From: Andrea Bianco Date: Sat, 28 Aug 2021 21:35:58 +0000 (+0200) Subject: Built motion from commit 2efa48e9.|2.5.34 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22angular-material.layout.css/%22?a=commitdiff_plain;h=d2e332c0fa5b52146296453de54a829eeeefdbac;p=motion2.git Built motion from commit 2efa48e9.|2.5.34 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 8423e89..2c393d9 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-28T20:08:55.546Z", + "time": "2021-08-28T21:29:44.669Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index f774686..a987636 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-28T20:08:55.546Z", + "time": "2021-08-28T21:29:44.669Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/public/app/forgot/i18n/de.json b/public/app/forgot/i18n/de.json index 53a27fb..5c4734e 100644 --- a/public/app/forgot/i18n/de.json +++ b/public/app/forgot/i18n/de.json @@ -1,15 +1,15 @@ { "FORGOTPASSWORD": { - "TITLE": "Ihr Passwort wiederherstellen", - "EMAIL_ADRESS": "E-mail Adresse", + "TITLE": "Passwort wiederherstellen", + "EMAIL_ADRESS": "E-Mail Adresse", "SEND_RESET_LINK": "LINK ZUM ZURÜCKSETZEN SENDEN", "GO_BACK": "Zurück zum Login", "LINK_SENT": "Link gesendet", - "LINNK_SENT_MESSAGE": "Eine e-Mail mit einem Link zum Zurücksetzen des Kennworts wurde an Ihre Adresse gesendet!", - "PASSWORD_RESET_ERROR": "Passwort Fehler zurücksetzen", + "LINNK_SENT_MESSAGE": "Eine E-Mail mit einem Link zum Zurücksetzen des Passwortes wurde an Ihre Adresse gesendet.", + "PASSWORD_RESET_ERROR": "Fehler beim Zurücksetzen des Passwortes", "ERRORS": { - "EMAIL_REQUIRED": "Im Feld E-Mail ist erforderlich", - "EMAIL_MUST_VALID": "E-Mail muss eine gültige e-mail Adresse" + "EMAIL_REQUIRED": "Eingabe E-Mail Adresse erforderlich", + "EMAIL_MUST_VALID": "Es muss eine gültige E-Mail Adresse eingegeben werden" } } } diff --git a/public/app/login/i18n/de.json b/public/app/login/i18n/de.json index c090dfa..bced170 100644 --- a/public/app/login/i18n/de.json +++ b/public/app/login/i18n/de.json @@ -1,16 +1,16 @@ { "LOGIN": { - "TITLE": "Melden Sie sich bei Ihrem Konto an", + "TITLE": "Bitte mit Ihrem Konto anmelden", "EMAIL": "E-Mail", "PASSWORD": "Passwort", - "REMEMBER_ME": "Erinnere Dich an Mich", + "REMEMBER_ME": "Anmeldedaten merken", "FORGOT_PASSWORD": "Passwort vergessen?", - "LOG_IN": "LOG IN", + "LOG_IN": "ANMELDEN", "OR": "Oder", - "WITH_GOOGLE": "Melden Sie sich mit Google", - "WITH_FACEBOOK": "Mit Facebook anmelden", + "WITH_GOOGLE": "Anmeldung mit Google", + "WITH_FACEBOOK": "Anmeldung mit Facebook", "DONT_HAVE_ACCOUNT": "Sie haben noch kein Konto?", - "CREATE_ACCOUNT": "Erstellen Sie ein Konto", + "CREATE_ACCOUNT": "Konto erstellen", "ERRORS": { "EMAIL_REQUIRED": "Pflichtfeld", "EMAIL_MUST_VALID": "Falsches Format", @@ -18,8 +18,8 @@ "USERNAME_REQUIRED": "Pflichtfeld" }, "USERNAME": "Benutzername", - "CANCEL": "Stornieren", - "SELECT": "Wählen", + "CANCEL": "Abbrechen", + "SELECT": "Auswählen", "TELEPHONES": "Telefone" } } diff --git a/public/app/main/apps/analytics/i18n/de.json b/public/app/main/apps/analytics/i18n/de.json index e60162b..e6b577a 100644 --- a/public/app/main/apps/analytics/i18n/de.json +++ b/public/app/main/apps/analytics/i18n/de.json @@ -13,7 +13,7 @@ "METRIC_REQUIRED": "Pflichtfeld", "COLUMN_REQUIRED": "Pflichtfeld", "VALUE_REQUIRED": "Pflichtfeld", - "CUSTOM_METRIC_REQUIRED": "benutzerdefinierte Metrik (erforderlich)", + "CUSTOM_METRIC_REQUIRED": "Pflichtfeld", "ALIAS_REQUIRED": "Pflichtfeld" }, "NEW_METRIC": "Neue Metrik", @@ -23,8 +23,8 @@ "SAVE": "Speichern", "BACK": "Zurück", "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Keine auswählen", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "TYPE": "Typ", "EXTRACTEDREPORTS": "Extrahierte Berichte", "DATE_RANGE_FROM": "Datum von", @@ -56,18 +56,18 @@ "GENERAL": "Allgemein", "FIELDS": "Felder", "CONDITION": "Bedingung", - "OPERATOR": "Betreiber", + "OPERATOR": "Operator", "GROUP": "Gruppe", "COLUMN": "Spalte", "VALUE": "Wert", "PREVIEW": "Vorschau", - "LIMITED_RESULT": "BEGRENZTES ERGEBNIS", + "LIMITED_RESULT": "Ergebins begrenzt", "NO_DATA": "Keine Daten", "CONDITIONS": "Bedingungen", "ALIAS": "Alias", "FUNCTION": "Funktion", "GROUP_BY": "Gruppieren nach", - "ORDER_BY": "Bestellung von", + "ORDER_BY": "Sortieren nach", "ADD_REPORTFIELD": "Feld hinzufügen", "EDIT_REPORTFIELD": "Feld bearbeiten", "DELETE_REPORTFIELD": "Feld löschen", @@ -75,12 +75,12 @@ "NO_METRIC_FOUND": "Keine Metrik gefunden", "NO_AVAILABLE_INFO": "keine Informationen verfügbar", "CUSTOM_METRIC": "Benutzerdefinierte Metrik", - "DELETE_EXTRACTEDREPORT": "Löschen extrahierte Berichte", + "DELETE_EXTRACTEDREPORT": "Extrahierte Berichte löschen", "EDIT_EXTRACTEDREPORT": "Extrahierte Berichte bearbeiten", - "DOWNLOAD_EXTRACTEDREPORT": "Herunterladen extrahierte Berichte", + "DOWNLOAD_EXTRACTEDREPORT": "Extrahierte Berichte herunterladen", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", + "OF": "von", "DELETE": "Löschen", "REPORTNAME": "Berichtsname", "SEND_IF_EMPTY": "Senden, wenn leer", diff --git a/public/app/main/apps/chat/i18n/de.json b/public/app/main/apps/chat/i18n/de.json index 4bc9896..02f4f10 100644 --- a/public/app/main/apps/chat/i18n/de.json +++ b/public/app/main/apps/chat/i18n/de.json @@ -2,12 +2,12 @@ "CHAT": { "AMAZONLEX": "Amazon Lex", "TEXT": "Text", - "TIMES": "Anzahl von Malen pro Interaktion", + "TIMES": "Anzahl der Zeiten pro Interaktion", "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", "AUTOREPLY": "Automatische Antwort", - "NEW_CHATDISPOSITION": "Neue Chat-Disposition", + "NEW_CHATDISPOSITION": "Neue Chat-Qualifizierung", "ENABLECUSTOMERATTACHMENT": "Kundenanhänge aktivieren", - "OFFLINE_CHAT_BUTTON": "Offline-Chat-Taste", + "OFFLINE_CHAT_BUTTON": "Button Chat offline", "OFFLINESTATUS": "Offline Status", "NAME": "Name", "CHATQUEUES": "Chat-Warteschlangen", @@ -15,29 +15,29 @@ "STRATEGY": "Strategie", "AGENT_TIMEOUT": "Agent Timeout", "DESCRIPTION": "Beschreibung", - "KEY": "Key", + "KEY": "Schlüssel", "ALIAS": "Alias-Name", "VARIABLE": "Variable", "INTERVAL": "Intervall", - "EDIT_CLOSE": "Bearbeiten Schließen", + "EDIT_CLOSE": "Bearbeitung abschließen", "TIMEZONE": "Zeitzone", "MESSAGE": "Nachricht", "ADVANCED": "Erweitert", "FORWARDTRANSCRIPT": "Transkript weiterleiten", "FORWARDTRANSCRIPTMESSAGE": "Transkript-Nachricht weiterleiten", - "SKIPMESSAGEBUTTON": "Nachrichtentaste überspringen", + "SKIPMESSAGEBUTTON": "Nachrichtenbutton überspringen", "EDIT_MESSAGE": "Nachricht bearbeiten", - "CONDITION_AGREEMENT": "Bedingungsvereinbarung", - "NONE": "Keine", + "CONDITION_AGREEMENT": "Konditionelle Vereinbarung", + "NONE": "Nichts", "PRIORITY": "Priorität", "ONLINESTATUS": "Online Status", - "UNMANAGEDSTATUS": "Nicht verwalteter Status", + "UNMANAGEDSTATUS": "Status nicht bearbeitet", "AUTOCLOSE": "Automatisches Schließen aktivieren", - "ENABLEUNMANAGEDNOTE": "Nicht verwaltete Nachricht aktivieren", - "UNMANAGEDMESSAGE": "Nachricht", + "ENABLEUNMANAGEDNOTE": "Unbearbeitete Nachricht aktivieren", + "UNMANAGEDMESSAGE": "Unbearbeitete Nachricht", "SKIPUNMANAGED": "Nachricht überspringen", "SENDUNMANAGED": "Nachricht senden", - "WEBSITESCRIPT": "Website-Script", + "WEBSITESCRIPT": "Webseiten-Skript", "DELETE_OFFLINEMESSAGE": "Löschen", "OFFLINEMESSAGES": "Offline Nachrichten", "FORWARD_OFFLINE": "Offline weiterleiten", @@ -45,25 +45,25 @@ "FORWARD_OFFLINE_ADDRESS": "Offline-Adresse weiterleiten", "CLOSINGFORM": "Formular schließen", "ENABLERATING": "Bewertung aktivieren", - "ENABLECUSTOMERWRITING": "Dem Kunden \"schreiben\" erlauben, bevor der Agent akzeptiert", + "ENABLECUSTOMERWRITING": "Kunde kann schreiben, bevor Chat akzeptiert wird", "ENABLEFEEDBACK": "Feedback aktivieren", "RATINGTYPE": "Bewertungstyp", - "CLOSINGMESSAGE": "Nachricht schließen", - "CLOSINGMESSAGEBUTTON": "Nachrichtentaste schließen", + "CLOSINGMESSAGE": "Abschluss Nachricht", + "CLOSINGMESSAGEBUTTON": "Button für Abschluss Nachricht", "RATINGSTARSNUMBER": "Anzahl der Bewertungssterne", "EDIT_GOTOIF": "GotoIf bearbeiten", "CONDITION": "Bedingung", - "TRUEPRIORITY": "Echte Priorität", + "TRUEPRIORITY": "Wahre Priorität", "FALSEPRIORITY": "Falsche Priorität", "VALUE": "Wert", "WEBSITEALIAS": "Website-Alias", "ERRORS": { "TEXT_REQUIRED": "Pflichtfeld", "SENDUNMANAGED_REQUIRED": "Pflichtfeld", - "SENDUNMANAGED_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "SKIPUNMANAGED_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{{{max}} haben", - "UNMANAGEDMESSAGE_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{{{max}} haben", - "WEBSITEALIAS_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{{{max}} haben", + "SENDUNMANAGED_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "SKIPUNMANAGED_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "UNMANAGEDMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "WEBSITEALIAS_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", "AGENT_REQUIRED": "Pflichtfeld", "QUEUE_REQUIRED": "Pflichtfeld", "CONDITION_REQUIRED": "Pflichtfeld", @@ -84,56 +84,56 @@ "TIMEOUT_REQUIRED": "Pflichtfeld", "REJECTURL_MUST_VALID_URL": "Falsches Format", "CLOSEURL_MUST_VALID_URL": "Falsches Format", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", "WAITINGMESSAGE_REQUIRED": "Pflichtfeld", "WAITINGTITLE_REQUIRED": "Pflichtfeld", - "KEY_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", + "KEY_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", "KEY_REQUIRED": "Pflichtfeld", - "WAITINGMESSAGE_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "WAITINGTITLE_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "HEADER_OFFLINE_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "CLOSINGQUESTION_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "TEXT_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", + "WAITINGMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "WAITINGTITLE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "HEADER_OFFLINE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "CLOSINGQUESTION_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "TEXT_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", "VALUE_REQUIRED": "Pflichtfeld", - "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "OFFLINEMESSAGEBODY_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "PLACEHOLDERMESSAGE_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "NOTETITLE_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", - "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "OFFLINEMESSAGEBODY_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "PLACEHOLDERMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "NOTETITLE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", "FONTSIZE_REQUIRED": "Pflichtfeld", "COMMAND_REQUIRED": "Pflichtfeld", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", "NAME_MUST_VALID_PATTERN": "Falsches Format", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", - "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "VERTICALPOSITION_REQUIRED": "Pflichtfeld", - "CUSTOMERALIAS_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", + "CUSTOMERALIAS_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", "TAG_REQUIRED": "Pflichtfeld", - "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "MESSAGEFONTSIZE_REQUIRED": "Pflichtfeld", "AGENTALIAS_REQUIRED": "Pflichtfeld", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "AGENTTRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", "CUSTOMERALIAS_REQUIRED": "Pflichtfeld", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "QUEUETRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "SYSTEMALIAS_MAX_LENGTH": "Der Wert muss eine maximale Länge gleich {{max}} haben", + "SYSTEMALIAS_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", "SYSTEMALIAS_REQUIRED": "Pflichtfeld", "ACCESSKEYID_REQUIRED": "Pflichtfeld", "BOTNAME_REQUIRED": "Pflichtfeld", @@ -145,18 +145,18 @@ "PROJECTID_REQUIRED": "Pflichtfeld", "VIDAOOTOPIC_REQUIRED": "Pflichtfeld" }, - "CM_FIELD": "Kontakt Manager Feld", - "CHATPROACTIVEACTIONS": "Proaktive Aktionen", - "NEW_CHATPROACTIVEACTION": "Neue proaktive Aktion", - "EDIT_CHATPROACTIVEACTION": "Proaktive Aktion bearbeiten", - "DELETE_CHATPROACTIVEACTION": "Proaktive Aktion löschen", - "ADD_CHATPROACTIVEACTION": "Proaktive Aktion hinzufügen", - "NO_CHATPROACTIVEACTION_AVAILABLE": "Keine proaktiven Aktionen verfügbar", + "CM_FIELD": "Kontaktmanager-Feld", + "CHATPROACTIVEACTIONS": "Proaktive Anfragen", + "NEW_CHATPROACTIVEACTION": "Neue proaktive Anfrage", + "EDIT_CHATPROACTIVEACTION": "Proaktive Anfrage bearbeiten", + "DELETE_CHATPROACTIVEACTION": "Proaktive Anfrage löschen", + "ADD_CHATPROACTIVEACTION": "Proaktive Anfrage hinzufügen", + "NO_CHATPROACTIVEACTION_AVAILABLE": "Keine proaktiven Anfragen verfügbar", "NO_OFFLINEMESSAGE_AVAILABLE": "Keine Offline-Nachrichten verfügbar", - "MOUSEOVER": "Maus über", + "MOUSEOVER": "Mouse-Over", "TIMEOUT": "Timeout", "TYPE": "Typ", - "SELECTOR": "Wählschalter", + "SELECTOR": "Selektion", "AGENT": "Agent", "GOTO": "Goto", "GOTOIF": "GotoIf", @@ -164,7 +164,7 @@ "QUEUE": "Warteschlange", "BUILDER": "Builder", "PREVIEW": "Vorschau", - "EDIT_AGENT": "Agent bearbeiten", + "EDIT_AGENT": "Agenten bearbeiten", "EDIT_QUEUE": "Warteschlange bearbeiten", "EDIT_GOTO": "Goto bearbeiten", "EDIT_GOTOIf": "GotoIf bearbeiten", @@ -186,18 +186,18 @@ "LIST": "Liste", "SNIPPET": "Snippet", "FORMS": "Formulare", - "UP": "Bis", - "DOWN": "Unten", - "COLLAPSE": "Zusammenklappen", - "PROACTIVEACTIONS": "Proaktive Aktionen", - "DISPOSITIONS": "Dispositionen", + "UP": "Nach Oben", + "DOWN": "Nach Unten", + "COLLAPSE": "Einklappen", + "PROACTIVEACTIONS": "Proaktive Anfragen", + "DISPOSITIONS": "Qualifizierungen", "WEBHOOKS": "WebHooks", "ACTIONS": "Aktionen", "FIDELITY": "Treue", - "APPEARANCE": "Aussehen", + "APPEARANCE": "Darstellung", "MAINCOLOR": "Hauptfarbe", "FOCUSCOLOR": "Fokusfarbe", - "BUTTONCOLOR": "Tastenfarbe", + "BUTTONCOLOR": "Buttonfarbe", "HEADERSHAPE": "Kopfzeilenform", "ANIMATION": "Animation", "DEFAULT": "Standard", @@ -210,65 +210,65 @@ "LABELS": "Labels", "HEADER_ONLINE": "Online-Kopfzeile", "ONLINE_MESSAGE": "Online Nachricht", - "NAME_TITLE": "Name Eingabebezeichnung", - "USERNAME_PLACEHOLDER": "Benutzername Eingabe Platzhalter", - "EMAIL_TITLE": "E-Mail-Eingabe Label", - "EMAIL_PLACEHOLDER": "Platzhalter für E-Mail-Eingabe", - "START_CHAT_BUTTON": "'Chat starten' Taste", - "AGENTS_BUSY": "Meldung für besetzte Agenten", + "NAME_TITLE": "Name Titel", + "USERNAME_PLACEHOLDER": "Platzhalter für Nutzernamen", + "EMAIL_TITLE": "E-Mail Titel", + "EMAIL_PLACEHOLDER": "Platzhalter für E-Mail Adresse", + "START_CHAT_BUTTON": "'Chat starten' Button", + "AGENTS_BUSY": "Agenten besetzt", "HEADER_OFFLINE": "Offline-Kopfzeile", "OFFLINE_MESSAGE": "Offline Nachricht", - "MESSAGE_TITLE": "Nachrichtenbezeichnung", - "ENQUIRY_MESSAGE_PLACEHOLDER": "Platzhalter für die Eingabe von Anfragenachrichten", - "ENQUIRY_BUTTON": "Anfrage-Taste Text", + "MESSAGE_TITLE": "Nachricht Titel", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Platzhalter für Nachrichteneingabe", + "ENQUIRY_BUTTON": "Anfrage-Button", "RATING_MESSAGE": "Bewertungsnachricht", - "RATING_SEND": "Bewertung Senden Tasten-Text", - "RATING_SKIP": "Bewertung Überspringen Tasten-Text", + "RATING_SEND": "Button Bewertung senden", + "RATING_SKIP": "Button Bewertung überspringen", "ONLINE": "Online", "OFFLINE": "Offline", - "PROACTIVE": "Proaktive", + "PROACTIVE": "Proaktiv", "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Methode", + "ACCEPTMETHOD": "Methode akzeptieren", "ACCEPTURL": "URL akzeptieren", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "Schliessen", + "CLOSE": "Schließen", "CLOSEMETHOD": "Methode schließen", "CLOSEURL": "URL schließen", - "EMBEDDING": "Einbettung", + "EMBEDDING": "Einbetten", "GENERAL": "Allgemein", "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "BACK": "Zurück", "HELP": { - "MAPKEY": "Das folgende Motion Contact Manager-Feld:", - "FROMKEY": "Wird in Ihrem Motion Chat-Snippet wie folgt zugeordnet:", - "TOKEN": "Automatisch generiertes Token, das im Skript verwendet wird", + "MAPKEY": "Das folgende Feld aus dem Kontaktmanager:", + "FROMKEY": "wird in dem Chat-Snippet wie folgt zugeordnet:", + "TOKEN": "Automatisch generierter Token zur Verwendung im Skript", "COPYSCRIPTTOCLIPBOARD": "Kopieren Sie den Skripttext und fügen Sie ihn in Ihre Website ein", "FORWARD_OFFLINE": "Sie können mehrere durch Kommas getrennte Adressen hinzufügen (z. B. john.doe@xcally.com, jane.miller@xcally.com)", "MOTIONADDRESS": "Das Feld muss das folgende Format haben: ≪protocol>://[:]. Beispiel: https://X.Y.Z.W", "MOTIONPROXY": "Das Feld muss das folgende Format haben: ≪Protocol>:// ≪IP-Adresse>: ≪port>]. Beispiel: https://X.Y.Z.W", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "LIST": "Contact Manager-Liste, die zum Zuordnen von Kontakten verwendet wird", + "LIST": "Liste für die Zuordnung aus dem Kontaktmanager", "KEY": "Website-Kurzname (5 Zeichen), der auf der Registerkarte \"Agent\" angezeigt wird", - "INTEVAL": "Wird aus der Liste der verfügbaren Intervalle ausgewählt", - "TIMEZONE": "Wählen Sie eine aus der Liste aus (Standard = lokale Zeitzone)", - "ENABLERATING": "Aktivieren Sie es, wenn Sie möchten, dass der Webbesucher die Interaktion am Ende bewerten kann", - "ENABLEFEEDBACK": "Aktivieren Sie es, wenn Sie möchten, dass der Webbesucher am Ende ein Feedback (bis zu 150 Zeichen) senden kann", - "FORWARDTRANSCRIPT": "Aktivieren Sie diese Option, wenn der Webbesucher aufgefordert wird, ein Chat-Protokoll per E-Mail zu erhalten", - "AUTOCLOSE": "Aktivieren Sie diese Option, wenn Chat-Sitzungen als nicht verwaltet geschlossen werden sollen, wenn kein Agent verfügbar ist. Weitere Informationen finden Sie unter: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", - "ENABLEUNMANAGEDNOTE": "Aktivieren Sie diese Option, wenn dem Besucher eine Nachricht angezeigt werden soll, wenn alle Agenten besetzt sind und der Chat nicht mehr verwaltet wird", - "ENABLECUSTOMERWRITING": "Aktivieren Sie es, wenn der Chat gestartet werden soll, ohne auf einen verfügbaren Agenten zu warten (Achtung: Wenn Sie ihn aktivieren, werden Ihre Chats niemals nicht verwaltet). Weitere Informationen finden Sie unter: https://wiki.xcallymotion.com/display/XMV/ Chat + Websites # ChatWebsites-Snippet ", - "INTERVAL": "Wählen Sie eins aus der Liste aus", + "INTEVAL": "Wählen aus der Liste der verfügbaren Intervalle", + "TIMEZONE": "Zeitzone auswählen (Standard = lokale Zeitzone)", + "ENABLERATING": "Bewertung nach Chat durch Kunden aktivieren", + "ENABLEFEEDBACK": "Feedback nach Chat durch Kunden aktivieren (Max. 150 Zeichen)", + "FORWARDTRANSCRIPT": "Chatprotokoll nach Abschluss per E-Mail senden", + "AUTOCLOSE": "Aktivieren Sie diese Option, wenn Chat-Sitzungen als nicht bearbeitet geschlossen werden sollen, sofern kein Agent verfügbar ist.", + "ENABLEUNMANAGEDNOTE": "Automatische Nachricht an den Kunden, wenn alle Agenten besetzt sind und somit der Chat nicht verfügbar ist", + "ENABLECUSTOMERWRITING": "Legt fest, ob der Kunde bereits im Chat schreiben kann, bevor ein Agent den Chat entgegen nimmmt. Hinweis: Dadurch kein Status \"unbearbeitet\"", + "INTERVAL": "Bitte aus der Liste wählen", "HIDEWHENOFFLINE": "Snippet ausblenden, wenn offline", - "AGENTIDENTIFIER": "Repräsentiert die Agentenkennung innerhalb der Chat-Sitzung im Snippet", + "AGENTIDENTIFIER": "Agentenkennung innerhalb der Chat-Sitzung im Snippet", "WEBSITEALIAS": "Ein Präfix, mit dem der Agentenname (Präfix + Agenten-ID) erstellt wird, der dem Webbesucher während der Chat-Sitzung angezeigt wird", - "VERTICALPOSITION": "Stellt den Abstand in Prozent von oben dar", - "WELCOMEMESSAGE": "Lassen Sie das Feld leer, wenn Sie keine Willkommensnachricht senden möchten", - "MANDATORYDISPOSITION": "Obligatorische Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pausieren Sie die Verwendung, wenn die obligatorische Disposition aktiviert ist" + "VERTICALPOSITION": "Prozentualer Abstand in Prozent vom oberen Bildschirmrand", + "WELCOMEMESSAGE": "Leer lassen, um keine Nachricht zu senden", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "PausenID bei erforderlicher Qualifizierung" }, "ADDRESS": "Adresse", "ONLINESTATE": "Online Status", @@ -276,88 +276,88 @@ "RATINGSTATE": "Bewertungsstatus", "ENQUIRY": "Anfrage", "OFFLINETEMPLATE": "Offline Vorlage", - "CHATDISPOSITIONS": "Chat-Dispositionen", - "NO_CHATDISPOSITION_AVAILABLE": "Keine Chat-Dispositionen verfügbar", - "ADD_CHATDISPOSITION": "Chat Disposition hinzufügen", + "CHATDISPOSITIONS": "Chat-Qualifizierungen", + "NO_CHATDISPOSITION_AVAILABLE": "Keine Qualifizierung verfügbar", + "ADD_CHATDISPOSITION": "Qualifizierung hinzufügen", "DELETE": "Löschen", - "EDIT_CHATDISPOSITION": "Chat-Disposition bearbeiten", - "DELETE_CHATDISPOSITION": "Chat-Disposition löschen", + "EDIT_CHATDISPOSITION": "Qualifizierung bearbeiten", + "DELETE_CHATDISPOSITION": "Qualifizierung löschen", "CHAT": "Chat", "ID": "ID", "NEW_CHATQUEUE": "Neue Chat-Warteschlange", "NEW_CHATWEBSITE": "Neue Chat-Website", - "ROUNDED": "Abgerundet", - "SQUARED": "Quadratisch", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "ROUNDED": "Rundes Design", + "SQUARED": "Eckiges Design", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", + "OF": "von", "CONTACT": "Kontakt", "STARTEDAT": "Gestartet am", "STATUS": "Status", "CLOSED": "Geschlossen", - "OPENED": "Öffnen", - "OPEN": "Öffnen", + "OPENED": "Geöffnet", + "OPEN": "Offen", "ACCOUNT": "Konto", "INTERACTION": "Interaktion", "INTERACTIONS": "Interaktionen", "WEBSITE": "Website", - "ALL": "Alle", - "SELECT_STATUS": "Wählen Sie einen Status", + "ALL": "Alles", + "SELECT_STATUS": "Status auswählen", "FILTER": "Filter", "FILTERS": "Filter", "TEAMADD_CHATQUEUE": "Team zur Chat-Warteschlange hinzufügen", - "AGENTADD_CHATQUEUE": "Agent zur Chat-Warteschlange hinzufügen", + "AGENTADD_CHATQUEUE": "Agenten zur Chat-Warteschlange hinzufügen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "CLOSEDAT": "Geschlossen am", - "DISPOSITION": "Disposition", + "DISPOSITION": "Qualifizierung", "CREATEDAT": "Erstellt am", "NOTES": "Notizen", "NO_INTERACTION_AVAILABLE": "Keine Interaktionen verfügbar", - "SELECTED_WEBSITE": "Wählen Sie eine Website", + "SELECTED_WEBSITE": "Ausgewählte Webseite", "GOTOP": "Gotop", "EDIT_GOTOP": "Gotop bearbeiten", - "SELECT_WEBSITE": "Wählen Sie eine Website", + "SELECT_WEBSITE": "Webseite auswählen", "INFO": "Info", "OFFLINEMESSAGES_CHATWEBSITE": "Zu Offline-Nachrichten gehen", - "WAITINGTITLE": "Wartetitel", - "WAITINGMESSAGE": "Wartende Nachricht", + "WAITINGTITLE": "Titel während Warten", + "WAITINGMESSAGE": "Wartenachricht", "RATING": "Bewertung", "NO_RATINGVALUE": "Keine Bewertung", - "AGENTSADD_QUEUE": "Agent zur Chat-Warteschlange hinzufügen", + "AGENTSADD_QUEUE": "Agenten zur Chat-Warteschlange hinzufügen", "QUEUES": "Warteschlangen", "LOGGED_IN": "Angemeldet", - "PAUSED": "Pausiert", + "PAUSED": "in Pause", "READY": "Bereit", - "WAITING": "Warten", - "WRITING": "Schreiben", + "WAITING": "Wartezustand", + "WRITING": "am Schreiben", "MAIL": "E-Mail", "SMS": "SMS", - "OPENCHANNEL": "Openchannel", + "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", "PAUSE": "Pause", "REALTIME": "Echtzeit", "AGENTS": "Agenten", "FULLNAME": "Vollständiger Name", - "INTERNAL": "Interne", + "INTERNAL": "Intern", "PHONE_STATE": "Telefonstatus", "PHONE_STATUS": "Telefonstatus", "LOGOUT": "Abmelden", "UNPAUSE": "Pause beenden", - "AGENTADD_QUEUE": "Agent zur Chat-Warteschlange hinzufügen", + "AGENTADD_QUEUE": "Agenten zur Chat-Warteschlange hinzufügen", "DEFAULT_PAUSE": "Standard Pause", "UNKNOWN": "Unbekannt", - "UNREGISTERED": "Unregistrierte", + "UNREGISTERED": "Nicht registriert", "UNAVAILABLE": "Nicht verfügbar", "NOT_INUSE": "Nicht in Verwendung", "REACHABLE": "Erreichbar", - "IN_USE": "Im Einsatz", - "VOICE": "Sprache", + "IN_USE": "In Verwendung", + "VOICE": "Anrufe", "NO_AGENT_ONLINE": "Kein Agent Online", - "GOTOREALTIME_CHATQUEUE": "Go to Echtzeit-Chat-Warteschlange", + "GOTOREALTIME_CHATQUEUE": "Zur Echtzeit-Warteschlange für Chat gehen", "PARTIALPAUSE": "Teilpause", "BUSY": "Besetzt", "TIMER": "Timer", @@ -365,39 +365,39 @@ "CAPACITY": "Kapazität", "TAGS": "Tags", "SHOWAGENTAVATAR": "Persönlichen Agenten-Avatar anzeigen", - "AGENTAVATAR": "Agent Avatar", - "SPYINTERACTION": "Spion", + "AGENTAVATAR": "Agenten-Avatar", + "SPYINTERACTION": "Mitlesen", "INTERACTIONS_CHATWEBSITE": "Zu den Interaktionen gehen", "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", - "CLOSINGQUESTION": "Frage schließen", + "CLOSINGQUESTION": "Abschlussfrage", "WEBSCRIPT": "Webskript", - "NO_CHATCANNEDANSWER_AVAILABLE": "Keine vordefinierten Antworten verfügbar", - "NEW_CHATCANNEDANSWER": "Neue vordefinierte Antwort", - "ADD_CHATCANNEDANSWER": "Vordefinierte Antwort hinzufügen", - "EDIT_CHATCANNEDANSWER": "Vordefinierte Antwort bearbeiten", - "DELETE_CHATCANNEDANSWER": "Vordefinierte Antwort löschen", - "OFFLINEMESSAGESUBJECT": "Betreff der Nachricht", - "OFFLINEMESSAGEBODY": "Nachrichtentext", - "FORMSUBMITSUCCESSMESSAGE": "Erfolgsmeldung beim Absenden des Formulars", - "FORMSUBMITFAILUREMESSAGE": "Fehlermeldung beim Absenden des Formulars", - "PLACEHOLDERMESSAGE": "Platzhalter für Nachrichten", + "NO_CHATCANNEDANSWER_AVAILABLE": "Keine Textvorlagen verfügbar", + "NEW_CHATCANNEDANSWER": "Neue Textvorlage", + "ADD_CHATCANNEDANSWER": "Textvorlage hinzufügen", + "EDIT_CHATCANNEDANSWER": "Textvorlage bearbeiten", + "DELETE_CHATCANNEDANSWER": "Textvorlage löschen", + "OFFLINEMESSAGESUBJECT": "Betreff der Nachricht bei Offline", + "OFFLINEMESSAGEBODY": "Test der Nachricht bei Offline", + "FORMSUBMITSUCCESSMESSAGE": "Meldung Formular erfolgreich gesendet", + "FORMSUBMITFAILUREMESSAGE": "Meldung Fehler beim Senden des Formulars", + "PLACEHOLDERMESSAGE": "Nachricht für Platzhalter", "NOTETITLE": "Titel der Notiz", "DELETE_INTERACTION": "Interaktion löschen", "FONTSIZE": "Schriftgröße", "TEXTCOLOR": "Textfarbe", - "COMMAND": "Befehl", + "COMMAND": "Eingabe", "EDIT_SYSTEM": "System bearbeiten", "SYSTEM": "System", "NOTIFICATION": "Benachrichtigung", "NOTIFICATIONSHAKE": "Schütteln", - "NOTIFICATIONSOUND": "Ton", + "NOTIFICATIONSOUND": "Klingeln", "NOTIFICATIONTEMPLATE": "Vorlage", - "HIDEWHENOFFLINE": "Ausblenden", - "INSERT_MESSAGE_HERE": "Fügen Sie hier Ihre Textnachricht ein", + "HIDEWHENOFFLINE": "Ausblenden, wenn offline", + "INSERT_MESSAGE_HERE": "Nachricht hier eingeben", "AGENTALIAS": "Agent Alias", "AGENTFULLNAME": "Vollständiger Name des Agenten", "AGENTIDENTIFIER": "Identifikator", - "WAITFORTHEASSIGNEDAGENT": "Warten auf den zugewiesenen Agenten", + "WAITFORTHEASSIGNEDAGENT": "Warten auf den zugewiesenen Mitarbeiter", "ALIGNMENT": "Ausrichtung", "BOTTOM_RIGHT": "Unten rechts", "LEFT": "Links", @@ -415,7 +415,7 @@ "CUSTOMERALIAS": "Kunden-Alias", "EDIT_TAG": "Tag bearbeiten", "TAG": "Tag", - "AGENTADD_CHATWEBSITE": "Agent zur Chat-Website hinzufügen", + "AGENTADD_CHATWEBSITE": "Agenten zur Chat-Website hinzufügen", "BACKGROUNDCOLOR": "Hintergrundfarbe", "MESSAGEFONTSIZE": "Schriftgröße der Nachricht", "AGENTTRANSFER": "Agententransfer", @@ -423,32 +423,32 @@ "DIALOGFLOW": "Dialogflow", "EDIT_DIALOGFLOW": "Dialogflow bearbeiten", "LANGUAGE": "Sprache", - "QUEUETRANSFER": "Warteschlangenübertragung", + "QUEUETRANSFER": "Transfer in Warteschlange", "QUEUETRANSFERTIMEOUT": "Timeout bei der Warteschlangenübertragung", "SYSTEMALIAS": "Systemalias", "SYSTEMAVATAR": "System-Avatar", "TRANSFER": "Transfer", "WELCOMEMESSAGE": "Willkommensnachricht", - "ENABLECUSTOMERCHECKMARKS": "Aktivieren vom Kunden gelieferten / gelesenen Benachrichtigungen", - "CANNEDANSWERS": "Vordefinierte Antworten", - "CHATCANNEDANSWERS": "Vordefinierte Antworten", + "ENABLECUSTOMERCHECKMARKS": "Bestätigung Nachricht erhalten/gelesen", + "CANNEDANSWERS": "Textvorlagen", + "CHATCANNEDANSWERS": "Textvorlagen", "DOWNLOAD_INTERACTION": "Herunterladen", - "LOGIN_TIME": "Login-Zeit", - "PAUSE_TIME": "Pausenzeit", + "LOGIN_TIME": "Zeit angemeldet", + "PAUSE_TIME": "Zeit in Pause", "ACCESSKEYID": "Zugangsschlüssel-ID", - "BOTNAME": "Bot-Name", + "BOTNAME": "Botname", "EDIT_AMAZONLEX": "Amazon Lex bearbeiten", "LEXREGION": "Region", "SECRETACCESSKEY": "Geheimer Zugangsschlüssel", - "TEAMS_ASSOCIATION": "Teams Verband", - "MANDATORYDISPOSITION": "Obligatorische Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pausieren Sie die Verwendung, wenn die obligatorische Disposition aktiviert ist", - "ENABLESENDBUTTON": "Sendetaste aktivieren", + "TEAMS_ASSOCIATION": "Teamzuweisung", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "PausenID, wenn Qualifizierung erforderlich", + "ENABLESENDBUTTON": "Senden-Button aktivieren", "FEEDBACKTITLE": "Feedback-Titel", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung läuft", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", - "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", + "DOWNLOAD_WITH_ATTACHMENTS": "Herunterladen inkl. Anhänge", "LASTMESSAGE": "Letzte Nachricht", "VIDAOO": "Vidaoo", "VIDAOOAPIKEY": "Vidaoo Api Key", @@ -458,14 +458,14 @@ "CLIENTEMAIL": "Kunden-E-Mail", "DIALOGFLOWV2": "Dialogflow V2", "EDIT_DIALOGFLOWV2": "Dialogflow V2 bearbeiten", - "PRIVATEKEY": "Privat Key", + "PRIVATEKEY": "Privater Schlüssel", "PROJECTID": "Projekt-ID", "EMAIL_ACCOUNT": "Email-Konto", "OPEN_NEW_INTERACTION": "Neue Interaktion öffnen", - "SUBJECT": "Gegenstand", + "SUBJECT": "Betreff", "ADD_NOTE": "Notiz hinzufügen", - "CANNED_ANSWER_NOT_FOUND": "Es wurden keine vordefinierten Antworten gefunden", - "NOTE": "Hinweis", + "CANNED_ANSWER_NOT_FOUND": "Keine Textvorlagen gefunden", + "NOTE": "Notiz", "VIDAOOMETADATA": "Vidaoo-Metadaten", "VIDAOONOTE": "Vidaoo-Hinweis", "VIDAOOTOPIC": "Vidaoo-Thema" diff --git a/public/app/main/apps/contactmanager/i18n/de.json b/public/app/main/apps/contactmanager/i18n/de.json index da8b00a..3c27f23 100644 --- a/public/app/main/apps/contactmanager/i18n/de.json +++ b/public/app/main/apps/contactmanager/i18n/de.json @@ -1,8 +1,8 @@ { "CONTACTMANAGER": { - "VOICEQUEUEID": "Sprachwarteschlange ID", - "CAMPAIGNID": "Kampagne ID", - "STATE": "Zustand", + "VOICEQUEUEID": "ID Warteschlange für Sprachanrufe", + "CAMPAIGNID": "Kampagnen-ID", + "STATE": "Status", "NAME": "Name", "LISTS": "Listen", "UNIQUEID": "Eindeutige ID", @@ -11,8 +11,8 @@ "ENDTIME": "Endzeit", "MOTION_BULL": "Motion Bull", "HOPPER": "Hopper", - "FINAL": "Hopper Final", - "HISTORY": "Hopper Geschichte", + "FINAL": "Hopper final", + "HISTORY": "Hopper historisch", "SCHEDULEDAT": "Geplant am", "SEARCH_FOR_ANYONE": "Suche", "EDIT_LIST": "Liste bearbeiten", @@ -21,30 +21,30 @@ "DELETE_HOPPER": "Hopper löschen", "RELOAD": "Neu laden", "NO_COMPANIES": "Kein Unternehmen", - "NO_AVAILABLE_ITEMS": "Keine verfügbaren Artikel", + "NO_AVAILABLE_ITEMS": "Keine Einträge verfügbar", "ADD": "Hinzufügen", "ERRORS": { - "NAME_REQUIRED": "Der Name ist erforderlich", - "FIRSTNAME_REQUIRED": "Der Vorname ist erforderlich", - "PHONE_REQUIRED": "Die Telefonnummer ist erforderlich", + "NAME_REQUIRED": "Name ist erforderlich", + "FIRSTNAME_REQUIRED": "Vorname ist erforderlich", + "PHONE_REQUIRED": "Telefonnummer ist erforderlich", "ALIAS_REQUIRED": "Alias ist erforderlich", - "VALUE_REQUIRED": "Der Wert ist erforderlich", + "VALUE_REQUIRED": "Wert ist erforderlich", "EMAIL_MUST_VALID": "Falsches Format", - "PHONEBAR_API": "Prüfen, ob die MotionBar ausgeführt wird und der Fernbedienungsschalter für den Agenten eingeschaltet ist", + "PHONEBAR_API": "Statusprüfung für die MotionBar und des Remote-Switches für den Agenten", "ACTIONTYPE_REQUIRED": "Pflichtfeld", "CLICKTOACTION_REQUIRED": "Pflichtfeld" }, "DESCRIPTION": "Beschreibung", - "DISPOSITION": "Disposition", - "DISPOSITIONS": "Dispositionen", - "VOICEDISPOSITIONS": "Sprachdispositionen", - "NEW_VOICEDISPOSITION": "Neue Sprachdisposition", + "DISPOSITION": "Qualifizierung", + "DISPOSITIONS": "Qualifizierungen", + "VOICEDISPOSITIONS": "Anrufqualifizierungen", + "NEW_VOICEDISPOSITION": "Neue Anrufqualifizierung", "CUSTOM_FIELDS": "Benutzerdefinierte Felder", "ADD_LIST": "Liste hinzufügen", "BACK": "Zurück", "SELECTED": "Ausgewählt", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Keine auswählen", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "COMPANIES": "Unternehmen", "EDIT_COMPANY": "Unternehmen bearbeiten", "DELETE_COMPANY": "Unternehmen löschen", @@ -76,7 +76,7 @@ "STREET": "Straße", "POSTALCODE": "Postleitzahl", "DELETE": "Löschen", - "DELETE_ALL": "Alle Löschen", + "DELETE_ALL": "Alles Löschen", "CONTACTMANAGER": "Kontaktmanager", "ID": "ID", "SETTINGS": "Einstellungen", @@ -95,17 +95,17 @@ "NEW_CONTACT": "Neuer Kontakt", "NEW_TAG": "Neuer Tag", "UPLOAD_CONTACTS": "Kontakte hochladen", - "FINISH": "Fertig", - "SUCCESS": "Erfolgreich", + "FINISH": "Beenden", + "SUCCESS": "Erfolg", "FAILURE": "Fehler", "ALL_CONTACTS": "Alle Kontakte", "NEW_CUSTOMFIELD": "Neues benutzerdefiniertes Feld", - "NO_VOICEDISPOSITION_AVAILABLE": "Keine Sprachdispositionen verfügbar", - "ADD_VOICEDISPOSITION": "Sprachdisposition hinzufügen", - "EDIT_VOICEDISPOSITION": "Sprachdisposition bearbeiten", - "DELETE_VOICEDISPOSITION": "Sprachdisposition löschen", - "VAT": "Mwst.", - "COMPANYID": "Ihre Unternehmens-ID", + "NO_VOICEDISPOSITION_AVAILABLE": "Keine Anrufqualifizierung verfügbar", + "ADD_VOICEDISPOSITION": "Anrufqualifizierung hinzufügen", + "EDIT_VOICEDISPOSITION": "Anrufqualifizierung bearbeiten", + "DELETE_VOICEDISPOSITION": "Anrufqualifizierung löschen", + "VAT": "Ust-ID.", + "COMPANYID": "Unternehmens-ID", "WEBSITE": "Website", "EMAIL_DOMAIN": "E-Mail Domain", "ADDRESS": "Adresse", @@ -116,12 +116,12 @@ "GOTOCONTACTS_COMPANY": "Kontakte anzeigen", "ADD_AGENT_TO_LIST": "Agenten zur Liste hinzufügen", "AGENTADD_LIST": "Agenten zur Liste hinzufügen", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "NONE": "Keine", + "NO_AVAILABLE_INFO": "Keine verfügbaren Informationen", + "NONE": "Nichts", "FULLNAME": "Vollständiger Name", - "CHECK_DUPLICATES": "Duplikate prüfen", + "CHECK_DUPLICATES": "auf Duplikate prüfen", "DUPLICATES": "Duplikate", - "UPLOAD_CSV": "Hochladen von CSV", + "UPLOAD_CSV": "Hochladen von CSV-Datei", "TAG": "Tag", "UPLOAD": "Hochladen", "ALL_AGENTS": "Alle Agenten", @@ -129,7 +129,7 @@ "DATE_OF_BIRTH": "Geburtsdatum", "DATEOFBIRTH": "Geburtsdatum", "NOTES": "Notizen", - "EXPORTCSVCONTACTS_LIST": "In CSV exportieren", + "EXPORTCSVCONTACTS_LIST": "In CSV-Datei exportieren", "GOTO_LIST": "Kontakte anzeigen", "GOTO_COMPANY": "Kontakte anzeigen", "REQUIRED": "Erforderlich", @@ -142,35 +142,35 @@ "SESSIONS": "Sitzungen", "AGENT": "Agent", "PROJECT": "Projekt", - "SELECT_LIST": "Wählen Sie eine Liste aus", - "SELECT_COMPANY": "Wählen Sie ein Unternehmen aus", - "SELECT_TAGS": "Wählen Sie ein oder mehrere Tags aus", + "SELECT_LIST": "Liste auswählen", + "SELECT_COMPANY": "Unternehmen auswählen", + "SELECT_TAGS": "Tags auswählen", "HELP": { - "PHONEBAR_API": "Um Click-to-Call zu aktivieren, geben Sie eine Telefonnummer ein und überprüfen Sie, ob der Fernbedienungsschalter für den Agenten eingeschaltet ist", - "PHONEBAR_API_MESSAGE": "Um Click-to-Call zu aktivieren, geben Sie eine Telefonnummer ein und überprüfen Sie, ob der Fernbedienungsschalter für den Agenten eingeschaltet ist" + "PHONEBAR_API": "Um Click-to-Call zu aktivieren, geben Sie eine Telefonnummer ein und überprüfen Sie, ob der Remote-Switch für den Agenten eingeschaltet ist", + "PHONEBAR_API_MESSAGE": "Um Click-to-Call zu aktivieren, geben Sie eine Telefonnummer ein und überprüfen Sie, ob der Remote-Switch für den Agenten eingeschaltet ist" }, "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", + "OF": "von", "SOCIAL": "Social", "ROW": "Reihe", - "EXPORT_ERRORS": "Fehler exportieren", + "EXPORT_ERRORS": "Fehler-Log exportieren", "UPLOAD_COMPLETED": "Hochladen abgeschlossen", "STOP": "Stopp", - "SELECT_FILE": "Datei aussuchen", + "SELECT_FILE": "Datei auswählen", "IMPORT_CONTACTS": "Kontakte importieren", "MOTIONDIALER": "Motion Bull", "PREFIX": "Vorwahl wählen", "PRIORITY": "Priorität", "USERID": "Agent-ID abrufen", - "CUSTOMER_JOURNEY": "Kundenreise", - "SELECT_TAG": "Wählen Sie Tags aus", + "CUSTOMER_JOURNEY": "Kundenhistorie", + "SELECT_TAG": "Tag auswählen", "ALL": "Alle", "BILLINGINFORMATION": "Abrechnungsdaten", "COMPANY_FISCAL_TYPE": "Unternehmenssteuerart", "CREATE": "Erstellen", "EUROPE": "Europa", - "EXPIREDAY": "Ablauftage", + "EXPIREDAY": "Ablauftag", "FLATDISCOUNT": "Firmenrabatt", "INVOICEARTICLE": "Gesetzliche Artikel", "ISOCODE": "Nationaler ISO-Code", @@ -180,9 +180,9 @@ "RELATIONSHIPCOMPANY": " ... mit", "SDICODE": "SDI-Code", "SOCIAL_CAPITAL": "Aktienkapital", - "VATNUMBER_CF": "Codice Fiscale / VAT", - "RECALLME": "Ruf mich zurück", + "VATNUMBER_CF": "Umsatzsteuer Identnummer / VAT", + "RECALLME": "Rückruf anfordern", "ACTIONTYPE": "Aktionstyp", - "CLICKTOACTION": "Zur Aktion klicken" + "CLICKTOACTION": "Klicken für Aktion" } } diff --git a/public/app/main/apps/dashboards/i18n/de.json b/public/app/main/apps/dashboards/i18n/de.json index df9fabe..dbfb7c7 100644 --- a/public/app/main/apps/dashboards/i18n/de.json +++ b/public/app/main/apps/dashboards/i18n/de.json @@ -1,10 +1,10 @@ { "DASHBOARDS": { - "HOME": "Home", + "HOME": "Startseite", "CHAT": "Chat", - "MAIL": "Email", - "SMS": "Sms", - "OPENCHANNEL": "Open Channel", + "MAIL": "E-Mail", + "SMS": "SMS", + "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", "RATING": "Bewertung", "FEEDBACK": "Feedback", @@ -15,54 +15,54 @@ "AGENT": "Agent", "CREATED_AT": "Erstellt am", "CLOSED_AT": "Geschlossen am", - "DISPOSITION": "Disposition", + "DISPOSITION": "Qualifizierung", "CONTACT": "Kontakt", "INTERACTION": "Interaktion", "BROWSER_NAME": "Browser Name", "BROWSER_VERSION": "Browser Version", - "OS_NAME": "Name des Betriebssystems", - "OS_VERSION": "Version des Betriebssystems", + "OS_NAME": "Betriebssystem Name", + "OS_VERSION": "Betriebssystem Version", "DEVICE_MODEL": "Gerätemodell", "DEVICE_VENDOR": "Gerätehersteller", "DEVICE_TYPE": "Gerätetyp", - "RECALLME": "Ruf mich zurück", - "DROP_RATE": "Abgebrochene Anrufrate", + "RECALLME": "Rückruf anfordern", + "DROP_RATE": "Abbruchrate Anrufe", "DROPPED": "Abgebrochen", - "DROPPED_TEXT": "Abgebrochene Anrufe aus der Warteschlange", + "DROPPED_TEXT": "Abgebrochene Anrufe innerhalb der Warteschlange", "DETAIL": "Detail", "MOTION_BULL": "Motion Bull", "LIMITED": "Limitiert", "LIMITED_TEXT": "IVR-Kampagnen Anrufe getätigt/limitiert", "DASHBOARDS": "Dashboards", - "RECORDINGS": "Aufnahmen", - "TODAY_MOTION_BULL_STATS": "Warteschlangen-Kampagnen Tagesstatistiken", + "RECORDINGS": "Aufzeichnungen", + "TODAY_MOTION_BULL_STATS": "Tagesstatistiken Warteschlangen", "ORIGINATED": "Gewählt", "ORIGINATED_TEXT": "Anrufe aus der Warteschlange gewählt", "UPDATE": "Aktualisieren", "MORE": "Mehr", "MOTIONDIALER": "Motion Dialer", - "DISPOSE": "Entsorgen", + "DISPOSE": "Qualifizieren", "QUEUES": "Warteschlangen", - "DIALER_CALL": "Dialer Anruf", + "DIALER_CALL": "Dialer-Anruf", "ELAPSED_TIME": "Abgelaufene Zeit", "EDIT": "Bearbeiten", "MERGE": "Zusammenführen", "DUPLICATE": "Duplizieren", "UNIQUEID": "Eindeutige ID", "CAMPAIGN": "Kampagne", - "NONE": "Keine", + "NONE": "Nichts", "NAME": "Name", "ANSWER_MACHINE": "Anrufbeantworter", "INTERESTED": "Interessiert", "NOT_INTERESTED": "Kein Interesse", "PERSONAL_INFO": "Persönliche Infos", "SOLD": "Verkauft", - "SPECIAL": "Spezielle", + "SPECIAL": "Speziell", "BLACKLIST": "Blacklist", - "RESCHEDULE": "Verschieben", + "RESCHEDULE": "erneut Planen", "FIRSTNAME": "Vorname", "LASTNAME": "Nachname", - "MOBILE": "Mobile", + "MOBILE": "Mobilnummer", "DATE_OF_BIRTH": "Geburtsdatum", "COMPANY": "Unternehmen", "TAG": "Tag", @@ -72,58 +72,58 @@ "POSTALCODE": "Postleitzahl", "CUSTOM_FIELDS": "Benutzerdefinierte Felder", "GENERAL": "Allgemein", - "VOICE": "Sprache", + "VOICE": "Sprachanrufe", "TODAY_IVR_CAMPAIGNS_STATS": "IVR-Tagesstatistiken", - "TODAY_INBOUND_STATS": "Inbound Warteschlangen Tagesstatistiken", - "TODAY_OUTBOUND_STATS": "Outbound Warteschlangen Tagesstatistiken", - "WAITING": "Anrufe in der Warteschlange", + "TODAY_INBOUND_STATS": "Tagesstatistiken - eingehende Warteschlangen", + "TODAY_OUTBOUND_STATS": "Tagesstatistiken - ausgehende Warteschlangen", + "WAITING": "Anrufe in Warteschlange", "TALKING": "Im Gespräch", - "INBOUND_ANSWERED": "Angenommen", - "OUTBOUND_ANSWERED": "Angenommen", - "ABANDONED": "Verlassen", - "TOTAL_OFFERED": "Insgesamt", + "INBOUND_ANSWERED": "Angenommen eingehend", + "OUTBOUND_ANSWERED": "Angenommen ausgehend", + "ABANDONED": "Abgebrochen", + "TOTAL_OFFERED": "Gesamt angeboten", "AVG_HOLD_TIME": "Durchschnittliche Wartezeit", - "INBOUND_ANSWER_RATE": "Angenommene Anrufrate", - "OUTBOUND_ANSWER_RATE": "Angenommene Anrufrate", - "ABANDON_RATE": "Verlassene Anrufrate", - "UNMANAGED": "Nicht verwaltete", - "TOTAL": "Insgesamt", + "INBOUND_ANSWER_RATE": "Antwortrate eingehend", + "OUTBOUND_ANSWER_RATE": "Antwortrate ausgehend", + "ABANDON_RATE": "Abbruchrate", + "UNMANAGED": "Nicht bearbeitet", + "TOTAL": "Gesamt", "TOT_DURATION": "Gesamtdauer", "AVG_DURATION": "Durchschnittliche Dauer", "HELP": { - "ORIGINATEDLIMITED": "IVR Kampagnen gewählt/Limitiert", - "DROPPED": "Die Gesamtzahl abgebrochener Anrufe aus der Warteschlange", - "DROP_RATE": "Die Rate aller abgebrochener Anrufe aus der Warteschlange", - "WAITING": "Die Gesamtzahl der wartenden Anrufe aus der Warteschlange", - "OUTBOUND_ANSWERED": "Die Gesamtzahl der angenommenen ausgehenden Anrufe", - "ABANDONED": "Die Gesamtzahl der abgebrochenen Anrufe aus der Warteschlange", - "TOTAL_OFFERED": "Die Gesamtzahl der Warteschlangenanrufe (angenommen + verlassen + nicht verwaltet in der letzten Warteschlange des Datenflusses). Beachten Sie, dass Anrufe, die in ein IVR und nicht in eine Warteschlange eingehen, nicht berücksichtigt werden.", - "AVG_HOLD_TIME": "Die durchschnittliche Interaktionswartezeit, d.h. die durchschnittliche Wartezeit auf die Antwort eines Agenten für alle vorhandenen Interaktionen.", - "OUTBOUND_ANSWER_RATE": "Die Rate aller angenommenen ausgehenden Anrufe", - "ABANDON_RATE": "Die Rate aller verlassenen Anrufe aus der Warteschlange", - "UNMANAGED": "Die Gesamtzahl der nicht verwalteten Warteschlangenanfrufe für alle vorhandenen Warteschlangen. Es enthält die Anrufe, die durch Timeout, Joinempty, Leavewhenempty und Exitwithkey abgebrochen werden (siehe Asterisk-Dokumentation für weitere Informationen).", - "TOTAL": "Die Gesamtzahl der ausgehenden Anrufe", - "TOT_DURATION": "Die Gesamtdauer aller ausgehenden Anrufe", - "AVG_DURATION": "Die durchschnittliche Dauer aller angenommenen ausgehenden Anrufe", - "ORIGINATED": "Die Gesamtzahl der in den Warteschlangenkampagnen gewählten Anrufe", - "ABANDONED_RATE": "Die Rate aller abgebrochenen Interaktionen", - "AVG_MANAGED_TIME": "Die durchschnittliche verwaltete Interaktionszeit, nämlich die durchschnittliche Zeit, die während des Gesprächs verbracht wird", - "MANAGED": "Die Gesamtzahl der abgeschlossenen Interaktionen", - "MANAGED_RATE": "Die verwaltete Rate aller Interaktionen", - "OPENED": "Die Gesamtzahl der aktiven Interaktionen", - "UNMANAGED_RATE": "Die nicht verwaltete Rate aller Interaktionen", - "VOICE_ABANDONED": "Die Gesamtzahl der aufgegebenen Warteschlangenanrufe unter Berücksichtigung aller vorhandenen Warteschlangen. Beachten Sie, dass Anrufe, die wegen Timeout und joinempty abgebrochen werden, nicht berücksichtigt werden", - "VOICE_ANSWERED": "Die Gesamtzahl der abgeschlossenen Warteschlangenanrufe für alle vorhandenen Warteschlangen", - "VOICE_ANSWER_RATE": "Die Antwortrate aller Warteschlangenanrufe", - "VOICE_AVG_HOLD_TIME": "Die durchschnittliche Wartezeit für Warteschlangen, nämlich die durchschnittliche Wartezeit auf die Antwort eines Agenten für alle vorhandenen Warteschlangen", - "VOICE_AVG_TALK_TIME": "Die durchschnittliche Gesprächszeit in der Warteschlange, nämlich die durchschnittliche Gesprächszeit für alle vorhandenen Warteschlangen", - "VOICE_TALKING": "Die Gesamtzahl der aktiven Warteschlangenanrufe für alle vorhandenen Warteschlangen", - "VOICE_TOTAL_OFFERED": "Die Gesamtzahl der Warteschlangenanrufe (angenommen + verlassen + nicht verwaltet in der letzten Warteschlange des Datenflusses). Beachten Sie, dass Anrufe, die in ein IVR und nicht in eine Warteschlange eingehen, nicht berücksichtigt werden.", - "VOICE_UNMANAGED": "Die Gesamtzahl der nicht verwalteten Warteschlangenanfrufe für alle vorhandenen Warteschlangen. Es enthält die Anrufe, die durch Timeout, Joinempty, Leavewhenempty und Exitwithkey abgebrochen werden (siehe Asterisk-Dokumentation für weitere Informationen).", - "VOICE_WAITING": "Die Gesamtanzahl der wartenden Warteschlangenanrufe für alle vorhandenen Warteschlangen", - "MANDATORY_DISPOSITION_ENABLED": "Obligatorische Disposition für dieses Konto aktiviert", - "EXACT_MATCH_FILTER": "Suche nach einer genauen Übereinstimmung", - "LIKE_FILTER": "Suchen Sie nach dem angegebenen Muster" + "ORIGINATEDLIMITED": "IVR Kampagnen gewählt/limitiert", + "DROPPED": "Gesamtzahl abgebrochener Anrufe innerhalb der Warteschlange", + "DROP_RATE": "Abbruchrate aller Anrufe in der Warteschlange", + "WAITING": "Gesamtzahl der wartenden Anrufe aus der Warteschlange", + "OUTBOUND_ANSWERED": "Gesamtzahl der angenommenen ausgehenden Anrufe", + "ABANDONED": "Gesamtzahl der abgebrochenen Anrufe innerhalb der Warteschlange", + "TOTAL_OFFERED": "Gesamtzahl der angebotenen Anrufe in der Warteschlange (angenommen + abgebrochen + nicht bearbeitet in der letzten Warteschlange des Callflows). Hinweis: Anrufe innerhalb der IVR werden nicht berücksichtigt.", + "AVG_HOLD_TIME": "Durchschnittliche Wartezeit einer Interaktion bis zur Beantwortung durch einen Agenten.", + "OUTBOUND_ANSWER_RATE": "Rate aller angenommenen ausgehenden Anrufe", + "ABANDON_RATE": "Rate aller abgebrochener Anrufe innerhalb der Warteschlange", + "UNMANAGED": "Gesamtzahl der nicht bearbeiteten Anrufe für alle Warteschlangen. Enthält die Anrufe, die durch Timeout, Joinempty, Leavewhenempty und Exitwithkey abgebrochen wurden (siehe Asterisk-Dokumentation für weitere Informationen).", + "TOTAL": "Gesamtzahl der ausgehenden Anrufe", + "TOT_DURATION": "Gesamtdauer aller ausgehenden Anrufe", + "AVG_DURATION": "Durchschnittliche Dauer aller angenommenen ausgehenden Anrufe", + "ORIGINATED": "Gesamtzahl der in den Warteschlangen-Kampagnen gewählten Anrufe", + "ABANDONED_RATE": "Rate aller abgebrochenen Interaktionen", + "AVG_MANAGED_TIME": "Durchschnittliche Bearbeitungszeit einer Interaktion", + "MANAGED": "Gesamtzahl der abgeschlossenen Interaktionen", + "MANAGED_RATE": "Rate aller bearbeiteten Anrufe", + "OPENED": "Gesamtzahl der aktiven Interaktionen", + "UNMANAGED_RATE": "Rate aller unbearbeiteten Interaktionen", + "VOICE_ABANDONED": "Gesamtzahl der abgebrochenen Anrufe in der Warteschlange unter Berücksichtigung aller vorhandenen Warteschlangen. Hinweis: Anrufe, die wegen Timeout und joinempty abgebrochen wurden, werden nicht berücksichtigt.", + "VOICE_ANSWERED": "Gesamtzahl der abgeschlossenen Anrufe für alle vorhandenen Warteschlangen", + "VOICE_ANSWER_RATE": "Antwortrate aller Anrufe in der Warteschlange", + "VOICE_AVG_HOLD_TIME": "Durchschnittliche Wartezeit bis zur Beantwortung durch einen Agenten für alle vorhandenen Warteschlangen", + "VOICE_AVG_TALK_TIME": "Durchschnittliche Gesprächszeit für alle Anrufe aus der Warteschlange ", + "VOICE_TALKING": "Gesamtzahl der aktiven Anrufe für alle vorhandenen Warteschlangen", + "VOICE_TOTAL_OFFERED": "Gesamtzahl der Anrufe der Warteschlangen (angenommen + abgebrochen + nicht bearbeitet in der letzten Warteschlange des Callflows). Hinweis: Anrufe innerhalb der IVR werden nicht berücksichtigt.", + "VOICE_UNMANAGED": "Gesamtzahl der nicht bearbeiteten Anrufe für alle vorhandenen Warteschlangen. Enthält die Anrufe, die durch Timeout, Joinempty, Leavewhenempty und Exitwithkey abgebrochen wurden (siehe Asterisk-Dokumentation für weitere Informationen).", + "VOICE_WAITING": "Gesamtanzahl der aktuell wartenden Anrufe für alle vorhandenen Warteschlangen", + "MANDATORY_DISPOSITION_ENABLED": "Kontaktqualifizierung erforderlich", + "EXACT_MATCH_FILTER": "Suche nach einer genauen Übereinstimmung der Suchbegriffe", + "LIKE_FILTER": "Suche nach variablen Übereinstimmungen der Suchbegriffe" }, "ERRORS": { "FIRSTNAME_REQUIRED": "Der erste Name ist erforderlich", @@ -134,11 +134,11 @@ "CAMPAIGN_REQUIRED": "Pflichtfeld", "FAILED_INITIALIZATION": "Fehler während der Initialisierung" }, - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "WELCOME_TO_MOTION": "Willkommen bei Motion", + "NO_AVAILABLE_INFO": "Keine Information vorhanden", + "WELCOME_TO_MOTION": "Willkommen zu Motion", "WELCOME_MESSAGE": "Verwenden Sie die linke Seitenleiste, um durch die verfügbaren Abschnitte zu navigieren", "ADD": "Hinzufügen", - "CONTACTMANAGER": "Contact Manager", + "CONTACTMANAGER": "Kontaktmanager", "DASHBOARD": "Dashboard", "EDIT_CONTACT": "Kontakt bearbeiten", "EMAIL": "E-Mail", @@ -147,40 +147,40 @@ "NEW_CONTACT": "Neuer Kontakt", "PHONE": "Telefon", "SAVE": "Speichern", - "INBOUND_WAITING_CALLS": "Eingehende Anrufe in der Warteschlange", + "INBOUND_WAITING_CALLS": "Wartende Anrufe (Eingehend)", "CONTACTS": "Kontakte", "MYCONTACTS": "Meine Kontakte", "ADD_CONTACT": "Kontakt hinzufügen", - "RELOAD": "Neu laden", + "RELOAD": "Neu Laden", "WAITING_TEXT": "Wartende Interaktionen", - "TALKING_TEXT": "Aktive Anrufe in der Warteschlange", - "INBOUND_ANSWERED_TEXT": "Angenommene Anrufe in der Warteschlange", - "ABANDONED_TEXT": "Verlassene Anrufe in der Warteschlange", - "DROP_RATE_TEXT": "Rate abgebrochener Anrufe in der Warteschlange", - "TOTAL_OFFERED_TEXT": "Gesamtzahl der Interaktionen", - "AVG_HOLD_TIME_TEXT": "Durchschnittliche Wartezeit der Interaktionen", - "AVG_TALK_TIME_TEXT": "Gesprächszeit der Warteschlangenanrufe", - "INBOUND_ANSWER_RATE_TEXT": "Rate angenommener Anrufe in der Warteschlange ", - "UNMANAGED_TEXT": "Nicht verwaltete Interaktionen", - "TOTAL_TEXT": "Gesamtzahl ausgehender Anrufe", - "OUTBOUND_ANSWERED_TEXT": "Ausgehende angenommene Anrufe ", + "TALKING_TEXT": "Aktive Anrufe", + "INBOUND_ANSWERED_TEXT": "Angenommene Anrufe", + "ABANDONED_TEXT": "Abgebrochene Anrufe", + "DROP_RATE_TEXT": "Abbruchrate", + "TOTAL_OFFERED_TEXT": "Gesamt angebotene Interaktionen", + "AVG_HOLD_TIME_TEXT": "Durchschnittliche Wartezeit", + "AVG_TALK_TIME_TEXT": "Durchschnittliche Gesprächszeit", + "INBOUND_ANSWER_RATE_TEXT": "Antwortrate ", + "UNMANAGED_TEXT": "Nicht bearbeitete Interaktionen", + "TOTAL_TEXT": "Gesamt ausgehende Anrufe", + "OUTBOUND_ANSWERED_TEXT": "Beantwortete Anrufe (Ausgehend) ", "TOT_DURATION_TEXT": "Gesamtdauer ausgehender Anrufe ", "AVG_DURATION_TEXT": "Durchschnittliche Dauer ausgehender Anrufe", "OUTBOUND_ANSWER_RATE_TEXT": "Rate angenommener ausgehender Anrufe", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", - "REPLY_PLACEHOLDER": "Geben Sie ein und drücken Sie die Eingabetaste, um eine Nachricht zu senden", + "OF": "von", + "REPLY_PLACEHOLDER": "Text eingeben und ENTER drücken zum Senden", "CONTACT_INFO": "Kontaktinformationen", - "CLOSE_AND_DISPOSE": "Schließen und Entsorgen", - "DISPOSITIONS": "Dispositionen", - "CLOSE_WITHOUT_DISPOSE": "Schließen ohne Entsorgen", - "ACCEPT": "Akzeptieren", + "CLOSE_AND_DISPOSE": "Schließen und Qualifizieren", + "DISPOSITIONS": "Qualifizierungen", + "CLOSE_WITHOUT_DISPOSE": "Schließen ohne Qualifizierung", + "ACCEPT": "Annehmen", "REJECT": "Ablehnen", "CLOSED": "Geschlossen", - "INFO": "Info", + "INFO": "Information", "NOTE": "Hinweis", - "ACCEPT_ELSEWHERE": "Anderswo akzeptiert", + "ACCEPT_ELSEWHERE": "Von anderem Teilnehmer angenommen", "ATTENTION": "Achtung", "SOCIAL": "Sozial", "NO_JSCRIPTY_PROJECTS_AVAILABLE": "Keine Jscripty-Projekte verfügbar", @@ -188,17 +188,17 @@ "FILTER": "Filter", "SELECT_STATUS": "Status auswählen", "SELECT_ACCOUNT": "Konto auswählen", - "SELECT_WEBSITE": "Wählen Sie die Webseite", - "ALL": "Alle", + "SELECT_WEBSITE": "Webseite auswählen", + "ALL": "Alles", "INTERACTIONS": "Interaktionen", - "STARTEDAT": "Gestartet am", + "STARTEDAT": "Begonnen am", "STATUS": "Status", "OPEN": "Öffnen", - "SHOW": "Zeigen", + "SHOW": "Anzeigen", "ME": "ICH", "NOT_ASSIGNED": "Nicht zugewiesen", "UNKNOWN": "Unbekannt", - "SELECT_USER": "Wählen Sie einen Benutzer", + "SELECT_USER": "Benutzer auswählen", "LAST_MESSAGE": "Letzte Nachricht", "USER": "Benutzer", "TAGS": "Tags", @@ -207,20 +207,20 @@ "SOURCE": "Quelle", "DESTINATION": "Ziel", "CALLERID": "Anrufer-ID", - "END_AT": "Ende am", + "END_AT": "Beendet am", "DURATION": "Dauer", "SHOW_DETAILS": "Details anzeigen", "HIDE_DETAILS": "Details ausblenden", "EXTERNAL_URL": "Externer Link", "SET_AS": "Festlegen als", "PENDING": "Ausstehend", - "CANNED_ANSWER_NOT_FOUND": "Es wurden keine vordefinierten Antworten gefunden", - "CANNED_ANSWER_SEARCH": "Geben Sie einen Text ein, um eine vordefinierte Antwort zu suchen", + "CANNED_ANSWER_NOT_FOUND": "Keine Textbausteine gefunden", + "CANNED_ANSWER_SEARCH": "Hier nach einem Textbaustein suchen", "NO_MAIL_ACCOUNTS_AVAILABLE": "Keine E-Mail-Konten verfügbar", "NO_FAX_ACCOUNTS_AVAILABLE": "Keine Fax-Konten verfügbar", "NO_SMS_ACCOUNTS_AVAILABLE": "Keine SMS-Konten verfügbar", - "FILTER_VOICE_QUEUES": "Sprachwarteschlangen filtern", - "LOADING_INTERACTION": "Wir laden die Interaktion ...", + "FILTER_VOICE_QUEUES": "Anrufwarteschlangen filtern", + "LOADING_INTERACTION": "Interaktion wird geladen", "JANUARY": "Januar", "FEBRUARY": "Februar", "MARCH": "März", @@ -253,109 +253,109 @@ "SELECT_DATE": "Datum auswählen", "SELECT_DATE_RANGE": "Wählen Sie einen Datumsbereich", "CLEAR": "Löschen", - "CALL_NUMBER": "Anruf", + "CALL_NUMBER": "Anrufen", "TRANSFER_NUMBER": "Transfer", - "CALL_SAVED": "Anruf richtig gespeichert", - "CALL_DISPOSED": "Anruf richtig entsorgt", - "CHANNEL_WAITING_TEXT": "Wartende Warteschlangen-Interaktionen", + "CALL_SAVED": "Anruf erfolgreich gespeichert", + "CALL_DISPOSED": "Anruf erfolgreich qualifiziert", + "CHANNEL_WAITING_TEXT": "Wartende Interaktionen", "CHANNEL_QUEUE": "Warteschlange", - "CHANNEL_FROM": "Von", + "CHANNEL_FROM": "von", "MARK_AS_UNREAD": "Als ungelesen markieren", - "SELECT_AGENT": "Wählen Sie den Agenten aus", + "SELECT_AGENT": "Agenten auswählen", "READ": "Gelesen", - "SELECT_READ_UNREAD": "Wählen Sie Lesen/Ungelesen", - "SELECT_SUBSTATUS": "Wählen Sie Substatus", + "SELECT_READ_UNREAD": "Wählen ob Lesen/Ungelesen", + "SELECT_SUBSTATUS": "Zwischenstatus auswählen", "UNREAD": "Ungelesen", - "ABANDONAT": "Verlassen", - "ABANDONEDQUEUECALLS": "Verlassene Warteschlangenanrufe", + "ABANDONAT": "Abgebrochen", + "ABANDONEDQUEUECALLS": "Abgebrochene Anrufe", "FREE": "Frei", "LASTASSIGNEDTO": "Zuletzt zugewiesen an", "QUEUE": "Warteschlange", "QUEUECALLEREXITAT": "Abgebrochen", "QUEUECALLEREXITREASON": "Grund", "RESERVED": "Reserviert", - "SELECT_CAMPAIGN": "Wählen Sie eine Warteschlange", + "SELECT_CAMPAIGN": "Warteschlange auswählen", "ASSIGNTO": "Zuweisen", - "CLICKRELOAD": "Neue verlassene Anrufe! Bitte neu laden", + "CLICKRELOAD": "Verpasste Anrufe! Bitte Seite erneut laden", "NOTAVAILABLE": "Nicht verfügbar", - "CURRENTLY_IN_USE_BY": "Derzeit im Einsatz von", - "CUSTOMER_JOURNEY": "Kundenreise", + "CURRENTLY_IN_USE_BY": "Derzeit verwendet von", + "CUSTOMER_JOURNEY": "Kundenhistorie", "NO_DATA_AVAILABLE": "Keine Daten verfügbar", "AGENTS": "Agenten", "TRANSFER": "Transfer", - "NO_DISPOSITION_SET": "Keine Disposition festgelegt", - "ABANDONED_RATE": "Verlassene Rate", - "ABANDONED_RATE_TEXT": "Rate verlassener Interaktionen", - "AVG_MANAGED_TIME": " Durchschnittliche Verwaltungszeit", - "AVG_MANAGED_TIME_TEXT": "Durchschnittliche Verwaltungszeit der Interkationen", - "MANAGED": "Verwaltet", - "MANAGED_RATE": "Verwaltete Rate", - "MANAGED_RATE_TEXT": "Verwaltete Interaktionsrate", - "MANAGED_TEXT": "Verwaltete Interaktionen", - "OPENED_TEXT": "Geöffnete Interaktionen", + "NO_DISPOSITION_SET": "Keine Qualifizierungen definiert", + "ABANDONED_RATE": "Abbruchrate", + "ABANDONED_RATE_TEXT": "Rate der abgebrochenen Anrufe innerhalb der Warteschlange", + "AVG_MANAGED_TIME": "Durchschnittliche Bearbeitungszeit", + "AVG_MANAGED_TIME_TEXT": "Durchschnittliche Bearbeitungszeit aller Interkationen", + "MANAGED": "Bearbeitet", + "MANAGED_RATE": "Bearbeitungsrate", + "MANAGED_RATE_TEXT": "Rate der bearbeiteten Interaktionen", + "MANAGED_TEXT": "Interaktionen bearbeitet", + "OPENED_TEXT": "Interaktionen geöffnet", "TODAY_INTERACTIONS_STATS": "Interaktionen Tagesstatistiken", - "UNMANAGED_RATE": "Nicht verwaltete Rate", - "UNMANAGED_RATE_TEXT": "Nicht verwaltete Interaktionsate", - "VOICE_ABANDONED": "Verlassen", - "VOICE_ABANDONED_TEXT": "Verlassene Warteschlangenanrufe", - "VOICE_ABANDON_RATE": "Verlassene Rate", - "VOICE_ABANDON_RATE_TEXT": "Rate verlassener Warteschlangenanrufe", + "UNMANAGED_RATE": "Rate nicht Bearbeitet", + "UNMANAGED_RATE_TEXT": "Rate der nicht bearbeiteten Interaktionen in der Warteschlange", + "VOICE_ABANDONED": "Abgebrochen", + "VOICE_ABANDONED_TEXT": "Abgebrochene Anrufe innerhalb der Warteschlange", + "VOICE_ABANDON_RATE": "Abbruchrate", + "VOICE_ABANDON_RATE_TEXT": "Rate der abgebrochenen Anrufe innerhalb der Warteschlange", "VOICE_ANSWERED": "Angenommen", "VOICE_ANSWERED_TEXT": "Angenommene Anrufe in der Warteschlange", - "VOICE_ANSWER_RATE": "Angenommene Rate", + "VOICE_ANSWER_RATE": "Antwortrate", "VOICE_ANSWER_RATE_TEXT": "Rate angenommener Anrufe in der Warteschlange", "VOICE_AVG_HOLD_TIME": "Durchschnittliche Wartezeit", - "VOICE_AVG_HOLD_TIME_TEXT": "Queue ruft AVG HOLD TIME an", + "VOICE_AVG_HOLD_TIME_TEXT": "Durchschnittliche Wartezeit aller Sprachanrufe", "VOICE_AVG_TALK_TIME": "Durchschnittliche Gesprächszeit", - "VOICE_AVG_TALK_TIME_TEXT": "Gesprächszeit der Anrufe in der Warteschlage", + "VOICE_AVG_TALK_TIME_TEXT": "Durchschnittliche Gesprächszeit aller Anrufe nach der Warteschleife", "VOICE_TALKING": "IM GESPRÄCH", "VOICE_TALKING_TEXT": "Aktive Anrufe in der Warteschlange", - "VOICE_TOTAL_OFFERED": "Insgesamt", - "VOICE_TOTAL_OFFERED_TEXT": "Gesamtzahl der Anrufe in der Warteschlange", - "VOICE_UNMANAGED": "Nicht verwaltet", - "VOICE_UNMANAGED_TEXT": "Nicht verwaltete Anrufe in der Warteschlange", + "VOICE_TOTAL_OFFERED": "Gesamt angeboten", + "VOICE_TOTAL_OFFERED_TEXT": "Gesamtzahl der angebotenen Anrufe in der Warteschlange", + "VOICE_UNMANAGED": "Nicht bearbeitet", + "VOICE_UNMANAGED_TEXT": "Nicht bearbeitete Anrufe in der Warteschlange", "VOICE_WAITING": "Wartende Anrufe", "VOICE_WAITING_TEXT": "Wartende Anrufe in der Warteschlange", "DOWNLOAD": "Herunterladen", "SCHEDULED_CALLS": "Geplante Anrufe", - "PRIVATE": "Privat", + "PRIVATE": "Persönlich", "PUBLIC": "Öffentlich", - "PUBLIC_INTERACTION": "Die Interaktion ist öffentlich", + "PUBLIC_INTERACTION": "Öffentliche Interaktion", "VISIBILITY": "Sichtbarkeit", - "INTERACTION_CLOSED": "Interaktion korrekt geschlossen", - "INTERACTION_CLOSED_DISPOSED": "Interaktion korrekt geschlossen und entsorgt", - "INTERACTION_DISPOSED": "Interaktion korrekt entsorgt", - "ASSIGNED_TO_OTHERS": "An andere zugewiesen", - "SELECT_ALL": "Alle auswählen", + "INTERACTION_CLOSED": "Interaktion erfolgreich geschlossen", + "INTERACTION_CLOSED_DISPOSED": "Interaktion erfolgreich geschlossen und qualifiziert", + "INTERACTION_DISPOSED": "Interaktion erfolgreich qualifiziert", + "ASSIGNED_TO_OTHERS": "An Andere zugewiesen", + "SELECT_ALL": "Alles auswählen", "CHAT_INTERACTIONS": "Chat-Interaktionen", "FAX_INTERACTIONS": "Fax-Interaktionen", - "ID": "Id", + "ID": "ID", "MAIL_INTERACTIONS": "E-Mail-Interaktionen", - "OPENCHANNEL_INTERACTIONS": "Open Channel-Interaktionen", + "OPENCHANNEL_INTERACTIONS": "Offener-Kanal-Interaktionen", "SMS_INTERACTIONS": "SMS-Interaktionen", - "CANCEL": "Stornieren", - "DRAFT": "Entwurf", - "DRAFT_SAVE_WARNING_MESSAGE": "Für diese Interaktion ist bereits ein Entwurf gespeichert. Sind Sie sicher, dass Sie ihn überschreiben möchten?", + "CANCEL": "Abbrechen", + "DRAFT": "Entwurf speichern", + "DRAFT_SAVE_WARNING_MESSAGE": "Für diese Interaktion ist bereits ein Entwurf gespeichert. Möchten Sie diesen überschreiben?", "DRAFT_SAVE_WARNING_TITLE": "Vorhandenen Entwurf überschreiben?", "OVERWRITE": "Überschreiben", "SAVE_AS_DRAFT": "Als Entwurf speichern", "UNTITLED": "Ohne Titel", "UPDATE_DRAFT": "Entwurf aktualisieren", "NO_AVAILABLE_INTERACTION": "Keine Interaktionen verfügbar", - "ACCOUNTINGDOC": "Buchhaltung", + "ACCOUNTINGDOC": "Abrechnungsdokumente", "ADD_PRODUCTPRICELIST": "PRODUKT HINZUFÜGEN", "AGENTFULLNAME": "Agent", "ALL_COMPANIES": "Alle Unternehmen", - "ALL_PRODUCTS": "Alle", - "ALL_STATUS": "Alle", - "ALL_STEP": "Alle", + "ALL_PRODUCTS": "Alles", + "ALL_STATUS": "Alles", + "ALL_STEP": "Alles", "ALL_WORKFLOW": "Alle Arbeitsabläufe", "ATTENDACELASTINVOICE": "Letzte Rechnung", "ATTENDACENEXTINVOICE": "Nächste Rechnung", "AUTHORIZED": "AUTORISIERT", "AUTOINVOICE": "SELBSTABRECHNUNG", "AUTOPROFORMA": "SELBST-PROFORMA", - "BALANCE": "BALANCE", + "BALANCE": "SALDO", "BY": "Durch", "CLONEPROFORMA": "Klon", "COMPANIES": "Unternehmen", @@ -386,7 +386,7 @@ "DOSSIERS": "Dossiers", "DOSSIER_INFO": "Information", "ENDDATE": "Ablaufdatum", - "FROM": "Von", + "FROM": "von", "GRAPHINVOICES": "Diagramm der Rechnungsemission", "INASSET": "Kapital", "INVOICE": "RECHNUNG", @@ -404,7 +404,7 @@ "INVOICEPAYED": "Bezahlt", "INVOICES": "RECHNUNGEN", "INVOICESTATUS": "Status", - "INVOICETOTAL": "Insgesamt", + "INVOICETOTAL": "Gesamt", "INVOICE_INFO": "Rechnung", "MANAGESALES": "Abonnements", "MOVEASSET": "Kapital", @@ -477,9 +477,9 @@ "QUOTATIONSTATUS": "Status", "QUOTATIONSUBSCRIPTION": "Dauer", "QUOTATIONTAX": "MwSt", - "QUOTATIONTOTAL": "Insgesamt", + "QUOTATIONTOTAL": "Gesamt", "QUOTATIONTOTALPRICE": "Gesamt netto", - "QUOTATIONTOTALS": "Insgesamt", + "QUOTATIONTOTALS": "Gesamt", "QUOTATIONTOTALTAX": "Gesamtsteuer", "QUOTATIONUNIT": "Einheit", "QUOTATIONVAT": "VAT", @@ -509,28 +509,28 @@ "TOTALPAYMENTS": "Gesamtzahlungen", "UPDATED_AT": "Geändert am", "UPDATE_PRODUCT": "Produkt aktualisieren", - "WORKFLOW": "Wählen Sie einen Arbeitsablauf", + "WORKFLOW": "Arbeitsablauf wählen", "YEARS": "Jahre", "CUSTOMER_IP": "Ursprüngliche IP-Adresse", "CUSTOMER_PORT": "Ursprünglicher TCP-Port", "ADVANCED_SEARCH": "Erweiterte Suche", - "AND": "Und", + "AND": "und", "APPLY": "Anwenden", - "CONTAINS": "Enthält", + "CONTAINS": "enthält", "DISABLED": "Deaktiviert", "ENABLED": "Aktiviert", "ENDING_DATE": "Enddatum", "ENDING_VALUE": "Endwert", - "ENDS_WITH": "Endet mit", - "EQUALS": "Gleich", - "IS_AMONG": "Ist unter", - "IS_BETWEEN": "Ist zwischen", - "IS_GREATER_THAN": "Ist größer als", - "IS_GREATER_THAN_OR_EQUAL_TO": "Ist größer oder gleich", - "IS_LESS_THAN": "Ist kleiner als", - "IS_LESS_THAN_OR_EQUAL_TO": "Ist kleiner oder gleich", - "IS_NOT_AMONG": "Ist nicht unter", - "IS_NOT_EQUAL": "Ist nicht gleich", + "ENDS_WITH": "endet mit", + "EQUALS": "gleich", + "IS_AMONG": "ist unter", + "IS_BETWEEN": "ist zwischen", + "IS_GREATER_THAN": "ist größer als", + "IS_GREATER_THAN_OR_EQUAL_TO": "ist größer oder gleich", + "IS_LESS_THAN": "ist kleiner als", + "IS_LESS_THAN_OR_EQUAL_TO": "ist kleiner oder gleich", + "IS_NOT_AMONG": "ist nicht innerhalb", + "IS_NOT_EQUAL": "ist nicht gleich", "MEET_ALL_CONDITIONS": "Alle Bedingungen erfüllen", "MEET_ANY_CONDITIONS": "Mindestens eine Bedingung erfüllen", "NEW_CONDITION": "Neue Bedingung", @@ -538,35 +538,34 @@ "SELECT_OPERATOR": "Operator auswählen", "STARTING_DATE": "Startdatum", "STARTING_VALUE": "Startwert", - "STARTS_WITH": "Beginnt mit", + "STARTS_WITH": "beginnt mit", "VALUE": "Wert", "VALUES": "Werte", "VALUE_RANGE_CHECK": "Wert muss größer sein als", - "CHOOSE": "Wählen", + "CHOOSE": "Auswählen", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", - "SELECT_QUEUE": "Wählen Sie eine Warteschlange aus", + "SELECT_QUEUE": "Warteschlange auswählen", "VIDAOOSESSION": "Videoanruf starten", "WHATSAPP": "WhatsApp Connector", - "WHATSAPP_INTERACTIONS": "WhatsApp Connector-Interaktionen", + "WHATSAPP_INTERACTIONS": "WhatsApp-Interaktionen", "LAST_UPDATED": "Zuletzt aktualisiert", "MATCHING_FIELD": "Übereinstimmendes Feld", "MULTIPLE_CONTACTS_FOUND": "Mehrere Kontakte für Nummer gefunden", - "SELECT": "Wählen", + "SELECT": "Auswählen", "SELECT_CONTACT": "Kontakt auswählen", - "WHICH_ONE_TO_USE": "Welches möchten Sie verwenden?", + "WHICH_ONE_TO_USE": "Welcher Eintrag soll verwendet werden?", "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Kein WhatsApp-Konto verfügbar", - "SECOND_LEVEL_DISPOSITION": "Disposition der zweiten Ebene", - "THIRD_LEVEL_DISPOSITION": "Disposition der dritten Ebene", + "SECOND_LEVEL_DISPOSITION": "Qualifizierung der zweiten Ebene", + "THIRD_LEVEL_DISPOSITION": "Qualifizierung der dritten Ebene", "LICENSE_EXPIRE_REMAINING_DAYS": "Ihre Lizenz läuft bald ab! Bitte wenden Sie sich an Ihren Administrator", "CREATEDAT": "Hergestellt in", "ELAPSED_ANSWERED": "Verstrichene Zeit seit dem Start des Anrufs", "ELAPSED_DISPOSED": "Verstrichene Zeit seit Beendigung des Anrufs", - "LOST_CONNECTION": "Probleme mit der Netzwerkkonnektivität. Bitte überprüfe deine Internetverbindung.", + "LOST_CONNECTION": "Probleme mit der Netzwerkkonnektivität. Bitte Internetverbindung prüfen.", "NO_RESULTS_AVAILABLE": "Keine Ergebnisse verfügbar", - "AUTOCLOSE": "Schließen Sie die Kontaktlasche nach der Entsorgung automatisch", - "AGENT_PRESENCE": "Agentenpräsenz", - "SELECT_TEAM": "Team auswählen", - "AVAILABLE": "Erhältlich" + "AUTOCLOSE": "Tab nach Qualifizierung automatisch schließen", + "AGENT_PRESENCE": "Bereitschaftsstatus", + "SELECT_TEAM": "Team auswählen" } } diff --git a/public/app/main/apps/mail/i18n/de.json b/public/app/main/apps/mail/i18n/de.json index 4b2f44e..fd1c6a8 100644 --- a/public/app/main/apps/mail/i18n/de.json +++ b/public/app/main/apps/mail/i18n/de.json @@ -1,83 +1,83 @@ { "MAIL": { "TEXT": "Text", - "TIMES": "Die Anzahl der Zeiten pro Interaktion", - "EDIT_AUTOREPLY": "Bearbeiten Sie automatische Antwort", + "TIMES": "Zeitstempel", + "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", "AUTOREPLY": "Automatische Antwort", - "SHOW_AUTOREPLY": "Die automatische Antwort anzeigen", + "SHOW_AUTOREPLY": "Automatische Antwort anzeigen", "SHOW_DETAILS": "Details anzeigen", "HIDE_DETAILS": "Details ausblenden", - "TO": "Zu", + "TO": "An", "FROM": "Von", "DATE": "Datum", - "CC": "Cc", - "REPLY": "Antwort", + "CC": "CC", + "REPLY": "Antworten", "REPLY_ALL": "Allen antworten", - "FORWARD": "Vorwärts", + "FORWARD": "Weiterleiten", "SUBJECT": "Betreff", - "BCC": "Bcc", + "BCC": "BCC", "SEND": "Senden", "ATTACHMENT": "Anhang", "ATTACHMENTS": "Anhänge", "NAME": "Name", "MAILQUEUES": "E-Mail Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "SEARCH_FOR_ANYONE": "Suche", "STRATEGY": "Strategie", "ERRORS": { - "TEXT_REQUIRED": "Das Feld \"Text\" ist erforderlich", - "NAME_REQUIRED": "Der Name ist erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Der Agent Timeout ist erforderlich", - "EMAIL_ADDRESS_REQUIRED": "Die E-Mail-Adresse ist erforderlich", - "EMAIL_ADDRESS_MUST_VALID": "Die E-Mail Adresse muss in einem gültigen Format", - "HOST_REQUIRED": "Der Host wird benötigt", - "USERNAME_REQUIRED": "Der Benutzername ist erforderlich", - "PORT_REQUIRED": "Der Port ist erforderlich", + "TEXT_REQUIRED": "Feld \"Text\" ist erforderlich", + "NAME_REQUIRED": "Name ist erforderlich", + "AGENT_TIMEOUT_REQUIRED": "Agent Timeout ist erforderlich", + "EMAIL_ADDRESS_REQUIRED": "E-Mail-Adresse ist erforderlich", + "EMAIL_ADDRESS_MUST_VALID": "E-Mail ungültiges Format", + "HOST_REQUIRED": "Host wird benötigt", + "USERNAME_REQUIRED": "Benutzername ist erforderlich", + "PORT_REQUIRED": "Port ist erforderlich", "CONNTIMEOUT_REQUIRED": "Timeout der Verbindung ist erforderlich", - "AUTHTIMEOUT_REQUIRED": "Das Zeitlimit für die Authentifizierung erforderlich ist", - "ACCEPTURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", - "REJECTURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "CLOSEURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "AGENT_REQUIRED": "Der Agent ist erforderlich", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Timeout muss größer als oder gleich", - "DISPOSITION_REQUIRED": "Die Disposition ist erforderlich", - "CONDITION_REQUIRED": "Der Zustand ist erforderlich", - "TRUEPRIORITY_REQUIRED": "Die wahre Priorität ist erforderlich", - "FALSEPRIORITY_REQUIRED": "Die falsche Priorität ist erforderlich", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die wahre Priorität muss größer als oder gleich", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die falsche Priorität muss größer als oder gleich", - "PRIORITY_REQUIRED": "Die Priorität ist erforderlich", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Priorität muss größer als oder gleich", - "QUEUE_REQUIRED": "Die Warteschlange ist erforderlich", - "LIST_REQUIRED": "Die Liste ist erforderlich", - "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", - "SERVICE_REQUIRED": "Der Dienst ist erforderlich,", - "IMAP_HOST_REQUIRED": "Der IMAP-Host wird benötigt", - "IMAP_PORT_REQUIRED": "Der IMAP-Anschluss erforderlich", - "SMTP_HOST_REQUIRED": "Der SMTP-Host ist erforderlich", - "SMTP_PORT_REQUIRED": "Der SMTP-Port ist erforderlich", - "CONFIRM_NOT_MATCH": "Die Passwörter nicht übereinstimmen", - "KEY_MAX_LENGTH": "Schlüssel muss eine maximale Länge von {{max}}", - "KEY_REQUIRED": "Der Schlüssel ist erforderlich", - "TEXT_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "AUTHTIMEOUT_REQUIRED": "Zeitlimit für die Authentifizierung ist erforderlich", + "ACCEPTURL_MUST_VALID_URL": "URL ungültiges Format", + "TIMEOUT_REQUIRED": "Timeout ist erforderlich", + "REJECTURL_MUST_VALID_URL": "URL ungültiges Format", + "CLOSEURL_MUST_VALID_URL": "URL ungültiges Format", + "AGENT_REQUIRED": "Agent ist erforderlich", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Timeout muss größer oder gleich sein als", + "DISPOSITION_REQUIRED": "Qualifizierung ist erforderlich", + "CONDITION_REQUIRED": "Bedingung ist erforderlich", + "TRUEPRIORITY_REQUIRED": "Wahre Priorität ist erforderlich", + "FALSEPRIORITY_REQUIRED": "Falsche Priorität ist erforderlich", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wahre Priorität muss größer oder gleich sein als", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Falsche Priorität muss größer oder gleich sein als", + "PRIORITY_REQUIRED": "Priorität ist erforderlich", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität muss größer oder gleich sein als", + "QUEUE_REQUIRED": "Warteschlange ist erforderlich", + "LIST_REQUIRED": "Liste ist erforderlich", + "PASSWORD_REQUIRED": "Passwort ist erforderlich", + "SERVICE_REQUIRED": "Dienst ist erforderlich,", + "IMAP_HOST_REQUIRED": "IMAP-Host ist erforderlich", + "IMAP_PORT_REQUIRED": "IMAP-Port erforderlich", + "SMTP_HOST_REQUIRED": "SMTP-Host ist erforderlich", + "SMTP_PORT_REQUIRED": "SMTP-Port ist erforderlich", + "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", + "KEY_MAX_LENGTH": "Schlüssel darf eine maximale Länge haben von {{max}}", + "KEY_REQUIRED": "Schlüssel ist erforderlich", + "TEXT_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}}", "VALUE_REQUIRED": "Pflichtfeld", - "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "FONT_SIZE_REQUIRED": "Pflichtfeld", "COMMAND_REQUIRED": "Pflichtfeld", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", "NAME_MUST_VALID_PATTERN": "Falsches Format", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", "TAG_REQUIRED": "Pflichtfeld", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "AGENTTRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "QUEUETRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", "REPLY_TYPE_REQUIRED": "Pflichtfeld" @@ -93,9 +93,9 @@ "MAILACCOUNTS": "E-Mail Konten", "EMAIL_ADDRESS": "E-Mail Adresse", "ADD_MAILACCOUNT": "E-Mail Konto hinzufügen", - "EDIT_MAILACCOUNT": "E-Mail-Konto bearbeiten", - "DELETE_MAILACCOUNT": "E-Mail-Konten löschen", - "DISPOSITIONS": "Bestimmungen", + "EDIT_MAILACCOUNT": "E-Mail Konto bearbeiten", + "DELETE_MAILACCOUNT": "E-Mail Konto löschen", + "DISPOSITIONS": "Qualifizierungen", "WEBHOOKS": "WebHooks", "ACTIONS": "Aktionen", "OTHERS": "Andere", @@ -105,20 +105,20 @@ "SERVICE": "Service", "CREATED_AT": "Erstellt am", "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Die Methode", + "ACCEPTMETHOD": "Methode akzeptieren", "ACCEPTURL": "URL akzeptieren", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "In der Nähe", - "CLOSEMETHOD": "In der Nähe Methode", - "CLOSEURL": "Der URL", + "CLOSE": "Schließen", + "CLOSEMETHOD": "Methode schließen", + "CLOSEURL": "URL schließen", "WHITELABEL": "White Label", - "SIGNATURE": "Unterschrift", + "SIGNATURE": "Signatur", "IMAP": "IMAP", "HOST": "Host", "USERNAME": "Benutzername", - "PORT": "Hafen", + "PORT": "Port", "MAILBOX": "Mailbox", "FILTER": "Filter", "CONNTIMEOUT": "Connection Timeout [sek]", @@ -130,48 +130,48 @@ "SMTP": "SMTP", "SELECTED": "Ausgewählte", "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "SELECT_NONE": "Nichts auswählen", "BACK": "Zurück", "MAIL": "E-Mail", - "ID": "Id", + "ID": "ID", "TIMEOUT": "Timeout", "PASSWORD": "Passwort", - "NO_MAILDISPOSITION_AVAILABLE": "Keine E-Mail zur Verfügung Verfügungen", - "ADD_MAILDISPOSITION": "E-Mail hinzufügen Disposition", - "NEW_MAILDISPOSITION": "Neue E-Mail zur Verfügung", - "EDIT_MAILDISPOSITION": "Bearbeiten von E-Mail zur Verfügung", - "DELETE_MAILDISPOSITION": "Löschen von E-Mail zur Verfügung", - "MAILDISPOSITIONS": "E-Mail Verfügungen", + "NO_MAILDISPOSITION_AVAILABLE": "Keine E-Mail Qualifizierung verfügbar", + "ADD_MAILDISPOSITION": "Qualifizierung hinzufügen", + "NEW_MAILDISPOSITION": "Neue E-Mail Qualifizierung", + "EDIT_MAILDISPOSITION": "Qualifizierung bearbeiten", + "DELETE_MAILDISPOSITION": "Qualifizierung löschen", + "MAILDISPOSITIONS": "E-Mail Qualifizierungen", "NEW_MAILQUEUE": "Neue E-Mail Warteschlange", - "NEW_MAILACCOUNT": "Neue E-Mail Konto", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "ALL_TEAMS": "Alle Mannschaften", + "NEW_MAILACCOUNT": "Neues E-Mail Konto", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", "HELP": { "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "USERNAME": "Benutzername für die Authentifizierung verwendet werden", - "PASSWORD": "Kennwort für die Authentifizierung verwendet werden", - "SECURE": "Bei true wird die Verbindung TLS verwenden, wenn eine Verbindung zu Server", - "FONT_FAMILY": "Standardschriftfamilie", + "USERNAME": "Benutzername für die Authentifizierung", + "PASSWORD": "Passwort für die Authentifizierung", + "SECURE": "Bei true wird die Verbindung TLS verwenden, wenn eine Verbindung zum Server aufgebaut wird", + "FONT_FAMILY": "Standard-Schriften", "FONT_SIZE": "Standard Schriftgröße", - "MARK_AS_UNREAD": "Agent aktivieren / deaktivieren, um die letzte Nachricht einer Interaktion als ungelesen zu markieren", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Anhalten, um zu verwenden, wenn die obligatorische Disposition aktiviert ist" + "MARK_AS_UNREAD": "Aktivieren / deaktivieren, um die letzte Nachricht einer Interaktion als ungelesen zu markieren", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "PausenID bei erforderlicher Qualifizierung" }, "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", - "TEAMADD_MAILQUEUE": "Team Chat Warteschlange hinzufügen", - "AGENTADD_MAILQUEUE": "Agent zu Chatten Warteschlange hinzufügen", + "OF": "von", + "TEAMADD_MAILQUEUE": "Team zur Warteschlange hinzufügen", + "AGENTADD_MAILQUEUE": "Agenten zur Warteschlange hinzufügen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "AGENT": "Agent", "EDIT_AGENT": "Agent bearbeiten", - "EDIT_CLOSE": "Bearbeiten Schließen", - "DISPOSITION": "Disposition", - "GOTOIF": "GotoIf", + "EDIT_CLOSE": "Bearbeitung abschließen", + "DISPOSITION": "Qualifizierung", + "GOTOIF": "GoToIf", "EDIT_GOTOIF": "Bearbeiten GotoIf", - "CONDITION": "Zustand", + "CONDITION": "Bedingung", "TRUEPRIORITY": "Wahre Priorität", "FALSEPRIORITY": "Falsche Priorität", "GOTOP": "GotoP", @@ -182,14 +182,14 @@ "VALUE": "Wert", "QUEUE": "Warteschlange", "EDIT_QUEUE": "Warteschlange bearbeiten", - "INTERACTIONS": "Wechselwirkungen", - "STARTEDAT": "Gestartet am", + "INTERACTIONS": "Interaktionen", + "STARTEDAT": "Startdatum", "CONTACT": "Kontakt", "CLOSEDAT": "Geschlossen", - "NOTES": "Hinweise", - "NO_INTERACTION_AVAILABLE": "Es sind keine Wechselwirkungen zur Verfügung", + "NOTES": "Anmerkungen", + "NO_INTERACTION_AVAILABLE": "Keine neuen Interaktionen verfügbar", "ACTIVE": "Aktiv", - "SECURE": "Sichere", + "SECURE": "Sicher", "AUTHENTICATION": "Authentifizierung", "SMTP_HOST": "SMTP-Host", "SMTP_PORT": "SMTP-Port", @@ -197,7 +197,7 @@ "IMAP_PORT": "IMAP-Port", "CONFIRM_PASSWORD": "Passwort bestätigen", "SELECT_STATUS": "Status auswählen", - "OPENED": "Öffnen", + "OPENED": "Geöffnet", "CLOSED": "Geschlossen", "ALL": "Alle", "SELECT_ACCOUNT": "Konto auswählen", @@ -209,117 +209,117 @@ "UNPAUSE": "Pause beenden", "DEFAULT_PAUSE": "Standard Pause", "LOGOUT": "An-/Abmelden", - "AGENTADD_QUEUE": "Agent E-Mail Warteschlange hinzufügen", - "VOICE": "Voice", + "AGENTADD_QUEUE": "Agenten zur Warteschlange hinzufügen", + "VOICE": "Anrufe", "CHAT": "Chat", - "SMS": "Sms", - "OPENCHANNEL": "Channel öffnen", + "SMS": "SMS", + "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", "REALTIME": "Echtzeit", "AGENTS": "Agenten", "QUEUES": "Warteschlangen", "ACCOUNTS": "Konten", - "FULLNAME": "Voller Name", - "INTERNAL": "Interne", + "FULLNAME": "Vollständiger Name", + "INTERNAL": "Intern", "PHONE_STATE": "Telefonstatus", "PHONE_STATUS": "Telefonstatus", "PAUSE": "Pause", "LOGGED_IN": "Angemeldet", "PAUSED": "Angehalten", "READY": "Bereit", - "WAITING": "Warten", - "TOTAL": "Insgesamt", - "IN": "In", - "OUT": "Aus", + "WAITING": "Wartezustand", + "TOTAL": "Gesamt", + "IN": "Eingehend", + "OUT": "Ausgehend", "IMAP_STATUS": "IMAP-Status", "SMTP_STATUS": "SMTP-Status", "DISABLED": "Deaktiviert", "CONNECTED": "Verbunden", - "NEVER_VERIFIED": "Nie verifiziert", + "NEVER_VERIFIED": "Noch nicht verifiziert", "ERROR": "Fehler", "EDIT_ACCOUNT": "Konto bearbeiten", - "VERIFY_SMTP": "Überprüfen Sie die SMTP-", + "VERIFY_SMTP": "Bitte SMTP-Einstellungen prüfen", "VERIFIED": "Überprüft", - "VERIFYSMTP_MAILACCOUNT": "Überprüfen Sie die SMTP-", - "GOTOREALTIME_MAILACCOUNT": "In Echtzeit, E-Mail Konto", - "GOTO_MAILACCOUNT": "In Echtzeit, E-Mail Konto", + "VERIFYSMTP_MAILACCOUNT": "Bitte SMTP-Einstellungen prüfen", + "GOTOREALTIME_MAILACCOUNT": "Zum E-Mail-Konto Echtzeitmonitoring", + "GOTO_MAILACCOUNT": "Zum E-Mail Konto gehen", "UNKNOWN": "Unbekannt", - "UNREGISTERED": "Unregistrierte", + "UNREGISTERED": "Nicht registriert", "UNAVAILABLE": "Nicht verfügbar", - "NOT_INUSE": "Nicht in Gebrauch", + "NOT_INUSE": "Nicht in Verwendung", "REACHABLE": "Erreichbar", - "IN_USE": "Im Einsatz", - "AGENTSADD_QUEUE": "Agenten zu Warteschlange hinzufügen", - "INFO": "Info", + "IN_USE": "In Verwendung", + "AGENTSADD_QUEUE": "Agenten zur Warteschlange hinzufügen", + "INFO": "Information", "NO_AGENT_ONLINE": "Kein Agent Online", - "GOTOREALTIME_MAILQUEUE": "In Echtzeit, E-Mail Warteschlange", - "PARTIALPAUSE": "Lastschriftzahlung teilweise Pause", + "GOTOREALTIME_MAILQUEUE": "Echtzeitmonitoring E-Mail Warteschlangen", + "PARTIALPAUSE": "Teilpause", "BUSY": "Besetzt", "TIMER": "Timer", "IDLE": "Leerlauf", "CAPACITY": "Kapazität", - "SPYINTERACTION": "Spy", + "SPYINTERACTION": "Mithören", "ADD_NOTE": "Notiz hinzufügen", - "NOTE": "Hinweis", + "NOTE": "Notiz", "TAGS": "Tags", - "INTERACTIONS_MAILACCOUNT": "Zu Wechselwirkungen gehen", - "REFRESH_INTERACTIONS": "Aktualisieren Interaktionen", - "PENDING": "Ausstehend", - "SEND_AS_PENDING": "Senden als Ausstehend", - "SEND_AND_CLOSE": "Senden und Schließen", - "CANNED_ANSWER_NOT_FOUND": "Es wurden keine vordefinierten Antworten gefunden", - "CANNED_ANSWER_SEARCH": "Geben Sie einen Text ein, um eine vordefinierte Antwort zu suchen", - "NO_MAILCANNEDANSWER_AVAILABLE": "Keine vordefinierten Antworten verfügbar", - "NEW_MAILCANNEDANSWER": "Neue vordefinierte Antowrt", - "ADD_MAILCANNEDANSWER": "Vordefinierte Antwort hinzufügen", - "EDIT_MAILCANNEDANSWER": "Vordefiierte Antwort bearbeiten", - "DELETE_MAILCANNEDANSWER": "Vordefinierte Antwort löschen", + "INTERACTIONS_MAILACCOUNT": "Zu den Interaktionen gehen", + "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", + "PENDING": "Warten auf Rückmeldung", + "SEND_AS_PENDING": "Senden und auf Rückmeldung warten", + "SEND_AND_CLOSE": "Senden und schließen", + "CANNED_ANSWER_NOT_FOUND": "Keine Textvorlagen gefunden", + "CANNED_ANSWER_SEARCH": "Nach Textvorlagen suchen", + "NO_MAILCANNEDANSWER_AVAILABLE": "Keine Textvorlagen verfügbar", + "NEW_MAILCANNEDANSWER": "Neue Textvorlage", + "ADD_MAILCANNEDANSWER": "Textvorlage hinzufügen", + "EDIT_MAILCANNEDANSWER": "Textvorlage bearbeiten", + "DELETE_MAILCANNEDANSWER": "Textvorlage löschen", "SHOW_ORIGINAL_MESSAGE": "Ursprüngliche Nachricht anzeigen", "DELETE_INTERACTION": "Interaktion löschen", "ACCEPTED": "Akzeptiert", "FONT_FAMILY": "Schriftfamilie", "FONT_SIZE": "Schriftgröße", - "MARK_AS_UNREAD": "als ungelesen markieren", - "ADD_MAILSUBSTATUS": "Unterstatus hinzufügen", - "DELETE_MAILSUBSTATUS": "Löschen", - "EDIT_MAILSUBSTATUS": "Bearbeiten", - "MAILSUBSTATUSES": "E-Mail-Unterstatus", - "NEW_MAILSUBSTATUS": "Neuer Unterstatus", - "SEND_AS": "Senden Als", - "COMMAND": "Befehl", + "MARK_AS_UNREAD": "Als ungelesen markieren", + "ADD_MAILSUBSTATUS": "SubStatus hinzufügen", + "DELETE_MAILSUBSTATUS": "SubStatus löschen", + "EDIT_MAILSUBSTATUS": "SubStatus bearbeiten", + "MAILSUBSTATUSES": "E-Mail SubStatus", + "NEW_MAILSUBSTATUS": "Neuer SubStatus", + "SEND_AS": "Senden als", + "COMMAND": "Eingabe", "EDIT_SYSTEM": "System bearbeiten", "SYSTEM": "System", "VARIABLE": "Variable", "NOTIFICATION": "Benachrichtigung", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONSOUND": "Klingen", + "NOTIFICATIONSHAKE": "Schütteln", + "NOTIFICATIONSOUND": "Klingeln", "NOTIFICATIONTEMPLATE": "Vorlage", "WAITFORTHEASSIGNEDAGENT": "Warte auf den zugewiesenen Agenten", "EDIT_TAG": "Tag bearbeiten", - "TAG": "Etikett", - "AGENTTRANSFER": "Agentenübertragung", - "AGENTTRANSFERTIMEOUT": "Zeitlimit für Agentenübertragungen", - "QUEUETRANSFER": "Warteschlangenübertragung", - "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung bei der Warteschlangenübertragung", - "TRANSFER": "Transfer", - "AGENTADD_MAILACCOUNT": "Fügen Sie dem E-Mail-Konto Agent hinzu", + "TAG": "Tag", + "AGENTTRANSFER": "Weiterleitung Agent", + "AGENTTRANSFERTIMEOUT": "Zeitlimit für Agententransfer", + "QUEUETRANSFER": "Weiterleitung Warteschlange", + "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung für Warteschlangentransfer", + "TRANSFER": "Weiterleitung", + "AGENTADD_MAILACCOUNT": "Agenten zum E-Mail Konto hinzufügen", "YOU_ARE_REGISTERED_AS_A": "Sie sind registriert als", - "CANNEDANSWERS": "Vordefinierte Antworten", + "CANNEDANSWERS": "Textvorlagen", "DOWNLOAD_INTERACTION": "Herunterladen", - "MAILCANNEDANSWERS": "Vordefinierte Antworten", - "LOGIN_TIME": "Login-Zeit", - "PAUSE_TIME": "Pausenzeit", + "MAILCANNEDANSWERS": "E-Mail Textvorlagen", + "LOGIN_TIME": "Zeit angemeldet", + "PAUSE_TIME": "Zeit in Pause", "DOWNLOAD": "Herunterladen", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download ohne Anhänge", - "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", - "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause zur Verwendung, wenn die obligatorische Disposition aktiviert ist", - "ADVANCED": "Fortgeschritten", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", - "DOWNLOAD_WITHOUT_ATTACHMENT": "Ohne Anhang herunterladen", - "DOWNLOAD_WITH_ATTACHMENT": "Download mit Anhang", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", + "DOWNLOAD_WITH_ATTACHMENTS": "Herunterlagen inkl. Anhänge", + "TEAMS_ASSOCIATION": "Teamzuweisung", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Qualifizierung pausieren, sofern sonst erforderlich", + "ADVANCED": "Erweitert", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung angehalten", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung läuft", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Herunterladen ohne Anhang", + "DOWNLOAD_WITH_ATTACHMENT": "Herunterladen inkl. Anhang", "LASTMESSAGE": "Letzte Nachricht", "REPLY_TYPE": "Antworttyp" } diff --git a/public/app/main/apps/openchannel/i18n/de.json b/public/app/main/apps/openchannel/i18n/de.json index 0ef1225..d002733 100644 --- a/public/app/main/apps/openchannel/i18n/de.json +++ b/public/app/main/apps/openchannel/i18n/de.json @@ -1,59 +1,59 @@ { "OPENCHANNEL": { "TEXT": "Text", - "TIMES": "Die Anzahl der Zeiten pro Interaktion", - "EDIT_AUTOREPLY": "Bearbeiten Sie automatische Antwort", + "TIMES": "Zeitstempel", + "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", "AUTOREPLY": "Automatische Antwort", "NAME": "Name", - "OPENCHANNELQUEUES": "Offener Kanal Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "OPENCHANNELQUEUES": "Warteschlangen offener Kanal", + "SEARCH_FOR_ANYONE": "Suche", "ERRORS": { - "TEXT_REQUIRED": "Das Feld \"Text\" ist erforderlich", - "NAME_REQUIRED": "Der Name ist erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Der Agent Timeout ist erforderlich", - "MOTIONADDRESS_REQUIRED": "Die Adresse ist erforderlich", - "MOTIONADDRESS_MUST_VALID_URL": "Die Adresse muss in einem gültigen Format", - "ACCEPTURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", - "REJECTURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "CLOSEURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "REPLYURI_REQUIRED": "Die Antwort URL ist erforderlich", - "REPLYURI_MUST_VALID_URL": "Die Antwort URL muss im gültigen Format geschrieben werden", - "PRIORITY_REQUIRED": "Die Priorität ist erforderlich", - "CONDITION_REQUIRED": "Der Zustand ist erforderlich", - "TRUEPRIORITY_REQUIRED": "Die wahre Priorität ist erforderlich", - "FALSEPRIORITY_REQUIRED": "Die falsche Priorität ist erforderlich", + "TEXT_REQUIRED": "Feld \"Text\" ist erforderlich", + "NAME_REQUIRED": "Name ist erforderlich", + "AGENT_TIMEOUT_REQUIRED": "Agent Timeout ist erforderlich", + "MOTIONADDRESS_REQUIRED": "Adresse ist erforderlich", + "MOTIONADDRESS_MUST_VALID_URL": "Adresse ungültiges Format", + "ACCEPTURL_MUST_VALID_URL": "URL ungültiges Format", + "TIMEOUT_REQUIRED": "Timeout ist erforderlich", + "REJECTURL_MUST_VALID_URL": "URL ungültiges Format", + "CLOSEURL_MUST_VALID_URL": "URL ungültiges Format", + "REPLYURI_REQUIRED": "Antwort-URL ungültiges Format", + "REPLYURI_MUST_VALID_URL": "Antwort-URL ungültiges Format", + "PRIORITY_REQUIRED": "Priorität ist erforderlich", + "CONDITION_REQUIRED": "Bedingung ist erforderlich", + "TRUEPRIORITY_REQUIRED": "Wahre Priorität ist erforderlich", + "FALSEPRIORITY_REQUIRED": "Falsche Priorität ist erforderlich", "AGENT_REQUIRED": "Pflichtfeld", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", "DISPOSITION_REQUIRED": "Pflichtfeld", "QUEUE_REQUIRED": "Pflichtfeld", - "KEY_MAX_LENGTH": "Schlüssel muss eine maximale Länge von {{max}}", - "TEXT_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "KEY_MAX_LENGTH": "Schlüssel darf eine maximale Länge haben von {{max}}", + "TEXT_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}}", "VALUE_REQUIRED": "Pflichtfeld", "COMMAND_REQUIRED": "Pflichtfeld", "LIST_REQUIRED": "Pflichtfeld", "KEY_REQUIRED": "Pflichtfeld", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "NAME_MUST_VALID_PATTERN": "Falsches Format", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", + "NAME_MUST_VALID_PATTERN": "Format ungültig", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", "TAG_REQUIRED": "Pflichtfeld", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "AGENTTRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "QUEUETRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", "ACCESSKEYID_REQUIRED": "Zugangsschlüssel-ID ist erforderlich", - "BOTNAME_REQUIRED": "Der Bot-Name ist erforderlich", - "SECRETACCESSKEY_REQUIRED": "Zugangsschlüssel geheim ist erforderlich", + "BOTNAME_REQUIRED": "Bot-Name ist erforderlich", + "SECRETACCESSKEY_REQUIRED": "Geheimer Schlüssel ist erforderlich", "CLIENTEMAIL_REQUIRED": "Pflichtfeld", "PRIVATEKEY_REQUIRED": "Pflichtfeld", "PROJECTID_REQUIRED": "Pflichtfeld" @@ -64,208 +64,208 @@ "GOTOIF": "Gotoif", "NOOP": "Noop", "QUEUE": "Warteschlange", - "EDIT_AGENT": "Agent bearbeiten", - "EDIT_GOTO": "Bearbeiten Gehe zu", - "EDIT_NOOP": "Bearbeiten Noop", - "EDIT_GOTOIF": "Bearbeiten Gotoif", + "EDIT_AGENT": "Agenteb bearbeiten", + "EDIT_GOTO": "Gehe zu bearbeiten", + "EDIT_NOOP": "Noop bearbeiten", + "EDIT_GOTOIF": "GoToIf bearbeiten", "EDIT_QUEUE": "Warteschlange bearbeiten", - "CONDITION": "Zustand", + "CONDITION": "Bedingung", "TRUEPRIORITY": "Wahre Priorität", "FALSEPRIORITY": "Falsche Priorität", "VALUE": "Wert", "PRIORITY": "Priorität", "AGENT_TIMEOUT": "Agent Timeout", "DESCRIPTION": "Beschreibung", - "ADD_OPENCHANNELQUEUE": "Fügen Sie im Offenen Kanal Warteschlange", - "EDIT_OPENCHANNELQUEUE": "Offener Kanal Warteschlange bearbeiten", - "DELETE_OPENCHANNELQUEUE": "Löschen der Warteschlange im Offenen Kanal", - "PENALTY": "Strafe", + "ADD_OPENCHANNELQUEUE": "Warteschlange offener Kanal hinzufügen", + "EDIT_OPENCHANNELQUEUE": "Warteschlange offener Kanal bearbeiten", + "DELETE_OPENCHANNELQUEUE": "Warteschlange offener Kanal löschen", + "PENALTY": "Verzögerung", "TEAMADD_OPENCHANNELQUEUE": "Team zur Warteschlange hinzufügen", - "AGENTADD_OPENCHANNELQUEUE": "Agent zur Warteschlange hinzufügen", + "AGENTADD_OPENCHANNELQUEUE": "Agenten zur Warteschlange hinzufügen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "CREATED_AT": "Erstellt am", "SAVE": "Speichern", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", - "OPENCHANNELACCOUNTS": "Offener Kanal Konten", + "OPENCHANNELACCOUNTS": "Konten offener Kanal", "MOTIONADDRESS": "Motion Adresse", - "ADD_OPENCHANNELACCOUNT": "Öffnen Sie den Channel Account hinzufügen", - "EDIT_OPENCHANNELACCOUNT": "Öffnen Sie den Channel Account bearbeiten", - "DELETE_OPENCHANNELACCOUNT": "Öffnen Sie den Channel Account löschen.", + "ADD_OPENCHANNELACCOUNT": "Konto offener Kanal hinzufügen", + "EDIT_OPENCHANNELACCOUNT": "Konto offener Kanal bearbeiten", + "DELETE_OPENCHANNELACCOUNT": "Konto offener Kanal löschen", "API": "API", - "DISPOSITIONS": "Bestimmungen", + "DISPOSITIONS": "Qualifizierungen", "WEBHOOKS": "WebHooks", "ACTIONS": "Aktionen", "LIST": "Liste", "FIDELITY": "Treue", "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Die Methode", + "ACCEPTMETHOD": "Methode akzeptieren", "ACCEPTURL": "URL akzeptieren", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "In der Nähe", - "CLOSEMETHOD": "In der Nähe Methode", - "CLOSEURL": "Der URL", - "SELECTED": "Ausgewählte", + "CLOSE": "Schließen", + "CLOSEMETHOD": "Methode schließen", + "CLOSEURL": "URL schließen", + "SELECTED": "Ausgewählt", "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "SELECT_NONE": "Nichts auswählen", "BACK": "Zurück", "OPENCHANNEL": "Offener Kanal", - "ID": "Id", + "ID": "ID", "TIMEOUT": "Timeout", - "OPENCHANNELDISPOSITIONS": "Offener Kanal Verfügungen", - "NO_OPENCHANNELDISPOSITION_AVAILABLE": "Keine offenen Kanal Dispositionen verfügbar", - "NEW_OPENCHANNELDISPOSITION": "Neue Offene Kanal inspektion", - "ADD_OPENCHANNELDISPOSITION": "Fügen Sie im Offenen Kanal inspektion", - "EDIT_OPENCHANNELDISPOSITION": "Bearbeiten Sie im Offenen Kanal inspektion", - "DELETE_OPENCHANNELDISPOSITION": "Löschen Sie im Offenen Kanal inspektion", - "NEW_OPENCHANNELQUEUE": "Neue Offene Kanal Warteschlange", - "NEW_OPENCHANNELACCOUNT": "Neue Open Channel Account", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "ALL_TEAMS": "Alle Mannschaften", + "OPENCHANNELDISPOSITIONS": "Qualifizierungen offener Kanal", + "NO_OPENCHANNELDISPOSITION_AVAILABLE": "Keine Qualifizierungen verfügbar", + "NEW_OPENCHANNELDISPOSITION": "Neue Qualifizierung", + "ADD_OPENCHANNELDISPOSITION": "Qualifizierung offener Kanal hinzufügen", + "EDIT_OPENCHANNELDISPOSITION": "Qualifizierung bearbeiten", + "DELETE_OPENCHANNELDISPOSITION": "Qualifizierung löschen", + "NEW_OPENCHANNELQUEUE": "Neue Warteschlange offener Kanal", + "NEW_OPENCHANNELACCOUNT": "Neues Konto offener Kanal", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", "REPLYURI": "Antwort URL", "RECEIVEURI": "Erhalten URL", "HELP": { - "RECEIVEURI": "Dies ist die automatisch generierte API-String müssen Sie die Nachrichten in Ihrem offenen Kanal zu erhalten von der externen Anwendung (POST-Methode verwendet werden muss). Drücken Sie die Zwischenablage, um Sie in die Zwischenablage zu kopieren.", - "REPLYURI": "Dies ist die URL der Offene Kanal wird beim Senden oder Beantworten von Nachrichten", + "RECEIVEURI": "Automatisch generierter API-String, um die Nachrichten über den offenen Kanal zu erhalten (POST-Methode). Zum Kopieren in die Zwischenablage klicken", + "REPLYURI": "URL des offenen Kanals zum Senden und Empfangen von Nachrichten", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", "LIST": "Contact Manager Liste zu verknüpfen von Kontakten", "TOKEN": "Fügen Sie diese Eigenschaft als Abfragezeichenfolge in Ihrer Web-Service-URL hinzu. Weitere Informationen finden Sie im Dokument doc .", - "REGISTRY": "Die amtsleitung Registry, die von einigen Anbietern, die in der Regel defaultuser:Secret@host.", - "FROMDOMAIN": "Legt Standardeinstellungen von:domain in SIP-Nachrichten als SIP-ua (Client). Einige Ziele können die obligatorische Identität Name anstatt nur die IP-Adresse.", - "FROMUSER": "Rovider wie ihr sie kennt. Dies ist der Benutzer, um anstelle der Anrufer-ID beim Tätigen von Anrufen zu anderen Peer (SIP-Proxy). Nur gültig für den Typ=peer.", + "REGISTRY": "Die SIP-Registry, die von einigen Anbietern, die in der Regel defaultuser:Secret@host.", + "FROMDOMAIN": "Legt Standardeinstellungen von:domain in SIP-Nachrichten als SIP-ua (Client).", + "FROMUSER": "SIP-Nutzereinstellungen. Nur gültig für den Typ=peer.", "OUTBOUNDPROXY": "IP-Adresse oder DNS-SRV-Ressourceneintrag name (ausgenommen die _sip._udp-Präfix): SRV Name, den Hostnamen oder die IP-Adresse des ausgehenden SIP-Proxy. Senden Sie ausgehende Signale zu diesem Proxy und nicht direkt an die Geräte. Nur gültig für den Typ=peer.", - "PORT": "Die Nummer des Ports, zu dem Sie eine Verbindung herstellen möchten wir auf der anderen Seite.", - "CONTEXT": "Die nutzbaren Rahmen für den Trunk.", - "TYPE": "Legt das SIP-Rolle innerhalb der Sternchen. User: Wird verwendet, um die Authentifizierung für eingehende - Peer: für ausgehende Anrufe - Freund: Deckt sowohl die Eigenschaften der oben genannten.", - "DTMFMODE": "Wie DTMF (Dual-Tone Multi-Frequency): RFC2833: Die Standardeinstellung, die DTMF gesendet mit RTP, aber außerhalb der Audio Stream. INBAND DTMF gesendet wird: Die in der Audio Stream des aktuellen Gesprächs, wird über die Lautsprecher hörbar. Erfordert eine hohe CPU-Last. INFO: Diese Methode ist zwar sehr zuverlässig, es ist nicht für alle TK-Anlagen und viele SIP-Trunk.", - "NAT": "Ändert das Verhalten von Sternchen für Clients hinter einer Firewall.Wenn der Komma-getrennten Optionen ist \"Nein\", Asterisk ignoriert alle anderen Einstellungen und die nat=No.", + "PORT": "Die Nummer des Ports, zu dem Sie eine Verbindung herstellen möchten.", + "CONTEXT": "Die nutzbaren Kontext für den Trunk.", + "TYPE": "Definiert die SIP-Rolle innerhalb der Anwendung. User: Authentifizierung für eingehende Verbindungen; Peer: für ausgehende Verbindungen - Freund: Beide Eigenschaften werden erfüllt", + "DTMFMODE": "Sendeart von DTMF-Tönen (Dual-Tone Multi-Frequency): RFC2833: Standardeinstellung, DMTF wird über RTP gesendet (außerhalb des Audiostreams) - INBAND DTMF wird innerhalb des Audiostreams gesendet, über die Lautsprecher hörbar. Erfordert eine höhere CPU-Last.", + "NAT": "Ändert das Verhalten von Sternchen für Clients hinter einer Firewall. Wenn \"Nein\", ignoriert der Asterisk alle anderen Einstellungen und die nat=No.", "QUALIFY": "Legt fest, wann die SIP erreichbar ist.", "ALLOWCODECS": "Erlaubt Codecs in der Reihenfolge ihrer Präferenz.", - "INSECURE": "Legt fest, wie Verbindungen mit Peer, dass unsichere Einstellungen.", - "CALL_LIMIT": "Die Anzahl der eingehenden und abgehenden Anrufe, die zu einer Zeit.", - "DIRECTMEDIA": "Sternchen standardmäßig versucht, die RTP-Stream direkt aus den Anrufer an den Angerufenen. Einige Geräte werden nicht unterstützt wird (vor allem, wenn einer von Ihnen hinter einem NAT-Gerät befindet). Die Standardeinstellung ist Ja. Wenn Sie alle Clients hinter einem NAT-Gerät befindet, oder aus einem anderen Grund nicht möchten, dass Sternchen in der Audiospur, können Sie diese ausschalten.", - "CALLCOUNTER": "Aktivieren Sie die Zähler auf Geräte.", - "ADD_PHONE_TO_URI": "Legen Sie fest, ob die Provider ';user=Telefon\" an den URL.", - "TRUST_REMOTE_PARTY_ID": "Wenn Remote-Party-ID definieren sollte.", - "SEND_REMOTE_PARTY_ID_HEADER": "Status", - "ENCRYPTION": "Festlegen, ob die Remote-Party-ID gesendet werden soll (standardmäßig auf Nein).", + "INSECURE": "Erlaubt unsichere Einstellungen für peer", + "CALL_LIMIT": "Maximale Anzahl aller gleichzeitigen ein- und ausgehenden Anrufe", + "DIRECTMEDIA": "Der Asterisk versucht, den RTP-Stream im Standard direkt zwischen dem Anrufer und dem Angerufenen aufzubauen. Manche Geräte (z.B. Firewalls) unterstützen diese Funktion nicht. Daher kann hier eine Umstellung erfolgen.", + "CALLCOUNTER": "Aktivieren der Anrufzähler für die Geräte", + "ADD_PHONE_TO_URI": "Fügt im SIP den user=phone zur URL hinzu", + "TRUST_REMOTE_PARTY_ID": "Soll der URL der anderen Partei vertraut werden?", + "SEND_REMOTE_PARTY_ID_HEADER": "Soll die ID der anderen Partei gesendet werden?", + "ENCRYPTION": "Legt fest, ob die Verbindung über SRTP verschlüsselt vorliegt. Sollte das peer kein SRTP unterstützen, werden Anrufe mit dem HANGUPCAUSE=58 beendet.", "TRANSPORT": "Festlegen der Standardeinstellungen für Transporte. Die Reihenfolge bestimmt den primären Standard.", - "OTHERFIELDS": "Weitere Felder hinzufügen, in der Amtsleitungen conf-Dateien. In Sternchen format (key=value), jedes Feld auf einer Zeile.", - "EMAILADDRESS": "Sie können mehrere Adressen mit Kommata (z. b. John.doe@xcally.com, jane.miller@xcally.com)", + "OTHERFIELDS": "Weitere Felder hinzufügen, in der Trunks conf-Dateien. In Sternchen format (key=value), jedes Feld auf einer Zeile.", + "EMAILADDRESS": "Mehrere Adressen mit Komma getrennt eingeben: (z. b. John.doe@xcally.com, jane.miller@xcally.com)", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "EVENTVARIABLES": "Wenn aktiviert, Es fügt alle Event Variablen an die Url", + "EVENTVARIABLES": "Fügt die Event-Variablen der URL hinzu", "T38PT_UDPTL": "Es: Ja, Redundanz, maxdatagram = 400", "EMAILBCCADDRESS": "Fügen Sie eine oder mehrere durch Kommas getrennte Adressen hinzu (z. B. john.doe@xcally.com, jane.miller@xcally.com).", "EMAILCCADDRESS": "Fügen Sie eine oder mehrere durch Kommas getrennte Adressen hinzu (z. B. john.doe@xcally.com, jane.miller@xcally.com).", - "BODY": "Wenn nicht ausgefüllt, wird der Standardwert gesendet", + "BODY": "(RAW-JSON-Format) Wenn nicht ausgefüllt, wird der Standardwert verwendet", "INFO": "Titel einfügen", "SCRIPT": "Skript einfügen", "SCRIPT_INFO": "Fügen Sie eine Beschreibung für das Skript ein", "SCRIPT_TYPE": "Geben Sie eine Typologie für das Skript ein (zB curl, bash ...)", - "HEADERS": "Hinweis: Der Header-Abschnitt muss im RAW-JSON-Format {\"key\": \"value\"} vorliegen.\nHinweis: Wenn nicht ausgefüllt, wird der Standardwert gesendet", - "TIMEOUT": "Zeitüberschreitung in Sekunden anfordern. Der Wert muss zwischen 1 und 10 liegen und der Standardwert ist 5." + "HEADERS": "Hinweis: Der Header-Abschnitt muss im RAW-JSON-Format {\"key\": \"value\"} vorliegen.\nHinweis: Wenn nicht ausgefüllt, wird der Standardwert verwendet", + "TIMEOUT": "Zeitüberschreitung in Sekunden anfordern. Der Wert muss zwischen 1 und 10 liegen - Standardwert ist 5." }, "EDIT_TRUNK": "Trunk bearbeiten", - "DELETE_TRUNK": "Löschen Sie Trunk", + "DELETE_TRUNK": "Trunk löschen", "CREATED_AT": "Erstellt am", "SETTINGS": "Einstellungen", - "ADVANCED": "Erweiterte", + "ADVANCED": "Erweitert", "OTHER": "Andere", "ACTIVE": "Aktiv", "CONTEXT": "Kontext", - "CALLERID": "Die Anrufer-ID", + "CALLERID": "Anrufer-ID", "TYPE": "Typ", - "DTMFMODE": "Mfv-Modus", + "DTMFMODE": "DTMF-Modus", "NAT": "NAT", "QUALIFY": "Qualifizieren", "ALLOWCODECS": "Codecs erlaubt", "INSECURE": "Unsicher", "REGISTRY": "Registrierung", - "DIRECTMEDIA": "Direkte Medien", + "DIRECTMEDIA": "Direct Media", "CALLCOUNTER": "Anrufzähler", - "FROMDOMAIN": "Aus der Domäne", - "FROMUSER": "Vom Benutzer", - "OUTBOUNDPROXY": "Ausgehender Proxy", - "ADD_PHONE_TO_URI": "Telefon hinzufügen, URL", - "TRUST_REMOTE_PARTY_ID": "Vertrauen Gegenstelle ID", - "SEND_REMOTE_PARTY_ID_HEADER": "Senden einer Partner-ID Header", + "FROMDOMAIN": "From Domain", + "FROMUSER": "From Nutzer", + "OUTBOUNDPROXY": "Outbound Proxy", + "ADD_PHONE_TO_URI": "Telefon zur URL hinzufügen", + "TRUST_REMOTE_PARTY_ID": "Trust Remote Party ID", + "SEND_REMOTE_PARTY_ID_HEADER": "Remote Party im Header senden", "ENCRYPTION": "Verschlüsselung", - "PORT": "Hafen", - "TRANSPORT": "Verkehr", + "PORT": "Port", + "TRANSPORT": "Transport", "SAVE": "Speichern", "VARIABLES": "Variablen", "ADD_VARIABLE": "Variable hinzufügen", "EDIT_VARIABLE": "Variable bearbeiten", "DELETE_VARIABLE": "Variable löschen", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "TAGS": "Tags", - "ADD_TAG": "Variable hinzufügen", - "EDIT_TAG": "Variable bearbeiten", - "DELETE_TAG": "Variable löschen", + "ADD_TAG": "Tag hinzufügen", + "EDIT_TAG": "Tag bearbeiten", + "DELETE_TAG": "Tag löschen", "PAUSES": "Pausen", "ADD_PAUSE": "Pause hinzufügen", "EDIT_PAUSE": "Pause bearbeiten", "DELETE_PAUSE": "Pause löschen", - "ADD_CANNEDANSWER": "Vordefinierte Antwort hinzufügen", - "EDIT_CANNEDANSWER": "Vordefinierte Antwort bearbeiten", - "DELETE_CANNEDANSWER": "Vordefinierte Antwort löschen", + "ADD_CANNEDANSWER": "Textvorlage hinzufügen", + "EDIT_CANNEDANSWER": "Textvorlage bearbeiten", + "DELETE_CANNEDANSWER": "Testvorlage löschen", "KEY": "Schlüssel", "VALUE": "Wert", - "SOUNDS": "Sounds", - "EDIT_SOUND": "Ton bearbeiten", - "DELETE_SOUND": "Sound löschen", - "FINISH": "Fertig stellen", + "SOUNDS": "Audiodateien", + "EDIT_SOUND": "Audiodatei bearbeiten", + "DELETE_SOUND": "Audiodatei löschen", + "FINISH": "Abschließen", "DROP_TO_UPLOAD": "Drop hochladen", "TRIGGERS": "Trigger", - "EDIT_TRIGGER": "Auslöser bearbeiten", - "DELETE_TRIGGER": "Auslöser löschen", + "EDIT_TRIGGER": "Trigger bearbeiten", + "DELETE_TRIGGER": "Trigger löschen", "ADD_TRIGGER": "Trigger hinzufügen", "DELETE": "Löschen", - "AUTOMATIONS": "Automatisierungen", - "EDIT_AUTOMATION": "Bearbeiten einer Automation", + "AUTOMATIONS": "Automation", + "EDIT_AUTOMATION": "Automation bearbeiten", "DELETE_AUTOMATION": "Automation löschen", "ADD_AUTOMATION": "Automation hinzufügen", "INTERVALS": "Intervalle", "EDIT_INTERVAL": "Intervall bearbeiten", - "DELETE_INTERVAL": "Intervall für Löschen.", + "DELETE_INTERVAL": "Intervall löschen", "ADD_INTERVAL": "Intervall hinzufügen", "TOOLS": "Werkzeuge", - "ID": "Id", + "ID": "ID", "AUDIO": "Audio", - "DOWNLOAD_SOUND": "Download Sound", - "UPLOAD_SOUND": "Werkzeuge", + "DOWNLOAD_SOUND": "Audiodatei herunterladen", + "UPLOAD_SOUND": "Audiodatei hochladen", "CHANNEL": "Kanal", "NEW_TRIGGER": "Neue Trigger", "GENERAL": "Allgemein", "STATUS": "Status", "CONDITIONS&ACTIONS": "Bedingungen und Aktionen", - "ALLCONDITIONS": "Alle diese Bedingungen erfüllen:", - "ANYCONDITIONS": "Treffen diese Voraussetzungen:", - "ACTIONS": "Aktionen:", + "ALLCONDITIONS": "Alle Bedingungen werden erfüllt", + "ANYCONDITIONS": "Einige Bedingungen werden erfüllt", + "ACTIONS": "Aktionen", "NEW_AUTOMATION": "Neue Automation", "TIMEOUT": "Timeout", "PEERSTATUS": "Peer Status", - "CALL_LIMIT": "Anrufe beschränken", - "OTHERFIELDS": "Andere Felder", + "CALL_LIMIT": "Anrufe limitieren", + "OTHERFIELDS": "Weitere Felder", "NEW_VARIABLE": "Neue Variable", "NEW_TAG": "Neuer Tag", "NEW_PAUSE": "Neue Pause", - "NEW_CANNEDANSWER": "Neue vordefinierte Antwort", + "NEW_CANNEDANSWER": "Neue Textvorlage", "CONFIRM_PASSWORD": "Passwort bestätigen", - "NEW_TRUNK": "Neue Leitung", - "FROM": "Von", - "TO": "Zu", - "WEEKDAY": "Woche Tag", - "MONTHDAY": "Monat Tag", + "NEW_TRUNK": "Neuer Trunk", + "FROM": "von", + "TO": "an", + "WEEKDAY": "Wochentag", + "MONTHDAY": "Monatstag", "MONTH": "Monat", "ALWAYS": "Immer", "MON": "Montag", @@ -231,22 +231,22 @@ "PASSWORD": "Passwort", "CUSTOMDASHBOARDS": "Benutzerdefinierte Dashboards", "NEW_CUSTOMDASHBOARD": "Neues benutzerdefiniertes Dashboard", - "ADD_CUSTOMDASHBOARD": "Hinzufügen von benutzerdefinierten Dashboard", - "EDIT_CUSTOMDASHBOARD": "Benutzerdefinierte Dashboards bearbeiten", - "DELETE_CUSTOMDASHBOARD": "Benutzerdefiniertes Dashboard löschen.", - "SCHEDULER": "Scheduler", - "NEW_SCHEDULE": "Neuer Zeitplan", - "ADD_SCHEDULE": "Zeitplan hinzufügen", - "EDIT_SCHEDULE": "Zeitplan bearbeiten", - "DELETE_SCHEDULE": "Zeitplan löschen", + "ADD_CUSTOMDASHBOARD": "Benutzerdefiniertes Dashboard hinzufügen", + "EDIT_CUSTOMDASHBOARD": "Benutzerdefiniertes Dashboard bearbeiten", + "DELETE_CUSTOMDASHBOARD": "Benutzerdefiniertes Dashboard löschen", + "SCHEDULER": "Berichtsplanung", + "NEW_SCHEDULE": "Neue Planung", + "ADD_SCHEDULE": "Planung hinzufügen", + "EDIT_SCHEDULE": "Planung bearbeiten", + "DELETE_SCHEDULE": "Planung löschen", "SENDMAIL": "E-Mail senden", "CONFIGURATION": "Konfiguration", "MAIL": "E-Mail", "REPORTTYPE": "Berichtstyp", "REPORT": "Bericht", - "OUTPUT": "Ausgang", + "OUTPUT": "Ausgabe", "EXECUTEON": "Ausführung", - "REPORTRANGE": "Berichtsbereich", + "REPORTRANGE": "Bereich", "VALIDITYSTART": "Startzeit", "VALIDITYEND": "Endzeit", "EXECUTEEVERY": "Alle ausführen", @@ -258,9 +258,9 @@ "MONTHLY": "Monatlich", "PREVIOUS_DAY": "Vorheriger Tag", "LAST_SEVEN_DAYS": "Letzte sieben Tage", - "LAST_THIRTY_DAYS": "33 verbotenen letzte Tage", + "LAST_THIRTY_DAYS": "Letzte 30 Tage", "LAST_MONTH": "Letzter Monat", - "WEEKDAYS": "Woche Tage", + "WEEKDAYS": "Wochentage", "HOUR": "Stunde", "DEFAULT": "Standard", "CSV": "CSV", @@ -268,7 +268,7 @@ "15MIN": "15 Minuten", "30MIN": "30 Minuten", "1H": "1 Stunde", - "VOICE": "Voice", + "VOICE": "Sprachanrufe", "CHAT": "Chat", "SMS": "SMS", "OPENCHANNEL": "Offener Kanal", @@ -293,19 +293,19 @@ "ADD_ALLCONDITION": "Bedingung hinzufügen", "EDIT_ACTION": "Aktion bearbeiten", "DELETE_ACTION": "Aktion löschen", - "NEW_ACTION": "Neue Maßnahme", + "NEW_ACTION": "Neue Aktion", "ADD_ACTION": "Aktion hinzufügen", "QUEUE": "Warteschlange", "CALL_STATUS": "Anrufstatus", - "OUTBOUNDROUTE": "Abgehende Routen", - "EQUALS": "Ist gleich", - "NOT_EQUALS": "Nicht gleich", - "CONTACT_MANAGER": "Contacts Manager", + "OUTBOUNDROUTE": "Ausgehende Routen", + "EQUALS": "ist gleich", + "NOT_EQUALS": "ist nicht gleich", + "CONTACT_MANAGER": "Kontaktmanager", "INTEGRATIONS": "Integrationen", "MOTIONBAR": "Motion Bar", "JSCRIPTY": "Jscripty", - "URL_FORWARD": "URL Weiterleitung", - "WEB_POPUP": "Web Popup", + "URL_FORWARD": "URL-Weiterleitung", + "WEB_POPUP": "Web-Popup", "LIST": "Liste", "INTEGRATION": "Integration", "TEMPLATE": "Vorlage", @@ -317,27 +317,27 @@ "OPERATOR": "Betreiber", "NO_INTERVALS_AVAILABLE": "Keine Intervalle zur Verfügung", "YES": "Ja", - "NO": "Keine", + "NO": "Nein", "SUBJECT": "Betreff", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "BROWSER": "Browser", "INTERVAL": "Intervall", - "INFO": "Info", + "INFO": "Information", "TIME_RANGE": "Zeitbereich", - "WEEK_DAYS": "Woche Tage", - "MONTH_DAYS": "Monat Tage", + "WEEK_DAYS": "Wochentage", + "MONTH_DAYS": "Monatstage", "MONTHS": "Monate", - "DROP_TO_UPLOAD_MESSAGE": "Sie können auch Audiodateien hier ablegen\" hochzuladen. Nur MP3-, WAV-, GSM-Max. 15 MB", + "DROP_TO_UPLOAD_MESSAGE": "Dateien hier hinein ziehen zum Hochladen. Unterstütze Formate: .mp3, .wav, .gsm; Max. Dateigröße: 15 MB", "POLLING_INTERVAL": "Abfrageintervall (Sekunden)", - "DASHBOARD": "Armaturenbrett", - "NEW_DASHBOARDITEM": "Neue Dashboard Widget", + "DASHBOARD": "Dashboard", + "NEW_DASHBOARDITEM": "Neues Dashboard-Widget", "COUNTER": "Zähler", "IFRAME": "IFrame", "CLOCK": "Uhr", - "ADD_DASHBOARDITEM": "Dashboard Widget hinzufügen", - "EDIT_WIDGET": "Bearbeiten Widget", - "DELETE_WIDGET": "Löschen Widget", - "FLIP_WIDGET": "Flip Widget", + "ADD_DASHBOARDITEM": "Dashboard-Widget hinzufügen", + "EDIT_WIDGET": "Widget bearbeiten", + "DELETE_WIDGET": "Widget löschen", + "FLIP_WIDGET": "Widget drehen", "TITLE": "Titel", "UPDATE": "Aktualisieren", "LAYOUT": "Layout", @@ -345,56 +345,56 @@ "FOREGROUND_COLOR": "Vordergrundfarbe", "FOREGROUND_TITLE_COLOR": "Vordergrund Titel Farbe", "THEME": "Thema", - "LIGHT": "Licht", + "LIGHT": "Hell", "DARK": "Dunkel", "TIMEZONE": "Zeitzone", - "DIGITAL_FORMAT": "Digitale Datum Format", + "DIGITAL_FORMAT": "Digitales Datumsformat", "TOOLS_QUERY": "Abfrage", - "SELECT": "Wählen Sie", + "SELECT": "Auswählen", "WHERE": "Wo", "BACK": "Zurück", "PROJECT": "Projekt", - "GOTOREALTIME_TRUNK": "In Echtzeit, Trunk gehen", - "GOTO_TRUNK": "Um die Leitungsbündel gehen", - "CRON": "Cron", + "GOTOREALTIME_TRUNK": "Zum Echtzeitmonitoring SIP-Trunks gehen", + "GOTO_TRUNK": "Zum SIP-Trunk gehen", + "CRON": "CrOn", "MINUTES": "Minuten", "HOURLY": "Stündlich", "YEARLY": "Jährlich", "EVERY": "Jede", "MINUTE": "Minute", - "ON_SECOND": "Im 2.", - "HOUR_ON_MINUTE": "Stunde Minute", - "AND_SECOND": "Und 2.", - "DAY_AT": "Tag an", + "ON_SECOND": "Zur Sekunde", + "HOUR_ON_MINUTE": "Stunde zur Minute", + "AND_SECOND": "und Sekunde", + "DAY_AT": "Am Tag", "START_TIME": "Startzeit", - "ON_THE": "Auf der", - "OF_EVERY": "Jedes", + "ON_THE": "Am", + "OF_EVERY": "An jedem", "MONTH_AT": "Monat", - "AT": "An", + "AT": "Um", "LAST": "Letzte", "LASTUNIT": "Einheit", "MAILACCOUNT": "E-Mail Konto", - "OF": "Von", + "OF": "von", "PAST_THE_HOUR": "Nach der vollen Stunde", "DAY": "Tag", "WEEK": "Woche", "YEAR": "Jahr", - "ON": "Auf", + "ON": "Am", "PAI": "P-Asserted-Identity", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OUTBOUND_ROUTE": "Abgehende Routen", - "EVENTVARIABLES": "Bei Variablen", + "OUTBOUND_ROUTE": "Ausgehende Routen", + "EVENTVARIABLES": "Event-Variablen", "FAX": "Fax", "INTERACTION": "Interaktion", "MESSAGE": "Nachricht", "T38PT_UDPTL": "T38 pt Udptl", - "AUTOCREATECONTACT": "Erstellen Sie automatisch", + "AUTOCREATECONTACT": "Automatische Kontakterstellung", "COLOR": "Farbe", - "LOCATION": "Lage", - "NEW_TAB": "Neue Registerkarte", + "LOCATION": "Standort", + "NEW_TAB": "Neuer Tab", "NEW_WINDOW": "Neues Fenster", - "WINDOWWIDTH": "Fenster Breite (px)", + "WINDOWWIDTH": "Fensterbreite (px)", "WINDOWHEIGHT": "Fensterhöhe (px)", "EDIT_DASHBOARDITEM": "Dashboard-Widget bearbeiten", "FONTSIZE": "Schriftgröße", @@ -404,21 +404,21 @@ "FOREGROUND": "Vordergrund", "NONE": "Keiner", "TOTAL": "Gesamt", - "ABANDONED": "Verlassen", + "ABANDONED": "Abgebrochen", "WAITING": "Warten", - "TALKING": "Reden", - "ANSWERED": "Antwortete", - "UNMANAGED": "Nicht verwaltet", + "TALKING": "im Gespräch", + "ANSWERED": "Beantwortet", + "UNMANAGED": "Nicht bearbeitet", "CUSTOMTYPE": "Benutzerdefiniert [Pfad]", "WEBREPORT": "Webbericht", "PIECHART": "Kuchendiagramm", "MULTIBARCHART": "Multibar-Diagramm", "MOVE_WIDGET": "Widget verschieben", - "USERADD_CUSTOMDASHBOARD": "Hinzufügen von Benutzerberechtigungen", - "GOTODASHBOARD_CUSTOMDASHBOARD": "Gehe zum Vorschau-Dashboard", - "GOTO_CUSTOMDASHBOARD": "Gehe zum Vorschau-Dashboard", + "USERADD_CUSTOMDASHBOARD": "Berechtigungen hinzufügen", + "GOTODASHBOARD_CUSTOMDASHBOARD": "Vorschau Dashboard", + "GOTO_CUSTOMDASHBOARD": "Vorschau Dashboard", "METRIC": "Metrisch", - "FILTERVOICEQUEUES": "Voice-Warteschlangen filtern", + "FILTERVOICEQUEUES": "Anruf-Warteschlangen filtern", "SERIE1": "Serie 1", "SERIE2": "Serie 2", "SERIE3": "Serie 3", @@ -428,43 +428,43 @@ "ALL_USERS": "Alle Nutzer", "SELECTED_USERS": "Ausgewählte Benutzer", "ADD_WIDGET": "Widget hinzufügen", - "NEXTCONTACT": "Nächster", + "NEXTCONTACT": "Nächster Kontakt", "SENDIFEMPTY": "Senden, wenn leer", - "CANCEL": "Stornieren", + "CANCEL": "Abbrechen", "UPLOADING": "Hochladen", - "EMAILBCCADDRESS": "Bcc", - "EMAILCCADDRESS": "Cc", - "RUN_SCHEDULE": "Zeitplan ausführen", - "ADD_DISPOSITION": "Disposition hinzufügen", - "DELETE_DISPOSITION": "Disposition löschen", - "DISPOSITIONS": "Dispositionen", - "EDIT_DISPOSITION": "Disposition bearbeiten", - "NEW_DISPOSITION": "Neue Disposition", - "CLONE_TRUNK": "Klon-Trunk", - "BODY": "Karosserie", - "CANNEDANSWERS": "Vordefinierte Antworten", + "EMAILBCCADDRESS": "BCC", + "EMAILCCADDRESS": "CC", + "RUN_SCHEDULE": "Zeitplanung ausführen", + "ADD_DISPOSITION": "Qualifizierung hinzufügen", + "DELETE_DISPOSITION": "Qualifizierung löschen", + "DISPOSITIONS": "Qualifizierungen", + "EDIT_DISPOSITION": "Qualifizierung bearbeiten", + "NEW_DISPOSITION": "Neue Qualifizierung", + "CLONE_TRUNK": "Trunk klonen", + "BODY": "Textinhalt", + "CANNEDANSWERS": "Textvorlagen", "REPORTFOLDER": "Berichtsordner", - "REPORTSUBFOLDER": "Unterordner melden", - "PREVIOUSCONTACT": "Bisherige", + "REPORTSUBFOLDER": "Unterordner", + "PREVIOUSCONTACT": "Vorherigen Kontakt", "VIDEOSUPPORT": "Video-Unterstützung", "AGENT": "Agent", "HEADERS": "Überschriften", "SCRIPT": "Skript", - "SCRIPT_INFO": "Info", + "SCRIPT_INFO": "Information", "SCRIPT_TYPE": "Art", "MOTION_TAB": "Neue Registerkarte \"Agent Dashboard\"", "WHATSAPP": "WhatsApp Connector", "AUTOCREATE_FIELD": "Feld automatisch erstellen", - "GLOBALS": "Globals", + "GLOBALS": "Globale Werte", "SEARCH_FIELDS": "Suchfelder", "STANDARD": "Standard", "MOTION_BAR": "Motion Bar", "ALL": "Alle", - "ALL_DISPOSITIONS": "Alle Dispositionen", - "FIRST_LEVEL_DISPOSITION": "First Level Disposition", - "LEVEL": "Niveau", - "SECOND_LEVEL_DISPOSITION": "Disposition der zweiten Ebene", - "SELECT_LEVEL": "Wählen Sie eine Ebene", - "TITLEFONTSIZE": "Schrifttitelgröße" + "ALL_DISPOSITIONS": "Alle Qualifizierungen", + "FIRST_LEVEL_DISPOSITION": "Qualifizierung der ersten Ebene", + "LEVEL": "Ebene", + "SECOND_LEVEL_DISPOSITION": "Qualifizierung der zweiten Ebene", + "SELECT_LEVEL": "Ebene auswählen", + "TITLEFONTSIZE": "Schriftgröße Titel" } } diff --git a/public/app/main/apps/voice/i18n/de.json b/public/app/main/apps/voice/i18n/de.json index c698d09..b21bd68 100644 --- a/public/app/main/apps/voice/i18n/de.json +++ b/public/app/main/apps/voice/i18n/de.json @@ -1,68 +1,68 @@ { "VOICE": { - "GOTO_VOICEQUEUE": "Zu Realtime Voice Warteschlangen gehen", - "GOTOREALTIME_VOICEQUEUE": "Zu Realtime Voice Warteschlangen gehen", + "GOTO_VOICEQUEUE": "Zur Anruf-Warteschlange gehen", + "GOTOREALTIME_VOICEQUEUE": "Zur Echtzeitansicht Anruf-Warteschlange gehen", "NAME": "Name", "LOGOUT": "An-/Abmelden", - "VOICEQUEUES": "Voice Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "VOICEQUEUES": "Anruf-Warteschlangen", + "SEARCH_FOR_ANYONE": "Suche", "BACK": "Zurück", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", - "DELETE_VOICEDISPOSITION": "Disposition löschen", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "EDIT_VOICEQUEUE": "Edit Voice Warteschlange", - "DELETE_VOICEQUEUE": "Warteschlange löschen", - "MOHSOUNDS": "Die MOH-Sounds", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", + "DELETE_VOICEDISPOSITION": "Qualifizierung löschen", + "EDIT_VOICEDISPOSITION": "Qualifizierung bearbeiten", + "EDIT_VOICEQUEUE": "Anruf-Warteschlange bearbeiten", + "DELETE_VOICEQUEUE": "Anruf-Warteschlange löschen", + "MOHSOUNDS": "MOH-Töne", "STRATEGY": "Strategie", "DESCRIPTION": "Beschreibung", - "ADD_VOICEQUEUE": "Hinzufügen von Warteschlangen", + "ADD_VOICEQUEUE": "Warteschlangen hinzufügen", "CREATED_AT": "Erstellt am", - "CANT_PLAY_GSM_AUDIO_FILES": "Nicht gsm-Audiodateien", + "CANT_PLAY_GSM_AUDIO_FILES": "Nicht GSM-Audiodateien", "APPLICATIONS_LIST": "Liste der Anwendungen", "LEGEND": { "CUSTOM_APPLICATION": "(*) - Benutzerdefinierte Anwendung." }, "ERRORS": { - "NAME_REQUIRED": "Der Name ist erforderlich", - "APPLICATION_NAME_REQUIRED": "Der Name der Anwendung ist erforderlich", - "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", - "PHONENUMBER_REQUIRED": "Die Telefonnummer ist erforderlich", - "CONTEXT_REQUIRED": "Der Rahmen ist erforderlich", - "DESTINATIONPATTERN_REQUIRED": "Das Ziel-pattern ist erforderlich", - "FULLNAME_REQUIRED": "Der vollständige Name ist erforderlich", - "EMAIL_REQUIRED": "Die E-Mail ist erforderlich", - "EMAIL_MUST_VALID": "Die e-Mail muss in einem gültigen Format", - "MAILBOX_REQUIRED": "Die Mailbox ist erforderlich", - "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", - "CONFIRM_NOT_MATCH": "Die Kennwörter stimmen nicht überein.", - "TIMEZONE_REQUIRED": "Die Zeitzone ist erforderlich", - "PREFIX_REQUIRED": "Das Präfix ist erforderlich", - "OPTIONS_REQUIRED": "Die Optionen sind Erforderlich", - "AFTERCALLWORKDURATION_REQUIRED": "Die Arbeit nach Anruf Dauer ist erforderlich", - "TECHNOLOGY/RESOURCE_REQUIRED": "Die Technologie/Ressource erforderlich ist", - "PHONE_REQUIRED": "Die Telefonnummer ist erforderlich", - "VALUE_REQUIRED": "Der Wert ist erforderlich", - "EXTENSION_REQUIRED": "Die Verlängerung ist erforderlich", - "PRIORITY_REQUIRED": "Die Priorität ist erforderlich", - "NAME_MUST_VALID_PATTERN": "Der Name muss in einem gültigen Format geschrieben werden", - "APPLICATION_REQUIRED": "Die Anwendung ist erforderlich", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Timeout muss größer als oder gleich", - "MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die max. Länge muss größer als oder gleich", - "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Wiederholung muss größer als oder gleich", - "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Nachlese Zeit muss größer als oder gleich", - "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Das Gewicht muss größer als oder gleich", - "ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Häufigkeit verkünden muss größer als oder gleich", - "MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Min Frequenz ankündigen muss größer als oder gleich", - "PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die periodische Frequenz ankündigen muss größer als oder gleich", - "AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Arbeit nach Anruf Dauer muss größer als oder gleich", - "MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Verzögerung muss größer als oder gleich", - "POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Position muss größer als oder gleich", - "CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Den Schnitt stellen muss größer als oder gleich", - "MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Muss die Max Sekunden größer als oder gleich", - "MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Max Meldungen muss größer als oder gleich", - "MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Max Meldungen muss kleiner als oder gleich", + "NAME_REQUIRED": "Name ist erforderlich", + "APPLICATION_NAME_REQUIRED": "Name der Anwendung ist erforderlich", + "TIMEOUT_REQUIRED": "Timeout ist erforderlich", + "PHONENUMBER_REQUIRED": "Telefonnummer ist erforderlich", + "CONTEXT_REQUIRED": "Kontext ist erforderlich", + "DESTINATIONPATTERN_REQUIRED": "Ziel-Pattern ist erforderlich", + "FULLNAME_REQUIRED": "Vollständiger Name ist erforderlich", + "EMAIL_REQUIRED": "E-Mail ist erforderlich", + "EMAIL_MUST_VALID": "E-Mail Format ungültig", + "MAILBOX_REQUIRED": "Mailbox ist erforderlich", + "PASSWORD_REQUIRED": "Passwort ist erforderlich", + "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", + "TIMEZONE_REQUIRED": "Zeitzone ist erforderlich", + "PREFIX_REQUIRED": "Präfix ist erforderlich", + "OPTIONS_REQUIRED": "Bedingungen sind Erforderlich", + "AFTERCALLWORKDURATION_REQUIRED": "Dauer Nacharbeit ist erforderlich", + "TECHNOLOGY/RESOURCE_REQUIRED": "Ressource ist erforderlich", + "PHONE_REQUIRED": "Telefonnummer ist erforderlich", + "VALUE_REQUIRED": "Wert ist erforderlich", + "EXTENSION_REQUIRED": "Nebenstelle ist erforderlich", + "PRIORITY_REQUIRED": "Priorität ist erforderlich", + "NAME_MUST_VALID_PATTERN": "Format Name ungültig", + "APPLICATION_REQUIRED": "Anwendung ist erforderlich", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Timeout muss größer oder gleich sein als", + "MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die max. Länge muss größer oder gleich sein als", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wiederversuche muss größer oder gleich sein als", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Nacharbeit Zeit muss größer oder gleich sein als", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gewichtung muss größer oder gleich sein als", + "ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Frequenz der Ansagen muss größer oder gleich sein als", + "MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Min. Frequenz der Ansagen muss größer oder gleich sein als", + "PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wiederholende Frequenz der Ansagen muss größer oder gleich sein als", + "AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Nacharbeit Zeit muss größer oder gleich sein als", + "MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Verzögerung muss größer oder gleich sein als", + "POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Position muss größer oder gleich sein als", + "CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Schnitt muss größer oder gleich sein als", + "MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Sekundenmuss größer oder gleich sein als", + "MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Nachrichten muss größer oder gleich sein als", + "MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Nachrichten muss kleiner oder gleich sein als", "CALLERIDALL_MUST_VALID_PATTERN": "Falsches Format", "OUTBOUNDROUTE_REQUIRED": "Pflichtfeld", "VARIABLE_REQUIRED": "Pflichtfeld", @@ -70,187 +70,186 @@ "TRUNK_REQUIRED": "Pflichtfeld", "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", "PROJECT_REQUIRED": "Pflichtfeld", - "PENALTY_REQUIRED": "Sie müssen einen Wert für die Strafe angeben" + "PENALTY_REQUIRED": "Wert für Verzögerung erforderlich" }, "GENERAL": "Allgemein", "TIMEOUT": "Timeout", "MAXLENGTH": "Maximale Länge", - "RETRY": "Versuchen Sie es erneut", - "WRAPUPTIME": "-Zeit", - "WEIGHT": "Gewicht", - "JOINWHENEMPTY": "Melden Sie wenn sie leer sind", - "LEAVEWHENEMPTY": "Wenn sie leer lassen", + "RETRY": "Bitte erneut versuchen", + "WRAPUPTIME": "Nacharbeit", + "WEIGHT": "Gewichtung", + "JOINWHENEMPTY": "Beitreten, wenn leer", + "LEAVEWHENEMPTY": "Verlassen, wenn leer", "HELP": { - "TIMEOUT": "Gibt die Anzahl von Sekunden an, die das Gerät.", - "MAXLENGTH": "Gibt die maximale Anzahl der Anrufer, die in der Warteschlange. Ein Wert von Null bedeutet, dass eine unbegrenzte Anzahl von Anrufern in der Warteschlange sind erlaubt.", - "RETRY": "Gibt die Anzahl der Sekunden, die gewartet wird, bevor das nächste Mitglied in die Warteschlange, wenn der Wert für die Zeitüberschreitung erschöpft ist, während versucht wird, den ein Mitglied der Warteschlange.", - "WRAPUPTIME": "Die Anzahl der Sekunden, die ein Mitglied in einer Warteschlange verfügbar, nachdem Sie einen Anruf.", - "WEIGHT": "Legt das Gewicht einer Warteschlange. Eine Warteschlange mit einem höheren Gewicht definiert werden erste Priorität, wenn Mitglieder, die mit mehreren Warteschlangen.", - "JOINWHENEMPTY": "Steuert, ob ein Anrufer wird zur Warteschlange hinzugefügt werden, wenn keine Mitglieder verfügbar sind.", - "LEAVEWHENEMPTY": "Zur Kontrolle, ob die Anrufer aus der Warteschlange, wenn die Mitglieder nicht mehr bereit sind, Anrufe zu beantworten.", - "ANNOUNCEFREQUENCY": "Legt fest, wie oft sollten wir den Anrufer ankündigen und/oder geschätzte Wartezeit in der Warteschlange. Setzen Sie diesen Wert auf Null, um die Funktion zu deaktivieren.", - "MINANNOUNCEFREQUENCY": "Gibt die minimale Zeit, die verstreichen müssen, bevor wir Ihnen die Anrufer in der Warteschlange wieder. Dieser wird verwendet, wenn der Anrufer die Position kann sich häufig ändern, um zu verhindern, dass der Anrufer hören mehrere Updates in einem kurzen Zeitraum.", - "PERIODICANNOUNCEFREQUENCY": "Gibt an, wie oft wir sollten regelmäßige Ansagen, die dem Anrufer vorgespielt werden.", - "ANNOUNCEPOSITIONLIMIT": "Sie kann verwendet werden, wenn Sie definiert haben, verkünden-Position entweder als Begrenzung oder mehr.", - "AFTERCALLWORKDURATION": "Die Dauer der Pause durch die Option \"Arbeit nach Anruf", - "MEMBERDELAY": "Sie kann verwendet werden, wenn Sie wollen, dass es eine Verzögerung, bevor der Anrufer und Mitglied der Warteschlange, die miteinander verbunden sind.", - "MUSICONHOLD": "Setzt die Musik klasse verwendet werden, die von einer bestimmten Warteschlange an.", - "ANNOUNCETOAGENT": "Für die Wiedergabe einer Ansage auf den Agenten, der den Anruf entgegengenommen hat, ihn wissen zu lassen, was der Anrufer die Warteschlange aus.", - "RANDOMPERIODICANNOUNCE": "Falls auf Ja eingestellt, wird die festgelegte regelmäßige Mitteilungen in einer zufälligen Reihenfolge.", - "ANNOUNCEHOLDTIME": "Legt fest, ob die geschätzte Wartezeit gespielt werden sollte zusammen mit den regelmäßigen Ankündigungen.", - "ANNOUNCECALLERPOSITION": "Legt fest, ob es sich bei dem Anrufer seine Position in der Warteschlange mitgeteilt werden sollten. Wenn die Einstellung Nein lautet, die Position wird nicht bekannt gegeben. Falls auf Ja eingestellt, wird die Position des Anrufers wird immer bekannt gegeben. Wenn der Wert überschritten wird, wird der Anrufer hört ihre Position in der Warteschlange nur, wenn er sich innerhalb der Grenze von AK-Position. Wenn der Wert auf Mehr, hört der Anrufer ihre Position, wenn es über die Zahl von AK-Position.", - "REPORTHOLDTIMEAGENT": "Die Berichterstattung über die CLI des Anrufers mit der Zeit in der Warteschleife in der Warteschlange vor.", - "PERIODICANNOUNCE": "Eine Reihe von regelmäßigen Mitteilungen gespielt zu werden, in der Reihenfolge wiedergegeben, in der sie definiert sind.", - "HOLDTIMEANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Hold\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "YOUARENEXTANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Sie sind jetzt in erster Linie\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "THEREAREANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Es gibt\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "WAITINGCALLSANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Wartende Anrufe\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "ESTIMATEDHOLDTIMEANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Die voraussichtliche Wartezeit ist\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "MINUTESANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"min\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "MINUTEANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"min\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "SECONDSANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Sekunden\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "THANKYOUANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Vielen Dank für Ihre Geduld.\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "AFTERCALLWORK": "Wenn der Agent aktiv ist, wird auf eine Pause nach einer abgeschlossenen Anruf in der Warteschlange", - "AUTOPAUSE": "Aktiviert/Deaktiviert die automatische Unterbrechung der Mitglieder, die es versäumen, um einen Anruf zu beantworten. Wenn aktiv, wird diese Mitgliedstaaten angehalten zu werden in allen Warteschlangen er Mitglied ist.", - "RINGINUSE": "Verwendet werden, um zu vermeiden, Senden von Anrufen an Mitglieder, deren Status im Einsatz ist.", - "TIMEOUTRESTART": "Falls auf Ja eingestellt, wird das Timeout für einen Agenten zu beantworten, wenn entweder ein Besetztzeichen oder wird mit dem Status \"Überlastung des Kanals.", - "CONTEXT": "Ermöglicht einem Anrufer zu beenden, die die Warteschlange durch Drücken einer einzigen Taste MFV-Ziffer. Wenn Sie einen Kontext angegeben ist und der Anrufer gibt eine Zahl, Ziffer wird versuchen, die angepasst werden können, im Rahmen festgelegt, und es wird auch weiterhin die Ausführung Nummernplan.", - "SETINTERFACEVARIABLES": "Falls auf Ja eingestellt, kurz vor dem Anrufer, die mit einer Warteschlange, die einige Variablen werden(siehe wiki)", - "SETQUEUEVARIABLES": "Falls auf Ja eingestellt, kurz vor dem Anrufer, die mit einer Warteschlange und kurz vor dem Anrufer die Warteschlange verlassen einige Variablen werden(siehe wiki)", - "SETQUEUEENTRYVARIABLES": "Falls auf Ja eingestellt, kurz vor dem Anrufer, die mit einer Warteschlange, die einige Variablen werden(siehe wiki)", + "TIMEOUT": "Zeitüberschreitung in Sekunden", + "MAXLENGTH": "Maximaler Anrufer in der Warteschlange. Wenn Wert 0, dann keine Begrenzung.", + "RETRY": "Klingelzeit in Sekunden pro Mitglied. Danach erfolgt ein weiterer Versuch bei der nächsten freien Nebenstelle.", + "WRAPUPTIME": "Nacharbeitszeit in Sekunden, bis ein Nutzer nach einem Anruf wieder verfügbar ist.", + "WEIGHT": "Gewichtung der Warteschlange. Ein höherer Wert bedeutet eine Priorisierung gegenüber anderen Warteschlangen.", + "JOINWHENEMPTY": "Legt fest, ob ein Anruf in die Warteschlange eintreten kann, wenn dort keine Nutzer angemeldet sind.", + "LEAVEWHENEMPTY": "Wirft den Anruf aus der Warteschlange, wenn dort kein Nutzer angemeldet ist.", + "ANNOUNCEFREQUENCY": "Intervall für automatische Ansagen der Wartezeit, Position, etc. Der Wert 0 deaktiviert diese Option.", + "MINANNOUNCEFREQUENCY": "Minimales Intervall für die Ansagen der Wartezeit. Verhindert, dass ein Nutzer bei häufigen Wechsel der Warteposition zu viele Ansagen erhält.", + "PERIODICANNOUNCEFREQUENCY": "Legt fest, wie oft die sich wiederholenden Ansagen gespielt werden sollen", + "ANNOUNCEPOSITIONLIMIT": "Wird verwendet, wenn der Wert für die Warteposition auf \"Limitierung\" oder \"Mehr\" gestellt wird.", + "AFTERCALLWORKDURATION": "Die Dauer der Nacharbeit nach einem Anruf", + "MEMBERDELAY": "Erstellt eine Verzögerung des Anrufes für bestimmte Agenten. Kann zum Skillbasierten Routing verwendet werden.", + "MUSICONHOLD": "Legt die Haltemusik auf Basis der Warteschlange fest", + "ANNOUNCETOAGENT": "Legt fest, ob der Agent vor Annahme des Anrufes einen Hinweis auf die eingehende Warteschlange hört", + "RANDOMPERIODICANNOUNCE": "Bei ja, werden die zugewiesenen Ansagen zufällig abgespielt", + "ANNOUNCEHOLDTIME": "Spielt die geschätzte Wartezeit zusammen oder ohne die sich wiederholenden Ansagen ab.", + "ANNOUNCECALLERPOSITION": "Definiert die Ansage der Warteposition für den Anrufer. Nein = Niemals; Ja = Immer; Limitierung = nur, wenn die Zeit innerhalb dem eingetragenen Wert liegt; Mehr = nur, wenn die Zeit oberhalb dem eingetragenen Wert liegt ", + "REPORTHOLDTIMEAGENT": "Haltezeiten der Agenten in den Berichten verwenden", + "PERIODICANNOUNCE": "Sich wiederholende Ansagen; können je nach Konfiguration in definierter Reihenfolge oder zufällig abgespielt werden.", + "HOLDTIMEANNOUNCE": "Ansage der Wartezeit. Leer lassen zum Überspringen", + "YOUARENEXTANNOUNCE": "Ansage \"Sie sind an erster Position der Warteschlange\", Leer lassen zum Überspringen", + "THEREAREANNOUNCE": "Ansage \"Es befinden sich..\" Leer lassen zum Überspringen", + "WAITINGCALLSANNOUNCE": "Ansage \"...Anrufe in der Warteschlange\" Leer lassen zum Überspringen", + "ESTIMATEDHOLDTIMEANNOUNCE": "Ansage: \"Die geschätzte Wartezeit beträgt derzeit...\" Leer lassen zum Überspringen", + "MINUTESANNOUNCE": "Ansage \"Minuten\"", + "MINUTEANNOUNCE": "Ansage \"Minute\"", + "SECONDSANNOUNCE": "Ansage \"Sekunden\" Leer lassen zum Überspringen", + "THANKYOUANNOUNCE": "Ansage \"Vielen Dank für Ihre Geduld\" Leer lassen zum Überspringen", + "AFTERCALLWORK": "Wenn aktiviert, erhalten die Agenten eine kurze Pause nach jedem Anruf", + "AUTOPAUSE": "Aktiviert/Deaktiviert die automatische Pause der Agenten, bei einem verpassten Anruf. Hinweis: bezieht sich dann auf alle Anruf-Warteschlangen des Agenten.", + "RINGINUSE": "Verhindert das Klingeln bei Agenten, deren Nebenstelle in Verwendung ist", + "TIMEOUTRESTART": "Wenn ja, wird die Zeitüberschreitung bei Agenten mit \"Besetzt\" oder \"Verbindungsfehler\"-Status übersprungen", + "CONTEXT": "Ermöglicht einem Anrufer, durch Drücken einer einzelnen Taste, die Warteschlange zu verlassen.", + "SETINTERFACEVARIABLES": "Definiert die Variablen im Interface, welche bei einem Anruf übergeben werden können. ", + "SETQUEUEVARIABLES": "Definiert die Variablen in der Warteschlange, welche bei einem Anruf übergeben werden können. ", + "SETQUEUEENTRYVARIABLES": "Definiert die Variablen beim Eintritt in die Warteschlange, welche bei einem Anruf übergeben werden können. ", "RECORDING": "Aktivieren der Aufzeichnung", - "VOICEMAIL_CONTEXT": "Im Rahmen der relativen Erweiterung.", + "VOICEMAIL_CONTEXT": "Kontext der verwendeten Nebenstellen", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", "CALLERIDALL": "Unterstützte Formate: \"CallerId\" & lt; number & gt;", "CALLER_ID": "Unterstützte Formate: \"CallerId\" & lt; number & gt;", - "MANDATORYDISPOSITIONPAUSEID": "Pausenstatus, der während der Zwangsdisposition festgelegt werden soll", - "SERVICELEVEL": "Zweite Einstellungen für Service Level (Standard = 0, kein SL). Wird für Service Level-Statistiken verwendet (Anrufe werden innerhalb des Service Level-Zeitrahmens beantwortet)", - "MONITORFORMAT": "Gibt das Format der Aufnahmedatei an. Wenn es auf 'inaktiv' gesetzt ist, werden Anrufe nicht aufgezeichnet", - "SAVE_ROUTES": "Die Streckenführung wurde geändert. Denken Sie daran, zu speichern, wenn Sie Ihre Änderungen nicht verlieren möchten." + "MANDATORYDISPOSITIONPAUSEID": "Pausenstatus, welcher während einer erforderlichen Qualifizierung verwendet wird", + "SERVICELEVEL": "Zweite Einstellungen für Service-Level (Standard = 0, kein SL). Wird für Service Level-Statistiken verwendet (Anrufe werden innerhalb des Service Level-Zeitrahmens beantwortet)", + "MONITORFORMAT": "Gibt das Format der Aufzeichnungsdatei an. Bei 'inaktiv', werden Anrufe nicht aufgezeichnet" }, - "MUSICONHOLD": "Musik auf Halten", - "ANNOUNCETOAGENT": "Geben Sie Agent", - "ANNOUNCEMENTS": "Ankündigungen", - "ADVANCED": "Erweiterte", - "ANNOUNCEFREQUENCY": "Frequenz ankündigen", - "MINANNOUNCEFREQUENCY": "Minimale Frequenz ankündigen", - "PERIODICANNOUNCEFREQUENCY": "Periodische Frequenz ankündigen", - "RANDOMPERIODICANNOUNCE": "Random Periodische verkünden", - "ANNOUNCEHOLDTIME": "Geben Sie Zeit", - "ANNOUNCECALLERPOSITION": "Position des Anrufers bekannt", - "ANNOUNCEPOSITIONLIMIT": "Geben Position Limit", - "REPORTHOLDTIMEAGENT": "Bericht Agenten", - "PERIODICANNOUNCE": "Periodische verkünden", - "HOLDTIMEANNOUNCE": "Zeit in der Warteschleife verkünden", - "YOUARENEXTANNOUNCE": "\"Sie sind weiter' verkünden", - "THEREAREANNOUNCE": "'Es gibt' verkünden", - "WAITINGCALLSANNOUNCE": "Wartende Anrufe,", - "ESTIMATEDHOLDTIMEANNOUNCE": "Geschätzte Zeit halten,", - "MINUTESANNOUNCE": "Minuten ankündigen", - "MINUTEANNOUNCE": "Minute verkünden", - "SECONDSANNOUNCE": "Sekunden,", + "MUSICONHOLD": "Wartemusik", + "ANNOUNCETOAGENT": "Ansage an Agenten", + "ANNOUNCEMENTS": "Ansagen", + "ADVANCED": "Erweitert", + "ANNOUNCEFREQUENCY": "Ansagefrequenz", + "MINANNOUNCEFREQUENCY": "Min. Ansagefrequenz", + "PERIODICANNOUNCEFREQUENCY": "Frequenz wiederholende Ansagen", + "RANDOMPERIODICANNOUNCE": "Zufällige Ansagen", + "ANNOUNCEHOLDTIME": "Wartezeit ansagen", + "ANNOUNCECALLERPOSITION": "Warteposition ansagen", + "ANNOUNCEPOSITIONLIMIT": "Limitierung Warteposition ansagen", + "REPORTHOLDTIMEAGENT": "Haltezeit in Agentenbericht", + "PERIODICANNOUNCE": "Wiederholende Ansagen", + "HOLDTIMEANNOUNCE": "Wartezeit ansagen", + "YOUARENEXTANNOUNCE": "Erste Position", + "THEREAREANNOUNCE": "Es befinden sich", + "WAITINGCALLSANNOUNCE": "Wartende Anrufe", + "ESTIMATEDHOLDTIMEANNOUNCE": "Geschätzte Wartezeit ansagen", + "MINUTESANNOUNCE": "Minuten", + "MINUTEANNOUNCE": "Minute", + "SECONDSANNOUNCE": "Sekunden", "THANKYOUANNOUNCE": "'Vielen Dank' verkünden", "AUTOPAUSE": "Auto Pause", - "AFTERCALLWORK": "Arbeit nach Anruf", - "AFTERCALLWORKDURATION": "Arbeit nach Anruf Dauer", - "RINGINUSE": "Ring in Verwendung", - "MEMBERDELAY": "Die Verzögerung", - "TIMEOUTRESTART": "Timeout starten", + "AFTERCALLWORK": "Nacharbeit", + "AFTERCALLWORKDURATION": "Dauer Nacharbeit", + "RINGINUSE": "Klingeln bei Besetzt", + "MEMBERDELAY": "Verzögerung", + "TIMEOUTRESTART": "Zeitüberschreitung", "MONITORFORMAT": "Aufzeichnungsformat", - "SETINTERFACEVARIABLES": "Die Interface- Variablen", - "SETQUEUEVARIABLES": "Die Warteschlange Variablen", - "SETQUEUEENTRYVARIABLES": "Die Warteschlange ENTRY-Variablen", + "SETINTERFACEVARIABLES": "Interface-Variablen", + "SETQUEUEVARIABLES": "Warteschlangen-Variablen", + "SETQUEUEENTRYVARIABLES": "Warteschlangen-Eintritts-Variablen", "VARIABLE": "Variable", - "CONTEXT": "Kontext", + "CONTEXT": "Kontext Austritt aus Warteschlange", "SAVE": "Speichern", "SETTINGS": "Einstellungen", - "INBOUNDROUTES": "Ankommende Routen", + "INBOUNDROUTES": "Eingehende Routen", "PHONENUMBER": "Telefonnummer", "ADD_INBOUNDROUTE": "Eingehende Route hinzufügen", - "EDIT_INBOUNDROUTE": "Route für eingehende Anrufe bearbeiten.", - "DELETE_INBOUNDROUTE": "Löschen der Route für eingehende Anrufe", + "EDIT_INBOUNDROUTE": "Eingehende Route bearbeiten", + "DELETE_INBOUNDROUTE": "Eingehende Route löschen", "ACTIONS": "Aktionen", - "OUTBOUNDROUTES": "Abgehende Routen", - "DESTINATIONPATTERN": "Ziel Muster", + "OUTBOUNDROUTES": "Ausgehende Routen", + "DESTINATIONPATTERN": "Ziel-Pattern", "ADD_OUTBOUNDROUTE": "Ausgehende Route hinzufügen", - "EDIT_OUTBOUNDROUTE": "Abgehende Route bearbeiten", - "DELETE_OUTBOUNDROUTE": "Abgehende Route löschen", - "CUTDIGITS": "Die Ziffern", - "RECORDING": "Aufnahme", + "EDIT_OUTBOUNDROUTE": "Ausgehende Route bearbeiten", + "DELETE_OUTBOUNDROUTE": "Ausgehende Route löschen", + "CUTDIGITS": "Ziffern", + "RECORDING": "Aufzeichnung", "RECORDINGFORMAT": "Aufzeichnungsformat", "INTERNALROUTES": "Interne Routen", - "ADD_INTERNALROUTE": "Fügen Sie interne Routen", + "ADD_INTERNALROUTE": "Interne Route hinzufügen", "EDIT_INTERNALROUTE": "Interne Route bearbeiten", - "DELETE_INTERNALROUTE": "Interne Routen löschen", + "DELETE_INTERNALROUTE": "Interne Route löschen", "CONTEXTS": "Kontexte", - "ADD_CONTEXT": "Rahmen hinzufügen", + "ADD_CONTEXT": "Kontext hinzufügen", "EDIT_CONTEXT": "Kontext bearbeiten", - "DELETE_CONTEXT": "Löschen von Rahmen", - "VOICEMAILS": "Von Voicemails", - "ADD_VOICEMAIL": "Fügen Sie Voicemail", - "EDIT_VOICEMAIL": "Bearbeiten von Voicemail", + "DELETE_CONTEXT": "Kontext löschen", + "VOICEMAILS": "Voicemails", + "ADD_VOICEMAIL": "Voicemail hinzufügen", + "EDIT_VOICEMAIL": "Voicemail bearbeiten", "DELETE_VOICEMAIL": "Voicemail löschen", - "FULLNAME": "Voller Name", + "FULLNAME": "Vollständiger Name", "EMAIL": "E-Mail", "MAILBOX": "Mailbox", "PASSWORD": "Passwort", "CONFIRM_PASSWORD": "Passwort bestätigen", "TIMEZONE": "Zeitzone", - "ATTACH": "Befestigen Sie", + "ATTACH": "Anhängen", "ENVELOPE": "Umschlag", "DELETE": "Löschen", "EMAILBODY": "E-Mail-Text", "EMAILSUBJECT": "Betreff der E-Mail", - "MAXSECONDS": "In Sekunden", + "MAXSECONDS": "Max. Sekunden", "MAXMESSAGES": "Max. Nachrichten", "MESSAGES": "Nachrichten", "SORT": "Sortieren", - "ADD_MUSICONHOLD": "Hinzufügen von Musik auf Halten", - "MUSICONHOLDS": "Musik auf Halten", - "EDIT_MUSICONHOLD": "Bearbeiten Musik auf Halten", - "DELETE_MUSICONHOLD": "Löschen Sie Musik auf Halten", + "ADD_MUSICONHOLD": "Wartemusik hinzufügen", + "MUSICONHOLDS": "Wartemusik", + "EDIT_MUSICONHOLD": "Wartemusik bearbeiten", + "DELETE_MUSICONHOLD": "Wartemusik löschen", "DIRECTORY": "Verzeichnis", "AUDIOFILES": "Audiodateien", - "RECORDINGS": "Aufnahmen", - "CHANSPY": "ChanSpy", + "RECORDINGS": "Aufzeichnungen", + "CHANSPY": "Listen-In", "PREFIX": "Präfix", "OPTIONS": "Optionen", - "AUTH": "Auth", - "ADD_CHANSPY": "Fügen Sie ChanSpy", - "EDIT_CHANSPY": "Bearbeiten Sie ChanSpy", - "DELETE_CHANSPY": "Löschen Sie ChanSpy", + "AUTH": "Authentifizierung", + "ADD_CHANSPY": "Listen-In hinzufügen", + "EDIT_CHANSPY": "Listen-In bearbeiten", + "DELETE_CHANSPY": "Listen-In löschen", "AGENTS": "Agenten", "TELEPHONES": "Telefone", "QUEUES": "Warteschlangen", - "QUEUE_CALLS": "Anrufe aus einer Warteschlange", - "QUEUE_PARAMETERS": "Queue Parameter", + "QUEUE_CALLS": "Anrufe in Warteschlange", + "QUEUE_PARAMETERS": "Warteschlangen Parameter", "ABANDONED_CALLS": "Abgebrochene Anrufe", "OUTBOUND_CALLS": "Ausgehende Anrufe", "AGI": "AGI", - "DIAL": "Kurzwahl", + "DIAL": "Wählen", "CALLYSQUARE": "CallySquare", - "INTERNALDIAL": "Interne Wahl", - "EXTERNALDIAL": "Externes Wählen", - "RINGGROUP": "Ring-Gruppe", + "INTERNALDIAL": "Interner Anruf", + "EXTERNALDIAL": "Externer Anruf", + "RINGGROUP": "Rufgruppe", "PLAYBACK": "Wiedergabe", "QUEUE": "Warteschlange", - "SET": "Set", + "SET": "Einstellen", "VOICEMAIL": "Voicemail", "GOTO": "Gehe zu", "HANGUP": "Auflegen", - "CUSTOM": "Benutzerdefinierte", + "CUSTOM": "Benutzerdefiniert", "PROJECT": "Cally-Square Projekt", "TECHNOLOGY/RESOURCE": "Technologie-/Ressourcen", "URL": "URL", - "EDIT_APP": "Anwendung bearbeiten.", + "EDIT_APP": "App bearbeiten.", "EDIT_INTERVAL": "Intervall bearbeiten", - "DELETE_APP": "Anwendung löschen", + "DELETE_APP": "App löschen", "INTERVALS": "Intervalle", "USER": "Benutzer", - "TRUNK": "Amtsleitung", + "TRUNK": "Trunk", "PHONE": "Telefon", "AUDIO_FILES": "Audiodateien", - "ANNOUNCE_OVERRIDES": "Überschreibt ankündigen", + "ANNOUNCE_OVERRIDES": "Überschreibungen ankündigen", "MACRO": "Makro", "GOSUB": "GoSub", "RULE": "Regel", @@ -258,151 +257,151 @@ "ANSWER": "Antwort", "VALUE": "Wert", "MAILBOX@CONTEXT": "Mailbox@Kontext", - "EXTENSION": "Erweiterung", + "EXTENSION": "Nebenstelle", "PRIORITY": "Priorität", - "HANGUP_CAUSE": "Ursache auflegen", - "OUTBOUNDDIAL": "Wählen Sie für abgehende Anrufe", - "CALLER_ID": "Die Anrufer-ID", + "HANGUP_CAUSE": "Ablehnungsgrund", + "OUTBOUNDDIAL": "Extern wählen", + "CALLER_ID": "Anrufer-ID", "NO_MESSAGE_AVAILABLE": "Keine Meldungen vorhanden", "NO_SOUND_AVAILABLE": "Kein Ton verfügbar", - "VOICERECORDINGS": "Sprachaufnahmen", - "CHANSPIES": "Chan Spies", - "VOICE": "Voice", + "VOICERECORDINGS": "Sprachaufzeichnungen", + "CHANSPIES": "Listen-Ins", + "VOICE": "Anrufe", "REALTIME": "Echtzeit", - "ID": "Id", + "ID": "ID", "VOICEMAIL_CONTEXT": "Kontext", "NO_MOHSOUND_AVAILABLE": "Keine Wartemusik verfügbar", "FILE": "Datei", - "ADD_MOHSOUND": "Hinzufügen von Musik auf Halten sound", - "DOWNLOAD_MOHSOUND": "Download Music-on-Hold sound", - "DELETE_MOHSOUND": "Löschen Sie Music On Hold sound", + "ADD_MOHSOUND": "Musik bei Halten hinzufügen", + "DOWNLOAD_MOHSOUND": "Musik bei Halten herunterladen", + "DELETE_MOHSOUND": "Musik bei Halten löschen", "UNIQUEID": "Eindeutige ID", "AGENT": "Agent", "TYPE": "Typ", "RATING": "Bewertung", "AUDIO": "Audio", "DATE": "Datum", - "NEW_VOICEQUEUE": "Neue Stimme der Warteschlange", - "NEW_INBOUNDROUTE": "Neue Route für eingehende Anrufe", - "NEW_OUTBOUNDROUTE": "Neue abgehende Route", - "NEW_INTERNALROUTE": "Neue interne Routen", - "NEW_CONTEXT": "Neue Kontext", + "NEW_VOICEQUEUE": "Neue Anruf-Warteschlange", + "NEW_INBOUNDROUTE": "Neue eingehende Route", + "NEW_OUTBOUNDROUTE": "Neue ausgehende Route", + "NEW_INTERNALROUTE": "Neue interne Route", + "NEW_CONTEXT": "Neuer Kontext", "NEW_VOICEMAIL": "Neue Voicemail", - "NEW_MUSICONHOLD": "Neue Musik auf Halten", - "NEW_CHANSPY": "Neue ChanSpy", - "PENALTY": "Strafe", - "ADD_TEAM_TO_VOICEQUEUE": "Team hinzufügen, Warteschlange", - "ADD_AGENT_TO_VOICEQUEUE": "Hinzufügen von Agenten der Warteschlange an die Mailbox", - "EDIT_DIAL": "Wählen Sie Bearbeiten.", + "NEW_MUSICONHOLD": "Neue Haltemusik", + "NEW_CHANSPY": "Neuer Listen-In", + "PENALTY": "Verzögerung", + "ADD_TEAM_TO_VOICEQUEUE": "Team zur Warteschlange hinzufügen", + "ADD_AGENT_TO_VOICEQUEUE": "Agenten zur Warteschlange hinzufügen", + "EDIT_DIAL": "Wählen anpassen", "EDIT_AGI": "AGI bearbeiten", - "EDIT_INTERNALDIAL": "Interne Wahl bearbeiten.", - "EDIT_EXTERNALDIAL": "Wählen Sie Externen bearbeiten", - "EDIT_RINGGROUP": "Gruppe bearbeiten", - "EDIT_PLAYBACK": "Bearbeiten Sie die Wiedergabe", - "EDIT_QUEUE": "Bearbeiten von Warteschlangen", - "EDIT_SET": "Bearbeiten", - "EDIT_GOTO": "Gehe zu bearbeiten.", - "EDIT_HANGUP": "Bearbeiten Sie Auflegen", - "EDIT_CUSTOM": "Bearbeiten von benutzerdefinierten", + "EDIT_INTERNALDIAL": "Internes Wählen bearbeiten", + "EDIT_EXTERNALDIAL": "Externes Wählen bearbeiten", + "EDIT_RINGGROUP": "Rufgruppe bearbeiten", + "EDIT_PLAYBACK": "Wiedergabe bearbeiten", + "EDIT_QUEUE": "Warteschlange bearbeiten", + "EDIT_SET": "Set bearbeiten", + "EDIT_GOTO": "Gehe zu bearbeiten", + "EDIT_HANGUP": "Auflegen bearbeiten", + "EDIT_CUSTOM": "Benutzerdef. Einstellungen bearbeiten", "DURATION": "Dauer", - "RECEIVED_AT": "Empfangen am", + "RECEIVED_AT": "Eingegangen am", "YES": "Ja", - "NO": "Keine", - "HANGUPCAUSE_1": "1 = Nicht zugewiesene Nummer", - "HANGUPCAUSE_16": "16 = Normail Anruf löschen", - "HANGUPCAUSE_17": "17 = Benutzer besetzt", - "HANGUPCAUSE_18": "18 = Keine Reaktion (Telefon Gerät nicht verbunden)", + "NO": "Nein", + "HANGUPCAUSE_1": "1 = Nummer nicht zugewiesen", + "HANGUPCAUSE_16": "16 = Beenden durch Nutzer", + "HANGUPCAUSE_17": "17 = Besetzt", + "HANGUPCAUSE_18": "18 = Keine Antwort (Nebenstelle nicht verbunden)", "HANGUPCAUSE_21": "21 = Anruf abgelehnt", - "HANGUPCAUSE_22": "22 = Anzahl geändert", - "HANGUPCAUSE_27": "27 = Ziel nicht in Ordnung", - "HANGUPCAUSE_38": "38 = Netzwerk aus, um", + "HANGUPCAUSE_22": "22 = Nummer geändert", + "HANGUPCAUSE_27": "27 = Ziel nicht verfügbar", + "HANGUPCAUSE_38": "38 = Netzwerk nicht verfügbar", "HANGUPCAUSE_41": "41 = vorübergehende Störung", - "RANDOM": "Random", + "RANDOM": "Zufall", "ALPHABETICAL": "Alphabetisch", "NO_APPS_AVAILABLE": "Keine Anwendungen verfügbar", - "DOWNLOAD_VOICERECORDING": "Download Voice Recording", - "DELETE_VOICERECORDING": "Löschen von Voice Recording", - "INTERNAL": "Interne", + "DOWNLOAD_VOICERECORDING": "Sprachaufzeichnung herunterladen", + "DELETE_VOICERECORDING": "Sprachaufzeichnung löschen", + "INTERNAL": "Intern", "PHONE_STATE": "Telefonstatus", "PHONE_STATUS": "Telefonstatus", "TRUNK_STATUS": "Trunk Status", "REGISTERED": "Registriert", - "UNREGISTERED": "Unregistrierte", + "UNREGISTERED": "Nicht registriert", "LAGGED": "Zurück", "REACHABLE": "Erreichbar", "UNREACHABLE": "Nicht erreichbar", "UNKNOWN": "Unbekannt", - "NOT_INUSE": "Nicht in Gebrauch", - "INUSE": "Im Einsatz", + "NOT_INUSE": "Nicht in Verwendung", + "INUSE": "In Verwendung", "BUSY": "Besetzt", "INVALID": "Ungültig", "UNAVAILABLE": "Nicht verfügbar", "RINGING": "Klingeln", - "ONHOLD": "Auf Halten", - "RING": "Ring", - "UP": "Bis", - "INFO": "Info", - "TRUNKS": "Amtsleitungen", + "ONHOLD": "Halten", + "RING": "Klingeln", + "UP": "Nach Oben", + "INFO": "Information", + "TRUNKS": "Trunks", "REGISTRY": "Registrierung", - "NO_REGISTRY": "Keine registry", + "NO_REGISTRY": "Keine Registrierung", "LOGGED_IN": "Angemeldet", "PAUSED": "Angehalten", - "WAITING": "Warten", - "TALKING": "Sprechen", - "DID": "Haben", + "WAITING": "Wartezustand", + "TALKING": "Im Gespräch", + "DID": "DID", "CALLER": "Anrufer", - "TOTAL": "Insgesamt", + "TOTAL": "Gesamt", "ANSWERED": "Beantwortet", "ABANDONED": "Abgebrochen", - "UNMANAGED": "Nicht verwaltete", - "AVG_HOLD_TIME": "Durchschnittl. Warteschleifenzeit", - "AVG_DURATION": "Av-Dauer", - "AVG_BILLABLE": "Avg Fakturierbaren", - "SOURCE": "Quelle", + "UNMANAGED": "Nicht bearbeitet", + "AVG_HOLD_TIME": "Durchschnittliche Wartezeit", + "AVG_DURATION": "Durchschnittliche Dauer", + "AVG_BILLABLE": "Durchschnittliche abrechenbare Zeit", + "SOURCE": "Ursprung", "DESTINATION": "Ziel", "REJECTED": "Abgelehnt", "FAILED": "Fehlgeschlagen", - "CALLED": "Aufgerufen", + "CALLED": "Angerufen", "CONNECTED": "Verbunden", "NO_RATING": "Keine Bewertung", - "EDIT_VOICERECORDING": "Edit Voice Recording", + "EDIT_VOICERECORDING": "Sprachaufzeichnungen verwalten", "APPLICATION_NAME": "Name der Anwendung", "ARGUMENTS": "Argumente", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "ADD_AGENT_TO_QUEUE": "Agent zur Warteschlange hinzufügen", - "DEFAULT_PAUSE": "Standard PAUSE", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "ADD_AGENT_TO_QUEUE": "Agenten zur Warteschlange hinzufügen", + "DEFAULT_PAUSE": "Standard Pause", "PAUSE": "Pause", - "UNPAUSE": "Pause", - "REDIRECT_TO_NUMBER": "Umleiten zu: Anzahl", - "REDIRECT_TO_AGENT": "Umleiten zu: Agent", - "AGENTADD_VOICEQUEUE": "Hinzufügen von Agenten der Warteschlange an die Mailbox", + "UNPAUSE": "Fortsetzen", + "REDIRECT_TO_NUMBER": "Weiterleiten an Nummer", + "REDIRECT_TO_AGENT": "Weiterleiten an Agenten", + "AGENTADD_VOICEQUEUE": "Agenten zu Anruf-Warteschlange hinzufügen", "APPLICATION": "Anwendung", "FILES": "Dateien", "FORMAT": "Format", "MODE": "Modus", "RECORD": "Datensatz", - "TEAMADD_VOICEQUEUE": "Hinzufügen Team voicequeue", - "NEW_MOHSOUND": "Neue Musik auf Halten", - "DOWNLOAD_MESSAGE": "Download", + "TEAMADD_VOICEQUEUE": "Team zur Anruf-Warteschlange hinzufügen", + "NEW_MOHSOUND": "Neue Wartemusik", + "DOWNLOAD_MESSAGE": "Herunterladen", "DELETE_MESSAGE": "Löschen", "QUEUE_PARAMS": "Queue Parameter", - "TOTAL_OFFERED": "Insgesamt", + "TOTAL_OFFERED": "Gesamt", "READY": "Bereit", - "AGENTADD_QUEUE": "Agent hinzufügen Warteschlangen zu Voice", - "AGENTSADD_QUEUE": "Hinzufügen von Agenten der Warteschlange an die Mailbox", - "ALL_TEAMS": "Alle Mannschaften", + "AGENTADD_QUEUE": "Agenten zur Warteschlange hinzufügen", + "AGENTSADD_QUEUE": "Agenten zur Warteschlangen hinzufügen", + "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "CLOSING": "Schließen", "TAGS": "Tags", "WAITING_FOR_AGENT": "Warten auf Agenten", - "EDIT_OUTBOUNDDIAL": "Bearbeiten ausgehenden DFÜ", - "ACCOUNTNAME": "Konto Name", + "EDIT_OUTBOUNDDIAL": "Wählverhalten ausgehend bearbeiten", + "ACCOUNTNAME": "Kontoname", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", - "DISPOSITION": "Disposition", + "OF": "von", + "DISPOSITION": "Qualifizierung", "WAITING_FOR_AGENTS": "Warten auf Agenten", "CHAT": "Chat", "MAIL": "E-Mail", @@ -410,72 +409,71 @@ "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", "NO_AGENT_ONLINE": "Kein Agent Online", - "PARTIALPAUSE": "Teilweise Pause", + "PARTIALPAUSE": "Teilpause", "STATUS": "Status", "TIMER": "Timer", "ALL": "Alle", "IDLE": "Leerlauf", - "EDIT_TRUNK": "Bearbeiten Trunk", + "EDIT_TRUNK": "Trunk bearbeiten", "ACTIVE": "Aktiv", - "CLEAR": "klar", + "CLEAR": "Leeren", "CALLS": "Anrufe", - "STARTEDAT": "Fing an bei", - "ENDEDAT": "Beendet bei", - "TAG": "Etikett", - "DETAILS": "Einzelheiten", + "STARTEDAT": "Startdatum", + "ENDEDAT": "Enddatum", + "TAG": "Tag", + "DETAILS": "Details", "BILLABLESECONDS": "Abrechenbare Sekunden", - "ANSWEREDAT": "Beantwortet bei", - "NOTE": "Hinweis", + "ANSWEREDAT": "Beantwortet am", + "NOTE": "Notiz", "CLOSE": "Schließen", - "SELECT_DATE": "Wählen Sie Startdatum", - "SELECT_TYPE": "Art auswählen", - "ABANDONEDCALLS": "Verlassene Warteschlangenanrufe", + "SELECT_DATE": "Startdatum auswählen", + "SELECT_TYPE": "Typ auswählen", + "ABANDONEDCALLS": "Abgebrochene Anrufe", "ADD_VOICEPREFIX": "Präfix hinzufügen", - "AGENTADD_VOICEPREFIX": "Fügen Sie Agent zu Präfix hinzu", + "AGENTADD_VOICEPREFIX": "Agentenpräfix hinzufügen", "DELETE_VOICEPREFIX": "Präfix löschen", "EDIT_VOICEPREFIX": "Präfix bearbeiten", "NEW_VOICEPREFIX": "Neues Präfix", - "VOICEPREFIXES": "Vorgegebene Präfixe", + "VOICEPREFIXES": "Präfixe für Sprachanrufe", "CALLERIDALL": "Anruferidentifikation", "OUTBOUNDROUTE": "Ausgehende Route", - "LOGIN_TIME": "Login-Zeit", - "PAUSE_TIME": "Pausenzeit", + "LOGIN_TIME": "Zeit angemeldet", + "PAUSE_TIME": "Zeit in Pause", "DIALER": "Dialer", - "INBOUND": "Eingehende", + "INBOUND": "Eingehend", "OUTBOUND": "Ausgehend", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Status der obligatorischen Dispositionspause", - "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", + "MANDATORYDISPOSITION": "Qualifikation erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "PausenID bei erforderlicher Qualifizierung", + "TEAMS_ASSOCIATION": "Teamzuweisung", "CANT_DOWNLOAD_THIS_FILE": "Diese Datei kann nicht heruntergeladen werden", "FILE_NOT_FOUND": "Datei nicht gefunden", "SCREENRECORDING": "Bildschirmaufzeichnung verwalten", - "START_SCREENRECORDING": "Starten Sie die Bildschirmaufnahme", - "STOP_SCREENRECORDING": "Beenden Sie die Bildschirmaufnahme", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", - "WRONG_EXTENSION": "Die Datei weist die falsche Erweiterung auf", + "START_SCREENRECORDING": "Bildschirmaufzeichnung starten", + "STOP_SCREENRECORDING": "Bildschirmaufzeichnung beenden", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung läuft", + "WRONG_EXTENSION": "Ungültige Dateiendung", "DOWNLOADTRANSCRIBE_VOICERECORDING": "Transkript herunterladen", "FAILUREREASON": "Fehlergrund", - "RUNSENTIMENT_VOICERECORDING": "Führen Sie Sentiment", - "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Führen Sie Transcribe & Sentiment aus", - "RUNTRANSCRIBE_VOICERECORDING": "Führen Sie Transcribe aus", - "SENTIMENT": "Gefühl", - "SENTIMENTANALYSIS": "Stimmungsanalyse", + "RUNSENTIMENT_VOICERECORDING": "Starten Sprachaufzeichnung inkl. Sentiment", + "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Transkription und Sentinemtaufzeichnung starten", + "RUNTRANSCRIBE_VOICERECORDING": "Transkription starten", + "SENTIMENT": "Sentiment", + "SENTIMENTANALYSIS": "Sentiment-Analyse", "SENTIMENT_MIXED": "Gemischt", "SENTIMENT_NEGATIVE": "Negativ", "SENTIMENT_NEUTRAL": "Neutral", "SENTIMENT_POSITIVE": "Positiv", "TEXT": "Text", "TRANSCRIBE": "Transkribieren", - "TRANSCRIBESTATUS_COMPLETED": "Abgeschlossen", - "TRANSCRIBESTATUS_FAILED": "Gescheitert", + "TRANSCRIBESTATUS_COMPLETED": "Transkription abgeschlossen", + "TRANSCRIBESTATUS_FAILED": "Transkription fehlgeschlagen", "TRANSCRIBESTATUS_IN_PROGRESS": "In Bearbeitung", "TRANSCRIBESTATUS_NEW": "Neu", "TRANSCRIPT": "Transkript", "TRANSCRIPTANALYSIS": "Transkript & Analyse", "SERVICELEVEL": "Service Level", - "SECOND_LEVEL_DISPOSITION": "Disposition der zweiten Ebene", - "THIRD_LEVEL_DISPOSITION": "Disposition der dritten Ebene", - "ALIAS": "Alias" + "SECOND_LEVEL_DISPOSITION": "Qualifizierung der zweiten Ebene", + "THIRD_LEVEL_DISPOSITION": "Qualifizierung der dritten Ebene" } } diff --git a/public/app/main/apps/whatsapp/i18n/de.json b/public/app/main/apps/whatsapp/i18n/de.json index 80b51fd..c10b0a5 100644 --- a/public/app/main/apps/whatsapp/i18n/de.json +++ b/public/app/main/apps/whatsapp/i18n/de.json @@ -3,8 +3,8 @@ "ERRORS": { "ACCESSKEYID_REQUIRED": "Pflichtfeld", "ACCOUNTSID_REQUIRED": "Pflichtfeld", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "AGENTTRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", "AGENT_REQUIRED": "Pflichtfeld", "AGENT_TIMEOUT_REQUIRED": "Pflichtfeld", @@ -14,9 +14,9 @@ "CONDITION_REQUIRED": "Pflichtfeld", "DESCRIPTION_REQUIRED": "Pflichtfeld", "DISPOSITION_REQUIRED": "Pflichtfeld", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", "FALSEPRIORITY_REQUIRED": "Pflichtfeld", - "KEY_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "KEY_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", "KEY_REQUIRED": "Pflichtfeld", "LANGUAGE_REQUIRED": "Pflichtfeld", "LEXREGION_REQUIRED": "Pflichtfeld", @@ -24,61 +24,61 @@ "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", "NAME_REQUIRED": "Pflichtfeld", "PHONE_REQUIRED": "Pflichtfeld", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", "PRIORITY_REQUIRED": "Pflichtfeld", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "QUEUETRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", "QUEUE_REQUIRED": "Pflichtfeld", "SECRETACCESSKEY_REQUIRED": "Pflichtfeld", "TAG_REQUIRED": "Pflichtfeld", "TEXT_REQUIRED": "Pflichtfeld", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "TIMEOUT_REQUIRED": "Pflichtfeld", "TIMES_REQUIRED": "Pflichtfeld", "TOKEN_REQUIRED": "Pflichtfeld", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", "TRUEPRIORITY_REQUIRED": "Pflichtfeld", "TYPE_REQUIRED": "Pflichtfeld", "VALUE_REQUIRED": "Pflichtfeld", "VARIABLE_REQUIRED": "Pflichtfeld", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", - "WELCOMEMESSAGE_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", + "WELCOMEMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", "WELCOMEMESSAGE_REQUIRED": "Pflichtfeld", "CLIENTEMAIL_REQUIRED": "Pflichtfeld", "PRIVATEKEY_REQUIRED": "Pflichtfeld", "PROJECTID_REQUIRED": "Pflichtfeld" }, "HELP": { - "LIST": "Kontaktmanagerliste zum Zuordnen von Kontakten", - "MANDATORYDISPOSITION": "Obligatorische Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", + "LIST": "Liste für die Zuordnung von Kontakten", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "PausenID bei erforderlicher Qualifizierung", "MOTIONPROXY": "Das Feld muss das folgende Format haben: : // [: ]. Beispiel: https: //X.Y.Z.W", "NAME": "Es werden nur Zahlen, Buchstaben und bestimmte Zeichen (._) unterstützt", "RECEIVEURL": "Dies ist die automatisch generierte API-Zeichenfolge, die Sie zum Empfangen der Nachrichten in Ihrem Konto von Ihrem WhatsApp Connector-Anbieter verwenden müssen (POST-Methode muss verwendet werden): Klicken Sie auf die Schaltfläche in der Zwischenablage, um sie zu kopieren", - "WELCOMEMESSAGE": "Dies ist die erste Antwortnachricht, die an neue Interaktionen gesendet wird" + "WELCOMEMESSAGE": "Dies ist die erste Antwortnachricht, welche bei einer neuen Interaktion gesendet wird" }, "ACCESSKEYID": "Zugriffsschlüssel-ID", - "ACCOUNTSID": "Konto-SID", + "ACCOUNTSID": "Konto-ID", "ACTIONS": "Aktionen", "ADD_NOTE": "Notiz hinzufügen", - "ADD_WHATSAPPACCOUNT": "Hinzufügen", - "ADD_WHATSAPPCANNEDANSWER": "Vordefinierte Antwort hinzufügen", - "ADD_WHATSAPPDISPOSITION": "WhatsApp Disposition hinzufügen", + "ADD_WHATSAPPACCOUNT": "Whatsapp Konto konzufügen", + "ADD_WHATSAPPCANNEDANSWER": "Textvorlage hinzufügen", + "ADD_WHATSAPPDISPOSITION": "Whatsapp-Qualifizierung hinzufügen", "ADD_WHATSAPPQUEUE": "WhatsApp-Warteschlange hinzufügen", - "ADVANCED": "Fortgeschrittene", + "ADVANCED": "Erweitert", "AGENT": "Agent", - "AGENTADD_QUEUE": "Agent zur WhatsApp-Warteschlange hinzufügen", - "AGENTADD_WHATSAPPACCOUNT": "Agent zum WhatsApp-Konto hinzufügen", - "AGENTADD_WHATSAPPQUEUE": "Agent zur WhatsApp-Warteschlange hinzufügen", + "AGENTADD_QUEUE": "Agenten zur Warteschlange hinzufügen", + "AGENTADD_WHATSAPPACCOUNT": "Agenten zum WhatsApp-Konto hinzufügen", + "AGENTADD_WHATSAPPQUEUE": "Agenten zur WhatsApp-Warteschlange hinzufügen", "AGENTS": "Agenten", - "AGENTSADD_QUEUE": "Hinzufügen von Agenten zur WhatsApp-Warteschlange", - "AGENTTRANSFER": "Agententransfer", - "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung bei der Agentenübertragung", - "AGENT_TIMEOUT": "Agent Timeout", + "AGENTSADD_QUEUE": "Agenten zur Warteschlange hinzufügen", + "AGENTTRANSFER": "Transfer Agent", + "AGENTTRANSFERTIMEOUT": "Timeout Agententransfer", + "AGENT_TIMEOUT": "Timeout Agent", "ALL": "Alles", "ALL_AGENTS": "Alle Agenten", "ALL_TEAMS": "Alle Teams", @@ -86,90 +86,90 @@ "AUTHTOKEN": "Auth Token", "AUTOREPLY": "Automatische Antwort", "BACK": "Zurück", - "BOTNAME": "Bot Name", + "BOTNAME": "Botname", "BUSY": "Beschäftigt", - "CANNEDANSWERS": "Vordefinierte Antworten", - "CANNED_ANSWER_NOT_FOUND": "Es wurden keine vordefinierten Antworten gefunden", - "CANNED_ANSWER_SEARCH": "Geben Sie einen Text ein, um eine vordefinierte Antwort zu suchen", + "CANNEDANSWERS": "Textvorlagen", + "CANNED_ANSWER_NOT_FOUND": "Keine Textvorlagen gefunden", + "CANNED_ANSWER_SEARCH": "Suchen nach Textvorlagen", "CAPACITY": "Kapazität", "CLOSE": "Schließen", "CLOSED": "Geschlossen", "CLOSEMETHOD": "Methode schließen", "CLOSEURL": "URL schließen", - "COMMAND": "Befehl", + "COMMAND": "Eingabe", "CONDITION": "Bedingung", "CONTACT": "Kontakt", - "CREATED_AT": "Hergestellt in", - "DEFAULT_PAUSE": "STANDARD PAUSE", + "CREATED_AT": "Erstellt am", + "DEFAULT_PAUSE": "Standard Pause", "DELETE": "Löschen", "DELETE_INTERACTION": "Interaktion löschen", "DELETE_SELECTED": "Ausgewählte löschen", "DELETE_WHATSAPPACCOUNT": "WhatsApp-Konto löschen", - "DELETE_WHATSAPPCANNEDANSWER": "Vordefinierte Antwort löschen", - "DELETE_WHATSAPPDISPOSITION": "WhatsApp-Disposition löschen", + "DELETE_WHATSAPPCANNEDANSWER": "Textvorlage löschen", + "DELETE_WHATSAPPDISPOSITION": "Qualifizierung löschen", "DELETE_WHATSAPPQUEUE": "WhatsApp-Warteschlange löschen", "DESCRIPTION": "Beschreibung", "DIALOGFLOW": "DialogFlow", - "DISPOSITION": "Anordnung", - "DISPOSITIONS": "Dispositionen", - "DOWNLOAD_INTERACTION": "Herunterladen", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Ohne Anhänge herunterladen", - "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", - "EDIT_AGENT": "Agent bearbeiten", - "EDIT_AMAZONLEX": "Bearbeiten Sie die Lex-Konfiguration", + "DISPOSITION": "Qualifizierung", + "DISPOSITIONS": "Qualifizierungen", + "DOWNLOAD_INTERACTION": "Interaktion herunterladen", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", + "DOWNLOAD_WITH_ATTACHMENTS": "Herunterladen inkl. Anhänge", + "EDIT_AGENT": "Agenten bearbeiten", + "EDIT_AMAZONLEX": "Lex-Konfiguration bearbeiten", "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", - "EDIT_CLOSE": "Bearbeiten Schließen", - "EDIT_DIALOGFLOW": "Bearbeiten Sie die DialogFlow-Konfiguration", - "EDIT_GOTOIF": "Bearbeiten Sie Gotoif", - "EDIT_GOTOP": "Gotop bearbeiten", + "EDIT_CLOSE": "Bearbeitung abschließen", + "EDIT_DIALOGFLOW": "DialogFlow-Konfiguration bearbeiten", + "EDIT_GOTOIF": "GoToIf bearbeiten", + "EDIT_GOTOP": "GoTop bearbeiten", "EDIT_NOOP": "Noop bearbeiten", "EDIT_QUEUE": "Warteschlange bearbeiten", "EDIT_SYSTEM": "System bearbeiten", "EDIT_TAG": "Tag bearbeiten", "EDIT_WHATSAPPACCOUNT": "WhatsApp-Konto bearbeiten", - "EDIT_WHATSAPPCANNEDANSWER": "Vordefinierte Antwort bearbeiten", - "EDIT_WHATSAPPDISPOSITION": "WhatsApp-Disposition bearbeiten", - "EDIT_WHATSAPPQUEUE": "Bearbeiten Sie die WhatsApp-Warteschlange", - "FALSEPRIORITY": "Falsche Priorität", - "GENERAL": "Allgemeines", + "EDIT_WHATSAPPCANNEDANSWER": "Textvorlage bearbeiten", + "EDIT_WHATSAPPDISPOSITION": "Whatsapp-Qualifizierung bearbeiten", + "EDIT_WHATSAPPQUEUE": "Whatsapp-Warteschlange bearbeiten", + "FALSEPRIORITY": "Priorität falsch", + "GENERAL": "Allgemein", "GOTOIF": "Gotoif", "GOTOP": "Zum Seitenanfang", - "GOTOREALTIME_WHATSAPPQUEUE": "Wechseln Sie zur WhatsApp-Warteschlange in Echtzeit", - "GO_TO_WHATSAPPACCOUNTS": "Gehe zu Konto", - "ID": "Ich würde", + "GOTOREALTIME_WHATSAPPQUEUE": "Zur Echtzeitansicht gehen", + "GO_TO_WHATSAPPACCOUNTS": "Zum Whatsapp-Konto gehen", + "ID": "ID", "IDLE": "Leerlauf", "INSERT_MESSAGE_HERE": "Nachricht hier einfügen", "INTERACTIONS": "Interaktionen", - "INTERACTIONS_WHATSAPPACCOUNT": "Gehen Sie zu Interaktionen", + "INTERACTIONS_WHATSAPPACCOUNT": "Zu Interaktionen gehen", "KEY": "Schlüssel", "LANGUAGE": "Sprache", "LASTMESSAGE": "Letzte Nachricht", - "LEXREGION": "Region", - "LIST": "Aufführen", - "LOGGED_IN": "Eingeloggt (SIP verbunden)", + "LEXREGION": "LexRegion", + "LIST": "Liste", + "LOGGED_IN": "Eingeloggt (Verbunden mit SIP)", "LOGIN_TIME": "Anmeldezeit", "LOGOUT": "Ausloggen", - "MANDATORYDISPOSITION": "Obligatorische Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Qualifizierung pausieren, sofern erforderlich", "MORE": "Mehr", - "MOTIONPROXY": "Proxy- oder Bewegungsdomäne", + "MOTIONPROXY": "Proxy", "MULTI_SELECT_TOGGLE": "Mehrfachauswahl umschalten", "NAME": "Name", "NEW_WHATSAPPACCOUNT": "Neues WhatsApp-Konto", - "NEW_WHATSAPPCANNEDANSWER": "Neue vordefinierte WhatsApp-Antwort", - "NEW_WHATSAPPDISPOSITION": "Neue WhatsApp-Disposition", + "NEW_WHATSAPPCANNEDANSWER": "Neue WhatsApp-Textvorlage", + "NEW_WHATSAPPDISPOSITION": "Neue WhatsApp-Quailifizierung", "NEW_WHATSAPPQUEUE": "Neue WhatsApp-Warteschlange", "NOOP": "Noop", - "NOTE": "Hinweis", + "NOTE": "Anmerkung", "NOTIFICATION": "Benachrichtigung", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONSOUND": "Klang", + "NOTIFICATIONSHAKE": "Schütteln", + "NOTIFICATIONSOUND": "Klingeln", "NOTIFICATIONTEMPLATE": "Vorlage", "NO_AGENT_ONLINE": "Kein Agent online", - "NO_AVAILABLE_INFO": "Keine verfügbaren Informationen", - "NO_INTERACTION_AVAILABLE": "Keine Interaktionen verfügbar", - "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "Keine vordefinierten WhatsApp-Antworten verfügbar", - "NO_WHATSAPPDISPOSITION_AVAILABLE": "Keine WhatsApp-Dispositionen verfügbar", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "NO_INTERACTION_AVAILABLE": "Keine neuen Interaktionen verfügbar", + "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "Keine Textvorlagen verfügbar", + "NO_WHATSAPPDISPOSITION_AVAILABLE": "Keine Qualifizierungen verfügbar", "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Keine WhatsApp-Konten verfügbar", "OF": "von", "OPENED": "Geöffnet", @@ -183,62 +183,62 @@ "PROXY": "Proxy", "QUEUE": "Warteschlange", "QUEUES": "Warteschlangen", - "QUEUETRANSFER": "Warteschlangenübertragung", - "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung bei der Warteschlangenübertragung", + "QUEUETRANSFER": "Transfer an Warteschlange", + "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung bei der Warteschlangentransfer", "READY": "Bereit", "REALTIME": "Echtzeit", - "RECEIVEURL": "URL erhalten", + "RECEIVEURL": "URL für Erhalt", "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", - "REMOTE": "Fernbedienung", + "REMOTE": "Remote", "ROWSPERPAGE": "Zeilen pro Seite", - "SAVE": "sparen", + "SAVE": "Speichern", "SCREENRECORDING": "Bildschirmaufzeichnung verwalten", "SEARCH_FOR_ANYONE": "Suche", - "SECRETACCESSKEY": "Zugriffsschlüsselgeheimnis", + "SECRETACCESSKEY": "Geheimer Schlüssel", "SELECTED": "Ausgewählt", "SELECTED_AGENTS": "Ausgewählte Agenten", "SELECTED_TEAMS": "Ausgewählte Teams", - "SELECT_ALL": "Wählen Sie Alle", - "SELECT_NONE": "Nichts ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "SEND": "Senden", - "SETTINGS": "die Einstellungen", - "SPYINTERACTION": "Spionage-Interaktion", - "STARTEDAT": "Fing an bei", - "START_SCREENRECORDING": "Bildschirmaufnahme starten", + "SETTINGS": "Einstellungen", + "SPYINTERACTION": "Mitlesen", + "STARTEDAT": "Startdatum", + "START_SCREENRECORDING": "Bildschirmaufzeichnung starten", "STATUS": "Status", "STOP_SCREENRECORDING": "Bildschirmaufzeichnung stoppen", "STRATEGY": "Strategie", "SYSTEM": "System", - "TAG": "Etikett", - "TAGS": "Stichworte", + "TAG": "Tag", + "TAGS": "Tags", "TEAMADD_WHATSAPPQUEUE": "Team zur WhatsApp-Warteschlange hinzufügen", - "TEAMS_ASSOCIATION": "Mannschaftsverband", + "TEAMS_ASSOCIATION": "Teamzuweisung", "TEXT": "Text", - "TIMEOUT": "Auszeit", + "TIMEOUT": "Zeitüberschreitung", "TIMER": "Timer", - "TIMES": "Mal", - "TO": "Zu", - "TOKEN": "Zeichen", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", - "TRANSFER": "Transfer", + "TIMES": "Zeiten", + "TO": "an", + "TOKEN": "Token", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung verfügbar", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung läuft", + "TRANSFER": "Weiterleiten", "TRUEPRIORITY": "Wahre Priorität", - "TYPE": "Art", + "TYPE": "Typ", "UNPAUSE": "Pause beenden", "VALUE": "Wert", "VARIABLE": "Variable", - "WAITFORTHEASSIGNEDAGENT": "Warten Sie auf den zugewiesenen Agenten", + "WAITFORTHEASSIGNEDAGENT": "Auf den zugewiesenen Mitarbeiter warten", "WAITING": "Warten", "WELCOMEMESSAGE": "Willkommensnachricht", "WHATSAPP": "WhatsApp Connector", "WHATSAPPACCOUNTS": "WhatsApp-Konten", - "WHATSAPPCANNEDANSWERS": "WhatsApp vordefinierte Antworten", - "WHATSAPPDISPOSITIONS": "WhatsApp Dispositionen", + "WHATSAPPCANNEDANSWERS": "WhatsApp-Textvorlagen", + "WHATSAPPDISPOSITIONS": "WhatsApp-Qualifizierungen", "WHATSAPPQUEUES": "WhatsApp-Warteschlangen", - "CLIENTEMAIL": "Kunden-E-Mail", + "CLIENTEMAIL": "Kunden E-Mail", "DIALOGFLOWV2": "Dialogflow V2", "EDIT_DIALOGFLOWV2": "Dialogflow V2 bearbeiten", - "PRIVATEKEY": "Privat Schlüssel", + "PRIVATEKEY": "Privater Schlüssel", "PROJECTID": "Projekt-ID" } } diff --git a/public/app/quick-panel/i18n/de.json b/public/app/quick-panel/i18n/de.json index 3162f7a..fd8ccd9 100644 --- a/public/app/quick-panel/i18n/de.json +++ b/public/app/quick-panel/i18n/de.json @@ -23,38 +23,38 @@ "CHAT": "CHAT", "ACTIVITY": "Aktivität", "FRIENDS": "Freunde", - "APP_SERVERS": "Anwendungsserver", - "USER_STATS": "Benutzer Stats", - "EVENTS": "Veranstaltungen", - "NOTES": "Hinweise", - "QUICK_SETTINGS": "Schnelle Einstellungen", + "APP_SERVERS": "Server Anwendung", + "USER_STATS": "Benutzer Statistiken", + "EVENTS": "Ereignisse", + "NOTES": "Notizen", + "QUICK_SETTINGS": "Schnelleinstellungen", "NOTIFICATIONS": "Benachrichtigungen", "CLOUD_SYNC": "Cloud Synchronisieren", - "RETRO_THRUSTERS": "Retro Triebwerke", - "RECENT": "Die jüngsten", + "RETRO_THRUSTERS": "Retro Thrusters", + "RECENT": "Neuste", "START_NEW_CHAT": "Neuen Chat starten", "BACK": "Zurück", - "CALL": "Anruf", + "CALL": "Anrufen", "MORE": "Mehr", "SEND_MESSAGE": "Nachricht senden", - "REPLY_PLACEHOLDER": "Geben Sie ein, und drücken Sie die Eingabetaste, um Nachricht senden", - "CONTACT_XCALLY_MOTION_SUPPORT": "Kontakt xCALLY Motion Support", + "REPLY_PLACEHOLDER": "Nachricht eingeben und Enter drücken zum Senden", + "CONTACT_XCALLY_MOTION_SUPPORT": "Support kontaktieren", "EXPIRATION_DATE": "Ablaufdatum", "EXPIRATION_REASON": "Ablauf Grund", "LICENSE": "Lizenz", - "NEW_TOKEN": "Neue Token", - "OLD_TOKEN": "Alte Token", + "NEW_TOKEN": "Neuer Token", + "OLD_TOKEN": "Alter Token", "SEND_EMAIL_TO": "E-Mail senden an", "TOKEN": "Token", - "EXPIRATION_REASON_MESSAGE": "Ihre Lizenz ist abgelaufen oder Ihre Maschine eindeutige Id wurde aufgrund einer Änderung an Ihrem System aktualisiert. Die xCALLY Motion Support Team Ihre alte und Ihre neue uuid senden Kontakt.", - "GRAY_PERIOD_EXPIRATION": "Grau Zeitraum Ablauf", + "EXPIRATION_REASON_MESSAGE": "Ihre Lizenz ist abgelaufen oder Ihre eindeutige ID wurde aufgrund einer Änderung an Ihrem System aktualisiert. Bitte den Support kontaktieren", + "GRAY_PERIOD_EXPIRATION": "Ablauf Testphase", "ERRORS": { "NAME_REQUIRED": "Pflichtfeld" }, - "EXPIRATION_GRAY_PERIOD": "Ablauf Grauzeit", - "NO_AVAILABLE_GROUPS": "Keine verfügbaren Gruppen", - "SAVE": "sparen", - "INFO": "Info", + "EXPIRATION_GRAY_PERIOD": "Ablauf Testphase", + "NO_AVAILABLE_GROUPS": "Keine Gruppen verfügbar", + "SAVE": "Speichern", + "INFO": "Information", "NEW_CHATGROUP": "Neue Gruppe", "NAME": "Name", "MEMBERS": "Mitglieder", @@ -65,9 +65,9 @@ "DELETE": "Löschen", "SEARCH": "Suche", "USERS": "Benutzer", - "EXPIRATION_REASON_MESSAGE_GRAY": "Ihre Lizenz ist abgelaufen oder wurde deaktiviert. Kontaktieren Sie xCALLY Motion Support Team.", - "EXPIRATION_REASON_MESSAGE_CHANGED": "Die eindeutige ID Ihres Rechners wurde aufgrund einer Änderung Ihres Systems aktualisiert. Kontaktieren Sie xCALLY Motion Support Team, das sowohl Ihren alten als auch Ihren neuen UUID sendet.", - "MESSENGER_DISABLED": "Das interne Messaging ist für diesen Agenten deaktiviert!", + "EXPIRATION_REASON_MESSAGE_GRAY": "Ihre Lizenz ist abgelaufen oder wurde deaktiviert. Bitte den Support kontaktieren.", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Ihre Lizenz ist abgelaufen oder Ihre eindeutige ID wurde aufgrund einer Änderung an Ihrem System aktualisiert. Bitte den Support kontaktieren", + "MESSENGER_DISABLED": "Internes Messaging für diesen Benutzer nicht aktiviert", "WARNING": "Warnung" } } diff --git a/public/app/reset/i18n/de.json b/public/app/reset/i18n/de.json index 1d7248b..6eb58fc 100644 --- a/public/app/reset/i18n/de.json +++ b/public/app/reset/i18n/de.json @@ -1,20 +1,20 @@ { "RESETPASSWORD": { - "TITLE": "Ihr Kennwort zurücksetzen", - "EMAIL_ADRESS": "E-mail Adresse", - "PASSWORD": "Kennwort", - "PASSWORD_CONFIRM": "Kennwort (bestätigen)", - "UPDATE_PASSWORD": "Kennwort zurücksetzen", + "TITLE": "Passwort zurücksetzen", + "EMAIL_ADRESS": "E-Mail Adresse", + "PASSWORD": "Passwort", + "PASSWORD_CONFIRM": "Passwort bestätigen", + "UPDATE_PASSWORD": "Passwort zurücksetzen", "GO_BACK": "Zurück zum Login", - "PASSWORD_RESET": "Kennwort zurücksetzen", - "PASSWORD_RESET_MESSAGE": "Ihr Passwort wurde korrekt zurückgesetzt wurde, können Sie sich jetzt!", - "PASSWORD_RESET_ERROR": "Passwort Fehler zurücksetzen", + "PASSWORD_RESET": "Passwort zurücksetzen", + "PASSWORD_RESET_MESSAGE": "Das Passwort wurde erfolgreich zurückgesetzt. Sie können sich nun erneut anmelden", + "PASSWORD_RESET_ERROR": "Fehler beim Zurücksetzen des Passwortes", "ERRORS": { - "EMAIL_REQUIRED": "Im Feld \"E-Mail ist erforderlich", - "EMAIL_MUST_VALID": "E-Mail muss eine gültige e-mail Adresse", - "PASSWORD_REQUIRED": "Kennwort Feld ist erforderlich.", + "EMAIL_REQUIRED": "E-Mail Adresse erfoderlich", + "EMAIL_MUST_VALID": "E-Mail Adresse ungültig", + "PASSWORD_REQUIRED": "Passwort erforderlich", "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein.", - "SECURE_PASSWORD_PATTERN": "Muss mindestens 8 Zeichen enthalten, mit einem Minimum von 1 Kleinbuchstaben, Großbuchstaben, 1 numerisches und 1 Sonderzeichen ~!?*@#$%^&-_=+[{]}." + "SECURE_PASSWORD_PATTERN": "Muss mindestens 8 Zeichen enthalten, Minimum von 1 Kleinbuchstabe, 1 Großbuchstabe, 1 Zahl und 1 Sonderzeichen ~!?*@#$%^&-_=+[{]}." } } } diff --git a/public/app/toolbar/i18n/de.json b/public/app/toolbar/i18n/de.json index a399ee6..b6abdf2 100644 --- a/public/app/toolbar/i18n/de.json +++ b/public/app/toolbar/i18n/de.json @@ -1,11 +1,11 @@ { "TOOLBAR": { - "TOGGLE_NAVIGATION": "Navigation wechseln", - "TOGGLE_NAVIGATION_FOLD": "Navigation wechseln Fach", - "TOGGLE_NAVIGATION_MODE": "Navigation Modus umschalten", + "TOGGLE_NAVIGATION": "Navigation umschalten", + "TOGGLE_NAVIGATION_FOLD": "Navigation einklappen", + "TOGGLE_NAVIGATION_MODE": "Navigation Moduswechsel", "SEARCH": "Suche", - "USER_SETTINGS": "Benutzereinstellungen", - "TOGGLE_QUICK_PANEL": "Um schnelle Panel", + "USER_SETTINGS": "Nutzereinstellungen", + "TOGGLE_QUICK_PANEL": "Schnelles Panel umschalten", "ENGLISH": "Englisch", "ITALIAN": "Italienisch", "FRENCH": "Französisch", @@ -18,88 +18,88 @@ "CHINESESIMPLIFIED": "Vereinfachtes Chinesisch", "CHINESETRADITIONAL": "Traditionelles Chinesisch", "DUTCH": "Niederländisch", - "FINNISH": "Finnische", + "FINNISH": "Finnisch", "DANISH": "Dänisch", "PORTUGUESE": "Portugiesisch", "NORWEGIAN": "Norwegisch", "HINDI": "Hindi", "TURKISH": "Türkisch", "PERSIAN": "Persisch", - "LOGIN_TIME": "Login Zeit", - "PAUSE_TIME": "Pausenzeit", + "LOGIN_TIME": "Zeit angemeldet", + "PAUSE_TIME": "Zeit in Pause", "PREVIEW": "Vorschau", "CONFIRM_PASSWORD": "Passwort bestätigen", "NEW_PASSWORD": "Neues Passwort", "OLD_PASSWORD": "Altes Passwort", "SAVE": "Speichern", "TRIAL_VERSION": "Testversion", - "SOMEONE_LOGGED_YOU_OUT": "Jemand eingeloggt haben, möchten Sie angemeldet bleiben?", + "SOMEONE_LOGGED_YOU_OUT": "Sie wurden von einem anderen Benutzer abgemeldet. Erneut anmelden?", "STAY_LOGGED": "Angemeldet bleiben", "WARNING": "Warnung", "PAUSE": "Pause", - "RESUME": "Lebenslauf", - "NO_PAUSES_AVAILABLE": "Keine Pausen zur Verfügung", - "LATVIAN": "Lettische", + "RESUME": "Fortsetzen", + "NO_PAUSES_AVAILABLE": "Keine Pausen verfügbar", + "LATVIAN": "Lettisch", "POLISH": "Polnisch", "ERRORS": { "FIELD_REQUIRED": "Pflichtfeld", "PASSWORD_REQUIRED": "Pflichtfeld", "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", - "SECURE_PASSWORD_PATTERN": "Das Passwort muss mindestens 8 Zeichen lang sein und 1 Kleinbuchstabe, 1 Großbuchstabe, 1 Zahl und 1 Sonderzeichen haben ~! @", - "PASSWORD_OLDPASSWORD_MATCH": "Das neue Passwort muss sich vom vorherigen Passwort unterscheiden" + "SECURE_PASSWORD_PATTERN": "Das Passwort muss mindestens 8 Zeichen lang sein und 1 Kleinbuchstaben, 1 Großbuchstaben, 1 Zahl und 1 Sonderzeichen enthalten.", + "PASSWORD_OLDPASSWORD_MATCH": "Die Passwörter stimmen nicht überein" }, "RESETPASSWORD": "Passwort zurücksetzen", - "PASSWORD_EXPIRE_REMAINING_DAYS": "Verbleibende Tage, bevor Ihr Passwort abläuft", + "PASSWORD_EXPIRE_REMAINING_DAYS": "Verbleibende Tage, bis zum Ablauf des Passwortes", "BROWSER_COMPATIBILITY": "Browserkompatibilität [Chrome, Opera, Safari]", "RECORDING": "Aufzeichnung", - "INVALID_LICENSE": "Ungültige Lizenz", + "INVALID_LICENSE": "Lizenz ungültig", "BROWSER": "Browser", "OS": "Betriebssystem", - "REQUIREMENTS": "Bedarf", + "REQUIREMENTS": "Anforderungen", "LICENSE": "Lizenz", "HTTPS": "HTTPS", "WEBRTCSUPPORT": "WebRTC-Unterstützung", - "REGISTERED": "Eingetragen", + "REGISTERED": "Registriert", "NOT_REGISTERED": "Nicht registriert", - "WEBRTC_LICENSE_NOT_ENABELD": "Die WebRTC-Lizenz ist nicht aktiviert", - "ATTENDED_TRANSFER": "Begleiteter Tranfer", + "WEBRTC_LICENSE_NOT_ENABELD": "WebRTC-Lizenz ist nicht aktiviert", + "ATTENDED_TRANSFER": "Warmer Transfer", "TRANSFER": "Transfer", "TARGET": "Ziel", - "CANCEL": "Stornieren", + "CANCEL": "Abbrechen", "FILENAME": "Dateiname", "STATUS": "Status", "ACTIONS": "Aktionen", - "SPEAKER": "Redner", - "RINGING": "Klingelton", + "SPEAKER": "Lautsprecher", + "RINGING": "Klingeln", "MICROPHONE": "Mikrofon", "PROFILE": "Profil", - "SERVICES": "Dienstleistungen", + "SERVICES": "Dienste", "AUDIO": "Audio", "FULLNAME": "Vollständiger Name", "NAME": "Name", "INTERNAL": "Intern", - "RINGINGDEVICE": "Klingelgerät", - "SPEAKERDEVICE": "Lautsprechergerät", - "MICROPHONEDEVICE": "Mikrofon Gerät", + "RINGINGDEVICE": "Klingeln auf Gerät", + "SPEAKERDEVICE": "Verwendeter Lautsprecher", + "MICROPHONEDEVICE": "Verwendetes Mikrofon", "CHANGEPASSWORD": "Passwort ändern", - "SETTINGS": "die Einstellungen", + "SETTINGS": "Einstellungen", "AUTOANSWER": "Automatische Antwort", "INDONESIAN": "Indonesisch", "ARABIC": "Arabisch", - "CALL": "Anruf", + "CALL": "Anrufen", "PREFIXES": "Präfixe", "HEBREW": "Hebräisch", - "ESTONIAN": "estnisch", + "ESTONIAN": "Estnisch", "CZECH": "Tschechisch", - "BRAZILIAN": "Brasilianer", - "CONFERENCE": "Konferenz mit 2 aktiven Sessions", - "CHANGE_LANGUAGE_MESSAGE": "Denken Sie daran, die Seite zu aktualisieren, um die RTL-Unterstützung anzuwenden (falls aktiviert).", + "BRAZILIAN": "Brasilianisch", + "CONFERENCE": "Konferenz mit 2 aktiven Sitzungen", + "CHANGE_LANGUAGE_MESSAGE": "Bitte Seite aktualisieren, um Änderungen zu übernehmen", "CHANGE_LANGUAGE_TITLE": "Sprache ändern", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Keine Audiogeräte verfügbar", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Kein Mikrofon vorhanden", "WEBRTC_SPEAKER_NOT_AVAILABLE": "Kein Lautsprecher verfügbar", "NO_AVAILABLE_INFO": "Keine verfügbaren Informationen", - "LITHUANIAN": "litauisch", + "LITHUANIAN": "Litauisch", "NOTIFICATION_TITLE": "Neue Benachrichtigung von {{Absender}}", "NOTIFICATION_TITLE_RECIPIENT": "an {{Empfänger}}", "USER_FORCE_LOGOUT": "{{ip}} hat sich mit Ihren Anmeldeinformationen angemeldet.\nMehrfachanmeldungen sind nicht zulässig", diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 092e9f1..ef7a144 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 _0x97d5=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty'];(function(_0x56825b,_0x172b8d){var _0x69ce77=function(_0x348a1c){while(--_0x348a1c){_0x56825b['push'](_0x56825b['shift']());}};_0x69ce77(++_0x172b8d);}(_0x97d5,0x67));var _0x597d=function(_0x5810cf,_0xcffeda){_0x5810cf=_0x5810cf-0x0;var _0x3b76dc=_0x97d5[_0x5810cf];return _0x3b76dc;};'use strict';var Sequelize=require(_0x597d('0x0'));module['exports']={'name':{'type':Sequelize[_0x597d('0x1')],'get':function(_0x397bf2){return this[_0x597d('0x2')](_0x597d('0x3'));}},'action':{'type':Sequelize[_0x597d('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x597d('0x5'),_0x597d('0x6'),_0x597d('0x7'),_0x597d('0x8'),'urlForward',_0x597d('0x9'),_0x597d('0xa'),_0x597d('0xb')]],'msg':_0x597d('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x597d('0x4')](0x1000),'comment':_0x597d('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x597d('0x4')](0x1000),'comment':_0x597d('0xe')},'data4':{'type':Sequelize[_0x597d('0x4')](0x1000)},'data5':{'type':Sequelize[_0x597d('0x4')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x597d('0xf')]}}; \ No newline at end of file +var _0x7f24=['sequelize','exports','VIRTUAL','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT'];(function(_0x2cc8e2,_0x28db24){var _0x4c6a94=function(_0x4a1f3a){while(--_0x4a1f3a){_0x2cc8e2['push'](_0x2cc8e2['shift']());}};_0x4c6a94(++_0x28db24);}(_0x7f24,0xf0));var _0x47f2=function(_0x324661,_0x3fb798){_0x324661=_0x324661-0x0;var _0x135bed=_0x7f24[_0x324661];return _0x135bed;};'use strict';var Sequelize=require(_0x47f2('0x0'));module[_0x47f2('0x1')]={'name':{'type':Sequelize[_0x47f2('0x2')],'get':function(_0x5e6f68){return this['getDataValue'](_0x47f2('0x3'));}},'action':{'type':Sequelize[_0x47f2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x47f2('0x5'),'integration',_0x47f2('0x6'),_0x47f2('0x7'),_0x47f2('0x8'),_0x47f2('0x9'),_0x47f2('0xa'),_0x47f2('0xb')]],'msg':_0x47f2('0xc')}},'comment':_0x47f2('0xc')},'data1':{'type':Sequelize[_0x47f2('0x4')](0x1000),'comment':_0x47f2('0xd')},'data2':{'type':Sequelize[_0x47f2('0x4')](0x1000),'comment':_0x47f2('0xe')},'data3':{'type':Sequelize[_0x47f2('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x47f2('0x4')](0x1000)},'data6':{'type':Sequelize[_0x47f2('0x4')]},'data7':{'type':Sequelize[_0x47f2('0xf')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 6e6ed71..95bdbd8 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 _0x4e6e=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','error','stack','name','send','update','body','Action','params','catch','destroy','find','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0xd55fa0,_0x4132ec){var _0xb428ea=function(_0x44ab55){while(--_0x44ab55){_0xd55fa0['push'](_0xd55fa0['shift']());}};_0xb428ea(++_0x4132ec);}(_0x4e6e,0x76));var _0xe4e6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4e6e[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xe4e6('0x0'));var rimraf=require(_0xe4e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4e6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe4e6('0x3'));var Mustache=require(_0xe4e6('0x4'));var util=require(_0xe4e6('0x5'));var path=require('path');var sox=require(_0xe4e6('0x6'));var csv=require(_0xe4e6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4e6('0x8'));var squel=require(_0xe4e6('0x9'));var crypto=require(_0xe4e6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe4e6('0xb'));var toCsv=require(_0xe4e6('0x7'));var querystring=require(_0xe4e6('0xc'));var Papa=require(_0xe4e6('0xd'));var Redis=require(_0xe4e6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe4e6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e6('0x10'));var logger=require(_0xe4e6('0x11'))('api');var utils=require(_0xe4e6('0x12'));var config=require(_0xe4e6('0x13'));var licenseUtil=require(_0xe4e6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61c38a,_0x5462fa){_0x5462fa=_0x5462fa||0xcc;return function(_0xf60862){if(_0xf60862){return _0x61c38a[_0xe4e6('0x15')](_0x5462fa);}return _0x61c38a[_0xe4e6('0x16')](_0x5462fa)[_0xe4e6('0x17')]();};}function respondWithResult(_0x272e76,_0x5b508c){_0x5b508c=_0x5b508c||0xc8;return function(_0x5de6ea){if(_0x5de6ea){return _0x272e76['status'](_0x5b508c)['json'](_0x5de6ea);}};}function respondWithFilteredResult(_0xb6e9eb,_0x1276ac){return function(_0x14c8fa){if(_0x14c8fa){var _0x24a963=typeof _0x1276ac[_0xe4e6('0x18')]===_0xe4e6('0x19')&&typeof _0x1276ac[_0xe4e6('0x1a')]===_0xe4e6('0x19');var _0x17550e=_0x14c8fa[_0xe4e6('0x1b')];var _0x47a03a=_0x24a963?0x0:_0x1276ac[_0xe4e6('0x18')];var _0x5546bd=_0x24a963?_0x14c8fa[_0xe4e6('0x1b')]:_0x1276ac[_0xe4e6('0x18')]+_0x1276ac['limit'];var _0x1e587e;if(_0x5546bd>=_0x17550e){_0x5546bd=_0x17550e;_0x1e587e=0xc8;}else{_0x1e587e=0xce;}_0xb6e9eb[_0xe4e6('0x16')](_0x1e587e);return _0xb6e9eb[_0xe4e6('0x1c')]('Content-Range',_0x47a03a+'-'+_0x5546bd+'/'+_0x17550e)[_0xe4e6('0x1d')](_0x14c8fa);}return null;};}function patchUpdates(_0x16c2cf){return function(_0x1d0032){try{jsonpatch[_0xe4e6('0x1e')](_0x1d0032,_0x16c2cf,!![]);}catch(_0x399db2){return BPromise[_0xe4e6('0x1f')](_0x399db2);}return _0x1d0032['save']();};}function saveUpdates(_0x43de2f,_0x244755){return function(_0x2a4ff5){if(_0x2a4ff5){return _0x2a4ff5['update'](_0x43de2f)[_0xe4e6('0x20')](function(_0x2c0c2d){return _0x2c0c2d;});}return null;};}function removeEntity(_0x5edb77,_0x245593){return function(_0x251623){if(_0x251623){return _0x251623['destroy']()[_0xe4e6('0x20')](function(){_0x5edb77[_0xe4e6('0x16')](0xcc)[_0xe4e6('0x17')]();});}};}function handleEntityNotFound(_0x3dcded,_0x2368aa){return function(_0xf2fd67){if(!_0xf2fd67){_0x3dcded[_0xe4e6('0x15')](0x194);}return _0xf2fd67;};}function handleError(_0x54fecd,_0x3a5fd0){_0x3a5fd0=_0x3a5fd0||0x1f4;return function(_0x2a19cc){logger[_0xe4e6('0x21')](_0x2a19cc[_0xe4e6('0x22')]);if(_0x2a19cc['name']){delete _0x2a19cc[_0xe4e6('0x23')];}_0x54fecd[_0xe4e6('0x16')](_0x3a5fd0)[_0xe4e6('0x24')](_0x2a19cc);};}exports[_0xe4e6('0x25')]=function(_0x2164c4,_0x1a45e4){if(_0x2164c4[_0xe4e6('0x26')]['id']){delete _0x2164c4[_0xe4e6('0x26')]['id'];}return db[_0xe4e6('0x27')]['find']({'where':{'id':_0x2164c4[_0xe4e6('0x28')]['id']}})[_0xe4e6('0x20')](handleEntityNotFound(_0x1a45e4,null))[_0xe4e6('0x20')](saveUpdates(_0x2164c4['body'],null))['then'](respondWithResult(_0x1a45e4,null))[_0xe4e6('0x29')](handleError(_0x1a45e4,null));};exports[_0xe4e6('0x2a')]=function(_0x2316e6,_0x16208a){return db[_0xe4e6('0x27')][_0xe4e6('0x2b')]({'where':{'id':_0x2316e6[_0xe4e6('0x28')]['id']}})[_0xe4e6('0x20')](handleEntityNotFound(_0x16208a,null))['then'](removeEntity(_0x16208a,null))[_0xe4e6('0x29')](handleError(_0x16208a,null));}; \ No newline at end of file +var _0x46a0=['fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','name','body','Action','catch','find','params','eml-format','rimraf'];(function(_0xa5fbfa,_0x4009b6){var _0x1318f3=function(_0x4c2964){while(--_0x4c2964){_0xa5fbfa['push'](_0xa5fbfa['shift']());}};_0x1318f3(++_0x4009b6);}(_0x46a0,0xe9));var _0x046a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x46a0[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x046a('0x0'));var rimraf=require(_0x046a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x046a('0x2'));var rp=require(_0x046a('0x3'));var moment=require(_0x046a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x046a('0x5'));var util=require(_0x046a('0x6'));var path=require('path');var sox=require(_0x046a('0x7'));var csv=require('to-csv');var ejs=require(_0x046a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x046a('0x9'));var squel=require('squel');var crypto=require(_0x046a('0xa'));var jsforce=require(_0x046a('0xb'));var deskjs=require(_0x046a('0xc'));var toCsv=require(_0x046a('0xd'));var querystring=require(_0x046a('0xe'));var Papa=require(_0x046a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x046a('0x10'));var as=require(_0x046a('0x11'));var hardwareService=require(_0x046a('0x12'));var logger=require(_0x046a('0x13'))(_0x046a('0x14'));var utils=require(_0x046a('0x15'));var config=require(_0x046a('0x16'));var licenseUtil=require(_0x046a('0x17'));var db=require(_0x046a('0x18'))['db'];function respondWithStatusCode(_0xf22835,_0x5c098c){_0x5c098c=_0x5c098c||0xcc;return function(_0x48b2a0){if(_0x48b2a0){return _0xf22835[_0x046a('0x19')](_0x5c098c);}return _0xf22835[_0x046a('0x1a')](_0x5c098c)[_0x046a('0x1b')]();};}function respondWithResult(_0x1c3af4,_0x1123b8){_0x1123b8=_0x1123b8||0xc8;return function(_0x140195){if(_0x140195){return _0x1c3af4[_0x046a('0x1a')](_0x1123b8)[_0x046a('0x1c')](_0x140195);}};}function respondWithFilteredResult(_0x1a8398,_0x181317){return function(_0x461628){if(_0x461628){var _0x59faee=typeof _0x181317[_0x046a('0x1d')]===_0x046a('0x1e')&&typeof _0x181317['limit']===_0x046a('0x1e');var _0x4db743=_0x461628[_0x046a('0x1f')];var _0x3664d8=_0x59faee?0x0:_0x181317['offset'];var _0x175fb7=_0x59faee?_0x461628['count']:_0x181317[_0x046a('0x1d')]+_0x181317[_0x046a('0x20')];var _0x32a889;if(_0x175fb7>=_0x4db743){_0x175fb7=_0x4db743;_0x32a889=0xc8;}else{_0x32a889=0xce;}_0x1a8398['status'](_0x32a889);return _0x1a8398[_0x046a('0x21')](_0x046a('0x22'),_0x3664d8+'-'+_0x175fb7+'/'+_0x4db743)[_0x046a('0x1c')](_0x461628);}return null;};}function patchUpdates(_0x4905d5){return function(_0x3bc372){try{jsonpatch['apply'](_0x3bc372,_0x4905d5,!![]);}catch(_0x3de05d){return BPromise[_0x046a('0x23')](_0x3de05d);}return _0x3bc372[_0x046a('0x24')]();};}function saveUpdates(_0x1e734c,_0x5a8ac2){return function(_0xd3ffa3){if(_0xd3ffa3){return _0xd3ffa3[_0x046a('0x25')](_0x1e734c)['then'](function(_0x4b9910){return _0x4b9910;});}return null;};}function removeEntity(_0x49ad05,_0x5d30da){return function(_0x168fe6){if(_0x168fe6){return _0x168fe6[_0x046a('0x26')]()[_0x046a('0x27')](function(){_0x49ad05[_0x046a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2432d2,_0x20486c){return function(_0x5b4e92){if(!_0x5b4e92){_0x2432d2[_0x046a('0x19')](0x194);}return _0x5b4e92;};}function handleError(_0x4e58e9,_0x8e2574){_0x8e2574=_0x8e2574||0x1f4;return function(_0x85e694){logger[_0x046a('0x28')](_0x85e694['stack']);if(_0x85e694[_0x046a('0x29')]){delete _0x85e694[_0x046a('0x29')];}_0x4e58e9['status'](_0x8e2574)['send'](_0x85e694);};}exports[_0x046a('0x25')]=function(_0x18ecde,_0x88430e){if(_0x18ecde[_0x046a('0x2a')]['id']){delete _0x18ecde[_0x046a('0x2a')]['id'];}return db[_0x046a('0x2b')]['find']({'where':{'id':_0x18ecde['params']['id']}})[_0x046a('0x27')](handleEntityNotFound(_0x88430e,null))['then'](saveUpdates(_0x18ecde[_0x046a('0x2a')],null))[_0x046a('0x27')](respondWithResult(_0x88430e,null))[_0x046a('0x2c')](handleError(_0x88430e,null));};exports['destroy']=function(_0x4370c0,_0x2145e7){return db[_0x046a('0x2b')][_0x046a('0x2d')]({'where':{'id':_0x4370c0[_0x046a('0x2e')]['id']}})[_0x046a('0x27')](handleEntityNotFound(_0x2145e7,null))[_0x046a('0x27')](removeEntity(_0x2145e7,null))[_0x046a('0x2c')](handleError(_0x2145e7,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 3e047e7..2c31606 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 _0x4255=['tools_actions','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define','Action'];(function(_0x21f457,_0x236b16){var _0x179f47=function(_0xec2a19){while(--_0xec2a19){_0x21f457['push'](_0x21f457['shift']());}};_0x179f47(++_0x236b16);}(_0x4255,0x1bb));var _0x5425=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x4255[_0x178856];return _0x3c7fe7;};'use strict';var _=require(_0x5425('0x0'));var util=require('util');var logger=require(_0x5425('0x1'))(_0x5425('0x2'));var moment=require(_0x5425('0x3'));var BPromise=require(_0x5425('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5425('0x5'));var rimraf=require(_0x5425('0x6'));var config=require(_0x5425('0x7'));var attributes=require(_0x5425('0x8'));module[_0x5425('0x9')]=function(_0x439f1b,_0xb9e88c){return _0x439f1b[_0x5425('0xa')](_0x5425('0xb'),attributes,{'tableName':_0x5425('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb035=['moment','bluebird','request-promise','path','rimraf','exports','define','lodash','util'];(function(_0x15f43a,_0x57c8b5){var _0x2369bc=function(_0x46c265){while(--_0x46c265){_0x15f43a['push'](_0x15f43a['shift']());}};_0x2369bc(++_0x57c8b5);}(_0xb035,0x1b7));var _0x5b03=function(_0x165d3c,_0x3ba20d){_0x165d3c=_0x165d3c-0x0;var _0xc27339=_0xb035[_0x165d3c];return _0xc27339;};'use strict';var _=require(_0x5b03('0x0'));var util=require(_0x5b03('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5b03('0x2'));var BPromise=require(_0x5b03('0x3'));var rp=require(_0x5b03('0x4'));var fs=require('fs');var path=require(_0x5b03('0x5'));var rimraf=require(_0x5b03('0x6'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x5b03('0x7')]=function(_0x4d3fd6,_0x3838a3){return _0x4d3fd6[_0x5b03('0x8')]('Action',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 2b60d9d..e4acf6f 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x9faff7,_0x59a564){var _0x4f8043=function(_0x5f060d){while(--_0x5f060d){_0x9faff7['push'](_0x9faff7['shift']());}};_0x4f8043(++_0x59a564);}(_0x5fab,0x177));var _0xb5fa=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x5fab[_0x3ec333];return _0x15ccb8;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file +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(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x814b,0x1a2));var _0xb814=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0x814b[_0x1ad901];return _0x3c0249;};'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 diff --git a/server/api/action/index.js b/server/api/action/index.js index 65d6918..af6d56f 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 _0x6aec=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x4d1d20,_0x2dead1){var _0x547c54=function(_0x510aae){while(--_0x510aae){_0x4d1d20['push'](_0x4d1d20['shift']());}};_0x547c54(++_0x2dead1);}(_0x6aec,0xb5));var _0xc6ae=function(_0x978525,_0x2aef01){_0x978525=_0x978525-0x0;var _0x31b2f3=_0x6aec[_0x978525];return _0x31b2f3;};'use strict';var multer=require(_0xc6ae('0x0'));var util=require(_0xc6ae('0x1'));var path=require(_0xc6ae('0x2'));var timeout=require(_0xc6ae('0x3'));var express=require(_0xc6ae('0x4'));var router=express[_0xc6ae('0x5')]();var fs_extra=require(_0xc6ae('0x6'));var auth=require(_0xc6ae('0x7'));var interaction=require(_0xc6ae('0x8'));var config=require(_0xc6ae('0x9'));var controller=require(_0xc6ae('0xa'));router[_0xc6ae('0xb')](_0xc6ae('0xc'),auth[_0xc6ae('0xd')](),controller[_0xc6ae('0xe')]);router[_0xc6ae('0xf')](_0xc6ae('0xc'),auth[_0xc6ae('0xd')](),controller[_0xc6ae('0x10')]);module[_0xc6ae('0x11')]=router; \ No newline at end of file +var _0xb8e8=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','multer','util','path'];(function(_0x488141,_0x58c0a4){var _0xb35deb=function(_0x657f76){while(--_0x657f76){_0x488141['push'](_0x488141['shift']());}};_0xb35deb(++_0x58c0a4);}(_0xb8e8,0xeb));var _0x8b8e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb8e8[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x8b8e('0x0'));var util=require(_0x8b8e('0x1'));var path=require(_0x8b8e('0x2'));var timeout=require('connect-timeout');var express=require(_0x8b8e('0x3'));var router=express[_0x8b8e('0x4')]();var fs_extra=require(_0x8b8e('0x5'));var auth=require(_0x8b8e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8b8e('0x7'));var controller=require(_0x8b8e('0x8'));router['put'](_0x8b8e('0x9'),auth[_0x8b8e('0xa')](),controller[_0x8b8e('0xb')]);router[_0x8b8e('0xc')]('/:id',auth[_0x8b8e('0xa')](),controller[_0x8b8e('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index ec35872..d568439 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 _0x425d=['sequelize','STRING','TEXT'];(function(_0x23aa53,_0x3d1c09){var _0x45c8ec=function(_0xefa646){while(--_0xefa646){_0x23aa53['push'](_0x23aa53['shift']());}};_0x45c8ec(++_0x3d1c09);}(_0x425d,0x1e0));var _0xd425=function(_0x298374,_0x4d34c4){_0x298374=_0x298374-0x0;var _0x42ada1=_0x425d[_0x298374];return _0x42ada1;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file +var _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x33b586,_0x484222){var _0x14bcfd=function(_0x13cf2d){while(--_0x13cf2d){_0x33b586['push'](_0x33b586['shift']());}};_0x14bcfd(++_0x484222);}(_0x1883,0xab));var _0x3188=function(_0x45bd9f,_0x23507b){_0x45bd9f=_0x45bd9f-0x0;var _0x160dc3=_0x1883[_0x45bd9f];return _0x160dc3;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index fedfff4..9faea2c 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 _0xf4ba=['groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','MIN(%s)','SEC_TO_TIME(%s)','HOUR(%s)','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','findAll','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','IS\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','name','index','map','AnalyticCustomReport','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick','where','merge','filter','options','rows','show','include','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xf4ba,0x17e));var _0xaf4b=function(_0x274ac7,_0xd3b201){_0x274ac7=_0x274ac7-0x0;var _0x1f9a15=_0xf4ba[_0x274ac7];return _0x1f9a15;};'use strict';var emlformat=require(_0xaf4b('0x0'));var rimraf=require(_0xaf4b('0x1'));var zipdir=require(_0xaf4b('0x2'));var jsonpatch=require(_0xaf4b('0x3'));var rp=require(_0xaf4b('0x4'));var moment=require(_0xaf4b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaf4b('0x6'));var util=require(_0xaf4b('0x7'));var path=require('path');var sox=require(_0xaf4b('0x8'));var csv=require(_0xaf4b('0x9'));var ejs=require(_0xaf4b('0xa'));var fs=require('fs');var fs_extra=require(_0xaf4b('0xb'));var _=require(_0xaf4b('0xc'));var squel=require(_0xaf4b('0xd'));var crypto=require(_0xaf4b('0xe'));var jsforce=require(_0xaf4b('0xf'));var deskjs=require(_0xaf4b('0x10'));var toCsv=require(_0xaf4b('0x9'));var querystring=require(_0xaf4b('0x11'));var Papa=require('papaparse');var Redis=require(_0xaf4b('0x12'));var authService=require(_0xaf4b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xaf4b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf4b('0x15'))(_0xaf4b('0x16'));var utils=require('../../config/utils');var config=require(_0xaf4b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xaf4b('0x18'))['dbH'];function respondWithStatusCode(_0x36afe5,_0x2a1ca5){_0x2a1ca5=_0x2a1ca5||0xcc;return function(_0x268a92){if(_0x268a92){return _0x36afe5[_0xaf4b('0x19')](_0x2a1ca5);}return _0x36afe5[_0xaf4b('0x1a')](_0x2a1ca5)[_0xaf4b('0x1b')]();};}function respondWithResult(_0x529fae,_0x566f3b){_0x566f3b=_0x566f3b||0xc8;return function(_0xb38b08){if(_0xb38b08){return _0x529fae[_0xaf4b('0x1a')](_0x566f3b)[_0xaf4b('0x1c')](_0xb38b08);}};}function respondWithFilteredResult(_0x2e1176,_0x5049dd){return function(_0xb49cba){if(_0xb49cba){var _0x5a4968=typeof _0x5049dd['offset']===_0xaf4b('0x1d')&&typeof _0x5049dd[_0xaf4b('0x1e')]===_0xaf4b('0x1d');var _0x5b03a9=_0xb49cba[_0xaf4b('0x1f')];var _0x474235=_0x5a4968?0x0:_0x5049dd['offset'];var _0x4d4fe6=_0x5a4968?_0xb49cba[_0xaf4b('0x1f')]:_0x5049dd['offset']+_0x5049dd['limit'];var _0x3046be;if(_0x4d4fe6>=_0x5b03a9){_0x4d4fe6=_0x5b03a9;_0x3046be=0xc8;}else{_0x3046be=0xce;}_0x2e1176[_0xaf4b('0x1a')](_0x3046be);return _0x2e1176[_0xaf4b('0x20')](_0xaf4b('0x21'),_0x474235+'-'+_0x4d4fe6+'/'+_0x5b03a9)[_0xaf4b('0x1c')](_0xb49cba);}return null;};}function patchUpdates(_0x53e347){return function(_0x1b40b3){try{jsonpatch['apply'](_0x1b40b3,_0x53e347,!![]);}catch(_0x2fe2b0){return BPromise[_0xaf4b('0x22')](_0x2fe2b0);}return _0x1b40b3[_0xaf4b('0x23')]();};}function saveUpdates(_0x50f0da,_0x1bf850){return function(_0x54e386){if(_0x54e386){return _0x54e386['update'](_0x50f0da)[_0xaf4b('0x24')](function(_0x549915){return _0x549915;});}return null;};}function removeEntity(_0x2f183c,_0x459dc5){return function(_0x24d860){if(_0x24d860){return _0x24d860[_0xaf4b('0x25')]()['then'](function(){var _0x598efd=_0x24d860[_0xaf4b('0x26')]({'plain':!![]});var _0x44c1bb='CustomReports';return db[_0xaf4b('0x27')][_0xaf4b('0x25')]({'where':{'type':_0x44c1bb,'resourceId':_0x598efd['id']}})['then'](function(){return _0x24d860;});})[_0xaf4b('0x24')](function(){_0x2f183c[_0xaf4b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a7600,_0x5fe575){return function(_0x12bffd){if(!_0x12bffd){_0x3a7600[_0xaf4b('0x19')](0x194);}return _0x12bffd;};}function handleError(_0xdf4093,_0x5556e2){_0x5556e2=_0x5556e2||0x1f4;return function(_0x35bbc1){logger[_0xaf4b('0x28')](_0x35bbc1['stack']);if(_0x35bbc1[_0xaf4b('0x29')]){delete _0x35bbc1[_0xaf4b('0x29')];}_0xdf4093['status'](_0x5556e2)['send'](_0x35bbc1);};}exports[_0xaf4b('0x2a')]=function(_0xc896d6,_0x21f140){var _0x12006b={},_0x5982e4={},_0x538ede={'count':0x0,'rows':[]};var _0x486faf=_[_0xaf4b('0x2b')](db[_0xaf4b('0x2c')][_0xaf4b('0x2d')],function(_0x5e04fa){return{'name':_0x5e04fa['fieldName'],'type':_0x5e04fa[_0xaf4b('0x2e')][_0xaf4b('0x2f')]};});_0x5982e4[_0xaf4b('0x30')]=_[_0xaf4b('0x2b')](_0x486faf,_0xaf4b('0x29'));_0x5982e4['query']=_[_0xaf4b('0x31')](_0xc896d6[_0xaf4b('0x32')]);_0x5982e4['filters']=_[_0xaf4b('0x33')](_0x5982e4[_0xaf4b('0x30')],_0x5982e4['query']);_0x12006b[_0xaf4b('0x34')]=_['intersection'](_0x5982e4[_0xaf4b('0x30')],qs[_0xaf4b('0x35')](_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x35')]));_0x12006b[_0xaf4b('0x34')]=_0x12006b[_0xaf4b('0x34')][_0xaf4b('0x36')]?_0x12006b['attributes']:_0x5982e4[_0xaf4b('0x30')];if(!_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x37')](_0xaf4b('0x38'))){_0x12006b[_0xaf4b('0x1e')]=qs[_0xaf4b('0x1e')](_0xc896d6[_0xaf4b('0x32')]['limit']);_0x12006b[_0xaf4b('0x39')]=qs[_0xaf4b('0x39')](_0xc896d6['query'][_0xaf4b('0x39')]);}_0x12006b[_0xaf4b('0x3a')]=qs[_0xaf4b('0x3b')](_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x3b')]);_0x12006b['where']=qs[_0xaf4b('0x3c')](_[_0xaf4b('0x3d')](_0xc896d6[_0xaf4b('0x32')],_0x5982e4['filters']),_0x486faf);if(_0xc896d6[_0xaf4b('0x32')]['filter']){_0x12006b[_0xaf4b('0x3e')]=_[_0xaf4b('0x3f')](_0x12006b['where'],{'$or':_[_0xaf4b('0x2b')](_0x486faf,function(_0x492359){if(_0x492359['type']!=='VIRTUAL'){var _0x40dcd8={};_0x40dcd8[_0x492359[_0xaf4b('0x29')]]={'$like':'%'+_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x40')]+'%'};return _0x40dcd8;}})});}_0x12006b=_[_0xaf4b('0x3f')]({},_0x12006b,_0xc896d6[_0xaf4b('0x41')]);var _0x2541b1={'where':_0x12006b[_0xaf4b('0x3e')]};return db[_0xaf4b('0x2c')]['count'](_0x2541b1)[_0xaf4b('0x24')](function(_0x52fb8e){_0x538ede[_0xaf4b('0x1f')]=_0x52fb8e;if(_0xc896d6[_0xaf4b('0x32')]['includeAll']){_0x12006b['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x12006b);})[_0xaf4b('0x24')](function(_0x3a4a6f){_0x538ede[_0xaf4b('0x42')]=_0x3a4a6f;return _0x538ede;})[_0xaf4b('0x24')](respondWithFilteredResult(_0x21f140,_0x12006b))['catch'](handleError(_0x21f140,null));};exports[_0xaf4b('0x43')]=function(_0x58078b,_0xa01f60){var _0x2a059b={'raw':![],'where':{'id':_0x58078b['params']['id']}},_0x552753={};_0x552753[_0xaf4b('0x30')]=_[_0xaf4b('0x31')](db['AnalyticCustomReport'][_0xaf4b('0x2d')]);_0x552753[_0xaf4b('0x32')]=_[_0xaf4b('0x31')](_0x58078b[_0xaf4b('0x32')]);_0x552753[_0xaf4b('0x3c')]=_['intersection'](_0x552753[_0xaf4b('0x30')],_0x552753[_0xaf4b('0x32')]);_0x2a059b['attributes']=_['intersection'](_0x552753['model'],qs[_0xaf4b('0x35')](_0x58078b[_0xaf4b('0x32')][_0xaf4b('0x35')]));_0x2a059b[_0xaf4b('0x34')]=_0x2a059b['attributes'][_0xaf4b('0x36')]?_0x2a059b[_0xaf4b('0x34')]:_0x552753[_0xaf4b('0x30')];if(_0x58078b[_0xaf4b('0x32')]['includeAll']){_0x2a059b[_0xaf4b('0x44')]=[{'all':!![]}];}_0x2a059b=_['merge']({},_0x2a059b,_0x58078b[_0xaf4b('0x41')]);return db[_0xaf4b('0x2c')]['find'](_0x2a059b)[_0xaf4b('0x24')](handleEntityNotFound(_0xa01f60,null))[_0xaf4b('0x24')](respondWithResult(_0xa01f60,null))[_0xaf4b('0x45')](handleError(_0xa01f60,null));};exports[_0xaf4b('0x46')]=function(_0x56638a,_0x14213a){return db[_0xaf4b('0x2c')][_0xaf4b('0x46')](_0x56638a['body'],{})[_0xaf4b('0x24')](function(_0x544976){var _0x262883=_0x56638a['user'][_0xaf4b('0x26')]({'plain':!![]});if(!_0x262883)throw new Error(_0xaf4b('0x47'));if(_0x262883[_0xaf4b('0x48')]===_0xaf4b('0x49')){var _0x477517=_0x544976[_0xaf4b('0x26')]({'plain':!![]});var _0x57b648='Reports';return db[_0xaf4b('0x4a')]['find']({'where':{'name':_0x57b648,'userProfileId':_0x262883['userProfileId']},'raw':!![]})[_0xaf4b('0x24')](function(_0xfa2fde){if(_0xfa2fde&&_0xfa2fde[_0xaf4b('0x4b')]===0x0){return db[_0xaf4b('0x27')]['create']({'name':_0x477517[_0xaf4b('0x29')],'resourceId':_0x477517['id'],'type':_0xaf4b('0x4c'),'sectionId':_0xfa2fde['id']},{})[_0xaf4b('0x24')](function(){return _0x544976;});}else{return _0x544976;}})['catch'](function(_0x5221e1){logger[_0xaf4b('0x28')](_0xaf4b('0x4d'),_0x5221e1);throw _0x5221e1;});}return _0x544976;})[_0xaf4b('0x24')](respondWithResult(_0x14213a,0xc9))[_0xaf4b('0x45')](handleError(_0x14213a,null));};exports['update']=function(_0x52804c,_0x594956){if(_0x52804c[_0xaf4b('0x4e')]['id']){delete _0x52804c['body']['id'];}return db['AnalyticCustomReport'][_0xaf4b('0x4f')]({'where':{'id':_0x52804c[_0xaf4b('0x50')]['id']}})[_0xaf4b('0x24')](handleEntityNotFound(_0x594956,null))['then'](saveUpdates(_0x52804c['body'],null))[_0xaf4b('0x24')](respondWithResult(_0x594956,null))[_0xaf4b('0x45')](handleError(_0x594956,null));};exports[_0xaf4b('0x25')]=function(_0x1d49b8,_0x4fcbe1){return db[_0xaf4b('0x2c')][_0xaf4b('0x4f')]({'where':{'id':_0x1d49b8[_0xaf4b('0x50')]['id']}})[_0xaf4b('0x24')](handleEntityNotFound(_0x4fcbe1,null))[_0xaf4b('0x24')](removeEntity(_0x4fcbe1,null))['catch'](handleError(_0x4fcbe1,null));};exports[_0xaf4b('0x51')]=function(_0x40dd22,_0x1fee08){var _0x2284b5=0xa;var _0x3da460=[_0xaf4b('0x52'),_0xaf4b('0x53'),_0xaf4b('0x54'),_0xaf4b('0x55')];var _0x446ffe={'SUM':_0xaf4b('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xaf4b('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xaf4b('0x58'),'GROUP_CONCAT':_0xaf4b('0x59'),'GROUP_CONCAT ASC':_0xaf4b('0x5a'),'GROUP_CONCAT DESC':_0xaf4b('0x5b')};var _0x33573a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xaf4b('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xaf4b('0x5d'),'UNIX_TIMESTAMP':_0xaf4b('0x5e')};var _0x2dd756=function(_0x30c493){return!_[_0xaf4b('0x5f')]([_0xaf4b('0x60'),_0xaf4b('0x61'),'IS\x20EMPTY',_0xaf4b('0x62')],_0x30c493);};var _0x52498f=function(_0xa3c7bc){if(!_0xa3c7bc||!_0xa3c7bc[_0xaf4b('0x63')][_0xaf4b('0x36')]){return'';}for(var _0x35207e='(',_0x9d2c94=0x0;_0x9d2c94<_0xa3c7bc[_0xaf4b('0x63')]['length'];_0x9d2c94+=0x1){_0x9d2c94>0x0&&(_0x35207e+='\x20'+_0xa3c7bc[_0xaf4b('0x64')]+'\x20');_0x35207e+=_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94]['group']?_0x52498f(_0xa3c7bc['rules'][_0x9d2c94][_0xaf4b('0x65')]):_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94][_0xaf4b('0x66')]+'\x20'+_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94][_0xaf4b('0x67')]+(_0x2dd756(_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94][_0xaf4b('0x67')])?'\x20'+_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94]['value']:'');}return _0x35207e+')';};var _0x2ab791={'where':{'id':_0x40dd22[_0xaf4b('0x50')]['id']}},_0x4be5bd,_0x10556a,_0x5452ab,_0x2bb6c3,_0x80732c;_0x2ab791=_['merge']({},_0x2ab791,_0x40dd22[_0xaf4b('0x41')]);return db[_0xaf4b('0x2c')][_0xaf4b('0x4f')](_0x2ab791)[_0xaf4b('0x24')](function(_0x5488fc){if(_0x5488fc){_0x4be5bd=_0x5488fc;return _0x5488fc['getFields']();}return null;})['then'](function(_0x464556){if(_0x464556){if(!_0x464556[_0xaf4b('0x36')]){throw new db[(_0xaf4b('0x68'))][(_0xaf4b('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10556a=_0x464556;return db[_0xaf4b('0x6a')]['findAll']({'raw':!![]});}return null;})[_0xaf4b('0x24')](function(_0xc3daa9){if(_0xc3daa9){_0x5452ab=_[_0xaf4b('0x6b')](_0xc3daa9,'id');var _0x1f1938;var _0x452d54=squel[_0xaf4b('0x6c')]();_0x452d54[_0xaf4b('0x6d')](_0x4be5bd[_0xaf4b('0x6e')]);for(var _0x46d4e8=0x0;_0x46d4e8<_0x10556a[_0xaf4b('0x36')];_0x46d4e8+=0x1){_0x1f1938=_0x10556a[_0x46d4e8][_0xaf4b('0x6f')]?_0x5452ab[_0x10556a[_0x46d4e8][_0xaf4b('0x6f')]][_0xaf4b('0x70')]:_0x10556a[_0x46d4e8][_0xaf4b('0x66')];_0x1f1938=_0x10556a[_0x46d4e8][_0xaf4b('0x71')]?_[_0xaf4b('0x72')](_0x446ffe[_0x10556a[_0x46d4e8][_0xaf4b('0x71')]],'%s',_0x1f1938):_0x1f1938;_0x1f1938=_0x10556a[_0x46d4e8][_0xaf4b('0x73')]?_[_0xaf4b('0x72')](_0x33573a[_0x10556a[_0x46d4e8][_0xaf4b('0x73')]],'%s',_0x1f1938):_0x1f1938;if(_0x10556a[_0x46d4e8][_0xaf4b('0x74')]){_0x452d54[_0xaf4b('0x65')](_0x1f1938);}_0x10556a[_0x46d4e8][_0xaf4b('0x75')]&&_0x452d54[_0xaf4b('0x3a')](_0x1f1938,_0x10556a[_0x46d4e8]['orderBy']===_0xaf4b('0x76')?![]:!![]);_0x452d54['field'](_0x1f1938,_0x10556a[_0x46d4e8][_0xaf4b('0x77')]||_0x1f1938);}if(_0x4be5bd[_0xaf4b('0x78')]){_0x4be5bd[_0xaf4b('0x78')]=JSON[_0xaf4b('0x79')](_0x4be5bd[_0xaf4b('0x78')]);for(var _0x431c08=0x0;_0x431c08<_0x4be5bd[_0xaf4b('0x78')]['length'];_0x431c08+=0x1){if(_0x4be5bd['joins'][_0x431c08][_0xaf4b('0x2e')]&&_[_0xaf4b('0x5f')](_0x3da460,_0x4be5bd[_0xaf4b('0x78')][_0x431c08]['type'])&&_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7a')]&&_0x4be5bd['joins'][_0x431c08][_0xaf4b('0x7b')]&&_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7c')]){_0x452d54[_0x4be5bd[_0xaf4b('0x78')][_0x431c08]['type']](_0x4be5bd['joins'][_0x431c08]['foreignTable'],null,util['format'](_0xaf4b('0x7d'),_0x4be5bd['table'],_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7a')],_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7b')],_0x4be5bd['joins'][_0x431c08][_0xaf4b('0x7c')]));}}}if(_0x4be5bd[_0xaf4b('0x7e')]){_0x4be5bd[_0xaf4b('0x7e')]=JSON['parse'](_0x4be5bd[_0xaf4b('0x7e')]);_0x452d54[_0xaf4b('0x3e')](_0x52498f(_0x4be5bd[_0xaf4b('0x7e')][_0xaf4b('0x65')]));}_0x80732c=_0x452d54[_0xaf4b('0x7f')]();_0x452d54[_0xaf4b('0x1e')](_0x2284b5);_0x452d54[_0xaf4b('0x39')](0x0);logger[_0xaf4b('0x80')](_0xaf4b('0x81'),_0x452d54[_0xaf4b('0x82')]());return dbH[_0xaf4b('0x83')][_0xaf4b('0x32')](_0x452d54['toString'](),{'type':dbH[_0xaf4b('0x83')][_0xaf4b('0x84')][_0xaf4b('0x85')]});}})[_0xaf4b('0x24')](respondWithResult(_0x1fee08,null))[_0xaf4b('0x45')](handleError(_0x1fee08,null));};function runReport(_0x1c8638,_0x26e848,_0x105bb6){var _0x484e1f=_0x26e848[_0xaf4b('0x29')];var _0x13d6c1=0xa;var _0x93ca91=['join','left_join',_0xaf4b('0x54'),_0xaf4b('0x55')];var _0xa03660={'SUM':'SUM(%s)','COUNT':_0xaf4b('0x86'),'COUNT DISTINCT':_0xaf4b('0x57'),'MAX':_0xaf4b('0x87'),'MIN':_0xaf4b('0x88'),'AVG':_0xaf4b('0x58'),'GROUP_CONCAT':_0xaf4b('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xaf4b('0x5b')};var _0x421d31={'SEC_TO_TIME':_0xaf4b('0x89'),'DATE':'DATE(%s)','HOUR':_0xaf4b('0x8a'),'ROUND':_0xaf4b('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x19cb2e=function(_0xd458){return!_[_0xaf4b('0x5f')]([_0xaf4b('0x60'),_0xaf4b('0x61'),'IS\x20EMPTY',_0xaf4b('0x62')],_0xd458);};var _0x39cf5f=function(_0x132100){if(!_0x132100||!_0x132100[_0xaf4b('0x63')][_0xaf4b('0x36')]){return'';}for(var _0x515cda='(',_0x4c2d8e=0x0;_0x4c2d8e<_0x132100[_0xaf4b('0x63')][_0xaf4b('0x36')];_0x4c2d8e+=0x1){_0x4c2d8e>0x0&&(_0x515cda+='\x20'+_0x132100['operator']+'\x20');_0x515cda+=_0x132100[_0xaf4b('0x63')][_0x4c2d8e]['group']?_0x39cf5f(_0x132100[_0xaf4b('0x63')][_0x4c2d8e]['group']):_0x132100[_0xaf4b('0x63')][_0x4c2d8e][_0xaf4b('0x66')]+'\x20'+_0x132100[_0xaf4b('0x63')][_0x4c2d8e][_0xaf4b('0x67')]+(_0x19cb2e(_0x132100[_0xaf4b('0x63')][_0x4c2d8e]['condition'])?'\x20'+_0x132100['rules'][_0x4c2d8e][_0xaf4b('0x8b')]:'');}return _0x515cda+')';};var _0x169c73={'where':{'id':_0x1c8638['id']}},_0x3acfd5,_0x283909,_0x4fb0b0,_0x26f070,_0x19fce9;_0x169c73=_[_0xaf4b('0x3f')]({},_0x169c73,_0x105bb6);return db['AnalyticCustomReport'][_0xaf4b('0x4f')](_0x169c73)[_0xaf4b('0x24')](function(_0x244452){if(_0x244452){_0x3acfd5=_0x244452;return _0x244452[_0xaf4b('0x8c')]();}return null;})[_0xaf4b('0x24')](function(_0x115289){if(_0x115289){if(!_0x115289[_0xaf4b('0x36')]){throw new db['Sequelize'][(_0xaf4b('0x69'))](_0xaf4b('0x8d'),0x193);}_0x283909=_0x115289;return db[_0xaf4b('0x6a')][_0xaf4b('0x8e')]({'raw':!![]});}return null;})[_0xaf4b('0x24')](function(_0x49ba71){if(_0x49ba71){_0x4fb0b0=_[_0xaf4b('0x6b')](_0x49ba71,'id');var _0x3774cb;var _0x47ff40=squel[_0xaf4b('0x6c')]();_0x47ff40[_0xaf4b('0x6d')](_0x3acfd5[_0xaf4b('0x6e')]);for(var _0x433d16=0x0;_0x433d16<_0x283909[_0xaf4b('0x36')];_0x433d16+=0x1){_0x3774cb=_0x283909[_0x433d16][_0xaf4b('0x6f')]?_0x4fb0b0[_0x283909[_0x433d16][_0xaf4b('0x6f')]]['metric']:_0x283909[_0x433d16][_0xaf4b('0x66')];_0x3774cb=_0x283909[_0x433d16][_0xaf4b('0x71')]?_[_0xaf4b('0x72')](_0xa03660[_0x283909[_0x433d16][_0xaf4b('0x71')]],'%s',_0x3774cb):_0x3774cb;_0x3774cb=_0x283909[_0x433d16]['format']?_[_0xaf4b('0x72')](_0x421d31[_0x283909[_0x433d16][_0xaf4b('0x73')]],'%s',_0x3774cb):_0x3774cb;if(_0x283909[_0x433d16][_0xaf4b('0x74')]){_0x47ff40[_0xaf4b('0x65')](_0x3774cb);}_0x283909[_0x433d16][_0xaf4b('0x75')]&&_0x47ff40[_0xaf4b('0x3a')](_0x3774cb,_0x283909[_0x433d16][_0xaf4b('0x75')]===_0xaf4b('0x76')?![]:!![]);_0x47ff40[_0xaf4b('0x66')](_0x3774cb,_0x283909[_0x433d16][_0xaf4b('0x77')]||_0x3774cb);}if(_0x3acfd5['joins']){_0x3acfd5[_0xaf4b('0x78')]=JSON['parse'](_0x3acfd5['joins']);for(var _0xc7bafd=0x0;_0xc7bafd<_0x3acfd5[_0xaf4b('0x78')][_0xaf4b('0x36')];_0xc7bafd+=0x1){if(_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x2e')]&&_[_0xaf4b('0x5f')](_0x93ca91,_0x3acfd5['joins'][_0xc7bafd][_0xaf4b('0x2e')])&&_0x3acfd5['joins'][_0xc7bafd]['parentKey']&&_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['foreignTable']&&_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['foreignKey']){_0x47ff40[_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['type']](_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x7b')],null,util[_0xaf4b('0x73')](_0xaf4b('0x7d'),_0x3acfd5[_0xaf4b('0x6e')],_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x7a')],_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['foreignTable'],_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x7c')]));}}}if(_0x3acfd5[_0xaf4b('0x7e')]){_0x3acfd5[_0xaf4b('0x7e')]=JSON[_0xaf4b('0x79')](_0x3acfd5['conditions']);_0x47ff40[_0xaf4b('0x3e')](_0x39cf5f(_0x3acfd5['conditions']['group']));}_0x19fce9=_0x47ff40[_0xaf4b('0x7f')]();_0x47ff40['limit'](_0x13d6c1);_0x47ff40[_0xaf4b('0x39')](0x0);return;}})[_0xaf4b('0x24')](function(){if(_0x26e848[_0xaf4b('0x8f')]===_0xaf4b('0x90')){return null;}var _0x187eb5=_[_0xaf4b('0x3f')](_0x26e848,{'name':_0x26e848[_0xaf4b('0x91')]||_0x26e848[_0xaf4b('0x29')]||_0x3acfd5[_0xaf4b('0x29')],'basename':_0x484e1f,'savename':util[_0xaf4b('0x73')](_0xaf4b('0x92'),_0x26e848[_0xaf4b('0x29')]||_0x3acfd5[_0xaf4b('0x29')],require(_0xaf4b('0x93'))[_0xaf4b('0x94')](0x4),_0x26e848[_0xaf4b('0x8f')]||'csv'),'reportId':_0x3acfd5['id'],'reportType':_0xaf4b('0x95')});return db['AnalyticExtractedReport'][_0xaf4b('0x46')](_0x187eb5,{'raw':!![]});})['then'](function(_0x2879bc){if(_0x3acfd5[_0xaf4b('0x6e')]===_0xaf4b('0x96')){_0x19fce9[_0xaf4b('0x3e')](_0x3acfd5[_0xaf4b('0x6e')]+_0xaf4b('0x97'),_0x26e848[_0xaf4b('0x98')],_0x26e848[_0xaf4b('0x99')]);}else{_0x19fce9[_0xaf4b('0x3e')](_0x3acfd5[_0xaf4b('0x6e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x26e848[_0xaf4b('0x98')],_0x26e848[_0xaf4b('0x99')]);}if(_0x2879bc){logger[_0xaf4b('0x9a')](_0xaf4b('0x9b'),_0x19fce9[_0xaf4b('0x82')]());require(_0xaf4b('0x9c'))[_0xaf4b('0x9d')](path[_0xaf4b('0x52')](__dirname,_0xaf4b('0x9e'),_0x2879bc[_0xaf4b('0x8f')]),[_0x2879bc['id'],_0x19fce9[_0xaf4b('0x82')](),path['join'](__dirname,_0xaf4b('0x9f'),_0x2879bc[_0xaf4b('0xa0')]),_0x484e1f]);return _0x2879bc;}else{var _0x2db0e2=squel[_0xaf4b('0x6c')]();_0x2db0e2[_0xaf4b('0x6d')]('('+_0x19fce9[_0xaf4b('0x82')]()+')',_0xaf4b('0xa1'));_0x2db0e2['field'](_0xaf4b('0xa2'),'count');_0x19fce9[_0xaf4b('0x1e')](_0x26e848[_0xaf4b('0x1e')]||_0x13d6c1);_0x19fce9[_0xaf4b('0x39')](_0x26e848[_0xaf4b('0x39')]||0x0);return dbH['sequelize'][_0xaf4b('0x32')](_0x2db0e2['toString'](),{'type':dbH[_0xaf4b('0x83')][_0xaf4b('0x84')][_0xaf4b('0x85')]})[_0xaf4b('0x24')](function(_0x368490){if(!_0x368490[_0xaf4b('0x36')]){_0x26f070=0x0;}else{_0x26f070=_0x368490[0x0]['count']||0x0;}return dbH[_0xaf4b('0x83')][_0xaf4b('0x32')](_0x19fce9['toString'](),{'type':dbH['sequelize'][_0xaf4b('0x84')][_0xaf4b('0x85')]});})[_0xaf4b('0x24')](function(_0x3ec89a){return{'rows':_0x3ec89a||[],'count':_0x26f070};});}});}exports[_0xaf4b('0xa3')]=function(_0x403848,_0xc8a385){return runReport(_0x403848['params'],_0x403848[_0xaf4b('0x32')],_0x403848[_0xaf4b('0x41')])['then'](respondWithResult(_0xc8a385,null))[_0xaf4b('0x45')](handleError(_0xc8a385,null));};exports[_0xaf4b('0xa4')]=runReport;exports[_0xaf4b('0x32')]=function(_0x363b8e,_0x3a8739){var _0x37ebba=0xa;var _0x3214c4=[_0xaf4b('0x52'),'left_join',_0xaf4b('0x54'),'cross_join'];var _0x3b8fda={'SUM':_0xaf4b('0x56'),'COUNT':_0xaf4b('0x86'),'COUNT DISTINCT':_0xaf4b('0x57'),'MAX':_0xaf4b('0x87'),'MIN':'MIN(%s)','AVG':_0xaf4b('0x58'),'GROUP_CONCAT':_0xaf4b('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xaf4b('0x5b')};var _0x5e67db={'SEC_TO_TIME':_0xaf4b('0x89'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3eacb1=function(_0x288785){return!_['includes'](['IS\x20NULL',_0xaf4b('0x61'),_0xaf4b('0xa5'),_0xaf4b('0x62')],_0x288785);};var _0x3258b0=function(_0x3be63c){if(!_0x3be63c||!_0x3be63c[_0xaf4b('0x63')][_0xaf4b('0x36')]){return'';}for(var _0x446074='(',_0x233581=0x0;_0x233581<_0x3be63c[_0xaf4b('0x63')]['length'];_0x233581+=0x1){_0x233581>0x0&&(_0x446074+='\x20'+_0x3be63c['operator']+'\x20');_0x446074+=_0x3be63c[_0xaf4b('0x63')][_0x233581][_0xaf4b('0x65')]?_0x3258b0(_0x3be63c[_0xaf4b('0x63')][_0x233581]['group']):_0x3be63c[_0xaf4b('0x63')][_0x233581][_0xaf4b('0x66')]+'\x20'+_0x3be63c['rules'][_0x233581]['condition']+(_0x3eacb1(_0x3be63c['rules'][_0x233581][_0xaf4b('0x67')])?'\x20'+_0x3be63c[_0xaf4b('0x63')][_0x233581]['value']:'');}return _0x446074+')';};var _0x1e9ea9={'where':{'id':_0x363b8e[_0xaf4b('0x50')]['id']}},_0x456bf5,_0x1d3489,_0x45e72d,_0x56a520,_0xffcaca;_0x1e9ea9=_[_0xaf4b('0x3f')]({},_0x1e9ea9,_0x363b8e[_0xaf4b('0x41')]);return db['AnalyticCustomReport']['find'](_0x1e9ea9)[_0xaf4b('0x24')](function(_0x3eac34){if(_0x3eac34){_0x456bf5=_0x3eac34;return _0x3eac34['getFields']();}return null;})['then'](function(_0x289a40){if(_0x289a40){if(!_0x289a40[_0xaf4b('0x36')]){throw new db[(_0xaf4b('0x68'))][(_0xaf4b('0x69'))](_0xaf4b('0x8d'),0x193);}_0x1d3489=_0x289a40;return db[_0xaf4b('0x6a')][_0xaf4b('0x8e')]({'raw':!![]});}return null;})['then'](function(_0x17b8c1){if(_0x17b8c1){_0x45e72d=_[_0xaf4b('0x6b')](_0x17b8c1,'id');var _0x37ccc6;var _0xac6ffb=squel[_0xaf4b('0x6c')]();_0xac6ffb['from'](_0x456bf5['table']);for(var _0x29ec58=0x0;_0x29ec58<_0x1d3489[_0xaf4b('0x36')];_0x29ec58+=0x1){_0x37ccc6=_0x1d3489[_0x29ec58][_0xaf4b('0x6f')]?_0x45e72d[_0x1d3489[_0x29ec58][_0xaf4b('0x6f')]][_0xaf4b('0x70')]:_0x1d3489[_0x29ec58][_0xaf4b('0x66')];_0x37ccc6=_0x1d3489[_0x29ec58]['function']?_[_0xaf4b('0x72')](_0x3b8fda[_0x1d3489[_0x29ec58]['function']],'%s',_0x37ccc6):_0x37ccc6;_0x37ccc6=_0x1d3489[_0x29ec58]['format']?_['replace'](_0x5e67db[_0x1d3489[_0x29ec58]['format']],'%s',_0x37ccc6):_0x37ccc6;if(_0x1d3489[_0x29ec58][_0xaf4b('0x74')]){_0xac6ffb['group'](_0x37ccc6);}_0x1d3489[_0x29ec58]['orderBy']&&_0xac6ffb[_0xaf4b('0x3a')](_0x37ccc6,_0x1d3489[_0x29ec58]['orderBy']===_0xaf4b('0x76')?![]:!![]);_0xac6ffb['field'](_0x37ccc6,_0x1d3489[_0x29ec58][_0xaf4b('0x77')]||_0x37ccc6);}if(_0x456bf5['joins']){_0x456bf5[_0xaf4b('0x78')]=JSON['parse'](_0x456bf5[_0xaf4b('0x78')]);for(var _0x51b756=0x0;_0x51b756<_0x456bf5[_0xaf4b('0x78')][_0xaf4b('0x36')];_0x51b756+=0x1){if(_0x456bf5[_0xaf4b('0x78')][_0x51b756]['type']&&_['includes'](_0x3214c4,_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x2e')])&&_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7a')]&&_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7b')]&&_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7c')]){_0xac6ffb[_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x2e')]](_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7b')],null,util['format'](_0xaf4b('0x7d'),_0x456bf5[_0xaf4b('0x6e')],_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7a')],_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7b')],_0x456bf5['joins'][_0x51b756][_0xaf4b('0x7c')]));}}}if(_0x456bf5[_0xaf4b('0x7e')]){_0x456bf5['conditions']=JSON['parse'](_0x456bf5[_0xaf4b('0x7e')]);_0xac6ffb[_0xaf4b('0x3e')](_0x3258b0(_0x456bf5[_0xaf4b('0x7e')]['group']));}_0xffcaca=_0xac6ffb[_0xaf4b('0x7f')]();_0xac6ffb['limit'](_0x37ebba);_0xac6ffb['offset'](0x0);logger[_0xaf4b('0x80')](_0xaf4b('0x81'),_0xac6ffb[_0xaf4b('0x82')]());return dbH[_0xaf4b('0x83')][_0xaf4b('0x32')](_0xac6ffb['toString'](),{'type':dbH[_0xaf4b('0x83')][_0xaf4b('0x84')][_0xaf4b('0x85')]});}})[_0xaf4b('0x24')](function(){return{'sql':_0xffcaca[_0xaf4b('0x82')]()};})[_0xaf4b('0x24')](respondWithResult(_0x3a8739,null))[_0xaf4b('0x45')](handleError(_0x3a8739,null));}; \ No newline at end of file +var _0xf6f7=['.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','savename','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','parentKey','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','keyBy','select','table','MetricId','metric','replace','function','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','COUNT(DISTINCT\x20%s)','DATE(%s)','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','DESC','web','fullPath','%s-%s.%s','randomstring','generate','output','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf6f7,0xae));var _0x7f6f=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xf6f7[_0x609988];return _0x159984;};'use strict';var emlformat=require(_0x7f6f('0x0'));var rimraf=require(_0x7f6f('0x1'));var zipdir=require(_0x7f6f('0x2'));var jsonpatch=require(_0x7f6f('0x3'));var rp=require(_0x7f6f('0x4'));var moment=require(_0x7f6f('0x5'));var BPromise=require(_0x7f6f('0x6'));var Mustache=require(_0x7f6f('0x7'));var util=require(_0x7f6f('0x8'));var path=require('path');var sox=require(_0x7f6f('0x9'));var csv=require(_0x7f6f('0xa'));var ejs=require(_0x7f6f('0xb'));var fs=require('fs');var fs_extra=require(_0x7f6f('0xc'));var _=require(_0x7f6f('0xd'));var squel=require('squel');var crypto=require(_0x7f6f('0xe'));var jsforce=require(_0x7f6f('0xf'));var deskjs=require(_0x7f6f('0x10'));var toCsv=require(_0x7f6f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7f6f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f6f('0x12'));var as=require(_0x7f6f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7f6f('0x14'));var utils=require(_0x7f6f('0x15'));var config=require(_0x7f6f('0x16'));var licenseUtil=require(_0x7f6f('0x17'));var db=require(_0x7f6f('0x18'))['db'];var dbH=require(_0x7f6f('0x18'))[_0x7f6f('0x19')];function respondWithStatusCode(_0x521d0a,_0x37418f){_0x37418f=_0x37418f||0xcc;return function(_0x40632b){if(_0x40632b){return _0x521d0a[_0x7f6f('0x1a')](_0x37418f);}return _0x521d0a[_0x7f6f('0x1b')](_0x37418f)[_0x7f6f('0x1c')]();};}function respondWithResult(_0x678041,_0x4f6d27){_0x4f6d27=_0x4f6d27||0xc8;return function(_0x1b9689){if(_0x1b9689){return _0x678041[_0x7f6f('0x1b')](_0x4f6d27)[_0x7f6f('0x1d')](_0x1b9689);}};}function respondWithFilteredResult(_0x55dace,_0x2f39e3){return function(_0x1b7288){if(_0x1b7288){var _0xe86614=typeof _0x2f39e3[_0x7f6f('0x1e')]===_0x7f6f('0x1f')&&typeof _0x2f39e3[_0x7f6f('0x20')]===_0x7f6f('0x1f');var _0xffac6=_0x1b7288['count'];var _0x5eccb0=_0xe86614?0x0:_0x2f39e3[_0x7f6f('0x1e')];var _0x869c64=_0xe86614?_0x1b7288[_0x7f6f('0x21')]:_0x2f39e3[_0x7f6f('0x1e')]+_0x2f39e3[_0x7f6f('0x20')];var _0x5ed0eb;if(_0x869c64>=_0xffac6){_0x869c64=_0xffac6;_0x5ed0eb=0xc8;}else{_0x5ed0eb=0xce;}_0x55dace['status'](_0x5ed0eb);return _0x55dace['set'](_0x7f6f('0x22'),_0x5eccb0+'-'+_0x869c64+'/'+_0xffac6)[_0x7f6f('0x1d')](_0x1b7288);}return null;};}function patchUpdates(_0x228d0d){return function(_0x3d77e5){try{jsonpatch[_0x7f6f('0x23')](_0x3d77e5,_0x228d0d,!![]);}catch(_0x2539b7){return BPromise[_0x7f6f('0x24')](_0x2539b7);}return _0x3d77e5[_0x7f6f('0x25')]();};}function saveUpdates(_0x21288d,_0x62489){return function(_0x40cff1){if(_0x40cff1){return _0x40cff1[_0x7f6f('0x26')](_0x21288d)[_0x7f6f('0x27')](function(_0x54c0cc){return _0x54c0cc;});}return null;};}function removeEntity(_0x36d313,_0x3bb4f6){return function(_0x55b086){if(_0x55b086){return _0x55b086['destroy']()[_0x7f6f('0x27')](function(){var _0x42a197=_0x55b086[_0x7f6f('0x28')]({'plain':!![]});var _0x367ad9='CustomReports';return db[_0x7f6f('0x29')]['destroy']({'where':{'type':_0x367ad9,'resourceId':_0x42a197['id']}})['then'](function(){return _0x55b086;});})[_0x7f6f('0x27')](function(){_0x36d313[_0x7f6f('0x1b')](0xcc)[_0x7f6f('0x1c')]();});}};}function handleEntityNotFound(_0x1765c0,_0x45fa04){return function(_0x1f6742){if(!_0x1f6742){_0x1765c0['sendStatus'](0x194);}return _0x1f6742;};}function handleError(_0x509c64,_0x2d2b12){_0x2d2b12=_0x2d2b12||0x1f4;return function(_0x5266ad){logger[_0x7f6f('0x2a')](_0x5266ad['stack']);if(_0x5266ad[_0x7f6f('0x2b')]){delete _0x5266ad[_0x7f6f('0x2b')];}_0x509c64[_0x7f6f('0x1b')](_0x2d2b12)[_0x7f6f('0x2c')](_0x5266ad);};}exports[_0x7f6f('0x2d')]=function(_0x3dca6a,_0x1c1fa1){var _0x3cd7b1={},_0x2aad16={},_0x1aadc1={'count':0x0,'rows':[]};var _0x228d0c=_[_0x7f6f('0x2e')](db['AnalyticCustomReport'][_0x7f6f('0x2f')],function(_0x3eed09){return{'name':_0x3eed09[_0x7f6f('0x30')],'type':_0x3eed09[_0x7f6f('0x31')]['key']};});_0x2aad16[_0x7f6f('0x32')]=_[_0x7f6f('0x2e')](_0x228d0c,_0x7f6f('0x2b'));_0x2aad16[_0x7f6f('0x33')]=_[_0x7f6f('0x34')](_0x3dca6a[_0x7f6f('0x33')]);_0x2aad16[_0x7f6f('0x35')]=_[_0x7f6f('0x36')](_0x2aad16[_0x7f6f('0x32')],_0x2aad16['query']);_0x3cd7b1[_0x7f6f('0x37')]=_[_0x7f6f('0x36')](_0x2aad16[_0x7f6f('0x32')],qs[_0x7f6f('0x38')](_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x38')]));_0x3cd7b1['attributes']=_0x3cd7b1[_0x7f6f('0x37')][_0x7f6f('0x39')]?_0x3cd7b1['attributes']:_0x2aad16['model'];if(!_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x3a')](_0x7f6f('0x3b'))){_0x3cd7b1[_0x7f6f('0x20')]=qs['limit'](_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x20')]);_0x3cd7b1[_0x7f6f('0x1e')]=qs[_0x7f6f('0x1e')](_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x1e')]);}_0x3cd7b1[_0x7f6f('0x3c')]=qs[_0x7f6f('0x3d')](_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x3d')]);_0x3cd7b1[_0x7f6f('0x3e')]=qs[_0x7f6f('0x35')](_['pick'](_0x3dca6a['query'],_0x2aad16['filters']),_0x228d0c);if(_0x3dca6a[_0x7f6f('0x33')]['filter']){_0x3cd7b1['where']=_[_0x7f6f('0x3f')](_0x3cd7b1[_0x7f6f('0x3e')],{'$or':_['map'](_0x228d0c,function(_0x413423){if(_0x413423[_0x7f6f('0x31')]!=='VIRTUAL'){var _0x2375ba={};_0x2375ba[_0x413423[_0x7f6f('0x2b')]]={'$like':'%'+_0x3dca6a[_0x7f6f('0x33')]['filter']+'%'};return _0x2375ba;}})});}_0x3cd7b1=_[_0x7f6f('0x3f')]({},_0x3cd7b1,_0x3dca6a['options']);var _0x2c893a={'where':_0x3cd7b1[_0x7f6f('0x3e')]};return db[_0x7f6f('0x40')][_0x7f6f('0x21')](_0x2c893a)['then'](function(_0x12a501){_0x1aadc1[_0x7f6f('0x21')]=_0x12a501;if(_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x41')]){_0x3cd7b1[_0x7f6f('0x42')]=[{'all':!![]}];}return db[_0x7f6f('0x40')][_0x7f6f('0x43')](_0x3cd7b1);})['then'](function(_0x509697){_0x1aadc1['rows']=_0x509697;return _0x1aadc1;})[_0x7f6f('0x27')](respondWithFilteredResult(_0x1c1fa1,_0x3cd7b1))[_0x7f6f('0x44')](handleError(_0x1c1fa1,null));};exports[_0x7f6f('0x45')]=function(_0x11ea83,_0x2edde2){var _0x16188d={'raw':![],'where':{'id':_0x11ea83[_0x7f6f('0x46')]['id']}},_0x5b6277={};_0x5b6277['model']=_[_0x7f6f('0x34')](db['AnalyticCustomReport'][_0x7f6f('0x2f')]);_0x5b6277['query']=_[_0x7f6f('0x34')](_0x11ea83['query']);_0x5b6277[_0x7f6f('0x35')]=_[_0x7f6f('0x36')](_0x5b6277[_0x7f6f('0x32')],_0x5b6277['query']);_0x16188d[_0x7f6f('0x37')]=_[_0x7f6f('0x36')](_0x5b6277[_0x7f6f('0x32')],qs[_0x7f6f('0x38')](_0x11ea83[_0x7f6f('0x33')][_0x7f6f('0x38')]));_0x16188d[_0x7f6f('0x37')]=_0x16188d[_0x7f6f('0x37')][_0x7f6f('0x39')]?_0x16188d[_0x7f6f('0x37')]:_0x5b6277[_0x7f6f('0x32')];if(_0x11ea83['query'][_0x7f6f('0x41')]){_0x16188d[_0x7f6f('0x42')]=[{'all':!![]}];}_0x16188d=_[_0x7f6f('0x3f')]({},_0x16188d,_0x11ea83[_0x7f6f('0x47')]);return db[_0x7f6f('0x40')][_0x7f6f('0x48')](_0x16188d)['then'](handleEntityNotFound(_0x2edde2,null))[_0x7f6f('0x27')](respondWithResult(_0x2edde2,null))[_0x7f6f('0x44')](handleError(_0x2edde2,null));};exports[_0x7f6f('0x49')]=function(_0x278ac0,_0x1b84b6){return db[_0x7f6f('0x40')][_0x7f6f('0x49')](_0x278ac0[_0x7f6f('0x4a')],{})[_0x7f6f('0x27')](function(_0x22bd30){var _0x4c5f99=_0x278ac0[_0x7f6f('0x4b')][_0x7f6f('0x28')]({'plain':!![]});if(!_0x4c5f99)throw new Error(_0x7f6f('0x4c'));if(_0x4c5f99[_0x7f6f('0x4d')]===_0x7f6f('0x4b')){var _0x361c27=_0x22bd30[_0x7f6f('0x28')]({'plain':!![]});var _0x33ce9c='Reports';return db[_0x7f6f('0x4e')][_0x7f6f('0x48')]({'where':{'name':_0x33ce9c,'userProfileId':_0x4c5f99[_0x7f6f('0x4f')]},'raw':!![]})[_0x7f6f('0x27')](function(_0x1d1d85){if(_0x1d1d85&&_0x1d1d85['autoAssociation']===0x0){return db[_0x7f6f('0x29')][_0x7f6f('0x49')]({'name':_0x361c27[_0x7f6f('0x2b')],'resourceId':_0x361c27['id'],'type':_0x7f6f('0x50'),'sectionId':_0x1d1d85['id']},{})[_0x7f6f('0x27')](function(){return _0x22bd30;});}else{return _0x22bd30;}})['catch'](function(_0x2a1608){logger[_0x7f6f('0x2a')](_0x7f6f('0x51'),_0x2a1608);throw _0x2a1608;});}return _0x22bd30;})[_0x7f6f('0x27')](respondWithResult(_0x1b84b6,0xc9))[_0x7f6f('0x44')](handleError(_0x1b84b6,null));};exports[_0x7f6f('0x26')]=function(_0x48ab1c,_0x365738){if(_0x48ab1c[_0x7f6f('0x4a')]['id']){delete _0x48ab1c[_0x7f6f('0x4a')]['id'];}return db[_0x7f6f('0x40')][_0x7f6f('0x48')]({'where':{'id':_0x48ab1c['params']['id']}})[_0x7f6f('0x27')](handleEntityNotFound(_0x365738,null))[_0x7f6f('0x27')](saveUpdates(_0x48ab1c[_0x7f6f('0x4a')],null))[_0x7f6f('0x27')](respondWithResult(_0x365738,null))[_0x7f6f('0x44')](handleError(_0x365738,null));};exports[_0x7f6f('0x52')]=function(_0x102a3f,_0x254172){return db[_0x7f6f('0x40')]['find']({'where':{'id':_0x102a3f[_0x7f6f('0x46')]['id']}})[_0x7f6f('0x27')](handleEntityNotFound(_0x254172,null))[_0x7f6f('0x27')](removeEntity(_0x254172,null))[_0x7f6f('0x44')](handleError(_0x254172,null));};exports[_0x7f6f('0x53')]=function(_0x9d84af,_0x169b63){var _0x19dd85=0xa;var _0x3d57ff=['join',_0x7f6f('0x54'),_0x7f6f('0x55'),_0x7f6f('0x56')];var _0x247041={'SUM':_0x7f6f('0x57'),'COUNT':_0x7f6f('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7f6f('0x59'),'MIN':_0x7f6f('0x5a'),'AVG':_0x7f6f('0x5b'),'GROUP_CONCAT':_0x7f6f('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7f6f('0x5d')};var _0x486337={'SEC_TO_TIME':_0x7f6f('0x5e'),'DATE':'DATE(%s)','HOUR':_0x7f6f('0x5f'),'ROUND':_0x7f6f('0x60'),'UNIX_TIMESTAMP':_0x7f6f('0x61')};var _0x1c86c6=function(_0x40fc87){return!_[_0x7f6f('0x62')]([_0x7f6f('0x63'),_0x7f6f('0x64'),_0x7f6f('0x65'),_0x7f6f('0x66')],_0x40fc87);};var _0x3950b4=function(_0x2a2cf2){if(!_0x2a2cf2||!_0x2a2cf2[_0x7f6f('0x67')]['length']){return'';}for(var _0x5ecf81='(',_0x5cde77=0x0;_0x5cde77<_0x2a2cf2[_0x7f6f('0x67')][_0x7f6f('0x39')];_0x5cde77+=0x1){_0x5cde77>0x0&&(_0x5ecf81+='\x20'+_0x2a2cf2[_0x7f6f('0x68')]+'\x20');_0x5ecf81+=_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x69')]?_0x3950b4(_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x69')]):_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x6a')]+'\x20'+_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x6b')]+(_0x1c86c6(_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x6b')])?'\x20'+_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x6c')]:'');}return _0x5ecf81+')';};var _0x184586={'where':{'id':_0x9d84af['params']['id']}},_0x4ab892,_0x26d7cb,_0x52d2ae,_0xe1a97f,_0x4150a9;_0x184586=_[_0x7f6f('0x3f')]({},_0x184586,_0x9d84af[_0x7f6f('0x47')]);return db['AnalyticCustomReport']['find'](_0x184586)[_0x7f6f('0x27')](function(_0x35cb3a){if(_0x35cb3a){_0x4ab892=_0x35cb3a;return _0x35cb3a[_0x7f6f('0x6d')]();}return null;})['then'](function(_0x449dd7){if(_0x449dd7){if(!_0x449dd7[_0x7f6f('0x39')]){throw new db[(_0x7f6f('0x6e'))][(_0x7f6f('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x26d7cb=_0x449dd7;return db['AnalyticMetric'][_0x7f6f('0x43')]({'raw':!![]});}return null;})[_0x7f6f('0x27')](function(_0x4ab987){if(_0x4ab987){_0x52d2ae=_[_0x7f6f('0x70')](_0x4ab987,'id');var _0x23d145;var _0x3f7ad5=squel[_0x7f6f('0x71')]();_0x3f7ad5['from'](_0x4ab892[_0x7f6f('0x72')]);for(var _0x2275fe=0x0;_0x2275fe<_0x26d7cb[_0x7f6f('0x39')];_0x2275fe+=0x1){_0x23d145=_0x26d7cb[_0x2275fe]['MetricId']?_0x52d2ae[_0x26d7cb[_0x2275fe][_0x7f6f('0x73')]][_0x7f6f('0x74')]:_0x26d7cb[_0x2275fe][_0x7f6f('0x6a')];_0x23d145=_0x26d7cb[_0x2275fe]['function']?_[_0x7f6f('0x75')](_0x247041[_0x26d7cb[_0x2275fe][_0x7f6f('0x76')]],'%s',_0x23d145):_0x23d145;_0x23d145=_0x26d7cb[_0x2275fe][_0x7f6f('0x77')]?_[_0x7f6f('0x75')](_0x486337[_0x26d7cb[_0x2275fe]['format']],'%s',_0x23d145):_0x23d145;if(_0x26d7cb[_0x2275fe][_0x7f6f('0x78')]){_0x3f7ad5[_0x7f6f('0x69')](_0x23d145);}_0x26d7cb[_0x2275fe][_0x7f6f('0x79')]&&_0x3f7ad5[_0x7f6f('0x3c')](_0x23d145,_0x26d7cb[_0x2275fe]['orderBy']==='DESC'?![]:!![]);_0x3f7ad5[_0x7f6f('0x6a')](_0x23d145,_0x26d7cb[_0x2275fe][_0x7f6f('0x7a')]||_0x23d145);}if(_0x4ab892[_0x7f6f('0x7b')]){_0x4ab892[_0x7f6f('0x7b')]=JSON[_0x7f6f('0x7c')](_0x4ab892['joins']);for(var _0x1f2ab8=0x0;_0x1f2ab8<_0x4ab892[_0x7f6f('0x7b')][_0x7f6f('0x39')];_0x1f2ab8+=0x1){if(_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x31')]&&_[_0x7f6f('0x62')](_0x3d57ff,_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x31')])&&_0x4ab892['joins'][_0x1f2ab8]['parentKey']&&_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x7d')]&&_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x7e')]){_0x3f7ad5[_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x31')]](_0x4ab892['joins'][_0x1f2ab8][_0x7f6f('0x7d')],null,util['format'](_0x7f6f('0x7f'),_0x4ab892[_0x7f6f('0x72')],_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8]['parentKey'],_0x4ab892['joins'][_0x1f2ab8][_0x7f6f('0x7d')],_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x7e')]));}}}if(_0x4ab892[_0x7f6f('0x80')]){_0x4ab892['conditions']=JSON[_0x7f6f('0x7c')](_0x4ab892[_0x7f6f('0x80')]);_0x3f7ad5[_0x7f6f('0x3e')](_0x3950b4(_0x4ab892[_0x7f6f('0x80')][_0x7f6f('0x69')]));}_0x4150a9=_0x3f7ad5[_0x7f6f('0x81')]();_0x3f7ad5['limit'](_0x19dd85);_0x3f7ad5[_0x7f6f('0x1e')](0x0);logger['debug'](_0x7f6f('0x82'),_0x3f7ad5[_0x7f6f('0x83')]());return dbH[_0x7f6f('0x84')][_0x7f6f('0x33')](_0x3f7ad5[_0x7f6f('0x83')](),{'type':dbH[_0x7f6f('0x84')][_0x7f6f('0x85')][_0x7f6f('0x86')]});}})[_0x7f6f('0x27')](respondWithResult(_0x169b63,null))['catch'](handleError(_0x169b63,null));};function runReport(_0x421aa4,_0xf6b58f,_0xa4cee6){var _0x1e5fa0=_0xf6b58f[_0x7f6f('0x2b')];var _0x550308=0xa;var _0x3cf99e=[_0x7f6f('0x87'),_0x7f6f('0x54'),_0x7f6f('0x55'),'cross_join'];var _0x2b2826={'SUM':_0x7f6f('0x57'),'COUNT':_0x7f6f('0x58'),'COUNT DISTINCT':_0x7f6f('0x88'),'MAX':'MAX(%s)','MIN':_0x7f6f('0x5a'),'AVG':_0x7f6f('0x5b'),'GROUP_CONCAT':_0x7f6f('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7f6f('0x5d')};var _0x15c2e2={'SEC_TO_TIME':_0x7f6f('0x5e'),'DATE':_0x7f6f('0x89'),'HOUR':_0x7f6f('0x5f'),'ROUND':_0x7f6f('0x60'),'UNIX_TIMESTAMP':_0x7f6f('0x61')};var _0x672dd0=function(_0x228948){return!_[_0x7f6f('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7f6f('0x65'),_0x7f6f('0x66')],_0x228948);};var _0x241f22=function(_0x539cbe){if(!_0x539cbe||!_0x539cbe[_0x7f6f('0x67')][_0x7f6f('0x39')]){return'';}for(var _0x3c7496='(',_0x46f159=0x0;_0x46f159<_0x539cbe[_0x7f6f('0x67')][_0x7f6f('0x39')];_0x46f159+=0x1){_0x46f159>0x0&&(_0x3c7496+='\x20'+_0x539cbe[_0x7f6f('0x68')]+'\x20');_0x3c7496+=_0x539cbe[_0x7f6f('0x67')][_0x46f159]['group']?_0x241f22(_0x539cbe[_0x7f6f('0x67')][_0x46f159][_0x7f6f('0x69')]):_0x539cbe[_0x7f6f('0x67')][_0x46f159]['field']+'\x20'+_0x539cbe[_0x7f6f('0x67')][_0x46f159]['condition']+(_0x672dd0(_0x539cbe['rules'][_0x46f159][_0x7f6f('0x6b')])?'\x20'+_0x539cbe['rules'][_0x46f159][_0x7f6f('0x6c')]:'');}return _0x3c7496+')';};var _0xe72352={'where':{'id':_0x421aa4['id']}},_0xacf636,_0x59f9ed,_0x1f82be,_0xaaa7fb,_0x18d06d;_0xe72352=_['merge']({},_0xe72352,_0xa4cee6);return db[_0x7f6f('0x40')][_0x7f6f('0x48')](_0xe72352)[_0x7f6f('0x27')](function(_0x549713){if(_0x549713){_0xacf636=_0x549713;return _0x549713[_0x7f6f('0x6d')]();}return null;})[_0x7f6f('0x27')](function(_0x1bb457){if(_0x1bb457){if(!_0x1bb457[_0x7f6f('0x39')]){throw new db[(_0x7f6f('0x6e'))][(_0x7f6f('0x6f'))](_0x7f6f('0x8a'),0x193);}_0x59f9ed=_0x1bb457;return db[_0x7f6f('0x8b')][_0x7f6f('0x43')]({'raw':!![]});}return null;})['then'](function(_0x44dcb9){if(_0x44dcb9){_0x1f82be=_[_0x7f6f('0x70')](_0x44dcb9,'id');var _0x4db479;var _0x58bf38=squel[_0x7f6f('0x71')]();_0x58bf38[_0x7f6f('0x8c')](_0xacf636[_0x7f6f('0x72')]);for(var _0x553b6d=0x0;_0x553b6d<_0x59f9ed[_0x7f6f('0x39')];_0x553b6d+=0x1){_0x4db479=_0x59f9ed[_0x553b6d][_0x7f6f('0x73')]?_0x1f82be[_0x59f9ed[_0x553b6d][_0x7f6f('0x73')]][_0x7f6f('0x74')]:_0x59f9ed[_0x553b6d][_0x7f6f('0x6a')];_0x4db479=_0x59f9ed[_0x553b6d][_0x7f6f('0x76')]?_[_0x7f6f('0x75')](_0x2b2826[_0x59f9ed[_0x553b6d][_0x7f6f('0x76')]],'%s',_0x4db479):_0x4db479;_0x4db479=_0x59f9ed[_0x553b6d][_0x7f6f('0x77')]?_[_0x7f6f('0x75')](_0x15c2e2[_0x59f9ed[_0x553b6d][_0x7f6f('0x77')]],'%s',_0x4db479):_0x4db479;if(_0x59f9ed[_0x553b6d][_0x7f6f('0x78')]){_0x58bf38[_0x7f6f('0x69')](_0x4db479);}_0x59f9ed[_0x553b6d]['orderBy']&&_0x58bf38[_0x7f6f('0x3c')](_0x4db479,_0x59f9ed[_0x553b6d][_0x7f6f('0x79')]===_0x7f6f('0x8d')?![]:!![]);_0x58bf38[_0x7f6f('0x6a')](_0x4db479,_0x59f9ed[_0x553b6d]['alias']||_0x4db479);}if(_0xacf636[_0x7f6f('0x7b')]){_0xacf636[_0x7f6f('0x7b')]=JSON['parse'](_0xacf636[_0x7f6f('0x7b')]);for(var _0x226a18=0x0;_0x226a18<_0xacf636[_0x7f6f('0x7b')][_0x7f6f('0x39')];_0x226a18+=0x1){if(_0xacf636[_0x7f6f('0x7b')][_0x226a18][_0x7f6f('0x31')]&&_[_0x7f6f('0x62')](_0x3cf99e,_0xacf636[_0x7f6f('0x7b')][_0x226a18]['type'])&&_0xacf636['joins'][_0x226a18]['parentKey']&&_0xacf636[_0x7f6f('0x7b')][_0x226a18]['foreignTable']&&_0xacf636[_0x7f6f('0x7b')][_0x226a18][_0x7f6f('0x7e')]){_0x58bf38[_0xacf636[_0x7f6f('0x7b')][_0x226a18][_0x7f6f('0x31')]](_0xacf636[_0x7f6f('0x7b')][_0x226a18][_0x7f6f('0x7d')],null,util['format'](_0x7f6f('0x7f'),_0xacf636[_0x7f6f('0x72')],_0xacf636['joins'][_0x226a18]['parentKey'],_0xacf636[_0x7f6f('0x7b')][_0x226a18]['foreignTable'],_0xacf636[_0x7f6f('0x7b')][_0x226a18][_0x7f6f('0x7e')]));}}}if(_0xacf636[_0x7f6f('0x80')]){_0xacf636[_0x7f6f('0x80')]=JSON['parse'](_0xacf636[_0x7f6f('0x80')]);_0x58bf38['where'](_0x241f22(_0xacf636[_0x7f6f('0x80')]['group']));}_0x18d06d=_0x58bf38[_0x7f6f('0x81')]();_0x58bf38[_0x7f6f('0x20')](_0x550308);_0x58bf38['offset'](0x0);return;}})[_0x7f6f('0x27')](function(){if(_0xf6b58f['output']===_0x7f6f('0x8e')){return null;}var _0x304650=_[_0x7f6f('0x3f')](_0xf6b58f,{'name':_0xf6b58f[_0x7f6f('0x8f')]||_0xf6b58f[_0x7f6f('0x2b')]||_0xacf636[_0x7f6f('0x2b')],'basename':_0x1e5fa0,'savename':util[_0x7f6f('0x77')](_0x7f6f('0x90'),_0xf6b58f[_0x7f6f('0x2b')]||_0xacf636[_0x7f6f('0x2b')],require(_0x7f6f('0x91'))[_0x7f6f('0x92')](0x4),_0xf6b58f[_0x7f6f('0x93')]||'csv'),'reportId':_0xacf636['id'],'reportType':'custom'});return db[_0x7f6f('0x94')][_0x7f6f('0x49')](_0x304650,{'raw':!![]});})[_0x7f6f('0x27')](function(_0x4512bc){if(_0xacf636[_0x7f6f('0x72')]===_0x7f6f('0x95')){_0x18d06d['where'](_0xacf636[_0x7f6f('0x72')]+_0x7f6f('0x96'),_0xf6b58f[_0x7f6f('0x97')],_0xf6b58f['endDate']);}else{_0x18d06d[_0x7f6f('0x3e')](_0xacf636[_0x7f6f('0x72')]+_0x7f6f('0x98'),_0xf6b58f['startDate'],_0xf6b58f['endDate']);}if(_0x4512bc){logger[_0x7f6f('0x99')](_0x7f6f('0x9a'),_0x18d06d['toString']());require('child_process')['fork'](path[_0x7f6f('0x87')](__dirname,_0x7f6f('0x9b'),_0x4512bc[_0x7f6f('0x93')]),[_0x4512bc['id'],_0x18d06d[_0x7f6f('0x83')](),path[_0x7f6f('0x87')](__dirname,_0x7f6f('0x9c'),_0x4512bc[_0x7f6f('0x9d')]),_0x1e5fa0]);return _0x4512bc;}else{var _0x352629=squel['select']();_0x352629[_0x7f6f('0x8c')]('('+_0x18d06d[_0x7f6f('0x83')]()+')','countTable');_0x352629[_0x7f6f('0x6a')]('COUNT(*)',_0x7f6f('0x21'));_0x18d06d['limit'](_0xf6b58f[_0x7f6f('0x20')]||_0x550308);_0x18d06d[_0x7f6f('0x1e')](_0xf6b58f[_0x7f6f('0x1e')]||0x0);return dbH['sequelize']['query'](_0x352629[_0x7f6f('0x83')](),{'type':dbH[_0x7f6f('0x84')]['QueryTypes'][_0x7f6f('0x86')]})[_0x7f6f('0x27')](function(_0x1b4a38){if(!_0x1b4a38[_0x7f6f('0x39')]){_0xaaa7fb=0x0;}else{_0xaaa7fb=_0x1b4a38[0x0][_0x7f6f('0x21')]||0x0;}return dbH[_0x7f6f('0x84')][_0x7f6f('0x33')](_0x18d06d[_0x7f6f('0x83')](),{'type':dbH[_0x7f6f('0x84')]['QueryTypes'][_0x7f6f('0x86')]});})['then'](function(_0x42fdf1){return{'rows':_0x42fdf1||[],'count':_0xaaa7fb};});}});}exports[_0x7f6f('0x9e')]=function(_0x358fa1,_0x421b3e){return runReport(_0x358fa1[_0x7f6f('0x46')],_0x358fa1[_0x7f6f('0x33')],_0x358fa1[_0x7f6f('0x47')])[_0x7f6f('0x27')](respondWithResult(_0x421b3e,null))[_0x7f6f('0x44')](handleError(_0x421b3e,null));};exports[_0x7f6f('0x9f')]=runReport;exports[_0x7f6f('0x33')]=function(_0x461c82,_0x1fe774){var _0x519ee2=0xa;var _0x3b7b41=[_0x7f6f('0x87'),_0x7f6f('0x54'),_0x7f6f('0x55'),_0x7f6f('0x56')];var _0x250345={'SUM':'SUM(%s)','COUNT':_0x7f6f('0x58'),'COUNT DISTINCT':_0x7f6f('0x88'),'MAX':_0x7f6f('0x59'),'MIN':'MIN(%s)','AVG':_0x7f6f('0x5b'),'GROUP_CONCAT':_0x7f6f('0x5c'),'GROUP_CONCAT ASC':_0x7f6f('0xa0'),'GROUP_CONCAT DESC':_0x7f6f('0x5d')};var _0x20ee3b={'SEC_TO_TIME':_0x7f6f('0x5e'),'DATE':_0x7f6f('0x89'),'HOUR':_0x7f6f('0x5f'),'ROUND':_0x7f6f('0x60'),'UNIX_TIMESTAMP':_0x7f6f('0x61')};var _0x274e95=function(_0x132984){return!_[_0x7f6f('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7f6f('0x65'),'IS\x20NOT\x20EMPTY'],_0x132984);};var _0x2c320d=function(_0x3b47be){if(!_0x3b47be||!_0x3b47be[_0x7f6f('0x67')][_0x7f6f('0x39')]){return'';}for(var _0x209335='(',_0x204178=0x0;_0x204178<_0x3b47be[_0x7f6f('0x67')][_0x7f6f('0x39')];_0x204178+=0x1){_0x204178>0x0&&(_0x209335+='\x20'+_0x3b47be[_0x7f6f('0x68')]+'\x20');_0x209335+=_0x3b47be['rules'][_0x204178][_0x7f6f('0x69')]?_0x2c320d(_0x3b47be[_0x7f6f('0x67')][_0x204178][_0x7f6f('0x69')]):_0x3b47be[_0x7f6f('0x67')][_0x204178][_0x7f6f('0x6a')]+'\x20'+_0x3b47be[_0x7f6f('0x67')][_0x204178]['condition']+(_0x274e95(_0x3b47be['rules'][_0x204178]['condition'])?'\x20'+_0x3b47be[_0x7f6f('0x67')][_0x204178]['value']:'');}return _0x209335+')';};var _0x565641={'where':{'id':_0x461c82['params']['id']}},_0x5a5073,_0x56674f,_0x2f8df6,_0x4acbb9,_0x39fcef;_0x565641=_[_0x7f6f('0x3f')]({},_0x565641,_0x461c82['options']);return db[_0x7f6f('0x40')][_0x7f6f('0x48')](_0x565641)['then'](function(_0x239aa1){if(_0x239aa1){_0x5a5073=_0x239aa1;return _0x239aa1['getFields']();}return null;})[_0x7f6f('0x27')](function(_0x4f0469){if(_0x4f0469){if(!_0x4f0469[_0x7f6f('0x39')]){throw new db[(_0x7f6f('0x6e'))][(_0x7f6f('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56674f=_0x4f0469;return db[_0x7f6f('0x8b')][_0x7f6f('0x43')]({'raw':!![]});}return null;})['then'](function(_0x2bf1a5){if(_0x2bf1a5){_0x2f8df6=_[_0x7f6f('0x70')](_0x2bf1a5,'id');var _0x56ef1d;var _0x24c389=squel[_0x7f6f('0x71')]();_0x24c389['from'](_0x5a5073[_0x7f6f('0x72')]);for(var _0x2abffd=0x0;_0x2abffd<_0x56674f['length'];_0x2abffd+=0x1){_0x56ef1d=_0x56674f[_0x2abffd][_0x7f6f('0x73')]?_0x2f8df6[_0x56674f[_0x2abffd][_0x7f6f('0x73')]][_0x7f6f('0x74')]:_0x56674f[_0x2abffd][_0x7f6f('0x6a')];_0x56ef1d=_0x56674f[_0x2abffd][_0x7f6f('0x76')]?_[_0x7f6f('0x75')](_0x250345[_0x56674f[_0x2abffd][_0x7f6f('0x76')]],'%s',_0x56ef1d):_0x56ef1d;_0x56ef1d=_0x56674f[_0x2abffd][_0x7f6f('0x77')]?_['replace'](_0x20ee3b[_0x56674f[_0x2abffd][_0x7f6f('0x77')]],'%s',_0x56ef1d):_0x56ef1d;if(_0x56674f[_0x2abffd][_0x7f6f('0x78')]){_0x24c389[_0x7f6f('0x69')](_0x56ef1d);}_0x56674f[_0x2abffd]['orderBy']&&_0x24c389[_0x7f6f('0x3c')](_0x56ef1d,_0x56674f[_0x2abffd][_0x7f6f('0x79')]===_0x7f6f('0x8d')?![]:!![]);_0x24c389[_0x7f6f('0x6a')](_0x56ef1d,_0x56674f[_0x2abffd][_0x7f6f('0x7a')]||_0x56ef1d);}if(_0x5a5073[_0x7f6f('0x7b')]){_0x5a5073['joins']=JSON[_0x7f6f('0x7c')](_0x5a5073['joins']);for(var _0x2a7f7d=0x0;_0x2a7f7d<_0x5a5073['joins'][_0x7f6f('0x39')];_0x2a7f7d+=0x1){if(_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x31')]&&_[_0x7f6f('0x62')](_0x3b7b41,_0x5a5073['joins'][_0x2a7f7d][_0x7f6f('0x31')])&&_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0xa1')]&&_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x7d')]&&_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x7e')]){_0x24c389[_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d]['type']](_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x7d')],null,util[_0x7f6f('0x77')](_0x7f6f('0x7f'),_0x5a5073[_0x7f6f('0x72')],_0x5a5073['joins'][_0x2a7f7d][_0x7f6f('0xa1')],_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x7d')],_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x7e')]));}}}if(_0x5a5073[_0x7f6f('0x80')]){_0x5a5073['conditions']=JSON[_0x7f6f('0x7c')](_0x5a5073[_0x7f6f('0x80')]);_0x24c389[_0x7f6f('0x3e')](_0x2c320d(_0x5a5073[_0x7f6f('0x80')]['group']));}_0x39fcef=_0x24c389[_0x7f6f('0x81')]();_0x24c389['limit'](_0x519ee2);_0x24c389[_0x7f6f('0x1e')](0x0);logger[_0x7f6f('0xa2')](_0x7f6f('0x82'),_0x24c389[_0x7f6f('0x83')]());return dbH[_0x7f6f('0x84')][_0x7f6f('0x33')](_0x24c389[_0x7f6f('0x83')](),{'type':dbH['sequelize']['QueryTypes'][_0x7f6f('0x86')]});}})[_0x7f6f('0x27')](function(){return{'sql':_0x39fcef[_0x7f6f('0x83')]()};})[_0x7f6f('0x27')](respondWithResult(_0x1fe774,null))['catch'](handleError(_0x1fe774,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index e75ecec..51565f7 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 _0xcfba=['util','api','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xcfba,0x105));var _0xacfb=function(_0x49c060,_0x1d85a4){_0x49c060=_0x49c060-0x0;var _0x3973e2=_0xcfba[_0x49c060];return _0x3973e2;};'use strict';var _=require('lodash');var util=require(_0xacfb('0x0'));var logger=require('../../config/logger')(_0xacfb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xacfb('0x2'));var fs=require('fs');var path=require(_0xacfb('0x3'));var rimraf=require(_0xacfb('0x4'));var config=require(_0xacfb('0x5'));var attributes=require(_0xacfb('0x6'));module['exports']=function(_0x2a0885,_0x396189){return _0x2a0885['define'](_0xacfb('0x7'),attributes,{'tableName':_0xacfb('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd5f=['bluebird','request-promise','rimraf','./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','util','../../config/logger','api','moment'];(function(_0x1da46d,_0x41ce26){var _0x463df9=function(_0x3788e7){while(--_0x3788e7){_0x1da46d['push'](_0x1da46d['shift']());}};_0x463df9(++_0x41ce26);}(_0xfd5f,0xb6));var _0xffd5=function(_0x49a8f0,_0x525c1a){_0x49a8f0=_0x49a8f0-0x0;var _0x318193=_0xfd5f[_0x49a8f0];return _0x318193;};'use strict';var _=require(_0xffd5('0x0'));var util=require(_0xffd5('0x1'));var logger=require(_0xffd5('0x2'))(_0xffd5('0x3'));var moment=require(_0xffd5('0x4'));var BPromise=require(_0xffd5('0x5'));var rp=require(_0xffd5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffd5('0x7'));var config=require('../../config/environment');var attributes=require(_0xffd5('0x8'));module[_0xffd5('0x9')]=function(_0x2c701e,_0xda0a1d){return _0x2c701e['define']('AnalyticCustomReport',attributes,{'tableName':_0xffd5('0xa'),'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 415dce9..e5b03b2 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 _0xe463=['message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3df31d,_0x5081ff){var _0x352dbc=function(_0x2ede7c){while(--_0x2ede7c){_0x3df31d['push'](_0x3df31d['shift']());}};_0x352dbc(++_0x5081ff);}(_0xe463,0x131));var _0x3e46=function(_0x57ba9f,_0x9a0921){_0x57ba9f=_0x57ba9f-0x0;var _0xa7731d=_0xe463[_0x57ba9f];return _0xa7731d;};'use strict';var _=require(_0x3e46('0x0'));var util=require(_0x3e46('0x1'));var moment=require(_0x3e46('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e46('0x3'));var fs=require('fs');var Redis=require(_0x3e46('0x4'));var db=require(_0x3e46('0x5'))['db'];var utils=require(_0x3e46('0x6'));var logger=require(_0x3e46('0x7'))(_0x3e46('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e46('0x9'));var client=jayson[_0x3e46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x402488,_0x36b92f,_0x4292ab){return new BPromise(function(_0xa0a923,_0xd76b25){return client['request'](_0x402488,_0x4292ab)['then'](function(_0x34dd24){logger[_0x3e46('0xb')](_0x3e46('0xc'),_0x36b92f,_0x3e46('0xd'));logger[_0x3e46('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x36b92f,_0x3e46('0xd'),JSON[_0x3e46('0xf')](_0x34dd24));if(_0x34dd24[_0x3e46('0x10')]){if(_0x34dd24[_0x3e46('0x10')][_0x3e46('0x11')]===0x1f4){logger[_0x3e46('0x10')](_0x3e46('0xc'),_0x36b92f,_0x34dd24['error']['message']);return _0xd76b25(_0x34dd24[_0x3e46('0x10')]['message']);}logger['error'](_0x3e46('0xc'),_0x36b92f,_0x34dd24[_0x3e46('0x10')][_0x3e46('0x12')]);return _0xa0a923(_0x34dd24[_0x3e46('0x10')][_0x3e46('0x12')]);}else{logger[_0x3e46('0xb')](_0x3e46('0xc'),_0x36b92f,_0x3e46('0xd'));_0xa0a923(_0x34dd24['result'][_0x3e46('0x12')]);}})['catch'](function(_0x4e14c5){logger[_0x3e46('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x36b92f,_0x4e14c5);_0xd76b25(_0x4e14c5);});});} \ No newline at end of file +var _0xd5a8=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20f9b9,_0x472933){var _0x5815d4=function(_0x5d9e15){while(--_0x5d9e15){_0x20f9b9['push'](_0x20f9b9['shift']());}};_0x5815d4(++_0x472933);}(_0xd5a8,0x194));var _0x8d5a=function(_0x173ad1,_0xb69870){_0x173ad1=_0x173ad1-0x0;var _0x202363=_0xd5a8[_0x173ad1];return _0x202363;};'use strict';var _=require(_0x8d5a('0x0'));var util=require(_0x8d5a('0x1'));var moment=require(_0x8d5a('0x2'));var BPromise=require(_0x8d5a('0x3'));var rs=require(_0x8d5a('0x4'));var fs=require('fs');var Redis=require(_0x8d5a('0x5'));var db=require(_0x8d5a('0x6'))['db'];var utils=require(_0x8d5a('0x7'));var logger=require(_0x8d5a('0x8'))('rpc');var config=require(_0x8d5a('0x9'));var jayson=require(_0x8d5a('0xa'));var client=jayson[_0x8d5a('0xb')][_0x8d5a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ef7a8,_0x3837fe,_0xbbfb66){return new BPromise(function(_0x2fcbae,_0x3cbfdb){return client[_0x8d5a('0xd')](_0x5ef7a8,_0xbbfb66)[_0x8d5a('0xe')](function(_0x4475a1){logger[_0x8d5a('0xf')](_0x8d5a('0x10'),_0x3837fe,_0x8d5a('0x11'));logger[_0x8d5a('0x12')](_0x8d5a('0x13'),_0x3837fe,'request\x20sent',JSON[_0x8d5a('0x14')](_0x4475a1));if(_0x4475a1[_0x8d5a('0x15')]){if(_0x4475a1[_0x8d5a('0x15')][_0x8d5a('0x16')]===0x1f4){logger[_0x8d5a('0x15')](_0x8d5a('0x10'),_0x3837fe,_0x4475a1[_0x8d5a('0x15')][_0x8d5a('0x17')]);return _0x3cbfdb(_0x4475a1['error']['message']);}logger[_0x8d5a('0x15')](_0x8d5a('0x10'),_0x3837fe,_0x4475a1[_0x8d5a('0x15')][_0x8d5a('0x17')]);return _0x2fcbae(_0x4475a1['error'][_0x8d5a('0x17')]);}else{logger[_0x8d5a('0xf')](_0x8d5a('0x10'),_0x3837fe,_0x8d5a('0x11'));_0x2fcbae(_0x4475a1[_0x8d5a('0x18')][_0x8d5a('0x17')]);}})['catch'](function(_0x24190e){logger['error'](_0x8d5a('0x10'),_0x3837fe,_0x24190e);_0x3cbfdb(_0x24190e);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 0482a66..1c469b8 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 _0x55ae=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3a5248,_0x34e201){var _0x4175a1=function(_0x5ad898){while(--_0x5ad898){_0x3a5248['push'](_0x3a5248['shift']());}};_0x4175a1(++_0x34e201);}(_0x55ae,0xf8));var _0xe55a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x55ae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xe55a('0x0'));var path=require(_0xe55a('0x1'));var timeout=require(_0xe55a('0x2'));var express=require(_0xe55a('0x3'));var router=express['Router']();var fs_extra=require(_0xe55a('0x4'));var auth=require(_0xe55a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe55a('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xe55a('0x7')]('/',auth[_0xe55a('0x8')](),controller['index']);router[_0xe55a('0x7')](_0xe55a('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xe55a('0x7')](_0xe55a('0xa'),auth[_0xe55a('0x8')](),controller[_0xe55a('0xb')]);router['get'](_0xe55a('0xc'),auth[_0xe55a('0x8')](),controller['run']);router[_0xe55a('0x7')](_0xe55a('0xd'),auth[_0xe55a('0x8')](),controller[_0xe55a('0xe')]);router[_0xe55a('0xf')]('/',auth[_0xe55a('0x8')](),controller[_0xe55a('0x10')]);router[_0xe55a('0x11')](_0xe55a('0x9'),auth[_0xe55a('0x8')](),controller['update']);router[_0xe55a('0x12')](_0xe55a('0x9'),auth['isAuthenticated'](),controller[_0xe55a('0x13')]);module[_0xe55a('0x14')]=router; \ No newline at end of file +var _0xe1f8=['get','isAuthenticated','index','show','/:id/preview','preview','query','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller'];(function(_0x31aa2e,_0x16c6ed){var _0x2f57f0=function(_0x1111d4){while(--_0x1111d4){_0x31aa2e['push'](_0x31aa2e['shift']());}};_0x2f57f0(++_0x16c6ed);}(_0xe1f8,0xf4));var _0x8e1f=function(_0x3563a1,_0x38e0ad){_0x3563a1=_0x3563a1-0x0;var _0x3fbe20=_0xe1f8[_0x3563a1];return _0x3fbe20;};'use strict';var multer=require(_0x8e1f('0x0'));var util=require(_0x8e1f('0x1'));var path=require(_0x8e1f('0x2'));var timeout=require(_0x8e1f('0x3'));var express=require('express');var router=express[_0x8e1f('0x4')]();var fs_extra=require(_0x8e1f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8e1f('0x6'));var config=require('../../config/environment');var controller=require(_0x8e1f('0x7'));router[_0x8e1f('0x8')]('/',auth[_0x8e1f('0x9')](),controller[_0x8e1f('0xa')]);router[_0x8e1f('0x8')]('/:id',auth[_0x8e1f('0x9')](),controller[_0x8e1f('0xb')]);router[_0x8e1f('0x8')](_0x8e1f('0xc'),auth[_0x8e1f('0x9')](),controller[_0x8e1f('0xd')]);router[_0x8e1f('0x8')]('/:id/run',auth[_0x8e1f('0x9')](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x8e1f('0xe')]);router[_0x8e1f('0xf')]('/',auth[_0x8e1f('0x9')](),controller['create']);router[_0x8e1f('0x10')](_0x8e1f('0x11'),auth[_0x8e1f('0x9')](),controller[_0x8e1f('0x12')]);router['delete'](_0x8e1f('0x11'),auth[_0x8e1f('0x9')](),controller[_0x8e1f('0x13')]);module[_0x8e1f('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 25a918c..51fb022 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 _0x8958=['TEXT','exports'];(function(_0xed6f46,_0x1c9006){var _0x5b267c=function(_0x59f0d2){while(--_0x59f0d2){_0xed6f46['push'](_0xed6f46['shift']());}};_0x5b267c(++_0x1c9006);}(_0x8958,0x93));var _0x8895=function(_0x1bdc3d,_0x40d513){_0x1bdc3d=_0x1bdc3d-0x0;var _0x26561e=_0x8958[_0x1bdc3d];return _0x26561e;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xda19=['exports','STRING','TEXT'];(function(_0x36f5af,_0x40f484){var _0x430004=function(_0x37fe84){while(--_0x37fe84){_0x36f5af['push'](_0x36f5af['shift']());}};_0x430004(++_0x40f484);}(_0xda19,0xd5));var _0x9da1=function(_0x369b03,_0x59f4e7){_0x369b03=_0x369b03-0x0;var _0x1c693e=_0xda19[_0x369b03];return _0x1c693e;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index b41ea03..c973a70 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 _0xdc97=['startDate','toString','../../components/export/','savename','COUNT(*)','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','DefaultReports','UserProfileResource','error','stack','name','map','AnalyticDefaultReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','default','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc97,0x13b));var _0x7dc9=function(_0x466708,_0x401295){_0x466708=_0x466708-0x0;var _0x580b4a=_0xdc97[_0x466708];return _0x580b4a;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x7dc9('0x16')];function respondWithStatusCode(_0x14e5db,_0x5c6ca5){_0x5c6ca5=_0x5c6ca5||0xcc;return function(_0xbd06be){if(_0xbd06be){return _0x14e5db[_0x7dc9('0x17')](_0x5c6ca5);}return _0x14e5db[_0x7dc9('0x18')](_0x5c6ca5)[_0x7dc9('0x19')]();};}function respondWithResult(_0x31d43d,_0x11af93){_0x11af93=_0x11af93||0xc8;return function(_0x524d09){if(_0x524d09){return _0x31d43d[_0x7dc9('0x18')](_0x11af93)[_0x7dc9('0x1a')](_0x524d09);}};}function respondWithFilteredResult(_0x1b0aa1,_0x442819){return function(_0x11606f){if(_0x11606f){var _0xbe0437=typeof _0x442819[_0x7dc9('0x1b')]===_0x7dc9('0x1c')&&typeof _0x442819[_0x7dc9('0x1d')]==='undefined';var _0x22577e=_0x11606f['count'];var _0x1f5906=_0xbe0437?0x0:_0x442819[_0x7dc9('0x1b')];var _0x5d61d7=_0xbe0437?_0x11606f[_0x7dc9('0x1e')]:_0x442819[_0x7dc9('0x1b')]+_0x442819[_0x7dc9('0x1d')];var _0x4b2703;if(_0x5d61d7>=_0x22577e){_0x5d61d7=_0x22577e;_0x4b2703=0xc8;}else{_0x4b2703=0xce;}_0x1b0aa1[_0x7dc9('0x18')](_0x4b2703);return _0x1b0aa1[_0x7dc9('0x1f')](_0x7dc9('0x20'),_0x1f5906+'-'+_0x5d61d7+'/'+_0x22577e)[_0x7dc9('0x1a')](_0x11606f);}return null;};}function patchUpdates(_0x155cc4){return function(_0x2b38d6){try{jsonpatch['apply'](_0x2b38d6,_0x155cc4,!![]);}catch(_0x593e60){return BPromise[_0x7dc9('0x21')](_0x593e60);}return _0x2b38d6[_0x7dc9('0x22')]();};}function saveUpdates(_0x596e0f,_0x349001){return function(_0x27f7fa){if(_0x27f7fa){return _0x27f7fa['update'](_0x596e0f)[_0x7dc9('0x23')](function(_0x43d31f){return _0x43d31f;});}return null;};}function removeEntity(_0x41110a,_0x4906b1){return function(_0x424763){if(_0x424763){return _0x424763[_0x7dc9('0x24')]()[_0x7dc9('0x23')](function(){var _0x55a482=_0x424763['get']({'plain':!![]});var _0x4b9ba6=_0x7dc9('0x25');return db[_0x7dc9('0x26')]['destroy']({'where':{'type':_0x4b9ba6,'resourceId':_0x55a482['id']}})['then'](function(){return _0x424763;});})[_0x7dc9('0x23')](function(){_0x41110a['status'](0xcc)[_0x7dc9('0x19')]();});}};}function handleEntityNotFound(_0x1c690b,_0x3a74a0){return function(_0x3e4102){if(!_0x3e4102){_0x1c690b[_0x7dc9('0x17')](0x194);}return _0x3e4102;};}function handleError(_0x450124,_0x236d42){_0x236d42=_0x236d42||0x1f4;return function(_0x229f8e){logger[_0x7dc9('0x27')](_0x229f8e[_0x7dc9('0x28')]);if(_0x229f8e[_0x7dc9('0x29')]){delete _0x229f8e[_0x7dc9('0x29')];}_0x450124['status'](_0x236d42)['send'](_0x229f8e);};}exports['index']=function(_0x49a4a5,_0x4a68f0){var _0x553a03={},_0x58c4e8={},_0x59f5d8={'count':0x0,'rows':[]};var _0x4463dc=_[_0x7dc9('0x2a')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')],function(_0x3300ff){return{'name':_0x3300ff[_0x7dc9('0x2d')],'type':_0x3300ff['type']['key']};});_0x58c4e8['model']=_[_0x7dc9('0x2a')](_0x4463dc,'name');_0x58c4e8[_0x7dc9('0x2e')]=_[_0x7dc9('0x2f')](_0x49a4a5[_0x7dc9('0x2e')]);_0x58c4e8[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x58c4e8[_0x7dc9('0x32')],_0x58c4e8[_0x7dc9('0x2e')]);_0x553a03[_0x7dc9('0x33')]=_['intersection'](_0x58c4e8[_0x7dc9('0x32')],qs['fields'](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x34')]));_0x553a03[_0x7dc9('0x33')]=_0x553a03[_0x7dc9('0x33')]['length']?_0x553a03[_0x7dc9('0x33')]:_0x58c4e8['model'];if(!_0x49a4a5[_0x7dc9('0x2e')]['hasOwnProperty']('nolimit')){_0x553a03[_0x7dc9('0x1d')]=qs[_0x7dc9('0x1d')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1d')]);_0x553a03['offset']=qs[_0x7dc9('0x1b')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1b')]);}_0x553a03[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x553a03[_0x7dc9('0x37')]=qs[_0x7dc9('0x30')](_[_0x7dc9('0x38')](_0x49a4a5[_0x7dc9('0x2e')],_0x58c4e8[_0x7dc9('0x30')]),_0x4463dc);if(_0x49a4a5['query'][_0x7dc9('0x39')]){_0x553a03[_0x7dc9('0x37')]=_[_0x7dc9('0x3a')](_0x553a03[_0x7dc9('0x37')],{'$or':_['map'](_0x4463dc,function(_0x3492e6){if(_0x3492e6[_0x7dc9('0x3b')]!==_0x7dc9('0x3c')){var _0x3876b6={};_0x3876b6[_0x3492e6[_0x7dc9('0x29')]]={'$like':'%'+_0x49a4a5[_0x7dc9('0x2e')]['filter']+'%'};return _0x3876b6;}})});}_0x553a03=_['merge']({},_0x553a03,_0x49a4a5[_0x7dc9('0x3d')]);var _0x36a965={'where':_0x553a03['where']};return db[_0x7dc9('0x2b')]['count'](_0x36a965)[_0x7dc9('0x23')](function(_0x2a91fe){_0x59f5d8[_0x7dc9('0x1e')]=_0x2a91fe;if(_0x49a4a5['query'][_0x7dc9('0x3e')]){_0x553a03[_0x7dc9('0x3f')]=[{'all':!![]}];}return db[_0x7dc9('0x2b')][_0x7dc9('0x40')](_0x553a03);})[_0x7dc9('0x23')](function(_0x23499a){_0x59f5d8[_0x7dc9('0x41')]=_0x23499a;return _0x59f5d8;})['then'](respondWithFilteredResult(_0x4a68f0,_0x553a03))[_0x7dc9('0x42')](handleError(_0x4a68f0,null));};exports['show']=function(_0x52d883,_0xcced6c){var _0x294276={'raw':!![],'where':{'id':_0x52d883[_0x7dc9('0x43')]['id']}},_0x18c8a1={};_0x18c8a1[_0x7dc9('0x32')]=_[_0x7dc9('0x2f')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')]);_0x18c8a1[_0x7dc9('0x2e')]=_['keys'](_0x52d883[_0x7dc9('0x2e')]);_0x18c8a1[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x18c8a1[_0x7dc9('0x32')],_0x18c8a1[_0x7dc9('0x2e')]);_0x294276[_0x7dc9('0x33')]=_['intersection'](_0x18c8a1[_0x7dc9('0x32')],qs[_0x7dc9('0x34')](_0x52d883['query'][_0x7dc9('0x34')]));_0x294276[_0x7dc9('0x33')]=_0x294276[_0x7dc9('0x33')]['length']?_0x294276[_0x7dc9('0x33')]:_0x18c8a1['model'];if(_0x52d883['query'][_0x7dc9('0x3e')]){_0x294276[_0x7dc9('0x3f')]=[{'all':!![]}];}_0x294276=_[_0x7dc9('0x3a')]({},_0x294276,_0x52d883['options']);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x294276)['then'](handleEntityNotFound(_0xcced6c,null))[_0x7dc9('0x23')](respondWithResult(_0xcced6c,null))[_0x7dc9('0x42')](handleError(_0xcced6c,null));};exports['create']=function(_0x24ccce,_0x1d6c0a){return db[_0x7dc9('0x2b')][_0x7dc9('0x45')](_0x24ccce[_0x7dc9('0x46')],{})[_0x7dc9('0x23')](function(_0x86739f){var _0x3a1102=_0x24ccce[_0x7dc9('0x47')][_0x7dc9('0x48')]({'plain':!![]});if(!_0x3a1102)throw new Error(_0x7dc9('0x49'));if(_0x3a1102[_0x7dc9('0x4a')]===_0x7dc9('0x47')){var _0x59be9b=_0x86739f[_0x7dc9('0x48')]({'plain':!![]});var _0x4fcfd5='Reports';return db[_0x7dc9('0x4b')][_0x7dc9('0x44')]({'where':{'name':_0x4fcfd5,'userProfileId':_0x3a1102[_0x7dc9('0x4c')]},'raw':!![]})[_0x7dc9('0x23')](function(_0x346d27){if(_0x346d27&&_0x346d27['autoAssociation']===0x0){return db[_0x7dc9('0x26')][_0x7dc9('0x45')]({'name':_0x59be9b[_0x7dc9('0x29')],'resourceId':_0x59be9b['id'],'type':'DefaultReports','sectionId':_0x346d27['id']},{})[_0x7dc9('0x23')](function(){return _0x86739f;});}else{return _0x86739f;}})[_0x7dc9('0x42')](function(_0x2cf133){logger[_0x7dc9('0x27')](_0x7dc9('0x4d'),_0x2cf133);throw _0x2cf133;});}return _0x86739f;})[_0x7dc9('0x23')](respondWithResult(_0x1d6c0a,0xc9))['catch'](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x4e')]=function(_0x2ecc80,_0x2b0941){if(_0x2ecc80[_0x7dc9('0x46')]['id']){delete _0x2ecc80[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x2ecc80[_0x7dc9('0x43')]['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x2b0941,null))[_0x7dc9('0x23')](saveUpdates(_0x2ecc80[_0x7dc9('0x46')],null))[_0x7dc9('0x23')](respondWithResult(_0x2b0941,null))['catch'](handleError(_0x2b0941,null));};exports[_0x7dc9('0x24')]=function(_0x39be46,_0x38df9a){return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x39be46['params']['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x38df9a,null))[_0x7dc9('0x23')](removeEntity(_0x38df9a,null))[_0x7dc9('0x42')](handleError(_0x38df9a,null));};exports[_0x7dc9('0x4f')]=function(_0x2a1db8,_0x2f01a0){var _0x495a06=0xa;var _0x547caa=['join',_0x7dc9('0x50'),_0x7dc9('0x51'),_0x7dc9('0x52')];var _0x2afefc={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x4905f6={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x4bbf8b=function(_0x175858){return!_[_0x7dc9('0x5f')]([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x175858);};var _0x286ac5=function(_0x2a02ed){if(!_0x2a02ed||!_0x2a02ed[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x19c209='(',_0xf3ae59=0x0;_0xf3ae59<_0x2a02ed[_0x7dc9('0x64')]['length'];_0xf3ae59+=0x1){_0xf3ae59>0x0&&(_0x19c209+='\x20'+_0x2a02ed[_0x7dc9('0x66')]+'\x20');_0x19c209+=_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x67')]?_0x286ac5(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59]['group']):_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x68')]+'\x20'+_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x69')]+(_0x4bbf8b(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x69')])?'\x20'+_0x2a02ed['rules'][_0xf3ae59]['value']:'');}return _0x19c209+')';};var _0x205d01={'where':{'id':_0x2a1db8[_0x7dc9('0x43')]['id']}},_0x366d4d,_0x4ed60e,_0x3aba59,_0x15d02f,_0x2bbf61;_0x205d01=_[_0x7dc9('0x3a')]({},_0x205d01,_0x2a1db8[_0x7dc9('0x3d')]);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x205d01)[_0x7dc9('0x23')](function(_0x3f81dd){if(_0x3f81dd){_0x366d4d=_0x3f81dd;return _0x3f81dd['getFields']();}return null;})['then'](function(_0x1b2369){if(_0x1b2369){if(!_0x1b2369[_0x7dc9('0x65')]){throw new db[(_0x7dc9('0x6a'))][(_0x7dc9('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ed60e=_0x1b2369;return db['AnalyticMetric'][_0x7dc9('0x40')]({'raw':!![]});}return null;})[_0x7dc9('0x23')](function(_0x25f8b3){if(_0x25f8b3){_0x3aba59=_[_0x7dc9('0x6c')](_0x25f8b3,'id');var _0x5d211b;var _0xea1728=squel[_0x7dc9('0x6d')]();_0xea1728[_0x7dc9('0x6e')](_0x366d4d[_0x7dc9('0x6f')]);for(var _0x19e0b1=0x0;_0x19e0b1<_0x4ed60e[_0x7dc9('0x65')];_0x19e0b1+=0x1){_0x5d211b=_0x4ed60e[_0x19e0b1][_0x7dc9('0x70')]?_0x3aba59[_0x4ed60e[_0x19e0b1]['MetricId']][_0x7dc9('0x71')]:_0x4ed60e[_0x19e0b1][_0x7dc9('0x68')];_0x5d211b=_0x4ed60e[_0x19e0b1]['function']?_['replace'](_0x2afefc[_0x4ed60e[_0x19e0b1][_0x7dc9('0x72')]],'%s',_0x5d211b):_0x5d211b;_0x5d211b=_0x4ed60e[_0x19e0b1]['format']?_[_0x7dc9('0x73')](_0x4905f6[_0x4ed60e[_0x19e0b1][_0x7dc9('0x74')]],'%s',_0x5d211b):_0x5d211b;if(_0x4ed60e[_0x19e0b1][_0x7dc9('0x75')]){_0xea1728[_0x7dc9('0x67')](_0x5d211b);}_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]&&_0xea1728[_0x7dc9('0x35')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0xea1728[_0x7dc9('0x68')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x78')]||_0x5d211b);}if(_0x366d4d['joins']){_0x366d4d[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x79')]);for(var _0x499393=0x0;_0x499393<_0x366d4d[_0x7dc9('0x79')]['length'];_0x499393+=0x1){if(_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]&&_[_0x7dc9('0x5f')](_0x547caa,_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')])&&_0x366d4d['joins'][_0x499393]['parentKey']&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')]&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7c')]){_0xea1728[_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]](_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x366d4d[_0x7dc9('0x6f')],_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7e')],_0x366d4d['joins'][_0x499393]['foreignTable'],_0x366d4d[_0x7dc9('0x79')][_0x499393]['foreignKey']));}}}if(_0x366d4d[_0x7dc9('0x7f')]){_0x366d4d[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x7f')]);_0xea1728['where'](_0x286ac5(_0x366d4d[_0x7dc9('0x7f')][_0x7dc9('0x67')]));}_0x2bbf61=_0xea1728['clone']();_0xea1728[_0x7dc9('0x1d')](_0x495a06);_0xea1728[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0xea1728['toString']());return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xea1728['toString'](),{'type':dbH['sequelize'][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})['then'](respondWithResult(_0x2f01a0,null))[_0x7dc9('0x42')](handleError(_0x2f01a0,null));};function runReport(_0x5f08f6,_0x2e7296,_0x1d0722){var _0x1acdba=_0x2e7296['name'];var _0x33d68c=0xa;var _0x3c7daf=[_0x7dc9('0x85'),'left_join',_0x7dc9('0x51'),'cross_join'];var _0x5761cb={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x2dc92e={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':'DATE(%s)','HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x200df7=function(_0x53c992){return!_[_0x7dc9('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7dc9('0x62'),'IS\x20NOT\x20EMPTY'],_0x53c992);};var _0x21da79=function(_0x476a24){if(!_0x476a24||!_0x476a24[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x38dccc='(',_0xc716c3=0x0;_0xc716c3<_0x476a24['rules'][_0x7dc9('0x65')];_0xc716c3+=0x1){_0xc716c3>0x0&&(_0x38dccc+='\x20'+_0x476a24[_0x7dc9('0x66')]+'\x20');_0x38dccc+=_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x67')]?_0x21da79(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['group']):_0x476a24[_0x7dc9('0x64')][_0xc716c3]['field']+'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x69')]+(_0x200df7(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['condition'])?'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x88')]:'');}return _0x38dccc+')';};var _0x5e8806={'where':{'id':_0x5f08f6['id']}},_0x1a9c7e,_0x3f8839,_0xf74b6,_0x2b3d46,_0x5c466d;_0x5e8806=_[_0x7dc9('0x3a')]({},_0x5e8806,_0x1d0722);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x5e8806)[_0x7dc9('0x23')](function(_0x3e06b3){if(_0x3e06b3){_0x1a9c7e=_0x3e06b3;return _0x3e06b3['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x4588a7){if(_0x4588a7){if(!_0x4588a7[_0x7dc9('0x65')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x3f8839=_0x4588a7;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xb0c228){if(_0xb0c228){_0xf74b6=_[_0x7dc9('0x6c')](_0xb0c228,'id');var _0x5f3487;var _0x29c228=squel['select']();_0x29c228[_0x7dc9('0x6e')](_0x1a9c7e[_0x7dc9('0x6f')]);for(var _0x235473=0x0;_0x235473<_0x3f8839[_0x7dc9('0x65')];_0x235473+=0x1){_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x70')]?_0xf74b6[_0x3f8839[_0x235473][_0x7dc9('0x70')]]['metric']:_0x3f8839[_0x235473][_0x7dc9('0x68')];_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x5761cb[_0x3f8839[_0x235473][_0x7dc9('0x72')]],'%s',_0x5f3487):_0x5f3487;_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x74')]?_['replace'](_0x2dc92e[_0x3f8839[_0x235473][_0x7dc9('0x74')]],'%s',_0x5f3487):_0x5f3487;if(_0x3f8839[_0x235473][_0x7dc9('0x75')]){_0x29c228[_0x7dc9('0x67')](_0x5f3487);}_0x3f8839[_0x235473][_0x7dc9('0x76')]&&_0x29c228['order'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x29c228['field'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x78')]||_0x5f3487);}if(_0x1a9c7e['joins']){_0x1a9c7e[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x79')]);for(var _0x4173c2=0x0;_0x4173c2<_0x1a9c7e[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x4173c2+=0x1){if(_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]&&_['includes'](_0x3c7daf,_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')])&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')]&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2]['foreignTable']&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]){_0x29c228[_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]](_0x1a9c7e['joins'][_0x4173c2][_0x7dc9('0x7b')],null,util['format'](_0x7dc9('0x7d'),_0x1a9c7e['table'],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7b')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]));}}}if(_0x1a9c7e[_0x7dc9('0x7f')]){_0x1a9c7e[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x7f')]);_0x29c228[_0x7dc9('0x37')](_0x21da79(_0x1a9c7e[_0x7dc9('0x7f')]['group']));}_0x5c466d=_0x29c228[_0x7dc9('0x8b')]();_0x29c228[_0x7dc9('0x1d')](_0x33d68c);_0x29c228[_0x7dc9('0x1b')](0x0);return;}})[_0x7dc9('0x23')](function(){if(_0x2e7296['output']===_0x7dc9('0x8c')){return null;}var _0x35e061=_[_0x7dc9('0x3a')](_0x2e7296,{'name':_0x2e7296[_0x7dc9('0x8d')]||_0x2e7296['name']||_0x1a9c7e[_0x7dc9('0x29')],'basename':_0x1acdba,'savename':util[_0x7dc9('0x74')](_0x7dc9('0x8e'),_0x2e7296['name']||_0x1a9c7e['name'],require(_0x7dc9('0x8f'))[_0x7dc9('0x90')](0x4),_0x2e7296[_0x7dc9('0x91')]||_0x7dc9('0x92')),'reportId':_0x1a9c7e['id'],'reportType':_0x7dc9('0x93')});return db['AnalyticExtractedReport'][_0x7dc9('0x45')](_0x35e061,{'raw':!![]});})[_0x7dc9('0x23')](function(_0x648bf9){if(_0x1a9c7e[_0x7dc9('0x6f')]==='cdr'){_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e['table']+_0x7dc9('0x94'),_0x2e7296['startDate'],_0x2e7296[_0x7dc9('0x95')]);}else{_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e[_0x7dc9('0x6f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e7296[_0x7dc9('0x96')],_0x2e7296[_0x7dc9('0x95')]);}if(_0x648bf9){logger['info']('Run\x20Query:',_0x5c466d[_0x7dc9('0x97')]());require('child_process')['fork'](path[_0x7dc9('0x85')](__dirname,_0x7dc9('0x98'),_0x648bf9[_0x7dc9('0x91')]),[_0x648bf9['id'],_0x5c466d['toString'](),path['join'](__dirname,'../../files/reports',_0x648bf9[_0x7dc9('0x99')]),_0x1acdba]);return _0x648bf9;}else{var _0xb825f3=squel[_0x7dc9('0x6d')]();_0xb825f3[_0x7dc9('0x6e')]('('+_0x5c466d['toString']()+')','countTable');_0xb825f3[_0x7dc9('0x68')](_0x7dc9('0x9a'),_0x7dc9('0x1e'));_0x5c466d['limit'](_0x2e7296['limit']||_0x33d68c);_0x5c466d[_0x7dc9('0x1b')](_0x2e7296['offset']||0x0);return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xb825f3['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]})[_0x7dc9('0x23')](function(_0x14cbd9){if(!_0x14cbd9[_0x7dc9('0x65')]){_0x2b3d46=0x0;}else{_0x2b3d46=_0x14cbd9[0x0][_0x7dc9('0x1e')]||0x0;}return dbH[_0x7dc9('0x82')]['query'](_0x5c466d[_0x7dc9('0x97')](),{'type':dbH['sequelize'][_0x7dc9('0x83')]['SELECT']});})[_0x7dc9('0x23')](function(_0x20f245){return{'rows':_0x20f245||[],'count':_0x2b3d46};});}});}exports['run']=function(_0x67d933,_0x1b2b88){return runReport(_0x67d933[_0x7dc9('0x43')],_0x67d933[_0x7dc9('0x2e')],_0x67d933[_0x7dc9('0x3d')])['then'](respondWithResult(_0x1b2b88,null))[_0x7dc9('0x42')](handleError(_0x1b2b88,null));};exports['runReport']=runReport;exports[_0x7dc9('0x2e')]=function(_0x313b41,_0x275675){var _0x299c23=0xa;var _0x4c1c43=[_0x7dc9('0x85'),_0x7dc9('0x50'),'right_join',_0x7dc9('0x52')];var _0x1fbaea={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6c7fdc={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x5c9d64=function(_0x59710c){return!_['includes']([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x59710c);};var _0x24a1e2=function(_0x45bcf4){if(!_0x45bcf4||!_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x4b18e1='(',_0x28e50e=0x0;_0x28e50e<_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')];_0x28e50e+=0x1){_0x28e50e>0x0&&(_0x4b18e1+='\x20'+_0x45bcf4['operator']+'\x20');_0x4b18e1+=_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]?_0x24a1e2(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]):_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x68')]+'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')]+(_0x5c9d64(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')])?'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x88')]:'');}return _0x4b18e1+')';};var _0x1dc474={'where':{'id':_0x313b41[_0x7dc9('0x43')]['id']}},_0x31121a,_0x454b3a,_0x409a9f,_0x187f17,_0x809ae5;_0x1dc474=_[_0x7dc9('0x3a')]({},_0x1dc474,_0x313b41['options']);return db[_0x7dc9('0x2b')]['find'](_0x1dc474)[_0x7dc9('0x23')](function(_0x56e1ba){if(_0x56e1ba){_0x31121a=_0x56e1ba;return _0x56e1ba['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x342b95){if(_0x342b95){if(!_0x342b95['length']){throw new db[(_0x7dc9('0x6a'))]['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x454b3a=_0x342b95;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x338c78){if(_0x338c78){_0x409a9f=_[_0x7dc9('0x6c')](_0x338c78,'id');var _0x8ee4f4;var _0x8f887e=squel['select']();_0x8f887e[_0x7dc9('0x6e')](_0x31121a[_0x7dc9('0x6f')]);for(var _0x4e2edf=0x0;_0x4e2edf<_0x454b3a[_0x7dc9('0x65')];_0x4e2edf+=0x1){_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x70')]?_0x409a9f[_0x454b3a[_0x4e2edf]['MetricId']]['metric']:_0x454b3a[_0x4e2edf][_0x7dc9('0x68')];_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x1fbaea[_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]],'%s',_0x8ee4f4):_0x8ee4f4;_0x8ee4f4=_0x454b3a[_0x4e2edf]['format']?_[_0x7dc9('0x73')](_0x6c7fdc[_0x454b3a[_0x4e2edf]['format']],'%s',_0x8ee4f4):_0x8ee4f4;if(_0x454b3a[_0x4e2edf]['groupBy']){_0x8f887e[_0x7dc9('0x67')](_0x8ee4f4);}_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]&&_0x8f887e[_0x7dc9('0x35')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x8f887e[_0x7dc9('0x68')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x78')]||_0x8ee4f4);}if(_0x31121a['joins']){_0x31121a[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x31121a[_0x7dc9('0x79')]);for(var _0x283f96=0x0;_0x283f96<_0x31121a[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x283f96+=0x1){if(_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']&&_[_0x7dc9('0x5f')](_0x4c1c43,_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x3b')])&&_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7e')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7b')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]){_0x8f887e[_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']](_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x31121a[_0x7dc9('0x6f')],_0x31121a[_0x7dc9('0x79')][_0x283f96]['parentKey'],_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]));}}}if(_0x31121a[_0x7dc9('0x7f')]){_0x31121a['conditions']=JSON['parse'](_0x31121a[_0x7dc9('0x7f')]);_0x8f887e[_0x7dc9('0x37')](_0x24a1e2(_0x31121a[_0x7dc9('0x7f')]['group']));}_0x809ae5=_0x8f887e[_0x7dc9('0x8b')]();_0x8f887e['limit'](_0x299c23);_0x8f887e[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0x8f887e['toString']());return dbH[_0x7dc9('0x82')]['query'](_0x8f887e['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})[_0x7dc9('0x23')](function(){return{'sql':_0x809ae5[_0x7dc9('0x97')]()};})['then'](respondWithResult(_0x275675,null))['catch'](handleError(_0x275675,null));}; \ No newline at end of file +var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x203357,_0x21c97e){var _0x255385=function(_0x1de374){while(--_0x1de374){_0x203357['push'](_0x203357['shift']());}};_0x255385(++_0x21c97e);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index f9bd5ad..700b12a 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 _0x3add=['bluebird','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0x53c3e7,_0x454629){var _0x51ad5d=function(_0x24173d){while(--_0x24173d){_0x53c3e7['push'](_0x53c3e7['shift']());}};_0x51ad5d(++_0x454629);}(_0x3add,0x1b5));var _0xd3ad=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x3add[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xd3ad('0x0'));var util=require(_0xd3ad('0x1'));var logger=require(_0xd3ad('0x2'))(_0xd3ad('0x3'));var moment=require(_0xd3ad('0x4'));var BPromise=require(_0xd3ad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3ad('0x6'));var rimraf=require(_0xd3ad('0x7'));var config=require(_0xd3ad('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0xd3ad('0x9')]=function(_0x347ea5,_0x2f2556){return _0x347ea5[_0xd3ad('0xa')](_0xd3ad('0xb'),attributes,{'tableName':_0xd3ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa029=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','lodash','util','../../config/logger','api'];(function(_0x392412,_0x20fd5c){var _0x1b417c=function(_0x5566a2){while(--_0x5566a2){_0x392412['push'](_0x392412['shift']());}};_0x1b417c(++_0x20fd5c);}(_0xa029,0x1a0));var _0x9a02=function(_0x22d7ee,_0x395978){_0x22d7ee=_0x22d7ee-0x0;var _0x5989ac=_0xa029[_0x22d7ee];return _0x5989ac;};'use strict';var _=require(_0x9a02('0x0'));var util=require(_0x9a02('0x1'));var logger=require(_0x9a02('0x2'))(_0x9a02('0x3'));var moment=require('moment');var BPromise=require(_0x9a02('0x4'));var rp=require(_0x9a02('0x5'));var fs=require('fs');var path=require(_0x9a02('0x6'));var rimraf=require(_0x9a02('0x7'));var config=require(_0x9a02('0x8'));var attributes=require(_0x9a02('0x9'));module['exports']=function(_0x118d37,_0x20f584){return _0x118d37[_0x9a02('0xa')](_0x9a02('0xb'),attributes,{'tableName':'analytics_default_reports','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 9b6129d..f3eaaf1 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 _0x9466=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x9466,0x110));var _0x6946=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9466[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x6946('0x0'));var util=require(_0x6946('0x1'));var moment=require(_0x6946('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6946('0x3'));var db=require(_0x6946('0x4'))['db'];var utils=require(_0x6946('0x5'));var logger=require(_0x6946('0x6'))(_0x6946('0x7'));var config=require(_0x6946('0x8'));var jayson=require(_0x6946('0x9'));var client=jayson[_0x6946('0xa')][_0x6946('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d17ed,_0xc51407,_0x35b30c){return new BPromise(function(_0x43b1a6,_0x405995){return client[_0x6946('0xc')](_0x4d17ed,_0x35b30c)[_0x6946('0xd')](function(_0x4de0fb){logger[_0x6946('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xc51407,_0x6946('0xf'));logger[_0x6946('0x10')](_0x6946('0x11'),_0xc51407,'request\x20sent',JSON[_0x6946('0x12')](_0x4de0fb));if(_0x4de0fb[_0x6946('0x13')]){if(_0x4de0fb[_0x6946('0x13')][_0x6946('0x14')]===0x1f4){logger[_0x6946('0x13')](_0x6946('0x15'),_0xc51407,_0x4de0fb['error'][_0x6946('0x16')]);return _0x405995(_0x4de0fb[_0x6946('0x13')][_0x6946('0x16')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xc51407,_0x4de0fb['error'][_0x6946('0x16')]);return _0x43b1a6(_0x4de0fb['error'][_0x6946('0x16')]);}else{logger[_0x6946('0xe')](_0x6946('0x15'),_0xc51407,'request\x20sent');_0x43b1a6(_0x4de0fb[_0x6946('0x17')][_0x6946('0x16')]);}})['catch'](function(_0x52f083){logger[_0x6946('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xc51407,_0x52f083);_0x405995(_0x52f083);});});} \ No newline at end of file +var _0xd956=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x5448a0,_0x4b7e59){var _0x3c93e7=function(_0x307282){while(--_0x307282){_0x5448a0['push'](_0x5448a0['shift']());}};_0x3c93e7(++_0x4b7e59);}(_0xd956,0x182));var _0x6d95=function(_0x3fc3ef,_0x46c08f){_0x3fc3ef=_0x3fc3ef-0x0;var _0x59e8c9=_0xd956[_0x3fc3ef];return _0x59e8c9;};'use strict';var _=require(_0x6d95('0x0'));var util=require('util');var moment=require(_0x6d95('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d95('0x2'));var db=require(_0x6d95('0x3'))['db'];var utils=require(_0x6d95('0x4'));var logger=require(_0x6d95('0x5'))(_0x6d95('0x6'));var config=require(_0x6d95('0x7'));var jayson=require(_0x6d95('0x8'));var client=jayson['client'][_0x6d95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38aac4,_0x469648,_0xd2fa2f){return new BPromise(function(_0x2464c0,_0x2abd41){return client[_0x6d95('0xa')](_0x38aac4,_0xd2fa2f)[_0x6d95('0xb')](function(_0x825568){logger['info'](_0x6d95('0xc'),_0x469648,'request\x20sent');logger[_0x6d95('0xd')](_0x6d95('0xe'),_0x469648,_0x6d95('0xf'),JSON[_0x6d95('0x10')](_0x825568));if(_0x825568[_0x6d95('0x11')]){if(_0x825568[_0x6d95('0x11')][_0x6d95('0x12')]===0x1f4){logger[_0x6d95('0x11')](_0x6d95('0xc'),_0x469648,_0x825568[_0x6d95('0x11')]['message']);return _0x2abd41(_0x825568[_0x6d95('0x11')][_0x6d95('0x13')]);}logger[_0x6d95('0x11')](_0x6d95('0xc'),_0x469648,_0x825568[_0x6d95('0x11')]['message']);return _0x2464c0(_0x825568['error']['message']);}else{logger[_0x6d95('0x14')](_0x6d95('0xc'),_0x469648,_0x6d95('0xf'));_0x2464c0(_0x825568[_0x6d95('0x15')][_0x6d95('0x13')]);}})[_0x6d95('0x16')](function(_0xfa0dd8){logger[_0x6d95('0x11')](_0x6d95('0xc'),_0x469648,_0xfa0dd8);_0x2abd41(_0xfa0dd8);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index d93f96c..8750001 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 _0x3958=['../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2544e1,_0x239612){var _0x33f958=function(_0x39ce75){while(--_0x39ce75){_0x2544e1['push'](_0x2544e1['shift']());}};_0x33f958(++_0x239612);}(_0x3958,0x7b));var _0x8395=function(_0x5a9527,_0x57a3d4){_0x5a9527=_0x5a9527-0x0;var _0x24c159=_0x3958[_0x5a9527];return _0x24c159;};'use strict';var multer=require('multer');var util=require(_0x8395('0x0'));var path=require(_0x8395('0x1'));var timeout=require(_0x8395('0x2'));var express=require(_0x8395('0x3'));var router=express[_0x8395('0x4')]();var fs_extra=require(_0x8395('0x5'));var auth=require(_0x8395('0x6'));var interaction=require(_0x8395('0x7'));var config=require('../../config/environment');var controller=require(_0x8395('0x8'));router[_0x8395('0x9')]('/',auth['isAuthenticated'](),controller[_0x8395('0xa')]);router['get'](_0x8395('0xb'),auth[_0x8395('0xc')](),controller[_0x8395('0xd')]);router['get'](_0x8395('0xe'),auth[_0x8395('0xc')](),controller[_0x8395('0xf')]);router['get'](_0x8395('0x10'),auth['isAuthenticated'](),controller[_0x8395('0x11')]);router[_0x8395('0x9')](_0x8395('0x12'),auth['isAuthenticated'](),controller[_0x8395('0x13')]);router[_0x8395('0x14')]('/',auth['isAuthenticated'](),controller[_0x8395('0x15')]);router[_0x8395('0x16')](_0x8395('0xb'),auth[_0x8395('0xc')](),controller[_0x8395('0x17')]);router[_0x8395('0x18')]('/:id',auth[_0x8395('0xc')](),controller['destroy']);module[_0x8395('0x19')]=router; \ No newline at end of file +var _0x77f1=['delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x77f1,0x13e));var _0x177f=function(_0x20f16e,_0x4f661f){_0x20f16e=_0x20f16e-0x0;var _0xa32be4=_0x77f1[_0x20f16e];return _0xa32be4;};'use strict';var multer=require('multer');var util=require(_0x177f('0x0'));var path=require('path');var timeout=require(_0x177f('0x1'));var express=require('express');var router=express[_0x177f('0x2')]();var fs_extra=require(_0x177f('0x3'));var auth=require(_0x177f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x177f('0x5')](),controller[_0x177f('0x6')]);router[_0x177f('0x7')](_0x177f('0x8'),auth[_0x177f('0x5')](),controller[_0x177f('0x9')]);router[_0x177f('0x7')](_0x177f('0xa'),auth[_0x177f('0x5')](),controller[_0x177f('0xb')]);router[_0x177f('0x7')](_0x177f('0xc'),auth[_0x177f('0x5')](),controller[_0x177f('0xd')]);router[_0x177f('0x7')](_0x177f('0xe'),auth['isAuthenticated'](),controller[_0x177f('0xf')]);router['post']('/',auth[_0x177f('0x5')](),controller[_0x177f('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x177f('0x11')]);router[_0x177f('0x12')](_0x177f('0x8'),auth[_0x177f('0x5')](),controller[_0x177f('0x13')]);module[_0x177f('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index d311f79..c924389 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 _0xde82=['DATE','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','csv','pdf'];(function(_0x4a881e,_0x534433){var _0x26929f=function(_0xe746c4){while(--_0xe746c4){_0x4a881e['push'](_0x4a881e['shift']());}};_0x26929f(++_0x534433);}(_0xde82,0x176));var _0x2de8=function(_0x396670,_0x23fed3){_0x396670=_0x396670-0x0;var _0x2a28f3=_0xde82[_0x396670];return _0x2a28f3;};'use strict';var Sequelize=require(_0x2de8('0x0'));var moment=require(_0x2de8('0x1'));module[_0x2de8('0x2')]={'name':{'type':Sequelize[_0x2de8('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x2de8('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x2de8('0x4'),_0x2de8('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x2de8('0x4')},'savename':{'type':Sequelize[_0x2de8('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2de8('0x6')]},'endDate':{'type':Sequelize[_0x2de8('0x6')]},'status':{'type':Sequelize[_0x2de8('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x2de8('0x7'),_0x2de8('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x2de8('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x2de8('0x3')]}}; \ No newline at end of file +var _0x0743=['UNSIGNED','sequelize','moment','STRING','ENUM','csv','DATE','Loading','manual','INTEGER'];(function(_0x536c66,_0x570b6b){var _0x221d57=function(_0x34af51){while(--_0x34af51){_0x536c66['push'](_0x536c66['shift']());}};_0x221d57(++_0x570b6b);}(_0x0743,0x173));var _0x3074=function(_0x43cd49,_0x5e851b){_0x43cd49=_0x43cd49-0x0;var _0x21c57a=_0x0743[_0x43cd49];return _0x21c57a;};'use strict';var Sequelize=require(_0x3074('0x0'));var moment=require(_0x3074('0x1'));module['exports']={'name':{'type':Sequelize[_0x3074('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3074('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3074('0x3')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x3074('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x3074('0x5')]},'endDate':{'type':Sequelize[_0x3074('0x5')]},'status':{'type':Sequelize[_0x3074('0x2')],'defaultValue':_0x3074('0x6')},'type':{'type':Sequelize[_0x3074('0x3')](_0x3074('0x7'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x3074('0x8')](0xb)[_0x3074('0x9')]},'reportType':{'type':Sequelize[_0x3074('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 963265f..49aafe9 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 _0xf61f=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','toLowerCase','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x2df821,_0x12c725){var _0x487ea1=function(_0x2bf649){while(--_0x2bf649){_0x2df821['push'](_0x2df821['shift']());}};_0x487ea1(++_0x12c725);}(_0xf61f,0x103));var _0xff61=function(_0x391df0,_0x51b2dc){_0x391df0=_0x391df0-0x0;var _0x30bec6=_0xf61f[_0x391df0];return _0x30bec6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xff61('0x0'));var jsonpatch=require(_0xff61('0x1'));var rp=require('request-promise');var moment=require(_0xff61('0x2'));var BPromise=require(_0xff61('0x3'));var Mustache=require(_0xff61('0x4'));var util=require(_0xff61('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xff61('0x6'));var ejs=require(_0xff61('0x7'));var fs=require('fs');var fs_extra=require(_0xff61('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xff61('0x9'));var jsforce=require(_0xff61('0xa'));var deskjs=require(_0xff61('0xb'));var toCsv=require(_0xff61('0x6'));var querystring=require(_0xff61('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xff61('0xd'));var qs=require(_0xff61('0xe'));var as=require(_0xff61('0xf'));var hardwareService=require(_0xff61('0x10'));var logger=require(_0xff61('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xff61('0x12'));var db=require(_0xff61('0x13'))['db'];function respondWithStatusCode(_0x3d2ade,_0x2e0db7){_0x2e0db7=_0x2e0db7||0xcc;return function(_0x59f565){if(_0x59f565){return _0x3d2ade[_0xff61('0x14')](_0x2e0db7);}return _0x3d2ade[_0xff61('0x15')](_0x2e0db7)[_0xff61('0x16')]();};}function respondWithResult(_0x250020,_0x423e47){_0x423e47=_0x423e47||0xc8;return function(_0x412724){if(_0x412724){return _0x250020['status'](_0x423e47)[_0xff61('0x17')](_0x412724);}};}function respondWithFilteredResult(_0x27f6f6,_0x3cab09){return function(_0x17c3de){if(_0x17c3de){var _0x213cb8=typeof _0x3cab09[_0xff61('0x18')]===_0xff61('0x19')&&typeof _0x3cab09[_0xff61('0x1a')]==='undefined';var _0x26362a=_0x17c3de[_0xff61('0x1b')];var _0x3dda91=_0x213cb8?0x0:_0x3cab09[_0xff61('0x18')];var _0x545f61=_0x213cb8?_0x17c3de[_0xff61('0x1b')]:_0x3cab09[_0xff61('0x18')]+_0x3cab09['limit'];var _0x17e8f0;if(_0x545f61>=_0x26362a){_0x545f61=_0x26362a;_0x17e8f0=0xc8;}else{_0x17e8f0=0xce;}_0x27f6f6[_0xff61('0x15')](_0x17e8f0);return _0x27f6f6[_0xff61('0x1c')]('Content-Range',_0x3dda91+'-'+_0x545f61+'/'+_0x26362a)[_0xff61('0x17')](_0x17c3de);}return null;};}function patchUpdates(_0x492480){return function(_0x386577){try{jsonpatch[_0xff61('0x1d')](_0x386577,_0x492480,!![]);}catch(_0x40175e){return BPromise[_0xff61('0x1e')](_0x40175e);}return _0x386577['save']();};}function saveUpdates(_0x28099b,_0x2c06a6){return function(_0x2f1ae5){if(_0x2f1ae5){return _0x2f1ae5[_0xff61('0x1f')](_0x28099b)[_0xff61('0x20')](function(_0x5b2704){return _0x5b2704;});}return null;};}function removeEntity(_0x3c2209,_0x3c9240){return function(_0x2ab736){if(_0x2ab736){return _0x2ab736['destroy']()[_0xff61('0x20')](function(){var _0x3605f2=_0x2ab736['get']({'plain':!![]});var _0x143a83=_0xff61('0x21');return db[_0xff61('0x22')][_0xff61('0x23')]({'where':{'type':_0x143a83,'resourceId':_0x3605f2['id']}})['then'](function(){return _0x2ab736;});})['then'](function(){_0x3c2209[_0xff61('0x15')](0xcc)[_0xff61('0x16')]();});}};}function handleEntityNotFound(_0x1fc581,_0xa6dba6){return function(_0x161eeb){if(!_0x161eeb){_0x1fc581[_0xff61('0x14')](0x194);}return _0x161eeb;};}function handleError(_0x2579ba,_0x1fd8af){_0x1fd8af=_0x1fd8af||0x1f4;return function(_0x2aed73){logger['error'](_0x2aed73[_0xff61('0x24')]);if(_0x2aed73[_0xff61('0x25')]){delete _0x2aed73['name'];}_0x2579ba[_0xff61('0x15')](_0x1fd8af)[_0xff61('0x26')](_0x2aed73);};}exports[_0xff61('0x27')]=function(_0x210961,_0x35b5da){var _0x4a75a2={},_0x5c35e0={},_0x206e4d={'count':0x0,'rows':[]};var _0x12ee4e=_[_0xff61('0x28')](db[_0xff61('0x29')][_0xff61('0x2a')],function(_0x196023){return{'name':_0x196023[_0xff61('0x2b')],'type':_0x196023[_0xff61('0x2c')][_0xff61('0x2d')]};});_0x5c35e0[_0xff61('0x2e')]=_[_0xff61('0x28')](_0x12ee4e,_0xff61('0x25'));_0x5c35e0[_0xff61('0x2f')]=_[_0xff61('0x30')](_0x210961[_0xff61('0x2f')]);_0x5c35e0[_0xff61('0x31')]=_[_0xff61('0x32')](_0x5c35e0[_0xff61('0x2e')],_0x5c35e0['query']);_0x4a75a2[_0xff61('0x33')]=_[_0xff61('0x32')](_0x5c35e0[_0xff61('0x2e')],qs['fields'](_0x210961[_0xff61('0x2f')][_0xff61('0x34')]));_0x4a75a2[_0xff61('0x33')]=_0x4a75a2['attributes'][_0xff61('0x35')]?_0x4a75a2[_0xff61('0x33')]:_0x5c35e0[_0xff61('0x2e')];if(!_0x210961[_0xff61('0x2f')][_0xff61('0x36')]('nolimit')){_0x4a75a2[_0xff61('0x1a')]=qs['limit'](_0x210961[_0xff61('0x2f')][_0xff61('0x1a')]);_0x4a75a2['offset']=qs[_0xff61('0x18')](_0x210961[_0xff61('0x2f')]['offset']);}_0x4a75a2[_0xff61('0x37')]=qs[_0xff61('0x38')](_0x210961[_0xff61('0x2f')][_0xff61('0x38')]);_0x4a75a2[_0xff61('0x39')]=qs[_0xff61('0x31')](_[_0xff61('0x3a')](_0x210961[_0xff61('0x2f')],_0x5c35e0['filters']),_0x12ee4e);if(_0x210961['query'][_0xff61('0x3b')]){_0x4a75a2[_0xff61('0x39')]=_[_0xff61('0x3c')](_0x4a75a2[_0xff61('0x39')],{'$or':_[_0xff61('0x28')](_0x12ee4e,function(_0xace7f0){if(_0xace7f0[_0xff61('0x2c')]!=='VIRTUAL'){var _0x383221={};_0x383221[_0xace7f0['name']]={'$like':'%'+_0x210961[_0xff61('0x2f')][_0xff61('0x3b')]+'%'};return _0x383221;}})});}_0x4a75a2=_[_0xff61('0x3c')]({},_0x4a75a2,_0x210961['options']);var _0x39bebd={'where':_0x4a75a2[_0xff61('0x39')]};return db[_0xff61('0x29')]['count'](_0x39bebd)['then'](function(_0x9a92be){_0x206e4d[_0xff61('0x1b')]=_0x9a92be;if(_0x210961[_0xff61('0x2f')][_0xff61('0x3d')]){_0x4a75a2[_0xff61('0x3e')]=[{'all':!![]}];}return db[_0xff61('0x29')][_0xff61('0x3f')](_0x4a75a2);})[_0xff61('0x20')](function(_0x4652b4){_0x206e4d[_0xff61('0x40')]=_0x4652b4;return _0x206e4d;})[_0xff61('0x20')](respondWithFilteredResult(_0x35b5da,_0x4a75a2))[_0xff61('0x41')](handleError(_0x35b5da,null));};exports[_0xff61('0x42')]=function(_0x35e2e9,_0xecc5ec){var _0x13ed72={'raw':!![],'where':{'id':_0x35e2e9[_0xff61('0x43')]['id']}},_0x2768f0={};_0x2768f0['model']=_['keys'](db[_0xff61('0x29')][_0xff61('0x2a')]);_0x2768f0['query']=_[_0xff61('0x30')](_0x35e2e9[_0xff61('0x2f')]);_0x2768f0[_0xff61('0x31')]=_[_0xff61('0x32')](_0x2768f0[_0xff61('0x2e')],_0x2768f0[_0xff61('0x2f')]);_0x13ed72['attributes']=_[_0xff61('0x32')](_0x2768f0[_0xff61('0x2e')],qs[_0xff61('0x34')](_0x35e2e9[_0xff61('0x2f')]['fields']));_0x13ed72['attributes']=_0x13ed72[_0xff61('0x33')][_0xff61('0x35')]?_0x13ed72['attributes']:_0x2768f0[_0xff61('0x2e')];if(_0x35e2e9[_0xff61('0x2f')][_0xff61('0x3d')]){_0x13ed72[_0xff61('0x3e')]=[{'all':!![]}];}_0x13ed72=_[_0xff61('0x3c')]({},_0x13ed72,_0x35e2e9[_0xff61('0x44')]);return db[_0xff61('0x29')]['find'](_0x13ed72)[_0xff61('0x20')](handleEntityNotFound(_0xecc5ec,null))['then'](respondWithResult(_0xecc5ec,null))['catch'](handleError(_0xecc5ec,null));};exports[_0xff61('0x45')]=function(_0x4058ab,_0x4c4d55){return db['AnalyticExtractedReport'][_0xff61('0x45')](_0x4058ab['body'],{})['then'](function(_0x43ce2e){var _0x5b4cc3=_0x4058ab[_0xff61('0x46')][_0xff61('0x47')]({'plain':!![]});if(!_0x5b4cc3)throw new Error(_0xff61('0x48'));if(_0x5b4cc3[_0xff61('0x49')]==='user'){var _0x2a1120=_0x43ce2e[_0xff61('0x47')]({'plain':!![]});var _0x42c430='ExtractedReports';return db[_0xff61('0x4a')][_0xff61('0x4b')]({'where':{'name':_0x42c430,'userProfileId':_0x5b4cc3['userProfileId']},'raw':!![]})[_0xff61('0x20')](function(_0x4e09fd){if(_0x4e09fd&&_0x4e09fd['autoAssociation']===0x0){return db[_0xff61('0x22')]['create']({'name':_0x2a1120[_0xff61('0x25')],'resourceId':_0x2a1120['id'],'type':_0x4e09fd[_0xff61('0x25')],'sectionId':_0x4e09fd['id']},{})[_0xff61('0x20')](function(){return _0x43ce2e;});}else{return _0x43ce2e;}})[_0xff61('0x41')](function(_0x453ef4){logger[_0xff61('0x4c')](_0xff61('0x4d'),_0x453ef4);throw _0x453ef4;});}return _0x43ce2e;})[_0xff61('0x20')](respondWithResult(_0x4c4d55,0xc9))[_0xff61('0x41')](handleError(_0x4c4d55,null));};exports[_0xff61('0x1f')]=function(_0x5f34e7,_0x1a9d48){if(_0x5f34e7[_0xff61('0x4e')]['id']){delete _0x5f34e7[_0xff61('0x4e')]['id'];}return db[_0xff61('0x29')]['find']({'where':{'id':_0x5f34e7[_0xff61('0x43')]['id']}})[_0xff61('0x20')](handleEntityNotFound(_0x1a9d48,null))[_0xff61('0x20')](saveUpdates(_0x5f34e7[_0xff61('0x4e')],null))[_0xff61('0x20')](respondWithResult(_0x1a9d48,null))[_0xff61('0x41')](handleError(_0x1a9d48,null));};exports[_0xff61('0x23')]=function(_0x4b7ef8,_0x1d99f4){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4b7ef8['params']['id']}})['then'](handleEntityNotFound(_0x1d99f4,null))[_0xff61('0x20')](removeEntity(_0x1d99f4,null))[_0xff61('0x41')](handleError(_0x1d99f4,null));};exports[_0xff61('0x4f')]=function(_0x1b5c53,_0x5cf4f6,_0x101752){return db[_0xff61('0x29')][_0xff61('0x4b')]({'where':{'id':_0x1b5c53[_0xff61('0x43')]['id']},'attributes':[_0xff61('0x25'),_0xff61('0x50'),_0xff61('0x51'),_0xff61('0x52')],'raw':!![]})[_0xff61('0x20')](handleEntityNotFound(_0x5cf4f6,null))[_0xff61('0x20')](function(_0x15d501){if(_0x15d501){if(!fs['existsSync'](path[_0xff61('0x53')](config[_0xff61('0x54')],_0xff61('0x55'),_0x15d501[_0xff61('0x51')]))){throw new db[(_0xff61('0x56'))][(_0xff61('0x57'))](_0xff61('0x58'));}if(_0x1b5c53[_0xff61('0x2f')]['exists']){return _0x5cf4f6[_0xff61('0x14')](0xc8);}return _0x5cf4f6[_0xff61('0x4f')](path[_0xff61('0x53')](config['root'],'server/files/reports',_0x15d501[_0xff61('0x51')]),util[_0xff61('0x59')]('%s.%s',_0x15d501[_0xff61('0x50')]||_0x15d501['name'],_0x15d501[_0xff61('0x52')][_0xff61('0x5a')]()));}})[_0xff61('0x41')](handleError(_0x5cf4f6,null));}; \ No newline at end of file +var _0x172d=['filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','output','existsSync','join','server/files/reports','Sequelize','exists','download','root','savename','format','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x4d212c,_0xdcd75){var _0x54618f=function(_0xb1b710){while(--_0xb1b710){_0x4d212c['push'](_0x4d212c['shift']());}};_0x54618f(++_0xdcd75);}(_0x172d,0x88));var _0xd172=function(_0x4559ad,_0x2eba0c){_0x4559ad=_0x4559ad-0x0;var _0x392de1=_0x172d[_0x4559ad];return _0x392de1;};'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('request-promise');var moment=require(_0xd172('0x4'));var BPromise=require(_0xd172('0x5'));var Mustache=require('mustache');var util=require(_0xd172('0x6'));var path=require(_0xd172('0x7'));var sox=require('sox');var csv=require(_0xd172('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd172('0x9'));var _=require('lodash');var squel=require(_0xd172('0xa'));var crypto=require(_0xd172('0xb'));var jsforce=require(_0xd172('0xc'));var deskjs=require(_0xd172('0xd'));var toCsv=require(_0xd172('0x8'));var querystring=require(_0xd172('0xe'));var Papa=require(_0xd172('0xf'));var Redis=require(_0xd172('0x10'));var authService=require(_0xd172('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd172('0x12'));var hardwareService=require(_0xd172('0x13'));var logger=require(_0xd172('0x14'))(_0xd172('0x15'));var utils=require(_0xd172('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd172('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461ae1,_0x47b9c7){_0x47b9c7=_0x47b9c7||0xcc;return function(_0x322879){if(_0x322879){return _0x461ae1[_0xd172('0x18')](_0x47b9c7);}return _0x461ae1['status'](_0x47b9c7)[_0xd172('0x19')]();};}function respondWithResult(_0x45cb8a,_0x18dfec){_0x18dfec=_0x18dfec||0xc8;return function(_0x736fd0){if(_0x736fd0){return _0x45cb8a['status'](_0x18dfec)[_0xd172('0x1a')](_0x736fd0);}};}function respondWithFilteredResult(_0x24a896,_0x4d6d38){return function(_0x26953f){if(_0x26953f){var _0x1b9348=typeof _0x4d6d38[_0xd172('0x1b')]==='undefined'&&typeof _0x4d6d38[_0xd172('0x1c')]===_0xd172('0x1d');var _0x5b4a07=_0x26953f[_0xd172('0x1e')];var _0x55ebb4=_0x1b9348?0x0:_0x4d6d38['offset'];var _0x18fee4=_0x1b9348?_0x26953f[_0xd172('0x1e')]:_0x4d6d38['offset']+_0x4d6d38['limit'];var _0x349966;if(_0x18fee4>=_0x5b4a07){_0x18fee4=_0x5b4a07;_0x349966=0xc8;}else{_0x349966=0xce;}_0x24a896[_0xd172('0x1f')](_0x349966);return _0x24a896[_0xd172('0x20')]('Content-Range',_0x55ebb4+'-'+_0x18fee4+'/'+_0x5b4a07)[_0xd172('0x1a')](_0x26953f);}return null;};}function patchUpdates(_0x267b9d){return function(_0x3700b0){try{jsonpatch['apply'](_0x3700b0,_0x267b9d,!![]);}catch(_0x57f0f3){return BPromise[_0xd172('0x21')](_0x57f0f3);}return _0x3700b0[_0xd172('0x22')]();};}function saveUpdates(_0x14f21c,_0x4fc530){return function(_0x272bb5){if(_0x272bb5){return _0x272bb5[_0xd172('0x23')](_0x14f21c)[_0xd172('0x24')](function(_0x4ac6fd){return _0x4ac6fd;});}return null;};}function removeEntity(_0x3d2258,_0x1c8b4b){return function(_0x1cfb81){if(_0x1cfb81){return _0x1cfb81['destroy']()[_0xd172('0x24')](function(){var _0x2354df=_0x1cfb81[_0xd172('0x25')]({'plain':!![]});var _0x2697d9='ExtractedReports';return db[_0xd172('0x26')][_0xd172('0x27')]({'where':{'type':_0x2697d9,'resourceId':_0x2354df['id']}})['then'](function(){return _0x1cfb81;});})[_0xd172('0x24')](function(){_0x3d2258[_0xd172('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x510f98,_0x5eefa4){return function(_0x4a9a62){if(!_0x4a9a62){_0x510f98[_0xd172('0x18')](0x194);}return _0x4a9a62;};}function handleError(_0x53f01b,_0x348c15){_0x348c15=_0x348c15||0x1f4;return function(_0x5d0986){logger[_0xd172('0x28')](_0x5d0986[_0xd172('0x29')]);if(_0x5d0986[_0xd172('0x2a')]){delete _0x5d0986[_0xd172('0x2a')];}_0x53f01b[_0xd172('0x1f')](_0x348c15)['send'](_0x5d0986);};}exports[_0xd172('0x2b')]=function(_0x3342ef,_0x2adb6e){var _0x15c40b={},_0x5c4d6a={},_0x528317={'count':0x0,'rows':[]};var _0x22d7c9=_['map'](db[_0xd172('0x2c')][_0xd172('0x2d')],function(_0xc45fc4){return{'name':_0xc45fc4[_0xd172('0x2e')],'type':_0xc45fc4[_0xd172('0x2f')][_0xd172('0x30')]};});_0x5c4d6a[_0xd172('0x31')]=_['map'](_0x22d7c9,'name');_0x5c4d6a[_0xd172('0x32')]=_[_0xd172('0x33')](_0x3342ef[_0xd172('0x32')]);_0x5c4d6a[_0xd172('0x34')]=_[_0xd172('0x35')](_0x5c4d6a[_0xd172('0x31')],_0x5c4d6a['query']);_0x15c40b['attributes']=_[_0xd172('0x35')](_0x5c4d6a['model'],qs[_0xd172('0x36')](_0x3342ef['query'][_0xd172('0x36')]));_0x15c40b[_0xd172('0x37')]=_0x15c40b[_0xd172('0x37')][_0xd172('0x38')]?_0x15c40b[_0xd172('0x37')]:_0x5c4d6a[_0xd172('0x31')];if(!_0x3342ef[_0xd172('0x32')]['hasOwnProperty'](_0xd172('0x39'))){_0x15c40b[_0xd172('0x1c')]=qs[_0xd172('0x1c')](_0x3342ef[_0xd172('0x32')][_0xd172('0x1c')]);_0x15c40b[_0xd172('0x1b')]=qs[_0xd172('0x1b')](_0x3342ef[_0xd172('0x32')][_0xd172('0x1b')]);}_0x15c40b[_0xd172('0x3a')]=qs['sort'](_0x3342ef[_0xd172('0x32')][_0xd172('0x3b')]);_0x15c40b[_0xd172('0x3c')]=qs['filters'](_[_0xd172('0x3d')](_0x3342ef[_0xd172('0x32')],_0x5c4d6a['filters']),_0x22d7c9);if(_0x3342ef['query'][_0xd172('0x3e')]){_0x15c40b[_0xd172('0x3c')]=_[_0xd172('0x3f')](_0x15c40b[_0xd172('0x3c')],{'$or':_[_0xd172('0x40')](_0x22d7c9,function(_0x5c102f){if(_0x5c102f[_0xd172('0x2f')]!==_0xd172('0x41')){var _0x106504={};_0x106504[_0x5c102f[_0xd172('0x2a')]]={'$like':'%'+_0x3342ef['query'][_0xd172('0x3e')]+'%'};return _0x106504;}})});}_0x15c40b=_[_0xd172('0x3f')]({},_0x15c40b,_0x3342ef[_0xd172('0x42')]);var _0x261f1f={'where':_0x15c40b[_0xd172('0x3c')]};return db['AnalyticExtractedReport']['count'](_0x261f1f)[_0xd172('0x24')](function(_0x5de1d5){_0x528317['count']=_0x5de1d5;if(_0x3342ef['query'][_0xd172('0x43')]){_0x15c40b[_0xd172('0x44')]=[{'all':!![]}];}return db[_0xd172('0x2c')][_0xd172('0x45')](_0x15c40b);})['then'](function(_0x2b1f86){_0x528317[_0xd172('0x46')]=_0x2b1f86;return _0x528317;})[_0xd172('0x24')](respondWithFilteredResult(_0x2adb6e,_0x15c40b))[_0xd172('0x47')](handleError(_0x2adb6e,null));};exports[_0xd172('0x48')]=function(_0x5a5704,_0x21ddbe){var _0x40bc1f={'raw':!![],'where':{'id':_0x5a5704[_0xd172('0x49')]['id']}},_0x2f5c25={};_0x2f5c25[_0xd172('0x31')]=_[_0xd172('0x33')](db[_0xd172('0x2c')][_0xd172('0x2d')]);_0x2f5c25[_0xd172('0x32')]=_[_0xd172('0x33')](_0x5a5704[_0xd172('0x32')]);_0x2f5c25[_0xd172('0x34')]=_[_0xd172('0x35')](_0x2f5c25[_0xd172('0x31')],_0x2f5c25[_0xd172('0x32')]);_0x40bc1f[_0xd172('0x37')]=_[_0xd172('0x35')](_0x2f5c25[_0xd172('0x31')],qs['fields'](_0x5a5704[_0xd172('0x32')][_0xd172('0x36')]));_0x40bc1f[_0xd172('0x37')]=_0x40bc1f[_0xd172('0x37')]['length']?_0x40bc1f[_0xd172('0x37')]:_0x2f5c25['model'];if(_0x5a5704['query'][_0xd172('0x43')]){_0x40bc1f['include']=[{'all':!![]}];}_0x40bc1f=_['merge']({},_0x40bc1f,_0x5a5704[_0xd172('0x42')]);return db[_0xd172('0x2c')][_0xd172('0x4a')](_0x40bc1f)[_0xd172('0x24')](handleEntityNotFound(_0x21ddbe,null))[_0xd172('0x24')](respondWithResult(_0x21ddbe,null))['catch'](handleError(_0x21ddbe,null));};exports[_0xd172('0x4b')]=function(_0x4dbda8,_0x3bde7b){return db['AnalyticExtractedReport']['create'](_0x4dbda8['body'],{})[_0xd172('0x24')](function(_0x446add){var _0x4576b6=_0x4dbda8[_0xd172('0x4c')][_0xd172('0x25')]({'plain':!![]});if(!_0x4576b6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4576b6[_0xd172('0x4d')]===_0xd172('0x4c')){var _0x2df4e9=_0x446add[_0xd172('0x25')]({'plain':!![]});var _0x336b3a='ExtractedReports';return db['UserProfileSection'][_0xd172('0x4a')]({'where':{'name':_0x336b3a,'userProfileId':_0x4576b6[_0xd172('0x4e')]},'raw':!![]})[_0xd172('0x24')](function(_0x36628b){if(_0x36628b&&_0x36628b[_0xd172('0x4f')]===0x0){return db[_0xd172('0x26')][_0xd172('0x4b')]({'name':_0x2df4e9['name'],'resourceId':_0x2df4e9['id'],'type':_0x36628b[_0xd172('0x2a')],'sectionId':_0x36628b['id']},{})[_0xd172('0x24')](function(){return _0x446add;});}else{return _0x446add;}})['catch'](function(_0x26e1c6){logger[_0xd172('0x28')](_0xd172('0x50'),_0x26e1c6);throw _0x26e1c6;});}return _0x446add;})[_0xd172('0x24')](respondWithResult(_0x3bde7b,0xc9))[_0xd172('0x47')](handleError(_0x3bde7b,null));};exports['update']=function(_0x33bbe5,_0x5c2890){if(_0x33bbe5[_0xd172('0x51')]['id']){delete _0x33bbe5[_0xd172('0x51')]['id'];}return db[_0xd172('0x2c')][_0xd172('0x4a')]({'where':{'id':_0x33bbe5['params']['id']}})[_0xd172('0x24')](handleEntityNotFound(_0x5c2890,null))[_0xd172('0x24')](saveUpdates(_0x33bbe5[_0xd172('0x51')],null))[_0xd172('0x24')](respondWithResult(_0x5c2890,null))[_0xd172('0x47')](handleError(_0x5c2890,null));};exports['destroy']=function(_0x33353e,_0x10be80){return db[_0xd172('0x2c')][_0xd172('0x4a')]({'where':{'id':_0x33353e[_0xd172('0x49')]['id']}})[_0xd172('0x24')](handleEntityNotFound(_0x10be80,null))[_0xd172('0x24')](removeEntity(_0x10be80,null))[_0xd172('0x47')](handleError(_0x10be80,null));};exports['download']=function(_0x4e7e8c,_0x4399d4,_0x162c5d){return db[_0xd172('0x2c')]['find']({'where':{'id':_0x4e7e8c[_0xd172('0x49')]['id']},'attributes':[_0xd172('0x2a'),'basename','savename',_0xd172('0x52')],'raw':!![]})[_0xd172('0x24')](handleEntityNotFound(_0x4399d4,null))[_0xd172('0x24')](function(_0x57b92c){if(_0x57b92c){if(!fs[_0xd172('0x53')](path[_0xd172('0x54')](config['root'],_0xd172('0x55'),_0x57b92c['savename']))){throw new db[(_0xd172('0x56'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x4e7e8c[_0xd172('0x32')][_0xd172('0x57')]){return _0x4399d4['sendStatus'](0xc8);}return _0x4399d4[_0xd172('0x58')](path[_0xd172('0x54')](config[_0xd172('0x59')],_0xd172('0x55'),_0x57b92c[_0xd172('0x5a')]),util[_0xd172('0x5b')]('%s.%s',_0x57b92c[_0xd172('0x5c')]||_0x57b92c['name'],_0x57b92c[_0xd172('0x52')][_0xd172('0x5d')]()));}})[_0xd172('0x47')](handleError(_0x4399d4,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index ce8e675..b4761cc 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 _0xa763=['moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x233f29,_0x34d890){var _0x5768ce=function(_0x2a116e){while(--_0x2a116e){_0x233f29['push'](_0x233f29['shift']());}};_0x5768ce(++_0x34d890);}(_0xa763,0x134));var _0x3a76=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xa763[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0x3a76('0x0'));var util=require(_0x3a76('0x1'));var logger=require(_0x3a76('0x2'))(_0x3a76('0x3'));var moment=require(_0x3a76('0x4'));var BPromise=require(_0x3a76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a76('0x6'));var rimraf=require('rimraf');var config=require(_0x3a76('0x7'));var attributes=require(_0x3a76('0x8'));module[_0x3a76('0x9')]=function(_0x1dcff9,_0x5eb47d){return _0x1dcff9[_0x3a76('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x3a76('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfae9=['request-promise','rimraf','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','moment'];(function(_0xd81b5b,_0x15f6a7){var _0x52ffd9=function(_0x5571ea){while(--_0x5571ea){_0xd81b5b['push'](_0xd81b5b['shift']());}};_0x52ffd9(++_0x15f6a7);}(_0xfae9,0xf9));var _0x9fae=function(_0xfb41d,_0x32740c){_0xfb41d=_0xfb41d-0x0;var _0x246945=_0xfae9[_0xfb41d];return _0x246945;};'use strict';var _=require('lodash');var util=require(_0x9fae('0x0'));var logger=require(_0x9fae('0x1'))('api');var moment=require(_0x9fae('0x2'));var BPromise=require('bluebird');var rp=require(_0x9fae('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fae('0x4'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x41370b,_0x4129cd){return _0x41370b['define'](_0x9fae('0x5'),attributes,{'tableName':_0x9fae('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index d273911..d91c5a4 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 _0xebf5=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x1551ed,_0x5cc3ce){var _0x499928=function(_0x41b8d5){while(--_0x41b8d5){_0x1551ed['push'](_0x1551ed['shift']());}};_0x499928(++_0x5cc3ce);}(_0xebf5,0x1ab));var _0x5ebf=function(_0x4f4b55,_0x31cbd6){_0x4f4b55=_0x4f4b55-0x0;var _0x36fbf9=_0xebf5[_0x4f4b55];return _0x36fbf9;};'use strict';var _=require(_0x5ebf('0x0'));var util=require(_0x5ebf('0x1'));var moment=require(_0x5ebf('0x2'));var BPromise=require(_0x5ebf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ebf('0x4'))['db'];var utils=require(_0x5ebf('0x5'));var logger=require(_0x5ebf('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5ebf('0x7'));var client=jayson[_0x5ebf('0x8')][_0x5ebf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x199a95,_0x19b334,_0x5b7dbd){return new BPromise(function(_0xc63519,_0x2b6691){return client[_0x5ebf('0xa')](_0x199a95,_0x5b7dbd)[_0x5ebf('0xb')](function(_0x1dbb55){logger[_0x5ebf('0xc')](_0x5ebf('0xd'),_0x19b334,_0x5ebf('0xe'));logger['debug'](_0x5ebf('0xf'),_0x19b334,'request\x20sent',JSON[_0x5ebf('0x10')](_0x1dbb55));if(_0x1dbb55[_0x5ebf('0x11')]){if(_0x1dbb55[_0x5ebf('0x11')][_0x5ebf('0x12')]===0x1f4){logger[_0x5ebf('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x19b334,_0x1dbb55[_0x5ebf('0x11')][_0x5ebf('0x13')]);return _0x2b6691(_0x1dbb55['error']['message']);}logger[_0x5ebf('0x11')](_0x5ebf('0xd'),_0x19b334,_0x1dbb55['error'][_0x5ebf('0x13')]);return _0xc63519(_0x1dbb55[_0x5ebf('0x11')][_0x5ebf('0x13')]);}else{logger[_0x5ebf('0xc')](_0x5ebf('0xd'),_0x19b334,'request\x20sent');_0xc63519(_0x1dbb55[_0x5ebf('0x14')][_0x5ebf('0x13')]);}})[_0x5ebf('0x15')](function(_0x394a13){logger[_0x5ebf('0x11')](_0x5ebf('0xd'),_0x19b334,_0x394a13);_0x2b6691(_0x394a13);});});} \ No newline at end of file +var _0xdcec=['then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xdcec,0xf2));var _0xcdce=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0xdcec[_0x5ecadc];return _0x565037;};'use strict';var _=require('lodash');var util=require(_0xcdce('0x0'));var moment=require(_0xcdce('0x1'));var BPromise=require(_0xcdce('0x2'));var rs=require(_0xcdce('0x3'));var fs=require('fs');var Redis=require(_0xcdce('0x4'));var db=require(_0xcdce('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcdce('0x6'));var config=require(_0xcdce('0x7'));var jayson=require(_0xcdce('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x475aed,_0x321f2f,_0xe97d13){return new BPromise(function(_0x1c582f,_0x16f148){return client[_0xcdce('0x9')](_0x475aed,_0xe97d13)[_0xcdce('0xa')](function(_0xb1c86b){logger['info'](_0xcdce('0xb'),_0x321f2f,_0xcdce('0xc'));logger[_0xcdce('0xd')](_0xcdce('0xe'),_0x321f2f,_0xcdce('0xc'),JSON[_0xcdce('0xf')](_0xb1c86b));if(_0xb1c86b[_0xcdce('0x10')]){if(_0xb1c86b['error'][_0xcdce('0x11')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x321f2f,_0xb1c86b[_0xcdce('0x10')]['message']);return _0x16f148(_0xb1c86b[_0xcdce('0x10')][_0xcdce('0x12')]);}logger[_0xcdce('0x10')](_0xcdce('0xb'),_0x321f2f,_0xb1c86b[_0xcdce('0x10')][_0xcdce('0x12')]);return _0x1c582f(_0xb1c86b['error']['message']);}else{logger[_0xcdce('0x13')](_0xcdce('0xb'),_0x321f2f,_0xcdce('0xc'));_0x1c582f(_0xb1c86b['result']['message']);}})[_0xcdce('0x14')](function(_0x22c10f){logger[_0xcdce('0x10')](_0xcdce('0xb'),_0x321f2f,_0x22c10f);_0x16f148(_0x22c10f);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b8e509c..2e1f114 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 _0x8f15=['util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','create','put','update','delete','destroy','exports'];(function(_0x43daa8,_0x2b964e){var _0x42a182=function(_0x16a94b){while(--_0x16a94b){_0x43daa8['push'](_0x43daa8['shift']());}};_0x42a182(++_0x2b964e);}(_0x8f15,0x1c2));var _0x58f1=function(_0x42cdc8,_0x3be788){_0x42cdc8=_0x42cdc8-0x0;var _0x50310e=_0x8f15[_0x42cdc8];return _0x50310e;};'use strict';var multer=require('multer');var util=require(_0x58f1('0x0'));var path=require(_0x58f1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x58f1('0x2'));var interaction=require(_0x58f1('0x3'));var config=require(_0x58f1('0x4'));var controller=require(_0x58f1('0x5'));router[_0x58f1('0x6')]('/',auth[_0x58f1('0x7')](),controller[_0x58f1('0x8')]);router[_0x58f1('0x6')](_0x58f1('0x9'),auth[_0x58f1('0x7')](),controller[_0x58f1('0xa')]);router[_0x58f1('0x6')](_0x58f1('0xb'),auth[_0x58f1('0x7')](),controller['download']);router['post']('/',auth[_0x58f1('0x7')](),controller[_0x58f1('0xc')]);router[_0x58f1('0xd')](_0x58f1('0x9'),auth[_0x58f1('0x7')](),controller[_0x58f1('0xe')]);router[_0x58f1('0xf')](_0x58f1('0x9'),auth[_0x58f1('0x7')](),controller[_0x58f1('0x10')]);module[_0x58f1('0x11')]=router; \ No newline at end of file +var _0x4e79=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x4e79,0x1f2));var _0x94e7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4e79[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x94e7('0x0'));var util=require(_0x94e7('0x1'));var path=require(_0x94e7('0x2'));var timeout=require(_0x94e7('0x3'));var express=require('express');var router=express[_0x94e7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x94e7('0x5'));var interaction=require(_0x94e7('0x6'));var config=require('../../config/environment');var controller=require(_0x94e7('0x7'));router[_0x94e7('0x8')]('/',auth[_0x94e7('0x9')](),controller[_0x94e7('0xa')]);router[_0x94e7('0x8')](_0x94e7('0xb'),auth['isAuthenticated'](),controller[_0x94e7('0xc')]);router[_0x94e7('0x8')]('/:id/download',auth[_0x94e7('0x9')](),controller[_0x94e7('0xd')]);router['post']('/',auth[_0x94e7('0x9')](),controller[_0x94e7('0xe')]);router[_0x94e7('0xf')](_0x94e7('0xb'),auth[_0x94e7('0x9')](),controller[_0x94e7('0x10')]);router[_0x94e7('0x11')](_0x94e7('0xb'),auth[_0x94e7('0x9')](),controller[_0x94e7('0x12')]);module[_0x94e7('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 087adda..0f66045 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 _0xb7bd=['exports','STRING','BOOLEAN','sequelize'];(function(_0x28d019,_0x55d2c5){var _0x25d7f1=function(_0x2e4fd4){while(--_0x2e4fd4){_0x28d019['push'](_0x28d019['shift']());}};_0x25d7f1(++_0x55d2c5);}(_0xb7bd,0x7f));var _0xdb7b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb7bd[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xdb7b('0x0'));module[_0xdb7b('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdb7b('0x2')]},'function':{'type':Sequelize[_0xdb7b('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xdb7b('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xdb7b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6a7e=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x76c797,_0x6e6570){var _0x39a216=function(_0x51b64c){while(--_0x51b64c){_0x76c797['push'](_0x76c797['shift']());}};_0x39a216(++_0x6e6570);}(_0x6a7e,0x1cb));var _0xe6a7=function(_0x4cab15,_0x4418ba){_0x4cab15=_0x4cab15-0x0;var _0x20b49a=_0x6a7e[_0x4cab15];return _0x20b49a;};'use strict';var Sequelize=require(_0xe6a7('0x0'));module[_0xe6a7('0x1')]={'field':{'type':Sequelize[_0xe6a7('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xe6a7('0x3')]},'format':{'type':Sequelize[_0xe6a7('0x3')]},'groupBy':{'type':Sequelize[_0xe6a7('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe6a7('0x3')]},'custom':{'type':Sequelize[_0xe6a7('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 0314cec..23e1f5f 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 _0x948c=['attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filters','where','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','merge','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','save','update','destroy','then','error','name','index','map','AnalyticFieldReport','type','key','model','query','keys'];(function(_0x1629b5,_0x5737cd){var _0x1b1b66=function(_0x4962fd){while(--_0x4962fd){_0x1629b5['push'](_0x1629b5['shift']());}};_0x1b1b66(++_0x5737cd);}(_0x948c,0x1b3));var _0xc948=function(_0x1d38e0,_0x23dcaf){_0x1d38e0=_0x1d38e0-0x0;var _0x26e31b=_0x948c[_0x1d38e0];return _0x26e31b;};'use strict';var emlformat=require(_0xc948('0x0'));var rimraf=require(_0xc948('0x1'));var zipdir=require(_0xc948('0x2'));var jsonpatch=require(_0xc948('0x3'));var rp=require('request-promise');var moment=require(_0xc948('0x4'));var BPromise=require(_0xc948('0x5'));var Mustache=require('mustache');var util=require(_0xc948('0x6'));var path=require(_0xc948('0x7'));var sox=require(_0xc948('0x8'));var csv=require(_0xc948('0x9'));var ejs=require(_0xc948('0xa'));var fs=require('fs');var fs_extra=require(_0xc948('0xb'));var _=require(_0xc948('0xc'));var squel=require(_0xc948('0xd'));var crypto=require(_0xc948('0xe'));var jsforce=require(_0xc948('0xf'));var deskjs=require(_0xc948('0x10'));var toCsv=require(_0xc948('0x9'));var querystring=require(_0xc948('0x11'));var Papa=require(_0xc948('0x12'));var Redis=require(_0xc948('0x13'));var authService=require(_0xc948('0x14'));var qs=require(_0xc948('0x15'));var as=require(_0xc948('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc948('0x17'))(_0xc948('0x18'));var utils=require(_0xc948('0x19'));var config=require(_0xc948('0x1a'));var licenseUtil=require(_0xc948('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfc3aa6,_0x2335fb){_0x2335fb=_0x2335fb||0xcc;return function(_0x2c8b73){if(_0x2c8b73){return _0xfc3aa6[_0xc948('0x1c')](_0x2335fb);}return _0xfc3aa6[_0xc948('0x1d')](_0x2335fb)[_0xc948('0x1e')]();};}function respondWithResult(_0x480469,_0x3246de){_0x3246de=_0x3246de||0xc8;return function(_0x597264){if(_0x597264){return _0x480469['status'](_0x3246de)[_0xc948('0x1f')](_0x597264);}};}function respondWithFilteredResult(_0x923d3f,_0x3a2042){return function(_0x1efbe5){if(_0x1efbe5){var _0x4a1060=typeof _0x3a2042['offset']===_0xc948('0x20')&&typeof _0x3a2042['limit']===_0xc948('0x20');var _0xbd0e21=_0x1efbe5[_0xc948('0x21')];var _0x5c35fb=_0x4a1060?0x0:_0x3a2042[_0xc948('0x22')];var _0x327ddc=_0x4a1060?_0x1efbe5['count']:_0x3a2042[_0xc948('0x22')]+_0x3a2042['limit'];var _0x599524;if(_0x327ddc>=_0xbd0e21){_0x327ddc=_0xbd0e21;_0x599524=0xc8;}else{_0x599524=0xce;}_0x923d3f[_0xc948('0x1d')](_0x599524);return _0x923d3f['set'](_0xc948('0x23'),_0x5c35fb+'-'+_0x327ddc+'/'+_0xbd0e21)['json'](_0x1efbe5);}return null;};}function patchUpdates(_0x535ec2){return function(_0x1f462d){try{jsonpatch[_0xc948('0x24')](_0x1f462d,_0x535ec2,!![]);}catch(_0x5ce436){return BPromise['reject'](_0x5ce436);}return _0x1f462d[_0xc948('0x25')]();};}function saveUpdates(_0x3849f1,_0x392c79){return function(_0x1c19e4){if(_0x1c19e4){return _0x1c19e4[_0xc948('0x26')](_0x3849f1)['then'](function(_0x594908){return _0x594908;});}return null;};}function removeEntity(_0x57720f,_0x56a849){return function(_0x129a7f){if(_0x129a7f){return _0x129a7f[_0xc948('0x27')]()[_0xc948('0x28')](function(){_0x57720f[_0xc948('0x1d')](0xcc)[_0xc948('0x1e')]();});}};}function handleEntityNotFound(_0x24d798,_0x16d3cd){return function(_0x1f043f){if(!_0x1f043f){_0x24d798[_0xc948('0x1c')](0x194);}return _0x1f043f;};}function handleError(_0x2c4b34,_0x13147b){_0x13147b=_0x13147b||0x1f4;return function(_0x2b9371){logger[_0xc948('0x29')](_0x2b9371['stack']);if(_0x2b9371['name']){delete _0x2b9371[_0xc948('0x2a')];}_0x2c4b34[_0xc948('0x1d')](_0x13147b)['send'](_0x2b9371);};}exports[_0xc948('0x2b')]=function(_0x402b3a,_0x4861be){var _0x177046={},_0x1f095f={},_0x28721a={'count':0x0,'rows':[]};var _0x57b06c=_[_0xc948('0x2c')](db[_0xc948('0x2d')]['rawAttributes'],function(_0x46e31c){return{'name':_0x46e31c['fieldName'],'type':_0x46e31c[_0xc948('0x2e')][_0xc948('0x2f')]};});_0x1f095f[_0xc948('0x30')]=_['map'](_0x57b06c,_0xc948('0x2a'));_0x1f095f[_0xc948('0x31')]=_[_0xc948('0x32')](_0x402b3a[_0xc948('0x31')]);_0x1f095f['filters']=_['intersection'](_0x1f095f['model'],_0x1f095f[_0xc948('0x31')]);_0x177046[_0xc948('0x33')]=_['intersection'](_0x1f095f[_0xc948('0x30')],qs[_0xc948('0x34')](_0x402b3a['query'][_0xc948('0x34')]));_0x177046[_0xc948('0x33')]=_0x177046[_0xc948('0x33')][_0xc948('0x35')]?_0x177046[_0xc948('0x33')]:_0x1f095f[_0xc948('0x30')];if(!_0x402b3a[_0xc948('0x31')][_0xc948('0x36')](_0xc948('0x37'))){_0x177046[_0xc948('0x38')]=qs[_0xc948('0x38')](_0x402b3a[_0xc948('0x31')]['limit']);_0x177046[_0xc948('0x22')]=qs[_0xc948('0x22')](_0x402b3a[_0xc948('0x31')][_0xc948('0x22')]);}_0x177046['order']=qs[_0xc948('0x39')](_0x402b3a[_0xc948('0x31')]['sort']);_0x177046['where']=qs['filters'](_[_0xc948('0x3a')](_0x402b3a[_0xc948('0x31')],_0x1f095f[_0xc948('0x3b')]),_0x57b06c);if(_0x402b3a[_0xc948('0x31')]['filter']){_0x177046[_0xc948('0x3c')]=_['merge'](_0x177046[_0xc948('0x3c')],{'$or':_['map'](_0x57b06c,function(_0x1bdca1){if(_0x1bdca1[_0xc948('0x2e')]!=='VIRTUAL'){var _0x476630={};_0x476630[_0x1bdca1[_0xc948('0x2a')]]={'$like':'%'+_0x402b3a['query'][_0xc948('0x3d')]+'%'};return _0x476630;}})});}_0x177046=_['merge']({},_0x177046,_0x402b3a['options']);var _0x38c532={'where':_0x177046['where']};return db[_0xc948('0x2d')][_0xc948('0x21')](_0x38c532)[_0xc948('0x28')](function(_0x54f3bb){_0x28721a[_0xc948('0x21')]=_0x54f3bb;if(_0x402b3a[_0xc948('0x31')][_0xc948('0x3e')]){_0x177046[_0xc948('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xc948('0x40')](_0x177046);})[_0xc948('0x28')](function(_0x9f68d){_0x28721a[_0xc948('0x41')]=_0x9f68d;return _0x28721a;})['then'](respondWithFilteredResult(_0x4861be,_0x177046))[_0xc948('0x42')](handleError(_0x4861be,null));};exports['show']=function(_0x2954ac,_0x3641c2){var _0x3fedeb={'raw':![],'where':{'id':_0x2954ac[_0xc948('0x43')]['id']}},_0x269a09={};_0x269a09['model']=_['keys'](db[_0xc948('0x2d')][_0xc948('0x44')]);_0x269a09['query']=_[_0xc948('0x32')](_0x2954ac[_0xc948('0x31')]);_0x269a09[_0xc948('0x3b')]=_[_0xc948('0x45')](_0x269a09['model'],_0x269a09['query']);_0x3fedeb[_0xc948('0x33')]=_[_0xc948('0x45')](_0x269a09[_0xc948('0x30')],qs[_0xc948('0x34')](_0x2954ac['query']['fields']));_0x3fedeb[_0xc948('0x33')]=_0x3fedeb[_0xc948('0x33')][_0xc948('0x35')]?_0x3fedeb['attributes']:_0x269a09[_0xc948('0x30')];if(_0x2954ac[_0xc948('0x31')][_0xc948('0x3e')]){_0x3fedeb['include']=[{'all':!![]}];}_0x3fedeb=_[_0xc948('0x46')]({},_0x3fedeb,_0x2954ac['options']);return db[_0xc948('0x2d')][_0xc948('0x47')](_0x3fedeb)[_0xc948('0x28')](handleEntityNotFound(_0x3641c2,null))['then'](respondWithResult(_0x3641c2,null))[_0xc948('0x42')](handleError(_0x3641c2,null));};exports[_0xc948('0x48')]=function(_0x546066,_0x50ebd2){return db[_0xc948('0x2d')][_0xc948('0x48')](_0x546066['body'],{})[_0xc948('0x28')](respondWithResult(_0x50ebd2,0xc9))['catch'](handleError(_0x50ebd2,null));};exports[_0xc948('0x49')]=function(_0x1fc483,_0x2f8c8f){return db[_0xc948('0x2d')][_0xc948('0x49')](_0x1fc483[_0xc948('0x4a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2f8c8f,0xc9))[_0xc948('0x42')](handleError(_0x2f8c8f,null));};exports[_0xc948('0x26')]=function(_0x50e45c,_0x291c89){if(_0x50e45c[_0xc948('0x4a')]['id']){delete _0x50e45c[_0xc948('0x4a')]['id'];}return db[_0xc948('0x2d')]['find']({'where':{'id':_0x50e45c[_0xc948('0x43')]['id']}})[_0xc948('0x28')](handleEntityNotFound(_0x291c89,null))[_0xc948('0x28')](saveUpdates(_0x50e45c[_0xc948('0x4a')],null))[_0xc948('0x28')](respondWithResult(_0x291c89,null))[_0xc948('0x42')](handleError(_0x291c89,null));};exports['destroy']=function(_0x279e8c,_0x5c8d81){return db['AnalyticFieldReport'][_0xc948('0x47')]({'where':{'id':_0x279e8c['params']['id']}})[_0xc948('0x28')](handleEntityNotFound(_0x5c8d81,null))[_0xc948('0x28')](removeEntity(_0x5c8d81,null))[_0xc948('0x42')](handleError(_0x5c8d81,null));};exports[_0xc948('0x4b')]=function(_0x4157f7,_0x12249e){return db[_0xc948('0x2d')][_0xc948('0x27')]({'where':{'id':_0x4157f7[_0xc948('0x31')][_0xc948('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xc948('0x28')](respondWithResult(_0x12249e,0xcc))[_0xc948('0x42')](handleError(_0x12249e,null));};exports[_0xc948('0x4d')]=function(_0x22ee9d,_0x525be8,_0x4c12b3){return db[_0xc948('0x4e')]['findOne']({'where':{'id':_0x22ee9d[_0xc948('0x43')]['id']}})[_0xc948('0x28')](handleEntityNotFound(_0x525be8,null))[_0xc948('0x28')](function(_0x3ec21d){if(_0x3ec21d){return db['sequelize'][_0xc948('0x4f')](function(_0x15d7d7){return db[_0xc948('0x2d')][_0xc948('0x27')]({'where':{'CustomReportId':_0x22ee9d[_0xc948('0x43')]['id']},'transaction':_0x15d7d7})[_0xc948('0x28')](function(_0x40dd19){var _0x450bc0=_[_0xc948('0x2c')](_0x22ee9d[_0xc948('0x4a')],function(_0x4bfe41){delete _0x4bfe41['id'];_0x4bfe41[_0xc948('0x50')]=_0x22ee9d[_0xc948('0x43')]['id'];return _0x4bfe41;});return db[_0xc948('0x2d')][_0xc948('0x49')](_0x450bc0,{'transaction':_0x15d7d7});});})[_0xc948('0x28')](function(){return db[_0xc948('0x2d')][_0xc948('0x40')]({'where':{'CustomReportId':_0x22ee9d[_0xc948('0x43')]['id']}});});}})['then'](respondWithResult(_0x525be8,null))[_0xc948('0x42')](handleError(_0x525be8,null));}; \ No newline at end of file +var _0x2bbc=['sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','destroy','then','stack','name','send','index','map','AnalyticFieldReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x5a299c,_0x2b97e5){var _0x5d886e=function(_0x22d2f7){while(--_0x22d2f7){_0x5a299c['push'](_0x5a299c['shift']());}};_0x5d886e(++_0x2b97e5);}(_0x2bbc,0x100));var _0xc2bb=function(_0x3d3b6c,_0x26cee6){_0x3d3b6c=_0x3d3b6c-0x0;var _0x55cb2c=_0x2bbc[_0x3d3b6c];return _0x55cb2c;};'use strict';var emlformat=require(_0xc2bb('0x0'));var rimraf=require(_0xc2bb('0x1'));var zipdir=require(_0xc2bb('0x2'));var jsonpatch=require(_0xc2bb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc2bb('0x4'));var Mustache=require('mustache');var util=require(_0xc2bb('0x5'));var path=require(_0xc2bb('0x6'));var sox=require(_0xc2bb('0x7'));var csv=require('to-csv');var ejs=require(_0xc2bb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc2bb('0x9'));var crypto=require(_0xc2bb('0xa'));var jsforce=require(_0xc2bb('0xb'));var deskjs=require(_0xc2bb('0xc'));var toCsv=require(_0xc2bb('0xd'));var querystring=require('querystring');var Papa=require(_0xc2bb('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc2bb('0xf'));var as=require(_0xc2bb('0x10'));var hardwareService=require(_0xc2bb('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xc2bb('0x12'));var config=require(_0xc2bb('0x13'));var licenseUtil=require(_0xc2bb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20d09e,_0xbc2a84){_0xbc2a84=_0xbc2a84||0xcc;return function(_0x3a53b8){if(_0x3a53b8){return _0x20d09e[_0xc2bb('0x15')](_0xbc2a84);}return _0x20d09e[_0xc2bb('0x16')](_0xbc2a84)[_0xc2bb('0x17')]();};}function respondWithResult(_0x582fa1,_0x1ddd0e){_0x1ddd0e=_0x1ddd0e||0xc8;return function(_0x1a0159){if(_0x1a0159){return _0x582fa1['status'](_0x1ddd0e)[_0xc2bb('0x18')](_0x1a0159);}};}function respondWithFilteredResult(_0x21aaec,_0x3e776a){return function(_0x49af5c){if(_0x49af5c){var _0x1518b4=typeof _0x3e776a['offset']===_0xc2bb('0x19')&&typeof _0x3e776a[_0xc2bb('0x1a')]===_0xc2bb('0x19');var _0x17ea5f=_0x49af5c[_0xc2bb('0x1b')];var _0x1ccb92=_0x1518b4?0x0:_0x3e776a[_0xc2bb('0x1c')];var _0x348762=_0x1518b4?_0x49af5c[_0xc2bb('0x1b')]:_0x3e776a[_0xc2bb('0x1c')]+_0x3e776a[_0xc2bb('0x1a')];var _0x26bdcd;if(_0x348762>=_0x17ea5f){_0x348762=_0x17ea5f;_0x26bdcd=0xc8;}else{_0x26bdcd=0xce;}_0x21aaec['status'](_0x26bdcd);return _0x21aaec[_0xc2bb('0x1d')](_0xc2bb('0x1e'),_0x1ccb92+'-'+_0x348762+'/'+_0x17ea5f)[_0xc2bb('0x18')](_0x49af5c);}return null;};}function patchUpdates(_0x53be41){return function(_0x13137f){try{jsonpatch['apply'](_0x13137f,_0x53be41,!![]);}catch(_0x68576d){return BPromise['reject'](_0x68576d);}return _0x13137f[_0xc2bb('0x1f')]();};}function saveUpdates(_0x2b9fa8,_0x2db511){return function(_0x4d4b64){if(_0x4d4b64){return _0x4d4b64['update'](_0x2b9fa8)['then'](function(_0x34ce9f){return _0x34ce9f;});}return null;};}function removeEntity(_0x5a03af,_0x1af8c4){return function(_0x33843c){if(_0x33843c){return _0x33843c[_0xc2bb('0x20')]()[_0xc2bb('0x21')](function(){_0x5a03af[_0xc2bb('0x16')](0xcc)[_0xc2bb('0x17')]();});}};}function handleEntityNotFound(_0x13b18d,_0x212642){return function(_0x1f801d){if(!_0x1f801d){_0x13b18d[_0xc2bb('0x15')](0x194);}return _0x1f801d;};}function handleError(_0x3d9069,_0x285740){_0x285740=_0x285740||0x1f4;return function(_0x3dab88){logger['error'](_0x3dab88[_0xc2bb('0x22')]);if(_0x3dab88[_0xc2bb('0x23')]){delete _0x3dab88['name'];}_0x3d9069['status'](_0x285740)[_0xc2bb('0x24')](_0x3dab88);};}exports[_0xc2bb('0x25')]=function(_0x4f9d30,_0x31c41c){var _0x2e4225={},_0x18ea00={},_0x5db4ed={'count':0x0,'rows':[]};var _0x4d67ce=_[_0xc2bb('0x26')](db[_0xc2bb('0x27')]['rawAttributes'],function(_0x13e60f){return{'name':_0x13e60f[_0xc2bb('0x28')],'type':_0x13e60f['type']['key']};});_0x18ea00[_0xc2bb('0x29')]=_[_0xc2bb('0x26')](_0x4d67ce,_0xc2bb('0x23'));_0x18ea00[_0xc2bb('0x2a')]=_[_0xc2bb('0x2b')](_0x4f9d30[_0xc2bb('0x2a')]);_0x18ea00[_0xc2bb('0x2c')]=_[_0xc2bb('0x2d')](_0x18ea00[_0xc2bb('0x29')],_0x18ea00[_0xc2bb('0x2a')]);_0x2e4225[_0xc2bb('0x2e')]=_['intersection'](_0x18ea00[_0xc2bb('0x29')],qs[_0xc2bb('0x2f')](_0x4f9d30[_0xc2bb('0x2a')][_0xc2bb('0x2f')]));_0x2e4225[_0xc2bb('0x2e')]=_0x2e4225['attributes'][_0xc2bb('0x30')]?_0x2e4225[_0xc2bb('0x2e')]:_0x18ea00[_0xc2bb('0x29')];if(!_0x4f9d30[_0xc2bb('0x2a')][_0xc2bb('0x31')](_0xc2bb('0x32'))){_0x2e4225['limit']=qs[_0xc2bb('0x1a')](_0x4f9d30['query'][_0xc2bb('0x1a')]);_0x2e4225[_0xc2bb('0x1c')]=qs[_0xc2bb('0x1c')](_0x4f9d30[_0xc2bb('0x2a')]['offset']);}_0x2e4225[_0xc2bb('0x33')]=qs[_0xc2bb('0x34')](_0x4f9d30['query'][_0xc2bb('0x34')]);_0x2e4225[_0xc2bb('0x35')]=qs[_0xc2bb('0x2c')](_['pick'](_0x4f9d30['query'],_0x18ea00[_0xc2bb('0x2c')]),_0x4d67ce);if(_0x4f9d30['query'][_0xc2bb('0x36')]){_0x2e4225[_0xc2bb('0x35')]=_[_0xc2bb('0x37')](_0x2e4225[_0xc2bb('0x35')],{'$or':_[_0xc2bb('0x26')](_0x4d67ce,function(_0xadac76){if(_0xadac76[_0xc2bb('0x38')]!==_0xc2bb('0x39')){var _0x3aae8d={};_0x3aae8d[_0xadac76[_0xc2bb('0x23')]]={'$like':'%'+_0x4f9d30[_0xc2bb('0x2a')][_0xc2bb('0x36')]+'%'};return _0x3aae8d;}})});}_0x2e4225=_['merge']({},_0x2e4225,_0x4f9d30[_0xc2bb('0x3a')]);var _0x51bde3={'where':_0x2e4225[_0xc2bb('0x35')]};return db['AnalyticFieldReport']['count'](_0x51bde3)[_0xc2bb('0x21')](function(_0x4d256c){_0x5db4ed[_0xc2bb('0x1b')]=_0x4d256c;if(_0x4f9d30[_0xc2bb('0x2a')][_0xc2bb('0x3b')]){_0x2e4225[_0xc2bb('0x3c')]=[{'all':!![]}];}return db[_0xc2bb('0x27')][_0xc2bb('0x3d')](_0x2e4225);})['then'](function(_0x1543af){_0x5db4ed[_0xc2bb('0x3e')]=_0x1543af;return _0x5db4ed;})[_0xc2bb('0x21')](respondWithFilteredResult(_0x31c41c,_0x2e4225))['catch'](handleError(_0x31c41c,null));};exports[_0xc2bb('0x3f')]=function(_0x429364,_0x5ba09f){var _0x13c108={'raw':![],'where':{'id':_0x429364[_0xc2bb('0x40')]['id']}},_0x27a852={};_0x27a852[_0xc2bb('0x29')]=_[_0xc2bb('0x2b')](db[_0xc2bb('0x27')]['rawAttributes']);_0x27a852['query']=_[_0xc2bb('0x2b')](_0x429364['query']);_0x27a852[_0xc2bb('0x2c')]=_['intersection'](_0x27a852[_0xc2bb('0x29')],_0x27a852[_0xc2bb('0x2a')]);_0x13c108[_0xc2bb('0x2e')]=_[_0xc2bb('0x2d')](_0x27a852[_0xc2bb('0x29')],qs[_0xc2bb('0x2f')](_0x429364[_0xc2bb('0x2a')][_0xc2bb('0x2f')]));_0x13c108[_0xc2bb('0x2e')]=_0x13c108[_0xc2bb('0x2e')]['length']?_0x13c108[_0xc2bb('0x2e')]:_0x27a852[_0xc2bb('0x29')];if(_0x429364['query']['includeAll']){_0x13c108[_0xc2bb('0x3c')]=[{'all':!![]}];}_0x13c108=_[_0xc2bb('0x37')]({},_0x13c108,_0x429364[_0xc2bb('0x3a')]);return db[_0xc2bb('0x27')][_0xc2bb('0x41')](_0x13c108)['then'](handleEntityNotFound(_0x5ba09f,null))[_0xc2bb('0x21')](respondWithResult(_0x5ba09f,null))[_0xc2bb('0x42')](handleError(_0x5ba09f,null));};exports[_0xc2bb('0x43')]=function(_0x50dc79,_0xe56517){return db[_0xc2bb('0x27')][_0xc2bb('0x43')](_0x50dc79[_0xc2bb('0x44')],{})[_0xc2bb('0x21')](respondWithResult(_0xe56517,0xc9))['catch'](handleError(_0xe56517,null));};exports['bulkCreate']=function(_0x45133a,_0x416af0){return db[_0xc2bb('0x27')]['bulkCreate'](_0x45133a['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x416af0,0xc9))[_0xc2bb('0x42')](handleError(_0x416af0,null));};exports[_0xc2bb('0x45')]=function(_0x2efd15,_0x4df9bc){if(_0x2efd15['body']['id']){delete _0x2efd15[_0xc2bb('0x44')]['id'];}return db[_0xc2bb('0x27')][_0xc2bb('0x41')]({'where':{'id':_0x2efd15[_0xc2bb('0x40')]['id']}})[_0xc2bb('0x21')](handleEntityNotFound(_0x4df9bc,null))[_0xc2bb('0x21')](saveUpdates(_0x2efd15[_0xc2bb('0x44')],null))[_0xc2bb('0x21')](respondWithResult(_0x4df9bc,null))[_0xc2bb('0x42')](handleError(_0x4df9bc,null));};exports[_0xc2bb('0x20')]=function(_0x56b019,_0x3bca3a){return db[_0xc2bb('0x27')][_0xc2bb('0x41')]({'where':{'id':_0x56b019[_0xc2bb('0x40')]['id']}})[_0xc2bb('0x21')](handleEntityNotFound(_0x3bca3a,null))[_0xc2bb('0x21')](removeEntity(_0x3bca3a,null))[_0xc2bb('0x42')](handleError(_0x3bca3a,null));};exports[_0xc2bb('0x46')]=function(_0x185a1d,_0x471067){return db[_0xc2bb('0x27')][_0xc2bb('0x20')]({'where':{'id':_0x185a1d[_0xc2bb('0x2a')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xc2bb('0x21')](respondWithResult(_0x471067,0xcc))[_0xc2bb('0x42')](handleError(_0x471067,null));};exports[_0xc2bb('0x47')]=function(_0x98dcbc,_0x3a0dbc,_0x24441f){return db[_0xc2bb('0x48')][_0xc2bb('0x49')]({'where':{'id':_0x98dcbc[_0xc2bb('0x40')]['id']}})[_0xc2bb('0x21')](handleEntityNotFound(_0x3a0dbc,null))[_0xc2bb('0x21')](function(_0x26134b){if(_0x26134b){return db[_0xc2bb('0x4a')]['transaction'](function(_0x279fe9){return db['AnalyticFieldReport'][_0xc2bb('0x20')]({'where':{'CustomReportId':_0x98dcbc[_0xc2bb('0x40')]['id']},'transaction':_0x279fe9})[_0xc2bb('0x21')](function(_0x501d5e){var _0x5b3d46=_[_0xc2bb('0x26')](_0x98dcbc['body'],function(_0x13415c){delete _0x13415c['id'];_0x13415c[_0xc2bb('0x4b')]=_0x98dcbc[_0xc2bb('0x40')]['id'];return _0x13415c;});return db['AnalyticFieldReport'][_0xc2bb('0x4c')](_0x5b3d46,{'transaction':_0x279fe9});});})[_0xc2bb('0x21')](function(){return db[_0xc2bb('0x27')][_0xc2bb('0x3d')]({'where':{'CustomReportId':_0x98dcbc[_0xc2bb('0x40')]['id']}});});}})['then'](respondWithResult(_0x3a0dbc,null))[_0xc2bb('0x42')](handleError(_0x3a0dbc,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index f7a02d6..79a2148 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 _0x27d2=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a50a6,_0x400207){var _0x9cd101=function(_0x4abe53){while(--_0x4abe53){_0x1a50a6['push'](_0x1a50a6['shift']());}};_0x9cd101(++_0x400207);}(_0x27d2,0x1f1));var _0x227d=function(_0x5a89ae,_0x5e0327){_0x5a89ae=_0x5a89ae-0x0;var _0x59b56e=_0x27d2[_0x5a89ae];return _0x59b56e;};'use strict';var _=require(_0x227d('0x0'));var util=require(_0x227d('0x1'));var logger=require(_0x227d('0x2'))(_0x227d('0x3'));var moment=require(_0x227d('0x4'));var BPromise=require(_0x227d('0x5'));var rp=require(_0x227d('0x6'));var fs=require('fs');var path=require(_0x227d('0x7'));var rimraf=require(_0x227d('0x8'));var config=require(_0x227d('0x9'));var attributes=require(_0x227d('0xa'));module[_0x227d('0xb')]=function(_0x1aa534,_0x2eb807){return _0x1aa534[_0x227d('0xc')]('AnalyticFieldReport',attributes,{'tableName':_0x227d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01fd=['exports','define','AnalyticFieldReport','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes'];(function(_0x449039,_0x23a6fd){var _0x34451e=function(_0x3560b0){while(--_0x3560b0){_0x449039['push'](_0x449039['shift']());}};_0x34451e(++_0x23a6fd);}(_0x01fd,0xc3));var _0xd01f=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x01fd[_0x1a7550];return _0x426e22;};'use strict';var _=require('lodash');var util=require(_0xd01f('0x0'));var logger=require(_0xd01f('0x1'))(_0xd01f('0x2'));var moment=require(_0xd01f('0x3'));var BPromise=require(_0xd01f('0x4'));var rp=require(_0xd01f('0x5'));var fs=require('fs');var path=require(_0xd01f('0x6'));var rimraf=require(_0xd01f('0x7'));var config=require('../../config/environment');var attributes=require(_0xd01f('0x8'));module[_0xd01f('0x9')]=function(_0x5a730c,_0x51935d){return _0x5a730c[_0xd01f('0xa')](_0xd01f('0xb'),attributes,{'tableName':'analytics_report_fields','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 b72860b..f82882e 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 _0x0c2f=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5bb113,_0x3d681b){var _0x2018b7=function(_0x33d10d){while(--_0x33d10d){_0x5bb113['push'](_0x5bb113['shift']());}};_0x2018b7(++_0x3d681b);}(_0x0c2f,0x74));var _0xf0c2=function(_0x4c315a,_0x187fc3){_0x4c315a=_0x4c315a-0x0;var _0x2310d8=_0x0c2f[_0x4c315a];return _0x2310d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf0c2('0x0'));var BPromise=require(_0xf0c2('0x1'));var rs=require(_0xf0c2('0x2'));var fs=require('fs');var Redis=require(_0xf0c2('0x3'));var db=require(_0xf0c2('0x4'))['db'];var utils=require(_0xf0c2('0x5'));var logger=require(_0xf0c2('0x6'))(_0xf0c2('0x7'));var config=require(_0xf0c2('0x8'));var jayson=require(_0xf0c2('0x9'));var client=jayson[_0xf0c2('0xa')][_0xf0c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x424f1e,_0x14e981,_0x4f8658){return new BPromise(function(_0x272269,_0x46f966){return client[_0xf0c2('0xc')](_0x424f1e,_0x4f8658)[_0xf0c2('0xd')](function(_0x5d36eb){logger[_0xf0c2('0xe')](_0xf0c2('0xf'),_0x14e981,_0xf0c2('0x10'));logger['debug'](_0xf0c2('0x11'),_0x14e981,_0xf0c2('0x10'),JSON[_0xf0c2('0x12')](_0x5d36eb));if(_0x5d36eb['error']){if(_0x5d36eb[_0xf0c2('0x13')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x14e981,_0x5d36eb[_0xf0c2('0x13')][_0xf0c2('0x14')]);return _0x46f966(_0x5d36eb[_0xf0c2('0x13')][_0xf0c2('0x14')]);}logger[_0xf0c2('0x13')](_0xf0c2('0xf'),_0x14e981,_0x5d36eb[_0xf0c2('0x13')][_0xf0c2('0x14')]);return _0x272269(_0x5d36eb[_0xf0c2('0x13')]['message']);}else{logger[_0xf0c2('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x14e981,_0xf0c2('0x10'));_0x272269(_0x5d36eb[_0xf0c2('0x15')][_0xf0c2('0x14')]);}})[_0xf0c2('0x16')](function(_0x4f8e9b){logger[_0xf0c2('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x14e981,_0x4f8e9b);_0x46f966(_0x4f8e9b);});});} \ No newline at end of file +var _0x513e=['../../config/environment','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xc03c9d,_0x1412fc){var _0x2c11=function(_0x3b7543){while(--_0x3b7543){_0xc03c9d['push'](_0xc03c9d['shift']());}};_0x2c11(++_0x1412fc);}(_0x513e,0x138));var _0xe513=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x513e[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xe513('0x0'));var util=require(_0xe513('0x1'));var moment=require(_0xe513('0x2'));var BPromise=require(_0xe513('0x3'));var rs=require(_0xe513('0x4'));var fs=require('fs');var Redis=require(_0xe513('0x5'));var db=require(_0xe513('0x6'))['db'];var utils=require(_0xe513('0x7'));var logger=require(_0xe513('0x8'))(_0xe513('0x9'));var config=require(_0xe513('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe513('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dd1bd,_0x125157,_0xd98878){return new BPromise(function(_0x41a943,_0x395486){return client[_0xe513('0xc')](_0x2dd1bd,_0xd98878)[_0xe513('0xd')](function(_0x3d0e6c){logger[_0xe513('0xe')](_0xe513('0xf'),_0x125157,'request\x20sent');logger[_0xe513('0x10')](_0xe513('0x11'),_0x125157,_0xe513('0x12'),JSON['stringify'](_0x3d0e6c));if(_0x3d0e6c[_0xe513('0x13')]){if(_0x3d0e6c[_0xe513('0x13')][_0xe513('0x14')]===0x1f4){logger[_0xe513('0x13')](_0xe513('0xf'),_0x125157,_0x3d0e6c[_0xe513('0x13')][_0xe513('0x15')]);return _0x395486(_0x3d0e6c['error'][_0xe513('0x15')]);}logger[_0xe513('0x13')](_0xe513('0xf'),_0x125157,_0x3d0e6c[_0xe513('0x13')][_0xe513('0x15')]);return _0x41a943(_0x3d0e6c['error']['message']);}else{logger[_0xe513('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x125157,'request\x20sent');_0x41a943(_0x3d0e6c[_0xe513('0x16')][_0xe513('0x15')]);}})['catch'](function(_0x28582e){logger[_0xe513('0x13')](_0xe513('0xf'),_0x125157,_0x28582e);_0x395486(_0x28582e);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 0bbcef9..78f76f4 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(_0x48dc48,_0xc7cd6d){var _0x30238b=function(_0x5d9dda){while(--_0x5d9dda){_0x48dc48['push'](_0x48dc48['shift']());}};_0x30238b(++_0xc7cd6d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x4a601e,_0x268dfb){var _0x451d47=function(_0x4ac46f){while(--_0x4ac46f){_0x4a601e['push'](_0x4a601e['shift']());}};_0x451d47(++_0x268dfb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 aa56205..d912e3f 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 _0xc584=['exports','STRING','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc584,0xa8));var _0x4c58=function(_0xee37f1,_0x189f43){_0xee37f1=_0xee37f1-0x0;var _0x37fd54=_0xc584[_0xee37f1];return _0x37fd54;};'use strict';var Sequelize=require('sequelize');module[_0x4c58('0x0')]={'name':{'type':Sequelize[_0x4c58('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x4c58('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfc03=['STRING','name','TEXT','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfc03,0x16f));var _0x3fc0=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xfc03[_0x5627e1];return _0x2f013f;};'use strict';var Sequelize=require(_0x3fc0('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fc0('0x1')],'allowNull':![],'unique':_0x3fc0('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x3fc0('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 699cb00..9b9a048 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 _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0xccfade,_0x38a817){var _0x5f2832=function(_0x292639){while(--_0x292639){_0xccfade['push'](_0xccfade['shift']());}};_0x5f2832(++_0x38a817);}(_0x98a8,0x12c));var _0x898a=function(_0x47e206,_0x4fece5){_0x47e206=_0x47e206-0x0;var _0x277770=_0x98a8[_0x47e206];return _0x277770;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));}; \ No newline at end of file +var _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x4b15ec,_0x5db374){var _0x6a8309=function(_0x34c22c){while(--_0x34c22c){_0x4b15ec['push'](_0x4b15ec['shift']());}};_0x6a8309(++_0x5db374);}(_0xa41a,0x6b));var _0xaa41=function(_0x4502d1,_0x26601f){_0x4502d1=_0x4502d1-0x0;var _0x34baa6=_0xa41a[_0x4502d1];return _0x34baa6;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index dc8caae..972e039 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 _0x7c09=['rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x9438cf,_0x19c958){var _0x3d8373=function(_0x17b7f0){while(--_0x17b7f0){_0x9438cf['push'](_0x9438cf['shift']());}};_0x3d8373(++_0x19c958);}(_0x7c09,0x102));var _0x97c0=function(_0x4df9f2,_0x20ee4e){_0x4df9f2=_0x4df9f2-0x0;var _0x5bb427=_0x7c09[_0x4df9f2];return _0x5bb427;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80c3=['define','AnalyticMetric','analytics_metrics','lodash','api','bluebird','request-promise','path','exports'];(function(_0x5a5db0,_0x4c9d2c){var _0x5a45da=function(_0x574994){while(--_0x574994){_0x5a5db0['push'](_0x5a5db0['shift']());}};_0x5a45da(++_0x4c9d2c);}(_0x80c3,0x18f));var _0x380c=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x80c3[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0x380c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x380c('0x1'));var moment=require('moment');var BPromise=require(_0x380c('0x2'));var rp=require(_0x380c('0x3'));var fs=require('fs');var path=require(_0x380c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x380c('0x5')]=function(_0x595b66,_0x581c96){return _0x595b66[_0x380c('0x6')](_0x380c('0x7'),attributes,{'tableName':_0x380c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 1263483..7aec4d4 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 _0x84a1=['info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then'];(function(_0x14540b,_0x85d32d){var _0x394822=function(_0x2e9b0e){while(--_0x2e9b0e){_0x14540b['push'](_0x14540b['shift']());}};_0x394822(++_0x85d32d);}(_0x84a1,0x172));var _0x184a=function(_0x1606ff,_0x4e7eaa){_0x1606ff=_0x1606ff-0x0;var _0x1d82a8=_0x84a1[_0x1606ff];return _0x1d82a8;};'use strict';var _=require('lodash');var util=require(_0x184a('0x0'));var moment=require('moment');var BPromise=require(_0x184a('0x1'));var rs=require(_0x184a('0x2'));var fs=require('fs');var Redis=require(_0x184a('0x3'));var db=require(_0x184a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x184a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x184a('0x6')][_0x184a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ae569,_0x3b770a,_0x4ff3fc){return new BPromise(function(_0x44b664,_0x52bcc2){return client[_0x184a('0x8')](_0x2ae569,_0x4ff3fc)[_0x184a('0x9')](function(_0x7b7f72){logger[_0x184a('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x3b770a,_0x184a('0xb'));logger[_0x184a('0xc')](_0x184a('0xd'),_0x3b770a,_0x184a('0xb'),JSON[_0x184a('0xe')](_0x7b7f72));if(_0x7b7f72[_0x184a('0xf')]){if(_0x7b7f72[_0x184a('0xf')][_0x184a('0x10')]===0x1f4){logger[_0x184a('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x3b770a,_0x7b7f72[_0x184a('0xf')]['message']);return _0x52bcc2(_0x7b7f72[_0x184a('0xf')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x3b770a,_0x7b7f72[_0x184a('0xf')]['message']);return _0x44b664(_0x7b7f72[_0x184a('0xf')]['message']);}else{logger['info'](_0x184a('0x11'),_0x3b770a,'request\x20sent');_0x44b664(_0x7b7f72['result'][_0x184a('0x12')]);}})[_0x184a('0x13')](function(_0x396e0f){logger[_0x184a('0xf')](_0x184a('0x11'),_0x3b770a,_0x396e0f);_0x52bcc2(_0x396e0f);});});} \ No newline at end of file +var _0x6678=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x49ffaf,_0x52ca64){var _0x32d9c8=function(_0x46e1f7){while(--_0x46e1f7){_0x49ffaf['push'](_0x49ffaf['shift']());}};_0x32d9c8(++_0x52ca64);}(_0x6678,0xb8));var _0x8667=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x6678[_0x1305e3];return _0x1068e9;};'use strict';var _=require(_0x8667('0x0'));var util=require(_0x8667('0x1'));var moment=require(_0x8667('0x2'));var BPromise=require(_0x8667('0x3'));var rs=require(_0x8667('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8667('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8667('0x6'))('rpc');var config=require(_0x8667('0x7'));var jayson=require(_0x8667('0x8'));var client=jayson[_0x8667('0x9')][_0x8667('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa2ae4d,_0x36b691,_0x3b75f5){return new BPromise(function(_0x3e363d,_0x310d45){return client['request'](_0xa2ae4d,_0x3b75f5)[_0x8667('0xb')](function(_0x5f1506){logger[_0x8667('0xc')](_0x8667('0xd'),_0x36b691,_0x8667('0xe'));logger[_0x8667('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x36b691,_0x8667('0xe'),JSON[_0x8667('0x10')](_0x5f1506));if(_0x5f1506[_0x8667('0x11')]){if(_0x5f1506['error'][_0x8667('0x12')]===0x1f4){logger[_0x8667('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x36b691,_0x5f1506['error'][_0x8667('0x13')]);return _0x310d45(_0x5f1506[_0x8667('0x11')][_0x8667('0x13')]);}logger[_0x8667('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x36b691,_0x5f1506['error'][_0x8667('0x13')]);return _0x3e363d(_0x5f1506['error']['message']);}else{logger[_0x8667('0xc')](_0x8667('0xd'),_0x36b691,_0x8667('0xe'));_0x3e363d(_0x5f1506[_0x8667('0x14')][_0x8667('0x13')]);}})[_0x8667('0x15')](function(_0x18eb22){logger['error'](_0x8667('0xd'),_0x36b691,_0x18eb22);_0x310d45(_0x18eb22);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index d25d1ab..1c81a0f 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 _0x7c09=['create','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','show','post'];(function(_0x4512a5,_0x471f20){var _0x540afa=function(_0x1fc82c){while(--_0x1fc82c){_0x4512a5['push'](_0x4512a5['shift']());}};_0x540afa(++_0x471f20);}(_0x7c09,0x102));var _0x97c0=function(_0x492ae5,_0xcd1348){_0x492ae5=_0x492ae5-0x0;var _0x11cbef=_0x7c09[_0x492ae5];return _0x11cbef;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97c0('0x9')](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/',auth['isAuthenticated'](),controller[_0x97c0('0xe')]);router['put'](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller['update']);router['delete'](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xf')]);module[_0x97c0('0x10')]=router; \ No newline at end of file +var _0xed1f=['../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x519420,_0x2624cf){var _0x33817a=function(_0xdba68b){while(--_0xdba68b){_0x519420['push'](_0x519420['shift']());}};_0x33817a(++_0x2624cf);}(_0xed1f,0x6a));var _0xfed1=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xed1f[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')]('/',auth[_0xfed1('0xc')](),controller[_0xfed1('0xd')]);router[_0xfed1('0xb')](_0xfed1('0xe'),auth[_0xfed1('0xc')](),controller[_0xfed1('0xf')]);router['post']('/',auth[_0xfed1('0xc')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xe'),auth[_0xfed1('0xc')](),controller['update']);router[_0xfed1('0x11')]('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ec12f04..dc944de 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 _0xa67c=['exports','TEXT','sequelize'];(function(_0x22663e,_0x25b0ce){var _0x38b63c=function(_0x3bd864){while(--_0x3bd864){_0x22663e['push'](_0x22663e['shift']());}};_0x38b63c(++_0x25b0ce);}(_0xa67c,0x179));var _0xca67=function(_0x2a4788,_0xbe2b0f){_0x2a4788=_0x2a4788-0x0;var _0x4d3f2f=_0xa67c[_0x2a4788];return _0x4d3f2f;};'use strict';var Sequelize=require(_0xca67('0x0'));module[_0xca67('0x1')]={'tree':{'type':Sequelize[_0xca67('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xaf34=['TEXT','sequelize'];(function(_0x5f2643,_0x2f987f){var _0x2d05dc=function(_0x55c0c3){while(--_0x55c0c3){_0x5f2643['push'](_0x5f2643['shift']());}};_0x2d05dc(++_0x2f987f);}(_0xaf34,0x163));var _0x4af3=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xaf34[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x4af3('0x0'));module['exports']={'tree':{'type':Sequelize[_0x4af3('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index efdf29e..422dec2 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 _0xc71b=['model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','AnalyticTreeReport','then','include','findAll','rows','catch','show','params','includeAll','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xc71b,0x151));var _0xbc71=function(_0x479c00,_0x3b56f9){_0x479c00=_0x479c00-0x0;var _0xf7ff18=_0xc71b[_0x479c00];return _0xf7ff18;};'use strict';var emlformat=require(_0xbc71('0x0'));var rimraf=require(_0xbc71('0x1'));var zipdir=require(_0xbc71('0x2'));var jsonpatch=require(_0xbc71('0x3'));var rp=require(_0xbc71('0x4'));var moment=require('moment');var BPromise=require(_0xbc71('0x5'));var Mustache=require(_0xbc71('0x6'));var util=require(_0xbc71('0x7'));var path=require(_0xbc71('0x8'));var sox=require(_0xbc71('0x9'));var csv=require(_0xbc71('0xa'));var ejs=require(_0xbc71('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc71('0xc'));var squel=require(_0xbc71('0xd'));var crypto=require('crypto');var jsforce=require(_0xbc71('0xe'));var deskjs=require(_0xbc71('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbc71('0x10'));var Papa=require(_0xbc71('0x11'));var Redis=require('ioredis');var authService=require(_0xbc71('0x12'));var qs=require(_0xbc71('0x13'));var as=require(_0xbc71('0x14'));var hardwareService=require(_0xbc71('0x15'));var logger=require(_0xbc71('0x16'))(_0xbc71('0x17'));var utils=require(_0xbc71('0x18'));var config=require(_0xbc71('0x19'));var licenseUtil=require(_0xbc71('0x1a'));var db=require(_0xbc71('0x1b'))['db'];function respondWithStatusCode(_0x3de868,_0x161f5e){_0x161f5e=_0x161f5e||0xcc;return function(_0x11d645){if(_0x11d645){return _0x3de868[_0xbc71('0x1c')](_0x161f5e);}return _0x3de868[_0xbc71('0x1d')](_0x161f5e)['end']();};}function respondWithResult(_0x196a0c,_0x345761){_0x345761=_0x345761||0xc8;return function(_0x5df17b){if(_0x5df17b){return _0x196a0c[_0xbc71('0x1d')](_0x345761)[_0xbc71('0x1e')](_0x5df17b);}};}function respondWithFilteredResult(_0x2c6602,_0x26a569){return function(_0x17b30f){if(_0x17b30f){var _0x37857f=typeof _0x26a569[_0xbc71('0x1f')]===_0xbc71('0x20')&&typeof _0x26a569[_0xbc71('0x21')]===_0xbc71('0x20');var _0x2c9ffe=_0x17b30f[_0xbc71('0x22')];var _0x2536c0=_0x37857f?0x0:_0x26a569[_0xbc71('0x1f')];var _0x27a52a=_0x37857f?_0x17b30f[_0xbc71('0x22')]:_0x26a569[_0xbc71('0x1f')]+_0x26a569[_0xbc71('0x21')];var _0x44e144;if(_0x27a52a>=_0x2c9ffe){_0x27a52a=_0x2c9ffe;_0x44e144=0xc8;}else{_0x44e144=0xce;}_0x2c6602[_0xbc71('0x1d')](_0x44e144);return _0x2c6602[_0xbc71('0x23')](_0xbc71('0x24'),_0x2536c0+'-'+_0x27a52a+'/'+_0x2c9ffe)[_0xbc71('0x1e')](_0x17b30f);}return null;};}function patchUpdates(_0x35eec1){return function(_0x162b2c){try{jsonpatch['apply'](_0x162b2c,_0x35eec1,!![]);}catch(_0x5ccfa5){return BPromise['reject'](_0x5ccfa5);}return _0x162b2c[_0xbc71('0x25')]();};}function saveUpdates(_0x2035fb,_0x26eeef){return function(_0x2cb236){if(_0x2cb236){return _0x2cb236['update'](_0x2035fb)['then'](function(_0x8ce8f3){return _0x8ce8f3;});}return null;};}function removeEntity(_0x39cf32,_0xc0d214){return function(_0x3f0373){if(_0x3f0373){return _0x3f0373[_0xbc71('0x26')]()['then'](function(){_0x39cf32[_0xbc71('0x1d')](0xcc)[_0xbc71('0x27')]();});}};}function handleEntityNotFound(_0x21adbb,_0x57aff2){return function(_0x33d56f){if(!_0x33d56f){_0x21adbb[_0xbc71('0x1c')](0x194);}return _0x33d56f;};}function handleError(_0x23b091,_0x56c7f9){_0x56c7f9=_0x56c7f9||0x1f4;return function(_0x4bf0ef){logger[_0xbc71('0x28')](_0x4bf0ef[_0xbc71('0x29')]);if(_0x4bf0ef[_0xbc71('0x2a')]){delete _0x4bf0ef[_0xbc71('0x2a')];}_0x23b091[_0xbc71('0x1d')](_0x56c7f9)[_0xbc71('0x2b')](_0x4bf0ef);};}exports[_0xbc71('0x2c')]=function(_0x1c6cda,_0x2ef3c6){var _0x488d9e={},_0x4fc2b1={},_0x5e4c80={'count':0x0,'rows':[]};var _0x2fa9c8=_['map'](db['AnalyticTreeReport'][_0xbc71('0x2d')],function(_0x3eb161){return{'name':_0x3eb161[_0xbc71('0x2e')],'type':_0x3eb161['type'][_0xbc71('0x2f')]};});_0x4fc2b1[_0xbc71('0x30')]=_[_0xbc71('0x31')](_0x2fa9c8,'name');_0x4fc2b1[_0xbc71('0x32')]=_[_0xbc71('0x33')](_0x1c6cda[_0xbc71('0x32')]);_0x4fc2b1[_0xbc71('0x34')]=_['intersection'](_0x4fc2b1['model'],_0x4fc2b1[_0xbc71('0x32')]);_0x488d9e['attributes']=_[_0xbc71('0x35')](_0x4fc2b1['model'],qs[_0xbc71('0x36')](_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x36')]));_0x488d9e[_0xbc71('0x37')]=_0x488d9e['attributes'][_0xbc71('0x38')]?_0x488d9e[_0xbc71('0x37')]:_0x4fc2b1[_0xbc71('0x30')];if(!_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x39')]('nolimit')){_0x488d9e['limit']=qs[_0xbc71('0x21')](_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x21')]);_0x488d9e[_0xbc71('0x1f')]=qs[_0xbc71('0x1f')](_0x1c6cda['query'][_0xbc71('0x1f')]);}_0x488d9e[_0xbc71('0x3a')]=qs[_0xbc71('0x3b')](_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x3b')]);_0x488d9e[_0xbc71('0x3c')]=qs['filters'](_['pick'](_0x1c6cda[_0xbc71('0x32')],_0x4fc2b1[_0xbc71('0x34')]),_0x2fa9c8);if(_0x1c6cda['query'][_0xbc71('0x3d')]){_0x488d9e[_0xbc71('0x3c')]=_[_0xbc71('0x3e')](_0x488d9e[_0xbc71('0x3c')],{'$or':_[_0xbc71('0x31')](_0x2fa9c8,function(_0xe84e8a){if(_0xe84e8a['type']!=='VIRTUAL'){var _0x16b3d4={};_0x16b3d4[_0xe84e8a['name']]={'$like':'%'+_0x1c6cda['query'][_0xbc71('0x3d')]+'%'};return _0x16b3d4;}})});}_0x488d9e=_[_0xbc71('0x3e')]({},_0x488d9e,_0x1c6cda[_0xbc71('0x3f')]);var _0x4c05ba={'where':_0x488d9e[_0xbc71('0x3c')]};return db[_0xbc71('0x40')][_0xbc71('0x22')](_0x4c05ba)[_0xbc71('0x41')](function(_0x21c805){_0x5e4c80['count']=_0x21c805;if(_0x1c6cda[_0xbc71('0x32')]['includeAll']){_0x488d9e[_0xbc71('0x42')]=[{'all':!![]}];}return db[_0xbc71('0x40')][_0xbc71('0x43')](_0x488d9e);})[_0xbc71('0x41')](function(_0x3fd921){_0x5e4c80[_0xbc71('0x44')]=_0x3fd921;return _0x5e4c80;})['then'](respondWithFilteredResult(_0x2ef3c6,_0x488d9e))[_0xbc71('0x45')](handleError(_0x2ef3c6,null));};exports[_0xbc71('0x46')]=function(_0x428385,_0x404869){var _0x262837={'raw':!![],'where':{'id':_0x428385[_0xbc71('0x47')]['id']}},_0x32762d={};_0x32762d[_0xbc71('0x30')]=_[_0xbc71('0x33')](db[_0xbc71('0x40')][_0xbc71('0x2d')]);_0x32762d[_0xbc71('0x32')]=_[_0xbc71('0x33')](_0x428385['query']);_0x32762d['filters']=_['intersection'](_0x32762d[_0xbc71('0x30')],_0x32762d[_0xbc71('0x32')]);_0x262837[_0xbc71('0x37')]=_[_0xbc71('0x35')](_0x32762d[_0xbc71('0x30')],qs[_0xbc71('0x36')](_0x428385[_0xbc71('0x32')][_0xbc71('0x36')]));_0x262837[_0xbc71('0x37')]=_0x262837[_0xbc71('0x37')]['length']?_0x262837['attributes']:_0x32762d[_0xbc71('0x30')];if(_0x428385[_0xbc71('0x32')][_0xbc71('0x48')]){_0x262837[_0xbc71('0x42')]=[{'all':!![]}];}_0x262837=_[_0xbc71('0x3e')]({},_0x262837,_0x428385[_0xbc71('0x3f')]);return db[_0xbc71('0x40')]['find'](_0x262837)['then'](handleEntityNotFound(_0x404869,null))[_0xbc71('0x41')](respondWithResult(_0x404869,null))[_0xbc71('0x45')](handleError(_0x404869,null));};exports[_0xbc71('0x49')]=function(_0x1a891c,_0x3d2d56){return db[_0xbc71('0x40')][_0xbc71('0x49')](_0x1a891c[_0xbc71('0x4a')],{})[_0xbc71('0x41')](respondWithResult(_0x3d2d56,0xc9))[_0xbc71('0x45')](handleError(_0x3d2d56,null));};exports[_0xbc71('0x4b')]=function(_0x1c3f82,_0x3849ad){if(_0x1c3f82[_0xbc71('0x4a')]['id']){delete _0x1c3f82[_0xbc71('0x4a')]['id'];}return db[_0xbc71('0x40')][_0xbc71('0x4c')]({'where':{'id':_0x1c3f82[_0xbc71('0x47')]['id']}})[_0xbc71('0x41')](handleEntityNotFound(_0x3849ad,null))[_0xbc71('0x41')](saveUpdates(_0x1c3f82[_0xbc71('0x4a')],null))[_0xbc71('0x41')](respondWithResult(_0x3849ad,null))[_0xbc71('0x45')](handleError(_0x3849ad,null));};exports[_0xbc71('0x26')]=function(_0xc30fcf,_0x46dd6c){return db[_0xbc71('0x40')]['find']({'where':{'id':_0xc30fcf[_0xbc71('0x47')]['id']}})['then'](handleEntityNotFound(_0x46dd6c,null))[_0xbc71('0x41')](removeEntity(_0x46dd6c,null))[_0xbc71('0x45')](handleError(_0x46dd6c,null));}; \ No newline at end of file +var _0x32f9=['params','length','find','create','body','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x310dc1,_0x5bf189){var _0x23a052=function(_0x306853){while(--_0x306853){_0x310dc1['push'](_0x310dc1['shift']());}};_0x23a052(++_0x5bf189);}(_0x32f9,0x186));var _0x932f=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x32f9[_0x62c958];return _0x57ec61;};'use strict';var emlformat=require(_0x932f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x932f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x932f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x932f('0x3'));var util=require(_0x932f('0x4'));var path=require(_0x932f('0x5'));var sox=require(_0x932f('0x6'));var csv=require(_0x932f('0x7'));var ejs=require(_0x932f('0x8'));var fs=require('fs');var fs_extra=require(_0x932f('0x9'));var _=require(_0x932f('0xa'));var squel=require(_0x932f('0xb'));var crypto=require('crypto');var jsforce=require(_0x932f('0xc'));var deskjs=require(_0x932f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x932f('0xe'));var Papa=require(_0x932f('0xf'));var Redis=require(_0x932f('0x10'));var authService=require(_0x932f('0x11'));var qs=require(_0x932f('0x12'));var as=require(_0x932f('0x13'));var hardwareService=require(_0x932f('0x14'));var logger=require(_0x932f('0x15'))('api');var utils=require(_0x932f('0x16'));var config=require(_0x932f('0x17'));var licenseUtil=require(_0x932f('0x18'));var db=require(_0x932f('0x19'))['db'];function respondWithStatusCode(_0x366f95,_0xa64e67){_0xa64e67=_0xa64e67||0xcc;return function(_0x9c03a5){if(_0x9c03a5){return _0x366f95[_0x932f('0x1a')](_0xa64e67);}return _0x366f95[_0x932f('0x1b')](_0xa64e67)[_0x932f('0x1c')]();};}function respondWithResult(_0x538b9d,_0x35db39){_0x35db39=_0x35db39||0xc8;return function(_0x58cb11){if(_0x58cb11){return _0x538b9d['status'](_0x35db39)[_0x932f('0x1d')](_0x58cb11);}};}function respondWithFilteredResult(_0x44c471,_0x6ccfbe){return function(_0x2a069e){if(_0x2a069e){var _0x1cba4c=typeof _0x6ccfbe[_0x932f('0x1e')]===_0x932f('0x1f')&&typeof _0x6ccfbe['limit']==='undefined';var _0x550734=_0x2a069e['count'];var _0x76b57b=_0x1cba4c?0x0:_0x6ccfbe['offset'];var _0x11a464=_0x1cba4c?_0x2a069e[_0x932f('0x20')]:_0x6ccfbe['offset']+_0x6ccfbe[_0x932f('0x21')];var _0x30c2ce;if(_0x11a464>=_0x550734){_0x11a464=_0x550734;_0x30c2ce=0xc8;}else{_0x30c2ce=0xce;}_0x44c471[_0x932f('0x1b')](_0x30c2ce);return _0x44c471['set']('Content-Range',_0x76b57b+'-'+_0x11a464+'/'+_0x550734)['json'](_0x2a069e);}return null;};}function patchUpdates(_0x5f4ade){return function(_0x5c025b){try{jsonpatch[_0x932f('0x22')](_0x5c025b,_0x5f4ade,!![]);}catch(_0x2200bf){return BPromise[_0x932f('0x23')](_0x2200bf);}return _0x5c025b[_0x932f('0x24')]();};}function saveUpdates(_0xb5512b,_0x515451){return function(_0x503dbc){if(_0x503dbc){return _0x503dbc[_0x932f('0x25')](_0xb5512b)[_0x932f('0x26')](function(_0xc19cad){return _0xc19cad;});}return null;};}function removeEntity(_0x50ac85,_0x242ee9){return function(_0x2f1318){if(_0x2f1318){return _0x2f1318[_0x932f('0x27')]()[_0x932f('0x26')](function(){_0x50ac85[_0x932f('0x1b')](0xcc)[_0x932f('0x1c')]();});}};}function handleEntityNotFound(_0x4938d5,_0x374d19){return function(_0x433c5c){if(!_0x433c5c){_0x4938d5[_0x932f('0x1a')](0x194);}return _0x433c5c;};}function handleError(_0x329a79,_0x5c155b){_0x5c155b=_0x5c155b||0x1f4;return function(_0x21b3c4){logger[_0x932f('0x28')](_0x21b3c4[_0x932f('0x29')]);if(_0x21b3c4['name']){delete _0x21b3c4[_0x932f('0x2a')];}_0x329a79[_0x932f('0x1b')](_0x5c155b)['send'](_0x21b3c4);};}exports[_0x932f('0x2b')]=function(_0x583568,_0x52039a){var _0x20c166={},_0x413b8a={},_0x25bf96={'count':0x0,'rows':[]};var _0xee4e0c=_[_0x932f('0x2c')](db[_0x932f('0x2d')][_0x932f('0x2e')],function(_0x5a9824){return{'name':_0x5a9824[_0x932f('0x2f')],'type':_0x5a9824[_0x932f('0x30')][_0x932f('0x31')]};});_0x413b8a[_0x932f('0x32')]=_[_0x932f('0x2c')](_0xee4e0c,_0x932f('0x2a'));_0x413b8a['query']=_[_0x932f('0x33')](_0x583568[_0x932f('0x34')]);_0x413b8a[_0x932f('0x35')]=_[_0x932f('0x36')](_0x413b8a['model'],_0x413b8a['query']);_0x20c166[_0x932f('0x37')]=_['intersection'](_0x413b8a['model'],qs['fields'](_0x583568[_0x932f('0x34')][_0x932f('0x38')]));_0x20c166[_0x932f('0x37')]=_0x20c166[_0x932f('0x37')]['length']?_0x20c166['attributes']:_0x413b8a[_0x932f('0x32')];if(!_0x583568[_0x932f('0x34')][_0x932f('0x39')](_0x932f('0x3a'))){_0x20c166[_0x932f('0x21')]=qs['limit'](_0x583568['query']['limit']);_0x20c166[_0x932f('0x1e')]=qs[_0x932f('0x1e')](_0x583568[_0x932f('0x34')][_0x932f('0x1e')]);}_0x20c166[_0x932f('0x3b')]=qs[_0x932f('0x3c')](_0x583568['query'][_0x932f('0x3c')]);_0x20c166['where']=qs['filters'](_[_0x932f('0x3d')](_0x583568[_0x932f('0x34')],_0x413b8a[_0x932f('0x35')]),_0xee4e0c);if(_0x583568['query'][_0x932f('0x3e')]){_0x20c166[_0x932f('0x3f')]=_[_0x932f('0x40')](_0x20c166[_0x932f('0x3f')],{'$or':_[_0x932f('0x2c')](_0xee4e0c,function(_0x3e2d3b){if(_0x3e2d3b[_0x932f('0x30')]!==_0x932f('0x41')){var _0x554166={};_0x554166[_0x3e2d3b[_0x932f('0x2a')]]={'$like':'%'+_0x583568['query'][_0x932f('0x3e')]+'%'};return _0x554166;}})});}_0x20c166=_['merge']({},_0x20c166,_0x583568[_0x932f('0x42')]);var _0x52bee0={'where':_0x20c166[_0x932f('0x3f')]};return db[_0x932f('0x2d')]['count'](_0x52bee0)[_0x932f('0x26')](function(_0x83d08){_0x25bf96[_0x932f('0x20')]=_0x83d08;if(_0x583568['query']['includeAll']){_0x20c166[_0x932f('0x43')]=[{'all':!![]}];}return db[_0x932f('0x2d')][_0x932f('0x44')](_0x20c166);})[_0x932f('0x26')](function(_0x201052){_0x25bf96[_0x932f('0x45')]=_0x201052;return _0x25bf96;})[_0x932f('0x26')](respondWithFilteredResult(_0x52039a,_0x20c166))[_0x932f('0x46')](handleError(_0x52039a,null));};exports[_0x932f('0x47')]=function(_0x4badc2,_0x4ea626){var _0x9ea30d={'raw':!![],'where':{'id':_0x4badc2[_0x932f('0x48')]['id']}},_0x3d70fe={};_0x3d70fe[_0x932f('0x32')]=_['keys'](db[_0x932f('0x2d')][_0x932f('0x2e')]);_0x3d70fe[_0x932f('0x34')]=_[_0x932f('0x33')](_0x4badc2[_0x932f('0x34')]);_0x3d70fe[_0x932f('0x35')]=_[_0x932f('0x36')](_0x3d70fe['model'],_0x3d70fe[_0x932f('0x34')]);_0x9ea30d['attributes']=_[_0x932f('0x36')](_0x3d70fe[_0x932f('0x32')],qs[_0x932f('0x38')](_0x4badc2[_0x932f('0x34')][_0x932f('0x38')]));_0x9ea30d[_0x932f('0x37')]=_0x9ea30d['attributes'][_0x932f('0x49')]?_0x9ea30d[_0x932f('0x37')]:_0x3d70fe[_0x932f('0x32')];if(_0x4badc2[_0x932f('0x34')]['includeAll']){_0x9ea30d['include']=[{'all':!![]}];}_0x9ea30d=_[_0x932f('0x40')]({},_0x9ea30d,_0x4badc2['options']);return db[_0x932f('0x2d')][_0x932f('0x4a')](_0x9ea30d)[_0x932f('0x26')](handleEntityNotFound(_0x4ea626,null))[_0x932f('0x26')](respondWithResult(_0x4ea626,null))[_0x932f('0x46')](handleError(_0x4ea626,null));};exports[_0x932f('0x4b')]=function(_0x9712d7,_0x465d88){return db[_0x932f('0x2d')][_0x932f('0x4b')](_0x9712d7[_0x932f('0x4c')],{})['then'](respondWithResult(_0x465d88,0xc9))[_0x932f('0x46')](handleError(_0x465d88,null));};exports[_0x932f('0x25')]=function(_0x245977,_0x4ae3f5){if(_0x245977[_0x932f('0x4c')]['id']){delete _0x245977[_0x932f('0x4c')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x245977[_0x932f('0x48')]['id']}})[_0x932f('0x26')](handleEntityNotFound(_0x4ae3f5,null))[_0x932f('0x26')](saveUpdates(_0x245977[_0x932f('0x4c')],null))[_0x932f('0x26')](respondWithResult(_0x4ae3f5,null))[_0x932f('0x46')](handleError(_0x4ae3f5,null));};exports['destroy']=function(_0x507591,_0xadc753){return db[_0x932f('0x2d')][_0x932f('0x4a')]({'where':{'id':_0x507591['params']['id']}})[_0x932f('0x26')](handleEntityNotFound(_0xadc753,null))[_0x932f('0x26')](removeEntity(_0xadc753,null))[_0x932f('0x46')](handleError(_0xadc753,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index f0baab7..e9e3d92 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 _0x1646=['./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','api','moment','path','rimraf'];(function(_0x59b889,_0x4b026c){var _0x470d3f=function(_0x52eeb2){while(--_0x52eeb2){_0x59b889['push'](_0x59b889['shift']());}};_0x470d3f(++_0x4b026c);}(_0x1646,0x124));var _0x6164=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x1646[_0x175e89];return _0x2ed996;};'use strict';var _=require(_0x6164('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6164('0x1'));var moment=require(_0x6164('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6164('0x3'));var rimraf=require(_0x6164('0x4'));var config=require('../../config/environment');var attributes=require(_0x6164('0x5'));module[_0x6164('0x6')]=function(_0x130eb8,_0x49fdcd){return _0x130eb8[_0x6164('0x7')]('AnalyticTreeReport',attributes,{'tableName':_0x6164('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc35=['request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x24a654,_0x2ca441){var _0x458651=function(_0x1ecda1){while(--_0x1ecda1){_0x24a654['push'](_0x24a654['shift']());}};_0x458651(++_0x2ca441);}(_0xfc35,0x14c));var _0x5fc3=function(_0x1a3a9b,_0x3f8344){_0x1a3a9b=_0x1a3a9b-0x0;var _0x402617=_0xfc35[_0x1a3a9b];return _0x402617;};'use strict';var _=require(_0x5fc3('0x0'));var util=require(_0x5fc3('0x1'));var logger=require(_0x5fc3('0x2'))(_0x5fc3('0x3'));var moment=require(_0x5fc3('0x4'));var BPromise=require(_0x5fc3('0x5'));var rp=require(_0x5fc3('0x6'));var fs=require('fs');var path=require(_0x5fc3('0x7'));var rimraf=require('rimraf');var config=require(_0x5fc3('0x8'));var attributes=require(_0x5fc3('0x9'));module[_0x5fc3('0xa')]=function(_0x2f0fbf,_0x194efb){return _0x2f0fbf[_0x5fc3('0xb')](_0x5fc3('0xc'),attributes,{'tableName':'analytics_report_trees','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 a2b847c..4d46f0e 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x12b8d4,_0x50bbfd){var _0x49f706=function(_0x4c455f){while(--_0x4c455f){_0x12b8d4['push'](_0x12b8d4['shift']());}};_0x49f706(++_0x50bbfd);}(_0x1261,0x144));var _0x1126=function(_0x439662,_0x5defdb){_0x439662=_0x439662-0x0;var _0x251ec4=_0x1261[_0x439662];return _0x251ec4;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5125cd,_0x1acb11){var _0x25777e=function(_0x29a1c8){while(--_0x29a1c8){_0x5125cd['push'](_0x5125cd['shift']());}};_0x25777e(++_0x1acb11);}(_0x2ef3,0xba));var _0x32ef=function(_0x1e9db5,_0x321766){_0x1e9db5=_0x1e9db5-0x0;var _0x16b5d4=_0x2ef3[_0x1e9db5];return _0x16b5d4;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index b0e13cc..bff8d79 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 _0xc484=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','show','create','update','delete','destroy','multer'];(function(_0x184412,_0x5cfdaf){var _0x4a0c3e=function(_0x325bf9){while(--_0x325bf9){_0x184412['push'](_0x184412['shift']());}};_0x4a0c3e(++_0x5cfdaf);}(_0xc484,0x155));var _0x4c48=function(_0x3b2f12,_0x1e7128){_0x3b2f12=_0x3b2f12-0x0;var _0x36a818=_0xc484[_0x3b2f12];return _0x36a818;};'use strict';var multer=require(_0x4c48('0x0'));var util=require(_0x4c48('0x1'));var path=require(_0x4c48('0x2'));var timeout=require(_0x4c48('0x3'));var express=require('express');var router=express[_0x4c48('0x4')]();var fs_extra=require(_0x4c48('0x5'));var auth=require(_0x4c48('0x6'));var interaction=require(_0x4c48('0x7'));var config=require(_0x4c48('0x8'));var controller=require(_0x4c48('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4c48('0xa')]);router[_0x4c48('0xb')](_0x4c48('0xc'),auth[_0x4c48('0xd')](),controller[_0x4c48('0xe')]);router['post']('/',auth[_0x4c48('0xd')](),controller[_0x4c48('0xf')]);router['put'](_0x4c48('0xc'),auth[_0x4c48('0xd')](),controller[_0x4c48('0x10')]);router[_0x4c48('0x11')](_0x4c48('0xc'),auth[_0x4c48('0xd')](),controller[_0x4c48('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0485=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x1392d4,_0x588cf7){var _0xc3fbc8=function(_0x3ac60c){while(--_0x3ac60c){_0x1392d4['push'](_0x1392d4['shift']());}};_0xc3fbc8(++_0x588cf7);}(_0x0485,0xff));var _0x5048=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0x0485[_0x307bf6];return _0x2878fc;};'use strict';var multer=require(_0x5048('0x0'));var util=require(_0x5048('0x1'));var path=require(_0x5048('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5048('0x3')]();var fs_extra=require(_0x5048('0x4'));var auth=require(_0x5048('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5048('0x6'));var controller=require(_0x5048('0x7'));router[_0x5048('0x8')]('/',auth[_0x5048('0x9')](),controller[_0x5048('0xa')]);router[_0x5048('0x8')](_0x5048('0xb'),auth[_0x5048('0x9')](),controller[_0x5048('0xc')]);router[_0x5048('0xd')]('/',auth['isAuthenticated'](),controller[_0x5048('0xe')]);router[_0x5048('0xf')](_0x5048('0xb'),auth[_0x5048('0x9')](),controller[_0x5048('0x10')]);router[_0x5048('0x11')](_0x5048('0xb'),auth[_0x5048('0x9')](),controller[_0x5048('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 3b327f1..b19116b 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 _0x885e=['sequelize','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x885e,0xe4));var _0xe885=function(_0x34965b,_0xe64754){_0x34965b=_0x34965b-0x0;var _0x5d9c02=_0x885e[_0x34965b];return _0x5d9c02;};'use strict';var Sequelize=require(_0xe885('0x0'));module[_0xe885('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xe885('0x2')]},'type':{'type':Sequelize[_0xe885('0x2')]}}; \ No newline at end of file +var _0xf14b=['exports','STRING','sequelize'];(function(_0x294acd,_0x4b243c){var _0x32ad44=function(_0x1f1c0d){while(--_0x1f1c0d){_0x294acd['push'](_0x294acd['shift']());}};_0x32ad44(++_0x4b243c);}(_0xf14b,0xdd));var _0xbf14=function(_0xef9edb,_0x406d7b){_0xef9edb=_0xef9edb-0x0;var _0x3583e3=_0xf14b[_0xef9edb];return _0x3583e3;};'use strict';var Sequelize=require(_0xbf14('0x0'));module[_0xbf14('0x1')]={'name':{'type':Sequelize[_0xbf14('0x2')]},'basename':{'type':Sequelize[_0xbf14('0x2')]},'type':{'type':Sequelize[_0xbf14('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index ac8074a..9c0b299 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 _0x18a9=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Attachment','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','keys','find','clone','params','includeAll','get','createdAt','updatedAt','body','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','join','root','offline-chat/','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1bc954,_0x260393){var _0x740462=function(_0x45cca6){while(--_0x45cca6){_0x1bc954['push'](_0x1bc954['shift']());}};_0x740462(++_0x260393);}(_0x18a9,0x10a));var _0x918a=function(_0x3416c3,_0x314646){_0x3416c3=_0x3416c3-0x0;var _0x2934d1=_0x18a9[_0x3416c3];return _0x2934d1;};'use strict';var emlformat=require(_0x918a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x918a('0x1'));var jsonpatch=require(_0x918a('0x2'));var rp=require(_0x918a('0x3'));var moment=require(_0x918a('0x4'));var BPromise=require(_0x918a('0x5'));var Mustache=require(_0x918a('0x6'));var util=require(_0x918a('0x7'));var path=require(_0x918a('0x8'));var sox=require(_0x918a('0x9'));var csv=require(_0x918a('0xa'));var ejs=require(_0x918a('0xb'));var fs=require('fs');var fs_extra=require(_0x918a('0xc'));var _=require('lodash');var squel=require(_0x918a('0xd'));var crypto=require(_0x918a('0xe'));var jsforce=require(_0x918a('0xf'));var deskjs=require(_0x918a('0x10'));var toCsv=require(_0x918a('0xa'));var querystring=require(_0x918a('0x11'));var Papa=require(_0x918a('0x12'));var Redis=require(_0x918a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x918a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x918a('0x15'))(_0x918a('0x16'));var utils=require(_0x918a('0x17'));var config=require(_0x918a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x918a('0x19'))['db'];function respondWithStatusCode(_0x2f4a5f,_0x5b70c0){_0x5b70c0=_0x5b70c0||0xcc;return function(_0x2fed95){if(_0x2fed95){return _0x2f4a5f[_0x918a('0x1a')](_0x5b70c0);}return _0x2f4a5f[_0x918a('0x1b')](_0x5b70c0)[_0x918a('0x1c')]();};}function respondWithResult(_0x24929b,_0x1526c3){_0x1526c3=_0x1526c3||0xc8;return function(_0x5b3b84){if(_0x5b3b84){return _0x24929b[_0x918a('0x1b')](_0x1526c3)[_0x918a('0x1d')](_0x5b3b84);}};}function respondWithFilteredResult(_0x168715,_0x2a8a81){return function(_0x577a98){if(_0x577a98){var _0x35d984=typeof _0x2a8a81[_0x918a('0x1e')]===_0x918a('0x1f')&&typeof _0x2a8a81[_0x918a('0x20')]===_0x918a('0x1f');var _0x946a30=_0x577a98[_0x918a('0x21')];var _0x983139=_0x35d984?0x0:_0x2a8a81['offset'];var _0x4811e8=_0x35d984?_0x577a98[_0x918a('0x21')]:_0x2a8a81[_0x918a('0x1e')]+_0x2a8a81[_0x918a('0x20')];var _0x18253b;if(_0x4811e8>=_0x946a30){_0x4811e8=_0x946a30;_0x18253b=0xc8;}else{_0x18253b=0xce;}_0x168715[_0x918a('0x1b')](_0x18253b);return _0x168715[_0x918a('0x22')](_0x918a('0x23'),_0x983139+'-'+_0x4811e8+'/'+_0x946a30)[_0x918a('0x1d')](_0x577a98);}return null;};}function patchUpdates(_0x452d1b){return function(_0x437718){try{jsonpatch[_0x918a('0x24')](_0x437718,_0x452d1b,!![]);}catch(_0x857384){return BPromise[_0x918a('0x25')](_0x857384);}return _0x437718[_0x918a('0x26')]();};}function saveUpdates(_0x4df845,_0x1f079a){return function(_0x3fbf4d){if(_0x3fbf4d){return _0x3fbf4d[_0x918a('0x27')](_0x4df845)[_0x918a('0x28')](function(_0x51741d){return _0x51741d;});}return null;};}function removeEntity(_0x2b896c,_0x86a7ba){return function(_0x261d83){if(_0x261d83){return _0x261d83[_0x918a('0x29')]()[_0x918a('0x28')](function(){_0x2b896c['status'](0xcc)[_0x918a('0x1c')]();});}};}function handleEntityNotFound(_0x218811,_0x1d0a70){return function(_0x3fd5ee){if(!_0x3fd5ee){_0x218811[_0x918a('0x1a')](0x194);}return _0x3fd5ee;};}function handleError(_0x5a2c0b,_0x2f0bd0){_0x2f0bd0=_0x2f0bd0||0x1f4;return function(_0x5a50b5){logger[_0x918a('0x2a')](_0x5a50b5[_0x918a('0x2b')]);if(_0x5a50b5[_0x918a('0x2c')]){delete _0x5a50b5['name'];}_0x5a2c0b[_0x918a('0x1b')](_0x2f0bd0)[_0x918a('0x2d')](_0x5a50b5);};}exports['index']=function(_0x1606fa,_0xc84ea0){var _0x5d4684={},_0x4a0328={},_0x92864e={'count':0x0,'rows':[]};var _0x4fa031=_[_0x918a('0x2e')](db[_0x918a('0x2f')][_0x918a('0x30')],function(_0x3d5f89){return{'name':_0x3d5f89[_0x918a('0x31')],'type':_0x3d5f89[_0x918a('0x32')]['key']};});_0x4a0328['model']=_[_0x918a('0x2e')](_0x4fa031,_0x918a('0x2c'));_0x4a0328[_0x918a('0x33')]=_['keys'](_0x1606fa['query']);_0x4a0328[_0x918a('0x34')]=_[_0x918a('0x35')](_0x4a0328[_0x918a('0x36')],_0x4a0328[_0x918a('0x33')]);_0x5d4684[_0x918a('0x37')]=_[_0x918a('0x35')](_0x4a0328[_0x918a('0x36')],qs[_0x918a('0x38')](_0x1606fa[_0x918a('0x33')][_0x918a('0x38')]));_0x5d4684['attributes']=_0x5d4684[_0x918a('0x37')][_0x918a('0x39')]?_0x5d4684['attributes']:_0x4a0328[_0x918a('0x36')];if(!_0x1606fa[_0x918a('0x33')][_0x918a('0x3a')](_0x918a('0x3b'))){_0x5d4684['limit']=qs['limit'](_0x1606fa['query'][_0x918a('0x20')]);_0x5d4684[_0x918a('0x1e')]=qs[_0x918a('0x1e')](_0x1606fa[_0x918a('0x33')][_0x918a('0x1e')]);}_0x5d4684[_0x918a('0x3c')]=qs[_0x918a('0x3d')](_0x1606fa[_0x918a('0x33')]['sort']);_0x5d4684[_0x918a('0x3e')]=qs[_0x918a('0x34')](_['pick'](_0x1606fa[_0x918a('0x33')],_0x4a0328[_0x918a('0x34')]),_0x4fa031);if(_0x1606fa[_0x918a('0x33')][_0x918a('0x3f')]){_0x5d4684[_0x918a('0x3e')]=_[_0x918a('0x40')](_0x5d4684[_0x918a('0x3e')],{'$or':_[_0x918a('0x2e')](_0x4fa031,function(_0x1aa709){if(_0x1aa709[_0x918a('0x32')]!==_0x918a('0x41')){var _0x966a34={};_0x966a34[_0x1aa709[_0x918a('0x2c')]]={'$like':'%'+_0x1606fa[_0x918a('0x33')][_0x918a('0x3f')]+'%'};return _0x966a34;}})});}_0x5d4684=_[_0x918a('0x40')]({},_0x5d4684,_0x1606fa[_0x918a('0x42')]);var _0x19524f={'where':_0x5d4684[_0x918a('0x3e')]};return db[_0x918a('0x2f')][_0x918a('0x21')](_0x19524f)['then'](function(_0xfab053){_0x92864e[_0x918a('0x21')]=_0xfab053;if(_0x1606fa['query']['includeAll']){_0x5d4684[_0x918a('0x43')]=[{'all':!![]}];}return db[_0x918a('0x2f')]['findAll'](_0x5d4684);})[_0x918a('0x28')](function(_0x18317e){_0x92864e[_0x918a('0x44')]=_0x18317e;return _0x92864e;})['then'](respondWithFilteredResult(_0xc84ea0,_0x5d4684))[_0x918a('0x45')](handleError(_0xc84ea0,null));};exports[_0x918a('0x46')]=function(_0x4b4369,_0x1789f7){var _0x5a8d12={'raw':!![],'where':{'id':_0x4b4369['params']['id']}},_0x29f885={};_0x29f885['model']=_[_0x918a('0x47')](db[_0x918a('0x2f')][_0x918a('0x30')]);_0x29f885['query']=_[_0x918a('0x47')](_0x4b4369[_0x918a('0x33')]);_0x29f885[_0x918a('0x34')]=_[_0x918a('0x35')](_0x29f885[_0x918a('0x36')],_0x29f885[_0x918a('0x33')]);_0x5a8d12['attributes']=_[_0x918a('0x35')](_0x29f885[_0x918a('0x36')],qs[_0x918a('0x38')](_0x4b4369[_0x918a('0x33')]['fields']));_0x5a8d12[_0x918a('0x37')]=_0x5a8d12[_0x918a('0x37')][_0x918a('0x39')]?_0x5a8d12[_0x918a('0x37')]:_0x29f885['model'];if(_0x4b4369[_0x918a('0x33')]['includeAll']){_0x5a8d12['include']=[{'all':!![]}];}_0x5a8d12=_[_0x918a('0x40')]({},_0x5a8d12,_0x4b4369[_0x918a('0x42')]);return db[_0x918a('0x2f')][_0x918a('0x48')](_0x5a8d12)[_0x918a('0x28')](handleEntityNotFound(_0x1789f7,null))[_0x918a('0x28')](respondWithResult(_0x1789f7,null))[_0x918a('0x45')](handleError(_0x1789f7,null));};exports[_0x918a('0x49')]=function(_0x4be11d,_0x4d3782){var _0x1b32cd={'where':{'id':_0x4be11d[_0x918a('0x4a')]['id']}},_0x4b429a={};_0x4b429a[_0x918a('0x36')]=_['keys'](db['Attachment'][_0x918a('0x30')]);_0x1b32cd[_0x918a('0x37')]=_[_0x918a('0x35')](_0x4b429a['model'],qs[_0x918a('0x38')](_0x4be11d[_0x918a('0x33')][_0x918a('0x38')]));_0x1b32cd['attributes']=_0x1b32cd[_0x918a('0x37')][_0x918a('0x39')]?_0x1b32cd[_0x918a('0x37')]:_0x4b429a[_0x918a('0x36')];if(_0x4be11d[_0x918a('0x33')][_0x918a('0x4b')]){_0x1b32cd[_0x918a('0x43')]=[{'all':!![]}];}_0x1b32cd=_[_0x918a('0x40')]({},_0x1b32cd,_0x4be11d[_0x918a('0x42')]);return db[_0x918a('0x2f')][_0x918a('0x48')](_0x1b32cd)['then'](handleEntityNotFound(_0x4d3782,null))[_0x918a('0x28')](function(_0x36c00b){if(_0x36c00b){var _0x9981a5=_0x36c00b[_0x918a('0x4c')]({'plain':!![]});_0x9981a5=qs['omit'](_0x9981a5,['id',_0x918a('0x4d'),_0x918a('0x4e')]);_0x4be11d['body']=_['omit'](_0x4be11d[_0x918a('0x4f')],['id',_0x918a('0x4d'),_0x918a('0x4e')]);return db[_0x918a('0x2f')][_0x918a('0x50')](_[_0x918a('0x40')](_0x9981a5,_0x4be11d['body']),{'include':_0x4be11d['query'][_0x918a('0x4b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4d3782,0xc9))[_0x918a('0x45')](handleError(_0x4d3782,null));};exports[_0x918a('0x27')]=function(_0x39035e,_0x3ffa30){if(_0x39035e[_0x918a('0x4f')]['id']){delete _0x39035e[_0x918a('0x4f')]['id'];}return db[_0x918a('0x2f')][_0x918a('0x48')]({'where':{'id':_0x39035e['params']['id']}})[_0x918a('0x28')](handleEntityNotFound(_0x3ffa30,null))['then'](saveUpdates(_0x39035e[_0x918a('0x4f')],null))[_0x918a('0x28')](respondWithResult(_0x3ffa30,null))[_0x918a('0x45')](handleError(_0x3ffa30,null));};exports['destroy']=function(_0xe44659,_0x394e35){return db[_0x918a('0x2f')][_0x918a('0x48')]({'where':{'id':_0xe44659[_0x918a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x394e35,null))['then'](removeEntity(_0x394e35,null))[_0x918a('0x45')](handleError(_0x394e35,null));};exports['create']=function(_0x21d759,_0x3f0d87,_0x18280a){_0x21d759[_0x918a('0x4f')][_0x918a('0x2c')]=_0x21d759[_0x918a('0x51')][_0x918a('0x52')];_0x21d759['body'][_0x918a('0x53')]=_0x21d759[_0x918a('0x51')][_0x918a('0x54')];_0x21d759[_0x918a('0x4f')][_0x918a('0x32')]=_0x21d759['file']['mimetype'];return db[_0x918a('0x2f')][_0x918a('0x50')](_0x21d759['body'])['then'](respondWithResult(_0x3f0d87,0xc9))[_0x918a('0x45')](handleError(_0x3f0d87,null));};exports['download']=function(_0x3c8ce2,_0x1f0705,_0x282f46){return db[_0x918a('0x2f')][_0x918a('0x55')]({'where':{'id':_0x3c8ce2[_0x918a('0x4a')]['id']},'raw':!![]})[_0x918a('0x28')](handleEntityNotFound(_0x1f0705,null))[_0x918a('0x28')](function(_0x240bdc){if(_0x240bdc){var _0x320a86=_0x240bdc[_0x918a('0x56')]!==null;var _0x40efa0=path[_0x918a('0x57')](config[_0x918a('0x58')],'server/files/attachments/');if(_0x320a86){_0x40efa0=path['join'](_0x40efa0,_0x918a('0x59'));}var _0x88259=path[_0x918a('0x57')](_0x40efa0,_0x240bdc[_0x918a('0x53')]);return _0x1f0705[_0x918a('0x5a')](_0x88259);}})[_0x918a('0x45')](handleError(_0x1f0705,null));}; \ No newline at end of file +var _0xbc70=['destroy','error','stack','name','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','options','includeAll','findAll','show','params','find','catch','clone','include','get','omit','createdAt','body','updatedAt','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x3528a1,_0x43c125){var _0x5c1a48=function(_0x5906fa){while(--_0x5906fa){_0x3528a1['push'](_0x3528a1['shift']());}};_0x5c1a48(++_0x43c125);}(_0xbc70,0xde));var _0x0bc7=function(_0xafdc70,_0x23936d){_0xafdc70=_0xafdc70-0x0;var _0x3242ce=_0xbc70[_0xafdc70];return _0x3242ce;};'use strict';var emlformat=require(_0x0bc7('0x0'));var rimraf=require(_0x0bc7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0bc7('0x2'));var moment=require(_0x0bc7('0x3'));var BPromise=require(_0x0bc7('0x4'));var Mustache=require(_0x0bc7('0x5'));var util=require(_0x0bc7('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bc7('0x7'));var fs=require('fs');var fs_extra=require(_0x0bc7('0x8'));var _=require(_0x0bc7('0x9'));var squel=require(_0x0bc7('0xa'));var crypto=require(_0x0bc7('0xb'));var jsforce=require(_0x0bc7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0bc7('0xd'));var querystring=require(_0x0bc7('0xe'));var Papa=require(_0x0bc7('0xf'));var Redis=require(_0x0bc7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0bc7('0x11'));var as=require(_0x0bc7('0x12'));var hardwareService=require(_0x0bc7('0x13'));var logger=require('../../config/logger')(_0x0bc7('0x14'));var utils=require(_0x0bc7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0bc7('0x16'));var db=require(_0x0bc7('0x17'))['db'];function respondWithStatusCode(_0x430229,_0x3a8def){_0x3a8def=_0x3a8def||0xcc;return function(_0x48b628){if(_0x48b628){return _0x430229[_0x0bc7('0x18')](_0x3a8def);}return _0x430229['status'](_0x3a8def)[_0x0bc7('0x19')]();};}function respondWithResult(_0x3a8339,_0x3d5604){_0x3d5604=_0x3d5604||0xc8;return function(_0x3dd87d){if(_0x3dd87d){return _0x3a8339[_0x0bc7('0x1a')](_0x3d5604)[_0x0bc7('0x1b')](_0x3dd87d);}};}function respondWithFilteredResult(_0x3a87f9,_0x3013b7){return function(_0xf9825c){if(_0xf9825c){var _0x4753ad=typeof _0x3013b7[_0x0bc7('0x1c')]===_0x0bc7('0x1d')&&typeof _0x3013b7[_0x0bc7('0x1e')]===_0x0bc7('0x1d');var _0x6dd719=_0xf9825c['count'];var _0xcb317=_0x4753ad?0x0:_0x3013b7[_0x0bc7('0x1c')];var _0x436bd4=_0x4753ad?_0xf9825c[_0x0bc7('0x1f')]:_0x3013b7[_0x0bc7('0x1c')]+_0x3013b7[_0x0bc7('0x1e')];var _0x199a32;if(_0x436bd4>=_0x6dd719){_0x436bd4=_0x6dd719;_0x199a32=0xc8;}else{_0x199a32=0xce;}_0x3a87f9[_0x0bc7('0x1a')](_0x199a32);return _0x3a87f9[_0x0bc7('0x20')](_0x0bc7('0x21'),_0xcb317+'-'+_0x436bd4+'/'+_0x6dd719)[_0x0bc7('0x1b')](_0xf9825c);}return null;};}function patchUpdates(_0xf3b6c3){return function(_0x3827ef){try{jsonpatch[_0x0bc7('0x22')](_0x3827ef,_0xf3b6c3,!![]);}catch(_0x9c3846){return BPromise[_0x0bc7('0x23')](_0x9c3846);}return _0x3827ef[_0x0bc7('0x24')]();};}function saveUpdates(_0x2b3117,_0x5de1bc){return function(_0x275ee2){if(_0x275ee2){return _0x275ee2[_0x0bc7('0x25')](_0x2b3117)[_0x0bc7('0x26')](function(_0x4b6b97){return _0x4b6b97;});}return null;};}function removeEntity(_0x44ff08,_0x23e321){return function(_0x18fdb5){if(_0x18fdb5){return _0x18fdb5[_0x0bc7('0x27')]()[_0x0bc7('0x26')](function(){_0x44ff08[_0x0bc7('0x1a')](0xcc)[_0x0bc7('0x19')]();});}};}function handleEntityNotFound(_0x2655e9,_0x4782ba){return function(_0x2c76fa){if(!_0x2c76fa){_0x2655e9[_0x0bc7('0x18')](0x194);}return _0x2c76fa;};}function handleError(_0xd58628,_0x30264c){_0x30264c=_0x30264c||0x1f4;return function(_0x515650){logger[_0x0bc7('0x28')](_0x515650[_0x0bc7('0x29')]);if(_0x515650[_0x0bc7('0x2a')]){delete _0x515650[_0x0bc7('0x2a')];}_0xd58628[_0x0bc7('0x1a')](_0x30264c)['send'](_0x515650);};}exports[_0x0bc7('0x2b')]=function(_0x2b4077,_0x441c40){var _0x175ab3={},_0x29831f={},_0x2347dd={'count':0x0,'rows':[]};var _0x1d0a44=_['map'](db[_0x0bc7('0x2c')][_0x0bc7('0x2d')],function(_0x3839db){return{'name':_0x3839db[_0x0bc7('0x2e')],'type':_0x3839db[_0x0bc7('0x2f')][_0x0bc7('0x30')]};});_0x29831f[_0x0bc7('0x31')]=_[_0x0bc7('0x32')](_0x1d0a44,_0x0bc7('0x2a'));_0x29831f[_0x0bc7('0x33')]=_[_0x0bc7('0x34')](_0x2b4077[_0x0bc7('0x33')]);_0x29831f['filters']=_[_0x0bc7('0x35')](_0x29831f[_0x0bc7('0x31')],_0x29831f[_0x0bc7('0x33')]);_0x175ab3[_0x0bc7('0x36')]=_[_0x0bc7('0x35')](_0x29831f[_0x0bc7('0x31')],qs[_0x0bc7('0x37')](_0x2b4077[_0x0bc7('0x33')]['fields']));_0x175ab3[_0x0bc7('0x36')]=_0x175ab3[_0x0bc7('0x36')][_0x0bc7('0x38')]?_0x175ab3[_0x0bc7('0x36')]:_0x29831f[_0x0bc7('0x31')];if(!_0x2b4077[_0x0bc7('0x33')][_0x0bc7('0x39')]('nolimit')){_0x175ab3[_0x0bc7('0x1e')]=qs['limit'](_0x2b4077['query'][_0x0bc7('0x1e')]);_0x175ab3[_0x0bc7('0x1c')]=qs[_0x0bc7('0x1c')](_0x2b4077[_0x0bc7('0x33')][_0x0bc7('0x1c')]);}_0x175ab3['order']=qs[_0x0bc7('0x3a')](_0x2b4077['query'][_0x0bc7('0x3a')]);_0x175ab3[_0x0bc7('0x3b')]=qs[_0x0bc7('0x3c')](_['pick'](_0x2b4077[_0x0bc7('0x33')],_0x29831f[_0x0bc7('0x3c')]),_0x1d0a44);if(_0x2b4077[_0x0bc7('0x33')][_0x0bc7('0x3d')]){_0x175ab3[_0x0bc7('0x3b')]=_[_0x0bc7('0x3e')](_0x175ab3[_0x0bc7('0x3b')],{'$or':_[_0x0bc7('0x32')](_0x1d0a44,function(_0x55697b){if(_0x55697b[_0x0bc7('0x2f')]!=='VIRTUAL'){var _0x454f73={};_0x454f73[_0x55697b[_0x0bc7('0x2a')]]={'$like':'%'+_0x2b4077['query'][_0x0bc7('0x3d')]+'%'};return _0x454f73;}})});}_0x175ab3=_['merge']({},_0x175ab3,_0x2b4077[_0x0bc7('0x3f')]);var _0x37b6a3={'where':_0x175ab3[_0x0bc7('0x3b')]};return db[_0x0bc7('0x2c')][_0x0bc7('0x1f')](_0x37b6a3)['then'](function(_0x46c7e0){_0x2347dd[_0x0bc7('0x1f')]=_0x46c7e0;if(_0x2b4077[_0x0bc7('0x33')][_0x0bc7('0x40')]){_0x175ab3['include']=[{'all':!![]}];}return db['Attachment'][_0x0bc7('0x41')](_0x175ab3);})['then'](function(_0x470fac){_0x2347dd['rows']=_0x470fac;return _0x2347dd;})[_0x0bc7('0x26')](respondWithFilteredResult(_0x441c40,_0x175ab3))['catch'](handleError(_0x441c40,null));};exports[_0x0bc7('0x42')]=function(_0xffce22,_0x544c91){var _0x336f99={'raw':!![],'where':{'id':_0xffce22[_0x0bc7('0x43')]['id']}},_0x7d3ad6={};_0x7d3ad6[_0x0bc7('0x31')]=_[_0x0bc7('0x34')](db[_0x0bc7('0x2c')][_0x0bc7('0x2d')]);_0x7d3ad6['query']=_[_0x0bc7('0x34')](_0xffce22[_0x0bc7('0x33')]);_0x7d3ad6[_0x0bc7('0x3c')]=_[_0x0bc7('0x35')](_0x7d3ad6[_0x0bc7('0x31')],_0x7d3ad6[_0x0bc7('0x33')]);_0x336f99[_0x0bc7('0x36')]=_[_0x0bc7('0x35')](_0x7d3ad6[_0x0bc7('0x31')],qs[_0x0bc7('0x37')](_0xffce22['query']['fields']));_0x336f99['attributes']=_0x336f99[_0x0bc7('0x36')]['length']?_0x336f99[_0x0bc7('0x36')]:_0x7d3ad6[_0x0bc7('0x31')];if(_0xffce22['query'][_0x0bc7('0x40')]){_0x336f99['include']=[{'all':!![]}];}_0x336f99=_[_0x0bc7('0x3e')]({},_0x336f99,_0xffce22[_0x0bc7('0x3f')]);return db['Attachment'][_0x0bc7('0x44')](_0x336f99)[_0x0bc7('0x26')](handleEntityNotFound(_0x544c91,null))['then'](respondWithResult(_0x544c91,null))[_0x0bc7('0x45')](handleError(_0x544c91,null));};exports[_0x0bc7('0x46')]=function(_0x48ab88,_0x1db535){var _0x5d9f58={'where':{'id':_0x48ab88[_0x0bc7('0x43')]['id']}},_0x2ed59b={};_0x2ed59b[_0x0bc7('0x31')]=_[_0x0bc7('0x34')](db['Attachment']['rawAttributes']);_0x5d9f58[_0x0bc7('0x36')]=_['intersection'](_0x2ed59b['model'],qs[_0x0bc7('0x37')](_0x48ab88['query']['fields']));_0x5d9f58[_0x0bc7('0x36')]=_0x5d9f58[_0x0bc7('0x36')][_0x0bc7('0x38')]?_0x5d9f58[_0x0bc7('0x36')]:_0x2ed59b['model'];if(_0x48ab88[_0x0bc7('0x33')][_0x0bc7('0x40')]){_0x5d9f58[_0x0bc7('0x47')]=[{'all':!![]}];}_0x5d9f58=_[_0x0bc7('0x3e')]({},_0x5d9f58,_0x48ab88[_0x0bc7('0x3f')]);return db['Attachment'][_0x0bc7('0x44')](_0x5d9f58)['then'](handleEntityNotFound(_0x1db535,null))['then'](function(_0x3521c8){if(_0x3521c8){var _0x357e90=_0x3521c8[_0x0bc7('0x48')]({'plain':!![]});_0x357e90=qs[_0x0bc7('0x49')](_0x357e90,['id',_0x0bc7('0x4a'),'updatedAt']);_0x48ab88[_0x0bc7('0x4b')]=_['omit'](_0x48ab88['body'],['id',_0x0bc7('0x4a'),_0x0bc7('0x4c')]);return db[_0x0bc7('0x2c')]['create'](_['merge'](_0x357e90,_0x48ab88[_0x0bc7('0x4b')]),{'include':_0x48ab88[_0x0bc7('0x33')][_0x0bc7('0x40')]?[{'all':!![]}]:undefined});}})[_0x0bc7('0x26')](respondWithResult(_0x1db535,0xc9))[_0x0bc7('0x45')](handleError(_0x1db535,null));};exports['update']=function(_0x39799b,_0x4a4a70){if(_0x39799b['body']['id']){delete _0x39799b['body']['id'];}return db['Attachment'][_0x0bc7('0x44')]({'where':{'id':_0x39799b[_0x0bc7('0x43')]['id']}})[_0x0bc7('0x26')](handleEntityNotFound(_0x4a4a70,null))[_0x0bc7('0x26')](saveUpdates(_0x39799b['body'],null))['then'](respondWithResult(_0x4a4a70,null))['catch'](handleError(_0x4a4a70,null));};exports[_0x0bc7('0x27')]=function(_0x2a5ef8,_0x5451ad){return db[_0x0bc7('0x2c')][_0x0bc7('0x44')]({'where':{'id':_0x2a5ef8[_0x0bc7('0x43')]['id']}})[_0x0bc7('0x26')](handleEntityNotFound(_0x5451ad,null))[_0x0bc7('0x26')](removeEntity(_0x5451ad,null))[_0x0bc7('0x45')](handleError(_0x5451ad,null));};exports[_0x0bc7('0x4d')]=function(_0x1cefeb,_0x3fc1c5,_0x18ba57){_0x1cefeb[_0x0bc7('0x4b')]['name']=_0x1cefeb[_0x0bc7('0x4e')][_0x0bc7('0x4f')];_0x1cefeb[_0x0bc7('0x4b')][_0x0bc7('0x50')]=_0x1cefeb['file'][_0x0bc7('0x51')];_0x1cefeb[_0x0bc7('0x4b')][_0x0bc7('0x2f')]=_0x1cefeb['file']['mimetype'];return db['Attachment'][_0x0bc7('0x4d')](_0x1cefeb[_0x0bc7('0x4b')])[_0x0bc7('0x26')](respondWithResult(_0x3fc1c5,0xc9))['catch'](handleError(_0x3fc1c5,null));};exports['download']=function(_0x3bb7f7,_0x517824,_0x480b5d){return db[_0x0bc7('0x2c')][_0x0bc7('0x52')]({'where':{'id':_0x3bb7f7[_0x0bc7('0x43')]['id']},'raw':!![]})[_0x0bc7('0x26')](handleEntityNotFound(_0x517824,null))[_0x0bc7('0x26')](function(_0x227dbe){if(_0x227dbe){var _0x3ff99c=_0x227dbe[_0x0bc7('0x53')]!==null;var _0x35976b=path['join'](config[_0x0bc7('0x54')],_0x0bc7('0x55'));if(_0x3ff99c){_0x35976b=path[_0x0bc7('0x56')](_0x35976b,'offline-chat/');}var _0x146355=path[_0x0bc7('0x56')](_0x35976b,_0x227dbe[_0x0bc7('0x50')]);return _0x517824['download'](_0x146355);}})['catch'](handleError(_0x517824,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7252243..3938b2e 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 _0x86f2=['exports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./attachment.attributes'];(function(_0x21e886,_0x20dcd2){var _0x5c5b67=function(_0x33cf7b){while(--_0x33cf7b){_0x21e886['push'](_0x21e886['shift']());}};_0x5c5b67(++_0x20dcd2);}(_0x86f2,0x1eb));var _0x286f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x86f2[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x286f('0x0'));var util=require(_0x286f('0x1'));var logger=require(_0x286f('0x2'))(_0x286f('0x3'));var moment=require(_0x286f('0x4'));var BPromise=require('bluebird');var rp=require(_0x286f('0x5'));var fs=require('fs');var path=require(_0x286f('0x6'));var rimraf=require('rimraf');var config=require(_0x286f('0x7'));var attributes=require(_0x286f('0x8'));module[_0x286f('0x9')]=function(_0x48d05e,_0x52257d){return _0x48d05e['define']('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bc7=['bluebird','request-promise','path','rimraf','./attachment.attributes','exports','Attachment','util','../../config/logger','moment'];(function(_0x16c0bd,_0x9676d2){var _0x48fd60=function(_0x2e3eb3){while(--_0x2e3eb3){_0x16c0bd['push'](_0x16c0bd['shift']());}};_0x48fd60(++_0x9676d2);}(_0x0bc7,0x10b));var _0x70bc=function(_0x30c2d7,_0x32cbcb){_0x30c2d7=_0x30c2d7-0x0;var _0x1052a0=_0x0bc7[_0x30c2d7];return _0x1052a0;};'use strict';var _=require('lodash');var util=require(_0x70bc('0x0'));var logger=require(_0x70bc('0x1'))('api');var moment=require(_0x70bc('0x2'));var BPromise=require(_0x70bc('0x3'));var rp=require(_0x70bc('0x4'));var fs=require('fs');var path=require(_0x70bc('0x5'));var rimraf=require(_0x70bc('0x6'));var config=require('../../config/environment');var attributes=require(_0x70bc('0x7'));module[_0x70bc('0x8')]=function(_0x3c24ba,_0x7185a6){return _0x3c24ba['define'](_0x70bc('0x9'),attributes,{'tableName':'attachments','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 7d83eab..cdce2de 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 _0x2750=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','Attachment','body','options','CreateAttachment','lodash','moment','bluebird','randomstring'];(function(_0x274de9,_0x2d40ef){var _0x442761=function(_0x3cd3d7){while(--_0x3cd3d7){_0x274de9['push'](_0x274de9['shift']());}};_0x442761(++_0x2d40ef);}(_0x2750,0x13b));var _0x0275=function(_0x5f08a8,_0x4b8709){_0x5f08a8=_0x5f08a8-0x0;var _0x1cbf0d=_0x2750[_0x5f08a8];return _0x1cbf0d;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var moment=require(_0x0275('0x1'));var BPromise=require(_0x0275('0x2'));var rs=require(_0x0275('0x3'));var fs=require('fs');var Redis=require(_0x0275('0x4'));var db=require(_0x0275('0x5'))['db'];var utils=require(_0x0275('0x6'));var logger=require(_0x0275('0x7'))(_0x0275('0x8'));var config=require(_0x0275('0x9'));var jayson=require(_0x0275('0xa'));var client=jayson['client'][_0x0275('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2421fd,_0x2fa0eb,_0x2e4b5c){return new BPromise(function(_0x4dffd1,_0x1f7c4a){return client[_0x0275('0xc')](_0x2421fd,_0x2e4b5c)[_0x0275('0xd')](function(_0x5e0e4a){logger['info'](_0x0275('0xe'),_0x2fa0eb,'request\x20sent');logger[_0x0275('0xf')](_0x0275('0x10'),_0x2fa0eb,_0x0275('0x11'),JSON[_0x0275('0x12')](_0x5e0e4a));if(_0x5e0e4a[_0x0275('0x13')]){if(_0x5e0e4a['error'][_0x0275('0x14')]===0x1f4){logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a['error']['message']);return _0x1f7c4a(_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);}logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);return _0x4dffd1(_0x5e0e4a['error'][_0x0275('0x15')]);}else{logger[_0x0275('0x16')]('Attachment,\x20%s,\x20%s',_0x2fa0eb,_0x0275('0x11'));_0x4dffd1(_0x5e0e4a[_0x0275('0x17')]['message']);}})[_0x0275('0x18')](function(_0x31c76b){logger['error']('Attachment,\x20%s,\x20%s',_0x2fa0eb,_0x31c76b);_0x1f7c4a(_0x31c76b);});});}exports['CreateAttachment']=function(_0x591d27){var _0x5b8746=this;return new Promise(function(_0x566ad6,_0x44f7b0){return db[_0x0275('0x19')]['create'](_0x591d27[_0x0275('0x1a')],{'raw':_0x591d27[_0x0275('0x1b')]?_0x591d27[_0x0275('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0275('0xd')](function(_0x402f0d){logger['info']('CreateAttachment',_0x591d27);logger[_0x0275('0xf')](_0x0275('0x1c'),_0x591d27,JSON[_0x0275('0x12')](_0x402f0d));_0x566ad6(_0x402f0d);})['catch'](function(_0xf3b68e){logger['error'](_0x0275('0x1c'),_0xf3b68e['message'],_0x591d27);_0x44f7b0(_0x5b8746[_0x0275('0x13')](0x1f4,_0xf3b68e[_0x0275('0x15')]));});});}; \ No newline at end of file +var _0x6c50=['error','Attachment,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x180bd3,_0x240488){var _0x2c7250=function(_0x949746){while(--_0x949746){_0x180bd3['push'](_0x180bd3['shift']());}};_0x2c7250(++_0x240488);}(_0x6c50,0xa4));var _0x06c5=function(_0x20f697,_0x232c4b){_0x20f697=_0x20f697-0x0;var _0x39a07a=_0x6c50[_0x20f697];return _0x39a07a;};'use strict';var _=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var BPromise=require(_0x06c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06c5('0x5'));var logger=require(_0x06c5('0x6'))(_0x06c5('0x7'));var config=require(_0x06c5('0x8'));var jayson=require(_0x06c5('0x9'));var client=jayson[_0x06c5('0xa')][_0x06c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x427dd6,_0x181c7f,_0x17c636){return new BPromise(function(_0x154b0a,_0x546ae5){return client[_0x06c5('0xc')](_0x427dd6,_0x17c636)[_0x06c5('0xd')](function(_0x3010af){logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,'request\x20sent');logger['debug'](_0x06c5('0xf'),_0x181c7f,'request\x20sent',JSON['stringify'](_0x3010af));if(_0x3010af['error']){if(_0x3010af[_0x06c5('0x10')]['code']===0x1f4){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af[_0x06c5('0x10')]['message']);return _0x546ae5(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af['error']['message']);return _0x154b0a(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}else{logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,_0x06c5('0x13'));_0x154b0a(_0x3010af[_0x06c5('0x14')]['message']);}})[_0x06c5('0x15')](function(_0x9045e6){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x9045e6);_0x546ae5(_0x9045e6);});});}exports[_0x06c5('0x16')]=function(_0x36b9e9){var _0x44d14e=this;return new Promise(function(_0x18a070,_0x1393f5){return db[_0x06c5('0x17')][_0x06c5('0x18')](_0x36b9e9[_0x06c5('0x19')],{'raw':_0x36b9e9[_0x06c5('0x1a')]?_0x36b9e9[_0x06c5('0x1a')][_0x06c5('0x1b')]===undefined?!![]:![]:!![]})[_0x06c5('0xd')](function(_0x26a653){logger['info'](_0x06c5('0x16'),_0x36b9e9);logger[_0x06c5('0x1c')](_0x06c5('0x16'),_0x36b9e9,JSON[_0x06c5('0x1d')](_0x26a653));_0x18a070(_0x26a653);})[_0x06c5('0x15')](function(_0x3c9e49){logger[_0x06c5('0x10')]('CreateAttachment',_0x3c9e49[_0x06c5('0x12')],_0x36b9e9);_0x1393f5(_0x44d14e[_0x06c5('0x10')](0x1f4,_0x3c9e49[_0x06c5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 5a568f9..8a32073 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x5c5148,_0x49acc7){var _0x2ec4ed=function(_0x2144b1){while(--_0x2144b1){_0x5c5148['push'](_0x5c5148['shift']());}};_0x2ec4ed(++_0x49acc7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x31f79b,_0xa6f57){_0x31f79b=_0x31f79b-0x0;var _0x521729=_0x5f2f[_0x31f79b];return _0x521729;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x5d24e9,_0x2035ac){var _0x1eb863=function(_0x186fad){while(--_0x186fad){_0x5d24e9['push'](_0x5d24e9['shift']());}};_0x1eb863(++_0x2035ac);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f1753,_0x458f6d){_0x2f1753=_0x2f1753-0x0;var _0x56a164=_0xb10b[_0x2f1753];return _0x56a164;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 1add881..d16fa4a 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 _0xecca=['email','callback','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','/login','profile'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xecca,0x138));var _0xaecc=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xecca[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xaecc('0x0'));var passport=require('passport');var GoogleStrategy=require(_0xaecc('0x1'))['Strategy'];var moment=require(_0xaecc('0x2'));var db=require(_0xaecc('0x3'))['db'];var config=require(_0xaecc('0x4'));var signToken=require(_0xaecc('0x5'))[_0xaecc('0x6')];var utils=require(_0xaecc('0x7'));exports['login']=passport[_0xaecc('0x8')](_0xaecc('0x9'),{'failureRedirect':_0xaecc('0xa'),'scope':[_0xaecc('0xb'),_0xaecc('0xc')],'session':![]});exports[_0xaecc('0xd')]=passport[_0xaecc('0x8')](_0xaecc('0x9'),{'failureRedirect':_0xaecc('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xaecc('0x9')]?config['google'][_0xaecc('0xe')]:'id','clientSecret':config['google']?config['google'][_0xaecc('0xf')]:'secret','callbackURL':config[_0xaecc('0x9')]?config[_0xaecc('0x9')][_0xaecc('0x10')]:''},function(_0x260cde,_0x547230,_0x48bdf3,_0x2411e3){var _0x387684,_0x12b1af;return db[_0xaecc('0x11')][_0xaecc('0x12')]({'where':{'id':0x1},'attributes':[_0xaecc('0x13'),_0xaecc('0x14')],'raw':!![]})[_0xaecc('0x15')](function(_0xe07e16){_0x387684=_0xe07e16;return db[_0xaecc('0x16')][_0xaecc('0x17')]({'where':{'email':_['map'](_0x48bdf3['emails'],_0xaecc('0x18')),'role':{'$or':[_0xaecc('0x19'),_0xaecc('0x1a'),_0xaecc('0x1b')]}}});})[_0xaecc('0x15')](function(_0x2ac78f){_0x12b1af=_0x2ac78f;if(_0x12b1af){if(_0x12b1af['disabled']){return _0x2411e3(_0xaecc('0x1c'));}else if(_0x387684['blockDuration']>0x0){if(_0x12b1af[_0xaecc('0x1d')]){if(moment(_0x12b1af[_0xaecc('0x1e')])[_0xaecc('0x1f')](_0x387684[_0xaecc('0x14')],_0xaecc('0x20'))>moment()){return _0x2411e3(_0xaecc('0x1c'));}else{return utils[_0xaecc('0x21')](_0x12b1af,0x0,![],null)[_0xaecc('0x15')](function(){return utils[_0xaecc('0x22')](_0x12b1af);})[_0xaecc('0x15')](function(){return _0x2411e3(null,_0x12b1af);});}}else{return utils[_0xaecc('0x22')](_0x12b1af)[_0xaecc('0x15')](function(){return _0x2411e3(null,_0x12b1af);});}}else{return utils[_0xaecc('0x22')](_0x12b1af)[_0xaecc('0x15')](function(){return _0x2411e3(null,_0x12b1af);});}}return _0x2411e3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xaecc('0x23')](function(_0xddfca1){_0x2411e3(_0xddfca1);});})); \ No newline at end of file +var _0x1931=['findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','authenticate','google','profile','email','callback','use','clientID','secret','callbackURL','Setting'];(function(_0x4543cb,_0x42fed5){var _0x3aed87=function(_0x21db2b){while(--_0x21db2b){_0x4543cb['push'](_0x4543cb['shift']());}};_0x3aed87(++_0x42fed5);}(_0x1931,0x169));var _0x1193=function(_0x3f18b5,_0x46cf7c){_0x3f18b5=_0x3f18b5-0x0;var _0x597183=_0x1931[_0x3f18b5];return _0x597183;};'use strict';var _=require(_0x1193('0x0'));var passport=require(_0x1193('0x1'));var GoogleStrategy=require(_0x1193('0x2'))[_0x1193('0x3')];var moment=require(_0x1193('0x4'));var db=require(_0x1193('0x5'))['db'];var config=require(_0x1193('0x6'));var signToken=require(_0x1193('0x7'))['signToken'];var utils=require(_0x1193('0x8'));exports['login']=passport[_0x1193('0x9')](_0x1193('0xa'),{'failureRedirect':'/login','scope':[_0x1193('0xb'),_0x1193('0xc')],'session':![]});exports[_0x1193('0xd')]=passport[_0x1193('0x9')](_0x1193('0xa'),{'failureRedirect':'/login','session':![]});passport[_0x1193('0xe')](new GoogleStrategy({'clientID':config[_0x1193('0xa')]?config[_0x1193('0xa')][_0x1193('0xf')]:'id','clientSecret':config[_0x1193('0xa')]?config[_0x1193('0xa')]['clientSecret']:_0x1193('0x10'),'callbackURL':config[_0x1193('0xa')]?config[_0x1193('0xa')][_0x1193('0x11')]:''},function(_0x519960,_0x5de32e,_0x3a25d6,_0x25f6c3){var _0x5b777d,_0x1dddb9;return db[_0x1193('0x12')][_0x1193('0x13')]({'where':{'id':0x1},'attributes':[_0x1193('0x14'),_0x1193('0x15')],'raw':!![]})[_0x1193('0x16')](function(_0x508d8f){_0x5b777d=_0x508d8f;return db[_0x1193('0x17')][_0x1193('0x18')]({'where':{'email':_[_0x1193('0x19')](_0x3a25d6[_0x1193('0x1a')],'value'),'role':{'$or':[_0x1193('0x1b'),_0x1193('0x1c'),'agent']}}});})['then'](function(_0x3e2ed9){_0x1dddb9=_0x3e2ed9;if(_0x1dddb9){if(_0x1dddb9[_0x1193('0x1d')]){return _0x25f6c3(_0x1193('0x1e'));}else if(_0x5b777d[_0x1193('0x15')]>0x0){if(_0x1dddb9[_0x1193('0x1f')]){if(moment(_0x1dddb9[_0x1193('0x20')])[_0x1193('0x21')](_0x5b777d[_0x1193('0x15')],_0x1193('0x22'))>moment()){return _0x25f6c3(_0x1193('0x1e'));}else{return utils[_0x1193('0x23')](_0x1dddb9,0x0,![],null)[_0x1193('0x16')](function(){return utils['getLicense'](_0x1dddb9);})['then'](function(){return _0x25f6c3(null,_0x1dddb9);});}}else{return utils[_0x1193('0x24')](_0x1dddb9)['then'](function(){return _0x25f6c3(null,_0x1dddb9);});}}else{return utils[_0x1193('0x24')](_0x1dddb9)['then'](function(){return _0x25f6c3(null,_0x1dddb9);});}}return _0x25f6c3(_0x1193('0x1e'));})[_0x1193('0x25')](function(_0x5ef9ab){_0x25f6c3(_0x5ef9ab);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 751759d..f6cbeb1 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 _0xf69b=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','isMiddleware','login','setTokenCookie','passport','Router'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0xf69b,0x1e8));var _0xbf69=function(_0x5417ba,_0x1f52df){_0x5417ba=_0x5417ba-0x0;var _0x42660f=_0xf69b[_0x5417ba];return _0x42660f;};'use strict';var express=require('express');var passport=require(_0xbf69('0x0'));var router=express[_0xbf69('0x1')]();var controller=require(_0xbf69('0x2'));var userController=require(_0xbf69('0x3'));var authService=require(_0xbf69('0x4'));router[_0xbf69('0x5')]('/',controller['login']);router[_0xbf69('0x5')](_0xbf69('0x6'),controller['callback'],authService[_0xbf69('0x7')],userController[_0xbf69('0x8')],authService[_0xbf69('0x9')]);module['exports']=router; \ No newline at end of file +var _0x1af1=['/callback','isMiddleware','setTokenCookie','express','passport','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0xdf2cb,_0x1ea5d8){var _0x1f92dd=function(_0x13473b){while(--_0x13473b){_0xdf2cb['push'](_0xdf2cb['shift']());}};_0x1f92dd(++_0x1ea5d8);}(_0x1af1,0x1e9));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x11af('0x0'));var passport=require(_0x11af('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x11af('0x2'));var authService=require(_0x11af('0x3'));router[_0x11af('0x4')]('/',controller[_0x11af('0x5')]);router[_0x11af('0x4')](_0x11af('0x6'),controller['callback'],authService[_0x11af('0x7')],userController[_0x11af('0x5')],authService[_0x11af('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index e067190..14a1ef8 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 _0x2d4d=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','generate','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/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.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent'];(function(_0x4fa66f,_0x4d618a){var _0x41b38c=function(_0x55a4c4){while(--_0x55a4c4){_0x4fa66f['push'](_0x4fa66f['shift']());}};_0x41b38c(++_0x4d618a);}(_0x2d4d,0x94));var _0xd2d4=function(_0x431275,_0xc22027){_0x431275=_0x431275-0x0;var _0x497f80=_0x2d4d[_0x431275];return _0x497f80;};'use strict';var util=require(_0xd2d4('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xd2d4('0x1'));var _=require(_0xd2d4('0x2'));var rs=require(_0xd2d4('0x3'));var moment=require(_0xd2d4('0x4'));var db=require(_0xd2d4('0x5'))['db'];var authService=require(_0xd2d4('0x6'));var utils=require(_0xd2d4('0x7'));var client=jayson[_0xd2d4('0x8')][_0xd2d4('0x9')]({'port':0x232b});function localAuthenticate(_0x471003,_0x56d1e3,_0x23e700,_0x57bae4){var _0x45176e,_0x89452c;return db[_0xd2d4('0xa')][_0xd2d4('0xb')]({'where':{'id':0x1},'attributes':[_0xd2d4('0xc'),_0xd2d4('0xd')],'raw':!![]})[_0xd2d4('0xe')](function(_0x32fc91){_0x45176e=_0x32fc91;return _0x471003[_0xd2d4('0xb')]({'attributes':['id',_0xd2d4('0xf'),_0xd2d4('0x10'),_0xd2d4('0x11'),_0xd2d4('0x12'),_0xd2d4('0x13'),_0xd2d4('0x14'),_0xd2d4('0x15'),_0xd2d4('0x16')],'where':{'name':_0x56d1e3,'role':{'$or':[_0xd2d4('0x17'),_0xd2d4('0x18'),_0xd2d4('0x19')]}}});})[_0xd2d4('0xe')](function(_0x3dc00c){if(!_0x3dc00c||_0x3dc00c&&_0x3dc00c[_0xd2d4('0xf')]!==_0x56d1e3){throw new Error(_0xd2d4('0x1a'));}else{_0x89452c=_0x3dc00c;return _0x89452c;}})[_0xd2d4('0xe')](function(){_0x89452c[_0xd2d4('0x1b')](_0x23e700,function(_0x457c02,_0x390d55){var _0x295041=_0x89452c['loginAttempts']+0x1;if(_0x457c02){return _0x57bae4(_0x457c02);}else if(!_0x390d55){if(_0x89452c[_0xd2d4('0x13')]){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else if(_0x45176e[_0xd2d4('0xc')]>0x0){if(_0x89452c[_0xd2d4('0x14')]){if(_0x45176e['blockDuration']>0x0){if(moment(_0x89452c[_0xd2d4('0x15')])[_0xd2d4('0x1c')](_0x45176e['blockDuration'],_0xd2d4('0x1d'))>moment()){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else{return utils[_0xd2d4('0x1e')](_0x89452c,_0x295041,![],null)[_0xd2d4('0xe')](function(){return _0x57bae4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x57bae4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x295041>=_0x45176e[_0xd2d4('0xc')]){return utils[_0xd2d4('0x1e')](_0x89452c,0x0,!![],moment())[_0xd2d4('0xe')](function(){return _0x57bae4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xd2d4('0x1e')](_0x89452c,_0x295041,![],null)[_0xd2d4('0xe')](function(){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});});}}}else{return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}}else{if(_0x89452c[_0xd2d4('0x13')]){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else if(_0x45176e['allowedLoginAttempts']>0x0){if(_0x89452c[_0xd2d4('0x14')]){if(_0x45176e[_0xd2d4('0xd')]>0x0){if(moment(_0x89452c[_0xd2d4('0x15')])[_0xd2d4('0x1c')](_0x45176e[_0xd2d4('0xd')],_0xd2d4('0x1d'))>moment()){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else{return utils[_0xd2d4('0x1e')](_0x89452c,0x0,![],null)[_0xd2d4('0xe')](function(){return utils[_0xd2d4('0x1f')](_0x89452c);})[_0xd2d4('0xe')](function(){return _0x57bae4(null,_0x89452c);});}}else{return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}}else{return utils['clearBlockUser'](_0x89452c,0x0,![],null)[_0xd2d4('0xe')](function(){return utils[_0xd2d4('0x1f')](_0x89452c);})['then'](function(){return _0x57bae4(null,_0x89452c);})[_0xd2d4('0x20')](function(_0x45ab5d){return _0x57bae4(null,![],_0x45ab5d);});}}else{if(_0x89452c['blocked']){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else{return utils[_0xd2d4('0x1f')](_0x89452c)[_0xd2d4('0xe')](function(){return _0x57bae4(null,_0x89452c);});}}}});})['catch'](function(_0x292d16){return _0x57bae4(null,![],_0x292d16);});}function sendServiceMail(_0x3aeffe){return db[_0xd2d4('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xd2d4('0xf'),_0xd2d4('0x22')],'include':[{'model':db[_0xd2d4('0x23')],'as':'Smtp'}]})['then'](function(_0x4bc51e){if(!_0x4bc51e){throw new Error(_0xd2d4('0x24'));}var _0x259dc6={'tls':{'rejectUnauthorized':![]}};if(_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x26')]){_0x259dc6[_0xd2d4('0x26')]=_0x4bc51e[_0xd2d4('0x25')]['service'];}else{_0x259dc6['host']=_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x27')];_0x259dc6['port']=_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x28')];_0x259dc6['secure']=_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x29')];}if(_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x2a')]){_0x259dc6[_0xd2d4('0x2b')]={'user':_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x18')],'pass':_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x2c')]};}var _0x14ab8f={'account':_0x259dc6,'message':_['merge']({'from':util[_0xd2d4('0x2d')](_0xd2d4('0x2e'),_0x4bc51e[_0xd2d4('0xf')],_0x4bc51e['email']||_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x18')])},_0x3aeffe)};return client['request']('SendMail',_0x14ab8f);})[_0xd2d4('0xe')](function(_0x530d7d){if(_0x530d7d['error']){throw new Error(util[_0xd2d4('0x2d')](_0xd2d4('0x2f'),_0x530d7d[_0xd2d4('0x30')][_0xd2d4('0x31')]||JSON[_0xd2d4('0x32')](_0x530d7d[_0xd2d4('0x30')])));}return!![];});}function handleError(_0x22bb30,_0xd88d68,_0x39af3d){return _0x22bb30[_0xd2d4('0x33')](_0xd88d68||0x1f4)[_0xd2d4('0x34')]({'message':_0x39af3d?_0x39af3d[_0xd2d4('0x31')]||_0x39af3d:''});}exports[_0xd2d4('0x35')]=function(_0x3dbe4c,_0x321cd6,_0x56278f){passport[_0xd2d4('0x1b')]('local',function(_0x34b204,_0x9a3410,_0x126e40){var _0x4d1ef7=_0x34b204||_0x126e40;if(_0x4d1ef7){return handleError(_0x321cd6,0x191,_0x4d1ef7);}if(!_0x9a3410){return handleError(_0x321cd6,0x194,{'message':_0xd2d4('0x36')});}else{var _0x19aa39={'payload':{'id':_0x9a3410['id'],'role':_0x9a3410['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x19aa39)[_0xd2d4('0xe')](function(_0x45544f){_0x321cd6['json']({'id':_0x9a3410['id'],'token':_0x45544f,'statusCall':'','isAlreadyLogged':_0x9a3410[_0xd2d4('0x37')]});});}})(_0x3dbe4c,_0x321cd6,_0x56278f);};exports[_0xd2d4('0x38')]=function(_0x5a7e0c,_0x3170d6,_0x10a882){if(!_0x5a7e0c[_0xd2d4('0x39')]['email']){return handleError(_0x3170d6,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x10af94=rs[_0xd2d4('0x3a')]();_0x5a7e0c[_0xd2d4('0x39')][_0xd2d4('0x22')]=_0x5a7e0c[_0xd2d4('0x39')]['email'][_0xd2d4('0x3b')]()[_0xd2d4('0x3c')]();var _0x4cd61f;return db['Setting'][_0xd2d4('0xb')]({'where':{'id':0x1},'attributes':[_0xd2d4('0xc'),'blockDuration'],'raw':!![]})[_0xd2d4('0xe')](function(_0x332be1){_0x4cd61f=_0x332be1;return db[_0xd2d4('0x3d')][_0xd2d4('0x3e')]({'where':{'email':_0x5a7e0c[_0xd2d4('0x39')]['email']}});})[_0xd2d4('0xe')](function(_0xeca5d4){if(!_0xeca5d4){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xeca5d4[_0xd2d4('0x13')]){throw new Error(_0xd2d4('0x3f'));}if(_0xeca5d4['blocked']){if(moment(_0xeca5d4[_0xd2d4('0x15')])[_0xd2d4('0x1c')](_0x4cd61f[_0xd2d4('0xd')],_0xd2d4('0x1d'))>moment()){throw new Error(_0xd2d4('0x40'));}else{_0xeca5d4['blocked']=![];_0xeca5d4['blockedAt']=null;}}_0xeca5d4[_0xd2d4('0x41')]=_0x10af94;_0xeca5d4['resetPasswordExpires']=Date['now']()+0x36ee80;return _0xeca5d4[_0xd2d4('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x5a7e0c['body'][_0xd2d4('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xd2d4('0x43')+_0xd2d4('0x44')+_0xd2d4('0x45')+_0x5a7e0c[_0xd2d4('0x46')][_0xd2d4('0x27')]+_0xd2d4('0x47')+_0x10af94+'\x0a\x0a'+_0xd2d4('0x48')});})[_0xd2d4('0xe')](function(){_0x3170d6[_0xd2d4('0x33')](0xc8)[_0xd2d4('0x34')]({'message':_0xd2d4('0x49')});})['catch'](function(_0x53bbe0){return handleError(_0x3170d6,0x1f4,_0x53bbe0);});};exports[_0xd2d4('0x4a')]=function(_0x19a558,_0x1e5b2c,_0x1cce3e){return db[_0xd2d4('0x3d')][_0xd2d4('0x3e')]({'where':{'resetPasswordToken':_0x19a558[_0xd2d4('0x4b')][_0xd2d4('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xd2d4('0x4d')]()}}})[_0xd2d4('0xe')](function(_0x3f6570){if(!_0x3f6570){throw new Error(_0xd2d4('0x4e'));}return db[_0xd2d4('0xa')][_0xd2d4('0xb')]({'attributes':['id','securePassword',_0xd2d4('0x4f'),_0xd2d4('0x50')]})[_0xd2d4('0xe')](function(_0x562188){if(_0x562188[_0xd2d4('0x51')])authService[_0xd2d4('0x52')](_0x19a558[_0xd2d4('0x39')]['password']);if(!_0x562188[_0xd2d4('0x4f')]||!_0x3f6570[_0xd2d4('0x53')])return _0x3f6570;authService[_0xd2d4('0x54')](_0x19a558['body'][_0xd2d4('0x10')],_0x3f6570[_0xd2d4('0x53')],_0x562188['passwordHistoryLimit']);return _0x3f6570;})[_0xd2d4('0xe')](function(){_0x3f6570[_0xd2d4('0x10')]=_0x19a558[_0xd2d4('0x39')][_0xd2d4('0x10')];_0x3f6570[_0xd2d4('0x41')]=null;_0x3f6570['resetPasswordExpires']=null;return _0x3f6570['save']();});})[_0xd2d4('0xe')](function(){_0x1e5b2c[_0xd2d4('0x33')](0xc8)[_0xd2d4('0x34')]({'message':_0xd2d4('0x55')});})[_0xd2d4('0x20')](function(_0x579280){return handleError(_0x1e5b2c,0x1f4,_0x579280);});};passport[_0xd2d4('0x56')](new LocalStrategy({'usernameField':_0xd2d4('0xf'),'passwordField':_0xd2d4('0x10')},function(_0x31e192,_0x25355d,_0x3effc0){return localAuthenticate(db['User'],_0x31e192,_0x25355d,_0x3effc0);})); \ No newline at end of file +var _0x7f3c=['enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','resetPasswordToken','passport-local','jayson/promise','randomstring','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','disabled','blockedAt','user','agent','loginAttempts','blocked','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','minutes','getLicense','catch','MailAccount','find','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','merge','\x22%s\x22\x20<%s>','email','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','role','signToken','json','online','forgot','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','User','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword'];(function(_0x37c9ea,_0x4421c8){var _0x186ae1=function(_0x3e6d87){while(--_0x3e6d87){_0x37c9ea['push'](_0x37c9ea['shift']());}};_0x186ae1(++_0x4421c8);}(_0x7f3c,0x1d3));var _0xc7f3=function(_0x1c3331,_0x49ecd7){_0x1c3331=_0x1c3331-0x0;var _0x4a2b9f=_0x7f3c[_0x1c3331];return _0x4a2b9f;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0xc7f3('0x0'))['Strategy'];var jayson=require(_0xc7f3('0x1'));var _=require('lodash');var rs=require(_0xc7f3('0x2'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xc7f3('0x3'));var utils=require(_0xc7f3('0x4'));var client=jayson['client'][_0xc7f3('0x5')]({'port':0x232b});function localAuthenticate(_0x356245,_0x5ec722,_0x13c864,_0x5a0d5e){var _0x1ec02b,_0x9ee025;return db[_0xc7f3('0x6')][_0xc7f3('0x7')]({'where':{'id':0x1},'attributes':[_0xc7f3('0x8'),_0xc7f3('0x9')],'raw':!![]})[_0xc7f3('0xa')](function(_0xa17e6a){_0x1ec02b=_0xa17e6a;return _0x356245[_0xc7f3('0x7')]({'attributes':['id',_0xc7f3('0xb'),_0xc7f3('0xc'),_0xc7f3('0xd'),'role',_0xc7f3('0xe'),'blocked',_0xc7f3('0xf'),'loginAttempts'],'where':{'name':_0x5ec722,'role':{'$or':['admin',_0xc7f3('0x10'),_0xc7f3('0x11')]}}});})[_0xc7f3('0xa')](function(_0x4d1f60){if(!_0x4d1f60||_0x4d1f60&&_0x4d1f60['name']!==_0x5ec722){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x9ee025=_0x4d1f60;return _0x9ee025;}})[_0xc7f3('0xa')](function(){_0x9ee025['authenticate'](_0x13c864,function(_0x808715,_0x214408){var _0x105111=_0x9ee025[_0xc7f3('0x12')]+0x1;if(_0x808715){return _0x5a0d5e(_0x808715);}else if(!_0x214408){if(_0x9ee025[_0xc7f3('0xe')]){return _0x5a0d5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1ec02b[_0xc7f3('0x8')]>0x0){if(_0x9ee025[_0xc7f3('0x13')]){if(_0x1ec02b[_0xc7f3('0x9')]>0x0){if(moment(_0x9ee025[_0xc7f3('0xf')])[_0xc7f3('0x14')](_0x1ec02b[_0xc7f3('0x9')],'minutes')>moment()){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});}else{return utils[_0xc7f3('0x16')](_0x9ee025,_0x105111,![],null)['then'](function(){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});});}}else{return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});}}else{if(_0x105111>=_0x1ec02b[_0xc7f3('0x8')]){return utils[_0xc7f3('0x16')](_0x9ee025,0x0,!![],moment())[_0xc7f3('0xa')](function(){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});});}else{return utils['clearBlockUser'](_0x9ee025,_0x105111,![],null)[_0xc7f3('0xa')](function(){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});});}}}else{return _0x5a0d5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x9ee025[_0xc7f3('0xe')]){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});}else if(_0x1ec02b['allowedLoginAttempts']>0x0){if(_0x9ee025[_0xc7f3('0x13')]){if(_0x1ec02b[_0xc7f3('0x9')]>0x0){if(moment(_0x9ee025[_0xc7f3('0xf')])[_0xc7f3('0x14')](_0x1ec02b['blockDuration'],_0xc7f3('0x17'))>moment()){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});}else{return utils[_0xc7f3('0x16')](_0x9ee025,0x0,![],null)[_0xc7f3('0xa')](function(){return utils[_0xc7f3('0x18')](_0x9ee025);})[_0xc7f3('0xa')](function(){return _0x5a0d5e(null,_0x9ee025);});}}else{return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});}}else{return utils[_0xc7f3('0x16')](_0x9ee025,0x0,![],null)[_0xc7f3('0xa')](function(){return utils[_0xc7f3('0x18')](_0x9ee025);})['then'](function(){return _0x5a0d5e(null,_0x9ee025);})[_0xc7f3('0x19')](function(_0x17211f){return _0x5a0d5e(null,![],_0x17211f);});}}else{if(_0x9ee025[_0xc7f3('0x13')]){return _0x5a0d5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc7f3('0x18')](_0x9ee025)['then'](function(){return _0x5a0d5e(null,_0x9ee025);});}}}});})[_0xc7f3('0x19')](function(_0x4a6aad){return _0x5a0d5e(null,![],_0x4a6aad);});}function sendServiceMail(_0x49d57c){return db[_0xc7f3('0x1a')][_0xc7f3('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xc7f3('0xb'),'email'],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xc7f3('0xa')](function(_0x3ef07f){if(!_0x3ef07f){throw new Error(_0xc7f3('0x1c'));}var _0x3566a3={'tls':{'rejectUnauthorized':![]}};if(_0x3ef07f['Smtp']['service']){_0x3566a3[_0xc7f3('0x1d')]=_0x3ef07f[_0xc7f3('0x1e')]['service'];}else{_0x3566a3['host']=_0x3ef07f['Smtp'][_0xc7f3('0x1f')];_0x3566a3[_0xc7f3('0x20')]=_0x3ef07f[_0xc7f3('0x1e')][_0xc7f3('0x20')];_0x3566a3[_0xc7f3('0x21')]=_0x3ef07f[_0xc7f3('0x1e')]['secure'];}if(_0x3ef07f[_0xc7f3('0x1e')][_0xc7f3('0x22')]){_0x3566a3[_0xc7f3('0x23')]={'user':_0x3ef07f[_0xc7f3('0x1e')][_0xc7f3('0x10')],'pass':_0x3ef07f[_0xc7f3('0x1e')]['pass']};}var _0x47274d={'account':_0x3566a3,'message':_[_0xc7f3('0x24')]({'from':util['format'](_0xc7f3('0x25'),_0x3ef07f[_0xc7f3('0xb')],_0x3ef07f[_0xc7f3('0x26')]||_0x3ef07f[_0xc7f3('0x1e')][_0xc7f3('0x10')])},_0x49d57c)};return client[_0xc7f3('0x27')](_0xc7f3('0x28'),_0x47274d);})[_0xc7f3('0xa')](function(_0x593e99){if(_0x593e99[_0xc7f3('0x29')]){throw new Error(util[_0xc7f3('0x2a')](_0xc7f3('0x2b'),_0x593e99['error'][_0xc7f3('0x2c')]||JSON['stringify'](_0x593e99['error'])));}return!![];});}function handleError(_0x1b8a02,_0x7408a2,_0x560f76){return _0x1b8a02[_0xc7f3('0x2d')](_0x7408a2||0x1f4)['send']({'message':_0x560f76?_0x560f76[_0xc7f3('0x2c')]||_0x560f76:''});}exports[_0xc7f3('0x2e')]=function(_0x444024,_0x1204b1,_0x451f1d){passport['authenticate']('local',function(_0x4e49f9,_0x454d07,_0x145890){var _0x20a1a6=_0x4e49f9||_0x145890;if(_0x20a1a6){return handleError(_0x1204b1,0x191,_0x20a1a6);}if(!_0x454d07){return handleError(_0x1204b1,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4ba037={'payload':{'id':_0x454d07['id'],'role':_0x454d07[_0xc7f3('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0xc7f3('0x30')](_0x4ba037)[_0xc7f3('0xa')](function(_0x4060d6){_0x1204b1[_0xc7f3('0x31')]({'id':_0x454d07['id'],'token':_0x4060d6,'statusCall':'','isAlreadyLogged':_0x454d07[_0xc7f3('0x32')]});});}})(_0x444024,_0x1204b1,_0x451f1d);};exports[_0xc7f3('0x33')]=function(_0x1b2cbc,_0x3781a4,_0x4853e4){if(!_0x1b2cbc['body'][_0xc7f3('0x26')]){return handleError(_0x3781a4,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x122c8e=rs['generate']();_0x1b2cbc[_0xc7f3('0x34')]['email']=_0x1b2cbc['body'][_0xc7f3('0x26')][_0xc7f3('0x35')]()[_0xc7f3('0x36')]();var _0x135953;return db['Setting'][_0xc7f3('0x7')]({'where':{'id':0x1},'attributes':[_0xc7f3('0x8'),_0xc7f3('0x9')],'raw':!![]})['then'](function(_0x476321){_0x135953=_0x476321;return db['User'][_0xc7f3('0x1b')]({'where':{'email':_0x1b2cbc[_0xc7f3('0x34')][_0xc7f3('0x26')]}});})[_0xc7f3('0xa')](function(_0x29bbd8){if(!_0x29bbd8){throw new Error(_0xc7f3('0x37'));}if(_0x29bbd8[_0xc7f3('0xe')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x29bbd8[_0xc7f3('0x13')]){if(moment(_0x29bbd8[_0xc7f3('0xf')])[_0xc7f3('0x14')](_0x135953[_0xc7f3('0x9')],_0xc7f3('0x17'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x29bbd8[_0xc7f3('0x13')]=![];_0x29bbd8['blockedAt']=null;}}_0x29bbd8['resetPasswordToken']=_0x122c8e;_0x29bbd8[_0xc7f3('0x38')]=Date[_0xc7f3('0x39')]()+0x36ee80;return _0x29bbd8[_0xc7f3('0x3a')]();})[_0xc7f3('0xa')](function(){return sendServiceMail({'to':_0x1b2cbc[_0xc7f3('0x34')][_0xc7f3('0x26')],'subject':_0xc7f3('0x3b'),'text':_0xc7f3('0x3c')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xc7f3('0x3d')+_0x1b2cbc[_0xc7f3('0x3e')][_0xc7f3('0x1f')]+_0xc7f3('0x3f')+_0x122c8e+'\x0a\x0a'+_0xc7f3('0x40')});})['then'](function(){_0x3781a4['status'](0xc8)[_0xc7f3('0x41')]({'message':_0xc7f3('0x42')});})[_0xc7f3('0x19')](function(_0x11f5b2){return handleError(_0x3781a4,0x1f4,_0x11f5b2);});};exports[_0xc7f3('0x43')]=function(_0x162ad3,_0x452e32,_0x577efa){return db[_0xc7f3('0x44')][_0xc7f3('0x1b')]({'where':{'resetPasswordToken':_0x162ad3[_0xc7f3('0x45')]['token'],'resetPasswordExpires':{'$gt':Date[_0xc7f3('0x39')]()}}})[_0xc7f3('0xa')](function(_0x214f3e){if(!_0x214f3e){throw new Error(_0xc7f3('0x46'));}return db['Setting']['findOne']({'attributes':['id',_0xc7f3('0x47'),_0xc7f3('0x48'),_0xc7f3('0x49')]})[_0xc7f3('0xa')](function(_0x59f74a){if(_0x59f74a[_0xc7f3('0x47')])authService[_0xc7f3('0x4a')](_0x162ad3[_0xc7f3('0x34')]['password']);if(!_0x59f74a[_0xc7f3('0x48')]||!_0x214f3e['previousPasswords'])return _0x214f3e;authService[_0xc7f3('0x4b')](_0x162ad3[_0xc7f3('0x34')]['password'],_0x214f3e['previousPasswords'],_0x59f74a[_0xc7f3('0x49')]);return _0x214f3e;})[_0xc7f3('0xa')](function(){_0x214f3e[_0xc7f3('0xc')]=_0x162ad3[_0xc7f3('0x34')]['password'];_0x214f3e[_0xc7f3('0x4c')]=null;_0x214f3e[_0xc7f3('0x38')]=null;return _0x214f3e[_0xc7f3('0x3a')]();});})[_0xc7f3('0xa')](function(){_0x452e32[_0xc7f3('0x2d')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xc7f3('0x19')](function(_0x23b058){return handleError(_0x452e32,0x1f4,_0x23b058);});};passport['use'](new LocalStrategy({'usernameField':_0xc7f3('0xb'),'passwordField':_0xc7f3('0xc')},function(_0x454cee,_0x1113f2,_0x28e61f){return localAuthenticate(db['User'],_0x454cee,_0x1113f2,_0x28e61f);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 1ba98bd..705f58b 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 _0x368e=['express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x3ab4fa,_0xfb4d70){var _0x489ea3=function(_0x42dc4d){while(--_0x42dc4d){_0x3ab4fa['push'](_0x3ab4fa['shift']());}};_0x489ea3(++_0xfb4d70);}(_0x368e,0xfa));var _0xe368=function(_0x2093f0,_0x1f903c){_0x2093f0=_0x2093f0-0x0;var _0x37829f=_0x368e[_0x2093f0];return _0x37829f;};'use strict';var express=require(_0xe368('0x0'));var router=express[_0xe368('0x1')]();var controller=require(_0xe368('0x2'));router[_0xe368('0x3')]('/',controller[_0xe368('0x4')]);router[_0xe368('0x3')](_0xe368('0x5'),controller[_0xe368('0x6')]);router[_0xe368('0x3')](_0xe368('0x7'),controller[_0xe368('0x8')]);module[_0xe368('0x9')]=router; \ No newline at end of file +var _0x0275=['/forgot','forgot','post','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x4377cc,_0x24ab80){var _0x2b10cf=function(_0x283a4a){while(--_0x283a4a){_0x4377cc['push'](_0x4377cc['shift']());}};_0x2b10cf(++_0x24ab80);}(_0x0275,0x1bf));var _0x5027=function(_0x223583,_0x49a46c){_0x223583=_0x223583-0x0;var _0x52819b=_0x0275[_0x223583];return _0x52819b;};'use strict';var express=require(_0x5027('0x0'));var router=express[_0x5027('0x1')]();var controller=require(_0x5027('0x2'));router['post']('/',controller['login']);router['post'](_0x5027('0x3'),controller[_0x5027('0x4')]);router[_0x5027('0x5')](_0x5027('0x6'),controller[_0x5027('0x7')]);module[_0x5027('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 8d7eac9..ae7440e 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 _0x5dc6=['exports','STRING','INTEGER','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5dc6,0x157));var _0x65dc=function(_0x47ace1,_0x1e7b27){_0x47ace1=_0x47ace1-0x0;var _0xce8451=_0x5dc6[_0x47ace1];return _0xce8451;};'use strict';var Sequelize=require(_0x65dc('0x0'));module[_0x65dc('0x1')]={'name':{'type':Sequelize[_0x65dc('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x65dc('0x2')]},'description':{'type':Sequelize[_0x65dc('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x65dc('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x7171=['sequelize','exports','STRING','INTEGER'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7171,0x198));var _0x1717=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x7171[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require(_0x1717('0x0'));module[_0x1717('0x1')]={'name':{'type':Sequelize[_0x1717('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x1717('0x2')]},'description':{'type':Sequelize[_0x1717('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1717('0x3')],'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 54936bb..adb9859 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 _0x6c19=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','then','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','options','Automation','includeAll','include','findAll','rows','catch','params','length','find','create','update','body','addConditions','omit','ids','getConditions','nolimit','Action','addActions','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x1917cd,_0x15a27f){var _0x423333=function(_0x55791e){while(--_0x55791e){_0x1917cd['push'](_0x1917cd['shift']());}};_0x423333(++_0x15a27f);}(_0x6c19,0xa0));var _0x96c1=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x6c19[_0x3a73bc];return _0x32891b;};'use strict';var emlformat=require(_0x96c1('0x0'));var rimraf=require(_0x96c1('0x1'));var zipdir=require(_0x96c1('0x2'));var jsonpatch=require(_0x96c1('0x3'));var rp=require(_0x96c1('0x4'));var moment=require('moment');var BPromise=require(_0x96c1('0x5'));var Mustache=require(_0x96c1('0x6'));var util=require(_0x96c1('0x7'));var path=require(_0x96c1('0x8'));var sox=require(_0x96c1('0x9'));var csv=require(_0x96c1('0xa'));var ejs=require(_0x96c1('0xb'));var fs=require('fs');var fs_extra=require(_0x96c1('0xc'));var _=require(_0x96c1('0xd'));var squel=require(_0x96c1('0xe'));var crypto=require(_0x96c1('0xf'));var jsforce=require(_0x96c1('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96c1('0x11'));var Papa=require('papaparse');var Redis=require(_0x96c1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x96c1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96c1('0x14'));var logger=require(_0x96c1('0x15'))('api');var utils=require(_0x96c1('0x16'));var config=require(_0x96c1('0x17'));var licenseUtil=require(_0x96c1('0x18'));var db=require(_0x96c1('0x19'))['db'];function respondWithStatusCode(_0x2bf790,_0x3f9c62){_0x3f9c62=_0x3f9c62||0xcc;return function(_0x265f98){if(_0x265f98){return _0x2bf790[_0x96c1('0x1a')](_0x3f9c62);}return _0x2bf790[_0x96c1('0x1b')](_0x3f9c62)[_0x96c1('0x1c')]();};}function respondWithResult(_0x536d05,_0x3cf014){_0x3cf014=_0x3cf014||0xc8;return function(_0x40d0d7){if(_0x40d0d7){return _0x536d05[_0x96c1('0x1b')](_0x3cf014)[_0x96c1('0x1d')](_0x40d0d7);}};}function respondWithFilteredResult(_0x154f0a,_0x3e8a57){return function(_0x173489){if(_0x173489){var _0x359d7f=typeof _0x3e8a57[_0x96c1('0x1e')]==='undefined'&&typeof _0x3e8a57['limit']==='undefined';var _0x48dd65=_0x173489[_0x96c1('0x1f')];var _0x549a2c=_0x359d7f?0x0:_0x3e8a57[_0x96c1('0x1e')];var _0x3b0d30=_0x359d7f?_0x173489['count']:_0x3e8a57[_0x96c1('0x1e')]+_0x3e8a57[_0x96c1('0x20')];var _0x422ede;if(_0x3b0d30>=_0x48dd65){_0x3b0d30=_0x48dd65;_0x422ede=0xc8;}else{_0x422ede=0xce;}_0x154f0a['status'](_0x422ede);return _0x154f0a[_0x96c1('0x21')](_0x96c1('0x22'),_0x549a2c+'-'+_0x3b0d30+'/'+_0x48dd65)[_0x96c1('0x1d')](_0x173489);}return null;};}function patchUpdates(_0x518917){return function(_0x53e36b){try{jsonpatch[_0x96c1('0x23')](_0x53e36b,_0x518917,!![]);}catch(_0x43a0b0){return BPromise[_0x96c1('0x24')](_0x43a0b0);}return _0x53e36b[_0x96c1('0x25')]();};}function saveUpdates(_0x28d302,_0x34337c){return function(_0x215462){if(_0x215462){return _0x215462['update'](_0x28d302)[_0x96c1('0x26')](function(_0x223c69){return _0x223c69;});}return null;};}function removeEntity(_0x1f336c,_0x101359){return function(_0x776c70){if(_0x776c70){return _0x776c70['destroy']()[_0x96c1('0x26')](function(){_0x1f336c[_0x96c1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x139f84,_0x47602d){return function(_0x16b69f){if(!_0x16b69f){_0x139f84[_0x96c1('0x1a')](0x194);}return _0x16b69f;};}function handleError(_0x165f72,_0x38d90c){_0x38d90c=_0x38d90c||0x1f4;return function(_0x4848e3){logger[_0x96c1('0x27')](_0x4848e3['stack']);if(_0x4848e3[_0x96c1('0x28')]){delete _0x4848e3[_0x96c1('0x28')];}_0x165f72['status'](_0x38d90c)['send'](_0x4848e3);};}exports[_0x96c1('0x29')]=function(_0x4a5855,_0x3be430){var _0x294d6a={},_0x1de30a={},_0x974fb3={'count':0x0,'rows':[]};var _0x2b99a5=_[_0x96c1('0x2a')](db['Automation'][_0x96c1('0x2b')],function(_0x58d7a2){return{'name':_0x58d7a2[_0x96c1('0x2c')],'type':_0x58d7a2[_0x96c1('0x2d')][_0x96c1('0x2e')]};});_0x1de30a[_0x96c1('0x2f')]=_['map'](_0x2b99a5,'name');_0x1de30a[_0x96c1('0x30')]=_[_0x96c1('0x31')](_0x4a5855['query']);_0x1de30a[_0x96c1('0x32')]=_[_0x96c1('0x33')](_0x1de30a[_0x96c1('0x2f')],_0x1de30a[_0x96c1('0x30')]);_0x294d6a[_0x96c1('0x34')]=_[_0x96c1('0x33')](_0x1de30a[_0x96c1('0x2f')],qs[_0x96c1('0x35')](_0x4a5855[_0x96c1('0x30')][_0x96c1('0x35')]));_0x294d6a[_0x96c1('0x34')]=_0x294d6a[_0x96c1('0x34')]['length']?_0x294d6a['attributes']:_0x1de30a[_0x96c1('0x2f')];if(!_0x4a5855[_0x96c1('0x30')][_0x96c1('0x36')]('nolimit')){_0x294d6a[_0x96c1('0x20')]=qs[_0x96c1('0x20')](_0x4a5855[_0x96c1('0x30')]['limit']);_0x294d6a[_0x96c1('0x1e')]=qs['offset'](_0x4a5855[_0x96c1('0x30')][_0x96c1('0x1e')]);}_0x294d6a[_0x96c1('0x37')]=qs['sort'](_0x4a5855['query'][_0x96c1('0x38')]);_0x294d6a['where']=qs['filters'](_[_0x96c1('0x39')](_0x4a5855['query'],_0x1de30a[_0x96c1('0x32')]),_0x2b99a5);if(_0x4a5855[_0x96c1('0x30')][_0x96c1('0x3a')]){_0x294d6a[_0x96c1('0x3b')]=_[_0x96c1('0x3c')](_0x294d6a[_0x96c1('0x3b')],{'$or':_[_0x96c1('0x2a')](_0x2b99a5,function(_0x3a534){if(_0x3a534[_0x96c1('0x2d')]!=='VIRTUAL'){var _0x53846a={};_0x53846a[_0x3a534[_0x96c1('0x28')]]={'$like':'%'+_0x4a5855[_0x96c1('0x30')][_0x96c1('0x3a')]+'%'};return _0x53846a;}})});}_0x294d6a=_[_0x96c1('0x3c')]({},_0x294d6a,_0x4a5855[_0x96c1('0x3d')]);var _0x47803b={'where':_0x294d6a[_0x96c1('0x3b')]};return db[_0x96c1('0x3e')][_0x96c1('0x1f')](_0x47803b)[_0x96c1('0x26')](function(_0x10625c){_0x974fb3['count']=_0x10625c;if(_0x4a5855[_0x96c1('0x30')][_0x96c1('0x3f')]){_0x294d6a[_0x96c1('0x40')]=[{'all':!![]}];}return db[_0x96c1('0x3e')][_0x96c1('0x41')](_0x294d6a);})[_0x96c1('0x26')](function(_0x505d3c){_0x974fb3[_0x96c1('0x42')]=_0x505d3c;return _0x974fb3;})['then'](respondWithFilteredResult(_0x3be430,_0x294d6a))[_0x96c1('0x43')](handleError(_0x3be430,null));};exports['show']=function(_0x2817c5,_0x70727d){var _0x4f9e86={'raw':![],'where':{'id':_0x2817c5[_0x96c1('0x44')]['id']}},_0x1f86f3={};_0x1f86f3[_0x96c1('0x2f')]=_[_0x96c1('0x31')](db[_0x96c1('0x3e')][_0x96c1('0x2b')]);_0x1f86f3[_0x96c1('0x30')]=_['keys'](_0x2817c5[_0x96c1('0x30')]);_0x1f86f3[_0x96c1('0x32')]=_['intersection'](_0x1f86f3['model'],_0x1f86f3[_0x96c1('0x30')]);_0x4f9e86[_0x96c1('0x34')]=_[_0x96c1('0x33')](_0x1f86f3['model'],qs['fields'](_0x2817c5['query'][_0x96c1('0x35')]));_0x4f9e86[_0x96c1('0x34')]=_0x4f9e86['attributes'][_0x96c1('0x45')]?_0x4f9e86[_0x96c1('0x34')]:_0x1f86f3[_0x96c1('0x2f')];if(_0x2817c5[_0x96c1('0x30')][_0x96c1('0x3f')]){_0x4f9e86[_0x96c1('0x40')]=[{'all':!![]}];}_0x4f9e86=_[_0x96c1('0x3c')]({},_0x4f9e86,_0x2817c5[_0x96c1('0x3d')]);return db[_0x96c1('0x3e')][_0x96c1('0x46')](_0x4f9e86)[_0x96c1('0x26')](handleEntityNotFound(_0x70727d,null))['then'](respondWithResult(_0x70727d,null))[_0x96c1('0x43')](handleError(_0x70727d,null));};exports['create']=function(_0x42803f,_0x5c99a1){return db[_0x96c1('0x3e')][_0x96c1('0x47')](_0x42803f['body'],{})[_0x96c1('0x26')](respondWithResult(_0x5c99a1,0xc9))[_0x96c1('0x43')](handleError(_0x5c99a1,null));};exports[_0x96c1('0x48')]=function(_0x33007a,_0x4b73eb){if(_0x33007a[_0x96c1('0x49')]['id']){delete _0x33007a['body']['id'];}return db[_0x96c1('0x3e')]['find']({'where':{'id':_0x33007a['params']['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x4b73eb,null))[_0x96c1('0x26')](saveUpdates(_0x33007a[_0x96c1('0x49')],null))[_0x96c1('0x26')](respondWithResult(_0x4b73eb,null))[_0x96c1('0x43')](handleError(_0x4b73eb,null));};exports['destroy']=function(_0x4fd64a,_0x180a8d){return db['Automation']['find']({'where':{'id':_0x4fd64a['params']['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x180a8d,null))['then'](removeEntity(_0x180a8d,null))['catch'](handleError(_0x180a8d,null));};exports[_0x96c1('0x4a')]=function(_0x4bf756,_0x50a53e,_0x574440){return db['Condition'][_0x96c1('0x46')]({'where':{'id':_0x4bf756[_0x96c1('0x44')]['id']}})['then'](handleEntityNotFound(_0x50a53e,null))['then'](function(_0x270b39){if(_0x270b39){return _0x270b39[_0x96c1('0x4a')](_0x4bf756[_0x96c1('0x49')]['ids'],_[_0x96c1('0x4b')](_0x4bf756[_0x96c1('0x49')],[_0x96c1('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x50a53e,null))[_0x96c1('0x43')](handleError(_0x50a53e,null));};exports['getConditions']=function(_0x441dcc,_0x1ae8f1,_0x1ea1d6){var _0x2c8415={};var _0x36bc7d={};var _0x5345fb;var _0x8723b;return db[_0x96c1('0x3e')]['findOne']({'where':{'id':_0x441dcc[_0x96c1('0x44')]['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x1ae8f1,null))['then'](function(_0x93fa1){if(_0x93fa1){_0x5345fb=_0x93fa1;_0x36bc7d[_0x96c1('0x2f')]=_[_0x96c1('0x31')](db['Condition'][_0x96c1('0x2b')]);_0x36bc7d[_0x96c1('0x30')]=_['keys'](_0x441dcc[_0x96c1('0x30')]);_0x36bc7d[_0x96c1('0x32')]=_[_0x96c1('0x33')](_0x36bc7d[_0x96c1('0x2f')],_0x36bc7d[_0x96c1('0x30')]);_0x2c8415['attributes']=_[_0x96c1('0x33')](_0x36bc7d[_0x96c1('0x2f')],qs['fields'](_0x441dcc[_0x96c1('0x30')][_0x96c1('0x35')]));_0x2c8415[_0x96c1('0x34')]=_0x2c8415[_0x96c1('0x34')]['length']?_0x2c8415[_0x96c1('0x34')]:_0x36bc7d[_0x96c1('0x2f')];_0x2c8415[_0x96c1('0x37')]=qs[_0x96c1('0x38')](_0x441dcc[_0x96c1('0x30')][_0x96c1('0x38')]);_0x2c8415[_0x96c1('0x3b')]=qs[_0x96c1('0x32')](_[_0x96c1('0x39')](_0x441dcc[_0x96c1('0x30')],_0x36bc7d[_0x96c1('0x32')]));if(_0x441dcc[_0x96c1('0x30')][_0x96c1('0x3a')]){_0x2c8415[_0x96c1('0x3b')]=_['merge'](_0x2c8415['where'],{'$or':_['map'](_0x2c8415[_0x96c1('0x34')],function(_0x3ae174){var _0x5e2808={};_0x5e2808[_0x3ae174]={'$like':'%'+_0x441dcc['query']['filter']+'%'};return _0x5e2808;})});}_0x2c8415=_[_0x96c1('0x3c')]({},_0x2c8415,_0x441dcc[_0x96c1('0x3d')]);return _0x5345fb[_0x96c1('0x4d')](_0x2c8415);}})[_0x96c1('0x26')](function(_0x2f00a0){if(_0x2f00a0){_0x8723b=_0x2f00a0[_0x96c1('0x45')];if(!_0x441dcc[_0x96c1('0x30')][_0x96c1('0x36')](_0x96c1('0x4e'))){_0x2c8415[_0x96c1('0x20')]=qs['limit'](_0x441dcc[_0x96c1('0x30')][_0x96c1('0x20')]);_0x2c8415['offset']=qs['offset'](_0x441dcc[_0x96c1('0x30')]['offset']);}return _0x5345fb['getConditions'](_0x2c8415);}})[_0x96c1('0x26')](function(_0x22828d){if(_0x22828d){return _0x22828d?{'count':_0x8723b,'rows':_0x22828d}:null;}})[_0x96c1('0x26')](respondWithResult(_0x1ae8f1,null))[_0x96c1('0x43')](handleError(_0x1ae8f1,null));};exports['addActions']=function(_0x530be5,_0x3e104f,_0x16b755){return db[_0x96c1('0x4f')][_0x96c1('0x46')]({'where':{'id':_0x530be5[_0x96c1('0x44')]['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x3e104f,null))[_0x96c1('0x26')](function(_0x45577d){if(_0x45577d){return _0x45577d[_0x96c1('0x50')](_0x530be5[_0x96c1('0x49')]['ids'],_[_0x96c1('0x4b')](_0x530be5[_0x96c1('0x49')],[_0x96c1('0x4c'),'id'])||{});}})[_0x96c1('0x26')](respondWithResult(_0x3e104f,null))['catch'](handleError(_0x3e104f,null));};exports[_0x96c1('0x51')]=function(_0x1bc90a,_0x342e00,_0x1beec1){var _0x583f90={};var _0x5e5ea3={};var _0x4f6b66;var _0x821f1a;return db['Automation'][_0x96c1('0x52')]({'where':{'id':_0x1bc90a[_0x96c1('0x44')]['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x342e00,null))[_0x96c1('0x26')](function(_0x2bb636){if(_0x2bb636){_0x4f6b66=_0x2bb636;_0x5e5ea3[_0x96c1('0x2f')]=_[_0x96c1('0x31')](db[_0x96c1('0x4f')][_0x96c1('0x2b')]);_0x5e5ea3[_0x96c1('0x30')]=_[_0x96c1('0x31')](_0x1bc90a[_0x96c1('0x30')]);_0x5e5ea3['filters']=_['intersection'](_0x5e5ea3['model'],_0x5e5ea3[_0x96c1('0x30')]);_0x583f90[_0x96c1('0x34')]=_[_0x96c1('0x33')](_0x5e5ea3[_0x96c1('0x2f')],qs[_0x96c1('0x35')](_0x1bc90a[_0x96c1('0x30')]['fields']));_0x583f90['attributes']=_0x583f90[_0x96c1('0x34')][_0x96c1('0x45')]?_0x583f90[_0x96c1('0x34')]:_0x5e5ea3['model'];_0x583f90['order']=qs['sort'](_0x1bc90a['query'][_0x96c1('0x38')]);_0x583f90['where']=qs['filters'](_['pick'](_0x1bc90a['query'],_0x5e5ea3[_0x96c1('0x32')]));if(_0x1bc90a[_0x96c1('0x30')][_0x96c1('0x3a')]){_0x583f90[_0x96c1('0x3b')]=_['merge'](_0x583f90[_0x96c1('0x3b')],{'$or':_['map'](_0x583f90[_0x96c1('0x34')],function(_0x508776){var _0x52b6c9={};_0x52b6c9[_0x508776]={'$like':'%'+_0x1bc90a[_0x96c1('0x30')][_0x96c1('0x3a')]+'%'};return _0x52b6c9;})});}_0x583f90=_[_0x96c1('0x3c')]({},_0x583f90,_0x1bc90a[_0x96c1('0x3d')]);return _0x4f6b66[_0x96c1('0x51')](_0x583f90);}})[_0x96c1('0x26')](function(_0x2a7b78){if(_0x2a7b78){_0x821f1a=_0x2a7b78['length'];if(!_0x1bc90a[_0x96c1('0x30')]['hasOwnProperty']('nolimit')){_0x583f90['limit']=qs[_0x96c1('0x20')](_0x1bc90a[_0x96c1('0x30')][_0x96c1('0x20')]);_0x583f90[_0x96c1('0x1e')]=qs[_0x96c1('0x1e')](_0x1bc90a['query'][_0x96c1('0x1e')]);}return _0x4f6b66[_0x96c1('0x51')](_0x583f90);}})['then'](function(_0x12a455){if(_0x12a455){return _0x12a455?{'count':_0x821f1a,'rows':_0x12a455}:null;}})[_0x96c1('0x26')](respondWithResult(_0x342e00,null))[_0x96c1('0x43')](handleError(_0x342e00,null));}; \ No newline at end of file +var _0x205d=['status','end','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Automation','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','Condition','ids','getConditions','findOne','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5906a5,_0x48af0a){var _0x1b9a31=function(_0x4b72ac){while(--_0x4b72ac){_0x5906a5['push'](_0x5906a5['shift']());}};_0x1b9a31(++_0x48af0a);}(_0x205d,0x1da));var _0xd205=function(_0x39507b,_0x3efdac){_0x39507b=_0x39507b-0x0;var _0x5e7dd4=_0x205d[_0x39507b];return _0x5e7dd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd205('0x0'));var zipdir=require(_0xd205('0x1'));var jsonpatch=require(_0xd205('0x2'));var rp=require(_0xd205('0x3'));var moment=require('moment');var BPromise=require(_0xd205('0x4'));var Mustache=require('mustache');var util=require(_0xd205('0x5'));var path=require(_0xd205('0x6'));var sox=require(_0xd205('0x7'));var csv=require('to-csv');var ejs=require(_0xd205('0x8'));var fs=require('fs');var fs_extra=require(_0xd205('0x9'));var _=require('lodash');var squel=require(_0xd205('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd205('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd205('0xc'));var Papa=require(_0xd205('0xd'));var Redis=require(_0xd205('0xe'));var authService=require(_0xd205('0xf'));var qs=require(_0xd205('0x10'));var as=require(_0xd205('0x11'));var hardwareService=require(_0xd205('0x12'));var logger=require(_0xd205('0x13'))('api');var utils=require(_0xd205('0x14'));var config=require(_0xd205('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd205('0x16'))['db'];function respondWithStatusCode(_0x16d880,_0x1c91f8){_0x1c91f8=_0x1c91f8||0xcc;return function(_0x330b58){if(_0x330b58){return _0x16d880[_0xd205('0x17')](_0x1c91f8);}return _0x16d880[_0xd205('0x18')](_0x1c91f8)[_0xd205('0x19')]();};}function respondWithResult(_0x5c71b0,_0x4fada9){_0x4fada9=_0x4fada9||0xc8;return function(_0xe8e8e8){if(_0xe8e8e8){return _0x5c71b0[_0xd205('0x18')](_0x4fada9)['json'](_0xe8e8e8);}};}function respondWithFilteredResult(_0x20df59,_0x5e9154){return function(_0x59c8f5){if(_0x59c8f5){var _0x108506=typeof _0x5e9154[_0xd205('0x1a')]==='undefined'&&typeof _0x5e9154[_0xd205('0x1b')]===_0xd205('0x1c');var _0x5eb550=_0x59c8f5[_0xd205('0x1d')];var _0x1a5fbe=_0x108506?0x0:_0x5e9154['offset'];var _0x1f13d5=_0x108506?_0x59c8f5[_0xd205('0x1d')]:_0x5e9154['offset']+_0x5e9154[_0xd205('0x1b')];var _0x145092;if(_0x1f13d5>=_0x5eb550){_0x1f13d5=_0x5eb550;_0x145092=0xc8;}else{_0x145092=0xce;}_0x20df59[_0xd205('0x18')](_0x145092);return _0x20df59['set'](_0xd205('0x1e'),_0x1a5fbe+'-'+_0x1f13d5+'/'+_0x5eb550)[_0xd205('0x1f')](_0x59c8f5);}return null;};}function patchUpdates(_0x9e0a5f){return function(_0x40aaa6){try{jsonpatch[_0xd205('0x20')](_0x40aaa6,_0x9e0a5f,!![]);}catch(_0x16d2de){return BPromise['reject'](_0x16d2de);}return _0x40aaa6[_0xd205('0x21')]();};}function saveUpdates(_0x18d5d8,_0x594c62){return function(_0x26ced1){if(_0x26ced1){return _0x26ced1[_0xd205('0x22')](_0x18d5d8)[_0xd205('0x23')](function(_0x3b298d){return _0x3b298d;});}return null;};}function removeEntity(_0x2f0b10,_0x38bfdd){return function(_0x1a6c80){if(_0x1a6c80){return _0x1a6c80[_0xd205('0x24')]()[_0xd205('0x23')](function(){_0x2f0b10[_0xd205('0x18')](0xcc)[_0xd205('0x19')]();});}};}function handleEntityNotFound(_0x2d461b,_0x9cf58a){return function(_0x3ec5bb){if(!_0x3ec5bb){_0x2d461b[_0xd205('0x17')](0x194);}return _0x3ec5bb;};}function handleError(_0x6d5c8e,_0x357aa3){_0x357aa3=_0x357aa3||0x1f4;return function(_0x18be85){logger['error'](_0x18be85[_0xd205('0x25')]);if(_0x18be85[_0xd205('0x26')]){delete _0x18be85[_0xd205('0x26')];}_0x6d5c8e[_0xd205('0x18')](_0x357aa3)[_0xd205('0x27')](_0x18be85);};}exports[_0xd205('0x28')]=function(_0x1c9880,_0x2219a7){var _0x845c6c={},_0x387e16={},_0x43ca3e={'count':0x0,'rows':[]};var _0xd49e3=_[_0xd205('0x29')](db['Automation'][_0xd205('0x2a')],function(_0xded885){return{'name':_0xded885[_0xd205('0x2b')],'type':_0xded885['type'][_0xd205('0x2c')]};});_0x387e16[_0xd205('0x2d')]=_[_0xd205('0x29')](_0xd49e3,_0xd205('0x26'));_0x387e16['query']=_[_0xd205('0x2e')](_0x1c9880[_0xd205('0x2f')]);_0x387e16[_0xd205('0x30')]=_[_0xd205('0x31')](_0x387e16[_0xd205('0x2d')],_0x387e16[_0xd205('0x2f')]);_0x845c6c[_0xd205('0x32')]=_[_0xd205('0x31')](_0x387e16['model'],qs[_0xd205('0x33')](_0x1c9880[_0xd205('0x2f')][_0xd205('0x33')]));_0x845c6c[_0xd205('0x32')]=_0x845c6c[_0xd205('0x32')][_0xd205('0x34')]?_0x845c6c[_0xd205('0x32')]:_0x387e16['model'];if(!_0x1c9880['query'][_0xd205('0x35')](_0xd205('0x36'))){_0x845c6c[_0xd205('0x1b')]=qs[_0xd205('0x1b')](_0x1c9880[_0xd205('0x2f')][_0xd205('0x1b')]);_0x845c6c[_0xd205('0x1a')]=qs[_0xd205('0x1a')](_0x1c9880[_0xd205('0x2f')]['offset']);}_0x845c6c[_0xd205('0x37')]=qs[_0xd205('0x38')](_0x1c9880[_0xd205('0x2f')][_0xd205('0x38')]);_0x845c6c[_0xd205('0x39')]=qs[_0xd205('0x30')](_[_0xd205('0x3a')](_0x1c9880[_0xd205('0x2f')],_0x387e16[_0xd205('0x30')]),_0xd49e3);if(_0x1c9880[_0xd205('0x2f')][_0xd205('0x3b')]){_0x845c6c[_0xd205('0x39')]=_['merge'](_0x845c6c[_0xd205('0x39')],{'$or':_[_0xd205('0x29')](_0xd49e3,function(_0x1c8b23){if(_0x1c8b23[_0xd205('0x3c')]!==_0xd205('0x3d')){var _0x539465={};_0x539465[_0x1c8b23[_0xd205('0x26')]]={'$like':'%'+_0x1c9880['query'][_0xd205('0x3b')]+'%'};return _0x539465;}})});}_0x845c6c=_[_0xd205('0x3e')]({},_0x845c6c,_0x1c9880[_0xd205('0x3f')]);var _0x100ea0={'where':_0x845c6c[_0xd205('0x39')]};return db[_0xd205('0x40')]['count'](_0x100ea0)['then'](function(_0x1201b1){_0x43ca3e[_0xd205('0x1d')]=_0x1201b1;if(_0x1c9880['query'][_0xd205('0x41')]){_0x845c6c[_0xd205('0x42')]=[{'all':!![]}];}return db[_0xd205('0x40')][_0xd205('0x43')](_0x845c6c);})[_0xd205('0x23')](function(_0x3b680a){_0x43ca3e[_0xd205('0x44')]=_0x3b680a;return _0x43ca3e;})[_0xd205('0x23')](respondWithFilteredResult(_0x2219a7,_0x845c6c))[_0xd205('0x45')](handleError(_0x2219a7,null));};exports[_0xd205('0x46')]=function(_0x4f7845,_0x302413){var _0x4e39eb={'raw':![],'where':{'id':_0x4f7845[_0xd205('0x47')]['id']}},_0x10c28d={};_0x10c28d[_0xd205('0x2d')]=_['keys'](db[_0xd205('0x40')]['rawAttributes']);_0x10c28d[_0xd205('0x2f')]=_[_0xd205('0x2e')](_0x4f7845[_0xd205('0x2f')]);_0x10c28d[_0xd205('0x30')]=_[_0xd205('0x31')](_0x10c28d[_0xd205('0x2d')],_0x10c28d['query']);_0x4e39eb[_0xd205('0x32')]=_[_0xd205('0x31')](_0x10c28d[_0xd205('0x2d')],qs[_0xd205('0x33')](_0x4f7845[_0xd205('0x2f')]['fields']));_0x4e39eb[_0xd205('0x32')]=_0x4e39eb['attributes']['length']?_0x4e39eb['attributes']:_0x10c28d[_0xd205('0x2d')];if(_0x4f7845[_0xd205('0x2f')][_0xd205('0x41')]){_0x4e39eb[_0xd205('0x42')]=[{'all':!![]}];}_0x4e39eb=_[_0xd205('0x3e')]({},_0x4e39eb,_0x4f7845[_0xd205('0x3f')]);return db['Automation'][_0xd205('0x48')](_0x4e39eb)[_0xd205('0x23')](handleEntityNotFound(_0x302413,null))[_0xd205('0x23')](respondWithResult(_0x302413,null))['catch'](handleError(_0x302413,null));};exports['create']=function(_0x5e4ce9,_0x47db77){return db[_0xd205('0x40')][_0xd205('0x49')](_0x5e4ce9['body'],{})['then'](respondWithResult(_0x47db77,0xc9))[_0xd205('0x45')](handleError(_0x47db77,null));};exports[_0xd205('0x22')]=function(_0xa13bc2,_0x39879b){if(_0xa13bc2[_0xd205('0x4a')]['id']){delete _0xa13bc2[_0xd205('0x4a')]['id'];}return db[_0xd205('0x40')][_0xd205('0x48')]({'where':{'id':_0xa13bc2[_0xd205('0x47')]['id']}})['then'](handleEntityNotFound(_0x39879b,null))[_0xd205('0x23')](saveUpdates(_0xa13bc2[_0xd205('0x4a')],null))[_0xd205('0x23')](respondWithResult(_0x39879b,null))[_0xd205('0x45')](handleError(_0x39879b,null));};exports[_0xd205('0x24')]=function(_0x2fc89e,_0x4522f3){return db[_0xd205('0x40')]['find']({'where':{'id':_0x2fc89e[_0xd205('0x47')]['id']}})[_0xd205('0x23')](handleEntityNotFound(_0x4522f3,null))[_0xd205('0x23')](removeEntity(_0x4522f3,null))[_0xd205('0x45')](handleError(_0x4522f3,null));};exports[_0xd205('0x4b')]=function(_0x571fba,_0x190a67,_0x3681ba){return db[_0xd205('0x4c')][_0xd205('0x48')]({'where':{'id':_0x571fba[_0xd205('0x47')]['id']}})[_0xd205('0x23')](handleEntityNotFound(_0x190a67,null))[_0xd205('0x23')](function(_0xb46681){if(_0xb46681){return _0xb46681[_0xd205('0x4b')](_0x571fba[_0xd205('0x4a')]['ids'],_['omit'](_0x571fba['body'],[_0xd205('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x190a67,null))[_0xd205('0x45')](handleError(_0x190a67,null));};exports[_0xd205('0x4e')]=function(_0x5c65e7,_0x4cd81d,_0x28d067){var _0x492fcf={};var _0x111860={};var _0x2d5d1f;var _0x44b42f;return db[_0xd205('0x40')][_0xd205('0x4f')]({'where':{'id':_0x5c65e7[_0xd205('0x47')]['id']}})[_0xd205('0x23')](handleEntityNotFound(_0x4cd81d,null))['then'](function(_0x3ed556){if(_0x3ed556){_0x2d5d1f=_0x3ed556;_0x111860[_0xd205('0x2d')]=_[_0xd205('0x2e')](db['Condition'][_0xd205('0x2a')]);_0x111860[_0xd205('0x2f')]=_[_0xd205('0x2e')](_0x5c65e7[_0xd205('0x2f')]);_0x111860[_0xd205('0x30')]=_[_0xd205('0x31')](_0x111860['model'],_0x111860[_0xd205('0x2f')]);_0x492fcf['attributes']=_[_0xd205('0x31')](_0x111860[_0xd205('0x2d')],qs['fields'](_0x5c65e7['query'][_0xd205('0x33')]));_0x492fcf['attributes']=_0x492fcf[_0xd205('0x32')][_0xd205('0x34')]?_0x492fcf[_0xd205('0x32')]:_0x111860[_0xd205('0x2d')];_0x492fcf[_0xd205('0x37')]=qs[_0xd205('0x38')](_0x5c65e7[_0xd205('0x2f')]['sort']);_0x492fcf[_0xd205('0x39')]=qs[_0xd205('0x30')](_['pick'](_0x5c65e7[_0xd205('0x2f')],_0x111860[_0xd205('0x30')]));if(_0x5c65e7['query'][_0xd205('0x3b')]){_0x492fcf['where']=_[_0xd205('0x3e')](_0x492fcf[_0xd205('0x39')],{'$or':_[_0xd205('0x29')](_0x492fcf['attributes'],function(_0x5c7486){var _0x32abb1={};_0x32abb1[_0x5c7486]={'$like':'%'+_0x5c65e7['query']['filter']+'%'};return _0x32abb1;})});}_0x492fcf=_['merge']({},_0x492fcf,_0x5c65e7['options']);return _0x2d5d1f[_0xd205('0x4e')](_0x492fcf);}})[_0xd205('0x23')](function(_0x1dc3dd){if(_0x1dc3dd){_0x44b42f=_0x1dc3dd[_0xd205('0x34')];if(!_0x5c65e7[_0xd205('0x2f')][_0xd205('0x35')](_0xd205('0x36'))){_0x492fcf[_0xd205('0x1b')]=qs[_0xd205('0x1b')](_0x5c65e7[_0xd205('0x2f')]['limit']);_0x492fcf[_0xd205('0x1a')]=qs['offset'](_0x5c65e7[_0xd205('0x2f')][_0xd205('0x1a')]);}return _0x2d5d1f[_0xd205('0x4e')](_0x492fcf);}})[_0xd205('0x23')](function(_0x57e6da){if(_0x57e6da){return _0x57e6da?{'count':_0x44b42f,'rows':_0x57e6da}:null;}})[_0xd205('0x23')](respondWithResult(_0x4cd81d,null))[_0xd205('0x45')](handleError(_0x4cd81d,null));};exports[_0xd205('0x50')]=function(_0x25701d,_0x1c085f,_0x55a801){return db[_0xd205('0x51')]['find']({'where':{'id':_0x25701d['params']['id']}})[_0xd205('0x23')](handleEntityNotFound(_0x1c085f,null))[_0xd205('0x23')](function(_0x1767fd){if(_0x1767fd){return _0x1767fd[_0xd205('0x50')](_0x25701d[_0xd205('0x4a')][_0xd205('0x4d')],_['omit'](_0x25701d['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1c085f,null))[_0xd205('0x45')](handleError(_0x1c085f,null));};exports['getActions']=function(_0x3ad083,_0x59d118,_0x1b852c){var _0x3db0cf={};var _0x2d1ab5={};var _0x547c03;var _0x559ffe;return db[_0xd205('0x40')]['findOne']({'where':{'id':_0x3ad083[_0xd205('0x47')]['id']}})[_0xd205('0x23')](handleEntityNotFound(_0x59d118,null))[_0xd205('0x23')](function(_0x451d14){if(_0x451d14){_0x547c03=_0x451d14;_0x2d1ab5[_0xd205('0x2d')]=_[_0xd205('0x2e')](db[_0xd205('0x51')][_0xd205('0x2a')]);_0x2d1ab5[_0xd205('0x2f')]=_[_0xd205('0x2e')](_0x3ad083[_0xd205('0x2f')]);_0x2d1ab5[_0xd205('0x30')]=_['intersection'](_0x2d1ab5[_0xd205('0x2d')],_0x2d1ab5[_0xd205('0x2f')]);_0x3db0cf[_0xd205('0x32')]=_[_0xd205('0x31')](_0x2d1ab5['model'],qs[_0xd205('0x33')](_0x3ad083[_0xd205('0x2f')]['fields']));_0x3db0cf[_0xd205('0x32')]=_0x3db0cf[_0xd205('0x32')][_0xd205('0x34')]?_0x3db0cf[_0xd205('0x32')]:_0x2d1ab5[_0xd205('0x2d')];_0x3db0cf['order']=qs['sort'](_0x3ad083[_0xd205('0x2f')]['sort']);_0x3db0cf[_0xd205('0x39')]=qs[_0xd205('0x30')](_[_0xd205('0x3a')](_0x3ad083[_0xd205('0x2f')],_0x2d1ab5[_0xd205('0x30')]));if(_0x3ad083[_0xd205('0x2f')]['filter']){_0x3db0cf[_0xd205('0x39')]=_[_0xd205('0x3e')](_0x3db0cf[_0xd205('0x39')],{'$or':_[_0xd205('0x29')](_0x3db0cf[_0xd205('0x32')],function(_0x45b594){var _0x3679f4={};_0x3679f4[_0x45b594]={'$like':'%'+_0x3ad083[_0xd205('0x2f')][_0xd205('0x3b')]+'%'};return _0x3679f4;})});}_0x3db0cf=_[_0xd205('0x3e')]({},_0x3db0cf,_0x3ad083[_0xd205('0x3f')]);return _0x547c03[_0xd205('0x52')](_0x3db0cf);}})[_0xd205('0x23')](function(_0x1d0652){if(_0x1d0652){_0x559ffe=_0x1d0652['length'];if(!_0x3ad083[_0xd205('0x2f')]['hasOwnProperty'](_0xd205('0x36'))){_0x3db0cf[_0xd205('0x1b')]=qs[_0xd205('0x1b')](_0x3ad083[_0xd205('0x2f')][_0xd205('0x1b')]);_0x3db0cf[_0xd205('0x1a')]=qs[_0xd205('0x1a')](_0x3ad083[_0xd205('0x2f')][_0xd205('0x1a')]);}return _0x547c03[_0xd205('0x52')](_0x3db0cf);}})[_0xd205('0x23')](function(_0x26e97b){if(_0x26e97b){return _0x26e97b?{'count':_0x559ffe,'rows':_0x26e97b}:null;}})['then'](respondWithResult(_0x59d118,null))[_0xd205('0x45')](handleError(_0x59d118,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 16d16b5..bd5ab03 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 _0xf021=['api','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x384943,_0xd57919){var _0x5b0735=function(_0x4e493e){while(--_0x4e493e){_0x384943['push'](_0x384943['shift']());}};_0x5b0735(++_0xd57919);}(_0xf021,0x1cb));var _0x1f02=function(_0x137fdc,_0x350ef5){_0x137fdc=_0x137fdc-0x0;var _0x4594b8=_0xf021[_0x137fdc];return _0x4594b8;};'use strict';var _=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var logger=require(_0x1f02('0x2'))(_0x1f02('0x3'));var moment=require('moment');var BPromise=require(_0x1f02('0x4'));var rp=require(_0x1f02('0x5'));var fs=require('fs');var path=require(_0x1f02('0x6'));var rimraf=require(_0x1f02('0x7'));var config=require(_0x1f02('0x8'));var attributes=require(_0x1f02('0x9'));module[_0x1f02('0xa')]=function(_0x40cec8,_0x580664){return _0x40cec8[_0x1f02('0xb')](_0x1f02('0xc'),attributes,{'tableName':_0x1f02('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc885=['request-promise','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xc885,0x10b));var _0x5c88=function(_0x446d64,_0x1357d3){_0x446d64=_0x446d64-0x0;var _0x34201b=_0xc885[_0x446d64];return _0x34201b;};'use strict';var _=require(_0x5c88('0x0'));var util=require(_0x5c88('0x1'));var logger=require(_0x5c88('0x2'))(_0x5c88('0x3'));var moment=require(_0x5c88('0x4'));var BPromise=require(_0x5c88('0x5'));var rp=require(_0x5c88('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5c88('0x7'));var config=require(_0x5c88('0x8'));var attributes=require(_0x5c88('0x9'));module[_0x5c88('0xa')]=function(_0x5caaed,_0x38c40f){return _0x5caaed['define'](_0x5c88('0xb'),attributes,{'tableName':_0x5c88('0xc'),'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 188b0f0..7deb535 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 _0x70e3=['then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1beaec,_0x47c1dd){var _0xb46d86=function(_0x1ee9c3){while(--_0x1ee9c3){_0x1beaec['push'](_0x1beaec['shift']());}};_0xb46d86(++_0x47c1dd);}(_0x70e3,0x9d));var _0x370e=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0x70e3[_0x480bc8];return _0x28c245;};'use strict';var _=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var moment=require(_0x370e('0x2'));var BPromise=require(_0x370e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x370e('0x4'));var db=require(_0x370e('0x5'))['db'];var utils=require(_0x370e('0x6'));var logger=require('../../config/logger')(_0x370e('0x7'));var config=require(_0x370e('0x8'));var jayson=require(_0x370e('0x9'));var client=jayson[_0x370e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2aaf,_0x5f57ea,_0x4a6884){return new BPromise(function(_0x5e5c79,_0x4086c4){return client['request'](_0x3a2aaf,_0x4a6884)[_0x370e('0xb')](function(_0x52d611){logger[_0x370e('0xc')](_0x370e('0xd'),_0x5f57ea,'request\x20sent');logger['debug'](_0x370e('0xe'),_0x5f57ea,_0x370e('0xf'),JSON[_0x370e('0x10')](_0x52d611));if(_0x52d611[_0x370e('0x11')]){if(_0x52d611[_0x370e('0x11')]['code']===0x1f4){logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x4086c4(_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);}logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x5e5c79(_0x52d611[_0x370e('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5f57ea,_0x370e('0xf'));_0x5e5c79(_0x52d611[_0x370e('0x13')][_0x370e('0x12')]);}})[_0x370e('0x14')](function(_0xb8381f){logger[_0x370e('0x11')]('Automation,\x20%s,\x20%s',_0x5f57ea,_0xb8381f);_0x4086c4(_0xb8381f);});});} \ No newline at end of file +var _0xb982=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','moment','bluebird'];(function(_0x3eb221,_0x39f3ab){var _0x2bdf1e=function(_0x3308ce){while(--_0x3308ce){_0x3eb221['push'](_0x3eb221['shift']());}};_0x2bdf1e(++_0x39f3ab);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2b98('0x0'));var BPromise=require(_0x2b98('0x1'));var rs=require(_0x2b98('0x2'));var fs=require('fs');var Redis=require(_0x2b98('0x3'));var db=require(_0x2b98('0x4'))['db'];var utils=require(_0x2b98('0x5'));var logger=require(_0x2b98('0x6'))(_0x2b98('0x7'));var config=require(_0x2b98('0x8'));var jayson=require(_0x2b98('0x9'));var client=jayson['client'][_0x2b98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1166cb,_0x15ee91,_0x4626ad){return new BPromise(function(_0x3a6bad,_0x6b6f9e){return client['request'](_0x1166cb,_0x4626ad)[_0x2b98('0xb')](function(_0x4c64b5){logger['info'](_0x2b98('0xc'),_0x15ee91,'request\x20sent');logger[_0x2b98('0xd')](_0x2b98('0xe'),_0x15ee91,_0x2b98('0xf'),JSON[_0x2b98('0x10')](_0x4c64b5));if(_0x4c64b5[_0x2b98('0x11')]){if(_0x4c64b5['error'][_0x2b98('0x12')]===0x1f4){logger['error'](_0x2b98('0xc'),_0x15ee91,_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);return _0x6b6f9e(_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);}logger[_0x2b98('0x11')]('Automation,\x20%s,\x20%s',_0x15ee91,_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);return _0x3a6bad(_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);}else{logger[_0x2b98('0x14')](_0x2b98('0xc'),_0x15ee91,_0x2b98('0xf'));_0x3a6bad(_0x4c64b5['result'][_0x2b98('0x13')]);}})[_0x2b98('0x15')](function(_0x51eb95){logger[_0x2b98('0x11')]('Automation,\x20%s,\x20%s',_0x15ee91,_0x51eb95);_0x6b6f9e(_0x51eb95);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 19834e0..5be289e 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 _0x98d5=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','get','show','getConditions','/:id/actions','getActions','create','post','/:id/conditions','addConditions','addActions','put','/:id','delete','destroy'];(function(_0x38e2eb,_0x215eaa){var _0x230647=function(_0x170de4){while(--_0x170de4){_0x38e2eb['push'](_0x38e2eb['shift']());}};_0x230647(++_0x215eaa);}(_0x98d5,0xfb));var _0x598d=function(_0x1fd086,_0x388ded){_0x1fd086=_0x1fd086-0x0;var _0x5a962d=_0x98d5[_0x1fd086];return _0x5a962d;};'use strict';var multer=require(_0x598d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x598d('0x1'));var express=require(_0x598d('0x2'));var router=express[_0x598d('0x3')]();var fs_extra=require(_0x598d('0x4'));var auth=require(_0x598d('0x5'));var interaction=require(_0x598d('0x6'));var config=require(_0x598d('0x7'));var controller=require(_0x598d('0x8'));router['get']('/',auth[_0x598d('0x9')](),controller['index']);router[_0x598d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x598d('0xb')]);router[_0x598d('0xa')]('/:id/conditions',auth[_0x598d('0x9')](),controller[_0x598d('0xc')]);router[_0x598d('0xa')](_0x598d('0xd'),auth[_0x598d('0x9')](),controller[_0x598d('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x598d('0xf')]);router[_0x598d('0x10')](_0x598d('0x11'),auth[_0x598d('0x9')](),controller[_0x598d('0x12')]);router[_0x598d('0x10')](_0x598d('0xd'),auth[_0x598d('0x9')](),controller[_0x598d('0x13')]);router[_0x598d('0x14')](_0x598d('0x15'),auth[_0x598d('0x9')](),controller['update']);router[_0x598d('0x16')]('/:id',auth[_0x598d('0x9')](),controller[_0x598d('0x17')]);module[_0x598d('0x18')]=router; \ No newline at end of file +var _0x0389=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','/:id/actions','addActions','/:id','update','delete','exports','multer'];(function(_0x2eef0d,_0x9a36a1){var _0x23a0a2=function(_0x3a72c9){while(--_0x3a72c9){_0x2eef0d['push'](_0x2eef0d['shift']());}};_0x23a0a2(++_0x9a36a1);}(_0x0389,0x175));var _0x9038=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x0389[_0x320b8e];return _0x55a10a;};'use strict';var multer=require(_0x9038('0x0'));var util=require('util');var path=require(_0x9038('0x1'));var timeout=require(_0x9038('0x2'));var express=require(_0x9038('0x3'));var router=express[_0x9038('0x4')]();var fs_extra=require(_0x9038('0x5'));var auth=require(_0x9038('0x6'));var interaction=require(_0x9038('0x7'));var config=require('../../config/environment');var controller=require(_0x9038('0x8'));router[_0x9038('0x9')]('/',auth[_0x9038('0xa')](),controller['index']);router['get']('/:id',auth[_0x9038('0xa')](),controller[_0x9038('0xb')]);router[_0x9038('0x9')](_0x9038('0xc'),auth['isAuthenticated'](),controller[_0x9038('0xd')]);router['get']('/:id/actions',auth[_0x9038('0xa')](),controller[_0x9038('0xe')]);router['post']('/',auth[_0x9038('0xa')](),controller['create']);router[_0x9038('0xf')](_0x9038('0xc'),auth[_0x9038('0xa')](),controller['addConditions']);router[_0x9038('0xf')](_0x9038('0x10'),auth[_0x9038('0xa')](),controller[_0x9038('0x11')]);router['put'](_0x9038('0x12'),auth[_0x9038('0xa')](),controller[_0x9038('0x13')]);router[_0x9038('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9038('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 87f8146..cc8eacf 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 _0x6b5f=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x17dcff,_0x546d31){var _0x27618b=function(_0x17030e){while(--_0x17030e){_0x17dcff['push'](_0x17dcff['shift']());}};_0x27618b(++_0x546d31);}(_0x6b5f,0x119));var _0xf6b5=function(_0xedc9e1,_0x458222){_0xedc9e1=_0xedc9e1-0x0;var _0x2aed13=_0x6b5f[_0xedc9e1];return _0x2aed13;};'use strict';var Sequelize=require(_0xf6b5('0x0'));module[_0xf6b5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf6b5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf6b5('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xf6b5('0x4')]},'active':{'type':Sequelize[_0xf6b5('0x5')],'defaultValue':0x0,'comment':_0xf6b5('0x6')},'limitCalls':{'type':Sequelize[_0xf6b5('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf6b5('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf6b5('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf6b5('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xf6b5('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf6b5('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf6b5('0x10')},'dialTimezone':{'type':Sequelize[_0xf6b5('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf6b5('0x4')],'defaultValue':_0xf6b5('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xf6b5('0x3')]('always',_0xf6b5('0x12'),_0xf6b5('0x13')),'defaultValue':_0xf6b5('0x14')},'dialAMDActive':{'type':Sequelize[_0xf6b5('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf6b5('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf6b5('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf6b5('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf6b5('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf6b5('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf6b5('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xf6b5('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf6b5('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf6b5('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xf6b5('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0xf6b5('0x1b')},'dialPrefix':{'type':Sequelize[_0xf6b5('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf6b5('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf6b5('0x1c')},'dialCutDigit':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0xea67=['exports','STRING','name','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#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)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize'];(function(_0x11aa3e,_0x11a2e8){var _0x3693a7=function(_0x4ad881){while(--_0x4ad881){_0x11aa3e['push'](_0x11aa3e['shift']());}};_0x3693a7(++_0x11a2e8);}(_0xea67,0x1e9));var _0x7ea6=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0xea67[_0x3bef2c];return _0x331503;};'use strict';var Sequelize=require(_0x7ea6('0x0'));module[_0x7ea6('0x1')]={'name':{'type':Sequelize[_0x7ea6('0x2')],'unique':_0x7ea6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7ea6('0x4')](_0x7ea6('0x5')),'allowNull':![],'defaultValue':_0x7ea6('0x5')},'description':{'type':Sequelize[_0x7ea6('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x7ea6('0x6')](0x4)[_0x7ea6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7ea6('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7ea6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7ea6('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ea6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7ea6('0x6')](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x7ea6('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ea6('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'comment':_0x7ea6('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ea6('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x7ea6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7ea6('0x2')],'defaultValue':_0x7ea6('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x7ea6('0x4')](_0x7ea6('0xe'),_0x7ea6('0xf'),_0x7ea6('0x10')),'defaultValue':_0x7ea6('0xe')},'dialAMDActive':{'type':Sequelize[_0x7ea6('0x11')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x7ea6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7ea6('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x7ea6('0x6')](0x9)[_0x7ea6('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7ea6('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7ea6('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7ea6('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x7ea6('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7ea6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7ea6('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7ea6('0x6')](0x9)[_0x7ea6('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7ea6('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7ea6('0x6')](0x9)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7ea6('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7ea6('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7ea6('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7ea6('0x4')](_0x7ea6('0x19'),_0x7ea6('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x7ea6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7ea6('0x1b')},'dialCutDigit':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ea6('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ea6('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ea6('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ea6('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ea6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7ea6('0x6')](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x7ea6('0x6')](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ea6('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7ea6('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ea6('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index cb4f7d2..6d82b4e 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 _0x85c2=['nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','getHoppers','findOne','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','scheduledAt','ContactId','CmListId','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','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','push','sequelize','all','removeLists','ids','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','IvrCampaigns','destroy','sendStatus','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x85c2,0xe2));var _0x285c=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x85c2[_0x58dc25];return _0x21b0a7;};'use strict';var emlformat=require(_0x285c('0x0'));var rimraf=require(_0x285c('0x1'));var zipdir=require(_0x285c('0x2'));var jsonpatch=require(_0x285c('0x3'));var rp=require(_0x285c('0x4'));var moment=require(_0x285c('0x5'));var BPromise=require(_0x285c('0x6'));var Mustache=require(_0x285c('0x7'));var util=require(_0x285c('0x8'));var path=require(_0x285c('0x9'));var sox=require(_0x285c('0xa'));var csv=require('to-csv');var ejs=require(_0x285c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x285c('0xc'));var crypto=require(_0x285c('0xd'));var jsforce=require(_0x285c('0xe'));var deskjs=require(_0x285c('0xf'));var toCsv=require(_0x285c('0x10'));var querystring=require(_0x285c('0x11'));var Papa=require(_0x285c('0x12'));var Redis=require(_0x285c('0x13'));var authService=require(_0x285c('0x14'));var qs=require(_0x285c('0x15'));var as=require(_0x285c('0x16'));var hardwareService=require(_0x285c('0x17'));var logger=require(_0x285c('0x18'))(_0x285c('0x19'));var utils=require(_0x285c('0x1a'));var config=require(_0x285c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x285c('0x1c'))['db'];function respondWithStatusCode(_0x5f4663,_0x20956d){_0x20956d=_0x20956d||0xcc;return function(_0x1b9d25){if(_0x1b9d25){return _0x5f4663['sendStatus'](_0x20956d);}return _0x5f4663[_0x285c('0x1d')](_0x20956d)[_0x285c('0x1e')]();};}function respondWithResult(_0x118d9b,_0x2a70a7){_0x2a70a7=_0x2a70a7||0xc8;return function(_0x501b98){if(_0x501b98){return _0x118d9b[_0x285c('0x1d')](_0x2a70a7)['json'](_0x501b98);}};}function respondWithFilteredResult(_0x49b16e,_0x4e0c92){return function(_0xc60564){if(_0xc60564){var _0x432c2e=typeof _0x4e0c92[_0x285c('0x1f')]===_0x285c('0x20')&&typeof _0x4e0c92[_0x285c('0x21')]==='undefined';var _0x8d26b3=_0xc60564['count'];var _0x21e5fb=_0x432c2e?0x0:_0x4e0c92[_0x285c('0x1f')];var _0x360e9d=_0x432c2e?_0xc60564[_0x285c('0x22')]:_0x4e0c92['offset']+_0x4e0c92['limit'];var _0x437d18;if(_0x360e9d>=_0x8d26b3){_0x360e9d=_0x8d26b3;_0x437d18=0xc8;}else{_0x437d18=0xce;}_0x49b16e[_0x285c('0x1d')](_0x437d18);return _0x49b16e['set'](_0x285c('0x23'),_0x21e5fb+'-'+_0x360e9d+'/'+_0x8d26b3)[_0x285c('0x24')](_0xc60564);}return null;};}function patchUpdates(_0x3eba2c){return function(_0x41ef29){try{jsonpatch[_0x285c('0x25')](_0x41ef29,_0x3eba2c,!![]);}catch(_0x8097cc){return BPromise[_0x285c('0x26')](_0x8097cc);}return _0x41ef29[_0x285c('0x27')]();};}function saveUpdates(_0x3f579a,_0x5f10cd){return function(_0x47110e){if(_0x47110e){return _0x47110e[_0x285c('0x28')](_0x3f579a)[_0x285c('0x29')](function(_0x47dc02){return _0x47dc02;});}return null;};}function removeEntity(_0x4b35c7,_0x24b07d){return function(_0xc5d1d8){if(_0xc5d1d8){return _0xc5d1d8['destroy']()[_0x285c('0x29')](function(){var _0x333e0d=_0xc5d1d8[_0x285c('0x2a')]({'plain':!![]});var _0x36c44b=_0x285c('0x2b');return db['UserProfileResource'][_0x285c('0x2c')]({'where':{'type':_0x36c44b,'resourceId':_0x333e0d['id']}})[_0x285c('0x29')](function(){return _0xc5d1d8;});})[_0x285c('0x29')](function(){_0x4b35c7[_0x285c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d1dd0,_0x2619c7){return function(_0x35f1cc){if(!_0x35f1cc){_0x5d1dd0[_0x285c('0x2d')](0x194);}return _0x35f1cc;};}function handleError(_0x428d27,_0x2369d1){_0x2369d1=_0x2369d1||0x1f4;return function(_0x3fdd49){logger[_0x285c('0x2e')](_0x3fdd49[_0x285c('0x2f')]);if(_0x3fdd49[_0x285c('0x30')]){delete _0x3fdd49['name'];}_0x428d27[_0x285c('0x1d')](_0x2369d1)[_0x285c('0x31')](_0x3fdd49);};}exports[_0x285c('0x32')]=function(_0x13d356,_0x52a88a){var _0x400db1={},_0x169bb8={},_0x2c62c4={'count':0x0,'rows':[]};var _0x4d2b9e=_['map'](db[_0x285c('0x33')][_0x285c('0x34')],function(_0x25c2d2){return{'name':_0x25c2d2[_0x285c('0x35')],'type':_0x25c2d2[_0x285c('0x36')][_0x285c('0x37')]};});_0x169bb8[_0x285c('0x38')]=_['map'](_0x4d2b9e,_0x285c('0x30'));_0x169bb8[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x13d356[_0x285c('0x39')]);_0x169bb8[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x169bb8[_0x285c('0x38')],_0x169bb8['query']);_0x400db1[_0x285c('0x3d')]=_['intersection'](_0x169bb8['model'],qs[_0x285c('0x3e')](_0x13d356[_0x285c('0x39')][_0x285c('0x3e')]));_0x400db1[_0x285c('0x3d')]=_0x400db1[_0x285c('0x3d')]['length']?_0x400db1['attributes']:_0x169bb8[_0x285c('0x38')];if(!_0x13d356[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x400db1[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x13d356['query'][_0x285c('0x21')]);_0x400db1[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x13d356[_0x285c('0x39')][_0x285c('0x1f')]);}_0x400db1[_0x285c('0x41')]=qs[_0x285c('0x42')](_0x13d356['query'][_0x285c('0x42')]);_0x400db1[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x13d356[_0x285c('0x39')],_0x169bb8[_0x285c('0x3b')]),_0x4d2b9e);if(_0x13d356[_0x285c('0x39')][_0x285c('0x45')]){_0x400db1[_0x285c('0x43')]=_[_0x285c('0x46')](_0x400db1['where'],{'$or':_[_0x285c('0x47')](_0x4d2b9e,function(_0x93affb){if(_0x93affb[_0x285c('0x36')]!==_0x285c('0x48')){var _0x46d882={};_0x46d882[_0x93affb['name']]={'$like':'%'+_0x13d356[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x46d882;}})});}_0x400db1=_[_0x285c('0x46')]({},_0x400db1,_0x13d356[_0x285c('0x49')]);var _0x367f77={'where':_0x400db1[_0x285c('0x43')]};return db['Campaign'][_0x285c('0x22')](_0x367f77)['then'](function(_0x56cac9){_0x2c62c4['count']=_0x56cac9;if(_0x13d356[_0x285c('0x39')]['includeAll']){_0x400db1[_0x285c('0x4a')]=[{'all':!![]}];}return db[_0x285c('0x33')][_0x285c('0x4b')](_0x400db1);})[_0x285c('0x29')](function(_0x5db789){_0x2c62c4['rows']=_0x5db789;return _0x2c62c4;})[_0x285c('0x29')](respondWithFilteredResult(_0x52a88a,_0x400db1))[_0x285c('0x4c')](handleError(_0x52a88a,null));};exports[_0x285c('0x4d')]=function(_0x3e9f0f,_0x3b93ce){var _0xfaf48e={'raw':![],'where':{'id':_0x3e9f0f[_0x285c('0x4e')]['id']}},_0x5eae9a={};_0x5eae9a['model']=_['keys'](db['Campaign'][_0x285c('0x34')]);_0x5eae9a[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x3e9f0f['query']);_0x5eae9a[_0x285c('0x3b')]=_['intersection'](_0x5eae9a['model'],_0x5eae9a[_0x285c('0x39')]);_0xfaf48e[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x5eae9a[_0x285c('0x38')],qs['fields'](_0x3e9f0f[_0x285c('0x39')][_0x285c('0x3e')]));_0xfaf48e[_0x285c('0x3d')]=_0xfaf48e['attributes'][_0x285c('0x4f')]?_0xfaf48e[_0x285c('0x3d')]:_0x5eae9a[_0x285c('0x38')];if(_0x3e9f0f[_0x285c('0x39')][_0x285c('0x50')]){_0xfaf48e[_0x285c('0x4a')]=[{'all':!![]}];}_0xfaf48e=_[_0x285c('0x46')]({},_0xfaf48e,_0x3e9f0f[_0x285c('0x49')]);return db[_0x285c('0x33')][_0x285c('0x51')](_0xfaf48e)[_0x285c('0x29')](handleEntityNotFound(_0x3b93ce,null))['then'](respondWithResult(_0x3b93ce,null))[_0x285c('0x4c')](handleError(_0x3b93ce,null));};exports[_0x285c('0x52')]=function(_0x437d26,_0x4d9a47){return db[_0x285c('0x33')][_0x285c('0x52')](_0x437d26[_0x285c('0x53')],{})[_0x285c('0x29')](function(_0x2cbc52){var _0x2f4071=_0x437d26[_0x285c('0x54')][_0x285c('0x2a')]({'plain':!![]});if(!_0x2f4071)throw new Error(_0x285c('0x55'));if(_0x2f4071[_0x285c('0x56')]==='user'){var _0x2cb29b=_0x2cbc52[_0x285c('0x2a')]({'plain':!![]});var _0x1db5ea='IvrCampaigns';return db[_0x285c('0x57')]['find']({'where':{'name':_0x1db5ea,'userProfileId':_0x2f4071[_0x285c('0x58')]},'raw':!![]})[_0x285c('0x29')](function(_0x2e05b3){if(_0x2e05b3&&_0x2e05b3[_0x285c('0x59')]===0x0){return db[_0x285c('0x5a')][_0x285c('0x52')]({'name':_0x2cb29b[_0x285c('0x30')],'resourceId':_0x2cb29b['id'],'type':_0x2e05b3[_0x285c('0x30')],'sectionId':_0x2e05b3['id']},{})[_0x285c('0x29')](function(){return _0x2cbc52;});}else{return _0x2cbc52;}})[_0x285c('0x4c')](function(_0x1b71c9){logger['error'](_0x285c('0x5b'),_0x1b71c9);throw _0x1b71c9;});}return _0x2cbc52;})['then'](respondWithResult(_0x4d9a47,0xc9))[_0x285c('0x4c')](handleError(_0x4d9a47,null));};exports[_0x285c('0x5c')]=function(_0x4cfe14,_0x45f114){var _0x53b325={'where':{'id':_0x4cfe14['params']['id']}},_0x5b0e73={};_0x5b0e73[_0x285c('0x38')]=_[_0x285c('0x3a')](db[_0x285c('0x33')][_0x285c('0x34')]);_0x53b325[_0x285c('0x3d')]=_['intersection'](_0x5b0e73[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x4cfe14[_0x285c('0x39')][_0x285c('0x3e')]));_0x53b325[_0x285c('0x3d')]=_0x53b325[_0x285c('0x3d')][_0x285c('0x4f')]?_0x53b325['attributes']:_0x5b0e73[_0x285c('0x38')];if(_0x4cfe14[_0x285c('0x39')][_0x285c('0x50')]){_0x53b325[_0x285c('0x4a')]=[{'all':!![]}];}_0x53b325=_[_0x285c('0x46')]({},_0x53b325,_0x4cfe14['options']);return db[_0x285c('0x33')]['find'](_0x53b325)['then'](handleEntityNotFound(_0x45f114,null))[_0x285c('0x29')](function(_0x8d96e8){if(_0x8d96e8){var _0x296ba9=_0x8d96e8[_0x285c('0x2a')]({'plain':!![]});_0x296ba9=qs[_0x285c('0x5d')](_0x296ba9,['id','createdAt',_0x285c('0x5e')]);_0x4cfe14['body']=_[_0x285c('0x5d')](_0x4cfe14['body'],['id',_0x285c('0x5f'),_0x285c('0x5e')]);return db[_0x285c('0x33')][_0x285c('0x52')](_[_0x285c('0x46')](_0x296ba9,_0x4cfe14[_0x285c('0x53')]),{'include':_0x4cfe14['query']['includeAll']?[{'all':!![]}]:undefined})[_0x285c('0x29')](function(_0x37b701){var _0x1a2cd2=_0x4cfe14['user']['get']({'plain':!![]});if(!_0x1a2cd2)throw new Error(_0x285c('0x55'));if(_0x1a2cd2[_0x285c('0x56')]===_0x285c('0x54')){var _0x2c50d0=_0x37b701[_0x285c('0x2a')]({'plain':!![]});var _0x4b5217='IvrCampaigns';return db[_0x285c('0x57')]['find']({'where':{'name':_0x4b5217,'userProfileId':_0x1a2cd2[_0x285c('0x58')]},'raw':!![]})[_0x285c('0x29')](function(_0x240bf8){if(_0x240bf8&&_0x240bf8[_0x285c('0x59')]===0x0){return db[_0x285c('0x5a')][_0x285c('0x52')]({'name':_0x2c50d0[_0x285c('0x30')],'resourceId':_0x2c50d0['id'],'type':_0x240bf8['name'],'sectionId':_0x240bf8['id']},{})['then'](function(){return _0x37b701;});}else{return _0x37b701;}})[_0x285c('0x4c')](function(_0x211ea6){logger['error'](_0x285c('0x5b'),_0x211ea6);throw _0x211ea6;});}return _0x37b701;});}})['then'](respondWithResult(_0x45f114,0xc9))[_0x285c('0x4c')](handleError(_0x45f114,null));};exports[_0x285c('0x28')]=function(_0x3853ae,_0x4415ae){if(_0x3853ae[_0x285c('0x53')]['id']){delete _0x3853ae[_0x285c('0x53')]['id'];}return db['Campaign']['find']({'where':{'id':_0x3853ae[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x4415ae,null))[_0x285c('0x29')](saveUpdates(_0x3853ae['body'],null))[_0x285c('0x29')](respondWithResult(_0x4415ae,null))[_0x285c('0x4c')](handleError(_0x4415ae,null));};exports[_0x285c('0x2c')]=function(_0xb8cb5a,_0x156bea){return db[_0x285c('0x33')]['find']({'where':{'id':_0xb8cb5a[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x156bea,null))['then'](removeEntity(_0x156bea,null))[_0x285c('0x4c')](handleError(_0x156bea,null));};exports[_0x285c('0x60')]=function(_0xff4837,_0x52a2db,_0x185359){var _0x563d7a={'raw':!![],'where':{}};var _0x28b0d0={};var _0x2c7fbf={'count':0x0,'rows':[]};return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0xff4837[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x52a2db,null))['then'](function(_0x4573e7){if(_0x4573e7){_0x28b0d0[_0x285c('0x38')]=_['keys'](db[_0x285c('0x62')][_0x285c('0x34')]);_0x28b0d0[_0x285c('0x39')]=_['keys'](_0xff4837[_0x285c('0x39')]);_0x28b0d0[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x28b0d0[_0x285c('0x38')],_0x28b0d0['query']);_0x563d7a[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x28b0d0[_0x285c('0x38')],qs[_0x285c('0x3e')](_0xff4837[_0x285c('0x39')]['fields']));_0x563d7a[_0x285c('0x3d')]=_0x563d7a[_0x285c('0x3d')][_0x285c('0x4f')]?_0x563d7a[_0x285c('0x3d')]:_0x28b0d0[_0x285c('0x38')];if(!_0xff4837['query'][_0x285c('0x3f')](_0x285c('0x40'))){_0x563d7a['limit']=qs[_0x285c('0x21')](_0xff4837[_0x285c('0x39')][_0x285c('0x21')]);_0x563d7a[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0xff4837[_0x285c('0x39')][_0x285c('0x1f')]);}_0x563d7a[_0x285c('0x41')]=qs[_0x285c('0x42')](_0xff4837[_0x285c('0x39')]['sort']);_0x563d7a['where']=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0xff4837[_0x285c('0x39')],_0x28b0d0['filters']));_0x563d7a['where'][_0x285c('0x63')]=_0x4573e7['id'];if(_0xff4837[_0x285c('0x39')][_0x285c('0x45')]){_0x563d7a[_0x285c('0x43')]=_[_0x285c('0x46')](_0x563d7a['where'],{'$or':_[_0x285c('0x47')](_0x563d7a[_0x285c('0x3d')],function(_0x3413ac){var _0x89aab6={};_0x89aab6[_0x3413ac]={'$like':'%'+_0xff4837[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x89aab6;})});}_0x563d7a=_[_0x285c('0x46')]({},_0x563d7a,_0xff4837[_0x285c('0x49')]);return db[_0x285c('0x62')][_0x285c('0x22')]({'where':_0x563d7a[_0x285c('0x43')]})['then'](function(_0x40a879){_0x2c7fbf[_0x285c('0x22')]=_0x40a879;if(_0xff4837[_0x285c('0x39')][_0x285c('0x50')]){_0x563d7a[_0x285c('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0x285c('0x4b')](_0x563d7a);})['then'](function(_0x232a2d){_0x2c7fbf[_0x285c('0x64')]=_0x232a2d;return _0x2c7fbf;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x52a2db,_0x563d7a))[_0x285c('0x4c')](handleError(_0x52a2db,null));};exports[_0x285c('0x65')]=function(_0x4fb177,_0x4b63cc,_0x27137b){var _0x16b78f={'raw':!![],'where':{}};var _0x58748f={};var _0x5b731c={'count':0x0,'rows':[]};return db['Campaign'][_0x285c('0x61')]({'where':{'id':_0x4fb177[_0x285c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4b63cc,null))['then'](function(_0x555583){if(_0x555583){_0x58748f[_0x285c('0x38')]=_[_0x285c('0x3a')](db[_0x285c('0x66')][_0x285c('0x34')]);_0x58748f[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x4fb177['query']);_0x58748f[_0x285c('0x3b')]=_['intersection'](_0x58748f[_0x285c('0x38')],_0x58748f[_0x285c('0x39')]);_0x16b78f[_0x285c('0x3d')]=_['intersection'](_0x58748f[_0x285c('0x38')],qs['fields'](_0x4fb177[_0x285c('0x39')][_0x285c('0x3e')]));_0x16b78f['attributes']=_0x16b78f[_0x285c('0x3d')][_0x285c('0x4f')]?_0x16b78f[_0x285c('0x3d')]:_0x58748f[_0x285c('0x38')];if(!_0x4fb177[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x16b78f[_0x285c('0x21')]=qs['limit'](_0x4fb177[_0x285c('0x39')][_0x285c('0x21')]);_0x16b78f[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x4fb177[_0x285c('0x39')]['offset']);}_0x16b78f[_0x285c('0x41')]=qs['sort'](_0x4fb177['query'][_0x285c('0x42')]);_0x16b78f[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x4fb177['query'],_0x58748f[_0x285c('0x3b')]));_0x16b78f[_0x285c('0x43')][_0x285c('0x63')]=_0x555583['id'];if(_0x4fb177[_0x285c('0x39')][_0x285c('0x45')]){_0x16b78f[_0x285c('0x43')]=_[_0x285c('0x46')](_0x16b78f[_0x285c('0x43')],{'$or':_[_0x285c('0x47')](_0x16b78f['attributes'],function(_0x5209d0){var _0x21b953={};_0x21b953[_0x5209d0]={'$like':'%'+_0x4fb177[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x21b953;})});}_0x16b78f=_[_0x285c('0x46')]({},_0x16b78f,_0x4fb177[_0x285c('0x49')]);return db['CmHopperHistory']['count']({'where':_0x16b78f[_0x285c('0x43')]})[_0x285c('0x29')](function(_0x48c932){_0x5b731c[_0x285c('0x22')]=_0x48c932;if(_0x4fb177[_0x285c('0x39')]['includeAll']){_0x16b78f[_0x285c('0x4a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x285c('0x4b')](_0x16b78f);})[_0x285c('0x29')](function(_0x38a5bc){_0x5b731c[_0x285c('0x64')]=_0x38a5bc;return _0x5b731c;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x4b63cc,_0x16b78f))['catch'](handleError(_0x4b63cc,null));};exports[_0x285c('0x67')]=function(_0x56f154,_0x22923c,_0x417b0c){var _0x4bf953={'raw':!![],'where':{}};var _0x1e107f={};var _0x2bc05d={'count':0x0,'rows':[]};return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0x56f154[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x22923c,null))[_0x285c('0x29')](function(_0x21054a){if(_0x21054a){_0x1e107f[_0x285c('0x38')]=_[_0x285c('0x3a')](db[_0x285c('0x68')]['rawAttributes']);_0x1e107f[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x56f154[_0x285c('0x39')]);_0x1e107f[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x1e107f['model'],_0x1e107f[_0x285c('0x39')]);_0x4bf953[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x1e107f[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x56f154[_0x285c('0x39')]['fields']));_0x4bf953[_0x285c('0x3d')]=_0x4bf953[_0x285c('0x3d')][_0x285c('0x4f')]?_0x4bf953[_0x285c('0x3d')]:_0x1e107f[_0x285c('0x38')];if(!_0x56f154[_0x285c('0x39')][_0x285c('0x3f')]('nolimit')){_0x4bf953[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x56f154[_0x285c('0x39')][_0x285c('0x21')]);_0x4bf953[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x56f154[_0x285c('0x39')][_0x285c('0x1f')]);}_0x4bf953[_0x285c('0x41')]=qs[_0x285c('0x42')](_0x56f154[_0x285c('0x39')][_0x285c('0x42')]);_0x4bf953[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x56f154[_0x285c('0x39')],_0x1e107f[_0x285c('0x3b')]));_0x4bf953[_0x285c('0x43')][_0x285c('0x63')]=_0x21054a['id'];if(_0x56f154[_0x285c('0x39')][_0x285c('0x45')]){_0x4bf953[_0x285c('0x43')]=_[_0x285c('0x46')](_0x4bf953[_0x285c('0x43')],{'$or':_['map'](_0x4bf953[_0x285c('0x3d')],function(_0xf32a0c){var _0x2a5c94={};_0x2a5c94[_0xf32a0c]={'$like':'%'+_0x56f154[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x2a5c94;})});}_0x4bf953=_[_0x285c('0x46')]({},_0x4bf953,_0x56f154['options']);return db[_0x285c('0x68')][_0x285c('0x22')]({'where':_0x4bf953[_0x285c('0x43')]})[_0x285c('0x29')](function(_0x2c6ed6){_0x2bc05d[_0x285c('0x22')]=_0x2c6ed6;if(_0x56f154[_0x285c('0x39')][_0x285c('0x50')]){_0x4bf953['include']=[{'all':!![]}];}return db[_0x285c('0x68')][_0x285c('0x4b')](_0x4bf953);})[_0x285c('0x29')](function(_0x3f979d){_0x2bc05d[_0x285c('0x64')]=_0x3f979d;return _0x2bc05d;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x22923c,_0x4bf953))[_0x285c('0x4c')](handleError(_0x22923c,null));};exports['getHopperBlacks']=function(_0x510c45,_0x304607,_0x213da9){var _0x3defd4={'raw':!![],'where':{}};var _0x1e9e9b={};var _0x2fc6d0={'count':0x0,'rows':[]};return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0x510c45[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x304607,null))[_0x285c('0x29')](function(_0x5c9015){if(_0x5c9015){_0x1e9e9b[_0x285c('0x38')]=_['keys'](db['CmHopperBlack'][_0x285c('0x34')]);_0x1e9e9b[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x510c45[_0x285c('0x39')]);_0x1e9e9b[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x1e9e9b[_0x285c('0x38')],_0x1e9e9b[_0x285c('0x39')]);_0x3defd4[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x1e9e9b[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x510c45['query'][_0x285c('0x3e')]));_0x3defd4[_0x285c('0x3d')]=_0x3defd4[_0x285c('0x3d')]['length']?_0x3defd4[_0x285c('0x3d')]:_0x1e9e9b[_0x285c('0x38')];if(!_0x510c45[_0x285c('0x39')]['hasOwnProperty'](_0x285c('0x40'))){_0x3defd4[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x510c45[_0x285c('0x39')][_0x285c('0x21')]);_0x3defd4[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x510c45['query']['offset']);}_0x3defd4['order']=qs[_0x285c('0x42')](_0x510c45[_0x285c('0x39')][_0x285c('0x42')]);_0x3defd4[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x510c45['query'],_0x1e9e9b[_0x285c('0x3b')]));_0x3defd4[_0x285c('0x43')][_0x285c('0x63')]=_0x5c9015['id'];if(_0x510c45[_0x285c('0x39')][_0x285c('0x45')]){_0x3defd4[_0x285c('0x43')]=_['merge'](_0x3defd4['where'],{'$or':_[_0x285c('0x47')](_0x3defd4['attributes'],function(_0x54fda4){var _0x165d8b={};_0x165d8b[_0x54fda4]={'$like':'%'+_0x510c45[_0x285c('0x39')]['filter']+'%'};return _0x165d8b;})});}_0x3defd4=_[_0x285c('0x46')]({},_0x3defd4,_0x510c45[_0x285c('0x49')]);return db[_0x285c('0x69')]['count']({'where':_0x3defd4[_0x285c('0x43')]})['then'](function(_0x737cec){_0x2fc6d0['count']=_0x737cec;if(_0x510c45['query'][_0x285c('0x50')]){_0x3defd4['include']=[{'all':!![]}];}return db[_0x285c('0x69')][_0x285c('0x4b')](_0x3defd4);})[_0x285c('0x29')](function(_0x2396bb){_0x2fc6d0[_0x285c('0x64')]=_0x2396bb;return _0x2fc6d0;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x304607,_0x3defd4))[_0x285c('0x4c')](handleError(_0x304607,null));};exports[_0x285c('0x6a')]=function(_0x2bd425,_0x7e35ef,_0x3919e1){var _0x5a8a14={};var _0x352186={};var _0x35be70;var _0x141f33;return db[_0x285c('0x33')]['findOne']({'where':{'id':_0x2bd425[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x7e35ef,null))[_0x285c('0x29')](function(_0x423b2d){if(_0x423b2d){_0x35be70=_0x423b2d;_0x352186['model']=_[_0x285c('0x3a')](db['CmList'][_0x285c('0x34')]);_0x352186[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x2bd425['query']);_0x352186[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x352186[_0x285c('0x38')],_0x352186[_0x285c('0x39')]);_0x5a8a14['attributes']=_[_0x285c('0x3c')](_0x352186[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x2bd425[_0x285c('0x39')][_0x285c('0x3e')]));_0x5a8a14[_0x285c('0x3d')]=_0x5a8a14[_0x285c('0x3d')][_0x285c('0x4f')]?_0x5a8a14['attributes']:_0x352186['model'];_0x5a8a14[_0x285c('0x41')]=qs[_0x285c('0x42')](_0x2bd425[_0x285c('0x39')][_0x285c('0x42')]);_0x5a8a14[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x2bd425[_0x285c('0x39')],_0x352186[_0x285c('0x3b')]));if(_0x2bd425[_0x285c('0x39')][_0x285c('0x45')]){_0x5a8a14['where']=_[_0x285c('0x46')](_0x5a8a14['where'],{'$or':_[_0x285c('0x47')](_0x5a8a14[_0x285c('0x3d')],function(_0x18f0ff){var _0x848896={};_0x848896[_0x18f0ff]={'$like':'%'+_0x2bd425[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x848896;})});}_0x5a8a14=_[_0x285c('0x46')]({},_0x5a8a14,_0x2bd425[_0x285c('0x49')]);return _0x35be70[_0x285c('0x6a')](_0x5a8a14);}})['then'](function(_0x447da5){if(_0x447da5){_0x141f33=_0x447da5[_0x285c('0x4f')];if(!_0x2bd425[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x5a8a14[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x2bd425['query'][_0x285c('0x21')]);_0x5a8a14[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x2bd425[_0x285c('0x39')]['offset']);}return _0x35be70['getLists'](_0x5a8a14);}})[_0x285c('0x29')](function(_0x568d0c){if(_0x568d0c){return _0x568d0c?{'count':_0x141f33,'rows':_0x568d0c}:null;}})[_0x285c('0x29')](respondWithResult(_0x7e35ef,null))[_0x285c('0x4c')](handleError(_0x7e35ef,null));};exports[_0x285c('0x6b')]=function(_0x3ed7bb,_0x540cd3,_0xec4a8d){var _0x29f013,_0x214f1f;return db[_0x285c('0x33')][_0x285c('0x51')]({'where':{'id':_0x3ed7bb[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x540cd3,null))['then'](function(_0x5e9e38){if(_0x5e9e38){_0x214f1f=_0x5e9e38;return _0x5e9e38[_0x285c('0x6b')](_0x3ed7bb['body']['ids'],_[_0x285c('0x5d')](_0x3ed7bb[_0x285c('0x53')],['ids','id'])||{});}return null;})[_0x285c('0x6c')](function(_0x3fb8e2){var _0x2ac706;_0x29f013=_0x3fb8e2||[];var _0x490e57=[];if(_0x3fb8e2){for(var _0x51768b=0x0;_0x51768b<_0x3fb8e2[_0x285c('0x4f')];_0x51768b+=0x1){var _0x1ced9d=_0x3fb8e2[_0x51768b][_0x285c('0x2a')]({'plain':!![]});_0x214f1f['dialCheckDuplicateType']=_0x3ed7bb[_0x285c('0x53')]['dialCheckDuplicateType']?_0x3ed7bb['body']['dialCheckDuplicateType']:_0x214f1f['dialCheckDuplicateType'];switch(_0x214f1f[_0x285c('0x6d')]){case _0x285c('0x6e'):_0x2ac706=squel[_0x285c('0x6f')]()['into'](_0x285c('0x70'))[_0x285c('0x71')]([_0x285c('0x72'),'scheduledAt','ContactId',_0x285c('0x73'),_0x285c('0x63'),_0x285c('0x5f'),_0x285c('0x5e')],squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x72'),_0x285c('0x72'))['field'](_0x285c('0x76'),_0x285c('0x77'))[_0x285c('0x75')]('id',_0x285c('0x78'))['field'](_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')](),_0x285c('0x73'))['field'](_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')](),_0x285c('0x63'))[_0x285c('0x75')](_0x285c('0x76'),_0x285c('0x5f'))[_0x285c('0x75')]('NOW()',_0x285c('0x5e'))[_0x285c('0x7b')](_0x285c('0x7c'))[_0x285c('0x43')](_0x285c('0x7d'))['where'](_0x285c('0x7e'),_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')](_0x285c('0x7f'))[_0x285c('0x43')](_0x285c('0x80'),squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x81'))['from'](_0x285c('0x82'))[_0x285c('0x43')](_0x285c('0x83'),_0x3ed7bb[_0x285c('0x4e')]['id']['toString']()))[_0x285c('0x43')](_0x285c('0x80'),squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x84'))[_0x285c('0x7b')](_0x285c('0x70'))[_0x285c('0x43')](_0x285c('0x83'),_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')]())))[_0x285c('0x7a')]();break;case _0x285c('0x85'):_0x2ac706=squel[_0x285c('0x6f')]()[_0x285c('0x86')](_0x285c('0x70'))[_0x285c('0x71')]([_0x285c('0x72'),_0x285c('0x77'),_0x285c('0x78'),_0x285c('0x73'),_0x285c('0x63'),_0x285c('0x5f'),'updatedAt'],squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x72'),_0x285c('0x72'))['field'](_0x285c('0x76'),_0x285c('0x77'))['field']('id','ContactId')[_0x285c('0x75')](_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')](),_0x285c('0x73'))[_0x285c('0x75')](_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')](),_0x285c('0x63'))['field'](_0x285c('0x76'),_0x285c('0x5f'))[_0x285c('0x75')](_0x285c('0x76'),_0x285c('0x5e'))[_0x285c('0x7b')](_0x285c('0x7c'))[_0x285c('0x43')](_0x285c('0x7d'))[_0x285c('0x43')]('ListId\x20=\x20?',_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')](_0x285c('0x7f'))[_0x285c('0x43')](_0x285c('0x80'),squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x84'))[_0x285c('0x7b')](_0x285c('0x70'))[_0x285c('0x43')](_0x285c('0x83'),_0x3ed7bb[_0x285c('0x4e')]['id']['toString']())))[_0x285c('0x7a')]();break;default:_0x2ac706=squel[_0x285c('0x6f')]()[_0x285c('0x86')](_0x285c('0x70'))[_0x285c('0x71')]([_0x285c('0x72'),_0x285c('0x77'),_0x285c('0x78'),_0x285c('0x73'),'CampaignId',_0x285c('0x5f'),_0x285c('0x5e')],squel[_0x285c('0x74')]()[_0x285c('0x75')]('phone',_0x285c('0x72'))[_0x285c('0x75')]('NOW()',_0x285c('0x77'))[_0x285c('0x75')]('id',_0x285c('0x78'))['field'](_0x1ced9d['CmListId'][_0x285c('0x7a')](),_0x285c('0x73'))['field'](_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')](),_0x285c('0x63'))[_0x285c('0x75')](_0x285c('0x76'),_0x285c('0x5f'))['field'](_0x285c('0x76'),_0x285c('0x5e'))[_0x285c('0x7b')]('cm_contacts')['where'](_0x285c('0x7d'))[_0x285c('0x43')](_0x285c('0x7e'),_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')](_0x285c('0x7f')))[_0x285c('0x7a')]();}_0x490e57[_0x285c('0x87')](db[_0x285c('0x88')][_0x285c('0x39')](_0x2ac706));}return BPromise[_0x285c('0x89')](_0x490e57);}})[_0x285c('0x29')](function(){return _0x29f013;})['then'](respondWithResult(_0x540cd3,null))[_0x285c('0x4c')](handleError(_0x540cd3,null));};exports[_0x285c('0x8a')]=function(_0x551f7d,_0x495dc8,_0xb17d40){return db['Campaign'][_0x285c('0x51')]({'where':{'id':_0x551f7d['params']['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x495dc8,null))[_0x285c('0x29')](function(_0x41c8df){if(_0x41c8df){return _0x41c8df[_0x285c('0x8a')](_0x551f7d['query'][_0x285c('0x8b')]);}})[_0x285c('0x29')](function(_0x3fcc98){if(_0x3fcc98){return db[_0x285c('0x62')][_0x285c('0x2c')]({'where':{'ListId':_0x551f7d[_0x285c('0x39')][_0x285c('0x8b')],'CampaignId':_0x551f7d[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](function(){return _0x3fcc98;});}})['then'](respondWithStatusCode(_0x495dc8,null))[_0x285c('0x4c')](handleError(_0x495dc8,null));};exports['getBlackLists']=function(_0x10ea64,_0x4f5ee7,_0x3aa966){var _0x23f054={};var _0x5d0cd1={};var _0x536daa;var _0x528b16;return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0x10ea64[_0x285c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f5ee7,null))[_0x285c('0x29')](function(_0x1034a4){if(_0x1034a4){_0x536daa=_0x1034a4;_0x5d0cd1['model']=_[_0x285c('0x3a')](db[_0x285c('0x8c')][_0x285c('0x34')]);_0x5d0cd1[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x10ea64['query']);_0x5d0cd1[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x5d0cd1['model'],_0x5d0cd1[_0x285c('0x39')]);_0x23f054['attributes']=_['intersection'](_0x5d0cd1[_0x285c('0x38')],qs['fields'](_0x10ea64[_0x285c('0x39')]['fields']));_0x23f054[_0x285c('0x3d')]=_0x23f054['attributes'][_0x285c('0x4f')]?_0x23f054[_0x285c('0x3d')]:_0x5d0cd1[_0x285c('0x38')];_0x23f054['order']=qs[_0x285c('0x42')](_0x10ea64[_0x285c('0x39')][_0x285c('0x42')]);_0x23f054['where']=qs['filters'](_[_0x285c('0x44')](_0x10ea64[_0x285c('0x39')],_0x5d0cd1[_0x285c('0x3b')]));if(_0x10ea64['query']['filter']){_0x23f054[_0x285c('0x43')]=_[_0x285c('0x46')](_0x23f054[_0x285c('0x43')],{'$or':_[_0x285c('0x47')](_0x23f054[_0x285c('0x3d')],function(_0x2f4dae){var _0x3a76e0={};_0x3a76e0[_0x2f4dae]={'$like':'%'+_0x10ea64[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x3a76e0;})});}_0x23f054=_[_0x285c('0x46')]({},_0x23f054,_0x10ea64[_0x285c('0x49')]);return _0x536daa[_0x285c('0x8d')](_0x23f054);}})['then'](function(_0x434516){if(_0x434516){_0x528b16=_0x434516[_0x285c('0x4f')];if(!_0x10ea64[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x23f054[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x10ea64['query'][_0x285c('0x21')]);_0x23f054[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x10ea64[_0x285c('0x39')]['offset']);}return _0x536daa[_0x285c('0x8d')](_0x23f054);}})[_0x285c('0x29')](function(_0x19845a){if(_0x19845a){return _0x19845a?{'count':_0x528b16,'rows':_0x19845a}:null;}})[_0x285c('0x29')](respondWithResult(_0x4f5ee7,null))['catch'](handleError(_0x4f5ee7,null));};exports[_0x285c('0x8e')]=function(_0x20c0ef,_0x4f633e,_0x271f4b){var _0xc084a6,_0x5b292a;return db[_0x285c('0x33')][_0x285c('0x51')]({'where':{'id':_0x20c0ef[_0x285c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f633e,null))[_0x285c('0x29')](function(_0x11d527){if(_0x11d527){_0x5b292a=_0x11d527;return _0x11d527['addBlackLists'](_0x20c0ef[_0x285c('0x53')][_0x285c('0x8b')],_[_0x285c('0x5d')](_0x20c0ef['body'],['ids','id'])||{});}return null;})[_0x285c('0x6c')](function(_0x7304a2){var _0x216656;_0xc084a6=_0x7304a2||[];var _0x4f1f14=[];if(_0x7304a2){for(var _0x4629a0=0x0;_0x4629a0<_0x7304a2['length'];_0x4629a0+=0x1){var _0x585dc5=_0x7304a2[_0x4629a0][_0x285c('0x2a')]({'plain':!![]});_0x216656=squel[_0x285c('0x6f')]()[_0x285c('0x86')](_0x285c('0x8f'))[_0x285c('0x71')]([_0x285c('0x72'),_0x285c('0x78'),_0x285c('0x73'),_0x285c('0x63'),'createdAt','updatedAt'],squel['select']()[_0x285c('0x75')]('phone',_0x285c('0x72'))[_0x285c('0x75')]('id',_0x285c('0x78'))[_0x285c('0x75')](_0x585dc5[_0x285c('0x79')][_0x285c('0x7a')](),'ListId')[_0x285c('0x75')](_0x20c0ef['params']['id']['toString'](),_0x285c('0x63'))[_0x285c('0x75')](_0x285c('0x76'),'createdAt')['field'](_0x285c('0x76'),'updatedAt')['from'](_0x285c('0x7c'))[_0x285c('0x43')]('deletedAt\x20IS\x20NULL')[_0x285c('0x43')](_0x285c('0x7e'),_0x585dc5[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x4f1f14[_0x285c('0x87')](db['sequelize']['query'](_0x216656));}return BPromise[_0x285c('0x89')](_0x4f1f14);}})[_0x285c('0x29')](function(){return _0xc084a6;})[_0x285c('0x29')](respondWithResult(_0x4f633e,null))[_0x285c('0x4c')](handleError(_0x4f633e,null));};exports[_0x285c('0x90')]=function(_0xb90e95,_0x360e98,_0x1d34d2){return db[_0x285c('0x33')][_0x285c('0x51')]({'where':{'id':_0xb90e95['params']['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x360e98,null))[_0x285c('0x29')](function(_0x23e822){if(_0x23e822){return _0x23e822['removeBlackLists'](_0xb90e95[_0x285c('0x39')][_0x285c('0x8b')]);}})[_0x285c('0x29')](function(_0x1fef68){if(_0x1fef68){return db['CmHopperBlack'][_0x285c('0x2c')]({'where':{'ListId':_0xb90e95[_0x285c('0x39')][_0x285c('0x8b')],'CampaignId':_0xb90e95[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](function(){return _0x1fef68;});}})[_0x285c('0x29')](respondWithStatusCode(_0x360e98,null))[_0x285c('0x4c')](handleError(_0x360e98,null));}; \ No newline at end of file +var _0x3828=['../../mysqldb','sendStatus','end','json','offset','limit','undefined','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Campaign','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','clone','params','omit','createdAt','updatedAt','role','IvrCampaigns','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','order','CampaignId','getHopperHistories','CmHopperHistory','sort','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','phone','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2aa3ed,_0x21bb61){var _0x4e0881=function(_0x581164){while(--_0x581164){_0x2aa3ed['push'](_0x2aa3ed['shift']());}};_0x4e0881(++_0x21bb61);}(_0x3828,0x188));var _0x8382=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3828[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x8382('0x0'));var rimraf=require(_0x8382('0x1'));var zipdir=require(_0x8382('0x2'));var jsonpatch=require(_0x8382('0x3'));var rp=require('request-promise');var moment=require(_0x8382('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8382('0x5'));var util=require(_0x8382('0x6'));var path=require(_0x8382('0x7'));var sox=require('sox');var csv=require(_0x8382('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8382('0x9'));var _=require('lodash');var squel=require(_0x8382('0xa'));var crypto=require(_0x8382('0xb'));var jsforce=require(_0x8382('0xc'));var deskjs=require(_0x8382('0xd'));var toCsv=require(_0x8382('0x8'));var querystring=require(_0x8382('0xe'));var Papa=require(_0x8382('0xf'));var Redis=require(_0x8382('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8382('0x11'));var as=require(_0x8382('0x12'));var hardwareService=require(_0x8382('0x13'));var logger=require(_0x8382('0x14'))(_0x8382('0x15'));var utils=require(_0x8382('0x16'));var config=require(_0x8382('0x17'));var licenseUtil=require(_0x8382('0x18'));var db=require(_0x8382('0x19'))['db'];function respondWithStatusCode(_0x2a485c,_0x114977){_0x114977=_0x114977||0xcc;return function(_0x3b9d59){if(_0x3b9d59){return _0x2a485c[_0x8382('0x1a')](_0x114977);}return _0x2a485c['status'](_0x114977)[_0x8382('0x1b')]();};}function respondWithResult(_0x2e0c65,_0x43eb8c){_0x43eb8c=_0x43eb8c||0xc8;return function(_0x31080f){if(_0x31080f){return _0x2e0c65['status'](_0x43eb8c)[_0x8382('0x1c')](_0x31080f);}};}function respondWithFilteredResult(_0x32409c,_0x21d942){return function(_0x4b4760){if(_0x4b4760){var _0x3bee21=typeof _0x21d942[_0x8382('0x1d')]==='undefined'&&typeof _0x21d942[_0x8382('0x1e')]===_0x8382('0x1f');var _0x441cb1=_0x4b4760['count'];var _0x5b39fa=_0x3bee21?0x0:_0x21d942['offset'];var _0x434de1=_0x3bee21?_0x4b4760['count']:_0x21d942[_0x8382('0x1d')]+_0x21d942[_0x8382('0x1e')];var _0x125e30;if(_0x434de1>=_0x441cb1){_0x434de1=_0x441cb1;_0x125e30=0xc8;}else{_0x125e30=0xce;}_0x32409c[_0x8382('0x20')](_0x125e30);return _0x32409c[_0x8382('0x21')](_0x8382('0x22'),_0x5b39fa+'-'+_0x434de1+'/'+_0x441cb1)[_0x8382('0x1c')](_0x4b4760);}return null;};}function patchUpdates(_0x351e58){return function(_0x43ad44){try{jsonpatch[_0x8382('0x23')](_0x43ad44,_0x351e58,!![]);}catch(_0x344cbf){return BPromise[_0x8382('0x24')](_0x344cbf);}return _0x43ad44['save']();};}function saveUpdates(_0x4af78f,_0xc595b7){return function(_0x27e87a){if(_0x27e87a){return _0x27e87a[_0x8382('0x25')](_0x4af78f)['then'](function(_0x29b9ce){return _0x29b9ce;});}return null;};}function removeEntity(_0x98f02f,_0x2fa5a0){return function(_0x503bb6){if(_0x503bb6){return _0x503bb6['destroy']()[_0x8382('0x26')](function(){var _0x12311c=_0x503bb6['get']({'plain':!![]});var _0x4377d9='IvrCampaigns';return db['UserProfileResource'][_0x8382('0x27')]({'where':{'type':_0x4377d9,'resourceId':_0x12311c['id']}})[_0x8382('0x26')](function(){return _0x503bb6;});})[_0x8382('0x26')](function(){_0x98f02f[_0x8382('0x20')](0xcc)[_0x8382('0x1b')]();});}};}function handleEntityNotFound(_0x5344dd,_0x2625e9){return function(_0x2f1a2b){if(!_0x2f1a2b){_0x5344dd[_0x8382('0x1a')](0x194);}return _0x2f1a2b;};}function handleError(_0xd2a383,_0xf207e4){_0xf207e4=_0xf207e4||0x1f4;return function(_0x10e3bc){logger[_0x8382('0x28')](_0x10e3bc[_0x8382('0x29')]);if(_0x10e3bc['name']){delete _0x10e3bc[_0x8382('0x2a')];}_0xd2a383['status'](_0xf207e4)[_0x8382('0x2b')](_0x10e3bc);};}exports[_0x8382('0x2c')]=function(_0x1f5f89,_0x188c72){var _0x75d838={},_0x41c259={},_0x5f4108={'count':0x0,'rows':[]};var _0x4bc4f0=_[_0x8382('0x2d')](db[_0x8382('0x2e')]['rawAttributes'],function(_0xf3b1ed){return{'name':_0xf3b1ed[_0x8382('0x2f')],'type':_0xf3b1ed[_0x8382('0x30')]['key']};});_0x41c259[_0x8382('0x31')]=_['map'](_0x4bc4f0,'name');_0x41c259[_0x8382('0x32')]=_[_0x8382('0x33')](_0x1f5f89['query']);_0x41c259[_0x8382('0x34')]=_[_0x8382('0x35')](_0x41c259['model'],_0x41c259[_0x8382('0x32')]);_0x75d838[_0x8382('0x36')]=_[_0x8382('0x35')](_0x41c259[_0x8382('0x31')],qs[_0x8382('0x37')](_0x1f5f89['query'][_0x8382('0x37')]));_0x75d838[_0x8382('0x36')]=_0x75d838['attributes'][_0x8382('0x38')]?_0x75d838[_0x8382('0x36')]:_0x41c259['model'];if(!_0x1f5f89[_0x8382('0x32')]['hasOwnProperty']('nolimit')){_0x75d838[_0x8382('0x1e')]=qs[_0x8382('0x1e')](_0x1f5f89[_0x8382('0x32')][_0x8382('0x1e')]);_0x75d838[_0x8382('0x1d')]=qs['offset'](_0x1f5f89[_0x8382('0x32')][_0x8382('0x1d')]);}_0x75d838['order']=qs['sort'](_0x1f5f89[_0x8382('0x32')]['sort']);_0x75d838[_0x8382('0x39')]=qs['filters'](_[_0x8382('0x3a')](_0x1f5f89[_0x8382('0x32')],_0x41c259[_0x8382('0x34')]),_0x4bc4f0);if(_0x1f5f89[_0x8382('0x32')][_0x8382('0x3b')]){_0x75d838[_0x8382('0x39')]=_[_0x8382('0x3c')](_0x75d838[_0x8382('0x39')],{'$or':_[_0x8382('0x2d')](_0x4bc4f0,function(_0x1b351a){if(_0x1b351a[_0x8382('0x30')]!=='VIRTUAL'){var _0x1ff735={};_0x1ff735[_0x1b351a[_0x8382('0x2a')]]={'$like':'%'+_0x1f5f89['query'][_0x8382('0x3b')]+'%'};return _0x1ff735;}})});}_0x75d838=_[_0x8382('0x3c')]({},_0x75d838,_0x1f5f89[_0x8382('0x3d')]);var _0x398164={'where':_0x75d838[_0x8382('0x39')]};return db[_0x8382('0x2e')][_0x8382('0x3e')](_0x398164)[_0x8382('0x26')](function(_0x4206b3){_0x5f4108[_0x8382('0x3e')]=_0x4206b3;if(_0x1f5f89[_0x8382('0x32')][_0x8382('0x3f')]){_0x75d838[_0x8382('0x40')]=[{'all':!![]}];}return db['Campaign'][_0x8382('0x41')](_0x75d838);})[_0x8382('0x26')](function(_0x2d6e44){_0x5f4108[_0x8382('0x42')]=_0x2d6e44;return _0x5f4108;})[_0x8382('0x26')](respondWithFilteredResult(_0x188c72,_0x75d838))['catch'](handleError(_0x188c72,null));};exports[_0x8382('0x43')]=function(_0x361f93,_0x13da07){var _0xf0b230={'raw':![],'where':{'id':_0x361f93['params']['id']}},_0x1aed7b={};_0x1aed7b['model']=_[_0x8382('0x33')](db[_0x8382('0x2e')][_0x8382('0x44')]);_0x1aed7b[_0x8382('0x32')]=_[_0x8382('0x33')](_0x361f93[_0x8382('0x32')]);_0x1aed7b[_0x8382('0x34')]=_[_0x8382('0x35')](_0x1aed7b[_0x8382('0x31')],_0x1aed7b[_0x8382('0x32')]);_0xf0b230[_0x8382('0x36')]=_['intersection'](_0x1aed7b[_0x8382('0x31')],qs[_0x8382('0x37')](_0x361f93['query'][_0x8382('0x37')]));_0xf0b230[_0x8382('0x36')]=_0xf0b230['attributes'][_0x8382('0x38')]?_0xf0b230[_0x8382('0x36')]:_0x1aed7b[_0x8382('0x31')];if(_0x361f93['query'][_0x8382('0x3f')]){_0xf0b230['include']=[{'all':!![]}];}_0xf0b230=_[_0x8382('0x3c')]({},_0xf0b230,_0x361f93[_0x8382('0x3d')]);return db[_0x8382('0x2e')][_0x8382('0x45')](_0xf0b230)[_0x8382('0x26')](handleEntityNotFound(_0x13da07,null))[_0x8382('0x26')](respondWithResult(_0x13da07,null))[_0x8382('0x46')](handleError(_0x13da07,null));};exports['create']=function(_0x4e83ca,_0x1bd57e){return db[_0x8382('0x2e')][_0x8382('0x47')](_0x4e83ca[_0x8382('0x48')],{})[_0x8382('0x26')](function(_0x3337b5){var _0x4cb8a4=_0x4e83ca[_0x8382('0x49')]['get']({'plain':!![]});if(!_0x4cb8a4)throw new Error(_0x8382('0x4a'));if(_0x4cb8a4['role']===_0x8382('0x49')){var _0x2e3c10=_0x3337b5[_0x8382('0x4b')]({'plain':!![]});var _0x14eb15='IvrCampaigns';return db[_0x8382('0x4c')][_0x8382('0x45')]({'where':{'name':_0x14eb15,'userProfileId':_0x4cb8a4[_0x8382('0x4d')]},'raw':!![]})[_0x8382('0x26')](function(_0x19e515){if(_0x19e515&&_0x19e515['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2e3c10[_0x8382('0x2a')],'resourceId':_0x2e3c10['id'],'type':_0x19e515[_0x8382('0x2a')],'sectionId':_0x19e515['id']},{})[_0x8382('0x26')](function(){return _0x3337b5;});}else{return _0x3337b5;}})[_0x8382('0x46')](function(_0x36c1f0){logger[_0x8382('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36c1f0);throw _0x36c1f0;});}return _0x3337b5;})[_0x8382('0x26')](respondWithResult(_0x1bd57e,0xc9))['catch'](handleError(_0x1bd57e,null));};exports[_0x8382('0x4e')]=function(_0x42d565,_0x1de434){var _0x4e730a={'where':{'id':_0x42d565[_0x8382('0x4f')]['id']}},_0x3b572e={};_0x3b572e['model']=_[_0x8382('0x33')](db[_0x8382('0x2e')][_0x8382('0x44')]);_0x4e730a[_0x8382('0x36')]=_[_0x8382('0x35')](_0x3b572e[_0x8382('0x31')],qs['fields'](_0x42d565[_0x8382('0x32')][_0x8382('0x37')]));_0x4e730a[_0x8382('0x36')]=_0x4e730a[_0x8382('0x36')]['length']?_0x4e730a[_0x8382('0x36')]:_0x3b572e[_0x8382('0x31')];if(_0x42d565[_0x8382('0x32')][_0x8382('0x3f')]){_0x4e730a[_0x8382('0x40')]=[{'all':!![]}];}_0x4e730a=_['merge']({},_0x4e730a,_0x42d565[_0x8382('0x3d')]);return db[_0x8382('0x2e')]['find'](_0x4e730a)[_0x8382('0x26')](handleEntityNotFound(_0x1de434,null))[_0x8382('0x26')](function(_0x362229){if(_0x362229){var _0x154e0c=_0x362229['get']({'plain':!![]});_0x154e0c=qs[_0x8382('0x50')](_0x154e0c,['id',_0x8382('0x51'),_0x8382('0x52')]);_0x42d565[_0x8382('0x48')]=_[_0x8382('0x50')](_0x42d565[_0x8382('0x48')],['id',_0x8382('0x51'),_0x8382('0x52')]);return db[_0x8382('0x2e')][_0x8382('0x47')](_['merge'](_0x154e0c,_0x42d565['body']),{'include':_0x42d565[_0x8382('0x32')][_0x8382('0x3f')]?[{'all':!![]}]:undefined})[_0x8382('0x26')](function(_0x4f16d9){var _0x4907eb=_0x42d565[_0x8382('0x49')][_0x8382('0x4b')]({'plain':!![]});if(!_0x4907eb)throw new Error(_0x8382('0x4a'));if(_0x4907eb[_0x8382('0x53')]===_0x8382('0x49')){var _0x4ba717=_0x4f16d9[_0x8382('0x4b')]({'plain':!![]});var _0x4f1c4a=_0x8382('0x54');return db[_0x8382('0x4c')][_0x8382('0x45')]({'where':{'name':_0x4f1c4a,'userProfileId':_0x4907eb[_0x8382('0x4d')]},'raw':!![]})[_0x8382('0x26')](function(_0x2e0ecb){if(_0x2e0ecb&&_0x2e0ecb['autoAssociation']===0x0){return db['UserProfileResource'][_0x8382('0x47')]({'name':_0x4ba717[_0x8382('0x2a')],'resourceId':_0x4ba717['id'],'type':_0x2e0ecb[_0x8382('0x2a')],'sectionId':_0x2e0ecb['id']},{})[_0x8382('0x26')](function(){return _0x4f16d9;});}else{return _0x4f16d9;}})[_0x8382('0x46')](function(_0x17ff21){logger[_0x8382('0x28')](_0x8382('0x55'),_0x17ff21);throw _0x17ff21;});}return _0x4f16d9;});}})[_0x8382('0x26')](respondWithResult(_0x1de434,0xc9))[_0x8382('0x46')](handleError(_0x1de434,null));};exports[_0x8382('0x25')]=function(_0x1b97d8,_0x107a7c){if(_0x1b97d8[_0x8382('0x48')]['id']){delete _0x1b97d8[_0x8382('0x48')]['id'];}return db['Campaign']['find']({'where':{'id':_0x1b97d8[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x107a7c,null))[_0x8382('0x26')](saveUpdates(_0x1b97d8[_0x8382('0x48')],null))[_0x8382('0x26')](respondWithResult(_0x107a7c,null))[_0x8382('0x46')](handleError(_0x107a7c,null));};exports[_0x8382('0x27')]=function(_0x30303d,_0x4854cc){return db[_0x8382('0x2e')][_0x8382('0x45')]({'where':{'id':_0x30303d[_0x8382('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4854cc,null))[_0x8382('0x26')](removeEntity(_0x4854cc,null))[_0x8382('0x46')](handleError(_0x4854cc,null));};exports[_0x8382('0x56')]=function(_0x4800dd,_0x44e678,_0xbd9997){var _0x1031d9={'raw':!![],'where':{}};var _0x271b66={};var _0x3de4ad={'count':0x0,'rows':[]};return db[_0x8382('0x2e')][_0x8382('0x57')]({'where':{'id':_0x4800dd[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x44e678,null))[_0x8382('0x26')](function(_0x182fd1){if(_0x182fd1){_0x271b66[_0x8382('0x31')]=_['keys'](db[_0x8382('0x58')][_0x8382('0x44')]);_0x271b66[_0x8382('0x32')]=_[_0x8382('0x33')](_0x4800dd[_0x8382('0x32')]);_0x271b66['filters']=_[_0x8382('0x35')](_0x271b66[_0x8382('0x31')],_0x271b66[_0x8382('0x32')]);_0x1031d9[_0x8382('0x36')]=_[_0x8382('0x35')](_0x271b66[_0x8382('0x31')],qs[_0x8382('0x37')](_0x4800dd[_0x8382('0x32')][_0x8382('0x37')]));_0x1031d9['attributes']=_0x1031d9[_0x8382('0x36')][_0x8382('0x38')]?_0x1031d9['attributes']:_0x271b66[_0x8382('0x31')];if(!_0x4800dd[_0x8382('0x32')][_0x8382('0x59')](_0x8382('0x5a'))){_0x1031d9['limit']=qs[_0x8382('0x1e')](_0x4800dd[_0x8382('0x32')][_0x8382('0x1e')]);_0x1031d9['offset']=qs[_0x8382('0x1d')](_0x4800dd['query'][_0x8382('0x1d')]);}_0x1031d9[_0x8382('0x5b')]=qs['sort'](_0x4800dd[_0x8382('0x32')]['sort']);_0x1031d9[_0x8382('0x39')]=qs[_0x8382('0x34')](_[_0x8382('0x3a')](_0x4800dd['query'],_0x271b66[_0x8382('0x34')]));_0x1031d9['where'][_0x8382('0x5c')]=_0x182fd1['id'];if(_0x4800dd[_0x8382('0x32')]['filter']){_0x1031d9[_0x8382('0x39')]=_[_0x8382('0x3c')](_0x1031d9[_0x8382('0x39')],{'$or':_[_0x8382('0x2d')](_0x1031d9['attributes'],function(_0x5933a6){var _0x10e101={};_0x10e101[_0x5933a6]={'$like':'%'+_0x4800dd[_0x8382('0x32')]['filter']+'%'};return _0x10e101;})});}_0x1031d9=_[_0x8382('0x3c')]({},_0x1031d9,_0x4800dd['options']);return db[_0x8382('0x58')][_0x8382('0x3e')]({'where':_0x1031d9['where']})[_0x8382('0x26')](function(_0x54b693){_0x3de4ad[_0x8382('0x3e')]=_0x54b693;if(_0x4800dd[_0x8382('0x32')][_0x8382('0x3f')]){_0x1031d9['include']=[{'all':!![]}];}return db[_0x8382('0x58')]['findAll'](_0x1031d9);})[_0x8382('0x26')](function(_0x14580b){_0x3de4ad['rows']=_0x14580b;return _0x3de4ad;});}})['then'](respondWithFilteredResult(_0x44e678,_0x1031d9))['catch'](handleError(_0x44e678,null));};exports[_0x8382('0x5d')]=function(_0x1e396e,_0x1d8ef2,_0x325f20){var _0x386fee={'raw':!![],'where':{}};var _0x4e69ed={};var _0x757852={'count':0x0,'rows':[]};return db[_0x8382('0x2e')][_0x8382('0x57')]({'where':{'id':_0x1e396e[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x1d8ef2,null))[_0x8382('0x26')](function(_0x12aea1){if(_0x12aea1){_0x4e69ed[_0x8382('0x31')]=_['keys'](db[_0x8382('0x5e')][_0x8382('0x44')]);_0x4e69ed[_0x8382('0x32')]=_[_0x8382('0x33')](_0x1e396e[_0x8382('0x32')]);_0x4e69ed[_0x8382('0x34')]=_[_0x8382('0x35')](_0x4e69ed[_0x8382('0x31')],_0x4e69ed[_0x8382('0x32')]);_0x386fee[_0x8382('0x36')]=_[_0x8382('0x35')](_0x4e69ed[_0x8382('0x31')],qs[_0x8382('0x37')](_0x1e396e[_0x8382('0x32')][_0x8382('0x37')]));_0x386fee[_0x8382('0x36')]=_0x386fee[_0x8382('0x36')]['length']?_0x386fee[_0x8382('0x36')]:_0x4e69ed[_0x8382('0x31')];if(!_0x1e396e[_0x8382('0x32')]['hasOwnProperty'](_0x8382('0x5a'))){_0x386fee[_0x8382('0x1e')]=qs['limit'](_0x1e396e[_0x8382('0x32')][_0x8382('0x1e')]);_0x386fee[_0x8382('0x1d')]=qs[_0x8382('0x1d')](_0x1e396e['query'][_0x8382('0x1d')]);}_0x386fee[_0x8382('0x5b')]=qs[_0x8382('0x5f')](_0x1e396e['query'][_0x8382('0x5f')]);_0x386fee[_0x8382('0x39')]=qs[_0x8382('0x34')](_[_0x8382('0x3a')](_0x1e396e[_0x8382('0x32')],_0x4e69ed['filters']));_0x386fee[_0x8382('0x39')]['CampaignId']=_0x12aea1['id'];if(_0x1e396e[_0x8382('0x32')][_0x8382('0x3b')]){_0x386fee[_0x8382('0x39')]=_['merge'](_0x386fee[_0x8382('0x39')],{'$or':_[_0x8382('0x2d')](_0x386fee[_0x8382('0x36')],function(_0x21ca0b){var _0x428fca={};_0x428fca[_0x21ca0b]={'$like':'%'+_0x1e396e[_0x8382('0x32')]['filter']+'%'};return _0x428fca;})});}_0x386fee=_[_0x8382('0x3c')]({},_0x386fee,_0x1e396e['options']);return db['CmHopperHistory'][_0x8382('0x3e')]({'where':_0x386fee[_0x8382('0x39')]})['then'](function(_0x5347c1){_0x757852[_0x8382('0x3e')]=_0x5347c1;if(_0x1e396e[_0x8382('0x32')][_0x8382('0x3f')]){_0x386fee[_0x8382('0x40')]=[{'all':!![]}];}return db[_0x8382('0x5e')]['findAll'](_0x386fee);})[_0x8382('0x26')](function(_0x103101){_0x757852[_0x8382('0x42')]=_0x103101;return _0x757852;});}})[_0x8382('0x26')](respondWithFilteredResult(_0x1d8ef2,_0x386fee))[_0x8382('0x46')](handleError(_0x1d8ef2,null));};exports[_0x8382('0x60')]=function(_0x96cbe3,_0x136281,_0x1bbd81){var _0x5d650e={'raw':!![],'where':{}};var _0x27b351={};var _0x2bfec2={'count':0x0,'rows':[]};return db[_0x8382('0x2e')][_0x8382('0x57')]({'where':{'id':_0x96cbe3[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x136281,null))['then'](function(_0x2a1419){if(_0x2a1419){_0x27b351['model']=_['keys'](db[_0x8382('0x61')][_0x8382('0x44')]);_0x27b351[_0x8382('0x32')]=_['keys'](_0x96cbe3[_0x8382('0x32')]);_0x27b351[_0x8382('0x34')]=_['intersection'](_0x27b351['model'],_0x27b351[_0x8382('0x32')]);_0x5d650e['attributes']=_['intersection'](_0x27b351[_0x8382('0x31')],qs[_0x8382('0x37')](_0x96cbe3[_0x8382('0x32')][_0x8382('0x37')]));_0x5d650e[_0x8382('0x36')]=_0x5d650e['attributes'][_0x8382('0x38')]?_0x5d650e['attributes']:_0x27b351[_0x8382('0x31')];if(!_0x96cbe3[_0x8382('0x32')][_0x8382('0x59')]('nolimit')){_0x5d650e['limit']=qs['limit'](_0x96cbe3[_0x8382('0x32')][_0x8382('0x1e')]);_0x5d650e[_0x8382('0x1d')]=qs[_0x8382('0x1d')](_0x96cbe3[_0x8382('0x32')][_0x8382('0x1d')]);}_0x5d650e['order']=qs[_0x8382('0x5f')](_0x96cbe3['query'][_0x8382('0x5f')]);_0x5d650e[_0x8382('0x39')]=qs[_0x8382('0x34')](_[_0x8382('0x3a')](_0x96cbe3[_0x8382('0x32')],_0x27b351[_0x8382('0x34')]));_0x5d650e[_0x8382('0x39')][_0x8382('0x5c')]=_0x2a1419['id'];if(_0x96cbe3[_0x8382('0x32')]['filter']){_0x5d650e[_0x8382('0x39')]=_[_0x8382('0x3c')](_0x5d650e[_0x8382('0x39')],{'$or':_[_0x8382('0x2d')](_0x5d650e[_0x8382('0x36')],function(_0x5b7322){var _0xd464d2={};_0xd464d2[_0x5b7322]={'$like':'%'+_0x96cbe3[_0x8382('0x32')][_0x8382('0x3b')]+'%'};return _0xd464d2;})});}_0x5d650e=_[_0x8382('0x3c')]({},_0x5d650e,_0x96cbe3[_0x8382('0x3d')]);return db[_0x8382('0x61')]['count']({'where':_0x5d650e['where']})[_0x8382('0x26')](function(_0x10e7fa){_0x2bfec2[_0x8382('0x3e')]=_0x10e7fa;if(_0x96cbe3[_0x8382('0x32')][_0x8382('0x3f')]){_0x5d650e[_0x8382('0x40')]=[{'all':!![]}];}return db[_0x8382('0x61')][_0x8382('0x41')](_0x5d650e);})[_0x8382('0x26')](function(_0x42bc94){_0x2bfec2[_0x8382('0x42')]=_0x42bc94;return _0x2bfec2;});}})[_0x8382('0x26')](respondWithFilteredResult(_0x136281,_0x5d650e))['catch'](handleError(_0x136281,null));};exports[_0x8382('0x62')]=function(_0x310deb,_0x4f3929,_0x1911f4){var _0xb599c7={'raw':!![],'where':{}};var _0x20ca7e={};var _0x154773={'count':0x0,'rows':[]};return db['Campaign'][_0x8382('0x57')]({'where':{'id':_0x310deb[_0x8382('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4f3929,null))[_0x8382('0x26')](function(_0x357846){if(_0x357846){_0x20ca7e[_0x8382('0x31')]=_['keys'](db['CmHopperBlack'][_0x8382('0x44')]);_0x20ca7e[_0x8382('0x32')]=_['keys'](_0x310deb[_0x8382('0x32')]);_0x20ca7e[_0x8382('0x34')]=_[_0x8382('0x35')](_0x20ca7e[_0x8382('0x31')],_0x20ca7e[_0x8382('0x32')]);_0xb599c7[_0x8382('0x36')]=_[_0x8382('0x35')](_0x20ca7e['model'],qs[_0x8382('0x37')](_0x310deb['query'][_0x8382('0x37')]));_0xb599c7[_0x8382('0x36')]=_0xb599c7['attributes'][_0x8382('0x38')]?_0xb599c7[_0x8382('0x36')]:_0x20ca7e[_0x8382('0x31')];if(!_0x310deb[_0x8382('0x32')][_0x8382('0x59')](_0x8382('0x5a'))){_0xb599c7[_0x8382('0x1e')]=qs[_0x8382('0x1e')](_0x310deb['query']['limit']);_0xb599c7[_0x8382('0x1d')]=qs['offset'](_0x310deb[_0x8382('0x32')]['offset']);}_0xb599c7[_0x8382('0x5b')]=qs['sort'](_0x310deb['query']['sort']);_0xb599c7[_0x8382('0x39')]=qs[_0x8382('0x34')](_['pick'](_0x310deb[_0x8382('0x32')],_0x20ca7e[_0x8382('0x34')]));_0xb599c7['where'][_0x8382('0x5c')]=_0x357846['id'];if(_0x310deb['query'][_0x8382('0x3b')]){_0xb599c7[_0x8382('0x39')]=_[_0x8382('0x3c')](_0xb599c7['where'],{'$or':_['map'](_0xb599c7[_0x8382('0x36')],function(_0x4c0a9a){var _0x2dd58c={};_0x2dd58c[_0x4c0a9a]={'$like':'%'+_0x310deb[_0x8382('0x32')][_0x8382('0x3b')]+'%'};return _0x2dd58c;})});}_0xb599c7=_[_0x8382('0x3c')]({},_0xb599c7,_0x310deb['options']);return db[_0x8382('0x63')][_0x8382('0x3e')]({'where':_0xb599c7[_0x8382('0x39')]})[_0x8382('0x26')](function(_0x1edd02){_0x154773[_0x8382('0x3e')]=_0x1edd02;if(_0x310deb[_0x8382('0x32')]['includeAll']){_0xb599c7[_0x8382('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x8382('0x41')](_0xb599c7);})[_0x8382('0x26')](function(_0x56b672){_0x154773['rows']=_0x56b672;return _0x154773;});}})['then'](respondWithFilteredResult(_0x4f3929,_0xb599c7))[_0x8382('0x46')](handleError(_0x4f3929,null));};exports[_0x8382('0x64')]=function(_0x4ff59b,_0x3239d4,_0x426775){var _0x314bc5={};var _0x4cdc4d={};var _0x207dac;var _0x16d360;return db[_0x8382('0x2e')][_0x8382('0x57')]({'where':{'id':_0x4ff59b[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x3239d4,null))['then'](function(_0x39dd09){if(_0x39dd09){_0x207dac=_0x39dd09;_0x4cdc4d[_0x8382('0x31')]=_['keys'](db[_0x8382('0x65')]['rawAttributes']);_0x4cdc4d[_0x8382('0x32')]=_[_0x8382('0x33')](_0x4ff59b['query']);_0x4cdc4d['filters']=_[_0x8382('0x35')](_0x4cdc4d[_0x8382('0x31')],_0x4cdc4d['query']);_0x314bc5[_0x8382('0x36')]=_[_0x8382('0x35')](_0x4cdc4d['model'],qs[_0x8382('0x37')](_0x4ff59b[_0x8382('0x32')][_0x8382('0x37')]));_0x314bc5['attributes']=_0x314bc5[_0x8382('0x36')][_0x8382('0x38')]?_0x314bc5[_0x8382('0x36')]:_0x4cdc4d[_0x8382('0x31')];_0x314bc5[_0x8382('0x5b')]=qs[_0x8382('0x5f')](_0x4ff59b[_0x8382('0x32')][_0x8382('0x5f')]);_0x314bc5[_0x8382('0x39')]=qs[_0x8382('0x34')](_[_0x8382('0x3a')](_0x4ff59b[_0x8382('0x32')],_0x4cdc4d[_0x8382('0x34')]));if(_0x4ff59b[_0x8382('0x32')][_0x8382('0x3b')]){_0x314bc5[_0x8382('0x39')]=_[_0x8382('0x3c')](_0x314bc5[_0x8382('0x39')],{'$or':_['map'](_0x314bc5[_0x8382('0x36')],function(_0x181e2a){var _0x255bce={};_0x255bce[_0x181e2a]={'$like':'%'+_0x4ff59b[_0x8382('0x32')][_0x8382('0x3b')]+'%'};return _0x255bce;})});}_0x314bc5=_[_0x8382('0x3c')]({},_0x314bc5,_0x4ff59b[_0x8382('0x3d')]);return _0x207dac[_0x8382('0x64')](_0x314bc5);}})[_0x8382('0x26')](function(_0x2526e7){if(_0x2526e7){_0x16d360=_0x2526e7[_0x8382('0x38')];if(!_0x4ff59b[_0x8382('0x32')][_0x8382('0x59')](_0x8382('0x5a'))){_0x314bc5[_0x8382('0x1e')]=qs[_0x8382('0x1e')](_0x4ff59b[_0x8382('0x32')][_0x8382('0x1e')]);_0x314bc5[_0x8382('0x1d')]=qs['offset'](_0x4ff59b[_0x8382('0x32')][_0x8382('0x1d')]);}return _0x207dac[_0x8382('0x64')](_0x314bc5);}})[_0x8382('0x26')](function(_0x2b6c95){if(_0x2b6c95){return _0x2b6c95?{'count':_0x16d360,'rows':_0x2b6c95}:null;}})[_0x8382('0x26')](respondWithResult(_0x3239d4,null))[_0x8382('0x46')](handleError(_0x3239d4,null));};exports[_0x8382('0x66')]=function(_0x458ee,_0x53be6e,_0x254096){var _0x84b1f3,_0x463fe5;return db[_0x8382('0x2e')][_0x8382('0x45')]({'where':{'id':_0x458ee['params']['id']}})['then'](handleEntityNotFound(_0x53be6e,null))[_0x8382('0x26')](function(_0x27b2eb){if(_0x27b2eb){_0x463fe5=_0x27b2eb;return _0x27b2eb['addLists'](_0x458ee['body'][_0x8382('0x67')],_[_0x8382('0x50')](_0x458ee[_0x8382('0x48')],['ids','id'])||{});}return null;})[_0x8382('0x68')](function(_0x4d04c7){var _0x12f4eb;_0x84b1f3=_0x4d04c7||[];var _0x189de7=[];if(_0x4d04c7){for(var _0x37462e=0x0;_0x37462e<_0x4d04c7[_0x8382('0x38')];_0x37462e+=0x1){var _0x752986=_0x4d04c7[_0x37462e][_0x8382('0x4b')]({'plain':!![]});_0x463fe5['dialCheckDuplicateType']=_0x458ee['body'][_0x8382('0x69')]?_0x458ee[_0x8382('0x48')][_0x8382('0x69')]:_0x463fe5['dialCheckDuplicateType'];switch(_0x463fe5[_0x8382('0x69')]){case _0x8382('0x6a'):_0x12f4eb=squel[_0x8382('0x6b')]()[_0x8382('0x6c')](_0x8382('0x6d'))[_0x8382('0x6e')](['phone',_0x8382('0x6f'),_0x8382('0x70'),'ListId',_0x8382('0x5c'),_0x8382('0x51'),_0x8382('0x52')],squel['select']()['field'](_0x8382('0x71'),_0x8382('0x71'))[_0x8382('0x72')](_0x8382('0x73'),'scheduledAt')[_0x8382('0x72')]('id',_0x8382('0x70'))[_0x8382('0x72')](_0x752986[_0x8382('0x74')]['toString'](),'ListId')[_0x8382('0x72')](_0x458ee[_0x8382('0x4f')]['id'][_0x8382('0x75')](),_0x8382('0x5c'))[_0x8382('0x72')](_0x8382('0x73'),_0x8382('0x51'))[_0x8382('0x72')](_0x8382('0x73'),_0x8382('0x52'))[_0x8382('0x76')](_0x8382('0x77'))['where'](_0x8382('0x78'))['where'](_0x8382('0x79'),_0x752986[_0x8382('0x74')][_0x8382('0x75')]())['where'](_0x8382('0x7a'))['where'](_0x8382('0x7b'),squel[_0x8382('0x7c')]()[_0x8382('0x72')](_0x8382('0x7d'))[_0x8382('0x76')](_0x8382('0x7e'))[_0x8382('0x39')](_0x8382('0x7f'),_0x458ee['params']['id'][_0x8382('0x75')]()))[_0x8382('0x39')](_0x8382('0x7b'),squel['select']()['field'](_0x8382('0x80'))[_0x8382('0x76')](_0x8382('0x6d'))['where'](_0x8382('0x7f'),_0x458ee['params']['id'][_0x8382('0x75')]())))['toString']();break;case _0x8382('0x81'):_0x12f4eb=squel['insert']()['into'](_0x8382('0x6d'))[_0x8382('0x6e')]([_0x8382('0x71'),_0x8382('0x6f'),'ContactId',_0x8382('0x82'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x8382('0x72')](_0x8382('0x71'),'phone')['field'](_0x8382('0x73'),_0x8382('0x6f'))[_0x8382('0x72')]('id',_0x8382('0x70'))['field'](_0x752986[_0x8382('0x74')]['toString'](),_0x8382('0x82'))[_0x8382('0x72')](_0x458ee['params']['id'][_0x8382('0x75')](),_0x8382('0x5c'))[_0x8382('0x72')]('NOW()',_0x8382('0x51'))[_0x8382('0x72')]('NOW()',_0x8382('0x52'))[_0x8382('0x76')](_0x8382('0x77'))[_0x8382('0x39')](_0x8382('0x78'))[_0x8382('0x39')](_0x8382('0x79'),_0x752986[_0x8382('0x74')]['toString']())[_0x8382('0x39')](_0x8382('0x7a'))[_0x8382('0x39')](_0x8382('0x7b'),squel[_0x8382('0x7c')]()[_0x8382('0x72')](_0x8382('0x80'))[_0x8382('0x76')](_0x8382('0x6d'))[_0x8382('0x39')](_0x8382('0x7f'),_0x458ee[_0x8382('0x4f')]['id'][_0x8382('0x75')]())))[_0x8382('0x75')]();break;default:_0x12f4eb=squel['insert']()[_0x8382('0x6c')]('cm_hopper')[_0x8382('0x6e')]([_0x8382('0x71'),_0x8382('0x6f'),_0x8382('0x70'),_0x8382('0x82'),_0x8382('0x5c'),_0x8382('0x51'),_0x8382('0x52')],squel[_0x8382('0x7c')]()[_0x8382('0x72')](_0x8382('0x71'),'phone')['field']('NOW()',_0x8382('0x6f'))[_0x8382('0x72')]('id',_0x8382('0x70'))[_0x8382('0x72')](_0x752986[_0x8382('0x74')][_0x8382('0x75')](),_0x8382('0x82'))[_0x8382('0x72')](_0x458ee[_0x8382('0x4f')]['id'][_0x8382('0x75')](),_0x8382('0x5c'))[_0x8382('0x72')](_0x8382('0x73'),_0x8382('0x51'))['field'](_0x8382('0x73'),_0x8382('0x52'))[_0x8382('0x76')](_0x8382('0x77'))[_0x8382('0x39')](_0x8382('0x78'))['where'](_0x8382('0x79'),_0x752986[_0x8382('0x74')][_0x8382('0x75')]())[_0x8382('0x39')](_0x8382('0x7a')))[_0x8382('0x75')]();}_0x189de7[_0x8382('0x83')](db[_0x8382('0x84')][_0x8382('0x32')](_0x12f4eb));}return BPromise['all'](_0x189de7);}})[_0x8382('0x26')](function(){return _0x84b1f3;})[_0x8382('0x26')](respondWithResult(_0x53be6e,null))[_0x8382('0x46')](handleError(_0x53be6e,null));};exports[_0x8382('0x85')]=function(_0x4e1411,_0x384c27,_0x4bf422){return db[_0x8382('0x2e')][_0x8382('0x45')]({'where':{'id':_0x4e1411[_0x8382('0x4f')]['id']}})['then'](handleEntityNotFound(_0x384c27,null))[_0x8382('0x26')](function(_0x35ff56){if(_0x35ff56){return _0x35ff56[_0x8382('0x85')](_0x4e1411[_0x8382('0x32')][_0x8382('0x67')]);}})[_0x8382('0x26')](function(_0x345030){if(_0x345030){return db[_0x8382('0x58')][_0x8382('0x27')]({'where':{'ListId':_0x4e1411[_0x8382('0x32')][_0x8382('0x67')],'CampaignId':_0x4e1411[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](function(){return _0x345030;});}})['then'](respondWithStatusCode(_0x384c27,null))[_0x8382('0x46')](handleError(_0x384c27,null));};exports[_0x8382('0x86')]=function(_0x23fec9,_0x46e9f7,_0x1cd6e0){var _0x1a8be6={};var _0x458b5b={};var _0x10f00e;var _0x5ec246;return db[_0x8382('0x2e')][_0x8382('0x57')]({'where':{'id':_0x23fec9[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x46e9f7,null))[_0x8382('0x26')](function(_0x10e6df){if(_0x10e6df){_0x10f00e=_0x10e6df;_0x458b5b[_0x8382('0x31')]=_[_0x8382('0x33')](db[_0x8382('0x65')][_0x8382('0x44')]);_0x458b5b[_0x8382('0x32')]=_[_0x8382('0x33')](_0x23fec9[_0x8382('0x32')]);_0x458b5b[_0x8382('0x34')]=_[_0x8382('0x35')](_0x458b5b[_0x8382('0x31')],_0x458b5b[_0x8382('0x32')]);_0x1a8be6[_0x8382('0x36')]=_[_0x8382('0x35')](_0x458b5b[_0x8382('0x31')],qs[_0x8382('0x37')](_0x23fec9[_0x8382('0x32')][_0x8382('0x37')]));_0x1a8be6[_0x8382('0x36')]=_0x1a8be6[_0x8382('0x36')][_0x8382('0x38')]?_0x1a8be6[_0x8382('0x36')]:_0x458b5b[_0x8382('0x31')];_0x1a8be6[_0x8382('0x5b')]=qs[_0x8382('0x5f')](_0x23fec9[_0x8382('0x32')][_0x8382('0x5f')]);_0x1a8be6[_0x8382('0x39')]=qs[_0x8382('0x34')](_[_0x8382('0x3a')](_0x23fec9[_0x8382('0x32')],_0x458b5b[_0x8382('0x34')]));if(_0x23fec9[_0x8382('0x32')][_0x8382('0x3b')]){_0x1a8be6[_0x8382('0x39')]=_['merge'](_0x1a8be6['where'],{'$or':_[_0x8382('0x2d')](_0x1a8be6[_0x8382('0x36')],function(_0x26d2e9){var _0xeeee20={};_0xeeee20[_0x26d2e9]={'$like':'%'+_0x23fec9['query'][_0x8382('0x3b')]+'%'};return _0xeeee20;})});}_0x1a8be6=_[_0x8382('0x3c')]({},_0x1a8be6,_0x23fec9[_0x8382('0x3d')]);return _0x10f00e[_0x8382('0x86')](_0x1a8be6);}})[_0x8382('0x26')](function(_0x5b9084){if(_0x5b9084){_0x5ec246=_0x5b9084[_0x8382('0x38')];if(!_0x23fec9[_0x8382('0x32')][_0x8382('0x59')]('nolimit')){_0x1a8be6['limit']=qs[_0x8382('0x1e')](_0x23fec9[_0x8382('0x32')][_0x8382('0x1e')]);_0x1a8be6[_0x8382('0x1d')]=qs['offset'](_0x23fec9['query'][_0x8382('0x1d')]);}return _0x10f00e['getBlackLists'](_0x1a8be6);}})[_0x8382('0x26')](function(_0x43472a){if(_0x43472a){return _0x43472a?{'count':_0x5ec246,'rows':_0x43472a}:null;}})[_0x8382('0x26')](respondWithResult(_0x46e9f7,null))[_0x8382('0x46')](handleError(_0x46e9f7,null));};exports[_0x8382('0x87')]=function(_0x163f47,_0x5f27f2,_0x480cd3){var _0x2902dc,_0x1ac4cd;return db[_0x8382('0x2e')]['find']({'where':{'id':_0x163f47[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x5f27f2,null))['then'](function(_0x46d74d){if(_0x46d74d){_0x1ac4cd=_0x46d74d;return _0x46d74d[_0x8382('0x87')](_0x163f47[_0x8382('0x48')][_0x8382('0x67')],_['omit'](_0x163f47['body'],[_0x8382('0x67'),'id'])||{});}return null;})[_0x8382('0x68')](function(_0xf29451){var _0x1f89f5;_0x2902dc=_0xf29451||[];var _0x3ded7a=[];if(_0xf29451){for(var _0x504786=0x0;_0x504786<_0xf29451[_0x8382('0x38')];_0x504786+=0x1){var _0x2db5b3=_0xf29451[_0x504786][_0x8382('0x4b')]({'plain':!![]});_0x1f89f5=squel[_0x8382('0x6b')]()[_0x8382('0x6c')](_0x8382('0x88'))[_0x8382('0x6e')]([_0x8382('0x71'),'ContactId',_0x8382('0x82'),'CampaignId','createdAt',_0x8382('0x52')],squel[_0x8382('0x7c')]()[_0x8382('0x72')](_0x8382('0x71'),_0x8382('0x71'))[_0x8382('0x72')]('id',_0x8382('0x70'))['field'](_0x2db5b3[_0x8382('0x74')]['toString'](),'ListId')['field'](_0x163f47[_0x8382('0x4f')]['id']['toString'](),'CampaignId')[_0x8382('0x72')](_0x8382('0x73'),_0x8382('0x51'))[_0x8382('0x72')](_0x8382('0x73'),_0x8382('0x52'))[_0x8382('0x76')](_0x8382('0x77'))[_0x8382('0x39')](_0x8382('0x78'))[_0x8382('0x39')](_0x8382('0x79'),_0x2db5b3['CmListId'][_0x8382('0x75')]())['where'](_0x8382('0x7a')))[_0x8382('0x75')]();_0x3ded7a[_0x8382('0x83')](db[_0x8382('0x84')][_0x8382('0x32')](_0x1f89f5));}return BPromise[_0x8382('0x89')](_0x3ded7a);}})[_0x8382('0x26')](function(){return _0x2902dc;})[_0x8382('0x26')](respondWithResult(_0x5f27f2,null))[_0x8382('0x46')](handleError(_0x5f27f2,null));};exports[_0x8382('0x8a')]=function(_0x5e7e3a,_0x50bb8c,_0x41f569){return db[_0x8382('0x2e')]['find']({'where':{'id':_0x5e7e3a[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x50bb8c,null))[_0x8382('0x26')](function(_0x3f741c){if(_0x3f741c){return _0x3f741c[_0x8382('0x8a')](_0x5e7e3a[_0x8382('0x32')][_0x8382('0x67')]);}})[_0x8382('0x26')](function(_0x53bd78){if(_0x53bd78){return db[_0x8382('0x63')][_0x8382('0x27')]({'where':{'ListId':_0x5e7e3a[_0x8382('0x32')][_0x8382('0x67')],'CampaignId':_0x5e7e3a[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](function(){return _0x53bd78;});}})['then'](respondWithStatusCode(_0x50bb8c,null))['catch'](handleError(_0x50bb8c,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 024fa1b..d64ded3 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','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(_0x309e52,_0x26c91b){var _0x2797c6=function(_0x1f333f){while(--_0x1f333f){_0x309e52['push'](_0x309e52['shift']());}};_0x2797c6(++_0x26c91b);}(_0x7a54,0x106));var _0x47a5=function(_0x117209,_0x5ae3b1){_0x117209=_0x117209-0x0;var _0x3dfb7d=_0x7a54[_0x117209];return _0x3dfb7d;};'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 9b86cb8..f3bb0b6 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 _0xee11=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Campaign,\x20%s,\x20%s','result','GetCampaign','Campaign','options','where','limit','include','map','attributes','model','debug','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x3cb882,_0x12f180){var _0x5d0bdb=function(_0x41780c){while(--_0x41780c){_0x3cb882['push'](_0x3cb882['shift']());}};_0x5d0bdb(++_0x12f180);}(_0xee11,0x146));var _0x1ee1=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xee11[_0x269ee8];return _0x4d98bd;};'use strict';var _=require(_0x1ee1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1ee1('0x1'));var rs=require(_0x1ee1('0x2'));var fs=require('fs');var Redis=require(_0x1ee1('0x3'));var db=require(_0x1ee1('0x4'))['db'];var utils=require(_0x1ee1('0x5'));var logger=require(_0x1ee1('0x6'))(_0x1ee1('0x7'));var config=require(_0x1ee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ee1('0x9')][_0x1ee1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fdb3b,_0x289d4c,_0x356919){return new BPromise(function(_0x47f984,_0x48af4c){return client[_0x1ee1('0xb')](_0x3fdb3b,_0x356919)[_0x1ee1('0xc')](function(_0x5899ca){logger[_0x1ee1('0xd')]('Campaign,\x20%s,\x20%s',_0x289d4c,_0x1ee1('0xe'));logger['debug'](_0x1ee1('0xf'),_0x289d4c,_0x1ee1('0xe'),JSON[_0x1ee1('0x10')](_0x5899ca));if(_0x5899ca[_0x1ee1('0x11')]){if(_0x5899ca['error'][_0x1ee1('0x12')]===0x1f4){logger[_0x1ee1('0x11')]('Campaign,\x20%s,\x20%s',_0x289d4c,_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);return _0x48af4c(_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);}logger[_0x1ee1('0x11')](_0x1ee1('0x14'),_0x289d4c,_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);return _0x47f984(_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);}else{logger[_0x1ee1('0xd')](_0x1ee1('0x14'),_0x289d4c,_0x1ee1('0xe'));_0x47f984(_0x5899ca[_0x1ee1('0x15')]['message']);}})['catch'](function(_0x7ff856){logger[_0x1ee1('0x11')](_0x1ee1('0x14'),_0x289d4c,_0x7ff856);_0x48af4c(_0x7ff856);});});}exports[_0x1ee1('0x16')]=function(_0x1e18b9){var _0xff3d76=this;return new Promise(function(_0x55abff,_0x39229e){return db[_0x1ee1('0x17')]['findAll']({'raw':_0x1e18b9[_0x1ee1('0x18')]?_0x1e18b9[_0x1ee1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1e18b9['options']?_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x19')]||null:null,'attributes':_0x1e18b9[_0x1ee1('0x18')]?_0x1e18b9[_0x1ee1('0x18')]['attributes']||null:null,'limit':_0x1e18b9[_0x1ee1('0x18')]?_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x1a')]||null:null,'include':_0x1e18b9['options']?_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x1b')]?_[_0x1ee1('0x1c')](_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x1b')],function(_0x353542){return{'model':db[_0x353542['model']],'as':_0x353542['as'],'attributes':_0x353542[_0x1ee1('0x1d')],'include':_0x353542['include']?_['map'](_0x353542[_0x1ee1('0x1b')],function(_0x306aac){return{'model':db[_0x306aac['model']],'as':_0x306aac['as'],'attributes':_0x306aac[_0x1ee1('0x1d')],'include':_0x306aac[_0x1ee1('0x1b')]?_[_0x1ee1('0x1c')](_0x306aac[_0x1ee1('0x1b')],function(_0x129232){return{'model':db[_0x129232[_0x1ee1('0x1e')]],'as':_0x129232['as'],'attributes':_0x129232['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ee1('0xc')](function(_0x8a95d8){logger[_0x1ee1('0xd')](_0x1ee1('0x16'),_0x1e18b9);logger[_0x1ee1('0x1f')](_0x1ee1('0x16'),_0x1e18b9,JSON['stringify'](_0x8a95d8));_0x55abff(_0x8a95d8);})[_0x1ee1('0x20')](function(_0x576bf4){logger[_0x1ee1('0x11')](_0x1ee1('0x16'),_0x576bf4['message'],_0x1e18b9);_0x39229e(_0xff3d76['error'](0x1f4,_0x576bf4[_0x1ee1('0x13')]));});});}; \ No newline at end of file +var _0x3ee5=['limit','include','map','model','attributes','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where'];(function(_0x555d30,_0xba683d){var _0x423c33=function(_0x332e28){while(--_0x332e28){_0x555d30['push'](_0x555d30['shift']());}};_0x423c33(++_0xba683d);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x4c6b47,_0x46d3a0){_0x4c6b47=_0x4c6b47-0x0;var _0x33a498=_0x3ee5[_0x4c6b47];return _0x33a498;};'use strict';var _=require('lodash');var util=require(_0x53ee('0x0'));var moment=require(_0x53ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x53ee('0x2'));var fs=require('fs');var Redis=require(_0x53ee('0x3'));var db=require(_0x53ee('0x4'))['db'];var utils=require(_0x53ee('0x5'));var logger=require(_0x53ee('0x6'))(_0x53ee('0x7'));var config=require(_0x53ee('0x8'));var jayson=require(_0x53ee('0x9'));var client=jayson[_0x53ee('0xa')][_0x53ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3173b2,_0x48bc62,_0x299b23){return new BPromise(function(_0x235c9f,_0x1ec296){return client[_0x53ee('0xc')](_0x3173b2,_0x299b23)[_0x53ee('0xd')](function(_0x3b1252){logger[_0x53ee('0xe')](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));logger[_0x53ee('0x11')](_0x53ee('0x12'),_0x48bc62,_0x53ee('0x10'),JSON['stringify'](_0x3b1252));if(_0x3b1252['error']){if(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x14')]===0x1f4){logger[_0x53ee('0x13')](_0x53ee('0xf'),_0x48bc62,_0x3b1252[_0x53ee('0x13')]['message']);return _0x1ec296(_0x3b1252['error'][_0x53ee('0x15')]);}logger[_0x53ee('0x13')]('Campaign,\x20%s,\x20%s',_0x48bc62,_0x3b1252['error'][_0x53ee('0x15')]);return _0x235c9f(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x15')]);}else{logger['info'](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));_0x235c9f(_0x3b1252[_0x53ee('0x16')][_0x53ee('0x15')]);}})[_0x53ee('0x17')](function(_0x2fb3cd){logger['error'](_0x53ee('0xf'),_0x48bc62,_0x2fb3cd);_0x1ec296(_0x2fb3cd);});});}exports[_0x53ee('0x18')]=function(_0x3d788e){var _0x17c3cb=this;return new Promise(function(_0x708604,_0x29a4b4){return db[_0x53ee('0x19')][_0x53ee('0x1a')]({'raw':_0x3d788e[_0x53ee('0x1b')]?_0x3d788e[_0x53ee('0x1b')][_0x53ee('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d788e[_0x53ee('0x1b')]?_0x3d788e[_0x53ee('0x1b')][_0x53ee('0x1d')]||null:null,'attributes':_0x3d788e['options']?_0x3d788e[_0x53ee('0x1b')]['attributes']||null:null,'limit':_0x3d788e['options']?_0x3d788e[_0x53ee('0x1b')][_0x53ee('0x1e')]||null:null,'include':_0x3d788e[_0x53ee('0x1b')]?_0x3d788e['options'][_0x53ee('0x1f')]?_[_0x53ee('0x20')](_0x3d788e[_0x53ee('0x1b')][_0x53ee('0x1f')],function(_0x364444){return{'model':db[_0x364444[_0x53ee('0x21')]],'as':_0x364444['as'],'attributes':_0x364444['attributes'],'include':_0x364444['include']?_[_0x53ee('0x20')](_0x364444[_0x53ee('0x1f')],function(_0x2274cf){return{'model':db[_0x2274cf[_0x53ee('0x21')]],'as':_0x2274cf['as'],'attributes':_0x2274cf[_0x53ee('0x22')],'include':_0x2274cf['include']?_[_0x53ee('0x20')](_0x2274cf['include'],function(_0x26080d){return{'model':db[_0x26080d['model']],'as':_0x26080d['as'],'attributes':_0x26080d[_0x53ee('0x22')]};}):[]};}):[]};}):[]:[]})[_0x53ee('0xd')](function(_0x11d4fa){logger[_0x53ee('0xe')](_0x53ee('0x18'),_0x3d788e);logger[_0x53ee('0x11')](_0x53ee('0x18'),_0x3d788e,JSON[_0x53ee('0x23')](_0x11d4fa));_0x708604(_0x11d4fa);})[_0x53ee('0x17')](function(_0x189ef9){logger[_0x53ee('0x13')]('GetCampaign',_0x189ef9[_0x53ee('0x15')],_0x3d788e);_0x29a4b4(_0x17c3cb['error'](0x1f4,_0x189ef9[_0x53ee('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index e0917ec..2b4c7f5 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 _0x0047=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x5638f6,_0x6d4277){var _0x13ea4c=function(_0x5698b7){while(--_0x5698b7){_0x5638f6['push'](_0x5638f6['shift']());}};_0x13ea4c(++_0x6d4277);}(_0x0047,0x69));var _0x7004=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x0047[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0x7004('0x0'));var util=require(_0x7004('0x1'));var path=require('path');var timeout=require(_0x7004('0x2'));var express=require('express');var router=express[_0x7004('0x3')]();var fs_extra=require(_0x7004('0x4'));var auth=require(_0x7004('0x5'));var interaction=require(_0x7004('0x6'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x7004('0x7')]('/',auth[_0x7004('0x8')](),controller[_0x7004('0x9')]);router[_0x7004('0x7')](_0x7004('0xa'),auth[_0x7004('0x8')](),controller[_0x7004('0xb')]);router[_0x7004('0x7')](_0x7004('0xc'),auth[_0x7004('0x8')](),controller[_0x7004('0xd')]);router[_0x7004('0x7')](_0x7004('0xe'),auth[_0x7004('0x8')](),controller[_0x7004('0xf')]);router[_0x7004('0x7')](_0x7004('0x10'),auth[_0x7004('0x8')](),controller[_0x7004('0x11')]);router[_0x7004('0x7')](_0x7004('0x12'),auth['isAuthenticated'](),controller[_0x7004('0x13')]);router[_0x7004('0x7')](_0x7004('0x14'),auth[_0x7004('0x8')](),controller[_0x7004('0x15')]);router['get'](_0x7004('0x16'),auth[_0x7004('0x8')](),controller['getBlackLists']);router[_0x7004('0x17')]('/',auth[_0x7004('0x8')](),controller[_0x7004('0x18')]);router['post'](_0x7004('0x19'),auth['isAuthenticated'](),controller[_0x7004('0x1a')]);router[_0x7004('0x17')](_0x7004('0x14'),auth[_0x7004('0x8')](),controller[_0x7004('0x1b')]);router['post'](_0x7004('0x16'),auth[_0x7004('0x8')](),controller[_0x7004('0x1c')]);router[_0x7004('0x1d')](_0x7004('0xa'),auth[_0x7004('0x8')](),controller['update']);router[_0x7004('0x1e')](_0x7004('0xa'),auth[_0x7004('0x8')](),controller[_0x7004('0x1f')]);router[_0x7004('0x1e')](_0x7004('0x14'),auth[_0x7004('0x8')](),controller[_0x7004('0x20')]);router[_0x7004('0x1e')](_0x7004('0x16'),auth[_0x7004('0x8')](),controller[_0x7004('0x21')]);module[_0x7004('0x22')]=router; \ No newline at end of file +var _0x1da6=['create','clone','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post'];(function(_0x532383,_0x5a01d2){var _0x4e6c7c=function(_0xe23203){while(--_0xe23203){_0x532383['push'](_0x532383['shift']());}};_0x4e6c7c(++_0x5a01d2);}(_0x1da6,0x7c));var _0x61da=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0x1da6[_0x263f4c];return _0x3a78d3;};'use strict';var multer=require(_0x61da('0x0'));var util=require(_0x61da('0x1'));var path=require(_0x61da('0x2'));var timeout=require(_0x61da('0x3'));var express=require(_0x61da('0x4'));var router=express[_0x61da('0x5')]();var fs_extra=require(_0x61da('0x6'));var auth=require(_0x61da('0x7'));var interaction=require(_0x61da('0x8'));var config=require(_0x61da('0x9'));var controller=require(_0x61da('0xa'));router[_0x61da('0xb')]('/',auth[_0x61da('0xc')](),controller[_0x61da('0xd')]);router[_0x61da('0xb')](_0x61da('0xe'),auth[_0x61da('0xc')](),controller[_0x61da('0xf')]);router[_0x61da('0xb')](_0x61da('0x10'),auth['isAuthenticated'](),controller[_0x61da('0x11')]);router[_0x61da('0xb')](_0x61da('0x12'),auth[_0x61da('0xc')](),controller[_0x61da('0x13')]);router[_0x61da('0xb')](_0x61da('0x14'),auth[_0x61da('0xc')](),controller[_0x61da('0x15')]);router[_0x61da('0xb')](_0x61da('0x16'),auth[_0x61da('0xc')](),controller[_0x61da('0x17')]);router[_0x61da('0xb')](_0x61da('0x18'),auth['isAuthenticated'](),controller[_0x61da('0x19')]);router[_0x61da('0xb')](_0x61da('0x1a'),auth[_0x61da('0xc')](),controller['getBlackLists']);router[_0x61da('0x1b')]('/',auth['isAuthenticated'](),controller[_0x61da('0x1c')]);router[_0x61da('0x1b')]('/:id/clone',auth['isAuthenticated'](),controller[_0x61da('0x1d')]);router[_0x61da('0x1b')](_0x61da('0x18'),auth[_0x61da('0xc')](),controller[_0x61da('0x1e')]);router[_0x61da('0x1b')]('/:id/blacklists',auth[_0x61da('0xc')](),controller[_0x61da('0x1f')]);router[_0x61da('0x20')](_0x61da('0xe'),auth['isAuthenticated'](),controller[_0x61da('0x21')]);router[_0x61da('0x22')](_0x61da('0xe'),auth[_0x61da('0xc')](),controller['destroy']);router[_0x61da('0x22')]('/:id/lists',auth[_0x61da('0xc')](),controller[_0x61da('0x23')]);router[_0x61da('0x22')](_0x61da('0x1a'),auth[_0x61da('0xc')](),controller[_0x61da('0x24')]);module[_0x61da('0x25')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 0ea522f..ab8c0c8 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 _0x574c=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x4a850a,_0x43ed12){var _0x1126ec=function(_0x27a594){while(--_0x27a594){_0x4a850a['push'](_0x4a850a['shift']());}};_0x1126ec(++_0x43ed12);}(_0x574c,0xf3));var _0xc574=function(_0x519828,_0x51ff66){_0x519828=_0x519828-0x0;var _0x25857b=_0x574c[_0x519828];return _0x25857b;};'use strict';var Sequelize=require(_0xc574('0x0'));module[_0xc574('0x1')]={'key':{'type':Sequelize[_0xc574('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xc574('0x2')]},'name':{'type':Sequelize[_0xc574('0x3')],'get':function(){return this[_0xc574('0x4')](_0xc574('0x5'));}}}; \ No newline at end of file +var _0x1565=['VIRTUAL','getDataValue','key','sequelize','TEXT','STRING'];(function(_0x380a5a,_0x50f2e5){var _0xd47ac1=function(_0x57dda9){while(--_0x57dda9){_0x380a5a['push'](_0x380a5a['shift']());}};_0xd47ac1(++_0x50f2e5);}(_0x1565,0xb1));var _0x5156=function(_0x5ccb57,_0x5a8d00){_0x5ccb57=_0x5ccb57-0x0;var _0x34d458=_0x1565[_0x5ccb57];return _0x34d458;};'use strict';var Sequelize=require(_0x5156('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x5156('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5156('0x2')]},'name':{'type':Sequelize[_0x5156('0x3')],'get':function(){return this[_0x5156('0x4')](_0x5156('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 5dec0f5..d3fa0ba 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 _0xef9f=['create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','show','params','catch','body','find'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xef9f,0x122));var _0xfef9=function(_0x3893cd,_0x5b133e){_0x3893cd=_0x3893cd-0x0;var _0x818ea5=_0xef9f[_0x3893cd];return _0x818ea5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfef9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfef9('0x1'));var moment=require(_0xfef9('0x2'));var BPromise=require(_0xfef9('0x3'));var Mustache=require(_0xfef9('0x4'));var util=require(_0xfef9('0x5'));var path=require(_0xfef9('0x6'));var sox=require('sox');var csv=require(_0xfef9('0x7'));var ejs=require(_0xfef9('0x8'));var fs=require('fs');var fs_extra=require(_0xfef9('0x9'));var _=require(_0xfef9('0xa'));var squel=require(_0xfef9('0xb'));var crypto=require(_0xfef9('0xc'));var jsforce=require(_0xfef9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfef9('0xe'));var Papa=require(_0xfef9('0xf'));var Redis=require(_0xfef9('0x10'));var authService=require(_0xfef9('0x11'));var qs=require(_0xfef9('0x12'));var as=require(_0xfef9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfef9('0x14'))('api');var utils=require(_0xfef9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfef9('0x16'));var db=require(_0xfef9('0x17'))['db'];function respondWithStatusCode(_0x3df20b,_0x20c90e){_0x20c90e=_0x20c90e||0xcc;return function(_0x350a31){if(_0x350a31){return _0x3df20b[_0xfef9('0x18')](_0x20c90e);}return _0x3df20b['status'](_0x20c90e)['end']();};}function respondWithResult(_0x2e3c95,_0x3eab72){_0x3eab72=_0x3eab72||0xc8;return function(_0x41064e){if(_0x41064e){return _0x2e3c95[_0xfef9('0x19')](_0x3eab72)['json'](_0x41064e);}};}function respondWithFilteredResult(_0x44646e,_0xa32f1){return function(_0x263386){if(_0x263386){var _0x4c6683=typeof _0xa32f1[_0xfef9('0x1a')]===_0xfef9('0x1b')&&typeof _0xa32f1['limit']===_0xfef9('0x1b');var _0x1d2277=_0x263386[_0xfef9('0x1c')];var _0xeaa514=_0x4c6683?0x0:_0xa32f1[_0xfef9('0x1a')];var _0x108a6b=_0x4c6683?_0x263386[_0xfef9('0x1c')]:_0xa32f1[_0xfef9('0x1a')]+_0xa32f1['limit'];var _0x36df58;if(_0x108a6b>=_0x1d2277){_0x108a6b=_0x1d2277;_0x36df58=0xc8;}else{_0x36df58=0xce;}_0x44646e[_0xfef9('0x19')](_0x36df58);return _0x44646e['set'](_0xfef9('0x1d'),_0xeaa514+'-'+_0x108a6b+'/'+_0x1d2277)[_0xfef9('0x1e')](_0x263386);}return null;};}function patchUpdates(_0x5e3cf9){return function(_0x381237){try{jsonpatch[_0xfef9('0x1f')](_0x381237,_0x5e3cf9,!![]);}catch(_0x57266d){return BPromise[_0xfef9('0x20')](_0x57266d);}return _0x381237['save']();};}function saveUpdates(_0x107cc1,_0x1ce2d8){return function(_0x3801fc){if(_0x3801fc){return _0x3801fc[_0xfef9('0x21')](_0x107cc1)[_0xfef9('0x22')](function(_0x20a8d3){return _0x20a8d3;});}return null;};}function removeEntity(_0x86ed5d,_0x376ca7){return function(_0x23b3d2){if(_0x23b3d2){return _0x23b3d2[_0xfef9('0x23')]()[_0xfef9('0x22')](function(){var _0x573740=_0x23b3d2[_0xfef9('0x24')]({'plain':!![]});var _0x32c213=_0xfef9('0x25');return db[_0xfef9('0x26')][_0xfef9('0x23')]({'where':{'type':_0x32c213,'resourceId':_0x573740['id']}})[_0xfef9('0x22')](function(){return _0x23b3d2;});})[_0xfef9('0x22')](function(){_0x86ed5d[_0xfef9('0x19')](0xcc)[_0xfef9('0x27')]();});}};}function handleEntityNotFound(_0x528c02,_0x566642){return function(_0x2af7d2){if(!_0x2af7d2){_0x528c02[_0xfef9('0x18')](0x194);}return _0x2af7d2;};}function handleError(_0x28dfc5,_0x5aaa9f){_0x5aaa9f=_0x5aaa9f||0x1f4;return function(_0x1f74ef){logger[_0xfef9('0x28')](_0x1f74ef[_0xfef9('0x29')]);if(_0x1f74ef[_0xfef9('0x2a')]){delete _0x1f74ef[_0xfef9('0x2a')];}_0x28dfc5[_0xfef9('0x19')](_0x5aaa9f)[_0xfef9('0x2b')](_0x1f74ef);};}exports[_0xfef9('0x2c')]=function(_0x6a2edc,_0x1ef741){var _0x345661={},_0x46da4d={},_0x245958={'count':0x0,'rows':[]};var _0x6955b2=_[_0xfef9('0x2d')](db['CannedAnswer'][_0xfef9('0x2e')],function(_0x1c0ab9){return{'name':_0x1c0ab9[_0xfef9('0x2f')],'type':_0x1c0ab9[_0xfef9('0x30')][_0xfef9('0x31')]};});_0x46da4d[_0xfef9('0x32')]=_[_0xfef9('0x2d')](_0x6955b2,_0xfef9('0x2a'));_0x46da4d[_0xfef9('0x33')]=_[_0xfef9('0x34')](_0x6a2edc['query']);_0x46da4d[_0xfef9('0x35')]=_['intersection'](_0x46da4d['model'],_0x46da4d[_0xfef9('0x33')]);_0x345661['attributes']=_[_0xfef9('0x36')](_0x46da4d[_0xfef9('0x32')],qs['fields'](_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x37')]));_0x345661[_0xfef9('0x38')]=_0x345661[_0xfef9('0x38')][_0xfef9('0x39')]?_0x345661[_0xfef9('0x38')]:_0x46da4d[_0xfef9('0x32')];if(!_0x6a2edc['query'][_0xfef9('0x3a')](_0xfef9('0x3b'))){_0x345661[_0xfef9('0x3c')]=qs[_0xfef9('0x3c')](_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x3c')]);_0x345661[_0xfef9('0x1a')]=qs['offset'](_0x6a2edc['query'][_0xfef9('0x1a')]);}_0x345661[_0xfef9('0x3d')]=qs[_0xfef9('0x3e')](_0x6a2edc['query']['sort']);_0x345661[_0xfef9('0x3f')]=qs[_0xfef9('0x35')](_[_0xfef9('0x40')](_0x6a2edc['query'],_0x46da4d['filters']),_0x6955b2);if(_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x41')]){_0x345661[_0xfef9('0x3f')]=_[_0xfef9('0x42')](_0x345661[_0xfef9('0x3f')],{'$or':[{'key':{'$like':'%'+_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x41')]+'%'}},{'value':{'$like':'%'+_0x6a2edc['query']['filter']+'%'}}]});}_0x345661=_[_0xfef9('0x42')]({},_0x345661,_0x6a2edc[_0xfef9('0x43')]);var _0xf64f63={'where':_0x345661['where']};return db[_0xfef9('0x44')]['count'](_0xf64f63)[_0xfef9('0x22')](function(_0x1008eb){_0x245958[_0xfef9('0x1c')]=_0x1008eb;if(_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x45')]){_0x345661[_0xfef9('0x46')]=[{'all':!![]}];}return db[_0xfef9('0x44')][_0xfef9('0x47')](_0x345661);})[_0xfef9('0x22')](function(_0xf13127){_0x245958[_0xfef9('0x48')]=_0xf13127;return _0x245958;})[_0xfef9('0x22')](respondWithFilteredResult(_0x1ef741,_0x345661))['catch'](handleError(_0x1ef741,null));};exports[_0xfef9('0x49')]=function(_0x4d411b,_0x45a701){var _0x4b29fb={'raw':!![],'where':{'id':_0x4d411b[_0xfef9('0x4a')]['id']}},_0x4fc3ad={};_0x4fc3ad['model']=_[_0xfef9('0x34')](db[_0xfef9('0x44')][_0xfef9('0x2e')]);_0x4fc3ad['query']=_[_0xfef9('0x34')](_0x4d411b['query']);_0x4fc3ad[_0xfef9('0x35')]=_['intersection'](_0x4fc3ad[_0xfef9('0x32')],_0x4fc3ad[_0xfef9('0x33')]);_0x4b29fb[_0xfef9('0x38')]=_['intersection'](_0x4fc3ad[_0xfef9('0x32')],qs[_0xfef9('0x37')](_0x4d411b[_0xfef9('0x33')]['fields']));_0x4b29fb[_0xfef9('0x38')]=_0x4b29fb[_0xfef9('0x38')][_0xfef9('0x39')]?_0x4b29fb['attributes']:_0x4fc3ad[_0xfef9('0x32')];if(_0x4d411b['query'][_0xfef9('0x45')]){_0x4b29fb[_0xfef9('0x46')]=[{'all':!![]}];}_0x4b29fb=_[_0xfef9('0x42')]({},_0x4b29fb,_0x4d411b['options']);return db['CannedAnswer']['find'](_0x4b29fb)[_0xfef9('0x22')](handleEntityNotFound(_0x45a701,null))[_0xfef9('0x22')](respondWithResult(_0x45a701,null))[_0xfef9('0x4b')](handleError(_0x45a701,null));};exports[_0xfef9('0x21')]=function(_0x135882,_0x7bd636){if(_0x135882[_0xfef9('0x4c')]['id']){delete _0x135882[_0xfef9('0x4c')]['id'];}return db[_0xfef9('0x44')]['find']({'where':{'id':_0x135882['params']['id']}})[_0xfef9('0x22')](handleEntityNotFound(_0x7bd636,null))[_0xfef9('0x22')](saveUpdates(_0x135882['body'],null))[_0xfef9('0x22')](respondWithResult(_0x7bd636,null))[_0xfef9('0x4b')](handleError(_0x7bd636,null));};exports['destroy']=function(_0x134f65,_0x370239){return db[_0xfef9('0x44')][_0xfef9('0x4d')]({'where':{'id':_0x134f65[_0xfef9('0x4a')]['id']}})[_0xfef9('0x22')](handleEntityNotFound(_0x370239,null))[_0xfef9('0x22')](removeEntity(_0x370239,null))['catch'](handleError(_0x370239,null));};exports[_0xfef9('0x4e')]=function(_0x59368d,_0x12f547){var _0x2566a7={'key':_0x59368d[_0xfef9('0x4c')][_0xfef9('0x31')]};if(_0x59368d[_0xfef9('0x4c')][_0xfef9('0x4f')]){_0x2566a7[_0xfef9('0x4f')]=_0x59368d[_0xfef9('0x4c')][_0xfef9('0x4f')];}else if(_0x59368d['body'][_0xfef9('0x50')]){_0x2566a7[_0xfef9('0x50')]=_0x59368d['body'][_0xfef9('0x50')];}else if(_0x59368d[_0xfef9('0x4c')]['OpenchannelAccountId']){_0x2566a7[_0xfef9('0x51')]=_0x59368d[_0xfef9('0x4c')][_0xfef9('0x51')];}else if(_0x59368d[_0xfef9('0x4c')]['ChatWebsiteId']){_0x2566a7['ChatWebsiteId']=_0x59368d[_0xfef9('0x4c')][_0xfef9('0x52')];}return db['CannedAnswer'][_0xfef9('0x4d')]({'where':_0x2566a7})[_0xfef9('0x22')](function(_0x3765a5){if(_0x3765a5){throw new db[(_0xfef9('0x53'))][(_0xfef9('0x54'))](_0xfef9('0x55'));}return db['CannedAnswer'][_0xfef9('0x4e')](_0x59368d[_0xfef9('0x4c')]);})[_0xfef9('0x22')](function(_0x1c4db4){var _0x56a64c=_0x59368d[_0xfef9('0x56')][_0xfef9('0x24')]({'plain':!![]});if(!_0x56a64c)throw new Error(_0xfef9('0x57'));if(_0x56a64c['role']===_0xfef9('0x56')){var _0x5c3c7a=_0x1c4db4[_0xfef9('0x24')]({'plain':!![]});return db[_0xfef9('0x58')][_0xfef9('0x4d')]({'where':{'name':_0xfef9('0x25'),'userProfileId':_0x56a64c[_0xfef9('0x59')]},'raw':!![]})['then'](function(_0x1115a5){if(_0x1115a5&&_0x1115a5[_0xfef9('0x5a')]===0x0){return db[_0xfef9('0x26')][_0xfef9('0x4e')]({'name':_0x5c3c7a[_0xfef9('0x2a')],'resourceId':_0x5c3c7a['id'],'type':_0x1115a5[_0xfef9('0x2a')],'sectionId':_0x1115a5['id']},{})['then'](function(){return _0x1c4db4;});}else{return _0x1c4db4;}})[_0xfef9('0x4b')](function(_0x4efd85){logger[_0xfef9('0x28')](_0xfef9('0x5b'),_0x4efd85);throw _0x4efd85;});}return _0x1c4db4;})[_0xfef9('0x22')](respondWithResult(_0x12f547,0xc9))[_0xfef9('0x4b')](handleError(_0x12f547,null));}; \ No newline at end of file +var _0x7d64=['then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','count','include','findAll','catch','show','params','rawAttributes','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update'];(function(_0x2ff8e3,_0x15553b){var _0x2f60b5=function(_0x582b5f){while(--_0x582b5f){_0x2ff8e3['push'](_0x2ff8e3['shift']());}};_0x2f60b5(++_0x15553b);}(_0x7d64,0xea));var _0x47d6=function(_0x4869b3,_0x53a366){_0x4869b3=_0x4869b3-0x0;var _0x7d9e28=_0x7d64[_0x4869b3];return _0x7d9e28;};'use strict';var emlformat=require(_0x47d6('0x0'));var rimraf=require(_0x47d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47d6('0x2'));var rp=require(_0x47d6('0x3'));var moment=require(_0x47d6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x47d6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x47d6('0x6'));var ejs=require(_0x47d6('0x7'));var fs=require('fs');var fs_extra=require(_0x47d6('0x8'));var _=require(_0x47d6('0x9'));var squel=require(_0x47d6('0xa'));var crypto=require(_0x47d6('0xb'));var jsforce=require(_0x47d6('0xc'));var deskjs=require(_0x47d6('0xd'));var toCsv=require(_0x47d6('0x6'));var querystring=require(_0x47d6('0xe'));var Papa=require(_0x47d6('0xf'));var Redis=require(_0x47d6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x47d6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47d6('0x12'));var logger=require(_0x47d6('0x13'))('api');var utils=require(_0x47d6('0x14'));var config=require(_0x47d6('0x15'));var licenseUtil=require(_0x47d6('0x16'));var db=require(_0x47d6('0x17'))['db'];function respondWithStatusCode(_0x4050bc,_0x2ec5bd){_0x2ec5bd=_0x2ec5bd||0xcc;return function(_0x4541cd){if(_0x4541cd){return _0x4050bc[_0x47d6('0x18')](_0x2ec5bd);}return _0x4050bc[_0x47d6('0x19')](_0x2ec5bd)[_0x47d6('0x1a')]();};}function respondWithResult(_0x1b9309,_0x42d132){_0x42d132=_0x42d132||0xc8;return function(_0x563333){if(_0x563333){return _0x1b9309[_0x47d6('0x19')](_0x42d132)[_0x47d6('0x1b')](_0x563333);}};}function respondWithFilteredResult(_0x5572ee,_0x279876){return function(_0x359fec){if(_0x359fec){var _0xd2d680=typeof _0x279876[_0x47d6('0x1c')]===_0x47d6('0x1d')&&typeof _0x279876[_0x47d6('0x1e')]===_0x47d6('0x1d');var _0x2ed80d=_0x359fec['count'];var _0x192cc8=_0xd2d680?0x0:_0x279876['offset'];var _0x3eb7e6=_0xd2d680?_0x359fec['count']:_0x279876['offset']+_0x279876[_0x47d6('0x1e')];var _0x1f9fbe;if(_0x3eb7e6>=_0x2ed80d){_0x3eb7e6=_0x2ed80d;_0x1f9fbe=0xc8;}else{_0x1f9fbe=0xce;}_0x5572ee[_0x47d6('0x19')](_0x1f9fbe);return _0x5572ee[_0x47d6('0x1f')](_0x47d6('0x20'),_0x192cc8+'-'+_0x3eb7e6+'/'+_0x2ed80d)['json'](_0x359fec);}return null;};}function patchUpdates(_0x4d32e5){return function(_0x4e9fb1){try{jsonpatch['apply'](_0x4e9fb1,_0x4d32e5,!![]);}catch(_0xb0be61){return BPromise[_0x47d6('0x21')](_0xb0be61);}return _0x4e9fb1[_0x47d6('0x22')]();};}function saveUpdates(_0x31e4fd,_0x234831){return function(_0xafbf60){if(_0xafbf60){return _0xafbf60[_0x47d6('0x23')](_0x31e4fd)[_0x47d6('0x24')](function(_0x34b9dc){return _0x34b9dc;});}return null;};}function removeEntity(_0x56091d,_0x13a4bc){return function(_0x12e4a6){if(_0x12e4a6){return _0x12e4a6[_0x47d6('0x25')]()[_0x47d6('0x24')](function(){var _0x3cc9f0=_0x12e4a6[_0x47d6('0x26')]({'plain':!![]});var _0x30fde6=_0x47d6('0x27');return db[_0x47d6('0x28')][_0x47d6('0x25')]({'where':{'type':_0x30fde6,'resourceId':_0x3cc9f0['id']}})['then'](function(){return _0x12e4a6;});})[_0x47d6('0x24')](function(){_0x56091d['status'](0xcc)[_0x47d6('0x1a')]();});}};}function handleEntityNotFound(_0x25e944,_0x5df188){return function(_0x23e16c){if(!_0x23e16c){_0x25e944[_0x47d6('0x18')](0x194);}return _0x23e16c;};}function handleError(_0x16943a,_0x31b350){_0x31b350=_0x31b350||0x1f4;return function(_0x5ec1cf){logger[_0x47d6('0x29')](_0x5ec1cf[_0x47d6('0x2a')]);if(_0x5ec1cf[_0x47d6('0x2b')]){delete _0x5ec1cf[_0x47d6('0x2b')];}_0x16943a['status'](_0x31b350)[_0x47d6('0x2c')](_0x5ec1cf);};}exports[_0x47d6('0x2d')]=function(_0x429904,_0xbff684){var _0x3ac2a4={},_0x360311={},_0x491da1={'count':0x0,'rows':[]};var _0x5da501=_[_0x47d6('0x2e')](db[_0x47d6('0x2f')]['rawAttributes'],function(_0xafdf8e){return{'name':_0xafdf8e[_0x47d6('0x30')],'type':_0xafdf8e[_0x47d6('0x31')][_0x47d6('0x32')]};});_0x360311['model']=_[_0x47d6('0x2e')](_0x5da501,_0x47d6('0x2b'));_0x360311[_0x47d6('0x33')]=_[_0x47d6('0x34')](_0x429904['query']);_0x360311[_0x47d6('0x35')]=_[_0x47d6('0x36')](_0x360311[_0x47d6('0x37')],_0x360311[_0x47d6('0x33')]);_0x3ac2a4['attributes']=_['intersection'](_0x360311['model'],qs[_0x47d6('0x38')](_0x429904['query'][_0x47d6('0x38')]));_0x3ac2a4[_0x47d6('0x39')]=_0x3ac2a4[_0x47d6('0x39')][_0x47d6('0x3a')]?_0x3ac2a4[_0x47d6('0x39')]:_0x360311[_0x47d6('0x37')];if(!_0x429904[_0x47d6('0x33')][_0x47d6('0x3b')]('nolimit')){_0x3ac2a4[_0x47d6('0x1e')]=qs[_0x47d6('0x1e')](_0x429904[_0x47d6('0x33')][_0x47d6('0x1e')]);_0x3ac2a4[_0x47d6('0x1c')]=qs['offset'](_0x429904[_0x47d6('0x33')]['offset']);}_0x3ac2a4[_0x47d6('0x3c')]=qs[_0x47d6('0x3d')](_0x429904['query'][_0x47d6('0x3d')]);_0x3ac2a4[_0x47d6('0x3e')]=qs[_0x47d6('0x35')](_[_0x47d6('0x3f')](_0x429904[_0x47d6('0x33')],_0x360311[_0x47d6('0x35')]),_0x5da501);if(_0x429904[_0x47d6('0x33')]['filter']){_0x3ac2a4[_0x47d6('0x3e')]=_[_0x47d6('0x40')](_0x3ac2a4[_0x47d6('0x3e')],{'$or':[{'key':{'$like':'%'+_0x429904[_0x47d6('0x33')][_0x47d6('0x41')]+'%'}},{'value':{'$like':'%'+_0x429904[_0x47d6('0x33')][_0x47d6('0x41')]+'%'}}]});}_0x3ac2a4=_[_0x47d6('0x40')]({},_0x3ac2a4,_0x429904[_0x47d6('0x42')]);var _0x27b1ae={'where':_0x3ac2a4[_0x47d6('0x3e')]};return db[_0x47d6('0x2f')][_0x47d6('0x43')](_0x27b1ae)['then'](function(_0x5d9af9){_0x491da1[_0x47d6('0x43')]=_0x5d9af9;if(_0x429904['query']['includeAll']){_0x3ac2a4[_0x47d6('0x44')]=[{'all':!![]}];}return db[_0x47d6('0x2f')][_0x47d6('0x45')](_0x3ac2a4);})[_0x47d6('0x24')](function(_0x51bfee){_0x491da1['rows']=_0x51bfee;return _0x491da1;})[_0x47d6('0x24')](respondWithFilteredResult(_0xbff684,_0x3ac2a4))[_0x47d6('0x46')](handleError(_0xbff684,null));};exports[_0x47d6('0x47')]=function(_0x279fa,_0x3e303f){var _0xb0dc5f={'raw':!![],'where':{'id':_0x279fa[_0x47d6('0x48')]['id']}},_0x211e57={};_0x211e57['model']=_[_0x47d6('0x34')](db[_0x47d6('0x2f')][_0x47d6('0x49')]);_0x211e57['query']=_['keys'](_0x279fa[_0x47d6('0x33')]);_0x211e57[_0x47d6('0x35')]=_['intersection'](_0x211e57[_0x47d6('0x37')],_0x211e57[_0x47d6('0x33')]);_0xb0dc5f[_0x47d6('0x39')]=_[_0x47d6('0x36')](_0x211e57[_0x47d6('0x37')],qs[_0x47d6('0x38')](_0x279fa[_0x47d6('0x33')][_0x47d6('0x38')]));_0xb0dc5f[_0x47d6('0x39')]=_0xb0dc5f[_0x47d6('0x39')][_0x47d6('0x3a')]?_0xb0dc5f[_0x47d6('0x39')]:_0x211e57[_0x47d6('0x37')];if(_0x279fa[_0x47d6('0x33')][_0x47d6('0x4a')]){_0xb0dc5f[_0x47d6('0x44')]=[{'all':!![]}];}_0xb0dc5f=_[_0x47d6('0x40')]({},_0xb0dc5f,_0x279fa[_0x47d6('0x42')]);return db[_0x47d6('0x2f')][_0x47d6('0x4b')](_0xb0dc5f)['then'](handleEntityNotFound(_0x3e303f,null))[_0x47d6('0x24')](respondWithResult(_0x3e303f,null))['catch'](handleError(_0x3e303f,null));};exports['update']=function(_0x4db305,_0x4b8893){if(_0x4db305[_0x47d6('0x4c')]['id']){delete _0x4db305[_0x47d6('0x4c')]['id'];}return db[_0x47d6('0x2f')][_0x47d6('0x4b')]({'where':{'id':_0x4db305[_0x47d6('0x48')]['id']}})[_0x47d6('0x24')](handleEntityNotFound(_0x4b8893,null))['then'](saveUpdates(_0x4db305['body'],null))[_0x47d6('0x24')](respondWithResult(_0x4b8893,null))['catch'](handleError(_0x4b8893,null));};exports[_0x47d6('0x25')]=function(_0x508538,_0x415b72){return db[_0x47d6('0x2f')][_0x47d6('0x4b')]({'where':{'id':_0x508538[_0x47d6('0x48')]['id']}})['then'](handleEntityNotFound(_0x415b72,null))['then'](removeEntity(_0x415b72,null))['catch'](handleError(_0x415b72,null));};exports[_0x47d6('0x4d')]=function(_0x43c136,_0x371c9b){var _0x52ee0b={'key':_0x43c136['body'][_0x47d6('0x32')]};if(_0x43c136['body'][_0x47d6('0x4e')]){_0x52ee0b[_0x47d6('0x4e')]=_0x43c136[_0x47d6('0x4c')][_0x47d6('0x4e')];}else if(_0x43c136['body'][_0x47d6('0x4f')]){_0x52ee0b[_0x47d6('0x4f')]=_0x43c136['body'][_0x47d6('0x4f')];}else if(_0x43c136[_0x47d6('0x4c')]['OpenchannelAccountId']){_0x52ee0b['OpenchannelAccountId']=_0x43c136[_0x47d6('0x4c')][_0x47d6('0x50')];}else if(_0x43c136['body'][_0x47d6('0x51')]){_0x52ee0b['ChatWebsiteId']=_0x43c136[_0x47d6('0x4c')][_0x47d6('0x51')];}return db[_0x47d6('0x2f')][_0x47d6('0x4b')]({'where':_0x52ee0b})[_0x47d6('0x24')](function(_0xf23e59){if(_0xf23e59){throw new db[(_0x47d6('0x52'))][(_0x47d6('0x53'))](_0x47d6('0x54'));}return db['CannedAnswer']['create'](_0x43c136[_0x47d6('0x4c')]);})['then'](function(_0x434640){var _0x36a4bc=_0x43c136[_0x47d6('0x55')][_0x47d6('0x26')]({'plain':!![]});if(!_0x36a4bc)throw new Error(_0x47d6('0x56'));if(_0x36a4bc[_0x47d6('0x57')]===_0x47d6('0x55')){var _0x460ce1=_0x434640[_0x47d6('0x26')]({'plain':!![]});return db[_0x47d6('0x58')][_0x47d6('0x4b')]({'where':{'name':_0x47d6('0x27'),'userProfileId':_0x36a4bc['userProfileId']},'raw':!![]})['then'](function(_0x4d5497){if(_0x4d5497&&_0x4d5497[_0x47d6('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x460ce1['name'],'resourceId':_0x460ce1['id'],'type':_0x4d5497[_0x47d6('0x2b')],'sectionId':_0x4d5497['id']},{})[_0x47d6('0x24')](function(){return _0x434640;});}else{return _0x434640;}})[_0x47d6('0x46')](function(_0x2fff7d){logger[_0x47d6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fff7d);throw _0x2fff7d;});}return _0x434640;})[_0x47d6('0x24')](respondWithResult(_0x371c9b,0xc9))[_0x47d6('0x46')](handleError(_0x371c9b,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index b0e1841..adb7303 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 _0xbf2b=['define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports'];(function(_0x20ac07,_0x55002e){var _0x25d350=function(_0x51910c){while(--_0x51910c){_0x20ac07['push'](_0x20ac07['shift']());}};_0x25d350(++_0x55002e);}(_0xbf2b,0x12f));var _0xbbf2=function(_0xccd88b,_0x18f330){_0xccd88b=_0xccd88b-0x0;var _0x1ea528=_0xbf2b[_0xccd88b];return _0x1ea528;};'use strict';var _=require(_0xbbf2('0x0'));var util=require(_0xbbf2('0x1'));var logger=require(_0xbbf2('0x2'))(_0xbbf2('0x3'));var moment=require(_0xbbf2('0x4'));var BPromise=require(_0xbbf2('0x5'));var rp=require(_0xbbf2('0x6'));var fs=require('fs');var path=require(_0xbbf2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xbbf2('0x8')]=function(_0x3c887f,_0x420df3){return _0x3c887f[_0xbbf2('0x9')](_0xbbf2('0xa'),attributes,{'tableName':_0xbbf2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbbf2('0xc')});}; \ No newline at end of file +var _0xe900=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x2e6c19,_0x131233){var _0x52885d=function(_0x38f224){while(--_0x38f224){_0x2e6c19['push'](_0x2e6c19['shift']());}};_0x52885d(++_0x131233);}(_0xe900,0x89));var _0x0e90=function(_0x31261c,_0x5d84dd){_0x31261c=_0x31261c-0x0;var _0x43919d=_0xe900[_0x31261c];return _0x43919d;};'use strict';var _=require(_0x0e90('0x0'));var util=require('util');var logger=require(_0x0e90('0x1'))(_0x0e90('0x2'));var moment=require(_0x0e90('0x3'));var BPromise=require('bluebird');var rp=require(_0x0e90('0x4'));var fs=require('fs');var path=require(_0x0e90('0x5'));var rimraf=require('rimraf');var config=require(_0x0e90('0x6'));var attributes=require(_0x0e90('0x7'));module[_0x0e90('0x8')]=function(_0x413d4b,_0x34a068){return _0x413d4b[_0x0e90('0x9')](_0x0e90('0xa'),attributes,{'tableName':_0x0e90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0e90('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index cb45144..47c1bbc 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(_0x286977,_0x4ffc3b){var _0x48da52=function(_0x3bf836){while(--_0x3bf836){_0x286977['push'](_0x286977['shift']());}};_0x48da52(++_0x4ffc3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});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(_0x1167cc,_0x5ea952){var _0x4aaedf=function(_0x529868){while(--_0x529868){_0x1167cc['push'](_0x1167cc['shift']());}};_0x4aaedf(++_0x5ea952);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 baa9c9c..6786de4 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 _0xeb12=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x122b35,_0x140c1){var _0xc54eb4=function(_0x2a0fdf){while(--_0x2a0fdf){_0x122b35['push'](_0x122b35['shift']());}};_0xc54eb4(++_0x140c1);}(_0xeb12,0x1f2));var _0x2eb1=function(_0x565569,_0x5c0375){_0x565569=_0x565569-0x0;var _0x1ac5da=_0xeb12[_0x565569];return _0x1ac5da;};'use strict';var multer=require(_0x2eb1('0x0'));var util=require(_0x2eb1('0x1'));var path=require('path');var timeout=require(_0x2eb1('0x2'));var express=require(_0x2eb1('0x3'));var router=express['Router']();var fs_extra=require(_0x2eb1('0x4'));var auth=require(_0x2eb1('0x5'));var interaction=require(_0x2eb1('0x6'));var config=require(_0x2eb1('0x7'));var controller=require(_0x2eb1('0x8'));router[_0x2eb1('0x9')]('/',auth[_0x2eb1('0xa')](),controller[_0x2eb1('0xb')]);router[_0x2eb1('0x9')](_0x2eb1('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2eb1('0xa')](),controller[_0x2eb1('0xd')]);router[_0x2eb1('0xe')](_0x2eb1('0xc'),auth['isAuthenticated'](),controller[_0x2eb1('0xf')]);router['delete'](_0x2eb1('0xc'),auth[_0x2eb1('0xa')](),controller[_0x2eb1('0x10')]);module[_0x2eb1('0x11')]=router; \ No newline at end of file +var _0xeece=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create','put'];(function(_0xa9518,_0x3ab179){var _0x230fff=function(_0x5a3131){while(--_0x5a3131){_0xa9518['push'](_0xa9518['shift']());}};_0x230fff(++_0x3ab179);}(_0xeece,0x178));var _0xeeec=function(_0x92fb1a,_0x359dcf){_0x92fb1a=_0x92fb1a-0x0;var _0x4d1675=_0xeece[_0x92fb1a];return _0x4d1675;};'use strict';var multer=require(_0xeeec('0x0'));var util=require(_0xeeec('0x1'));var path=require(_0xeeec('0x2'));var timeout=require(_0xeeec('0x3'));var express=require(_0xeeec('0x4'));var router=express[_0xeeec('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeeec('0x6'));var config=require(_0xeeec('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xeeec('0x8')](),controller['index']);router[_0xeeec('0x9')](_0xeeec('0xa'),auth[_0xeeec('0x8')](),controller[_0xeeec('0xb')]);router[_0xeeec('0xc')]('/',auth[_0xeeec('0x8')](),controller[_0xeeec('0xd')]);router[_0xeeec('0xe')](_0xeeec('0xa'),auth[_0xeeec('0x8')](),controller['update']);router[_0xeeec('0xf')](_0xeeec('0xa'),auth[_0xeeec('0x8')](),controller['destroy']);module[_0xeeec('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 60fcb46..3ebd24f 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 _0xc423=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x94b9d4,_0x1d58d8){var _0x4dfe17=function(_0x3f9aa4){while(--_0x3f9aa4){_0x94b9d4['push'](_0x94b9d4['shift']());}};_0x4dfe17(++_0x1d58d8);}(_0xc423,0x159));var _0x3c42=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc423[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x3c42('0x0'));module[_0x3c42('0x1')]={'calldate':{'type':Sequelize[_0x3c42('0x2')],'allowNull':![],'defaultValue':_0x3c42('0x3')},'clid':{'type':Sequelize[_0x3c42('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x3c42('0x4')]},'dcontext':{'type':Sequelize[_0x3c42('0x4')]},'channel':{'type':Sequelize[_0x3c42('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x3c42('0x4')]},'lastdata':{'type':Sequelize[_0x3c42('0x4')]},'duration':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3c42('0x4')]},'amaflags':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3c42('0x4')]},'userfield':{'type':Sequelize[_0x3c42('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3c42('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3c42('0x4')]},'tag':{'type':Sequelize[_0x3c42('0x4')]}}; \ No newline at end of file +var _0x7daf=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0x7daf,0xaa));var _0xf7da=function(_0x40e0eb,_0x51f9a5){_0x40e0eb=_0x40e0eb-0x0;var _0x3b11ee=_0x7daf[_0x40e0eb];return _0x3b11ee;};'use strict';var Sequelize=require('sequelize');module[_0xf7da('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xf7da('0x1')},'clid':{'type':Sequelize[_0xf7da('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xf7da('0x2')]},'dcontext':{'type':Sequelize[_0xf7da('0x2')]},'channel':{'type':Sequelize[_0xf7da('0x2')]},'dstchannel':{'type':Sequelize[_0xf7da('0x2')]},'lastapp':{'type':Sequelize[_0xf7da('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xf7da('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf7da('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf7da('0x2')]},'amaflags':{'type':Sequelize[_0xf7da('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf7da('0x2')]},'userfield':{'type':Sequelize[_0xf7da('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xf7da('0x2')]},'sequence':{'type':Sequelize[_0xf7da('0x2')]},'peeraccount':{'type':Sequelize[_0xf7da('0x2')]},'type':{'type':Sequelize[_0xf7da('0x2')]},'tag':{'type':Sequelize[_0xf7da('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 47e724a..f5335e8 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 _0xae30=['offset','apply','reject','end','sendStatus','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','findAll','then','rows','catch','show','params','includeAll','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','json','undefined','limit','count'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xae30,0x10a));var _0x0ae3=function(_0x239786,_0x471f27){_0x239786=_0x239786-0x0;var _0x3f15e2=_0xae30[_0x239786];return _0x3f15e2;};'use strict';var emlformat=require(_0x0ae3('0x0'));var rimraf=require(_0x0ae3('0x1'));var zipdir=require(_0x0ae3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae3('0x3'));var moment=require(_0x0ae3('0x4'));var BPromise=require(_0x0ae3('0x5'));var Mustache=require(_0x0ae3('0x6'));var util=require('util');var path=require(_0x0ae3('0x7'));var sox=require(_0x0ae3('0x8'));var csv=require(_0x0ae3('0x9'));var ejs=require(_0x0ae3('0xa'));var fs=require('fs');var fs_extra=require(_0x0ae3('0xb'));var _=require(_0x0ae3('0xc'));var squel=require(_0x0ae3('0xd'));var crypto=require(_0x0ae3('0xe'));var jsforce=require(_0x0ae3('0xf'));var deskjs=require(_0x0ae3('0x10'));var toCsv=require(_0x0ae3('0x9'));var querystring=require(_0x0ae3('0x11'));var Papa=require(_0x0ae3('0x12'));var Redis=require('ioredis');var authService=require(_0x0ae3('0x13'));var qs=require(_0x0ae3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ae3('0x15'))(_0x0ae3('0x16'));var utils=require(_0x0ae3('0x17'));var config=require(_0x0ae3('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245ac0,_0x45242d){_0x45242d=_0x45242d||0xcc;return function(_0x50cee6){if(_0x50cee6){return _0x245ac0['sendStatus'](_0x45242d);}return _0x245ac0[_0x0ae3('0x19')](_0x45242d)['end']();};}function respondWithResult(_0x1b1e46,_0x450000){_0x450000=_0x450000||0xc8;return function(_0x1a6c69){if(_0x1a6c69){return _0x1b1e46[_0x0ae3('0x19')](_0x450000)[_0x0ae3('0x1a')](_0x1a6c69);}};}function respondWithFilteredResult(_0x1600bc,_0x28b547){return function(_0x5af348){if(_0x5af348){var _0x17f280=typeof _0x28b547['offset']===_0x0ae3('0x1b')&&typeof _0x28b547[_0x0ae3('0x1c')]===_0x0ae3('0x1b');var _0x59d0de=_0x5af348[_0x0ae3('0x1d')];var _0x40edc6=_0x17f280?0x0:_0x28b547[_0x0ae3('0x1e')];var _0x1bf406=_0x17f280?_0x5af348[_0x0ae3('0x1d')]:_0x28b547['offset']+_0x28b547[_0x0ae3('0x1c')];var _0x4b8949;if(_0x1bf406>=_0x59d0de){_0x1bf406=_0x59d0de;_0x4b8949=0xc8;}else{_0x4b8949=0xce;}_0x1600bc['status'](_0x4b8949);return _0x1600bc['set']('Content-Range',_0x40edc6+'-'+_0x1bf406+'/'+_0x59d0de)['json'](_0x5af348);}return null;};}function patchUpdates(_0x4e8135){return function(_0x4d1385){try{jsonpatch[_0x0ae3('0x1f')](_0x4d1385,_0x4e8135,!![]);}catch(_0x1fd946){return BPromise[_0x0ae3('0x20')](_0x1fd946);}return _0x4d1385['save']();};}function saveUpdates(_0x1cdd85,_0x5ecc45){return function(_0xfcf4a8){if(_0xfcf4a8){return _0xfcf4a8['update'](_0x1cdd85)['then'](function(_0x5ab18d){return _0x5ab18d;});}return null;};}function removeEntity(_0x281adf,_0x3b49a0){return function(_0x51e7d1){if(_0x51e7d1){return _0x51e7d1['destroy']()['then'](function(){_0x281adf[_0x0ae3('0x19')](0xcc)[_0x0ae3('0x21')]();});}};}function handleEntityNotFound(_0x5a76e5,_0x36ce4e){return function(_0x1613c3){if(!_0x1613c3){_0x5a76e5[_0x0ae3('0x22')](0x194);}return _0x1613c3;};}function handleError(_0x5b0117,_0x2f8134){_0x2f8134=_0x2f8134||0x1f4;return function(_0x1f9cde){logger[_0x0ae3('0x23')](_0x1f9cde['stack']);if(_0x1f9cde[_0x0ae3('0x24')]){delete _0x1f9cde[_0x0ae3('0x24')];}_0x5b0117[_0x0ae3('0x19')](_0x2f8134)['send'](_0x1f9cde);};}exports[_0x0ae3('0x25')]=function(_0x247623,_0xf0e310){var _0x152876={},_0x1f8f61={},_0x10a7bd={'count':0x0,'rows':[]};var _0x5e8979=_[_0x0ae3('0x26')](db[_0x0ae3('0x27')][_0x0ae3('0x28')],function(_0x4032f4){return{'name':_0x4032f4[_0x0ae3('0x29')],'type':_0x4032f4[_0x0ae3('0x2a')][_0x0ae3('0x2b')]};});_0x1f8f61[_0x0ae3('0x2c')]=_['map'](_0x5e8979,_0x0ae3('0x24'));_0x1f8f61[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x247623[_0x0ae3('0x2d')]);_0x1f8f61['filters']=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],_0x1f8f61[_0x0ae3('0x2d')]);_0x152876[_0x0ae3('0x30')]=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],qs['fields'](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x31')]));_0x152876[_0x0ae3('0x30')]=_0x152876[_0x0ae3('0x30')][_0x0ae3('0x32')]?_0x152876[_0x0ae3('0x30')]:_0x1f8f61[_0x0ae3('0x2c')];if(!_0x247623['query']['hasOwnProperty'](_0x0ae3('0x33'))){_0x152876[_0x0ae3('0x1c')]=qs[_0x0ae3('0x1c')](_0x247623['query']['limit']);_0x152876[_0x0ae3('0x1e')]=qs[_0x0ae3('0x1e')](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x1e')]);}_0x152876[_0x0ae3('0x34')]=qs[_0x0ae3('0x35')](_0x247623[_0x0ae3('0x2d')]['sort']);_0x152876[_0x0ae3('0x36')]=qs[_0x0ae3('0x37')](_[_0x0ae3('0x38')](_0x247623['query'],_0x1f8f61['filters']),_0x5e8979);if(_0x247623['query'][_0x0ae3('0x39')]){_0x152876[_0x0ae3('0x36')]=_['merge'](_0x152876[_0x0ae3('0x36')],{'$or':_[_0x0ae3('0x26')](_0x5e8979,function(_0x3ee862){if(_0x3ee862['type']!==_0x0ae3('0x3a')){var _0x5dd8d7={};_0x5dd8d7[_0x3ee862[_0x0ae3('0x24')]]={'$like':'%'+_0x247623[_0x0ae3('0x2d')]['filter']+'%'};return _0x5dd8d7;}})});}_0x152876=_[_0x0ae3('0x3b')]({},_0x152876,_0x247623[_0x0ae3('0x3c')]);var _0xfa6c7f={'where':_0x152876[_0x0ae3('0x36')]};return db[_0x0ae3('0x27')]['count'](_0xfa6c7f)['then'](function(_0x2e95e5){_0x10a7bd[_0x0ae3('0x1d')]=_0x2e95e5;if(_0x247623['query']['includeAll']){_0x152876['include']=[{'all':!![]}];}return db['Cdr'][_0x0ae3('0x3d')](_0x152876);})[_0x0ae3('0x3e')](function(_0x325153){_0x10a7bd[_0x0ae3('0x3f')]=_0x325153;return _0x10a7bd;})[_0x0ae3('0x3e')](respondWithFilteredResult(_0xf0e310,_0x152876))[_0x0ae3('0x40')](handleError(_0xf0e310,null));};exports[_0x0ae3('0x41')]=function(_0x3166af,_0x2cfc16){var _0x1230c9={'raw':!![],'where':{'id':_0x3166af[_0x0ae3('0x42')]['id']}},_0x5a0e74={};_0x5a0e74[_0x0ae3('0x2c')]=_['keys'](db[_0x0ae3('0x27')][_0x0ae3('0x28')]);_0x5a0e74[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x3166af[_0x0ae3('0x2d')]);_0x5a0e74['filters']=_[_0x0ae3('0x2f')](_0x5a0e74[_0x0ae3('0x2c')],_0x5a0e74[_0x0ae3('0x2d')]);_0x1230c9[_0x0ae3('0x30')]=_['intersection'](_0x5a0e74[_0x0ae3('0x2c')],qs[_0x0ae3('0x31')](_0x3166af['query'][_0x0ae3('0x31')]));_0x1230c9[_0x0ae3('0x30')]=_0x1230c9['attributes']['length']?_0x1230c9[_0x0ae3('0x30')]:_0x5a0e74[_0x0ae3('0x2c')];if(_0x3166af[_0x0ae3('0x2d')][_0x0ae3('0x43')]){_0x1230c9[_0x0ae3('0x44')]=[{'all':!![]}];}_0x1230c9=_['merge']({},_0x1230c9,_0x3166af['options']);return db[_0x0ae3('0x27')]['find'](_0x1230c9)[_0x0ae3('0x3e')](handleEntityNotFound(_0x2cfc16,null))[_0x0ae3('0x3e')](respondWithResult(_0x2cfc16,null))['catch'](handleError(_0x2cfc16,null));};exports[_0x0ae3('0x45')]=function(_0x3e4bfb,_0x53e018){return db[_0x0ae3('0x27')][_0x0ae3('0x45')](_0x3e4bfb[_0x0ae3('0x46')],{})[_0x0ae3('0x3e')](respondWithResult(_0x53e018,0xc9))[_0x0ae3('0x40')](handleError(_0x53e018,null));};exports['update']=function(_0x3ad6b3,_0x53393b){if(_0x3ad6b3[_0x0ae3('0x46')]['id']){delete _0x3ad6b3[_0x0ae3('0x46')]['id'];}return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x3ad6b3[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x53393b,null))[_0x0ae3('0x3e')](saveUpdates(_0x3ad6b3[_0x0ae3('0x46')],null))['then'](respondWithResult(_0x53393b,null))[_0x0ae3('0x40')](handleError(_0x53393b,null));};exports[_0x0ae3('0x48')]=function(_0x29479f,_0x12ea03){return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x29479f[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x12ea03,null))[_0x0ae3('0x3e')](removeEntity(_0x12ea03,null))[_0x0ae3('0x40')](handleError(_0x12ea03,null));};exports[_0x0ae3('0x49')]=function(_0x572166,_0x256dc5){return db['Cdr'][_0x0ae3('0x49')]()[_0x0ae3('0x3e')](respondWithResult(_0x256dc5,null))[_0x0ae3('0x40')](handleError(_0x256dc5,null));}; \ No newline at end of file +var _0x72b1=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x72b1,0x16e));var _0x172b=function(_0x536bff,_0x16668f){_0x536bff=_0x536bff-0x0;var _0x4f196a=_0x72b1[_0x536bff];return _0x4f196a;};'use strict';var emlformat=require(_0x172b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x172b('0x1'));var jsonpatch=require(_0x172b('0x2'));var rp=require(_0x172b('0x3'));var moment=require(_0x172b('0x4'));var BPromise=require(_0x172b('0x5'));var Mustache=require(_0x172b('0x6'));var util=require(_0x172b('0x7'));var path=require('path');var sox=require(_0x172b('0x8'));var csv=require(_0x172b('0x9'));var ejs=require(_0x172b('0xa'));var fs=require('fs');var fs_extra=require(_0x172b('0xb'));var _=require('lodash');var squel=require(_0x172b('0xc'));var crypto=require('crypto');var jsforce=require(_0x172b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x172b('0x9'));var querystring=require(_0x172b('0xe'));var Papa=require(_0x172b('0xf'));var Redis=require(_0x172b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x172b('0x11'));var as=require(_0x172b('0x12'));var hardwareService=require(_0x172b('0x13'));var logger=require(_0x172b('0x14'))(_0x172b('0x15'));var utils=require(_0x172b('0x16'));var config=require(_0x172b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x172b('0x18'))['db'];function respondWithStatusCode(_0x82727f,_0xdf832e){_0xdf832e=_0xdf832e||0xcc;return function(_0x4970f8){if(_0x4970f8){return _0x82727f[_0x172b('0x19')](_0xdf832e);}return _0x82727f['status'](_0xdf832e)[_0x172b('0x1a')]();};}function respondWithResult(_0x81e11e,_0x5239b9){_0x5239b9=_0x5239b9||0xc8;return function(_0x1b7247){if(_0x1b7247){return _0x81e11e[_0x172b('0x1b')](_0x5239b9)[_0x172b('0x1c')](_0x1b7247);}};}function respondWithFilteredResult(_0xa28463,_0x5b0ab1){return function(_0x5293ef){if(_0x5293ef){var _0x3625bb=typeof _0x5b0ab1[_0x172b('0x1d')]===_0x172b('0x1e')&&typeof _0x5b0ab1[_0x172b('0x1f')]==='undefined';var _0x4f369b=_0x5293ef[_0x172b('0x20')];var _0x3b2701=_0x3625bb?0x0:_0x5b0ab1[_0x172b('0x1d')];var _0xba7825=_0x3625bb?_0x5293ef[_0x172b('0x20')]:_0x5b0ab1['offset']+_0x5b0ab1[_0x172b('0x1f')];var _0x2d24f9;if(_0xba7825>=_0x4f369b){_0xba7825=_0x4f369b;_0x2d24f9=0xc8;}else{_0x2d24f9=0xce;}_0xa28463[_0x172b('0x1b')](_0x2d24f9);return _0xa28463[_0x172b('0x21')](_0x172b('0x22'),_0x3b2701+'-'+_0xba7825+'/'+_0x4f369b)[_0x172b('0x1c')](_0x5293ef);}return null;};}function patchUpdates(_0x296aa6){return function(_0x5c7e17){try{jsonpatch['apply'](_0x5c7e17,_0x296aa6,!![]);}catch(_0x562db9){return BPromise['reject'](_0x562db9);}return _0x5c7e17[_0x172b('0x23')]();};}function saveUpdates(_0x4c8090,_0x721d07){return function(_0x25ee62){if(_0x25ee62){return _0x25ee62[_0x172b('0x24')](_0x4c8090)[_0x172b('0x25')](function(_0x32419a){return _0x32419a;});}return null;};}function removeEntity(_0x24e4ff,_0x507b99){return function(_0x1cefd1){if(_0x1cefd1){return _0x1cefd1[_0x172b('0x26')]()['then'](function(){_0x24e4ff[_0x172b('0x1b')](0xcc)[_0x172b('0x1a')]();});}};}function handleEntityNotFound(_0x3df490,_0x29e1d4){return function(_0x356c83){if(!_0x356c83){_0x3df490[_0x172b('0x19')](0x194);}return _0x356c83;};}function handleError(_0x39bdc5,_0x5ee442){_0x5ee442=_0x5ee442||0x1f4;return function(_0x1deb7e){logger[_0x172b('0x27')](_0x1deb7e['stack']);if(_0x1deb7e[_0x172b('0x28')]){delete _0x1deb7e[_0x172b('0x28')];}_0x39bdc5[_0x172b('0x1b')](_0x5ee442)[_0x172b('0x29')](_0x1deb7e);};}exports[_0x172b('0x2a')]=function(_0x4bea8e,_0x9624f5){var _0x37acc5={},_0x596b4c={},_0x5db251={'count':0x0,'rows':[]};var _0x43728b=_[_0x172b('0x2b')](db[_0x172b('0x2c')][_0x172b('0x2d')],function(_0x367f80){return{'name':_0x367f80[_0x172b('0x2e')],'type':_0x367f80[_0x172b('0x2f')][_0x172b('0x30')]};});_0x596b4c[_0x172b('0x31')]=_[_0x172b('0x2b')](_0x43728b,_0x172b('0x28'));_0x596b4c[_0x172b('0x32')]=_[_0x172b('0x33')](_0x4bea8e[_0x172b('0x32')]);_0x596b4c[_0x172b('0x34')]=_[_0x172b('0x35')](_0x596b4c[_0x172b('0x31')],_0x596b4c[_0x172b('0x32')]);_0x37acc5[_0x172b('0x36')]=_[_0x172b('0x35')](_0x596b4c[_0x172b('0x31')],qs[_0x172b('0x37')](_0x4bea8e[_0x172b('0x32')][_0x172b('0x37')]));_0x37acc5[_0x172b('0x36')]=_0x37acc5['attributes'][_0x172b('0x38')]?_0x37acc5[_0x172b('0x36')]:_0x596b4c[_0x172b('0x31')];if(!_0x4bea8e['query'][_0x172b('0x39')]('nolimit')){_0x37acc5['limit']=qs['limit'](_0x4bea8e[_0x172b('0x32')]['limit']);_0x37acc5['offset']=qs[_0x172b('0x1d')](_0x4bea8e[_0x172b('0x32')][_0x172b('0x1d')]);}_0x37acc5['order']=qs[_0x172b('0x3a')](_0x4bea8e[_0x172b('0x32')][_0x172b('0x3a')]);_0x37acc5[_0x172b('0x3b')]=qs[_0x172b('0x34')](_[_0x172b('0x3c')](_0x4bea8e[_0x172b('0x32')],_0x596b4c[_0x172b('0x34')]),_0x43728b);if(_0x4bea8e[_0x172b('0x32')][_0x172b('0x3d')]){_0x37acc5[_0x172b('0x3b')]=_[_0x172b('0x3e')](_0x37acc5[_0x172b('0x3b')],{'$or':_[_0x172b('0x2b')](_0x43728b,function(_0x51ac71){if(_0x51ac71[_0x172b('0x2f')]!==_0x172b('0x3f')){var _0x2beb2a={};_0x2beb2a[_0x51ac71[_0x172b('0x28')]]={'$like':'%'+_0x4bea8e['query']['filter']+'%'};return _0x2beb2a;}})});}_0x37acc5=_[_0x172b('0x3e')]({},_0x37acc5,_0x4bea8e['options']);var _0x5e8ff6={'where':_0x37acc5['where']};return db[_0x172b('0x2c')][_0x172b('0x20')](_0x5e8ff6)[_0x172b('0x25')](function(_0x54e62d){_0x5db251[_0x172b('0x20')]=_0x54e62d;if(_0x4bea8e[_0x172b('0x32')][_0x172b('0x40')]){_0x37acc5['include']=[{'all':!![]}];}return db[_0x172b('0x2c')]['findAll'](_0x37acc5);})[_0x172b('0x25')](function(_0x4a05da){_0x5db251[_0x172b('0x41')]=_0x4a05da;return _0x5db251;})[_0x172b('0x25')](respondWithFilteredResult(_0x9624f5,_0x37acc5))[_0x172b('0x42')](handleError(_0x9624f5,null));};exports[_0x172b('0x43')]=function(_0x24fba9,_0x5c973c){var _0x177250={'raw':!![],'where':{'id':_0x24fba9[_0x172b('0x44')]['id']}},_0x5e036e={};_0x5e036e[_0x172b('0x31')]=_[_0x172b('0x33')](db[_0x172b('0x2c')]['rawAttributes']);_0x5e036e['query']=_[_0x172b('0x33')](_0x24fba9['query']);_0x5e036e['filters']=_['intersection'](_0x5e036e[_0x172b('0x31')],_0x5e036e[_0x172b('0x32')]);_0x177250[_0x172b('0x36')]=_[_0x172b('0x35')](_0x5e036e['model'],qs[_0x172b('0x37')](_0x24fba9[_0x172b('0x32')][_0x172b('0x37')]));_0x177250[_0x172b('0x36')]=_0x177250[_0x172b('0x36')][_0x172b('0x38')]?_0x177250[_0x172b('0x36')]:_0x5e036e[_0x172b('0x31')];if(_0x24fba9[_0x172b('0x32')][_0x172b('0x40')]){_0x177250[_0x172b('0x45')]=[{'all':!![]}];}_0x177250=_[_0x172b('0x3e')]({},_0x177250,_0x24fba9['options']);return db[_0x172b('0x2c')][_0x172b('0x46')](_0x177250)['then'](handleEntityNotFound(_0x5c973c,null))['then'](respondWithResult(_0x5c973c,null))[_0x172b('0x42')](handleError(_0x5c973c,null));};exports[_0x172b('0x47')]=function(_0x1a14b2,_0x571504){return db[_0x172b('0x2c')]['create'](_0x1a14b2['body'],{})[_0x172b('0x25')](respondWithResult(_0x571504,0xc9))[_0x172b('0x42')](handleError(_0x571504,null));};exports[_0x172b('0x24')]=function(_0x3941d4,_0x24ab0c){if(_0x3941d4[_0x172b('0x48')]['id']){delete _0x3941d4[_0x172b('0x48')]['id'];}return db[_0x172b('0x2c')][_0x172b('0x46')]({'where':{'id':_0x3941d4[_0x172b('0x44')]['id']}})['then'](handleEntityNotFound(_0x24ab0c,null))['then'](saveUpdates(_0x3941d4[_0x172b('0x48')],null))[_0x172b('0x25')](respondWithResult(_0x24ab0c,null))['catch'](handleError(_0x24ab0c,null));};exports['destroy']=function(_0x3db238,_0x41ea2c){return db[_0x172b('0x2c')][_0x172b('0x46')]({'where':{'id':_0x3db238[_0x172b('0x44')]['id']}})[_0x172b('0x25')](handleEntityNotFound(_0x41ea2c,null))['then'](removeEntity(_0x41ea2c,null))[_0x172b('0x42')](handleError(_0x41ea2c,null));};exports['describe']=function(_0x5f22eb,_0x221cd7){return db[_0x172b('0x2c')][_0x172b('0x49')]()['then'](respondWithResult(_0x221cd7,null))[_0x172b('0x42')](handleError(_0x221cd7,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 283d202..af886f5 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(_0x3b59c4,_0x3e1816){var _0x497ad2=function(_0x3288f8){while(--_0x3288f8){_0x3b59c4['push'](_0x3b59c4['shift']());}};_0x497ad2(++_0x3e1816);}(_0x7a54,0x106));var _0x47a5=function(_0x323229,_0xff09){_0x323229=_0x323229-0x0;var _0x488de3=_0x7a54[_0x323229];return _0x488de3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2ffd4a,_0x4ce2b3){var _0x58146e=function(_0x50191f){while(--_0x50191f){_0x2ffd4a['push'](_0x2ffd4a['shift']());}};_0x58146e(++_0x4ce2b3);}(_0x7a54,0x106));var _0x47a5=function(_0x36865c,_0x1ed4a5){_0x36865c=_0x36865c-0x0;var _0x4940f5=_0x7a54[_0x36865c];return _0x4940f5;};'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 diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 512889d..cfbbd4f 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 _0x77b7=['stringify','error','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x77b7,0x180));var _0x777b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x77b7[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x777b('0x0'));var util=require(_0x777b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x777b('0x2'));var fs=require('fs');var Redis=require(_0x777b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x777b('0x4'));var logger=require(_0x777b('0x5'))(_0x777b('0x6'));var config=require('../../config/environment');var jayson=require(_0x777b('0x7'));var client=jayson[_0x777b('0x8')][_0x777b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe2ff9c,_0x549de1,_0x649df0){return new BPromise(function(_0x5595ff,_0x2f4c0f){return client[_0x777b('0xa')](_0xe2ff9c,_0x649df0)[_0x777b('0xb')](function(_0x5f3567){logger[_0x777b('0xc')](_0x777b('0xd'),_0x549de1,'request\x20sent');logger['debug'](_0x777b('0xe'),_0x549de1,'request\x20sent',JSON[_0x777b('0xf')](_0x5f3567));if(_0x5f3567[_0x777b('0x10')]){if(_0x5f3567['error']['code']===0x1f4){logger[_0x777b('0x10')](_0x777b('0xd'),_0x549de1,_0x5f3567[_0x777b('0x10')]['message']);return _0x2f4c0f(_0x5f3567[_0x777b('0x10')][_0x777b('0x11')]);}logger[_0x777b('0x10')]('Cdr,\x20%s,\x20%s',_0x549de1,_0x5f3567[_0x777b('0x10')][_0x777b('0x11')]);return _0x5595ff(_0x5f3567[_0x777b('0x10')][_0x777b('0x11')]);}else{logger[_0x777b('0xc')](_0x777b('0xd'),_0x549de1,_0x777b('0x12'));_0x5595ff(_0x5f3567[_0x777b('0x13')][_0x777b('0x11')]);}})[_0x777b('0x14')](function(_0x3e4a02){logger[_0x777b('0x10')](_0x777b('0xd'),_0x549de1,_0x3e4a02);_0x2f4c0f(_0x3e4a02);});});} \ No newline at end of file +var _0xce8f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1aca78,_0x21c237){var _0x2712e7=function(_0x2f1a5f){while(--_0x2f1a5f){_0x1aca78['push'](_0x1aca78['shift']());}};_0x2712e7(++_0x21c237);}(_0xce8f,0x16b));var _0xfce8=function(_0x528db,_0x31f893){_0x528db=_0x528db-0x0;var _0x5365aa=_0xce8f[_0x528db];return _0x5365aa;};'use strict';var _=require('lodash');var util=require(_0xfce8('0x0'));var moment=require(_0xfce8('0x1'));var BPromise=require(_0xfce8('0x2'));var rs=require(_0xfce8('0x3'));var fs=require('fs');var Redis=require(_0xfce8('0x4'));var db=require(_0xfce8('0x5'))['db'];var utils=require(_0xfce8('0x6'));var logger=require(_0xfce8('0x7'))('rpc');var config=require(_0xfce8('0x8'));var jayson=require(_0xfce8('0x9'));var client=jayson['client'][_0xfce8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x88c1be,_0x326962,_0x47c7c9){return new BPromise(function(_0x74c2ac,_0x588e49){return client[_0xfce8('0xb')](_0x88c1be,_0x47c7c9)[_0xfce8('0xc')](function(_0x1eb534){logger[_0xfce8('0xd')](_0xfce8('0xe'),_0x326962,'request\x20sent');logger[_0xfce8('0xf')](_0xfce8('0x10'),_0x326962,'request\x20sent',JSON['stringify'](_0x1eb534));if(_0x1eb534[_0xfce8('0x11')]){if(_0x1eb534[_0xfce8('0x11')][_0xfce8('0x12')]===0x1f4){logger['error'](_0xfce8('0xe'),_0x326962,_0x1eb534[_0xfce8('0x11')][_0xfce8('0x13')]);return _0x588e49(_0x1eb534['error'][_0xfce8('0x13')]);}logger[_0xfce8('0x11')](_0xfce8('0xe'),_0x326962,_0x1eb534[_0xfce8('0x11')]['message']);return _0x74c2ac(_0x1eb534[_0xfce8('0x11')][_0xfce8('0x13')]);}else{logger[_0xfce8('0xd')](_0xfce8('0xe'),_0x326962,_0xfce8('0x14'));_0x74c2ac(_0x1eb534[_0xfce8('0x15')]['message']);}})[_0xfce8('0x16')](function(_0x44295e){logger[_0xfce8('0x11')](_0xfce8('0xe'),_0x326962,_0x44295e);_0x588e49(_0x44295e);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 67cde74..5d44847 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _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(_0xb14376,_0x5b0bf2){var _0x232f52=function(_0x29342e){while(--_0x29342e){_0xb14376['push'](_0xb14376['shift']());}};_0x232f52(++_0x5b0bf2);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index fde4ae1..0b217af 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 _0x251e=['sequelize','exports','INTEGER','noop','*,*,*,*'];(function(_0x1c86cf,_0xd758df){var _0x22c104=function(_0x330796){while(--_0x330796){_0x1c86cf['push'](_0x1c86cf['shift']());}};_0x22c104(++_0xd758df);}(_0x251e,0x195));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe251('0x0'));module[_0xe251('0x1')]={'priority':{'type':Sequelize[_0xe251('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe251('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe251('0x4')}}; \ No newline at end of file +var _0x0a88=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x149df7,_0x57d5cb){var _0x309d90=function(_0x46d633){while(--_0x46d633){_0x149df7['push'](_0x149df7['shift']());}};_0x309d90(++_0x57d5cb);}(_0x0a88,0xd2));var _0x80a8=function(_0x3074f3,_0x4f2c03){_0x3074f3=_0x3074f3-0x0;var _0x53f112=_0x0a88[_0x3074f3];return _0x53f112;};'use strict';var Sequelize=require('sequelize');module[_0x80a8('0x0')]={'priority':{'type':Sequelize[_0x80a8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x80a8('0x2')],'allowNull':![],'defaultValue':_0x80a8('0x3')},'appdata':{'type':Sequelize[_0x80a8('0x4')]()},'description':{'type':Sequelize[_0x80a8('0x2')]},'interval':{'type':Sequelize[_0x80a8('0x2')],'defaultValue':_0x80a8('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index fb2489a..39fe90e 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 _0xc041=['../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','show','params','model','query','filters','intersection','attributes','length','includeAll','include','merge','ChatApplication','find','body','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc041,0x1ea));var _0x1c04=function(_0xaf33a2,_0x3038e1){_0xaf33a2=_0xaf33a2-0x0;var _0x37d5a3=_0xc041[_0xaf33a2];return _0x37d5a3;};'use strict';var emlformat=require(_0x1c04('0x0'));var rimraf=require(_0x1c04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c04('0x2'));var rp=require('request-promise');var moment=require(_0x1c04('0x3'));var BPromise=require(_0x1c04('0x4'));var Mustache=require(_0x1c04('0x5'));var util=require(_0x1c04('0x6'));var path=require(_0x1c04('0x7'));var sox=require(_0x1c04('0x8'));var csv=require('to-csv');var ejs=require(_0x1c04('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1c04('0xa'));var crypto=require(_0x1c04('0xb'));var jsforce=require(_0x1c04('0xc'));var deskjs=require(_0x1c04('0xd'));var toCsv=require(_0x1c04('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1c04('0xf'));var authService=require(_0x1c04('0x10'));var qs=require(_0x1c04('0x11'));var as=require(_0x1c04('0x12'));var hardwareService=require(_0x1c04('0x13'));var logger=require(_0x1c04('0x14'))(_0x1c04('0x15'));var utils=require(_0x1c04('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1c04('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x178900,_0x167bd5){_0x167bd5=_0x167bd5||0xcc;return function(_0x48e69f){if(_0x48e69f){return _0x178900[_0x1c04('0x18')](_0x167bd5);}return _0x178900[_0x1c04('0x19')](_0x167bd5)[_0x1c04('0x1a')]();};}function respondWithResult(_0x199782,_0x3c7bb3){_0x3c7bb3=_0x3c7bb3||0xc8;return function(_0x30b019){if(_0x30b019){return _0x199782[_0x1c04('0x19')](_0x3c7bb3)['json'](_0x30b019);}};}function respondWithFilteredResult(_0x28d516,_0x2dbf09){return function(_0x408e4c){if(_0x408e4c){var _0x5a0ff4=typeof _0x2dbf09[_0x1c04('0x1b')]==='undefined'&&typeof _0x2dbf09[_0x1c04('0x1c')]===_0x1c04('0x1d');var _0x2ed73c=_0x408e4c[_0x1c04('0x1e')];var _0x2b3a8b=_0x5a0ff4?0x0:_0x2dbf09[_0x1c04('0x1b')];var _0x3e2bd9=_0x5a0ff4?_0x408e4c[_0x1c04('0x1e')]:_0x2dbf09['offset']+_0x2dbf09['limit'];var _0x51dad0;if(_0x3e2bd9>=_0x2ed73c){_0x3e2bd9=_0x2ed73c;_0x51dad0=0xc8;}else{_0x51dad0=0xce;}_0x28d516[_0x1c04('0x19')](_0x51dad0);return _0x28d516[_0x1c04('0x1f')](_0x1c04('0x20'),_0x2b3a8b+'-'+_0x3e2bd9+'/'+_0x2ed73c)[_0x1c04('0x21')](_0x408e4c);}return null;};}function patchUpdates(_0x1724a4){return function(_0x21c320){try{jsonpatch[_0x1c04('0x22')](_0x21c320,_0x1724a4,!![]);}catch(_0xf9255d){return BPromise[_0x1c04('0x23')](_0xf9255d);}return _0x21c320[_0x1c04('0x24')]();};}function saveUpdates(_0x290375,_0x460dd1){return function(_0x22a4cc){if(_0x22a4cc){return _0x22a4cc[_0x1c04('0x25')](_0x290375)['then'](function(_0x2ee6b2){return _0x2ee6b2;});}return null;};}function removeEntity(_0x5bb5bc,_0x247116){return function(_0x3c81b0){if(_0x3c81b0){return _0x3c81b0[_0x1c04('0x26')]()[_0x1c04('0x27')](function(){_0x5bb5bc[_0x1c04('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5101e2,_0x29293c){return function(_0x2c9f84){if(!_0x2c9f84){_0x5101e2[_0x1c04('0x18')](0x194);}return _0x2c9f84;};}function handleError(_0x43c4a8,_0x252fbe){_0x252fbe=_0x252fbe||0x1f4;return function(_0x1e2daa){logger[_0x1c04('0x28')](_0x1e2daa[_0x1c04('0x29')]);if(_0x1e2daa['name']){delete _0x1e2daa['name'];}_0x43c4a8[_0x1c04('0x19')](_0x252fbe)['send'](_0x1e2daa);};}exports[_0x1c04('0x2a')]=function(_0x228e4,_0x29d273){var _0x220cdc={'raw':!![],'where':{'id':_0x228e4[_0x1c04('0x2b')]['id']}},_0x3bf4fd={};_0x3bf4fd[_0x1c04('0x2c')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x3bf4fd[_0x1c04('0x2d')]=_['keys'](_0x228e4[_0x1c04('0x2d')]);_0x3bf4fd[_0x1c04('0x2e')]=_[_0x1c04('0x2f')](_0x3bf4fd[_0x1c04('0x2c')],_0x3bf4fd[_0x1c04('0x2d')]);_0x220cdc[_0x1c04('0x30')]=_[_0x1c04('0x2f')](_0x3bf4fd[_0x1c04('0x2c')],qs['fields'](_0x228e4[_0x1c04('0x2d')]['fields']));_0x220cdc['attributes']=_0x220cdc['attributes'][_0x1c04('0x31')]?_0x220cdc[_0x1c04('0x30')]:_0x3bf4fd[_0x1c04('0x2c')];if(_0x228e4[_0x1c04('0x2d')][_0x1c04('0x32')]){_0x220cdc[_0x1c04('0x33')]=[{'all':!![]}];}_0x220cdc=_[_0x1c04('0x34')]({},_0x220cdc,_0x228e4['options']);return db[_0x1c04('0x35')][_0x1c04('0x36')](_0x220cdc)[_0x1c04('0x27')](handleEntityNotFound(_0x29d273,null))[_0x1c04('0x27')](respondWithResult(_0x29d273,null))['catch'](handleError(_0x29d273,null));};exports['update']=function(_0x1e5586,_0x236b7f){if(_0x1e5586[_0x1c04('0x37')]['id']){delete _0x1e5586[_0x1c04('0x37')]['id'];}return db[_0x1c04('0x35')]['find']({'where':{'id':_0x1e5586[_0x1c04('0x2b')]['id']}})[_0x1c04('0x27')](handleEntityNotFound(_0x236b7f,null))['then'](saveUpdates(_0x1e5586[_0x1c04('0x37')],null))[_0x1c04('0x27')](respondWithResult(_0x236b7f,null))[_0x1c04('0x38')](handleError(_0x236b7f,null));};exports[_0x1c04('0x26')]=function(_0x587b09,_0x220c64){return db['ChatApplication'][_0x1c04('0x36')]({'where':{'id':_0x587b09[_0x1c04('0x2b')]['id']}})[_0x1c04('0x27')](handleEntityNotFound(_0x220c64,null))[_0x1c04('0x27')](removeEntity(_0x220c64,null))[_0x1c04('0x38')](handleError(_0x220c64,null));}; \ No newline at end of file +var _0x2948=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','reject','update','then','destroy','stack','name','model','keys','ChatApplication','query','intersection','attributes','fields','length','includeAll','include','merge','find','body','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4b5be2,_0x3e22a3){var _0x25c2a8=function(_0x6b4d1e){while(--_0x6b4d1e){_0x4b5be2['push'](_0x4b5be2['shift']());}};_0x25c2a8(++_0x3e22a3);}(_0x2948,0xcb));var _0x8294=function(_0x55f316,_0x39b21a){_0x55f316=_0x55f316-0x0;var _0x231040=_0x2948[_0x55f316];return _0x231040;};'use strict';var emlformat=require(_0x8294('0x0'));var rimraf=require(_0x8294('0x1'));var zipdir=require(_0x8294('0x2'));var jsonpatch=require(_0x8294('0x3'));var rp=require(_0x8294('0x4'));var moment=require(_0x8294('0x5'));var BPromise=require(_0x8294('0x6'));var Mustache=require(_0x8294('0x7'));var util=require(_0x8294('0x8'));var path=require('path');var sox=require(_0x8294('0x9'));var csv=require('to-csv');var ejs=require(_0x8294('0xa'));var fs=require('fs');var fs_extra=require(_0x8294('0xb'));var _=require(_0x8294('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8294('0xd'));var querystring=require(_0x8294('0xe'));var Papa=require('papaparse');var Redis=require(_0x8294('0xf'));var authService=require(_0x8294('0x10'));var qs=require(_0x8294('0x11'));var as=require(_0x8294('0x12'));var hardwareService=require(_0x8294('0x13'));var logger=require(_0x8294('0x14'))('api');var utils=require(_0x8294('0x15'));var config=require(_0x8294('0x16'));var licenseUtil=require(_0x8294('0x17'));var db=require(_0x8294('0x18'))['db'];function respondWithStatusCode(_0x3a13f4,_0x29f1c6){_0x29f1c6=_0x29f1c6||0xcc;return function(_0x71e347){if(_0x71e347){return _0x3a13f4[_0x8294('0x19')](_0x29f1c6);}return _0x3a13f4['status'](_0x29f1c6)[_0x8294('0x1a')]();};}function respondWithResult(_0xde307c,_0x3041ce){_0x3041ce=_0x3041ce||0xc8;return function(_0x552a87){if(_0x552a87){return _0xde307c['status'](_0x3041ce)['json'](_0x552a87);}};}function respondWithFilteredResult(_0x19295d,_0x1bccf6){return function(_0x25c9ae){if(_0x25c9ae){var _0x2ca14b=typeof _0x1bccf6[_0x8294('0x1b')]===_0x8294('0x1c')&&typeof _0x1bccf6[_0x8294('0x1d')]===_0x8294('0x1c');var _0xf93bde=_0x25c9ae[_0x8294('0x1e')];var _0x3d194a=_0x2ca14b?0x0:_0x1bccf6['offset'];var _0x40175a=_0x2ca14b?_0x25c9ae['count']:_0x1bccf6[_0x8294('0x1b')]+_0x1bccf6[_0x8294('0x1d')];var _0x256be3;if(_0x40175a>=_0xf93bde){_0x40175a=_0xf93bde;_0x256be3=0xc8;}else{_0x256be3=0xce;}_0x19295d[_0x8294('0x1f')](_0x256be3);return _0x19295d[_0x8294('0x20')](_0x8294('0x21'),_0x3d194a+'-'+_0x40175a+'/'+_0xf93bde)[_0x8294('0x22')](_0x25c9ae);}return null;};}function patchUpdates(_0x27273d){return function(_0x318fd3){try{jsonpatch['apply'](_0x318fd3,_0x27273d,!![]);}catch(_0x24ea70){return BPromise[_0x8294('0x23')](_0x24ea70);}return _0x318fd3['save']();};}function saveUpdates(_0x1e5d1e,_0x140666){return function(_0xc0eed4){if(_0xc0eed4){return _0xc0eed4[_0x8294('0x24')](_0x1e5d1e)[_0x8294('0x25')](function(_0x3a36af){return _0x3a36af;});}return null;};}function removeEntity(_0x2b6935,_0xff5d69){return function(_0x3aa9f6){if(_0x3aa9f6){return _0x3aa9f6[_0x8294('0x26')]()[_0x8294('0x25')](function(){_0x2b6935['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d2b6a,_0x557529){return function(_0x83f0c4){if(!_0x83f0c4){_0x2d2b6a['sendStatus'](0x194);}return _0x83f0c4;};}function handleError(_0x591b94,_0x37601e){_0x37601e=_0x37601e||0x1f4;return function(_0x399c9d){logger['error'](_0x399c9d[_0x8294('0x27')]);if(_0x399c9d[_0x8294('0x28')]){delete _0x399c9d[_0x8294('0x28')];}_0x591b94[_0x8294('0x1f')](_0x37601e)['send'](_0x399c9d);};}exports['show']=function(_0x311e6b,_0x2d6312){var _0x3ae908={'raw':!![],'where':{'id':_0x311e6b['params']['id']}},_0x4fa43c={};_0x4fa43c[_0x8294('0x29')]=_[_0x8294('0x2a')](db[_0x8294('0x2b')]['rawAttributes']);_0x4fa43c['query']=_[_0x8294('0x2a')](_0x311e6b[_0x8294('0x2c')]);_0x4fa43c['filters']=_[_0x8294('0x2d')](_0x4fa43c[_0x8294('0x29')],_0x4fa43c['query']);_0x3ae908[_0x8294('0x2e')]=_['intersection'](_0x4fa43c[_0x8294('0x29')],qs['fields'](_0x311e6b[_0x8294('0x2c')][_0x8294('0x2f')]));_0x3ae908[_0x8294('0x2e')]=_0x3ae908[_0x8294('0x2e')][_0x8294('0x30')]?_0x3ae908[_0x8294('0x2e')]:_0x4fa43c[_0x8294('0x29')];if(_0x311e6b['query'][_0x8294('0x31')]){_0x3ae908[_0x8294('0x32')]=[{'all':!![]}];}_0x3ae908=_[_0x8294('0x33')]({},_0x3ae908,_0x311e6b['options']);return db[_0x8294('0x2b')][_0x8294('0x34')](_0x3ae908)[_0x8294('0x25')](handleEntityNotFound(_0x2d6312,null))['then'](respondWithResult(_0x2d6312,null))['catch'](handleError(_0x2d6312,null));};exports[_0x8294('0x24')]=function(_0x35a80d,_0x1f60f3){if(_0x35a80d[_0x8294('0x35')]['id']){delete _0x35a80d[_0x8294('0x35')]['id'];}return db[_0x8294('0x2b')][_0x8294('0x34')]({'where':{'id':_0x35a80d[_0x8294('0x36')]['id']}})[_0x8294('0x25')](handleEntityNotFound(_0x1f60f3,null))['then'](saveUpdates(_0x35a80d[_0x8294('0x35')],null))[_0x8294('0x25')](respondWithResult(_0x1f60f3,null))['catch'](handleError(_0x1f60f3,null));};exports[_0x8294('0x26')]=function(_0x8ad38c,_0x1f2b33){return db[_0x8294('0x2b')]['find']({'where':{'id':_0x8ad38c[_0x8294('0x36')]['id']}})[_0x8294('0x25')](handleEntityNotFound(_0x1f2b33,null))[_0x8294('0x25')](removeEntity(_0x1f2b33,null))[_0x8294('0x37')](handleError(_0x1f2b33,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 03e3f89..2afeb9d 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 _0x655d=['rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x655d,0x13b));var _0xd655=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x655d[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xd655('0x0'));var util=require(_0xd655('0x1'));var logger=require(_0xd655('0x2'))(_0xd655('0x3'));var moment=require(_0xd655('0x4'));var BPromise=require(_0xd655('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd655('0x6'));var rimraf=require(_0xd655('0x7'));var config=require('../../config/environment');var attributes=require(_0xd655('0x8'));module['exports']=function(_0x1a2ecb,_0x1c3f69){return _0x1a2ecb[_0xd655('0x9')](_0xd655('0xa'),attributes,{'tableName':_0xd655('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd655('0xc'),'collate':_0xd655('0xd')});}; \ No newline at end of file +var _0x6a39=['exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes'];(function(_0x397b40,_0x511296){var _0x36b866=function(_0x458149){while(--_0x458149){_0x397b40['push'](_0x397b40['shift']());}};_0x36b866(++_0x511296);}(_0x6a39,0x140));var _0x96a3=function(_0x188cc8,_0xd39746){_0x188cc8=_0x188cc8-0x0;var _0x4cb155=_0x6a39[_0x188cc8];return _0x4cb155;};'use strict';var _=require(_0x96a3('0x0'));var util=require(_0x96a3('0x1'));var logger=require(_0x96a3('0x2'))(_0x96a3('0x3'));var moment=require(_0x96a3('0x4'));var BPromise=require(_0x96a3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96a3('0x6'));var rimraf=require(_0x96a3('0x7'));var config=require(_0x96a3('0x8'));var attributes=require(_0x96a3('0x9'));module[_0x96a3('0xa')]=function(_0x21f936,_0x2174a1){return _0x21f936[_0x96a3('0xb')](_0x96a3('0xc'),attributes,{'tableName':_0x96a3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x96a3('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 5420fa0..73f4d66 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 _0x17e9=['../../config/utils','rpc','../../config/environment','jayson/promise','client','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x50045a,_0x1e1fb4){var _0x41eba7=function(_0x4c44fe){while(--_0x4c44fe){_0x50045a['push'](_0x50045a['shift']());}};_0x41eba7(++_0x1e1fb4);}(_0x17e9,0x1db));var _0x917e=function(_0x5ce4db,_0x313a2b){_0x5ce4db=_0x5ce4db-0x0;var _0x918b0a=_0x17e9[_0x5ce4db];return _0x918b0a;};'use strict';var _=require(_0x917e('0x0'));var util=require(_0x917e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x917e('0x2'));var fs=require('fs');var Redis=require(_0x917e('0x3'));var db=require(_0x917e('0x4'))['db'];var utils=require(_0x917e('0x5'));var logger=require('../../config/logger')(_0x917e('0x6'));var config=require(_0x917e('0x7'));var jayson=require(_0x917e('0x8'));var client=jayson[_0x917e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c7103,_0x311df1,_0x24c370){return new BPromise(function(_0x24f190,_0x34be88){return client['request'](_0x4c7103,_0x24c370)['then'](function(_0x383a07){logger['info'](_0x917e('0xa'),_0x311df1,_0x917e('0xb'));logger[_0x917e('0xc')](_0x917e('0xd'),_0x311df1,_0x917e('0xb'),JSON[_0x917e('0xe')](_0x383a07));if(_0x383a07[_0x917e('0xf')]){if(_0x383a07[_0x917e('0xf')][_0x917e('0x10')]===0x1f4){logger[_0x917e('0xf')](_0x917e('0xa'),_0x311df1,_0x383a07[_0x917e('0xf')][_0x917e('0x11')]);return _0x34be88(_0x383a07[_0x917e('0xf')]['message']);}logger[_0x917e('0xf')]('ChatApplication,\x20%s,\x20%s',_0x311df1,_0x383a07[_0x917e('0xf')]['message']);return _0x24f190(_0x383a07[_0x917e('0xf')][_0x917e('0x11')]);}else{logger[_0x917e('0x12')](_0x917e('0xa'),_0x311df1,'request\x20sent');_0x24f190(_0x383a07['result'][_0x917e('0x11')]);}})[_0x917e('0x13')](function(_0x327fb3){logger[_0x917e('0xf')](_0x917e('0xa'),_0x311df1,_0x327fb3);_0x34be88(_0x327fb3);});});} \ No newline at end of file +var _0x6169=['../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x30945b,_0x225f4b){var _0x796d92=function(_0x537b3f){while(--_0x537b3f){_0x30945b['push'](_0x30945b['shift']());}};_0x796d92(++_0x225f4b);}(_0x6169,0x84));var _0x9616=function(_0x31cb75,_0xdbf4e6){_0x31cb75=_0x31cb75-0x0;var _0x371fb7=_0x6169[_0x31cb75];return _0x371fb7;};'use strict';var _=require(_0x9616('0x0'));var util=require(_0x9616('0x1'));var moment=require(_0x9616('0x2'));var BPromise=require(_0x9616('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9616('0x4'));var db=require(_0x9616('0x5'))['db'];var utils=require(_0x9616('0x6'));var logger=require('../../config/logger')(_0x9616('0x7'));var config=require(_0x9616('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9616('0x9')][_0x9616('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a448c,_0x4db8a2,_0x456f95){return new BPromise(function(_0x182a5f,_0x41de06){return client[_0x9616('0xb')](_0x2a448c,_0x456f95)[_0x9616('0xc')](function(_0x16f6cb){logger['info']('ChatApplication,\x20%s,\x20%s',_0x4db8a2,_0x9616('0xd'));logger[_0x9616('0xe')](_0x9616('0xf'),_0x4db8a2,_0x9616('0xd'),JSON[_0x9616('0x10')](_0x16f6cb));if(_0x16f6cb[_0x9616('0x11')]){if(_0x16f6cb[_0x9616('0x11')]['code']===0x1f4){logger[_0x9616('0x11')](_0x9616('0x12'),_0x4db8a2,_0x16f6cb['error']['message']);return _0x41de06(_0x16f6cb[_0x9616('0x11')]['message']);}logger[_0x9616('0x11')](_0x9616('0x12'),_0x4db8a2,_0x16f6cb[_0x9616('0x11')][_0x9616('0x13')]);return _0x182a5f(_0x16f6cb[_0x9616('0x11')][_0x9616('0x13')]);}else{logger[_0x9616('0x14')](_0x9616('0x12'),_0x4db8a2,_0x9616('0xd'));_0x182a5f(_0x16f6cb[_0x9616('0x15')][_0x9616('0x13')]);}})[_0x9616('0x16')](function(_0x5b1f29){logger['error'](_0x9616('0x12'),_0x4db8a2,_0x5b1f29);_0x41de06(_0x5b1f29);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 68aa577..2fae508 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 _0x1add=['put','/:id','destroy','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show'];(function(_0x32acd1,_0x434e8a){var _0x446047=function(_0x17ce14){while(--_0x17ce14){_0x32acd1['push'](_0x32acd1['shift']());}};_0x446047(++_0x434e8a);}(_0x1add,0x14d));var _0xd1ad=function(_0x44174f,_0x5b0087){_0x44174f=_0x44174f-0x0;var _0x4f0d66=_0x1add[_0x44174f];return _0x4f0d66;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd1ad('0x0'));var timeout=require(_0xd1ad('0x1'));var express=require('express');var router=express[_0xd1ad('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd1ad('0x3'));var config=require(_0xd1ad('0x4'));var controller=require(_0xd1ad('0x5'));router[_0xd1ad('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xd1ad('0x7')]);router[_0xd1ad('0x8')](_0xd1ad('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd1ad('0x9'),auth['isAuthenticated'](),controller[_0xd1ad('0xa')]);module['exports']=router; \ No newline at end of file +var _0x5b2a=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','exports','multer','util','path'];(function(_0xe0488c,_0x5b86e1){var _0x296757=function(_0x47934f){while(--_0x47934f){_0xe0488c['push'](_0xe0488c['shift']());}};_0x296757(++_0x5b86e1);}(_0x5b2a,0xed));var _0xa5b2=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0x5b2a[_0x515283];return _0x38f836;};'use strict';var multer=require(_0xa5b2('0x0'));var util=require(_0xa5b2('0x1'));var path=require(_0xa5b2('0x2'));var timeout=require(_0xa5b2('0x3'));var express=require(_0xa5b2('0x4'));var router=express['Router']();var fs_extra=require(_0xa5b2('0x5'));var auth=require(_0xa5b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa5b2('0x7'));var controller=require(_0xa5b2('0x8'));router[_0xa5b2('0x9')](_0xa5b2('0xa'),auth[_0xa5b2('0xb')](),controller[_0xa5b2('0xc')]);router[_0xa5b2('0xd')](_0xa5b2('0xa'),auth[_0xa5b2('0xb')](),controller['update']);router['delete'](_0xa5b2('0xa'),auth[_0xa5b2('0xb')](),controller['destroy']);module[_0xa5b2('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 6e704d7..50d25b3 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 _0xce62=['exports','STRING','BOOLEAN','sequelize'];(function(_0x367f71,_0x539921){var _0x123610=function(_0x5b9a32){while(--_0x5b9a32){_0x367f71['push'](_0x367f71['shift']());}};_0x123610(++_0x539921);}(_0xce62,0x83));var _0x2ce6=function(_0xf081c9,_0x90f843){_0xf081c9=_0xf081c9-0x0;var _0x1e3b8f=_0xce62[_0xf081c9];return _0x1e3b8f;};'use strict';var Sequelize=require(_0x2ce6('0x0'));module[_0x2ce6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2ce6('0x2')]},'write':{'type':Sequelize[_0x2ce6('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5a5a=['exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x574162,_0x2425ea){_0x574162=_0x574162-0x0;var _0x39c245=_0x5a5a[_0x574162];return _0x39c245;};'use strict';var Sequelize=require('sequelize');module[_0xa5a5('0x0')]={'name':{'type':Sequelize[_0xa5a5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa5a5('0x1')]},'write':{'type':Sequelize[_0xa5a5('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 55a9886..3b0594e 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 _0xb140=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ChatGroup','fieldName','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','merge','find','create','body','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','getMembers','findOne','options','length','removeMembers','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x53adf9,_0x381ee9){var _0x41b41f=function(_0x226bb8){while(--_0x226bb8){_0x53adf9['push'](_0x53adf9['shift']());}};_0x41b41f(++_0x381ee9);}(_0xb140,0x10f));var _0x0b14=function(_0xb66f92,_0x301f99){_0xb66f92=_0xb66f92-0x0;var _0x344d2d=_0xb140[_0xb66f92];return _0x344d2d;};'use strict';var emlformat=require(_0x0b14('0x0'));var rimraf=require(_0x0b14('0x1'));var zipdir=require(_0x0b14('0x2'));var jsonpatch=require(_0x0b14('0x3'));var rp=require(_0x0b14('0x4'));var moment=require(_0x0b14('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0b14('0x6'));var util=require(_0x0b14('0x7'));var path=require('path');var sox=require(_0x0b14('0x8'));var csv=require(_0x0b14('0x9'));var ejs=require(_0x0b14('0xa'));var fs=require('fs');var fs_extra=require(_0x0b14('0xb'));var _=require('lodash');var squel=require(_0x0b14('0xc'));var crypto=require('crypto');var jsforce=require(_0x0b14('0xd'));var deskjs=require(_0x0b14('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0b14('0xf'));var Redis=require('ioredis');var authService=require(_0x0b14('0x10'));var qs=require(_0x0b14('0x11'));var as=require(_0x0b14('0x12'));var hardwareService=require(_0x0b14('0x13'));var logger=require(_0x0b14('0x14'))(_0x0b14('0x15'));var utils=require(_0x0b14('0x16'));var config=require(_0x0b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b14('0x18'))['db'];config[_0x0b14('0x19')]=_[_0x0b14('0x1a')](config[_0x0b14('0x19')],{'host':_0x0b14('0x1b'),'port':0x18eb});var socket=require(_0x0b14('0x1c'))(new Redis(config['redis']));require(_0x0b14('0x1d'))[_0x0b14('0x1e')](socket);function respondWithStatusCode(_0x242c3c,_0x8a9a80){_0x8a9a80=_0x8a9a80||0xcc;return function(_0x10c64a){if(_0x10c64a){return _0x242c3c['sendStatus'](_0x8a9a80);}return _0x242c3c[_0x0b14('0x1f')](_0x8a9a80)[_0x0b14('0x20')]();};}function respondWithResult(_0x3a5673,_0x4694a5){_0x4694a5=_0x4694a5||0xc8;return function(_0x2e3c7b){if(_0x2e3c7b){return _0x3a5673[_0x0b14('0x1f')](_0x4694a5)[_0x0b14('0x21')](_0x2e3c7b);}};}function respondWithFilteredResult(_0x4febd9,_0x15867a){return function(_0x1a5538){if(_0x1a5538){var _0xfc6704=typeof _0x15867a['offset']===_0x0b14('0x22')&&typeof _0x15867a[_0x0b14('0x23')]===_0x0b14('0x22');var _0x47be90=_0x1a5538[_0x0b14('0x24')];var _0x46a35d=_0xfc6704?0x0:_0x15867a[_0x0b14('0x25')];var _0x334e55=_0xfc6704?_0x1a5538[_0x0b14('0x24')]:_0x15867a[_0x0b14('0x25')]+_0x15867a[_0x0b14('0x23')];var _0x45f407;if(_0x334e55>=_0x47be90){_0x334e55=_0x47be90;_0x45f407=0xc8;}else{_0x45f407=0xce;}_0x4febd9['status'](_0x45f407);return _0x4febd9[_0x0b14('0x26')](_0x0b14('0x27'),_0x46a35d+'-'+_0x334e55+'/'+_0x47be90)[_0x0b14('0x21')](_0x1a5538);}return null;};}function patchUpdates(_0x2ee5dc){return function(_0x5b5e83){try{jsonpatch[_0x0b14('0x28')](_0x5b5e83,_0x2ee5dc,!![]);}catch(_0x4bd933){return BPromise[_0x0b14('0x29')](_0x4bd933);}return _0x5b5e83['save']();};}function saveUpdates(_0x494a0c,_0x862b28){return function(_0x224d5c){if(_0x224d5c){return _0x224d5c[_0x0b14('0x2a')](_0x494a0c)[_0x0b14('0x2b')](function(_0xd4e75f){return _0xd4e75f;});}return null;};}function removeEntity(_0x3b2b2e,_0x260103){return function(_0x36dcf2){if(_0x36dcf2){return _0x36dcf2['destroy']()[_0x0b14('0x2b')](function(){_0x3b2b2e[_0x0b14('0x1f')](0xcc)[_0x0b14('0x20')]();});}};}function handleEntityNotFound(_0x2a331d,_0x53d06d){return function(_0xdd7286){if(!_0xdd7286){_0x2a331d[_0x0b14('0x2c')](0x194);}return _0xdd7286;};}function handleError(_0x91107f,_0x3160e0){_0x3160e0=_0x3160e0||0x1f4;return function(_0x27c8c7){logger[_0x0b14('0x2d')](_0x27c8c7[_0x0b14('0x2e')]);if(_0x27c8c7[_0x0b14('0x2f')]){delete _0x27c8c7['name'];}_0x91107f[_0x0b14('0x1f')](_0x3160e0)[_0x0b14('0x30')](_0x27c8c7);};}exports[_0x0b14('0x31')]=function(_0x26a245,_0x29c48e){var _0x1f6b99={},_0x1c65a1={},_0xe00c55={'count':0x0,'rows':[]};var _0x2083e9=_[_0x0b14('0x32')](db[_0x0b14('0x33')]['rawAttributes'],function(_0x70d87){return{'name':_0x70d87[_0x0b14('0x34')],'type':_0x70d87['type']['key']};});_0x1c65a1['model']=_[_0x0b14('0x32')](_0x2083e9,_0x0b14('0x2f'));_0x1c65a1[_0x0b14('0x35')]=_['keys'](_0x26a245[_0x0b14('0x35')]);_0x1c65a1[_0x0b14('0x36')]=_['intersection'](_0x1c65a1[_0x0b14('0x37')],_0x1c65a1[_0x0b14('0x35')]);_0x1f6b99[_0x0b14('0x38')]=_[_0x0b14('0x39')](_0x1c65a1[_0x0b14('0x37')],qs[_0x0b14('0x3a')](_0x26a245[_0x0b14('0x35')]['fields']));_0x1f6b99[_0x0b14('0x38')]=_0x1f6b99[_0x0b14('0x38')]['length']?_0x1f6b99[_0x0b14('0x38')]:_0x1c65a1[_0x0b14('0x37')];if(!_0x26a245[_0x0b14('0x35')][_0x0b14('0x3b')](_0x0b14('0x3c'))){_0x1f6b99[_0x0b14('0x23')]=qs[_0x0b14('0x23')](_0x26a245[_0x0b14('0x35')][_0x0b14('0x23')]);_0x1f6b99[_0x0b14('0x25')]=qs[_0x0b14('0x25')](_0x26a245[_0x0b14('0x35')]['offset']);}_0x1f6b99[_0x0b14('0x3d')]=qs[_0x0b14('0x3e')](_0x26a245[_0x0b14('0x35')][_0x0b14('0x3e')]);_0x1f6b99[_0x0b14('0x3f')]=qs[_0x0b14('0x36')](_[_0x0b14('0x40')](_0x26a245[_0x0b14('0x35')],_0x1c65a1['filters']),_0x2083e9);if(_0x26a245[_0x0b14('0x35')][_0x0b14('0x41')]){_0x1f6b99['where']=_['merge'](_0x1f6b99[_0x0b14('0x3f')],{'$or':_[_0x0b14('0x32')](_0x2083e9,function(_0xd21c31){if(_0xd21c31[_0x0b14('0x42')]!==_0x0b14('0x43')){var _0x29f8cb={};_0x29f8cb[_0xd21c31[_0x0b14('0x2f')]]={'$like':'%'+_0x26a245[_0x0b14('0x35')]['filter']+'%'};return _0x29f8cb;}})});}_0x1f6b99=_['merge']({},_0x1f6b99,_0x26a245['options']);var _0x366bea={'where':_0x1f6b99[_0x0b14('0x3f')]};return db[_0x0b14('0x33')]['count'](_0x366bea)[_0x0b14('0x2b')](function(_0x4b0a7c){_0xe00c55[_0x0b14('0x24')]=_0x4b0a7c;if(_0x26a245[_0x0b14('0x35')]['includeAll']){_0x1f6b99[_0x0b14('0x44')]=[{'all':!![]}];}return db[_0x0b14('0x33')][_0x0b14('0x45')](_0x1f6b99);})[_0x0b14('0x2b')](function(_0x12a091){_0xe00c55[_0x0b14('0x46')]=_0x12a091;return _0xe00c55;})[_0x0b14('0x2b')](respondWithFilteredResult(_0x29c48e,_0x1f6b99))[_0x0b14('0x47')](handleError(_0x29c48e,null));};exports[_0x0b14('0x48')]=function(_0x5a8f5b,_0x10d903){var _0x205ca9={'raw':!![],'where':{'id':_0x5a8f5b[_0x0b14('0x49')]['id']}},_0x4aba3e={};_0x4aba3e['model']=_[_0x0b14('0x4a')](db[_0x0b14('0x33')][_0x0b14('0x4b')]);_0x4aba3e[_0x0b14('0x35')]=_[_0x0b14('0x4a')](_0x5a8f5b['query']);_0x4aba3e['filters']=_[_0x0b14('0x39')](_0x4aba3e[_0x0b14('0x37')],_0x4aba3e[_0x0b14('0x35')]);_0x205ca9[_0x0b14('0x38')]=_[_0x0b14('0x39')](_0x4aba3e[_0x0b14('0x37')],qs[_0x0b14('0x3a')](_0x5a8f5b[_0x0b14('0x35')]['fields']));_0x205ca9[_0x0b14('0x38')]=_0x205ca9[_0x0b14('0x38')]['length']?_0x205ca9['attributes']:_0x4aba3e[_0x0b14('0x37')];if(_0x5a8f5b['query'][_0x0b14('0x4c')]){_0x205ca9[_0x0b14('0x44')]=[{'all':!![]}];}_0x205ca9=_[_0x0b14('0x4d')]({},_0x205ca9,_0x5a8f5b['options']);return db[_0x0b14('0x33')][_0x0b14('0x4e')](_0x205ca9)[_0x0b14('0x2b')](handleEntityNotFound(_0x10d903,null))[_0x0b14('0x2b')](respondWithResult(_0x10d903,null))['catch'](handleError(_0x10d903,null));};exports[_0x0b14('0x4f')]=function(_0x517b7a,_0x110d7d){return db[_0x0b14('0x33')][_0x0b14('0x4f')](_0x517b7a[_0x0b14('0x50')],{})[_0x0b14('0x2b')](respondWithResult(_0x110d7d,0xc9))['catch'](handleError(_0x110d7d,null));};exports[_0x0b14('0x2a')]=function(_0x5ede4e,_0x496ff7){if(_0x5ede4e[_0x0b14('0x50')]['id']){delete _0x5ede4e['body']['id'];}return db[_0x0b14('0x33')]['find']({'where':{'id':_0x5ede4e[_0x0b14('0x49')]['id']}})['then'](handleEntityNotFound(_0x496ff7,null))[_0x0b14('0x2b')](saveUpdates(_0x5ede4e['body'],null))['then'](respondWithResult(_0x496ff7,null))['catch'](handleError(_0x496ff7,null));};exports['destroy']=function(_0x398300,_0x111d7e){return db[_0x0b14('0x33')]['find']({'where':{'id':_0x398300[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x111d7e,null))[_0x0b14('0x2b')](removeEntity(_0x111d7e,null))['catch'](handleError(_0x111d7e,null));};exports['describe']=function(_0x48cf1b,_0x3f612a){return db[_0x0b14('0x33')][_0x0b14('0x51')]()[_0x0b14('0x2b')](respondWithResult(_0x3f612a,null))[_0x0b14('0x47')](handleError(_0x3f612a,null));};exports[_0x0b14('0x52')]=function(_0x56b8c0,_0x391c6f,_0x2dbda2){return db[_0x0b14('0x53')][_0x0b14('0x24')]({'where':{'ChatGroupId':_0x56b8c0[_0x0b14('0x49')]['id'],'ToId':_0x56b8c0['user']['id'],'read':![]}})['then'](function(_0x4cd541){return{'id':_['toInteger'](_0x56b8c0[_0x0b14('0x49')]['id']),'count':_0x4cd541};})[_0x0b14('0x2b')](respondWithResult(_0x391c6f,null))['catch'](handleError(_0x391c6f,null));};exports[_0x0b14('0x54')]=function(_0x305ccc,_0x2d77e9,_0x1e2edc){return db[_0x0b14('0x33')]['find']({'where':{'id':_0x305ccc[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x2d77e9,null))[_0x0b14('0x2b')](function(_0x55e8de){if(_0x55e8de){return _0x55e8de[_0x0b14('0x54')](_0x305ccc['body'][_0x0b14('0x55')],_[_0x0b14('0x56')](_0x305ccc[_0x0b14('0x50')],[_0x0b14('0x55'),'id'])||{});}})[_0x0b14('0x2b')](respondWithResult(_0x2d77e9,null))[_0x0b14('0x47')](handleError(_0x2d77e9,null));};exports[_0x0b14('0x57')]=function(_0x33b4b3,_0x1fb474,_0x5bb6df){var _0x4b90df={};var _0x189f7d={};var _0x160ad6;var _0x56696f;return db['ChatGroup'][_0x0b14('0x58')]({'where':{'id':_0x33b4b3[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x1fb474,null))[_0x0b14('0x2b')](function(_0x4ec94e){if(_0x4ec94e){_0x160ad6=_0x4ec94e;_0x189f7d[_0x0b14('0x37')]=_[_0x0b14('0x4a')](db['User'][_0x0b14('0x4b')]);_0x189f7d[_0x0b14('0x35')]=_['keys'](_0x33b4b3[_0x0b14('0x35')]);_0x189f7d['filters']=_[_0x0b14('0x39')](_0x189f7d[_0x0b14('0x37')],_0x189f7d[_0x0b14('0x35')]);_0x4b90df[_0x0b14('0x38')]=_['intersection'](_0x189f7d[_0x0b14('0x37')],qs['fields'](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x3a')]));_0x4b90df['attributes']=_0x4b90df[_0x0b14('0x38')]['length']?_0x4b90df[_0x0b14('0x38')]:_0x189f7d[_0x0b14('0x37')];_0x4b90df['order']=qs[_0x0b14('0x3e')](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x3e')]);_0x4b90df[_0x0b14('0x3f')]=qs['filters'](_[_0x0b14('0x40')](_0x33b4b3[_0x0b14('0x35')],_0x189f7d[_0x0b14('0x36')]));if(_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x41')]){_0x4b90df[_0x0b14('0x3f')]=_['merge'](_0x4b90df[_0x0b14('0x3f')],{'$or':_[_0x0b14('0x32')](_0x4b90df['attributes'],function(_0x178c2e){var _0x52f829={};_0x52f829[_0x178c2e]={'$like':'%'+_0x33b4b3['query'][_0x0b14('0x41')]+'%'};return _0x52f829;})});}_0x4b90df=_[_0x0b14('0x4d')]({},_0x4b90df,_0x33b4b3[_0x0b14('0x59')]);return _0x160ad6['getMembers'](_0x4b90df);}})[_0x0b14('0x2b')](function(_0x7a04bb){if(_0x7a04bb){_0x56696f=_0x7a04bb[_0x0b14('0x5a')];if(!_0x33b4b3[_0x0b14('0x35')]['hasOwnProperty'](_0x0b14('0x3c'))){_0x4b90df[_0x0b14('0x23')]=qs[_0x0b14('0x23')](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x23')]);_0x4b90df[_0x0b14('0x25')]=qs[_0x0b14('0x25')](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x25')]);}return _0x160ad6[_0x0b14('0x57')](_0x4b90df);}})[_0x0b14('0x2b')](function(_0x54823c){if(_0x54823c){return _0x54823c?{'count':_0x56696f,'rows':_0x54823c}:null;}})[_0x0b14('0x2b')](respondWithResult(_0x1fb474,null))[_0x0b14('0x47')](handleError(_0x1fb474,null));};exports[_0x0b14('0x5b')]=function(_0x57b7f2,_0x111fcb,_0x557545){return db[_0x0b14('0x33')][_0x0b14('0x4e')]({'where':{'id':_0x57b7f2[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x111fcb,null))[_0x0b14('0x2b')](function(_0x1479e4){if(_0x1479e4){return _0x1479e4[_0x0b14('0x5b')](_0x57b7f2[_0x0b14('0x35')][_0x0b14('0x55')]);}})[_0x0b14('0x2b')](respondWithStatusCode(_0x111fcb,null))[_0x0b14('0x47')](handleError(_0x111fcb,null));};exports['addMessage']=function(_0x185264,_0x5ce9d5,_0x119fa7){if(_0x185264[_0x0b14('0x50')]['id']){delete _0x185264['body']['id'];}return db[_0x0b14('0x33')][_0x0b14('0x4e')]({'where':{'id':_0x185264[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x5ce9d5,null))[_0x0b14('0x2b')](function(_0x494688){if(_0x494688){_0x185264['body'][_0x0b14('0x5c')]=_0x494688['id'];return db[_0x0b14('0x53')][_0x0b14('0x4f')](_0x185264['body']);}})[_0x0b14('0x2b')](respondWithResult(_0x5ce9d5,null))['catch'](handleError(_0x5ce9d5,null));};exports[_0x0b14('0x5d')]=function(_0x3fb96c,_0x4d1eb5,_0x310c83){var _0x3bffaf={};var _0x44a103={};var _0x26eb2a;var _0x3b5a7a;return db[_0x0b14('0x33')][_0x0b14('0x58')]({'where':{'id':_0x3fb96c[_0x0b14('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d1eb5,null))[_0x0b14('0x2b')](function(_0x4f28fd){if(_0x4f28fd){_0x26eb2a=_0x4f28fd;_0x44a103['model']=_[_0x0b14('0x4a')](db['ChatInternalMessage']['rawAttributes']);_0x44a103[_0x0b14('0x35')]=_[_0x0b14('0x4a')](_0x3fb96c[_0x0b14('0x35')]);_0x44a103[_0x0b14('0x36')]=_[_0x0b14('0x39')](_0x44a103[_0x0b14('0x37')],_0x44a103[_0x0b14('0x35')]);_0x3bffaf[_0x0b14('0x38')]=_[_0x0b14('0x39')](_0x44a103[_0x0b14('0x37')],qs[_0x0b14('0x3a')](_0x3fb96c[_0x0b14('0x35')]['fields']));_0x3bffaf[_0x0b14('0x38')]=_0x3bffaf['attributes'][_0x0b14('0x5a')]?_0x3bffaf['attributes']:_0x44a103[_0x0b14('0x37')];_0x3bffaf[_0x0b14('0x3d')]=qs[_0x0b14('0x3e')](_0x3fb96c[_0x0b14('0x35')][_0x0b14('0x3e')]);_0x3bffaf[_0x0b14('0x3f')]=qs[_0x0b14('0x36')](_[_0x0b14('0x40')](_0x3fb96c[_0x0b14('0x35')],_0x44a103['filters']));if(_0x3fb96c[_0x0b14('0x35')][_0x0b14('0x41')]){_0x3bffaf[_0x0b14('0x3f')]=_[_0x0b14('0x4d')](_0x3bffaf[_0x0b14('0x3f')],{'$or':_[_0x0b14('0x32')](_0x3bffaf[_0x0b14('0x38')],function(_0x4edc0a){var _0x444023={};_0x444023[_0x4edc0a]={'$like':'%'+_0x3fb96c['query'][_0x0b14('0x41')]+'%'};return _0x444023;})});}if(_0x3fb96c[_0x0b14('0x35')]['$gte']){var _0x50bff7=_0x3fb96c[_0x0b14('0x35')][_0x0b14('0x5e')][_0x0b14('0x5f')](',');var _0x150454={};_0x150454[_0x50bff7[0x0]]={'$gte':moment(_0x50bff7[0x1])[_0x0b14('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3bffaf['where']=_[_0x0b14('0x4d')](_0x3bffaf[_0x0b14('0x3f')],_0x150454);}_0x3bffaf=_['merge']({},_0x3bffaf,_0x3fb96c['options']);return _0x26eb2a['getMessages'](_0x3bffaf);}})[_0x0b14('0x2b')](function(_0x513f75){if(_0x513f75){_0x3b5a7a=_0x513f75[_0x0b14('0x5a')];if(!_0x3fb96c['query'][_0x0b14('0x3b')]('nolimit')){_0x3bffaf[_0x0b14('0x23')]=qs[_0x0b14('0x23')](_0x3fb96c[_0x0b14('0x35')]['limit']);_0x3bffaf[_0x0b14('0x25')]=qs[_0x0b14('0x25')](_0x3fb96c['query']['offset']);}return _0x26eb2a['getMessages'](_0x3bffaf);}})[_0x0b14('0x2b')](function(_0x3e013b){if(_0x3e013b){return _0x3e013b?{'count':_0x3b5a7a,'rows':_0x3e013b}:null;}})[_0x0b14('0x2b')](respondWithResult(_0x4d1eb5,null))[_0x0b14('0x47')](handleError(_0x4d1eb5,null));}; \ No newline at end of file +var _0x8901=['save','update','then','destroy','sendStatus','error','stack','send','index','ChatGroup','rawAttributes','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','rows','catch','show','params','includeAll','include','find','create','body','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','findOne','filter','removeMembers','addMessage','getMessages','$gte','split','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','count','limit','set','apply','reject'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8901,0x1b3));var _0x1890=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x8901[_0x42f009];return _0x22a1e0;};'use strict';var emlformat=require(_0x1890('0x0'));var rimraf=require(_0x1890('0x1'));var zipdir=require(_0x1890('0x2'));var jsonpatch=require(_0x1890('0x3'));var rp=require(_0x1890('0x4'));var moment=require(_0x1890('0x5'));var BPromise=require(_0x1890('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1890('0x7'));var sox=require('sox');var csv=require(_0x1890('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1890('0x9'));var _=require(_0x1890('0xa'));var squel=require('squel');var crypto=require(_0x1890('0xb'));var jsforce=require(_0x1890('0xc'));var deskjs=require(_0x1890('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1890('0xe'));var Papa=require(_0x1890('0xf'));var Redis=require(_0x1890('0x10'));var authService=require(_0x1890('0x11'));var qs=require(_0x1890('0x12'));var as=require(_0x1890('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1890('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1890('0x15'));var licenseUtil=require(_0x1890('0x16'));var db=require(_0x1890('0x17'))['db'];config[_0x1890('0x18')]=_[_0x1890('0x19')](config[_0x1890('0x18')],{'host':_0x1890('0x1a'),'port':0x18eb});var socket=require(_0x1890('0x1b'))(new Redis(config['redis']));require(_0x1890('0x1c'))[_0x1890('0x1d')](socket);function respondWithStatusCode(_0x2e64bc,_0x46c05f){_0x46c05f=_0x46c05f||0xcc;return function(_0x23e95b){if(_0x23e95b){return _0x2e64bc['sendStatus'](_0x46c05f);}return _0x2e64bc[_0x1890('0x1e')](_0x46c05f)[_0x1890('0x1f')]();};}function respondWithResult(_0x16e687,_0x3268de){_0x3268de=_0x3268de||0xc8;return function(_0x23c4b2){if(_0x23c4b2){return _0x16e687[_0x1890('0x1e')](_0x3268de)[_0x1890('0x20')](_0x23c4b2);}};}function respondWithFilteredResult(_0x1e9acb,_0x274752){return function(_0x472fd3){if(_0x472fd3){var _0x5086ee=typeof _0x274752[_0x1890('0x21')]===_0x1890('0x22')&&typeof _0x274752['limit']===_0x1890('0x22');var _0xe66eed=_0x472fd3[_0x1890('0x23')];var _0x167e71=_0x5086ee?0x0:_0x274752[_0x1890('0x21')];var _0x56edb1=_0x5086ee?_0x472fd3[_0x1890('0x23')]:_0x274752[_0x1890('0x21')]+_0x274752[_0x1890('0x24')];var _0x5112ac;if(_0x56edb1>=_0xe66eed){_0x56edb1=_0xe66eed;_0x5112ac=0xc8;}else{_0x5112ac=0xce;}_0x1e9acb[_0x1890('0x1e')](_0x5112ac);return _0x1e9acb[_0x1890('0x25')]('Content-Range',_0x167e71+'-'+_0x56edb1+'/'+_0xe66eed)[_0x1890('0x20')](_0x472fd3);}return null;};}function patchUpdates(_0x3f95ac){return function(_0x3ea83a){try{jsonpatch[_0x1890('0x26')](_0x3ea83a,_0x3f95ac,!![]);}catch(_0x28d87c){return BPromise[_0x1890('0x27')](_0x28d87c);}return _0x3ea83a[_0x1890('0x28')]();};}function saveUpdates(_0x10dff9,_0x350282){return function(_0x17b620){if(_0x17b620){return _0x17b620[_0x1890('0x29')](_0x10dff9)[_0x1890('0x2a')](function(_0x36c304){return _0x36c304;});}return null;};}function removeEntity(_0xd73d66,_0x310e8b){return function(_0x524267){if(_0x524267){return _0x524267[_0x1890('0x2b')]()[_0x1890('0x2a')](function(){_0xd73d66[_0x1890('0x1e')](0xcc)[_0x1890('0x1f')]();});}};}function handleEntityNotFound(_0x11be8c,_0x3a4934){return function(_0x197c2c){if(!_0x197c2c){_0x11be8c[_0x1890('0x2c')](0x194);}return _0x197c2c;};}function handleError(_0x4f4302,_0x26a1ea){_0x26a1ea=_0x26a1ea||0x1f4;return function(_0x3e1889){logger[_0x1890('0x2d')](_0x3e1889[_0x1890('0x2e')]);if(_0x3e1889['name']){delete _0x3e1889['name'];}_0x4f4302[_0x1890('0x1e')](_0x26a1ea)[_0x1890('0x2f')](_0x3e1889);};}exports[_0x1890('0x30')]=function(_0x2bf707,_0x32b4ef){var _0x1b2a76={},_0x3115f5={},_0x2508b2={'count':0x0,'rows':[]};var _0x1d4d02=_['map'](db[_0x1890('0x31')][_0x1890('0x32')],function(_0x19ecac){return{'name':_0x19ecac['fieldName'],'type':_0x19ecac[_0x1890('0x33')][_0x1890('0x34')]};});_0x3115f5[_0x1890('0x35')]=_[_0x1890('0x36')](_0x1d4d02,_0x1890('0x37'));_0x3115f5['query']=_[_0x1890('0x38')](_0x2bf707[_0x1890('0x39')]);_0x3115f5[_0x1890('0x3a')]=_[_0x1890('0x3b')](_0x3115f5[_0x1890('0x35')],_0x3115f5[_0x1890('0x39')]);_0x1b2a76[_0x1890('0x3c')]=_[_0x1890('0x3b')](_0x3115f5['model'],qs[_0x1890('0x3d')](_0x2bf707[_0x1890('0x39')]['fields']));_0x1b2a76['attributes']=_0x1b2a76['attributes'][_0x1890('0x3e')]?_0x1b2a76[_0x1890('0x3c')]:_0x3115f5[_0x1890('0x35')];if(!_0x2bf707[_0x1890('0x39')][_0x1890('0x3f')](_0x1890('0x40'))){_0x1b2a76[_0x1890('0x24')]=qs[_0x1890('0x24')](_0x2bf707['query'][_0x1890('0x24')]);_0x1b2a76[_0x1890('0x21')]=qs[_0x1890('0x21')](_0x2bf707['query'][_0x1890('0x21')]);}_0x1b2a76[_0x1890('0x41')]=qs[_0x1890('0x42')](_0x2bf707[_0x1890('0x39')][_0x1890('0x42')]);_0x1b2a76[_0x1890('0x43')]=qs['filters'](_[_0x1890('0x44')](_0x2bf707[_0x1890('0x39')],_0x3115f5[_0x1890('0x3a')]),_0x1d4d02);if(_0x2bf707[_0x1890('0x39')]['filter']){_0x1b2a76[_0x1890('0x43')]=_['merge'](_0x1b2a76[_0x1890('0x43')],{'$or':_[_0x1890('0x36')](_0x1d4d02,function(_0x391871){if(_0x391871[_0x1890('0x33')]!==_0x1890('0x45')){var _0x44e0ef={};_0x44e0ef[_0x391871[_0x1890('0x37')]]={'$like':'%'+_0x2bf707[_0x1890('0x39')]['filter']+'%'};return _0x44e0ef;}})});}_0x1b2a76=_[_0x1890('0x46')]({},_0x1b2a76,_0x2bf707[_0x1890('0x47')]);var _0x5758b8={'where':_0x1b2a76['where']};return db[_0x1890('0x31')][_0x1890('0x23')](_0x5758b8)[_0x1890('0x2a')](function(_0x2a0d80){_0x2508b2[_0x1890('0x23')]=_0x2a0d80;if(_0x2bf707[_0x1890('0x39')]['includeAll']){_0x1b2a76['include']=[{'all':!![]}];}return db[_0x1890('0x31')]['findAll'](_0x1b2a76);})[_0x1890('0x2a')](function(_0x41c6be){_0x2508b2[_0x1890('0x48')]=_0x41c6be;return _0x2508b2;})[_0x1890('0x2a')](respondWithFilteredResult(_0x32b4ef,_0x1b2a76))[_0x1890('0x49')](handleError(_0x32b4ef,null));};exports[_0x1890('0x4a')]=function(_0x4e971c,_0x5a0687){var _0x337935={'raw':!![],'where':{'id':_0x4e971c[_0x1890('0x4b')]['id']}},_0x912087={};_0x912087[_0x1890('0x35')]=_[_0x1890('0x38')](db[_0x1890('0x31')][_0x1890('0x32')]);_0x912087[_0x1890('0x39')]=_['keys'](_0x4e971c[_0x1890('0x39')]);_0x912087[_0x1890('0x3a')]=_[_0x1890('0x3b')](_0x912087[_0x1890('0x35')],_0x912087[_0x1890('0x39')]);_0x337935['attributes']=_[_0x1890('0x3b')](_0x912087[_0x1890('0x35')],qs[_0x1890('0x3d')](_0x4e971c['query'][_0x1890('0x3d')]));_0x337935['attributes']=_0x337935[_0x1890('0x3c')][_0x1890('0x3e')]?_0x337935['attributes']:_0x912087['model'];if(_0x4e971c['query'][_0x1890('0x4c')]){_0x337935[_0x1890('0x4d')]=[{'all':!![]}];}_0x337935=_['merge']({},_0x337935,_0x4e971c[_0x1890('0x47')]);return db[_0x1890('0x31')][_0x1890('0x4e')](_0x337935)['then'](handleEntityNotFound(_0x5a0687,null))[_0x1890('0x2a')](respondWithResult(_0x5a0687,null))['catch'](handleError(_0x5a0687,null));};exports[_0x1890('0x4f')]=function(_0x3859f2,_0x50402a){return db[_0x1890('0x31')]['create'](_0x3859f2['body'],{})[_0x1890('0x2a')](respondWithResult(_0x50402a,0xc9))[_0x1890('0x49')](handleError(_0x50402a,null));};exports[_0x1890('0x29')]=function(_0x24aaa2,_0x351197){if(_0x24aaa2[_0x1890('0x50')]['id']){delete _0x24aaa2[_0x1890('0x50')]['id'];}return db[_0x1890('0x31')][_0x1890('0x4e')]({'where':{'id':_0x24aaa2[_0x1890('0x4b')]['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0x351197,null))[_0x1890('0x2a')](saveUpdates(_0x24aaa2['body'],null))[_0x1890('0x2a')](respondWithResult(_0x351197,null))[_0x1890('0x49')](handleError(_0x351197,null));};exports[_0x1890('0x2b')]=function(_0x122079,_0x3de606){return db['ChatGroup'][_0x1890('0x4e')]({'where':{'id':_0x122079[_0x1890('0x4b')]['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0x3de606,null))['then'](removeEntity(_0x3de606,null))[_0x1890('0x49')](handleError(_0x3de606,null));};exports['describe']=function(_0x416d2d,_0xaeb33e){return db[_0x1890('0x31')]['describe']()[_0x1890('0x2a')](respondWithResult(_0xaeb33e,null))[_0x1890('0x49')](handleError(_0xaeb33e,null));};exports[_0x1890('0x51')]=function(_0x429730,_0x144226,_0x313441){return db[_0x1890('0x52')]['count']({'where':{'ChatGroupId':_0x429730[_0x1890('0x4b')]['id'],'ToId':_0x429730[_0x1890('0x53')]['id'],'read':![]}})[_0x1890('0x2a')](function(_0x3b9611){return{'id':_[_0x1890('0x54')](_0x429730[_0x1890('0x4b')]['id']),'count':_0x3b9611};})[_0x1890('0x2a')](respondWithResult(_0x144226,null))['catch'](handleError(_0x144226,null));};exports[_0x1890('0x55')]=function(_0x1b39a7,_0x570595,_0xdc687e){return db[_0x1890('0x31')][_0x1890('0x4e')]({'where':{'id':_0x1b39a7['params']['id']}})['then'](handleEntityNotFound(_0x570595,null))['then'](function(_0x30d4d5){if(_0x30d4d5){return _0x30d4d5[_0x1890('0x55')](_0x1b39a7[_0x1890('0x50')]['ids'],_[_0x1890('0x56')](_0x1b39a7[_0x1890('0x50')],[_0x1890('0x57'),'id'])||{});}})[_0x1890('0x2a')](respondWithResult(_0x570595,null))[_0x1890('0x49')](handleError(_0x570595,null));};exports['getMembers']=function(_0x7e6eca,_0xb5b1bc,_0x326eef){var _0x4130c5={};var _0x5a3cb4={};var _0x2e17a6;var _0x1b6adb;return db[_0x1890('0x31')][_0x1890('0x58')]({'where':{'id':_0x7e6eca[_0x1890('0x4b')]['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0xb5b1bc,null))[_0x1890('0x2a')](function(_0x19b661){if(_0x19b661){_0x2e17a6=_0x19b661;_0x5a3cb4[_0x1890('0x35')]=_[_0x1890('0x38')](db['User'][_0x1890('0x32')]);_0x5a3cb4['query']=_[_0x1890('0x38')](_0x7e6eca['query']);_0x5a3cb4[_0x1890('0x3a')]=_['intersection'](_0x5a3cb4[_0x1890('0x35')],_0x5a3cb4[_0x1890('0x39')]);_0x4130c5[_0x1890('0x3c')]=_[_0x1890('0x3b')](_0x5a3cb4['model'],qs['fields'](_0x7e6eca[_0x1890('0x39')][_0x1890('0x3d')]));_0x4130c5[_0x1890('0x3c')]=_0x4130c5[_0x1890('0x3c')]['length']?_0x4130c5[_0x1890('0x3c')]:_0x5a3cb4[_0x1890('0x35')];_0x4130c5['order']=qs[_0x1890('0x42')](_0x7e6eca[_0x1890('0x39')][_0x1890('0x42')]);_0x4130c5[_0x1890('0x43')]=qs[_0x1890('0x3a')](_['pick'](_0x7e6eca[_0x1890('0x39')],_0x5a3cb4[_0x1890('0x3a')]));if(_0x7e6eca[_0x1890('0x39')][_0x1890('0x59')]){_0x4130c5['where']=_['merge'](_0x4130c5[_0x1890('0x43')],{'$or':_[_0x1890('0x36')](_0x4130c5[_0x1890('0x3c')],function(_0x4fb957){var _0x199951={};_0x199951[_0x4fb957]={'$like':'%'+_0x7e6eca[_0x1890('0x39')][_0x1890('0x59')]+'%'};return _0x199951;})});}_0x4130c5=_[_0x1890('0x46')]({},_0x4130c5,_0x7e6eca[_0x1890('0x47')]);return _0x2e17a6['getMembers'](_0x4130c5);}})[_0x1890('0x2a')](function(_0x4a1972){if(_0x4a1972){_0x1b6adb=_0x4a1972[_0x1890('0x3e')];if(!_0x7e6eca['query'][_0x1890('0x3f')](_0x1890('0x40'))){_0x4130c5[_0x1890('0x24')]=qs[_0x1890('0x24')](_0x7e6eca[_0x1890('0x39')][_0x1890('0x24')]);_0x4130c5[_0x1890('0x21')]=qs[_0x1890('0x21')](_0x7e6eca[_0x1890('0x39')]['offset']);}return _0x2e17a6['getMembers'](_0x4130c5);}})[_0x1890('0x2a')](function(_0x10e27f){if(_0x10e27f){return _0x10e27f?{'count':_0x1b6adb,'rows':_0x10e27f}:null;}})[_0x1890('0x2a')](respondWithResult(_0xb5b1bc,null))[_0x1890('0x49')](handleError(_0xb5b1bc,null));};exports[_0x1890('0x5a')]=function(_0x306bfe,_0x1bec3c,_0xd7693f){return db['ChatGroup'][_0x1890('0x4e')]({'where':{'id':_0x306bfe['params']['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0x1bec3c,null))[_0x1890('0x2a')](function(_0x3e513c){if(_0x3e513c){return _0x3e513c[_0x1890('0x5a')](_0x306bfe[_0x1890('0x39')][_0x1890('0x57')]);}})[_0x1890('0x2a')](respondWithStatusCode(_0x1bec3c,null))[_0x1890('0x49')](handleError(_0x1bec3c,null));};exports[_0x1890('0x5b')]=function(_0x44f388,_0x4d8707,_0x208e22){if(_0x44f388[_0x1890('0x50')]['id']){delete _0x44f388[_0x1890('0x50')]['id'];}return db[_0x1890('0x31')][_0x1890('0x4e')]({'where':{'id':_0x44f388['params']['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0x4d8707,null))['then'](function(_0x5f363d){if(_0x5f363d){_0x44f388[_0x1890('0x50')]['ChatGroupId']=_0x5f363d['id'];return db[_0x1890('0x52')][_0x1890('0x4f')](_0x44f388[_0x1890('0x50')]);}})[_0x1890('0x2a')](respondWithResult(_0x4d8707,null))['catch'](handleError(_0x4d8707,null));};exports[_0x1890('0x5c')]=function(_0x401d4b,_0x14fd32,_0x21d642){var _0xfaa17={};var _0x1612f6={};var _0x27ca71;var _0x50fefa;return db[_0x1890('0x31')][_0x1890('0x58')]({'where':{'id':_0x401d4b[_0x1890('0x4b')]['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0x14fd32,null))[_0x1890('0x2a')](function(_0x1b0e2a){if(_0x1b0e2a){_0x27ca71=_0x1b0e2a;_0x1612f6['model']=_[_0x1890('0x38')](db[_0x1890('0x52')][_0x1890('0x32')]);_0x1612f6[_0x1890('0x39')]=_[_0x1890('0x38')](_0x401d4b[_0x1890('0x39')]);_0x1612f6[_0x1890('0x3a')]=_[_0x1890('0x3b')](_0x1612f6[_0x1890('0x35')],_0x1612f6[_0x1890('0x39')]);_0xfaa17[_0x1890('0x3c')]=_[_0x1890('0x3b')](_0x1612f6[_0x1890('0x35')],qs[_0x1890('0x3d')](_0x401d4b['query']['fields']));_0xfaa17[_0x1890('0x3c')]=_0xfaa17['attributes'][_0x1890('0x3e')]?_0xfaa17[_0x1890('0x3c')]:_0x1612f6[_0x1890('0x35')];_0xfaa17['order']=qs[_0x1890('0x42')](_0x401d4b[_0x1890('0x39')][_0x1890('0x42')]);_0xfaa17[_0x1890('0x43')]=qs[_0x1890('0x3a')](_[_0x1890('0x44')](_0x401d4b[_0x1890('0x39')],_0x1612f6[_0x1890('0x3a')]));if(_0x401d4b['query'][_0x1890('0x59')]){_0xfaa17[_0x1890('0x43')]=_[_0x1890('0x46')](_0xfaa17[_0x1890('0x43')],{'$or':_['map'](_0xfaa17[_0x1890('0x3c')],function(_0x28dad2){var _0x1394d5={};_0x1394d5[_0x28dad2]={'$like':'%'+_0x401d4b[_0x1890('0x39')][_0x1890('0x59')]+'%'};return _0x1394d5;})});}if(_0x401d4b[_0x1890('0x39')][_0x1890('0x5d')]){var _0x1463fb=_0x401d4b[_0x1890('0x39')]['$gte'][_0x1890('0x5e')](',');var _0x3c71a9={};_0x3c71a9[_0x1463fb[0x0]]={'$gte':moment(_0x1463fb[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xfaa17['where']=_['merge'](_0xfaa17['where'],_0x3c71a9);}_0xfaa17=_[_0x1890('0x46')]({},_0xfaa17,_0x401d4b[_0x1890('0x47')]);return _0x27ca71[_0x1890('0x5c')](_0xfaa17);}})['then'](function(_0x3c04b0){if(_0x3c04b0){_0x50fefa=_0x3c04b0[_0x1890('0x3e')];if(!_0x401d4b[_0x1890('0x39')][_0x1890('0x3f')](_0x1890('0x40'))){_0xfaa17[_0x1890('0x24')]=qs[_0x1890('0x24')](_0x401d4b[_0x1890('0x39')][_0x1890('0x24')]);_0xfaa17['offset']=qs[_0x1890('0x21')](_0x401d4b['query'][_0x1890('0x21')]);}return _0x27ca71[_0x1890('0x5c')](_0xfaa17);}})[_0x1890('0x2a')](function(_0x1ac353){if(_0x1ac353){return _0x1ac353?{'count':_0x50fefa,'rows':_0x1ac353}:null;}})[_0x1890('0x2a')](respondWithResult(_0x14fd32,null))[_0x1890('0x49')](handleError(_0x14fd32,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 224a880..3f8869b 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 _0x9790=['exports','events','../../mysqldb','save','update','remove','emit','hook'];(function(_0x12f934,_0x2bc2ec){var _0x3a0eb4=function(_0x382da6){while(--_0x382da6){_0x12f934['push'](_0x12f934['shift']());}};_0x3a0eb4(++_0x2bc2ec);}(_0x9790,0xc1));var _0x0979=function(_0x1d36d5,_0x261e4d){_0x1d36d5=_0x1d36d5-0x0;var _0x1c583c=_0x9790[_0x1d36d5];return _0x1c583c;};'use strict';var EventEmitter=require(_0x0979('0x0'));var ChatGroup=require(_0x0979('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0979('0x2'),'afterUpdate':_0x0979('0x3'),'afterDestroy':_0x0979('0x4')};function emitEvent(_0x4c512a){return function(_0x4316f1,_0x4f2e67,_0x16f7b8){ChatGroupEvents[_0x0979('0x5')](_0x4c512a+':'+_0x4316f1['id'],_0x4316f1);ChatGroupEvents[_0x0979('0x5')](_0x4c512a,_0x4316f1);_0x16f7b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x0979('0x6')](e,emitEvent(event));}}module[_0x0979('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x090a=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x4822ac,_0x1dc22e){var _0x3db7f4=function(_0x280e1c){while(--_0x280e1c){_0x4822ac['push'](_0x4822ac['shift']());}};_0x3db7f4(++_0x1dc22e);}(_0x090a,0x133));var _0xa090=function(_0x271a0f,_0x458d11){_0x271a0f=_0x271a0f-0x0;var _0x39ef50=_0x090a[_0x271a0f];return _0x39ef50;};'use strict';var EventEmitter=require(_0xa090('0x0'));var ChatGroup=require(_0xa090('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa090('0x2')](0x0);var events={'afterCreate':_0xa090('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3f7ae2){return function(_0x5a0530,_0x364c3b,_0x191c3a){ChatGroupEvents[_0xa090('0x4')](_0x3f7ae2+':'+_0x5a0530['id'],_0x5a0530);ChatGroupEvents[_0xa090('0x4')](_0x3f7ae2,_0x5a0530);_0x191c3a(null);};}for(var e in events){if(events[_0xa090('0x5')](e)){var event=events[e];ChatGroup[_0xa090('0x6')](e,emitEvent(event));}}module[_0xa090('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 3a82011..bb347b1 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 _0x1dfa=['../../config/logger','moment','bluebird','path','../../config/environment','./chatGroup.attributes','exports','define','lodash'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1dfa,0xb3));var _0xa1df=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x1dfa[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0xa1df('0x0'));var util=require('util');var logger=require(_0xa1df('0x1'))('api');var moment=require(_0xa1df('0x2'));var BPromise=require(_0xa1df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1df('0x4'));var rimraf=require('rimraf');var config=require(_0xa1df('0x5'));var attributes=require(_0xa1df('0x6'));module[_0xa1df('0x7')]=function(_0xb6a3e,_0x4f55d1){return _0xb6a3e[_0xa1df('0x8')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9ed=['lodash','util','../../config/logger','api','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0xb9ed,0x11e));var _0xdb9e=function(_0x389731,_0x1417b8){_0x389731=_0x389731-0x0;var _0x21b5f2=_0xb9ed[_0x389731];return _0x21b5f2;};'use strict';var _=require(_0xdb9e('0x0'));var util=require(_0xdb9e('0x1'));var logger=require(_0xdb9e('0x2'))(_0xdb9e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb9e('0x4'));var rimraf=require('rimraf');var config=require(_0xdb9e('0x5'));var attributes=require(_0xdb9e('0x6'));module[_0xdb9e('0x7')]=function(_0xf4e485,_0x6d8cd8){return _0xf4e485[_0xdb9e('0x8')](_0xdb9e('0x9'),attributes,{'tableName':_0xdb9e('0xa'),'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 7868ec2..32a6639 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 _0x548b=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x348c09,_0x539458){var _0x22d339=function(_0x3be039){while(--_0x3be039){_0x348c09['push'](_0x348c09['shift']());}};_0x22d339(++_0x539458);}(_0x548b,0x14f));var _0xb548=function(_0xb8d5b6,_0x22ab4b){_0xb8d5b6=_0xb8d5b6-0x0;var _0x4f0b2f=_0x548b[_0xb8d5b6];return _0x4f0b2f;};'use strict';var _=require(_0xb548('0x0'));var util=require('util');var moment=require(_0xb548('0x1'));var BPromise=require(_0xb548('0x2'));var rs=require(_0xb548('0x3'));var fs=require('fs');var Redis=require(_0xb548('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb548('0x5'))(_0xb548('0x6'));var config=require(_0xb548('0x7'));var jayson=require(_0xb548('0x8'));var client=jayson[_0xb548('0x9')][_0xb548('0xa')]({'port':0x232a});config[_0xb548('0xb')]=_[_0xb548('0xc')](config[_0xb548('0xb')],{'host':_0xb548('0xd'),'port':0x18eb});var socket=require(_0xb548('0xe'))(new Redis(config['redis']));require(_0xb548('0xf'))[_0xb548('0x10')](socket);function respondWithRpcPromise(_0x14d205,_0x4afd2e,_0x29c118){return new BPromise(function(_0x3d03d6,_0x4fec63){return client['request'](_0x14d205,_0x29c118)['then'](function(_0x260ecf){logger[_0xb548('0x11')](_0xb548('0x12'),_0x4afd2e,'request\x20sent');logger[_0xb548('0x13')](_0xb548('0x14'),_0x4afd2e,'request\x20sent',JSON[_0xb548('0x15')](_0x260ecf));if(_0x260ecf[_0xb548('0x16')]){if(_0x260ecf[_0xb548('0x16')]['code']===0x1f4){logger[_0xb548('0x16')](_0xb548('0x12'),_0x4afd2e,_0x260ecf[_0xb548('0x16')][_0xb548('0x17')]);return _0x4fec63(_0x260ecf[_0xb548('0x16')]['message']);}logger['error'](_0xb548('0x12'),_0x4afd2e,_0x260ecf['error']['message']);return _0x3d03d6(_0x260ecf['error'][_0xb548('0x17')]);}else{logger['info'](_0xb548('0x12'),_0x4afd2e,'request\x20sent');_0x3d03d6(_0x260ecf[_0xb548('0x18')][_0xb548('0x17')]);}})[_0xb548('0x19')](function(_0x521a3c){logger[_0xb548('0x16')](_0xb548('0x12'),_0x4afd2e,_0x521a3c);_0x4fec63(_0x521a3c);});});} \ No newline at end of file +var _0x9a22=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a22,0x75));var _0x29a2=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9a22[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x29a2('0x0'));var util=require(_0x29a2('0x1'));var moment=require(_0x29a2('0x2'));var BPromise=require(_0x29a2('0x3'));var rs=require(_0x29a2('0x4'));var fs=require('fs');var Redis=require(_0x29a2('0x5'));var db=require(_0x29a2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x29a2('0x7'));var config=require(_0x29a2('0x8'));var jayson=require(_0x29a2('0x9'));var client=jayson[_0x29a2('0xa')][_0x29a2('0xb')]({'port':0x232a});config[_0x29a2('0xc')]=_[_0x29a2('0xd')](config[_0x29a2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x29a2('0xe'))(new Redis(config[_0x29a2('0xc')]));require('./chatGroup.socket')[_0x29a2('0xf')](socket);function respondWithRpcPromise(_0x336236,_0x4bcc9c,_0x3140c7){return new BPromise(function(_0x47439a,_0x4dded3){return client[_0x29a2('0x10')](_0x336236,_0x3140c7)[_0x29a2('0x11')](function(_0x1442b6){logger[_0x29a2('0x12')](_0x29a2('0x13'),_0x4bcc9c,_0x29a2('0x14'));logger['debug'](_0x29a2('0x15'),_0x4bcc9c,_0x29a2('0x14'),JSON[_0x29a2('0x16')](_0x1442b6));if(_0x1442b6[_0x29a2('0x17')]){if(_0x1442b6[_0x29a2('0x17')][_0x29a2('0x18')]===0x1f4){logger[_0x29a2('0x17')]('ChatGroup,\x20%s,\x20%s',_0x4bcc9c,_0x1442b6[_0x29a2('0x17')][_0x29a2('0x19')]);return _0x4dded3(_0x1442b6[_0x29a2('0x17')][_0x29a2('0x19')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4bcc9c,_0x1442b6[_0x29a2('0x17')][_0x29a2('0x19')]);return _0x47439a(_0x1442b6[_0x29a2('0x17')][_0x29a2('0x19')]);}else{logger[_0x29a2('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4bcc9c,_0x29a2('0x14'));_0x47439a(_0x1442b6[_0x29a2('0x1a')]['message']);}})[_0x29a2('0x1b')](function(_0x4ca5ee){logger[_0x29a2('0x17')](_0x29a2('0x13'),_0x4bcc9c,_0x4ca5ee);_0x4dded3(_0x4ca5ee);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index a1afcec..f1e2a6e 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 _0x63bf=['chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register','length'];(function(_0x464470,_0x3439e7){var _0xae7c25=function(_0x44e58e){while(--_0x44e58e){_0x464470['push'](_0x464470['shift']());}};_0xae7c25(++_0x3439e7);}(_0x63bf,0x199));var _0xf63b=function(_0x2f0b27,_0x3e7ee2){_0x2f0b27=_0x2f0b27-0x0;var _0x2acf69=_0x63bf[_0x2f0b27];return _0x2acf69;};'use strict';var ChatGroupEvents=require(_0xf63b('0x0'));var events=['save',_0xf63b('0x1'),_0xf63b('0x2')];function createListener(_0x56f8eb,_0x29b7f8){return function(_0x22a5db){_0x29b7f8[_0xf63b('0x3')](_0x56f8eb,_0x22a5db);};}function removeListener(_0x9dfee8,_0x12912e){return function(){ChatGroupEvents[_0xf63b('0x4')](_0x9dfee8,_0x12912e);};}exports[_0xf63b('0x5')]=function(_0x14fd2e){for(var _0x333aa7=0x0,_0x5f1bb0=events[_0xf63b('0x6')];_0x333aa7<_0x5f1bb0;_0x333aa7++){var _0x51c09b=events[_0x333aa7];var _0x5421f1=createListener(_0xf63b('0x7')+_0x51c09b,_0x14fd2e);ChatGroupEvents['on'](_0x51c09b,_0x5421f1);}}; \ No newline at end of file +var _0x7fd4=['removeListener','register','length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x4853fc,_0x52cd55){var _0x23be73=function(_0x541448){while(--_0x541448){_0x4853fc['push'](_0x4853fc['shift']());}};_0x23be73(++_0x52cd55);}(_0x7fd4,0x1ec));var _0x47fd=function(_0x22cb5f,_0x2cdd63){_0x22cb5f=_0x22cb5f-0x0;var _0x274d36=_0x7fd4[_0x22cb5f];return _0x274d36;};'use strict';var ChatGroupEvents=require(_0x47fd('0x0'));var events=['save',_0x47fd('0x1'),_0x47fd('0x2')];function createListener(_0x3f73bb,_0x3fa8f7){return function(_0xf6e7a5){_0x3fa8f7[_0x47fd('0x3')](_0x3f73bb,_0xf6e7a5);};}function removeListener(_0xbe5f8d,_0x7f7d0c){return function(){ChatGroupEvents[_0x47fd('0x4')](_0xbe5f8d,_0x7f7d0c);};}exports[_0x47fd('0x5')]=function(_0x967fa3){for(var _0x282dce=0x0,_0x231744=events[_0x47fd('0x6')];_0x282dce<_0x231744;_0x282dce++){var _0x4c52c7=events[_0x282dce];var _0x5a469d=createListener(_0x47fd('0x7')+_0x4c52c7,_0x967fa3);ChatGroupEvents['on'](_0x4c52c7,_0x5a469d);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 1b12dcd..4a5611e 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 _0x2a44=['/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','delete','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/unread','getUnread'];(function(_0x203d1e,_0x2166de){var _0x4b086d=function(_0x5c1bd0){while(--_0x5c1bd0){_0x203d1e['push'](_0x203d1e['shift']());}};_0x4b086d(++_0x2166de);}(_0x2a44,0xbe));var _0x42a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2a44[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x42a4('0x0'));var util=require(_0x42a4('0x1'));var path=require(_0x42a4('0x2'));var timeout=require(_0x42a4('0x3'));var express=require(_0x42a4('0x4'));var router=express[_0x42a4('0x5')]();var fs_extra=require(_0x42a4('0x6'));var auth=require(_0x42a4('0x7'));var interaction=require(_0x42a4('0x8'));var config=require(_0x42a4('0x9'));var controller=require(_0x42a4('0xa'));router[_0x42a4('0xb')]('/',auth['isAuthenticated'](),controller[_0x42a4('0xc')]);router[_0x42a4('0xb')](_0x42a4('0xd'),auth['isAuthenticated'](),controller[_0x42a4('0xe')]);router[_0x42a4('0xb')](_0x42a4('0xf'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x11')]);router[_0x42a4('0xb')](_0x42a4('0x12'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x13')]);router[_0x42a4('0xb')](_0x42a4('0x14'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x15')]);router[_0x42a4('0xb')](_0x42a4('0x16'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x17')]);router[_0x42a4('0x18')]('/',auth['isAuthenticated'](),controller[_0x42a4('0x19')]);router[_0x42a4('0x18')](_0x42a4('0x14'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x1a')]);router['post'](_0x42a4('0x16'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x1b')]);router['put'](_0x42a4('0xf'),auth[_0x42a4('0x10')](),controller['update']);router[_0x42a4('0x1c')]('/:id',auth[_0x42a4('0x10')](),controller['destroy']);router['delete'](_0x42a4('0x14'),auth['isAuthenticated'](),controller[_0x42a4('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xe3d7=['removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','describe','get','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','create','addMembers','post','addMessage','put','update','delete'];(function(_0x7a6b9a,_0x34dbf8){var _0x52623a=function(_0x116e1b){while(--_0x116e1b){_0x7a6b9a['push'](_0x7a6b9a['shift']());}};_0x52623a(++_0x34dbf8);}(_0xe3d7,0x1d2));var _0x7e3d=function(_0x1a53a9,_0x299433){_0x1a53a9=_0x1a53a9-0x0;var _0xc06594=_0xe3d7[_0x1a53a9];return _0xc06594;};'use strict';var multer=require('multer');var util=require(_0x7e3d('0x0'));var path=require(_0x7e3d('0x1'));var timeout=require(_0x7e3d('0x2'));var express=require(_0x7e3d('0x3'));var router=express[_0x7e3d('0x4')]();var fs_extra=require(_0x7e3d('0x5'));var auth=require(_0x7e3d('0x6'));var interaction=require(_0x7e3d('0x7'));var config=require(_0x7e3d('0x8'));var controller=require(_0x7e3d('0x9'));router['get']('/',auth[_0x7e3d('0xa')](),controller['index']);router['get']('/describe',auth[_0x7e3d('0xa')](),controller[_0x7e3d('0xb')]);router[_0x7e3d('0xc')](_0x7e3d('0xd'),auth[_0x7e3d('0xa')](),controller[_0x7e3d('0xe')]);router[_0x7e3d('0xc')](_0x7e3d('0xf'),auth['isAuthenticated'](),controller[_0x7e3d('0x10')]);router[_0x7e3d('0xc')](_0x7e3d('0x11'),auth[_0x7e3d('0xa')](),controller[_0x7e3d('0x12')]);router[_0x7e3d('0xc')](_0x7e3d('0x13'),auth[_0x7e3d('0xa')](),controller['getMessages']);router['post']('/',auth[_0x7e3d('0xa')](),controller[_0x7e3d('0x14')]);router['post'](_0x7e3d('0x11'),auth['isAuthenticated'](),controller[_0x7e3d('0x15')]);router[_0x7e3d('0x16')](_0x7e3d('0x13'),auth[_0x7e3d('0xa')](),controller[_0x7e3d('0x17')]);router[_0x7e3d('0x18')](_0x7e3d('0xd'),auth[_0x7e3d('0xa')](),controller[_0x7e3d('0x19')]);router[_0x7e3d('0x1a')](_0x7e3d('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x7e3d('0x1a')](_0x7e3d('0x11'),auth[_0x7e3d('0xa')](),controller[_0x7e3d('0x1b')]);module[_0x7e3d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 502fa93..a04924e 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 _0x1619=['DATE','BOOLEAN','ENUM','star','thumb','TEXT','STRING','long'];(function(_0x42fac1,_0x38fa53){var _0x286b82=function(_0x5938e8){while(--_0x5938e8){_0x42fac1['push'](_0x42fac1['shift']());}};_0x286b82(++_0x38fa53);}(_0x1619,0x189));var _0x9161=function(_0x1e29cc,_0x4b668a){_0x1e29cc=_0x1e29cc-0x0;var _0x25fabb=_0x1619[_0x1e29cc];return _0x25fabb;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x9161('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x9161('0x1')](_0x9161('0x2'),_0x9161('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x9161('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x9161('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9161('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9161('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x9161('0x5')]},'browserVersion':{'type':Sequelize[_0x9161('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x9161('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x9161('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x9161('0x4')]},'customerIp':{'type':Sequelize[_0x9161('0x5')]},'formData':{'type':Sequelize[_0x9161('0x4')](_0x9161('0x6'))},'read1stAt':{'type':Sequelize[_0x9161('0x7')]},'lastMsgAt':{'type':Sequelize[_0x9161('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x9161('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x9161('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0x7df3=['BOOLEAN','sequelize','exports','INTEGER','star','TEXT','STRING','DATE','ENUM'];(function(_0x8389ed,_0x13b63e){var _0x4d7795=function(_0x3ed3e9){while(--_0x3ed3e9){_0x8389ed['push'](_0x8389ed['shift']());}};_0x4d7795(++_0x13b63e);}(_0x7df3,0x1cc));var _0x37df=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x7df3[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x37df('0x0'));module[_0x37df('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x37df('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x37df('0x3'),'thumb'),'defaultValue':_0x37df('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x37df('0x4')]},'mailTranscript':{'type':Sequelize[_0x37df('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x37df('0x6')]},'disposition':{'type':Sequelize[_0x37df('0x5')]},'secondDisposition':{'type':Sequelize[_0x37df('0x5')]},'thirdDisposition':{'type':Sequelize[_0x37df('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x37df('0x5')]},'osVersion':{'type':Sequelize[_0x37df('0x5')]},'deviceModel':{'type':Sequelize[_0x37df('0x5')]},'deviceVendor':{'type':Sequelize[_0x37df('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x37df('0x4')]},'customerIp':{'type':Sequelize[_0x37df('0x5')]},'formData':{'type':Sequelize[_0x37df('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x37df('0x6')]},'lastMsgAt':{'type':Sequelize[_0x37df('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x37df('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x37df('0x5')]},'customerPort':{'type':Sequelize[_0x37df('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x37df('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x37df('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 028cf6f..4b951da 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 _0xef0f=['alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','mailTranscript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','includeAgent','addTags','setTags','omit','emit','removeTags','download','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','mkdirSync','Chat','Owner','N.A.','browserName','osName','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','save','update','destroy','end','stack','name','send','render','body','contact','interaction','account','Users','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','ChatWebsiteId','sequelize','toString','count','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','keys','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','isNull','vidaooNote','follow','metadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','originalname','basename','file','filename','mimetype','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','server/files/chat/upload/','format','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias'];(function(_0x483dba,_0x1a3942){var _0x15b8c7=function(_0x514902){while(--_0x514902){_0x483dba['push'](_0x483dba['shift']());}};_0x15b8c7(++_0x1a3942);}(_0xef0f,0x168));var _0xfef0=function(_0x15beb5,_0x206a03){_0x15beb5=_0x15beb5-0x0;var _0x213c61=_0xef0f[_0x15beb5];return _0x213c61;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var pdf=require(_0xfef0('0x14'));var hardwareService=require(_0xfef0('0x15'));var logger=require(_0xfef0('0x16'))(_0xfef0('0x17'));var utils=require(_0xfef0('0x18'));var config=require(_0xfef0('0x19'));var licenseUtil=require(_0xfef0('0x1a'));var db=require('../../mysqldb')['db'];config[_0xfef0('0x1b')]=_[_0xfef0('0x1c')](config[_0xfef0('0x1b')],{'host':_0xfef0('0x1d'),'port':0x18eb});var socket=require(_0xfef0('0x1e'))(new Redis(config[_0xfef0('0x1b')]));require(_0xfef0('0x1f'))['register'](socket);var jayson=require(_0xfef0('0x20'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0xfef0('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x284b6d,_0x3510a7,_0x1bce2f,_0x2a96d9){return new BPromise(function(_0x3f9a6c,_0x155833){var _0x2887e6=_0x2a96d9||client;return _0x2887e6['request'](_0x284b6d,_0x1bce2f)[_0xfef0('0x22')](function(_0x1642cd){logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));logger['debug'](_0xfef0('0x26'),_0x3510a7,'request\x20sent',JSON[_0xfef0('0x27')](_0x1642cd));if(_0x1642cd[_0xfef0('0x28')]){if(_0x1642cd[_0xfef0('0x28')]['code']===0x1f4){logger[_0xfef0('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x3510a7,_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);return _0x155833(_0x1642cd['error']['message']);}logger['error'](_0xfef0('0x24'),_0x3510a7,_0x1642cd['error'][_0xfef0('0x29')]);return _0x3f9a6c(_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);}else{logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));_0x3f9a6c(_0x1642cd['result']['message']);}})[_0xfef0('0x2a')](function(_0x1ffaa4){logger[_0xfef0('0x28')](_0xfef0('0x24'),_0x3510a7,_0x1ffaa4);_0x155833(_0x1ffaa4);});});}function respondWithStatusCode(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0xcc;return function(_0x5df04f){if(_0x5df04f){return _0xab231c[_0xfef0('0x2b')](_0xf60f2);}return _0xab231c[_0xfef0('0x2c')](_0xf60f2)['end']();};}function respondWithResult(_0x1a6758,_0x394bad){_0x394bad=_0x394bad||0xc8;return function(_0xca0cce){if(_0xca0cce){return _0x1a6758[_0xfef0('0x2c')](_0x394bad)[_0xfef0('0x2d')](_0xca0cce);}};}function respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c){return function(_0x3e026a){if(_0x3e026a){var _0x26cb9a=typeof _0x3e3c4c[_0xfef0('0x2e')]===_0xfef0('0x2f')&&typeof _0x3e3c4c[_0xfef0('0x30')]==='undefined';var _0x445625=_0x3e026a['count'];var _0x4eaf74=_0x26cb9a?0x0:_0x3e3c4c[_0xfef0('0x2e')];var _0x2ae54a=_0x26cb9a?_0x3e026a['count']:_0x3e3c4c['offset']+_0x3e3c4c['limit'];var _0x4f65cd;if(_0x2ae54a>=_0x445625){_0x2ae54a=_0x445625;_0x4f65cd=0xc8;}else{_0x4f65cd=0xce;}_0x1ac4a3['status'](_0x4f65cd);return _0x1ac4a3[_0xfef0('0x31')](_0xfef0('0x32'),_0x4eaf74+'-'+_0x2ae54a+'/'+_0x445625)[_0xfef0('0x2d')](_0x3e026a);}return null;};}function patchUpdates(_0x5cda6b){return function(_0x4d0778){try{jsonpatch['apply'](_0x4d0778,_0x5cda6b,!![]);}catch(_0x1f8110){return BPromise['reject'](_0x1f8110);}return _0x4d0778[_0xfef0('0x33')]();};}function saveUpdates(_0x3783f9,_0x1b9f39){return function(_0x4a2773){if(_0x4a2773){return _0x4a2773[_0xfef0('0x34')](_0x3783f9)['then'](function(_0x4234e4){return _0x4234e4;});}return null;};}function removeEntity(_0x1f21b7,_0x234d49){return function(_0xe5188e){if(_0xe5188e){return _0xe5188e[_0xfef0('0x35')]()[_0xfef0('0x22')](function(){_0x1f21b7[_0xfef0('0x2c')](0xcc)[_0xfef0('0x36')]();});}};}function handleEntityNotFound(_0x590e37,_0x24ea7c){return function(_0xea09ec){if(!_0xea09ec){_0x590e37[_0xfef0('0x2b')](0x194);}return _0xea09ec;};}function handleError(_0x36b2d1,_0xae697){_0xae697=_0xae697||0x1f4;return function(_0x262341){logger[_0xfef0('0x28')](_0x262341[_0xfef0('0x37')]);if(_0x262341[_0xfef0('0x38')]){delete _0x262341[_0xfef0('0x38')];}_0x36b2d1[_0xfef0('0x2c')](_0xae697)[_0xfef0('0x39')](_0x262341);};}function getMustacheRender(_0x366667,_0x4a8af4){return Mustache[_0xfef0('0x3a')](_0x366667,_['merge'](_0x4a8af4[_0xfef0('0x3b')],{'contact':_0x4a8af4[_0xfef0('0x3c')],'message':_0x4a8af4[_0xfef0('0x29')],'agent':_0x4a8af4['agent'],'interaction':_0x4a8af4[_0xfef0('0x3d')],'account':_0x4a8af4[_0xfef0('0x3e')]}))||'';}function getInteractionUsers(_0x3f2753,_0x5537c8){return new BPromise(function(_0x8613a0,_0x3abcc5){try{if(_0x5537c8[_0x3f2753['id']]){_0x3f2753[_0xfef0('0x3f')]=_['map'](_0x5537c8[_0x3f2753['id']],function(_0x3a6667){return{'id':_0x3a6667['id'],'fullname':_0x3a6667['fullname']};});}}catch(_0x49ed48){_0x3abcc5(_0x49ed48);}_0x8613a0(_0x3f2753);});}function getInteractionTags(_0xf30aff,_0x547a5d){return new BPromise(function(_0x5c3305,_0xbf6ddd){try{if(_0xf30aff[_0xfef0('0x40')]){_0xf30aff[_0xfef0('0x41')]=[];_0xf30aff[_0xfef0('0x40')][_0xfef0('0x42')](',')[_0xfef0('0x43')](function(_0x4dd8f8){_0xf30aff[_0xfef0('0x41')][_0xfef0('0x44')](_0x547a5d[_0x4dd8f8]);});}delete _0xf30aff['TagIds'];}catch(_0x54d5cb){_0xbf6ddd(_0x54d5cb);}_0x5c3305(_0xf30aff);});}function updateChatInteraction(_0x1d554e,_0x5dc824,_0x1fc518){return new BPromise(function(_0x22c940,_0x3c100c){return getInteractionUsers(_0x1d554e,_0x1fc518)[_0xfef0('0x22')](function(_0x199c57){return getInteractionTags(_0x199c57,_0x5dc824);})[_0xfef0('0x22')](function(_0x166a7b){_0x22c940(_0x166a7b);})[_0xfef0('0x2a')](function(_0x4e63f3){_0x3c100c(_0x4e63f3);});});}exports[_0xfef0('0x45')]=function(_0x50e372,_0x4b6da1){var _0x18c656={},_0x17d7f2={},_0x5bf416={'count':0x0,'rows':[]};var _0x2af79f=_['map'](db[_0xfef0('0x46')][_0xfef0('0x47')],function(_0x1f252e){return{'name':_0x1f252e[_0xfef0('0x48')],'type':_0x1f252e['type'][_0xfef0('0x49')]};});_0x17d7f2[_0xfef0('0x4a')]=_['map'](_0x2af79f,'name');_0x17d7f2[_0xfef0('0x4b')]=_['keys'](_0x50e372[_0xfef0('0x4b')]);_0x17d7f2[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x17d7f2[_0xfef0('0x4a')],_0x17d7f2[_0xfef0('0x4b')]);_0x18c656[_0xfef0('0x4e')]=_['intersection'](_0x17d7f2[_0xfef0('0x4a')],qs['fields'](_0x50e372['query'][_0xfef0('0x4f')]));_0x18c656[_0xfef0('0x4e')]=_0x18c656[_0xfef0('0x4e')]['length']?_0x18c656[_0xfef0('0x4e')]:_0x17d7f2['model'];if(!_0x50e372['query']['hasOwnProperty'](_0xfef0('0x50'))){_0x18c656[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x18c656[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x18c656['order']=qs['sort'](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x18c656[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x50e372[_0xfef0('0x4b')],_0x17d7f2[_0xfef0('0x4c')]),_0x2af79f);var _0x20b647=[];var _0x5e989f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')]('id')[_0xfef0('0x55')](_0xfef0('0x38'))[_0xfef0('0x55')]('color')['from']('tools_tags');var _0x445f3f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')](_0xfef0('0x56'))['field'](_0xfef0('0x57'))[_0xfef0('0x55')](_0xfef0('0x58'))[_0xfef0('0x59')](_0xfef0('0x5a'),'ui')[_0xfef0('0x5b')](_0xfef0('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x3458b0=squel[_0xfef0('0x54')]()['from'](_0xfef0('0x5d'),'i')['left_join'](_0xfef0('0x5e'),'c',_0xfef0('0x5f'))['left_join'](_0xfef0('0x5c'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0xfef0('0x60'))[_0xfef0('0x5b')](_0xfef0('0x61'),'me',_0xfef0('0x62'))[_0xfef0('0x5b')](_0xfef0('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xfef0('0x5b')](_0xfef0('0x64'),'t',_0xfef0('0x65'));var _0x45abb3=squel[_0xfef0('0x66')]();var _0x58d95e=[];var _0x59d1b6=squel['expr']();var _0x135653;if(_0x50e372['query'][_0xfef0('0x67')]){_0x135653=as[_0xfef0('0x68')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x67')]);var _0xd0255c=_0x135653['sqlOperator'];for(var _0x2abdb7=0x0;_0x2abdb7<_0x135653['conditions'][_0xfef0('0x69')];_0x2abdb7++){var _0x4a1316=_0x135653['conditions'][_0x2abdb7];var _0x3a12c5='i';var _0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0x4a1316[_0xfef0('0x55')]]);if(!_0x3c5640){switch(_0x4a1316[_0xfef0('0x55')]){case _0xfef0('0x6b'):if(_0x4a1316[_0xfef0('0x6c')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316[_0xfef0('0x55')]+_0xfef0('0x6e'));}else{_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316['field']+_0xfef0('0x6f'));}break;case _0xfef0('0x70'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){if(_0x4a1316[_0xfef0('0x6c')]['split']('\x20')[_0xfef0('0x69')]>0x1){_0x45abb3[_0xd0255c](_0xfef0('0x73'),qs[_0xfef0('0x74')](_0x4a1316[_0xfef0('0x6c')]),null);}else{var _0x176fc7='%'+_0x4a1316[_0xfef0('0x6c')]+'%';_0x45abb3[_0xd0255c](_0xfef0('0x75'),_0x176fc7,_0x176fc7,_0x176fc7);}}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x76')]);_0x4a1316['field']=_0xfef0('0x76');_0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640[_0xfef0('0x77')],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf['value'][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);}break;case _0xfef0('0x7a'):var _0x1e0ad5=_0x4a1316['value'][_0xfef0('0x42')](',')[_0xfef0('0x7b')](function(_0x2ccb33){return Number(_0x2ccb33);});_0x1e0ad5['forEach'](function(_0x117b74){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x117b74+',%');});_0x58d95e=_[_0xfef0('0x7d')](_0x58d95e,_0x1e0ad5);break;case _0xfef0('0x7e'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){_0x45abb3[_0xd0255c](_0xfef0('0x7f'),'%'+_0x4a1316['value']+'%',null);}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x80')]);_0x4a1316[_0xfef0('0x55')]=_0xfef0('0x80');_0x1d7caf=as[_0xfef0('0x81')](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}break;case _0xfef0('0x3b'):_0x1d7caf=as[_0xfef0('0x81')]('me',null,_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);break;}}else{var _0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}}}else{var _0x24229e=_(_0x50e372['query'])['keys']()['map'](function(_0x2a92de){return _[_0xfef0('0x82')](_0x2af79f,['name',_0x2a92de])?_0x2a92de:undefined;})[_0xfef0('0x83')]()[_0xfef0('0x6c')]();if(!_[_0xfef0('0x84')](_0x24229e)){_0x24229e['forEach'](function(_0x3f2b55){if(_0x3f2b55==='ChatWebsiteId'){_0x3458b0['where'](_0xfef0('0x85'),[][_0xfef0('0x86')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55]));}else if(_0x3f2b55===_0xfef0('0x87')){var _0x4df63b=JSON['parse'](_0x50e372['query'][_0x3f2b55])[_0xfef0('0x88')];var _0x546455=JSON[_0xfef0('0x89')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55])[_0xfef0('0x8a')];_0x3458b0[_0xfef0('0x52')](_0xfef0('0x8b'),_0x4df63b,_0x546455);}else{if(_0x50e372['query'][_0x3f2b55]===_0xfef0('0x8c')){_0x3458b0['where']('i.'+_0x3f2b55+'\x20IS\x20NULL');}else{_0x3458b0[_0xfef0('0x52')]('i.'+_0x3f2b55+_0xfef0('0x8d'),_0x50e372[_0xfef0('0x4b')][_0x3f2b55]);}}});}if(_0x50e372[_0xfef0('0x4b')]['read']){if(_0x50e372['query'][_0xfef0('0x8e')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`unreadMessages`\x20=\x200');}else{_0x3458b0[_0xfef0('0x6d')](_0xfef0('0x8f'));}}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]){_0x58d95e=_[_0xfef0('0x91')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')])?_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]:new Array(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]);_0x58d95e[_0xfef0('0x43')](function(_0x3c1136){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x3c1136+',%');});}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x92')]){var _0x1a61e4=_0x50e372['query'][_0xfef0('0x92')][_0xfef0('0x93')]('\x5c','\x5c\x5c')[_0xfef0('0x93')](/'/g,'\x27\x27');if(qs[_0xfef0('0x94')](_0x1a61e4)){_0x45abb3['or'](_0xfef0('0x95'),_0x1a61e4+'%');}else{_0x45abb3['or'](_0xfef0('0x96'),qs[_0xfef0('0x74')](_0x1a61e4))['or'](_0xfef0('0x97'),_0x1a61e4+'%');}}}_0x3458b0[_0xfef0('0x52')](_0x45abb3);_0x3458b0[_0xfef0('0x98')](_0xfef0('0x99'));var _0x17c350={'type':db[_0xfef0('0x9a')]['QueryTypes'][_0xfef0('0x9b')],'raw':!![]};var _0x56af65=_0x3458b0['clone']();_0x56af65[_0xfef0('0x55')](_0xfef0('0x99'));_0x56af65['field'](_0xfef0('0x9c'),'unreadMessages');if(_0x18c656['order']){_0x18c656[_0xfef0('0x9d')][_0xfef0('0x43')](function(_0x4ebcf){var _0x437cb2=_0x4ebcf[0x0]==='contactName'?_0x4ebcf[0x0]:'i.'+_0x4ebcf[0x0];_0x3458b0[_0xfef0('0x9d')](_0x437cb2,_0x4ebcf[0x1]===_0xfef0('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x58d95e)){_0x3458b0[_0xfef0('0x6d')](_0x59d1b6);_0x56af65[_0xfef0('0x52')](_0xfef0('0x9f'),_0x58d95e);}BPromise['resolve']()['then'](function(){if(!_0x135653){if(_0x50e372[_0xfef0('0x4b')]['ChatWebsiteId'])return;_0x56af65['where'](_0xfef0('0xa0'));_0x3458b0['where'](_0xfef0('0xa0'));return;}if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]!==_0xfef0('0xa3'))return;return _0x50e372[_0xfef0('0xa1')][_0xfef0('0xa4')]({'attributes':['id'],'raw':!![]})[_0xfef0('0x22')](function(_0x28cc77){if(_[_0xfef0('0x84')](_0x28cc77)){_0x56af65[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');_0x3458b0[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x56af65['where'](_0xfef0('0x85'),_['map'](_0x28cc77,'id'));_0x3458b0[_0xfef0('0x52')](_0xfef0('0x85'),_[_0xfef0('0x7b')](_0x28cc77,'id'));}});})[_0xfef0('0x22')](function(){if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]==='agent'&&!_0x135653&&!_0x50e372[_0xfef0('0x4b')][_0xfef0('0xa5')])return[];return db[_0xfef0('0xa6')][_0xfef0('0x4b')](_0x56af65[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x3cc27e){_0x5bf416[_0xfef0('0xa8')]=_0x3cc27e['length'];if(_0x5bf416[_0xfef0('0xa8')]===0x0)return[];return db[_0xfef0('0xa6')]['query'](_0x5e989f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x221b17){_0x20b647=_['keyBy'](_0x221b17,'id');_0x17c350=_[_0xfef0('0xa9')](_0x17c350,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x4f')]){_0x18c656['attributes'][_0xfef0('0x43')](function(_0x51f79b){_0x3458b0[_0xfef0('0x55')]('i.'+_0x51f79b);});}else{_0x3458b0[_0xfef0('0x55')](_0xfef0('0x9c'),_0xfef0('0x6b'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xaa'),_0xfef0('0xab'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xac'),_0xfef0('0xad'));_0x3458b0[_0xfef0('0x55')]('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',_0xfef0('0xae'));_0x3458b0['field']('i.*');_0x3458b0[_0xfef0('0x55')]('c.firstName',_0xfef0('0xaf'));_0x3458b0['field']('c.lastName',_0xfef0('0xb0'));_0x3458b0['field']('c.email','Contact.email');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb1'),_0xfef0('0xb2'));_0x3458b0[_0xfef0('0x55')]('c.mobile',_0xfef0('0xb3'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb4'),_0xfef0('0xb5'));_0x3458b0[_0xfef0('0x55')]('o.fullname','Owner.fullname');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb6'),'Owner.internal');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb7'),_0xfef0('0x40'));}if(_0x18c656[_0xfef0('0x30')])_0x3458b0[_0xfef0('0x30')](_0x18c656[_0xfef0('0x30')]);if(_0x18c656[_0xfef0('0x2e')])_0x3458b0[_0xfef0('0x2e')](_0x18c656['offset']);return db['sequelize'][_0xfef0('0x4b')](_0x3458b0[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x475eb7){if(_0x475eb7[_0xfef0('0x69')]>0x0)_0x445f3f[_0xfef0('0x52')](_0xfef0('0xb8'),_[_0xfef0('0x7b')](_0x475eb7,'id'));return db['sequelize']['query'](_0x445f3f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x374877){var _0xd780bb=_[_0xfef0('0xb9')](_0x374877,_0xfef0('0xba'));var _0x5ac2df=[];_0x475eb7[_0xfef0('0x43')](function(_0x1060c2){_0x5ac2df['push'](updateChatInteraction(_0x1060c2,_0x20b647,_0xd780bb));});return BPromise[_0xfef0('0xbb')](_0x5ac2df);});});})[_0xfef0('0x22')](function(_0x36873f){_0x5bf416[_0xfef0('0xbc')]=_0x36873f;return _0x5bf416;})[_0xfef0('0x22')](respondWithFilteredResult(_0x4b6da1,_0x18c656))[_0xfef0('0x2a')](handleError(_0x4b6da1,null));};exports['show']=function(_0x4dd6e8,_0x1084b9){var _0xd7c5b={'raw':![],'where':{'id':_0x4dd6e8[_0xfef0('0xbd')]['id']}},_0xd2c0be={};_0xd2c0be[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatInteraction'][_0xfef0('0x47')]);_0xd2c0be['query']=_[_0xfef0('0xbe')](_0x4dd6e8['query']);_0xd2c0be[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],_0xd2c0be[_0xfef0('0x4b')]);_0xd7c5b[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],qs['fields'](_0x4dd6e8['query'][_0xfef0('0x4f')]));_0xd7c5b['attributes']=_0xd7c5b[_0xfef0('0x4e')][_0xfef0('0x69')]?_0xd7c5b['attributes']:_0xd2c0be[_0xfef0('0x4a')];if(_0x4dd6e8['query'][_0xfef0('0xbf')]){_0xd7c5b[_0xfef0('0xc0')]=[{'all':!![]}];}_0xd7c5b=_[_0xfef0('0xa9')]({},_0xd7c5b,_0x4dd6e8[_0xfef0('0xc1')]);return db[_0xfef0('0x46')][_0xfef0('0x6a')](_0xd7c5b)[_0xfef0('0x22')](handleEntityNotFound(_0x1084b9,null))['then'](respondWithResult(_0x1084b9,null))[_0xfef0('0x2a')](handleError(_0x1084b9,null));};exports[_0xfef0('0xc2')]=function(_0x38f96f,_0x1bdf18){return db[_0xfef0('0x46')][_0xfef0('0xc2')](_0x38f96f[_0xfef0('0x3b')],{})[_0xfef0('0x22')](respondWithResult(_0x1bdf18,0xc9))[_0xfef0('0x2a')](handleError(_0x1bdf18,null));};exports[_0xfef0('0x34')]=function(_0x2a25cb,_0x34f1db){if(_0x2a25cb[_0xfef0('0x3b')]['id']){delete _0x2a25cb[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a25cb[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x34f1db,null))[_0xfef0('0x22')](saveUpdates(_0x2a25cb[_0xfef0('0x3b')],null))[_0xfef0('0x22')](respondWithResult(_0x34f1db,null))[_0xfef0('0x2a')](handleError(_0x34f1db,null));};exports[_0xfef0('0x35')]=function(_0x191072,_0x5b5a15){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x191072['params']['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x5b5a15,null))[_0xfef0('0x22')](removeEntity(_0x5b5a15,null))[_0xfef0('0x2a')](handleError(_0x5b5a15,null));};exports[_0xfef0('0xc3')]=function(_0xd9c290,_0x365938){return db[_0xfef0('0x46')][_0xfef0('0xc3')]()[_0xfef0('0x22')](respondWithResult(_0x365938,null))[_0xfef0('0x2a')](handleError(_0x365938,null));};exports[_0xfef0('0xc4')]=function(_0x4c6ddd,_0x17ac08){var _0x40afcb=_0x4c6ddd['params']['id'];var _0xaa5902;var _0x189964;var _0x524db7;return db[_0xfef0('0x46')]['findOne']({'where':{'id':_0x40afcb}})[_0xfef0('0x22')](function(_0x41aadf){_0xaa5902=_0x41aadf;return db[_0xfef0('0xc5')][_0xfef0('0xc6')]({'where':{'id':_0x41aadf[_0xfef0('0xa5')]},'attributes':['id','vidaooApiKey',_0xfef0('0xc7'),_0xfef0('0xc8'),'vidaooNote',_0xfef0('0xc9')],'raw':!![]});})['then'](function(_0x3a180e){if(_0x3a180e&&_0x3a180e[_0xfef0('0xca')]&&_0x3a180e[_0xfef0('0xc7')]){_0x189964=_0x3a180e;var _0x52fb8b={'interaction':{'id':_0x40afcb},'agent':{'id':_0x4c6ddd[_0xfef0('0xa1')]['id'],'name':_0x4c6ddd['user']['name'],'fullname':_0x4c6ddd[_0xfef0('0xa1')]['fullname'],'email':_0x4c6ddd[_0xfef0('0xa1')][_0xfef0('0xcb')]},'contact':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3c')],'account':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3e')]};var _0x7f9b61={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3a180e[_0xfef0('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4c6ddd['user'][_0xfef0('0xcb')]],'buttons':null,'topic':_0x189964[_0xfef0('0xc8')],'note':_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xcd')])?null:getMustacheRender(_0x189964[_0xfef0('0xcd')],_0x52fb8b),'metadata':null},'redirect':_0xfef0('0xce'),'json':!![]};try{if(!_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xc9')])){var _0x4a3b68=getMustacheRender(_0x189964['vidaooMetadata'],_0x52fb8b);var _0x3c5471=JSON[_0xfef0('0x89')](_0x4a3b68);_0x7f9b61[_0xfef0('0x3b')][_0xfef0('0xcf')]=_0x3c5471;}}catch(_0xdbd7f2){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x7f9b61);}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xfef0('0x22')](function(_0x4f171b){_0x524db7=_0x4f171b;if(_0x524db7['id']){var _0x236523={'body':_0x524db7[_0xfef0('0xd1')],'ChatWebsiteId':_0x189964['id'],'ChatInteractionId':_0xaa5902['id'],'direction':_0xfef0('0xd2'),'UserId':_0x4c6ddd[_0xfef0('0xa1')]['id']};return db[_0xfef0('0xd3')][_0xfef0('0xc2')](_0x236523,{});}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd4'));}})[_0xfef0('0x22')](function(){return _0xaa5902[_0xfef0('0xd5')]({'vidaooSessionId':_0x524db7['id']});})['then'](respondWithResult(_0x17ac08,null))[_0xfef0('0x2a')](handleError(_0x17ac08,null));};exports['customUpdate']=function(_0xf763b1,_0x1fc6a0){if(_0xf763b1[_0xfef0('0x3b')]['id']){delete _0xf763b1[_0xfef0('0x3b')]['id'];}return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0xf763b1[_0xfef0('0xbd')]['id']},'include':[{'model':db[_0xfef0('0xd6')],'as':_0xfef0('0x70')}]})['then'](handleEntityNotFound(_0x1fc6a0,null))['then'](saveUpdates(_0xf763b1[_0xfef0('0x3b')],null))['then'](respondWithResult(_0x1fc6a0,null))[_0xfef0('0x2a')](handleError(_0x1fc6a0,null));};exports[_0xfef0('0xd7')]=function(_0x45049d,_0x238112,_0x3a7c93){if(_0x45049d['body']['id']){delete _0x45049d[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x45049d[_0xfef0('0xbd')]['id']}})['then'](function(_0x34bcc3){if(!_0x34bcc3){logger['error'](_0xfef0('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x238112[_0xfef0('0x2b')](0x194);}else{if(_0x34bcc3['UserId']){throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd9'));}}return _0x34bcc3;})['then'](function(_0x5c7b35){if(_0x5c7b35){return _0x5c7b35[_0xfef0('0x34')]({'closed':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xda')],'disposition':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xdb')]})[_0xfef0('0x22')](function(_0x3107e2){return _0x3107e2;});}})[_0xfef0('0x22')](function(_0x325d36){return respondWithRpcPromise('AbandonInteraction',_0xfef0('0xd7'),_0x45049d[_0xfef0('0x3b')],client9004);})[_0xfef0('0x22')](respondWithResult(_0x238112,null))[_0xfef0('0x2a')](handleError(_0x238112,null));};exports[_0xfef0('0xdc')]=function(_0xb1df6f,_0x42604b,_0x5969d2){_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0x38')]=_0xb1df6f['file'][_0xfef0('0xdd')];_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0xde')]=_0xb1df6f[_0xfef0('0xdf')][_0xfef0('0xe0')];_0xb1df6f['body'][_0xfef0('0x77')]=_0xb1df6f['file'][_0xfef0('0xe1')];return db['Attachment']['create'](_0xb1df6f['body'])[_0xfef0('0x22')](respondWithResult(_0x42604b,0xc9))['catch'](handleError(_0x42604b,null));};exports['attachmentDownload']=function(_0x25fed0,_0x43453b,_0x4da5b0){return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0[_0xfef0('0xbd')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43453b,null))['then'](function(_0x39a2a7){if(_0x39a2a7){if(_0x39a2a7[_0xfef0('0xda')]){return _0x43453b[_0xfef0('0x2c')](0x193)[_0xfef0('0x2d')]({'status':0x193,'message':_0xfef0('0xe2')});}return db[_0xfef0('0xe3')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0['query'][_0xfef0('0xe4')]},'raw':!![]})[_0xfef0('0x22')](handleEntityNotFound(_0x43453b,null));}})[_0xfef0('0x22')](function(_0x4544fe){if(_0x4544fe){var _0x5c0f32=_0x4544fe['ChatOfflineMessageId']!==null;var _0x461c91=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe7'));if(_0x5c0f32){_0x461c91=path[_0xfef0('0xe5')](_0x461c91,_0xfef0('0xe8'));}var _0xe24c2d=path['join'](_0x461c91,_0x4544fe['basename']);return _0x43453b['download'](_0xe24c2d);}})[_0xfef0('0x2a')](handleError(_0x43453b,null));};exports['close']=function(_0x38ac84,_0x4a1406){var _0x2daf2a=null;var _0x4f703e=null;var _0x20cf67=null;var _0x235122=null;if(_0x38ac84[_0xfef0('0x3b')]['id']){delete _0x38ac84[_0xfef0('0x3b')]['id'];}if(_0x38ac84[_0xfef0('0x3b')]['mailTranscript']){_0x235122=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe9'),util[_0xfef0('0xea')]('transcript-%s.txt',Date[_0xfef0('0xeb')]()));_0x38ac84['body']['pathTranscript']=_0x235122;}return db[_0xfef0('0x46')]['find']({'where':{'id':_0x38ac84['params']['id']},'include':[{'model':db[_0xfef0('0xd3')],'as':'Messages','include':[{'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e')}]}]})[_0xfef0('0x22')](handleEntityNotFound(_0x4a1406,null))[_0xfef0('0x22')](saveUpdates(_0x38ac84[_0xfef0('0x3b')],null))[_0xfef0('0x22')](function(_0x4f6c50){if(_0x4f6c50){_0x2daf2a=_0x4f6c50;return db[_0xfef0('0xc5')][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0xa5')]}});}})['then'](function(_0x3ac462){if(_0x3ac462){_0x20cf67=_0x3ac462;return db['CmContact'][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0x76')]}});}})[_0xfef0('0x22')](function(_0x5ef687){if(_0x5ef687){_0x4f703e=_0x5ef687;if(_0x235122){var _0x906e55=null;for(var _0x4cec7d=0x1;_0x4cec7d<_0x2daf2a['Messages'][_0xfef0('0x69')];++_0x4cec7d){_0x906e55=_0x2daf2a[_0xfef0('0xec')][_0x4cec7d];var _0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');var _0x484cc3=_0x38ac84[_0xfef0('0x3b')][_0xfef0('0xf0')]||util[_0xfef0('0xea')](_0xfef0('0xed'),_0xfef0('0xf1'),_0x906e55[_0xfef0('0x76')]);switch(_0x20cf67[_0xfef0('0xf2')]){case _0xfef0('0xf3'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util['format'](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');break;case'agent_alias':_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf4')]||_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf5')]:'System';break;case _0xfef0('0xf6'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')]['fullname']:'System';break;default:_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');}var _0x4b4986=util[_0xfef0('0xea')](_0xfef0('0xf7'),moment(_0x906e55[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0xf8')),_0x906e55['direction']==='in'?_0x484cc3:_0x58a4ef,_0x906e55[_0xfef0('0x3b')]);if(!_0x906e55[_0xfef0('0xf9')]){fs[_0xfef0('0xfa')](_0x235122,_0x4b4986);}}return db[_0xfef0('0xfb')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfef0('0xfc')],'as':'Smtp','raw':!![]}]});}}})[_0xfef0('0x22')](function(_0x402c7d){if(_0x402c7d&&_0x402c7d[_0xfef0('0xfd')]&&_0x38ac84[_0xfef0('0x3b')]){var _0x5315eb={'tls':{'rejectUnauthorized':![]}};if(_0x402c7d['Smtp'][_0xfef0('0xfe')]){_0x5315eb[_0xfef0('0xfe')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xfe')];}else{_0x5315eb[_0xfef0('0xff')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xff')];_0x5315eb['port']=_0x402c7d['Smtp'][_0xfef0('0x100')];_0x5315eb[_0xfef0('0x101')]=_0x402c7d['Smtp'][_0xfef0('0x101')];}if(_0x402c7d['Smtp']['authentication']){_0x5315eb[_0xfef0('0x102')]={'user':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xa1')],'pass':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0x103')]};}return respondWithRpcPromise('SendMail',_0xfef0('0x104'),{'account':_0x5315eb,'message':{'from':util[_0xfef0('0xea')](_0xfef0('0x105'),_0x402c7d[_0xfef0('0x38')],_0x402c7d['email']||_0x402c7d['Smtp']['user']),'to':_0x38ac84[_0xfef0('0x3b')]['mailTranscript'],'subject':_0xfef0('0x106'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x38ac84['body'][_0xfef0('0x107')]),'attachments':[{'path':_0x235122}]}})[_0xfef0('0x22')](function(){return _0x2daf2a;})['catch'](function(_0x411870){console['error'](_0x411870);});}else{return _0x2daf2a;}})[_0xfef0('0x22')](respondWithStatusCode(_0x4a1406,0xc8))[_0xfef0('0x2a')](handleError(_0x4a1406,null));};exports[_0xfef0('0x108')]=function(_0x9b2969,_0x1f842f,_0x36c978){return db[_0xfef0('0xd3')][_0xfef0('0x6a')]({'where':{'id':_0x9b2969[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1f842f,null))['then'](function(_0x1d342a){if(_0x1d342a){return _0x1d342a[_0xfef0('0x108')](_0x9b2969['body'][_0xfef0('0x109')],_['omit'](_0x9b2969[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{});}})[_0xfef0('0x22')](respondWithResult(_0x1f842f,null))[_0xfef0('0x2a')](handleError(_0x1f842f,null));};exports[_0xfef0('0x10a')]=function(_0x422af1,_0xcb9eb8,_0x38e829){var _0x287403={'raw':![],'where':{}};var _0x2ebd8d={};var _0x115454={'count':0x0,'rows':[]};return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x422af1[_0xfef0('0xbd')]['id']}})['then'](handleEntityNotFound(_0xcb9eb8,null))[_0xfef0('0x22')](function(_0x5593de){if(_0x5593de){_0x2ebd8d['model']=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2ebd8d[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x422af1['query']);_0x2ebd8d[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],_0x2ebd8d[_0xfef0('0x4b')]);_0x287403[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x287403[_0xfef0('0x4e')]=_0x287403[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x287403[_0xfef0('0x4e')]:_0x2ebd8d['model'];if(!_0x422af1[_0xfef0('0x4b')]['hasOwnProperty'](_0xfef0('0x50'))){_0x287403['limit']=qs[_0xfef0('0x30')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x287403[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x422af1['query']['offset']);}_0x287403[_0xfef0('0x9d')]=qs[_0xfef0('0x51')](_0x422af1['query'][_0xfef0('0x51')]);_0x287403[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x422af1[_0xfef0('0x4b')],_0x2ebd8d[_0xfef0('0x4c')]));_0x287403[_0xfef0('0x52')][_0xfef0('0xba')]=_0x5593de['id'];if(_0x422af1['query'][_0xfef0('0x92')]){_0x287403[_0xfef0('0x52')]=_['merge'](_0x287403[_0xfef0('0x52')],{'$or':_['map'](_0x287403[_0xfef0('0x4e')],function(_0x41790c){var _0x189965={};_0x189965[_0x41790c]={'$like':'%'+_0x422af1[_0xfef0('0x4b')][_0xfef0('0x92')]+'%'};return _0x189965;})});}if(_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]){var _0x5b1b34=_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]['split'](',');var _0xfa83e1={};_0xfa83e1[_0x5b1b34[0x0]]={'$gte':moment(_0x5b1b34[0x1])[_0xfef0('0xea')](_0xfef0('0x10b'))};_0x287403['where']=_[_0xfef0('0xa9')](_0x287403[_0xfef0('0x52')],_0xfa83e1);}_0x287403=_[_0xfef0('0xa9')]({},_0x287403,_0x422af1[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')][_0xfef0('0xa8')]({'where':_0x287403[_0xfef0('0x52')]})[_0xfef0('0x22')](function(_0x464d00){_0x115454[_0xfef0('0xa8')]=_0x464d00;if(_0x422af1['query'][_0xfef0('0xbf')]){_0x287403[_0xfef0('0xc0')]=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x287403);})[_0xfef0('0x22')](function(_0x1b23f0){_0x115454['rows']=_0x1b23f0;return _0x115454;});}})['then'](respondWithFilteredResult(_0xcb9eb8,_0x287403))[_0xfef0('0x2a')](handleError(_0xcb9eb8,null));};exports['getMyMessages']=function(_0x30f7d5,_0x1a53fa,_0x14a37e){var _0x303128={'where':{}},_0x2b3263={},_0x43e758={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfef0('0xc6')]({'where':{'id':_0x30f7d5[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1a53fa,null))[_0xfef0('0x22')](function(_0x273e8b){if(_0x273e8b){_0x2b3263[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2b3263[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x30f7d5[_0xfef0('0x4b')]);_0x2b3263[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2b3263['model'],_0x2b3263['query']);_0x303128[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2b3263[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x303128[_0xfef0('0x4e')]=_0x303128[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x303128[_0xfef0('0x4e')]:_0x2b3263[_0xfef0('0x4a')];if(!_0x30f7d5['query'][_0xfef0('0x10d')](_0xfef0('0x50'))){_0x303128[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x303128['offset']=qs[_0xfef0('0x2e')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x303128[_0xfef0('0x9d')]=qs['sort'](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x303128['where']=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x30f7d5[_0xfef0('0x4b')],_0x2b3263[_0xfef0('0x4c')]));_0x303128[_0xfef0('0x52')][_0xfef0('0xba')]=_0x273e8b['id'];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x92')]){_0x303128['where']=_[_0xfef0('0xa9')](_0x303128[_0xfef0('0x52')],{'$or':_['map'](_0x303128['attributes'],function(_0x3081e){var _0xd34b68={};_0xd34b68[_0x3081e]={'$like':'%'+_0x30f7d5[_0xfef0('0x4b')]['filter']+'%'};return _0xd34b68;})});}_0x303128[_0xfef0('0x52')][_0xfef0('0xf9')]=![];if(_0x30f7d5['query']['id']){_0x303128[_0xfef0('0x52')]['id']={'$gt':_0x30f7d5[_0xfef0('0x4b')]['id']};}_0x303128=_[_0xfef0('0xa9')]({},_0x303128,_0x30f7d5[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')]['count']({'where':_0x303128[_0xfef0('0x52')]})['then'](function(_0x63bcae){_0x43e758['count']=_0x63bcae;_0x303128[_0xfef0('0xc0')]=[];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x10e')]){_0x303128['include'][_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':'User','attributes':['id','fullname',_0xfef0('0xf4')]});}if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0xbf')]){_0x303128['include']=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x303128);})['then'](function(_0x527d0d){_0x43e758[_0xfef0('0xbc')]=_0x527d0d;return _0x43e758;});}})[_0xfef0('0x22')](respondWithFilteredResult(_0x1a53fa,_0x303128))['catch'](handleError(_0x1a53fa,null));};exports[_0xfef0('0x10f')]=function(_0x3f68ed,_0x45a5e8,_0x33cecb){return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x3f68ed[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x45a5e8,null))[_0xfef0('0x22')](function(_0x53ce05){if(_0x53ce05){return _0x53ce05[_0xfef0('0x110')](_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')],_[_0xfef0('0x111')](_0x3f68ed[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{})['spread'](function(){return db[_0xfef0('0x7a')][_0xfef0('0x10c')]({'attributes':['id','name','color'],'where':{'id':_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')]}});})[_0xfef0('0x22')](function(_0x4697ee){socket[_0xfef0('0x112')]('chatInteractionTags:save',{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]});return{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]};});}})[_0xfef0('0x22')](respondWithResult(_0x45a5e8,null))['catch'](handleError(_0x45a5e8,null));};exports[_0xfef0('0x113')]=function(_0x2a229b,_0xcb6d50,_0x53ed7e){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a229b[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0xcb6d50,null))['then'](function(_0x241763){if(_0x241763){return _0x241763[_0xfef0('0x113')](_0x2a229b['query'][_0xfef0('0x109')]);}})[_0xfef0('0x22')](respondWithStatusCode(_0xcb6d50,null))['catch'](handleError(_0xcb6d50,null));};exports[_0xfef0('0x114')]=function(_0x57e2d8,_0x3fdeae){var _0x30b0a9=moment()[_0xfef0('0x115')]()['toString']();var _0x416d36=path[_0xfef0('0xe5')](config['root'],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x118'));var _0x50b3d7=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x119'));var _0x2a9a1e=path[_0xfef0('0xe5')](_0x416d36,_0x30b0a9);var _0x584c9b=util[_0xfef0('0xea')](_0xfef0('0x11a'),_0x57e2d8[_0xfef0('0xbd')]['id'],_0x30b0a9);var _0x4f4c4e=path[_0xfef0('0xe5')](_0x416d36,_0x584c9b);var _0x1c6ab9=[];_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e'),'attributes':['id',_0xfef0('0xf5')],'raw':!![]});_0x1c6ab9['push']({'model':db[_0xfef0('0xd6')],'as':'Contact','attributes':['id',_0xfef0('0x11b'),_0xfef0('0x11c')],'raw':!![]});if(_0x57e2d8[_0xfef0('0x4b')][_0xfef0('0x119')]){_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0xe3')],'as':'Attachment','raw':!![]});}var _0x937d8e=[{'model':db[_0xfef0('0xd3')],'as':_0xfef0('0xec'),'attributes':['id',_0xfef0('0x3b'),'createdAt',_0xfef0('0x11d'),_0xfef0('0xf9'),'read'],'include':_0x1c6ab9}];_0x937d8e['push']({'model':db[_0xfef0('0xc5')],'as':_0xfef0('0x11e'),'attributes':['id',_0xfef0('0x38')]});_0x937d8e[_0xfef0('0x44')]({'model':db['User'],'as':'Owner','attributes':['id',_0xfef0('0xf5')]});return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x57e2d8[_0xfef0('0xbd')]['id']},'include':_0x937d8e})[_0xfef0('0x22')](handleEntityNotFound(_0x3fdeae,null))['then'](function(_0x2978cc){if(_0x2978cc){var _0x81bcee=_0x2978cc['get']({'plain':!![]});fs[_0xfef0('0x11f')](_0x2a9a1e);var _0xc8d0ca={'channel':_0xfef0('0x120'),'account':_0x81bcee[_0xfef0('0x11e')][_0xfef0('0x38')],'agent':_0x81bcee[_0xfef0('0x121')]?_0x81bcee['Owner']['fullname']:_0xfef0('0x122'),'createdAt':moment(_0x81bcee[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))['toString'](),'closedAt':_0x81bcee['closed']?moment(_0x81bcee['closedAt'])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')]():'','disposition':_0x81bcee[_0xfef0('0xdb')],'chatInfo':{'browser':_0x81bcee[_0xfef0('0x123')],'os':_0x81bcee[_0xfef0('0x124')],'referer':_0x81bcee['referer'],'customerIp':_0x81bcee['customerIp'],'customerPort':_0x81bcee['customerPort']?_0x81bcee['customerPort']:'N.A.'},'messages':_(_0x81bcee[_0xfef0('0xec')])['tail']()[_0xfef0('0x92')]({'secret':![]})[_0xfef0('0x7b')](function(_0x46ab62){if(_0x46ab62[_0xfef0('0xe3')]){var _0x3507a8=path['join'](_0x50b3d7,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')]);if(fs[_0xfef0('0x125')](_0x3507a8)){fs['createReadStream'](_0x3507a8)[_0xfef0('0x126')](fs[_0xfef0('0x127')](path[_0xfef0('0xe5')](_0x2a9a1e,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')])));}}return{'date':moment(_0x46ab62[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')](),'sender':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?_0x46ab62[_0xfef0('0x7e')]?_0x46ab62[_0xfef0('0x7e')][_0xfef0('0xf5')]:_0xfef0('0xef'):_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11b')]+(_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11c')]?'\x20'+_0x46ab62[_0xfef0('0x70')]['lastName']:''),'body':_0x46ab62['Attachment']?_0x46ab62['Attachment']['basename']:_0x46ab62[_0xfef0('0x3b')],'direction':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?'A':'C','secret':_0x46ab62['secret'],'read':_0x46ab62[_0xfef0('0x8e')],'attachment':_0x46ab62[_0xfef0('0xe3')]};})[_0xfef0('0x6c')]()};return ejs[_0xfef0('0x128')](path['join'](config['root'],'server',_0xfef0('0x129'),_0xfef0('0x12a')),{'interaction':_0xc8d0ca})[_0xfef0('0x22')](function(_0x2b1f64){var _0x55ecff=path[_0xfef0('0xe5')](_0x2a9a1e,_0xfef0('0x12b')+_0x81bcee['id']+'-'+_0x30b0a9+'.pdf');var _0x409147={'path':_0x55ecff,'channel':_0xfef0('0x120'),'interactionId':_0x81bcee['id']};return pdf[_0xfef0('0x12c')](_0x2b1f64,_0x409147);})[_0xfef0('0x22')](function(){return new BPromise(function(_0x27856d,_0x44081d){zipdir(_0x2a9a1e,{'saveTo':_0x4f4c4e},function(_0x177c9b,_0x322672){if(_0x177c9b)return _0x44081d(_0x177c9b);return _0x27856d(_0x322672);});})[_0xfef0('0x22')](function(){return new BPromise(function(_0x102b4e,_0x2a206b){rimraf(_0x2a9a1e,function(_0x279f5b){if(_0x279f5b)_0x2a206b(_0x279f5b);return _0x102b4e();});});})[_0xfef0('0x22')](function(){return _0x3fdeae[_0xfef0('0x114')](_0x4f4c4e,_0x584c9b,function(_0x44603e){if(_0x44603e){console['log'](_0xfef0('0x12d'),_0x44603e);}else{fs['unlinkSync'](_0x4f4c4e);}});});});}else{return _0x3fdeae[_0xfef0('0x2b')](0xc8);}})['catch'](handleError(_0x3fdeae,null));}; \ No newline at end of file +var _0x757a=['u.id','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','conditions','length','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','type','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','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','c.phone','Contact.phone','c.mobile','Contact.mobile','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','show','params','rawAttributes','includeAll','include','options','create','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','basename','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','getMessages','$gte','findAll','getMyMessages','secret','includeAgent','addTags','setTags','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','root','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','end','stack','name','send','render','merge','body','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','push','catch','index','ChatInteraction','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','from','tools_tags'];(function(_0x26b14f,_0xcf2f69){var _0x566132=function(_0x5d41b3){while(--_0x5d41b3){_0x26b14f['push'](_0x26b14f['shift']());}};_0x566132(++_0xcf2f69);}(_0x757a,0xde));var _0xa757=function(_0x152bf8,_0x462608){_0x152bf8=_0x152bf8-0x0;var _0x320918=_0x757a[_0x152bf8];return _0x320918;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var pdf=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa757('0x15')]=_['defaults'](config['redis'],{'host':_0xa757('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa757('0x17'))[_0xa757('0x18')](socket);var jayson=require(_0xa757('0x19'));var client=jayson[_0xa757('0x1a')][_0xa757('0x1b')]({'port':0x232b});var client9004=jayson[_0xa757('0x1a')][_0xa757('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x2f7947,_0x185011,_0x3df1f9,_0x50aac1){return new BPromise(function(_0x2e195b,_0x44eab8){var _0xde8248=_0x50aac1||client;return _0xde8248['request'](_0x2f7947,_0x3df1f9)['then'](function(_0x151c04){logger[_0xa757('0x1c')](_0xa757('0x1d'),_0x185011,_0xa757('0x1e'));logger[_0xa757('0x1f')](_0xa757('0x20'),_0x185011,'request\x20sent',JSON[_0xa757('0x21')](_0x151c04));if(_0x151c04['error']){if(_0x151c04[_0xa757('0x22')][_0xa757('0x23')]===0x1f4){logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x151c04['error']['message']);return _0x44eab8(_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);}logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);return _0x2e195b(_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);}else{logger[_0xa757('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x185011,_0xa757('0x1e'));_0x2e195b(_0x151c04['result'][_0xa757('0x24')]);}})['catch'](function(_0x40551d){logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x40551d);_0x44eab8(_0x40551d);});});}function respondWithStatusCode(_0x4d58a4,_0x2b19d5){_0x2b19d5=_0x2b19d5||0xcc;return function(_0xcd98bd){if(_0xcd98bd){return _0x4d58a4[_0xa757('0x25')](_0x2b19d5);}return _0x4d58a4[_0xa757('0x26')](_0x2b19d5)['end']();};}function respondWithResult(_0x449a7d,_0x54263b){_0x54263b=_0x54263b||0xc8;return function(_0x5a5664){if(_0x5a5664){return _0x449a7d['status'](_0x54263b)['json'](_0x5a5664);}};}function respondWithFilteredResult(_0xfdf69d,_0x596ae2){return function(_0x2208f9){if(_0x2208f9){var _0x3bc24c=typeof _0x596ae2['offset']===_0xa757('0x27')&&typeof _0x596ae2['limit']===_0xa757('0x27');var _0xa6d0f6=_0x2208f9['count'];var _0x235e54=_0x3bc24c?0x0:_0x596ae2['offset'];var _0x3a4a66=_0x3bc24c?_0x2208f9[_0xa757('0x28')]:_0x596ae2[_0xa757('0x29')]+_0x596ae2[_0xa757('0x2a')];var _0xcc87c0;if(_0x3a4a66>=_0xa6d0f6){_0x3a4a66=_0xa6d0f6;_0xcc87c0=0xc8;}else{_0xcc87c0=0xce;}_0xfdf69d[_0xa757('0x26')](_0xcc87c0);return _0xfdf69d[_0xa757('0x2b')](_0xa757('0x2c'),_0x235e54+'-'+_0x3a4a66+'/'+_0xa6d0f6)[_0xa757('0x2d')](_0x2208f9);}return null;};}function patchUpdates(_0x384424){return function(_0x1f5d5a){try{jsonpatch[_0xa757('0x2e')](_0x1f5d5a,_0x384424,!![]);}catch(_0x25dfbb){return BPromise[_0xa757('0x2f')](_0x25dfbb);}return _0x1f5d5a[_0xa757('0x30')]();};}function saveUpdates(_0xc1cc20,_0x3e64b7){return function(_0x1ad384){if(_0x1ad384){return _0x1ad384[_0xa757('0x31')](_0xc1cc20)[_0xa757('0x32')](function(_0x3de18f){return _0x3de18f;});}return null;};}function removeEntity(_0x170aa9,_0x379de7){return function(_0x3aae1e){if(_0x3aae1e){return _0x3aae1e['destroy']()[_0xa757('0x32')](function(){_0x170aa9[_0xa757('0x26')](0xcc)[_0xa757('0x33')]();});}};}function handleEntityNotFound(_0x1794a9,_0x1c4c40){return function(_0x51e2aa){if(!_0x51e2aa){_0x1794a9[_0xa757('0x25')](0x194);}return _0x51e2aa;};}function handleError(_0x2af470,_0x37b1a3){_0x37b1a3=_0x37b1a3||0x1f4;return function(_0x2c34b1){logger[_0xa757('0x22')](_0x2c34b1[_0xa757('0x34')]);if(_0x2c34b1['name']){delete _0x2c34b1[_0xa757('0x35')];}_0x2af470[_0xa757('0x26')](_0x37b1a3)[_0xa757('0x36')](_0x2c34b1);};}function getMustacheRender(_0xc34409,_0x3b5104){return Mustache[_0xa757('0x37')](_0xc34409,_[_0xa757('0x38')](_0x3b5104[_0xa757('0x39')],{'contact':_0x3b5104[_0xa757('0x3a')],'message':_0x3b5104['message'],'agent':_0x3b5104[_0xa757('0x3b')],'interaction':_0x3b5104[_0xa757('0x3c')],'account':_0x3b5104[_0xa757('0x3d')]}))||'';}function getInteractionUsers(_0x35c15a,_0x2531be){return new BPromise(function(_0x2fd99e,_0x501e26){try{if(_0x2531be[_0x35c15a['id']]){_0x35c15a[_0xa757('0x3e')]=_[_0xa757('0x3f')](_0x2531be[_0x35c15a['id']],function(_0x48cde9){return{'id':_0x48cde9['id'],'fullname':_0x48cde9['fullname']};});}}catch(_0x9607af){_0x501e26(_0x9607af);}_0x2fd99e(_0x35c15a);});}function getInteractionTags(_0x6193bf,_0x5b11fe){return new BPromise(function(_0x51c3d1,_0xcff7c4){try{if(_0x6193bf[_0xa757('0x40')]){_0x6193bf[_0xa757('0x41')]=[];_0x6193bf['TagIds'][_0xa757('0x42')](',')[_0xa757('0x43')](function(_0x26802c){_0x6193bf[_0xa757('0x41')][_0xa757('0x44')](_0x5b11fe[_0x26802c]);});}delete _0x6193bf['TagIds'];}catch(_0x1f9af){_0xcff7c4(_0x1f9af);}_0x51c3d1(_0x6193bf);});}function updateChatInteraction(_0x52c728,_0x564d40,_0x43329c){return new BPromise(function(_0x57298b,_0x373747){return getInteractionUsers(_0x52c728,_0x43329c)[_0xa757('0x32')](function(_0x9a0934){return getInteractionTags(_0x9a0934,_0x564d40);})['then'](function(_0x5d25bb){_0x57298b(_0x5d25bb);})[_0xa757('0x45')](function(_0x129d77){_0x373747(_0x129d77);});});}exports[_0xa757('0x46')]=function(_0xe03a3c,_0xc063db){var _0x3db5d5={},_0x4f12b1={},_0xd61628={'count':0x0,'rows':[]};var _0x364998=_['map'](db[_0xa757('0x47')]['rawAttributes'],function(_0x2d111e){return{'name':_0x2d111e[_0xa757('0x48')],'type':_0x2d111e['type'][_0xa757('0x49')]};});_0x4f12b1[_0xa757('0x4a')]=_['map'](_0x364998,_0xa757('0x35'));_0x4f12b1[_0xa757('0x4b')]=_[_0xa757('0x4c')](_0xe03a3c[_0xa757('0x4b')]);_0x4f12b1['filters']=_[_0xa757('0x4d')](_0x4f12b1[_0xa757('0x4a')],_0x4f12b1[_0xa757('0x4b')]);_0x3db5d5[_0xa757('0x4e')]=_['intersection'](_0x4f12b1[_0xa757('0x4a')],qs['fields'](_0xe03a3c['query'][_0xa757('0x4f')]));_0x3db5d5[_0xa757('0x4e')]=_0x3db5d5[_0xa757('0x4e')]['length']?_0x3db5d5[_0xa757('0x4e')]:_0x4f12b1['model'];if(!_0xe03a3c[_0xa757('0x4b')][_0xa757('0x50')](_0xa757('0x51'))){_0x3db5d5[_0xa757('0x2a')]=qs[_0xa757('0x2a')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x2a')]);_0x3db5d5[_0xa757('0x29')]=qs['offset'](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x29')]);}_0x3db5d5[_0xa757('0x52')]=qs[_0xa757('0x53')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x53')]);_0x3db5d5[_0xa757('0x54')]=qs[_0xa757('0x55')](_[_0xa757('0x56')](_0xe03a3c[_0xa757('0x4b')],_0x4f12b1[_0xa757('0x55')]),_0x364998);var _0x19ceef=[];var _0x2367c7=squel[_0xa757('0x57')]()[_0xa757('0x58')]('id')[_0xa757('0x58')]('name')[_0xa757('0x58')]('color')[_0xa757('0x59')](_0xa757('0x5a'));var _0xa89d24=squel[_0xa757('0x57')]()['field'](_0xa757('0x5b'))[_0xa757('0x58')](_0xa757('0x5c'))[_0xa757('0x58')]('ui.ChatInteractionId')[_0xa757('0x59')](_0xa757('0x5d'),'ui')[_0xa757('0x5e')](_0xa757('0x5f'),'u',_0xa757('0x60'));var _0x291b26=squel['select']()['from']('chat_interactions','i')['left_join'](_0xa757('0x61'),'c',_0xa757('0x62'))[_0xa757('0x5e')](_0xa757('0x5f'),'o',_0xa757('0x63'))[_0xa757('0x5e')]('chat_websites','a',_0xa757('0x64'))[_0xa757('0x5e')](_0xa757('0x65'),'me',_0xa757('0x66'))['left_join'](_0xa757('0x67'),'it',_0xa757('0x68'))['left_join'](_0xa757('0x5a'),'t','t.id\x20=\x20it.TagId');var _0x211980=squel['expr']();var _0x51be6e=[];var _0x58633a=squel['expr']();var _0x367b48;if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x69')]){_0x367b48=as[_0xa757('0x6a')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x69')]);var _0x4c19a6=_0x367b48['sqlOperator'];for(var _0x201557=0x0;_0x201557<_0x367b48[_0xa757('0x6b')][_0xa757('0x6c')];_0x201557++){var _0x4a5ad5=_0x367b48['conditions'][_0x201557];var _0x18dff7='i';var _0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),_0x4a5ad5[_0xa757('0x58')]]);if(!_0x31c4cd){switch(_0x4a5ad5[_0xa757('0x58')]){case'unreadMessages':if(_0x4a5ad5[_0xa757('0x6e')]==0x1){_0x291b26[_0xa757('0x6f')]('`'+_0x4a5ad5[_0xa757('0x58')]+_0xa757('0x70'));}else{_0x291b26[_0xa757('0x6f')]('`'+_0x4a5ad5[_0xa757('0x58')]+_0xa757('0x71'));}break;case _0xa757('0x72'):if(_0x4a5ad5[_0xa757('0x73')]===_0xa757('0x74')){if(_0x4a5ad5['value'][_0xa757('0x42')]('\x20')['length']>0x1){_0x211980[_0x4c19a6]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa757('0x75')](_0x4a5ad5[_0xa757('0x6e')]),null);}else{var _0x432856='%'+_0x4a5ad5[_0xa757('0x6e')]+'%';_0x211980[_0x4c19a6](_0xa757('0x76'),_0x432856,_0x432856,_0x432856);}}else{_0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),_0xa757('0x77')]);_0x4a5ad5[_0xa757('0x58')]=_0xa757('0x77');_0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd['type'],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')]['start'],_0x423f3a[_0xa757('0x6e')][_0xa757('0x33')]);}break;case _0xa757('0x7a'):var _0x180cec=_0x4a5ad5[_0xa757('0x6e')][_0xa757('0x42')](',')['map'](function(_0x413217){return Number(_0x413217);});_0x180cec['forEach'](function(_0xee5b78){_0x58633a['or'](_0xa757('0x7b'),'%,'+_0xee5b78+',%');});_0x51be6e=_[_0xa757('0x7c')](_0x51be6e,_0x180cec);break;case _0xa757('0x7d'):if(_0x4a5ad5[_0xa757('0x73')]==='$substring'){_0x211980[_0x4c19a6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4a5ad5[_0xa757('0x6e')]+'%',null);}else{_0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),'UserId']);_0x4a5ad5[_0xa757('0x58')]='UserId';_0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd[_0xa757('0x7e')],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x7f')],_0x423f3a[_0xa757('0x6e')]['end']);}break;case _0xa757('0x39'):_0x423f3a=as[_0xa757('0x78')]('me',null,_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x7f')],_0x423f3a['value'][_0xa757('0x33')]);break;}}else{var _0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd[_0xa757('0x7e')],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a['value'][_0xa757('0x7f')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x33')]);}}}else{var _0x529298=_(_0xe03a3c[_0xa757('0x4b')])[_0xa757('0x4c')]()[_0xa757('0x3f')](function(_0x60f518){return _[_0xa757('0x80')](_0x364998,[_0xa757('0x35'),_0x60f518])?_0x60f518:undefined;})[_0xa757('0x81')]()[_0xa757('0x6e')]();if(!_[_0xa757('0x82')](_0x529298)){_0x529298[_0xa757('0x43')](function(_0x1a868d){if(_0x1a868d===_0xa757('0x83')){_0x291b26[_0xa757('0x54')](_0xa757('0x84'),[]['concat'](_0xe03a3c[_0xa757('0x4b')][_0x1a868d]));}else if(_0x1a868d===_0xa757('0x85')){var _0x532ab5=JSON[_0xa757('0x86')](_0xe03a3c[_0xa757('0x4b')][_0x1a868d])['$gte'];var _0x29aea2=JSON[_0xa757('0x86')](_0xe03a3c[_0xa757('0x4b')][_0x1a868d])[_0xa757('0x87')];_0x291b26[_0xa757('0x54')](_0xa757('0x88'),_0x532ab5,_0x29aea2);}else{if(_0xe03a3c[_0xa757('0x4b')][_0x1a868d]===_0xa757('0x89')){_0x291b26[_0xa757('0x54')]('i.'+_0x1a868d+_0xa757('0x8a'));}else{_0x291b26[_0xa757('0x54')]('i.'+_0x1a868d+_0xa757('0x8b'),_0xe03a3c[_0xa757('0x4b')][_0x1a868d]);}}});}if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8c')]){if(_0xe03a3c[_0xa757('0x4b')]['read']==0x1){_0x291b26[_0xa757('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x291b26[_0xa757('0x6f')](_0xa757('0x8d'));}}if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8e')]){_0x51be6e=_[_0xa757('0x8f')](_0xe03a3c['query'][_0xa757('0x8e')])?_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8e')]:new Array(_0xe03a3c['query'][_0xa757('0x8e')]);_0x51be6e[_0xa757('0x43')](function(_0x2c05d5){_0x58633a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c05d5+',%');});}if(_0xe03a3c['query'][_0xa757('0x90')]){var _0x351e0e=_0xe03a3c[_0xa757('0x4b')]['filter'][_0xa757('0x91')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x351e0e)){_0x211980['or'](_0xa757('0x92'),_0x351e0e+'%');}else{_0x211980['or'](_0xa757('0x93'),qs[_0xa757('0x75')](_0x351e0e))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x351e0e+'%');}}}_0x291b26[_0xa757('0x54')](_0x211980);_0x291b26[_0xa757('0x94')](_0xa757('0x95'));var _0x199f75={'type':db[_0xa757('0x96')][_0xa757('0x97')][_0xa757('0x98')],'raw':!![]};var _0x44c681=_0x291b26[_0xa757('0x99')]();_0x44c681[_0xa757('0x58')](_0xa757('0x95'));_0x44c681[_0xa757('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa757('0x9a'));if(_0x3db5d5[_0xa757('0x52')]){_0x3db5d5[_0xa757('0x52')][_0xa757('0x43')](function(_0x1a46d6){var _0x7440f6=_0x1a46d6[0x0]===_0xa757('0x9b')?_0x1a46d6[0x0]:'i.'+_0x1a46d6[0x0];_0x291b26[_0xa757('0x52')](_0x7440f6,_0x1a46d6[0x1]===_0xa757('0x9c')?![]:!![]);});}if(!_[_0xa757('0x82')](_0x51be6e)){_0x291b26[_0xa757('0x6f')](_0x58633a);_0x44c681[_0xa757('0x54')](_0xa757('0x9d'),_0x51be6e);}BPromise[_0xa757('0x9e')]()[_0xa757('0x32')](function(){if(!_0x367b48){if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x83')])return;_0x44c681[_0xa757('0x54')](_0xa757('0x9f'));_0x291b26[_0xa757('0x54')](_0xa757('0x9f'));return;}if(_0xe03a3c[_0xa757('0xa0')]['role']!==_0xa757('0x3b'))return;return _0xe03a3c[_0xa757('0xa0')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xa757('0x32')](function(_0x4c4b1a){if(_[_0xa757('0x82')](_0x4c4b1a)){_0x44c681[_0xa757('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');_0x291b26[_0xa757('0x54')](_0xa757('0xa1'));}else{_0x44c681[_0xa757('0x54')](_0xa757('0x84'),_['map'](_0x4c4b1a,'id'));_0x291b26[_0xa757('0x54')](_0xa757('0x84'),_['map'](_0x4c4b1a,'id'));}});})[_0xa757('0x32')](function(){if(_0xe03a3c[_0xa757('0xa0')]['role']===_0xa757('0x3b')&&!_0x367b48&&!_0xe03a3c[_0xa757('0x4b')][_0xa757('0x83')])return[];return db[_0xa757('0xa2')][_0xa757('0x4b')](_0x44c681[_0xa757('0xa3')](),_0x199f75);})[_0xa757('0x32')](function(_0x2d6405){_0xd61628[_0xa757('0x28')]=_0x2d6405['length'];if(_0xd61628['count']===0x0)return[];return db[_0xa757('0xa2')][_0xa757('0x4b')](_0x2367c7[_0xa757('0xa3')](),_0x199f75)[_0xa757('0x32')](function(_0x38d0f8){_0x19ceef=_[_0xa757('0xa4')](_0x38d0f8,'id');_0x199f75=_[_0xa757('0x38')](_0x199f75,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xe03a3c[_0xa757('0x4b')]['fields']){_0x3db5d5[_0xa757('0x4e')][_0xa757('0x43')](function(_0x365a0d){_0x291b26[_0xa757('0x58')]('i.'+_0x365a0d);});}else{_0x291b26[_0xa757('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa757('0x9a'));_0x291b26['field'](_0xa757('0xa5'),_0xa757('0xa6'));_0x291b26[_0xa757('0x58')](_0xa757('0xa7'),'Account.mandatoryDisposition');_0x291b26[_0xa757('0x58')](_0xa757('0xa8'),_0xa757('0x9b'));_0x291b26[_0xa757('0x58')](_0xa757('0xa9'));_0x291b26[_0xa757('0x58')](_0xa757('0xaa'),_0xa757('0xab'));_0x291b26['field'](_0xa757('0xac'),_0xa757('0xad'));_0x291b26[_0xa757('0x58')](_0xa757('0xae'),'Contact.email');_0x291b26[_0xa757('0x58')](_0xa757('0xaf'),_0xa757('0xb0'));_0x291b26[_0xa757('0x58')](_0xa757('0xb1'),_0xa757('0xb2'));_0x291b26[_0xa757('0x58')]('c.fax','Contact.fax');_0x291b26[_0xa757('0x58')]('o.fullname',_0xa757('0xb3'));_0x291b26['field']('o.internal',_0xa757('0xb4'));_0x291b26[_0xa757('0x58')](_0xa757('0xb5'),_0xa757('0x40'));}if(_0x3db5d5[_0xa757('0x2a')])_0x291b26[_0xa757('0x2a')](_0x3db5d5[_0xa757('0x2a')]);if(_0x3db5d5[_0xa757('0x29')])_0x291b26[_0xa757('0x29')](_0x3db5d5[_0xa757('0x29')]);return db['sequelize'][_0xa757('0x4b')](_0x291b26['toString'](),_0x199f75);})[_0xa757('0x32')](function(_0x4e7280){if(_0x4e7280[_0xa757('0x6c')]>0x0)_0xa89d24[_0xa757('0x54')]('ui.ChatInteractionId\x20IN\x20?',_[_0xa757('0x3f')](_0x4e7280,'id'));return db[_0xa757('0xa2')][_0xa757('0x4b')](_0xa89d24[_0xa757('0xa3')](),_0x199f75)[_0xa757('0x32')](function(_0x162ff6){var _0x1c789c=_[_0xa757('0xb6')](_0x162ff6,_0xa757('0xb7'));var _0x358268=[];_0x4e7280[_0xa757('0x43')](function(_0x204489){_0x358268[_0xa757('0x44')](updateChatInteraction(_0x204489,_0x19ceef,_0x1c789c));});return BPromise[_0xa757('0xb8')](_0x358268);});});})[_0xa757('0x32')](function(_0x56a060){_0xd61628['rows']=_0x56a060;return _0xd61628;})[_0xa757('0x32')](respondWithFilteredResult(_0xc063db,_0x3db5d5))['catch'](handleError(_0xc063db,null));};exports[_0xa757('0xb9')]=function(_0x3404f1,_0x2edad2){var _0x1d03a7={'raw':![],'where':{'id':_0x3404f1[_0xa757('0xba')]['id']}},_0x48c52f={};_0x48c52f[_0xa757('0x4a')]=_[_0xa757('0x4c')](db[_0xa757('0x47')][_0xa757('0xbb')]);_0x48c52f[_0xa757('0x4b')]=_['keys'](_0x3404f1[_0xa757('0x4b')]);_0x48c52f[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x48c52f[_0xa757('0x4a')],_0x48c52f[_0xa757('0x4b')]);_0x1d03a7['attributes']=_['intersection'](_0x48c52f[_0xa757('0x4a')],qs['fields'](_0x3404f1[_0xa757('0x4b')]['fields']));_0x1d03a7[_0xa757('0x4e')]=_0x1d03a7[_0xa757('0x4e')][_0xa757('0x6c')]?_0x1d03a7[_0xa757('0x4e')]:_0x48c52f[_0xa757('0x4a')];if(_0x3404f1[_0xa757('0x4b')][_0xa757('0xbc')]){_0x1d03a7[_0xa757('0xbd')]=[{'all':!![]}];}_0x1d03a7=_[_0xa757('0x38')]({},_0x1d03a7,_0x3404f1[_0xa757('0xbe')]);return db[_0xa757('0x47')]['find'](_0x1d03a7)[_0xa757('0x32')](handleEntityNotFound(_0x2edad2,null))[_0xa757('0x32')](respondWithResult(_0x2edad2,null))[_0xa757('0x45')](handleError(_0x2edad2,null));};exports[_0xa757('0xbf')]=function(_0x1f308f,_0x1ea6d7){return db['ChatInteraction'][_0xa757('0xbf')](_0x1f308f[_0xa757('0x39')],{})['then'](respondWithResult(_0x1ea6d7,0xc9))[_0xa757('0x45')](handleError(_0x1ea6d7,null));};exports[_0xa757('0x31')]=function(_0x1f4782,_0x5e6171){if(_0x1f4782[_0xa757('0x39')]['id']){delete _0x1f4782[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x1f4782[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x5e6171,null))[_0xa757('0x32')](saveUpdates(_0x1f4782['body'],null))['then'](respondWithResult(_0x5e6171,null))[_0xa757('0x45')](handleError(_0x5e6171,null));};exports['destroy']=function(_0x5d9102,_0x44023e){return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x5d9102[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x44023e,null))[_0xa757('0x32')](removeEntity(_0x44023e,null))['catch'](handleError(_0x44023e,null));};exports['describe']=function(_0x556b78,_0x4b4a87){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x4b4a87,null))[_0xa757('0x45')](handleError(_0x4b4a87,null));};exports['createVidaooSession']=function(_0x1ba0df,_0xccb91e){var _0x146305=_0x1ba0df[_0xa757('0xba')]['id'];var _0x46fd6b;var _0xc0a523;var _0x399952;return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0x146305}})['then'](function(_0x4dd40a){_0x46fd6b=_0x4dd40a;return db[_0xa757('0xc1')][_0xa757('0xc0')]({'where':{'id':_0x4dd40a[_0xa757('0x83')]},'attributes':['id',_0xa757('0xc2'),'vidaooEscalation',_0xa757('0xc3'),_0xa757('0xc4'),_0xa757('0xc5')],'raw':!![]});})[_0xa757('0x32')](function(_0x30c170){if(_0x30c170&&_0x30c170[_0xa757('0xc2')]&&_0x30c170[_0xa757('0xc6')]){_0xc0a523=_0x30c170;var _0x4e552d={'interaction':{'id':_0x146305},'agent':{'id':_0x1ba0df[_0xa757('0xa0')]['id'],'name':_0x1ba0df[_0xa757('0xa0')]['name'],'fullname':_0x1ba0df[_0xa757('0xa0')][_0xa757('0xc7')],'email':_0x1ba0df[_0xa757('0xa0')][_0xa757('0xc8')]},'contact':_0x1ba0df[_0xa757('0x39')]['contact'],'account':_0x1ba0df[_0xa757('0x39')][_0xa757('0x3d')]};var _0x3d031d={'rejectUnauthorized':![],'method':'POST','url':_0xa757('0xc9'),'headers':{'X-APIKEY':_0x30c170[_0xa757('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ba0df[_0xa757('0xa0')]['email']],'buttons':null,'topic':_0xc0a523[_0xa757('0xc3')],'note':_[_0xa757('0xca')](_0xc0a523[_0xa757('0xc4')])?null:getMustacheRender(_0xc0a523[_0xa757('0xc4')],_0x4e552d),'metadata':null},'redirect':_0xa757('0xcb'),'json':!![]};try{if(!_['isNull'](_0xc0a523[_0xa757('0xc5')])){var _0x4b440e=getMustacheRender(_0xc0a523['vidaooMetadata'],_0x4e552d);var _0x6e9075=JSON[_0xa757('0x86')](_0x4b440e);_0x3d031d[_0xa757('0x39')][_0xa757('0xcc')]=_0x6e9075;}}catch(_0x4d3423){throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xce'));}return rp(_0x3d031d);}else{throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xcf'));}})[_0xa757('0x32')](function(_0xad41e1){_0x399952=_0xad41e1;if(_0x399952['id']){var _0x564db3={'body':_0x399952[_0xa757('0xd0')],'ChatWebsiteId':_0xc0a523['id'],'ChatInteractionId':_0x46fd6b['id'],'direction':_0xa757('0xd1'),'UserId':_0x1ba0df[_0xa757('0xa0')]['id']};return db[_0xa757('0xd2')][_0xa757('0xbf')](_0x564db3,{});}else{throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xd3'));}})[_0xa757('0x32')](function(){return _0x46fd6b['updateAttributes']({'vidaooSessionId':_0x399952['id']});})['then'](respondWithResult(_0xccb91e,null))[_0xa757('0x45')](handleError(_0xccb91e,null));};exports[_0xa757('0xd4')]=function(_0x542faf,_0x3e7174){if(_0x542faf['body']['id']){delete _0x542faf[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x542faf[_0xa757('0xba')]['id']},'include':[{'model':db[_0xa757('0xd5')],'as':_0xa757('0x72')}]})[_0xa757('0x32')](handleEntityNotFound(_0x3e7174,null))[_0xa757('0x32')](saveUpdates(_0x542faf[_0xa757('0x39')],null))['then'](respondWithResult(_0x3e7174,null))[_0xa757('0x45')](handleError(_0x3e7174,null));};exports[_0xa757('0xd6')]=function(_0x4a7a69,_0xea878b,_0x434c4b){if(_0x4a7a69[_0xa757('0x39')]['id']){delete _0x4a7a69[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x4a7a69[_0xa757('0xba')]['id']}})[_0xa757('0x32')](function(_0x2ea80d){if(!_0x2ea80d){logger[_0xa757('0x22')](_0xa757('0xd7'),_0xa757('0xd6'),0x194,'entity\x20not\x20found');_0xea878b[_0xa757('0x25')](0x194);}else{if(_0x2ea80d[_0xa757('0xd8')]){throw new db['Sequelize'][(_0xa757('0xcd'))](_0xa757('0xd9'));}}return _0x2ea80d;})['then'](function(_0x124eff){if(_0x124eff){return _0x124eff[_0xa757('0x31')]({'closed':_0x4a7a69[_0xa757('0x39')][_0xa757('0xda')],'disposition':_0x4a7a69['body']['disposition']})[_0xa757('0x32')](function(_0x48a9d0){return _0x48a9d0;});}})[_0xa757('0x32')](function(_0x551930){return respondWithRpcPromise(_0xa757('0xdb'),_0xa757('0xd6'),_0x4a7a69[_0xa757('0x39')],client9004);})[_0xa757('0x32')](respondWithResult(_0xea878b,null))[_0xa757('0x45')](handleError(_0xea878b,null));};exports['attachmentUpload']=function(_0x54385d,_0xa77319,_0x7c238d){_0x54385d[_0xa757('0x39')][_0xa757('0x35')]=_0x54385d['file']['originalname'];_0x54385d[_0xa757('0x39')]['basename']=_0x54385d[_0xa757('0xdc')][_0xa757('0xdd')];_0x54385d[_0xa757('0x39')][_0xa757('0x7e')]=_0x54385d[_0xa757('0xdc')][_0xa757('0xde')];return db[_0xa757('0xdf')]['create'](_0x54385d[_0xa757('0x39')])[_0xa757('0x32')](respondWithResult(_0xa77319,0xc9))[_0xa757('0x45')](handleError(_0xa77319,null));};exports[_0xa757('0xe0')]=function(_0x177db5,_0x1f678e,_0x377663){return db['ChatInteraction']['findOne']({'where':{'id':_0x177db5[_0xa757('0xba')]['id']},'raw':!![]})[_0xa757('0x32')](handleEntityNotFound(_0x1f678e,null))[_0xa757('0x32')](function(_0x54da87){if(_0x54da87){if(_0x54da87[_0xa757('0xda')]){return _0x1f678e[_0xa757('0x26')](0x193)['json']({'status':0x193,'message':_0xa757('0xe1')});}return db['Attachment'][_0xa757('0xc0')]({'where':{'id':_0x177db5[_0xa757('0x4b')][_0xa757('0xe2')]},'raw':!![]})[_0xa757('0x32')](handleEntityNotFound(_0x1f678e,null));}})[_0xa757('0x32')](function(_0x1b4e62){if(_0x1b4e62){var _0x42e409=_0x1b4e62[_0xa757('0xe3')]!==null;var _0x19f834=path[_0xa757('0xe4')](config['root'],'server/files/attachments/');if(_0x42e409){_0x19f834=path[_0xa757('0xe4')](_0x19f834,'offline-chat/');}var _0x4bd0a6=path[_0xa757('0xe4')](_0x19f834,_0x1b4e62[_0xa757('0xe5')]);return _0x1f678e['download'](_0x4bd0a6);}})[_0xa757('0x45')](handleError(_0x1f678e,null));};exports['close']=function(_0x334f77,_0x45dc56){var _0x2fe93c=null;var _0x101410=null;var _0x2cc39e=null;var _0x1aa70d=null;if(_0x334f77[_0xa757('0x39')]['id']){delete _0x334f77[_0xa757('0x39')]['id'];}if(_0x334f77['body']['mailTranscript']){_0x1aa70d=path[_0xa757('0xe4')](config['root'],_0xa757('0xe6'),util[_0xa757('0xe7')](_0xa757('0xe8'),Date[_0xa757('0xe9')]()));_0x334f77[_0xa757('0x39')][_0xa757('0xea')]=_0x1aa70d;}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x334f77['params']['id']},'include':[{'model':db[_0xa757('0xd2')],'as':'Messages','include':[{'model':db['User'],'as':_0xa757('0x7d')}]}]})[_0xa757('0x32')](handleEntityNotFound(_0x45dc56,null))[_0xa757('0x32')](saveUpdates(_0x334f77[_0xa757('0x39')],null))['then'](function(_0xce5af4){if(_0xce5af4){_0x2fe93c=_0xce5af4;return db['ChatWebsite'][_0xa757('0x6d')]({'where':{'id':_0x2fe93c['ChatWebsiteId']}});}})[_0xa757('0x32')](function(_0x3e9009){if(_0x3e9009){_0x2cc39e=_0x3e9009;return db['CmContact'][_0xa757('0x6d')]({'where':{'id':_0x2fe93c[_0xa757('0x77')]}});}})['then'](function(_0x2a5b41){if(_0x2a5b41){_0x101410=_0x2a5b41;if(_0x1aa70d){var _0x1ec56a=null;for(var _0xa09d83=0x1;_0xa09d83<_0x2fe93c[_0xa757('0xeb')][_0xa757('0x6c')];++_0xa09d83){_0x1ec56a=_0x2fe93c[_0xa757('0xeb')][_0xa09d83];var _0x2439f9=_0x1ec56a['UserId']?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e['agentAlias'],_0x1ec56a['UserId']):_0xa757('0xed');var _0x30f2da=_0x334f77[_0xa757('0x39')][_0xa757('0xee')]||util[_0xa757('0xe7')](_0xa757('0xec'),_0xa757('0xef'),_0x1ec56a[_0xa757('0x77')]);switch(_0x2cc39e[_0xa757('0xf0')]){case _0xa757('0xf1'):_0x2439f9=_0x1ec56a[_0xa757('0xd8')]?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e['agentAlias'],_0x1ec56a[_0xa757('0xd8')]):_0xa757('0xed');break;case _0xa757('0xf2'):_0x2439f9=_0x1ec56a['UserId']?_0x1ec56a['User'][_0xa757('0xf3')]||_0x1ec56a[_0xa757('0x7d')]['fullname']:_0xa757('0xed');break;case _0xa757('0xf4'):_0x2439f9=_0x1ec56a['UserId']?_0x1ec56a[_0xa757('0x7d')]['fullname']:_0xa757('0xed');break;default:_0x2439f9=_0x1ec56a[_0xa757('0xd8')]?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e[_0xa757('0xf5')],_0x1ec56a[_0xa757('0xd8')]):_0xa757('0xed');}var _0x69af1f=util['format'](_0xa757('0xf6'),moment(_0x1ec56a['createdAt'])['format'](_0xa757('0xf7')),_0x1ec56a[_0xa757('0xf8')]==='in'?_0x30f2da:_0x2439f9,_0x1ec56a['body']);if(!_0x1ec56a['secret']){fs['appendFileSync'](_0x1aa70d,_0x69af1f);}}return db[_0xa757('0xf9')][_0xa757('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xa757('0xfa')],'as':'Smtp','raw':!![]}]});}}})[_0xa757('0x32')](function(_0x2e76e5){if(_0x2e76e5&&_0x2e76e5[_0xa757('0xfb')]&&_0x334f77[_0xa757('0x39')]){var _0x1caccc={'tls':{'rejectUnauthorized':![]}};if(_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfc')]){_0x1caccc[_0xa757('0xfc')]=_0x2e76e5['Smtp'][_0xa757('0xfc')];}else{_0x1caccc['host']=_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfd')];_0x1caccc[_0xa757('0xfe')]=_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfe')];_0x1caccc['secure']=_0x2e76e5[_0xa757('0xfb')]['secure'];}if(_0x2e76e5[_0xa757('0xfb')][_0xa757('0xff')]){_0x1caccc[_0xa757('0x100')]={'user':_0x2e76e5[_0xa757('0xfb')][_0xa757('0xa0')],'pass':_0x2e76e5[_0xa757('0xfb')][_0xa757('0x101')]};}return respondWithRpcPromise(_0xa757('0x102'),_0xa757('0x103'),{'account':_0x1caccc,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2e76e5[_0xa757('0x35')],_0x2e76e5[_0xa757('0xc8')]||_0x2e76e5['Smtp'][_0xa757('0xa0')]),'to':_0x334f77[_0xa757('0x39')]['mailTranscript'],'subject':_0xa757('0x104'),'text':util['format'](_0xa757('0x105'),_0x334f77[_0xa757('0x39')][_0xa757('0x106')]),'attachments':[{'path':_0x1aa70d}]}})[_0xa757('0x32')](function(){return _0x2fe93c;})[_0xa757('0x45')](function(_0xa285fa){console[_0xa757('0x22')](_0xa285fa);});}else{return _0x2fe93c;}})[_0xa757('0x32')](respondWithStatusCode(_0x45dc56,0xc8))[_0xa757('0x45')](handleError(_0x45dc56,null));};exports[_0xa757('0x107')]=function(_0x379660,_0x36643f,_0xe704f0){return db['ChatMessage']['find']({'where':{'id':_0x379660[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x36643f,null))[_0xa757('0x32')](function(_0x4f1a01){if(_0x4f1a01){return _0x4f1a01[_0xa757('0x107')](_0x379660[_0xa757('0x39')][_0xa757('0x108')],_[_0xa757('0x109')](_0x379660[_0xa757('0x39')],['ids','id'])||{});}})['then'](respondWithResult(_0x36643f,null))[_0xa757('0x45')](handleError(_0x36643f,null));};exports[_0xa757('0x10a')]=function(_0xada3bd,_0x566095,_0x25c4da){var _0x35b41e={'raw':![],'where':{}};var _0x4b60b9={};var _0x2d7d24={'count':0x0,'rows':[]};return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0xada3bd['params']['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x566095,null))[_0xa757('0x32')](function(_0x1b702f){if(_0x1b702f){_0x4b60b9[_0xa757('0x4a')]=_[_0xa757('0x4c')](db[_0xa757('0xd2')][_0xa757('0xbb')]);_0x4b60b9['query']=_[_0xa757('0x4c')](_0xada3bd['query']);_0x4b60b9[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x4b60b9[_0xa757('0x4a')],_0x4b60b9[_0xa757('0x4b')]);_0x35b41e['attributes']=_['intersection'](_0x4b60b9[_0xa757('0x4a')],qs[_0xa757('0x4f')](_0xada3bd[_0xa757('0x4b')][_0xa757('0x4f')]));_0x35b41e[_0xa757('0x4e')]=_0x35b41e['attributes']['length']?_0x35b41e[_0xa757('0x4e')]:_0x4b60b9[_0xa757('0x4a')];if(!_0xada3bd[_0xa757('0x4b')][_0xa757('0x50')](_0xa757('0x51'))){_0x35b41e[_0xa757('0x2a')]=qs['limit'](_0xada3bd[_0xa757('0x4b')][_0xa757('0x2a')]);_0x35b41e[_0xa757('0x29')]=qs['offset'](_0xada3bd[_0xa757('0x4b')][_0xa757('0x29')]);}_0x35b41e[_0xa757('0x52')]=qs[_0xa757('0x53')](_0xada3bd[_0xa757('0x4b')][_0xa757('0x53')]);_0x35b41e[_0xa757('0x54')]=qs['filters'](_[_0xa757('0x56')](_0xada3bd[_0xa757('0x4b')],_0x4b60b9[_0xa757('0x55')]));_0x35b41e[_0xa757('0x54')][_0xa757('0xb7')]=_0x1b702f['id'];if(_0xada3bd[_0xa757('0x4b')][_0xa757('0x90')]){_0x35b41e['where']=_[_0xa757('0x38')](_0x35b41e['where'],{'$or':_[_0xa757('0x3f')](_0x35b41e['attributes'],function(_0x4438ec){var _0x1491c7={};_0x1491c7[_0x4438ec]={'$like':'%'+_0xada3bd[_0xa757('0x4b')]['filter']+'%'};return _0x1491c7;})});}if(_0xada3bd['query']['$gte']){var _0xa89e07=_0xada3bd[_0xa757('0x4b')][_0xa757('0x10b')][_0xa757('0x42')](',');var _0x560b05={};_0x560b05[_0xa89e07[0x0]]={'$gte':moment(_0xa89e07[0x1])[_0xa757('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x35b41e[_0xa757('0x54')]=_[_0xa757('0x38')](_0x35b41e[_0xa757('0x54')],_0x560b05);}_0x35b41e=_['merge']({},_0x35b41e,_0xada3bd[_0xa757('0xbe')]);return db['ChatMessage'][_0xa757('0x28')]({'where':_0x35b41e[_0xa757('0x54')]})['then'](function(_0x31c25e){_0x2d7d24[_0xa757('0x28')]=_0x31c25e;if(_0xada3bd[_0xa757('0x4b')]['includeAll']){_0x35b41e['include']=[{'all':!![]}];}return db['ChatMessage'][_0xa757('0x10c')](_0x35b41e);})[_0xa757('0x32')](function(_0x4867c8){_0x2d7d24['rows']=_0x4867c8;return _0x2d7d24;});}})[_0xa757('0x32')](respondWithFilteredResult(_0x566095,_0x35b41e))[_0xa757('0x45')](handleError(_0x566095,null));};exports[_0xa757('0x10d')]=function(_0x4da912,_0x4b0e40,_0x4fe6f5){var _0x3cf8d3={'where':{}},_0x1a1605={},_0x4074a3={'count':0x0,'rows':[]};return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0x4da912[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x4b0e40,null))[_0xa757('0x32')](function(_0x4b3270){if(_0x4b3270){_0x1a1605[_0xa757('0x4a')]=_[_0xa757('0x4c')](db['ChatMessage'][_0xa757('0xbb')]);_0x1a1605[_0xa757('0x4b')]=_[_0xa757('0x4c')](_0x4da912[_0xa757('0x4b')]);_0x1a1605[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x1a1605[_0xa757('0x4a')],_0x1a1605[_0xa757('0x4b')]);_0x3cf8d3[_0xa757('0x4e')]=_[_0xa757('0x4d')](_0x1a1605[_0xa757('0x4a')],qs[_0xa757('0x4f')](_0x4da912['query']['fields']));_0x3cf8d3[_0xa757('0x4e')]=_0x3cf8d3[_0xa757('0x4e')][_0xa757('0x6c')]?_0x3cf8d3[_0xa757('0x4e')]:_0x1a1605[_0xa757('0x4a')];if(!_0x4da912[_0xa757('0x4b')][_0xa757('0x50')]('nolimit')){_0x3cf8d3[_0xa757('0x2a')]=qs[_0xa757('0x2a')](_0x4da912[_0xa757('0x4b')][_0xa757('0x2a')]);_0x3cf8d3[_0xa757('0x29')]=qs[_0xa757('0x29')](_0x4da912[_0xa757('0x4b')]['offset']);}_0x3cf8d3[_0xa757('0x52')]=qs[_0xa757('0x53')](_0x4da912['query']['sort']);_0x3cf8d3['where']=qs[_0xa757('0x55')](_['pick'](_0x4da912['query'],_0x1a1605[_0xa757('0x55')]));_0x3cf8d3[_0xa757('0x54')][_0xa757('0xb7')]=_0x4b3270['id'];if(_0x4da912[_0xa757('0x4b')]['filter']){_0x3cf8d3[_0xa757('0x54')]=_[_0xa757('0x38')](_0x3cf8d3['where'],{'$or':_[_0xa757('0x3f')](_0x3cf8d3[_0xa757('0x4e')],function(_0x2782e3){var _0x2f8045={};_0x2f8045[_0x2782e3]={'$like':'%'+_0x4da912['query'][_0xa757('0x90')]+'%'};return _0x2f8045;})});}_0x3cf8d3[_0xa757('0x54')][_0xa757('0x10e')]=![];if(_0x4da912[_0xa757('0x4b')]['id']){_0x3cf8d3[_0xa757('0x54')]['id']={'$gt':_0x4da912[_0xa757('0x4b')]['id']};}_0x3cf8d3=_[_0xa757('0x38')]({},_0x3cf8d3,_0x4da912[_0xa757('0xbe')]);return db[_0xa757('0xd2')]['count']({'where':_0x3cf8d3[_0xa757('0x54')]})[_0xa757('0x32')](function(_0x409ae1){_0x4074a3[_0xa757('0x28')]=_0x409ae1;_0x3cf8d3[_0xa757('0xbd')]=[];if(_0x4da912[_0xa757('0x4b')][_0xa757('0x10f')]){_0x3cf8d3['include'][_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x7d'),'attributes':['id',_0xa757('0xc7'),_0xa757('0xf3')]});}if(_0x4da912[_0xa757('0x4b')][_0xa757('0xbc')]){_0x3cf8d3[_0xa757('0xbd')]=[{'all':!![]}];}return db[_0xa757('0xd2')]['findAll'](_0x3cf8d3);})[_0xa757('0x32')](function(_0x4c86fd){_0x4074a3['rows']=_0x4c86fd;return _0x4074a3;});}})[_0xa757('0x32')](respondWithFilteredResult(_0x4b0e40,_0x3cf8d3))['catch'](handleError(_0x4b0e40,null));};exports[_0xa757('0x110')]=function(_0x40e0df,_0x54f4ca,_0x4152da){return db['ChatInteraction']['find']({'where':{'id':_0x40e0df[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x54f4ca,null))['then'](function(_0x59ff48){if(_0x59ff48){return _0x59ff48[_0xa757('0x111')](_0x40e0df['body'][_0xa757('0x108')],_[_0xa757('0x109')](_0x40e0df[_0xa757('0x39')],[_0xa757('0x108'),'id'])||{})['spread'](function(){return db[_0xa757('0x7a')][_0xa757('0x10c')]({'attributes':['id',_0xa757('0x35'),_0xa757('0x112')],'where':{'id':_0x40e0df[_0xa757('0x39')][_0xa757('0x108')]}});})[_0xa757('0x32')](function(_0x5d2063){socket[_0xa757('0x113')](_0xa757('0x114'),{'id':Number(_0x40e0df['params']['id']),'tags':_0x5d2063||[]});return{'id':Number(_0x40e0df[_0xa757('0xba')]['id']),'tags':_0x5d2063||[]};});}})[_0xa757('0x32')](respondWithResult(_0x54f4ca,null))['catch'](handleError(_0x54f4ca,null));};exports[_0xa757('0x115')]=function(_0x1474f7,_0x1449d4,_0x2aaf2a){return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x1474f7[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x1449d4,null))[_0xa757('0x32')](function(_0x1ba7d0){if(_0x1ba7d0){return _0x1ba7d0[_0xa757('0x115')](_0x1474f7[_0xa757('0x4b')]['ids']);}})[_0xa757('0x32')](respondWithStatusCode(_0x1449d4,null))[_0xa757('0x45')](handleError(_0x1449d4,null));};exports[_0xa757('0x116')]=function(_0x563988,_0x43e9cb){var _0xaf7112=moment()['unix']()[_0xa757('0xa3')]();var _0x5ea526=path[_0xa757('0xe4')](config['root'],_0xa757('0x117'),_0xa757('0x118'),_0xa757('0x119'));var _0x58f20d=path[_0xa757('0xe4')](config[_0xa757('0x11a')],_0xa757('0x117'),_0xa757('0x118'),_0xa757('0x11b'));var _0x4b274f=path[_0xa757('0xe4')](_0x5ea526,_0xaf7112);var _0x225b14=util[_0xa757('0xe7')](_0xa757('0x11c'),_0x563988[_0xa757('0xba')]['id'],_0xaf7112);var _0x14d04e=path['join'](_0x5ea526,_0x225b14);var _0x3798ea=[];_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x7d'),'attributes':['id',_0xa757('0xc7')],'raw':!![]});_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0xd5')],'as':'Contact','attributes':['id',_0xa757('0x11d'),'lastName'],'raw':!![]});if(_0x563988['query'][_0xa757('0x11b')]){_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0xdf')],'as':'Attachment','raw':!![]});}var _0x3bd69c=[{'model':db['ChatMessage'],'as':_0xa757('0xeb'),'attributes':['id',_0xa757('0x39'),'createdAt',_0xa757('0xf8'),'secret',_0xa757('0x8c')],'include':_0x3798ea}];_0x3bd69c[_0xa757('0x44')]({'model':db[_0xa757('0xc1')],'as':_0xa757('0x11e'),'attributes':['id',_0xa757('0x35')]});_0x3bd69c[_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x11f'),'attributes':['id',_0xa757('0xc7')]});return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x563988['params']['id']},'include':_0x3bd69c})[_0xa757('0x32')](handleEntityNotFound(_0x43e9cb,null))[_0xa757('0x32')](function(_0x374216){if(_0x374216){var _0x1a8c73=_0x374216[_0xa757('0x120')]({'plain':!![]});fs[_0xa757('0x121')](_0x4b274f);var _0xd20b89={'channel':_0xa757('0x122'),'account':_0x1a8c73['Account'][_0xa757('0x35')],'agent':_0x1a8c73['Owner']?_0x1a8c73[_0xa757('0x11f')][_0xa757('0xc7')]:_0xa757('0x123'),'createdAt':moment(_0x1a8c73[_0xa757('0x85')])[_0xa757('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa757('0xa3')](),'closedAt':_0x1a8c73[_0xa757('0xda')]?moment(_0x1a8c73[_0xa757('0x124')])['format'](_0xa757('0x125'))['toString']():'','disposition':_0x1a8c73['disposition'],'chatInfo':{'browser':_0x1a8c73[_0xa757('0x126')],'os':_0x1a8c73[_0xa757('0x127')],'referer':_0x1a8c73[_0xa757('0x128')],'customerIp':_0x1a8c73[_0xa757('0x129')],'customerPort':_0x1a8c73['customerPort']?_0x1a8c73[_0xa757('0x12a')]:_0xa757('0x123')},'messages':_(_0x1a8c73[_0xa757('0xeb')])[_0xa757('0x12b')]()[_0xa757('0x90')]({'secret':![]})['map'](function(_0x535599){if(_0x535599['Attachment']){var _0x56c9b9=path[_0xa757('0xe4')](_0x58f20d,_0x535599['Attachment'][_0xa757('0xe5')]);if(fs[_0xa757('0x12c')](_0x56c9b9)){fs[_0xa757('0x12d')](_0x56c9b9)[_0xa757('0x12e')](fs[_0xa757('0x12f')](path[_0xa757('0xe4')](_0x4b274f,_0x535599[_0xa757('0xdf')][_0xa757('0xe5')])));}}return{'date':moment(_0x535599[_0xa757('0x85')])[_0xa757('0xe7')](_0xa757('0x125'))[_0xa757('0xa3')](),'sender':_0x535599[_0xa757('0xf8')]===_0xa757('0xd1')?_0x535599[_0xa757('0x7d')]?_0x535599[_0xa757('0x7d')][_0xa757('0xc7')]:_0xa757('0xed'):_0x535599[_0xa757('0x72')][_0xa757('0x11d')]+(_0x535599[_0xa757('0x72')][_0xa757('0x130')]?'\x20'+_0x535599[_0xa757('0x72')][_0xa757('0x130')]:''),'body':_0x535599[_0xa757('0xdf')]?_0x535599[_0xa757('0xdf')][_0xa757('0xe5')]:_0x535599[_0xa757('0x39')],'direction':_0x535599['direction']===_0xa757('0xd1')?'A':'C','secret':_0x535599[_0xa757('0x10e')],'read':_0x535599[_0xa757('0x8c')],'attachment':_0x535599[_0xa757('0xdf')]};})['value']()};return ejs[_0xa757('0x131')](path[_0xa757('0xe4')](config[_0xa757('0x11a')],_0xa757('0x117'),_0xa757('0x132'),_0xa757('0x133')),{'interaction':_0xd20b89})[_0xa757('0x32')](function(_0xd7df6f){var _0x7e03ff=path[_0xa757('0xe4')](_0x4b274f,_0xa757('0x134')+_0x1a8c73['id']+'-'+_0xaf7112+_0xa757('0x135'));var _0x1d21e7={'path':_0x7e03ff,'channel':_0xa757('0x122'),'interactionId':_0x1a8c73['id']};return pdf['createPdfFromHTML'](_0xd7df6f,_0x1d21e7);})[_0xa757('0x32')](function(){return new BPromise(function(_0xacfa4b,_0x567517){zipdir(_0x4b274f,{'saveTo':_0x14d04e},function(_0x22e7f5,_0x435552){if(_0x22e7f5)return _0x567517(_0x22e7f5);return _0xacfa4b(_0x435552);});})[_0xa757('0x32')](function(){return new BPromise(function(_0x466f7b,_0x4f5ae1){rimraf(_0x4b274f,function(_0x404003){if(_0x404003)_0x4f5ae1(_0x404003);return _0x466f7b();});});})[_0xa757('0x32')](function(){return _0x43e9cb[_0xa757('0x116')](_0x14d04e,_0x225b14,function(_0x34f745){if(_0x34f745){console[_0xa757('0x136')](_0xa757('0x137'),_0x34f745);}else{fs[_0xa757('0x138')](_0x14d04e);}});});});}else{return _0x43e9cb[_0xa757('0x25')](0xc8);}})[_0xa757('0x45')](handleError(_0x43e9cb,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index c5e7a2a..09ca2a7 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 _0xc5ab=['catch','hasOwnProperty','hook','../../mysqldb','save','update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xc5ab,0x73));var _0xbc5a=function(_0x3566b7,_0x408f7c){_0x3566b7=_0x3566b7-0x0;var _0x10fdc1=_0xc5ab[_0x3566b7];return _0x10fdc1;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xbc5a('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xbc5a('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbc5a('0x1'),'afterUpdate':_0xbc5a('0x2'),'afterDestroy':_0xbc5a('0x3')};function emitEvent(_0x1d8791){return function(_0x28b068,_0x296403,_0x2ab4a0){_0x28b068['getUsers']({'attributes':['id'],'raw':!![]})[_0xbc5a('0x4')](function(_0x54f751){_0x28b068[_0xbc5a('0x5')](_0xbc5a('0x6'),_0x54f751['map'](function(_0x21ad58){return{'id':_0x21ad58['id']};}));return ChatMessage[_0xbc5a('0x7')]({'where':{'ChatInteractionId':_0x28b068['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbc5a('0x4')](function(_0x13ac20){_0x28b068[_0xbc5a('0x5')](_0xbc5a('0x8'),_0x13ac20[_0xbc5a('0x9')]);ChatInteractionEvents['emit'](_0x1d8791+':'+_0x28b068['id'],_0x28b068);ChatInteractionEvents[_0xbc5a('0xa')](_0x1d8791,_0x28b068);_0x2ab4a0(null);})[_0xbc5a('0xb')](_0x2ab4a0(null));};}for(var e in events){if(events[_0xbc5a('0xc')](e)){var event=events[e];ChatInteraction[_0xbc5a('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x5b00=['remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update'];(function(_0x5e80de,_0x27ed58){var _0x4a7825=function(_0x490249){while(--_0x490249){_0x5e80de['push'](_0x5e80de['shift']());}};_0x4a7825(++_0x27ed58);}(_0x5b00,0x150));var _0x05b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5b00[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x05b0('0x0'));var ChatInteraction=require(_0x05b0('0x1'))['db'][_0x05b0('0x2')];var ChatMessage=require(_0x05b0('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x05b0('0x3')](0x0);var events={'afterCreate':_0x05b0('0x4'),'afterUpdate':_0x05b0('0x5'),'afterDestroy':_0x05b0('0x6')};function emitEvent(_0x38d116){return function(_0x4864aa,_0x56a30c,_0x58d374){_0x4864aa[_0x05b0('0x7')]({'attributes':['id'],'raw':!![]})[_0x05b0('0x8')](function(_0x3c285c){_0x4864aa['setDataValue'](_0x05b0('0x9'),_0x3c285c[_0x05b0('0xa')](function(_0x1c3366){return{'id':_0x1c3366['id']};}));return ChatMessage[_0x05b0('0xb')]({'where':{'ChatInteractionId':_0x4864aa['id'],'direction':'in','read':![]},'raw':!![]});})[_0x05b0('0x8')](function(_0x14f09d){_0x4864aa[_0x05b0('0xc')](_0x05b0('0xd'),_0x14f09d['length']);ChatInteractionEvents[_0x05b0('0xe')](_0x38d116+':'+_0x4864aa['id'],_0x4864aa);ChatInteractionEvents[_0x05b0('0xe')](_0x38d116,_0x4864aa);_0x58d374(null);})[_0x05b0('0xf')](_0x58d374(null));};}for(var e in events){if(events[_0x05b0('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x05b0('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 6223ac2..af58a27 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 _0xafa1=['define','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0xafa1,0x1a6));var _0x1afa=function(_0x5b862e,_0x3bc15f){_0x5b862e=_0x5b862e-0x0;var _0x4d2295=_0xafa1[_0x5b862e];return _0x4d2295;};'use strict';var _=require('lodash');var util=require(_0x1afa('0x0'));var logger=require(_0x1afa('0x1'))(_0x1afa('0x2'));var moment=require(_0x1afa('0x3'));var BPromise=require(_0x1afa('0x4'));var rp=require(_0x1afa('0x5'));var fs=require('fs');var path=require(_0x1afa('0x6'));var rimraf=require('rimraf');var config=require(_0x1afa('0x7'));var attributes=require(_0x1afa('0x8'));module[_0x1afa('0x9')]=function(_0x12282a,_0x2e6a0e){return _0x12282a[_0x1afa('0xa')](_0x1afa('0xb'),attributes,{'tableName':_0x1afa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1267b8,_0x5d3dab,_0x327c03){if(_0x1267b8['changed'](_0x1afa('0xd'))){_0x1267b8['closedAt']=moment()[_0x1afa('0xe')](_0x1afa('0xf'));}_0x327c03(null,_0x1267b8);}},'charset':_0x1afa('0x10'),'collate':_0x1afa('0x11')});}; \ No newline at end of file +var _0x447e=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','changed'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0x447e,0x170));var _0xe447=function(_0x1fef69,_0x2d056e){_0x1fef69=_0x1fef69-0x0;var _0x5d0cfb=_0x447e[_0x1fef69];return _0x5d0cfb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe447('0x0'))(_0xe447('0x1'));var moment=require('moment');var BPromise=require(_0xe447('0x2'));var rp=require(_0xe447('0x3'));var fs=require('fs');var path=require(_0xe447('0x4'));var rimraf=require(_0xe447('0x5'));var config=require('../../config/environment');var attributes=require(_0xe447('0x6'));module[_0xe447('0x7')]=function(_0x2a6198,_0x3628b7){return _0x2a6198['define'](_0xe447('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e655a,_0xa52f4a,_0x465c6b){if(_0x4e655a[_0xe447('0x9')]('closed')){_0x4e655a[_0xe447('0xa')]=moment()[_0xe447('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x465c6b(null,_0x4e655a);}},'charset':_0xe447('0xc'),'collate':_0xe447('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 9fbc4f4..fe25bb2 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 _0x5adc=['error','code','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','then','catch','AddTagsToChatInteraction','find','omit','spread','AddTags','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0x5adc,0x10b));var _0xc5ad=function(_0x39fa33,_0xb1c5f7){_0x39fa33=_0x39fa33-0x0;var _0xcab27d=_0x5adc[_0x39fa33];return _0xcab27d;};'use strict';var _=require('lodash');var util=require(_0xc5ad('0x0'));var moment=require(_0xc5ad('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5ad('0x2'));var fs=require('fs');var Redis=require(_0xc5ad('0x3'));var db=require(_0xc5ad('0x4'))['db'];var utils=require(_0xc5ad('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc5ad('0x6'));var jayson=require(_0xc5ad('0x7'));var client=jayson[_0xc5ad('0x8')][_0xc5ad('0x9')]({'port':0x232a});config[_0xc5ad('0xa')]=_[_0xc5ad('0xb')](config[_0xc5ad('0xa')],{'host':_0xc5ad('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5ad('0xa')]));require(_0xc5ad('0xd'))[_0xc5ad('0xe')](socket);function respondWithRpcPromise(_0x5f4e10,_0x4d0e7e,_0x4f8ee2){return new BPromise(function(_0x3b36a1,_0x404e88){return client[_0xc5ad('0xf')](_0x5f4e10,_0x4f8ee2)['then'](function(_0x174bed){logger[_0xc5ad('0x10')](_0xc5ad('0x11'),_0x4d0e7e,'request\x20sent');logger[_0xc5ad('0x12')](_0xc5ad('0x13'),_0x4d0e7e,'request\x20sent',JSON['stringify'](_0x174bed));if(_0x174bed['error']){if(_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x15')]===0x1f4){logger[_0xc5ad('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x4d0e7e,_0x174bed[_0xc5ad('0x14')]['message']);return _0x404e88(_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x16')]);}logger[_0xc5ad('0x14')](_0xc5ad('0x11'),_0x4d0e7e,_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x16')]);return _0x3b36a1(_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x16')]);}else{logger[_0xc5ad('0x10')](_0xc5ad('0x11'),_0x4d0e7e,_0xc5ad('0x17'));_0x3b36a1(_0x174bed[_0xc5ad('0x18')][_0xc5ad('0x16')]);}})['catch'](function(_0x5db34c){logger['error'](_0xc5ad('0x11'),_0x4d0e7e,_0x5db34c);_0x404e88(_0x5db34c);});});}exports[_0xc5ad('0x19')]=function(_0x292288){var _0x18e1dd=this;return new Promise(function(_0x59224d,_0x4f08ed){return db[_0xc5ad('0x1a')][_0xc5ad('0x1b')](_0x292288[_0xc5ad('0x1c')],{'raw':_0x292288['options']?_0x292288['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x292288[_0xc5ad('0x1d')]?_0x292288[_0xc5ad('0x1d')][_0xc5ad('0x1e')]||null:null,'attributes':_0x292288['options']?_0x292288[_0xc5ad('0x1d')][_0xc5ad('0x1f')]||null:null,'limit':_0x292288[_0xc5ad('0x1d')]?_0x292288['options'][_0xc5ad('0x20')]||null:null})[_0xc5ad('0x21')](function(_0x2475c2){logger[_0xc5ad('0x10')](_0xc5ad('0x19'),_0x292288);logger[_0xc5ad('0x12')]('UpdateChatInteraction',_0x292288,JSON['stringify'](_0x2475c2));_0x59224d(_0x2475c2);})[_0xc5ad('0x22')](function(_0x2a73cd){logger[_0xc5ad('0x14')]('UpdateChatInteraction',_0x2a73cd[_0xc5ad('0x16')],_0x292288);_0x4f08ed(_0x18e1dd['error'](0x1f4,_0x2a73cd[_0xc5ad('0x16')]));});});};exports[_0xc5ad('0x23')]=function(_0x13bbba){return new Promise(function(_0x9e48d7,_0x4b95a9){return db['ChatInteraction'][_0xc5ad('0x24')]({'where':_0x13bbba['options']?_0x13bbba[_0xc5ad('0x1d')][_0xc5ad('0x1e')]||null:null})[_0xc5ad('0x21')](function(_0x3aa706){if(_0x3aa706){return _0x3aa706['addTags'](_0x13bbba['body']['ids'],_[_0xc5ad('0x25')](_0x13bbba[_0xc5ad('0x1c')],['ids','id'])||{});}})[_0xc5ad('0x26')](function(_0xe900c5){logger[_0xc5ad('0x10')](_0xc5ad('0x27'),_0x13bbba);logger['debug']('AddTags',_0x13bbba,JSON[_0xc5ad('0x28')](_0xe900c5));_0x9e48d7(_0xe900c5);})['catch'](function(_0x591763){logger['error']('AddTags',_0x591763[_0xc5ad('0x16')],_0x13bbba);_0x4b95a9(_this['error'](0x1f4,_0x591763[_0xc5ad('0x16')]));});});}; \ No newline at end of file +var _0x1c14=['body','options','limit','AddTagsToChatInteraction','find','where','omit','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c14,0xd2));var _0x41c1=function(_0x177c62,_0x3f5b73){_0x177c62=_0x177c62-0x0;var _0x548aca=_0x1c14[_0x177c62];return _0x548aca;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x41c1('0x0'));var BPromise=require(_0x41c1('0x1'));var rs=require(_0x41c1('0x2'));var fs=require('fs');var Redis=require(_0x41c1('0x3'));var db=require(_0x41c1('0x4'))['db'];var utils=require(_0x41c1('0x5'));var logger=require(_0x41c1('0x6'))(_0x41c1('0x7'));var config=require(_0x41c1('0x8'));var jayson=require(_0x41c1('0x9'));var client=jayson[_0x41c1('0xa')][_0x41c1('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x41c1('0xc')],{'host':_0x41c1('0xd'),'port':0x18eb});var socket=require(_0x41c1('0xe'))(new Redis(config[_0x41c1('0xc')]));require(_0x41c1('0xf'))[_0x41c1('0x10')](socket);function respondWithRpcPromise(_0x10cc6c,_0x11593b,_0x2a9c49){return new BPromise(function(_0xb7be5,_0x431e37){return client['request'](_0x10cc6c,_0x2a9c49)[_0x41c1('0x11')](function(_0x47a1ec){logger[_0x41c1('0x12')](_0x41c1('0x13'),_0x11593b,_0x41c1('0x14'));logger[_0x41c1('0x15')](_0x41c1('0x16'),_0x11593b,_0x41c1('0x14'),JSON[_0x41c1('0x17')](_0x47a1ec));if(_0x47a1ec[_0x41c1('0x18')]){if(_0x47a1ec[_0x41c1('0x18')][_0x41c1('0x19')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x11593b,_0x47a1ec[_0x41c1('0x18')][_0x41c1('0x1a')]);return _0x431e37(_0x47a1ec[_0x41c1('0x18')][_0x41c1('0x1a')]);}logger[_0x41c1('0x18')](_0x41c1('0x13'),_0x11593b,_0x47a1ec[_0x41c1('0x18')]['message']);return _0xb7be5(_0x47a1ec['error'][_0x41c1('0x1a')]);}else{logger['info'](_0x41c1('0x13'),_0x11593b,_0x41c1('0x14'));_0xb7be5(_0x47a1ec['result'][_0x41c1('0x1a')]);}})[_0x41c1('0x1b')](function(_0x2660b3){logger['error'](_0x41c1('0x13'),_0x11593b,_0x2660b3);_0x431e37(_0x2660b3);});});}exports[_0x41c1('0x1c')]=function(_0x18c82c){var _0x2fd6d7=this;return new Promise(function(_0x3317be,_0x2da513){return db['ChatInteraction'][_0x41c1('0x1d')](_0x18c82c[_0x41c1('0x1e')],{'raw':_0x18c82c[_0x41c1('0x1f')]?_0x18c82c[_0x41c1('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18c82c[_0x41c1('0x1f')]?_0x18c82c[_0x41c1('0x1f')]['where']||null:null,'attributes':_0x18c82c[_0x41c1('0x1f')]?_0x18c82c[_0x41c1('0x1f')]['attributes']||null:null,'limit':_0x18c82c[_0x41c1('0x1f')]?_0x18c82c['options'][_0x41c1('0x20')]||null:null})[_0x41c1('0x11')](function(_0x30a23a){logger[_0x41c1('0x12')]('UpdateChatInteraction',_0x18c82c);logger['debug']('UpdateChatInteraction',_0x18c82c,JSON['stringify'](_0x30a23a));_0x3317be(_0x30a23a);})['catch'](function(_0x4fa900){logger[_0x41c1('0x18')](_0x41c1('0x1c'),_0x4fa900['message'],_0x18c82c);_0x2da513(_0x2fd6d7[_0x41c1('0x18')](0x1f4,_0x4fa900[_0x41c1('0x1a')]));});});};exports[_0x41c1('0x21')]=function(_0x28ddc0){return new Promise(function(_0x2ea624,_0x4f5740){return db['ChatInteraction'][_0x41c1('0x22')]({'where':_0x28ddc0[_0x41c1('0x1f')]?_0x28ddc0[_0x41c1('0x1f')][_0x41c1('0x23')]||null:null})['then'](function(_0xf2bf15){if(_0xf2bf15){return _0xf2bf15['addTags'](_0x28ddc0[_0x41c1('0x1e')]['ids'],_[_0x41c1('0x24')](_0x28ddc0['body'],[_0x41c1('0x25'),'id'])||{});}})[_0x41c1('0x26')](function(_0x26aae4){logger['info']('AddTags',_0x28ddc0);logger[_0x41c1('0x15')](_0x41c1('0x27'),_0x28ddc0,JSON['stringify'](_0x26aae4));_0x2ea624(_0x26aae4);})[_0x41c1('0x1b')](function(_0x3b938f){logger[_0x41c1('0x18')](_0x41c1('0x27'),_0x3b938f[_0x41c1('0x1a')],_0x28ddc0);_0x4f5740(_this[_0x41c1('0x18')](0x1f4,_0x3b938f['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index a63c3bc..8584625 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 _0x9d89=['register','length','chatInteraction:','remove','emit','removeListener'];(function(_0x5851c0,_0x3f4287){var _0x408a1c=function(_0x3f8794){while(--_0x3f8794){_0x5851c0['push'](_0x5851c0['shift']());}};_0x408a1c(++_0x3f4287);}(_0x9d89,0xd5));var _0x99d8=function(_0x191ee1,_0x43e84c){_0x191ee1=_0x191ee1-0x0;var _0x5e0942=_0x9d89[_0x191ee1];return _0x5e0942;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x99d8('0x0'),'update'];function createListener(_0x421c7f,_0x3f00cb){return function(_0x712a3e){_0x3f00cb[_0x99d8('0x1')](_0x421c7f,_0x712a3e);};}function removeListener(_0x25fd10,_0x1428de){return function(){ChatInteractionEvents[_0x99d8('0x2')](_0x25fd10,_0x1428de);};}exports[_0x99d8('0x3')]=function(_0xe8b79b){for(var _0x1c814a=0x0,_0x34f4d4=events[_0x99d8('0x4')];_0x1c814a<_0x34f4d4;_0x1c814a++){var _0x18e11b=events[_0x1c814a];var _0x336de3=createListener(_0x99d8('0x5')+_0x18e11b,_0xe8b79b);ChatInteractionEvents['on'](_0x18e11b,_0x336de3);}}; \ No newline at end of file +var _0xd0fd=['register','chatInteraction:','./chatInteraction.events','save','emit','removeListener'];(function(_0x1eb755,_0x31610b){var _0x54e51c=function(_0x1c2602){while(--_0x1c2602){_0x1eb755['push'](_0x1eb755['shift']());}};_0x54e51c(++_0x31610b);}(_0xd0fd,0x146));var _0xdd0f=function(_0x73eb36,_0x58feb5){_0x73eb36=_0x73eb36-0x0;var _0x24cb48=_0xd0fd[_0x73eb36];return _0x24cb48;};'use strict';var ChatInteractionEvents=require(_0xdd0f('0x0'));var events=[_0xdd0f('0x1'),'remove','update'];function createListener(_0x341286,_0x31826a){return function(_0x5139d9){_0x31826a[_0xdd0f('0x2')](_0x341286,_0x5139d9);};}function removeListener(_0x814a52,_0x21af32){return function(){ChatInteractionEvents[_0xdd0f('0x3')](_0x814a52,_0x21af32);};}exports[_0xdd0f('0x4')]=function(_0x1936df){for(var _0xb81fa8=0x0,_0x49be38=events['length'];_0xb81fa8<_0x49be38;_0xb81fa8++){var _0x38abd2=events[_0xb81fa8];var _0x1aa0ef=createListener(_0xdd0f('0x5')+_0x38abd2,_0x1936df);ChatInteractionEvents['on'](_0x38abd2,_0x1aa0ef);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 080fc5a..16deea9 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 _0x97f4=['isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','single','file','attachmentUpload','chatinteraction:addtags','addTags','put','tracked','chat','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe'];(function(_0xbac7a6,_0x1cc55f){var _0x41e7e9=function(_0x2d4b01){while(--_0x2d4b01){_0xbac7a6['push'](_0xbac7a6['shift']());}};_0x41e7e9(++_0x1cc55f);}(_0x97f4,0x94));var _0x497f=function(_0x53dc2f,_0x433560){_0x53dc2f=_0x53dc2f-0x0;var _0x275565=_0x97f4[_0x53dc2f];return _0x275565;};'use strict';var multer=require(_0x497f('0x0'));var util=require(_0x497f('0x1'));var path=require(_0x497f('0x2'));var timeout=require('connect-timeout');var express=require(_0x497f('0x3'));var router=express[_0x497f('0x4')]();var fs_extra=require(_0x497f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x497f('0x6'));var config=require(_0x497f('0x7'));var controller=require(_0x497f('0x8'));router[_0x497f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x497f('0x9')](_0x497f('0xa'),auth[_0x497f('0xb')](),controller[_0x497f('0xc')]);router['get'](_0x497f('0xd'),auth[_0x497f('0xe')](),controller[_0x497f('0xf')]);router[_0x497f('0x9')](_0x497f('0x10'),auth[_0x497f('0xe')](),controller[_0x497f('0x11')]);router['get'](_0x497f('0x12'),auth[_0x497f('0xb')](),controller[_0x497f('0x13')]);router['get'](_0x497f('0x14'),auth[_0x497f('0xe')](),controller[_0x497f('0x15')]);router[_0x497f('0x9')]('/:id/download',auth[_0x497f('0xb')](),controller[_0x497f('0x16')]);router[_0x497f('0x17')]('/',auth[_0x497f('0xb')](),controller[_0x497f('0x18')]);router['post'](_0x497f('0x19'),auth['isAuthenticated'](),controller[_0x497f('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c8e00,_0x15ddb5,_0x17d051){_0x17d051(null,path[_0x497f('0x1b')](config[_0x497f('0x1c')],_0x497f('0x1d')));},'filename':function(_0x1d5889,_0x687595,_0x1f61dd){_0x1f61dd(null,util[_0x497f('0x1e')](_0x497f('0x1f'),Date[_0x497f('0x20')](),_0x687595[_0x497f('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x497f('0x22')](_0x497f('0x23')),controller[_0x497f('0x24')]);router[_0x497f('0x17')](_0x497f('0x12'),auth[_0x497f('0xe')](),controller['addMessage']);router[_0x497f('0x17')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked']('chat',_0x497f('0x25')),controller[_0x497f('0x26')]);router[_0x497f('0x27')](_0x497f('0xd'),auth[_0x497f('0xb')](),interaction[_0x497f('0x28')](_0x497f('0x29'),'chatinteraction:update'),controller[_0x497f('0x2a')]);router[_0x497f('0x27')](_0x497f('0x2b'),controller[_0x497f('0x2c')]);router['put'](_0x497f('0x2d'),auth[_0x497f('0xe')](),controller['abandon']);router[_0x497f('0x27')](_0x497f('0x2e'),controller[_0x497f('0x2f')]);router['delete'](_0x497f('0xd'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x497f('0x30')),controller[_0x497f('0x31')]);router['delete'](_0x497f('0x32'),auth[_0x497f('0xb')](),controller[_0x497f('0x33')]);module[_0x497f('0x34')]=router; \ No newline at end of file +var _0x23a6=['file','attachmentUpload','addMessage','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','getMyMessages','download','post','createVidaooSession','diskStorage','join','server/files/attachments/','%s-%s','originalname','replace','single'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x23a6,0x1d4));var _0x623a=function(_0x52dd3c,_0x2bee4b){_0x52dd3c=_0x52dd3c-0x0;var _0x5015f2=_0x23a6[_0x52dd3c];return _0x5015f2;};'use strict';var multer=require(_0x623a('0x0'));var util=require(_0x623a('0x1'));var path=require(_0x623a('0x2'));var timeout=require(_0x623a('0x3'));var express=require(_0x623a('0x4'));var router=express[_0x623a('0x5')]();var fs_extra=require(_0x623a('0x6'));var auth=require(_0x623a('0x7'));var interaction=require(_0x623a('0x8'));var config=require(_0x623a('0x9'));var controller=require('./chatInteraction.controller');router[_0x623a('0xa')]('/',auth[_0x623a('0xb')](),controller[_0x623a('0xc')]);router[_0x623a('0xa')](_0x623a('0xd'),auth[_0x623a('0xb')](),controller[_0x623a('0xe')]);router[_0x623a('0xa')](_0x623a('0xf'),auth[_0x623a('0x10')](),controller[_0x623a('0x11')]);router[_0x623a('0xa')]('/:id/attachment_download',auth[_0x623a('0x10')](),controller[_0x623a('0x12')]);router['get'](_0x623a('0x13'),auth[_0x623a('0xb')](),controller[_0x623a('0x14')]);router[_0x623a('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x623a('0x15')]);router['get']('/:id/download',auth[_0x623a('0xb')](),controller[_0x623a('0x16')]);router['post']('/',auth[_0x623a('0xb')](),controller['create']);router[_0x623a('0x17')]('/:id/vidaoo',auth[_0x623a('0xb')](),controller[_0x623a('0x18')]);var upload=multer({'storage':multer[_0x623a('0x19')]({'destination':function(_0x4469f0,_0x5165d2,_0x5b192c){_0x5b192c(null,path[_0x623a('0x1a')](config['root'],_0x623a('0x1b')));},'filename':function(_0x2601dc,_0x4142d0,_0x22527f){_0x22527f(null,util['format'](_0x623a('0x1c'),Date['now'](),_0x4142d0[_0x623a('0x1d')][_0x623a('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x623a('0x1f')](_0x623a('0x20')),controller[_0x623a('0x21')]);router[_0x623a('0x17')](_0x623a('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x623a('0x22')]);router[_0x623a('0x17')]('/:id/tags',auth[_0x623a('0xb')](),interaction[_0x623a('0x23')]('chat',_0x623a('0x24')),controller[_0x623a('0x25')]);router[_0x623a('0x26')](_0x623a('0xf'),auth[_0x623a('0xb')](),interaction[_0x623a('0x23')](_0x623a('0x27'),_0x623a('0x28')),controller['update']);router[_0x623a('0x26')](_0x623a('0x29'),controller[_0x623a('0x2a')]);router[_0x623a('0x26')](_0x623a('0x2b'),auth[_0x623a('0x10')](),controller['abandon']);router[_0x623a('0x26')](_0x623a('0x2c'),controller['close']);router[_0x623a('0x2d')](_0x623a('0xf'),auth[_0x623a('0xb')](),interaction[_0x623a('0x23')](_0x623a('0x27'),_0x623a('0x2e')),controller[_0x623a('0x2f')]);router[_0x623a('0x2d')]('/:id/tags',auth[_0x623a('0xb')](),controller[_0x623a('0x30')]);module[_0x623a('0x31')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 2d53375..b62af12 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 _0x3e94=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x406ae7,_0x12181b){var _0x5a5b9d=function(_0x3f20c2){while(--_0x3f20c2){_0x406ae7['push'](_0x406ae7['shift']());}};_0x5a5b9d(++_0x12181b);}(_0x3e94,0x1e3));var _0x43e9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3e94[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x43e9('0x0'));module[_0x43e9('0x1')]={'body':{'type':Sequelize['TEXT'](_0x43e9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x43e9('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x43e9('0x4')]}}; \ No newline at end of file +var _0x12a0=['exports','BOOLEAN','INTEGER','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x12a0,0x6f));var _0x012a=function(_0x21b434,_0x4d9fac){_0x21b434=_0x21b434-0x0;var _0x22c0d3=_0x12a0[_0x21b434];return _0x22c0d3;};'use strict';var Sequelize=require(_0x012a('0x0'));module[_0x012a('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x012a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x012a('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 8052889..0e165b4 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 _0x56a7=['userProfileId','autoAssociation','UserProfileResource','isEmpty','role','resourceId','messages','push','ToId','read','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','create','body','find','describe','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','user','fullname','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x1e98f6,_0x454ce1){var _0x54e601=function(_0x148ac3){while(--_0x148ac3){_0x1e98f6['push'](_0x1e98f6['shift']());}};_0x54e601(++_0x454ce1);}(_0x56a7,0x77));var _0x756a=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0x56a7[_0x2ef8f1];return _0x17498d;};'use strict';var emlformat=require(_0x756a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x756a('0x1'));var jsonpatch=require(_0x756a('0x2'));var rp=require(_0x756a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x756a('0x4'));var util=require(_0x756a('0x5'));var path=require(_0x756a('0x6'));var sox=require('sox');var csv=require(_0x756a('0x7'));var ejs=require(_0x756a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x756a('0x9'));var squel=require(_0x756a('0xa'));var crypto=require(_0x756a('0xb'));var jsforce=require(_0x756a('0xc'));var deskjs=require(_0x756a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x756a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x756a('0xf'));var qs=require(_0x756a('0x10'));var as=require(_0x756a('0x11'));var hardwareService=require(_0x756a('0x12'));var logger=require('../../config/logger')(_0x756a('0x13'));var utils=require(_0x756a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x756a('0x15'));var db=require('../../mysqldb')['db'];config[_0x756a('0x16')]=_[_0x756a('0x17')](config['redis'],{'host':_0x756a('0x18'),'port':0x18eb});var socket=require(_0x756a('0x19'))(new Redis(config[_0x756a('0x16')]));require('./chatInternalMessage.socket')[_0x756a('0x1a')](socket);function respondWithStatusCode(_0x6e2cd8,_0x1e2b03){_0x1e2b03=_0x1e2b03||0xcc;return function(_0x2c0fd7){if(_0x2c0fd7){return _0x6e2cd8['sendStatus'](_0x1e2b03);}return _0x6e2cd8['status'](_0x1e2b03)['end']();};}function respondWithResult(_0x401140,_0x6487de){_0x6487de=_0x6487de||0xc8;return function(_0x3a8d9d){if(_0x3a8d9d){return _0x401140['status'](_0x6487de)[_0x756a('0x1b')](_0x3a8d9d);}};}function respondWithFilteredResult(_0x36c858,_0x29d0c7){return function(_0x1f552d){if(_0x1f552d){var _0x32773a=typeof _0x29d0c7[_0x756a('0x1c')]===_0x756a('0x1d')&&typeof _0x29d0c7[_0x756a('0x1e')]===_0x756a('0x1d');var _0x143757=_0x1f552d[_0x756a('0x1f')];var _0x27b367=_0x32773a?0x0:_0x29d0c7[_0x756a('0x1c')];var _0x3c58c3=_0x32773a?_0x1f552d[_0x756a('0x1f')]:_0x29d0c7['offset']+_0x29d0c7[_0x756a('0x1e')];var _0x3fc115;if(_0x3c58c3>=_0x143757){_0x3c58c3=_0x143757;_0x3fc115=0xc8;}else{_0x3fc115=0xce;}_0x36c858[_0x756a('0x20')](_0x3fc115);return _0x36c858['set'](_0x756a('0x21'),_0x27b367+'-'+_0x3c58c3+'/'+_0x143757)[_0x756a('0x1b')](_0x1f552d);}return null;};}function patchUpdates(_0x30c626){return function(_0x55fd84){try{jsonpatch[_0x756a('0x22')](_0x55fd84,_0x30c626,!![]);}catch(_0x3423ff){return BPromise[_0x756a('0x23')](_0x3423ff);}return _0x55fd84[_0x756a('0x24')]();};}function saveUpdates(_0x5b28f7,_0x5d5db6){return function(_0x98f872){if(_0x98f872){return _0x98f872[_0x756a('0x25')](_0x5b28f7)['then'](function(_0x59d914){return _0x59d914;});}return null;};}function removeEntity(_0x1be1d7,_0x44cd1f){return function(_0x5290ab){if(_0x5290ab){return _0x5290ab[_0x756a('0x26')]()[_0x756a('0x27')](function(){_0x1be1d7[_0x756a('0x20')](0xcc)[_0x756a('0x28')]();});}};}function handleEntityNotFound(_0x192785,_0x416693){return function(_0x5e762e){if(!_0x5e762e){_0x192785[_0x756a('0x29')](0x194);}return _0x5e762e;};}function handleError(_0x46c147,_0x157dcc){_0x157dcc=_0x157dcc||0x1f4;return function(_0x38fcc3){logger[_0x756a('0x2a')](_0x38fcc3[_0x756a('0x2b')]);if(_0x38fcc3[_0x756a('0x2c')]){delete _0x38fcc3[_0x756a('0x2c')];}_0x46c147['status'](_0x157dcc)[_0x756a('0x2d')](_0x38fcc3);};}exports[_0x756a('0x2e')]=function(_0x2060ff,_0x155585){var _0x45b997={},_0x5a65e7={},_0x297553={'count':0x0,'rows':[]};var _0x323fe0=_[_0x756a('0x2f')](db[_0x756a('0x30')][_0x756a('0x31')],function(_0x2d6c81){return{'name':_0x2d6c81[_0x756a('0x32')],'type':_0x2d6c81[_0x756a('0x33')][_0x756a('0x34')]};});_0x5a65e7[_0x756a('0x35')]=_[_0x756a('0x2f')](_0x323fe0,_0x756a('0x2c'));_0x5a65e7[_0x756a('0x36')]=_[_0x756a('0x37')](_0x2060ff['query']);_0x5a65e7[_0x756a('0x38')]=_['intersection'](_0x5a65e7[_0x756a('0x35')],_0x5a65e7[_0x756a('0x36')]);_0x45b997[_0x756a('0x39')]=_[_0x756a('0x3a')](_0x5a65e7['model'],qs['fields'](_0x2060ff[_0x756a('0x36')][_0x756a('0x3b')]));_0x45b997[_0x756a('0x39')]=_0x45b997[_0x756a('0x39')][_0x756a('0x3c')]?_0x45b997[_0x756a('0x39')]:_0x5a65e7[_0x756a('0x35')];if(!_0x2060ff[_0x756a('0x36')][_0x756a('0x3d')](_0x756a('0x3e'))){_0x45b997[_0x756a('0x1e')]=qs[_0x756a('0x1e')](_0x2060ff['query']['limit']);_0x45b997[_0x756a('0x1c')]=qs[_0x756a('0x1c')](_0x2060ff[_0x756a('0x36')]['offset']);}_0x45b997['order']=qs[_0x756a('0x3f')](_0x2060ff['query'][_0x756a('0x3f')]);_0x45b997['where']=qs[_0x756a('0x38')](_[_0x756a('0x40')](_0x2060ff[_0x756a('0x36')],_0x5a65e7['filters']),_0x323fe0);if(_0x2060ff[_0x756a('0x36')][_0x756a('0x41')]){_0x45b997[_0x756a('0x42')]=_['merge'](_0x45b997['where'],{'$or':_[_0x756a('0x2f')](_0x323fe0,function(_0x314a7d){if(_0x314a7d['type']!==_0x756a('0x43')){var _0x2d97e7={};_0x2d97e7[_0x314a7d[_0x756a('0x2c')]]={'$like':'%'+_0x2060ff[_0x756a('0x36')]['filter']+'%'};return _0x2d97e7;}})});}_0x45b997=_[_0x756a('0x44')]({},_0x45b997,_0x2060ff[_0x756a('0x45')]);var _0x270a7d={'where':_0x45b997[_0x756a('0x42')]};return db[_0x756a('0x30')][_0x756a('0x1f')](_0x270a7d)[_0x756a('0x27')](function(_0x5cde78){_0x297553[_0x756a('0x1f')]=_0x5cde78;if(_0x2060ff['query']['includeAll']){_0x45b997[_0x756a('0x46')]=[{'all':!![]}];}return db[_0x756a('0x30')][_0x756a('0x47')](_0x45b997);})[_0x756a('0x27')](function(_0x129f5){_0x297553[_0x756a('0x48')]=_0x129f5;return _0x297553;})['then'](respondWithFilteredResult(_0x155585,_0x45b997))[_0x756a('0x49')](handleError(_0x155585,null));};exports[_0x756a('0x4a')]=function(_0x5d8d45,_0x3f80be){var _0x5d44ec={'raw':!![],'where':{'id':_0x5d8d45[_0x756a('0x4b')]['id']}},_0x14851a={};_0x14851a[_0x756a('0x35')]=_[_0x756a('0x37')](db[_0x756a('0x30')][_0x756a('0x31')]);_0x14851a['query']=_[_0x756a('0x37')](_0x5d8d45[_0x756a('0x36')]);_0x14851a['filters']=_['intersection'](_0x14851a[_0x756a('0x35')],_0x14851a[_0x756a('0x36')]);_0x5d44ec[_0x756a('0x39')]=_[_0x756a('0x3a')](_0x14851a['model'],qs[_0x756a('0x3b')](_0x5d8d45[_0x756a('0x36')][_0x756a('0x3b')]));_0x5d44ec[_0x756a('0x39')]=_0x5d44ec['attributes'][_0x756a('0x3c')]?_0x5d44ec[_0x756a('0x39')]:_0x14851a[_0x756a('0x35')];if(_0x5d8d45[_0x756a('0x36')]['includeAll']){_0x5d44ec[_0x756a('0x46')]=[{'all':!![]}];}_0x5d44ec=_[_0x756a('0x44')]({},_0x5d44ec,_0x5d8d45[_0x756a('0x45')]);return db[_0x756a('0x30')]['find'](_0x5d44ec)[_0x756a('0x27')](handleEntityNotFound(_0x3f80be,null))[_0x756a('0x27')](respondWithResult(_0x3f80be,null))[_0x756a('0x49')](handleError(_0x3f80be,null));};exports['create']=function(_0x46ae43,_0x32dfb8){return db[_0x756a('0x30')][_0x756a('0x4c')](_0x46ae43[_0x756a('0x4d')],{})['then'](respondWithResult(_0x32dfb8,0xc9))[_0x756a('0x49')](handleError(_0x32dfb8,null));};exports[_0x756a('0x25')]=function(_0x31efdf,_0x18da84){if(_0x31efdf[_0x756a('0x4d')]['id']){delete _0x31efdf['body']['id'];}return db[_0x756a('0x30')][_0x756a('0x4e')]({'where':{'id':_0x31efdf[_0x756a('0x4b')]['id']}})[_0x756a('0x27')](handleEntityNotFound(_0x18da84,null))[_0x756a('0x27')](saveUpdates(_0x31efdf[_0x756a('0x4d')],null))[_0x756a('0x27')](respondWithResult(_0x18da84,null))[_0x756a('0x49')](handleError(_0x18da84,null));};exports[_0x756a('0x26')]=function(_0x24d3eb,_0x4ce710){return db[_0x756a('0x30')][_0x756a('0x4e')]({'where':{'id':_0x24d3eb['params']['id']}})[_0x756a('0x27')](handleEntityNotFound(_0x4ce710,null))[_0x756a('0x27')](removeEntity(_0x4ce710,null))[_0x756a('0x49')](handleError(_0x4ce710,null));};exports[_0x756a('0x4f')]=function(_0x341810,_0x364349){return db['ChatInternalMessage']['describe']()[_0x756a('0x27')](respondWithResult(_0x364349,null))[_0x756a('0x49')](handleError(_0x364349,null));};function wrapUser(_0x63fa63){return function(_0x4e783e){var _0x434542=_0x63fa63['get']({'plain':!![]});_0x434542['messages']=[];if(_0x4e783e){_0x434542[_0x756a('0x50')]=_0x4e783e[_0x756a('0x51')];_0x434542[_0x756a('0x52')]=_0x4e783e;}else{_0x434542[_0x756a('0x50')]=moment(0x0)[_0x756a('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x434542[_0x756a('0x52')]={};}return _0x434542;};}exports[_0x756a('0x54')]=function(_0x29dc28,_0x1df751,_0x13c484){var _0x7b003f=[];return db[_0x756a('0x55')][_0x756a('0x47')]({'where':{'role':[_0x756a('0x56'),'admin',_0x756a('0x57')]},'attributes':['id',_0x756a('0x58'),_0x756a('0x2c'),'role',_0x756a('0x59'),_0x756a('0x5a'),'online',_0x756a('0x5b'),_0x756a('0x5c'),_0x756a('0x5d')],'order':qs[_0x756a('0x3f')](_0x756a('0x5e')),'include':[{'model':db['VoiceQueue'],'as':_0x756a('0x5f'),'attributes':['id',_0x756a('0x2c'),_0x756a('0x33')],'through':{'attributes':[]}}]})[_0x756a('0x27')](function(_0xf4aeeb){if(_0xf4aeeb){var _0x3b98fd=_0x29dc28['user'][_0x756a('0x60')]({'plain':!![]});if(!_0x3b98fd)throw new Error(_0x756a('0x61'));if(_0x3b98fd['role']===_0x756a('0x57')){return db[_0x756a('0x62')]['find']({'where':{'name':'Agents','userProfileId':_0x3b98fd[_0x756a('0x63')]},'raw':!![]})[_0x756a('0x27')](function(_0x99ad21){if(_0x99ad21){if(_0x99ad21[_0x756a('0x64')]===0x0){return db[_0x756a('0x65')][_0x756a('0x47')]({'where':{'sectionId':_0x99ad21['id']},'raw':!![]})[_0x756a('0x27')](function(_0x4b3dcf){var _0x47a842=[];if(_[_0x756a('0x66')](_0x4b3dcf)){_0x47a842=_[_0x756a('0x41')](_0xf4aeeb,function(_0x70f717){if(_0x70f717['role']!==_0x756a('0x56')){return _0x70f717;}});return _0x47a842;}else{for(var _0x5ef4b2=0x0;_0x5ef4b2<_0xf4aeeb[_0x756a('0x3c')];_0x5ef4b2++){var _0x1192a4=_0xf4aeeb[_0x5ef4b2];if(_0x1192a4[_0x756a('0x67')]===_0x756a('0x56')){var _0x2206ab=_[_0x756a('0x4e')](_0x4b3dcf,function(_0x31d5d9){return _0x31d5d9[_0x756a('0x68')]===_0x1192a4['id'];});if(_0x2206ab)_0x47a842['push'](_0x1192a4);}else{_0x47a842['push'](_0x1192a4);}}return _0x47a842;}});}else{return _0xf4aeeb;}}else{var _0x14e457=_[_0x756a('0x41')](_0xf4aeeb,function(_0xcfdfc5){if(_0xcfdfc5[_0x756a('0x67')]!==_0x756a('0x56')){return _0xcfdfc5;}});return _0x14e457;}});}else{return _0xf4aeeb;}}})['then'](function(_0x550e3c){var _0x50ba78=[];if(_0x550e3c){_0x7b003f=_0x550e3c;for(var _0x280fe5=0x0;_0x280fe5<_0x550e3c['length'];_0x280fe5+=0x1){_0x7b003f[_0x280fe5][_0x756a('0x69')]=[];_0x50ba78[_0x756a('0x6a')](db[_0x756a('0x30')][_0x756a('0x4e')]({'where':{'FromId':[_0x29dc28[_0x756a('0x57')]['id'],_0x550e3c[_0x280fe5]['id']],'ToId':[_0x29dc28[_0x756a('0x57')]['id'],_0x550e3c[_0x280fe5]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x756a('0x6b'),_0x756a('0x6c'),_0x756a('0x4d')],'order':qs[_0x756a('0x3f')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x756a('0x27')](wrapUser(_0x550e3c[_0x280fe5])));}return BPromise['all'](_0x50ba78);}return[];})[_0x756a('0x27')](function(_0x5bf72e){return{'rows':_0x5bf72e,'count':_0x5bf72e[_0x756a('0x3c')]};})[_0x756a('0x27')](respondWithResult(_0x1df751,null))[_0x756a('0x49')](handleError(_0x1df751,null));}; \ No newline at end of file +var _0x4108=['name','index','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','admin','user','fullname','role','internal','online','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','stack'];(function(_0x3819e5,_0x189bbd){var _0x2041c5=function(_0x3b8fee){while(--_0x3b8fee){_0x3819e5['push'](_0x3819e5['shift']());}};_0x2041c5(++_0x189bbd);}(_0x4108,0xb2));var _0x8410=function(_0x2d23df,_0x509f3e){_0x2d23df=_0x2d23df-0x0;var _0x5b20ce=_0x4108[_0x2d23df];return _0x5b20ce;};'use strict';var emlformat=require(_0x8410('0x0'));var rimraf=require(_0x8410('0x1'));var zipdir=require(_0x8410('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8410('0x3'));var moment=require(_0x8410('0x4'));var BPromise=require(_0x8410('0x5'));var Mustache=require(_0x8410('0x6'));var util=require(_0x8410('0x7'));var path=require(_0x8410('0x8'));var sox=require(_0x8410('0x9'));var csv=require(_0x8410('0xa'));var ejs=require(_0x8410('0xb'));var fs=require('fs');var fs_extra=require(_0x8410('0xc'));var _=require(_0x8410('0xd'));var squel=require('squel');var crypto=require(_0x8410('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8410('0xa'));var querystring=require(_0x8410('0xf'));var Papa=require('papaparse');var Redis=require(_0x8410('0x10'));var authService=require(_0x8410('0x11'));var qs=require(_0x8410('0x12'));var as=require(_0x8410('0x13'));var hardwareService=require(_0x8410('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x8410('0x15'));var config=require(_0x8410('0x16'));var licenseUtil=require(_0x8410('0x17'));var db=require(_0x8410('0x18'))['db'];config[_0x8410('0x19')]=_[_0x8410('0x1a')](config[_0x8410('0x19')],{'host':_0x8410('0x1b'),'port':0x18eb});var socket=require(_0x8410('0x1c'))(new Redis(config['redis']));require(_0x8410('0x1d'))[_0x8410('0x1e')](socket);function respondWithStatusCode(_0x20ad6e,_0x5836d6){_0x5836d6=_0x5836d6||0xcc;return function(_0x2a39c9){if(_0x2a39c9){return _0x20ad6e[_0x8410('0x1f')](_0x5836d6);}return _0x20ad6e[_0x8410('0x20')](_0x5836d6)['end']();};}function respondWithResult(_0x24492d,_0x205ccd){_0x205ccd=_0x205ccd||0xc8;return function(_0x2b43fa){if(_0x2b43fa){return _0x24492d[_0x8410('0x20')](_0x205ccd)[_0x8410('0x21')](_0x2b43fa);}};}function respondWithFilteredResult(_0x49a940,_0x18a9d5){return function(_0x44c5ba){if(_0x44c5ba){var _0x350308=typeof _0x18a9d5['offset']===_0x8410('0x22')&&typeof _0x18a9d5[_0x8410('0x23')]===_0x8410('0x22');var _0x5cc727=_0x44c5ba[_0x8410('0x24')];var _0x27feb5=_0x350308?0x0:_0x18a9d5['offset'];var _0x369986=_0x350308?_0x44c5ba[_0x8410('0x24')]:_0x18a9d5['offset']+_0x18a9d5[_0x8410('0x23')];var _0x500419;if(_0x369986>=_0x5cc727){_0x369986=_0x5cc727;_0x500419=0xc8;}else{_0x500419=0xce;}_0x49a940[_0x8410('0x20')](_0x500419);return _0x49a940[_0x8410('0x25')]('Content-Range',_0x27feb5+'-'+_0x369986+'/'+_0x5cc727)[_0x8410('0x21')](_0x44c5ba);}return null;};}function patchUpdates(_0x1fa3dd){return function(_0x2a16bd){try{jsonpatch[_0x8410('0x26')](_0x2a16bd,_0x1fa3dd,!![]);}catch(_0x16db94){return BPromise[_0x8410('0x27')](_0x16db94);}return _0x2a16bd[_0x8410('0x28')]();};}function saveUpdates(_0x2731a2,_0x500605){return function(_0xa6fa2){if(_0xa6fa2){return _0xa6fa2['update'](_0x2731a2)[_0x8410('0x29')](function(_0x477e3a){return _0x477e3a;});}return null;};}function removeEntity(_0x3fb848,_0xad6271){return function(_0xf7bbc3){if(_0xf7bbc3){return _0xf7bbc3[_0x8410('0x2a')]()[_0x8410('0x29')](function(){_0x3fb848[_0x8410('0x20')](0xcc)[_0x8410('0x2b')]();});}};}function handleEntityNotFound(_0x3b95a7,_0x420cc0){return function(_0x5de78c){if(!_0x5de78c){_0x3b95a7['sendStatus'](0x194);}return _0x5de78c;};}function handleError(_0x46f143,_0x115997){_0x115997=_0x115997||0x1f4;return function(_0x4e3033){logger[_0x8410('0x2c')](_0x4e3033[_0x8410('0x2d')]);if(_0x4e3033['name']){delete _0x4e3033[_0x8410('0x2e')];}_0x46f143[_0x8410('0x20')](_0x115997)['send'](_0x4e3033);};}exports[_0x8410('0x2f')]=function(_0x4228b3,_0xcea616){var _0xc54207={},_0x7cfc35={},_0x1210a4={'count':0x0,'rows':[]};var _0x1b2f42=_['map'](db[_0x8410('0x30')]['rawAttributes'],function(_0x260ad6){return{'name':_0x260ad6[_0x8410('0x31')],'type':_0x260ad6[_0x8410('0x32')][_0x8410('0x33')]};});_0x7cfc35[_0x8410('0x34')]=_['map'](_0x1b2f42,_0x8410('0x2e'));_0x7cfc35[_0x8410('0x35')]=_[_0x8410('0x36')](_0x4228b3['query']);_0x7cfc35[_0x8410('0x37')]=_['intersection'](_0x7cfc35[_0x8410('0x34')],_0x7cfc35['query']);_0xc54207[_0x8410('0x38')]=_[_0x8410('0x39')](_0x7cfc35['model'],qs[_0x8410('0x3a')](_0x4228b3['query'][_0x8410('0x3a')]));_0xc54207[_0x8410('0x38')]=_0xc54207[_0x8410('0x38')][_0x8410('0x3b')]?_0xc54207[_0x8410('0x38')]:_0x7cfc35[_0x8410('0x34')];if(!_0x4228b3[_0x8410('0x35')][_0x8410('0x3c')](_0x8410('0x3d'))){_0xc54207[_0x8410('0x23')]=qs['limit'](_0x4228b3['query'][_0x8410('0x23')]);_0xc54207[_0x8410('0x3e')]=qs['offset'](_0x4228b3['query'][_0x8410('0x3e')]);}_0xc54207[_0x8410('0x3f')]=qs[_0x8410('0x40')](_0x4228b3['query'][_0x8410('0x40')]);_0xc54207['where']=qs['filters'](_['pick'](_0x4228b3['query'],_0x7cfc35['filters']),_0x1b2f42);if(_0x4228b3['query'][_0x8410('0x41')]){_0xc54207[_0x8410('0x42')]=_[_0x8410('0x43')](_0xc54207[_0x8410('0x42')],{'$or':_[_0x8410('0x44')](_0x1b2f42,function(_0x2cd039){if(_0x2cd039[_0x8410('0x32')]!==_0x8410('0x45')){var _0x9933be={};_0x9933be[_0x2cd039['name']]={'$like':'%'+_0x4228b3[_0x8410('0x35')]['filter']+'%'};return _0x9933be;}})});}_0xc54207=_[_0x8410('0x43')]({},_0xc54207,_0x4228b3[_0x8410('0x46')]);var _0x20ad5e={'where':_0xc54207[_0x8410('0x42')]};return db['ChatInternalMessage'][_0x8410('0x24')](_0x20ad5e)[_0x8410('0x29')](function(_0x506525){_0x1210a4[_0x8410('0x24')]=_0x506525;if(_0x4228b3[_0x8410('0x35')][_0x8410('0x47')]){_0xc54207[_0x8410('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x8410('0x49')](_0xc54207);})[_0x8410('0x29')](function(_0x57bb51){_0x1210a4[_0x8410('0x4a')]=_0x57bb51;return _0x1210a4;})[_0x8410('0x29')](respondWithFilteredResult(_0xcea616,_0xc54207))['catch'](handleError(_0xcea616,null));};exports[_0x8410('0x4b')]=function(_0x3bdd76,_0x1fcccc){var _0x57c2b9={'raw':!![],'where':{'id':_0x3bdd76[_0x8410('0x4c')]['id']}},_0x372de9={};_0x372de9[_0x8410('0x34')]=_[_0x8410('0x36')](db['ChatInternalMessage']['rawAttributes']);_0x372de9[_0x8410('0x35')]=_[_0x8410('0x36')](_0x3bdd76['query']);_0x372de9[_0x8410('0x37')]=_[_0x8410('0x39')](_0x372de9[_0x8410('0x34')],_0x372de9[_0x8410('0x35')]);_0x57c2b9[_0x8410('0x38')]=_['intersection'](_0x372de9[_0x8410('0x34')],qs[_0x8410('0x3a')](_0x3bdd76[_0x8410('0x35')]['fields']));_0x57c2b9[_0x8410('0x38')]=_0x57c2b9[_0x8410('0x38')]['length']?_0x57c2b9[_0x8410('0x38')]:_0x372de9[_0x8410('0x34')];if(_0x3bdd76[_0x8410('0x35')][_0x8410('0x47')]){_0x57c2b9['include']=[{'all':!![]}];}_0x57c2b9=_[_0x8410('0x43')]({},_0x57c2b9,_0x3bdd76[_0x8410('0x46')]);return db[_0x8410('0x30')][_0x8410('0x4d')](_0x57c2b9)[_0x8410('0x29')](handleEntityNotFound(_0x1fcccc,null))[_0x8410('0x29')](respondWithResult(_0x1fcccc,null))['catch'](handleError(_0x1fcccc,null));};exports[_0x8410('0x4e')]=function(_0x18d46b,_0x324e34){return db[_0x8410('0x30')][_0x8410('0x4e')](_0x18d46b[_0x8410('0x4f')],{})[_0x8410('0x29')](respondWithResult(_0x324e34,0xc9))[_0x8410('0x50')](handleError(_0x324e34,null));};exports['update']=function(_0x183020,_0x1032d3){if(_0x183020[_0x8410('0x4f')]['id']){delete _0x183020[_0x8410('0x4f')]['id'];}return db['ChatInternalMessage'][_0x8410('0x4d')]({'where':{'id':_0x183020[_0x8410('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1032d3,null))['then'](saveUpdates(_0x183020['body'],null))[_0x8410('0x29')](respondWithResult(_0x1032d3,null))[_0x8410('0x50')](handleError(_0x1032d3,null));};exports['destroy']=function(_0x281c6b,_0x422b1d){return db[_0x8410('0x30')][_0x8410('0x4d')]({'where':{'id':_0x281c6b[_0x8410('0x4c')]['id']}})['then'](handleEntityNotFound(_0x422b1d,null))[_0x8410('0x29')](removeEntity(_0x422b1d,null))[_0x8410('0x50')](handleError(_0x422b1d,null));};exports[_0x8410('0x51')]=function(_0x1af71f,_0x30aced){return db[_0x8410('0x30')]['describe']()['then'](respondWithResult(_0x30aced,null))[_0x8410('0x50')](handleError(_0x30aced,null));};function wrapUser(_0x4af6e9){return function(_0x2bb78b){var _0x7df79e=_0x4af6e9[_0x8410('0x52')]({'plain':!![]});_0x7df79e[_0x8410('0x53')]=[];if(_0x2bb78b){_0x7df79e[_0x8410('0x54')]=_0x2bb78b[_0x8410('0x55')];_0x7df79e['lastMessage']=_0x2bb78b;}else{_0x7df79e[_0x8410('0x54')]=moment(0x0)['format'](_0x8410('0x56'));_0x7df79e[_0x8410('0x57')]={};}return _0x7df79e;};}exports[_0x8410('0x58')]=function(_0x20f7f6,_0x6ef99d,_0x2e8d9a){var _0x292c5c=[];return db[_0x8410('0x59')][_0x8410('0x49')]({'where':{'role':['agent',_0x8410('0x5a'),_0x8410('0x5b')]},'attributes':['id',_0x8410('0x5c'),_0x8410('0x2e'),_0x8410('0x5d'),'userpic',_0x8410('0x5e'),_0x8410('0x5f'),'lastLoginAt',_0x8410('0x60'),_0x8410('0x61')],'order':qs[_0x8410('0x40')]('-online'),'include':[{'model':db[_0x8410('0x62')],'as':_0x8410('0x63'),'attributes':['id',_0x8410('0x2e'),_0x8410('0x32')],'through':{'attributes':[]}}]})[_0x8410('0x29')](function(_0x5861cc){if(_0x5861cc){var _0x2fe7cc=_0x20f7f6[_0x8410('0x5b')]['get']({'plain':!![]});if(!_0x2fe7cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fe7cc[_0x8410('0x5d')]==='user'){return db[_0x8410('0x64')][_0x8410('0x4d')]({'where':{'name':'Agents','userProfileId':_0x2fe7cc[_0x8410('0x65')]},'raw':!![]})[_0x8410('0x29')](function(_0x5dbd15){if(_0x5dbd15){if(_0x5dbd15[_0x8410('0x66')]===0x0){return db[_0x8410('0x67')][_0x8410('0x49')]({'where':{'sectionId':_0x5dbd15['id']},'raw':!![]})[_0x8410('0x29')](function(_0xe7cf8){var _0x4e9407=[];if(_[_0x8410('0x68')](_0xe7cf8)){_0x4e9407=_[_0x8410('0x41')](_0x5861cc,function(_0x11fdb5){if(_0x11fdb5['role']!==_0x8410('0x69')){return _0x11fdb5;}});return _0x4e9407;}else{for(var _0x3d08f4=0x0;_0x3d08f4<_0x5861cc[_0x8410('0x3b')];_0x3d08f4++){var _0x23e433=_0x5861cc[_0x3d08f4];if(_0x23e433[_0x8410('0x5d')]===_0x8410('0x69')){var _0x3c00b6=_[_0x8410('0x4d')](_0xe7cf8,function(_0x1934d4){return _0x1934d4[_0x8410('0x6a')]===_0x23e433['id'];});if(_0x3c00b6)_0x4e9407[_0x8410('0x6b')](_0x23e433);}else{_0x4e9407[_0x8410('0x6b')](_0x23e433);}}return _0x4e9407;}});}else{return _0x5861cc;}}else{var _0x41a0d0=_[_0x8410('0x41')](_0x5861cc,function(_0x2c4f64){if(_0x2c4f64[_0x8410('0x5d')]!==_0x8410('0x69')){return _0x2c4f64;}});return _0x41a0d0;}});}else{return _0x5861cc;}}})[_0x8410('0x29')](function(_0x36f5c5){var _0x1e6da4=[];if(_0x36f5c5){_0x292c5c=_0x36f5c5;for(var _0x3675c1=0x0;_0x3675c1<_0x36f5c5['length'];_0x3675c1+=0x1){_0x292c5c[_0x3675c1]['messages']=[];_0x1e6da4[_0x8410('0x6b')](db['ChatInternalMessage'][_0x8410('0x4d')]({'where':{'FromId':[_0x20f7f6[_0x8410('0x5b')]['id'],_0x36f5c5[_0x3675c1]['id']],'ToId':[_0x20f7f6[_0x8410('0x5b')]['id'],_0x36f5c5[_0x3675c1]['id']],'ChatGroupId':null},'attributes':['id',_0x8410('0x55'),'FromId',_0x8410('0x6c'),_0x8410('0x6d'),'body'],'order':qs[_0x8410('0x40')](_0x8410('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8410('0x29')](wrapUser(_0x36f5c5[_0x3675c1])));}return BPromise[_0x8410('0x6f')](_0x1e6da4);}return[];})['then'](function(_0x214ed4){return{'rows':_0x214ed4,'count':_0x214ed4[_0x8410('0x3b')]};})['then'](respondWithResult(_0x6ef99d,null))[_0x8410('0x50')](handleError(_0x6ef99d,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 511a211..1cbd832 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 _0x1a80=['save','remove','emit','hasOwnProperty','hook','events','ChatInternalMessage'];(function(_0x355d8c,_0x2de949){var _0xd527fa=function(_0x49ca82){while(--_0x49ca82){_0x355d8c['push'](_0x355d8c['shift']());}};_0xd527fa(++_0x2de949);}(_0x1a80,0x1e1));var _0x01a8=function(_0x2b063d,_0x57b7c2){_0x2b063d=_0x2b063d-0x0;var _0x17bceb=_0x1a80[_0x2b063d];return _0x17bceb;};'use strict';var EventEmitter=require(_0x01a8('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x01a8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x01a8('0x2'),'afterUpdate':'update','afterDestroy':_0x01a8('0x3')};function emitEvent(_0x2b5c85){return function(_0xb926,_0x2872f4,_0xb25951){ChatInternalMessageEvents[_0x01a8('0x4')](_0x2b5c85+':'+_0xb926['id'],_0xb926);ChatInternalMessageEvents['emit'](_0x2b5c85,_0xb926);_0xb25951(null);};}for(var e in events){if(events[_0x01a8('0x5')](e)){var event=events[e];ChatInternalMessage[_0x01a8('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xbb1f=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hook'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xbb1f,0x68));var _0xfbb1=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xbb1f[_0x3e2fcf];return _0x497db7;};'use strict';var EventEmitter=require(_0xfbb1('0x0'));var ChatInternalMessage=require(_0xfbb1('0x1'))['db'][_0xfbb1('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xfbb1('0x3')](0x0);var events={'afterCreate':_0xfbb1('0x4'),'afterUpdate':_0xfbb1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5baec0){return function(_0x3119b1,_0x41f5b4,_0x5a261c){ChatInternalMessageEvents[_0xfbb1('0x6')](_0x5baec0+':'+_0x3119b1['id'],_0x3119b1);ChatInternalMessageEvents[_0xfbb1('0x6')](_0x5baec0,_0x3119b1);_0x5a261c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xfbb1('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 513b04a..67207ce 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 _0x0f25=['rimraf','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x0f25,0x18e));var _0x50f2=function(_0x301cd8,_0x2eceb8){_0x301cd8=_0x301cd8-0x0;var _0x52a8ad=_0x0f25[_0x301cd8];return _0x52a8ad;};'use strict';var _=require(_0x50f2('0x0'));var util=require(_0x50f2('0x1'));var logger=require(_0x50f2('0x2'))(_0x50f2('0x3'));var moment=require(_0x50f2('0x4'));var BPromise=require(_0x50f2('0x5'));var rp=require(_0x50f2('0x6'));var fs=require('fs');var path=require(_0x50f2('0x7'));var rimraf=require(_0x50f2('0x8'));var config=require(_0x50f2('0x9'));var attributes=require('./chatInternalMessage.attributes');module[_0x50f2('0xa')]=function(_0x3428b7,_0x4dd7b1){return _0x3428b7[_0x50f2('0xb')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x50f2('0xc'),'collate':_0x50f2('0xd')});}; \ No newline at end of file +var _0x7f1d=['define','chat_internal_messages','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports'];(function(_0x51f1af,_0x55a1a4){var _0x3ae83d=function(_0xd475e6){while(--_0xd475e6){_0x51f1af['push'](_0x51f1af['shift']());}};_0x3ae83d(++_0x55a1a4);}(_0x7f1d,0x6f));var _0xd7f1=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0x7f1d[_0x74892f];return _0x10ee61;};'use strict';var _=require(_0xd7f1('0x0'));var util=require('util');var logger=require(_0xd7f1('0x1'))(_0xd7f1('0x2'));var moment=require('moment');var BPromise=require(_0xd7f1('0x3'));var rp=require(_0xd7f1('0x4'));var fs=require('fs');var path=require(_0xd7f1('0x5'));var rimraf=require(_0xd7f1('0x6'));var config=require('../../config/environment');var attributes=require(_0xd7f1('0x7'));module[_0xd7f1('0x8')]=function(_0x897167,_0x3213e9){return _0x897167[_0xd7f1('0x9')]('ChatInternalMessage',attributes,{'tableName':_0xd7f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd7f1('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 d211dab..6b37f9a 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 _0x0e28=['http','redis','localhost','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1781f9,_0x5c36a3){var _0x4bd468=function(_0x3d3efb){while(--_0x3d3efb){_0x1781f9['push'](_0x1781f9['shift']());}};_0x4bd468(++_0x5c36a3);}(_0x0e28,0x12d));var _0x80e2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0e28[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x80e2('0x0'));var moment=require(_0x80e2('0x1'));var BPromise=require(_0x80e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80e2('0x3'));var db=require(_0x80e2('0x4'))['db'];var utils=require(_0x80e2('0x5'));var logger=require(_0x80e2('0x6'))(_0x80e2('0x7'));var config=require(_0x80e2('0x8'));var jayson=require(_0x80e2('0x9'));var client=jayson[_0x80e2('0xa')][_0x80e2('0xb')]({'port':0x232a});config[_0x80e2('0xc')]=_['defaults'](config[_0x80e2('0xc')],{'host':_0x80e2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x80e2('0xc')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x23f3b4,_0x1e997e,_0x4cde86){return new BPromise(function(_0x15771a,_0x349d3c){return client[_0x80e2('0xe')](_0x23f3b4,_0x4cde86)['then'](function(_0x3ffeb9){logger[_0x80e2('0xf')](_0x80e2('0x10'),_0x1e997e,_0x80e2('0x11'));logger[_0x80e2('0x12')](_0x80e2('0x13'),_0x1e997e,_0x80e2('0x11'),JSON[_0x80e2('0x14')](_0x3ffeb9));if(_0x3ffeb9['error']){if(_0x3ffeb9['error'][_0x80e2('0x15')]===0x1f4){logger[_0x80e2('0x16')](_0x80e2('0x10'),_0x1e997e,_0x3ffeb9[_0x80e2('0x16')][_0x80e2('0x17')]);return _0x349d3c(_0x3ffeb9[_0x80e2('0x16')][_0x80e2('0x17')]);}logger['error'](_0x80e2('0x10'),_0x1e997e,_0x3ffeb9[_0x80e2('0x16')][_0x80e2('0x17')]);return _0x15771a(_0x3ffeb9['error'][_0x80e2('0x17')]);}else{logger[_0x80e2('0xf')](_0x80e2('0x10'),_0x1e997e,_0x80e2('0x11'));_0x15771a(_0x3ffeb9[_0x80e2('0x18')][_0x80e2('0x17')]);}})[_0x80e2('0x19')](function(_0x267e15){logger[_0x80e2('0x16')](_0x80e2('0x10'),_0x1e997e,_0x267e15);_0x349d3c(_0x267e15);});});} \ No newline at end of file +var _0x6737=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0xc96ce9,_0x39dab2){var _0x4f8966=function(_0x5739ef){while(--_0x5739ef){_0xc96ce9['push'](_0xc96ce9['shift']());}};_0x4f8966(++_0x39dab2);}(_0x6737,0xaf));var _0x7673=function(_0x2465bb,_0x4e46d5){_0x2465bb=_0x2465bb-0x0;var _0x3bd189=_0x6737[_0x2465bb];return _0x3bd189;};'use strict';var _=require(_0x7673('0x0'));var util=require(_0x7673('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7673('0x2'));var fs=require('fs');var Redis=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var utils=require(_0x7673('0x5'));var logger=require(_0x7673('0x6'))(_0x7673('0x7'));var config=require(_0x7673('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7673('0x9')]['http']({'port':0x232a});config[_0x7673('0xa')]=_[_0x7673('0xb')](config['redis'],{'host':_0x7673('0xc'),'port':0x18eb});var socket=require(_0x7673('0xd'))(new Redis(config[_0x7673('0xa')]));require(_0x7673('0xe'))['register'](socket);function respondWithRpcPromise(_0x185630,_0x1091a8,_0x70d6a7){return new BPromise(function(_0x39be53,_0x9c88ef){return client['request'](_0x185630,_0x70d6a7)['then'](function(_0xefe8b8){logger[_0x7673('0xf')](_0x7673('0x10'),_0x1091a8,'request\x20sent');logger['debug'](_0x7673('0x11'),_0x1091a8,_0x7673('0x12'),JSON[_0x7673('0x13')](_0xefe8b8));if(_0xefe8b8[_0x7673('0x14')]){if(_0xefe8b8[_0x7673('0x14')][_0x7673('0x15')]===0x1f4){logger[_0x7673('0x14')](_0x7673('0x10'),_0x1091a8,_0xefe8b8['error']['message']);return _0x9c88ef(_0xefe8b8[_0x7673('0x14')][_0x7673('0x16')]);}logger[_0x7673('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1091a8,_0xefe8b8[_0x7673('0x14')][_0x7673('0x16')]);return _0x39be53(_0xefe8b8[_0x7673('0x14')][_0x7673('0x16')]);}else{logger[_0x7673('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x1091a8,_0x7673('0x12'));_0x39be53(_0xefe8b8[_0x7673('0x17')][_0x7673('0x16')]);}})[_0x7673('0x18')](function(_0x3f8f33){logger[_0x7673('0x14')](_0x7673('0x10'),_0x1091a8,_0x3f8f33);_0x9c88ef(_0x3f8f33);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index d51869c..c37afbd 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 _0xe60f=['register','length','chatInternalMessage:','save','remove'];(function(_0x30e53b,_0xac1400){var _0x5a5c36=function(_0x1c1507){while(--_0x1c1507){_0x30e53b['push'](_0x30e53b['shift']());}};_0x5a5c36(++_0xac1400);}(_0xe60f,0x1f2));var _0xfe60=function(_0x99a3df,_0x45aafc){_0x99a3df=_0x99a3df-0x0;var _0x3f6369=_0xe60f[_0x99a3df];return _0x3f6369;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xfe60('0x0'),_0xfe60('0x1'),'update'];function createListener(_0x1873ce,_0x21787f){return function(_0xa99cc1){_0x21787f['emit'](_0x1873ce,_0xa99cc1);};}function removeListener(_0x2b14fa,_0x4de8d6){return function(){ChatInternalMessageEvents['removeListener'](_0x2b14fa,_0x4de8d6);};}exports[_0xfe60('0x2')]=function(_0xa589cd){for(var _0x41b372=0x0,_0x64e9ae=events[_0xfe60('0x3')];_0x41b372<_0x64e9ae;_0x41b372++){var _0x5230ec=events[_0x41b372];var _0x168dbf=createListener(_0xfe60('0x4')+_0x5230ec,_0xa589cd);ChatInternalMessageEvents['on'](_0x5230ec,_0x168dbf);}}; \ No newline at end of file +var _0xf688=['./chatInternalMessage.events','remove','update','emit','register','length','chatInternalMessage:'];(function(_0x592141,_0x5031ad){var _0x52efaa=function(_0x2baf97){while(--_0x2baf97){_0x592141['push'](_0x592141['shift']());}};_0x52efaa(++_0x5031ad);}(_0xf688,0x173));var _0x8f68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf688[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x8f68('0x0'));var events=['save',_0x8f68('0x1'),_0x8f68('0x2')];function createListener(_0x850cf5,_0x275a63){return function(_0xb52e46){_0x275a63[_0x8f68('0x3')](_0x850cf5,_0xb52e46);};}function removeListener(_0x1b0f1f,_0x57888b){return function(){ChatInternalMessageEvents['removeListener'](_0x1b0f1f,_0x57888b);};}exports[_0x8f68('0x4')]=function(_0x3dbc56){for(var _0x3aa650=0x0,_0x28af0c=events[_0x8f68('0x5')];_0x3aa650<_0x28af0c;_0x3aa650++){var _0x4647e9=events[_0x3aa650];var _0x53ef23=createListener(_0x8f68('0x6')+_0x4647e9,_0x3dbc56);ChatInternalMessageEvents['on'](_0x4647e9,_0x53ef23);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index a77eb5f..a840401 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 _0x5026=['../../components/interaction/service','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','/users','getUsers','/:id','create','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4ca1b8,_0x9faad5){var _0x49b9e4=function(_0x360bcd){while(--_0x360bcd){_0x4ca1b8['push'](_0x4ca1b8['shift']());}};_0x49b9e4(++_0x9faad5);}(_0x5026,0xac));var _0x6502=function(_0x5be840,_0x4e11ec){_0x5be840=_0x5be840-0x0;var _0x576dd5=_0x5026[_0x5be840];return _0x576dd5;};'use strict';var multer=require(_0x6502('0x0'));var util=require(_0x6502('0x1'));var path=require(_0x6502('0x2'));var timeout=require(_0x6502('0x3'));var express=require(_0x6502('0x4'));var router=express[_0x6502('0x5')]();var fs_extra=require(_0x6502('0x6'));var auth=require(_0x6502('0x7'));var interaction=require(_0x6502('0x8'));var config=require('../../config/environment');var controller=require(_0x6502('0x9'));router[_0x6502('0xa')]('/',auth['isAuthenticated'](),controller[_0x6502('0xb')]);router['get'](_0x6502('0xc'),auth[_0x6502('0xd')](),controller['describe']);router['get'](_0x6502('0xe'),auth['isAuthenticated'](),controller[_0x6502('0xf')]);router[_0x6502('0xa')](_0x6502('0x10'),auth[_0x6502('0xd')](),controller['show']);router['post']('/',auth[_0x6502('0xd')](),controller[_0x6502('0x11')]);router['put'](_0x6502('0x10'),controller[_0x6502('0x12')]);router['delete'](_0x6502('0x10'),auth[_0x6502('0xd')](),controller[_0x6502('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0796=['express','Router','fs-extra','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout'];(function(_0x50972d,_0x2eed5b){var _0x55cdee=function(_0x33cd8d){while(--_0x33cd8d){_0x50972d['push'](_0x50972d['shift']());}};_0x55cdee(++_0x2eed5b);}(_0x0796,0x131));var _0x6079=function(_0x286d47,_0x4d57be){_0x286d47=_0x286d47-0x0;var _0x3cc213=_0x0796[_0x286d47];return _0x3cc213;};'use strict';var multer=require(_0x6079('0x0'));var util=require(_0x6079('0x1'));var path=require('path');var timeout=require(_0x6079('0x2'));var express=require(_0x6079('0x3'));var router=express[_0x6079('0x4')]();var fs_extra=require(_0x6079('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6079('0x6'));var controller=require(_0x6079('0x7'));router['get']('/',auth[_0x6079('0x8')](),controller[_0x6079('0x9')]);router[_0x6079('0xa')](_0x6079('0xb'),auth[_0x6079('0x8')](),controller[_0x6079('0xc')]);router[_0x6079('0xa')](_0x6079('0xd'),auth['isAuthenticated'](),controller[_0x6079('0xe')]);router[_0x6079('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6079('0xf')]('/',auth['isAuthenticated'](),controller[_0x6079('0x10')]);router[_0x6079('0x11')](_0x6079('0x12'),controller[_0x6079('0x13')]);router['delete'](_0x6079('0x12'),auth[_0x6079('0x8')](),controller[_0x6079('0x14')]);module[_0x6079('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 2005ea4..65caf9d 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 _0x7033=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x7033,0x19e));var _0x3703=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7033[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x3703('0x0'));module[_0x3703('0x1')]={'body':{'type':Sequelize[_0x3703('0x2')](_0x3703('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3703('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3703('0x5')]('in',_0x3703('0x6')),'defaultValue':_0x3703('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3703('0x7')]},'providerName':{'type':Sequelize[_0x3703('0x8')]},'providerResponse':{'type':Sequelize[_0x3703('0x2')]}}; \ No newline at end of file +var _0xdb94=['ENUM','out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x16ad5b,_0x406cb0){var _0x1ebc5b=function(_0x269f86){while(--_0x269f86){_0x16ad5b['push'](_0x16ad5b['shift']());}};_0x1ebc5b(++_0x406cb0);}(_0xdb94,0xab));var _0x4db9=function(_0x2316dd,_0x438ece){_0x2316dd=_0x2316dd-0x0;var _0x16e5ce=_0xdb94[_0x2316dd];return _0x16e5ce;};'use strict';var Sequelize=require(_0x4db9('0x0'));module[_0x4db9('0x1')]={'body':{'type':Sequelize[_0x4db9('0x2')](_0x4db9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4db9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4db9('0x5')]('in',_0x4db9('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4db9('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index f3c0251..1a53533 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','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','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x2da02c,_0x293473){var _0x1b6fe9=function(_0x2cdfa4){while(--_0x2cdfa4){_0x2da02c['push'](_0x2da02c['shift']());}};_0x1b6fe9(++_0x293473);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file +var _0xffc9=['set','Content-Range','save','update','destroy','stack','name','send','map','ChatMessage','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','rejectmessage','parse','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status'];(function(_0x4e9a07,_0x1b49f0){var _0xab802a=function(_0x73ba57){while(--_0x73ba57){_0x4e9a07['push'](_0x4e9a07['shift']());}};_0xab802a(++_0x1b49f0);}(_0xffc9,0x1f3));var _0x9ffc=function(_0xa0a1ab,_0x6d0eb7){_0xa0a1ab=_0xa0a1ab-0x0;var _0x3d57aa=_0xffc9[_0xa0a1ab];return _0x3d57aa;};'use strict';var emlformat=require(_0x9ffc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9ffc('0x1'));var rp=require(_0x9ffc('0x2'));var moment=require(_0x9ffc('0x3'));var BPromise=require(_0x9ffc('0x4'));var Mustache=require(_0x9ffc('0x5'));var util=require('util');var path=require(_0x9ffc('0x6'));var sox=require(_0x9ffc('0x7'));var csv=require(_0x9ffc('0x8'));var ejs=require(_0x9ffc('0x9'));var fs=require('fs');var fs_extra=require(_0x9ffc('0xa'));var _=require(_0x9ffc('0xb'));var squel=require(_0x9ffc('0xc'));var crypto=require(_0x9ffc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9ffc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9ffc('0xf'));var Papa=require('papaparse');var Redis=require(_0x9ffc('0x10'));var authService=require(_0x9ffc('0x11'));var qs=require(_0x9ffc('0x12'));var as=require(_0x9ffc('0x13'));var hardwareService=require(_0x9ffc('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9ffc('0x15'));var licenseUtil=require(_0x9ffc('0x16'));var db=require(_0x9ffc('0x17'))['db'];config[_0x9ffc('0x18')]=_[_0x9ffc('0x19')](config[_0x9ffc('0x18')],{'host':_0x9ffc('0x1a'),'port':0x18eb});var socket=require(_0x9ffc('0x1b'))(new Redis(config[_0x9ffc('0x18')]));require(_0x9ffc('0x1c'))[_0x9ffc('0x1d')](socket);var jayson=require(_0x9ffc('0x1e'));var client=jayson[_0x9ffc('0x1f')][_0x9ffc('0x20')]({'port':0x232c});var client9002=jayson[_0x9ffc('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57fd15,_0xe5eb6b,_0x35f763,_0x212790){return new BPromise(function(_0x5b30ac,_0x2bf2b9){var _0x65e869=_0x212790||client;return _0x65e869[_0x9ffc('0x21')](_0x57fd15,_0x35f763)[_0x9ffc('0x22')](function(_0x7f1650){logger[_0x9ffc('0x23')](_0x9ffc('0x24'),_0xe5eb6b,_0x9ffc('0x25'));logger['debug'](_0x9ffc('0x26'),_0xe5eb6b,_0x9ffc('0x25'),JSON[_0x9ffc('0x27')](_0x7f1650));if(_0x7f1650['error']){if(_0x7f1650[_0x9ffc('0x28')][_0x9ffc('0x29')]===0x1f4){logger[_0x9ffc('0x28')]('ChatMessage,\x20%s,\x20%s',_0xe5eb6b,_0x7f1650[_0x9ffc('0x28')]['message']);return _0x2bf2b9(_0x7f1650[_0x9ffc('0x28')]['message']);}logger['error'](_0x9ffc('0x24'),_0xe5eb6b,_0x7f1650[_0x9ffc('0x28')][_0x9ffc('0x2a')]);return _0x5b30ac(_0x7f1650[_0x9ffc('0x28')][_0x9ffc('0x2a')]);}else{logger['info'](_0x9ffc('0x24'),_0xe5eb6b,_0x9ffc('0x25'));_0x5b30ac(_0x7f1650[_0x9ffc('0x2b')][_0x9ffc('0x2a')]);}})[_0x9ffc('0x2c')](function(_0x219fce){logger['error'](_0x9ffc('0x24'),_0xe5eb6b,_0x219fce);_0x2bf2b9(_0x219fce);});});}function respondWithStatusCode(_0xedf97,_0x2c49a0){_0x2c49a0=_0x2c49a0||0xcc;return function(_0x44025c){if(_0x44025c){return _0xedf97[_0x9ffc('0x2d')](_0x2c49a0);}return _0xedf97['status'](_0x2c49a0)[_0x9ffc('0x2e')]();};}function respondWithResult(_0x5a4b44,_0xee0c97){_0xee0c97=_0xee0c97||0xc8;return function(_0x59f13c){if(_0x59f13c){return _0x5a4b44['status'](_0xee0c97)[_0x9ffc('0x2f')](_0x59f13c);}};}function respondWithFilteredResult(_0x859dbe,_0xb36f38){return function(_0x5175b4){if(_0x5175b4){var _0x987369=typeof _0xb36f38[_0x9ffc('0x30')]===_0x9ffc('0x31')&&typeof _0xb36f38[_0x9ffc('0x32')]===_0x9ffc('0x31');var _0x207a4f=_0x5175b4[_0x9ffc('0x33')];var _0x4cf349=_0x987369?0x0:_0xb36f38['offset'];var _0x534385=_0x987369?_0x5175b4[_0x9ffc('0x33')]:_0xb36f38['offset']+_0xb36f38[_0x9ffc('0x32')];var _0x2a3d06;if(_0x534385>=_0x207a4f){_0x534385=_0x207a4f;_0x2a3d06=0xc8;}else{_0x2a3d06=0xce;}_0x859dbe[_0x9ffc('0x34')](_0x2a3d06);return _0x859dbe[_0x9ffc('0x35')](_0x9ffc('0x36'),_0x4cf349+'-'+_0x534385+'/'+_0x207a4f)['json'](_0x5175b4);}return null;};}function patchUpdates(_0x426df7){return function(_0x2f253d){try{jsonpatch['apply'](_0x2f253d,_0x426df7,!![]);}catch(_0x12e47c){return BPromise['reject'](_0x12e47c);}return _0x2f253d[_0x9ffc('0x37')]();};}function saveUpdates(_0x45e096,_0x201435){return function(_0x3126fc){if(_0x3126fc){return _0x3126fc[_0x9ffc('0x38')](_0x45e096)[_0x9ffc('0x22')](function(_0x5470c1){return _0x5470c1;});}return null;};}function removeEntity(_0x2718a6,_0x1563db){return function(_0x2348c1){if(_0x2348c1){return _0x2348c1[_0x9ffc('0x39')]()[_0x9ffc('0x22')](function(){_0x2718a6[_0x9ffc('0x34')](0xcc)[_0x9ffc('0x2e')]();});}};}function handleEntityNotFound(_0x57d074,_0x39d8ee){return function(_0x152b17){if(!_0x152b17){_0x57d074[_0x9ffc('0x2d')](0x194);}return _0x152b17;};}function handleError(_0x481842,_0x32cfbe){_0x32cfbe=_0x32cfbe||0x1f4;return function(_0x1c1619){logger[_0x9ffc('0x28')](_0x1c1619[_0x9ffc('0x3a')]);if(_0x1c1619[_0x9ffc('0x3b')]){delete _0x1c1619[_0x9ffc('0x3b')];}_0x481842[_0x9ffc('0x34')](_0x32cfbe)[_0x9ffc('0x3c')](_0x1c1619);};}exports['index']=function(_0x17ee29,_0x11dcfd){var _0xec8368={},_0x2b1487={},_0x18a26b={'count':0x0,'rows':[]};var _0x198704=_[_0x9ffc('0x3d')](db[_0x9ffc('0x3e')]['rawAttributes'],function(_0x6b5c2b){return{'name':_0x6b5c2b['fieldName'],'type':_0x6b5c2b[_0x9ffc('0x3f')][_0x9ffc('0x40')]};});_0x2b1487[_0x9ffc('0x41')]=_['map'](_0x198704,_0x9ffc('0x3b'));_0x2b1487[_0x9ffc('0x42')]=_[_0x9ffc('0x43')](_0x17ee29[_0x9ffc('0x42')]);_0x2b1487[_0x9ffc('0x44')]=_[_0x9ffc('0x45')](_0x2b1487[_0x9ffc('0x41')],_0x2b1487[_0x9ffc('0x42')]);_0xec8368[_0x9ffc('0x46')]=_['intersection'](_0x2b1487[_0x9ffc('0x41')],qs[_0x9ffc('0x47')](_0x17ee29['query'][_0x9ffc('0x47')]));_0xec8368['attributes']=_0xec8368[_0x9ffc('0x46')][_0x9ffc('0x48')]?_0xec8368[_0x9ffc('0x46')]:_0x2b1487[_0x9ffc('0x41')];if(!_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x49')](_0x9ffc('0x4a'))){_0xec8368[_0x9ffc('0x32')]=qs[_0x9ffc('0x32')](_0x17ee29['query']['limit']);_0xec8368[_0x9ffc('0x30')]=qs[_0x9ffc('0x30')](_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x30')]);}_0xec8368[_0x9ffc('0x4b')]=qs[_0x9ffc('0x4c')](_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x4c')]);_0xec8368[_0x9ffc('0x4d')]=qs[_0x9ffc('0x44')](_[_0x9ffc('0x4e')](_0x17ee29[_0x9ffc('0x42')],_0x2b1487[_0x9ffc('0x44')]),_0x198704);if(_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x4f')]){_0xec8368[_0x9ffc('0x4d')]=_[_0x9ffc('0x50')](_0xec8368[_0x9ffc('0x4d')],{'$or':_[_0x9ffc('0x3d')](_0x198704,function(_0x51d4cb){if(_0x51d4cb[_0x9ffc('0x3f')]!=='VIRTUAL'){var _0xadc0c={};_0xadc0c[_0x51d4cb[_0x9ffc('0x3b')]]={'$like':'%'+_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x4f')]+'%'};return _0xadc0c;}})});}_0xec8368=_[_0x9ffc('0x50')]({},_0xec8368,_0x17ee29[_0x9ffc('0x51')]);var _0x4c92e3={'where':_0xec8368[_0x9ffc('0x4d')]};return db[_0x9ffc('0x3e')]['count'](_0x4c92e3)[_0x9ffc('0x22')](function(_0x2259b3){_0x18a26b[_0x9ffc('0x33')]=_0x2259b3;if(_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x52')]){_0xec8368[_0x9ffc('0x53')]=[{'all':!![]}];}return db[_0x9ffc('0x3e')][_0x9ffc('0x54')](_0xec8368);})[_0x9ffc('0x22')](function(_0x13c786){_0x18a26b[_0x9ffc('0x55')]=_0x13c786;return _0x18a26b;})[_0x9ffc('0x22')](respondWithFilteredResult(_0x11dcfd,_0xec8368))[_0x9ffc('0x2c')](handleError(_0x11dcfd,null));};exports[_0x9ffc('0x56')]=function(_0x19e4e1,_0x1f6ba8){var _0x1c6340={'raw':!![],'where':{'id':_0x19e4e1[_0x9ffc('0x57')]['id']}},_0x2393d1={};_0x2393d1[_0x9ffc('0x41')]=_[_0x9ffc('0x43')](db[_0x9ffc('0x3e')][_0x9ffc('0x58')]);_0x2393d1[_0x9ffc('0x42')]=_['keys'](_0x19e4e1[_0x9ffc('0x42')]);_0x2393d1[_0x9ffc('0x44')]=_[_0x9ffc('0x45')](_0x2393d1[_0x9ffc('0x41')],_0x2393d1['query']);_0x1c6340[_0x9ffc('0x46')]=_['intersection'](_0x2393d1['model'],qs[_0x9ffc('0x47')](_0x19e4e1[_0x9ffc('0x42')][_0x9ffc('0x47')]));_0x1c6340[_0x9ffc('0x46')]=_0x1c6340[_0x9ffc('0x46')][_0x9ffc('0x48')]?_0x1c6340['attributes']:_0x2393d1[_0x9ffc('0x41')];if(_0x19e4e1['query'][_0x9ffc('0x52')]){_0x1c6340[_0x9ffc('0x53')]=[{'all':!![]}];}_0x1c6340=_['merge']({},_0x1c6340,_0x19e4e1['options']);return db[_0x9ffc('0x3e')][_0x9ffc('0x59')](_0x1c6340)[_0x9ffc('0x22')](handleEntityNotFound(_0x1f6ba8,null))[_0x9ffc('0x22')](respondWithResult(_0x1f6ba8,null))['catch'](handleError(_0x1f6ba8,null));};exports[_0x9ffc('0x5a')]=function(_0x15df98,_0x4bf670){return db[_0x9ffc('0x3e')][_0x9ffc('0x5a')](_0x15df98[_0x9ffc('0x5b')],{})[_0x9ffc('0x22')](respondWithResult(_0x4bf670,0xc9))[_0x9ffc('0x2c')](handleError(_0x4bf670,null));};exports['update']=function(_0x209ab6,_0xd24ca2){if(_0x209ab6[_0x9ffc('0x5b')]['id']){delete _0x209ab6[_0x9ffc('0x5b')]['id'];}return db[_0x9ffc('0x3e')][_0x9ffc('0x59')]({'where':{'id':_0x209ab6[_0x9ffc('0x57')]['id']}})['then'](handleEntityNotFound(_0xd24ca2,null))['then'](saveUpdates(_0x209ab6[_0x9ffc('0x5b')],null))[_0x9ffc('0x22')](respondWithResult(_0xd24ca2,null))['catch'](handleError(_0xd24ca2,null));};exports[_0x9ffc('0x39')]=function(_0x2a83f2,_0x11d200){return db[_0x9ffc('0x3e')]['find']({'where':{'id':_0x2a83f2[_0x9ffc('0x57')]['id']}})[_0x9ffc('0x22')](handleEntityNotFound(_0x11d200,null))[_0x9ffc('0x22')](removeEntity(_0x11d200,null))[_0x9ffc('0x2c')](handleError(_0x11d200,null));};exports[_0x9ffc('0x5c')]=function(_0x588058,_0x5e17cf){return db[_0x9ffc('0x3e')][_0x9ffc('0x5c')]()[_0x9ffc('0x22')](respondWithResult(_0x5e17cf,null))[_0x9ffc('0x2c')](handleError(_0x5e17cf,null));};var interaction_log=require(_0x9ffc('0x5d'))(_0x9ffc('0x5e'));exports[_0x9ffc('0x5f')]=function(_0x4f1018,_0x5cbb27,_0x1f8a73){var _0x29a79f={'agent':{},'channel':_0x9ffc('0x60')};if(_0x4f1018[_0x9ffc('0x5b')]['id']){delete _0x4f1018[_0x9ffc('0x5b')]['id'];}_0x4f1018['body']['read']=!![];_0x4f1018['body'][_0x9ffc('0x61')]=moment()[_0x9ffc('0x62')](_0x9ffc('0x63'));_0x4f1018[_0x9ffc('0x5b')][_0x9ffc('0x64')]=_0x4f1018['body'][_0x9ffc('0x64')]||_0x4f1018[_0x9ffc('0x65')]['id'];_0x29a79f[_0x9ffc('0x66')]['id']=_0x4f1018[_0x9ffc('0x5b')][_0x9ffc('0x64')];return db[_0x9ffc('0x3e')][_0x9ffc('0x59')]({'where':{'id':_0x4f1018[_0x9ffc('0x57')]['id'],'UserId':null}})[_0x9ffc('0x22')](handleEntityNotFound(_0x5cbb27,null))[_0x9ffc('0x22')](saveUpdates(_0x4f1018[_0x9ffc('0x5b')],null))[_0x9ffc('0x22')](function(_0x494eb8){if(_0x494eb8){_0x29a79f[_0x9ffc('0x2a')]=_0x494eb8[_0x9ffc('0x67')]({'plain':!![]});return db[_0x9ffc('0x68')][_0x9ffc('0x59')]({'where':{'id':_0x494eb8[_0x9ffc('0x69')]}});}return null;})[_0x9ffc('0x22')](handleEntityNotFound(_0x5cbb27,null))[_0x9ffc('0x22')](function(_0x271b6f){if(_0x271b6f){return _0x271b6f[_0x9ffc('0x38')]({'UserId':_0x4f1018[_0x9ffc('0x5b')][_0x9ffc('0x64')],'read1stAt':_[_0x9ffc('0x6a')](_0x271b6f[_0x9ffc('0x6b')])?moment()['format'](_0x9ffc('0x63')):undefined});}return null;})[_0x9ffc('0x22')](function(_0x14920c){if(_0x14920c){_0x29a79f[_0x9ffc('0x6c')]=_0x14920c[_0x9ffc('0x67')]({'plain':!![]});interaction_log[_0x9ffc('0x23')](_0x9ffc('0x6d'),_0x4f1018[_0x9ffc('0x65')]['id'],_0x4f1018['user'][_0x9ffc('0x3b')],_0x4f1018['user']['role'],_0x29a79f[_0x9ffc('0x6c')]['id'],_0x4f1018['body']?JSON['stringify'](_0x4f1018[_0x9ffc('0x5b')]):'null');return respondWithRpcPromise('AcceptMessage',_0x9ffc('0x6e'),_0x29a79f);}return null;})[_0x9ffc('0x22')](function(_0x4fb12a){var _0xa20664=_0x9ffc('0x6f')+_0x4fb12a[_0x9ffc('0x2a')][_0x9ffc('0x70')];return db[_0x9ffc('0x71')]['query'](_0xa20664,{'type':db[_0x9ffc('0x72')][_0x9ffc('0x73')][_0x9ffc('0x74')],'raw':!![]})[_0x9ffc('0x22')](function(_0x4008e4){return _0x4008e4;});})[_0x9ffc('0x22')](function(_0x6a2063){if(_0x6a2063){_0x29a79f['message'][_0x9ffc('0x75')]=_0x6a2063[0x0];if(!_0x4f1018[_0x9ffc('0x5b')]['UserId'])return;return db[_0x9ffc('0x76')][_0x9ffc('0x59')]({'where':{'id':_0x4f1018[_0x9ffc('0x5b')][_0x9ffc('0x64')],'role':_0x9ffc('0x66')},'attributes':['id',_0x9ffc('0x3b'),_0x9ffc('0x77'),_0x9ffc('0x78'),'internal'],'raw':!![]});}return null;})[_0x9ffc('0x22')](function(_0x475b98){if(!_0x475b98)return null;_0x29a79f[_0x9ffc('0x2a')][_0x9ffc('0x66')]=_0x475b98;return _0x29a79f;})[_0x9ffc('0x22')](function(_0x4aa326){if(_0x4aa326){if(_0x4f1018[_0x9ffc('0x5b')][_0x9ffc('0x79')]){_0x29a79f['message'][_0x9ffc('0x7a')]=util[_0x9ffc('0x62')](_0x9ffc('0x7b'),_0x4f1018[_0x9ffc('0x65')][_0x9ffc('0x3b')]);_0x29a79f[_0x9ffc('0x2a')][_0x9ffc('0x7c')]=_0x29a79f[_0x9ffc('0x7c')];_0x29a79f[_0x9ffc('0x2a')][_0x9ffc('0x7d')]=_0x29a79f[_0x9ffc('0x7c')];_0x29a79f['message'][_0x9ffc('0x7e')]=_0x9ffc('0x5f');return respondWithRpcPromise(_0x9ffc('0x7f'),'EventManager',{'event':_0x9ffc('0x80'),'message':_[_0x9ffc('0x50')](_0x29a79f[_0x9ffc('0x2a')],JSON['parse'](_0x29a79f['interaction'][_0x9ffc('0x81')]))},client9002)[_0x9ffc('0x22')](function(){return _0x29a79f;});}return _0x29a79f;}return null;})[_0x9ffc('0x22')](respondWithResult(_0x5cbb27,null))[_0x9ffc('0x2c')](handleError(_0x5cbb27,null));};var interaction_log=require(_0x9ffc('0x5d'))(_0x9ffc('0x5e'));exports[_0x9ffc('0x82')]=function(_0x509ebf,_0x2d3ccb,_0x4005b4){var _0x151f3f={'agent':{},'channel':_0x9ffc('0x60')};if(_0x509ebf[_0x9ffc('0x5b')]['id']){delete _0x509ebf[_0x9ffc('0x5b')]['id'];}_0x509ebf[_0x9ffc('0x5b')][_0x9ffc('0x64')]=_0x509ebf['body'][_0x9ffc('0x64')]||_0x509ebf['user']['id'];_0x151f3f[_0x9ffc('0x66')]['id']=_0x509ebf[_0x9ffc('0x5b')][_0x9ffc('0x64')];return db['ChatMessage'][_0x9ffc('0x59')]({'where':{'id':_0x509ebf[_0x9ffc('0x57')]['id'],'UserId':null}})[_0x9ffc('0x22')](handleEntityNotFound(_0x2d3ccb,null))[_0x9ffc('0x22')](function(_0x4f6de5){if(_0x4f6de5){_0x151f3f[_0x9ffc('0x2a')]=_0x4f6de5[_0x9ffc('0x67')]({'plain':!![]});return db[_0x9ffc('0x68')][_0x9ffc('0x59')]({'where':{'id':_0x4f6de5[_0x9ffc('0x69')]}});}return null;})[_0x9ffc('0x22')](handleEntityNotFound(_0x2d3ccb,null))[_0x9ffc('0x22')](function(_0x45cfb5){if(_0x45cfb5){_0x151f3f[_0x9ffc('0x6c')]=_0x45cfb5[_0x9ffc('0x67')]({'plain':!![]});interaction_log[_0x9ffc('0x23')](_0x9ffc('0x83'),_0x509ebf[_0x9ffc('0x65')]['id'],_0x509ebf[_0x9ffc('0x65')][_0x9ffc('0x3b')],_0x509ebf[_0x9ffc('0x65')][_0x9ffc('0x84')],_0x151f3f[_0x9ffc('0x6c')]['id'],_0x509ebf[_0x9ffc('0x5b')]?JSON[_0x9ffc('0x27')](_0x509ebf[_0x9ffc('0x5b')]):_0x9ffc('0x85'));return respondWithRpcPromise(_0x9ffc('0x86'),_0x9ffc('0x87'),_0x151f3f);}return null;})[_0x9ffc('0x22')](function(_0x4421b1){var _0x241699='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4421b1[_0x9ffc('0x2a')][_0x9ffc('0x70')];return db[_0x9ffc('0x71')]['query'](_0x241699,{'type':db[_0x9ffc('0x72')][_0x9ffc('0x73')]['SELECT'],'raw':!![]})[_0x9ffc('0x22')](function(_0x5c7a32){return _0x5c7a32;});})[_0x9ffc('0x22')](function(_0x2c0c16){if(_0x2c0c16){_0x151f3f['message'][_0x9ffc('0x75')]=_0x2c0c16[0x0];if(!_0x509ebf[_0x9ffc('0x5b')][_0x9ffc('0x64')])return;return db['User'][_0x9ffc('0x59')]({'where':{'id':_0x509ebf[_0x9ffc('0x5b')][_0x9ffc('0x64')],'role':_0x9ffc('0x66')},'attributes':['id','name',_0x9ffc('0x77'),'email','internal'],'raw':!![]});}return null;})[_0x9ffc('0x22')](function(_0x544955){if(!_0x544955)return null;_0x151f3f[_0x9ffc('0x2a')]['agent']=_0x544955;return _0x151f3f;})[_0x9ffc('0x22')](function(_0x139083){if(_0x139083){_0x139083[_0x9ffc('0x2a')]['interface']=util['format'](_0x9ffc('0x7b'),_0x509ebf['user'][_0x9ffc('0x3b')]);_0x139083['message'][_0x9ffc('0x7c')]=_0x151f3f[_0x9ffc('0x7c')];_0x139083['message']['motionChannel']=_0x151f3f[_0x9ffc('0x7c')];_0x139083[_0x9ffc('0x2a')][_0x9ffc('0x7e')]=_0x9ffc('0x82');respondWithRpcPromise('EventManager','EventManager',{'event':_0x9ffc('0x88'),'message':_[_0x9ffc('0x50')](_0x151f3f['message'],JSON[_0x9ffc('0x89')](_0x151f3f[_0x9ffc('0x6c')][_0x9ffc('0x81')]))},client9002);return _0x151f3f;}return null;})[_0x9ffc('0x22')](respondWithResult(_0x2d3ccb,null))[_0x9ffc('0x2c')](handleError(_0x2d3ccb,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 6a8c762..5e98fb5 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 _0xe1a1=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0xe1a1,0x183));var _0x1e1a=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xe1a1[_0x4a53d];return _0x27410e;};'use strict';var EventEmitter=require(_0x1e1a('0x0'));var ChatMessage=require(_0x1e1a('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1e1a('0x2')](0x0);var events={'afterCreate':_0x1e1a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x79cc45){return function(_0x264e8c,_0x5b1261,_0x2d389f){ChatMessageEvents[_0x1e1a('0x4')](_0x79cc45+':'+_0x264e8c['id'],_0x264e8c);ChatMessageEvents[_0x1e1a('0x4')](_0x79cc45,_0x264e8c);_0x2d389f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1e1a('0x5')](e,emitEvent(event));}}module[_0x1e1a('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0xc742=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x491d59,_0x24a469){var _0x24c7c1=function(_0x404959){while(--_0x404959){_0x491d59['push'](_0x491d59['shift']());}};_0x24c7c1(++_0x24a469);}(_0xc742,0x92));var _0x2c74=function(_0x57ae89,_0x441387){_0x57ae89=_0x57ae89-0x0;var _0x5ca4c7=_0xc742[_0x57ae89];return _0x5ca4c7;};'use strict';var EventEmitter=require(_0x2c74('0x0'));var ChatMessage=require(_0x2c74('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2c74('0x2')](0x0);var events={'afterCreate':_0x2c74('0x3'),'afterUpdate':'update','afterDestroy':_0x2c74('0x4')};function emitEvent(_0x570b05){return function(_0x5aba27,_0x3e3f43,_0x9ef519){ChatMessageEvents[_0x2c74('0x5')](_0x570b05+':'+_0x5aba27['id'],_0x5aba27);ChatMessageEvents[_0x2c74('0x5')](_0x570b05,_0x5aba27);_0x9ef519(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x2c74('0x6')](e,emitEvent(event));}}module[_0x2c74('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 0b3615d..bd0fac5 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 _0xacd4=['bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','models','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x9815f2,_0x1bf69d){var _0x4dd2d4=function(_0x28e750){while(--_0x28e750){_0x9815f2['push'](_0x9815f2['shift']());}};_0x4dd2d4(++_0x1bf69d);}(_0xacd4,0xe6));var _0x4acd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xacd4[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4acd('0x0'));var util=require('util');var logger=require(_0x4acd('0x1'))(_0x4acd('0x2'));var moment=require(_0x4acd('0x3'));var BPromise=require(_0x4acd('0x4'));var rp=require(_0x4acd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4acd('0x6'));var config=require(_0x4acd('0x7'));var attributes=require(_0x4acd('0x8'));module[_0x4acd('0x9')]=function(_0x2bf7b5,_0x100fb9){return _0x2bf7b5['define'](_0x4acd('0xa'),attributes,{'tableName':_0x4acd('0xb'),'paranoid':![],'indexes':[{'name':_0x4acd('0xc'),'fields':[_0x4acd('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x308a93,_0x365427,_0x218078){var _0xe9a34d=_0x2bf7b5[_0x4acd('0xe')];var _0x248e08=_0x308a93['get']({'plain':!![]});if(_0x248e08[_0x4acd('0xf')][_0x4acd('0x10')]()==='in'||_0x248e08[_0x4acd('0xf')]['toLowerCase']()===_0x4acd('0x11')&&!_0x248e08['secret']&&!_[_0x4acd('0x12')](_0x248e08[_0x4acd('0x13')])){_0xe9a34d[_0x4acd('0x14')][_0x4acd('0x15')]({'where':{'id':_0x248e08[_0x4acd('0x16')]}})['then'](function(_0x44bedf){if(_0x44bedf){_0x44bedf['update']({'lastMsgAt':_0x248e08[_0x4acd('0x17')],'lastMsgDirection':_0x248e08[_0x4acd('0xf')][_0x4acd('0x10')]()});}})[_0x4acd('0x18')](function(_0x13697a){console['error'](_0x13697a);});}_0x218078();}},'charset':'utf8mb4','collate':_0x4acd('0x19')});}; \ No newline at end of file +var _0x961d=['ChatInteractionId','then','update','createdAt','error','utf8mb4','lodash','util','moment','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x3259ab,_0x4eeda2){var _0x4bd7af=function(_0x327385){while(--_0x327385){_0x3259ab['push'](_0x3259ab['shift']());}};_0x4bd7af(++_0x4eeda2);}(_0x961d,0x9c));var _0xd961=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x961d[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0xd961('0x0'));var util=require(_0xd961('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd961('0x2'));var BPromise=require('bluebird');var rp=require(_0xd961('0x3'));var fs=require('fs');var path=require(_0xd961('0x4'));var rimraf=require('rimraf');var config=require(_0xd961('0x5'));var attributes=require(_0xd961('0x6'));module[_0xd961('0x7')]=function(_0x2349d1,_0x5af184){return _0x2349d1[_0xd961('0x8')](_0xd961('0x9'),attributes,{'tableName':_0xd961('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xd961('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38e557,_0x513901,_0x3b14d4){var _0x5ef3a0=_0x2349d1['models'];var _0xa749bd=_0x38e557['get']({'plain':!![]});if(_0xa749bd['direction'][_0xd961('0xc')]()==='in'||_0xa749bd['direction'][_0xd961('0xc')]()===_0xd961('0xd')&&!_0xa749bd[_0xd961('0xe')]&&!_[_0xd961('0xf')](_0xa749bd[_0xd961('0x10')])){_0x5ef3a0[_0xd961('0x11')][_0xd961('0x12')]({'where':{'id':_0xa749bd[_0xd961('0x13')]}})[_0xd961('0x14')](function(_0x4ffe3b){if(_0x4ffe3b){_0x4ffe3b[_0xd961('0x15')]({'lastMsgAt':_0xa749bd[_0xd961('0x16')],'lastMsgDirection':_0xa749bd['direction'][_0xd961('0xc')]()});}})['catch'](function(_0x16e02d){console[_0xd961('0x17')](_0x16e02d);});}_0x3b14d4();}},'charset':_0xd961('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 3945e6f..9112f5a 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 _0x56cd=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','raw','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4754b3,_0x135d7f){var _0x39a6fe=function(_0x5b4827){while(--_0x5b4827){_0x4754b3['push'](_0x4754b3['shift']());}};_0x39a6fe(++_0x135d7f);}(_0x56cd,0x77));var _0xd56c=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x56cd[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0xd56c('0x0'));var util=require(_0xd56c('0x1'));var moment=require('moment');var BPromise=require(_0xd56c('0x2'));var rs=require(_0xd56c('0x3'));var fs=require('fs');var Redis=require(_0xd56c('0x4'));var db=require(_0xd56c('0x5'))['db'];var utils=require(_0xd56c('0x6'));var logger=require(_0xd56c('0x7'))(_0xd56c('0x8'));var config=require('../../config/environment');var jayson=require(_0xd56c('0x9'));var client=jayson[_0xd56c('0xa')][_0xd56c('0xb')]({'port':0x232a});config[_0xd56c('0xc')]=_[_0xd56c('0xd')](config[_0xd56c('0xc')],{'host':_0xd56c('0xe'),'port':0x18eb});var socket=require(_0xd56c('0xf'))(new Redis(config[_0xd56c('0xc')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x363b24,_0x8bce44,_0x3e6da4){return new BPromise(function(_0x517cc3,_0x594fd7){return client['request'](_0x363b24,_0x3e6da4)['then'](function(_0x416f59){logger[_0xd56c('0x10')](_0xd56c('0x11'),_0x8bce44,_0xd56c('0x12'));logger[_0xd56c('0x13')](_0xd56c('0x14'),_0x8bce44,_0xd56c('0x12'),JSON[_0xd56c('0x15')](_0x416f59));if(_0x416f59[_0xd56c('0x16')]){if(_0x416f59[_0xd56c('0x16')]['code']===0x1f4){logger['error'](_0xd56c('0x11'),_0x8bce44,_0x416f59[_0xd56c('0x16')]['message']);return _0x594fd7(_0x416f59['error'][_0xd56c('0x17')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x8bce44,_0x416f59['error']['message']);return _0x517cc3(_0x416f59[_0xd56c('0x16')][_0xd56c('0x17')]);}else{logger[_0xd56c('0x10')](_0xd56c('0x11'),_0x8bce44,'request\x20sent');_0x517cc3(_0x416f59[_0xd56c('0x18')][_0xd56c('0x17')]);}})[_0xd56c('0x19')](function(_0x3dbe59){logger[_0xd56c('0x16')](_0xd56c('0x11'),_0x8bce44,_0x3dbe59);_0x594fd7(_0x3dbe59);});});}exports[_0xd56c('0x1a')]=function(_0x23cafc){var _0x4ce500=this;return new Promise(function(_0x503c32,_0x1e1c68){return db[_0xd56c('0x1b')][_0xd56c('0x1c')](_0x23cafc[_0xd56c('0x1d')],{'raw':_0x23cafc['options']?_0x23cafc['options'][_0xd56c('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x37934d){logger['info'](_0xd56c('0x1a'),_0x23cafc);logger['debug'](_0xd56c('0x1a'),_0x23cafc,JSON[_0xd56c('0x15')](_0x37934d));_0x503c32(_0x37934d);})[_0xd56c('0x19')](function(_0x470f9f){logger[_0xd56c('0x16')](_0xd56c('0x1a'),_0x470f9f['message'],_0x23cafc);_0x1e1c68(_0x4ce500['error'](0x1f4,_0x470f9f['message']));});});}; \ No newline at end of file +var _0x18a1=['info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','ChatMessage','create','body','options','raw','CreateChatMessage','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then'];(function(_0x30efe1,_0x170c82){var _0x798a64=function(_0x1ab695){while(--_0x1ab695){_0x30efe1['push'](_0x30efe1['shift']());}};_0x798a64(++_0x170c82);}(_0x18a1,0x1a8));var _0x118a=function(_0x2e711f,_0x18cbe3){_0x2e711f=_0x2e711f-0x0;var _0x14c7d7=_0x18a1[_0x2e711f];return _0x14c7d7;};'use strict';var _=require(_0x118a('0x0'));var util=require(_0x118a('0x1'));var moment=require('moment');var BPromise=require(_0x118a('0x2'));var rs=require(_0x118a('0x3'));var fs=require('fs');var Redis=require(_0x118a('0x4'));var db=require(_0x118a('0x5'))['db'];var utils=require(_0x118a('0x6'));var logger=require(_0x118a('0x7'))('rpc');var config=require(_0x118a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x118a('0x9')][_0x118a('0xa')]({'port':0x232a});config[_0x118a('0xb')]=_[_0x118a('0xc')](config[_0x118a('0xb')],{'host':_0x118a('0xd'),'port':0x18eb});var socket=require(_0x118a('0xe'))(new Redis(config['redis']));require(_0x118a('0xf'))[_0x118a('0x10')](socket);function respondWithRpcPromise(_0x124788,_0x236c1b,_0x9fc224){return new BPromise(function(_0x40c7d1,_0x47a316){return client['request'](_0x124788,_0x9fc224)[_0x118a('0x11')](function(_0x1aeb7a){logger[_0x118a('0x12')]('ChatMessage,\x20%s,\x20%s',_0x236c1b,'request\x20sent');logger[_0x118a('0x13')](_0x118a('0x14'),_0x236c1b,_0x118a('0x15'),JSON[_0x118a('0x16')](_0x1aeb7a));if(_0x1aeb7a['error']){if(_0x1aeb7a[_0x118a('0x17')]['code']===0x1f4){logger['error'](_0x118a('0x18'),_0x236c1b,_0x1aeb7a['error']['message']);return _0x47a316(_0x1aeb7a[_0x118a('0x17')][_0x118a('0x19')]);}logger[_0x118a('0x17')]('ChatMessage,\x20%s,\x20%s',_0x236c1b,_0x1aeb7a[_0x118a('0x17')]['message']);return _0x40c7d1(_0x1aeb7a[_0x118a('0x17')][_0x118a('0x19')]);}else{logger[_0x118a('0x12')]('ChatMessage,\x20%s,\x20%s',_0x236c1b,_0x118a('0x15'));_0x40c7d1(_0x1aeb7a[_0x118a('0x1a')][_0x118a('0x19')]);}})['catch'](function(_0x2cbee9){logger['error'](_0x118a('0x18'),_0x236c1b,_0x2cbee9);_0x47a316(_0x2cbee9);});});}exports['CreateChatMessage']=function(_0x5d8b0c){var _0x5f133f=this;return new Promise(function(_0x41ed97,_0x3686c7){return db[_0x118a('0x1b')][_0x118a('0x1c')](_0x5d8b0c[_0x118a('0x1d')],{'raw':_0x5d8b0c[_0x118a('0x1e')]?_0x5d8b0c['options'][_0x118a('0x1f')]===undefined?!![]:![]:!![]})[_0x118a('0x11')](function(_0x42a1a9){logger[_0x118a('0x12')](_0x118a('0x20'),_0x5d8b0c);logger[_0x118a('0x13')](_0x118a('0x20'),_0x5d8b0c,JSON['stringify'](_0x42a1a9));_0x41ed97(_0x42a1a9);})[_0x118a('0x21')](function(_0x558f45){logger[_0x118a('0x17')](_0x118a('0x20'),_0x558f45[_0x118a('0x19')],_0x5d8b0c);_0x3686c7(_0x5f133f[_0x118a('0x17')](0x1f4,_0x558f45[_0x118a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index e510f08..315dab2 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 _0x06f4=['register','chatMessage:','./chatMessage.events','save','update','emit','removeListener'];(function(_0x4e8618,_0x1a4c6d){var _0x50e0ed=function(_0x7c28ec){while(--_0x7c28ec){_0x4e8618['push'](_0x4e8618['shift']());}};_0x50e0ed(++_0x1a4c6d);}(_0x06f4,0x136));var _0x406f=function(_0x2904eb,_0x5906a4){_0x2904eb=_0x2904eb-0x0;var _0x2dbbd7=_0x06f4[_0x2904eb];return _0x2dbbd7;};'use strict';var ChatMessageEvents=require(_0x406f('0x0'));var events=[_0x406f('0x1'),'remove',_0x406f('0x2')];function createListener(_0x276a15,_0x58cd7d){return function(_0x5cab5e){_0x58cd7d[_0x406f('0x3')](_0x276a15,_0x5cab5e);};}function removeListener(_0x5ed32f,_0x32abfd){return function(){ChatMessageEvents[_0x406f('0x4')](_0x5ed32f,_0x32abfd);};}exports[_0x406f('0x5')]=function(_0x32b2bd){for(var _0x59821c=0x0,_0x1d2886=events['length'];_0x59821c<_0x1d2886;_0x59821c++){var _0x1afec4=events[_0x59821c];var _0x1c39ce=createListener(_0x406f('0x6')+_0x1afec4,_0x32b2bd);ChatMessageEvents['on'](_0x1afec4,_0x1c39ce);}}; \ No newline at end of file +var _0x8585=['remove','removeListener','length','chatMessage:','./chatMessage.events','save'];(function(_0x55f178,_0x46f2aa){var _0x1db52a=function(_0x90330){while(--_0x90330){_0x55f178['push'](_0x55f178['shift']());}};_0x1db52a(++_0x46f2aa);}(_0x8585,0x64));var _0x5858=function(_0x2466e2,_0x407b7c){_0x2466e2=_0x2466e2-0x0;var _0x302e44=_0x8585[_0x2466e2];return _0x302e44;};'use strict';var ChatMessageEvents=require(_0x5858('0x0'));var events=[_0x5858('0x1'),_0x5858('0x2'),'update'];function createListener(_0x2864b0,_0x294e8e){return function(_0x5739bc){_0x294e8e['emit'](_0x2864b0,_0x5739bc);};}function removeListener(_0x5c548b,_0x307ed3){return function(){ChatMessageEvents[_0x5858('0x3')](_0x5c548b,_0x307ed3);};}exports['register']=function(_0x5807a2){for(var _0x35b37a=0x0,_0x1d26d1=events[_0x5858('0x4')];_0x35b37a<_0x1d26d1;_0x35b37a++){var _0x5c8e94=events[_0x35b37a];var _0x4d5efe=createListener(_0x5858('0x5')+_0x5c8e94,_0x5807a2);ChatMessageEvents['on'](_0x5c8e94,_0x4d5efe);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 43eb1f0..8d8514b 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 _0x8f5f=['update','accept','reject','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','post','tracked','chat','chatmessage:create','put'];(function(_0x489d50,_0x16d213){var _0x10d007=function(_0x143ae3){while(--_0x143ae3){_0x489d50['push'](_0x489d50['shift']());}};_0x10d007(++_0x16d213);}(_0x8f5f,0x133));var _0xf8f5=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0x8f5f[_0x556634];return _0x4429fd;};'use strict';var multer=require('multer');var util=require(_0xf8f5('0x0'));var path=require(_0xf8f5('0x1'));var timeout=require(_0xf8f5('0x2'));var express=require(_0xf8f5('0x3'));var router=express['Router']();var fs_extra=require(_0xf8f5('0x4'));var auth=require(_0xf8f5('0x5'));var interaction=require(_0xf8f5('0x6'));var config=require('../../config/environment');var controller=require(_0xf8f5('0x7'));router[_0xf8f5('0x8')]('/',auth[_0xf8f5('0x9')](),controller[_0xf8f5('0xa')]);router[_0xf8f5('0x8')](_0xf8f5('0xb'),auth['isAuthenticated'](),controller[_0xf8f5('0xc')]);router[_0xf8f5('0x8')]('/:id',auth[_0xf8f5('0x9')](),controller['show']);router[_0xf8f5('0xd')]('/',auth[_0xf8f5('0x9')](),interaction[_0xf8f5('0xe')](_0xf8f5('0xf'),_0xf8f5('0x10')),controller['create']);router[_0xf8f5('0x11')]('/:id',controller[_0xf8f5('0x12')]);router[_0xf8f5('0x11')]('/:id/accept',auth[_0xf8f5('0x9')](),controller[_0xf8f5('0x13')]);router[_0xf8f5('0x11')]('/:id/reject',auth[_0xf8f5('0x9')](),controller[_0xf8f5('0x14')]);router[_0xf8f5('0x15')](_0xf8f5('0x16'),auth['isAuthenticated'](),controller[_0xf8f5('0x17')]);module[_0xf8f5('0x18')]=router; \ No newline at end of file +var _0x886e=['../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','show','post','tracked','chat','chatmessage:create','/:id','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5be7cb,_0x494b5f){var _0x124dee=function(_0x378856){while(--_0x378856){_0x5be7cb['push'](_0x5be7cb['shift']());}};_0x124dee(++_0x494b5f);}(_0x886e,0xb6));var _0xe886=function(_0x10bc88,_0x50cf83){_0x10bc88=_0x10bc88-0x0;var _0x1f70ca=_0x886e[_0x10bc88];return _0x1f70ca;};'use strict';var multer=require(_0xe886('0x0'));var util=require(_0xe886('0x1'));var path=require(_0xe886('0x2'));var timeout=require(_0xe886('0x3'));var express=require('express');var router=express[_0xe886('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe886('0x5'));var interaction=require(_0xe886('0x6'));var config=require(_0xe886('0x7'));var controller=require(_0xe886('0x8'));router[_0xe886('0x9')]('/',auth[_0xe886('0xa')](),controller['index']);router[_0xe886('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe886('0xb')]);router[_0xe886('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe886('0xc')]);router[_0xe886('0xd')]('/',auth['isAuthenticated'](),interaction[_0xe886('0xe')](_0xe886('0xf'),_0xe886('0x10')),controller['create']);router['put'](_0xe886('0x11'),controller[_0xe886('0x12')]);router[_0xe886('0x13')](_0xe886('0x14'),auth[_0xe886('0xa')](),controller[_0xe886('0x15')]);router[_0xe886('0x13')](_0xe886('0x16'),auth[_0xe886('0xa')](),controller[_0xe886('0x17')]);router[_0xe886('0x18')]('/:id',auth[_0xe886('0xa')](),controller[_0xe886('0x19')]);module[_0xe886('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 4f7d5b0..8a7646d 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 _0x896d=['sequelize','medium'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x896d,0x1dc));var _0xd896=function(_0x3c056a,_0x34c1ce){_0x3c056a=_0x3c056a-0x0;var _0x1bff8f=_0x896d[_0x3c056a];return _0x1bff8f;};'use strict';var Sequelize=require(_0xd896('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xd896('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xace9=['exports','sequelize'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xace9,0x1b9));var _0x9ace=function(_0xf31274,_0x205d9b){_0xf31274=_0xf31274-0x0;var _0x4ee45d=_0xace9[_0xf31274];return _0x4ee45d;};'use strict';var Sequelize=require(_0x9ace('0x0'));module[_0x9ace('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 364cf4b..88266d6 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(_0x4201a8,_0x5685a9){var _0x36899e=function(_0x39ae87){while(--_0x39ae87){_0x4201a8['push'](_0x4201a8['shift']());}};_0x36899e(++_0x5685a9);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x7a54,0x106));var _0x47a5=function(_0xee740e,_0xbb089f){_0xee740e=_0xee740e-0x0;var _0x5411c1=_0x7a54[_0xee740e];return _0x5411c1;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 43dcf11..51948d8 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 _0x0243=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x31ba88,_0x4430b7){var _0x412113=function(_0x3a0dc9){while(--_0x3a0dc9){_0x31ba88['push'](_0x31ba88['shift']());}};_0x412113(++_0x4430b7);}(_0x0243,0x191));var _0x3024=function(_0x70a176,_0x3f2e3f){_0x70a176=_0x70a176-0x0;var _0x1ad0b4=_0x0243[_0x70a176];return _0x1ad0b4;};'use strict';var _=require('lodash');var util=require(_0x3024('0x0'));var logger=require(_0x3024('0x1'))(_0x3024('0x2'));var moment=require(_0x3024('0x3'));var BPromise=require(_0x3024('0x4'));var rp=require(_0x3024('0x5'));var fs=require('fs');var path=require(_0x3024('0x6'));var rimraf=require(_0x3024('0x7'));var config=require(_0x3024('0x8'));var attributes=require(_0x3024('0x9'));module[_0x3024('0xa')]=function(_0xd1404e,_0x19f3e8){return _0xd1404e[_0x3024('0xb')](_0x3024('0xc'),attributes,{'tableName':_0x3024('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3024('0xe'),'collate':_0x3024('0xf')});}; \ No newline at end of file +var _0x1f01=['request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5499ab,_0x4c1128){var _0x344478=function(_0x5d767e){while(--_0x5d767e){_0x5499ab['push'](_0x5499ab['shift']());}};_0x344478(++_0x4c1128);}(_0x1f01,0xa3));var _0x11f0=function(_0x46c1a8,_0x363524){_0x46c1a8=_0x46c1a8-0x0;var _0x1d2217=_0x1f01[_0x46c1a8];return _0x1d2217;};'use strict';var _=require(_0x11f0('0x0'));var util=require('util');var logger=require(_0x11f0('0x1'))(_0x11f0('0x2'));var moment=require(_0x11f0('0x3'));var BPromise=require(_0x11f0('0x4'));var rp=require(_0x11f0('0x5'));var fs=require('fs');var path=require(_0x11f0('0x6'));var rimraf=require(_0x11f0('0x7'));var config=require(_0x11f0('0x8'));var attributes=require(_0x11f0('0x9'));module['exports']=function(_0x4dda5c,_0x204b3a){return _0x4dda5c[_0x11f0('0xa')](_0x11f0('0xb'),attributes,{'tableName':_0x11f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x11f0('0xd'),'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 185c291..a360c38 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 _0x33ba=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x459bcb,_0x1c02aa){var _0x308a6b=function(_0x3224ab){while(--_0x3224ab){_0x459bcb['push'](_0x459bcb['shift']());}};_0x308a6b(++_0x1c02aa);}(_0x33ba,0x1f0));var _0xa33b=function(_0x320210,_0x11dfb7){_0x320210=_0x320210-0x0;var _0x5be217=_0x33ba[_0x320210];return _0x5be217;};'use strict';var _=require(_0xa33b('0x0'));var util=require(_0xa33b('0x1'));var moment=require('moment');var BPromise=require(_0xa33b('0x2'));var rs=require(_0xa33b('0x3'));var fs=require('fs');var Redis=require(_0xa33b('0x4'));var db=require(_0xa33b('0x5'))['db'];var utils=require(_0xa33b('0x6'));var logger=require(_0xa33b('0x7'))(_0xa33b('0x8'));var config=require(_0xa33b('0x9'));var jayson=require(_0xa33b('0xa'));var client=jayson[_0xa33b('0xb')][_0xa33b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x371668,_0x1723e9,_0xc09188){return new BPromise(function(_0x387c2c,_0x4b49e2){return client[_0xa33b('0xd')](_0x371668,_0xc09188)[_0xa33b('0xe')](function(_0x333220){logger[_0xa33b('0xf')](_0xa33b('0x10'),_0x1723e9,_0xa33b('0x11'));logger[_0xa33b('0x12')](_0xa33b('0x13'),_0x1723e9,_0xa33b('0x11'),JSON[_0xa33b('0x14')](_0x333220));if(_0x333220[_0xa33b('0x15')]){if(_0x333220[_0xa33b('0x15')][_0xa33b('0x16')]===0x1f4){logger[_0xa33b('0x15')](_0xa33b('0x10'),_0x1723e9,_0x333220[_0xa33b('0x15')][_0xa33b('0x17')]);return _0x4b49e2(_0x333220[_0xa33b('0x15')][_0xa33b('0x17')]);}logger[_0xa33b('0x15')](_0xa33b('0x10'),_0x1723e9,_0x333220[_0xa33b('0x15')]['message']);return _0x387c2c(_0x333220['error'][_0xa33b('0x17')]);}else{logger[_0xa33b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1723e9,'request\x20sent');_0x387c2c(_0x333220['result'][_0xa33b('0x17')]);}})[_0xa33b('0x18')](function(_0x53200a){logger['error'](_0xa33b('0x10'),_0x1723e9,_0x53200a);_0x4b49e2(_0x53200a);});});} \ No newline at end of file +var _0xeece=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5ace60,_0x48c635){var _0x3a9ab7=function(_0x2920f5){while(--_0x2920f5){_0x5ace60['push'](_0x5ace60['shift']());}};_0x3a9ab7(++_0x48c635);}(_0xeece,0x159));var _0xeeec=function(_0x2fb356,_0x567092){_0x2fb356=_0x2fb356-0x0;var _0x27fb4b=_0xeece[_0x2fb356];return _0x27fb4b;};'use strict';var _=require('lodash');var util=require(_0xeeec('0x0'));var moment=require(_0xeeec('0x1'));var BPromise=require(_0xeeec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeeec('0x3'));var db=require(_0xeeec('0x4'))['db'];var utils=require(_0xeeec('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeeec('0x6')][_0xeeec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34949f,_0x5aa42d,_0x1116bc){return new BPromise(function(_0x50e0b7,_0x51e070){return client['request'](_0x34949f,_0x1116bc)['then'](function(_0x1da37b){logger[_0xeeec('0x8')](_0xeeec('0x9'),_0x5aa42d,_0xeeec('0xa'));logger[_0xeeec('0xb')](_0xeeec('0xc'),_0x5aa42d,'request\x20sent',JSON[_0xeeec('0xd')](_0x1da37b));if(_0x1da37b[_0xeeec('0xe')]){if(_0x1da37b[_0xeeec('0xe')][_0xeeec('0xf')]===0x1f4){logger[_0xeeec('0xe')](_0xeeec('0x9'),_0x5aa42d,_0x1da37b[_0xeeec('0xe')][_0xeeec('0x10')]);return _0x51e070(_0x1da37b[_0xeeec('0xe')]['message']);}logger[_0xeeec('0xe')](_0xeeec('0x9'),_0x5aa42d,_0x1da37b[_0xeeec('0xe')][_0xeeec('0x10')]);return _0x50e0b7(_0x1da37b[_0xeeec('0xe')][_0xeeec('0x10')]);}else{logger['info'](_0xeeec('0x9'),_0x5aa42d,_0xeeec('0xa'));_0x50e0b7(_0x1da37b[_0xeeec('0x11')][_0xeeec('0x10')]);}})[_0xeeec('0x12')](function(_0x3a3350){logger[_0xeeec('0xe')](_0xeeec('0x9'),_0x5aa42d,_0x3a3350);_0x51e070(_0x3a3350);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 6476fed..6bf5508 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 _0x54fe=['show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0x54fe,0x9a));var _0xe54f=function(_0x426d1d,_0x5f364d){_0x426d1d=_0x426d1d-0x0;var _0x18366a=_0x54fe[_0x426d1d];return _0x18366a;};'use strict';var multer=require(_0xe54f('0x0'));var util=require('util');var path=require(_0xe54f('0x1'));var timeout=require(_0xe54f('0x2'));var express=require(_0xe54f('0x3'));var router=express[_0xe54f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe54f('0x5'));var interaction=require(_0xe54f('0x6'));var config=require(_0xe54f('0x7'));var controller=require(_0xe54f('0x8'));router[_0xe54f('0x9')]('/',auth['isAuthenticated'](),controller[_0xe54f('0xa')]);router[_0xe54f('0x9')](_0xe54f('0xb'),auth[_0xe54f('0xc')](),controller['describe']);router[_0xe54f('0x9')](_0xe54f('0xd'),auth['isAuthenticated'](),controller[_0xe54f('0xe')]);router['post']('/',auth[_0xe54f('0xc')](),controller[_0xe54f('0xf')]);router[_0xe54f('0x10')](_0xe54f('0xd'),auth[_0xe54f('0xc')](),controller[_0xe54f('0x11')]);router[_0xe54f('0x12')]('/:id',auth[_0xe54f('0xc')](),controller[_0xe54f('0x13')]);module[_0xe54f('0x14')]=router; \ No newline at end of file +var _0x2c23=['put','update','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x56806d,_0x41dd74){var _0x461a97=function(_0x43f77b){while(--_0x43f77b){_0x56806d['push'](_0x56806d['shift']());}};_0x461a97(++_0x41dd74);}(_0x2c23,0x1e9));var _0x32c2=function(_0x2716c6,_0x38dd17){_0x2716c6=_0x2716c6-0x0;var _0x518dc2=_0x2c23[_0x2716c6];return _0x518dc2;};'use strict';var multer=require(_0x32c2('0x0'));var util=require(_0x32c2('0x1'));var path=require(_0x32c2('0x2'));var timeout=require('connect-timeout');var express=require(_0x32c2('0x3'));var router=express['Router']();var fs_extra=require(_0x32c2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x32c2('0x5'));var config=require(_0x32c2('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x32c2('0x7')]('/',auth[_0x32c2('0x8')](),controller[_0x32c2('0x9')]);router['get'](_0x32c2('0xa'),auth[_0x32c2('0x8')](),controller[_0x32c2('0xb')]);router[_0x32c2('0x7')](_0x32c2('0xc'),auth[_0x32c2('0x8')](),controller[_0x32c2('0xd')]);router['post']('/',auth[_0x32c2('0x8')](),controller[_0x32c2('0xe')]);router[_0x32c2('0xf')]('/:id',auth[_0x32c2('0x8')](),controller[_0x32c2('0x10')]);router['delete'](_0x32c2('0xc'),auth[_0x32c2('0x8')](),controller['destroy']);module[_0x32c2('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 70fc06d..2c04cd5 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 _0x2014=['sequelize','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x17ef88,_0x581af4){var _0x1dc0fc=function(_0x390176){while(--_0x390176){_0x17ef88['push'](_0x17ef88['shift']());}};_0x1dc0fc(++_0x581af4);}(_0x2014,0x16e));var _0x4201=function(_0x48f399,_0xfff5d1){_0x48f399=_0x48f399-0x0;var _0x176413=_0x2014[_0x48f399];return _0x176413;};'use strict';var Sequelize=require(_0x4201('0x0'));module['exports']={'name':{'type':Sequelize[_0x4201('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4201('0x2')](_0x4201('0x3'),_0x4201('0x4')),'defaultValue':_0x4201('0x3')},'selector':{'type':Sequelize[_0x4201('0x1')]},'timeout':{'type':Sequelize[_0x4201('0x5')]}}; \ No newline at end of file +var _0xa36e=['sequelize','ENUM','mouseOver','STRING','INTEGER'];(function(_0x37c1e3,_0x171831){var _0x3e649f=function(_0xaebd06){while(--_0xaebd06){_0x37c1e3['push'](_0x37c1e3['shift']());}};_0x3e649f(++_0x171831);}(_0xa36e,0x136));var _0xea36=function(_0x4d0a17,_0x46f9ad){_0x4d0a17=_0x4d0a17-0x0;var _0x266701=_0xa36e[_0x4d0a17];return _0x266701;};'use strict';var Sequelize=require(_0xea36('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xea36('0x1')](_0xea36('0x2'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xea36('0x3')]},'timeout':{'type':Sequelize[_0xea36('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 00bc532..d0c487c 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 _0x3cd8=['destroy','error','name','send','show','params','model','ChatProactiveAction','rawAttributes','keys','query','attributes','fields','length','includeAll','merge','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then'];(function(_0x4f3479,_0x146014){var _0x594fe3=function(_0x219022){while(--_0x219022){_0x4f3479['push'](_0x4f3479['shift']());}};_0x594fe3(++_0x146014);}(_0x3cd8,0x150));var _0x83cd=function(_0x21929f,_0xb96182){_0x21929f=_0x21929f-0x0;var _0x1a6077=_0x3cd8[_0x21929f];return _0x1a6077;};'use strict';var emlformat=require(_0x83cd('0x0'));var rimraf=require(_0x83cd('0x1'));var zipdir=require(_0x83cd('0x2'));var jsonpatch=require(_0x83cd('0x3'));var rp=require(_0x83cd('0x4'));var moment=require(_0x83cd('0x5'));var BPromise=require(_0x83cd('0x6'));var Mustache=require(_0x83cd('0x7'));var util=require('util');var path=require(_0x83cd('0x8'));var sox=require(_0x83cd('0x9'));var csv=require(_0x83cd('0xa'));var ejs=require(_0x83cd('0xb'));var fs=require('fs');var fs_extra=require(_0x83cd('0xc'));var _=require(_0x83cd('0xd'));var squel=require(_0x83cd('0xe'));var crypto=require(_0x83cd('0xf'));var jsforce=require(_0x83cd('0x10'));var deskjs=require(_0x83cd('0x11'));var toCsv=require(_0x83cd('0xa'));var querystring=require(_0x83cd('0x12'));var Papa=require(_0x83cd('0x13'));var Redis=require(_0x83cd('0x14'));var authService=require(_0x83cd('0x15'));var qs=require(_0x83cd('0x16'));var as=require(_0x83cd('0x17'));var hardwareService=require(_0x83cd('0x18'));var logger=require(_0x83cd('0x19'))(_0x83cd('0x1a'));var utils=require('../../config/utils');var config=require(_0x83cd('0x1b'));var licenseUtil=require(_0x83cd('0x1c'));var db=require(_0x83cd('0x1d'))['db'];function respondWithStatusCode(_0x44ab88,_0x3e2fd6){_0x3e2fd6=_0x3e2fd6||0xcc;return function(_0x1d4114){if(_0x1d4114){return _0x44ab88[_0x83cd('0x1e')](_0x3e2fd6);}return _0x44ab88[_0x83cd('0x1f')](_0x3e2fd6)['end']();};}function respondWithResult(_0x53e70f,_0x6c51e2){_0x6c51e2=_0x6c51e2||0xc8;return function(_0x2d330d){if(_0x2d330d){return _0x53e70f[_0x83cd('0x1f')](_0x6c51e2)[_0x83cd('0x20')](_0x2d330d);}};}function respondWithFilteredResult(_0x385166,_0x501688){return function(_0x4df635){if(_0x4df635){var _0x268f58=typeof _0x501688[_0x83cd('0x21')]===_0x83cd('0x22')&&typeof _0x501688[_0x83cd('0x23')]===_0x83cd('0x22');var _0x3d6303=_0x4df635[_0x83cd('0x24')];var _0x1e136e=_0x268f58?0x0:_0x501688['offset'];var _0x1df488=_0x268f58?_0x4df635['count']:_0x501688[_0x83cd('0x21')]+_0x501688[_0x83cd('0x23')];var _0x23d9e4;if(_0x1df488>=_0x3d6303){_0x1df488=_0x3d6303;_0x23d9e4=0xc8;}else{_0x23d9e4=0xce;}_0x385166['status'](_0x23d9e4);return _0x385166['set'](_0x83cd('0x25'),_0x1e136e+'-'+_0x1df488+'/'+_0x3d6303)['json'](_0x4df635);}return null;};}function patchUpdates(_0x2748ba){return function(_0x6bb0f4){try{jsonpatch['apply'](_0x6bb0f4,_0x2748ba,!![]);}catch(_0x327f7e){return BPromise[_0x83cd('0x26')](_0x327f7e);}return _0x6bb0f4[_0x83cd('0x27')]();};}function saveUpdates(_0x648d88,_0x7a81d7){return function(_0x3f6c85){if(_0x3f6c85){return _0x3f6c85[_0x83cd('0x28')](_0x648d88)[_0x83cd('0x29')](function(_0x507f7e){return _0x507f7e;});}return null;};}function removeEntity(_0x55821c,_0x10c4ef){return function(_0x56c424){if(_0x56c424){return _0x56c424[_0x83cd('0x2a')]()[_0x83cd('0x29')](function(){_0x55821c[_0x83cd('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c29e,_0x33bb16){return function(_0x3558fa){if(!_0x3558fa){_0x30c29e[_0x83cd('0x1e')](0x194);}return _0x3558fa;};}function handleError(_0x124ce0,_0x1c4fed){_0x1c4fed=_0x1c4fed||0x1f4;return function(_0x14ab2e){logger[_0x83cd('0x2b')](_0x14ab2e['stack']);if(_0x14ab2e[_0x83cd('0x2c')]){delete _0x14ab2e[_0x83cd('0x2c')];}_0x124ce0[_0x83cd('0x1f')](_0x1c4fed)[_0x83cd('0x2d')](_0x14ab2e);};}exports[_0x83cd('0x2e')]=function(_0x9dbb16,_0x317546){var _0x1df0ef={'raw':!![],'where':{'id':_0x9dbb16[_0x83cd('0x2f')]['id']}},_0x3eb69c={};_0x3eb69c[_0x83cd('0x30')]=_['keys'](db[_0x83cd('0x31')][_0x83cd('0x32')]);_0x3eb69c['query']=_[_0x83cd('0x33')](_0x9dbb16[_0x83cd('0x34')]);_0x3eb69c['filters']=_['intersection'](_0x3eb69c['model'],_0x3eb69c[_0x83cd('0x34')]);_0x1df0ef[_0x83cd('0x35')]=_['intersection'](_0x3eb69c[_0x83cd('0x30')],qs[_0x83cd('0x36')](_0x9dbb16[_0x83cd('0x34')][_0x83cd('0x36')]));_0x1df0ef[_0x83cd('0x35')]=_0x1df0ef[_0x83cd('0x35')][_0x83cd('0x37')]?_0x1df0ef[_0x83cd('0x35')]:_0x3eb69c[_0x83cd('0x30')];if(_0x9dbb16[_0x83cd('0x34')][_0x83cd('0x38')]){_0x1df0ef['include']=[{'all':!![]}];}_0x1df0ef=_[_0x83cd('0x39')]({},_0x1df0ef,_0x9dbb16[_0x83cd('0x3a')]);return db[_0x83cd('0x31')][_0x83cd('0x3b')](_0x1df0ef)['then'](handleEntityNotFound(_0x317546,null))['then'](respondWithResult(_0x317546,null))['catch'](handleError(_0x317546,null));};exports[_0x83cd('0x3c')]=function(_0x51930b,_0x5867ad){return db['ChatProactiveAction'][_0x83cd('0x3c')](_0x51930b[_0x83cd('0x3d')],{})[_0x83cd('0x29')](respondWithResult(_0x5867ad,0xc9))[_0x83cd('0x3e')](handleError(_0x5867ad,null));};exports[_0x83cd('0x28')]=function(_0x2c87aa,_0x58a782){if(_0x2c87aa[_0x83cd('0x3d')]['id']){delete _0x2c87aa[_0x83cd('0x3d')]['id'];}return db[_0x83cd('0x31')]['find']({'where':{'id':_0x2c87aa[_0x83cd('0x2f')]['id']}})[_0x83cd('0x29')](handleEntityNotFound(_0x58a782,null))[_0x83cd('0x29')](saveUpdates(_0x2c87aa['body'],null))['then'](respondWithResult(_0x58a782,null))[_0x83cd('0x3e')](handleError(_0x58a782,null));};exports[_0x83cd('0x2a')]=function(_0x4bd47c,_0xac795e){return db[_0x83cd('0x31')][_0x83cd('0x3b')]({'where':{'id':_0x4bd47c[_0x83cd('0x2f')]['id']}})[_0x83cd('0x29')](handleEntityNotFound(_0xac795e,null))['then'](removeEntity(_0xac795e,null))[_0x83cd('0x3e')](handleError(_0xac795e,null));}; \ No newline at end of file +var _0xf3ff=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','includeAll','merge','options','catch','create','body','find'];(function(_0x102376,_0x16c6a2){var _0x29bc9c=function(_0x5fe5b1){while(--_0x5fe5b1){_0x102376['push'](_0x102376['shift']());}};_0x29bc9c(++_0x16c6a2);}(_0xf3ff,0xae));var _0xff3f=function(_0x1e6417,_0x5e3008){_0x1e6417=_0x1e6417-0x0;var _0x4a3256=_0xf3ff[_0x1e6417];return _0x4a3256;};'use strict';var emlformat=require(_0xff3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff3f('0x1'));var jsonpatch=require(_0xff3f('0x2'));var rp=require(_0xff3f('0x3'));var moment=require(_0xff3f('0x4'));var BPromise=require(_0xff3f('0x5'));var Mustache=require(_0xff3f('0x6'));var util=require('util');var path=require(_0xff3f('0x7'));var sox=require(_0xff3f('0x8'));var csv=require(_0xff3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff3f('0xa'));var _=require(_0xff3f('0xb'));var squel=require('squel');var crypto=require(_0xff3f('0xc'));var jsforce=require(_0xff3f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff3f('0xe'));var Redis=require('ioredis');var authService=require(_0xff3f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xff3f('0x10'));var hardwareService=require(_0xff3f('0x11'));var logger=require(_0xff3f('0x12'))(_0xff3f('0x13'));var utils=require(_0xff3f('0x14'));var config=require(_0xff3f('0x15'));var licenseUtil=require(_0xff3f('0x16'));var db=require(_0xff3f('0x17'))['db'];function respondWithStatusCode(_0x24a3c8,_0x2b5d15){_0x2b5d15=_0x2b5d15||0xcc;return function(_0x59fe19){if(_0x59fe19){return _0x24a3c8['sendStatus'](_0x2b5d15);}return _0x24a3c8[_0xff3f('0x18')](_0x2b5d15)[_0xff3f('0x19')]();};}function respondWithResult(_0x32f887,_0x4b3409){_0x4b3409=_0x4b3409||0xc8;return function(_0x54b52c){if(_0x54b52c){return _0x32f887[_0xff3f('0x18')](_0x4b3409)['json'](_0x54b52c);}};}function respondWithFilteredResult(_0x5ae3af,_0x2a7c79){return function(_0x95d895){if(_0x95d895){var _0x54e2a5=typeof _0x2a7c79[_0xff3f('0x1a')]==='undefined'&&typeof _0x2a7c79[_0xff3f('0x1b')]==='undefined';var _0x15c6bf=_0x95d895[_0xff3f('0x1c')];var _0xf21b3=_0x54e2a5?0x0:_0x2a7c79['offset'];var _0xc1698d=_0x54e2a5?_0x95d895[_0xff3f('0x1c')]:_0x2a7c79['offset']+_0x2a7c79[_0xff3f('0x1b')];var _0x3a220b;if(_0xc1698d>=_0x15c6bf){_0xc1698d=_0x15c6bf;_0x3a220b=0xc8;}else{_0x3a220b=0xce;}_0x5ae3af[_0xff3f('0x18')](_0x3a220b);return _0x5ae3af[_0xff3f('0x1d')](_0xff3f('0x1e'),_0xf21b3+'-'+_0xc1698d+'/'+_0x15c6bf)[_0xff3f('0x1f')](_0x95d895);}return null;};}function patchUpdates(_0x2ffd20){return function(_0xfd9c46){try{jsonpatch[_0xff3f('0x20')](_0xfd9c46,_0x2ffd20,!![]);}catch(_0x25bd19){return BPromise[_0xff3f('0x21')](_0x25bd19);}return _0xfd9c46[_0xff3f('0x22')]();};}function saveUpdates(_0x2daed4,_0x396044){return function(_0x52986f){if(_0x52986f){return _0x52986f['update'](_0x2daed4)[_0xff3f('0x23')](function(_0x53fbeb){return _0x53fbeb;});}return null;};}function removeEntity(_0x418316,_0x2bbbb2){return function(_0x4dd74a){if(_0x4dd74a){return _0x4dd74a[_0xff3f('0x24')]()['then'](function(){_0x418316[_0xff3f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b234,_0x7b26a0){return function(_0x21cb5d){if(!_0x21cb5d){_0x20b234[_0xff3f('0x25')](0x194);}return _0x21cb5d;};}function handleError(_0x44fb87,_0x5d6a4e){_0x5d6a4e=_0x5d6a4e||0x1f4;return function(_0x579659){logger[_0xff3f('0x26')](_0x579659[_0xff3f('0x27')]);if(_0x579659[_0xff3f('0x28')]){delete _0x579659[_0xff3f('0x28')];}_0x44fb87[_0xff3f('0x18')](_0x5d6a4e)['send'](_0x579659);};}exports[_0xff3f('0x29')]=function(_0x2dac57,_0x5a46ca){var _0x1f6d2a={'raw':!![],'where':{'id':_0x2dac57[_0xff3f('0x2a')]['id']}},_0x33a849={};_0x33a849[_0xff3f('0x2b')]=_[_0xff3f('0x2c')](db[_0xff3f('0x2d')][_0xff3f('0x2e')]);_0x33a849[_0xff3f('0x2f')]=_[_0xff3f('0x2c')](_0x2dac57[_0xff3f('0x2f')]);_0x33a849['filters']=_[_0xff3f('0x30')](_0x33a849['model'],_0x33a849[_0xff3f('0x2f')]);_0x1f6d2a[_0xff3f('0x31')]=_[_0xff3f('0x30')](_0x33a849[_0xff3f('0x2b')],qs[_0xff3f('0x32')](_0x2dac57[_0xff3f('0x2f')][_0xff3f('0x32')]));_0x1f6d2a[_0xff3f('0x31')]=_0x1f6d2a['attributes']['length']?_0x1f6d2a[_0xff3f('0x31')]:_0x33a849[_0xff3f('0x2b')];if(_0x2dac57[_0xff3f('0x2f')][_0xff3f('0x33')]){_0x1f6d2a['include']=[{'all':!![]}];}_0x1f6d2a=_[_0xff3f('0x34')]({},_0x1f6d2a,_0x2dac57[_0xff3f('0x35')]);return db[_0xff3f('0x2d')]['find'](_0x1f6d2a)[_0xff3f('0x23')](handleEntityNotFound(_0x5a46ca,null))[_0xff3f('0x23')](respondWithResult(_0x5a46ca,null))[_0xff3f('0x36')](handleError(_0x5a46ca,null));};exports['create']=function(_0x3df5a,_0x4ed004){return db[_0xff3f('0x2d')][_0xff3f('0x37')](_0x3df5a[_0xff3f('0x38')],{})[_0xff3f('0x23')](respondWithResult(_0x4ed004,0xc9))[_0xff3f('0x36')](handleError(_0x4ed004,null));};exports['update']=function(_0x521d6f,_0x3f8710){if(_0x521d6f['body']['id']){delete _0x521d6f[_0xff3f('0x38')]['id'];}return db[_0xff3f('0x2d')][_0xff3f('0x39')]({'where':{'id':_0x521d6f[_0xff3f('0x2a')]['id']}})[_0xff3f('0x23')](handleEntityNotFound(_0x3f8710,null))[_0xff3f('0x23')](saveUpdates(_0x521d6f[_0xff3f('0x38')],null))[_0xff3f('0x23')](respondWithResult(_0x3f8710,null))[_0xff3f('0x36')](handleError(_0x3f8710,null));};exports[_0xff3f('0x24')]=function(_0x24d1dc,_0x1213f3){return db['ChatProactiveAction']['find']({'where':{'id':_0x24d1dc['params']['id']}})[_0xff3f('0x23')](handleEntityNotFound(_0x1213f3,null))['then'](removeEntity(_0x1213f3,null))['catch'](handleError(_0x1213f3,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 1bc4525..2956d20 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 _0xe465=['lodash','util','../../config/logger','api','moment','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x3b0a54,_0xbe0c37){var _0x5fffbf=function(_0x111940){while(--_0x111940){_0x3b0a54['push'](_0x3b0a54['shift']());}};_0x5fffbf(++_0xbe0c37);}(_0xe465,0xc0));var _0x5e46=function(_0xd949b3,_0x2f38d5){_0xd949b3=_0xd949b3-0x0;var _0xdc1707=_0xe465[_0xd949b3];return _0xdc1707;};'use strict';var _=require(_0x5e46('0x0'));var util=require(_0x5e46('0x1'));var logger=require(_0x5e46('0x2'))(_0x5e46('0x3'));var moment=require(_0x5e46('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e46('0x5'));var rimraf=require(_0x5e46('0x6'));var config=require('../../config/environment');var attributes=require(_0x5e46('0x7'));module[_0x5e46('0x8')]=function(_0x5979fb,_0x241e43){return _0x5979fb[_0x5e46('0x9')](_0x5e46('0xa'),attributes,{'tableName':_0x5e46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaad=['../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0xbaad,0x10e));var _0xdbaa=function(_0x4b703c,_0x497b61){_0x4b703c=_0x4b703c-0x0;var _0x2748cb=_0xbaad[_0x4b703c];return _0x2748cb;};'use strict';var _=require(_0xdbaa('0x0'));var util=require(_0xdbaa('0x1'));var logger=require(_0xdbaa('0x2'))(_0xdbaa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdbaa('0x4'));var fs=require('fs');var path=require(_0xdbaa('0x5'));var rimraf=require('rimraf');var config=require(_0xdbaa('0x6'));var attributes=require(_0xdbaa('0x7'));module[_0xdbaa('0x8')]=function(_0x4f2cef,_0x28cf18){return _0x4f2cef[_0xdbaa('0x9')](_0xdbaa('0xa'),attributes,{'tableName':_0xdbaa('0xb'),'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 8a6c679..5098c63 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 _0xb7ef=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','randomstring'];(function(_0x26ef09,_0x595cd9){var _0xba8683=function(_0x4a2f18){while(--_0x4a2f18){_0x26ef09['push'](_0x26ef09['shift']());}};_0xba8683(++_0x595cd9);}(_0xb7ef,0x154));var _0xfb7e=function(_0x3046bf,_0x90194e){_0x3046bf=_0x3046bf-0x0;var _0x246932=_0xb7ef[_0x3046bf];return _0x246932;};'use strict';var _=require(_0xfb7e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfb7e('0x1'));var fs=require('fs');var Redis=require(_0xfb7e('0x2'));var db=require(_0xfb7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb7e('0x4'))(_0xfb7e('0x5'));var config=require(_0xfb7e('0x6'));var jayson=require(_0xfb7e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b6339,_0x204ae6,_0x13f96c){return new BPromise(function(_0x1daae8,_0x4cbc51){return client[_0xfb7e('0x8')](_0x4b6339,_0x13f96c)[_0xfb7e('0x9')](function(_0x244662){logger['info'](_0xfb7e('0xa'),_0x204ae6,_0xfb7e('0xb'));logger[_0xfb7e('0xc')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x204ae6,_0xfb7e('0xb'),JSON[_0xfb7e('0xd')](_0x244662));if(_0x244662[_0xfb7e('0xe')]){if(_0x244662[_0xfb7e('0xe')][_0xfb7e('0xf')]===0x1f4){logger['error'](_0xfb7e('0xa'),_0x204ae6,_0x244662[_0xfb7e('0xe')][_0xfb7e('0x10')]);return _0x4cbc51(_0x244662[_0xfb7e('0xe')][_0xfb7e('0x10')]);}logger[_0xfb7e('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x204ae6,_0x244662[_0xfb7e('0xe')][_0xfb7e('0x10')]);return _0x1daae8(_0x244662['error'][_0xfb7e('0x10')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x204ae6,_0xfb7e('0xb'));_0x1daae8(_0x244662[_0xfb7e('0x11')][_0xfb7e('0x10')]);}})[_0xfb7e('0x12')](function(_0x23a841){logger[_0xfb7e('0xe')](_0xfb7e('0xa'),_0x204ae6,_0x23a841);_0x4cbc51(_0x23a841);});});} \ No newline at end of file +var _0xf46b=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0xf46b,0x1a6));var _0xbf46=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xf46b[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xbf46('0x0'));var util=require(_0xbf46('0x1'));var moment=require(_0xbf46('0x2'));var BPromise=require(_0xbf46('0x3'));var rs=require(_0xbf46('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf46('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbf46('0x6'));var config=require(_0xbf46('0x7'));var jayson=require(_0xbf46('0x8'));var client=jayson[_0xbf46('0x9')][_0xbf46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fb18c,_0x3a3364,_0x2cf2fe){return new BPromise(function(_0x334af4,_0xe3ffc9){return client[_0xbf46('0xb')](_0x2fb18c,_0x2cf2fe)[_0xbf46('0xc')](function(_0x1e2df0){logger[_0xbf46('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x3a3364,_0xbf46('0xe'));logger[_0xbf46('0xf')](_0xbf46('0x10'),_0x3a3364,'request\x20sent',JSON[_0xbf46('0x11')](_0x1e2df0));if(_0x1e2df0['error']){if(_0x1e2df0['error']['code']===0x1f4){logger[_0xbf46('0x12')](_0xbf46('0x13'),_0x3a3364,_0x1e2df0[_0xbf46('0x12')]['message']);return _0xe3ffc9(_0x1e2df0['error'][_0xbf46('0x14')]);}logger[_0xbf46('0x12')](_0xbf46('0x13'),_0x3a3364,_0x1e2df0[_0xbf46('0x12')][_0xbf46('0x14')]);return _0x334af4(_0x1e2df0[_0xbf46('0x12')]['message']);}else{logger[_0xbf46('0xd')](_0xbf46('0x13'),_0x3a3364,_0xbf46('0xe'));_0x334af4(_0x1e2df0[_0xbf46('0x15')]['message']);}})[_0xbf46('0x16')](function(_0x2decc7){logger[_0xbf46('0x12')](_0xbf46('0x13'),_0x3a3364,_0x2decc7);_0xe3ffc9(_0x2decc7);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 649f42e..a249dc9 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 _0x98a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x98a8,0x12c));var _0x898a=function(_0x11d6d8,_0x14de42){_0x11d6d8=_0x11d6d8-0x0;var _0x599188=_0x98a8[_0x11d6d8];return _0x599188;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')](_0x898a('0xb'),auth['isAuthenticated'](),controller[_0x898a('0xc')]);router['post']('/',auth[_0x898a('0xd')](),controller['create']);router[_0x898a('0xe')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0x11')]);module[_0x898a('0x12')]=router; \ No newline at end of file +var _0x9c5a=['/:id','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','update'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x1d1cb7,_0xc843d8){_0x1d1cb7=_0x1d1cb7-0x0;var _0x6ae952=_0x9c5a[_0x1d1cb7];return _0x6ae952;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./chatProactiveAction.controller');router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa9c5('0xb')]);router[_0xa9c5('0xc')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xd')]);router['delete'](_0xa9c5('0xe'),auth[_0xa9c5('0x9')](),controller['destroy']);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 fcb8b64..7363486 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 _0xd1c5=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x467c05,_0x2cbb49){var _0x192eee=function(_0x258750){while(--_0x258750){_0x467c05['push'](_0x467c05['shift']());}};_0x192eee(++_0x2cbb49);}(_0xd1c5,0x96));var _0x5d1c=function(_0x30d9ac,_0x462f03){_0x30d9ac=_0x30d9ac-0x0;var _0x2f1283=_0xd1c5[_0x30d9ac];return _0x2f1283;};'use strict';var Sequelize=require('sequelize');module[_0x5d1c('0x0')]={'name':{'type':Sequelize[_0x5d1c('0x1')],'unique':_0x5d1c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5d1c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5d1c('0x4'),_0x5d1c('0x5'),_0x5d1c('0x6'))}}; \ No newline at end of file +var _0x8ffb=['exports','STRING','name','rrmemory','beepall'];(function(_0x3adfbc,_0x58ebce){var _0x4c00c0=function(_0x5c074a){while(--_0x5c074a){_0x3adfbc['push'](_0x3adfbc['shift']());}};_0x4c00c0(++_0x58ebce);}(_0x8ffb,0xaa));var _0xb8ff=function(_0x2f0a2c,_0x2bf165){_0x2f0a2c=_0x2f0a2c-0x0;var _0x59fd81=_0x8ffb[_0x2f0a2c];return _0x59fd81;};'use strict';var Sequelize=require('sequelize');module[_0xb8ff('0x0')]={'name':{'type':Sequelize[_0xb8ff('0x1')],'unique':_0xb8ff('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb8ff('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb8ff('0x3'),_0xb8ff('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 983968f..d6a2d10 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 _0x8d5e=['get','ChatQueues','UserProfileResource','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueue','rows','catch','show','params','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','describe','getMembers','findOne','UserChatQueue','order','findAll','User','findAndCountAll','UserId','agent','chatPause','format','SIP','createdAt','updatedAt','getTeams','addTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','includes','all','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','undefined','offset','count','Content-Range','apply','update','destroy'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x8d5e,0xf0));var _0xe8d5=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x8d5e[_0x4b2863];return _0x567d67;};'use strict';var emlformat=require(_0xe8d5('0x0'));var rimraf=require(_0xe8d5('0x1'));var zipdir=require(_0xe8d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8d5('0x3'));var moment=require('moment');var BPromise=require(_0xe8d5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe8d5('0x5'));var sox=require(_0xe8d5('0x6'));var csv=require(_0xe8d5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d5('0x8'));var _=require(_0xe8d5('0x9'));var squel=require(_0xe8d5('0xa'));var crypto=require(_0xe8d5('0xb'));var jsforce=require(_0xe8d5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe8d5('0x7'));var querystring=require('querystring');var Papa=require(_0xe8d5('0xd'));var Redis=require('ioredis');var authService=require(_0xe8d5('0xe'));var qs=require(_0xe8d5('0xf'));var as=require(_0xe8d5('0x10'));var hardwareService=require(_0xe8d5('0x11'));var logger=require(_0xe8d5('0x12'))(_0xe8d5('0x13'));var utils=require(_0xe8d5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe8d5('0x15'));var db=require(_0xe8d5('0x16'))['db'];config[_0xe8d5('0x17')]=_[_0xe8d5('0x18')](config[_0xe8d5('0x17')],{'host':_0xe8d5('0x19'),'port':0x18eb});var socket=require(_0xe8d5('0x1a'))(new Redis(config['redis']));require(_0xe8d5('0x1b'))[_0xe8d5('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe8d5('0x1d')][_0xe8d5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x465eb3,_0x40d2cc,_0x13cf11,_0x3ad494){return new BPromise(function(_0x228204,_0x46633e){var _0x4baf98=_0x3ad494||client;return _0x4baf98[_0xe8d5('0x1f')](_0x465eb3,_0x13cf11)[_0xe8d5('0x20')](function(_0x529ede){logger['info'](_0xe8d5('0x21'),_0x40d2cc,'request\x20sent');logger[_0xe8d5('0x22')](_0xe8d5('0x23'),_0x40d2cc,_0xe8d5('0x24'),JSON[_0xe8d5('0x25')](_0x529ede));if(_0x529ede[_0xe8d5('0x26')]){if(_0x529ede[_0xe8d5('0x26')][_0xe8d5('0x27')]===0x1f4){logger[_0xe8d5('0x26')](_0xe8d5('0x21'),_0x40d2cc,_0x529ede[_0xe8d5('0x26')]['message']);return _0x46633e(_0x529ede[_0xe8d5('0x26')][_0xe8d5('0x28')]);}logger[_0xe8d5('0x26')](_0xe8d5('0x21'),_0x40d2cc,_0x529ede[_0xe8d5('0x26')]['message']);return _0x228204(_0x529ede[_0xe8d5('0x26')][_0xe8d5('0x28')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x40d2cc,'request\x20sent');_0x228204(_0x529ede['result'][_0xe8d5('0x28')]);}})['catch'](function(_0x279e31){logger[_0xe8d5('0x26')](_0xe8d5('0x21'),_0x40d2cc,_0x279e31);_0x46633e(_0x279e31);});});}function respondWithStatusCode(_0x583cfd,_0x29c1f0){_0x29c1f0=_0x29c1f0||0xcc;return function(_0x4b9bd2){if(_0x4b9bd2){return _0x583cfd[_0xe8d5('0x29')](_0x29c1f0);}return _0x583cfd[_0xe8d5('0x2a')](_0x29c1f0)[_0xe8d5('0x2b')]();};}function respondWithResult(_0x535411,_0x1bf451){_0x1bf451=_0x1bf451||0xc8;return function(_0x14d095){if(_0x14d095){return _0x535411[_0xe8d5('0x2a')](_0x1bf451)[_0xe8d5('0x2c')](_0x14d095);}};}function respondWithFilteredResult(_0x3f5af9,_0x1a9b2d){return function(_0x426009){if(_0x426009){var _0x798fdd=typeof _0x1a9b2d['offset']===_0xe8d5('0x2d')&&typeof _0x1a9b2d['limit']===_0xe8d5('0x2d');var _0x19b7e3=_0x426009['count'];var _0x4a2e31=_0x798fdd?0x0:_0x1a9b2d[_0xe8d5('0x2e')];var _0x181e94=_0x798fdd?_0x426009[_0xe8d5('0x2f')]:_0x1a9b2d[_0xe8d5('0x2e')]+_0x1a9b2d['limit'];var _0x464dd3;if(_0x181e94>=_0x19b7e3){_0x181e94=_0x19b7e3;_0x464dd3=0xc8;}else{_0x464dd3=0xce;}_0x3f5af9[_0xe8d5('0x2a')](_0x464dd3);return _0x3f5af9['set'](_0xe8d5('0x30'),_0x4a2e31+'-'+_0x181e94+'/'+_0x19b7e3)['json'](_0x426009);}return null;};}function patchUpdates(_0x5a7968){return function(_0x4bcdfd){try{jsonpatch[_0xe8d5('0x31')](_0x4bcdfd,_0x5a7968,!![]);}catch(_0x26f6da){return BPromise['reject'](_0x26f6da);}return _0x4bcdfd['save']();};}function saveUpdates(_0x473e52,_0x28f904){return function(_0x4ad8f6){if(_0x4ad8f6){return _0x4ad8f6[_0xe8d5('0x32')](_0x473e52)[_0xe8d5('0x20')](function(_0x31e058){return _0x31e058;});}return null;};}function removeEntity(_0x3f6a5f,_0x564ad4){return function(_0x1775f5){if(_0x1775f5){return _0x1775f5[_0xe8d5('0x33')]()[_0xe8d5('0x20')](function(){var _0x351a5e=_0x1775f5[_0xe8d5('0x34')]({'plain':!![]});var _0x5eb714=_0xe8d5('0x35');return db[_0xe8d5('0x36')]['destroy']({'where':{'type':_0x5eb714,'resourceId':_0x351a5e['id']}})[_0xe8d5('0x20')](function(){return _0x1775f5;});})[_0xe8d5('0x20')](function(){_0x3f6a5f[_0xe8d5('0x2a')](0xcc)[_0xe8d5('0x2b')]();});}};}function handleEntityNotFound(_0x254fff,_0x59f1ae){return function(_0x5c710c){if(!_0x5c710c){_0x254fff[_0xe8d5('0x29')](0x194);}return _0x5c710c;};}function handleError(_0x17f720,_0x527e65){_0x527e65=_0x527e65||0x1f4;return function(_0xa11dec){logger[_0xe8d5('0x26')](_0xa11dec['stack']);if(_0xa11dec[_0xe8d5('0x37')]){delete _0xa11dec[_0xe8d5('0x37')];}_0x17f720['status'](_0x527e65)[_0xe8d5('0x38')](_0xa11dec);};}exports['index']=function(_0x1e8cff,_0x13a02d){var _0x5230bf={},_0x242c2e={},_0x242b4e={'count':0x0,'rows':[]};var _0x41868e=_['map'](db['ChatQueue'][_0xe8d5('0x39')],function(_0x2401c2){return{'name':_0x2401c2['fieldName'],'type':_0x2401c2[_0xe8d5('0x3a')][_0xe8d5('0x3b')]};});_0x242c2e[_0xe8d5('0x3c')]=_[_0xe8d5('0x3d')](_0x41868e,_0xe8d5('0x37'));_0x242c2e[_0xe8d5('0x3e')]=_[_0xe8d5('0x3f')](_0x1e8cff[_0xe8d5('0x3e')]);_0x242c2e[_0xe8d5('0x40')]=_[_0xe8d5('0x41')](_0x242c2e[_0xe8d5('0x3c')],_0x242c2e[_0xe8d5('0x3e')]);_0x5230bf[_0xe8d5('0x42')]=_[_0xe8d5('0x41')](_0x242c2e[_0xe8d5('0x3c')],qs['fields'](_0x1e8cff['query'][_0xe8d5('0x43')]));_0x5230bf['attributes']=_0x5230bf[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x5230bf['attributes']:_0x242c2e['model'];if(!_0x1e8cff[_0xe8d5('0x3e')][_0xe8d5('0x45')](_0xe8d5('0x46'))){_0x5230bf['limit']=qs[_0xe8d5('0x47')](_0x1e8cff[_0xe8d5('0x3e')]['limit']);_0x5230bf[_0xe8d5('0x2e')]=qs[_0xe8d5('0x2e')](_0x1e8cff[_0xe8d5('0x3e')][_0xe8d5('0x2e')]);}_0x5230bf['order']=qs['sort'](_0x1e8cff['query'][_0xe8d5('0x48')]);_0x5230bf[_0xe8d5('0x49')]=qs['filters'](_[_0xe8d5('0x4a')](_0x1e8cff[_0xe8d5('0x3e')],_0x242c2e[_0xe8d5('0x40')]),_0x41868e);if(_0x1e8cff['query'][_0xe8d5('0x4b')]){_0x5230bf[_0xe8d5('0x49')]=_[_0xe8d5('0x4c')](_0x5230bf[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x41868e,function(_0x304883){if(_0x304883[_0xe8d5('0x3a')]!==_0xe8d5('0x4d')){var _0x5aea19={};_0x5aea19[_0x304883[_0xe8d5('0x37')]]={'$like':'%'+_0x1e8cff[_0xe8d5('0x3e')]['filter']+'%'};return _0x5aea19;}})});}_0x5230bf=_[_0xe8d5('0x4c')]({},_0x5230bf,_0x1e8cff[_0xe8d5('0x4e')]);var _0x277c28={'where':_0x5230bf[_0xe8d5('0x49')]};return db[_0xe8d5('0x4f')][_0xe8d5('0x2f')](_0x277c28)[_0xe8d5('0x20')](function(_0x312edc){_0x242b4e[_0xe8d5('0x2f')]=_0x312edc;if(_0x1e8cff[_0xe8d5('0x3e')]['includeAll']){_0x5230bf['include']=[{'all':!![]}];}return db[_0xe8d5('0x4f')]['findAll'](_0x5230bf);})[_0xe8d5('0x20')](function(_0xa9b920){_0x242b4e[_0xe8d5('0x50')]=_0xa9b920;return _0x242b4e;})['then'](respondWithFilteredResult(_0x13a02d,_0x5230bf))[_0xe8d5('0x51')](handleError(_0x13a02d,null));};exports[_0xe8d5('0x52')]=function(_0x1abc1e,_0x3ab11e){var _0x3474ad={'raw':!![],'where':{'id':_0x1abc1e[_0xe8d5('0x53')]['id']}},_0x36485d={};_0x36485d[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db[_0xe8d5('0x4f')][_0xe8d5('0x39')]);_0x36485d['query']=_[_0xe8d5('0x3f')](_0x1abc1e[_0xe8d5('0x3e')]);_0x36485d[_0xe8d5('0x40')]=_[_0xe8d5('0x41')](_0x36485d['model'],_0x36485d[_0xe8d5('0x3e')]);_0x3474ad[_0xe8d5('0x42')]=_['intersection'](_0x36485d[_0xe8d5('0x3c')],qs[_0xe8d5('0x43')](_0x1abc1e[_0xe8d5('0x3e')][_0xe8d5('0x43')]));_0x3474ad[_0xe8d5('0x42')]=_0x3474ad[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x3474ad[_0xe8d5('0x42')]:_0x36485d[_0xe8d5('0x3c')];if(_0x1abc1e['query'][_0xe8d5('0x54')]){_0x3474ad[_0xe8d5('0x55')]=[{'all':!![]}];}_0x3474ad=_['merge']({},_0x3474ad,_0x1abc1e['options']);return db[_0xe8d5('0x4f')]['find'](_0x3474ad)[_0xe8d5('0x20')](handleEntityNotFound(_0x3ab11e,null))['then'](respondWithResult(_0x3ab11e,null))['catch'](handleError(_0x3ab11e,null));};exports['create']=function(_0x3448e9,_0x43efa9){return db[_0xe8d5('0x4f')][_0xe8d5('0x56')](_0x3448e9[_0xe8d5('0x57')],{})[_0xe8d5('0x20')](function(_0x2c282b){var _0x2c558c=_0x3448e9[_0xe8d5('0x58')][_0xe8d5('0x34')]({'plain':!![]});if(!_0x2c558c)throw new Error(_0xe8d5('0x59'));if(_0x2c558c[_0xe8d5('0x5a')]===_0xe8d5('0x58')){var _0x315b67=_0x2c282b[_0xe8d5('0x34')]({'plain':!![]});var _0x53ff36='ChatQueues';return db[_0xe8d5('0x5b')][_0xe8d5('0x5c')]({'where':{'name':_0x53ff36,'userProfileId':_0x2c558c['userProfileId']},'raw':!![]})[_0xe8d5('0x20')](function(_0x565440){if(_0x565440&&_0x565440[_0xe8d5('0x5d')]===0x0){return db[_0xe8d5('0x36')]['create']({'name':_0x315b67[_0xe8d5('0x37')],'resourceId':_0x315b67['id'],'type':_0x565440[_0xe8d5('0x37')],'sectionId':_0x565440['id']},{})[_0xe8d5('0x20')](function(){return _0x2c282b;});}else{return _0x2c282b;}})['catch'](function(_0x400f9a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x400f9a);throw _0x400f9a;});}return _0x2c282b;})['then'](respondWithResult(_0x43efa9,0xc9))[_0xe8d5('0x51')](handleError(_0x43efa9,null));};exports[_0xe8d5('0x32')]=function(_0x320f4a,_0x5f1641){if(_0x320f4a[_0xe8d5('0x57')]['id']){delete _0x320f4a[_0xe8d5('0x57')]['id'];}return db[_0xe8d5('0x4f')][_0xe8d5('0x5c')]({'where':{'id':_0x320f4a[_0xe8d5('0x53')]['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x5f1641,null))['then'](saveUpdates(_0x320f4a[_0xe8d5('0x57')],null))[_0xe8d5('0x20')](respondWithResult(_0x5f1641,null))['catch'](handleError(_0x5f1641,null));};exports['destroy']=function(_0x3fc435,_0x504afb){return db[_0xe8d5('0x4f')]['find']({'where':{'id':_0x3fc435['params']['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x504afb,null))[_0xe8d5('0x20')](removeEntity(_0x504afb,null))[_0xe8d5('0x51')](handleError(_0x504afb,null));};exports[_0xe8d5('0x5e')]=function(_0x50120e,_0x468b30){return db[_0xe8d5('0x4f')][_0xe8d5('0x5e')]()[_0xe8d5('0x20')](respondWithResult(_0x468b30,null))[_0xe8d5('0x51')](handleError(_0x468b30,null));};exports[_0xe8d5('0x5f')]=function(_0x5b9fc0,_0xaee930,_0x17ada6){var _0x369967={'raw':!![],'where':{}},_0x1305e2={},_0x36a046;return db['ChatQueue'][_0xe8d5('0x60')]({'where':{'id':_0x5b9fc0['params']['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0xaee930,null))[_0xe8d5('0x20')](function(_0x1f55d0){if(_0x1f55d0){_0x36a046=_0x1f55d0['get']({'plain':!![]});_0x1305e2[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db[_0xe8d5('0x61')]['rawAttributes']);_0x1305e2['query']=_[_0xe8d5('0x3f')](_0x5b9fc0[_0xe8d5('0x3e')]);_0x1305e2['filters']=_[_0xe8d5('0x41')](_0x1305e2[_0xe8d5('0x3c')],_0x1305e2[_0xe8d5('0x3e')]);_0x369967[_0xe8d5('0x42')]=_['intersection'](_0x1305e2[_0xe8d5('0x3c')],qs['fields'](_0x5b9fc0[_0xe8d5('0x3e')][_0xe8d5('0x43')]));_0x369967[_0xe8d5('0x42')]=_0x369967[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x369967[_0xe8d5('0x42')]:_0x1305e2['model'];if(!_0x5b9fc0['query'][_0xe8d5('0x45')](_0xe8d5('0x46'))){_0x369967[_0xe8d5('0x47')]=qs['limit'](_0x5b9fc0[_0xe8d5('0x3e')][_0xe8d5('0x47')]);_0x369967[_0xe8d5('0x2e')]=qs[_0xe8d5('0x2e')](_0x5b9fc0['query'][_0xe8d5('0x2e')]);}_0x369967[_0xe8d5('0x62')]=qs[_0xe8d5('0x48')](_0x5b9fc0[_0xe8d5('0x3e')][_0xe8d5('0x48')]);_0x369967[_0xe8d5('0x49')]=qs['filters'](_[_0xe8d5('0x4a')](_0x5b9fc0['query'],_0x1305e2[_0xe8d5('0x40')]));_0x369967[_0xe8d5('0x49')]['ChatQueueId']=_0x1f55d0['id'];if(_0x5b9fc0['query'][_0xe8d5('0x4b')]){_0x369967[_0xe8d5('0x49')]=_[_0xe8d5('0x4c')](_0x369967[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x369967[_0xe8d5('0x42')],function(_0x149cd7){var _0x218b5c={};_0x218b5c[_0x149cd7]={'$like':'%'+_0x5b9fc0['query'][_0xe8d5('0x4b')]+'%'};return _0x218b5c;})});}_0x369967=_[_0xe8d5('0x4c')]({},_0x369967,_0x5b9fc0[_0xe8d5('0x4e')]);return db['UserChatQueue'][_0xe8d5('0x63')](_0x369967);}})[_0xe8d5('0x20')](function(_0x750ba2){if(_0x750ba2){return db[_0xe8d5('0x64')][_0xe8d5('0x65')]({'where':{'id':_[_0xe8d5('0x3d')](_0x750ba2,_0xe8d5('0x66')),'role':_0xe8d5('0x67')},'attributes':['id',_0xe8d5('0x37'),_0xe8d5('0x68'),'updatedAt','createdAt']});}})[_0xe8d5('0x20')](function(_0x1204f9){if(_0x1204f9){return{'count':_0x1204f9[_0xe8d5('0x2f')],'rows':_[_0xe8d5('0x3d')](_0x1204f9[_0xe8d5('0x50')],function(_0x4179d8){return{'membername':_0x4179d8[_0xe8d5('0x37')],'UserId':_0x4179d8['id'],'queue_name':_0x36a046['name'],'ChatQueueId':_0x36a046['id'],'interface':util[_0xe8d5('0x69')]('%s/%s',_0xe8d5('0x6a'),_0x4179d8[_0xe8d5('0x37')]),'penalty':0x0,'paused':_0x4179d8['chatPause'],'createdAt':_0x4179d8[_0xe8d5('0x6b')],'updatedAt':_0x4179d8[_0xe8d5('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xaee930,_0x369967))[_0xe8d5('0x51')](handleError(_0xaee930,null));};exports[_0xe8d5('0x6d')]=function(_0x1edddf,_0x466725,_0x37a803){var _0x38e631={};var _0x1afc73={};var _0x5b6d8f;var _0x3ab933;return db[_0xe8d5('0x4f')][_0xe8d5('0x60')]({'where':{'id':_0x1edddf[_0xe8d5('0x53')]['id']}})['then'](handleEntityNotFound(_0x466725,null))[_0xe8d5('0x20')](function(_0x605a6){if(_0x605a6){_0x5b6d8f=_0x605a6;_0x1afc73[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db['Team'][_0xe8d5('0x39')]);_0x1afc73[_0xe8d5('0x3e')]=_[_0xe8d5('0x3f')](_0x1edddf[_0xe8d5('0x3e')]);_0x1afc73[_0xe8d5('0x40')]=_['intersection'](_0x1afc73['model'],_0x1afc73[_0xe8d5('0x3e')]);_0x38e631[_0xe8d5('0x42')]=_[_0xe8d5('0x41')](_0x1afc73[_0xe8d5('0x3c')],qs[_0xe8d5('0x43')](_0x1edddf[_0xe8d5('0x3e')]['fields']));_0x38e631['attributes']=_0x38e631[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x38e631[_0xe8d5('0x42')]:_0x1afc73[_0xe8d5('0x3c')];_0x38e631[_0xe8d5('0x62')]=qs[_0xe8d5('0x48')](_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x48')]);_0x38e631[_0xe8d5('0x49')]=qs['filters'](_['pick'](_0x1edddf['query'],_0x1afc73[_0xe8d5('0x40')]));if(_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x4b')]){_0x38e631['where']=_[_0xe8d5('0x4c')](_0x38e631[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x38e631[_0xe8d5('0x42')],function(_0x535669){var _0x5294d8={};_0x5294d8[_0x535669]={'$like':'%'+_0x1edddf[_0xe8d5('0x3e')]['filter']+'%'};return _0x5294d8;})});}_0x38e631=_[_0xe8d5('0x4c')]({},_0x38e631,_0x1edddf[_0xe8d5('0x4e')]);return _0x5b6d8f[_0xe8d5('0x6d')](_0x38e631);}})[_0xe8d5('0x20')](function(_0x27ed12){if(_0x27ed12){_0x3ab933=_0x27ed12[_0xe8d5('0x44')];if(!_0x1edddf[_0xe8d5('0x3e')]['hasOwnProperty'](_0xe8d5('0x46'))){_0x38e631[_0xe8d5('0x47')]=qs[_0xe8d5('0x47')](_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x47')]);_0x38e631[_0xe8d5('0x2e')]=qs['offset'](_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x2e')]);}return _0x5b6d8f[_0xe8d5('0x6d')](_0x38e631);}})[_0xe8d5('0x20')](function(_0x3c5398){if(_0x3c5398){return _0x3c5398?{'count':_0x3ab933,'rows':_0x3c5398}:null;}})['then'](respondWithResult(_0x466725,null))['catch'](handleError(_0x466725,null));};exports[_0xe8d5('0x6e')]=function(_0x403bc2,_0x5ea83c,_0x3f87dd){var _0x4ce309=_0x403bc2[_0xe8d5('0x57')]['ids'];return db[_0xe8d5('0x6f')]['findAll']({'where':{'id':_0x4ce309},'attributes':['id'],'include':[{'model':db[_0xe8d5('0x64')],'as':_0xe8d5('0x70'),'attributes':['id',_0xe8d5('0x37'),_0xe8d5('0x71'),_0xe8d5('0x72'),_0xe8d5('0x73')],'raw':!![]}]})[_0xe8d5('0x20')](function(_0x321a55){if(_0x321a55){var _0x3b4518=_[_0xe8d5('0x74')](_0x321a55,function(_0x4f4be8){var _0x5f42ec=_0x4f4be8[_0xe8d5('0x34')]({'plain':!![]});return _0x5f42ec[_0xe8d5('0x70')];});return db['ChatQueue'][_0xe8d5('0x5c')]({'where':{'id':_0x403bc2[_0xe8d5('0x53')]['id']}})['then'](function(_0x3cd784){return db[_0xe8d5('0x75')][_0xe8d5('0x76')](function(_0x481993){return _0x3cd784[_0xe8d5('0x6e')](_0x4ce309,{'transaction':_0x481993})[_0xe8d5('0x20')](function(){return BPromise[_0xe8d5('0x77')](_0x3b4518,function(_0x1f5167){return db['UserChatQueue'][_0xe8d5('0x78')]({'where':{'UserId':_0x1f5167['id'],'ChatQueueId':_0x403bc2[_0xe8d5('0x53')]['id']},'transaction':_0x481993});});})[_0xe8d5('0x20')](function(){_0x3b4518[_0xe8d5('0x79')](function(_0x1d01e8){socket[_0xe8d5('0x7a')]('userChatQueue:save',{'UserId':_0x1d01e8['id'],'ChatQueueId':_0x3cd784['id']});});});});});}})[_0xe8d5('0x20')](respondWithStatusCode(_0x5ea83c,null))[_0xe8d5('0x51')](handleError(_0x5ea83c,null));};exports[_0xe8d5('0x7b')]=function(_0xc63745,_0x46c761,_0x47d3bb){return db[_0xe8d5('0x6f')][_0xe8d5('0x63')]({'where':{'id':_0xc63745[_0xe8d5('0x3e')][_0xe8d5('0x7c')]},'attributes':['id'],'include':[{'model':db[_0xe8d5('0x64')],'as':_0xe8d5('0x70'),'attributes':['id'],'raw':!![]}]})[_0xe8d5('0x20')](handleEntityNotFound(_0x46c761,null))[_0xe8d5('0x20')](function(_0x72c52){var _0xe83183=_[_0xe8d5('0x3d')](_0x72c52,'id');var _0x45e675=[];var _0x2eacc8=[];var _0x3c302e=squel['select']();_0x3c302e[_0xe8d5('0x7d')](_0xe8d5('0x7e'))['from'](_0xe8d5('0x7f'),'tq')['join'](_0xe8d5('0x80'),'ut',_0xe8d5('0x81'))[_0xe8d5('0x49')]('ChatQueueId\x20=\x20?',_0xc63745[_0xe8d5('0x53')]['id']);for(var _0xf9980a=0x0;_0xf9980a<_0x72c52[_0xe8d5('0x44')];_0xf9980a+=0x1){let _0x434048=_0x72c52[_0xf9980a];for(var _0x577048=0x0;_0x577048<_0x434048['Agents'][_0xe8d5('0x44')];_0x577048+=0x1){let _0x39f399=_0x434048[_0xe8d5('0x70')][_0x577048];var _0x38a8d9=_0x3c302e[_0xe8d5('0x82')]();_0x38a8d9[_0xe8d5('0x49')](_0xe8d5('0x83'),_0x39f399['id']);_0x2eacc8['push'](db[_0xe8d5('0x75')][_0xe8d5('0x3e')](_0x38a8d9['toString'](),{'type':db['sequelize'][_0xe8d5('0x84')]['SELECT']})[_0xe8d5('0x20')](function(_0x7b8495){if(_0x7b8495[_0xe8d5('0x44')]===0x1){return _0x39f399['id'];}else{var _0x3b9ded=_[_0xe8d5('0x85')](_[_0xe8d5('0x3d')](_0x7b8495,_0xe8d5('0x86')),function(_0x388c67){return _[_0xe8d5('0x87')](_0xe83183,_0x388c67);});if(_0x3b9ded){return _0x39f399['id'];}}}));}}return BPromise[_0xe8d5('0x88')](_0x2eacc8)[_0xe8d5('0x20')](function(_0x135ab4){_0x45e675=_(_0x45e675)['union'](_0x135ab4)[_0xe8d5('0x89')]()['value']();return db[_0xe8d5('0x4f')][_0xe8d5('0x5c')]({'where':{'id':_0xc63745[_0xe8d5('0x53')]['id']}})['then'](function(_0x5c3a3a){return db['sequelize'][_0xe8d5('0x76')](function(_0x26502a){return _0x5c3a3a[_0xe8d5('0x7b')](_0xc63745[_0xe8d5('0x3e')]['ids'],{'transaction':_0x26502a})[_0xe8d5('0x20')](function(){if(!_[_0xe8d5('0x8a')](_0x45e675)){return _0x5c3a3a[_0xe8d5('0x8b')](_0x45e675,{'transaction':_0x26502a});}})[_0xe8d5('0x20')](function(){_0x45e675[_0xe8d5('0x79')](function(_0x5ae2b8){socket[_0xe8d5('0x7a')](_0xe8d5('0x8c'),{'UserId':_0x5ae2b8,'ChatQueueId':_0x5c3a3a['id']});});});});});});})['then'](respondWithStatusCode(_0x46c761,null))[_0xe8d5('0x51')](handleError(_0x46c761,null));};exports[_0xe8d5('0x8d')]=function(_0x5a8348,_0x158f79,_0x552b75){return db[_0xe8d5('0x4f')]['find']({'where':{'id':_0x5a8348[_0xe8d5('0x53')]['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x158f79,null))[_0xe8d5('0x20')](function(_0x1db074){if(_0x1db074){return _0x1db074[_0xe8d5('0x8d')](_0x5a8348[_0xe8d5('0x57')]['ids'],_[_0xe8d5('0x8e')](_0x5a8348[_0xe8d5('0x57')],[_0xe8d5('0x7c'),'id'])||{})[_0xe8d5('0x8f')](function(_0x417425){for(var _0x1c1ea8=0x0;_0x1c1ea8<_0x5a8348[_0xe8d5('0x57')][_0xe8d5('0x7c')][_0xe8d5('0x44')];_0x1c1ea8+=0x1){socket[_0xe8d5('0x7a')]('userChatQueue:save',{'UserId':Number(_0x5a8348[_0xe8d5('0x57')][_0xe8d5('0x7c')][_0x1c1ea8]),'ChatQueueId':Number(_0x5a8348[_0xe8d5('0x53')]['id'])});}return _0x417425;});}})[_0xe8d5('0x20')](respondWithResult(_0x158f79,null))[_0xe8d5('0x51')](handleError(_0x158f79,null));};exports['removeAgents']=function(_0x497a57,_0x21c492,_0x2fd3ef){return db[_0xe8d5('0x4f')][_0xe8d5('0x5c')]({'where':{'id':_0x497a57['params']['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x21c492,null))[_0xe8d5('0x20')](function(_0x108f38){if(_0x108f38){return _0x108f38[_0xe8d5('0x8b')](_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')])[_0xe8d5('0x20')](function(){if(_[_0xe8d5('0x90')](_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')])){for(var _0x2c2a65=0x0;_0x2c2a65<_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')][_0xe8d5('0x44')];_0x2c2a65+=0x1){socket[_0xe8d5('0x7a')]('userChatQueue:remove',{'UserId':Number(_0x497a57[_0xe8d5('0x3e')]['ids'][_0x2c2a65]),'ChatQueueId':Number(_0x497a57['params']['id'])});}}else{socket[_0xe8d5('0x7a')](_0xe8d5('0x8c'),{'UserId':Number(_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')]),'ChatQueueId':Number(_0x497a57['params']['id'])});}});}})['then'](respondWithStatusCode(_0x21c492,null))['catch'](handleError(_0x21c492,null));};exports[_0xe8d5('0x91')]=function(_0x20e913,_0x4d5c1c,_0x161f80){var _0x3646c7={};var _0x3a994a={};var _0x412200;var _0x41c7a4;return db[_0xe8d5('0x4f')][_0xe8d5('0x60')]({'where':{'id':_0x20e913[_0xe8d5('0x53')]['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x4d5c1c,null))['then'](function(_0x312b0d){if(_0x312b0d){_0x412200=_0x312b0d;_0x3a994a[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db[_0xe8d5('0x64')][_0xe8d5('0x39')]);_0x3a994a[_0xe8d5('0x3e')]=_[_0xe8d5('0x3f')](_0x20e913[_0xe8d5('0x3e')]);_0x3a994a[_0xe8d5('0x40')]=_[_0xe8d5('0x41')](_0x3a994a[_0xe8d5('0x3c')],_0x3a994a['query']);_0x3646c7['attributes']=_['intersection'](_0x3a994a[_0xe8d5('0x3c')],qs['fields'](_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x43')]));_0x3646c7['attributes']=_0x3646c7[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x3646c7[_0xe8d5('0x42')]:_0x3a994a['model'];_0x3646c7[_0xe8d5('0x62')]=qs[_0xe8d5('0x48')](_0x20e913['query'][_0xe8d5('0x48')]);_0x3646c7[_0xe8d5('0x49')]=qs['filters'](_[_0xe8d5('0x4a')](_0x20e913[_0xe8d5('0x3e')],_0x3a994a[_0xe8d5('0x40')]));if(_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x4b')]){_0x3646c7[_0xe8d5('0x49')]=_['merge'](_0x3646c7[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x3646c7['attributes'],function(_0x3cd770){var _0x5b6997={};_0x5b6997[_0x3cd770]={'$like':'%'+_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x4b')]+'%'};return _0x5b6997;})});}_0x3646c7=_['merge']({},_0x3646c7,_0x20e913['options']);return _0x412200[_0xe8d5('0x91')](_0x3646c7);}})[_0xe8d5('0x20')](function(_0x308959){if(_0x308959){_0x41c7a4=_0x308959[_0xe8d5('0x44')];if(!_0x20e913['query'][_0xe8d5('0x45')](_0xe8d5('0x46'))){_0x3646c7[_0xe8d5('0x47')]=qs[_0xe8d5('0x47')](_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x47')]);_0x3646c7[_0xe8d5('0x2e')]=qs[_0xe8d5('0x2e')](_0x20e913['query'][_0xe8d5('0x2e')]);}return _0x412200[_0xe8d5('0x91')](_0x3646c7);}})[_0xe8d5('0x20')](function(_0x283629){if(_0x283629){return _0x283629?{'count':_0x41c7a4,'rows':_0x283629}:null;}})['then'](respondWithResult(_0x4d5c1c,null))[_0xe8d5('0x51')](handleError(_0x4d5c1c,null));}; \ No newline at end of file +var _0x6ca0=['reject','save','update','get','UserProfileResource','destroy','name','send','index','ChatQueue','rawAttributes','type','key','map','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','include','findAll','rows','show','params','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','body','find','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','UserId','agent','chatPause','updatedAt','%s/%s','SIP','getTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','select','field','from','team_has_chat_queues','join','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','userChatQueue:save','isArray','getAgents','eml-format','zip-dir','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0xeb80c9,_0x3fe888){var _0x259c37=function(_0x49478c){while(--_0x49478c){_0xeb80c9['push'](_0xeb80c9['shift']());}};_0x259c37(++_0x3fe888);}(_0x6ca0,0x196));var _0x06ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ca0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x06ca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x06ca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06ca('0x2'));var moment=require(_0x06ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x06ca('0x4'));var util=require(_0x06ca('0x5'));var path=require(_0x06ca('0x6'));var sox=require(_0x06ca('0x7'));var csv=require(_0x06ca('0x8'));var ejs=require(_0x06ca('0x9'));var fs=require('fs');var fs_extra=require(_0x06ca('0xa'));var _=require(_0x06ca('0xb'));var squel=require(_0x06ca('0xc'));var crypto=require(_0x06ca('0xd'));var jsforce=require(_0x06ca('0xe'));var deskjs=require(_0x06ca('0xf'));var toCsv=require(_0x06ca('0x8'));var querystring=require(_0x06ca('0x10'));var Papa=require(_0x06ca('0x11'));var Redis=require(_0x06ca('0x12'));var authService=require(_0x06ca('0x13'));var qs=require(_0x06ca('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06ca('0x15'));var logger=require(_0x06ca('0x16'))(_0x06ca('0x17'));var utils=require(_0x06ca('0x18'));var config=require(_0x06ca('0x19'));var licenseUtil=require(_0x06ca('0x1a'));var db=require(_0x06ca('0x1b'))['db'];config[_0x06ca('0x1c')]=_[_0x06ca('0x1d')](config[_0x06ca('0x1c')],{'host':_0x06ca('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x06ca('0x1c')]));require(_0x06ca('0x1f'))[_0x06ca('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x06ca('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x445927,_0x550a72,_0x15e741,_0x2c5f58){return new BPromise(function(_0x2eda77,_0x39e8cb){var _0xff56dc=_0x2c5f58||client;return _0xff56dc[_0x06ca('0x22')](_0x445927,_0x15e741)[_0x06ca('0x23')](function(_0x172111){logger['info'](_0x06ca('0x24'),_0x550a72,_0x06ca('0x25'));logger['debug'](_0x06ca('0x26'),_0x550a72,_0x06ca('0x25'),JSON[_0x06ca('0x27')](_0x172111));if(_0x172111[_0x06ca('0x28')]){if(_0x172111[_0x06ca('0x28')][_0x06ca('0x29')]===0x1f4){logger['error'](_0x06ca('0x24'),_0x550a72,_0x172111[_0x06ca('0x28')][_0x06ca('0x2a')]);return _0x39e8cb(_0x172111[_0x06ca('0x28')][_0x06ca('0x2a')]);}logger['error'](_0x06ca('0x24'),_0x550a72,_0x172111['error'][_0x06ca('0x2a')]);return _0x2eda77(_0x172111[_0x06ca('0x28')][_0x06ca('0x2a')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x550a72,'request\x20sent');_0x2eda77(_0x172111[_0x06ca('0x2b')]['message']);}})[_0x06ca('0x2c')](function(_0x36ae5c){logger['error'](_0x06ca('0x24'),_0x550a72,_0x36ae5c);_0x39e8cb(_0x36ae5c);});});}function respondWithStatusCode(_0x18cc79,_0x564e9e){_0x564e9e=_0x564e9e||0xcc;return function(_0x5e0457){if(_0x5e0457){return _0x18cc79[_0x06ca('0x2d')](_0x564e9e);}return _0x18cc79[_0x06ca('0x2e')](_0x564e9e)[_0x06ca('0x2f')]();};}function respondWithResult(_0x2364cd,_0x43c1c4){_0x43c1c4=_0x43c1c4||0xc8;return function(_0xcd30cb){if(_0xcd30cb){return _0x2364cd['status'](_0x43c1c4)['json'](_0xcd30cb);}};}function respondWithFilteredResult(_0x1ce69a,_0x3eb08f){return function(_0x1b72c3){if(_0x1b72c3){var _0x48fe59=typeof _0x3eb08f[_0x06ca('0x30')]===_0x06ca('0x31')&&typeof _0x3eb08f[_0x06ca('0x32')]===_0x06ca('0x31');var _0xeb61b4=_0x1b72c3[_0x06ca('0x33')];var _0x46ca8b=_0x48fe59?0x0:_0x3eb08f[_0x06ca('0x30')];var _0x2614bf=_0x48fe59?_0x1b72c3[_0x06ca('0x33')]:_0x3eb08f[_0x06ca('0x30')]+_0x3eb08f['limit'];var _0x45db07;if(_0x2614bf>=_0xeb61b4){_0x2614bf=_0xeb61b4;_0x45db07=0xc8;}else{_0x45db07=0xce;}_0x1ce69a[_0x06ca('0x2e')](_0x45db07);return _0x1ce69a[_0x06ca('0x34')](_0x06ca('0x35'),_0x46ca8b+'-'+_0x2614bf+'/'+_0xeb61b4)[_0x06ca('0x36')](_0x1b72c3);}return null;};}function patchUpdates(_0x2a65e7){return function(_0x484b0c){try{jsonpatch[_0x06ca('0x37')](_0x484b0c,_0x2a65e7,!![]);}catch(_0x144cfe){return BPromise[_0x06ca('0x38')](_0x144cfe);}return _0x484b0c[_0x06ca('0x39')]();};}function saveUpdates(_0x38dcf3,_0xf02335){return function(_0xbf01ab){if(_0xbf01ab){return _0xbf01ab[_0x06ca('0x3a')](_0x38dcf3)[_0x06ca('0x23')](function(_0x4d7c44){return _0x4d7c44;});}return null;};}function removeEntity(_0x18fd09,_0xb1b6a){return function(_0x20f3bb){if(_0x20f3bb){return _0x20f3bb['destroy']()[_0x06ca('0x23')](function(){var _0x7e9174=_0x20f3bb[_0x06ca('0x3b')]({'plain':!![]});var _0x515fc1='ChatQueues';return db[_0x06ca('0x3c')][_0x06ca('0x3d')]({'where':{'type':_0x515fc1,'resourceId':_0x7e9174['id']}})['then'](function(){return _0x20f3bb;});})[_0x06ca('0x23')](function(){_0x18fd09['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x312d09,_0x11d8be){return function(_0x5bebbc){if(!_0x5bebbc){_0x312d09[_0x06ca('0x2d')](0x194);}return _0x5bebbc;};}function handleError(_0x4a1dad,_0x59dd6d){_0x59dd6d=_0x59dd6d||0x1f4;return function(_0x1d8cfd){logger[_0x06ca('0x28')](_0x1d8cfd['stack']);if(_0x1d8cfd[_0x06ca('0x3e')]){delete _0x1d8cfd[_0x06ca('0x3e')];}_0x4a1dad[_0x06ca('0x2e')](_0x59dd6d)[_0x06ca('0x3f')](_0x1d8cfd);};}exports[_0x06ca('0x40')]=function(_0x466e46,_0x145378){var _0x16c2c1={},_0x5da2f7={},_0x3864d2={'count':0x0,'rows':[]};var _0x2861d5=_['map'](db[_0x06ca('0x41')][_0x06ca('0x42')],function(_0x589dc9){return{'name':_0x589dc9['fieldName'],'type':_0x589dc9[_0x06ca('0x43')][_0x06ca('0x44')]};});_0x5da2f7['model']=_[_0x06ca('0x45')](_0x2861d5,_0x06ca('0x3e'));_0x5da2f7[_0x06ca('0x46')]=_[_0x06ca('0x47')](_0x466e46[_0x06ca('0x46')]);_0x5da2f7[_0x06ca('0x48')]=_['intersection'](_0x5da2f7['model'],_0x5da2f7[_0x06ca('0x46')]);_0x16c2c1[_0x06ca('0x49')]=_[_0x06ca('0x4a')](_0x5da2f7[_0x06ca('0x4b')],qs[_0x06ca('0x4c')](_0x466e46[_0x06ca('0x46')]['fields']));_0x16c2c1[_0x06ca('0x49')]=_0x16c2c1['attributes'][_0x06ca('0x4d')]?_0x16c2c1['attributes']:_0x5da2f7['model'];if(!_0x466e46[_0x06ca('0x46')][_0x06ca('0x4e')](_0x06ca('0x4f'))){_0x16c2c1['limit']=qs[_0x06ca('0x32')](_0x466e46[_0x06ca('0x46')][_0x06ca('0x32')]);_0x16c2c1[_0x06ca('0x30')]=qs[_0x06ca('0x30')](_0x466e46[_0x06ca('0x46')][_0x06ca('0x30')]);}_0x16c2c1[_0x06ca('0x50')]=qs[_0x06ca('0x51')](_0x466e46[_0x06ca('0x46')][_0x06ca('0x51')]);_0x16c2c1['where']=qs[_0x06ca('0x48')](_[_0x06ca('0x52')](_0x466e46[_0x06ca('0x46')],_0x5da2f7[_0x06ca('0x48')]),_0x2861d5);if(_0x466e46[_0x06ca('0x46')][_0x06ca('0x53')]){_0x16c2c1[_0x06ca('0x54')]=_['merge'](_0x16c2c1[_0x06ca('0x54')],{'$or':_[_0x06ca('0x45')](_0x2861d5,function(_0x5a9a93){if(_0x5a9a93[_0x06ca('0x43')]!==_0x06ca('0x55')){var _0x4e19a8={};_0x4e19a8[_0x5a9a93[_0x06ca('0x3e')]]={'$like':'%'+_0x466e46['query'][_0x06ca('0x53')]+'%'};return _0x4e19a8;}})});}_0x16c2c1=_['merge']({},_0x16c2c1,_0x466e46[_0x06ca('0x56')]);var _0x57f5c2={'where':_0x16c2c1['where']};return db[_0x06ca('0x41')][_0x06ca('0x33')](_0x57f5c2)[_0x06ca('0x23')](function(_0x4472a3){_0x3864d2[_0x06ca('0x33')]=_0x4472a3;if(_0x466e46[_0x06ca('0x46')]['includeAll']){_0x16c2c1[_0x06ca('0x57')]=[{'all':!![]}];}return db[_0x06ca('0x41')][_0x06ca('0x58')](_0x16c2c1);})['then'](function(_0x38cb95){_0x3864d2[_0x06ca('0x59')]=_0x38cb95;return _0x3864d2;})[_0x06ca('0x23')](respondWithFilteredResult(_0x145378,_0x16c2c1))[_0x06ca('0x2c')](handleError(_0x145378,null));};exports[_0x06ca('0x5a')]=function(_0x24a0cc,_0xedcb4c){var _0x115223={'raw':!![],'where':{'id':_0x24a0cc[_0x06ca('0x5b')]['id']}},_0x5b7dc1={};_0x5b7dc1[_0x06ca('0x4b')]=_[_0x06ca('0x47')](db['ChatQueue'][_0x06ca('0x42')]);_0x5b7dc1[_0x06ca('0x46')]=_[_0x06ca('0x47')](_0x24a0cc[_0x06ca('0x46')]);_0x5b7dc1[_0x06ca('0x48')]=_[_0x06ca('0x4a')](_0x5b7dc1['model'],_0x5b7dc1[_0x06ca('0x46')]);_0x115223[_0x06ca('0x49')]=_[_0x06ca('0x4a')](_0x5b7dc1[_0x06ca('0x4b')],qs[_0x06ca('0x4c')](_0x24a0cc['query']['fields']));_0x115223['attributes']=_0x115223['attributes'][_0x06ca('0x4d')]?_0x115223[_0x06ca('0x49')]:_0x5b7dc1[_0x06ca('0x4b')];if(_0x24a0cc[_0x06ca('0x46')]['includeAll']){_0x115223['include']=[{'all':!![]}];}_0x115223=_[_0x06ca('0x5c')]({},_0x115223,_0x24a0cc[_0x06ca('0x56')]);return db['ChatQueue']['find'](_0x115223)[_0x06ca('0x23')](handleEntityNotFound(_0xedcb4c,null))['then'](respondWithResult(_0xedcb4c,null))['catch'](handleError(_0xedcb4c,null));};exports[_0x06ca('0x5d')]=function(_0xf8fb94,_0x422d02){return db[_0x06ca('0x41')]['create'](_0xf8fb94['body'],{})[_0x06ca('0x23')](function(_0x1bf11e){var _0x37e683=_0xf8fb94[_0x06ca('0x5e')][_0x06ca('0x3b')]({'plain':!![]});if(!_0x37e683)throw new Error(_0x06ca('0x5f'));if(_0x37e683['role']==='user'){var _0x39e245=_0x1bf11e[_0x06ca('0x3b')]({'plain':!![]});var _0xb156df=_0x06ca('0x60');return db[_0x06ca('0x61')]['find']({'where':{'name':_0xb156df,'userProfileId':_0x37e683[_0x06ca('0x62')]},'raw':!![]})[_0x06ca('0x23')](function(_0x58670e){if(_0x58670e&&_0x58670e[_0x06ca('0x63')]===0x0){return db[_0x06ca('0x3c')][_0x06ca('0x5d')]({'name':_0x39e245[_0x06ca('0x3e')],'resourceId':_0x39e245['id'],'type':_0x58670e[_0x06ca('0x3e')],'sectionId':_0x58670e['id']},{})[_0x06ca('0x23')](function(){return _0x1bf11e;});}else{return _0x1bf11e;}})[_0x06ca('0x2c')](function(_0x5fe32a){logger[_0x06ca('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5fe32a);throw _0x5fe32a;});}return _0x1bf11e;})['then'](respondWithResult(_0x422d02,0xc9))['catch'](handleError(_0x422d02,null));};exports['update']=function(_0x383ab4,_0x4be602){if(_0x383ab4['body']['id']){delete _0x383ab4[_0x06ca('0x64')]['id'];}return db[_0x06ca('0x41')][_0x06ca('0x65')]({'where':{'id':_0x383ab4[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x4be602,null))['then'](saveUpdates(_0x383ab4[_0x06ca('0x64')],null))[_0x06ca('0x23')](respondWithResult(_0x4be602,null))['catch'](handleError(_0x4be602,null));};exports[_0x06ca('0x3d')]=function(_0x1a838b,_0x1f2a9e){return db[_0x06ca('0x41')][_0x06ca('0x65')]({'where':{'id':_0x1a838b[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x1f2a9e,null))['then'](removeEntity(_0x1f2a9e,null))[_0x06ca('0x2c')](handleError(_0x1f2a9e,null));};exports[_0x06ca('0x66')]=function(_0x38861d,_0x4270ba){return db[_0x06ca('0x41')][_0x06ca('0x66')]()[_0x06ca('0x23')](respondWithResult(_0x4270ba,null))[_0x06ca('0x2c')](handleError(_0x4270ba,null));};exports[_0x06ca('0x67')]=function(_0x4edb7e,_0x3a35e4,_0x446af6){var _0x1658b9={'raw':!![],'where':{}},_0x2ce4d4={},_0x3ee6f6;return db[_0x06ca('0x41')][_0x06ca('0x68')]({'where':{'id':_0x4edb7e[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x3a35e4,null))[_0x06ca('0x23')](function(_0x306e41){if(_0x306e41){_0x3ee6f6=_0x306e41[_0x06ca('0x3b')]({'plain':!![]});_0x2ce4d4[_0x06ca('0x4b')]=_[_0x06ca('0x47')](db[_0x06ca('0x69')][_0x06ca('0x42')]);_0x2ce4d4[_0x06ca('0x46')]=_[_0x06ca('0x47')](_0x4edb7e[_0x06ca('0x46')]);_0x2ce4d4[_0x06ca('0x48')]=_[_0x06ca('0x4a')](_0x2ce4d4[_0x06ca('0x4b')],_0x2ce4d4[_0x06ca('0x46')]);_0x1658b9[_0x06ca('0x49')]=_[_0x06ca('0x4a')](_0x2ce4d4[_0x06ca('0x4b')],qs['fields'](_0x4edb7e[_0x06ca('0x46')][_0x06ca('0x4c')]));_0x1658b9[_0x06ca('0x49')]=_0x1658b9[_0x06ca('0x49')][_0x06ca('0x4d')]?_0x1658b9[_0x06ca('0x49')]:_0x2ce4d4[_0x06ca('0x4b')];if(!_0x4edb7e['query'][_0x06ca('0x4e')](_0x06ca('0x4f'))){_0x1658b9[_0x06ca('0x32')]=qs[_0x06ca('0x32')](_0x4edb7e[_0x06ca('0x46')]['limit']);_0x1658b9[_0x06ca('0x30')]=qs[_0x06ca('0x30')](_0x4edb7e[_0x06ca('0x46')]['offset']);}_0x1658b9[_0x06ca('0x50')]=qs['sort'](_0x4edb7e[_0x06ca('0x46')][_0x06ca('0x51')]);_0x1658b9[_0x06ca('0x54')]=qs[_0x06ca('0x48')](_[_0x06ca('0x52')](_0x4edb7e['query'],_0x2ce4d4[_0x06ca('0x48')]));_0x1658b9[_0x06ca('0x54')][_0x06ca('0x6a')]=_0x306e41['id'];if(_0x4edb7e[_0x06ca('0x46')][_0x06ca('0x53')]){_0x1658b9[_0x06ca('0x54')]=_['merge'](_0x1658b9[_0x06ca('0x54')],{'$or':_['map'](_0x1658b9[_0x06ca('0x49')],function(_0x284556){var _0x224dee={};_0x224dee[_0x284556]={'$like':'%'+_0x4edb7e[_0x06ca('0x46')]['filter']+'%'};return _0x224dee;})});}_0x1658b9=_[_0x06ca('0x5c')]({},_0x1658b9,_0x4edb7e[_0x06ca('0x56')]);return db['UserChatQueue'][_0x06ca('0x58')](_0x1658b9);}})[_0x06ca('0x23')](function(_0x475637){if(_0x475637){return db[_0x06ca('0x6b')]['findAndCountAll']({'where':{'id':_[_0x06ca('0x45')](_0x475637,_0x06ca('0x6c')),'role':_0x06ca('0x6d')},'attributes':['id',_0x06ca('0x3e'),_0x06ca('0x6e'),_0x06ca('0x6f'),'createdAt']});}})[_0x06ca('0x23')](function(_0x82d7ef){if(_0x82d7ef){return{'count':_0x82d7ef[_0x06ca('0x33')],'rows':_[_0x06ca('0x45')](_0x82d7ef[_0x06ca('0x59')],function(_0x48c5dd){return{'membername':_0x48c5dd[_0x06ca('0x3e')],'UserId':_0x48c5dd['id'],'queue_name':_0x3ee6f6[_0x06ca('0x3e')],'ChatQueueId':_0x3ee6f6['id'],'interface':util['format'](_0x06ca('0x70'),_0x06ca('0x71'),_0x48c5dd[_0x06ca('0x3e')]),'penalty':0x0,'paused':_0x48c5dd[_0x06ca('0x6e')],'createdAt':_0x48c5dd['createdAt'],'updatedAt':_0x48c5dd[_0x06ca('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x06ca('0x23')](respondWithFilteredResult(_0x3a35e4,_0x1658b9))[_0x06ca('0x2c')](handleError(_0x3a35e4,null));};exports[_0x06ca('0x72')]=function(_0x1b3276,_0x3cfcf3,_0xc10df3){var _0x50d989={};var _0x27e0d9={};var _0xa7ec99;var _0x59e3cf;return db[_0x06ca('0x41')][_0x06ca('0x68')]({'where':{'id':_0x1b3276[_0x06ca('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3cfcf3,null))[_0x06ca('0x23')](function(_0x3746e2){if(_0x3746e2){_0xa7ec99=_0x3746e2;_0x27e0d9[_0x06ca('0x4b')]=_[_0x06ca('0x47')](db['Team'][_0x06ca('0x42')]);_0x27e0d9['query']=_['keys'](_0x1b3276[_0x06ca('0x46')]);_0x27e0d9[_0x06ca('0x48')]=_[_0x06ca('0x4a')](_0x27e0d9[_0x06ca('0x4b')],_0x27e0d9[_0x06ca('0x46')]);_0x50d989[_0x06ca('0x49')]=_[_0x06ca('0x4a')](_0x27e0d9[_0x06ca('0x4b')],qs[_0x06ca('0x4c')](_0x1b3276[_0x06ca('0x46')][_0x06ca('0x4c')]));_0x50d989['attributes']=_0x50d989[_0x06ca('0x49')][_0x06ca('0x4d')]?_0x50d989[_0x06ca('0x49')]:_0x27e0d9[_0x06ca('0x4b')];_0x50d989[_0x06ca('0x50')]=qs['sort'](_0x1b3276[_0x06ca('0x46')][_0x06ca('0x51')]);_0x50d989[_0x06ca('0x54')]=qs['filters'](_[_0x06ca('0x52')](_0x1b3276[_0x06ca('0x46')],_0x27e0d9[_0x06ca('0x48')]));if(_0x1b3276[_0x06ca('0x46')][_0x06ca('0x53')]){_0x50d989[_0x06ca('0x54')]=_['merge'](_0x50d989[_0x06ca('0x54')],{'$or':_[_0x06ca('0x45')](_0x50d989['attributes'],function(_0x126f3c){var _0x3a8b38={};_0x3a8b38[_0x126f3c]={'$like':'%'+_0x1b3276['query'][_0x06ca('0x53')]+'%'};return _0x3a8b38;})});}_0x50d989=_[_0x06ca('0x5c')]({},_0x50d989,_0x1b3276[_0x06ca('0x56')]);return _0xa7ec99['getTeams'](_0x50d989);}})[_0x06ca('0x23')](function(_0x23f647){if(_0x23f647){_0x59e3cf=_0x23f647['length'];if(!_0x1b3276[_0x06ca('0x46')][_0x06ca('0x4e')](_0x06ca('0x4f'))){_0x50d989[_0x06ca('0x32')]=qs[_0x06ca('0x32')](_0x1b3276[_0x06ca('0x46')]['limit']);_0x50d989['offset']=qs[_0x06ca('0x30')](_0x1b3276[_0x06ca('0x46')][_0x06ca('0x30')]);}return _0xa7ec99[_0x06ca('0x72')](_0x50d989);}})['then'](function(_0x223556){if(_0x223556){return _0x223556?{'count':_0x59e3cf,'rows':_0x223556}:null;}})[_0x06ca('0x23')](respondWithResult(_0x3cfcf3,null))[_0x06ca('0x2c')](handleError(_0x3cfcf3,null));};exports['addTeams']=function(_0x198e78,_0x119e10,_0x5294b2){var _0x4cb36d=_0x198e78[_0x06ca('0x64')][_0x06ca('0x73')];return db[_0x06ca('0x74')][_0x06ca('0x58')]({'where':{'id':_0x4cb36d},'attributes':['id'],'include':[{'model':db[_0x06ca('0x6b')],'as':_0x06ca('0x75'),'attributes':['id',_0x06ca('0x3e'),_0x06ca('0x76'),_0x06ca('0x77'),_0x06ca('0x78')],'raw':!![]}]})[_0x06ca('0x23')](function(_0x33b45a){if(_0x33b45a){var _0x2398b4=_[_0x06ca('0x79')](_0x33b45a,function(_0x227c6f){var _0x6872d6=_0x227c6f['get']({'plain':!![]});return _0x6872d6[_0x06ca('0x75')];});return db[_0x06ca('0x41')][_0x06ca('0x65')]({'where':{'id':_0x198e78[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](function(_0xdd52bd){return db[_0x06ca('0x7a')][_0x06ca('0x7b')](function(_0x4fb3a8){return _0xdd52bd[_0x06ca('0x7c')](_0x4cb36d,{'transaction':_0x4fb3a8})[_0x06ca('0x23')](function(){return BPromise[_0x06ca('0x7d')](_0x2398b4,function(_0x4273c8){return db[_0x06ca('0x69')][_0x06ca('0x7e')]({'where':{'UserId':_0x4273c8['id'],'ChatQueueId':_0x198e78[_0x06ca('0x5b')]['id']},'transaction':_0x4fb3a8});});})[_0x06ca('0x23')](function(){_0x2398b4[_0x06ca('0x7f')](function(_0x519b18){socket[_0x06ca('0x80')]('userChatQueue:save',{'UserId':_0x519b18['id'],'ChatQueueId':_0xdd52bd['id']});});});});});}})['then'](respondWithStatusCode(_0x119e10,null))[_0x06ca('0x2c')](handleError(_0x119e10,null));};exports['removeTeams']=function(_0x184bfb,_0x1d5927,_0x22fbf4){return db[_0x06ca('0x74')][_0x06ca('0x58')]({'where':{'id':_0x184bfb['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x06ca('0x6b')],'as':_0x06ca('0x75'),'attributes':['id'],'raw':!![]}]})[_0x06ca('0x23')](handleEntityNotFound(_0x1d5927,null))[_0x06ca('0x23')](function(_0x335271){var _0x115f14=_['map'](_0x335271,'id');var _0x5861e8=[];var _0x317396=[];var _0x2774cb=squel[_0x06ca('0x81')]();_0x2774cb[_0x06ca('0x82')]('tq.TeamId')[_0x06ca('0x83')](_0x06ca('0x84'),'tq')[_0x06ca('0x85')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x06ca('0x54')]('ChatQueueId\x20=\x20?',_0x184bfb[_0x06ca('0x5b')]['id']);for(var _0x13b68b=0x0;_0x13b68b<_0x335271[_0x06ca('0x4d')];_0x13b68b+=0x1){let _0x32d488=_0x335271[_0x13b68b];for(var _0x52f77d=0x0;_0x52f77d<_0x32d488[_0x06ca('0x75')][_0x06ca('0x4d')];_0x52f77d+=0x1){let _0x20883d=_0x32d488[_0x06ca('0x75')][_0x52f77d];var _0x1631e3=_0x2774cb[_0x06ca('0x86')]();_0x1631e3[_0x06ca('0x54')](_0x06ca('0x87'),_0x20883d['id']);_0x317396[_0x06ca('0x88')](db[_0x06ca('0x7a')][_0x06ca('0x46')](_0x1631e3[_0x06ca('0x89')](),{'type':db[_0x06ca('0x7a')][_0x06ca('0x8a')]['SELECT']})[_0x06ca('0x23')](function(_0x8239e){if(_0x8239e[_0x06ca('0x4d')]===0x1){return _0x20883d['id'];}else{var _0x5336d4=_['every'](_[_0x06ca('0x45')](_0x8239e,_0x06ca('0x8b')),function(_0x51d4e3){return _[_0x06ca('0x8c')](_0x115f14,_0x51d4e3);});if(_0x5336d4){return _0x20883d['id'];}}}));}}return BPromise[_0x06ca('0x8d')](_0x317396)[_0x06ca('0x23')](function(_0x4c68d4){_0x5861e8=_(_0x5861e8)[_0x06ca('0x8e')](_0x4c68d4)[_0x06ca('0x8f')]()[_0x06ca('0x90')]();return db[_0x06ca('0x41')]['find']({'where':{'id':_0x184bfb['params']['id']}})['then'](function(_0x44cbc8){return db[_0x06ca('0x7a')][_0x06ca('0x7b')](function(_0x35d2ef){return _0x44cbc8[_0x06ca('0x91')](_0x184bfb['query'][_0x06ca('0x73')],{'transaction':_0x35d2ef})[_0x06ca('0x23')](function(){if(!_[_0x06ca('0x92')](_0x5861e8)){return _0x44cbc8[_0x06ca('0x93')](_0x5861e8,{'transaction':_0x35d2ef});}})[_0x06ca('0x23')](function(){_0x5861e8[_0x06ca('0x7f')](function(_0x2361c1){socket[_0x06ca('0x80')](_0x06ca('0x94'),{'UserId':_0x2361c1,'ChatQueueId':_0x44cbc8['id']});});});});});});})[_0x06ca('0x23')](respondWithStatusCode(_0x1d5927,null))[_0x06ca('0x2c')](handleError(_0x1d5927,null));};exports[_0x06ca('0x95')]=function(_0x4989a1,_0x5ed8b0,_0x5234e3){return db[_0x06ca('0x41')][_0x06ca('0x65')]({'where':{'id':_0x4989a1['params']['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x5ed8b0,null))[_0x06ca('0x23')](function(_0x460546){if(_0x460546){return _0x460546['addAgents'](_0x4989a1['body'][_0x06ca('0x73')],_['omit'](_0x4989a1[_0x06ca('0x64')],[_0x06ca('0x73'),'id'])||{})[_0x06ca('0x96')](function(_0x1ce30b){for(var _0x306216=0x0;_0x306216<_0x4989a1[_0x06ca('0x64')]['ids'][_0x06ca('0x4d')];_0x306216+=0x1){socket[_0x06ca('0x80')](_0x06ca('0x97'),{'UserId':Number(_0x4989a1[_0x06ca('0x64')][_0x06ca('0x73')][_0x306216]),'ChatQueueId':Number(_0x4989a1[_0x06ca('0x5b')]['id'])});}return _0x1ce30b;});}})['then'](respondWithResult(_0x5ed8b0,null))[_0x06ca('0x2c')](handleError(_0x5ed8b0,null));};exports[_0x06ca('0x93')]=function(_0x4fa2db,_0x24063a,_0xf6b1a8){return db[_0x06ca('0x41')][_0x06ca('0x65')]({'where':{'id':_0x4fa2db[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x24063a,null))[_0x06ca('0x23')](function(_0x46c819){if(_0x46c819){return _0x46c819['removeAgents'](_0x4fa2db['query'][_0x06ca('0x73')])[_0x06ca('0x23')](function(){if(_[_0x06ca('0x98')](_0x4fa2db[_0x06ca('0x46')][_0x06ca('0x73')])){for(var _0x52c6d9=0x0;_0x52c6d9<_0x4fa2db[_0x06ca('0x46')]['ids']['length'];_0x52c6d9+=0x1){socket['emit'](_0x06ca('0x94'),{'UserId':Number(_0x4fa2db['query'][_0x06ca('0x73')][_0x52c6d9]),'ChatQueueId':Number(_0x4fa2db['params']['id'])});}}else{socket[_0x06ca('0x80')](_0x06ca('0x94'),{'UserId':Number(_0x4fa2db[_0x06ca('0x46')][_0x06ca('0x73')]),'ChatQueueId':Number(_0x4fa2db[_0x06ca('0x5b')]['id'])});}});}})[_0x06ca('0x23')](respondWithStatusCode(_0x24063a,null))[_0x06ca('0x2c')](handleError(_0x24063a,null));};exports[_0x06ca('0x99')]=function(_0x30bedf,_0x5a2041,_0x584d2a){var _0x105f35={};var _0x4066b5={};var _0x17652b;var _0x50fa7d;return db[_0x06ca('0x41')][_0x06ca('0x68')]({'where':{'id':_0x30bedf[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x5a2041,null))[_0x06ca('0x23')](function(_0x4bc827){if(_0x4bc827){_0x17652b=_0x4bc827;_0x4066b5[_0x06ca('0x4b')]=_[_0x06ca('0x47')](db['User']['rawAttributes']);_0x4066b5['query']=_['keys'](_0x30bedf[_0x06ca('0x46')]);_0x4066b5['filters']=_['intersection'](_0x4066b5[_0x06ca('0x4b')],_0x4066b5['query']);_0x105f35[_0x06ca('0x49')]=_[_0x06ca('0x4a')](_0x4066b5[_0x06ca('0x4b')],qs[_0x06ca('0x4c')](_0x30bedf[_0x06ca('0x46')]['fields']));_0x105f35['attributes']=_0x105f35[_0x06ca('0x49')][_0x06ca('0x4d')]?_0x105f35[_0x06ca('0x49')]:_0x4066b5[_0x06ca('0x4b')];_0x105f35[_0x06ca('0x50')]=qs[_0x06ca('0x51')](_0x30bedf[_0x06ca('0x46')][_0x06ca('0x51')]);_0x105f35['where']=qs[_0x06ca('0x48')](_[_0x06ca('0x52')](_0x30bedf[_0x06ca('0x46')],_0x4066b5[_0x06ca('0x48')]));if(_0x30bedf[_0x06ca('0x46')][_0x06ca('0x53')]){_0x105f35['where']=_[_0x06ca('0x5c')](_0x105f35[_0x06ca('0x54')],{'$or':_['map'](_0x105f35[_0x06ca('0x49')],function(_0x19f122){var _0x1fc9e4={};_0x1fc9e4[_0x19f122]={'$like':'%'+_0x30bedf[_0x06ca('0x46')][_0x06ca('0x53')]+'%'};return _0x1fc9e4;})});}_0x105f35=_[_0x06ca('0x5c')]({},_0x105f35,_0x30bedf[_0x06ca('0x56')]);return _0x17652b[_0x06ca('0x99')](_0x105f35);}})[_0x06ca('0x23')](function(_0x3cc991){if(_0x3cc991){_0x50fa7d=_0x3cc991['length'];if(!_0x30bedf[_0x06ca('0x46')][_0x06ca('0x4e')](_0x06ca('0x4f'))){_0x105f35[_0x06ca('0x32')]=qs['limit'](_0x30bedf[_0x06ca('0x46')][_0x06ca('0x32')]);_0x105f35['offset']=qs[_0x06ca('0x30')](_0x30bedf[_0x06ca('0x46')][_0x06ca('0x30')]);}return _0x17652b[_0x06ca('0x99')](_0x105f35);}})['then'](function(_0x706efb){if(_0x706efb){return _0x706efb?{'count':_0x50fa7d,'rows':_0x706efb}:null;}})[_0x06ca('0x23')](respondWithResult(_0x5a2041,null))[_0x06ca('0x2c')](handleError(_0x5a2041,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index f2626c6..06d36fc 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 _0x15e1=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x579ae3,_0x303b07){var _0x19aef2=function(_0x9fdfcb){while(--_0x9fdfcb){_0x579ae3['push'](_0x579ae3['shift']());}};_0x19aef2(++_0x303b07);}(_0x15e1,0x1c1));var _0x115e=function(_0x3cd944,_0x2f134b){_0x3cd944=_0x3cd944-0x0;var _0xad852c=_0x15e1[_0x3cd944];return _0xad852c;};'use strict';var EventEmitter=require(_0x115e('0x0'));var ChatQueue=require(_0x115e('0x1'))['db'][_0x115e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x115e('0x3')](0x0);var events={'afterCreate':_0x115e('0x4'),'afterUpdate':'update','afterDestroy':_0x115e('0x5')};function emitEvent(_0x189f43){return function(_0x1e25d5,_0x362a21,_0x29b35a){ChatQueueEvents[_0x115e('0x6')](_0x189f43+':'+_0x1e25d5['id'],_0x1e25d5);ChatQueueEvents[_0x115e('0x6')](_0x189f43,_0x1e25d5);_0x29b35a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x115e('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x9ac8=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2cff3c,_0x33f5c5){var _0x43141c=function(_0x50236f){while(--_0x50236f){_0x2cff3c['push'](_0x2cff3c['shift']());}};_0x43141c(++_0x33f5c5);}(_0x9ac8,0x184));var _0x89ac=function(_0x344e7b,_0xfff3ce){_0x344e7b=_0x344e7b-0x0;var _0x271f43=_0x9ac8[_0x344e7b];return _0x271f43;};'use strict';var EventEmitter=require(_0x89ac('0x0'));var ChatQueue=require(_0x89ac('0x1'))['db'][_0x89ac('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x89ac('0x3'),'afterUpdate':_0x89ac('0x4'),'afterDestroy':_0x89ac('0x5')};function emitEvent(_0x32a208){return function(_0x3eb597,_0x3d0aa8,_0x494d3f){ChatQueueEvents[_0x89ac('0x6')](_0x32a208+':'+_0x3eb597['id'],_0x3eb597);ChatQueueEvents[_0x89ac('0x6')](_0x32a208,_0x3eb597);_0x494d3f(null);};}for(var e in events){if(events[_0x89ac('0x7')](e)){var event=events[e];ChatQueue[_0x89ac('0x8')](e,emitEvent(event));}}module[_0x89ac('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 5bc01f8..dcf0f5d 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 _0xf37b=['bluebird','path','../../config/environment','define','ChatQueue','lodash','../../config/logger','api'];(function(_0x3a7767,_0x3ada12){var _0x3e2724=function(_0x36e8c5){while(--_0x36e8c5){_0x3a7767['push'](_0x3a7767['shift']());}};_0x3e2724(++_0x3ada12);}(_0xf37b,0x1ad));var _0xbf37=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xf37b[_0x47e549];return _0x251374;};'use strict';var _=require(_0xbf37('0x0'));var util=require('util');var logger=require(_0xbf37('0x1'))(_0xbf37('0x2'));var moment=require('moment');var BPromise=require(_0xbf37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf37('0x4'));var rimraf=require('rimraf');var config=require(_0xbf37('0x5'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x713a32,_0xf6195a){return _0x713a32[_0xbf37('0x6')](_0xbf37('0x7'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x609a=['rimraf','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3494ee,_0x7b1b9a){var _0x12b115=function(_0x25e4c6){while(--_0x25e4c6){_0x3494ee['push'](_0x3494ee['shift']());}};_0x12b115(++_0x7b1b9a);}(_0x609a,0xf5));var _0xa609=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x609a[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xa609('0x0'));var logger=require(_0xa609('0x1'))(_0xa609('0x2'));var moment=require(_0xa609('0x3'));var BPromise=require(_0xa609('0x4'));var rp=require(_0xa609('0x5'));var fs=require('fs');var path=require(_0xa609('0x6'));var rimraf=require(_0xa609('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xa609('0x8')]=function(_0x9413d3,_0x27ae8a){return _0x9413d3[_0xa609('0x9')](_0xa609('0xa'),attributes,{'tableName':_0xa609('0xb'),'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 df3b7af..e8d03a4 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 _0x8cce=['jayson/promise','client','redis','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','debug','stringify','catch','ShowChatQueue','find','raw','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4191af,_0x5783da){var _0x27bebf=function(_0x355be7){while(--_0x355be7){_0x4191af['push'](_0x4191af['shift']());}};_0x27bebf(++_0x5783da);}(_0x8cce,0xd6));var _0xe8cc=function(_0x413af4,_0x34f2f1){_0x413af4=_0x413af4-0x0;var _0x20f98b=_0x8cce[_0x413af4];return _0x20f98b;};'use strict';var _=require('lodash');var util=require(_0xe8cc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8cc('0x1'));var fs=require('fs');var Redis=require(_0xe8cc('0x2'));var db=require(_0xe8cc('0x3'))['db'];var utils=require(_0xe8cc('0x4'));var logger=require(_0xe8cc('0x5'))(_0xe8cc('0x6'));var config=require(_0xe8cc('0x7'));var jayson=require(_0xe8cc('0x8'));var client=jayson[_0xe8cc('0x9')]['http']({'port':0x232a});config[_0xe8cc('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe8cc('0xb'))(new Redis(config[_0xe8cc('0xa')]));require('./chatQueue.socket')[_0xe8cc('0xc')](socket);function respondWithRpcPromise(_0x4c211b,_0x22ca98,_0x401515){return new BPromise(function(_0xcbf3ec,_0x826385){return client[_0xe8cc('0xd')](_0x4c211b,_0x401515)[_0xe8cc('0xe')](function(_0x4d499c){logger[_0xe8cc('0xf')](_0xe8cc('0x10'),_0x22ca98,'request\x20sent');logger['debug'](_0xe8cc('0x11'),_0x22ca98,'request\x20sent',JSON['stringify'](_0x4d499c));if(_0x4d499c[_0xe8cc('0x12')]){if(_0x4d499c['error'][_0xe8cc('0x13')]===0x1f4){logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x4d499c['error'][_0xe8cc('0x14')]);return _0x826385(_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);}logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);return _0xcbf3ec(_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);}else{logger[_0xe8cc('0xf')]('ChatQueue,\x20%s,\x20%s',_0x22ca98,'request\x20sent');_0xcbf3ec(_0x4d499c[_0xe8cc('0x15')][_0xe8cc('0x14')]);}})['catch'](function(_0x53014b){logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x53014b);_0x826385(_0x53014b);});});}exports[_0xe8cc('0x16')]=function(_0x403f91){var _0xbafd99=this;return new Promise(function(_0x21e933,_0x445f4f){return db[_0xe8cc('0x17')]['findAll']({'raw':_0x403f91['options']?_0x403f91[_0xe8cc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x403f91['options']?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x19')]||null:null,'attributes':_0x403f91[_0xe8cc('0x18')]?_0x403f91['options'][_0xe8cc('0x1a')]||null:null,'limit':_0x403f91[_0xe8cc('0x18')]?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x1b')]||null:null,'include':_0x403f91[_0xe8cc('0x18')]?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x403f91['options'][_0xe8cc('0x1c')],function(_0x34d6e0){return{'model':db[_0x34d6e0[_0xe8cc('0x1e')]],'as':_0x34d6e0['as'],'attributes':_0x34d6e0[_0xe8cc('0x1a')],'include':_0x34d6e0[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x34d6e0[_0xe8cc('0x1c')],function(_0x2c5fb2){return{'model':db[_0x2c5fb2[_0xe8cc('0x1e')]],'as':_0x2c5fb2['as'],'attributes':_0x2c5fb2[_0xe8cc('0x1a')],'include':_0x2c5fb2[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x2c5fb2[_0xe8cc('0x1c')],function(_0x35029c){return{'model':db[_0x35029c['model']],'as':_0x35029c['as'],'attributes':_0x35029c[_0xe8cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe8cc('0xe')](function(_0x4bed04){logger[_0xe8cc('0xf')](_0xe8cc('0x16'),_0x403f91);logger[_0xe8cc('0x1f')](_0xe8cc('0x16'),_0x403f91,JSON[_0xe8cc('0x20')](_0x4bed04));_0x21e933(_0x4bed04);})[_0xe8cc('0x21')](function(_0xdc9b1b){logger[_0xe8cc('0x12')](_0xe8cc('0x16'),_0xdc9b1b['message'],_0x403f91);_0x445f4f(_0xbafd99[_0xe8cc('0x12')](0x1f4,_0xdc9b1b[_0xe8cc('0x14')]));});});};exports[_0xe8cc('0x22')]=function(_0x5f6a3c){var _0x1518ce=this;return new Promise(function(_0x5048a7,_0x17405d){return db[_0xe8cc('0x17')][_0xe8cc('0x23')]({'raw':_0x5f6a3c[_0xe8cc('0x18')]?_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x24')]===undefined?!![]:![]:!![],'where':_0x5f6a3c['options']?_0x5f6a3c['options']['where']||null:null,'attributes':_0x5f6a3c['options']?_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x1a')]||null:null,'include':_0x5f6a3c[_0xe8cc('0x18')]?_0x5f6a3c['options'][_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x1c')],function(_0x550d9a){return{'model':db[_0x550d9a[_0xe8cc('0x1e')]],'as':_0x550d9a['as'],'attributes':_0x550d9a['attributes'],'include':_0x550d9a[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x550d9a['include'],function(_0x1dcf5b){return{'model':db[_0x1dcf5b[_0xe8cc('0x1e')]],'as':_0x1dcf5b['as'],'attributes':_0x1dcf5b[_0xe8cc('0x1a')],'include':_0x1dcf5b['include']?_[_0xe8cc('0x1d')](_0x1dcf5b[_0xe8cc('0x1c')],function(_0x531555){return{'model':db[_0x531555[_0xe8cc('0x1e')]],'as':_0x531555['as'],'attributes':_0x531555[_0xe8cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe8cc('0xe')](function(_0x286685){logger[_0xe8cc('0xf')](_0xe8cc('0x22'),_0x5f6a3c);logger[_0xe8cc('0x1f')](_0xe8cc('0x22'),_0x5f6a3c,JSON[_0xe8cc('0x20')](_0x286685));_0x5048a7(_0x286685);})[_0xe8cc('0x21')](function(_0x2e6e13){logger[_0xe8cc('0x12')](_0xe8cc('0x22'),_0x2e6e13[_0xe8cc('0x14')],_0x5f6a3c);_0x17405d(_0x1518ce[_0xe8cc('0x12')](0x1f4,_0x2e6e13['message']));});});}; \ No newline at end of file +var _0x7732=['stringify','ShowChatQueue','find','then','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','include','model','attributes'];(function(_0x26c321,_0x228a43){var _0x516864=function(_0xcb87d2){while(--_0xcb87d2){_0x26c321['push'](_0x26c321['shift']());}};_0x516864(++_0x228a43);}(_0x7732,0x7d));var _0x2773=function(_0x2abaae,_0x29fd8b){_0x2abaae=_0x2abaae-0x0;var _0x5b5745=_0x7732[_0x2abaae];return _0x5b5745;};'use strict';var _=require(_0x2773('0x0'));var util=require(_0x2773('0x1'));var moment=require('moment');var BPromise=require(_0x2773('0x2'));var rs=require(_0x2773('0x3'));var fs=require('fs');var Redis=require(_0x2773('0x4'));var db=require(_0x2773('0x5'))['db'];var utils=require(_0x2773('0x6'));var logger=require(_0x2773('0x7'))(_0x2773('0x8'));var config=require(_0x2773('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2773('0xa')][_0x2773('0xb')]({'port':0x232a});config['redis']=_[_0x2773('0xc')](config[_0x2773('0xd')],{'host':_0x2773('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2773('0xd')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5e0464,_0x3485bf,_0x17d8cd){return new BPromise(function(_0x44ffaf,_0x2b572e){return client['request'](_0x5e0464,_0x17d8cd)['then'](function(_0x136f00){logger[_0x2773('0xf')](_0x2773('0x10'),_0x3485bf,_0x2773('0x11'));logger['debug'](_0x2773('0x12'),_0x3485bf,'request\x20sent',JSON['stringify'](_0x136f00));if(_0x136f00[_0x2773('0x13')]){if(_0x136f00[_0x2773('0x13')][_0x2773('0x14')]===0x1f4){logger[_0x2773('0x13')](_0x2773('0x10'),_0x3485bf,_0x136f00[_0x2773('0x13')][_0x2773('0x15')]);return _0x2b572e(_0x136f00[_0x2773('0x13')][_0x2773('0x15')]);}logger[_0x2773('0x13')](_0x2773('0x10'),_0x3485bf,_0x136f00[_0x2773('0x13')][_0x2773('0x15')]);return _0x44ffaf(_0x136f00['error']['message']);}else{logger[_0x2773('0xf')](_0x2773('0x10'),_0x3485bf,'request\x20sent');_0x44ffaf(_0x136f00[_0x2773('0x16')][_0x2773('0x15')]);}})[_0x2773('0x17')](function(_0x267aeb){logger[_0x2773('0x13')](_0x2773('0x10'),_0x3485bf,_0x267aeb);_0x2b572e(_0x267aeb);});});}exports[_0x2773('0x18')]=function(_0x49cd9b){var _0x434d2f=this;return new Promise(function(_0x28f6fd,_0x3a4130){return db[_0x2773('0x19')][_0x2773('0x1a')]({'raw':_0x49cd9b['options']?_0x49cd9b[_0x2773('0x1b')][_0x2773('0x1c')]===undefined?!![]:![]:!![],'where':_0x49cd9b[_0x2773('0x1b')]?_0x49cd9b['options'][_0x2773('0x1d')]||null:null,'attributes':_0x49cd9b[_0x2773('0x1b')]?_0x49cd9b[_0x2773('0x1b')]['attributes']||null:null,'limit':_0x49cd9b[_0x2773('0x1b')]?_0x49cd9b['options'][_0x2773('0x1e')]||null:null,'include':_0x49cd9b[_0x2773('0x1b')]?_0x49cd9b[_0x2773('0x1b')]['include']?_[_0x2773('0x1f')](_0x49cd9b['options'][_0x2773('0x20')],function(_0x3000c1){return{'model':db[_0x3000c1[_0x2773('0x21')]],'as':_0x3000c1['as'],'attributes':_0x3000c1['attributes'],'include':_0x3000c1[_0x2773('0x20')]?_['map'](_0x3000c1[_0x2773('0x20')],function(_0x478da4){return{'model':db[_0x478da4[_0x2773('0x21')]],'as':_0x478da4['as'],'attributes':_0x478da4[_0x2773('0x22')],'include':_0x478da4[_0x2773('0x20')]?_[_0x2773('0x1f')](_0x478da4[_0x2773('0x20')],function(_0xe02608){return{'model':db[_0xe02608['model']],'as':_0xe02608['as'],'attributes':_0xe02608['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b99f5){logger[_0x2773('0xf')](_0x2773('0x18'),_0x49cd9b);logger['debug'](_0x2773('0x18'),_0x49cd9b,JSON[_0x2773('0x23')](_0x4b99f5));_0x28f6fd(_0x4b99f5);})[_0x2773('0x17')](function(_0x5d6855){logger[_0x2773('0x13')]('GetChatQueue',_0x5d6855[_0x2773('0x15')],_0x49cd9b);_0x3a4130(_0x434d2f[_0x2773('0x13')](0x1f4,_0x5d6855['message']));});});};exports[_0x2773('0x24')]=function(_0x27e36d){var _0x1d75c4=this;return new Promise(function(_0x26a035,_0xe2a092){return db[_0x2773('0x19')][_0x2773('0x25')]({'raw':_0x27e36d['options']?_0x27e36d['options'][_0x2773('0x1c')]===undefined?!![]:![]:!![],'where':_0x27e36d[_0x2773('0x1b')]?_0x27e36d[_0x2773('0x1b')]['where']||null:null,'attributes':_0x27e36d[_0x2773('0x1b')]?_0x27e36d[_0x2773('0x1b')][_0x2773('0x22')]||null:null,'include':_0x27e36d[_0x2773('0x1b')]?_0x27e36d[_0x2773('0x1b')][_0x2773('0x20')]?_[_0x2773('0x1f')](_0x27e36d['options'][_0x2773('0x20')],function(_0x162722){return{'model':db[_0x162722['model']],'as':_0x162722['as'],'attributes':_0x162722[_0x2773('0x22')],'include':_0x162722['include']?_[_0x2773('0x1f')](_0x162722[_0x2773('0x20')],function(_0x2b375a){return{'model':db[_0x2b375a[_0x2773('0x21')]],'as':_0x2b375a['as'],'attributes':_0x2b375a['attributes'],'include':_0x2b375a[_0x2773('0x20')]?_[_0x2773('0x1f')](_0x2b375a[_0x2773('0x20')],function(_0x1cfe56){return{'model':db[_0x1cfe56[_0x2773('0x21')]],'as':_0x1cfe56['as'],'attributes':_0x1cfe56[_0x2773('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2773('0x26')](function(_0x105e8){logger[_0x2773('0xf')](_0x2773('0x24'),_0x27e36d);logger[_0x2773('0x27')]('ShowChatQueue',_0x27e36d,JSON['stringify'](_0x105e8));_0x26a035(_0x105e8);})['catch'](function(_0x2eaff1){logger[_0x2773('0x13')](_0x2773('0x24'),_0x2eaff1['message'],_0x27e36d);_0xe2a092(_0x1d75c4[_0x2773('0x13')](0x1f4,_0x2eaff1[_0x2773('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index cb4e338..364afe8 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 _0xf72b=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','emit'];(function(_0x1af3db,_0x369209){var _0x5da06a=function(_0x3eb995){while(--_0x3eb995){_0x1af3db['push'](_0x1af3db['shift']());}};_0x5da06a(++_0x369209);}(_0xf72b,0x1d9));var _0xbf72=function(_0x21d88d,_0x3df29e){_0x21d88d=_0x21d88d-0x0;var _0xc044bd=_0xf72b[_0x21d88d];return _0xc044bd;};'use strict';var ChatQueueEvents=require(_0xbf72('0x0'));var events=['save',_0xbf72('0x1'),'update'];function createListener(_0xd09dd2,_0x1880d0){return function(_0x5a9feb){_0x1880d0[_0xbf72('0x2')](_0xd09dd2,_0x5a9feb);};}function removeListener(_0x550a9e,_0x37afc8){return function(){ChatQueueEvents[_0xbf72('0x3')](_0x550a9e,_0x37afc8);};}exports[_0xbf72('0x4')]=function(_0x2b8440){for(var _0x5ee060=0x0,_0x41c11d=events[_0xbf72('0x5')];_0x5ee060<_0x41c11d;_0x5ee060++){var _0x119807=events[_0x5ee060];var _0xd0402c=createListener(_0xbf72('0x6')+_0x119807,_0x2b8440);ChatQueueEvents['on'](_0x119807,_0xd0402c);}}; \ No newline at end of file +var _0x0faf=['update','emit','removeListener','length','chatQueue:','./chatQueue.events','remove'];(function(_0x3a8ce2,_0x552ad5){var _0x2e5a45=function(_0x5de5ed){while(--_0x5de5ed){_0x3a8ce2['push'](_0x3a8ce2['shift']());}};_0x2e5a45(++_0x552ad5);}(_0x0faf,0x132));var _0xf0fa=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0x0faf[_0x36f243];return _0x426436;};'use strict';var ChatQueueEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatQueueEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatQueueEvents['on'](_0x2db1d9,_0x587865);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 941eeec..6b3409b 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(_0x95eba9,_0x41c502){var _0x4cec3f=function(_0x42e18c){while(--_0x42e18c){_0x95eba9['push'](_0x95eba9['shift']());}};_0x4cec3f(++_0x41c502);}(_0xe14b,0x93));var _0xbe14=function(_0x2b76e6,_0x11f93c){_0x2b76e6=_0x2b76e6-0x0;var _0x36fd04=_0xe14b[_0x2b76e6];return _0x36fd04;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x5fc3[_0x4347ec];return _0x4c8314;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 9331309..e1cf445 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 _0x8143=['sequelize','exports','STRING','DATE'];(function(_0x4ee9cd,_0xd375b0){var _0x328a5b=function(_0x3ad1f4){while(--_0x3ad1f4){_0x4ee9cd['push'](_0x4ee9cd['shift']());}};_0x328a5b(++_0xd375b0);}(_0x8143,0x74));var _0x3814=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8143[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require(_0x3814('0x0'));module[_0x3814('0x1')]={'uniqueid':{'type':Sequelize[_0x3814('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3814('0x2')]},'joinAt':{'type':Sequelize[_0x3814('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3814('0x3')]},'exitAt':{'type':Sequelize[_0x3814('0x3')]},'reason':{'type':Sequelize[_0x3814('0x2')]}}; \ No newline at end of file +var _0x0260=['exports','STRING','DATE','moment','sequelize'];(function(_0x34b0c8,_0x2a007a){var _0x4778d3=function(_0x452d32){while(--_0x452d32){_0x34b0c8['push'](_0x34b0c8['shift']());}};_0x4778d3(++_0x2a007a);}(_0x0260,0x1d9));var _0x0026=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x0260[_0x4e6ae6];return _0x23c108;};'use strict';var moment=require(_0x0026('0x0'));var Sequelize=require(_0x0026('0x1'));module[_0x0026('0x2')]={'uniqueid':{'type':Sequelize[_0x0026('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0026('0x3')]},'joinAt':{'type':Sequelize[_0x0026('0x4')]},'leaveAt':{'type':Sequelize[_0x0026('0x4')]},'acceptAt':{'type':Sequelize[_0x0026('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x0026('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 8207d3f..0836e5d 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 _0x0f9f=['then','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','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','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options'];(function(_0x49a15e,_0x1fba32){var _0x19e9b5=function(_0x147e4d){while(--_0x147e4d){_0x49a15e['push'](_0x49a15e['shift']());}};_0x19e9b5(++_0x1fba32);}(_0x0f9f,0xae));var _0xf0f9=function(_0x2ef60e,_0x35c32c){_0x2ef60e=_0x2ef60e-0x0;var _0x3be207=_0x0f9f[_0x2ef60e];return _0x3be207;};'use strict';var emlformat=require(_0xf0f9('0x0'));var rimraf=require(_0xf0f9('0x1'));var zipdir=require(_0xf0f9('0x2'));var jsonpatch=require(_0xf0f9('0x3'));var rp=require(_0xf0f9('0x4'));var moment=require(_0xf0f9('0x5'));var BPromise=require(_0xf0f9('0x6'));var Mustache=require(_0xf0f9('0x7'));var util=require(_0xf0f9('0x8'));var path=require(_0xf0f9('0x9'));var sox=require(_0xf0f9('0xa'));var csv=require('to-csv');var ejs=require(_0xf0f9('0xb'));var fs=require('fs');var fs_extra=require(_0xf0f9('0xc'));var _=require('lodash');var squel=require(_0xf0f9('0xd'));var crypto=require(_0xf0f9('0xe'));var jsforce=require(_0xf0f9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf0f9('0x10'));var querystring=require(_0xf0f9('0x11'));var Papa=require('papaparse');var Redis=require(_0xf0f9('0x12'));var authService=require(_0xf0f9('0x13'));var qs=require(_0xf0f9('0x14'));var as=require(_0xf0f9('0x15'));var hardwareService=require(_0xf0f9('0x16'));var logger=require(_0xf0f9('0x17'))(_0xf0f9('0x18'));var utils=require(_0xf0f9('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf0f9('0x1a'));var db=require(_0xf0f9('0x1b'))['db'];function respondWithStatusCode(_0xc23039,_0x458e1c){_0x458e1c=_0x458e1c||0xcc;return function(_0x5b0fa7){if(_0x5b0fa7){return _0xc23039[_0xf0f9('0x1c')](_0x458e1c);}return _0xc23039[_0xf0f9('0x1d')](_0x458e1c)['end']();};}function respondWithResult(_0x334c39,_0x519adf){_0x519adf=_0x519adf||0xc8;return function(_0x538864){if(_0x538864){return _0x334c39[_0xf0f9('0x1d')](_0x519adf)['json'](_0x538864);}};}function respondWithFilteredResult(_0x3e1587,_0x516717){return function(_0x3c23ec){if(_0x3c23ec){var _0x336483=typeof _0x516717[_0xf0f9('0x1e')]===_0xf0f9('0x1f')&&typeof _0x516717[_0xf0f9('0x20')]===_0xf0f9('0x1f');var _0x10dae6=_0x3c23ec['count'];var _0x44d248=_0x336483?0x0:_0x516717[_0xf0f9('0x1e')];var _0x43de16=_0x336483?_0x3c23ec[_0xf0f9('0x21')]:_0x516717[_0xf0f9('0x1e')]+_0x516717[_0xf0f9('0x20')];var _0x1765ad;if(_0x43de16>=_0x10dae6){_0x43de16=_0x10dae6;_0x1765ad=0xc8;}else{_0x1765ad=0xce;}_0x3e1587[_0xf0f9('0x1d')](_0x1765ad);return _0x3e1587['set'](_0xf0f9('0x22'),_0x44d248+'-'+_0x43de16+'/'+_0x10dae6)['json'](_0x3c23ec);}return null;};}function patchUpdates(_0x3664ff){return function(_0x510119){try{jsonpatch[_0xf0f9('0x23')](_0x510119,_0x3664ff,!![]);}catch(_0x1d5965){return BPromise[_0xf0f9('0x24')](_0x1d5965);}return _0x510119[_0xf0f9('0x25')]();};}function saveUpdates(_0xaff53c,_0x1b9740){return function(_0x49bddc){if(_0x49bddc){return _0x49bddc[_0xf0f9('0x26')](_0xaff53c)['then'](function(_0x2cb8f8){return _0x2cb8f8;});}return null;};}function removeEntity(_0x21dd05,_0x55ba89){return function(_0x217a15){if(_0x217a15){return _0x217a15[_0xf0f9('0x27')]()['then'](function(){_0x21dd05[_0xf0f9('0x1d')](0xcc)[_0xf0f9('0x28')]();});}};}function handleEntityNotFound(_0xa0b46e,_0x27defc){return function(_0x3ce34a){if(!_0x3ce34a){_0xa0b46e[_0xf0f9('0x1c')](0x194);}return _0x3ce34a;};}function handleError(_0x4c7c7c,_0x1849f0){_0x1849f0=_0x1849f0||0x1f4;return function(_0x4c31f2){logger[_0xf0f9('0x29')](_0x4c31f2[_0xf0f9('0x2a')]);if(_0x4c31f2[_0xf0f9('0x2b')]){delete _0x4c31f2[_0xf0f9('0x2b')];}_0x4c7c7c['status'](_0x1849f0)[_0xf0f9('0x2c')](_0x4c31f2);};}exports[_0xf0f9('0x2d')]=function(_0x477eb0,_0x5a435d){var _0x3bcd66={},_0x1cafc0={},_0x5957b1={'count':0x0,'rows':[]};var _0xfd5593=_['map'](db[_0xf0f9('0x2e')][_0xf0f9('0x2f')],function(_0x280681){return{'name':_0x280681[_0xf0f9('0x30')],'type':_0x280681[_0xf0f9('0x31')][_0xf0f9('0x32')]};});_0x1cafc0[_0xf0f9('0x33')]=_[_0xf0f9('0x34')](_0xfd5593,_0xf0f9('0x2b'));_0x1cafc0[_0xf0f9('0x35')]=_['keys'](_0x477eb0[_0xf0f9('0x35')]);_0x1cafc0[_0xf0f9('0x36')]=_['intersection'](_0x1cafc0['model'],_0x1cafc0[_0xf0f9('0x35')]);_0x3bcd66[_0xf0f9('0x37')]=_[_0xf0f9('0x38')](_0x1cafc0[_0xf0f9('0x33')],qs[_0xf0f9('0x39')](_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x39')]));_0x3bcd66['attributes']=_0x3bcd66[_0xf0f9('0x37')]['length']?_0x3bcd66[_0xf0f9('0x37')]:_0x1cafc0[_0xf0f9('0x33')];if(!_0x477eb0[_0xf0f9('0x35')]['hasOwnProperty'](_0xf0f9('0x3a'))){_0x3bcd66['limit']=qs[_0xf0f9('0x20')](_0x477eb0['query']['limit']);_0x3bcd66[_0xf0f9('0x1e')]=qs[_0xf0f9('0x1e')](_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x1e')]);}_0x3bcd66[_0xf0f9('0x3b')]=qs[_0xf0f9('0x3c')](_0x477eb0['query']['sort']);_0x3bcd66[_0xf0f9('0x3d')]=qs[_0xf0f9('0x36')](_[_0xf0f9('0x3e')](_0x477eb0['query'],_0x1cafc0['filters']),_0xfd5593);if(_0x477eb0[_0xf0f9('0x35')]['filter']){_0x3bcd66[_0xf0f9('0x3d')]=_[_0xf0f9('0x3f')](_0x3bcd66[_0xf0f9('0x3d')],{'$or':_[_0xf0f9('0x34')](_0xfd5593,function(_0x5b19b2){if(_0x5b19b2[_0xf0f9('0x31')]!==_0xf0f9('0x40')){var _0x11ea8f={};_0x11ea8f[_0x5b19b2[_0xf0f9('0x2b')]]={'$like':'%'+_0x477eb0['query']['filter']+'%'};return _0x11ea8f;}})});}_0x3bcd66=_['merge']({},_0x3bcd66,_0x477eb0[_0xf0f9('0x41')]);var _0x458810={'where':_0x3bcd66[_0xf0f9('0x3d')]};return db[_0xf0f9('0x2e')][_0xf0f9('0x21')](_0x458810)[_0xf0f9('0x42')](function(_0xcf598f){_0x5957b1['count']=_0xcf598f;if(_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x43')]){_0x3bcd66[_0xf0f9('0x44')]=[{'all':!![]}];}return db[_0xf0f9('0x2e')][_0xf0f9('0x45')](_0x3bcd66);})[_0xf0f9('0x42')](function(_0x4eb772){_0x5957b1[_0xf0f9('0x46')]=_0x4eb772;return _0x5957b1;})['then'](respondWithFilteredResult(_0x5a435d,_0x3bcd66))[_0xf0f9('0x47')](handleError(_0x5a435d,null));};exports[_0xf0f9('0x48')]=function(_0x290849,_0x181ed0){var _0x294e57={'raw':!![],'where':{'id':_0x290849[_0xf0f9('0x49')]['id']}},_0x574364={};_0x574364['model']=_[_0xf0f9('0x4a')](db[_0xf0f9('0x2e')][_0xf0f9('0x2f')]);_0x574364[_0xf0f9('0x35')]=_[_0xf0f9('0x4a')](_0x290849[_0xf0f9('0x35')]);_0x574364['filters']=_[_0xf0f9('0x38')](_0x574364[_0xf0f9('0x33')],_0x574364[_0xf0f9('0x35')]);_0x294e57['attributes']=_[_0xf0f9('0x38')](_0x574364['model'],qs[_0xf0f9('0x39')](_0x290849['query']['fields']));_0x294e57['attributes']=_0x294e57['attributes'][_0xf0f9('0x4b')]?_0x294e57['attributes']:_0x574364[_0xf0f9('0x33')];if(_0x290849[_0xf0f9('0x35')]['includeAll']){_0x294e57[_0xf0f9('0x44')]=[{'all':!![]}];}_0x294e57=_[_0xf0f9('0x3f')]({},_0x294e57,_0x290849[_0xf0f9('0x41')]);return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')](_0x294e57)['then'](handleEntityNotFound(_0x181ed0,null))[_0xf0f9('0x42')](respondWithResult(_0x181ed0,null))[_0xf0f9('0x47')](handleError(_0x181ed0,null));};exports[_0xf0f9('0x4d')]=function(_0x3512d5,_0x5601ca){return db[_0xf0f9('0x2e')][_0xf0f9('0x4d')](_0x3512d5[_0xf0f9('0x4e')],{})[_0xf0f9('0x42')](respondWithResult(_0x5601ca,0xc9))[_0xf0f9('0x47')](handleError(_0x5601ca,null));};exports[_0xf0f9('0x26')]=function(_0x3dd389,_0x299cec){if(_0x3dd389[_0xf0f9('0x4e')]['id']){delete _0x3dd389[_0xf0f9('0x4e')]['id'];}return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')]({'where':{'id':_0x3dd389['params']['id']}})[_0xf0f9('0x42')](handleEntityNotFound(_0x299cec,null))[_0xf0f9('0x42')](saveUpdates(_0x3dd389[_0xf0f9('0x4e')],null))['then'](respondWithResult(_0x299cec,null))[_0xf0f9('0x47')](handleError(_0x299cec,null));};exports[_0xf0f9('0x27')]=function(_0xa003e7,_0x1fe3b7){return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')]({'where':{'id':_0xa003e7[_0xf0f9('0x49')]['id']}})[_0xf0f9('0x42')](handleEntityNotFound(_0x1fe3b7,null))['then'](removeEntity(_0x1fe3b7,null))[_0xf0f9('0x47')](handleError(_0x1fe3b7,null));};exports[_0xf0f9('0x4f')]=function(_0x5d3756,_0x56c5e8){return db[_0xf0f9('0x2e')][_0xf0f9('0x4f')]()[_0xf0f9('0x42')](respondWithResult(_0x56c5e8,null))['catch'](handleError(_0x56c5e8,null));}; \ No newline at end of file +var _0xf954=['reject','save','update','then','sendStatus','error','stack','name','index','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','ChatQueueReport','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xf954,0x10e));var _0x4f95=function(_0x567d04,_0x3d13a1){_0x567d04=_0x567d04-0x0;var _0x58ee79=_0xf954[_0x567d04];return _0x58ee79;};'use strict';var emlformat=require(_0x4f95('0x0'));var rimraf=require(_0x4f95('0x1'));var zipdir=require(_0x4f95('0x2'));var jsonpatch=require(_0x4f95('0x3'));var rp=require(_0x4f95('0x4'));var moment=require(_0x4f95('0x5'));var BPromise=require(_0x4f95('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4f95('0x7'));var sox=require(_0x4f95('0x8'));var csv=require(_0x4f95('0x9'));var ejs=require(_0x4f95('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f95('0xb'));var squel=require(_0x4f95('0xc'));var crypto=require(_0x4f95('0xd'));var jsforce=require(_0x4f95('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4f95('0xf'));var Papa=require(_0x4f95('0x10'));var Redis=require(_0x4f95('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f95('0x12'));var logger=require(_0x4f95('0x13'))(_0x4f95('0x14'));var utils=require(_0x4f95('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4f95('0x16'));var db=require(_0x4f95('0x17'))['db'];function respondWithStatusCode(_0x424457,_0x4629d9){_0x4629d9=_0x4629d9||0xcc;return function(_0xefe2a2){if(_0xefe2a2){return _0x424457['sendStatus'](_0x4629d9);}return _0x424457[_0x4f95('0x18')](_0x4629d9)[_0x4f95('0x19')]();};}function respondWithResult(_0x39a456,_0x125249){_0x125249=_0x125249||0xc8;return function(_0x56d995){if(_0x56d995){return _0x39a456[_0x4f95('0x18')](_0x125249)[_0x4f95('0x1a')](_0x56d995);}};}function respondWithFilteredResult(_0x234adf,_0x57bbcd){return function(_0xfd3673){if(_0xfd3673){var _0x451dc2=typeof _0x57bbcd[_0x4f95('0x1b')]===_0x4f95('0x1c')&&typeof _0x57bbcd[_0x4f95('0x1d')]===_0x4f95('0x1c');var _0x2aa444=_0xfd3673[_0x4f95('0x1e')];var _0x235c03=_0x451dc2?0x0:_0x57bbcd[_0x4f95('0x1b')];var _0x5918ad=_0x451dc2?_0xfd3673[_0x4f95('0x1e')]:_0x57bbcd[_0x4f95('0x1b')]+_0x57bbcd[_0x4f95('0x1d')];var _0x2d2595;if(_0x5918ad>=_0x2aa444){_0x5918ad=_0x2aa444;_0x2d2595=0xc8;}else{_0x2d2595=0xce;}_0x234adf[_0x4f95('0x18')](_0x2d2595);return _0x234adf[_0x4f95('0x1f')](_0x4f95('0x20'),_0x235c03+'-'+_0x5918ad+'/'+_0x2aa444)[_0x4f95('0x1a')](_0xfd3673);}return null;};}function patchUpdates(_0xc449b4){return function(_0x50d3b0){try{jsonpatch[_0x4f95('0x21')](_0x50d3b0,_0xc449b4,!![]);}catch(_0xf70461){return BPromise[_0x4f95('0x22')](_0xf70461);}return _0x50d3b0[_0x4f95('0x23')]();};}function saveUpdates(_0x131436,_0xe47cd7){return function(_0xe49db2){if(_0xe49db2){return _0xe49db2[_0x4f95('0x24')](_0x131436)[_0x4f95('0x25')](function(_0x10cab5){return _0x10cab5;});}return null;};}function removeEntity(_0x21e3eb,_0x27a229){return function(_0x1e675c){if(_0x1e675c){return _0x1e675c['destroy']()[_0x4f95('0x25')](function(){_0x21e3eb[_0x4f95('0x18')](0xcc)[_0x4f95('0x19')]();});}};}function handleEntityNotFound(_0x34a4de,_0x3875fe){return function(_0x14ba9f){if(!_0x14ba9f){_0x34a4de[_0x4f95('0x26')](0x194);}return _0x14ba9f;};}function handleError(_0x49677d,_0x2154c4){_0x2154c4=_0x2154c4||0x1f4;return function(_0x50996d){logger[_0x4f95('0x27')](_0x50996d[_0x4f95('0x28')]);if(_0x50996d[_0x4f95('0x29')]){delete _0x50996d[_0x4f95('0x29')];}_0x49677d[_0x4f95('0x18')](_0x2154c4)['send'](_0x50996d);};}exports[_0x4f95('0x2a')]=function(_0x2dc278,_0x1cdd1b){var _0x6ff6c4={},_0x1ae268={},_0x73783a={'count':0x0,'rows':[]};var _0x2e33dc=_[_0x4f95('0x2b')](db['ChatQueueReport']['rawAttributes'],function(_0x5ea525){return{'name':_0x5ea525[_0x4f95('0x2c')],'type':_0x5ea525['type'][_0x4f95('0x2d')]};});_0x1ae268[_0x4f95('0x2e')]=_[_0x4f95('0x2b')](_0x2e33dc,_0x4f95('0x29'));_0x1ae268[_0x4f95('0x2f')]=_[_0x4f95('0x30')](_0x2dc278[_0x4f95('0x2f')]);_0x1ae268[_0x4f95('0x31')]=_['intersection'](_0x1ae268[_0x4f95('0x2e')],_0x1ae268[_0x4f95('0x2f')]);_0x6ff6c4[_0x4f95('0x32')]=_[_0x4f95('0x33')](_0x1ae268[_0x4f95('0x2e')],qs[_0x4f95('0x34')](_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x34')]));_0x6ff6c4['attributes']=_0x6ff6c4[_0x4f95('0x32')][_0x4f95('0x35')]?_0x6ff6c4[_0x4f95('0x32')]:_0x1ae268[_0x4f95('0x2e')];if(!_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x36')](_0x4f95('0x37'))){_0x6ff6c4[_0x4f95('0x1d')]=qs[_0x4f95('0x1d')](_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x1d')]);_0x6ff6c4[_0x4f95('0x1b')]=qs[_0x4f95('0x1b')](_0x2dc278['query']['offset']);}_0x6ff6c4[_0x4f95('0x38')]=qs[_0x4f95('0x39')](_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x39')]);_0x6ff6c4[_0x4f95('0x3a')]=qs['filters'](_['pick'](_0x2dc278[_0x4f95('0x2f')],_0x1ae268[_0x4f95('0x31')]),_0x2e33dc);if(_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x3b')]){_0x6ff6c4[_0x4f95('0x3a')]=_[_0x4f95('0x3c')](_0x6ff6c4['where'],{'$or':_[_0x4f95('0x2b')](_0x2e33dc,function(_0x110470){if(_0x110470[_0x4f95('0x3d')]!==_0x4f95('0x3e')){var _0x203b19={};_0x203b19[_0x110470[_0x4f95('0x29')]]={'$like':'%'+_0x2dc278[_0x4f95('0x2f')]['filter']+'%'};return _0x203b19;}})});}_0x6ff6c4=_['merge']({},_0x6ff6c4,_0x2dc278['options']);var _0x5322db={'where':_0x6ff6c4[_0x4f95('0x3a')]};return db[_0x4f95('0x3f')]['count'](_0x5322db)['then'](function(_0x4b6009){_0x73783a[_0x4f95('0x1e')]=_0x4b6009;if(_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x40')]){_0x6ff6c4[_0x4f95('0x41')]=[{'all':!![]}];}return db[_0x4f95('0x3f')]['findAll'](_0x6ff6c4);})[_0x4f95('0x25')](function(_0x2af149){_0x73783a[_0x4f95('0x42')]=_0x2af149;return _0x73783a;})[_0x4f95('0x25')](respondWithFilteredResult(_0x1cdd1b,_0x6ff6c4))[_0x4f95('0x43')](handleError(_0x1cdd1b,null));};exports[_0x4f95('0x44')]=function(_0x338d48,_0x10e8bf){var _0x2e133d={'raw':!![],'where':{'id':_0x338d48[_0x4f95('0x45')]['id']}},_0x572606={};_0x572606[_0x4f95('0x2e')]=_[_0x4f95('0x30')](db[_0x4f95('0x3f')][_0x4f95('0x46')]);_0x572606['query']=_['keys'](_0x338d48['query']);_0x572606[_0x4f95('0x31')]=_[_0x4f95('0x33')](_0x572606[_0x4f95('0x2e')],_0x572606['query']);_0x2e133d['attributes']=_[_0x4f95('0x33')](_0x572606[_0x4f95('0x2e')],qs[_0x4f95('0x34')](_0x338d48['query'][_0x4f95('0x34')]));_0x2e133d[_0x4f95('0x32')]=_0x2e133d['attributes']['length']?_0x2e133d[_0x4f95('0x32')]:_0x572606[_0x4f95('0x2e')];if(_0x338d48[_0x4f95('0x2f')][_0x4f95('0x40')]){_0x2e133d[_0x4f95('0x41')]=[{'all':!![]}];}_0x2e133d=_[_0x4f95('0x3c')]({},_0x2e133d,_0x338d48[_0x4f95('0x47')]);return db[_0x4f95('0x3f')][_0x4f95('0x48')](_0x2e133d)[_0x4f95('0x25')](handleEntityNotFound(_0x10e8bf,null))[_0x4f95('0x25')](respondWithResult(_0x10e8bf,null))['catch'](handleError(_0x10e8bf,null));};exports[_0x4f95('0x49')]=function(_0x23b029,_0x372e1b){return db[_0x4f95('0x3f')]['create'](_0x23b029[_0x4f95('0x4a')],{})[_0x4f95('0x25')](respondWithResult(_0x372e1b,0xc9))[_0x4f95('0x43')](handleError(_0x372e1b,null));};exports[_0x4f95('0x24')]=function(_0x3b66b8,_0x43c97b){if(_0x3b66b8['body']['id']){delete _0x3b66b8[_0x4f95('0x4a')]['id'];}return db[_0x4f95('0x3f')][_0x4f95('0x48')]({'where':{'id':_0x3b66b8[_0x4f95('0x45')]['id']}})[_0x4f95('0x25')](handleEntityNotFound(_0x43c97b,null))[_0x4f95('0x25')](saveUpdates(_0x3b66b8[_0x4f95('0x4a')],null))['then'](respondWithResult(_0x43c97b,null))[_0x4f95('0x43')](handleError(_0x43c97b,null));};exports['destroy']=function(_0x4646ca,_0x2d91bc){return db[_0x4f95('0x3f')]['find']({'where':{'id':_0x4646ca['params']['id']}})[_0x4f95('0x25')](handleEntityNotFound(_0x2d91bc,null))['then'](removeEntity(_0x2d91bc,null))[_0x4f95('0x43')](handleError(_0x2d91bc,null));};exports[_0x4f95('0x4b')]=function(_0x1811c2,_0x2f42b4){return db[_0x4f95('0x3f')]['describe']()[_0x4f95('0x25')](respondWithResult(_0x2f42b4,null))['catch'](handleError(_0x2f42b4,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 2af0748..269b867 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x26c4a8,_0x2179f7){var _0x46b15b=function(_0x368ac6){while(--_0x368ac6){_0x26c4a8['push'](_0x26c4a8['shift']());}};_0x46b15b(++_0x2179f7);}(_0x757a,0xde));var _0xa757=function(_0x578487,_0x5f5c4d){_0x578487=_0x578487-0x0;var _0x34b72d=_0x757a[_0x578487];return _0x34b72d;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index b51faa5..92a81e5 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 _0x813c=['attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','body','options','raw','debug','UpdateChatQueueReport','update','where'];(function(_0x23db19,_0x4ac567){var _0x3becef=function(_0x14a37b){while(--_0x14a37b){_0x23db19['push'](_0x23db19['shift']());}};_0x3becef(++_0x4ac567);}(_0x813c,0x169));var _0xc813=function(_0x20ab23,_0x516530){_0x20ab23=_0x20ab23-0x0;var _0x44dc5a=_0x813c[_0x20ab23];return _0x44dc5a;};'use strict';var _=require('lodash');var util=require(_0xc813('0x0'));var moment=require(_0xc813('0x1'));var BPromise=require(_0xc813('0x2'));var rs=require(_0xc813('0x3'));var fs=require('fs');var Redis=require(_0xc813('0x4'));var db=require(_0xc813('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc813('0x6'))(_0xc813('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc813('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26833c,_0x362188,_0x1e5706){return new BPromise(function(_0x327468,_0x352385){return client[_0xc813('0x9')](_0x26833c,_0x1e5706)[_0xc813('0xa')](function(_0x4cd271){logger[_0xc813('0xb')](_0xc813('0xc'),_0x362188,_0xc813('0xd'));logger['debug'](_0xc813('0xe'),_0x362188,_0xc813('0xd'),JSON[_0xc813('0xf')](_0x4cd271));if(_0x4cd271[_0xc813('0x10')]){if(_0x4cd271[_0xc813('0x10')][_0xc813('0x11')]===0x1f4){logger['error'](_0xc813('0xc'),_0x362188,_0x4cd271[_0xc813('0x10')]['message']);return _0x352385(_0x4cd271[_0xc813('0x10')]['message']);}logger[_0xc813('0x10')](_0xc813('0xc'),_0x362188,_0x4cd271[_0xc813('0x10')][_0xc813('0x12')]);return _0x327468(_0x4cd271[_0xc813('0x10')]['message']);}else{logger[_0xc813('0xb')](_0xc813('0xc'),_0x362188,'request\x20sent');_0x327468(_0x4cd271[_0xc813('0x13')][_0xc813('0x12')]);}})[_0xc813('0x14')](function(_0x21282c){logger[_0xc813('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x362188,_0x21282c);_0x352385(_0x21282c);});});}exports[_0xc813('0x15')]=function(_0x1fc7ce){var _0xdb8fdf=this;return new Promise(function(_0x255296,_0x376c84){return db['ChatQueueReport']['create'](_0x1fc7ce[_0xc813('0x16')],{'raw':_0x1fc7ce[_0xc813('0x17')]?_0x1fc7ce[_0xc813('0x17')][_0xc813('0x18')]===undefined?!![]:![]:!![]})[_0xc813('0xa')](function(_0x2ecc79){logger[_0xc813('0xb')]('CreateChatQueueReport',_0x1fc7ce);logger[_0xc813('0x19')](_0xc813('0x15'),_0x1fc7ce,JSON[_0xc813('0xf')](_0x2ecc79));_0x255296(_0x2ecc79);})['catch'](function(_0x1f8d81){logger[_0xc813('0x10')](_0xc813('0x15'),_0x1f8d81[_0xc813('0x12')],_0x1fc7ce);_0x376c84(_0xdb8fdf[_0xc813('0x10')](0x1f4,_0x1f8d81['message']));});});};exports[_0xc813('0x1a')]=function(_0x14d351){var _0x18fbad=this;return new Promise(function(_0x1b3596,_0x49be2e){return db['ChatQueueReport'][_0xc813('0x1b')](_0x14d351['body'],{'raw':_0x14d351[_0xc813('0x17')]?_0x14d351[_0xc813('0x17')][_0xc813('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14d351['options']?_0x14d351[_0xc813('0x17')][_0xc813('0x1c')]||null:null,'attributes':_0x14d351['options']?_0x14d351[_0xc813('0x17')][_0xc813('0x1d')]||null:null,'limit':_0x14d351[_0xc813('0x17')]?_0x14d351['options']['limit']||null:null})[_0xc813('0xa')](function(_0x3a7798){logger[_0xc813('0xb')](_0xc813('0x1a'),_0x14d351);logger[_0xc813('0x19')](_0xc813('0x1a'),_0x14d351,JSON['stringify'](_0x3a7798));_0x1b3596(_0x3a7798);})[_0xc813('0x14')](function(_0x137f57){logger[_0xc813('0x10')](_0xc813('0x1a'),_0x137f57[_0xc813('0x12')],_0x14d351);_0x49be2e(_0x18fbad[_0xc813('0x10')](0x1f4,_0x137f57[_0xc813('0x12')]));});});}; \ No newline at end of file +var _0xab23=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatQueueReport','create','body','options','ChatQueueReport','update','raw','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xab23,0x1bc));var _0x3ab2=function(_0x4a9218,_0x2b25cc){_0x4a9218=_0x4a9218-0x0;var _0x338098=_0xab23[_0x4a9218];return _0x338098;};'use strict';var _=require(_0x3ab2('0x0'));var util=require(_0x3ab2('0x1'));var moment=require(_0x3ab2('0x2'));var BPromise=require(_0x3ab2('0x3'));var rs=require(_0x3ab2('0x4'));var fs=require('fs');var Redis=require(_0x3ab2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ab2('0x6'));var logger=require(_0x3ab2('0x7'))(_0x3ab2('0x8'));var config=require(_0x3ab2('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3ab2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e8d92,_0x5c861e,_0x36eee5){return new BPromise(function(_0x46d253,_0x20cfe1){return client[_0x3ab2('0xb')](_0x4e8d92,_0x36eee5)[_0x3ab2('0xc')](function(_0x120021){logger[_0x3ab2('0xd')](_0x3ab2('0xe'),_0x5c861e,_0x3ab2('0xf'));logger[_0x3ab2('0x10')](_0x3ab2('0x11'),_0x5c861e,'request\x20sent',JSON[_0x3ab2('0x12')](_0x120021));if(_0x120021[_0x3ab2('0x13')]){if(_0x120021[_0x3ab2('0x13')]['code']===0x1f4){logger['error'](_0x3ab2('0xe'),_0x5c861e,_0x120021[_0x3ab2('0x13')][_0x3ab2('0x14')]);return _0x20cfe1(_0x120021[_0x3ab2('0x13')][_0x3ab2('0x14')]);}logger[_0x3ab2('0x13')](_0x3ab2('0xe'),_0x5c861e,_0x120021[_0x3ab2('0x13')][_0x3ab2('0x14')]);return _0x46d253(_0x120021['error'][_0x3ab2('0x14')]);}else{logger['info'](_0x3ab2('0xe'),_0x5c861e,_0x3ab2('0xf'));_0x46d253(_0x120021['result']['message']);}})[_0x3ab2('0x15')](function(_0x43336e){logger[_0x3ab2('0x13')](_0x3ab2('0xe'),_0x5c861e,_0x43336e);_0x20cfe1(_0x43336e);});});}exports[_0x3ab2('0x16')]=function(_0x5a6ec4){var _0x4d129b=this;return new Promise(function(_0x42c4f4,_0x1efcb9){return db['ChatQueueReport'][_0x3ab2('0x17')](_0x5a6ec4[_0x3ab2('0x18')],{'raw':_0x5a6ec4[_0x3ab2('0x19')]?_0x5a6ec4[_0x3ab2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3ab2('0xc')](function(_0x42638a){logger[_0x3ab2('0xd')](_0x3ab2('0x16'),_0x5a6ec4);logger[_0x3ab2('0x10')](_0x3ab2('0x16'),_0x5a6ec4,JSON[_0x3ab2('0x12')](_0x42638a));_0x42c4f4(_0x42638a);})[_0x3ab2('0x15')](function(_0x5dbfdc){logger[_0x3ab2('0x13')]('CreateChatQueueReport',_0x5dbfdc[_0x3ab2('0x14')],_0x5a6ec4);_0x1efcb9(_0x4d129b[_0x3ab2('0x13')](0x1f4,_0x5dbfdc[_0x3ab2('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x436433){var _0x3b05dd=this;return new Promise(function(_0x459400,_0x3dcb9e){return db[_0x3ab2('0x1a')][_0x3ab2('0x1b')](_0x436433[_0x3ab2('0x18')],{'raw':_0x436433[_0x3ab2('0x19')]?_0x436433[_0x3ab2('0x19')][_0x3ab2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x436433[_0x3ab2('0x19')]?_0x436433[_0x3ab2('0x19')]['where']||null:null,'attributes':_0x436433[_0x3ab2('0x19')]?_0x436433['options'][_0x3ab2('0x1d')]||null:null,'limit':_0x436433[_0x3ab2('0x19')]?_0x436433[_0x3ab2('0x19')][_0x3ab2('0x1e')]||null:null})[_0x3ab2('0xc')](function(_0x36005a){logger[_0x3ab2('0xd')](_0x3ab2('0x1f'),_0x436433);logger[_0x3ab2('0x10')](_0x3ab2('0x1f'),_0x436433,JSON[_0x3ab2('0x12')](_0x36005a));_0x459400(_0x36005a);})['catch'](function(_0x5dbcf4){logger['error'](_0x3ab2('0x1f'),_0x5dbcf4['message'],_0x436433);_0x3dcb9e(_0x3b05dd[_0x3ab2('0x13')](0x1f4,_0x5dbcf4[_0x3ab2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 1878428..1bf1bf5 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 _0xf974=['exports','path','Router','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3e2c1e,_0x1e8d40){var _0x1c6666=function(_0x190b73){while(--_0x190b73){_0x3e2c1e['push'](_0x3e2c1e['shift']());}};_0x1c6666(++_0x1e8d40);}(_0xf974,0xab));var _0x4f97=function(_0x464b63,_0x3b71a4){_0x464b63=_0x464b63-0x0;var _0xdb1776=_0xf974[_0x464b63];return _0xdb1776;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4f97('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4f97('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4f97('0x2'));var config=require('../../config/environment');var controller=require(_0x4f97('0x3'));router[_0x4f97('0x4')]('/',auth[_0x4f97('0x5')](),controller[_0x4f97('0x6')]);router[_0x4f97('0x4')](_0x4f97('0x7'),auth[_0x4f97('0x5')](),controller['describe']);router[_0x4f97('0x4')](_0x4f97('0x8'),auth[_0x4f97('0x5')](),controller[_0x4f97('0x9')]);router[_0x4f97('0xa')]('/',auth[_0x4f97('0x5')](),controller[_0x4f97('0xb')]);router[_0x4f97('0xc')](_0x4f97('0x8'),auth['isAuthenticated'](),controller[_0x4f97('0xd')]);router[_0x4f97('0xe')](_0x4f97('0x8'),auth[_0x4f97('0x5')](),controller[_0x4f97('0xf')]);module[_0x4f97('0x10')]=router; \ No newline at end of file +var _0x6080=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','show','put','/:id','update','delete'];(function(_0x3cff16,_0x12713c){var _0x5943a0=function(_0x572563){while(--_0x572563){_0x3cff16['push'](_0x3cff16['shift']());}};_0x5943a0(++_0x12713c);}(_0x6080,0x18c));var _0x0608=function(_0x5bd1f1,_0xfa1e23){_0x5bd1f1=_0x5bd1f1-0x0;var _0x3313a7=_0x6080[_0x5bd1f1];return _0x3313a7;};'use strict';var multer=require(_0x0608('0x0'));var util=require(_0x0608('0x1'));var path=require(_0x0608('0x2'));var timeout=require(_0x0608('0x3'));var express=require('express');var router=express[_0x0608('0x4')]();var fs_extra=require(_0x0608('0x5'));var auth=require(_0x0608('0x6'));var interaction=require(_0x0608('0x7'));var config=require(_0x0608('0x8'));var controller=require(_0x0608('0x9'));router[_0x0608('0xa')]('/',auth[_0x0608('0xb')](),controller['index']);router[_0x0608('0xa')](_0x0608('0xc'),auth[_0x0608('0xb')](),controller['describe']);router[_0x0608('0xa')]('/:id',auth[_0x0608('0xb')](),controller[_0x0608('0xd')]);router['post']('/',auth[_0x0608('0xb')](),controller['create']);router[_0x0608('0xe')](_0x0608('0xf'),auth['isAuthenticated'](),controller[_0x0608('0x10')]);router[_0x0608('0x11')]('/:id',auth[_0x0608('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index a294b23..f562801 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x468d16,_0x17ece7){var _0x55850a=function(_0x4326e2){while(--_0x4326e2){_0x468d16['push'](_0x468d16['shift']());}};_0x55850a(++_0x17ece7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0xf3cd[_0x49e584];return _0x58b1be;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x18ddf4,_0x3fb331){var _0xa06d9c=function(_0x8e7c41){while(--_0x8e7c41){_0x18ddf4['push'](_0x18ddf4['shift']());}};_0xa06d9c(++_0x3fb331);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1830ce,_0x305798){_0x1830ce=_0x1830ce-0x0;var _0x2bce9f=_0xf3cd[_0x1830ce];return _0x2bce9f;};'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 86c889c..ad45b3b 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 _0x672e=['pick','where','findAll','show','params','keys','length','includeAll','include','merge','catch','create','body','find','describe','eml-format','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/license/hardware','../../config/logger','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x5ed068,_0x470a7c){var _0x141d2d=function(_0x32ce1a){while(--_0x32ce1a){_0x5ed068['push'](_0x5ed068['shift']());}};_0x141d2d(++_0x470a7c);}(_0x672e,0x9b));var _0xe672=function(_0x39bab8,_0x23d6c2){_0x39bab8=_0x39bab8-0x0;var _0x14ade4=_0x672e[_0x39bab8];return _0x14ade4;};'use strict';var emlformat=require(_0xe672('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe672('0x1'));var moment=require('moment');var BPromise=require(_0xe672('0x2'));var Mustache=require(_0xe672('0x3'));var util=require(_0xe672('0x4'));var path=require(_0xe672('0x5'));var sox=require(_0xe672('0x6'));var csv=require(_0xe672('0x7'));var ejs=require(_0xe672('0x8'));var fs=require('fs');var fs_extra=require(_0xe672('0x9'));var _=require(_0xe672('0xa'));var squel=require(_0xe672('0xb'));var crypto=require(_0xe672('0xc'));var jsforce=require(_0xe672('0xd'));var deskjs=require(_0xe672('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe672('0xf'));var Papa=require(_0xe672('0x10'));var Redis=require(_0xe672('0x11'));var authService=require(_0xe672('0x12'));var qs=require(_0xe672('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe672('0x14'));var logger=require(_0xe672('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x262924,_0x4fec67){_0x4fec67=_0x4fec67||0xcc;return function(_0x19f156){if(_0x19f156){return _0x262924[_0xe672('0x16')](_0x4fec67);}return _0x262924[_0xe672('0x17')](_0x4fec67)[_0xe672('0x18')]();};}function respondWithResult(_0x453b01,_0x30d7d5){_0x30d7d5=_0x30d7d5||0xc8;return function(_0x38f394){if(_0x38f394){return _0x453b01[_0xe672('0x17')](_0x30d7d5)['json'](_0x38f394);}};}function respondWithFilteredResult(_0x5df333,_0x716626){return function(_0x7bdb4d){if(_0x7bdb4d){var _0x5c60fd=typeof _0x716626[_0xe672('0x19')]===_0xe672('0x1a')&&typeof _0x716626[_0xe672('0x1b')]==='undefined';var _0x369578=_0x7bdb4d[_0xe672('0x1c')];var _0x584433=_0x5c60fd?0x0:_0x716626[_0xe672('0x19')];var _0x1883da=_0x5c60fd?_0x7bdb4d['count']:_0x716626[_0xe672('0x19')]+_0x716626[_0xe672('0x1b')];var _0x400a01;if(_0x1883da>=_0x369578){_0x1883da=_0x369578;_0x400a01=0xc8;}else{_0x400a01=0xce;}_0x5df333['status'](_0x400a01);return _0x5df333[_0xe672('0x1d')](_0xe672('0x1e'),_0x584433+'-'+_0x1883da+'/'+_0x369578)[_0xe672('0x1f')](_0x7bdb4d);}return null;};}function patchUpdates(_0x18380c){return function(_0x500cdf){try{jsonpatch[_0xe672('0x20')](_0x500cdf,_0x18380c,!![]);}catch(_0x459a16){return BPromise['reject'](_0x459a16);}return _0x500cdf[_0xe672('0x21')]();};}function saveUpdates(_0x11afff,_0x589628){return function(_0xfe1057){if(_0xfe1057){return _0xfe1057['update'](_0x11afff)[_0xe672('0x22')](function(_0x15db50){return _0x15db50;});}return null;};}function removeEntity(_0x41f14a,_0x17f439){return function(_0xade1c1){if(_0xade1c1){return _0xade1c1[_0xe672('0x23')]()[_0xe672('0x22')](function(){_0x41f14a['status'](0xcc)[_0xe672('0x18')]();});}};}function handleEntityNotFound(_0x3cd974,_0x414e5e){return function(_0x5a93f7){if(!_0x5a93f7){_0x3cd974[_0xe672('0x16')](0x194);}return _0x5a93f7;};}function handleError(_0x36df39,_0x45e3c5){_0x45e3c5=_0x45e3c5||0x1f4;return function(_0xd03513){logger[_0xe672('0x24')](_0xd03513[_0xe672('0x25')]);if(_0xd03513[_0xe672('0x26')]){delete _0xd03513['name'];}_0x36df39['status'](_0x45e3c5)[_0xe672('0x27')](_0xd03513);};}exports[_0xe672('0x28')]=function(_0x36f1b4,_0x2ea55b){var _0x52af5b={},_0x4b8595={},_0x5f2f83={'count':0x0,'rows':[]};var _0x47190d=_[_0xe672('0x29')](db[_0xe672('0x2a')]['rawAttributes'],function(_0x214133){return{'name':_0x214133[_0xe672('0x2b')],'type':_0x214133[_0xe672('0x2c')]['key']};});_0x4b8595[_0xe672('0x2d')]=_[_0xe672('0x29')](_0x47190d,'name');_0x4b8595[_0xe672('0x2e')]=_['keys'](_0x36f1b4[_0xe672('0x2e')]);_0x4b8595[_0xe672('0x2f')]=_[_0xe672('0x30')](_0x4b8595[_0xe672('0x2d')],_0x4b8595[_0xe672('0x2e')]);_0x52af5b[_0xe672('0x31')]=_[_0xe672('0x30')](_0x4b8595[_0xe672('0x2d')],qs[_0xe672('0x32')](_0x36f1b4[_0xe672('0x2e')]['fields']));_0x52af5b[_0xe672('0x31')]=_0x52af5b[_0xe672('0x31')]['length']?_0x52af5b[_0xe672('0x31')]:_0x4b8595['model'];if(!_0x36f1b4['query'][_0xe672('0x33')](_0xe672('0x34'))){_0x52af5b[_0xe672('0x1b')]=qs[_0xe672('0x1b')](_0x36f1b4['query'][_0xe672('0x1b')]);_0x52af5b[_0xe672('0x19')]=qs['offset'](_0x36f1b4[_0xe672('0x2e')]['offset']);}_0x52af5b[_0xe672('0x35')]=qs[_0xe672('0x36')](_0x36f1b4['query'][_0xe672('0x36')]);_0x52af5b['where']=qs[_0xe672('0x2f')](_[_0xe672('0x37')](_0x36f1b4[_0xe672('0x2e')],_0x4b8595['filters']),_0x47190d);if(_0x36f1b4[_0xe672('0x2e')]['filter']){_0x52af5b[_0xe672('0x38')]=_['merge'](_0x52af5b[_0xe672('0x38')],{'$or':_[_0xe672('0x29')](_0x47190d,function(_0x52b0cd){if(_0x52b0cd[_0xe672('0x2c')]!=='VIRTUAL'){var _0x593b2e={};_0x593b2e[_0x52b0cd['name']]={'$like':'%'+_0x36f1b4[_0xe672('0x2e')]['filter']+'%'};return _0x593b2e;}})});}_0x52af5b=_['merge']({},_0x52af5b,_0x36f1b4['options']);var _0x5e5967={'where':_0x52af5b[_0xe672('0x38')]};return db[_0xe672('0x2a')][_0xe672('0x1c')](_0x5e5967)[_0xe672('0x22')](function(_0xdfa0f6){_0x5f2f83[_0xe672('0x1c')]=_0xdfa0f6;if(_0x36f1b4[_0xe672('0x2e')]['includeAll']){_0x52af5b['include']=[{'all':!![]}];}return db[_0xe672('0x2a')][_0xe672('0x39')](_0x52af5b);})[_0xe672('0x22')](function(_0x4c5346){_0x5f2f83['rows']=_0x4c5346;return _0x5f2f83;})[_0xe672('0x22')](respondWithFilteredResult(_0x2ea55b,_0x52af5b))['catch'](handleError(_0x2ea55b,null));};exports[_0xe672('0x3a')]=function(_0x2ad1e5,_0x30d2a5){var _0x44d69c={'raw':!![],'where':{'id':_0x2ad1e5[_0xe672('0x3b')]['id']}},_0x4f3bf3={};_0x4f3bf3[_0xe672('0x2d')]=_[_0xe672('0x3c')](db['ChatTransferReport']['rawAttributes']);_0x4f3bf3[_0xe672('0x2e')]=_['keys'](_0x2ad1e5[_0xe672('0x2e')]);_0x4f3bf3[_0xe672('0x2f')]=_['intersection'](_0x4f3bf3['model'],_0x4f3bf3[_0xe672('0x2e')]);_0x44d69c[_0xe672('0x31')]=_[_0xe672('0x30')](_0x4f3bf3[_0xe672('0x2d')],qs[_0xe672('0x32')](_0x2ad1e5[_0xe672('0x2e')]['fields']));_0x44d69c[_0xe672('0x31')]=_0x44d69c[_0xe672('0x31')][_0xe672('0x3d')]?_0x44d69c[_0xe672('0x31')]:_0x4f3bf3[_0xe672('0x2d')];if(_0x2ad1e5[_0xe672('0x2e')][_0xe672('0x3e')]){_0x44d69c[_0xe672('0x3f')]=[{'all':!![]}];}_0x44d69c=_[_0xe672('0x40')]({},_0x44d69c,_0x2ad1e5['options']);return db[_0xe672('0x2a')]['find'](_0x44d69c)[_0xe672('0x22')](handleEntityNotFound(_0x30d2a5,null))['then'](respondWithResult(_0x30d2a5,null))[_0xe672('0x41')](handleError(_0x30d2a5,null));};exports[_0xe672('0x42')]=function(_0x15af09,_0x17cb60){return db['ChatTransferReport']['create'](_0x15af09[_0xe672('0x43')],{})[_0xe672('0x22')](respondWithResult(_0x17cb60,0xc9))[_0xe672('0x41')](handleError(_0x17cb60,null));};exports['update']=function(_0x5ac8e0,_0x2b9b13){if(_0x5ac8e0['body']['id']){delete _0x5ac8e0['body']['id'];}return db['ChatTransferReport'][_0xe672('0x44')]({'where':{'id':_0x5ac8e0['params']['id']}})[_0xe672('0x22')](handleEntityNotFound(_0x2b9b13,null))['then'](saveUpdates(_0x5ac8e0[_0xe672('0x43')],null))['then'](respondWithResult(_0x2b9b13,null))[_0xe672('0x41')](handleError(_0x2b9b13,null));};exports[_0xe672('0x23')]=function(_0x3eb924,_0x5886dd){return db[_0xe672('0x2a')][_0xe672('0x44')]({'where':{'id':_0x3eb924[_0xe672('0x3b')]['id']}})[_0xe672('0x22')](handleEntityNotFound(_0x5886dd,null))[_0xe672('0x22')](removeEntity(_0x5886dd,null))[_0xe672('0x41')](handleError(_0x5886dd,null));};exports[_0xe672('0x45')]=function(_0x41c3f9,_0x5266fb){return db['ChatTransferReport'][_0xe672('0x45')]()['then'](respondWithResult(_0x5266fb,null))[_0xe672('0x41')](handleError(_0x5266fb,null));}; \ No newline at end of file +var _0x0881=['catch','show','params','intersection','options','create','body','find','describe','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll'];(function(_0x52a60d,_0x5cf284){var _0x2c6ad2=function(_0x1f2cce){while(--_0x1f2cce){_0x52a60d['push'](_0x52a60d['shift']());}};_0x2c6ad2(++_0x5cf284);}(_0x0881,0xea));var _0x1088=function(_0x1cea7b,_0x37f5f4){_0x1cea7b=_0x1cea7b-0x0;var _0x5618d1=_0x0881[_0x1cea7b];return _0x5618d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1088('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1088('0x1'));var moment=require(_0x1088('0x2'));var BPromise=require(_0x1088('0x3'));var Mustache=require('mustache');var util=require(_0x1088('0x4'));var path=require(_0x1088('0x5'));var sox=require(_0x1088('0x6'));var csv=require(_0x1088('0x7'));var ejs=require(_0x1088('0x8'));var fs=require('fs');var fs_extra=require(_0x1088('0x9'));var _=require(_0x1088('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1088('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1088('0xc'));var Papa=require(_0x1088('0xd'));var Redis=require(_0x1088('0xe'));var authService=require(_0x1088('0xf'));var qs=require(_0x1088('0x10'));var as=require(_0x1088('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1088('0x12'))(_0x1088('0x13'));var utils=require('../../config/utils');var config=require(_0x1088('0x14'));var licenseUtil=require(_0x1088('0x15'));var db=require(_0x1088('0x16'))['db'];function respondWithStatusCode(_0x518232,_0x5da1de){_0x5da1de=_0x5da1de||0xcc;return function(_0x15e1ee){if(_0x15e1ee){return _0x518232[_0x1088('0x17')](_0x5da1de);}return _0x518232[_0x1088('0x18')](_0x5da1de)[_0x1088('0x19')]();};}function respondWithResult(_0x454355,_0x24ac5e){_0x24ac5e=_0x24ac5e||0xc8;return function(_0x13ef5f){if(_0x13ef5f){return _0x454355[_0x1088('0x18')](_0x24ac5e)['json'](_0x13ef5f);}};}function respondWithFilteredResult(_0x5a997a,_0x2bdfb9){return function(_0x1269ae){if(_0x1269ae){var _0xf14386=typeof _0x2bdfb9[_0x1088('0x1a')]==='undefined'&&typeof _0x2bdfb9['limit']==='undefined';var _0x43f429=_0x1269ae[_0x1088('0x1b')];var _0x50fac7=_0xf14386?0x0:_0x2bdfb9[_0x1088('0x1a')];var _0x842f2e=_0xf14386?_0x1269ae[_0x1088('0x1b')]:_0x2bdfb9[_0x1088('0x1a')]+_0x2bdfb9['limit'];var _0x581778;if(_0x842f2e>=_0x43f429){_0x842f2e=_0x43f429;_0x581778=0xc8;}else{_0x581778=0xce;}_0x5a997a['status'](_0x581778);return _0x5a997a[_0x1088('0x1c')](_0x1088('0x1d'),_0x50fac7+'-'+_0x842f2e+'/'+_0x43f429)[_0x1088('0x1e')](_0x1269ae);}return null;};}function patchUpdates(_0x18e441){return function(_0x34945d){try{jsonpatch[_0x1088('0x1f')](_0x34945d,_0x18e441,!![]);}catch(_0x57ebbb){return BPromise['reject'](_0x57ebbb);}return _0x34945d[_0x1088('0x20')]();};}function saveUpdates(_0x3dff76,_0x51f281){return function(_0x3813e4){if(_0x3813e4){return _0x3813e4[_0x1088('0x21')](_0x3dff76)[_0x1088('0x22')](function(_0x27e40e){return _0x27e40e;});}return null;};}function removeEntity(_0x5395cb,_0x2fe399){return function(_0x3e61a2){if(_0x3e61a2){return _0x3e61a2[_0x1088('0x23')]()[_0x1088('0x22')](function(){_0x5395cb[_0x1088('0x18')](0xcc)[_0x1088('0x19')]();});}};}function handleEntityNotFound(_0xb91f37,_0x59b1db){return function(_0xcf449d){if(!_0xcf449d){_0xb91f37[_0x1088('0x17')](0x194);}return _0xcf449d;};}function handleError(_0x5542d9,_0x1adbba){_0x1adbba=_0x1adbba||0x1f4;return function(_0x383c11){logger[_0x1088('0x24')](_0x383c11[_0x1088('0x25')]);if(_0x383c11[_0x1088('0x26')]){delete _0x383c11[_0x1088('0x26')];}_0x5542d9['status'](_0x1adbba)[_0x1088('0x27')](_0x383c11);};}exports['index']=function(_0x43d6c7,_0x45d050){var _0x3e4630={},_0x104708={},_0x8fa8a3={'count':0x0,'rows':[]};var _0x27ead4=_[_0x1088('0x28')](db[_0x1088('0x29')][_0x1088('0x2a')],function(_0x281f08){return{'name':_0x281f08[_0x1088('0x2b')],'type':_0x281f08['type'][_0x1088('0x2c')]};});_0x104708['model']=_[_0x1088('0x28')](_0x27ead4,_0x1088('0x26'));_0x104708[_0x1088('0x2d')]=_[_0x1088('0x2e')](_0x43d6c7[_0x1088('0x2d')]);_0x104708['filters']=_['intersection'](_0x104708[_0x1088('0x2f')],_0x104708[_0x1088('0x2d')]);_0x3e4630[_0x1088('0x30')]=_['intersection'](_0x104708[_0x1088('0x2f')],qs[_0x1088('0x31')](_0x43d6c7[_0x1088('0x2d')][_0x1088('0x31')]));_0x3e4630['attributes']=_0x3e4630[_0x1088('0x30')][_0x1088('0x32')]?_0x3e4630[_0x1088('0x30')]:_0x104708[_0x1088('0x2f')];if(!_0x43d6c7[_0x1088('0x2d')][_0x1088('0x33')](_0x1088('0x34'))){_0x3e4630['limit']=qs[_0x1088('0x35')](_0x43d6c7[_0x1088('0x2d')][_0x1088('0x35')]);_0x3e4630[_0x1088('0x1a')]=qs[_0x1088('0x1a')](_0x43d6c7[_0x1088('0x2d')][_0x1088('0x1a')]);}_0x3e4630[_0x1088('0x36')]=qs[_0x1088('0x37')](_0x43d6c7[_0x1088('0x2d')][_0x1088('0x37')]);_0x3e4630[_0x1088('0x38')]=qs[_0x1088('0x39')](_[_0x1088('0x3a')](_0x43d6c7[_0x1088('0x2d')],_0x104708[_0x1088('0x39')]),_0x27ead4);if(_0x43d6c7[_0x1088('0x2d')][_0x1088('0x3b')]){_0x3e4630[_0x1088('0x38')]=_[_0x1088('0x3c')](_0x3e4630['where'],{'$or':_[_0x1088('0x28')](_0x27ead4,function(_0x955851){if(_0x955851[_0x1088('0x3d')]!==_0x1088('0x3e')){var _0x5ded67={};_0x5ded67[_0x955851['name']]={'$like':'%'+_0x43d6c7[_0x1088('0x2d')][_0x1088('0x3b')]+'%'};return _0x5ded67;}})});}_0x3e4630=_[_0x1088('0x3c')]({},_0x3e4630,_0x43d6c7['options']);var _0x2c3f65={'where':_0x3e4630['where']};return db['ChatTransferReport'][_0x1088('0x1b')](_0x2c3f65)[_0x1088('0x22')](function(_0x152588){_0x8fa8a3[_0x1088('0x1b')]=_0x152588;if(_0x43d6c7['query'][_0x1088('0x3f')]){_0x3e4630[_0x1088('0x40')]=[{'all':!![]}];}return db[_0x1088('0x29')][_0x1088('0x41')](_0x3e4630);})[_0x1088('0x22')](function(_0x593036){_0x8fa8a3['rows']=_0x593036;return _0x8fa8a3;})['then'](respondWithFilteredResult(_0x45d050,_0x3e4630))[_0x1088('0x42')](handleError(_0x45d050,null));};exports[_0x1088('0x43')]=function(_0x33e1bd,_0x135e2e){var _0xf9a196={'raw':!![],'where':{'id':_0x33e1bd[_0x1088('0x44')]['id']}},_0x12caa7={};_0x12caa7[_0x1088('0x2f')]=_[_0x1088('0x2e')](db['ChatTransferReport'][_0x1088('0x2a')]);_0x12caa7['query']=_[_0x1088('0x2e')](_0x33e1bd[_0x1088('0x2d')]);_0x12caa7[_0x1088('0x39')]=_['intersection'](_0x12caa7['model'],_0x12caa7['query']);_0xf9a196[_0x1088('0x30')]=_[_0x1088('0x45')](_0x12caa7['model'],qs[_0x1088('0x31')](_0x33e1bd[_0x1088('0x2d')][_0x1088('0x31')]));_0xf9a196[_0x1088('0x30')]=_0xf9a196[_0x1088('0x30')][_0x1088('0x32')]?_0xf9a196[_0x1088('0x30')]:_0x12caa7[_0x1088('0x2f')];if(_0x33e1bd[_0x1088('0x2d')][_0x1088('0x3f')]){_0xf9a196[_0x1088('0x40')]=[{'all':!![]}];}_0xf9a196=_[_0x1088('0x3c')]({},_0xf9a196,_0x33e1bd[_0x1088('0x46')]);return db[_0x1088('0x29')]['find'](_0xf9a196)[_0x1088('0x22')](handleEntityNotFound(_0x135e2e,null))[_0x1088('0x22')](respondWithResult(_0x135e2e,null))[_0x1088('0x42')](handleError(_0x135e2e,null));};exports[_0x1088('0x47')]=function(_0x1b943c,_0x85e37e){return db['ChatTransferReport'][_0x1088('0x47')](_0x1b943c[_0x1088('0x48')],{})[_0x1088('0x22')](respondWithResult(_0x85e37e,0xc9))[_0x1088('0x42')](handleError(_0x85e37e,null));};exports[_0x1088('0x21')]=function(_0x4bb57b,_0x3386a1){if(_0x4bb57b[_0x1088('0x48')]['id']){delete _0x4bb57b[_0x1088('0x48')]['id'];}return db[_0x1088('0x29')][_0x1088('0x49')]({'where':{'id':_0x4bb57b[_0x1088('0x44')]['id']}})[_0x1088('0x22')](handleEntityNotFound(_0x3386a1,null))['then'](saveUpdates(_0x4bb57b[_0x1088('0x48')],null))[_0x1088('0x22')](respondWithResult(_0x3386a1,null))[_0x1088('0x42')](handleError(_0x3386a1,null));};exports['destroy']=function(_0x332c53,_0x19f071){return db[_0x1088('0x29')]['find']({'where':{'id':_0x332c53[_0x1088('0x44')]['id']}})[_0x1088('0x22')](handleEntityNotFound(_0x19f071,null))[_0x1088('0x22')](removeEntity(_0x19f071,null))['catch'](handleError(_0x19f071,null));};exports[_0x1088('0x4a')]=function(_0x565f0a,_0x43cee8){return db[_0x1088('0x29')]['describe']()[_0x1088('0x22')](respondWithResult(_0x43cee8,null))['catch'](handleError(_0x43cee8,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index af7b134..9a0284c 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 _0x1646=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid'];(function(_0x34daaf,_0x11df92){var _0x3d49d1=function(_0x1671b2){while(--_0x1671b2){_0x34daaf['push'](_0x34daaf['shift']());}};_0x3d49d1(++_0x11df92);}(_0x1646,0x11e));var _0x6164=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x1646[_0x15b399];return _0x199f2d;};'use strict';var _=require(_0x6164('0x0'));var util=require(_0x6164('0x1'));var logger=require(_0x6164('0x2'))(_0x6164('0x3'));var moment=require('moment');var BPromise=require(_0x6164('0x4'));var rp=require(_0x6164('0x5'));var fs=require('fs');var path=require(_0x6164('0x6'));var rimraf=require(_0x6164('0x7'));var config=require(_0x6164('0x8'));var attributes=require(_0x6164('0x9'));module['exports']=function(_0x262f1b,_0x26d669){return _0x262f1b[_0x6164('0xa')](_0x6164('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6164('0xc'),'fields':[_0x6164('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee49=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xee49,0x1ca));var _0x9ee4=function(_0x11bef7,_0x35cfa2){_0x11bef7=_0x11bef7-0x0;var _0x516854=_0xee49[_0x11bef7];return _0x516854;};'use strict';var _=require(_0x9ee4('0x0'));var util=require(_0x9ee4('0x1'));var logger=require(_0x9ee4('0x2'))(_0x9ee4('0x3'));var moment=require(_0x9ee4('0x4'));var BPromise=require(_0x9ee4('0x5'));var rp=require(_0x9ee4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ee4('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x9ee4('0x8')]=function(_0x4a0e3d,_0x4e3185){return _0x4a0e3d[_0x9ee4('0x9')](_0x9ee4('0xa'),attributes,{'tableName':_0x9ee4('0xb'),'paranoid':![],'indexes':[{'name':_0x9ee4('0xc'),'fields':[_0x9ee4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 11c1423..d745157 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 _0xad9e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x4c9734,_0x559b03){var _0x308459=function(_0x5093a3){while(--_0x5093a3){_0x4c9734['push'](_0x4c9734['shift']());}};_0x308459(++_0x559b03);}(_0xad9e,0xe4));var _0xead9=function(_0x28c3d6,_0x4fd2ca){_0x28c3d6=_0x28c3d6-0x0;var _0x13f769=_0xad9e[_0x28c3d6];return _0x13f769;};'use strict';var _=require(_0xead9('0x0'));var util=require(_0xead9('0x1'));var moment=require(_0xead9('0x2'));var BPromise=require('bluebird');var rs=require(_0xead9('0x3'));var fs=require('fs');var Redis=require(_0xead9('0x4'));var db=require(_0xead9('0x5'))['db'];var utils=require(_0xead9('0x6'));var logger=require(_0xead9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xead9('0x8'));var client=jayson[_0xead9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d42d6,_0x31961d,_0x24e951){return new BPromise(function(_0x429288,_0x5a1c81){return client[_0xead9('0xa')](_0x5d42d6,_0x24e951)['then'](function(_0x1f0d50){logger[_0xead9('0xb')](_0xead9('0xc'),_0x31961d,_0xead9('0xd'));logger['debug'](_0xead9('0xe'),_0x31961d,_0xead9('0xd'),JSON[_0xead9('0xf')](_0x1f0d50));if(_0x1f0d50[_0xead9('0x10')]){if(_0x1f0d50['error']['code']===0x1f4){logger[_0xead9('0x10')](_0xead9('0xc'),_0x31961d,_0x1f0d50[_0xead9('0x10')][_0xead9('0x11')]);return _0x5a1c81(_0x1f0d50[_0xead9('0x10')][_0xead9('0x11')]);}logger[_0xead9('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x31961d,_0x1f0d50['error'][_0xead9('0x11')]);return _0x429288(_0x1f0d50['error'][_0xead9('0x11')]);}else{logger[_0xead9('0xb')](_0xead9('0xc'),_0x31961d,_0xead9('0xd'));_0x429288(_0x1f0d50['result'][_0xead9('0x11')]);}})[_0xead9('0x12')](function(_0x1092f6){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x31961d,_0x1092f6);_0x5a1c81(_0x1092f6);});});} \ No newline at end of file +var _0xf008=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5dd5ba,_0x3f14ca){var _0x929129=function(_0x459d45){while(--_0x459d45){_0x5dd5ba['push'](_0x5dd5ba['shift']());}};_0x929129(++_0x3f14ca);}(_0xf008,0xba));var _0x8f00=function(_0x325ffc,_0x6914a7){_0x325ffc=_0x325ffc-0x0;var _0x34324a=_0xf008[_0x325ffc];return _0x34324a;};'use strict';var _=require(_0x8f00('0x0'));var util=require(_0x8f00('0x1'));var moment=require(_0x8f00('0x2'));var BPromise=require(_0x8f00('0x3'));var rs=require(_0x8f00('0x4'));var fs=require('fs');var Redis=require(_0x8f00('0x5'));var db=require(_0x8f00('0x6'))['db'];var utils=require(_0x8f00('0x7'));var logger=require('../../config/logger')(_0x8f00('0x8'));var config=require(_0x8f00('0x9'));var jayson=require(_0x8f00('0xa'));var client=jayson[_0x8f00('0xb')][_0x8f00('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x380e32,_0x3323cd,_0x471fd9){return new BPromise(function(_0x4172f9,_0x5924a6){return client[_0x8f00('0xd')](_0x380e32,_0x471fd9)[_0x8f00('0xe')](function(_0xa00130){logger[_0x8f00('0xf')](_0x8f00('0x10'),_0x3323cd,_0x8f00('0x11'));logger[_0x8f00('0x12')](_0x8f00('0x13'),_0x3323cd,_0x8f00('0x11'),JSON[_0x8f00('0x14')](_0xa00130));if(_0xa00130['error']){if(_0xa00130[_0x8f00('0x15')][_0x8f00('0x16')]===0x1f4){logger[_0x8f00('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x3323cd,_0xa00130['error'][_0x8f00('0x17')]);return _0x5924a6(_0xa00130[_0x8f00('0x15')][_0x8f00('0x17')]);}logger[_0x8f00('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x3323cd,_0xa00130[_0x8f00('0x15')][_0x8f00('0x17')]);return _0x4172f9(_0xa00130['error']['message']);}else{logger[_0x8f00('0xf')](_0x8f00('0x10'),_0x3323cd,_0x8f00('0x11'));_0x4172f9(_0xa00130[_0x8f00('0x18')]['message']);}})[_0x8f00('0x19')](function(_0x55e4a6){logger[_0x8f00('0x15')](_0x8f00('0x10'),_0x3323cd,_0x55e4a6);_0x5924a6(_0x55e4a6);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 9971165..e928e31 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 _0x9cae=['create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x3605e1,_0x15c574){var _0x9f0586=function(_0x4422c4){while(--_0x4422c4){_0x3605e1['push'](_0x3605e1['shift']());}};_0x9f0586(++_0x15c574);}(_0x9cae,0xb9));var _0xe9ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9cae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xe9ca('0x0'));var path=require('path');var timeout=require(_0xe9ca('0x1'));var express=require(_0xe9ca('0x2'));var router=express[_0xe9ca('0x3')]();var fs_extra=require(_0xe9ca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe9ca('0x5'));var config=require(_0xe9ca('0x6'));var controller=require(_0xe9ca('0x7'));router[_0xe9ca('0x8')]('/',auth[_0xe9ca('0x9')](),controller['index']);router[_0xe9ca('0x8')](_0xe9ca('0xa'),auth[_0xe9ca('0x9')](),controller[_0xe9ca('0xb')]);router[_0xe9ca('0x8')](_0xe9ca('0xc'),auth[_0xe9ca('0x9')](),controller[_0xe9ca('0xd')]);router[_0xe9ca('0xe')]('/',auth['isAuthenticated'](),controller[_0xe9ca('0xf')]);router[_0xe9ca('0x10')](_0xe9ca('0xc'),auth[_0xe9ca('0x9')](),controller['update']);router[_0xe9ca('0x11')]('/:id',auth[_0xe9ca('0x9')](),controller[_0xe9ca('0x12')]);module[_0xe9ca('0x13')]=router; \ No newline at end of file +var _0x7a21=['show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x41b2bb,_0x4324e3){var _0x7e369b=function(_0x39d9e6){while(--_0x39d9e6){_0x41b2bb['push'](_0x41b2bb['shift']());}};_0x7e369b(++_0x4324e3);}(_0x7a21,0x1d6));var _0x17a2=function(_0x317489,_0x4a8108){_0x317489=_0x317489-0x0;var _0x169ab9=_0x7a21[_0x317489];return _0x169ab9;};'use strict';var multer=require(_0x17a2('0x0'));var util=require('util');var path=require(_0x17a2('0x1'));var timeout=require(_0x17a2('0x2'));var express=require(_0x17a2('0x3'));var router=express[_0x17a2('0x4')]();var fs_extra=require(_0x17a2('0x5'));var auth=require(_0x17a2('0x6'));var interaction=require(_0x17a2('0x7'));var config=require('../../config/environment');var controller=require(_0x17a2('0x8'));router['get']('/',auth[_0x17a2('0x9')](),controller[_0x17a2('0xa')]);router[_0x17a2('0xb')](_0x17a2('0xc'),auth[_0x17a2('0x9')](),controller['describe']);router['get'](_0x17a2('0xd'),auth[_0x17a2('0x9')](),controller[_0x17a2('0xe')]);router[_0x17a2('0xf')]('/',auth[_0x17a2('0x9')](),controller[_0x17a2('0x10')]);router[_0x17a2('0x11')](_0x17a2('0xd'),auth[_0x17a2('0x9')](),controller[_0x17a2('0x12')]);router[_0x17a2('0x13')]('/:id',auth[_0x17a2('0x9')](),controller[_0x17a2('0x14')]);module[_0x17a2('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index d5da5a8..7c48298 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 _0xe412=['Skip','BOOLEAN','Feedback','thumb','star','stringify','name','text','input','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!'];(function(_0xdb4417,_0x2b9887){var _0x1af27e=function(_0x3337d2){while(--_0x3337d2){_0xdb4417['push'](_0xdb4417['shift']());}};_0x1af27e(++_0x2b9887);}(_0xe412,0x150));var _0x2e41=function(_0x475cf3,_0x3dbba6){_0x475cf3=_0x475cf3-0x0;var _0x482982=_0xe412[_0x475cf3];return _0x482982;};'use strict';var Sequelize=require(_0x2e41('0x0'));var rs=require(_0x2e41('0x1'));module[_0x2e41('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x2e41('0x3')],'allowNull':![],'unique':_0x2e41('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x5')},'mapKeyOffline':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2e41('0x3')],'allowNull':![],'defaultValue':_0x2e41('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2e41('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e41('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2e41('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2e41('0xa')]('rounded',_0x2e41('0xb')),'defaultValue':_0x2e41('0xc')},'header_online':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xd')},'start_chat_button':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xe')},'header_offline':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2e41('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x12')},'placeholderMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x13')},'closingMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x14')},'closingMessageButton':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x2e41('0x15')},'conditionAgreement':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x17')},'ratingType':{'type':Sequelize[_0x2e41('0xa')]('star',_0x2e41('0x18')),'defaultValue':_0x2e41('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':function(){return JSON[_0x2e41('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x2e41('0x1b'),'type':_0x2e41('0x1c'),'required':!![]},'props':{'title':_0x2e41('0x1b'),'helpText':''}},{'type':_0x2e41('0x1d'),'props':{'title':_0x2e41('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2e41('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2e41('0x1e')](_0x2e41('0x1f'))?JSON[_0x2e41('0x20')](this[_0x2e41('0x1e')](_0x2e41('0x1f'))):{};},'set':function(_0x350132){return this[_0x2e41('0x21')](_0x2e41('0x1f'),JSON[_0x2e41('0x1a')](_0x350132));}},'offlineForm':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':function(){return JSON[_0x2e41('0x1a')]({'items':[{'type':_0x2e41('0x1d'),'props':{'title':_0x2e41('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2e41('0x5'),'type':_0x2e41('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x2e41('0x22')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x2e41('0x1e')](_0x2e41('0x23'))?JSON[_0x2e41('0x20')](this['getDataValue']('offlineForm')):{};},'set':function(_0x12676a){return this[_0x2e41('0x21')](_0x2e41('0x23'),JSON[_0x2e41('0x1a')](_0x12676a));}},'token':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':function(){return rs[_0x2e41('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2e41('0x3')]},'forwardOffline':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x25')},'waitingMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2e41('0x26')},'skipUnmanaged':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x15')},'sendUnmanaged':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':function(){return _0x2e41('0x27');}},'notificationSound':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x28')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x29')},'verticalAlignment':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2e41('0x2a')},'defaultTitle':{'type':Sequelize[_0x2e41('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e41('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2e41('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x2c')},'systemAvatar':{'type':Sequelize[_0x2e41('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2e41('0x9')],'comment':_0x2e41('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![],'comment':_0x2e41('0x2e'),'set':function(_0x3c3353){if(!_0x3c3353)this[_0x2e41('0x21')](_0x2e41('0x2f'),null);this[_0x2e41('0x21')](_0x2e41('0x30'),_0x3c3353);}},'vidaooEscalation':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2e41('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e41('0x31')},'vidaooNote':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':function(){return _0x2e41('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2e41('0x10')]}}; \ No newline at end of file +var _0x7932=['STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Feedback','thumb','star','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','parse','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports'];(function(_0x3e6901,_0x352dab){var _0xf04c26=function(_0x5c931c){while(--_0x5c931c){_0x3e6901['push'](_0x3e6901['shift']());}};_0xf04c26(++_0x352dab);}(_0x7932,0x14e));var _0x2793=function(_0xca2d0c,_0x27bcce){_0xca2d0c=_0xca2d0c-0x0;var _0x221fa8=_0x7932[_0xca2d0c];return _0x221fa8;};'use strict';var Sequelize=require(_0x2793('0x0'));var rs=require('randomstring');module[_0x2793('0x1')]={'name':{'type':Sequelize[_0x2793('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'unique':_0x2793('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x2793('0x4')},'mapKeyOffline':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x4')},'key':{'type':Sequelize[_0x2793('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'defaultValue':_0x2793('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'defaultValue':_0x2793('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2793('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2793('0x2')]},'animation':{'type':Sequelize[_0x2793('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2793('0xa')](_0x2793('0xb'),_0x2793('0xc')),'defaultValue':_0x2793('0xb')},'header_online':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0xd')},'offline_chat_button':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2793('0xf')]},'closingQuestion':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2793('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x12')},'placeholderMessage':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x13')},'closingMessage':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x14')},'closingMessageButton':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x15')},'skipMessageButton':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x16')},'ratingType':{'type':Sequelize[_0x2793('0xa')]('star',_0x2793('0x17')),'defaultValue':_0x2793('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x2793('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x2793('0x19')]({'items':[{'type':_0x2793('0x1a'),'variable':null,'config':{'placeholder':_0x2793('0x1b'),'type':_0x2793('0x1c'),'required':!![]},'props':{'title':_0x2793('0x1b'),'helpText':''}},{'type':_0x2793('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2793('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2793('0x1d')](_0x2793('0x1e'))?JSON['parse'](this[_0x2793('0x1d')](_0x2793('0x1e'))):{};},'set':function(_0xdcc759){return this[_0x2793('0x1f')](_0x2793('0x1e'),JSON[_0x2793('0x19')](_0xdcc759));}},'offlineForm':{'type':Sequelize[_0x2793('0xf')],'defaultValue':function(){return JSON[_0x2793('0x19')]({'items':[{'type':_0x2793('0x1a'),'props':{'title':_0x2793('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x2793('0x4'),'type':_0x2793('0x4')},'variable':null},{'type':_0x2793('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0x2793('0x21'),'helpText':_0x2793('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x2793('0x1d')]('offlineForm')?JSON[_0x2793('0x23')](this[_0x2793('0x1d')]('offlineForm')):{};},'set':function(_0x7026b){return this[_0x2793('0x1f')]('offlineForm',JSON[_0x2793('0x19')](_0x7026b));}},'token':{'type':Sequelize[_0x2793('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2793('0x2')]},'forwardOffline':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2793('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x25')},'offlineMessageBody':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x2793('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2793('0x27')},'skipUnmanaged':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2793('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2793('0xf')],'defaultValue':function(){return _0x2793('0x28');}},'notificationSound':{'type':Sequelize[_0x2793('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x2793('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x2793('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x2a')},'verticalAlignment':{'type':Sequelize[_0x2793('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x2793('0x2')]},'customerAvatar':{'type':Sequelize[_0x2793('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2793('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2793('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2793('0x2b')},'systemAvatar':{'type':Sequelize[_0x2793('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2793('0x8')],'comment':_0x2793('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2793('0x2d'),'set':function(_0x41290f){if(!_0x41290f)this[_0x2793('0x1f')](_0x2793('0x2e'),null);this[_0x2793('0x1f')]('mandatoryDisposition',_0x41290f);}},'vidaooEscalation':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2793('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'defaultValue':_0x2793('0x2f')},'vidaooNote':{'type':Sequelize[_0x2793('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x2793('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2793('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 7a4face..ceabed7 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 _0x9388=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','end','json','offset','limit','undefined','set','Content-Range','apply','save','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','include','findAll','rows','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','body','describe','ChatWebsiteId','Disposition','getDispositions','findOne','order','count','removeDispositions','CannedAnswer','getAnswers','includeAll','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','CmContact','Contacts','DESC','account','applications','Applications','list','orderBy','contact','headers','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','unknown','version','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','MailAccount','Smtp','service','host','port','secure','pass','SendMail','sendMail','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','ids','getInteractions','Contact','Owner','internal','Tag','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','License','all','some','server/files/chat/iframe.ejs','remote','stringify','x-real-ip','referer','virtual','replace','render','alignment','textColor','color_button','addApplications','sequelize','ChatApplication','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','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/license/util','redis'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x9388,0x10f));var _0x8938=function(_0x2cc555,_0x44123b){_0x2cc555=_0x2cc555-0x0;var _0xb43253=_0x9388[_0x2cc555];return _0xb43253;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8938('0x0'));var zipdir=require(_0x8938('0x1'));var jsonpatch=require(_0x8938('0x2'));var rp=require(_0x8938('0x3'));var moment=require(_0x8938('0x4'));var BPromise=require(_0x8938('0x5'));var Mustache=require(_0x8938('0x6'));var util=require(_0x8938('0x7'));var path=require(_0x8938('0x8'));var sox=require('sox');var csv=require(_0x8938('0x9'));var ejs=require(_0x8938('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8938('0xb'));var crypto=require(_0x8938('0xc'));var jsforce=require(_0x8938('0xd'));var deskjs=require(_0x8938('0xe'));var toCsv=require(_0x8938('0x9'));var querystring=require(_0x8938('0xf'));var Papa=require('papaparse');var Redis=require(_0x8938('0x10'));var authService=require(_0x8938('0x11'));var qs=require(_0x8938('0x12'));var as=require(_0x8938('0x13'));var hardwareService=require(_0x8938('0x14'));var logger=require(_0x8938('0x15'))(_0x8938('0x16'));var utils=require(_0x8938('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8938('0x18'));var db=require('../../mysqldb')['db'];config[_0x8938('0x19')]=_[_0x8938('0x1a')](config[_0x8938('0x19')],{'host':_0x8938('0x1b'),'port':0x18eb});var socket=require(_0x8938('0x1c'))(new Redis(config[_0x8938('0x19')]));require(_0x8938('0x1d'))[_0x8938('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8938('0x1f')][_0x8938('0x20')]({'port':0x232c});var client9002=jayson[_0x8938('0x1f')]['http']({'port':0x232a});var client9003=jayson[_0x8938('0x1f')][_0x8938('0x20')]({'port':0x232b});var client9001=jayson[_0x8938('0x1f')][_0x8938('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x570fed,_0x60346,_0x12689f,_0x4af5ee){return new BPromise(function(_0x5c9bcf,_0x2d9a3f){var _0x45bfa6=_0x4af5ee||client;return _0x45bfa6[_0x8938('0x21')](_0x570fed,_0x12689f)[_0x8938('0x22')](function(_0x61e6ea){logger['info'](_0x8938('0x23'),_0x60346,_0x8938('0x24'));logger[_0x8938('0x25')](_0x8938('0x26'),_0x60346,'request\x20sent',JSON['stringify'](_0x61e6ea));if(_0x61e6ea[_0x8938('0x27')]){if(_0x61e6ea[_0x8938('0x27')]['code']===0x1f4){logger['error'](_0x8938('0x23'),_0x60346,_0x61e6ea[_0x8938('0x27')][_0x8938('0x28')]);return _0x2d9a3f(_0x61e6ea[_0x8938('0x27')]['message']);}logger[_0x8938('0x27')](_0x8938('0x23'),_0x60346,_0x61e6ea[_0x8938('0x27')][_0x8938('0x28')]);return _0x5c9bcf(_0x61e6ea[_0x8938('0x27')]['message']);}else{logger[_0x8938('0x29')](_0x8938('0x23'),_0x60346,_0x8938('0x24'));_0x5c9bcf(_0x61e6ea[_0x8938('0x2a')][_0x8938('0x28')]);}})[_0x8938('0x2b')](function(_0x5c91a0){logger['error'](_0x8938('0x23'),_0x60346,_0x5c91a0);_0x2d9a3f(_0x5c91a0);});});}function respondWithStatusCode(_0xd26d0d,_0x2a15e0){_0x2a15e0=_0x2a15e0||0xcc;return function(_0x216d52){if(_0x216d52){return _0xd26d0d['sendStatus'](_0x2a15e0);}return _0xd26d0d[_0x8938('0x2c')](_0x2a15e0)[_0x8938('0x2d')]();};}function respondWithResult(_0x1ce863,_0x5ba877){_0x5ba877=_0x5ba877||0xc8;return function(_0x7ba87a){if(_0x7ba87a){return _0x1ce863[_0x8938('0x2c')](_0x5ba877)[_0x8938('0x2e')](_0x7ba87a);}};}function respondWithFilteredResult(_0xa1b664,_0x4da873){return function(_0x46881b){if(_0x46881b){var _0x12d72a=typeof _0x4da873[_0x8938('0x2f')]==='undefined'&&typeof _0x4da873[_0x8938('0x30')]===_0x8938('0x31');var _0x304415=_0x46881b['count'];var _0x3bede0=_0x12d72a?0x0:_0x4da873[_0x8938('0x2f')];var _0x16af18=_0x12d72a?_0x46881b['count']:_0x4da873['offset']+_0x4da873[_0x8938('0x30')];var _0x29b02b;if(_0x16af18>=_0x304415){_0x16af18=_0x304415;_0x29b02b=0xc8;}else{_0x29b02b=0xce;}_0xa1b664[_0x8938('0x2c')](_0x29b02b);return _0xa1b664[_0x8938('0x32')](_0x8938('0x33'),_0x3bede0+'-'+_0x16af18+'/'+_0x304415)[_0x8938('0x2e')](_0x46881b);}return null;};}function patchUpdates(_0x4cb898){return function(_0x22ef84){try{jsonpatch[_0x8938('0x34')](_0x22ef84,_0x4cb898,!![]);}catch(_0x9bdb9){return BPromise['reject'](_0x9bdb9);}return _0x22ef84[_0x8938('0x35')]();};}function saveUpdates(_0x36c91c,_0x4942f2){return function(_0x5d5d44){if(_0x5d5d44){return _0x5d5d44[_0x8938('0x36')](_0x36c91c)[_0x8938('0x22')](function(_0x1753ce){return _0x1753ce;});}return null;};}function removeEntity(_0x135910,_0x4d83f9){return function(_0x1d3a36){if(_0x1d3a36){return _0x1d3a36['destroy']()['then'](function(){var _0x27d80b=_0x1d3a36[_0x8938('0x37')]({'plain':!![]});var _0x12a93b=_0x8938('0x38');return db[_0x8938('0x39')][_0x8938('0x3a')]({'where':{'type':_0x12a93b,'resourceId':_0x27d80b['id']}})[_0x8938('0x22')](function(){return _0x1d3a36;});})[_0x8938('0x22')](function(){_0x135910['status'](0xcc)[_0x8938('0x2d')]();});}};}function handleEntityNotFound(_0xe4fe40,_0xeb5724){return function(_0xd3df2){if(!_0xd3df2){_0xe4fe40[_0x8938('0x3b')](0x194);}return _0xd3df2;};}function handleError(_0x46171c,_0x16c359){_0x16c359=_0x16c359||0x1f4;return function(_0x8807c3){logger['error'](_0x8807c3[_0x8938('0x3c')]);if(_0x8807c3[_0x8938('0x3d')]){delete _0x8807c3[_0x8938('0x3d')];}_0x46171c[_0x8938('0x2c')](_0x16c359)[_0x8938('0x3e')](_0x8807c3);};}exports['index']=function(_0x3fdaba,_0x2f1e96){var _0x19dc86={'include':[{'model':db[_0x8938('0x3f')],'as':_0x8938('0x40')}]},_0x42a386={},_0x649414={'count':0x0,'rows':[]};var _0x1289df=_[_0x8938('0x41')](db[_0x8938('0x42')][_0x8938('0x43')],function(_0x30c942){return{'name':_0x30c942[_0x8938('0x44')],'type':_0x30c942[_0x8938('0x45')][_0x8938('0x46')]};});_0x42a386[_0x8938('0x47')]=_['map'](_0x1289df,_0x8938('0x3d'));_0x42a386['query']=_['keys'](_0x3fdaba[_0x8938('0x48')]);_0x42a386['filters']=_[_0x8938('0x49')](_0x42a386[_0x8938('0x47')],_0x42a386[_0x8938('0x48')]);_0x19dc86['attributes']=_[_0x8938('0x49')](_0x42a386['model'],qs['fields'](_0x3fdaba[_0x8938('0x48')][_0x8938('0x4a')]));_0x19dc86[_0x8938('0x4b')]=_0x19dc86[_0x8938('0x4b')][_0x8938('0x4c')]?_0x19dc86[_0x8938('0x4b')]:_0x42a386[_0x8938('0x47')];if(!_0x3fdaba[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x19dc86['limit']=qs[_0x8938('0x30')](_0x3fdaba['query']['limit']);_0x19dc86[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x3fdaba[_0x8938('0x48')]['offset']);}_0x19dc86['order']=qs[_0x8938('0x4f')](_0x3fdaba['query'][_0x8938('0x4f')]);_0x19dc86[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x3fdaba[_0x8938('0x48')],_0x42a386[_0x8938('0x51')]),_0x1289df);if(_0x3fdaba[_0x8938('0x48')]['filter']){_0x19dc86[_0x8938('0x50')]=_[_0x8938('0x53')](_0x19dc86[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x1289df,function(_0x2b9bea){if(_0x2b9bea[_0x8938('0x45')]!=='VIRTUAL'){var _0x57cd6e={};_0x57cd6e[_0x2b9bea[_0x8938('0x3d')]]={'$like':'%'+_0x3fdaba[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x57cd6e;}})});}_0x19dc86=_[_0x8938('0x53')]({},_0x19dc86,_0x3fdaba[_0x8938('0x55')]);var _0x2ec187={'where':_0x19dc86[_0x8938('0x50')]};return db[_0x8938('0x42')]['count'](_0x2ec187)['then'](function(_0x44793a){_0x649414['count']=_0x44793a;if(_0x3fdaba[_0x8938('0x48')]['includeAll']){_0x19dc86[_0x8938('0x56')]=[{'all':!![]}];}return db[_0x8938('0x42')][_0x8938('0x57')](_0x19dc86);})[_0x8938('0x22')](function(_0x2848f2){_0x649414[_0x8938('0x58')]=_0x2848f2;return _0x649414;})[_0x8938('0x22')](respondWithFilteredResult(_0x2f1e96,_0x19dc86))[_0x8938('0x2b')](handleError(_0x2f1e96,null));};exports[_0x8938('0x59')]=function(_0x2beeb5,_0x394f03){var _0x34ae55={'raw':![],'where':{'id':_0x2beeb5[_0x8938('0x5a')]['id']},'include':[{'model':db[_0x8938('0x3f')],'as':_0x8938('0x40')}]},_0x33bef5={};_0x33bef5[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0x42')][_0x8938('0x43')]);_0x33bef5[_0x8938('0x48')]=_[_0x8938('0x5b')](_0x2beeb5[_0x8938('0x48')]);_0x33bef5['filters']=_[_0x8938('0x49')](_0x33bef5[_0x8938('0x47')],_0x33bef5[_0x8938('0x48')]);_0x34ae55[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x33bef5[_0x8938('0x47')],qs['fields'](_0x2beeb5['query'][_0x8938('0x4a')]));_0x34ae55[_0x8938('0x4b')]=_0x34ae55['attributes'][_0x8938('0x4c')]?_0x34ae55[_0x8938('0x4b')]:_0x33bef5[_0x8938('0x47')];if(_0x2beeb5[_0x8938('0x48')]['includeAll']){_0x34ae55[_0x8938('0x56')]=[{'all':!![]}];}_0x34ae55=_[_0x8938('0x53')]({},_0x34ae55,_0x2beeb5[_0x8938('0x55')]);return db['ChatWebsite'][_0x8938('0x5c')](_0x34ae55)[_0x8938('0x22')](handleEntityNotFound(_0x394f03,null))[_0x8938('0x22')](respondWithResult(_0x394f03,null))[_0x8938('0x2b')](handleError(_0x394f03,null));};exports[_0x8938('0x5d')]=function(_0x470287,_0x49f60e){return db[_0x8938('0x42')][_0x8938('0x5d')](_0x470287['body'],{})[_0x8938('0x22')](function(_0x117e89){var _0x4add37=_0x470287[_0x8938('0x5e')][_0x8938('0x37')]({'plain':!![]});if(!_0x4add37)throw new Error(_0x8938('0x5f'));if(_0x4add37['role']==='user'){var _0x3114af=_0x117e89[_0x8938('0x37')]({'plain':!![]});var _0x2be453=_0x8938('0x38');return db['UserProfileSection'][_0x8938('0x5c')]({'where':{'name':_0x2be453,'userProfileId':_0x4add37['userProfileId']},'raw':!![]})[_0x8938('0x22')](function(_0x53fb3c){if(_0x53fb3c&&_0x53fb3c[_0x8938('0x60')]===0x0){return db[_0x8938('0x39')]['create']({'name':_0x3114af[_0x8938('0x3d')],'resourceId':_0x3114af['id'],'type':_0x53fb3c['name'],'sectionId':_0x53fb3c['id']},{})[_0x8938('0x22')](function(){return _0x117e89;});}else{return _0x117e89;}})[_0x8938('0x2b')](function(_0x2ba94a){logger[_0x8938('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ba94a);throw _0x2ba94a;});}return _0x117e89;})[_0x8938('0x22')](respondWithResult(_0x49f60e,0xc9))[_0x8938('0x2b')](handleError(_0x49f60e,null));};exports[_0x8938('0x36')]=function(_0x598386,_0x78cd39){if(_0x598386[_0x8938('0x61')]['id']){delete _0x598386[_0x8938('0x61')]['id'];}return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x598386[_0x8938('0x5a')]['id']},'include':[{'model':db[_0x8938('0x3f')],'as':_0x8938('0x40')}]})['then'](handleEntityNotFound(_0x78cd39,null))[_0x8938('0x22')](saveUpdates(_0x598386[_0x8938('0x61')],null))[_0x8938('0x22')](respondWithResult(_0x78cd39,null))['catch'](handleError(_0x78cd39,null));};exports[_0x8938('0x3a')]=function(_0x513907,_0x3b3779){return db[_0x8938('0x42')]['find']({'where':{'id':_0x513907[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3b3779,null))[_0x8938('0x22')](removeEntity(_0x3b3779,null))[_0x8938('0x2b')](handleError(_0x3b3779,null));};exports[_0x8938('0x62')]=function(_0x54e8e1,_0x4544f0){return db[_0x8938('0x42')][_0x8938('0x62')]()[_0x8938('0x22')](respondWithResult(_0x4544f0,null))['catch'](handleError(_0x4544f0,null));};exports['addDisposition']=function(_0x1a29f7,_0x42588c,_0x836e56){if(_0x1a29f7[_0x8938('0x61')]['id']){delete _0x1a29f7[_0x8938('0x61')]['id'];}return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x1a29f7[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x42588c,null))[_0x8938('0x22')](function(_0x210c1d){if(_0x210c1d){_0x1a29f7[_0x8938('0x61')][_0x8938('0x63')]=_0x210c1d['id'];return db[_0x8938('0x64')][_0x8938('0x5d')](_0x1a29f7['body']);}})[_0x8938('0x22')](respondWithResult(_0x42588c,null))[_0x8938('0x2b')](handleError(_0x42588c,null));};exports[_0x8938('0x65')]=function(_0x3a33b4,_0x4f8d78,_0x5be9ad){var _0x4ae9f4={'raw':![],'where':{}};var _0x45fb3c={};var _0x5d50fa={'count':0x0,'rows':[]};return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x3a33b4[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x4f8d78,null))[_0x8938('0x22')](function(_0x13edd2){if(_0x13edd2){_0x45fb3c[_0x8938('0x47')]=_[_0x8938('0x5b')](db['Disposition'][_0x8938('0x43')]);_0x45fb3c[_0x8938('0x48')]=_['keys'](_0x3a33b4[_0x8938('0x48')]);_0x45fb3c[_0x8938('0x51')]=_['intersection'](_0x45fb3c['model'],_0x45fb3c[_0x8938('0x48')]);_0x4ae9f4[_0x8938('0x4b')]=_['intersection'](_0x45fb3c['model'],qs['fields'](_0x3a33b4[_0x8938('0x48')][_0x8938('0x4a')]));_0x4ae9f4[_0x8938('0x4b')]=_0x4ae9f4[_0x8938('0x4b')][_0x8938('0x4c')]?_0x4ae9f4[_0x8938('0x4b')]:_0x45fb3c['model'];if(!_0x3a33b4[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x4ae9f4[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x3a33b4[_0x8938('0x48')][_0x8938('0x30')]);_0x4ae9f4[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x3a33b4[_0x8938('0x48')]['offset']);}_0x4ae9f4[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x3a33b4[_0x8938('0x48')][_0x8938('0x4f')]);_0x4ae9f4['where']=qs['filters'](_['pick'](_0x3a33b4[_0x8938('0x48')],_0x45fb3c[_0x8938('0x51')]));_0x4ae9f4['where'][_0x8938('0x63')]=_0x13edd2['id'];if(_0x3a33b4[_0x8938('0x48')][_0x8938('0x54')]){_0x4ae9f4[_0x8938('0x50')]=_[_0x8938('0x53')](_0x4ae9f4[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x4ae9f4[_0x8938('0x4b')],function(_0x4f2f86){var _0x1da87f={};_0x1da87f[_0x4f2f86]={'$like':'%'+_0x3a33b4[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x1da87f;})});}_0x4ae9f4=_[_0x8938('0x53')]({},_0x4ae9f4,_0x3a33b4[_0x8938('0x55')]);return db[_0x8938('0x64')][_0x8938('0x68')]({'where':_0x4ae9f4[_0x8938('0x50')]})['then'](function(_0x4d4211){_0x5d50fa[_0x8938('0x68')]=_0x4d4211;if(_0x3a33b4[_0x8938('0x48')]['includeAll']){_0x4ae9f4['include']=[{'all':!![]}];}return db[_0x8938('0x64')][_0x8938('0x57')](_0x4ae9f4);})[_0x8938('0x22')](function(_0x32d353){_0x5d50fa[_0x8938('0x58')]=_0x32d353;return _0x5d50fa;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x4f8d78,_0x4ae9f4))['catch'](handleError(_0x4f8d78,null));};exports[_0x8938('0x69')]=function(_0x27618b,_0x429873,_0x35887a){return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x27618b['params']['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x429873,null))[_0x8938('0x22')](function(_0x4c4be2){if(_0x4c4be2){return _0x4c4be2['removeDispositions'](_0x27618b['query']['ids']);}})['then'](respondWithStatusCode(_0x429873,null))[_0x8938('0x2b')](handleError(_0x429873,null));};exports['addAnswer']=function(_0x36215b,_0x5be8f3,_0x5a461a){if(_0x36215b[_0x8938('0x61')]['id']){delete _0x36215b[_0x8938('0x61')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x36215b[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x5be8f3,null))[_0x8938('0x22')](function(_0x16de85){if(_0x16de85){_0x36215b['body']['ChatWebsiteId']=_0x16de85['id'];return db[_0x8938('0x6a')]['create'](_0x36215b[_0x8938('0x61')]);}})['then'](respondWithResult(_0x5be8f3,null))['catch'](handleError(_0x5be8f3,null));};exports[_0x8938('0x6b')]=function(_0x54eac4,_0x1e2782,_0x353b96){var _0x4e6102={'raw':![],'where':{}};var _0x4ea1cd={};var _0x521029={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8938('0x66')]({'where':{'id':_0x54eac4[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1e2782,null))[_0x8938('0x22')](function(_0x5704be){if(_0x5704be){_0x4ea1cd['model']=_['keys'](db['CannedAnswer'][_0x8938('0x43')]);_0x4ea1cd[_0x8938('0x48')]=_[_0x8938('0x5b')](_0x54eac4[_0x8938('0x48')]);_0x4ea1cd[_0x8938('0x51')]=_[_0x8938('0x49')](_0x4ea1cd[_0x8938('0x47')],_0x4ea1cd[_0x8938('0x48')]);_0x4e6102[_0x8938('0x4b')]=_['intersection'](_0x4ea1cd[_0x8938('0x47')],qs[_0x8938('0x4a')](_0x54eac4[_0x8938('0x48')][_0x8938('0x4a')]));_0x4e6102[_0x8938('0x4b')]=_0x4e6102['attributes'][_0x8938('0x4c')]?_0x4e6102[_0x8938('0x4b')]:_0x4ea1cd[_0x8938('0x47')];if(!_0x54eac4['query'][_0x8938('0x4d')](_0x8938('0x4e'))){_0x4e6102[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x54eac4[_0x8938('0x48')][_0x8938('0x30')]);_0x4e6102['offset']=qs['offset'](_0x54eac4['query'][_0x8938('0x2f')]);}_0x4e6102['order']=qs[_0x8938('0x4f')](_0x54eac4[_0x8938('0x48')]['sort']);_0x4e6102[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x54eac4[_0x8938('0x48')],_0x4ea1cd[_0x8938('0x51')]));_0x4e6102['where'][_0x8938('0x63')]=_0x5704be['id'];if(_0x54eac4[_0x8938('0x48')][_0x8938('0x54')]){_0x4e6102[_0x8938('0x50')]=_['merge'](_0x4e6102[_0x8938('0x50')],{'$or':_['map'](_0x4e6102[_0x8938('0x4b')],function(_0x9f6e64){var _0xf898de={};_0xf898de[_0x9f6e64]={'$like':'%'+_0x54eac4[_0x8938('0x48')]['filter']+'%'};return _0xf898de;})});}_0x4e6102=_[_0x8938('0x53')]({},_0x4e6102,_0x54eac4[_0x8938('0x55')]);return db['CannedAnswer'][_0x8938('0x68')]({'where':_0x4e6102[_0x8938('0x50')]})['then'](function(_0x122393){_0x521029[_0x8938('0x68')]=_0x122393;if(_0x54eac4[_0x8938('0x48')][_0x8938('0x6c')]){_0x4e6102[_0x8938('0x56')]=[{'all':!![]}];}return db[_0x8938('0x6a')]['findAll'](_0x4e6102);})['then'](function(_0xb7a065){_0x521029[_0x8938('0x58')]=_0xb7a065;return _0x521029;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x1e2782,_0x4e6102))[_0x8938('0x2b')](handleError(_0x1e2782,null));};exports[_0x8938('0x6d')]=function(_0xe0c93c,_0x2c599e,_0x37327b){return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0xe0c93c[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2c599e,null))[_0x8938('0x22')](function(_0x31431b){if(_0x31431b){return _0x31431b['removeAnswers'](_0xe0c93c['query']['ids']);}})[_0x8938('0x22')](respondWithStatusCode(_0x2c599e,null))['catch'](handleError(_0x2c599e,null));};exports[_0x8938('0x6e')]=function(_0x51ab83,_0x582664,_0x1b0443){_0x51ab83['body'][_0x8938('0x6f')]=_0x51ab83[_0x8938('0x70')]['filename'];return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0x51ab83[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x582664,null))[_0x8938('0x22')](saveUpdates(_0x51ab83[_0x8938('0x61')],null))['then'](respondWithResult(_0x582664,null))[_0x8938('0x2b')](handleError(_0x582664,null));};exports[_0x8938('0x71')]=function(_0x108654,_0x3382c7,_0x2beb91){_0x108654['body'][_0x8938('0x72')]=_0x108654['file']['filename'];return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x108654[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x3382c7,null))[_0x8938('0x22')](saveUpdates(_0x108654['body'],null))[_0x8938('0x22')](respondWithResult(_0x3382c7,null))[_0x8938('0x2b')](handleError(_0x3382c7,null));};exports[_0x8938('0x73')]=function(_0x27d0e8,_0x47fa47,_0x3e2a99){_0x27d0e8[_0x8938('0x61')][_0x8938('0x74')]=_0x27d0e8['file'][_0x8938('0x75')];return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x27d0e8[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x47fa47,null))[_0x8938('0x22')](saveUpdates(_0x27d0e8[_0x8938('0x61')],null))['then'](respondWithResult(_0x47fa47,null))[_0x8938('0x2b')](handleError(_0x47fa47,null));};exports[_0x8938('0x76')]=function(_0x384557,_0x24e30f,_0x57b2db){_0x384557['body'][_0x8938('0x77')]=_0x384557[_0x8938('0x70')]['filename'];return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x384557[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x24e30f,null))[_0x8938('0x22')](saveUpdates(_0x384557[_0x8938('0x61')],null))['then'](respondWithResult(_0x24e30f,null))[_0x8938('0x2b')](handleError(_0x24e30f,null));};exports[_0x8938('0x78')]=function(_0x4f1699,_0x383b8d,_0x40a570){var _0x216e59=path[_0x8938('0x79')](config['root'],'server/files/images/logos/default_logo.svg');var _0x56c1e3={'where':{'id':_0x4f1699[_0x8938('0x5a')]['id']},'attributes':['id',_0x8938('0x6f')],'raw':!![]};var _0x36d889=![];return require(_0x8938('0x18'))[_0x8938('0x7a')]()[_0x8938('0x22')](function(_0x320974){if(_0x320974){_0x36d889=_0x320974[_0x8938('0x7b')];}})[_0x8938('0x22')](function(){return db[_0x8938('0x42')][_0x8938('0x5c')](_0x56c1e3);})[_0x8938('0x22')](handleEntityNotFound(_0x383b8d,null))[_0x8938('0x22')](function(_0x1dbe5e){if(_0x1dbe5e){if(!_[_0x8938('0x7c')](_0x1dbe5e[_0x8938('0x6f')])){if(fs[_0x8938('0x7d')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x7f'),_0x1dbe5e['sitepic']))&&_0x36d889){_0x216e59=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x7f'),_0x1dbe5e['sitepic']);}}return _0x383b8d[_0x8938('0x80')](_0x216e59);}})['catch'](handleError(_0x383b8d,null));};exports['getAvatar']=function(_0x595312,_0x276daf,_0x2872b6){var _0x1398bd=path['join'](config['root'],_0x8938('0x81'));var _0xdfddff={'where':{'id':_0x595312[_0x8938('0x5a')]['id']},'attributes':['id',_0x8938('0x72')],'raw':!![]};return db[_0x8938('0x42')][_0x8938('0x5c')](_0xdfddff)[_0x8938('0x22')](handleEntityNotFound(_0x276daf,null))[_0x8938('0x22')](function(_0x40b822){if(_0x40b822){if(!_[_0x8938('0x7c')](_0x40b822[_0x8938('0x72')])){if(fs[_0x8938('0x7d')](path['join'](config[_0x8938('0x7e')],_0x8938('0x82'),_0x40b822[_0x8938('0x72')]))){_0x1398bd=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x82'),_0x40b822['agentAvatar']);}}return _0x276daf[_0x8938('0x80')](_0x1398bd);}})[_0x8938('0x2b')](handleError(_0x276daf,null));};exports[_0x8938('0x83')]=function(_0x5e979e,_0x413581,_0x168966){var _0x2c4b57=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x84'));var _0x168634={'where':{'id':_0x5e979e['params']['id']},'attributes':['id',_0x8938('0x74'),'showCustomerAvatar'],'raw':!![]};return db[_0x8938('0x42')][_0x8938('0x5c')](_0x168634)[_0x8938('0x22')](handleEntityNotFound(_0x413581,null))[_0x8938('0x22')](function(_0x15d749){if(_0x15d749){if(!_[_0x8938('0x7c')](_0x15d749[_0x8938('0x74')])){if(fs[_0x8938('0x7d')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x82'),_0x15d749[_0x8938('0x74')]))&&_0x15d749['showCustomerAvatar']){_0x2c4b57=path['join'](config['root'],_0x8938('0x82'),_0x15d749[_0x8938('0x74')]);}}return _0x413581[_0x8938('0x80')](_0x2c4b57);}})[_0x8938('0x2b')](handleError(_0x413581,null));};exports['getSystemAvatar']=function(_0x3ee2bb,_0x176850,_0x113d58){var _0x289fa3=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x85'));var _0x42efcf={'where':{'id':_0x3ee2bb['params']['id']},'attributes':['id',_0x8938('0x77')],'raw':!![]};return db['ChatWebsite'][_0x8938('0x5c')](_0x42efcf)['then'](handleEntityNotFound(_0x176850,null))[_0x8938('0x22')](function(_0x1dfe4c){if(_0x1dfe4c){if(!_['isNil'](_0x1dfe4c[_0x8938('0x77')])){if(fs['existsSync'](path['join'](config['root'],_0x8938('0x82'),_0x1dfe4c[_0x8938('0x77')]))){_0x289fa3=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x82'),_0x1dfe4c['systemAvatar']);}}return _0x176850['download'](_0x289fa3);}})['catch'](handleError(_0x176850,null));};exports[_0x8938('0x86')]=function(_0x1f8e4c,_0x5f12d1,_0x58f475){var _0x1dd486=require(_0x8938('0x87'));var _0x43b39b=new _0x1dd486();var _0x10e840=_0x43b39b[_0x8938('0x88')](_0x1f8e4c['headers'][_0x8938('0x89')])[_0x8938('0x8a')]();var _0x3ac59b={'body':_0x1f8e4c[_0x8938('0x61')],'channel':_0x8938('0x8b')};var _0x36f9ed=[];var _0x16199e=[];var _0x463890={};var _0x443d21=![];return db['CmContact'][_0x8938('0x62')]()[_0x8938('0x22')](function(_0x11e339){if(!_0x11e339){throw new db['Sequelize'][(_0x8938('0x8c'))](_0x8938('0x8d'));}_0x36f9ed=_['difference'](_[_0x8938('0x5b')](_0x11e339),['createdAt',_0x8938('0x8e')]);_0x16199e=_[_0x8938('0x8f')](_[_0x8938('0x5b')](_0x11e339),[_0x8938('0x90'),'updatedAt',_0x8938('0x91'),_0x8938('0x92')]);if(_0x1f8e4c[_0x8938('0x61')]['id']){delete _0x1f8e4c[_0x8938('0x61')]['id'];}if(_[_0x8938('0x7c')](_0x1f8e4c[_0x8938('0x61')][_0x8938('0x93')])){throw new db['Sequelize'][(_0x8938('0x8c'))](_0x8938('0x94'));}if(_[_0x8938('0x7c')](_0x1f8e4c[_0x8938('0x61')][_0x8938('0x61')])||_0x1f8e4c[_0x8938('0x61')][_0x8938('0x61')]===''){throw new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0x96'));}if(_[_0x8938('0x7c')](_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')])){throw new db[(_0x8938('0x95'))][(_0x8938('0x8c'))](_0x8938('0x98')+_0x16199e);}if(!_[_0x8938('0x99')](_0x16199e,_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')])){throw new db['Sequelize'][(_0x8938('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16199e);}_0x463890[_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')]]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0x93')];})[_0x8938('0x22')](function(){return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x1f8e4c['params']['id']},'include':[{'model':db['CmList'],'as':_0x8938('0x9a'),'include':[{'model':db[_0x8938('0x9b')],'as':_0x8938('0x9c'),'where':_0x463890,'limit':0x1,'order':[[_0x8938('0x8e'),_0x8938('0x9d')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x5f12d1,null))[_0x8938('0x22')](function(_0xfd3cd6){if(_0xfd3cd6&&_0xfd3cd6['List']){_0x3ac59b[_0x8938('0x9e')]=_0xfd3cd6;_0x3ac59b[_0x8938('0x9f')]=_0xfd3cd6[_0x8938('0xa0')];_0x3ac59b[_0x8938('0xa1')]=_0xfd3cd6[_0x8938('0x9a')];_0x3ac59b[_0x8938('0x9f')]=_[_0x8938('0xa2')](_0x3ac59b['applications'],['priority'],['asc']);if(_0x3ac59b[_0x8938('0x9e')][_0x8938('0xa0')]){delete _0x3ac59b['account']['Applications'];}if(_0x3ac59b[_0x8938('0x9e')][_0x8938('0x9a')]&&_0x3ac59b[_0x8938('0x9e')]['List'][_0x8938('0x9c')][_0x8938('0x4c')]){return _0x3ac59b[_0x8938('0x9e')]['List'][_0x8938('0x9c')][0x0];}var _0x4ab18b=_[_0x8938('0x1a')](_0x1f8e4c[_0x8938('0x61')],{'firstName':_0x1f8e4c['body'][_0x8938('0x93')],'ListId':_0xfd3cd6[_0x8938('0x92')]});_0x4ab18b[_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')]]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0x93')];return db[_0x8938('0x9b')][_0x8938('0x5d')](_0x4ab18b,{'fields':_0x36f9ed,'raw':!![]});}})['then'](handleEntityNotFound(_0x5f12d1,null))['then'](function(_0xb8135d){_0x3ac59b[_0x8938('0xa3')]=_0xb8135d;var _0x3e39dc=_0x1f8e4c[_0x8938('0x61')]['customerIp'];if(_0x1f8e4c[_0x8938('0xa4')]['cf-connecting-ip']){_0x3e39dc=_0x1f8e4c[_0x8938('0xa4')]['cf-connecting-ip'];}else if(_0x1f8e4c['headers']['x-forwarded-for']){_0x3e39dc=_[_0x8938('0xa5')](_0x1f8e4c[_0x8938('0xa4')][_0x8938('0xa6')][_0x8938('0xa7')](','));}if(_0xb8135d){var _0x31cd58={'ContactId':_0xb8135d['id'],'ChatWebsiteId':_0x1f8e4c['params']['id'],'from':(_0xb8135d[_0x8938('0xa8')]||'')+'\x20'+(_0xb8135d[_0x8938('0xa9')]||''),'customerIp':_0x3e39dc,'customerPort':_0x1f8e4c[_0x8938('0xa4')]['x-real-port']?_0x1f8e4c[_0x8938('0xa4')][_0x8938('0xaa')]:null,'referer':_0x1f8e4c[_0x8938('0x61')]['referer'],'browserName':_0x10e840[_0x8938('0xab')][_0x8938('0x3d')]&&_0x10e840[_0x8938('0xab')]['version']?util[_0x8938('0xac')](_0x8938('0xad'),_0x10e840['browser'][_0x8938('0x3d')],_0x10e840['browser']['version']):_0x8938('0xae'),'browserVersion':_0x10e840[_0x8938('0xab')][_0x8938('0xaf')]||'unknown','osName':util['format']('%s\x20%s',_0x10e840['os']['name'],_0x10e840['os'][_0x8938('0xaf')]),'osVersion':_0x10e840['os'][_0x8938('0xaf')],'deviceModel':_0x10e840['device'][_0x8938('0x47')]&&_0x10e840[_0x8938('0xb0')][_0x8938('0xb1')]?util[_0x8938('0xac')](_0x8938('0xb2'),_0x10e840[_0x8938('0xb0')][_0x8938('0x47')],_0x10e840['device'][_0x8938('0xb1')],_0x10e840['device']['type']):null,'deviceVendor':_0x10e840['device'][_0x8938('0xb1')],'deviceType':_0x10e840[_0x8938('0xb0')][_0x8938('0x45')],'formData':JSON['stringify'](_0x1f8e4c[_0x8938('0x61')])};var _0xd6b136={'ChatWebsiteId':_0x1f8e4c['params']['id'],'closed':![]};if(_0x1f8e4c['body'][_0x8938('0xb3')]){_0xd6b136[_0x8938('0xb3')]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb3')];return db[_0x8938('0xb4')][_0x8938('0x5c')]({'where':_0xd6b136})[_0x8938('0x22')](function(_0x5abae8){if(_0x5abae8){return[_0x5abae8,![]];}_0x31cd58[_0x8938('0xb3')]=_0x1f8e4c[_0x8938('0x61')]['threadId'];_0x31cd58[_0x8938('0xb5')]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb5')];return db[_0x8938('0xb4')][_0x8938('0x5d')](_0x31cd58)[_0x8938('0x22')](function(_0x2d5214){return[_0x2d5214,!![]];});});}_0xd6b136['ContactId']=_0xb8135d['id'];if(_0x1f8e4c['body'][_0x8938('0xb6')]&&_0x1f8e4c['body'][_0x8938('0xb6')]['id']){_0xd6b136['id']=_0x1f8e4c['body'][_0x8938('0xb6')]['id'];return db[_0x8938('0xb4')]['find']({'where':_0xd6b136})[_0x8938('0x22')](function(_0xef474f){if(_0xef474f){return[_0xef474f,![]];}return db[_0x8938('0xb4')][_0x8938('0x5d')](_0x31cd58)[_0x8938('0x22')](function(_0x3c975e){return[_0x3c975e,!![]];});});}return db[_0x8938('0xb4')]['create'](_0x31cd58)[_0x8938('0x22')](function(_0x547096){return[_0x547096,!![]];});}})[_0x8938('0xb7')](function(_0x1ee506,_0x5e30a9){if(_0x1ee506){_0x443d21=_0x5e30a9;if(!_0x5e30a9){var _0x3ff221={'from':(_0x3ac59b['contact']['firstName']||'')+'\x20'+(_0x3ac59b[_0x8938('0xa3')][_0x8938('0xa9')]||'')};if(_0x1f8e4c[_0x8938('0x61')]['threadId']&&_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb8')]&&_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb3')]!=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb8')]){_0x3ff221[_0x8938('0xb3')]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb8')];}return _0x1ee506[_0x8938('0x36')](_0x3ff221);}else{return _0x1ee506;}}})['then'](function(_0xc676fb){_0x3ac59b[_0x8938('0xb6')]=_0xc676fb[_0x8938('0x37')]({'plain':!![]});_0x3ac59b[_0x8938('0xb6')][_0x8938('0xb9')]=_0x443d21;if(_0x3ac59b[_0x8938('0xb6')]['created']){if(_0x3ac59b[_0x8938('0x9e')][_0x8938('0xba')]){_0x3ac59b[_0x8938('0x9f')][_0x8938('0xbb')]({'id':0x0,'priority':_0x3ac59b[_0x8938('0x9f')][_0x8938('0x4c')]+0x1,'app':_0x8938('0xbc'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0x8938('0x5d')]({'body':_0x1f8e4c[_0x8938('0x61')][_0x8938('0x61')],'ChatWebsiteId':_0x1f8e4c['params']['id'],'ChatInteractionId':_0xc676fb['id'],'direction':'in','ContactId':_0x3ac59b['contact']['id'],'AttachmentId':_0x1f8e4c[_0x8938('0x61')][_0x8938('0xbd')]});})[_0x8938('0x22')](function(_0x2e6b6c){_0x3ac59b[_0x8938('0x28')]=_0x2e6b6c;if(_0x3ac59b['interaction'][_0x8938('0xbe')]){return db[_0x8938('0xbf')][_0x8938('0x5c')]({'attributes':['id',_0x8938('0x3d')],'where':{'id':_0x3ac59b[_0x8938('0xb6')]['UserId']}})['then'](function(_0x991f43){if(_0x991f43){_0x3ac59b[_0x8938('0x9f')][_0x8938('0xc0')]({'id':0x0,'priority':0x0,'app':_0x8938('0xc1'),'appdata':_0x991f43[_0x8938('0x3d')]+','+(_0x3ac59b[_0x8938('0x9e')][_0x8938('0xc2')]||0xa),'interval':_0x8938('0xc3')});_0x3ac59b[_0x8938('0xc4')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x3ac59b);});}return respondWithRpcPromise(_0x8938('0xc5'),_0x8938('0xc6'),_0x3ac59b);})['then'](function(_0x53d6f6){respondWithRpcPromise(_0x8938('0xc7'),'EventManager',{'event':_0x8938('0x86'),'message':_0x53d6f6},client9002);return _0x53d6f6;})[_0x8938('0x22')](respondWithResult(_0x5f12d1,null))['catch'](handleError(_0x5f12d1,null));};exports['offline']=function(_0x3f5b64,_0x252102,_0x1b25a7){var _0x1adcc6,_0x2c7981,_0x3b11fb;var _0x580b6e=[];var _0x5df022=[];var _0x5b4483={};var _0x320885=_0x3f5b64[_0x8938('0xc8')]||[];var _0x29ec6c=[];var _0x5482ec;return db[_0x8938('0x9b')]['describe']()[_0x8938('0x22')](function(_0x59a637){if(!_0x59a637){throw new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0x8d'));}_0x5df022=_[_0x8938('0x8f')](_['keys'](_0x59a637),[_0x8938('0x90'),_0x8938('0x8e')]);_0x580b6e=_['difference'](_[_0x8938('0x5b')](_0x59a637),[_0x8938('0x90'),_0x8938('0x8e'),'CompanyId',_0x8938('0x92')]);if(_0x3f5b64['body']['id']){delete _0x3f5b64['body']['id'];}if(_['isNil'](_0x3f5b64[_0x8938('0x61')][_0x8938('0x93')])){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0x94')));}if(_[_0x8938('0x7c')](_0x3f5b64[_0x8938('0x61')][_0x8938('0x61')])||_0x3f5b64['body'][_0x8938('0x61')]===''){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db['Sequelize'][(_0x8938('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8938('0x7c')](_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')])){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db['Sequelize'][(_0x8938('0x8c'))](_0x8938('0xca')+_0x580b6e));}if(!_[_0x8938('0x99')](_0x580b6e,_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')])){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0xcb')+_0x580b6e));}_0x5b4483[_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')]]=_0x3f5b64['body'][_0x8938('0x93')];})[_0x8938('0x22')](function(){return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x3f5b64[_0x8938('0x5a')]['id']},'include':[{'model':db[_0x8938('0xcc')],'as':_0x8938('0x9a')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x8938('0x22')](handleEntityNotFound(_0x252102,null))[_0x8938('0x22')](function(_0x2d5cb3){if(_0x2d5cb3&&_0x2d5cb3[_0x8938('0x9a')]){_0x2c7981=_0x2d5cb3;var _0x4b174e=_[_0x8938('0x1a')](_0x3f5b64[_0x8938('0x61')],{'firstName':_0x3f5b64[_0x8938('0x61')][_0x8938('0x93')],'phone':_0x3f5b64[_0x8938('0x61')]['from'],'ListId':_0x2d5cb3['ListId']});_0x4b174e[_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')]]=_0x3f5b64['body'][_0x8938('0x93')];return db[_0x8938('0x9b')][_0x8938('0xcd')]({'where':_0x5b4483,'defaults':_0x4b174e});}})[_0x8938('0xb7')](function(_0x316d24){if(_0x316d24){_0x3b11fb=_0x316d24;var _0x208dce=fs[_0x8938('0xce')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0xcf')),_0x8938('0xd0'));var _0xd2853d=ejs['render'](_0x208dce,{'body':_[_0x8938('0xd1')](_0x3f5b64[_0x8938('0x61')][_0x8938('0x61')]),'bodyTitle':_0x2c7981[_0x8938('0xd2')]});return db[_0x8938('0xd3')][_0x8938('0x5d')]({'body':_0xd2853d,'ContactId':_0x316d24['id'],'ChatWebsiteId':_0x2c7981['id']});}})[_0x8938('0x22')](function(_0x2e3aa1){_0x5482ec=_0x2e3aa1;if(_0x320885[_0x8938('0x4c')]){var _0x155d0b=_0x320885[_0x8938('0x41')](function(_0x519d02){return{'name':_0x519d02[_0x8938('0xd4')],'basename':_0x519d02[_0x8938('0x75')],'type':_0x519d02[_0x8938('0xd5')],'ChatOfflineMessageId':_0x2e3aa1['id']};});_0x29ec6c=_0x155d0b[_0x8938('0x41')](_0x4bd3a5=>{var _0x4e212b={'filename':_0x4bd3a5[_0x8938('0x3d')],'path':path['join'](config[_0x8938('0x7e')],_0x8938('0xd6'),'files',_0x8938('0xd7'),_0x8938('0xd8'),_0x4bd3a5[_0x8938('0xd9')])};return _0x4e212b;});if(!_0x2c7981[_0x8938('0xda')]){return db['sequelize'][_0x8938('0xdb')](function(_0x12ce01){return db[_0x8938('0xdc')]['bulkCreate'](_0x155d0b,{'transaction':_0x12ce01});});}}})[_0x8938('0x22')](function(){if(_0x5482ec){_0x1adcc6=_0x5482ec;return db[_0x8938('0xdd')][_0x8938('0x66')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8938('0xde'),'raw':!![]}]});}})[_0x8938('0x22')](function(_0x343197){if(_0x343197&&_0x343197['Smtp']&&_0x2c7981['forwardOffline']&&_0x2c7981['forwardOfflineAddress']){var _0x3af5ea={'tls':{'rejectUnauthorized':![]}};if(_0x343197['Smtp'][_0x8938('0xdf')]){_0x3af5ea['service']=_0x343197[_0x8938('0xde')][_0x8938('0xdf')];}else{_0x3af5ea[_0x8938('0xe0')]=_0x343197[_0x8938('0xde')][_0x8938('0xe0')];_0x3af5ea[_0x8938('0xe1')]=_0x343197[_0x8938('0xde')][_0x8938('0xe1')];_0x3af5ea['secure']=_0x343197[_0x8938('0xde')][_0x8938('0xe2')];}if(_0x343197[_0x8938('0xde')]['authentication']){_0x3af5ea['auth']={'user':_0x343197['Smtp'][_0x8938('0x5e')],'pass':_0x343197[_0x8938('0xde')][_0x8938('0xe3')]};}return respondWithRpcPromise(_0x8938('0xe4'),_0x8938('0xe5'),{'account':_0x3af5ea,'message':{'from':util[_0x8938('0xac')]('\x22%s\x22\x20<%s>',_0x343197[_0x8938('0x3d')],_0x343197[_0x8938('0xe6')]||_0x343197[_0x8938('0xde')][_0x8938('0x5e')]),'to':_0x2c7981['forwardOfflineAddress'],'subject':_0x2c7981[_0x8938('0xe7')],'html':_0x1adcc6[_0x8938('0x61')],'attachments':_0x29ec6c}},client9003)[_0x8938('0x22')](function(){return _0x1adcc6;})[_0x8938('0x2b')](function(_0x58b6c5){console[_0x8938('0x27')](_0x58b6c5);});}})[_0x8938('0x22')](function(){if(_0x2c7981&&_0x2c7981[_0x8938('0xda')]&&_0x2c7981['MailAccountId']){var _0x1bf54a=[];if(_0x320885[_0x8938('0x4c')]){_0x1bf54a=_0x320885[_0x8938('0x41')](function(_0x269ad8){return{'name':_0x269ad8[_0x8938('0xd4')],'basename':_0x269ad8[_0x8938('0x75')],'type':_0x269ad8[_0x8938('0xd5')],'ChatOfflineMessageId':_0x5482ec['id']};});}var _0x456540;if(!_[_0x8938('0x7c')](_0x2c7981[_0x8938('0xe8')])){var _0x6d1852=_[_0x8938('0x41')](_0x3f5b64['body'],function(_0x5f4948){return _0x5f4948;});var _0x426ba8=_[_0x8938('0xe9')](_0x6d1852)[0x0];var _0x41031b=_[_0x8938('0xea')](_0x426ba8,function(_0x2834b0){return _0x2834b0;});_0x456540=_0x41031b[0x1][_0x2c7981[_0x8938('0xe8')]];}var _0x1cf17d={'from':_0x3b11fb[_0x8938('0xe6')],'firstName':_0x3b11fb[_0x8938('0xa8')],'lastName':_0x3b11fb['lastName'],'mapKey':_0x8938('0xe6'),'message':{'from':_0x3b11fb['email'],'to':_0x2c7981['MailAccount']['email'],'cc':'','subject':_[_0x8938('0x7c')](_0x456540)?_0x2c7981[_0x8938('0xe7')]:_0x456540,'messageId':'','sentAt':new Date(),'attach':_0x1bf54a[_0x8938('0x4c')],'attachments':_0x1bf54a,'originChannel':_0x8938('0xeb'),'ChatWebsiteId':_0x2c7981['id'],'ChatOfflineMessageId':_0x1adcc6['id'],'originTo':_0x2c7981[_0x8938('0xdd')]['email']},'body':_0x1adcc6[_0x8938('0x61')]};var _0x8f78d0={'account':{'id':_0x2c7981[_0x8938('0xec')]},'body':_0x1cf17d,'log':_0x8938('0xed')};return respondWithRpcPromise(_0x8938('0xed'),'notifyMail',_0x8f78d0,client9001)[_0x8938('0x22')](function(){return _0x1adcc6;})[_0x8938('0x2b')](function(_0x1256d1){console[_0x8938('0x27')](_0x1256d1);});}return;})[_0x8938('0x22')](function(){if(_0x1adcc6){return _0x1adcc6;}})[_0x8938('0x22')](respondWithResult(_0x252102,null))['catch'](function(_0xdedfa3){console[_0x8938('0x27')](_0x8938('0x2b'),_0xdedfa3);for(var _0x1a97bd of _0x320885){var _0x444e9e=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0xd6'),'files',_0x8938('0xd7'),_0x8938('0xd8'),_0x1a97bd[_0x8938('0x75')]);fs_extra[_0x8938('0xee')](_0x444e9e)['catch'](function(_0x29d40e){console['error'](_0x8938('0xef'),_0x444e9e,_0x29d40e);});}});};exports[_0x8938('0xf0')]=function(_0x3b2443,_0x2090e5,_0x5da7d6){return db[_0x8938('0xb4')][_0x8938('0x5c')]({'where':{'id':_0x3b2443['params']['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x2090e5,null))[_0x8938('0x22')](function(_0x45d459){if(_0x45d459){return _0x45d459[_0x8938('0xf0')](_0x3b2443[_0x8938('0x61')]['ids'],_[_0x8938('0xf1')](_0x3b2443[_0x8938('0x61')],[_0x8938('0xf2'),'id'])||{});}})[_0x8938('0x22')](respondWithResult(_0x2090e5,null))[_0x8938('0x2b')](handleError(_0x2090e5,null));};exports[_0x8938('0xf3')]=function(_0x8f67c9,_0x2f5398,_0x3aca12){var _0x22fd55={'raw':![],'where':{}};var _0x3d630f={};var _0x1ffa5e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8938('0x66')]({'where':{'id':_0x8f67c9[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2f5398,null))[_0x8938('0x22')](function(_0x16d438){if(_0x16d438){_0x3d630f['model']=_[_0x8938('0x5b')](db[_0x8938('0xb4')][_0x8938('0x43')]);_0x3d630f[_0x8938('0x48')]=_['keys'](_0x8f67c9[_0x8938('0x48')]);_0x3d630f[_0x8938('0x51')]=_[_0x8938('0x49')](_0x3d630f[_0x8938('0x47')],_0x3d630f[_0x8938('0x48')]);_0x22fd55[_0x8938('0x4b')]=_['intersection'](_0x3d630f[_0x8938('0x47')],qs[_0x8938('0x4a')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x4a')]));_0x22fd55['attributes']=_0x22fd55[_0x8938('0x4b')][_0x8938('0x4c')]?_0x22fd55[_0x8938('0x4b')]:_0x3d630f[_0x8938('0x47')];if(!_0x8f67c9[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x22fd55[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x30')]);_0x22fd55[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x2f')]);}_0x22fd55[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x4f')]);_0x22fd55[_0x8938('0x50')]=qs[_0x8938('0x51')](_['pick'](_0x8f67c9[_0x8938('0x48')],_0x3d630f[_0x8938('0x51')]));_0x22fd55[_0x8938('0x50')]['ChatWebsiteId']=_0x16d438['id'];if(_0x8f67c9[_0x8938('0x48')][_0x8938('0x54')]){_0x22fd55[_0x8938('0x50')]=_[_0x8938('0x53')](_0x22fd55[_0x8938('0x50')],{'$or':_['map'](_0x22fd55[_0x8938('0x4b')],function(_0xd29739){var _0x3f18cd={};_0x3f18cd[_0xd29739]={'$like':'%'+_0x8f67c9[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x3f18cd;})});}_0x22fd55=_[_0x8938('0x53')]({},_0x22fd55,_0x8f67c9[_0x8938('0x55')]);return db[_0x8938('0xb4')][_0x8938('0x68')]({'where':_0x22fd55[_0x8938('0x50')]})[_0x8938('0x22')](function(_0x396249){_0x1ffa5e['count']=_0x396249;if(_0x8f67c9['query']['includeAll']){_0x22fd55[_0x8938('0x56')]=[{'model':db[_0x8938('0x9b')],'as':_0x8938('0xf4'),'required':![]},{'model':db[_0x8938('0xbf')],'as':_0x8938('0xf5'),'attributes':[_0x8938('0x3d'),'fullname',_0x8938('0xf6')],'required':![]},{'model':db[_0x8938('0xf7')],'as':'Tags','attributes':['id',_0x8938('0x3d'),_0x8938('0xf8')],'where':_0x8f67c9[_0x8938('0x48')][_0x8938('0xf9')]?{'id':_0x8f67c9[_0x8938('0x48')][_0x8938('0xf9')]}:undefined,'required':_0x8f67c9[_0x8938('0x48')][_0x8938('0xf9')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x22fd55);})[_0x8938('0x22')](function(_0x4f58b5){_0x1ffa5e['rows']=_0x4f58b5;return _0x1ffa5e;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x2f5398,_0x22fd55))[_0x8938('0x2b')](handleError(_0x2f5398,null));};function iftimePromise(_0x123992,_0x1bb43e){return respondWithRpcPromise(_0x8938('0xfa'),'getSnippet',{'command':_0x1bb43e[_0x8938('0xfb')]?util[_0x8938('0xac')]('iftime\x20%s,%s',_0x123992[_0x8938('0xfc')],_0x1bb43e[_0x8938('0xfb')]):util[_0x8938('0xac')](_0x8938('0xfd'),_0x123992[_0x8938('0xfc')])},client9002)[_0x8938('0x22')](function(_0x3bbb45){var _0x57d9c0=_0x3bbb45&&_0x3bbb45[_0x8938('0xfe')](_0x8938('0xff'))>=0x0?!![]:![];logger[_0x8938('0x29')](_0x8938('0x100'),_0x1bb43e['id'],_0x123992['id'],_0x123992['interval'],_0x57d9c0?'ONLINE':_0x8938('0x101'),_0x1bb43e[_0x8938('0xfb')]?_0x1bb43e['timezone']:_0x8938('0x102'));return _0x57d9c0;})['catch'](function(_0x1fcdfe){logger[_0x8938('0x27')](_0x8938('0x100'),_0x1bb43e['id'],_0x123992['id'],_0x123992[_0x8938('0xfc')],util['inspect'](_0x1fcdfe,{'showHidden':![],'depth':null}),_0x1bb43e[_0x8938('0xfb')]?_0x1bb43e[_0x8938('0xfb')]:_0x8938('0x102'));return![];});}exports['getSnippet']=function(_0x157065,_0x1d90d8,_0x579a43){var _0x5df8ab=0x0;var _0x33ef92=0x0;var _0x227091=![];var _0x1490ce;var _0xea28c8;return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0x157065['params']['id']},'include':[{'model':db[_0x8938('0x103')],'as':'Interval','include':[{'model':db[_0x8938('0x103')],'as':_0x8938('0x104'),'attributes':['id',_0x8938('0xfc')],'raw':!![]}]}]})[_0x8938('0x22')](handleEntityNotFound(_0x1d90d8,null))[_0x8938('0x22')](function(_0xdbf039){if(_0xdbf039){_0x1490ce=_0xdbf039;return _0xdbf039[_0x8938('0x105')]({'raw':!![]});}})[_0x8938('0x22')](function(_0x5271d2){if(_0x1490ce){if(_0x5271d2){_0xea28c8=_0x5271d2;}}return require('../../config/license/util')[_0x8938('0x7a')]();})[_0x8938('0x22')](function(_0x33ac97){if(_0x33ac97){_0x33ef92=_0x33ac97['virtual'];_0x227091=_0x33ac97[_0x8938('0x7b')];}})[_0x8938('0x22')](function(){return db[_0x8938('0xb4')][_0x8938('0x68')]({'where':{'closed':![]}});})[_0x8938('0x22')](function(_0x26e063){_0x5df8ab=_0x26e063;if(_0x33ef92&&_0x26e063>_0x33ef92){return db[_0x8938('0x106')][_0x8938('0x66')]({'where':{'id':0x1}})[_0x8938('0x22')](function(_0xf08597){if(_0xf08597){_0xf08597['increment']('chatLicenseExceeded');}});}})[_0x8938('0x22')](function(){if(_0x1490ce[_0x8938('0x103')]&&_0x1490ce[_0x8938('0x103')]['Intervals']){var _0x4f14cf=[];for(var _0x158d97=0x0;_0x158d97<_0x1490ce[_0x8938('0x103')][_0x8938('0x104')]['length'];_0x158d97++){var _0x551ba5=_0x1490ce['Interval'][_0x8938('0x104')][_0x158d97][_0x8938('0x37')]({'plain':!![]});_0x4f14cf[_0x8938('0xbb')](iftimePromise(_0x551ba5,_0x1490ce));}return BPromise[_0x8938('0x107')](_0x4f14cf)[_0x8938('0x22')](function(_0x4e570e){return _[_0x8938('0x108')](_0x4e570e);});}else{return!![];}})[_0x8938('0x22')](function(_0x84c45){var _0x101938=fs[_0x8938('0xce')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x109')),_0x8938('0xd0'));var _0x183d6a={'remote':_0x1490ce[_0x8938('0x10a')],'query':querystring[_0x8938('0x10b')](_[_0x8938('0x53')](_0x1490ce[_0x8938('0x37')]({'plain':!![]}),{'customerIp':_0x157065['headers'][_0x8938('0xa6')]||_0x157065['headers'][_0x8938('0x10c')]||_0x157065['connection']['remoteAddress']||_0x157065['ip'],'referer':_0x157065[_0x8938('0xa4')][_0x8938('0x10d')],'openedInteractions':_0x5df8ab,'maxInteractions':_0x33ef92,'virtual':_0x227091[_0x8938('0x10e')],'online':_0x84c45,'custom':_0x227091}))[_0x8938('0x10f')](/'/g,'\x5c\x27')};_0x1d90d8[_0x8938('0x3e')](ejs[_0x8938('0x110')](Mustache[_0x8938('0x110')](_0x101938,_0x183d6a),{'proactiveActions':_0xea28c8,'alignment':_0x1490ce[_0x8938('0x111')],'verticalAlignment':_0x1490ce['verticalAlignment'],'div_color':_0x1490ce[_0x8938('0xf8')],'text_color':_0x1490ce[_0x8938('0x112')],'button_color':_0x1490ce[_0x8938('0x113')],'background_color':_0x1490ce['backgroundColor']}));})[_0x8938('0x2b')](handleError(_0x1d90d8,null));};exports[_0x8938('0x114')]=function(_0x4b1702,_0x478a56,_0x38a8af){return db[_0x8938('0x42')]['findOne']({'where':{'id':_0x4b1702['params']['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x478a56,null))[_0x8938('0x22')](function(_0x3a7a80){if(_0x3a7a80){return db[_0x8938('0x115')][_0x8938('0xdb')](function(_0x147752){return db['ChatApplication'][_0x8938('0x3a')]({'where':{'ChatWebsiteId':_0x4b1702[_0x8938('0x5a')]['id']},'transaction':_0x147752})[_0x8938('0x22')](function(_0x12abf6){var _0x391819=_[_0x8938('0x41')](_0x4b1702['body'],function(_0x35153a){_0x35153a[_0x8938('0x63')]=_0x4b1702[_0x8938('0x5a')]['id'];return _0x35153a;});return db[_0x8938('0x116')]['bulkCreate'](_0x391819,{'transaction':_0x147752});});})[_0x8938('0x22')](function(){return db[_0x8938('0x116')][_0x8938('0x117')]({'where':{'ChatWebsiteId':_0x4b1702[_0x8938('0x5a')]['id']},'order':_0x8938('0x118')});});}})[_0x8938('0x22')](respondWithResult(_0x478a56,null))[_0x8938('0x2b')](handleError(_0x478a56,null));};exports[_0x8938('0x119')]=function(_0x262217,_0x3585d1,_0x4602b6){var _0x51293c={};var _0x440102={};var _0x16fdb1;var _0x1e3850;return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x262217[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x3585d1,null))['then'](function(_0x7f6422){if(_0x7f6422){_0x16fdb1=_0x7f6422;_0x440102[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0x116')]['rawAttributes']);_0x440102['query']=_[_0x8938('0x5b')](_0x262217[_0x8938('0x48')]);_0x440102['filters']=_['intersection'](_0x440102[_0x8938('0x47')],_0x440102[_0x8938('0x48')]);_0x51293c[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x440102[_0x8938('0x47')],qs['fields'](_0x262217['query'][_0x8938('0x4a')]));_0x51293c[_0x8938('0x4b')]=_0x51293c[_0x8938('0x4b')]['length']?_0x51293c[_0x8938('0x4b')]:_0x440102[_0x8938('0x47')];_0x51293c[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x262217[_0x8938('0x48')][_0x8938('0x4f')]);_0x51293c[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x262217[_0x8938('0x48')],_0x440102['filters']));if(_0x262217[_0x8938('0x48')][_0x8938('0x54')]){_0x51293c['where']=_[_0x8938('0x53')](_0x51293c['where'],{'$or':_[_0x8938('0x41')](_0x51293c[_0x8938('0x4b')],function(_0x41deda){var _0x345ba7={};_0x345ba7[_0x41deda]={'$like':'%'+_0x262217[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x345ba7;})});}_0x51293c=_[_0x8938('0x53')]({},_0x51293c,_0x262217[_0x8938('0x55')]);return _0x16fdb1[_0x8938('0x119')](_0x51293c);}})[_0x8938('0x22')](function(_0x38a2ce){if(_0x38a2ce){_0x1e3850=_0x38a2ce['length'];if(!_0x262217[_0x8938('0x48')][_0x8938('0x4d')]('nolimit')){_0x51293c[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x262217[_0x8938('0x48')][_0x8938('0x30')]);_0x51293c[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x262217[_0x8938('0x48')][_0x8938('0x2f')]);}return _0x16fdb1['getApplications'](_0x51293c);}})[_0x8938('0x22')](function(_0x24a6ef){if(_0x24a6ef){return _0x24a6ef?{'count':_0x1e3850,'rows':_0x24a6ef}:null;}})['then'](respondWithResult(_0x3585d1,null))[_0x8938('0x2b')](handleError(_0x3585d1,null));};exports[_0x8938('0x11a')]=function(_0x398d2c,_0x3c257a,_0x3a1445){return db[_0x8938('0x11b')][_0x8938('0x5c')]({'where':{'id':_0x398d2c[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x3c257a,null))['then'](function(_0x184964){if(_0x184964){return _0x184964[_0x8938('0x11a')](_0x398d2c[_0x8938('0x61')]['ids'],_[_0x8938('0xf1')](_0x398d2c[_0x8938('0x61')],[_0x8938('0xf2'),'id'])||{});}})[_0x8938('0x22')](respondWithResult(_0x3c257a,null))[_0x8938('0x2b')](handleError(_0x3c257a,null));};exports['getProactiveActions']=function(_0x5cf80b,_0xc83460,_0x4696b4){var _0x14cf98={};var _0x49986d={};var _0x359c96;var _0x72a7f3;return db['ChatWebsite'][_0x8938('0x66')]({'where':{'id':_0x5cf80b[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0xc83460,null))[_0x8938('0x22')](function(_0x4cb2b6){if(_0x4cb2b6){_0x359c96=_0x4cb2b6;_0x49986d['model']=_[_0x8938('0x5b')](db[_0x8938('0x11c')][_0x8938('0x43')]);_0x49986d['query']=_[_0x8938('0x5b')](_0x5cf80b['query']);_0x49986d['filters']=_['intersection'](_0x49986d[_0x8938('0x47')],_0x49986d[_0x8938('0x48')]);_0x14cf98[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x49986d[_0x8938('0x47')],qs['fields'](_0x5cf80b[_0x8938('0x48')][_0x8938('0x4a')]));_0x14cf98['attributes']=_0x14cf98[_0x8938('0x4b')]['length']?_0x14cf98[_0x8938('0x4b')]:_0x49986d[_0x8938('0x47')];_0x14cf98[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x5cf80b[_0x8938('0x48')]['sort']);_0x14cf98[_0x8938('0x50')]=qs[_0x8938('0x51')](_['pick'](_0x5cf80b[_0x8938('0x48')],_0x49986d[_0x8938('0x51')]));if(_0x5cf80b[_0x8938('0x48')][_0x8938('0x54')]){_0x14cf98[_0x8938('0x50')]=_[_0x8938('0x53')](_0x14cf98[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x14cf98[_0x8938('0x4b')],function(_0x2d4899){var _0x43e945={};_0x43e945[_0x2d4899]={'$like':'%'+_0x5cf80b[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x43e945;})});}_0x14cf98=_['merge']({},_0x14cf98,_0x5cf80b[_0x8938('0x55')]);return _0x359c96[_0x8938('0x105')](_0x14cf98);}})[_0x8938('0x22')](function(_0x357742){if(_0x357742){_0x72a7f3=_0x357742[_0x8938('0x4c')];if(!_0x5cf80b[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x14cf98[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x5cf80b[_0x8938('0x48')][_0x8938('0x30')]);_0x14cf98[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x5cf80b[_0x8938('0x48')][_0x8938('0x2f')]);}return _0x359c96['getProactiveActions'](_0x14cf98);}})[_0x8938('0x22')](function(_0x1a19dd){if(_0x1a19dd){return _0x1a19dd?{'count':_0x72a7f3,'rows':_0x1a19dd}:null;}})[_0x8938('0x22')](respondWithResult(_0xc83460,null))[_0x8938('0x2b')](handleError(_0xc83460,null));};exports[_0x8938('0x11d')]=function(_0x3aa8d0,_0xd17e87,_0x44c3f3){var _0x23afdc=_0x3aa8d0[_0x8938('0x48')][_0x8938('0x11e')]==='false'?_0x8938('0x11f'):'onlineForm';return db['ChatWebsite'][_0x8938('0x5c')]({'attributes':['id',_0x23afdc],'where':{'id':_0x3aa8d0[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0xd17e87,null))[_0x8938('0x22')](function(_0x65c864){if(_0x65c864){var _0x2760ed=_0x65c864[_0x23afdc];var _0x374975=_0x2760ed&&_0x2760ed[_0x8938('0x120')]?_0x2760ed[_0x8938('0x120')]:[];_0xd17e87['send']({'fromKey':_[_0x8938('0x7c')](_0x2760ed[_0x8938('0x121')])?undefined:_0x2760ed[_0x8938('0x121')],'count':_0x374975[_0x8938('0x4c')],'rows':_0x374975});}})[_0x8938('0x2b')](handleError(_0xd17e87,null));};exports[_0x8938('0x122')]=function(_0x412ed5,_0x2c6b17,_0x526867){var _0x28c4c0={'raw':![],'where':{}};var _0x17f499={};var _0x504a3e={'count':0x0,'rows':[]};return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x412ed5['params']['id']}})['then'](handleEntityNotFound(_0x2c6b17,null))[_0x8938('0x22')](function(_0x4a1be5){if(_0x4a1be5){_0x17f499[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0xd3')]['rawAttributes']);_0x17f499['query']=_['keys'](_0x412ed5[_0x8938('0x48')]);_0x17f499[_0x8938('0x51')]=_[_0x8938('0x49')](_0x17f499['model'],_0x17f499[_0x8938('0x48')]);_0x28c4c0['attributes']=_[_0x8938('0x49')](_0x17f499[_0x8938('0x47')],qs['fields'](_0x412ed5[_0x8938('0x48')][_0x8938('0x4a')]));_0x28c4c0[_0x8938('0x4b')]=_0x28c4c0[_0x8938('0x4b')][_0x8938('0x4c')]?_0x28c4c0[_0x8938('0x4b')]:_0x17f499[_0x8938('0x47')];if(!_0x412ed5['query'][_0x8938('0x4d')](_0x8938('0x4e'))){_0x28c4c0['limit']=qs[_0x8938('0x30')](_0x412ed5[_0x8938('0x48')][_0x8938('0x30')]);_0x28c4c0[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x412ed5[_0x8938('0x48')][_0x8938('0x2f')]);}_0x28c4c0[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x412ed5[_0x8938('0x48')][_0x8938('0x4f')]);_0x28c4c0['where']=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x412ed5[_0x8938('0x48')],_0x17f499['filters']));_0x28c4c0[_0x8938('0x50')][_0x8938('0x63')]=_0x4a1be5['id'];if(_0x412ed5[_0x8938('0x48')][_0x8938('0x54')]){_0x28c4c0[_0x8938('0x50')]=_[_0x8938('0x53')](_0x28c4c0[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x28c4c0['attributes'],function(_0x486a82){var _0x2b13df={};_0x2b13df[_0x486a82]={'$like':'%'+_0x412ed5[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x2b13df;})});}_0x28c4c0=_[_0x8938('0x53')]({},_0x28c4c0,_0x412ed5['options']);return db[_0x8938('0xd3')]['count']({'where':_0x28c4c0['where']})[_0x8938('0x22')](function(_0x2d7264){_0x504a3e[_0x8938('0x68')]=_0x2d7264;if(_0x412ed5['query'][_0x8938('0x6c')]){_0x28c4c0[_0x8938('0x56')]=[{'all':!![]}];}else{_0x28c4c0[_0x8938('0x56')]=[{'model':db[_0x8938('0x9b')],'as':_0x8938('0xf4'),'required':![]},{'model':db[_0x8938('0xdc')],'as':'Attachments','required':![]}];}return db[_0x8938('0xd3')][_0x8938('0x57')](_0x28c4c0);})[_0x8938('0x22')](function(_0x2c472c){_0x504a3e[_0x8938('0x58')]=_0x2c472c;return _0x504a3e;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x2c6b17,_0x28c4c0))[_0x8938('0x2b')](handleError(_0x2c6b17,null));};exports['addAgents']=function(_0x2d15ff,_0x44190c,_0x4c407f){return db[_0x8938('0x42')]['find']({'where':{'id':_0x2d15ff[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x44190c,null))[_0x8938('0x22')](function(_0x348870){if(_0x348870){return _0x348870['addAgents'](_0x2d15ff['body'][_0x8938('0xf2')],_['omit'](_0x2d15ff[_0x8938('0x61')],[_0x8938('0xf2'),'id'])||{})['spread'](function(_0x516ba3){for(var _0x51ddd5=0x0;_0x51ddd5<_0x2d15ff[_0x8938('0x61')][_0x8938('0xf2')][_0x8938('0x4c')];_0x51ddd5+=0x1){socket['emit'](_0x8938('0x123'),{'UserId':Number(_0x2d15ff[_0x8938('0x61')][_0x8938('0xf2')][_0x51ddd5]),'ChatWebsiteId':Number(_0x2d15ff[_0x8938('0x5a')]['id'])});}return _0x516ba3;});}})['then'](respondWithResult(_0x44190c,null))[_0x8938('0x2b')](handleError(_0x44190c,null));};exports['removeAgents']=function(_0x4af9d9,_0x12be0a,_0x1ec88a){return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0x4af9d9[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x12be0a,null))['then'](function(_0x59bdec){if(_0x59bdec){return _0x59bdec[_0x8938('0x124')](_0x4af9d9['query'][_0x8938('0xf2')])[_0x8938('0x22')](function(){if(_[_0x8938('0x125')](_0x4af9d9[_0x8938('0x48')][_0x8938('0xf2')])){for(var _0x486e23=0x0;_0x486e23<_0x4af9d9[_0x8938('0x48')]['ids'][_0x8938('0x4c')];_0x486e23+=0x1){socket[_0x8938('0x126')](_0x8938('0x127'),{'UserId':Number(_0x4af9d9[_0x8938('0x48')][_0x8938('0xf2')][_0x486e23]),'ChatWebsiteId':Number(_0x4af9d9[_0x8938('0x5a')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x4af9d9['query'][_0x8938('0xf2')]),'ChatWebsiteId':Number(_0x4af9d9['params']['id'])});}});}})[_0x8938('0x22')](respondWithStatusCode(_0x12be0a,null))[_0x8938('0x2b')](handleError(_0x12be0a,null));};exports[_0x8938('0x128')]=function(_0x388dbb,_0x897f5c,_0x373607){var _0x27e10f={};var _0x12e2b2={};var _0x1a532b;var _0x2469f6;return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x388dbb[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x897f5c,null))[_0x8938('0x22')](function(_0x326b6e){if(_0x326b6e){_0x1a532b=_0x326b6e;_0x12e2b2[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0xbf')][_0x8938('0x43')]);_0x12e2b2[_0x8938('0x48')]=_['keys'](_0x388dbb[_0x8938('0x48')]);_0x12e2b2[_0x8938('0x51')]=_[_0x8938('0x49')](_0x12e2b2[_0x8938('0x47')],_0x12e2b2[_0x8938('0x48')]);_0x27e10f[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x12e2b2[_0x8938('0x47')],qs['fields'](_0x388dbb[_0x8938('0x48')][_0x8938('0x4a')]));_0x27e10f[_0x8938('0x4b')]=_0x27e10f[_0x8938('0x4b')]['length']?_0x27e10f[_0x8938('0x4b')]:_0x12e2b2[_0x8938('0x47')];_0x27e10f['order']=qs[_0x8938('0x4f')](_0x388dbb[_0x8938('0x48')]['sort']);_0x27e10f[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x388dbb['query'],_0x12e2b2['filters']));if(_0x388dbb[_0x8938('0x48')][_0x8938('0x54')]){_0x27e10f['where']=_[_0x8938('0x53')](_0x27e10f[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x27e10f[_0x8938('0x4b')],function(_0x74e8f2){var _0x59e7fb={};_0x59e7fb[_0x74e8f2]={'$like':'%'+_0x388dbb[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x59e7fb;})});}_0x27e10f=_[_0x8938('0x53')]({},_0x27e10f,_0x388dbb['options']);return _0x1a532b['getAgents'](_0x27e10f);}})[_0x8938('0x22')](function(_0x1151e9){if(_0x1151e9){_0x2469f6=_0x1151e9['length'];if(!_0x388dbb[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x27e10f[_0x8938('0x30')]=qs['limit'](_0x388dbb['query'][_0x8938('0x30')]);_0x27e10f[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x388dbb[_0x8938('0x48')][_0x8938('0x2f')]);}return _0x1a532b[_0x8938('0x128')](_0x27e10f);}})[_0x8938('0x22')](function(_0x3bdb20){if(_0x3bdb20){return _0x3bdb20?{'count':_0x2469f6,'rows':_0x3bdb20}:null;}})[_0x8938('0x22')](respondWithResult(_0x897f5c,null))['catch'](handleError(_0x897f5c,null));}; \ No newline at end of file +var _0x3343=['intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','Pause','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','params','Disposition','findOne','hasOwnProperty','ChatWebsiteId','removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','createdAt','difference','updatedAt','CompanyId','ListId','from','Sequelize','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','List','ChatApplication','Applications','account','applications','orderBy','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','files','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','rows','Command','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','getProactiveActions','virtual','License','increment','Intervals','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','get','ChatWebsites','name','send','index','mandatoryDispositionPause','ChatWebsite','fieldName','type','key','model','map','query','keys','filters'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x3343,0xf0));var _0x3334=function(_0x174e6b,_0x124a26){_0x174e6b=_0x174e6b-0x0;var _0x10ab0e=_0x3343[_0x174e6b];return _0x10ab0e;};'use strict';var emlformat=require(_0x3334('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3334('0x1'));var jsonpatch=require(_0x3334('0x2'));var rp=require(_0x3334('0x3'));var moment=require('moment');var BPromise=require(_0x3334('0x4'));var Mustache=require(_0x3334('0x5'));var util=require(_0x3334('0x6'));var path=require('path');var sox=require(_0x3334('0x7'));var csv=require(_0x3334('0x8'));var ejs=require(_0x3334('0x9'));var fs=require('fs');var fs_extra=require(_0x3334('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3334('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3334('0xc'));var Papa=require(_0x3334('0xd'));var Redis=require(_0x3334('0xe'));var authService=require(_0x3334('0xf'));var qs=require(_0x3334('0x10'));var as=require(_0x3334('0x11'));var hardwareService=require(_0x3334('0x12'));var logger=require(_0x3334('0x13'))(_0x3334('0x14'));var utils=require(_0x3334('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3334('0x16'));var db=require('../../mysqldb')['db'];config[_0x3334('0x17')]=_[_0x3334('0x18')](config[_0x3334('0x17')],{'host':_0x3334('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3334('0x17')]));require('./chatWebsite.socket')[_0x3334('0x1a')](socket);var jayson=require(_0x3334('0x1b'));var client=jayson[_0x3334('0x1c')][_0x3334('0x1d')]({'port':0x232c});var client9002=jayson[_0x3334('0x1c')][_0x3334('0x1d')]({'port':0x232a});var client9003=jayson[_0x3334('0x1c')]['http']({'port':0x232b});var client9001=jayson[_0x3334('0x1c')][_0x3334('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x1ce163,_0x519947,_0x147246,_0x27bf79){return new BPromise(function(_0x52836e,_0x1b991a){var _0x14d23d=_0x27bf79||client;return _0x14d23d['request'](_0x1ce163,_0x147246)[_0x3334('0x1e')](function(_0x53ecc9){logger[_0x3334('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x519947,_0x3334('0x20'));logger['debug'](_0x3334('0x21'),_0x519947,_0x3334('0x20'),JSON[_0x3334('0x22')](_0x53ecc9));if(_0x53ecc9[_0x3334('0x23')]){if(_0x53ecc9['error'][_0x3334('0x24')]===0x1f4){logger['error'](_0x3334('0x25'),_0x519947,_0x53ecc9['error'][_0x3334('0x26')]);return _0x1b991a(_0x53ecc9[_0x3334('0x23')]['message']);}logger[_0x3334('0x23')](_0x3334('0x25'),_0x519947,_0x53ecc9['error'][_0x3334('0x26')]);return _0x52836e(_0x53ecc9[_0x3334('0x23')]['message']);}else{logger['info'](_0x3334('0x25'),_0x519947,'request\x20sent');_0x52836e(_0x53ecc9[_0x3334('0x27')][_0x3334('0x26')]);}})[_0x3334('0x28')](function(_0x5a98f1){logger[_0x3334('0x23')](_0x3334('0x25'),_0x519947,_0x5a98f1);_0x1b991a(_0x5a98f1);});});}function respondWithStatusCode(_0x21b64f,_0x8dfc65){_0x8dfc65=_0x8dfc65||0xcc;return function(_0xfa3029){if(_0xfa3029){return _0x21b64f[_0x3334('0x29')](_0x8dfc65);}return _0x21b64f[_0x3334('0x2a')](_0x8dfc65)[_0x3334('0x2b')]();};}function respondWithResult(_0x430b64,_0x53689a){_0x53689a=_0x53689a||0xc8;return function(_0x5c1105){if(_0x5c1105){return _0x430b64[_0x3334('0x2a')](_0x53689a)[_0x3334('0x2c')](_0x5c1105);}};}function respondWithFilteredResult(_0x3943b1,_0x53c922){return function(_0x4c2bcc){if(_0x4c2bcc){var _0x4d8ae6=typeof _0x53c922[_0x3334('0x2d')]==='undefined'&&typeof _0x53c922['limit']===_0x3334('0x2e');var _0x447c35=_0x4c2bcc[_0x3334('0x2f')];var _0x2eda3f=_0x4d8ae6?0x0:_0x53c922[_0x3334('0x2d')];var _0x2a6ba4=_0x4d8ae6?_0x4c2bcc[_0x3334('0x2f')]:_0x53c922['offset']+_0x53c922[_0x3334('0x30')];var _0x2df606;if(_0x2a6ba4>=_0x447c35){_0x2a6ba4=_0x447c35;_0x2df606=0xc8;}else{_0x2df606=0xce;}_0x3943b1[_0x3334('0x2a')](_0x2df606);return _0x3943b1[_0x3334('0x31')]('Content-Range',_0x2eda3f+'-'+_0x2a6ba4+'/'+_0x447c35)[_0x3334('0x2c')](_0x4c2bcc);}return null;};}function patchUpdates(_0x36b13d){return function(_0x253b32){try{jsonpatch[_0x3334('0x32')](_0x253b32,_0x36b13d,!![]);}catch(_0x3d48cc){return BPromise[_0x3334('0x33')](_0x3d48cc);}return _0x253b32[_0x3334('0x34')]();};}function saveUpdates(_0xbf9831,_0x389170){return function(_0x31ae02){if(_0x31ae02){return _0x31ae02[_0x3334('0x35')](_0xbf9831)[_0x3334('0x1e')](function(_0x4bed61){return _0x4bed61;});}return null;};}function removeEntity(_0x86ee8d,_0x7fecf2){return function(_0x5469a5){if(_0x5469a5){return _0x5469a5['destroy']()[_0x3334('0x1e')](function(){var _0x40d66f=_0x5469a5[_0x3334('0x36')]({'plain':!![]});var _0x1945c7=_0x3334('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x1945c7,'resourceId':_0x40d66f['id']}})[_0x3334('0x1e')](function(){return _0x5469a5;});})[_0x3334('0x1e')](function(){_0x86ee8d[_0x3334('0x2a')](0xcc)[_0x3334('0x2b')]();});}};}function handleEntityNotFound(_0x156167,_0x8d53d3){return function(_0xf26dd2){if(!_0xf26dd2){_0x156167[_0x3334('0x29')](0x194);}return _0xf26dd2;};}function handleError(_0x1db722,_0x3dcd11){_0x3dcd11=_0x3dcd11||0x1f4;return function(_0x47977d){logger['error'](_0x47977d['stack']);if(_0x47977d[_0x3334('0x38')]){delete _0x47977d[_0x3334('0x38')];}_0x1db722[_0x3334('0x2a')](_0x3dcd11)[_0x3334('0x39')](_0x47977d);};}exports[_0x3334('0x3a')]=function(_0x5e356c,_0x209add){var _0x2919be={'include':[{'model':db['Pause'],'as':_0x3334('0x3b')}]},_0x56918e={},_0x29167b={'count':0x0,'rows':[]};var _0x3a8df1=_['map'](db[_0x3334('0x3c')]['rawAttributes'],function(_0x38a97f){return{'name':_0x38a97f[_0x3334('0x3d')],'type':_0x38a97f[_0x3334('0x3e')][_0x3334('0x3f')]};});_0x56918e[_0x3334('0x40')]=_[_0x3334('0x41')](_0x3a8df1,'name');_0x56918e[_0x3334('0x42')]=_[_0x3334('0x43')](_0x5e356c[_0x3334('0x42')]);_0x56918e[_0x3334('0x44')]=_[_0x3334('0x45')](_0x56918e[_0x3334('0x40')],_0x56918e[_0x3334('0x42')]);_0x2919be[_0x3334('0x46')]=_['intersection'](_0x56918e[_0x3334('0x40')],qs[_0x3334('0x47')](_0x5e356c[_0x3334('0x42')]['fields']));_0x2919be[_0x3334('0x46')]=_0x2919be[_0x3334('0x46')][_0x3334('0x48')]?_0x2919be[_0x3334('0x46')]:_0x56918e['model'];if(!_0x5e356c[_0x3334('0x42')]['hasOwnProperty'](_0x3334('0x49'))){_0x2919be[_0x3334('0x30')]=qs['limit'](_0x5e356c['query'][_0x3334('0x30')]);_0x2919be[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x5e356c[_0x3334('0x42')][_0x3334('0x2d')]);}_0x2919be[_0x3334('0x4a')]=qs[_0x3334('0x4b')](_0x5e356c['query'][_0x3334('0x4b')]);_0x2919be[_0x3334('0x4c')]=qs[_0x3334('0x44')](_[_0x3334('0x4d')](_0x5e356c[_0x3334('0x42')],_0x56918e['filters']),_0x3a8df1);if(_0x5e356c[_0x3334('0x42')][_0x3334('0x4e')]){_0x2919be['where']=_[_0x3334('0x4f')](_0x2919be['where'],{'$or':_[_0x3334('0x41')](_0x3a8df1,function(_0x35b63b){if(_0x35b63b[_0x3334('0x3e')]!==_0x3334('0x50')){var _0x4a00d0={};_0x4a00d0[_0x35b63b[_0x3334('0x38')]]={'$like':'%'+_0x5e356c[_0x3334('0x42')][_0x3334('0x4e')]+'%'};return _0x4a00d0;}})});}_0x2919be=_[_0x3334('0x4f')]({},_0x2919be,_0x5e356c[_0x3334('0x51')]);var _0x4518cd={'where':_0x2919be[_0x3334('0x4c')]};return db['ChatWebsite'][_0x3334('0x2f')](_0x4518cd)[_0x3334('0x1e')](function(_0x591a7d){_0x29167b[_0x3334('0x2f')]=_0x591a7d;if(_0x5e356c[_0x3334('0x42')][_0x3334('0x52')]){_0x2919be[_0x3334('0x53')]=[{'all':!![]}];}return db[_0x3334('0x3c')][_0x3334('0x54')](_0x2919be);})['then'](function(_0x10a931){_0x29167b['rows']=_0x10a931;return _0x29167b;})[_0x3334('0x1e')](respondWithFilteredResult(_0x209add,_0x2919be))[_0x3334('0x28')](handleError(_0x209add,null));};exports['show']=function(_0x5e7e73,_0x646834){var _0x3997ed={'raw':![],'where':{'id':_0x5e7e73['params']['id']},'include':[{'model':db[_0x3334('0x55')],'as':'mandatoryDispositionPause'}]},_0x1d80ef={};_0x1d80ef['model']=_[_0x3334('0x43')](db[_0x3334('0x3c')][_0x3334('0x56')]);_0x1d80ef['query']=_['keys'](_0x5e7e73['query']);_0x1d80ef[_0x3334('0x44')]=_['intersection'](_0x1d80ef['model'],_0x1d80ef[_0x3334('0x42')]);_0x3997ed['attributes']=_[_0x3334('0x45')](_0x1d80ef['model'],qs[_0x3334('0x47')](_0x5e7e73[_0x3334('0x42')][_0x3334('0x47')]));_0x3997ed[_0x3334('0x46')]=_0x3997ed['attributes'][_0x3334('0x48')]?_0x3997ed['attributes']:_0x1d80ef[_0x3334('0x40')];if(_0x5e7e73[_0x3334('0x42')][_0x3334('0x52')]){_0x3997ed[_0x3334('0x53')]=[{'all':!![]}];}_0x3997ed=_[_0x3334('0x4f')]({},_0x3997ed,_0x5e7e73[_0x3334('0x51')]);return db[_0x3334('0x3c')]['find'](_0x3997ed)[_0x3334('0x1e')](handleEntityNotFound(_0x646834,null))['then'](respondWithResult(_0x646834,null))[_0x3334('0x28')](handleError(_0x646834,null));};exports[_0x3334('0x57')]=function(_0x451c54,_0x47ab00){return db[_0x3334('0x3c')]['create'](_0x451c54[_0x3334('0x58')],{})[_0x3334('0x1e')](function(_0x434301){var _0x2667dc=_0x451c54[_0x3334('0x59')][_0x3334('0x36')]({'plain':!![]});if(!_0x2667dc)throw new Error(_0x3334('0x5a'));if(_0x2667dc[_0x3334('0x5b')]===_0x3334('0x59')){var _0xfe4e8=_0x434301['get']({'plain':!![]});var _0x17ee34=_0x3334('0x37');return db[_0x3334('0x5c')][_0x3334('0x5d')]({'where':{'name':_0x17ee34,'userProfileId':_0x2667dc[_0x3334('0x5e')]},'raw':!![]})[_0x3334('0x1e')](function(_0xb9a24f){if(_0xb9a24f&&_0xb9a24f[_0x3334('0x5f')]===0x0){return db[_0x3334('0x60')]['create']({'name':_0xfe4e8[_0x3334('0x38')],'resourceId':_0xfe4e8['id'],'type':_0xb9a24f[_0x3334('0x38')],'sectionId':_0xb9a24f['id']},{})['then'](function(){return _0x434301;});}else{return _0x434301;}})['catch'](function(_0x5e89fb){logger[_0x3334('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e89fb);throw _0x5e89fb;});}return _0x434301;})[_0x3334('0x1e')](respondWithResult(_0x47ab00,0xc9))[_0x3334('0x28')](handleError(_0x47ab00,null));};exports['update']=function(_0x155989,_0xd7885d){if(_0x155989['body']['id']){delete _0x155989['body']['id'];}return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x155989['params']['id']},'include':[{'model':db[_0x3334('0x55')],'as':_0x3334('0x3b')}]})[_0x3334('0x1e')](handleEntityNotFound(_0xd7885d,null))[_0x3334('0x1e')](saveUpdates(_0x155989[_0x3334('0x58')],null))[_0x3334('0x1e')](respondWithResult(_0xd7885d,null))[_0x3334('0x28')](handleError(_0xd7885d,null));};exports['destroy']=function(_0x36e8c2,_0x10d833){return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x36e8c2['params']['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x10d833,null))[_0x3334('0x1e')](removeEntity(_0x10d833,null))['catch'](handleError(_0x10d833,null));};exports[_0x3334('0x61')]=function(_0x572cdd,_0x218fea){return db[_0x3334('0x3c')][_0x3334('0x61')]()[_0x3334('0x1e')](respondWithResult(_0x218fea,null))[_0x3334('0x28')](handleError(_0x218fea,null));};exports[_0x3334('0x62')]=function(_0x5dc5b2,_0x5cd9d5,_0x408ca9){if(_0x5dc5b2['body']['id']){delete _0x5dc5b2['body']['id'];}return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x5dc5b2[_0x3334('0x63')]['id']}})['then'](handleEntityNotFound(_0x5cd9d5,null))['then'](function(_0x5038db){if(_0x5038db){_0x5dc5b2[_0x3334('0x58')]['ChatWebsiteId']=_0x5038db['id'];return db[_0x3334('0x64')][_0x3334('0x57')](_0x5dc5b2[_0x3334('0x58')]);}})[_0x3334('0x1e')](respondWithResult(_0x5cd9d5,null))[_0x3334('0x28')](handleError(_0x5cd9d5,null));};exports['getDispositions']=function(_0x435052,_0x12b2f1,_0x495964){var _0xf1784c={'raw':![],'where':{}};var _0x212696={};var _0x392070={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3334('0x65')]({'where':{'id':_0x435052[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x12b2f1,null))[_0x3334('0x1e')](function(_0x4f6f4b){if(_0x4f6f4b){_0x212696[_0x3334('0x40')]=_[_0x3334('0x43')](db['Disposition'][_0x3334('0x56')]);_0x212696[_0x3334('0x42')]=_['keys'](_0x435052['query']);_0x212696[_0x3334('0x44')]=_[_0x3334('0x45')](_0x212696[_0x3334('0x40')],_0x212696['query']);_0xf1784c['attributes']=_[_0x3334('0x45')](_0x212696[_0x3334('0x40')],qs[_0x3334('0x47')](_0x435052[_0x3334('0x42')]['fields']));_0xf1784c['attributes']=_0xf1784c[_0x3334('0x46')][_0x3334('0x48')]?_0xf1784c[_0x3334('0x46')]:_0x212696[_0x3334('0x40')];if(!_0x435052['query'][_0x3334('0x66')]('nolimit')){_0xf1784c[_0x3334('0x30')]=qs[_0x3334('0x30')](_0x435052[_0x3334('0x42')][_0x3334('0x30')]);_0xf1784c[_0x3334('0x2d')]=qs['offset'](_0x435052['query'][_0x3334('0x2d')]);}_0xf1784c[_0x3334('0x4a')]=qs['sort'](_0x435052[_0x3334('0x42')]['sort']);_0xf1784c['where']=qs[_0x3334('0x44')](_['pick'](_0x435052['query'],_0x212696[_0x3334('0x44')]));_0xf1784c[_0x3334('0x4c')][_0x3334('0x67')]=_0x4f6f4b['id'];if(_0x435052[_0x3334('0x42')]['filter']){_0xf1784c['where']=_[_0x3334('0x4f')](_0xf1784c[_0x3334('0x4c')],{'$or':_[_0x3334('0x41')](_0xf1784c[_0x3334('0x46')],function(_0x43eca1){var _0xaaaaa3={};_0xaaaaa3[_0x43eca1]={'$like':'%'+_0x435052[_0x3334('0x42')][_0x3334('0x4e')]+'%'};return _0xaaaaa3;})});}_0xf1784c=_['merge']({},_0xf1784c,_0x435052[_0x3334('0x51')]);return db['Disposition'][_0x3334('0x2f')]({'where':_0xf1784c[_0x3334('0x4c')]})[_0x3334('0x1e')](function(_0x421761){_0x392070[_0x3334('0x2f')]=_0x421761;if(_0x435052[_0x3334('0x42')]['includeAll']){_0xf1784c[_0x3334('0x53')]=[{'all':!![]}];}return db[_0x3334('0x64')][_0x3334('0x54')](_0xf1784c);})['then'](function(_0x596415){_0x392070['rows']=_0x596415;return _0x392070;});}})[_0x3334('0x1e')](respondWithFilteredResult(_0x12b2f1,_0xf1784c))[_0x3334('0x28')](handleError(_0x12b2f1,null));};exports[_0x3334('0x68')]=function(_0x1b1b5c,_0xe86887,_0x3f950b){return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x1b1b5c[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0xe86887,null))[_0x3334('0x1e')](function(_0x3409e6){if(_0x3409e6){return _0x3409e6[_0x3334('0x68')](_0x1b1b5c['query'][_0x3334('0x69')]);}})['then'](respondWithStatusCode(_0xe86887,null))[_0x3334('0x28')](handleError(_0xe86887,null));};exports['addAnswer']=function(_0x2e2c35,_0x46895e,_0x34af25){if(_0x2e2c35[_0x3334('0x58')]['id']){delete _0x2e2c35['body']['id'];}return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x2e2c35[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x46895e,null))[_0x3334('0x1e')](function(_0x2cbd80){if(_0x2cbd80){_0x2e2c35[_0x3334('0x58')][_0x3334('0x67')]=_0x2cbd80['id'];return db[_0x3334('0x6a')][_0x3334('0x57')](_0x2e2c35[_0x3334('0x58')]);}})[_0x3334('0x1e')](respondWithResult(_0x46895e,null))[_0x3334('0x28')](handleError(_0x46895e,null));};exports['getAnswers']=function(_0x58e853,_0x1684a5,_0xf982ea){var _0x1cf5ba={'raw':![],'where':{}};var _0x4f4d90={};var _0x408b23={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x58e853[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x1684a5,null))['then'](function(_0x240ed8){if(_0x240ed8){_0x4f4d90[_0x3334('0x40')]=_[_0x3334('0x43')](db['CannedAnswer'][_0x3334('0x56')]);_0x4f4d90[_0x3334('0x42')]=_['keys'](_0x58e853[_0x3334('0x42')]);_0x4f4d90[_0x3334('0x44')]=_[_0x3334('0x45')](_0x4f4d90[_0x3334('0x40')],_0x4f4d90[_0x3334('0x42')]);_0x1cf5ba[_0x3334('0x46')]=_[_0x3334('0x45')](_0x4f4d90[_0x3334('0x40')],qs[_0x3334('0x47')](_0x58e853[_0x3334('0x42')]['fields']));_0x1cf5ba[_0x3334('0x46')]=_0x1cf5ba[_0x3334('0x46')][_0x3334('0x48')]?_0x1cf5ba[_0x3334('0x46')]:_0x4f4d90[_0x3334('0x40')];if(!_0x58e853[_0x3334('0x42')][_0x3334('0x66')](_0x3334('0x49'))){_0x1cf5ba[_0x3334('0x30')]=qs['limit'](_0x58e853[_0x3334('0x42')]['limit']);_0x1cf5ba[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x58e853['query']['offset']);}_0x1cf5ba[_0x3334('0x4a')]=qs['sort'](_0x58e853[_0x3334('0x42')][_0x3334('0x4b')]);_0x1cf5ba[_0x3334('0x4c')]=qs[_0x3334('0x44')](_[_0x3334('0x4d')](_0x58e853[_0x3334('0x42')],_0x4f4d90[_0x3334('0x44')]));_0x1cf5ba[_0x3334('0x4c')][_0x3334('0x67')]=_0x240ed8['id'];if(_0x58e853[_0x3334('0x42')]['filter']){_0x1cf5ba[_0x3334('0x4c')]=_['merge'](_0x1cf5ba[_0x3334('0x4c')],{'$or':_['map'](_0x1cf5ba[_0x3334('0x46')],function(_0xa4922f){var _0x83cbff={};_0x83cbff[_0xa4922f]={'$like':'%'+_0x58e853[_0x3334('0x42')][_0x3334('0x4e')]+'%'};return _0x83cbff;})});}_0x1cf5ba=_['merge']({},_0x1cf5ba,_0x58e853['options']);return db[_0x3334('0x6a')][_0x3334('0x2f')]({'where':_0x1cf5ba[_0x3334('0x4c')]})[_0x3334('0x1e')](function(_0x14b147){_0x408b23[_0x3334('0x2f')]=_0x14b147;if(_0x58e853[_0x3334('0x42')][_0x3334('0x52')]){_0x1cf5ba['include']=[{'all':!![]}];}return db[_0x3334('0x6a')][_0x3334('0x54')](_0x1cf5ba);})['then'](function(_0x5d7244){_0x408b23['rows']=_0x5d7244;return _0x408b23;});}})[_0x3334('0x1e')](respondWithFilteredResult(_0x1684a5,_0x1cf5ba))[_0x3334('0x28')](handleError(_0x1684a5,null));};exports[_0x3334('0x6b')]=function(_0x4b76c5,_0x146474,_0x8ec518){return db['ChatWebsite']['find']({'where':{'id':_0x4b76c5[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x146474,null))[_0x3334('0x1e')](function(_0x425bee){if(_0x425bee){return _0x425bee['removeAnswers'](_0x4b76c5[_0x3334('0x42')][_0x3334('0x69')]);}})[_0x3334('0x1e')](respondWithStatusCode(_0x146474,null))[_0x3334('0x28')](handleError(_0x146474,null));};exports[_0x3334('0x6c')]=function(_0x5df94d,_0x473770,_0x682f59){_0x5df94d[_0x3334('0x58')]['sitepic']=_0x5df94d[_0x3334('0x6d')][_0x3334('0x6e')];return db[_0x3334('0x3c')]['find']({'where':{'id':_0x5df94d[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x473770,null))[_0x3334('0x1e')](saveUpdates(_0x5df94d[_0x3334('0x58')],null))[_0x3334('0x1e')](respondWithResult(_0x473770,null))[_0x3334('0x28')](handleError(_0x473770,null));};exports[_0x3334('0x6f')]=function(_0x562ff3,_0x5b404d,_0x157b7b){_0x562ff3[_0x3334('0x58')]['agentAvatar']=_0x562ff3[_0x3334('0x6d')][_0x3334('0x6e')];return db[_0x3334('0x3c')]['find']({'where':{'id':_0x562ff3[_0x3334('0x63')]['id']}})['then'](handleEntityNotFound(_0x5b404d,null))[_0x3334('0x1e')](saveUpdates(_0x562ff3[_0x3334('0x58')],null))[_0x3334('0x1e')](respondWithResult(_0x5b404d,null))[_0x3334('0x28')](handleError(_0x5b404d,null));};exports[_0x3334('0x70')]=function(_0x6c3bc2,_0x118ec1,_0x36dcb3){_0x6c3bc2[_0x3334('0x58')][_0x3334('0x71')]=_0x6c3bc2[_0x3334('0x6d')]['filename'];return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x6c3bc2[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x118ec1,null))['then'](saveUpdates(_0x6c3bc2[_0x3334('0x58')],null))[_0x3334('0x1e')](respondWithResult(_0x118ec1,null))['catch'](handleError(_0x118ec1,null));};exports[_0x3334('0x72')]=function(_0x5752b6,_0x50e160,_0x20e8e7){_0x5752b6[_0x3334('0x58')][_0x3334('0x73')]=_0x5752b6[_0x3334('0x6d')]['filename'];return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x5752b6[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x50e160,null))[_0x3334('0x1e')](saveUpdates(_0x5752b6[_0x3334('0x58')],null))['then'](respondWithResult(_0x50e160,null))[_0x3334('0x28')](handleError(_0x50e160,null));};exports['getLogo']=function(_0x42175d,_0x1d9864,_0x203b91){var _0x5bf759=path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x76'));var _0x5c8ad1={'where':{'id':_0x42175d[_0x3334('0x63')]['id']},'attributes':['id',_0x3334('0x77')],'raw':!![]};var _0xd0389d=![];return require(_0x3334('0x16'))[_0x3334('0x78')]()[_0x3334('0x1e')](function(_0x2ba161){if(_0x2ba161){_0xd0389d=_0x2ba161[_0x3334('0x79')];}})[_0x3334('0x1e')](function(){return db['ChatWebsite'][_0x3334('0x5d')](_0x5c8ad1);})['then'](handleEntityNotFound(_0x1d9864,null))['then'](function(_0x3ea9da){if(_0x3ea9da){if(!_[_0x3334('0x7a')](_0x3ea9da[_0x3334('0x77')])){if(fs[_0x3334('0x7b')](path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x7c'),_0x3ea9da['sitepic']))&&_0xd0389d){_0x5bf759=path[_0x3334('0x74')](config['root'],'server/files/images/logos/',_0x3ea9da[_0x3334('0x77')]);}}return _0x1d9864[_0x3334('0x7d')](_0x5bf759);}})[_0x3334('0x28')](handleError(_0x1d9864,null));};exports[_0x3334('0x7e')]=function(_0x514a4b,_0x38ba71,_0x42f42b){var _0x42b45a=path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x7f'));var _0x52081c={'where':{'id':_0x514a4b['params']['id']},'attributes':['id',_0x3334('0x80')],'raw':!![]};return db[_0x3334('0x3c')]['find'](_0x52081c)[_0x3334('0x1e')](handleEntityNotFound(_0x38ba71,null))['then'](function(_0x1c75d6){if(_0x1c75d6){if(!_[_0x3334('0x7a')](_0x1c75d6[_0x3334('0x80')])){if(fs['existsSync'](path[_0x3334('0x74')](config['root'],_0x3334('0x81'),_0x1c75d6['agentAvatar']))){_0x42b45a=path[_0x3334('0x74')](config[_0x3334('0x75')],'server/files/images/avatars/',_0x1c75d6['agentAvatar']);}}return _0x38ba71[_0x3334('0x7d')](_0x42b45a);}})[_0x3334('0x28')](handleError(_0x38ba71,null));};exports[_0x3334('0x82')]=function(_0x276944,_0x436936,_0xbfb75e){var _0x270179=path[_0x3334('0x74')](config['root'],_0x3334('0x83'));var _0x495cb0={'where':{'id':_0x276944[_0x3334('0x63')]['id']},'attributes':['id','customerAvatar',_0x3334('0x84')],'raw':!![]};return db['ChatWebsite'][_0x3334('0x5d')](_0x495cb0)[_0x3334('0x1e')](handleEntityNotFound(_0x436936,null))[_0x3334('0x1e')](function(_0x3fc6f4){if(_0x3fc6f4){if(!_[_0x3334('0x7a')](_0x3fc6f4[_0x3334('0x71')])){if(fs[_0x3334('0x7b')](path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x81'),_0x3fc6f4['customerAvatar']))&&_0x3fc6f4[_0x3334('0x84')]){_0x270179=path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x81'),_0x3fc6f4[_0x3334('0x71')]);}}return _0x436936['download'](_0x270179);}})['catch'](handleError(_0x436936,null));};exports[_0x3334('0x85')]=function(_0x2e8109,_0x1e6fc6,_0x39a44b){var _0x38dd22=path[_0x3334('0x74')](config[_0x3334('0x75')],'server/files/images/avatars/system_avatar.png');var _0x409697={'where':{'id':_0x2e8109[_0x3334('0x63')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x3334('0x3c')][_0x3334('0x5d')](_0x409697)[_0x3334('0x1e')](handleEntityNotFound(_0x1e6fc6,null))[_0x3334('0x1e')](function(_0x150df3){if(_0x150df3){if(!_[_0x3334('0x7a')](_0x150df3[_0x3334('0x73')])){if(fs['existsSync'](path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x81'),_0x150df3['systemAvatar']))){_0x38dd22=path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x81'),_0x150df3[_0x3334('0x73')]);}}return _0x1e6fc6[_0x3334('0x7d')](_0x38dd22);}})[_0x3334('0x28')](handleError(_0x1e6fc6,null));};exports[_0x3334('0x86')]=function(_0x4419a,_0x3a64d7,_0x103f20){var _0x382a6c=require('user-agent-parser');var _0x3323ef=new _0x382a6c();var _0x4f0884=_0x3323ef[_0x3334('0x87')](_0x4419a[_0x3334('0x88')][_0x3334('0x89')])[_0x3334('0x8a')]();var _0x5eb8f8={'body':_0x4419a[_0x3334('0x58')],'channel':_0x3334('0x8b')};var _0x2a8cb0=[];var _0x761a83=[];var _0x103a32={};var _0x2eac4f=![];return db[_0x3334('0x8c')][_0x3334('0x61')]()[_0x3334('0x1e')](function(_0x1839db){if(!_0x1839db){throw new db['Sequelize'][(_0x3334('0x8d'))]('no\x20available\x20attributes');}_0x2a8cb0=_['difference'](_['keys'](_0x1839db),[_0x3334('0x8e'),'updatedAt']);_0x761a83=_[_0x3334('0x8f')](_[_0x3334('0x43')](_0x1839db),['createdAt',_0x3334('0x90'),_0x3334('0x91'),_0x3334('0x92')]);if(_0x4419a[_0x3334('0x58')]['id']){delete _0x4419a[_0x3334('0x58')]['id'];}if(_['isNil'](_0x4419a[_0x3334('0x58')][_0x3334('0x93')])){throw new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0x95'));}if(_[_0x3334('0x7a')](_0x4419a[_0x3334('0x58')][_0x3334('0x58')])||_0x4419a[_0x3334('0x58')]['body']===''){throw new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0x96'));}if(_[_0x3334('0x7a')](_0x4419a[_0x3334('0x58')]['mapKey'])){throw new db[(_0x3334('0x94'))]['ValidationError'](_0x3334('0x97')+_0x761a83);}if(!_[_0x3334('0x98')](_0x761a83,_0x4419a[_0x3334('0x58')]['mapKey'])){throw new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0x99')+_0x761a83);}_0x103a32[_0x4419a[_0x3334('0x58')][_0x3334('0x9a')]]=_0x4419a[_0x3334('0x58')][_0x3334('0x93')];})[_0x3334('0x1e')](function(){return db['ChatWebsite'][_0x3334('0x5d')]({'where':{'id':_0x4419a['params']['id']},'include':[{'model':db['CmList'],'as':_0x3334('0x9b'),'include':[{'model':db[_0x3334('0x8c')],'as':'Contacts','where':_0x103a32,'limit':0x1,'order':[[_0x3334('0x90'),'DESC']]}]},{'model':db[_0x3334('0x9c')],'as':_0x3334('0x9d')}]});})[_0x3334('0x1e')](handleEntityNotFound(_0x3a64d7,null))[_0x3334('0x1e')](function(_0x50cd14){if(_0x50cd14&&_0x50cd14[_0x3334('0x9b')]){_0x5eb8f8[_0x3334('0x9e')]=_0x50cd14;_0x5eb8f8[_0x3334('0x9f')]=_0x50cd14[_0x3334('0x9d')];_0x5eb8f8['list']=_0x50cd14[_0x3334('0x9b')];_0x5eb8f8[_0x3334('0x9f')]=_[_0x3334('0xa0')](_0x5eb8f8['applications'],[_0x3334('0xa1')],[_0x3334('0xa2')]);if(_0x5eb8f8['account'][_0x3334('0x9d')]){delete _0x5eb8f8[_0x3334('0x9e')]['Applications'];}if(_0x5eb8f8['account']['List']&&_0x5eb8f8['account'][_0x3334('0x9b')][_0x3334('0xa3')][_0x3334('0x48')]){return _0x5eb8f8[_0x3334('0x9e')]['List'][_0x3334('0xa3')][0x0];}var _0x1b762=_[_0x3334('0x18')](_0x4419a[_0x3334('0x58')],{'firstName':_0x4419a[_0x3334('0x58')][_0x3334('0x93')],'ListId':_0x50cd14['ListId']});_0x1b762[_0x4419a[_0x3334('0x58')][_0x3334('0x9a')]]=_0x4419a['body'][_0x3334('0x93')];return db[_0x3334('0x8c')][_0x3334('0x57')](_0x1b762,{'fields':_0x2a8cb0,'raw':!![]});}})['then'](handleEntityNotFound(_0x3a64d7,null))[_0x3334('0x1e')](function(_0x3771a3){_0x5eb8f8[_0x3334('0xa4')]=_0x3771a3;var _0x1303ba=_0x4419a[_0x3334('0x58')][_0x3334('0xa5')];if(_0x4419a[_0x3334('0x88')][_0x3334('0xa6')]){_0x1303ba=_0x4419a[_0x3334('0x88')]['cf-connecting-ip'];}else if(_0x4419a[_0x3334('0x88')][_0x3334('0xa7')]){_0x1303ba=_[_0x3334('0xa8')](_0x4419a[_0x3334('0x88')][_0x3334('0xa7')]['split'](','));}if(_0x3771a3){var _0x5c33e3={'ContactId':_0x3771a3['id'],'ChatWebsiteId':_0x4419a[_0x3334('0x63')]['id'],'from':(_0x3771a3[_0x3334('0xa9')]||'')+'\x20'+(_0x3771a3[_0x3334('0xaa')]||''),'customerIp':_0x1303ba,'customerPort':_0x4419a[_0x3334('0x88')]['x-real-port']?_0x4419a[_0x3334('0x88')][_0x3334('0xab')]:null,'referer':_0x4419a[_0x3334('0x58')][_0x3334('0xac')],'browserName':_0x4f0884[_0x3334('0xad')][_0x3334('0x38')]&&_0x4f0884[_0x3334('0xad')][_0x3334('0xae')]?util['format'](_0x3334('0xaf'),_0x4f0884[_0x3334('0xad')][_0x3334('0x38')],_0x4f0884[_0x3334('0xad')][_0x3334('0xae')]):_0x3334('0xb0'),'browserVersion':_0x4f0884[_0x3334('0xad')]['version']||_0x3334('0xb0'),'osName':util[_0x3334('0xb1')]('%s\x20%s',_0x4f0884['os'][_0x3334('0x38')],_0x4f0884['os']['version']),'osVersion':_0x4f0884['os'][_0x3334('0xae')],'deviceModel':_0x4f0884[_0x3334('0xb2')][_0x3334('0x40')]&&_0x4f0884[_0x3334('0xb2')]['vendor']?util[_0x3334('0xb1')](_0x3334('0xb3'),_0x4f0884['device'][_0x3334('0x40')],_0x4f0884[_0x3334('0xb2')][_0x3334('0xb4')],_0x4f0884['device'][_0x3334('0x3e')]):null,'deviceVendor':_0x4f0884[_0x3334('0xb2')][_0x3334('0xb4')],'deviceType':_0x4f0884['device']['type'],'formData':JSON[_0x3334('0x22')](_0x4419a[_0x3334('0x58')])};var _0x383b79={'ChatWebsiteId':_0x4419a['params']['id'],'closed':![]};if(_0x4419a[_0x3334('0x58')][_0x3334('0xb5')]){_0x383b79[_0x3334('0xb5')]=_0x4419a['body'][_0x3334('0xb5')];return db[_0x3334('0xb6')][_0x3334('0x5d')]({'where':_0x383b79})[_0x3334('0x1e')](function(_0x2b54b3){if(_0x2b54b3){return[_0x2b54b3,![]];}_0x5c33e3[_0x3334('0xb5')]=_0x4419a[_0x3334('0x58')][_0x3334('0xb5')];_0x5c33e3[_0x3334('0xb7')]=_0x4419a[_0x3334('0x58')][_0x3334('0xb7')];return db[_0x3334('0xb6')]['create'](_0x5c33e3)[_0x3334('0x1e')](function(_0x277c80){return[_0x277c80,!![]];});});}_0x383b79[_0x3334('0xb8')]=_0x3771a3['id'];if(_0x4419a[_0x3334('0x58')][_0x3334('0xb9')]&&_0x4419a[_0x3334('0x58')]['interaction']['id']){_0x383b79['id']=_0x4419a[_0x3334('0x58')]['interaction']['id'];return db[_0x3334('0xb6')][_0x3334('0x5d')]({'where':_0x383b79})['then'](function(_0x504c2d){if(_0x504c2d){return[_0x504c2d,![]];}return db['ChatInteraction'][_0x3334('0x57')](_0x5c33e3)['then'](function(_0x3d30f6){return[_0x3d30f6,!![]];});});}return db[_0x3334('0xb6')][_0x3334('0x57')](_0x5c33e3)[_0x3334('0x1e')](function(_0x4be62b){return[_0x4be62b,!![]];});}})[_0x3334('0xba')](function(_0x2de1e8,_0x592aab){if(_0x2de1e8){_0x2eac4f=_0x592aab;if(!_0x592aab){var _0xf23640={'from':(_0x5eb8f8[_0x3334('0xa4')][_0x3334('0xa9')]||'')+'\x20'+(_0x5eb8f8[_0x3334('0xa4')][_0x3334('0xaa')]||'')};if(_0x4419a[_0x3334('0x58')][_0x3334('0xb5')]&&_0x4419a[_0x3334('0x58')][_0x3334('0xbb')]&&_0x4419a[_0x3334('0x58')][_0x3334('0xb5')]!=_0x4419a[_0x3334('0x58')]['messageId']){_0xf23640[_0x3334('0xb5')]=_0x4419a[_0x3334('0x58')][_0x3334('0xbb')];}return _0x2de1e8['update'](_0xf23640);}else{return _0x2de1e8;}}})[_0x3334('0x1e')](function(_0x2f0cfd){_0x5eb8f8['interaction']=_0x2f0cfd[_0x3334('0x36')]({'plain':!![]});_0x5eb8f8[_0x3334('0xb9')][_0x3334('0xbc')]=_0x2eac4f;if(_0x5eb8f8[_0x3334('0xb9')][_0x3334('0xbc')]){if(_0x5eb8f8['account'][_0x3334('0xbd')]){_0x5eb8f8[_0x3334('0x9f')][_0x3334('0xbe')]({'id':0x0,'priority':_0x5eb8f8[_0x3334('0x9f')][_0x3334('0x48')]+0x1,'app':'close','appdata':_0x3334('0xbf'),'interval':_0x3334('0xc0')});}}return db['ChatMessage'][_0x3334('0x57')]({'body':_0x4419a[_0x3334('0x58')]['body'],'ChatWebsiteId':_0x4419a['params']['id'],'ChatInteractionId':_0x2f0cfd['id'],'direction':'in','ContactId':_0x5eb8f8[_0x3334('0xa4')]['id'],'AttachmentId':_0x4419a[_0x3334('0x58')][_0x3334('0xc1')]});})[_0x3334('0x1e')](function(_0x41b317){_0x5eb8f8['message']=_0x41b317;if(_0x5eb8f8[_0x3334('0xb9')][_0x3334('0xc2')]){return db['User']['find']({'attributes':['id',_0x3334('0x38')],'where':{'id':_0x5eb8f8[_0x3334('0xb9')]['UserId']}})[_0x3334('0x1e')](function(_0x5f1eed){if(_0x5f1eed){_0x5eb8f8[_0x3334('0x9f')][_0x3334('0xc3')]({'id':0x0,'priority':0x0,'app':_0x3334('0xc4'),'appdata':_0x5f1eed[_0x3334('0x38')]+','+(_0x5eb8f8[_0x3334('0x9e')][_0x3334('0xc5')]||0xa),'interval':_0x3334('0xc0')});_0x5eb8f8[_0x3334('0xc6')]=!![];}return respondWithRpcPromise(_0x3334('0xc7'),_0x3334('0xc8'),_0x5eb8f8);});}return respondWithRpcPromise('Start',_0x3334('0xc8'),_0x5eb8f8);})['then'](function(_0x295eb0){respondWithRpcPromise(_0x3334('0xc9'),_0x3334('0xc9'),{'event':_0x3334('0x86'),'message':_0x295eb0},client9002);return _0x295eb0;})[_0x3334('0x1e')](respondWithResult(_0x3a64d7,null))['catch'](handleError(_0x3a64d7,null));};exports['offline']=function(_0x11635e,_0x2bd0b3,_0x277c10){var _0x3fe386,_0x1c8765,_0x332976;var _0x31ec82=[];var _0x1d754e=[];var _0x4d1967={};var _0x1ed86a=_0x11635e['files']||[];var _0x32c857=[];var _0x993bab;return db[_0x3334('0x8c')]['describe']()[_0x3334('0x1e')](function(_0x5947eb){if(!_0x5947eb){throw new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0xca'));}_0x1d754e=_[_0x3334('0x8f')](_['keys'](_0x5947eb),[_0x3334('0x8e'),_0x3334('0x90')]);_0x31ec82=_['difference'](_[_0x3334('0x43')](_0x5947eb),[_0x3334('0x8e'),_0x3334('0x90'),_0x3334('0x91'),_0x3334('0x92')]);if(_0x11635e[_0x3334('0x58')]['id']){delete _0x11635e[_0x3334('0x58')]['id'];}if(_[_0x3334('0x7a')](_0x11635e[_0x3334('0x58')][_0x3334('0x93')])){throw _0x2bd0b3['status'](0x1f4)['send'](new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0x95')));}if(_[_0x3334('0x7a')](_0x11635e['body'][_0x3334('0x58')])||_0x11635e[_0x3334('0x58')][_0x3334('0x58')]===''){throw _0x2bd0b3[_0x3334('0x2a')](0x1f4)['send'](new db[(_0x3334('0x94'))]['ValidationError'](_0x3334('0x96')));}if(_[_0x3334('0x7a')](_0x11635e['body'][_0x3334('0xcb')])){throw _0x2bd0b3[_0x3334('0x2a')](0x1f4)[_0x3334('0x39')](new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0xcc')+_0x31ec82));}if(!_[_0x3334('0x98')](_0x31ec82,_0x11635e[_0x3334('0x58')][_0x3334('0xcb')])){throw _0x2bd0b3['status'](0x1f4)[_0x3334('0x39')](new db[(_0x3334('0x94'))]['ValidationError'](_0x3334('0xcd')+_0x31ec82));}_0x4d1967[_0x11635e[_0x3334('0x58')][_0x3334('0xcb')]]=_0x11635e[_0x3334('0x58')][_0x3334('0x93')];})[_0x3334('0x1e')](function(){return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x11635e[_0x3334('0x63')]['id']},'include':[{'model':db[_0x3334('0xce')],'as':_0x3334('0x9b')},{'model':db[_0x3334('0xcf')],'as':_0x3334('0xcf')}]});})[_0x3334('0x1e')](handleEntityNotFound(_0x2bd0b3,null))['then'](function(_0x51e286){if(_0x51e286&&_0x51e286[_0x3334('0x9b')]){_0x1c8765=_0x51e286;var _0x337692=_[_0x3334('0x18')](_0x11635e['body'],{'firstName':_0x11635e['body']['from'],'phone':_0x11635e[_0x3334('0x58')][_0x3334('0x93')],'ListId':_0x51e286[_0x3334('0x92')]});_0x337692[_0x11635e[_0x3334('0x58')][_0x3334('0xcb')]]=_0x11635e[_0x3334('0x58')][_0x3334('0x93')];return db[_0x3334('0x8c')][_0x3334('0xd0')]({'where':_0x4d1967,'defaults':_0x337692});}})[_0x3334('0xba')](function(_0x593364){if(_0x593364){_0x332976=_0x593364;var _0x394ebf=fs[_0x3334('0xd1')](path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0xd2')),_0x3334('0xd3'));var _0x17bf27=ejs[_0x3334('0xd4')](_0x394ebf,{'body':_[_0x3334('0xd5')](_0x11635e[_0x3334('0x58')][_0x3334('0x58')]),'bodyTitle':_0x1c8765[_0x3334('0xd6')]});return db['ChatOfflineMessage']['create']({'body':_0x17bf27,'ContactId':_0x593364['id'],'ChatWebsiteId':_0x1c8765['id']});}})[_0x3334('0x1e')](function(_0x1f0194){_0x993bab=_0x1f0194;if(_0x1ed86a[_0x3334('0x48')]){var _0x31c262=_0x1ed86a[_0x3334('0x41')](function(_0x34d2b1){return{'name':_0x34d2b1[_0x3334('0xd7')],'basename':_0x34d2b1[_0x3334('0x6e')],'type':_0x34d2b1['mimetype'],'ChatOfflineMessageId':_0x1f0194['id']};});_0x32c857=_0x31c262[_0x3334('0x41')](_0x568146=>{var _0x24bbf4={'filename':_0x568146[_0x3334('0x38')],'path':path[_0x3334('0x74')](config[_0x3334('0x75')],'server',_0x3334('0xd8'),'attachments',_0x3334('0xd9'),_0x568146[_0x3334('0xda')])};return _0x24bbf4;});if(!_0x1c8765[_0x3334('0xdb')]){return db[_0x3334('0xdc')][_0x3334('0xdd')](function(_0x1e7ba0){return db[_0x3334('0xde')]['bulkCreate'](_0x31c262,{'transaction':_0x1e7ba0});});}}})[_0x3334('0x1e')](function(){if(_0x993bab){_0x3fe386=_0x993bab;return db[_0x3334('0xcf')][_0x3334('0x65')]({'where':{'active':!![]},'include':[{'model':db[_0x3334('0xdf')],'as':_0x3334('0xe0'),'raw':!![]}]});}})[_0x3334('0x1e')](function(_0x44d62b){if(_0x44d62b&&_0x44d62b[_0x3334('0xe0')]&&_0x1c8765[_0x3334('0xe1')]&&_0x1c8765[_0x3334('0xe2')]){var _0x38e434={'tls':{'rejectUnauthorized':![]}};if(_0x44d62b[_0x3334('0xe0')]['service']){_0x38e434[_0x3334('0xe3')]=_0x44d62b[_0x3334('0xe0')][_0x3334('0xe3')];}else{_0x38e434['host']=_0x44d62b[_0x3334('0xe0')][_0x3334('0xe4')];_0x38e434['port']=_0x44d62b['Smtp'][_0x3334('0xe5')];_0x38e434[_0x3334('0xe6')]=_0x44d62b['Smtp'][_0x3334('0xe6')];}if(_0x44d62b[_0x3334('0xe0')][_0x3334('0xe7')]){_0x38e434[_0x3334('0xe8')]={'user':_0x44d62b['Smtp'][_0x3334('0x59')],'pass':_0x44d62b[_0x3334('0xe0')][_0x3334('0xe9')]};}return respondWithRpcPromise(_0x3334('0xea'),_0x3334('0xeb'),{'account':_0x38e434,'message':{'from':util[_0x3334('0xb1')](_0x3334('0xec'),_0x44d62b[_0x3334('0x38')],_0x44d62b[_0x3334('0xed')]||_0x44d62b[_0x3334('0xe0')]['user']),'to':_0x1c8765['forwardOfflineAddress'],'subject':_0x1c8765['offlineMessageSubject'],'html':_0x3fe386[_0x3334('0x58')],'attachments':_0x32c857}},client9003)[_0x3334('0x1e')](function(){return _0x3fe386;})[_0x3334('0x28')](function(_0x221770){console[_0x3334('0x23')](_0x221770);});}})['then'](function(){if(_0x1c8765&&_0x1c8765[_0x3334('0xdb')]&&_0x1c8765[_0x3334('0xee')]){var _0x18bae5=[];if(_0x1ed86a['length']){_0x18bae5=_0x1ed86a[_0x3334('0x41')](function(_0x5cb97d){return{'name':_0x5cb97d[_0x3334('0xd7')],'basename':_0x5cb97d[_0x3334('0x6e')],'type':_0x5cb97d['mimetype'],'ChatOfflineMessageId':_0x993bab['id']};});}var _0x11a477;if(!_[_0x3334('0x7a')](_0x1c8765[_0x3334('0xef')])){var _0x20a909=_[_0x3334('0x41')](_0x11635e['body'],function(_0x378cc9){return _0x378cc9;});var _0x492c53=_[_0x3334('0xf0')](_0x20a909)[0x0];var _0x11e743=_[_0x3334('0xf1')](_0x492c53,function(_0x58e943){return _0x58e943;});_0x11a477=_0x11e743[0x1][_0x1c8765[_0x3334('0xef')]];}var _0x2f22fa={'from':_0x332976['email'],'firstName':_0x332976[_0x3334('0xa9')],'lastName':_0x332976[_0x3334('0xaa')],'mapKey':_0x3334('0xed'),'message':{'from':_0x332976[_0x3334('0xed')],'to':_0x1c8765[_0x3334('0xcf')][_0x3334('0xed')],'cc':'','subject':_[_0x3334('0x7a')](_0x11a477)?_0x1c8765[_0x3334('0xf2')]:_0x11a477,'messageId':'','sentAt':new Date(),'attach':_0x18bae5[_0x3334('0x48')],'attachments':_0x18bae5,'originChannel':_0x3334('0xf3'),'ChatWebsiteId':_0x1c8765['id'],'ChatOfflineMessageId':_0x3fe386['id'],'originTo':_0x1c8765[_0x3334('0xcf')]['email']},'body':_0x3fe386['body']};var _0x4a6f07={'account':{'id':_0x1c8765[_0x3334('0xee')]},'body':_0x2f22fa,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x3334('0xf4'),'notifyMail',_0x4a6f07,client9001)['then'](function(){return _0x3fe386;})[_0x3334('0x28')](function(_0x3d2ca1){console[_0x3334('0x23')](_0x3d2ca1);});}return;})[_0x3334('0x1e')](function(){if(_0x3fe386){return _0x3fe386;}})[_0x3334('0x1e')](respondWithResult(_0x2bd0b3,null))[_0x3334('0x28')](function(_0x149884){console[_0x3334('0x23')]('catch',_0x149884);for(var _0x1a979b of _0x1ed86a){var _0xd1811a=path[_0x3334('0x74')](config[_0x3334('0x75')],'server',_0x3334('0xd8'),_0x3334('0xf5'),_0x3334('0xd9'),_0x1a979b['filename']);fs_extra[_0x3334('0xf6')](_0xd1811a)[_0x3334('0x28')](function(_0x3e3dca){console[_0x3334('0x23')](_0x3334('0xf7'),_0xd1811a,_0x3e3dca);});}});};exports[_0x3334('0xf8')]=function(_0x59042c,_0x5ab8e0,_0x355f70){return db['ChatInteraction'][_0x3334('0x5d')]({'where':{'id':_0x59042c[_0x3334('0x63')]['id']}})['then'](handleEntityNotFound(_0x5ab8e0,null))['then'](function(_0x597681){if(_0x597681){return _0x597681['addInteraction'](_0x59042c[_0x3334('0x58')][_0x3334('0x69')],_[_0x3334('0xf9')](_0x59042c[_0x3334('0x58')],[_0x3334('0x69'),'id'])||{});}})['then'](respondWithResult(_0x5ab8e0,null))[_0x3334('0x28')](handleError(_0x5ab8e0,null));};exports[_0x3334('0xfa')]=function(_0x50fab3,_0x502ad1,_0x2d7926){var _0x29f833={'raw':![],'where':{}};var _0x45c278={};var _0x27852a={'count':0x0,'rows':[]};return db[_0x3334('0x3c')][_0x3334('0x65')]({'where':{'id':_0x50fab3[_0x3334('0x63')]['id']}})['then'](handleEntityNotFound(_0x502ad1,null))[_0x3334('0x1e')](function(_0x4e9002){if(_0x4e9002){_0x45c278[_0x3334('0x40')]=_['keys'](db[_0x3334('0xb6')][_0x3334('0x56')]);_0x45c278[_0x3334('0x42')]=_[_0x3334('0x43')](_0x50fab3[_0x3334('0x42')]);_0x45c278[_0x3334('0x44')]=_['intersection'](_0x45c278[_0x3334('0x40')],_0x45c278[_0x3334('0x42')]);_0x29f833['attributes']=_[_0x3334('0x45')](_0x45c278[_0x3334('0x40')],qs[_0x3334('0x47')](_0x50fab3[_0x3334('0x42')][_0x3334('0x47')]));_0x29f833['attributes']=_0x29f833[_0x3334('0x46')]['length']?_0x29f833[_0x3334('0x46')]:_0x45c278['model'];if(!_0x50fab3[_0x3334('0x42')][_0x3334('0x66')](_0x3334('0x49'))){_0x29f833[_0x3334('0x30')]=qs[_0x3334('0x30')](_0x50fab3['query'][_0x3334('0x30')]);_0x29f833[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x50fab3[_0x3334('0x42')][_0x3334('0x2d')]);}_0x29f833[_0x3334('0x4a')]=qs[_0x3334('0x4b')](_0x50fab3[_0x3334('0x42')][_0x3334('0x4b')]);_0x29f833['where']=qs['filters'](_[_0x3334('0x4d')](_0x50fab3['query'],_0x45c278['filters']));_0x29f833[_0x3334('0x4c')][_0x3334('0x67')]=_0x4e9002['id'];if(_0x50fab3['query'][_0x3334('0x4e')]){_0x29f833[_0x3334('0x4c')]=_[_0x3334('0x4f')](_0x29f833[_0x3334('0x4c')],{'$or':_[_0x3334('0x41')](_0x29f833[_0x3334('0x46')],function(_0x5f517d){var _0x5b94c9={};_0x5b94c9[_0x5f517d]={'$like':'%'+_0x50fab3[_0x3334('0x42')][_0x3334('0x4e')]+'%'};return _0x5b94c9;})});}_0x29f833=_['merge']({},_0x29f833,_0x50fab3[_0x3334('0x51')]);return db[_0x3334('0xb6')][_0x3334('0x2f')]({'where':_0x29f833[_0x3334('0x4c')]})[_0x3334('0x1e')](function(_0x5e15b1){_0x27852a[_0x3334('0x2f')]=_0x5e15b1;if(_0x50fab3['query']['includeAll']){_0x29f833['include']=[{'model':db[_0x3334('0x8c')],'as':_0x3334('0xfb'),'required':![]},{'model':db[_0x3334('0xfc')],'as':'Owner','attributes':[_0x3334('0x38'),_0x3334('0xfd'),_0x3334('0xfe')],'required':![]},{'model':db[_0x3334('0xff')],'as':_0x3334('0x100'),'attributes':['id','name',_0x3334('0x101')],'where':_0x50fab3[_0x3334('0x42')]['tag']?{'id':_0x50fab3[_0x3334('0x42')][_0x3334('0x102')]}:undefined,'required':_0x50fab3[_0x3334('0x42')][_0x3334('0x102')]?!![]:![]}];}return db[_0x3334('0xb6')]['findAll'](_0x29f833);})[_0x3334('0x1e')](function(_0x3a09e6){_0x27852a[_0x3334('0x103')]=_0x3a09e6;return _0x27852a;});}})['then'](respondWithFilteredResult(_0x502ad1,_0x29f833))[_0x3334('0x28')](handleError(_0x502ad1,null));};function iftimePromise(_0x3fd988,_0x5b5537){return respondWithRpcPromise(_0x3334('0x104'),'getSnippet',{'command':_0x5b5537[_0x3334('0x105')]?util[_0x3334('0xb1')](_0x3334('0x106'),_0x3fd988[_0x3334('0x107')],_0x5b5537[_0x3334('0x105')]):util[_0x3334('0xb1')]('iftime\x20%s',_0x3fd988['interval'])},client9002)['then'](function(_0x20d7c6){var _0x332df0=_0x20d7c6&&_0x20d7c6[_0x3334('0x108')](_0x3334('0x109'))>=0x0?!![]:![];logger[_0x3334('0x1f')](_0x3334('0x10a'),_0x5b5537['id'],_0x3fd988['id'],_0x3fd988[_0x3334('0x107')],_0x332df0?_0x3334('0x10b'):_0x3334('0x10c'),_0x5b5537['timezone']?_0x5b5537[_0x3334('0x105')]:'No\x20timezone');return _0x332df0;})[_0x3334('0x28')](function(_0x39d76b){logger['error'](_0x3334('0x10a'),_0x5b5537['id'],_0x3fd988['id'],_0x3fd988['interval'],util['inspect'](_0x39d76b,{'showHidden':![],'depth':null}),_0x5b5537[_0x3334('0x105')]?_0x5b5537['timezone']:_0x3334('0x10d'));return![];});}exports[_0x3334('0x10e')]=function(_0x37a9bf,_0x5c3ae8,_0x52794c){var _0x5b39d4=0x0;var _0x21768d=0x0;var _0x43e6ee=![];var _0x312dcf;var _0xcf86c4;return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x37a9bf[_0x3334('0x63')]['id']},'include':[{'model':db['Interval'],'as':_0x3334('0x10f'),'include':[{'model':db[_0x3334('0x10f')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x3334('0x1e')](handleEntityNotFound(_0x5c3ae8,null))['then'](function(_0x192873){if(_0x192873){_0x312dcf=_0x192873;return _0x192873[_0x3334('0x110')]({'raw':!![]});}})[_0x3334('0x1e')](function(_0x13ce22){if(_0x312dcf){if(_0x13ce22){_0xcf86c4=_0x13ce22;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0xd41b0f){if(_0xd41b0f){_0x21768d=_0xd41b0f[_0x3334('0x111')];_0x43e6ee=_0xd41b0f[_0x3334('0x79')];}})[_0x3334('0x1e')](function(){return db[_0x3334('0xb6')][_0x3334('0x2f')]({'where':{'closed':![]}});})[_0x3334('0x1e')](function(_0x17c7f2){_0x5b39d4=_0x17c7f2;if(_0x21768d&&_0x17c7f2>_0x21768d){return db[_0x3334('0x112')][_0x3334('0x65')]({'where':{'id':0x1}})[_0x3334('0x1e')](function(_0x1669d3){if(_0x1669d3){_0x1669d3[_0x3334('0x113')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x312dcf[_0x3334('0x10f')]&&_0x312dcf['Interval'][_0x3334('0x114')]){var _0x318e7f=[];for(var _0x4aa86d=0x0;_0x4aa86d<_0x312dcf['Interval'][_0x3334('0x114')][_0x3334('0x48')];_0x4aa86d++){var _0x36581a=_0x312dcf[_0x3334('0x10f')][_0x3334('0x114')][_0x4aa86d][_0x3334('0x36')]({'plain':!![]});_0x318e7f[_0x3334('0xbe')](iftimePromise(_0x36581a,_0x312dcf));}return BPromise[_0x3334('0x115')](_0x318e7f)[_0x3334('0x1e')](function(_0x208c4d){return _['some'](_0x208c4d);});}else{return!![];}})[_0x3334('0x1e')](function(_0xc1d7f7){var _0x1998ed=fs[_0x3334('0xd1')](path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x116')),_0x3334('0xd3'));var _0x33d77f={'remote':_0x312dcf[_0x3334('0x117')],'query':querystring[_0x3334('0x22')](_[_0x3334('0x4f')](_0x312dcf[_0x3334('0x36')]({'plain':!![]}),{'customerIp':_0x37a9bf[_0x3334('0x88')][_0x3334('0xa7')]||_0x37a9bf[_0x3334('0x88')][_0x3334('0x118')]||_0x37a9bf[_0x3334('0x119')][_0x3334('0x11a')]||_0x37a9bf['ip'],'referer':_0x37a9bf['headers']['referer'],'openedInteractions':_0x5b39d4,'maxInteractions':_0x21768d,'virtual':_0x43e6ee[_0x3334('0x111')],'online':_0xc1d7f7,'custom':_0x43e6ee}))[_0x3334('0x11b')](/'/g,'\x5c\x27')};_0x5c3ae8['send'](ejs[_0x3334('0xd4')](Mustache[_0x3334('0xd4')](_0x1998ed,_0x33d77f),{'proactiveActions':_0xcf86c4,'alignment':_0x312dcf[_0x3334('0x11c')],'verticalAlignment':_0x312dcf[_0x3334('0x11d')],'div_color':_0x312dcf[_0x3334('0x101')],'text_color':_0x312dcf[_0x3334('0x11e')],'button_color':_0x312dcf['color_button'],'background_color':_0x312dcf['backgroundColor']}));})[_0x3334('0x28')](handleError(_0x5c3ae8,null));};exports[_0x3334('0x11f')]=function(_0x3f8157,_0x323e7c,_0x4e308b){return db[_0x3334('0x3c')][_0x3334('0x65')]({'where':{'id':_0x3f8157[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x323e7c,null))['then'](function(_0x6a1471){if(_0x6a1471){return db[_0x3334('0xdc')]['transaction'](function(_0x16736e){return db[_0x3334('0x9c')]['destroy']({'where':{'ChatWebsiteId':_0x3f8157[_0x3334('0x63')]['id']},'transaction':_0x16736e})[_0x3334('0x1e')](function(_0x47428b){var _0x360de3=_[_0x3334('0x41')](_0x3f8157[_0x3334('0x58')],function(_0x218ee6){_0x218ee6['ChatWebsiteId']=_0x3f8157[_0x3334('0x63')]['id'];return _0x218ee6;});return db[_0x3334('0x9c')][_0x3334('0x120')](_0x360de3,{'transaction':_0x16736e});});})['then'](function(){return db[_0x3334('0x9c')][_0x3334('0x121')]({'where':{'ChatWebsiteId':_0x3f8157[_0x3334('0x63')]['id']},'order':_0x3334('0xa1')});});}})[_0x3334('0x1e')](respondWithResult(_0x323e7c,null))[_0x3334('0x28')](handleError(_0x323e7c,null));};exports[_0x3334('0x122')]=function(_0x3133ae,_0x3e0f23,_0x3bbdf5){var _0x582240={};var _0x1bdc89={};var _0x2fe176;var _0x836cab;return db[_0x3334('0x3c')][_0x3334('0x65')]({'where':{'id':_0x3133ae[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x3e0f23,null))[_0x3334('0x1e')](function(_0x429b1a){if(_0x429b1a){_0x2fe176=_0x429b1a;_0x1bdc89[_0x3334('0x40')]=_[_0x3334('0x43')](db['ChatApplication'][_0x3334('0x56')]);_0x1bdc89[_0x3334('0x42')]=_[_0x3334('0x43')](_0x3133ae['query']);_0x1bdc89[_0x3334('0x44')]=_[_0x3334('0x45')](_0x1bdc89[_0x3334('0x40')],_0x1bdc89['query']);_0x582240[_0x3334('0x46')]=_[_0x3334('0x45')](_0x1bdc89[_0x3334('0x40')],qs[_0x3334('0x47')](_0x3133ae[_0x3334('0x42')][_0x3334('0x47')]));_0x582240[_0x3334('0x46')]=_0x582240[_0x3334('0x46')][_0x3334('0x48')]?_0x582240[_0x3334('0x46')]:_0x1bdc89[_0x3334('0x40')];_0x582240[_0x3334('0x4a')]=qs[_0x3334('0x4b')](_0x3133ae[_0x3334('0x42')]['sort']);_0x582240['where']=qs[_0x3334('0x44')](_[_0x3334('0x4d')](_0x3133ae[_0x3334('0x42')],_0x1bdc89[_0x3334('0x44')]));if(_0x3133ae['query'][_0x3334('0x4e')]){_0x582240[_0x3334('0x4c')]=_['merge'](_0x582240[_0x3334('0x4c')],{'$or':_[_0x3334('0x41')](_0x582240[_0x3334('0x46')],function(_0x51b27a){var _0x2523f7={};_0x2523f7[_0x51b27a]={'$like':'%'+_0x3133ae[_0x3334('0x42')]['filter']+'%'};return _0x2523f7;})});}_0x582240=_[_0x3334('0x4f')]({},_0x582240,_0x3133ae[_0x3334('0x51')]);return _0x2fe176[_0x3334('0x122')](_0x582240);}})[_0x3334('0x1e')](function(_0x59dab6){if(_0x59dab6){_0x836cab=_0x59dab6[_0x3334('0x48')];if(!_0x3133ae['query'][_0x3334('0x66')](_0x3334('0x49'))){_0x582240[_0x3334('0x30')]=qs[_0x3334('0x30')](_0x3133ae['query']['limit']);_0x582240[_0x3334('0x2d')]=qs['offset'](_0x3133ae[_0x3334('0x42')][_0x3334('0x2d')]);}return _0x2fe176[_0x3334('0x122')](_0x582240);}})[_0x3334('0x1e')](function(_0x3c46d9){if(_0x3c46d9){return _0x3c46d9?{'count':_0x836cab,'rows':_0x3c46d9}:null;}})[_0x3334('0x1e')](respondWithResult(_0x3e0f23,null))['catch'](handleError(_0x3e0f23,null));};exports[_0x3334('0x123')]=function(_0x2a2be7,_0x34f92b,_0x257c09){return db[_0x3334('0x124')][_0x3334('0x5d')]({'where':{'id':_0x2a2be7[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x34f92b,null))[_0x3334('0x1e')](function(_0x5f5cf4){if(_0x5f5cf4){return _0x5f5cf4[_0x3334('0x123')](_0x2a2be7[_0x3334('0x58')][_0x3334('0x69')],_[_0x3334('0xf9')](_0x2a2be7[_0x3334('0x58')],['ids','id'])||{});}})[_0x3334('0x1e')](respondWithResult(_0x34f92b,null))['catch'](handleError(_0x34f92b,null));};exports[_0x3334('0x110')]=function(_0x1fc116,_0x36fc89,_0x51225a){var _0xec5b49={};var _0x1eb65e={};var _0x27fc03;var _0x583ef8;return db['ChatWebsite'][_0x3334('0x65')]({'where':{'id':_0x1fc116['params']['id']}})['then'](handleEntityNotFound(_0x36fc89,null))[_0x3334('0x1e')](function(_0x147554){if(_0x147554){_0x27fc03=_0x147554;_0x1eb65e[_0x3334('0x40')]=_['keys'](db['ChatProactiveAction'][_0x3334('0x56')]);_0x1eb65e[_0x3334('0x42')]=_[_0x3334('0x43')](_0x1fc116['query']);_0x1eb65e[_0x3334('0x44')]=_[_0x3334('0x45')](_0x1eb65e[_0x3334('0x40')],_0x1eb65e[_0x3334('0x42')]);_0xec5b49[_0x3334('0x46')]=_[_0x3334('0x45')](_0x1eb65e[_0x3334('0x40')],qs[_0x3334('0x47')](_0x1fc116[_0x3334('0x42')][_0x3334('0x47')]));_0xec5b49[_0x3334('0x46')]=_0xec5b49[_0x3334('0x46')]['length']?_0xec5b49[_0x3334('0x46')]:_0x1eb65e[_0x3334('0x40')];_0xec5b49[_0x3334('0x4a')]=qs[_0x3334('0x4b')](_0x1fc116[_0x3334('0x42')][_0x3334('0x4b')]);_0xec5b49[_0x3334('0x4c')]=qs[_0x3334('0x44')](_[_0x3334('0x4d')](_0x1fc116[_0x3334('0x42')],_0x1eb65e[_0x3334('0x44')]));if(_0x1fc116[_0x3334('0x42')][_0x3334('0x4e')]){_0xec5b49[_0x3334('0x4c')]=_['merge'](_0xec5b49[_0x3334('0x4c')],{'$or':_[_0x3334('0x41')](_0xec5b49[_0x3334('0x46')],function(_0x377057){var _0x32bf81={};_0x32bf81[_0x377057]={'$like':'%'+_0x1fc116[_0x3334('0x42')]['filter']+'%'};return _0x32bf81;})});}_0xec5b49=_[_0x3334('0x4f')]({},_0xec5b49,_0x1fc116[_0x3334('0x51')]);return _0x27fc03[_0x3334('0x110')](_0xec5b49);}})[_0x3334('0x1e')](function(_0x55a5a2){if(_0x55a5a2){_0x583ef8=_0x55a5a2['length'];if(!_0x1fc116[_0x3334('0x42')][_0x3334('0x66')](_0x3334('0x49'))){_0xec5b49['limit']=qs[_0x3334('0x30')](_0x1fc116['query'][_0x3334('0x30')]);_0xec5b49[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x1fc116['query'][_0x3334('0x2d')]);}return _0x27fc03[_0x3334('0x110')](_0xec5b49);}})[_0x3334('0x1e')](function(_0x57c3d8){if(_0x57c3d8){return _0x57c3d8?{'count':_0x583ef8,'rows':_0x57c3d8}:null;}})[_0x3334('0x1e')](respondWithResult(_0x36fc89,null))[_0x3334('0x28')](handleError(_0x36fc89,null));};exports[_0x3334('0x125')]=function(_0x2dfd1e,_0x225d41,_0xddb1e0){var _0xe13317=_0x2dfd1e[_0x3334('0x42')][_0x3334('0x126')]===_0x3334('0x127')?_0x3334('0x128'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0xe13317],'where':{'id':_0x2dfd1e['params']['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x225d41,null))[_0x3334('0x1e')](function(_0x38066b){if(_0x38066b){var _0x36b302=_0x38066b[_0xe13317];var _0x42cd18=_0x36b302&&_0x36b302[_0x3334('0x129')]?_0x36b302[_0x3334('0x129')]:[];_0x225d41['send']({'fromKey':_['isNil'](_0x36b302['fromKey'])?undefined:_0x36b302[_0x3334('0x12a')],'count':_0x42cd18[_0x3334('0x48')],'rows':_0x42cd18});}})[_0x3334('0x28')](handleError(_0x225d41,null));};exports[_0x3334('0x12b')]=function(_0x238ff5,_0x227bb4,_0x750287){var _0x8e6873={'raw':![],'where':{}};var _0x360f55={};var _0x3f1d1c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3334('0x65')]({'where':{'id':_0x238ff5[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x227bb4,null))[_0x3334('0x1e')](function(_0x5dab55){if(_0x5dab55){_0x360f55[_0x3334('0x40')]=_['keys'](db[_0x3334('0x12c')][_0x3334('0x56')]);_0x360f55[_0x3334('0x42')]=_[_0x3334('0x43')](_0x238ff5[_0x3334('0x42')]);_0x360f55['filters']=_[_0x3334('0x45')](_0x360f55[_0x3334('0x40')],_0x360f55[_0x3334('0x42')]);_0x8e6873[_0x3334('0x46')]=_['intersection'](_0x360f55[_0x3334('0x40')],qs[_0x3334('0x47')](_0x238ff5[_0x3334('0x42')][_0x3334('0x47')]));_0x8e6873['attributes']=_0x8e6873['attributes'][_0x3334('0x48')]?_0x8e6873[_0x3334('0x46')]:_0x360f55['model'];if(!_0x238ff5[_0x3334('0x42')]['hasOwnProperty'](_0x3334('0x49'))){_0x8e6873['limit']=qs[_0x3334('0x30')](_0x238ff5[_0x3334('0x42')][_0x3334('0x30')]);_0x8e6873[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x238ff5[_0x3334('0x42')][_0x3334('0x2d')]);}_0x8e6873['order']=qs[_0x3334('0x4b')](_0x238ff5[_0x3334('0x42')][_0x3334('0x4b')]);_0x8e6873['where']=qs['filters'](_[_0x3334('0x4d')](_0x238ff5[_0x3334('0x42')],_0x360f55[_0x3334('0x44')]));_0x8e6873[_0x3334('0x4c')]['ChatWebsiteId']=_0x5dab55['id'];if(_0x238ff5[_0x3334('0x42')][_0x3334('0x4e')]){_0x8e6873[_0x3334('0x4c')]=_[_0x3334('0x4f')](_0x8e6873[_0x3334('0x4c')],{'$or':_['map'](_0x8e6873['attributes'],function(_0x31a28d){var _0x590059={};_0x590059[_0x31a28d]={'$like':'%'+_0x238ff5[_0x3334('0x42')][_0x3334('0x4e')]+'%'};return _0x590059;})});}_0x8e6873=_[_0x3334('0x4f')]({},_0x8e6873,_0x238ff5['options']);return db[_0x3334('0x12c')][_0x3334('0x2f')]({'where':_0x8e6873[_0x3334('0x4c')]})[_0x3334('0x1e')](function(_0x5c7d7a){_0x3f1d1c[_0x3334('0x2f')]=_0x5c7d7a;if(_0x238ff5['query']['includeAll']){_0x8e6873[_0x3334('0x53')]=[{'all':!![]}];}else{_0x8e6873['include']=[{'model':db[_0x3334('0x8c')],'as':_0x3334('0xfb'),'required':![]},{'model':db['Attachment'],'as':_0x3334('0x12d'),'required':![]}];}return db[_0x3334('0x12c')][_0x3334('0x54')](_0x8e6873);})[_0x3334('0x1e')](function(_0x3eb237){_0x3f1d1c[_0x3334('0x103')]=_0x3eb237;return _0x3f1d1c;});}})[_0x3334('0x1e')](respondWithFilteredResult(_0x227bb4,_0x8e6873))['catch'](handleError(_0x227bb4,null));};exports['addAgents']=function(_0x5802ee,_0x9d6937,_0x461ef5){return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x5802ee[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x9d6937,null))['then'](function(_0x39966d){if(_0x39966d){return _0x39966d[_0x3334('0x12e')](_0x5802ee[_0x3334('0x58')]['ids'],_[_0x3334('0xf9')](_0x5802ee[_0x3334('0x58')],[_0x3334('0x69'),'id'])||{})[_0x3334('0xba')](function(_0x42488f){for(var _0xf7dbbd=0x0;_0xf7dbbd<_0x5802ee['body']['ids'][_0x3334('0x48')];_0xf7dbbd+=0x1){socket[_0x3334('0x12f')](_0x3334('0x130'),{'UserId':Number(_0x5802ee[_0x3334('0x58')][_0x3334('0x69')][_0xf7dbbd]),'ChatWebsiteId':Number(_0x5802ee[_0x3334('0x63')]['id'])});}return _0x42488f;});}})[_0x3334('0x1e')](respondWithResult(_0x9d6937,null))['catch'](handleError(_0x9d6937,null));};exports[_0x3334('0x131')]=function(_0x27f565,_0x5e5b28,_0x1ad2b4){return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x27f565[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x5e5b28,null))[_0x3334('0x1e')](function(_0x4764fb){if(_0x4764fb){return _0x4764fb[_0x3334('0x131')](_0x27f565['query'][_0x3334('0x69')])[_0x3334('0x1e')](function(){if(_[_0x3334('0x132')](_0x27f565[_0x3334('0x42')][_0x3334('0x69')])){for(var _0x1e660b=0x0;_0x1e660b<_0x27f565['query'][_0x3334('0x69')][_0x3334('0x48')];_0x1e660b+=0x1){socket[_0x3334('0x12f')](_0x3334('0x133'),{'UserId':Number(_0x27f565[_0x3334('0x42')][_0x3334('0x69')][_0x1e660b]),'ChatWebsiteId':Number(_0x27f565['params']['id'])});}}else{socket[_0x3334('0x12f')](_0x3334('0x133'),{'UserId':Number(_0x27f565[_0x3334('0x42')][_0x3334('0x69')]),'ChatWebsiteId':Number(_0x27f565[_0x3334('0x63')]['id'])});}});}})[_0x3334('0x1e')](respondWithStatusCode(_0x5e5b28,null))['catch'](handleError(_0x5e5b28,null));};exports[_0x3334('0x134')]=function(_0x36932d,_0x26be74,_0x322985){var _0x479f32={};var _0x59b18a={};var _0x221226;var _0x21285a;return db[_0x3334('0x3c')][_0x3334('0x65')]({'where':{'id':_0x36932d[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x26be74,null))[_0x3334('0x1e')](function(_0x3c1049){if(_0x3c1049){_0x221226=_0x3c1049;_0x59b18a[_0x3334('0x40')]=_['keys'](db['User'][_0x3334('0x56')]);_0x59b18a['query']=_[_0x3334('0x43')](_0x36932d[_0x3334('0x42')]);_0x59b18a['filters']=_[_0x3334('0x45')](_0x59b18a[_0x3334('0x40')],_0x59b18a[_0x3334('0x42')]);_0x479f32[_0x3334('0x46')]=_[_0x3334('0x45')](_0x59b18a[_0x3334('0x40')],qs[_0x3334('0x47')](_0x36932d[_0x3334('0x42')][_0x3334('0x47')]));_0x479f32[_0x3334('0x46')]=_0x479f32['attributes']['length']?_0x479f32[_0x3334('0x46')]:_0x59b18a[_0x3334('0x40')];_0x479f32['order']=qs[_0x3334('0x4b')](_0x36932d[_0x3334('0x42')][_0x3334('0x4b')]);_0x479f32['where']=qs[_0x3334('0x44')](_[_0x3334('0x4d')](_0x36932d[_0x3334('0x42')],_0x59b18a[_0x3334('0x44')]));if(_0x36932d[_0x3334('0x42')][_0x3334('0x4e')]){_0x479f32[_0x3334('0x4c')]=_[_0x3334('0x4f')](_0x479f32[_0x3334('0x4c')],{'$or':_['map'](_0x479f32[_0x3334('0x46')],function(_0x4e5d21){var _0xbd3e31={};_0xbd3e31[_0x4e5d21]={'$like':'%'+_0x36932d['query'][_0x3334('0x4e')]+'%'};return _0xbd3e31;})});}_0x479f32=_[_0x3334('0x4f')]({},_0x479f32,_0x36932d[_0x3334('0x51')]);return _0x221226[_0x3334('0x134')](_0x479f32);}})[_0x3334('0x1e')](function(_0x4a111a){if(_0x4a111a){_0x21285a=_0x4a111a[_0x3334('0x48')];if(!_0x36932d[_0x3334('0x42')][_0x3334('0x66')](_0x3334('0x49'))){_0x479f32[_0x3334('0x30')]=qs[_0x3334('0x30')](_0x36932d[_0x3334('0x42')]['limit']);_0x479f32[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x36932d[_0x3334('0x42')][_0x3334('0x2d')]);}return _0x221226[_0x3334('0x134')](_0x479f32);}})[_0x3334('0x1e')](function(_0xea9dba){if(_0xea9dba){return _0xea9dba?{'count':_0x21285a,'rows':_0xea9dba}:null;}})['then'](respondWithResult(_0x26be74,null))[_0x3334('0x28')](handleError(_0x26be74,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 780d79a..9161944 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 _0xc9b9=['hasOwnProperty','hook','exports','ChatWebsite','setMaxListeners','save'];(function(_0x23239b,_0x4a22c8){var _0xaae286=function(_0x5dbd44){while(--_0x5dbd44){_0x23239b['push'](_0x23239b['shift']());}};_0xaae286(++_0x4a22c8);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0xc9b9[_0x1655bb];return _0x5e2020;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x9c9b('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9c9b('0x1')](0x0);var events={'afterCreate':_0x9c9b('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x48231c){return function(_0x497d53,_0x38a64b,_0x4be6dc){ChatWebsiteEvents['emit'](_0x48231c+':'+_0x497d53['id'],_0x497d53);ChatWebsiteEvents['emit'](_0x48231c,_0x497d53);_0x4be6dc(null);};}for(var e in events){if(events[_0x9c9b('0x3')](e)){var event=events[e];ChatWebsite[_0x9c9b('0x4')](e,emitEvent(event));}}module[_0x9c9b('0x5')]=ChatWebsiteEvents; \ No newline at end of file +var _0xafdd=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x21a685,_0x3c7c71){var _0x330af2=function(_0x2e1f07){while(--_0x2e1f07){_0x21a685['push'](_0x21a685['shift']());}};_0x330af2(++_0x3c7c71);}(_0xafdd,0x19a));var _0xdafd=function(_0x381d88,_0x187470){_0x381d88=_0x381d88-0x0;var _0x10c0c1=_0xafdd[_0x381d88];return _0x10c0c1;};'use strict';var EventEmitter=require(_0xdafd('0x0'));var ChatWebsite=require(_0xdafd('0x1'))['db'][_0xdafd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdafd('0x3')](0x0);var events={'afterCreate':_0xdafd('0x4'),'afterUpdate':_0xdafd('0x5'),'afterDestroy':_0xdafd('0x6')};function emitEvent(_0x2b0752){return function(_0x5624f6,_0x283ab1,_0x799727){ChatWebsiteEvents[_0xdafd('0x7')](_0x2b0752+':'+_0x5624f6['id'],_0x5624f6);ChatWebsiteEvents[_0xdafd('0x7')](_0x2b0752,_0x5624f6);_0x799727(null);};}for(var e in events){if(events[_0xdafd('0x8')](e)){var event=events[e];ChatWebsite[_0xdafd('0x9')](e,emitEvent(event));}}module[_0xdafd('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 7feb8b3..72aa206 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 _0x77f8=['moment','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api'];(function(_0x1fb55b,_0x473495){var _0x30ec9a=function(_0x94638){while(--_0x94638){_0x1fb55b['push'](_0x1fb55b['shift']());}};_0x30ec9a(++_0x473495);}(_0x77f8,0xd5));var _0x877f=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x77f8[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require('lodash');var util=require(_0x877f('0x0'));var logger=require(_0x877f('0x1'))(_0x877f('0x2'));var moment=require(_0x877f('0x3'));var BPromise=require('bluebird');var rp=require(_0x877f('0x4'));var fs=require('fs');var path=require(_0x877f('0x5'));var rimraf=require('rimraf');var config=require(_0x877f('0x6'));var attributes=require(_0x877f('0x7'));module[_0x877f('0x8')]=function(_0x455c99,_0x1ac165){return _0x455c99[_0x877f('0x9')](_0x877f('0xa'),attributes,{'tableName':_0x877f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2779=['request-promise','rimraf','../../config/environment','exports','define','chat_websites','lodash','util','api','moment','bluebird'];(function(_0x1fdd6b,_0x56eb13){var _0x34ee8f=function(_0x54fd41){while(--_0x54fd41){_0x1fdd6b['push'](_0x1fdd6b['shift']());}};_0x34ee8f(++_0x56eb13);}(_0x2779,0xf8));var _0x9277=function(_0x49daeb,_0x54baba){_0x49daeb=_0x49daeb-0x0;var _0xaabc8d=_0x2779[_0x49daeb];return _0xaabc8d;};'use strict';var _=require(_0x9277('0x0'));var util=require(_0x9277('0x1'));var logger=require('../../config/logger')(_0x9277('0x2'));var moment=require(_0x9277('0x3'));var BPromise=require(_0x9277('0x4'));var rp=require(_0x9277('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9277('0x6'));var config=require(_0x9277('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x9277('0x8')]=function(_0x3f0a17,_0x2b1d31){return _0x3f0a17[_0x9277('0x9')]('ChatWebsite',attributes,{'tableName':_0x9277('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 1b93e85..c93ebd7 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 _0x8d7c=['localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','defaults','redis'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8d7c,0xdf));var _0xc8d7=function(_0x57611e,_0x4482c8){_0x57611e=_0x57611e-0x0;var _0x36cacc=_0x8d7c[_0x57611e];return _0x36cacc;};'use strict';var _=require(_0xc8d7('0x0'));var util=require(_0xc8d7('0x1'));var moment=require(_0xc8d7('0x2'));var BPromise=require(_0xc8d7('0x3'));var rs=require(_0xc8d7('0x4'));var fs=require('fs');var Redis=require(_0xc8d7('0x5'));var db=require(_0xc8d7('0x6'))['db'];var utils=require(_0xc8d7('0x7'));var logger=require('../../config/logger')(_0xc8d7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xc8d7('0x9')](config[_0xc8d7('0xa')],{'host':_0xc8d7('0xb'),'port':0x18eb});var socket=require(_0xc8d7('0xc'))(new Redis(config['redis']));require(_0xc8d7('0xd'))[_0xc8d7('0xe')](socket);function respondWithRpcPromise(_0x1c5978,_0x3c85a,_0x323a13){return new BPromise(function(_0x4acc08,_0x338bd1){return client['request'](_0x1c5978,_0x323a13)[_0xc8d7('0xf')](function(_0x15ead5){logger[_0xc8d7('0x10')](_0xc8d7('0x11'),_0x3c85a,_0xc8d7('0x12'));logger[_0xc8d7('0x13')](_0xc8d7('0x14'),_0x3c85a,_0xc8d7('0x12'),JSON[_0xc8d7('0x15')](_0x15ead5));if(_0x15ead5[_0xc8d7('0x16')]){if(_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x17')]===0x1f4){logger[_0xc8d7('0x16')](_0xc8d7('0x11'),_0x3c85a,_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);return _0x338bd1(_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);}logger[_0xc8d7('0x16')](_0xc8d7('0x11'),_0x3c85a,_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);return _0x4acc08(_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);}else{logger['info'](_0xc8d7('0x11'),_0x3c85a,_0xc8d7('0x12'));_0x4acc08(_0x15ead5['result'][_0xc8d7('0x18')]);}})[_0xc8d7('0x19')](function(_0x5042b9){logger[_0xc8d7('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x3c85a,_0x5042b9);_0x338bd1(_0x5042b9);});});} \ No newline at end of file +var _0xefa1=['socket.io-emitter','register','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x243863,_0x52aebd){var _0x4aca75=function(_0x113eb0){while(--_0x113eb0){_0x243863['push'](_0x243863['shift']());}};_0x4aca75(++_0x52aebd);}(_0xefa1,0x188));var _0x1efa=function(_0x39f78b,_0x11e936){_0x39f78b=_0x39f78b-0x0;var _0x373e4f=_0xefa1[_0x39f78b];return _0x373e4f;};'use strict';var _=require('lodash');var util=require(_0x1efa('0x0'));var moment=require(_0x1efa('0x1'));var BPromise=require(_0x1efa('0x2'));var rs=require(_0x1efa('0x3'));var fs=require('fs');var Redis=require(_0x1efa('0x4'));var db=require(_0x1efa('0x5'))['db'];var utils=require(_0x1efa('0x6'));var logger=require('../../config/logger')(_0x1efa('0x7'));var config=require(_0x1efa('0x8'));var jayson=require(_0x1efa('0x9'));var client=jayson[_0x1efa('0xa')]['http']({'port':0x232a});config[_0x1efa('0xb')]=_['defaults'](config[_0x1efa('0xb')],{'host':_0x1efa('0xc'),'port':0x18eb});var socket=require(_0x1efa('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x1efa('0xe')](socket);function respondWithRpcPromise(_0x4594f6,_0x4ff668,_0x186988){return new BPromise(function(_0xcd812a,_0x4d8ab4){return client[_0x1efa('0xf')](_0x4594f6,_0x186988)[_0x1efa('0x10')](function(_0x111bd3){logger[_0x1efa('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4ff668,_0x1efa('0x12'));logger['debug'](_0x1efa('0x13'),_0x4ff668,_0x1efa('0x12'),JSON[_0x1efa('0x14')](_0x111bd3));if(_0x111bd3['error']){if(_0x111bd3[_0x1efa('0x15')][_0x1efa('0x16')]===0x1f4){logger[_0x1efa('0x15')](_0x1efa('0x17'),_0x4ff668,_0x111bd3[_0x1efa('0x15')][_0x1efa('0x18')]);return _0x4d8ab4(_0x111bd3[_0x1efa('0x15')]['message']);}logger[_0x1efa('0x15')](_0x1efa('0x17'),_0x4ff668,_0x111bd3['error'][_0x1efa('0x18')]);return _0xcd812a(_0x111bd3[_0x1efa('0x15')]['message']);}else{logger[_0x1efa('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4ff668,_0x1efa('0x12'));_0xcd812a(_0x111bd3[_0x1efa('0x19')][_0x1efa('0x18')]);}})[_0x1efa('0x1a')](function(_0x22bd6c){logger[_0x1efa('0x15')](_0x1efa('0x17'),_0x4ff668,_0x22bd6c);_0x4d8ab4(_0x22bd6c);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 5528ed6..6cd4d0b 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 _0x98bf=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x576292,_0x23b1a2){var _0x3aa65b=function(_0x2eac91){while(--_0x2eac91){_0x576292['push'](_0x576292['shift']());}};_0x3aa65b(++_0x23b1a2);}(_0x98bf,0xb6));var _0xf98b=function(_0xd60ec9,_0x4c62fd){_0xd60ec9=_0xd60ec9-0x0;var _0x4a6c4b=_0x98bf[_0xd60ec9];return _0x4a6c4b;};'use strict';var ChatWebsiteEvents=require(_0xf98b('0x0'));var events=[_0xf98b('0x1'),_0xf98b('0x2'),_0xf98b('0x3')];function createListener(_0x9ed68,_0x2b2a4e){return function(_0x226a00){_0x2b2a4e[_0xf98b('0x4')](_0x9ed68,_0x226a00);};}function removeListener(_0x528232,_0xeda2ce){return function(){ChatWebsiteEvents[_0xf98b('0x5')](_0x528232,_0xeda2ce);};}exports[_0xf98b('0x6')]=function(_0x35d2cd){for(var _0x40d437=0x0,_0x3cc5ab=events[_0xf98b('0x7')];_0x40d437<_0x3cc5ab;_0x40d437++){var _0x209326=events[_0x40d437];var _0x57874e=createListener(_0xf98b('0x8')+_0x209326,_0x35d2cd);ChatWebsiteEvents['on'](_0x209326,_0x57874e);}}; \ No newline at end of file +var _0x5951=['update','emit','removeListener','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x5951,0xb5));var _0x1595=function(_0xebbdd5,_0xca00a7){_0xebbdd5=_0xebbdd5-0x0;var _0xe1a941=_0x5951[_0xebbdd5];return _0xe1a941;};'use strict';var ChatWebsiteEvents=require(_0x1595('0x0'));var events=[_0x1595('0x1'),_0x1595('0x2'),_0x1595('0x3')];function createListener(_0x20da50,_0x2e831b){return function(_0x1c9e3b){_0x2e831b[_0x1595('0x4')](_0x20da50,_0x1c9e3b);};}function removeListener(_0x589977,_0x4a2dfe){return function(){ChatWebsiteEvents[_0x1595('0x5')](_0x589977,_0x4a2dfe);};}exports['register']=function(_0x5dc1cc){for(var _0x2652af=0x0,_0x3bd88b=events[_0x1595('0x6')];_0x2652af<_0x3bd88b;_0x2652af++){var _0x599f34=events[_0x2652af];var _0x4cf17a=createListener(_0x1595('0x7')+_0x599f34,_0x5dc1cc);ChatWebsiteEvents['on'](_0x599f34,_0x4cf17a);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 32ee1c1..fd05bec 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 _0x908f=['./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/customer_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','diskStorage','join','format','%s-%s','now','originalname','single','addLogo','root','file','addAvatar','addCustomerAvatar','server/files/images/avatars/','/:id/system_avatar','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1a920f,_0x547b1b){var _0x390e05=function(_0xa37692){while(--_0xa37692){_0x1a920f['push'](_0x1a920f['shift']());}};_0x390e05(++_0x547b1b);}(_0x908f,0x1a5));var _0xf908=function(_0x26868d,_0x471272){_0x26868d=_0x26868d-0x0;var _0x4d24ad=_0x908f[_0x26868d];return _0x4d24ad;};'use strict';var multer=require(_0xf908('0x0'));var util=require('util');var path=require(_0xf908('0x1'));var timeout=require(_0xf908('0x2'));var express=require('express');var router=express[_0xf908('0x3')]();var fs_extra=require(_0xf908('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf908('0x5'));var config=require('../../config/environment');var controller=require(_0xf908('0x6'));router[_0xf908('0x7')]('/',auth[_0xf908('0x8')](),controller[_0xf908('0x9')]);router[_0xf908('0x7')](_0xf908('0xa'),auth[_0xf908('0x8')](),controller[_0xf908('0xb')]);router[_0xf908('0x7')](_0xf908('0xc'),auth['isAuthenticated'](),controller[_0xf908('0xd')]);router[_0xf908('0x7')](_0xf908('0xe'),auth[_0xf908('0x8')](),controller[_0xf908('0xf')]);router[_0xf908('0x7')](_0xf908('0x10'),auth[_0xf908('0x8')](),controller['getAnswers']);router[_0xf908('0x7')](_0xf908('0x11'),controller[_0xf908('0x12')]);router[_0xf908('0x7')]('/:id/avatar',controller['getAvatar']);router[_0xf908('0x7')](_0xf908('0x13'),controller['getCustomerAvatar']);router[_0xf908('0x7')]('/:id/system_avatar',controller[_0xf908('0x14')]);router[_0xf908('0x7')](_0xf908('0x15'),auth[_0xf908('0x8')](),controller['getInteractions']);router[_0xf908('0x7')](_0xf908('0x16'),controller['getSnippet']);router['get'](_0xf908('0x17'),auth[_0xf908('0x8')](),controller['getApplications']);router['get'](_0xf908('0x18'),auth[_0xf908('0x8')](),controller[_0xf908('0x19')]);router[_0xf908('0x7')](_0xf908('0x1a'),controller[_0xf908('0x1b')]);router[_0xf908('0x7')]('/:id/offline_messages',auth[_0xf908('0x8')](),controller[_0xf908('0x1c')]);router[_0xf908('0x7')](_0xf908('0x1d'),auth[_0xf908('0x8')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf908('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xf908('0x1e')](_0xf908('0x10'),auth[_0xf908('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x91d1c8,_0x158fb2,_0x4d2436){_0x4d2436(null,path[_0xf908('0x20')](config['root'],'server/files/images/logos/'));},'filename':function(_0x3024ae,_0x6bcae5,_0x2c9d5c){_0x2c9d5c(null,util[_0xf908('0x21')](_0xf908('0x22'),Date[_0xf908('0x23')](),_0x6bcae5[_0xf908('0x24')]));}})});router[_0xf908('0x1e')](_0xf908('0x11'),upload[_0xf908('0x25')]('file'),controller[_0xf908('0x26')]);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x438ac4,_0x597bd6,_0x637d93){_0x637d93(null,path['join'](config[_0xf908('0x27')],'server/files/images/avatars/'));},'filename':function(_0x145fe4,_0x3cebfa,_0x284ecd){_0x284ecd(null,util[_0xf908('0x21')]('%s-%s',Date[_0xf908('0x23')](),_0x3cebfa[_0xf908('0x24')]));}})});router['post']('/:id/avatar',upload[_0xf908('0x25')](_0xf908('0x28')),controller[_0xf908('0x29')]);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x34139e,_0x10f981,_0x107fd8){_0x107fd8(null,path[_0xf908('0x20')](config[_0xf908('0x27')],'server/files/images/avatars/'));},'filename':function(_0xc87017,_0x200681,_0x51a343){_0x51a343(null,util[_0xf908('0x21')]('%s-%s',Date['now'](),_0x200681['originalname']));}})});router[_0xf908('0x1e')](_0xf908('0x13'),upload[_0xf908('0x25')](_0xf908('0x28')),controller[_0xf908('0x2a')]);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x22d8fa,_0xbd5a0d,_0x2cec0c){_0x2cec0c(null,path[_0xf908('0x20')](config[_0xf908('0x27')],_0xf908('0x2b')));},'filename':function(_0x57eee0,_0xa1c29b,_0x56c329){_0x56c329(null,util['format']('%s-%s',Date[_0xf908('0x23')](),_0xa1c29b[_0xf908('0x24')]));}})});router[_0xf908('0x1e')](_0xf908('0x2c'),upload[_0xf908('0x25')](_0xf908('0x28')),controller['addSystemAvatar']);router[_0xf908('0x1e')]('/:id/notify',controller[_0xf908('0x2d')]);const offlineUploadMulter=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x2d11c4,_0x230443,_0x5f4d1b){const _0x717e9c=path[_0xf908('0x20')](config['root'],_0xf908('0x2e'),'attachments',_0xf908('0x2f'));fs_extra[_0xf908('0x30')](_0x717e9c,function(){_0x5f4d1b(null,_0x717e9c);});},'filename':function(_0x545a82,_0x5cf982,_0x2bb762){const _0x29412e=_0x5cf982[_0xf908('0x24')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3c7e5b=path['extname'](_0x29412e);const _0x4c30c6=Date[_0xf908('0x23')]()+'-'+_0x29412e[_0xf908('0x31')](_0x3c7e5b,'')+_0x3c7e5b;_0x2bb762(null,_0x4c30c6);}})});router['post'](_0xf908('0x32'),offlineUploadMulter[_0xf908('0x33')](),controller[_0xf908('0x34')]);router[_0xf908('0x1e')](_0xf908('0x15'),auth[_0xf908('0x8')](),controller[_0xf908('0x35')]);router[_0xf908('0x1e')](_0xf908('0x17'),auth[_0xf908('0x8')](),controller['addApplications']);router[_0xf908('0x1e')]('/:id/proactive_actions',auth[_0xf908('0x8')](),controller[_0xf908('0x36')]);router[_0xf908('0x1e')](_0xf908('0x1d'),auth[_0xf908('0x8')](),controller[_0xf908('0x37')]);router[_0xf908('0x38')]('/:id',auth[_0xf908('0x8')](),controller[_0xf908('0x39')]);router[_0xf908('0x3a')](_0xf908('0xc'),auth['isAuthenticated'](),controller[_0xf908('0x3b')]);router['delete']('/:id/dispositions',auth[_0xf908('0x8')](),controller['removeDispositions']);router[_0xf908('0x3a')](_0xf908('0x10'),auth[_0xf908('0x8')](),controller[_0xf908('0x3c')]);router[_0xf908('0x3a')](_0xf908('0x1d'),auth[_0xf908('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x2fd7=['getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','server/files/images/logos/','now','originalname','single','file','addLogo','diskStorage','join','root','server/files/images/avatars/','%s-%s','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','server/files','attachments','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo'];(function(_0x2afeb8,_0x14d761){var _0x28e268=function(_0x3f348f){while(--_0x3f348f){_0x2afeb8['push'](_0x2afeb8['shift']());}};_0x28e268(++_0x14d761);}(_0x2fd7,0xc8));var _0x72fd=function(_0x581e18,_0x590931){_0x581e18=_0x581e18-0x0;var _0x9e08d7=_0x2fd7[_0x581e18];return _0x9e08d7;};'use strict';var multer=require(_0x72fd('0x0'));var util=require(_0x72fd('0x1'));var path=require(_0x72fd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x72fd('0x3'));var auth=require(_0x72fd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x72fd('0x5'));var controller=require(_0x72fd('0x6'));router[_0x72fd('0x7')]('/',auth[_0x72fd('0x8')](),controller[_0x72fd('0x9')]);router[_0x72fd('0x7')]('/describe',auth[_0x72fd('0x8')](),controller['describe']);router[_0x72fd('0x7')](_0x72fd('0xa'),auth[_0x72fd('0x8')](),controller[_0x72fd('0xb')]);router[_0x72fd('0x7')](_0x72fd('0xc'),auth['isAuthenticated'](),controller[_0x72fd('0xd')]);router[_0x72fd('0x7')](_0x72fd('0xe'),auth[_0x72fd('0x8')](),controller['getAnswers']);router[_0x72fd('0x7')](_0x72fd('0xf'),controller[_0x72fd('0x10')]);router[_0x72fd('0x7')](_0x72fd('0x11'),controller[_0x72fd('0x12')]);router[_0x72fd('0x7')]('/:id/customer_avatar',controller[_0x72fd('0x13')]);router[_0x72fd('0x7')](_0x72fd('0x14'),controller[_0x72fd('0x15')]);router[_0x72fd('0x7')](_0x72fd('0x16'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x17')]);router[_0x72fd('0x7')](_0x72fd('0x18'),controller[_0x72fd('0x19')]);router[_0x72fd('0x7')]('/:id/applications',auth[_0x72fd('0x8')](),controller[_0x72fd('0x1a')]);router['get']('/:id/proactive_actions',auth[_0x72fd('0x8')](),controller[_0x72fd('0x1b')]);router['get'](_0x72fd('0x1c'),controller[_0x72fd('0x1d')]);router['get'](_0x72fd('0x1e'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x1f')]);router['get'](_0x72fd('0x20'),auth['isAuthenticated'](),controller[_0x72fd('0x21')]);router[_0x72fd('0x22')]('/',auth[_0x72fd('0x8')](),controller['create']);router[_0x72fd('0x22')](_0x72fd('0xc'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x23')]);router[_0x72fd('0x22')](_0x72fd('0xe'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f1f67,_0x292292,_0x2d1e54){_0x2d1e54(null,path['join'](config['root'],_0x72fd('0x25')));},'filename':function(_0x1ac066,_0x2b079b,_0x526a36){_0x526a36(null,util['format']('%s-%s',Date[_0x72fd('0x26')](),_0x2b079b[_0x72fd('0x27')]));}})});router[_0x72fd('0x22')]('/:id/logo',upload[_0x72fd('0x28')](_0x72fd('0x29')),controller[_0x72fd('0x2a')]);var upload=multer({'storage':multer[_0x72fd('0x2b')]({'destination':function(_0x4868ff,_0x227cc8,_0x1752ef){_0x1752ef(null,path[_0x72fd('0x2c')](config[_0x72fd('0x2d')],_0x72fd('0x2e')));},'filename':function(_0x48bf6f,_0x3d5a19,_0x5f100d){_0x5f100d(null,util['format'](_0x72fd('0x2f'),Date[_0x72fd('0x26')](),_0x3d5a19[_0x72fd('0x27')]));}})});router['post'](_0x72fd('0x11'),upload[_0x72fd('0x28')](_0x72fd('0x29')),controller[_0x72fd('0x30')]);var upload=multer({'storage':multer[_0x72fd('0x2b')]({'destination':function(_0xecd593,_0x4ed8c1,_0xc76a11){_0xc76a11(null,path[_0x72fd('0x2c')](config[_0x72fd('0x2d')],_0x72fd('0x2e')));},'filename':function(_0x411626,_0x3d6191,_0x193645){_0x193645(null,util['format'](_0x72fd('0x2f'),Date[_0x72fd('0x26')](),_0x3d6191[_0x72fd('0x27')]));}})});router['post'](_0x72fd('0x31'),upload[_0x72fd('0x28')]('file'),controller[_0x72fd('0x32')]);var upload=multer({'storage':multer[_0x72fd('0x2b')]({'destination':function(_0x469826,_0xd01f30,_0x2b3618){_0x2b3618(null,path[_0x72fd('0x2c')](config[_0x72fd('0x2d')],_0x72fd('0x2e')));},'filename':function(_0xa232f0,_0x428fcc,_0x44d19c){_0x44d19c(null,util['format'](_0x72fd('0x2f'),Date[_0x72fd('0x26')](),_0x428fcc['originalname']));}})});router[_0x72fd('0x22')](_0x72fd('0x14'),upload[_0x72fd('0x28')](_0x72fd('0x29')),controller[_0x72fd('0x33')]);router[_0x72fd('0x22')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x72fd('0x2b')]({'destination':function(_0x48561d,_0x4aacda,_0x22611a){const _0x540fe9=path[_0x72fd('0x2c')](config[_0x72fd('0x2d')],_0x72fd('0x34'),_0x72fd('0x35'),_0x72fd('0x36'));fs_extra[_0x72fd('0x37')](_0x540fe9,function(){_0x22611a(null,_0x540fe9);});},'filename':function(_0x2734c2,_0x56e260,_0x5b24b2){const _0x534afd=_0x56e260[_0x72fd('0x27')][_0x72fd('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x179d85=path[_0x72fd('0x39')](_0x534afd);const _0x4d83af=Date['now']()+'-'+_0x534afd['replace'](_0x179d85,'')+_0x179d85;_0x5b24b2(null,_0x4d83af);}})});router[_0x72fd('0x22')]('/:id/offline',offlineUploadMulter[_0x72fd('0x3a')](),controller[_0x72fd('0x3b')]);router[_0x72fd('0x22')](_0x72fd('0x16'),auth['isAuthenticated'](),controller[_0x72fd('0x3c')]);router[_0x72fd('0x22')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x72fd('0x3d'),auth['isAuthenticated'](),controller[_0x72fd('0x3e')]);router[_0x72fd('0x22')]('/:id/users',auth['isAuthenticated'](),controller[_0x72fd('0x3f')]);router[_0x72fd('0x40')]('/:id',auth[_0x72fd('0x8')](),controller[_0x72fd('0x41')]);router[_0x72fd('0x42')](_0x72fd('0xa'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x43')]);router[_0x72fd('0x42')](_0x72fd('0xc'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x44')]);router[_0x72fd('0x42')]('/:id/canned_answers',auth[_0x72fd('0x8')](),controller[_0x72fd('0x45')]);router[_0x72fd('0x42')](_0x72fd('0x20'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x46')]);module[_0x72fd('0x47')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 33e0149..1b6cb19 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 _0x624c=['STRING','ENUM','AmazonAWS','Google','exports'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0x624c,0x1ee));var _0xc624=function(_0x42235f,_0x5dabfd){_0x42235f=_0x42235f-0x0;var _0x3f5fab=_0x624c[_0x42235f];return _0x3f5fab;};'use strict';var Sequelize=require('sequelize');module[_0xc624('0x0')]={'name':{'type':Sequelize[_0xc624('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc624('0x2')](_0xc624('0x3'),_0xc624('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xc624('0x1')]}}; \ No newline at end of file +var _0xa498=['STRING','Google','exports'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa498,0x1d6));var _0x8a49=function(_0x4599b6,_0x40c254){_0x4599b6=_0x4599b6-0x0;var _0x2e014c=_0xa498[_0x4599b6];return _0x2e014c;};'use strict';var Sequelize=require('sequelize');module[_0x8a49('0x0')]={'name':{'type':Sequelize[_0x8a49('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x8a49('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8a49('0x1')]},'data2':{'type':Sequelize[_0x8a49('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index ef2bfcf..76fece1 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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','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','CloudProvider','fieldName','type','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadb5,0xad));var _0x5adb=function(_0x5e45ca,_0x4853ca){_0x5e45ca=_0x5e45ca-0x0;var _0x1fab16=_0xadb5[_0x5e45ca];return _0x1fab16;};'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['CloudProvider']['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')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file +var _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x3ce33a,_0x265c89){var _0x3b5ed6=function(_0x5822e2){while(--_0x5822e2){_0x3ce33a['push'](_0x3ce33a['shift']());}};_0x3b5ed6(++_0x265c89);}(_0x0b0e,0x187));var _0xe0b0=function(_0x249565,_0x2a026a){_0x249565=_0x249565-0x0;var _0x43dee8=_0x0b0e[_0x249565];return _0x43dee8;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 82bef70..8bbca22 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 _0x2494=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x202962,_0x4baf03){var _0x4896a0=function(_0x10c05b){while(--_0x10c05b){_0x202962['push'](_0x202962['shift']());}};_0x4896a0(++_0x4baf03);}(_0x2494,0xf5));var _0x4249=function(_0x3cf5ec,_0x250439){_0x3cf5ec=_0x3cf5ec-0x0;var _0x986eec=_0x2494[_0x3cf5ec];return _0x986eec;};'use strict';var _=require(_0x4249('0x0'));var util=require(_0x4249('0x1'));var logger=require(_0x4249('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4249('0x3'));var rp=require(_0x4249('0x4'));var fs=require('fs');var path=require(_0x4249('0x5'));var rimraf=require(_0x4249('0x6'));var config=require('../../config/environment');var attributes=require(_0x4249('0x7'));module[_0x4249('0x8')]=function(_0x473708,_0x2ceed7){return _0x473708[_0x4249('0x9')](_0x4249('0xa'),attributes,{'tableName':_0x4249('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1293=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1e7d56,_0x19d978){var _0x1371e4=function(_0x53d238){while(--_0x53d238){_0x1e7d56['push'](_0x1e7d56['shift']());}};_0x1371e4(++_0x19d978);}(_0x1293,0x68));var _0x3129=function(_0x3267cb,_0x126cc9){_0x3267cb=_0x3267cb-0x0;var _0x200925=_0x1293[_0x3267cb];return _0x200925;};'use strict';var _=require(_0x3129('0x0'));var util=require(_0x3129('0x1'));var logger=require(_0x3129('0x2'))(_0x3129('0x3'));var moment=require(_0x3129('0x4'));var BPromise=require(_0x3129('0x5'));var rp=require(_0x3129('0x6'));var fs=require('fs');var path=require(_0x3129('0x7'));var rimraf=require(_0x3129('0x8'));var config=require(_0x3129('0x9'));var attributes=require(_0x3129('0xa'));module[_0x3129('0xb')]=function(_0x26a5bf,_0x5ec459){return _0x26a5bf[_0x3129('0xc')]('CloudProvider',attributes,{'tableName':_0x3129('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 01f376b..7ed1a3e 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 _0xc177=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x280ddd,_0xdd88f3){var _0x1ae8bd=function(_0xfe3652){while(--_0xfe3652){_0x280ddd['push'](_0x280ddd['shift']());}};_0x1ae8bd(++_0xdd88f3);}(_0xc177,0x1b2));var _0x7c17=function(_0x53cb6d,_0x1826c3){_0x53cb6d=_0x53cb6d-0x0;var _0x245e70=_0xc177[_0x53cb6d];return _0x245e70;};'use strict';var _=require(_0x7c17('0x0'));var util=require(_0x7c17('0x1'));var moment=require(_0x7c17('0x2'));var BPromise=require(_0x7c17('0x3'));var rs=require(_0x7c17('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c17('0x5'))['db'];var utils=require(_0x7c17('0x6'));var logger=require(_0x7c17('0x7'))(_0x7c17('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c17('0x9'));var client=jayson[_0x7c17('0xa')][_0x7c17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4810b7,_0x3ab87c,_0x3aa79e){return new BPromise(function(_0x33dd1e,_0x3854dd){return client[_0x7c17('0xc')](_0x4810b7,_0x3aa79e)[_0x7c17('0xd')](function(_0x44e782){logger[_0x7c17('0xe')](_0x7c17('0xf'),_0x3ab87c,_0x7c17('0x10'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3ab87c,'request\x20sent',JSON[_0x7c17('0x11')](_0x44e782));if(_0x44e782[_0x7c17('0x12')]){if(_0x44e782[_0x7c17('0x12')]['code']===0x1f4){logger[_0x7c17('0x12')](_0x7c17('0xf'),_0x3ab87c,_0x44e782[_0x7c17('0x12')]['message']);return _0x3854dd(_0x44e782['error'][_0x7c17('0x13')]);}logger[_0x7c17('0x12')]('CloudProvider,\x20%s,\x20%s',_0x3ab87c,_0x44e782[_0x7c17('0x12')]['message']);return _0x33dd1e(_0x44e782[_0x7c17('0x12')]['message']);}else{logger[_0x7c17('0xe')](_0x7c17('0xf'),_0x3ab87c,_0x7c17('0x10'));_0x33dd1e(_0x44e782[_0x7c17('0x14')][_0x7c17('0x13')]);}})[_0x7c17('0x15')](function(_0x87715a){logger[_0x7c17('0x12')](_0x7c17('0xf'),_0x3ab87c,_0x87715a);_0x3854dd(_0x87715a);});});} \ No newline at end of file +var _0x4f7b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x365101,_0x12b1e6){var _0x1c253a=function(_0x42592a){while(--_0x42592a){_0x365101['push'](_0x365101['shift']());}};_0x1c253a(++_0x12b1e6);}(_0x4f7b,0x13e));var _0xb4f7=function(_0xce5d2a,_0x1add09){_0xce5d2a=_0xce5d2a-0x0;var _0xc4fc6f=_0x4f7b[_0xce5d2a];return _0xc4fc6f;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var moment=require(_0xb4f7('0x2'));var BPromise=require(_0xb4f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f7('0x4'));var db=require(_0xb4f7('0x5'))['db'];var utils=require(_0xb4f7('0x6'));var logger=require(_0xb4f7('0x7'))(_0xb4f7('0x8'));var config=require(_0xb4f7('0x9'));var jayson=require(_0xb4f7('0xa'));var client=jayson[_0xb4f7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27872e,_0x5e7b94,_0x179391){return new BPromise(function(_0xf56d08,_0x2849ed){return client['request'](_0x27872e,_0x179391)[_0xb4f7('0xc')](function(_0x5af41f){logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));logger['debug'](_0xb4f7('0x10'),_0x5e7b94,_0xb4f7('0xf'),JSON[_0xb4f7('0x11')](_0x5af41f));if(_0x5af41f[_0xb4f7('0x12')]){if(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x13')]===0x1f4){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f['error'][_0xb4f7('0x14')]);return _0x2849ed(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x14')]);}logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f[_0xb4f7('0x12')]['message']);return _0xf56d08(_0x5af41f[_0xb4f7('0x12')]['message']);}else{logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));_0xf56d08(_0x5af41f[_0xb4f7('0x15')][_0xb4f7('0x14')]);}})[_0xb4f7('0x16')](function(_0xbc599a){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0xbc599a);_0x2849ed(_0xbc599a);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 22ccb20..1077040 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 _0x97dd=['get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cloudProvider.controller'];(function(_0x58ee54,_0x4e92ec){var _0x4d89d0=function(_0x4ab5c1){while(--_0x4ab5c1){_0x58ee54['push'](_0x58ee54['shift']());}};_0x4d89d0(++_0x4e92ec);}(_0x97dd,0xef));var _0xd97d=function(_0x2c98af,_0x3f5a43){_0x2c98af=_0x2c98af-0x0;var _0x372dba=_0x97dd[_0x2c98af];return _0x372dba;};'use strict';var multer=require(_0xd97d('0x0'));var util=require(_0xd97d('0x1'));var path=require('path');var timeout=require(_0xd97d('0x2'));var express=require(_0xd97d('0x3'));var router=express[_0xd97d('0x4')]();var fs_extra=require(_0xd97d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd97d('0x6'));var config=require('../../config/environment');var controller=require(_0xd97d('0x7'));router[_0xd97d('0x8')]('/',auth['isAuthenticated'](),controller[_0xd97d('0x9')]);router[_0xd97d('0x8')](_0xd97d('0xa'),auth['isAuthenticated'](),controller[_0xd97d('0xb')]);router[_0xd97d('0xc')]('/',auth[_0xd97d('0xd')](),controller['create']);router[_0xd97d('0xe')](_0xd97d('0xa'),auth[_0xd97d('0xd')](),controller[_0xd97d('0xf')]);router[_0xd97d('0x10')]('/:id',auth[_0xd97d('0xd')](),controller[_0xd97d('0x11')]);module[_0xd97d('0x12')]=router; \ No newline at end of file +var _0xb5a8=['index','isAuthenticated','show','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0xb5a8,0x81));var _0x8b5a=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xb5a8[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x8b5a('0x0'));var util=require(_0x8b5a('0x1'));var path=require(_0x8b5a('0x2'));var timeout=require(_0x8b5a('0x3'));var express=require(_0x8b5a('0x4'));var router=express['Router']();var fs_extra=require(_0x8b5a('0x5'));var auth=require(_0x8b5a('0x6'));var interaction=require(_0x8b5a('0x7'));var config=require(_0x8b5a('0x8'));var controller=require(_0x8b5a('0x9'));router[_0x8b5a('0xa')]('/',auth['isAuthenticated'](),controller[_0x8b5a('0xb')]);router[_0x8b5a('0xa')]('/:id',auth[_0x8b5a('0xc')](),controller[_0x8b5a('0xd')]);router[_0x8b5a('0xe')]('/',auth[_0x8b5a('0xc')](),controller['create']);router[_0x8b5a('0xf')](_0x8b5a('0x10'),auth[_0x8b5a('0xc')](),controller[_0x8b5a('0x11')]);router[_0x8b5a('0x12')](_0x8b5a('0x10'),auth[_0x8b5a('0xc')](),controller['destroy']);module[_0x8b5a('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index a8d1e96..ce2c581 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 _0xc7b1=['STRING','sequelize','name'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0xc7b1,0xe5));var _0x1c7b=function(_0x2300f2,_0x315c5f){_0x2300f2=_0x2300f2-0x0;var _0x6bd508=_0xc7b1[_0x2300f2];return _0x6bd508;};'use strict';var Sequelize=require(_0x1c7b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1c7b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1c7b('0x2')]},'companyId':{'type':Sequelize[_0x1c7b('0x2')]},'website':{'type':Sequelize[_0x1c7b('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1c7b('0x2')]},'type':{'type':Sequelize[_0x1c7b('0x2')]},'street':{'type':Sequelize[_0x1c7b('0x2')]},'postalCode':{'type':Sequelize[_0x1c7b('0x2')]},'city':{'type':Sequelize[_0x1c7b('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1c7b('0x2')]},'sStreet':{'type':Sequelize[_0x1c7b('0x2')]},'sPostalCode':{'type':Sequelize[_0x1c7b('0x2')]},'sCity':{'type':Sequelize[_0x1c7b('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1c7b('0x2')]}}; \ No newline at end of file +var _0x2228=['STRING'];(function(_0x20c2e6,_0x199912){var _0x451b69=function(_0xfa21f){while(--_0xfa21f){_0x20c2e6['push'](_0x20c2e6['shift']());}};_0x451b69(++_0x199912);}(_0x2228,0x118));var _0x8222=function(_0x14eeb5,_0x12a40d){_0x14eeb5=_0x14eeb5-0x0;var _0x200fa3=_0x2228[_0x14eeb5];return _0x200fa3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8222('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8222('0x0')]},'companyId':{'type':Sequelize[_0x8222('0x0')]},'website':{'type':Sequelize[_0x8222('0x0')]},'phone':{'type':Sequelize[_0x8222('0x0')]},'fax':{'type':Sequelize[_0x8222('0x0')]},'type':{'type':Sequelize[_0x8222('0x0')]},'street':{'type':Sequelize[_0x8222('0x0')]},'postalCode':{'type':Sequelize[_0x8222('0x0')]},'city':{'type':Sequelize[_0x8222('0x0')]},'country':{'type':Sequelize[_0x8222('0x0')]},'email':{'type':Sequelize[_0x8222('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8222('0x0')]},'sStreet':{'type':Sequelize[_0x8222('0x0')]},'sPostalCode':{'type':Sequelize[_0x8222('0x0')]},'sCity':{'type':Sequelize[_0x8222('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8222('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 6ca7c1e..b094834 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 _0xe2de=['update','then','destroy','get','UserProfileResource','end','error','stack','name','index','CmCompany','describe','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','merge','options','rows','catch','show','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','omit','getContacts','findOne','rawAttributes','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xe2de,0x132));var _0xee2d=function(_0x5cc1ed,_0x6a43c1){_0x5cc1ed=_0x5cc1ed-0x0;var _0x3c6695=_0xe2de[_0x5cc1ed];return _0x3c6695;};'use strict';var emlformat=require(_0xee2d('0x0'));var rimraf=require(_0xee2d('0x1'));var zipdir=require(_0xee2d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xee2d('0x3'));var Mustache=require(_0xee2d('0x4'));var util=require(_0xee2d('0x5'));var path=require(_0xee2d('0x6'));var sox=require(_0xee2d('0x7'));var csv=require(_0xee2d('0x8'));var ejs=require(_0xee2d('0x9'));var fs=require('fs');var fs_extra=require(_0xee2d('0xa'));var _=require(_0xee2d('0xb'));var squel=require(_0xee2d('0xc'));var crypto=require(_0xee2d('0xd'));var jsforce=require(_0xee2d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xee2d('0x8'));var querystring=require('querystring');var Papa=require(_0xee2d('0xf'));var Redis=require('ioredis');var authService=require(_0xee2d('0x10'));var qs=require(_0xee2d('0x11'));var as=require(_0xee2d('0x12'));var hardwareService=require(_0xee2d('0x13'));var logger=require(_0xee2d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xee2d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x839df4,_0x2d53f9){_0x2d53f9=_0x2d53f9||0xcc;return function(_0x5e2a30){if(_0x5e2a30){return _0x839df4[_0xee2d('0x16')](_0x2d53f9);}return _0x839df4[_0xee2d('0x17')](_0x2d53f9)['end']();};}function respondWithResult(_0x231a3b,_0x340f35){_0x340f35=_0x340f35||0xc8;return function(_0x72f5e2){if(_0x72f5e2){return _0x231a3b[_0xee2d('0x17')](_0x340f35)[_0xee2d('0x18')](_0x72f5e2);}};}function respondWithFilteredResult(_0x3d8371,_0x46fb8f){return function(_0x4a237e){if(_0x4a237e){var _0x226f81=typeof _0x46fb8f[_0xee2d('0x19')]===_0xee2d('0x1a')&&typeof _0x46fb8f[_0xee2d('0x1b')]==='undefined';var _0x4519ec=_0x4a237e['count'];var _0x2b94ad=_0x226f81?0x0:_0x46fb8f[_0xee2d('0x19')];var _0x1e9bba=_0x226f81?_0x4a237e[_0xee2d('0x1c')]:_0x46fb8f[_0xee2d('0x19')]+_0x46fb8f[_0xee2d('0x1b')];var _0x2bfbf7;if(_0x1e9bba>=_0x4519ec){_0x1e9bba=_0x4519ec;_0x2bfbf7=0xc8;}else{_0x2bfbf7=0xce;}_0x3d8371[_0xee2d('0x17')](_0x2bfbf7);return _0x3d8371[_0xee2d('0x1d')](_0xee2d('0x1e'),_0x2b94ad+'-'+_0x1e9bba+'/'+_0x4519ec)[_0xee2d('0x18')](_0x4a237e);}return null;};}function patchUpdates(_0x5493f5){return function(_0x2a93c6){try{jsonpatch[_0xee2d('0x1f')](_0x2a93c6,_0x5493f5,!![]);}catch(_0x5beaed){return BPromise[_0xee2d('0x20')](_0x5beaed);}return _0x2a93c6[_0xee2d('0x21')]();};}function saveUpdates(_0x51ed04,_0x3bf523){return function(_0x20c8be){if(_0x20c8be){return _0x20c8be[_0xee2d('0x22')](_0x51ed04)[_0xee2d('0x23')](function(_0x36df42){return _0x36df42;});}return null;};}function removeEntity(_0x28ef76,_0x17712c){return function(_0x2eda40){if(_0x2eda40){return _0x2eda40[_0xee2d('0x24')]()[_0xee2d('0x23')](function(){var _0x334e20=_0x2eda40[_0xee2d('0x25')]({'plain':!![]});var _0x1a66da='Companies';return db[_0xee2d('0x26')][_0xee2d('0x24')]({'where':{'type':_0x1a66da,'resourceId':_0x334e20['id']}})[_0xee2d('0x23')](function(){return _0x2eda40;});})[_0xee2d('0x23')](function(){_0x28ef76[_0xee2d('0x17')](0xcc)[_0xee2d('0x27')]();});}};}function handleEntityNotFound(_0xf8787f,_0x1b87fb){return function(_0x2bf33b){if(!_0x2bf33b){_0xf8787f[_0xee2d('0x16')](0x194);}return _0x2bf33b;};}function handleError(_0x27082a,_0x2a6983){_0x2a6983=_0x2a6983||0x1f4;return function(_0x9a9f46){logger[_0xee2d('0x28')](_0x9a9f46[_0xee2d('0x29')]);if(_0x9a9f46[_0xee2d('0x2a')]){delete _0x9a9f46[_0xee2d('0x2a')];}_0x27082a[_0xee2d('0x17')](_0x2a6983)['send'](_0x9a9f46);};}exports[_0xee2d('0x2b')]=function(_0x23d9bd,_0x39cca0){var _0x252a1a={},_0x65dbb8={},_0x374498={'count':0x0,'rows':[]};return db[_0xee2d('0x2c')][_0xee2d('0x2d')]()[_0xee2d('0x23')](function(_0xa7979f){_0x65dbb8[_0xee2d('0x2e')]=_[_0xee2d('0x2f')](_0xa7979f);_0x65dbb8[_0xee2d('0x30')]=_[_0xee2d('0x2f')](_0x23d9bd[_0xee2d('0x30')]);_0x65dbb8['filters']=_['intersection'](_0x65dbb8[_0xee2d('0x2e')],_0x65dbb8[_0xee2d('0x30')]);_0x252a1a[_0xee2d('0x31')]=_[_0xee2d('0x32')](_0x65dbb8[_0xee2d('0x2e')],qs[_0xee2d('0x33')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x33')]));_0x252a1a[_0xee2d('0x31')]=_0x252a1a[_0xee2d('0x31')][_0xee2d('0x34')]?_0x252a1a['attributes']:_0x65dbb8[_0xee2d('0x2e')];if(!_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x35')](_0xee2d('0x36'))){_0x252a1a[_0xee2d('0x1b')]=qs[_0xee2d('0x1b')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x1b')]);_0x252a1a[_0xee2d('0x19')]=qs[_0xee2d('0x19')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x19')]);}_0x252a1a[_0xee2d('0x37')]=qs[_0xee2d('0x38')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x38')]);_0x252a1a['where']=qs[_0xee2d('0x39')](_[_0xee2d('0x3a')](_0x23d9bd[_0xee2d('0x30')],_0x65dbb8['filters']),_0xa7979f);if(_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x3b')]){_0x252a1a[_0xee2d('0x3c')]=_['merge'](_0x252a1a[_0xee2d('0x3c')],{'$or':_[_0xee2d('0x3d')](_0x252a1a[_0xee2d('0x31')],function(_0x16022f){var _0x679600={};_0x679600[_0x16022f]={'$like':'%'+_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x3b')]+'%'};return _0x679600;})});}_0x252a1a=_[_0xee2d('0x3e')]({},_0x252a1a,_0x23d9bd[_0xee2d('0x3f')]);var _0x3896a2={'where':_0x252a1a[_0xee2d('0x3c')]};return db[_0xee2d('0x2c')][_0xee2d('0x1c')](_0x3896a2)[_0xee2d('0x23')](function(_0x65c7d0){_0x374498[_0xee2d('0x1c')]=_0x65c7d0;if(_0x23d9bd['query']['includeAll']){_0x252a1a['include']=[{'all':!![]}];}return db[_0xee2d('0x2c')]['findAll'](_0x252a1a);})['then'](function(_0x5db388){_0x374498[_0xee2d('0x40')]=_0x5db388;return _0x374498;})[_0xee2d('0x23')](respondWithFilteredResult(_0x39cca0,_0x252a1a))[_0xee2d('0x41')](handleError(_0x39cca0,null));})[_0xee2d('0x41')](handleError(_0x39cca0,null));};exports[_0xee2d('0x42')]=function(_0x2f8b27,_0x482f66){var _0x3d1438={'raw':![],'where':{'id':_0x2f8b27['params']['id']}},_0x1cb718={};_0x1cb718[_0xee2d('0x2e')]=_[_0xee2d('0x2f')](db['CmCompany']['rawAttributes']);_0x1cb718[_0xee2d('0x30')]=_[_0xee2d('0x2f')](_0x2f8b27['query']);_0x1cb718[_0xee2d('0x39')]=_[_0xee2d('0x32')](_0x1cb718[_0xee2d('0x2e')],_0x1cb718['query']);_0x3d1438[_0xee2d('0x31')]=_['intersection'](_0x1cb718[_0xee2d('0x2e')],qs[_0xee2d('0x33')](_0x2f8b27[_0xee2d('0x30')][_0xee2d('0x33')]));_0x3d1438[_0xee2d('0x31')]=_0x3d1438['attributes']['length']?_0x3d1438['attributes']:_0x1cb718[_0xee2d('0x2e')];if(_0x2f8b27[_0xee2d('0x30')][_0xee2d('0x43')]){_0x3d1438[_0xee2d('0x44')]=[{'all':!![]}];}_0x3d1438=_['merge']({},_0x3d1438,_0x2f8b27[_0xee2d('0x3f')]);return db['CmCompany'][_0xee2d('0x45')](_0x3d1438)[_0xee2d('0x23')](handleEntityNotFound(_0x482f66,null))[_0xee2d('0x23')](respondWithResult(_0x482f66,null))['catch'](handleError(_0x482f66,null));};exports[_0xee2d('0x46')]=function(_0xed71a7,_0x31ee29){return db[_0xee2d('0x2c')][_0xee2d('0x46')](_0xed71a7['body'],{})[_0xee2d('0x23')](function(_0x434c7e){var _0x52e65c=_0xed71a7[_0xee2d('0x47')]['get']({'plain':!![]});if(!_0x52e65c)throw new Error(_0xee2d('0x48'));if(_0x52e65c['role']===_0xee2d('0x47')){var _0x51dff8=_0x434c7e[_0xee2d('0x25')]({'plain':!![]});var _0x4b72f0='Companies';return db[_0xee2d('0x49')][_0xee2d('0x45')]({'where':{'name':_0x4b72f0,'userProfileId':_0x52e65c[_0xee2d('0x4a')]},'raw':!![]})[_0xee2d('0x23')](function(_0x3c3b29){if(_0x3c3b29&&_0x3c3b29[_0xee2d('0x4b')]===0x0){return db[_0xee2d('0x26')][_0xee2d('0x46')]({'name':_0x51dff8[_0xee2d('0x2a')],'resourceId':_0x51dff8['id'],'type':_0x3c3b29['name'],'sectionId':_0x3c3b29['id']},{})[_0xee2d('0x23')](function(){return _0x434c7e;});}else{return _0x434c7e;}})[_0xee2d('0x41')](function(_0x33b2bd){logger[_0xee2d('0x28')](_0xee2d('0x4c'),_0x33b2bd);throw _0x33b2bd;});}return _0x434c7e;})[_0xee2d('0x23')](respondWithResult(_0x31ee29,0xc9))['catch'](handleError(_0x31ee29,null));};exports['update']=function(_0x271df2,_0x427c30){if(_0x271df2[_0xee2d('0x4d')]['id']){delete _0x271df2['body']['id'];}return db['CmCompany'][_0xee2d('0x45')]({'where':{'id':_0x271df2['params']['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x427c30,null))[_0xee2d('0x23')](saveUpdates(_0x271df2[_0xee2d('0x4d')],null))[_0xee2d('0x23')](respondWithResult(_0x427c30,null))[_0xee2d('0x41')](handleError(_0x427c30,null));};exports[_0xee2d('0x24')]=function(_0x5c98eb,_0x3924ee){return db['CmCompany']['find']({'where':{'id':_0x5c98eb[_0xee2d('0x4e')]['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x3924ee,null))['then'](removeEntity(_0x3924ee,null))[_0xee2d('0x41')](handleError(_0x3924ee,null));};exports[_0xee2d('0x2d')]=function(_0x41d64f,_0x45b082){return db[_0xee2d('0x2c')][_0xee2d('0x2d')]()[_0xee2d('0x23')](respondWithResult(_0x45b082,null))[_0xee2d('0x41')](handleError(_0x45b082,null));};exports[_0xee2d('0x4f')]=function(_0x3e22b0,_0x3e8223,_0x22f930){return db[_0xee2d('0x50')][_0xee2d('0x45')]({'where':{'id':_0x3e22b0[_0xee2d('0x4e')]['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x3e8223,null))[_0xee2d('0x23')](function(_0x3e5d5d){if(_0x3e5d5d){return _0x3e5d5d[_0xee2d('0x4f')](_0x3e22b0[_0xee2d('0x4d')]['ids'],_[_0xee2d('0x51')](_0x3e22b0[_0xee2d('0x4d')],['ids','id'])||{});}})[_0xee2d('0x23')](respondWithResult(_0x3e8223,null))[_0xee2d('0x41')](handleError(_0x3e8223,null));};exports[_0xee2d('0x52')]=function(_0x10de76,_0x276e7e,_0x4dae13){var _0x46e094={};var _0x57f421={};var _0x4e1695;var _0x13b04c;return db[_0xee2d('0x2c')][_0xee2d('0x53')]({'where':{'id':_0x10de76[_0xee2d('0x4e')]['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x276e7e,null))[_0xee2d('0x23')](function(_0xee0e8d){if(_0xee0e8d){_0x4e1695=_0xee0e8d;_0x57f421[_0xee2d('0x2e')]=_['keys'](db['CmContact'][_0xee2d('0x54')]);_0x57f421[_0xee2d('0x30')]=_[_0xee2d('0x2f')](_0x10de76['query']);_0x57f421['filters']=_['intersection'](_0x57f421['model'],_0x57f421[_0xee2d('0x30')]);_0x46e094[_0xee2d('0x31')]=_['intersection'](_0x57f421[_0xee2d('0x2e')],qs[_0xee2d('0x33')](_0x10de76['query'][_0xee2d('0x33')]));_0x46e094[_0xee2d('0x31')]=_0x46e094[_0xee2d('0x31')][_0xee2d('0x34')]?_0x46e094['attributes']:_0x57f421[_0xee2d('0x2e')];_0x46e094[_0xee2d('0x37')]=qs[_0xee2d('0x38')](_0x10de76['query'][_0xee2d('0x38')]);_0x46e094[_0xee2d('0x3c')]=qs[_0xee2d('0x39')](_[_0xee2d('0x3a')](_0x10de76['query'],_0x57f421[_0xee2d('0x39')]));if(_0x10de76[_0xee2d('0x30')]['filter']){_0x46e094[_0xee2d('0x3c')]=_[_0xee2d('0x3e')](_0x46e094[_0xee2d('0x3c')],{'$or':_['map'](_0x46e094[_0xee2d('0x31')],function(_0x54b18e){var _0x1b7846={};_0x1b7846[_0x54b18e]={'$like':'%'+_0x10de76[_0xee2d('0x30')][_0xee2d('0x3b')]+'%'};return _0x1b7846;})});}_0x46e094=_[_0xee2d('0x3e')]({},_0x46e094,_0x10de76[_0xee2d('0x3f')]);return _0x4e1695[_0xee2d('0x52')](_0x46e094);}})['then'](function(_0xb3b0a3){if(_0xb3b0a3){_0x13b04c=_0xb3b0a3[_0xee2d('0x34')];if(!_0x10de76[_0xee2d('0x30')][_0xee2d('0x35')](_0xee2d('0x36'))){_0x46e094[_0xee2d('0x1b')]=qs[_0xee2d('0x1b')](_0x10de76['query'][_0xee2d('0x1b')]);_0x46e094[_0xee2d('0x19')]=qs['offset'](_0x10de76[_0xee2d('0x30')]['offset']);}return _0x4e1695['getContacts'](_0x46e094);}})[_0xee2d('0x23')](function(_0x2b9e87){if(_0x2b9e87){return _0x2b9e87?{'count':_0x13b04c,'rows':_0x2b9e87}:null;}})[_0xee2d('0x23')](respondWithResult(_0x276e7e,null))[_0xee2d('0x41')](handleError(_0x276e7e,null));}; \ No newline at end of file +var _0x3a4f=['Content-Range','apply','reject','save','destroy','then','Companies','error','stack','name','send','index','CmCompany','describe','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','user','get','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','ids','omit','CmContact','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count'];(function(_0x54d7a7,_0x57b69a){var _0x1cf477=function(_0x599cd4){while(--_0x599cd4){_0x54d7a7['push'](_0x54d7a7['shift']());}};_0x1cf477(++_0x57b69a);}(_0x3a4f,0x130));var _0xf3a4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3a4f[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3a4('0x0'));var zipdir=require(_0xf3a4('0x1'));var jsonpatch=require(_0xf3a4('0x2'));var rp=require(_0xf3a4('0x3'));var moment=require(_0xf3a4('0x4'));var BPromise=require(_0xf3a4('0x5'));var Mustache=require(_0xf3a4('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf3a4('0x7'));var csv=require('to-csv');var ejs=require(_0xf3a4('0x8'));var fs=require('fs');var fs_extra=require(_0xf3a4('0x9'));var _=require(_0xf3a4('0xa'));var squel=require('squel');var crypto=require(_0xf3a4('0xb'));var jsforce=require(_0xf3a4('0xc'));var deskjs=require(_0xf3a4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf3a4('0xe'));var Papa=require(_0xf3a4('0xf'));var Redis=require(_0xf3a4('0x10'));var authService=require(_0xf3a4('0x11'));var qs=require(_0xf3a4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3a4('0x13'));var logger=require(_0xf3a4('0x14'))(_0xf3a4('0x15'));var utils=require(_0xf3a4('0x16'));var config=require(_0xf3a4('0x17'));var licenseUtil=require(_0xf3a4('0x18'));var db=require(_0xf3a4('0x19'))['db'];function respondWithStatusCode(_0x4a3630,_0x3b3435){_0x3b3435=_0x3b3435||0xcc;return function(_0x43ec44){if(_0x43ec44){return _0x4a3630['sendStatus'](_0x3b3435);}return _0x4a3630['status'](_0x3b3435)[_0xf3a4('0x1a')]();};}function respondWithResult(_0x1786c0,_0x37b471){_0x37b471=_0x37b471||0xc8;return function(_0x5763a9){if(_0x5763a9){return _0x1786c0[_0xf3a4('0x1b')](_0x37b471)['json'](_0x5763a9);}};}function respondWithFilteredResult(_0x372f8e,_0x3a3a1f){return function(_0xbdc8f5){if(_0xbdc8f5){var _0x103ffc=typeof _0x3a3a1f[_0xf3a4('0x1c')]===_0xf3a4('0x1d')&&typeof _0x3a3a1f[_0xf3a4('0x1e')]===_0xf3a4('0x1d');var _0x1a6528=_0xbdc8f5['count'];var _0x185fc9=_0x103ffc?0x0:_0x3a3a1f['offset'];var _0x50150b=_0x103ffc?_0xbdc8f5[_0xf3a4('0x1f')]:_0x3a3a1f[_0xf3a4('0x1c')]+_0x3a3a1f[_0xf3a4('0x1e')];var _0x47ab3f;if(_0x50150b>=_0x1a6528){_0x50150b=_0x1a6528;_0x47ab3f=0xc8;}else{_0x47ab3f=0xce;}_0x372f8e[_0xf3a4('0x1b')](_0x47ab3f);return _0x372f8e['set'](_0xf3a4('0x20'),_0x185fc9+'-'+_0x50150b+'/'+_0x1a6528)['json'](_0xbdc8f5);}return null;};}function patchUpdates(_0x2ab13b){return function(_0x3fe07d){try{jsonpatch[_0xf3a4('0x21')](_0x3fe07d,_0x2ab13b,!![]);}catch(_0x1eae0b){return BPromise[_0xf3a4('0x22')](_0x1eae0b);}return _0x3fe07d[_0xf3a4('0x23')]();};}function saveUpdates(_0x217afb,_0x228b18){return function(_0x6ce2a2){if(_0x6ce2a2){return _0x6ce2a2['update'](_0x217afb)['then'](function(_0x361cb2){return _0x361cb2;});}return null;};}function removeEntity(_0x2a6a3d,_0x1addc4){return function(_0x458e90){if(_0x458e90){return _0x458e90[_0xf3a4('0x24')]()[_0xf3a4('0x25')](function(){var _0x54b9bc=_0x458e90['get']({'plain':!![]});var _0x212132=_0xf3a4('0x26');return db['UserProfileResource'][_0xf3a4('0x24')]({'where':{'type':_0x212132,'resourceId':_0x54b9bc['id']}})[_0xf3a4('0x25')](function(){return _0x458e90;});})[_0xf3a4('0x25')](function(){_0x2a6a3d[_0xf3a4('0x1b')](0xcc)[_0xf3a4('0x1a')]();});}};}function handleEntityNotFound(_0x4700d3,_0x49b5c8){return function(_0x164ffc){if(!_0x164ffc){_0x4700d3['sendStatus'](0x194);}return _0x164ffc;};}function handleError(_0x2b92c0,_0x5db2a7){_0x5db2a7=_0x5db2a7||0x1f4;return function(_0x38c197){logger[_0xf3a4('0x27')](_0x38c197[_0xf3a4('0x28')]);if(_0x38c197[_0xf3a4('0x29')]){delete _0x38c197[_0xf3a4('0x29')];}_0x2b92c0[_0xf3a4('0x1b')](_0x5db2a7)[_0xf3a4('0x2a')](_0x38c197);};}exports[_0xf3a4('0x2b')]=function(_0x3e13f9,_0x33f75d){var _0x19bf5b={},_0xffb320={},_0x1d6793={'count':0x0,'rows':[]};return db[_0xf3a4('0x2c')][_0xf3a4('0x2d')]()['then'](function(_0x4aff72){_0xffb320['model']=_['keys'](_0x4aff72);_0xffb320[_0xf3a4('0x2e')]=_['keys'](_0x3e13f9[_0xf3a4('0x2e')]);_0xffb320['filters']=_[_0xf3a4('0x2f')](_0xffb320[_0xf3a4('0x30')],_0xffb320[_0xf3a4('0x2e')]);_0x19bf5b[_0xf3a4('0x31')]=_[_0xf3a4('0x2f')](_0xffb320[_0xf3a4('0x30')],qs[_0xf3a4('0x32')](_0x3e13f9[_0xf3a4('0x2e')]['fields']));_0x19bf5b[_0xf3a4('0x31')]=_0x19bf5b[_0xf3a4('0x31')][_0xf3a4('0x33')]?_0x19bf5b['attributes']:_0xffb320[_0xf3a4('0x30')];if(!_0x3e13f9[_0xf3a4('0x2e')][_0xf3a4('0x34')](_0xf3a4('0x35'))){_0x19bf5b[_0xf3a4('0x1e')]=qs[_0xf3a4('0x1e')](_0x3e13f9[_0xf3a4('0x2e')]['limit']);_0x19bf5b[_0xf3a4('0x1c')]=qs[_0xf3a4('0x1c')](_0x3e13f9[_0xf3a4('0x2e')][_0xf3a4('0x1c')]);}_0x19bf5b[_0xf3a4('0x36')]=qs['sort'](_0x3e13f9[_0xf3a4('0x2e')][_0xf3a4('0x37')]);_0x19bf5b['where']=qs['filters'](_[_0xf3a4('0x38')](_0x3e13f9[_0xf3a4('0x2e')],_0xffb320[_0xf3a4('0x39')]),_0x4aff72);if(_0x3e13f9[_0xf3a4('0x2e')]['filter']){_0x19bf5b[_0xf3a4('0x3a')]=_[_0xf3a4('0x3b')](_0x19bf5b[_0xf3a4('0x3a')],{'$or':_['map'](_0x19bf5b[_0xf3a4('0x31')],function(_0x20cd50){var _0x30ca97={};_0x30ca97[_0x20cd50]={'$like':'%'+_0x3e13f9[_0xf3a4('0x2e')][_0xf3a4('0x3c')]+'%'};return _0x30ca97;})});}_0x19bf5b=_['merge']({},_0x19bf5b,_0x3e13f9[_0xf3a4('0x3d')]);var _0x15cec1={'where':_0x19bf5b[_0xf3a4('0x3a')]};return db['CmCompany']['count'](_0x15cec1)[_0xf3a4('0x25')](function(_0x1f82b9){_0x1d6793[_0xf3a4('0x1f')]=_0x1f82b9;if(_0x3e13f9['query'][_0xf3a4('0x3e')]){_0x19bf5b[_0xf3a4('0x3f')]=[{'all':!![]}];}return db[_0xf3a4('0x2c')][_0xf3a4('0x40')](_0x19bf5b);})[_0xf3a4('0x25')](function(_0x4416b7){_0x1d6793['rows']=_0x4416b7;return _0x1d6793;})[_0xf3a4('0x25')](respondWithFilteredResult(_0x33f75d,_0x19bf5b))['catch'](handleError(_0x33f75d,null));})['catch'](handleError(_0x33f75d,null));};exports[_0xf3a4('0x41')]=function(_0x444c95,_0x5ddecb){var _0x4de65e={'raw':![],'where':{'id':_0x444c95[_0xf3a4('0x42')]['id']}},_0x1d7a33={};_0x1d7a33[_0xf3a4('0x30')]=_[_0xf3a4('0x43')](db[_0xf3a4('0x2c')]['rawAttributes']);_0x1d7a33['query']=_['keys'](_0x444c95[_0xf3a4('0x2e')]);_0x1d7a33[_0xf3a4('0x39')]=_[_0xf3a4('0x2f')](_0x1d7a33['model'],_0x1d7a33['query']);_0x4de65e[_0xf3a4('0x31')]=_[_0xf3a4('0x2f')](_0x1d7a33[_0xf3a4('0x30')],qs['fields'](_0x444c95[_0xf3a4('0x2e')][_0xf3a4('0x32')]));_0x4de65e[_0xf3a4('0x31')]=_0x4de65e[_0xf3a4('0x31')][_0xf3a4('0x33')]?_0x4de65e[_0xf3a4('0x31')]:_0x1d7a33[_0xf3a4('0x30')];if(_0x444c95['query'][_0xf3a4('0x3e')]){_0x4de65e[_0xf3a4('0x3f')]=[{'all':!![]}];}_0x4de65e=_[_0xf3a4('0x3b')]({},_0x4de65e,_0x444c95[_0xf3a4('0x3d')]);return db['CmCompany'][_0xf3a4('0x44')](_0x4de65e)[_0xf3a4('0x25')](handleEntityNotFound(_0x5ddecb,null))[_0xf3a4('0x25')](respondWithResult(_0x5ddecb,null))[_0xf3a4('0x45')](handleError(_0x5ddecb,null));};exports[_0xf3a4('0x46')]=function(_0x3621b6,_0x4a927d){return db['CmCompany'][_0xf3a4('0x46')](_0x3621b6[_0xf3a4('0x47')],{})[_0xf3a4('0x25')](function(_0x13e100){var _0x391dfc=_0x3621b6[_0xf3a4('0x48')][_0xf3a4('0x49')]({'plain':!![]});if(!_0x391dfc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x391dfc[_0xf3a4('0x4a')]===_0xf3a4('0x48')){var _0x42afa2=_0x13e100[_0xf3a4('0x49')]({'plain':!![]});var _0x513eaa=_0xf3a4('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x513eaa,'userProfileId':_0x391dfc[_0xf3a4('0x4b')]},'raw':!![]})[_0xf3a4('0x25')](function(_0x509b38){if(_0x509b38&&_0x509b38['autoAssociation']===0x0){return db[_0xf3a4('0x4c')][_0xf3a4('0x46')]({'name':_0x42afa2['name'],'resourceId':_0x42afa2['id'],'type':_0x509b38[_0xf3a4('0x29')],'sectionId':_0x509b38['id']},{})[_0xf3a4('0x25')](function(){return _0x13e100;});}else{return _0x13e100;}})[_0xf3a4('0x45')](function(_0x316193){logger['error'](_0xf3a4('0x4d'),_0x316193);throw _0x316193;});}return _0x13e100;})[_0xf3a4('0x25')](respondWithResult(_0x4a927d,0xc9))[_0xf3a4('0x45')](handleError(_0x4a927d,null));};exports[_0xf3a4('0x4e')]=function(_0x16de95,_0x5803b4){if(_0x16de95[_0xf3a4('0x47')]['id']){delete _0x16de95[_0xf3a4('0x47')]['id'];}return db[_0xf3a4('0x2c')][_0xf3a4('0x44')]({'where':{'id':_0x16de95['params']['id']}})['then'](handleEntityNotFound(_0x5803b4,null))['then'](saveUpdates(_0x16de95[_0xf3a4('0x47')],null))[_0xf3a4('0x25')](respondWithResult(_0x5803b4,null))[_0xf3a4('0x45')](handleError(_0x5803b4,null));};exports[_0xf3a4('0x24')]=function(_0x39b10f,_0x3ba0f2){return db[_0xf3a4('0x2c')]['find']({'where':{'id':_0x39b10f[_0xf3a4('0x42')]['id']}})[_0xf3a4('0x25')](handleEntityNotFound(_0x3ba0f2,null))[_0xf3a4('0x25')](removeEntity(_0x3ba0f2,null))[_0xf3a4('0x45')](handleError(_0x3ba0f2,null));};exports['describe']=function(_0x5d970e,_0x136a07){return db[_0xf3a4('0x2c')][_0xf3a4('0x2d')]()[_0xf3a4('0x25')](respondWithResult(_0x136a07,null))[_0xf3a4('0x45')](handleError(_0x136a07,null));};exports[_0xf3a4('0x4f')]=function(_0x4e53c5,_0x318f24,_0x2bce2b){return db['CmContact'][_0xf3a4('0x44')]({'where':{'id':_0x4e53c5['params']['id']}})[_0xf3a4('0x25')](handleEntityNotFound(_0x318f24,null))[_0xf3a4('0x25')](function(_0x49fef5){if(_0x49fef5){return _0x49fef5[_0xf3a4('0x4f')](_0x4e53c5['body'][_0xf3a4('0x50')],_[_0xf3a4('0x51')](_0x4e53c5[_0xf3a4('0x47')],[_0xf3a4('0x50'),'id'])||{});}})[_0xf3a4('0x25')](respondWithResult(_0x318f24,null))[_0xf3a4('0x45')](handleError(_0x318f24,null));};exports['getContacts']=function(_0x7e3497,_0x167730,_0x2722d8){var _0x59e64a={};var _0xca4b22={};var _0x3b5342;var _0xfd6464;return db[_0xf3a4('0x2c')]['findOne']({'where':{'id':_0x7e3497['params']['id']}})['then'](handleEntityNotFound(_0x167730,null))['then'](function(_0xc09cba){if(_0xc09cba){_0x3b5342=_0xc09cba;_0xca4b22['model']=_[_0xf3a4('0x43')](db[_0xf3a4('0x52')]['rawAttributes']);_0xca4b22[_0xf3a4('0x2e')]=_[_0xf3a4('0x43')](_0x7e3497[_0xf3a4('0x2e')]);_0xca4b22[_0xf3a4('0x39')]=_['intersection'](_0xca4b22[_0xf3a4('0x30')],_0xca4b22['query']);_0x59e64a[_0xf3a4('0x31')]=_[_0xf3a4('0x2f')](_0xca4b22['model'],qs[_0xf3a4('0x32')](_0x7e3497[_0xf3a4('0x2e')]['fields']));_0x59e64a['attributes']=_0x59e64a[_0xf3a4('0x31')][_0xf3a4('0x33')]?_0x59e64a['attributes']:_0xca4b22[_0xf3a4('0x30')];_0x59e64a[_0xf3a4('0x36')]=qs[_0xf3a4('0x37')](_0x7e3497[_0xf3a4('0x2e')][_0xf3a4('0x37')]);_0x59e64a[_0xf3a4('0x3a')]=qs[_0xf3a4('0x39')](_[_0xf3a4('0x38')](_0x7e3497[_0xf3a4('0x2e')],_0xca4b22['filters']));if(_0x7e3497[_0xf3a4('0x2e')]['filter']){_0x59e64a['where']=_[_0xf3a4('0x3b')](_0x59e64a[_0xf3a4('0x3a')],{'$or':_['map'](_0x59e64a[_0xf3a4('0x31')],function(_0x2ed003){var _0x11f23a={};_0x11f23a[_0x2ed003]={'$like':'%'+_0x7e3497[_0xf3a4('0x2e')]['filter']+'%'};return _0x11f23a;})});}_0x59e64a=_['merge']({},_0x59e64a,_0x7e3497[_0xf3a4('0x3d')]);return _0x3b5342[_0xf3a4('0x53')](_0x59e64a);}})[_0xf3a4('0x25')](function(_0x57c359){if(_0x57c359){_0xfd6464=_0x57c359[_0xf3a4('0x33')];if(!_0x7e3497[_0xf3a4('0x2e')][_0xf3a4('0x34')](_0xf3a4('0x35'))){_0x59e64a[_0xf3a4('0x1e')]=qs[_0xf3a4('0x1e')](_0x7e3497[_0xf3a4('0x2e')]['limit']);_0x59e64a[_0xf3a4('0x1c')]=qs[_0xf3a4('0x1c')](_0x7e3497[_0xf3a4('0x2e')]['offset']);}return _0x3b5342[_0xf3a4('0x53')](_0x59e64a);}})[_0xf3a4('0x25')](function(_0x501339){if(_0x501339){return _0x501339?{'count':_0xfd6464,'rows':_0x501339}:null;}})['then'](respondWithResult(_0x167730,null))['catch'](handleError(_0x167730,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index a50d625..48b74ba 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 _0x6349=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17499b,_0x1b2ffd){var _0x5d2b45=function(_0x55f4e2){while(--_0x55f4e2){_0x17499b['push'](_0x17499b['shift']());}};_0x5d2b45(++_0x1b2ffd);}(_0x6349,0x101));var _0x9634=function(_0x1a4a85,_0x2af844){_0x1a4a85=_0x1a4a85-0x0;var _0x185e02=_0x6349[_0x1a4a85];return _0x185e02;};'use strict';var _=require('lodash');var util=require(_0x9634('0x0'));var logger=require(_0x9634('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9634('0x2'));var rp=require(_0x9634('0x3'));var fs=require('fs');var path=require(_0x9634('0x4'));var rimraf=require(_0x9634('0x5'));var config=require(_0x9634('0x6'));var attributes=require(_0x9634('0x7'));module[_0x9634('0x8')]=function(_0x43a8a0,_0x57a3b3){return _0x43a8a0[_0x9634('0x9')](_0x9634('0xa'),attributes,{'tableName':_0x9634('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbd8=['path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x13a26b,_0x5693b1){var _0x4c2f07=function(_0x260581){while(--_0x260581){_0x13a26b['push'](_0x13a26b['shift']());}};_0x4c2f07(++_0x5693b1);}(_0xbbd8,0x125));var _0x8bbd=function(_0x207909,_0x5ccc80){_0x207909=_0x207909-0x0;var _0x46b282=_0xbbd8[_0x207909];return _0x46b282;};'use strict';var _=require(_0x8bbd('0x0'));var util=require('util');var logger=require(_0x8bbd('0x1'))(_0x8bbd('0x2'));var moment=require(_0x8bbd('0x3'));var BPromise=require(_0x8bbd('0x4'));var rp=require(_0x8bbd('0x5'));var fs=require('fs');var path=require(_0x8bbd('0x6'));var rimraf=require(_0x8bbd('0x7'));var config=require('../../config/environment');var attributes=require(_0x8bbd('0x8'));module[_0x8bbd('0x9')]=function(_0x5be8d3,_0x20fb81){return _0x5be8d3[_0x8bbd('0xa')](_0x8bbd('0xb'),attributes,{'tableName':_0x8bbd('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 a2379c2..523578b 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 _0x1fb0=['request\x20sent','debug','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmCompany,\x20%s,\x20%s'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0x1fb0,0x15b));var _0x01fb=function(_0x47a5f8,_0x1b4545){_0x47a5f8=_0x47a5f8-0x0;var _0x554bbf=_0x1fb0[_0x47a5f8];return _0x554bbf;};'use strict';var _=require('lodash');var util=require(_0x01fb('0x0'));var moment=require(_0x01fb('0x1'));var BPromise=require('bluebird');var rs=require(_0x01fb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01fb('0x3'))['db'];var utils=require(_0x01fb('0x4'));var logger=require(_0x01fb('0x5'))(_0x01fb('0x6'));var config=require(_0x01fb('0x7'));var jayson=require(_0x01fb('0x8'));var client=jayson['client'][_0x01fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ab1ce,_0x21c6cd,_0x492b2e){return new BPromise(function(_0x3d4d6c,_0x3eb8ba){return client[_0x01fb('0xa')](_0x4ab1ce,_0x492b2e)[_0x01fb('0xb')](function(_0x25b6e3){logger['info'](_0x01fb('0xc'),_0x21c6cd,_0x01fb('0xd'));logger[_0x01fb('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x21c6cd,_0x01fb('0xd'),JSON['stringify'](_0x25b6e3));if(_0x25b6e3[_0x01fb('0xf')]){if(_0x25b6e3['error'][_0x01fb('0x10')]===0x1f4){logger[_0x01fb('0xf')](_0x01fb('0xc'),_0x21c6cd,_0x25b6e3[_0x01fb('0xf')][_0x01fb('0x11')]);return _0x3eb8ba(_0x25b6e3['error'][_0x01fb('0x11')]);}logger['error'](_0x01fb('0xc'),_0x21c6cd,_0x25b6e3[_0x01fb('0xf')][_0x01fb('0x11')]);return _0x3d4d6c(_0x25b6e3[_0x01fb('0xf')][_0x01fb('0x11')]);}else{logger['info'](_0x01fb('0xc'),_0x21c6cd,_0x01fb('0xd'));_0x3d4d6c(_0x25b6e3[_0x01fb('0x12')]['message']);}})[_0x01fb('0x13')](function(_0x5c7218){logger['error'](_0x01fb('0xc'),_0x21c6cd,_0x5c7218);_0x3eb8ba(_0x5c7218);});});} \ No newline at end of file +var _0x31f0=['error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x2f672e,_0x3405d1){var _0xaf008=function(_0x454fdf){while(--_0x454fdf){_0x2f672e['push'](_0x2f672e['shift']());}};_0xaf008(++_0x3405d1);}(_0x31f0,0xcb));var _0x031f=function(_0x17d5bf,_0x3252c1){_0x17d5bf=_0x17d5bf-0x0;var _0x5b3bf7=_0x31f0[_0x17d5bf];return _0x5b3bf7;};'use strict';var _=require(_0x031f('0x0'));var util=require(_0x031f('0x1'));var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rs=require(_0x031f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x031f('0x5'));var logger=require(_0x031f('0x6'))('rpc');var config=require(_0x031f('0x7'));var jayson=require(_0x031f('0x8'));var client=jayson[_0x031f('0x9')][_0x031f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xec014c,_0x48facc,_0x2553cd){return new BPromise(function(_0x247e10,_0x5dfd85){return client[_0x031f('0xb')](_0xec014c,_0x2553cd)[_0x031f('0xc')](function(_0x2ccc19){logger['info'](_0x031f('0xd'),_0x48facc,_0x031f('0xe'));logger[_0x031f('0xf')](_0x031f('0x10'),_0x48facc,'request\x20sent',JSON['stringify'](_0x2ccc19));if(_0x2ccc19['error']){if(_0x2ccc19[_0x031f('0x11')]['code']===0x1f4){logger[_0x031f('0x11')](_0x031f('0xd'),_0x48facc,_0x2ccc19[_0x031f('0x11')][_0x031f('0x12')]);return _0x5dfd85(_0x2ccc19[_0x031f('0x11')][_0x031f('0x12')]);}logger[_0x031f('0x11')]('CmCompany,\x20%s,\x20%s',_0x48facc,_0x2ccc19[_0x031f('0x11')][_0x031f('0x12')]);return _0x247e10(_0x2ccc19[_0x031f('0x11')][_0x031f('0x12')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x48facc,_0x031f('0xe'));_0x247e10(_0x2ccc19['result'][_0x031f('0x12')]);}})[_0x031f('0x13')](function(_0x43e17d){logger['error'](_0x031f('0xd'),_0x48facc,_0x43e17d);_0x5dfd85(_0x43e17d);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 0b90850..b636dd8 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 _0x8b0a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','destroy','exports','multer','util','path','express'];(function(_0x585b20,_0xed7dd){var _0x43aaa0=function(_0xf54695){while(--_0xf54695){_0x585b20['push'](_0x585b20['shift']());}};_0x43aaa0(++_0xed7dd);}(_0x8b0a,0xac));var _0xa8b0=function(_0x2acd35,_0x2b21df){_0x2acd35=_0x2acd35-0x0;var _0x272693=_0x8b0a[_0x2acd35];return _0x272693;};'use strict';var multer=require(_0xa8b0('0x0'));var util=require(_0xa8b0('0x1'));var path=require(_0xa8b0('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8b0('0x3'));var router=express[_0xa8b0('0x4')]();var fs_extra=require(_0xa8b0('0x5'));var auth=require(_0xa8b0('0x6'));var interaction=require(_0xa8b0('0x7'));var config=require(_0xa8b0('0x8'));var controller=require(_0xa8b0('0x9'));router[_0xa8b0('0xa')]('/',auth[_0xa8b0('0xb')](),controller[_0xa8b0('0xc')]);router['get'](_0xa8b0('0xd'),auth[_0xa8b0('0xb')](),controller[_0xa8b0('0xe')]);router[_0xa8b0('0xa')](_0xa8b0('0xf'),auth[_0xa8b0('0xb')](),controller[_0xa8b0('0x10')]);router[_0xa8b0('0xa')](_0xa8b0('0x11'),auth[_0xa8b0('0xb')](),controller[_0xa8b0('0x12')]);router['post']('/',auth[_0xa8b0('0xb')](),controller['create']);router[_0xa8b0('0x13')](_0xa8b0('0x11'),auth['isAuthenticated'](),controller['addContacts']);router['put'](_0xa8b0('0xf'),auth[_0xa8b0('0xb')](),controller['update']);router['delete'](_0xa8b0('0xf'),auth['isAuthenticated'](),controller[_0xa8b0('0x14')]);module[_0xa8b0('0x15')]=router; \ No newline at end of file +var _0x5b58=['update','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','/:id/contacts','getContacts','create','post','addContacts','put'];(function(_0x17aeef,_0x3b10c4){var _0x1764c9=function(_0x2c742d){while(--_0x2c742d){_0x17aeef['push'](_0x17aeef['shift']());}};_0x1764c9(++_0x3b10c4);}(_0x5b58,0xb5));var _0x85b5=function(_0x5137c9,_0x3d193f){_0x5137c9=_0x5137c9-0x0;var _0x548778=_0x5b58[_0x5137c9];return _0x548778;};'use strict';var multer=require('multer');var util=require(_0x85b5('0x0'));var path=require('path');var timeout=require(_0x85b5('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x85b5('0x2'));var auth=require(_0x85b5('0x3'));var interaction=require(_0x85b5('0x4'));var config=require(_0x85b5('0x5'));var controller=require(_0x85b5('0x6'));router[_0x85b5('0x7')]('/',auth[_0x85b5('0x8')](),controller['index']);router[_0x85b5('0x7')](_0x85b5('0x9'),auth[_0x85b5('0x8')](),controller['describe']);router[_0x85b5('0x7')](_0x85b5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x85b5('0x7')](_0x85b5('0xb'),auth['isAuthenticated'](),controller[_0x85b5('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x85b5('0xd')]);router[_0x85b5('0xe')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x85b5('0xf')]);router[_0x85b5('0x10')](_0x85b5('0xa'),auth[_0x85b5('0x8')](),controller[_0x85b5('0x11')]);router['delete'](_0x85b5('0xa'),auth[_0x85b5('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 801e0dd..bb05e7b 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 _0x2c13=['STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize','exports'];(function(_0x19b2ff,_0x4e04c5){var _0x31bc90=function(_0x56e881){while(--_0x56e881){_0x19b2ff['push'](_0x19b2ff['shift']());}};_0x31bc90(++_0x4e04c5);}(_0x2c13,0x1cd));var _0x32c1=function(_0x1f7d8f,_0x43e1ed){_0x1f7d8f=_0x1f7d8f-0x0;var _0x41bd00=_0x2c13[_0x1f7d8f];return _0x41bd00;};'use strict';var _=require(_0x32c1('0x0'));var Sequelize=require(_0x32c1('0x1'));module[_0x32c1('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x32c1('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x32c1('0x3')]},'city':{'type':Sequelize[_0x32c1('0x3')]},'country':{'type':Sequelize[_0x32c1('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x32c1('0x4')]},'phone':{'type':Sequelize[_0x32c1('0x3')]},'mobile':{'type':Sequelize[_0x32c1('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x32c1('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x32c1('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x32c1('0x3')]},'viber':{'type':Sequelize[_0x32c1('0x3')]},'line':{'type':Sequelize[_0x32c1('0x3')]},'wechat':{'type':Sequelize[_0x32c1('0x3')]},'telegram':{'type':Sequelize[_0x32c1('0x3')]},'UserId':{'type':Sequelize[_0x32c1('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x32c1('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x32c1('0x7')]}}; \ No newline at end of file +var _0xc33c=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x9e3edc,_0x594d61){var _0x44a387=function(_0x4edc66){while(--_0x4edc66){_0x9e3edc['push'](_0x9e3edc['shift']());}};_0x44a387(++_0x594d61);}(_0xc33c,0x1ee));var _0xcc33=function(_0xf5e58,_0x25959d){_0xf5e58=_0xf5e58-0x0;var _0x194c49=_0xc33c[_0xf5e58];return _0x194c49;};'use strict';var _=require(_0xcc33('0x0'));var Sequelize=require(_0xcc33('0x1'));module[_0xcc33('0x2')]={'firstName':{'type':Sequelize[_0xcc33('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xcc33('0x3')]},'street':{'type':Sequelize[_0xcc33('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xcc33('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xcc33('0x3')]},'description':{'type':Sequelize[_0xcc33('0x4')]},'phone':{'type':Sequelize[_0xcc33('0x3')]},'mobile':{'type':Sequelize[_0xcc33('0x3')]},'fax':{'type':Sequelize[_0xcc33('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xcc33('0x3')]},'facebook':{'type':Sequelize[_0xcc33('0x3')]},'fb_data':{'type':Sequelize[_0xcc33('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xcc33('0x3')]},'line':{'type':Sequelize[_0xcc33('0x3')]},'wechat':{'type':Sequelize[_0xcc33('0x3')]},'telegram':{'type':Sequelize[_0xcc33('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xcc33('0x5')](0x2)[_0xcc33('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xcc33('0x7')],'defaultValue':Sequelize[_0xcc33('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 2f9c78e..adc5491 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 _0xc9f1=['FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','$or','push','findOrCreate','spread','error','show','find','$and','omit','format','startsWith','table','setFields','id\x20=\x20?','toParam','text','phone','findOne','rawAttributes','pick','options','getTags','setTags','ids','include','ContactId','includeAll','getHopperFinals','CmHopperFinal','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','binding','No\x20firstName\x20column\x20specified','stringify','message','start\x20child\x20process\x20correctly!','getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','duration','createdAt','userSecondDisposition','UserId','fullname','DESC','findAndCountAll','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','key','Owner','browserName','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','mail','substatus','externalUrl','Interaction','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','describe','keys','length','cf_','CmCustomField','trimStart','all','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','cm_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','left_join','t.id\x20=\x20ct.TagId','expr','search','sqlOperator','conditions','Tag','value','split','forEach','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','map','isNil','Contact','ListId','concat','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','clone','isEmpty','having','t.id\x20IN\x20?','resolve','user','User','getLists','c.ListId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.CompanyId','TagIds','Tags','rows','catch','params','tags','columnName','displayName','findAll','alias','values','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage'];(function(_0x6da29c,_0x4951a0){var _0xed78dc=function(_0x1bbb8a){while(--_0x1bbb8a){_0x6da29c['push'](_0x6da29c['shift']());}};_0xed78dc(++_0x4951a0);}(_0xc9f1,0x79));var _0x1c9f=function(_0x2e02ec,_0x16cb09){_0x2e02ec=_0x2e02ec-0x0;var _0x4fd6bb=_0xc9f1[_0x2e02ec];return _0x4fd6bb;};'use strict';var emlformat=require(_0x1c9f('0x0'));var rimraf=require(_0x1c9f('0x1'));var zipdir=require(_0x1c9f('0x2'));var jsonpatch=require(_0x1c9f('0x3'));var rp=require('request-promise');var moment=require(_0x1c9f('0x4'));var BPromise=require(_0x1c9f('0x5'));var Mustache=require('mustache');var util=require(_0x1c9f('0x6'));var path=require(_0x1c9f('0x7'));var sox=require(_0x1c9f('0x8'));var csv=require('to-csv');var ejs=require(_0x1c9f('0x9'));var fs=require('fs');var fs_extra=require(_0x1c9f('0xa'));var _=require(_0x1c9f('0xb'));var squel=require('squel');var crypto=require(_0x1c9f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1c9f('0xd'));var querystring=require(_0x1c9f('0xe'));var Papa=require(_0x1c9f('0xf'));var Redis=require(_0x1c9f('0x10'));var authService=require(_0x1c9f('0x11'));var qs=require(_0x1c9f('0x12'));var as=require(_0x1c9f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1c9f('0x14'));var utils=require(_0x1c9f('0x15'));var config=require(_0x1c9f('0x16'));var licenseUtil=require(_0x1c9f('0x17'));var db=require(_0x1c9f('0x18'))['db'];config[_0x1c9f('0x19')]=_[_0x1c9f('0x1a')](config[_0x1c9f('0x19')],{'host':_0x1c9f('0x1b'),'port':0x18eb});var socket=require(_0x1c9f('0x1c'))(new Redis(config[_0x1c9f('0x19')]));require(_0x1c9f('0x1d'))[_0x1c9f('0x1e')](socket);function respondWithStatusCode(_0x245692,_0x136af8){_0x136af8=_0x136af8||0xcc;return function(_0x41b9f9){if(_0x41b9f9){return _0x245692[_0x1c9f('0x1f')](_0x136af8);}return _0x245692[_0x1c9f('0x20')](_0x136af8)[_0x1c9f('0x21')]();};}function respondWithResult(_0x351606,_0x2781f2){_0x2781f2=_0x2781f2||0xc8;return function(_0x356916){if(_0x356916){return _0x351606['status'](_0x2781f2)[_0x1c9f('0x22')](_0x356916);}};}function respondWithFilteredResult(_0x4c9cb3,_0x4b2046){return function(_0x448962){if(_0x448962){var _0x2cce82=typeof _0x4b2046[_0x1c9f('0x23')]==='undefined'&&typeof _0x4b2046['limit']===_0x1c9f('0x24');var _0x476c5d=_0x448962['count'];var _0xb2adc0=_0x2cce82?0x0:_0x4b2046[_0x1c9f('0x23')];var _0x58760e=_0x2cce82?_0x448962[_0x1c9f('0x25')]:_0x4b2046[_0x1c9f('0x23')]+_0x4b2046[_0x1c9f('0x26')];var _0x21a9f4;if(_0x58760e>=_0x476c5d){_0x58760e=_0x476c5d;_0x21a9f4=0xc8;}else{_0x21a9f4=0xce;}_0x4c9cb3[_0x1c9f('0x20')](_0x21a9f4);return _0x4c9cb3[_0x1c9f('0x27')](_0x1c9f('0x28'),_0xb2adc0+'-'+_0x58760e+'/'+_0x476c5d)[_0x1c9f('0x22')](_0x448962);}return null;};}function patchUpdates(_0x2be303){return function(_0x17d4b7){try{jsonpatch[_0x1c9f('0x29')](_0x17d4b7,_0x2be303,!![]);}catch(_0x27a131){return BPromise[_0x1c9f('0x2a')](_0x27a131);}return _0x17d4b7['save']();};}function saveUpdates(_0x54920c,_0x2e2420){return function(_0x24ea54){if(_0x24ea54){return _0x24ea54[_0x1c9f('0x2b')](_0x54920c)[_0x1c9f('0x2c')](function(_0x220744){return _0x220744;});}return null;};}function removeEntity(_0x39d79d,_0xbd93e9){return function(_0x5d7b88){if(_0x5d7b88){return _0x5d7b88[_0x1c9f('0x2d')]()[_0x1c9f('0x2c')](function(){_0x39d79d[_0x1c9f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37bafc,_0x4d4205){return function(_0xa08f62){if(!_0xa08f62){_0x37bafc[_0x1c9f('0x1f')](0x194);}return _0xa08f62;};}function handleError(_0x4ad3aa,_0x118bdf){_0x118bdf=_0x118bdf||0x1f4;return function(_0x79b0b){logger['error'](_0x79b0b[_0x1c9f('0x2e')]);if(_0x79b0b[_0x1c9f('0x2f')]){delete _0x79b0b[_0x1c9f('0x2f')];}_0x4ad3aa[_0x1c9f('0x20')](_0x118bdf)[_0x1c9f('0x30')](_0x79b0b);};}exports[_0x1c9f('0x31')]=function(_0x4fff97,_0x1ac87d){var _0x266804={},_0x899926={},_0xd00d83={'count':0x0,'rows':[]};return db['CmContact'][_0x1c9f('0x32')]()['then'](function(_0x21e00d){var _0x131de0=[];for(var _0x3093d5=0x0;_0x3093d50x1){_0x52cb69['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1c9f('0x6a')](_0x2581cf),null);}else{if(qs[_0x1c9f('0x6b')](_0x2581cf)){_0x52cb69['or'](_0x1c9f('0x6c'),_0x2581cf+'%');_0x52cb69['or']('c.phone\x20LIKE\x20?',_0x2581cf+'%');_0x52cb69['or'](_0x1c9f('0x6d'),_0x2581cf+'%');_0x52cb69['or'](_0x1c9f('0x6e'),_0x2581cf+'%');}else if(qs[_0x1c9f('0x6f')](_0x2581cf)){_0x52cb69['or'](_0x1c9f('0x70'),_0x2581cf+'%');}else{_0x52cb69['or']('c.firstName\x20LIKE\x20?','%'+_0x2581cf+'%');_0x52cb69['or'](_0x1c9f('0x71'),'%'+_0x2581cf+'%');_0x52cb69['or'](_0x1c9f('0x70'),'%'+_0x2581cf+'%');}}}}_0x4734ba['where'](_0x52cb69);_0x4734ba['group'](_0x1c9f('0x72'));var _0x1c63e9={'type':db[_0x1c9f('0x73')][_0x1c9f('0x74')]['SELECT'],'raw':!![]};var _0x14a68f=_0x4734ba[_0x1c9f('0x75')]()[_0x1c9f('0x45')](_0x1c9f('0x72'));if(_0x266804[_0x1c9f('0x41')]){_0x266804[_0x1c9f('0x41')]['forEach'](function(_0x37ceda){_0x4734ba[_0x1c9f('0x41')]('c.'+_0x37ceda[0x0],_0x37ceda[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1c9f('0x76')](_0x28e87f)){_0x4734ba[_0x1c9f('0x77')](_0x17b90a);_0x14a68f[_0x1c9f('0x43')](_0x1c9f('0x78'),_0x28e87f);}BPromise[_0x1c9f('0x79')]()['then'](function(){if(!_0x372429)return;if(_0x4fff97[_0x1c9f('0x7a')]['role']!=='agent')return;if(!_['some'](_0x372429['conditions'],[_0x1c9f('0x45'),_0x1c9f('0x7b')])){return _0x4fff97['user'][_0x1c9f('0x7c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x36137f){if(_[_0x1c9f('0x76')](_0x36137f)){_0x14a68f[_0x1c9f('0x43')](_0x1c9f('0x7d'));_0x4734ba[_0x1c9f('0x43')](_0x1c9f('0x7d'));}else{_0x14a68f[_0x1c9f('0x43')]('c.ListId\x20IN\x20?',_['map'](_0x36137f,'id'));_0x4734ba[_0x1c9f('0x43')]('c.ListId\x20IN\x20?',_[_0x1c9f('0x60')](_0x36137f,'id'));}});}})['then'](function(){if(_0x4fff97['user'][_0x1c9f('0x7e')]===_0x1c9f('0x7f')&&!_0x372429&&!_0x4fff97['query'][_0x1c9f('0x63')])return[];return db[_0x1c9f('0x80')][_0x1c9f('0x3a')](_0x14a68f['toString'](),_0x1c63e9);})[_0x1c9f('0x2c')](function(_0x5c0fd6){_0xd00d83[_0x1c9f('0x25')]=_0x5c0fd6[_0x1c9f('0x34')];if(_0xd00d83[_0x1c9f('0x25')]===0x0)return[];return db['sequelize']['query'](_0x474fec[_0x1c9f('0x81')](),_0x1c63e9)[_0x1c9f('0x2c')](function(_0x565546){_0x4cec27=_[_0x1c9f('0x82')](_0x565546,'id');_0x1c63e9=_[_0x1c9f('0x83')](_0x1c63e9,{'model':db[_0x1c9f('0x84')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4fff97[_0x1c9f('0x3a')][_0x1c9f('0x3e')]){_0x266804[_0x1c9f('0x3c')][_0x1c9f('0x56')](function(_0x3604ad){_0x4734ba['field']('c.'+_0x3604ad);});}else{_0x4734ba[_0x1c9f('0x45')]('c.id');_0x4734ba[_0x1c9f('0x45')](_0x1c9f('0x85'));_0x4734ba[_0x1c9f('0x45')]('c.lastName');_0x4734ba['field'](_0x1c9f('0x86'));_0x4734ba[_0x1c9f('0x45')](_0x1c9f('0x87'));_0x4734ba[_0x1c9f('0x45')]('c.fax');_0x4734ba['field'](_0x1c9f('0x88'));_0x4734ba[_0x1c9f('0x45')](_0x1c9f('0x89'));_0x4734ba['field'](_0x1c9f('0x8a'));_0x4734ba[_0x1c9f('0x45')]('c.deletedAt');_0x4734ba[_0x1c9f('0x45')](_0x1c9f('0x8b'));_0x4734ba[_0x1c9f('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x266804['limit'])_0x4734ba['limit'](_0x266804[_0x1c9f('0x26')]);if(_0x266804[_0x1c9f('0x23')])_0x4734ba['offset'](_0x266804['offset']);return db[_0x1c9f('0x80')][_0x1c9f('0x3a')](_0x4734ba['toString'](),_0x1c63e9);});})[_0x1c9f('0x2c')](function(_0x3b7994){_0x3b7994[_0x1c9f('0x56')](function(_0x39de02){if(_0x39de02[_0x1c9f('0x8c')]){_0x39de02[_0x1c9f('0x8d')]=[];_0x39de02['TagIds']['split'](',')[_0x1c9f('0x56')](function(_0x51bf80){_0x39de02[_0x1c9f('0x8d')]['push'](_0x4cec27[_0x51bf80]);});}delete _0x39de02[_0x1c9f('0x8c')];});_0xd00d83[_0x1c9f('0x8e')]=_0x3b7994;return _0xd00d83;})[_0x1c9f('0x2c')](respondWithFilteredResult(_0x1ac87d,_0x266804));})[_0x1c9f('0x8f')](handleError(_0x1ac87d,null));};exports[_0x1c9f('0x2d')]=function(_0xdc2a43,_0x5f079d){return db[_0x1c9f('0x84')]['find']({'where':{'id':_0xdc2a43[_0x1c9f('0x90')]['id']}})[_0x1c9f('0x2c')](handleEntityNotFound(_0x5f079d,null))[_0x1c9f('0x2c')](removeEntity(_0x5f079d,null))[_0x1c9f('0x8f')](handleError(_0x5f079d,null));};exports['describe']=function(_0x446169,_0x100f30){return db[_0x1c9f('0x84')]['describe']()[_0x1c9f('0x2c')](function(_0x1dac12){delete _0x1dac12[_0x1c9f('0x91')];for(var _0x4bc3b1=0x0;_0x4bc3b1=_0x17cfe6){_0xed00c5=_0x17cfe6;_0x3e1e7e=0xc8;}else{_0x3e1e7e=0xce;}_0x114a19['status'](_0x3e1e7e);return _0x114a19[_0x74af('0x22')]('Content-Range',_0x116191+'-'+_0xed00c5+'/'+_0x17cfe6)[_0x74af('0x1d')](_0x1d5da1);}return null;};}function patchUpdates(_0x194deb){return function(_0x6bd7a4){try{jsonpatch[_0x74af('0x23')](_0x6bd7a4,_0x194deb,!![]);}catch(_0x23aab0){return BPromise[_0x74af('0x24')](_0x23aab0);}return _0x6bd7a4[_0x74af('0x25')]();};}function saveUpdates(_0x5aab4b,_0x2455ff){return function(_0x4ca943){if(_0x4ca943){return _0x4ca943[_0x74af('0x26')](_0x5aab4b)[_0x74af('0x27')](function(_0x4af42a){return _0x4af42a;});}return null;};}function removeEntity(_0x3a43b2,_0x114d12){return function(_0x33f8e6){if(_0x33f8e6){return _0x33f8e6[_0x74af('0x28')]()[_0x74af('0x27')](function(){_0x3a43b2[_0x74af('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17a1ca,_0x3ee7da){return function(_0x8985cd){if(!_0x8985cd){_0x17a1ca[_0x74af('0x29')](0x194);}return _0x8985cd;};}function handleError(_0x152848,_0x859c84){_0x859c84=_0x859c84||0x1f4;return function(_0x2938ee){logger[_0x74af('0x2a')](_0x2938ee['stack']);if(_0x2938ee[_0x74af('0x2b')]){delete _0x2938ee[_0x74af('0x2b')];}_0x152848[_0x74af('0x1b')](_0x859c84)[_0x74af('0x2c')](_0x2938ee);};}exports[_0x74af('0x2d')]=function(_0x242bee,_0x309c63){var _0x28b480={},_0x2303cf={},_0x2152f9={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x74af('0x27')](function(_0x4886c9){var _0x54b05e=[];for(var _0x704701=0x0;_0x7047010x1){_0x1cdff2['or'](_0x74af('0x69'),qs['getFullTextValue'](_0x26b083),null);}else{if(qs[_0x74af('0x6a')](_0x26b083)){_0x1cdff2['or'](_0x74af('0x6b'),_0x26b083+'%');_0x1cdff2['or'](_0x74af('0x6c'),_0x26b083+'%');_0x1cdff2['or'](_0x74af('0x6d'),_0x26b083+'%');_0x1cdff2['or']('c.fax\x20LIKE\x20?',_0x26b083+'%');}else if(qs[_0x74af('0x6e')](_0x26b083)){_0x1cdff2['or'](_0x74af('0x6f'),_0x26b083+'%');}else{_0x1cdff2['or']('c.firstName\x20LIKE\x20?','%'+_0x26b083+'%');_0x1cdff2['or'](_0x74af('0x70'),'%'+_0x26b083+'%');_0x1cdff2['or'](_0x74af('0x6f'),'%'+_0x26b083+'%');}}}}_0x29a60b['where'](_0x1cdff2);_0x29a60b['group'](_0x74af('0x71'));var _0x91d018={'type':db[_0x74af('0x72')]['QueryTypes'][_0x74af('0x73')],'raw':!![]};var _0x15b572=_0x29a60b['clone']()[_0x74af('0x42')](_0x74af('0x71'));if(_0x28b480[_0x74af('0x3d')]){_0x28b480[_0x74af('0x3d')]['forEach'](function(_0x4f18cc){_0x29a60b[_0x74af('0x3d')]('c.'+_0x4f18cc[0x0],_0x4f18cc[0x1]==='DESC'?![]:!![]);});}if(!_[_0x74af('0x60')](_0x2400a3)){_0x29a60b['having'](_0x410d4a);_0x15b572[_0x74af('0x3f')](_0x74af('0x74'),_0x2400a3);}BPromise[_0x74af('0x75')]()['then'](function(){if(!_0x5170bc)return;if(_0x242bee[_0x74af('0x76')][_0x74af('0x77')]!==_0x74af('0x78'))return;if(!_[_0x74af('0x79')](_0x5170bc[_0x74af('0x51')],['field',_0x74af('0x58')])){return _0x242bee[_0x74af('0x76')][_0x74af('0x7a')]({'attributes':['id'],'raw':!![]})[_0x74af('0x27')](function(_0x12db46){if(_[_0x74af('0x60')](_0x12db46)){_0x15b572['where']('c.ListId\x20IS\x20NULL');_0x29a60b[_0x74af('0x3f')]('c.ListId\x20IS\x20NULL');}else{_0x15b572[_0x74af('0x3f')](_0x74af('0x62'),_['map'](_0x12db46,'id'));_0x29a60b[_0x74af('0x3f')](_0x74af('0x62'),_[_0x74af('0x56')](_0x12db46,'id'));}});}})['then'](function(){if(_0x242bee[_0x74af('0x76')][_0x74af('0x77')]===_0x74af('0x78')&&!_0x5170bc&&!_0x242bee['query'][_0x74af('0x61')])return[];return db[_0x74af('0x7b')][_0x74af('0x37')](_0x15b572['toString'](),_0x91d018);})[_0x74af('0x27')](function(_0xf58763){_0x2152f9[_0x74af('0x21')]=_0xf58763[_0x74af('0x2f')];if(_0x2152f9['count']===0x0)return[];return db[_0x74af('0x7b')][_0x74af('0x37')](_0x185d37[_0x74af('0x7c')](),_0x91d018)[_0x74af('0x27')](function(_0x49671d){_0x2cf34e=_[_0x74af('0x7d')](_0x49671d,'id');_0x91d018=_[_0x74af('0x7e')](_0x91d018,{'model':db[_0x74af('0x7f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x242bee[_0x74af('0x37')][_0x74af('0x80')]){_0x28b480['attributes'][_0x74af('0x57')](function(_0x70f4f9){_0x29a60b[_0x74af('0x42')]('c.'+_0x70f4f9);});}else{_0x29a60b[_0x74af('0x42')]('c.id');_0x29a60b['field']('c.firstName');_0x29a60b[_0x74af('0x42')]('c.lastName');_0x29a60b[_0x74af('0x42')](_0x74af('0x81'));_0x29a60b['field'](_0x74af('0x82'));_0x29a60b[_0x74af('0x42')](_0x74af('0x83'));_0x29a60b[_0x74af('0x42')](_0x74af('0x84'));_0x29a60b['field'](_0x74af('0x85'));_0x29a60b[_0x74af('0x42')]('c.createdAt');_0x29a60b[_0x74af('0x42')](_0x74af('0x86'));_0x29a60b[_0x74af('0x42')](_0x74af('0x87'));_0x29a60b[_0x74af('0x42')](_0x74af('0x88'),_0x74af('0x89'));}if(_0x28b480[_0x74af('0x20')])_0x29a60b[_0x74af('0x20')](_0x28b480[_0x74af('0x20')]);if(_0x28b480[_0x74af('0x1e')])_0x29a60b['offset'](_0x28b480[_0x74af('0x1e')]);return db[_0x74af('0x7b')]['query'](_0x29a60b[_0x74af('0x7c')](),_0x91d018);});})['then'](function(_0x52e217){_0x52e217[_0x74af('0x57')](function(_0x2153a9){if(_0x2153a9[_0x74af('0x89')]){_0x2153a9[_0x74af('0x8a')]=[];_0x2153a9['TagIds'][_0x74af('0x55')](',')[_0x74af('0x57')](function(_0x77c1a4){_0x2153a9[_0x74af('0x8a')]['push'](_0x2cf34e[_0x77c1a4]);});}delete _0x2153a9[_0x74af('0x89')];});_0x2152f9[_0x74af('0x8b')]=_0x52e217;return _0x2152f9;})['then'](respondWithFilteredResult(_0x309c63,_0x28b480));})[_0x74af('0x8c')](handleError(_0x309c63,null));};exports[_0x74af('0x28')]=function(_0x2efd48,_0x46bfec){return db[_0x74af('0x7f')]['find']({'where':{'id':_0x2efd48['params']['id']}})['then'](handleEntityNotFound(_0x46bfec,null))[_0x74af('0x27')](removeEntity(_0x46bfec,null))['catch'](handleError(_0x46bfec,null));};exports[_0x74af('0x8d')]=function(_0x1c4ac6,_0x3bc98e){return db[_0x74af('0x7f')][_0x74af('0x8d')]()[_0x74af('0x27')](function(_0x3dd51c){delete _0x3dd51c['tags'];for(var _0x313f9f=0x0;_0x313f9f{}\s\\|]/g,'-');_0x3697ff(null,util[_0x4b80('0x22')](_0x4b80('0x23'),path['basename'](_0x39dbe8['originalname'],path[_0x4b80('0x24')](_0x39dbe8[_0x4b80('0x20')])),Date[_0x4b80('0x25')](),path[_0x4b80('0x24')](_0x39dbe8[_0x4b80('0x20')])));}})});router[_0x4b80('0x15')]('/csv',upload[_0x4b80('0x26')]('file'),controller[_0x4b80('0x27')]);var upload=multer({'storage':multer[_0x4b80('0x1c')]({'destination':function(_0x3a7227,_0x1552a0,_0x1e2f61){_0x1e2f61(null,path[_0x4b80('0x1d')](config[_0x4b80('0x1e')],_0x4b80('0x1f')));},'filename':function(_0x4a865a,_0xde309e,_0xa33104){_0xde309e['originalname']=_0xde309e['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xa33104(null,util[_0x4b80('0x22')]('%s-%s%s',path[_0x4b80('0x28')](_0xde309e[_0x4b80('0x20')],path['extname'](_0xde309e['originalname'])),Date[_0x4b80('0x25')](),path['extname'](_0xde309e[_0x4b80('0x20')])));}})});router[_0x4b80('0x15')](_0x4b80('0x29'),upload[_0x4b80('0x26')](_0x4b80('0x2a')),controller['upload']);router['post'](_0x4b80('0x2b'),auth[_0x4b80('0x9')](),controller[_0x4b80('0x2c')]);router['put'](_0x4b80('0x2d'),auth[_0x4b80('0x9')](),controller['update']);router['delete'](_0x4b80('0x2d'),auth[_0x4b80('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x756b=['/upload','upload','import','put','update','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','/:id','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','create','/create_many','bulkCreate','setTags','diskStorage','root','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','uploadCsv','join','server/files/tmp'];(function(_0x2459a8,_0x2db005){var _0x1cce67=function(_0x3bba54){while(--_0x3bba54){_0x2459a8['push'](_0x2459a8['shift']());}};_0x1cce67(++_0x2db005);}(_0x756b,0xfc));var _0xb756=function(_0x31d44c,_0x4bed6c){_0x31d44c=_0x31d44c-0x0;var _0x24517c=_0x756b[_0x31d44c];return _0x24517c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb756('0x0'));var timeout=require('connect-timeout');var express=require(_0xb756('0x1'));var router=express[_0xb756('0x2')]();var fs_extra=require(_0xb756('0x3'));var auth=require(_0xb756('0x4'));var interaction=require(_0xb756('0x5'));var config=require(_0xb756('0x6'));var controller=require(_0xb756('0x7'));router[_0xb756('0x8')]('/',auth[_0xb756('0x9')](),controller['index']);router[_0xb756('0x8')](_0xb756('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb756('0xb'),auth[_0xb756('0x9')](),controller['show']);router[_0xb756('0x8')](_0xb756('0xc'),auth[_0xb756('0x9')](),controller['getTags']);router[_0xb756('0x8')](_0xb756('0xd'),auth['isAuthenticated'](),controller[_0xb756('0xe')]);router[_0xb756('0x8')](_0xb756('0xf'),auth[_0xb756('0x9')](),controller[_0xb756('0x10')]);router[_0xb756('0x8')](_0xb756('0x11'),auth['isAuthenticated'](),controller[_0xb756('0x12')]);router[_0xb756('0x8')](_0xb756('0x13'),auth[_0xb756('0x9')](),controller[_0xb756('0x14')]);router[_0xb756('0x8')]('/:id/journey',auth[_0xb756('0x9')](),controller['getJourney']);router[_0xb756('0x15')](_0xb756('0x16'),auth[_0xb756('0x9')](),controller['merge']);router['post']('/',auth[_0xb756('0x9')](),controller[_0xb756('0x17')]);router[_0xb756('0x15')](_0xb756('0x18'),auth[_0xb756('0x9')](),controller[_0xb756('0x19')]);router[_0xb756('0x15')]('/:id/tags',auth[_0xb756('0x9')](),controller[_0xb756('0x1a')]);var upload=multer({'storage':multer[_0xb756('0x1b')]({'destination':function(_0x107fee,_0x4f7017,_0x2d0d81){_0x2d0d81(null,path['join'](config[_0xb756('0x1c')],'server/files/tmp'));},'filename':function(_0x4462c4,_0x683694,_0x4a0f4b){_0x683694['originalname']=_0x683694[_0xb756('0x1d')][_0xb756('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4a0f4b(null,util[_0xb756('0x1f')](_0xb756('0x20'),path[_0xb756('0x21')](_0x683694[_0xb756('0x1d')],path[_0xb756('0x22')](_0x683694['originalname'])),Date[_0xb756('0x23')](),path[_0xb756('0x22')](_0x683694['originalname'])));}})});router[_0xb756('0x15')](_0xb756('0x24'),upload[_0xb756('0x25')](_0xb756('0x26')),controller[_0xb756('0x27')]);var upload=multer({'storage':multer[_0xb756('0x1b')]({'destination':function(_0x140327,_0x35d19c,_0x50679e){_0x50679e(null,path[_0xb756('0x28')](config[_0xb756('0x1c')],_0xb756('0x29')));},'filename':function(_0x26d6da,_0x3bee26,_0x34d447){_0x3bee26[_0xb756('0x1d')]=_0x3bee26[_0xb756('0x1d')][_0xb756('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x34d447(null,util[_0xb756('0x1f')](_0xb756('0x20'),path[_0xb756('0x21')](_0x3bee26['originalname'],path['extname'](_0x3bee26[_0xb756('0x1d')])),Date['now'](),path[_0xb756('0x22')](_0x3bee26[_0xb756('0x1d')])));}})});router['post'](_0xb756('0x2a'),upload[_0xb756('0x25')](_0xb756('0x26')),controller[_0xb756('0x2b')]);router[_0xb756('0x15')]('/upload/:id',auth[_0xb756('0x9')](),controller[_0xb756('0x2c')]);router[_0xb756('0x2d')](_0xb756('0xb'),auth[_0xb756('0x9')](),controller[_0xb756('0x2e')]);router['delete'](_0xb756('0xb'),auth['isAuthenticated'](),controller[_0xb756('0x2f')]);module[_0xb756('0x30')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 15c67af..e70ac2c 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 _0xd38a=['stringify','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','getDataValue','TEXT','type','select','parse','isArray','values'];(function(_0x57bca5,_0x1fc3a4){var _0x58029d=function(_0x4df89d){while(--_0x4df89d){_0x57bca5['push'](_0x57bca5['shift']());}};_0x58029d(++_0x1fc3a4);}(_0xd38a,0xad));var _0xad38=function(_0x3b732c,_0x5bc6d4){_0x3b732c=_0x3b732c-0x0;var _0x232319=_0xd38a[_0x3b732c];return _0x232319;};'use strict';var Sequelize=require(_0xad38('0x0'));var _=require(_0xad38('0x1'));module[_0xad38('0x2')]={'name':{'type':Sequelize[_0xad38('0x3')],'get':function(_0x124320){return this['getDataValue'](_0xad38('0x4'));}},'alias':{'type':Sequelize[_0xad38('0x5')],'allowNull':![],'set':function(_0x10c584){this[_0xad38('0x6')](_0xad38('0x4'),_0x10c584?_0x10c584:this[_0xad38('0x7')]('name'));}},'type':{'type':Sequelize[_0xad38('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xad38('0x8')]('long'),'get':function(){if(this['getDataValue'](_0xad38('0x9'))===_0xad38('0xa')){return JSON[_0xad38('0xb')](this[_0xad38('0x7')]('values'));}else{return this[_0xad38('0x7')]('values');}},'set':function(_0x3d0ace){if(Array[_0xad38('0xc')](_0x3d0ace)){this[_0xad38('0x6')](_0xad38('0xd'),JSON[_0xad38('0xe')](_0x3d0ace));}else{this[_0xad38('0x6')]('values',_0x3d0ace);}}},'required':{'type':Sequelize[_0xad38('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xad38('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xad38('0x10')]('voice')}}; \ No newline at end of file +var _0x5fee=['STRING','setDataValue','getDataValue','name','long','type','select','parse','values','isArray','BOOLEAN','voice','sequelize','lodash','VIRTUAL','alias'];(function(_0x16a059,_0x326057){var _0xb8ba8d=function(_0x5f1320){while(--_0x5f1320){_0x16a059['push'](_0x16a059['shift']());}};_0xb8ba8d(++_0x326057);}(_0x5fee,0xfc));var _0xe5fe=function(_0x59fee2,_0x35c51b){_0x59fee2=_0x59fee2-0x0;var _0x12ddac=_0x5fee[_0x59fee2];return _0x12ddac;};'use strict';var Sequelize=require(_0xe5fe('0x0'));var _=require(_0xe5fe('0x1'));module['exports']={'name':{'type':Sequelize[_0xe5fe('0x2')],'get':function(_0x51db67){return this['getDataValue'](_0xe5fe('0x3'));}},'alias':{'type':Sequelize[_0xe5fe('0x4')],'allowNull':![],'set':function(_0x55552f){this[_0xe5fe('0x5')](_0xe5fe('0x3'),_0x55552f?_0x55552f:this[_0xe5fe('0x6')](_0xe5fe('0x7')));}},'type':{'type':Sequelize[_0xe5fe('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xe5fe('0x8')),'get':function(){if(this[_0xe5fe('0x6')](_0xe5fe('0x9'))===_0xe5fe('0xa')){return JSON[_0xe5fe('0xb')](this[_0xe5fe('0x6')](_0xe5fe('0xc')));}else{return this[_0xe5fe('0x6')](_0xe5fe('0xc'));}},'set':function(_0x141ca6){if(Array[_0xe5fe('0xd')](_0x141ca6)){this[_0xe5fe('0x5')](_0xe5fe('0xc'),JSON['stringify'](_0x141ca6));}else{this['setDataValue'](_0xe5fe('0xc'),_0x141ca6);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe5fe('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xe5fe('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 447cb38..a9e0ea7 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 _0xda3c=['pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','then','rows','catch','show','rawAttributes','length','options','find','params','create','sequelize','Sequelize','TEXT','body','text','number','switch','BOOLEAN','defaultValue','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','update','destroy','stack','name','index','map','CmCustomField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x59fa94,_0x41c802){var _0x3db30c=function(_0x3189db){while(--_0x3189db){_0x59fa94['push'](_0x59fa94['shift']());}};_0x3db30c(++_0x41c802);}(_0xda3c,0x1d1));var _0xcda3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xda3c[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xcda3('0x0'));var rimraf=require(_0xcda3('0x1'));var zipdir=require(_0xcda3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcda3('0x3'));var moment=require(_0xcda3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcda3('0x5'));var util=require('util');var path=require(_0xcda3('0x6'));var sox=require(_0xcda3('0x7'));var csv=require(_0xcda3('0x8'));var ejs=require(_0xcda3('0x9'));var fs=require('fs');var fs_extra=require(_0xcda3('0xa'));var _=require('lodash');var squel=require(_0xcda3('0xb'));var crypto=require(_0xcda3('0xc'));var jsforce=require(_0xcda3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcda3('0x8'));var querystring=require(_0xcda3('0xe'));var Papa=require(_0xcda3('0xf'));var Redis=require(_0xcda3('0x10'));var authService=require(_0xcda3('0x11'));var qs=require(_0xcda3('0x12'));var as=require(_0xcda3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcda3('0x14'))(_0xcda3('0x15'));var utils=require(_0xcda3('0x16'));var config=require(_0xcda3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcda3('0x18'))['db'];function respondWithStatusCode(_0xee4bc,_0x2a3fa4){_0x2a3fa4=_0x2a3fa4||0xcc;return function(_0x3a4470){if(_0x3a4470){return _0xee4bc[_0xcda3('0x19')](_0x2a3fa4);}return _0xee4bc[_0xcda3('0x1a')](_0x2a3fa4)[_0xcda3('0x1b')]();};}function respondWithResult(_0xa62158,_0x52b3de){_0x52b3de=_0x52b3de||0xc8;return function(_0x4aa7e8){if(_0x4aa7e8){return _0xa62158[_0xcda3('0x1a')](_0x52b3de)[_0xcda3('0x1c')](_0x4aa7e8);}};}function respondWithFilteredResult(_0x589b3b,_0x420243){return function(_0x2c275e){if(_0x2c275e){var _0x47903a=typeof _0x420243['offset']==='undefined'&&typeof _0x420243[_0xcda3('0x1d')]===_0xcda3('0x1e');var _0x40cb67=_0x2c275e[_0xcda3('0x1f')];var _0x260a34=_0x47903a?0x0:_0x420243[_0xcda3('0x20')];var _0x3cfafb=_0x47903a?_0x2c275e[_0xcda3('0x1f')]:_0x420243[_0xcda3('0x20')]+_0x420243['limit'];var _0x4c6a69;if(_0x3cfafb>=_0x40cb67){_0x3cfafb=_0x40cb67;_0x4c6a69=0xc8;}else{_0x4c6a69=0xce;}_0x589b3b['status'](_0x4c6a69);return _0x589b3b[_0xcda3('0x21')](_0xcda3('0x22'),_0x260a34+'-'+_0x3cfafb+'/'+_0x40cb67)[_0xcda3('0x1c')](_0x2c275e);}return null;};}function patchUpdates(_0x491f26){return function(_0x370f20){try{jsonpatch['apply'](_0x370f20,_0x491f26,!![]);}catch(_0x11b6d9){return BPromise[_0xcda3('0x23')](_0x11b6d9);}return _0x370f20['save']();};}function saveUpdates(_0x1c2e8e,_0x5dd3f6){return function(_0x1668d5){if(_0x1668d5){return _0x1668d5[_0xcda3('0x24')](_0x1c2e8e)['then'](function(_0x5b020a){return _0x5b020a;});}return null;};}function removeEntity(_0x2ffed7,_0x377d7f){return function(_0xb621f7){if(_0xb621f7){return _0xb621f7[_0xcda3('0x25')]()['then'](function(){_0x2ffed7[_0xcda3('0x1a')](0xcc)[_0xcda3('0x1b')]();});}};}function handleEntityNotFound(_0x4b5dae,_0x356511){return function(_0x13d2a8){if(!_0x13d2a8){_0x4b5dae[_0xcda3('0x19')](0x194);}return _0x13d2a8;};}function handleError(_0x4549b6,_0x2829be){_0x2829be=_0x2829be||0x1f4;return function(_0x403e16){logger['error'](_0x403e16[_0xcda3('0x26')]);if(_0x403e16[_0xcda3('0x27')]){delete _0x403e16[_0xcda3('0x27')];}_0x4549b6['status'](_0x2829be)['send'](_0x403e16);};}exports[_0xcda3('0x28')]=function(_0x50af0b,_0x5ae0ce){var _0xd0046c={},_0x574aab={},_0x240832={'count':0x0,'rows':[]};var _0x5cfd02=_[_0xcda3('0x29')](db[_0xcda3('0x2a')]['rawAttributes'],function(_0x59fe05){return{'name':_0x59fe05[_0xcda3('0x2b')],'type':_0x59fe05[_0xcda3('0x2c')][_0xcda3('0x2d')]};});_0x574aab[_0xcda3('0x2e')]=_['differenceBy'](_[_0xcda3('0x29')](_0x5cfd02,_0xcda3('0x27')),[_0xcda3('0x27')]);_0x574aab[_0xcda3('0x2f')]=_[_0xcda3('0x30')](_0x50af0b[_0xcda3('0x2f')]);_0x574aab[_0xcda3('0x31')]=_[_0xcda3('0x32')](_0x574aab[_0xcda3('0x2e')],_0x574aab[_0xcda3('0x2f')]);_0xd0046c[_0xcda3('0x33')]=_[_0xcda3('0x32')](_0x574aab[_0xcda3('0x2e')],qs[_0xcda3('0x34')](_0x50af0b[_0xcda3('0x2f')]['fields']));_0xd0046c[_0xcda3('0x33')]=_0xd0046c['attributes']['length']?_0xd0046c['attributes']:_0x574aab['model'];if(!_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x35')](_0xcda3('0x36'))){_0xd0046c['limit']=qs[_0xcda3('0x1d')](_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x1d')]);_0xd0046c[_0xcda3('0x20')]=qs['offset'](_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x20')]);}_0xd0046c[_0xcda3('0x37')]=qs[_0xcda3('0x38')](_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x38')]);_0xd0046c['where']=qs['filters'](_[_0xcda3('0x39')](_0x50af0b['query'],_0x574aab['filters']),_0x5cfd02);if(_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x3a')]){_0xd0046c['where']=_[_0xcda3('0x3b')](_0xd0046c[_0xcda3('0x3c')],{'$or':_[_0xcda3('0x29')](_0x5cfd02,function(_0x2e4601){if(_0x2e4601[_0xcda3('0x2c')]!==_0xcda3('0x3d')){var _0x4a106c={};_0x4a106c[_0x2e4601['name']]={'$like':'%'+_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x3a')]+'%'};return _0x4a106c;}})});}_0xd0046c=_[_0xcda3('0x3b')]({},_0xd0046c,_0x50af0b['options']);var _0x3dc3db={'where':_0xd0046c['where']};return db[_0xcda3('0x2a')]['count'](_0x3dc3db)['then'](function(_0x2dc85c){_0x240832[_0xcda3('0x1f')]=_0x2dc85c;if(_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x3e')]){_0xd0046c[_0xcda3('0x3f')]=[{'all':!![]}];}return db[_0xcda3('0x2a')][_0xcda3('0x40')](_0xd0046c);})[_0xcda3('0x41')](function(_0x586606){_0x240832[_0xcda3('0x42')]=_0x586606;return _0x240832;})[_0xcda3('0x41')](respondWithFilteredResult(_0x5ae0ce,_0xd0046c))[_0xcda3('0x43')](handleError(_0x5ae0ce,null));};exports[_0xcda3('0x44')]=function(_0x26cab3,_0x36d2cb){var _0x58a561={'raw':!![],'where':{'id':_0x26cab3['params']['id']}},_0x127249={};_0x127249[_0xcda3('0x2e')]=_[_0xcda3('0x30')](db[_0xcda3('0x2a')][_0xcda3('0x45')]);_0x127249['query']=_[_0xcda3('0x30')](_0x26cab3[_0xcda3('0x2f')]);_0x127249['filters']=_['intersection'](_0x127249[_0xcda3('0x2e')],_0x127249['query']);_0x58a561[_0xcda3('0x33')]=_['intersection'](_0x127249[_0xcda3('0x2e')],qs[_0xcda3('0x34')](_0x26cab3['query'][_0xcda3('0x34')]));_0x58a561[_0xcda3('0x33')]=_0x58a561['attributes'][_0xcda3('0x46')]?_0x58a561[_0xcda3('0x33')]:_0x127249[_0xcda3('0x2e')];if(_0x26cab3[_0xcda3('0x2f')][_0xcda3('0x3e')]){_0x58a561[_0xcda3('0x3f')]=[{'all':!![]}];}_0x58a561=_['merge']({},_0x58a561,_0x26cab3[_0xcda3('0x47')]);return db[_0xcda3('0x2a')][_0xcda3('0x48')](_0x58a561)[_0xcda3('0x41')](handleEntityNotFound(_0x36d2cb,null))['then'](respondWithResult(_0x36d2cb,null))[_0xcda3('0x43')](handleError(_0x36d2cb,null));};exports['update']=function(_0x43798a,_0x47249d){if(_0x43798a['body']['id']){delete _0x43798a['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x43798a['params']['id']}})[_0xcda3('0x41')](handleEntityNotFound(_0x47249d,null))[_0xcda3('0x41')](saveUpdates(_0x43798a['body'],null))[_0xcda3('0x41')](respondWithResult(_0x47249d,null))['catch'](handleError(_0x47249d,null));};exports[_0xcda3('0x25')]=function(_0x5333a1,_0x3fb19e){return db[_0xcda3('0x2a')][_0xcda3('0x48')]({'where':{'id':_0x5333a1[_0xcda3('0x49')]['id']}})[_0xcda3('0x41')](handleEntityNotFound(_0x3fb19e,null))[_0xcda3('0x41')](removeEntity(_0x3fb19e,null))['catch'](handleError(_0x3fb19e,null));};exports[_0xcda3('0x4a')]=function(_0x19715b,_0x13439e){var _0x144d16;return db[_0xcda3('0x4b')]['transaction'](function(_0x319ec0){return db['CmCustomField']['create'](_0x19715b['body'],{'transaction':_0x319ec0})[_0xcda3('0x41')](function(_0x4e19e6){_0x144d16=_0x4e19e6;var _0x27d3ba={'type':db[_0xcda3('0x4c')][_0xcda3('0x4d')],'transaction':_0x319ec0};switch(_0x19715b[_0xcda3('0x4e')][_0xcda3('0x2c')]){case _0xcda3('0x4f'):_0x27d3ba['type']=db[_0xcda3('0x4c')][_0xcda3('0x4d')];break;case _0xcda3('0x50'):_0x27d3ba['type']=db[_0xcda3('0x4c')]['INTEGER'];break;case _0xcda3('0x51'):_0x27d3ba[_0xcda3('0x2c')]=db['Sequelize'][_0xcda3('0x52')];_0x27d3ba[_0xcda3('0x53')]=![];break;default:}return db[_0xcda3('0x4b')]['queryInterface'][_0xcda3('0x54')]('cm_contacts',util[_0xcda3('0x55')](_0xcda3('0x56'),_0x144d16['id']),_0x27d3ba);})[_0xcda3('0x41')](function(){return _0x144d16;});})['then'](respondWithResult(_0x13439e,0xc9))[_0xcda3('0x43')](handleError(_0x13439e,null));}; \ No newline at end of file +var _0x83ca=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','length','find','update','body','params','create','sequelize','transaction','Sequelize','TEXT','text','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb'];(function(_0x158cd2,_0x35de32){var _0x4630f0=function(_0x1ce40c){while(--_0x1ce40c){_0x158cd2['push'](_0x158cd2['shift']());}};_0x4630f0(++_0x35de32);}(_0x83ca,0xe9));var _0xa83c=function(_0x13ba38,_0x4d768b){_0x13ba38=_0x13ba38-0x0;var _0x2d4571=_0x83ca[_0x13ba38];return _0x2d4571;};'use strict';var emlformat=require(_0xa83c('0x0'));var rimraf=require(_0xa83c('0x1'));var zipdir=require(_0xa83c('0x2'));var jsonpatch=require(_0xa83c('0x3'));var rp=require('request-promise');var moment=require(_0xa83c('0x4'));var BPromise=require(_0xa83c('0x5'));var Mustache=require('mustache');var util=require(_0xa83c('0x6'));var path=require(_0xa83c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa83c('0x8'));var fs=require('fs');var fs_extra=require(_0xa83c('0x9'));var _=require('lodash');var squel=require(_0xa83c('0xa'));var crypto=require(_0xa83c('0xb'));var jsforce=require(_0xa83c('0xc'));var deskjs=require(_0xa83c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa83c('0xe'));var Papa=require(_0xa83c('0xf'));var Redis=require('ioredis');var authService=require(_0xa83c('0x10'));var qs=require(_0xa83c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa83c('0x12'));var logger=require('../../config/logger')(_0xa83c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa83c('0x14'));var db=require(_0xa83c('0x15'))['db'];function respondWithStatusCode(_0x4292cc,_0x27ce5c){_0x27ce5c=_0x27ce5c||0xcc;return function(_0x422b7a){if(_0x422b7a){return _0x4292cc[_0xa83c('0x16')](_0x27ce5c);}return _0x4292cc[_0xa83c('0x17')](_0x27ce5c)[_0xa83c('0x18')]();};}function respondWithResult(_0x1d3ef3,_0x27d7f5){_0x27d7f5=_0x27d7f5||0xc8;return function(_0x2167d2){if(_0x2167d2){return _0x1d3ef3[_0xa83c('0x17')](_0x27d7f5)[_0xa83c('0x19')](_0x2167d2);}};}function respondWithFilteredResult(_0x50611d,_0xd15581){return function(_0x444fdd){if(_0x444fdd){var _0x321b0b=typeof _0xd15581[_0xa83c('0x1a')]===_0xa83c('0x1b')&&typeof _0xd15581[_0xa83c('0x1c')]===_0xa83c('0x1b');var _0x4758f6=_0x444fdd[_0xa83c('0x1d')];var _0x569660=_0x321b0b?0x0:_0xd15581[_0xa83c('0x1a')];var _0x4fbbb0=_0x321b0b?_0x444fdd[_0xa83c('0x1d')]:_0xd15581[_0xa83c('0x1a')]+_0xd15581['limit'];var _0x16f28f;if(_0x4fbbb0>=_0x4758f6){_0x4fbbb0=_0x4758f6;_0x16f28f=0xc8;}else{_0x16f28f=0xce;}_0x50611d['status'](_0x16f28f);return _0x50611d[_0xa83c('0x1e')](_0xa83c('0x1f'),_0x569660+'-'+_0x4fbbb0+'/'+_0x4758f6)[_0xa83c('0x19')](_0x444fdd);}return null;};}function patchUpdates(_0x3f429d){return function(_0x57efbf){try{jsonpatch['apply'](_0x57efbf,_0x3f429d,!![]);}catch(_0x34d157){return BPromise[_0xa83c('0x20')](_0x34d157);}return _0x57efbf['save']();};}function saveUpdates(_0x12cf0b,_0x5146c5){return function(_0xfa62b9){if(_0xfa62b9){return _0xfa62b9['update'](_0x12cf0b)[_0xa83c('0x21')](function(_0x1aaeab){return _0x1aaeab;});}return null;};}function removeEntity(_0x49d9ba,_0x215aa8){return function(_0x1c93fb){if(_0x1c93fb){return _0x1c93fb[_0xa83c('0x22')]()[_0xa83c('0x21')](function(){_0x49d9ba['status'](0xcc)[_0xa83c('0x18')]();});}};}function handleEntityNotFound(_0x5f1349,_0x11d8cf){return function(_0x1dc54){if(!_0x1dc54){_0x5f1349[_0xa83c('0x16')](0x194);}return _0x1dc54;};}function handleError(_0x1cc9fe,_0x3c3024){_0x3c3024=_0x3c3024||0x1f4;return function(_0x2b8f62){logger[_0xa83c('0x23')](_0x2b8f62[_0xa83c('0x24')]);if(_0x2b8f62[_0xa83c('0x25')]){delete _0x2b8f62[_0xa83c('0x25')];}_0x1cc9fe[_0xa83c('0x17')](_0x3c3024)['send'](_0x2b8f62);};}exports[_0xa83c('0x26')]=function(_0x4bd765,_0x1962e2){var _0x5e3d78={},_0x941fbd={},_0x53bc58={'count':0x0,'rows':[]};var _0x2d9d59=_[_0xa83c('0x27')](db[_0xa83c('0x28')][_0xa83c('0x29')],function(_0x45bd17){return{'name':_0x45bd17[_0xa83c('0x2a')],'type':_0x45bd17[_0xa83c('0x2b')][_0xa83c('0x2c')]};});_0x941fbd[_0xa83c('0x2d')]=_[_0xa83c('0x2e')](_[_0xa83c('0x27')](_0x2d9d59,_0xa83c('0x25')),[_0xa83c('0x25')]);_0x941fbd[_0xa83c('0x2f')]=_['keys'](_0x4bd765[_0xa83c('0x2f')]);_0x941fbd[_0xa83c('0x30')]=_[_0xa83c('0x31')](_0x941fbd[_0xa83c('0x2d')],_0x941fbd['query']);_0x5e3d78[_0xa83c('0x32')]=_[_0xa83c('0x31')](_0x941fbd[_0xa83c('0x2d')],qs[_0xa83c('0x33')](_0x4bd765['query'][_0xa83c('0x33')]));_0x5e3d78['attributes']=_0x5e3d78[_0xa83c('0x32')]['length']?_0x5e3d78['attributes']:_0x941fbd[_0xa83c('0x2d')];if(!_0x4bd765[_0xa83c('0x2f')]['hasOwnProperty'](_0xa83c('0x34'))){_0x5e3d78[_0xa83c('0x1c')]=qs[_0xa83c('0x1c')](_0x4bd765[_0xa83c('0x2f')][_0xa83c('0x1c')]);_0x5e3d78[_0xa83c('0x1a')]=qs[_0xa83c('0x1a')](_0x4bd765[_0xa83c('0x2f')]['offset']);}_0x5e3d78['order']=qs[_0xa83c('0x35')](_0x4bd765[_0xa83c('0x2f')][_0xa83c('0x35')]);_0x5e3d78[_0xa83c('0x36')]=qs['filters'](_[_0xa83c('0x37')](_0x4bd765['query'],_0x941fbd[_0xa83c('0x30')]),_0x2d9d59);if(_0x4bd765['query'][_0xa83c('0x38')]){_0x5e3d78[_0xa83c('0x36')]=_['merge'](_0x5e3d78[_0xa83c('0x36')],{'$or':_['map'](_0x2d9d59,function(_0x42ec74){if(_0x42ec74['type']!==_0xa83c('0x39')){var _0x1bf700={};_0x1bf700[_0x42ec74[_0xa83c('0x25')]]={'$like':'%'+_0x4bd765['query']['filter']+'%'};return _0x1bf700;}})});}_0x5e3d78=_[_0xa83c('0x3a')]({},_0x5e3d78,_0x4bd765[_0xa83c('0x3b')]);var _0x67395d={'where':_0x5e3d78['where']};return db[_0xa83c('0x28')][_0xa83c('0x1d')](_0x67395d)[_0xa83c('0x21')](function(_0x142def){_0x53bc58['count']=_0x142def;if(_0x4bd765[_0xa83c('0x2f')][_0xa83c('0x3c')]){_0x5e3d78[_0xa83c('0x3d')]=[{'all':!![]}];}return db[_0xa83c('0x28')][_0xa83c('0x3e')](_0x5e3d78);})['then'](function(_0x35082a){_0x53bc58[_0xa83c('0x3f')]=_0x35082a;return _0x53bc58;})[_0xa83c('0x21')](respondWithFilteredResult(_0x1962e2,_0x5e3d78))[_0xa83c('0x40')](handleError(_0x1962e2,null));};exports[_0xa83c('0x41')]=function(_0x343e48,_0x2f901c){var _0x171937={'raw':!![],'where':{'id':_0x343e48['params']['id']}},_0x2b8c74={};_0x2b8c74['model']=_[_0xa83c('0x42')](db[_0xa83c('0x28')]['rawAttributes']);_0x2b8c74[_0xa83c('0x2f')]=_[_0xa83c('0x42')](_0x343e48[_0xa83c('0x2f')]);_0x2b8c74[_0xa83c('0x30')]=_[_0xa83c('0x31')](_0x2b8c74[_0xa83c('0x2d')],_0x2b8c74[_0xa83c('0x2f')]);_0x171937['attributes']=_[_0xa83c('0x31')](_0x2b8c74[_0xa83c('0x2d')],qs[_0xa83c('0x33')](_0x343e48[_0xa83c('0x2f')]['fields']));_0x171937[_0xa83c('0x32')]=_0x171937['attributes'][_0xa83c('0x43')]?_0x171937[_0xa83c('0x32')]:_0x2b8c74[_0xa83c('0x2d')];if(_0x343e48[_0xa83c('0x2f')]['includeAll']){_0x171937['include']=[{'all':!![]}];}_0x171937=_[_0xa83c('0x3a')]({},_0x171937,_0x343e48['options']);return db[_0xa83c('0x28')][_0xa83c('0x44')](_0x171937)['then'](handleEntityNotFound(_0x2f901c,null))[_0xa83c('0x21')](respondWithResult(_0x2f901c,null))[_0xa83c('0x40')](handleError(_0x2f901c,null));};exports[_0xa83c('0x45')]=function(_0x529790,_0x4f460f){if(_0x529790[_0xa83c('0x46')]['id']){delete _0x529790[_0xa83c('0x46')]['id'];}return db[_0xa83c('0x28')][_0xa83c('0x44')]({'where':{'id':_0x529790[_0xa83c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f460f,null))[_0xa83c('0x21')](saveUpdates(_0x529790[_0xa83c('0x46')],null))[_0xa83c('0x21')](respondWithResult(_0x4f460f,null))['catch'](handleError(_0x4f460f,null));};exports[_0xa83c('0x22')]=function(_0x23786c,_0x25e1ec){return db[_0xa83c('0x28')][_0xa83c('0x44')]({'where':{'id':_0x23786c[_0xa83c('0x47')]['id']}})[_0xa83c('0x21')](handleEntityNotFound(_0x25e1ec,null))[_0xa83c('0x21')](removeEntity(_0x25e1ec,null))[_0xa83c('0x40')](handleError(_0x25e1ec,null));};exports[_0xa83c('0x48')]=function(_0x1d745e,_0x1f9c0b){var _0x233f82;return db[_0xa83c('0x49')][_0xa83c('0x4a')](function(_0x2d4591){return db['CmCustomField'][_0xa83c('0x48')](_0x1d745e[_0xa83c('0x46')],{'transaction':_0x2d4591})['then'](function(_0x225458){_0x233f82=_0x225458;var _0x220a3c={'type':db[_0xa83c('0x4b')][_0xa83c('0x4c')],'transaction':_0x2d4591};switch(_0x1d745e[_0xa83c('0x46')][_0xa83c('0x2b')]){case _0xa83c('0x4d'):_0x220a3c['type']=db[_0xa83c('0x4b')]['TEXT'];break;case'number':_0x220a3c[_0xa83c('0x2b')]=db[_0xa83c('0x4b')]['INTEGER'];break;case _0xa83c('0x4e'):_0x220a3c[_0xa83c('0x2b')]=db[_0xa83c('0x4b')][_0xa83c('0x4f')];_0x220a3c[_0xa83c('0x50')]=![];break;default:}return db[_0xa83c('0x49')][_0xa83c('0x51')][_0xa83c('0x52')](_0xa83c('0x53'),util['format'](_0xa83c('0x54'),_0x233f82['id']),_0x220a3c);})[_0xa83c('0x21')](function(){return _0x233f82;});})[_0xa83c('0x21')](respondWithResult(_0x1f9c0b,0xc9))[_0xa83c('0x40')](handleError(_0x1f9c0b,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index e97c9aa..e4621d7 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 _0x3eaa=['moment','bluebird','request-promise','path','rimraf','exports','CmCustomField','cm_custom_fields','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3eaa,0x1dc));var _0xa3ea=function(_0x313e77,_0x4ffd44){_0x313e77=_0x313e77-0x0;var _0xf5bab0=_0x3eaa[_0x313e77];return _0xf5bab0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa3ea('0x0'))('api');var moment=require(_0xa3ea('0x1'));var BPromise=require(_0xa3ea('0x2'));var rp=require(_0xa3ea('0x3'));var fs=require('fs');var path=require(_0xa3ea('0x4'));var rimraf=require(_0xa3ea('0x5'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0xa3ea('0x6')]=function(_0x37906d,_0x3665fc){return _0x37906d['define'](_0xa3ea('0x7'),attributes,{'tableName':_0xa3ea('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe34=['../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3293de,_0x4431d8){var _0x5d2348=function(_0x14ab8f){while(--_0x14ab8f){_0x3293de['push'](_0x3293de['shift']());}};_0x5d2348(++_0x4431d8);}(_0xbe34,0x132));var _0x4be3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xbe34[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x4be3('0x0'));var util=require(_0x4be3('0x1'));var logger=require(_0x4be3('0x2'))(_0x4be3('0x3'));var moment=require(_0x4be3('0x4'));var BPromise=require(_0x4be3('0x5'));var rp=require(_0x4be3('0x6'));var fs=require('fs');var path=require(_0x4be3('0x7'));var rimraf=require(_0x4be3('0x8'));var config=require(_0x4be3('0x9'));var attributes=require(_0x4be3('0xa'));module[_0x4be3('0xb')]=function(_0x269317,_0x4eda4d){return _0x269317[_0x4be3('0xc')](_0x4be3('0xd'),attributes,{'tableName':_0x4be3('0xe'),'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 96188f2..2734b79 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 _0xd52f=['http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x137b9b,_0x160277){var _0x36df54=function(_0x3ffe97){while(--_0x3ffe97){_0x137b9b['push'](_0x137b9b['shift']());}};_0x36df54(++_0x160277);}(_0xd52f,0x131));var _0xfd52=function(_0x2a58e8,_0xea057d){_0x2a58e8=_0x2a58e8-0x0;var _0x279892=_0xd52f[_0x2a58e8];return _0x279892;};'use strict';var _=require(_0xfd52('0x0'));var util=require(_0xfd52('0x1'));var moment=require(_0xfd52('0x2'));var BPromise=require(_0xfd52('0x3'));var rs=require(_0xfd52('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd52('0x5'));var logger=require(_0xfd52('0x6'))(_0xfd52('0x7'));var config=require(_0xfd52('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd52('0x9')][_0xfd52('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f6679,_0x20b355,_0xe8088d){return new BPromise(function(_0x525967,_0x4d5d32){return client[_0xfd52('0xb')](_0x4f6679,_0xe8088d)['then'](function(_0x2e8668){logger[_0xfd52('0xc')]('CmCustomField,\x20%s,\x20%s',_0x20b355,_0xfd52('0xd'));logger[_0xfd52('0xe')](_0xfd52('0xf'),_0x20b355,'request\x20sent',JSON[_0xfd52('0x10')](_0x2e8668));if(_0x2e8668[_0xfd52('0x11')]){if(_0x2e8668[_0xfd52('0x11')]['code']===0x1f4){logger[_0xfd52('0x11')](_0xfd52('0x12'),_0x20b355,_0x2e8668['error'][_0xfd52('0x13')]);return _0x4d5d32(_0x2e8668[_0xfd52('0x11')][_0xfd52('0x13')]);}logger[_0xfd52('0x11')](_0xfd52('0x12'),_0x20b355,_0x2e8668[_0xfd52('0x11')][_0xfd52('0x13')]);return _0x525967(_0x2e8668[_0xfd52('0x11')]['message']);}else{logger[_0xfd52('0xc')](_0xfd52('0x12'),_0x20b355,_0xfd52('0xd'));_0x525967(_0x2e8668['result'][_0xfd52('0x13')]);}})[_0xfd52('0x14')](function(_0x2ba558){logger[_0xfd52('0x11')](_0xfd52('0x12'),_0x20b355,_0x2ba558);_0x4d5d32(_0x2ba558);});});} \ No newline at end of file +var _0xaf26=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0x8ad00,_0x51b817){var _0x54dedd=function(_0x572445){while(--_0x572445){_0x8ad00['push'](_0x8ad00['shift']());}};_0x54dedd(++_0x51b817);}(_0xaf26,0x142));var _0x6af2=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xaf26[_0x2de0a7];return _0x429437;};'use strict';var _=require(_0x6af2('0x0'));var util=require(_0x6af2('0x1'));var moment=require(_0x6af2('0x2'));var BPromise=require(_0x6af2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6af2('0x4'));var db=require(_0x6af2('0x5'))['db'];var utils=require(_0x6af2('0x6'));var logger=require('../../config/logger')(_0x6af2('0x7'));var config=require(_0x6af2('0x8'));var jayson=require(_0x6af2('0x9'));var client=jayson['client'][_0x6af2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x128ab1,_0x362115,_0x3eace4){return new BPromise(function(_0x46b310,_0x1fd11c){return client[_0x6af2('0xb')](_0x128ab1,_0x3eace4)['then'](function(_0x7274e){logger['info'](_0x6af2('0xc'),_0x362115,_0x6af2('0xd'));logger[_0x6af2('0xe')](_0x6af2('0xf'),_0x362115,_0x6af2('0xd'),JSON['stringify'](_0x7274e));if(_0x7274e[_0x6af2('0x10')]){if(_0x7274e[_0x6af2('0x10')]['code']===0x1f4){logger[_0x6af2('0x10')](_0x6af2('0xc'),_0x362115,_0x7274e[_0x6af2('0x10')]['message']);return _0x1fd11c(_0x7274e[_0x6af2('0x10')]['message']);}logger[_0x6af2('0x10')](_0x6af2('0xc'),_0x362115,_0x7274e['error'][_0x6af2('0x11')]);return _0x46b310(_0x7274e[_0x6af2('0x10')][_0x6af2('0x11')]);}else{logger[_0x6af2('0x12')](_0x6af2('0xc'),_0x362115,_0x6af2('0xd'));_0x46b310(_0x7274e[_0x6af2('0x13')]['message']);}})[_0x6af2('0x14')](function(_0x496460){logger[_0x6af2('0x10')](_0x6af2('0xc'),_0x362115,_0x496460);_0x1fd11c(_0x496460);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 46fa5cb..cea4147 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 _0xe767=['connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','show','post','update','delete','exports','util','path'];(function(_0x10185f,_0x5c2f98){var _0x2e4f39=function(_0x21ec64){while(--_0x21ec64){_0x10185f['push'](_0x10185f['shift']());}};_0x2e4f39(++_0x5c2f98);}(_0xe767,0x11e));var _0x7e76=function(_0x5dbc14,_0x1bbbf4){_0x5dbc14=_0x5dbc14-0x0;var _0x237b78=_0xe767[_0x5dbc14];return _0x237b78;};'use strict';var multer=require('multer');var util=require(_0x7e76('0x0'));var path=require(_0x7e76('0x1'));var timeout=require(_0x7e76('0x2'));var express=require(_0x7e76('0x3'));var router=express[_0x7e76('0x4')]();var fs_extra=require(_0x7e76('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7e76('0x6'));var controller=require('./cmCustomField.controller');router[_0x7e76('0x7')]('/',auth['isAuthenticated'](),controller[_0x7e76('0x8')]);router[_0x7e76('0x7')](_0x7e76('0x9'),auth[_0x7e76('0xa')](),controller[_0x7e76('0xb')]);router[_0x7e76('0xc')]('/',auth[_0x7e76('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7e76('0xd')]);router[_0x7e76('0xe')](_0x7e76('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x7e76('0xf')]=router; \ No newline at end of file +var _0x44e8=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer'];(function(_0x39876c,_0x34a7f1){var _0x5c1fbd=function(_0x8fd7b1){while(--_0x8fd7b1){_0x39876c['push'](_0x39876c['shift']());}};_0x5c1fbd(++_0x34a7f1);}(_0x44e8,0xd7));var _0x844e=function(_0x3c35d7,_0x1a4093){_0x3c35d7=_0x3c35d7-0x0;var _0x2a5395=_0x44e8[_0x3c35d7];return _0x2a5395;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x844e('0x1'));var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var fs_extra=require(_0x844e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require(_0x844e('0x7'));router[_0x844e('0x8')]('/',auth['isAuthenticated'](),controller[_0x844e('0x9')]);router[_0x844e('0x8')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['show']);router[_0x844e('0xc')]('/',auth[_0x844e('0xb')](),controller[_0x844e('0xd')]);router[_0x844e('0xe')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['update']);router[_0x844e('0xf')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller[_0x844e('0x10')]);module[_0x844e('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 69c0fde..98190d0 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 _0x1d93=['DATE','contactListQueue','moment','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0xcd09e,_0x1f8e86){var _0x4eef75=function(_0x1adbed){while(--_0x1adbed){_0xcd09e['push'](_0xcd09e['shift']());}};_0x4eef75(++_0x1f8e86);}(_0x1d93,0x1c4));var _0x31d9=function(_0x39853d,_0x2501bf){_0x39853d=_0x39853d-0x0;var _0x5864ca=_0x1d93[_0x39853d];return _0x5864ca;};'use strict';var moment=require(_0x31d9('0x0'));var Sequelize=require('sequelize');module[_0x31d9('0x1')]={'phone':{'type':Sequelize[_0x31d9('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x31d9('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x31d9('0x4')](_0x31d9('0x5'))},'countbusyretry':{'type':Sequelize[_0x31d9('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x31d9('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x31d9('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x31d9('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x31d9('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x31d9('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x31d9('0x6')],'unique':_0x31d9('0x8')},'ListId':{'type':Sequelize[_0x31d9('0x6')],'unique':_0x31d9('0x8')},'UserId':{'type':Sequelize[_0x31d9('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x31d9('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x31d9('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x31d9('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x31d9('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0a6f=['STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','exports'];(function(_0x52282a,_0x45aef7){var _0x3c66b4=function(_0x312aa9){while(--_0x312aa9){_0x52282a['push'](_0x52282a['shift']());}};_0x3c66b4(++_0x45aef7);}(_0x0a6f,0x85));var _0xf0a6=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x0a6f[_0x237f8b];return _0x423f94;};'use strict';var moment=require(_0xf0a6('0x0'));var Sequelize=require('sequelize');module[_0xf0a6('0x1')]={'phone':{'type':Sequelize[_0xf0a6('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xf0a6('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xf0a6('0x4')](_0xf0a6('0x5'))},'countbusyretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf0a6('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xf0a6('0x6')](0x2)[_0xf0a6('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf0a6('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xf0a6('0x6')],'unique':_0xf0a6('0x8')},'ListId':{'type':Sequelize[_0xf0a6('0x6')],'unique':_0xf0a6('0x8')},'UserId':{'type':Sequelize[_0xf0a6('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xf0a6('0x6')],'unique':_0xf0a6('0x8')},'CampaignId':{'type':Sequelize[_0xf0a6('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 6af81e5..1cd81fb 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 _0x4992=['Content-Range','reject','update','destroy','then','error','name','send','index','map','CmHopper','rawAttributes','type','key','model','query','intersection','filters','concat','$and','$or','$gte','$lt','$ne','$eq','$not','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','keys','includeAll','create','body','find','describe','CampaignId','VoiceQueueId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','CmContact','user','outbound','preview','sequelize','transaction','direction','prev','isEmpty','hopperIds','ASC','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','findOne','scheduledat','UPDATE','Contact','CmCompany','Company','CmList','Queue','getOpenContacts','getVoiceQueues','isNumber','entity\x20not\x20found','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set'];(function(_0x119e6d,_0xe3377d){var _0x56b2d5=function(_0x31d728){while(--_0x31d728){_0x119e6d['push'](_0x119e6d['shift']());}};_0x56b2d5(++_0xe3377d);}(_0x4992,0x199));var _0x2499=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4992[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2499('0x0'));var zipdir=require(_0x2499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2499('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2499('0x3'));var util=require(_0x2499('0x4'));var path=require(_0x2499('0x5'));var sox=require(_0x2499('0x6'));var csv=require('to-csv');var ejs=require(_0x2499('0x7'));var fs=require('fs');var fs_extra=require(_0x2499('0x8'));var _=require(_0x2499('0x9'));var squel=require(_0x2499('0xa'));var crypto=require(_0x2499('0xb'));var jsforce=require(_0x2499('0xc'));var deskjs=require(_0x2499('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2499('0xe'));var Papa=require(_0x2499('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2499('0x10'));var as=require(_0x2499('0x11'));var hardwareService=require(_0x2499('0x12'));var logger=require('../../config/logger')(_0x2499('0x13'));var utils=require(_0x2499('0x14'));var config=require(_0x2499('0x15'));var licenseUtil=require(_0x2499('0x16'));var db=require(_0x2499('0x17'))['db'];function respondWithStatusCode(_0x409ef9,_0x4f2977){_0x4f2977=_0x4f2977||0xcc;return function(_0x5b3ff1){if(_0x5b3ff1){return _0x409ef9[_0x2499('0x18')](_0x4f2977);}return _0x409ef9[_0x2499('0x19')](_0x4f2977)[_0x2499('0x1a')]();};}function respondWithResult(_0x2ef250,_0x32f4f8){_0x32f4f8=_0x32f4f8||0xc8;return function(_0x26ff2c){if(_0x26ff2c){return _0x2ef250[_0x2499('0x19')](_0x32f4f8)[_0x2499('0x1b')](_0x26ff2c);}};}function respondWithFilteredResult(_0x5a4768,_0x3f31b9){return function(_0x45e36d){if(_0x45e36d){var _0x32c69a=typeof _0x3f31b9['offset']===_0x2499('0x1c')&&typeof _0x3f31b9['limit']==='undefined';var _0x11db51=_0x45e36d[_0x2499('0x1d')];var _0x44581b=_0x32c69a?0x0:_0x3f31b9[_0x2499('0x1e')];var _0x4f5b47=_0x32c69a?_0x45e36d[_0x2499('0x1d')]:_0x3f31b9[_0x2499('0x1e')]+_0x3f31b9['limit'];var _0x153365;if(_0x4f5b47>=_0x11db51){_0x4f5b47=_0x11db51;_0x153365=0xc8;}else{_0x153365=0xce;}_0x5a4768[_0x2499('0x19')](_0x153365);return _0x5a4768[_0x2499('0x1f')](_0x2499('0x20'),_0x44581b+'-'+_0x4f5b47+'/'+_0x11db51)['json'](_0x45e36d);}return null;};}function patchUpdates(_0x309015){return function(_0x26cb18){try{jsonpatch['apply'](_0x26cb18,_0x309015,!![]);}catch(_0x2f5010){return BPromise[_0x2499('0x21')](_0x2f5010);}return _0x26cb18['save']();};}function saveUpdates(_0x243720,_0x4f67a0){return function(_0x20c4a3){if(_0x20c4a3){return _0x20c4a3[_0x2499('0x22')](_0x243720)['then'](function(_0x28c4ea){return _0x28c4ea;});}return null;};}function removeEntity(_0x36a10b,_0x100044){return function(_0x3f59e8){if(_0x3f59e8){return _0x3f59e8[_0x2499('0x23')]()[_0x2499('0x24')](function(){_0x36a10b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x480e3b,_0x107427){return function(_0x33fe58){if(!_0x33fe58){_0x480e3b[_0x2499('0x18')](0x194);}return _0x33fe58;};}function handleError(_0x1e7902,_0x39e153){_0x39e153=_0x39e153||0x1f4;return function(_0x1395d9){logger[_0x2499('0x25')](_0x1395d9['stack']);if(_0x1395d9[_0x2499('0x26')]){delete _0x1395d9[_0x2499('0x26')];}_0x1e7902[_0x2499('0x19')](_0x39e153)[_0x2499('0x27')](_0x1395d9);};}exports[_0x2499('0x28')]=function(_0x540d08,_0x43bc37){var _0x17d161={},_0x2fe959={},_0x363063={'count':0x0,'rows':[]};var _0x159898=_[_0x2499('0x29')](db[_0x2499('0x2a')][_0x2499('0x2b')],function(_0x717755){return{'name':_0x717755['fieldName'],'type':_0x717755[_0x2499('0x2c')][_0x2499('0x2d')]};});_0x2fe959[_0x2499('0x2e')]=_[_0x2499('0x29')](_0x159898,_0x2499('0x26'));_0x2fe959[_0x2499('0x2f')]=_['keys'](_0x540d08[_0x2499('0x2f')]);_0x2fe959['filters']=_[_0x2499('0x30')](_0x2fe959[_0x2499('0x2e')],_0x2fe959[_0x2499('0x2f')]);_0x2fe959[_0x2499('0x31')]=_[_0x2499('0x32')](_0x2fe959[_0x2499('0x31')],[_0x2499('0x33'),_0x2499('0x34'),'$gt',_0x2499('0x35'),_0x2499('0x36'),'$lte',_0x2499('0x37'),_0x2499('0x38'),_0x2499('0x39'),'$between','$notBetween','$in',_0x2499('0x3a'),_0x2499('0x3b'),_0x2499('0x3c'),_0x2499('0x3d'),_0x2499('0x3e'),_0x2499('0x3b'),_0x2499('0x3f'),_0x2499('0x40'),_0x2499('0x41'),_0x2499('0x42')]);_0x17d161['attributes']=_[_0x2499('0x30')](_0x2fe959[_0x2499('0x2e')],qs[_0x2499('0x43')](_0x540d08[_0x2499('0x2f')][_0x2499('0x43')]));_0x17d161[_0x2499('0x44')]=_0x17d161['attributes'][_0x2499('0x45')]?_0x17d161[_0x2499('0x44')]:_0x2fe959[_0x2499('0x2e')];if(!_0x540d08['query'][_0x2499('0x46')](_0x2499('0x47'))){_0x17d161[_0x2499('0x48')]=qs[_0x2499('0x48')](_0x540d08[_0x2499('0x2f')][_0x2499('0x48')]);_0x17d161[_0x2499('0x1e')]=qs['offset'](_0x540d08[_0x2499('0x2f')]['offset']);}_0x17d161['order']=qs[_0x2499('0x49')](_0x540d08[_0x2499('0x2f')][_0x2499('0x49')]);_0x17d161[_0x2499('0x4a')]=qs[_0x2499('0x31')](_[_0x2499('0x4b')](_0x540d08[_0x2499('0x2f')],_0x2fe959['filters']),_0x159898);if(_0x540d08[_0x2499('0x2f')]['filter']){_0x17d161[_0x2499('0x4a')]=_[_0x2499('0x4c')](_0x17d161['where'],{'$or':_[_0x2499('0x29')](_0x159898,function(_0x3fe6c7){if(_0x3fe6c7[_0x2499('0x2c')]!==_0x2499('0x4d')){var _0x18d592={};_0x18d592[_0x3fe6c7[_0x2499('0x26')]]={'$like':'%'+_0x540d08['query'][_0x2499('0x4e')]+'%'};return _0x18d592;}})});}_0x17d161=_['merge']({},_0x17d161,_0x540d08[_0x2499('0x4f')]);var _0x1a76c8={'where':_0x17d161[_0x2499('0x4a')]};return db[_0x2499('0x2a')]['count'](_0x1a76c8)[_0x2499('0x24')](function(_0x27aa94){_0x363063['count']=_0x27aa94;if(_0x540d08[_0x2499('0x2f')]['includeAll']){_0x17d161[_0x2499('0x50')]=[{'all':!![]}];}return db[_0x2499('0x2a')]['findAll'](_0x17d161);})['then'](function(_0x264d9f){_0x363063[_0x2499('0x51')]=_0x264d9f;return _0x363063;})[_0x2499('0x24')](respondWithFilteredResult(_0x43bc37,_0x17d161))[_0x2499('0x52')](handleError(_0x43bc37,null));};exports[_0x2499('0x53')]=function(_0x7fea90,_0x34ff82){var _0x43b8cc={'raw':!![],'where':{'id':_0x7fea90[_0x2499('0x54')]['id']}},_0x481dd7={};_0x481dd7[_0x2499('0x2e')]=_[_0x2499('0x55')](db['CmHopper']['rawAttributes']);_0x481dd7[_0x2499('0x2f')]=_[_0x2499('0x55')](_0x7fea90[_0x2499('0x2f')]);_0x481dd7['filters']=_[_0x2499('0x30')](_0x481dd7[_0x2499('0x2e')],_0x481dd7[_0x2499('0x2f')]);_0x43b8cc[_0x2499('0x44')]=_[_0x2499('0x30')](_0x481dd7[_0x2499('0x2e')],qs['fields'](_0x7fea90[_0x2499('0x2f')][_0x2499('0x43')]));_0x43b8cc[_0x2499('0x44')]=_0x43b8cc[_0x2499('0x44')][_0x2499('0x45')]?_0x43b8cc[_0x2499('0x44')]:_0x481dd7[_0x2499('0x2e')];if(_0x7fea90[_0x2499('0x2f')][_0x2499('0x56')]){_0x43b8cc[_0x2499('0x50')]=[{'all':!![]}];}_0x43b8cc=_[_0x2499('0x4c')]({},_0x43b8cc,_0x7fea90['options']);return db['CmHopper']['find'](_0x43b8cc)['then'](handleEntityNotFound(_0x34ff82,null))[_0x2499('0x24')](respondWithResult(_0x34ff82,null))[_0x2499('0x52')](handleError(_0x34ff82,null));};exports[_0x2499('0x57')]=function(_0x15975b,_0x1ae690){return db['CmHopper']['create'](_0x15975b[_0x2499('0x58')],{})['then'](respondWithResult(_0x1ae690,0xc9))[_0x2499('0x52')](handleError(_0x1ae690,null));};exports[_0x2499('0x22')]=function(_0x3e55f4,_0xc76308){if(_0x3e55f4[_0x2499('0x58')]['id']){delete _0x3e55f4[_0x2499('0x58')]['id'];}return db[_0x2499('0x2a')][_0x2499('0x59')]({'where':{'id':_0x3e55f4[_0x2499('0x54')]['id']}})[_0x2499('0x24')](handleEntityNotFound(_0xc76308,null))[_0x2499('0x24')](saveUpdates(_0x3e55f4[_0x2499('0x58')],null))[_0x2499('0x24')](respondWithResult(_0xc76308,null))['catch'](handleError(_0xc76308,null));};exports[_0x2499('0x5a')]=function(_0x2d67cb,_0x2d68d9){return db[_0x2499('0x2a')][_0x2499('0x5a')]()['then'](respondWithResult(_0x2d68d9,null))[_0x2499('0x52')](handleError(_0x2d68d9,null));};exports['destroy']=function(_0x24ac68,_0x55fd46){var _0x1a66c4;return db[_0x2499('0x2a')]['find']({'where':{'id':_0x24ac68[_0x2499('0x54')]['id']}})['then'](handleEntityNotFound(_0x55fd46,null))[_0x2499('0x24')](function(_0x17e430){if(_0x17e430){return _0x17e430['destroy']()[_0x2499('0x24')](function(_0x773ba){return _0x773ba;});}})[_0x2499('0x24')](function(_0x506adf){_0x1a66c4=_0x506adf;if(_0x506adf){if(_0x506adf['VoiceQueueId']||_0x506adf[_0x2499('0x5b')]){return db[_0x506adf[_0x2499('0x5c')]?_0x2499('0x5d'):_0x2499('0x5e')][_0x2499('0x59')]({'where':{'id':_0x506adf['VoiceQueueId']?_0x506adf['VoiceQueueId']:_0x506adf[_0x2499('0x5b')]},'attributes':['id','name'],'raw':!![]});}}})[_0x2499('0x24')](function(_0x4512bb){var _0x2329d8={};if(_0x4512bb){_[_0x2499('0x4c')](_0x2329d8,_['omit'](_0x1a66c4[_0x2499('0x5f')],[_0x2499('0x60'),_0x2499('0x61'),'id']));_0x2329d8[_0x2499('0x62')]=0x15;_0x2329d8[_0x2499('0x63')]='deleted';_0x2329d8[_0x2499('0x64')]=_0x4512bb['name'];_0x2329d8[_0x2499('0x65')]=_0x24ac68['user'][_0x2499('0x26')];_0x2329d8[_0x2499('0x66')]=_0x24ac68['user']['id'];_0x2329d8[_0x2499('0x67')]=!![];_0x2329d8[_0x2499('0x68')]=moment()[_0x2499('0x69')](_0x2499('0x6a'));_0x2329d8['calleridnum']=_0x1a66c4[_0x2499('0x6b')];_0x2329d8[_0x2499('0x6c')]=_0x1a66c4['VoiceQueueId']?_0x2499('0x6d'):_0x2499('0x6e');return db['CmContact']['find']({'where':{'id':_0x2329d8[_0x2499('0x6f')]},'attributes':[_0x2499('0x70'),_0x2499('0x71')]})['then'](function(_0x29f6ac){if(!_[_0x2499('0x72')](_0x55fd46)&&!_[_0x2499('0x72')](_0x29f6ac[_0x2499('0x70')])){_0x2329d8[_0x2499('0x73')]=_0x29f6ac[_0x2499('0x70')];if(!_[_0x2499('0x72')](_0x29f6ac[_0x2499('0x71')])){_0x2329d8['calleridname']+='\x20'+_0x29f6ac[_0x2499('0x71')];}}})[_0x2499('0x74')](function(){return db[_0x2499('0x75')][_0x2499('0x57')](_0x2329d8);});}})[_0x2499('0x24')](function(){return _0x55fd46[_0x2499('0x19')](0xcc)[_0x2499('0x1a')]();})['catch'](handleError(_0x55fd46,null));};exports[_0x2499('0x76')]=function(_0xf14fe7,_0x2ac10b,_0x4e358e){var _0x52d89a=[];return db[_0x2499('0x77')][_0x2499('0x5a')]()['then'](function(_0x158877){_0x52d89a=_['keys'](_0x158877);return _0xf14fe7[_0x2499('0x78')]['getVoiceQueues']({'where':{'type':_0x2499('0x79'),'dialActive':!![],'dialMethod':_0x2499('0x7a')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x5856c8){if(_0x5856c8&&_0x5856c8[_0x2499('0x45')]){return db[_0x2499('0x7b')][_0x2499('0x7c')](function(_0x47910d){var _0x466cf6={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2499('0x69')](_0x2499('0x6a'))},'VoiceQueueId':{'$in':_[_0x2499('0x29')](_0x5856c8,'id')},'$or':[{'UserId':null},{'UserId':_0xf14fe7[_0x2499('0x78')]['id']}]};var _0x2f76b1=[];if(_0xf14fe7[_0x2499('0x58')][_0x2499('0x7d')]&&_0xf14fe7[_0x2499('0x58')][_0x2499('0x7d')]===_0x2499('0x7e')){if(!_[_0x2499('0x7f')](_0xf14fe7[_0x2499('0x58')][_0x2499('0x80')])){_0x466cf6['id']={'$in':_0xf14fe7[_0x2499('0x58')][_0x2499('0x80')]};}_0x2f76b1=[['priority',_0x2499('0x81')],['scheduledAt',_0x5856c8[0x0][_0x2499('0x82')]===_0x2499('0x81')?_0x2499('0x83'):_0x2499('0x81')],db['sequelize'][_0x2499('0x84')](_0x2499('0x85')),['id',_0x2499('0x83')]];}else{if(!_[_0x2499('0x7f')](_0xf14fe7[_0x2499('0x58')]['hopperIds'])){_0x466cf6['id']={'$notIn':_0xf14fe7[_0x2499('0x58')][_0x2499('0x80')]};}_0x2f76b1=[[_0x2499('0x86'),_0x2499('0x83')],['scheduledAt',_0x5856c8[0x0][_0x2499('0x82')]],db[_0x2499('0x7b')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x2499('0x81')]];}return db[_0x2499('0x2a')][_0x2499('0x87')]({'attributes':['id',_0x2499('0x88')],'where':_0x466cf6,'order':_0x2f76b1,'transaction':_0x47910d,'lock':_0x47910d['LOCK'][_0x2499('0x89')],'include':[{'model':db[_0x2499('0x77')],'as':_0x2499('0x8a'),'attributes':_0x52d89a,'include':[{'model':db[_0x2499('0x8b')],'as':_0x2499('0x8c'),'attributes':['id',_0x2499('0x26')]}]},{'model':db[_0x2499('0x8d')],'as':'List','attributes':['id',_0x2499('0x26')]},{'model':db[_0x2499('0x5d')],'as':_0x2499('0x8e'),'attributes':['id','name','dialActive']}]})[_0x2499('0x24')](function(_0x3b83ec){if(_0x3b83ec){return _0x3b83ec['update']({'UserId':_0xf14fe7[_0x2499('0x78')]['id']},{'transaction':_0x47910d});}});});}})[_0x2499('0x24')](handleEntityNotFound(_0x2ac10b,null))[_0x2499('0x24')](respondWithResult(_0x2ac10b,null))[_0x2499('0x52')](handleError(_0x2ac10b,null));};exports[_0x2499('0x8f')]=function(_0x200bd1,_0x32f8a7,_0x598771){return _0x200bd1[_0x2499('0x78')][_0x2499('0x90')]({'where':{'type':_0x2499('0x79'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x588699){if(_0x588699&&_0x588699['length']){return db[_0x2499('0x2a')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2499('0x69')](_0x2499('0x6a'))},'VoiceQueueId':{'$in':_['map'](_0x588699,'id')},'$or':[{'UserId':null},{'UserId':_0x200bd1['user']['id']}]}});}return 0x0;})[_0x2499('0x24')](function(_0x2f6c5d){if(!_[_0x2499('0x72')](_0x2f6c5d)&&_[_0x2499('0x91')](_0x2f6c5d)){return _0x32f8a7[_0x2499('0x19')](0xc8)[_0x2499('0x1b')]({'contacts':_0x2f6c5d});}else{logger[_0x2499('0x25')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x2499('0x92'));_0x32f8a7[_0x2499('0x18')](0x194);}})[_0x2499('0x52')](handleError(_0x32f8a7,null));}; \ No newline at end of file +var _0x90e0=['where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','include','create','body','find','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','updatedAt','state','deleted','membername','UserId','user','format','phone','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','outbound','dialOrderByScheduledAt','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','ASC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','../../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','Content-Range','reject','update','then','error','stack','name','send','index','CmHopper','rawAttributes','type','key','model','map','query','keys','filters','$and','$or','$gt','$ne','$eq','$between','$in','$iLike','$like','$overlap','attributes','intersection','fields','length','order','sort'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x90e0,0x1d8));var _0x090e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90e0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x090e('0x0'));var zipdir=require(_0x090e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x090e('0x2'));var Mustache=require('mustache');var util=require(_0x090e('0x3'));var path=require(_0x090e('0x4'));var sox=require(_0x090e('0x5'));var csv=require(_0x090e('0x6'));var ejs=require(_0x090e('0x7'));var fs=require('fs');var fs_extra=require(_0x090e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x090e('0x9'));var deskjs=require(_0x090e('0xa'));var toCsv=require(_0x090e('0x6'));var querystring=require(_0x090e('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x090e('0xc'));var qs=require(_0x090e('0xd'));var as=require(_0x090e('0xe'));var hardwareService=require(_0x090e('0xf'));var logger=require(_0x090e('0x10'))(_0x090e('0x11'));var utils=require(_0x090e('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x090e('0x13'));var db=require(_0x090e('0x14'))['db'];function respondWithStatusCode(_0x4f301e,_0x38e078){_0x38e078=_0x38e078||0xcc;return function(_0x4ef108){if(_0x4ef108){return _0x4f301e[_0x090e('0x15')](_0x38e078);}return _0x4f301e[_0x090e('0x16')](_0x38e078)[_0x090e('0x17')]();};}function respondWithResult(_0x5b3dcf,_0x1a5ec7){_0x1a5ec7=_0x1a5ec7||0xc8;return function(_0x12e326){if(_0x12e326){return _0x5b3dcf[_0x090e('0x16')](_0x1a5ec7)[_0x090e('0x18')](_0x12e326);}};}function respondWithFilteredResult(_0x56cad3,_0x3ca56d){return function(_0x2817a3){if(_0x2817a3){var _0x26a395=typeof _0x3ca56d[_0x090e('0x19')]===_0x090e('0x1a')&&typeof _0x3ca56d[_0x090e('0x1b')]==='undefined';var _0x869825=_0x2817a3[_0x090e('0x1c')];var _0x17cc10=_0x26a395?0x0:_0x3ca56d[_0x090e('0x19')];var _0x1a800c=_0x26a395?_0x2817a3[_0x090e('0x1c')]:_0x3ca56d[_0x090e('0x19')]+_0x3ca56d[_0x090e('0x1b')];var _0x435cb6;if(_0x1a800c>=_0x869825){_0x1a800c=_0x869825;_0x435cb6=0xc8;}else{_0x435cb6=0xce;}_0x56cad3['status'](_0x435cb6);return _0x56cad3[_0x090e('0x1d')](_0x090e('0x1e'),_0x17cc10+'-'+_0x1a800c+'/'+_0x869825)[_0x090e('0x18')](_0x2817a3);}return null;};}function patchUpdates(_0x5e3209){return function(_0x316f7d){try{jsonpatch['apply'](_0x316f7d,_0x5e3209,!![]);}catch(_0x143793){return BPromise[_0x090e('0x1f')](_0x143793);}return _0x316f7d['save']();};}function saveUpdates(_0x1d71a9,_0x15c9fc){return function(_0x19b80a){if(_0x19b80a){return _0x19b80a[_0x090e('0x20')](_0x1d71a9)['then'](function(_0x528f4f){return _0x528f4f;});}return null;};}function removeEntity(_0x50a041,_0x4212d1){return function(_0x242393){if(_0x242393){return _0x242393['destroy']()[_0x090e('0x21')](function(){_0x50a041['status'](0xcc)[_0x090e('0x17')]();});}};}function handleEntityNotFound(_0x39c0cd,_0x212e45){return function(_0xb9e65a){if(!_0xb9e65a){_0x39c0cd['sendStatus'](0x194);}return _0xb9e65a;};}function handleError(_0x5c2121,_0x228cb1){_0x228cb1=_0x228cb1||0x1f4;return function(_0x343a56){logger[_0x090e('0x22')](_0x343a56[_0x090e('0x23')]);if(_0x343a56[_0x090e('0x24')]){delete _0x343a56[_0x090e('0x24')];}_0x5c2121[_0x090e('0x16')](_0x228cb1)[_0x090e('0x25')](_0x343a56);};}exports[_0x090e('0x26')]=function(_0xe2596a,_0x3f19f2){var _0x5967dc={},_0x4fde16={},_0x36f8e3={'count':0x0,'rows':[]};var _0x25847=_['map'](db[_0x090e('0x27')][_0x090e('0x28')],function(_0x31c6c3){return{'name':_0x31c6c3['fieldName'],'type':_0x31c6c3[_0x090e('0x29')][_0x090e('0x2a')]};});_0x4fde16[_0x090e('0x2b')]=_[_0x090e('0x2c')](_0x25847,_0x090e('0x24'));_0x4fde16[_0x090e('0x2d')]=_[_0x090e('0x2e')](_0xe2596a[_0x090e('0x2d')]);_0x4fde16['filters']=_['intersection'](_0x4fde16[_0x090e('0x2b')],_0x4fde16[_0x090e('0x2d')]);_0x4fde16[_0x090e('0x2f')]=_['concat'](_0x4fde16[_0x090e('0x2f')],[_0x090e('0x30'),_0x090e('0x31'),_0x090e('0x32'),'$gte','$lt','$lte',_0x090e('0x33'),_0x090e('0x34'),'$not',_0x090e('0x35'),'$notBetween',_0x090e('0x36'),'$notIn','$like','$notLike',_0x090e('0x37'),'$notILike',_0x090e('0x38'),_0x090e('0x39'),'$contains','$contained','$any']);_0x5967dc[_0x090e('0x3a')]=_[_0x090e('0x3b')](_0x4fde16['model'],qs[_0x090e('0x3c')](_0xe2596a[_0x090e('0x2d')]['fields']));_0x5967dc['attributes']=_0x5967dc['attributes'][_0x090e('0x3d')]?_0x5967dc[_0x090e('0x3a')]:_0x4fde16[_0x090e('0x2b')];if(!_0xe2596a['query']['hasOwnProperty']('nolimit')){_0x5967dc[_0x090e('0x1b')]=qs[_0x090e('0x1b')](_0xe2596a[_0x090e('0x2d')][_0x090e('0x1b')]);_0x5967dc[_0x090e('0x19')]=qs[_0x090e('0x19')](_0xe2596a[_0x090e('0x2d')]['offset']);}_0x5967dc[_0x090e('0x3e')]=qs[_0x090e('0x3f')](_0xe2596a[_0x090e('0x2d')]['sort']);_0x5967dc[_0x090e('0x40')]=qs['filters'](_[_0x090e('0x41')](_0xe2596a[_0x090e('0x2d')],_0x4fde16[_0x090e('0x2f')]),_0x25847);if(_0xe2596a[_0x090e('0x2d')]['filter']){_0x5967dc['where']=_[_0x090e('0x42')](_0x5967dc[_0x090e('0x40')],{'$or':_[_0x090e('0x2c')](_0x25847,function(_0x4db4dd){if(_0x4db4dd[_0x090e('0x29')]!=='VIRTUAL'){var _0x4fac65={};_0x4fac65[_0x4db4dd[_0x090e('0x24')]]={'$like':'%'+_0xe2596a['query'][_0x090e('0x43')]+'%'};return _0x4fac65;}})});}_0x5967dc=_['merge']({},_0x5967dc,_0xe2596a[_0x090e('0x44')]);var _0x1a844c={'where':_0x5967dc[_0x090e('0x40')]};return db['CmHopper'][_0x090e('0x1c')](_0x1a844c)[_0x090e('0x21')](function(_0x473dd9){_0x36f8e3[_0x090e('0x1c')]=_0x473dd9;if(_0xe2596a[_0x090e('0x2d')][_0x090e('0x45')]){_0x5967dc['include']=[{'all':!![]}];}return db['CmHopper'][_0x090e('0x46')](_0x5967dc);})[_0x090e('0x21')](function(_0x29f472){_0x36f8e3[_0x090e('0x47')]=_0x29f472;return _0x36f8e3;})[_0x090e('0x21')](respondWithFilteredResult(_0x3f19f2,_0x5967dc))[_0x090e('0x48')](handleError(_0x3f19f2,null));};exports[_0x090e('0x49')]=function(_0x1e8822,_0x2aee0f){var _0xb1306a={'raw':!![],'where':{'id':_0x1e8822['params']['id']}},_0x567d8f={};_0x567d8f[_0x090e('0x2b')]=_['keys'](db['CmHopper'][_0x090e('0x28')]);_0x567d8f[_0x090e('0x2d')]=_[_0x090e('0x2e')](_0x1e8822[_0x090e('0x2d')]);_0x567d8f[_0x090e('0x2f')]=_[_0x090e('0x3b')](_0x567d8f[_0x090e('0x2b')],_0x567d8f[_0x090e('0x2d')]);_0xb1306a[_0x090e('0x3a')]=_[_0x090e('0x3b')](_0x567d8f['model'],qs[_0x090e('0x3c')](_0x1e8822[_0x090e('0x2d')][_0x090e('0x3c')]));_0xb1306a[_0x090e('0x3a')]=_0xb1306a[_0x090e('0x3a')][_0x090e('0x3d')]?_0xb1306a[_0x090e('0x3a')]:_0x567d8f[_0x090e('0x2b')];if(_0x1e8822[_0x090e('0x2d')][_0x090e('0x45')]){_0xb1306a[_0x090e('0x4a')]=[{'all':!![]}];}_0xb1306a=_[_0x090e('0x42')]({},_0xb1306a,_0x1e8822[_0x090e('0x44')]);return db[_0x090e('0x27')]['find'](_0xb1306a)[_0x090e('0x21')](handleEntityNotFound(_0x2aee0f,null))['then'](respondWithResult(_0x2aee0f,null))[_0x090e('0x48')](handleError(_0x2aee0f,null));};exports[_0x090e('0x4b')]=function(_0x163283,_0x1b770b){return db['CmHopper'][_0x090e('0x4b')](_0x163283[_0x090e('0x4c')],{})[_0x090e('0x21')](respondWithResult(_0x1b770b,0xc9))[_0x090e('0x48')](handleError(_0x1b770b,null));};exports[_0x090e('0x20')]=function(_0x1da3ca,_0xb65955){if(_0x1da3ca[_0x090e('0x4c')]['id']){delete _0x1da3ca[_0x090e('0x4c')]['id'];}return db['CmHopper'][_0x090e('0x4d')]({'where':{'id':_0x1da3ca[_0x090e('0x4e')]['id']}})[_0x090e('0x21')](handleEntityNotFound(_0xb65955,null))['then'](saveUpdates(_0x1da3ca[_0x090e('0x4c')],null))[_0x090e('0x21')](respondWithResult(_0xb65955,null))[_0x090e('0x48')](handleError(_0xb65955,null));};exports[_0x090e('0x4f')]=function(_0x9f1feb,_0x4427a7){return db['CmHopper'][_0x090e('0x4f')]()[_0x090e('0x21')](respondWithResult(_0x4427a7,null))[_0x090e('0x48')](handleError(_0x4427a7,null));};exports[_0x090e('0x50')]=function(_0x161d69,_0x52f0eb){var _0x53c02e;return db[_0x090e('0x27')][_0x090e('0x4d')]({'where':{'id':_0x161d69[_0x090e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x52f0eb,null))[_0x090e('0x21')](function(_0x596982){if(_0x596982){return _0x596982[_0x090e('0x50')]()['then'](function(_0x13c809){return _0x13c809;});}})['then'](function(_0x25f8a3){_0x53c02e=_0x25f8a3;if(_0x25f8a3){if(_0x25f8a3[_0x090e('0x51')]||_0x25f8a3[_0x090e('0x52')]){return db[_0x25f8a3[_0x090e('0x51')]?_0x090e('0x53'):_0x090e('0x54')]['find']({'where':{'id':_0x25f8a3[_0x090e('0x51')]?_0x25f8a3[_0x090e('0x51')]:_0x25f8a3[_0x090e('0x52')]},'attributes':['id',_0x090e('0x24')],'raw':!![]});}}})[_0x090e('0x21')](function(_0x346759){var _0x5eb5da={};if(_0x346759){_[_0x090e('0x42')](_0x5eb5da,_[_0x090e('0x55')](_0x53c02e['dataValues'],['createdAt',_0x090e('0x56'),'id']));_0x5eb5da[_0x090e('0x57')]=0x15;_0x5eb5da['statedesc']=_0x090e('0x58');_0x5eb5da['campaign']=_0x346759[_0x090e('0x24')];_0x5eb5da[_0x090e('0x59')]=_0x161d69['user'][_0x090e('0x24')];_0x5eb5da[_0x090e('0x5a')]=_0x161d69[_0x090e('0x5b')]['id'];_0x5eb5da[_0x090e('0x58')]=!![];_0x5eb5da['deletedat']=moment()[_0x090e('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5eb5da['calleridnum']=_0x53c02e[_0x090e('0x5d')];_0x5eb5da['campaigntype']=_0x53c02e[_0x090e('0x51')]?'queue':_0x090e('0x5e');return db[_0x090e('0x5f')][_0x090e('0x4d')]({'where':{'id':_0x5eb5da[_0x090e('0x60')]},'attributes':[_0x090e('0x61'),_0x090e('0x62')]})[_0x090e('0x21')](function(_0x1e914a){if(!_[_0x090e('0x63')](_0x52f0eb)&&!_[_0x090e('0x63')](_0x1e914a[_0x090e('0x61')])){_0x5eb5da['calleridname']=_0x1e914a['firstName'];if(!_[_0x090e('0x63')](_0x1e914a[_0x090e('0x62')])){_0x5eb5da[_0x090e('0x64')]+='\x20'+_0x1e914a['lastName'];}}})[_0x090e('0x65')](function(){return db[_0x090e('0x66')][_0x090e('0x4b')](_0x5eb5da);});}})[_0x090e('0x21')](function(){return _0x52f0eb[_0x090e('0x16')](0xcc)[_0x090e('0x17')]();})[_0x090e('0x48')](handleError(_0x52f0eb,null));};exports[_0x090e('0x67')]=function(_0x16f47b,_0x42809e,_0x1e83cf){var _0x24b711=[];return db['CmContact'][_0x090e('0x4f')]()['then'](function(_0x2f847c){_0x24b711=_[_0x090e('0x2e')](_0x2f847c);return _0x16f47b[_0x090e('0x5b')]['getVoiceQueues']({'where':{'type':_0x090e('0x68'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x090e('0x69')],'raw':!![]});})[_0x090e('0x21')](function(_0x181216){if(_0x181216&&_0x181216['length']){return db['sequelize'][_0x090e('0x6a')](function(_0x5c0fbc){var _0x1c4e85={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x090e('0x5c')](_0x090e('0x6b'))},'VoiceQueueId':{'$in':_[_0x090e('0x2c')](_0x181216,'id')},'$or':[{'UserId':null},{'UserId':_0x16f47b['user']['id']}]};var _0x300c28=[];if(_0x16f47b[_0x090e('0x4c')][_0x090e('0x6c')]&&_0x16f47b[_0x090e('0x4c')][_0x090e('0x6c')]===_0x090e('0x6d')){if(!_[_0x090e('0x6e')](_0x16f47b[_0x090e('0x4c')][_0x090e('0x6f')])){_0x1c4e85['id']={'$in':_0x16f47b[_0x090e('0x4c')][_0x090e('0x6f')]};}_0x300c28=[['priority','ASC'],[_0x090e('0x70'),_0x181216[0x0][_0x090e('0x69')]==='ASC'?_0x090e('0x71'):'ASC'],db[_0x090e('0x72')][_0x090e('0x73')](_0x090e('0x74')),['id',_0x090e('0x71')]];}else{if(!_[_0x090e('0x6e')](_0x16f47b[_0x090e('0x4c')][_0x090e('0x6f')])){_0x1c4e85['id']={'$notIn':_0x16f47b[_0x090e('0x4c')][_0x090e('0x6f')]};}_0x300c28=[[_0x090e('0x75'),_0x090e('0x71')],[_0x090e('0x70'),_0x181216[0x0][_0x090e('0x69')]],db[_0x090e('0x72')][_0x090e('0x73')](_0x090e('0x76')),['id',_0x090e('0x77')]];}return db[_0x090e('0x27')][_0x090e('0x78')]({'attributes':['id','scheduledat'],'where':_0x1c4e85,'order':_0x300c28,'transaction':_0x5c0fbc,'lock':_0x5c0fbc[_0x090e('0x79')][_0x090e('0x7a')],'include':[{'model':db[_0x090e('0x5f')],'as':_0x090e('0x7b'),'attributes':_0x24b711,'include':[{'model':db[_0x090e('0x7c')],'as':_0x090e('0x7d'),'attributes':['id',_0x090e('0x24')]}]},{'model':db['CmList'],'as':_0x090e('0x7e'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x090e('0x7f'),'attributes':['id',_0x090e('0x24'),_0x090e('0x80')]}]})[_0x090e('0x21')](function(_0x1da4a6){if(_0x1da4a6){return _0x1da4a6['update']({'UserId':_0x16f47b[_0x090e('0x5b')]['id']},{'transaction':_0x5c0fbc});}});});}})['then'](handleEntityNotFound(_0x42809e,null))[_0x090e('0x21')](respondWithResult(_0x42809e,null))['catch'](handleError(_0x42809e,null));};exports[_0x090e('0x81')]=function(_0x605476,_0x2349f5,_0x359d71){return _0x605476[_0x090e('0x5b')]['getVoiceQueues']({'where':{'type':_0x090e('0x68'),'dialActive':!![],'dialMethod':_0x090e('0x82')},'attributes':['id'],'raw':!![]})['then'](function(_0x11e376){if(_0x11e376&&_0x11e376['length']){return db[_0x090e('0x27')][_0x090e('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x090e('0x5c')](_0x090e('0x6b'))},'VoiceQueueId':{'$in':_[_0x090e('0x2c')](_0x11e376,'id')},'$or':[{'UserId':null},{'UserId':_0x605476[_0x090e('0x5b')]['id']}]}});}return 0x0;})[_0x090e('0x21')](function(_0x4a1e4a){if(!_['isNil'](_0x4a1e4a)&&_[_0x090e('0x83')](_0x4a1e4a)){return _0x2349f5[_0x090e('0x16')](0xc8)[_0x090e('0x18')]({'contacts':_0x4a1e4a});}else{logger[_0x090e('0x22')](_0x090e('0x84'),_0x090e('0x81'),0x194,_0x090e('0x85'));_0x2349f5[_0x090e('0x15')](0x194);}})[_0x090e('0x48')](handleError(_0x2349f5,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 7a48f56..dd08c75 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 _0xfdbd=['path','rimraf','./cmHopper.attributes','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x394894,_0x3f4a95){var _0x407a0a=function(_0x3be898){while(--_0x3be898){_0x394894['push'](_0x394894['shift']());}};_0x407a0a(++_0x3f4a95);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xa76664,_0x5e32db){_0xa76664=_0xa76664-0x0;var _0x3f7743=_0xfdbd[_0xa76664];return _0x3f7743;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'phone','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdbd=['path','rimraf','./cmHopper.attributes','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x260530,_0x50dbcd){var _0x3c5413=function(_0x1d1941){while(--_0x1d1941){_0x260530['push'](_0x260530['shift']());}};_0x3c5413(++_0x50dbcd);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x872f6f,_0x5efe7b){_0x872f6f=_0x872f6f-0x0;var _0x59a5f4=_0xfdbd[_0x872f6f];return _0x59a5f4;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'phone','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 10f81f8..036b663 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 _0xb691=['catch','ShowCmHopper','raw','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','UPDATE','Contact','keys','voicePause','push','includes','transaction','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','LOCK','length','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','CmHopper,\x20%s,\x20%s','message','request\x20sent','result','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model'];(function(_0x578fd4,_0x1302c7){var _0x5744fc=function(_0x36bd33){while(--_0x36bd33){_0x578fd4['push'](_0x578fd4['shift']());}};_0x5744fc(++_0x1302c7);}(_0xb691,0x13e));var _0x1b69=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0xb691[_0x4b4638];return _0x59e92b;};'use strict';var _=require(_0x1b69('0x0'));var util=require(_0x1b69('0x1'));var moment=require(_0x1b69('0x2'));var BPromise=require(_0x1b69('0x3'));var rs=require(_0x1b69('0x4'));var fs=require('fs');var Redis=require(_0x1b69('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b69('0x6'))(_0x1b69('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b69('0x8'));var client=jayson[_0x1b69('0x9')][_0x1b69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xab5f66,_0xc66a1a,_0x3a52d0){return new BPromise(function(_0x44f78e,_0x5393b1){return client[_0x1b69('0xb')](_0xab5f66,_0x3a52d0)[_0x1b69('0xc')](function(_0xedb5b6){logger[_0x1b69('0xd')]('CmHopper,\x20%s,\x20%s',_0xc66a1a,'request\x20sent');logger[_0x1b69('0xe')](_0x1b69('0xf'),_0xc66a1a,'request\x20sent',JSON[_0x1b69('0x10')](_0xedb5b6));if(_0xedb5b6[_0x1b69('0x11')]){if(_0xedb5b6[_0x1b69('0x11')]['code']===0x1f4){logger[_0x1b69('0x11')](_0x1b69('0x12'),_0xc66a1a,_0xedb5b6['error']['message']);return _0x5393b1(_0xedb5b6[_0x1b69('0x11')]['message']);}logger[_0x1b69('0x11')](_0x1b69('0x12'),_0xc66a1a,_0xedb5b6[_0x1b69('0x11')][_0x1b69('0x13')]);return _0x44f78e(_0xedb5b6[_0x1b69('0x11')][_0x1b69('0x13')]);}else{logger['info'](_0x1b69('0x12'),_0xc66a1a,_0x1b69('0x14'));_0x44f78e(_0xedb5b6[_0x1b69('0x15')][_0x1b69('0x13')]);}})['catch'](function(_0x13aeb7){logger[_0x1b69('0x11')](_0x1b69('0x12'),_0xc66a1a,_0x13aeb7);_0x5393b1(_0x13aeb7);});});}exports[_0x1b69('0x16')]=function(_0x13994d){var _0x594667=this;return new Promise(function(_0x48c572,_0x139a67){return db[_0x1b69('0x17')][_0x1b69('0x18')]({'raw':_0x13994d['options']?_0x13994d[_0x1b69('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x13994d[_0x1b69('0x19')]?_0x13994d[_0x1b69('0x19')][_0x1b69('0x1a')]||null:null,'attributes':_0x13994d[_0x1b69('0x19')]?_0x13994d[_0x1b69('0x19')][_0x1b69('0x1b')]||null:null,'limit':_0x13994d[_0x1b69('0x19')]?_0x13994d[_0x1b69('0x19')][_0x1b69('0x1c')]||null:null,'include':_0x13994d[_0x1b69('0x19')]?_0x13994d['options'][_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x13994d[_0x1b69('0x19')]['include'],function(_0x108ad2){return{'model':db[_0x108ad2[_0x1b69('0x1f')]],'as':_0x108ad2['as'],'attributes':_0x108ad2[_0x1b69('0x1b')],'include':_0x108ad2[_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x108ad2[_0x1b69('0x1d')],function(_0x113c5f){return{'model':db[_0x113c5f[_0x1b69('0x1f')]],'as':_0x113c5f['as'],'attributes':_0x113c5f[_0x1b69('0x1b')],'include':_0x113c5f['include']?_[_0x1b69('0x1e')](_0x113c5f[_0x1b69('0x1d')],function(_0x1cc552){return{'model':db[_0x1cc552[_0x1b69('0x1f')]],'as':_0x1cc552['as'],'attributes':_0x1cc552[_0x1b69('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1b69('0xc')](function(_0x476640){logger['info'](_0x1b69('0x16'),_0x13994d);logger[_0x1b69('0xe')](_0x1b69('0x16'),_0x13994d,JSON['stringify'](_0x476640));_0x48c572(_0x476640);})[_0x1b69('0x20')](function(_0x40943a){logger['error'](_0x1b69('0x16'),_0x40943a['message'],_0x13994d);_0x139a67(_0x594667[_0x1b69('0x11')](0x1f4,_0x40943a[_0x1b69('0x13')]));});});};exports[_0x1b69('0x21')]=function(_0x47d6c9){var _0x517be5=this;return new Promise(function(_0x1d8876,_0x73b1d3){return db['CmHopper']['find']({'raw':_0x47d6c9['options']?_0x47d6c9[_0x1b69('0x19')][_0x1b69('0x22')]===undefined?!![]:![]:!![],'where':_0x47d6c9[_0x1b69('0x19')]?_0x47d6c9[_0x1b69('0x19')]['where']||null:null,'attributes':_0x47d6c9['options']?_0x47d6c9['options'][_0x1b69('0x1b')]||null:null,'include':_0x47d6c9[_0x1b69('0x19')]?_0x47d6c9[_0x1b69('0x19')]['include']?_[_0x1b69('0x1e')](_0x47d6c9[_0x1b69('0x19')][_0x1b69('0x1d')],function(_0x54835b){return{'model':db[_0x54835b['model']],'as':_0x54835b['as'],'attributes':_0x54835b[_0x1b69('0x1b')],'include':_0x54835b[_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x54835b[_0x1b69('0x1d')],function(_0xa5835f){return{'model':db[_0xa5835f[_0x1b69('0x1f')]],'as':_0xa5835f['as'],'attributes':_0xa5835f[_0x1b69('0x1b')],'include':_0xa5835f[_0x1b69('0x1d')]?_['map'](_0xa5835f[_0x1b69('0x1d')],function(_0xef085b){return{'model':db[_0xef085b[_0x1b69('0x1f')]],'as':_0xef085b['as'],'attributes':_0xef085b['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b69('0xc')](function(_0x241262){logger['info'](_0x1b69('0x21'),_0x47d6c9);logger[_0x1b69('0xe')]('ShowCmHopper',_0x47d6c9,JSON[_0x1b69('0x10')](_0x241262));_0x1d8876(_0x241262);})[_0x1b69('0x20')](function(_0x52ad34){logger['error'](_0x1b69('0x21'),_0x52ad34[_0x1b69('0x13')],_0x47d6c9);_0x73b1d3(_0x517be5['error'](0x1f4,_0x52ad34[_0x1b69('0x13')]));});});};exports['CreateCmHopper']=function(_0x33b748){var _0x996f0f=this;return new Promise(function(_0x3fb818,_0x370213){return db['CmHopper'][_0x1b69('0x23')](_0x33b748[_0x1b69('0x24')],{'raw':_0x33b748['options']?_0x33b748[_0x1b69('0x19')][_0x1b69('0x22')]===undefined?!![]:![]:!![]})[_0x1b69('0xc')](function(_0x1062cc){logger[_0x1b69('0xd')](_0x1b69('0x25'),_0x33b748);logger[_0x1b69('0xe')](_0x1b69('0x25'),_0x33b748,JSON[_0x1b69('0x10')](_0x1062cc));_0x3fb818(_0x1062cc);})[_0x1b69('0x20')](function(_0x5a1edc){logger['error'](_0x1b69('0x25'),_0x5a1edc[_0x1b69('0x13')],_0x33b748);_0x370213(_0x996f0f['error'](0x1f4,_0x5a1edc[_0x1b69('0x13')]));});});};exports[_0x1b69('0x26')]=function(_0x4947cf){var _0xe2edf2=this;return new Promise(function(_0x539184,_0x43dd42){return db['CmHopper'][_0x1b69('0x27')](_0x4947cf[_0x1b69('0x24')],{'raw':_0x4947cf[_0x1b69('0x19')]?_0x4947cf[_0x1b69('0x19')][_0x1b69('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4947cf[_0x1b69('0x19')]?_0x4947cf[_0x1b69('0x19')]['where']||null:null,'attributes':_0x4947cf[_0x1b69('0x19')]?_0x4947cf['options']['attributes']||null:null,'limit':_0x4947cf[_0x1b69('0x19')]?_0x4947cf['options'][_0x1b69('0x1c')]||null:null})[_0x1b69('0xc')](function(_0x9b25f9){logger[_0x1b69('0xd')](_0x1b69('0x26'),_0x4947cf);logger[_0x1b69('0xe')]('UpdateCmHopper',_0x4947cf,JSON[_0x1b69('0x10')](_0x9b25f9));_0x539184(_0x9b25f9);})[_0x1b69('0x20')](function(_0x336732){logger[_0x1b69('0x11')](_0x1b69('0x26'),_0x336732[_0x1b69('0x13')],_0x4947cf);_0x43dd42(_0xe2edf2[_0x1b69('0x11')](0x1f4,_0x336732['message']));});});};exports[_0x1b69('0x28')]=function(_0x1a0d13){var _0x127a96=this;return new Promise(function(_0x10fcc4,_0x27d554){return db[_0x1b69('0x17')][_0x1b69('0x29')]({'where':_0x1a0d13[_0x1b69('0x19')]?_0x1a0d13[_0x1b69('0x19')][_0x1b69('0x1a')]||null:null})[_0x1b69('0xc')](function(_0x2146f4){logger[_0x1b69('0xd')]('DestroyCmHopper',_0x1a0d13);logger[_0x1b69('0xe')](_0x1b69('0x28'),_0x1a0d13,JSON['stringify'](_0x2146f4));_0x10fcc4(_0x2146f4);})[_0x1b69('0x20')](function(_0xe9e639){logger[_0x1b69('0x11')](_0x1b69('0x28'),_0xe9e639[_0x1b69('0x13')],_0x1a0d13);_0x27d554(_0x127a96['error'](0x1f4,_0xe9e639[_0x1b69('0x13')]));});});};exports[_0x1b69('0x2a')]=function(_0x38ddf1){var _0x3131c6=this;return new Promise(function(_0x59bd04,_0xfa1f60){return db[_0x1b69('0x2b')][_0x1b69('0x2c')]()[_0x1b69('0xc')](function(_0xfa5f58){return db[_0x1b69('0x2d')]['transaction'](function(_0x5ea383){return db[_0x1b69('0x17')]['findAll']({'where':_0x38ddf1[_0x1b69('0x19')]?_0x38ddf1['options'][_0x1b69('0x1a')]||null:null,'attributes':_0x38ddf1[_0x1b69('0x19')]?_0x38ddf1['options']['attributes']||null:null,'limit':_0x38ddf1[_0x1b69('0x19')]?_0x38ddf1[_0x1b69('0x19')]['limit']||null:null,'order':_0x38ddf1[_0x1b69('0x19')]?_0x38ddf1[_0x1b69('0x19')][_0x1b69('0x2e')]||null:null,'transaction':_0x5ea383,'lock':_0x5ea383['LOCK'][_0x1b69('0x2f')],'include':[{'model':db[_0x1b69('0x2b')],'as':_0x1b69('0x30'),'attributes':_[_0x1b69('0x31')](_0xfa5f58)},{'model':db['User'],'as':'Agent','attributes':['id','name',_0x1b69('0x32')]}]})['then'](function(_0x131eed){var _0x22d313=[];var _0x3bc109=[];for(var _0xba9be9=0x0;_0xba9be9<_0x131eed['length'];_0xba9be9+=0x1){var _0xef90e2=_0x131eed[_0xba9be9]['UserId'];if(_0xef90e2===null){_0x22d313[_0x1b69('0x33')](_0x131eed[_0xba9be9][_0x1b69('0x27')](_0x38ddf1['body'],{'transaction':_0x5ea383}));}else if(!_0x3bc109[_0x1b69('0x34')](_0xef90e2)){_0x3bc109[_0x1b69('0x33')](_0xef90e2);_0x22d313[_0x1b69('0x33')](_0x131eed[_0xba9be9][_0x1b69('0x27')](_0x38ddf1['body'],{'transaction':_0x5ea383}));}}return BPromise['all'](_0x22d313);});})['then'](function(_0x1dfcf9){logger[_0x1b69('0xd')](_0x1b69('0x2a'),_0x38ddf1);logger[_0x1b69('0xe')](_0x1b69('0x2a'),_0x38ddf1,JSON[_0x1b69('0x10')](_0x1dfcf9));_0x59bd04(_0x1dfcf9);})[_0x1b69('0x20')](function(_0x598f4e){logger[_0x1b69('0x11')](_0x1b69('0x2a'),_0x598f4e[_0x1b69('0x13')],_0x38ddf1);_0xfa1f60(_0x3131c6['error'](0x1f4,_0x598f4e[_0x1b69('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x31e55a){var _0x586bea=this;return new Promise(function(_0x53f21e,_0x187989){return db['sequelize'][_0x1b69('0x35')](function(_0xcc8e3c){return db[_0x1b69('0x36')][_0x1b69('0x23')](_0x31e55a[_0x1b69('0x24')],{'raw':_0x31e55a['options']?_0x31e55a[_0x1b69('0x19')][_0x1b69('0x22')]===undefined?!![]:![]:!![],'transaction':_0xcc8e3c})[_0x1b69('0xc')](function(){return db[_0x1b69('0x17')][_0x1b69('0x29')]({'where':_0x31e55a[_0x1b69('0x19')]?_0x31e55a[_0x1b69('0x19')]['where']||null:null,'transaction':_0xcc8e3c});});})[_0x1b69('0xc')](function(_0x54a45d){logger['info'](_0x1b69('0x37'),_0x31e55a);logger[_0x1b69('0xe')](_0x1b69('0x37'),_0x31e55a,JSON['stringify'](_0x54a45d));_0x53f21e(_0x54a45d);})[_0x1b69('0x20')](function(_0x1b2fea){logger[_0x1b69('0x11')]('MoveContactManagedDialer',_0x1b2fea[_0x1b69('0x13')],_0x31e55a);_0x187989(_0x586bea[_0x1b69('0x11')](0x1f4,_0x1b2fea[_0x1b69('0x13')]));});});};exports[_0x1b69('0x38')]=function(_0x34414b){var _0x18cd0e=this;return new Promise(function(_0x68fb7f,_0x2d9208){return db[_0x1b69('0x17')][_0x1b69('0x18')]({'raw':_0x34414b[_0x1b69('0x19')]?_0x34414b['options'][_0x1b69('0x22')]===undefined?!![]:![]:!![],'where':_0x34414b[_0x1b69('0x19')]?_0x34414b[_0x1b69('0x19')][_0x1b69('0x1a')]||null:null,'attributes':[[db[_0x1b69('0x2d')]['fn'](_0x1b69('0x39'),db[_0x1b69('0x2d')]['fn']('IF',db[_0x1b69('0x2d')][_0x1b69('0x3a')](_0x1b69('0x3b')+util[_0x1b69('0x3c')](_0x1b69('0x3d'),moment()['format'](_0x1b69('0x3e')))+_0x1b69('0x3f')))),_0x1b69('0x40')]]})[_0x1b69('0xc')](function(_0xc55cc1){logger[_0x1b69('0xd')](_0x1b69('0x38'),_0x34414b);logger['debug']('CountReScheduled',_0x34414b,JSON[_0x1b69('0x10')](_0xc55cc1));_0x68fb7f(_0xc55cc1);})[_0x1b69('0x20')](function(_0x3d1b38){logger['error']('CountReScheduled',_0x3d1b38[_0x1b69('0x13')],_0x34414b);_0x2d9208(_0x18cd0e[_0x1b69('0x11')](0x1f4,_0x3d1b38[_0x1b69('0x13')]));});});};exports[_0x1b69('0x41')]=function(_0x24f672){var _0x91e05e=this;return new Promise(function(_0x430e35,_0x4057dc){return db[_0x1b69('0x2b')][_0x1b69('0x2c')]()['then'](function(_0x55a62a){return db[_0x1b69('0x2d')][_0x1b69('0x35')](function(_0x38658a){return db['CmHopper'][_0x1b69('0x18')]({'where':_0x24f672[_0x1b69('0x19')]?_0x24f672[_0x1b69('0x19')][_0x1b69('0x1a')]||null:null,'attributes':_0x24f672[_0x1b69('0x19')]?_0x24f672[_0x1b69('0x19')][_0x1b69('0x1b')]||null:null,'limit':0x1,'order':_0x24f672['options']?_0x24f672[_0x1b69('0x19')][_0x1b69('0x2e')]||null:null,'group':db[_0x1b69('0x17')][_0x1b69('0x42')],'transaction':_0x38658a,'lock':_0x38658a[_0x1b69('0x43')][_0x1b69('0x2f')],'include':_0x24f672[_0x1b69('0x19')]?_0x24f672['options'][_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x24f672[_0x1b69('0x19')][_0x1b69('0x1d')],function(_0x39d4de){return{'model':db[_0x39d4de[_0x1b69('0x1f')]],'as':_0x39d4de['as'],'attributes':_0x39d4de['attributes'],'include':_0x39d4de['include']?_[_0x1b69('0x1e')](_0x39d4de['include'],function(_0xca7628){return{'model':db[_0xca7628[_0x1b69('0x1f')]],'as':_0xca7628['as'],'attributes':_0xca7628[_0x1b69('0x1b')],'include':_0xca7628[_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0xca7628[_0x1b69('0x1d')],function(_0x2279ba){return{'model':db[_0x2279ba['model']],'as':_0x2279ba['as'],'attributes':_0x2279ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b69('0xc')](function(_0x279b3b){var _0x1b68e6=[];for(var _0x21d449=0x0;_0x21d449<_0x279b3b[_0x1b69('0x44')];_0x21d449+=0x1){_0x1b68e6[_0x1b69('0x33')](_0x279b3b[_0x21d449][_0x1b69('0x27')](_0x24f672[_0x1b69('0x24')],{'transaction':_0x38658a}));}return BPromise['all'](_0x1b68e6);});})['then'](function(_0x343b69){logger['info'](_0x1b69('0x41'),_0x24f672);logger[_0x1b69('0xe')](_0x1b69('0x41'),_0x24f672,JSON['stringify'](_0x343b69));_0x430e35(_0x343b69);})[_0x1b69('0x20')](function(_0x39a12b){logger[_0x1b69('0x11')]('GetContactRecallMe',_0x39a12b[_0x1b69('0x13')],_0x24f672);_0x4057dc(_0x91e05e[_0x1b69('0x11')](0x1f4,_0x39a12b[_0x1b69('0x13')]));});});});};exports[_0x1b69('0x45')]=function(_0x353cf5){var _0x2e75bb=this;return new Promise(function(_0x586f6b,_0x1d4c30){db['CmContact'][_0x1b69('0x2c')]()[_0x1b69('0xc')](function(_0x4cc7a5){return db['CmHopper']['findAll']({'raw':_0x353cf5[_0x1b69('0x19')]?_0x353cf5['options'][_0x1b69('0x22')]===undefined?!![]:![]:!![],'where':_0x353cf5[_0x1b69('0x19')]?_0x353cf5[_0x1b69('0x19')]['where']||null:null,'attributes':_0x353cf5[_0x1b69('0x19')]?_0x353cf5[_0x1b69('0x19')]['attributes']||null:null,'limit':_0x353cf5[_0x1b69('0x19')]?_0x353cf5[_0x1b69('0x19')][_0x1b69('0x1c')]||null:null,'include':_0x353cf5['options']?_0x353cf5['options'][_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x353cf5[_0x1b69('0x19')]['include'],function(_0x42531b){return{'model':db[_0x42531b['model']],'as':_0x42531b['as'],'attributes':_0x42531b['as']===_0x1b69('0x30')?_[_0x1b69('0x31')](_0x4cc7a5):_0x42531b['attributes'],'include':_0x42531b[_0x1b69('0x1d')]?_['map'](_0x42531b[_0x1b69('0x1d')],function(_0x3da63f){return{'model':db[_0x3da63f[_0x1b69('0x1f')]],'as':_0x3da63f['as'],'attributes':_0x3da63f[_0x1b69('0x1b')],'include':_0x3da63f[_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x3da63f[_0x1b69('0x1d')],function(_0x24491a){return{'model':db[_0x24491a[_0x1b69('0x1f')]],'as':_0x24491a['as'],'attributes':_0x24491a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x576b06){logger[_0x1b69('0xd')](_0x1b69('0x16'),_0x353cf5);logger['debug']('GetCmHopper',_0x353cf5,JSON['stringify'](_0x576b06));_0x586f6b(_0x576b06);})[_0x1b69('0x20')](function(_0x17d837){logger[_0x1b69('0x11')]('GetCmHopper',_0x17d837[_0x1b69('0x13')],_0x353cf5);_0x1d4c30(_0x2e75bb[_0x1b69('0x11')](0x1f4,_0x17d837['message']));});});});}; \ No newline at end of file +var _0x6b8d=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','limit','include','map','model','find','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','findAll','order','LOCK','Contact','keys','User','name','voicePause','length','UserId','push','all','MoveContactManagedDialer','sequelize','CmHopperFinal','destroy','CountReScheduled','literal','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x7c6e16,_0x3c11f7){var _0x10f3d9=function(_0x10d250){while(--_0x10d250){_0x7c6e16['push'](_0x7c6e16['shift']());}};_0x10f3d9(++_0x3c11f7);}(_0x6b8d,0x8c));var _0xd6b8=function(_0x2a4e13,_0x5a846e){_0x2a4e13=_0x2a4e13-0x0;var _0xb0c2d9=_0x6b8d[_0x2a4e13];return _0xb0c2d9;};'use strict';var _=require(_0xd6b8('0x0'));var util=require(_0xd6b8('0x1'));var moment=require(_0xd6b8('0x2'));var BPromise=require(_0xd6b8('0x3'));var rs=require(_0xd6b8('0x4'));var fs=require('fs');var Redis=require(_0xd6b8('0x5'));var db=require(_0xd6b8('0x6'))['db'];var utils=require(_0xd6b8('0x7'));var logger=require(_0xd6b8('0x8'))('rpc');var config=require(_0xd6b8('0x9'));var jayson=require(_0xd6b8('0xa'));var client=jayson[_0xd6b8('0xb')][_0xd6b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32c53f,_0x11df27,_0x139df7){return new BPromise(function(_0x61b26c,_0x4f50e0){return client[_0xd6b8('0xd')](_0x32c53f,_0x139df7)[_0xd6b8('0xe')](function(_0x53ea96){logger[_0xd6b8('0xf')](_0xd6b8('0x10'),_0x11df27,'request\x20sent');logger[_0xd6b8('0x11')](_0xd6b8('0x12'),_0x11df27,_0xd6b8('0x13'),JSON[_0xd6b8('0x14')](_0x53ea96));if(_0x53ea96[_0xd6b8('0x15')]){if(_0x53ea96[_0xd6b8('0x15')][_0xd6b8('0x16')]===0x1f4){logger['error'](_0xd6b8('0x10'),_0x11df27,_0x53ea96[_0xd6b8('0x15')][_0xd6b8('0x17')]);return _0x4f50e0(_0x53ea96[_0xd6b8('0x15')][_0xd6b8('0x17')]);}logger[_0xd6b8('0x15')]('CmHopper,\x20%s,\x20%s',_0x11df27,_0x53ea96[_0xd6b8('0x15')]['message']);return _0x61b26c(_0x53ea96['error'][_0xd6b8('0x17')]);}else{logger['info'](_0xd6b8('0x10'),_0x11df27,_0xd6b8('0x13'));_0x61b26c(_0x53ea96[_0xd6b8('0x18')]['message']);}})[_0xd6b8('0x19')](function(_0x2b7672){logger[_0xd6b8('0x15')]('CmHopper,\x20%s,\x20%s',_0x11df27,_0x2b7672);_0x4f50e0(_0x2b7672);});});}exports[_0xd6b8('0x1a')]=function(_0xa0f454){var _0x5e83ed=this;return new Promise(function(_0x1d2f8e,_0x3111f5){return db[_0xd6b8('0x1b')]['findAll']({'raw':_0xa0f454[_0xd6b8('0x1c')]?_0xa0f454[_0xd6b8('0x1c')][_0xd6b8('0x1d')]===undefined?!![]:![]:!![],'where':_0xa0f454[_0xd6b8('0x1c')]?_0xa0f454['options'][_0xd6b8('0x1e')]||null:null,'attributes':_0xa0f454['options']?_0xa0f454[_0xd6b8('0x1c')][_0xd6b8('0x1f')]||null:null,'limit':_0xa0f454[_0xd6b8('0x1c')]?_0xa0f454[_0xd6b8('0x1c')][_0xd6b8('0x20')]||null:null,'include':_0xa0f454[_0xd6b8('0x1c')]?_0xa0f454['options'][_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0xa0f454[_0xd6b8('0x1c')][_0xd6b8('0x21')],function(_0x2f0563){return{'model':db[_0x2f0563[_0xd6b8('0x23')]],'as':_0x2f0563['as'],'attributes':_0x2f0563['attributes'],'include':_0x2f0563[_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x2f0563['include'],function(_0xc4a6f9){return{'model':db[_0xc4a6f9[_0xd6b8('0x23')]],'as':_0xc4a6f9['as'],'attributes':_0xc4a6f9['attributes'],'include':_0xc4a6f9['include']?_['map'](_0xc4a6f9[_0xd6b8('0x21')],function(_0x5aa6a0){return{'model':db[_0x5aa6a0[_0xd6b8('0x23')]],'as':_0x5aa6a0['as'],'attributes':_0x5aa6a0[_0xd6b8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd6b8('0xe')](function(_0x1c7b9c){logger[_0xd6b8('0xf')](_0xd6b8('0x1a'),_0xa0f454);logger[_0xd6b8('0x11')](_0xd6b8('0x1a'),_0xa0f454,JSON[_0xd6b8('0x14')](_0x1c7b9c));_0x1d2f8e(_0x1c7b9c);})['catch'](function(_0x156e3c){logger[_0xd6b8('0x15')](_0xd6b8('0x1a'),_0x156e3c[_0xd6b8('0x17')],_0xa0f454);_0x3111f5(_0x5e83ed['error'](0x1f4,_0x156e3c['message']));});});};exports['ShowCmHopper']=function(_0x5e981a){var _0x5388f5=this;return new Promise(function(_0x8dc997,_0x85e0ca){return db[_0xd6b8('0x1b')][_0xd6b8('0x24')]({'raw':_0x5e981a['options']?_0x5e981a['options'][_0xd6b8('0x1d')]===undefined?!![]:![]:!![],'where':_0x5e981a[_0xd6b8('0x1c')]?_0x5e981a[_0xd6b8('0x1c')][_0xd6b8('0x1e')]||null:null,'attributes':_0x5e981a[_0xd6b8('0x1c')]?_0x5e981a['options'][_0xd6b8('0x1f')]||null:null,'include':_0x5e981a['options']?_0x5e981a['options'][_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x5e981a[_0xd6b8('0x1c')][_0xd6b8('0x21')],function(_0x52c805){return{'model':db[_0x52c805[_0xd6b8('0x23')]],'as':_0x52c805['as'],'attributes':_0x52c805[_0xd6b8('0x1f')],'include':_0x52c805[_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x52c805[_0xd6b8('0x21')],function(_0xf2b5da){return{'model':db[_0xf2b5da[_0xd6b8('0x23')]],'as':_0xf2b5da['as'],'attributes':_0xf2b5da[_0xd6b8('0x1f')],'include':_0xf2b5da[_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0xf2b5da[_0xd6b8('0x21')],function(_0x135695){return{'model':db[_0x135695[_0xd6b8('0x23')]],'as':_0x135695['as'],'attributes':_0x135695['attributes']};}):[]};}):[]};}):[]:[]})[_0xd6b8('0xe')](function(_0x28fd71){logger['info'](_0xd6b8('0x25'),_0x5e981a);logger[_0xd6b8('0x11')](_0xd6b8('0x25'),_0x5e981a,JSON[_0xd6b8('0x14')](_0x28fd71));_0x8dc997(_0x28fd71);})['catch'](function(_0x5b31b8){logger[_0xd6b8('0x15')]('ShowCmHopper',_0x5b31b8[_0xd6b8('0x17')],_0x5e981a);_0x85e0ca(_0x5388f5['error'](0x1f4,_0x5b31b8['message']));});});};exports[_0xd6b8('0x26')]=function(_0x2dcfb7){var _0xfbc9d7=this;return new Promise(function(_0x4b5bbd,_0x3ab26b){return db['CmHopper'][_0xd6b8('0x27')](_0x2dcfb7[_0xd6b8('0x28')],{'raw':_0x2dcfb7['options']?_0x2dcfb7[_0xd6b8('0x1c')][_0xd6b8('0x1d')]===undefined?!![]:![]:!![]})[_0xd6b8('0xe')](function(_0x4fe77c){logger['info'](_0xd6b8('0x26'),_0x2dcfb7);logger['debug']('CreateCmHopper',_0x2dcfb7,JSON[_0xd6b8('0x14')](_0x4fe77c));_0x4b5bbd(_0x4fe77c);})[_0xd6b8('0x19')](function(_0x5214e1){logger[_0xd6b8('0x15')](_0xd6b8('0x26'),_0x5214e1[_0xd6b8('0x17')],_0x2dcfb7);_0x3ab26b(_0xfbc9d7[_0xd6b8('0x15')](0x1f4,_0x5214e1['message']));});});};exports[_0xd6b8('0x29')]=function(_0x30651c){var _0x103378=this;return new Promise(function(_0x5e8543,_0x53a8e2){return db[_0xd6b8('0x1b')][_0xd6b8('0x2a')](_0x30651c['body'],{'raw':_0x30651c[_0xd6b8('0x1c')]?_0x30651c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30651c[_0xd6b8('0x1c')]?_0x30651c[_0xd6b8('0x1c')]['where']||null:null,'attributes':_0x30651c[_0xd6b8('0x1c')]?_0x30651c[_0xd6b8('0x1c')][_0xd6b8('0x1f')]||null:null,'limit':_0x30651c['options']?_0x30651c[_0xd6b8('0x1c')]['limit']||null:null})[_0xd6b8('0xe')](function(_0x458616){logger['info']('UpdateCmHopper',_0x30651c);logger[_0xd6b8('0x11')]('UpdateCmHopper',_0x30651c,JSON['stringify'](_0x458616));_0x5e8543(_0x458616);})['catch'](function(_0x1d0ae4){logger[_0xd6b8('0x15')](_0xd6b8('0x29'),_0x1d0ae4['message'],_0x30651c);_0x53a8e2(_0x103378[_0xd6b8('0x15')](0x1f4,_0x1d0ae4[_0xd6b8('0x17')]));});});};exports[_0xd6b8('0x2b')]=function(_0x307d44){var _0x1ad99e=this;return new Promise(function(_0x3f9f5b,_0x5f2f19){return db['CmHopper']['destroy']({'where':_0x307d44[_0xd6b8('0x1c')]?_0x307d44[_0xd6b8('0x1c')]['where']||null:null})[_0xd6b8('0xe')](function(_0x3e4afb){logger[_0xd6b8('0xf')](_0xd6b8('0x2b'),_0x307d44);logger[_0xd6b8('0x11')](_0xd6b8('0x2b'),_0x307d44,JSON[_0xd6b8('0x14')](_0x3e4afb));_0x3f9f5b(_0x3e4afb);})[_0xd6b8('0x19')](function(_0x17182a){logger[_0xd6b8('0x15')](_0xd6b8('0x2b'),_0x17182a[_0xd6b8('0x17')],_0x307d44);_0x5f2f19(_0x1ad99e[_0xd6b8('0x15')](0x1f4,_0x17182a[_0xd6b8('0x17')]));});});};exports[_0xd6b8('0x2c')]=function(_0x2bd263){var _0x12ed0e=this;return new Promise(function(_0x124893,_0xd45db5){return db[_0xd6b8('0x2d')][_0xd6b8('0x2e')]()[_0xd6b8('0xe')](function(_0x35d213){return db['sequelize'][_0xd6b8('0x2f')](function(_0x17381f){return db['CmHopper'][_0xd6b8('0x30')]({'where':_0x2bd263[_0xd6b8('0x1c')]?_0x2bd263[_0xd6b8('0x1c')][_0xd6b8('0x1e')]||null:null,'attributes':_0x2bd263['options']?_0x2bd263[_0xd6b8('0x1c')]['attributes']||null:null,'limit':_0x2bd263[_0xd6b8('0x1c')]?_0x2bd263['options'][_0xd6b8('0x20')]||null:null,'order':_0x2bd263[_0xd6b8('0x1c')]?_0x2bd263[_0xd6b8('0x1c')][_0xd6b8('0x31')]||null:null,'transaction':_0x17381f,'lock':_0x17381f[_0xd6b8('0x32')]['UPDATE'],'include':[{'model':db[_0xd6b8('0x2d')],'as':_0xd6b8('0x33'),'attributes':_[_0xd6b8('0x34')](_0x35d213)},{'model':db[_0xd6b8('0x35')],'as':'Agent','attributes':['id',_0xd6b8('0x36'),_0xd6b8('0x37')]}]})['then'](function(_0x4e7d4d){var _0x58a15c=[];var _0x323e33=[];for(var _0x1f710b=0x0;_0x1f710b<_0x4e7d4d[_0xd6b8('0x38')];_0x1f710b+=0x1){var _0x15cfc4=_0x4e7d4d[_0x1f710b][_0xd6b8('0x39')];if(_0x15cfc4===null){_0x58a15c[_0xd6b8('0x3a')](_0x4e7d4d[_0x1f710b][_0xd6b8('0x2a')](_0x2bd263[_0xd6b8('0x28')],{'transaction':_0x17381f}));}else if(!_0x323e33['includes'](_0x15cfc4)){_0x323e33[_0xd6b8('0x3a')](_0x15cfc4);_0x58a15c['push'](_0x4e7d4d[_0x1f710b][_0xd6b8('0x2a')](_0x2bd263[_0xd6b8('0x28')],{'transaction':_0x17381f}));}}return BPromise[_0xd6b8('0x3b')](_0x58a15c);});})[_0xd6b8('0xe')](function(_0x541671){logger[_0xd6b8('0xf')](_0xd6b8('0x2c'),_0x2bd263);logger[_0xd6b8('0x11')](_0xd6b8('0x2c'),_0x2bd263,JSON[_0xd6b8('0x14')](_0x541671));_0x124893(_0x541671);})['catch'](function(_0x212e28){logger[_0xd6b8('0x15')](_0xd6b8('0x2c'),_0x212e28[_0xd6b8('0x17')],_0x2bd263);_0xd45db5(_0x12ed0e[_0xd6b8('0x15')](0x1f4,_0x212e28[_0xd6b8('0x17')]));});});});};exports[_0xd6b8('0x3c')]=function(_0x5d2b29){var _0x3fd213=this;return new Promise(function(_0x474f05,_0x59063a){return db[_0xd6b8('0x3d')][_0xd6b8('0x2f')](function(_0xe423b6){return db[_0xd6b8('0x3e')][_0xd6b8('0x27')](_0x5d2b29[_0xd6b8('0x28')],{'raw':_0x5d2b29[_0xd6b8('0x1c')]?_0x5d2b29[_0xd6b8('0x1c')][_0xd6b8('0x1d')]===undefined?!![]:![]:!![],'transaction':_0xe423b6})['then'](function(){return db['CmHopper'][_0xd6b8('0x3f')]({'where':_0x5d2b29[_0xd6b8('0x1c')]?_0x5d2b29[_0xd6b8('0x1c')][_0xd6b8('0x1e')]||null:null,'transaction':_0xe423b6});});})['then'](function(_0xd6b9e){logger[_0xd6b8('0xf')](_0xd6b8('0x3c'),_0x5d2b29);logger[_0xd6b8('0x11')](_0xd6b8('0x3c'),_0x5d2b29,JSON[_0xd6b8('0x14')](_0xd6b9e));_0x474f05(_0xd6b9e);})[_0xd6b8('0x19')](function(_0x378eae){logger[_0xd6b8('0x15')](_0xd6b8('0x3c'),_0x378eae[_0xd6b8('0x17')],_0x5d2b29);_0x59063a(_0x3fd213['error'](0x1f4,_0x378eae['message']));});});};exports[_0xd6b8('0x40')]=function(_0x400d97){var _0x22d457=this;return new Promise(function(_0x473306,_0x24e746){return db['CmHopper'][_0xd6b8('0x30')]({'raw':_0x400d97[_0xd6b8('0x1c')]?_0x400d97[_0xd6b8('0x1c')][_0xd6b8('0x1d')]===undefined?!![]:![]:!![],'where':_0x400d97[_0xd6b8('0x1c')]?_0x400d97[_0xd6b8('0x1c')]['where']||null:null,'attributes':[[db[_0xd6b8('0x3d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd6b8('0x3d')][_0xd6b8('0x41')]('`scheduledat`\x20>=\x20'+util['format'](_0xd6b8('0x42'),moment()[_0xd6b8('0x43')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xd6b8('0x44')))),_0xd6b8('0x45')]]})[_0xd6b8('0xe')](function(_0x2e7424){logger[_0xd6b8('0xf')](_0xd6b8('0x40'),_0x400d97);logger['debug'](_0xd6b8('0x40'),_0x400d97,JSON[_0xd6b8('0x14')](_0x2e7424));_0x473306(_0x2e7424);})[_0xd6b8('0x19')](function(_0x574e74){logger[_0xd6b8('0x15')](_0xd6b8('0x40'),_0x574e74[_0xd6b8('0x17')],_0x400d97);_0x24e746(_0x22d457['error'](0x1f4,_0x574e74[_0xd6b8('0x17')]));});});};exports[_0xd6b8('0x46')]=function(_0x45f447){var _0x4f265b=this;return new Promise(function(_0xd4c40d,_0x3cf199){return db['CmContact'][_0xd6b8('0x2e')]()['then'](function(_0x229c37){return db[_0xd6b8('0x3d')][_0xd6b8('0x2f')](function(_0x1b4064){return db['CmHopper'][_0xd6b8('0x30')]({'where':_0x45f447[_0xd6b8('0x1c')]?_0x45f447[_0xd6b8('0x1c')][_0xd6b8('0x1e')]||null:null,'attributes':_0x45f447[_0xd6b8('0x1c')]?_0x45f447[_0xd6b8('0x1c')][_0xd6b8('0x1f')]||null:null,'limit':0x1,'order':_0x45f447[_0xd6b8('0x1c')]?_0x45f447[_0xd6b8('0x1c')][_0xd6b8('0x31')]||null:null,'group':db['CmHopper'][_0xd6b8('0x39')],'transaction':_0x1b4064,'lock':_0x1b4064[_0xd6b8('0x32')][_0xd6b8('0x47')],'include':_0x45f447['options']?_0x45f447['options'][_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x45f447[_0xd6b8('0x1c')][_0xd6b8('0x21')],function(_0xaf0e62){return{'model':db[_0xaf0e62['model']],'as':_0xaf0e62['as'],'attributes':_0xaf0e62[_0xd6b8('0x1f')],'include':_0xaf0e62['include']?_['map'](_0xaf0e62[_0xd6b8('0x21')],function(_0x2f5b5c){return{'model':db[_0x2f5b5c[_0xd6b8('0x23')]],'as':_0x2f5b5c['as'],'attributes':_0x2f5b5c[_0xd6b8('0x1f')],'include':_0x2f5b5c[_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x2f5b5c[_0xd6b8('0x21')],function(_0xd64497){return{'model':db[_0xd64497['model']],'as':_0xd64497['as'],'attributes':_0xd64497['attributes']};}):[]};}):[]};}):[]:[]})[_0xd6b8('0xe')](function(_0x34c873){var _0x413e1d=[];for(var _0x698b5b=0x0;_0x698b5b<_0x34c873[_0xd6b8('0x38')];_0x698b5b+=0x1){_0x413e1d[_0xd6b8('0x3a')](_0x34c873[_0x698b5b][_0xd6b8('0x2a')](_0x45f447[_0xd6b8('0x28')],{'transaction':_0x1b4064}));}return BPromise[_0xd6b8('0x3b')](_0x413e1d);});})[_0xd6b8('0xe')](function(_0x337a02){logger[_0xd6b8('0xf')]('GetContactRecallMe',_0x45f447);logger[_0xd6b8('0x11')](_0xd6b8('0x46'),_0x45f447,JSON[_0xd6b8('0x14')](_0x337a02));_0xd4c40d(_0x337a02);})[_0xd6b8('0x19')](function(_0x51145d){logger['error']('GetContactRecallMe',_0x51145d[_0xd6b8('0x17')],_0x45f447);_0x3cf199(_0x4f265b['error'](0x1f4,_0x51145d[_0xd6b8('0x17')]));});});});};exports[_0xd6b8('0x48')]=function(_0x234a98){var _0xad71bf=this;return new Promise(function(_0x780fcb,_0x33785a){db[_0xd6b8('0x2d')][_0xd6b8('0x2e')]()[_0xd6b8('0xe')](function(_0x2e4a0c){return db['CmHopper'][_0xd6b8('0x30')]({'raw':_0x234a98[_0xd6b8('0x1c')]?_0x234a98[_0xd6b8('0x1c')][_0xd6b8('0x1d')]===undefined?!![]:![]:!![],'where':_0x234a98[_0xd6b8('0x1c')]?_0x234a98[_0xd6b8('0x1c')]['where']||null:null,'attributes':_0x234a98['options']?_0x234a98['options']['attributes']||null:null,'limit':_0x234a98[_0xd6b8('0x1c')]?_0x234a98['options'][_0xd6b8('0x20')]||null:null,'include':_0x234a98[_0xd6b8('0x1c')]?_0x234a98[_0xd6b8('0x1c')][_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x234a98[_0xd6b8('0x1c')][_0xd6b8('0x21')],function(_0x44da24){return{'model':db[_0x44da24[_0xd6b8('0x23')]],'as':_0x44da24['as'],'attributes':_0x44da24['as']===_0xd6b8('0x33')?_[_0xd6b8('0x34')](_0x2e4a0c):_0x44da24[_0xd6b8('0x1f')],'include':_0x44da24[_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x44da24[_0xd6b8('0x21')],function(_0x1e859d){return{'model':db[_0x1e859d[_0xd6b8('0x23')]],'as':_0x1e859d['as'],'attributes':_0x1e859d['attributes'],'include':_0x1e859d['include']?_[_0xd6b8('0x22')](_0x1e859d[_0xd6b8('0x21')],function(_0x5dd62a){return{'model':db[_0x5dd62a[_0xd6b8('0x23')]],'as':_0x5dd62a['as'],'attributes':_0x5dd62a['attributes']};}):[]};}):[]};}):[]:[]})[_0xd6b8('0xe')](function(_0x5d7537){logger[_0xd6b8('0xf')](_0xd6b8('0x1a'),_0x234a98);logger['debug'](_0xd6b8('0x1a'),_0x234a98,JSON[_0xd6b8('0x14')](_0x5d7537));_0x780fcb(_0x5d7537);})[_0xd6b8('0x19')](function(_0x168f01){logger[_0xd6b8('0x15')]('GetCmHopper',_0x168f01['message'],_0x234a98);_0x33785a(_0xad71bf[_0xd6b8('0x15')](0x1f4,_0x168f01['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 16cdf97..1fc5336 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 _0x5cef=['../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','/:id','show','post','create','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3bcc19,_0x3190e4){var _0x2570f6=function(_0x239f41){while(--_0x239f41){_0x3bcc19['push'](_0x3bcc19['shift']());}};_0x2570f6(++_0x3190e4);}(_0x5cef,0x141));var _0xf5ce=function(_0x98feb5,_0x2fa627){_0x98feb5=_0x98feb5-0x0;var _0x3c5902=_0x5cef[_0x98feb5];return _0x3c5902;};'use strict';var multer=require(_0xf5ce('0x0'));var util=require(_0xf5ce('0x1'));var path=require(_0xf5ce('0x2'));var timeout=require(_0xf5ce('0x3'));var express=require(_0xf5ce('0x4'));var router=express[_0xf5ce('0x5')]();var fs_extra=require(_0xf5ce('0x6'));var auth=require(_0xf5ce('0x7'));var interaction=require(_0xf5ce('0x8'));var config=require(_0xf5ce('0x9'));var controller=require('./cmHopper.controller');router[_0xf5ce('0xa')]('/',auth[_0xf5ce('0xb')](),controller[_0xf5ce('0xc')]);router['get'](_0xf5ce('0xd'),auth[_0xf5ce('0xb')](),controller['describe']);router[_0xf5ce('0xa')](_0xf5ce('0xe'),auth[_0xf5ce('0xb')](),controller[_0xf5ce('0xf')]);router[_0xf5ce('0xa')](_0xf5ce('0x10'),auth[_0xf5ce('0xb')](),controller[_0xf5ce('0x11')]);router[_0xf5ce('0x12')]('/',auth['isAuthenticated'](),controller[_0xf5ce('0x13')]);router[_0xf5ce('0x12')]('/preview',auth['isAuthenticated'](),controller['getPreview']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf5ce('0x14')]);router['delete']('/:id',auth[_0xf5ce('0xb')](),controller['destroy']);module[_0xf5ce('0x15')]=router; \ No newline at end of file +var _0x13a9=['create','/preview','getPreview','put','update','delete','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','describe','/opencontacts','getOpenContacts','/:id','post'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0x13a9,0x132));var _0x913a=function(_0x49986a,_0x368cf5){_0x49986a=_0x49986a-0x0;var _0x97a9f2=_0x13a9[_0x49986a];return _0x97a9f2;};'use strict';var multer=require('multer');var util=require(_0x913a('0x0'));var path=require('path');var timeout=require(_0x913a('0x1'));var express=require(_0x913a('0x2'));var router=express['Router']();var fs_extra=require(_0x913a('0x3'));var auth=require(_0x913a('0x4'));var interaction=require(_0x913a('0x5'));var config=require(_0x913a('0x6'));var controller=require(_0x913a('0x7'));router['get']('/',auth[_0x913a('0x8')](),controller[_0x913a('0x9')]);router[_0x913a('0xa')]('/describe',auth[_0x913a('0x8')](),controller[_0x913a('0xb')]);router[_0x913a('0xa')](_0x913a('0xc'),auth[_0x913a('0x8')](),controller[_0x913a('0xd')]);router[_0x913a('0xa')](_0x913a('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x913a('0xf')]('/',auth[_0x913a('0x8')](),controller[_0x913a('0x10')]);router[_0x913a('0xf')](_0x913a('0x11'),auth[_0x913a('0x8')](),controller[_0x913a('0x12')]);router[_0x913a('0x13')](_0x913a('0xe'),auth[_0x913a('0x8')](),controller[_0x913a('0x14')]);router[_0x913a('0x15')](_0x913a('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x913a('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 56746dd..811cab4 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 _0x89b2=['STRING','INTEGER','contactListQueue','moment','exports'];(function(_0x13b2e1,_0x30a633){var _0x4afafb=function(_0x2e4dfa){while(--_0x2e4dfa){_0x13b2e1['push'](_0x13b2e1['shift']());}};_0x4afafb(++_0x30a633);}(_0x89b2,0x1de));var _0x289b=function(_0x348d83,_0x1e627e){_0x348d83=_0x348d83-0x0;var _0x405138=_0x89b2[_0x348d83];return _0x405138;};'use strict';var moment=require(_0x289b('0x0'));var Sequelize=require('sequelize');module[_0x289b('0x1')]={'phone':{'type':Sequelize[_0x289b('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x289b('0x3')],'unique':_0x289b('0x4')},'ListId':{'type':Sequelize[_0x289b('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x289b('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x1a0b=['exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x1f89d4,_0x1d6de0){_0x1f89d4=_0x1f89d4-0x0;var _0x4b9640=_0x1a0b[_0x1f89d4];return _0x4b9640;};'use strict';var moment=require(_0xb1a0('0x0'));var Sequelize=require('sequelize');module[_0xb1a0('0x1')]={'phone':{'type':Sequelize[_0xb1a0('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb1a0('0x3')],'unique':_0xb1a0('0x4')},'ListId':{'type':Sequelize[_0xb1a0('0x3')],'unique':_0xb1a0('0x4')},'VoiceQueueId':{'type':Sequelize[_0xb1a0('0x3')],'unique':_0xb1a0('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index e9419e4..977324c 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 _0x9785=['intersection','attributes','fields','nolimit','limit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','then','show','params','keys','rawAttributes','length','find','catch','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','map','CmHopperBlack','fieldName','type','model','query'];(function(_0x447c29,_0x5db822){var _0x33420d=function(_0x5a46d1){while(--_0x5a46d1){_0x447c29['push'](_0x447c29['shift']());}};_0x33420d(++_0x5db822);}(_0x9785,0x133));var _0x5978=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x9785[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0x5978('0x0'));var rimraf=require(_0x5978('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5978('0x2'));var rp=require(_0x5978('0x3'));var moment=require(_0x5978('0x4'));var BPromise=require(_0x5978('0x5'));var Mustache=require(_0x5978('0x6'));var util=require(_0x5978('0x7'));var path=require('path');var sox=require(_0x5978('0x8'));var csv=require(_0x5978('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5978('0xa'));var crypto=require(_0x5978('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5978('0x9'));var querystring=require(_0x5978('0xc'));var Papa=require(_0x5978('0xd'));var Redis=require('ioredis');var authService=require(_0x5978('0xe'));var qs=require(_0x5978('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5978('0x10'));var logger=require(_0x5978('0x11'))(_0x5978('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5978('0x13'));var db=require(_0x5978('0x14'))['db'];function respondWithStatusCode(_0x4a7a20,_0xbebbd9){_0xbebbd9=_0xbebbd9||0xcc;return function(_0x49a7bb){if(_0x49a7bb){return _0x4a7a20['sendStatus'](_0xbebbd9);}return _0x4a7a20['status'](_0xbebbd9)[_0x5978('0x15')]();};}function respondWithResult(_0x3c3b3a,_0x1089ea){_0x1089ea=_0x1089ea||0xc8;return function(_0x133f79){if(_0x133f79){return _0x3c3b3a[_0x5978('0x16')](_0x1089ea)['json'](_0x133f79);}};}function respondWithFilteredResult(_0x5d820a,_0x3607be){return function(_0x6795c8){if(_0x6795c8){var _0x138c13=typeof _0x3607be[_0x5978('0x17')]==='undefined'&&typeof _0x3607be['limit']===_0x5978('0x18');var _0x1b5b8b=_0x6795c8[_0x5978('0x19')];var _0x56286c=_0x138c13?0x0:_0x3607be[_0x5978('0x17')];var _0x1cba78=_0x138c13?_0x6795c8[_0x5978('0x19')]:_0x3607be[_0x5978('0x17')]+_0x3607be['limit'];var _0x41efb0;if(_0x1cba78>=_0x1b5b8b){_0x1cba78=_0x1b5b8b;_0x41efb0=0xc8;}else{_0x41efb0=0xce;}_0x5d820a['status'](_0x41efb0);return _0x5d820a[_0x5978('0x1a')]('Content-Range',_0x56286c+'-'+_0x1cba78+'/'+_0x1b5b8b)[_0x5978('0x1b')](_0x6795c8);}return null;};}function patchUpdates(_0x5085dd){return function(_0x1b21eb){try{jsonpatch[_0x5978('0x1c')](_0x1b21eb,_0x5085dd,!![]);}catch(_0x2daf22){return BPromise[_0x5978('0x1d')](_0x2daf22);}return _0x1b21eb[_0x5978('0x1e')]();};}function saveUpdates(_0x416582,_0x50e299){return function(_0x1e2e1a){if(_0x1e2e1a){return _0x1e2e1a[_0x5978('0x1f')](_0x416582)['then'](function(_0x384cd4){return _0x384cd4;});}return null;};}function removeEntity(_0x547703,_0x4f5c76){return function(_0x5ea79c){if(_0x5ea79c){return _0x5ea79c[_0x5978('0x20')]()['then'](function(){_0x547703[_0x5978('0x16')](0xcc)[_0x5978('0x15')]();});}};}function handleEntityNotFound(_0x17f5dd,_0x459d97){return function(_0x496595){if(!_0x496595){_0x17f5dd[_0x5978('0x21')](0x194);}return _0x496595;};}function handleError(_0x366ab1,_0xf872ac){_0xf872ac=_0xf872ac||0x1f4;return function(_0xe03c41){logger['error'](_0xe03c41[_0x5978('0x22')]);if(_0xe03c41[_0x5978('0x23')]){delete _0xe03c41[_0x5978('0x23')];}_0x366ab1[_0x5978('0x16')](_0xf872ac)[_0x5978('0x24')](_0xe03c41);};}exports['index']=function(_0x90d075,_0x303f57){var _0x528126={},_0x41426f={},_0x4402c0={'count':0x0,'rows':[]};var _0x1f2847=_[_0x5978('0x25')](db[_0x5978('0x26')]['rawAttributes'],function(_0x1b29bd){return{'name':_0x1b29bd[_0x5978('0x27')],'type':_0x1b29bd[_0x5978('0x28')]['key']};});_0x41426f[_0x5978('0x29')]=_['map'](_0x1f2847,_0x5978('0x23'));_0x41426f[_0x5978('0x2a')]=_['keys'](_0x90d075[_0x5978('0x2a')]);_0x41426f['filters']=_[_0x5978('0x2b')](_0x41426f[_0x5978('0x29')],_0x41426f['query']);_0x528126[_0x5978('0x2c')]=_[_0x5978('0x2b')](_0x41426f[_0x5978('0x29')],qs[_0x5978('0x2d')](_0x90d075[_0x5978('0x2a')]['fields']));_0x528126['attributes']=_0x528126[_0x5978('0x2c')]['length']?_0x528126['attributes']:_0x41426f[_0x5978('0x29')];if(!_0x90d075['query']['hasOwnProperty'](_0x5978('0x2e'))){_0x528126[_0x5978('0x2f')]=qs[_0x5978('0x2f')](_0x90d075[_0x5978('0x2a')][_0x5978('0x2f')]);_0x528126[_0x5978('0x17')]=qs[_0x5978('0x17')](_0x90d075[_0x5978('0x2a')][_0x5978('0x17')]);}_0x528126[_0x5978('0x30')]=qs['sort'](_0x90d075[_0x5978('0x2a')]['sort']);_0x528126['where']=qs[_0x5978('0x31')](_[_0x5978('0x32')](_0x90d075['query'],_0x41426f[_0x5978('0x31')]),_0x1f2847);if(_0x90d075[_0x5978('0x2a')][_0x5978('0x33')]){_0x528126[_0x5978('0x34')]=_[_0x5978('0x35')](_0x528126[_0x5978('0x34')],{'$or':_[_0x5978('0x25')](_0x1f2847,function(_0x41f8de){if(_0x41f8de[_0x5978('0x28')]!==_0x5978('0x36')){var _0x1d3414={};_0x1d3414[_0x41f8de['name']]={'$like':'%'+_0x90d075[_0x5978('0x2a')][_0x5978('0x33')]+'%'};return _0x1d3414;}})});}_0x528126=_['merge']({},_0x528126,_0x90d075[_0x5978('0x37')]);var _0x3cf252={'where':_0x528126['where']};return db[_0x5978('0x26')][_0x5978('0x19')](_0x3cf252)['then'](function(_0x189134){_0x4402c0[_0x5978('0x19')]=_0x189134;if(_0x90d075[_0x5978('0x2a')][_0x5978('0x38')]){_0x528126[_0x5978('0x39')]=[{'all':!![]}];}return db[_0x5978('0x26')][_0x5978('0x3a')](_0x528126);})['then'](function(_0x3b2dce){_0x4402c0[_0x5978('0x3b')]=_0x3b2dce;return _0x4402c0;})[_0x5978('0x3c')](respondWithFilteredResult(_0x303f57,_0x528126))['catch'](handleError(_0x303f57,null));};exports[_0x5978('0x3d')]=function(_0x552ae1,_0x35472f){var _0x1bb298={'raw':!![],'where':{'id':_0x552ae1[_0x5978('0x3e')]['id']}},_0x36f7ee={};_0x36f7ee[_0x5978('0x29')]=_[_0x5978('0x3f')](db[_0x5978('0x26')][_0x5978('0x40')]);_0x36f7ee[_0x5978('0x2a')]=_[_0x5978('0x3f')](_0x552ae1[_0x5978('0x2a')]);_0x36f7ee[_0x5978('0x31')]=_[_0x5978('0x2b')](_0x36f7ee['model'],_0x36f7ee[_0x5978('0x2a')]);_0x1bb298['attributes']=_[_0x5978('0x2b')](_0x36f7ee['model'],qs[_0x5978('0x2d')](_0x552ae1[_0x5978('0x2a')]['fields']));_0x1bb298[_0x5978('0x2c')]=_0x1bb298[_0x5978('0x2c')][_0x5978('0x41')]?_0x1bb298[_0x5978('0x2c')]:_0x36f7ee[_0x5978('0x29')];if(_0x552ae1['query']['includeAll']){_0x1bb298[_0x5978('0x39')]=[{'all':!![]}];}_0x1bb298=_[_0x5978('0x35')]({},_0x1bb298,_0x552ae1[_0x5978('0x37')]);return db[_0x5978('0x26')][_0x5978('0x42')](_0x1bb298)[_0x5978('0x3c')](handleEntityNotFound(_0x35472f,null))[_0x5978('0x3c')](respondWithResult(_0x35472f,null))[_0x5978('0x43')](handleError(_0x35472f,null));};exports[_0x5978('0x1f')]=function(_0x278a0a,_0x297ac1){if(_0x278a0a['body']['id']){delete _0x278a0a[_0x5978('0x44')]['id'];}return db[_0x5978('0x26')]['find']({'where':{'id':_0x278a0a[_0x5978('0x3e')]['id']}})[_0x5978('0x3c')](handleEntityNotFound(_0x297ac1,null))[_0x5978('0x3c')](saveUpdates(_0x278a0a[_0x5978('0x44')],null))['then'](respondWithResult(_0x297ac1,null))['catch'](handleError(_0x297ac1,null));};exports[_0x5978('0x20')]=function(_0x210bb8,_0x2b219d){return db[_0x5978('0x26')]['find']({'where':{'id':_0x210bb8['params']['id']}})[_0x5978('0x3c')](handleEntityNotFound(_0x2b219d,null))[_0x5978('0x3c')](removeEntity(_0x2b219d,null))[_0x5978('0x43')](handleError(_0x2b219d,null));};exports[_0x5978('0x45')]=function(_0x5edd9f,_0x7deac8){return db[_0x5978('0x26')][_0x5978('0x45')]()[_0x5978('0x3c')](respondWithResult(_0x7deac8,null))[_0x5978('0x43')](handleError(_0x7deac8,null));}; \ No newline at end of file +var _0x286e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','includeAll','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x426d21,_0x1e9415){var _0x33ca32=function(_0x319870){while(--_0x319870){_0x426d21['push'](_0x426d21['shift']());}};_0x33ca32(++_0x1e9415);}(_0x286e,0x85));var _0xe286=function(_0x2f1047,_0x516ee1){_0x2f1047=_0x2f1047-0x0;var _0x24f11a=_0x286e[_0x2f1047];return _0x24f11a;};'use strict';var emlformat=require(_0xe286('0x0'));var rimraf=require(_0xe286('0x1'));var zipdir=require(_0xe286('0x2'));var jsonpatch=require(_0xe286('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe286('0x4'));var Mustache=require(_0xe286('0x5'));var util=require(_0xe286('0x6'));var path=require('path');var sox=require(_0xe286('0x7'));var csv=require('to-csv');var ejs=require(_0xe286('0x8'));var fs=require('fs');var fs_extra=require(_0xe286('0x9'));var _=require('lodash');var squel=require(_0xe286('0xa'));var crypto=require(_0xe286('0xb'));var jsforce=require(_0xe286('0xc'));var deskjs=require(_0xe286('0xd'));var toCsv=require(_0xe286('0xe'));var querystring=require(_0xe286('0xf'));var Papa=require(_0xe286('0x10'));var Redis=require(_0xe286('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe286('0x12'));var as=require(_0xe286('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe286('0x14'))(_0xe286('0x15'));var utils=require(_0xe286('0x16'));var config=require(_0xe286('0x17'));var licenseUtil=require(_0xe286('0x18'));var db=require(_0xe286('0x19'))['db'];function respondWithStatusCode(_0x13a5d3,_0x48830f){_0x48830f=_0x48830f||0xcc;return function(_0x9bb20a){if(_0x9bb20a){return _0x13a5d3[_0xe286('0x1a')](_0x48830f);}return _0x13a5d3['status'](_0x48830f)[_0xe286('0x1b')]();};}function respondWithResult(_0x55692a,_0x1c2a33){_0x1c2a33=_0x1c2a33||0xc8;return function(_0x260820){if(_0x260820){return _0x55692a['status'](_0x1c2a33)[_0xe286('0x1c')](_0x260820);}};}function respondWithFilteredResult(_0xd02c9a,_0x23d1e0){return function(_0x4afd13){if(_0x4afd13){var _0x2e30c7=typeof _0x23d1e0[_0xe286('0x1d')]===_0xe286('0x1e')&&typeof _0x23d1e0[_0xe286('0x1f')]===_0xe286('0x1e');var _0x5abf43=_0x4afd13[_0xe286('0x20')];var _0x582d39=_0x2e30c7?0x0:_0x23d1e0[_0xe286('0x1d')];var _0x3f483e=_0x2e30c7?_0x4afd13[_0xe286('0x20')]:_0x23d1e0['offset']+_0x23d1e0['limit'];var _0xeb4289;if(_0x3f483e>=_0x5abf43){_0x3f483e=_0x5abf43;_0xeb4289=0xc8;}else{_0xeb4289=0xce;}_0xd02c9a[_0xe286('0x21')](_0xeb4289);return _0xd02c9a[_0xe286('0x22')]('Content-Range',_0x582d39+'-'+_0x3f483e+'/'+_0x5abf43)[_0xe286('0x1c')](_0x4afd13);}return null;};}function patchUpdates(_0xd318ad){return function(_0x58cd92){try{jsonpatch[_0xe286('0x23')](_0x58cd92,_0xd318ad,!![]);}catch(_0x31ff9c){return BPromise[_0xe286('0x24')](_0x31ff9c);}return _0x58cd92[_0xe286('0x25')]();};}function saveUpdates(_0x202157,_0x3b285f){return function(_0x506163){if(_0x506163){return _0x506163[_0xe286('0x26')](_0x202157)[_0xe286('0x27')](function(_0x2e2cfa){return _0x2e2cfa;});}return null;};}function removeEntity(_0x176479,_0x117185){return function(_0x1c6721){if(_0x1c6721){return _0x1c6721[_0xe286('0x28')]()[_0xe286('0x27')](function(){_0x176479[_0xe286('0x21')](0xcc)[_0xe286('0x1b')]();});}};}function handleEntityNotFound(_0x93c89,_0x391ee7){return function(_0x5c00de){if(!_0x5c00de){_0x93c89[_0xe286('0x1a')](0x194);}return _0x5c00de;};}function handleError(_0x5dfb29,_0x27f6ce){_0x27f6ce=_0x27f6ce||0x1f4;return function(_0x47fa50){logger[_0xe286('0x29')](_0x47fa50[_0xe286('0x2a')]);if(_0x47fa50[_0xe286('0x2b')]){delete _0x47fa50[_0xe286('0x2b')];}_0x5dfb29['status'](_0x27f6ce)[_0xe286('0x2c')](_0x47fa50);};}exports[_0xe286('0x2d')]=function(_0x2f6345,_0x256661){var _0x236d20={},_0x176477={},_0x4632c8={'count':0x0,'rows':[]};var _0x51ece5=_['map'](db[_0xe286('0x2e')][_0xe286('0x2f')],function(_0x2cf479){return{'name':_0x2cf479[_0xe286('0x30')],'type':_0x2cf479[_0xe286('0x31')][_0xe286('0x32')]};});_0x176477[_0xe286('0x33')]=_[_0xe286('0x34')](_0x51ece5,_0xe286('0x2b'));_0x176477[_0xe286('0x35')]=_[_0xe286('0x36')](_0x2f6345[_0xe286('0x35')]);_0x176477[_0xe286('0x37')]=_[_0xe286('0x38')](_0x176477[_0xe286('0x33')],_0x176477[_0xe286('0x35')]);_0x236d20[_0xe286('0x39')]=_['intersection'](_0x176477['model'],qs[_0xe286('0x3a')](_0x2f6345[_0xe286('0x35')]['fields']));_0x236d20[_0xe286('0x39')]=_0x236d20[_0xe286('0x39')][_0xe286('0x3b')]?_0x236d20[_0xe286('0x39')]:_0x176477[_0xe286('0x33')];if(!_0x2f6345[_0xe286('0x35')][_0xe286('0x3c')](_0xe286('0x3d'))){_0x236d20[_0xe286('0x1f')]=qs[_0xe286('0x1f')](_0x2f6345[_0xe286('0x35')][_0xe286('0x1f')]);_0x236d20[_0xe286('0x1d')]=qs[_0xe286('0x1d')](_0x2f6345['query'][_0xe286('0x1d')]);}_0x236d20['order']=qs['sort'](_0x2f6345[_0xe286('0x35')][_0xe286('0x3e')]);_0x236d20[_0xe286('0x3f')]=qs['filters'](_[_0xe286('0x40')](_0x2f6345['query'],_0x176477['filters']),_0x51ece5);if(_0x2f6345['query']['filter']){_0x236d20[_0xe286('0x3f')]=_['merge'](_0x236d20[_0xe286('0x3f')],{'$or':_[_0xe286('0x34')](_0x51ece5,function(_0x413138){if(_0x413138[_0xe286('0x31')]!=='VIRTUAL'){var _0xf8e032={};_0xf8e032[_0x413138['name']]={'$like':'%'+_0x2f6345['query'][_0xe286('0x41')]+'%'};return _0xf8e032;}})});}_0x236d20=_[_0xe286('0x42')]({},_0x236d20,_0x2f6345[_0xe286('0x43')]);var _0x546837={'where':_0x236d20[_0xe286('0x3f')]};return db['CmHopperBlack'][_0xe286('0x20')](_0x546837)[_0xe286('0x27')](function(_0x1eb0b3){_0x4632c8[_0xe286('0x20')]=_0x1eb0b3;if(_0x2f6345[_0xe286('0x35')]['includeAll']){_0x236d20[_0xe286('0x44')]=[{'all':!![]}];}return db[_0xe286('0x2e')][_0xe286('0x45')](_0x236d20);})[_0xe286('0x27')](function(_0x40e17b){_0x4632c8[_0xe286('0x46')]=_0x40e17b;return _0x4632c8;})[_0xe286('0x27')](respondWithFilteredResult(_0x256661,_0x236d20))[_0xe286('0x47')](handleError(_0x256661,null));};exports[_0xe286('0x48')]=function(_0x1d3ec4,_0x1f6564){var _0x15c927={'raw':!![],'where':{'id':_0x1d3ec4['params']['id']}},_0x105b59={};_0x105b59[_0xe286('0x33')]=_['keys'](db[_0xe286('0x2e')]['rawAttributes']);_0x105b59['query']=_['keys'](_0x1d3ec4[_0xe286('0x35')]);_0x105b59[_0xe286('0x37')]=_['intersection'](_0x105b59[_0xe286('0x33')],_0x105b59[_0xe286('0x35')]);_0x15c927[_0xe286('0x39')]=_[_0xe286('0x38')](_0x105b59['model'],qs[_0xe286('0x3a')](_0x1d3ec4[_0xe286('0x35')][_0xe286('0x3a')]));_0x15c927['attributes']=_0x15c927[_0xe286('0x39')][_0xe286('0x3b')]?_0x15c927[_0xe286('0x39')]:_0x105b59[_0xe286('0x33')];if(_0x1d3ec4[_0xe286('0x35')][_0xe286('0x49')]){_0x15c927[_0xe286('0x44')]=[{'all':!![]}];}_0x15c927=_[_0xe286('0x42')]({},_0x15c927,_0x1d3ec4[_0xe286('0x43')]);return db[_0xe286('0x2e')]['find'](_0x15c927)[_0xe286('0x27')](handleEntityNotFound(_0x1f6564,null))[_0xe286('0x27')](respondWithResult(_0x1f6564,null))[_0xe286('0x47')](handleError(_0x1f6564,null));};exports[_0xe286('0x26')]=function(_0x14b362,_0x7c014d){if(_0x14b362['body']['id']){delete _0x14b362[_0xe286('0x4a')]['id'];}return db[_0xe286('0x2e')]['find']({'where':{'id':_0x14b362['params']['id']}})[_0xe286('0x27')](handleEntityNotFound(_0x7c014d,null))['then'](saveUpdates(_0x14b362[_0xe286('0x4a')],null))[_0xe286('0x27')](respondWithResult(_0x7c014d,null))[_0xe286('0x47')](handleError(_0x7c014d,null));};exports[_0xe286('0x28')]=function(_0x217d9d,_0x34035d){return db[_0xe286('0x2e')][_0xe286('0x4b')]({'where':{'id':_0x217d9d[_0xe286('0x4c')]['id']}})[_0xe286('0x27')](handleEntityNotFound(_0x34035d,null))['then'](removeEntity(_0x34035d,null))[_0xe286('0x47')](handleError(_0x34035d,null));};exports[_0xe286('0x4d')]=function(_0x46783f,_0x46dadd){return db[_0xe286('0x2e')][_0xe286('0x4d')]()[_0xe286('0x27')](respondWithResult(_0x46dadd,null))[_0xe286('0x47')](handleError(_0x46dadd,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index a96c317..67f0a59 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 _0x478f=['moment','bluebird','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','lodash','../../config/logger','api'];(function(_0x4a1d1c,_0x37f56d){var _0x588863=function(_0x348e50){while(--_0x348e50){_0x4a1d1c['push'](_0x4a1d1c['shift']());}};_0x588863(++_0x37f56d);}(_0x478f,0x81));var _0xf478=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x478f[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0xf478('0x0'));var util=require('util');var logger=require(_0xf478('0x1'))(_0xf478('0x2'));var moment=require(_0xf478('0x3'));var BPromise=require(_0xf478('0x4'));var rp=require(_0xf478('0x5'));var fs=require('fs');var path=require(_0xf478('0x6'));var rimraf=require('rimraf');var config=require(_0xf478('0x7'));var attributes=require(_0xf478('0x8'));module[_0xf478('0x9')]=function(_0x846a9f,_0x198ac5){return _0x846a9f['define'](_0xf478('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6133=['moment','bluebird','request-promise','path','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x546dea,_0x385221){var _0xb9451=function(_0x34f354){while(--_0x34f354){_0x546dea['push'](_0x546dea['shift']());}};_0xb9451(++_0x385221);}(_0x6133,0xed));var _0x3613=function(_0xd10088,_0x35153c){_0xd10088=_0xd10088-0x0;var _0x1fbfb3=_0x6133[_0xd10088];return _0x1fbfb3;};'use strict';var _=require(_0x3613('0x0'));var util=require(_0x3613('0x1'));var logger=require(_0x3613('0x2'))('api');var moment=require(_0x3613('0x3'));var BPromise=require(_0x3613('0x4'));var rp=require(_0x3613('0x5'));var fs=require('fs');var path=require(_0x3613('0x6'));var rimraf=require('rimraf');var config=require(_0x3613('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0x3613('0x8')]=function(_0x210a4e,_0x895cb7){return _0x210a4e[_0x3613('0x9')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','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 76028ce..2cdf857 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 _0x6c66=['then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','map','model','include','UpdateCmHopperBlack','update','body','where','DestroyCmHopperBlack','destroy','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xc4edac,_0x43e311){var _0x6cc19=function(_0x554214){while(--_0x554214){_0xc4edac['push'](_0xc4edac['shift']());}};_0x6cc19(++_0x43e311);}(_0x6c66,0x94));var _0x66c6=function(_0x3c856a,_0xe05453){_0x3c856a=_0x3c856a-0x0;var _0x53f4f4=_0x6c66[_0x3c856a];return _0x53f4f4;};'use strict';var _=require(_0x66c6('0x0'));var util=require(_0x66c6('0x1'));var moment=require('moment');var BPromise=require(_0x66c6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66c6('0x3'))['db'];var utils=require(_0x66c6('0x4'));var logger=require(_0x66c6('0x5'))(_0x66c6('0x6'));var config=require(_0x66c6('0x7'));var jayson=require(_0x66c6('0x8'));var client=jayson[_0x66c6('0x9')][_0x66c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16d2ee,_0x400a4c,_0x58f691){return new BPromise(function(_0x148af2,_0x10b810){return client[_0x66c6('0xb')](_0x16d2ee,_0x58f691)[_0x66c6('0xc')](function(_0x158cbd){logger[_0x66c6('0xd')](_0x66c6('0xe'),_0x400a4c,_0x66c6('0xf'));logger[_0x66c6('0x10')](_0x66c6('0x11'),_0x400a4c,_0x66c6('0xf'),JSON[_0x66c6('0x12')](_0x158cbd));if(_0x158cbd[_0x66c6('0x13')]){if(_0x158cbd[_0x66c6('0x13')][_0x66c6('0x14')]===0x1f4){logger[_0x66c6('0x13')](_0x66c6('0xe'),_0x400a4c,_0x158cbd[_0x66c6('0x13')]['message']);return _0x10b810(_0x158cbd[_0x66c6('0x13')][_0x66c6('0x15')]);}logger['error'](_0x66c6('0xe'),_0x400a4c,_0x158cbd['error'][_0x66c6('0x15')]);return _0x148af2(_0x158cbd[_0x66c6('0x13')][_0x66c6('0x15')]);}else{logger['info'](_0x66c6('0xe'),_0x400a4c,_0x66c6('0xf'));_0x148af2(_0x158cbd[_0x66c6('0x16')][_0x66c6('0x15')]);}})[_0x66c6('0x17')](function(_0x5e3552){logger['error'](_0x66c6('0xe'),_0x400a4c,_0x5e3552);_0x10b810(_0x5e3552);});});}exports[_0x66c6('0x18')]=function(_0x1fd945){var _0x2bcdbb=this;return new Promise(function(_0x47ec8b,_0x2b1097){return db[_0x66c6('0x19')][_0x66c6('0x1a')]({'raw':_0x1fd945[_0x66c6('0x1b')]?_0x1fd945[_0x66c6('0x1b')][_0x66c6('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fd945[_0x66c6('0x1b')]?_0x1fd945[_0x66c6('0x1b')]['where']||null:null,'attributes':_0x1fd945[_0x66c6('0x1b')]?_0x1fd945['options'][_0x66c6('0x1d')]||null:null,'limit':_0x1fd945['options']?_0x1fd945[_0x66c6('0x1b')][_0x66c6('0x1e')]||null:null,'include':_0x1fd945[_0x66c6('0x1b')]?_0x1fd945[_0x66c6('0x1b')]['include']?_[_0x66c6('0x1f')](_0x1fd945[_0x66c6('0x1b')]['include'],function(_0x1730b2){return{'model':db[_0x1730b2[_0x66c6('0x20')]],'as':_0x1730b2['as'],'attributes':_0x1730b2[_0x66c6('0x1d')],'include':_0x1730b2[_0x66c6('0x21')]?_[_0x66c6('0x1f')](_0x1730b2[_0x66c6('0x21')],function(_0x5a8355){return{'model':db[_0x5a8355['model']],'as':_0x5a8355['as'],'attributes':_0x5a8355['attributes'],'include':_0x5a8355[_0x66c6('0x21')]?_['map'](_0x5a8355['include'],function(_0x468fd3){return{'model':db[_0x468fd3[_0x66c6('0x20')]],'as':_0x468fd3['as'],'attributes':_0x468fd3[_0x66c6('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b622f){logger[_0x66c6('0xd')](_0x66c6('0x18'),_0x1fd945);logger[_0x66c6('0x10')](_0x66c6('0x18'),_0x1fd945,JSON[_0x66c6('0x12')](_0x1b622f));_0x47ec8b(_0x1b622f);})['catch'](function(_0xd9c67f){logger[_0x66c6('0x13')]('GetCmHopperBlack',_0xd9c67f['message'],_0x1fd945);_0x2b1097(_0x2bcdbb[_0x66c6('0x13')](0x1f4,_0xd9c67f[_0x66c6('0x15')]));});});};exports[_0x66c6('0x22')]=function(_0x431c57){var _0x50e3c0=this;return new Promise(function(_0x5a0fa5,_0x37e4b7){return db[_0x66c6('0x19')][_0x66c6('0x23')](_0x431c57[_0x66c6('0x24')],{'raw':_0x431c57['options']?_0x431c57[_0x66c6('0x1b')][_0x66c6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x431c57[_0x66c6('0x1b')]?_0x431c57[_0x66c6('0x1b')][_0x66c6('0x25')]||null:null,'attributes':_0x431c57[_0x66c6('0x1b')]?_0x431c57[_0x66c6('0x1b')]['attributes']||null:null,'limit':_0x431c57['options']?_0x431c57[_0x66c6('0x1b')][_0x66c6('0x1e')]||null:null})[_0x66c6('0xc')](function(_0xb39e76){logger['info']('UpdateCmHopperBlack',_0x431c57);logger['debug'](_0x66c6('0x22'),_0x431c57,JSON['stringify'](_0xb39e76));_0x5a0fa5(_0xb39e76);})[_0x66c6('0x17')](function(_0x5b823b){logger['error'](_0x66c6('0x22'),_0x5b823b[_0x66c6('0x15')],_0x431c57);_0x37e4b7(_0x50e3c0[_0x66c6('0x13')](0x1f4,_0x5b823b[_0x66c6('0x15')]));});});};exports[_0x66c6('0x26')]=function(_0x2c1565){var _0x6de4af=this;return new Promise(function(_0x336091,_0x11c5aa){return db[_0x66c6('0x19')][_0x66c6('0x27')]({'where':_0x2c1565['options']?_0x2c1565['options'][_0x66c6('0x25')]||null:null})[_0x66c6('0xc')](function(_0x29cff2){logger[_0x66c6('0xd')](_0x66c6('0x26'),_0x2c1565);logger['debug'](_0x66c6('0x26'),_0x2c1565,JSON['stringify'](_0x29cff2));_0x336091(_0x29cff2);})[_0x66c6('0x17')](function(_0x367b6b){logger[_0x66c6('0x13')]('DestroyCmHopperBlack',_0x367b6b[_0x66c6('0x15')],_0x2c1565);_0x11c5aa(_0x6de4af[_0x66c6('0x13')](0x1f4,_0x367b6b[_0x66c6('0x15')]));});});}; \ No newline at end of file +var _0x2b5f=['then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','map','include','model','attributes','debug','catch','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request'];(function(_0x17e151,_0x5917ee){var _0x2fa985=function(_0x4a3dc1){while(--_0x4a3dc1){_0x17e151['push'](_0x17e151['shift']());}};_0x2fa985(++_0x5917ee);}(_0x2b5f,0x168));var _0xf2b5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2b5f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xf2b5('0x0'));var moment=require(_0xf2b5('0x1'));var BPromise=require(_0xf2b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2b5('0x3'));var db=require(_0xf2b5('0x4'))['db'];var utils=require(_0xf2b5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf2b5('0x6'));var client=jayson[_0xf2b5('0x7')][_0xf2b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x337749,_0x569c45,_0x7a304d){return new BPromise(function(_0x4aeac3,_0x18a345){return client[_0xf2b5('0x9')](_0x337749,_0x7a304d)[_0xf2b5('0xa')](function(_0x53f246){logger[_0xf2b5('0xb')](_0xf2b5('0xc'),_0x569c45,_0xf2b5('0xd'));logger['debug'](_0xf2b5('0xe'),_0x569c45,_0xf2b5('0xd'),JSON[_0xf2b5('0xf')](_0x53f246));if(_0x53f246['error']){if(_0x53f246[_0xf2b5('0x10')]['code']===0x1f4){logger[_0xf2b5('0x10')](_0xf2b5('0xc'),_0x569c45,_0x53f246[_0xf2b5('0x10')]['message']);return _0x18a345(_0x53f246[_0xf2b5('0x10')][_0xf2b5('0x11')]);}logger[_0xf2b5('0x10')](_0xf2b5('0xc'),_0x569c45,_0x53f246[_0xf2b5('0x10')]['message']);return _0x4aeac3(_0x53f246[_0xf2b5('0x10')][_0xf2b5('0x11')]);}else{logger['info'](_0xf2b5('0xc'),_0x569c45,_0xf2b5('0xd'));_0x4aeac3(_0x53f246[_0xf2b5('0x12')][_0xf2b5('0x11')]);}})['catch'](function(_0x20a646){logger[_0xf2b5('0x10')](_0xf2b5('0xc'),_0x569c45,_0x20a646);_0x18a345(_0x20a646);});});}exports[_0xf2b5('0x13')]=function(_0x28aa69){var _0x389f9a=this;return new Promise(function(_0x10e151,_0x56d9ad){return db[_0xf2b5('0x14')][_0xf2b5('0x15')]({'raw':_0x28aa69['options']?_0x28aa69[_0xf2b5('0x16')][_0xf2b5('0x17')]===undefined?!![]:![]:!![],'where':_0x28aa69['options']?_0x28aa69['options'][_0xf2b5('0x18')]||null:null,'attributes':_0x28aa69[_0xf2b5('0x16')]?_0x28aa69[_0xf2b5('0x16')]['attributes']||null:null,'limit':_0x28aa69[_0xf2b5('0x16')]?_0x28aa69[_0xf2b5('0x16')][_0xf2b5('0x19')]||null:null,'include':_0x28aa69[_0xf2b5('0x16')]?_0x28aa69[_0xf2b5('0x16')]['include']?_[_0xf2b5('0x1a')](_0x28aa69[_0xf2b5('0x16')][_0xf2b5('0x1b')],function(_0xc3ce24){return{'model':db[_0xc3ce24[_0xf2b5('0x1c')]],'as':_0xc3ce24['as'],'attributes':_0xc3ce24[_0xf2b5('0x1d')],'include':_0xc3ce24[_0xf2b5('0x1b')]?_[_0xf2b5('0x1a')](_0xc3ce24['include'],function(_0x2b5fb5){return{'model':db[_0x2b5fb5[_0xf2b5('0x1c')]],'as':_0x2b5fb5['as'],'attributes':_0x2b5fb5['attributes'],'include':_0x2b5fb5[_0xf2b5('0x1b')]?_[_0xf2b5('0x1a')](_0x2b5fb5[_0xf2b5('0x1b')],function(_0x49cce9){return{'model':db[_0x49cce9['model']],'as':_0x49cce9['as'],'attributes':_0x49cce9[_0xf2b5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf2b5('0xa')](function(_0xb0b769){logger[_0xf2b5('0xb')]('GetCmHopperBlack',_0x28aa69);logger[_0xf2b5('0x1e')](_0xf2b5('0x13'),_0x28aa69,JSON[_0xf2b5('0xf')](_0xb0b769));_0x10e151(_0xb0b769);})[_0xf2b5('0x1f')](function(_0x11f136){logger[_0xf2b5('0x10')](_0xf2b5('0x13'),_0x11f136['message'],_0x28aa69);_0x56d9ad(_0x389f9a[_0xf2b5('0x10')](0x1f4,_0x11f136[_0xf2b5('0x11')]));});});};exports[_0xf2b5('0x20')]=function(_0x3e1af8){var _0x81e2f=this;return new Promise(function(_0x5bf99c,_0x93ff9a){return db[_0xf2b5('0x14')][_0xf2b5('0x21')](_0x3e1af8[_0xf2b5('0x22')],{'raw':_0x3e1af8['options']?_0x3e1af8[_0xf2b5('0x16')][_0xf2b5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e1af8['options']?_0x3e1af8['options'][_0xf2b5('0x18')]||null:null,'attributes':_0x3e1af8['options']?_0x3e1af8[_0xf2b5('0x16')]['attributes']||null:null,'limit':_0x3e1af8[_0xf2b5('0x16')]?_0x3e1af8['options'][_0xf2b5('0x19')]||null:null})[_0xf2b5('0xa')](function(_0x4f7ce6){logger[_0xf2b5('0xb')](_0xf2b5('0x20'),_0x3e1af8);logger[_0xf2b5('0x1e')](_0xf2b5('0x20'),_0x3e1af8,JSON[_0xf2b5('0xf')](_0x4f7ce6));_0x5bf99c(_0x4f7ce6);})[_0xf2b5('0x1f')](function(_0x38e986){logger['error'](_0xf2b5('0x20'),_0x38e986[_0xf2b5('0x11')],_0x3e1af8);_0x93ff9a(_0x81e2f[_0xf2b5('0x10')](0x1f4,_0x38e986[_0xf2b5('0x11')]));});});};exports[_0xf2b5('0x23')]=function(_0x286eee){var _0x3e07b9=this;return new Promise(function(_0x8723bf,_0x397caf){return db['CmHopperBlack'][_0xf2b5('0x24')]({'where':_0x286eee[_0xf2b5('0x16')]?_0x286eee[_0xf2b5('0x16')][_0xf2b5('0x18')]||null:null})[_0xf2b5('0xa')](function(_0x3bf55e){logger['info'](_0xf2b5('0x23'),_0x286eee);logger[_0xf2b5('0x1e')](_0xf2b5('0x23'),_0x286eee,JSON[_0xf2b5('0xf')](_0x3bf55e));_0x8723bf(_0x3bf55e);})[_0xf2b5('0x1f')](function(_0x241f76){logger[_0xf2b5('0x10')](_0xf2b5('0x23'),_0x241f76[_0xf2b5('0x11')],_0x286eee);_0x397caf(_0x3e07b9[_0xf2b5('0x10')](0x1f4,_0x241f76[_0xf2b5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 6f29ade..a6a0c9f 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 _0x4975=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x4975,0x86));var _0x5497=function(_0x587373,_0x1fa51e){_0x587373=_0x587373-0x0;var _0x244a97=_0x4975[_0x587373];return _0x244a97;};'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')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x33af=['isAuthenticated','describe','show','put','/:id','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','index','/describe'];(function(_0x1f5c94,_0x2be990){var _0x43b6c5=function(_0x596c07){while(--_0x596c07){_0x1f5c94['push'](_0x1f5c94['shift']());}};_0x43b6c5(++_0x2be990);}(_0x33af,0xec));var _0xf33a=function(_0x22123d,_0x45ae06){_0x22123d=_0x22123d-0x0;var _0xeabce1=_0x33af[_0x22123d];return _0xeabce1;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0xe')](_0xf33a('0xf'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router['delete']('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0x11')]);module[_0xf33a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index a339663..a57e40a 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 _0xba39=['DATE','getDataValue','endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize','INTEGER','STRING'];(function(_0x5ace65,_0xc17a40){var _0x1738fb=function(_0x48bf90){while(--_0x48bf90){_0x5ace65['push'](_0x5ace65['shift']());}};_0x1738fb(++_0xc17a40);}(_0xba39,0x97));var _0x9ba3=function(_0x2b7466,_0x39193f){_0x2b7466=_0x2b7466-0x0;var _0x38241a=_0xba39[_0x2b7466];return _0x38241a;};'use strict';var Sequelize=require(_0x9ba3('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x9ba3('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x9ba3('0x2')]},'scheduledat':{'type':Sequelize[_0x9ba3('0x3')]},'countbusyretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9ba3('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x9ba3('0x2')]},'originatecalleridname':{'type':Sequelize[_0x9ba3('0x2')]},'calleridnum':{'type':Sequelize[_0x9ba3('0x2')]},'calleridname':{'type':Sequelize[_0x9ba3('0x2')]},'starttime':{'type':Sequelize[_0x9ba3('0x3')]},'responsetime':{'type':Sequelize[_0x9ba3('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x9ba3('0x3')]},'ringtime':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x9ba3('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9ba3('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x9ba3('0x3')],'set':function(_0x2b7f43){var _0x1489d3=this[_0x9ba3('0x4')](_0x9ba3('0x5'));if(_0x1489d3&&_0x2b7f43){this[_0x9ba3('0x6')](_0x9ba3('0x7'),moment(_0x2b7f43)['diff'](moment(_0x1489d3),_0x9ba3('0x8')));}return this['setDataValue'](_0x9ba3('0x9'),_0x2b7f43);}},'amd':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9ba3('0x3')]},'callback':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9ba3('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9ba3('0x3')]},'deleted':{'type':Sequelize[_0x9ba3('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9ba3('0x3')]},'recallme':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfa32=['sequelize','moment','INTEGER','DATE','STRING','endtime','setDataValue','seconds','dispositionat','BOOLEAN'];(function(_0x1ea7c2,_0x5b04e2){var _0x147c2e=function(_0x5485c3){while(--_0x5485c3){_0x1ea7c2['push'](_0x1ea7c2['shift']());}};_0x147c2e(++_0x5b04e2);}(_0xfa32,0x17c));var _0x2fa3=function(_0x33ab7b,_0x29403b){_0x33ab7b=_0x33ab7b-0x0;var _0x20ebb4=_0xfa32[_0x33ab7b];return _0x20ebb4;};'use strict';var Sequelize=require(_0x2fa3('0x0'));var moment=require(_0x2fa3('0x1'));module['exports']={'state':{'type':Sequelize[_0x2fa3('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2fa3('0x3')]},'countbusyretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2fa3('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x2fa3('0x4')]},'originatecalleridname':{'type':Sequelize[_0x2fa3('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2fa3('0x4')]},'starttime':{'type':Sequelize[_0x2fa3('0x3')]},'responsetime':{'type':Sequelize[_0x2fa3('0x3')]},'answertime':{'type':Sequelize[_0x2fa3('0x3')]},'droptime':{'type':Sequelize[_0x2fa3('0x3')]},'endtime':{'type':Sequelize[_0x2fa3('0x3')]},'ringtime':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2fa3('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2fa3('0x4')]},'membername':{'type':Sequelize[_0x2fa3('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x2fa3('0x4')]},'secondDisposition':{'type':Sequelize[_0x2fa3('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2fa3('0x4')]},'dispositionat':{'type':Sequelize[_0x2fa3('0x3')],'set':function(_0x13aab8){var _0x5594f3=this['getDataValue'](_0x2fa3('0x5'));if(_0x5594f3&&_0x13aab8){this[_0x2fa3('0x6')]('followuptime',moment(_0x13aab8)['diff'](moment(_0x5594f3),_0x2fa3('0x7')));}return this[_0x2fa3('0x6')](_0x2fa3('0x8'),_0x13aab8);}},'amd':{'type':Sequelize[_0x2fa3('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x2fa3('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2fa3('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2fa3('0x3')]},'deleted':{'type':Sequelize[_0x2fa3('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2fa3('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2fa3('0x2')],'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 4c6fed3..9b71e1d 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 _0x187d=['state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','select','from','cm_hopper','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','into','CampaignId','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','toString'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x187d,0x93));var _0xd187=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x187d[_0x5783f4];return _0x28e380;};'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'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':!![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')]()[_0xd187('0x3f')](respondWithResult(_0x3f5def,null))['catch'](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x2657be,_0x4523c8){if(_0x2657be[_0xd187('0x48')][_0xd187('0x49')]){delete _0x2657be['body'][_0xd187('0x49')];}return db[_0xd187('0x2d')]['find']({'where':{'uniqueid':_0x2657be[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x4523c8,null))['then'](saveUpdates(_0x2657be['body'],null))['then'](respondWithResult(_0x4523c8,null))['catch'](handleError(_0x4523c8,null));};exports[_0xd187('0x4a')]=function(_0x22f432,_0x12d448,_0x1bcc3a){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x22f432[_0xd187('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0xd187('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x4f')))),_0xd187('0x50')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x52')))),'congestionContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd187('0x53')],[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd187('0x56')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x12d448,null))[_0xd187('0x3f')](respondWithResult(_0x12d448,null))[_0xd187('0x41')](handleError(_0x12d448,null));};exports[_0xd187('0x59')]=function(_0x23271b,_0x288a04,_0x39934c){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'CampaignId':_0x23271b[_0xd187('0x43')]['id']},'attributes':[[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x5a')))),_0xd187('0x4e')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x52')))),_0xd187('0x5b')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xd187('0x5c')))),_0xd187('0x53')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x5d')))),'reCallContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x288a04,null))['then'](respondWithResult(_0x288a04,null))[_0xd187('0x41')](handleError(_0x288a04,null));};exports[_0xd187('0x5e')]=function(_0x52e364,_0x569959,_0x3bca83){return db['VoiceQueue'][_0xd187('0x46')]({'where':{'id':_0x52e364[_0xd187('0x43')]['id']}})['then'](handleEntityNotFound(_0x569959,null))[_0xd187('0x3f')](function(_0x570c1c){var _0x317bc3;if(_0x570c1c){_0x317bc3=squel['insert']()['into']('cm_hopper')[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x64'),_0xd187('0x65'),_0xd187('0x66')],squel['select']()[_0xd187('0x67')](_0xd187('0x68'),_0xd187('0x60'))['field'](_0xd187('0x69'),_0xd187('0x61'))[_0xd187('0x67')](_0xd187('0x6a'),'ContactId')[_0xd187('0x67')](_0xd187('0x6b'),'ListId')[_0xd187('0x67')](_0xd187('0x6c'),_0xd187('0x64'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')]('NOW()',_0xd187('0x66'))['from']('cm_hopper_final')['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x6f'),_0x52e364[_0xd187('0x48')]['state'][_0xd187('0x6e')]())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x60'))[_0xd187('0x72')](_0xd187('0x73'))['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x74'))[_0xd187('0x72')](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x6d'),_0x52e364['params']['id']['toString']())[_0xd187('0x39')](_0xd187('0x76')))[_0xd187('0x77')](_0xd187('0x62')))[_0xd187('0x6e')]();return db[_0xd187('0x4c')]['query'](_0x317bc3);}return[];})[_0xd187('0x3f')](respondWithResult(_0x569959,null))['catch'](handleError(_0x569959,null));};exports[_0xd187('0x78')]=function(_0x520f86,_0x5cbfa6,_0x304117){return db['Campaign'][_0xd187('0x46')]({'where':{'id':_0x520f86[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x5cbfa6,null))[_0xd187('0x3f')](function(_0x1b93db){var _0x13a362;if(_0x1b93db){_0x13a362=squel[_0xd187('0x79')]()[_0xd187('0x7a')](_0xd187('0x73'))[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x7b'),'createdAt',_0xd187('0x66')],squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x68'),'phone')[_0xd187('0x67')](_0xd187('0x69'),'scheduledAt')['field'](_0xd187('0x6a'),_0xd187('0x62'))[_0xd187('0x67')](_0xd187('0x6b'),_0xd187('0x63'))[_0xd187('0x67')]('ANY_VALUE(CampaignId)',_0xd187('0x7b'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')](_0xd187('0x69'),_0xd187('0x66'))['from']('cm_hopper_final')[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id']['toString']())[_0xd187('0x39')](_0xd187('0x6f'),_0x520f86[_0xd187('0x48')][_0xd187('0x7d')]['toString']())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')['from'](_0xd187('0x73'))[_0xd187('0x39')]('CampaignId\x20=\x20?',_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()['field'](_0xd187('0x74'))['from'](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x76')))['group'](_0xd187('0x62')))[_0xd187('0x6e')]();return db['sequelize'][_0xd187('0x31')](_0x13a362);}return[];})[_0xd187('0x3f')](respondWithResult(_0x5cbfa6,null))['catch'](handleError(_0x5cbfa6,null));};exports[_0xd187('0x7e')]=function(_0x3bd1d8,_0x224312,_0x45b522){return db[_0xd187('0x7f')][_0xd187('0x80')]({'where':{'VoiceQueueId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x64')],'CampaignId':_0x3bd1d8['body'][_0xd187('0x7b')],'ContactId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x62')]}})[_0xd187('0x3f')](handleEntityNotFound(_0x224312,null))[_0xd187('0x3f')](function(_0x400a9){if(_0x400a9){return _0x400a9;}return null;})['then'](respondWithResult(_0x224312,null))['catch'](handleError(_0x224312,null));}; \ No newline at end of file +var _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x28080b,_0x1bc499){var _0x34fd53=function(_0x34455f){while(--_0x34455f){_0x28080b['push'](_0x28080b['shift']());}};_0x34fd53(++_0x1bc499);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index cc52715..72deee6 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 _0x6884=['util','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0xdae187,_0x4606c5){var _0x55f0ac=function(_0x56c812){while(--_0x56c812){_0xdae187['push'](_0xdae187['shift']());}};_0x55f0ac(++_0x4606c5);}(_0x6884,0x179));var _0x4688=function(_0x444d90,_0x11c679){_0x444d90=_0x444d90-0x0;var _0x3a8344=_0x6884[_0x444d90];return _0x3a8344;};'use strict';var _=require(_0x4688('0x0'));var util=require(_0x4688('0x1'));var logger=require(_0x4688('0x2'))(_0x4688('0x3'));var moment=require(_0x4688('0x4'));var BPromise=require(_0x4688('0x5'));var rp=require(_0x4688('0x6'));var fs=require('fs');var path=require(_0x4688('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4688('0x8'));module[_0x4688('0x9')]=function(_0x1aae00,_0x5be644){return _0x1aae00['define'](_0x4688('0xa'),attributes,{'tableName':_0x4688('0xb'),'paranoid':![],'indexes':[{'name':_0x4688('0xc'),'fields':['calleridnum']},{'name':_0x4688('0xd'),'fields':[_0x4688('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f61=['define','CmHopperFinal','calleridnum','uniqueid','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x4c5207,_0x112d7a){var _0x57e4bc=function(_0x3e72ba){while(--_0x3e72ba){_0x4c5207['push'](_0x4c5207['shift']());}};_0x57e4bc(++_0x112d7a);}(_0x0f61,0x12f));var _0x10f6=function(_0x3d91bc,_0x1ee4bc){_0x3d91bc=_0x3d91bc-0x0;var _0x3b4667=_0x0f61[_0x3d91bc];return _0x3b4667;};'use strict';var _=require('lodash');var util=require(_0x10f6('0x0'));var logger=require(_0x10f6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x10f6('0x2'));var rp=require(_0x10f6('0x3'));var fs=require('fs');var path=require(_0x10f6('0x4'));var rimraf=require(_0x10f6('0x5'));var config=require(_0x10f6('0x6'));var attributes=require(_0x10f6('0x7'));module[_0x10f6('0x8')]=function(_0x2ed399,_0x93409){return _0x2ed399[_0x10f6('0x9')](_0x10f6('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x10f6('0xb'),'fields':[_0x10f6('0xb')]},{'name':_0x10f6('0xc'),'fields':[_0x10f6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 6267b9c..726f216 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(_0x439367,_0x437ee1){var _0x442e7e=function(_0x217066){while(--_0x217066){_0x439367['push'](_0x439367['shift']());}};_0x442e7e(++_0x437ee1);}(_0x7a54,0x106));var _0x47a5=function(_0x4a3e52,_0x29da47){_0x4a3e52=_0x4a3e52-0x0;var _0x18337=_0x7a54[_0x4a3e52];return _0x18337;};'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 _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(_0x30a386,_0x1c006c){var _0xe31540=function(_0x598737){while(--_0x598737){_0x30a386['push'](_0x30a386['shift']());}};_0xe31540(++_0x1c006c);}(_0x7a54,0x106));var _0x47a5=function(_0x1556ca,_0x41bda7){_0x1556ca=_0x1556ca-0x0;var _0x112a77=_0x7a54[_0x1556ca];return _0x112a77;};'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 diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 7322074..27bbb30 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 _0x8948=['countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','describe','/:id','show','/voice/queue/countAttributes/:id'];(function(_0x52cb32,_0x16f826){var _0x30a471=function(_0x1a0e86){while(--_0x1a0e86){_0x52cb32['push'](_0x52cb32['shift']());}};_0x30a471(++_0x16f826);}(_0x8948,0xa6));var _0x8894=function(_0x3bad75,_0xee992a){_0x3bad75=_0x3bad75-0x0;var _0x15e2ee=_0x8948[_0x3bad75];return _0x15e2ee;};'use strict';var multer=require('multer');var util=require(_0x8894('0x0'));var path=require(_0x8894('0x1'));var timeout=require(_0x8894('0x2'));var express=require(_0x8894('0x3'));var router=express[_0x8894('0x4')]();var fs_extra=require(_0x8894('0x5'));var auth=require(_0x8894('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8894('0x7'));var controller=require(_0x8894('0x8'));router['get']('/',auth[_0x8894('0x9')](),controller[_0x8894('0xa')]);router[_0x8894('0xb')]('/describe',auth[_0x8894('0x9')](),controller[_0x8894('0xc')]);router['get'](_0x8894('0xd'),auth['isAuthenticated'](),controller[_0x8894('0xe')]);router[_0x8894('0xb')](_0x8894('0xf'),auth[_0x8894('0x9')](),controller[_0x8894('0x10')]);router[_0x8894('0xb')](_0x8894('0x11'),auth['isAuthenticated'](),controller[_0x8894('0x12')]);router[_0x8894('0x13')](_0x8894('0x14'),auth[_0x8894('0x9')](),controller[_0x8894('0x15')]);router[_0x8894('0x13')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x8894('0x16')]);router['post'](_0x8894('0x17'),auth[_0x8894('0x9')](),controller[_0x8894('0x18')]);router['put'](_0x8894('0xd'),auth[_0x8894('0x9')](),controller[_0x8894('0x19')]);module['exports']=router; \ No newline at end of file +var _0x7cfa=['index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','checkContactHopper','update','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated'];(function(_0x3a355d,_0x26de2a){var _0x37aa3b=function(_0x42c21a){while(--_0x42c21a){_0x3a355d['push'](_0x3a355d['shift']());}};_0x37aa3b(++_0x26de2a);}(_0x7cfa,0x137));var _0xa7cf=function(_0x57022c,_0x4878eb){_0x57022c=_0x57022c-0x0;var _0x5069f4=_0x7cfa[_0x57022c];return _0x5069f4;};'use strict';var multer=require(_0xa7cf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa7cf('0x1'));var express=require(_0xa7cf('0x2'));var router=express[_0xa7cf('0x3')]();var fs_extra=require(_0xa7cf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa7cf('0x5'));var config=require('../../config/environment');var controller=require(_0xa7cf('0x6'));router[_0xa7cf('0x7')]('/',auth[_0xa7cf('0x8')](),controller[_0xa7cf('0x9')]);router[_0xa7cf('0x7')](_0xa7cf('0xa'),auth[_0xa7cf('0x8')](),controller[_0xa7cf('0xb')]);router[_0xa7cf('0x7')](_0xa7cf('0xc'),auth[_0xa7cf('0x8')](),controller['show']);router[_0xa7cf('0x7')](_0xa7cf('0xd'),auth['isAuthenticated'](),controller[_0xa7cf('0xe')]);router[_0xa7cf('0x7')](_0xa7cf('0xf'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0xa7cf('0x10')](_0xa7cf('0x11'),auth[_0xa7cf('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xa7cf('0x10')]('/voice/campaign/moveContacts/:id',auth[_0xa7cf('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router['post']('/checkContactHopper',auth['isAuthenticated'](),controller[_0xa7cf('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa7cf('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 57267a6..9b2fba7 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 _0x800c=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0xdd9039,_0x5be390){var _0xeb229b=function(_0x5eb22a){while(--_0x5eb22a){_0xdd9039['push'](_0xdd9039['shift']());}};_0xeb229b(++_0x5be390);}(_0x800c,0x1a1));var _0xc800=function(_0x164dd3,_0x90805c){_0x164dd3=_0x164dd3-0x0;var _0x5bb448=_0x800c[_0x164dd3];return _0x5bb448;};'use strict';var Sequelize=require(_0xc800('0x0'));module[_0xc800('0x1')]={'state':{'type':Sequelize[_0xc800('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc800('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc800('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xc800('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc800('0x3')]},'starttime':{'type':Sequelize[_0xc800('0x4')]},'responsetime':{'type':Sequelize[_0xc800('0x4')]},'answertime':{'type':Sequelize[_0xc800('0x4')]},'droptime':{'type':Sequelize[_0xc800('0x4')]},'endtime':{'type':Sequelize[_0xc800('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xc800('0x3')]},'campaigntype':{'type':Sequelize[_0xc800('0x3')]},'membername':{'type':Sequelize[_0xc800('0x3')]},'reason':{'type':Sequelize[_0xc800('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc800('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xc800('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc800('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc800('0x4')]},'recallme':{'type':Sequelize[_0xc800('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc800('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe41c=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x127407,_0xce29ea){var _0x11858d=function(_0x2f08f2){while(--_0x2f08f2){_0x127407['push'](_0x127407['shift']());}};_0x11858d(++_0xce29ea);}(_0xe41c,0xb8));var _0xce41=function(_0x2ec356,_0x3f55c7){_0x2ec356=_0x2ec356-0x0;var _0x41ad23=_0xe41c[_0x2ec356];return _0x41ad23;};'use strict';var Sequelize=require(_0xce41('0x0'));module[_0xce41('0x1')]={'state':{'type':Sequelize[_0xce41('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xce41('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xce41('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xce41('0x3')]},'calleridnum':{'type':Sequelize[_0xce41('0x3')]},'calleridname':{'type':Sequelize[_0xce41('0x3')]},'starttime':{'type':Sequelize[_0xce41('0x4')]},'responsetime':{'type':Sequelize[_0xce41('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xce41('0x4')]},'ringtime':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xce41('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xce41('0x3')]},'membername':{'type':Sequelize[_0xce41('0x3')]},'reason':{'type':Sequelize[_0xce41('0x3')]},'amd':{'type':Sequelize[_0xce41('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xce41('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xce41('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xce41('0x4')]},'recallme':{'type':Sequelize[_0xce41('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xce41('0x4')]},'edited':{'type':Sequelize[_0xce41('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index c025aa8..3d318a5 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 _0xdd03=['send','index','CmHopperHistory','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','findAll','show','length','includeAll','include','merge','find','catch','create','describe','body','uniqueid','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd03,0x103));var _0x3dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd03[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3dd0('0x0'));var rimraf=require(_0x3dd0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3dd0('0x2'));var moment=require('moment');var BPromise=require(_0x3dd0('0x3'));var Mustache=require(_0x3dd0('0x4'));var util=require(_0x3dd0('0x5'));var path=require(_0x3dd0('0x6'));var sox=require(_0x3dd0('0x7'));var csv=require('to-csv');var ejs=require(_0x3dd0('0x8'));var fs=require('fs');var fs_extra=require(_0x3dd0('0x9'));var _=require(_0x3dd0('0xa'));var squel=require(_0x3dd0('0xb'));var crypto=require('crypto');var jsforce=require(_0x3dd0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3dd0('0xd'));var querystring=require(_0x3dd0('0xe'));var Papa=require(_0x3dd0('0xf'));var Redis=require(_0x3dd0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3dd0('0x11'));var as=require(_0x3dd0('0x12'));var hardwareService=require(_0x3dd0('0x13'));var logger=require('../../config/logger')(_0x3dd0('0x14'));var utils=require('../../config/utils');var config=require(_0x3dd0('0x15'));var licenseUtil=require(_0x3dd0('0x16'));var db=require(_0x3dd0('0x17'))['db'];function respondWithStatusCode(_0x28b909,_0x11cc26){_0x11cc26=_0x11cc26||0xcc;return function(_0x2c4af7){if(_0x2c4af7){return _0x28b909['sendStatus'](_0x11cc26);}return _0x28b909[_0x3dd0('0x18')](_0x11cc26)['end']();};}function respondWithResult(_0x5dbce5,_0x16bf10){_0x16bf10=_0x16bf10||0xc8;return function(_0x2b513f){if(_0x2b513f){return _0x5dbce5[_0x3dd0('0x18')](_0x16bf10)[_0x3dd0('0x19')](_0x2b513f);}};}function respondWithFilteredResult(_0x3b3d8d,_0xce4761){return function(_0x448920){if(_0x448920){var _0x5ed48c=typeof _0xce4761[_0x3dd0('0x1a')]===_0x3dd0('0x1b')&&typeof _0xce4761['limit']==='undefined';var _0x393529=_0x448920['count'];var _0x5410dd=_0x5ed48c?0x0:_0xce4761[_0x3dd0('0x1a')];var _0x42f1b8=_0x5ed48c?_0x448920[_0x3dd0('0x1c')]:_0xce4761['offset']+_0xce4761[_0x3dd0('0x1d')];var _0x3c9d94;if(_0x42f1b8>=_0x393529){_0x42f1b8=_0x393529;_0x3c9d94=0xc8;}else{_0x3c9d94=0xce;}_0x3b3d8d['status'](_0x3c9d94);return _0x3b3d8d[_0x3dd0('0x1e')](_0x3dd0('0x1f'),_0x5410dd+'-'+_0x42f1b8+'/'+_0x393529)[_0x3dd0('0x19')](_0x448920);}return null;};}function patchUpdates(_0x39808c){return function(_0x578120){try{jsonpatch[_0x3dd0('0x20')](_0x578120,_0x39808c,!![]);}catch(_0xc535b0){return BPromise[_0x3dd0('0x21')](_0xc535b0);}return _0x578120[_0x3dd0('0x22')]();};}function saveUpdates(_0x2992bf,_0x27be4a){return function(_0x959a83){if(_0x959a83){return _0x959a83[_0x3dd0('0x23')](_0x2992bf)['then'](function(_0xd09d3){return _0xd09d3;});}return null;};}function removeEntity(_0x420039,_0x49ad59){return function(_0x10f25b){if(_0x10f25b){return _0x10f25b[_0x3dd0('0x24')]()[_0x3dd0('0x25')](function(){_0x420039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ed26,_0x19c0f9){return function(_0x2ff583){if(!_0x2ff583){_0x20ed26[_0x3dd0('0x26')](0x194);}return _0x2ff583;};}function handleError(_0x2c57ca,_0x1b4995){_0x1b4995=_0x1b4995||0x1f4;return function(_0x188faa){logger[_0x3dd0('0x27')](_0x188faa['stack']);if(_0x188faa[_0x3dd0('0x28')]){delete _0x188faa['name'];}_0x2c57ca[_0x3dd0('0x18')](_0x1b4995)[_0x3dd0('0x29')](_0x188faa);};}exports[_0x3dd0('0x2a')]=function(_0x5d6ca7,_0x221e70){var _0x2d9277={},_0x2d99e2={},_0x52733e={'count':0x0,'rows':[]};var _0x1869e3=_['map'](db[_0x3dd0('0x2b')][_0x3dd0('0x2c')],function(_0x1d5d2a){return{'name':_0x1d5d2a[_0x3dd0('0x2d')],'type':_0x1d5d2a[_0x3dd0('0x2e')]['key']};});_0x2d99e2[_0x3dd0('0x2f')]=_[_0x3dd0('0x30')](_0x1869e3,'name');_0x2d99e2[_0x3dd0('0x31')]=_[_0x3dd0('0x32')](_0x5d6ca7[_0x3dd0('0x31')]);_0x2d99e2[_0x3dd0('0x33')]=_[_0x3dd0('0x34')](_0x2d99e2[_0x3dd0('0x2f')],_0x2d99e2[_0x3dd0('0x31')]);_0x2d9277[_0x3dd0('0x35')]=_[_0x3dd0('0x34')](_0x2d99e2[_0x3dd0('0x2f')],qs[_0x3dd0('0x36')](_0x5d6ca7['query'][_0x3dd0('0x36')]));_0x2d9277[_0x3dd0('0x35')]=_0x2d9277['attributes']['length']?_0x2d9277[_0x3dd0('0x35')]:_0x2d99e2[_0x3dd0('0x2f')];if(!_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x37')]('nolimit')){_0x2d9277[_0x3dd0('0x1d')]=qs[_0x3dd0('0x1d')](_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x1d')]);_0x2d9277[_0x3dd0('0x1a')]=qs['offset'](_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x1a')]);}_0x2d9277[_0x3dd0('0x38')]=qs[_0x3dd0('0x39')](_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x39')]);_0x2d9277['where']=qs[_0x3dd0('0x33')](_[_0x3dd0('0x3a')](_0x5d6ca7[_0x3dd0('0x31')],_0x2d99e2[_0x3dd0('0x33')]),_0x1869e3);if(_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x3b')]){_0x2d9277[_0x3dd0('0x3c')]=_['merge'](_0x2d9277['where'],{'$or':_[_0x3dd0('0x30')](_0x1869e3,function(_0x41573e){if(_0x41573e['type']!==_0x3dd0('0x3d')){var _0x56b48d={};_0x56b48d[_0x41573e[_0x3dd0('0x28')]]={'$like':'%'+_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x3b')]+'%'};return _0x56b48d;}})});}_0x2d9277=_['merge']({},_0x2d9277,_0x5d6ca7[_0x3dd0('0x3e')]);var _0x97193d={'where':_0x2d9277[_0x3dd0('0x3c')]};return db['CmHopperHistory'][_0x3dd0('0x1c')](_0x97193d)[_0x3dd0('0x25')](function(_0x26818e){_0x52733e[_0x3dd0('0x1c')]=_0x26818e;if(_0x5d6ca7[_0x3dd0('0x31')]['includeAll']){_0x2d9277['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x3dd0('0x3f')](_0x2d9277);})[_0x3dd0('0x25')](function(_0x471d1c){_0x52733e['rows']=_0x471d1c;return _0x52733e;})[_0x3dd0('0x25')](respondWithFilteredResult(_0x221e70,_0x2d9277))['catch'](handleError(_0x221e70,null));};exports[_0x3dd0('0x40')]=function(_0x30a75e,_0x2d454f){var _0x422c21={'raw':!![],'where':{'id':_0x30a75e['params']['id']}},_0x11ae12={};_0x11ae12[_0x3dd0('0x2f')]=_['keys'](db[_0x3dd0('0x2b')][_0x3dd0('0x2c')]);_0x11ae12[_0x3dd0('0x31')]=_['keys'](_0x30a75e[_0x3dd0('0x31')]);_0x11ae12[_0x3dd0('0x33')]=_[_0x3dd0('0x34')](_0x11ae12[_0x3dd0('0x2f')],_0x11ae12[_0x3dd0('0x31')]);_0x422c21[_0x3dd0('0x35')]=_[_0x3dd0('0x34')](_0x11ae12[_0x3dd0('0x2f')],qs[_0x3dd0('0x36')](_0x30a75e[_0x3dd0('0x31')][_0x3dd0('0x36')]));_0x422c21['attributes']=_0x422c21['attributes'][_0x3dd0('0x41')]?_0x422c21[_0x3dd0('0x35')]:_0x11ae12[_0x3dd0('0x2f')];if(_0x30a75e['query'][_0x3dd0('0x42')]){_0x422c21[_0x3dd0('0x43')]=[{'all':!![]}];}_0x422c21=_[_0x3dd0('0x44')]({},_0x422c21,_0x30a75e[_0x3dd0('0x3e')]);return db['CmHopperHistory'][_0x3dd0('0x45')](_0x422c21)[_0x3dd0('0x25')](handleEntityNotFound(_0x2d454f,null))[_0x3dd0('0x25')](respondWithResult(_0x2d454f,null))[_0x3dd0('0x46')](handleError(_0x2d454f,null));};exports[_0x3dd0('0x47')]=function(_0x344e7f,_0x346e1){return db[_0x3dd0('0x2b')][_0x3dd0('0x47')](_0x344e7f['body'],{})['then'](respondWithResult(_0x346e1,0xc9))[_0x3dd0('0x46')](handleError(_0x346e1,null));};exports[_0x3dd0('0x48')]=function(_0x11ac92,_0x4d3710){return db[_0x3dd0('0x2b')][_0x3dd0('0x48')]()[_0x3dd0('0x25')](respondWithResult(_0x4d3710,null))[_0x3dd0('0x46')](handleError(_0x4d3710,null));};exports[_0x3dd0('0x23')]=function(_0x5508b1,_0x302cb0){if(_0x5508b1[_0x3dd0('0x49')]['uniqueid']){delete _0x5508b1['body'][_0x3dd0('0x4a')];}return db[_0x3dd0('0x2b')][_0x3dd0('0x45')]({'where':{'uniqueid':_0x5508b1['params']['id']}})[_0x3dd0('0x25')](handleEntityNotFound(_0x302cb0,null))[_0x3dd0('0x25')](saveUpdates(_0x5508b1['body'],null))[_0x3dd0('0x25')](respondWithResult(_0x302cb0,null))[_0x3dd0('0x46')](handleError(_0x302cb0,null));}; \ No newline at end of file +var _0xd5f8=['update','then','destroy','stack','name','send','map','CmHopperHistory','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','describe','uniqueid','find','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','Content-Range','reject','save'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0xd5f8,0xb9));var _0x8d5f=function(_0x1ba6fe,_0xaa7a87){_0x1ba6fe=_0x1ba6fe-0x0;var _0x2deb54=_0xd5f8[_0x1ba6fe];return _0x2deb54;};'use strict';var emlformat=require(_0x8d5f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8d5f('0x1'));var rp=require(_0x8d5f('0x2'));var moment=require(_0x8d5f('0x3'));var BPromise=require(_0x8d5f('0x4'));var Mustache=require('mustache');var util=require(_0x8d5f('0x5'));var path=require(_0x8d5f('0x6'));var sox=require('sox');var csv=require(_0x8d5f('0x7'));var ejs=require(_0x8d5f('0x8'));var fs=require('fs');var fs_extra=require(_0x8d5f('0x9'));var _=require(_0x8d5f('0xa'));var squel=require(_0x8d5f('0xb'));var crypto=require(_0x8d5f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8d5f('0xd'));var toCsv=require(_0x8d5f('0x7'));var querystring=require(_0x8d5f('0xe'));var Papa=require(_0x8d5f('0xf'));var Redis=require('ioredis');var authService=require(_0x8d5f('0x10'));var qs=require(_0x8d5f('0x11'));var as=require(_0x8d5f('0x12'));var hardwareService=require(_0x8d5f('0x13'));var logger=require(_0x8d5f('0x14'))(_0x8d5f('0x15'));var utils=require('../../config/utils');var config=require(_0x8d5f('0x16'));var licenseUtil=require(_0x8d5f('0x17'));var db=require(_0x8d5f('0x18'))['db'];function respondWithStatusCode(_0xb3105,_0x13b9c1){_0x13b9c1=_0x13b9c1||0xcc;return function(_0xadb4ee){if(_0xadb4ee){return _0xb3105[_0x8d5f('0x19')](_0x13b9c1);}return _0xb3105[_0x8d5f('0x1a')](_0x13b9c1)[_0x8d5f('0x1b')]();};}function respondWithResult(_0x1ae9ad,_0x11a3bc){_0x11a3bc=_0x11a3bc||0xc8;return function(_0x345ee5){if(_0x345ee5){return _0x1ae9ad[_0x8d5f('0x1a')](_0x11a3bc)['json'](_0x345ee5);}};}function respondWithFilteredResult(_0x5b7848,_0x31ac55){return function(_0x492db9){if(_0x492db9){var _0x1654f3=typeof _0x31ac55[_0x8d5f('0x1c')]==='undefined'&&typeof _0x31ac55[_0x8d5f('0x1d')]==='undefined';var _0x338906=_0x492db9[_0x8d5f('0x1e')];var _0x338c09=_0x1654f3?0x0:_0x31ac55[_0x8d5f('0x1c')];var _0x226f5d=_0x1654f3?_0x492db9[_0x8d5f('0x1e')]:_0x31ac55['offset']+_0x31ac55[_0x8d5f('0x1d')];var _0x4be29c;if(_0x226f5d>=_0x338906){_0x226f5d=_0x338906;_0x4be29c=0xc8;}else{_0x4be29c=0xce;}_0x5b7848['status'](_0x4be29c);return _0x5b7848['set'](_0x8d5f('0x1f'),_0x338c09+'-'+_0x226f5d+'/'+_0x338906)['json'](_0x492db9);}return null;};}function patchUpdates(_0x212c47){return function(_0x12096c){try{jsonpatch['apply'](_0x12096c,_0x212c47,!![]);}catch(_0x3d009e){return BPromise[_0x8d5f('0x20')](_0x3d009e);}return _0x12096c[_0x8d5f('0x21')]();};}function saveUpdates(_0xc81e5c,_0x50966b){return function(_0x1fab62){if(_0x1fab62){return _0x1fab62[_0x8d5f('0x22')](_0xc81e5c)[_0x8d5f('0x23')](function(_0x4c4858){return _0x4c4858;});}return null;};}function removeEntity(_0x2d48de,_0x49a22d){return function(_0x54ae06){if(_0x54ae06){return _0x54ae06[_0x8d5f('0x24')]()[_0x8d5f('0x23')](function(){_0x2d48de['status'](0xcc)[_0x8d5f('0x1b')]();});}};}function handleEntityNotFound(_0x173a8d,_0x3ff0f0){return function(_0x3726c0){if(!_0x3726c0){_0x173a8d[_0x8d5f('0x19')](0x194);}return _0x3726c0;};}function handleError(_0xc06807,_0x291a77){_0x291a77=_0x291a77||0x1f4;return function(_0x8942d0){logger['error'](_0x8942d0[_0x8d5f('0x25')]);if(_0x8942d0[_0x8d5f('0x26')]){delete _0x8942d0[_0x8d5f('0x26')];}_0xc06807['status'](_0x291a77)[_0x8d5f('0x27')](_0x8942d0);};}exports['index']=function(_0xa6e537,_0x490f04){var _0x18ab00={},_0x563e23={},_0x4dac0b={'count':0x0,'rows':[]};var _0x3b33f9=_[_0x8d5f('0x28')](db[_0x8d5f('0x29')][_0x8d5f('0x2a')],function(_0x11d85c){return{'name':_0x11d85c['fieldName'],'type':_0x11d85c[_0x8d5f('0x2b')][_0x8d5f('0x2c')]};});_0x563e23[_0x8d5f('0x2d')]=_[_0x8d5f('0x28')](_0x3b33f9,'name');_0x563e23[_0x8d5f('0x2e')]=_[_0x8d5f('0x2f')](_0xa6e537[_0x8d5f('0x2e')]);_0x563e23[_0x8d5f('0x30')]=_[_0x8d5f('0x31')](_0x563e23[_0x8d5f('0x2d')],_0x563e23[_0x8d5f('0x2e')]);_0x18ab00[_0x8d5f('0x32')]=_[_0x8d5f('0x31')](_0x563e23[_0x8d5f('0x2d')],qs[_0x8d5f('0x33')](_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x33')]));_0x18ab00[_0x8d5f('0x32')]=_0x18ab00[_0x8d5f('0x32')][_0x8d5f('0x34')]?_0x18ab00['attributes']:_0x563e23[_0x8d5f('0x2d')];if(!_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x35')](_0x8d5f('0x36'))){_0x18ab00[_0x8d5f('0x1d')]=qs[_0x8d5f('0x1d')](_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x1d')]);_0x18ab00[_0x8d5f('0x1c')]=qs[_0x8d5f('0x1c')](_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x1c')]);}_0x18ab00['order']=qs[_0x8d5f('0x37')](_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x37')]);_0x18ab00[_0x8d5f('0x38')]=qs[_0x8d5f('0x30')](_['pick'](_0xa6e537[_0x8d5f('0x2e')],_0x563e23['filters']),_0x3b33f9);if(_0xa6e537['query'][_0x8d5f('0x39')]){_0x18ab00[_0x8d5f('0x38')]=_['merge'](_0x18ab00[_0x8d5f('0x38')],{'$or':_[_0x8d5f('0x28')](_0x3b33f9,function(_0x1ccff4){if(_0x1ccff4['type']!==_0x8d5f('0x3a')){var _0x2faaba={};_0x2faaba[_0x1ccff4[_0x8d5f('0x26')]]={'$like':'%'+_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x39')]+'%'};return _0x2faaba;}})});}_0x18ab00=_['merge']({},_0x18ab00,_0xa6e537[_0x8d5f('0x3b')]);var _0x25d88c={'where':_0x18ab00[_0x8d5f('0x38')]};return db[_0x8d5f('0x29')]['count'](_0x25d88c)['then'](function(_0xff0871){_0x4dac0b[_0x8d5f('0x1e')]=_0xff0871;if(_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x3c')]){_0x18ab00[_0x8d5f('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x8d5f('0x3e')](_0x18ab00);})[_0x8d5f('0x23')](function(_0x471350){_0x4dac0b[_0x8d5f('0x3f')]=_0x471350;return _0x4dac0b;})[_0x8d5f('0x23')](respondWithFilteredResult(_0x490f04,_0x18ab00))[_0x8d5f('0x40')](handleError(_0x490f04,null));};exports[_0x8d5f('0x41')]=function(_0xdb7c83,_0xbd79d0){var _0x123a87={'raw':!![],'where':{'id':_0xdb7c83[_0x8d5f('0x42')]['id']}},_0x104d12={};_0x104d12[_0x8d5f('0x2d')]=_[_0x8d5f('0x2f')](db['CmHopperHistory']['rawAttributes']);_0x104d12[_0x8d5f('0x2e')]=_[_0x8d5f('0x2f')](_0xdb7c83[_0x8d5f('0x2e')]);_0x104d12['filters']=_[_0x8d5f('0x31')](_0x104d12[_0x8d5f('0x2d')],_0x104d12[_0x8d5f('0x2e')]);_0x123a87['attributes']=_[_0x8d5f('0x31')](_0x104d12['model'],qs[_0x8d5f('0x33')](_0xdb7c83[_0x8d5f('0x2e')]['fields']));_0x123a87[_0x8d5f('0x32')]=_0x123a87[_0x8d5f('0x32')][_0x8d5f('0x34')]?_0x123a87[_0x8d5f('0x32')]:_0x104d12[_0x8d5f('0x2d')];if(_0xdb7c83[_0x8d5f('0x2e')][_0x8d5f('0x3c')]){_0x123a87[_0x8d5f('0x3d')]=[{'all':!![]}];}_0x123a87=_[_0x8d5f('0x43')]({},_0x123a87,_0xdb7c83[_0x8d5f('0x3b')]);return db['CmHopperHistory']['find'](_0x123a87)[_0x8d5f('0x23')](handleEntityNotFound(_0xbd79d0,null))[_0x8d5f('0x23')](respondWithResult(_0xbd79d0,null))[_0x8d5f('0x40')](handleError(_0xbd79d0,null));};exports['create']=function(_0x148dd9,_0xc33c33){return db[_0x8d5f('0x29')][_0x8d5f('0x44')](_0x148dd9[_0x8d5f('0x45')],{})[_0x8d5f('0x23')](respondWithResult(_0xc33c33,0xc9))[_0x8d5f('0x40')](handleError(_0xc33c33,null));};exports[_0x8d5f('0x46')]=function(_0x4745f6,_0x14f534){return db[_0x8d5f('0x29')][_0x8d5f('0x46')]()[_0x8d5f('0x23')](respondWithResult(_0x14f534,null))[_0x8d5f('0x40')](handleError(_0x14f534,null));};exports[_0x8d5f('0x22')]=function(_0x449631,_0x1709e6){if(_0x449631[_0x8d5f('0x45')][_0x8d5f('0x47')]){delete _0x449631[_0x8d5f('0x45')]['uniqueid'];}return db[_0x8d5f('0x29')][_0x8d5f('0x48')]({'where':{'uniqueid':_0x449631['params']['id']}})[_0x8d5f('0x23')](handleEntityNotFound(_0x1709e6,null))['then'](saveUpdates(_0x449631[_0x8d5f('0x45')],null))['then'](respondWithResult(_0x1709e6,null))[_0x8d5f('0x40')](handleError(_0x1709e6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 19e1f94..724b407 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 _0x65c9=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash','util','api','moment'];(function(_0x464091,_0x1bed8a){var _0x5ae274=function(_0x17b2cc){while(--_0x17b2cc){_0x464091['push'](_0x464091['shift']());}};_0x5ae274(++_0x1bed8a);}(_0x65c9,0x182));var _0x965c=function(_0x266d5e,_0x2f3c56){_0x266d5e=_0x266d5e-0x0;var _0xff450=_0x65c9[_0x266d5e];return _0xff450;};'use strict';var _=require(_0x965c('0x0'));var util=require(_0x965c('0x1'));var logger=require('../../config/logger')(_0x965c('0x2'));var moment=require(_0x965c('0x3'));var BPromise=require(_0x965c('0x4'));var rp=require(_0x965c('0x5'));var fs=require('fs');var path=require(_0x965c('0x6'));var rimraf=require(_0x965c('0x7'));var config=require(_0x965c('0x8'));var attributes=require(_0x965c('0x9'));module[_0x965c('0xa')]=function(_0xbda9ee,_0xb9c834){return _0xbda9ee[_0x965c('0xb')]('CmHopperHistory',attributes,{'tableName':_0x965c('0xc'),'paranoid':![],'indexes':[{'name':_0x965c('0xd'),'fields':[_0x965c('0xd')]},{'name':_0x965c('0xe'),'fields':[_0x965c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2cf5=['util','api','bluebird','request-promise','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x289f02,_0x396fb4){var _0x41a05f=function(_0x1e38ee){while(--_0x1e38ee){_0x289f02['push'](_0x289f02['shift']());}};_0x41a05f(++_0x396fb4);}(_0x2cf5,0x19f));var _0x52cf=function(_0x3dbc05,_0x281539){_0x3dbc05=_0x3dbc05-0x0;var _0x434833=_0x2cf5[_0x3dbc05];return _0x434833;};'use strict';var _=require(_0x52cf('0x0'));var util=require(_0x52cf('0x1'));var logger=require('../../config/logger')(_0x52cf('0x2'));var moment=require('moment');var BPromise=require(_0x52cf('0x3'));var rp=require(_0x52cf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x52cf('0x5'));var attributes=require(_0x52cf('0x6'));module[_0x52cf('0x7')]=function(_0x1001bd,_0x31185d){return _0x1001bd[_0x52cf('0x8')](_0x52cf('0x9'),attributes,{'tableName':_0x52cf('0xa'),'paranoid':![],'indexes':[{'name':_0x52cf('0xb'),'fields':[_0x52cf('0xb')]},{'name':_0x52cf('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 3f46e9e..a2c6f87 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 _0xde71=['outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','`state`\x20=\x204,\x201,\x20null','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','CmHopperHistory,\x20%s,\x20%s','message','catch','create','options','CreateCmHopperHistory','findAll','raw','where','sequelize','COUNT','col','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','CmHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x371b29,_0x2d33ed){var _0x434d79=function(_0x3966cf){while(--_0x3966cf){_0x371b29['push'](_0x371b29['shift']());}};_0x434d79(++_0x2d33ed);}(_0xde71,0x1c1));var _0x1de7=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0xde71[_0x919445];return _0x511b3e;};'use strict';var _=require(_0x1de7('0x0'));var util=require(_0x1de7('0x1'));var moment=require(_0x1de7('0x2'));var BPromise=require(_0x1de7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1de7('0x4'));var db=require(_0x1de7('0x5'))['db'];var utils=require(_0x1de7('0x6'));var logger=require(_0x1de7('0x7'))(_0x1de7('0x8'));var config=require(_0x1de7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1de7('0xa')][_0x1de7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8efed1,_0x1c92d9,_0x3a2f08){return new BPromise(function(_0x58a35f,_0x52940d){return client[_0x1de7('0xc')](_0x8efed1,_0x3a2f08)[_0x1de7('0xd')](function(_0x37383f){logger[_0x1de7('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x1c92d9,'request\x20sent');logger[_0x1de7('0xf')](_0x1de7('0x10'),_0x1c92d9,_0x1de7('0x11'),JSON[_0x1de7('0x12')](_0x37383f));if(_0x37383f['error']){if(_0x37383f['error'][_0x1de7('0x13')]===0x1f4){logger[_0x1de7('0x14')](_0x1de7('0x15'),_0x1c92d9,_0x37383f[_0x1de7('0x14')][_0x1de7('0x16')]);return _0x52940d(_0x37383f[_0x1de7('0x14')][_0x1de7('0x16')]);}logger[_0x1de7('0x14')](_0x1de7('0x15'),_0x1c92d9,_0x37383f['error'][_0x1de7('0x16')]);return _0x58a35f(_0x37383f['error']['message']);}else{logger['info'](_0x1de7('0x15'),_0x1c92d9,_0x1de7('0x11'));_0x58a35f(_0x37383f['result']['message']);}})[_0x1de7('0x17')](function(_0x2592c1){logger[_0x1de7('0x14')](_0x1de7('0x15'),_0x1c92d9,_0x2592c1);_0x52940d(_0x2592c1);});});}exports['CreateCmHopperHistory']=function(_0x1630d9){var _0x1bc2f7=this;return new Promise(function(_0x305c3a,_0x3b75d4){return db['CmHopperHistory'][_0x1de7('0x18')](_0x1630d9['body'],{'raw':_0x1630d9[_0x1de7('0x19')]?_0x1630d9[_0x1de7('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x24d123){logger[_0x1de7('0xe')](_0x1de7('0x1a'),_0x1630d9);logger['debug'](_0x1de7('0x1a'),_0x1630d9,JSON[_0x1de7('0x12')](_0x24d123));_0x305c3a(_0x24d123);})['catch'](function(_0xffd5cd){logger[_0x1de7('0x14')](_0x1de7('0x1a'),_0xffd5cd[_0x1de7('0x16')],_0x1630d9);_0x3b75d4(_0x1bc2f7[_0x1de7('0x14')](0x1f4,_0xffd5cd['message']));});});};exports['AvgHandleTime']=function(_0x574a06){var _0x32c80b=this;return new Promise(function(_0x5da0b2,_0x41b3d7){return db['CmHopperHistory'][_0x1de7('0x1b')]({'raw':_0x574a06[_0x1de7('0x19')]?_0x574a06[_0x1de7('0x19')][_0x1de7('0x1c')]===undefined?!![]:![]:!![],'where':_0x574a06[_0x1de7('0x19')]?_0x574a06['options'][_0x1de7('0x1d')]||null:null,'attributes':[[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db['sequelize'][_0x1de7('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x1de7('0x22')],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db['sequelize'][_0x1de7('0x21')](_0x1de7('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x24')))),_0x1de7('0x25')],[db['sequelize']['fn'](_0x1de7('0x26'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x27')))),_0x1de7('0x28')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x26'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x29')))),_0x1de7('0x2a')]]})[_0x1de7('0xd')](function(_0x5eb0f2){logger['info'](_0x1de7('0x2b'),_0x574a06);logger[_0x1de7('0xf')](_0x1de7('0x2b'),_0x574a06,JSON[_0x1de7('0x12')](_0x5eb0f2));_0x5da0b2(_0x5eb0f2);})[_0x1de7('0x17')](function(_0x35d0cf){logger['error']('AvgHandleTime',_0x35d0cf[_0x1de7('0x16')],_0x574a06);_0x41b3d7(_0x32c80b['error'](0x1f4,_0x35d0cf[_0x1de7('0x16')]));});});};exports[_0x1de7('0x2c')]=function(_0x368da5){var _0x2db375=this;return new Promise(function(_0x24c8a9,_0x432ac2){return db[_0x1de7('0x2d')][_0x1de7('0x1b')]({'raw':_0x368da5[_0x1de7('0x19')]?_0x368da5[_0x1de7('0x19')][_0x1de7('0x1c')]===undefined?!![]:![]:!![],'where':_0x368da5[_0x1de7('0x19')]?_0x368da5[_0x1de7('0x19')][_0x1de7('0x1d')]||null:null,'attributes':[[_0x1de7('0x2e'),'name'],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x2f')))),'outboundNoSuchCallsDay'],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x30')))),_0x1de7('0x31')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x1de7('0x32')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x33')))),_0x1de7('0x34')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x35')))),_0x1de7('0x36')],[db['sequelize']['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x37')))),_0x1de7('0x38')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x39')))),_0x1de7('0x3a')],[db['sequelize']['fn'](_0x1de7('0x1f'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x3b')))),'outboundUnknownCallsDay'],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0x1de7('0x3c')],[db[_0x1de7('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x3d')))),_0x1de7('0x3e')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db['sequelize'][_0x1de7('0x21')](_0x1de7('0x3f')))),_0x1de7('0x40')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x41')))),_0x1de7('0x42')],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x43')))),_0x1de7('0x40')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x44')))),_0x1de7('0x45')]],'group':[_0x1de7('0x2e')]})['then'](function(_0x4a799b){logger[_0x1de7('0xe')](_0x1de7('0x2c'),_0x368da5);logger['debug'](_0x1de7('0x2c'),_0x368da5,JSON['stringify'](_0x4a799b));_0x24c8a9(_0x4a799b);})['catch'](function(_0x41bf29){logger[_0x1de7('0x14')](_0x1de7('0x2c'),_0x41bf29['message'],_0x368da5);_0x432ac2(_0x2db375[_0x1de7('0x14')](0x1f4,_0x41bf29[_0x1de7('0x16')]));});});};exports[_0x1de7('0x46')]=function(_0x3a23b7){var _0x579321=this;return new Promise(function(_0x15b26e,_0x2d140d){return db['CmHopperHistory'][_0x1de7('0x1b')]({'raw':_0x3a23b7[_0x1de7('0x19')]?_0x3a23b7[_0x1de7('0x19')][_0x1de7('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a23b7[_0x1de7('0x19')]?_0x3a23b7[_0x1de7('0x19')][_0x1de7('0x1d')]||null:null,'attributes':[[_0x1de7('0x2e'),_0x1de7('0x47')],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')][_0x1de7('0x20')]('id')),_0x1de7('0x48')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x49')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x1de7('0xd')](function(_0x38ac74){logger['info'](_0x1de7('0x46'),_0x3a23b7);logger[_0x1de7('0xf')](_0x1de7('0x46'),_0x3a23b7,JSON['stringify'](_0x38ac74));_0x15b26e(_0x38ac74);})[_0x1de7('0x17')](function(_0x4b2f5a){logger['error'](_0x1de7('0x46'),_0x4b2f5a['message'],_0x3a23b7);_0x2d140d(_0x579321[_0x1de7('0x14')](0x1f4,_0x4b2f5a[_0x1de7('0x16')]));});});}; \ No newline at end of file +var _0x3299=['outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateCmHopperHistory','create','options','raw','stringify','AvgHandleTime','CmHopperHistory','findAll','sequelize','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null'];(function(_0x521c86,_0x441430){var _0x2aba01=function(_0x1e0a57){while(--_0x1e0a57){_0x521c86['push'](_0x521c86['shift']());}};_0x2aba01(++_0x441430);}(_0x3299,0x1bc));var _0x9329=function(_0x4546bf,_0x3899e4){_0x4546bf=_0x4546bf-0x0;var _0x514c6e=_0x3299[_0x4546bf];return _0x514c6e;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var moment=require(_0x9329('0x1'));var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require(_0x9329('0x7'))(_0x9329('0x8'));var config=require(_0x9329('0x9'));var jayson=require(_0x9329('0xa'));var client=jayson[_0x9329('0xb')][_0x9329('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14bc45,_0x1fa6c4,_0x218cf3){return new BPromise(function(_0x182d15,_0x531cf1){return client[_0x9329('0xd')](_0x14bc45,_0x218cf3)[_0x9329('0xe')](function(_0x1c1033){logger[_0x9329('0xf')](_0x9329('0x10'),_0x1fa6c4,'request\x20sent');logger[_0x9329('0x11')](_0x9329('0x12'),_0x1fa6c4,'request\x20sent',JSON['stringify'](_0x1c1033));if(_0x1c1033['error']){if(_0x1c1033[_0x9329('0x13')][_0x9329('0x14')]===0x1f4){logger[_0x9329('0x13')](_0x9329('0x10'),_0x1fa6c4,_0x1c1033[_0x9329('0x13')]['message']);return _0x531cf1(_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);}logger[_0x9329('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x1fa6c4,_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);return _0x182d15(_0x1c1033['error'][_0x9329('0x15')]);}else{logger[_0x9329('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x1fa6c4,_0x9329('0x16'));_0x182d15(_0x1c1033[_0x9329('0x17')][_0x9329('0x15')]);}})[_0x9329('0x18')](function(_0x4dfbc1){logger[_0x9329('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x1fa6c4,_0x4dfbc1);_0x531cf1(_0x4dfbc1);});});}exports[_0x9329('0x19')]=function(_0x1b5eed){var _0x57718b=this;return new Promise(function(_0x41db73,_0x26a3c2){return db['CmHopperHistory'][_0x9329('0x1a')](_0x1b5eed['body'],{'raw':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed['options'][_0x9329('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x6676d7){logger[_0x9329('0xf')](_0x9329('0x19'),_0x1b5eed);logger[_0x9329('0x11')](_0x9329('0x19'),_0x1b5eed,JSON[_0x9329('0x1d')](_0x6676d7));_0x41db73(_0x6676d7);})['catch'](function(_0x1fa600){logger[_0x9329('0x13')](_0x9329('0x19'),_0x1fa600[_0x9329('0x15')],_0x1b5eed);_0x26a3c2(_0x57718b[_0x9329('0x13')](0x1f4,_0x1fa600['message']));});});};exports[_0x9329('0x1e')]=function(_0x46019b){var _0x528927=this;return new Promise(function(_0x425240,_0x84dacf){return db[_0x9329('0x1f')][_0x9329('0x20')]({'raw':_0x46019b['options']?_0x46019b['options'][_0x9329('0x1c')]===undefined?!![]:![]:!![],'where':_0x46019b[_0x9329('0x1b')]?_0x46019b[_0x9329('0x1b')]['where']||null:null,'attributes':[[db[_0x9329('0x21')]['fn']('COUNT',db[_0x9329('0x21')][_0x9329('0x22')]('id')),_0x9329('0x23')],[db['sequelize']['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x9329('0x25')],[db['sequelize']['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x9329('0x21')]['fn']('AVG',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x28')))),'predictiveIntervalAvgHoldtime'],[db[_0x9329('0x21')]['fn'](_0x9329('0x29'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')]['literal'](_0x9329('0x2a')))),_0x9329('0x2b')]]})[_0x9329('0xe')](function(_0x1d7d20){logger[_0x9329('0xf')](_0x9329('0x1e'),_0x46019b);logger['debug'](_0x9329('0x1e'),_0x46019b,JSON[_0x9329('0x1d')](_0x1d7d20));_0x425240(_0x1d7d20);})[_0x9329('0x18')](function(_0x3ae0a5){logger[_0x9329('0x13')](_0x9329('0x1e'),_0x3ae0a5[_0x9329('0x15')],_0x46019b);_0x84dacf(_0x528927[_0x9329('0x13')](0x1f4,_0x3ae0a5['message']));});});};exports[_0x9329('0x2c')]=function(_0x4f5202){var _0x11dc44=this;return new Promise(function(_0x22086e,_0x37475b){return db[_0x9329('0x1f')][_0x9329('0x20')]({'raw':_0x4f5202[_0x9329('0x1b')]?_0x4f5202['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f5202[_0x9329('0x1b')]?_0x4f5202[_0x9329('0x1b')][_0x9329('0x2d')]||null:null,'attributes':[[_0x9329('0x2e'),_0x9329('0x2f')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x30')))),_0x9329('0x31')],[db[_0x9329('0x21')]['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')]('`state`\x20=\x203,\x201,\x20null'))),_0x9329('0x32')],[db['sequelize']['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x9329('0x33')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x34')))),'outboundBusyCallsDay'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x208,\x201,\x20null'))),_0x9329('0x35')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x36')))),_0x9329('0x37')],[db['sequelize']['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x38')))),_0x9329('0x39')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x3a')))),_0x9329('0x3b')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db['sequelize']['fn']('IF',db['sequelize'][_0x9329('0x24')]('`state`\x20=\x2013,\x201,\x20null'))),_0x9329('0x3c')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x2014,\x201,\x20null'))),_0x9329('0x3d')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db['sequelize']['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x3e')))),'outboundRejectCallsDay'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x2016,\x201,\x20null'))),_0x9329('0x3f')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x40')))),_0x9329('0x41')],[db[_0x9329('0x21')]['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x42')))),_0x9329('0x43')]],'group':[_0x9329('0x2e')]})[_0x9329('0xe')](function(_0x54431c){logger[_0x9329('0xf')](_0x9329('0x2c'),_0x4f5202);logger[_0x9329('0x11')](_0x9329('0x2c'),_0x4f5202,JSON[_0x9329('0x1d')](_0x54431c));_0x22086e(_0x54431c);})[_0x9329('0x18')](function(_0x2cdff6){logger[_0x9329('0x13')](_0x9329('0x2c'),_0x2cdff6[_0x9329('0x15')],_0x4f5202);_0x37475b(_0x11dc44[_0x9329('0x13')](0x1f4,_0x2cdff6[_0x9329('0x15')]));});});};exports[_0x9329('0x44')]=function(_0x3551b5){var _0x83c24a=this;return new Promise(function(_0x1aec36,_0x4ac39c){return db['CmHopperHistory'][_0x9329('0x20')]({'raw':_0x3551b5[_0x9329('0x1b')]?_0x3551b5[_0x9329('0x1b')][_0x9329('0x1c')]===undefined?!![]:![]:!![],'where':_0x3551b5[_0x9329('0x1b')]?_0x3551b5['options'][_0x9329('0x2d')]||null:null,'attributes':[[_0x9329('0x2e'),_0x9329('0x2f')],[db['sequelize']['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['col']('id')),'ivrTotalCallsDays'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x45')))),_0x9329('0x46')]],'group':[_0x9329('0x2e')]})['then'](function(_0x1e26d9){logger[_0x9329('0xf')](_0x9329('0x44'),_0x3551b5);logger[_0x9329('0x11')]('GetCampaignHopperHistory',_0x3551b5,JSON['stringify'](_0x1e26d9));_0x1aec36(_0x1e26d9);})[_0x9329('0x18')](function(_0x1fa2a2){logger[_0x9329('0x13')](_0x9329('0x44'),_0x1fa2a2[_0x9329('0x15')],_0x3551b5);_0x4ac39c(_0x83c24a[_0x9329('0x13')](0x1f4,_0x1fa2a2[_0x9329('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index b0a9039..6e34f29 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 _0x8562=['isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4050f2,_0x55bfa8){var _0x3fb601=function(_0x413ff9){while(--_0x413ff9){_0x4050f2['push'](_0x4050f2['shift']());}};_0x3fb601(++_0x55bfa8);}(_0x8562,0x118));var _0x2856=function(_0x49bae9,_0x72b4d2){_0x49bae9=_0x49bae9-0x0;var _0x36f5bf=_0x8562[_0x49bae9];return _0x36f5bf;};'use strict';var multer=require('multer');var util=require(_0x2856('0x0'));var path=require(_0x2856('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2856('0x2')]();var fs_extra=require(_0x2856('0x3'));var auth=require(_0x2856('0x4'));var interaction=require(_0x2856('0x5'));var config=require(_0x2856('0x6'));var controller=require('./cmHopperHistory.controller');router[_0x2856('0x7')]('/',auth[_0x2856('0x8')](),controller[_0x2856('0x9')]);router[_0x2856('0x7')](_0x2856('0xa'),auth['isAuthenticated'](),controller[_0x2856('0xb')]);router['get']('/:id',auth[_0x2856('0x8')](),controller[_0x2856('0xc')]);router[_0x2856('0xd')]('/',auth[_0x2856('0x8')](),controller[_0x2856('0xe')]);router[_0x2856('0xf')](_0x2856('0x10'),auth[_0x2856('0x8')](),controller[_0x2856('0x11')]);module['exports']=router; \ No newline at end of file +var _0xbd7d=['Router','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id','post','put','update','multer','util','path','connect-timeout','express'];(function(_0x1305d3,_0x47be29){var _0x883447=function(_0x5ddf06){while(--_0x5ddf06){_0x1305d3['push'](_0x1305d3['shift']());}};_0x883447(++_0x47be29);}(_0xbd7d,0xeb));var _0xdbd7=function(_0x35aeda,_0x264a31){_0x35aeda=_0x35aeda-0x0;var _0x40498c=_0xbd7d[_0x35aeda];return _0x40498c;};'use strict';var multer=require(_0xdbd7('0x0'));var util=require(_0xdbd7('0x1'));var path=require(_0xdbd7('0x2'));var timeout=require(_0xdbd7('0x3'));var express=require(_0xdbd7('0x4'));var router=express[_0xdbd7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdbd7('0x6'));var controller=require(_0xdbd7('0x7'));router[_0xdbd7('0x8')]('/',auth[_0xdbd7('0x9')](),controller['index']);router[_0xdbd7('0x8')](_0xdbd7('0xa'),auth[_0xdbd7('0x9')](),controller[_0xdbd7('0xb')]);router['get'](_0xdbd7('0xc'),auth[_0xdbd7('0x9')](),controller['show']);router[_0xdbd7('0xd')]('/',auth[_0xdbd7('0x9')](),controller['create']);router[_0xdbd7('0xe')](_0xdbd7('0xc'),auth[_0xdbd7('0x9')](),controller[_0xdbd7('0xf')]);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 8051af9..9e5a401 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 _0x16d8=['name','exports','STRING'];(function(_0x22df70,_0x103d9d){var _0x30b9f4=function(_0x74890d){while(--_0x74890d){_0x22df70['push'](_0x22df70['shift']());}};_0x30b9f4(++_0x103d9d);}(_0x16d8,0xa3));var _0x816d=function(_0x382d2e,_0x38e835){_0x382d2e=_0x382d2e-0x0;var _0x8122b4=_0x16d8[_0x382d2e];return _0x8122b4;};'use strict';var Sequelize=require('sequelize');module[_0x816d('0x0')]={'name':{'type':Sequelize[_0x816d('0x1')],'unique':_0x816d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x816d('0x1')]},'dialPrefix':{'type':Sequelize[_0x816d('0x1')]}}; \ No newline at end of file +var _0x00bb=['STRING','sequelize','exports'];(function(_0x47a8c0,_0x4d5931){var _0x551fa1=function(_0x45ac5a){while(--_0x45ac5a){_0x47a8c0['push'](_0x47a8c0['shift']());}};_0x551fa1(++_0x4d5931);}(_0x00bb,0x1d8));var _0xb00b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x00bb[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'name':{'type':Sequelize[_0xb00b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb00b('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 dd756cd..778c78a 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 _0xd26c=['where','filter','merge','VIRTUAL','options','CmList','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','getDispositions','hasOwnProperty','pick','Disposition','ids','addContacts','CmContact','tags','push','each','omit','success','errors','message','json','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','getContacts','getContactsCsv','raw','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findOne','addAgents','spread','userCmList:save','removeAgents','isArray','userCmList:remove','emit','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','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','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Lists','UserProfileResource','error','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd26c,0x180));var _0xcd26=function(_0x4afbb1,_0x296da0){_0x4afbb1=_0x4afbb1-0x0;var _0x286f39=_0xd26c[_0x4afbb1];return _0x286f39;};'use strict';var emlformat=require(_0xcd26('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd26('0x1'));var jsonpatch=require(_0xcd26('0x2'));var rp=require(_0xcd26('0x3'));var moment=require('moment');var BPromise=require(_0xcd26('0x4'));var Mustache=require(_0xcd26('0x5'));var util=require(_0xcd26('0x6'));var path=require(_0xcd26('0x7'));var sox=require(_0xcd26('0x8'));var csv=require(_0xcd26('0x9'));var ejs=require(_0xcd26('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd26('0xb'));var squel=require(_0xcd26('0xc'));var crypto=require(_0xcd26('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcd26('0xe'));var toCsv=require(_0xcd26('0x9'));var querystring=require(_0xcd26('0xf'));var Papa=require(_0xcd26('0x10'));var Redis=require(_0xcd26('0x11'));var authService=require(_0xcd26('0x12'));var qs=require(_0xcd26('0x13'));var as=require(_0xcd26('0x14'));var hardwareService=require(_0xcd26('0x15'));var logger=require(_0xcd26('0x16'))(_0xcd26('0x17'));var utils=require('../../config/utils');var config=require(_0xcd26('0x18'));var licenseUtil=require(_0xcd26('0x19'));var db=require(_0xcd26('0x1a'))['db'];config[_0xcd26('0x1b')]=_['defaults'](config['redis'],{'host':_0xcd26('0x1c'),'port':0x18eb});var socket=require(_0xcd26('0x1d'))(new Redis(config['redis']));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x206859,_0xefbc52){_0xefbc52=_0xefbc52||0xcc;return function(_0xb135b1){if(_0xb135b1){return _0x206859[_0xcd26('0x1e')](_0xefbc52);}return _0x206859['status'](_0xefbc52)[_0xcd26('0x1f')]();};}function respondWithResult(_0x4ccd83,_0x62a0f7){_0x62a0f7=_0x62a0f7||0xc8;return function(_0x4887c9){if(_0x4887c9){return _0x4ccd83[_0xcd26('0x20')](_0x62a0f7)['json'](_0x4887c9);}};}function respondWithFilteredResult(_0x30483d,_0x896a4f){return function(_0x23f45f){if(_0x23f45f){var _0x370ad8=typeof _0x896a4f[_0xcd26('0x21')]===_0xcd26('0x22')&&typeof _0x896a4f[_0xcd26('0x23')]===_0xcd26('0x22');var _0x1ba2d8=_0x23f45f[_0xcd26('0x24')];var _0xe6f375=_0x370ad8?0x0:_0x896a4f[_0xcd26('0x21')];var _0x327910=_0x370ad8?_0x23f45f[_0xcd26('0x24')]:_0x896a4f[_0xcd26('0x21')]+_0x896a4f[_0xcd26('0x23')];var _0x4ce819;if(_0x327910>=_0x1ba2d8){_0x327910=_0x1ba2d8;_0x4ce819=0xc8;}else{_0x4ce819=0xce;}_0x30483d[_0xcd26('0x20')](_0x4ce819);return _0x30483d[_0xcd26('0x25')](_0xcd26('0x26'),_0xe6f375+'-'+_0x327910+'/'+_0x1ba2d8)['json'](_0x23f45f);}return null;};}function patchUpdates(_0x471a10){return function(_0x52d8fe){try{jsonpatch[_0xcd26('0x27')](_0x52d8fe,_0x471a10,!![]);}catch(_0x2ab1d9){return BPromise[_0xcd26('0x28')](_0x2ab1d9);}return _0x52d8fe[_0xcd26('0x29')]();};}function saveUpdates(_0x3ec439,_0x89f429){return function(_0x226b59){if(_0x226b59){return _0x226b59['update'](_0x3ec439)[_0xcd26('0x2a')](function(_0x531669){return _0x531669;});}return null;};}function removeEntity(_0x40677b,_0x51c368){return function(_0x2b21ff){if(_0x2b21ff){return _0x2b21ff[_0xcd26('0x2b')]()['then'](function(){var _0x3d0357=_0x2b21ff[_0xcd26('0x2c')]({'plain':!![]});var _0x5a70a6=_0xcd26('0x2d');return db[_0xcd26('0x2e')]['destroy']({'where':{'type':_0x5a70a6,'resourceId':_0x3d0357['id']}})[_0xcd26('0x2a')](function(){return _0x2b21ff;});})[_0xcd26('0x2a')](function(){_0x40677b['status'](0xcc)[_0xcd26('0x1f')]();});}};}function handleEntityNotFound(_0x5ab61d,_0x4d21a6){return function(_0x1e1d87){if(!_0x1e1d87){_0x5ab61d['sendStatus'](0x194);}return _0x1e1d87;};}function handleError(_0x1628eb,_0x5313ae){_0x5313ae=_0x5313ae||0x1f4;return function(_0x58e353){logger[_0xcd26('0x2f')](_0x58e353['stack']);if(_0x58e353[_0xcd26('0x30')]){delete _0x58e353[_0xcd26('0x30')];}_0x1628eb[_0xcd26('0x20')](_0x5313ae)['send'](_0x58e353);};}exports[_0xcd26('0x31')]=function(_0x595eee,_0x1f9e74){var _0x18d268={},_0x52e7ae={},_0x8ac8b1={'count':0x0,'rows':[]};var _0x2acf63=_[_0xcd26('0x32')](db['CmList'][_0xcd26('0x33')],function(_0x49589b){return{'name':_0x49589b[_0xcd26('0x34')],'type':_0x49589b[_0xcd26('0x35')][_0xcd26('0x36')]};});_0x52e7ae['model']=_['map'](_0x2acf63,'name');_0x52e7ae['query']=_[_0xcd26('0x37')](_0x595eee[_0xcd26('0x38')]);_0x52e7ae[_0xcd26('0x39')]=_[_0xcd26('0x3a')](_0x52e7ae[_0xcd26('0x3b')],_0x52e7ae[_0xcd26('0x38')]);_0x18d268[_0xcd26('0x3c')]=_[_0xcd26('0x3a')](_0x52e7ae[_0xcd26('0x3b')],qs[_0xcd26('0x3d')](_0x595eee['query'][_0xcd26('0x3d')]));_0x18d268['attributes']=_0x18d268[_0xcd26('0x3c')][_0xcd26('0x3e')]?_0x18d268[_0xcd26('0x3c')]:_0x52e7ae[_0xcd26('0x3b')];if(!_0x595eee[_0xcd26('0x38')]['hasOwnProperty'](_0xcd26('0x3f'))){_0x18d268[_0xcd26('0x23')]=qs[_0xcd26('0x23')](_0x595eee['query'][_0xcd26('0x23')]);_0x18d268[_0xcd26('0x21')]=qs['offset'](_0x595eee[_0xcd26('0x38')][_0xcd26('0x21')]);}_0x18d268[_0xcd26('0x40')]=qs[_0xcd26('0x41')](_0x595eee[_0xcd26('0x38')]['sort']);_0x18d268[_0xcd26('0x42')]=qs[_0xcd26('0x39')](_['pick'](_0x595eee['query'],_0x52e7ae['filters']),_0x2acf63);if(_0x595eee['query'][_0xcd26('0x43')]){_0x18d268[_0xcd26('0x42')]=_[_0xcd26('0x44')](_0x18d268[_0xcd26('0x42')],{'$or':_[_0xcd26('0x32')](_0x2acf63,function(_0x38f6a1){if(_0x38f6a1[_0xcd26('0x35')]!==_0xcd26('0x45')){var _0x2d04d8={};_0x2d04d8[_0x38f6a1[_0xcd26('0x30')]]={'$like':'%'+_0x595eee[_0xcd26('0x38')][_0xcd26('0x43')]+'%'};return _0x2d04d8;}})});}_0x18d268=_['merge']({},_0x18d268,_0x595eee[_0xcd26('0x46')]);var _0x3d1c4a={'where':_0x18d268[_0xcd26('0x42')]};return db[_0xcd26('0x47')][_0xcd26('0x24')](_0x3d1c4a)[_0xcd26('0x2a')](function(_0xaefc5){_0x8ac8b1[_0xcd26('0x24')]=_0xaefc5;if(_0x595eee[_0xcd26('0x38')][_0xcd26('0x48')]){_0x18d268[_0xcd26('0x49')]=[{'all':!![]}];}return db[_0xcd26('0x47')][_0xcd26('0x4a')](_0x18d268);})[_0xcd26('0x2a')](function(_0x1c62d7){_0x8ac8b1[_0xcd26('0x4b')]=_0x1c62d7;return _0x8ac8b1;})[_0xcd26('0x2a')](respondWithFilteredResult(_0x1f9e74,_0x18d268))[_0xcd26('0x4c')](handleError(_0x1f9e74,null));};exports[_0xcd26('0x4d')]=function(_0x1ec16a,_0x4afa71){var _0x259df2={'raw':![],'where':{'id':_0x1ec16a[_0xcd26('0x4e')]['id']}},_0x28ec83={};_0x28ec83[_0xcd26('0x3b')]=_[_0xcd26('0x37')](db[_0xcd26('0x47')][_0xcd26('0x33')]);_0x28ec83['query']=_[_0xcd26('0x37')](_0x1ec16a[_0xcd26('0x38')]);_0x28ec83[_0xcd26('0x39')]=_[_0xcd26('0x3a')](_0x28ec83[_0xcd26('0x3b')],_0x28ec83[_0xcd26('0x38')]);_0x259df2[_0xcd26('0x3c')]=_[_0xcd26('0x3a')](_0x28ec83[_0xcd26('0x3b')],qs[_0xcd26('0x3d')](_0x1ec16a[_0xcd26('0x38')][_0xcd26('0x3d')]));_0x259df2['attributes']=_0x259df2[_0xcd26('0x3c')]['length']?_0x259df2[_0xcd26('0x3c')]:_0x28ec83['model'];if(_0x1ec16a[_0xcd26('0x38')][_0xcd26('0x48')]){_0x259df2[_0xcd26('0x49')]=[{'all':!![]}];}_0x259df2=_[_0xcd26('0x44')]({},_0x259df2,_0x1ec16a[_0xcd26('0x46')]);return db[_0xcd26('0x47')][_0xcd26('0x4f')](_0x259df2)[_0xcd26('0x2a')](handleEntityNotFound(_0x4afa71,null))[_0xcd26('0x2a')](respondWithResult(_0x4afa71,null))[_0xcd26('0x4c')](handleError(_0x4afa71,null));};exports[_0xcd26('0x50')]=function(_0x1aab6f,_0x20b10e){return db[_0xcd26('0x47')][_0xcd26('0x50')](_0x1aab6f[_0xcd26('0x51')],{})[_0xcd26('0x2a')](function(_0x4f88cd){var _0x48b565=_0x1aab6f[_0xcd26('0x52')][_0xcd26('0x2c')]({'plain':!![]});if(!_0x48b565)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48b565[_0xcd26('0x53')]===_0xcd26('0x52')){var _0x56c62b=_0x4f88cd[_0xcd26('0x2c')]({'plain':!![]});var _0x4c5055='Lists';return db[_0xcd26('0x54')][_0xcd26('0x4f')]({'where':{'name':_0x4c5055,'userProfileId':_0x48b565['userProfileId']},'raw':!![]})[_0xcd26('0x2a')](function(_0x3f05dd){if(_0x3f05dd&&_0x3f05dd[_0xcd26('0x55')]===0x0){return db[_0xcd26('0x2e')][_0xcd26('0x50')]({'name':_0x56c62b[_0xcd26('0x30')],'resourceId':_0x56c62b['id'],'type':_0x3f05dd[_0xcd26('0x30')],'sectionId':_0x3f05dd['id']},{})[_0xcd26('0x2a')](function(){return _0x4f88cd;});}else{return _0x4f88cd;}})[_0xcd26('0x4c')](function(_0x2473f7){logger[_0xcd26('0x2f')](_0xcd26('0x56'),_0x2473f7);throw _0x2473f7;});}return _0x4f88cd;})['then'](respondWithResult(_0x20b10e,0xc9))['catch'](handleError(_0x20b10e,null));};exports[_0xcd26('0x57')]=function(_0x29642d,_0x552481){if(_0x29642d[_0xcd26('0x51')]['id']){delete _0x29642d[_0xcd26('0x51')]['id'];}return db['CmList'][_0xcd26('0x4f')]({'where':{'id':_0x29642d[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x552481,null))[_0xcd26('0x2a')](saveUpdates(_0x29642d[_0xcd26('0x51')],null))[_0xcd26('0x2a')](respondWithResult(_0x552481,null))[_0xcd26('0x4c')](handleError(_0x552481,null));};exports[_0xcd26('0x2b')]=function(_0x360a23,_0x5a59aa){return db[_0xcd26('0x47')]['find']({'where':{'id':_0x360a23[_0xcd26('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5a59aa,null))[_0xcd26('0x2a')](removeEntity(_0x5a59aa,null))[_0xcd26('0x4c')](handleError(_0x5a59aa,null));};exports[_0xcd26('0x58')]=function(_0x33f556,_0x500ffa){return db['CmList']['describe']()['then'](respondWithResult(_0x500ffa,null))['catch'](handleError(_0x500ffa,null));};exports[_0xcd26('0x59')]=function(_0x38d809,_0x58a9e4,_0x29d3cb){if(_0x38d809[_0xcd26('0x51')]['id']){delete _0x38d809[_0xcd26('0x51')]['id'];}return db[_0xcd26('0x47')][_0xcd26('0x4f')]({'where':{'id':_0x38d809[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x58a9e4,null))[_0xcd26('0x2a')](function(_0x4c9896){if(_0x4c9896){_0x38d809[_0xcd26('0x51')][_0xcd26('0x5a')]=_0x4c9896['id'];return db['Disposition'][_0xcd26('0x50')](_0x38d809['body']);}})[_0xcd26('0x2a')](respondWithResult(_0x58a9e4,null))[_0xcd26('0x4c')](handleError(_0x58a9e4,null));};exports[_0xcd26('0x5b')]=function(_0x396cc3,_0x39a8e9,_0xe2f677){var _0x28df7e={'raw':![],'where':{}};var _0x370bca={};var _0x2b1082={'count':0x0,'rows':[]};return db[_0xcd26('0x47')]['findOne']({'where':{'id':_0x396cc3['params']['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x39a8e9,null))[_0xcd26('0x2a')](function(_0x31dd19){if(_0x31dd19){_0x370bca[_0xcd26('0x3b')]=_[_0xcd26('0x37')](db['Disposition'][_0xcd26('0x33')]);_0x370bca[_0xcd26('0x38')]=_[_0xcd26('0x37')](_0x396cc3[_0xcd26('0x38')]);_0x370bca['filters']=_[_0xcd26('0x3a')](_0x370bca[_0xcd26('0x3b')],_0x370bca['query']);_0x28df7e[_0xcd26('0x3c')]=_['intersection'](_0x370bca['model'],qs[_0xcd26('0x3d')](_0x396cc3[_0xcd26('0x38')][_0xcd26('0x3d')]));_0x28df7e['attributes']=_0x28df7e[_0xcd26('0x3c')][_0xcd26('0x3e')]?_0x28df7e[_0xcd26('0x3c')]:_0x370bca['model'];if(!_0x396cc3[_0xcd26('0x38')][_0xcd26('0x5c')](_0xcd26('0x3f'))){_0x28df7e[_0xcd26('0x23')]=qs[_0xcd26('0x23')](_0x396cc3[_0xcd26('0x38')]['limit']);_0x28df7e['offset']=qs[_0xcd26('0x21')](_0x396cc3[_0xcd26('0x38')]['offset']);}_0x28df7e[_0xcd26('0x40')]=qs[_0xcd26('0x41')](_0x396cc3[_0xcd26('0x38')]['sort']);_0x28df7e[_0xcd26('0x42')]=qs[_0xcd26('0x39')](_[_0xcd26('0x5d')](_0x396cc3[_0xcd26('0x38')],_0x370bca[_0xcd26('0x39')]));_0x28df7e[_0xcd26('0x42')]['ListId']=_0x31dd19['id'];if(_0x396cc3[_0xcd26('0x38')][_0xcd26('0x43')]){_0x28df7e['where']=_[_0xcd26('0x44')](_0x28df7e[_0xcd26('0x42')],{'$or':_['map'](_0x28df7e['attributes'],function(_0x58c3fc){var _0x3f7728={};_0x3f7728[_0x58c3fc]={'$like':'%'+_0x396cc3['query'][_0xcd26('0x43')]+'%'};return _0x3f7728;})});}_0x28df7e=_[_0xcd26('0x44')]({},_0x28df7e,_0x396cc3[_0xcd26('0x46')]);return db[_0xcd26('0x5e')][_0xcd26('0x24')]({'where':_0x28df7e[_0xcd26('0x42')]})[_0xcd26('0x2a')](function(_0x3cf5bf){_0x2b1082[_0xcd26('0x24')]=_0x3cf5bf;if(_0x396cc3[_0xcd26('0x38')]['includeAll']){_0x28df7e[_0xcd26('0x49')]=[{'all':!![]}];}return db[_0xcd26('0x5e')][_0xcd26('0x4a')](_0x28df7e);})['then'](function(_0x57bd82){_0x2b1082[_0xcd26('0x4b')]=_0x57bd82;return _0x2b1082;});}})[_0xcd26('0x2a')](respondWithFilteredResult(_0x39a8e9,_0x28df7e))[_0xcd26('0x4c')](handleError(_0x39a8e9,null));};exports['removeDispositions']=function(_0xde7094,_0x3b66ac,_0x46446b){return db[_0xcd26('0x47')][_0xcd26('0x4f')]({'where':{'id':_0xde7094[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x3b66ac,null))['then'](function(_0x4860d6){if(_0x4860d6){return _0x4860d6['removeDispositions'](_0xde7094[_0xcd26('0x38')][_0xcd26('0x5f')]);}})[_0xcd26('0x2a')](respondWithStatusCode(_0x3b66ac,null))[_0xcd26('0x4c')](handleError(_0x3b66ac,null));};exports[_0xcd26('0x60')]=function(_0xeb0a23,_0x287738,_0x8532db){return db[_0xcd26('0x47')][_0xcd26('0x4f')]({'where':{'id':_0xeb0a23[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x287738,null))[_0xcd26('0x2a')](function(_0x5b56f6){if(_0x5b56f6){var _0xf1448d=[];var _0x2e0498={'success':[],'errors':[]};return db[_0xcd26('0x61')][_0xcd26('0x58')]()[_0xcd26('0x2a')](function(_0x1bcc39){if(_0xeb0a23[_0xcd26('0x51')]['tags']&&_['isArray'](_0xeb0a23[_0xcd26('0x51')]['tags'])){if(_0xeb0a23[_0xcd26('0x51')][_0xcd26('0x62')][_0xcd26('0x3e')]){_0xeb0a23[_0xcd26('0x51')][_0xcd26('0x62')]=_0xeb0a23['body']['tags']['join'](';')+';';}else{_0xeb0a23[_0xcd26('0x51')][_0xcd26('0x62')]=null;}}else{_0xeb0a23['body'][_0xcd26('0x62')]=null;}if(_0xeb0a23[_0xcd26('0x51')]&&_['isArray'](_0xeb0a23[_0xcd26('0x51')])){for(var _0x45fd54=0x0;_0x45fd54<_0xeb0a23[_0xcd26('0x51')]['length'];_0x45fd54+=0x1){_0xeb0a23[_0xcd26('0x51')][_0x45fd54][_0xcd26('0x5a')]=_0xeb0a23['params']['id'];_0xf1448d[_0xcd26('0x63')](_0xeb0a23[_0xcd26('0x51')][_0x45fd54]);}return BPromise[_0xcd26('0x64')](_0xf1448d,function(_0x4409c5){return db['CmContact']['create'](_[_0xcd26('0x65')](_0x4409c5,[_0xcd26('0x5f'),'id'])||{},{'fields':_[_0xcd26('0x37')](_0x1bcc39),'raw':!![]})['then'](function(_0x15e15d){_0x2e0498[_0xcd26('0x66')][_0xcd26('0x63')](_0x15e15d['dataValues']);})['catch'](function(_0x4a2a0e){_0x2e0498[_0xcd26('0x67')][_0xcd26('0x63')]({'data':_0x4409c5,'error':_0x4a2a0e[_0xcd26('0x68')]});});})['then'](function(_0x23665e){return _0x2e0498;})['catch'](function(_0x4bf87d){return _0x4bf87d;});}else{_0x287738[_0xcd26('0x20')](0x190)[_0xcd26('0x69')]({'message':_0xcd26('0x6a')});}});}})['then'](respondWithResult(_0x287738,null))[_0xcd26('0x4c')](handleError(_0x287738,null));};exports['getContacts']=function(_0x5d9da1,_0xc26746,_0xb812fc){var _0x3cce34;return db[_0xcd26('0x47')][_0xcd26('0x4f')]({'where':{'id':_0x5d9da1[_0xcd26('0x4e')]['id']},'include':[{'model':db[_0xcd26('0x6b')],'as':_0xcd26('0x6c')}]})['then'](handleEntityNotFound(_0xc26746,null))[_0xcd26('0x2a')](function(_0x415a92){if(_0x415a92){_0x3cce34=_0x415a92;return db['CmContact'][_0xcd26('0x33')];}})[_0xcd26('0x2a')](function(_0x5b9a8a){if(_0x5b9a8a){var _0x3e483b={};var _0x5f186f={};_0x5f186f[_0xcd26('0x3b')]=_[_0xcd26('0x6d')](_[_0xcd26('0x37')](_0x5b9a8a),_[_0xcd26('0x32')](_0x3cce34[_0xcd26('0x6c')],function(_0xc49c4e){return util[_0xcd26('0x6e')](_0xcd26('0x6f'),_0xc49c4e['id']);}));_0x5f186f[_0xcd26('0x38')]=_[_0xcd26('0x37')](_0x5d9da1[_0xcd26('0x38')]);_0x5f186f[_0xcd26('0x39')]=_[_0xcd26('0x3a')](_0x5f186f['model'],_0x5f186f['query']);_0x3e483b[_0xcd26('0x3c')]=_[_0xcd26('0x3a')](_0x5f186f[_0xcd26('0x3b')],qs['fields'](_0x5d9da1[_0xcd26('0x38')][_0xcd26('0x3d')]));_0x3e483b[_0xcd26('0x3c')]=_0x3e483b[_0xcd26('0x3c')][_0xcd26('0x3e')]?_0x3e483b['attributes']:_0x5f186f['model'];if(!_0x5d9da1[_0xcd26('0x38')][_0xcd26('0x5c')](_0xcd26('0x3f'))){_0x3e483b[_0xcd26('0x23')]=qs[_0xcd26('0x23')](_0x5d9da1[_0xcd26('0x38')]['limit']);_0x3e483b[_0xcd26('0x21')]=qs[_0xcd26('0x21')](_0x5d9da1[_0xcd26('0x38')][_0xcd26('0x21')]);}_0x3e483b[_0xcd26('0x40')]=qs[_0xcd26('0x41')](_0x5d9da1[_0xcd26('0x38')]['sort']);_0x3e483b[_0xcd26('0x42')]=qs[_0xcd26('0x39')](_[_0xcd26('0x5d')](_0x5d9da1[_0xcd26('0x38')],_0x5f186f[_0xcd26('0x39')]));_0x3e483b['raw']=!![];if(_0x5d9da1[_0xcd26('0x38')][_0xcd26('0x43')]){_0x3e483b[_0xcd26('0x42')]=_[_0xcd26('0x44')](_0x3e483b[_0xcd26('0x42')],{'$or':_['map'](_0x3e483b[_0xcd26('0x3c')],function(_0x1d28bb){var _0x1854f1={};_0x1854f1[_0x1d28bb]={'$like':'%'+_0x5d9da1[_0xcd26('0x38')][_0xcd26('0x43')]+'%'};return _0x1854f1;})});}_0x3e483b=_[_0xcd26('0x44')]({},_0x3e483b,_0x5d9da1[_0xcd26('0x46')]);return _0x3cce34[_0xcd26('0x70')](_0x3e483b);}})['then'](respondWithResult(_0xc26746,null))[_0xcd26('0x4c')](handleError(_0xc26746,null));};exports[_0xcd26('0x71')]=function(_0x4d2093,_0x44ccce,_0x84753f){var _0x549ee5;return db[_0xcd26('0x47')]['find']({'where':{'id':_0x4d2093[_0xcd26('0x4e')]['id']},'include':[{'model':db[_0xcd26('0x6b')],'as':_0xcd26('0x6c')}]})[_0xcd26('0x2a')](handleEntityNotFound(_0x44ccce,null))[_0xcd26('0x2a')](function(_0x36b981){if(_0x36b981){_0x549ee5=_0x36b981;return db[_0xcd26('0x61')][_0xcd26('0x33')];}})[_0xcd26('0x2a')](function(_0x5d9038){if(_0x5d9038){var _0x2006c1={};var _0x388550={};_0x388550[_0xcd26('0x3b')]=_[_0xcd26('0x6d')](_[_0xcd26('0x37')](_0x5d9038),_[_0xcd26('0x32')](_0x549ee5[_0xcd26('0x6c')],function(_0x28999a){return util[_0xcd26('0x6e')](_0xcd26('0x6f'),_0x28999a['id']);}));_0x388550[_0xcd26('0x38')]=_['keys'](_0x4d2093['query']);_0x388550[_0xcd26('0x39')]=_[_0xcd26('0x3a')](_0x388550['model'],_0x388550[_0xcd26('0x38')]);_0x2006c1[_0xcd26('0x3c')]=_[_0xcd26('0x3a')](_0x388550[_0xcd26('0x3b')],qs['fields'](_0x4d2093['query'][_0xcd26('0x3d')]));_0x2006c1[_0xcd26('0x3c')]=_0x2006c1['attributes'][_0xcd26('0x3e')]?_0x2006c1[_0xcd26('0x3c')]:_0x388550[_0xcd26('0x3b')];if(!_0x4d2093[_0xcd26('0x38')][_0xcd26('0x5c')](_0xcd26('0x3f'))){_0x2006c1[_0xcd26('0x23')]=qs[_0xcd26('0x23')](_0x4d2093[_0xcd26('0x38')][_0xcd26('0x23')]);_0x2006c1[_0xcd26('0x21')]=qs['offset'](_0x4d2093[_0xcd26('0x38')][_0xcd26('0x21')]);}_0x2006c1['order']=qs[_0xcd26('0x41')](_0x4d2093['query'][_0xcd26('0x41')]);_0x2006c1[_0xcd26('0x42')]=qs[_0xcd26('0x39')](_[_0xcd26('0x5d')](_0x4d2093[_0xcd26('0x38')],_0x388550[_0xcd26('0x39')]));_0x2006c1[_0xcd26('0x72')]=!![];if(_0x4d2093[_0xcd26('0x38')]['filter']){_0x2006c1[_0xcd26('0x42')]=_[_0xcd26('0x44')](_0x2006c1[_0xcd26('0x42')],{'$or':_[_0xcd26('0x32')](_0x2006c1[_0xcd26('0x3c')],function(_0x592b95){var _0x451048={};_0x451048[_0x592b95]={'$like':'%'+_0x4d2093['query']['filter']+'%'};return _0x451048;})});}_0x2006c1=_['merge']({},_0x2006c1,_0x4d2093[_0xcd26('0x46')]);return _0x549ee5['getContacts'](_0x2006c1);}})['then'](function(_0x405767){if(!_[_0xcd26('0x73')](_0x405767)){var _0x58e249=toCsv(_0x405767);var _0x2f0e74=Date[_0xcd26('0x74')]();fs[_0xcd26('0x75')](util['format']('/tmp/list_%d_%s.csv',_0x549ee5['id'],_0x2f0e74),_0x58e249);_0x44ccce[_0xcd26('0x76')]('Content-disposition',_0xcd26('0x77')+util[_0xcd26('0x6e')](_0xcd26('0x78'),_0x549ee5['id'],_0x2f0e74));_0x44ccce[_0xcd26('0x76')](_0xcd26('0x79'),_0xcd26('0x7a'));return _0x44ccce[_0xcd26('0x7b')](util[_0xcd26('0x6e')](_0xcd26('0x7c'),_0x549ee5['id'],_0x2f0e74));}else{return _0x44ccce[_0xcd26('0x1e')](0xcc);}})['catch'](handleError(_0x44ccce,null));};exports[_0xcd26('0x7d')]=function(_0x3f3df8,_0x358506,_0x27df51){var _0x12d61f;delete _0x3f3df8[_0xcd26('0x51')]['id'];return db[_0xcd26('0x47')]['findOne']({'where':{'id':_0x3f3df8[_0xcd26('0x4e')]['id']}})['then'](handleEntityNotFound(_0x358506,null))[_0xcd26('0x2a')](function(_0x28f3ef){if(_0x28f3ef){return db[_0xcd26('0x7e')][_0xcd26('0x7f')](function(_0x48fcd0){return db[_0xcd26('0x6b')][_0xcd26('0x50')](_0x3f3df8[_0xcd26('0x51')],{'transaction':_0x48fcd0})[_0xcd26('0x2a')](function(_0x24a4e6){_0x12d61f=_0x24a4e6;return _0x28f3ef[_0xcd26('0x80')](_0x24a4e6,{'transaction':_0x48fcd0});})[_0xcd26('0x2a')](function(){var _0x367691={'type':db[_0xcd26('0x81')][_0xcd26('0x82')],'transaction':_0x48fcd0};switch(_0x3f3df8['body']['type']){case _0xcd26('0x83'):_0x367691['type']=db[_0xcd26('0x81')][_0xcd26('0x82')];break;case _0xcd26('0x84'):_0x367691[_0xcd26('0x35')]=db[_0xcd26('0x81')][_0xcd26('0x85')];break;case _0xcd26('0x86'):_0x367691[_0xcd26('0x35')]=db['Sequelize'][_0xcd26('0x87')];_0x367691[_0xcd26('0x88')]=![];break;default:}return db[_0xcd26('0x7e')]['queryInterface'][_0xcd26('0x89')](_0xcd26('0x8a'),util[_0xcd26('0x6e')](_0xcd26('0x8b'),_0x12d61f['id']),_0x367691);})[_0xcd26('0x2a')](function(){return _0x12d61f;});});}})[_0xcd26('0x2a')](respondWithResult(_0x358506,null))[_0xcd26('0x4c')](handleError(_0x358506,null));};exports[_0xcd26('0x8c')]=function(_0x388dd9,_0x40d0e2,_0x526646){var _0x575470={};var _0x2b2481={};var _0x19c45e;var _0x2f5652;return db[_0xcd26('0x47')][_0xcd26('0x8d')]({'where':{'id':_0x388dd9[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x40d0e2,null))[_0xcd26('0x2a')](function(_0x4f4134){if(_0x4f4134){_0x19c45e=_0x4f4134;_0x2b2481[_0xcd26('0x3b')]=_[_0xcd26('0x37')](db['CmCustomField']['rawAttributes']);_0x2b2481[_0xcd26('0x38')]=_[_0xcd26('0x37')](_0x388dd9['query']);_0x2b2481['filters']=_['intersection'](_0x2b2481[_0xcd26('0x3b')],_0x2b2481[_0xcd26('0x38')]);_0x575470[_0xcd26('0x3c')]=_[_0xcd26('0x3a')](_0x2b2481['model'],qs[_0xcd26('0x3d')](_0x388dd9[_0xcd26('0x38')][_0xcd26('0x3d')]));_0x575470['attributes']=_0x575470[_0xcd26('0x3c')][_0xcd26('0x3e')]?_0x575470[_0xcd26('0x3c')]:_0x2b2481[_0xcd26('0x3b')];_0x575470['order']=qs[_0xcd26('0x41')](_0x388dd9[_0xcd26('0x38')][_0xcd26('0x41')]);_0x575470[_0xcd26('0x42')]=qs['filters'](_[_0xcd26('0x5d')](_0x388dd9['query'],_0x2b2481[_0xcd26('0x39')]));_0x575470[_0xcd26('0x42')]=_['merge'](_0x575470[_0xcd26('0x42')],{'$or':[{'ListId':_0x4f4134['id']},{'ListId':null}]});if(_0x388dd9[_0xcd26('0x38')][_0xcd26('0x43')]){_0x575470['where']=_[_0xcd26('0x44')](_0x575470[_0xcd26('0x42')],{'$or':_['map'](_0x575470[_0xcd26('0x3c')],function(_0x57c874){var _0x28f0a0={};_0x28f0a0[_0x57c874]={'$like':'%'+_0x388dd9['query'][_0xcd26('0x43')]+'%'};return _0x28f0a0;})});}_0x575470=_[_0xcd26('0x44')]({},_0x575470,_0x388dd9['options']);return db[_0xcd26('0x6b')]['findAndCountAll'](_0x575470);}})[_0xcd26('0x2a')](respondWithResult(_0x40d0e2,null))['catch'](handleError(_0x40d0e2,null));};exports[_0xcd26('0x8e')]=function(_0x5b1b58,_0x33f163,_0x3249d8){return db[_0xcd26('0x47')][_0xcd26('0x4f')]({'where':{'id':_0x5b1b58[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x33f163,null))[_0xcd26('0x2a')](function(_0x31923f){if(_0x31923f){return _0x31923f[_0xcd26('0x8e')](_0x5b1b58[_0xcd26('0x51')][_0xcd26('0x5f')],_[_0xcd26('0x65')](_0x5b1b58[_0xcd26('0x51')],[_0xcd26('0x5f'),'id'])||{})[_0xcd26('0x8f')](function(_0x386dff){for(var _0xd1b444=0x0;_0xd1b444<_0x5b1b58[_0xcd26('0x51')][_0xcd26('0x5f')][_0xcd26('0x3e')];_0xd1b444+=0x1){socket['emit'](_0xcd26('0x90'),{'UserId':Number(_0x5b1b58[_0xcd26('0x51')]['ids'][_0xd1b444]),'CmListId':Number(_0x5b1b58[_0xcd26('0x4e')]['id'])});}return _0x386dff;});}})[_0xcd26('0x2a')](respondWithResult(_0x33f163,null))[_0xcd26('0x4c')](handleError(_0x33f163,null));};exports['removeAgents']=function(_0x2f14b0,_0x309137,_0x5cd722){return db['CmList'][_0xcd26('0x4f')]({'where':{'id':_0x2f14b0[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x309137,null))[_0xcd26('0x2a')](function(_0x20f4c5){if(_0x20f4c5){return _0x20f4c5[_0xcd26('0x91')](_0x2f14b0[_0xcd26('0x38')][_0xcd26('0x5f')])[_0xcd26('0x2a')](function(){if(_[_0xcd26('0x92')](_0x2f14b0['query'][_0xcd26('0x5f')])){for(var _0x3fc1c6=0x0;_0x3fc1c6<_0x2f14b0['query'][_0xcd26('0x5f')]['length'];_0x3fc1c6+=0x1){socket['emit'](_0xcd26('0x93'),{'UserId':Number(_0x2f14b0[_0xcd26('0x38')][_0xcd26('0x5f')][_0x3fc1c6]),'CmListId':Number(_0x2f14b0[_0xcd26('0x4e')]['id'])});}}else{socket[_0xcd26('0x94')](_0xcd26('0x93'),{'UserId':Number(_0x2f14b0['query'][_0xcd26('0x5f')]),'CmListId':Number(_0x2f14b0['params']['id'])});}});}})[_0xcd26('0x2a')](respondWithStatusCode(_0x309137,null))[_0xcd26('0x4c')](handleError(_0x309137,null));};exports[_0xcd26('0x95')]=function(_0x2dd01e,_0x4d7df5,_0x565397){var _0x2758de={};var _0x4aa32b={};var _0x5a9a3c;var _0x121a18;return db[_0xcd26('0x47')]['findOne']({'where':{'id':_0x2dd01e['params']['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x4d7df5,null))['then'](function(_0x3105ec){if(_0x3105ec){_0x5a9a3c=_0x3105ec;_0x4aa32b[_0xcd26('0x3b')]=_[_0xcd26('0x37')](db['User'][_0xcd26('0x33')]);_0x4aa32b[_0xcd26('0x38')]=_[_0xcd26('0x37')](_0x2dd01e[_0xcd26('0x38')]);_0x4aa32b[_0xcd26('0x39')]=_[_0xcd26('0x3a')](_0x4aa32b[_0xcd26('0x3b')],_0x4aa32b[_0xcd26('0x38')]);_0x2758de['attributes']=_[_0xcd26('0x3a')](_0x4aa32b[_0xcd26('0x3b')],qs[_0xcd26('0x3d')](_0x2dd01e['query'][_0xcd26('0x3d')]));_0x2758de[_0xcd26('0x3c')]=_0x2758de[_0xcd26('0x3c')]['length']?_0x2758de[_0xcd26('0x3c')]:_0x4aa32b[_0xcd26('0x3b')];_0x2758de[_0xcd26('0x40')]=qs[_0xcd26('0x41')](_0x2dd01e[_0xcd26('0x38')][_0xcd26('0x41')]);_0x2758de['where']=qs[_0xcd26('0x39')](_[_0xcd26('0x5d')](_0x2dd01e['query'],_0x4aa32b[_0xcd26('0x39')]));if(_0x2dd01e[_0xcd26('0x38')][_0xcd26('0x43')]){_0x2758de[_0xcd26('0x42')]=_[_0xcd26('0x44')](_0x2758de[_0xcd26('0x42')],{'$or':_['map'](_0x2758de['attributes'],function(_0x42352e){var _0x1ae035={};_0x1ae035[_0x42352e]={'$like':'%'+_0x2dd01e[_0xcd26('0x38')][_0xcd26('0x43')]+'%'};return _0x1ae035;})});}_0x2758de=_[_0xcd26('0x44')]({},_0x2758de,_0x2dd01e[_0xcd26('0x46')]);return _0x5a9a3c[_0xcd26('0x95')](_0x2758de);}})[_0xcd26('0x2a')](function(_0x32ce09){if(_0x32ce09){_0x121a18=_0x32ce09[_0xcd26('0x3e')];if(!_0x2dd01e[_0xcd26('0x38')][_0xcd26('0x5c')](_0xcd26('0x3f'))){_0x2758de[_0xcd26('0x23')]=qs['limit'](_0x2dd01e['query']['limit']);_0x2758de[_0xcd26('0x21')]=qs[_0xcd26('0x21')](_0x2dd01e[_0xcd26('0x38')][_0xcd26('0x21')]);}return _0x5a9a3c['getAgents'](_0x2758de);}})[_0xcd26('0x2a')](function(_0x49e37a){if(_0x49e37a){return _0x49e37a?{'count':_0x121a18,'rows':_0x49e37a}:null;}})['then'](respondWithResult(_0x4d7df5,null))[_0xcd26('0x4c')](handleError(_0x4d7df5,null));}; \ No newline at end of file +var _0x7e06=['format','cf_%d','raw','CmCustomField','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','Sequelize','TEXT','text','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','Lists','UserProfileResource','end','sendStatus','error','stack','name','send','index','CmList','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','params','describe','Disposition','getDispositions','findOne','ListId','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','concat','CustomFields'];(function(_0x4cdc4b,_0x38e843){var _0x3dce2c=function(_0x4105c6){while(--_0x4105c6){_0x4cdc4b['push'](_0x4cdc4b['shift']());}};_0x3dce2c(++_0x38e843);}(_0x7e06,0x14a));var _0x67e0=function(_0x33155c,_0x3fdde1){_0x33155c=_0x33155c-0x0;var _0x5becf7=_0x7e06[_0x33155c];return _0x5becf7;};'use strict';var emlformat=require(_0x67e0('0x0'));var rimraf=require(_0x67e0('0x1'));var zipdir=require(_0x67e0('0x2'));var jsonpatch=require(_0x67e0('0x3'));var rp=require(_0x67e0('0x4'));var moment=require(_0x67e0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x67e0('0x6'));var util=require(_0x67e0('0x7'));var path=require(_0x67e0('0x8'));var sox=require(_0x67e0('0x9'));var csv=require('to-csv');var ejs=require(_0x67e0('0xa'));var fs=require('fs');var fs_extra=require(_0x67e0('0xb'));var _=require(_0x67e0('0xc'));var squel=require(_0x67e0('0xd'));var crypto=require(_0x67e0('0xe'));var jsforce=require(_0x67e0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x67e0('0x10'));var querystring=require(_0x67e0('0x11'));var Papa=require(_0x67e0('0x12'));var Redis=require(_0x67e0('0x13'));var authService=require(_0x67e0('0x14'));var qs=require(_0x67e0('0x15'));var as=require(_0x67e0('0x16'));var hardwareService=require(_0x67e0('0x17'));var logger=require(_0x67e0('0x18'))('api');var utils=require(_0x67e0('0x19'));var config=require(_0x67e0('0x1a'));var licenseUtil=require(_0x67e0('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x67e0('0x1c')](config[_0x67e0('0x1d')],{'host':_0x67e0('0x1e'),'port':0x18eb});var socket=require(_0x67e0('0x1f'))(new Redis(config[_0x67e0('0x1d')]));require(_0x67e0('0x20'))[_0x67e0('0x21')](socket);function respondWithStatusCode(_0x56a3af,_0x2233b1){_0x2233b1=_0x2233b1||0xcc;return function(_0x36b854){if(_0x36b854){return _0x56a3af['sendStatus'](_0x2233b1);}return _0x56a3af[_0x67e0('0x22')](_0x2233b1)['end']();};}function respondWithResult(_0x55f6af,_0x4f4f17){_0x4f4f17=_0x4f4f17||0xc8;return function(_0x22eae9){if(_0x22eae9){return _0x55f6af['status'](_0x4f4f17)[_0x67e0('0x23')](_0x22eae9);}};}function respondWithFilteredResult(_0x324b2a,_0x6108a8){return function(_0x3b778f){if(_0x3b778f){var _0x2f2a9f=typeof _0x6108a8['offset']===_0x67e0('0x24')&&typeof _0x6108a8[_0x67e0('0x25')]===_0x67e0('0x24');var _0x5e6e38=_0x3b778f[_0x67e0('0x26')];var _0x28edac=_0x2f2a9f?0x0:_0x6108a8[_0x67e0('0x27')];var _0x333fce=_0x2f2a9f?_0x3b778f[_0x67e0('0x26')]:_0x6108a8[_0x67e0('0x27')]+_0x6108a8[_0x67e0('0x25')];var _0x5c0fc9;if(_0x333fce>=_0x5e6e38){_0x333fce=_0x5e6e38;_0x5c0fc9=0xc8;}else{_0x5c0fc9=0xce;}_0x324b2a['status'](_0x5c0fc9);return _0x324b2a[_0x67e0('0x28')](_0x67e0('0x29'),_0x28edac+'-'+_0x333fce+'/'+_0x5e6e38)['json'](_0x3b778f);}return null;};}function patchUpdates(_0xd032ad){return function(_0x21f214){try{jsonpatch[_0x67e0('0x2a')](_0x21f214,_0xd032ad,!![]);}catch(_0x40a78c){return BPromise['reject'](_0x40a78c);}return _0x21f214['save']();};}function saveUpdates(_0x5cbe0b,_0x2e5209){return function(_0xdcc2ca){if(_0xdcc2ca){return _0xdcc2ca[_0x67e0('0x2b')](_0x5cbe0b)[_0x67e0('0x2c')](function(_0xa56068){return _0xa56068;});}return null;};}function removeEntity(_0x89c663,_0x20edad){return function(_0x461fe5){if(_0x461fe5){return _0x461fe5['destroy']()['then'](function(){var _0x3f6aff=_0x461fe5['get']({'plain':!![]});var _0x4cfd8c=_0x67e0('0x2d');return db[_0x67e0('0x2e')]['destroy']({'where':{'type':_0x4cfd8c,'resourceId':_0x3f6aff['id']}})['then'](function(){return _0x461fe5;});})['then'](function(){_0x89c663['status'](0xcc)[_0x67e0('0x2f')]();});}};}function handleEntityNotFound(_0x2f84af,_0x1297f2){return function(_0x172c5c){if(!_0x172c5c){_0x2f84af[_0x67e0('0x30')](0x194);}return _0x172c5c;};}function handleError(_0x1bcf99,_0x1ab48c){_0x1ab48c=_0x1ab48c||0x1f4;return function(_0x58a9d5){logger[_0x67e0('0x31')](_0x58a9d5[_0x67e0('0x32')]);if(_0x58a9d5[_0x67e0('0x33')]){delete _0x58a9d5['name'];}_0x1bcf99[_0x67e0('0x22')](_0x1ab48c)[_0x67e0('0x34')](_0x58a9d5);};}exports[_0x67e0('0x35')]=function(_0xeec987,_0x378e4a){var _0x8cb852={},_0x15762c={},_0x3a0833={'count':0x0,'rows':[]};var _0x3f54ac=_['map'](db[_0x67e0('0x36')][_0x67e0('0x37')],function(_0xd80362){return{'name':_0xd80362[_0x67e0('0x38')],'type':_0xd80362['type'][_0x67e0('0x39')]};});_0x15762c['model']=_[_0x67e0('0x3a')](_0x3f54ac,_0x67e0('0x33'));_0x15762c['query']=_[_0x67e0('0x3b')](_0xeec987[_0x67e0('0x3c')]);_0x15762c[_0x67e0('0x3d')]=_[_0x67e0('0x3e')](_0x15762c[_0x67e0('0x3f')],_0x15762c['query']);_0x8cb852[_0x67e0('0x40')]=_[_0x67e0('0x3e')](_0x15762c[_0x67e0('0x3f')],qs['fields'](_0xeec987[_0x67e0('0x3c')]['fields']));_0x8cb852[_0x67e0('0x40')]=_0x8cb852[_0x67e0('0x40')][_0x67e0('0x41')]?_0x8cb852[_0x67e0('0x40')]:_0x15762c['model'];if(!_0xeec987[_0x67e0('0x3c')][_0x67e0('0x42')](_0x67e0('0x43'))){_0x8cb852['limit']=qs[_0x67e0('0x25')](_0xeec987[_0x67e0('0x3c')]['limit']);_0x8cb852['offset']=qs[_0x67e0('0x27')](_0xeec987[_0x67e0('0x3c')][_0x67e0('0x27')]);}_0x8cb852[_0x67e0('0x44')]=qs[_0x67e0('0x45')](_0xeec987[_0x67e0('0x3c')][_0x67e0('0x45')]);_0x8cb852[_0x67e0('0x46')]=qs[_0x67e0('0x3d')](_[_0x67e0('0x47')](_0xeec987[_0x67e0('0x3c')],_0x15762c['filters']),_0x3f54ac);if(_0xeec987['query'][_0x67e0('0x48')]){_0x8cb852[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0x8cb852['where'],{'$or':_['map'](_0x3f54ac,function(_0x1266d1){if(_0x1266d1[_0x67e0('0x4a')]!==_0x67e0('0x4b')){var _0xe077ee={};_0xe077ee[_0x1266d1[_0x67e0('0x33')]]={'$like':'%'+_0xeec987[_0x67e0('0x3c')]['filter']+'%'};return _0xe077ee;}})});}_0x8cb852=_[_0x67e0('0x49')]({},_0x8cb852,_0xeec987[_0x67e0('0x4c')]);var _0x42c30d={'where':_0x8cb852[_0x67e0('0x46')]};return db[_0x67e0('0x36')][_0x67e0('0x26')](_0x42c30d)['then'](function(_0x1c03d4){_0x3a0833[_0x67e0('0x26')]=_0x1c03d4;if(_0xeec987['query'][_0x67e0('0x4d')]){_0x8cb852[_0x67e0('0x4e')]=[{'all':!![]}];}return db[_0x67e0('0x36')][_0x67e0('0x4f')](_0x8cb852);})[_0x67e0('0x2c')](function(_0x558da5){_0x3a0833[_0x67e0('0x50')]=_0x558da5;return _0x3a0833;})['then'](respondWithFilteredResult(_0x378e4a,_0x8cb852))[_0x67e0('0x51')](handleError(_0x378e4a,null));};exports[_0x67e0('0x52')]=function(_0x2249cc,_0x89c167){var _0x32522a={'raw':![],'where':{'id':_0x2249cc['params']['id']}},_0x2e9e57={};_0x2e9e57[_0x67e0('0x3f')]=_[_0x67e0('0x3b')](db[_0x67e0('0x36')][_0x67e0('0x37')]);_0x2e9e57[_0x67e0('0x3c')]=_[_0x67e0('0x3b')](_0x2249cc['query']);_0x2e9e57[_0x67e0('0x3d')]=_[_0x67e0('0x3e')](_0x2e9e57[_0x67e0('0x3f')],_0x2e9e57[_0x67e0('0x3c')]);_0x32522a['attributes']=_[_0x67e0('0x3e')](_0x2e9e57[_0x67e0('0x3f')],qs[_0x67e0('0x53')](_0x2249cc['query'][_0x67e0('0x53')]));_0x32522a[_0x67e0('0x40')]=_0x32522a[_0x67e0('0x40')][_0x67e0('0x41')]?_0x32522a[_0x67e0('0x40')]:_0x2e9e57[_0x67e0('0x3f')];if(_0x2249cc[_0x67e0('0x3c')][_0x67e0('0x4d')]){_0x32522a[_0x67e0('0x4e')]=[{'all':!![]}];}_0x32522a=_[_0x67e0('0x49')]({},_0x32522a,_0x2249cc[_0x67e0('0x4c')]);return db[_0x67e0('0x36')][_0x67e0('0x54')](_0x32522a)[_0x67e0('0x2c')](handleEntityNotFound(_0x89c167,null))['then'](respondWithResult(_0x89c167,null))[_0x67e0('0x51')](handleError(_0x89c167,null));};exports[_0x67e0('0x55')]=function(_0x28fc98,_0x9b7d0a){return db[_0x67e0('0x36')][_0x67e0('0x55')](_0x28fc98['body'],{})['then'](function(_0x8cbec9){var _0x339b56=_0x28fc98[_0x67e0('0x56')][_0x67e0('0x57')]({'plain':!![]});if(!_0x339b56)throw new Error(_0x67e0('0x58'));if(_0x339b56[_0x67e0('0x59')]==='user'){var _0x1f503f=_0x8cbec9[_0x67e0('0x57')]({'plain':!![]});var _0x4a815a=_0x67e0('0x2d');return db[_0x67e0('0x5a')][_0x67e0('0x54')]({'where':{'name':_0x4a815a,'userProfileId':_0x339b56['userProfileId']},'raw':!![]})[_0x67e0('0x2c')](function(_0x3f5405){if(_0x3f5405&&_0x3f5405['autoAssociation']===0x0){return db[_0x67e0('0x2e')][_0x67e0('0x55')]({'name':_0x1f503f[_0x67e0('0x33')],'resourceId':_0x1f503f['id'],'type':_0x3f5405['name'],'sectionId':_0x3f5405['id']},{})[_0x67e0('0x2c')](function(){return _0x8cbec9;});}else{return _0x8cbec9;}})[_0x67e0('0x51')](function(_0x3bacc6){logger[_0x67e0('0x31')](_0x67e0('0x5b'),_0x3bacc6);throw _0x3bacc6;});}return _0x8cbec9;})[_0x67e0('0x2c')](respondWithResult(_0x9b7d0a,0xc9))[_0x67e0('0x51')](handleError(_0x9b7d0a,null));};exports['update']=function(_0x39b8c2,_0x27cdc2){if(_0x39b8c2['body']['id']){delete _0x39b8c2[_0x67e0('0x5c')]['id'];}return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x39b8c2['params']['id']}})['then'](handleEntityNotFound(_0x27cdc2,null))[_0x67e0('0x2c')](saveUpdates(_0x39b8c2[_0x67e0('0x5c')],null))[_0x67e0('0x2c')](respondWithResult(_0x27cdc2,null))[_0x67e0('0x51')](handleError(_0x27cdc2,null));};exports[_0x67e0('0x5d')]=function(_0x1d59b5,_0x582a59){return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x1d59b5[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x582a59,null))[_0x67e0('0x2c')](removeEntity(_0x582a59,null))['catch'](handleError(_0x582a59,null));};exports['describe']=function(_0x2520ee,_0x541f78){return db['CmList'][_0x67e0('0x5f')]()[_0x67e0('0x2c')](respondWithResult(_0x541f78,null))[_0x67e0('0x51')](handleError(_0x541f78,null));};exports['addDisposition']=function(_0x1bd63d,_0x4ac86a,_0x42c3fc){if(_0x1bd63d[_0x67e0('0x5c')]['id']){delete _0x1bd63d[_0x67e0('0x5c')]['id'];}return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x1bd63d[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x4ac86a,null))[_0x67e0('0x2c')](function(_0x1f6934){if(_0x1f6934){_0x1bd63d[_0x67e0('0x5c')]['ListId']=_0x1f6934['id'];return db[_0x67e0('0x60')][_0x67e0('0x55')](_0x1bd63d[_0x67e0('0x5c')]);}})['then'](respondWithResult(_0x4ac86a,null))[_0x67e0('0x51')](handleError(_0x4ac86a,null));};exports[_0x67e0('0x61')]=function(_0x551038,_0x436525,_0x58618c){var _0xa73ef7={'raw':![],'where':{}};var _0x1f2f1d={};var _0x57ca26={'count':0x0,'rows':[]};return db[_0x67e0('0x36')][_0x67e0('0x62')]({'where':{'id':_0x551038[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x436525,null))[_0x67e0('0x2c')](function(_0x1538da){if(_0x1538da){_0x1f2f1d[_0x67e0('0x3f')]=_['keys'](db[_0x67e0('0x60')][_0x67e0('0x37')]);_0x1f2f1d[_0x67e0('0x3c')]=_['keys'](_0x551038[_0x67e0('0x3c')]);_0x1f2f1d[_0x67e0('0x3d')]=_[_0x67e0('0x3e')](_0x1f2f1d['model'],_0x1f2f1d[_0x67e0('0x3c')]);_0xa73ef7[_0x67e0('0x40')]=_[_0x67e0('0x3e')](_0x1f2f1d[_0x67e0('0x3f')],qs[_0x67e0('0x53')](_0x551038[_0x67e0('0x3c')]['fields']));_0xa73ef7['attributes']=_0xa73ef7[_0x67e0('0x40')][_0x67e0('0x41')]?_0xa73ef7[_0x67e0('0x40')]:_0x1f2f1d[_0x67e0('0x3f')];if(!_0x551038[_0x67e0('0x3c')][_0x67e0('0x42')](_0x67e0('0x43'))){_0xa73ef7[_0x67e0('0x25')]=qs[_0x67e0('0x25')](_0x551038[_0x67e0('0x3c')][_0x67e0('0x25')]);_0xa73ef7['offset']=qs[_0x67e0('0x27')](_0x551038['query'][_0x67e0('0x27')]);}_0xa73ef7[_0x67e0('0x44')]=qs[_0x67e0('0x45')](_0x551038[_0x67e0('0x3c')][_0x67e0('0x45')]);_0xa73ef7[_0x67e0('0x46')]=qs[_0x67e0('0x3d')](_[_0x67e0('0x47')](_0x551038['query'],_0x1f2f1d[_0x67e0('0x3d')]));_0xa73ef7[_0x67e0('0x46')][_0x67e0('0x63')]=_0x1538da['id'];if(_0x551038['query']['filter']){_0xa73ef7[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0xa73ef7[_0x67e0('0x46')],{'$or':_[_0x67e0('0x3a')](_0xa73ef7[_0x67e0('0x40')],function(_0xd93a){var _0x2a403d={};_0x2a403d[_0xd93a]={'$like':'%'+_0x551038[_0x67e0('0x3c')][_0x67e0('0x48')]+'%'};return _0x2a403d;})});}_0xa73ef7=_[_0x67e0('0x49')]({},_0xa73ef7,_0x551038[_0x67e0('0x4c')]);return db[_0x67e0('0x60')][_0x67e0('0x26')]({'where':_0xa73ef7[_0x67e0('0x46')]})[_0x67e0('0x2c')](function(_0x28aa96){_0x57ca26[_0x67e0('0x26')]=_0x28aa96;if(_0x551038['query'][_0x67e0('0x4d')]){_0xa73ef7[_0x67e0('0x4e')]=[{'all':!![]}];}return db[_0x67e0('0x60')][_0x67e0('0x4f')](_0xa73ef7);})[_0x67e0('0x2c')](function(_0x37d3e7){_0x57ca26[_0x67e0('0x50')]=_0x37d3e7;return _0x57ca26;});}})[_0x67e0('0x2c')](respondWithFilteredResult(_0x436525,_0xa73ef7))['catch'](handleError(_0x436525,null));};exports[_0x67e0('0x64')]=function(_0x44c752,_0x8f6cb5,_0x4041e3){return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x44c752['params']['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x8f6cb5,null))[_0x67e0('0x2c')](function(_0x2be77c){if(_0x2be77c){return _0x2be77c[_0x67e0('0x64')](_0x44c752[_0x67e0('0x3c')][_0x67e0('0x65')]);}})[_0x67e0('0x2c')](respondWithStatusCode(_0x8f6cb5,null))[_0x67e0('0x51')](handleError(_0x8f6cb5,null));};exports[_0x67e0('0x66')]=function(_0x10c972,_0x19f9fb,_0x25bd39){return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x10c972['params']['id']}})['then'](handleEntityNotFound(_0x19f9fb,null))[_0x67e0('0x2c')](function(_0x38c327){if(_0x38c327){var _0x428689=[];var _0x354013={'success':[],'errors':[]};return db[_0x67e0('0x67')]['describe']()[_0x67e0('0x2c')](function(_0x3e643d){if(_0x10c972[_0x67e0('0x5c')]['tags']&&_[_0x67e0('0x68')](_0x10c972['body']['tags'])){if(_0x10c972[_0x67e0('0x5c')][_0x67e0('0x69')]['length']){_0x10c972[_0x67e0('0x5c')][_0x67e0('0x69')]=_0x10c972[_0x67e0('0x5c')][_0x67e0('0x69')][_0x67e0('0x6a')](';')+';';}else{_0x10c972[_0x67e0('0x5c')][_0x67e0('0x69')]=null;}}else{_0x10c972[_0x67e0('0x5c')][_0x67e0('0x69')]=null;}if(_0x10c972['body']&&_[_0x67e0('0x68')](_0x10c972['body'])){for(var _0x57e993=0x0;_0x57e993<_0x10c972[_0x67e0('0x5c')][_0x67e0('0x41')];_0x57e993+=0x1){_0x10c972[_0x67e0('0x5c')][_0x57e993]['ListId']=_0x10c972[_0x67e0('0x5e')]['id'];_0x428689[_0x67e0('0x6b')](_0x10c972['body'][_0x57e993]);}return BPromise[_0x67e0('0x6c')](_0x428689,function(_0x11bf48){return db['CmContact']['create'](_[_0x67e0('0x6d')](_0x11bf48,[_0x67e0('0x65'),'id'])||{},{'fields':_[_0x67e0('0x3b')](_0x3e643d),'raw':!![]})[_0x67e0('0x2c')](function(_0x29e714){_0x354013[_0x67e0('0x6e')][_0x67e0('0x6b')](_0x29e714[_0x67e0('0x6f')]);})[_0x67e0('0x51')](function(_0x53cffc){_0x354013[_0x67e0('0x70')][_0x67e0('0x6b')]({'data':_0x11bf48,'error':_0x53cffc['message']});});})[_0x67e0('0x2c')](function(_0x3319c6){return _0x354013;})[_0x67e0('0x51')](function(_0x5877ea){return _0x5877ea;});}else{_0x19f9fb[_0x67e0('0x22')](0x190)['json']({'message':_0x67e0('0x71')});}});}})['then'](respondWithResult(_0x19f9fb,null))[_0x67e0('0x51')](handleError(_0x19f9fb,null));};exports[_0x67e0('0x72')]=function(_0x5606c5,_0x55b4ee,_0x5772d0){var _0x9cc511;return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x5606c5[_0x67e0('0x5e')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x67e0('0x2c')](handleEntityNotFound(_0x55b4ee,null))[_0x67e0('0x2c')](function(_0x4eb9b4){if(_0x4eb9b4){_0x9cc511=_0x4eb9b4;return db[_0x67e0('0x67')][_0x67e0('0x37')];}})['then'](function(_0x2a1995){if(_0x2a1995){var _0x3e6764={};var _0x3ce138={};_0x3ce138[_0x67e0('0x3f')]=_[_0x67e0('0x73')](_[_0x67e0('0x3b')](_0x2a1995),_[_0x67e0('0x3a')](_0x9cc511[_0x67e0('0x74')],function(_0x368aa4){return util[_0x67e0('0x75')](_0x67e0('0x76'),_0x368aa4['id']);}));_0x3ce138[_0x67e0('0x3c')]=_[_0x67e0('0x3b')](_0x5606c5[_0x67e0('0x3c')]);_0x3ce138[_0x67e0('0x3d')]=_['intersection'](_0x3ce138['model'],_0x3ce138[_0x67e0('0x3c')]);_0x3e6764[_0x67e0('0x40')]=_['intersection'](_0x3ce138[_0x67e0('0x3f')],qs[_0x67e0('0x53')](_0x5606c5['query'][_0x67e0('0x53')]));_0x3e6764[_0x67e0('0x40')]=_0x3e6764[_0x67e0('0x40')][_0x67e0('0x41')]?_0x3e6764[_0x67e0('0x40')]:_0x3ce138['model'];if(!_0x5606c5[_0x67e0('0x3c')][_0x67e0('0x42')](_0x67e0('0x43'))){_0x3e6764[_0x67e0('0x25')]=qs['limit'](_0x5606c5[_0x67e0('0x3c')]['limit']);_0x3e6764[_0x67e0('0x27')]=qs[_0x67e0('0x27')](_0x5606c5[_0x67e0('0x3c')][_0x67e0('0x27')]);}_0x3e6764[_0x67e0('0x44')]=qs[_0x67e0('0x45')](_0x5606c5[_0x67e0('0x3c')][_0x67e0('0x45')]);_0x3e6764[_0x67e0('0x46')]=qs['filters'](_[_0x67e0('0x47')](_0x5606c5[_0x67e0('0x3c')],_0x3ce138[_0x67e0('0x3d')]));_0x3e6764[_0x67e0('0x77')]=!![];if(_0x5606c5[_0x67e0('0x3c')][_0x67e0('0x48')]){_0x3e6764[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0x3e6764[_0x67e0('0x46')],{'$or':_['map'](_0x3e6764[_0x67e0('0x40')],function(_0x560906){var _0x3337a6={};_0x3337a6[_0x560906]={'$like':'%'+_0x5606c5[_0x67e0('0x3c')][_0x67e0('0x48')]+'%'};return _0x3337a6;})});}_0x3e6764=_[_0x67e0('0x49')]({},_0x3e6764,_0x5606c5[_0x67e0('0x4c')]);return _0x9cc511['getContacts'](_0x3e6764);}})[_0x67e0('0x2c')](respondWithResult(_0x55b4ee,null))[_0x67e0('0x51')](handleError(_0x55b4ee,null));};exports['getContactsCsv']=function(_0x309f38,_0x51d182,_0x103572){var _0x5af785;return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x309f38['params']['id']},'include':[{'model':db[_0x67e0('0x78')],'as':_0x67e0('0x74')}]})['then'](handleEntityNotFound(_0x51d182,null))[_0x67e0('0x2c')](function(_0x787618){if(_0x787618){_0x5af785=_0x787618;return db['CmContact'][_0x67e0('0x37')];}})[_0x67e0('0x2c')](function(_0x21ff88){if(_0x21ff88){var _0x455635={};var _0x312127={};_0x312127[_0x67e0('0x3f')]=_['concat'](_[_0x67e0('0x3b')](_0x21ff88),_[_0x67e0('0x3a')](_0x5af785[_0x67e0('0x74')],function(_0x35a013){return util[_0x67e0('0x75')](_0x67e0('0x76'),_0x35a013['id']);}));_0x312127[_0x67e0('0x3c')]=_[_0x67e0('0x3b')](_0x309f38['query']);_0x312127[_0x67e0('0x3d')]=_[_0x67e0('0x3e')](_0x312127[_0x67e0('0x3f')],_0x312127[_0x67e0('0x3c')]);_0x455635[_0x67e0('0x40')]=_[_0x67e0('0x3e')](_0x312127[_0x67e0('0x3f')],qs[_0x67e0('0x53')](_0x309f38[_0x67e0('0x3c')][_0x67e0('0x53')]));_0x455635['attributes']=_0x455635[_0x67e0('0x40')][_0x67e0('0x41')]?_0x455635[_0x67e0('0x40')]:_0x312127['model'];if(!_0x309f38[_0x67e0('0x3c')][_0x67e0('0x42')]('nolimit')){_0x455635[_0x67e0('0x25')]=qs['limit'](_0x309f38[_0x67e0('0x3c')][_0x67e0('0x25')]);_0x455635[_0x67e0('0x27')]=qs['offset'](_0x309f38[_0x67e0('0x3c')]['offset']);}_0x455635[_0x67e0('0x44')]=qs[_0x67e0('0x45')](_0x309f38['query'][_0x67e0('0x45')]);_0x455635[_0x67e0('0x46')]=qs[_0x67e0('0x3d')](_[_0x67e0('0x47')](_0x309f38[_0x67e0('0x3c')],_0x312127[_0x67e0('0x3d')]));_0x455635['raw']=!![];if(_0x309f38[_0x67e0('0x3c')][_0x67e0('0x48')]){_0x455635[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0x455635['where'],{'$or':_[_0x67e0('0x3a')](_0x455635['attributes'],function(_0x140742){var _0x376559={};_0x376559[_0x140742]={'$like':'%'+_0x309f38['query'][_0x67e0('0x48')]+'%'};return _0x376559;})});}_0x455635=_[_0x67e0('0x49')]({},_0x455635,_0x309f38[_0x67e0('0x4c')]);return _0x5af785['getContacts'](_0x455635);}})[_0x67e0('0x2c')](function(_0x3ed59d){if(!_['isEmpty'](_0x3ed59d)){var _0x3867d3=toCsv(_0x3ed59d);var _0x362d9e=Date['now']();fs[_0x67e0('0x79')](util[_0x67e0('0x75')](_0x67e0('0x7a'),_0x5af785['id'],_0x362d9e),_0x3867d3);_0x51d182[_0x67e0('0x7b')](_0x67e0('0x7c'),_0x67e0('0x7d')+util[_0x67e0('0x75')](_0x67e0('0x7e'),_0x5af785['id'],_0x362d9e));_0x51d182[_0x67e0('0x7b')](_0x67e0('0x7f'),_0x67e0('0x80'));return _0x51d182[_0x67e0('0x81')](util['format'](_0x67e0('0x7a'),_0x5af785['id'],_0x362d9e));}else{return _0x51d182[_0x67e0('0x30')](0xcc);}})[_0x67e0('0x51')](handleError(_0x51d182,null));};exports['addCustomField']=function(_0x20e7be,_0x7713dd,_0x5d94f6){var _0x34ab57;delete _0x20e7be[_0x67e0('0x5c')]['id'];return db[_0x67e0('0x36')][_0x67e0('0x62')]({'where':{'id':_0x20e7be[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x7713dd,null))[_0x67e0('0x2c')](function(_0x361195){if(_0x361195){return db[_0x67e0('0x82')][_0x67e0('0x83')](function(_0x2bcea1){return db['CmCustomField']['create'](_0x20e7be[_0x67e0('0x5c')],{'transaction':_0x2bcea1})[_0x67e0('0x2c')](function(_0x3a663d){_0x34ab57=_0x3a663d;return _0x361195['addCustomFields'](_0x3a663d,{'transaction':_0x2bcea1});})[_0x67e0('0x2c')](function(){var _0x3d940a={'type':db[_0x67e0('0x84')][_0x67e0('0x85')],'transaction':_0x2bcea1};switch(_0x20e7be[_0x67e0('0x5c')][_0x67e0('0x4a')]){case _0x67e0('0x86'):_0x3d940a[_0x67e0('0x4a')]=db[_0x67e0('0x84')][_0x67e0('0x85')];break;case'number':_0x3d940a[_0x67e0('0x4a')]=db[_0x67e0('0x84')]['INTEGER'];break;case _0x67e0('0x87'):_0x3d940a[_0x67e0('0x4a')]=db[_0x67e0('0x84')][_0x67e0('0x88')];_0x3d940a[_0x67e0('0x89')]=![];break;default:}return db[_0x67e0('0x82')][_0x67e0('0x8a')][_0x67e0('0x8b')](_0x67e0('0x8c'),util[_0x67e0('0x75')]('cf_%s',_0x34ab57['id']),_0x3d940a);})[_0x67e0('0x2c')](function(){return _0x34ab57;});});}})['then'](respondWithResult(_0x7713dd,null))[_0x67e0('0x51')](handleError(_0x7713dd,null));};exports['getCustomFields']=function(_0x2511bd,_0x514474,_0x494d1d){var _0x51e462={};var _0x4d2432={};var _0x271b56;var _0x3faa49;return db[_0x67e0('0x36')][_0x67e0('0x62')]({'where':{'id':_0x2511bd[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x514474,null))['then'](function(_0x23ddf8){if(_0x23ddf8){_0x271b56=_0x23ddf8;_0x4d2432[_0x67e0('0x3f')]=_[_0x67e0('0x3b')](db[_0x67e0('0x78')][_0x67e0('0x37')]);_0x4d2432['query']=_[_0x67e0('0x3b')](_0x2511bd['query']);_0x4d2432['filters']=_[_0x67e0('0x3e')](_0x4d2432[_0x67e0('0x3f')],_0x4d2432['query']);_0x51e462['attributes']=_['intersection'](_0x4d2432[_0x67e0('0x3f')],qs['fields'](_0x2511bd[_0x67e0('0x3c')][_0x67e0('0x53')]));_0x51e462[_0x67e0('0x40')]=_0x51e462[_0x67e0('0x40')][_0x67e0('0x41')]?_0x51e462[_0x67e0('0x40')]:_0x4d2432['model'];_0x51e462[_0x67e0('0x44')]=qs['sort'](_0x2511bd[_0x67e0('0x3c')][_0x67e0('0x45')]);_0x51e462['where']=qs['filters'](_[_0x67e0('0x47')](_0x2511bd['query'],_0x4d2432[_0x67e0('0x3d')]));_0x51e462[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0x51e462[_0x67e0('0x46')],{'$or':[{'ListId':_0x23ddf8['id']},{'ListId':null}]});if(_0x2511bd[_0x67e0('0x3c')][_0x67e0('0x48')]){_0x51e462[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0x51e462['where'],{'$or':_[_0x67e0('0x3a')](_0x51e462['attributes'],function(_0x272650){var _0x12ca4a={};_0x12ca4a[_0x272650]={'$like':'%'+_0x2511bd[_0x67e0('0x3c')][_0x67e0('0x48')]+'%'};return _0x12ca4a;})});}_0x51e462=_['merge']({},_0x51e462,_0x2511bd['options']);return db[_0x67e0('0x78')][_0x67e0('0x8d')](_0x51e462);}})[_0x67e0('0x2c')](respondWithResult(_0x514474,null))['catch'](handleError(_0x514474,null));};exports[_0x67e0('0x8e')]=function(_0x2c0d18,_0x371a50,_0x145301){return db['CmList'][_0x67e0('0x54')]({'where':{'id':_0x2c0d18['params']['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x371a50,null))[_0x67e0('0x2c')](function(_0x1eb601){if(_0x1eb601){return _0x1eb601[_0x67e0('0x8e')](_0x2c0d18[_0x67e0('0x5c')][_0x67e0('0x65')],_[_0x67e0('0x6d')](_0x2c0d18[_0x67e0('0x5c')],[_0x67e0('0x65'),'id'])||{})['spread'](function(_0x2fc97d){for(var _0x1141f8=0x0;_0x1141f8<_0x2c0d18[_0x67e0('0x5c')][_0x67e0('0x65')]['length'];_0x1141f8+=0x1){socket[_0x67e0('0x8f')](_0x67e0('0x90'),{'UserId':Number(_0x2c0d18[_0x67e0('0x5c')]['ids'][_0x1141f8]),'CmListId':Number(_0x2c0d18[_0x67e0('0x5e')]['id'])});}return _0x2fc97d;});}})[_0x67e0('0x2c')](respondWithResult(_0x371a50,null))[_0x67e0('0x51')](handleError(_0x371a50,null));};exports[_0x67e0('0x91')]=function(_0xf7a9e5,_0x53962b,_0x4bb1c3){return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0xf7a9e5['params']['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x53962b,null))[_0x67e0('0x2c')](function(_0x5736f1){if(_0x5736f1){return _0x5736f1[_0x67e0('0x91')](_0xf7a9e5['query'][_0x67e0('0x65')])[_0x67e0('0x2c')](function(){if(_[_0x67e0('0x68')](_0xf7a9e5[_0x67e0('0x3c')][_0x67e0('0x65')])){for(var _0x35bee1=0x0;_0x35bee1<_0xf7a9e5['query'][_0x67e0('0x65')][_0x67e0('0x41')];_0x35bee1+=0x1){socket['emit'](_0x67e0('0x92'),{'UserId':Number(_0xf7a9e5[_0x67e0('0x3c')][_0x67e0('0x65')][_0x35bee1]),'CmListId':Number(_0xf7a9e5[_0x67e0('0x5e')]['id'])});}}else{socket[_0x67e0('0x8f')](_0x67e0('0x92'),{'UserId':Number(_0xf7a9e5[_0x67e0('0x3c')][_0x67e0('0x65')]),'CmListId':Number(_0xf7a9e5['params']['id'])});}});}})[_0x67e0('0x2c')](respondWithStatusCode(_0x53962b,null))[_0x67e0('0x51')](handleError(_0x53962b,null));};exports[_0x67e0('0x93')]=function(_0x2c3dc7,_0x499803,_0x35fafc){var _0x479d09={};var _0x3fdcae={};var _0x324679;var _0x31cf9d;return db['CmList'][_0x67e0('0x62')]({'where':{'id':_0x2c3dc7[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x499803,null))[_0x67e0('0x2c')](function(_0x4c3278){if(_0x4c3278){_0x324679=_0x4c3278;_0x3fdcae[_0x67e0('0x3f')]=_['keys'](db[_0x67e0('0x94')][_0x67e0('0x37')]);_0x3fdcae[_0x67e0('0x3c')]=_[_0x67e0('0x3b')](_0x2c3dc7[_0x67e0('0x3c')]);_0x3fdcae[_0x67e0('0x3d')]=_[_0x67e0('0x3e')](_0x3fdcae[_0x67e0('0x3f')],_0x3fdcae[_0x67e0('0x3c')]);_0x479d09[_0x67e0('0x40')]=_[_0x67e0('0x3e')](_0x3fdcae['model'],qs[_0x67e0('0x53')](_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x53')]));_0x479d09[_0x67e0('0x40')]=_0x479d09['attributes']['length']?_0x479d09[_0x67e0('0x40')]:_0x3fdcae[_0x67e0('0x3f')];_0x479d09[_0x67e0('0x44')]=qs[_0x67e0('0x45')](_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x45')]);_0x479d09[_0x67e0('0x46')]=qs['filters'](_[_0x67e0('0x47')](_0x2c3dc7['query'],_0x3fdcae[_0x67e0('0x3d')]));if(_0x2c3dc7['query']['filter']){_0x479d09[_0x67e0('0x46')]=_['merge'](_0x479d09[_0x67e0('0x46')],{'$or':_[_0x67e0('0x3a')](_0x479d09[_0x67e0('0x40')],function(_0x68038f){var _0x3f2734={};_0x3f2734[_0x68038f]={'$like':'%'+_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x48')]+'%'};return _0x3f2734;})});}_0x479d09=_[_0x67e0('0x49')]({},_0x479d09,_0x2c3dc7[_0x67e0('0x4c')]);return _0x324679[_0x67e0('0x93')](_0x479d09);}})[_0x67e0('0x2c')](function(_0x2f8945){if(_0x2f8945){_0x31cf9d=_0x2f8945[_0x67e0('0x41')];if(!_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x42')](_0x67e0('0x43'))){_0x479d09[_0x67e0('0x25')]=qs['limit'](_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x25')]);_0x479d09[_0x67e0('0x27')]=qs[_0x67e0('0x27')](_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x27')]);}return _0x324679['getAgents'](_0x479d09);}})['then'](function(_0x4c8690){if(_0x4c8690){return _0x4c8690?{'count':_0x31cf9d,'rows':_0x4c8690}:null;}})['then'](respondWithResult(_0x499803,null))[_0x67e0('0x51')](handleError(_0x499803,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index b6ee07f..ee12924 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x2b4da2,_0xd6c6c7){var _0x564a35=function(_0x12c6a9){while(--_0x12c6a9){_0x2b4da2['push'](_0x2b4da2['shift']());}};_0x564a35(++_0xd6c6c7);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x55ca,0x126));var _0xa55c=function(_0x335f37,_0x37302b){_0x335f37=_0x335f37-0x0;var _0x1768f4=_0x55ca[_0x335f37];return _0x1768f4;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 18c2235..57e1993 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 _0x878f=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x878f,0x173));var _0xf878=function(_0x5e85b2,_0x2d4b38){_0x5e85b2=_0x5e85b2-0x0;var _0x3b428a=_0x878f[_0x5e85b2];return _0x3b428a;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var moment=require(_0xf878('0x3'));var BPromise=require(_0xf878('0x4'));var rp=require(_0xf878('0x5'));var fs=require('fs');var path=require(_0xf878('0x6'));var rimraf=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var attributes=require(_0xf878('0x9'));module[_0xf878('0xa')]=function(_0x4bc9aa,_0x4ac8d8){return _0x4bc9aa[_0xf878('0xb')](_0xf878('0xc'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa75b=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0xa75b,0x170));var _0xba75=function(_0x37e191,_0x578ce2){_0x37e191=_0x37e191-0x0;var _0x59d44a=_0xa75b[_0x37e191];return _0x59d44a;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));module[_0xba75('0x9')]=function(_0x41afc9,_0x2baa28){return _0x41afc9[_0xba75('0xa')](_0xba75('0xb'),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 6624bf3..44e2e89 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 _0x1802=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','./cmList.socket','register','then','request\x20sent','debug','stringify','error','code','CmList,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x52b8eb,_0x395554){var _0x4b2c00=function(_0x4559bd){while(--_0x4559bd){_0x52b8eb['push'](_0x52b8eb['shift']());}};_0x4b2c00(++_0x395554);}(_0x1802,0x1e6));var _0x2180=function(_0x3f0b1e,_0x4ece3d){_0x3f0b1e=_0x3f0b1e-0x0;var _0x300d2d=_0x1802[_0x3f0b1e];return _0x300d2d;};'use strict';var _=require(_0x2180('0x0'));var util=require(_0x2180('0x1'));var moment=require(_0x2180('0x2'));var BPromise=require(_0x2180('0x3'));var rs=require(_0x2180('0x4'));var fs=require('fs');var Redis=require(_0x2180('0x5'));var db=require(_0x2180('0x6'))['db'];var utils=require(_0x2180('0x7'));var logger=require(_0x2180('0x8'))(_0x2180('0x9'));var config=require(_0x2180('0xa'));var jayson=require(_0x2180('0xb'));var client=jayson['client'][_0x2180('0xc')]({'port':0x232a});config[_0x2180('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2180('0xe'))[_0x2180('0xf')](socket);function respondWithRpcPromise(_0x56814e,_0x1d1282,_0x230c04){return new BPromise(function(_0x5d6fce,_0x1779ca){return client['request'](_0x56814e,_0x230c04)[_0x2180('0x10')](function(_0x2a76b8){logger['info']('CmList,\x20%s,\x20%s',_0x1d1282,_0x2180('0x11'));logger[_0x2180('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x1d1282,_0x2180('0x11'),JSON[_0x2180('0x13')](_0x2a76b8));if(_0x2a76b8[_0x2180('0x14')]){if(_0x2a76b8[_0x2180('0x14')][_0x2180('0x15')]===0x1f4){logger['error'](_0x2180('0x16'),_0x1d1282,_0x2a76b8[_0x2180('0x14')]['message']);return _0x1779ca(_0x2a76b8['error'][_0x2180('0x17')]);}logger[_0x2180('0x14')]('CmList,\x20%s,\x20%s',_0x1d1282,_0x2a76b8[_0x2180('0x14')][_0x2180('0x17')]);return _0x5d6fce(_0x2a76b8[_0x2180('0x14')][_0x2180('0x17')]);}else{logger[_0x2180('0x18')](_0x2180('0x16'),_0x1d1282,_0x2180('0x11'));_0x5d6fce(_0x2a76b8['result'][_0x2180('0x17')]);}})[_0x2180('0x19')](function(_0xab8da8){logger[_0x2180('0x14')]('CmList,\x20%s,\x20%s',_0x1d1282,_0xab8da8);_0x1779ca(_0xab8da8);});});} \ No newline at end of file +var _0x37f7=['code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2a4dda,_0x394a1b){var _0xe725e=function(_0x5c005c){while(--_0x5c005c){_0x2a4dda['push'](_0x2a4dda['shift']());}};_0xe725e(++_0x394a1b);}(_0x37f7,0x1d7));var _0x737f=function(_0x15f39e,_0x473b61){_0x15f39e=_0x15f39e-0x0;var _0xb4f8e5=_0x37f7[_0x15f39e];return _0xb4f8e5;};'use strict';var _=require(_0x737f('0x0'));var util=require(_0x737f('0x1'));var moment=require(_0x737f('0x2'));var BPromise=require(_0x737f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x737f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x737f('0x5'));var logger=require(_0x737f('0x6'))('rpc');var config=require(_0x737f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x737f('0x8')]['http']({'port':0x232a});config[_0x737f('0x9')]=_[_0x737f('0xa')](config['redis'],{'host':_0x737f('0xb'),'port':0x18eb});var socket=require(_0x737f('0xc'))(new Redis(config[_0x737f('0x9')]));require(_0x737f('0xd'))['register'](socket);function respondWithRpcPromise(_0x4c37c5,_0x290a5f,_0x154f81){return new BPromise(function(_0x33f0a3,_0x2dc1d2){return client[_0x737f('0xe')](_0x4c37c5,_0x154f81)[_0x737f('0xf')](function(_0x181636){logger[_0x737f('0x10')](_0x737f('0x11'),_0x290a5f,'request\x20sent');logger[_0x737f('0x12')](_0x737f('0x13'),_0x290a5f,_0x737f('0x14'),JSON[_0x737f('0x15')](_0x181636));if(_0x181636[_0x737f('0x16')]){if(_0x181636['error'][_0x737f('0x17')]===0x1f4){logger[_0x737f('0x16')](_0x737f('0x11'),_0x290a5f,_0x181636['error'][_0x737f('0x18')]);return _0x2dc1d2(_0x181636[_0x737f('0x16')][_0x737f('0x18')]);}logger[_0x737f('0x16')]('CmList,\x20%s,\x20%s',_0x290a5f,_0x181636[_0x737f('0x16')][_0x737f('0x18')]);return _0x33f0a3(_0x181636[_0x737f('0x16')]['message']);}else{logger[_0x737f('0x10')](_0x737f('0x11'),_0x290a5f,_0x737f('0x14'));_0x33f0a3(_0x181636['result'][_0x737f('0x18')]);}})[_0x737f('0x19')](function(_0x4e8a4a){logger[_0x737f('0x16')](_0x737f('0x11'),_0x290a5f,_0x4e8a4a);_0x2dc1d2(_0x4e8a4a);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index b1bcd3a..980ff31 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 _0xc526=['length','save','update','emit','removeListener','register'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xc526,0x1bd));var _0x6c52=function(_0x5cc0d6,_0x39b4ae){_0x5cc0d6=_0x5cc0d6-0x0;var _0x47f300=_0xc526[_0x5cc0d6];return _0x47f300;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x6c52('0x0'),'remove',_0x6c52('0x1')];function createListener(_0x470878,_0x18e097){return function(_0x195211){_0x18e097[_0x6c52('0x2')](_0x470878,_0x195211);};}function removeListener(_0x21fee6,_0x1f8fe3){return function(){CmListEvents[_0x6c52('0x3')](_0x21fee6,_0x1f8fe3);};}exports[_0x6c52('0x4')]=function(_0x4cc61b){for(var _0x457ca2=0x0,_0x18f5e7=events[_0x6c52('0x5')];_0x457ca2<_0x18f5e7;_0x457ca2++){var _0x40a391=events[_0x457ca2];var _0x48f62c=createListener('cmList:'+_0x40a391,_0x4cc61b);CmListEvents['on'](_0x40a391,_0x48f62c);}}; \ No newline at end of file +var _0xebff=['register','length','remove','update','removeListener'];(function(_0x58b5cf,_0x3b1891){var _0x4d4a1e=function(_0x55f5f4){while(--_0x55f5f4){_0x58b5cf['push'](_0x58b5cf['shift']());}};_0x4d4a1e(++_0x3b1891);}(_0xebff,0x147));var _0xfebf=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xebff[_0x2080a3];return _0x8d7d17;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0xfebf('0x0'),_0xfebf('0x1')];function createListener(_0x2159cc,_0x42b1ac){return function(_0x2dd296){_0x42b1ac['emit'](_0x2159cc,_0x2dd296);};}function removeListener(_0x16ad6e,_0x1a8084){return function(){CmListEvents[_0xfebf('0x2')](_0x16ad6e,_0x1a8084);};}exports[_0xfebf('0x3')]=function(_0x309920){for(var _0x5f2e65=0x0,_0x33a544=events[_0xfebf('0x4')];_0x5f2e65<_0x33a544;_0x5f2e65++){var _0x2b7252=events[_0x5f2e65];var _0x3ecfa9=createListener('cmList:'+_0x2b7252,_0x309920);CmListEvents['on'](_0x2b7252,_0x3ecfa9);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index ba7efe8..0681bdb 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 _0x747c=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getAgents','post','create','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','put','destroy','delete','removeDispositions','removeAgents','exports','multer','util'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x747c,0x196));var _0xc747=function(_0x3b0b02,_0x37c8ee){_0x3b0b02=_0x3b0b02-0x0;var _0x22041c=_0x747c[_0x3b0b02];return _0x22041c;};'use strict';var multer=require(_0xc747('0x0'));var util=require(_0xc747('0x1'));var path=require(_0xc747('0x2'));var timeout=require('connect-timeout');var express=require(_0xc747('0x3'));var router=express['Router']();var fs_extra=require(_0xc747('0x4'));var auth=require(_0xc747('0x5'));var interaction=require(_0xc747('0x6'));var config=require(_0xc747('0x7'));var controller=require('./cmList.controller');router[_0xc747('0x8')]('/',auth[_0xc747('0x9')](),controller[_0xc747('0xa')]);router['get'](_0xc747('0xb'),auth[_0xc747('0x9')](),controller[_0xc747('0xc')]);router['get'](_0xc747('0xd'),auth[_0xc747('0x9')](),controller[_0xc747('0xe')]);router[_0xc747('0x8')](_0xc747('0xf'),auth[_0xc747('0x9')](),controller['getDispositions']);router['get'](_0xc747('0x10'),auth[_0xc747('0x9')](),controller[_0xc747('0x11')]);router[_0xc747('0x8')](_0xc747('0x12'),auth[_0xc747('0x9')](),controller[_0xc747('0x13')]);router['get']('/:id/fields',auth[_0xc747('0x9')](),controller['getCustomFields']);router[_0xc747('0x8')]('/:id/users',auth[_0xc747('0x9')](),controller[_0xc747('0x14')]);router[_0xc747('0x15')]('/',auth['isAuthenticated'](),controller[_0xc747('0x16')]);router['post'](_0xc747('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xc747('0x15')]('/:id/contacts',auth[_0xc747('0x9')](),controller[_0xc747('0x17')]);router[_0xc747('0x15')](_0xc747('0x18'),auth['isAuthenticated'](),controller[_0xc747('0x19')]);router['post'](_0xc747('0x1a'),auth[_0xc747('0x9')](),controller[_0xc747('0x1b')]);router[_0xc747('0x1c')](_0xc747('0xd'),auth[_0xc747('0x9')](),controller['update']);router['delete'](_0xc747('0xd'),auth[_0xc747('0x9')](),controller[_0xc747('0x1d')]);router[_0xc747('0x1e')](_0xc747('0xf'),auth[_0xc747('0x9')](),controller[_0xc747('0x1f')]);router[_0xc747('0x1e')](_0xc747('0x1a'),auth[_0xc747('0x9')](),controller[_0xc747('0x20')]);module[_0xc747('0x21')]=router; \ No newline at end of file +var _0x942c=['addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getContacts','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addContacts','/:id/fields','addCustomField'];(function(_0x9e14b2,_0x173211){var _0x5ddb08=function(_0x546af0){while(--_0x546af0){_0x9e14b2['push'](_0x9e14b2['shift']());}};_0x5ddb08(++_0x173211);}(_0x942c,0xe0));var _0xc942=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x942c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc942('0x0'));var util=require('util');var path=require(_0xc942('0x1'));var timeout=require(_0xc942('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc942('0x3'));var auth=require(_0xc942('0x4'));var interaction=require(_0xc942('0x5'));var config=require(_0xc942('0x6'));var controller=require(_0xc942('0x7'));router['get']('/',auth[_0xc942('0x8')](),controller[_0xc942('0x9')]);router[_0xc942('0xa')](_0xc942('0xb'),auth[_0xc942('0x8')](),controller[_0xc942('0xc')]);router[_0xc942('0xa')](_0xc942('0xd'),auth['isAuthenticated'](),controller[_0xc942('0xe')]);router['get'](_0xc942('0xf'),auth[_0xc942('0x8')](),controller['getDispositions']);router[_0xc942('0xa')]('/:id/contacts',auth[_0xc942('0x8')](),controller[_0xc942('0x10')]);router['get']('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0xc942('0x11')]);router[_0xc942('0xa')]('/:id/fields',auth[_0xc942('0x8')](),controller[_0xc942('0x12')]);router['get'](_0xc942('0x13'),auth['isAuthenticated'](),controller[_0xc942('0x14')]);router[_0xc942('0x15')]('/',auth[_0xc942('0x8')](),controller[_0xc942('0x16')]);router['post'](_0xc942('0xf'),auth[_0xc942('0x8')](),controller[_0xc942('0x17')]);router[_0xc942('0x15')](_0xc942('0x18'),auth[_0xc942('0x8')](),controller[_0xc942('0x19')]);router[_0xc942('0x15')](_0xc942('0x1a'),auth[_0xc942('0x8')](),controller[_0xc942('0x1b')]);router[_0xc942('0x15')](_0xc942('0x13'),auth[_0xc942('0x8')](),controller[_0xc942('0x1c')]);router[_0xc942('0x1d')](_0xc942('0xd'),auth[_0xc942('0x8')](),controller[_0xc942('0x1e')]);router[_0xc942('0x1f')](_0xc942('0xd'),auth[_0xc942('0x8')](),controller[_0xc942('0x20')]);router[_0xc942('0x1f')](_0xc942('0xf'),auth[_0xc942('0x8')](),controller[_0xc942('0x21')]);router[_0xc942('0x1f')](_0xc942('0x13'),auth[_0xc942('0x8')](),controller[_0xc942('0x22')]);module[_0xc942('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 ba75569..074cc0b 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 _0x9cd5=['STRING','VIRTUAL'];(function(_0x237c49,_0x40c939){var _0x39bc47=function(_0x41b1e9){while(--_0x41b1e9){_0x237c49['push'](_0x237c49['shift']());}};_0x39bc47(++_0x40c939);}(_0x9cd5,0x1a3));var _0x59cd=function(_0x4254cb,_0x493ef9){_0x4254cb=_0x4254cb-0x0;var _0x5f5507=_0x9cd5[_0x4254cb];return _0x5f5507;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x59cd('0x0')],'get':function(_0x448312){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x59cd('0x1')],'allowNull':![]},'operator':{'type':Sequelize[_0x59cd('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x59cd('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x979c=['VIRTUAL','field','STRING','sequelize','exports'];(function(_0x3ad737,_0x300131){var _0x16c1e2=function(_0x4c64fe){while(--_0x4c64fe){_0x3ad737['push'](_0x3ad737['shift']());}};_0x16c1e2(++_0x300131);}(_0x979c,0xd0));var _0xc979=function(_0x3ad6e6,_0x552abb){_0x3ad6e6=_0x3ad6e6-0x0;var _0x17d030=_0x979c[_0x3ad6e6];return _0x17d030;};'use strict';var Sequelize=require(_0xc979('0x0'));module[_0xc979('0x1')]={'name':{'type':Sequelize[_0xc979('0x2')],'get':function(_0x4e4b5e){return this['getDataValue'](_0xc979('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xc979('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 0b247c7..7096dc0 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(_0x37b666,_0x429468){var _0x2b0035=function(_0x3b141b){while(--_0x3b141b){_0x37b666['push'](_0x37b666['shift']());}};_0x2b0035(++_0x429468);}(_0x7a54,0x106));var _0x47a5=function(_0x4ee225,_0x280416){_0x4ee225=_0x4ee225-0x0;var _0x5740c2=_0x7a54[_0x4ee225];return _0x5740c2;};'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(_0x43a2b4,_0x1c3871){var _0x3044a1=function(_0x1f19ce){while(--_0x1f19ce){_0x43a2b4['push'](_0x43a2b4['shift']());}};_0x3044a1(++_0x1c3871);}(_0x7a54,0x106));var _0x47a5=function(_0x5149aa,_0x5e88f0){_0x5149aa=_0x5149aa-0x0;var _0x386708=_0x7a54[_0x5149aa];return _0x386708;};'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 092836a..fb1bce6 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 _0x9c69=['../../config/environment','./condition.attributes','exports','define','Condition','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0x9c69,0x71));var _0x99c6=function(_0x21bcc5,_0x3c0552){_0x21bcc5=_0x21bcc5-0x0;var _0xc62ace=_0x9c69[_0x21bcc5];return _0xc62ace;};'use strict';var _=require('lodash');var util=require(_0x99c6('0x0'));var logger=require('../../config/logger')(_0x99c6('0x1'));var moment=require(_0x99c6('0x2'));var BPromise=require(_0x99c6('0x3'));var rp=require(_0x99c6('0x4'));var fs=require('fs');var path=require(_0x99c6('0x5'));var rimraf=require(_0x99c6('0x6'));var config=require(_0x99c6('0x7'));var attributes=require(_0x99c6('0x8'));module[_0x99c6('0x9')]=function(_0x11e4bf,_0x4af159){return _0x11e4bf[_0x99c6('0xa')](_0x99c6('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc35c=['Condition','tools_conditions','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x3acbb1,_0xd43f85){var _0x585e72=function(_0x12bb95){while(--_0x12bb95){_0x3acbb1['push'](_0x3acbb1['shift']());}};_0x585e72(++_0xd43f85);}(_0xc35c,0x162));var _0xcc35=function(_0x197176,_0x24b6c3){_0x197176=_0x197176-0x0;var _0x2a5220=_0xc35c[_0x197176];return _0x2a5220;};'use strict';var _=require('lodash');var util=require(_0xcc35('0x0'));var logger=require(_0xcc35('0x1'))('api');var moment=require(_0xcc35('0x2'));var BPromise=require(_0xcc35('0x3'));var rp=require(_0xcc35('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc35('0x5'));var config=require(_0xcc35('0x6'));var attributes=require(_0xcc35('0x7'));module[_0xcc35('0x8')]=function(_0x19fb6a,_0x2fde71){return _0x19fb6a['define'](_0xcc35('0x9'),attributes,{'tableName':_0xcc35('0xa'),'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 4fe61fa..302966f 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 _0xc62e=['stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x49239a,_0x1fd222){var _0x4382f0=function(_0xe2ef3a){while(--_0xe2ef3a){_0x49239a['push'](_0x49239a['shift']());}};_0x4382f0(++_0x1fd222);}(_0xc62e,0x116));var _0xec62=function(_0x283fd1,_0x5a2a3e){_0x283fd1=_0x283fd1-0x0;var _0x4e6def=_0xc62e[_0x283fd1];return _0x4e6def;};'use strict';var _=require(_0xec62('0x0'));var util=require('util');var moment=require(_0xec62('0x1'));var BPromise=require(_0xec62('0x2'));var rs=require(_0xec62('0x3'));var fs=require('fs');var Redis=require(_0xec62('0x4'));var db=require(_0xec62('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec62('0x6'))('rpc');var config=require(_0xec62('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xec62('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14216b,_0x592a16,_0x3fac0f){return new BPromise(function(_0x289fa0,_0x5b0314){return client[_0xec62('0x9')](_0x14216b,_0x3fac0f)[_0xec62('0xa')](function(_0x4451e0){logger[_0xec62('0xb')](_0xec62('0xc'),_0x592a16,'request\x20sent');logger[_0xec62('0xd')](_0xec62('0xe'),_0x592a16,_0xec62('0xf'),JSON[_0xec62('0x10')](_0x4451e0));if(_0x4451e0[_0xec62('0x11')]){if(_0x4451e0[_0xec62('0x11')][_0xec62('0x12')]===0x1f4){logger[_0xec62('0x11')](_0xec62('0xc'),_0x592a16,_0x4451e0[_0xec62('0x11')][_0xec62('0x13')]);return _0x5b0314(_0x4451e0[_0xec62('0x11')][_0xec62('0x13')]);}logger[_0xec62('0x11')](_0xec62('0xc'),_0x592a16,_0x4451e0[_0xec62('0x11')][_0xec62('0x13')]);return _0x289fa0(_0x4451e0[_0xec62('0x11')][_0xec62('0x13')]);}else{logger[_0xec62('0xb')](_0xec62('0xc'),_0x592a16,_0xec62('0xf'));_0x289fa0(_0x4451e0[_0xec62('0x14')][_0xec62('0x13')]);}})['catch'](function(_0x163ce1){logger[_0xec62('0x11')](_0xec62('0xc'),_0x592a16,_0x163ce1);_0x5b0314(_0x163ce1);});});} \ No newline at end of file +var _0x127a=['message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','Condition,\x20%s,\x20%s'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0x127a,0x9d));var _0xa127=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x127a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xa127('0x0'));var util=require('util');var moment=require(_0xa127('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa127('0x2'));var db=require(_0xa127('0x3'))['db'];var utils=require(_0xa127('0x4'));var logger=require(_0xa127('0x5'))(_0xa127('0x6'));var config=require(_0xa127('0x7'));var jayson=require(_0xa127('0x8'));var client=jayson[_0xa127('0x9')][_0xa127('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ac1e6,_0x169d26,_0x4bdb55){return new BPromise(function(_0x2d5677,_0x1e8de6){return client[_0xa127('0xb')](_0x3ac1e6,_0x4bdb55)['then'](function(_0x426315){logger[_0xa127('0xc')]('Condition,\x20%s,\x20%s',_0x169d26,_0xa127('0xd'));logger[_0xa127('0xe')](_0xa127('0xf'),_0x169d26,_0xa127('0xd'),JSON[_0xa127('0x10')](_0x426315));if(_0x426315[_0xa127('0x11')]){if(_0x426315[_0xa127('0x11')]['code']===0x1f4){logger[_0xa127('0x11')](_0xa127('0x12'),_0x169d26,_0x426315[_0xa127('0x11')]['message']);return _0x1e8de6(_0x426315['error'][_0xa127('0x13')]);}logger[_0xa127('0x11')](_0xa127('0x12'),_0x169d26,_0x426315['error'][_0xa127('0x13')]);return _0x2d5677(_0x426315[_0xa127('0x11')][_0xa127('0x13')]);}else{logger[_0xa127('0xc')]('Condition,\x20%s,\x20%s',_0x169d26,_0xa127('0xd'));_0x2d5677(_0x426315[_0xa127('0x14')]['message']);}})[_0xa127('0x15')](function(_0x7b34c3){logger[_0xa127('0x11')](_0xa127('0x12'),_0x169d26,_0x7b34c3);_0x1e8de6(_0x7b34c3);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index b527384..ffe9eea 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 _0x2577=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','delete','isAuthenticated','exports','multer','util','path','express'];(function(_0x31b882,_0x1f5c3e){var _0x343154=function(_0x21ff50){while(--_0x21ff50){_0x31b882['push'](_0x31b882['shift']());}};_0x343154(++_0x1f5c3e);}(_0x2577,0x1e6));var _0x7257=function(_0x332bb4,_0x24246d){_0x332bb4=_0x332bb4-0x0;var _0x136f0b=_0x2577[_0x332bb4];return _0x136f0b;};'use strict';var multer=require(_0x7257('0x0'));var util=require(_0x7257('0x1'));var path=require(_0x7257('0x2'));var timeout=require('connect-timeout');var express=require(_0x7257('0x3'));var router=express['Router']();var fs_extra=require(_0x7257('0x4'));var auth=require(_0x7257('0x5'));var interaction=require(_0x7257('0x6'));var config=require(_0x7257('0x7'));var controller=require(_0x7257('0x8'));router[_0x7257('0x9')](_0x7257('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x7257('0xb')](_0x7257('0xa'),auth[_0x7257('0xc')](),controller['destroy']);module[_0x7257('0xd')]=router; \ No newline at end of file +var _0xa738=['../../config/environment','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x80aaa6,_0x2f8e20){var _0x1ea132=function(_0x178998){while(--_0x178998){_0x80aaa6['push'](_0x80aaa6['shift']());}};_0x1ea132(++_0x2f8e20);}(_0xa738,0x93));var _0x8a73=function(_0x614ae0,_0x44902d){_0x614ae0=_0x614ae0-0x0;var _0xf955a4=_0xa738[_0x614ae0];return _0xf955a4;};'use strict';var multer=require(_0x8a73('0x0'));var util=require(_0x8a73('0x1'));var path=require(_0x8a73('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a73('0x3'));var router=express[_0x8a73('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8a73('0x5'));var interaction=require(_0x8a73('0x6'));var config=require(_0x8a73('0x7'));var controller=require('./condition.controller');router[_0x8a73('0x8')](_0x8a73('0x9'),auth['isAuthenticated'](),controller[_0x8a73('0xa')]);router[_0x8a73('0xb')](_0x8a73('0x9'),auth['isAuthenticated'](),controller[_0x8a73('0xc')]);module[_0x8a73('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 1d1205f..3433ee9 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 _0xb10b=['name','sequelize','STRING'];(function(_0x35c502,_0x20024c){var _0x1d7825=function(_0x3289b2){while(--_0x3289b2){_0x35c502['push'](_0x35c502['shift']());}};_0x1d7825(++_0x20024c);}(_0xb10b,0x12a));var _0xbb10=function(_0xeffc63,_0x4acafd){_0xeffc63=_0xeffc63-0x0;var _0x175db2=_0xb10b[_0xeffc63];return _0x175db2;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x185723,_0x5d3c53){var _0x5835e6=function(_0xe55625){while(--_0xe55625){_0x185723['push'](_0x185723['shift']());}};_0x5835e6(++_0x5d3c53);}(_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 d5e6922..58a583a 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 _0x7a79=['HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardId','getItems','findOne','DashboardItem','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','body','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat'];(function(_0x5521cd,_0x5875a3){var _0x143ffe=function(_0x5ecdd9){while(--_0x5ecdd9){_0x5521cd['push'](_0x5521cd['shift']());}};_0x143ffe(++_0x5875a3);}(_0x7a79,0xfc));var _0x97a7=function(_0x439790,_0x2f4e02){_0x439790=_0x439790-0x0;var _0x1275ab=_0x7a79[_0x439790];return _0x1275ab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a7('0x0'));var rp=require('request-promise');var moment=require(_0x97a7('0x1'));var BPromise=require(_0x97a7('0x2'));var Mustache=require(_0x97a7('0x3'));var util=require('util');var path=require(_0x97a7('0x4'));var sox=require('sox');var csv=require(_0x97a7('0x5'));var ejs=require(_0x97a7('0x6'));var fs=require('fs');var fs_extra=require(_0x97a7('0x7'));var _=require(_0x97a7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x97a7('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x97a7('0xa'));var Papa=require('papaparse');var Redis=require(_0x97a7('0xb'));var authService=require(_0x97a7('0xc'));var qs=require(_0x97a7('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97a7('0xe'));var logger=require(_0x97a7('0xf'))(_0x97a7('0x10'));var utils=require(_0x97a7('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x97a7('0x12'))['db'];config[_0x97a7('0x13')]=_[_0x97a7('0x14')](config[_0x97a7('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x97a7('0x15'))(new Redis(config[_0x97a7('0x13')]));require(_0x97a7('0x16'))[_0x97a7('0x17')](socket);function respondWithStatusCode(_0xa4818,_0x405c9f){_0x405c9f=_0x405c9f||0xcc;return function(_0x1548d8){if(_0x1548d8){return _0xa4818[_0x97a7('0x18')](_0x405c9f);}return _0xa4818[_0x97a7('0x19')](_0x405c9f)[_0x97a7('0x1a')]();};}function respondWithResult(_0x5bb190,_0x2fbf3d){_0x2fbf3d=_0x2fbf3d||0xc8;return function(_0x19cbc1){if(_0x19cbc1){return _0x5bb190[_0x97a7('0x19')](_0x2fbf3d)[_0x97a7('0x1b')](_0x19cbc1);}};}function respondWithFilteredResult(_0x212223,_0x26ddf4){return function(_0x277b79){if(_0x277b79){var _0x14d8da=typeof _0x26ddf4[_0x97a7('0x1c')]==='undefined'&&typeof _0x26ddf4[_0x97a7('0x1d')]==='undefined';var _0x287b0f=_0x277b79[_0x97a7('0x1e')];var _0x4adf31=_0x14d8da?0x0:_0x26ddf4[_0x97a7('0x1c')];var _0x2f8bbc=_0x14d8da?_0x277b79[_0x97a7('0x1e')]:_0x26ddf4[_0x97a7('0x1c')]+_0x26ddf4['limit'];var _0x42133f;if(_0x2f8bbc>=_0x287b0f){_0x2f8bbc=_0x287b0f;_0x42133f=0xc8;}else{_0x42133f=0xce;}_0x212223[_0x97a7('0x19')](_0x42133f);return _0x212223['set'](_0x97a7('0x1f'),_0x4adf31+'-'+_0x2f8bbc+'/'+_0x287b0f)[_0x97a7('0x1b')](_0x277b79);}return null;};}function patchUpdates(_0x3c2987){return function(_0x461e2b){try{jsonpatch[_0x97a7('0x20')](_0x461e2b,_0x3c2987,!![]);}catch(_0x2974ad){return BPromise[_0x97a7('0x21')](_0x2974ad);}return _0x461e2b[_0x97a7('0x22')]();};}function saveUpdates(_0x8321fc,_0x48cbcf){return function(_0x479119){if(_0x479119){return _0x479119[_0x97a7('0x23')](_0x8321fc)[_0x97a7('0x24')](function(_0x3aa135){return _0x3aa135;});}return null;};}function removeEntity(_0x1b98d7,_0x490db7){return function(_0x1fdbbd){if(_0x1fdbbd){return _0x1fdbbd[_0x97a7('0x25')]()['then'](function(){var _0x34decb=_0x1fdbbd[_0x97a7('0x26')]({'plain':!![]});var _0x4a3418=_0x97a7('0x27');return db[_0x97a7('0x28')]['destroy']({'where':{'type':_0x4a3418,'resourceId':_0x34decb['id']}})[_0x97a7('0x24')](function(){return _0x1fdbbd;});})[_0x97a7('0x24')](function(){_0x1b98d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34b094,_0x15e74d){return function(_0x6e261d){if(!_0x6e261d){_0x34b094['sendStatus'](0x194);}return _0x6e261d;};}function handleError(_0xcda3ca,_0x1e5ce6){_0x1e5ce6=_0x1e5ce6||0x1f4;return function(_0x49b34e){logger[_0x97a7('0x29')](_0x49b34e[_0x97a7('0x2a')]);if(_0x49b34e['name']){delete _0x49b34e[_0x97a7('0x2b')];}_0xcda3ca[_0x97a7('0x19')](_0x1e5ce6)[_0x97a7('0x2c')](_0x49b34e);};}exports[_0x97a7('0x2d')]=function(_0x4f9702,_0x53348e){var _0x440c5b={},_0x364490={},_0x4ca852={'count':0x0,'rows':[]};var _0x5c53e3=_[_0x97a7('0x2e')](db[_0x97a7('0x2f')][_0x97a7('0x30')],function(_0x153741){return{'name':_0x153741[_0x97a7('0x31')],'type':_0x153741[_0x97a7('0x32')][_0x97a7('0x33')]};});_0x364490[_0x97a7('0x34')]=_[_0x97a7('0x2e')](_0x5c53e3,'name');_0x364490[_0x97a7('0x35')]=_[_0x97a7('0x36')](_0x4f9702['query']);_0x364490[_0x97a7('0x37')]=_['intersection'](_0x364490[_0x97a7('0x34')],_0x364490[_0x97a7('0x35')]);_0x440c5b[_0x97a7('0x38')]=_[_0x97a7('0x39')](_0x364490['model'],qs[_0x97a7('0x3a')](_0x4f9702[_0x97a7('0x35')]['fields']));_0x440c5b[_0x97a7('0x38')]=_0x440c5b['attributes'][_0x97a7('0x3b')]?_0x440c5b['attributes']:_0x364490[_0x97a7('0x34')];if(!_0x4f9702[_0x97a7('0x35')][_0x97a7('0x3c')](_0x97a7('0x3d'))){_0x440c5b[_0x97a7('0x1d')]=qs['limit'](_0x4f9702['query']['limit']);_0x440c5b[_0x97a7('0x1c')]=qs['offset'](_0x4f9702[_0x97a7('0x35')]['offset']);}_0x440c5b[_0x97a7('0x3e')]=qs[_0x97a7('0x3f')](_0x4f9702[_0x97a7('0x35')][_0x97a7('0x3f')]);_0x440c5b['where']=qs[_0x97a7('0x37')](_[_0x97a7('0x40')](_0x4f9702[_0x97a7('0x35')],_0x364490[_0x97a7('0x37')]),_0x5c53e3);if(_0x4f9702[_0x97a7('0x35')][_0x97a7('0x41')]){_0x440c5b[_0x97a7('0x42')]=_[_0x97a7('0x43')](_0x440c5b[_0x97a7('0x42')],{'$or':_[_0x97a7('0x2e')](_0x5c53e3,function(_0xcb6816){if(_0xcb6816['type']!==_0x97a7('0x44')){var _0xd63fb4={};_0xd63fb4[_0xcb6816[_0x97a7('0x2b')]]={'$like':'%'+_0x4f9702[_0x97a7('0x35')][_0x97a7('0x41')]+'%'};return _0xd63fb4;}})});}_0x440c5b=_['merge']({},_0x440c5b,_0x4f9702[_0x97a7('0x45')]);var _0x432960={'where':_0x440c5b[_0x97a7('0x42')]};return db[_0x97a7('0x2f')][_0x97a7('0x1e')](_0x432960)[_0x97a7('0x24')](function(_0x3e98c4){_0x4ca852[_0x97a7('0x1e')]=_0x3e98c4;if(_0x4f9702[_0x97a7('0x35')][_0x97a7('0x46')]){_0x440c5b[_0x97a7('0x47')]=[{'all':!![]}];}return db[_0x97a7('0x2f')][_0x97a7('0x48')](_0x440c5b);})['then'](function(_0x1031b8){_0x4ca852['rows']=_0x1031b8;return _0x4ca852;})['then'](respondWithFilteredResult(_0x53348e,_0x440c5b))[_0x97a7('0x49')](handleError(_0x53348e,null));};exports[_0x97a7('0x4a')]=function(_0x24d1d4,_0x45c30f){var _0x1c93d9={'raw':![],'where':{'id':_0x24d1d4[_0x97a7('0x4b')]['id']}},_0x2300b0={};_0x2300b0[_0x97a7('0x34')]=_[_0x97a7('0x36')](db[_0x97a7('0x2f')][_0x97a7('0x30')]);_0x2300b0[_0x97a7('0x35')]=_['keys'](_0x24d1d4[_0x97a7('0x35')]);_0x2300b0[_0x97a7('0x37')]=_[_0x97a7('0x39')](_0x2300b0[_0x97a7('0x34')],_0x2300b0[_0x97a7('0x35')]);_0x1c93d9[_0x97a7('0x38')]=_[_0x97a7('0x39')](_0x2300b0['model'],qs[_0x97a7('0x3a')](_0x24d1d4[_0x97a7('0x35')][_0x97a7('0x3a')]));_0x1c93d9[_0x97a7('0x38')]=_0x1c93d9['attributes']['length']?_0x1c93d9[_0x97a7('0x38')]:_0x2300b0[_0x97a7('0x34')];if(_0x24d1d4[_0x97a7('0x35')][_0x97a7('0x46')]){_0x1c93d9[_0x97a7('0x47')]=[{'all':!![]}];}_0x1c93d9=_['merge']({},_0x1c93d9,_0x24d1d4['options']);return db[_0x97a7('0x2f')]['find'](_0x1c93d9)[_0x97a7('0x24')](handleEntityNotFound(_0x45c30f,null))['then'](respondWithResult(_0x45c30f,null))[_0x97a7('0x49')](handleError(_0x45c30f,null));};exports[_0x97a7('0x4c')]=function(_0x4eaf6c,_0x284aa1){return db[_0x97a7('0x2f')]['create'](_0x4eaf6c['body'],{})['then'](function(_0x1b77ae){var _0x9f311e=_0x4eaf6c[_0x97a7('0x4d')][_0x97a7('0x26')]({'plain':!![]});if(!_0x9f311e)throw new Error(_0x97a7('0x4e'));if(_0x9f311e[_0x97a7('0x4f')]===_0x97a7('0x4d')){var _0x4365c4=_0x1b77ae[_0x97a7('0x26')]({'plain':!![]});var _0xc35155=_0x97a7('0x27');return db[_0x97a7('0x50')][_0x97a7('0x51')]({'where':{'name':_0xc35155,'userProfileId':_0x9f311e[_0x97a7('0x52')]},'raw':!![]})[_0x97a7('0x24')](function(_0x4429fe){if(_0x4429fe&&_0x4429fe[_0x97a7('0x53')]===0x0){return db['UserProfileResource'][_0x97a7('0x4c')]({'name':_0x4365c4[_0x97a7('0x2b')],'resourceId':_0x4365c4['id'],'type':_0x4429fe[_0x97a7('0x2b')],'sectionId':_0x4429fe['id']},{})[_0x97a7('0x24')](function(){return _0x1b77ae;});}else{return _0x1b77ae;}})[_0x97a7('0x49')](function(_0x10a8bd){logger[_0x97a7('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10a8bd);throw _0x10a8bd;});}return _0x1b77ae;})['then'](respondWithResult(_0x284aa1,0xc9))['catch'](handleError(_0x284aa1,null));};exports[_0x97a7('0x54')]=function(_0xb8fa70,_0x5f58ba){var _0x5b31d3={'where':{'id':_0xb8fa70[_0x97a7('0x4b')]['id']}},_0x1ae011={};_0x1ae011['model']=_['keys'](db[_0x97a7('0x2f')][_0x97a7('0x30')]);_0x5b31d3[_0x97a7('0x38')]=_[_0x97a7('0x39')](_0x1ae011[_0x97a7('0x34')],qs[_0x97a7('0x3a')](_0xb8fa70[_0x97a7('0x35')][_0x97a7('0x3a')]));_0x5b31d3[_0x97a7('0x38')]=_0x5b31d3[_0x97a7('0x38')][_0x97a7('0x3b')]?_0x5b31d3[_0x97a7('0x38')]:_0x1ae011[_0x97a7('0x34')];if(_0xb8fa70[_0x97a7('0x35')]['includeAll']){_0x5b31d3[_0x97a7('0x47')]=[{'all':!![]}];}_0x5b31d3=_[_0x97a7('0x43')]({},_0x5b31d3,_0xb8fa70['options']);return db[_0x97a7('0x2f')]['find'](_0x5b31d3)['then'](handleEntityNotFound(_0x5f58ba,null))[_0x97a7('0x24')](function(_0x467798){if(_0x467798){var _0x467f47=_0x467798[_0x97a7('0x26')]({'plain':!![]});_0x467f47=qs[_0x97a7('0x55')](_0x467f47,['id',_0x97a7('0x56'),_0x97a7('0x57')]);_0xb8fa70[_0x97a7('0x58')]=_['omit'](_0xb8fa70['body'],['id','createdAt',_0x97a7('0x57')]);return db['Dashboard'][_0x97a7('0x4c')](_[_0x97a7('0x43')](_0x467f47,_0xb8fa70[_0x97a7('0x58')]),{'include':_0xb8fa70[_0x97a7('0x35')][_0x97a7('0x46')]?[{'all':!![]}]:undefined})[_0x97a7('0x24')](function(_0x2ee613){var _0x2bd366=_0xb8fa70[_0x97a7('0x4d')][_0x97a7('0x26')]({'plain':!![]});if(!_0x2bd366)throw new Error(_0x97a7('0x4e'));if(_0x2bd366[_0x97a7('0x4f')]===_0x97a7('0x4d')){var _0x514f46=_0x2ee613['get']({'plain':!![]});var _0x512d59='CustomDashboards';return db[_0x97a7('0x50')]['find']({'where':{'name':_0x512d59,'userProfileId':_0x2bd366[_0x97a7('0x52')]},'raw':!![]})[_0x97a7('0x24')](function(_0x133d3e){if(_0x133d3e&&_0x133d3e[_0x97a7('0x53')]===0x0){return db[_0x97a7('0x28')][_0x97a7('0x4c')]({'name':_0x514f46[_0x97a7('0x2b')],'resourceId':_0x514f46['id'],'type':_0x133d3e[_0x97a7('0x2b')],'sectionId':_0x133d3e['id']},{})['then'](function(){return _0x2ee613;});}else{return _0x2ee613;}})[_0x97a7('0x49')](function(_0x504c2b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x504c2b);throw _0x504c2b;});}return _0x2ee613;});}})[_0x97a7('0x24')](respondWithResult(_0x5f58ba,0xc9))[_0x97a7('0x49')](handleError(_0x5f58ba,null));};exports[_0x97a7('0x23')]=function(_0x2bb323,_0x31e550){if(_0x2bb323[_0x97a7('0x58')]['id']){delete _0x2bb323[_0x97a7('0x58')]['id'];}return db['Dashboard'][_0x97a7('0x51')]({'where':{'id':_0x2bb323[_0x97a7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x31e550,null))['then'](saveUpdates(_0x2bb323['body'],null))[_0x97a7('0x24')](respondWithResult(_0x31e550,null))[_0x97a7('0x49')](handleError(_0x31e550,null));};exports[_0x97a7('0x25')]=function(_0x45f7fc,_0x3a5656){return db[_0x97a7('0x2f')][_0x97a7('0x51')]({'where':{'id':_0x45f7fc['params']['id']}})[_0x97a7('0x24')](handleEntityNotFound(_0x3a5656,null))['then'](removeEntity(_0x3a5656,null))[_0x97a7('0x49')](handleError(_0x3a5656,null));};function widgetAttributes(_0x1e5ae9){try{switch(_0x1e5ae9['type']){case'iframe':return[{'name':_0x97a7('0x59'),'value':_0x1e5ae9[_0x97a7('0x59')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x0]?_0x1e5ae9[_0x97a7('0x5a')][0x0][_0x97a7('0x5b')]:undefined)||_0x97a7('0x5c')}];case _0x97a7('0x5d'):return[{'name':_0x97a7('0x5e'),'value':_0x1e5ae9[_0x97a7('0x5e')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x0]?_0x1e5ae9[_0x97a7('0x5a')][0x0][_0x97a7('0x5b')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x1e5ae9[_0x97a7('0x5f')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x0]?_0x1e5ae9[_0x97a7('0x5a')][0x0][_0x97a7('0x5b')]:undefined)||_0x97a7('0x60')},{'name':_0x97a7('0x61'),'value':_0x1e5ae9['attrTimezone']||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x1]?_0x1e5ae9[_0x97a7('0x5a')][0x1][_0x97a7('0x5b')]:undefined)||'0.00'},{'name':_0x97a7('0x62'),'value':_0x1e5ae9[_0x97a7('0x62')]||(_0x1e5ae9['attrs']&&_0x1e5ae9[_0x97a7('0x5a')][0x2]?_0x1e5ae9[_0x97a7('0x5a')][0x2]['value']:undefined)||0xc}];case _0x97a7('0x63'):return[{'name':_0x97a7('0x64'),'value':_0x1e5ae9[_0x97a7('0x64')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x0]?_0x1e5ae9['attrs'][0x0][_0x97a7('0x5b')]:undefined)||_0x97a7('0x65')},{'name':'attrVoiceQueues','value':_0x1e5ae9['attrVoiceQueues']||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x1]?_0x1e5ae9[_0x97a7('0x5a')][0x1][_0x97a7('0x5b')]:undefined)||[]},{'name':_0x97a7('0x62'),'value':_0x1e5ae9[_0x97a7('0x62')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x2]?_0x1e5ae9['attrs'][0x2]['value']:undefined)||0x14}];case _0x97a7('0x66'):case _0x97a7('0x67'):return[{'name':_0x97a7('0x68'),'value':_0x1e5ae9[_0x97a7('0x68')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x0]?_0x1e5ae9[_0x97a7('0x5a')][0x0][_0x97a7('0x5b')]:undefined)||_0x97a7('0x65')},{'name':_0x97a7('0x69'),'value':_0x1e5ae9[_0x97a7('0x69')]||(_0x1e5ae9['attrs']&&_0x1e5ae9[_0x97a7('0x5a')][0x1]?_0x1e5ae9[_0x97a7('0x5a')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x1e5ae9[_0x97a7('0x6a')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x2]?_0x1e5ae9[_0x97a7('0x5a')][0x2]['value']:undefined)||null},{'name':_0x97a7('0x6b'),'value':_0x1e5ae9['attrVoiceQueues']||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x3]?_0x1e5ae9[_0x97a7('0x5a')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x97a7('0x6c'),'type':_0x1e5ae9[_0x97a7('0x6d')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x0]?_0x1e5ae9['attrs'][0x0][_0x97a7('0x32')]:undefined)||null,'value':_0x1e5ae9[_0x97a7('0x6c')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x0]?_0x1e5ae9['attrs'][0x0]['value']:undefined)||null},{'name':_0x97a7('0x6e'),'value':_0x1e5ae9[_0x97a7('0x6e')]||(_0x1e5ae9['attrs']&&_0x1e5ae9[_0x97a7('0x5a')][0x1]?_0x1e5ae9[_0x97a7('0x5a')][0x1][_0x97a7('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x3393a9){logger[_0x97a7('0x29')](_0x97a7('0x6f'),JSON['stringify'](_0x3393a9));return[];}}exports['addItem']=function(_0x57e5ea,_0x543e07,_0xca723b){if(_0x57e5ea[_0x97a7('0x58')]['id']){delete _0x57e5ea[_0x97a7('0x58')]['id'];}return db['Dashboard'][_0x97a7('0x51')]({'where':{'id':_0x57e5ea['params']['id']}})[_0x97a7('0x24')](handleEntityNotFound(_0x543e07,null))['then'](function(_0x50b3a3){if(_0x50b3a3){_0x57e5ea[_0x97a7('0x58')][_0x97a7('0x70')]=_0x50b3a3['id'];_0x57e5ea[_0x97a7('0x58')]['attrs']=widgetAttributes(_0x57e5ea[_0x97a7('0x58')]);return db['DashboardItem'][_0x97a7('0x4c')](_0x57e5ea[_0x97a7('0x58')]);}})[_0x97a7('0x24')](respondWithResult(_0x543e07,null))[_0x97a7('0x49')](handleError(_0x543e07,null));};exports[_0x97a7('0x71')]=function(_0x1dcb9f,_0x1b369d,_0x2b501f){var _0x344db7={};var _0x5ad0c6={};var _0x4b2b1d;var _0x5ddc51;return db['Dashboard'][_0x97a7('0x72')]({'where':{'id':_0x1dcb9f[_0x97a7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1b369d,null))['then'](function(_0x150776){if(_0x150776){_0x4b2b1d=_0x150776;_0x5ad0c6['model']=_[_0x97a7('0x36')](db[_0x97a7('0x73')][_0x97a7('0x30')]);_0x5ad0c6[_0x97a7('0x35')]=_['keys'](_0x1dcb9f['query']);_0x5ad0c6[_0x97a7('0x37')]=_[_0x97a7('0x39')](_0x5ad0c6[_0x97a7('0x34')],_0x5ad0c6[_0x97a7('0x35')]);_0x344db7[_0x97a7('0x38')]=_[_0x97a7('0x39')](_0x5ad0c6[_0x97a7('0x34')],qs[_0x97a7('0x3a')](_0x1dcb9f['query'][_0x97a7('0x3a')]));_0x344db7[_0x97a7('0x38')]=_0x344db7[_0x97a7('0x38')][_0x97a7('0x3b')]?_0x344db7[_0x97a7('0x38')]:_0x5ad0c6[_0x97a7('0x34')];_0x344db7[_0x97a7('0x3e')]=qs[_0x97a7('0x3f')](_0x1dcb9f[_0x97a7('0x35')][_0x97a7('0x3f')]);_0x344db7[_0x97a7('0x42')]=qs[_0x97a7('0x37')](_[_0x97a7('0x40')](_0x1dcb9f[_0x97a7('0x35')],_0x5ad0c6['filters']));if(_0x1dcb9f[_0x97a7('0x35')][_0x97a7('0x41')]){_0x344db7[_0x97a7('0x42')]=_[_0x97a7('0x43')](_0x344db7['where'],{'$or':_[_0x97a7('0x2e')](_0x344db7[_0x97a7('0x38')],function(_0x34f9dc){var _0x19166b={};_0x19166b[_0x34f9dc]={'$like':'%'+_0x1dcb9f[_0x97a7('0x35')][_0x97a7('0x41')]+'%'};return _0x19166b;})});}_0x344db7=_[_0x97a7('0x43')]({},_0x344db7,_0x1dcb9f[_0x97a7('0x45')]);return _0x4b2b1d[_0x97a7('0x71')](_0x344db7);}})[_0x97a7('0x24')](function(_0x8052c4){if(_0x8052c4){_0x5ddc51=_0x8052c4[_0x97a7('0x3b')];if(!_0x1dcb9f[_0x97a7('0x35')][_0x97a7('0x3c')]('nolimit')){_0x344db7[_0x97a7('0x1d')]=qs[_0x97a7('0x1d')](_0x1dcb9f[_0x97a7('0x35')][_0x97a7('0x1d')]);_0x344db7[_0x97a7('0x1c')]=qs['offset'](_0x1dcb9f[_0x97a7('0x35')]['offset']);}return _0x4b2b1d[_0x97a7('0x71')](_0x344db7);}})[_0x97a7('0x24')](function(_0x167463){if(_0x167463){return _0x167463?{'count':_0x5ddc51,'rows':_0x167463}:null;}})[_0x97a7('0x24')](respondWithResult(_0x1b369d,null))[_0x97a7('0x49')](handleError(_0x1b369d,null));}; \ No newline at end of file +var _0xcbfa=['length','nolimit','order','sort','pick','filter','merge','name','include','findAll','catch','params','rawAttributes','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','createdAt','autoAssociation','update','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','getItems','findOne','DashboardItem','where','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','stack','index','map','Dashboard','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0xba2304,_0x476a68){var _0xdf2560=function(_0x5e82d4){while(--_0x5e82d4){_0xba2304['push'](_0xba2304['shift']());}};_0xdf2560(++_0x476a68);}(_0xcbfa,0x12b));var _0xacbf=function(_0x4a8ce2,_0x4cd94e){_0x4a8ce2=_0x4a8ce2-0x0;var _0x38c265=_0xcbfa[_0x4a8ce2];return _0x38c265;};'use strict';var emlformat=require(_0xacbf('0x0'));var rimraf=require(_0xacbf('0x1'));var zipdir=require(_0xacbf('0x2'));var jsonpatch=require(_0xacbf('0x3'));var rp=require(_0xacbf('0x4'));var moment=require(_0xacbf('0x5'));var BPromise=require(_0xacbf('0x6'));var Mustache=require(_0xacbf('0x7'));var util=require(_0xacbf('0x8'));var path=require('path');var sox=require(_0xacbf('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xacbf('0xa'));var _=require(_0xacbf('0xb'));var squel=require(_0xacbf('0xc'));var crypto=require(_0xacbf('0xd'));var jsforce=require(_0xacbf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xacbf('0xf'));var querystring=require(_0xacbf('0x10'));var Papa=require(_0xacbf('0x11'));var Redis=require(_0xacbf('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xacbf('0x13'));var as=require(_0xacbf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacbf('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xacbf('0x16'));var licenseUtil=require(_0xacbf('0x17'));var db=require(_0xacbf('0x18'))['db'];config[_0xacbf('0x19')]=_[_0xacbf('0x1a')](config[_0xacbf('0x19')],{'host':_0xacbf('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0xacbf('0x1c')](socket);function respondWithStatusCode(_0x2c9a82,_0x101d43){_0x101d43=_0x101d43||0xcc;return function(_0x27b644){if(_0x27b644){return _0x2c9a82[_0xacbf('0x1d')](_0x101d43);}return _0x2c9a82['status'](_0x101d43)[_0xacbf('0x1e')]();};}function respondWithResult(_0x4e6fc0,_0x3675d8){_0x3675d8=_0x3675d8||0xc8;return function(_0x5e69a4){if(_0x5e69a4){return _0x4e6fc0[_0xacbf('0x1f')](_0x3675d8)[_0xacbf('0x20')](_0x5e69a4);}};}function respondWithFilteredResult(_0x102848,_0x544abc){return function(_0x10cdcb){if(_0x10cdcb){var _0x17486c=typeof _0x544abc[_0xacbf('0x21')]===_0xacbf('0x22')&&typeof _0x544abc[_0xacbf('0x23')]===_0xacbf('0x22');var _0x2facc0=_0x10cdcb[_0xacbf('0x24')];var _0xb38898=_0x17486c?0x0:_0x544abc[_0xacbf('0x21')];var _0x53c00f=_0x17486c?_0x10cdcb['count']:_0x544abc['offset']+_0x544abc[_0xacbf('0x23')];var _0x4c1600;if(_0x53c00f>=_0x2facc0){_0x53c00f=_0x2facc0;_0x4c1600=0xc8;}else{_0x4c1600=0xce;}_0x102848[_0xacbf('0x1f')](_0x4c1600);return _0x102848[_0xacbf('0x25')](_0xacbf('0x26'),_0xb38898+'-'+_0x53c00f+'/'+_0x2facc0)['json'](_0x10cdcb);}return null;};}function patchUpdates(_0x18d934){return function(_0xab6cbe){try{jsonpatch[_0xacbf('0x27')](_0xab6cbe,_0x18d934,!![]);}catch(_0x12efd0){return BPromise['reject'](_0x12efd0);}return _0xab6cbe[_0xacbf('0x28')]();};}function saveUpdates(_0xbdd802,_0x44f4ea){return function(_0x2ee5eb){if(_0x2ee5eb){return _0x2ee5eb['update'](_0xbdd802)[_0xacbf('0x29')](function(_0x3ebb5b){return _0x3ebb5b;});}return null;};}function removeEntity(_0x4d702d,_0x6f5e96){return function(_0x5ba1f5){if(_0x5ba1f5){return _0x5ba1f5[_0xacbf('0x2a')]()[_0xacbf('0x29')](function(){var _0x3e8e22=_0x5ba1f5[_0xacbf('0x2b')]({'plain':!![]});var _0x58b925='CustomDashboards';return db[_0xacbf('0x2c')]['destroy']({'where':{'type':_0x58b925,'resourceId':_0x3e8e22['id']}})[_0xacbf('0x29')](function(){return _0x5ba1f5;});})['then'](function(){_0x4d702d['status'](0xcc)[_0xacbf('0x1e')]();});}};}function handleEntityNotFound(_0x2071b3,_0x46afcd){return function(_0x16287c){if(!_0x16287c){_0x2071b3[_0xacbf('0x1d')](0x194);}return _0x16287c;};}function handleError(_0x52c303,_0x46785c){_0x46785c=_0x46785c||0x1f4;return function(_0x42fd70){logger['error'](_0x42fd70[_0xacbf('0x2d')]);if(_0x42fd70['name']){delete _0x42fd70['name'];}_0x52c303['status'](_0x46785c)['send'](_0x42fd70);};}exports[_0xacbf('0x2e')]=function(_0x454927,_0x54f413){var _0x1da83f={},_0x2ed9df={},_0x330583={'count':0x0,'rows':[]};var _0x1aff8e=_[_0xacbf('0x2f')](db[_0xacbf('0x30')]['rawAttributes'],function(_0x308089){return{'name':_0x308089[_0xacbf('0x31')],'type':_0x308089[_0xacbf('0x32')]['key']};});_0x2ed9df[_0xacbf('0x33')]=_[_0xacbf('0x2f')](_0x1aff8e,'name');_0x2ed9df[_0xacbf('0x34')]=_[_0xacbf('0x35')](_0x454927[_0xacbf('0x34')]);_0x2ed9df[_0xacbf('0x36')]=_[_0xacbf('0x37')](_0x2ed9df[_0xacbf('0x33')],_0x2ed9df['query']);_0x1da83f[_0xacbf('0x38')]=_['intersection'](_0x2ed9df[_0xacbf('0x33')],qs[_0xacbf('0x39')](_0x454927[_0xacbf('0x34')][_0xacbf('0x39')]));_0x1da83f[_0xacbf('0x38')]=_0x1da83f[_0xacbf('0x38')][_0xacbf('0x3a')]?_0x1da83f[_0xacbf('0x38')]:_0x2ed9df[_0xacbf('0x33')];if(!_0x454927[_0xacbf('0x34')]['hasOwnProperty'](_0xacbf('0x3b'))){_0x1da83f[_0xacbf('0x23')]=qs[_0xacbf('0x23')](_0x454927[_0xacbf('0x34')][_0xacbf('0x23')]);_0x1da83f[_0xacbf('0x21')]=qs['offset'](_0x454927['query'][_0xacbf('0x21')]);}_0x1da83f[_0xacbf('0x3c')]=qs['sort'](_0x454927[_0xacbf('0x34')][_0xacbf('0x3d')]);_0x1da83f['where']=qs[_0xacbf('0x36')](_[_0xacbf('0x3e')](_0x454927[_0xacbf('0x34')],_0x2ed9df['filters']),_0x1aff8e);if(_0x454927[_0xacbf('0x34')][_0xacbf('0x3f')]){_0x1da83f['where']=_[_0xacbf('0x40')](_0x1da83f['where'],{'$or':_[_0xacbf('0x2f')](_0x1aff8e,function(_0x3cb3dc){if(_0x3cb3dc[_0xacbf('0x32')]!=='VIRTUAL'){var _0x55c0be={};_0x55c0be[_0x3cb3dc[_0xacbf('0x41')]]={'$like':'%'+_0x454927[_0xacbf('0x34')]['filter']+'%'};return _0x55c0be;}})});}_0x1da83f=_['merge']({},_0x1da83f,_0x454927['options']);var _0x3b3039={'where':_0x1da83f['where']};return db[_0xacbf('0x30')]['count'](_0x3b3039)['then'](function(_0x5b02e9){_0x330583[_0xacbf('0x24')]=_0x5b02e9;if(_0x454927[_0xacbf('0x34')]['includeAll']){_0x1da83f[_0xacbf('0x42')]=[{'all':!![]}];}return db[_0xacbf('0x30')][_0xacbf('0x43')](_0x1da83f);})[_0xacbf('0x29')](function(_0x3702c3){_0x330583['rows']=_0x3702c3;return _0x330583;})[_0xacbf('0x29')](respondWithFilteredResult(_0x54f413,_0x1da83f))[_0xacbf('0x44')](handleError(_0x54f413,null));};exports['show']=function(_0x201595,_0x52da96){var _0x2c5914={'raw':![],'where':{'id':_0x201595[_0xacbf('0x45')]['id']}},_0x12026b={};_0x12026b[_0xacbf('0x33')]=_[_0xacbf('0x35')](db[_0xacbf('0x30')][_0xacbf('0x46')]);_0x12026b[_0xacbf('0x34')]=_['keys'](_0x201595[_0xacbf('0x34')]);_0x12026b['filters']=_['intersection'](_0x12026b[_0xacbf('0x33')],_0x12026b[_0xacbf('0x34')]);_0x2c5914[_0xacbf('0x38')]=_[_0xacbf('0x37')](_0x12026b[_0xacbf('0x33')],qs[_0xacbf('0x39')](_0x201595[_0xacbf('0x34')][_0xacbf('0x39')]));_0x2c5914[_0xacbf('0x38')]=_0x2c5914[_0xacbf('0x38')][_0xacbf('0x3a')]?_0x2c5914[_0xacbf('0x38')]:_0x12026b['model'];if(_0x201595[_0xacbf('0x34')][_0xacbf('0x47')]){_0x2c5914[_0xacbf('0x42')]=[{'all':!![]}];}_0x2c5914=_['merge']({},_0x2c5914,_0x201595[_0xacbf('0x48')]);return db[_0xacbf('0x30')][_0xacbf('0x49')](_0x2c5914)[_0xacbf('0x29')](handleEntityNotFound(_0x52da96,null))[_0xacbf('0x29')](respondWithResult(_0x52da96,null))[_0xacbf('0x44')](handleError(_0x52da96,null));};exports['create']=function(_0x27b9bf,_0x28998d){return db[_0xacbf('0x30')][_0xacbf('0x4a')](_0x27b9bf['body'],{})[_0xacbf('0x29')](function(_0x4b3bfc){var _0x108e9c=_0x27b9bf[_0xacbf('0x4b')]['get']({'plain':!![]});if(!_0x108e9c)throw new Error(_0xacbf('0x4c'));if(_0x108e9c[_0xacbf('0x4d')]===_0xacbf('0x4b')){var _0x2fca54=_0x4b3bfc[_0xacbf('0x2b')]({'plain':!![]});var _0x2a3b83=_0xacbf('0x4e');return db[_0xacbf('0x4f')][_0xacbf('0x49')]({'where':{'name':_0x2a3b83,'userProfileId':_0x108e9c[_0xacbf('0x50')]},'raw':!![]})['then'](function(_0xd609b5){if(_0xd609b5&&_0xd609b5['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2fca54['name'],'resourceId':_0x2fca54['id'],'type':_0xd609b5['name'],'sectionId':_0xd609b5['id']},{})['then'](function(){return _0x4b3bfc;});}else{return _0x4b3bfc;}})[_0xacbf('0x44')](function(_0x4254ff){logger[_0xacbf('0x51')](_0xacbf('0x52'),_0x4254ff);throw _0x4254ff;});}return _0x4b3bfc;})['then'](respondWithResult(_0x28998d,0xc9))[_0xacbf('0x44')](handleError(_0x28998d,null));};exports[_0xacbf('0x53')]=function(_0x4491bb,_0x27e9d8){var _0x1de65a={'where':{'id':_0x4491bb['params']['id']}},_0x46f3bd={};_0x46f3bd[_0xacbf('0x33')]=_[_0xacbf('0x35')](db[_0xacbf('0x30')][_0xacbf('0x46')]);_0x1de65a[_0xacbf('0x38')]=_['intersection'](_0x46f3bd[_0xacbf('0x33')],qs[_0xacbf('0x39')](_0x4491bb['query']['fields']));_0x1de65a['attributes']=_0x1de65a['attributes'][_0xacbf('0x3a')]?_0x1de65a['attributes']:_0x46f3bd[_0xacbf('0x33')];if(_0x4491bb['query']['includeAll']){_0x1de65a[_0xacbf('0x42')]=[{'all':!![]}];}_0x1de65a=_['merge']({},_0x1de65a,_0x4491bb[_0xacbf('0x48')]);return db[_0xacbf('0x30')]['find'](_0x1de65a)[_0xacbf('0x29')](handleEntityNotFound(_0x27e9d8,null))[_0xacbf('0x29')](function(_0x1ffe24){if(_0x1ffe24){var _0x353c60=_0x1ffe24['get']({'plain':!![]});_0x353c60=qs['omit'](_0x353c60,['id','createdAt',_0xacbf('0x54')]);_0x4491bb['body']=_['omit'](_0x4491bb[_0xacbf('0x55')],['id',_0xacbf('0x56'),_0xacbf('0x54')]);return db['Dashboard'][_0xacbf('0x4a')](_[_0xacbf('0x40')](_0x353c60,_0x4491bb[_0xacbf('0x55')]),{'include':_0x4491bb[_0xacbf('0x34')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xab137b){var _0x5aaaf9=_0x4491bb[_0xacbf('0x4b')]['get']({'plain':!![]});if(!_0x5aaaf9)throw new Error(_0xacbf('0x4c'));if(_0x5aaaf9[_0xacbf('0x4d')]===_0xacbf('0x4b')){var _0x473ca8=_0xab137b[_0xacbf('0x2b')]({'plain':!![]});var _0x4fb8c9=_0xacbf('0x4e');return db[_0xacbf('0x4f')][_0xacbf('0x49')]({'where':{'name':_0x4fb8c9,'userProfileId':_0x5aaaf9[_0xacbf('0x50')]},'raw':!![]})[_0xacbf('0x29')](function(_0x20f384){if(_0x20f384&&_0x20f384[_0xacbf('0x57')]===0x0){return db['UserProfileResource'][_0xacbf('0x4a')]({'name':_0x473ca8[_0xacbf('0x41')],'resourceId':_0x473ca8['id'],'type':_0x20f384[_0xacbf('0x41')],'sectionId':_0x20f384['id']},{})['then'](function(){return _0xab137b;});}else{return _0xab137b;}})[_0xacbf('0x44')](function(_0x49c537){logger[_0xacbf('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49c537);throw _0x49c537;});}return _0xab137b;});}})[_0xacbf('0x29')](respondWithResult(_0x27e9d8,0xc9))['catch'](handleError(_0x27e9d8,null));};exports[_0xacbf('0x58')]=function(_0x352e26,_0x141e32){if(_0x352e26[_0xacbf('0x55')]['id']){delete _0x352e26[_0xacbf('0x55')]['id'];}return db['Dashboard'][_0xacbf('0x49')]({'where':{'id':_0x352e26['params']['id']}})[_0xacbf('0x29')](handleEntityNotFound(_0x141e32,null))[_0xacbf('0x29')](saveUpdates(_0x352e26['body'],null))['then'](respondWithResult(_0x141e32,null))[_0xacbf('0x44')](handleError(_0x141e32,null));};exports['destroy']=function(_0x45d820,_0x5d5c38){return db['Dashboard'][_0xacbf('0x49')]({'where':{'id':_0x45d820[_0xacbf('0x45')]['id']}})[_0xacbf('0x29')](handleEntityNotFound(_0x5d5c38,null))[_0xacbf('0x29')](removeEntity(_0x5d5c38,null))[_0xacbf('0x44')](handleError(_0x5d5c38,null));};function widgetAttributes(_0x4ce756){try{switch(_0x4ce756['type']){case _0xacbf('0x59'):return[{'name':_0xacbf('0x5a'),'value':_0x4ce756[_0xacbf('0x5a')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x0]?_0x4ce756[_0xacbf('0x5b')][0x0][_0xacbf('0x5c')]:undefined)||_0xacbf('0x5d')}];case _0xacbf('0x5e'):return[{'name':_0xacbf('0x5f'),'value':_0x4ce756[_0xacbf('0x5f')]||(_0x4ce756['attrs']&&_0x4ce756['attrs'][0x0]?_0x4ce756['attrs'][0x0][_0xacbf('0x5c')]:undefined)||''}];case _0xacbf('0x60'):return[{'name':_0xacbf('0x61'),'value':_0x4ce756[_0xacbf('0x61')]||(_0x4ce756['attrs']&&_0x4ce756['attrs'][0x0]?_0x4ce756['attrs'][0x0][_0xacbf('0x5c')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x4ce756[_0xacbf('0x62')]||(_0x4ce756['attrs']&&_0x4ce756[_0xacbf('0x5b')][0x1]?_0x4ce756[_0xacbf('0x5b')][0x1][_0xacbf('0x5c')]:undefined)||_0xacbf('0x63')},{'name':'attrFontSize','value':_0x4ce756[_0xacbf('0x64')]||(_0x4ce756['attrs']&&_0x4ce756['attrs'][0x2]?_0x4ce756[_0xacbf('0x5b')][0x2][_0xacbf('0x5c')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x4ce756[_0xacbf('0x65')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x0]?_0x4ce756[_0xacbf('0x5b')][0x0][_0xacbf('0x5c')]:undefined)||_0xacbf('0x66')},{'name':_0xacbf('0x67'),'value':_0x4ce756[_0xacbf('0x67')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756['attrs'][0x1]?_0x4ce756['attrs'][0x1][_0xacbf('0x5c')]:undefined)||[]},{'name':_0xacbf('0x64'),'value':_0x4ce756[_0xacbf('0x64')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x2]?_0x4ce756[_0xacbf('0x5b')][0x2][_0xacbf('0x5c')]:undefined)||0x14}];case _0xacbf('0x68'):case _0xacbf('0x69'):return[{'name':_0xacbf('0x6a'),'value':_0x4ce756[_0xacbf('0x6a')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x0]?_0x4ce756[_0xacbf('0x5b')][0x0][_0xacbf('0x5c')]:undefined)||_0xacbf('0x66')},{'name':_0xacbf('0x6b'),'value':_0x4ce756[_0xacbf('0x6b')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x1]?_0x4ce756[_0xacbf('0x5b')][0x1][_0xacbf('0x5c')]:undefined)||null},{'name':_0xacbf('0x6c'),'value':_0x4ce756[_0xacbf('0x6c')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x2]?_0x4ce756[_0xacbf('0x5b')][0x2][_0xacbf('0x5c')]:undefined)||null},{'name':_0xacbf('0x67'),'value':_0x4ce756[_0xacbf('0x67')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756['attrs'][0x3]?_0x4ce756[_0xacbf('0x5b')][0x3][_0xacbf('0x5c')]:undefined)||[]}];case _0xacbf('0x6d'):return[{'name':'attrReport','type':_0x4ce756['reportType']||(_0x4ce756['attrs']&&_0x4ce756['attrs'][0x0]?_0x4ce756['attrs'][0x0]['type']:undefined)||null,'value':_0x4ce756['attrReport']||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x0]?_0x4ce756[_0xacbf('0x5b')][0x0][_0xacbf('0x5c')]:undefined)||null},{'name':_0xacbf('0x6e'),'value':_0x4ce756['attrRefresh']||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756['attrs'][0x1]?_0x4ce756[_0xacbf('0x5b')][0x1][_0xacbf('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x2dc749){logger[_0xacbf('0x51')](_0xacbf('0x6f'),JSON[_0xacbf('0x70')](_0x2dc749));return[];}}exports[_0xacbf('0x71')]=function(_0x2a3db2,_0x2c495e,_0xc62c3){if(_0x2a3db2[_0xacbf('0x55')]['id']){delete _0x2a3db2[_0xacbf('0x55')]['id'];}return db[_0xacbf('0x30')][_0xacbf('0x49')]({'where':{'id':_0x2a3db2[_0xacbf('0x45')]['id']}})[_0xacbf('0x29')](handleEntityNotFound(_0x2c495e,null))[_0xacbf('0x29')](function(_0x2a0e72){if(_0x2a0e72){_0x2a3db2[_0xacbf('0x55')]['DashboardId']=_0x2a0e72['id'];_0x2a3db2[_0xacbf('0x55')][_0xacbf('0x5b')]=widgetAttributes(_0x2a3db2[_0xacbf('0x55')]);return db['DashboardItem'][_0xacbf('0x4a')](_0x2a3db2[_0xacbf('0x55')]);}})[_0xacbf('0x29')](respondWithResult(_0x2c495e,null))[_0xacbf('0x44')](handleError(_0x2c495e,null));};exports[_0xacbf('0x72')]=function(_0x4f7915,_0x16137a,_0x2ee6fe){var _0x216ced={};var _0xfa5833={};var _0x2eefb9;var _0x30991d;return db[_0xacbf('0x30')][_0xacbf('0x73')]({'where':{'id':_0x4f7915[_0xacbf('0x45')]['id']}})[_0xacbf('0x29')](handleEntityNotFound(_0x16137a,null))[_0xacbf('0x29')](function(_0x2c794c){if(_0x2c794c){_0x2eefb9=_0x2c794c;_0xfa5833[_0xacbf('0x33')]=_[_0xacbf('0x35')](db[_0xacbf('0x74')][_0xacbf('0x46')]);_0xfa5833['query']=_['keys'](_0x4f7915[_0xacbf('0x34')]);_0xfa5833[_0xacbf('0x36')]=_[_0xacbf('0x37')](_0xfa5833[_0xacbf('0x33')],_0xfa5833[_0xacbf('0x34')]);_0x216ced[_0xacbf('0x38')]=_[_0xacbf('0x37')](_0xfa5833['model'],qs['fields'](_0x4f7915[_0xacbf('0x34')][_0xacbf('0x39')]));_0x216ced[_0xacbf('0x38')]=_0x216ced['attributes'][_0xacbf('0x3a')]?_0x216ced[_0xacbf('0x38')]:_0xfa5833[_0xacbf('0x33')];_0x216ced[_0xacbf('0x3c')]=qs['sort'](_0x4f7915[_0xacbf('0x34')]['sort']);_0x216ced[_0xacbf('0x75')]=qs[_0xacbf('0x36')](_['pick'](_0x4f7915[_0xacbf('0x34')],_0xfa5833[_0xacbf('0x36')]));if(_0x4f7915[_0xacbf('0x34')][_0xacbf('0x3f')]){_0x216ced[_0xacbf('0x75')]=_['merge'](_0x216ced['where'],{'$or':_[_0xacbf('0x2f')](_0x216ced[_0xacbf('0x38')],function(_0x3715ca){var _0x591722={};_0x591722[_0x3715ca]={'$like':'%'+_0x4f7915[_0xacbf('0x34')][_0xacbf('0x3f')]+'%'};return _0x591722;})});}_0x216ced=_[_0xacbf('0x40')]({},_0x216ced,_0x4f7915[_0xacbf('0x48')]);return _0x2eefb9[_0xacbf('0x72')](_0x216ced);}})['then'](function(_0x5824fa){if(_0x5824fa){_0x30991d=_0x5824fa[_0xacbf('0x3a')];if(!_0x4f7915['query'][_0xacbf('0x76')](_0xacbf('0x3b'))){_0x216ced['limit']=qs['limit'](_0x4f7915[_0xacbf('0x34')]['limit']);_0x216ced[_0xacbf('0x21')]=qs['offset'](_0x4f7915[_0xacbf('0x34')][_0xacbf('0x21')]);}return _0x2eefb9[_0xacbf('0x72')](_0x216ced);}})['then'](function(_0x2ca61e){if(_0x2ca61e){return _0x2ca61e?{'count':_0x30991d,'rows':_0x2ca61e}:null;}})[_0xacbf('0x29')](respondWithResult(_0x16137a,null))[_0xacbf('0x44')](handleError(_0x16137a,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 7646956..aaf8406 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 _0x32f3=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard','setMaxListeners','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x32f3,0xd4));var _0x332f=function(_0x36ac8b,_0x19cf8e){_0x36ac8b=_0x36ac8b-0x0;var _0x5003b9=_0x32f3[_0x36ac8b];return _0x5003b9;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x332f('0x0'))['db'][_0x332f('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x332f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x332f('0x3'),'afterDestroy':_0x332f('0x4')};function emitEvent(_0x1f8a06){return function(_0x59f1b8,_0x66f96d,_0x4161bc){DashboardEvents[_0x332f('0x5')](_0x1f8a06+':'+_0x59f1b8['id'],_0x59f1b8);DashboardEvents[_0x332f('0x5')](_0x1f8a06,_0x59f1b8);_0x4161bc(null);};}for(var e in events){if(events[_0x332f('0x6')](e)){var event=events[e];Dashboard[_0x332f('0x7')](e,emitEvent(event));}}module[_0x332f('0x8')]=DashboardEvents; \ No newline at end of file +var _0x157f=['emit','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x53bec2,_0x2c8db1){var _0x418497=function(_0x208c89){while(--_0x208c89){_0x53bec2['push'](_0x53bec2['shift']());}};_0x418497(++_0x2c8db1);}(_0x157f,0xd2));var _0xf157=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x157f[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0xf157('0x0'));var Dashboard=require(_0xf157('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf157('0x2')](0x0);var events={'afterCreate':_0xf157('0x3'),'afterUpdate':_0xf157('0x4'),'afterDestroy':_0xf157('0x5')};function emitEvent(_0x19d725){return function(_0x6920cf,_0x34a187,_0x248c09){DashboardEvents[_0xf157('0x6')](_0x19d725+':'+_0x6920cf['id'],_0x6920cf);DashboardEvents[_0xf157('0x6')](_0x19d725,_0x6920cf);_0x248c09(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xf157('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index f04a8a4..d4a4284 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 _0xeabf=['../../config/environment','exports','Dashboard','dashboards','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x4c5b87,_0x4bb889){var _0x166de3=function(_0x5cb872){while(--_0x5cb872){_0x4c5b87['push'](_0x4c5b87['shift']());}};_0x166de3(++_0x4bb889);}(_0xeabf,0x159));var _0xfeab=function(_0x248166,_0x36ec54){_0x248166=_0x248166-0x0;var _0x5d364e=_0xeabf[_0x248166];return _0x5d364e;};'use strict';var _=require(_0xfeab('0x0'));var util=require(_0xfeab('0x1'));var logger=require('../../config/logger')(_0xfeab('0x2'));var moment=require(_0xfeab('0x3'));var BPromise=require(_0xfeab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfeab('0x5'));var rimraf=require(_0xfeab('0x6'));var config=require(_0xfeab('0x7'));var attributes=require('./dashboard.attributes');module[_0xfeab('0x8')]=function(_0x30b8fe,_0x5bd151){return _0x30b8fe['define'](_0xfeab('0x9'),attributes,{'tableName':_0xfeab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x240e=['util','api','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards'];(function(_0x1a5179,_0x59a00e){var _0x14bfcd=function(_0x91c357){while(--_0x91c357){_0x1a5179['push'](_0x1a5179['shift']());}};_0x14bfcd(++_0x59a00e);}(_0x240e,0x96));var _0xe240=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x240e[_0xa6cc5c];return _0x44803d;};'use strict';var _=require('lodash');var util=require(_0xe240('0x0'));var logger=require('../../config/logger')(_0xe240('0x1'));var moment=require('moment');var BPromise=require(_0xe240('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe240('0x3'));var rimraf=require(_0xe240('0x4'));var config=require(_0xe240('0x5'));var attributes=require(_0xe240('0x6'));module[_0xe240('0x7')]=function(_0x1f310b,_0x1ba5cf){return _0x1f310b['define'](_0xe240('0x8'),attributes,{'tableName':_0xe240('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index a18e2f0..ccc280e 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 _0x9dbe=['../../config/logger','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9dbe,0x1e8));var _0xe9db=function(_0x371b36,_0x8606f7){_0x371b36=_0x371b36-0x0;var _0x449638=_0x9dbe[_0x371b36];return _0x449638;};'use strict';var _=require(_0xe9db('0x0'));var util=require(_0xe9db('0x1'));var moment=require(_0xe9db('0x2'));var BPromise=require(_0xe9db('0x3'));var rs=require(_0xe9db('0x4'));var fs=require('fs');var Redis=require(_0xe9db('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe9db('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe9db('0x7')][_0xe9db('0x8')]({'port':0x232a});config[_0xe9db('0x9')]=_['defaults'](config[_0xe9db('0x9')],{'host':_0xe9db('0xa'),'port':0x18eb});var socket=require(_0xe9db('0xb'))(new Redis(config[_0xe9db('0x9')]));require(_0xe9db('0xc'))[_0xe9db('0xd')](socket);function respondWithRpcPromise(_0x4974f7,_0x511750,_0x5505cc){return new BPromise(function(_0x387d3d,_0x3927c4){return client[_0xe9db('0xe')](_0x4974f7,_0x5505cc)[_0xe9db('0xf')](function(_0x296174){logger['info'](_0xe9db('0x10'),_0x511750,'request\x20sent');logger['debug'](_0xe9db('0x11'),_0x511750,'request\x20sent',JSON[_0xe9db('0x12')](_0x296174));if(_0x296174[_0xe9db('0x13')]){if(_0x296174[_0xe9db('0x13')][_0xe9db('0x14')]===0x1f4){logger[_0xe9db('0x13')]('Dashboard,\x20%s,\x20%s',_0x511750,_0x296174[_0xe9db('0x13')][_0xe9db('0x15')]);return _0x3927c4(_0x296174['error'][_0xe9db('0x15')]);}logger[_0xe9db('0x13')]('Dashboard,\x20%s,\x20%s',_0x511750,_0x296174['error'][_0xe9db('0x15')]);return _0x387d3d(_0x296174[_0xe9db('0x13')][_0xe9db('0x15')]);}else{logger[_0xe9db('0x16')]('Dashboard,\x20%s,\x20%s',_0x511750,_0xe9db('0x17'));_0x387d3d(_0x296174[_0xe9db('0x18')][_0xe9db('0x15')]);}})[_0xe9db('0x19')](function(_0x301c91){logger[_0xe9db('0x13')](_0xe9db('0x10'),_0x511750,_0x301c91);_0x3927c4(_0x301c91);});});} \ No newline at end of file +var _0x2064=['redis','defaults','localhost','socket.io-emitter','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x29342d,_0x4a4720){var _0x2b0bea=function(_0x16383c){while(--_0x16383c){_0x29342d['push'](_0x29342d['shift']());}};_0x2b0bea(++_0x4a4720);}(_0x2064,0x7b));var _0x4206=function(_0x99e075,_0x211213){_0x99e075=_0x99e075-0x0;var _0x1a81ba=_0x2064[_0x99e075];return _0x1a81ba;};'use strict';var _=require(_0x4206('0x0'));var util=require(_0x4206('0x1'));var moment=require(_0x4206('0x2'));var BPromise=require(_0x4206('0x3'));var rs=require(_0x4206('0x4'));var fs=require('fs');var Redis=require(_0x4206('0x5'));var db=require(_0x4206('0x6'))['db'];var utils=require(_0x4206('0x7'));var logger=require(_0x4206('0x8'))(_0x4206('0x9'));var config=require('../../config/environment');var jayson=require(_0x4206('0xa'));var client=jayson[_0x4206('0xb')]['http']({'port':0x232a});config[_0x4206('0xc')]=_[_0x4206('0xd')](config['redis'],{'host':_0x4206('0xe'),'port':0x18eb});var socket=require(_0x4206('0xf'))(new Redis(config[_0x4206('0xc')]));require('./dashboard.socket')[_0x4206('0x10')](socket);function respondWithRpcPromise(_0xdf798e,_0x334015,_0x3875a8){return new BPromise(function(_0xc30a1a,_0xc7096d){return client[_0x4206('0x11')](_0xdf798e,_0x3875a8)[_0x4206('0x12')](function(_0x45f5fa){logger['info'](_0x4206('0x13'),_0x334015,_0x4206('0x14'));logger[_0x4206('0x15')](_0x4206('0x16'),_0x334015,_0x4206('0x14'),JSON['stringify'](_0x45f5fa));if(_0x45f5fa['error']){if(_0x45f5fa[_0x4206('0x17')][_0x4206('0x18')]===0x1f4){logger[_0x4206('0x17')]('Dashboard,\x20%s,\x20%s',_0x334015,_0x45f5fa[_0x4206('0x17')][_0x4206('0x19')]);return _0xc7096d(_0x45f5fa[_0x4206('0x17')][_0x4206('0x19')]);}logger[_0x4206('0x17')]('Dashboard,\x20%s,\x20%s',_0x334015,_0x45f5fa[_0x4206('0x17')][_0x4206('0x19')]);return _0xc30a1a(_0x45f5fa['error'][_0x4206('0x19')]);}else{logger[_0x4206('0x1a')](_0x4206('0x13'),_0x334015,_0x4206('0x14'));_0xc30a1a(_0x45f5fa['result']['message']);}})['catch'](function(_0x4d0c48){logger[_0x4206('0x17')](_0x4206('0x13'),_0x334015,_0x4d0c48);_0xc7096d(_0x4d0c48);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index fa788e3..3e86958 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 _0x842d=['./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0x5b1698,_0x4624a8){var _0x1b416e=function(_0xa8db71){while(--_0xa8db71){_0x5b1698['push'](_0x5b1698['shift']());}};_0x1b416e(++_0x4624a8);}(_0x842d,0x7e));var _0xd842=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x842d[_0x12a2a6];return _0x1754ae;};'use strict';var DashboardEvents=require(_0xd842('0x0'));var events=[_0xd842('0x1'),_0xd842('0x2'),_0xd842('0x3')];function createListener(_0x532d77,_0x52bc63){return function(_0x128dfc){_0x52bc63[_0xd842('0x4')](_0x532d77,_0x128dfc);};}function removeListener(_0x4c1c31,_0x11eaf8){return function(){DashboardEvents[_0xd842('0x5')](_0x4c1c31,_0x11eaf8);};}exports[_0xd842('0x6')]=function(_0x35c162){for(var _0x40e8af=0x0,_0x336fd4=events['length'];_0x40e8af<_0x336fd4;_0x40e8af++){var _0x5e0350=events[_0x40e8af];var _0x32a9b4=createListener('dashboard:'+_0x5e0350,_0x35c162);DashboardEvents['on'](_0x5e0350,_0x32a9b4);}}; \ No newline at end of file +var _0x4dfe=['emit','removeListener','register','length','dashboard:','update'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x4dfe,0x15b));var _0xe4df=function(_0x2d81de,_0x119dea){_0x2d81de=_0x2d81de-0x0;var _0x114c59=_0x4dfe[_0x2d81de];return _0x114c59;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save','remove',_0xe4df('0x0')];function createListener(_0x1970d1,_0x24bdfe){return function(_0x5a7880){_0x24bdfe[_0xe4df('0x1')](_0x1970d1,_0x5a7880);};}function removeListener(_0x1520a0,_0x4b7cae){return function(){DashboardEvents[_0xe4df('0x2')](_0x1520a0,_0x4b7cae);};}exports[_0xe4df('0x3')]=function(_0x4e79ba){for(var _0x4d85ca=0x0,_0x3edcc8=events[_0xe4df('0x4')];_0x4d85ca<_0x3edcc8;_0x4d85ca++){var _0x332694=events[_0x4d85ca];var _0x51edf4=createListener(_0xe4df('0x5')+_0x332694,_0x4e79ba);DashboardEvents['on'](_0x332694,_0x51edf4);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 9fab1da..9120b7b 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 _0x6c0f=['get','isAuthenticated','index','/:id','show','/:id/items','post','/:id/clone','clone','addItem','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57435e,_0xa6c9bc){var _0x1869f1=function(_0x2b2619){while(--_0x2b2619){_0x57435e['push'](_0x57435e['shift']());}};_0x1869f1(++_0xa6c9bc);}(_0x6c0f,0x150));var _0xf6c0=function(_0x55c937,_0x4136f7){_0x55c937=_0x55c937-0x0;var _0xc45fad=_0x6c0f[_0x55c937];return _0xc45fad;};'use strict';var multer=require('multer');var util=require(_0xf6c0('0x0'));var path=require(_0xf6c0('0x1'));var timeout=require(_0xf6c0('0x2'));var express=require(_0xf6c0('0x3'));var router=express[_0xf6c0('0x4')]();var fs_extra=require(_0xf6c0('0x5'));var auth=require(_0xf6c0('0x6'));var interaction=require(_0xf6c0('0x7'));var config=require(_0xf6c0('0x8'));var controller=require('./dashboard.controller');router[_0xf6c0('0x9')]('/',auth[_0xf6c0('0xa')](),controller[_0xf6c0('0xb')]);router['get'](_0xf6c0('0xc'),auth['isAuthenticated'](),controller[_0xf6c0('0xd')]);router['get'](_0xf6c0('0xe'),auth['isAuthenticated'](),controller['getItems']);router[_0xf6c0('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xf6c0('0x10'),auth[_0xf6c0('0xa')](),controller[_0xf6c0('0x11')]);router[_0xf6c0('0xf')](_0xf6c0('0xe'),auth[_0xf6c0('0xa')](),controller[_0xf6c0('0x12')]);router['put'](_0xf6c0('0xc'),auth['isAuthenticated'](),controller[_0xf6c0('0x13')]);router[_0xf6c0('0x14')]('/:id',auth[_0xf6c0('0xa')](),controller[_0xf6c0('0x15')]);module[_0xf6c0('0x16')]=router; \ No newline at end of file +var _0x9ae9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','exports','util','path','connect-timeout','express','Router'];(function(_0x5c5c54,_0x5872b8){var _0x40e34c=function(_0x2f63b2){while(--_0x2f63b2){_0x5c5c54['push'](_0x5c5c54['shift']());}};_0x40e34c(++_0x5872b8);}(_0x9ae9,0x8b));var _0x99ae=function(_0xd12c7f,_0x413a4d){_0xd12c7f=_0xd12c7f-0x0;var _0x4702da=_0x9ae9[_0xd12c7f];return _0x4702da;};'use strict';var multer=require('multer');var util=require(_0x99ae('0x0'));var path=require(_0x99ae('0x1'));var timeout=require(_0x99ae('0x2'));var express=require(_0x99ae('0x3'));var router=express[_0x99ae('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x99ae('0x5'));var interaction=require(_0x99ae('0x6'));var config=require(_0x99ae('0x7'));var controller=require(_0x99ae('0x8'));router[_0x99ae('0x9')]('/',auth[_0x99ae('0xa')](),controller[_0x99ae('0xb')]);router[_0x99ae('0x9')](_0x99ae('0xc'),auth[_0x99ae('0xa')](),controller[_0x99ae('0xd')]);router[_0x99ae('0x9')](_0x99ae('0xe'),auth[_0x99ae('0xa')](),controller[_0x99ae('0xf')]);router[_0x99ae('0x10')]('/',auth['isAuthenticated'](),controller[_0x99ae('0x11')]);router[_0x99ae('0x10')](_0x99ae('0x12'),auth[_0x99ae('0xa')](),controller[_0x99ae('0x13')]);router[_0x99ae('0x10')](_0x99ae('0xe'),auth[_0x99ae('0xa')](),controller[_0x99ae('0x14')]);router[_0x99ae('0x15')](_0x99ae('0xc'),auth['isAuthenticated'](),controller[_0x99ae('0x16')]);router['delete']('/:id',auth[_0x99ae('0xa')](),controller['destroy']);module[_0x99ae('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index c7ed4b4..f70bd5b 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 _0xe2fe=['setDataValue','INTEGER','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify'];(function(_0x5c528c,_0x30cbae){var _0x31a944=function(_0x60a402){while(--_0x60a402){_0x5c528c['push'](_0x5c528c['shift']());}};_0x31a944(++_0x30cbae);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));var squel=require('squel');var _=require('lodash');module[_0xee2f('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xee2f('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xee2f('0x3')](_0xee2f('0x4')),'get':function(){try{return JSON[_0xee2f('0x5')](this[_0xee2f('0x6')]('attrs'));}catch(_0x311a2f){return[];}},'set':function(_0x2b7e7c){try{this['setDataValue'](_0xee2f('0x7'),JSON[_0xee2f('0x8')](_0x2b7e7c));}catch(_0x5a7975){this[_0xee2f('0x9')]('attrs',JSON[_0xee2f('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xee2f('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xee2f('0xa')]},'col':{'type':Sequelize[_0xee2f('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xee2f('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x6d38=['INTEGER','STRING','#2196f3','squel','lodash','exports','TEXT','parse','getDataValue','attrs','setDataValue','stringify'];(function(_0x1e3f59,_0xd39d37){var _0x46a871=function(_0x1490b1){while(--_0x1490b1){_0x1e3f59['push'](_0x1e3f59['shift']());}};_0x46a871(++_0xd39d37);}(_0x6d38,0x1ef));var _0x86d3=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6d38[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x86d3('0x0'));var _=require(_0x86d3('0x1'));module[_0x86d3('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x86d3('0x3')]('long'),'get':function(){try{return JSON[_0x86d3('0x4')](this[_0x86d3('0x5')](_0x86d3('0x6')));}catch(_0x4ef557){return[];}},'set':function(_0x2d8272){try{this[_0x86d3('0x7')](_0x86d3('0x6'),JSON[_0x86d3('0x8')](_0x2d8272));}catch(_0x47e654){this['setDataValue'](_0x86d3('0x6'),JSON[_0x86d3('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x86d3('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x86d3('0x9')]},'background':{'type':Sequelize[_0x86d3('0xa')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x86d3('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x86d3('0xa')]},'titleFontSize':{'type':Sequelize['INTEGER'],'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 cad6f35..648f997 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 _0xe91f=['attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','lodash','squel','crypto','desk.js','papaparse','ioredis','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','end','status','json','offset','undefined','limit','count','apply','reject','update','then','sendStatus','error','name','send','params','model','DashboardItem','rawAttributes','query','keys','filters','attributes','fields','includeAll','include','merge','options','catch','destroy','find','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1'];(function(_0x12f452,_0x34ecbc){var _0x1b7778=function(_0x4ba457){while(--_0x4ba457){_0x12f452['push'](_0x12f452['shift']());}};_0x1b7778(++_0x34ecbc);}(_0xe91f,0xf8));var _0xfe91=function(_0x1fb9e2,_0x277bcc){_0x1fb9e2=_0x1fb9e2-0x0;var _0x379305=_0xe91f[_0x1fb9e2];return _0x379305;};'use strict';var emlformat=require(_0xfe91('0x0'));var rimraf=require(_0xfe91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe91('0x2'));var rp=require('request-promise');var moment=require(_0xfe91('0x3'));var BPromise=require(_0xfe91('0x4'));var Mustache=require(_0xfe91('0x5'));var util=require('util');var path=require(_0xfe91('0x6'));var sox=require(_0xfe91('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe91('0x8'));var squel=require(_0xfe91('0x9'));var crypto=require(_0xfe91('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfe91('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfe91('0xc'));var Redis=require(_0xfe91('0xd'));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')(_0xfe91('0xe'));var utils=require(_0xfe91('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xfe91('0x10'));var db=require(_0xfe91('0x11'))['db'];config[_0xfe91('0x12')]=_['defaults'](config[_0xfe91('0x12')],{'host':_0xfe91('0x13'),'port':0x18eb});var socket=require(_0xfe91('0x14'))(new Redis(config[_0xfe91('0x12')]));require(_0xfe91('0x15'))['register'](socket);function respondWithStatusCode(_0x27f41d,_0x41b0bf){_0x41b0bf=_0x41b0bf||0xcc;return function(_0x145c77){if(_0x145c77){return _0x27f41d['sendStatus'](_0x41b0bf);}return _0x27f41d['status'](_0x41b0bf)[_0xfe91('0x16')]();};}function respondWithResult(_0x5cefbf,_0x2efd25){_0x2efd25=_0x2efd25||0xc8;return function(_0x1dd98f){if(_0x1dd98f){return _0x5cefbf[_0xfe91('0x17')](_0x2efd25)[_0xfe91('0x18')](_0x1dd98f);}};}function respondWithFilteredResult(_0x23f685,_0x3a5c80){return function(_0x49d580){if(_0x49d580){var _0x2ed04a=typeof _0x3a5c80[_0xfe91('0x19')]===_0xfe91('0x1a')&&typeof _0x3a5c80[_0xfe91('0x1b')]==='undefined';var _0x4158d4=_0x49d580[_0xfe91('0x1c')];var _0x423cc4=_0x2ed04a?0x0:_0x3a5c80[_0xfe91('0x19')];var _0xebc4cd=_0x2ed04a?_0x49d580[_0xfe91('0x1c')]:_0x3a5c80[_0xfe91('0x19')]+_0x3a5c80[_0xfe91('0x1b')];var _0xd94f30;if(_0xebc4cd>=_0x4158d4){_0xebc4cd=_0x4158d4;_0xd94f30=0xc8;}else{_0xd94f30=0xce;}_0x23f685[_0xfe91('0x17')](_0xd94f30);return _0x23f685['set']('Content-Range',_0x423cc4+'-'+_0xebc4cd+'/'+_0x4158d4)[_0xfe91('0x18')](_0x49d580);}return null;};}function patchUpdates(_0x2ab69c){return function(_0x8ab145){try{jsonpatch[_0xfe91('0x1d')](_0x8ab145,_0x2ab69c,!![]);}catch(_0x37bc71){return BPromise[_0xfe91('0x1e')](_0x37bc71);}return _0x8ab145['save']();};}function saveUpdates(_0xe14856,_0x4d1b6c){return function(_0x378ca4){if(_0x378ca4){return _0x378ca4[_0xfe91('0x1f')](_0xe14856)[_0xfe91('0x20')](function(_0x396719){return _0x396719;});}return null;};}function removeEntity(_0x3cdc0f,_0x418a1c){return function(_0x1668ea){if(_0x1668ea){return _0x1668ea['destroy']()[_0xfe91('0x20')](function(){_0x3cdc0f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4200d0,_0x2fef82){return function(_0x3f44df){if(!_0x3f44df){_0x4200d0[_0xfe91('0x21')](0x194);}return _0x3f44df;};}function handleError(_0x544b91,_0x5ef011){_0x5ef011=_0x5ef011||0x1f4;return function(_0x23ebe1){logger[_0xfe91('0x22')](_0x23ebe1['stack']);if(_0x23ebe1[_0xfe91('0x23')]){delete _0x23ebe1['name'];}_0x544b91[_0xfe91('0x17')](_0x5ef011)[_0xfe91('0x24')](_0x23ebe1);};}exports['show']=function(_0x9c2da9,_0x5f4cfb){var _0x1a168d={'raw':![],'where':{'id':_0x9c2da9[_0xfe91('0x25')]['id']}},_0x3d6086={};_0x3d6086[_0xfe91('0x26')]=_['keys'](db[_0xfe91('0x27')][_0xfe91('0x28')]);_0x3d6086[_0xfe91('0x29')]=_[_0xfe91('0x2a')](_0x9c2da9['query']);_0x3d6086[_0xfe91('0x2b')]=_['intersection'](_0x3d6086[_0xfe91('0x26')],_0x3d6086[_0xfe91('0x29')]);_0x1a168d[_0xfe91('0x2c')]=_['intersection'](_0x3d6086[_0xfe91('0x26')],qs[_0xfe91('0x2d')](_0x9c2da9[_0xfe91('0x29')][_0xfe91('0x2d')]));_0x1a168d[_0xfe91('0x2c')]=_0x1a168d['attributes']['length']?_0x1a168d[_0xfe91('0x2c')]:_0x3d6086[_0xfe91('0x26')];if(_0x9c2da9[_0xfe91('0x29')][_0xfe91('0x2e')]){_0x1a168d[_0xfe91('0x2f')]=[{'all':!![]}];}_0x1a168d=_[_0xfe91('0x30')]({},_0x1a168d,_0x9c2da9[_0xfe91('0x31')]);return db[_0xfe91('0x27')]['find'](_0x1a168d)[_0xfe91('0x20')](handleEntityNotFound(_0x5f4cfb,null))[_0xfe91('0x20')](respondWithResult(_0x5f4cfb,null))[_0xfe91('0x32')](handleError(_0x5f4cfb,null));};exports[_0xfe91('0x33')]=function(_0x343ca9,_0x2ff63f){return db['DashboardItem'][_0xfe91('0x34')]({'where':{'id':_0x343ca9[_0xfe91('0x25')]['id']}})[_0xfe91('0x20')](handleEntityNotFound(_0x2ff63f,null))[_0xfe91('0x20')](removeEntity(_0x2ff63f,null))[_0xfe91('0x32')](handleError(_0x2ff63f,null));};function widgetAttributes(_0x5b21cc){try{switch(_0x5b21cc[_0xfe91('0x35')]){case _0xfe91('0x36'):return[{'name':_0xfe91('0x37'),'value':_0x5b21cc[_0xfe91('0x37')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc[_0xfe91('0x38')][0x0][_0xfe91('0x39')]:undefined)||_0xfe91('0x3a')}];case'custom':return[{'name':_0xfe91('0x3b'),'value':_0x5b21cc['attrPath']||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc['attrs'][0x0]?_0x5b21cc[_0xfe91('0x38')][0x0][_0xfe91('0x39')]:undefined)||''}];case _0xfe91('0x3c'):return[{'name':_0xfe91('0x3d'),'value':_0x5b21cc[_0xfe91('0x3d')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc[_0xfe91('0x38')][0x0]['value']:undefined)||_0xfe91('0x3e')},{'name':_0xfe91('0x3f'),'value':_0x5b21cc[_0xfe91('0x3f')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc['attrs'][0x1]?_0x5b21cc[_0xfe91('0x38')][0x1][_0xfe91('0x39')]:undefined)||'0.00'},{'name':_0xfe91('0x40'),'value':_0x5b21cc[_0xfe91('0x40')]||(_0x5b21cc['attrs']&&_0x5b21cc[_0xfe91('0x38')][0x2]?_0x5b21cc[_0xfe91('0x38')][0x2][_0xfe91('0x39')]:undefined)||0xc}];case _0xfe91('0x41'):return[{'name':_0xfe91('0x42'),'value':_0x5b21cc[_0xfe91('0x42')]||(_0x5b21cc['attrs']&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc['attrs'][0x0][_0xfe91('0x39')]:undefined)||_0xfe91('0x43')},{'name':'attrVoiceQueues','value':_0x5b21cc[_0xfe91('0x44')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc['attrs'][0x1]?_0x5b21cc[_0xfe91('0x38')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x5b21cc[_0xfe91('0x40')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x2]?_0x5b21cc[_0xfe91('0x38')][0x2][_0xfe91('0x39')]:undefined)||0x14}];case _0xfe91('0x45'):case _0xfe91('0x46'):return[{'name':_0xfe91('0x47'),'value':_0x5b21cc[_0xfe91('0x47')]||(_0x5b21cc['attrs']&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc[_0xfe91('0x38')][0x0][_0xfe91('0x39')]:undefined)||_0xfe91('0x43')},{'name':_0xfe91('0x48'),'value':_0x5b21cc[_0xfe91('0x48')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x1]?_0x5b21cc[_0xfe91('0x38')][0x1][_0xfe91('0x39')]:undefined)||null},{'name':_0xfe91('0x49'),'value':_0x5b21cc['attrSerie3']||(_0x5b21cc['attrs']&&_0x5b21cc[_0xfe91('0x38')][0x2]?_0x5b21cc[_0xfe91('0x38')][0x2][_0xfe91('0x39')]:undefined)||null},{'name':_0xfe91('0x44'),'value':_0x5b21cc[_0xfe91('0x44')]||(_0x5b21cc['attrs']&&_0x5b21cc['attrs'][0x3]?_0x5b21cc['attrs'][0x3]['value']:undefined)||[]}];case _0xfe91('0x4a'):return[{'name':_0xfe91('0x4b'),'type':_0x5b21cc[_0xfe91('0x4c')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc['attrs'][0x0][_0xfe91('0x35')]:undefined)||null,'value':_0x5b21cc['attrReport']||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc['attrs'][0x0][_0xfe91('0x39')]:undefined)||null},{'name':_0xfe91('0x4d'),'value':_0x5b21cc[_0xfe91('0x4d')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc['attrs'][0x1]?_0x5b21cc[_0xfe91('0x38')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1da056){logger[_0xfe91('0x22')]('widgetAttributes:\x20%s',JSON['stringify'](_0x1da056));return[];}}exports[_0xfe91('0x4e')]=function(_0x3178ef,_0x5ec74b){if(_0x3178ef[_0xfe91('0x4f')]){_0x3178ef['body'][_0xfe91('0x38')]=widgetAttributes(_0x3178ef[_0xfe91('0x4f')]);}return db[_0xfe91('0x27')][_0xfe91('0x4e')](_0x3178ef[_0xfe91('0x4f')],{})[_0xfe91('0x20')](respondWithResult(_0x5ec74b,0xc9))[_0xfe91('0x32')](handleError(_0x5ec74b,null));};exports[_0xfe91('0x1f')]=function(_0x38dbfd,_0x28a392){if(_0x38dbfd[_0xfe91('0x4f')]['id']){delete _0x38dbfd[_0xfe91('0x4f')]['id'];}_0x38dbfd[_0xfe91('0x4f')][_0xfe91('0x38')]=widgetAttributes(_0x38dbfd['body']);return db[_0xfe91('0x27')]['find']({'where':{'id':_0x38dbfd[_0xfe91('0x25')]['id']}})['then'](handleEntityNotFound(_0x28a392,null))[_0xfe91('0x20')](saveUpdates(_0x38dbfd[_0xfe91('0x4f')],null))['then'](respondWithResult(_0x28a392,null))[_0xfe91('0x32')](handleError(_0x28a392,null));}; \ No newline at end of file +var _0x7114=['attrReport','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','status','end','json','offset','limit','undefined','count','Content-Range','save','update','then','destroy','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','params','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3'];(function(_0x3c3fc7,_0x5a17c1){var _0x491162=function(_0x5e1280){while(--_0x5e1280){_0x3c3fc7['push'](_0x3c3fc7['shift']());}};_0x491162(++_0x5a17c1);}(_0x7114,0x177));var _0x4711=function(_0x3af63d,_0xd159f6){_0x3af63d=_0x3af63d-0x0;var _0x103609=_0x7114[_0x3af63d];return _0x103609;};'use strict';var emlformat=require(_0x4711('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4711('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4711('0x2'));var moment=require(_0x4711('0x3'));var BPromise=require(_0x4711('0x4'));var Mustache=require(_0x4711('0x5'));var util=require('util');var path=require(_0x4711('0x6'));var sox=require(_0x4711('0x7'));var csv=require(_0x4711('0x8'));var ejs=require(_0x4711('0x9'));var fs=require('fs');var fs_extra=require(_0x4711('0xa'));var _=require(_0x4711('0xb'));var squel=require('squel');var crypto=require(_0x4711('0xc'));var jsforce=require(_0x4711('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4711('0x8'));var querystring=require(_0x4711('0xe'));var Papa=require('papaparse');var Redis=require(_0x4711('0xf'));var authService=require(_0x4711('0x10'));var qs=require(_0x4711('0x11'));var as=require(_0x4711('0x12'));var hardwareService=require(_0x4711('0x13'));var logger=require(_0x4711('0x14'))(_0x4711('0x15'));var utils=require(_0x4711('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4711('0x17'));var db=require('../../mysqldb')['db'];config[_0x4711('0x18')]=_[_0x4711('0x19')](config[_0x4711('0x18')],{'host':_0x4711('0x1a'),'port':0x18eb});var socket=require(_0x4711('0x1b'))(new Redis(config[_0x4711('0x18')]));require(_0x4711('0x1c'))['register'](socket);function respondWithStatusCode(_0x19cab8,_0x1359cc){_0x1359cc=_0x1359cc||0xcc;return function(_0x1fd001){if(_0x1fd001){return _0x19cab8['sendStatus'](_0x1359cc);}return _0x19cab8[_0x4711('0x1d')](_0x1359cc)[_0x4711('0x1e')]();};}function respondWithResult(_0x43404d,_0xde1922){_0xde1922=_0xde1922||0xc8;return function(_0x3b560b){if(_0x3b560b){return _0x43404d[_0x4711('0x1d')](_0xde1922)[_0x4711('0x1f')](_0x3b560b);}};}function respondWithFilteredResult(_0x1ceeb7,_0x52b93a){return function(_0x13ce49){if(_0x13ce49){var _0x5d7754=typeof _0x52b93a[_0x4711('0x20')]==='undefined'&&typeof _0x52b93a[_0x4711('0x21')]===_0x4711('0x22');var _0x126e9b=_0x13ce49[_0x4711('0x23')];var _0x36850f=_0x5d7754?0x0:_0x52b93a[_0x4711('0x20')];var _0xdee62d=_0x5d7754?_0x13ce49[_0x4711('0x23')]:_0x52b93a[_0x4711('0x20')]+_0x52b93a['limit'];var _0x11ccb4;if(_0xdee62d>=_0x126e9b){_0xdee62d=_0x126e9b;_0x11ccb4=0xc8;}else{_0x11ccb4=0xce;}_0x1ceeb7['status'](_0x11ccb4);return _0x1ceeb7['set'](_0x4711('0x24'),_0x36850f+'-'+_0xdee62d+'/'+_0x126e9b)[_0x4711('0x1f')](_0x13ce49);}return null;};}function patchUpdates(_0x243e31){return function(_0xdb04e2){try{jsonpatch['apply'](_0xdb04e2,_0x243e31,!![]);}catch(_0x17c8ca){return BPromise['reject'](_0x17c8ca);}return _0xdb04e2[_0x4711('0x25')]();};}function saveUpdates(_0x314d79,_0x5acbc6){return function(_0xa50b5c){if(_0xa50b5c){return _0xa50b5c[_0x4711('0x26')](_0x314d79)[_0x4711('0x27')](function(_0x36d3af){return _0x36d3af;});}return null;};}function removeEntity(_0x1cc576,_0x35ecb6){return function(_0x26a220){if(_0x26a220){return _0x26a220[_0x4711('0x28')]()[_0x4711('0x27')](function(){_0x1cc576[_0x4711('0x1d')](0xcc)[_0x4711('0x1e')]();});}};}function handleEntityNotFound(_0x3614bb,_0x438150){return function(_0x5df4bd){if(!_0x5df4bd){_0x3614bb['sendStatus'](0x194);}return _0x5df4bd;};}function handleError(_0x2b3997,_0x756465){_0x756465=_0x756465||0x1f4;return function(_0x1b1a41){logger[_0x4711('0x29')](_0x1b1a41[_0x4711('0x2a')]);if(_0x1b1a41[_0x4711('0x2b')]){delete _0x1b1a41[_0x4711('0x2b')];}_0x2b3997[_0x4711('0x1d')](_0x756465)[_0x4711('0x2c')](_0x1b1a41);};}exports[_0x4711('0x2d')]=function(_0x27cdf4,_0x4664c7){var _0x2163b9={'raw':![],'where':{'id':_0x27cdf4['params']['id']}},_0x216764={};_0x216764[_0x4711('0x2e')]=_[_0x4711('0x2f')](db[_0x4711('0x30')][_0x4711('0x31')]);_0x216764[_0x4711('0x32')]=_['keys'](_0x27cdf4[_0x4711('0x32')]);_0x216764[_0x4711('0x33')]=_[_0x4711('0x34')](_0x216764[_0x4711('0x2e')],_0x216764[_0x4711('0x32')]);_0x2163b9[_0x4711('0x35')]=_[_0x4711('0x34')](_0x216764['model'],qs[_0x4711('0x36')](_0x27cdf4['query'][_0x4711('0x36')]));_0x2163b9[_0x4711('0x35')]=_0x2163b9[_0x4711('0x35')][_0x4711('0x37')]?_0x2163b9[_0x4711('0x35')]:_0x216764['model'];if(_0x27cdf4[_0x4711('0x32')][_0x4711('0x38')]){_0x2163b9[_0x4711('0x39')]=[{'all':!![]}];}_0x2163b9=_[_0x4711('0x3a')]({},_0x2163b9,_0x27cdf4[_0x4711('0x3b')]);return db[_0x4711('0x30')][_0x4711('0x3c')](_0x2163b9)[_0x4711('0x27')](handleEntityNotFound(_0x4664c7,null))[_0x4711('0x27')](respondWithResult(_0x4664c7,null))[_0x4711('0x3d')](handleError(_0x4664c7,null));};exports['destroy']=function(_0x35bb5c,_0xbabbd3){return db[_0x4711('0x30')][_0x4711('0x3c')]({'where':{'id':_0x35bb5c[_0x4711('0x3e')]['id']}})['then'](handleEntityNotFound(_0xbabbd3,null))[_0x4711('0x27')](removeEntity(_0xbabbd3,null))[_0x4711('0x3d')](handleError(_0xbabbd3,null));};function widgetAttributes(_0x12a034){try{switch(_0x12a034['type']){case _0x4711('0x3f'):return[{'name':_0x4711('0x40'),'value':_0x12a034[_0x4711('0x40')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x0]?_0x12a034[_0x4711('0x41')][0x0]['value']:undefined)||_0x4711('0x42')}];case _0x4711('0x43'):return[{'name':_0x4711('0x44'),'value':_0x12a034[_0x4711('0x44')]||(_0x12a034['attrs']&&_0x12a034[_0x4711('0x41')][0x0]?_0x12a034[_0x4711('0x41')][0x0][_0x4711('0x45')]:undefined)||''}];case _0x4711('0x46'):return[{'name':'attrHourFormat','value':_0x12a034[_0x4711('0x47')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034['attrs'][0x0]?_0x12a034[_0x4711('0x41')][0x0]['value']:undefined)||_0x4711('0x48')},{'name':'attrTimezone','value':_0x12a034[_0x4711('0x49')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x1]?_0x12a034['attrs'][0x1][_0x4711('0x45')]:undefined)||_0x4711('0x4a')},{'name':_0x4711('0x4b'),'value':_0x12a034[_0x4711('0x4b')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x2]?_0x12a034[_0x4711('0x41')][0x2][_0x4711('0x45')]:undefined)||0xc}];case _0x4711('0x4c'):return[{'name':_0x4711('0x4d'),'value':_0x12a034[_0x4711('0x4d')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x0]?_0x12a034[_0x4711('0x41')][0x0][_0x4711('0x45')]:undefined)||_0x4711('0x4e')},{'name':'attrVoiceQueues','value':_0x12a034[_0x4711('0x4f')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x1]?_0x12a034['attrs'][0x1][_0x4711('0x45')]:undefined)||[]},{'name':_0x4711('0x4b'),'value':_0x12a034[_0x4711('0x4b')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x2]?_0x12a034[_0x4711('0x41')][0x2][_0x4711('0x45')]:undefined)||0x14}];case _0x4711('0x50'):case _0x4711('0x51'):return[{'name':_0x4711('0x52'),'value':_0x12a034[_0x4711('0x52')]||(_0x12a034['attrs']&&_0x12a034['attrs'][0x0]?_0x12a034['attrs'][0x0][_0x4711('0x45')]:undefined)||_0x4711('0x4e')},{'name':'attrSerie2','value':_0x12a034[_0x4711('0x53')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x1]?_0x12a034[_0x4711('0x41')][0x1][_0x4711('0x45')]:undefined)||null},{'name':'attrSerie3','value':_0x12a034[_0x4711('0x54')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034['attrs'][0x2]?_0x12a034[_0x4711('0x41')][0x2][_0x4711('0x45')]:undefined)||null},{'name':_0x4711('0x4f'),'value':_0x12a034[_0x4711('0x4f')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x3]?_0x12a034[_0x4711('0x41')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x4711('0x55'),'type':_0x12a034['reportType']||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x0]?_0x12a034[_0x4711('0x41')][0x0][_0x4711('0x56')]:undefined)||null,'value':_0x12a034[_0x4711('0x55')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x0]?_0x12a034[_0x4711('0x41')][0x0][_0x4711('0x45')]:undefined)||null},{'name':_0x4711('0x57'),'value':_0x12a034[_0x4711('0x57')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x1]?_0x12a034[_0x4711('0x41')][0x1][_0x4711('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x557389){logger[_0x4711('0x29')](_0x4711('0x58'),JSON[_0x4711('0x59')](_0x557389));return[];}}exports[_0x4711('0x5a')]=function(_0x287289,_0x35b34a){if(_0x287289[_0x4711('0x5b')]){_0x287289[_0x4711('0x5b')][_0x4711('0x41')]=widgetAttributes(_0x287289[_0x4711('0x5b')]);}return db['DashboardItem'][_0x4711('0x5a')](_0x287289[_0x4711('0x5b')],{})[_0x4711('0x27')](respondWithResult(_0x35b34a,0xc9))[_0x4711('0x3d')](handleError(_0x35b34a,null));};exports[_0x4711('0x26')]=function(_0x4b222f,_0x5f3906){if(_0x4b222f[_0x4711('0x5b')]['id']){delete _0x4b222f['body']['id'];}_0x4b222f['body'][_0x4711('0x41')]=widgetAttributes(_0x4b222f[_0x4711('0x5b')]);return db[_0x4711('0x30')][_0x4711('0x3c')]({'where':{'id':_0x4b222f[_0x4711('0x3e')]['id']}})[_0x4711('0x27')](handleEntityNotFound(_0x5f3906,null))[_0x4711('0x27')](saveUpdates(_0x4b222f[_0x4711('0x5b')],null))[_0x4711('0x27')](respondWithResult(_0x5f3906,null))[_0x4711('0x3d')](handleError(_0x5f3906,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index f16b59d..a6bb433 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 _0x2d20=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','save','update'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2d20,0x1d1));var _0x02d2=function(_0x1c9176,_0x1b66eb){_0x1c9176=_0x1c9176-0x0;var _0x93deeb=_0x2d20[_0x1c9176];return _0x93deeb;};'use strict';var EventEmitter=require(_0x02d2('0x0'));var DashboardItem=require(_0x02d2('0x1'))['db'][_0x02d2('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x02d2('0x3'),'afterUpdate':_0x02d2('0x4'),'afterDestroy':_0x02d2('0x5')};function emitEvent(_0x46e545){return function(_0xc5dbf3,_0xd46046,_0x30799b){DashboardItemEvents[_0x02d2('0x6')](_0x46e545+':'+_0xc5dbf3['id'],_0xc5dbf3);DashboardItemEvents[_0x02d2('0x6')](_0x46e545,_0xc5dbf3);_0x30799b(null);};}for(var e in events){if(events[_0x02d2('0x7')](e)){var event=events[e];DashboardItem[_0x02d2('0x8')](e,emitEvent(event));}}module[_0x02d2('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x490e=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','DashboardItem'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x490e,0x10b));var _0xe490=function(_0x487d0a,_0x1b7cb4){_0x487d0a=_0x487d0a-0x0;var _0x3d740c=_0x490e[_0x487d0a];return _0x3d740c;};'use strict';var EventEmitter=require(_0xe490('0x0'));var DashboardItem=require(_0xe490('0x1'))['db'][_0xe490('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe490('0x3'),'afterUpdate':_0xe490('0x4'),'afterDestroy':_0xe490('0x5')};function emitEvent(_0x42e6c4){return function(_0x34298d,_0xf9b88c,_0x468f6b){DashboardItemEvents[_0xe490('0x6')](_0x42e6c4+':'+_0x34298d['id'],_0x34298d);DashboardItemEvents[_0xe490('0x6')](_0x42e6c4,_0x34298d);_0x468f6b(null);};}for(var e in events){if(events[_0xe490('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xe490('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 73ea2fd..481ee92 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 _0x92a4=['lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','dashboard_items'];(function(_0x453db0,_0x5cdc9b){var _0x382549=function(_0x2e3b69){while(--_0x2e3b69){_0x453db0['push'](_0x453db0['shift']());}};_0x382549(++_0x5cdc9b);}(_0x92a4,0xb4));var _0x492a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x92a4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x492a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x492a('0x1'));var moment=require('moment');var BPromise=require(_0x492a('0x2'));var rp=require(_0x492a('0x3'));var fs=require('fs');var path=require(_0x492a('0x4'));var rimraf=require(_0x492a('0x5'));var config=require(_0x492a('0x6'));var attributes=require(_0x492a('0x7'));module['exports']=function(_0x239caf,_0x3e47a2){return _0x239caf['define']('DashboardItem',attributes,{'tableName':_0x492a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d54=['dashboard_items','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','define'];(function(_0x35cbb9,_0x2536b6){var _0x3262cb=function(_0x19ffb4){while(--_0x19ffb4){_0x35cbb9['push'](_0x35cbb9['shift']());}};_0x3262cb(++_0x2536b6);}(_0x9d54,0x155));var _0x49d5=function(_0x11df74,_0x40bb4b){_0x11df74=_0x11df74-0x0;var _0x5db810=_0x9d54[_0x11df74];return _0x5db810;};'use strict';var _=require('lodash');var util=require(_0x49d5('0x0'));var logger=require(_0x49d5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x49d5('0x2'));var rp=require(_0x49d5('0x3'));var fs=require('fs');var path=require(_0x49d5('0x4'));var rimraf=require(_0x49d5('0x5'));var config=require(_0x49d5('0x6'));var attributes=require(_0x49d5('0x7'));module['exports']=function(_0x49eff0,_0x2eac1f){return _0x49eff0[_0x49d5('0x8')]('DashboardItem',attributes,{'tableName':_0x49d5('0x9'),'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 65cac3a..5d66a3f 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 _0x482a=['then','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','DashboardItem,\x20%s,\x20%s','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x2a318a,_0x3f8006){var _0x346cf3=function(_0x314595){while(--_0x314595){_0x2a318a['push'](_0x2a318a['shift']());}};_0x346cf3(++_0x3f8006);}(_0x482a,0xc0));var _0xa482=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x482a[_0x368fb9];return _0x4892fb;};'use strict';var _=require(_0xa482('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa482('0x1'));var rs=require(_0xa482('0x2'));var fs=require('fs');var Redis=require(_0xa482('0x3'));var db=require(_0xa482('0x4'))['db'];var utils=require(_0xa482('0x5'));var logger=require('../../config/logger')(_0xa482('0x6'));var config=require(_0xa482('0x7'));var jayson=require(_0xa482('0x8'));var client=jayson[_0xa482('0x9')]['http']({'port':0x232a});config[_0xa482('0xa')]=_[_0xa482('0xb')](config[_0xa482('0xa')],{'host':_0xa482('0xc'),'port':0x18eb});var socket=require(_0xa482('0xd'))(new Redis(config['redis']));require(_0xa482('0xe'))[_0xa482('0xf')](socket);function respondWithRpcPromise(_0x585e12,_0x2713e4,_0x4d9c03){return new BPromise(function(_0x107d03,_0x16f8bb){return client['request'](_0x585e12,_0x4d9c03)[_0xa482('0x10')](function(_0x216466){logger['info']('DashboardItem,\x20%s,\x20%s',_0x2713e4,_0xa482('0x11'));logger[_0xa482('0x12')](_0xa482('0x13'),_0x2713e4,'request\x20sent',JSON['stringify'](_0x216466));if(_0x216466[_0xa482('0x14')]){if(_0x216466[_0xa482('0x14')][_0xa482('0x15')]===0x1f4){logger['error'](_0xa482('0x16'),_0x2713e4,_0x216466['error'][_0xa482('0x17')]);return _0x16f8bb(_0x216466[_0xa482('0x14')][_0xa482('0x17')]);}logger[_0xa482('0x14')](_0xa482('0x16'),_0x2713e4,_0x216466[_0xa482('0x14')][_0xa482('0x17')]);return _0x107d03(_0x216466[_0xa482('0x14')][_0xa482('0x17')]);}else{logger[_0xa482('0x18')](_0xa482('0x16'),_0x2713e4,_0xa482('0x11'));_0x107d03(_0x216466[_0xa482('0x19')][_0xa482('0x17')]);}})['catch'](function(_0x28838f){logger[_0xa482('0x14')](_0xa482('0x16'),_0x2713e4,_0x28838f);_0x16f8bb(_0x28838f);});});} \ No newline at end of file +var _0x743f=['request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x743f,0x104));var _0xf743=function(_0x4af7fe,_0x535377){_0x4af7fe=_0x4af7fe-0x0;var _0x5dbfda=_0x743f[_0x4af7fe];return _0x5dbfda;};'use strict';var _=require(_0xf743('0x0'));var util=require(_0xf743('0x1'));var moment=require(_0xf743('0x2'));var BPromise=require(_0xf743('0x3'));var rs=require(_0xf743('0x4'));var fs=require('fs');var Redis=require(_0xf743('0x5'));var db=require(_0xf743('0x6'))['db'];var utils=require(_0xf743('0x7'));var logger=require('../../config/logger')(_0xf743('0x8'));var config=require(_0xf743('0x9'));var jayson=require(_0xf743('0xa'));var client=jayson[_0xf743('0xb')][_0xf743('0xc')]({'port':0x232a});config['redis']=_[_0xf743('0xd')](config[_0xf743('0xe')],{'host':_0xf743('0xf'),'port':0x18eb});var socket=require(_0xf743('0x10'))(new Redis(config[_0xf743('0xe')]));require(_0xf743('0x11'))[_0xf743('0x12')](socket);function respondWithRpcPromise(_0x34272b,_0x459d9d,_0x382bc){return new BPromise(function(_0x4b8c7f,_0x182deb){return client[_0xf743('0x13')](_0x34272b,_0x382bc)[_0xf743('0x14')](function(_0x2e3888){logger[_0xf743('0x15')](_0xf743('0x16'),_0x459d9d,'request\x20sent');logger[_0xf743('0x17')](_0xf743('0x18'),_0x459d9d,_0xf743('0x19'),JSON[_0xf743('0x1a')](_0x2e3888));if(_0x2e3888[_0xf743('0x1b')]){if(_0x2e3888[_0xf743('0x1b')][_0xf743('0x1c')]===0x1f4){logger[_0xf743('0x1b')](_0xf743('0x16'),_0x459d9d,_0x2e3888[_0xf743('0x1b')][_0xf743('0x1d')]);return _0x182deb(_0x2e3888['error'][_0xf743('0x1d')]);}logger[_0xf743('0x1b')](_0xf743('0x16'),_0x459d9d,_0x2e3888[_0xf743('0x1b')][_0xf743('0x1d')]);return _0x4b8c7f(_0x2e3888[_0xf743('0x1b')]['message']);}else{logger['info'](_0xf743('0x16'),_0x459d9d,_0xf743('0x19'));_0x4b8c7f(_0x2e3888['result'][_0xf743('0x1d')]);}})[_0xf743('0x1e')](function(_0x54658c){logger['error'](_0xf743('0x16'),_0x459d9d,_0x54658c);_0x182deb(_0x54658c);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 16e4865..6ef0a27 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 _0x9542=['dashboardItem:','./dashboardItem.events','save','update','length'];(function(_0x2691dd,_0x5b7947){var _0x4e66c1=function(_0x3db4a9){while(--_0x3db4a9){_0x2691dd['push'](_0x2691dd['shift']());}};_0x4e66c1(++_0x5b7947);}(_0x9542,0x11e));var _0x2954=function(_0x33353b,_0x401751){_0x33353b=_0x33353b-0x0;var _0x20086d=_0x9542[_0x33353b];return _0x20086d;};'use strict';var DashboardItemEvents=require(_0x2954('0x0'));var events=[_0x2954('0x1'),'remove',_0x2954('0x2')];function createListener(_0x182c57,_0x573273){return function(_0x36bc88){_0x573273['emit'](_0x182c57,_0x36bc88);};}function removeListener(_0x2b8730,_0x51243a){return function(){DashboardItemEvents['removeListener'](_0x2b8730,_0x51243a);};}exports['register']=function(_0x4e0d0b){for(var _0x1d4d5e=0x0,_0x550aa2=events[_0x2954('0x3')];_0x1d4d5e<_0x550aa2;_0x1d4d5e++){var _0x2e3b13=events[_0x1d4d5e];var _0x5e8a40=createListener(_0x2954('0x4')+_0x2e3b13,_0x4e0d0b);DashboardItemEvents['on'](_0x2e3b13,_0x5e8a40);}}; \ No newline at end of file +var _0x6406=['register','dashboardItem:','./dashboardItem.events','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6406,0x9e));var _0x6640=function(_0x434138,_0x74656){_0x434138=_0x434138-0x0;var _0x40ebdd=_0x6406[_0x434138];return _0x40ebdd;};'use strict';var DashboardItemEvents=require(_0x6640('0x0'));var events=['save',_0x6640('0x1'),_0x6640('0x2')];function createListener(_0x4e38f6,_0x42d753){return function(_0x58e0be){_0x42d753[_0x6640('0x3')](_0x4e38f6,_0x58e0be);};}function removeListener(_0x68a867,_0x148f5a){return function(){DashboardItemEvents['removeListener'](_0x68a867,_0x148f5a);};}exports[_0x6640('0x4')]=function(_0x2dc702){for(var _0x105fac=0x0,_0x78c566=events['length'];_0x105fac<_0x78c566;_0x105fac++){var _0x3669bf=events[_0x105fac];var _0x35b4b2=createListener(_0x6640('0x5')+_0x3669bf,_0x2dc702);DashboardItemEvents['on'](_0x3669bf,_0x35b4b2);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index defe2c7..4d1b7e7 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 _0xcafb=['show','isAuthenticated','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id'];(function(_0x17086d,_0x36fd66){var _0x57adce=function(_0x183422){while(--_0x183422){_0x17086d['push'](_0x17086d['shift']());}};_0x57adce(++_0x36fd66);}(_0xcafb,0xe4));var _0xbcaf=function(_0x29d79e,_0x4c1e50){_0x29d79e=_0x29d79e-0x0;var _0xf91ad2=_0xcafb[_0x29d79e];return _0xf91ad2;};'use strict';var multer=require(_0xbcaf('0x0'));var util=require(_0xbcaf('0x1'));var path=require(_0xbcaf('0x2'));var timeout=require(_0xbcaf('0x3'));var express=require(_0xbcaf('0x4'));var router=express[_0xbcaf('0x5')]();var fs_extra=require(_0xbcaf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbcaf('0x7'));var config=require(_0xbcaf('0x8'));var controller=require(_0xbcaf('0x9'));router[_0xbcaf('0xa')](_0xbcaf('0xb'),auth['isAuthenticated'](),controller[_0xbcaf('0xc')]);router['post']('/',auth[_0xbcaf('0xd')](),controller['create']);router[_0xbcaf('0xe')](_0xbcaf('0xb'),auth['isAuthenticated'](),controller[_0xbcaf('0xf')]);router['delete']('/:id',auth[_0xbcaf('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6ecf=['fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x4f2dfa,_0x2be505){var _0x1eebd2=function(_0x3689d8){while(--_0x3689d8){_0x4f2dfa['push'](_0x4f2dfa['shift']());}};_0x1eebd2(++_0x2be505);}(_0x6ecf,0x19a));var _0xf6ec=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6ecf[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require('multer');var util=require(_0xf6ec('0x0'));var path=require(_0xf6ec('0x1'));var timeout=require(_0xf6ec('0x2'));var express=require(_0xf6ec('0x3'));var router=express['Router']();var fs_extra=require(_0xf6ec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf6ec('0x5'));var config=require(_0xf6ec('0x6'));var controller=require(_0xf6ec('0x7'));router[_0xf6ec('0x8')](_0xf6ec('0x9'),auth[_0xf6ec('0xa')](),controller[_0xf6ec('0xb')]);router[_0xf6ec('0xc')]('/',auth['isAuthenticated'](),controller[_0xf6ec('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf6ec('0xe')]);router[_0xf6ec('0xf')](_0xf6ec('0x9'),auth[_0xf6ec('0xa')](),controller[_0xf6ec('0x10')]);module[_0xf6ec('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 59878e5..c1384c6 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 _0x0f3f=['first','STRING','exports','ENUM'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x0f3f,0x19a));var _0xf0f3=function(_0x289c3e,_0x3614b5){_0x289c3e=_0x289c3e-0x0;var _0x25a4b3=_0x0f3f[_0x289c3e];return _0x25a4b3;};'use strict';var Sequelize=require('sequelize');module[_0xf0f3('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xf0f3('0x1')](_0xf0f3('0x2'),'second','third'),'allowNull':![],'defaultValue':_0xf0f3('0x2')},'description':{'type':Sequelize[_0xf0f3('0x3')]}}; \ No newline at end of file +var _0xc9c6=['third','first','STRING','exports','ENUM','second'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xc9c6,0x1a7));var _0x6c9c=function(_0x5ee5ac,_0xe68d07){_0x5ee5ac=_0x5ee5ac-0x0;var _0x30fbdd=_0xc9c6[_0x5ee5ac];return _0x30fbdd;};'use strict';var Sequelize=require('sequelize');module[_0x6c9c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x6c9c('0x1')]('first',_0x6c9c('0x2'),_0x6c9c('0x3')),'allowNull':![],'defaultValue':_0x6c9c('0x4')},'description':{'type':Sequelize[_0x6c9c('0x5')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 0498486..24d3003 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 _0x9034=['end','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Disposition','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','find','userProfileId','autoAssociation','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1b860b,_0xe4be7){var _0x2aad10=function(_0x220468){while(--_0x220468){_0x1b860b['push'](_0x1b860b['shift']());}};_0x2aad10(++_0xe4be7);}(_0x9034,0x1cd));var _0x4903=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9034[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4903('0x0'));var zipdir=require(_0x4903('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4903('0x2'));var moment=require('moment');var BPromise=require(_0x4903('0x3'));var Mustache=require(_0x4903('0x4'));var util=require(_0x4903('0x5'));var path=require(_0x4903('0x6'));var sox=require('sox');var csv=require(_0x4903('0x7'));var ejs=require(_0x4903('0x8'));var fs=require('fs');var fs_extra=require(_0x4903('0x9'));var _=require(_0x4903('0xa'));var squel=require(_0x4903('0xb'));var crypto=require('crypto');var jsforce=require(_0x4903('0xc'));var deskjs=require(_0x4903('0xd'));var toCsv=require(_0x4903('0x7'));var querystring=require(_0x4903('0xe'));var Papa=require(_0x4903('0xf'));var Redis=require('ioredis');var authService=require(_0x4903('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4903('0x11'));var hardwareService=require(_0x4903('0x12'));var logger=require('../../config/logger')(_0x4903('0x13'));var utils=require('../../config/utils');var config=require(_0x4903('0x14'));var licenseUtil=require(_0x4903('0x15'));var db=require(_0x4903('0x16'))['db'];function respondWithStatusCode(_0x23dd77,_0x3deb11){_0x3deb11=_0x3deb11||0xcc;return function(_0x5cbe80){if(_0x5cbe80){return _0x23dd77[_0x4903('0x17')](_0x3deb11);}return _0x23dd77[_0x4903('0x18')](_0x3deb11)[_0x4903('0x19')]();};}function respondWithResult(_0x111738,_0x30e22b){_0x30e22b=_0x30e22b||0xc8;return function(_0x3fae15){if(_0x3fae15){return _0x111738[_0x4903('0x18')](_0x30e22b)['json'](_0x3fae15);}};}function respondWithFilteredResult(_0x954494,_0x5d100d){return function(_0x2176cd){if(_0x2176cd){var _0x115478=typeof _0x5d100d[_0x4903('0x1a')]==='undefined'&&typeof _0x5d100d['limit']===_0x4903('0x1b');var _0x25bac1=_0x2176cd[_0x4903('0x1c')];var _0x5934a1=_0x115478?0x0:_0x5d100d[_0x4903('0x1a')];var _0x3dea5f=_0x115478?_0x2176cd['count']:_0x5d100d[_0x4903('0x1a')]+_0x5d100d[_0x4903('0x1d')];var _0x333374;if(_0x3dea5f>=_0x25bac1){_0x3dea5f=_0x25bac1;_0x333374=0xc8;}else{_0x333374=0xce;}_0x954494[_0x4903('0x18')](_0x333374);return _0x954494[_0x4903('0x1e')](_0x4903('0x1f'),_0x5934a1+'-'+_0x3dea5f+'/'+_0x25bac1)[_0x4903('0x20')](_0x2176cd);}return null;};}function patchUpdates(_0x5b6505){return function(_0x149c4b){try{jsonpatch[_0x4903('0x21')](_0x149c4b,_0x5b6505,!![]);}catch(_0x8741f2){return BPromise['reject'](_0x8741f2);}return _0x149c4b['save']();};}function saveUpdates(_0x1e47ee,_0x2fdce6){return function(_0x1aa5b5){if(_0x1aa5b5){return _0x1aa5b5[_0x4903('0x22')](_0x1e47ee)[_0x4903('0x23')](function(_0x186f2d){return _0x186f2d;});}return null;};}function removeEntity(_0x154312,_0x4635b9){return function(_0x2da1e6){if(_0x2da1e6){return _0x2da1e6['destroy']()[_0x4903('0x23')](function(){var _0x2823b3=_0x2da1e6[_0x4903('0x24')]({'plain':!![]});var _0x4fe6f8='Dispositions';return db[_0x4903('0x25')][_0x4903('0x26')]({'where':{'type':_0x4fe6f8,'resourceId':_0x2823b3['id']}})[_0x4903('0x23')](function(){return _0x2da1e6;});})['then'](function(){_0x154312['status'](0xcc)[_0x4903('0x19')]();});}};}function handleEntityNotFound(_0x368116,_0x164aa5){return function(_0x8ab962){if(!_0x8ab962){_0x368116[_0x4903('0x17')](0x194);}return _0x8ab962;};}function handleError(_0x2b0379,_0xb21966){_0xb21966=_0xb21966||0x1f4;return function(_0x57f015){logger[_0x4903('0x27')](_0x57f015[_0x4903('0x28')]);if(_0x57f015['name']){delete _0x57f015[_0x4903('0x29')];}_0x2b0379[_0x4903('0x18')](_0xb21966)[_0x4903('0x2a')](_0x57f015);};}exports[_0x4903('0x2b')]=function(_0x32f4fb,_0x15a4d7){var _0x4dda21={},_0x30bbf0={},_0xab17d6={'count':0x0,'rows':[]};var _0x18ac9b=_[_0x4903('0x2c')](db[_0x4903('0x2d')][_0x4903('0x2e')],function(_0x25c9d8){return{'name':_0x25c9d8['fieldName'],'type':_0x25c9d8['type'][_0x4903('0x2f')]};});_0x30bbf0[_0x4903('0x30')]=_['map'](_0x18ac9b,_0x4903('0x29'));_0x30bbf0[_0x4903('0x31')]=_[_0x4903('0x32')](_0x32f4fb['query']);_0x30bbf0['filters']=_[_0x4903('0x33')](_0x30bbf0['model'],_0x30bbf0[_0x4903('0x31')]);_0x4dda21[_0x4903('0x34')]=_[_0x4903('0x33')](_0x30bbf0[_0x4903('0x30')],qs['fields'](_0x32f4fb[_0x4903('0x31')][_0x4903('0x35')]));_0x4dda21['attributes']=_0x4dda21[_0x4903('0x34')][_0x4903('0x36')]?_0x4dda21[_0x4903('0x34')]:_0x30bbf0[_0x4903('0x30')];if(!_0x32f4fb[_0x4903('0x31')][_0x4903('0x37')](_0x4903('0x38'))){_0x4dda21[_0x4903('0x1d')]=qs['limit'](_0x32f4fb[_0x4903('0x31')][_0x4903('0x1d')]);_0x4dda21['offset']=qs['offset'](_0x32f4fb[_0x4903('0x31')][_0x4903('0x1a')]);}_0x4dda21[_0x4903('0x39')]=qs[_0x4903('0x3a')](_0x32f4fb['query'][_0x4903('0x3a')]);_0x4dda21[_0x4903('0x3b')]=qs[_0x4903('0x3c')](_[_0x4903('0x3d')](_0x32f4fb['query'],_0x30bbf0[_0x4903('0x3c')]),_0x18ac9b);if(_0x32f4fb[_0x4903('0x31')][_0x4903('0x3e')]){_0x4dda21[_0x4903('0x3b')]=_[_0x4903('0x3f')](_0x4dda21[_0x4903('0x3b')],{'$or':_[_0x4903('0x2c')](_0x18ac9b,function(_0x373968){if(_0x373968[_0x4903('0x40')]!==_0x4903('0x41')){var _0x256796={};_0x256796[_0x373968[_0x4903('0x29')]]={'$like':'%'+_0x32f4fb[_0x4903('0x31')][_0x4903('0x3e')]+'%'};return _0x256796;}})});}_0x4dda21=_[_0x4903('0x3f')]({},_0x4dda21,_0x32f4fb[_0x4903('0x42')]);var _0x432fed={'where':_0x4dda21[_0x4903('0x3b')]};return db[_0x4903('0x2d')]['count'](_0x432fed)[_0x4903('0x23')](function(_0x189b51){_0xab17d6[_0x4903('0x1c')]=_0x189b51;if(_0x32f4fb[_0x4903('0x31')][_0x4903('0x43')]){_0x4dda21[_0x4903('0x44')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4dda21);})[_0x4903('0x23')](function(_0x2f1067){_0xab17d6['rows']=_0x2f1067;return _0xab17d6;})['then'](respondWithFilteredResult(_0x15a4d7,_0x4dda21))[_0x4903('0x45')](handleError(_0x15a4d7,null));};exports[_0x4903('0x46')]=function(_0x3b054f,_0xe5fc77){var _0x3f7e20={'raw':!![],'where':{'id':_0x3b054f['params']['id']}},_0x149704={};_0x149704[_0x4903('0x30')]=_[_0x4903('0x32')](db['Disposition'][_0x4903('0x2e')]);_0x149704[_0x4903('0x31')]=_['keys'](_0x3b054f[_0x4903('0x31')]);_0x149704[_0x4903('0x3c')]=_[_0x4903('0x33')](_0x149704[_0x4903('0x30')],_0x149704['query']);_0x3f7e20[_0x4903('0x34')]=_[_0x4903('0x33')](_0x149704[_0x4903('0x30')],qs[_0x4903('0x35')](_0x3b054f[_0x4903('0x31')]['fields']));_0x3f7e20[_0x4903('0x34')]=_0x3f7e20[_0x4903('0x34')][_0x4903('0x36')]?_0x3f7e20[_0x4903('0x34')]:_0x149704[_0x4903('0x30')];if(_0x3b054f['query'][_0x4903('0x43')]){_0x3f7e20['include']=[{'all':!![]}];}_0x3f7e20=_[_0x4903('0x3f')]({},_0x3f7e20,_0x3b054f['options']);return db[_0x4903('0x2d')]['find'](_0x3f7e20)[_0x4903('0x23')](handleEntityNotFound(_0xe5fc77,null))[_0x4903('0x23')](respondWithResult(_0xe5fc77,null))[_0x4903('0x45')](handleError(_0xe5fc77,null));};exports[_0x4903('0x47')]=function(_0x8f2d4c,_0x5ef362){return db[_0x4903('0x2d')][_0x4903('0x47')](_0x8f2d4c[_0x4903('0x48')],{})[_0x4903('0x23')](function(_0x418689){var _0x217ede=_0x8f2d4c[_0x4903('0x49')][_0x4903('0x24')]({'plain':!![]});if(!_0x217ede)throw new Error(_0x4903('0x4a'));if(_0x217ede[_0x4903('0x4b')]===_0x4903('0x49')){var _0x58bb3f=_0x418689[_0x4903('0x24')]({'plain':!![]});var _0x793c16=_0x4903('0x4c');return db[_0x4903('0x4d')][_0x4903('0x4e')]({'where':{'name':_0x793c16,'userProfileId':_0x217ede[_0x4903('0x4f')]},'raw':!![]})[_0x4903('0x23')](function(_0x4f469f){if(_0x4f469f&&_0x4f469f[_0x4903('0x50')]===0x0){return db[_0x4903('0x25')][_0x4903('0x47')]({'name':_0x58bb3f['name'],'resourceId':_0x58bb3f['id'],'type':_0x4f469f[_0x4903('0x29')],'sectionId':_0x4f469f['id']},{})['then'](function(){return _0x418689;});}else{return _0x418689;}})[_0x4903('0x45')](function(_0x1e6e3d){logger[_0x4903('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e6e3d);throw _0x1e6e3d;});}return _0x418689;})[_0x4903('0x23')](respondWithResult(_0x5ef362,0xc9))['catch'](handleError(_0x5ef362,null));};exports[_0x4903('0x22')]=function(_0x2df451,_0x529e42){if(_0x2df451[_0x4903('0x48')]['id']){delete _0x2df451['body']['id'];}return db[_0x4903('0x2d')][_0x4903('0x4e')]({'where':{'id':_0x2df451['params']['id']}})[_0x4903('0x23')](handleEntityNotFound(_0x529e42,null))[_0x4903('0x23')](saveUpdates(_0x2df451['body'],null))['then'](respondWithResult(_0x529e42,null))[_0x4903('0x45')](handleError(_0x529e42,null));};exports['destroy']=function(_0x5779b7,_0x37cb02){return db[_0x4903('0x2d')][_0x4903('0x4e')]({'where':{'id':_0x5779b7['params']['id']}})['then'](handleEntityNotFound(_0x37cb02,null))[_0x4903('0x23')](removeEntity(_0x37cb02,null))['catch'](handleError(_0x37cb02,null));}; \ No newline at end of file +var _0xc55e=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','destroy','then','get','Dispositions','UserProfileResource','end','stack','name','send','index','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','Disposition','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation'];(function(_0x1a659e,_0x419c03){var _0x372753=function(_0x2d4f7f){while(--_0x2d4f7f){_0x1a659e['push'](_0x1a659e['shift']());}};_0x372753(++_0x419c03);}(_0xc55e,0x146));var _0xec55=function(_0x3666ce,_0x3c5c82){_0x3666ce=_0x3666ce-0x0;var _0x164a73=_0xc55e[_0x3666ce];return _0x164a73;};'use strict';var emlformat=require(_0xec55('0x0'));var rimraf=require(_0xec55('0x1'));var zipdir=require(_0xec55('0x2'));var jsonpatch=require(_0xec55('0x3'));var rp=require(_0xec55('0x4'));var moment=require('moment');var BPromise=require(_0xec55('0x5'));var Mustache=require(_0xec55('0x6'));var util=require(_0xec55('0x7'));var path=require(_0xec55('0x8'));var sox=require(_0xec55('0x9'));var csv=require('to-csv');var ejs=require(_0xec55('0xa'));var fs=require('fs');var fs_extra=require(_0xec55('0xb'));var _=require(_0xec55('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xec55('0xd'));var toCsv=require(_0xec55('0xe'));var querystring=require(_0xec55('0xf'));var Papa=require(_0xec55('0x10'));var Redis=require(_0xec55('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xec55('0x12'));var as=require(_0xec55('0x13'));var hardwareService=require(_0xec55('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xec55('0x15'));var licenseUtil=require(_0xec55('0x16'));var db=require(_0xec55('0x17'))['db'];function respondWithStatusCode(_0x5dc831,_0x32042f){_0x32042f=_0x32042f||0xcc;return function(_0x12a687){if(_0x12a687){return _0x5dc831[_0xec55('0x18')](_0x32042f);}return _0x5dc831[_0xec55('0x19')](_0x32042f)['end']();};}function respondWithResult(_0x308c39,_0x5f0a85){_0x5f0a85=_0x5f0a85||0xc8;return function(_0x2faa9d){if(_0x2faa9d){return _0x308c39[_0xec55('0x19')](_0x5f0a85)[_0xec55('0x1a')](_0x2faa9d);}};}function respondWithFilteredResult(_0x5747e7,_0x23916a){return function(_0x10de6a){if(_0x10de6a){var _0x249f73=typeof _0x23916a['offset']===_0xec55('0x1b')&&typeof _0x23916a[_0xec55('0x1c')]===_0xec55('0x1b');var _0x3b471c=_0x10de6a[_0xec55('0x1d')];var _0x5abb76=_0x249f73?0x0:_0x23916a[_0xec55('0x1e')];var _0x1ab4d2=_0x249f73?_0x10de6a[_0xec55('0x1d')]:_0x23916a['offset']+_0x23916a[_0xec55('0x1c')];var _0x25adea;if(_0x1ab4d2>=_0x3b471c){_0x1ab4d2=_0x3b471c;_0x25adea=0xc8;}else{_0x25adea=0xce;}_0x5747e7[_0xec55('0x19')](_0x25adea);return _0x5747e7['set'](_0xec55('0x1f'),_0x5abb76+'-'+_0x1ab4d2+'/'+_0x3b471c)[_0xec55('0x1a')](_0x10de6a);}return null;};}function patchUpdates(_0x5c1b03){return function(_0x3c8871){try{jsonpatch['apply'](_0x3c8871,_0x5c1b03,!![]);}catch(_0x568a36){return BPromise[_0xec55('0x20')](_0x568a36);}return _0x3c8871[_0xec55('0x21')]();};}function saveUpdates(_0x2c9eb1,_0x9a9d38){return function(_0x21f335){if(_0x21f335){return _0x21f335['update'](_0x2c9eb1)['then'](function(_0x368d09){return _0x368d09;});}return null;};}function removeEntity(_0x43aca0,_0x5ce959){return function(_0x18b5d6){if(_0x18b5d6){return _0x18b5d6[_0xec55('0x22')]()[_0xec55('0x23')](function(){var _0x1cec0a=_0x18b5d6[_0xec55('0x24')]({'plain':!![]});var _0x197cc9=_0xec55('0x25');return db[_0xec55('0x26')]['destroy']({'where':{'type':_0x197cc9,'resourceId':_0x1cec0a['id']}})['then'](function(){return _0x18b5d6;});})[_0xec55('0x23')](function(){_0x43aca0[_0xec55('0x19')](0xcc)[_0xec55('0x27')]();});}};}function handleEntityNotFound(_0x238f48,_0x5c6588){return function(_0x38f7fb){if(!_0x38f7fb){_0x238f48[_0xec55('0x18')](0x194);}return _0x38f7fb;};}function handleError(_0x8e6c9f,_0x19c7d4){_0x19c7d4=_0x19c7d4||0x1f4;return function(_0x3fd7ef){logger['error'](_0x3fd7ef[_0xec55('0x28')]);if(_0x3fd7ef['name']){delete _0x3fd7ef[_0xec55('0x29')];}_0x8e6c9f[_0xec55('0x19')](_0x19c7d4)[_0xec55('0x2a')](_0x3fd7ef);};}exports[_0xec55('0x2b')]=function(_0x25e6c9,_0x1830a4){var _0x48b406={},_0x35f522={},_0x1ad344={'count':0x0,'rows':[]};var _0x378ded=_['map'](db['Disposition']['rawAttributes'],function(_0x110957){return{'name':_0x110957['fieldName'],'type':_0x110957['type'][_0xec55('0x2c')]};});_0x35f522['model']=_[_0xec55('0x2d')](_0x378ded,'name');_0x35f522[_0xec55('0x2e')]=_[_0xec55('0x2f')](_0x25e6c9[_0xec55('0x2e')]);_0x35f522[_0xec55('0x30')]=_[_0xec55('0x31')](_0x35f522['model'],_0x35f522[_0xec55('0x2e')]);_0x48b406[_0xec55('0x32')]=_[_0xec55('0x31')](_0x35f522['model'],qs[_0xec55('0x33')](_0x25e6c9[_0xec55('0x2e')][_0xec55('0x33')]));_0x48b406[_0xec55('0x32')]=_0x48b406[_0xec55('0x32')][_0xec55('0x34')]?_0x48b406[_0xec55('0x32')]:_0x35f522[_0xec55('0x35')];if(!_0x25e6c9['query'][_0xec55('0x36')]('nolimit')){_0x48b406[_0xec55('0x1c')]=qs['limit'](_0x25e6c9[_0xec55('0x2e')][_0xec55('0x1c')]);_0x48b406[_0xec55('0x1e')]=qs['offset'](_0x25e6c9[_0xec55('0x2e')]['offset']);}_0x48b406['order']=qs['sort'](_0x25e6c9['query'][_0xec55('0x37')]);_0x48b406[_0xec55('0x38')]=qs[_0xec55('0x30')](_[_0xec55('0x39')](_0x25e6c9[_0xec55('0x2e')],_0x35f522[_0xec55('0x30')]),_0x378ded);if(_0x25e6c9[_0xec55('0x2e')][_0xec55('0x3a')]){_0x48b406[_0xec55('0x38')]=_['merge'](_0x48b406['where'],{'$or':_['map'](_0x378ded,function(_0x522bcf){if(_0x522bcf[_0xec55('0x3b')]!==_0xec55('0x3c')){var _0x3afb95={};_0x3afb95[_0x522bcf['name']]={'$like':'%'+_0x25e6c9[_0xec55('0x2e')]['filter']+'%'};return _0x3afb95;}})});}_0x48b406=_[_0xec55('0x3d')]({},_0x48b406,_0x25e6c9['options']);var _0x192a0d={'where':_0x48b406[_0xec55('0x38')]};return db[_0xec55('0x3e')][_0xec55('0x1d')](_0x192a0d)[_0xec55('0x23')](function(_0x152168){_0x1ad344[_0xec55('0x1d')]=_0x152168;if(_0x25e6c9[_0xec55('0x2e')][_0xec55('0x3f')]){_0x48b406[_0xec55('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xec55('0x41')](_0x48b406);})[_0xec55('0x23')](function(_0x459f28){_0x1ad344['rows']=_0x459f28;return _0x1ad344;})[_0xec55('0x23')](respondWithFilteredResult(_0x1830a4,_0x48b406))[_0xec55('0x42')](handleError(_0x1830a4,null));};exports[_0xec55('0x43')]=function(_0x57a570,_0x563b68){var _0x4e30c4={'raw':!![],'where':{'id':_0x57a570[_0xec55('0x44')]['id']}},_0x4d72fe={};_0x4d72fe['model']=_[_0xec55('0x2f')](db[_0xec55('0x3e')][_0xec55('0x45')]);_0x4d72fe[_0xec55('0x2e')]=_['keys'](_0x57a570['query']);_0x4d72fe[_0xec55('0x30')]=_[_0xec55('0x31')](_0x4d72fe['model'],_0x4d72fe[_0xec55('0x2e')]);_0x4e30c4['attributes']=_[_0xec55('0x31')](_0x4d72fe[_0xec55('0x35')],qs[_0xec55('0x33')](_0x57a570['query'][_0xec55('0x33')]));_0x4e30c4['attributes']=_0x4e30c4['attributes'][_0xec55('0x34')]?_0x4e30c4[_0xec55('0x32')]:_0x4d72fe[_0xec55('0x35')];if(_0x57a570['query']['includeAll']){_0x4e30c4['include']=[{'all':!![]}];}_0x4e30c4=_[_0xec55('0x3d')]({},_0x4e30c4,_0x57a570[_0xec55('0x46')]);return db[_0xec55('0x3e')][_0xec55('0x47')](_0x4e30c4)[_0xec55('0x23')](handleEntityNotFound(_0x563b68,null))[_0xec55('0x23')](respondWithResult(_0x563b68,null))[_0xec55('0x42')](handleError(_0x563b68,null));};exports[_0xec55('0x48')]=function(_0x1cb602,_0x4d54db){return db['Disposition'][_0xec55('0x48')](_0x1cb602[_0xec55('0x49')],{})['then'](function(_0xcb63aa){var _0x340a6f=_0x1cb602['user'][_0xec55('0x24')]({'plain':!![]});if(!_0x340a6f)throw new Error(_0xec55('0x4a'));if(_0x340a6f[_0xec55('0x4b')]===_0xec55('0x4c')){var _0x2b0812=_0xcb63aa[_0xec55('0x24')]({'plain':!![]});var _0x11a776='Dispositions';return db[_0xec55('0x4d')][_0xec55('0x47')]({'where':{'name':_0x11a776,'userProfileId':_0x340a6f['userProfileId']},'raw':!![]})[_0xec55('0x23')](function(_0x30e5d8){if(_0x30e5d8&&_0x30e5d8[_0xec55('0x4e')]===0x0){return db[_0xec55('0x26')][_0xec55('0x48')]({'name':_0x2b0812[_0xec55('0x29')],'resourceId':_0x2b0812['id'],'type':_0x30e5d8[_0xec55('0x29')],'sectionId':_0x30e5d8['id']},{})['then'](function(){return _0xcb63aa;});}else{return _0xcb63aa;}})[_0xec55('0x42')](function(_0x1f4578){logger['error'](_0xec55('0x4f'),_0x1f4578);throw _0x1f4578;});}return _0xcb63aa;})[_0xec55('0x23')](respondWithResult(_0x4d54db,0xc9))[_0xec55('0x42')](handleError(_0x4d54db,null));};exports[_0xec55('0x50')]=function(_0x1ce047,_0x4b972d){if(_0x1ce047[_0xec55('0x49')]['id']){delete _0x1ce047[_0xec55('0x49')]['id'];}return db[_0xec55('0x3e')][_0xec55('0x47')]({'where':{'id':_0x1ce047[_0xec55('0x44')]['id']}})[_0xec55('0x23')](handleEntityNotFound(_0x4b972d,null))['then'](saveUpdates(_0x1ce047[_0xec55('0x49')],null))[_0xec55('0x23')](respondWithResult(_0x4b972d,null))[_0xec55('0x42')](handleError(_0x4b972d,null));};exports['destroy']=function(_0x8a4888,_0x59d7df){return db[_0xec55('0x3e')]['find']({'where':{'id':_0x8a4888[_0xec55('0x44')]['id']}})['then'](handleEntityNotFound(_0x59d7df,null))[_0xec55('0x23')](removeEntity(_0x59d7df,null))[_0xec55('0x42')](handleError(_0x59d7df,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index a1c2ea4..36e1ede 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 _0xc931=['exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes'];(function(_0x186496,_0x3c83ed){var _0xf2d985=function(_0x4f44a1){while(--_0x4f44a1){_0x186496['push'](_0x186496['shift']());}};_0xf2d985(++_0x3c83ed);}(_0xc931,0xd0));var _0x1c93=function(_0x2a1a10,_0x4b1eff){_0x2a1a10=_0x2a1a10-0x0;var _0x180e23=_0xc931[_0x2a1a10];return _0x180e23;};'use strict';var _=require('lodash');var util=require(_0x1c93('0x0'));var logger=require(_0x1c93('0x1'))('api');var moment=require(_0x1c93('0x2'));var BPromise=require('bluebird');var rp=require(_0x1c93('0x3'));var fs=require('fs');var path=require(_0x1c93('0x4'));var rimraf=require(_0x1c93('0x5'));var config=require(_0x1c93('0x6'));var attributes=require(_0x1c93('0x7'));module[_0x1c93('0x8')]=function(_0x258889,_0x2b871d){return _0x258889[_0x1c93('0x9')](_0x1c93('0xa'),attributes,{'tableName':_0x1c93('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x1c93('0xc'),'fields':[_0x1c93('0xd'),_0x1c93('0xe')]},{'unique':!![],'name':_0x1c93('0xf'),'fields':[_0x1c93('0xd'),_0x1c93('0x10')]},{'unique':!![],'name':'name_mail','fields':[_0x1c93('0xd'),_0x1c93('0x11')]},{'unique':!![],'name':_0x1c93('0x12'),'fields':['name',_0x1c93('0x13')]},{'unique':!![],'name':'name_fax','fields':['name',_0x1c93('0x14')]},{'unique':!![],'name':_0x1c93('0x15'),'fields':[_0x1c93('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x1c93('0x16'),'fields':['name',_0x1c93('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb76b=['OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','FaxAccountId','name_openchannel'];(function(_0x44fffe,_0x330dd8){var _0x7f0797=function(_0x3ababd){while(--_0x3ababd){_0x44fffe['push'](_0x44fffe['shift']());}};_0x7f0797(++_0x330dd8);}(_0xb76b,0x12f));var _0xbb76=function(_0x4ffac1,_0x4a5eaa){_0x4ffac1=_0x4ffac1-0x0;var _0x381eca=_0xb76b[_0x4ffac1];return _0x381eca;};'use strict';var _=require('lodash');var util=require(_0xbb76('0x0'));var logger=require(_0xbb76('0x1'))(_0xbb76('0x2'));var moment=require('moment');var BPromise=require(_0xbb76('0x3'));var rp=require(_0xbb76('0x4'));var fs=require('fs');var path=require(_0xbb76('0x5'));var rimraf=require(_0xbb76('0x6'));var config=require(_0xbb76('0x7'));var attributes=require(_0xbb76('0x8'));module[_0xbb76('0x9')]=function(_0x789165,_0x2a98c0){return _0x789165[_0xbb76('0xa')]('Disposition',attributes,{'tableName':_0xbb76('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xbb76('0xc'),'fields':['name',_0xbb76('0xd')]},{'unique':!![],'name':_0xbb76('0xe'),'fields':[_0xbb76('0xf'),_0xbb76('0x10')]},{'unique':!![],'name':_0xbb76('0x11'),'fields':[_0xbb76('0xf'),_0xbb76('0x12')]},{'unique':!![],'name':_0xbb76('0x13'),'fields':['name','SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0xbb76('0xf'),_0xbb76('0x14')]},{'unique':!![],'name':_0xbb76('0x15'),'fields':[_0xbb76('0xf'),_0xbb76('0x16')]},{'unique':!![],'name':_0xbb76('0x17'),'fields':['name',_0xbb76('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index b11a8eb..9bd3ac9 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(_0xad4022,_0x5877c9){var _0x543bde=function(_0x32b85c){while(--_0x32b85c){_0xad4022['push'](_0xad4022['shift']());}};_0x543bde(++_0x5877c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x335072,_0x2a89db){var _0x5d719a=function(_0x741647){while(--_0x741647){_0x335072['push'](_0x335072['shift']());}};_0x5d719a(++_0x2a89db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 875aa2a..0838264 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 _0x87e0=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','put','delete'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x87e0,0x154));var _0x087e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x87e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x087e('0x0'));var path=require(_0x087e('0x1'));var timeout=require(_0x087e('0x2'));var express=require(_0x087e('0x3'));var router=express[_0x087e('0x4')]();var fs_extra=require(_0x087e('0x5'));var auth=require(_0x087e('0x6'));var interaction=require(_0x087e('0x7'));var config=require(_0x087e('0x8'));var controller=require(_0x087e('0x9'));router[_0x087e('0xa')]('/',auth[_0x087e('0xb')](),controller[_0x087e('0xc')]);router[_0x087e('0xa')](_0x087e('0xd'),auth[_0x087e('0xb')](),controller[_0x087e('0xe')]);router['post']('/',auth[_0x087e('0xb')](),controller['create']);router[_0x087e('0xf')](_0x087e('0xd'),auth[_0x087e('0xb')](),controller['update']);router[_0x087e('0x10')](_0x087e('0xd'),auth[_0x087e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x966f=['/:id','update','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','post','create','put'];(function(_0x3ef984,_0x3f5981){var _0x578b03=function(_0x112d2f){while(--_0x112d2f){_0x3ef984['push'](_0x3ef984['shift']());}};_0x578b03(++_0x3f5981);}(_0x966f,0x6d));var _0xf966=function(_0xdbde45,_0x36f38a){_0xdbde45=_0xdbde45-0x0;var _0x34a95a=_0x966f[_0xdbde45];return _0x34a95a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf966('0x0'));var express=require(_0xf966('0x1'));var router=express[_0xf966('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf966('0x3'));var interaction=require(_0xf966('0x4'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xf966('0x5')]('/',auth['isAuthenticated'](),controller[_0xf966('0x6')]);router[_0xf966('0x5')]('/:id',auth[_0xf966('0x7')](),controller['show']);router[_0xf966('0x8')]('/',auth['isAuthenticated'](),controller[_0xf966('0x9')]);router[_0xf966('0xa')](_0xf966('0xb'),auth[_0xf966('0x7')](),controller[_0xf966('0xc')]);router['delete'](_0xf966('0xb'),auth[_0xf966('0x7')](),controller[_0xf966('0xd')]);module[_0xf966('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 2fa440d..83321cb 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 _0xc361=['STRING','yes','localstationid','4800','7200','9600','12000','14400','ENUM','v17,v27,v29','INTEGER','SIP','IAX','DADHI','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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0xc361,0x76));var _0x1c36=function(_0x2f2c64,_0x29db54){_0x2f2c64=_0x2f2c64-0x0;var _0x4ee4aa=_0xc361[_0x2f2c64];return _0x4ee4aa;};'use strict';var Sequelize=require(_0x1c36('0x0'));module[_0x1c36('0x1')]={'name':{'type':Sequelize[_0x1c36('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1c36('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x1c36('0x3'),'no'),'defaultValue':_0x1c36('0x3')},'headerinfo':{'type':Sequelize[_0x1c36('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x1c36('0x2')],'unique':_0x1c36('0x4')},'minrate':{'type':Sequelize['ENUM']('2400',_0x1c36('0x5'),_0x1c36('0x6'),_0x1c36('0x7'),_0x1c36('0x8'),_0x1c36('0x9')),'defaultValue':_0x1c36('0x5')},'maxrate':{'type':Sequelize[_0x1c36('0xa')]('2400',_0x1c36('0x5'),_0x1c36('0x6'),_0x1c36('0x7'),_0x1c36('0x8'),'14400'),'defaultValue':_0x1c36('0x9')},'modem':{'type':Sequelize[_0x1c36('0x2')],'defaultValue':_0x1c36('0xb')},'gateway':{'type':Sequelize[_0x1c36('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1c36('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x1c36('0xa')](_0x1c36('0xd'),_0x1c36('0xe'),_0x1c36('0xf'),_0x1c36('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x1c36('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1c36('0x11');}},'notificationSound':{'type':Sequelize[_0x1c36('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1c36('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1c36('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1c36('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1c36('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1c36('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1c36('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1c36('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1c36('0x14'),'set':function(_0x46e8eb){if(!_0x46e8eb)this['setDataValue'](_0x1c36('0x15'),null);this[_0x1c36('0x16')](_0x1c36('0x17'),_0x46e8eb);}}}; \ No newline at end of file +var _0xaa44=['4800','7200','9600','12000','14400','v17,v27,v29','SIP','IAX','DADHI','KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400'];(function(_0x582995,_0x55a862){var _0x322b86=function(_0x5e7130){while(--_0x5e7130){_0x582995['push'](_0x582995['shift']());}};_0x322b86(++_0x55a862);}(_0xaa44,0x1c6));var _0x4aa4=function(_0xb90b25,_0x3cbb10){_0xb90b25=_0xb90b25-0x0;var _0x3b98e9=_0xaa44[_0xb90b25];return _0x3b98e9;};'use strict';var Sequelize=require(_0x4aa4('0x0'));module[_0x4aa4('0x1')]={'name':{'type':Sequelize[_0x4aa4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4aa4('0x2')]},'ecm':{'type':Sequelize[_0x4aa4('0x3')](_0x4aa4('0x4'),'no'),'defaultValue':_0x4aa4('0x4')},'headerinfo':{'type':Sequelize[_0x4aa4('0x2')],'defaultValue':_0x4aa4('0x5')},'localstationid':{'type':Sequelize[_0x4aa4('0x2')],'unique':_0x4aa4('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x4aa4('0x7'),_0x4aa4('0x8'),_0x4aa4('0x9'),_0x4aa4('0xa'),_0x4aa4('0xb'),'14400'),'defaultValue':_0x4aa4('0x8')},'maxrate':{'type':Sequelize[_0x4aa4('0x3')](_0x4aa4('0x7'),_0x4aa4('0x8'),_0x4aa4('0x9'),'9600','12000',_0x4aa4('0xc')),'defaultValue':_0x4aa4('0xc')},'modem':{'type':Sequelize[_0x4aa4('0x2')],'defaultValue':_0x4aa4('0xd')},'gateway':{'type':Sequelize[_0x4aa4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4aa4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4aa4('0x3')](_0x4aa4('0xe'),_0x4aa4('0xf'),_0x4aa4('0x10'),_0x4aa4('0x11')),'defaultValue':_0x4aa4('0xe')},'key':{'type':Sequelize[_0x4aa4('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4aa4('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4aa4('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4aa4('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x4aa4('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x4aa4('0x12')],'defaultValue':![],'comment':_0x4aa4('0x14'),'set':function(_0x2e8c2a){if(!_0x2e8c2a)this['setDataValue'](_0x4aa4('0x15'),null);this['setDataValue']('mandatoryDisposition',_0x2e8c2a);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index a0cda98..2933e10 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 _0x371d=['CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','out','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','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','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','sendStatus','status','json','limit','count','offset','set','Content-Range','apply','reject','save','destroy','get','FaxAccounts','end','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','describe','FaxAccountId','Disposition','getDispositions','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','findOne','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','app','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','ecm','localstationid','faxdetect','headerinfo','maxrate','minrate','t38timeout','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','addAccountApplications','VoiceExtension','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','send','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename'];(function(_0x8567ae,_0x118fcf){var _0x2f9e9b=function(_0x7bef6f){while(--_0x7bef6f){_0x8567ae['push'](_0x8567ae['shift']());}};_0x2f9e9b(++_0x118fcf);}(_0x371d,0xd4));var _0xd371=function(_0x24fcec,_0x14a697){_0x24fcec=_0x24fcec-0x0;var _0x5533d3=_0x371d[_0x24fcec];return _0x5533d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd371('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd371('0x1'));var rp=require(_0xd371('0x2'));var moment=require(_0xd371('0x3'));var BPromise=require(_0xd371('0x4'));var Mustache=require(_0xd371('0x5'));var util=require(_0xd371('0x6'));var path=require(_0xd371('0x7'));var sox=require(_0xd371('0x8'));var csv=require('to-csv');var ejs=require(_0xd371('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd371('0xa'));var squel=require(_0xd371('0xb'));var crypto=require('crypto');var jsforce=require(_0xd371('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd371('0xd'));var Papa=require(_0xd371('0xe'));var Redis=require(_0xd371('0xf'));var authService=require(_0xd371('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd371('0x11'));var hardwareService=require(_0xd371('0x12'));var logger=require(_0xd371('0x13'))(_0xd371('0x14'));var utils=require(_0xd371('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd371('0x16'));var db=require(_0xd371('0x17'))['db'];config[_0xd371('0x18')]=_[_0xd371('0x19')](config['redis'],{'host':_0xd371('0x1a'),'port':0x18eb});var socket=require(_0xd371('0x1b'))(new Redis(config[_0xd371('0x18')]));require(_0xd371('0x1c'))[_0xd371('0x1d')](socket);var jayson=require(_0xd371('0x1e'));var client=jayson[_0xd371('0x1f')][_0xd371('0x20')]({'port':0x232c});var client9002=jayson[_0xd371('0x1f')][_0xd371('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x47fa17,_0x244f7b,_0x12ae86,_0x32ada9){return new BPromise(function(_0x44c615,_0x5561b4){var _0x41f97c=_0x32ada9||client;return _0x41f97c[_0xd371('0x21')](_0x47fa17,_0x12ae86)[_0xd371('0x22')](function(_0x482aba){logger[_0xd371('0x23')]('FaxAccount,\x20%s,\x20%s',_0x244f7b,'request\x20sent');logger[_0xd371('0x24')](_0xd371('0x25'),_0x244f7b,_0xd371('0x26'),JSON[_0xd371('0x27')](_0x482aba));if(_0x482aba[_0xd371('0x28')]){if(_0x482aba[_0xd371('0x28')][_0xd371('0x29')]===0x1f4){logger['error'](_0xd371('0x2a'),_0x244f7b,_0x482aba[_0xd371('0x28')][_0xd371('0x2b')]);return _0x5561b4(_0x482aba[_0xd371('0x28')][_0xd371('0x2b')]);}logger[_0xd371('0x28')](_0xd371('0x2a'),_0x244f7b,_0x482aba[_0xd371('0x28')][_0xd371('0x2b')]);return _0x44c615(_0x482aba['error']['message']);}else{logger[_0xd371('0x23')](_0xd371('0x2a'),_0x244f7b,_0xd371('0x26'));_0x44c615(_0x482aba['result'][_0xd371('0x2b')]);}})['catch'](function(_0x4d0d8b){logger[_0xd371('0x28')](_0xd371('0x2a'),_0x244f7b,_0x4d0d8b);_0x5561b4(_0x4d0d8b);});});}function respondWithStatusCode(_0x3109c4,_0x499b3d){_0x499b3d=_0x499b3d||0xcc;return function(_0x4e0702){if(_0x4e0702){return _0x3109c4[_0xd371('0x2c')](_0x499b3d);}return _0x3109c4[_0xd371('0x2d')](_0x499b3d)['end']();};}function respondWithResult(_0x528ac4,_0x4a9228){_0x4a9228=_0x4a9228||0xc8;return function(_0x119a7b){if(_0x119a7b){return _0x528ac4[_0xd371('0x2d')](_0x4a9228)[_0xd371('0x2e')](_0x119a7b);}};}function respondWithFilteredResult(_0x4cce43,_0x5a556e){return function(_0x1e1d72){if(_0x1e1d72){var _0x30820f=typeof _0x5a556e['offset']==='undefined'&&typeof _0x5a556e[_0xd371('0x2f')]==='undefined';var _0x18036e=_0x1e1d72[_0xd371('0x30')];var _0x5342d3=_0x30820f?0x0:_0x5a556e[_0xd371('0x31')];var _0xb2f239=_0x30820f?_0x1e1d72[_0xd371('0x30')]:_0x5a556e[_0xd371('0x31')]+_0x5a556e[_0xd371('0x2f')];var _0x59dd87;if(_0xb2f239>=_0x18036e){_0xb2f239=_0x18036e;_0x59dd87=0xc8;}else{_0x59dd87=0xce;}_0x4cce43[_0xd371('0x2d')](_0x59dd87);return _0x4cce43[_0xd371('0x32')](_0xd371('0x33'),_0x5342d3+'-'+_0xb2f239+'/'+_0x18036e)[_0xd371('0x2e')](_0x1e1d72);}return null;};}function patchUpdates(_0x2ac6cb){return function(_0x30b769){try{jsonpatch[_0xd371('0x34')](_0x30b769,_0x2ac6cb,!![]);}catch(_0x32da93){return BPromise[_0xd371('0x35')](_0x32da93);}return _0x30b769[_0xd371('0x36')]();};}function saveUpdates(_0x246909,_0x48c734){return function(_0x523603){if(_0x523603){return _0x523603['update'](_0x246909)[_0xd371('0x22')](function(_0x30fad7){return _0x30fad7;});}return null;};}function removeEntity(_0x226868,_0x20ad9d){return function(_0x476b75){if(_0x476b75){return _0x476b75[_0xd371('0x37')]()[_0xd371('0x22')](function(){var _0x7bddb4=_0x476b75[_0xd371('0x38')]({'plain':!![]});var _0x279b0f=_0xd371('0x39');return db['UserProfileResource'][_0xd371('0x37')]({'where':{'type':_0x279b0f,'resourceId':_0x7bddb4['id']}})[_0xd371('0x22')](function(){return _0x476b75;});})[_0xd371('0x22')](function(){_0x226868[_0xd371('0x2d')](0xcc)[_0xd371('0x3a')]();});}};}function handleEntityNotFound(_0x49d9f2,_0x33d086){return function(_0x3f8ce8){if(!_0x3f8ce8){_0x49d9f2[_0xd371('0x2c')](0x194);}return _0x3f8ce8;};}function handleError(_0x41eb11,_0x240150){_0x240150=_0x240150||0x1f4;return function(_0x5c04d9){logger[_0xd371('0x28')](_0x5c04d9['stack']);if(_0x5c04d9[_0xd371('0x3b')]){delete _0x5c04d9[_0xd371('0x3b')];}_0x41eb11[_0xd371('0x2d')](_0x240150)['send'](_0x5c04d9);};}exports[_0xd371('0x3c')]=function(_0xba202,_0x3804cd){var _0x460884={'include':[{'model':db[_0xd371('0x3d')],'as':_0xd371('0x3e')}]},_0x2fd62f={},_0x58b602={'count':0x0,'rows':[]};var _0x52155d=_[_0xd371('0x3f')](db[_0xd371('0x40')][_0xd371('0x41')],function(_0x23f356){return{'name':_0x23f356[_0xd371('0x42')],'type':_0x23f356[_0xd371('0x43')][_0xd371('0x44')]};});_0x2fd62f['model']=_[_0xd371('0x3f')](_0x52155d,_0xd371('0x3b'));_0x2fd62f[_0xd371('0x45')]=_[_0xd371('0x46')](_0xba202['query']);_0x2fd62f['filters']=_['intersection'](_0x2fd62f[_0xd371('0x47')],_0x2fd62f['query']);_0x460884[_0xd371('0x48')]=_[_0xd371('0x49')](_0x2fd62f['model'],qs[_0xd371('0x4a')](_0xba202[_0xd371('0x45')]['fields']));_0x460884[_0xd371('0x48')]=_0x460884[_0xd371('0x48')][_0xd371('0x4b')]?_0x460884['attributes']:_0x2fd62f[_0xd371('0x47')];if(!_0xba202[_0xd371('0x45')]['hasOwnProperty'](_0xd371('0x4c'))){_0x460884['limit']=qs[_0xd371('0x2f')](_0xba202[_0xd371('0x45')][_0xd371('0x2f')]);_0x460884[_0xd371('0x31')]=qs[_0xd371('0x31')](_0xba202['query'][_0xd371('0x31')]);}_0x460884[_0xd371('0x4d')]=qs[_0xd371('0x4e')](_0xba202[_0xd371('0x45')][_0xd371('0x4e')]);_0x460884[_0xd371('0x4f')]=qs['filters'](_[_0xd371('0x50')](_0xba202['query'],_0x2fd62f[_0xd371('0x51')]),_0x52155d);if(_0xba202[_0xd371('0x45')][_0xd371('0x52')]){_0x460884[_0xd371('0x4f')]=_[_0xd371('0x53')](_0x460884['where'],{'$or':_['map'](_0x52155d,function(_0x317bce){if(_0x317bce['type']!==_0xd371('0x54')){var _0x10fd53={};_0x10fd53[_0x317bce[_0xd371('0x3b')]]={'$like':'%'+_0xba202[_0xd371('0x45')]['filter']+'%'};return _0x10fd53;}})});}_0x460884=_['merge']({},_0x460884,_0xba202[_0xd371('0x55')]);var _0x1103f9={'where':_0x460884[_0xd371('0x4f')]};return db['FaxAccount'][_0xd371('0x30')](_0x1103f9)[_0xd371('0x22')](function(_0x49a7df){_0x58b602['count']=_0x49a7df;if(_0xba202['query'][_0xd371('0x56')]){_0x460884[_0xd371('0x57')]=[{'all':!![]}];}return db['FaxAccount'][_0xd371('0x58')](_0x460884);})[_0xd371('0x22')](function(_0x157e1c){_0x58b602[_0xd371('0x59')]=_0x157e1c;return _0x58b602;})[_0xd371('0x22')](respondWithFilteredResult(_0x3804cd,_0x460884))[_0xd371('0x5a')](handleError(_0x3804cd,null));};exports[_0xd371('0x5b')]=function(_0x292b0a,_0x4c7467){var _0x493238={'raw':![],'where':{'id':_0x292b0a[_0xd371('0x5c')]['id']},'include':[{'model':db[_0xd371('0x3d')],'as':_0xd371('0x3e')}]},_0xd3da12={};_0xd3da12[_0xd371('0x47')]=_['keys'](db['FaxAccount']['rawAttributes']);_0xd3da12[_0xd371('0x45')]=_[_0xd371('0x46')](_0x292b0a[_0xd371('0x45')]);_0xd3da12[_0xd371('0x51')]=_[_0xd371('0x49')](_0xd3da12[_0xd371('0x47')],_0xd3da12['query']);_0x493238[_0xd371('0x48')]=_['intersection'](_0xd3da12['model'],qs['fields'](_0x292b0a[_0xd371('0x45')][_0xd371('0x4a')]));_0x493238[_0xd371('0x48')]=_0x493238[_0xd371('0x48')]['length']?_0x493238[_0xd371('0x48')]:_0xd3da12[_0xd371('0x47')];if(_0x292b0a[_0xd371('0x45')][_0xd371('0x56')]){_0x493238[_0xd371('0x57')]=[{'all':!![]}];}_0x493238=_[_0xd371('0x53')]({},_0x493238,_0x292b0a[_0xd371('0x55')]);return db[_0xd371('0x40')][_0xd371('0x5d')](_0x493238)[_0xd371('0x22')](handleEntityNotFound(_0x4c7467,null))[_0xd371('0x22')](respondWithResult(_0x4c7467,null))['catch'](handleError(_0x4c7467,null));};exports['create']=function(_0x34c762,_0x121133){return db['FaxAccount'][_0xd371('0x5e')](_0x34c762[_0xd371('0x5f')],{})[_0xd371('0x22')](function(_0x1ec64c){var _0x15f5b7=_0x34c762['user'][_0xd371('0x38')]({'plain':!![]});if(!_0x15f5b7)throw new Error(_0xd371('0x60'));if(_0x15f5b7[_0xd371('0x61')]===_0xd371('0x62')){var _0x149636=_0x1ec64c[_0xd371('0x38')]({'plain':!![]});var _0x480b62=_0xd371('0x39');return db[_0xd371('0x63')][_0xd371('0x5d')]({'where':{'name':_0x480b62,'userProfileId':_0x15f5b7[_0xd371('0x64')]},'raw':!![]})[_0xd371('0x22')](function(_0xde55aa){if(_0xde55aa&&_0xde55aa[_0xd371('0x65')]===0x0){return db[_0xd371('0x66')]['create']({'name':_0x149636[_0xd371('0x3b')],'resourceId':_0x149636['id'],'type':_0xde55aa[_0xd371('0x3b')],'sectionId':_0xde55aa['id']},{})[_0xd371('0x22')](function(){return _0x1ec64c;});}else{return _0x1ec64c;}})[_0xd371('0x5a')](function(_0x110d90){logger[_0xd371('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x110d90);throw _0x110d90;});}return _0x1ec64c;})[_0xd371('0x22')](respondWithResult(_0x121133,0xc9))[_0xd371('0x5a')](handleError(_0x121133,null));};exports[_0xd371('0x67')]=function(_0x363cbf,_0x1d26d3){if(_0x363cbf[_0xd371('0x5f')]['id']){delete _0x363cbf[_0xd371('0x5f')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x363cbf['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xd371('0x22')](handleEntityNotFound(_0x1d26d3,null))[_0xd371('0x22')](saveUpdates(_0x363cbf[_0xd371('0x5f')],null))[_0xd371('0x22')](respondWithResult(_0x1d26d3,null))[_0xd371('0x5a')](handleError(_0x1d26d3,null));};exports[_0xd371('0x37')]=function(_0x5b21fd,_0x586888){return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x5b21fd[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0x586888,null))[_0xd371('0x22')](removeEntity(_0x586888,null))[_0xd371('0x5a')](handleError(_0x586888,null));};exports[_0xd371('0x68')]=function(_0x52b6ee,_0x9a6ecf){return db[_0xd371('0x40')][_0xd371('0x68')]()[_0xd371('0x22')](respondWithResult(_0x9a6ecf,null))[_0xd371('0x5a')](handleError(_0x9a6ecf,null));};exports['addDisposition']=function(_0x1a56c9,_0xdcdd94,_0x3174b8){if(_0x1a56c9[_0xd371('0x5f')]['id']){delete _0x1a56c9[_0xd371('0x5f')]['id'];}return db[_0xd371('0x40')]['find']({'where':{'id':_0x1a56c9[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0xdcdd94,null))[_0xd371('0x22')](function(_0x24e597){if(_0x24e597){_0x1a56c9[_0xd371('0x5f')][_0xd371('0x69')]=_0x24e597['id'];return db[_0xd371('0x6a')][_0xd371('0x5e')](_0x1a56c9[_0xd371('0x5f')]);}})[_0xd371('0x22')](respondWithResult(_0xdcdd94,null))[_0xd371('0x5a')](handleError(_0xdcdd94,null));};exports[_0xd371('0x6b')]=function(_0x58d71b,_0x287880,_0xca67d0){var _0x3ec15d={'raw':![],'where':{}};var _0x255df6={};var _0x5e9dc8={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x58d71b['params']['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x287880,null))[_0xd371('0x22')](function(_0x347fc3){if(_0x347fc3){_0x255df6[_0xd371('0x47')]=_['keys'](db[_0xd371('0x6a')]['rawAttributes']);_0x255df6[_0xd371('0x45')]=_[_0xd371('0x46')](_0x58d71b['query']);_0x255df6[_0xd371('0x51')]=_[_0xd371('0x49')](_0x255df6['model'],_0x255df6['query']);_0x3ec15d['attributes']=_[_0xd371('0x49')](_0x255df6[_0xd371('0x47')],qs[_0xd371('0x4a')](_0x58d71b[_0xd371('0x45')][_0xd371('0x4a')]));_0x3ec15d['attributes']=_0x3ec15d['attributes'][_0xd371('0x4b')]?_0x3ec15d[_0xd371('0x48')]:_0x255df6[_0xd371('0x47')];if(!_0x58d71b[_0xd371('0x45')][_0xd371('0x6c')](_0xd371('0x4c'))){_0x3ec15d['limit']=qs[_0xd371('0x2f')](_0x58d71b[_0xd371('0x45')][_0xd371('0x2f')]);_0x3ec15d[_0xd371('0x31')]=qs[_0xd371('0x31')](_0x58d71b['query'][_0xd371('0x31')]);}_0x3ec15d['order']=qs[_0xd371('0x4e')](_0x58d71b[_0xd371('0x45')][_0xd371('0x4e')]);_0x3ec15d['where']=qs[_0xd371('0x51')](_['pick'](_0x58d71b['query'],_0x255df6['filters']));_0x3ec15d[_0xd371('0x4f')]['FaxAccountId']=_0x347fc3['id'];if(_0x58d71b[_0xd371('0x45')]['filter']){_0x3ec15d[_0xd371('0x4f')]=_['merge'](_0x3ec15d[_0xd371('0x4f')],{'$or':_[_0xd371('0x3f')](_0x3ec15d['attributes'],function(_0x1a8e88){var _0x45bf68={};_0x45bf68[_0x1a8e88]={'$like':'%'+_0x58d71b[_0xd371('0x45')][_0xd371('0x52')]+'%'};return _0x45bf68;})});}_0x3ec15d=_['merge']({},_0x3ec15d,_0x58d71b[_0xd371('0x55')]);return db[_0xd371('0x6a')][_0xd371('0x30')]({'where':_0x3ec15d[_0xd371('0x4f')]})[_0xd371('0x22')](function(_0x5848e0){_0x5e9dc8[_0xd371('0x30')]=_0x5848e0;if(_0x58d71b[_0xd371('0x45')][_0xd371('0x56')]){_0x3ec15d['include']=[{'all':!![]}];}return db[_0xd371('0x6a')][_0xd371('0x58')](_0x3ec15d);})[_0xd371('0x22')](function(_0x5febda){_0x5e9dc8[_0xd371('0x59')]=_0x5febda;return _0x5e9dc8;});}})[_0xd371('0x22')](respondWithFilteredResult(_0x287880,_0x3ec15d))[_0xd371('0x5a')](handleError(_0x287880,null));};exports[_0xd371('0x6d')]=function(_0x40115c,_0xd36479,_0x4f7a68){return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x40115c[_0xd371('0x5c')]['id']}})[_0xd371('0x22')](handleEntityNotFound(_0xd36479,null))[_0xd371('0x22')](function(_0x3f50eb){if(_0x3f50eb){return _0x3f50eb['removeDispositions'](_0x40115c[_0xd371('0x45')][_0xd371('0x6e')]);}})[_0xd371('0x22')](respondWithStatusCode(_0xd36479,null))[_0xd371('0x5a')](handleError(_0xd36479,null));};exports[_0xd371('0x6f')]=function(_0x2ec4ee,_0x140050,_0x4b8346){if(_0x2ec4ee[_0xd371('0x5f')]['id']){delete _0x2ec4ee['body']['id'];}return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x2ec4ee[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0x140050,null))[_0xd371('0x22')](function(_0x4b9a83){if(_0x4b9a83){_0x2ec4ee[_0xd371('0x5f')]['FaxAccountId']=_0x4b9a83['id'];return db[_0xd371('0x70')][_0xd371('0x5e')](_0x2ec4ee[_0xd371('0x5f')]);}})[_0xd371('0x22')](respondWithResult(_0x140050,null))[_0xd371('0x5a')](handleError(_0x140050,null));};exports[_0xd371('0x71')]=function(_0x5882c4,_0xab14fb,_0x1c73ad){var _0x48f1ea={'raw':![],'where':{}};var _0x5b2129={};var _0x145213={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5882c4[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0xab14fb,null))[_0xd371('0x22')](function(_0x41599e){if(_0x41599e){_0x5b2129[_0xd371('0x47')]=_[_0xd371('0x46')](db[_0xd371('0x70')][_0xd371('0x41')]);_0x5b2129[_0xd371('0x45')]=_[_0xd371('0x46')](_0x5882c4[_0xd371('0x45')]);_0x5b2129[_0xd371('0x51')]=_[_0xd371('0x49')](_0x5b2129[_0xd371('0x47')],_0x5b2129[_0xd371('0x45')]);_0x48f1ea[_0xd371('0x48')]=_['intersection'](_0x5b2129[_0xd371('0x47')],qs[_0xd371('0x4a')](_0x5882c4[_0xd371('0x45')]['fields']));_0x48f1ea[_0xd371('0x48')]=_0x48f1ea['attributes'][_0xd371('0x4b')]?_0x48f1ea[_0xd371('0x48')]:_0x5b2129[_0xd371('0x47')];if(!_0x5882c4[_0xd371('0x45')][_0xd371('0x6c')](_0xd371('0x4c'))){_0x48f1ea[_0xd371('0x2f')]=qs[_0xd371('0x2f')](_0x5882c4[_0xd371('0x45')][_0xd371('0x2f')]);_0x48f1ea['offset']=qs['offset'](_0x5882c4[_0xd371('0x45')]['offset']);}_0x48f1ea[_0xd371('0x4d')]=qs[_0xd371('0x4e')](_0x5882c4[_0xd371('0x45')][_0xd371('0x4e')]);_0x48f1ea[_0xd371('0x4f')]=qs[_0xd371('0x51')](_['pick'](_0x5882c4[_0xd371('0x45')],_0x5b2129['filters']));_0x48f1ea[_0xd371('0x4f')][_0xd371('0x69')]=_0x41599e['id'];if(_0x5882c4[_0xd371('0x45')][_0xd371('0x52')]){_0x48f1ea[_0xd371('0x4f')]=_[_0xd371('0x53')](_0x48f1ea[_0xd371('0x4f')],{'$or':_[_0xd371('0x3f')](_0x48f1ea[_0xd371('0x48')],function(_0x2c61ed){var _0x176265={};_0x176265[_0x2c61ed]={'$like':'%'+_0x5882c4[_0xd371('0x45')][_0xd371('0x52')]+'%'};return _0x176265;})});}_0x48f1ea=_[_0xd371('0x53')]({},_0x48f1ea,_0x5882c4[_0xd371('0x55')]);return db[_0xd371('0x70')][_0xd371('0x30')]({'where':_0x48f1ea[_0xd371('0x4f')]})['then'](function(_0x2b40c0){_0x145213[_0xd371('0x30')]=_0x2b40c0;if(_0x5882c4[_0xd371('0x45')]['includeAll']){_0x48f1ea[_0xd371('0x57')]=[{'all':!![]}];}return db[_0xd371('0x70')][_0xd371('0x58')](_0x48f1ea);})['then'](function(_0x5a4642){_0x145213[_0xd371('0x59')]=_0x5a4642;return _0x145213;});}})[_0xd371('0x22')](respondWithFilteredResult(_0xab14fb,_0x48f1ea))[_0xd371('0x5a')](handleError(_0xab14fb,null));};exports['removeAnswers']=function(_0x1922b4,_0x21a073,_0x59b0a9){return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x1922b4['params']['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x21a073,null))['then'](function(_0x29b6c6){if(_0x29b6c6){return _0x29b6c6[_0xd371('0x72')](_0x1922b4['query'][_0xd371('0x6e')]);}})[_0xd371('0x22')](respondWithStatusCode(_0x21a073,null))[_0xd371('0x5a')](handleError(_0x21a073,null));};exports['addInteraction']=function(_0x33da6a,_0x1faf02,_0x2b12f2){return db[_0xd371('0x73')][_0xd371('0x5d')]({'where':{'id':_0x33da6a[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1faf02,null))['then'](function(_0x14d1da){if(_0x14d1da){return _0x14d1da[_0xd371('0x74')](_0x33da6a[_0xd371('0x5f')][_0xd371('0x6e')],_[_0xd371('0x75')](_0x33da6a[_0xd371('0x5f')],[_0xd371('0x6e'),'id'])||{});}})[_0xd371('0x22')](respondWithResult(_0x1faf02,null))[_0xd371('0x5a')](handleError(_0x1faf02,null));};exports[_0xd371('0x76')]=function(_0x2f9c67,_0x24c241,_0x1168b4){var _0x2ab5a7={'raw':![],'where':{}};var _0x27687e={};var _0x3b349e={'count':0x0,'rows':[]};return db[_0xd371('0x40')][_0xd371('0x77')]({'where':{'id':_0x2f9c67[_0xd371('0x5c')]['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x24c241,null))[_0xd371('0x22')](function(_0x26d202){if(_0x26d202){_0x27687e['model']=_[_0xd371('0x46')](db[_0xd371('0x73')][_0xd371('0x41')]);_0x27687e[_0xd371('0x45')]=_[_0xd371('0x46')](_0x2f9c67['query']);_0x27687e[_0xd371('0x51')]=_['intersection'](_0x27687e['model'],_0x27687e[_0xd371('0x45')]);_0x2ab5a7[_0xd371('0x48')]=_[_0xd371('0x49')](_0x27687e['model'],qs[_0xd371('0x4a')](_0x2f9c67['query']['fields']));_0x2ab5a7[_0xd371('0x48')]=_0x2ab5a7[_0xd371('0x48')]['length']?_0x2ab5a7[_0xd371('0x48')]:_0x27687e[_0xd371('0x47')];if(!_0x2f9c67[_0xd371('0x45')]['hasOwnProperty'](_0xd371('0x4c'))){_0x2ab5a7[_0xd371('0x2f')]=qs[_0xd371('0x2f')](_0x2f9c67[_0xd371('0x45')][_0xd371('0x2f')]);_0x2ab5a7[_0xd371('0x31')]=qs['offset'](_0x2f9c67[_0xd371('0x45')][_0xd371('0x31')]);}_0x2ab5a7[_0xd371('0x4d')]=qs[_0xd371('0x4e')](_0x2f9c67[_0xd371('0x45')]['sort']);_0x2ab5a7[_0xd371('0x4f')]=qs[_0xd371('0x51')](_[_0xd371('0x50')](_0x2f9c67['query'],_0x27687e[_0xd371('0x51')]));_0x2ab5a7[_0xd371('0x4f')][_0xd371('0x69')]=_0x26d202['id'];if(_0x2f9c67[_0xd371('0x45')][_0xd371('0x52')]){_0x2ab5a7[_0xd371('0x4f')]=_[_0xd371('0x53')](_0x2ab5a7[_0xd371('0x4f')],{'$or':_['map'](_0x2ab5a7[_0xd371('0x48')],function(_0x37955f){var _0x197e50={};_0x197e50[_0x37955f]={'$like':'%'+_0x2f9c67[_0xd371('0x45')][_0xd371('0x52')]+'%'};return _0x197e50;})});}_0x2ab5a7=_[_0xd371('0x53')]({},_0x2ab5a7,_0x2f9c67[_0xd371('0x55')]);return db[_0xd371('0x73')]['count']({'where':_0x2ab5a7[_0xd371('0x4f')]})['then'](function(_0x4eda26){_0x3b349e[_0xd371('0x30')]=_0x4eda26;if(_0x2f9c67['query'][_0xd371('0x56')]){_0x2ab5a7['include']=[{'model':db[_0xd371('0x78')],'as':_0xd371('0x79'),'required':![]},{'model':db[_0xd371('0x7a')],'as':_0xd371('0x7b'),'attributes':[_0xd371('0x3b'),'fullname',_0xd371('0x7c')],'required':![]},{'model':db[_0xd371('0x7d')],'as':_0xd371('0x7e'),'attributes':['id',_0xd371('0x3b'),_0xd371('0x7f')],'where':_0x2f9c67[_0xd371('0x45')][_0xd371('0x80')]?{'id':_0x2f9c67[_0xd371('0x45')][_0xd371('0x80')]}:undefined,'required':_0x2f9c67[_0xd371('0x45')][_0xd371('0x80')]?!![]:![]}];}return db[_0xd371('0x73')]['findAll'](_0x2ab5a7);})[_0xd371('0x22')](function(_0x371c70){_0x3b349e[_0xd371('0x59')]=_0x371c70;return _0x3b349e;});}})[_0xd371('0x22')](respondWithFilteredResult(_0x24c241,_0x2ab5a7))['catch'](handleError(_0x24c241,null));};exports['addApplications']=function(_0x1e287d,_0x4f8814,_0x35843f){return db['FaxAccount'][_0xd371('0x77')]({'where':{'id':_0x1e287d['params']['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x4f8814,null))[_0xd371('0x22')](function(_0x3cebe3){if(_0x3cebe3){return db[_0xd371('0x81')][_0xd371('0x82')](function(_0x19b01f){return db['FaxApplication'][_0xd371('0x37')]({'where':{'FaxAccountId':_0x1e287d[_0xd371('0x5c')]['id']},'transaction':_0x19b01f})[_0xd371('0x22')](function(_0x28ce5a){var _0xb548cc=_[_0xd371('0x3f')](_0x1e287d[_0xd371('0x5f')],function(_0x3dee84){_0x3dee84[_0xd371('0x69')]=_0x1e287d[_0xd371('0x5c')]['id'];return _0x3dee84;});return db[_0xd371('0x83')][_0xd371('0x84')](_0xb548cc,{'transaction':_0x19b01f});});})[_0xd371('0x22')](function(){return db[_0xd371('0x83')]['findAndCountAll']({'where':{'FaxAccountId':_0x1e287d[_0xd371('0x5c')]['id']},'order':_0xd371('0x85')});});}})['then'](respondWithResult(_0x4f8814,null))[_0xd371('0x5a')](handleError(_0x4f8814,null));};exports[_0xd371('0x86')]=function(_0x87260b,_0x2da975,_0x514e83){var _0x477c19={};var _0x136956={};var _0x4fde7b;var _0x27174e;return db[_0xd371('0x40')][_0xd371('0x77')]({'where':{'id':_0x87260b[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2da975,null))[_0xd371('0x22')](function(_0x39e71e){if(_0x39e71e){_0x4fde7b=_0x39e71e;_0x136956[_0xd371('0x47')]=_[_0xd371('0x46')](db[_0xd371('0x83')][_0xd371('0x41')]);_0x136956[_0xd371('0x45')]=_[_0xd371('0x46')](_0x87260b['query']);_0x136956['filters']=_[_0xd371('0x49')](_0x136956['model'],_0x136956[_0xd371('0x45')]);_0x477c19[_0xd371('0x48')]=_[_0xd371('0x49')](_0x136956['model'],qs['fields'](_0x87260b[_0xd371('0x45')][_0xd371('0x4a')]));_0x477c19[_0xd371('0x48')]=_0x477c19['attributes'][_0xd371('0x4b')]?_0x477c19[_0xd371('0x48')]:_0x136956[_0xd371('0x47')];_0x477c19[_0xd371('0x4d')]=qs[_0xd371('0x4e')](_0x87260b[_0xd371('0x45')][_0xd371('0x4e')]);_0x477c19[_0xd371('0x4f')]=qs[_0xd371('0x51')](_[_0xd371('0x50')](_0x87260b[_0xd371('0x45')],_0x136956['filters']));if(_0x87260b[_0xd371('0x45')][_0xd371('0x52')]){_0x477c19[_0xd371('0x4f')]=_[_0xd371('0x53')](_0x477c19[_0xd371('0x4f')],{'$or':_[_0xd371('0x3f')](_0x477c19[_0xd371('0x48')],function(_0x35caa9){var _0x31a20c={};_0x31a20c[_0x35caa9]={'$like':'%'+_0x87260b[_0xd371('0x45')][_0xd371('0x52')]+'%'};return _0x31a20c;})});}_0x477c19=_[_0xd371('0x53')]({},_0x477c19,_0x87260b[_0xd371('0x55')]);return _0x4fde7b[_0xd371('0x86')](_0x477c19);}})[_0xd371('0x22')](function(_0x1f81ee){if(_0x1f81ee){_0x27174e=_0x1f81ee[_0xd371('0x4b')];if(!_0x87260b[_0xd371('0x45')][_0xd371('0x6c')](_0xd371('0x4c'))){_0x477c19['limit']=qs[_0xd371('0x2f')](_0x87260b[_0xd371('0x45')][_0xd371('0x2f')]);_0x477c19[_0xd371('0x31')]=qs['offset'](_0x87260b[_0xd371('0x45')]['offset']);}return _0x4fde7b[_0xd371('0x86')](_0x477c19);}})['then'](function(_0x3b0604){if(_0x3b0604){return _0x3b0604?{'count':_0x27174e,'rows':_0x3b0604}:null;}})[_0xd371('0x22')](respondWithResult(_0x2da975,null))['catch'](handleError(_0x2da975,null));};function Extension(_0x22ef1c,_0x22a826,_0x198447,_0x5b260b){this[_0xd371('0x87')]=_0xd371('0x88');this['exten']=_0x22ef1c['localstationid'];this[_0xd371('0x89')]=_0x5b260b;this[_0xd371('0x43')]='system';this[_0xd371('0x8a')]=_0xd371('0x8b');this['FaxAccountId']=_0x22ef1c['id'];this[_0xd371('0x85')]=_0x22a826;this['appdata']=_0x198447;}function createExtensionsReciveFax(_0x2f37d8){var _0x19ae68=0x1;var _0x17c134=[];_0x17c134[_0xd371('0x8c')](new Extension(_0x2f37d8,_0x19ae68,'',_0xd371('0x8d')));_0x19ae68+=0x1;_0x17c134[_0xd371('0x8c')](new Extension(_0x2f37d8,_0x19ae68,_0xd371('0x8e'),'Set'));_0x19ae68+=0x1;for(var _0x1eced0 in _0x2f37d8){if(_0x2f37d8[_0xd371('0x6c')](_0x1eced0)&&(_0x1eced0===_0xd371('0x8f')||_0x1eced0===_0xd371('0x90')||_0x1eced0==='gateway'||_0x1eced0===_0xd371('0x91')||_0x1eced0===_0xd371('0x92')||_0x1eced0===_0xd371('0x93')||_0x1eced0===_0xd371('0x94')||_0x1eced0==='modem'||_0x1eced0===_0xd371('0x95'))){_0x17c134['push'](new Extension(_0x2f37d8,_0x19ae68,'FAXOPT('+_0x1eced0+')='+_0x2f37d8[_0x1eced0],_0xd371('0x96')));_0x19ae68+=0x1;}}_0x17c134[_0xd371('0x8c')](new Extension(_0x2f37d8,_0x19ae68,'6',_0xd371('0x97')));_0x19ae68+=0x1;_0x17c134[_0xd371('0x8c')](new Extension(_0x2f37d8,_0x19ae68,_0xd371('0x98'),_0xd371('0x99')));_0x19ae68=0x0;return _0x17c134;}exports[_0xd371('0x9a')]=function(_0x48b84a,_0x2cfa10,_0x1ca0a2){var _0x3a0d51;return db['sequelize'][_0xd371('0x82')](function(_0x5da301){return db[_0xd371('0x40')][_0xd371('0x5e')](_0x48b84a[_0xd371('0x5f')],{'transaction':_0x5da301})[_0xd371('0x22')](function(_0x1b0038){_0x3a0d51=_0x1b0038['get']({'plain':!![]});return db[_0xd371('0x9b')]['bulkCreate'](createExtensionsReciveFax(_0x3a0d51),{'transaction':_0x5da301});});})[_0xd371('0x22')](function(){return _0x3a0d51;})[_0xd371('0x22')](respondWithResult(_0x2cfa10,null))[_0xd371('0x5a')](handleError(_0x2cfa10,null));};exports['updateAccountApplications']=function(_0x26fa93,_0x588bad,_0x58627b){var _0xf8996c;return db[_0xd371('0x81')]['transaction'](function(_0x36c74d){return db['FaxAccount'][_0xd371('0x67')](_0x26fa93[_0xd371('0x5f')],{'where':{'id':_0x26fa93[_0xd371('0x5f')]['id']},'transaction':_0x36c74d})['then'](function(_0x3de513){return db[_0xd371('0x9b')][_0xd371('0x37')]({'where':{'FaxAccountId':_0x26fa93[_0xd371('0x5f')]['id']},'transaction':_0x36c74d})[_0xd371('0x22')](function(_0x396f32){return db[_0xd371('0x9b')]['bulkCreate'](createExtensionsReciveFax(_[_0xd371('0x75')](_0x26fa93[_0xd371('0x5f')],['tech','key','createdAt',_0xd371('0x9c'),_0xd371('0x9d'),_0xd371('0x9e')])),{'transaction':_0x36c74d});});});})[_0xd371('0x22')](function(){return db['FaxAccount'][_0xd371('0x9f')](_0x26fa93[_0xd371('0x5f')]['id']);})['then'](respondWithResult(_0x588bad,null))[_0xd371('0x5a')](handleError(_0x588bad,null));};exports['getMessages']=function(_0x3bf4e8,_0x2d3b82,_0x34e2ba){var _0x533bb1={'raw':!![],'where':{}};var _0x3e737d={};var _0x3b0a4b={'count':0x0,'rows':[]};return db[_0xd371('0x40')]['findOne']({'where':{'id':_0x3bf4e8[_0xd371('0x5c')]['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x2d3b82,null))[_0xd371('0x22')](function(_0x16aca9){if(_0x16aca9){_0x3e737d['model']=_[_0xd371('0x46')](db[_0xd371('0xa0')]['rawAttributes']);_0x3e737d[_0xd371('0x45')]=_[_0xd371('0x46')](_0x3bf4e8[_0xd371('0x45')]);_0x3e737d[_0xd371('0x51')]=_['intersection'](_0x3e737d[_0xd371('0x47')],_0x3e737d[_0xd371('0x45')]);_0x533bb1['attributes']=_[_0xd371('0x49')](_0x3e737d[_0xd371('0x47')],qs[_0xd371('0x4a')](_0x3bf4e8['query']['fields']));_0x533bb1['attributes']=_0x533bb1['attributes']['length']?_0x533bb1[_0xd371('0x48')]:_0x3e737d[_0xd371('0x47')];if(!_0x3bf4e8['query'][_0xd371('0x6c')]('nolimit')){_0x533bb1['limit']=qs[_0xd371('0x2f')](_0x3bf4e8[_0xd371('0x45')]['limit']);_0x533bb1[_0xd371('0x31')]=qs['offset'](_0x3bf4e8[_0xd371('0x45')][_0xd371('0x31')]);}_0x533bb1['order']=qs['sort'](_0x3bf4e8['query'][_0xd371('0x4e')]);_0x533bb1['where']=qs[_0xd371('0x51')](_[_0xd371('0x50')](_0x3bf4e8['query'],_0x3e737d[_0xd371('0x51')]));_0x533bb1[_0xd371('0x4f')][_0xd371('0x69')]=_0x16aca9['id'];if(_0x3bf4e8[_0xd371('0x45')][_0xd371('0x52')]){_0x533bb1['where']=_[_0xd371('0x53')](_0x533bb1[_0xd371('0x4f')],{'$or':_['map'](_0x533bb1[_0xd371('0x48')],function(_0x83afd7){var _0x17ddd0={};_0x17ddd0[_0x83afd7]={'$like':'%'+_0x3bf4e8[_0xd371('0x45')]['filter']+'%'};return _0x17ddd0;})});}if(_0x3bf4e8['query'][_0xd371('0xa1')]){var _0x188649=_0x3bf4e8[_0xd371('0x45')][_0xd371('0xa1')][_0xd371('0xa2')](',');var _0x39d266={};_0x39d266[_0x188649[0x0]]={'$gte':moment(_0x188649[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x533bb1[_0xd371('0x4f')]=_[_0xd371('0x53')](_0x533bb1[_0xd371('0x4f')],_0x39d266);}_0x533bb1=_['merge']({},_0x533bb1,_0x3bf4e8['options']);return db['FaxMessage'][_0xd371('0x30')]({'where':_0x533bb1[_0xd371('0x4f')]})[_0xd371('0x22')](function(_0x59c283){_0x3b0a4b['count']=_0x59c283;if(_0x3bf4e8[_0xd371('0x45')][_0xd371('0x56')]){_0x533bb1['include']=[{'all':!![]}];}return db[_0xd371('0xa0')][_0xd371('0x58')](_0x533bb1);})['then'](function(_0x585cab){_0x3b0a4b[_0xd371('0x59')]=_0x585cab;return _0x3b0a4b;});}})[_0xd371('0x22')](respondWithFilteredResult(_0x2d3b82,_0x533bb1))[_0xd371('0x5a')](handleError(_0x2d3b82,null));};exports[_0xd371('0xa3')]=function(_0x5e20b5,_0x2c72e3,_0x232933){var _0x25a7d6,_0x36b7a6={},_0x145d53;if(_0x5e20b5[_0xd371('0x5f')]['to']){_0x145d53=_0x5e20b5[_0xd371('0x5f')]['to'][0x0];}return db['FaxAccount'][_0xd371('0x5d')]({'where':{'id':_0x5e20b5[_0xd371('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xd371('0xa4'),'include':[{'model':db[_0xd371('0x78')],'as':_0xd371('0xa5'),'where':{'fax':_0x145d53},'limit':0x1,'order':[['updatedAt',_0xd371('0xa6')]]}]}]})[_0xd371('0x22')](handleEntityNotFound(_0x2c72e3,null))[_0xd371('0x22')](function(_0x5b3e90){_0x25a7d6=_0x5b3e90;if(_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')]&&_0x5e20b5['body'][_0xd371('0xa7')][_0xd371('0x4b')]){for(var _0x1bbcc2=0x0;_0x1bbcc2<_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][_0xd371('0x4b')];_0x1bbcc2+=0x1){_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][_0x1bbcc2]={'filename':_0x5e20b5[_0xd371('0x5f')]['attachments'][_0x1bbcc2]['name'],'id':_0x5e20b5[_0xd371('0x5f')]['attachments'][_0x1bbcc2]['id'],'path':path[_0xd371('0xa8')](config[_0xd371('0xa9')],_0xd371('0xaa'),_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][_0x1bbcc2][_0xd371('0xab')])};}}return respondWithRpcPromise(_0xd371('0xac'),_0xd371('0xac'),{'FaxAccountId':_[_0xd371('0xad')](_0x5e20b5[_0xd371('0x5c')]['id'])?undefined:_0x5e20b5[_0xd371('0x5c')]['id'],'path':_[_0xd371('0xad')](_0x5e20b5['body'][_0xd371('0xa7')][0x0][_0xd371('0x7')])?undefined:_0x5e20b5[_0xd371('0x5f')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x5e20b5['body']['to'][0x0])?undefined:_0x5e20b5[_0xd371('0x5f')]['to'][0x0]},client9002);})['then'](function(){if(_0x25a7d6){if(_[_0xd371('0xad')](_0x5e20b5[_0xd371('0x5f')][_0xd371('0xae')])){_0x5e20b5[_0xd371('0x5f')][_0xd371('0xae')]=util[_0xd371('0xaf')](_0xd371('0xb0'),_0x25a7d6[_0xd371('0x3b')],_0x25a7d6[_0xd371('0xb1')]);}if(_0x25a7d6[_0xd371('0xa4')]){if(_0x25a7d6[_0xd371('0xa4')]['Contacts']['length']){return _0x25a7d6[_0xd371('0xa4')][_0xd371('0xa5')][0x0];}else{return db['CmContact'][_0xd371('0x5e')](_[_0xd371('0x19')](_0x5e20b5[_0xd371('0x5f')],{'firstName':_0x5e20b5[_0xd371('0x5f')]['to'][0x0],'phone':_0x5e20b5[_0xd371('0x5f')]['to'][0x0],'fax':_0x5e20b5[_0xd371('0x5f')]['to'][0x0],'ListId':_0x25a7d6[_0xd371('0x9e')]}));}}else{throw new Error(_0xd371('0xb2'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xd371('0x22')](function(_0x2ad1ce){if(_0x2ad1ce){return db[_0xd371('0x73')][_0xd371('0x5d')]({'where':{'ContactId':_0x2ad1ce['id'],'closed':![],'FaxAccountId':_0x25a7d6['id']}})['then'](function(_0x43a4e0){if(_0x43a4e0){return[_0x43a4e0,![]];}return db[_0xd371('0x73')][_0xd371('0x5e')]({'UserId':_0x5e20b5[_0xd371('0x62')]['id'],'ContactId':_0x2ad1ce['id'],'FaxAccountId':_0x25a7d6['id'],'fax':_0x5e20b5[_0xd371('0x5f')]['to'][0x0],'firstMsgDirection':_0xd371('0xb3'),'Messages':[_[_0xd371('0x53')](_0x5e20b5['body'],{'read':![],'body':_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][0x0]['filename'],'FaxAccountId':_0x25a7d6['id'],'UserId':_0x5e20b5['user']['id'],'ContactId':_0x2ad1ce['id'],'AttachmentId':_0x5e20b5[_0xd371('0x5f')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xd371('0xb4')}]})[_0xd371('0x22')](function(_0x2dd877){return[_0x2dd877,!![]];});});}else{throw new Error(_0xd371('0xb5'));}})['spread'](function(_0x164e40,_0x511201){if(_0x511201){return _0x164e40;}return db[_0xd371('0xa0')][_0xd371('0x5e')]({'direction':_0xd371('0xb3'),'read':![],'body':_0x5e20b5[_0xd371('0x5f')]['attachments'][0x0]['filename'],'FaxAccountId':_0x25a7d6['id'],'FaxInteractionId':_0x164e40['id'],'UserId':_0x5e20b5['user']['id'],'ContactId':_0x164e40[_0xd371('0xb6')],'AttachmentId':_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][0x0]['id']})[_0xd371('0x22')](function(_0x1f20d2){_0x164e40[_0xd371('0xb7')]['Messages']=[];_0x164e40[_0xd371('0xb7')][_0xd371('0xb4')][_0xd371('0x8c')](_0x1f20d2['dataValues']);return _0x164e40;});})[_0xd371('0x22')](function(_0x430c56){respondWithRpcPromise(_0xd371('0xb8'),'SendFax',{'FaxAccountId':_[_0xd371('0xad')](_0x5e20b5[_0xd371('0x5c')]['id'])?undefined:_0x5e20b5[_0xd371('0x5c')]['id'],'path':_[_0xd371('0xad')](_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][0x0][_0xd371('0x7')])?undefined:_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][0x0][_0xd371('0x7')],'fax':_['isNil'](_0x5e20b5[_0xd371('0x5f')]['to'][0x0])?undefined:_0x5e20b5['body']['to'][0x0],'AttachmentId':_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][0x0]['id']},client9002)[_0xd371('0x22')](function(_0x5a2c61){logger[_0xd371('0x23')](_0xd371('0xb9'),_0x5a2c61);})[_0xd371('0x5a')](function(_0x5ee736){logger['info']('SendFaxRpc,\x20%s',_0x5ee736);});return _0x430c56;})[_0xd371('0x22')](respondWithResult(_0x2c72e3,null))['catch'](handleError(_0x2c72e3,null));};exports['addAgents']=function(_0x1a3a73,_0x37c3c3,_0x46fec3){return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x1a3a73['params']['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x37c3c3,null))[_0xd371('0x22')](function(_0x1d00af){if(_0x1d00af){return _0x1d00af[_0xd371('0xba')](_0x1a3a73[_0xd371('0x5f')][_0xd371('0x6e')],_[_0xd371('0x75')](_0x1a3a73[_0xd371('0x5f')],[_0xd371('0x6e'),'id'])||{})['spread'](function(_0x3d1bfa){for(var _0x32651f=0x0;_0x32651f<_0x1a3a73[_0xd371('0x5f')][_0xd371('0x6e')]['length'];_0x32651f+=0x1){socket[_0xd371('0xbb')](_0xd371('0xbc'),{'UserId':Number(_0x1a3a73[_0xd371('0x5f')][_0xd371('0x6e')][_0x32651f]),'FaxAccountId':Number(_0x1a3a73[_0xd371('0x5c')]['id'])});}return _0x3d1bfa;});}})[_0xd371('0x22')](respondWithResult(_0x37c3c3,null))[_0xd371('0x5a')](handleError(_0x37c3c3,null));};exports['removeAgents']=function(_0x248a8d,_0x2501c8,_0x94f942){return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x248a8d[_0xd371('0x5c')]['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x2501c8,null))[_0xd371('0x22')](function(_0x171a3e){if(_0x171a3e){return _0x171a3e[_0xd371('0xbd')](_0x248a8d[_0xd371('0x45')][_0xd371('0x6e')])[_0xd371('0x22')](function(){if(_[_0xd371('0xbe')](_0x248a8d['query'][_0xd371('0x6e')])){for(var _0x28159d=0x0;_0x28159d<_0x248a8d[_0xd371('0x45')][_0xd371('0x6e')]['length'];_0x28159d+=0x1){socket[_0xd371('0xbb')](_0xd371('0xbf'),{'UserId':Number(_0x248a8d[_0xd371('0x45')][_0xd371('0x6e')][_0x28159d]),'FaxAccountId':Number(_0x248a8d[_0xd371('0x5c')]['id'])});}}else{socket[_0xd371('0xbb')](_0xd371('0xbf'),{'UserId':Number(_0x248a8d[_0xd371('0x45')][_0xd371('0x6e')]),'FaxAccountId':Number(_0x248a8d[_0xd371('0x5c')]['id'])});}});}})[_0xd371('0x22')](respondWithStatusCode(_0x2501c8,null))[_0xd371('0x5a')](handleError(_0x2501c8,null));};exports['getAgents']=function(_0x489210,_0x299f97,_0x58790b){var _0x13c351={};var _0x15bdfb={};var _0x1a8e40;var _0x1232fc;return db[_0xd371('0x40')][_0xd371('0x77')]({'where':{'id':_0x489210[_0xd371('0x5c')]['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x299f97,null))[_0xd371('0x22')](function(_0x301771){if(_0x301771){_0x1a8e40=_0x301771;_0x15bdfb[_0xd371('0x47')]=_['keys'](db['User']['rawAttributes']);_0x15bdfb[_0xd371('0x45')]=_[_0xd371('0x46')](_0x489210['query']);_0x15bdfb['filters']=_[_0xd371('0x49')](_0x15bdfb[_0xd371('0x47')],_0x15bdfb[_0xd371('0x45')]);_0x13c351['attributes']=_[_0xd371('0x49')](_0x15bdfb[_0xd371('0x47')],qs[_0xd371('0x4a')](_0x489210[_0xd371('0x45')]['fields']));_0x13c351[_0xd371('0x48')]=_0x13c351[_0xd371('0x48')]['length']?_0x13c351[_0xd371('0x48')]:_0x15bdfb['model'];_0x13c351[_0xd371('0x4d')]=qs['sort'](_0x489210[_0xd371('0x45')][_0xd371('0x4e')]);_0x13c351[_0xd371('0x4f')]=qs[_0xd371('0x51')](_[_0xd371('0x50')](_0x489210[_0xd371('0x45')],_0x15bdfb[_0xd371('0x51')]));if(_0x489210['query'][_0xd371('0x52')]){_0x13c351['where']=_[_0xd371('0x53')](_0x13c351[_0xd371('0x4f')],{'$or':_[_0xd371('0x3f')](_0x13c351['attributes'],function(_0x93f18e){var _0x5014ab={};_0x5014ab[_0x93f18e]={'$like':'%'+_0x489210[_0xd371('0x45')]['filter']+'%'};return _0x5014ab;})});}_0x13c351=_[_0xd371('0x53')]({},_0x13c351,_0x489210[_0xd371('0x55')]);return _0x1a8e40['getAgents'](_0x13c351);}})['then'](function(_0x5d49af){if(_0x5d49af){_0x1232fc=_0x5d49af[_0xd371('0x4b')];if(!_0x489210['query'][_0xd371('0x6c')](_0xd371('0x4c'))){_0x13c351[_0xd371('0x2f')]=qs[_0xd371('0x2f')](_0x489210[_0xd371('0x45')]['limit']);_0x13c351[_0xd371('0x31')]=qs[_0xd371('0x31')](_0x489210[_0xd371('0x45')][_0xd371('0x31')]);}return _0x1a8e40['getAgents'](_0x13c351);}})[_0xd371('0x22')](function(_0xac13c8){if(_0xac13c8){return _0xac13c8?{'count':_0x1232fc,'rows':_0xac13c8}:null;}})[_0xd371('0x22')](respondWithResult(_0x299f97,null))[_0xd371('0x5a')](handleError(_0x299f97,null));}; \ No newline at end of file +var _0x9edc=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','rawAttributes','pick','includeAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','order','removeAnswers','addInteraction','omit','FaxInteraction','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','app','system','Fax\x20Extension','push','CDR(type)=inbound-fax','Set','ecm','localstationid','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','DESC','attachments','root','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','Contacts','CmContact','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','emit','userFaxAccount:remove','getAgents','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./faxAccount.socket','register','client','http','then','info','FaxAccount,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','send','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','Pause','find','create'];(function(_0x40557d,_0x5a48eb){var _0x2db316=function(_0x344620){while(--_0x344620){_0x40557d['push'](_0x40557d['shift']());}};_0x2db316(++_0x5a48eb);}(_0x9edc,0x66));var _0xc9ed=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0x9edc[_0x555069];return _0x100af7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9ed('0x0'));var zipdir=require(_0xc9ed('0x1'));var jsonpatch=require(_0xc9ed('0x2'));var rp=require(_0xc9ed('0x3'));var moment=require('moment');var BPromise=require(_0xc9ed('0x4'));var Mustache=require(_0xc9ed('0x5'));var util=require(_0xc9ed('0x6'));var path=require(_0xc9ed('0x7'));var sox=require(_0xc9ed('0x8'));var csv=require(_0xc9ed('0x9'));var ejs=require(_0xc9ed('0xa'));var fs=require('fs');var fs_extra=require(_0xc9ed('0xb'));var _=require(_0xc9ed('0xc'));var squel=require(_0xc9ed('0xd'));var crypto=require(_0xc9ed('0xe'));var jsforce=require(_0xc9ed('0xf'));var deskjs=require(_0xc9ed('0x10'));var toCsv=require(_0xc9ed('0x9'));var querystring=require(_0xc9ed('0x11'));var Papa=require('papaparse');var Redis=require(_0xc9ed('0x12'));var authService=require(_0xc9ed('0x13'));var qs=require(_0xc9ed('0x14'));var as=require(_0xc9ed('0x15'));var hardwareService=require(_0xc9ed('0x16'));var logger=require(_0xc9ed('0x17'))(_0xc9ed('0x18'));var utils=require(_0xc9ed('0x19'));var config=require(_0xc9ed('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc9ed('0x1b'))['db'];config['redis']=_[_0xc9ed('0x1c')](config[_0xc9ed('0x1d')],{'host':_0xc9ed('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc9ed('0x1d')]));require(_0xc9ed('0x1f'))[_0xc9ed('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc9ed('0x21')][_0xc9ed('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xc9ed('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5fdff8,_0x3cd7d0,_0x38fae1,_0x4ebe30){return new BPromise(function(_0x123e5b,_0x3600a6){var _0xdd299f=_0x4ebe30||client;return _0xdd299f['request'](_0x5fdff8,_0x38fae1)[_0xc9ed('0x23')](function(_0xc6621f){logger[_0xc9ed('0x24')](_0xc9ed('0x25'),_0x3cd7d0,'request\x20sent');logger[_0xc9ed('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3cd7d0,'request\x20sent',JSON[_0xc9ed('0x27')](_0xc6621f));if(_0xc6621f['error']){if(_0xc6621f['error'][_0xc9ed('0x28')]===0x1f4){logger[_0xc9ed('0x29')](_0xc9ed('0x25'),_0x3cd7d0,_0xc6621f['error'][_0xc9ed('0x2a')]);return _0x3600a6(_0xc6621f[_0xc9ed('0x29')][_0xc9ed('0x2a')]);}logger[_0xc9ed('0x29')](_0xc9ed('0x25'),_0x3cd7d0,_0xc6621f[_0xc9ed('0x29')][_0xc9ed('0x2a')]);return _0x123e5b(_0xc6621f['error'][_0xc9ed('0x2a')]);}else{logger[_0xc9ed('0x24')](_0xc9ed('0x25'),_0x3cd7d0,_0xc9ed('0x2b'));_0x123e5b(_0xc6621f[_0xc9ed('0x2c')]['message']);}})[_0xc9ed('0x2d')](function(_0x188771){logger[_0xc9ed('0x29')](_0xc9ed('0x25'),_0x3cd7d0,_0x188771);_0x3600a6(_0x188771);});});}function respondWithStatusCode(_0x1b3500,_0x375a7b){_0x375a7b=_0x375a7b||0xcc;return function(_0x3c6e6f){if(_0x3c6e6f){return _0x1b3500[_0xc9ed('0x2e')](_0x375a7b);}return _0x1b3500[_0xc9ed('0x2f')](_0x375a7b)[_0xc9ed('0x30')]();};}function respondWithResult(_0x5b5106,_0xc4108d){_0xc4108d=_0xc4108d||0xc8;return function(_0x50b64f){if(_0x50b64f){return _0x5b5106[_0xc9ed('0x2f')](_0xc4108d)[_0xc9ed('0x31')](_0x50b64f);}};}function respondWithFilteredResult(_0x3b4227,_0x2eaf98){return function(_0x351cdc){if(_0x351cdc){var _0x45dbcc=typeof _0x2eaf98[_0xc9ed('0x32')]===_0xc9ed('0x33')&&typeof _0x2eaf98['limit']===_0xc9ed('0x33');var _0x413755=_0x351cdc[_0xc9ed('0x34')];var _0x39b08a=_0x45dbcc?0x0:_0x2eaf98['offset'];var _0x4004f1=_0x45dbcc?_0x351cdc[_0xc9ed('0x34')]:_0x2eaf98[_0xc9ed('0x32')]+_0x2eaf98[_0xc9ed('0x35')];var _0x30255a;if(_0x4004f1>=_0x413755){_0x4004f1=_0x413755;_0x30255a=0xc8;}else{_0x30255a=0xce;}_0x3b4227[_0xc9ed('0x2f')](_0x30255a);return _0x3b4227['set']('Content-Range',_0x39b08a+'-'+_0x4004f1+'/'+_0x413755)[_0xc9ed('0x31')](_0x351cdc);}return null;};}function patchUpdates(_0x1a0810){return function(_0x27b290){try{jsonpatch[_0xc9ed('0x36')](_0x27b290,_0x1a0810,!![]);}catch(_0x4b94e4){return BPromise[_0xc9ed('0x37')](_0x4b94e4);}return _0x27b290[_0xc9ed('0x38')]();};}function saveUpdates(_0x4365fa,_0x1df99f){return function(_0x237f6a){if(_0x237f6a){return _0x237f6a[_0xc9ed('0x39')](_0x4365fa)[_0xc9ed('0x23')](function(_0x38cd94){return _0x38cd94;});}return null;};}function removeEntity(_0x199a9d,_0x25aa89){return function(_0x4dab4a){if(_0x4dab4a){return _0x4dab4a[_0xc9ed('0x3a')]()[_0xc9ed('0x23')](function(){var _0x32533f=_0x4dab4a[_0xc9ed('0x3b')]({'plain':!![]});var _0x108a6c=_0xc9ed('0x3c');return db[_0xc9ed('0x3d')][_0xc9ed('0x3a')]({'where':{'type':_0x108a6c,'resourceId':_0x32533f['id']}})[_0xc9ed('0x23')](function(){return _0x4dab4a;});})[_0xc9ed('0x23')](function(){_0x199a9d['status'](0xcc)[_0xc9ed('0x30')]();});}};}function handleEntityNotFound(_0x41192a,_0x1de891){return function(_0x329b70){if(!_0x329b70){_0x41192a[_0xc9ed('0x2e')](0x194);}return _0x329b70;};}function handleError(_0x2411d7,_0x32d99c){_0x32d99c=_0x32d99c||0x1f4;return function(_0xae4b52){logger[_0xc9ed('0x29')](_0xae4b52['stack']);if(_0xae4b52['name']){delete _0xae4b52['name'];}_0x2411d7[_0xc9ed('0x2f')](_0x32d99c)[_0xc9ed('0x3e')](_0xae4b52);};}exports['index']=function(_0x9ffc3,_0x3ea0a0){var _0x9b06f0={'include':[{'model':db['Pause'],'as':_0xc9ed('0x3f')}]},_0x540d7d={},_0x3f402d={'count':0x0,'rows':[]};var _0x304b97=_[_0xc9ed('0x40')](db[_0xc9ed('0x41')]['rawAttributes'],function(_0x434310){return{'name':_0x434310[_0xc9ed('0x42')],'type':_0x434310[_0xc9ed('0x43')][_0xc9ed('0x44')]};});_0x540d7d[_0xc9ed('0x45')]=_['map'](_0x304b97,_0xc9ed('0x46'));_0x540d7d[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x9ffc3[_0xc9ed('0x47')]);_0x540d7d[_0xc9ed('0x49')]=_[_0xc9ed('0x4a')](_0x540d7d['model'],_0x540d7d['query']);_0x9b06f0['attributes']=_[_0xc9ed('0x4a')](_0x540d7d[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x4b')]));_0x9b06f0[_0xc9ed('0x4c')]=_0x9b06f0[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x9b06f0[_0xc9ed('0x4c')]:_0x540d7d[_0xc9ed('0x45')];if(!_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x9b06f0['limit']=qs[_0xc9ed('0x35')](_0x9ffc3[_0xc9ed('0x47')]['limit']);_0x9b06f0[_0xc9ed('0x32')]=qs['offset'](_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x32')]);}_0x9b06f0['order']=qs[_0xc9ed('0x50')](_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x50')]);_0x9b06f0[_0xc9ed('0x51')]=qs[_0xc9ed('0x49')](_['pick'](_0x9ffc3[_0xc9ed('0x47')],_0x540d7d[_0xc9ed('0x49')]),_0x304b97);if(_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x52')]){_0x9b06f0[_0xc9ed('0x51')]=_[_0xc9ed('0x53')](_0x9b06f0[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x304b97,function(_0x41b504){if(_0x41b504['type']!==_0xc9ed('0x54')){var _0x29138d={};_0x29138d[_0x41b504['name']]={'$like':'%'+_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x52')]+'%'};return _0x29138d;}})});}_0x9b06f0=_[_0xc9ed('0x53')]({},_0x9b06f0,_0x9ffc3[_0xc9ed('0x55')]);var _0x407f3e={'where':_0x9b06f0[_0xc9ed('0x51')]};return db[_0xc9ed('0x41')][_0xc9ed('0x34')](_0x407f3e)['then'](function(_0x385e3a){_0x3f402d['count']=_0x385e3a;if(_0x9ffc3[_0xc9ed('0x47')]['includeAll']){_0x9b06f0[_0xc9ed('0x56')]=[{'all':!![]}];}return db[_0xc9ed('0x41')][_0xc9ed('0x57')](_0x9b06f0);})[_0xc9ed('0x23')](function(_0x3b5366){_0x3f402d[_0xc9ed('0x58')]=_0x3b5366;return _0x3f402d;})[_0xc9ed('0x23')](respondWithFilteredResult(_0x3ea0a0,_0x9b06f0))[_0xc9ed('0x2d')](handleError(_0x3ea0a0,null));};exports[_0xc9ed('0x59')]=function(_0x37de3d,_0x56d10c){var _0x175175={'raw':![],'where':{'id':_0x37de3d[_0xc9ed('0x5a')]['id']},'include':[{'model':db[_0xc9ed('0x5b')],'as':_0xc9ed('0x3f')}]},_0x363990={};_0x363990[_0xc9ed('0x45')]=_[_0xc9ed('0x48')](db[_0xc9ed('0x41')]['rawAttributes']);_0x363990['query']=_[_0xc9ed('0x48')](_0x37de3d[_0xc9ed('0x47')]);_0x363990['filters']=_[_0xc9ed('0x4a')](_0x363990['model'],_0x363990[_0xc9ed('0x47')]);_0x175175['attributes']=_[_0xc9ed('0x4a')](_0x363990[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x37de3d['query'][_0xc9ed('0x4b')]));_0x175175[_0xc9ed('0x4c')]=_0x175175[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x175175[_0xc9ed('0x4c')]:_0x363990[_0xc9ed('0x45')];if(_0x37de3d[_0xc9ed('0x47')]['includeAll']){_0x175175[_0xc9ed('0x56')]=[{'all':!![]}];}_0x175175=_[_0xc9ed('0x53')]({},_0x175175,_0x37de3d['options']);return db['FaxAccount'][_0xc9ed('0x5c')](_0x175175)['then'](handleEntityNotFound(_0x56d10c,null))[_0xc9ed('0x23')](respondWithResult(_0x56d10c,null))['catch'](handleError(_0x56d10c,null));};exports[_0xc9ed('0x5d')]=function(_0x26df5c,_0x5efc23){return db[_0xc9ed('0x41')][_0xc9ed('0x5d')](_0x26df5c[_0xc9ed('0x5e')],{})[_0xc9ed('0x23')](function(_0x694787){var _0x311b47=_0x26df5c[_0xc9ed('0x5f')][_0xc9ed('0x3b')]({'plain':!![]});if(!_0x311b47)throw new Error(_0xc9ed('0x60'));if(_0x311b47[_0xc9ed('0x61')]===_0xc9ed('0x5f')){var _0x522dfa=_0x694787[_0xc9ed('0x3b')]({'plain':!![]});var _0x799402=_0xc9ed('0x3c');return db['UserProfileSection'][_0xc9ed('0x5c')]({'where':{'name':_0x799402,'userProfileId':_0x311b47[_0xc9ed('0x62')]},'raw':!![]})[_0xc9ed('0x23')](function(_0x1e491e){if(_0x1e491e&&_0x1e491e[_0xc9ed('0x63')]===0x0){return db[_0xc9ed('0x3d')][_0xc9ed('0x5d')]({'name':_0x522dfa[_0xc9ed('0x46')],'resourceId':_0x522dfa['id'],'type':_0x1e491e[_0xc9ed('0x46')],'sectionId':_0x1e491e['id']},{})['then'](function(){return _0x694787;});}else{return _0x694787;}})[_0xc9ed('0x2d')](function(_0x42d52e){logger[_0xc9ed('0x29')](_0xc9ed('0x64'),_0x42d52e);throw _0x42d52e;});}return _0x694787;})['then'](respondWithResult(_0x5efc23,0xc9))[_0xc9ed('0x2d')](handleError(_0x5efc23,null));};exports[_0xc9ed('0x39')]=function(_0x300a7b,_0x518e55){if(_0x300a7b[_0xc9ed('0x5e')]['id']){delete _0x300a7b['body']['id'];}return db['FaxAccount'][_0xc9ed('0x5c')]({'where':{'id':_0x300a7b[_0xc9ed('0x5a')]['id']},'include':[{'model':db[_0xc9ed('0x5b')],'as':'mandatoryDispositionPause'}]})[_0xc9ed('0x23')](handleEntityNotFound(_0x518e55,null))['then'](saveUpdates(_0x300a7b[_0xc9ed('0x5e')],null))[_0xc9ed('0x23')](respondWithResult(_0x518e55,null))[_0xc9ed('0x2d')](handleError(_0x518e55,null));};exports['destroy']=function(_0x33131c,_0x1f7819){return db[_0xc9ed('0x41')][_0xc9ed('0x5c')]({'where':{'id':_0x33131c[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x1f7819,null))[_0xc9ed('0x23')](removeEntity(_0x1f7819,null))['catch'](handleError(_0x1f7819,null));};exports['describe']=function(_0x30b118,_0x5ee901){return db[_0xc9ed('0x41')][_0xc9ed('0x65')]()['then'](respondWithResult(_0x5ee901,null))[_0xc9ed('0x2d')](handleError(_0x5ee901,null));};exports[_0xc9ed('0x66')]=function(_0x20297a,_0x142219,_0x3e6176){if(_0x20297a[_0xc9ed('0x5e')]['id']){delete _0x20297a[_0xc9ed('0x5e')]['id'];}return db[_0xc9ed('0x41')][_0xc9ed('0x5c')]({'where':{'id':_0x20297a[_0xc9ed('0x5a')]['id']}})['then'](handleEntityNotFound(_0x142219,null))['then'](function(_0x3dd649){if(_0x3dd649){_0x20297a['body'][_0xc9ed('0x67')]=_0x3dd649['id'];return db[_0xc9ed('0x68')]['create'](_0x20297a[_0xc9ed('0x5e')]);}})[_0xc9ed('0x23')](respondWithResult(_0x142219,null))[_0xc9ed('0x2d')](handleError(_0x142219,null));};exports['getDispositions']=function(_0x3f0374,_0x3ad75b,_0x1b1887){var _0x56d2de={'raw':![],'where':{}};var _0x2f1b88={};var _0x484f85={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3f0374[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x3ad75b,null))[_0xc9ed('0x23')](function(_0x2e83f7){if(_0x2e83f7){_0x2f1b88[_0xc9ed('0x45')]=_['keys'](db[_0xc9ed('0x68')][_0xc9ed('0x69')]);_0x2f1b88[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x3f0374[_0xc9ed('0x47')]);_0x2f1b88[_0xc9ed('0x49')]=_[_0xc9ed('0x4a')](_0x2f1b88['model'],_0x2f1b88['query']);_0x56d2de['attributes']=_[_0xc9ed('0x4a')](_0x2f1b88['model'],qs[_0xc9ed('0x4b')](_0x3f0374[_0xc9ed('0x47')][_0xc9ed('0x4b')]));_0x56d2de[_0xc9ed('0x4c')]=_0x56d2de[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x56d2de[_0xc9ed('0x4c')]:_0x2f1b88[_0xc9ed('0x45')];if(!_0x3f0374[_0xc9ed('0x47')][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x56d2de[_0xc9ed('0x35')]=qs['limit'](_0x3f0374[_0xc9ed('0x47')]['limit']);_0x56d2de['offset']=qs[_0xc9ed('0x32')](_0x3f0374[_0xc9ed('0x47')][_0xc9ed('0x32')]);}_0x56d2de['order']=qs['sort'](_0x3f0374['query'][_0xc9ed('0x50')]);_0x56d2de[_0xc9ed('0x51')]=qs[_0xc9ed('0x49')](_[_0xc9ed('0x6a')](_0x3f0374[_0xc9ed('0x47')],_0x2f1b88['filters']));_0x56d2de['where'][_0xc9ed('0x67')]=_0x2e83f7['id'];if(_0x3f0374[_0xc9ed('0x47')][_0xc9ed('0x52')]){_0x56d2de['where']=_[_0xc9ed('0x53')](_0x56d2de[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x56d2de[_0xc9ed('0x4c')],function(_0xdc98b4){var _0x535294={};_0x535294[_0xdc98b4]={'$like':'%'+_0x3f0374[_0xc9ed('0x47')]['filter']+'%'};return _0x535294;})});}_0x56d2de=_['merge']({},_0x56d2de,_0x3f0374[_0xc9ed('0x55')]);return db['Disposition'][_0xc9ed('0x34')]({'where':_0x56d2de[_0xc9ed('0x51')]})[_0xc9ed('0x23')](function(_0x1f5d75){_0x484f85[_0xc9ed('0x34')]=_0x1f5d75;if(_0x3f0374[_0xc9ed('0x47')][_0xc9ed('0x6b')]){_0x56d2de[_0xc9ed('0x56')]=[{'all':!![]}];}return db[_0xc9ed('0x68')]['findAll'](_0x56d2de);})[_0xc9ed('0x23')](function(_0x2d6cea){_0x484f85['rows']=_0x2d6cea;return _0x484f85;});}})[_0xc9ed('0x23')](respondWithFilteredResult(_0x3ad75b,_0x56d2de))['catch'](handleError(_0x3ad75b,null));};exports[_0xc9ed('0x6c')]=function(_0x554ef2,_0x582cdd,_0x4e42e8){return db[_0xc9ed('0x41')]['find']({'where':{'id':_0x554ef2['params']['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x582cdd,null))[_0xc9ed('0x23')](function(_0x1942f4){if(_0x1942f4){return _0x1942f4[_0xc9ed('0x6c')](_0x554ef2[_0xc9ed('0x47')][_0xc9ed('0x6d')]);}})[_0xc9ed('0x23')](respondWithStatusCode(_0x582cdd,null))[_0xc9ed('0x2d')](handleError(_0x582cdd,null));};exports[_0xc9ed('0x6e')]=function(_0x4a9599,_0x4ae55b,_0xdefdb4){if(_0x4a9599[_0xc9ed('0x5e')]['id']){delete _0x4a9599['body']['id'];}return db[_0xc9ed('0x41')]['find']({'where':{'id':_0x4a9599['params']['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x4ae55b,null))['then'](function(_0x1ac8b7){if(_0x1ac8b7){_0x4a9599[_0xc9ed('0x5e')]['FaxAccountId']=_0x1ac8b7['id'];return db['CannedAnswer']['create'](_0x4a9599[_0xc9ed('0x5e')]);}})[_0xc9ed('0x23')](respondWithResult(_0x4ae55b,null))[_0xc9ed('0x2d')](handleError(_0x4ae55b,null));};exports[_0xc9ed('0x6f')]=function(_0x40804c,_0x48a7a4,_0xbe0a4c){var _0x50b063={'raw':![],'where':{}};var _0x10b37d={};var _0x1bec9a={'count':0x0,'rows':[]};return db[_0xc9ed('0x41')][_0xc9ed('0x70')]({'where':{'id':_0x40804c[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x48a7a4,null))[_0xc9ed('0x23')](function(_0xfc78b0){if(_0xfc78b0){_0x10b37d['model']=_[_0xc9ed('0x48')](db[_0xc9ed('0x71')][_0xc9ed('0x69')]);_0x10b37d[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x40804c[_0xc9ed('0x47')]);_0x10b37d[_0xc9ed('0x49')]=_[_0xc9ed('0x4a')](_0x10b37d[_0xc9ed('0x45')],_0x10b37d[_0xc9ed('0x47')]);_0x50b063['attributes']=_['intersection'](_0x10b37d[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x40804c['query']['fields']));_0x50b063[_0xc9ed('0x4c')]=_0x50b063[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x50b063[_0xc9ed('0x4c')]:_0x10b37d[_0xc9ed('0x45')];if(!_0x40804c[_0xc9ed('0x47')][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x50b063['limit']=qs['limit'](_0x40804c['query'][_0xc9ed('0x35')]);_0x50b063[_0xc9ed('0x32')]=qs[_0xc9ed('0x32')](_0x40804c[_0xc9ed('0x47')][_0xc9ed('0x32')]);}_0x50b063[_0xc9ed('0x72')]=qs[_0xc9ed('0x50')](_0x40804c[_0xc9ed('0x47')]['sort']);_0x50b063[_0xc9ed('0x51')]=qs[_0xc9ed('0x49')](_[_0xc9ed('0x6a')](_0x40804c['query'],_0x10b37d[_0xc9ed('0x49')]));_0x50b063[_0xc9ed('0x51')][_0xc9ed('0x67')]=_0xfc78b0['id'];if(_0x40804c[_0xc9ed('0x47')][_0xc9ed('0x52')]){_0x50b063[_0xc9ed('0x51')]=_[_0xc9ed('0x53')](_0x50b063[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x50b063[_0xc9ed('0x4c')],function(_0xaa3b19){var _0x75b24a={};_0x75b24a[_0xaa3b19]={'$like':'%'+_0x40804c[_0xc9ed('0x47')][_0xc9ed('0x52')]+'%'};return _0x75b24a;})});}_0x50b063=_[_0xc9ed('0x53')]({},_0x50b063,_0x40804c[_0xc9ed('0x55')]);return db[_0xc9ed('0x71')][_0xc9ed('0x34')]({'where':_0x50b063['where']})[_0xc9ed('0x23')](function(_0x47953b){_0x1bec9a['count']=_0x47953b;if(_0x40804c[_0xc9ed('0x47')][_0xc9ed('0x6b')]){_0x50b063[_0xc9ed('0x56')]=[{'all':!![]}];}return db[_0xc9ed('0x71')][_0xc9ed('0x57')](_0x50b063);})[_0xc9ed('0x23')](function(_0x5dc6c8){_0x1bec9a[_0xc9ed('0x58')]=_0x5dc6c8;return _0x1bec9a;});}})['then'](respondWithFilteredResult(_0x48a7a4,_0x50b063))[_0xc9ed('0x2d')](handleError(_0x48a7a4,null));};exports[_0xc9ed('0x73')]=function(_0x4d0389,_0x3a9edf,_0x11d7fe){return db[_0xc9ed('0x41')][_0xc9ed('0x5c')]({'where':{'id':_0x4d0389[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x3a9edf,null))[_0xc9ed('0x23')](function(_0x35e87a){if(_0x35e87a){return _0x35e87a['removeAnswers'](_0x4d0389[_0xc9ed('0x47')][_0xc9ed('0x6d')]);}})[_0xc9ed('0x23')](respondWithStatusCode(_0x3a9edf,null))[_0xc9ed('0x2d')](handleError(_0x3a9edf,null));};exports['addInteraction']=function(_0x124eac,_0x11d449,_0x40a2fc){return db['FaxInteraction'][_0xc9ed('0x5c')]({'where':{'id':_0x124eac[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x11d449,null))[_0xc9ed('0x23')](function(_0x176344){if(_0x176344){return _0x176344[_0xc9ed('0x74')](_0x124eac[_0xc9ed('0x5e')][_0xc9ed('0x6d')],_[_0xc9ed('0x75')](_0x124eac[_0xc9ed('0x5e')],[_0xc9ed('0x6d'),'id'])||{});}})[_0xc9ed('0x23')](respondWithResult(_0x11d449,null))['catch'](handleError(_0x11d449,null));};exports['getInteractions']=function(_0x4b56d6,_0x537daf,_0xc20f87){var _0x31c9e5={'raw':![],'where':{}};var _0x2818ef={};var _0x2e17ea={'count':0x0,'rows':[]};return db[_0xc9ed('0x41')][_0xc9ed('0x70')]({'where':{'id':_0x4b56d6['params']['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x537daf,null))['then'](function(_0x51acc2){if(_0x51acc2){_0x2818ef[_0xc9ed('0x45')]=_[_0xc9ed('0x48')](db[_0xc9ed('0x76')]['rawAttributes']);_0x2818ef['query']=_[_0xc9ed('0x48')](_0x4b56d6['query']);_0x2818ef['filters']=_[_0xc9ed('0x4a')](_0x2818ef['model'],_0x2818ef[_0xc9ed('0x47')]);_0x31c9e5[_0xc9ed('0x4c')]=_[_0xc9ed('0x4a')](_0x2818ef[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x4b')]));_0x31c9e5[_0xc9ed('0x4c')]=_0x31c9e5[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x31c9e5[_0xc9ed('0x4c')]:_0x2818ef[_0xc9ed('0x45')];if(!_0x4b56d6['query'][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x31c9e5['limit']=qs['limit'](_0x4b56d6['query']['limit']);_0x31c9e5[_0xc9ed('0x32')]=qs[_0xc9ed('0x32')](_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x32')]);}_0x31c9e5['order']=qs['sort'](_0x4b56d6['query'][_0xc9ed('0x50')]);_0x31c9e5['where']=qs[_0xc9ed('0x49')](_[_0xc9ed('0x6a')](_0x4b56d6['query'],_0x2818ef[_0xc9ed('0x49')]));_0x31c9e5[_0xc9ed('0x51')][_0xc9ed('0x67')]=_0x51acc2['id'];if(_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x52')]){_0x31c9e5[_0xc9ed('0x51')]=_[_0xc9ed('0x53')](_0x31c9e5[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x31c9e5[_0xc9ed('0x4c')],function(_0x125dc7){var _0x1cb6b6={};_0x1cb6b6[_0x125dc7]={'$like':'%'+_0x4b56d6['query']['filter']+'%'};return _0x1cb6b6;})});}_0x31c9e5=_[_0xc9ed('0x53')]({},_0x31c9e5,_0x4b56d6[_0xc9ed('0x55')]);return db[_0xc9ed('0x76')]['count']({'where':_0x31c9e5['where']})[_0xc9ed('0x23')](function(_0x5b83e5){_0x2e17ea[_0xc9ed('0x34')]=_0x5b83e5;if(_0x4b56d6['query'][_0xc9ed('0x6b')]){_0x31c9e5['include']=[{'model':db['CmContact'],'as':_0xc9ed('0x77'),'required':![]},{'model':db[_0xc9ed('0x78')],'as':_0xc9ed('0x79'),'attributes':[_0xc9ed('0x46'),'fullname',_0xc9ed('0x7a')],'required':![]},{'model':db[_0xc9ed('0x7b')],'as':_0xc9ed('0x7c'),'attributes':['id','name',_0xc9ed('0x7d')],'where':_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x7e')]?{'id':_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x7e')]}:undefined,'required':_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x7e')]?!![]:![]}];}return db[_0xc9ed('0x76')][_0xc9ed('0x57')](_0x31c9e5);})[_0xc9ed('0x23')](function(_0x49ca89){_0x2e17ea[_0xc9ed('0x58')]=_0x49ca89;return _0x2e17ea;});}})[_0xc9ed('0x23')](respondWithFilteredResult(_0x537daf,_0x31c9e5))[_0xc9ed('0x2d')](handleError(_0x537daf,null));};exports[_0xc9ed('0x7f')]=function(_0x1237cf,_0xbaec0b,_0x4f9a90){return db[_0xc9ed('0x41')][_0xc9ed('0x70')]({'where':{'id':_0x1237cf['params']['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0xbaec0b,null))[_0xc9ed('0x23')](function(_0x4caa5f){if(_0x4caa5f){return db[_0xc9ed('0x80')][_0xc9ed('0x81')](function(_0x27c925){return db[_0xc9ed('0x82')]['destroy']({'where':{'FaxAccountId':_0x1237cf[_0xc9ed('0x5a')]['id']},'transaction':_0x27c925})[_0xc9ed('0x23')](function(_0x59c334){var _0x285425=_[_0xc9ed('0x40')](_0x1237cf[_0xc9ed('0x5e')],function(_0x3834dd){_0x3834dd[_0xc9ed('0x67')]=_0x1237cf['params']['id'];return _0x3834dd;});return db[_0xc9ed('0x82')][_0xc9ed('0x83')](_0x285425,{'transaction':_0x27c925});});})['then'](function(){return db[_0xc9ed('0x82')][_0xc9ed('0x84')]({'where':{'FaxAccountId':_0x1237cf['params']['id']},'order':_0xc9ed('0x85')});});}})['then'](respondWithResult(_0xbaec0b,null))[_0xc9ed('0x2d')](handleError(_0xbaec0b,null));};exports[_0xc9ed('0x86')]=function(_0x1e2768,_0x27c3a9,_0x47169a){var _0x59257d={};var _0x29c5b1={};var _0x14ee29;var _0x36716f;return db['FaxAccount'][_0xc9ed('0x70')]({'where':{'id':_0x1e2768[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x27c3a9,null))[_0xc9ed('0x23')](function(_0x58973b){if(_0x58973b){_0x14ee29=_0x58973b;_0x29c5b1[_0xc9ed('0x45')]=_[_0xc9ed('0x48')](db['FaxApplication'][_0xc9ed('0x69')]);_0x29c5b1[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x1e2768[_0xc9ed('0x47')]);_0x29c5b1[_0xc9ed('0x49')]=_['intersection'](_0x29c5b1[_0xc9ed('0x45')],_0x29c5b1[_0xc9ed('0x47')]);_0x59257d[_0xc9ed('0x4c')]=_[_0xc9ed('0x4a')](_0x29c5b1[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x1e2768[_0xc9ed('0x47')]['fields']));_0x59257d[_0xc9ed('0x4c')]=_0x59257d[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x59257d[_0xc9ed('0x4c')]:_0x29c5b1['model'];_0x59257d[_0xc9ed('0x72')]=qs[_0xc9ed('0x50')](_0x1e2768[_0xc9ed('0x47')][_0xc9ed('0x50')]);_0x59257d['where']=qs['filters'](_[_0xc9ed('0x6a')](_0x1e2768[_0xc9ed('0x47')],_0x29c5b1['filters']));if(_0x1e2768['query']['filter']){_0x59257d[_0xc9ed('0x51')]=_[_0xc9ed('0x53')](_0x59257d[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x59257d[_0xc9ed('0x4c')],function(_0x1f3d62){var _0x45617b={};_0x45617b[_0x1f3d62]={'$like':'%'+_0x1e2768['query'][_0xc9ed('0x52')]+'%'};return _0x45617b;})});}_0x59257d=_['merge']({},_0x59257d,_0x1e2768['options']);return _0x14ee29[_0xc9ed('0x86')](_0x59257d);}})[_0xc9ed('0x23')](function(_0x1f0658){if(_0x1f0658){_0x36716f=_0x1f0658['length'];if(!_0x1e2768['query'][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x59257d[_0xc9ed('0x35')]=qs['limit'](_0x1e2768[_0xc9ed('0x47')]['limit']);_0x59257d[_0xc9ed('0x32')]=qs[_0xc9ed('0x32')](_0x1e2768[_0xc9ed('0x47')]['offset']);}return _0x14ee29[_0xc9ed('0x86')](_0x59257d);}})['then'](function(_0x5530c0){if(_0x5530c0){return _0x5530c0?{'count':_0x36716f,'rows':_0x5530c0}:null;}})[_0xc9ed('0x23')](respondWithResult(_0x27c3a9,null))[_0xc9ed('0x2d')](handleError(_0x27c3a9,null));};function Extension(_0x321e06,_0x26d179,_0x6a5f71,_0x2628f5){this['context']=_0xc9ed('0x87');this[_0xc9ed('0x88')]=_0x321e06['localstationid'];this[_0xc9ed('0x89')]=_0x2628f5;this['type']=_0xc9ed('0x8a');this['description']=_0xc9ed('0x8b');this[_0xc9ed('0x67')]=_0x321e06['id'];this[_0xc9ed('0x85')]=_0x26d179;this['appdata']=_0x6a5f71;}function createExtensionsReciveFax(_0x4c985e){var _0x3c9bab=0x1;var _0x336fc7=[];_0x336fc7[_0xc9ed('0x8c')](new Extension(_0x4c985e,_0x3c9bab,'','Answer'));_0x3c9bab+=0x1;_0x336fc7[_0xc9ed('0x8c')](new Extension(_0x4c985e,_0x3c9bab,_0xc9ed('0x8d'),_0xc9ed('0x8e')));_0x3c9bab+=0x1;for(var _0x165f6f in _0x4c985e){if(_0x4c985e[_0xc9ed('0x4e')](_0x165f6f)&&(_0x165f6f===_0xc9ed('0x8f')||_0x165f6f===_0xc9ed('0x90')||_0x165f6f==='gateway'||_0x165f6f===_0xc9ed('0x91')||_0x165f6f===_0xc9ed('0x92')||_0x165f6f===_0xc9ed('0x93')||_0x165f6f==='minrate'||_0x165f6f===_0xc9ed('0x94')||_0x165f6f===_0xc9ed('0x95'))){_0x336fc7[_0xc9ed('0x8c')](new Extension(_0x4c985e,_0x3c9bab,_0xc9ed('0x96')+_0x165f6f+')='+_0x4c985e[_0x165f6f],'Set'));_0x3c9bab+=0x1;}}_0x336fc7[_0xc9ed('0x8c')](new Extension(_0x4c985e,_0x3c9bab,'6',_0xc9ed('0x97')));_0x3c9bab+=0x1;_0x336fc7[_0xc9ed('0x8c')](new Extension(_0x4c985e,_0x3c9bab,_0xc9ed('0x98'),_0xc9ed('0x99')));_0x3c9bab=0x0;return _0x336fc7;}exports[_0xc9ed('0x9a')]=function(_0x16db37,_0x591031,_0x27d14e){var _0x13cd56;return db[_0xc9ed('0x80')][_0xc9ed('0x81')](function(_0x293361){return db['FaxAccount']['create'](_0x16db37[_0xc9ed('0x5e')],{'transaction':_0x293361})[_0xc9ed('0x23')](function(_0x4200db){_0x13cd56=_0x4200db['get']({'plain':!![]});return db[_0xc9ed('0x9b')][_0xc9ed('0x83')](createExtensionsReciveFax(_0x13cd56),{'transaction':_0x293361});});})[_0xc9ed('0x23')](function(){return _0x13cd56;})[_0xc9ed('0x23')](respondWithResult(_0x591031,null))[_0xc9ed('0x2d')](handleError(_0x591031,null));};exports[_0xc9ed('0x9c')]=function(_0x974b4a,_0x472455,_0x38c361){var _0x20731e;return db[_0xc9ed('0x80')][_0xc9ed('0x81')](function(_0x23459e){return db[_0xc9ed('0x41')][_0xc9ed('0x39')](_0x974b4a[_0xc9ed('0x5e')],{'where':{'id':_0x974b4a['body']['id']},'transaction':_0x23459e})['then'](function(_0x51bcfa){return db[_0xc9ed('0x9b')][_0xc9ed('0x3a')]({'where':{'FaxAccountId':_0x974b4a[_0xc9ed('0x5e')]['id']},'transaction':_0x23459e})[_0xc9ed('0x23')](function(_0x4337e8){return db[_0xc9ed('0x9b')][_0xc9ed('0x83')](createExtensionsReciveFax(_[_0xc9ed('0x75')](_0x974b4a[_0xc9ed('0x5e')],[_0xc9ed('0x9d'),_0xc9ed('0x44'),_0xc9ed('0x9e'),_0xc9ed('0x9f'),_0xc9ed('0xa0'),_0xc9ed('0xa1')])),{'transaction':_0x23459e});});});})[_0xc9ed('0x23')](function(){return db[_0xc9ed('0x41')][_0xc9ed('0xa2')](_0x974b4a[_0xc9ed('0x5e')]['id']);})[_0xc9ed('0x23')](respondWithResult(_0x472455,null))['catch'](handleError(_0x472455,null));};exports[_0xc9ed('0xa3')]=function(_0x1b3b3d,_0x3b701b,_0x3def7f){var _0x11c97a={'raw':!![],'where':{}};var _0x2e8e24={};var _0x3aa443={'count':0x0,'rows':[]};return db[_0xc9ed('0x41')][_0xc9ed('0x70')]({'where':{'id':_0x1b3b3d[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x3b701b,null))[_0xc9ed('0x23')](function(_0x1bc882){if(_0x1bc882){_0x2e8e24[_0xc9ed('0x45')]=_[_0xc9ed('0x48')](db[_0xc9ed('0xa4')][_0xc9ed('0x69')]);_0x2e8e24[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x1b3b3d[_0xc9ed('0x47')]);_0x2e8e24[_0xc9ed('0x49')]=_['intersection'](_0x2e8e24['model'],_0x2e8e24[_0xc9ed('0x47')]);_0x11c97a[_0xc9ed('0x4c')]=_[_0xc9ed('0x4a')](_0x2e8e24[_0xc9ed('0x45')],qs['fields'](_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x4b')]));_0x11c97a[_0xc9ed('0x4c')]=_0x11c97a['attributes'][_0xc9ed('0x4d')]?_0x11c97a['attributes']:_0x2e8e24[_0xc9ed('0x45')];if(!_0x1b3b3d[_0xc9ed('0x47')]['hasOwnProperty'](_0xc9ed('0x4f'))){_0x11c97a[_0xc9ed('0x35')]=qs[_0xc9ed('0x35')](_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x35')]);_0x11c97a[_0xc9ed('0x32')]=qs[_0xc9ed('0x32')](_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x32')]);}_0x11c97a[_0xc9ed('0x72')]=qs[_0xc9ed('0x50')](_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x50')]);_0x11c97a[_0xc9ed('0x51')]=qs['filters'](_[_0xc9ed('0x6a')](_0x1b3b3d[_0xc9ed('0x47')],_0x2e8e24['filters']));_0x11c97a[_0xc9ed('0x51')]['FaxAccountId']=_0x1bc882['id'];if(_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x52')]){_0x11c97a[_0xc9ed('0x51')]=_[_0xc9ed('0x53')](_0x11c97a['where'],{'$or':_[_0xc9ed('0x40')](_0x11c97a['attributes'],function(_0x4a6e90){var _0x387cc5={};_0x387cc5[_0x4a6e90]={'$like':'%'+_0x1b3b3d['query'][_0xc9ed('0x52')]+'%'};return _0x387cc5;})});}if(_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0xa5')]){var _0x2e667d=_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0xa5')][_0xc9ed('0xa6')](',');var _0x4c3e60={};_0x4c3e60[_0x2e667d[0x0]]={'$gte':moment(_0x2e667d[0x1])[_0xc9ed('0xa7')](_0xc9ed('0xa8'))};_0x11c97a['where']=_[_0xc9ed('0x53')](_0x11c97a[_0xc9ed('0x51')],_0x4c3e60);}_0x11c97a=_[_0xc9ed('0x53')]({},_0x11c97a,_0x1b3b3d[_0xc9ed('0x55')]);return db['FaxMessage'][_0xc9ed('0x34')]({'where':_0x11c97a[_0xc9ed('0x51')]})[_0xc9ed('0x23')](function(_0x33f7e0){_0x3aa443[_0xc9ed('0x34')]=_0x33f7e0;if(_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x6b')]){_0x11c97a[_0xc9ed('0x56')]=[{'all':!![]}];}return db[_0xc9ed('0xa4')][_0xc9ed('0x57')](_0x11c97a);})[_0xc9ed('0x23')](function(_0x52307e){_0x3aa443[_0xc9ed('0x58')]=_0x52307e;return _0x3aa443;});}})[_0xc9ed('0x23')](respondWithFilteredResult(_0x3b701b,_0x11c97a))[_0xc9ed('0x2d')](handleError(_0x3b701b,null));};exports['send']=function(_0x1ea5ac,_0x92aa3d,_0x3cf04e){var _0x43a242,_0x2d3d9b={},_0x116aaa;if(_0x1ea5ac[_0xc9ed('0x5e')]['to']){_0x116aaa=_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0];}return db['FaxAccount'][_0xc9ed('0x5c')]({'where':{'id':_0x1ea5ac['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x116aaa},'limit':0x1,'order':[[_0xc9ed('0x9f'),_0xc9ed('0xa9')]]}]}]})[_0xc9ed('0x23')](handleEntityNotFound(_0x92aa3d,null))['then'](function(_0x199276){_0x43a242=_0x199276;if(_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')]&&_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][_0xc9ed('0x4d')]){for(var _0xa6e77e=0x0;_0xa6e77e<_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][_0xc9ed('0x4d')];_0xa6e77e+=0x1){_0x1ea5ac['body'][_0xc9ed('0xaa')][_0xa6e77e]={'filename':_0x1ea5ac[_0xc9ed('0x5e')]['attachments'][_0xa6e77e][_0xc9ed('0x46')],'id':_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][_0xa6e77e]['id'],'path':path['join'](config[_0xc9ed('0xab')],'server/files/attachments',_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][_0xa6e77e]['basename'])};}}return respondWithRpcPromise(_0xc9ed('0xac'),_0xc9ed('0xac'),{'FaxAccountId':_[_0xc9ed('0xad')](_0x1ea5ac[_0xc9ed('0x5a')]['id'])?undefined:_0x1ea5ac['params']['id'],'path':_[_0xc9ed('0xad')](_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][0x0][_0xc9ed('0x7')])?undefined:_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][0x0]['path'],'fax':_[_0xc9ed('0xad')](_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0])?undefined:_0x1ea5ac['body']['to'][0x0]},client9002);})[_0xc9ed('0x23')](function(){if(_0x43a242){if(_[_0xc9ed('0xad')](_0x1ea5ac['body'][_0xc9ed('0xae')])){_0x1ea5ac['body'][_0xc9ed('0xae')]=util[_0xc9ed('0xa7')](_0xc9ed('0xaf'),_0x43a242[_0xc9ed('0x46')],_0x43a242[_0xc9ed('0xb0')]);}if(_0x43a242[_0xc9ed('0xb1')]){if(_0x43a242[_0xc9ed('0xb1')][_0xc9ed('0xb2')][_0xc9ed('0x4d')]){return _0x43a242['List']['Contacts'][0x0];}else{return db[_0xc9ed('0xb3')]['create'](_['defaults'](_0x1ea5ac[_0xc9ed('0x5e')],{'firstName':_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0],'phone':_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0],'fax':_0x1ea5ac['body']['to'][0x0],'ListId':_0x43a242['ListId']}));}}else{throw new Error(_0xc9ed('0xb4'));}}else{throw new Error(_0xc9ed('0xb5'));}})[_0xc9ed('0x23')](function(_0x3cdbfb){if(_0x3cdbfb){return db['FaxInteraction']['find']({'where':{'ContactId':_0x3cdbfb['id'],'closed':![],'FaxAccountId':_0x43a242['id']}})[_0xc9ed('0x23')](function(_0x36a28d){if(_0x36a28d){return[_0x36a28d,![]];}return db[_0xc9ed('0x76')][_0xc9ed('0x5d')]({'UserId':_0x1ea5ac[_0xc9ed('0x5f')]['id'],'ContactId':_0x3cdbfb['id'],'FaxAccountId':_0x43a242['id'],'fax':_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0],'firstMsgDirection':_0xc9ed('0xb6'),'Messages':[_['merge'](_0x1ea5ac[_0xc9ed('0x5e')],{'read':![],'body':_0x1ea5ac[_0xc9ed('0x5e')]['attachments'][0x0][_0xc9ed('0xb7')],'FaxAccountId':_0x43a242['id'],'UserId':_0x1ea5ac[_0xc9ed('0x5f')]['id'],'ContactId':_0x3cdbfb['id'],'AttachmentId':_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0xc9ed('0xa4')],'as':'Messages'}]})[_0xc9ed('0x23')](function(_0x496131){return[_0x496131,!![]];});});}else{throw new Error(_0xc9ed('0xb8'));}})[_0xc9ed('0xb9')](function(_0x2b173e,_0x1e369e){if(_0x1e369e){return _0x2b173e;}return db['FaxMessage'][_0xc9ed('0x5d')]({'direction':'out','read':![],'body':_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][0x0][_0xc9ed('0xb7')],'FaxAccountId':_0x43a242['id'],'FaxInteractionId':_0x2b173e['id'],'UserId':_0x1ea5ac[_0xc9ed('0x5f')]['id'],'ContactId':_0x2b173e['ContactId'],'AttachmentId':_0x1ea5ac['body'][_0xc9ed('0xaa')][0x0]['id']})['then'](function(_0x5733d5){_0x2b173e['dataValues'][_0xc9ed('0xba')]=[];_0x2b173e[_0xc9ed('0xbb')][_0xc9ed('0xba')][_0xc9ed('0x8c')](_0x5733d5[_0xc9ed('0xbb')]);return _0x2b173e;});})['then'](function(_0x23b025){respondWithRpcPromise('SendFax',_0xc9ed('0xbc'),{'FaxAccountId':_[_0xc9ed('0xad')](_0x1ea5ac[_0xc9ed('0x5a')]['id'])?undefined:_0x1ea5ac[_0xc9ed('0x5a')]['id'],'path':_[_0xc9ed('0xad')](_0x1ea5ac['body'][_0xc9ed('0xaa')][0x0]['path'])?undefined:_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][0x0][_0xc9ed('0x7')],'fax':_[_0xc9ed('0xad')](_0x1ea5ac['body']['to'][0x0])?undefined:_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0],'AttachmentId':_0x1ea5ac['body']['attachments'][0x0]['id']},client9002)['then'](function(_0x4ba8c2){logger[_0xc9ed('0x24')](_0xc9ed('0xbd'),_0x4ba8c2);})['catch'](function(_0x5c195b){logger[_0xc9ed('0x24')](_0xc9ed('0xbd'),_0x5c195b);});return _0x23b025;})['then'](respondWithResult(_0x92aa3d,null))[_0xc9ed('0x2d')](handleError(_0x92aa3d,null));};exports['addAgents']=function(_0x492a8a,_0x502a9b,_0x331c8f){return db[_0xc9ed('0x41')]['find']({'where':{'id':_0x492a8a[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x502a9b,null))[_0xc9ed('0x23')](function(_0x4beb27){if(_0x4beb27){return _0x4beb27[_0xc9ed('0xbe')](_0x492a8a[_0xc9ed('0x5e')]['ids'],_[_0xc9ed('0x75')](_0x492a8a[_0xc9ed('0x5e')],['ids','id'])||{})[_0xc9ed('0xb9')](function(_0x4c9543){for(var _0x1a4d4f=0x0;_0x1a4d4f<_0x492a8a[_0xc9ed('0x5e')]['ids'][_0xc9ed('0x4d')];_0x1a4d4f+=0x1){socket['emit'](_0xc9ed('0xbf'),{'UserId':Number(_0x492a8a['body'][_0xc9ed('0x6d')][_0x1a4d4f]),'FaxAccountId':Number(_0x492a8a['params']['id'])});}return _0x4c9543;});}})[_0xc9ed('0x23')](respondWithResult(_0x502a9b,null))[_0xc9ed('0x2d')](handleError(_0x502a9b,null));};exports[_0xc9ed('0xc0')]=function(_0x36d1f5,_0x3e5409,_0x5cfc93){return db[_0xc9ed('0x41')]['find']({'where':{'id':_0x36d1f5['params']['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x3e5409,null))[_0xc9ed('0x23')](function(_0x3839ee){if(_0x3839ee){return _0x3839ee[_0xc9ed('0xc0')](_0x36d1f5['query']['ids'])['then'](function(){if(_['isArray'](_0x36d1f5[_0xc9ed('0x47')][_0xc9ed('0x6d')])){for(var _0x5aaa2d=0x0;_0x5aaa2d<_0x36d1f5[_0xc9ed('0x47')][_0xc9ed('0x6d')]['length'];_0x5aaa2d+=0x1){socket[_0xc9ed('0xc1')](_0xc9ed('0xc2'),{'UserId':Number(_0x36d1f5[_0xc9ed('0x47')]['ids'][_0x5aaa2d]),'FaxAccountId':Number(_0x36d1f5[_0xc9ed('0x5a')]['id'])});}}else{socket[_0xc9ed('0xc1')](_0xc9ed('0xc2'),{'UserId':Number(_0x36d1f5[_0xc9ed('0x47')][_0xc9ed('0x6d')]),'FaxAccountId':Number(_0x36d1f5[_0xc9ed('0x5a')]['id'])});}});}})[_0xc9ed('0x23')](respondWithStatusCode(_0x3e5409,null))[_0xc9ed('0x2d')](handleError(_0x3e5409,null));};exports[_0xc9ed('0xc3')]=function(_0x456da7,_0x12b26d,_0x2102ff){var _0x3e3d23={};var _0x32c8e7={};var _0x539623;var _0x24c803;return db['FaxAccount'][_0xc9ed('0x70')]({'where':{'id':_0x456da7[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x12b26d,null))[_0xc9ed('0x23')](function(_0x296109){if(_0x296109){_0x539623=_0x296109;_0x32c8e7[_0xc9ed('0x45')]=_['keys'](db['User'][_0xc9ed('0x69')]);_0x32c8e7[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x456da7[_0xc9ed('0x47')]);_0x32c8e7[_0xc9ed('0x49')]=_[_0xc9ed('0x4a')](_0x32c8e7[_0xc9ed('0x45')],_0x32c8e7[_0xc9ed('0x47')]);_0x3e3d23[_0xc9ed('0x4c')]=_['intersection'](_0x32c8e7[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x456da7[_0xc9ed('0x47')][_0xc9ed('0x4b')]));_0x3e3d23[_0xc9ed('0x4c')]=_0x3e3d23[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x3e3d23['attributes']:_0x32c8e7[_0xc9ed('0x45')];_0x3e3d23[_0xc9ed('0x72')]=qs[_0xc9ed('0x50')](_0x456da7[_0xc9ed('0x47')][_0xc9ed('0x50')]);_0x3e3d23[_0xc9ed('0x51')]=qs[_0xc9ed('0x49')](_['pick'](_0x456da7[_0xc9ed('0x47')],_0x32c8e7[_0xc9ed('0x49')]));if(_0x456da7[_0xc9ed('0x47')]['filter']){_0x3e3d23[_0xc9ed('0x51')]=_['merge'](_0x3e3d23[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x3e3d23[_0xc9ed('0x4c')],function(_0x7180fb){var _0x2c50bc={};_0x2c50bc[_0x7180fb]={'$like':'%'+_0x456da7[_0xc9ed('0x47')][_0xc9ed('0x52')]+'%'};return _0x2c50bc;})});}_0x3e3d23=_['merge']({},_0x3e3d23,_0x456da7[_0xc9ed('0x55')]);return _0x539623[_0xc9ed('0xc3')](_0x3e3d23);}})['then'](function(_0x56e7ef){if(_0x56e7ef){_0x24c803=_0x56e7ef['length'];if(!_0x456da7[_0xc9ed('0x47')][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x3e3d23[_0xc9ed('0x35')]=qs[_0xc9ed('0x35')](_0x456da7[_0xc9ed('0x47')]['limit']);_0x3e3d23[_0xc9ed('0x32')]=qs[_0xc9ed('0x32')](_0x456da7[_0xc9ed('0x47')]['offset']);}return _0x539623[_0xc9ed('0xc3')](_0x3e3d23);}})['then'](function(_0x179a97){if(_0x179a97){return _0x179a97?{'count':_0x24c803,'rows':_0x179a97}:null;}})[_0xc9ed('0x23')](respondWithResult(_0x12b26d,null))[_0xc9ed('0x2d')](handleError(_0x12b26d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 496621a..9c620b8 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 _0xfa89=['update','emit','hasOwnProperty','hook','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x8d3f30,_0x4ff433){var _0x385596=function(_0x35d874){while(--_0x35d874){_0x8d3f30['push'](_0x8d3f30['shift']());}};_0x385596(++_0x4ff433);}(_0xfa89,0x64));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x9fa8('0x0'))['db'][_0x9fa8('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9fa8('0x2')](0x0);var events={'afterCreate':_0x9fa8('0x3'),'afterUpdate':_0x9fa8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f17dd){return function(_0x44d00b,_0x6c9a9f,_0x1c3e22){FaxAccountEvents[_0x9fa8('0x5')](_0x2f17dd+':'+_0x44d00b['id'],_0x44d00b);FaxAccountEvents[_0x9fa8('0x5')](_0x2f17dd,_0x44d00b);_0x1c3e22(null);};}for(var e in events){if(events[_0x9fa8('0x6')](e)){var event=events[e];FaxAccount[_0x9fa8('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x8294=['../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0x243d1d,_0x411c28){var _0x2c1abc=function(_0x245bd0){while(--_0x245bd0){_0x243d1d['push'](_0x243d1d['shift']());}};_0x2c1abc(++_0x411c28);}(_0x8294,0x1c6));var _0x4829=function(_0x10eef5,_0x440eb8){_0x10eef5=_0x10eef5-0x0;var _0x4981b0=_0x8294[_0x10eef5];return _0x4981b0;};'use strict';var EventEmitter=require(_0x4829('0x0'));var FaxAccount=require(_0x4829('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4829('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4829('0x3')};function emitEvent(_0x31c3ac){return function(_0x27a714,_0x494a7d,_0x1cbde3){FaxAccountEvents['emit'](_0x31c3ac+':'+_0x27a714['id'],_0x27a714);FaxAccountEvents[_0x4829('0x4')](_0x31c3ac,_0x27a714);_0x1cbde3(null);};}for(var e in events){if(events[_0x4829('0x5')](e)){var event=events[e];FaxAccount[_0x4829('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 25980ed..80feda4 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 _0x25e3=['path','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x25e58e,_0x563989){var _0x133279=function(_0x45fcd9){while(--_0x45fcd9){_0x25e58e['push'](_0x25e58e['shift']());}};_0x133279(++_0x563989);}(_0x25e3,0x125));var _0x325e=function(_0x53e72f,_0x196c4f){_0x53e72f=_0x53e72f-0x0;var _0x307b1a=_0x25e3[_0x53e72f];return _0x307b1a;};'use strict';var _=require(_0x325e('0x0'));var util=require(_0x325e('0x1'));var logger=require('../../config/logger')(_0x325e('0x2'));var moment=require(_0x325e('0x3'));var BPromise=require(_0x325e('0x4'));var rp=require(_0x325e('0x5'));var fs=require('fs');var path=require(_0x325e('0x6'));var rimraf=require('rimraf');var config=require(_0x325e('0x7'));var attributes=require(_0x325e('0x8'));module[_0x325e('0x9')]=function(_0x1b2d19,_0x491782){return _0x1b2d19[_0x325e('0xa')](_0x325e('0xb'),attributes,{'tableName':_0x325e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fa0=['fax_accounts','lodash','util','api','moment','bluebird','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x266599,_0x3edbee){var _0x12ac8a=function(_0x42ed59){while(--_0x42ed59){_0x266599['push'](_0x266599['shift']());}};_0x12ac8a(++_0x3edbee);}(_0x8fa0,0xd3));var _0x08fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8fa0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x08fa('0x0'));var util=require(_0x08fa('0x1'));var logger=require('../../config/logger')(_0x08fa('0x2'));var moment=require(_0x08fa('0x3'));var BPromise=require(_0x08fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x08fa('0x5'));var attributes=require(_0x08fa('0x6'));module[_0x08fa('0x7')]=function(_0x5cdcc4,_0x31182e){return _0x5cdcc4[_0x08fa('0x8')]('FaxAccount',attributes,{'tableName':_0x08fa('0x9'),'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 29f1081..f2a701d 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 _0x9c20=['from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','asc','length','defaults','create','FaxInteraction','close','unmanaged','created','interaction','FaxMessage','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','findAll','options','raw','attributes','limit','include','model','map','debug','catch','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0x9c20,0xcd));var _0x09c2=function(_0x3ff811,_0x5be877){_0x3ff811=_0x3ff811-0x0;var _0x326566=_0x9c20[_0x3ff811];return _0x326566;};'use strict';var _=require(_0x09c2('0x0'));var util=require('util');var moment=require(_0x09c2('0x1'));var BPromise=require('bluebird');var rs=require(_0x09c2('0x2'));var fs=require('fs');var Redis=require(_0x09c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c2('0x4'));var logger=require('../../config/logger')(_0x09c2('0x5'));var config=require(_0x09c2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x09c2('0x7')][_0x09c2('0x8')]({'port':0x232c});config['redis']=_['defaults'](config[_0x09c2('0x9')],{'host':_0x09c2('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x09c2('0x9')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4e6ff1,_0x27109e,_0x1f1f32){return new BPromise(function(_0x53d0b5,_0x1345b0){return client[_0x09c2('0xb')](_0x4e6ff1,_0x1f1f32)[_0x09c2('0xc')](function(_0x541fd0){logger[_0x09c2('0xd')](_0x09c2('0xe'),_0x27109e,_0x09c2('0xf'));logger['debug'](_0x09c2('0x10'),_0x27109e,_0x09c2('0xf'),JSON[_0x09c2('0x11')](_0x541fd0));if(_0x541fd0[_0x09c2('0x12')]){if(_0x541fd0[_0x09c2('0x12')][_0x09c2('0x13')]===0x1f4){logger[_0x09c2('0x12')](_0x09c2('0xe'),_0x27109e,_0x541fd0[_0x09c2('0x12')][_0x09c2('0x14')]);return _0x1345b0(_0x541fd0[_0x09c2('0x12')][_0x09c2('0x14')]);}logger['error'](_0x09c2('0xe'),_0x27109e,_0x541fd0[_0x09c2('0x12')][_0x09c2('0x14')]);return _0x53d0b5(_0x541fd0[_0x09c2('0x12')][_0x09c2('0x14')]);}else{logger[_0x09c2('0xd')](_0x09c2('0xe'),_0x27109e,_0x09c2('0xf'));_0x53d0b5(_0x541fd0[_0x09c2('0x15')][_0x09c2('0x14')]);}})['catch'](function(_0x59b177){logger['error'](_0x09c2('0xe'),_0x27109e,_0x59b177);_0x1345b0(_0x59b177);});});}exports[_0x09c2('0x16')]=function(_0x5dbb5d){var _0x2582ff=this;return new Promise(function(_0x361951,_0x52b8f1){return db['FaxAccount'][_0x09c2('0x17')]({'raw':_0x5dbb5d[_0x09c2('0x18')]?_0x5dbb5d['options'][_0x09c2('0x19')]===undefined?!![]:![]:!![],'where':_0x5dbb5d['options']?_0x5dbb5d['options']['where']||null:null,'attributes':_0x5dbb5d['options']?_0x5dbb5d[_0x09c2('0x18')][_0x09c2('0x1a')]||null:null,'limit':_0x5dbb5d[_0x09c2('0x18')]?_0x5dbb5d[_0x09c2('0x18')][_0x09c2('0x1b')]||null:null,'include':_0x5dbb5d[_0x09c2('0x18')]?_0x5dbb5d[_0x09c2('0x18')][_0x09c2('0x1c')]?_['map'](_0x5dbb5d[_0x09c2('0x18')][_0x09c2('0x1c')],function(_0x49c05e){return{'model':db[_0x49c05e[_0x09c2('0x1d')]],'as':_0x49c05e['as'],'attributes':_0x49c05e['attributes'],'include':_0x49c05e[_0x09c2('0x1c')]?_['map'](_0x49c05e[_0x09c2('0x1c')],function(_0x1c70e8){return{'model':db[_0x1c70e8[_0x09c2('0x1d')]],'as':_0x1c70e8['as'],'attributes':_0x1c70e8[_0x09c2('0x1a')],'include':_0x1c70e8[_0x09c2('0x1c')]?_[_0x09c2('0x1e')](_0x1c70e8['include'],function(_0x5b7c5c){return{'model':db[_0x5b7c5c[_0x09c2('0x1d')]],'as':_0x5b7c5c['as'],'attributes':_0x5b7c5c[_0x09c2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x09c2('0xc')](function(_0x5d39a8){logger['info'](_0x09c2('0x16'),_0x5dbb5d);logger[_0x09c2('0x1f')](_0x09c2('0x16'),_0x5dbb5d,JSON[_0x09c2('0x11')](_0x5d39a8));_0x361951(_0x5d39a8);})[_0x09c2('0x20')](function(_0x1a4977){logger['error']('GetFaxAccount',_0x1a4977[_0x09c2('0x14')],_0x5dbb5d);_0x52b8f1(_0x2582ff[_0x09c2('0x12')](0x1f4,_0x1a4977[_0x09c2('0x14')]));});});};exports[_0x09c2('0x21')]=function(_0x375f3a,_0x153c0a,_0x387b43){var _0x1cdde6=this;return new Promise(function(_0x56980b,_0x306254){var _0x2f8b01={'body':_0x375f3a[_0x09c2('0x22')],'channel':_0x09c2('0x23')};var _0x49df58=[];var _0x4cfcb1=[];var _0x31081e={};return db['CmContact'][_0x09c2('0x24')]()['then'](function(_0x5d984f){if(!_0x5d984f){throw new db[(_0x09c2('0x25'))][(_0x09c2('0x26'))](_0x09c2('0x27'));}_0x49df58=_[_0x09c2('0x28')](_['keys'](_0x5d984f),['createdAt',_0x09c2('0x29')]);_0x4cfcb1=_[_0x09c2('0x28')](_['keys'](_0x5d984f),[_0x09c2('0x2a'),_0x09c2('0x29'),_0x09c2('0x2b'),_0x09c2('0x2c')]);if(_0x375f3a['body']['id']){delete _0x375f3a[_0x09c2('0x22')]['id'];}if(_[_0x09c2('0x2d')](_0x375f3a[_0x09c2('0x22')][_0x09c2('0x2e')])){throw new db['Sequelize']['ValidationError'](_0x09c2('0x2f'));}if(_[_0x09c2('0x2d')](_0x375f3a[_0x09c2('0x22')][_0x09c2('0x22')])||_0x375f3a[_0x09c2('0x22')][_0x09c2('0x22')]===''){throw new db[(_0x09c2('0x25'))]['ValidationError'](_0x09c2('0x30'));}if(_[_0x09c2('0x2d')](_0x375f3a['body'][_0x09c2('0x31')])){throw new db['Sequelize'][(_0x09c2('0x26'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4cfcb1);}if(!_[_0x09c2('0x32')](_0x4cfcb1,_0x375f3a[_0x09c2('0x22')][_0x09c2('0x31')])){throw new db['Sequelize'][(_0x09c2('0x26'))](_0x09c2('0x33')+_0x4cfcb1);}_0x31081e[_0x375f3a[_0x09c2('0x22')][_0x09c2('0x31')]]=_0x375f3a[_0x09c2('0x22')][_0x09c2('0x2e')];})[_0x09c2('0xc')](function(){return db[_0x09c2('0x34')][_0x09c2('0x35')]({'where':{'id':_0x375f3a[_0x09c2('0x36')]['id']},'include':[{'model':db['CmList'],'as':_0x09c2('0x37'),'include':[{'model':db[_0x09c2('0x38')],'as':_0x09c2('0x39'),'where':_0x31081e,'limit':0x1,'order':[['updatedAt',_0x09c2('0x3a')]]}]},{'model':db[_0x09c2('0x3b')],'as':_0x09c2('0x3c')}]});})[_0x09c2('0xc')](function(_0x13523a){if(_0x13523a&&_0x13523a[_0x09c2('0x37')]){var _0x32cbfd=_0x13523a[_0x09c2('0x3d')]({'plain':!![]});_0x2f8b01['account']=_0x32cbfd;_0x2f8b01['applications']=_0x32cbfd['Applications'];_0x2f8b01[_0x09c2('0x3e')]=_0x32cbfd[_0x09c2('0x37')];_0x2f8b01[_0x09c2('0x3f')]=_[_0x09c2('0x40')](_0x2f8b01[_0x09c2('0x3f')],['priority'],[_0x09c2('0x41')]);if(_0x2f8b01['account'][_0x09c2('0x3c')]){delete _0x2f8b01[_0x09c2('0x36')][_0x09c2('0x3c')];}if(_0x2f8b01[_0x09c2('0x36')]['List']&&_0x2f8b01[_0x09c2('0x36')][_0x09c2('0x37')][_0x09c2('0x39')][_0x09c2('0x42')]){return _0x2f8b01[_0x09c2('0x36')][_0x09c2('0x37')][_0x09c2('0x39')][0x0];}var _0x3fe893=_[_0x09c2('0x43')](_0x375f3a[_0x09c2('0x22')],{'firstName':_0x375f3a['body'][_0x09c2('0x2e')],'ListId':_0x32cbfd[_0x09c2('0x2c')]});_0x3fe893[_0x375f3a[_0x09c2('0x22')]['mapKey']]=_0x375f3a[_0x09c2('0x22')][_0x09c2('0x2e')];return db[_0x09c2('0x38')][_0x09c2('0x44')](_0x3fe893,{'fields':_0x49df58,'raw':!![]});}})[_0x09c2('0xc')](function(_0x3243d1){_0x2f8b01['contact']=_0x3243d1;if(_0x3243d1){var _0x3cf784={'ContactId':_0x3243d1['id'],'FaxAccountId':_0x375f3a[_0x09c2('0x36')]['id'],'fax':_0x3243d1[_0x09c2('0x23')]};return db[_0x09c2('0x45')][_0x09c2('0x35')]({'where':{'ContactId':_0x3243d1['id'],'closed':![],'FaxAccountId':_0x375f3a[_0x09c2('0x36')]['id']}})['then'](function(_0x16f6c9){if(_0x16f6c9){return[_0x16f6c9,![]];}return db['FaxInteraction']['create'](_0x3cf784)['then'](function(_0x170723){return[_0x170723,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x207968,_0x5e40b1){var _0x4764ae=_0x207968['get']({'plain':!![]});if(_0x5e40b1){if(_0x2f8b01['account']['autoclose']){_0x2f8b01['applications']['push']({'id':0x0,'priority':_0x2f8b01[_0x09c2('0x3f')][_0x09c2('0x42')]+0x1,'app':_0x09c2('0x46'),'appdata':_0x09c2('0x47'),'interval':'*,*,*,*'});}_0x4764ae[_0x09c2('0x48')]=!![];}else{_0x4764ae[_0x09c2('0x48')]=![];}_0x2f8b01[_0x09c2('0x49')]=_0x4764ae;return db[_0x09c2('0x4a')][_0x09c2('0x44')]({'body':_0x375f3a['body'][_0x09c2('0x22')],'FaxAccountId':_0x375f3a[_0x09c2('0x36')]['id'],'FaxInteractionId':_0x207968['id'],'direction':'in','ContactId':_0x207968['ContactId'],'AttachmentId':_0x375f3a[_0x09c2('0x22')][_0x09c2('0x4b')]});})[_0x09c2('0xc')](function(_0x5d9fc5){_0x2f8b01['message']=_0x5d9fc5;if(_0x2f8b01[_0x09c2('0x49')][_0x09c2('0x4c')]){return db['User'][_0x09c2('0x35')]({'attributes':['id','name'],'where':{'id':_0x2f8b01[_0x09c2('0x49')][_0x09c2('0x4c')]}})['then'](function(_0x2de19d){if(_0x2de19d){_0x2f8b01[_0x09c2('0x3f')][_0x09c2('0x4d')]({'id':0x0,'priority':0x0,'app':_0x09c2('0x4e'),'appdata':_0x2de19d[_0x09c2('0x4f')]+','+(_0x2f8b01[_0x09c2('0x36')][_0x09c2('0x50')]||0xa),'interval':_0x09c2('0x51')});}return respondWithRpcPromise(_0x09c2('0x52'),_0x09c2('0x53'),_0x2f8b01);});}return respondWithRpcPromise(_0x09c2('0x52'),'startRouting',_0x2f8b01);})['then'](function(_0x51259e){_0x56980b(_0x51259e);})[_0x09c2('0x20')](function(_0x28677f){_0x306254(_0x1cdde6[_0x09c2('0x12')](0x1f4,_0x28677f[_0x09c2('0x14')]));});});}; \ No newline at end of file +var _0x82b8=['NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','difference','createdAt','keys','updatedAt','CompanyId','isNil','from','Sequelize','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','find','account','CmList','List','Contacts','DESC','Applications','get','applications','list','orderBy','priority','ListId','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','create','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','FaxAccount','options','attributes','include','model','map','GetFaxAccount','stringify','catch'];(function(_0x3d6785,_0x492ea3){var _0x39a624=function(_0x27d7db){while(--_0x27d7db){_0x3d6785['push'](_0x3d6785['shift']());}};_0x39a624(++_0x492ea3);}(_0x82b8,0x93));var _0x882b=function(_0x1bd627,_0x4a0d53){_0x1bd627=_0x1bd627-0x0;var _0x58b7a2=_0x82b8[_0x1bd627];return _0x58b7a2;};'use strict';var _=require('lodash');var util=require(_0x882b('0x0'));var moment=require(_0x882b('0x1'));var BPromise=require(_0x882b('0x2'));var rs=require(_0x882b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x882b('0x4'));var logger=require(_0x882b('0x5'))('rpc');var config=require(_0x882b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x882b('0x7')][_0x882b('0x8')]({'port':0x232c});config[_0x882b('0x9')]=_[_0x882b('0xa')](config[_0x882b('0x9')],{'host':_0x882b('0xb'),'port':0x18eb});var socket=require(_0x882b('0xc'))(new Redis(config['redis']));require(_0x882b('0xd'))['register'](socket);function respondWithRpcPromise(_0x1c37b3,_0x53d79b,_0x410b71){return new BPromise(function(_0x4dee96,_0x35f8d7){return client['request'](_0x1c37b3,_0x410b71)[_0x882b('0xe')](function(_0x143d00){logger[_0x882b('0xf')](_0x882b('0x10'),_0x53d79b,_0x882b('0x11'));logger[_0x882b('0x12')](_0x882b('0x13'),_0x53d79b,_0x882b('0x11'),JSON['stringify'](_0x143d00));if(_0x143d00[_0x882b('0x14')]){if(_0x143d00[_0x882b('0x14')][_0x882b('0x15')]===0x1f4){logger[_0x882b('0x14')](_0x882b('0x10'),_0x53d79b,_0x143d00[_0x882b('0x14')][_0x882b('0x16')]);return _0x35f8d7(_0x143d00[_0x882b('0x14')]['message']);}logger['error'](_0x882b('0x10'),_0x53d79b,_0x143d00[_0x882b('0x14')][_0x882b('0x16')]);return _0x4dee96(_0x143d00['error']['message']);}else{logger[_0x882b('0xf')]('FaxAccount,\x20%s,\x20%s',_0x53d79b,_0x882b('0x11'));_0x4dee96(_0x143d00[_0x882b('0x17')][_0x882b('0x16')]);}})['catch'](function(_0x1a1a63){logger[_0x882b('0x14')]('FaxAccount,\x20%s,\x20%s',_0x53d79b,_0x1a1a63);_0x35f8d7(_0x1a1a63);});});}exports['GetFaxAccount']=function(_0x344080){var _0x439c9e=this;return new Promise(function(_0x5381ae,_0x39f80f){return db[_0x882b('0x18')]['findAll']({'raw':_0x344080['options']?_0x344080['options']['raw']===undefined?!![]:![]:!![],'where':_0x344080[_0x882b('0x19')]?_0x344080['options']['where']||null:null,'attributes':_0x344080['options']?_0x344080['options'][_0x882b('0x1a')]||null:null,'limit':_0x344080['options']?_0x344080[_0x882b('0x19')]['limit']||null:null,'include':_0x344080[_0x882b('0x19')]?_0x344080[_0x882b('0x19')][_0x882b('0x1b')]?_['map'](_0x344080[_0x882b('0x19')][_0x882b('0x1b')],function(_0x1dd760){return{'model':db[_0x1dd760[_0x882b('0x1c')]],'as':_0x1dd760['as'],'attributes':_0x1dd760[_0x882b('0x1a')],'include':_0x1dd760['include']?_[_0x882b('0x1d')](_0x1dd760[_0x882b('0x1b')],function(_0x5df45b){return{'model':db[_0x5df45b[_0x882b('0x1c')]],'as':_0x5df45b['as'],'attributes':_0x5df45b['attributes'],'include':_0x5df45b[_0x882b('0x1b')]?_[_0x882b('0x1d')](_0x5df45b[_0x882b('0x1b')],function(_0x147027){return{'model':db[_0x147027[_0x882b('0x1c')]],'as':_0x147027['as'],'attributes':_0x147027[_0x882b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x882b('0xe')](function(_0x3b4524){logger[_0x882b('0xf')]('GetFaxAccount',_0x344080);logger[_0x882b('0x12')](_0x882b('0x1e'),_0x344080,JSON[_0x882b('0x1f')](_0x3b4524));_0x5381ae(_0x3b4524);})[_0x882b('0x20')](function(_0x2c91f6){logger['error'](_0x882b('0x1e'),_0x2c91f6[_0x882b('0x16')],_0x344080);_0x39f80f(_0x439c9e['error'](0x1f4,_0x2c91f6[_0x882b('0x16')]));});});};exports[_0x882b('0x21')]=function(_0xfc935f,_0x5391f5,_0x522232){var _0x337624=this;return new Promise(function(_0x142572,_0x47d4ff){var _0x200414={'body':_0xfc935f[_0x882b('0x22')],'channel':_0x882b('0x23')};var _0x3af1ff=[];var _0x181d4a=[];var _0x25438d={};return db[_0x882b('0x24')][_0x882b('0x25')]()[_0x882b('0xe')](function(_0x3ec174){if(!_0x3ec174){throw new db['Sequelize'][(_0x882b('0x26'))]('no\x20available\x20attributes');}_0x3af1ff=_[_0x882b('0x27')](_['keys'](_0x3ec174),[_0x882b('0x28'),'updatedAt']);_0x181d4a=_[_0x882b('0x27')](_[_0x882b('0x29')](_0x3ec174),[_0x882b('0x28'),_0x882b('0x2a'),_0x882b('0x2b'),'ListId']);if(_0xfc935f[_0x882b('0x22')]['id']){delete _0xfc935f[_0x882b('0x22')]['id'];}if(_[_0x882b('0x2c')](_0xfc935f['body'][_0x882b('0x2d')])){throw new db[(_0x882b('0x2e'))]['ValidationError'](_0x882b('0x2f'));}if(_[_0x882b('0x2c')](_0xfc935f['body'][_0x882b('0x22')])||_0xfc935f[_0x882b('0x22')][_0x882b('0x22')]===''){throw new db[(_0x882b('0x2e'))]['ValidationError'](_0x882b('0x30'));}if(_[_0x882b('0x2c')](_0xfc935f[_0x882b('0x22')]['mapKey'])){throw new db[(_0x882b('0x2e'))][(_0x882b('0x26'))](_0x882b('0x31')+_0x181d4a);}if(!_[_0x882b('0x32')](_0x181d4a,_0xfc935f[_0x882b('0x22')][_0x882b('0x33')])){throw new db['Sequelize']['ValidationError'](_0x882b('0x34')+_0x181d4a);}_0x25438d[_0xfc935f['body'][_0x882b('0x33')]]=_0xfc935f[_0x882b('0x22')][_0x882b('0x2d')];})[_0x882b('0xe')](function(){return db['FaxAccount'][_0x882b('0x35')]({'where':{'id':_0xfc935f[_0x882b('0x36')]['id']},'include':[{'model':db[_0x882b('0x37')],'as':_0x882b('0x38'),'include':[{'model':db[_0x882b('0x24')],'as':_0x882b('0x39'),'where':_0x25438d,'limit':0x1,'order':[[_0x882b('0x2a'),_0x882b('0x3a')]]}]},{'model':db['FaxApplication'],'as':_0x882b('0x3b')}]});})[_0x882b('0xe')](function(_0x4d0517){if(_0x4d0517&&_0x4d0517[_0x882b('0x38')]){var _0x48df0f=_0x4d0517[_0x882b('0x3c')]({'plain':!![]});_0x200414[_0x882b('0x36')]=_0x48df0f;_0x200414[_0x882b('0x3d')]=_0x48df0f[_0x882b('0x3b')];_0x200414[_0x882b('0x3e')]=_0x48df0f[_0x882b('0x38')];_0x200414['applications']=_[_0x882b('0x3f')](_0x200414[_0x882b('0x3d')],[_0x882b('0x40')],['asc']);if(_0x200414[_0x882b('0x36')][_0x882b('0x3b')]){delete _0x200414[_0x882b('0x36')][_0x882b('0x3b')];}if(_0x200414[_0x882b('0x36')][_0x882b('0x38')]&&_0x200414['account'][_0x882b('0x38')][_0x882b('0x39')]['length']){return _0x200414[_0x882b('0x36')][_0x882b('0x38')]['Contacts'][0x0];}var _0x1917cc=_['defaults'](_0xfc935f[_0x882b('0x22')],{'firstName':_0xfc935f['body'][_0x882b('0x2d')],'ListId':_0x48df0f[_0x882b('0x41')]});_0x1917cc[_0xfc935f[_0x882b('0x22')][_0x882b('0x33')]]=_0xfc935f[_0x882b('0x22')][_0x882b('0x2d')];return db['CmContact']['create'](_0x1917cc,{'fields':_0x3af1ff,'raw':!![]});}})['then'](function(_0x4415ac){_0x200414[_0x882b('0x42')]=_0x4415ac;if(_0x4415ac){var _0x53451d={'ContactId':_0x4415ac['id'],'FaxAccountId':_0xfc935f[_0x882b('0x36')]['id'],'fax':_0x4415ac['fax']};return db[_0x882b('0x43')][_0x882b('0x35')]({'where':{'ContactId':_0x4415ac['id'],'closed':![],'FaxAccountId':_0xfc935f['account']['id']}})[_0x882b('0xe')](function(_0x1126d5){if(_0x1126d5){return[_0x1126d5,![]];}return db[_0x882b('0x43')]['create'](_0x53451d)['then'](function(_0x12fecb){return[_0x12fecb,!![]];});});}else{throw new Error(_0x882b('0x44'));}})[_0x882b('0x45')](function(_0x21c1dd,_0x56c356){var _0x55fa93=_0x21c1dd[_0x882b('0x3c')]({'plain':!![]});if(_0x56c356){if(_0x200414['account'][_0x882b('0x46')]){_0x200414[_0x882b('0x3d')][_0x882b('0x47')]({'id':0x0,'priority':_0x200414['applications'][_0x882b('0x48')]+0x1,'app':_0x882b('0x49'),'appdata':_0x882b('0x4a'),'interval':_0x882b('0x4b')});}_0x55fa93[_0x882b('0x4c')]=!![];}else{_0x55fa93[_0x882b('0x4c')]=![];}_0x200414[_0x882b('0x4d')]=_0x55fa93;return db[_0x882b('0x4e')][_0x882b('0x4f')]({'body':_0xfc935f['body'][_0x882b('0x22')],'FaxAccountId':_0xfc935f[_0x882b('0x36')]['id'],'FaxInteractionId':_0x21c1dd['id'],'direction':'in','ContactId':_0x21c1dd[_0x882b('0x50')],'AttachmentId':_0xfc935f[_0x882b('0x22')][_0x882b('0x51')]});})[_0x882b('0xe')](function(_0x54f985){_0x200414[_0x882b('0x16')]=_0x54f985;if(_0x200414['interaction'][_0x882b('0x52')]){return db[_0x882b('0x53')][_0x882b('0x35')]({'attributes':['id',_0x882b('0x54')],'where':{'id':_0x200414[_0x882b('0x4d')][_0x882b('0x52')]}})[_0x882b('0xe')](function(_0x4c7c08){if(_0x4c7c08){_0x200414[_0x882b('0x3d')][_0x882b('0x55')]({'id':0x0,'priority':0x0,'app':_0x882b('0x56'),'appdata':_0x4c7c08[_0x882b('0x54')]+','+(_0x200414[_0x882b('0x36')][_0x882b('0x57')]||0xa),'interval':_0x882b('0x4b')});}return respondWithRpcPromise(_0x882b('0x58'),_0x882b('0x59'),_0x200414);});}return respondWithRpcPromise(_0x882b('0x58'),_0x882b('0x59'),_0x200414);})[_0x882b('0xe')](function(_0x103096){_0x142572(_0x103096);})[_0x882b('0x20')](function(_0x548988){_0x47d4ff(_0x337624[_0x882b('0x14')](0x1f4,_0x548988[_0x882b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index af83ba8..803d935 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 _0x94e9=['faxAccount:','remove','emit','removeListener'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x94e9,0x14d));var _0x994e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x94e9[_0x47e7cb];return _0x2a8874;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0x994e('0x0'),'update'];function createListener(_0x3047b0,_0x3edfd6){return function(_0x4739c4){_0x3edfd6[_0x994e('0x1')](_0x3047b0,_0x4739c4);};}function removeListener(_0x190cc3,_0x278a3c){return function(){FaxAccountEvents[_0x994e('0x2')](_0x190cc3,_0x278a3c);};}exports['register']=function(_0xedb24a){for(var _0x4b393d=0x0,_0x4a6bbb=events['length'];_0x4b393d<_0x4a6bbb;_0x4b393d++){var _0x165280=events[_0x4b393d];var _0x3a4c9c=createListener(_0x994e('0x3')+_0x165280,_0xedb24a);FaxAccountEvents['on'](_0x165280,_0x3a4c9c);}}; \ No newline at end of file +var _0xc190=['register','length','faxAccount:','./faxAccount.events','remove','update','removeListener'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0xc190,0x161));var _0x0c19=function(_0x355957,_0x42692c){_0x355957=_0x355957-0x0;var _0x27bbed=_0xc190[_0x355957];return _0x27bbed;};'use strict';var FaxAccountEvents=require(_0x0c19('0x0'));var events=['save',_0x0c19('0x1'),_0x0c19('0x2')];function createListener(_0x35317b,_0xdf02e3){return function(_0x179a95){_0xdf02e3['emit'](_0x35317b,_0x179a95);};}function removeListener(_0x26354c,_0x356cae){return function(){FaxAccountEvents[_0x0c19('0x3')](_0x26354c,_0x356cae);};}exports[_0x0c19('0x4')]=function(_0x587047){for(var _0x32f5fb=0x0,_0x19eb3d=events[_0x0c19('0x5')];_0x32f5fb<_0x19eb3d;_0x32f5fb++){var _0x20bb69=events[_0x32f5fb];var _0x12dfdf=createListener(_0x0c19('0x6')+_0x20bb69,_0x587047);FaxAccountEvents['on'](_0x20bb69,_0x12dfdf);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 90c37aa..5554367 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(_0x233369,_0x5be2c9){var _0x40a709=function(_0x10bfcd){while(--_0x10bfcd){_0x233369['push'](_0x233369['shift']());}};_0x40a709(++_0x5be2c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/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(_0x1c47d7,_0x58b64c){var _0x15f013=function(_0x13ccb3){while(--_0x13ccb3){_0x1c47d7['push'](_0x1c47d7['shift']());}};_0x15f013(++_0x58b64c);}(_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'));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 3dbb395..23ca2a3 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 _0x547c=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x547c,0x13b));var _0xc547=function(_0x5a7bd6,_0x3ed838){_0x5a7bd6=_0x5a7bd6-0x0;var _0x490f39=_0x547c[_0x5a7bd6];return _0x490f39;};'use strict';var Sequelize=require('sequelize');module[_0xc547('0x0')]={'priority':{'type':Sequelize[_0xc547('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc547('0x2')],'allowNull':![],'defaultValue':_0xc547('0x3')},'appdata':{'type':Sequelize[_0xc547('0x4')]()},'description':{'type':Sequelize[_0xc547('0x2')]},'interval':{'type':Sequelize[_0xc547('0x2')],'defaultValue':_0xc547('0x5')}}; \ No newline at end of file +var _0xef36=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0xef36,0xc6));var _0x6ef3=function(_0x4e9b51,_0x23e0a6){_0x4e9b51=_0x4e9b51-0x0;var _0x5a5550=_0xef36[_0x4e9b51];return _0x5a5550;};'use strict';var Sequelize=require(_0x6ef3('0x0'));module[_0x6ef3('0x1')]={'priority':{'type':Sequelize[_0x6ef3('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ef3('0x3')},'appdata':{'type':Sequelize[_0x6ef3('0x4')]()},'description':{'type':Sequelize[_0x6ef3('0x5')]},'interval':{'type':Sequelize[_0x6ef3('0x5')],'defaultValue':_0x6ef3('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 43b0de5..d75c189 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 _0x38dc=['rawAttributes','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','save','update','then','destroy','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','limit','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x38dc,0x11a));var _0xc38d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x38dc[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xc38d('0x0'));var rimraf=require(_0xc38d('0x1'));var zipdir=require(_0xc38d('0x2'));var jsonpatch=require(_0xc38d('0x3'));var rp=require(_0xc38d('0x4'));var moment=require(_0xc38d('0x5'));var BPromise=require(_0xc38d('0x6'));var Mustache=require(_0xc38d('0x7'));var util=require(_0xc38d('0x8'));var path=require(_0xc38d('0x9'));var sox=require(_0xc38d('0xa'));var csv=require(_0xc38d('0xb'));var ejs=require(_0xc38d('0xc'));var fs=require('fs');var fs_extra=require(_0xc38d('0xd'));var _=require('lodash');var squel=require(_0xc38d('0xe'));var crypto=require(_0xc38d('0xf'));var jsforce=require(_0xc38d('0x10'));var deskjs=require(_0xc38d('0x11'));var toCsv=require(_0xc38d('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc38d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc38d('0x13'));var logger=require('../../config/logger')(_0xc38d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc38d('0x15'));var db=require(_0xc38d('0x16'))['db'];function respondWithStatusCode(_0x4ef258,_0x2df8df){_0x2df8df=_0x2df8df||0xcc;return function(_0x10a87e){if(_0x10a87e){return _0x4ef258[_0xc38d('0x17')](_0x2df8df);}return _0x4ef258[_0xc38d('0x18')](_0x2df8df)[_0xc38d('0x19')]();};}function respondWithResult(_0x5ec506,_0x3e76e1){_0x3e76e1=_0x3e76e1||0xc8;return function(_0x306563){if(_0x306563){return _0x5ec506[_0xc38d('0x18')](_0x3e76e1)['json'](_0x306563);}};}function respondWithFilteredResult(_0x5d45cb,_0x4b6d7e){return function(_0x1dd4d9){if(_0x1dd4d9){var _0x4794d0=typeof _0x4b6d7e[_0xc38d('0x1a')]===_0xc38d('0x1b')&&typeof _0x4b6d7e['limit']===_0xc38d('0x1b');var _0x302f9d=_0x1dd4d9['count'];var _0x2171d0=_0x4794d0?0x0:_0x4b6d7e['offset'];var _0xdd9979=_0x4794d0?_0x1dd4d9['count']:_0x4b6d7e[_0xc38d('0x1a')]+_0x4b6d7e['limit'];var _0x2832a9;if(_0xdd9979>=_0x302f9d){_0xdd9979=_0x302f9d;_0x2832a9=0xc8;}else{_0x2832a9=0xce;}_0x5d45cb[_0xc38d('0x18')](_0x2832a9);return _0x5d45cb['set']('Content-Range',_0x2171d0+'-'+_0xdd9979+'/'+_0x302f9d)['json'](_0x1dd4d9);}return null;};}function patchUpdates(_0x1a2a66){return function(_0x5a67b7){try{jsonpatch['apply'](_0x5a67b7,_0x1a2a66,!![]);}catch(_0x7a925c){return BPromise['reject'](_0x7a925c);}return _0x5a67b7[_0xc38d('0x1c')]();};}function saveUpdates(_0x5629db,_0x2b628f){return function(_0x1bc74a){if(_0x1bc74a){return _0x1bc74a[_0xc38d('0x1d')](_0x5629db)[_0xc38d('0x1e')](function(_0x8c0c5b){return _0x8c0c5b;});}return null;};}function removeEntity(_0x4a2b11,_0x55c804){return function(_0x3ae83d){if(_0x3ae83d){return _0x3ae83d[_0xc38d('0x1f')]()[_0xc38d('0x1e')](function(){_0x4a2b11['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x221280,_0x5cfc4c){return function(_0x3fb3b5){if(!_0x3fb3b5){_0x221280[_0xc38d('0x17')](0x194);}return _0x3fb3b5;};}function handleError(_0xb260b8,_0x6962e1){_0x6962e1=_0x6962e1||0x1f4;return function(_0x2f6aa3){logger['error'](_0x2f6aa3[_0xc38d('0x20')]);if(_0x2f6aa3[_0xc38d('0x21')]){delete _0x2f6aa3[_0xc38d('0x21')];}_0xb260b8[_0xc38d('0x18')](_0x6962e1)[_0xc38d('0x22')](_0x2f6aa3);};}exports[_0xc38d('0x23')]=function(_0x132dff,_0x597fa7){var _0x21598c={},_0x3dfd00={},_0x35a8b3={'count':0x0,'rows':[]};var _0x4d3a8b=_[_0xc38d('0x24')](db[_0xc38d('0x25')]['rawAttributes'],function(_0x4bb6f4){return{'name':_0x4bb6f4[_0xc38d('0x26')],'type':_0x4bb6f4[_0xc38d('0x27')][_0xc38d('0x28')]};});_0x3dfd00[_0xc38d('0x29')]=_['map'](_0x4d3a8b,_0xc38d('0x21'));_0x3dfd00[_0xc38d('0x2a')]=_['keys'](_0x132dff[_0xc38d('0x2a')]);_0x3dfd00['filters']=_[_0xc38d('0x2b')](_0x3dfd00[_0xc38d('0x29')],_0x3dfd00['query']);_0x21598c[_0xc38d('0x2c')]=_[_0xc38d('0x2b')](_0x3dfd00[_0xc38d('0x29')],qs[_0xc38d('0x2d')](_0x132dff[_0xc38d('0x2a')][_0xc38d('0x2d')]));_0x21598c[_0xc38d('0x2c')]=_0x21598c[_0xc38d('0x2c')]['length']?_0x21598c[_0xc38d('0x2c')]:_0x3dfd00['model'];if(!_0x132dff['query']['hasOwnProperty'](_0xc38d('0x2e'))){_0x21598c['limit']=qs['limit'](_0x132dff[_0xc38d('0x2a')][_0xc38d('0x2f')]);_0x21598c['offset']=qs[_0xc38d('0x1a')](_0x132dff[_0xc38d('0x2a')][_0xc38d('0x1a')]);}_0x21598c['order']=qs[_0xc38d('0x30')](_0x132dff[_0xc38d('0x2a')][_0xc38d('0x30')]);_0x21598c[_0xc38d('0x31')]=qs[_0xc38d('0x32')](_[_0xc38d('0x33')](_0x132dff[_0xc38d('0x2a')],_0x3dfd00[_0xc38d('0x32')]),_0x4d3a8b);if(_0x132dff[_0xc38d('0x2a')][_0xc38d('0x34')]){_0x21598c['where']=_[_0xc38d('0x35')](_0x21598c[_0xc38d('0x31')],{'$or':_['map'](_0x4d3a8b,function(_0x146f77){if(_0x146f77[_0xc38d('0x27')]!=='VIRTUAL'){var _0x43d454={};_0x43d454[_0x146f77[_0xc38d('0x21')]]={'$like':'%'+_0x132dff[_0xc38d('0x2a')]['filter']+'%'};return _0x43d454;}})});}_0x21598c=_['merge']({},_0x21598c,_0x132dff[_0xc38d('0x36')]);var _0x364de9={'where':_0x21598c[_0xc38d('0x31')]};return db[_0xc38d('0x25')][_0xc38d('0x37')](_0x364de9)[_0xc38d('0x1e')](function(_0x440b03){_0x35a8b3[_0xc38d('0x37')]=_0x440b03;if(_0x132dff[_0xc38d('0x2a')][_0xc38d('0x38')]){_0x21598c[_0xc38d('0x39')]=[{'all':!![]}];}return db['FaxApplication'][_0xc38d('0x3a')](_0x21598c);})[_0xc38d('0x1e')](function(_0x371da8){_0x35a8b3[_0xc38d('0x3b')]=_0x371da8;return _0x35a8b3;})[_0xc38d('0x1e')](respondWithFilteredResult(_0x597fa7,_0x21598c))[_0xc38d('0x3c')](handleError(_0x597fa7,null));};exports[_0xc38d('0x3d')]=function(_0x26b570,_0x3009d4){var _0x56335e={'raw':!![],'where':{'id':_0x26b570[_0xc38d('0x3e')]['id']}},_0x252b9d={};_0x252b9d[_0xc38d('0x29')]=_['keys'](db[_0xc38d('0x25')][_0xc38d('0x3f')]);_0x252b9d[_0xc38d('0x2a')]=_[_0xc38d('0x40')](_0x26b570[_0xc38d('0x2a')]);_0x252b9d['filters']=_[_0xc38d('0x2b')](_0x252b9d['model'],_0x252b9d[_0xc38d('0x2a')]);_0x56335e['attributes']=_[_0xc38d('0x2b')](_0x252b9d['model'],qs[_0xc38d('0x2d')](_0x26b570[_0xc38d('0x2a')][_0xc38d('0x2d')]));_0x56335e[_0xc38d('0x2c')]=_0x56335e[_0xc38d('0x2c')][_0xc38d('0x41')]?_0x56335e[_0xc38d('0x2c')]:_0x252b9d['model'];if(_0x26b570['query'][_0xc38d('0x38')]){_0x56335e[_0xc38d('0x39')]=[{'all':!![]}];}_0x56335e=_[_0xc38d('0x35')]({},_0x56335e,_0x26b570[_0xc38d('0x36')]);return db[_0xc38d('0x25')][_0xc38d('0x42')](_0x56335e)[_0xc38d('0x1e')](handleEntityNotFound(_0x3009d4,null))[_0xc38d('0x1e')](respondWithResult(_0x3009d4,null))['catch'](handleError(_0x3009d4,null));};exports[_0xc38d('0x43')]=function(_0x2c07c,_0x7de061){return db[_0xc38d('0x25')][_0xc38d('0x43')](_0x2c07c[_0xc38d('0x44')],{})[_0xc38d('0x1e')](respondWithResult(_0x7de061,0xc9))['catch'](handleError(_0x7de061,null));};exports[_0xc38d('0x1d')]=function(_0x11988f,_0x67c89a){if(_0x11988f['body']['id']){delete _0x11988f['body']['id'];}return db[_0xc38d('0x25')][_0xc38d('0x42')]({'where':{'id':_0x11988f[_0xc38d('0x3e')]['id']}})[_0xc38d('0x1e')](handleEntityNotFound(_0x67c89a,null))[_0xc38d('0x1e')](saveUpdates(_0x11988f[_0xc38d('0x44')],null))[_0xc38d('0x1e')](respondWithResult(_0x67c89a,null))[_0xc38d('0x3c')](handleError(_0x67c89a,null));};exports[_0xc38d('0x1f')]=function(_0x49a06e,_0x2b1324){return db['FaxApplication'][_0xc38d('0x42')]({'where':{'id':_0x49a06e[_0xc38d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2b1324,null))['then'](removeEntity(_0x2b1324,null))[_0xc38d('0x3c')](handleError(_0x2b1324,null));}; \ No newline at end of file +var _0x6c1c=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','create','body','find','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x47bdc1,_0x5614f){var _0x1016c4=function(_0x48fafa){while(--_0x48fafa){_0x47bdc1['push'](_0x47bdc1['shift']());}};_0x1016c4(++_0x5614f);}(_0x6c1c,0x16a));var _0xc6c1=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x6c1c[_0x38a7ac];return _0x53061a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6c1('0x0'));var zipdir=require(_0xc6c1('0x1'));var jsonpatch=require(_0xc6c1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6c1('0x3'));var util=require(_0xc6c1('0x4'));var path=require(_0xc6c1('0x5'));var sox=require(_0xc6c1('0x6'));var csv=require(_0xc6c1('0x7'));var ejs=require(_0xc6c1('0x8'));var fs=require('fs');var fs_extra=require(_0xc6c1('0x9'));var _=require(_0xc6c1('0xa'));var squel=require('squel');var crypto=require(_0xc6c1('0xb'));var jsforce=require(_0xc6c1('0xc'));var deskjs=require(_0xc6c1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc6c1('0xe'));var Papa=require(_0xc6c1('0xf'));var Redis=require(_0xc6c1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc6c1('0x11'));var as=require(_0xc6c1('0x12'));var hardwareService=require(_0xc6c1('0x13'));var logger=require(_0xc6c1('0x14'))(_0xc6c1('0x15'));var utils=require(_0xc6c1('0x16'));var config=require(_0xc6c1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6c1('0x18'))['db'];function respondWithStatusCode(_0x5d3a30,_0xfb29dc){_0xfb29dc=_0xfb29dc||0xcc;return function(_0x43f504){if(_0x43f504){return _0x5d3a30['sendStatus'](_0xfb29dc);}return _0x5d3a30['status'](_0xfb29dc)[_0xc6c1('0x19')]();};}function respondWithResult(_0x58f988,_0x12fafa){_0x12fafa=_0x12fafa||0xc8;return function(_0x2124db){if(_0x2124db){return _0x58f988[_0xc6c1('0x1a')](_0x12fafa)[_0xc6c1('0x1b')](_0x2124db);}};}function respondWithFilteredResult(_0x5098a9,_0x12efec){return function(_0x5778be){if(_0x5778be){var _0xdc7e22=typeof _0x12efec[_0xc6c1('0x1c')]==='undefined'&&typeof _0x12efec[_0xc6c1('0x1d')]===_0xc6c1('0x1e');var _0x3e9be1=_0x5778be[_0xc6c1('0x1f')];var _0x1ad4f0=_0xdc7e22?0x0:_0x12efec[_0xc6c1('0x1c')];var _0x547f0d=_0xdc7e22?_0x5778be[_0xc6c1('0x1f')]:_0x12efec[_0xc6c1('0x1c')]+_0x12efec['limit'];var _0x53f0b7;if(_0x547f0d>=_0x3e9be1){_0x547f0d=_0x3e9be1;_0x53f0b7=0xc8;}else{_0x53f0b7=0xce;}_0x5098a9[_0xc6c1('0x1a')](_0x53f0b7);return _0x5098a9[_0xc6c1('0x20')](_0xc6c1('0x21'),_0x1ad4f0+'-'+_0x547f0d+'/'+_0x3e9be1)['json'](_0x5778be);}return null;};}function patchUpdates(_0xde0044){return function(_0x29dbba){try{jsonpatch['apply'](_0x29dbba,_0xde0044,!![]);}catch(_0x3c3898){return BPromise[_0xc6c1('0x22')](_0x3c3898);}return _0x29dbba['save']();};}function saveUpdates(_0x4f25a2,_0x26c0be){return function(_0x467b08){if(_0x467b08){return _0x467b08[_0xc6c1('0x23')](_0x4f25a2)[_0xc6c1('0x24')](function(_0x1d46be){return _0x1d46be;});}return null;};}function removeEntity(_0x5fe625,_0x5b8bff){return function(_0x562ce6){if(_0x562ce6){return _0x562ce6[_0xc6c1('0x25')]()['then'](function(){_0x5fe625[_0xc6c1('0x1a')](0xcc)[_0xc6c1('0x19')]();});}};}function handleEntityNotFound(_0x35f9fa,_0xe221ed){return function(_0x2ef8a3){if(!_0x2ef8a3){_0x35f9fa[_0xc6c1('0x26')](0x194);}return _0x2ef8a3;};}function handleError(_0x23b2b2,_0x3d6a26){_0x3d6a26=_0x3d6a26||0x1f4;return function(_0x206344){logger[_0xc6c1('0x27')](_0x206344['stack']);if(_0x206344[_0xc6c1('0x28')]){delete _0x206344[_0xc6c1('0x28')];}_0x23b2b2[_0xc6c1('0x1a')](_0x3d6a26)[_0xc6c1('0x29')](_0x206344);};}exports[_0xc6c1('0x2a')]=function(_0x5a9023,_0x33a377){var _0x1430ba={},_0x4aaa2e={},_0x5812c0={'count':0x0,'rows':[]};var _0x35d476=_[_0xc6c1('0x2b')](db[_0xc6c1('0x2c')][_0xc6c1('0x2d')],function(_0x2b3fd1){return{'name':_0x2b3fd1[_0xc6c1('0x2e')],'type':_0x2b3fd1[_0xc6c1('0x2f')][_0xc6c1('0x30')]};});_0x4aaa2e['model']=_[_0xc6c1('0x2b')](_0x35d476,_0xc6c1('0x28'));_0x4aaa2e[_0xc6c1('0x31')]=_['keys'](_0x5a9023['query']);_0x4aaa2e['filters']=_[_0xc6c1('0x32')](_0x4aaa2e['model'],_0x4aaa2e[_0xc6c1('0x31')]);_0x1430ba[_0xc6c1('0x33')]=_[_0xc6c1('0x32')](_0x4aaa2e[_0xc6c1('0x34')],qs[_0xc6c1('0x35')](_0x5a9023['query'][_0xc6c1('0x35')]));_0x1430ba['attributes']=_0x1430ba[_0xc6c1('0x33')][_0xc6c1('0x36')]?_0x1430ba[_0xc6c1('0x33')]:_0x4aaa2e[_0xc6c1('0x34')];if(!_0x5a9023[_0xc6c1('0x31')][_0xc6c1('0x37')](_0xc6c1('0x38'))){_0x1430ba[_0xc6c1('0x1d')]=qs['limit'](_0x5a9023['query'][_0xc6c1('0x1d')]);_0x1430ba[_0xc6c1('0x1c')]=qs[_0xc6c1('0x1c')](_0x5a9023['query'][_0xc6c1('0x1c')]);}_0x1430ba[_0xc6c1('0x39')]=qs[_0xc6c1('0x3a')](_0x5a9023[_0xc6c1('0x31')]['sort']);_0x1430ba[_0xc6c1('0x3b')]=qs['filters'](_[_0xc6c1('0x3c')](_0x5a9023[_0xc6c1('0x31')],_0x4aaa2e['filters']),_0x35d476);if(_0x5a9023[_0xc6c1('0x31')][_0xc6c1('0x3d')]){_0x1430ba[_0xc6c1('0x3b')]=_[_0xc6c1('0x3e')](_0x1430ba[_0xc6c1('0x3b')],{'$or':_[_0xc6c1('0x2b')](_0x35d476,function(_0x217a4f){if(_0x217a4f['type']!==_0xc6c1('0x3f')){var _0x40a3e6={};_0x40a3e6[_0x217a4f[_0xc6c1('0x28')]]={'$like':'%'+_0x5a9023[_0xc6c1('0x31')][_0xc6c1('0x3d')]+'%'};return _0x40a3e6;}})});}_0x1430ba=_[_0xc6c1('0x3e')]({},_0x1430ba,_0x5a9023['options']);var _0x91bd={'where':_0x1430ba[_0xc6c1('0x3b')]};return db['FaxApplication'][_0xc6c1('0x1f')](_0x91bd)[_0xc6c1('0x24')](function(_0x178cf4){_0x5812c0['count']=_0x178cf4;if(_0x5a9023[_0xc6c1('0x31')][_0xc6c1('0x40')]){_0x1430ba[_0xc6c1('0x41')]=[{'all':!![]}];}return db[_0xc6c1('0x2c')][_0xc6c1('0x42')](_0x1430ba);})[_0xc6c1('0x24')](function(_0x26a9a0){_0x5812c0['rows']=_0x26a9a0;return _0x5812c0;})['then'](respondWithFilteredResult(_0x33a377,_0x1430ba))[_0xc6c1('0x43')](handleError(_0x33a377,null));};exports[_0xc6c1('0x44')]=function(_0x124011,_0x58d616){var _0x4b6aee={'raw':!![],'where':{'id':_0x124011[_0xc6c1('0x45')]['id']}},_0xca8c15={};_0xca8c15[_0xc6c1('0x34')]=_[_0xc6c1('0x46')](db[_0xc6c1('0x2c')]['rawAttributes']);_0xca8c15['query']=_['keys'](_0x124011['query']);_0xca8c15['filters']=_['intersection'](_0xca8c15[_0xc6c1('0x34')],_0xca8c15[_0xc6c1('0x31')]);_0x4b6aee[_0xc6c1('0x33')]=_['intersection'](_0xca8c15['model'],qs['fields'](_0x124011['query']['fields']));_0x4b6aee[_0xc6c1('0x33')]=_0x4b6aee[_0xc6c1('0x33')][_0xc6c1('0x36')]?_0x4b6aee['attributes']:_0xca8c15[_0xc6c1('0x34')];if(_0x124011[_0xc6c1('0x31')][_0xc6c1('0x40')]){_0x4b6aee[_0xc6c1('0x41')]=[{'all':!![]}];}_0x4b6aee=_[_0xc6c1('0x3e')]({},_0x4b6aee,_0x124011[_0xc6c1('0x47')]);return db[_0xc6c1('0x2c')]['find'](_0x4b6aee)['then'](handleEntityNotFound(_0x58d616,null))[_0xc6c1('0x24')](respondWithResult(_0x58d616,null))['catch'](handleError(_0x58d616,null));};exports[_0xc6c1('0x48')]=function(_0x18c23f,_0x124572){return db[_0xc6c1('0x2c')][_0xc6c1('0x48')](_0x18c23f[_0xc6c1('0x49')],{})[_0xc6c1('0x24')](respondWithResult(_0x124572,0xc9))[_0xc6c1('0x43')](handleError(_0x124572,null));};exports[_0xc6c1('0x23')]=function(_0x3f5d94,_0x95d587){if(_0x3f5d94[_0xc6c1('0x49')]['id']){delete _0x3f5d94[_0xc6c1('0x49')]['id'];}return db['FaxApplication'][_0xc6c1('0x4a')]({'where':{'id':_0x3f5d94[_0xc6c1('0x45')]['id']}})[_0xc6c1('0x24')](handleEntityNotFound(_0x95d587,null))['then'](saveUpdates(_0x3f5d94['body'],null))[_0xc6c1('0x24')](respondWithResult(_0x95d587,null))[_0xc6c1('0x43')](handleError(_0x95d587,null));};exports[_0xc6c1('0x25')]=function(_0x1f99cb,_0xbe3933){return db[_0xc6c1('0x2c')][_0xc6c1('0x4a')]({'where':{'id':_0x1f99cb[_0xc6c1('0x45')]['id']}})[_0xc6c1('0x24')](handleEntityNotFound(_0xbe3933,null))['then'](removeEntity(_0xbe3933,null))['catch'](handleError(_0xbe3933,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index eac8f23..d75fd38 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 _0x0972=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x0972,0x12c));var _0x2097=function(_0x2d92e4,_0x4a6bf4){_0x2d92e4=_0x2d92e4-0x0;var _0x181f2d=_0x0972[_0x2d92e4];return _0x181f2d;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require(_0x2097('0x1'))(_0x2097('0x2'));var moment=require('moment');var BPromise=require(_0x2097('0x3'));var rp=require(_0x2097('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x5'));var config=require(_0x2097('0x6'));var attributes=require(_0x2097('0x7'));module['exports']=function(_0x1f1909,_0x219c0f){return _0x1f1909['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2097('0x8'),'collate':_0x2097('0x9')});}; \ No newline at end of file +var _0x0758=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x3b0489,_0x571af8){var _0x4de392=function(_0x1b4844){while(--_0x1b4844){_0x3b0489['push'](_0x3b0489['shift']());}};_0x4de392(++_0x571af8);}(_0x0758,0x1ee));var _0x8075=function(_0x47c746,_0xc16c34){_0x47c746=_0x47c746-0x0;var _0x37d5bf=_0x0758[_0x47c746];return _0x37d5bf;};'use strict';var _=require(_0x8075('0x0'));var util=require(_0x8075('0x1'));var logger=require(_0x8075('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8075('0x3'));var rp=require(_0x8075('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8075('0x5'));var config=require(_0x8075('0x6'));var attributes=require(_0x8075('0x7'));module[_0x8075('0x8')]=function(_0x5dd5f3,_0x582788){return _0x5dd5f3[_0x8075('0x9')](_0x8075('0xa'),attributes,{'tableName':_0x8075('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8075('0xc'),'collate':_0x8075('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index ba318a2..804df33 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 _0x82d2=['http','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','catch','update','options','raw','then','stringify','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x483597,_0x198104){var _0x392ccf=function(_0x3e1984){while(--_0x3e1984){_0x483597['push'](_0x483597['shift']());}};_0x392ccf(++_0x198104);}(_0x82d2,0xdd));var _0x282d=function(_0x249338,_0x6558fa){_0x249338=_0x249338-0x0;var _0x1dbe4a=_0x82d2[_0x249338];return _0x1dbe4a;};'use strict';var _=require(_0x282d('0x0'));var util=require(_0x282d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x282d('0x2'));var fs=require('fs');var Redis=require(_0x282d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x282d('0x4'));var logger=require('../../config/logger')(_0x282d('0x5'));var config=require(_0x282d('0x6'));var jayson=require(_0x282d('0x7'));var client=jayson[_0x282d('0x8')][_0x282d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33c274,_0xd871be,_0x3ea5fd){return new BPromise(function(_0x54ffc0,_0x374dc3){return client['request'](_0x33c274,_0x3ea5fd)['then'](function(_0x4b8f82){logger[_0x282d('0xa')](_0x282d('0xb'),_0xd871be,_0x282d('0xc'));logger[_0x282d('0xd')](_0x282d('0xe'),_0xd871be,_0x282d('0xc'),JSON['stringify'](_0x4b8f82));if(_0x4b8f82[_0x282d('0xf')]){if(_0x4b8f82['error']['code']===0x1f4){logger[_0x282d('0xf')](_0x282d('0xb'),_0xd871be,_0x4b8f82[_0x282d('0xf')][_0x282d('0x10')]);return _0x374dc3(_0x4b8f82[_0x282d('0xf')]['message']);}logger['error'](_0x282d('0xb'),_0xd871be,_0x4b8f82[_0x282d('0xf')][_0x282d('0x10')]);return _0x54ffc0(_0x4b8f82['error'][_0x282d('0x10')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0xd871be,_0x282d('0xc'));_0x54ffc0(_0x4b8f82['result'][_0x282d('0x10')]);}})[_0x282d('0x11')](function(_0x11ce08){logger[_0x282d('0xf')](_0x282d('0xb'),_0xd871be,_0x11ce08);_0x374dc3(_0x11ce08);});});}exports['UpdateFaxApplication']=function(_0x547e15){var _0x1eeb42=this;return new Promise(function(_0x1d5051,_0x2282e2){return db['FaxApplication'][_0x282d('0x12')](_0x547e15['body'],{'raw':_0x547e15['options']?_0x547e15[_0x282d('0x13')][_0x282d('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x547e15[_0x282d('0x13')]?_0x547e15[_0x282d('0x13')]['where']||null:null,'attributes':_0x547e15[_0x282d('0x13')]?_0x547e15[_0x282d('0x13')]['attributes']||null:null,'limit':_0x547e15[_0x282d('0x13')]?_0x547e15[_0x282d('0x13')]['limit']||null:null})[_0x282d('0x15')](function(_0x43758d){logger[_0x282d('0xa')]('UpdateFaxApplication',_0x547e15);logger[_0x282d('0xd')]('UpdateFaxApplication',_0x547e15,JSON[_0x282d('0x16')](_0x43758d));_0x1d5051(_0x43758d);})[_0x282d('0x11')](function(_0x50237a){logger[_0x282d('0xf')]('UpdateFaxApplication',_0x50237a[_0x282d('0x10')],_0x547e15);_0x2282e2(_0x1eeb42[_0x282d('0xf')](0x1f4,_0x50237a['message']));});});}; \ No newline at end of file +var _0x357e=['http','request','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','info','result','catch','UpdateFaxApplication','update','body','options','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x4b60ae,_0x4ea45c){var _0x11ddbe=function(_0x196985){while(--_0x196985){_0x4b60ae['push'](_0x4b60ae['shift']());}};_0x11ddbe(++_0x4ea45c);}(_0x357e,0x1c2));var _0xe357=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x357e[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xe357('0x0'));var util=require('util');var moment=require(_0xe357('0x1'));var BPromise=require(_0xe357('0x2'));var rs=require(_0xe357('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe357('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe357('0x5'))(_0xe357('0x6'));var config=require('../../config/environment');var jayson=require(_0xe357('0x7'));var client=jayson[_0xe357('0x8')][_0xe357('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d61fc,_0x143654,_0x2dc298){return new BPromise(function(_0x41f2a2,_0x31b8d2){return client[_0xe357('0xa')](_0x3d61fc,_0x2dc298)['then'](function(_0x33394a){logger['info']('FaxApplication,\x20%s,\x20%s',_0x143654,_0xe357('0xb'));logger[_0xe357('0xc')](_0xe357('0xd'),_0x143654,'request\x20sent',JSON[_0xe357('0xe')](_0x33394a));if(_0x33394a[_0xe357('0xf')]){if(_0x33394a['error']['code']===0x1f4){logger[_0xe357('0xf')](_0xe357('0x10'),_0x143654,_0x33394a[_0xe357('0xf')][_0xe357('0x11')]);return _0x31b8d2(_0x33394a[_0xe357('0xf')][_0xe357('0x11')]);}logger[_0xe357('0xf')]('FaxApplication,\x20%s,\x20%s',_0x143654,_0x33394a[_0xe357('0xf')][_0xe357('0x11')]);return _0x41f2a2(_0x33394a[_0xe357('0xf')][_0xe357('0x11')]);}else{logger[_0xe357('0x12')](_0xe357('0x10'),_0x143654,_0xe357('0xb'));_0x41f2a2(_0x33394a[_0xe357('0x13')][_0xe357('0x11')]);}})[_0xe357('0x14')](function(_0x25bd30){logger[_0xe357('0xf')](_0xe357('0x10'),_0x143654,_0x25bd30);_0x31b8d2(_0x25bd30);});});}exports[_0xe357('0x15')]=function(_0xe05fbf){var _0x4938c2=this;return new Promise(function(_0x3f400f,_0x543bef){return db['FaxApplication'][_0xe357('0x16')](_0xe05fbf[_0xe357('0x17')],{'raw':_0xe05fbf['options']?_0xe05fbf[_0xe357('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe05fbf['options']?_0xe05fbf[_0xe357('0x18')]['where']||null:null,'attributes':_0xe05fbf[_0xe357('0x18')]?_0xe05fbf[_0xe357('0x18')][_0xe357('0x19')]||null:null,'limit':_0xe05fbf[_0xe357('0x18')]?_0xe05fbf[_0xe357('0x18')][_0xe357('0x1a')]||null:null})['then'](function(_0x96f687){logger['info'](_0xe357('0x15'),_0xe05fbf);logger[_0xe357('0xc')](_0xe357('0x15'),_0xe05fbf,JSON[_0xe357('0xe')](_0x96f687));_0x3f400f(_0x96f687);})[_0xe357('0x14')](function(_0x1a69f4){logger[_0xe357('0xf')](_0xe357('0x15'),_0x1a69f4[_0xe357('0x11')],_0xe05fbf);_0x543bef(_0x4938c2['error'](0x1f4,_0x1a69f4[_0xe357('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index c9f9d65..d420c45 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 _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x4e74c2,_0x287d93){var _0x2bd9c0=function(_0x31b05b){while(--_0x31b05b){_0x4e74c2['push'](_0x4e74c2['shift']());}};_0x2bd9c0(++_0x287d93);}(_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('./faxApplication.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file +var _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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xea28,0x13a));var _0x8ea2=function(_0x2a12ed,_0x2f4927){_0x2a12ed=_0x2a12ed-0x0;var _0x44cbf5=_0xea28[_0x2a12ed];return _0x44cbf5;};'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 diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 33ef51b..94763c6 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 _0x1892=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x4df349,_0x4d8194){var _0xf4cba5=function(_0x40529){while(--_0x40529){_0x4df349['push'](_0x4df349['shift']());}};_0xf4cba5(++_0x4d8194);}(_0x1892,0x8d));var _0x2189=function(_0x48292a,_0x12e2ec){_0x48292a=_0x48292a-0x0;var _0x31ca8a=_0x1892[_0x48292a];return _0x31ca8a;};'use strict';var Sequelize=require(_0x2189('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2189('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2189('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2189('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2189('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2189('0x2')]},'fax':{'type':Sequelize[_0x2189('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2189('0x4')]('in',_0x2189('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2189('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x2189('0x4')]('in',_0x2189('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xe68a=['exports','STRING','out','DATE','ENUM','sequelize'];(function(_0xd09f18,_0x3ef147){var _0x1cc45d=function(_0x300f68){while(--_0x300f68){_0xd09f18['push'](_0xd09f18['shift']());}};_0x1cc45d(++_0x3ef147);}(_0xe68a,0x15b));var _0xae68=function(_0xb6a965,_0x5c5ace){_0xb6a965=_0xb6a965-0x0;var _0x51d37d=_0xe68a[_0xb6a965];return _0x51d37d;};'use strict';var Sequelize=require(_0xae68('0x0'));module[_0xae68('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xae68('0x2')]},'secondDisposition':{'type':Sequelize[_0xae68('0x2')]},'thirdDisposition':{'type':Sequelize[_0xae68('0x2')]},'note':{'type':Sequelize[_0xae68('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xae68('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xae68('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xae68('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xae68('0x5')]('in',_0xae68('0x3')),'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 6e6b6a8..413139c 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 _0x8342=['to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','forEach','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','having','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','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','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','params','intersection','include','options','create','describe','addMessage','ids','findOne','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','server','root','files','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x4796d9,_0xc2a231){var _0x3912c0=function(_0x442951){while(--_0x442951){_0x4796d9['push'](_0x4796d9['shift']());}};_0x3912c0(++_0xc2a231);}(_0x8342,0x1ae));var _0x2834=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0x8342[_0x3a8db5];return _0x2c03cd;};'use strict';var emlformat=require(_0x2834('0x0'));var rimraf=require(_0x2834('0x1'));var zipdir=require(_0x2834('0x2'));var jsonpatch=require(_0x2834('0x3'));var rp=require(_0x2834('0x4'));var moment=require(_0x2834('0x5'));var BPromise=require(_0x2834('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2834('0x7'));var sox=require('sox');var csv=require(_0x2834('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2834('0x9'));var _=require(_0x2834('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2834('0xb'));var deskjs=require(_0x2834('0xc'));var toCsv=require(_0x2834('0x8'));var querystring=require(_0x2834('0xd'));var Papa=require(_0x2834('0xe'));var Redis=require(_0x2834('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2834('0x10'));var hardwareService=require(_0x2834('0x11'));var logger=require(_0x2834('0x12'))(_0x2834('0x13'));var utils=require(_0x2834('0x14'));var config=require(_0x2834('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2834('0x16'))['db'];config[_0x2834('0x17')]=_[_0x2834('0x18')](config[_0x2834('0x17')],{'host':_0x2834('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2834('0x1a'))[_0x2834('0x1b')](socket);function respondWithStatusCode(_0x512685,_0x476dda){_0x476dda=_0x476dda||0xcc;return function(_0xddd2bb){if(_0xddd2bb){return _0x512685[_0x2834('0x1c')](_0x476dda);}return _0x512685[_0x2834('0x1d')](_0x476dda)[_0x2834('0x1e')]();};}function respondWithResult(_0x2d43d5,_0x4729b1){_0x4729b1=_0x4729b1||0xc8;return function(_0x28c593){if(_0x28c593){return _0x2d43d5[_0x2834('0x1d')](_0x4729b1)[_0x2834('0x1f')](_0x28c593);}};}function respondWithFilteredResult(_0x4ae400,_0xc9d97d){return function(_0x1d9f71){if(_0x1d9f71){var _0x34b679=typeof _0xc9d97d['offset']===_0x2834('0x20')&&typeof _0xc9d97d[_0x2834('0x21')]===_0x2834('0x20');var _0x9f51be=_0x1d9f71['count'];var _0x13f608=_0x34b679?0x0:_0xc9d97d['offset'];var _0x464e91=_0x34b679?_0x1d9f71[_0x2834('0x22')]:_0xc9d97d[_0x2834('0x23')]+_0xc9d97d[_0x2834('0x21')];var _0x23203a;if(_0x464e91>=_0x9f51be){_0x464e91=_0x9f51be;_0x23203a=0xc8;}else{_0x23203a=0xce;}_0x4ae400[_0x2834('0x1d')](_0x23203a);return _0x4ae400['set'](_0x2834('0x24'),_0x13f608+'-'+_0x464e91+'/'+_0x9f51be)[_0x2834('0x1f')](_0x1d9f71);}return null;};}function patchUpdates(_0x5afb37){return function(_0x2dceb2){try{jsonpatch['apply'](_0x2dceb2,_0x5afb37,!![]);}catch(_0x48b303){return BPromise[_0x2834('0x25')](_0x48b303);}return _0x2dceb2[_0x2834('0x26')]();};}function saveUpdates(_0x5d6dae,_0x53f641){return function(_0x3c7aad){if(_0x3c7aad){return _0x3c7aad[_0x2834('0x27')](_0x5d6dae)[_0x2834('0x28')](function(_0x1255e8){return _0x1255e8;});}return null;};}function removeEntity(_0x184d64,_0x479dbf){return function(_0x3356e8){if(_0x3356e8){return _0x3356e8[_0x2834('0x29')]()[_0x2834('0x28')](function(){_0x184d64[_0x2834('0x1d')](0xcc)[_0x2834('0x1e')]();});}};}function handleEntityNotFound(_0x56de6c,_0x5932ce){return function(_0x172966){if(!_0x172966){_0x56de6c[_0x2834('0x1c')](0x194);}return _0x172966;};}function handleError(_0x551401,_0xa7acbc){_0xa7acbc=_0xa7acbc||0x1f4;return function(_0x494c0a){logger[_0x2834('0x2a')](_0x494c0a[_0x2834('0x2b')]);if(_0x494c0a[_0x2834('0x2c')]){delete _0x494c0a[_0x2834('0x2c')];}_0x551401[_0x2834('0x1d')](_0xa7acbc)[_0x2834('0x2d')](_0x494c0a);};}function getInteractionUsers(_0x440f89,_0x1cc84e){return new BPromise(function(_0xf6f764,_0x4a7520){try{if(_0x1cc84e[_0x440f89['id']]){_0x440f89['Users']=_[_0x2834('0x2e')](_0x1cc84e[_0x440f89['id']],function(_0x5eb18c){return{'id':_0x5eb18c['id'],'fullname':_0x5eb18c[_0x2834('0x2f')]};});}}catch(_0x3ae134){_0x4a7520(_0x3ae134);}_0xf6f764(_0x440f89);});}function getInteractionTags(_0x1c98cd,_0x18b1a0){return new BPromise(function(_0x1e6642,_0x434d3c){try{if(_0x1c98cd[_0x2834('0x30')]){_0x1c98cd[_0x2834('0x31')]=[];_0x1c98cd[_0x2834('0x30')]['split'](',')[_0x2834('0x32')](function(_0x5e1064){_0x1c98cd[_0x2834('0x31')][_0x2834('0x33')](_0x18b1a0[_0x5e1064]);});}delete _0x1c98cd[_0x2834('0x30')];}catch(_0x544109){_0x434d3c(_0x544109);}_0x1e6642(_0x1c98cd);});}function updateFaxInteraction(_0x615df7,_0x588a45,_0x378d21){return new BPromise(function(_0x1b6991,_0x13dae2){return getInteractionUsers(_0x615df7,_0x378d21)[_0x2834('0x28')](function(_0x10fc5d){return getInteractionTags(_0x10fc5d,_0x588a45);})[_0x2834('0x28')](function(_0x391fde){_0x1b6991(_0x391fde);})[_0x2834('0x34')](function(_0x4ae454){_0x13dae2(_0x4ae454);});});}exports[_0x2834('0x35')]=function(_0x54ec9c,_0x1fc752){var _0x12a404={},_0x573715={},_0x340237={'count':0x0,'rows':[]};var _0x52bf69=_[_0x2834('0x2e')](db[_0x2834('0x36')][_0x2834('0x37')],function(_0x5c6bbf){return{'name':_0x5c6bbf[_0x2834('0x38')],'type':_0x5c6bbf[_0x2834('0x39')]['key']};});_0x573715[_0x2834('0x3a')]=_[_0x2834('0x2e')](_0x52bf69,'name');_0x573715['query']=_[_0x2834('0x3b')](_0x54ec9c[_0x2834('0x3c')]);_0x573715[_0x2834('0x3d')]=_['intersection'](_0x573715['model'],_0x573715['query']);_0x12a404[_0x2834('0x3e')]=_['intersection'](_0x573715[_0x2834('0x3a')],qs[_0x2834('0x3f')](_0x54ec9c[_0x2834('0x3c')][_0x2834('0x3f')]));_0x12a404[_0x2834('0x3e')]=_0x12a404[_0x2834('0x3e')][_0x2834('0x40')]?_0x12a404[_0x2834('0x3e')]:_0x573715[_0x2834('0x3a')];if(!_0x54ec9c[_0x2834('0x3c')][_0x2834('0x41')](_0x2834('0x42'))){_0x12a404[_0x2834('0x21')]=qs[_0x2834('0x21')](_0x54ec9c[_0x2834('0x3c')][_0x2834('0x21')]);_0x12a404[_0x2834('0x23')]=qs[_0x2834('0x23')](_0x54ec9c[_0x2834('0x3c')][_0x2834('0x23')]);}_0x12a404['order']=qs[_0x2834('0x43')](_0x54ec9c['query'][_0x2834('0x43')]);_0x12a404[_0x2834('0x44')]=qs[_0x2834('0x3d')](_['pick'](_0x54ec9c['query'],_0x573715[_0x2834('0x3d')]),_0x52bf69);var _0x580161=[];var _0xdd54a4=squel['select']()[_0x2834('0x45')]('id')[_0x2834('0x45')]('name')['field'](_0x2834('0x46'))[_0x2834('0x47')](_0x2834('0x48'));var _0x54d148=squel[_0x2834('0x49')]()[_0x2834('0x45')](_0x2834('0x4a'))[_0x2834('0x45')](_0x2834('0x4b'))[_0x2834('0x45')]('ui.FaxInteractionId')[_0x2834('0x47')](_0x2834('0x4c'),'ui')[_0x2834('0x4d')](_0x2834('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x4a4753=squel['select']()[_0x2834('0x47')](_0x2834('0x4f'),'i')[_0x2834('0x4d')](_0x2834('0x50'),'c',_0x2834('0x51'))['left_join'](_0x2834('0x4e'),'o','o.id\x20=\x20i.UserId')[_0x2834('0x4d')](_0x2834('0x52'),'a',_0x2834('0x53'))[_0x2834('0x4d')](_0x2834('0x54'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x2834('0x4d')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0x2834('0x4d')]('tools_tags','t',_0x2834('0x55'));var _0x5c450e=squel[_0x2834('0x56')]();var _0x5ce134=[];var _0x514710=squel[_0x2834('0x56')]();var _0x288dd7;if(_0x54ec9c[_0x2834('0x3c')][_0x2834('0x57')]){_0x288dd7=as[_0x2834('0x58')](_0x54ec9c[_0x2834('0x3c')]['search']);var _0x15709f=_0x288dd7['sqlOperator'];for(var _0x494a30=0x0;_0x494a30<_0x288dd7[_0x2834('0x59')][_0x2834('0x40')];_0x494a30++){var _0xb8773a=_0x288dd7['conditions'][_0x494a30];var _0x3e801c='i';var _0xa3bf13=_[_0x2834('0x5a')](_0x52bf69,[_0x2834('0x2c'),_0xb8773a[_0x2834('0x45')]]);if(!_0xa3bf13){switch(_0xb8773a[_0x2834('0x45')]){case'unreadMessages':if(_0xb8773a[_0x2834('0x5b')]==0x1){_0x4a4753['having']('`'+_0xb8773a['field']+'`\x20=\x200');}else{_0x4a4753[_0x2834('0x5c')]('`'+_0xb8773a[_0x2834('0x45')]+_0x2834('0x5d'));}break;case _0x2834('0x5e'):if(_0xb8773a[_0x2834('0x5f')]==='$substring'){if(_0xb8773a[_0x2834('0x5b')][_0x2834('0x60')]('\x20')[_0x2834('0x40')]>0x1){_0x5c450e[_0x15709f](_0x2834('0x61'),qs['getFullTextValue'](_0xb8773a[_0x2834('0x5b')]),null);}else{var _0x5282f6='%'+_0xb8773a[_0x2834('0x5b')]+'%';_0x5c450e[_0x15709f](_0x2834('0x62'),_0x5282f6,_0x5282f6,_0x5282f6);}}else{_0xa3bf13=_[_0x2834('0x5a')](_0x52bf69,['name',_0x2834('0x63')]);_0xb8773a[_0x2834('0x45')]=_0x2834('0x63');_0x5a5c72=as[_0x2834('0x64')](_0x3e801c,_0xa3bf13[_0x2834('0x39')],_0xb8773a);_0x5c450e[_0x15709f](_0x5a5c72[_0x2834('0x65')],_0x5a5c72['value'][_0x2834('0x66')],_0x5a5c72[_0x2834('0x5b')][_0x2834('0x1e')]);}break;case _0x2834('0x67'):var _0x1a320d=_0xb8773a[_0x2834('0x5b')]['split'](',')['map'](function(_0x580110){return Number(_0x580110);});_0x1a320d[_0x2834('0x32')](function(_0x11e37b){_0x514710['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x11e37b+',%');});_0x5ce134=_[_0x2834('0x68')](_0x5ce134,_0x1a320d);break;case _0x2834('0x69'):if(_0xb8773a[_0x2834('0x5f')]===_0x2834('0x6a')){_0x5c450e[_0x15709f](_0x2834('0x6b'),'%'+_0xb8773a[_0x2834('0x5b')]+'%',null);}else{_0xa3bf13=_[_0x2834('0x5a')](_0x52bf69,[_0x2834('0x2c'),'UserId']);_0xb8773a[_0x2834('0x45')]=_0x2834('0x6c');_0x5a5c72=as['buildExpression'](_0x3e801c,_0xa3bf13['type'],_0xb8773a);_0x5c450e[_0x15709f](_0x5a5c72[_0x2834('0x65')],_0x5a5c72[_0x2834('0x5b')][_0x2834('0x66')],_0x5a5c72['value'][_0x2834('0x1e')]);}break;case _0x2834('0x6d'):_0x5a5c72=as[_0x2834('0x64')]('me',null,_0xb8773a);_0x5c450e[_0x15709f](_0x5a5c72[_0x2834('0x65')],_0x5a5c72['value'][_0x2834('0x66')],_0x5a5c72[_0x2834('0x5b')][_0x2834('0x1e')]);break;}}else{var _0x5a5c72=as[_0x2834('0x64')](_0x3e801c,_0xa3bf13['type'],_0xb8773a);_0x5c450e[_0x15709f](_0x5a5c72[_0x2834('0x65')],_0x5a5c72['value'][_0x2834('0x66')],_0x5a5c72[_0x2834('0x5b')][_0x2834('0x1e')]);}}}else{var _0x6de357=_(_0x54ec9c[_0x2834('0x3c')])['keys']()[_0x2834('0x2e')](function(_0x47808a){return _[_0x2834('0x6e')](_0x52bf69,['name',_0x47808a])?_0x47808a:undefined;})[_0x2834('0x6f')]()[_0x2834('0x5b')]();if(!_[_0x2834('0x70')](_0x6de357)){_0x6de357[_0x2834('0x32')](function(_0x45e4d1){if(_0x45e4d1===_0x2834('0x71')){_0x4a4753[_0x2834('0x44')](_0x2834('0x72'),[][_0x2834('0x73')](_0x54ec9c['query'][_0x45e4d1]));}else if(_0x45e4d1==='createdAt'){var _0x31c75e=JSON[_0x2834('0x74')](_0x54ec9c[_0x2834('0x3c')][_0x45e4d1])['$gte'];var _0x360b56=JSON['parse'](_0x54ec9c['query'][_0x45e4d1])['$lte'];_0x4a4753[_0x2834('0x44')](_0x2834('0x75'),_0x31c75e,_0x360b56);}else{if(_0x54ec9c[_0x2834('0x3c')][_0x45e4d1]==='null'){_0x4a4753[_0x2834('0x44')]('i.'+_0x45e4d1+_0x2834('0x76'));}else{_0x4a4753[_0x2834('0x44')]('i.'+_0x45e4d1+_0x2834('0x77'),_0x54ec9c[_0x2834('0x3c')][_0x45e4d1]);}}});}if(_0x54ec9c['query'][_0x2834('0x78')]){if(_0x54ec9c[_0x2834('0x3c')][_0x2834('0x78')]==0x1){_0x4a4753[_0x2834('0x5c')](_0x2834('0x79'));}else{_0x4a4753[_0x2834('0x5c')](_0x2834('0x7a'));}}if(_0x54ec9c['query'][_0x2834('0x7b')]){_0x5ce134=_[_0x2834('0x7c')](_0x54ec9c[_0x2834('0x3c')][_0x2834('0x7b')])?_0x54ec9c[_0x2834('0x3c')][_0x2834('0x7b')]:new Array(_0x54ec9c[_0x2834('0x3c')][_0x2834('0x7b')]);_0x5ce134[_0x2834('0x32')](function(_0x24e33c){_0x514710['or'](_0x2834('0x7d'),'%,'+_0x24e33c+',%');});}if(_0x54ec9c[_0x2834('0x3c')][_0x2834('0x7e')]){var _0x4eba25=_0x54ec9c[_0x2834('0x3c')][_0x2834('0x7e')][_0x2834('0x7f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2834('0x80')](_0x4eba25)){_0x5c450e['or'](_0x2834('0x81'),_0x4eba25+'%')['or'](_0x2834('0x82'),_0x4eba25+'%');}_0x5c450e['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4eba25+'%');}}_0x4a4753[_0x2834('0x44')](_0x5c450e);_0x4a4753[_0x2834('0x83')](_0x2834('0x84'));var _0x52f2eb={'type':db[_0x2834('0x85')][_0x2834('0x86')][_0x2834('0x87')],'raw':!![]};var _0x535fa9=_0x4a4753[_0x2834('0x88')]();_0x535fa9[_0x2834('0x45')](_0x2834('0x84'));_0x535fa9['field'](_0x2834('0x89'),_0x2834('0x8a'));if(_0x12a404[_0x2834('0x8b')]){_0x12a404[_0x2834('0x8b')]['forEach'](function(_0x5aeddf){var _0xc2d7ca=_0x5aeddf[0x0]===_0x2834('0x8c')?_0x5aeddf[0x0]:'i.'+_0x5aeddf[0x0];_0x4a4753[_0x2834('0x8b')](_0xc2d7ca,_0x5aeddf[0x1]===_0x2834('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x5ce134)){_0x4a4753[_0x2834('0x5c')](_0x514710);_0x535fa9[_0x2834('0x44')](_0x2834('0x8e'),_0x5ce134);}BPromise[_0x2834('0x8f')]()['then'](function(){if(!_0x288dd7){if(_0x54ec9c[_0x2834('0x3c')]['FaxAccountId'])return;_0x535fa9[_0x2834('0x44')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x4a4753[_0x2834('0x44')](_0x2834('0x90'));return;}if(_0x54ec9c['user'][_0x2834('0x91')]!==_0x2834('0x92'))return;return _0x54ec9c[_0x2834('0x93')][_0x2834('0x94')]({'attributes':['id'],'raw':!![]})[_0x2834('0x28')](function(_0x1abbd3){if(_[_0x2834('0x70')](_0x1abbd3)){_0x535fa9[_0x2834('0x44')](_0x2834('0x95'));_0x4a4753[_0x2834('0x44')](_0x2834('0x95'));}else{_0x535fa9[_0x2834('0x44')](_0x2834('0x72'),_[_0x2834('0x2e')](_0x1abbd3,'id'));_0x4a4753['where'](_0x2834('0x72'),_['map'](_0x1abbd3,'id'));}});})['then'](function(){if(_0x54ec9c[_0x2834('0x93')][_0x2834('0x91')]===_0x2834('0x92')&&!_0x288dd7&&!_0x54ec9c[_0x2834('0x3c')][_0x2834('0x71')])return[];return db[_0x2834('0x96')][_0x2834('0x3c')](_0x535fa9[_0x2834('0x97')](),_0x52f2eb);})['then'](function(_0x3e9625){_0x340237[_0x2834('0x22')]=_0x3e9625[_0x2834('0x40')];if(_0x340237[_0x2834('0x22')]===0x0)return[];return db[_0x2834('0x96')][_0x2834('0x3c')](_0xdd54a4[_0x2834('0x97')](),_0x52f2eb)['then'](function(_0x46b5a0){_0x580161=_[_0x2834('0x98')](_0x46b5a0,'id');_0x52f2eb=_[_0x2834('0x99')](_0x52f2eb,{'model':db[_0x2834('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x54ec9c[_0x2834('0x3c')]['fields']){_0x12a404[_0x2834('0x3e')][_0x2834('0x32')](function(_0x568c8e){_0x4a4753[_0x2834('0x45')]('i.'+_0x568c8e);});}else{_0x4a4753[_0x2834('0x45')](_0x2834('0x89'),_0x2834('0x8a'));_0x4a4753[_0x2834('0x45')]('a.key',_0x2834('0x9a'));_0x4a4753[_0x2834('0x45')](_0x2834('0x9b'),'Account.mandatoryDisposition');_0x4a4753[_0x2834('0x45')](_0x2834('0x9c'),_0x2834('0x8c'));_0x4a4753[_0x2834('0x45')](_0x2834('0x9d'));_0x4a4753['field'](_0x2834('0x9e'),_0x2834('0x9f'));_0x4a4753[_0x2834('0x45')](_0x2834('0xa0'),_0x2834('0xa1'));_0x4a4753[_0x2834('0x45')](_0x2834('0xa2'),_0x2834('0xa3'));_0x4a4753[_0x2834('0x45')](_0x2834('0xa4'),_0x2834('0xa5'));_0x4a4753[_0x2834('0x45')]('c.mobile',_0x2834('0xa6'));_0x4a4753[_0x2834('0x45')](_0x2834('0xa7'),_0x2834('0xa8'));_0x4a4753[_0x2834('0x45')](_0x2834('0xa9'),_0x2834('0xaa'));_0x4a4753['field'](_0x2834('0xab'),'Owner.internal');_0x4a4753[_0x2834('0x45')](_0x2834('0xac'),_0x2834('0x30'));}if(_0x12a404['limit'])_0x4a4753[_0x2834('0x21')](_0x12a404[_0x2834('0x21')]);if(_0x12a404[_0x2834('0x23')])_0x4a4753[_0x2834('0x23')](_0x12a404[_0x2834('0x23')]);return db[_0x2834('0x96')]['query'](_0x4a4753[_0x2834('0x97')](),_0x52f2eb);})[_0x2834('0x28')](function(_0x3db2ab){if(_0x3db2ab[_0x2834('0x40')]>0x0)_0x54d148['where'](_0x2834('0xad'),_['map'](_0x3db2ab,'id'));return db[_0x2834('0x96')]['query'](_0x54d148[_0x2834('0x97')](),_0x52f2eb)['then'](function(_0x2b3e14){var _0x558df7=_[_0x2834('0xae')](_0x2b3e14,_0x2834('0xaf'));var _0x6e5e5d=[];_0x3db2ab[_0x2834('0x32')](function(_0x5ed367){_0x6e5e5d[_0x2834('0x33')](updateFaxInteraction(_0x5ed367,_0x580161,_0x558df7));});return BPromise[_0x2834('0xb0')](_0x6e5e5d);});});})[_0x2834('0x28')](function(_0x1ee6ef){_0x340237['rows']=_0x1ee6ef;return _0x340237;})['then'](respondWithFilteredResult(_0x1fc752,_0x12a404))['catch'](handleError(_0x1fc752,null));};exports[_0x2834('0xb1')]=function(_0x2d78fc,_0x16f916){var _0x1bf35a={'raw':![],'where':{'id':_0x2d78fc[_0x2834('0xb2')]['id']}},_0x56ebad={};_0x56ebad[_0x2834('0x3a')]=_[_0x2834('0x3b')](db[_0x2834('0x36')][_0x2834('0x37')]);_0x56ebad[_0x2834('0x3c')]=_[_0x2834('0x3b')](_0x2d78fc['query']);_0x56ebad[_0x2834('0x3d')]=_[_0x2834('0xb3')](_0x56ebad[_0x2834('0x3a')],_0x56ebad[_0x2834('0x3c')]);_0x1bf35a[_0x2834('0x3e')]=_[_0x2834('0xb3')](_0x56ebad[_0x2834('0x3a')],qs[_0x2834('0x3f')](_0x2d78fc[_0x2834('0x3c')]['fields']));_0x1bf35a[_0x2834('0x3e')]=_0x1bf35a[_0x2834('0x3e')][_0x2834('0x40')]?_0x1bf35a[_0x2834('0x3e')]:_0x56ebad[_0x2834('0x3a')];if(_0x2d78fc[_0x2834('0x3c')]['includeAll']){_0x1bf35a[_0x2834('0xb4')]=[{'all':!![]}];}_0x1bf35a=_['merge']({},_0x1bf35a,_0x2d78fc[_0x2834('0xb5')]);return db[_0x2834('0x36')]['find'](_0x1bf35a)[_0x2834('0x28')](handleEntityNotFound(_0x16f916,null))[_0x2834('0x28')](respondWithResult(_0x16f916,null))['catch'](handleError(_0x16f916,null));};exports['create']=function(_0x3b8580,_0x97213e){return db['FaxInteraction'][_0x2834('0xb6')](_0x3b8580[_0x2834('0x6d')],{})['then'](respondWithResult(_0x97213e,0xc9))[_0x2834('0x34')](handleError(_0x97213e,null));};exports[_0x2834('0x27')]=function(_0x2d57aa,_0x38b111){if(_0x2d57aa[_0x2834('0x6d')]['id']){delete _0x2d57aa['body']['id'];}return db[_0x2834('0x36')][_0x2834('0x5a')]({'where':{'id':_0x2d57aa[_0x2834('0xb2')]['id']}})['then'](handleEntityNotFound(_0x38b111,null))[_0x2834('0x28')](saveUpdates(_0x2d57aa[_0x2834('0x6d')],null))[_0x2834('0x28')](respondWithResult(_0x38b111,null))[_0x2834('0x34')](handleError(_0x38b111,null));};exports[_0x2834('0x29')]=function(_0x2c677e,_0x577918){return db['FaxInteraction'][_0x2834('0x5a')]({'where':{'id':_0x2c677e[_0x2834('0xb2')]['id']}})[_0x2834('0x28')](handleEntityNotFound(_0x577918,null))[_0x2834('0x28')](removeEntity(_0x577918,null))[_0x2834('0x34')](handleError(_0x577918,null));};exports[_0x2834('0xb7')]=function(_0x3b22fd,_0x3034df){return db[_0x2834('0x36')][_0x2834('0xb7')]()[_0x2834('0x28')](respondWithResult(_0x3034df,null))[_0x2834('0x34')](handleError(_0x3034df,null));};exports[_0x2834('0xb8')]=function(_0x213e45,_0x2fd8c5,_0x5db9ed){return db['FaxMessage'][_0x2834('0x5a')]({'where':{'id':_0x213e45[_0x2834('0xb2')]['id']}})[_0x2834('0x28')](handleEntityNotFound(_0x2fd8c5,null))[_0x2834('0x28')](function(_0x2d43ab){if(_0x2d43ab){return _0x2d43ab[_0x2834('0xb8')](_0x213e45[_0x2834('0x6d')][_0x2834('0xb9')],_['omit'](_0x213e45['body'],[_0x2834('0xb9'),'id'])||{});}})[_0x2834('0x28')](respondWithResult(_0x2fd8c5,null))[_0x2834('0x34')](handleError(_0x2fd8c5,null));};exports['getMessages']=function(_0x891240,_0x5e0dda,_0x22f6c3){var _0x3a71df={'raw':![],'where':{}};var _0x33eb70={};var _0x1d7901={'count':0x0,'rows':[]};return db[_0x2834('0x36')][_0x2834('0xba')]({'where':{'id':_0x891240[_0x2834('0xb2')]['id']}})[_0x2834('0x28')](handleEntityNotFound(_0x5e0dda,null))['then'](function(_0xf0127a){if(_0xf0127a){_0x33eb70['model']=_[_0x2834('0x3b')](db[_0x2834('0xbb')][_0x2834('0x37')]);_0x33eb70[_0x2834('0x3c')]=_['keys'](_0x891240['query']);_0x33eb70[_0x2834('0x3d')]=_['intersection'](_0x33eb70['model'],_0x33eb70[_0x2834('0x3c')]);_0x3a71df[_0x2834('0x3e')]=_[_0x2834('0xb3')](_0x33eb70[_0x2834('0x3a')],qs[_0x2834('0x3f')](_0x891240['query']['fields']));_0x3a71df[_0x2834('0x3e')]=_0x3a71df[_0x2834('0x3e')][_0x2834('0x40')]?_0x3a71df['attributes']:_0x33eb70[_0x2834('0x3a')];if(!_0x891240[_0x2834('0x3c')][_0x2834('0x41')](_0x2834('0x42'))){_0x3a71df[_0x2834('0x21')]=qs[_0x2834('0x21')](_0x891240[_0x2834('0x3c')][_0x2834('0x21')]);_0x3a71df[_0x2834('0x23')]=qs[_0x2834('0x23')](_0x891240[_0x2834('0x3c')][_0x2834('0x23')]);}_0x3a71df[_0x2834('0x8b')]=qs['sort'](_0x891240[_0x2834('0x3c')]['sort']);_0x3a71df[_0x2834('0x44')]=qs[_0x2834('0x3d')](_['pick'](_0x891240[_0x2834('0x3c')],_0x33eb70['filters']));_0x3a71df[_0x2834('0x44')][_0x2834('0xaf')]=_0xf0127a['id'];if(_0x891240[_0x2834('0x3c')][_0x2834('0x7e')]){_0x3a71df[_0x2834('0x44')]=_['merge'](_0x3a71df[_0x2834('0x44')],{'$or':_['map'](_0x3a71df[_0x2834('0x3e')],function(_0x2241b1){var _0x33787d={};_0x33787d[_0x2241b1]={'$like':'%'+_0x891240[_0x2834('0x3c')]['filter']+'%'};return _0x33787d;})});}if(_0x891240[_0x2834('0x3c')][_0x2834('0xbc')]){var _0xabb0cf=_0x891240['query'][_0x2834('0xbc')]['split'](',');var _0x3176a3={};_0x3176a3[_0xabb0cf[0x0]]={'$gte':moment(_0xabb0cf[0x1])[_0x2834('0xbd')](_0x2834('0xbe'))};_0x3a71df['where']=_['merge'](_0x3a71df[_0x2834('0x44')],_0x3176a3);}_0x3a71df=_[_0x2834('0x99')]({},_0x3a71df,_0x891240[_0x2834('0xb5')]);return db[_0x2834('0xbb')]['count']({'where':_0x3a71df['where']})[_0x2834('0x28')](function(_0x3266ad){_0x1d7901['count']=_0x3266ad;if(_0x891240['query']['includeAll']){_0x3a71df[_0x2834('0xb4')]=[{'all':!![]}];}return db[_0x2834('0xbb')][_0x2834('0xbf')](_0x3a71df);})['then'](function(_0x211a55){_0x1d7901[_0x2834('0xc0')]=_0x211a55;return _0x1d7901;});}})[_0x2834('0x28')](respondWithFilteredResult(_0x5e0dda,_0x3a71df))['catch'](handleError(_0x5e0dda,null));};exports[_0x2834('0xc1')]=function(_0x431642,_0x30f794,_0x2661ae){return db[_0x2834('0x36')]['find']({'where':{'id':_0x431642[_0x2834('0xb2')]['id']}})[_0x2834('0x28')](handleEntityNotFound(_0x30f794,null))[_0x2834('0x28')](function(_0x352a04){if(_0x352a04){return _0x352a04[_0x2834('0xc2')](_0x431642[_0x2834('0x6d')][_0x2834('0xb9')],_[_0x2834('0xc3')](_0x431642['body'],[_0x2834('0xb9'),'id'])||{})[_0x2834('0xc4')](function(){return db[_0x2834('0x67')][_0x2834('0xbf')]({'attributes':['id','name',_0x2834('0x46')],'where':{'id':_0x431642[_0x2834('0x6d')][_0x2834('0xb9')]}});})['then'](function(_0x469b49){socket[_0x2834('0xc5')](_0x2834('0xc6'),{'id':Number(_0x431642[_0x2834('0xb2')]['id']),'tags':_0x469b49||[]});return{'id':Number(_0x431642['params']['id']),'tags':_0x469b49||[]};});}})[_0x2834('0x28')](respondWithResult(_0x30f794,null))['catch'](handleError(_0x30f794,null));};exports[_0x2834('0xc7')]=function(_0x40e387,_0x579138,_0x42a8f1){return db[_0x2834('0x36')][_0x2834('0x5a')]({'where':{'id':_0x40e387[_0x2834('0xb2')]['id']}})[_0x2834('0x28')](handleEntityNotFound(_0x579138,null))[_0x2834('0x28')](function(_0x35670b){if(_0x35670b){return _0x35670b['removeTags'](_0x40e387['query']['ids']);}})['then'](respondWithStatusCode(_0x579138,null))[_0x2834('0x34')](handleError(_0x579138,null));};exports[_0x2834('0xc8')]=function(_0x3ee070,_0x4909bc){var _0x324d19=moment()[_0x2834('0xc9')]()[_0x2834('0x97')]();var _0x1329aa=path[_0x2834('0xca')](config['root'],_0x2834('0xcb'),'files','tmp');var _0x3f27a3=path[_0x2834('0xca')](config[_0x2834('0xcc')],_0x2834('0xcb'),_0x2834('0xcd'),_0x2834('0xce'));var _0x387202=path['join'](_0x1329aa,_0x324d19);var _0x44cf08=util[_0x2834('0xbd')](_0x2834('0xcf'),_0x3ee070[_0x2834('0xb2')]['id'],_0x324d19);var _0x492e00=path[_0x2834('0xca')](_0x1329aa,_0x44cf08);var _0xd55322=[];_0xd55322[_0x2834('0x33')]({'model':db[_0x2834('0xd0')],'as':_0x2834('0xd0'),'raw':!![]});var _0x330190=[{'model':db[_0x2834('0xbb')],'as':_0x2834('0xd1'),'attributes':['id',_0x2834('0x6d'),_0x2834('0xd2')],'include':_0xd55322}];return db[_0x2834('0x36')][_0x2834('0x5a')]({'where':{'id':_0x3ee070[_0x2834('0xb2')]['id']},'include':_0x330190})[_0x2834('0x28')](handleEntityNotFound(_0x4909bc,null))[_0x2834('0x28')](function(_0x1d5e85){if(_0x1d5e85&&_0x1d5e85[_0x2834('0xd1')]){var _0x4f288f=_0x1d5e85[_0x2834('0xd3')]({'plain':!![]});fs[_0x2834('0xd4')](_0x387202);for(var _0x17945f=0x0;_0x17945f<_0x4f288f[_0x2834('0xd1')][_0x2834('0x40')];_0x17945f++){var _0x3275ce=_0x4f288f[_0x2834('0xd1')][_0x17945f][_0x2834('0xd0')];if(_0x3275ce){var _0xa33723=path[_0x2834('0xca')](_0x3f27a3,_0x3275ce[_0x2834('0xd5')]);if(fs['existsSync'](_0xa33723)){fs[_0x2834('0xd6')](_0xa33723)[_0x2834('0xd7')](fs[_0x2834('0xd8')](path['join'](_0x387202,_0x3275ce[_0x2834('0xd5')])));}}}return BPromise[_0x2834('0x8f')]()[_0x2834('0x28')](function(){return new BPromise(function(_0xdb359,_0x37b0a8){zipdir(_0x387202,{'saveTo':_0x492e00},function(_0x247b47,_0x43d09d){if(_0x247b47)return _0x37b0a8(_0x247b47);return _0xdb359(_0x43d09d);});})[_0x2834('0x28')](function(){return new BPromise(function(_0x371f0f,_0x568331){rimraf(_0x387202,function(_0x1dec45){if(_0x1dec45)_0x568331(_0x1dec45);return _0x371f0f();});});})[_0x2834('0x28')](function(){return _0x4909bc[_0x2834('0xc8')](_0x492e00,_0x44cf08,function(_0x2087d8){if(_0x2087d8){console[_0x2834('0xd9')](_0x2834('0xda'),_0x2087d8);}else{fs['unlinkSync'](_0x492e00);}});});});}else{return _0x4909bc[_0x2834('0x1c')](0xc8);}})[_0x2834('0x34')](handleError(_0x4909bc,null));}; \ No newline at end of file +var _0x408a=['create','update','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','$gte','format','addTags','spread','Tag','findAll','faxInteractionTags:save','removeTags','download','join','server','files','tmp','root','transcript-%d-%s.zip','Attachment','Messages','get','existsSync','createReadStream','pipe','createWriteStream','basename','err','unlinkSync','sendStatus','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','localhost','redis','./faxInteraction.socket','register','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','name','Users','map','TagIds','Tags','forEach','push','catch','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','end','some','compact','isEmpty','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','includeAll','include','options'];(function(_0x5bdae6,_0x50a3dd){var _0x116917=function(_0x3222bc){while(--_0x3222bc){_0x5bdae6['push'](_0x5bdae6['shift']());}};_0x116917(++_0x50a3dd);}(_0x408a,0xf9));var _0xa408=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x408a[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xa408('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa408('0x1'));var rp=require(_0xa408('0x2'));var moment=require(_0xa408('0x3'));var BPromise=require(_0xa408('0x4'));var Mustache=require(_0xa408('0x5'));var util=require(_0xa408('0x6'));var path=require(_0xa408('0x7'));var sox=require(_0xa408('0x8'));var csv=require(_0xa408('0x9'));var ejs=require(_0xa408('0xa'));var fs=require('fs');var fs_extra=require(_0xa408('0xb'));var _=require('lodash');var squel=require(_0xa408('0xc'));var crypto=require('crypto');var jsforce=require(_0xa408('0xd'));var deskjs=require(_0xa408('0xe'));var toCsv=require(_0xa408('0x9'));var querystring=require(_0xa408('0xf'));var Papa=require('papaparse');var Redis=require(_0xa408('0x10'));var authService=require(_0xa408('0x11'));var qs=require(_0xa408('0x12'));var as=require(_0xa408('0x13'));var hardwareService=require(_0xa408('0x14'));var logger=require(_0xa408('0x15'))(_0xa408('0x16'));var utils=require(_0xa408('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xa408('0x18')](config['redis'],{'host':_0xa408('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa408('0x1a')]));require(_0xa408('0x1b'))[_0xa408('0x1c')](socket);function respondWithStatusCode(_0x29f8f6,_0x4a4d2c){_0x4a4d2c=_0x4a4d2c||0xcc;return function(_0x5e8b62){if(_0x5e8b62){return _0x29f8f6['sendStatus'](_0x4a4d2c);}return _0x29f8f6[_0xa408('0x1d')](_0x4a4d2c)['end']();};}function respondWithResult(_0x2f64ca,_0x2fbf2b){_0x2fbf2b=_0x2fbf2b||0xc8;return function(_0xa4f273){if(_0xa4f273){return _0x2f64ca[_0xa408('0x1d')](_0x2fbf2b)[_0xa408('0x1e')](_0xa4f273);}};}function respondWithFilteredResult(_0x5c2aba,_0x3be8ef){return function(_0x2473d1){if(_0x2473d1){var _0x4be3e5=typeof _0x3be8ef['offset']===_0xa408('0x1f')&&typeof _0x3be8ef[_0xa408('0x20')]===_0xa408('0x1f');var _0xae66ae=_0x2473d1[_0xa408('0x21')];var _0x3a8a5f=_0x4be3e5?0x0:_0x3be8ef[_0xa408('0x22')];var _0x1c59f1=_0x4be3e5?_0x2473d1[_0xa408('0x21')]:_0x3be8ef[_0xa408('0x22')]+_0x3be8ef[_0xa408('0x20')];var _0x51270c;if(_0x1c59f1>=_0xae66ae){_0x1c59f1=_0xae66ae;_0x51270c=0xc8;}else{_0x51270c=0xce;}_0x5c2aba['status'](_0x51270c);return _0x5c2aba['set'](_0xa408('0x23'),_0x3a8a5f+'-'+_0x1c59f1+'/'+_0xae66ae)['json'](_0x2473d1);}return null;};}function patchUpdates(_0x55b236){return function(_0x4e5785){try{jsonpatch[_0xa408('0x24')](_0x4e5785,_0x55b236,!![]);}catch(_0x1a0ef3){return BPromise[_0xa408('0x25')](_0x1a0ef3);}return _0x4e5785[_0xa408('0x26')]();};}function saveUpdates(_0x4cb2ba,_0xffdc6a){return function(_0x165b07){if(_0x165b07){return _0x165b07['update'](_0x4cb2ba)['then'](function(_0x36bfb6){return _0x36bfb6;});}return null;};}function removeEntity(_0x186f74,_0x4a7dca){return function(_0x40ea2d){if(_0x40ea2d){return _0x40ea2d[_0xa408('0x27')]()[_0xa408('0x28')](function(){_0x186f74[_0xa408('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fd566,_0x29fc94){return function(_0x47fc11){if(!_0x47fc11){_0x1fd566['sendStatus'](0x194);}return _0x47fc11;};}function handleError(_0x14dcb1,_0x2c0a30){_0x2c0a30=_0x2c0a30||0x1f4;return function(_0x907caf){logger['error'](_0x907caf['stack']);if(_0x907caf['name']){delete _0x907caf[_0xa408('0x29')];}_0x14dcb1[_0xa408('0x1d')](_0x2c0a30)['send'](_0x907caf);};}function getInteractionUsers(_0x5a9d51,_0x15ce75){return new BPromise(function(_0x7372a8,_0x36ce90){try{if(_0x15ce75[_0x5a9d51['id']]){_0x5a9d51[_0xa408('0x2a')]=_[_0xa408('0x2b')](_0x15ce75[_0x5a9d51['id']],function(_0x5697ea){return{'id':_0x5697ea['id'],'fullname':_0x5697ea['fullname']};});}}catch(_0x1b715b){_0x36ce90(_0x1b715b);}_0x7372a8(_0x5a9d51);});}function getInteractionTags(_0x4e4d0d,_0xb14a7){return new BPromise(function(_0x520b67,_0x276a14){try{if(_0x4e4d0d[_0xa408('0x2c')]){_0x4e4d0d[_0xa408('0x2d')]=[];_0x4e4d0d[_0xa408('0x2c')]['split'](',')[_0xa408('0x2e')](function(_0x246e60){_0x4e4d0d[_0xa408('0x2d')][_0xa408('0x2f')](_0xb14a7[_0x246e60]);});}delete _0x4e4d0d[_0xa408('0x2c')];}catch(_0x1fa83e){_0x276a14(_0x1fa83e);}_0x520b67(_0x4e4d0d);});}function updateFaxInteraction(_0x17a65f,_0x27ccdf,_0x14ccb1){return new BPromise(function(_0x4cda69,_0x526abc){return getInteractionUsers(_0x17a65f,_0x14ccb1)[_0xa408('0x28')](function(_0xad6352){return getInteractionTags(_0xad6352,_0x27ccdf);})[_0xa408('0x28')](function(_0x49d8df){_0x4cda69(_0x49d8df);})[_0xa408('0x30')](function(_0x11d8ef){_0x526abc(_0x11d8ef);});});}exports['index']=function(_0x4208a7,_0x552460){var _0x129727={},_0x394658={},_0x490358={'count':0x0,'rows':[]};var _0x4f0500=_[_0xa408('0x2b')](db[_0xa408('0x31')][_0xa408('0x32')],function(_0x5a977d){return{'name':_0x5a977d[_0xa408('0x33')],'type':_0x5a977d[_0xa408('0x34')][_0xa408('0x35')]};});_0x394658[_0xa408('0x36')]=_[_0xa408('0x2b')](_0x4f0500,_0xa408('0x29'));_0x394658[_0xa408('0x37')]=_[_0xa408('0x38')](_0x4208a7[_0xa408('0x37')]);_0x394658[_0xa408('0x39')]=_[_0xa408('0x3a')](_0x394658[_0xa408('0x36')],_0x394658[_0xa408('0x37')]);_0x129727[_0xa408('0x3b')]=_[_0xa408('0x3a')](_0x394658[_0xa408('0x36')],qs[_0xa408('0x3c')](_0x4208a7[_0xa408('0x37')][_0xa408('0x3c')]));_0x129727[_0xa408('0x3b')]=_0x129727['attributes']['length']?_0x129727[_0xa408('0x3b')]:_0x394658[_0xa408('0x36')];if(!_0x4208a7[_0xa408('0x37')][_0xa408('0x3d')](_0xa408('0x3e'))){_0x129727[_0xa408('0x20')]=qs[_0xa408('0x20')](_0x4208a7[_0xa408('0x37')]['limit']);_0x129727[_0xa408('0x22')]=qs['offset'](_0x4208a7[_0xa408('0x37')][_0xa408('0x22')]);}_0x129727[_0xa408('0x3f')]=qs[_0xa408('0x40')](_0x4208a7[_0xa408('0x37')][_0xa408('0x40')]);_0x129727[_0xa408('0x41')]=qs[_0xa408('0x39')](_[_0xa408('0x42')](_0x4208a7['query'],_0x394658[_0xa408('0x39')]),_0x4f0500);var _0x176580=[];var _0x813e22=squel[_0xa408('0x43')]()[_0xa408('0x44')]('id')[_0xa408('0x44')](_0xa408('0x29'))[_0xa408('0x44')](_0xa408('0x45'))[_0xa408('0x46')](_0xa408('0x47'));var _0x480ad2=squel[_0xa408('0x43')]()[_0xa408('0x44')](_0xa408('0x48'))[_0xa408('0x44')](_0xa408('0x49'))['field']('ui.FaxInteractionId')[_0xa408('0x46')](_0xa408('0x4a'),'ui')[_0xa408('0x4b')](_0xa408('0x4c'),'u',_0xa408('0x4d'));var _0x5ccb99=squel[_0xa408('0x43')]()[_0xa408('0x46')]('fax_interactions','i')[_0xa408('0x4b')](_0xa408('0x4e'),'c',_0xa408('0x4f'))['left_join'](_0xa408('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xa408('0x4b')](_0xa408('0x50'),'a',_0xa408('0x51'))[_0xa408('0x4b')](_0xa408('0x52'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xa408('0x4b')](_0xa408('0x53'),'it',_0xa408('0x54'))['left_join'](_0xa408('0x47'),'t','t.id\x20=\x20it.TagId');var _0x413f11=squel['expr']();var _0x402cd3=[];var _0x3a7890=squel['expr']();var _0x52bc1e;if(_0x4208a7[_0xa408('0x37')][_0xa408('0x55')]){_0x52bc1e=as[_0xa408('0x56')](_0x4208a7[_0xa408('0x37')][_0xa408('0x55')]);var _0x4d5288=_0x52bc1e[_0xa408('0x57')];for(var _0x16fc7e=0x0;_0x16fc7e<_0x52bc1e['conditions'][_0xa408('0x58')];_0x16fc7e++){var _0xb0c5cf=_0x52bc1e[_0xa408('0x59')][_0x16fc7e];var _0x3df486='i';var _0x442a0f=_[_0xa408('0x5a')](_0x4f0500,[_0xa408('0x29'),_0xb0c5cf['field']]);if(!_0x442a0f){switch(_0xb0c5cf[_0xa408('0x44')]){case _0xa408('0x5b'):if(_0xb0c5cf[_0xa408('0x5c')]==0x1){_0x5ccb99[_0xa408('0x5d')]('`'+_0xb0c5cf[_0xa408('0x44')]+_0xa408('0x5e'));}else{_0x5ccb99[_0xa408('0x5d')]('`'+_0xb0c5cf['field']+_0xa408('0x5f'));}break;case _0xa408('0x60'):if(_0xb0c5cf['operator']===_0xa408('0x61')){if(_0xb0c5cf['value'][_0xa408('0x62')]('\x20')[_0xa408('0x58')]>0x1){_0x413f11[_0x4d5288](_0xa408('0x63'),qs['getFullTextValue'](_0xb0c5cf[_0xa408('0x5c')]),null);}else{var _0xb1e08c='%'+_0xb0c5cf[_0xa408('0x5c')]+'%';_0x413f11[_0x4d5288]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xb1e08c,_0xb1e08c,_0xb1e08c);}}else{_0x442a0f=_[_0xa408('0x5a')](_0x4f0500,[_0xa408('0x29'),_0xa408('0x64')]);_0xb0c5cf[_0xa408('0x44')]=_0xa408('0x64');_0x355bb1=as[_0xa408('0x65')](_0x3df486,_0x442a0f[_0xa408('0x34')],_0xb0c5cf);_0x413f11[_0x4d5288](_0x355bb1[_0xa408('0x66')],_0x355bb1[_0xa408('0x5c')][_0xa408('0x67')],_0x355bb1[_0xa408('0x5c')]['end']);}break;case'Tag':var _0x252bf9=_0xb0c5cf[_0xa408('0x5c')][_0xa408('0x62')](',')['map'](function(_0xa57796){return Number(_0xa57796);});_0x252bf9[_0xa408('0x2e')](function(_0x26f2ca){_0x3a7890['or'](_0xa408('0x68'),'%,'+_0x26f2ca+',%');});_0x402cd3=_[_0xa408('0x69')](_0x402cd3,_0x252bf9);break;case _0xa408('0x6a'):if(_0xb0c5cf[_0xa408('0x6b')]==='$substring'){_0x413f11[_0x4d5288](_0xa408('0x6c'),'%'+_0xb0c5cf[_0xa408('0x5c')]+'%',null);}else{_0x442a0f=_['find'](_0x4f0500,[_0xa408('0x29'),_0xa408('0x6d')]);_0xb0c5cf['field']=_0xa408('0x6d');_0x355bb1=as[_0xa408('0x65')](_0x3df486,_0x442a0f['type'],_0xb0c5cf);_0x413f11[_0x4d5288](_0x355bb1[_0xa408('0x66')],_0x355bb1[_0xa408('0x5c')][_0xa408('0x67')],_0x355bb1[_0xa408('0x5c')]['end']);}break;case _0xa408('0x6e'):_0x355bb1=as[_0xa408('0x65')]('me',null,_0xb0c5cf);_0x413f11[_0x4d5288](_0x355bb1['text'],_0x355bb1[_0xa408('0x5c')][_0xa408('0x67')],_0x355bb1[_0xa408('0x5c')][_0xa408('0x6f')]);break;}}else{var _0x355bb1=as[_0xa408('0x65')](_0x3df486,_0x442a0f['type'],_0xb0c5cf);_0x413f11[_0x4d5288](_0x355bb1[_0xa408('0x66')],_0x355bb1['value'][_0xa408('0x67')],_0x355bb1[_0xa408('0x5c')]['end']);}}}else{var _0x4350fb=_(_0x4208a7[_0xa408('0x37')])[_0xa408('0x38')]()[_0xa408('0x2b')](function(_0x51fdb2){return _[_0xa408('0x70')](_0x4f0500,[_0xa408('0x29'),_0x51fdb2])?_0x51fdb2:undefined;})[_0xa408('0x71')]()[_0xa408('0x5c')]();if(!_[_0xa408('0x72')](_0x4350fb)){_0x4350fb['forEach'](function(_0x5645bc){if(_0x5645bc==='FaxAccountId'){_0x5ccb99[_0xa408('0x41')]('i.FaxAccountId\x20IN\x20?',[][_0xa408('0x73')](_0x4208a7[_0xa408('0x37')][_0x5645bc]));}else if(_0x5645bc===_0xa408('0x74')){var _0x4750c6=JSON[_0xa408('0x75')](_0x4208a7[_0xa408('0x37')][_0x5645bc])['$gte'];var _0x30b079=JSON[_0xa408('0x75')](_0x4208a7['query'][_0x5645bc])[_0xa408('0x76')];_0x5ccb99[_0xa408('0x41')](_0xa408('0x77'),_0x4750c6,_0x30b079);}else{if(_0x4208a7[_0xa408('0x37')][_0x5645bc]==='null'){_0x5ccb99['where']('i.'+_0x5645bc+'\x20IS\x20NULL');}else{_0x5ccb99[_0xa408('0x41')]('i.'+_0x5645bc+'\x20=\x20?',_0x4208a7[_0xa408('0x37')][_0x5645bc]);}}});}if(_0x4208a7[_0xa408('0x37')][_0xa408('0x78')]){if(_0x4208a7['query'][_0xa408('0x78')]==0x1){_0x5ccb99[_0xa408('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x5ccb99[_0xa408('0x5d')](_0xa408('0x79'));}}if(_0x4208a7[_0xa408('0x37')][_0xa408('0x7a')]){_0x402cd3=_[_0xa408('0x7b')](_0x4208a7['query'][_0xa408('0x7a')])?_0x4208a7[_0xa408('0x37')][_0xa408('0x7a')]:new Array(_0x4208a7[_0xa408('0x37')][_0xa408('0x7a')]);_0x402cd3[_0xa408('0x2e')](function(_0x5ad272){_0x3a7890['or'](_0xa408('0x68'),'%,'+_0x5ad272+',%');});}if(_0x4208a7[_0xa408('0x37')][_0xa408('0x7c')]){var _0x2c2320=_0x4208a7[_0xa408('0x37')][_0xa408('0x7c')][_0xa408('0x7d')]('\x5c','\x5c\x5c')[_0xa408('0x7d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2c2320)){_0x413f11['or'](_0xa408('0x7e'),_0x2c2320+'%')['or'](_0xa408('0x7f'),_0x2c2320+'%');}_0x413f11['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2c2320+'%');}}_0x5ccb99[_0xa408('0x41')](_0x413f11);_0x5ccb99[_0xa408('0x80')](_0xa408('0x81'));var _0x547829={'type':db[_0xa408('0x82')]['QueryTypes'][_0xa408('0x83')],'raw':!![]};var _0x79a68f=_0x5ccb99['clone']();_0x79a68f['field'](_0xa408('0x81'));_0x79a68f[_0xa408('0x44')](_0xa408('0x84'),_0xa408('0x5b'));if(_0x129727['order']){_0x129727['order'][_0xa408('0x2e')](function(_0x3997ad){var _0x1d4998=_0x3997ad[0x0]==='contactName'?_0x3997ad[0x0]:'i.'+_0x3997ad[0x0];_0x5ccb99[_0xa408('0x3f')](_0x1d4998,_0x3997ad[0x1]===_0xa408('0x85')?![]:!![]);});}if(!_[_0xa408('0x72')](_0x402cd3)){_0x5ccb99[_0xa408('0x5d')](_0x3a7890);_0x79a68f[_0xa408('0x41')](_0xa408('0x86'),_0x402cd3);}BPromise[_0xa408('0x87')]()[_0xa408('0x28')](function(){if(!_0x52bc1e){if(_0x4208a7[_0xa408('0x37')][_0xa408('0x88')])return;_0x79a68f[_0xa408('0x41')](_0xa408('0x89'));_0x5ccb99[_0xa408('0x41')](_0xa408('0x89'));return;}if(_0x4208a7['user']['role']!==_0xa408('0x8a'))return;return _0x4208a7[_0xa408('0x8b')][_0xa408('0x8c')]({'attributes':['id'],'raw':!![]})[_0xa408('0x28')](function(_0x3486b5){if(_['isEmpty'](_0x3486b5)){_0x79a68f[_0xa408('0x41')](_0xa408('0x8d'));_0x5ccb99['where'](_0xa408('0x8d'));}else{_0x79a68f['where'](_0xa408('0x8e'),_['map'](_0x3486b5,'id'));_0x5ccb99[_0xa408('0x41')](_0xa408('0x8e'),_[_0xa408('0x2b')](_0x3486b5,'id'));}});})[_0xa408('0x28')](function(){if(_0x4208a7[_0xa408('0x8b')][_0xa408('0x8f')]==='agent'&&!_0x52bc1e&&!_0x4208a7[_0xa408('0x37')][_0xa408('0x88')])return[];return db[_0xa408('0x90')]['query'](_0x79a68f['toString'](),_0x547829);})[_0xa408('0x28')](function(_0x46ff90){_0x490358[_0xa408('0x21')]=_0x46ff90[_0xa408('0x58')];if(_0x490358[_0xa408('0x21')]===0x0)return[];return db[_0xa408('0x90')]['query'](_0x813e22[_0xa408('0x91')](),_0x547829)['then'](function(_0x553da7){_0x176580=_[_0xa408('0x92')](_0x553da7,'id');_0x547829=_[_0xa408('0x93')](_0x547829,{'model':db[_0xa408('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4208a7[_0xa408('0x37')][_0xa408('0x3c')]){_0x129727[_0xa408('0x3b')][_0xa408('0x2e')](function(_0x3c6a10){_0x5ccb99[_0xa408('0x44')]('i.'+_0x3c6a10);});}else{_0x5ccb99['field'](_0xa408('0x84'),'unreadMessages');_0x5ccb99[_0xa408('0x44')](_0xa408('0x94'),'Account.key');_0x5ccb99[_0xa408('0x44')](_0xa408('0x95'),_0xa408('0x96'));_0x5ccb99[_0xa408('0x44')](_0xa408('0x97'),_0xa408('0x98'));_0x5ccb99[_0xa408('0x44')](_0xa408('0x99'));_0x5ccb99['field'](_0xa408('0x9a'),'Contact.firstName');_0x5ccb99[_0xa408('0x44')](_0xa408('0x9b'),_0xa408('0x9c'));_0x5ccb99[_0xa408('0x44')](_0xa408('0x9d'),_0xa408('0x9e'));_0x5ccb99[_0xa408('0x44')](_0xa408('0x9f'),_0xa408('0xa0'));_0x5ccb99[_0xa408('0x44')](_0xa408('0xa1'),_0xa408('0xa2'));_0x5ccb99['field'](_0xa408('0xa3'),_0xa408('0xa4'));_0x5ccb99['field'](_0xa408('0xa5'),_0xa408('0xa6'));_0x5ccb99[_0xa408('0x44')]('o.internal',_0xa408('0xa7'));_0x5ccb99[_0xa408('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa408('0x2c'));}if(_0x129727[_0xa408('0x20')])_0x5ccb99[_0xa408('0x20')](_0x129727['limit']);if(_0x129727[_0xa408('0x22')])_0x5ccb99[_0xa408('0x22')](_0x129727[_0xa408('0x22')]);return db['sequelize']['query'](_0x5ccb99[_0xa408('0x91')](),_0x547829);})[_0xa408('0x28')](function(_0x401d77){if(_0x401d77[_0xa408('0x58')]>0x0)_0x480ad2[_0xa408('0x41')](_0xa408('0xa8'),_[_0xa408('0x2b')](_0x401d77,'id'));return db[_0xa408('0x90')][_0xa408('0x37')](_0x480ad2[_0xa408('0x91')](),_0x547829)['then'](function(_0x2d4ada){var _0x39044b=_[_0xa408('0xa9')](_0x2d4ada,_0xa408('0xaa'));var _0x3ec07b=[];_0x401d77['forEach'](function(_0x203c1f){_0x3ec07b[_0xa408('0x2f')](updateFaxInteraction(_0x203c1f,_0x176580,_0x39044b));});return BPromise[_0xa408('0xab')](_0x3ec07b);});});})[_0xa408('0x28')](function(_0x53d188){_0x490358[_0xa408('0xac')]=_0x53d188;return _0x490358;})[_0xa408('0x28')](respondWithFilteredResult(_0x552460,_0x129727))[_0xa408('0x30')](handleError(_0x552460,null));};exports[_0xa408('0xad')]=function(_0xa19f10,_0x42efd9){var _0x393aac={'raw':![],'where':{'id':_0xa19f10['params']['id']}},_0x1c4fb7={};_0x1c4fb7[_0xa408('0x36')]=_['keys'](db[_0xa408('0x31')]['rawAttributes']);_0x1c4fb7[_0xa408('0x37')]=_['keys'](_0xa19f10[_0xa408('0x37')]);_0x1c4fb7[_0xa408('0x39')]=_[_0xa408('0x3a')](_0x1c4fb7[_0xa408('0x36')],_0x1c4fb7[_0xa408('0x37')]);_0x393aac[_0xa408('0x3b')]=_[_0xa408('0x3a')](_0x1c4fb7[_0xa408('0x36')],qs['fields'](_0xa19f10[_0xa408('0x37')]['fields']));_0x393aac[_0xa408('0x3b')]=_0x393aac['attributes'][_0xa408('0x58')]?_0x393aac[_0xa408('0x3b')]:_0x1c4fb7[_0xa408('0x36')];if(_0xa19f10[_0xa408('0x37')][_0xa408('0xae')]){_0x393aac[_0xa408('0xaf')]=[{'all':!![]}];}_0x393aac=_[_0xa408('0x93')]({},_0x393aac,_0xa19f10[_0xa408('0xb0')]);return db['FaxInteraction'][_0xa408('0x5a')](_0x393aac)[_0xa408('0x28')](handleEntityNotFound(_0x42efd9,null))[_0xa408('0x28')](respondWithResult(_0x42efd9,null))['catch'](handleError(_0x42efd9,null));};exports[_0xa408('0xb1')]=function(_0x3841c0,_0x2dedcb){return db[_0xa408('0x31')][_0xa408('0xb1')](_0x3841c0['body'],{})[_0xa408('0x28')](respondWithResult(_0x2dedcb,0xc9))[_0xa408('0x30')](handleError(_0x2dedcb,null));};exports[_0xa408('0xb2')]=function(_0x21ca43,_0x57f433){if(_0x21ca43['body']['id']){delete _0x21ca43[_0xa408('0x6e')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x21ca43[_0xa408('0xb3')]['id']}})[_0xa408('0x28')](handleEntityNotFound(_0x57f433,null))[_0xa408('0x28')](saveUpdates(_0x21ca43[_0xa408('0x6e')],null))[_0xa408('0x28')](respondWithResult(_0x57f433,null))[_0xa408('0x30')](handleError(_0x57f433,null));};exports['destroy']=function(_0x4e6ac3,_0x110501){return db[_0xa408('0x31')][_0xa408('0x5a')]({'where':{'id':_0x4e6ac3[_0xa408('0xb3')]['id']}})['then'](handleEntityNotFound(_0x110501,null))[_0xa408('0x28')](removeEntity(_0x110501,null))['catch'](handleError(_0x110501,null));};exports[_0xa408('0xb4')]=function(_0x24bdf9,_0x251f5a){return db[_0xa408('0x31')]['describe']()[_0xa408('0x28')](respondWithResult(_0x251f5a,null))[_0xa408('0x30')](handleError(_0x251f5a,null));};exports[_0xa408('0xb5')]=function(_0x3ab01c,_0x91e2d3,_0x350e5b){return db[_0xa408('0xb6')][_0xa408('0x5a')]({'where':{'id':_0x3ab01c[_0xa408('0xb3')]['id']}})[_0xa408('0x28')](handleEntityNotFound(_0x91e2d3,null))[_0xa408('0x28')](function(_0xed7117){if(_0xed7117){return _0xed7117[_0xa408('0xb5')](_0x3ab01c[_0xa408('0x6e')][_0xa408('0xb7')],_[_0xa408('0xb8')](_0x3ab01c[_0xa408('0x6e')],[_0xa408('0xb7'),'id'])||{});}})[_0xa408('0x28')](respondWithResult(_0x91e2d3,null))[_0xa408('0x30')](handleError(_0x91e2d3,null));};exports[_0xa408('0xb9')]=function(_0x49220e,_0x16f28c,_0x3289df){var _0xbe05d9={'raw':![],'where':{}};var _0x2d7c6e={};var _0xeb84f6={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xa408('0xba')]({'where':{'id':_0x49220e[_0xa408('0xb3')]['id']}})[_0xa408('0x28')](handleEntityNotFound(_0x16f28c,null))[_0xa408('0x28')](function(_0x8fefa0){if(_0x8fefa0){_0x2d7c6e[_0xa408('0x36')]=_[_0xa408('0x38')](db[_0xa408('0xb6')]['rawAttributes']);_0x2d7c6e[_0xa408('0x37')]=_[_0xa408('0x38')](_0x49220e['query']);_0x2d7c6e[_0xa408('0x39')]=_['intersection'](_0x2d7c6e[_0xa408('0x36')],_0x2d7c6e[_0xa408('0x37')]);_0xbe05d9[_0xa408('0x3b')]=_[_0xa408('0x3a')](_0x2d7c6e[_0xa408('0x36')],qs[_0xa408('0x3c')](_0x49220e[_0xa408('0x37')][_0xa408('0x3c')]));_0xbe05d9['attributes']=_0xbe05d9[_0xa408('0x3b')][_0xa408('0x58')]?_0xbe05d9[_0xa408('0x3b')]:_0x2d7c6e['model'];if(!_0x49220e[_0xa408('0x37')]['hasOwnProperty']('nolimit')){_0xbe05d9[_0xa408('0x20')]=qs[_0xa408('0x20')](_0x49220e[_0xa408('0x37')][_0xa408('0x20')]);_0xbe05d9[_0xa408('0x22')]=qs[_0xa408('0x22')](_0x49220e[_0xa408('0x37')][_0xa408('0x22')]);}_0xbe05d9[_0xa408('0x3f')]=qs[_0xa408('0x40')](_0x49220e['query']['sort']);_0xbe05d9['where']=qs['filters'](_[_0xa408('0x42')](_0x49220e[_0xa408('0x37')],_0x2d7c6e[_0xa408('0x39')]));_0xbe05d9[_0xa408('0x41')][_0xa408('0xaa')]=_0x8fefa0['id'];if(_0x49220e[_0xa408('0x37')][_0xa408('0x7c')]){_0xbe05d9[_0xa408('0x41')]=_['merge'](_0xbe05d9[_0xa408('0x41')],{'$or':_[_0xa408('0x2b')](_0xbe05d9[_0xa408('0x3b')],function(_0x38bdba){var _0x497aaf={};_0x497aaf[_0x38bdba]={'$like':'%'+_0x49220e[_0xa408('0x37')][_0xa408('0x7c')]+'%'};return _0x497aaf;})});}if(_0x49220e[_0xa408('0x37')][_0xa408('0xbb')]){var _0x54ff4a=_0x49220e['query'][_0xa408('0xbb')][_0xa408('0x62')](',');var _0x588497={};_0x588497[_0x54ff4a[0x0]]={'$gte':moment(_0x54ff4a[0x1])[_0xa408('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0xbe05d9[_0xa408('0x41')]=_[_0xa408('0x93')](_0xbe05d9['where'],_0x588497);}_0xbe05d9=_[_0xa408('0x93')]({},_0xbe05d9,_0x49220e[_0xa408('0xb0')]);return db[_0xa408('0xb6')][_0xa408('0x21')]({'where':_0xbe05d9[_0xa408('0x41')]})['then'](function(_0xbeb44b){_0xeb84f6['count']=_0xbeb44b;if(_0x49220e[_0xa408('0x37')][_0xa408('0xae')]){_0xbe05d9[_0xa408('0xaf')]=[{'all':!![]}];}return db[_0xa408('0xb6')]['findAll'](_0xbe05d9);})[_0xa408('0x28')](function(_0xfcebc){_0xeb84f6[_0xa408('0xac')]=_0xfcebc;return _0xeb84f6;});}})[_0xa408('0x28')](respondWithFilteredResult(_0x16f28c,_0xbe05d9))['catch'](handleError(_0x16f28c,null));};exports[_0xa408('0xbd')]=function(_0xe23f54,_0x5372d3,_0x59e994){return db[_0xa408('0x31')][_0xa408('0x5a')]({'where':{'id':_0xe23f54[_0xa408('0xb3')]['id']}})[_0xa408('0x28')](handleEntityNotFound(_0x5372d3,null))[_0xa408('0x28')](function(_0x2f0613){if(_0x2f0613){return _0x2f0613['setTags'](_0xe23f54['body'][_0xa408('0xb7')],_[_0xa408('0xb8')](_0xe23f54[_0xa408('0x6e')],[_0xa408('0xb7'),'id'])||{})[_0xa408('0xbe')](function(){return db[_0xa408('0xbf')][_0xa408('0xc0')]({'attributes':['id',_0xa408('0x29'),_0xa408('0x45')],'where':{'id':_0xe23f54['body'][_0xa408('0xb7')]}});})[_0xa408('0x28')](function(_0x15a115){socket['emit'](_0xa408('0xc1'),{'id':Number(_0xe23f54[_0xa408('0xb3')]['id']),'tags':_0x15a115||[]});return{'id':Number(_0xe23f54[_0xa408('0xb3')]['id']),'tags':_0x15a115||[]};});}})[_0xa408('0x28')](respondWithResult(_0x5372d3,null))[_0xa408('0x30')](handleError(_0x5372d3,null));};exports['removeTags']=function(_0x4cd3cb,_0xf376ab,_0x236712){return db['FaxInteraction'][_0xa408('0x5a')]({'where':{'id':_0x4cd3cb[_0xa408('0xb3')]['id']}})[_0xa408('0x28')](handleEntityNotFound(_0xf376ab,null))[_0xa408('0x28')](function(_0x13e064){if(_0x13e064){return _0x13e064[_0xa408('0xc2')](_0x4cd3cb[_0xa408('0x37')][_0xa408('0xb7')]);}})[_0xa408('0x28')](respondWithStatusCode(_0xf376ab,null))[_0xa408('0x30')](handleError(_0xf376ab,null));};exports[_0xa408('0xc3')]=function(_0x1a1aa2,_0xbdfd34){var _0x3f9186=moment()['unix']()[_0xa408('0x91')]();var _0x5b22c6=path[_0xa408('0xc4')](config['root'],_0xa408('0xc5'),_0xa408('0xc6'),_0xa408('0xc7'));var _0x173ab0=path['join'](config[_0xa408('0xc8')],'server',_0xa408('0xc6'),'attachments');var _0x3f3796=path[_0xa408('0xc4')](_0x5b22c6,_0x3f9186);var _0x2b4013=util['format'](_0xa408('0xc9'),_0x1a1aa2[_0xa408('0xb3')]['id'],_0x3f9186);var _0x1b260c=path[_0xa408('0xc4')](_0x5b22c6,_0x2b4013);var _0x3b41fb=[];_0x3b41fb[_0xa408('0x2f')]({'model':db[_0xa408('0xca')],'as':_0xa408('0xca'),'raw':!![]});var _0xd93eaa=[{'model':db[_0xa408('0xb6')],'as':_0xa408('0xcb'),'attributes':['id',_0xa408('0x6e'),_0xa408('0x74')],'include':_0x3b41fb}];return db['FaxInteraction'][_0xa408('0x5a')]({'where':{'id':_0x1a1aa2['params']['id']},'include':_0xd93eaa})['then'](handleEntityNotFound(_0xbdfd34,null))[_0xa408('0x28')](function(_0x43f6ef){if(_0x43f6ef&&_0x43f6ef[_0xa408('0xcb')]){var _0x2127f8=_0x43f6ef[_0xa408('0xcc')]({'plain':!![]});fs['mkdirSync'](_0x3f3796);for(var _0xd3026d=0x0;_0xd3026d<_0x2127f8['Messages'][_0xa408('0x58')];_0xd3026d++){var _0x1ede07=_0x2127f8[_0xa408('0xcb')][_0xd3026d][_0xa408('0xca')];if(_0x1ede07){var _0x26f694=path['join'](_0x173ab0,_0x1ede07['basename']);if(fs[_0xa408('0xcd')](_0x26f694)){fs[_0xa408('0xce')](_0x26f694)[_0xa408('0xcf')](fs[_0xa408('0xd0')](path[_0xa408('0xc4')](_0x3f3796,_0x1ede07[_0xa408('0xd1')])));}}}return BPromise[_0xa408('0x87')]()[_0xa408('0x28')](function(){return new BPromise(function(_0x49898c,_0x5d5dbb){zipdir(_0x3f3796,{'saveTo':_0x1b260c},function(_0x42823b,_0x5eb983){if(_0x42823b)return _0x5d5dbb(_0x42823b);return _0x49898c(_0x5eb983);});})[_0xa408('0x28')](function(){return new BPromise(function(_0x52f37e,_0xa40400){rimraf(_0x3f3796,function(_0x29298e){if(_0x29298e)_0xa40400(_0x29298e);return _0x52f37e();});});})[_0xa408('0x28')](function(){return _0xbdfd34['download'](_0x1b260c,_0x2b4013,function(_0x50751a){if(_0x50751a){console['log'](_0xa408('0xd2'),_0x50751a);}else{fs[_0xa408('0xd3')](_0x1b260c);}});});});}else{return _0xbdfd34[_0xa408('0xd4')](0xc8);}})[_0xa408('0x30')](handleError(_0xbdfd34,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 67d1405..8dde2ff 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 _0xcd1a=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','save','remove','then','setDataValue','Users','map','findAll'];(function(_0x2fc403,_0x5b052a){var _0xe7f1ff=function(_0xe0a58e){while(--_0xe0a58e){_0x2fc403['push'](_0x2fc403['shift']());}};_0xe7f1ff(++_0x5b052a);}(_0xcd1a,0x1f4));var _0xacd1=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xcd1a[_0x3070dc];return _0x431489;};'use strict';var EventEmitter=require(_0xacd1('0x0'));var FaxInteraction=require(_0xacd1('0x1'))['db'][_0xacd1('0x2')];var FaxMessage=require(_0xacd1('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xacd1('0x3'),'afterUpdate':'update','afterDestroy':_0xacd1('0x4')};function emitEvent(_0x56cb54){return function(_0x57b979,_0xe4f602,_0x3608bc){_0x57b979['getUsers']({'attributes':['id'],'raw':!![]})[_0xacd1('0x5')](function(_0x377e87){_0x57b979[_0xacd1('0x6')](_0xacd1('0x7'),_0x377e87[_0xacd1('0x8')](function(_0x911e7c){return{'id':_0x911e7c['id']};}));return FaxMessage[_0xacd1('0x9')]({'where':{'FaxInteractionId':_0x57b979['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3a105d){_0x57b979[_0xacd1('0x6')](_0xacd1('0xa'),_0x3a105d[_0xacd1('0xb')]);FaxInteractionEvents[_0xacd1('0xc')](_0x56cb54+':'+_0x57b979['id'],_0x57b979);FaxInteractionEvents['emit'](_0x56cb54,_0x57b979);_0x3608bc(null);})[_0xacd1('0xd')](_0x3608bc(null));};}for(var e in events){if(events[_0xacd1('0xe')](e)){var event=events[e];FaxInteraction[_0xacd1('0xf')](e,emitEvent(event));}}module[_0xacd1('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xe466=['exports','events','../../mysqldb','FaxInteraction','update','remove','getUsers','then','Users','map','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0xe466,0x178));var _0x6e46=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xe466[_0x4a747d];return _0x3a5b5c;};'use strict';var EventEmitter=require(_0x6e46('0x0'));var FaxInteraction=require(_0x6e46('0x1'))['db'][_0x6e46('0x2')];var FaxMessage=require(_0x6e46('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6e46('0x3'),'afterDestroy':_0x6e46('0x4')};function emitEvent(_0x21987e){return function(_0x513cd9,_0x5578d3,_0x191969){_0x513cd9[_0x6e46('0x5')]({'attributes':['id'],'raw':!![]})[_0x6e46('0x6')](function(_0x219da6){_0x513cd9['setDataValue'](_0x6e46('0x7'),_0x219da6[_0x6e46('0x8')](function(_0xe58788){return{'id':_0xe58788['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x513cd9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6e46('0x6')](function(_0x2d5c2c){_0x513cd9['setDataValue'](_0x6e46('0x9'),_0x2d5c2c[_0x6e46('0xa')]);FaxInteractionEvents[_0x6e46('0xb')](_0x21987e+':'+_0x513cd9['id'],_0x513cd9);FaxInteractionEvents['emit'](_0x21987e,_0x513cd9);_0x191969(null);})[_0x6e46('0xc')](_0x191969(null));};}for(var e in events){if(events[_0x6e46('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x6e46('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 780a63f..a5b326a 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 _0xc7c3=['util','../../config/logger','request-promise','path','../../config/environment','./faxInteraction.attributes','FaxInteraction','fax_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3a441a,_0x43eb56){var _0x3128a2=function(_0x5d5a17){while(--_0x5d5a17){_0x3a441a['push'](_0x3a441a['shift']());}};_0x3128a2(++_0x43eb56);}(_0xc7c3,0x143));var _0x3c7c=function(_0x54c289,_0x247de9){_0x54c289=_0x54c289-0x0;var _0x46edb1=_0xc7c3[_0x54c289];return _0x46edb1;};'use strict';var _=require(_0x3c7c('0x0'));var util=require(_0x3c7c('0x1'));var logger=require(_0x3c7c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3c7c('0x3'));var fs=require('fs');var path=require(_0x3c7c('0x4'));var rimraf=require('rimraf');var config=require(_0x3c7c('0x5'));var attributes=require(_0x3c7c('0x6'));module['exports']=function(_0xc36ebc,_0x321cc5){return _0xc36ebc['define'](_0x3c7c('0x7'),attributes,{'tableName':_0x3c7c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x166e42,_0x3d160c,_0x186f61){if(_0x166e42[_0x3c7c('0x9')]('closed')){_0x166e42['closedAt']=moment()[_0x3c7c('0xa')](_0x3c7c('0xb'));}_0x186f61(null,_0x166e42);}}});}; \ No newline at end of file +var _0x842c=['api','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x842c,0x1de));var _0xc842=function(_0x4925ea,_0x57dc16){_0x4925ea=_0x4925ea-0x0;var _0x4d7f04=_0x842c[_0x4925ea];return _0x4d7f04;};'use strict';var _=require(_0xc842('0x0'));var util=require(_0xc842('0x1'));var logger=require('../../config/logger')(_0xc842('0x2'));var moment=require(_0xc842('0x3'));var BPromise=require(_0xc842('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc842('0x5'));var rimraf=require(_0xc842('0x6'));var config=require(_0xc842('0x7'));var attributes=require(_0xc842('0x8'));module['exports']=function(_0x2b24da,_0x5c88a2){return _0x2b24da[_0xc842('0x9')](_0xc842('0xa'),attributes,{'tableName':_0xc842('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9e4021,_0x5b3a61,_0x5a87e5){if(_0x9e4021[_0xc842('0xc')]('closed')){_0x9e4021[_0xc842('0xd')]=moment()[_0xc842('0xe')](_0xc842('0xf'));}_0x5a87e5(null,_0x9e4021);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index e7e7ab6..8b2e8ad 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 _0x58af=['catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','where','then','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x408ad6,_0x186394){var _0x4d38c2=function(_0x1ad425){while(--_0x1ad425){_0x408ad6['push'](_0x408ad6['shift']());}};_0x4d38c2(++_0x186394);}(_0x58af,0x94));var _0xf58a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x58af[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf58a('0x0'));var util=require('util');var moment=require(_0xf58a('0x1'));var BPromise=require(_0xf58a('0x2'));var rs=require(_0xf58a('0x3'));var fs=require('fs');var Redis=require(_0xf58a('0x4'));var db=require(_0xf58a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf58a('0x6'))(_0xf58a('0x7'));var config=require(_0xf58a('0x8'));var jayson=require(_0xf58a('0x9'));var client=jayson[_0xf58a('0xa')][_0xf58a('0xb')]({'port':0x232a});config[_0xf58a('0xc')]=_[_0xf58a('0xd')](config[_0xf58a('0xc')],{'host':_0xf58a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf58a('0xf'))[_0xf58a('0x10')](socket);function respondWithRpcPromise(_0x2d8b85,_0x509f56,_0x20ddc6){return new BPromise(function(_0xa9135a,_0x57f719){return client[_0xf58a('0x11')](_0x2d8b85,_0x20ddc6)['then'](function(_0x573ec8){logger[_0xf58a('0x12')](_0xf58a('0x13'),_0x509f56,_0xf58a('0x14'));logger[_0xf58a('0x15')](_0xf58a('0x16'),_0x509f56,_0xf58a('0x14'),JSON[_0xf58a('0x17')](_0x573ec8));if(_0x573ec8[_0xf58a('0x18')]){if(_0x573ec8['error'][_0xf58a('0x19')]===0x1f4){logger['error'](_0xf58a('0x13'),_0x509f56,_0x573ec8['error']['message']);return _0x57f719(_0x573ec8['error']['message']);}logger[_0xf58a('0x18')](_0xf58a('0x13'),_0x509f56,_0x573ec8[_0xf58a('0x18')][_0xf58a('0x1a')]);return _0xa9135a(_0x573ec8['error'][_0xf58a('0x1a')]);}else{logger[_0xf58a('0x12')](_0xf58a('0x13'),_0x509f56,_0xf58a('0x14'));_0xa9135a(_0x573ec8[_0xf58a('0x1b')][_0xf58a('0x1a')]);}})[_0xf58a('0x1c')](function(_0x1b5d45){logger[_0xf58a('0x18')](_0xf58a('0x13'),_0x509f56,_0x1b5d45);_0x57f719(_0x1b5d45);});});}exports[_0xf58a('0x1d')]=function(_0x3df4dc){var _0x40be43=this;return new Promise(function(_0x41a21c,_0x133b42){return db[_0xf58a('0x1e')][_0xf58a('0x1f')](_0x3df4dc[_0xf58a('0x20')],{'raw':_0x3df4dc[_0xf58a('0x21')]?_0x3df4dc['options'][_0xf58a('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3df4dc['options']?_0x3df4dc[_0xf58a('0x21')]['where']||null:null,'attributes':_0x3df4dc[_0xf58a('0x21')]?_0x3df4dc[_0xf58a('0x21')][_0xf58a('0x23')]||null:null,'limit':_0x3df4dc['options']?_0x3df4dc[_0xf58a('0x21')][_0xf58a('0x24')]||null:null})['then'](function(_0x39ba80){logger[_0xf58a('0x12')]('UpdateFaxInteraction',_0x3df4dc);logger[_0xf58a('0x15')](_0xf58a('0x1d'),_0x3df4dc,JSON[_0xf58a('0x17')](_0x39ba80));_0x41a21c(_0x39ba80);})['catch'](function(_0x9e5cc8){logger[_0xf58a('0x18')](_0xf58a('0x1d'),_0x9e5cc8[_0xf58a('0x1a')],_0x3df4dc);_0x133b42(_0x40be43[_0xf58a('0x18')](0x1f4,_0x9e5cc8['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x3a1cab){return new Promise(function(_0x56024f,_0x212326){return db['FaxInteraction']['find']({'where':_0x3a1cab[_0xf58a('0x21')]?_0x3a1cab['options'][_0xf58a('0x25')]||null:null})[_0xf58a('0x26')](function(_0x9af097){if(_0x9af097){return _0x9af097[_0xf58a('0x27')](_0x3a1cab[_0xf58a('0x20')][_0xf58a('0x28')],_[_0xf58a('0x29')](_0x3a1cab[_0xf58a('0x20')],[_0xf58a('0x28'),'id'])||{});}})[_0xf58a('0x2a')](function(_0x5c5b45){logger[_0xf58a('0x12')]('AddTags',_0x3a1cab);logger[_0xf58a('0x15')](_0xf58a('0x2b'),_0x3a1cab,JSON[_0xf58a('0x17')](_0x5c5b45));_0x56024f(_0x5c5b45);})['catch'](function(_0x23481c){logger[_0xf58a('0x18')](_0xf58a('0x2b'),_0x23481c['message'],_0x3a1cab);_0x212326(_this[_0xf58a('0x18')](0x1f4,_0x23481c[_0xf58a('0x1a')]));});});}; \ No newline at end of file +var _0x5fc7=['defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','where','attributes','then','AddTagsToFaxInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x1e8d10,_0x84f524){var _0x44e78d=function(_0x311087){while(--_0x311087){_0x1e8d10['push'](_0x1e8d10['shift']());}};_0x44e78d(++_0x84f524);}(_0x5fc7,0x184));var _0x75fc=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x5fc7[_0x58a4ac];return _0x545810;};'use strict';var _=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var moment=require(_0x75fc('0x2'));var BPromise=require(_0x75fc('0x3'));var rs=require(_0x75fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75fc('0x5'))['db'];var utils=require(_0x75fc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x75fc('0x7'));var jayson=require(_0x75fc('0x8'));var client=jayson[_0x75fc('0x9')][_0x75fc('0xa')]({'port':0x232a});config[_0x75fc('0xb')]=_[_0x75fc('0xc')](config[_0x75fc('0xb')],{'host':_0x75fc('0xd'),'port':0x18eb});var socket=require(_0x75fc('0xe'))(new Redis(config[_0x75fc('0xb')]));require(_0x75fc('0xf'))['register'](socket);function respondWithRpcPromise(_0x124de3,_0x11629c,_0xdc8862){return new BPromise(function(_0x4feda4,_0x35c786){return client[_0x75fc('0x10')](_0x124de3,_0xdc8862)['then'](function(_0x28ff02){logger[_0x75fc('0x11')](_0x75fc('0x12'),_0x11629c,_0x75fc('0x13'));logger[_0x75fc('0x14')](_0x75fc('0x15'),_0x11629c,_0x75fc('0x13'),JSON[_0x75fc('0x16')](_0x28ff02));if(_0x28ff02[_0x75fc('0x17')]){if(_0x28ff02[_0x75fc('0x17')][_0x75fc('0x18')]===0x1f4){logger['error'](_0x75fc('0x12'),_0x11629c,_0x28ff02[_0x75fc('0x17')][_0x75fc('0x19')]);return _0x35c786(_0x28ff02[_0x75fc('0x17')][_0x75fc('0x19')]);}logger['error'](_0x75fc('0x12'),_0x11629c,_0x28ff02[_0x75fc('0x17')][_0x75fc('0x19')]);return _0x4feda4(_0x28ff02[_0x75fc('0x17')]['message']);}else{logger[_0x75fc('0x11')](_0x75fc('0x12'),_0x11629c,_0x75fc('0x13'));_0x4feda4(_0x28ff02[_0x75fc('0x1a')][_0x75fc('0x19')]);}})[_0x75fc('0x1b')](function(_0x26673c){logger[_0x75fc('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x11629c,_0x26673c);_0x35c786(_0x26673c);});});}exports[_0x75fc('0x1c')]=function(_0x3e5a9a){var _0x31e186=this;return new Promise(function(_0x55771b,_0x1f1cc5){return db[_0x75fc('0x1d')]['update'](_0x3e5a9a[_0x75fc('0x1e')],{'raw':_0x3e5a9a[_0x75fc('0x1f')]?_0x3e5a9a[_0x75fc('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e5a9a[_0x75fc('0x1f')]?_0x3e5a9a[_0x75fc('0x1f')][_0x75fc('0x20')]||null:null,'attributes':_0x3e5a9a[_0x75fc('0x1f')]?_0x3e5a9a[_0x75fc('0x1f')][_0x75fc('0x21')]||null:null,'limit':_0x3e5a9a['options']?_0x3e5a9a[_0x75fc('0x1f')]['limit']||null:null})[_0x75fc('0x22')](function(_0x261872){logger['info'](_0x75fc('0x1c'),_0x3e5a9a);logger['debug'](_0x75fc('0x1c'),_0x3e5a9a,JSON['stringify'](_0x261872));_0x55771b(_0x261872);})[_0x75fc('0x1b')](function(_0x4fbfc8){logger[_0x75fc('0x17')](_0x75fc('0x1c'),_0x4fbfc8['message'],_0x3e5a9a);_0x1f1cc5(_0x31e186[_0x75fc('0x17')](0x1f4,_0x4fbfc8[_0x75fc('0x19')]));});});};exports[_0x75fc('0x23')]=function(_0x33f625){return new Promise(function(_0xc953ce,_0x43069f){return db[_0x75fc('0x1d')][_0x75fc('0x24')]({'where':_0x33f625[_0x75fc('0x1f')]?_0x33f625[_0x75fc('0x1f')][_0x75fc('0x20')]||null:null})['then'](function(_0x31d670){if(_0x31d670){return _0x31d670['addTags'](_0x33f625[_0x75fc('0x1e')][_0x75fc('0x25')],_[_0x75fc('0x26')](_0x33f625[_0x75fc('0x1e')],[_0x75fc('0x25'),'id'])||{});}})['spread'](function(_0x4828e6){logger['info'](_0x75fc('0x27'),_0x33f625);logger['debug']('AddTags',_0x33f625,JSON['stringify'](_0x4828e6));_0xc953ce(_0x4828e6);})[_0x75fc('0x1b')](function(_0x3fbae3){logger[_0x75fc('0x17')]('AddTags',_0x3fbae3[_0x75fc('0x19')],_0x33f625);_0x43069f(_this[_0x75fc('0x17')](0x1f4,_0x3fbae3[_0x75fc('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 2331b2f..69cb8b9 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 _0xcec3=['length','faxInteraction:','./faxInteraction.events','remove','removeListener'];(function(_0x52b4e1,_0x169ee0){var _0x1789b8=function(_0x340cf2){while(--_0x340cf2){_0x52b4e1['push'](_0x52b4e1['shift']());}};_0x1789b8(++_0x169ee0);}(_0xcec3,0x1c4));var _0x3cec=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcec3[_0x19950b];return _0x3c6b41;};'use strict';var FaxInteractionEvents=require(_0x3cec('0x0'));var events=['save',_0x3cec('0x1'),'update'];function createListener(_0x486c0a,_0x718e14){return function(_0x2318b8){_0x718e14['emit'](_0x486c0a,_0x2318b8);};}function removeListener(_0x2535d3,_0x2aec86){return function(){FaxInteractionEvents[_0x3cec('0x2')](_0x2535d3,_0x2aec86);};}exports['register']=function(_0x120e62){for(var _0x551d10=0x0,_0x3f5a08=events[_0x3cec('0x3')];_0x551d10<_0x3f5a08;_0x551d10++){var _0x4b5246=events[_0x551d10];var _0x43a8fb=createListener(_0x3cec('0x4')+_0x4b5246,_0x120e62);FaxInteractionEvents['on'](_0x4b5246,_0x43a8fb);}}; \ No newline at end of file +var _0x8ce3=['update','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x99facc,_0x548cd6){var _0xd39ed0=function(_0x207e47){while(--_0x207e47){_0x99facc['push'](_0x99facc['shift']());}};_0xd39ed0(++_0x548cd6);}(_0x8ce3,0x175));var _0x38ce=function(_0x31db2b,_0xb218b7){_0x31db2b=_0x31db2b-0x0;var _0x1459a0=_0x8ce3[_0x31db2b];return _0x1459a0;};'use strict';var FaxInteractionEvents=require(_0x38ce('0x0'));var events=[_0x38ce('0x1'),_0x38ce('0x2'),_0x38ce('0x3')];function createListener(_0x3b78fd,_0x23a9b3){return function(_0x2b7f1a){_0x23a9b3['emit'](_0x3b78fd,_0x2b7f1a);};}function removeListener(_0x1b702e,_0x28b358){return function(){FaxInteractionEvents[_0x38ce('0x4')](_0x1b702e,_0x28b358);};}exports[_0x38ce('0x5')]=function(_0x3fdaf4){for(var _0x569904=0x0,_0x33753c=events[_0x38ce('0x6')];_0x569904<_0x33753c;_0x569904++){var _0x346e16=events[_0x569904];var _0x520564=createListener(_0x38ce('0x7')+_0x346e16,_0x3fdaf4);FaxInteractionEvents['on'](_0x346e16,_0x520564);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 61e43af..fc48dbe 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 _0x2d27=['faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','tracked','faxinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','index','get','describe','/:id','show','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x178474,_0x37d82d){var _0x35cc54=function(_0x10aebe){while(--_0x10aebe){_0x178474['push'](_0x178474['shift']());}};_0x35cc54(++_0x37d82d);}(_0x2d27,0x13e));var _0x72d2=function(_0x38494c,_0x5393f5){_0x38494c=_0x38494c-0x0;var _0x591aec=_0x2d27[_0x38494c];return _0x591aec;};'use strict';var multer=require(_0x72d2('0x0'));var util=require('util');var path=require(_0x72d2('0x1'));var timeout=require(_0x72d2('0x2'));var express=require(_0x72d2('0x3'));var router=express[_0x72d2('0x4')]();var fs_extra=require(_0x72d2('0x5'));var auth=require(_0x72d2('0x6'));var interaction=require(_0x72d2('0x7'));var config=require('../../config/environment');var controller=require(_0x72d2('0x8'));router['get']('/',auth[_0x72d2('0x9')](),controller[_0x72d2('0xa')]);router[_0x72d2('0xb')]('/describe',auth[_0x72d2('0x9')](),controller[_0x72d2('0xc')]);router[_0x72d2('0xb')](_0x72d2('0xd'),auth[_0x72d2('0x9')](),controller[_0x72d2('0xe')]);router[_0x72d2('0xb')]('/:id/messages',auth[_0x72d2('0x9')](),controller[_0x72d2('0xf')]);router['get'](_0x72d2('0x10'),auth[_0x72d2('0x9')](),controller[_0x72d2('0x11')]);router[_0x72d2('0x12')]('/',auth[_0x72d2('0x9')](),controller[_0x72d2('0x13')]);router['post']('/:id/messages',auth[_0x72d2('0x9')](),controller[_0x72d2('0x14')]);router[_0x72d2('0x12')](_0x72d2('0x15'),auth[_0x72d2('0x9')](),interaction['tracked']('fax',_0x72d2('0x16')),controller[_0x72d2('0x17')]);router[_0x72d2('0x18')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x72d2('0x19'),_0x72d2('0x1a')),controller[_0x72d2('0x1b')]);router[_0x72d2('0x1c')](_0x72d2('0xd'),auth[_0x72d2('0x9')](),interaction[_0x72d2('0x1d')]('fax',_0x72d2('0x1e')),controller[_0x72d2('0x1f')]);router[_0x72d2('0x1c')]('/:id/tags',auth['isAuthenticated'](),controller[_0x72d2('0x20')]);module[_0x72d2('0x21')]=router; \ No newline at end of file +var _0x3320=['update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','index','/describe','describe','/:id','isAuthenticated','show','getMessages','/:id/download','post','/:id/messages','addMessage','tracked','fax','addTags','put','faxinteraction:update'];(function(_0x3b5a46,_0x19a51f){var _0x33f804=function(_0x12c892){while(--_0x12c892){_0x3b5a46['push'](_0x3b5a46['shift']());}};_0x33f804(++_0x19a51f);}(_0x3320,0x13c));var _0x0332=function(_0xdd9156,_0x4dfe7b){_0xdd9156=_0xdd9156-0x0;var _0x1f57ec=_0x3320[_0xdd9156];return _0x1f57ec;};'use strict';var multer=require('multer');var util=require(_0x0332('0x0'));var path=require(_0x0332('0x1'));var timeout=require('connect-timeout');var express=require(_0x0332('0x2'));var router=express[_0x0332('0x3')]();var fs_extra=require(_0x0332('0x4'));var auth=require(_0x0332('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0332('0x6'));var controller=require(_0x0332('0x7'));router[_0x0332('0x8')]('/',auth['isAuthenticated'](),controller[_0x0332('0x9')]);router[_0x0332('0x8')](_0x0332('0xa'),auth['isAuthenticated'](),controller[_0x0332('0xb')]);router[_0x0332('0x8')](_0x0332('0xc'),auth[_0x0332('0xd')](),controller[_0x0332('0xe')]);router[_0x0332('0x8')]('/:id/messages',auth[_0x0332('0xd')](),controller[_0x0332('0xf')]);router['get'](_0x0332('0x10'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x0332('0xd')](),controller['create']);router[_0x0332('0x11')](_0x0332('0x12'),auth[_0x0332('0xd')](),controller[_0x0332('0x13')]);router[_0x0332('0x11')]('/:id/tags',auth[_0x0332('0xd')](),interaction[_0x0332('0x14')](_0x0332('0x15'),'faxinteraction:addtags'),controller[_0x0332('0x16')]);router[_0x0332('0x17')](_0x0332('0xc'),auth[_0x0332('0xd')](),interaction['tracked'](_0x0332('0x15'),_0x0332('0x18')),controller[_0x0332('0x19')]);router[_0x0332('0x1a')](_0x0332('0xc'),auth[_0x0332('0xd')](),interaction[_0x0332('0x14')](_0x0332('0x15'),_0x0332('0x1b')),controller[_0x0332('0x1c')]);router[_0x0332('0x1a')]('/:id/tags',auth[_0x0332('0xd')](),controller[_0x0332('0x1d')]);module[_0x0332('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 9327a55..52f33e3 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 _0x6ddd=['TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x1f251e,_0x35ec2a){var _0x1fc13d=function(_0x3ba1f9){while(--_0x3ba1f9){_0x1f251e['push'](_0x1f251e['shift']());}};_0x1fc13d(++_0x35ec2a);}(_0x6ddd,0xae));var _0xd6dd=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x6ddd[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd6dd('0x0')](_0xd6dd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xd6dd('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd6dd('0x3')]('in','out'),'defaultValue':_0xd6dd('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xd6dd('0x5')]}}; \ No newline at end of file +var _0xadb8=['BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xadb8,0x1d0));var _0x8adb=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xadb8[_0x1e03a6];return _0x295b64;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x8adb('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8adb('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8adb('0x2')]('in',_0x8adb('0x3')),'defaultValue':_0x8adb('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8adb('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8adb('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index f5221df..cbf3cf5 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 _0x9ce0=['map','FaxMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','body','describe','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','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','QueryTypes','contact','User','email','manual','SIP/%s','channel','event','accept','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT','internal','interface','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','join','root','server','attachments','download','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send'];(function(_0xf00074,_0x57ae02){var _0x122942=function(_0x1d2ee8){while(--_0x1d2ee8){_0xf00074['push'](_0xf00074['shift']());}};_0x122942(++_0x57ae02);}(_0x9ce0,0xde));var _0x09ce=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9ce0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09ce('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x09ce('0x1'));var rp=require(_0x09ce('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x09ce('0x3'));var util=require('util');var path=require(_0x09ce('0x4'));var sox=require('sox');var csv=require(_0x09ce('0x5'));var ejs=require(_0x09ce('0x6'));var fs=require('fs');var fs_extra=require(_0x09ce('0x7'));var _=require(_0x09ce('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x09ce('0x9'));var deskjs=require(_0x09ce('0xa'));var toCsv=require(_0x09ce('0x5'));var querystring=require(_0x09ce('0xb'));var Papa=require(_0x09ce('0xc'));var Redis=require(_0x09ce('0xd'));var authService=require(_0x09ce('0xe'));var qs=require(_0x09ce('0xf'));var as=require(_0x09ce('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x09ce('0x11'))(_0x09ce('0x12'));var utils=require(_0x09ce('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x09ce('0x14'))['db'];config['redis']=_[_0x09ce('0x15')](config[_0x09ce('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x09ce('0x17'))(new Redis(config[_0x09ce('0x16')]));require('./faxMessage.socket')[_0x09ce('0x18')](socket);var jayson=require(_0x09ce('0x19'));var client=jayson[_0x09ce('0x1a')][_0x09ce('0x1b')]({'port':0x232c});var client9002=jayson[_0x09ce('0x1a')][_0x09ce('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x743e93,_0x7e19b7,_0x4129f4,_0x184eeb){return new BPromise(function(_0x3a8e38,_0x21509b){var _0x6395ca=_0x184eeb||client;return _0x6395ca[_0x09ce('0x1c')](_0x743e93,_0x4129f4)[_0x09ce('0x1d')](function(_0xa67d39){logger[_0x09ce('0x1e')](_0x09ce('0x1f'),_0x7e19b7,_0x09ce('0x20'));logger[_0x09ce('0x21')](_0x09ce('0x22'),_0x7e19b7,_0x09ce('0x20'),JSON[_0x09ce('0x23')](_0xa67d39));if(_0xa67d39[_0x09ce('0x24')]){if(_0xa67d39['error'][_0x09ce('0x25')]===0x1f4){logger[_0x09ce('0x24')]('FaxMessage,\x20%s,\x20%s',_0x7e19b7,_0xa67d39[_0x09ce('0x24')][_0x09ce('0x26')]);return _0x21509b(_0xa67d39[_0x09ce('0x24')]['message']);}logger[_0x09ce('0x24')]('FaxMessage,\x20%s,\x20%s',_0x7e19b7,_0xa67d39[_0x09ce('0x24')]['message']);return _0x3a8e38(_0xa67d39[_0x09ce('0x24')][_0x09ce('0x26')]);}else{logger[_0x09ce('0x1e')](_0x09ce('0x1f'),_0x7e19b7,_0x09ce('0x20'));_0x3a8e38(_0xa67d39[_0x09ce('0x27')][_0x09ce('0x26')]);}})[_0x09ce('0x28')](function(_0x491193){logger[_0x09ce('0x24')](_0x09ce('0x1f'),_0x7e19b7,_0x491193);_0x21509b(_0x491193);});});}function respondWithStatusCode(_0x299df6,_0x3a242b){_0x3a242b=_0x3a242b||0xcc;return function(_0x3987c6){if(_0x3987c6){return _0x299df6[_0x09ce('0x29')](_0x3a242b);}return _0x299df6[_0x09ce('0x2a')](_0x3a242b)[_0x09ce('0x2b')]();};}function respondWithResult(_0xd25033,_0x4007c2){_0x4007c2=_0x4007c2||0xc8;return function(_0x3a56a3){if(_0x3a56a3){return _0xd25033[_0x09ce('0x2a')](_0x4007c2)[_0x09ce('0x2c')](_0x3a56a3);}};}function respondWithFilteredResult(_0xc78a31,_0x57d850){return function(_0x1bf3d4){if(_0x1bf3d4){var _0x4c8185=typeof _0x57d850[_0x09ce('0x2d')]==='undefined'&&typeof _0x57d850['limit']===_0x09ce('0x2e');var _0x3dbfd2=_0x1bf3d4[_0x09ce('0x2f')];var _0x37c3af=_0x4c8185?0x0:_0x57d850[_0x09ce('0x2d')];var _0x344895=_0x4c8185?_0x1bf3d4['count']:_0x57d850[_0x09ce('0x2d')]+_0x57d850['limit'];var _0x1d22cb;if(_0x344895>=_0x3dbfd2){_0x344895=_0x3dbfd2;_0x1d22cb=0xc8;}else{_0x1d22cb=0xce;}_0xc78a31[_0x09ce('0x2a')](_0x1d22cb);return _0xc78a31[_0x09ce('0x30')](_0x09ce('0x31'),_0x37c3af+'-'+_0x344895+'/'+_0x3dbfd2)['json'](_0x1bf3d4);}return null;};}function patchUpdates(_0x12bbb2){return function(_0xcfd446){try{jsonpatch[_0x09ce('0x32')](_0xcfd446,_0x12bbb2,!![]);}catch(_0x1ea5e7){return BPromise[_0x09ce('0x33')](_0x1ea5e7);}return _0xcfd446[_0x09ce('0x34')]();};}function saveUpdates(_0x163156,_0x314873){return function(_0x1e8d33){if(_0x1e8d33){return _0x1e8d33[_0x09ce('0x35')](_0x163156)[_0x09ce('0x1d')](function(_0x49db36){return _0x49db36;});}return null;};}function removeEntity(_0x4f1f03,_0x2c21a8){return function(_0x334e31){if(_0x334e31){return _0x334e31[_0x09ce('0x36')]()[_0x09ce('0x1d')](function(){_0x4f1f03[_0x09ce('0x2a')](0xcc)[_0x09ce('0x2b')]();});}};}function handleEntityNotFound(_0xea677b,_0x53df6b){return function(_0x5c6239){if(!_0x5c6239){_0xea677b[_0x09ce('0x29')](0x194);}return _0x5c6239;};}function handleError(_0x2b3305,_0x1124d2){_0x1124d2=_0x1124d2||0x1f4;return function(_0x5c24a9){logger[_0x09ce('0x24')](_0x5c24a9[_0x09ce('0x37')]);if(_0x5c24a9[_0x09ce('0x38')]){delete _0x5c24a9[_0x09ce('0x38')];}_0x2b3305[_0x09ce('0x2a')](_0x1124d2)[_0x09ce('0x39')](_0x5c24a9);};}exports['index']=function(_0x1dd7ac,_0x3b0baa){var _0x3a0b3b={},_0x1797aa={},_0x51c1b8={'count':0x0,'rows':[]};var _0x4a176d=_[_0x09ce('0x3a')](db[_0x09ce('0x3b')][_0x09ce('0x3c')],function(_0xafc984){return{'name':_0xafc984['fieldName'],'type':_0xafc984[_0x09ce('0x3d')]['key']};});_0x1797aa[_0x09ce('0x3e')]=_[_0x09ce('0x3a')](_0x4a176d,_0x09ce('0x38'));_0x1797aa[_0x09ce('0x3f')]=_[_0x09ce('0x40')](_0x1dd7ac['query']);_0x1797aa[_0x09ce('0x41')]=_[_0x09ce('0x42')](_0x1797aa[_0x09ce('0x3e')],_0x1797aa[_0x09ce('0x3f')]);_0x3a0b3b[_0x09ce('0x43')]=_[_0x09ce('0x42')](_0x1797aa[_0x09ce('0x3e')],qs[_0x09ce('0x44')](_0x1dd7ac['query'][_0x09ce('0x44')]));_0x3a0b3b[_0x09ce('0x43')]=_0x3a0b3b[_0x09ce('0x43')][_0x09ce('0x45')]?_0x3a0b3b[_0x09ce('0x43')]:_0x1797aa['model'];if(!_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x46')]('nolimit')){_0x3a0b3b[_0x09ce('0x47')]=qs[_0x09ce('0x47')](_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x47')]);_0x3a0b3b[_0x09ce('0x2d')]=qs['offset'](_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x2d')]);}_0x3a0b3b[_0x09ce('0x48')]=qs['sort'](_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x49')]);_0x3a0b3b[_0x09ce('0x4a')]=qs['filters'](_[_0x09ce('0x4b')](_0x1dd7ac[_0x09ce('0x3f')],_0x1797aa[_0x09ce('0x41')]),_0x4a176d);if(_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x4c')]){_0x3a0b3b['where']=_[_0x09ce('0x4d')](_0x3a0b3b['where'],{'$or':_['map'](_0x4a176d,function(_0x4e952c){if(_0x4e952c['type']!==_0x09ce('0x4e')){var _0x4c8b3c={};_0x4c8b3c[_0x4e952c[_0x09ce('0x38')]]={'$like':'%'+_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x4c')]+'%'};return _0x4c8b3c;}})});}_0x3a0b3b=_[_0x09ce('0x4d')]({},_0x3a0b3b,_0x1dd7ac[_0x09ce('0x4f')]);var _0x427d53={'where':_0x3a0b3b['where']};return db[_0x09ce('0x3b')]['count'](_0x427d53)[_0x09ce('0x1d')](function(_0x29b789){_0x51c1b8[_0x09ce('0x2f')]=_0x29b789;if(_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x50')]){_0x3a0b3b[_0x09ce('0x51')]=[{'all':!![]}];}return db[_0x09ce('0x3b')][_0x09ce('0x52')](_0x3a0b3b);})[_0x09ce('0x1d')](function(_0x289c78){_0x51c1b8['rows']=_0x289c78;return _0x51c1b8;})['then'](respondWithFilteredResult(_0x3b0baa,_0x3a0b3b))[_0x09ce('0x28')](handleError(_0x3b0baa,null));};exports[_0x09ce('0x53')]=function(_0x29d49a,_0x3f6cb9){var _0x1e20d4={'raw':!![],'where':{'id':_0x29d49a[_0x09ce('0x54')]['id']}},_0x50cce6={};_0x50cce6[_0x09ce('0x3e')]=_['keys'](db[_0x09ce('0x3b')]['rawAttributes']);_0x50cce6['query']=_['keys'](_0x29d49a[_0x09ce('0x3f')]);_0x50cce6['filters']=_[_0x09ce('0x42')](_0x50cce6[_0x09ce('0x3e')],_0x50cce6[_0x09ce('0x3f')]);_0x1e20d4[_0x09ce('0x43')]=_['intersection'](_0x50cce6[_0x09ce('0x3e')],qs['fields'](_0x29d49a[_0x09ce('0x3f')][_0x09ce('0x44')]));_0x1e20d4[_0x09ce('0x43')]=_0x1e20d4[_0x09ce('0x43')][_0x09ce('0x45')]?_0x1e20d4[_0x09ce('0x43')]:_0x50cce6[_0x09ce('0x3e')];if(_0x29d49a[_0x09ce('0x3f')][_0x09ce('0x50')]){_0x1e20d4[_0x09ce('0x51')]=[{'all':!![]}];}_0x1e20d4=_['merge']({},_0x1e20d4,_0x29d49a[_0x09ce('0x4f')]);return db[_0x09ce('0x3b')][_0x09ce('0x55')](_0x1e20d4)[_0x09ce('0x1d')](handleEntityNotFound(_0x3f6cb9,null))[_0x09ce('0x1d')](respondWithResult(_0x3f6cb9,null))[_0x09ce('0x28')](handleError(_0x3f6cb9,null));};exports['update']=function(_0x5b815d,_0x4c3d7a){if(_0x5b815d[_0x09ce('0x56')]['id']){delete _0x5b815d['body']['id'];}return db[_0x09ce('0x3b')][_0x09ce('0x55')]({'where':{'id':_0x5b815d[_0x09ce('0x54')]['id']}})[_0x09ce('0x1d')](handleEntityNotFound(_0x4c3d7a,null))['then'](saveUpdates(_0x5b815d[_0x09ce('0x56')],null))[_0x09ce('0x1d')](respondWithResult(_0x4c3d7a,null))['catch'](handleError(_0x4c3d7a,null));};exports['destroy']=function(_0xce1d6,_0x491a1d){return db['FaxMessage'][_0x09ce('0x55')]({'where':{'id':_0xce1d6[_0x09ce('0x54')]['id']}})['then'](handleEntityNotFound(_0x491a1d,null))[_0x09ce('0x1d')](removeEntity(_0x491a1d,null))[_0x09ce('0x28')](handleError(_0x491a1d,null));};exports[_0x09ce('0x57')]=function(_0x423fb2,_0x37f943){return db[_0x09ce('0x3b')]['describe']()[_0x09ce('0x1d')](respondWithResult(_0x37f943,null))['catch'](handleError(_0x37f943,null));};var interaction_log=require(_0x09ce('0x11'))('fax-interactions');exports['accept']=function(_0x57d109,_0x59255e,_0x55aba3){var _0x8feb39={'agent':{},'channel':_0x09ce('0x58')};if(_0x57d109['body']['id']){delete _0x57d109[_0x09ce('0x56')]['id'];}_0x57d109[_0x09ce('0x56')][_0x09ce('0x59')]=!![];_0x57d109['body']['readAt']=moment()[_0x09ce('0x5a')](_0x09ce('0x5b'));_0x57d109[_0x09ce('0x56')][_0x09ce('0x5c')]=_0x57d109['body'][_0x09ce('0x5c')]||_0x57d109[_0x09ce('0x5d')]['id'];_0x8feb39[_0x09ce('0x5e')]['id']=_0x57d109[_0x09ce('0x56')][_0x09ce('0x5c')];return db[_0x09ce('0x3b')][_0x09ce('0x55')]({'where':{'id':_0x57d109[_0x09ce('0x54')]['id'],'UserId':null}})[_0x09ce('0x1d')](handleEntityNotFound(_0x59255e,null))[_0x09ce('0x1d')](saveUpdates(_0x57d109[_0x09ce('0x56')],null))[_0x09ce('0x1d')](function(_0x26ab3e){if(_0x26ab3e){_0x8feb39[_0x09ce('0x26')]=_0x26ab3e[_0x09ce('0x5f')]({'plain':!![]});return db[_0x09ce('0x60')][_0x09ce('0x55')]({'where':{'id':_0x26ab3e[_0x09ce('0x61')]}});}return null;})[_0x09ce('0x1d')](handleEntityNotFound(_0x59255e,null))[_0x09ce('0x1d')](function(_0x2b4c2c){if(_0x2b4c2c){return _0x2b4c2c[_0x09ce('0x35')]({'UserId':_0x57d109[_0x09ce('0x56')][_0x09ce('0x5c')],'read1stAt':_[_0x09ce('0x62')](_0x2b4c2c[_0x09ce('0x63')])?moment()['format'](_0x09ce('0x5b')):undefined});}return null;})[_0x09ce('0x1d')](function(_0x49bf7){if(_0x49bf7){_0x8feb39[_0x09ce('0x64')]=_0x49bf7[_0x09ce('0x5f')]({'plain':!![]});interaction_log[_0x09ce('0x1e')](_0x09ce('0x65'),_0x57d109[_0x09ce('0x5d')]['id'],_0x57d109['user'][_0x09ce('0x38')],_0x57d109[_0x09ce('0x5d')]['role'],_0x8feb39[_0x09ce('0x64')]['id'],_0x57d109['body']?JSON['stringify'](_0x57d109['body']):_0x09ce('0x66'));return respondWithRpcPromise(_0x09ce('0x67'),_0x09ce('0x68'),_0x8feb39);}return null;})[_0x09ce('0x1d')](function(_0x50b4cc){var _0x39fd61=_0x09ce('0x69')+_0x50b4cc['message'][_0x09ce('0x6a')];return db[_0x09ce('0x6b')][_0x09ce('0x3f')](_0x39fd61,{'type':db['Sequelize'][_0x09ce('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x1be00e){return _0x1be00e;});})[_0x09ce('0x1d')](function(_0x1ee867){if(_0x1ee867){_0x8feb39[_0x09ce('0x26')][_0x09ce('0x6d')]=_0x1ee867[0x0];if(!_0x57d109['body'][_0x09ce('0x5c')])return;return db[_0x09ce('0x6e')][_0x09ce('0x55')]({'where':{'id':_0x57d109[_0x09ce('0x56')][_0x09ce('0x5c')],'role':_0x09ce('0x5e')},'attributes':['id',_0x09ce('0x38'),'fullname',_0x09ce('0x6f'),'internal'],'raw':!![]});}return null;})[_0x09ce('0x1d')](function(_0x4a00b7){if(!_0x4a00b7)return null;_0x8feb39[_0x09ce('0x26')]['agent']=_0x4a00b7;return _0x8feb39;})[_0x09ce('0x1d')](function(_0x42c3b0){if(_0x42c3b0){if(_0x57d109[_0x09ce('0x56')][_0x09ce('0x70')]){_0x8feb39['message']['interface']=util['format'](_0x09ce('0x71'),_0x57d109['user']['name']);_0x8feb39[_0x09ce('0x26')][_0x09ce('0x72')]=_0x8feb39[_0x09ce('0x72')];_0x8feb39['message'][_0x09ce('0x73')]=_0x09ce('0x74');return respondWithRpcPromise('EventManager',_0x09ce('0x75'),{'event':_0x09ce('0x76'),'message':_0x8feb39['message']},client9002)['then'](function(){return _0x8feb39;});}return _0x8feb39;}return null;})['then'](respondWithResult(_0x59255e,null))[_0x09ce('0x28')](handleError(_0x59255e,null));};var interaction_log=require(_0x09ce('0x11'))(_0x09ce('0x77'));exports[_0x09ce('0x33')]=function(_0x260f03,_0x15704a,_0xdef760){var _0x34a048={'agent':{},'channel':'fax'};if(_0x260f03['body']['id']){delete _0x260f03[_0x09ce('0x56')]['id'];}_0x260f03['body'][_0x09ce('0x5c')]=_0x260f03[_0x09ce('0x56')][_0x09ce('0x5c')]||_0x260f03[_0x09ce('0x5d')]['id'];_0x34a048[_0x09ce('0x5e')]['id']=_0x260f03[_0x09ce('0x56')][_0x09ce('0x5c')];return db[_0x09ce('0x3b')][_0x09ce('0x55')]({'where':{'id':_0x260f03[_0x09ce('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x15704a,null))[_0x09ce('0x1d')](function(_0x543b53){if(_0x543b53){_0x34a048[_0x09ce('0x26')]=_0x543b53[_0x09ce('0x5f')]({'plain':!![]});return db[_0x09ce('0x60')][_0x09ce('0x55')]({'where':{'id':_0x543b53[_0x09ce('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x15704a,null))[_0x09ce('0x1d')](function(_0xd584a5){if(_0xd584a5){_0x34a048[_0x09ce('0x64')]=_0xd584a5['get']({'plain':!![]});interaction_log[_0x09ce('0x1e')](_0x09ce('0x78'),_0x260f03[_0x09ce('0x5d')]['id'],_0x260f03['user'][_0x09ce('0x38')],_0x260f03[_0x09ce('0x5d')][_0x09ce('0x79')],_0x34a048[_0x09ce('0x64')]['id'],_0x260f03[_0x09ce('0x56')]?JSON['stringify'](_0x260f03[_0x09ce('0x56')]):_0x09ce('0x66'));return respondWithRpcPromise(_0x09ce('0x7a'),_0x09ce('0x7b'),_0x34a048);}return null;})[_0x09ce('0x1d')](function(_0x12e4c7){var _0x4d2aff='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12e4c7['message'][_0x09ce('0x6a')];return db['sequelize'][_0x09ce('0x3f')](_0x4d2aff,{'type':db['Sequelize'][_0x09ce('0x6c')][_0x09ce('0x7c')],'raw':!![]})['then'](function(_0x4931ae){return _0x4931ae;});})['then'](function(_0x2abf72){if(_0x2abf72){_0x34a048[_0x09ce('0x26')][_0x09ce('0x6d')]=_0x2abf72[0x0];if(!_0x260f03[_0x09ce('0x56')][_0x09ce('0x5c')])return;return db[_0x09ce('0x6e')][_0x09ce('0x55')]({'where':{'id':_0x260f03['body'][_0x09ce('0x5c')],'role':_0x09ce('0x5e')},'attributes':['id',_0x09ce('0x38'),'fullname',_0x09ce('0x6f'),_0x09ce('0x7d')],'raw':!![]});}return null;})[_0x09ce('0x1d')](function(_0x219636){if(!_0x219636)return null;_0x34a048[_0x09ce('0x26')][_0x09ce('0x5e')]=_0x219636;return _0x34a048;})[_0x09ce('0x1d')](function(_0x38c9f0){if(_0x38c9f0){_0x38c9f0['message'][_0x09ce('0x7e')]=util[_0x09ce('0x5a')](_0x09ce('0x71'),_0x260f03[_0x09ce('0x5d')]['name']);_0x38c9f0['message'][_0x09ce('0x72')]=_0x34a048['channel'];_0x38c9f0[_0x09ce('0x26')][_0x09ce('0x73')]=_0x09ce('0x33');respondWithRpcPromise('EventManager',_0x09ce('0x75'),{'event':_0x09ce('0x7f'),'message':_0x38c9f0['message']},client9002);return _0x34a048;}return null;})[_0x09ce('0x1d')](respondWithResult(_0x15704a,null))['catch'](handleError(_0x15704a,null));};exports[_0x09ce('0x80')]=function(_0x29a54e,_0x1fcf17){var _0x5298cc;return db['FaxMessage'][_0x09ce('0x80')](_0x29a54e[_0x09ce('0x56')],{})['then'](function(_0x316ad4){_0x5298cc=_0x316ad4;return db['CmContact'][_0x09ce('0x81')]({'where':{'id':_0x5298cc[_0x09ce('0x6a')]}});})[_0x09ce('0x1d')](function(_0x120d88){if(_[_0x09ce('0x62')](_0x120d88)){return;}else{_0x5298cc[_0x09ce('0x58')]=_0x120d88[_0x09ce('0x58')];return db[_0x09ce('0x82')][_0x09ce('0x81')]({'where':{'id':_0x5298cc[_0x09ce('0x83')]}});}})[_0x09ce('0x1d')](function(_0x50da21){return respondWithRpcPromise(_0x09ce('0x84'),_0x09ce('0x84'),{'FaxAccountId':_[_0x09ce('0x62')](_0x29a54e[_0x09ce('0x56')])?undefined:_0x29a54e[_0x09ce('0x56')][_0x09ce('0x85')],'path':_[_0x09ce('0x62')](_0x50da21)?undefined:util[_0x09ce('0x5a')]('/var/opt/motion2/server/files/attachments/%s',_0x50da21[_0x09ce('0x86')]),'fax':_['isNil'](_0x5298cc[_0x09ce('0x58')])?undefined:_0x5298cc[_0x09ce('0x58')],'AttachmentId':_0x5298cc[_0x09ce('0x83')]},client9002);})[_0x09ce('0x1d')](respondWithResult(_0x1fcf17,0xc9))[_0x09ce('0x28')](handleError(_0x1fcf17,null));};exports['download']=function(_0x524055,_0x587b5f){var _0x57572b=path[_0x09ce('0x87')](config[_0x09ce('0x88')],_0x09ce('0x89'),'files',_0x09ce('0x8a'));return db[_0x09ce('0x3b')][_0x09ce('0x55')]({'where':{'id':_0x524055['params']['id']},'include':[{'model':db['Attachment'],'as':_0x09ce('0x82')}]})[_0x09ce('0x1d')](handleEntityNotFound(_0x587b5f,null))[_0x09ce('0x1d')](function(_0x668a61){if(_0x668a61){return _0x587b5f[_0x09ce('0x8b')](path[_0x09ce('0x87')](_0x57572b,_0x668a61[_0x09ce('0x82')][_0x09ce('0x86')]));}})[_0x09ce('0x28')](handleError(_0x587b5f,null));}; \ No newline at end of file +var _0x1ec0=['localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','send','index','map','FaxMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','params','options','body','find','describe','fax-interactions','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','agent','email','internal','manual','interface','format','SIP/%s','user','channel','motionChannel','event','EventManager','reject','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','Sequelize','fullname','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x1ec0,0x194));var _0x01ec=function(_0x9f57ca,_0xede913){_0x9f57ca=_0x9f57ca-0x0;var _0x171560=_0x1ec0[_0x9f57ca];return _0x171560;};'use strict';var emlformat=require(_0x01ec('0x0'));var rimraf=require(_0x01ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x01ec('0x2'));var moment=require(_0x01ec('0x3'));var BPromise=require(_0x01ec('0x4'));var Mustache=require(_0x01ec('0x5'));var util=require(_0x01ec('0x6'));var path=require('path');var sox=require(_0x01ec('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01ec('0x8'));var _=require(_0x01ec('0x9'));var squel=require(_0x01ec('0xa'));var crypto=require(_0x01ec('0xb'));var jsforce=require(_0x01ec('0xc'));var deskjs=require(_0x01ec('0xd'));var toCsv=require(_0x01ec('0xe'));var querystring=require(_0x01ec('0xf'));var Papa=require('papaparse');var Redis=require(_0x01ec('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01ec('0x11'));var logger=require(_0x01ec('0x12'))(_0x01ec('0x13'));var utils=require('../../config/utils');var config=require(_0x01ec('0x14'));var licenseUtil=require(_0x01ec('0x15'));var db=require(_0x01ec('0x16'))['db'];config['redis']=_[_0x01ec('0x17')](config[_0x01ec('0x18')],{'host':_0x01ec('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01ec('0x18')]));require(_0x01ec('0x1a'))[_0x01ec('0x1b')](socket);var jayson=require(_0x01ec('0x1c'));var client=jayson[_0x01ec('0x1d')][_0x01ec('0x1e')]({'port':0x232c});var client9002=jayson[_0x01ec('0x1d')][_0x01ec('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3b9ea3,_0x1a74bf,_0x937e7,_0x212a34){return new BPromise(function(_0x5b8601,_0x379caf){var _0x4266c3=_0x212a34||client;return _0x4266c3[_0x01ec('0x1f')](_0x3b9ea3,_0x937e7)[_0x01ec('0x20')](function(_0x134134){logger[_0x01ec('0x21')](_0x01ec('0x22'),_0x1a74bf,_0x01ec('0x23'));logger['debug'](_0x01ec('0x24'),_0x1a74bf,_0x01ec('0x23'),JSON[_0x01ec('0x25')](_0x134134));if(_0x134134[_0x01ec('0x26')]){if(_0x134134['error'][_0x01ec('0x27')]===0x1f4){logger[_0x01ec('0x26')](_0x01ec('0x22'),_0x1a74bf,_0x134134[_0x01ec('0x26')]['message']);return _0x379caf(_0x134134['error'][_0x01ec('0x28')]);}logger['error'](_0x01ec('0x22'),_0x1a74bf,_0x134134[_0x01ec('0x26')][_0x01ec('0x28')]);return _0x5b8601(_0x134134[_0x01ec('0x26')][_0x01ec('0x28')]);}else{logger[_0x01ec('0x21')](_0x01ec('0x22'),_0x1a74bf,_0x01ec('0x23'));_0x5b8601(_0x134134['result'][_0x01ec('0x28')]);}})['catch'](function(_0x11158c){logger[_0x01ec('0x26')](_0x01ec('0x22'),_0x1a74bf,_0x11158c);_0x379caf(_0x11158c);});});}function respondWithStatusCode(_0x40ed84,_0x518de4){_0x518de4=_0x518de4||0xcc;return function(_0x4b48d8){if(_0x4b48d8){return _0x40ed84[_0x01ec('0x29')](_0x518de4);}return _0x40ed84[_0x01ec('0x2a')](_0x518de4)[_0x01ec('0x2b')]();};}function respondWithResult(_0x20dd0f,_0x127aa4){_0x127aa4=_0x127aa4||0xc8;return function(_0x31a914){if(_0x31a914){return _0x20dd0f['status'](_0x127aa4)[_0x01ec('0x2c')](_0x31a914);}};}function respondWithFilteredResult(_0x2d75fb,_0x5e3b28){return function(_0x50c2ed){if(_0x50c2ed){var _0x2db7c9=typeof _0x5e3b28[_0x01ec('0x2d')]===_0x01ec('0x2e')&&typeof _0x5e3b28[_0x01ec('0x2f')]===_0x01ec('0x2e');var _0x35ce76=_0x50c2ed[_0x01ec('0x30')];var _0x77bada=_0x2db7c9?0x0:_0x5e3b28[_0x01ec('0x2d')];var _0xacc633=_0x2db7c9?_0x50c2ed[_0x01ec('0x30')]:_0x5e3b28[_0x01ec('0x2d')]+_0x5e3b28[_0x01ec('0x2f')];var _0x25e705;if(_0xacc633>=_0x35ce76){_0xacc633=_0x35ce76;_0x25e705=0xc8;}else{_0x25e705=0xce;}_0x2d75fb['status'](_0x25e705);return _0x2d75fb[_0x01ec('0x31')](_0x01ec('0x32'),_0x77bada+'-'+_0xacc633+'/'+_0x35ce76)['json'](_0x50c2ed);}return null;};}function patchUpdates(_0x11ed44){return function(_0x4dccbb){try{jsonpatch[_0x01ec('0x33')](_0x4dccbb,_0x11ed44,!![]);}catch(_0x27fba4){return BPromise['reject'](_0x27fba4);}return _0x4dccbb[_0x01ec('0x34')]();};}function saveUpdates(_0x300aa0,_0x450980){return function(_0x16ea4c){if(_0x16ea4c){return _0x16ea4c[_0x01ec('0x35')](_0x300aa0)[_0x01ec('0x20')](function(_0x4bcdcd){return _0x4bcdcd;});}return null;};}function removeEntity(_0x3a363a,_0x2b36ed){return function(_0x33e6a3){if(_0x33e6a3){return _0x33e6a3['destroy']()[_0x01ec('0x20')](function(){_0x3a363a[_0x01ec('0x2a')](0xcc)[_0x01ec('0x2b')]();});}};}function handleEntityNotFound(_0x283128,_0x6ec7d9){return function(_0x10e8b9){if(!_0x10e8b9){_0x283128[_0x01ec('0x29')](0x194);}return _0x10e8b9;};}function handleError(_0x5d04c5,_0x199bb1){_0x199bb1=_0x199bb1||0x1f4;return function(_0x4e0143){logger[_0x01ec('0x26')](_0x4e0143[_0x01ec('0x36')]);if(_0x4e0143[_0x01ec('0x37')]){delete _0x4e0143[_0x01ec('0x37')];}_0x5d04c5[_0x01ec('0x2a')](_0x199bb1)[_0x01ec('0x38')](_0x4e0143);};}exports[_0x01ec('0x39')]=function(_0xb4b5db,_0x1495c4){var _0x1032c2={},_0x29c0a0={},_0x3a5757={'count':0x0,'rows':[]};var _0x1bd4b5=_[_0x01ec('0x3a')](db[_0x01ec('0x3b')][_0x01ec('0x3c')],function(_0x377780){return{'name':_0x377780['fieldName'],'type':_0x377780[_0x01ec('0x3d')][_0x01ec('0x3e')]};});_0x29c0a0[_0x01ec('0x3f')]=_['map'](_0x1bd4b5,'name');_0x29c0a0[_0x01ec('0x40')]=_[_0x01ec('0x41')](_0xb4b5db[_0x01ec('0x40')]);_0x29c0a0[_0x01ec('0x42')]=_['intersection'](_0x29c0a0[_0x01ec('0x3f')],_0x29c0a0[_0x01ec('0x40')]);_0x1032c2[_0x01ec('0x43')]=_[_0x01ec('0x44')](_0x29c0a0[_0x01ec('0x3f')],qs[_0x01ec('0x45')](_0xb4b5db[_0x01ec('0x40')]['fields']));_0x1032c2[_0x01ec('0x43')]=_0x1032c2[_0x01ec('0x43')][_0x01ec('0x46')]?_0x1032c2[_0x01ec('0x43')]:_0x29c0a0[_0x01ec('0x3f')];if(!_0xb4b5db[_0x01ec('0x40')][_0x01ec('0x47')](_0x01ec('0x48'))){_0x1032c2[_0x01ec('0x2f')]=qs[_0x01ec('0x2f')](_0xb4b5db['query'][_0x01ec('0x2f')]);_0x1032c2[_0x01ec('0x2d')]=qs[_0x01ec('0x2d')](_0xb4b5db['query']['offset']);}_0x1032c2['order']=qs[_0x01ec('0x49')](_0xb4b5db[_0x01ec('0x40')]['sort']);_0x1032c2['where']=qs[_0x01ec('0x42')](_[_0x01ec('0x4a')](_0xb4b5db[_0x01ec('0x40')],_0x29c0a0[_0x01ec('0x42')]),_0x1bd4b5);if(_0xb4b5db[_0x01ec('0x40')][_0x01ec('0x4b')]){_0x1032c2['where']=_[_0x01ec('0x4c')](_0x1032c2[_0x01ec('0x4d')],{'$or':_[_0x01ec('0x3a')](_0x1bd4b5,function(_0xe61694){if(_0xe61694[_0x01ec('0x3d')]!==_0x01ec('0x4e')){var _0x4b1f16={};_0x4b1f16[_0xe61694[_0x01ec('0x37')]]={'$like':'%'+_0xb4b5db['query'][_0x01ec('0x4b')]+'%'};return _0x4b1f16;}})});}_0x1032c2=_[_0x01ec('0x4c')]({},_0x1032c2,_0xb4b5db['options']);var _0x4468eb={'where':_0x1032c2[_0x01ec('0x4d')]};return db['FaxMessage'][_0x01ec('0x30')](_0x4468eb)[_0x01ec('0x20')](function(_0x463443){_0x3a5757[_0x01ec('0x30')]=_0x463443;if(_0xb4b5db[_0x01ec('0x40')][_0x01ec('0x4f')]){_0x1032c2[_0x01ec('0x50')]=[{'all':!![]}];}return db[_0x01ec('0x3b')]['findAll'](_0x1032c2);})[_0x01ec('0x20')](function(_0x41cfc5){_0x3a5757[_0x01ec('0x51')]=_0x41cfc5;return _0x3a5757;})['then'](respondWithFilteredResult(_0x1495c4,_0x1032c2))[_0x01ec('0x52')](handleError(_0x1495c4,null));};exports[_0x01ec('0x53')]=function(_0x1a0716,_0x269d57){var _0x40c286={'raw':!![],'where':{'id':_0x1a0716[_0x01ec('0x54')]['id']}},_0x340833={};_0x340833[_0x01ec('0x3f')]=_[_0x01ec('0x41')](db[_0x01ec('0x3b')][_0x01ec('0x3c')]);_0x340833[_0x01ec('0x40')]=_['keys'](_0x1a0716[_0x01ec('0x40')]);_0x340833[_0x01ec('0x42')]=_['intersection'](_0x340833[_0x01ec('0x3f')],_0x340833[_0x01ec('0x40')]);_0x40c286[_0x01ec('0x43')]=_[_0x01ec('0x44')](_0x340833['model'],qs['fields'](_0x1a0716[_0x01ec('0x40')][_0x01ec('0x45')]));_0x40c286[_0x01ec('0x43')]=_0x40c286[_0x01ec('0x43')][_0x01ec('0x46')]?_0x40c286[_0x01ec('0x43')]:_0x340833[_0x01ec('0x3f')];if(_0x1a0716[_0x01ec('0x40')]['includeAll']){_0x40c286['include']=[{'all':!![]}];}_0x40c286=_['merge']({},_0x40c286,_0x1a0716[_0x01ec('0x55')]);return db[_0x01ec('0x3b')]['find'](_0x40c286)[_0x01ec('0x20')](handleEntityNotFound(_0x269d57,null))[_0x01ec('0x20')](respondWithResult(_0x269d57,null))[_0x01ec('0x52')](handleError(_0x269d57,null));};exports[_0x01ec('0x35')]=function(_0x1c7da0,_0x49bb20){if(_0x1c7da0['body']['id']){delete _0x1c7da0[_0x01ec('0x56')]['id'];}return db['FaxMessage'][_0x01ec('0x57')]({'where':{'id':_0x1c7da0[_0x01ec('0x54')]['id']}})['then'](handleEntityNotFound(_0x49bb20,null))['then'](saveUpdates(_0x1c7da0[_0x01ec('0x56')],null))[_0x01ec('0x20')](respondWithResult(_0x49bb20,null))[_0x01ec('0x52')](handleError(_0x49bb20,null));};exports['destroy']=function(_0xa56539,_0x1d0f34){return db[_0x01ec('0x3b')][_0x01ec('0x57')]({'where':{'id':_0xa56539[_0x01ec('0x54')]['id']}})[_0x01ec('0x20')](handleEntityNotFound(_0x1d0f34,null))[_0x01ec('0x20')](removeEntity(_0x1d0f34,null))[_0x01ec('0x52')](handleError(_0x1d0f34,null));};exports[_0x01ec('0x58')]=function(_0x223381,_0x358c0f){return db[_0x01ec('0x3b')][_0x01ec('0x58')]()[_0x01ec('0x20')](respondWithResult(_0x358c0f,null))[_0x01ec('0x52')](handleError(_0x358c0f,null));};var interaction_log=require(_0x01ec('0x12'))(_0x01ec('0x59'));exports['accept']=function(_0x5b9070,_0x2739da,_0x41c1e8){var _0x198004={'agent':{},'channel':_0x01ec('0x5a')};if(_0x5b9070['body']['id']){delete _0x5b9070[_0x01ec('0x56')]['id'];}_0x5b9070['body'][_0x01ec('0x5b')]=!![];_0x5b9070['body'][_0x01ec('0x5c')]=moment()['format'](_0x01ec('0x5d'));_0x5b9070[_0x01ec('0x56')][_0x01ec('0x5e')]=_0x5b9070[_0x01ec('0x56')][_0x01ec('0x5e')]||_0x5b9070['user']['id'];_0x198004['agent']['id']=_0x5b9070[_0x01ec('0x56')][_0x01ec('0x5e')];return db['FaxMessage'][_0x01ec('0x57')]({'where':{'id':_0x5b9070['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2739da,null))[_0x01ec('0x20')](saveUpdates(_0x5b9070[_0x01ec('0x56')],null))[_0x01ec('0x20')](function(_0xa56de9){if(_0xa56de9){_0x198004[_0x01ec('0x28')]=_0xa56de9[_0x01ec('0x5f')]({'plain':!![]});return db['FaxInteraction'][_0x01ec('0x57')]({'where':{'id':_0xa56de9['FaxInteractionId']}});}return null;})[_0x01ec('0x20')](handleEntityNotFound(_0x2739da,null))[_0x01ec('0x20')](function(_0x1e29c7){if(_0x1e29c7){return _0x1e29c7[_0x01ec('0x35')]({'UserId':_0x5b9070[_0x01ec('0x56')][_0x01ec('0x5e')],'read1stAt':_[_0x01ec('0x60')](_0x1e29c7[_0x01ec('0x61')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x16c1d9){if(_0x16c1d9){_0x198004[_0x01ec('0x62')]=_0x16c1d9['get']({'plain':!![]});interaction_log[_0x01ec('0x21')](_0x01ec('0x63'),_0x5b9070['user']['id'],_0x5b9070['user']['name'],_0x5b9070['user'][_0x01ec('0x64')],_0x198004['interaction']['id'],_0x5b9070['body']?JSON['stringify'](_0x5b9070[_0x01ec('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0x01ec('0x65'),_0x198004);}return null;})[_0x01ec('0x20')](function(_0x215988){var _0x337ccb=_0x01ec('0x66')+_0x215988['message'][_0x01ec('0x67')];return db['sequelize'][_0x01ec('0x40')](_0x337ccb,{'type':db['Sequelize'][_0x01ec('0x68')][_0x01ec('0x69')],'raw':!![]})['then'](function(_0x57a30){return _0x57a30;});})[_0x01ec('0x20')](function(_0x1fe7e2){if(_0x1fe7e2){_0x198004['message']['contact']=_0x1fe7e2[0x0];if(!_0x5b9070[_0x01ec('0x56')][_0x01ec('0x5e')])return;return db[_0x01ec('0x6a')][_0x01ec('0x57')]({'where':{'id':_0x5b9070['body'][_0x01ec('0x5e')],'role':_0x01ec('0x6b')},'attributes':['id',_0x01ec('0x37'),'fullname',_0x01ec('0x6c'),_0x01ec('0x6d')],'raw':!![]});}return null;})[_0x01ec('0x20')](function(_0xe5f298){if(!_0xe5f298)return null;_0x198004[_0x01ec('0x28')][_0x01ec('0x6b')]=_0xe5f298;return _0x198004;})[_0x01ec('0x20')](function(_0x1bbb27){if(_0x1bbb27){if(_0x5b9070['body'][_0x01ec('0x6e')]){_0x198004[_0x01ec('0x28')][_0x01ec('0x6f')]=util[_0x01ec('0x70')](_0x01ec('0x71'),_0x5b9070[_0x01ec('0x72')][_0x01ec('0x37')]);_0x198004[_0x01ec('0x28')][_0x01ec('0x73')]=_0x198004[_0x01ec('0x73')];_0x198004[_0x01ec('0x28')][_0x01ec('0x74')]=_0x198004[_0x01ec('0x73')];_0x198004[_0x01ec('0x28')][_0x01ec('0x75')]='accept';return respondWithRpcPromise(_0x01ec('0x76'),_0x01ec('0x76'),{'event':'acceptmessage','message':_0x198004[_0x01ec('0x28')]},client9002)[_0x01ec('0x20')](function(){return _0x198004;});}return _0x198004;}return null;})[_0x01ec('0x20')](respondWithResult(_0x2739da,null))[_0x01ec('0x52')](handleError(_0x2739da,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x01ec('0x77')]=function(_0x513948,_0x4b4f16,_0x1fbce6){var _0x36f612={'agent':{},'channel':'fax'};if(_0x513948[_0x01ec('0x56')]['id']){delete _0x513948[_0x01ec('0x56')]['id'];}_0x513948[_0x01ec('0x56')][_0x01ec('0x5e')]=_0x513948[_0x01ec('0x56')]['UserId']||_0x513948[_0x01ec('0x72')]['id'];_0x36f612[_0x01ec('0x6b')]['id']=_0x513948[_0x01ec('0x56')]['UserId'];return db[_0x01ec('0x3b')][_0x01ec('0x57')]({'where':{'id':_0x513948[_0x01ec('0x54')]['id'],'UserId':null}})[_0x01ec('0x20')](handleEntityNotFound(_0x4b4f16,null))['then'](function(_0x4fb5b2){if(_0x4fb5b2){_0x36f612[_0x01ec('0x28')]=_0x4fb5b2[_0x01ec('0x5f')]({'plain':!![]});return db[_0x01ec('0x78')][_0x01ec('0x57')]({'where':{'id':_0x4fb5b2[_0x01ec('0x79')]}});}return null;})[_0x01ec('0x20')](handleEntityNotFound(_0x4b4f16,null))[_0x01ec('0x20')](function(_0x1617f1){if(_0x1617f1){_0x36f612[_0x01ec('0x62')]=_0x1617f1[_0x01ec('0x5f')]({'plain':!![]});interaction_log[_0x01ec('0x21')](_0x01ec('0x7a'),_0x513948[_0x01ec('0x72')]['id'],_0x513948[_0x01ec('0x72')]['name'],_0x513948[_0x01ec('0x72')][_0x01ec('0x64')],_0x36f612[_0x01ec('0x62')]['id'],_0x513948[_0x01ec('0x56')]?JSON['stringify'](_0x513948['body']):_0x01ec('0x7b'));return respondWithRpcPromise(_0x01ec('0x7c'),_0x01ec('0x7d'),_0x36f612);}return null;})[_0x01ec('0x20')](function(_0x369453){var _0x2619d4=_0x01ec('0x66')+_0x369453[_0x01ec('0x28')][_0x01ec('0x67')];return db[_0x01ec('0x7e')][_0x01ec('0x40')](_0x2619d4,{'type':db[_0x01ec('0x7f')][_0x01ec('0x68')]['SELECT'],'raw':!![]})[_0x01ec('0x20')](function(_0x41487c){return _0x41487c;});})[_0x01ec('0x20')](function(_0x55107a){if(_0x55107a){_0x36f612['message']['contact']=_0x55107a[0x0];if(!_0x513948[_0x01ec('0x56')][_0x01ec('0x5e')])return;return db[_0x01ec('0x6a')][_0x01ec('0x57')]({'where':{'id':_0x513948['body'][_0x01ec('0x5e')],'role':'agent'},'attributes':['id',_0x01ec('0x37'),_0x01ec('0x80'),'email',_0x01ec('0x6d')],'raw':!![]});}return null;})[_0x01ec('0x20')](function(_0x1bb96d){if(!_0x1bb96d)return null;_0x36f612[_0x01ec('0x28')][_0x01ec('0x6b')]=_0x1bb96d;return _0x36f612;})[_0x01ec('0x20')](function(_0xe88214){if(_0xe88214){_0xe88214[_0x01ec('0x28')][_0x01ec('0x6f')]=util[_0x01ec('0x70')](_0x01ec('0x71'),_0x513948['user'][_0x01ec('0x37')]);_0xe88214[_0x01ec('0x28')][_0x01ec('0x73')]=_0x36f612[_0x01ec('0x73')];_0xe88214[_0x01ec('0x28')][_0x01ec('0x74')]=_0x36f612[_0x01ec('0x73')];_0xe88214[_0x01ec('0x28')]['event']='reject';respondWithRpcPromise(_0x01ec('0x76'),_0x01ec('0x76'),{'event':_0x01ec('0x81'),'message':_0xe88214[_0x01ec('0x28')]},client9002);return _0x36f612;}return null;})[_0x01ec('0x20')](respondWithResult(_0x4b4f16,null))[_0x01ec('0x52')](handleError(_0x4b4f16,null));};exports[_0x01ec('0x82')]=function(_0x2c19b9,_0x4e7c2f){var _0x4196c5;return db['FaxMessage'][_0x01ec('0x82')](_0x2c19b9[_0x01ec('0x56')],{})['then'](function(_0x2f80e6){_0x4196c5=_0x2f80e6;return db['CmContact'][_0x01ec('0x83')]({'where':{'id':_0x4196c5[_0x01ec('0x67')]}});})[_0x01ec('0x20')](function(_0xa5691d){if(_[_0x01ec('0x60')](_0xa5691d)){return;}else{_0x4196c5[_0x01ec('0x5a')]=_0xa5691d[_0x01ec('0x5a')];return db[_0x01ec('0x84')][_0x01ec('0x83')]({'where':{'id':_0x4196c5[_0x01ec('0x85')]}});}})[_0x01ec('0x20')](function(_0x2f43c7){return respondWithRpcPromise(_0x01ec('0x86'),_0x01ec('0x86'),{'FaxAccountId':_[_0x01ec('0x60')](_0x2c19b9[_0x01ec('0x56')])?undefined:_0x2c19b9['body']['FaxAccountId'],'path':_[_0x01ec('0x60')](_0x2f43c7)?undefined:util['format'](_0x01ec('0x87'),_0x2f43c7['basename']),'fax':_['isNil'](_0x4196c5[_0x01ec('0x5a')])?undefined:_0x4196c5[_0x01ec('0x5a')],'AttachmentId':_0x4196c5['AttachmentId']},client9002);})[_0x01ec('0x20')](respondWithResult(_0x4e7c2f,0xc9))[_0x01ec('0x52')](handleError(_0x4e7c2f,null));};exports[_0x01ec('0x88')]=function(_0x18c781,_0x25a049){var _0x1dd100=path[_0x01ec('0x89')](config[_0x01ec('0x8a')],_0x01ec('0x8b'),_0x01ec('0x8c'),_0x01ec('0x8d'));return db[_0x01ec('0x3b')][_0x01ec('0x57')]({'where':{'id':_0x18c781[_0x01ec('0x54')]['id']},'include':[{'model':db[_0x01ec('0x84')],'as':_0x01ec('0x84')}]})[_0x01ec('0x20')](handleEntityNotFound(_0x25a049,null))['then'](function(_0x882ca5){if(_0x882ca5){return _0x25a049['download'](path[_0x01ec('0x89')](_0x1dd100,_0x882ca5['Attachment'][_0x01ec('0x8e')]));}})['catch'](handleError(_0x25a049,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 26938d5..123be53 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 _0x2b47=['FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x5360b9,_0xaa2c02){var _0x1b8e7f=function(_0x44e0dc){while(--_0x44e0dc){_0x5360b9['push'](_0x5360b9['shift']());}};_0x1b8e7f(++_0xaa2c02);}(_0x2b47,0x177));var _0x72b4=function(_0x2b2b08,_0x13b004){_0x2b2b08=_0x2b2b08-0x0;var _0x3719c3=_0x2b47[_0x2b2b08];return _0x3719c3;};'use strict';var EventEmitter=require(_0x72b4('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x72b4('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x72b4('0x2')](0x0);var events={'afterCreate':_0x72b4('0x3'),'afterUpdate':'update','afterDestroy':_0x72b4('0x4')};function emitEvent(_0x299680){return function(_0x2a3f83,_0x302681,_0x160600){FaxMessageEvents[_0x72b4('0x5')](_0x299680+':'+_0x2a3f83['id'],_0x2a3f83);FaxMessageEvents['emit'](_0x299680,_0x2a3f83);_0x160600(null);};}for(var e in events){if(events[_0x72b4('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x72b4('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x00f0=['hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x4740ab,_0x142db6){var _0x1b72eb=function(_0x5a116e){while(--_0x5a116e){_0x4740ab['push'](_0x4740ab['shift']());}};_0x1b72eb(++_0x142db6);}(_0x00f0,0xec));var _0x000f=function(_0x8fbecf,_0x4a518a){_0x8fbecf=_0x8fbecf-0x0;var _0x46c36d=_0x00f0[_0x8fbecf];return _0x46c36d;};'use strict';var EventEmitter=require(_0x000f('0x0'));var FaxMessage=require(_0x000f('0x1'))['db'][_0x000f('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x000f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x000f('0x4')};function emitEvent(_0x4c8ce1){return function(_0x3cd8ed,_0x53989d,_0x3a0613){FaxMessageEvents[_0x000f('0x5')](_0x4c8ce1+':'+_0x3cd8ed['id'],_0x3cd8ed);FaxMessageEvents['emit'](_0x4c8ce1,_0x3cd8ed);_0x3a0613(null);};}for(var e in events){if(events[_0x000f('0x6')](e)){var event=events[e];FaxMessage[_0x000f('0x7')](e,emitEvent(event));}}module[_0x000f('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 7f29029..48ca3ae 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 _0x29a2=['rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','get','direction','toLowerCase','out','isNil','UserId','findOne','then','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x29a2,0x7c));var _0x229a=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0x29a2[_0x2e41e2];return _0x2844d6;};'use strict';var _=require('lodash');var util=require(_0x229a('0x0'));var logger=require(_0x229a('0x1'))(_0x229a('0x2'));var moment=require(_0x229a('0x3'));var BPromise=require(_0x229a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x229a('0x5'));var rimraf=require(_0x229a('0x6'));var config=require('../../config/environment');var attributes=require(_0x229a('0x7'));module[_0x229a('0x8')]=function(_0x26c97a,_0x490aae){return _0x26c97a[_0x229a('0x9')](_0x229a('0xa'),attributes,{'tableName':_0x229a('0xb'),'paranoid':![],'indexes':[{'name':_0x229a('0xc'),'fields':[_0x229a('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d4c3c,_0xd1ec52,_0x570b2b){var _0x3ab3d1=_0x26c97a['models'];var _0x487687=_0x1d4c3c[_0x229a('0xe')]({'plain':!![]});if(_0x487687[_0x229a('0xf')][_0x229a('0x10')]()==='in'||_0x487687['direction']['toLowerCase']()===_0x229a('0x11')&&!_0x487687['secret']&&!_[_0x229a('0x12')](_0x487687[_0x229a('0x13')])){_0x3ab3d1['FaxInteraction'][_0x229a('0x14')]({'where':{'id':_0x487687['FaxInteractionId']}})[_0x229a('0x15')](function(_0x363132){if(_0x363132){_0x363132['update']({'lastMsgAt':_0x487687['createdAt'],'lastMsgDirection':_0x487687['direction'][_0x229a('0x10')]()});}})[_0x229a('0x16')](function(_0x1c3dad){console[_0x229a('0x17')](_0x1c3dad);});}_0x570b2b();}},'charset':_0x229a('0x18'),'collate':_0x229a('0x19')});}; \ No newline at end of file +var _0x7ac6=['findOne','FaxInteractionId','update','catch','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','./faxMessage.attributes','exports','FaxMessage','fti_fax_messages','body','FULLTEXT','models','toLowerCase','direction','out','isNil','UserId','FaxInteraction'];(function(_0x5e8a68,_0x416f32){var _0x3c0dc8=function(_0xf7df00){while(--_0xf7df00){_0x5e8a68['push'](_0x5e8a68['shift']());}};_0x3c0dc8(++_0x416f32);}(_0x7ac6,0xce));var _0x67ac=function(_0x333ed5,_0x592df1){_0x333ed5=_0x333ed5-0x0;var _0x1eae55=_0x7ac6[_0x333ed5];return _0x1eae55;};'use strict';var _=require('lodash');var util=require(_0x67ac('0x0'));var logger=require('../../config/logger')(_0x67ac('0x1'));var moment=require(_0x67ac('0x2'));var BPromise=require(_0x67ac('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67ac('0x4'));var rimraf=require(_0x67ac('0x5'));var config=require('../../config/environment');var attributes=require(_0x67ac('0x6'));module[_0x67ac('0x7')]=function(_0x1116f1,_0x2b61cf){return _0x1116f1['define'](_0x67ac('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x67ac('0x9'),'fields':[_0x67ac('0xa')],'type':_0x67ac('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a5705,_0x55875e,_0x5cf0b5){var _0x422fd6=_0x1116f1[_0x67ac('0xc')];var _0x11b8a6=_0x3a5705['get']({'plain':!![]});if(_0x11b8a6['direction'][_0x67ac('0xd')]()==='in'||_0x11b8a6[_0x67ac('0xe')][_0x67ac('0xd')]()===_0x67ac('0xf')&&!_0x11b8a6['secret']&&!_[_0x67ac('0x10')](_0x11b8a6[_0x67ac('0x11')])){_0x422fd6[_0x67ac('0x12')][_0x67ac('0x13')]({'where':{'id':_0x11b8a6[_0x67ac('0x14')]}})['then'](function(_0x419cc3){if(_0x419cc3){_0x419cc3[_0x67ac('0x15')]({'lastMsgAt':_0x11b8a6['createdAt'],'lastMsgDirection':_0x11b8a6[_0x67ac('0xe')][_0x67ac('0xd')]()});}})[_0x67ac('0x16')](function(_0x668044){console['error'](_0x668044);});}_0x5cf0b5();}},'charset':_0x67ac('0x17'),'collate':_0x67ac('0x18')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 65cd048..e4401f9 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 _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0x299c63,_0x1aa16e){var _0x19fe63=function(_0x3f99a5){while(--_0x3f99a5){_0x299c63['push'](_0x299c63['shift']());}};_0x19fe63(++_0x1aa16e);}(_0xac31,0xca));var _0x1ac3=function(_0x34c643,_0x3d7b55){_0x34c643=_0x34c643-0x0;var _0x29862d=_0xac31[_0x34c643];return _0x29862d;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});}; \ No newline at end of file +var _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0x42ca7a,_0x2fd73c){var _0x29b7b3=function(_0x53b1b6){while(--_0x53b1b6){_0x42ca7a['push'](_0x42ca7a['shift']());}};_0x29b7b3(++_0x2fd73c);}(_0xac31,0xca));var _0x1ac3=function(_0x546353,_0x3f2e5a){_0x546353=_0x546353-0x0;var _0x1d44c7=_0xac31[_0x546353];return _0x1d44c7;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 8dacca0..5a8322d 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 _0x0034=['remove','emit','removeListener','register','faxMessage:','./faxMessage.events'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0034,0x1d3));var _0x4003=function(_0x52fb3c,_0x2cf66e){_0x52fb3c=_0x52fb3c-0x0;var _0x5c9223=_0x0034[_0x52fb3c];return _0x5c9223;};'use strict';var FaxMessageEvents=require(_0x4003('0x0'));var events=['save',_0x4003('0x1'),'update'];function createListener(_0x2d30a6,_0x115bea){return function(_0x44f68d){_0x115bea[_0x4003('0x2')](_0x2d30a6,_0x44f68d);};}function removeListener(_0x864bf2,_0x2335ee){return function(){FaxMessageEvents[_0x4003('0x3')](_0x864bf2,_0x2335ee);};}exports[_0x4003('0x4')]=function(_0x100d46){for(var _0x163e37=0x0,_0x34a248=events['length'];_0x163e37<_0x34a248;_0x163e37++){var _0x282b51=events[_0x163e37];var _0xcf4051=createListener(_0x4003('0x5')+_0x282b51,_0x100d46);FaxMessageEvents['on'](_0x282b51,_0xcf4051);}}; \ No newline at end of file +var _0x5979=['save','removeListener','register','faxMessage:','./faxMessage.events'];(function(_0x3111b5,_0x2731e6){var _0x457a11=function(_0x2d333a){while(--_0x2d333a){_0x3111b5['push'](_0x3111b5['shift']());}};_0x457a11(++_0x2731e6);}(_0x5979,0x176));var _0x9597=function(_0x134058,_0x423995){_0x134058=_0x134058-0x0;var _0x14a1a9=_0x5979[_0x134058];return _0x14a1a9;};'use strict';var FaxMessageEvents=require(_0x9597('0x0'));var events=[_0x9597('0x1'),'remove','update'];function createListener(_0x2bc659,_0x10f657){return function(_0x87bb42){_0x10f657['emit'](_0x2bc659,_0x87bb42);};}function removeListener(_0x2ed5ec,_0x459e47){return function(){FaxMessageEvents[_0x9597('0x2')](_0x2ed5ec,_0x459e47);};}exports[_0x9597('0x3')]=function(_0x4227f6){for(var _0x4d365d=0x0,_0x2935f9=events['length'];_0x4d365d<_0x2935f9;_0x4d365d++){var _0x3942a2=events[_0x4d365d];var _0x5b88b5=createListener(_0x9597('0x4')+_0x3942a2,_0x4227f6);FaxMessageEvents['on'](_0x3942a2,_0x5b88b5);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 15cfc60..b34655c 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 _0xc368=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','download','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','delete','destroy','exports','util','connect-timeout'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xc368,0x7b));var _0x8c36=function(_0x4daf90,_0x31d7c5){_0x4daf90=_0x4daf90-0x0;var _0x16b208=_0xc368[_0x4daf90];return _0x16b208;};'use strict';var multer=require('multer');var util=require(_0x8c36('0x0'));var path=require('path');var timeout=require(_0x8c36('0x1'));var express=require(_0x8c36('0x2'));var router=express[_0x8c36('0x3')]();var fs_extra=require(_0x8c36('0x4'));var auth=require(_0x8c36('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c36('0x6'));var controller=require(_0x8c36('0x7'));router[_0x8c36('0x8')]('/',auth[_0x8c36('0x9')](),controller['index']);router['get'](_0x8c36('0xa'),auth[_0x8c36('0x9')](),controller[_0x8c36('0xb')]);router[_0x8c36('0x8')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller['show']);router['get']('/:id/download',auth[_0x8c36('0x9')](),controller[_0x8c36('0xd')]);router['post']('/',auth[_0x8c36('0x9')](),interaction[_0x8c36('0xe')](_0x8c36('0xf'),_0x8c36('0x10')),controller[_0x8c36('0x11')]);router[_0x8c36('0x12')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x13')]);router[_0x8c36('0x12')](_0x8c36('0x14'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x15')]);router[_0x8c36('0x12')]('/:id/reject',auth[_0x8c36('0x9')](),controller['reject']);router[_0x8c36('0x16')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x17')]);module[_0x8c36('0x18')]=router; \ No newline at end of file +var _0xeffd=['./faxMessage.controller','get','isAuthenticated','index','/describe','describe','show','download','post','tracked','fax','faxmessage:create','create','/:id','put','accept','/:id/reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4066c4,_0x840cfe){var _0xb9c135=function(_0x175f75){while(--_0x175f75){_0x4066c4['push'](_0x4066c4['shift']());}};_0xb9c135(++_0x840cfe);}(_0xeffd,0x6b));var _0xdeff=function(_0x3b7785,_0x432897){_0x3b7785=_0x3b7785-0x0;var _0x2ede21=_0xeffd[_0x3b7785];return _0x2ede21;};'use strict';var multer=require(_0xdeff('0x0'));var util=require('util');var path=require(_0xdeff('0x1'));var timeout=require(_0xdeff('0x2'));var express=require(_0xdeff('0x3'));var router=express[_0xdeff('0x4')]();var fs_extra=require(_0xdeff('0x5'));var auth=require(_0xdeff('0x6'));var interaction=require(_0xdeff('0x7'));var config=require(_0xdeff('0x8'));var controller=require(_0xdeff('0x9'));router[_0xdeff('0xa')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0xc')]);router[_0xdeff('0xa')](_0xdeff('0xd'),auth[_0xdeff('0xb')](),controller[_0xdeff('0xe')]);router[_0xdeff('0xa')]('/:id',auth[_0xdeff('0xb')](),controller[_0xdeff('0xf')]);router[_0xdeff('0xa')]('/:id/download',auth[_0xdeff('0xb')](),controller[_0xdeff('0x10')]);router[_0xdeff('0x11')]('/',auth[_0xdeff('0xb')](),interaction[_0xdeff('0x12')](_0xdeff('0x13'),_0xdeff('0x14')),controller[_0xdeff('0x15')]);router['put'](_0xdeff('0x16'),auth[_0xdeff('0xb')](),controller['update']);router[_0xdeff('0x17')]('/:id/accept',auth['isAuthenticated'](),controller[_0xdeff('0x18')]);router[_0xdeff('0x17')](_0xdeff('0x19'),auth[_0xdeff('0xb')](),controller['reject']);router[_0xdeff('0x1a')](_0xdeff('0x16'),auth[_0xdeff('0xb')](),controller[_0xdeff('0x1b')]);module[_0xdeff('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 77626b0..9983f9d 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 _0x288a=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x288a,0x1d5));var _0xa288=function(_0x96db0f,_0x4e5537){_0x96db0f=_0x96db0f-0x0;var _0x5c74f5=_0x288a[_0x96db0f];return _0x5c74f5;};'use strict';var Sequelize=require(_0xa288('0x0'));module[_0xa288('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa288('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa288('0x3')]},'timeout':{'type':Sequelize[_0xa288('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa288('0x5')](_0xa288('0x6'),'beepall',_0xa288('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa288('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc00b=['STRING','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x241ce5,_0x5b5737){var _0x1774aa=function(_0x3a53b1){while(--_0x3a53b1){_0x241ce5['push'](_0x241ce5['shift']());}};_0x1774aa(++_0x5b5737);}(_0xc00b,0x1e5));var _0xbc00=function(_0x4f53a6,_0x582ff5){_0x4f53a6=_0x4f53a6-0x0;var _0x30e4b7=_0xc00b[_0x4f53a6];return _0x30e4b7;};'use strict';var Sequelize=require(_0xbc00('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbc00('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbc00('0x2')](_0xbc00('0x3'),_0xbc00('0x4'),_0xbc00('0x5')),'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 69cb13c..6ad5b7a 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 _0xa4e8=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','reject','update','then','FaxQueues','UserProfileResource','destroy','end','error','stack','name','send','index','FaxQueue','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','role','UserProfileSection','autoAssociation','describe','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','from','join'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa4e8,0x12d));var _0x8a4e=function(_0x22924d,_0x59e3a4){_0x22924d=_0x22924d-0x0;var _0x4f86d6=_0xa4e8[_0x22924d];return _0x4f86d6;};'use strict';var emlformat=require(_0x8a4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a4e('0x1'));var jsonpatch=require(_0x8a4e('0x2'));var rp=require(_0x8a4e('0x3'));var moment=require('moment');var BPromise=require(_0x8a4e('0x4'));var Mustache=require(_0x8a4e('0x5'));var util=require(_0x8a4e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8a4e('0x7'));var ejs=require(_0x8a4e('0x8'));var fs=require('fs');var fs_extra=require(_0x8a4e('0x9'));var _=require(_0x8a4e('0xa'));var squel=require(_0x8a4e('0xb'));var crypto=require('crypto');var jsforce=require(_0x8a4e('0xc'));var deskjs=require(_0x8a4e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8a4e('0xe'));var Redis=require('ioredis');var authService=require(_0x8a4e('0xf'));var qs=require(_0x8a4e('0x10'));var as=require(_0x8a4e('0x11'));var hardwareService=require(_0x8a4e('0x12'));var logger=require('../../config/logger')(_0x8a4e('0x13'));var utils=require(_0x8a4e('0x14'));var config=require(_0x8a4e('0x15'));var licenseUtil=require(_0x8a4e('0x16'));var db=require(_0x8a4e('0x17'))['db'];config['redis']=_[_0x8a4e('0x18')](config[_0x8a4e('0x19')],{'host':_0x8a4e('0x1a'),'port':0x18eb});var socket=require(_0x8a4e('0x1b'))(new Redis(config[_0x8a4e('0x19')]));require(_0x8a4e('0x1c'))[_0x8a4e('0x1d')](socket);function respondWithStatusCode(_0x38cecd,_0xea8b4f){_0xea8b4f=_0xea8b4f||0xcc;return function(_0x1b759b){if(_0x1b759b){return _0x38cecd[_0x8a4e('0x1e')](_0xea8b4f);}return _0x38cecd[_0x8a4e('0x1f')](_0xea8b4f)['end']();};}function respondWithResult(_0x1558b6,_0x220e11){_0x220e11=_0x220e11||0xc8;return function(_0x45894c){if(_0x45894c){return _0x1558b6[_0x8a4e('0x1f')](_0x220e11)[_0x8a4e('0x20')](_0x45894c);}};}function respondWithFilteredResult(_0xeb4219,_0x3932f0){return function(_0x59d6d9){if(_0x59d6d9){var _0x2c3067=typeof _0x3932f0['offset']===_0x8a4e('0x21')&&typeof _0x3932f0[_0x8a4e('0x22')]===_0x8a4e('0x21');var _0xda92d7=_0x59d6d9[_0x8a4e('0x23')];var _0x4725d7=_0x2c3067?0x0:_0x3932f0['offset'];var _0x201761=_0x2c3067?_0x59d6d9['count']:_0x3932f0[_0x8a4e('0x24')]+_0x3932f0[_0x8a4e('0x22')];var _0x4a1190;if(_0x201761>=_0xda92d7){_0x201761=_0xda92d7;_0x4a1190=0xc8;}else{_0x4a1190=0xce;}_0xeb4219[_0x8a4e('0x1f')](_0x4a1190);return _0xeb4219['set']('Content-Range',_0x4725d7+'-'+_0x201761+'/'+_0xda92d7)[_0x8a4e('0x20')](_0x59d6d9);}return null;};}function patchUpdates(_0x5716e4){return function(_0x145305){try{jsonpatch['apply'](_0x145305,_0x5716e4,!![]);}catch(_0x25e8b7){return BPromise[_0x8a4e('0x25')](_0x25e8b7);}return _0x145305['save']();};}function saveUpdates(_0x35a00e,_0x196c87){return function(_0xb776a4){if(_0xb776a4){return _0xb776a4[_0x8a4e('0x26')](_0x35a00e)[_0x8a4e('0x27')](function(_0x559e78){return _0x559e78;});}return null;};}function removeEntity(_0x4d36aa,_0x10ae7e){return function(_0x4eb393){if(_0x4eb393){return _0x4eb393['destroy']()[_0x8a4e('0x27')](function(){var _0xfba397=_0x4eb393['get']({'plain':!![]});var _0x5dfb00=_0x8a4e('0x28');return db[_0x8a4e('0x29')][_0x8a4e('0x2a')]({'where':{'type':_0x5dfb00,'resourceId':_0xfba397['id']}})['then'](function(){return _0x4eb393;});})['then'](function(){_0x4d36aa[_0x8a4e('0x1f')](0xcc)[_0x8a4e('0x2b')]();});}};}function handleEntityNotFound(_0xf2f0b3,_0x460cb3){return function(_0x58bf5b){if(!_0x58bf5b){_0xf2f0b3['sendStatus'](0x194);}return _0x58bf5b;};}function handleError(_0x5b9dd1,_0x3d6316){_0x3d6316=_0x3d6316||0x1f4;return function(_0xa1c127){logger[_0x8a4e('0x2c')](_0xa1c127[_0x8a4e('0x2d')]);if(_0xa1c127[_0x8a4e('0x2e')]){delete _0xa1c127[_0x8a4e('0x2e')];}_0x5b9dd1['status'](_0x3d6316)[_0x8a4e('0x2f')](_0xa1c127);};}exports[_0x8a4e('0x30')]=function(_0x4af39b,_0xd06b77){var _0x3fc179={},_0x3bb874={},_0x3fc413={'count':0x0,'rows':[]};var _0xcf2358=_['map'](db[_0x8a4e('0x31')]['rawAttributes'],function(_0x3d8830){return{'name':_0x3d8830[_0x8a4e('0x32')],'type':_0x3d8830[_0x8a4e('0x33')]['key']};});_0x3bb874['model']=_[_0x8a4e('0x34')](_0xcf2358,_0x8a4e('0x2e'));_0x3bb874[_0x8a4e('0x35')]=_[_0x8a4e('0x36')](_0x4af39b[_0x8a4e('0x35')]);_0x3bb874[_0x8a4e('0x37')]=_[_0x8a4e('0x38')](_0x3bb874[_0x8a4e('0x39')],_0x3bb874[_0x8a4e('0x35')]);_0x3fc179[_0x8a4e('0x3a')]=_[_0x8a4e('0x38')](_0x3bb874[_0x8a4e('0x39')],qs[_0x8a4e('0x3b')](_0x4af39b[_0x8a4e('0x35')][_0x8a4e('0x3b')]));_0x3fc179[_0x8a4e('0x3a')]=_0x3fc179[_0x8a4e('0x3a')][_0x8a4e('0x3c')]?_0x3fc179['attributes']:_0x3bb874['model'];if(!_0x4af39b['query'][_0x8a4e('0x3d')](_0x8a4e('0x3e'))){_0x3fc179[_0x8a4e('0x22')]=qs['limit'](_0x4af39b[_0x8a4e('0x35')][_0x8a4e('0x22')]);_0x3fc179[_0x8a4e('0x24')]=qs[_0x8a4e('0x24')](_0x4af39b[_0x8a4e('0x35')][_0x8a4e('0x24')]);}_0x3fc179[_0x8a4e('0x3f')]=qs[_0x8a4e('0x40')](_0x4af39b['query'][_0x8a4e('0x40')]);_0x3fc179[_0x8a4e('0x41')]=qs[_0x8a4e('0x37')](_[_0x8a4e('0x42')](_0x4af39b[_0x8a4e('0x35')],_0x3bb874[_0x8a4e('0x37')]),_0xcf2358);if(_0x4af39b['query'][_0x8a4e('0x43')]){_0x3fc179['where']=_[_0x8a4e('0x44')](_0x3fc179['where'],{'$or':_[_0x8a4e('0x34')](_0xcf2358,function(_0x32d9f6){if(_0x32d9f6[_0x8a4e('0x33')]!=='VIRTUAL'){var _0x2bd74a={};_0x2bd74a[_0x32d9f6[_0x8a4e('0x2e')]]={'$like':'%'+_0x4af39b[_0x8a4e('0x35')][_0x8a4e('0x43')]+'%'};return _0x2bd74a;}})});}_0x3fc179=_['merge']({},_0x3fc179,_0x4af39b[_0x8a4e('0x45')]);var _0x2133d7={'where':_0x3fc179[_0x8a4e('0x41')]};return db[_0x8a4e('0x31')]['count'](_0x2133d7)['then'](function(_0x4b954b){_0x3fc413['count']=_0x4b954b;if(_0x4af39b[_0x8a4e('0x35')][_0x8a4e('0x46')]){_0x3fc179[_0x8a4e('0x47')]=[{'all':!![]}];}return db[_0x8a4e('0x31')][_0x8a4e('0x48')](_0x3fc179);})['then'](function(_0x2cddd8){_0x3fc413[_0x8a4e('0x49')]=_0x2cddd8;return _0x3fc413;})[_0x8a4e('0x27')](respondWithFilteredResult(_0xd06b77,_0x3fc179))[_0x8a4e('0x4a')](handleError(_0xd06b77,null));};exports[_0x8a4e('0x4b')]=function(_0x398c0b,_0x285009){var _0x16efbb={'raw':!![],'where':{'id':_0x398c0b[_0x8a4e('0x4c')]['id']}},_0x496cda={};_0x496cda[_0x8a4e('0x39')]=_[_0x8a4e('0x36')](db[_0x8a4e('0x31')][_0x8a4e('0x4d')]);_0x496cda[_0x8a4e('0x35')]=_['keys'](_0x398c0b[_0x8a4e('0x35')]);_0x496cda[_0x8a4e('0x37')]=_['intersection'](_0x496cda[_0x8a4e('0x39')],_0x496cda[_0x8a4e('0x35')]);_0x16efbb[_0x8a4e('0x3a')]=_['intersection'](_0x496cda[_0x8a4e('0x39')],qs[_0x8a4e('0x3b')](_0x398c0b['query'][_0x8a4e('0x3b')]));_0x16efbb[_0x8a4e('0x3a')]=_0x16efbb[_0x8a4e('0x3a')][_0x8a4e('0x3c')]?_0x16efbb[_0x8a4e('0x3a')]:_0x496cda[_0x8a4e('0x39')];if(_0x398c0b[_0x8a4e('0x35')][_0x8a4e('0x46')]){_0x16efbb['include']=[{'all':!![]}];}_0x16efbb=_[_0x8a4e('0x44')]({},_0x16efbb,_0x398c0b[_0x8a4e('0x45')]);return db[_0x8a4e('0x31')][_0x8a4e('0x4e')](_0x16efbb)[_0x8a4e('0x27')](handleEntityNotFound(_0x285009,null))[_0x8a4e('0x27')](respondWithResult(_0x285009,null))[_0x8a4e('0x4a')](handleError(_0x285009,null));};exports[_0x8a4e('0x4f')]=function(_0x42c835,_0x453c70){return db[_0x8a4e('0x31')][_0x8a4e('0x4f')](_0x42c835[_0x8a4e('0x50')],{})[_0x8a4e('0x27')](function(_0x6a76cd){var _0x1ea489=_0x42c835[_0x8a4e('0x51')][_0x8a4e('0x52')]({'plain':!![]});if(!_0x1ea489)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ea489[_0x8a4e('0x53')]===_0x8a4e('0x51')){var _0x3195ab=_0x6a76cd[_0x8a4e('0x52')]({'plain':!![]});var _0x45b1cb=_0x8a4e('0x28');return db[_0x8a4e('0x54')]['find']({'where':{'name':_0x45b1cb,'userProfileId':_0x1ea489['userProfileId']},'raw':!![]})[_0x8a4e('0x27')](function(_0x2d9893){if(_0x2d9893&&_0x2d9893[_0x8a4e('0x55')]===0x0){return db[_0x8a4e('0x29')][_0x8a4e('0x4f')]({'name':_0x3195ab[_0x8a4e('0x2e')],'resourceId':_0x3195ab['id'],'type':_0x2d9893['name'],'sectionId':_0x2d9893['id']},{})['then'](function(){return _0x6a76cd;});}else{return _0x6a76cd;}})['catch'](function(_0x2f5737){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f5737);throw _0x2f5737;});}return _0x6a76cd;})[_0x8a4e('0x27')](respondWithResult(_0x453c70,0xc9))['catch'](handleError(_0x453c70,null));};exports[_0x8a4e('0x26')]=function(_0x40d023,_0x137ffb){if(_0x40d023['body']['id']){delete _0x40d023['body']['id'];}return db['FaxQueue']['find']({'where':{'id':_0x40d023[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x137ffb,null))[_0x8a4e('0x27')](saveUpdates(_0x40d023[_0x8a4e('0x50')],null))['then'](respondWithResult(_0x137ffb,null))[_0x8a4e('0x4a')](handleError(_0x137ffb,null));};exports[_0x8a4e('0x2a')]=function(_0x2dfba3,_0x104f77){return db[_0x8a4e('0x31')][_0x8a4e('0x4e')]({'where':{'id':_0x2dfba3['params']['id']}})['then'](handleEntityNotFound(_0x104f77,null))[_0x8a4e('0x27')](removeEntity(_0x104f77,null))[_0x8a4e('0x4a')](handleError(_0x104f77,null));};exports[_0x8a4e('0x56')]=function(_0x359997,_0x1b5a03){return db['FaxQueue'][_0x8a4e('0x56')]()['then'](respondWithResult(_0x1b5a03,null))[_0x8a4e('0x4a')](handleError(_0x1b5a03,null));};exports['getMembers']=function(_0x32a61c,_0x5abb5e,_0x4da87f){var _0x15a25a={'raw':!![],'where':{}},_0x27b6bb={},_0x11671f;return db['FaxQueue'][_0x8a4e('0x57')]({'where':{'id':_0x32a61c[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x5abb5e,null))['then'](function(_0x532292){if(_0x532292){_0x11671f=_0x532292[_0x8a4e('0x52')]({'plain':!![]});_0x27b6bb[_0x8a4e('0x39')]=_[_0x8a4e('0x36')](db[_0x8a4e('0x58')][_0x8a4e('0x4d')]);_0x27b6bb[_0x8a4e('0x35')]=_['keys'](_0x32a61c[_0x8a4e('0x35')]);_0x27b6bb[_0x8a4e('0x37')]=_['intersection'](_0x27b6bb[_0x8a4e('0x39')],_0x27b6bb['query']);_0x15a25a[_0x8a4e('0x3a')]=_[_0x8a4e('0x38')](_0x27b6bb['model'],qs[_0x8a4e('0x3b')](_0x32a61c['query'][_0x8a4e('0x3b')]));_0x15a25a['attributes']=_0x15a25a[_0x8a4e('0x3a')][_0x8a4e('0x3c')]?_0x15a25a['attributes']:_0x27b6bb[_0x8a4e('0x39')];if(!_0x32a61c[_0x8a4e('0x35')][_0x8a4e('0x3d')]('nolimit')){_0x15a25a['limit']=qs['limit'](_0x32a61c[_0x8a4e('0x35')]['limit']);_0x15a25a[_0x8a4e('0x24')]=qs[_0x8a4e('0x24')](_0x32a61c[_0x8a4e('0x35')][_0x8a4e('0x24')]);}_0x15a25a['order']=qs[_0x8a4e('0x40')](_0x32a61c[_0x8a4e('0x35')][_0x8a4e('0x40')]);_0x15a25a[_0x8a4e('0x41')]=qs[_0x8a4e('0x37')](_[_0x8a4e('0x42')](_0x32a61c[_0x8a4e('0x35')],_0x27b6bb[_0x8a4e('0x37')]));_0x15a25a[_0x8a4e('0x41')][_0x8a4e('0x59')]=_0x532292['id'];if(_0x32a61c[_0x8a4e('0x35')][_0x8a4e('0x43')]){_0x15a25a[_0x8a4e('0x41')]=_['merge'](_0x15a25a[_0x8a4e('0x41')],{'$or':_[_0x8a4e('0x34')](_0x15a25a[_0x8a4e('0x3a')],function(_0x578b71){var _0x6b5ca6={};_0x6b5ca6[_0x578b71]={'$like':'%'+_0x32a61c['query'][_0x8a4e('0x43')]+'%'};return _0x6b5ca6;})});}_0x15a25a=_[_0x8a4e('0x44')]({},_0x15a25a,_0x32a61c[_0x8a4e('0x45')]);return db[_0x8a4e('0x58')][_0x8a4e('0x48')](_0x15a25a);}})[_0x8a4e('0x27')](function(_0x114a34){if(_0x114a34){return db[_0x8a4e('0x5a')][_0x8a4e('0x5b')]({'where':{'id':_['map'](_0x114a34,_0x8a4e('0x5c')),'role':_0x8a4e('0x5d')},'attributes':['id',_0x8a4e('0x2e'),_0x8a4e('0x5e'),_0x8a4e('0x5f'),_0x8a4e('0x60')]});}})[_0x8a4e('0x27')](function(_0x389cc1){if(_0x389cc1){return{'count':_0x389cc1['count'],'rows':_[_0x8a4e('0x34')](_0x389cc1[_0x8a4e('0x49')],function(_0x14ff4d){return{'membername':_0x14ff4d[_0x8a4e('0x2e')],'UserId':_0x14ff4d['id'],'queue_name':_0x11671f[_0x8a4e('0x2e')],'FaxQueueId':_0x11671f['id'],'interface':util[_0x8a4e('0x61')](_0x8a4e('0x62'),_0x8a4e('0x63'),_0x14ff4d[_0x8a4e('0x2e')]),'penalty':0x0,'paused':_0x14ff4d[_0x8a4e('0x5e')],'createdAt':_0x14ff4d[_0x8a4e('0x60')],'updatedAt':_0x14ff4d[_0x8a4e('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8a4e('0x27')](respondWithFilteredResult(_0x5abb5e,_0x15a25a))[_0x8a4e('0x4a')](handleError(_0x5abb5e,null));};exports[_0x8a4e('0x64')]=function(_0x440b00,_0x238c61,_0x2c21bc){var _0x2e76ee={};var _0x2944ec={};var _0xcf89b0;var _0x4eb917;return db[_0x8a4e('0x31')][_0x8a4e('0x57')]({'where':{'id':_0x440b00[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x238c61,null))[_0x8a4e('0x27')](function(_0x5cabde){if(_0x5cabde){_0xcf89b0=_0x5cabde;_0x2944ec[_0x8a4e('0x39')]=_[_0x8a4e('0x36')](db[_0x8a4e('0x65')][_0x8a4e('0x4d')]);_0x2944ec[_0x8a4e('0x35')]=_[_0x8a4e('0x36')](_0x440b00[_0x8a4e('0x35')]);_0x2944ec[_0x8a4e('0x37')]=_[_0x8a4e('0x38')](_0x2944ec[_0x8a4e('0x39')],_0x2944ec[_0x8a4e('0x35')]);_0x2e76ee[_0x8a4e('0x3a')]=_[_0x8a4e('0x38')](_0x2944ec['model'],qs['fields'](_0x440b00[_0x8a4e('0x35')]['fields']));_0x2e76ee['attributes']=_0x2e76ee[_0x8a4e('0x3a')][_0x8a4e('0x3c')]?_0x2e76ee[_0x8a4e('0x3a')]:_0x2944ec[_0x8a4e('0x39')];_0x2e76ee[_0x8a4e('0x3f')]=qs[_0x8a4e('0x40')](_0x440b00[_0x8a4e('0x35')][_0x8a4e('0x40')]);_0x2e76ee['where']=qs['filters'](_[_0x8a4e('0x42')](_0x440b00[_0x8a4e('0x35')],_0x2944ec['filters']));if(_0x440b00['query'][_0x8a4e('0x43')]){_0x2e76ee[_0x8a4e('0x41')]=_[_0x8a4e('0x44')](_0x2e76ee['where'],{'$or':_[_0x8a4e('0x34')](_0x2e76ee['attributes'],function(_0xa7341){var _0x5b7ee7={};_0x5b7ee7[_0xa7341]={'$like':'%'+_0x440b00[_0x8a4e('0x35')]['filter']+'%'};return _0x5b7ee7;})});}_0x2e76ee=_[_0x8a4e('0x44')]({},_0x2e76ee,_0x440b00['options']);return _0xcf89b0['getTeams'](_0x2e76ee);}})[_0x8a4e('0x27')](function(_0x549bcf){if(_0x549bcf){_0x4eb917=_0x549bcf['length'];if(!_0x440b00[_0x8a4e('0x35')][_0x8a4e('0x3d')](_0x8a4e('0x3e'))){_0x2e76ee[_0x8a4e('0x22')]=qs[_0x8a4e('0x22')](_0x440b00[_0x8a4e('0x35')][_0x8a4e('0x22')]);_0x2e76ee['offset']=qs[_0x8a4e('0x24')](_0x440b00[_0x8a4e('0x35')][_0x8a4e('0x24')]);}return _0xcf89b0[_0x8a4e('0x64')](_0x2e76ee);}})['then'](function(_0x86dddd){if(_0x86dddd){return _0x86dddd?{'count':_0x4eb917,'rows':_0x86dddd}:null;}})[_0x8a4e('0x27')](respondWithResult(_0x238c61,null))[_0x8a4e('0x4a')](handleError(_0x238c61,null));};exports[_0x8a4e('0x66')]=function(_0x49e1bd,_0x4d26ed,_0x1f6d7d){var _0x527fdf=_0x49e1bd[_0x8a4e('0x50')][_0x8a4e('0x67')];return db[_0x8a4e('0x65')]['findAll']({'where':{'id':_0x527fdf},'attributes':['id'],'include':[{'model':db[_0x8a4e('0x5a')],'as':_0x8a4e('0x68'),'attributes':['id','name',_0x8a4e('0x69'),_0x8a4e('0x6a'),_0x8a4e('0x6b')],'raw':!![]}]})[_0x8a4e('0x27')](function(_0x83a559){if(_0x83a559){var _0x1fb656=_[_0x8a4e('0x6c')](_0x83a559,function(_0x41a808){var _0x4ffba4=_0x41a808[_0x8a4e('0x52')]({'plain':!![]});return _0x4ffba4[_0x8a4e('0x68')];});return db[_0x8a4e('0x31')][_0x8a4e('0x4e')]({'where':{'id':_0x49e1bd[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](function(_0x4ab411){return db['sequelize'][_0x8a4e('0x6d')](function(_0x3f76bb){return _0x4ab411['addTeams'](_0x527fdf,{'transaction':_0x3f76bb})[_0x8a4e('0x27')](function(){return BPromise[_0x8a4e('0x6e')](_0x1fb656,function(_0x6e566b){return db['UserFaxQueue'][_0x8a4e('0x6f')]({'where':{'UserId':_0x6e566b['id'],'FaxQueueId':_0x49e1bd['params']['id']},'transaction':_0x3f76bb});});})[_0x8a4e('0x27')](function(){_0x1fb656[_0x8a4e('0x70')](function(_0x148c60){socket[_0x8a4e('0x71')](_0x8a4e('0x72'),{'UserId':_0x148c60['id'],'FaxQueueId':_0x4ab411['id']});});});});});}})[_0x8a4e('0x27')](respondWithStatusCode(_0x4d26ed,null))[_0x8a4e('0x4a')](handleError(_0x4d26ed,null));};exports['removeTeams']=function(_0xcf7360,_0x5b7bd8,_0xf46837){return db[_0x8a4e('0x65')][_0x8a4e('0x48')]({'where':{'id':_0xcf7360['query'][_0x8a4e('0x67')]},'attributes':['id'],'include':[{'model':db[_0x8a4e('0x5a')],'as':_0x8a4e('0x68'),'attributes':['id'],'raw':!![]}]})[_0x8a4e('0x27')](handleEntityNotFound(_0x5b7bd8,null))[_0x8a4e('0x27')](function(_0x4448a7){var _0xda4a57=_[_0x8a4e('0x34')](_0x4448a7,'id');var _0x1cec22=[];var _0x4594c2=[];var _0x5b0e91=squel[_0x8a4e('0x73')]();_0x5b0e91[_0x8a4e('0x74')]('tq.TeamId')[_0x8a4e('0x75')]('team_has_fax_queues','tq')[_0x8a4e('0x76')](_0x8a4e('0x77'),'ut',_0x8a4e('0x78'))['where']('FaxQueueId\x20=\x20?',_0xcf7360[_0x8a4e('0x4c')]['id']);for(var _0x3c32d3=0x0;_0x3c32d3<_0x4448a7['length'];_0x3c32d3+=0x1){let _0x2aa026=_0x4448a7[_0x3c32d3];for(var _0x59acbb=0x0;_0x59acbb<_0x2aa026[_0x8a4e('0x68')]['length'];_0x59acbb+=0x1){let _0xd111e2=_0x2aa026[_0x8a4e('0x68')][_0x59acbb];var _0x4f21fe=_0x5b0e91['clone']();_0x4f21fe[_0x8a4e('0x41')]('ut.UserId\x20=\x20?',_0xd111e2['id']);_0x4594c2[_0x8a4e('0x79')](db[_0x8a4e('0x7a')][_0x8a4e('0x35')](_0x4f21fe['toString'](),{'type':db[_0x8a4e('0x7a')][_0x8a4e('0x7b')][_0x8a4e('0x7c')]})[_0x8a4e('0x27')](function(_0x9e25f2){if(_0x9e25f2[_0x8a4e('0x3c')]===0x1){return _0xd111e2['id'];}else{var _0x20c519=_['every'](_[_0x8a4e('0x34')](_0x9e25f2,_0x8a4e('0x7d')),function(_0x1dca86){return _[_0x8a4e('0x7e')](_0xda4a57,_0x1dca86);});if(_0x20c519){return _0xd111e2['id'];}}}));}}return BPromise[_0x8a4e('0x7f')](_0x4594c2)[_0x8a4e('0x27')](function(_0x5a4661){_0x1cec22=_(_0x1cec22)[_0x8a4e('0x80')](_0x5a4661)[_0x8a4e('0x81')]()[_0x8a4e('0x82')]();return db[_0x8a4e('0x31')][_0x8a4e('0x4e')]({'where':{'id':_0xcf7360[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](function(_0x2c7dd9){return db['sequelize'][_0x8a4e('0x6d')](function(_0x543f17){return _0x2c7dd9[_0x8a4e('0x83')](_0xcf7360[_0x8a4e('0x35')][_0x8a4e('0x67')],{'transaction':_0x543f17})['then'](function(){if(!_[_0x8a4e('0x84')](_0x1cec22)){return _0x2c7dd9[_0x8a4e('0x85')](_0x1cec22,{'transaction':_0x543f17});}})[_0x8a4e('0x27')](function(){_0x1cec22[_0x8a4e('0x70')](function(_0x4a2d60){socket[_0x8a4e('0x71')](_0x8a4e('0x86'),{'UserId':_0x4a2d60,'FaxQueueId':_0x2c7dd9['id']});});});});});});})[_0x8a4e('0x27')](respondWithStatusCode(_0x5b7bd8,null))['catch'](handleError(_0x5b7bd8,null));};exports['addAgents']=function(_0x599b4b,_0x2d5e31,_0x168bef){return db[_0x8a4e('0x31')]['find']({'where':{'id':_0x599b4b[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x2d5e31,null))[_0x8a4e('0x27')](function(_0x2576bd){if(_0x2576bd){return _0x2576bd[_0x8a4e('0x87')](_0x599b4b['body'][_0x8a4e('0x67')],_[_0x8a4e('0x88')](_0x599b4b['body'],[_0x8a4e('0x67'),'id'])||{})[_0x8a4e('0x89')](function(_0x35ea26){for(var _0x4b61ee=0x0;_0x4b61ee<_0x599b4b[_0x8a4e('0x50')][_0x8a4e('0x67')][_0x8a4e('0x3c')];_0x4b61ee+=0x1){socket[_0x8a4e('0x71')](_0x8a4e('0x72'),{'UserId':Number(_0x599b4b[_0x8a4e('0x50')][_0x8a4e('0x67')][_0x4b61ee]),'FaxQueueId':Number(_0x599b4b['params']['id'])});}return _0x35ea26;});}})[_0x8a4e('0x27')](respondWithResult(_0x2d5e31,null))['catch'](handleError(_0x2d5e31,null));};exports[_0x8a4e('0x85')]=function(_0x448806,_0x5c1376,_0x4e613a){return db[_0x8a4e('0x31')]['find']({'where':{'id':_0x448806[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x5c1376,null))[_0x8a4e('0x27')](function(_0x27f188){if(_0x27f188){return _0x27f188['removeAgents'](_0x448806['query'][_0x8a4e('0x67')])[_0x8a4e('0x27')](function(){if(_[_0x8a4e('0x8a')](_0x448806[_0x8a4e('0x35')][_0x8a4e('0x67')])){for(var _0xa118d0=0x0;_0xa118d0<_0x448806['query'][_0x8a4e('0x67')][_0x8a4e('0x3c')];_0xa118d0+=0x1){socket[_0x8a4e('0x71')](_0x8a4e('0x86'),{'UserId':Number(_0x448806[_0x8a4e('0x35')][_0x8a4e('0x67')][_0xa118d0]),'FaxQueueId':Number(_0x448806[_0x8a4e('0x4c')]['id'])});}}else{socket[_0x8a4e('0x71')](_0x8a4e('0x86'),{'UserId':Number(_0x448806[_0x8a4e('0x35')][_0x8a4e('0x67')]),'FaxQueueId':Number(_0x448806['params']['id'])});}});}})[_0x8a4e('0x27')](respondWithStatusCode(_0x5c1376,null))[_0x8a4e('0x4a')](handleError(_0x5c1376,null));};exports[_0x8a4e('0x8b')]=function(_0x3a1e76,_0x39d7db,_0x148320){var _0x1934fd={};var _0xe978a6={};var _0x104e9a;var _0x2dc61e;return db[_0x8a4e('0x31')][_0x8a4e('0x57')]({'where':{'id':_0x3a1e76['params']['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x39d7db,null))[_0x8a4e('0x27')](function(_0x33fd84){if(_0x33fd84){_0x104e9a=_0x33fd84;_0xe978a6[_0x8a4e('0x39')]=_[_0x8a4e('0x36')](db[_0x8a4e('0x5a')][_0x8a4e('0x4d')]);_0xe978a6[_0x8a4e('0x35')]=_[_0x8a4e('0x36')](_0x3a1e76[_0x8a4e('0x35')]);_0xe978a6[_0x8a4e('0x37')]=_[_0x8a4e('0x38')](_0xe978a6[_0x8a4e('0x39')],_0xe978a6[_0x8a4e('0x35')]);_0x1934fd[_0x8a4e('0x3a')]=_[_0x8a4e('0x38')](_0xe978a6[_0x8a4e('0x39')],qs[_0x8a4e('0x3b')](_0x3a1e76[_0x8a4e('0x35')][_0x8a4e('0x3b')]));_0x1934fd[_0x8a4e('0x3a')]=_0x1934fd[_0x8a4e('0x3a')]['length']?_0x1934fd[_0x8a4e('0x3a')]:_0xe978a6[_0x8a4e('0x39')];_0x1934fd['order']=qs['sort'](_0x3a1e76[_0x8a4e('0x35')][_0x8a4e('0x40')]);_0x1934fd['where']=qs['filters'](_[_0x8a4e('0x42')](_0x3a1e76[_0x8a4e('0x35')],_0xe978a6[_0x8a4e('0x37')]));if(_0x3a1e76['query'][_0x8a4e('0x43')]){_0x1934fd[_0x8a4e('0x41')]=_[_0x8a4e('0x44')](_0x1934fd[_0x8a4e('0x41')],{'$or':_['map'](_0x1934fd['attributes'],function(_0x33560f){var _0x94c06a={};_0x94c06a[_0x33560f]={'$like':'%'+_0x3a1e76[_0x8a4e('0x35')][_0x8a4e('0x43')]+'%'};return _0x94c06a;})});}_0x1934fd=_[_0x8a4e('0x44')]({},_0x1934fd,_0x3a1e76['options']);return _0x104e9a[_0x8a4e('0x8b')](_0x1934fd);}})['then'](function(_0x1d5127){if(_0x1d5127){_0x2dc61e=_0x1d5127[_0x8a4e('0x3c')];if(!_0x3a1e76[_0x8a4e('0x35')][_0x8a4e('0x3d')](_0x8a4e('0x3e'))){_0x1934fd[_0x8a4e('0x22')]=qs['limit'](_0x3a1e76['query'][_0x8a4e('0x22')]);_0x1934fd['offset']=qs[_0x8a4e('0x24')](_0x3a1e76[_0x8a4e('0x35')][_0x8a4e('0x24')]);}return _0x104e9a[_0x8a4e('0x8b')](_0x1934fd);}})[_0x8a4e('0x27')](function(_0x5bc2bd){if(_0x5bc2bd){return _0x5bc2bd?{'count':_0x2dc61e,'rows':_0x5bc2bd}:null;}})[_0x8a4e('0x27')](respondWithResult(_0x39d7db,null))[_0x8a4e('0x4a')](handleError(_0x39d7db,null));}; \ No newline at end of file +var _0xd6a2=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','FaxQueues','sendStatus','error','stack','name','send','map','FaxQueue','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','includeAll','rows','catch','show','params','include','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','rawAttributes','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','forEach','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','request-promise','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5d46b6,_0x2eec71){var _0x23ce81=function(_0x57708b){while(--_0x57708b){_0x5d46b6['push'](_0x5d46b6['shift']());}};_0x23ce81(++_0x2eec71);}(_0xd6a2,0x1a5));var _0x2d6a=function(_0x71649a,_0x28ae87){_0x71649a=_0x71649a-0x0;var _0x5c8c08=_0xd6a2[_0x71649a];return _0x5c8c08;};'use strict';var emlformat=require(_0x2d6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2d6a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d6a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2d6a('0x3'));var util=require('util');var path=require(_0x2d6a('0x4'));var sox=require(_0x2d6a('0x5'));var csv=require('to-csv');var ejs=require(_0x2d6a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d6a('0x7'));var squel=require(_0x2d6a('0x8'));var crypto=require(_0x2d6a('0x9'));var jsforce=require(_0x2d6a('0xa'));var deskjs=require(_0x2d6a('0xb'));var toCsv=require(_0x2d6a('0xc'));var querystring=require(_0x2d6a('0xd'));var Papa=require(_0x2d6a('0xe'));var Redis=require(_0x2d6a('0xf'));var authService=require(_0x2d6a('0x10'));var qs=require(_0x2d6a('0x11'));var as=require(_0x2d6a('0x12'));var hardwareService=require(_0x2d6a('0x13'));var logger=require(_0x2d6a('0x14'))('api');var utils=require(_0x2d6a('0x15'));var config=require(_0x2d6a('0x16'));var licenseUtil=require(_0x2d6a('0x17'));var db=require(_0x2d6a('0x18'))['db'];config[_0x2d6a('0x19')]=_[_0x2d6a('0x1a')](config[_0x2d6a('0x19')],{'host':_0x2d6a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2d6a('0x19')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x22a449,_0x3f1680){_0x3f1680=_0x3f1680||0xcc;return function(_0xe19c7b){if(_0xe19c7b){return _0x22a449['sendStatus'](_0x3f1680);}return _0x22a449[_0x2d6a('0x1c')](_0x3f1680)[_0x2d6a('0x1d')]();};}function respondWithResult(_0x32be34,_0x534676){_0x534676=_0x534676||0xc8;return function(_0x35ec0e){if(_0x35ec0e){return _0x32be34[_0x2d6a('0x1c')](_0x534676)[_0x2d6a('0x1e')](_0x35ec0e);}};}function respondWithFilteredResult(_0xc067f2,_0x244364){return function(_0x5456a5){if(_0x5456a5){var _0x3108e2=typeof _0x244364[_0x2d6a('0x1f')]===_0x2d6a('0x20')&&typeof _0x244364[_0x2d6a('0x21')]===_0x2d6a('0x20');var _0x11a867=_0x5456a5[_0x2d6a('0x22')];var _0x12ad38=_0x3108e2?0x0:_0x244364[_0x2d6a('0x1f')];var _0x2febdc=_0x3108e2?_0x5456a5[_0x2d6a('0x22')]:_0x244364['offset']+_0x244364[_0x2d6a('0x21')];var _0x351e80;if(_0x2febdc>=_0x11a867){_0x2febdc=_0x11a867;_0x351e80=0xc8;}else{_0x351e80=0xce;}_0xc067f2[_0x2d6a('0x1c')](_0x351e80);return _0xc067f2[_0x2d6a('0x23')](_0x2d6a('0x24'),_0x12ad38+'-'+_0x2febdc+'/'+_0x11a867)[_0x2d6a('0x1e')](_0x5456a5);}return null;};}function patchUpdates(_0x5c13fb){return function(_0x43f92e){try{jsonpatch[_0x2d6a('0x25')](_0x43f92e,_0x5c13fb,!![]);}catch(_0x2fbe82){return BPromise[_0x2d6a('0x26')](_0x2fbe82);}return _0x43f92e[_0x2d6a('0x27')]();};}function saveUpdates(_0x2ef704,_0x2e187b){return function(_0xcfd6e5){if(_0xcfd6e5){return _0xcfd6e5[_0x2d6a('0x28')](_0x2ef704)['then'](function(_0x2606d2){return _0x2606d2;});}return null;};}function removeEntity(_0x3a9701,_0x36b9b6){return function(_0x51dd62){if(_0x51dd62){return _0x51dd62[_0x2d6a('0x29')]()[_0x2d6a('0x2a')](function(){var _0x3d38d1=_0x51dd62['get']({'plain':!![]});var _0x5a6266=_0x2d6a('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x5a6266,'resourceId':_0x3d38d1['id']}})[_0x2d6a('0x2a')](function(){return _0x51dd62;});})[_0x2d6a('0x2a')](function(){_0x3a9701[_0x2d6a('0x1c')](0xcc)[_0x2d6a('0x1d')]();});}};}function handleEntityNotFound(_0x3d17b6,_0x35f8bc){return function(_0x3fa143){if(!_0x3fa143){_0x3d17b6[_0x2d6a('0x2c')](0x194);}return _0x3fa143;};}function handleError(_0x1e545d,_0x1e9aa2){_0x1e9aa2=_0x1e9aa2||0x1f4;return function(_0x18f3fb){logger[_0x2d6a('0x2d')](_0x18f3fb[_0x2d6a('0x2e')]);if(_0x18f3fb['name']){delete _0x18f3fb[_0x2d6a('0x2f')];}_0x1e545d[_0x2d6a('0x1c')](_0x1e9aa2)[_0x2d6a('0x30')](_0x18f3fb);};}exports['index']=function(_0x3aacd9,_0xf9008a){var _0x29457c={},_0x3932f6={},_0x5b3a37={'count':0x0,'rows':[]};var _0x250bd1=_[_0x2d6a('0x31')](db[_0x2d6a('0x32')]['rawAttributes'],function(_0x483630){return{'name':_0x483630['fieldName'],'type':_0x483630[_0x2d6a('0x33')][_0x2d6a('0x34')]};});_0x3932f6[_0x2d6a('0x35')]=_[_0x2d6a('0x31')](_0x250bd1,_0x2d6a('0x2f'));_0x3932f6[_0x2d6a('0x36')]=_[_0x2d6a('0x37')](_0x3aacd9['query']);_0x3932f6[_0x2d6a('0x38')]=_['intersection'](_0x3932f6[_0x2d6a('0x35')],_0x3932f6['query']);_0x29457c[_0x2d6a('0x39')]=_[_0x2d6a('0x3a')](_0x3932f6[_0x2d6a('0x35')],qs[_0x2d6a('0x3b')](_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x3b')]));_0x29457c[_0x2d6a('0x39')]=_0x29457c['attributes'][_0x2d6a('0x3c')]?_0x29457c['attributes']:_0x3932f6['model'];if(!_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x3d')](_0x2d6a('0x3e'))){_0x29457c['limit']=qs[_0x2d6a('0x21')](_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x21')]);_0x29457c['offset']=qs['offset'](_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x1f')]);}_0x29457c[_0x2d6a('0x3f')]=qs[_0x2d6a('0x40')](_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x40')]);_0x29457c['where']=qs[_0x2d6a('0x38')](_[_0x2d6a('0x41')](_0x3aacd9[_0x2d6a('0x36')],_0x3932f6[_0x2d6a('0x38')]),_0x250bd1);if(_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x42')]){_0x29457c[_0x2d6a('0x43')]=_['merge'](_0x29457c[_0x2d6a('0x43')],{'$or':_[_0x2d6a('0x31')](_0x250bd1,function(_0x525d9a){if(_0x525d9a[_0x2d6a('0x33')]!==_0x2d6a('0x44')){var _0x5c91ab={};_0x5c91ab[_0x525d9a['name']]={'$like':'%'+_0x3aacd9['query'][_0x2d6a('0x42')]+'%'};return _0x5c91ab;}})});}_0x29457c=_['merge']({},_0x29457c,_0x3aacd9['options']);var _0x2a07e2={'where':_0x29457c[_0x2d6a('0x43')]};return db[_0x2d6a('0x32')][_0x2d6a('0x22')](_0x2a07e2)['then'](function(_0x49b0f2){_0x5b3a37[_0x2d6a('0x22')]=_0x49b0f2;if(_0x3aacd9['query'][_0x2d6a('0x45')]){_0x29457c['include']=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x29457c);})[_0x2d6a('0x2a')](function(_0x88cdf9){_0x5b3a37[_0x2d6a('0x46')]=_0x88cdf9;return _0x5b3a37;})[_0x2d6a('0x2a')](respondWithFilteredResult(_0xf9008a,_0x29457c))[_0x2d6a('0x47')](handleError(_0xf9008a,null));};exports[_0x2d6a('0x48')]=function(_0x226b3c,_0x8f2d10){var _0x429d92={'raw':!![],'where':{'id':_0x226b3c[_0x2d6a('0x49')]['id']}},_0x52a728={};_0x52a728[_0x2d6a('0x35')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x52a728[_0x2d6a('0x36')]=_[_0x2d6a('0x37')](_0x226b3c[_0x2d6a('0x36')]);_0x52a728['filters']=_[_0x2d6a('0x3a')](_0x52a728[_0x2d6a('0x35')],_0x52a728[_0x2d6a('0x36')]);_0x429d92['attributes']=_[_0x2d6a('0x3a')](_0x52a728[_0x2d6a('0x35')],qs[_0x2d6a('0x3b')](_0x226b3c[_0x2d6a('0x36')][_0x2d6a('0x3b')]));_0x429d92['attributes']=_0x429d92[_0x2d6a('0x39')]['length']?_0x429d92[_0x2d6a('0x39')]:_0x52a728[_0x2d6a('0x35')];if(_0x226b3c[_0x2d6a('0x36')][_0x2d6a('0x45')]){_0x429d92[_0x2d6a('0x4a')]=[{'all':!![]}];}_0x429d92=_[_0x2d6a('0x4b')]({},_0x429d92,_0x226b3c[_0x2d6a('0x4c')]);return db[_0x2d6a('0x32')][_0x2d6a('0x4d')](_0x429d92)[_0x2d6a('0x2a')](handleEntityNotFound(_0x8f2d10,null))[_0x2d6a('0x2a')](respondWithResult(_0x8f2d10,null))[_0x2d6a('0x47')](handleError(_0x8f2d10,null));};exports[_0x2d6a('0x4e')]=function(_0x165e7a,_0x2395ad){return db[_0x2d6a('0x32')][_0x2d6a('0x4e')](_0x165e7a[_0x2d6a('0x4f')],{})[_0x2d6a('0x2a')](function(_0x348ab1){var _0x4f5140=_0x165e7a['user']['get']({'plain':!![]});if(!_0x4f5140)throw new Error(_0x2d6a('0x50'));if(_0x4f5140[_0x2d6a('0x51')]===_0x2d6a('0x52')){var _0xb98396=_0x348ab1[_0x2d6a('0x53')]({'plain':!![]});var _0x1aa053='FaxQueues';return db[_0x2d6a('0x54')][_0x2d6a('0x4d')]({'where':{'name':_0x1aa053,'userProfileId':_0x4f5140['userProfileId']},'raw':!![]})[_0x2d6a('0x2a')](function(_0xc99f13){if(_0xc99f13&&_0xc99f13[_0x2d6a('0x55')]===0x0){return db[_0x2d6a('0x56')][_0x2d6a('0x4e')]({'name':_0xb98396[_0x2d6a('0x2f')],'resourceId':_0xb98396['id'],'type':_0xc99f13[_0x2d6a('0x2f')],'sectionId':_0xc99f13['id']},{})['then'](function(){return _0x348ab1;});}else{return _0x348ab1;}})['catch'](function(_0x5ae23d){logger[_0x2d6a('0x2d')](_0x2d6a('0x57'),_0x5ae23d);throw _0x5ae23d;});}return _0x348ab1;})[_0x2d6a('0x2a')](respondWithResult(_0x2395ad,0xc9))[_0x2d6a('0x47')](handleError(_0x2395ad,null));};exports[_0x2d6a('0x28')]=function(_0x40c3eb,_0x22ee03){if(_0x40c3eb[_0x2d6a('0x4f')]['id']){delete _0x40c3eb[_0x2d6a('0x4f')]['id'];}return db[_0x2d6a('0x32')][_0x2d6a('0x4d')]({'where':{'id':_0x40c3eb[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x22ee03,null))[_0x2d6a('0x2a')](saveUpdates(_0x40c3eb[_0x2d6a('0x4f')],null))['then'](respondWithResult(_0x22ee03,null))['catch'](handleError(_0x22ee03,null));};exports[_0x2d6a('0x29')]=function(_0x368b9e,_0x5241d4){return db[_0x2d6a('0x32')][_0x2d6a('0x4d')]({'where':{'id':_0x368b9e[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x5241d4,null))['then'](removeEntity(_0x5241d4,null))[_0x2d6a('0x47')](handleError(_0x5241d4,null));};exports[_0x2d6a('0x58')]=function(_0x4a7830,_0x3c9192){return db[_0x2d6a('0x32')]['describe']()[_0x2d6a('0x2a')](respondWithResult(_0x3c9192,null))['catch'](handleError(_0x3c9192,null));};exports[_0x2d6a('0x59')]=function(_0x2dc9e1,_0x140527,_0xe85bfe){var _0x2f70b6={'raw':!![],'where':{}},_0x16fed7={},_0x570e6f;return db['FaxQueue'][_0x2d6a('0x5a')]({'where':{'id':_0x2dc9e1[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x140527,null))[_0x2d6a('0x2a')](function(_0x1ba4ad){if(_0x1ba4ad){_0x570e6f=_0x1ba4ad[_0x2d6a('0x53')]({'plain':!![]});_0x16fed7[_0x2d6a('0x35')]=_['keys'](db[_0x2d6a('0x5b')][_0x2d6a('0x5c')]);_0x16fed7[_0x2d6a('0x36')]=_[_0x2d6a('0x37')](_0x2dc9e1['query']);_0x16fed7[_0x2d6a('0x38')]=_[_0x2d6a('0x3a')](_0x16fed7[_0x2d6a('0x35')],_0x16fed7[_0x2d6a('0x36')]);_0x2f70b6['attributes']=_[_0x2d6a('0x3a')](_0x16fed7['model'],qs[_0x2d6a('0x3b')](_0x2dc9e1[_0x2d6a('0x36')][_0x2d6a('0x3b')]));_0x2f70b6[_0x2d6a('0x39')]=_0x2f70b6['attributes'][_0x2d6a('0x3c')]?_0x2f70b6[_0x2d6a('0x39')]:_0x16fed7[_0x2d6a('0x35')];if(!_0x2dc9e1[_0x2d6a('0x36')][_0x2d6a('0x3d')](_0x2d6a('0x3e'))){_0x2f70b6[_0x2d6a('0x21')]=qs['limit'](_0x2dc9e1['query']['limit']);_0x2f70b6[_0x2d6a('0x1f')]=qs[_0x2d6a('0x1f')](_0x2dc9e1['query'][_0x2d6a('0x1f')]);}_0x2f70b6['order']=qs[_0x2d6a('0x40')](_0x2dc9e1[_0x2d6a('0x36')][_0x2d6a('0x40')]);_0x2f70b6[_0x2d6a('0x43')]=qs['filters'](_['pick'](_0x2dc9e1[_0x2d6a('0x36')],_0x16fed7[_0x2d6a('0x38')]));_0x2f70b6[_0x2d6a('0x43')][_0x2d6a('0x5d')]=_0x1ba4ad['id'];if(_0x2dc9e1['query']['filter']){_0x2f70b6['where']=_['merge'](_0x2f70b6['where'],{'$or':_['map'](_0x2f70b6['attributes'],function(_0x11e505){var _0x4d379a={};_0x4d379a[_0x11e505]={'$like':'%'+_0x2dc9e1[_0x2d6a('0x36')][_0x2d6a('0x42')]+'%'};return _0x4d379a;})});}_0x2f70b6=_[_0x2d6a('0x4b')]({},_0x2f70b6,_0x2dc9e1[_0x2d6a('0x4c')]);return db[_0x2d6a('0x5b')][_0x2d6a('0x5e')](_0x2f70b6);}})['then'](function(_0x26d27d){if(_0x26d27d){return db[_0x2d6a('0x5f')][_0x2d6a('0x60')]({'where':{'id':_['map'](_0x26d27d,_0x2d6a('0x61')),'role':_0x2d6a('0x62')},'attributes':['id','name',_0x2d6a('0x63'),'updatedAt',_0x2d6a('0x64')]});}})['then'](function(_0x2e6b73){if(_0x2e6b73){return{'count':_0x2e6b73[_0x2d6a('0x22')],'rows':_['map'](_0x2e6b73[_0x2d6a('0x46')],function(_0xcb84e2){return{'membername':_0xcb84e2[_0x2d6a('0x2f')],'UserId':_0xcb84e2['id'],'queue_name':_0x570e6f[_0x2d6a('0x2f')],'FaxQueueId':_0x570e6f['id'],'interface':util['format'](_0x2d6a('0x65'),_0x2d6a('0x66'),_0xcb84e2[_0x2d6a('0x2f')]),'penalty':0x0,'paused':_0xcb84e2[_0x2d6a('0x63')],'createdAt':_0xcb84e2[_0x2d6a('0x64')],'updatedAt':_0xcb84e2[_0x2d6a('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x140527,_0x2f70b6))[_0x2d6a('0x47')](handleError(_0x140527,null));};exports[_0x2d6a('0x68')]=function(_0x5e918e,_0x125d3f,_0xc9957a){var _0x3c494e={};var _0x568f0f={};var _0x2e376b;var _0x1d86df;return db[_0x2d6a('0x32')][_0x2d6a('0x5a')]({'where':{'id':_0x5e918e[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x125d3f,null))[_0x2d6a('0x2a')](function(_0x3da32a){if(_0x3da32a){_0x2e376b=_0x3da32a;_0x568f0f[_0x2d6a('0x35')]=_[_0x2d6a('0x37')](db[_0x2d6a('0x69')][_0x2d6a('0x5c')]);_0x568f0f[_0x2d6a('0x36')]=_['keys'](_0x5e918e[_0x2d6a('0x36')]);_0x568f0f[_0x2d6a('0x38')]=_[_0x2d6a('0x3a')](_0x568f0f[_0x2d6a('0x35')],_0x568f0f[_0x2d6a('0x36')]);_0x3c494e[_0x2d6a('0x39')]=_[_0x2d6a('0x3a')](_0x568f0f[_0x2d6a('0x35')],qs['fields'](_0x5e918e[_0x2d6a('0x36')][_0x2d6a('0x3b')]));_0x3c494e[_0x2d6a('0x39')]=_0x3c494e[_0x2d6a('0x39')]['length']?_0x3c494e[_0x2d6a('0x39')]:_0x568f0f[_0x2d6a('0x35')];_0x3c494e[_0x2d6a('0x3f')]=qs[_0x2d6a('0x40')](_0x5e918e[_0x2d6a('0x36')]['sort']);_0x3c494e[_0x2d6a('0x43')]=qs['filters'](_[_0x2d6a('0x41')](_0x5e918e[_0x2d6a('0x36')],_0x568f0f[_0x2d6a('0x38')]));if(_0x5e918e['query']['filter']){_0x3c494e[_0x2d6a('0x43')]=_[_0x2d6a('0x4b')](_0x3c494e[_0x2d6a('0x43')],{'$or':_[_0x2d6a('0x31')](_0x3c494e[_0x2d6a('0x39')],function(_0x29a67a){var _0x3a8ba7={};_0x3a8ba7[_0x29a67a]={'$like':'%'+_0x5e918e[_0x2d6a('0x36')][_0x2d6a('0x42')]+'%'};return _0x3a8ba7;})});}_0x3c494e=_['merge']({},_0x3c494e,_0x5e918e[_0x2d6a('0x4c')]);return _0x2e376b[_0x2d6a('0x68')](_0x3c494e);}})['then'](function(_0x12012f){if(_0x12012f){_0x1d86df=_0x12012f[_0x2d6a('0x3c')];if(!_0x5e918e[_0x2d6a('0x36')][_0x2d6a('0x3d')](_0x2d6a('0x3e'))){_0x3c494e[_0x2d6a('0x21')]=qs[_0x2d6a('0x21')](_0x5e918e[_0x2d6a('0x36')]['limit']);_0x3c494e[_0x2d6a('0x1f')]=qs[_0x2d6a('0x1f')](_0x5e918e['query']['offset']);}return _0x2e376b['getTeams'](_0x3c494e);}})['then'](function(_0x364c46){if(_0x364c46){return _0x364c46?{'count':_0x1d86df,'rows':_0x364c46}:null;}})['then'](respondWithResult(_0x125d3f,null))['catch'](handleError(_0x125d3f,null));};exports[_0x2d6a('0x6a')]=function(_0x43d173,_0x35a223,_0x34fd89){var _0x1651f9=_0x43d173[_0x2d6a('0x4f')][_0x2d6a('0x6b')];return db[_0x2d6a('0x69')][_0x2d6a('0x5e')]({'where':{'id':_0x1651f9},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2d6a('0x6c'),'attributes':['id',_0x2d6a('0x2f'),_0x2d6a('0x6d'),'voicePause',_0x2d6a('0x6e')],'raw':!![]}]})[_0x2d6a('0x2a')](function(_0x32a79d){if(_0x32a79d){var _0x5b578e=_[_0x2d6a('0x6f')](_0x32a79d,function(_0x3dba6e){var _0x4ea0a7=_0x3dba6e['get']({'plain':!![]});return _0x4ea0a7[_0x2d6a('0x6c')];});return db[_0x2d6a('0x32')][_0x2d6a('0x4d')]({'where':{'id':_0x43d173[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](function(_0x15a4f2){return db[_0x2d6a('0x70')][_0x2d6a('0x71')](function(_0x19b826){return _0x15a4f2[_0x2d6a('0x6a')](_0x1651f9,{'transaction':_0x19b826})[_0x2d6a('0x2a')](function(){return BPromise[_0x2d6a('0x72')](_0x5b578e,function(_0x3b35ae){return db[_0x2d6a('0x5b')][_0x2d6a('0x73')]({'where':{'UserId':_0x3b35ae['id'],'FaxQueueId':_0x43d173[_0x2d6a('0x49')]['id']},'transaction':_0x19b826});});})['then'](function(){_0x5b578e['forEach'](function(_0x1c5e32){socket[_0x2d6a('0x74')](_0x2d6a('0x75'),{'UserId':_0x1c5e32['id'],'FaxQueueId':_0x15a4f2['id']});});});});});}})[_0x2d6a('0x2a')](respondWithStatusCode(_0x35a223,null))[_0x2d6a('0x47')](handleError(_0x35a223,null));};exports[_0x2d6a('0x76')]=function(_0x3603d6,_0x2a7674,_0x1f20d8){return db['Team'][_0x2d6a('0x5e')]({'where':{'id':_0x3603d6[_0x2d6a('0x36')][_0x2d6a('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x2d6a('0x5f')],'as':_0x2d6a('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x2d6a('0x2a')](handleEntityNotFound(_0x2a7674,null))['then'](function(_0x5701cb){var _0x1ee4c6=_['map'](_0x5701cb,'id');var _0x1e0d89=[];var _0x3b97f0=[];var _0x1e1e9f=squel['select']();_0x1e1e9f[_0x2d6a('0x77')](_0x2d6a('0x78'))[_0x2d6a('0x79')](_0x2d6a('0x7a'),'tq')[_0x2d6a('0x7b')](_0x2d6a('0x7c'),'ut',_0x2d6a('0x7d'))[_0x2d6a('0x43')](_0x2d6a('0x7e'),_0x3603d6[_0x2d6a('0x49')]['id']);for(var _0xf1fd46=0x0;_0xf1fd46<_0x5701cb[_0x2d6a('0x3c')];_0xf1fd46+=0x1){let _0x46e7b1=_0x5701cb[_0xf1fd46];for(var _0x5778a4=0x0;_0x5778a4<_0x46e7b1[_0x2d6a('0x6c')][_0x2d6a('0x3c')];_0x5778a4+=0x1){let _0x4f46e4=_0x46e7b1[_0x2d6a('0x6c')][_0x5778a4];var _0x1aff86=_0x1e1e9f[_0x2d6a('0x7f')]();_0x1aff86[_0x2d6a('0x43')](_0x2d6a('0x80'),_0x4f46e4['id']);_0x3b97f0[_0x2d6a('0x81')](db['sequelize'][_0x2d6a('0x36')](_0x1aff86[_0x2d6a('0x82')](),{'type':db[_0x2d6a('0x70')][_0x2d6a('0x83')][_0x2d6a('0x84')]})[_0x2d6a('0x2a')](function(_0x9a5b38){if(_0x9a5b38['length']===0x1){return _0x4f46e4['id'];}else{var _0x281080=_[_0x2d6a('0x85')](_['map'](_0x9a5b38,'TeamId'),function(_0x4dd4b9){return _[_0x2d6a('0x86')](_0x1ee4c6,_0x4dd4b9);});if(_0x281080){return _0x4f46e4['id'];}}}));}}return BPromise[_0x2d6a('0x87')](_0x3b97f0)[_0x2d6a('0x2a')](function(_0x362aa3){_0x1e0d89=_(_0x1e0d89)[_0x2d6a('0x88')](_0x362aa3)[_0x2d6a('0x89')]()[_0x2d6a('0x8a')]();return db[_0x2d6a('0x32')]['find']({'where':{'id':_0x3603d6[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](function(_0x32d21b){return db[_0x2d6a('0x70')][_0x2d6a('0x71')](function(_0x3cef5a){return _0x32d21b['removeTeams'](_0x3603d6['query'][_0x2d6a('0x6b')],{'transaction':_0x3cef5a})['then'](function(){if(!_['isEmpty'](_0x1e0d89)){return _0x32d21b['removeAgents'](_0x1e0d89,{'transaction':_0x3cef5a});}})['then'](function(){_0x1e0d89[_0x2d6a('0x8b')](function(_0x2122f6){socket[_0x2d6a('0x74')](_0x2d6a('0x8c'),{'UserId':_0x2122f6,'FaxQueueId':_0x32d21b['id']});});});});});});})[_0x2d6a('0x2a')](respondWithStatusCode(_0x2a7674,null))[_0x2d6a('0x47')](handleError(_0x2a7674,null));};exports[_0x2d6a('0x8d')]=function(_0x4984cb,_0x73a735,_0x50d7aa){return db['FaxQueue']['find']({'where':{'id':_0x4984cb['params']['id']}})['then'](handleEntityNotFound(_0x73a735,null))[_0x2d6a('0x2a')](function(_0x2dce78){if(_0x2dce78){return _0x2dce78[_0x2d6a('0x8d')](_0x4984cb[_0x2d6a('0x4f')][_0x2d6a('0x6b')],_[_0x2d6a('0x8e')](_0x4984cb[_0x2d6a('0x4f')],['ids','id'])||{})[_0x2d6a('0x8f')](function(_0x5e77ab){for(var _0x38a501=0x0;_0x38a501<_0x4984cb[_0x2d6a('0x4f')][_0x2d6a('0x6b')]['length'];_0x38a501+=0x1){socket['emit'](_0x2d6a('0x75'),{'UserId':Number(_0x4984cb[_0x2d6a('0x4f')][_0x2d6a('0x6b')][_0x38a501]),'FaxQueueId':Number(_0x4984cb[_0x2d6a('0x49')]['id'])});}return _0x5e77ab;});}})[_0x2d6a('0x2a')](respondWithResult(_0x73a735,null))[_0x2d6a('0x47')](handleError(_0x73a735,null));};exports[_0x2d6a('0x90')]=function(_0x3df575,_0x54fbb1,_0x314cd2){return db[_0x2d6a('0x32')][_0x2d6a('0x4d')]({'where':{'id':_0x3df575['params']['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x54fbb1,null))[_0x2d6a('0x2a')](function(_0xad46d0){if(_0xad46d0){return _0xad46d0[_0x2d6a('0x90')](_0x3df575[_0x2d6a('0x36')][_0x2d6a('0x6b')])[_0x2d6a('0x2a')](function(){if(_[_0x2d6a('0x91')](_0x3df575[_0x2d6a('0x36')]['ids'])){for(var _0x27f169=0x0;_0x27f169<_0x3df575[_0x2d6a('0x36')][_0x2d6a('0x6b')][_0x2d6a('0x3c')];_0x27f169+=0x1){socket['emit'](_0x2d6a('0x8c'),{'UserId':Number(_0x3df575['query']['ids'][_0x27f169]),'FaxQueueId':Number(_0x3df575[_0x2d6a('0x49')]['id'])});}}else{socket['emit'](_0x2d6a('0x8c'),{'UserId':Number(_0x3df575['query'][_0x2d6a('0x6b')]),'FaxQueueId':Number(_0x3df575[_0x2d6a('0x49')]['id'])});}});}})[_0x2d6a('0x2a')](respondWithStatusCode(_0x54fbb1,null))['catch'](handleError(_0x54fbb1,null));};exports['getAgents']=function(_0x5b8a16,_0x131aaf,_0x1fbdeb){var _0x1638ee={};var _0x2ea582={};var _0x46c043;var _0x10ddbc;return db['FaxQueue'][_0x2d6a('0x5a')]({'where':{'id':_0x5b8a16['params']['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x131aaf,null))[_0x2d6a('0x2a')](function(_0x4b5f93){if(_0x4b5f93){_0x46c043=_0x4b5f93;_0x2ea582[_0x2d6a('0x35')]=_[_0x2d6a('0x37')](db[_0x2d6a('0x5f')][_0x2d6a('0x5c')]);_0x2ea582[_0x2d6a('0x36')]=_['keys'](_0x5b8a16[_0x2d6a('0x36')]);_0x2ea582[_0x2d6a('0x38')]=_[_0x2d6a('0x3a')](_0x2ea582['model'],_0x2ea582[_0x2d6a('0x36')]);_0x1638ee[_0x2d6a('0x39')]=_[_0x2d6a('0x3a')](_0x2ea582[_0x2d6a('0x35')],qs['fields'](_0x5b8a16[_0x2d6a('0x36')]['fields']));_0x1638ee[_0x2d6a('0x39')]=_0x1638ee[_0x2d6a('0x39')][_0x2d6a('0x3c')]?_0x1638ee[_0x2d6a('0x39')]:_0x2ea582[_0x2d6a('0x35')];_0x1638ee[_0x2d6a('0x3f')]=qs[_0x2d6a('0x40')](_0x5b8a16['query'][_0x2d6a('0x40')]);_0x1638ee['where']=qs[_0x2d6a('0x38')](_[_0x2d6a('0x41')](_0x5b8a16['query'],_0x2ea582['filters']));if(_0x5b8a16[_0x2d6a('0x36')][_0x2d6a('0x42')]){_0x1638ee[_0x2d6a('0x43')]=_[_0x2d6a('0x4b')](_0x1638ee[_0x2d6a('0x43')],{'$or':_[_0x2d6a('0x31')](_0x1638ee[_0x2d6a('0x39')],function(_0x488011){var _0x395103={};_0x395103[_0x488011]={'$like':'%'+_0x5b8a16[_0x2d6a('0x36')]['filter']+'%'};return _0x395103;})});}_0x1638ee=_[_0x2d6a('0x4b')]({},_0x1638ee,_0x5b8a16['options']);return _0x46c043[_0x2d6a('0x92')](_0x1638ee);}})[_0x2d6a('0x2a')](function(_0x557cd3){if(_0x557cd3){_0x10ddbc=_0x557cd3[_0x2d6a('0x3c')];if(!_0x5b8a16[_0x2d6a('0x36')][_0x2d6a('0x3d')](_0x2d6a('0x3e'))){_0x1638ee[_0x2d6a('0x21')]=qs[_0x2d6a('0x21')](_0x5b8a16[_0x2d6a('0x36')][_0x2d6a('0x21')]);_0x1638ee[_0x2d6a('0x1f')]=qs[_0x2d6a('0x1f')](_0x5b8a16[_0x2d6a('0x36')][_0x2d6a('0x1f')]);}return _0x46c043[_0x2d6a('0x92')](_0x1638ee);}})[_0x2d6a('0x2a')](function(_0x11ae0a){if(_0x11ae0a){return _0x11ae0a?{'count':_0x10ddbc,'rows':_0x11ae0a}:null;}})[_0x2d6a('0x2a')](respondWithResult(_0x131aaf,null))[_0x2d6a('0x47')](handleError(_0x131aaf,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index c6322f2..f7f1a69 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 _0x9e63=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue'];(function(_0x242d6f,_0x24a25c){var _0x4f034e=function(_0x549953){while(--_0x549953){_0x242d6f['push'](_0x242d6f['shift']());}};_0x4f034e(++_0x24a25c);}(_0x9e63,0x192));var _0x39e6=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x9e63[_0x5b561d];return _0x431060;};'use strict';var EventEmitter=require(_0x39e6('0x0'));var FaxQueue=require(_0x39e6('0x1'))['db'][_0x39e6('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x39e6('0x3')](0x0);var events={'afterCreate':_0x39e6('0x4'),'afterUpdate':_0x39e6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3a69a2){return function(_0x55cf21,_0x47bf70,_0x1e32ae){FaxQueueEvents[_0x39e6('0x6')](_0x3a69a2+':'+_0x55cf21['id'],_0x55cf21);FaxQueueEvents[_0x39e6('0x6')](_0x3a69a2,_0x55cf21);_0x1e32ae(null);};}for(var e in events){if(events[_0x39e6('0x7')](e)){var event=events[e];FaxQueue[_0x39e6('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x1fb9=['save','update','remove','emit','hasOwnProperty','events','FaxQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fb9,0x1cd));var _0x91fb=function(_0x40570d,_0x173745){_0x40570d=_0x40570d-0x0;var _0x53bc05=_0x1fb9[_0x40570d];return _0x53bc05;};'use strict';var EventEmitter=require(_0x91fb('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x91fb('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x91fb('0x2')](0x0);var events={'afterCreate':_0x91fb('0x3'),'afterUpdate':_0x91fb('0x4'),'afterDestroy':_0x91fb('0x5')};function emitEvent(_0x3b7fe3){return function(_0x47c099,_0x2c3c7c,_0x1f0865){FaxQueueEvents[_0x91fb('0x6')](_0x3b7fe3+':'+_0x47c099['id'],_0x47c099);FaxQueueEvents[_0x91fb('0x6')](_0x3b7fe3,_0x47c099);_0x1f0865(null);};}for(var e in events){if(events[_0x91fb('0x7')](e)){var event=events[e];FaxQueue['hook'](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 46f5eb2..71adb66 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 _0x2a19=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxQueue.attributes','fax_queues','util'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0x2a19,0x1c1));var _0x92a1=function(_0x43e987,_0x38c3a3){_0x43e987=_0x43e987-0x0;var _0x36a7f5=_0x2a19[_0x43e987];return _0x36a7f5;};'use strict';var _=require('lodash');var util=require(_0x92a1('0x0'));var logger=require(_0x92a1('0x1'))(_0x92a1('0x2'));var moment=require(_0x92a1('0x3'));var BPromise=require(_0x92a1('0x4'));var rp=require(_0x92a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x92a1('0x6'));var attributes=require(_0x92a1('0x7'));module['exports']=function(_0x364b8c,_0x2e2ea3){return _0x364b8c['define']('FaxQueue',attributes,{'tableName':_0x92a1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae2e=['../../config/logger','api','moment','bluebird','request-promise','./faxQueue.attributes','exports','FaxQueue','fax_queues','lodash','util'];(function(_0x4144d3,_0x1127fc){var _0x332dfa=function(_0x5a2b39){while(--_0x5a2b39){_0x4144d3['push'](_0x4144d3['shift']());}};_0x332dfa(++_0x1127fc);}(_0xae2e,0x153));var _0xeae2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xae2e[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xeae2('0x0'));var util=require(_0xeae2('0x1'));var logger=require(_0xeae2('0x2'))(_0xeae2('0x3'));var moment=require(_0xeae2('0x4'));var BPromise=require(_0xeae2('0x5'));var rp=require(_0xeae2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeae2('0x7'));module[_0xeae2('0x8')]=function(_0x87f6ab,_0x429526){return _0x87f6ab['define'](_0xeae2('0x9'),attributes,{'tableName':_0xeae2('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 1f6c241..ca34207 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 _0xefd5=['raw','where','include','map','model','attributes','GetFaxQueue','ShowFaxQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FaxQueue','findAll','options'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xefd5,0xa9));var _0x5efd=function(_0x5d8d42,_0x1ee52c){_0x5d8d42=_0x5d8d42-0x0;var _0x474f7b=_0xefd5[_0x5d8d42];return _0x474f7b;};'use strict';var _=require(_0x5efd('0x0'));var util=require('util');var moment=require(_0x5efd('0x1'));var BPromise=require(_0x5efd('0x2'));var rs=require(_0x5efd('0x3'));var fs=require('fs');var Redis=require(_0x5efd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5efd('0x5'))(_0x5efd('0x6'));var config=require(_0x5efd('0x7'));var jayson=require(_0x5efd('0x8'));var client=jayson[_0x5efd('0x9')]['http']({'port':0x232a});config[_0x5efd('0xa')]=_[_0x5efd('0xb')](config[_0x5efd('0xa')],{'host':_0x5efd('0xc'),'port':0x18eb});var socket=require(_0x5efd('0xd'))(new Redis(config[_0x5efd('0xa')]));require(_0x5efd('0xe'))[_0x5efd('0xf')](socket);function respondWithRpcPromise(_0x3f1423,_0x45ca48,_0x1b8e6d){return new BPromise(function(_0x1b428d,_0x58288c){return client[_0x5efd('0x10')](_0x3f1423,_0x1b8e6d)[_0x5efd('0x11')](function(_0x5dae32){logger[_0x5efd('0x12')](_0x5efd('0x13'),_0x45ca48,_0x5efd('0x14'));logger[_0x5efd('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x45ca48,_0x5efd('0x14'),JSON[_0x5efd('0x16')](_0x5dae32));if(_0x5dae32[_0x5efd('0x17')]){if(_0x5dae32[_0x5efd('0x17')][_0x5efd('0x18')]===0x1f4){logger[_0x5efd('0x17')](_0x5efd('0x13'),_0x45ca48,_0x5dae32[_0x5efd('0x17')][_0x5efd('0x19')]);return _0x58288c(_0x5dae32[_0x5efd('0x17')][_0x5efd('0x19')]);}logger['error'](_0x5efd('0x13'),_0x45ca48,_0x5dae32[_0x5efd('0x17')][_0x5efd('0x19')]);return _0x1b428d(_0x5dae32[_0x5efd('0x17')][_0x5efd('0x19')]);}else{logger[_0x5efd('0x12')]('FaxQueue,\x20%s,\x20%s',_0x45ca48,'request\x20sent');_0x1b428d(_0x5dae32[_0x5efd('0x1a')][_0x5efd('0x19')]);}})[_0x5efd('0x1b')](function(_0x5f4db5){logger[_0x5efd('0x17')](_0x5efd('0x13'),_0x45ca48,_0x5f4db5);_0x58288c(_0x5f4db5);});});}exports['GetFaxQueue']=function(_0x21e3a0){var _0x33e59a=this;return new Promise(function(_0x4a9bbe,_0x1d7c6d){return db[_0x5efd('0x1c')][_0x5efd('0x1d')]({'raw':_0x21e3a0['options']?_0x21e3a0[_0x5efd('0x1e')][_0x5efd('0x1f')]===undefined?!![]:![]:!![],'where':_0x21e3a0[_0x5efd('0x1e')]?_0x21e3a0[_0x5efd('0x1e')][_0x5efd('0x20')]||null:null,'attributes':_0x21e3a0[_0x5efd('0x1e')]?_0x21e3a0[_0x5efd('0x1e')]['attributes']||null:null,'limit':_0x21e3a0[_0x5efd('0x1e')]?_0x21e3a0[_0x5efd('0x1e')]['limit']||null:null,'include':_0x21e3a0['options']?_0x21e3a0[_0x5efd('0x1e')][_0x5efd('0x21')]?_[_0x5efd('0x22')](_0x21e3a0[_0x5efd('0x1e')]['include'],function(_0x1a1369){return{'model':db[_0x1a1369[_0x5efd('0x23')]],'as':_0x1a1369['as'],'attributes':_0x1a1369[_0x5efd('0x24')],'include':_0x1a1369['include']?_['map'](_0x1a1369[_0x5efd('0x21')],function(_0x4a13cb){return{'model':db[_0x4a13cb['model']],'as':_0x4a13cb['as'],'attributes':_0x4a13cb['attributes'],'include':_0x4a13cb['include']?_[_0x5efd('0x22')](_0x4a13cb[_0x5efd('0x21')],function(_0x32ff53){return{'model':db[_0x32ff53['model']],'as':_0x32ff53['as'],'attributes':_0x32ff53[_0x5efd('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5efd('0x11')](function(_0x35400e){logger[_0x5efd('0x12')]('GetFaxQueue',_0x21e3a0);logger[_0x5efd('0x15')](_0x5efd('0x25'),_0x21e3a0,JSON[_0x5efd('0x16')](_0x35400e));_0x4a9bbe(_0x35400e);})[_0x5efd('0x1b')](function(_0x1366e7){logger[_0x5efd('0x17')]('GetFaxQueue',_0x1366e7[_0x5efd('0x19')],_0x21e3a0);_0x1d7c6d(_0x33e59a[_0x5efd('0x17')](0x1f4,_0x1366e7[_0x5efd('0x19')]));});});};exports[_0x5efd('0x26')]=function(_0x1e81cc){var _0xe7b778=this;return new Promise(function(_0x243d56,_0xee28f1){return db['FaxQueue'][_0x5efd('0x27')]({'raw':_0x1e81cc[_0x5efd('0x1e')]?_0x1e81cc[_0x5efd('0x1e')][_0x5efd('0x1f')]===undefined?!![]:![]:!![],'where':_0x1e81cc[_0x5efd('0x1e')]?_0x1e81cc[_0x5efd('0x1e')][_0x5efd('0x20')]||null:null,'attributes':_0x1e81cc[_0x5efd('0x1e')]?_0x1e81cc[_0x5efd('0x1e')][_0x5efd('0x24')]||null:null,'include':_0x1e81cc['options']?_0x1e81cc[_0x5efd('0x1e')][_0x5efd('0x21')]?_['map'](_0x1e81cc[_0x5efd('0x1e')]['include'],function(_0xc72644){return{'model':db[_0xc72644[_0x5efd('0x23')]],'as':_0xc72644['as'],'attributes':_0xc72644['attributes'],'include':_0xc72644[_0x5efd('0x21')]?_[_0x5efd('0x22')](_0xc72644[_0x5efd('0x21')],function(_0x445221){return{'model':db[_0x445221[_0x5efd('0x23')]],'as':_0x445221['as'],'attributes':_0x445221[_0x5efd('0x24')],'include':_0x445221[_0x5efd('0x21')]?_[_0x5efd('0x22')](_0x445221[_0x5efd('0x21')],function(_0x4b035f){return{'model':db[_0x4b035f[_0x5efd('0x23')]],'as':_0x4b035f['as'],'attributes':_0x4b035f[_0x5efd('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5efd('0x11')](function(_0x308dbb){logger[_0x5efd('0x12')](_0x5efd('0x26'),_0x1e81cc);logger[_0x5efd('0x15')](_0x5efd('0x26'),_0x1e81cc,JSON['stringify'](_0x308dbb));_0x243d56(_0x308dbb);})[_0x5efd('0x1b')](function(_0x71b62b){logger[_0x5efd('0x17')]('ShowFaxQueue',_0x71b62b[_0x5efd('0x19')],_0x1e81cc);_0xee28f1(_0xe7b778[_0x5efd('0x17')](0x1f4,_0x71b62b[_0x5efd('0x19')]));});});}; \ No newline at end of file +var _0xe6c3=['FaxQueue','find','ShowFaxQueue','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','FaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetFaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','catch'];(function(_0x3a75eb,_0x1efec7){var _0x29375a=function(_0x2ca5f3){while(--_0x2ca5f3){_0x3a75eb['push'](_0x3a75eb['shift']());}};_0x29375a(++_0x1efec7);}(_0xe6c3,0xe7));var _0x3e6c=function(_0x4d14d1,_0x161707){_0x4d14d1=_0x4d14d1-0x0;var _0x5cf04c=_0xe6c3[_0x4d14d1];return _0x5cf04c;};'use strict';var _=require(_0x3e6c('0x0'));var util=require(_0x3e6c('0x1'));var moment=require('moment');var BPromise=require(_0x3e6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e6c('0x3'));var db=require(_0x3e6c('0x4'))['db'];var utils=require(_0x3e6c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3e6c('0x6'));var client=jayson[_0x3e6c('0x7')][_0x3e6c('0x8')]({'port':0x232a});config[_0x3e6c('0x9')]=_[_0x3e6c('0xa')](config[_0x3e6c('0x9')],{'host':_0x3e6c('0xb'),'port':0x18eb});var socket=require(_0x3e6c('0xc'))(new Redis(config[_0x3e6c('0x9')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0xd38ae8,_0x4a0a84,_0xab537){return new BPromise(function(_0x36c949,_0xb6bd3){return client[_0x3e6c('0xd')](_0xd38ae8,_0xab537)[_0x3e6c('0xe')](function(_0x58c1bf){logger[_0x3e6c('0xf')](_0x3e6c('0x10'),_0x4a0a84,'request\x20sent');logger[_0x3e6c('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x4a0a84,_0x3e6c('0x12'),JSON[_0x3e6c('0x13')](_0x58c1bf));if(_0x58c1bf[_0x3e6c('0x14')]){if(_0x58c1bf[_0x3e6c('0x14')][_0x3e6c('0x15')]===0x1f4){logger['error'](_0x3e6c('0x10'),_0x4a0a84,_0x58c1bf[_0x3e6c('0x14')][_0x3e6c('0x16')]);return _0xb6bd3(_0x58c1bf[_0x3e6c('0x14')][_0x3e6c('0x16')]);}logger[_0x3e6c('0x14')](_0x3e6c('0x10'),_0x4a0a84,_0x58c1bf[_0x3e6c('0x14')][_0x3e6c('0x16')]);return _0x36c949(_0x58c1bf[_0x3e6c('0x14')][_0x3e6c('0x16')]);}else{logger[_0x3e6c('0xf')](_0x3e6c('0x10'),_0x4a0a84,_0x3e6c('0x12'));_0x36c949(_0x58c1bf[_0x3e6c('0x17')]['message']);}})['catch'](function(_0x42e68c){logger[_0x3e6c('0x14')](_0x3e6c('0x10'),_0x4a0a84,_0x42e68c);_0xb6bd3(_0x42e68c);});});}exports[_0x3e6c('0x18')]=function(_0x3e541a){var _0x40961c=this;return new Promise(function(_0x16a359,_0x52d520){return db['FaxQueue'][_0x3e6c('0x19')]({'raw':_0x3e541a[_0x3e6c('0x1a')]?_0x3e541a[_0x3e6c('0x1a')][_0x3e6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x3e541a['options']?_0x3e541a[_0x3e6c('0x1a')][_0x3e6c('0x1c')]||null:null,'attributes':_0x3e541a[_0x3e6c('0x1a')]?_0x3e541a[_0x3e6c('0x1a')][_0x3e6c('0x1d')]||null:null,'limit':_0x3e541a['options']?_0x3e541a['options'][_0x3e6c('0x1e')]||null:null,'include':_0x3e541a[_0x3e6c('0x1a')]?_0x3e541a['options']['include']?_[_0x3e6c('0x1f')](_0x3e541a[_0x3e6c('0x1a')][_0x3e6c('0x20')],function(_0x28f5c3){return{'model':db[_0x28f5c3[_0x3e6c('0x21')]],'as':_0x28f5c3['as'],'attributes':_0x28f5c3[_0x3e6c('0x1d')],'include':_0x28f5c3[_0x3e6c('0x20')]?_[_0x3e6c('0x1f')](_0x28f5c3[_0x3e6c('0x20')],function(_0xc31004){return{'model':db[_0xc31004[_0x3e6c('0x21')]],'as':_0xc31004['as'],'attributes':_0xc31004[_0x3e6c('0x1d')],'include':_0xc31004['include']?_[_0x3e6c('0x1f')](_0xc31004[_0x3e6c('0x20')],function(_0x3208c2){return{'model':db[_0x3208c2[_0x3e6c('0x21')]],'as':_0x3208c2['as'],'attributes':_0x3208c2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ffebd){logger[_0x3e6c('0xf')](_0x3e6c('0x18'),_0x3e541a);logger[_0x3e6c('0x11')](_0x3e6c('0x18'),_0x3e541a,JSON[_0x3e6c('0x13')](_0x1ffebd));_0x16a359(_0x1ffebd);})[_0x3e6c('0x22')](function(_0x5d769e){logger['error'](_0x3e6c('0x18'),_0x5d769e[_0x3e6c('0x16')],_0x3e541a);_0x52d520(_0x40961c[_0x3e6c('0x14')](0x1f4,_0x5d769e[_0x3e6c('0x16')]));});});};exports['ShowFaxQueue']=function(_0x1d7d59){var _0x2440e4=this;return new Promise(function(_0x1fcaf0,_0x38a8ae){return db[_0x3e6c('0x23')][_0x3e6c('0x24')]({'raw':_0x1d7d59['options']?_0x1d7d59['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d7d59[_0x3e6c('0x1a')]?_0x1d7d59[_0x3e6c('0x1a')]['where']||null:null,'attributes':_0x1d7d59[_0x3e6c('0x1a')]?_0x1d7d59['options'][_0x3e6c('0x1d')]||null:null,'include':_0x1d7d59[_0x3e6c('0x1a')]?_0x1d7d59['options'][_0x3e6c('0x20')]?_[_0x3e6c('0x1f')](_0x1d7d59[_0x3e6c('0x1a')][_0x3e6c('0x20')],function(_0x2f16c5){return{'model':db[_0x2f16c5[_0x3e6c('0x21')]],'as':_0x2f16c5['as'],'attributes':_0x2f16c5[_0x3e6c('0x1d')],'include':_0x2f16c5['include']?_['map'](_0x2f16c5['include'],function(_0x3633a8){return{'model':db[_0x3633a8[_0x3e6c('0x21')]],'as':_0x3633a8['as'],'attributes':_0x3633a8['attributes'],'include':_0x3633a8[_0x3e6c('0x20')]?_[_0x3e6c('0x1f')](_0x3633a8[_0x3e6c('0x20')],function(_0xb8a073){return{'model':db[_0xb8a073[_0x3e6c('0x21')]],'as':_0xb8a073['as'],'attributes':_0xb8a073[_0x3e6c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x456861){logger[_0x3e6c('0xf')](_0x3e6c('0x25'),_0x1d7d59);logger[_0x3e6c('0x11')](_0x3e6c('0x25'),_0x1d7d59,JSON[_0x3e6c('0x13')](_0x456861));_0x1fcaf0(_0x456861);})['catch'](function(_0x7cf5af){logger[_0x3e6c('0x14')](_0x3e6c('0x25'),_0x7cf5af[_0x3e6c('0x16')],_0x1d7d59);_0x38a8ae(_0x2440e4['error'](0x1f4,_0x7cf5af['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 4073d3f..2066cfd 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 _0xed05=['update','emit','removeListener','register','length','./faxQueue.events','save','remove'];(function(_0x5a2871,_0x386326){var _0x55d597=function(_0x2a73ee){while(--_0x2a73ee){_0x5a2871['push'](_0x5a2871['shift']());}};_0x55d597(++_0x386326);}(_0xed05,0xcd));var _0x5ed0=function(_0x1b736a,_0x108e5e){_0x1b736a=_0x1b736a-0x0;var _0x18a24f=_0xed05[_0x1b736a];return _0x18a24f;};'use strict';var FaxQueueEvents=require(_0x5ed0('0x0'));var events=[_0x5ed0('0x1'),_0x5ed0('0x2'),_0x5ed0('0x3')];function createListener(_0x11e3f4,_0x8093a0){return function(_0xaf86e8){_0x8093a0[_0x5ed0('0x4')](_0x11e3f4,_0xaf86e8);};}function removeListener(_0x220e77,_0x2e0d6a){return function(){FaxQueueEvents[_0x5ed0('0x5')](_0x220e77,_0x2e0d6a);};}exports[_0x5ed0('0x6')]=function(_0x5b9994){for(var _0x4712b3=0x0,_0x484c11=events[_0x5ed0('0x7')];_0x4712b3<_0x484c11;_0x4712b3++){var _0x4cc5e2=events[_0x4712b3];var _0x454445=createListener('faxQueue:'+_0x4cc5e2,_0x5b9994);FaxQueueEvents['on'](_0x4cc5e2,_0x454445);}}; \ No newline at end of file +var _0x663f=['remove','emit','register','length','faxQueue:','save'];(function(_0x5b9e24,_0x2265f9){var _0x1cbf61=function(_0xa9128d){while(--_0xa9128d){_0x5b9e24['push'](_0x5b9e24['shift']());}};_0x1cbf61(++_0x2265f9);}(_0x663f,0xdd));var _0xf663=function(_0xdd0313,_0x251c2b){_0xdd0313=_0xdd0313-0x0;var _0x2bd7e8=_0x663f[_0xdd0313];return _0x2bd7e8;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xf663('0x0'),_0xf663('0x1'),'update'];function createListener(_0x51df07,_0x135c57){return function(_0x1ec9ed){_0x135c57[_0xf663('0x2')](_0x51df07,_0x1ec9ed);};}function removeListener(_0x42c2f1,_0x354f0e){return function(){FaxQueueEvents['removeListener'](_0x42c2f1,_0x354f0e);};}exports[_0xf663('0x3')]=function(_0x11e449){for(var _0x725397=0x0,_0x5647af=events[_0xf663('0x4')];_0x725397<_0x5647af;_0x725397++){var _0x20bbca=events[_0x725397];var _0x363e57=createListener(_0xf663('0x5')+_0x20bbca,_0x11e449);FaxQueueEvents['on'](_0x20bbca,_0x363e57);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 9b7ed89..64b8c68 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 _0xdbb1=['../../config/environment','./faxQueue.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','multer','express','../../components/auth/service'];(function(_0x61ec5f,_0x3900ff){var _0x4a72e5=function(_0x4d14e8){while(--_0x4d14e8){_0x61ec5f['push'](_0x61ec5f['shift']());}};_0x4a72e5(++_0x3900ff);}(_0xdbb1,0x105));var _0x1dbb=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xdbb1[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0x1dbb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1dbb('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1dbb('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x1dbb('0x3'));var controller=require(_0x1dbb('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x1dbb('0x5')]);router[_0x1dbb('0x6')](_0x1dbb('0x7'),auth[_0x1dbb('0x8')](),controller['describe']);router[_0x1dbb('0x6')](_0x1dbb('0x9'),auth['isAuthenticated'](),controller[_0x1dbb('0xa')]);router[_0x1dbb('0x6')](_0x1dbb('0xb'),auth[_0x1dbb('0x8')](),controller[_0x1dbb('0xc')]);router[_0x1dbb('0x6')](_0x1dbb('0xd'),auth[_0x1dbb('0x8')](),controller[_0x1dbb('0xe')]);router[_0x1dbb('0x6')](_0x1dbb('0xf'),auth['isAuthenticated'](),controller[_0x1dbb('0x10')]);router[_0x1dbb('0x11')]('/',auth[_0x1dbb('0x8')](),controller[_0x1dbb('0x12')]);router['post']('/:id/teams',auth[_0x1dbb('0x8')](),controller[_0x1dbb('0x13')]);router[_0x1dbb('0x11')](_0x1dbb('0xf'),auth[_0x1dbb('0x8')](),controller['addAgents']);router[_0x1dbb('0x14')](_0x1dbb('0x9'),auth[_0x1dbb('0x8')](),controller['update']);router[_0x1dbb('0x15')](_0x1dbb('0x9'),auth['isAuthenticated'](),controller[_0x1dbb('0x16')]);router[_0x1dbb('0x15')](_0x1dbb('0xd'),auth[_0x1dbb('0x8')](),controller[_0x1dbb('0x17')]);router[_0x1dbb('0x15')](_0x1dbb('0xf'),auth[_0x1dbb('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9bd9=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x7d70ca,_0x35d51a){var _0x4dd0fc=function(_0x15d987){while(--_0x15d987){_0x7d70ca['push'](_0x7d70ca['shift']());}};_0x4dd0fc(++_0x35d51a);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x401b3e,_0xed8de5){_0x401b3e=_0x401b3e-0x0;var _0x4f290f=_0x9bd9[_0x401b3e];return _0x4f290f;};'use strict';var multer=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var path=require(_0x99bd('0x2'));var timeout=require(_0x99bd('0x3'));var express=require(_0x99bd('0x4'));var router=express[_0x99bd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x99bd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x99bd('0x7'));var controller=require(_0x99bd('0x8'));router['get']('/',auth[_0x99bd('0x9')](),controller[_0x99bd('0xa')]);router[_0x99bd('0xb')](_0x99bd('0xc'),auth[_0x99bd('0x9')](),controller[_0x99bd('0xd')]);router[_0x99bd('0xb')](_0x99bd('0xe'),auth[_0x99bd('0x9')](),controller[_0x99bd('0xf')]);router[_0x99bd('0xb')](_0x99bd('0x10'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x11')]);router['get'](_0x99bd('0x12'),auth['isAuthenticated'](),controller[_0x99bd('0x13')]);router['get'](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller['getAgents']);router[_0x99bd('0x15')]('/',auth['isAuthenticated'](),controller[_0x99bd('0x16')]);router['post'](_0x99bd('0x12'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x17')]);router['post'](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x18')]);router[_0x99bd('0x19')](_0x99bd('0xe'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x1a')]);router[_0x99bd('0x1b')](_0x99bd('0xe'),auth['isAuthenticated'](),controller[_0x99bd('0x1c')]);router[_0x99bd('0x1b')](_0x99bd('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x99bd('0x1b')](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x1d')]);module[_0x99bd('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 261edb2..5299468 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 _0x5e04=['sequelize','exports','STRING','DATE','moment'];(function(_0x1203bb,_0x4ddd17){var _0x10434f=function(_0xe85f33){while(--_0xe85f33){_0x1203bb['push'](_0x1203bb['shift']());}};_0x10434f(++_0x4ddd17);}(_0x5e04,0x176));var _0x45e0=function(_0x2a0c21,_0x51ad5e){_0x2a0c21=_0x2a0c21-0x0;var _0x28f2ff=_0x5e04[_0x2a0c21];return _0x28f2ff;};'use strict';var moment=require(_0x45e0('0x0'));var Sequelize=require(_0x45e0('0x1'));module[_0x45e0('0x2')]={'uniqueid':{'type':Sequelize[_0x45e0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x45e0('0x3')]},'joinAt':{'type':Sequelize[_0x45e0('0x4')]},'leaveAt':{'type':Sequelize[_0x45e0('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x45e0('0x4')]},'reason':{'type':Sequelize[_0x45e0('0x3')]}}; \ No newline at end of file +var _0xbceb=['DATE','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbceb,0x10d));var _0xbbce=function(_0x2f0220,_0x153318){_0x2f0220=_0x2f0220-0x0;var _0x4d4b45=_0xbceb[_0x2f0220];return _0x4d4b45;};'use strict';var moment=require('moment');var Sequelize=require(_0xbbce('0x0'));module[_0xbbce('0x1')]={'uniqueid':{'type':Sequelize[_0xbbce('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbbce('0x2')]},'joinAt':{'type':Sequelize[_0xbbce('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbbce('0x3')]},'reason':{'type':Sequelize[_0xbbce('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 486734c..58cabba 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 _0xca56=['show','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch'];(function(_0x2a3969,_0x42b9bc){var _0x31a010=function(_0x2f7d8a){while(--_0x2f7d8a){_0x2a3969['push'](_0x2a3969['shift']());}};_0x31a010(++_0x42b9bc);}(_0xca56,0xee));var _0x6ca5=function(_0x16b909,_0x57814d){_0x16b909=_0x16b909-0x0;var _0x2e0e48=_0xca56[_0x16b909];return _0x2e0e48;};'use strict';var emlformat=require(_0x6ca5('0x0'));var rimraf=require(_0x6ca5('0x1'));var zipdir=require(_0x6ca5('0x2'));var jsonpatch=require(_0x6ca5('0x3'));var rp=require(_0x6ca5('0x4'));var moment=require(_0x6ca5('0x5'));var BPromise=require(_0x6ca5('0x6'));var Mustache=require(_0x6ca5('0x7'));var util=require(_0x6ca5('0x8'));var path=require('path');var sox=require(_0x6ca5('0x9'));var csv=require(_0x6ca5('0xa'));var ejs=require(_0x6ca5('0xb'));var fs=require('fs');var fs_extra=require(_0x6ca5('0xc'));var _=require('lodash');var squel=require(_0x6ca5('0xd'));var crypto=require(_0x6ca5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ca5('0xa'));var querystring=require(_0x6ca5('0xf'));var Papa=require(_0x6ca5('0x10'));var Redis=require(_0x6ca5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6ca5('0x12'));var hardwareService=require(_0x6ca5('0x13'));var logger=require(_0x6ca5('0x14'))(_0x6ca5('0x15'));var utils=require(_0x6ca5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6ca5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eb3b9,_0x4fb08b){_0x4fb08b=_0x4fb08b||0xcc;return function(_0x5dd594){if(_0x5dd594){return _0x2eb3b9[_0x6ca5('0x18')](_0x4fb08b);}return _0x2eb3b9['status'](_0x4fb08b)['end']();};}function respondWithResult(_0x2a35cf,_0x428419){_0x428419=_0x428419||0xc8;return function(_0x5ba653){if(_0x5ba653){return _0x2a35cf[_0x6ca5('0x19')](_0x428419)[_0x6ca5('0x1a')](_0x5ba653);}};}function respondWithFilteredResult(_0x491a95,_0x40483f){return function(_0x19debd){if(_0x19debd){var _0x1cdfdc=typeof _0x40483f[_0x6ca5('0x1b')]===_0x6ca5('0x1c')&&typeof _0x40483f['limit']===_0x6ca5('0x1c');var _0x38f3db=_0x19debd['count'];var _0x2b3daf=_0x1cdfdc?0x0:_0x40483f[_0x6ca5('0x1b')];var _0x4fefd0=_0x1cdfdc?_0x19debd[_0x6ca5('0x1d')]:_0x40483f[_0x6ca5('0x1b')]+_0x40483f[_0x6ca5('0x1e')];var _0x37e362;if(_0x4fefd0>=_0x38f3db){_0x4fefd0=_0x38f3db;_0x37e362=0xc8;}else{_0x37e362=0xce;}_0x491a95[_0x6ca5('0x19')](_0x37e362);return _0x491a95[_0x6ca5('0x1f')]('Content-Range',_0x2b3daf+'-'+_0x4fefd0+'/'+_0x38f3db)[_0x6ca5('0x1a')](_0x19debd);}return null;};}function patchUpdates(_0xc7c1cb){return function(_0x44df63){try{jsonpatch[_0x6ca5('0x20')](_0x44df63,_0xc7c1cb,!![]);}catch(_0x11fe18){return BPromise[_0x6ca5('0x21')](_0x11fe18);}return _0x44df63[_0x6ca5('0x22')]();};}function saveUpdates(_0x1f8119,_0x23c16b){return function(_0x324881){if(_0x324881){return _0x324881[_0x6ca5('0x23')](_0x1f8119)[_0x6ca5('0x24')](function(_0x3754f5){return _0x3754f5;});}return null;};}function removeEntity(_0x1a23f2,_0x18967e){return function(_0x4e2f36){if(_0x4e2f36){return _0x4e2f36[_0x6ca5('0x25')]()[_0x6ca5('0x24')](function(){_0x1a23f2[_0x6ca5('0x19')](0xcc)[_0x6ca5('0x26')]();});}};}function handleEntityNotFound(_0x553930,_0xc10fad){return function(_0x350a69){if(!_0x350a69){_0x553930[_0x6ca5('0x18')](0x194);}return _0x350a69;};}function handleError(_0x1bdcc2,_0x409d7b){_0x409d7b=_0x409d7b||0x1f4;return function(_0x26239c){logger[_0x6ca5('0x27')](_0x26239c['stack']);if(_0x26239c[_0x6ca5('0x28')]){delete _0x26239c[_0x6ca5('0x28')];}_0x1bdcc2[_0x6ca5('0x19')](_0x409d7b)[_0x6ca5('0x29')](_0x26239c);};}exports[_0x6ca5('0x2a')]=function(_0x1b1ee9,_0x51b148){var _0xa570e4={},_0x31ab9c={},_0x3f0756={'count':0x0,'rows':[]};var _0x1b6359=_[_0x6ca5('0x2b')](db[_0x6ca5('0x2c')][_0x6ca5('0x2d')],function(_0x451c2d){return{'name':_0x451c2d[_0x6ca5('0x2e')],'type':_0x451c2d[_0x6ca5('0x2f')][_0x6ca5('0x30')]};});_0x31ab9c[_0x6ca5('0x31')]=_[_0x6ca5('0x2b')](_0x1b6359,_0x6ca5('0x28'));_0x31ab9c[_0x6ca5('0x32')]=_[_0x6ca5('0x33')](_0x1b1ee9[_0x6ca5('0x32')]);_0x31ab9c[_0x6ca5('0x34')]=_[_0x6ca5('0x35')](_0x31ab9c[_0x6ca5('0x31')],_0x31ab9c['query']);_0xa570e4[_0x6ca5('0x36')]=_['intersection'](_0x31ab9c[_0x6ca5('0x31')],qs[_0x6ca5('0x37')](_0x1b1ee9[_0x6ca5('0x32')][_0x6ca5('0x37')]));_0xa570e4['attributes']=_0xa570e4[_0x6ca5('0x36')][_0x6ca5('0x38')]?_0xa570e4[_0x6ca5('0x36')]:_0x31ab9c[_0x6ca5('0x31')];if(!_0x1b1ee9[_0x6ca5('0x32')][_0x6ca5('0x39')](_0x6ca5('0x3a'))){_0xa570e4[_0x6ca5('0x1e')]=qs[_0x6ca5('0x1e')](_0x1b1ee9['query'][_0x6ca5('0x1e')]);_0xa570e4[_0x6ca5('0x1b')]=qs[_0x6ca5('0x1b')](_0x1b1ee9['query'][_0x6ca5('0x1b')]);}_0xa570e4[_0x6ca5('0x3b')]=qs[_0x6ca5('0x3c')](_0x1b1ee9[_0x6ca5('0x32')]['sort']);_0xa570e4[_0x6ca5('0x3d')]=qs[_0x6ca5('0x34')](_[_0x6ca5('0x3e')](_0x1b1ee9[_0x6ca5('0x32')],_0x31ab9c[_0x6ca5('0x34')]),_0x1b6359);if(_0x1b1ee9['query'][_0x6ca5('0x3f')]){_0xa570e4[_0x6ca5('0x3d')]=_[_0x6ca5('0x40')](_0xa570e4[_0x6ca5('0x3d')],{'$or':_['map'](_0x1b6359,function(_0x9261a8){if(_0x9261a8[_0x6ca5('0x2f')]!==_0x6ca5('0x41')){var _0x47ca92={};_0x47ca92[_0x9261a8[_0x6ca5('0x28')]]={'$like':'%'+_0x1b1ee9[_0x6ca5('0x32')][_0x6ca5('0x3f')]+'%'};return _0x47ca92;}})});}_0xa570e4=_[_0x6ca5('0x40')]({},_0xa570e4,_0x1b1ee9['options']);var _0x2b506a={'where':_0xa570e4[_0x6ca5('0x3d')]};return db['FaxQueueReport'][_0x6ca5('0x1d')](_0x2b506a)[_0x6ca5('0x24')](function(_0x14f069){_0x3f0756[_0x6ca5('0x1d')]=_0x14f069;if(_0x1b1ee9[_0x6ca5('0x32')][_0x6ca5('0x42')]){_0xa570e4[_0x6ca5('0x43')]=[{'all':!![]}];}return db[_0x6ca5('0x2c')][_0x6ca5('0x44')](_0xa570e4);})[_0x6ca5('0x24')](function(_0x116caf){_0x3f0756['rows']=_0x116caf;return _0x3f0756;})[_0x6ca5('0x24')](respondWithFilteredResult(_0x51b148,_0xa570e4))[_0x6ca5('0x45')](handleError(_0x51b148,null));};exports[_0x6ca5('0x46')]=function(_0xfce19e,_0x4fb2a8){var _0x3522e3={'raw':!![],'where':{'id':_0xfce19e['params']['id']}},_0x3616b3={};_0x3616b3[_0x6ca5('0x31')]=_[_0x6ca5('0x33')](db['FaxQueueReport'][_0x6ca5('0x2d')]);_0x3616b3['query']=_['keys'](_0xfce19e['query']);_0x3616b3[_0x6ca5('0x34')]=_[_0x6ca5('0x35')](_0x3616b3[_0x6ca5('0x31')],_0x3616b3[_0x6ca5('0x32')]);_0x3522e3[_0x6ca5('0x36')]=_[_0x6ca5('0x35')](_0x3616b3[_0x6ca5('0x31')],qs['fields'](_0xfce19e['query'][_0x6ca5('0x37')]));_0x3522e3[_0x6ca5('0x36')]=_0x3522e3[_0x6ca5('0x36')][_0x6ca5('0x38')]?_0x3522e3[_0x6ca5('0x36')]:_0x3616b3['model'];if(_0xfce19e[_0x6ca5('0x32')][_0x6ca5('0x42')]){_0x3522e3[_0x6ca5('0x43')]=[{'all':!![]}];}_0x3522e3=_[_0x6ca5('0x40')]({},_0x3522e3,_0xfce19e[_0x6ca5('0x47')]);return db['FaxQueueReport']['find'](_0x3522e3)[_0x6ca5('0x24')](handleEntityNotFound(_0x4fb2a8,null))['then'](respondWithResult(_0x4fb2a8,null))[_0x6ca5('0x45')](handleError(_0x4fb2a8,null));};exports[_0x6ca5('0x48')]=function(_0x4d5856,_0x9802c3){return db[_0x6ca5('0x2c')][_0x6ca5('0x48')](_0x4d5856[_0x6ca5('0x49')],{})['then'](respondWithResult(_0x9802c3,0xc9))[_0x6ca5('0x45')](handleError(_0x9802c3,null));};exports[_0x6ca5('0x23')]=function(_0x290c6c,_0x2aa3b1){if(_0x290c6c[_0x6ca5('0x49')]['id']){delete _0x290c6c[_0x6ca5('0x49')]['id'];}return db[_0x6ca5('0x2c')][_0x6ca5('0x4a')]({'where':{'id':_0x290c6c['params']['id']}})[_0x6ca5('0x24')](handleEntityNotFound(_0x2aa3b1,null))['then'](saveUpdates(_0x290c6c['body'],null))[_0x6ca5('0x24')](respondWithResult(_0x2aa3b1,null))[_0x6ca5('0x45')](handleError(_0x2aa3b1,null));};exports[_0x6ca5('0x25')]=function(_0x555a52,_0x42567c){return db[_0x6ca5('0x2c')][_0x6ca5('0x4a')]({'where':{'id':_0x555a52[_0x6ca5('0x4b')]['id']}})[_0x6ca5('0x24')](handleEntityNotFound(_0x42567c,null))[_0x6ca5('0x24')](removeEntity(_0x42567c,null))['catch'](handleError(_0x42567c,null));};exports[_0x6ca5('0x4c')]=function(_0x4d2c1c,_0x1e60a2){return db[_0x6ca5('0x2c')]['describe']()[_0x6ca5('0x24')](respondWithResult(_0x1e60a2,null))['catch'](handleError(_0x1e60a2,null));}; \ No newline at end of file +var _0x95c5=['stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','include','create','body','find','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','save','update','then','error'];(function(_0x56f935,_0xbb3e13){var _0x25ff2f=function(_0x3d0fad){while(--_0x3d0fad){_0x56f935['push'](_0x56f935['shift']());}};_0x25ff2f(++_0xbb3e13);}(_0x95c5,0x153));var _0x595c=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0x95c5[_0x316904];return _0xfa9a21;};'use strict';var emlformat=require(_0x595c('0x0'));var rimraf=require(_0x595c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x595c('0x2'));var rp=require(_0x595c('0x3'));var moment=require(_0x595c('0x4'));var BPromise=require(_0x595c('0x5'));var Mustache=require(_0x595c('0x6'));var util=require(_0x595c('0x7'));var path=require(_0x595c('0x8'));var sox=require(_0x595c('0x9'));var csv=require(_0x595c('0xa'));var ejs=require(_0x595c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x595c('0xc'));var crypto=require(_0x595c('0xd'));var jsforce=require(_0x595c('0xe'));var deskjs=require(_0x595c('0xf'));var toCsv=require(_0x595c('0xa'));var querystring=require(_0x595c('0x10'));var Papa=require(_0x595c('0x11'));var Redis=require(_0x595c('0x12'));var authService=require(_0x595c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x595c('0x14'));var hardwareService=require(_0x595c('0x15'));var logger=require(_0x595c('0x16'))('api');var utils=require(_0x595c('0x17'));var config=require(_0x595c('0x18'));var licenseUtil=require(_0x595c('0x19'));var db=require(_0x595c('0x1a'))['db'];function respondWithStatusCode(_0x913a30,_0x1bae2a){_0x1bae2a=_0x1bae2a||0xcc;return function(_0x3c73e8){if(_0x3c73e8){return _0x913a30[_0x595c('0x1b')](_0x1bae2a);}return _0x913a30[_0x595c('0x1c')](_0x1bae2a)[_0x595c('0x1d')]();};}function respondWithResult(_0x31c568,_0x7b2bcd){_0x7b2bcd=_0x7b2bcd||0xc8;return function(_0x35b622){if(_0x35b622){return _0x31c568[_0x595c('0x1c')](_0x7b2bcd)['json'](_0x35b622);}};}function respondWithFilteredResult(_0x17c053,_0x3243f9){return function(_0x3bf9be){if(_0x3bf9be){var _0x28c2ed=typeof _0x3243f9['offset']==='undefined'&&typeof _0x3243f9[_0x595c('0x1e')]==='undefined';var _0x505f0c=_0x3bf9be[_0x595c('0x1f')];var _0xe45721=_0x28c2ed?0x0:_0x3243f9[_0x595c('0x20')];var _0x4f9936=_0x28c2ed?_0x3bf9be[_0x595c('0x1f')]:_0x3243f9[_0x595c('0x20')]+_0x3243f9['limit'];var _0x2bb744;if(_0x4f9936>=_0x505f0c){_0x4f9936=_0x505f0c;_0x2bb744=0xc8;}else{_0x2bb744=0xce;}_0x17c053[_0x595c('0x1c')](_0x2bb744);return _0x17c053[_0x595c('0x21')](_0x595c('0x22'),_0xe45721+'-'+_0x4f9936+'/'+_0x505f0c)[_0x595c('0x23')](_0x3bf9be);}return null;};}function patchUpdates(_0x3195b8){return function(_0x2d59d4){try{jsonpatch[_0x595c('0x24')](_0x2d59d4,_0x3195b8,!![]);}catch(_0x83573f){return BPromise['reject'](_0x83573f);}return _0x2d59d4[_0x595c('0x25')]();};}function saveUpdates(_0x589c35,_0x378eaf){return function(_0x4b0cb1){if(_0x4b0cb1){return _0x4b0cb1[_0x595c('0x26')](_0x589c35)[_0x595c('0x27')](function(_0x3d7668){return _0x3d7668;});}return null;};}function removeEntity(_0x3d64a8,_0x3f58c4){return function(_0x1eb0ff){if(_0x1eb0ff){return _0x1eb0ff['destroy']()[_0x595c('0x27')](function(){_0x3d64a8['status'](0xcc)[_0x595c('0x1d')]();});}};}function handleEntityNotFound(_0x4970a1,_0x3df8ed){return function(_0x1c3d72){if(!_0x1c3d72){_0x4970a1['sendStatus'](0x194);}return _0x1c3d72;};}function handleError(_0x195df7,_0x99622){_0x99622=_0x99622||0x1f4;return function(_0x1998da){logger[_0x595c('0x28')](_0x1998da[_0x595c('0x29')]);if(_0x1998da[_0x595c('0x2a')]){delete _0x1998da[_0x595c('0x2a')];}_0x195df7['status'](_0x99622)[_0x595c('0x2b')](_0x1998da);};}exports['index']=function(_0x306b16,_0x4afafb){var _0x19001a={},_0x4a6278={},_0x5b7d81={'count':0x0,'rows':[]};var _0x1b8414=_[_0x595c('0x2c')](db[_0x595c('0x2d')][_0x595c('0x2e')],function(_0x5e51c1){return{'name':_0x5e51c1[_0x595c('0x2f')],'type':_0x5e51c1[_0x595c('0x30')][_0x595c('0x31')]};});_0x4a6278[_0x595c('0x32')]=_[_0x595c('0x2c')](_0x1b8414,'name');_0x4a6278['query']=_[_0x595c('0x33')](_0x306b16[_0x595c('0x34')]);_0x4a6278[_0x595c('0x35')]=_['intersection'](_0x4a6278[_0x595c('0x32')],_0x4a6278[_0x595c('0x34')]);_0x19001a['attributes']=_[_0x595c('0x36')](_0x4a6278[_0x595c('0x32')],qs[_0x595c('0x37')](_0x306b16[_0x595c('0x34')]['fields']));_0x19001a[_0x595c('0x38')]=_0x19001a['attributes'][_0x595c('0x39')]?_0x19001a['attributes']:_0x4a6278[_0x595c('0x32')];if(!_0x306b16[_0x595c('0x34')]['hasOwnProperty']('nolimit')){_0x19001a[_0x595c('0x1e')]=qs[_0x595c('0x1e')](_0x306b16[_0x595c('0x34')][_0x595c('0x1e')]);_0x19001a[_0x595c('0x20')]=qs[_0x595c('0x20')](_0x306b16['query'][_0x595c('0x20')]);}_0x19001a[_0x595c('0x3a')]=qs['sort'](_0x306b16['query'][_0x595c('0x3b')]);_0x19001a[_0x595c('0x3c')]=qs[_0x595c('0x35')](_[_0x595c('0x3d')](_0x306b16[_0x595c('0x34')],_0x4a6278['filters']),_0x1b8414);if(_0x306b16[_0x595c('0x34')][_0x595c('0x3e')]){_0x19001a['where']=_[_0x595c('0x3f')](_0x19001a['where'],{'$or':_[_0x595c('0x2c')](_0x1b8414,function(_0x2b841b){if(_0x2b841b['type']!==_0x595c('0x40')){var _0x9eb193={};_0x9eb193[_0x2b841b[_0x595c('0x2a')]]={'$like':'%'+_0x306b16['query'][_0x595c('0x3e')]+'%'};return _0x9eb193;}})});}_0x19001a=_['merge']({},_0x19001a,_0x306b16[_0x595c('0x41')]);var _0x23b636={'where':_0x19001a[_0x595c('0x3c')]};return db[_0x595c('0x2d')][_0x595c('0x1f')](_0x23b636)[_0x595c('0x27')](function(_0x46f1e0){_0x5b7d81['count']=_0x46f1e0;if(_0x306b16[_0x595c('0x34')]['includeAll']){_0x19001a['include']=[{'all':!![]}];}return db[_0x595c('0x2d')][_0x595c('0x42')](_0x19001a);})[_0x595c('0x27')](function(_0xcf14e7){_0x5b7d81['rows']=_0xcf14e7;return _0x5b7d81;})[_0x595c('0x27')](respondWithFilteredResult(_0x4afafb,_0x19001a))[_0x595c('0x43')](handleError(_0x4afafb,null));};exports[_0x595c('0x44')]=function(_0x21fbf5,_0x28cd01){var _0x528780={'raw':!![],'where':{'id':_0x21fbf5['params']['id']}},_0x5359e6={};_0x5359e6[_0x595c('0x32')]=_['keys'](db[_0x595c('0x2d')][_0x595c('0x2e')]);_0x5359e6[_0x595c('0x34')]=_[_0x595c('0x33')](_0x21fbf5[_0x595c('0x34')]);_0x5359e6['filters']=_['intersection'](_0x5359e6['model'],_0x5359e6[_0x595c('0x34')]);_0x528780[_0x595c('0x38')]=_[_0x595c('0x36')](_0x5359e6['model'],qs[_0x595c('0x37')](_0x21fbf5['query']['fields']));_0x528780[_0x595c('0x38')]=_0x528780['attributes'][_0x595c('0x39')]?_0x528780[_0x595c('0x38')]:_0x5359e6['model'];if(_0x21fbf5[_0x595c('0x34')]['includeAll']){_0x528780[_0x595c('0x45')]=[{'all':!![]}];}_0x528780=_['merge']({},_0x528780,_0x21fbf5[_0x595c('0x41')]);return db[_0x595c('0x2d')]['find'](_0x528780)[_0x595c('0x27')](handleEntityNotFound(_0x28cd01,null))[_0x595c('0x27')](respondWithResult(_0x28cd01,null))['catch'](handleError(_0x28cd01,null));};exports[_0x595c('0x46')]=function(_0x1aaa69,_0x126b9e){return db[_0x595c('0x2d')]['create'](_0x1aaa69[_0x595c('0x47')],{})[_0x595c('0x27')](respondWithResult(_0x126b9e,0xc9))[_0x595c('0x43')](handleError(_0x126b9e,null));};exports[_0x595c('0x26')]=function(_0x23cdfe,_0x18aa82){if(_0x23cdfe[_0x595c('0x47')]['id']){delete _0x23cdfe[_0x595c('0x47')]['id'];}return db[_0x595c('0x2d')][_0x595c('0x48')]({'where':{'id':_0x23cdfe[_0x595c('0x49')]['id']}})[_0x595c('0x27')](handleEntityNotFound(_0x18aa82,null))[_0x595c('0x27')](saveUpdates(_0x23cdfe[_0x595c('0x47')],null))[_0x595c('0x27')](respondWithResult(_0x18aa82,null))[_0x595c('0x43')](handleError(_0x18aa82,null));};exports[_0x595c('0x4a')]=function(_0x379d16,_0x1e42a4){return db[_0x595c('0x2d')][_0x595c('0x48')]({'where':{'id':_0x379d16['params']['id']}})[_0x595c('0x27')](handleEntityNotFound(_0x1e42a4,null))[_0x595c('0x27')](removeEntity(_0x1e42a4,null))[_0x595c('0x43')](handleError(_0x1e42a4,null));};exports[_0x595c('0x4b')]=function(_0x1796d1,_0x74dea8){return db[_0x595c('0x2d')][_0x595c('0x4b')]()[_0x595c('0x27')](respondWithResult(_0x74dea8,null))[_0x595c('0x43')](handleError(_0x74dea8,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c253aa4..11ff446 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(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x1cb9,0x14e));var _0x91cb=function(_0x231fc1,_0x44bad4){_0x231fc1=_0x231fc1-0x0;var _0x57a520=_0x1cb9[_0x231fc1];return _0x57a520;};'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 _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x493e31,_0x33cc81){var _0x103b84=function(_0x8de80e){while(--_0x8de80e){_0x493e31['push'](_0x493e31['shift']());}};_0x103b84(++_0x33cc81);}(_0xf494,0x1c6));var _0x4f49=function(_0x54dc7b,_0x592c0f){_0x54dc7b=_0x54dc7b-0x0;var _0x4711ee=_0xf494[_0x54dc7b];return _0x4711ee;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('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 8b4b944..9620973 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 _0xe57e=['code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','UpdateFaxQueueReport','where','attributes','limit','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xe57e,0x12f));var _0xee57=function(_0x29b672,_0x27967b){_0x29b672=_0x29b672-0x0;var _0x50c112=_0xe57e[_0x29b672];return _0x50c112;};'use strict';var _=require('lodash');var util=require(_0xee57('0x0'));var moment=require(_0xee57('0x1'));var BPromise=require(_0xee57('0x2'));var rs=require(_0xee57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee57('0x4'))['db'];var utils=require(_0xee57('0x5'));var logger=require(_0xee57('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xee57('0x7'));var client=jayson[_0xee57('0x8')][_0xee57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33452b,_0x3d2c48,_0x3db846){return new BPromise(function(_0x3b581b,_0x2b5f26){return client[_0xee57('0xa')](_0x33452b,_0x3db846)['then'](function(_0x2d91d8){logger[_0xee57('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x3d2c48,'request\x20sent');logger[_0xee57('0xc')](_0xee57('0xd'),_0x3d2c48,_0xee57('0xe'),JSON[_0xee57('0xf')](_0x2d91d8));if(_0x2d91d8['error']){if(_0x2d91d8[_0xee57('0x10')][_0xee57('0x11')]===0x1f4){logger[_0xee57('0x10')](_0xee57('0x12'),_0x3d2c48,_0x2d91d8[_0xee57('0x10')][_0xee57('0x13')]);return _0x2b5f26(_0x2d91d8[_0xee57('0x10')]['message']);}logger[_0xee57('0x10')](_0xee57('0x12'),_0x3d2c48,_0x2d91d8[_0xee57('0x10')][_0xee57('0x13')]);return _0x3b581b(_0x2d91d8[_0xee57('0x10')]['message']);}else{logger[_0xee57('0xb')](_0xee57('0x12'),_0x3d2c48,_0xee57('0xe'));_0x3b581b(_0x2d91d8[_0xee57('0x14')][_0xee57('0x13')]);}})[_0xee57('0x15')](function(_0x48c5a5){logger[_0xee57('0x10')](_0xee57('0x12'),_0x3d2c48,_0x48c5a5);_0x2b5f26(_0x48c5a5);});});}exports[_0xee57('0x16')]=function(_0x21ac09){var _0x5aae39=this;return new Promise(function(_0x5dc708,_0x33100b){return db[_0xee57('0x17')][_0xee57('0x18')](_0x21ac09[_0xee57('0x19')],{'raw':_0x21ac09[_0xee57('0x1a')]?_0x21ac09['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x21d74d){logger[_0xee57('0xb')](_0xee57('0x16'),_0x21ac09);logger[_0xee57('0xc')](_0xee57('0x16'),_0x21ac09,JSON[_0xee57('0xf')](_0x21d74d));_0x5dc708(_0x21d74d);})['catch'](function(_0x1d5f87){logger[_0xee57('0x10')]('CreateFaxQueueReport',_0x1d5f87[_0xee57('0x13')],_0x21ac09);_0x33100b(_0x5aae39['error'](0x1f4,_0x1d5f87[_0xee57('0x13')]));});});};exports[_0xee57('0x1b')]=function(_0x1939dc){var _0x3bb14e=this;return new Promise(function(_0x45ce51,_0x379e13){return db['FaxQueueReport']['update'](_0x1939dc[_0xee57('0x19')],{'raw':_0x1939dc['options']?_0x1939dc[_0xee57('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1939dc[_0xee57('0x1a')]?_0x1939dc[_0xee57('0x1a')][_0xee57('0x1c')]||null:null,'attributes':_0x1939dc[_0xee57('0x1a')]?_0x1939dc['options'][_0xee57('0x1d')]||null:null,'limit':_0x1939dc[_0xee57('0x1a')]?_0x1939dc[_0xee57('0x1a')][_0xee57('0x1e')]||null:null})[_0xee57('0x1f')](function(_0x4c800e){logger['info'](_0xee57('0x1b'),_0x1939dc);logger[_0xee57('0xc')](_0xee57('0x1b'),_0x1939dc,JSON['stringify'](_0x4c800e));_0x45ce51(_0x4c800e);})['catch'](function(_0x21b939){logger[_0xee57('0x10')]('UpdateFaxQueueReport',_0x21b939['message'],_0x1939dc);_0x379e13(_0x3bb14e['error'](0x1f4,_0x21b939[_0xee57('0x13')]));});});}; \ No newline at end of file +var _0xcdee=['catch','CreateFaxQueueReport','create','body','options','FaxQueueReport','update','raw','where','limit','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x25923f,_0x5415b8){var _0x207b18=function(_0x29af9a){while(--_0x29af9a){_0x25923f['push'](_0x25923f['shift']());}};_0x207b18(++_0x5415b8);}(_0xcdee,0x176));var _0xecde=function(_0x356f98,_0x552c1c){_0x356f98=_0x356f98-0x0;var _0x3c40f0=_0xcdee[_0x356f98];return _0x3c40f0;};'use strict';var _=require(_0xecde('0x0'));var util=require(_0xecde('0x1'));var moment=require('moment');var BPromise=require(_0xecde('0x2'));var rs=require(_0xecde('0x3'));var fs=require('fs');var Redis=require(_0xecde('0x4'));var db=require(_0xecde('0x5'))['db'];var utils=require(_0xecde('0x6'));var logger=require(_0xecde('0x7'))(_0xecde('0x8'));var config=require(_0xecde('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xecde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x409ea9,_0x420d54,_0x1288b5){return new BPromise(function(_0x11e586,_0x38616){return client[_0xecde('0xb')](_0x409ea9,_0x1288b5)[_0xecde('0xc')](function(_0x53c282){logger['info'](_0xecde('0xd'),_0x420d54,_0xecde('0xe'));logger[_0xecde('0xf')](_0xecde('0x10'),_0x420d54,_0xecde('0xe'),JSON[_0xecde('0x11')](_0x53c282));if(_0x53c282[_0xecde('0x12')]){if(_0x53c282[_0xecde('0x12')]['code']===0x1f4){logger[_0xecde('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x420d54,_0x53c282[_0xecde('0x12')][_0xecde('0x13')]);return _0x38616(_0x53c282['error'][_0xecde('0x13')]);}logger[_0xecde('0x12')](_0xecde('0xd'),_0x420d54,_0x53c282['error'][_0xecde('0x13')]);return _0x11e586(_0x53c282['error'][_0xecde('0x13')]);}else{logger[_0xecde('0x14')](_0xecde('0xd'),_0x420d54,_0xecde('0xe'));_0x11e586(_0x53c282[_0xecde('0x15')][_0xecde('0x13')]);}})[_0xecde('0x16')](function(_0x43525e){logger[_0xecde('0x12')](_0xecde('0xd'),_0x420d54,_0x43525e);_0x38616(_0x43525e);});});}exports[_0xecde('0x17')]=function(_0x4f029d){var _0xf5fb0f=this;return new Promise(function(_0x52209c,_0x221acc){return db['FaxQueueReport'][_0xecde('0x18')](_0x4f029d[_0xecde('0x19')],{'raw':_0x4f029d[_0xecde('0x1a')]?_0x4f029d['options']['raw']===undefined?!![]:![]:!![]})[_0xecde('0xc')](function(_0xd4cc5e){logger[_0xecde('0x14')]('CreateFaxQueueReport',_0x4f029d);logger[_0xecde('0xf')](_0xecde('0x17'),_0x4f029d,JSON['stringify'](_0xd4cc5e));_0x52209c(_0xd4cc5e);})[_0xecde('0x16')](function(_0x3defdd){logger[_0xecde('0x12')](_0xecde('0x17'),_0x3defdd['message'],_0x4f029d);_0x221acc(_0xf5fb0f[_0xecde('0x12')](0x1f4,_0x3defdd['message']));});});};exports['UpdateFaxQueueReport']=function(_0x50cabf){var _0x184120=this;return new Promise(function(_0x38591c,_0x2d22e2){return db[_0xecde('0x1b')][_0xecde('0x1c')](_0x50cabf[_0xecde('0x19')],{'raw':_0x50cabf['options']?_0x50cabf[_0xecde('0x1a')][_0xecde('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50cabf[_0xecde('0x1a')]?_0x50cabf[_0xecde('0x1a')][_0xecde('0x1e')]||null:null,'attributes':_0x50cabf[_0xecde('0x1a')]?_0x50cabf[_0xecde('0x1a')]['attributes']||null:null,'limit':_0x50cabf[_0xecde('0x1a')]?_0x50cabf[_0xecde('0x1a')][_0xecde('0x1f')]||null:null})[_0xecde('0xc')](function(_0x261077){logger[_0xecde('0x14')](_0xecde('0x20'),_0x50cabf);logger['debug'](_0xecde('0x20'),_0x50cabf,JSON[_0xecde('0x11')](_0x261077));_0x38591c(_0x261077);})[_0xecde('0x16')](function(_0x32fc79){logger[_0xecde('0x12')](_0xecde('0x20'),_0x32fc79[_0xecde('0x13')],_0x50cabf);_0x2d22e2(_0x184120['error'](0x1f4,_0x32fc79['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index b1cfbdd..1259274 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 _0xf64a=['index','describe','/:id','show','post','create','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../config/environment','./faxQueueReport.controller','get','isAuthenticated'];(function(_0x19b84d,_0x4f1e23){var _0x429f31=function(_0x507f10){while(--_0x507f10){_0x19b84d['push'](_0x19b84d['shift']());}};_0x429f31(++_0x4f1e23);}(_0xf64a,0x15c));var _0xaf64=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0xf64a[_0x4179e2];return _0x24cb50;};'use strict';var multer=require(_0xaf64('0x0'));var util=require(_0xaf64('0x1'));var path=require('path');var timeout=require(_0xaf64('0x2'));var express=require(_0xaf64('0x3'));var router=express['Router']();var fs_extra=require(_0xaf64('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf64('0x5'));var controller=require(_0xaf64('0x6'));router[_0xaf64('0x7')]('/',auth[_0xaf64('0x8')](),controller[_0xaf64('0x9')]);router[_0xaf64('0x7')]('/describe',auth[_0xaf64('0x8')](),controller[_0xaf64('0xa')]);router[_0xaf64('0x7')](_0xaf64('0xb'),auth[_0xaf64('0x8')](),controller[_0xaf64('0xc')]);router[_0xaf64('0xd')]('/',auth[_0xaf64('0x8')](),controller[_0xaf64('0xe')]);router['put'](_0xaf64('0xb'),auth[_0xaf64('0x8')](),controller['update']);router[_0xaf64('0xf')](_0xaf64('0xb'),auth[_0xaf64('0x8')](),controller[_0xaf64('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe57c=['isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe57c,0x83));var _0xce57=function(_0x105073,_0x2cb6d1){_0x105073=_0x105073-0x0;var _0x4feeed=_0xe57c[_0x105073];return _0x4feeed;};'use strict';var multer=require(_0xce57('0x0'));var util=require(_0xce57('0x1'));var path=require('path');var timeout=require(_0xce57('0x2'));var express=require(_0xce57('0x3'));var router=express[_0xce57('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xce57('0x5'));var interaction=require(_0xce57('0x6'));var config=require('../../config/environment');var controller=require(_0xce57('0x7'));router[_0xce57('0x8')]('/',auth[_0xce57('0x9')](),controller[_0xce57('0xa')]);router[_0xce57('0x8')]('/describe',auth[_0xce57('0x9')](),controller[_0xce57('0xb')]);router[_0xce57('0x8')](_0xce57('0xc'),auth[_0xce57('0x9')](),controller[_0xce57('0xd')]);router['post']('/',auth[_0xce57('0x9')](),controller[_0xce57('0xe')]);router[_0xce57('0xf')](_0xce57('0xc'),auth['isAuthenticated'](),controller[_0xce57('0x10')]);router[_0xce57('0x11')](_0xce57('0xc'),auth[_0xce57('0x9')](),controller[_0xce57('0x12')]);module[_0xce57('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index e8d9ac1..6d9b346 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x4d0c64,_0x2d729f){var _0x132d6f=function(_0x1a3380){while(--_0x1a3380){_0x4d0c64['push'](_0x4d0c64['shift']());}};_0x132d6f(++_0x2d729f);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0x4b84[_0x5c6994];return _0x1d5c84;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x22a1e0,_0x279d8b){var _0x5d0dc7=function(_0x421aff){while(--_0x421aff){_0x22a1e0['push'](_0x22a1e0['shift']());}};_0x5d0dc7(++_0x279d8b);}(_0x34e8,0x12c));var _0x834e=function(_0x1f7ab8,_0x4ff838){_0x1f7ab8=_0x1f7ab8-0x0;var _0x223af8=_0x34e8[_0x1f7ab8];return _0x223af8;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f36b866..65685b2 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 _0x208f=['../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api'];(function(_0x4e005f,_0x3cf4ac){var _0x439682=function(_0x11f8df){while(--_0x11f8df){_0x4e005f['push'](_0x4e005f['shift']());}};_0x439682(++_0x3cf4ac);}(_0x208f,0x1ad));var _0xf208=function(_0x1ac728,_0x4aff0d){_0x1ac728=_0x1ac728-0x0;var _0x503bd7=_0x208f[_0x1ac728];return _0x503bd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf208('0x0'));var zipdir=require(_0xf208('0x1'));var jsonpatch=require(_0xf208('0x2'));var rp=require(_0xf208('0x3'));var moment=require('moment');var BPromise=require(_0xf208('0x4'));var Mustache=require(_0xf208('0x5'));var util=require(_0xf208('0x6'));var path=require(_0xf208('0x7'));var sox=require('sox');var csv=require(_0xf208('0x8'));var ejs=require(_0xf208('0x9'));var fs=require('fs');var fs_extra=require(_0xf208('0xa'));var _=require(_0xf208('0xb'));var squel=require('squel');var crypto=require(_0xf208('0xc'));var jsforce=require(_0xf208('0xd'));var deskjs=require(_0xf208('0xe'));var toCsv=require(_0xf208('0x8'));var querystring=require(_0xf208('0xf'));var Papa=require('papaparse');var Redis=require(_0xf208('0x10'));var authService=require(_0xf208('0x11'));var qs=require(_0xf208('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf208('0x13'))(_0xf208('0x14'));var utils=require(_0xf208('0x15'));var config=require(_0xf208('0x16'));var licenseUtil=require(_0xf208('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c86fe,_0x3eeb2e){_0x3eeb2e=_0x3eeb2e||0xcc;return function(_0x2da0a5){if(_0x2da0a5){return _0x3c86fe['sendStatus'](_0x3eeb2e);}return _0x3c86fe['status'](_0x3eeb2e)['end']();};}function respondWithResult(_0x5afc55,_0x55bfd0){_0x55bfd0=_0x55bfd0||0xc8;return function(_0x498e83){if(_0x498e83){return _0x5afc55[_0xf208('0x18')](_0x55bfd0)[_0xf208('0x19')](_0x498e83);}};}function respondWithFilteredResult(_0x4d8cf1,_0x43ee49){return function(_0x198732){if(_0x198732){var _0x15200b=typeof _0x43ee49[_0xf208('0x1a')]===_0xf208('0x1b')&&typeof _0x43ee49['limit']===_0xf208('0x1b');var _0x3bf54e=_0x198732[_0xf208('0x1c')];var _0x2df2b8=_0x15200b?0x0:_0x43ee49['offset'];var _0x4a2e87=_0x15200b?_0x198732[_0xf208('0x1c')]:_0x43ee49[_0xf208('0x1a')]+_0x43ee49[_0xf208('0x1d')];var _0x34c02c;if(_0x4a2e87>=_0x3bf54e){_0x4a2e87=_0x3bf54e;_0x34c02c=0xc8;}else{_0x34c02c=0xce;}_0x4d8cf1['status'](_0x34c02c);return _0x4d8cf1[_0xf208('0x1e')](_0xf208('0x1f'),_0x2df2b8+'-'+_0x4a2e87+'/'+_0x3bf54e)['json'](_0x198732);}return null;};}function patchUpdates(_0x28fe76){return function(_0x2ecab1){try{jsonpatch[_0xf208('0x20')](_0x2ecab1,_0x28fe76,!![]);}catch(_0x1e1e0a){return BPromise['reject'](_0x1e1e0a);}return _0x2ecab1[_0xf208('0x21')]();};}function saveUpdates(_0x36e9a1,_0x57c0b0){return function(_0x55c92a){if(_0x55c92a){return _0x55c92a[_0xf208('0x22')](_0x36e9a1)[_0xf208('0x23')](function(_0x429a93){return _0x429a93;});}return null;};}function removeEntity(_0x4dc40d,_0x1a9554){return function(_0x13dc6d){if(_0x13dc6d){return _0x13dc6d[_0xf208('0x24')]()[_0xf208('0x23')](function(){_0x4dc40d['status'](0xcc)[_0xf208('0x25')]();});}};}function handleEntityNotFound(_0x1d98a6,_0x190040){return function(_0x11f980){if(!_0x11f980){_0x1d98a6[_0xf208('0x26')](0x194);}return _0x11f980;};}function handleError(_0x1bab40,_0x420bdd){_0x420bdd=_0x420bdd||0x1f4;return function(_0x3136b3){logger[_0xf208('0x27')](_0x3136b3[_0xf208('0x28')]);if(_0x3136b3['name']){delete _0x3136b3[_0xf208('0x29')];}_0x1bab40['status'](_0x420bdd)[_0xf208('0x2a')](_0x3136b3);};}exports[_0xf208('0x2b')]=function(_0x810643,_0x30db8b){var _0x45a134={},_0x1132b2={},_0x168bd5={'count':0x0,'rows':[]};var _0x2210da=_[_0xf208('0x2c')](db['FaxTransferReport'][_0xf208('0x2d')],function(_0x556c0a){return{'name':_0x556c0a['fieldName'],'type':_0x556c0a[_0xf208('0x2e')]['key']};});_0x1132b2[_0xf208('0x2f')]=_['map'](_0x2210da,_0xf208('0x29'));_0x1132b2[_0xf208('0x30')]=_[_0xf208('0x31')](_0x810643['query']);_0x1132b2[_0xf208('0x32')]=_[_0xf208('0x33')](_0x1132b2['model'],_0x1132b2[_0xf208('0x30')]);_0x45a134[_0xf208('0x34')]=_[_0xf208('0x33')](_0x1132b2[_0xf208('0x2f')],qs['fields'](_0x810643[_0xf208('0x30')][_0xf208('0x35')]));_0x45a134[_0xf208('0x34')]=_0x45a134[_0xf208('0x34')][_0xf208('0x36')]?_0x45a134[_0xf208('0x34')]:_0x1132b2[_0xf208('0x2f')];if(!_0x810643[_0xf208('0x30')]['hasOwnProperty'](_0xf208('0x37'))){_0x45a134[_0xf208('0x1d')]=qs[_0xf208('0x1d')](_0x810643['query'][_0xf208('0x1d')]);_0x45a134[_0xf208('0x1a')]=qs[_0xf208('0x1a')](_0x810643[_0xf208('0x30')][_0xf208('0x1a')]);}_0x45a134[_0xf208('0x38')]=qs[_0xf208('0x39')](_0x810643['query'][_0xf208('0x39')]);_0x45a134['where']=qs[_0xf208('0x32')](_['pick'](_0x810643[_0xf208('0x30')],_0x1132b2['filters']),_0x2210da);if(_0x810643[_0xf208('0x30')][_0xf208('0x3a')]){_0x45a134[_0xf208('0x3b')]=_[_0xf208('0x3c')](_0x45a134[_0xf208('0x3b')],{'$or':_[_0xf208('0x2c')](_0x2210da,function(_0x3df8b6){if(_0x3df8b6[_0xf208('0x2e')]!==_0xf208('0x3d')){var _0x13beab={};_0x13beab[_0x3df8b6[_0xf208('0x29')]]={'$like':'%'+_0x810643[_0xf208('0x30')][_0xf208('0x3a')]+'%'};return _0x13beab;}})});}_0x45a134=_[_0xf208('0x3c')]({},_0x45a134,_0x810643[_0xf208('0x3e')]);var _0x17831e={'where':_0x45a134[_0xf208('0x3b')]};return db[_0xf208('0x3f')][_0xf208('0x1c')](_0x17831e)[_0xf208('0x23')](function(_0x3db8a5){_0x168bd5[_0xf208('0x1c')]=_0x3db8a5;if(_0x810643[_0xf208('0x30')][_0xf208('0x40')]){_0x45a134[_0xf208('0x41')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xf208('0x42')](_0x45a134);})[_0xf208('0x23')](function(_0x49f3c9){_0x168bd5[_0xf208('0x43')]=_0x49f3c9;return _0x168bd5;})[_0xf208('0x23')](respondWithFilteredResult(_0x30db8b,_0x45a134))[_0xf208('0x44')](handleError(_0x30db8b,null));};exports[_0xf208('0x45')]=function(_0x42edb5,_0x437b5f){var _0x335724={'raw':!![],'where':{'id':_0x42edb5[_0xf208('0x46')]['id']}},_0x4df1d4={};_0x4df1d4[_0xf208('0x2f')]=_[_0xf208('0x31')](db[_0xf208('0x3f')][_0xf208('0x2d')]);_0x4df1d4[_0xf208('0x30')]=_[_0xf208('0x31')](_0x42edb5['query']);_0x4df1d4['filters']=_[_0xf208('0x33')](_0x4df1d4[_0xf208('0x2f')],_0x4df1d4['query']);_0x335724[_0xf208('0x34')]=_[_0xf208('0x33')](_0x4df1d4[_0xf208('0x2f')],qs[_0xf208('0x35')](_0x42edb5[_0xf208('0x30')]['fields']));_0x335724[_0xf208('0x34')]=_0x335724['attributes']['length']?_0x335724[_0xf208('0x34')]:_0x4df1d4[_0xf208('0x2f')];if(_0x42edb5[_0xf208('0x30')][_0xf208('0x40')]){_0x335724['include']=[{'all':!![]}];}_0x335724=_[_0xf208('0x3c')]({},_0x335724,_0x42edb5[_0xf208('0x3e')]);return db[_0xf208('0x3f')][_0xf208('0x47')](_0x335724)['then'](handleEntityNotFound(_0x437b5f,null))['then'](respondWithResult(_0x437b5f,null))[_0xf208('0x44')](handleError(_0x437b5f,null));};exports[_0xf208('0x48')]=function(_0x156b95,_0x3c3a23){return db[_0xf208('0x3f')][_0xf208('0x48')](_0x156b95[_0xf208('0x49')],{})[_0xf208('0x23')](respondWithResult(_0x3c3a23,0xc9))[_0xf208('0x44')](handleError(_0x3c3a23,null));};exports['update']=function(_0x5ea8aa,_0x3b8bc3){if(_0x5ea8aa[_0xf208('0x49')]['id']){delete _0x5ea8aa[_0xf208('0x49')]['id'];}return db[_0xf208('0x3f')][_0xf208('0x47')]({'where':{'id':_0x5ea8aa['params']['id']}})[_0xf208('0x23')](handleEntityNotFound(_0x3b8bc3,null))[_0xf208('0x23')](saveUpdates(_0x5ea8aa[_0xf208('0x49')],null))[_0xf208('0x23')](respondWithResult(_0x3b8bc3,null))['catch'](handleError(_0x3b8bc3,null));};exports[_0xf208('0x24')]=function(_0x3e103d,_0x45528f){return db[_0xf208('0x3f')]['find']({'where':{'id':_0x3e103d['params']['id']}})[_0xf208('0x23')](handleEntityNotFound(_0x45528f,null))[_0xf208('0x23')](removeEntity(_0x45528f,null))[_0xf208('0x44')](handleError(_0x45528f,null));};exports[_0xf208('0x4a')]=function(_0x5a2362,_0x4d8caf){return db[_0xf208('0x3f')][_0xf208('0x4a')]()[_0xf208('0x23')](respondWithResult(_0x4d8caf,null))['catch'](handleError(_0x4d8caf,null));}; \ No newline at end of file +var _0xcac8=['offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','name','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x4a498f,_0x33fa4c){var _0x3fde32=function(_0x534eec){while(--_0x534eec){_0x4a498f['push'](_0x4a498f['shift']());}};_0x3fde32(++_0x33fa4c);}(_0xcac8,0x10c));var _0x8cac=function(_0x4183ed,_0x4725b3){_0x4183ed=_0x4183ed-0x0;var _0x388a2b=_0xcac8[_0x4183ed];return _0x388a2b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8cac('0x0'));var jsonpatch=require(_0x8cac('0x1'));var rp=require('request-promise');var moment=require(_0x8cac('0x2'));var BPromise=require(_0x8cac('0x3'));var Mustache=require(_0x8cac('0x4'));var util=require('util');var path=require(_0x8cac('0x5'));var sox=require(_0x8cac('0x6'));var csv=require(_0x8cac('0x7'));var ejs=require(_0x8cac('0x8'));var fs=require('fs');var fs_extra=require(_0x8cac('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8cac('0xa'));var jsforce=require(_0x8cac('0xb'));var deskjs=require(_0x8cac('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8cac('0xd'));var Papa=require('papaparse');var Redis=require(_0x8cac('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8cac('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8cac('0x10'));var logger=require('../../config/logger')(_0x8cac('0x11'));var utils=require('../../config/utils');var config=require(_0x8cac('0x12'));var licenseUtil=require(_0x8cac('0x13'));var db=require(_0x8cac('0x14'))['db'];function respondWithStatusCode(_0x2418bb,_0x54777d){_0x54777d=_0x54777d||0xcc;return function(_0x3e1de3){if(_0x3e1de3){return _0x2418bb[_0x8cac('0x15')](_0x54777d);}return _0x2418bb['status'](_0x54777d)[_0x8cac('0x16')]();};}function respondWithResult(_0x5be9be,_0x52f872){_0x52f872=_0x52f872||0xc8;return function(_0xab49ab){if(_0xab49ab){return _0x5be9be[_0x8cac('0x17')](_0x52f872)['json'](_0xab49ab);}};}function respondWithFilteredResult(_0x2fe8fd,_0x670d18){return function(_0x5c5c59){if(_0x5c5c59){var _0x9c0732=typeof _0x670d18[_0x8cac('0x18')]===_0x8cac('0x19')&&typeof _0x670d18[_0x8cac('0x1a')]===_0x8cac('0x19');var _0xec6d75=_0x5c5c59[_0x8cac('0x1b')];var _0x3a7328=_0x9c0732?0x0:_0x670d18['offset'];var _0x184feb=_0x9c0732?_0x5c5c59[_0x8cac('0x1b')]:_0x670d18[_0x8cac('0x18')]+_0x670d18[_0x8cac('0x1a')];var _0x2e3797;if(_0x184feb>=_0xec6d75){_0x184feb=_0xec6d75;_0x2e3797=0xc8;}else{_0x2e3797=0xce;}_0x2fe8fd['status'](_0x2e3797);return _0x2fe8fd['set'](_0x8cac('0x1c'),_0x3a7328+'-'+_0x184feb+'/'+_0xec6d75)[_0x8cac('0x1d')](_0x5c5c59);}return null;};}function patchUpdates(_0x38af6b){return function(_0xca4b23){try{jsonpatch['apply'](_0xca4b23,_0x38af6b,!![]);}catch(_0x181edf){return BPromise[_0x8cac('0x1e')](_0x181edf);}return _0xca4b23[_0x8cac('0x1f')]();};}function saveUpdates(_0x1cf6c6,_0x2153cb){return function(_0x43bfc3){if(_0x43bfc3){return _0x43bfc3[_0x8cac('0x20')](_0x1cf6c6)[_0x8cac('0x21')](function(_0x1f452b){return _0x1f452b;});}return null;};}function removeEntity(_0x33ee01,_0x337fd6){return function(_0x4ad011){if(_0x4ad011){return _0x4ad011[_0x8cac('0x22')]()['then'](function(){_0x33ee01[_0x8cac('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5036e8,_0x3d3f8a){return function(_0x95d4c7){if(!_0x95d4c7){_0x5036e8[_0x8cac('0x15')](0x194);}return _0x95d4c7;};}function handleError(_0x58ecd2,_0x3d2726){_0x3d2726=_0x3d2726||0x1f4;return function(_0x15cc83){logger[_0x8cac('0x23')](_0x15cc83[_0x8cac('0x24')]);if(_0x15cc83['name']){delete _0x15cc83['name'];}_0x58ecd2[_0x8cac('0x17')](_0x3d2726)[_0x8cac('0x25')](_0x15cc83);};}exports['index']=function(_0x5cbdda,_0x17c893){var _0xd6857f={},_0x58a517={},_0x42939e={'count':0x0,'rows':[]};var _0x3d3719=_[_0x8cac('0x26')](db[_0x8cac('0x27')][_0x8cac('0x28')],function(_0x119d6b){return{'name':_0x119d6b[_0x8cac('0x29')],'type':_0x119d6b[_0x8cac('0x2a')][_0x8cac('0x2b')]};});_0x58a517['model']=_['map'](_0x3d3719,_0x8cac('0x2c'));_0x58a517['query']=_[_0x8cac('0x2d')](_0x5cbdda[_0x8cac('0x2e')]);_0x58a517[_0x8cac('0x2f')]=_['intersection'](_0x58a517[_0x8cac('0x30')],_0x58a517[_0x8cac('0x2e')]);_0xd6857f[_0x8cac('0x31')]=_[_0x8cac('0x32')](_0x58a517[_0x8cac('0x30')],qs[_0x8cac('0x33')](_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x33')]));_0xd6857f[_0x8cac('0x31')]=_0xd6857f[_0x8cac('0x31')][_0x8cac('0x34')]?_0xd6857f[_0x8cac('0x31')]:_0x58a517[_0x8cac('0x30')];if(!_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x35')](_0x8cac('0x36'))){_0xd6857f['limit']=qs[_0x8cac('0x1a')](_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x1a')]);_0xd6857f[_0x8cac('0x18')]=qs[_0x8cac('0x18')](_0x5cbdda[_0x8cac('0x2e')]['offset']);}_0xd6857f[_0x8cac('0x37')]=qs[_0x8cac('0x38')](_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x38')]);_0xd6857f[_0x8cac('0x39')]=qs[_0x8cac('0x2f')](_[_0x8cac('0x3a')](_0x5cbdda[_0x8cac('0x2e')],_0x58a517[_0x8cac('0x2f')]),_0x3d3719);if(_0x5cbdda[_0x8cac('0x2e')]['filter']){_0xd6857f['where']=_[_0x8cac('0x3b')](_0xd6857f['where'],{'$or':_['map'](_0x3d3719,function(_0x3fbf74){if(_0x3fbf74[_0x8cac('0x2a')]!==_0x8cac('0x3c')){var _0x9449dc={};_0x9449dc[_0x3fbf74[_0x8cac('0x2c')]]={'$like':'%'+_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x3d')]+'%'};return _0x9449dc;}})});}_0xd6857f=_[_0x8cac('0x3b')]({},_0xd6857f,_0x5cbdda[_0x8cac('0x3e')]);var _0x22073c={'where':_0xd6857f[_0x8cac('0x39')]};return db['FaxTransferReport'][_0x8cac('0x1b')](_0x22073c)[_0x8cac('0x21')](function(_0x187b84){_0x42939e['count']=_0x187b84;if(_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x3f')]){_0xd6857f[_0x8cac('0x40')]=[{'all':!![]}];}return db[_0x8cac('0x27')][_0x8cac('0x41')](_0xd6857f);})['then'](function(_0x30aeda){_0x42939e[_0x8cac('0x42')]=_0x30aeda;return _0x42939e;})[_0x8cac('0x21')](respondWithFilteredResult(_0x17c893,_0xd6857f))['catch'](handleError(_0x17c893,null));};exports['show']=function(_0x563efb,_0x2b7e88){var _0x1d3524={'raw':!![],'where':{'id':_0x563efb[_0x8cac('0x43')]['id']}},_0x205f0e={};_0x205f0e[_0x8cac('0x30')]=_[_0x8cac('0x2d')](db['FaxTransferReport']['rawAttributes']);_0x205f0e[_0x8cac('0x2e')]=_[_0x8cac('0x2d')](_0x563efb['query']);_0x205f0e[_0x8cac('0x2f')]=_[_0x8cac('0x32')](_0x205f0e[_0x8cac('0x30')],_0x205f0e['query']);_0x1d3524[_0x8cac('0x31')]=_[_0x8cac('0x32')](_0x205f0e[_0x8cac('0x30')],qs[_0x8cac('0x33')](_0x563efb['query'][_0x8cac('0x33')]));_0x1d3524[_0x8cac('0x31')]=_0x1d3524[_0x8cac('0x31')][_0x8cac('0x34')]?_0x1d3524[_0x8cac('0x31')]:_0x205f0e['model'];if(_0x563efb[_0x8cac('0x2e')][_0x8cac('0x3f')]){_0x1d3524[_0x8cac('0x40')]=[{'all':!![]}];}_0x1d3524=_[_0x8cac('0x3b')]({},_0x1d3524,_0x563efb['options']);return db['FaxTransferReport'][_0x8cac('0x44')](_0x1d3524)['then'](handleEntityNotFound(_0x2b7e88,null))['then'](respondWithResult(_0x2b7e88,null))[_0x8cac('0x45')](handleError(_0x2b7e88,null));};exports['create']=function(_0x5c4065,_0x536715){return db[_0x8cac('0x27')][_0x8cac('0x46')](_0x5c4065[_0x8cac('0x47')],{})[_0x8cac('0x21')](respondWithResult(_0x536715,0xc9))[_0x8cac('0x45')](handleError(_0x536715,null));};exports[_0x8cac('0x20')]=function(_0x103c96,_0x489962){if(_0x103c96[_0x8cac('0x47')]['id']){delete _0x103c96[_0x8cac('0x47')]['id'];}return db[_0x8cac('0x27')][_0x8cac('0x44')]({'where':{'id':_0x103c96[_0x8cac('0x43')]['id']}})['then'](handleEntityNotFound(_0x489962,null))[_0x8cac('0x21')](saveUpdates(_0x103c96[_0x8cac('0x47')],null))[_0x8cac('0x21')](respondWithResult(_0x489962,null))[_0x8cac('0x45')](handleError(_0x489962,null));};exports[_0x8cac('0x22')]=function(_0x52a209,_0x259779){return db[_0x8cac('0x27')][_0x8cac('0x44')]({'where':{'id':_0x52a209[_0x8cac('0x43')]['id']}})['then'](handleEntityNotFound(_0x259779,null))[_0x8cac('0x21')](removeEntity(_0x259779,null))['catch'](handleError(_0x259779,null));};exports[_0x8cac('0x48')]=function(_0x10f6a7,_0x3d7a68){return db[_0x8cac('0x27')][_0x8cac('0x48')]()[_0x8cac('0x21')](respondWithResult(_0x3d7a68,null))['catch'](handleError(_0x3d7a68,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 0e35d72..36dab4a 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 _0xc48e=['../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','rimraf'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0xc48e,0xd7));var _0xec48=function(_0x52fb4e,_0x46d5c1){_0x52fb4e=_0x52fb4e-0x0;var _0x442197=_0xc48e[_0x52fb4e];return _0x442197;};'use strict';var _=require(_0xec48('0x0'));var util=require('util');var logger=require(_0xec48('0x1'))('api');var moment=require(_0xec48('0x2'));var BPromise=require(_0xec48('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec48('0x4'));var config=require(_0xec48('0x5'));var attributes=require(_0xec48('0x6'));module[_0xec48('0x7')]=function(_0x1e369f,_0x10e11f){return _0x1e369f['define']('FaxTransferReport',attributes,{'tableName':_0xec48('0x8'),'paranoid':![],'indexes':[{'name':_0xec48('0x9'),'fields':[_0xec48('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2d3=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0xf2d3,0x1ec));var _0x3f2d=function(_0x5c5a2d,_0x2fc4df){_0x5c5a2d=_0x5c5a2d-0x0;var _0x13a954=_0xf2d3[_0x5c5a2d];return _0x13a954;};'use strict';var _=require(_0x3f2d('0x0'));var util=require(_0x3f2d('0x1'));var logger=require(_0x3f2d('0x2'))('api');var moment=require(_0x3f2d('0x3'));var BPromise=require('bluebird');var rp=require(_0x3f2d('0x4'));var fs=require('fs');var path=require(_0x3f2d('0x5'));var rimraf=require(_0x3f2d('0x6'));var config=require(_0x3f2d('0x7'));var attributes=require(_0x3f2d('0x8'));module[_0x3f2d('0x9')]=function(_0x12d9ec,_0x345593){return _0x12d9ec[_0x3f2d('0xa')](_0x3f2d('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x3f2d('0xc'),'fields':[_0x3f2d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 16447c9..098d641 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 _0x0c1f=['client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4b7bc0,_0x49a7f8){var _0x274223=function(_0x4c2bbb){while(--_0x4c2bbb){_0x4b7bc0['push'](_0x4b7bc0['shift']());}};_0x274223(++_0x49a7f8);}(_0x0c1f,0x176));var _0xf0c1=function(_0x2ddd52,_0x4e3b17){_0x2ddd52=_0x2ddd52-0x0;var _0x4bb4ec=_0x0c1f[_0x2ddd52];return _0x4bb4ec;};'use strict';var _=require(_0xf0c1('0x0'));var util=require(_0xf0c1('0x1'));var moment=require('moment');var BPromise=require(_0xf0c1('0x2'));var rs=require(_0xf0c1('0x3'));var fs=require('fs');var Redis=require(_0xf0c1('0x4'));var db=require(_0xf0c1('0x5'))['db'];var utils=require(_0xf0c1('0x6'));var logger=require(_0xf0c1('0x7'))(_0xf0c1('0x8'));var config=require('../../config/environment');var jayson=require(_0xf0c1('0x9'));var client=jayson[_0xf0c1('0xa')][_0xf0c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f97de,_0x570c49,_0xd7f963){return new BPromise(function(_0x465c20,_0x5edcd7){return client[_0xf0c1('0xc')](_0x1f97de,_0xd7f963)[_0xf0c1('0xd')](function(_0x14a6c4){logger[_0xf0c1('0xe')](_0xf0c1('0xf'),_0x570c49,_0xf0c1('0x10'));logger['debug'](_0xf0c1('0x11'),_0x570c49,_0xf0c1('0x10'),JSON[_0xf0c1('0x12')](_0x14a6c4));if(_0x14a6c4[_0xf0c1('0x13')]){if(_0x14a6c4[_0xf0c1('0x13')][_0xf0c1('0x14')]===0x1f4){logger[_0xf0c1('0x13')](_0xf0c1('0xf'),_0x570c49,_0x14a6c4['error'][_0xf0c1('0x15')]);return _0x5edcd7(_0x14a6c4['error'][_0xf0c1('0x15')]);}logger['error'](_0xf0c1('0xf'),_0x570c49,_0x14a6c4[_0xf0c1('0x13')]['message']);return _0x465c20(_0x14a6c4[_0xf0c1('0x13')][_0xf0c1('0x15')]);}else{logger[_0xf0c1('0xe')](_0xf0c1('0xf'),_0x570c49,'request\x20sent');_0x465c20(_0x14a6c4[_0xf0c1('0x16')][_0xf0c1('0x15')]);}})[_0xf0c1('0x17')](function(_0xcc3516){logger[_0xf0c1('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x570c49,_0xcc3516);_0x5edcd7(_0xcc3516);});});} \ No newline at end of file +var _0x3739=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3739,0x1b4));var _0x9373=function(_0x252a30,_0x14fcb7){_0x252a30=_0x252a30-0x0;var _0x1e4b58=_0x3739[_0x252a30];return _0x1e4b58;};'use strict';var _=require('lodash');var util=require(_0x9373('0x0'));var moment=require(_0x9373('0x1'));var BPromise=require(_0x9373('0x2'));var rs=require(_0x9373('0x3'));var fs=require('fs');var Redis=require(_0x9373('0x4'));var db=require(_0x9373('0x5'))['db'];var utils=require(_0x9373('0x6'));var logger=require(_0x9373('0x7'))(_0x9373('0x8'));var config=require(_0x9373('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9373('0xa')][_0x9373('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b70c9,_0x56f711,_0x40fd10){return new BPromise(function(_0x576d10,_0x312e11){return client[_0x9373('0xc')](_0x4b70c9,_0x40fd10)[_0x9373('0xd')](function(_0x4b3258){logger[_0x9373('0xe')](_0x9373('0xf'),_0x56f711,_0x9373('0x10'));logger[_0x9373('0x11')](_0x9373('0x12'),_0x56f711,_0x9373('0x10'),JSON[_0x9373('0x13')](_0x4b3258));if(_0x4b3258['error']){if(_0x4b3258[_0x9373('0x14')][_0x9373('0x15')]===0x1f4){logger[_0x9373('0x14')](_0x9373('0xf'),_0x56f711,_0x4b3258['error'][_0x9373('0x16')]);return _0x312e11(_0x4b3258['error'][_0x9373('0x16')]);}logger[_0x9373('0x14')](_0x9373('0xf'),_0x56f711,_0x4b3258['error']['message']);return _0x576d10(_0x4b3258[_0x9373('0x14')]['message']);}else{logger[_0x9373('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x56f711,_0x9373('0x10'));_0x576d10(_0x4b3258[_0x9373('0x17')][_0x9373('0x16')]);}})[_0x9373('0x18')](function(_0x207d85){logger[_0x9373('0x14')](_0x9373('0xf'),_0x56f711,_0x207d85);_0x312e11(_0x207d85);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 7c1211c..a8584c5 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 _0xb7b6=['./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4f2f5c,_0x5a3f1a){var _0x22b549=function(_0x532149){while(--_0x532149){_0x4f2f5c['push'](_0x4f2f5c['shift']());}};_0x22b549(++_0x5a3f1a);}(_0xb7b6,0x1b1));var _0x6b7b=function(_0x641ab,_0x13e9f0){_0x641ab=_0x641ab-0x0;var _0x5a554e=_0xb7b6[_0x641ab];return _0x5a554e;};'use strict';var multer=require(_0x6b7b('0x0'));var util=require('util');var path=require(_0x6b7b('0x1'));var timeout=require(_0x6b7b('0x2'));var express=require('express');var router=express[_0x6b7b('0x3')]();var fs_extra=require(_0x6b7b('0x4'));var auth=require(_0x6b7b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6b7b('0x6'));var controller=require(_0x6b7b('0x7'));router[_0x6b7b('0x8')]('/',auth[_0x6b7b('0x9')](),controller[_0x6b7b('0xa')]);router[_0x6b7b('0x8')](_0x6b7b('0xb'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0xc')]);router['get'](_0x6b7b('0xd'),auth['isAuthenticated'](),controller[_0x6b7b('0xe')]);router[_0x6b7b('0xf')]('/',auth['isAuthenticated'](),controller[_0x6b7b('0x10')]);router[_0x6b7b('0x11')](_0x6b7b('0xd'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0x12')]);router[_0x6b7b('0x13')](_0x6b7b('0xd'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0x14')]);module[_0x6b7b('0x15')]=router; \ No newline at end of file +var _0x3c22=['get','isAuthenticated','/describe','describe','/:id','post','put','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f797d,_0x262d51){var _0x1fc012=function(_0x270870){while(--_0x270870){_0x3f797d['push'](_0x3f797d['shift']());}};_0x1fc012(++_0x262d51);}(_0x3c22,0x1cb));var _0x23c2=function(_0x9941e1,_0x1523ac){_0x9941e1=_0x9941e1-0x0;var _0x290931=_0x3c22[_0x9941e1];return _0x290931;};'use strict';var multer=require(_0x23c2('0x0'));var util=require(_0x23c2('0x1'));var path=require(_0x23c2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x23c2('0x3'));var auth=require(_0x23c2('0x4'));var interaction=require(_0x23c2('0x5'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x23c2('0x6')]('/',auth[_0x23c2('0x7')](),controller['index']);router[_0x23c2('0x6')](_0x23c2('0x8'),auth[_0x23c2('0x7')](),controller[_0x23c2('0x9')]);router['get'](_0x23c2('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x23c2('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x23c2('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x23c2('0xd')]('/:id',auth[_0x23c2('0x7')](),controller['destroy']);module[_0x23c2('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 10ef316..d50f518 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 _0x1da1=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','util'];(function(_0x421738,_0x4863c8){var _0xc44c82=function(_0x166d96){while(--_0x166d96){_0x421738['push'](_0x421738['shift']());}};_0xc44c82(++_0x4863c8);}(_0x1da1,0x1df));var _0x11da=function(_0x213e71,_0x4ea1c0){_0x213e71=_0x213e71-0x0;var _0x367e94=_0x1da1[_0x213e71];return _0x367e94;};'use strict';var multer=require('multer');var util=require(_0x11da('0x0'));var path=require(_0x11da('0x1'));var timeout=require(_0x11da('0x2'));var express=require('express');var router=express[_0x11da('0x3')]();var fs_extra=require(_0x11da('0x4'));var auth=require(_0x11da('0x5'));var interaction=require(_0x11da('0x6'));var config=require('../../config/environment');var controller=require(_0x11da('0x7'));router[_0x11da('0x8')]('/',auth[_0x11da('0x9')](),controller[_0x11da('0xa')]);router[_0x11da('0x8')](_0x11da('0xb'),auth['isAuthenticated'](),controller[_0x11da('0xc')]);router[_0x11da('0x8')](_0x11da('0xd'),auth['isAuthenticated'](),controller[_0x11da('0xe')]);router[_0x11da('0x8')](_0x11da('0xf'),auth[_0x11da('0x9')](),controller[_0x11da('0x10')]);router[_0x11da('0x11')]('/',auth[_0x11da('0x9')](),controller[_0x11da('0x12')]);router[_0x11da('0x11')]('/:id/configurations',auth[_0x11da('0x9')](),controller[_0x11da('0x13')]);router[_0x11da('0x14')](_0x11da('0xb'),auth[_0x11da('0x9')](),controller[_0x11da('0x15')]);router[_0x11da('0x16')](_0x11da('0xb'),auth[_0x11da('0x9')](),controller['destroy']);module[_0x11da('0x17')]=router; \ No newline at end of file +var _0x53c5=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x53c5,0x8f));var _0x553c=function(_0x463c41,_0x44291f){_0x463c41=_0x463c41-0x0;var _0x39463b=_0x53c5[_0x463c41];return _0x39463b;};'use strict';var multer=require(_0x553c('0x0'));var util=require(_0x553c('0x1'));var path=require(_0x553c('0x2'));var timeout=require(_0x553c('0x3'));var express=require('express');var router=express[_0x553c('0x4')]();var fs_extra=require(_0x553c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x553c('0x6'));var config=require(_0x553c('0x7'));var controller=require('./intDeskAccount.controller');router[_0x553c('0x8')]('/',auth[_0x553c('0x9')](),controller[_0x553c('0xa')]);router[_0x553c('0x8')](_0x553c('0xb'),auth['isAuthenticated'](),controller[_0x553c('0xc')]);router[_0x553c('0x8')](_0x553c('0xd'),auth[_0x553c('0x9')](),controller[_0x553c('0xe')]);router['get']('/:id/fields',auth[_0x553c('0x9')](),controller[_0x553c('0xf')]);router[_0x553c('0x10')]('/',auth[_0x553c('0x9')](),controller[_0x553c('0x11')]);router[_0x553c('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x553c('0x12')]('/:id',auth[_0x553c('0x9')](),controller[_0x553c('0x13')]);router[_0x553c('0x14')](_0x553c('0xb'),auth[_0x553c('0x9')](),controller[_0x553c('0x15')]);module[_0x553c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 33caff7..398724f 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 _0x5e3c=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0x455ee1,_0x43b4f4){var _0x2097aa=function(_0x5b3e4e){while(--_0x5b3e4e){_0x455ee1['push'](_0x455ee1['shift']());}};_0x2097aa(++_0x43b4f4);}(_0x5e3c,0x93));var _0xc5e3=function(_0x2981e2,_0x54d6aa){_0x2981e2=_0x2981e2-0x0;var _0x2406b1=_0x5e3c[_0x2981e2];return _0x2406b1;};'use strict';var Sequelize=require(_0xc5e3('0x0'));module[_0xc5e3('0x1')]={'name':{'type':Sequelize[_0xc5e3('0x2')]},'description':{'type':Sequelize[_0xc5e3('0x2')]},'username':{'type':Sequelize[_0xc5e3('0x2')]},'remoteUri':{'type':Sequelize[_0xc5e3('0x2')]},'authType':{'type':Sequelize[_0xc5e3('0x3')](_0xc5e3('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xc5e3('0x2')]},'consumerKey':{'type':Sequelize[_0xc5e3('0x2')]},'consumerSecret':{'type':Sequelize[_0xc5e3('0x2')]},'token':{'type':Sequelize[_0xc5e3('0x2')]},'tokenSecret':{'type':Sequelize[_0xc5e3('0x2')]},'serverUrl':{'type':Sequelize[_0xc5e3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc5e3('0x3')](_0xc5e3('0x5'),'newTab'),'defaultValue':_0xc5e3('0x5')}}; \ No newline at end of file +var _0x21ef=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x21ef,0x1cb));var _0xf21e=function(_0xc62eb0,_0x3169b6){_0xc62eb0=_0xc62eb0-0x0;var _0x215c9a=_0x21ef[_0xc62eb0];return _0x215c9a;};'use strict';var Sequelize=require(_0xf21e('0x0'));module[_0xf21e('0x1')]={'name':{'type':Sequelize[_0xf21e('0x2')]},'description':{'type':Sequelize[_0xf21e('0x2')]},'username':{'type':Sequelize[_0xf21e('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xf21e('0x3')]('basic'),'defaultValue':_0xf21e('0x4')},'password':{'type':Sequelize[_0xf21e('0x2')]},'consumerKey':{'type':Sequelize[_0xf21e('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xf21e('0x2')]},'serverUrl':{'type':Sequelize[_0xf21e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf21e('0x3')](_0xf21e('0x5'),_0xf21e('0x6')),'defaultValue':_0xf21e('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 8a51143..fbb7406 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 _0xe206=['Subjects','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','slice','substring','GET','format','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','count','limit','status','apply','reject','save','update','then','destroy','end','name','send','index','map','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','DeskAccount','includeAll','include','rows','catch','params','find','body','getConfigurations','findOne','DeskConfiguration','rawAttributes','pick','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','DeskField'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xe206,0xfc));var _0x6e20=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe206[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0x6e20('0x0'));var rimraf=require(_0x6e20('0x1'));var zipdir=require(_0x6e20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e20('0x3'));var moment=require(_0x6e20('0x4'));var BPromise=require(_0x6e20('0x5'));var Mustache=require(_0x6e20('0x6'));var util=require(_0x6e20('0x7'));var path=require(_0x6e20('0x8'));var sox=require(_0x6e20('0x9'));var csv=require(_0x6e20('0xa'));var ejs=require(_0x6e20('0xb'));var fs=require('fs');var fs_extra=require(_0x6e20('0xc'));var _=require(_0x6e20('0xd'));var squel=require(_0x6e20('0xe'));var crypto=require(_0x6e20('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6e20('0x10'));var Redis=require('ioredis');var authService=require(_0x6e20('0x11'));var qs=require(_0x6e20('0x12'));var as=require(_0x6e20('0x13'));var hardwareService=require(_0x6e20('0x14'));var logger=require('../../config/logger')(_0x6e20('0x15'));var utils=require(_0x6e20('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6e20('0x17'))['db'];var integrations=require(_0x6e20('0x18'));function respondWithStatusCode(_0x4d5ead,_0x98fe7f){_0x98fe7f=_0x98fe7f||0xcc;return function(_0x303a0e){if(_0x303a0e){return _0x4d5ead[_0x6e20('0x19')](_0x98fe7f);}return _0x4d5ead['status'](_0x98fe7f)['end']();};}function respondWithResult(_0x572bc1,_0x553b4a){_0x553b4a=_0x553b4a||0xc8;return function(_0x1221a6){if(_0x1221a6){return _0x572bc1['status'](_0x553b4a)[_0x6e20('0x1a')](_0x1221a6);}};}function respondWithFilteredResult(_0x5b8f15,_0x154ec7){return function(_0x358204){if(_0x358204){var _0x19cce2=typeof _0x154ec7[_0x6e20('0x1b')]===_0x6e20('0x1c')&&typeof _0x154ec7['limit']==='undefined';var _0x3faf84=_0x358204[_0x6e20('0x1d')];var _0x5d9223=_0x19cce2?0x0:_0x154ec7[_0x6e20('0x1b')];var _0x498f23=_0x19cce2?_0x358204[_0x6e20('0x1d')]:_0x154ec7['offset']+_0x154ec7[_0x6e20('0x1e')];var _0x15a3fd;if(_0x498f23>=_0x3faf84){_0x498f23=_0x3faf84;_0x15a3fd=0xc8;}else{_0x15a3fd=0xce;}_0x5b8f15[_0x6e20('0x1f')](_0x15a3fd);return _0x5b8f15['set']('Content-Range',_0x5d9223+'-'+_0x498f23+'/'+_0x3faf84)['json'](_0x358204);}return null;};}function patchUpdates(_0x2d1aea){return function(_0x537463){try{jsonpatch[_0x6e20('0x20')](_0x537463,_0x2d1aea,!![]);}catch(_0xe5ece){return BPromise[_0x6e20('0x21')](_0xe5ece);}return _0x537463[_0x6e20('0x22')]();};}function saveUpdates(_0x5f2c95,_0x1d0087){return function(_0x2e6de1){if(_0x2e6de1){return _0x2e6de1[_0x6e20('0x23')](_0x5f2c95)[_0x6e20('0x24')](function(_0x2d8dcd){return _0x2d8dcd;});}return null;};}function removeEntity(_0xcd1db9,_0x43ea14){return function(_0x16a763){if(_0x16a763){return _0x16a763[_0x6e20('0x25')]()[_0x6e20('0x24')](function(){_0xcd1db9[_0x6e20('0x1f')](0xcc)[_0x6e20('0x26')]();});}};}function handleEntityNotFound(_0x309e00,_0x5dd33d){return function(_0x401a79){if(!_0x401a79){_0x309e00[_0x6e20('0x19')](0x194);}return _0x401a79;};}function handleError(_0x4cf9b1,_0x200c2c){_0x200c2c=_0x200c2c||0x1f4;return function(_0x2a0b32){logger['error'](_0x2a0b32['stack']);if(_0x2a0b32[_0x6e20('0x27')]){delete _0x2a0b32[_0x6e20('0x27')];}_0x4cf9b1[_0x6e20('0x1f')](_0x200c2c)[_0x6e20('0x28')](_0x2a0b32);};}exports[_0x6e20('0x29')]=function(_0x3c0e85,_0x64f6b4){var _0x565b1f={},_0x452659={},_0x40ee36={'count':0x0,'rows':[]};var _0x5d8d6f=_[_0x6e20('0x2a')](db['DeskAccount']['rawAttributes'],function(_0x4faab3){return{'name':_0x4faab3[_0x6e20('0x2b')],'type':_0x4faab3['type']['key']};});_0x452659[_0x6e20('0x2c')]=_[_0x6e20('0x2a')](_0x5d8d6f,'name');_0x452659[_0x6e20('0x2d')]=_[_0x6e20('0x2e')](_0x3c0e85['query']);_0x452659[_0x6e20('0x2f')]=_['intersection'](_0x452659[_0x6e20('0x2c')],_0x452659['query']);_0x565b1f[_0x6e20('0x30')]=_[_0x6e20('0x31')](_0x452659[_0x6e20('0x2c')],qs[_0x6e20('0x32')](_0x3c0e85[_0x6e20('0x2d')]['fields']));_0x565b1f[_0x6e20('0x30')]=_0x565b1f[_0x6e20('0x30')][_0x6e20('0x33')]?_0x565b1f[_0x6e20('0x30')]:_0x452659[_0x6e20('0x2c')];if(!_0x3c0e85[_0x6e20('0x2d')][_0x6e20('0x34')](_0x6e20('0x35'))){_0x565b1f[_0x6e20('0x1e')]=qs[_0x6e20('0x1e')](_0x3c0e85[_0x6e20('0x2d')]['limit']);_0x565b1f[_0x6e20('0x1b')]=qs[_0x6e20('0x1b')](_0x3c0e85['query'][_0x6e20('0x1b')]);}_0x565b1f[_0x6e20('0x36')]=qs[_0x6e20('0x37')](_0x3c0e85['query']['sort']);_0x565b1f[_0x6e20('0x38')]=qs['filters'](_['pick'](_0x3c0e85[_0x6e20('0x2d')],_0x452659['filters']),_0x5d8d6f);if(_0x3c0e85[_0x6e20('0x2d')][_0x6e20('0x39')]){_0x565b1f[_0x6e20('0x38')]=_['merge'](_0x565b1f[_0x6e20('0x38')],{'$or':_['map'](_0x5d8d6f,function(_0x410b4d){if(_0x410b4d[_0x6e20('0x3a')]!==_0x6e20('0x3b')){var _0x4fa93f={};_0x4fa93f[_0x410b4d[_0x6e20('0x27')]]={'$like':'%'+_0x3c0e85[_0x6e20('0x2d')][_0x6e20('0x39')]+'%'};return _0x4fa93f;}})});}_0x565b1f=_[_0x6e20('0x3c')]({},_0x565b1f,_0x3c0e85[_0x6e20('0x3d')]);var _0x17458a={'where':_0x565b1f[_0x6e20('0x38')]};return db[_0x6e20('0x3e')][_0x6e20('0x1d')](_0x17458a)['then'](function(_0xe89d64){_0x40ee36[_0x6e20('0x1d')]=_0xe89d64;if(_0x3c0e85['query'][_0x6e20('0x3f')]){_0x565b1f[_0x6e20('0x40')]=[{'all':!![]}];}return db[_0x6e20('0x3e')]['findAll'](_0x565b1f);})[_0x6e20('0x24')](function(_0x3f9fee){_0x40ee36[_0x6e20('0x41')]=_0x3f9fee;return _0x40ee36;})[_0x6e20('0x24')](respondWithFilteredResult(_0x64f6b4,_0x565b1f))[_0x6e20('0x42')](handleError(_0x64f6b4,null));};exports['show']=function(_0x3aed28,_0x31a486){var _0x3c2319={'raw':![],'where':{'id':_0x3aed28[_0x6e20('0x43')]['id']}},_0x4e3a80={};_0x4e3a80[_0x6e20('0x2c')]=_[_0x6e20('0x2e')](db[_0x6e20('0x3e')]['rawAttributes']);_0x4e3a80[_0x6e20('0x2d')]=_[_0x6e20('0x2e')](_0x3aed28['query']);_0x4e3a80['filters']=_[_0x6e20('0x31')](_0x4e3a80[_0x6e20('0x2c')],_0x4e3a80[_0x6e20('0x2d')]);_0x3c2319['attributes']=_[_0x6e20('0x31')](_0x4e3a80[_0x6e20('0x2c')],qs['fields'](_0x3aed28[_0x6e20('0x2d')][_0x6e20('0x32')]));_0x3c2319[_0x6e20('0x30')]=_0x3c2319[_0x6e20('0x30')][_0x6e20('0x33')]?_0x3c2319['attributes']:_0x4e3a80['model'];if(_0x3aed28['query'][_0x6e20('0x3f')]){_0x3c2319[_0x6e20('0x40')]=[{'all':!![]}];}_0x3c2319=_['merge']({},_0x3c2319,_0x3aed28['options']);return db[_0x6e20('0x3e')][_0x6e20('0x44')](_0x3c2319)[_0x6e20('0x24')](handleEntityNotFound(_0x31a486,null))['then'](respondWithResult(_0x31a486,null))[_0x6e20('0x42')](handleError(_0x31a486,null));};exports['create']=function(_0x3cadd8,_0x4cf54c){return db['DeskAccount']['create'](_0x3cadd8[_0x6e20('0x45')],{})[_0x6e20('0x24')](respondWithResult(_0x4cf54c,0xc9))['catch'](handleError(_0x4cf54c,null));};exports[_0x6e20('0x23')]=function(_0x17e810,_0x22278a){if(_0x17e810[_0x6e20('0x45')]['id']){delete _0x17e810[_0x6e20('0x45')]['id'];}return db[_0x6e20('0x3e')]['find']({'where':{'id':_0x17e810[_0x6e20('0x43')]['id']}})[_0x6e20('0x24')](handleEntityNotFound(_0x22278a,null))[_0x6e20('0x24')](saveUpdates(_0x17e810['body'],null))[_0x6e20('0x24')](respondWithResult(_0x22278a,null))['catch'](handleError(_0x22278a,null));};exports[_0x6e20('0x25')]=function(_0x4e87c2,_0x186468){return db[_0x6e20('0x3e')][_0x6e20('0x44')]({'where':{'id':_0x4e87c2[_0x6e20('0x43')]['id']}})[_0x6e20('0x24')](handleEntityNotFound(_0x186468,null))[_0x6e20('0x24')](removeEntity(_0x186468,null))[_0x6e20('0x42')](handleError(_0x186468,null));};exports[_0x6e20('0x46')]=function(_0x396546,_0x3aee44,_0x2d29bb){var _0x4cb355={};var _0x263f97={};var _0x825570;var _0x1877bc;return db['DeskAccount'][_0x6e20('0x47')]({'where':{'id':_0x396546[_0x6e20('0x43')]['id']}})['then'](handleEntityNotFound(_0x3aee44,null))['then'](function(_0x593e7e){if(_0x593e7e){_0x825570=_0x593e7e;_0x263f97['model']=_[_0x6e20('0x2e')](db[_0x6e20('0x48')][_0x6e20('0x49')]);_0x263f97['query']=_[_0x6e20('0x2e')](_0x396546[_0x6e20('0x2d')]);_0x263f97[_0x6e20('0x2f')]=_[_0x6e20('0x31')](_0x263f97[_0x6e20('0x2c')],_0x263f97['query']);_0x4cb355[_0x6e20('0x30')]=_[_0x6e20('0x31')](_0x263f97[_0x6e20('0x2c')],qs[_0x6e20('0x32')](_0x396546[_0x6e20('0x2d')][_0x6e20('0x32')]));_0x4cb355['attributes']=_0x4cb355[_0x6e20('0x30')][_0x6e20('0x33')]?_0x4cb355[_0x6e20('0x30')]:_0x263f97['model'];_0x4cb355[_0x6e20('0x36')]=qs['sort'](_0x396546['query']['sort']);_0x4cb355[_0x6e20('0x38')]=qs['filters'](_[_0x6e20('0x4a')](_0x396546[_0x6e20('0x2d')],_0x263f97[_0x6e20('0x2f')]));if(_0x396546[_0x6e20('0x2d')][_0x6e20('0x39')]){_0x4cb355[_0x6e20('0x38')]=_['merge'](_0x4cb355[_0x6e20('0x38')],{'$or':_[_0x6e20('0x2a')](_0x4cb355[_0x6e20('0x30')],function(_0x3e3c76){var _0x89772b={};_0x89772b[_0x3e3c76]={'$like':'%'+_0x396546[_0x6e20('0x2d')][_0x6e20('0x39')]+'%'};return _0x89772b;})});}_0x4cb355=_['merge']({},_0x4cb355,_0x396546['options']);return _0x825570[_0x6e20('0x46')](_0x4cb355);}})[_0x6e20('0x24')](function(_0x3472e2){if(_0x3472e2){_0x1877bc=_0x3472e2[_0x6e20('0x33')];if(!_0x396546['query']['hasOwnProperty'](_0x6e20('0x35'))){_0x4cb355[_0x6e20('0x1e')]=qs['limit'](_0x396546[_0x6e20('0x2d')][_0x6e20('0x1e')]);_0x4cb355[_0x6e20('0x1b')]=qs[_0x6e20('0x1b')](_0x396546[_0x6e20('0x2d')][_0x6e20('0x1b')]);}return _0x825570[_0x6e20('0x46')](_0x4cb355);}})['then'](function(_0x50b1ee){if(_0x50b1ee){return _0x50b1ee?{'count':_0x1877bc,'rows':_0x50b1ee}:null;}})['then'](respondWithResult(_0x3aee44,null))['catch'](handleError(_0x3aee44,null));};exports[_0x6e20('0x4b')]=function(_0x255f62,_0x2c4fa3,_0x45c71e){if(_0x255f62['body']['id']){delete _0x255f62[_0x6e20('0x45')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x255f62[_0x6e20('0x43')]['id']}})[_0x6e20('0x24')](handleEntityNotFound(_0x2c4fa3,null))['then'](function(_0x5bbbbc){if(_0x5bbbbc){_0x255f62[_0x6e20('0x45')][_0x6e20('0x4c')]=_0x5bbbbc['id'];_0x255f62[_0x6e20('0x45')]['Subjects']=integrations[_0x6e20('0x4d')](_0x255f62[_0x6e20('0x45')]['channel'],_0x255f62[_0x6e20('0x45')][_0x6e20('0x3a')]);_0x255f62[_0x6e20('0x45')][_0x6e20('0x4e')]=integrations[_0x6e20('0x4f')](_0x255f62[_0x6e20('0x45')]['channel'],_0x255f62['body']['type']);return db['DeskConfiguration']['create'](_0x255f62[_0x6e20('0x45')],{'include':[{'model':db[_0x6e20('0x50')],'as':_0x6e20('0x51')},{'model':db[_0x6e20('0x50')],'as':_0x6e20('0x4e')}]});}return null;})[_0x6e20('0x24')](respondWithResult(_0x2c4fa3,null))['catch'](handleError(_0x2c4fa3,null));};exports[_0x6e20('0x52')]=function(_0x11300e,_0x58b541,_0x4ab261){var _0xe8778c=[{'name':'priority','label':_0x6e20('0x53'),'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 _0x289b0a='';return db[_0x6e20('0x3e')][_0x6e20('0x47')]({'where':{'id':_0x11300e['params']['id']},'attributes':['id',_0x6e20('0x54'),_0x6e20('0x55'),_0x6e20('0x56'),_0x6e20('0x57'),_0x6e20('0x58'),_0x6e20('0x59'),_0x6e20('0x5a'),'tokenSecret']})[_0x6e20('0x24')](handleEntityNotFound(_0x58b541,null))['then'](function(_0x10c4dc){if(_0x10c4dc){_0x289b0a=_0x10c4dc[_0x6e20('0x54')];var _0x4055fe=_0x289b0a[_0x6e20('0x5b')](-0x1);if(_0x4055fe==='/'){_0x289b0a=_0x289b0a[_0x6e20('0x5c')](0x0,_0x289b0a['lastIndexOf'](_0x4055fe));}var _0x174dc9={'method':_0x6e20('0x5d'),'uri':util[_0x6e20('0x5e')]('%s/custom_fields',_0x289b0a),'headers':{'Content-Type':_0x6e20('0x5f'),'Accept':'application/json'},'json':!![]};if(_0x10c4dc['authType']===_0x6e20('0x60')){_0x174dc9['headers'][_0x6e20('0x61')]=util[_0x6e20('0x5e')](_0x6e20('0x62'),new Buffer(util[_0x6e20('0x5e')](_0x6e20('0x63'),_0x10c4dc[_0x6e20('0x56')],_0x10c4dc[_0x6e20('0x57')]))[_0x6e20('0x64')](_0x6e20('0x65')));}return rp(_0x174dc9)[_0x6e20('0x24')](function(_0x8156ea){return _0xe8778c[_0x6e20('0x66')](_[_0x6e20('0x2a')](_0x8156ea[_0x6e20('0x67')][_0x6e20('0x68')],function(_0x488412){return{'id':_0x488412[_0x6e20('0x27')],'name':_0x488412[_0x6e20('0x27')],'type':_0x488412[_0x6e20('0x3a')],'active':_0x488412[_0x6e20('0x69')],'label':_0x488412['label'],'custom':!![]};}));});}})[_0x6e20('0x24')](function(_0x247616){return{'count':_0x247616[_0x6e20('0x33')],'rows':_0x247616};})[_0x6e20('0x24')](respondWithResult(_0x58b541,null))[_0x6e20('0x42')](function(_0x393b71){var _0x5c9733=_0x11300e['query'][_0x6e20('0x6a')]?0x1f4:_0x393b71[_0x6e20('0x6b')]||0x1f4;logger[_0x6e20('0x6c')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5c9733,JSON[_0x6e20('0x6d')](_0x393b71));delete _0x393b71[_0x6e20('0x27')];if(_0x5c9733===0x191){_0x5c9733=0x190;}_0x58b541[_0x6e20('0x1f')](_0x5c9733)[_0x6e20('0x28')](_0x11300e[_0x6e20('0x2d')][_0x6e20('0x6a')]?{'message':_0x6e20('0x6e'),'statusCode':_0x393b71[_0x6e20('0x6b')]}:_0x393b71);});}; \ No newline at end of file +var _0x2078=['key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','DeskAccount','include','catch','params','keys','rawAttributes','includeAll','find','create','update','body','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','getSubjects','getDescriptions','channel','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','password','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','basic','headers','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','undefined','limit','count','offset','set','apply','reject','then','destroy','sendStatus','error','stack','name','send','fieldName','type'];(function(_0x312a7f,_0x509e83){var _0x2fb5ba=function(_0x3dcdea){while(--_0x3dcdea){_0x312a7f['push'](_0x312a7f['shift']());}};_0x2fb5ba(++_0x509e83);}(_0x2078,0xaf));var _0x8207=function(_0x1ddb6b,_0x22f207){_0x1ddb6b=_0x1ddb6b-0x0;var _0x34220c=_0x2078[_0x1ddb6b];return _0x34220c;};'use strict';var emlformat=require(_0x8207('0x0'));var rimraf=require(_0x8207('0x1'));var zipdir=require(_0x8207('0x2'));var jsonpatch=require(_0x8207('0x3'));var rp=require('request-promise');var moment=require(_0x8207('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8207('0x5'));var util=require(_0x8207('0x6'));var path=require(_0x8207('0x7'));var sox=require(_0x8207('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8207('0x9'));var squel=require(_0x8207('0xa'));var crypto=require(_0x8207('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8207('0xc'));var toCsv=require(_0x8207('0xd'));var querystring=require(_0x8207('0xe'));var Papa=require(_0x8207('0xf'));var Redis=require('ioredis');var authService=require(_0x8207('0x10'));var qs=require(_0x8207('0x11'));var as=require(_0x8207('0x12'));var hardwareService=require(_0x8207('0x13'));var logger=require(_0x8207('0x14'))(_0x8207('0x15'));var utils=require('../../config/utils');var config=require(_0x8207('0x16'));var licenseUtil=require(_0x8207('0x17'));var db=require(_0x8207('0x18'))['db'];var integrations=require(_0x8207('0x19'));function respondWithStatusCode(_0x1dfde1,_0x2be7b2){_0x2be7b2=_0x2be7b2||0xcc;return function(_0x2230a7){if(_0x2230a7){return _0x1dfde1['sendStatus'](_0x2be7b2);}return _0x1dfde1['status'](_0x2be7b2)[_0x8207('0x1a')]();};}function respondWithResult(_0x49a709,_0x4c5a4b){_0x4c5a4b=_0x4c5a4b||0xc8;return function(_0x46e5a4){if(_0x46e5a4){return _0x49a709[_0x8207('0x1b')](_0x4c5a4b)[_0x8207('0x1c')](_0x46e5a4);}};}function respondWithFilteredResult(_0x3ba62c,_0x43037e){return function(_0x5bfc2a){if(_0x5bfc2a){var _0x2da49c=typeof _0x43037e['offset']===_0x8207('0x1d')&&typeof _0x43037e[_0x8207('0x1e')]===_0x8207('0x1d');var _0x14c7a5=_0x5bfc2a['count'];var _0x3aef40=_0x2da49c?0x0:_0x43037e['offset'];var _0x271b0c=_0x2da49c?_0x5bfc2a[_0x8207('0x1f')]:_0x43037e[_0x8207('0x20')]+_0x43037e[_0x8207('0x1e')];var _0x2ca482;if(_0x271b0c>=_0x14c7a5){_0x271b0c=_0x14c7a5;_0x2ca482=0xc8;}else{_0x2ca482=0xce;}_0x3ba62c[_0x8207('0x1b')](_0x2ca482);return _0x3ba62c[_0x8207('0x21')]('Content-Range',_0x3aef40+'-'+_0x271b0c+'/'+_0x14c7a5)[_0x8207('0x1c')](_0x5bfc2a);}return null;};}function patchUpdates(_0x1437ca){return function(_0x2c8698){try{jsonpatch[_0x8207('0x22')](_0x2c8698,_0x1437ca,!![]);}catch(_0xe8e5c){return BPromise[_0x8207('0x23')](_0xe8e5c);}return _0x2c8698['save']();};}function saveUpdates(_0x322d3c,_0x44bb9c){return function(_0x325eed){if(_0x325eed){return _0x325eed['update'](_0x322d3c)[_0x8207('0x24')](function(_0x11ac64){return _0x11ac64;});}return null;};}function removeEntity(_0x4a2e68,_0x540b9d){return function(_0x48bcf1){if(_0x48bcf1){return _0x48bcf1[_0x8207('0x25')]()[_0x8207('0x24')](function(){_0x4a2e68[_0x8207('0x1b')](0xcc)[_0x8207('0x1a')]();});}};}function handleEntityNotFound(_0x138152,_0x159c0c){return function(_0x1e957b){if(!_0x1e957b){_0x138152[_0x8207('0x26')](0x194);}return _0x1e957b;};}function handleError(_0x30ec31,_0x18a1dc){_0x18a1dc=_0x18a1dc||0x1f4;return function(_0x2cb1c7){logger[_0x8207('0x27')](_0x2cb1c7[_0x8207('0x28')]);if(_0x2cb1c7[_0x8207('0x29')]){delete _0x2cb1c7['name'];}_0x30ec31[_0x8207('0x1b')](_0x18a1dc)[_0x8207('0x2a')](_0x2cb1c7);};}exports['index']=function(_0x5e7e19,_0x367b13){var _0x464ecf={},_0x264eb6={},_0x3c3e65={'count':0x0,'rows':[]};var _0xedda00=_['map'](db['DeskAccount']['rawAttributes'],function(_0x3f1d5d){return{'name':_0x3f1d5d[_0x8207('0x2b')],'type':_0x3f1d5d[_0x8207('0x2c')][_0x8207('0x2d')]};});_0x264eb6[_0x8207('0x2e')]=_['map'](_0xedda00,_0x8207('0x29'));_0x264eb6[_0x8207('0x2f')]=_['keys'](_0x5e7e19[_0x8207('0x2f')]);_0x264eb6[_0x8207('0x30')]=_[_0x8207('0x31')](_0x264eb6[_0x8207('0x2e')],_0x264eb6['query']);_0x464ecf[_0x8207('0x32')]=_[_0x8207('0x31')](_0x264eb6['model'],qs['fields'](_0x5e7e19[_0x8207('0x2f')][_0x8207('0x33')]));_0x464ecf[_0x8207('0x32')]=_0x464ecf[_0x8207('0x32')][_0x8207('0x34')]?_0x464ecf['attributes']:_0x264eb6[_0x8207('0x2e')];if(!_0x5e7e19[_0x8207('0x2f')]['hasOwnProperty'](_0x8207('0x35'))){_0x464ecf[_0x8207('0x1e')]=qs[_0x8207('0x1e')](_0x5e7e19['query'][_0x8207('0x1e')]);_0x464ecf[_0x8207('0x20')]=qs['offset'](_0x5e7e19[_0x8207('0x2f')]['offset']);}_0x464ecf['order']=qs[_0x8207('0x36')](_0x5e7e19[_0x8207('0x2f')][_0x8207('0x36')]);_0x464ecf[_0x8207('0x37')]=qs[_0x8207('0x30')](_[_0x8207('0x38')](_0x5e7e19[_0x8207('0x2f')],_0x264eb6[_0x8207('0x30')]),_0xedda00);if(_0x5e7e19['query'][_0x8207('0x39')]){_0x464ecf[_0x8207('0x37')]=_[_0x8207('0x3a')](_0x464ecf[_0x8207('0x37')],{'$or':_[_0x8207('0x3b')](_0xedda00,function(_0x5dff51){if(_0x5dff51[_0x8207('0x2c')]!==_0x8207('0x3c')){var _0x403da6={};_0x403da6[_0x5dff51[_0x8207('0x29')]]={'$like':'%'+_0x5e7e19['query']['filter']+'%'};return _0x403da6;}})});}_0x464ecf=_[_0x8207('0x3a')]({},_0x464ecf,_0x5e7e19[_0x8207('0x3d')]);var _0xa343ca={'where':_0x464ecf[_0x8207('0x37')]};return db[_0x8207('0x3e')]['count'](_0xa343ca)[_0x8207('0x24')](function(_0x10e79d){_0x3c3e65[_0x8207('0x1f')]=_0x10e79d;if(_0x5e7e19[_0x8207('0x2f')]['includeAll']){_0x464ecf[_0x8207('0x3f')]=[{'all':!![]}];}return db[_0x8207('0x3e')]['findAll'](_0x464ecf);})['then'](function(_0x574c47){_0x3c3e65['rows']=_0x574c47;return _0x3c3e65;})['then'](respondWithFilteredResult(_0x367b13,_0x464ecf))[_0x8207('0x40')](handleError(_0x367b13,null));};exports['show']=function(_0x566c5a,_0x90e766){var _0x31c681={'raw':![],'where':{'id':_0x566c5a[_0x8207('0x41')]['id']}},_0x41d974={};_0x41d974[_0x8207('0x2e')]=_[_0x8207('0x42')](db[_0x8207('0x3e')][_0x8207('0x43')]);_0x41d974['query']=_[_0x8207('0x42')](_0x566c5a[_0x8207('0x2f')]);_0x41d974[_0x8207('0x30')]=_[_0x8207('0x31')](_0x41d974[_0x8207('0x2e')],_0x41d974[_0x8207('0x2f')]);_0x31c681[_0x8207('0x32')]=_[_0x8207('0x31')](_0x41d974[_0x8207('0x2e')],qs['fields'](_0x566c5a[_0x8207('0x2f')][_0x8207('0x33')]));_0x31c681[_0x8207('0x32')]=_0x31c681[_0x8207('0x32')][_0x8207('0x34')]?_0x31c681[_0x8207('0x32')]:_0x41d974[_0x8207('0x2e')];if(_0x566c5a[_0x8207('0x2f')][_0x8207('0x44')]){_0x31c681[_0x8207('0x3f')]=[{'all':!![]}];}_0x31c681=_[_0x8207('0x3a')]({},_0x31c681,_0x566c5a['options']);return db[_0x8207('0x3e')][_0x8207('0x45')](_0x31c681)[_0x8207('0x24')](handleEntityNotFound(_0x90e766,null))[_0x8207('0x24')](respondWithResult(_0x90e766,null))['catch'](handleError(_0x90e766,null));};exports['create']=function(_0x347d96,_0xbb736f){return db[_0x8207('0x3e')][_0x8207('0x46')](_0x347d96['body'],{})['then'](respondWithResult(_0xbb736f,0xc9))[_0x8207('0x40')](handleError(_0xbb736f,null));};exports[_0x8207('0x47')]=function(_0x584920,_0x3d6094){if(_0x584920[_0x8207('0x48')]['id']){delete _0x584920['body']['id'];}return db['DeskAccount'][_0x8207('0x45')]({'where':{'id':_0x584920['params']['id']}})[_0x8207('0x24')](handleEntityNotFound(_0x3d6094,null))[_0x8207('0x24')](saveUpdates(_0x584920[_0x8207('0x48')],null))['then'](respondWithResult(_0x3d6094,null))[_0x8207('0x40')](handleError(_0x3d6094,null));};exports[_0x8207('0x25')]=function(_0xce8f04,_0x1351dd){return db[_0x8207('0x3e')][_0x8207('0x45')]({'where':{'id':_0xce8f04[_0x8207('0x41')]['id']}})[_0x8207('0x24')](handleEntityNotFound(_0x1351dd,null))['then'](removeEntity(_0x1351dd,null))['catch'](handleError(_0x1351dd,null));};exports[_0x8207('0x49')]=function(_0xeb0ae4,_0x59aaf6,_0x45f3f1){var _0x1a2e4a={};var _0x5b713a={};var _0x16791f;var _0x233454;return db[_0x8207('0x3e')][_0x8207('0x4a')]({'where':{'id':_0xeb0ae4[_0x8207('0x41')]['id']}})[_0x8207('0x24')](handleEntityNotFound(_0x59aaf6,null))[_0x8207('0x24')](function(_0x1e0cd0){if(_0x1e0cd0){_0x16791f=_0x1e0cd0;_0x5b713a[_0x8207('0x2e')]=_['keys'](db[_0x8207('0x4b')][_0x8207('0x43')]);_0x5b713a[_0x8207('0x2f')]=_[_0x8207('0x42')](_0xeb0ae4[_0x8207('0x2f')]);_0x5b713a[_0x8207('0x30')]=_[_0x8207('0x31')](_0x5b713a[_0x8207('0x2e')],_0x5b713a[_0x8207('0x2f')]);_0x1a2e4a['attributes']=_[_0x8207('0x31')](_0x5b713a[_0x8207('0x2e')],qs[_0x8207('0x33')](_0xeb0ae4['query']['fields']));_0x1a2e4a[_0x8207('0x32')]=_0x1a2e4a['attributes'][_0x8207('0x34')]?_0x1a2e4a[_0x8207('0x32')]:_0x5b713a[_0x8207('0x2e')];_0x1a2e4a['order']=qs[_0x8207('0x36')](_0xeb0ae4[_0x8207('0x2f')]['sort']);_0x1a2e4a[_0x8207('0x37')]=qs[_0x8207('0x30')](_['pick'](_0xeb0ae4['query'],_0x5b713a[_0x8207('0x30')]));if(_0xeb0ae4[_0x8207('0x2f')][_0x8207('0x39')]){_0x1a2e4a[_0x8207('0x37')]=_['merge'](_0x1a2e4a['where'],{'$or':_[_0x8207('0x3b')](_0x1a2e4a[_0x8207('0x32')],function(_0x30c1e6){var _0x1766e2={};_0x1766e2[_0x30c1e6]={'$like':'%'+_0xeb0ae4[_0x8207('0x2f')][_0x8207('0x39')]+'%'};return _0x1766e2;})});}_0x1a2e4a=_[_0x8207('0x3a')]({},_0x1a2e4a,_0xeb0ae4[_0x8207('0x3d')]);return _0x16791f[_0x8207('0x49')](_0x1a2e4a);}})[_0x8207('0x24')](function(_0x558463){if(_0x558463){_0x233454=_0x558463[_0x8207('0x34')];if(!_0xeb0ae4[_0x8207('0x2f')][_0x8207('0x4c')](_0x8207('0x35'))){_0x1a2e4a[_0x8207('0x1e')]=qs[_0x8207('0x1e')](_0xeb0ae4[_0x8207('0x2f')][_0x8207('0x1e')]);_0x1a2e4a[_0x8207('0x20')]=qs['offset'](_0xeb0ae4[_0x8207('0x2f')][_0x8207('0x20')]);}return _0x16791f[_0x8207('0x49')](_0x1a2e4a);}})[_0x8207('0x24')](function(_0xbb5477){if(_0xbb5477){return _0xbb5477?{'count':_0x233454,'rows':_0xbb5477}:null;}})[_0x8207('0x24')](respondWithResult(_0x59aaf6,null))[_0x8207('0x40')](handleError(_0x59aaf6,null));};exports['addConfiguration']=function(_0x1a0a2e,_0x13f7d2,_0x3a2a42){if(_0x1a0a2e[_0x8207('0x48')]['id']){delete _0x1a0a2e['body']['id'];}return db['DeskAccount'][_0x8207('0x4a')]({'where':{'id':_0x1a0a2e[_0x8207('0x41')]['id']}})[_0x8207('0x24')](handleEntityNotFound(_0x13f7d2,null))['then'](function(_0x159b8b){if(_0x159b8b){_0x1a0a2e[_0x8207('0x48')]['AccountId']=_0x159b8b['id'];_0x1a0a2e[_0x8207('0x48')]['Subjects']=integrations[_0x8207('0x4d')](_0x1a0a2e[_0x8207('0x48')]['channel'],_0x1a0a2e[_0x8207('0x48')][_0x8207('0x2c')]);_0x1a0a2e[_0x8207('0x48')]['Descriptions']=integrations[_0x8207('0x4e')](_0x1a0a2e['body'][_0x8207('0x4f')],_0x1a0a2e['body'][_0x8207('0x2c')]);return db[_0x8207('0x4b')][_0x8207('0x46')](_0x1a0a2e[_0x8207('0x48')],{'include':[{'model':db[_0x8207('0x50')],'as':'Subjects'},{'model':db[_0x8207('0x50')],'as':_0x8207('0x51')}]});}return null;})[_0x8207('0x24')](respondWithResult(_0x13f7d2,null))[_0x8207('0x40')](handleError(_0x13f7d2,null));};exports[_0x8207('0x52')]=function(_0x370aeb,_0x32c8cc,_0x447e22){var _0x7ce912=[{'name':_0x8207('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 _0x5a43da='';return db[_0x8207('0x3e')]['findOne']({'where':{'id':_0x370aeb[_0x8207('0x41')]['id']},'attributes':['id',_0x8207('0x54'),_0x8207('0x55'),_0x8207('0x56'),_0x8207('0x57'),'consumerKey','consumerSecret',_0x8207('0x58'),_0x8207('0x59')]})[_0x8207('0x24')](handleEntityNotFound(_0x32c8cc,null))[_0x8207('0x24')](function(_0x4459ae){if(_0x4459ae){_0x5a43da=_0x4459ae[_0x8207('0x54')];var _0x1f6016=_0x5a43da[_0x8207('0x5a')](-0x1);if(_0x1f6016==='/'){_0x5a43da=_0x5a43da[_0x8207('0x5b')](0x0,_0x5a43da[_0x8207('0x5c')](_0x1f6016));}var _0x5b642f={'method':_0x8207('0x5d'),'uri':util[_0x8207('0x5e')](_0x8207('0x5f'),_0x5a43da),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x4459ae['authType']===_0x8207('0x60')){_0x5b642f[_0x8207('0x61')]['Authorization']=util[_0x8207('0x5e')](_0x8207('0x62'),new Buffer(util['format'](_0x8207('0x63'),_0x4459ae[_0x8207('0x56')],_0x4459ae[_0x8207('0x57')]))[_0x8207('0x64')](_0x8207('0x65')));}return rp(_0x5b642f)[_0x8207('0x24')](function(_0x16e52a){return _0x7ce912[_0x8207('0x66')](_[_0x8207('0x3b')](_0x16e52a[_0x8207('0x67')][_0x8207('0x68')],function(_0x129b7f){return{'id':_0x129b7f[_0x8207('0x29')],'name':_0x129b7f[_0x8207('0x29')],'type':_0x129b7f[_0x8207('0x2c')],'active':_0x129b7f['active'],'label':_0x129b7f['label'],'custom':!![]};}));});}})['then'](function(_0x287c0f){return{'count':_0x287c0f[_0x8207('0x34')],'rows':_0x287c0f};})[_0x8207('0x24')](respondWithResult(_0x32c8cc,null))['catch'](function(_0x546bec){var _0x2c938c=_0x370aeb[_0x8207('0x2f')][_0x8207('0x69')]?0x1f4:_0x546bec[_0x8207('0x6a')]||0x1f4;logger[_0x8207('0x27')](_0x8207('0x6b'),_0x8207('0x52'),_0x2c938c,JSON[_0x8207('0x6c')](_0x546bec));delete _0x546bec[_0x8207('0x29')];if(_0x2c938c===0x191){_0x2c938c=0x190;}_0x32c8cc[_0x8207('0x1b')](_0x2c938c)['send'](_0x370aeb[_0x8207('0x2f')][_0x8207('0x69')]?{'message':_0x8207('0x6d'),'statusCode':_0x546bec[_0x8207('0x6a')]}:_0x546bec);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 167d9e1..a187635 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 _0x4e5e=['int_desk_accounts','util','api','moment','bluebird','request-promise','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x475fa8,_0x444305){var _0x5c1657=function(_0x47a757){while(--_0x47a757){_0x475fa8['push'](_0x475fa8['shift']());}};_0x5c1657(++_0x444305);}(_0x4e5e,0x18d));var _0xe4e5=function(_0x51d959,_0x56b9c5){_0x51d959=_0x51d959-0x0;var _0x5d7d92=_0x4e5e[_0x51d959];return _0x5d7d92;};'use strict';var _=require('lodash');var util=require(_0xe4e5('0x0'));var logger=require('../../config/logger')(_0xe4e5('0x1'));var moment=require(_0xe4e5('0x2'));var BPromise=require(_0xe4e5('0x3'));var rp=require(_0xe4e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe4e5('0x5'));var attributes=require(_0xe4e5('0x6'));var integrations=require(_0xe4e5('0x7'));module[_0xe4e5('0x8')]=function(_0x104008,_0x2a1004){return _0x104008[_0xe4e5('0x9')]('DeskAccount',attributes,{'tableName':_0xe4e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeebc=['path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x15dacd,_0x8b58e4){var _0x30f78c=function(_0x400b4a){while(--_0x400b4a){_0x15dacd['push'](_0x15dacd['shift']());}};_0x30f78c(++_0x8b58e4);}(_0xeebc,0x180));var _0xceeb=function(_0x146ccf,_0x3aa6fa){_0x146ccf=_0x146ccf-0x0;var _0x5e75df=_0xeebc[_0x146ccf];return _0x5e75df;};'use strict';var _=require(_0xceeb('0x0'));var util=require(_0xceeb('0x1'));var logger=require(_0xceeb('0x2'))('api');var moment=require(_0xceeb('0x3'));var BPromise=require(_0xceeb('0x4'));var rp=require(_0xceeb('0x5'));var fs=require('fs');var path=require(_0xceeb('0x6'));var rimraf=require(_0xceeb('0x7'));var config=require(_0xceeb('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xceeb('0x9'));module[_0xceeb('0xa')]=function(_0x3b1347,_0x2ea2db){return _0x3b1347[_0xceeb('0xb')](_0xceeb('0xc'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index d6f3863..2e8228c 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 _0x1eaa=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xac5aeb,_0x14ce88){var _0x57d45b=function(_0x211e07){while(--_0x211e07){_0xac5aeb['push'](_0xac5aeb['shift']());}};_0x57d45b(++_0x14ce88);}(_0x1eaa,0xdd));var _0xa1ea=function(_0x1eaf12,_0x598b17){_0x1eaf12=_0x1eaf12-0x0;var _0x26a801=_0x1eaa[_0x1eaf12];return _0x26a801;};'use strict';var _=require(_0xa1ea('0x0'));var util=require(_0xa1ea('0x1'));var moment=require(_0xa1ea('0x2'));var BPromise=require(_0xa1ea('0x3'));var rs=require(_0xa1ea('0x4'));var fs=require('fs');var Redis=require(_0xa1ea('0x5'));var db=require(_0xa1ea('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa1ea('0x7'));var config=require(_0xa1ea('0x8'));var jayson=require(_0xa1ea('0x9'));var client=jayson[_0xa1ea('0xa')][_0xa1ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b1b3c,_0x2463ae,_0xcf0653){return new BPromise(function(_0x4aa8b0,_0x5f4007){return client[_0xa1ea('0xc')](_0x1b1b3c,_0xcf0653)[_0xa1ea('0xd')](function(_0xf43a25){logger[_0xa1ea('0xe')](_0xa1ea('0xf'),_0x2463ae,_0xa1ea('0x10'));logger[_0xa1ea('0x11')](_0xa1ea('0x12'),_0x2463ae,'request\x20sent',JSON['stringify'](_0xf43a25));if(_0xf43a25[_0xa1ea('0x13')]){if(_0xf43a25[_0xa1ea('0x13')][_0xa1ea('0x14')]===0x1f4){logger[_0xa1ea('0x13')](_0xa1ea('0xf'),_0x2463ae,_0xf43a25['error'][_0xa1ea('0x15')]);return _0x5f4007(_0xf43a25[_0xa1ea('0x13')][_0xa1ea('0x15')]);}logger[_0xa1ea('0x13')](_0xa1ea('0xf'),_0x2463ae,_0xf43a25[_0xa1ea('0x13')]['message']);return _0x4aa8b0(_0xf43a25[_0xa1ea('0x13')]['message']);}else{logger[_0xa1ea('0xe')](_0xa1ea('0xf'),_0x2463ae,_0xa1ea('0x10'));_0x4aa8b0(_0xf43a25[_0xa1ea('0x16')]['message']);}})[_0xa1ea('0x17')](function(_0x3b31aa){logger[_0xa1ea('0x13')](_0xa1ea('0xf'),_0x2463ae,_0x3b31aa);_0x5f4007(_0x3b31aa);});});}exports[_0xa1ea('0x18')]=function(_0x276bdd){var _0x2ed099=this;return new Promise(function(_0x1fe90b,_0x58d13e){return db[_0xa1ea('0x19')][_0xa1ea('0x1a')]({'raw':_0x276bdd['options']?_0x276bdd[_0xa1ea('0x1b')][_0xa1ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x276bdd[_0xa1ea('0x1b')]?_0x276bdd[_0xa1ea('0x1b')][_0xa1ea('0x1d')]||null:null,'attributes':_0x276bdd[_0xa1ea('0x1b')]?_0x276bdd['options'][_0xa1ea('0x1e')]||null:null,'limit':_0x276bdd[_0xa1ea('0x1b')]?_0x276bdd[_0xa1ea('0x1b')][_0xa1ea('0x1f')]||null:null,'include':_0x276bdd[_0xa1ea('0x1b')]?_0x276bdd[_0xa1ea('0x1b')]['include']?_['map'](_0x276bdd[_0xa1ea('0x1b')][_0xa1ea('0x20')],function(_0x5a8c48){return{'model':db[_0x5a8c48[_0xa1ea('0x21')]],'as':_0x5a8c48['as'],'attributes':_0x5a8c48['attributes'],'include':_0x5a8c48[_0xa1ea('0x20')]?_['map'](_0x5a8c48[_0xa1ea('0x20')],function(_0x5bbfb0){return{'model':db[_0x5bbfb0['model']],'as':_0x5bbfb0['as'],'attributes':_0x5bbfb0[_0xa1ea('0x1e')],'include':_0x5bbfb0['include']?_[_0xa1ea('0x22')](_0x5bbfb0['include'],function(_0x1c9ed0){return{'model':db[_0x1c9ed0[_0xa1ea('0x21')]],'as':_0x1c9ed0['as'],'attributes':_0x1c9ed0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x549bc3){logger['info'](_0xa1ea('0x18'),_0x276bdd);logger[_0xa1ea('0x11')]('GetDeskAccount',_0x276bdd,JSON[_0xa1ea('0x23')](_0x549bc3));_0x1fe90b(_0x549bc3);})[_0xa1ea('0x17')](function(_0x44e185){logger[_0xa1ea('0x13')](_0xa1ea('0x18'),_0x44e185[_0xa1ea('0x15')],_0x276bdd);_0x58d13e(_0x2ed099[_0xa1ea('0x13')](0x1f4,_0x44e185[_0xa1ea('0x15')]));});});};exports[_0xa1ea('0x24')]=function(_0x1438bf){var _0x1ba0be=this;return new Promise(function(_0x462ade,_0x45f08e){return db[_0xa1ea('0x19')][_0xa1ea('0x25')]({'raw':_0x1438bf[_0xa1ea('0x1b')]?_0x1438bf['options'][_0xa1ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x1438bf[_0xa1ea('0x1b')]?_0x1438bf['options'][_0xa1ea('0x1d')]||null:null,'attributes':_0x1438bf[_0xa1ea('0x1b')]?_0x1438bf[_0xa1ea('0x1b')][_0xa1ea('0x1e')]||null:null,'include':_0x1438bf[_0xa1ea('0x1b')]?_0x1438bf[_0xa1ea('0x1b')][_0xa1ea('0x20')]?_[_0xa1ea('0x22')](_0x1438bf[_0xa1ea('0x1b')][_0xa1ea('0x20')],function(_0x14688c){return{'model':db[_0x14688c[_0xa1ea('0x21')]],'as':_0x14688c['as'],'attributes':_0x14688c[_0xa1ea('0x1e')],'include':_0x14688c[_0xa1ea('0x20')]?_[_0xa1ea('0x22')](_0x14688c[_0xa1ea('0x20')],function(_0x17158c){return{'model':db[_0x17158c['model']],'as':_0x17158c['as'],'attributes':_0x17158c[_0xa1ea('0x1e')],'include':_0x17158c[_0xa1ea('0x20')]?_[_0xa1ea('0x22')](_0x17158c['include'],function(_0x15d6e5){return{'model':db[_0x15d6e5[_0xa1ea('0x21')]],'as':_0x15d6e5['as'],'attributes':_0x15d6e5[_0xa1ea('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x490654){logger[_0xa1ea('0xe')](_0xa1ea('0x24'),_0x1438bf);logger[_0xa1ea('0x11')]('ShowDeskAccount',_0x1438bf,JSON[_0xa1ea('0x23')](_0x490654));_0x462ade(_0x490654);})[_0xa1ea('0x17')](function(_0x3f3790){logger[_0xa1ea('0x13')](_0xa1ea('0x24'),_0x3f3790['message'],_0x1438bf);_0x45f08e(_0x1ba0be['error'](0x1f4,_0x3f3790[_0xa1ea('0x15')]));});});}; \ No newline at end of file +var _0x72fa=['code','message','DeskAccount','options','where','attributes','limit','include','map','model','GetDeskAccount','catch','ShowDeskAccount','find','raw','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x72fa,0x72));var _0xa72f=function(_0x241b92,_0x1526dd){_0x241b92=_0x241b92-0x0;var _0x575bb4=_0x72fa[_0x241b92];return _0x575bb4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa72f('0x0'));var BPromise=require(_0xa72f('0x1'));var rs=require(_0xa72f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa72f('0x3'))['db'];var utils=require(_0xa72f('0x4'));var logger=require(_0xa72f('0x5'))(_0xa72f('0x6'));var config=require(_0xa72f('0x7'));var jayson=require(_0xa72f('0x8'));var client=jayson[_0xa72f('0x9')][_0xa72f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x510afa,_0x12d5ed,_0x502350){return new BPromise(function(_0x209c53,_0x5dcf75){return client['request'](_0x510afa,_0x502350)[_0xa72f('0xb')](function(_0x45e569){logger[_0xa72f('0xc')](_0xa72f('0xd'),_0x12d5ed,_0xa72f('0xe'));logger[_0xa72f('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x12d5ed,_0xa72f('0xe'),JSON[_0xa72f('0x10')](_0x45e569));if(_0x45e569[_0xa72f('0x11')]){if(_0x45e569['error'][_0xa72f('0x12')]===0x1f4){logger[_0xa72f('0x11')](_0xa72f('0xd'),_0x12d5ed,_0x45e569['error'][_0xa72f('0x13')]);return _0x5dcf75(_0x45e569[_0xa72f('0x11')][_0xa72f('0x13')]);}logger[_0xa72f('0x11')]('DeskAccount,\x20%s,\x20%s',_0x12d5ed,_0x45e569[_0xa72f('0x11')][_0xa72f('0x13')]);return _0x209c53(_0x45e569[_0xa72f('0x11')]['message']);}else{logger[_0xa72f('0xc')](_0xa72f('0xd'),_0x12d5ed,_0xa72f('0xe'));_0x209c53(_0x45e569['result']['message']);}})['catch'](function(_0x5768fd){logger[_0xa72f('0x11')](_0xa72f('0xd'),_0x12d5ed,_0x5768fd);_0x5dcf75(_0x5768fd);});});}exports['GetDeskAccount']=function(_0x2aad4d){var _0x3329e8=this;return new Promise(function(_0x5b63ff,_0x414940){return db[_0xa72f('0x14')]['findAll']({'raw':_0x2aad4d[_0xa72f('0x15')]?_0x2aad4d[_0xa72f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2aad4d[_0xa72f('0x15')]?_0x2aad4d[_0xa72f('0x15')][_0xa72f('0x16')]||null:null,'attributes':_0x2aad4d['options']?_0x2aad4d[_0xa72f('0x15')][_0xa72f('0x17')]||null:null,'limit':_0x2aad4d[_0xa72f('0x15')]?_0x2aad4d[_0xa72f('0x15')][_0xa72f('0x18')]||null:null,'include':_0x2aad4d[_0xa72f('0x15')]?_0x2aad4d[_0xa72f('0x15')][_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x2aad4d['options'][_0xa72f('0x19')],function(_0x3f5adb){return{'model':db[_0x3f5adb['model']],'as':_0x3f5adb['as'],'attributes':_0x3f5adb[_0xa72f('0x17')],'include':_0x3f5adb[_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x3f5adb[_0xa72f('0x19')],function(_0x249255){return{'model':db[_0x249255['model']],'as':_0x249255['as'],'attributes':_0x249255[_0xa72f('0x17')],'include':_0x249255[_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x249255[_0xa72f('0x19')],function(_0x3b17b4){return{'model':db[_0x3b17b4[_0xa72f('0x1b')]],'as':_0x3b17b4['as'],'attributes':_0x3b17b4[_0xa72f('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa72f('0xb')](function(_0x5eea4e){logger[_0xa72f('0xc')]('GetDeskAccount',_0x2aad4d);logger[_0xa72f('0xf')](_0xa72f('0x1c'),_0x2aad4d,JSON[_0xa72f('0x10')](_0x5eea4e));_0x5b63ff(_0x5eea4e);})[_0xa72f('0x1d')](function(_0x4d150f){logger[_0xa72f('0x11')]('GetDeskAccount',_0x4d150f['message'],_0x2aad4d);_0x414940(_0x3329e8['error'](0x1f4,_0x4d150f[_0xa72f('0x13')]));});});};exports[_0xa72f('0x1e')]=function(_0x4f1aa5){var _0x5c1a7b=this;return new Promise(function(_0x1b9284,_0x1624fc){return db[_0xa72f('0x14')][_0xa72f('0x1f')]({'raw':_0x4f1aa5[_0xa72f('0x15')]?_0x4f1aa5['options'][_0xa72f('0x20')]===undefined?!![]:![]:!![],'where':_0x4f1aa5[_0xa72f('0x15')]?_0x4f1aa5[_0xa72f('0x15')]['where']||null:null,'attributes':_0x4f1aa5[_0xa72f('0x15')]?_0x4f1aa5[_0xa72f('0x15')][_0xa72f('0x17')]||null:null,'include':_0x4f1aa5[_0xa72f('0x15')]?_0x4f1aa5[_0xa72f('0x15')][_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x4f1aa5[_0xa72f('0x15')][_0xa72f('0x19')],function(_0x41dd9b){return{'model':db[_0x41dd9b['model']],'as':_0x41dd9b['as'],'attributes':_0x41dd9b[_0xa72f('0x17')],'include':_0x41dd9b[_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x41dd9b[_0xa72f('0x19')],function(_0x32d24a){return{'model':db[_0x32d24a['model']],'as':_0x32d24a['as'],'attributes':_0x32d24a[_0xa72f('0x17')],'include':_0x32d24a[_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x32d24a[_0xa72f('0x19')],function(_0x20f15d){return{'model':db[_0x20f15d['model']],'as':_0x20f15d['as'],'attributes':_0x20f15d[_0xa72f('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3240dd){logger['info'](_0xa72f('0x1e'),_0x4f1aa5);logger[_0xa72f('0xf')]('ShowDeskAccount',_0x4f1aa5,JSON[_0xa72f('0x10')](_0x3240dd));_0x1b9284(_0x3240dd);})['catch'](function(_0x2e423e){logger[_0xa72f('0x11')]('ShowDeskAccount',_0x2e423e[_0xa72f('0x13')],_0x4f1aa5);_0x1624fc(_0x5c1a7b[_0xa72f('0x11')](0x1f4,_0x2e423e[_0xa72f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 66b4161..5ca5e96 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 _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x11d7d3,_0x54a7a0){var _0x480a5f=function(_0x69725d){while(--_0x69725d){_0x11d7d3['push'](_0x11d7d3['shift']());}};_0x480a5f(++_0x54a7a0);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x28f814,_0x1c61e1){var _0x4b39b1=function(_0x17323d){while(--_0x17323d){_0x28f814['push'](_0x28f814['shift']());}};_0x4b39b1(++_0x1c61e1);}(_0x7217,0x19e));var _0x7721=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7217[_0x1c546c];return _0x2cc384;};'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['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 1be8970..f365a12 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 _0xc090=['exports','STRING','sequelize'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xc090,0x1e5));var _0x0c09=function(_0x4da8ad,_0xf16c52){_0x4da8ad=_0x4da8ad-0x0;var _0x974c7d=_0xc090[_0x4da8ad];return _0x974c7d;};'use strict';var Sequelize=require(_0x0c09('0x0'));module[_0x0c09('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0c09('0x2')]}}; \ No newline at end of file +var _0x5a03=['sequelize','exports','STRING'];(function(_0x428f32,_0xba79ad){var _0x9e6f89=function(_0x5cf6c8){while(--_0x5cf6c8){_0x428f32['push'](_0x428f32['shift']());}};_0x9e6f89(++_0xba79ad);}(_0x5a03,0x1d1));var _0x35a0=function(_0x503162,_0x25ea26){_0x503162=_0x503162-0x0;var _0x23495d=_0x5a03[_0x503162];return _0x23495d;};'use strict';var Sequelize=require(_0x35a0('0x0'));module[_0x35a0('0x1')]={'name':{'type':Sequelize[_0x35a0('0x2')]},'description':{'type':Sequelize[_0x35a0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 0b44334..055b257 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 _0x4696=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','findOne','DeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x5635dd,_0x553f61){var _0x529070=function(_0x6160d){while(--_0x6160d){_0x5635dd['push'](_0x5635dd['shift']());}};_0x529070(++_0x553f61);}(_0x4696,0x1c9));var _0x6469=function(_0x1c9b46,_0x507d41){_0x1c9b46=_0x1c9b46-0x0;var _0x2d199c=_0x4696[_0x1c9b46];return _0x2d199c;};'use strict';var emlformat=require(_0x6469('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6469('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6469('0x2'));var moment=require(_0x6469('0x3'));var BPromise=require(_0x6469('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6469('0x5'));var sox=require(_0x6469('0x6'));var csv=require('to-csv');var ejs=require(_0x6469('0x7'));var fs=require('fs');var fs_extra=require(_0x6469('0x8'));var _=require(_0x6469('0x9'));var squel=require(_0x6469('0xa'));var crypto=require('crypto');var jsforce=require(_0x6469('0xb'));var deskjs=require(_0x6469('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6469('0xd'));var Redis=require(_0x6469('0xe'));var authService=require(_0x6469('0xf'));var qs=require(_0x6469('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6469('0x11'));var logger=require('../../config/logger')(_0x6469('0x12'));var utils=require(_0x6469('0x13'));var config=require(_0x6469('0x14'));var licenseUtil=require(_0x6469('0x15'));var db=require(_0x6469('0x16'))['db'];function respondWithStatusCode(_0x836d42,_0x5d0b54){_0x5d0b54=_0x5d0b54||0xcc;return function(_0x4e4577){if(_0x4e4577){return _0x836d42[_0x6469('0x17')](_0x5d0b54);}return _0x836d42[_0x6469('0x18')](_0x5d0b54)[_0x6469('0x19')]();};}function respondWithResult(_0x80f51,_0x33c9bb){_0x33c9bb=_0x33c9bb||0xc8;return function(_0x346719){if(_0x346719){return _0x80f51['status'](_0x33c9bb)[_0x6469('0x1a')](_0x346719);}};}function respondWithFilteredResult(_0x1ff916,_0x3f88df){return function(_0x6c8097){if(_0x6c8097){var _0x5ed5a4=typeof _0x3f88df[_0x6469('0x1b')]===_0x6469('0x1c')&&typeof _0x3f88df['limit']===_0x6469('0x1c');var _0x84c6df=_0x6c8097[_0x6469('0x1d')];var _0xe6aa36=_0x5ed5a4?0x0:_0x3f88df[_0x6469('0x1b')];var _0x2de6f8=_0x5ed5a4?_0x6c8097['count']:_0x3f88df['offset']+_0x3f88df[_0x6469('0x1e')];var _0x263210;if(_0x2de6f8>=_0x84c6df){_0x2de6f8=_0x84c6df;_0x263210=0xc8;}else{_0x263210=0xce;}_0x1ff916['status'](_0x263210);return _0x1ff916[_0x6469('0x1f')]('Content-Range',_0xe6aa36+'-'+_0x2de6f8+'/'+_0x84c6df)[_0x6469('0x1a')](_0x6c8097);}return null;};}function patchUpdates(_0x2bdf93){return function(_0x3a8668){try{jsonpatch[_0x6469('0x20')](_0x3a8668,_0x2bdf93,!![]);}catch(_0x14a90b){return BPromise['reject'](_0x14a90b);}return _0x3a8668[_0x6469('0x21')]();};}function saveUpdates(_0x4990d1,_0x5c39ad){return function(_0x49a2e9){if(_0x49a2e9){return _0x49a2e9[_0x6469('0x22')](_0x4990d1)[_0x6469('0x23')](function(_0x2b5485){return _0x2b5485;});}return null;};}function removeEntity(_0x4ae00f,_0x5d9a8b){return function(_0x59f023){if(_0x59f023){return _0x59f023['destroy']()[_0x6469('0x23')](function(){_0x4ae00f[_0x6469('0x18')](0xcc)[_0x6469('0x19')]();});}};}function handleEntityNotFound(_0x4d7b9c,_0x33aeaf){return function(_0xf67874){if(!_0xf67874){_0x4d7b9c[_0x6469('0x17')](0x194);}return _0xf67874;};}function handleError(_0x2aeace,_0x7aca91){_0x7aca91=_0x7aca91||0x1f4;return function(_0x1ba314){logger[_0x6469('0x24')](_0x1ba314['stack']);if(_0x1ba314[_0x6469('0x25')]){delete _0x1ba314[_0x6469('0x25')];}_0x2aeace[_0x6469('0x18')](_0x7aca91)[_0x6469('0x26')](_0x1ba314);};}exports[_0x6469('0x27')]=function(_0xc12e34,_0x41ddec){var _0x12625d={},_0xd6baab={},_0x1b82ea={'count':0x0,'rows':[]};var _0x16ad1d=_[_0x6469('0x28')](db['DeskConfiguration'][_0x6469('0x29')],function(_0x3cdaa4){return{'name':_0x3cdaa4[_0x6469('0x2a')],'type':_0x3cdaa4[_0x6469('0x2b')][_0x6469('0x2c')]};});_0xd6baab[_0x6469('0x2d')]=_['map'](_0x16ad1d,_0x6469('0x25'));_0xd6baab[_0x6469('0x2e')]=_[_0x6469('0x2f')](_0xc12e34['query']);_0xd6baab[_0x6469('0x30')]=_['intersection'](_0xd6baab[_0x6469('0x2d')],_0xd6baab[_0x6469('0x2e')]);_0x12625d[_0x6469('0x31')]=_[_0x6469('0x32')](_0xd6baab[_0x6469('0x2d')],qs[_0x6469('0x33')](_0xc12e34['query'][_0x6469('0x33')]));_0x12625d[_0x6469('0x31')]=_0x12625d[_0x6469('0x31')][_0x6469('0x34')]?_0x12625d['attributes']:_0xd6baab[_0x6469('0x2d')];if(!_0xc12e34[_0x6469('0x2e')][_0x6469('0x35')](_0x6469('0x36'))){_0x12625d[_0x6469('0x1e')]=qs[_0x6469('0x1e')](_0xc12e34[_0x6469('0x2e')][_0x6469('0x1e')]);_0x12625d[_0x6469('0x1b')]=qs[_0x6469('0x1b')](_0xc12e34['query']['offset']);}_0x12625d[_0x6469('0x37')]=qs[_0x6469('0x38')](_0xc12e34[_0x6469('0x2e')]['sort']);_0x12625d[_0x6469('0x39')]=qs[_0x6469('0x30')](_[_0x6469('0x3a')](_0xc12e34[_0x6469('0x2e')],_0xd6baab[_0x6469('0x30')]),_0x16ad1d);if(_0xc12e34[_0x6469('0x2e')][_0x6469('0x3b')]){_0x12625d['where']=_[_0x6469('0x3c')](_0x12625d[_0x6469('0x39')],{'$or':_[_0x6469('0x28')](_0x16ad1d,function(_0x190e09){if(_0x190e09[_0x6469('0x2b')]!==_0x6469('0x3d')){var _0x524c48={};_0x524c48[_0x190e09[_0x6469('0x25')]]={'$like':'%'+_0xc12e34[_0x6469('0x2e')][_0x6469('0x3b')]+'%'};return _0x524c48;}})});}_0x12625d=_['merge']({},_0x12625d,_0xc12e34[_0x6469('0x3e')]);var _0x282824={'where':_0x12625d[_0x6469('0x39')]};return db[_0x6469('0x3f')][_0x6469('0x1d')](_0x282824)[_0x6469('0x23')](function(_0xe2ddea){_0x1b82ea['count']=_0xe2ddea;if(_0xc12e34[_0x6469('0x2e')][_0x6469('0x40')]){_0x12625d[_0x6469('0x41')]=[{'all':!![]}];}return db[_0x6469('0x3f')][_0x6469('0x42')](_0x12625d);})['then'](function(_0x44e900){_0x1b82ea[_0x6469('0x43')]=_0x44e900;return _0x1b82ea;})[_0x6469('0x23')](respondWithFilteredResult(_0x41ddec,_0x12625d))[_0x6469('0x44')](handleError(_0x41ddec,null));};exports[_0x6469('0x45')]=function(_0x22915b,_0x1c38f2){var _0x1d1313={'raw':![],'where':{'id':_0x22915b[_0x6469('0x46')]['id']}},_0x5b7cad={};_0x5b7cad[_0x6469('0x2d')]=_['keys'](db[_0x6469('0x3f')]['rawAttributes']);_0x5b7cad[_0x6469('0x2e')]=_[_0x6469('0x2f')](_0x22915b[_0x6469('0x2e')]);_0x5b7cad[_0x6469('0x30')]=_[_0x6469('0x32')](_0x5b7cad['model'],_0x5b7cad[_0x6469('0x2e')]);_0x1d1313[_0x6469('0x31')]=_['intersection'](_0x5b7cad[_0x6469('0x2d')],qs[_0x6469('0x33')](_0x22915b[_0x6469('0x2e')]['fields']));_0x1d1313['attributes']=_0x1d1313[_0x6469('0x31')][_0x6469('0x34')]?_0x1d1313[_0x6469('0x31')]:_0x5b7cad[_0x6469('0x2d')];if(_0x22915b[_0x6469('0x2e')]['includeAll']){_0x1d1313[_0x6469('0x41')]=[{'all':!![]}];}_0x1d1313=_[_0x6469('0x3c')]({},_0x1d1313,_0x22915b[_0x6469('0x3e')]);return db[_0x6469('0x3f')][_0x6469('0x47')](_0x1d1313)[_0x6469('0x23')](handleEntityNotFound(_0x1c38f2,null))['then'](respondWithResult(_0x1c38f2,null))[_0x6469('0x44')](handleError(_0x1c38f2,null));};exports[_0x6469('0x48')]=function(_0x4bbcd3,_0x58dda8){return db[_0x6469('0x3f')]['create'](_0x4bbcd3[_0x6469('0x49')],{})[_0x6469('0x23')](respondWithResult(_0x58dda8,0xc9))[_0x6469('0x44')](handleError(_0x58dda8,null));};exports[_0x6469('0x22')]=function(_0x33ba69,_0x157091){if(_0x33ba69[_0x6469('0x49')]['id']){delete _0x33ba69[_0x6469('0x49')]['id'];}return db['DeskConfiguration'][_0x6469('0x47')]({'where':{'id':_0x33ba69[_0x6469('0x46')]['id']}})['then'](handleEntityNotFound(_0x157091,null))[_0x6469('0x23')](saveUpdates(_0x33ba69[_0x6469('0x49')],null))[_0x6469('0x23')](respondWithResult(_0x157091,null))[_0x6469('0x44')](handleError(_0x157091,null));};exports[_0x6469('0x4a')]=function(_0x15fd85,_0x1f4bc4){return db[_0x6469('0x3f')][_0x6469('0x47')]({'where':{'id':_0x15fd85[_0x6469('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f4bc4,null))[_0x6469('0x23')](removeEntity(_0x1f4bc4,null))[_0x6469('0x44')](handleError(_0x1f4bc4,null));};exports['getFields']=function(_0x429d1d,_0x1d9839,_0x5ba868){var _0x281ceb={};var _0x29c42b={};var _0x2d16a2;var _0x4cd9e2;return db[_0x6469('0x3f')][_0x6469('0x4b')]({'where':{'id':_0x429d1d[_0x6469('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d9839,null))['then'](function(_0x54a791){if(_0x54a791){_0x2d16a2=_0x54a791;_0x29c42b['model']=_[_0x6469('0x2f')](db[_0x6469('0x4c')]['rawAttributes']);_0x29c42b['query']=_['keys'](_0x429d1d[_0x6469('0x2e')]);_0x29c42b['filters']=_[_0x6469('0x32')](_0x29c42b['model'],_0x29c42b[_0x6469('0x2e')]);_0x281ceb['attributes']=_['intersection'](_0x29c42b[_0x6469('0x2d')],qs[_0x6469('0x33')](_0x429d1d[_0x6469('0x2e')][_0x6469('0x33')]));_0x281ceb[_0x6469('0x31')]=_0x281ceb[_0x6469('0x31')]['length']?_0x281ceb[_0x6469('0x31')]:_0x29c42b[_0x6469('0x2d')];_0x281ceb[_0x6469('0x37')]=qs[_0x6469('0x38')](_0x429d1d['query']['sort']);_0x281ceb[_0x6469('0x39')]=qs['filters'](_[_0x6469('0x3a')](_0x429d1d[_0x6469('0x2e')],_0x29c42b[_0x6469('0x30')]));if(_0x429d1d['query'][_0x6469('0x3b')]){_0x281ceb[_0x6469('0x39')]=_[_0x6469('0x3c')](_0x281ceb[_0x6469('0x39')],{'$or':_[_0x6469('0x28')](_0x281ceb[_0x6469('0x31')],function(_0x3560ac){var _0x43f9ee={};_0x43f9ee[_0x3560ac]={'$like':'%'+_0x429d1d[_0x6469('0x2e')]['filter']+'%'};return _0x43f9ee;})});}_0x281ceb=_['merge']({},_0x281ceb,_0x429d1d['options']);return _0x2d16a2[_0x6469('0x4d')](_0x281ceb);}})['then'](function(_0x3f058d){if(_0x3f058d){_0x4cd9e2=_0x3f058d[_0x6469('0x34')];if(!_0x429d1d['query'][_0x6469('0x35')](_0x6469('0x36'))){_0x281ceb[_0x6469('0x1e')]=qs[_0x6469('0x1e')](_0x429d1d[_0x6469('0x2e')][_0x6469('0x1e')]);_0x281ceb[_0x6469('0x1b')]=qs['offset'](_0x429d1d['query']['offset']);}return _0x2d16a2[_0x6469('0x4d')](_0x281ceb);}})[_0x6469('0x23')](function(_0x3f33fc){if(_0x3f33fc){return _0x3f33fc?{'count':_0x4cd9e2,'rows':_0x3f33fc}:null;}})[_0x6469('0x23')](respondWithResult(_0x1d9839,null))[_0x6469('0x44')](handleError(_0x1d9839,null));};exports[_0x6469('0x4e')]=function(_0xc93e43,_0x479c7d,_0x2ec0d1){var _0x23a000={};var _0x3a5c9f={};var _0x25daf0;var _0x1ac89b;return db[_0x6469('0x3f')][_0x6469('0x4b')]({'where':{'id':_0xc93e43[_0x6469('0x46')]['id']}})[_0x6469('0x23')](handleEntityNotFound(_0x479c7d,null))['then'](function(_0x4f9ca4){if(_0x4f9ca4){_0x25daf0=_0x4f9ca4;_0x3a5c9f['model']=_[_0x6469('0x2f')](db[_0x6469('0x4c')][_0x6469('0x29')]);_0x3a5c9f[_0x6469('0x2e')]=_[_0x6469('0x2f')](_0xc93e43[_0x6469('0x2e')]);_0x3a5c9f[_0x6469('0x30')]=_[_0x6469('0x32')](_0x3a5c9f[_0x6469('0x2d')],_0x3a5c9f[_0x6469('0x2e')]);_0x23a000['attributes']=_[_0x6469('0x32')](_0x3a5c9f[_0x6469('0x2d')],qs[_0x6469('0x33')](_0xc93e43['query'][_0x6469('0x33')]));_0x23a000[_0x6469('0x31')]=_0x23a000[_0x6469('0x31')][_0x6469('0x34')]?_0x23a000['attributes']:_0x3a5c9f[_0x6469('0x2d')];_0x23a000[_0x6469('0x37')]=qs[_0x6469('0x38')](_0xc93e43['query'][_0x6469('0x38')]);_0x23a000[_0x6469('0x39')]=qs[_0x6469('0x30')](_[_0x6469('0x3a')](_0xc93e43[_0x6469('0x2e')],_0x3a5c9f[_0x6469('0x30')]));if(_0xc93e43[_0x6469('0x2e')][_0x6469('0x3b')]){_0x23a000[_0x6469('0x39')]=_[_0x6469('0x3c')](_0x23a000['where'],{'$or':_['map'](_0x23a000[_0x6469('0x31')],function(_0x127ebf){var _0x3f71a1={};_0x3f71a1[_0x127ebf]={'$like':'%'+_0xc93e43[_0x6469('0x2e')]['filter']+'%'};return _0x3f71a1;})});}_0x23a000=_[_0x6469('0x3c')]({},_0x23a000,_0xc93e43[_0x6469('0x3e')]);return _0x25daf0[_0x6469('0x4e')](_0x23a000);}})['then'](function(_0x43c963){if(_0x43c963){_0x1ac89b=_0x43c963['length'];if(!_0xc93e43['query'][_0x6469('0x35')](_0x6469('0x36'))){_0x23a000[_0x6469('0x1e')]=qs[_0x6469('0x1e')](_0xc93e43[_0x6469('0x2e')][_0x6469('0x1e')]);_0x23a000[_0x6469('0x1b')]=qs['offset'](_0xc93e43[_0x6469('0x2e')][_0x6469('0x1b')]);}return _0x25daf0[_0x6469('0x4e')](_0x23a000);}})['then'](function(_0x41639e){if(_0x41639e){return _0x41639e?{'count':_0x1ac89b,'rows':_0x41639e}:null;}})[_0x6469('0x23')](respondWithResult(_0x479c7d,null))[_0x6469('0x44')](handleError(_0x479c7d,null));};exports[_0x6469('0x4f')]=function(_0x4a7301,_0x4a80db,_0x45ebd9){var _0x28e794={};var _0x5b46b0={};var _0x90209d;var _0x367224;return db[_0x6469('0x3f')][_0x6469('0x4b')]({'where':{'id':_0x4a7301[_0x6469('0x46')]['id']}})[_0x6469('0x23')](handleEntityNotFound(_0x4a80db,null))['then'](function(_0x5a69cc){if(_0x5a69cc){_0x90209d=_0x5a69cc;_0x5b46b0[_0x6469('0x2d')]=_[_0x6469('0x2f')](db[_0x6469('0x4c')][_0x6469('0x29')]);_0x5b46b0[_0x6469('0x2e')]=_[_0x6469('0x2f')](_0x4a7301[_0x6469('0x2e')]);_0x5b46b0['filters']=_['intersection'](_0x5b46b0[_0x6469('0x2d')],_0x5b46b0['query']);_0x28e794[_0x6469('0x31')]=_[_0x6469('0x32')](_0x5b46b0[_0x6469('0x2d')],qs[_0x6469('0x33')](_0x4a7301['query'][_0x6469('0x33')]));_0x28e794[_0x6469('0x31')]=_0x28e794[_0x6469('0x31')][_0x6469('0x34')]?_0x28e794[_0x6469('0x31')]:_0x5b46b0[_0x6469('0x2d')];_0x28e794[_0x6469('0x37')]=qs[_0x6469('0x38')](_0x4a7301['query']['sort']);_0x28e794[_0x6469('0x39')]=qs['filters'](_['pick'](_0x4a7301[_0x6469('0x2e')],_0x5b46b0[_0x6469('0x30')]));if(_0x4a7301['query']['filter']){_0x28e794['where']=_[_0x6469('0x3c')](_0x28e794[_0x6469('0x39')],{'$or':_[_0x6469('0x28')](_0x28e794[_0x6469('0x31')],function(_0x1fec92){var _0x506343={};_0x506343[_0x1fec92]={'$like':'%'+_0x4a7301[_0x6469('0x2e')][_0x6469('0x3b')]+'%'};return _0x506343;})});}_0x28e794=_[_0x6469('0x3c')]({},_0x28e794,_0x4a7301[_0x6469('0x3e')]);return _0x90209d[_0x6469('0x4f')](_0x28e794);}})[_0x6469('0x23')](function(_0x587703){if(_0x587703){_0x367224=_0x587703['length'];if(!_0x4a7301[_0x6469('0x2e')][_0x6469('0x35')](_0x6469('0x36'))){_0x28e794[_0x6469('0x1e')]=qs[_0x6469('0x1e')](_0x4a7301[_0x6469('0x2e')][_0x6469('0x1e')]);_0x28e794[_0x6469('0x1b')]=qs[_0x6469('0x1b')](_0x4a7301['query']['offset']);}return _0x90209d[_0x6469('0x4f')](_0x28e794);}})[_0x6469('0x23')](function(_0x895708){if(_0x895708){return _0x895708?{'count':_0x367224,'rows':_0x895708}:null;}})[_0x6469('0x23')](respondWithResult(_0x4a80db,null))['catch'](handleError(_0x4a80db,null));};exports[_0x6469('0x50')]=function(_0x104ff6,_0x4de137,_0x4236e8){var _0x2c7e94={};var _0x17c3db={};var _0x3bf98f;var _0xac55d5;return db[_0x6469('0x3f')]['findOne']({'where':{'id':_0x104ff6['params']['id']}})[_0x6469('0x23')](handleEntityNotFound(_0x4de137,null))['then'](function(_0x5e57f9){if(_0x5e57f9){_0x3bf98f=_0x5e57f9;_0x17c3db[_0x6469('0x2d')]=_[_0x6469('0x2f')](db[_0x6469('0x51')][_0x6469('0x29')]);_0x17c3db[_0x6469('0x2e')]=_[_0x6469('0x2f')](_0x104ff6[_0x6469('0x2e')]);_0x17c3db[_0x6469('0x30')]=_[_0x6469('0x32')](_0x17c3db[_0x6469('0x2d')],_0x17c3db[_0x6469('0x2e')]);_0x2c7e94[_0x6469('0x31')]=_[_0x6469('0x32')](_0x17c3db['model'],qs[_0x6469('0x33')](_0x104ff6['query'][_0x6469('0x33')]));_0x2c7e94[_0x6469('0x31')]=_0x2c7e94[_0x6469('0x31')]['length']?_0x2c7e94[_0x6469('0x31')]:_0x17c3db[_0x6469('0x2d')];_0x2c7e94['order']=qs[_0x6469('0x38')](_0x104ff6[_0x6469('0x2e')][_0x6469('0x38')]);_0x2c7e94[_0x6469('0x39')]=qs[_0x6469('0x30')](_[_0x6469('0x3a')](_0x104ff6[_0x6469('0x2e')],_0x17c3db[_0x6469('0x30')]));if(_0x104ff6[_0x6469('0x2e')][_0x6469('0x3b')]){_0x2c7e94[_0x6469('0x39')]=_[_0x6469('0x3c')](_0x2c7e94[_0x6469('0x39')],{'$or':_[_0x6469('0x28')](_0x2c7e94[_0x6469('0x31')],function(_0x340bf6){var _0x354c4c={};_0x354c4c[_0x340bf6]={'$like':'%'+_0x104ff6[_0x6469('0x2e')][_0x6469('0x3b')]+'%'};return _0x354c4c;})});}_0x2c7e94=_['merge']({},_0x2c7e94,_0x104ff6[_0x6469('0x3e')]);return _0x3bf98f[_0x6469('0x50')](_0x2c7e94);}})[_0x6469('0x23')](function(_0x1dc2b1){if(_0x1dc2b1){_0xac55d5=_0x1dc2b1['length'];if(!_0x104ff6[_0x6469('0x2e')]['hasOwnProperty'](_0x6469('0x36'))){_0x2c7e94[_0x6469('0x1e')]=qs[_0x6469('0x1e')](_0x104ff6[_0x6469('0x2e')][_0x6469('0x1e')]);_0x2c7e94[_0x6469('0x1b')]=qs[_0x6469('0x1b')](_0x104ff6[_0x6469('0x2e')][_0x6469('0x1b')]);}return _0x3bf98f[_0x6469('0x50')](_0x2c7e94);}})['then'](function(_0x394e71){if(_0x394e71){return _0x394e71?{'count':_0xac55d5,'rows':_0x394e71}:null;}})[_0x6469('0x23')](respondWithResult(_0x4de137,null))[_0x6469('0x44')](handleError(_0x4de137,null));};exports[_0x6469('0x52')]=function(_0x5467a6,_0x1c19e8,_0x20c904){if(_0x5467a6[_0x6469('0x49')]['id']){delete _0x5467a6['body']['id'];}return db[_0x6469('0x3f')][_0x6469('0x4b')]({'where':{'id':_0x5467a6[_0x6469('0x46')]['id']}})[_0x6469('0x23')](handleEntityNotFound(_0x1c19e8,null))[_0x6469('0x23')](function(_0x5b49ed){if(_0x5b49ed){return _0x5b49ed[_0x6469('0x52')](_0x5467a6[_0x6469('0x49')][_0x6469('0x53')]||[]);}return null;})[_0x6469('0x23')](respondWithResult(_0x1c19e8,null))[_0x6469('0x44')](handleError(_0x1c19e8,null));}; \ No newline at end of file +var _0xfbde=['show','params','find','create','body','catch','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows'];(function(_0x6075dd,_0x5e63dc){var _0xba97b8=function(_0x4263cc){while(--_0x4263cc){_0x6075dd['push'](_0x6075dd['shift']());}};_0xba97b8(++_0x5e63dc);}(_0xfbde,0x65));var _0xefbd=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xfbde[_0x468b0f];return _0x3e74d9;};'use strict';var emlformat=require(_0xefbd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xefbd('0x1'));var jsonpatch=require(_0xefbd('0x2'));var rp=require(_0xefbd('0x3'));var moment=require(_0xefbd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xefbd('0x5'));var util=require(_0xefbd('0x6'));var path=require('path');var sox=require(_0xefbd('0x7'));var csv=require(_0xefbd('0x8'));var ejs=require(_0xefbd('0x9'));var fs=require('fs');var fs_extra=require(_0xefbd('0xa'));var _=require(_0xefbd('0xb'));var squel=require(_0xefbd('0xc'));var crypto=require(_0xefbd('0xd'));var jsforce=require(_0xefbd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xefbd('0x8'));var querystring=require(_0xefbd('0xf'));var Papa=require('papaparse');var Redis=require(_0xefbd('0x10'));var authService=require(_0xefbd('0x11'));var qs=require(_0xefbd('0x12'));var as=require(_0xefbd('0x13'));var hardwareService=require(_0xefbd('0x14'));var logger=require(_0xefbd('0x15'))('api');var utils=require(_0xefbd('0x16'));var config=require(_0xefbd('0x17'));var licenseUtil=require(_0xefbd('0x18'));var db=require(_0xefbd('0x19'))['db'];function respondWithStatusCode(_0x107c91,_0x5b9fce){_0x5b9fce=_0x5b9fce||0xcc;return function(_0x473f59){if(_0x473f59){return _0x107c91['sendStatus'](_0x5b9fce);}return _0x107c91[_0xefbd('0x1a')](_0x5b9fce)['end']();};}function respondWithResult(_0x4c244f,_0x115923){_0x115923=_0x115923||0xc8;return function(_0x274fcb){if(_0x274fcb){return _0x4c244f[_0xefbd('0x1a')](_0x115923)[_0xefbd('0x1b')](_0x274fcb);}};}function respondWithFilteredResult(_0x468978,_0x388eb9){return function(_0x2092f2){if(_0x2092f2){var _0x102707=typeof _0x388eb9['offset']==='undefined'&&typeof _0x388eb9[_0xefbd('0x1c')]===_0xefbd('0x1d');var _0x99eee9=_0x2092f2['count'];var _0x2af426=_0x102707?0x0:_0x388eb9[_0xefbd('0x1e')];var _0x15d6af=_0x102707?_0x2092f2[_0xefbd('0x1f')]:_0x388eb9['offset']+_0x388eb9[_0xefbd('0x1c')];var _0x5c3af0;if(_0x15d6af>=_0x99eee9){_0x15d6af=_0x99eee9;_0x5c3af0=0xc8;}else{_0x5c3af0=0xce;}_0x468978[_0xefbd('0x1a')](_0x5c3af0);return _0x468978[_0xefbd('0x20')](_0xefbd('0x21'),_0x2af426+'-'+_0x15d6af+'/'+_0x99eee9)[_0xefbd('0x1b')](_0x2092f2);}return null;};}function patchUpdates(_0x2e634c){return function(_0x2103f0){try{jsonpatch[_0xefbd('0x22')](_0x2103f0,_0x2e634c,!![]);}catch(_0x5492ce){return BPromise[_0xefbd('0x23')](_0x5492ce);}return _0x2103f0['save']();};}function saveUpdates(_0x523a0f,_0x5673d9){return function(_0x397ed0){if(_0x397ed0){return _0x397ed0[_0xefbd('0x24')](_0x523a0f)[_0xefbd('0x25')](function(_0x5339f6){return _0x5339f6;});}return null;};}function removeEntity(_0x3a1bc4,_0xeb1042){return function(_0x498203){if(_0x498203){return _0x498203[_0xefbd('0x26')]()['then'](function(){_0x3a1bc4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x203a13,_0x4655ba){return function(_0x2b9597){if(!_0x2b9597){_0x203a13[_0xefbd('0x27')](0x194);}return _0x2b9597;};}function handleError(_0x26f010,_0x51d12f){_0x51d12f=_0x51d12f||0x1f4;return function(_0x5f8dba){logger[_0xefbd('0x28')](_0x5f8dba[_0xefbd('0x29')]);if(_0x5f8dba[_0xefbd('0x2a')]){delete _0x5f8dba['name'];}_0x26f010[_0xefbd('0x1a')](_0x51d12f)['send'](_0x5f8dba);};}exports[_0xefbd('0x2b')]=function(_0x41d28e,_0x2e68ed){var _0x441bd4={},_0x45ab78={},_0x1338aa={'count':0x0,'rows':[]};var _0x4ec6be=_[_0xefbd('0x2c')](db[_0xefbd('0x2d')][_0xefbd('0x2e')],function(_0x4aebfb){return{'name':_0x4aebfb[_0xefbd('0x2f')],'type':_0x4aebfb[_0xefbd('0x30')][_0xefbd('0x31')]};});_0x45ab78['model']=_[_0xefbd('0x2c')](_0x4ec6be,_0xefbd('0x2a'));_0x45ab78['query']=_[_0xefbd('0x32')](_0x41d28e[_0xefbd('0x33')]);_0x45ab78[_0xefbd('0x34')]=_[_0xefbd('0x35')](_0x45ab78[_0xefbd('0x36')],_0x45ab78[_0xefbd('0x33')]);_0x441bd4['attributes']=_['intersection'](_0x45ab78['model'],qs[_0xefbd('0x37')](_0x41d28e[_0xefbd('0x33')][_0xefbd('0x37')]));_0x441bd4[_0xefbd('0x38')]=_0x441bd4[_0xefbd('0x38')][_0xefbd('0x39')]?_0x441bd4[_0xefbd('0x38')]:_0x45ab78[_0xefbd('0x36')];if(!_0x41d28e[_0xefbd('0x33')][_0xefbd('0x3a')](_0xefbd('0x3b'))){_0x441bd4[_0xefbd('0x1c')]=qs['limit'](_0x41d28e[_0xefbd('0x33')][_0xefbd('0x1c')]);_0x441bd4[_0xefbd('0x1e')]=qs[_0xefbd('0x1e')](_0x41d28e[_0xefbd('0x33')][_0xefbd('0x1e')]);}_0x441bd4[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x41d28e[_0xefbd('0x33')][_0xefbd('0x3d')]);_0x441bd4[_0xefbd('0x3e')]=qs['filters'](_[_0xefbd('0x3f')](_0x41d28e['query'],_0x45ab78['filters']),_0x4ec6be);if(_0x41d28e['query'][_0xefbd('0x40')]){_0x441bd4[_0xefbd('0x3e')]=_['merge'](_0x441bd4['where'],{'$or':_[_0xefbd('0x2c')](_0x4ec6be,function(_0x5504eb){if(_0x5504eb[_0xefbd('0x30')]!=='VIRTUAL'){var _0x3e63b0={};_0x3e63b0[_0x5504eb[_0xefbd('0x2a')]]={'$like':'%'+_0x41d28e[_0xefbd('0x33')][_0xefbd('0x40')]+'%'};return _0x3e63b0;}})});}_0x441bd4=_[_0xefbd('0x41')]({},_0x441bd4,_0x41d28e[_0xefbd('0x42')]);var _0x3707a9={'where':_0x441bd4['where']};return db[_0xefbd('0x2d')][_0xefbd('0x1f')](_0x3707a9)[_0xefbd('0x25')](function(_0x35e39a){_0x1338aa[_0xefbd('0x1f')]=_0x35e39a;if(_0x41d28e[_0xefbd('0x33')][_0xefbd('0x43')]){_0x441bd4[_0xefbd('0x44')]=[{'all':!![]}];}return db[_0xefbd('0x2d')][_0xefbd('0x45')](_0x441bd4);})[_0xefbd('0x25')](function(_0x3b5288){_0x1338aa[_0xefbd('0x46')]=_0x3b5288;return _0x1338aa;})['then'](respondWithFilteredResult(_0x2e68ed,_0x441bd4))['catch'](handleError(_0x2e68ed,null));};exports[_0xefbd('0x47')]=function(_0x7efca1,_0x2ce4cc){var _0x37f68b={'raw':![],'where':{'id':_0x7efca1[_0xefbd('0x48')]['id']}},_0x408cf7={};_0x408cf7[_0xefbd('0x36')]=_['keys'](db[_0xefbd('0x2d')][_0xefbd('0x2e')]);_0x408cf7[_0xefbd('0x33')]=_[_0xefbd('0x32')](_0x7efca1[_0xefbd('0x33')]);_0x408cf7['filters']=_[_0xefbd('0x35')](_0x408cf7[_0xefbd('0x36')],_0x408cf7['query']);_0x37f68b[_0xefbd('0x38')]=_[_0xefbd('0x35')](_0x408cf7['model'],qs[_0xefbd('0x37')](_0x7efca1['query'][_0xefbd('0x37')]));_0x37f68b[_0xefbd('0x38')]=_0x37f68b[_0xefbd('0x38')][_0xefbd('0x39')]?_0x37f68b[_0xefbd('0x38')]:_0x408cf7[_0xefbd('0x36')];if(_0x7efca1[_0xefbd('0x33')][_0xefbd('0x43')]){_0x37f68b[_0xefbd('0x44')]=[{'all':!![]}];}_0x37f68b=_[_0xefbd('0x41')]({},_0x37f68b,_0x7efca1[_0xefbd('0x42')]);return db['DeskConfiguration'][_0xefbd('0x49')](_0x37f68b)[_0xefbd('0x25')](handleEntityNotFound(_0x2ce4cc,null))[_0xefbd('0x25')](respondWithResult(_0x2ce4cc,null))['catch'](handleError(_0x2ce4cc,null));};exports[_0xefbd('0x4a')]=function(_0x4cc963,_0x3b1d11){return db[_0xefbd('0x2d')]['create'](_0x4cc963[_0xefbd('0x4b')],{})[_0xefbd('0x25')](respondWithResult(_0x3b1d11,0xc9))[_0xefbd('0x4c')](handleError(_0x3b1d11,null));};exports[_0xefbd('0x24')]=function(_0x2dc4c7,_0x42e44f){if(_0x2dc4c7[_0xefbd('0x4b')]['id']){delete _0x2dc4c7[_0xefbd('0x4b')]['id'];}return db['DeskConfiguration'][_0xefbd('0x49')]({'where':{'id':_0x2dc4c7[_0xefbd('0x48')]['id']}})[_0xefbd('0x25')](handleEntityNotFound(_0x42e44f,null))[_0xefbd('0x25')](saveUpdates(_0x2dc4c7[_0xefbd('0x4b')],null))['then'](respondWithResult(_0x42e44f,null))['catch'](handleError(_0x42e44f,null));};exports[_0xefbd('0x26')]=function(_0x5b2c21,_0x5c37e3){return db[_0xefbd('0x2d')]['find']({'where':{'id':_0x5b2c21[_0xefbd('0x48')]['id']}})[_0xefbd('0x25')](handleEntityNotFound(_0x5c37e3,null))['then'](removeEntity(_0x5c37e3,null))[_0xefbd('0x4c')](handleError(_0x5c37e3,null));};exports[_0xefbd('0x4d')]=function(_0x43c192,_0x2365e9,_0x3bddfe){var _0x101a2b={};var _0x38795c={};var _0x42c8ba;var _0x281401;return db[_0xefbd('0x2d')][_0xefbd('0x4e')]({'where':{'id':_0x43c192['params']['id']}})[_0xefbd('0x25')](handleEntityNotFound(_0x2365e9,null))[_0xefbd('0x25')](function(_0x3e2f37){if(_0x3e2f37){_0x42c8ba=_0x3e2f37;_0x38795c[_0xefbd('0x36')]=_[_0xefbd('0x32')](db[_0xefbd('0x4f')]['rawAttributes']);_0x38795c[_0xefbd('0x33')]=_[_0xefbd('0x32')](_0x43c192[_0xefbd('0x33')]);_0x38795c[_0xefbd('0x34')]=_[_0xefbd('0x35')](_0x38795c['model'],_0x38795c[_0xefbd('0x33')]);_0x101a2b['attributes']=_[_0xefbd('0x35')](_0x38795c[_0xefbd('0x36')],qs[_0xefbd('0x37')](_0x43c192[_0xefbd('0x33')][_0xefbd('0x37')]));_0x101a2b['attributes']=_0x101a2b[_0xefbd('0x38')]['length']?_0x101a2b[_0xefbd('0x38')]:_0x38795c[_0xefbd('0x36')];_0x101a2b[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x43c192[_0xefbd('0x33')]['sort']);_0x101a2b[_0xefbd('0x3e')]=qs[_0xefbd('0x34')](_['pick'](_0x43c192['query'],_0x38795c[_0xefbd('0x34')]));if(_0x43c192['query']['filter']){_0x101a2b['where']=_[_0xefbd('0x41')](_0x101a2b[_0xefbd('0x3e')],{'$or':_[_0xefbd('0x2c')](_0x101a2b[_0xefbd('0x38')],function(_0x3e342b){var _0x2230bc={};_0x2230bc[_0x3e342b]={'$like':'%'+_0x43c192[_0xefbd('0x33')][_0xefbd('0x40')]+'%'};return _0x2230bc;})});}_0x101a2b=_['merge']({},_0x101a2b,_0x43c192[_0xefbd('0x42')]);return _0x42c8ba['getFields'](_0x101a2b);}})[_0xefbd('0x25')](function(_0x4880d7){if(_0x4880d7){_0x281401=_0x4880d7['length'];if(!_0x43c192[_0xefbd('0x33')][_0xefbd('0x3a')](_0xefbd('0x3b'))){_0x101a2b[_0xefbd('0x1c')]=qs[_0xefbd('0x1c')](_0x43c192[_0xefbd('0x33')][_0xefbd('0x1c')]);_0x101a2b['offset']=qs[_0xefbd('0x1e')](_0x43c192[_0xefbd('0x33')][_0xefbd('0x1e')]);}return _0x42c8ba['getFields'](_0x101a2b);}})['then'](function(_0x1e07f4){if(_0x1e07f4){return _0x1e07f4?{'count':_0x281401,'rows':_0x1e07f4}:null;}})[_0xefbd('0x25')](respondWithResult(_0x2365e9,null))[_0xefbd('0x4c')](handleError(_0x2365e9,null));};exports[_0xefbd('0x50')]=function(_0x491323,_0x2686c1,_0x1b7715){var _0x39f57f={};var _0x507dc8={};var _0x2f0829;var _0x388de4;return db[_0xefbd('0x2d')][_0xefbd('0x4e')]({'where':{'id':_0x491323['params']['id']}})['then'](handleEntityNotFound(_0x2686c1,null))[_0xefbd('0x25')](function(_0x21719d){if(_0x21719d){_0x2f0829=_0x21719d;_0x507dc8['model']=_[_0xefbd('0x32')](db['DeskField']['rawAttributes']);_0x507dc8['query']=_[_0xefbd('0x32')](_0x491323['query']);_0x507dc8[_0xefbd('0x34')]=_['intersection'](_0x507dc8[_0xefbd('0x36')],_0x507dc8[_0xefbd('0x33')]);_0x39f57f[_0xefbd('0x38')]=_[_0xefbd('0x35')](_0x507dc8[_0xefbd('0x36')],qs[_0xefbd('0x37')](_0x491323[_0xefbd('0x33')][_0xefbd('0x37')]));_0x39f57f[_0xefbd('0x38')]=_0x39f57f[_0xefbd('0x38')][_0xefbd('0x39')]?_0x39f57f[_0xefbd('0x38')]:_0x507dc8[_0xefbd('0x36')];_0x39f57f[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x491323[_0xefbd('0x33')]['sort']);_0x39f57f['where']=qs[_0xefbd('0x34')](_[_0xefbd('0x3f')](_0x491323['query'],_0x507dc8[_0xefbd('0x34')]));if(_0x491323[_0xefbd('0x33')][_0xefbd('0x40')]){_0x39f57f['where']=_[_0xefbd('0x41')](_0x39f57f[_0xefbd('0x3e')],{'$or':_[_0xefbd('0x2c')](_0x39f57f[_0xefbd('0x38')],function(_0x392d65){var _0x2e0a09={};_0x2e0a09[_0x392d65]={'$like':'%'+_0x491323[_0xefbd('0x33')][_0xefbd('0x40')]+'%'};return _0x2e0a09;})});}_0x39f57f=_['merge']({},_0x39f57f,_0x491323[_0xefbd('0x42')]);return _0x2f0829[_0xefbd('0x50')](_0x39f57f);}})[_0xefbd('0x25')](function(_0xba5e74){if(_0xba5e74){_0x388de4=_0xba5e74[_0xefbd('0x39')];if(!_0x491323[_0xefbd('0x33')][_0xefbd('0x3a')](_0xefbd('0x3b'))){_0x39f57f[_0xefbd('0x1c')]=qs[_0xefbd('0x1c')](_0x491323[_0xefbd('0x33')][_0xefbd('0x1c')]);_0x39f57f[_0xefbd('0x1e')]=qs[_0xefbd('0x1e')](_0x491323[_0xefbd('0x33')][_0xefbd('0x1e')]);}return _0x2f0829[_0xefbd('0x50')](_0x39f57f);}})['then'](function(_0x30b35b){if(_0x30b35b){return _0x30b35b?{'count':_0x388de4,'rows':_0x30b35b}:null;}})[_0xefbd('0x25')](respondWithResult(_0x2686c1,null))[_0xefbd('0x4c')](handleError(_0x2686c1,null));};exports[_0xefbd('0x51')]=function(_0xe64f48,_0x2429bc,_0x109c91){var _0x4dd762={};var _0x202e34={};var _0x169eff;var _0x375b54;return db[_0xefbd('0x2d')][_0xefbd('0x4e')]({'where':{'id':_0xe64f48[_0xefbd('0x48')]['id']}})[_0xefbd('0x25')](handleEntityNotFound(_0x2429bc,null))[_0xefbd('0x25')](function(_0x1a2587){if(_0x1a2587){_0x169eff=_0x1a2587;_0x202e34[_0xefbd('0x36')]=_[_0xefbd('0x32')](db['DeskField'][_0xefbd('0x2e')]);_0x202e34[_0xefbd('0x33')]=_[_0xefbd('0x32')](_0xe64f48[_0xefbd('0x33')]);_0x202e34[_0xefbd('0x34')]=_['intersection'](_0x202e34[_0xefbd('0x36')],_0x202e34[_0xefbd('0x33')]);_0x4dd762[_0xefbd('0x38')]=_[_0xefbd('0x35')](_0x202e34[_0xefbd('0x36')],qs[_0xefbd('0x37')](_0xe64f48[_0xefbd('0x33')][_0xefbd('0x37')]));_0x4dd762['attributes']=_0x4dd762[_0xefbd('0x38')][_0xefbd('0x39')]?_0x4dd762[_0xefbd('0x38')]:_0x202e34[_0xefbd('0x36')];_0x4dd762[_0xefbd('0x3c')]=qs['sort'](_0xe64f48['query'][_0xefbd('0x3d')]);_0x4dd762[_0xefbd('0x3e')]=qs['filters'](_[_0xefbd('0x3f')](_0xe64f48[_0xefbd('0x33')],_0x202e34[_0xefbd('0x34')]));if(_0xe64f48[_0xefbd('0x33')]['filter']){_0x4dd762[_0xefbd('0x3e')]=_['merge'](_0x4dd762['where'],{'$or':_[_0xefbd('0x2c')](_0x4dd762[_0xefbd('0x38')],function(_0x450893){var _0x220098={};_0x220098[_0x450893]={'$like':'%'+_0xe64f48[_0xefbd('0x33')]['filter']+'%'};return _0x220098;})});}_0x4dd762=_['merge']({},_0x4dd762,_0xe64f48[_0xefbd('0x42')]);return _0x169eff[_0xefbd('0x51')](_0x4dd762);}})[_0xefbd('0x25')](function(_0x4ba0b6){if(_0x4ba0b6){_0x375b54=_0x4ba0b6[_0xefbd('0x39')];if(!_0xe64f48['query']['hasOwnProperty'](_0xefbd('0x3b'))){_0x4dd762[_0xefbd('0x1c')]=qs[_0xefbd('0x1c')](_0xe64f48['query'][_0xefbd('0x1c')]);_0x4dd762[_0xefbd('0x1e')]=qs[_0xefbd('0x1e')](_0xe64f48[_0xefbd('0x33')][_0xefbd('0x1e')]);}return _0x169eff[_0xefbd('0x51')](_0x4dd762);}})[_0xefbd('0x25')](function(_0x46fb4a){if(_0x46fb4a){return _0x46fb4a?{'count':_0x375b54,'rows':_0x46fb4a}:null;}})[_0xefbd('0x25')](respondWithResult(_0x2429bc,null))[_0xefbd('0x4c')](handleError(_0x2429bc,null));};exports[_0xefbd('0x52')]=function(_0x5c1b72,_0xd99eab,_0x24e3b7){var _0x22028f={};var _0x48021d={};var _0x5cfa9a;var _0x43ac68;return db[_0xefbd('0x2d')][_0xefbd('0x4e')]({'where':{'id':_0x5c1b72[_0xefbd('0x48')]['id']}})[_0xefbd('0x25')](handleEntityNotFound(_0xd99eab,null))['then'](function(_0x32ea31){if(_0x32ea31){_0x5cfa9a=_0x32ea31;_0x48021d[_0xefbd('0x36')]=_[_0xefbd('0x32')](db[_0xefbd('0x53')]['rawAttributes']);_0x48021d[_0xefbd('0x33')]=_['keys'](_0x5c1b72[_0xefbd('0x33')]);_0x48021d[_0xefbd('0x34')]=_[_0xefbd('0x35')](_0x48021d[_0xefbd('0x36')],_0x48021d['query']);_0x22028f['attributes']=_[_0xefbd('0x35')](_0x48021d[_0xefbd('0x36')],qs[_0xefbd('0x37')](_0x5c1b72['query']['fields']));_0x22028f['attributes']=_0x22028f[_0xefbd('0x38')]['length']?_0x22028f[_0xefbd('0x38')]:_0x48021d[_0xefbd('0x36')];_0x22028f[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x5c1b72[_0xefbd('0x33')][_0xefbd('0x3d')]);_0x22028f['where']=qs[_0xefbd('0x34')](_[_0xefbd('0x3f')](_0x5c1b72[_0xefbd('0x33')],_0x48021d[_0xefbd('0x34')]));if(_0x5c1b72[_0xefbd('0x33')][_0xefbd('0x40')]){_0x22028f['where']=_[_0xefbd('0x41')](_0x22028f[_0xefbd('0x3e')],{'$or':_[_0xefbd('0x2c')](_0x22028f[_0xefbd('0x38')],function(_0x26a6fe){var _0x38e614={};_0x38e614[_0x26a6fe]={'$like':'%'+_0x5c1b72[_0xefbd('0x33')]['filter']+'%'};return _0x38e614;})});}_0x22028f=_[_0xefbd('0x41')]({},_0x22028f,_0x5c1b72[_0xefbd('0x42')]);return _0x5cfa9a[_0xefbd('0x52')](_0x22028f);}})[_0xefbd('0x25')](function(_0x6b42c4){if(_0x6b42c4){_0x43ac68=_0x6b42c4[_0xefbd('0x39')];if(!_0x5c1b72[_0xefbd('0x33')][_0xefbd('0x3a')](_0xefbd('0x3b'))){_0x22028f['limit']=qs['limit'](_0x5c1b72['query'][_0xefbd('0x1c')]);_0x22028f[_0xefbd('0x1e')]=qs[_0xefbd('0x1e')](_0x5c1b72[_0xefbd('0x33')][_0xefbd('0x1e')]);}return _0x5cfa9a[_0xefbd('0x52')](_0x22028f);}})['then'](function(_0x1010c7){if(_0x1010c7){return _0x1010c7?{'count':_0x43ac68,'rows':_0x1010c7}:null;}})[_0xefbd('0x25')](respondWithResult(_0xd99eab,null))[_0xefbd('0x4c')](handleError(_0xd99eab,null));};exports[_0xefbd('0x54')]=function(_0xc2e2db,_0x55b6d3,_0x4ad6ab){if(_0xc2e2db['body']['id']){delete _0xc2e2db['body']['id'];}return db[_0xefbd('0x2d')][_0xefbd('0x4e')]({'where':{'id':_0xc2e2db['params']['id']}})['then'](handleEntityNotFound(_0x55b6d3,null))[_0xefbd('0x25')](function(_0x573da9){if(_0x573da9){return _0x573da9[_0xefbd('0x54')](_0xc2e2db[_0xefbd('0x4b')][_0xefbd('0x55')]||[]);}return null;})[_0xefbd('0x25')](respondWithResult(_0x55b6d3,null))['catch'](handleError(_0x55b6d3,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 6f3d541..a4a2dc5 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 _0x051a=['bluebird','request-promise','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash','util','api'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x051a,0xe3));var _0xa051=function(_0x53c31c,_0x332310){_0x53c31c=_0x53c31c-0x0;var _0x1710d=_0x051a[_0x53c31c];return _0x1710d;};'use strict';var _=require(_0xa051('0x0'));var util=require(_0xa051('0x1'));var logger=require('../../config/logger')(_0xa051('0x2'));var moment=require('moment');var BPromise=require(_0xa051('0x3'));var rp=require(_0xa051('0x4'));var fs=require('fs');var path=require(_0xa051('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa051('0x6'));module[_0xa051('0x7')]=function(_0x78d440,_0x5895d8){return _0x78d440[_0xa051('0x8')](_0xa051('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06b1=['path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','int_desk_configurations','util','../../config/logger','moment','request-promise'];(function(_0x49acee,_0x49c7ab){var _0x18a8f8=function(_0x18fb2a){while(--_0x18fb2a){_0x49acee['push'](_0x49acee['shift']());}};_0x18a8f8(++_0x49c7ab);}(_0x06b1,0x15a));var _0x106b=function(_0x348d75,_0x1bee06){_0x348d75=_0x348d75-0x0;var _0x57893c=_0x06b1[_0x348d75];return _0x57893c;};'use strict';var _=require('lodash');var util=require(_0x106b('0x0'));var logger=require(_0x106b('0x1'))('api');var moment=require(_0x106b('0x2'));var BPromise=require('bluebird');var rp=require(_0x106b('0x3'));var fs=require('fs');var path=require(_0x106b('0x4'));var rimraf=require(_0x106b('0x5'));var config=require(_0x106b('0x6'));var attributes=require(_0x106b('0x7'));module[_0x106b('0x8')]=function(_0x56319b,_0x42df6a){return _0x56319b['define']('DeskConfiguration',attributes,{'tableName':_0x106b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 070e9b0..f02e806 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 _0x4628=['jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xad9d4d,_0x5bf432){var _0x195e72=function(_0x1d2e78){while(--_0x1d2e78){_0xad9d4d['push'](_0xad9d4d['shift']());}};_0x195e72(++_0x5bf432);}(_0x4628,0xd3));var _0x8462=function(_0x56d372,_0x2dbf5d){_0x56d372=_0x56d372-0x0;var _0x3650e5=_0x4628[_0x56d372];return _0x3650e5;};'use strict';var _=require(_0x8462('0x0'));var util=require(_0x8462('0x1'));var moment=require('moment');var BPromise=require(_0x8462('0x2'));var rs=require(_0x8462('0x3'));var fs=require('fs');var Redis=require(_0x8462('0x4'));var db=require(_0x8462('0x5'))['db'];var utils=require(_0x8462('0x6'));var logger=require('../../config/logger')(_0x8462('0x7'));var config=require(_0x8462('0x8'));var jayson=require(_0x8462('0x9'));var client=jayson[_0x8462('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12dad7,_0x4b92a7,_0x162bea){return new BPromise(function(_0x4b987a,_0x314c4c){return client[_0x8462('0xb')](_0x12dad7,_0x162bea)['then'](function(_0x58ec31){logger[_0x8462('0xc')](_0x8462('0xd'),_0x4b92a7,_0x8462('0xe'));logger[_0x8462('0xf')](_0x8462('0x10'),_0x4b92a7,_0x8462('0xe'),JSON['stringify'](_0x58ec31));if(_0x58ec31[_0x8462('0x11')]){if(_0x58ec31[_0x8462('0x11')]['code']===0x1f4){logger[_0x8462('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4b92a7,_0x58ec31['error']['message']);return _0x314c4c(_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);}logger[_0x8462('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4b92a7,_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);return _0x4b987a(_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);}else{logger['info'](_0x8462('0xd'),_0x4b92a7,_0x8462('0xe'));_0x4b987a(_0x58ec31['result'][_0x8462('0x12')]);}})[_0x8462('0x13')](function(_0xabd292){logger[_0x8462('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4b92a7,_0xabd292);_0x314c4c(_0xabd292);});});} \ No newline at end of file +var _0xcc6d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','request','then','DeskConfiguration,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result'];(function(_0xe26bb8,_0x4c7683){var _0x1af4ec=function(_0x143879){while(--_0x143879){_0xe26bb8['push'](_0xe26bb8['shift']());}};_0x1af4ec(++_0x4c7683);}(_0xcc6d,0x1a9));var _0xdcc6=function(_0x5a54e7,_0x539e10){_0x5a54e7=_0x5a54e7-0x0;var _0x5be15f=_0xcc6d[_0x5a54e7];return _0x5be15f;};'use strict';var _=require(_0xdcc6('0x0'));var util=require(_0xdcc6('0x1'));var moment=require(_0xdcc6('0x2'));var BPromise=require(_0xdcc6('0x3'));var rs=require(_0xdcc6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcc6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdcc6('0x6'));var config=require('../../config/environment');var jayson=require(_0xdcc6('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47ec37,_0x226e34,_0x47cc5a){return new BPromise(function(_0x393524,_0x13a583){return client[_0xdcc6('0x8')](_0x47ec37,_0x47cc5a)[_0xdcc6('0x9')](function(_0x45fa41){logger['info'](_0xdcc6('0xa'),_0x226e34,'request\x20sent');logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x226e34,'request\x20sent',JSON[_0xdcc6('0xb')](_0x45fa41));if(_0x45fa41['error']){if(_0x45fa41['error'][_0xdcc6('0xc')]===0x1f4){logger[_0xdcc6('0xd')](_0xdcc6('0xa'),_0x226e34,_0x45fa41[_0xdcc6('0xd')][_0xdcc6('0xe')]);return _0x13a583(_0x45fa41[_0xdcc6('0xd')][_0xdcc6('0xe')]);}logger[_0xdcc6('0xd')](_0xdcc6('0xa'),_0x226e34,_0x45fa41[_0xdcc6('0xd')]['message']);return _0x393524(_0x45fa41['error'][_0xdcc6('0xe')]);}else{logger['info'](_0xdcc6('0xa'),_0x226e34,_0xdcc6('0xf'));_0x393524(_0x45fa41[_0xdcc6('0x10')][_0xdcc6('0xe')]);}})['catch'](function(_0x36a485){logger[_0xdcc6('0xd')](_0xdcc6('0xa'),_0x226e34,_0x36a485);_0x13a583(_0x36a485);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index e60f073..2a3f03d 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 _0x3442=['create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x89013d,_0xc03f0b){var _0x35e196=function(_0x53e894){while(--_0x53e894){_0x89013d['push'](_0x89013d['shift']());}};_0x35e196(++_0xc03f0b);}(_0x3442,0x15a));var _0x2344=function(_0x4adcd4,_0x15bbb4){_0x4adcd4=_0x4adcd4-0x0;var _0x1193ca=_0x3442[_0x4adcd4];return _0x1193ca;};'use strict';var multer=require('multer');var util=require(_0x2344('0x0'));var path=require(_0x2344('0x1'));var timeout=require(_0x2344('0x2'));var express=require(_0x2344('0x3'));var router=express[_0x2344('0x4')]();var fs_extra=require(_0x2344('0x5'));var auth=require(_0x2344('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2344('0x7'));var controller=require(_0x2344('0x8'));router['get']('/',auth[_0x2344('0x9')](),controller[_0x2344('0xa')]);router[_0x2344('0xb')](_0x2344('0xc'),auth[_0x2344('0x9')](),controller[_0x2344('0xd')]);router[_0x2344('0xe')]('/',auth[_0x2344('0x9')](),controller[_0x2344('0xf')]);router['put'](_0x2344('0xc'),auth[_0x2344('0x9')](),controller[_0x2344('0x10')]);router[_0x2344('0x11')](_0x2344('0xc'),auth[_0x2344('0x9')](),controller['destroy']);module[_0x2344('0x12')]=router; \ No newline at end of file +var _0x75c2=['multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post','put','destroy','exports'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x75c2,0x1a0));var _0x275c=function(_0x40e130,_0x11203c){_0x40e130=_0x40e130-0x0;var _0x3dbb41=_0x75c2[_0x40e130];return _0x3dbb41;};'use strict';var multer=require(_0x275c('0x0'));var util=require(_0x275c('0x1'));var path=require(_0x275c('0x2'));var timeout=require(_0x275c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x275c('0x4'));var config=require(_0x275c('0x5'));var controller=require(_0x275c('0x6'));router['get']('/',auth[_0x275c('0x7')](),controller[_0x275c('0x8')]);router[_0x275c('0x9')](_0x275c('0xa'),auth[_0x275c('0x7')](),controller[_0x275c('0xb')]);router[_0x275c('0xc')]('/',auth[_0x275c('0x7')](),controller['create']);router[_0x275c('0xd')](_0x275c('0xa'),auth[_0x275c('0x7')](),controller['update']);router['delete'](_0x275c('0xa'),auth[_0x275c('0x7')](),controller[_0x275c('0xe')]);module[_0x275c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e8d0856..0b85b15 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 _0x8273=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x8273,0xb9));var _0x3827=function(_0xcd22a3,_0x33ae8f){_0xcd22a3=_0xcd22a3-0x0;var _0x1deacc=_0x8273[_0xcd22a3];return _0x1deacc;};'use strict';var Sequelize=require(_0x3827('0x0'));module[_0x3827('0x1')]={'type':{'type':Sequelize[_0x3827('0x2')](_0x3827('0x3'),_0x3827('0x4'),_0x3827('0x5'),_0x3827('0x6'),_0x3827('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3827('0x8')]},'key':{'type':Sequelize[_0x3827('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0x3827('0x4'),_0x3827('0x5'))},'keyContent':{'type':Sequelize[_0x3827('0x8')]},'idField':{'type':Sequelize[_0x3827('0x8')]},'nameField':{'type':Sequelize[_0x3827('0x8')]},'customField':{'type':Sequelize[_0x3827('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1ed7=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x38b21e,_0x1453cb){var _0x5f2472=function(_0x34ba89){while(--_0x34ba89){_0x38b21e['push'](_0x38b21e['shift']());}};_0x5f2472(++_0x1453cb);}(_0x1ed7,0x6f));var _0x71ed=function(_0x1be053,_0x4efb28){_0x1be053=_0x1be053-0x0;var _0x1b5814=_0x1ed7[_0x1be053];return _0x1b5814;};'use strict';var Sequelize=require(_0x71ed('0x0'));module[_0x71ed('0x1')]={'type':{'type':Sequelize[_0x71ed('0x2')](_0x71ed('0x3'),_0x71ed('0x4'),_0x71ed('0x5'),_0x71ed('0x6'),_0x71ed('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x71ed('0x8')]},'key':{'type':Sequelize[_0x71ed('0x8')]},'keyType':{'type':Sequelize[_0x71ed('0x2')](_0x71ed('0x3'),_0x71ed('0x4'),_0x71ed('0x5'))},'keyContent':{'type':Sequelize[_0x71ed('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x71ed('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x71ed('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 7774851..7a65501 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 _0x5eca=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','DeskField','includeAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5eca,0x10e));var _0xa5ec=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5eca[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xa5ec('0x0'));var rimraf=require(_0xa5ec('0x1'));var zipdir=require(_0xa5ec('0x2'));var jsonpatch=require(_0xa5ec('0x3'));var rp=require(_0xa5ec('0x4'));var moment=require('moment');var BPromise=require(_0xa5ec('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa5ec('0x6'));var sox=require(_0xa5ec('0x7'));var csv=require(_0xa5ec('0x8'));var ejs=require(_0xa5ec('0x9'));var fs=require('fs');var fs_extra=require(_0xa5ec('0xa'));var _=require(_0xa5ec('0xb'));var squel=require(_0xa5ec('0xc'));var crypto=require('crypto');var jsforce=require(_0xa5ec('0xd'));var deskjs=require(_0xa5ec('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa5ec('0xf'));var Papa=require('papaparse');var Redis=require(_0xa5ec('0x10'));var authService=require(_0xa5ec('0x11'));var qs=require(_0xa5ec('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5ec('0x13'));var logger=require(_0xa5ec('0x14'))(_0xa5ec('0x15'));var utils=require(_0xa5ec('0x16'));var config=require(_0xa5ec('0x17'));var licenseUtil=require(_0xa5ec('0x18'));var db=require(_0xa5ec('0x19'))['db'];function respondWithStatusCode(_0x703db5,_0x3e5ce7){_0x3e5ce7=_0x3e5ce7||0xcc;return function(_0x69bcea){if(_0x69bcea){return _0x703db5[_0xa5ec('0x1a')](_0x3e5ce7);}return _0x703db5[_0xa5ec('0x1b')](_0x3e5ce7)[_0xa5ec('0x1c')]();};}function respondWithResult(_0x58c1d7,_0x21c65a){_0x21c65a=_0x21c65a||0xc8;return function(_0x241d2b){if(_0x241d2b){return _0x58c1d7[_0xa5ec('0x1b')](_0x21c65a)[_0xa5ec('0x1d')](_0x241d2b);}};}function respondWithFilteredResult(_0x142305,_0x2fe110){return function(_0x54288a){if(_0x54288a){var _0x471de4=typeof _0x2fe110['offset']===_0xa5ec('0x1e')&&typeof _0x2fe110[_0xa5ec('0x1f')]===_0xa5ec('0x1e');var _0x32281e=_0x54288a[_0xa5ec('0x20')];var _0x372767=_0x471de4?0x0:_0x2fe110[_0xa5ec('0x21')];var _0x29fbb4=_0x471de4?_0x54288a[_0xa5ec('0x20')]:_0x2fe110[_0xa5ec('0x21')]+_0x2fe110['limit'];var _0x7613;if(_0x29fbb4>=_0x32281e){_0x29fbb4=_0x32281e;_0x7613=0xc8;}else{_0x7613=0xce;}_0x142305[_0xa5ec('0x1b')](_0x7613);return _0x142305[_0xa5ec('0x22')](_0xa5ec('0x23'),_0x372767+'-'+_0x29fbb4+'/'+_0x32281e)[_0xa5ec('0x1d')](_0x54288a);}return null;};}function patchUpdates(_0x3560d7){return function(_0x1255bc){try{jsonpatch[_0xa5ec('0x24')](_0x1255bc,_0x3560d7,!![]);}catch(_0x2a0602){return BPromise['reject'](_0x2a0602);}return _0x1255bc[_0xa5ec('0x25')]();};}function saveUpdates(_0x3581b7,_0x3c957){return function(_0xa2daff){if(_0xa2daff){return _0xa2daff[_0xa5ec('0x26')](_0x3581b7)[_0xa5ec('0x27')](function(_0x1995f4){return _0x1995f4;});}return null;};}function removeEntity(_0x364770,_0x5eef95){return function(_0x584d82){if(_0x584d82){return _0x584d82['destroy']()[_0xa5ec('0x27')](function(){_0x364770['status'](0xcc)[_0xa5ec('0x1c')]();});}};}function handleEntityNotFound(_0x38be6b,_0x57ef19){return function(_0x20612a){if(!_0x20612a){_0x38be6b[_0xa5ec('0x1a')](0x194);}return _0x20612a;};}function handleError(_0x4ff18c,_0x4643aa){_0x4643aa=_0x4643aa||0x1f4;return function(_0x12bfbb){logger['error'](_0x12bfbb[_0xa5ec('0x28')]);if(_0x12bfbb['name']){delete _0x12bfbb[_0xa5ec('0x29')];}_0x4ff18c[_0xa5ec('0x1b')](_0x4643aa)[_0xa5ec('0x2a')](_0x12bfbb);};}exports[_0xa5ec('0x2b')]=function(_0x39907f,_0x40a05a){var _0x45e32c={},_0x2cda8c={},_0x25ef57={'count':0x0,'rows':[]};var _0x4c1871=_[_0xa5ec('0x2c')](db['DeskField']['rawAttributes'],function(_0xa8caab){return{'name':_0xa8caab[_0xa5ec('0x2d')],'type':_0xa8caab[_0xa5ec('0x2e')][_0xa5ec('0x2f')]};});_0x2cda8c[_0xa5ec('0x30')]=_[_0xa5ec('0x2c')](_0x4c1871,'name');_0x2cda8c[_0xa5ec('0x31')]=_[_0xa5ec('0x32')](_0x39907f['query']);_0x2cda8c[_0xa5ec('0x33')]=_[_0xa5ec('0x34')](_0x2cda8c[_0xa5ec('0x30')],_0x2cda8c[_0xa5ec('0x31')]);_0x45e32c['attributes']=_[_0xa5ec('0x34')](_0x2cda8c[_0xa5ec('0x30')],qs[_0xa5ec('0x35')](_0x39907f[_0xa5ec('0x31')]['fields']));_0x45e32c[_0xa5ec('0x36')]=_0x45e32c['attributes'][_0xa5ec('0x37')]?_0x45e32c[_0xa5ec('0x36')]:_0x2cda8c['model'];if(!_0x39907f['query'][_0xa5ec('0x38')](_0xa5ec('0x39'))){_0x45e32c[_0xa5ec('0x1f')]=qs[_0xa5ec('0x1f')](_0x39907f[_0xa5ec('0x31')]['limit']);_0x45e32c[_0xa5ec('0x21')]=qs[_0xa5ec('0x21')](_0x39907f[_0xa5ec('0x31')][_0xa5ec('0x21')]);}_0x45e32c[_0xa5ec('0x3a')]=qs[_0xa5ec('0x3b')](_0x39907f['query'][_0xa5ec('0x3b')]);_0x45e32c['where']=qs[_0xa5ec('0x33')](_[_0xa5ec('0x3c')](_0x39907f[_0xa5ec('0x31')],_0x2cda8c[_0xa5ec('0x33')]),_0x4c1871);if(_0x39907f[_0xa5ec('0x31')]['filter']){_0x45e32c[_0xa5ec('0x3d')]=_[_0xa5ec('0x3e')](_0x45e32c[_0xa5ec('0x3d')],{'$or':_[_0xa5ec('0x2c')](_0x4c1871,function(_0x12feed){if(_0x12feed[_0xa5ec('0x2e')]!==_0xa5ec('0x3f')){var _0x5dda81={};_0x5dda81[_0x12feed[_0xa5ec('0x29')]]={'$like':'%'+_0x39907f[_0xa5ec('0x31')]['filter']+'%'};return _0x5dda81;}})});}_0x45e32c=_[_0xa5ec('0x3e')]({},_0x45e32c,_0x39907f[_0xa5ec('0x40')]);var _0x3c4f1c={'where':_0x45e32c[_0xa5ec('0x3d')]};return db[_0xa5ec('0x41')][_0xa5ec('0x20')](_0x3c4f1c)[_0xa5ec('0x27')](function(_0x1c13b2){_0x25ef57[_0xa5ec('0x20')]=_0x1c13b2;if(_0x39907f[_0xa5ec('0x31')][_0xa5ec('0x42')]){_0x45e32c['include']=[{'all':!![]}];}return db['DeskField']['findAll'](_0x45e32c);})['then'](function(_0x1744be){_0x25ef57[_0xa5ec('0x43')]=_0x1744be;return _0x25ef57;})[_0xa5ec('0x27')](respondWithFilteredResult(_0x40a05a,_0x45e32c))[_0xa5ec('0x44')](handleError(_0x40a05a,null));};exports[_0xa5ec('0x45')]=function(_0x1ae6e4,_0xa6369a){var _0x46d042={'raw':!![],'where':{'id':_0x1ae6e4[_0xa5ec('0x46')]['id']}},_0x56dfa4={};_0x56dfa4['model']=_[_0xa5ec('0x32')](db[_0xa5ec('0x41')]['rawAttributes']);_0x56dfa4['query']=_[_0xa5ec('0x32')](_0x1ae6e4[_0xa5ec('0x31')]);_0x56dfa4[_0xa5ec('0x33')]=_[_0xa5ec('0x34')](_0x56dfa4[_0xa5ec('0x30')],_0x56dfa4[_0xa5ec('0x31')]);_0x46d042[_0xa5ec('0x36')]=_[_0xa5ec('0x34')](_0x56dfa4[_0xa5ec('0x30')],qs[_0xa5ec('0x35')](_0x1ae6e4['query']['fields']));_0x46d042[_0xa5ec('0x36')]=_0x46d042[_0xa5ec('0x36')][_0xa5ec('0x37')]?_0x46d042[_0xa5ec('0x36')]:_0x56dfa4[_0xa5ec('0x30')];if(_0x1ae6e4[_0xa5ec('0x31')][_0xa5ec('0x42')]){_0x46d042['include']=[{'all':!![]}];}_0x46d042=_[_0xa5ec('0x3e')]({},_0x46d042,_0x1ae6e4['options']);return db['DeskField'][_0xa5ec('0x47')](_0x46d042)[_0xa5ec('0x27')](handleEntityNotFound(_0xa6369a,null))[_0xa5ec('0x27')](respondWithResult(_0xa6369a,null))['catch'](handleError(_0xa6369a,null));};exports[_0xa5ec('0x48')]=function(_0x55c3c7,_0xfcc42b){return db[_0xa5ec('0x41')][_0xa5ec('0x48')](_0x55c3c7[_0xa5ec('0x49')],{})[_0xa5ec('0x27')](respondWithResult(_0xfcc42b,0xc9))[_0xa5ec('0x44')](handleError(_0xfcc42b,null));};exports['update']=function(_0x485f07,_0xc74073){if(_0x485f07['body']['id']){delete _0x485f07[_0xa5ec('0x49')]['id'];}return db[_0xa5ec('0x41')]['find']({'where':{'id':_0x485f07['params']['id']}})[_0xa5ec('0x27')](handleEntityNotFound(_0xc74073,null))[_0xa5ec('0x27')](saveUpdates(_0x485f07[_0xa5ec('0x49')],null))[_0xa5ec('0x27')](respondWithResult(_0xc74073,null))['catch'](handleError(_0xc74073,null));};exports['destroy']=function(_0x388f20,_0x17b719){return db[_0xa5ec('0x41')][_0xa5ec('0x47')]({'where':{'id':_0x388f20[_0xa5ec('0x46')]['id']}})[_0xa5ec('0x27')](handleEntityNotFound(_0x17b719,null))[_0xa5ec('0x27')](removeEntity(_0x17b719,null))[_0xa5ec('0x44')](handleError(_0x17b719,null));}; \ No newline at end of file +var _0x0adf=['include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','DeskField','count','includeAll'];(function(_0x25c2df,_0x2b08ef){var _0x524bec=function(_0x3564d4){while(--_0x3564d4){_0x25c2df['push'](_0x25c2df['shift']());}};_0x524bec(++_0x2b08ef);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x40b374,_0x4d0a2d){_0x40b374=_0x40b374-0x0;var _0x2db84c=_0x0adf[_0x40b374];return _0x2db84c;};'use strict';var emlformat=require(_0xf0ad('0x0'));var rimraf=require(_0xf0ad('0x1'));var zipdir=require(_0xf0ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0ad('0x3'));var moment=require(_0xf0ad('0x4'));var BPromise=require(_0xf0ad('0x5'));var Mustache=require(_0xf0ad('0x6'));var util=require(_0xf0ad('0x7'));var path=require(_0xf0ad('0x8'));var sox=require(_0xf0ad('0x9'));var csv=require('to-csv');var ejs=require(_0xf0ad('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0ad('0xb'));var squel=require(_0xf0ad('0xc'));var crypto=require(_0xf0ad('0xd'));var jsforce=require(_0xf0ad('0xe'));var deskjs=require(_0xf0ad('0xf'));var toCsv=require(_0xf0ad('0x10'));var querystring=require(_0xf0ad('0x11'));var Papa=require('papaparse');var Redis=require(_0xf0ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf0ad('0x13'));var as=require(_0xf0ad('0x14'));var hardwareService=require(_0xf0ad('0x15'));var logger=require(_0xf0ad('0x16'))(_0xf0ad('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf0ad('0x18'));var db=require(_0xf0ad('0x19'))['db'];function respondWithStatusCode(_0x3646a2,_0x238c3b){_0x238c3b=_0x238c3b||0xcc;return function(_0x597c40){if(_0x597c40){return _0x3646a2[_0xf0ad('0x1a')](_0x238c3b);}return _0x3646a2[_0xf0ad('0x1b')](_0x238c3b)['end']();};}function respondWithResult(_0x49df92,_0x5332e9){_0x5332e9=_0x5332e9||0xc8;return function(_0x221d7b){if(_0x221d7b){return _0x49df92['status'](_0x5332e9)[_0xf0ad('0x1c')](_0x221d7b);}};}function respondWithFilteredResult(_0x313ad6,_0xfa544c){return function(_0xfa829e){if(_0xfa829e){var _0x237dd9=typeof _0xfa544c['offset']===_0xf0ad('0x1d')&&typeof _0xfa544c[_0xf0ad('0x1e')]===_0xf0ad('0x1d');var _0x1c9fac=_0xfa829e['count'];var _0x4e9970=_0x237dd9?0x0:_0xfa544c[_0xf0ad('0x1f')];var _0x46fb20=_0x237dd9?_0xfa829e['count']:_0xfa544c[_0xf0ad('0x1f')]+_0xfa544c[_0xf0ad('0x1e')];var _0x9a95bf;if(_0x46fb20>=_0x1c9fac){_0x46fb20=_0x1c9fac;_0x9a95bf=0xc8;}else{_0x9a95bf=0xce;}_0x313ad6[_0xf0ad('0x1b')](_0x9a95bf);return _0x313ad6['set']('Content-Range',_0x4e9970+'-'+_0x46fb20+'/'+_0x1c9fac)[_0xf0ad('0x1c')](_0xfa829e);}return null;};}function patchUpdates(_0x2da425){return function(_0x37b968){try{jsonpatch[_0xf0ad('0x20')](_0x37b968,_0x2da425,!![]);}catch(_0x2ac8ba){return BPromise[_0xf0ad('0x21')](_0x2ac8ba);}return _0x37b968['save']();};}function saveUpdates(_0x33c95d,_0x16e62a){return function(_0x31635b){if(_0x31635b){return _0x31635b[_0xf0ad('0x22')](_0x33c95d)[_0xf0ad('0x23')](function(_0x88b47b){return _0x88b47b;});}return null;};}function removeEntity(_0xb91769,_0x276322){return function(_0x3fc97e){if(_0x3fc97e){return _0x3fc97e[_0xf0ad('0x24')]()[_0xf0ad('0x23')](function(){_0xb91769[_0xf0ad('0x1b')](0xcc)[_0xf0ad('0x25')]();});}};}function handleEntityNotFound(_0x456f81,_0x879f89){return function(_0x557f90){if(!_0x557f90){_0x456f81[_0xf0ad('0x1a')](0x194);}return _0x557f90;};}function handleError(_0x1507a3,_0x248794){_0x248794=_0x248794||0x1f4;return function(_0x7377d7){logger[_0xf0ad('0x26')](_0x7377d7[_0xf0ad('0x27')]);if(_0x7377d7['name']){delete _0x7377d7[_0xf0ad('0x28')];}_0x1507a3[_0xf0ad('0x1b')](_0x248794)[_0xf0ad('0x29')](_0x7377d7);};}exports[_0xf0ad('0x2a')]=function(_0x1b6880,_0x1ac25c){var _0x267b7a={},_0x1bee71={},_0x2386e8={'count':0x0,'rows':[]};var _0x39c46c=_[_0xf0ad('0x2b')](db['DeskField'][_0xf0ad('0x2c')],function(_0x5f5115){return{'name':_0x5f5115[_0xf0ad('0x2d')],'type':_0x5f5115['type'][_0xf0ad('0x2e')]};});_0x1bee71[_0xf0ad('0x2f')]=_[_0xf0ad('0x2b')](_0x39c46c,_0xf0ad('0x28'));_0x1bee71[_0xf0ad('0x30')]=_[_0xf0ad('0x31')](_0x1b6880[_0xf0ad('0x30')]);_0x1bee71[_0xf0ad('0x32')]=_['intersection'](_0x1bee71['model'],_0x1bee71[_0xf0ad('0x30')]);_0x267b7a[_0xf0ad('0x33')]=_[_0xf0ad('0x34')](_0x1bee71[_0xf0ad('0x2f')],qs['fields'](_0x1b6880[_0xf0ad('0x30')]['fields']));_0x267b7a[_0xf0ad('0x33')]=_0x267b7a['attributes'][_0xf0ad('0x35')]?_0x267b7a['attributes']:_0x1bee71[_0xf0ad('0x2f')];if(!_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x36')](_0xf0ad('0x37'))){_0x267b7a[_0xf0ad('0x1e')]=qs[_0xf0ad('0x1e')](_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x1e')]);_0x267b7a['offset']=qs[_0xf0ad('0x1f')](_0x1b6880['query'][_0xf0ad('0x1f')]);}_0x267b7a['order']=qs[_0xf0ad('0x38')](_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x38')]);_0x267b7a[_0xf0ad('0x39')]=qs[_0xf0ad('0x32')](_['pick'](_0x1b6880[_0xf0ad('0x30')],_0x1bee71[_0xf0ad('0x32')]),_0x39c46c);if(_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x3a')]){_0x267b7a[_0xf0ad('0x39')]=_[_0xf0ad('0x3b')](_0x267b7a[_0xf0ad('0x39')],{'$or':_['map'](_0x39c46c,function(_0x2e0c7a){if(_0x2e0c7a[_0xf0ad('0x3c')]!==_0xf0ad('0x3d')){var _0x189f67={};_0x189f67[_0x2e0c7a[_0xf0ad('0x28')]]={'$like':'%'+_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x3a')]+'%'};return _0x189f67;}})});}_0x267b7a=_[_0xf0ad('0x3b')]({},_0x267b7a,_0x1b6880[_0xf0ad('0x3e')]);var _0x5dd631={'where':_0x267b7a[_0xf0ad('0x39')]};return db[_0xf0ad('0x3f')][_0xf0ad('0x40')](_0x5dd631)['then'](function(_0x510f54){_0x2386e8['count']=_0x510f54;if(_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x41')]){_0x267b7a[_0xf0ad('0x42')]=[{'all':!![]}];}return db[_0xf0ad('0x3f')][_0xf0ad('0x43')](_0x267b7a);})[_0xf0ad('0x23')](function(_0x39083d){_0x2386e8[_0xf0ad('0x44')]=_0x39083d;return _0x2386e8;})[_0xf0ad('0x23')](respondWithFilteredResult(_0x1ac25c,_0x267b7a))[_0xf0ad('0x45')](handleError(_0x1ac25c,null));};exports[_0xf0ad('0x46')]=function(_0x516a72,_0x4ea947){var _0x5cd1dc={'raw':!![],'where':{'id':_0x516a72[_0xf0ad('0x47')]['id']}},_0x1c0609={};_0x1c0609['model']=_[_0xf0ad('0x31')](db[_0xf0ad('0x3f')]['rawAttributes']);_0x1c0609[_0xf0ad('0x30')]=_[_0xf0ad('0x31')](_0x516a72[_0xf0ad('0x30')]);_0x1c0609[_0xf0ad('0x32')]=_['intersection'](_0x1c0609[_0xf0ad('0x2f')],_0x1c0609[_0xf0ad('0x30')]);_0x5cd1dc[_0xf0ad('0x33')]=_[_0xf0ad('0x34')](_0x1c0609[_0xf0ad('0x2f')],qs[_0xf0ad('0x48')](_0x516a72[_0xf0ad('0x30')][_0xf0ad('0x48')]));_0x5cd1dc[_0xf0ad('0x33')]=_0x5cd1dc[_0xf0ad('0x33')][_0xf0ad('0x35')]?_0x5cd1dc['attributes']:_0x1c0609[_0xf0ad('0x2f')];if(_0x516a72[_0xf0ad('0x30')][_0xf0ad('0x41')]){_0x5cd1dc['include']=[{'all':!![]}];}_0x5cd1dc=_['merge']({},_0x5cd1dc,_0x516a72[_0xf0ad('0x3e')]);return db[_0xf0ad('0x3f')][_0xf0ad('0x49')](_0x5cd1dc)[_0xf0ad('0x23')](handleEntityNotFound(_0x4ea947,null))[_0xf0ad('0x23')](respondWithResult(_0x4ea947,null))[_0xf0ad('0x45')](handleError(_0x4ea947,null));};exports[_0xf0ad('0x4a')]=function(_0x561f2a,_0x1e35ce){return db['DeskField'][_0xf0ad('0x4a')](_0x561f2a[_0xf0ad('0x4b')],{})[_0xf0ad('0x23')](respondWithResult(_0x1e35ce,0xc9))[_0xf0ad('0x45')](handleError(_0x1e35ce,null));};exports[_0xf0ad('0x22')]=function(_0x5b18a7,_0x4e8ef5){if(_0x5b18a7[_0xf0ad('0x4b')]['id']){delete _0x5b18a7[_0xf0ad('0x4b')]['id'];}return db[_0xf0ad('0x3f')][_0xf0ad('0x49')]({'where':{'id':_0x5b18a7[_0xf0ad('0x47')]['id']}})[_0xf0ad('0x23')](handleEntityNotFound(_0x4e8ef5,null))[_0xf0ad('0x23')](saveUpdates(_0x5b18a7['body'],null))[_0xf0ad('0x23')](respondWithResult(_0x4e8ef5,null))[_0xf0ad('0x45')](handleError(_0x4e8ef5,null));};exports[_0xf0ad('0x24')]=function(_0xda0e52,_0x2cb082){return db['DeskField'][_0xf0ad('0x49')]({'where':{'id':_0xda0e52[_0xf0ad('0x47')]['id']}})[_0xf0ad('0x23')](handleEntityNotFound(_0x2cb082,null))[_0xf0ad('0x23')](removeEntity(_0x2cb082,null))[_0xf0ad('0x45')](handleError(_0x2cb082,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 93f8342..b728319 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 _0xc077=['util','../../config/logger','api','moment','bluebird','exports','define','DeskField','int_desk_fields','idField','FieldId','lodash'];(function(_0x235563,_0x260ece){var _0x219be0=function(_0xef2469){while(--_0xef2469){_0x235563['push'](_0x235563['shift']());}};_0x219be0(++_0x260ece);}(_0xc077,0x15b));var _0x7c07=function(_0x1e9bf5,_0x2b8466){_0x1e9bf5=_0x1e9bf5-0x0;var _0x3e43a0=_0xc077[_0x1e9bf5];return _0x3e43a0;};'use strict';var _=require(_0x7c07('0x0'));var util=require(_0x7c07('0x1'));var logger=require(_0x7c07('0x2'))(_0x7c07('0x3'));var moment=require(_0x7c07('0x4'));var BPromise=require(_0x7c07('0x5'));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('./intDeskField.attributes');module[_0x7c07('0x6')]=function(_0x1af351,_0x1e61f5){return _0x1af351[_0x7c07('0x7')](_0x7c07('0x8'),attributes,{'tableName':_0x7c07('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x7c07('0xa'),_0x7c07('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf540=['desk_unique_index','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields'];(function(_0x19bef1,_0x53c40d){var _0x32de66=function(_0xa75bb9){while(--_0xa75bb9){_0x19bef1['push'](_0x19bef1['shift']());}};_0x32de66(++_0x53c40d);}(_0xf540,0x84));var _0x0f54=function(_0x218540,_0x55466d){_0x218540=_0x218540-0x0;var _0x41654c=_0xf540[_0x218540];return _0x41654c;};'use strict';var _=require(_0x0f54('0x0'));var util=require('util');var logger=require(_0x0f54('0x1'))('api');var moment=require(_0x0f54('0x2'));var BPromise=require(_0x0f54('0x3'));var rp=require(_0x0f54('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0f54('0x5'));var attributes=require(_0x0f54('0x6'));module[_0x0f54('0x7')]=function(_0x1336ea,_0xd62d90){return _0x1336ea[_0x0f54('0x8')](_0x0f54('0x9'),attributes,{'tableName':_0x0f54('0xa'),'paranoid':![],'indexes':[{'name':_0x0f54('0xb'),'fields':['idField',_0x0f54('0xc')],'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 1a14231..5215d6b 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 _0xa868=['rpc','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x438c8d,_0x5afcfc){var _0x1d5d1b=function(_0x5e256c){while(--_0x5e256c){_0x438c8d['push'](_0x438c8d['shift']());}};_0x1d5d1b(++_0x5afcfc);}(_0xa868,0x136));var _0x8a86=function(_0xafdec6,_0x3d94df){_0xafdec6=_0xafdec6-0x0;var _0x372bdb=_0xa868[_0xafdec6];return _0x372bdb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a86('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a86('0x1'));var db=require(_0x8a86('0x2'))['db'];var utils=require(_0x8a86('0x3'));var logger=require(_0x8a86('0x4'))(_0x8a86('0x5'));var config=require(_0x8a86('0x6'));var jayson=require(_0x8a86('0x7'));var client=jayson['client'][_0x8a86('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x534ccb,_0x3883ae,_0x3a8a2f){return new BPromise(function(_0x1e0e79,_0x238763){return client[_0x8a86('0x9')](_0x534ccb,_0x3a8a2f)[_0x8a86('0xa')](function(_0x370e2d){logger[_0x8a86('0xb')](_0x8a86('0xc'),_0x3883ae,'request\x20sent');logger[_0x8a86('0xd')](_0x8a86('0xe'),_0x3883ae,'request\x20sent',JSON[_0x8a86('0xf')](_0x370e2d));if(_0x370e2d['error']){if(_0x370e2d['error'][_0x8a86('0x10')]===0x1f4){logger[_0x8a86('0x11')](_0x8a86('0xc'),_0x3883ae,_0x370e2d['error'][_0x8a86('0x12')]);return _0x238763(_0x370e2d[_0x8a86('0x11')]['message']);}logger[_0x8a86('0x11')](_0x8a86('0xc'),_0x3883ae,_0x370e2d[_0x8a86('0x11')][_0x8a86('0x12')]);return _0x1e0e79(_0x370e2d[_0x8a86('0x11')][_0x8a86('0x12')]);}else{logger[_0x8a86('0xb')]('DeskField,\x20%s,\x20%s',_0x3883ae,_0x8a86('0x13'));_0x1e0e79(_0x370e2d[_0x8a86('0x14')]['message']);}})['catch'](function(_0x1f4f9c){logger[_0x8a86('0x11')](_0x8a86('0xc'),_0x3883ae,_0x1f4f9c);_0x238763(_0x1f4f9c);});});} \ No newline at end of file +var _0xab4a=['debug','stringify','error','message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x48564d,_0x2c1c8c){var _0x2ad779=function(_0x4490dd){while(--_0x4490dd){_0x48564d['push'](_0x48564d['shift']());}};_0x2ad779(++_0x2c1c8c);}(_0xab4a,0x1e0));var _0xaab4=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0xab4a[_0x231b2e];return _0x3feb2a;};'use strict';var _=require('lodash');var util=require(_0xaab4('0x0'));var moment=require(_0xaab4('0x1'));var BPromise=require(_0xaab4('0x2'));var rs=require(_0xaab4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaab4('0x4'));var logger=require(_0xaab4('0x5'))(_0xaab4('0x6'));var config=require(_0xaab4('0x7'));var jayson=require(_0xaab4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42fe79,_0x36a4af,_0x26b5b1){return new BPromise(function(_0x29c965,_0xadd23){return client[_0xaab4('0x9')](_0x42fe79,_0x26b5b1)[_0xaab4('0xa')](function(_0x25c779){logger[_0xaab4('0xb')](_0xaab4('0xc'),_0x36a4af,_0xaab4('0xd'));logger[_0xaab4('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x36a4af,_0xaab4('0xd'),JSON[_0xaab4('0xf')](_0x25c779));if(_0x25c779['error']){if(_0x25c779[_0xaab4('0x10')]['code']===0x1f4){logger[_0xaab4('0x10')](_0xaab4('0xc'),_0x36a4af,_0x25c779['error'][_0xaab4('0x11')]);return _0xadd23(_0x25c779[_0xaab4('0x10')][_0xaab4('0x11')]);}logger[_0xaab4('0x10')]('DeskField,\x20%s,\x20%s',_0x36a4af,_0x25c779[_0xaab4('0x10')]['message']);return _0x29c965(_0x25c779[_0xaab4('0x10')]['message']);}else{logger['info'](_0xaab4('0xc'),_0x36a4af,'request\x20sent');_0x29c965(_0x25c779[_0xaab4('0x12')][_0xaab4('0x11')]);}})['catch'](function(_0xffe6ee){logger[_0xaab4('0x10')](_0xaab4('0xc'),_0x36a4af,_0xffe6ee);_0xadd23(_0xffe6ee);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 5ed316d..e4e0ba4 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 _0x6038=['post','/:id/configurations','addConfiguration','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields'];(function(_0x5aed9,_0xa3c19b){var _0x2d681a=function(_0x2cb1fa){while(--_0x2cb1fa){_0x5aed9['push'](_0x5aed9['shift']());}};_0x2d681a(++_0xa3c19b);}(_0x6038,0x194));var _0x8603=function(_0x382862,_0x2557fa){_0x382862=_0x382862-0x0;var _0x429ac2=_0x6038[_0x382862];return _0x429ac2;};'use strict';var multer=require(_0x8603('0x0'));var util=require(_0x8603('0x1'));var path=require(_0x8603('0x2'));var timeout=require(_0x8603('0x3'));var express=require(_0x8603('0x4'));var router=express[_0x8603('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8603('0x6'));var interaction=require(_0x8603('0x7'));var config=require(_0x8603('0x8'));var controller=require(_0x8603('0x9'));router[_0x8603('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8603('0xa')](_0x8603('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x8603('0xa')]('/:id/configurations',auth[_0x8603('0xc')](),controller[_0x8603('0xd')]);router[_0x8603('0xa')](_0x8603('0xe'),auth[_0x8603('0xc')](),controller[_0x8603('0xf')]);router[_0x8603('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x8603('0x11'),auth[_0x8603('0xc')](),controller[_0x8603('0x12')]);router['put'](_0x8603('0xb'),auth[_0x8603('0xc')](),controller[_0x8603('0x13')]);router['delete']('/:id',auth[_0x8603('0xc')](),controller['destroy']);module[_0x8603('0x14')]=router; \ No newline at end of file +var _0x1c4f=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show'];(function(_0x20deba,_0x41295e){var _0x1f79f6=function(_0x4dcb27){while(--_0x4dcb27){_0x20deba['push'](_0x20deba['shift']());}};_0x1f79f6(++_0x41295e);}(_0x1c4f,0x89));var _0xf1c4=function(_0xb5f37a,_0x1c0cf9){_0xb5f37a=_0xb5f37a-0x0;var _0x325beb=_0x1c4f[_0xb5f37a];return _0x325beb;};'use strict';var multer=require('multer');var util=require(_0xf1c4('0x0'));var path=require(_0xf1c4('0x1'));var timeout=require(_0xf1c4('0x2'));var express=require('express');var router=express[_0xf1c4('0x3')]();var fs_extra=require(_0xf1c4('0x4'));var auth=require(_0xf1c4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf1c4('0x6'));var controller=require(_0xf1c4('0x7'));router[_0xf1c4('0x8')]('/',auth[_0xf1c4('0x9')](),controller[_0xf1c4('0xa')]);router[_0xf1c4('0x8')](_0xf1c4('0xb'),auth['isAuthenticated'](),controller[_0xf1c4('0xc')]);router['get'](_0xf1c4('0xd'),auth['isAuthenticated'](),controller[_0xf1c4('0xe')]);router[_0xf1c4('0x8')](_0xf1c4('0xf'),auth['isAuthenticated'](),controller[_0xf1c4('0x10')]);router[_0xf1c4('0x11')]('/',auth[_0xf1c4('0x9')](),controller[_0xf1c4('0x12')]);router[_0xf1c4('0x11')](_0xf1c4('0xd'),auth[_0xf1c4('0x9')](),controller[_0xf1c4('0x13')]);router[_0xf1c4('0x14')](_0xf1c4('0xb'),auth[_0xf1c4('0x9')](),controller[_0xf1c4('0x15')]);router[_0xf1c4('0x16')](_0xf1c4('0xb'),auth[_0xf1c4('0x9')](),controller[_0xf1c4('0x17')]);module[_0xf1c4('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index dc87c48..7e3ec12 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 _0xeaec=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeaec,0xde));var _0xceae=function(_0x197ed4,_0xfdb80f){_0x197ed4=_0x197ed4-0x0;var _0x2bf99a=_0xeaec[_0x197ed4];return _0x2bf99a;};'use strict';var Sequelize=require(_0xceae('0x0'));module[_0xceae('0x1')]={'name':{'type':Sequelize[_0xceae('0x2')]},'username':{'type':Sequelize[_0xceae('0x2')]},'password':{'type':Sequelize[_0xceae('0x2')]},'remoteUri':{'type':Sequelize[_0xceae('0x2')]},'tenantId':{'type':Sequelize[_0xceae('0x2')]},'clientId':{'type':Sequelize[_0xceae('0x2')]},'clientSecret':{'type':Sequelize[_0xceae('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xceae('0x2')]}}; \ No newline at end of file +var _0x871e=['exports','STRING','sequelize'];(function(_0x4b67a3,_0x328d94){var _0x4e08b1=function(_0x5873eb){while(--_0x5873eb){_0x4b67a3['push'](_0x4b67a3['shift']());}};_0x4e08b1(++_0x328d94);}(_0x871e,0x185));var _0xe871=function(_0x312e96,_0x2ca8af){_0x312e96=_0x312e96-0x0;var _0x55a2b7=_0x871e[_0x312e96];return _0x55a2b7;};'use strict';var Sequelize=require(_0xe871('0x0'));module[_0xe871('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe871('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe871('0x2')]},'clientSecret':{'type':Sequelize[_0xe871('0x2')]},'serverUrl':{'type':Sequelize[_0xe871('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe871('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 6910693..e495ecf 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 _0x0bde=['slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','LogicalName','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','stack','send','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','end','error','name','index','Dynamics365Account','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','length','find','create','body','catch','params','getConfigurations','findOne','Dynamics365Configuration','order','pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','primarycontactidname','resolveby','responseby','responsiblecontactidname','sentimentvalue'];(function(_0x5ce6eb,_0x2c1544){var _0x2632d4=function(_0x3f5c67){while(--_0x3f5c67){_0x5ce6eb['push'](_0x5ce6eb['shift']());}};_0x2632d4(++_0x2c1544);}(_0x0bde,0x110));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xe0bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0bd('0x1'));var jsonpatch=require(_0xe0bd('0x2'));var rp=require('request-promise');var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require(_0xe0bd('0xd'));var jsforce=require(_0xe0bd('0xe'));var deskjs=require(_0xe0bd('0xf'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0x10'));var Papa=require(_0xe0bd('0x11'));var Redis=require('ioredis');var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0bd('0x14'));var logger=require('../../config/logger')(_0xe0bd('0x15'));var utils=require(_0xe0bd('0x16'));var config=require(_0xe0bd('0x17'));var licenseUtil=require(_0xe0bd('0x18'));var db=require(_0xe0bd('0x19'))['db'];var integrations=require(_0xe0bd('0x1a'));function respondWithStatusCode(_0x1905b2,_0x500a9e){_0x500a9e=_0x500a9e||0xcc;return function(_0xadea83){if(_0xadea83){return _0x1905b2[_0xe0bd('0x1b')](_0x500a9e);}return _0x1905b2[_0xe0bd('0x1c')](_0x500a9e)['end']();};}function respondWithResult(_0x479438,_0x48afde){_0x48afde=_0x48afde||0xc8;return function(_0x1858b8){if(_0x1858b8){return _0x479438[_0xe0bd('0x1c')](_0x48afde)[_0xe0bd('0x1d')](_0x1858b8);}};}function respondWithFilteredResult(_0x3042e1,_0x361429){return function(_0x302f5f){if(_0x302f5f){var _0x39e222=typeof _0x361429[_0xe0bd('0x1e')]==='undefined'&&typeof _0x361429['limit']===_0xe0bd('0x1f');var _0xd8746d=_0x302f5f[_0xe0bd('0x20')];var _0x100b8f=_0x39e222?0x0:_0x361429[_0xe0bd('0x1e')];var _0x2a015c=_0x39e222?_0x302f5f['count']:_0x361429['offset']+_0x361429[_0xe0bd('0x21')];var _0x1edb3d;if(_0x2a015c>=_0xd8746d){_0x2a015c=_0xd8746d;_0x1edb3d=0xc8;}else{_0x1edb3d=0xce;}_0x3042e1[_0xe0bd('0x1c')](_0x1edb3d);return _0x3042e1[_0xe0bd('0x22')](_0xe0bd('0x23'),_0x100b8f+'-'+_0x2a015c+'/'+_0xd8746d)[_0xe0bd('0x1d')](_0x302f5f);}return null;};}function patchUpdates(_0x3dbd98){return function(_0x572c25){try{jsonpatch['apply'](_0x572c25,_0x3dbd98,!![]);}catch(_0x1597ab){return BPromise[_0xe0bd('0x24')](_0x1597ab);}return _0x572c25[_0xe0bd('0x25')]();};}function saveUpdates(_0xdcb789,_0x290c1e){return function(_0x4ac6b7){if(_0x4ac6b7){return _0x4ac6b7[_0xe0bd('0x26')](_0xdcb789)['then'](function(_0x242cbe){return _0x242cbe;});}return null;};}function removeEntity(_0x296f64,_0x3f24b6){return function(_0x5467ff){if(_0x5467ff){return _0x5467ff[_0xe0bd('0x27')]()[_0xe0bd('0x28')](function(){_0x296f64['status'](0xcc)[_0xe0bd('0x29')]();});}};}function handleEntityNotFound(_0x5e6496,_0x2debcb){return function(_0x54d1d0){if(!_0x54d1d0){_0x5e6496[_0xe0bd('0x1b')](0x194);}return _0x54d1d0;};}function handleError(_0x72e284,_0x3c851d){_0x3c851d=_0x3c851d||0x1f4;return function(_0x53a727){logger[_0xe0bd('0x2a')](_0x53a727['stack']);if(_0x53a727[_0xe0bd('0x2b')]){delete _0x53a727[_0xe0bd('0x2b')];}_0x72e284['status'](_0x3c851d)['send'](_0x53a727);};}exports[_0xe0bd('0x2c')]=function(_0x3789a1,_0x441475){var _0x23a317={},_0x2d7f2f={},_0x17e614={'count':0x0,'rows':[]};var _0x8e0a2f=_['map'](db[_0xe0bd('0x2d')][_0xe0bd('0x2e')],function(_0x52329b){return{'name':_0x52329b[_0xe0bd('0x2f')],'type':_0x52329b[_0xe0bd('0x30')][_0xe0bd('0x31')]};});_0x2d7f2f['model']=_[_0xe0bd('0x32')](_0x8e0a2f,_0xe0bd('0x2b'));_0x2d7f2f[_0xe0bd('0x33')]=_[_0xe0bd('0x34')](_0x3789a1[_0xe0bd('0x33')]);_0x2d7f2f[_0xe0bd('0x35')]=_[_0xe0bd('0x36')](_0x2d7f2f[_0xe0bd('0x37')],_0x2d7f2f['query']);_0x23a317['attributes']=_[_0xe0bd('0x36')](_0x2d7f2f[_0xe0bd('0x37')],qs[_0xe0bd('0x38')](_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x38')]));_0x23a317['attributes']=_0x23a317['attributes']['length']?_0x23a317[_0xe0bd('0x39')]:_0x2d7f2f[_0xe0bd('0x37')];if(!_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x3a')](_0xe0bd('0x3b'))){_0x23a317[_0xe0bd('0x21')]=qs['limit'](_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x21')]);_0x23a317[_0xe0bd('0x1e')]=qs['offset'](_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x1e')]);}_0x23a317['order']=qs[_0xe0bd('0x3c')](_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x3c')]);_0x23a317['where']=qs[_0xe0bd('0x35')](_['pick'](_0x3789a1[_0xe0bd('0x33')],_0x2d7f2f[_0xe0bd('0x35')]),_0x8e0a2f);if(_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x3d')]){_0x23a317['where']=_[_0xe0bd('0x3e')](_0x23a317[_0xe0bd('0x3f')],{'$or':_[_0xe0bd('0x32')](_0x8e0a2f,function(_0x4f73dd){if(_0x4f73dd['type']!==_0xe0bd('0x40')){var _0x2d18db={};_0x2d18db[_0x4f73dd[_0xe0bd('0x2b')]]={'$like':'%'+_0x3789a1['query']['filter']+'%'};return _0x2d18db;}})});}_0x23a317=_[_0xe0bd('0x3e')]({},_0x23a317,_0x3789a1[_0xe0bd('0x41')]);var _0x324bb2={'where':_0x23a317[_0xe0bd('0x3f')]};return db['Dynamics365Account'][_0xe0bd('0x20')](_0x324bb2)[_0xe0bd('0x28')](function(_0x351412){_0x17e614['count']=_0x351412;if(_0x3789a1['query'][_0xe0bd('0x42')]){_0x23a317[_0xe0bd('0x43')]=[{'all':!![]}];}return db[_0xe0bd('0x2d')][_0xe0bd('0x44')](_0x23a317);})['then'](function(_0x7a2547){_0x17e614[_0xe0bd('0x45')]=_0x7a2547;return _0x17e614;})[_0xe0bd('0x28')](respondWithFilteredResult(_0x441475,_0x23a317))['catch'](handleError(_0x441475,null));};exports['show']=function(_0x27a582,_0x52a0af){var _0x24be53={'raw':![],'where':{'id':_0x27a582['params']['id']}},_0x2f5a60={};_0x2f5a60[_0xe0bd('0x37')]=_[_0xe0bd('0x34')](db[_0xe0bd('0x2d')]['rawAttributes']);_0x2f5a60[_0xe0bd('0x33')]=_[_0xe0bd('0x34')](_0x27a582[_0xe0bd('0x33')]);_0x2f5a60[_0xe0bd('0x35')]=_[_0xe0bd('0x36')](_0x2f5a60[_0xe0bd('0x37')],_0x2f5a60[_0xe0bd('0x33')]);_0x24be53[_0xe0bd('0x39')]=_['intersection'](_0x2f5a60[_0xe0bd('0x37')],qs[_0xe0bd('0x38')](_0x27a582[_0xe0bd('0x33')][_0xe0bd('0x38')]));_0x24be53[_0xe0bd('0x39')]=_0x24be53[_0xe0bd('0x39')][_0xe0bd('0x46')]?_0x24be53[_0xe0bd('0x39')]:_0x2f5a60['model'];if(_0x27a582[_0xe0bd('0x33')][_0xe0bd('0x42')]){_0x24be53[_0xe0bd('0x43')]=[{'all':!![]}];}_0x24be53=_[_0xe0bd('0x3e')]({},_0x24be53,_0x27a582[_0xe0bd('0x41')]);return db['Dynamics365Account'][_0xe0bd('0x47')](_0x24be53)['then'](handleEntityNotFound(_0x52a0af,null))['then'](respondWithResult(_0x52a0af,null))['catch'](handleError(_0x52a0af,null));};exports[_0xe0bd('0x48')]=function(_0x55dd83,_0x545cfb){return db[_0xe0bd('0x2d')][_0xe0bd('0x48')](_0x55dd83[_0xe0bd('0x49')],{})[_0xe0bd('0x28')](respondWithResult(_0x545cfb,0xc9))[_0xe0bd('0x4a')](handleError(_0x545cfb,null));};exports[_0xe0bd('0x26')]=function(_0xe2b989,_0x1c4464){if(_0xe2b989[_0xe0bd('0x49')]['id']){delete _0xe2b989[_0xe0bd('0x49')]['id'];}return db['Dynamics365Account'][_0xe0bd('0x47')]({'where':{'id':_0xe2b989['params']['id']}})['then'](handleEntityNotFound(_0x1c4464,null))[_0xe0bd('0x28')](saveUpdates(_0xe2b989[_0xe0bd('0x49')],null))[_0xe0bd('0x28')](respondWithResult(_0x1c4464,null))['catch'](handleError(_0x1c4464,null));};exports[_0xe0bd('0x27')]=function(_0x3fe076,_0x2ace8e){return db[_0xe0bd('0x2d')][_0xe0bd('0x47')]({'where':{'id':_0x3fe076[_0xe0bd('0x4b')]['id']}})[_0xe0bd('0x28')](handleEntityNotFound(_0x2ace8e,null))[_0xe0bd('0x28')](removeEntity(_0x2ace8e,null))[_0xe0bd('0x4a')](handleError(_0x2ace8e,null));};exports[_0xe0bd('0x4c')]=function(_0x29c7f8,_0x29c721,_0x544195){var _0x1a62ce={};var _0xa761ae={};var _0x530338;var _0x5b246b;return db['Dynamics365Account'][_0xe0bd('0x4d')]({'where':{'id':_0x29c7f8['params']['id']}})['then'](handleEntityNotFound(_0x29c721,null))['then'](function(_0x26b184){if(_0x26b184){_0x530338=_0x26b184;_0xa761ae[_0xe0bd('0x37')]=_[_0xe0bd('0x34')](db[_0xe0bd('0x4e')]['rawAttributes']);_0xa761ae[_0xe0bd('0x33')]=_['keys'](_0x29c7f8[_0xe0bd('0x33')]);_0xa761ae[_0xe0bd('0x35')]=_[_0xe0bd('0x36')](_0xa761ae[_0xe0bd('0x37')],_0xa761ae[_0xe0bd('0x33')]);_0x1a62ce[_0xe0bd('0x39')]=_[_0xe0bd('0x36')](_0xa761ae[_0xe0bd('0x37')],qs[_0xe0bd('0x38')](_0x29c7f8[_0xe0bd('0x33')][_0xe0bd('0x38')]));_0x1a62ce[_0xe0bd('0x39')]=_0x1a62ce[_0xe0bd('0x39')]['length']?_0x1a62ce[_0xe0bd('0x39')]:_0xa761ae['model'];_0x1a62ce[_0xe0bd('0x4f')]=qs[_0xe0bd('0x3c')](_0x29c7f8[_0xe0bd('0x33')][_0xe0bd('0x3c')]);_0x1a62ce[_0xe0bd('0x3f')]=qs[_0xe0bd('0x35')](_[_0xe0bd('0x50')](_0x29c7f8[_0xe0bd('0x33')],_0xa761ae[_0xe0bd('0x35')]));if(_0x29c7f8['query']['filter']){_0x1a62ce['where']=_[_0xe0bd('0x3e')](_0x1a62ce[_0xe0bd('0x3f')],{'$or':_[_0xe0bd('0x32')](_0x1a62ce[_0xe0bd('0x39')],function(_0x3c12a2){var _0x293f91={};_0x293f91[_0x3c12a2]={'$like':'%'+_0x29c7f8[_0xe0bd('0x33')][_0xe0bd('0x3d')]+'%'};return _0x293f91;})});}_0x1a62ce=_[_0xe0bd('0x3e')]({},_0x1a62ce,_0x29c7f8['options']);return _0x530338[_0xe0bd('0x4c')](_0x1a62ce);}})['then'](function(_0x5f0226){if(_0x5f0226){_0x5b246b=_0x5f0226[_0xe0bd('0x46')];if(!_0x29c7f8[_0xe0bd('0x33')][_0xe0bd('0x3a')](_0xe0bd('0x3b'))){_0x1a62ce[_0xe0bd('0x21')]=qs[_0xe0bd('0x21')](_0x29c7f8[_0xe0bd('0x33')]['limit']);_0x1a62ce[_0xe0bd('0x1e')]=qs[_0xe0bd('0x1e')](_0x29c7f8[_0xe0bd('0x33')]['offset']);}return _0x530338[_0xe0bd('0x4c')](_0x1a62ce);}})[_0xe0bd('0x28')](function(_0x593e24){if(_0x593e24){return _0x593e24?{'count':_0x5b246b,'rows':_0x593e24}:null;}})[_0xe0bd('0x28')](respondWithResult(_0x29c721,null))[_0xe0bd('0x4a')](handleError(_0x29c721,null));};exports[_0xe0bd('0x51')]=function(_0x26d6fc,_0x5a43e0,_0x4721f9){if(_0x26d6fc[_0xe0bd('0x49')]['id']){delete _0x26d6fc[_0xe0bd('0x49')]['id'];}return db[_0xe0bd('0x2d')][_0xe0bd('0x4d')]({'where':{'id':_0x26d6fc[_0xe0bd('0x4b')]['id']}})[_0xe0bd('0x28')](handleEntityNotFound(_0x5a43e0,null))[_0xe0bd('0x28')](function(_0x1a6881){if(_0x1a6881){_0x26d6fc[_0xe0bd('0x49')][_0xe0bd('0x52')]=_0x1a6881['id'];_0x26d6fc[_0xe0bd('0x49')]['Subjects']=integrations[_0xe0bd('0x53')](_0x26d6fc[_0xe0bd('0x49')][_0xe0bd('0x54')],_0x26d6fc[_0xe0bd('0x49')][_0xe0bd('0x30')]);_0x26d6fc[_0xe0bd('0x49')][_0xe0bd('0x55')]=integrations['getDescriptions'](_0x26d6fc[_0xe0bd('0x49')]['channel'],_0x26d6fc[_0xe0bd('0x49')]['type']);return db[_0xe0bd('0x4e')][_0xe0bd('0x48')](_0x26d6fc[_0xe0bd('0x49')],{'include':[{'model':db[_0xe0bd('0x56')],'as':_0xe0bd('0x57')},{'model':db[_0xe0bd('0x56')],'as':_0xe0bd('0x55')}]});}return null;})[_0xe0bd('0x28')](respondWithResult(_0x5a43e0,null))[_0xe0bd('0x4a')](handleError(_0x5a43e0,null));};exports[_0xe0bd('0x58')]=function(_0x47d775,_0x2a997f,_0x354f31){var _0x184c64=_0x47d775[_0xe0bd('0x33')][_0xe0bd('0x59')];var _0x2336d8=_0x184c64===_0xe0bd('0x5a')?_0xe0bd('0x5b'):_0xe0bd('0x5c');var _0xde7194='';var _0x4a5413='';var _0x5c4ba0='';var _0x23c450='';var _0x95dd5='';var _0x236217='';var _0x522daf='';var _0x46841c='';var _0x10a29b=[_0xe0bd('0x5d'),'description',_0xe0bd('0x5e'),_0xe0bd('0x5f'),'caseorigincode',_0xe0bd('0x60'),_0xe0bd('0x61'),_0xe0bd('0x62'),_0xe0bd('0x63'),'phonecall_activity_parties'];var _0x543e78=[_0xe0bd('0x64'),'accountidyominame',_0xe0bd('0x65'),_0xe0bd('0x66'),_0xe0bd('0x67'),_0xe0bd('0x68'),_0xe0bd('0x69'),_0xe0bd('0x6a'),_0xe0bd('0x6b'),'createdbyexternalpartyyominame',_0xe0bd('0x6c'),_0xe0bd('0x6d'),_0xe0bd('0x6e'),'createdonbehalfbyname','createdonbehalfbyyominame','customeridname',_0xe0bd('0x6f'),_0xe0bd('0x70'),_0xe0bd('0x71'),_0xe0bd('0x72'),_0xe0bd('0x73'),_0xe0bd('0x74'),'escalatedon',_0xe0bd('0x75'),'firstresponsebykpiidname','followupby',_0xe0bd('0x76'),_0xe0bd('0x77'),_0xe0bd('0x78'),_0xe0bd('0x79'),_0xe0bd('0x7a'),_0xe0bd('0x7b'),_0xe0bd('0x7c'),_0xe0bd('0x7d'),_0xe0bd('0x7e'),_0xe0bd('0x7f'),_0xe0bd('0x80'),'modifiedonbehalfbyyominame',_0xe0bd('0x81'),_0xe0bd('0x82'),'numberofchildincidents',_0xe0bd('0x83'),_0xe0bd('0x84'),'owneridname','owneridtype',_0xe0bd('0x85'),_0xe0bd('0x86'),_0xe0bd('0x87'),'primarycontactidyominame','prioritycodename','productidname','productserialnumber',_0xe0bd('0x88'),'resolvebykpiidname',_0xe0bd('0x89'),_0xe0bd('0x8a'),'responsiblecontactidyominame',_0xe0bd('0x8b'),_0xe0bd('0x8c'),_0xe0bd('0x8d'),_0xe0bd('0x8e'),_0xe0bd('0x8f'),_0xe0bd('0x90'),_0xe0bd('0x91'),_0xe0bd('0x92'),_0xe0bd('0x93'),_0xe0bd('0x94'),'traversedpath',_0xe0bd('0x95'),_0xe0bd('0x96')];var _0x17ecc0=_0x10a29b['concat'](_0x543e78);return db[_0xe0bd('0x2d')][_0xe0bd('0x4d')]({'where':{'id':_0x47d775[_0xe0bd('0x4b')]['id']},'attributes':['id','username',_0xe0bd('0x97'),_0xe0bd('0x98'),'tenantId',_0xe0bd('0x99'),_0xe0bd('0x9a')]})[_0xe0bd('0x28')](handleEntityNotFound(_0x2a997f,null))[_0xe0bd('0x28')](function(_0x425159){if(_0x425159){_0x46841c=_0x425159[_0xe0bd('0x98')];var _0x5dbbc7=_0x46841c[_0xe0bd('0x9b')](-0x1);if(_0x5dbbc7==='/'){_0x46841c=_0x46841c[_0xe0bd('0x9c')](0x0,_0x46841c[_0xe0bd('0x9d')](_0x5dbbc7));}_0x522daf=util[_0xe0bd('0x9e')](_0xe0bd('0x9f'),_0x46841c);var _0x1a32a1={'method':_0xe0bd('0xa0'),'uri':_0xe0bd('0xa1')+_0x425159['tenantId']+_0xe0bd('0xa2'),'form':{'client_id':_0x425159[_0xe0bd('0x99')],'resource':_0x46841c,'username':_0x425159['username'],'password':_0x425159[_0xe0bd('0x97')],'grant_type':_0xe0bd('0x97'),'client_secret':_0x425159[_0xe0bd('0x9a')]},'json':!![]};return rp(_0x1a32a1);}})['then'](function(_0x445a58){_0x236217=_0x445a58[_0xe0bd('0xa3')];var _0x5dfb39={'method':_0xe0bd('0xa4'),'uri':encodeURI(_0x522daf+_0xe0bd('0xa5')+_0x2336d8+'\x27'),'headers':{'Authorization':_0xe0bd('0xa6')+_0x236217,'If-None-Match':null,'OData-Version':_0xe0bd('0xa7')},'json':!![]};return rp(_0x5dfb39);})[_0xe0bd('0x28')](function(_0xc295e9){var _0x53ba2f=_0xc295e9[_0xe0bd('0xa8')][0x0];var _0x5be878=_0x53ba2f[_0xe0bd('0xa9')];var _0x308efa={'method':_0xe0bd('0xa4'),'uri':_0x522daf+_0xe0bd('0xaa')+_0x5be878+_0xe0bd('0xab'),'headers':{'Authorization':_0xe0bd('0xa6')+_0x236217,'If-None-Match':null,'OData-Version':_0xe0bd('0xa7')},'json':!![]};return rp(_0x308efa);})[_0xe0bd('0x28')](function(_0xe753ad){_0xde7194=_0xe753ad;_0x4a5413=_0xde7194['Attributes'];_0x4a5413=_[_0xe0bd('0xac')](_0x4a5413,function(_0x2d742d){return!_0x17ecc0['includes'](_0x2d742d[_0xe0bd('0xad')]);});var _0x35ee85=[];var _0x142b98=[];_0x4a5413[_0xe0bd('0xae')](function(_0x40f0e1){if(_0x40f0e1[_0xe0bd('0xaf')]){var _0x117abb=_0x40f0e1['@odata.type'][_0xe0bd('0x9c')](_0x40f0e1[_0xe0bd('0xaf')][_0xe0bd('0x9d')]('.')+0x1);if(_0x117abb==='PicklistAttributeMetadata'){_0x35ee85[_0xe0bd('0xb0')](getSelectList(_0x522daf,_0x184c64,_0x142b98,_0xde7194['MetadataId'],_0x40f0e1[_0xe0bd('0xa9')],_0x236217));}}});return Promise[_0xe0bd('0xb1')](_0x35ee85);})[_0xe0bd('0x28')](function(_0x280107){_0x5c4ba0=_0x280107[0x0];var _0x359b34=[];var _0x538adf=[];_0x4a5413[_0xe0bd('0xae')](function(_0x14bb92){if(!_[_0xe0bd('0xb2')](_0x14bb92[_0xe0bd('0xaf')])){var _0x3edc86=_0x14bb92[_0xe0bd('0xaf')][_0xe0bd('0x9c')](_0x14bb92[_0xe0bd('0xaf')][_0xe0bd('0x9d')]('.')+0x1);if(_0x3edc86===_0xe0bd('0xb3')){_0x359b34[_0xe0bd('0xb0')](getBooleanList(_0x522daf,_0x184c64,_0x538adf,_0xde7194['MetadataId'],_0x14bb92[_0xe0bd('0xa9')],_0x236217));}}});return Promise[_0xe0bd('0xb1')](_0x359b34);})['then'](function(_0x220710){_0x23c450=_0x220710[0x0];var _0x4d7f3b=[];var _0xd8aba3=[];_0x4a5413[_0xe0bd('0xae')](function(_0x202f9b){if(_0x202f9b['@odata.type']){var _0x1e75b6=_0x202f9b[_0xe0bd('0xaf')][_0xe0bd('0x9c')](_0x202f9b[_0xe0bd('0xaf')][_0xe0bd('0x9d')]('.')+0x1);if(_0x1e75b6===_0xe0bd('0xb4')||_0x1e75b6===_0xe0bd('0xb5')||_0x1e75b6===_0xe0bd('0xb6')||_0x1e75b6==='IntegerAttributeMetadata'||_0x1e75b6===_0xe0bd('0xb7')||_0x1e75b6===_0xe0bd('0xb8')||_0x1e75b6===_0xe0bd('0xb9')||_0x1e75b6==='EntityNameAttributeMetadata'||_0x1e75b6===_0xe0bd('0xba')||_0x1e75b6===_0xe0bd('0xbb')){_0x4d7f3b[_0xe0bd('0xb0')](getInputList(_0x522daf,_0x184c64,_0x1e75b6,_0xd8aba3,_0xde7194['MetadataId'],_0x202f9b['MetadataId'],_0x236217));}}});return Promise[_0xe0bd('0xb1')](_0x4d7f3b);})['then'](function(_0x2aec8e){_0x95dd5=_0x2aec8e[0x0];var _0x58629=_0x5c4ba0[_0xe0bd('0xbc')](_0x23c450)[_0xe0bd('0xbc')](_0x95dd5);var _0x4eaa9b={'count':_0x58629[_0xe0bd('0x46')],'rows':_0x58629};return _0x4eaa9b;})[_0xe0bd('0x28')](respondWithResult(_0x2a997f,null))[_0xe0bd('0x4a')](function(_0x26e2a7){var _0x591a5e=_0x47d775['query'][_0xe0bd('0xbd')]?0x1f4:_0x26e2a7['statusCode']||0x1f4;logger[_0xe0bd('0x2a')](_0x26e2a7[_0xe0bd('0xbe')]);delete _0x26e2a7[_0xe0bd('0x2b')];if(_0x591a5e===0x191){_0x591a5e=0x190;}_0x2a997f[_0xe0bd('0x1c')](_0x591a5e)[_0xe0bd('0xbf')](_0x47d775[_0xe0bd('0x33')][_0xe0bd('0xbd')]?{'message':_0xe0bd('0xc0'),'statusCode':_0x26e2a7['statusCode']}:_0x26e2a7);});};function getSelectList(_0x59833b,_0x197ddb,_0x193257,_0x35e991,_0x28de70,_0x4e9055){var _0x28ee47={'method':'GET','uri':_0x59833b+_0xe0bd('0xaa')+_0x35e991+')/Attributes('+_0x28de70+_0xe0bd('0xc1')+_0xe0bd('0xc2'),'headers':{'Authorization':_0xe0bd('0xa6')+_0x4e9055,'If-None-Match':null,'OData-Version':_0xe0bd('0xa7')},'json':!![]};return rp(_0x28ee47)[_0xe0bd('0x28')](function(_0x1736a3){var _0x176d4a=[];var _0x3c5f36=_0x1736a3[_0xe0bd('0xc3')]['Options'];_0x3c5f36[_0xe0bd('0xae')](function(_0xc3798b){_0x176d4a['push']({'name':_0xc3798b[_0xe0bd('0xc4')][_0xe0bd('0xc5')][_0xe0bd('0xc4')],'value':String(_0xc3798b[_0xe0bd('0xc6')])});});var _0x4408f8={'id':_0x197ddb+'_'+_0x1736a3[_0xe0bd('0xad')],'name':_0x1736a3[_0xe0bd('0xc7')][_0xe0bd('0xc5')]['Label'],'custom':![],'options':_0x176d4a};_0x193257[_0xe0bd('0xb0')](_0x4408f8);return _0x193257;});}function getBooleanList(_0x6bf871,_0x46fa11,_0x461598,_0x4e0ed9,_0x133415,_0x5e396b){var _0x8850b4={'method':_0xe0bd('0xa4'),'uri':_0x6bf871+_0xe0bd('0xaa')+_0x4e0ed9+_0xe0bd('0xc8')+_0x133415+_0xe0bd('0xc9'),'headers':{'Authorization':_0xe0bd('0xa6')+_0x5e396b,'If-None-Match':null,'OData-Version':_0xe0bd('0xa7')},'json':!![]};return rp(_0x8850b4)[_0xe0bd('0x28')](function(_0x3f9bd1){var _0x1cfdfa=[];_0x1cfdfa[_0xe0bd('0xb0')]({'name':_0x3f9bd1[_0xe0bd('0xc3')][_0xe0bd('0xca')][_0xe0bd('0xc4')][_0xe0bd('0xc5')][_0xe0bd('0xc4')],'value':_0xe0bd('0xcb')},{'name':_0x3f9bd1[_0xe0bd('0xc3')]['FalseOption'][_0xe0bd('0xc4')][_0xe0bd('0xc5')][_0xe0bd('0xc4')],'value':_0xe0bd('0xcc')});var _0x23b4c4={'id':_0x46fa11+'_'+_0x3f9bd1[_0xe0bd('0xad')],'name':_0x3f9bd1['DisplayName'][_0xe0bd('0xc5')][_0xe0bd('0xc4')],'custom':![],'options':_0x1cfdfa};_0x461598['push'](_0x23b4c4);return _0x461598;});}function getInputList(_0x1daf26,_0x35125d,_0x41b36e,_0x5cc40c,_0x66909f,_0x549200,_0x373911){var _0x123a1c={'method':_0xe0bd('0xa4'),'uri':_0x1daf26+_0xe0bd('0xaa')+_0x66909f+_0xe0bd('0xc8')+_0x549200+_0xe0bd('0xcd')+_0x41b36e+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x373911,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x123a1c)[_0xe0bd('0x28')](function(_0x2271d4){var _0x482458={'id':_0x35125d+'_'+_0x2271d4[_0xe0bd('0xad')],'name':_0x2271d4['DisplayName'][_0xe0bd('0xc5')]?_0x2271d4[_0xe0bd('0xc7')][_0xe0bd('0xc5')][_0xe0bd('0xc4')]:_0x2271d4[_0xe0bd('0xad')],'custom':![],'options':[]};_0x5cc40c['push'](_0x482458);return _0x5cc40c;});} \ No newline at end of file +var _0x292e=['bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','stack','name','index','map','Dynamics365Account','fieldName','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','rawAttributes','intersection','options','find','create','body','catch','destroy','getConfigurations','Dynamics365Configuration','addConfiguration','Subjects','getSubjects','channel','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','importsequencenumber','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','findOne','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','lastIndexOf','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','error','send','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','UserLocalizedLabel','false',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x292e,0xcb));var _0xe292=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x292e[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0xe292('0x0'));var rimraf=require(_0xe292('0x1'));var zipdir=require(_0xe292('0x2'));var jsonpatch=require(_0xe292('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe292('0x4'));var Mustache=require(_0xe292('0x5'));var util=require(_0xe292('0x6'));var path=require(_0xe292('0x7'));var sox=require('sox');var csv=require(_0xe292('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe292('0x9'));var _=require(_0xe292('0xa'));var squel=require(_0xe292('0xb'));var crypto=require(_0xe292('0xc'));var jsforce=require(_0xe292('0xd'));var deskjs=require(_0xe292('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe292('0xf'));var Redis=require(_0xe292('0x10'));var authService=require(_0xe292('0x11'));var qs=require(_0xe292('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe292('0x13'));var logger=require(_0xe292('0x14'))('api');var utils=require(_0xe292('0x15'));var config=require(_0xe292('0x16'));var licenseUtil=require(_0xe292('0x17'));var db=require(_0xe292('0x18'))['db'];var integrations=require(_0xe292('0x19'));function respondWithStatusCode(_0x3c73ea,_0x52ae8b){_0x52ae8b=_0x52ae8b||0xcc;return function(_0x278967){if(_0x278967){return _0x3c73ea[_0xe292('0x1a')](_0x52ae8b);}return _0x3c73ea[_0xe292('0x1b')](_0x52ae8b)[_0xe292('0x1c')]();};}function respondWithResult(_0x1df3da,_0x2512fd){_0x2512fd=_0x2512fd||0xc8;return function(_0x3a2a83){if(_0x3a2a83){return _0x1df3da['status'](_0x2512fd)[_0xe292('0x1d')](_0x3a2a83);}};}function respondWithFilteredResult(_0x1de9ec,_0x51fa78){return function(_0x582549){if(_0x582549){var _0x46593f=typeof _0x51fa78[_0xe292('0x1e')]===_0xe292('0x1f')&&typeof _0x51fa78[_0xe292('0x20')]==='undefined';var _0x1a6e9e=_0x582549['count'];var _0x1ba5bb=_0x46593f?0x0:_0x51fa78[_0xe292('0x1e')];var _0x57b0f7=_0x46593f?_0x582549[_0xe292('0x21')]:_0x51fa78[_0xe292('0x1e')]+_0x51fa78[_0xe292('0x20')];var _0x4c68c9;if(_0x57b0f7>=_0x1a6e9e){_0x57b0f7=_0x1a6e9e;_0x4c68c9=0xc8;}else{_0x4c68c9=0xce;}_0x1de9ec[_0xe292('0x1b')](_0x4c68c9);return _0x1de9ec[_0xe292('0x22')]('Content-Range',_0x1ba5bb+'-'+_0x57b0f7+'/'+_0x1a6e9e)[_0xe292('0x1d')](_0x582549);}return null;};}function patchUpdates(_0x6298f5){return function(_0x3c8d7f){try{jsonpatch[_0xe292('0x23')](_0x3c8d7f,_0x6298f5,!![]);}catch(_0x1052a7){return BPromise[_0xe292('0x24')](_0x1052a7);}return _0x3c8d7f['save']();};}function saveUpdates(_0x1589eb,_0x47813d){return function(_0x16d60c){if(_0x16d60c){return _0x16d60c[_0xe292('0x25')](_0x1589eb)[_0xe292('0x26')](function(_0x3677c4){return _0x3677c4;});}return null;};}function removeEntity(_0x83d82e,_0x13ae73){return function(_0x8370db){if(_0x8370db){return _0x8370db['destroy']()[_0xe292('0x26')](function(){_0x83d82e[_0xe292('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x488c76,_0x145044){return function(_0x22af74){if(!_0x22af74){_0x488c76[_0xe292('0x1a')](0x194);}return _0x22af74;};}function handleError(_0x24cfe5,_0x3c8b85){_0x3c8b85=_0x3c8b85||0x1f4;return function(_0x25de38){logger['error'](_0x25de38[_0xe292('0x27')]);if(_0x25de38[_0xe292('0x28')]){delete _0x25de38[_0xe292('0x28')];}_0x24cfe5[_0xe292('0x1b')](_0x3c8b85)['send'](_0x25de38);};}exports[_0xe292('0x29')]=function(_0x56d1bb,_0x358ed5){var _0xcdf2d={},_0x35f8c8={},_0x458ecf={'count':0x0,'rows':[]};var _0xf6362a=_[_0xe292('0x2a')](db[_0xe292('0x2b')]['rawAttributes'],function(_0x42d441){return{'name':_0x42d441[_0xe292('0x2c')],'type':_0x42d441[_0xe292('0x2d')][_0xe292('0x2e')]};});_0x35f8c8['model']=_[_0xe292('0x2a')](_0xf6362a,_0xe292('0x28'));_0x35f8c8[_0xe292('0x2f')]=_['keys'](_0x56d1bb[_0xe292('0x2f')]);_0x35f8c8[_0xe292('0x30')]=_['intersection'](_0x35f8c8[_0xe292('0x31')],_0x35f8c8[_0xe292('0x2f')]);_0xcdf2d['attributes']=_['intersection'](_0x35f8c8[_0xe292('0x31')],qs[_0xe292('0x32')](_0x56d1bb['query']['fields']));_0xcdf2d[_0xe292('0x33')]=_0xcdf2d[_0xe292('0x33')][_0xe292('0x34')]?_0xcdf2d[_0xe292('0x33')]:_0x35f8c8[_0xe292('0x31')];if(!_0x56d1bb['query'][_0xe292('0x35')](_0xe292('0x36'))){_0xcdf2d['limit']=qs[_0xe292('0x20')](_0x56d1bb['query'][_0xe292('0x20')]);_0xcdf2d[_0xe292('0x1e')]=qs[_0xe292('0x1e')](_0x56d1bb['query'][_0xe292('0x1e')]);}_0xcdf2d['order']=qs[_0xe292('0x37')](_0x56d1bb[_0xe292('0x2f')][_0xe292('0x37')]);_0xcdf2d[_0xe292('0x38')]=qs[_0xe292('0x30')](_[_0xe292('0x39')](_0x56d1bb[_0xe292('0x2f')],_0x35f8c8[_0xe292('0x30')]),_0xf6362a);if(_0x56d1bb[_0xe292('0x2f')][_0xe292('0x3a')]){_0xcdf2d[_0xe292('0x38')]=_[_0xe292('0x3b')](_0xcdf2d[_0xe292('0x38')],{'$or':_[_0xe292('0x2a')](_0xf6362a,function(_0x37285a){if(_0x37285a[_0xe292('0x2d')]!==_0xe292('0x3c')){var _0x596cc9={};_0x596cc9[_0x37285a[_0xe292('0x28')]]={'$like':'%'+_0x56d1bb[_0xe292('0x2f')][_0xe292('0x3a')]+'%'};return _0x596cc9;}})});}_0xcdf2d=_['merge']({},_0xcdf2d,_0x56d1bb['options']);var _0x22d372={'where':_0xcdf2d[_0xe292('0x38')]};return db[_0xe292('0x2b')]['count'](_0x22d372)['then'](function(_0x335efe){_0x458ecf[_0xe292('0x21')]=_0x335efe;if(_0x56d1bb[_0xe292('0x2f')][_0xe292('0x3d')]){_0xcdf2d[_0xe292('0x3e')]=[{'all':!![]}];}return db[_0xe292('0x2b')]['findAll'](_0xcdf2d);})[_0xe292('0x26')](function(_0x56a909){_0x458ecf[_0xe292('0x3f')]=_0x56a909;return _0x458ecf;})[_0xe292('0x26')](respondWithFilteredResult(_0x358ed5,_0xcdf2d))['catch'](handleError(_0x358ed5,null));};exports[_0xe292('0x40')]=function(_0x554346,_0x4a57ce){var _0xe39fb4={'raw':![],'where':{'id':_0x554346[_0xe292('0x41')]['id']}},_0x3e3606={};_0x3e3606[_0xe292('0x31')]=_[_0xe292('0x42')](db[_0xe292('0x2b')][_0xe292('0x43')]);_0x3e3606[_0xe292('0x2f')]=_['keys'](_0x554346['query']);_0x3e3606[_0xe292('0x30')]=_[_0xe292('0x44')](_0x3e3606[_0xe292('0x31')],_0x3e3606[_0xe292('0x2f')]);_0xe39fb4[_0xe292('0x33')]=_[_0xe292('0x44')](_0x3e3606[_0xe292('0x31')],qs['fields'](_0x554346[_0xe292('0x2f')][_0xe292('0x32')]));_0xe39fb4['attributes']=_0xe39fb4['attributes'][_0xe292('0x34')]?_0xe39fb4[_0xe292('0x33')]:_0x3e3606[_0xe292('0x31')];if(_0x554346['query'][_0xe292('0x3d')]){_0xe39fb4[_0xe292('0x3e')]=[{'all':!![]}];}_0xe39fb4=_[_0xe292('0x3b')]({},_0xe39fb4,_0x554346[_0xe292('0x45')]);return db[_0xe292('0x2b')][_0xe292('0x46')](_0xe39fb4)[_0xe292('0x26')](handleEntityNotFound(_0x4a57ce,null))[_0xe292('0x26')](respondWithResult(_0x4a57ce,null))['catch'](handleError(_0x4a57ce,null));};exports[_0xe292('0x47')]=function(_0xc57ae7,_0x440018){return db[_0xe292('0x2b')][_0xe292('0x47')](_0xc57ae7[_0xe292('0x48')],{})[_0xe292('0x26')](respondWithResult(_0x440018,0xc9))['catch'](handleError(_0x440018,null));};exports[_0xe292('0x25')]=function(_0x59ee5e,_0x4ede4e){if(_0x59ee5e[_0xe292('0x48')]['id']){delete _0x59ee5e[_0xe292('0x48')]['id'];}return db['Dynamics365Account'][_0xe292('0x46')]({'where':{'id':_0x59ee5e[_0xe292('0x41')]['id']}})[_0xe292('0x26')](handleEntityNotFound(_0x4ede4e,null))[_0xe292('0x26')](saveUpdates(_0x59ee5e[_0xe292('0x48')],null))['then'](respondWithResult(_0x4ede4e,null))[_0xe292('0x49')](handleError(_0x4ede4e,null));};exports[_0xe292('0x4a')]=function(_0x5733a7,_0x5cee6c){return db[_0xe292('0x2b')][_0xe292('0x46')]({'where':{'id':_0x5733a7['params']['id']}})[_0xe292('0x26')](handleEntityNotFound(_0x5cee6c,null))[_0xe292('0x26')](removeEntity(_0x5cee6c,null))['catch'](handleError(_0x5cee6c,null));};exports[_0xe292('0x4b')]=function(_0x2997d2,_0x46c2bb,_0x39b840){var _0x4615c4={};var _0xc513dc={};var _0x20a287;var _0x3e236f;return db[_0xe292('0x2b')]['findOne']({'where':{'id':_0x2997d2[_0xe292('0x41')]['id']}})[_0xe292('0x26')](handleEntityNotFound(_0x46c2bb,null))['then'](function(_0x460b83){if(_0x460b83){_0x20a287=_0x460b83;_0xc513dc[_0xe292('0x31')]=_[_0xe292('0x42')](db[_0xe292('0x4c')]['rawAttributes']);_0xc513dc[_0xe292('0x2f')]=_[_0xe292('0x42')](_0x2997d2[_0xe292('0x2f')]);_0xc513dc[_0xe292('0x30')]=_[_0xe292('0x44')](_0xc513dc[_0xe292('0x31')],_0xc513dc['query']);_0x4615c4[_0xe292('0x33')]=_[_0xe292('0x44')](_0xc513dc['model'],qs[_0xe292('0x32')](_0x2997d2[_0xe292('0x2f')]['fields']));_0x4615c4[_0xe292('0x33')]=_0x4615c4[_0xe292('0x33')]['length']?_0x4615c4['attributes']:_0xc513dc[_0xe292('0x31')];_0x4615c4['order']=qs['sort'](_0x2997d2[_0xe292('0x2f')][_0xe292('0x37')]);_0x4615c4[_0xe292('0x38')]=qs[_0xe292('0x30')](_['pick'](_0x2997d2[_0xe292('0x2f')],_0xc513dc['filters']));if(_0x2997d2['query'][_0xe292('0x3a')]){_0x4615c4[_0xe292('0x38')]=_[_0xe292('0x3b')](_0x4615c4[_0xe292('0x38')],{'$or':_['map'](_0x4615c4['attributes'],function(_0x863e8f){var _0x1765b4={};_0x1765b4[_0x863e8f]={'$like':'%'+_0x2997d2['query'][_0xe292('0x3a')]+'%'};return _0x1765b4;})});}_0x4615c4=_[_0xe292('0x3b')]({},_0x4615c4,_0x2997d2[_0xe292('0x45')]);return _0x20a287[_0xe292('0x4b')](_0x4615c4);}})['then'](function(_0x57062c){if(_0x57062c){_0x3e236f=_0x57062c[_0xe292('0x34')];if(!_0x2997d2['query'][_0xe292('0x35')](_0xe292('0x36'))){_0x4615c4[_0xe292('0x20')]=qs[_0xe292('0x20')](_0x2997d2[_0xe292('0x2f')]['limit']);_0x4615c4[_0xe292('0x1e')]=qs[_0xe292('0x1e')](_0x2997d2[_0xe292('0x2f')]['offset']);}return _0x20a287[_0xe292('0x4b')](_0x4615c4);}})[_0xe292('0x26')](function(_0x3b3afe){if(_0x3b3afe){return _0x3b3afe?{'count':_0x3e236f,'rows':_0x3b3afe}:null;}})['then'](respondWithResult(_0x46c2bb,null))[_0xe292('0x49')](handleError(_0x46c2bb,null));};exports[_0xe292('0x4d')]=function(_0x2b3601,_0x158994,_0x2bbdcb){if(_0x2b3601[_0xe292('0x48')]['id']){delete _0x2b3601[_0xe292('0x48')]['id'];}return db[_0xe292('0x2b')]['findOne']({'where':{'id':_0x2b3601[_0xe292('0x41')]['id']}})[_0xe292('0x26')](handleEntityNotFound(_0x158994,null))[_0xe292('0x26')](function(_0x1eed93){if(_0x1eed93){_0x2b3601['body']['AccountId']=_0x1eed93['id'];_0x2b3601[_0xe292('0x48')][_0xe292('0x4e')]=integrations[_0xe292('0x4f')](_0x2b3601['body'][_0xe292('0x50')],_0x2b3601[_0xe292('0x48')][_0xe292('0x2d')]);_0x2b3601[_0xe292('0x48')]['Descriptions']=integrations['getDescriptions'](_0x2b3601['body'][_0xe292('0x50')],_0x2b3601['body']['type']);return db['Dynamics365Configuration']['create'](_0x2b3601[_0xe292('0x48')],{'include':[{'model':db['Dynamics365Field'],'as':_0xe292('0x4e')},{'model':db[_0xe292('0x51')],'as':_0xe292('0x52')}]});}return null;})[_0xe292('0x26')](respondWithResult(_0x158994,null))[_0xe292('0x49')](handleError(_0x158994,null));};exports[_0xe292('0x53')]=function(_0x2b52cb,_0x358e95,_0xd41cb0){var _0x48fb92=_0x2b52cb[_0xe292('0x2f')][_0xe292('0x54')];var _0x320339=_0x48fb92===_0xe292('0x55')?_0xe292('0x56'):_0xe292('0x57');var _0x186d18='';var _0xfd6f88='';var _0x2b72cf='';var _0x49918d='';var _0x5456fd='';var _0x19a220='';var _0x7bd0cd='';var _0x3fbc0e='';var _0xb935b0=[_0xe292('0x58'),'description',_0xe292('0x59'),_0xe292('0x5a'),_0xe292('0x5b'),_0xe292('0x5c'),_0xe292('0x5d'),_0xe292('0x5e'),'directioncode',_0xe292('0x5f')];var _0x53bb42=[_0xe292('0x60'),_0xe292('0x61'),'actualserviceunits',_0xe292('0x62'),_0xe292('0x63'),'contactidyominame','contractdetailidname',_0xe292('0x64'),_0xe292('0x65'),'createdbyexternalpartyyominame',_0xe292('0x66'),_0xe292('0x67'),_0xe292('0x68'),_0xe292('0x69'),_0xe292('0x6a'),_0xe292('0x6b'),'customeridtype',_0xe292('0x6c'),'emailaddress',_0xe292('0x6d'),_0xe292('0x6e'),_0xe292('0x6f'),_0xe292('0x70'),'exchangerate',_0xe292('0x71'),'followupby',_0xe292('0x72'),'influencescore','kbarticleidname',_0xe292('0x73'),'masteridname',_0xe292('0x74'),_0xe292('0x75'),_0xe292('0x76'),_0xe292('0x77'),_0xe292('0x78'),_0xe292('0x79'),'modifiedonbehalfbyyominame',_0xe292('0x7a'),_0xe292('0x7b'),_0xe292('0x7c'),'onholdtime',_0xe292('0x7d'),_0xe292('0x7e'),_0xe292('0x7f'),_0xe292('0x80'),_0xe292('0x81'),_0xe292('0x82'),'primarycontactidyominame',_0xe292('0x83'),'productidname',_0xe292('0x84'),'resolveby',_0xe292('0x85'),_0xe292('0x86'),_0xe292('0x87'),'responsiblecontactidyominame',_0xe292('0x88'),'slainvokedidname',_0xe292('0x89'),_0xe292('0x8a'),'statecode','statuscode',_0xe292('0x8b'),_0xe292('0x8c'),_0xe292('0x8d'),_0xe292('0x8e'),_0xe292('0x8f'),'utcconversiontimezonecode',_0xe292('0x90')];var _0x455d76=_0xb935b0[_0xe292('0x91')](_0x53bb42);return db[_0xe292('0x2b')][_0xe292('0x92')]({'where':{'id':_0x2b52cb['params']['id']},'attributes':['id',_0xe292('0x93'),_0xe292('0x94'),_0xe292('0x95'),_0xe292('0x96'),_0xe292('0x97'),_0xe292('0x98')]})[_0xe292('0x26')](handleEntityNotFound(_0x358e95,null))[_0xe292('0x26')](function(_0x1e21b4){if(_0x1e21b4){_0x3fbc0e=_0x1e21b4[_0xe292('0x95')];var _0x4ed2b1=_0x3fbc0e[_0xe292('0x99')](-0x1);if(_0x4ed2b1==='/'){_0x3fbc0e=_0x3fbc0e[_0xe292('0x9a')](0x0,_0x3fbc0e['lastIndexOf'](_0x4ed2b1));}_0x7bd0cd=util[_0xe292('0x9b')](_0xe292('0x9c'),_0x3fbc0e);var _0x5dc252={'method':_0xe292('0x9d'),'uri':_0xe292('0x9e')+_0x1e21b4['tenantId']+_0xe292('0x9f'),'form':{'client_id':_0x1e21b4[_0xe292('0x97')],'resource':_0x3fbc0e,'username':_0x1e21b4[_0xe292('0x93')],'password':_0x1e21b4['password'],'grant_type':_0xe292('0x94'),'client_secret':_0x1e21b4[_0xe292('0x98')]},'json':!![]};return rp(_0x5dc252);}})[_0xe292('0x26')](function(_0x540526){_0x19a220=_0x540526['access_token'];var _0x244a22={'method':_0xe292('0xa0'),'uri':encodeURI(_0x7bd0cd+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x320339+'\x27'),'headers':{'Authorization':_0xe292('0xa1')+_0x19a220,'If-None-Match':null,'OData-Version':_0xe292('0xa2')},'json':!![]};return rp(_0x244a22);})[_0xe292('0x26')](function(_0xea27fc){var _0x458fb3=_0xea27fc[_0xe292('0xa3')][0x0];var _0x22c9de=_0x458fb3[_0xe292('0xa4')];var _0x3f95d4={'method':_0xe292('0xa0'),'uri':_0x7bd0cd+_0xe292('0xa5')+_0x22c9de+_0xe292('0xa6'),'headers':{'Authorization':_0xe292('0xa1')+_0x19a220,'If-None-Match':null,'OData-Version':_0xe292('0xa2')},'json':!![]};return rp(_0x3f95d4);})[_0xe292('0x26')](function(_0x4ff130){_0x186d18=_0x4ff130;_0xfd6f88=_0x186d18[_0xe292('0xa7')];_0xfd6f88=_[_0xe292('0xa8')](_0xfd6f88,function(_0xf92b55){return!_0x455d76[_0xe292('0xa9')](_0xf92b55['LogicalName']);});var _0x46507a=[];var _0x5ad7c9=[];_0xfd6f88[_0xe292('0xaa')](function(_0x2cc9){if(_0x2cc9['@odata.type']){var _0x2fd9ff=_0x2cc9[_0xe292('0xab')][_0xe292('0x9a')](_0x2cc9[_0xe292('0xab')]['lastIndexOf']('.')+0x1);if(_0x2fd9ff===_0xe292('0xac')){_0x46507a[_0xe292('0xad')](getSelectList(_0x7bd0cd,_0x48fb92,_0x5ad7c9,_0x186d18[_0xe292('0xa4')],_0x2cc9['MetadataId'],_0x19a220));}}});return Promise[_0xe292('0xae')](_0x46507a);})[_0xe292('0x26')](function(_0x205912){_0x2b72cf=_0x205912[0x0];var _0x28663a=[];var _0x531e04=[];_0xfd6f88[_0xe292('0xaa')](function(_0x2634c7){if(!_[_0xe292('0xaf')](_0x2634c7[_0xe292('0xab')])){var _0x5962ae=_0x2634c7[_0xe292('0xab')][_0xe292('0x9a')](_0x2634c7['@odata.type'][_0xe292('0xb0')]('.')+0x1);if(_0x5962ae===_0xe292('0xb1')){_0x28663a['push'](getBooleanList(_0x7bd0cd,_0x48fb92,_0x531e04,_0x186d18['MetadataId'],_0x2634c7['MetadataId'],_0x19a220));}}});return Promise[_0xe292('0xae')](_0x28663a);})[_0xe292('0x26')](function(_0xe1b3dc){_0x49918d=_0xe1b3dc[0x0];var _0x313812=[];var _0x1727f0=[];_0xfd6f88[_0xe292('0xaa')](function(_0x4ede3a){if(_0x4ede3a[_0xe292('0xab')]){var _0x88e206=_0x4ede3a[_0xe292('0xab')][_0xe292('0x9a')](_0x4ede3a[_0xe292('0xab')][_0xe292('0xb0')]('.')+0x1);if(_0x88e206===_0xe292('0xb2')||_0x88e206===_0xe292('0xb3')||_0x88e206===_0xe292('0xb4')||_0x88e206===_0xe292('0xb5')||_0x88e206===_0xe292('0xb6')||_0x88e206===_0xe292('0xb7')||_0x88e206===_0xe292('0xb8')||_0x88e206===_0xe292('0xb9')||_0x88e206===_0xe292('0xba')||_0x88e206==='DecimalAttributeMetadata'){_0x313812[_0xe292('0xad')](getInputList(_0x7bd0cd,_0x48fb92,_0x88e206,_0x1727f0,_0x186d18['MetadataId'],_0x4ede3a[_0xe292('0xa4')],_0x19a220));}}});return Promise[_0xe292('0xae')](_0x313812);})[_0xe292('0x26')](function(_0x4aacf1){_0x5456fd=_0x4aacf1[0x0];var _0x1b55d8=_0x2b72cf[_0xe292('0x91')](_0x49918d)[_0xe292('0x91')](_0x5456fd);var _0x35d00b={'count':_0x1b55d8['length'],'rows':_0x1b55d8};return _0x35d00b;})['then'](respondWithResult(_0x358e95,null))['catch'](function(_0x4aff3a){var _0x1072bc=_0x2b52cb[_0xe292('0x2f')][_0xe292('0xbb')]?0x1f4:_0x4aff3a['statusCode']||0x1f4;logger[_0xe292('0xbc')](_0x4aff3a[_0xe292('0x27')]);delete _0x4aff3a[_0xe292('0x28')];if(_0x1072bc===0x191){_0x1072bc=0x190;}_0x358e95[_0xe292('0x1b')](_0x1072bc)[_0xe292('0xbd')](_0x2b52cb[_0xe292('0x2f')][_0xe292('0xbb')]?{'message':_0xe292('0xbe'),'statusCode':_0x4aff3a[_0xe292('0xbf')]}:_0x4aff3a);});};function getSelectList(_0x40a3c7,_0x43a9c5,_0x44254a,_0x19fd36,_0x5f253c,_0x4af120){var _0x21c50f={'method':_0xe292('0xa0'),'uri':_0x40a3c7+'EntityDefinitions('+_0x19fd36+_0xe292('0xc0')+_0x5f253c+_0xe292('0xc1')+_0xe292('0xc2'),'headers':{'Authorization':_0xe292('0xa1')+_0x4af120,'If-None-Match':null,'OData-Version':_0xe292('0xa2')},'json':!![]};return rp(_0x21c50f)[_0xe292('0x26')](function(_0x25107d){var _0x10db0f=[];var _0x56d128=_0x25107d[_0xe292('0xc3')][_0xe292('0xc4')];_0x56d128[_0xe292('0xaa')](function(_0x289022){_0x10db0f[_0xe292('0xad')]({'name':_0x289022[_0xe292('0xc5')]['UserLocalizedLabel']['Label'],'value':String(_0x289022[_0xe292('0xc6')])});});var _0x2dfaf0={'id':_0x43a9c5+'_'+_0x25107d[_0xe292('0xc7')],'name':_0x25107d[_0xe292('0xc8')]['UserLocalizedLabel'][_0xe292('0xc5')],'custom':![],'options':_0x10db0f};_0x44254a[_0xe292('0xad')](_0x2dfaf0);return _0x44254a;});}function getBooleanList(_0x58c040,_0x9f882f,_0xc68445,_0x3f7452,_0x4bf449,_0x3c4032){var _0x401e5d={'method':_0xe292('0xa0'),'uri':_0x58c040+_0xe292('0xa5')+_0x3f7452+')/Attributes('+_0x4bf449+_0xe292('0xc9'),'headers':{'Authorization':_0xe292('0xa1')+_0x3c4032,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x401e5d)[_0xe292('0x26')](function(_0x146d04){var _0x5f1fc8=[];_0x5f1fc8[_0xe292('0xad')]({'name':_0x146d04['OptionSet'][_0xe292('0xca')][_0xe292('0xc5')]['UserLocalizedLabel']['Label'],'value':'true'},{'name':_0x146d04[_0xe292('0xc3')][_0xe292('0xcb')][_0xe292('0xc5')][_0xe292('0xcc')]['Label'],'value':_0xe292('0xcd')});var _0x1681d9={'id':_0x9f882f+'_'+_0x146d04[_0xe292('0xc7')],'name':_0x146d04[_0xe292('0xc8')][_0xe292('0xcc')][_0xe292('0xc5')],'custom':![],'options':_0x5f1fc8};_0xc68445[_0xe292('0xad')](_0x1681d9);return _0xc68445;});}function getInputList(_0x14f25e,_0x380abb,_0x327c65,_0xe4b682,_0x3aed2c,_0x29ec23,_0x5d3f52){var _0x4b7c8a={'method':_0xe292('0xa0'),'uri':_0x14f25e+_0xe292('0xa5')+_0x3aed2c+_0xe292('0xc0')+_0x29ec23+_0xe292('0xce')+_0x327c65+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xe292('0xa1')+_0x5d3f52,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4b7c8a)['then'](function(_0x742176){var _0x47e417={'id':_0x380abb+'_'+_0x742176[_0xe292('0xc7')],'name':_0x742176['DisplayName'][_0xe292('0xcc')]?_0x742176[_0xe292('0xc8')][_0xe292('0xcc')][_0xe292('0xc5')]:_0x742176['LogicalName'],'custom':![],'options':[]};_0xe4b682[_0xe292('0xad')](_0x47e417);return _0xe4b682;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 1074318..c6b08b5 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 _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x523b93,_0x5a842b){var _0x24f40a=function(_0x31049d){while(--_0x31049d){_0x523b93['push'](_0x523b93['shift']());}};_0x24f40a(++_0x5a842b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x2cbf11,_0x407d5d){var _0x5691d0=function(_0x30d0e5){while(--_0x30d0e5){_0x2cbf11['push'](_0x2cbf11['shift']());}};_0x5691d0(++_0x407d5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','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 f26f3ec..fbb3277 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 _0x15c6=['then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetDynamics365Account','debug','ShowDynamics365Account','Dynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x5ba343,_0x5340da){var _0x4e4811=function(_0x47293c){while(--_0x47293c){_0x5ba343['push'](_0x5ba343['shift']());}};_0x4e4811(++_0x5340da);}(_0x15c6,0x11b));var _0x615c=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x15c6[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x615c('0x0'));var util=require(_0x615c('0x1'));var moment=require(_0x615c('0x2'));var BPromise=require(_0x615c('0x3'));var rs=require(_0x615c('0x4'));var fs=require('fs');var Redis=require(_0x615c('0x5'));var db=require(_0x615c('0x6'))['db'];var utils=require(_0x615c('0x7'));var logger=require('../../config/logger')(_0x615c('0x8'));var config=require(_0x615c('0x9'));var jayson=require(_0x615c('0xa'));var client=jayson[_0x615c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39b4e9,_0x30e5d1,_0x59091f){return new BPromise(function(_0x116f6d,_0x4581ee){return client[_0x615c('0xc')](_0x39b4e9,_0x59091f)[_0x615c('0xd')](function(_0xdd2025){logger[_0x615c('0xe')](_0x615c('0xf'),_0x30e5d1,_0x615c('0x10'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x30e5d1,_0x615c('0x10'),JSON[_0x615c('0x11')](_0xdd2025));if(_0xdd2025[_0x615c('0x12')]){if(_0xdd2025['error'][_0x615c('0x13')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x30e5d1,_0xdd2025['error']['message']);return _0x4581ee(_0xdd2025[_0x615c('0x12')][_0x615c('0x14')]);}logger[_0x615c('0x12')](_0x615c('0xf'),_0x30e5d1,_0xdd2025['error'][_0x615c('0x14')]);return _0x116f6d(_0xdd2025[_0x615c('0x12')]['message']);}else{logger[_0x615c('0xe')](_0x615c('0xf'),_0x30e5d1,_0x615c('0x10'));_0x116f6d(_0xdd2025[_0x615c('0x15')][_0x615c('0x14')]);}})[_0x615c('0x16')](function(_0x41406e){logger[_0x615c('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x30e5d1,_0x41406e);_0x4581ee(_0x41406e);});});}exports['GetDynamics365Account']=function(_0x317302){var _0x55a38a=this;return new Promise(function(_0x475526,_0x154a56){return db['Dynamics365Account'][_0x615c('0x17')]({'raw':_0x317302[_0x615c('0x18')]?_0x317302[_0x615c('0x18')][_0x615c('0x19')]===undefined?!![]:![]:!![],'where':_0x317302[_0x615c('0x18')]?_0x317302[_0x615c('0x18')][_0x615c('0x1a')]||null:null,'attributes':_0x317302['options']?_0x317302[_0x615c('0x18')][_0x615c('0x1b')]||null:null,'limit':_0x317302[_0x615c('0x18')]?_0x317302[_0x615c('0x18')][_0x615c('0x1c')]||null:null,'include':_0x317302[_0x615c('0x18')]?_0x317302[_0x615c('0x18')][_0x615c('0x1d')]?_[_0x615c('0x1e')](_0x317302[_0x615c('0x18')][_0x615c('0x1d')],function(_0x598d89){return{'model':db[_0x598d89[_0x615c('0x1f')]],'as':_0x598d89['as'],'attributes':_0x598d89[_0x615c('0x1b')],'include':_0x598d89['include']?_['map'](_0x598d89['include'],function(_0x1cd317){return{'model':db[_0x1cd317[_0x615c('0x1f')]],'as':_0x1cd317['as'],'attributes':_0x1cd317[_0x615c('0x1b')],'include':_0x1cd317[_0x615c('0x1d')]?_[_0x615c('0x1e')](_0x1cd317[_0x615c('0x1d')],function(_0x2a3be9){return{'model':db[_0x2a3be9[_0x615c('0x1f')]],'as':_0x2a3be9['as'],'attributes':_0x2a3be9[_0x615c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x615c('0xd')](function(_0x12cd91){logger[_0x615c('0xe')](_0x615c('0x20'),_0x317302);logger[_0x615c('0x21')](_0x615c('0x20'),_0x317302,JSON[_0x615c('0x11')](_0x12cd91));_0x475526(_0x12cd91);})[_0x615c('0x16')](function(_0xbc1392){logger[_0x615c('0x12')](_0x615c('0x20'),_0xbc1392[_0x615c('0x14')],_0x317302);_0x154a56(_0x55a38a[_0x615c('0x12')](0x1f4,_0xbc1392['message']));});});};exports[_0x615c('0x22')]=function(_0x3714eb){var _0x264322=this;return new Promise(function(_0x171844,_0x5c962c){return db[_0x615c('0x23')][_0x615c('0x24')]({'raw':_0x3714eb[_0x615c('0x18')]?_0x3714eb[_0x615c('0x18')][_0x615c('0x19')]===undefined?!![]:![]:!![],'where':_0x3714eb[_0x615c('0x18')]?_0x3714eb[_0x615c('0x18')][_0x615c('0x1a')]||null:null,'attributes':_0x3714eb['options']?_0x3714eb[_0x615c('0x18')][_0x615c('0x1b')]||null:null,'include':_0x3714eb[_0x615c('0x18')]?_0x3714eb[_0x615c('0x18')][_0x615c('0x1d')]?_[_0x615c('0x1e')](_0x3714eb[_0x615c('0x18')][_0x615c('0x1d')],function(_0x4b2e6e){return{'model':db[_0x4b2e6e['model']],'as':_0x4b2e6e['as'],'attributes':_0x4b2e6e['attributes'],'include':_0x4b2e6e[_0x615c('0x1d')]?_[_0x615c('0x1e')](_0x4b2e6e['include'],function(_0x455cf8){return{'model':db[_0x455cf8['model']],'as':_0x455cf8['as'],'attributes':_0x455cf8[_0x615c('0x1b')],'include':_0x455cf8[_0x615c('0x1d')]?_[_0x615c('0x1e')](_0x455cf8[_0x615c('0x1d')],function(_0x5074aa){return{'model':db[_0x5074aa[_0x615c('0x1f')]],'as':_0x5074aa['as'],'attributes':_0x5074aa[_0x615c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x615c('0xd')](function(_0x2a1468){logger[_0x615c('0xe')](_0x615c('0x22'),_0x3714eb);logger[_0x615c('0x21')](_0x615c('0x22'),_0x3714eb,JSON[_0x615c('0x11')](_0x2a1468));_0x171844(_0x2a1468);})['catch'](function(_0x146b56){logger[_0x615c('0x12')]('ShowDynamics365Account',_0x146b56[_0x615c('0x14')],_0x3714eb);_0x5c962c(_0x264322[_0x615c('0x12')](0x1f4,_0x146b56[_0x615c('0x14')]));});});}; \ No newline at end of file +var _0x1ce0=['Dynamics365Account','where','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetDynamics365Account','options','raw','map','include','model','attributes','ShowDynamics365Account'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x1ce0,0x1a7));var _0x01ce=function(_0x4b416c,_0x53ef9e){_0x4b416c=_0x4b416c-0x0;var _0x2037fa=_0x1ce0[_0x4b416c];return _0x2037fa;};'use strict';var _=require(_0x01ce('0x0'));var util=require(_0x01ce('0x1'));var moment=require(_0x01ce('0x2'));var BPromise=require(_0x01ce('0x3'));var rs=require(_0x01ce('0x4'));var fs=require('fs');var Redis=require(_0x01ce('0x5'));var db=require(_0x01ce('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x01ce('0x7'))(_0x01ce('0x8'));var config=require(_0x01ce('0x9'));var jayson=require(_0x01ce('0xa'));var client=jayson[_0x01ce('0xb')][_0x01ce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c86af,_0x1afc98,_0x1354ab){return new BPromise(function(_0xc634a8,_0xc3aeef){return client[_0x01ce('0xd')](_0x4c86af,_0x1354ab)[_0x01ce('0xe')](function(_0x3fd490){logger[_0x01ce('0xf')](_0x01ce('0x10'),_0x1afc98,_0x01ce('0x11'));logger[_0x01ce('0x12')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1afc98,_0x01ce('0x11'),JSON[_0x01ce('0x13')](_0x3fd490));if(_0x3fd490[_0x01ce('0x14')]){if(_0x3fd490[_0x01ce('0x14')][_0x01ce('0x15')]===0x1f4){logger[_0x01ce('0x14')](_0x01ce('0x10'),_0x1afc98,_0x3fd490[_0x01ce('0x14')][_0x01ce('0x16')]);return _0xc3aeef(_0x3fd490[_0x01ce('0x14')]['message']);}logger['error'](_0x01ce('0x10'),_0x1afc98,_0x3fd490[_0x01ce('0x14')]['message']);return _0xc634a8(_0x3fd490[_0x01ce('0x14')][_0x01ce('0x16')]);}else{logger[_0x01ce('0xf')](_0x01ce('0x10'),_0x1afc98,_0x01ce('0x11'));_0xc634a8(_0x3fd490[_0x01ce('0x17')]['message']);}})['catch'](function(_0x1879b3){logger[_0x01ce('0x14')](_0x01ce('0x10'),_0x1afc98,_0x1879b3);_0xc3aeef(_0x1879b3);});});}exports[_0x01ce('0x18')]=function(_0x24688a){var _0x418b98=this;return new Promise(function(_0x4ea71e,_0xc77116){return db['Dynamics365Account']['findAll']({'raw':_0x24688a[_0x01ce('0x19')]?_0x24688a[_0x01ce('0x19')][_0x01ce('0x1a')]===undefined?!![]:![]:!![],'where':_0x24688a[_0x01ce('0x19')]?_0x24688a[_0x01ce('0x19')]['where']||null:null,'attributes':_0x24688a[_0x01ce('0x19')]?_0x24688a['options']['attributes']||null:null,'limit':_0x24688a[_0x01ce('0x19')]?_0x24688a[_0x01ce('0x19')]['limit']||null:null,'include':_0x24688a[_0x01ce('0x19')]?_0x24688a[_0x01ce('0x19')]['include']?_[_0x01ce('0x1b')](_0x24688a[_0x01ce('0x19')][_0x01ce('0x1c')],function(_0x571a80){return{'model':db[_0x571a80[_0x01ce('0x1d')]],'as':_0x571a80['as'],'attributes':_0x571a80[_0x01ce('0x1e')],'include':_0x571a80[_0x01ce('0x1c')]?_[_0x01ce('0x1b')](_0x571a80[_0x01ce('0x1c')],function(_0x49c987){return{'model':db[_0x49c987[_0x01ce('0x1d')]],'as':_0x49c987['as'],'attributes':_0x49c987[_0x01ce('0x1e')],'include':_0x49c987[_0x01ce('0x1c')]?_[_0x01ce('0x1b')](_0x49c987[_0x01ce('0x1c')],function(_0x164aa7){return{'model':db[_0x164aa7[_0x01ce('0x1d')]],'as':_0x164aa7['as'],'attributes':_0x164aa7[_0x01ce('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x01ce('0xe')](function(_0x310133){logger['info'](_0x01ce('0x18'),_0x24688a);logger['debug'](_0x01ce('0x18'),_0x24688a,JSON['stringify'](_0x310133));_0x4ea71e(_0x310133);})['catch'](function(_0x37ff64){logger['error'](_0x01ce('0x18'),_0x37ff64[_0x01ce('0x16')],_0x24688a);_0xc77116(_0x418b98[_0x01ce('0x14')](0x1f4,_0x37ff64[_0x01ce('0x16')]));});});};exports[_0x01ce('0x1f')]=function(_0x2248b2){var _0x4cfb5=this;return new Promise(function(_0x72bc04,_0x58f2af){return db[_0x01ce('0x20')]['find']({'raw':_0x2248b2[_0x01ce('0x19')]?_0x2248b2[_0x01ce('0x19')][_0x01ce('0x1a')]===undefined?!![]:![]:!![],'where':_0x2248b2['options']?_0x2248b2[_0x01ce('0x19')][_0x01ce('0x21')]||null:null,'attributes':_0x2248b2[_0x01ce('0x19')]?_0x2248b2[_0x01ce('0x19')]['attributes']||null:null,'include':_0x2248b2[_0x01ce('0x19')]?_0x2248b2[_0x01ce('0x19')][_0x01ce('0x1c')]?_[_0x01ce('0x1b')](_0x2248b2[_0x01ce('0x19')][_0x01ce('0x1c')],function(_0x681aba){return{'model':db[_0x681aba[_0x01ce('0x1d')]],'as':_0x681aba['as'],'attributes':_0x681aba[_0x01ce('0x1e')],'include':_0x681aba['include']?_[_0x01ce('0x1b')](_0x681aba['include'],function(_0x5750de){return{'model':db[_0x5750de[_0x01ce('0x1d')]],'as':_0x5750de['as'],'attributes':_0x5750de[_0x01ce('0x1e')],'include':_0x5750de['include']?_[_0x01ce('0x1b')](_0x5750de[_0x01ce('0x1c')],function(_0x4ae0da){return{'model':db[_0x4ae0da['model']],'as':_0x4ae0da['as'],'attributes':_0x4ae0da[_0x01ce('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x01ce('0xe')](function(_0x553aa2){logger[_0x01ce('0xf')]('ShowDynamics365Account',_0x2248b2);logger['debug'](_0x01ce('0x1f'),_0x2248b2,JSON[_0x01ce('0x13')](_0x553aa2));_0x72bc04(_0x553aa2);})[_0x01ce('0x22')](function(_0x4bc609){logger['error'](_0x01ce('0x1f'),_0x4bc609[_0x01ce('0x16')],_0x2248b2);_0x58f2af(_0x4cfb5[_0x01ce('0x14')](0x1f4,_0x4bc609[_0x01ce('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 944ad10..bcddb86 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 _0xed11=['../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','destroy','Router','fs-extra','../../components/auth/service'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0xed11,0x107));var _0x1ed1=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xed11[_0x13d07a];return _0x5ee0ee;};'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[_0x1ed1('0x0')]();var fs_extra=require(_0x1ed1('0x1'));var auth=require(_0x1ed1('0x2'));var interaction=require(_0x1ed1('0x3'));var config=require('../../config/environment');var controller=require(_0x1ed1('0x4'));router[_0x1ed1('0x5')]('/',auth[_0x1ed1('0x6')](),controller[_0x1ed1('0x7')]);router[_0x1ed1('0x5')](_0x1ed1('0x8'),auth[_0x1ed1('0x6')](),controller[_0x1ed1('0x9')]);router[_0x1ed1('0x5')](_0x1ed1('0xa'),auth[_0x1ed1('0x6')](),controller[_0x1ed1('0xb')]);router['get'](_0x1ed1('0xc'),auth[_0x1ed1('0x6')](),controller['getSubjects']);router[_0x1ed1('0x5')](_0x1ed1('0xd'),auth[_0x1ed1('0x6')](),controller[_0x1ed1('0xe')]);router[_0x1ed1('0xf')]('/',auth[_0x1ed1('0x6')](),controller['create']);router[_0x1ed1('0x10')](_0x1ed1('0x8'),auth[_0x1ed1('0x6')](),controller[_0x1ed1('0x11')]);router['delete'](_0x1ed1('0x8'),auth[_0x1ed1('0x6')](),controller[_0x1ed1('0x12')]);module['exports']=router; \ No newline at end of file +var _0xab95=['getDescriptions','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects'];(function(_0x5ccff8,_0x3d85cc){var _0x5a97d9=function(_0x3da675){while(--_0x3da675){_0x5ccff8['push'](_0x5ccff8['shift']());}};_0x5a97d9(++_0x3d85cc);}(_0xab95,0x1d5));var _0x5ab9=function(_0x182da8,_0x59191e){_0x182da8=_0x182da8-0x0;var _0x5285a1=_0xab95[_0x182da8];return _0x5285a1;};'use strict';var multer=require(_0x5ab9('0x0'));var util=require(_0x5ab9('0x1'));var path=require(_0x5ab9('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ab9('0x3'));var router=express[_0x5ab9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5ab9('0x5'));var config=require(_0x5ab9('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0x5ab9('0x7')]('/',auth[_0x5ab9('0x8')](),controller['index']);router[_0x5ab9('0x7')](_0x5ab9('0x9'),auth['isAuthenticated'](),controller[_0x5ab9('0xa')]);router[_0x5ab9('0x7')](_0x5ab9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x5ab9('0x7')](_0x5ab9('0xc'),auth[_0x5ab9('0x8')](),controller[_0x5ab9('0xd')]);router[_0x5ab9('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x5ab9('0xe')]);router[_0x5ab9('0xf')]('/',auth['isAuthenticated'](),controller[_0x5ab9('0x10')]);router['put'](_0x5ab9('0x9'),auth[_0x5ab9('0x8')](),controller[_0x5ab9('0x11')]);router[_0x5ab9('0x12')](_0x5ab9('0x9'),auth['isAuthenticated'](),controller[_0x5ab9('0x13')]);module[_0x5ab9('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index fa1d850..8d7b6ad 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 _0x5348=['STRING','ENUM','incident','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5348,0x1eb));var _0x8534=function(_0x47e153,_0x5ef1b3){_0x47e153=_0x47e153-0x0;var _0x44e260=_0x5348[_0x47e153];return _0x44e260;};'use strict';var Sequelize=require(_0x8534('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8534('0x1')]},'ticketType':{'type':Sequelize[_0x8534('0x2')](_0x8534('0x3'),'phonecall'),'defaultValue':_0x8534('0x3')}}; \ No newline at end of file +var _0xc811=['exports','STRING','ENUM','incident','phonecall','sequelize'];(function(_0x30c48d,_0x4ba1db){var _0x394ba1=function(_0x1fdd9e){while(--_0x1fdd9e){_0x30c48d['push'](_0x30c48d['shift']());}};_0x394ba1(++_0x4ba1db);}(_0xc811,0x125));var _0x1c81=function(_0x6db0e,_0x48212e){_0x6db0e=_0x6db0e-0x0;var _0xe297d2=_0xc811[_0x6db0e];return _0xe297d2;};'use strict';var Sequelize=require(_0x1c81('0x0'));module[_0x1c81('0x1')]={'name':{'type':Sequelize[_0x1c81('0x2')]},'description':{'type':Sequelize[_0x1c81('0x2')]},'ticketType':{'type':Sequelize[_0x1c81('0x3')](_0x1c81('0x4'),_0x1c81('0x5')),'defaultValue':_0x1c81('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ce7e812..ff24d2c 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 _0x86bd=['VIRTUAL','options','Dynamics365Configuration','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','getFields','findOne','Dynamics365Field','rawAttributes','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type'];(function(_0x4263f5,_0x2a1ebd){var _0x58a6dc=function(_0x291b74){while(--_0x291b74){_0x4263f5['push'](_0x4263f5['shift']());}};_0x58a6dc(++_0x2a1ebd);}(_0x86bd,0x110));var _0xd86b=function(_0x10513a,_0xceafff){_0x10513a=_0x10513a-0x0;var _0x2289b8=_0x86bd[_0x10513a];return _0x2289b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd86b('0x0'));var zipdir=require(_0xd86b('0x1'));var jsonpatch=require(_0xd86b('0x2'));var rp=require(_0xd86b('0x3'));var moment=require(_0xd86b('0x4'));var BPromise=require(_0xd86b('0x5'));var Mustache=require(_0xd86b('0x6'));var util=require('util');var path=require(_0xd86b('0x7'));var sox=require(_0xd86b('0x8'));var csv=require(_0xd86b('0x9'));var ejs=require(_0xd86b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd86b('0xb'));var squel=require(_0xd86b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd86b('0xd'));var toCsv=require(_0xd86b('0x9'));var querystring=require(_0xd86b('0xe'));var Papa=require(_0xd86b('0xf'));var Redis=require('ioredis');var authService=require(_0xd86b('0x10'));var qs=require(_0xd86b('0x11'));var as=require(_0xd86b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd86b('0x13'));var utils=require(_0xd86b('0x14'));var config=require(_0xd86b('0x15'));var licenseUtil=require(_0xd86b('0x16'));var db=require(_0xd86b('0x17'))['db'];function respondWithStatusCode(_0x550bc6,_0x15c2af){_0x15c2af=_0x15c2af||0xcc;return function(_0x521929){if(_0x521929){return _0x550bc6[_0xd86b('0x18')](_0x15c2af);}return _0x550bc6[_0xd86b('0x19')](_0x15c2af)[_0xd86b('0x1a')]();};}function respondWithResult(_0x1ab043,_0x164796){_0x164796=_0x164796||0xc8;return function(_0x4c1feb){if(_0x4c1feb){return _0x1ab043[_0xd86b('0x19')](_0x164796)['json'](_0x4c1feb);}};}function respondWithFilteredResult(_0x2464e3,_0x3e59f3){return function(_0x217ed1){if(_0x217ed1){var _0x467ecb=typeof _0x3e59f3[_0xd86b('0x1b')]===_0xd86b('0x1c')&&typeof _0x3e59f3[_0xd86b('0x1d')]==='undefined';var _0x545734=_0x217ed1[_0xd86b('0x1e')];var _0x339eb8=_0x467ecb?0x0:_0x3e59f3[_0xd86b('0x1b')];var _0x3769c4=_0x467ecb?_0x217ed1[_0xd86b('0x1e')]:_0x3e59f3[_0xd86b('0x1b')]+_0x3e59f3['limit'];var _0x443d99;if(_0x3769c4>=_0x545734){_0x3769c4=_0x545734;_0x443d99=0xc8;}else{_0x443d99=0xce;}_0x2464e3[_0xd86b('0x19')](_0x443d99);return _0x2464e3[_0xd86b('0x1f')](_0xd86b('0x20'),_0x339eb8+'-'+_0x3769c4+'/'+_0x545734)[_0xd86b('0x21')](_0x217ed1);}return null;};}function patchUpdates(_0xde7b06){return function(_0x4c62e9){try{jsonpatch[_0xd86b('0x22')](_0x4c62e9,_0xde7b06,!![]);}catch(_0x532ba3){return BPromise[_0xd86b('0x23')](_0x532ba3);}return _0x4c62e9[_0xd86b('0x24')]();};}function saveUpdates(_0x24c987,_0x43645a){return function(_0x5ef7ad){if(_0x5ef7ad){return _0x5ef7ad['update'](_0x24c987)[_0xd86b('0x25')](function(_0x16a60c){return _0x16a60c;});}return null;};}function removeEntity(_0x15b6fc,_0x481bc3){return function(_0x55cd38){if(_0x55cd38){return _0x55cd38[_0xd86b('0x26')]()[_0xd86b('0x25')](function(){_0x15b6fc[_0xd86b('0x19')](0xcc)[_0xd86b('0x1a')]();});}};}function handleEntityNotFound(_0x1236b8,_0x5d20ff){return function(_0x1f1cef){if(!_0x1f1cef){_0x1236b8[_0xd86b('0x18')](0x194);}return _0x1f1cef;};}function handleError(_0x278490,_0xffe4b8){_0xffe4b8=_0xffe4b8||0x1f4;return function(_0x28a2a0){logger[_0xd86b('0x27')](_0x28a2a0[_0xd86b('0x28')]);if(_0x28a2a0[_0xd86b('0x29')]){delete _0x28a2a0[_0xd86b('0x29')];}_0x278490[_0xd86b('0x19')](_0xffe4b8)[_0xd86b('0x2a')](_0x28a2a0);};}exports[_0xd86b('0x2b')]=function(_0x12dc48,_0x54d117){var _0x42223f={},_0x574be7={},_0x629052={'count':0x0,'rows':[]};var _0xa935e7=_[_0xd86b('0x2c')](db['Dynamics365Configuration']['rawAttributes'],function(_0x3033db){return{'name':_0x3033db[_0xd86b('0x2d')],'type':_0x3033db['type'][_0xd86b('0x2e')]};});_0x574be7[_0xd86b('0x2f')]=_[_0xd86b('0x2c')](_0xa935e7,_0xd86b('0x29'));_0x574be7[_0xd86b('0x30')]=_[_0xd86b('0x31')](_0x12dc48[_0xd86b('0x30')]);_0x574be7[_0xd86b('0x32')]=_[_0xd86b('0x33')](_0x574be7['model'],_0x574be7[_0xd86b('0x30')]);_0x42223f[_0xd86b('0x34')]=_[_0xd86b('0x33')](_0x574be7['model'],qs[_0xd86b('0x35')](_0x12dc48['query'][_0xd86b('0x35')]));_0x42223f['attributes']=_0x42223f[_0xd86b('0x34')][_0xd86b('0x36')]?_0x42223f['attributes']:_0x574be7[_0xd86b('0x2f')];if(!_0x12dc48[_0xd86b('0x30')][_0xd86b('0x37')](_0xd86b('0x38'))){_0x42223f['limit']=qs[_0xd86b('0x1d')](_0x12dc48[_0xd86b('0x30')][_0xd86b('0x1d')]);_0x42223f[_0xd86b('0x1b')]=qs[_0xd86b('0x1b')](_0x12dc48[_0xd86b('0x30')][_0xd86b('0x1b')]);}_0x42223f[_0xd86b('0x39')]=qs['sort'](_0x12dc48['query'][_0xd86b('0x3a')]);_0x42223f[_0xd86b('0x3b')]=qs[_0xd86b('0x32')](_[_0xd86b('0x3c')](_0x12dc48['query'],_0x574be7[_0xd86b('0x32')]),_0xa935e7);if(_0x12dc48['query'][_0xd86b('0x3d')]){_0x42223f[_0xd86b('0x3b')]=_[_0xd86b('0x3e')](_0x42223f[_0xd86b('0x3b')],{'$or':_['map'](_0xa935e7,function(_0x141738){if(_0x141738[_0xd86b('0x3f')]!==_0xd86b('0x40')){var _0x5e9805={};_0x5e9805[_0x141738[_0xd86b('0x29')]]={'$like':'%'+_0x12dc48['query'][_0xd86b('0x3d')]+'%'};return _0x5e9805;}})});}_0x42223f=_[_0xd86b('0x3e')]({},_0x42223f,_0x12dc48[_0xd86b('0x41')]);var _0x13031d={'where':_0x42223f['where']};return db[_0xd86b('0x42')]['count'](_0x13031d)[_0xd86b('0x25')](function(_0x4da1d0){_0x629052[_0xd86b('0x1e')]=_0x4da1d0;if(_0x12dc48['query'][_0xd86b('0x43')]){_0x42223f['include']=[{'all':!![]}];}return db[_0xd86b('0x42')][_0xd86b('0x44')](_0x42223f);})[_0xd86b('0x25')](function(_0xe82eca){_0x629052[_0xd86b('0x45')]=_0xe82eca;return _0x629052;})[_0xd86b('0x25')](respondWithFilteredResult(_0x54d117,_0x42223f))[_0xd86b('0x46')](handleError(_0x54d117,null));};exports[_0xd86b('0x47')]=function(_0x43acf3,_0x5b63c7){var _0x27312d={'raw':![],'where':{'id':_0x43acf3[_0xd86b('0x48')]['id']}},_0x19c7a3={};_0x19c7a3[_0xd86b('0x2f')]=_[_0xd86b('0x31')](db[_0xd86b('0x42')]['rawAttributes']);_0x19c7a3[_0xd86b('0x30')]=_[_0xd86b('0x31')](_0x43acf3[_0xd86b('0x30')]);_0x19c7a3[_0xd86b('0x32')]=_[_0xd86b('0x33')](_0x19c7a3['model'],_0x19c7a3[_0xd86b('0x30')]);_0x27312d[_0xd86b('0x34')]=_[_0xd86b('0x33')](_0x19c7a3[_0xd86b('0x2f')],qs[_0xd86b('0x35')](_0x43acf3['query'][_0xd86b('0x35')]));_0x27312d[_0xd86b('0x34')]=_0x27312d[_0xd86b('0x34')][_0xd86b('0x36')]?_0x27312d['attributes']:_0x19c7a3[_0xd86b('0x2f')];if(_0x43acf3[_0xd86b('0x30')][_0xd86b('0x43')]){_0x27312d[_0xd86b('0x49')]=[{'all':!![]}];}_0x27312d=_[_0xd86b('0x3e')]({},_0x27312d,_0x43acf3[_0xd86b('0x41')]);return db[_0xd86b('0x42')][_0xd86b('0x4a')](_0x27312d)[_0xd86b('0x25')](handleEntityNotFound(_0x5b63c7,null))[_0xd86b('0x25')](respondWithResult(_0x5b63c7,null))[_0xd86b('0x46')](handleError(_0x5b63c7,null));};exports[_0xd86b('0x4b')]=function(_0x21acfc,_0x4fbe9a){return db[_0xd86b('0x42')][_0xd86b('0x4b')](_0x21acfc[_0xd86b('0x4c')],{})[_0xd86b('0x25')](respondWithResult(_0x4fbe9a,0xc9))[_0xd86b('0x46')](handleError(_0x4fbe9a,null));};exports[_0xd86b('0x4d')]=function(_0x1c00fe,_0x2135f2){if(_0x1c00fe[_0xd86b('0x4c')]['id']){delete _0x1c00fe[_0xd86b('0x4c')]['id'];}return db[_0xd86b('0x42')][_0xd86b('0x4a')]({'where':{'id':_0x1c00fe[_0xd86b('0x48')]['id']}})[_0xd86b('0x25')](handleEntityNotFound(_0x2135f2,null))[_0xd86b('0x25')](saveUpdates(_0x1c00fe['body'],null))[_0xd86b('0x25')](respondWithResult(_0x2135f2,null))[_0xd86b('0x46')](handleError(_0x2135f2,null));};exports[_0xd86b('0x26')]=function(_0x4b454d,_0x1ef04c){return db['Dynamics365Configuration'][_0xd86b('0x4a')]({'where':{'id':_0x4b454d[_0xd86b('0x48')]['id']}})[_0xd86b('0x25')](handleEntityNotFound(_0x1ef04c,null))['then'](removeEntity(_0x1ef04c,null))[_0xd86b('0x46')](handleError(_0x1ef04c,null));};exports[_0xd86b('0x4e')]=function(_0x4cba57,_0x28d14c,_0x76c35b){var _0x2f1cf3={};var _0x196490={};var _0x17c806;var _0x5113ee;return db['Dynamics365Configuration'][_0xd86b('0x4f')]({'where':{'id':_0x4cba57[_0xd86b('0x48')]['id']}})[_0xd86b('0x25')](handleEntityNotFound(_0x28d14c,null))[_0xd86b('0x25')](function(_0x3bb09f){if(_0x3bb09f){_0x17c806=_0x3bb09f;_0x196490['model']=_['keys'](db[_0xd86b('0x50')][_0xd86b('0x51')]);_0x196490[_0xd86b('0x30')]=_[_0xd86b('0x31')](_0x4cba57[_0xd86b('0x30')]);_0x196490[_0xd86b('0x32')]=_[_0xd86b('0x33')](_0x196490['model'],_0x196490['query']);_0x2f1cf3['attributes']=_[_0xd86b('0x33')](_0x196490[_0xd86b('0x2f')],qs[_0xd86b('0x35')](_0x4cba57['query'][_0xd86b('0x35')]));_0x2f1cf3['attributes']=_0x2f1cf3[_0xd86b('0x34')][_0xd86b('0x36')]?_0x2f1cf3[_0xd86b('0x34')]:_0x196490[_0xd86b('0x2f')];_0x2f1cf3[_0xd86b('0x39')]=qs['sort'](_0x4cba57[_0xd86b('0x30')][_0xd86b('0x3a')]);_0x2f1cf3[_0xd86b('0x3b')]=qs[_0xd86b('0x32')](_[_0xd86b('0x3c')](_0x4cba57[_0xd86b('0x30')],_0x196490[_0xd86b('0x32')]));if(_0x4cba57['query'][_0xd86b('0x3d')]){_0x2f1cf3[_0xd86b('0x3b')]=_['merge'](_0x2f1cf3[_0xd86b('0x3b')],{'$or':_[_0xd86b('0x2c')](_0x2f1cf3[_0xd86b('0x34')],function(_0x5509d0){var _0x5a287c={};_0x5a287c[_0x5509d0]={'$like':'%'+_0x4cba57['query'][_0xd86b('0x3d')]+'%'};return _0x5a287c;})});}_0x2f1cf3=_[_0xd86b('0x3e')]({},_0x2f1cf3,_0x4cba57[_0xd86b('0x41')]);return _0x17c806[_0xd86b('0x4e')](_0x2f1cf3);}})[_0xd86b('0x25')](function(_0xa94e0){if(_0xa94e0){_0x5113ee=_0xa94e0[_0xd86b('0x36')];if(!_0x4cba57[_0xd86b('0x30')][_0xd86b('0x37')](_0xd86b('0x38'))){_0x2f1cf3[_0xd86b('0x1d')]=qs[_0xd86b('0x1d')](_0x4cba57['query']['limit']);_0x2f1cf3[_0xd86b('0x1b')]=qs[_0xd86b('0x1b')](_0x4cba57[_0xd86b('0x30')][_0xd86b('0x1b')]);}return _0x17c806['getFields'](_0x2f1cf3);}})['then'](function(_0x53906b){if(_0x53906b){return _0x53906b?{'count':_0x5113ee,'rows':_0x53906b}:null;}})['then'](respondWithResult(_0x28d14c,null))[_0xd86b('0x46')](handleError(_0x28d14c,null));};exports[_0xd86b('0x52')]=function(_0x29ade8,_0x4fc79f,_0x5e017d){var _0x43041d={};var _0x48ac1b={};var _0x5aebd4;var _0x32938c;return db[_0xd86b('0x42')][_0xd86b('0x4f')]({'where':{'id':_0x29ade8[_0xd86b('0x48')]['id']}})[_0xd86b('0x25')](handleEntityNotFound(_0x4fc79f,null))['then'](function(_0x155310){if(_0x155310){_0x5aebd4=_0x155310;_0x48ac1b[_0xd86b('0x2f')]=_[_0xd86b('0x31')](db['Dynamics365Field']['rawAttributes']);_0x48ac1b[_0xd86b('0x30')]=_[_0xd86b('0x31')](_0x29ade8[_0xd86b('0x30')]);_0x48ac1b[_0xd86b('0x32')]=_['intersection'](_0x48ac1b[_0xd86b('0x2f')],_0x48ac1b[_0xd86b('0x30')]);_0x43041d[_0xd86b('0x34')]=_[_0xd86b('0x33')](_0x48ac1b[_0xd86b('0x2f')],qs[_0xd86b('0x35')](_0x29ade8[_0xd86b('0x30')]['fields']));_0x43041d[_0xd86b('0x34')]=_0x43041d[_0xd86b('0x34')][_0xd86b('0x36')]?_0x43041d[_0xd86b('0x34')]:_0x48ac1b[_0xd86b('0x2f')];_0x43041d[_0xd86b('0x39')]=qs['sort'](_0x29ade8[_0xd86b('0x30')][_0xd86b('0x3a')]);_0x43041d[_0xd86b('0x3b')]=qs[_0xd86b('0x32')](_[_0xd86b('0x3c')](_0x29ade8['query'],_0x48ac1b[_0xd86b('0x32')]));if(_0x29ade8[_0xd86b('0x30')][_0xd86b('0x3d')]){_0x43041d[_0xd86b('0x3b')]=_['merge'](_0x43041d['where'],{'$or':_[_0xd86b('0x2c')](_0x43041d[_0xd86b('0x34')],function(_0x4dedfc){var _0x3ba156={};_0x3ba156[_0x4dedfc]={'$like':'%'+_0x29ade8['query'][_0xd86b('0x3d')]+'%'};return _0x3ba156;})});}_0x43041d=_['merge']({},_0x43041d,_0x29ade8[_0xd86b('0x41')]);return _0x5aebd4['getSubjects'](_0x43041d);}})[_0xd86b('0x25')](function(_0x135ee0){if(_0x135ee0){_0x32938c=_0x135ee0[_0xd86b('0x36')];if(!_0x29ade8[_0xd86b('0x30')]['hasOwnProperty'](_0xd86b('0x38'))){_0x43041d[_0xd86b('0x1d')]=qs[_0xd86b('0x1d')](_0x29ade8[_0xd86b('0x30')][_0xd86b('0x1d')]);_0x43041d[_0xd86b('0x1b')]=qs[_0xd86b('0x1b')](_0x29ade8[_0xd86b('0x30')][_0xd86b('0x1b')]);}return _0x5aebd4[_0xd86b('0x52')](_0x43041d);}})['then'](function(_0x5780dd){if(_0x5780dd){return _0x5780dd?{'count':_0x32938c,'rows':_0x5780dd}:null;}})[_0xd86b('0x25')](respondWithResult(_0x4fc79f,null))[_0xd86b('0x46')](handleError(_0x4fc79f,null));};exports[_0xd86b('0x53')]=function(_0x4af2ed,_0x243871,_0x210a66){var _0x1742d0={};var _0x444fe6={};var _0x2ea58c;var _0x3257c9;return db[_0xd86b('0x42')][_0xd86b('0x4f')]({'where':{'id':_0x4af2ed[_0xd86b('0x48')]['id']}})[_0xd86b('0x25')](handleEntityNotFound(_0x243871,null))[_0xd86b('0x25')](function(_0x31db9e){if(_0x31db9e){_0x2ea58c=_0x31db9e;_0x444fe6['model']=_[_0xd86b('0x31')](db['Dynamics365Field'][_0xd86b('0x51')]);_0x444fe6[_0xd86b('0x30')]=_[_0xd86b('0x31')](_0x4af2ed[_0xd86b('0x30')]);_0x444fe6['filters']=_[_0xd86b('0x33')](_0x444fe6[_0xd86b('0x2f')],_0x444fe6[_0xd86b('0x30')]);_0x1742d0[_0xd86b('0x34')]=_[_0xd86b('0x33')](_0x444fe6['model'],qs['fields'](_0x4af2ed['query'][_0xd86b('0x35')]));_0x1742d0[_0xd86b('0x34')]=_0x1742d0[_0xd86b('0x34')][_0xd86b('0x36')]?_0x1742d0[_0xd86b('0x34')]:_0x444fe6[_0xd86b('0x2f')];_0x1742d0['order']=qs[_0xd86b('0x3a')](_0x4af2ed[_0xd86b('0x30')][_0xd86b('0x3a')]);_0x1742d0[_0xd86b('0x3b')]=qs[_0xd86b('0x32')](_[_0xd86b('0x3c')](_0x4af2ed[_0xd86b('0x30')],_0x444fe6[_0xd86b('0x32')]));if(_0x4af2ed[_0xd86b('0x30')][_0xd86b('0x3d')]){_0x1742d0['where']=_[_0xd86b('0x3e')](_0x1742d0[_0xd86b('0x3b')],{'$or':_['map'](_0x1742d0[_0xd86b('0x34')],function(_0x514986){var _0x1a8af7={};_0x1a8af7[_0x514986]={'$like':'%'+_0x4af2ed[_0xd86b('0x30')][_0xd86b('0x3d')]+'%'};return _0x1a8af7;})});}_0x1742d0=_[_0xd86b('0x3e')]({},_0x1742d0,_0x4af2ed['options']);return _0x2ea58c[_0xd86b('0x53')](_0x1742d0);}})[_0xd86b('0x25')](function(_0x369504){if(_0x369504){_0x3257c9=_0x369504[_0xd86b('0x36')];if(!_0x4af2ed['query'][_0xd86b('0x37')]('nolimit')){_0x1742d0['limit']=qs[_0xd86b('0x1d')](_0x4af2ed['query'][_0xd86b('0x1d')]);_0x1742d0[_0xd86b('0x1b')]=qs[_0xd86b('0x1b')](_0x4af2ed['query']['offset']);}return _0x2ea58c['getDescriptions'](_0x1742d0);}})[_0xd86b('0x25')](function(_0xd4d344){if(_0xd4d344){return _0xd4d344?{'count':_0x3257c9,'rows':_0xd4d344}:null;}})[_0xd86b('0x25')](respondWithResult(_0x243871,null))[_0xd86b('0x46')](handleError(_0x243871,null));}; \ No newline at end of file +var _0xa26e=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','stack','name','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','Dynamics365Configuration','find','catch','create','body','params','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0xeb1c75,_0x5a1a4a){var _0x476467=function(_0x239acf){while(--_0x239acf){_0xeb1c75['push'](_0xeb1c75['shift']());}};_0x476467(++_0x5a1a4a);}(_0xa26e,0x1c4));var _0xea26=function(_0x344c19,_0x570604){_0x344c19=_0x344c19-0x0;var _0x27e315=_0xa26e[_0x344c19];return _0x27e315;};'use strict';var emlformat=require(_0xea26('0x0'));var rimraf=require(_0xea26('0x1'));var zipdir=require(_0xea26('0x2'));var jsonpatch=require(_0xea26('0x3'));var rp=require(_0xea26('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xea26('0x5'));var util=require(_0xea26('0x6'));var path=require(_0xea26('0x7'));var sox=require(_0xea26('0x8'));var csv=require(_0xea26('0x9'));var ejs=require(_0xea26('0xa'));var fs=require('fs');var fs_extra=require(_0xea26('0xb'));var _=require(_0xea26('0xc'));var squel=require(_0xea26('0xd'));var crypto=require('crypto');var jsforce=require(_0xea26('0xe'));var deskjs=require(_0xea26('0xf'));var toCsv=require('to-csv');var querystring=require(_0xea26('0x10'));var Papa=require(_0xea26('0x11'));var Redis=require('ioredis');var authService=require(_0xea26('0x12'));var qs=require(_0xea26('0x13'));var as=require(_0xea26('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xea26('0x15'));var utils=require(_0xea26('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xea26('0x17'));var db=require(_0xea26('0x18'))['db'];function respondWithStatusCode(_0x5e76bc,_0x2903b6){_0x2903b6=_0x2903b6||0xcc;return function(_0x4b8a2b){if(_0x4b8a2b){return _0x5e76bc['sendStatus'](_0x2903b6);}return _0x5e76bc['status'](_0x2903b6)[_0xea26('0x19')]();};}function respondWithResult(_0x580c5e,_0x2b1588){_0x2b1588=_0x2b1588||0xc8;return function(_0x276607){if(_0x276607){return _0x580c5e[_0xea26('0x1a')](_0x2b1588)[_0xea26('0x1b')](_0x276607);}};}function respondWithFilteredResult(_0x2b4338,_0x162a89){return function(_0x10a13e){if(_0x10a13e){var _0x852f05=typeof _0x162a89['offset']===_0xea26('0x1c')&&typeof _0x162a89[_0xea26('0x1d')]==='undefined';var _0x50afc3=_0x10a13e[_0xea26('0x1e')];var _0x2368fa=_0x852f05?0x0:_0x162a89[_0xea26('0x1f')];var _0x1d759e=_0x852f05?_0x10a13e['count']:_0x162a89[_0xea26('0x1f')]+_0x162a89[_0xea26('0x1d')];var _0x3a6cc1;if(_0x1d759e>=_0x50afc3){_0x1d759e=_0x50afc3;_0x3a6cc1=0xc8;}else{_0x3a6cc1=0xce;}_0x2b4338[_0xea26('0x1a')](_0x3a6cc1);return _0x2b4338[_0xea26('0x20')](_0xea26('0x21'),_0x2368fa+'-'+_0x1d759e+'/'+_0x50afc3)[_0xea26('0x1b')](_0x10a13e);}return null;};}function patchUpdates(_0x3b6469){return function(_0x5d30cf){try{jsonpatch[_0xea26('0x22')](_0x5d30cf,_0x3b6469,!![]);}catch(_0x10c477){return BPromise['reject'](_0x10c477);}return _0x5d30cf[_0xea26('0x23')]();};}function saveUpdates(_0x7ede3c,_0x4cb82c){return function(_0x2815b6){if(_0x2815b6){return _0x2815b6['update'](_0x7ede3c)[_0xea26('0x24')](function(_0x79ce4d){return _0x79ce4d;});}return null;};}function removeEntity(_0x28a810,_0x3ca604){return function(_0x194a89){if(_0x194a89){return _0x194a89[_0xea26('0x25')]()[_0xea26('0x24')](function(){_0x28a810[_0xea26('0x1a')](0xcc)[_0xea26('0x19')]();});}};}function handleEntityNotFound(_0x14e487,_0x4587ec){return function(_0x577e53){if(!_0x577e53){_0x14e487['sendStatus'](0x194);}return _0x577e53;};}function handleError(_0x232067,_0x93ba8b){_0x93ba8b=_0x93ba8b||0x1f4;return function(_0x407330){logger['error'](_0x407330[_0xea26('0x26')]);if(_0x407330[_0xea26('0x27')]){delete _0x407330[_0xea26('0x27')];}_0x232067[_0xea26('0x1a')](_0x93ba8b)['send'](_0x407330);};}exports['index']=function(_0x5b9561,_0x41e49a){var _0x327828={},_0x40dc39={},_0x129dd8={'count':0x0,'rows':[]};var _0x3ed337=_['map'](db['Dynamics365Configuration'][_0xea26('0x28')],function(_0x107541){return{'name':_0x107541[_0xea26('0x29')],'type':_0x107541[_0xea26('0x2a')][_0xea26('0x2b')]};});_0x40dc39[_0xea26('0x2c')]=_[_0xea26('0x2d')](_0x3ed337,_0xea26('0x27'));_0x40dc39[_0xea26('0x2e')]=_[_0xea26('0x2f')](_0x5b9561[_0xea26('0x2e')]);_0x40dc39[_0xea26('0x30')]=_[_0xea26('0x31')](_0x40dc39[_0xea26('0x2c')],_0x40dc39[_0xea26('0x2e')]);_0x327828['attributes']=_[_0xea26('0x31')](_0x40dc39['model'],qs[_0xea26('0x32')](_0x5b9561[_0xea26('0x2e')][_0xea26('0x32')]));_0x327828[_0xea26('0x33')]=_0x327828['attributes'][_0xea26('0x34')]?_0x327828['attributes']:_0x40dc39[_0xea26('0x2c')];if(!_0x5b9561['query'][_0xea26('0x35')](_0xea26('0x36'))){_0x327828['limit']=qs['limit'](_0x5b9561[_0xea26('0x2e')][_0xea26('0x1d')]);_0x327828[_0xea26('0x1f')]=qs['offset'](_0x5b9561['query']['offset']);}_0x327828[_0xea26('0x37')]=qs[_0xea26('0x38')](_0x5b9561[_0xea26('0x2e')][_0xea26('0x38')]);_0x327828[_0xea26('0x39')]=qs[_0xea26('0x30')](_[_0xea26('0x3a')](_0x5b9561[_0xea26('0x2e')],_0x40dc39[_0xea26('0x30')]),_0x3ed337);if(_0x5b9561[_0xea26('0x2e')][_0xea26('0x3b')]){_0x327828[_0xea26('0x39')]=_[_0xea26('0x3c')](_0x327828[_0xea26('0x39')],{'$or':_[_0xea26('0x2d')](_0x3ed337,function(_0xa437a3){if(_0xa437a3['type']!==_0xea26('0x3d')){var _0x1f1c07={};_0x1f1c07[_0xa437a3[_0xea26('0x27')]]={'$like':'%'+_0x5b9561[_0xea26('0x2e')][_0xea26('0x3b')]+'%'};return _0x1f1c07;}})});}_0x327828=_[_0xea26('0x3c')]({},_0x327828,_0x5b9561[_0xea26('0x3e')]);var _0x5f0fa0={'where':_0x327828[_0xea26('0x39')]};return db['Dynamics365Configuration']['count'](_0x5f0fa0)[_0xea26('0x24')](function(_0x5890be){_0x129dd8['count']=_0x5890be;if(_0x5b9561['query'][_0xea26('0x3f')]){_0x327828[_0xea26('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x327828);})[_0xea26('0x24')](function(_0x22b829){_0x129dd8[_0xea26('0x41')]=_0x22b829;return _0x129dd8;})['then'](respondWithFilteredResult(_0x41e49a,_0x327828))['catch'](handleError(_0x41e49a,null));};exports[_0xea26('0x42')]=function(_0x1fbe75,_0x465ac1){var _0x29c3da={'raw':![],'where':{'id':_0x1fbe75['params']['id']}},_0x12a24c={};_0x12a24c[_0xea26('0x2c')]=_[_0xea26('0x2f')](db[_0xea26('0x43')]['rawAttributes']);_0x12a24c[_0xea26('0x2e')]=_[_0xea26('0x2f')](_0x1fbe75['query']);_0x12a24c[_0xea26('0x30')]=_['intersection'](_0x12a24c['model'],_0x12a24c[_0xea26('0x2e')]);_0x29c3da['attributes']=_[_0xea26('0x31')](_0x12a24c[_0xea26('0x2c')],qs['fields'](_0x1fbe75[_0xea26('0x2e')][_0xea26('0x32')]));_0x29c3da[_0xea26('0x33')]=_0x29c3da[_0xea26('0x33')]['length']?_0x29c3da['attributes']:_0x12a24c[_0xea26('0x2c')];if(_0x1fbe75[_0xea26('0x2e')][_0xea26('0x3f')]){_0x29c3da[_0xea26('0x40')]=[{'all':!![]}];}_0x29c3da=_[_0xea26('0x3c')]({},_0x29c3da,_0x1fbe75[_0xea26('0x3e')]);return db[_0xea26('0x43')][_0xea26('0x44')](_0x29c3da)[_0xea26('0x24')](handleEntityNotFound(_0x465ac1,null))[_0xea26('0x24')](respondWithResult(_0x465ac1,null))[_0xea26('0x45')](handleError(_0x465ac1,null));};exports['create']=function(_0x268b4f,_0x148cb2){return db[_0xea26('0x43')][_0xea26('0x46')](_0x268b4f[_0xea26('0x47')],{})['then'](respondWithResult(_0x148cb2,0xc9))['catch'](handleError(_0x148cb2,null));};exports['update']=function(_0x32dc21,_0x1ae9cf){if(_0x32dc21[_0xea26('0x47')]['id']){delete _0x32dc21['body']['id'];}return db[_0xea26('0x43')][_0xea26('0x44')]({'where':{'id':_0x32dc21[_0xea26('0x48')]['id']}})[_0xea26('0x24')](handleEntityNotFound(_0x1ae9cf,null))[_0xea26('0x24')](saveUpdates(_0x32dc21[_0xea26('0x47')],null))[_0xea26('0x24')](respondWithResult(_0x1ae9cf,null))[_0xea26('0x45')](handleError(_0x1ae9cf,null));};exports[_0xea26('0x25')]=function(_0x5e6fb2,_0x462559){return db[_0xea26('0x43')]['find']({'where':{'id':_0x5e6fb2[_0xea26('0x48')]['id']}})[_0xea26('0x24')](handleEntityNotFound(_0x462559,null))[_0xea26('0x24')](removeEntity(_0x462559,null))[_0xea26('0x45')](handleError(_0x462559,null));};exports['getFields']=function(_0x4e96ee,_0xad40e0,_0x4f3d1c){var _0x345989={};var _0xbc07fa={};var _0x449b94;var _0x1b82c9;return db[_0xea26('0x43')][_0xea26('0x49')]({'where':{'id':_0x4e96ee[_0xea26('0x48')]['id']}})['then'](handleEntityNotFound(_0xad40e0,null))[_0xea26('0x24')](function(_0x17bfd6){if(_0x17bfd6){_0x449b94=_0x17bfd6;_0xbc07fa['model']=_[_0xea26('0x2f')](db[_0xea26('0x4a')]['rawAttributes']);_0xbc07fa[_0xea26('0x2e')]=_[_0xea26('0x2f')](_0x4e96ee[_0xea26('0x2e')]);_0xbc07fa[_0xea26('0x30')]=_[_0xea26('0x31')](_0xbc07fa[_0xea26('0x2c')],_0xbc07fa[_0xea26('0x2e')]);_0x345989[_0xea26('0x33')]=_[_0xea26('0x31')](_0xbc07fa[_0xea26('0x2c')],qs[_0xea26('0x32')](_0x4e96ee[_0xea26('0x2e')][_0xea26('0x32')]));_0x345989[_0xea26('0x33')]=_0x345989['attributes'][_0xea26('0x34')]?_0x345989[_0xea26('0x33')]:_0xbc07fa['model'];_0x345989['order']=qs[_0xea26('0x38')](_0x4e96ee[_0xea26('0x2e')][_0xea26('0x38')]);_0x345989['where']=qs[_0xea26('0x30')](_[_0xea26('0x3a')](_0x4e96ee[_0xea26('0x2e')],_0xbc07fa['filters']));if(_0x4e96ee[_0xea26('0x2e')][_0xea26('0x3b')]){_0x345989[_0xea26('0x39')]=_[_0xea26('0x3c')](_0x345989[_0xea26('0x39')],{'$or':_[_0xea26('0x2d')](_0x345989['attributes'],function(_0x3e3b56){var _0x1d3821={};_0x1d3821[_0x3e3b56]={'$like':'%'+_0x4e96ee['query'][_0xea26('0x3b')]+'%'};return _0x1d3821;})});}_0x345989=_['merge']({},_0x345989,_0x4e96ee[_0xea26('0x3e')]);return _0x449b94['getFields'](_0x345989);}})['then'](function(_0x1aa7b3){if(_0x1aa7b3){_0x1b82c9=_0x1aa7b3[_0xea26('0x34')];if(!_0x4e96ee[_0xea26('0x2e')][_0xea26('0x35')](_0xea26('0x36'))){_0x345989[_0xea26('0x1d')]=qs[_0xea26('0x1d')](_0x4e96ee[_0xea26('0x2e')][_0xea26('0x1d')]);_0x345989[_0xea26('0x1f')]=qs['offset'](_0x4e96ee[_0xea26('0x2e')][_0xea26('0x1f')]);}return _0x449b94[_0xea26('0x4b')](_0x345989);}})[_0xea26('0x24')](function(_0x56e01f){if(_0x56e01f){return _0x56e01f?{'count':_0x1b82c9,'rows':_0x56e01f}:null;}})[_0xea26('0x24')](respondWithResult(_0xad40e0,null))[_0xea26('0x45')](handleError(_0xad40e0,null));};exports['getSubjects']=function(_0x5d5130,_0x18d5e6,_0xe937c){var _0x4e402b={};var _0x578e06={};var _0x5040c9;var _0xc1231e;return db[_0xea26('0x43')]['findOne']({'where':{'id':_0x5d5130[_0xea26('0x48')]['id']}})[_0xea26('0x24')](handleEntityNotFound(_0x18d5e6,null))['then'](function(_0xdd5008){if(_0xdd5008){_0x5040c9=_0xdd5008;_0x578e06[_0xea26('0x2c')]=_[_0xea26('0x2f')](db[_0xea26('0x4a')][_0xea26('0x28')]);_0x578e06[_0xea26('0x2e')]=_[_0xea26('0x2f')](_0x5d5130['query']);_0x578e06[_0xea26('0x30')]=_[_0xea26('0x31')](_0x578e06[_0xea26('0x2c')],_0x578e06[_0xea26('0x2e')]);_0x4e402b['attributes']=_[_0xea26('0x31')](_0x578e06[_0xea26('0x2c')],qs[_0xea26('0x32')](_0x5d5130[_0xea26('0x2e')]['fields']));_0x4e402b['attributes']=_0x4e402b[_0xea26('0x33')]['length']?_0x4e402b[_0xea26('0x33')]:_0x578e06[_0xea26('0x2c')];_0x4e402b[_0xea26('0x37')]=qs['sort'](_0x5d5130['query'][_0xea26('0x38')]);_0x4e402b[_0xea26('0x39')]=qs['filters'](_[_0xea26('0x3a')](_0x5d5130[_0xea26('0x2e')],_0x578e06[_0xea26('0x30')]));if(_0x5d5130[_0xea26('0x2e')][_0xea26('0x3b')]){_0x4e402b[_0xea26('0x39')]=_['merge'](_0x4e402b[_0xea26('0x39')],{'$or':_['map'](_0x4e402b[_0xea26('0x33')],function(_0x44e561){var _0x2e2cc9={};_0x2e2cc9[_0x44e561]={'$like':'%'+_0x5d5130[_0xea26('0x2e')][_0xea26('0x3b')]+'%'};return _0x2e2cc9;})});}_0x4e402b=_[_0xea26('0x3c')]({},_0x4e402b,_0x5d5130['options']);return _0x5040c9[_0xea26('0x4c')](_0x4e402b);}})['then'](function(_0x42d6a2){if(_0x42d6a2){_0xc1231e=_0x42d6a2[_0xea26('0x34')];if(!_0x5d5130[_0xea26('0x2e')][_0xea26('0x35')](_0xea26('0x36'))){_0x4e402b[_0xea26('0x1d')]=qs[_0xea26('0x1d')](_0x5d5130[_0xea26('0x2e')][_0xea26('0x1d')]);_0x4e402b[_0xea26('0x1f')]=qs[_0xea26('0x1f')](_0x5d5130[_0xea26('0x2e')][_0xea26('0x1f')]);}return _0x5040c9[_0xea26('0x4c')](_0x4e402b);}})[_0xea26('0x24')](function(_0x3202c9){if(_0x3202c9){return _0x3202c9?{'count':_0xc1231e,'rows':_0x3202c9}:null;}})[_0xea26('0x24')](respondWithResult(_0x18d5e6,null))['catch'](handleError(_0x18d5e6,null));};exports[_0xea26('0x4d')]=function(_0xe1e7ef,_0x147001,_0xa26094){var _0x532638={};var _0x208a25={};var _0x4f25c7;var _0x3aced5;return db[_0xea26('0x43')][_0xea26('0x49')]({'where':{'id':_0xe1e7ef[_0xea26('0x48')]['id']}})[_0xea26('0x24')](handleEntityNotFound(_0x147001,null))[_0xea26('0x24')](function(_0x21a041){if(_0x21a041){_0x4f25c7=_0x21a041;_0x208a25['model']=_[_0xea26('0x2f')](db[_0xea26('0x4a')]['rawAttributes']);_0x208a25[_0xea26('0x2e')]=_['keys'](_0xe1e7ef[_0xea26('0x2e')]);_0x208a25[_0xea26('0x30')]=_[_0xea26('0x31')](_0x208a25[_0xea26('0x2c')],_0x208a25['query']);_0x532638[_0xea26('0x33')]=_[_0xea26('0x31')](_0x208a25[_0xea26('0x2c')],qs[_0xea26('0x32')](_0xe1e7ef[_0xea26('0x2e')][_0xea26('0x32')]));_0x532638[_0xea26('0x33')]=_0x532638[_0xea26('0x33')][_0xea26('0x34')]?_0x532638['attributes']:_0x208a25[_0xea26('0x2c')];_0x532638['order']=qs[_0xea26('0x38')](_0xe1e7ef[_0xea26('0x2e')][_0xea26('0x38')]);_0x532638['where']=qs[_0xea26('0x30')](_[_0xea26('0x3a')](_0xe1e7ef[_0xea26('0x2e')],_0x208a25[_0xea26('0x30')]));if(_0xe1e7ef[_0xea26('0x2e')][_0xea26('0x3b')]){_0x532638[_0xea26('0x39')]=_[_0xea26('0x3c')](_0x532638['where'],{'$or':_['map'](_0x532638['attributes'],function(_0x1aa123){var _0x3b3d38={};_0x3b3d38[_0x1aa123]={'$like':'%'+_0xe1e7ef[_0xea26('0x2e')][_0xea26('0x3b')]+'%'};return _0x3b3d38;})});}_0x532638=_[_0xea26('0x3c')]({},_0x532638,_0xe1e7ef[_0xea26('0x3e')]);return _0x4f25c7[_0xea26('0x4d')](_0x532638);}})[_0xea26('0x24')](function(_0x2a943a){if(_0x2a943a){_0x3aced5=_0x2a943a['length'];if(!_0xe1e7ef['query'][_0xea26('0x35')](_0xea26('0x36'))){_0x532638[_0xea26('0x1d')]=qs[_0xea26('0x1d')](_0xe1e7ef[_0xea26('0x2e')][_0xea26('0x1d')]);_0x532638['offset']=qs[_0xea26('0x1f')](_0xe1e7ef['query'][_0xea26('0x1f')]);}return _0x4f25c7['getDescriptions'](_0x532638);}})[_0xea26('0x24')](function(_0x33f5ca){if(_0x33f5ca){return _0x33f5ca?{'count':_0x3aced5,'rows':_0x33f5ca}:null;}})['then'](respondWithResult(_0x147001,null))[_0xea26('0x45')](handleError(_0x147001,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5c5c693..8f7b74e 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 _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0xb97d6c,_0x84e16d){var _0x2bd7b3=function(_0x20051c){while(--_0x20051c){_0xb97d6c['push'](_0xb97d6c['shift']());}};_0x2bd7b3(++_0x84e16d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x456183,_0x3aebef){var _0x518f74=function(_0x3904f7){while(--_0x3904f7){_0x456183['push'](_0x456183['shift']());}};_0x518f74(++_0x3aebef);}(_0xa41a,0x6b));var _0xaa41=function(_0x54709d,_0x27fe3b){_0x54709d=_0x54709d-0x0;var _0x5280e7=_0xa41a[_0x54709d];return _0x5280e7;};'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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 16d99b7..a7b47c0 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 _0xa561=['code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','error'];(function(_0x12a0ab,_0x2753b3){var _0x9be6bd=function(_0x5e406a){while(--_0x5e406a){_0x12a0ab['push'](_0x12a0ab['shift']());}};_0x9be6bd(++_0x2753b3);}(_0xa561,0x1ac));var _0x1a56=function(_0x16e55,_0xd402c8){_0x16e55=_0x16e55-0x0;var _0x21e73e=_0xa561[_0x16e55];return _0x21e73e;};'use strict';var _=require('lodash');var util=require(_0x1a56('0x0'));var moment=require(_0x1a56('0x1'));var BPromise=require(_0x1a56('0x2'));var rs=require(_0x1a56('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a56('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a56('0x5'));var config=require(_0x1a56('0x6'));var jayson=require(_0x1a56('0x7'));var client=jayson['client'][_0x1a56('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37605d,_0x100e56,_0x53a1cc){return new BPromise(function(_0x1f5624,_0x144641){return client['request'](_0x37605d,_0x53a1cc)[_0x1a56('0x9')](function(_0x1df0ad){logger[_0x1a56('0xa')](_0x1a56('0xb'),_0x100e56,_0x1a56('0xc'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x100e56,_0x1a56('0xc'),JSON['stringify'](_0x1df0ad));if(_0x1df0ad['error']){if(_0x1df0ad[_0x1a56('0xd')][_0x1a56('0xe')]===0x1f4){logger[_0x1a56('0xd')](_0x1a56('0xb'),_0x100e56,_0x1df0ad[_0x1a56('0xd')][_0x1a56('0xf')]);return _0x144641(_0x1df0ad['error']['message']);}logger[_0x1a56('0xd')](_0x1a56('0xb'),_0x100e56,_0x1df0ad[_0x1a56('0xd')][_0x1a56('0xf')]);return _0x1f5624(_0x1df0ad['error']['message']);}else{logger[_0x1a56('0xa')](_0x1a56('0xb'),_0x100e56,_0x1a56('0xc'));_0x1f5624(_0x1df0ad['result'][_0x1a56('0xf')]);}})[_0x1a56('0x10')](function(_0x61c13){logger[_0x1a56('0xd')](_0x1a56('0xb'),_0x100e56,_0x61c13);_0x144641(_0x61c13);});});} \ No newline at end of file +var _0x50c9=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x50c9,0xc7));var _0x950c=function(_0xe98045,_0x15eee6){_0xe98045=_0xe98045-0x0;var _0x2b84bc=_0x50c9[_0xe98045];return _0x2b84bc;};'use strict';var _=require(_0x950c('0x0'));var util=require(_0x950c('0x1'));var moment=require(_0x950c('0x2'));var BPromise=require(_0x950c('0x3'));var rs=require(_0x950c('0x4'));var fs=require('fs');var Redis=require(_0x950c('0x5'));var db=require(_0x950c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x950c('0x7'));var config=require(_0x950c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x950c('0x9')][_0x950c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x369ae6,_0x2f490b,_0x357787){return new BPromise(function(_0x333d3d,_0x3267eb){return client['request'](_0x369ae6,_0x357787)[_0x950c('0xb')](function(_0x2df382){logger[_0x950c('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2f490b,_0x950c('0xd'));logger[_0x950c('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2f490b,_0x950c('0xd'),JSON[_0x950c('0xf')](_0x2df382));if(_0x2df382[_0x950c('0x10')]){if(_0x2df382[_0x950c('0x10')][_0x950c('0x11')]===0x1f4){logger['error'](_0x950c('0x12'),_0x2f490b,_0x2df382['error']['message']);return _0x3267eb(_0x2df382[_0x950c('0x10')][_0x950c('0x13')]);}logger[_0x950c('0x10')](_0x950c('0x12'),_0x2f490b,_0x2df382[_0x950c('0x10')][_0x950c('0x13')]);return _0x333d3d(_0x2df382[_0x950c('0x10')][_0x950c('0x13')]);}else{logger[_0x950c('0xc')](_0x950c('0x12'),_0x2f490b,'request\x20sent');_0x333d3d(_0x2df382[_0x950c('0x14')][_0x950c('0x13')]);}})[_0x950c('0x15')](function(_0xecb372){logger[_0x950c('0x10')](_0x950c('0x12'),_0x2f490b,_0xecb372);_0x3267eb(_0xecb372);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 312cfd1..d3d4148 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 _0x7186=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./intDynamics365Field.controller','isAuthenticated','get','show','post','create','put','/:id','update','delete','destroy'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x7186,0x10f));var _0x6718=function(_0x3e9dfb,_0x92d3aa){_0x3e9dfb=_0x3e9dfb-0x0;var _0x491efb=_0x7186[_0x3e9dfb];return _0x491efb;};'use strict';var multer=require(_0x6718('0x0'));var util=require(_0x6718('0x1'));var path=require('path');var timeout=require(_0x6718('0x2'));var express=require(_0x6718('0x3'));var router=express['Router']();var fs_extra=require(_0x6718('0x4'));var auth=require(_0x6718('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6718('0x6'));router['get']('/',auth[_0x6718('0x7')](),controller['index']);router[_0x6718('0x8')]('/:id',auth[_0x6718('0x7')](),controller[_0x6718('0x9')]);router[_0x6718('0xa')]('/',auth[_0x6718('0x7')](),controller[_0x6718('0xb')]);router[_0x6718('0xc')](_0x6718('0xd'),auth['isAuthenticated'](),controller[_0x6718('0xe')]);router[_0x6718('0xf')](_0x6718('0xd'),auth[_0x6718('0x7')](),controller[_0x6718('0x10')]);module[_0x6718('0x11')]=router; \ No newline at end of file +var _0xea79=['../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x215b41,_0x55c9a5){var _0x37f0a7=function(_0x5d948b){while(--_0x5d948b){_0x215b41['push'](_0x215b41['shift']());}};_0x37f0a7(++_0x55c9a5);}(_0xea79,0x1f2));var _0x9ea7=function(_0x54cca3,_0x3b297d){_0x54cca3=_0x54cca3-0x0;var _0x348fde=_0xea79[_0x54cca3];return _0x348fde;};'use strict';var multer=require('multer');var util=require(_0x9ea7('0x0'));var path=require(_0x9ea7('0x1'));var timeout=require(_0x9ea7('0x2'));var express=require(_0x9ea7('0x3'));var router=express[_0x9ea7('0x4')]();var fs_extra=require(_0x9ea7('0x5'));var auth=require(_0x9ea7('0x6'));var interaction=require(_0x9ea7('0x7'));var config=require(_0x9ea7('0x8'));var controller=require(_0x9ea7('0x9'));router[_0x9ea7('0xa')]('/',auth['isAuthenticated'](),controller[_0x9ea7('0xb')]);router[_0x9ea7('0xa')](_0x9ea7('0xc'),auth[_0x9ea7('0xd')](),controller[_0x9ea7('0xe')]);router[_0x9ea7('0xf')]('/',auth[_0x9ea7('0xd')](),controller[_0x9ea7('0x10')]);router[_0x9ea7('0x11')](_0x9ea7('0xc'),auth['isAuthenticated'](),controller[_0x9ea7('0x12')]);router[_0x9ea7('0x13')]('/:id',auth[_0x9ea7('0xd')](),controller[_0x9ea7('0x14')]);module[_0x9ea7('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 9d2e49e..d54829e 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 _0x0eff=['variable','customVariable','keyValue','string','STRING','sequelize','ENUM'];(function(_0x4628c6,_0x212c5e){var _0x181ddc=function(_0x36280a){while(--_0x36280a){_0x4628c6['push'](_0x4628c6['shift']());}};_0x181ddc(++_0x212c5e);}(_0x0eff,0x178));var _0xf0ef=function(_0x2f32c4,_0x531dc6){_0x2f32c4=_0x2f32c4-0x0;var _0x3f3018=_0x0eff[_0x2f32c4];return _0x3f3018;};'use strict';var Sequelize=require(_0xf0ef('0x0'));module['exports']={'type':{'type':Sequelize[_0xf0ef('0x1')]('string',_0xf0ef('0x2'),_0xf0ef('0x3'),_0xf0ef('0x4'),'picklist'),'defaultValue':_0xf0ef('0x5')},'content':{'type':Sequelize[_0xf0ef('0x6')]},'key':{'type':Sequelize[_0xf0ef('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xf0ef('0x5'),'variable',_0xf0ef('0x3'))},'keyContent':{'type':Sequelize[_0xf0ef('0x6')]},'idField':{'type':Sequelize[_0xf0ef('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x36c2=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x4ed482,_0x12d35f){var _0x2540b6=function(_0x111822){while(--_0x111822){_0x4ed482['push'](_0x4ed482['shift']());}};_0x2540b6(++_0x12d35f);}(_0x36c2,0x114));var _0x236c=function(_0x59de16,_0x1020a1){_0x59de16=_0x59de16-0x0;var _0x4dc86b=_0x36c2[_0x59de16];return _0x4dc86b;};'use strict';var Sequelize=require(_0x236c('0x0'));module[_0x236c('0x1')]={'type':{'type':Sequelize[_0x236c('0x2')]('string',_0x236c('0x3'),_0x236c('0x4'),_0x236c('0x5'),_0x236c('0x6')),'defaultValue':_0x236c('0x7')},'content':{'type':Sequelize[_0x236c('0x8')]},'key':{'type':Sequelize[_0x236c('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x236c('0x7'),_0x236c('0x3'),_0x236c('0x4'))},'keyContent':{'type':Sequelize[_0x236c('0x8')]},'idField':{'type':Sequelize[_0x236c('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x236c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x236c('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index b42d208..b0becb8 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 _0x364e=['sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','Dynamics365Field','includeAll','include','rows','catch','length','options','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path'];(function(_0x30b4da,_0x1e1a64){var _0xc5eaaa=function(_0x126fac){while(--_0x126fac){_0x30b4da['push'](_0x30b4da['shift']());}};_0xc5eaaa(++_0x1e1a64);}(_0x364e,0x15b));var _0xe364=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x364e[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0xe364('0x0'));var rimraf=require(_0xe364('0x1'));var zipdir=require(_0xe364('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe364('0x3'));var moment=require('moment');var BPromise=require(_0xe364('0x4'));var Mustache=require(_0xe364('0x5'));var util=require(_0xe364('0x6'));var path=require(_0xe364('0x7'));var sox=require(_0xe364('0x8'));var csv=require(_0xe364('0x9'));var ejs=require(_0xe364('0xa'));var fs=require('fs');var fs_extra=require(_0xe364('0xb'));var _=require('lodash');var squel=require(_0xe364('0xc'));var crypto=require('crypto');var jsforce=require(_0xe364('0xd'));var deskjs=require(_0xe364('0xe'));var toCsv=require(_0xe364('0x9'));var querystring=require(_0xe364('0xf'));var Papa=require(_0xe364('0x10'));var Redis=require('ioredis');var authService=require(_0xe364('0x11'));var qs=require(_0xe364('0x12'));var as=require(_0xe364('0x13'));var hardwareService=require(_0xe364('0x14'));var logger=require(_0xe364('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xe364('0x16'));var licenseUtil=require(_0xe364('0x17'));var db=require(_0xe364('0x18'))['db'];function respondWithStatusCode(_0x4fb272,_0x1f92b3){_0x1f92b3=_0x1f92b3||0xcc;return function(_0x38a3ca){if(_0x38a3ca){return _0x4fb272[_0xe364('0x19')](_0x1f92b3);}return _0x4fb272[_0xe364('0x1a')](_0x1f92b3)[_0xe364('0x1b')]();};}function respondWithResult(_0x4aa54f,_0x377220){_0x377220=_0x377220||0xc8;return function(_0xfd8b3c){if(_0xfd8b3c){return _0x4aa54f[_0xe364('0x1a')](_0x377220)['json'](_0xfd8b3c);}};}function respondWithFilteredResult(_0x39a040,_0x750d96){return function(_0x40dc8b){if(_0x40dc8b){var _0x4e52d3=typeof _0x750d96[_0xe364('0x1c')]===_0xe364('0x1d')&&typeof _0x750d96['limit']==='undefined';var _0x3590d9=_0x40dc8b[_0xe364('0x1e')];var _0x49b5b1=_0x4e52d3?0x0:_0x750d96[_0xe364('0x1c')];var _0x445cc3=_0x4e52d3?_0x40dc8b[_0xe364('0x1e')]:_0x750d96[_0xe364('0x1c')]+_0x750d96[_0xe364('0x1f')];var _0x3ec0cf;if(_0x445cc3>=_0x3590d9){_0x445cc3=_0x3590d9;_0x3ec0cf=0xc8;}else{_0x3ec0cf=0xce;}_0x39a040[_0xe364('0x1a')](_0x3ec0cf);return _0x39a040[_0xe364('0x20')](_0xe364('0x21'),_0x49b5b1+'-'+_0x445cc3+'/'+_0x3590d9)[_0xe364('0x22')](_0x40dc8b);}return null;};}function patchUpdates(_0x1b6241){return function(_0x23232d){try{jsonpatch[_0xe364('0x23')](_0x23232d,_0x1b6241,!![]);}catch(_0x196e05){return BPromise[_0xe364('0x24')](_0x196e05);}return _0x23232d[_0xe364('0x25')]();};}function saveUpdates(_0x8b052a,_0x3a2c4e){return function(_0x3aa838){if(_0x3aa838){return _0x3aa838['update'](_0x8b052a)[_0xe364('0x26')](function(_0x46b8e2){return _0x46b8e2;});}return null;};}function removeEntity(_0x3b974d,_0x8bc806){return function(_0x1309b2){if(_0x1309b2){return _0x1309b2[_0xe364('0x27')]()[_0xe364('0x26')](function(){_0x3b974d[_0xe364('0x1a')](0xcc)[_0xe364('0x1b')]();});}};}function handleEntityNotFound(_0x55a366,_0x115229){return function(_0x5009db){if(!_0x5009db){_0x55a366[_0xe364('0x19')](0x194);}return _0x5009db;};}function handleError(_0x43dacc,_0x42d3d3){_0x42d3d3=_0x42d3d3||0x1f4;return function(_0x47fef8){logger['error'](_0x47fef8['stack']);if(_0x47fef8[_0xe364('0x28')]){delete _0x47fef8['name'];}_0x43dacc[_0xe364('0x1a')](_0x42d3d3)['send'](_0x47fef8);};}exports[_0xe364('0x29')]=function(_0x2c8b34,_0x4d689f){var _0x53902f={},_0x2df6ac={},_0x547d62={'count':0x0,'rows':[]};var _0x496bb6=_[_0xe364('0x2a')](db['Dynamics365Field'][_0xe364('0x2b')],function(_0x587e16){return{'name':_0x587e16['fieldName'],'type':_0x587e16['type'][_0xe364('0x2c')]};});_0x2df6ac[_0xe364('0x2d')]=_[_0xe364('0x2a')](_0x496bb6,_0xe364('0x28'));_0x2df6ac[_0xe364('0x2e')]=_[_0xe364('0x2f')](_0x2c8b34['query']);_0x2df6ac[_0xe364('0x30')]=_[_0xe364('0x31')](_0x2df6ac['model'],_0x2df6ac[_0xe364('0x2e')]);_0x53902f[_0xe364('0x32')]=_['intersection'](_0x2df6ac[_0xe364('0x2d')],qs['fields'](_0x2c8b34['query'][_0xe364('0x33')]));_0x53902f[_0xe364('0x32')]=_0x53902f[_0xe364('0x32')]['length']?_0x53902f['attributes']:_0x2df6ac[_0xe364('0x2d')];if(!_0x2c8b34[_0xe364('0x2e')][_0xe364('0x34')](_0xe364('0x35'))){_0x53902f[_0xe364('0x1f')]=qs['limit'](_0x2c8b34[_0xe364('0x2e')]['limit']);_0x53902f['offset']=qs['offset'](_0x2c8b34[_0xe364('0x2e')][_0xe364('0x1c')]);}_0x53902f['order']=qs['sort'](_0x2c8b34[_0xe364('0x2e')]['sort']);_0x53902f[_0xe364('0x36')]=qs[_0xe364('0x30')](_[_0xe364('0x37')](_0x2c8b34[_0xe364('0x2e')],_0x2df6ac[_0xe364('0x30')]),_0x496bb6);if(_0x2c8b34[_0xe364('0x2e')][_0xe364('0x38')]){_0x53902f[_0xe364('0x36')]=_[_0xe364('0x39')](_0x53902f[_0xe364('0x36')],{'$or':_[_0xe364('0x2a')](_0x496bb6,function(_0x5f041a){if(_0x5f041a[_0xe364('0x3a')]!==_0xe364('0x3b')){var _0x10c6cd={};_0x10c6cd[_0x5f041a['name']]={'$like':'%'+_0x2c8b34['query'][_0xe364('0x38')]+'%'};return _0x10c6cd;}})});}_0x53902f=_[_0xe364('0x39')]({},_0x53902f,_0x2c8b34['options']);var _0x1a28da={'where':_0x53902f['where']};return db[_0xe364('0x3c')][_0xe364('0x1e')](_0x1a28da)[_0xe364('0x26')](function(_0x51fd29){_0x547d62[_0xe364('0x1e')]=_0x51fd29;if(_0x2c8b34[_0xe364('0x2e')][_0xe364('0x3d')]){_0x53902f[_0xe364('0x3e')]=[{'all':!![]}];}return db[_0xe364('0x3c')]['findAll'](_0x53902f);})[_0xe364('0x26')](function(_0x178ac2){_0x547d62[_0xe364('0x3f')]=_0x178ac2;return _0x547d62;})[_0xe364('0x26')](respondWithFilteredResult(_0x4d689f,_0x53902f))[_0xe364('0x40')](handleError(_0x4d689f,null));};exports['show']=function(_0x25ff1e,_0x1712f5){var _0x4c57ff={'raw':!![],'where':{'id':_0x25ff1e['params']['id']}},_0x2ca1bc={};_0x2ca1bc[_0xe364('0x2d')]=_[_0xe364('0x2f')](db[_0xe364('0x3c')][_0xe364('0x2b')]);_0x2ca1bc[_0xe364('0x2e')]=_[_0xe364('0x2f')](_0x25ff1e[_0xe364('0x2e')]);_0x2ca1bc['filters']=_[_0xe364('0x31')](_0x2ca1bc[_0xe364('0x2d')],_0x2ca1bc[_0xe364('0x2e')]);_0x4c57ff[_0xe364('0x32')]=_[_0xe364('0x31')](_0x2ca1bc['model'],qs['fields'](_0x25ff1e[_0xe364('0x2e')]['fields']));_0x4c57ff[_0xe364('0x32')]=_0x4c57ff[_0xe364('0x32')][_0xe364('0x41')]?_0x4c57ff['attributes']:_0x2ca1bc['model'];if(_0x25ff1e[_0xe364('0x2e')][_0xe364('0x3d')]){_0x4c57ff[_0xe364('0x3e')]=[{'all':!![]}];}_0x4c57ff=_[_0xe364('0x39')]({},_0x4c57ff,_0x25ff1e[_0xe364('0x42')]);return db['Dynamics365Field'][_0xe364('0x43')](_0x4c57ff)['then'](handleEntityNotFound(_0x1712f5,null))[_0xe364('0x26')](respondWithResult(_0x1712f5,null))[_0xe364('0x40')](handleError(_0x1712f5,null));};exports[_0xe364('0x44')]=function(_0x3e9ef8,_0x2378e5){return db[_0xe364('0x3c')][_0xe364('0x44')](_0x3e9ef8['body'],{})['then'](respondWithResult(_0x2378e5,0xc9))[_0xe364('0x40')](handleError(_0x2378e5,null));};exports['update']=function(_0x2eecfc,_0x45af98){if(_0x2eecfc[_0xe364('0x45')]['id']){delete _0x2eecfc['body']['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x2eecfc[_0xe364('0x46')]['id']}})[_0xe364('0x26')](handleEntityNotFound(_0x45af98,null))[_0xe364('0x26')](saveUpdates(_0x2eecfc['body'],null))[_0xe364('0x26')](respondWithResult(_0x45af98,null))[_0xe364('0x40')](handleError(_0x45af98,null));};exports[_0xe364('0x27')]=function(_0x107847,_0x5528a7){return db['Dynamics365Field'][_0xe364('0x43')]({'where':{'id':_0x107847[_0xe364('0x46')]['id']}})[_0xe364('0x26')](handleEntityNotFound(_0x5528a7,null))[_0xe364('0x26')](removeEntity(_0x5528a7,null))['catch'](handleError(_0x5528a7,null));}; \ No newline at end of file +var _0xdf90=['destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','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','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','then','catch','show','params','length','find','create','body'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0xdf90,0x131));var _0x0df9=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0xdf90[_0x154940];return _0x401409;};'use strict';var emlformat=require(_0x0df9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0df9('0x1'));var jsonpatch=require(_0x0df9('0x2'));var rp=require(_0x0df9('0x3'));var moment=require(_0x0df9('0x4'));var BPromise=require(_0x0df9('0x5'));var Mustache=require('mustache');var util=require(_0x0df9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0df9('0x7'));var ejs=require(_0x0df9('0x8'));var fs=require('fs');var fs_extra=require(_0x0df9('0x9'));var _=require(_0x0df9('0xa'));var squel=require(_0x0df9('0xb'));var crypto=require('crypto');var jsforce=require(_0x0df9('0xc'));var deskjs=require(_0x0df9('0xd'));var toCsv=require(_0x0df9('0x7'));var querystring=require('querystring');var Papa=require(_0x0df9('0xe'));var Redis=require(_0x0df9('0xf'));var authService=require(_0x0df9('0x10'));var qs=require(_0x0df9('0x11'));var as=require(_0x0df9('0x12'));var hardwareService=require(_0x0df9('0x13'));var logger=require(_0x0df9('0x14'))('api');var utils=require(_0x0df9('0x15'));var config=require(_0x0df9('0x16'));var licenseUtil=require(_0x0df9('0x17'));var db=require(_0x0df9('0x18'))['db'];function respondWithStatusCode(_0x5bb6f0,_0x4884de){_0x4884de=_0x4884de||0xcc;return function(_0x371011){if(_0x371011){return _0x5bb6f0[_0x0df9('0x19')](_0x4884de);}return _0x5bb6f0[_0x0df9('0x1a')](_0x4884de)[_0x0df9('0x1b')]();};}function respondWithResult(_0x26d5e3,_0x2e3454){_0x2e3454=_0x2e3454||0xc8;return function(_0x26f438){if(_0x26f438){return _0x26d5e3[_0x0df9('0x1a')](_0x2e3454)[_0x0df9('0x1c')](_0x26f438);}};}function respondWithFilteredResult(_0x59a009,_0x5248cc){return function(_0x2b5055){if(_0x2b5055){var _0x5d8094=typeof _0x5248cc[_0x0df9('0x1d')]===_0x0df9('0x1e')&&typeof _0x5248cc[_0x0df9('0x1f')]===_0x0df9('0x1e');var _0x3b2bee=_0x2b5055['count'];var _0x29371d=_0x5d8094?0x0:_0x5248cc[_0x0df9('0x1d')];var _0x1c415e=_0x5d8094?_0x2b5055['count']:_0x5248cc['offset']+_0x5248cc[_0x0df9('0x1f')];var _0xb82c24;if(_0x1c415e>=_0x3b2bee){_0x1c415e=_0x3b2bee;_0xb82c24=0xc8;}else{_0xb82c24=0xce;}_0x59a009[_0x0df9('0x1a')](_0xb82c24);return _0x59a009[_0x0df9('0x20')](_0x0df9('0x21'),_0x29371d+'-'+_0x1c415e+'/'+_0x3b2bee)[_0x0df9('0x1c')](_0x2b5055);}return null;};}function patchUpdates(_0x47ce23){return function(_0x1d93e2){try{jsonpatch[_0x0df9('0x22')](_0x1d93e2,_0x47ce23,!![]);}catch(_0x372719){return BPromise[_0x0df9('0x23')](_0x372719);}return _0x1d93e2[_0x0df9('0x24')]();};}function saveUpdates(_0x15e775,_0x488e66){return function(_0x49113a){if(_0x49113a){return _0x49113a[_0x0df9('0x25')](_0x15e775)['then'](function(_0x41aa8a){return _0x41aa8a;});}return null;};}function removeEntity(_0x527e33,_0x342792){return function(_0x8d177f){if(_0x8d177f){return _0x8d177f['destroy']()['then'](function(){_0x527e33[_0x0df9('0x1a')](0xcc)[_0x0df9('0x1b')]();});}};}function handleEntityNotFound(_0x5303b5,_0x27edc9){return function(_0x257044){if(!_0x257044){_0x5303b5[_0x0df9('0x19')](0x194);}return _0x257044;};}function handleError(_0x7b9a03,_0x590360){_0x590360=_0x590360||0x1f4;return function(_0x3601b4){logger[_0x0df9('0x26')](_0x3601b4[_0x0df9('0x27')]);if(_0x3601b4[_0x0df9('0x28')]){delete _0x3601b4[_0x0df9('0x28')];}_0x7b9a03[_0x0df9('0x1a')](_0x590360)[_0x0df9('0x29')](_0x3601b4);};}exports[_0x0df9('0x2a')]=function(_0x403a2e,_0x486e36){var _0x1c227f={},_0x10acbd={},_0x1bc323={'count':0x0,'rows':[]};var _0x238799=_[_0x0df9('0x2b')](db[_0x0df9('0x2c')][_0x0df9('0x2d')],function(_0x2858ae){return{'name':_0x2858ae['fieldName'],'type':_0x2858ae[_0x0df9('0x2e')][_0x0df9('0x2f')]};});_0x10acbd['model']=_[_0x0df9('0x2b')](_0x238799,_0x0df9('0x28'));_0x10acbd[_0x0df9('0x30')]=_[_0x0df9('0x31')](_0x403a2e['query']);_0x10acbd[_0x0df9('0x32')]=_[_0x0df9('0x33')](_0x10acbd[_0x0df9('0x34')],_0x10acbd[_0x0df9('0x30')]);_0x1c227f[_0x0df9('0x35')]=_[_0x0df9('0x33')](_0x10acbd[_0x0df9('0x34')],qs[_0x0df9('0x36')](_0x403a2e[_0x0df9('0x30')]['fields']));_0x1c227f[_0x0df9('0x35')]=_0x1c227f[_0x0df9('0x35')]['length']?_0x1c227f[_0x0df9('0x35')]:_0x10acbd['model'];if(!_0x403a2e[_0x0df9('0x30')][_0x0df9('0x37')]('nolimit')){_0x1c227f[_0x0df9('0x1f')]=qs[_0x0df9('0x1f')](_0x403a2e[_0x0df9('0x30')][_0x0df9('0x1f')]);_0x1c227f[_0x0df9('0x1d')]=qs[_0x0df9('0x1d')](_0x403a2e[_0x0df9('0x30')][_0x0df9('0x1d')]);}_0x1c227f['order']=qs['sort'](_0x403a2e[_0x0df9('0x30')][_0x0df9('0x38')]);_0x1c227f[_0x0df9('0x39')]=qs[_0x0df9('0x32')](_[_0x0df9('0x3a')](_0x403a2e['query'],_0x10acbd[_0x0df9('0x32')]),_0x238799);if(_0x403a2e['query']['filter']){_0x1c227f[_0x0df9('0x39')]=_[_0x0df9('0x3b')](_0x1c227f[_0x0df9('0x39')],{'$or':_[_0x0df9('0x2b')](_0x238799,function(_0x2e7930){if(_0x2e7930[_0x0df9('0x2e')]!==_0x0df9('0x3c')){var _0x3af0c1={};_0x3af0c1[_0x2e7930[_0x0df9('0x28')]]={'$like':'%'+_0x403a2e[_0x0df9('0x30')]['filter']+'%'};return _0x3af0c1;}})});}_0x1c227f=_[_0x0df9('0x3b')]({},_0x1c227f,_0x403a2e[_0x0df9('0x3d')]);var _0x13e8df={'where':_0x1c227f[_0x0df9('0x39')]};return db[_0x0df9('0x2c')][_0x0df9('0x3e')](_0x13e8df)['then'](function(_0x4e73f4){_0x1bc323[_0x0df9('0x3e')]=_0x4e73f4;if(_0x403a2e['query'][_0x0df9('0x3f')]){_0x1c227f[_0x0df9('0x40')]=[{'all':!![]}];}return db[_0x0df9('0x2c')][_0x0df9('0x41')](_0x1c227f);})['then'](function(_0x5ec9a5){_0x1bc323[_0x0df9('0x42')]=_0x5ec9a5;return _0x1bc323;})[_0x0df9('0x43')](respondWithFilteredResult(_0x486e36,_0x1c227f))[_0x0df9('0x44')](handleError(_0x486e36,null));};exports[_0x0df9('0x45')]=function(_0xa0c9e1,_0x16e157){var _0x588a20={'raw':!![],'where':{'id':_0xa0c9e1[_0x0df9('0x46')]['id']}},_0x46972f={};_0x46972f[_0x0df9('0x34')]=_[_0x0df9('0x31')](db[_0x0df9('0x2c')]['rawAttributes']);_0x46972f[_0x0df9('0x30')]=_[_0x0df9('0x31')](_0xa0c9e1[_0x0df9('0x30')]);_0x46972f[_0x0df9('0x32')]=_[_0x0df9('0x33')](_0x46972f[_0x0df9('0x34')],_0x46972f[_0x0df9('0x30')]);_0x588a20[_0x0df9('0x35')]=_[_0x0df9('0x33')](_0x46972f[_0x0df9('0x34')],qs[_0x0df9('0x36')](_0xa0c9e1[_0x0df9('0x30')]['fields']));_0x588a20[_0x0df9('0x35')]=_0x588a20[_0x0df9('0x35')][_0x0df9('0x47')]?_0x588a20[_0x0df9('0x35')]:_0x46972f[_0x0df9('0x34')];if(_0xa0c9e1[_0x0df9('0x30')]['includeAll']){_0x588a20[_0x0df9('0x40')]=[{'all':!![]}];}_0x588a20=_[_0x0df9('0x3b')]({},_0x588a20,_0xa0c9e1['options']);return db[_0x0df9('0x2c')][_0x0df9('0x48')](_0x588a20)[_0x0df9('0x43')](handleEntityNotFound(_0x16e157,null))[_0x0df9('0x43')](respondWithResult(_0x16e157,null))[_0x0df9('0x44')](handleError(_0x16e157,null));};exports[_0x0df9('0x49')]=function(_0xaeb1b2,_0x23b054){return db['Dynamics365Field'][_0x0df9('0x49')](_0xaeb1b2[_0x0df9('0x4a')],{})[_0x0df9('0x43')](respondWithResult(_0x23b054,0xc9))['catch'](handleError(_0x23b054,null));};exports['update']=function(_0x56f70b,_0x5c8d58){if(_0x56f70b[_0x0df9('0x4a')]['id']){delete _0x56f70b['body']['id'];}return db[_0x0df9('0x2c')][_0x0df9('0x48')]({'where':{'id':_0x56f70b[_0x0df9('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c8d58,null))[_0x0df9('0x43')](saveUpdates(_0x56f70b[_0x0df9('0x4a')],null))[_0x0df9('0x43')](respondWithResult(_0x5c8d58,null))['catch'](handleError(_0x5c8d58,null));};exports[_0x0df9('0x4b')]=function(_0xd479f9,_0x235e32){return db[_0x0df9('0x2c')][_0x0df9('0x48')]({'where':{'id':_0xd479f9['params']['id']}})[_0x0df9('0x43')](handleEntityNotFound(_0x235e32,null))[_0x0df9('0x43')](removeEntity(_0x235e32,null))[_0x0df9('0x44')](handleError(_0x235e32,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 51a0374..6147fb7 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 _0x6459=['api','moment','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','FieldId','lodash','util','../../config/logger'];(function(_0xa7aed2,_0x2f9971){var _0x43304a=function(_0xde20e9){while(--_0xde20e9){_0xa7aed2['push'](_0xa7aed2['shift']());}};_0x43304a(++_0x2f9971);}(_0x6459,0x8d));var _0x9645=function(_0xcac6ad,_0x4131ad){_0xcac6ad=_0xcac6ad-0x0;var _0x5a4406=_0x6459[_0xcac6ad];return _0x5a4406;};'use strict';var _=require(_0x9645('0x0'));var util=require(_0x9645('0x1'));var logger=require(_0x9645('0x2'))(_0x9645('0x3'));var moment=require(_0x9645('0x4'));var BPromise=require('bluebird');var rp=require(_0x9645('0x5'));var fs=require('fs');var path=require(_0x9645('0x6'));var rimraf=require('rimraf');var config=require(_0x9645('0x7'));var attributes=require(_0x9645('0x8'));module[_0x9645('0x9')]=function(_0x5a71d1,_0x5a9188){return _0x5a71d1['define'](_0x9645('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x9645('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1dee=['dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Field'];(function(_0x291aaf,_0x4c6d8d){var _0x5571e6=function(_0x1b4fec){while(--_0x1b4fec){_0x291aaf['push'](_0x291aaf['shift']());}};_0x5571e6(++_0x4c6d8d);}(_0x1dee,0x14d));var _0xe1de=function(_0x201e29,_0x362efd){_0x201e29=_0x201e29-0x0;var _0x34d5f3=_0x1dee[_0x201e29];return _0x34d5f3;};'use strict';var _=require(_0xe1de('0x0'));var util=require(_0xe1de('0x1'));var logger=require(_0xe1de('0x2'))('api');var moment=require(_0xe1de('0x3'));var BPromise=require(_0xe1de('0x4'));var rp=require(_0xe1de('0x5'));var fs=require('fs');var path=require(_0xe1de('0x6'));var rimraf=require(_0xe1de('0x7'));var config=require(_0xe1de('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0xe1de('0x9')]=function(_0x3e8bf7,_0x46d853){return _0x3e8bf7[_0xe1de('0xa')](_0xe1de('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xe1de('0xc'),'fields':[_0xe1de('0xd'),_0xe1de('0xe')],'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 f1e791d..63fd3de 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 _0x06ad=['jayson/promise','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x357cc6,_0x39255a){var _0x39befe=function(_0x5a0d4a){while(--_0x5a0d4a){_0x357cc6['push'](_0x357cc6['shift']());}};_0x39befe(++_0x39255a);}(_0x06ad,0x13a));var _0xd06a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd06a('0x0'));var util=require(_0xd06a('0x1'));var moment=require(_0xd06a('0x2'));var BPromise=require(_0xd06a('0x3'));var rs=require(_0xd06a('0x4'));var fs=require('fs');var Redis=require(_0xd06a('0x5'));var db=require(_0xd06a('0x6'))['db'];var utils=require(_0xd06a('0x7'));var logger=require(_0xd06a('0x8'))(_0xd06a('0x9'));var config=require(_0xd06a('0xa'));var jayson=require(_0xd06a('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c3048,_0x3b305e,_0x286f8b){return new BPromise(function(_0x5a86cc,_0x371826){return client[_0xd06a('0xc')](_0x4c3048,_0x286f8b)[_0xd06a('0xd')](function(_0x360ffa){logger[_0xd06a('0xe')](_0xd06a('0xf'),_0x3b305e,_0xd06a('0x10'));logger[_0xd06a('0x11')](_0xd06a('0x12'),_0x3b305e,_0xd06a('0x10'),JSON[_0xd06a('0x13')](_0x360ffa));if(_0x360ffa['error']){if(_0x360ffa[_0xd06a('0x14')][_0xd06a('0x15')]===0x1f4){logger[_0xd06a('0x14')](_0xd06a('0xf'),_0x3b305e,_0x360ffa[_0xd06a('0x14')][_0xd06a('0x16')]);return _0x371826(_0x360ffa[_0xd06a('0x14')]['message']);}logger[_0xd06a('0x14')](_0xd06a('0xf'),_0x3b305e,_0x360ffa[_0xd06a('0x14')][_0xd06a('0x16')]);return _0x5a86cc(_0x360ffa['error'][_0xd06a('0x16')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x3b305e,_0xd06a('0x10'));_0x5a86cc(_0x360ffa[_0xd06a('0x17')][_0xd06a('0x16')]);}})[_0xd06a('0x18')](function(_0x5c6a42){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3b305e,_0x5c6a42);_0x371826(_0x5c6a42);});});} \ No newline at end of file +var _0xb84b=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x2ccbed,_0x30ad47){var _0x6a5b5=function(_0x2e0552){while(--_0x2e0552){_0x2ccbed['push'](_0x2ccbed['shift']());}};_0x6a5b5(++_0x30ad47);}(_0xb84b,0xf4));var _0xbb84=function(_0x3d6036,_0x262482){_0x3d6036=_0x3d6036-0x0;var _0x24bbaa=_0xb84b[_0x3d6036];return _0x24bbaa;};'use strict';var _=require(_0xbb84('0x0'));var util=require(_0xbb84('0x1'));var moment=require('moment');var BPromise=require(_0xbb84('0x2'));var rs=require(_0xbb84('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbb84('0x4'));var logger=require(_0xbb84('0x5'))(_0xbb84('0x6'));var config=require('../../config/environment');var jayson=require(_0xbb84('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b514a,_0x39b04a,_0x320132){return new BPromise(function(_0x226dc1,_0x4fb7e2){return client['request'](_0x4b514a,_0x320132)[_0xbb84('0x8')](function(_0x31904c){logger[_0xbb84('0x9')](_0xbb84('0xa'),_0x39b04a,_0xbb84('0xb'));logger[_0xbb84('0xc')](_0xbb84('0xd'),_0x39b04a,_0xbb84('0xb'),JSON['stringify'](_0x31904c));if(_0x31904c[_0xbb84('0xe')]){if(_0x31904c[_0xbb84('0xe')][_0xbb84('0xf')]===0x1f4){logger['error'](_0xbb84('0xa'),_0x39b04a,_0x31904c[_0xbb84('0xe')]['message']);return _0x4fb7e2(_0x31904c['error']['message']);}logger[_0xbb84('0xe')](_0xbb84('0xa'),_0x39b04a,_0x31904c['error'][_0xbb84('0x10')]);return _0x226dc1(_0x31904c[_0xbb84('0xe')][_0xbb84('0x10')]);}else{logger[_0xbb84('0x9')](_0xbb84('0xa'),_0x39b04a,_0xbb84('0xb'));_0x226dc1(_0x31904c[_0xbb84('0x11')]['message']);}})[_0xbb84('0x12')](function(_0x2ddb5c){logger[_0xbb84('0xe')](_0xbb84('0xa'),_0x39b04a,_0x2ddb5c);_0x4fb7e2(_0x2ddb5c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 3d1e354..d08dee4 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 _0x9516=['/:id/fields','getFields','post','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x9516,0x119));var _0x6951=function(_0x214d8c,_0x242dc3){_0x214d8c=_0x214d8c-0x0;var _0x5a5060=_0x9516[_0x214d8c];return _0x5a5060;};'use strict';var multer=require(_0x6951('0x0'));var util=require(_0x6951('0x1'));var path=require('path');var timeout=require(_0x6951('0x2'));var express=require('express');var router=express[_0x6951('0x3')]();var fs_extra=require(_0x6951('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6951('0x5'));var config=require(_0x6951('0x6'));var controller=require(_0x6951('0x7'));router[_0x6951('0x8')]('/',auth[_0x6951('0x9')](),controller['index']);router[_0x6951('0x8')](_0x6951('0xa'),auth[_0x6951('0x9')](),controller[_0x6951('0xb')]);router[_0x6951('0x8')](_0x6951('0xc'),auth[_0x6951('0x9')](),controller['getConfigurations']);router[_0x6951('0x8')](_0x6951('0xd'),auth[_0x6951('0x9')](),controller[_0x6951('0xe')]);router[_0x6951('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6951('0xf')](_0x6951('0xc'),auth[_0x6951('0x9')](),controller[_0x6951('0x10')]);router['put'](_0x6951('0xa'),auth[_0x6951('0x9')](),controller[_0x6951('0x11')]);router[_0x6951('0x12')](_0x6951('0xa'),auth[_0x6951('0x9')](),controller[_0x6951('0x13')]);module[_0x6951('0x14')]=router; \ No newline at end of file +var _0xc6f7=['express','Router','../../components/auth/service','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','exports','multer','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc6f7,0x115));var _0x7c6f=function(_0x42b18a,_0x2ff3bf){_0x42b18a=_0x42b18a-0x0;var _0x4f80be=_0xc6f7[_0x42b18a];return _0x4f80be;};'use strict';var multer=require(_0x7c6f('0x0'));var util=require('util');var path=require(_0x7c6f('0x1'));var timeout=require(_0x7c6f('0x2'));var express=require(_0x7c6f('0x3'));var router=express[_0x7c6f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7c6f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x7c6f('0x6')]('/',auth[_0x7c6f('0x7')](),controller[_0x7c6f('0x8')]);router['get']('/:id',auth[_0x7c6f('0x7')](),controller[_0x7c6f('0x9')]);router['get'](_0x7c6f('0xa'),auth[_0x7c6f('0x7')](),controller[_0x7c6f('0xb')]);router[_0x7c6f('0x6')](_0x7c6f('0xc'),auth[_0x7c6f('0x7')](),controller[_0x7c6f('0xd')]);router[_0x7c6f('0xe')]('/',auth[_0x7c6f('0x7')](),controller[_0x7c6f('0xf')]);router[_0x7c6f('0xe')]('/:id/configurations',auth[_0x7c6f('0x7')](),controller[_0x7c6f('0x10')]);router[_0x7c6f('0x11')](_0x7c6f('0x12'),auth[_0x7c6f('0x7')](),controller['update']);router['delete'](_0x7c6f('0x12'),auth[_0x7c6f('0x7')](),controller['destroy']);module[_0x7c6f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index ec83865..9b86faa 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 _0x5204=['exports','STRING','username','sequelize'];(function(_0x4df199,_0x510858){var _0x2b7bd2=function(_0x110f0e){while(--_0x110f0e){_0x4df199['push'](_0x4df199['shift']());}};_0x2b7bd2(++_0x510858);}(_0x5204,0xdf));var _0x4520=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x5204[_0x204eb7];return _0x37e444;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1967=['STRING','username','remoteUri','exports'];(function(_0x34366b,_0x248c3c){var _0x33921b=function(_0x55946a){while(--_0x55946a){_0x34366b['push'](_0x34366b['shift']());}};_0x33921b(++_0x248c3c);}(_0x1967,0x173));var _0x7196=function(_0x1f3453,_0x1edb31){_0x1f3453=_0x1f3453-0x0;var _0xd5403b=_0x1967[_0x1f3453];return _0xd5403b;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'name':{'type':Sequelize[_0x7196('0x1')]},'description':{'type':Sequelize[_0x7196('0x1')]},'username':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x2')},'apiKey':{'type':Sequelize[_0x7196('0x1')]},'remoteUri':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x3')},'serverUrl':{'type':Sequelize[_0x7196('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index e57c8ac..2cdb449 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 _0x3f59=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','map','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','params','keys','length','create','body','find','destroy','getConfigurations','findOne','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','slice','substring','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','apiKey','toString','subject','agent','description','source','group','company','default','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials'];(function(_0x515bcd,_0x4ea1c1){var _0x5d21fa=function(_0x7d323a){while(--_0x7d323a){_0x515bcd['push'](_0x515bcd['shift']());}};_0x5d21fa(++_0x4ea1c1);}(_0x3f59,0x1b0));var _0x93f5=function(_0x6b63fe,_0x1d62ea){_0x6b63fe=_0x6b63fe-0x0;var _0x2532d3=_0x3f59[_0x6b63fe];return _0x2532d3;};'use strict';var emlformat=require(_0x93f5('0x0'));var rimraf=require(_0x93f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93f5('0x2'));var rp=require(_0x93f5('0x3'));var moment=require(_0x93f5('0x4'));var BPromise=require(_0x93f5('0x5'));var Mustache=require(_0x93f5('0x6'));var util=require(_0x93f5('0x7'));var path=require(_0x93f5('0x8'));var sox=require(_0x93f5('0x9'));var csv=require(_0x93f5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93f5('0xb'));var squel=require(_0x93f5('0xc'));var crypto=require(_0x93f5('0xd'));var jsforce=require(_0x93f5('0xe'));var deskjs=require(_0x93f5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x93f5('0x10'));var qs=require(_0x93f5('0x11'));var as=require(_0x93f5('0x12'));var hardwareService=require(_0x93f5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x93f5('0x14'));var config=require(_0x93f5('0x15'));var licenseUtil=require(_0x93f5('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x93f5('0x17'));function respondWithStatusCode(_0x4ea7b4,_0x3e7e84){_0x3e7e84=_0x3e7e84||0xcc;return function(_0x107b90){if(_0x107b90){return _0x4ea7b4[_0x93f5('0x18')](_0x3e7e84);}return _0x4ea7b4[_0x93f5('0x19')](_0x3e7e84)[_0x93f5('0x1a')]();};}function respondWithResult(_0x45a275,_0x5d6001){_0x5d6001=_0x5d6001||0xc8;return function(_0x108b11){if(_0x108b11){return _0x45a275[_0x93f5('0x19')](_0x5d6001)[_0x93f5('0x1b')](_0x108b11);}};}function respondWithFilteredResult(_0x2ab5ce,_0x316fb2){return function(_0x22bcd7){if(_0x22bcd7){var _0x36aa85=typeof _0x316fb2[_0x93f5('0x1c')]===_0x93f5('0x1d')&&typeof _0x316fb2[_0x93f5('0x1e')]===_0x93f5('0x1d');var _0x869415=_0x22bcd7['count'];var _0x8d8ffe=_0x36aa85?0x0:_0x316fb2[_0x93f5('0x1c')];var _0x45eac3=_0x36aa85?_0x22bcd7[_0x93f5('0x1f')]:_0x316fb2[_0x93f5('0x1c')]+_0x316fb2['limit'];var _0x34edb9;if(_0x45eac3>=_0x869415){_0x45eac3=_0x869415;_0x34edb9=0xc8;}else{_0x34edb9=0xce;}_0x2ab5ce[_0x93f5('0x19')](_0x34edb9);return _0x2ab5ce[_0x93f5('0x20')](_0x93f5('0x21'),_0x8d8ffe+'-'+_0x45eac3+'/'+_0x869415)[_0x93f5('0x1b')](_0x22bcd7);}return null;};}function patchUpdates(_0xb44720){return function(_0x17e4ef){try{jsonpatch[_0x93f5('0x22')](_0x17e4ef,_0xb44720,!![]);}catch(_0x466ad7){return BPromise[_0x93f5('0x23')](_0x466ad7);}return _0x17e4ef[_0x93f5('0x24')]();};}function saveUpdates(_0xb59065,_0x330869){return function(_0x5b1a1f){if(_0x5b1a1f){return _0x5b1a1f[_0x93f5('0x25')](_0xb59065)[_0x93f5('0x26')](function(_0x34f8ce){return _0x34f8ce;});}return null;};}function removeEntity(_0x3ffe51,_0x365afd){return function(_0x1b4576){if(_0x1b4576){return _0x1b4576['destroy']()[_0x93f5('0x26')](function(){_0x3ffe51[_0x93f5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x107d91,_0x43fad9){return function(_0x57ae09){if(!_0x57ae09){_0x107d91['sendStatus'](0x194);}return _0x57ae09;};}function handleError(_0x403b45,_0x11e86c){_0x11e86c=_0x11e86c||0x1f4;return function(_0x469968){logger[_0x93f5('0x27')](_0x469968['stack']);if(_0x469968[_0x93f5('0x28')]){delete _0x469968['name'];}_0x403b45[_0x93f5('0x19')](_0x11e86c)[_0x93f5('0x29')](_0x469968);};}exports['index']=function(_0x36d579,_0x95e47e){var _0x136dc4={},_0x5e5cb5={},_0x3090a9={'count':0x0,'rows':[]};var _0x4883c6=_[_0x93f5('0x2a')](db['FreshdeskAccount'][_0x93f5('0x2b')],function(_0x2484bc){return{'name':_0x2484bc['fieldName'],'type':_0x2484bc[_0x93f5('0x2c')][_0x93f5('0x2d')]};});_0x5e5cb5[_0x93f5('0x2e')]=_[_0x93f5('0x2a')](_0x4883c6,'name');_0x5e5cb5[_0x93f5('0x2f')]=_['keys'](_0x36d579[_0x93f5('0x2f')]);_0x5e5cb5['filters']=_[_0x93f5('0x30')](_0x5e5cb5[_0x93f5('0x2e')],_0x5e5cb5[_0x93f5('0x2f')]);_0x136dc4[_0x93f5('0x31')]=_['intersection'](_0x5e5cb5[_0x93f5('0x2e')],qs[_0x93f5('0x32')](_0x36d579[_0x93f5('0x2f')][_0x93f5('0x32')]));_0x136dc4['attributes']=_0x136dc4[_0x93f5('0x31')]['length']?_0x136dc4[_0x93f5('0x31')]:_0x5e5cb5[_0x93f5('0x2e')];if(!_0x36d579[_0x93f5('0x2f')][_0x93f5('0x33')]('nolimit')){_0x136dc4[_0x93f5('0x1e')]=qs['limit'](_0x36d579[_0x93f5('0x2f')]['limit']);_0x136dc4['offset']=qs[_0x93f5('0x1c')](_0x36d579[_0x93f5('0x2f')][_0x93f5('0x1c')]);}_0x136dc4['order']=qs[_0x93f5('0x34')](_0x36d579[_0x93f5('0x2f')]['sort']);_0x136dc4[_0x93f5('0x35')]=qs['filters'](_[_0x93f5('0x36')](_0x36d579['query'],_0x5e5cb5[_0x93f5('0x37')]),_0x4883c6);if(_0x36d579[_0x93f5('0x2f')][_0x93f5('0x38')]){_0x136dc4[_0x93f5('0x35')]=_[_0x93f5('0x39')](_0x136dc4['where'],{'$or':_[_0x93f5('0x2a')](_0x4883c6,function(_0x364b5d){if(_0x364b5d[_0x93f5('0x2c')]!==_0x93f5('0x3a')){var _0x5c8687={};_0x5c8687[_0x364b5d[_0x93f5('0x28')]]={'$like':'%'+_0x36d579['query'][_0x93f5('0x38')]+'%'};return _0x5c8687;}})});}_0x136dc4=_[_0x93f5('0x39')]({},_0x136dc4,_0x36d579[_0x93f5('0x3b')]);var _0x1a6e28={'where':_0x136dc4[_0x93f5('0x35')]};return db[_0x93f5('0x3c')]['count'](_0x1a6e28)[_0x93f5('0x26')](function(_0x4f45d8){_0x3090a9[_0x93f5('0x1f')]=_0x4f45d8;if(_0x36d579[_0x93f5('0x2f')]['includeAll']){_0x136dc4[_0x93f5('0x3d')]=[{'all':!![]}];}return db[_0x93f5('0x3c')][_0x93f5('0x3e')](_0x136dc4);})[_0x93f5('0x26')](function(_0x53958b){_0x3090a9[_0x93f5('0x3f')]=_0x53958b;return _0x3090a9;})['then'](respondWithFilteredResult(_0x95e47e,_0x136dc4))[_0x93f5('0x40')](handleError(_0x95e47e,null));};exports[_0x93f5('0x41')]=function(_0x283261,_0x24d2dc){var _0xd4d915={'raw':![],'where':{'id':_0x283261[_0x93f5('0x42')]['id']}},_0x1d4c11={};_0x1d4c11['model']=_[_0x93f5('0x43')](db[_0x93f5('0x3c')][_0x93f5('0x2b')]);_0x1d4c11[_0x93f5('0x2f')]=_[_0x93f5('0x43')](_0x283261[_0x93f5('0x2f')]);_0x1d4c11[_0x93f5('0x37')]=_[_0x93f5('0x30')](_0x1d4c11['model'],_0x1d4c11['query']);_0xd4d915[_0x93f5('0x31')]=_['intersection'](_0x1d4c11[_0x93f5('0x2e')],qs['fields'](_0x283261[_0x93f5('0x2f')][_0x93f5('0x32')]));_0xd4d915['attributes']=_0xd4d915['attributes'][_0x93f5('0x44')]?_0xd4d915['attributes']:_0x1d4c11[_0x93f5('0x2e')];if(_0x283261[_0x93f5('0x2f')]['includeAll']){_0xd4d915[_0x93f5('0x3d')]=[{'all':!![]}];}_0xd4d915=_[_0x93f5('0x39')]({},_0xd4d915,_0x283261[_0x93f5('0x3b')]);return db[_0x93f5('0x3c')]['find'](_0xd4d915)[_0x93f5('0x26')](handleEntityNotFound(_0x24d2dc,null))['then'](respondWithResult(_0x24d2dc,null))[_0x93f5('0x40')](handleError(_0x24d2dc,null));};exports[_0x93f5('0x45')]=function(_0x548ee2,_0x5be105){return db[_0x93f5('0x3c')][_0x93f5('0x45')](_0x548ee2['body'],{})[_0x93f5('0x26')](respondWithResult(_0x5be105,0xc9))[_0x93f5('0x40')](handleError(_0x5be105,null));};exports[_0x93f5('0x25')]=function(_0x576500,_0x544091){if(_0x576500[_0x93f5('0x46')]['id']){delete _0x576500[_0x93f5('0x46')]['id'];}return db['FreshdeskAccount'][_0x93f5('0x47')]({'where':{'id':_0x576500['params']['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x544091,null))[_0x93f5('0x26')](saveUpdates(_0x576500[_0x93f5('0x46')],null))[_0x93f5('0x26')](respondWithResult(_0x544091,null))[_0x93f5('0x40')](handleError(_0x544091,null));};exports[_0x93f5('0x48')]=function(_0x970bcf,_0x14e053){return db[_0x93f5('0x3c')][_0x93f5('0x47')]({'where':{'id':_0x970bcf[_0x93f5('0x42')]['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x14e053,null))[_0x93f5('0x26')](removeEntity(_0x14e053,null))[_0x93f5('0x40')](handleError(_0x14e053,null));};exports[_0x93f5('0x49')]=function(_0xd2d30a,_0x178b03,_0x389f31){var _0x2f81c2={};var _0x57cff5={};var _0x26507f;var _0x4c0810;return db['FreshdeskAccount'][_0x93f5('0x4a')]({'where':{'id':_0xd2d30a['params']['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x178b03,null))['then'](function(_0x4366d7){if(_0x4366d7){_0x26507f=_0x4366d7;_0x57cff5[_0x93f5('0x2e')]=_['keys'](db['FreshdeskConfiguration'][_0x93f5('0x2b')]);_0x57cff5['query']=_[_0x93f5('0x43')](_0xd2d30a[_0x93f5('0x2f')]);_0x57cff5[_0x93f5('0x37')]=_['intersection'](_0x57cff5['model'],_0x57cff5[_0x93f5('0x2f')]);_0x2f81c2['attributes']=_['intersection'](_0x57cff5['model'],qs['fields'](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x32')]));_0x2f81c2[_0x93f5('0x31')]=_0x2f81c2[_0x93f5('0x31')]['length']?_0x2f81c2['attributes']:_0x57cff5['model'];_0x2f81c2[_0x93f5('0x4b')]=qs[_0x93f5('0x34')](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x34')]);_0x2f81c2[_0x93f5('0x35')]=qs[_0x93f5('0x37')](_['pick'](_0xd2d30a['query'],_0x57cff5['filters']));if(_0xd2d30a[_0x93f5('0x2f')]['filter']){_0x2f81c2[_0x93f5('0x35')]=_['merge'](_0x2f81c2[_0x93f5('0x35')],{'$or':_[_0x93f5('0x2a')](_0x2f81c2[_0x93f5('0x31')],function(_0x204467){var _0x5eb615={};_0x5eb615[_0x204467]={'$like':'%'+_0xd2d30a['query'][_0x93f5('0x38')]+'%'};return _0x5eb615;})});}_0x2f81c2=_[_0x93f5('0x39')]({},_0x2f81c2,_0xd2d30a[_0x93f5('0x3b')]);return _0x26507f[_0x93f5('0x49')](_0x2f81c2);}})[_0x93f5('0x26')](function(_0x246484){if(_0x246484){_0x4c0810=_0x246484[_0x93f5('0x44')];if(!_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x33')](_0x93f5('0x4c'))){_0x2f81c2[_0x93f5('0x1e')]=qs[_0x93f5('0x1e')](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x1e')]);_0x2f81c2[_0x93f5('0x1c')]=qs[_0x93f5('0x1c')](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x1c')]);}return _0x26507f[_0x93f5('0x49')](_0x2f81c2);}})[_0x93f5('0x26')](function(_0x5ad360){if(_0x5ad360){return _0x5ad360?{'count':_0x4c0810,'rows':_0x5ad360}:null;}})['then'](respondWithResult(_0x178b03,null))['catch'](handleError(_0x178b03,null));};exports[_0x93f5('0x4d')]=function(_0x1296b0,_0x49e4a1,_0x2882d7){if(_0x1296b0[_0x93f5('0x46')]['id']){delete _0x1296b0[_0x93f5('0x46')]['id'];}return db[_0x93f5('0x3c')][_0x93f5('0x4a')]({'where':{'id':_0x1296b0['params']['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x49e4a1,null))[_0x93f5('0x26')](function(_0x251f7a){if(_0x251f7a){_0x1296b0[_0x93f5('0x46')][_0x93f5('0x4e')]=_0x251f7a['id'];_0x1296b0[_0x93f5('0x46')][_0x93f5('0x4f')]=integrations[_0x93f5('0x50')](_0x1296b0['body'][_0x93f5('0x51')],_0x1296b0[_0x93f5('0x46')][_0x93f5('0x2c')]);_0x1296b0['body'][_0x93f5('0x52')]=integrations['getDescriptions'](_0x1296b0['body'][_0x93f5('0x51')],_0x1296b0[_0x93f5('0x46')][_0x93f5('0x2c')]);return db['FreshdeskConfiguration'][_0x93f5('0x45')](_0x1296b0[_0x93f5('0x46')],{'include':[{'model':db[_0x93f5('0x53')],'as':'Subjects'},{'model':db[_0x93f5('0x53')],'as':_0x93f5('0x52')}]});}return null;})[_0x93f5('0x26')](respondWithResult(_0x49e4a1,null))['catch'](handleError(_0x49e4a1,null));};exports[_0x93f5('0x54')]=function(_0x1c5fd4,_0x30d670,_0x365520){var _0x28cff8='';return db[_0x93f5('0x3c')]['findOne']({'where':{'id':_0x1c5fd4[_0x93f5('0x42')]['id']},'attributes':['id',_0x93f5('0x55'),'apiKey']})[_0x93f5('0x26')](handleEntityNotFound(_0x30d670,null))[_0x93f5('0x26')](function(_0x1290e4){if(_0x1290e4){_0x28cff8=_0x1290e4[_0x93f5('0x55')];var _0x18f25d=_0x28cff8[_0x93f5('0x56')](-0x1);if(_0x18f25d==='/'){_0x28cff8=_0x28cff8[_0x93f5('0x57')](0x0,_0x28cff8['lastIndexOf'](_0x18f25d));}return rp({'method':_0x93f5('0x58'),'uri':util['format'](_0x93f5('0x59'),_0x28cff8,_0x93f5('0x5a')),'headers':{'Authorization':util[_0x93f5('0x5b')](_0x93f5('0x5c'),new Buffer(util[_0x93f5('0x5b')]('%s:X',_0x1290e4[_0x93f5('0x5d')]))[_0x93f5('0x5e')]('base64'))},'json':!![]});}})[_0x93f5('0x26')](function(_0x2cf8c5){if(_0x2cf8c5){var _0x48b41b=['requester',_0x93f5('0x5f'),_0x93f5('0x60'),_0x93f5('0x61'),_0x93f5('0x19'),'priority','group',_0x93f5('0x62'),'ticket_type',_0x93f5('0x63'),_0x93f5('0x64')];_['remove'](_0x2cf8c5,function(_0x385392){return _0x48b41b['includes'](_0x385392[_0x93f5('0x28')])||!_0x385392[_0x93f5('0x65')]&&_0x385392[_0x93f5('0x2c')]!=='custom_text'&&_0x385392[_0x93f5('0x2c')]!=='custom_dropdown';});return{'count':_0x2cf8c5[_0x93f5('0x44')],'rows':_[_0x93f5('0x2a')](_0x2cf8c5,function(_0x13c1df){return{'id':_0x13c1df[_0x93f5('0x28')],'name':_0x13c1df[_0x93f5('0x66')],'custom':!_0x13c1df[_0x93f5('0x65')],'options':_0x13c1df['choices']?_[_0x93f5('0x2a')](_0x13c1df[_0x93f5('0x67')],function(_0x149fec){return{'name':_['capitalize'](_0x149fec),'value':_0x149fec};}):[]};})};}})[_0x93f5('0x26')](respondWithResult(_0x30d670,null))[_0x93f5('0x40')](function(_0xfaac55){var _0x57e0c4=_0x1c5fd4[_0x93f5('0x2f')][_0x93f5('0x68')]?0x1f4:_0xfaac55[_0x93f5('0x69')]||0x1f4;logger['error'](_0x93f5('0x6a'),_0x93f5('0x54'),_0x57e0c4,JSON['stringify'](_0xfaac55));delete _0xfaac55[_0x93f5('0x28')];if(_0x57e0c4===0x191){_0x57e0c4=0x190;}_0x30d670[_0x93f5('0x19')](_0x57e0c4)[_0x93f5('0x29')](_0x1c5fd4[_0x93f5('0x2f')]['test']?{'message':_0x93f5('0x6b'),'statusCode':_0xfaac55[_0x93f5('0x69')]}:_0xfaac55);});}; \ No newline at end of file +var _0x7072=['model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskAccount','count','includeAll','findAll','catch','show','fields','length','include','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','substring','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','custom_text','custom_dropdown','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0x2ae489,_0x9f8183){var _0x144cd2=function(_0x3a62b7){while(--_0x3a62b7){_0x2ae489['push'](_0x2ae489['shift']());}};_0x144cd2(++_0x9f8183);}(_0x7072,0x138));var _0x2707=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x7072[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];var integrations=require(_0x2707('0x1a'));function respondWithStatusCode(_0x40d370,_0x5bf16e){_0x5bf16e=_0x5bf16e||0xcc;return function(_0x44c1d7){if(_0x44c1d7){return _0x40d370['sendStatus'](_0x5bf16e);}return _0x40d370[_0x2707('0x1b')](_0x5bf16e)[_0x2707('0x1c')]();};}function respondWithResult(_0xfe975c,_0x3a67f2){_0x3a67f2=_0x3a67f2||0xc8;return function(_0x13d9ac){if(_0x13d9ac){return _0xfe975c['status'](_0x3a67f2)[_0x2707('0x1d')](_0x13d9ac);}};}function respondWithFilteredResult(_0x1a687a,_0x2f6381){return function(_0x5d523f){if(_0x5d523f){var _0x1153d7=typeof _0x2f6381[_0x2707('0x1e')]===_0x2707('0x1f')&&typeof _0x2f6381[_0x2707('0x20')]===_0x2707('0x1f');var _0x27a3ea=_0x5d523f['count'];var _0x119ac4=_0x1153d7?0x0:_0x2f6381[_0x2707('0x1e')];var _0x4009f3=_0x1153d7?_0x5d523f['count']:_0x2f6381['offset']+_0x2f6381['limit'];var _0x1da4a6;if(_0x4009f3>=_0x27a3ea){_0x4009f3=_0x27a3ea;_0x1da4a6=0xc8;}else{_0x1da4a6=0xce;}_0x1a687a[_0x2707('0x1b')](_0x1da4a6);return _0x1a687a[_0x2707('0x21')](_0x2707('0x22'),_0x119ac4+'-'+_0x4009f3+'/'+_0x27a3ea)[_0x2707('0x1d')](_0x5d523f);}return null;};}function patchUpdates(_0x3c2935){return function(_0xab87f1){try{jsonpatch[_0x2707('0x23')](_0xab87f1,_0x3c2935,!![]);}catch(_0x1e50ea){return BPromise[_0x2707('0x24')](_0x1e50ea);}return _0xab87f1[_0x2707('0x25')]();};}function saveUpdates(_0x119df4,_0x454fde){return function(_0x1c0ffe){if(_0x1c0ffe){return _0x1c0ffe['update'](_0x119df4)[_0x2707('0x26')](function(_0x3b030a){return _0x3b030a;});}return null;};}function removeEntity(_0x46259e,_0x369e3a){return function(_0x378ca4){if(_0x378ca4){return _0x378ca4[_0x2707('0x27')]()['then'](function(){_0x46259e[_0x2707('0x1b')](0xcc)[_0x2707('0x1c')]();});}};}function handleEntityNotFound(_0x171add,_0x2ad386){return function(_0x5b763f){if(!_0x5b763f){_0x171add['sendStatus'](0x194);}return _0x5b763f;};}function handleError(_0x2dce16,_0x4ca05d){_0x4ca05d=_0x4ca05d||0x1f4;return function(_0x29dad2){logger[_0x2707('0x28')](_0x29dad2[_0x2707('0x29')]);if(_0x29dad2['name']){delete _0x29dad2[_0x2707('0x2a')];}_0x2dce16[_0x2707('0x1b')](_0x4ca05d)[_0x2707('0x2b')](_0x29dad2);};}exports['index']=function(_0x31e990,_0x42adf8){var _0x4a99ce={},_0xd63d3f={},_0x497c92={'count':0x0,'rows':[]};var _0x5aaffb=_[_0x2707('0x2c')](db['FreshdeskAccount'][_0x2707('0x2d')],function(_0x3f153d){return{'name':_0x3f153d[_0x2707('0x2e')],'type':_0x3f153d[_0x2707('0x2f')]['key']};});_0xd63d3f[_0x2707('0x30')]=_[_0x2707('0x2c')](_0x5aaffb,_0x2707('0x2a'));_0xd63d3f[_0x2707('0x31')]=_[_0x2707('0x32')](_0x31e990[_0x2707('0x31')]);_0xd63d3f[_0x2707('0x33')]=_[_0x2707('0x34')](_0xd63d3f[_0x2707('0x30')],_0xd63d3f['query']);_0x4a99ce[_0x2707('0x35')]=_[_0x2707('0x34')](_0xd63d3f['model'],qs['fields'](_0x31e990['query']['fields']));_0x4a99ce['attributes']=_0x4a99ce[_0x2707('0x35')]['length']?_0x4a99ce['attributes']:_0xd63d3f[_0x2707('0x30')];if(!_0x31e990[_0x2707('0x31')]['hasOwnProperty'](_0x2707('0x36'))){_0x4a99ce[_0x2707('0x20')]=qs['limit'](_0x31e990['query'][_0x2707('0x20')]);_0x4a99ce[_0x2707('0x1e')]=qs['offset'](_0x31e990['query'][_0x2707('0x1e')]);}_0x4a99ce[_0x2707('0x37')]=qs['sort'](_0x31e990[_0x2707('0x31')][_0x2707('0x38')]);_0x4a99ce[_0x2707('0x39')]=qs[_0x2707('0x33')](_[_0x2707('0x3a')](_0x31e990[_0x2707('0x31')],_0xd63d3f['filters']),_0x5aaffb);if(_0x31e990[_0x2707('0x31')][_0x2707('0x3b')]){_0x4a99ce[_0x2707('0x39')]=_[_0x2707('0x3c')](_0x4a99ce[_0x2707('0x39')],{'$or':_[_0x2707('0x2c')](_0x5aaffb,function(_0x2700bf){if(_0x2700bf['type']!==_0x2707('0x3d')){var _0x2473e3={};_0x2473e3[_0x2700bf[_0x2707('0x2a')]]={'$like':'%'+_0x31e990[_0x2707('0x31')][_0x2707('0x3b')]+'%'};return _0x2473e3;}})});}_0x4a99ce=_[_0x2707('0x3c')]({},_0x4a99ce,_0x31e990[_0x2707('0x3e')]);var _0x39d9f6={'where':_0x4a99ce[_0x2707('0x39')]};return db[_0x2707('0x3f')][_0x2707('0x40')](_0x39d9f6)[_0x2707('0x26')](function(_0x2a221c){_0x497c92[_0x2707('0x40')]=_0x2a221c;if(_0x31e990[_0x2707('0x31')][_0x2707('0x41')]){_0x4a99ce['include']=[{'all':!![]}];}return db[_0x2707('0x3f')][_0x2707('0x42')](_0x4a99ce);})['then'](function(_0x358aa8){_0x497c92['rows']=_0x358aa8;return _0x497c92;})[_0x2707('0x26')](respondWithFilteredResult(_0x42adf8,_0x4a99ce))[_0x2707('0x43')](handleError(_0x42adf8,null));};exports[_0x2707('0x44')]=function(_0x1d69d3,_0x13e1c0){var _0xdeec24={'raw':![],'where':{'id':_0x1d69d3['params']['id']}},_0x26b464={};_0x26b464[_0x2707('0x30')]=_[_0x2707('0x32')](db['FreshdeskAccount'][_0x2707('0x2d')]);_0x26b464[_0x2707('0x31')]=_[_0x2707('0x32')](_0x1d69d3['query']);_0x26b464['filters']=_[_0x2707('0x34')](_0x26b464[_0x2707('0x30')],_0x26b464['query']);_0xdeec24[_0x2707('0x35')]=_['intersection'](_0x26b464[_0x2707('0x30')],qs[_0x2707('0x45')](_0x1d69d3[_0x2707('0x31')][_0x2707('0x45')]));_0xdeec24['attributes']=_0xdeec24[_0x2707('0x35')][_0x2707('0x46')]?_0xdeec24[_0x2707('0x35')]:_0x26b464[_0x2707('0x30')];if(_0x1d69d3[_0x2707('0x31')][_0x2707('0x41')]){_0xdeec24[_0x2707('0x47')]=[{'all':!![]}];}_0xdeec24=_['merge']({},_0xdeec24,_0x1d69d3[_0x2707('0x3e')]);return db[_0x2707('0x3f')][_0x2707('0x48')](_0xdeec24)[_0x2707('0x26')](handleEntityNotFound(_0x13e1c0,null))[_0x2707('0x26')](respondWithResult(_0x13e1c0,null))['catch'](handleError(_0x13e1c0,null));};exports[_0x2707('0x49')]=function(_0x4a6eea,_0xf96f41){return db[_0x2707('0x3f')]['create'](_0x4a6eea[_0x2707('0x4a')],{})[_0x2707('0x26')](respondWithResult(_0xf96f41,0xc9))[_0x2707('0x43')](handleError(_0xf96f41,null));};exports['update']=function(_0x1a8034,_0x59c60f){if(_0x1a8034[_0x2707('0x4a')]['id']){delete _0x1a8034[_0x2707('0x4a')]['id'];}return db['FreshdeskAccount'][_0x2707('0x48')]({'where':{'id':_0x1a8034[_0x2707('0x4b')]['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x59c60f,null))['then'](saveUpdates(_0x1a8034['body'],null))[_0x2707('0x26')](respondWithResult(_0x59c60f,null))[_0x2707('0x43')](handleError(_0x59c60f,null));};exports[_0x2707('0x27')]=function(_0x2515dc,_0x463bf){return db['FreshdeskAccount']['find']({'where':{'id':_0x2515dc['params']['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x463bf,null))[_0x2707('0x26')](removeEntity(_0x463bf,null))[_0x2707('0x43')](handleError(_0x463bf,null));};exports[_0x2707('0x4c')]=function(_0x1ffcce,_0x5b622c,_0xa2c4c0){var _0x2df682={};var _0x5c99fd={};var _0x482ed1;var _0x3b41b2;return db[_0x2707('0x3f')][_0x2707('0x4d')]({'where':{'id':_0x1ffcce['params']['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x5b622c,null))[_0x2707('0x26')](function(_0x2a2a71){if(_0x2a2a71){_0x482ed1=_0x2a2a71;_0x5c99fd[_0x2707('0x30')]=_['keys'](db[_0x2707('0x4e')][_0x2707('0x2d')]);_0x5c99fd[_0x2707('0x31')]=_[_0x2707('0x32')](_0x1ffcce[_0x2707('0x31')]);_0x5c99fd[_0x2707('0x33')]=_[_0x2707('0x34')](_0x5c99fd[_0x2707('0x30')],_0x5c99fd[_0x2707('0x31')]);_0x2df682[_0x2707('0x35')]=_['intersection'](_0x5c99fd[_0x2707('0x30')],qs['fields'](_0x1ffcce['query'][_0x2707('0x45')]));_0x2df682['attributes']=_0x2df682['attributes'][_0x2707('0x46')]?_0x2df682[_0x2707('0x35')]:_0x5c99fd[_0x2707('0x30')];_0x2df682[_0x2707('0x37')]=qs[_0x2707('0x38')](_0x1ffcce[_0x2707('0x31')][_0x2707('0x38')]);_0x2df682[_0x2707('0x39')]=qs[_0x2707('0x33')](_[_0x2707('0x3a')](_0x1ffcce[_0x2707('0x31')],_0x5c99fd['filters']));if(_0x1ffcce['query']['filter']){_0x2df682[_0x2707('0x39')]=_[_0x2707('0x3c')](_0x2df682[_0x2707('0x39')],{'$or':_['map'](_0x2df682['attributes'],function(_0x33ce37){var _0x39c9b4={};_0x39c9b4[_0x33ce37]={'$like':'%'+_0x1ffcce[_0x2707('0x31')][_0x2707('0x3b')]+'%'};return _0x39c9b4;})});}_0x2df682=_[_0x2707('0x3c')]({},_0x2df682,_0x1ffcce['options']);return _0x482ed1['getConfigurations'](_0x2df682);}})[_0x2707('0x26')](function(_0x6a3e8d){if(_0x6a3e8d){_0x3b41b2=_0x6a3e8d[_0x2707('0x46')];if(!_0x1ffcce[_0x2707('0x31')][_0x2707('0x4f')](_0x2707('0x36'))){_0x2df682[_0x2707('0x20')]=qs[_0x2707('0x20')](_0x1ffcce[_0x2707('0x31')]['limit']);_0x2df682[_0x2707('0x1e')]=qs[_0x2707('0x1e')](_0x1ffcce[_0x2707('0x31')][_0x2707('0x1e')]);}return _0x482ed1[_0x2707('0x4c')](_0x2df682);}})[_0x2707('0x26')](function(_0x519042){if(_0x519042){return _0x519042?{'count':_0x3b41b2,'rows':_0x519042}:null;}})['then'](respondWithResult(_0x5b622c,null))[_0x2707('0x43')](handleError(_0x5b622c,null));};exports[_0x2707('0x50')]=function(_0x4eb8eb,_0x58fefc,_0x4f14e0){if(_0x4eb8eb['body']['id']){delete _0x4eb8eb[_0x2707('0x4a')]['id'];}return db[_0x2707('0x3f')]['findOne']({'where':{'id':_0x4eb8eb[_0x2707('0x4b')]['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x58fefc,null))[_0x2707('0x26')](function(_0x5bad5a){if(_0x5bad5a){_0x4eb8eb['body'][_0x2707('0x51')]=_0x5bad5a['id'];_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x52')]=integrations[_0x2707('0x53')](_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x54')],_0x4eb8eb[_0x2707('0x4a')]['type']);_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x55')]=integrations[_0x2707('0x56')](_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x54')],_0x4eb8eb[_0x2707('0x4a')]['type']);return db[_0x2707('0x4e')][_0x2707('0x49')](_0x4eb8eb[_0x2707('0x4a')],{'include':[{'model':db[_0x2707('0x57')],'as':_0x2707('0x52')},{'model':db[_0x2707('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x58fefc,null))[_0x2707('0x43')](handleError(_0x58fefc,null));};exports[_0x2707('0x58')]=function(_0x354322,_0x42da4e,_0x3ae5c6){var _0x2af149='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x354322[_0x2707('0x4b')]['id']},'attributes':['id','remoteUri',_0x2707('0x59')]})[_0x2707('0x26')](handleEntityNotFound(_0x42da4e,null))[_0x2707('0x26')](function(_0x3015d4){if(_0x3015d4){_0x2af149=_0x3015d4[_0x2707('0x5a')];var _0x1783e1=_0x2af149['slice'](-0x1);if(_0x1783e1==='/'){_0x2af149=_0x2af149[_0x2707('0x5b')](0x0,_0x2af149['lastIndexOf'](_0x1783e1));}return rp({'method':_0x2707('0x5c'),'uri':util[_0x2707('0x5d')]('%s/%s',_0x2af149,_0x2707('0x5e')),'headers':{'Authorization':util[_0x2707('0x5d')](_0x2707('0x5f'),new Buffer(util[_0x2707('0x5d')](_0x2707('0x60'),_0x3015d4['apiKey']))[_0x2707('0x61')](_0x2707('0x62')))},'json':!![]});}})[_0x2707('0x26')](function(_0x44f340){if(_0x44f340){var _0x7e505c=[_0x2707('0x63'),_0x2707('0x64'),_0x2707('0x65'),_0x2707('0x66'),_0x2707('0x1b'),_0x2707('0x67'),_0x2707('0x68'),_0x2707('0x69'),_0x2707('0x6a'),_0x2707('0x68'),_0x2707('0x6b')];_[_0x2707('0x6c')](_0x44f340,function(_0x43830c){return _0x7e505c['includes'](_0x43830c[_0x2707('0x2a')])||!_0x43830c['default']&&_0x43830c['type']!==_0x2707('0x6d')&&_0x43830c[_0x2707('0x2f')]!==_0x2707('0x6e');});return{'count':_0x44f340[_0x2707('0x46')],'rows':_[_0x2707('0x2c')](_0x44f340,function(_0x2e04e6){return{'id':_0x2e04e6['name'],'name':_0x2e04e6[_0x2707('0x6f')],'custom':!_0x2e04e6[_0x2707('0x70')],'options':_0x2e04e6[_0x2707('0x71')]?_['map'](_0x2e04e6[_0x2707('0x71')],function(_0x378f14){return{'name':_[_0x2707('0x72')](_0x378f14),'value':_0x378f14};}):[]};})};}})[_0x2707('0x26')](respondWithResult(_0x42da4e,null))['catch'](function(_0xc091da){var _0x5c68d6=_0x354322[_0x2707('0x31')][_0x2707('0x73')]?0x1f4:_0xc091da[_0x2707('0x74')]||0x1f4;logger[_0x2707('0x28')](_0x2707('0x75'),_0x2707('0x58'),_0x5c68d6,JSON[_0x2707('0x76')](_0xc091da));delete _0xc091da[_0x2707('0x2a')];if(_0x5c68d6===0x191){_0x5c68d6=0x190;}_0x42da4e[_0x2707('0x1b')](_0x5c68d6)['send'](_0x354322[_0x2707('0x31')]['test']?{'message':_0x2707('0x77'),'statusCode':_0xc091da[_0x2707('0x74')]}:_0xc091da);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index cbe3dde..027f84b 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 _0xe8c4=['path','rimraf','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','util','moment'];(function(_0x439368,_0x49fbba){var _0x3e8b1c=function(_0x4b9f9d){while(--_0x4b9f9d){_0x439368['push'](_0x439368['shift']());}};_0x3e8b1c(++_0x49fbba);}(_0xe8c4,0xe6));var _0x4e8c=function(_0x1aa56e,_0x68a659){_0x1aa56e=_0x1aa56e-0x0;var _0x1e845d=_0xe8c4[_0x1aa56e];return _0x1e845d;};'use strict';var _=require('lodash');var util=require(_0x4e8c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4e8c('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e8c('0x2'));var rimraf=require(_0x4e8c('0x3'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x4e8c('0x4'));module['exports']=function(_0x3d5829,_0xc1e9b0){return _0x3d5829[_0x4e8c('0x5')](_0x4e8c('0x6'),attributes,{'tableName':_0x4e8c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4440=['path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','api','bluebird','request-promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4440,0xe0));var _0x0444=function(_0x444f22,_0x5bda95){_0x444f22=_0x444f22-0x0;var _0x44a969=_0x4440[_0x444f22];return _0x44a969;};'use strict';var _=require(_0x0444('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0444('0x1'));var moment=require('moment');var BPromise=require(_0x0444('0x2'));var rp=require(_0x0444('0x3'));var fs=require('fs');var path=require(_0x0444('0x4'));var rimraf=require('rimraf');var config=require(_0x0444('0x5'));var attributes=require(_0x0444('0x6'));var integrations=require(_0x0444('0x7'));module[_0x0444('0x8')]=function(_0x24a6da,_0x3e1738){return _0x24a6da[_0x0444('0x9')](_0x0444('0xa'),attributes,{'tableName':_0x0444('0xb'),'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 e040877..82f8059 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 _0x0a20=['map','ShowFreshdeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','request\x20sent','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include','model'];(function(_0x401642,_0x58fbf3){var _0x572e85=function(_0x14968e){while(--_0x14968e){_0x401642['push'](_0x401642['shift']());}};_0x572e85(++_0x58fbf3);}(_0x0a20,0x65));var _0x00a2=function(_0x1ce7e9,_0x5f1f2a){_0x1ce7e9=_0x1ce7e9-0x0;var _0x3d786c=_0x0a20[_0x1ce7e9];return _0x3d786c;};'use strict';var _=require(_0x00a2('0x0'));var util=require(_0x00a2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x00a2('0x2'));var fs=require('fs');var Redis=require(_0x00a2('0x3'));var db=require(_0x00a2('0x4'))['db'];var utils=require(_0x00a2('0x5'));var logger=require(_0x00a2('0x6'))(_0x00a2('0x7'));var config=require(_0x00a2('0x8'));var jayson=require(_0x00a2('0x9'));var client=jayson[_0x00a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22068b,_0x41298f,_0x186241){return new BPromise(function(_0x2fc422,_0x34cfcf){return client['request'](_0x22068b,_0x186241)[_0x00a2('0xb')](function(_0x47a5ad){logger[_0x00a2('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x41298f,'request\x20sent');logger[_0x00a2('0xd')](_0x00a2('0xe'),_0x41298f,'request\x20sent',JSON[_0x00a2('0xf')](_0x47a5ad));if(_0x47a5ad[_0x00a2('0x10')]){if(_0x47a5ad[_0x00a2('0x10')][_0x00a2('0x11')]===0x1f4){logger['error'](_0x00a2('0x12'),_0x41298f,_0x47a5ad[_0x00a2('0x10')]['message']);return _0x34cfcf(_0x47a5ad[_0x00a2('0x10')][_0x00a2('0x13')]);}logger[_0x00a2('0x10')](_0x00a2('0x12'),_0x41298f,_0x47a5ad[_0x00a2('0x10')][_0x00a2('0x13')]);return _0x2fc422(_0x47a5ad[_0x00a2('0x10')]['message']);}else{logger[_0x00a2('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x41298f,_0x00a2('0x14'));_0x2fc422(_0x47a5ad['result']['message']);}})[_0x00a2('0x15')](function(_0x3a6c5e){logger[_0x00a2('0x10')](_0x00a2('0x12'),_0x41298f,_0x3a6c5e);_0x34cfcf(_0x3a6c5e);});});}exports[_0x00a2('0x16')]=function(_0x3e03c4){var _0x49c476=this;return new Promise(function(_0x52249c,_0x462c27){return db[_0x00a2('0x17')][_0x00a2('0x18')]({'raw':_0x3e03c4[_0x00a2('0x19')]?_0x3e03c4[_0x00a2('0x19')][_0x00a2('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e03c4[_0x00a2('0x19')]?_0x3e03c4[_0x00a2('0x19')][_0x00a2('0x1b')]||null:null,'attributes':_0x3e03c4[_0x00a2('0x19')]?_0x3e03c4[_0x00a2('0x19')][_0x00a2('0x1c')]||null:null,'limit':_0x3e03c4['options']?_0x3e03c4[_0x00a2('0x19')]['limit']||null:null,'include':_0x3e03c4[_0x00a2('0x19')]?_0x3e03c4[_0x00a2('0x19')][_0x00a2('0x1d')]?_['map'](_0x3e03c4['options'][_0x00a2('0x1d')],function(_0x585b55){return{'model':db[_0x585b55[_0x00a2('0x1e')]],'as':_0x585b55['as'],'attributes':_0x585b55[_0x00a2('0x1c')],'include':_0x585b55['include']?_[_0x00a2('0x1f')](_0x585b55[_0x00a2('0x1d')],function(_0x18fe7f){return{'model':db[_0x18fe7f[_0x00a2('0x1e')]],'as':_0x18fe7f['as'],'attributes':_0x18fe7f[_0x00a2('0x1c')],'include':_0x18fe7f[_0x00a2('0x1d')]?_[_0x00a2('0x1f')](_0x18fe7f[_0x00a2('0x1d')],function(_0x140a5d){return{'model':db[_0x140a5d['model']],'as':_0x140a5d['as'],'attributes':_0x140a5d[_0x00a2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x00a2('0xb')](function(_0x157186){logger[_0x00a2('0xc')](_0x00a2('0x16'),_0x3e03c4);logger[_0x00a2('0xd')](_0x00a2('0x16'),_0x3e03c4,JSON[_0x00a2('0xf')](_0x157186));_0x52249c(_0x157186);})[_0x00a2('0x15')](function(_0x23ac51){logger[_0x00a2('0x10')](_0x00a2('0x16'),_0x23ac51[_0x00a2('0x13')],_0x3e03c4);_0x462c27(_0x49c476[_0x00a2('0x10')](0x1f4,_0x23ac51['message']));});});};exports[_0x00a2('0x20')]=function(_0x1ec3cb){var _0x2fdd63=this;return new Promise(function(_0x5b69e8,_0x51858e){return db[_0x00a2('0x17')]['find']({'raw':_0x1ec3cb['options']?_0x1ec3cb[_0x00a2('0x19')][_0x00a2('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ec3cb['options']?_0x1ec3cb[_0x00a2('0x19')][_0x00a2('0x1b')]||null:null,'attributes':_0x1ec3cb['options']?_0x1ec3cb[_0x00a2('0x19')][_0x00a2('0x1c')]||null:null,'include':_0x1ec3cb['options']?_0x1ec3cb[_0x00a2('0x19')][_0x00a2('0x1d')]?_[_0x00a2('0x1f')](_0x1ec3cb[_0x00a2('0x19')][_0x00a2('0x1d')],function(_0x385a93){return{'model':db[_0x385a93['model']],'as':_0x385a93['as'],'attributes':_0x385a93[_0x00a2('0x1c')],'include':_0x385a93[_0x00a2('0x1d')]?_[_0x00a2('0x1f')](_0x385a93[_0x00a2('0x1d')],function(_0x52bc55){return{'model':db[_0x52bc55[_0x00a2('0x1e')]],'as':_0x52bc55['as'],'attributes':_0x52bc55['attributes'],'include':_0x52bc55[_0x00a2('0x1d')]?_[_0x00a2('0x1f')](_0x52bc55[_0x00a2('0x1d')],function(_0x3b5a4a){return{'model':db[_0x3b5a4a['model']],'as':_0x3b5a4a['as'],'attributes':_0x3b5a4a[_0x00a2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x00a2('0xb')](function(_0x355679){logger['info'](_0x00a2('0x20'),_0x1ec3cb);logger['debug'](_0x00a2('0x20'),_0x1ec3cb,JSON[_0x00a2('0xf')](_0x355679));_0x5b69e8(_0x355679);})[_0x00a2('0x15')](function(_0x333946){logger['error'](_0x00a2('0x20'),_0x333946['message'],_0x1ec3cb);_0x51858e(_0x2fdd63[_0x00a2('0x10')](0x1f4,_0x333946[_0x00a2('0x13')]));});});}; \ No newline at end of file +var _0xc414=['debug','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','map','include','model','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5acf93,_0x1ddebe){var _0x468fa0=function(_0x5e3016){while(--_0x5e3016){_0x5acf93['push'](_0x5acf93['shift']());}};_0x468fa0(++_0x1ddebe);}(_0xc414,0x1c0));var _0x4c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc414[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c41('0x0'));var util=require(_0x4c41('0x1'));var moment=require(_0x4c41('0x2'));var BPromise=require(_0x4c41('0x3'));var rs=require(_0x4c41('0x4'));var fs=require('fs');var Redis=require(_0x4c41('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4c41('0x6'))(_0x4c41('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4c41('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e8f13,_0x5b898f,_0x436807){return new BPromise(function(_0x33f718,_0x2c50da){return client[_0x4c41('0x9')](_0x2e8f13,_0x436807)[_0x4c41('0xa')](function(_0x197b14){logger[_0x4c41('0xb')](_0x4c41('0xc'),_0x5b898f,_0x4c41('0xd'));logger[_0x4c41('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5b898f,_0x4c41('0xd'),JSON[_0x4c41('0xf')](_0x197b14));if(_0x197b14[_0x4c41('0x10')]){if(_0x197b14[_0x4c41('0x10')][_0x4c41('0x11')]===0x1f4){logger[_0x4c41('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x5b898f,_0x197b14[_0x4c41('0x10')]['message']);return _0x2c50da(_0x197b14[_0x4c41('0x10')][_0x4c41('0x12')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x5b898f,_0x197b14[_0x4c41('0x10')][_0x4c41('0x12')]);return _0x33f718(_0x197b14['error'][_0x4c41('0x12')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x5b898f,_0x4c41('0xd'));_0x33f718(_0x197b14[_0x4c41('0x13')]['message']);}})[_0x4c41('0x14')](function(_0x2abaa7){logger['error'](_0x4c41('0xc'),_0x5b898f,_0x2abaa7);_0x2c50da(_0x2abaa7);});});}exports[_0x4c41('0x15')]=function(_0x118cc4){var _0x18243b=this;return new Promise(function(_0x4c8997,_0x44bf0a){return db[_0x4c41('0x16')][_0x4c41('0x17')]({'raw':_0x118cc4[_0x4c41('0x18')]?_0x118cc4[_0x4c41('0x18')][_0x4c41('0x19')]===undefined?!![]:![]:!![],'where':_0x118cc4[_0x4c41('0x18')]?_0x118cc4['options'][_0x4c41('0x1a')]||null:null,'attributes':_0x118cc4[_0x4c41('0x18')]?_0x118cc4['options'][_0x4c41('0x1b')]||null:null,'limit':_0x118cc4[_0x4c41('0x18')]?_0x118cc4[_0x4c41('0x18')]['limit']||null:null,'include':_0x118cc4[_0x4c41('0x18')]?_0x118cc4[_0x4c41('0x18')]['include']?_[_0x4c41('0x1c')](_0x118cc4[_0x4c41('0x18')][_0x4c41('0x1d')],function(_0x29dc74){return{'model':db[_0x29dc74[_0x4c41('0x1e')]],'as':_0x29dc74['as'],'attributes':_0x29dc74[_0x4c41('0x1b')],'include':_0x29dc74[_0x4c41('0x1d')]?_[_0x4c41('0x1c')](_0x29dc74[_0x4c41('0x1d')],function(_0x59d08a){return{'model':db[_0x59d08a[_0x4c41('0x1e')]],'as':_0x59d08a['as'],'attributes':_0x59d08a[_0x4c41('0x1b')],'include':_0x59d08a['include']?_['map'](_0x59d08a[_0x4c41('0x1d')],function(_0x4b5909){return{'model':db[_0x4b5909[_0x4c41('0x1e')]],'as':_0x4b5909['as'],'attributes':_0x4b5909[_0x4c41('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4c41('0xa')](function(_0x4d0cef){logger[_0x4c41('0xb')](_0x4c41('0x15'),_0x118cc4);logger['debug']('GetFreshdeskAccount',_0x118cc4,JSON[_0x4c41('0xf')](_0x4d0cef));_0x4c8997(_0x4d0cef);})[_0x4c41('0x14')](function(_0xc636b0){logger[_0x4c41('0x10')]('GetFreshdeskAccount',_0xc636b0[_0x4c41('0x12')],_0x118cc4);_0x44bf0a(_0x18243b[_0x4c41('0x10')](0x1f4,_0xc636b0[_0x4c41('0x12')]));});});};exports[_0x4c41('0x1f')]=function(_0x6c85){var _0x2aab80=this;return new Promise(function(_0x335e01,_0x1470e7){return db[_0x4c41('0x16')][_0x4c41('0x20')]({'raw':_0x6c85[_0x4c41('0x18')]?_0x6c85[_0x4c41('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x6c85['options']?_0x6c85[_0x4c41('0x18')][_0x4c41('0x1a')]||null:null,'attributes':_0x6c85[_0x4c41('0x18')]?_0x6c85[_0x4c41('0x18')][_0x4c41('0x1b')]||null:null,'include':_0x6c85[_0x4c41('0x18')]?_0x6c85[_0x4c41('0x18')]['include']?_[_0x4c41('0x1c')](_0x6c85[_0x4c41('0x18')][_0x4c41('0x1d')],function(_0x487cb7){return{'model':db[_0x487cb7[_0x4c41('0x1e')]],'as':_0x487cb7['as'],'attributes':_0x487cb7[_0x4c41('0x1b')],'include':_0x487cb7['include']?_[_0x4c41('0x1c')](_0x487cb7[_0x4c41('0x1d')],function(_0x31aaec){return{'model':db[_0x31aaec[_0x4c41('0x1e')]],'as':_0x31aaec['as'],'attributes':_0x31aaec[_0x4c41('0x1b')],'include':_0x31aaec[_0x4c41('0x1d')]?_[_0x4c41('0x1c')](_0x31aaec[_0x4c41('0x1d')],function(_0x517142){return{'model':db[_0x517142[_0x4c41('0x1e')]],'as':_0x517142['as'],'attributes':_0x517142[_0x4c41('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4c41('0xa')](function(_0x2b1a2a){logger[_0x4c41('0xb')]('ShowFreshdeskAccount',_0x6c85);logger[_0x4c41('0xe')](_0x4c41('0x1f'),_0x6c85,JSON['stringify'](_0x2b1a2a));_0x335e01(_0x2b1a2a);})[_0x4c41('0x14')](function(_0x54c134){logger[_0x4c41('0x10')](_0x4c41('0x1f'),_0x54c134[_0x4c41('0x12')],_0x6c85);_0x1470e7(_0x2aab80[_0x4c41('0x10')](0x1f4,_0x54c134[_0x4c41('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 68fd55e..61156d9 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 _0x1444=['getTags','post','setTags','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags'];(function(_0x1d149a,_0x4215cd){var _0x12c67a=function(_0x1db9d2){while(--_0x1db9d2){_0x1d149a['push'](_0x1d149a['shift']());}};_0x12c67a(++_0x4215cd);}(_0x1444,0x163));var _0x4144=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x1444[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x4144('0x0'));var util=require(_0x4144('0x1'));var path=require('path');var timeout=require(_0x4144('0x2'));var express=require(_0x4144('0x3'));var router=express[_0x4144('0x4')]();var fs_extra=require(_0x4144('0x5'));var auth=require(_0x4144('0x6'));var interaction=require(_0x4144('0x7'));var config=require(_0x4144('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x4144('0x9')]('/',auth[_0x4144('0xa')](),controller[_0x4144('0xb')]);router['get'](_0x4144('0xc'),auth[_0x4144('0xa')](),controller[_0x4144('0xd')]);router[_0x4144('0x9')](_0x4144('0xe'),auth[_0x4144('0xa')](),controller[_0x4144('0xf')]);router[_0x4144('0x9')](_0x4144('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x4144('0x9')](_0x4144('0x11'),auth['isAuthenticated'](),controller[_0x4144('0x12')]);router[_0x4144('0x9')](_0x4144('0x13'),auth[_0x4144('0xa')](),controller[_0x4144('0x14')]);router[_0x4144('0x15')]('/',auth[_0x4144('0xa')](),controller['create']);router[_0x4144('0x15')]('/:id/tags',auth[_0x4144('0xa')](),controller[_0x4144('0x16')]);router['put'](_0x4144('0xc'),auth[_0x4144('0xa')](),controller['update']);router[_0x4144('0x17')](_0x4144('0xc'),auth[_0x4144('0xa')](),controller[_0x4144('0x18')]);module['exports']=router; \ No newline at end of file +var _0xc2e1=['delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','create','put','/:id','update'];(function(_0x46db9b,_0x1cd099){var _0x399090=function(_0x47d323){while(--_0x47d323){_0x46db9b['push'](_0x46db9b['shift']());}};_0x399090(++_0x1cd099);}(_0xc2e1,0x116));var _0x1c2e=function(_0xfd6940,_0x594df7){_0xfd6940=_0xfd6940-0x0;var _0x28d966=_0xc2e1[_0xfd6940];return _0x28d966;};'use strict';var multer=require(_0x1c2e('0x0'));var util=require('util');var path=require(_0x1c2e('0x1'));var timeout=require(_0x1c2e('0x2'));var express=require(_0x1c2e('0x3'));var router=express[_0x1c2e('0x4')]();var fs_extra=require(_0x1c2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1c2e('0x6'));var config=require(_0x1c2e('0x7'));var controller=require(_0x1c2e('0x8'));router[_0x1c2e('0x9')]('/',auth[_0x1c2e('0xa')](),controller['index']);router[_0x1c2e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1c2e('0xb')]);router[_0x1c2e('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1c2e('0xc')]);router['get'](_0x1c2e('0xd'),auth[_0x1c2e('0xa')](),controller[_0x1c2e('0xe')]);router[_0x1c2e('0x9')](_0x1c2e('0xf'),auth[_0x1c2e('0xa')](),controller['getDescriptions']);router[_0x1c2e('0x9')](_0x1c2e('0x10'),auth['isAuthenticated'](),controller['getTags']);router['post']('/',auth[_0x1c2e('0xa')](),controller[_0x1c2e('0x11')]);router['post'](_0x1c2e('0x10'),auth[_0x1c2e('0xa')](),controller['setTags']);router[_0x1c2e('0x12')](_0x1c2e('0x13'),auth[_0x1c2e('0xa')](),controller[_0x1c2e('0x14')]);router[_0x1c2e('0x15')]('/:id',auth[_0x1c2e('0xa')](),controller['destroy']);module[_0x1c2e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 1adda5e..087517c 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 _0x21a7=['exports','STRING'];(function(_0x50dbc6,_0x4e226a){var _0x349828=function(_0x16aa64){while(--_0x16aa64){_0x50dbc6['push'](_0x50dbc6['shift']());}};_0x349828(++_0x4e226a);}(_0x21a7,0xec));var _0x721a=function(_0xef3aef,_0x235a57){_0xef3aef=_0xef3aef-0x0;var _0x41240c=_0x21a7[_0xef3aef];return _0x41240c;};'use strict';var Sequelize=require('sequelize');module[_0x721a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x721a('0x1')]}}; \ No newline at end of file +var _0xc409=['exports','STRING','sequelize'];(function(_0xeed861,_0x144453){var _0x2d161e=function(_0x103b51){while(--_0x103b51){_0xeed861['push'](_0xeed861['shift']());}};_0x2d161e(++_0x144453);}(_0xc409,0x1a0));var _0x9c40=function(_0x5d8b2b,_0x57264f){_0x5d8b2b=_0x5d8b2b-0x0;var _0xb0f56=_0xc409[_0x5d8b2b];return _0xb0f56;};'use strict';var Sequelize=require(_0x9c40('0x0'));module[_0x9c40('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9c40('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index cc954a0..b4af51a 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 _0x4860=['where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','find','create','body','getFields','FreshdeskField','getSubjects','findOne','getTags','Tag','setTags','rimraf','zip-dir','bluebird','util','path','ejs','fs-extra','lodash','squel','to-csv','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','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x4860,0x1b3));var _0x0486=function(_0x4fb70e,_0x49e793){_0x4fb70e=_0x4fb70e-0x0;var _0x2d3465=_0x4860[_0x4fb70e];return _0x2d3465;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0486('0x0'));var zipdir=require(_0x0486('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0486('0x2'));var Mustache=require('mustache');var util=require(_0x0486('0x3'));var path=require(_0x0486('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0486('0x5'));var fs=require('fs');var fs_extra=require(_0x0486('0x6'));var _=require(_0x0486('0x7'));var squel=require(_0x0486('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0486('0x9'));var querystring=require(_0x0486('0xa'));var Papa=require('papaparse');var Redis=require(_0x0486('0xb'));var authService=require(_0x0486('0xc'));var qs=require(_0x0486('0xd'));var as=require(_0x0486('0xe'));var hardwareService=require(_0x0486('0xf'));var logger=require(_0x0486('0x10'))('api');var utils=require(_0x0486('0x11'));var config=require(_0x0486('0x12'));var licenseUtil=require(_0x0486('0x13'));var db=require(_0x0486('0x14'))['db'];function respondWithStatusCode(_0x3a3375,_0x594477){_0x594477=_0x594477||0xcc;return function(_0x7d5212){if(_0x7d5212){return _0x3a3375[_0x0486('0x15')](_0x594477);}return _0x3a3375[_0x0486('0x16')](_0x594477)[_0x0486('0x17')]();};}function respondWithResult(_0x36cab7,_0x2682bb){_0x2682bb=_0x2682bb||0xc8;return function(_0x948f31){if(_0x948f31){return _0x36cab7['status'](_0x2682bb)['json'](_0x948f31);}};}function respondWithFilteredResult(_0x5a119c,_0x13581f){return function(_0x4d68c0){if(_0x4d68c0){var _0x1e87f7=typeof _0x13581f[_0x0486('0x18')]===_0x0486('0x19')&&typeof _0x13581f['limit']===_0x0486('0x19');var _0x4f67c7=_0x4d68c0[_0x0486('0x1a')];var _0x4b98b3=_0x1e87f7?0x0:_0x13581f[_0x0486('0x18')];var _0x4dba92=_0x1e87f7?_0x4d68c0[_0x0486('0x1a')]:_0x13581f[_0x0486('0x18')]+_0x13581f[_0x0486('0x1b')];var _0x44397c;if(_0x4dba92>=_0x4f67c7){_0x4dba92=_0x4f67c7;_0x44397c=0xc8;}else{_0x44397c=0xce;}_0x5a119c[_0x0486('0x16')](_0x44397c);return _0x5a119c[_0x0486('0x1c')](_0x0486('0x1d'),_0x4b98b3+'-'+_0x4dba92+'/'+_0x4f67c7)[_0x0486('0x1e')](_0x4d68c0);}return null;};}function patchUpdates(_0x47d589){return function(_0x27a948){try{jsonpatch[_0x0486('0x1f')](_0x27a948,_0x47d589,!![]);}catch(_0x35cd10){return BPromise[_0x0486('0x20')](_0x35cd10);}return _0x27a948[_0x0486('0x21')]();};}function saveUpdates(_0x2e11a9,_0x318496){return function(_0x3070bc){if(_0x3070bc){return _0x3070bc[_0x0486('0x22')](_0x2e11a9)[_0x0486('0x23')](function(_0x1bd525){return _0x1bd525;});}return null;};}function removeEntity(_0x247031,_0x583cf3){return function(_0x64127b){if(_0x64127b){return _0x64127b[_0x0486('0x24')]()[_0x0486('0x23')](function(){_0x247031['status'](0xcc)[_0x0486('0x17')]();});}};}function handleEntityNotFound(_0x4f2f79,_0xdd239f){return function(_0x16264d){if(!_0x16264d){_0x4f2f79[_0x0486('0x15')](0x194);}return _0x16264d;};}function handleError(_0x49ff5c,_0x415ea9){_0x415ea9=_0x415ea9||0x1f4;return function(_0x5207fa){logger[_0x0486('0x25')](_0x5207fa[_0x0486('0x26')]);if(_0x5207fa[_0x0486('0x27')]){delete _0x5207fa[_0x0486('0x27')];}_0x49ff5c[_0x0486('0x16')](_0x415ea9)[_0x0486('0x28')](_0x5207fa);};}exports[_0x0486('0x29')]=function(_0x41c934,_0x32dc9c){var _0x3ecff7={},_0x1024df={},_0x573a8d={'count':0x0,'rows':[]};var _0x46f26a=_[_0x0486('0x2a')](db[_0x0486('0x2b')]['rawAttributes'],function(_0x1e7c5f){return{'name':_0x1e7c5f[_0x0486('0x2c')],'type':_0x1e7c5f[_0x0486('0x2d')][_0x0486('0x2e')]};});_0x1024df[_0x0486('0x2f')]=_[_0x0486('0x2a')](_0x46f26a,_0x0486('0x27'));_0x1024df[_0x0486('0x30')]=_[_0x0486('0x31')](_0x41c934[_0x0486('0x30')]);_0x1024df['filters']=_[_0x0486('0x32')](_0x1024df[_0x0486('0x2f')],_0x1024df[_0x0486('0x30')]);_0x3ecff7[_0x0486('0x33')]=_[_0x0486('0x32')](_0x1024df[_0x0486('0x2f')],qs['fields'](_0x41c934[_0x0486('0x30')]['fields']));_0x3ecff7[_0x0486('0x33')]=_0x3ecff7[_0x0486('0x33')][_0x0486('0x34')]?_0x3ecff7[_0x0486('0x33')]:_0x1024df[_0x0486('0x2f')];if(!_0x41c934[_0x0486('0x30')][_0x0486('0x35')](_0x0486('0x36'))){_0x3ecff7[_0x0486('0x1b')]=qs[_0x0486('0x1b')](_0x41c934['query'][_0x0486('0x1b')]);_0x3ecff7['offset']=qs['offset'](_0x41c934['query'][_0x0486('0x18')]);}_0x3ecff7[_0x0486('0x37')]=qs[_0x0486('0x38')](_0x41c934[_0x0486('0x30')][_0x0486('0x38')]);_0x3ecff7[_0x0486('0x39')]=qs[_0x0486('0x3a')](_[_0x0486('0x3b')](_0x41c934[_0x0486('0x30')],_0x1024df[_0x0486('0x3a')]),_0x46f26a);if(_0x41c934['query'][_0x0486('0x3c')]){_0x3ecff7['where']=_[_0x0486('0x3d')](_0x3ecff7['where'],{'$or':_[_0x0486('0x2a')](_0x46f26a,function(_0x48994a){if(_0x48994a[_0x0486('0x2d')]!=='VIRTUAL'){var _0x59ba54={};_0x59ba54[_0x48994a['name']]={'$like':'%'+_0x41c934[_0x0486('0x30')][_0x0486('0x3c')]+'%'};return _0x59ba54;}})});}_0x3ecff7=_[_0x0486('0x3d')]({},_0x3ecff7,_0x41c934[_0x0486('0x3e')]);var _0xeca751={'where':_0x3ecff7['where']};return db['FreshdeskConfiguration']['count'](_0xeca751)['then'](function(_0xeac4ac){_0x573a8d[_0x0486('0x1a')]=_0xeac4ac;if(_0x41c934[_0x0486('0x30')]['includeAll']){_0x3ecff7[_0x0486('0x3f')]=[{'all':!![]}];}return db[_0x0486('0x2b')][_0x0486('0x40')](_0x3ecff7);})[_0x0486('0x23')](function(_0x397a72){_0x573a8d[_0x0486('0x41')]=_0x397a72;return _0x573a8d;})[_0x0486('0x23')](respondWithFilteredResult(_0x32dc9c,_0x3ecff7))[_0x0486('0x42')](handleError(_0x32dc9c,null));};exports[_0x0486('0x43')]=function(_0x5774bd,_0x457d25){var _0x218e4c={'raw':![],'where':{'id':_0x5774bd[_0x0486('0x44')]['id']}},_0x26b569={};_0x26b569[_0x0486('0x2f')]=_['keys'](db[_0x0486('0x2b')][_0x0486('0x45')]);_0x26b569[_0x0486('0x30')]=_[_0x0486('0x31')](_0x5774bd['query']);_0x26b569[_0x0486('0x3a')]=_[_0x0486('0x32')](_0x26b569['model'],_0x26b569['query']);_0x218e4c['attributes']=_['intersection'](_0x26b569[_0x0486('0x2f')],qs[_0x0486('0x46')](_0x5774bd[_0x0486('0x30')][_0x0486('0x46')]));_0x218e4c[_0x0486('0x33')]=_0x218e4c['attributes'][_0x0486('0x34')]?_0x218e4c[_0x0486('0x33')]:_0x26b569[_0x0486('0x2f')];if(_0x5774bd['query'][_0x0486('0x47')]){_0x218e4c[_0x0486('0x3f')]=[{'all':!![]}];}_0x218e4c=_[_0x0486('0x3d')]({},_0x218e4c,_0x5774bd[_0x0486('0x3e')]);return db[_0x0486('0x2b')][_0x0486('0x48')](_0x218e4c)[_0x0486('0x23')](handleEntityNotFound(_0x457d25,null))['then'](respondWithResult(_0x457d25,null))[_0x0486('0x42')](handleError(_0x457d25,null));};exports[_0x0486('0x49')]=function(_0x44a6f8,_0xd6bd02){return db['FreshdeskConfiguration']['create'](_0x44a6f8[_0x0486('0x4a')],{})[_0x0486('0x23')](respondWithResult(_0xd6bd02,0xc9))[_0x0486('0x42')](handleError(_0xd6bd02,null));};exports['update']=function(_0x5a2ad6,_0x5b2b33){if(_0x5a2ad6[_0x0486('0x4a')]['id']){delete _0x5a2ad6['body']['id'];}return db[_0x0486('0x2b')][_0x0486('0x48')]({'where':{'id':_0x5a2ad6[_0x0486('0x44')]['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x5b2b33,null))[_0x0486('0x23')](saveUpdates(_0x5a2ad6['body'],null))[_0x0486('0x23')](respondWithResult(_0x5b2b33,null))[_0x0486('0x42')](handleError(_0x5b2b33,null));};exports['destroy']=function(_0x4fd7ac,_0x3a87c0){return db['FreshdeskConfiguration'][_0x0486('0x48')]({'where':{'id':_0x4fd7ac[_0x0486('0x44')]['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x3a87c0,null))[_0x0486('0x23')](removeEntity(_0x3a87c0,null))[_0x0486('0x42')](handleError(_0x3a87c0,null));};exports[_0x0486('0x4b')]=function(_0x2fb689,_0x2717b8,_0x4378e6){var _0x10d6cb={};var _0xe257f0={};var _0x5cf5ef;var _0x5c9a98;return db[_0x0486('0x2b')]['findOne']({'where':{'id':_0x2fb689['params']['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x2717b8,null))['then'](function(_0x4702ca){if(_0x4702ca){_0x5cf5ef=_0x4702ca;_0xe257f0[_0x0486('0x2f')]=_[_0x0486('0x31')](db[_0x0486('0x4c')][_0x0486('0x45')]);_0xe257f0[_0x0486('0x30')]=_['keys'](_0x2fb689[_0x0486('0x30')]);_0xe257f0['filters']=_['intersection'](_0xe257f0[_0x0486('0x2f')],_0xe257f0[_0x0486('0x30')]);_0x10d6cb[_0x0486('0x33')]=_[_0x0486('0x32')](_0xe257f0[_0x0486('0x2f')],qs['fields'](_0x2fb689[_0x0486('0x30')][_0x0486('0x46')]));_0x10d6cb[_0x0486('0x33')]=_0x10d6cb[_0x0486('0x33')][_0x0486('0x34')]?_0x10d6cb[_0x0486('0x33')]:_0xe257f0['model'];_0x10d6cb[_0x0486('0x37')]=qs[_0x0486('0x38')](_0x2fb689[_0x0486('0x30')][_0x0486('0x38')]);_0x10d6cb[_0x0486('0x39')]=qs['filters'](_[_0x0486('0x3b')](_0x2fb689[_0x0486('0x30')],_0xe257f0[_0x0486('0x3a')]));if(_0x2fb689[_0x0486('0x30')][_0x0486('0x3c')]){_0x10d6cb[_0x0486('0x39')]=_[_0x0486('0x3d')](_0x10d6cb[_0x0486('0x39')],{'$or':_[_0x0486('0x2a')](_0x10d6cb[_0x0486('0x33')],function(_0x56a978){var _0x347a2b={};_0x347a2b[_0x56a978]={'$like':'%'+_0x2fb689[_0x0486('0x30')][_0x0486('0x3c')]+'%'};return _0x347a2b;})});}_0x10d6cb=_[_0x0486('0x3d')]({},_0x10d6cb,_0x2fb689['options']);return _0x5cf5ef[_0x0486('0x4b')](_0x10d6cb);}})[_0x0486('0x23')](function(_0x33c3cc){if(_0x33c3cc){_0x5c9a98=_0x33c3cc[_0x0486('0x34')];if(!_0x2fb689['query'][_0x0486('0x35')](_0x0486('0x36'))){_0x10d6cb['limit']=qs[_0x0486('0x1b')](_0x2fb689[_0x0486('0x30')][_0x0486('0x1b')]);_0x10d6cb[_0x0486('0x18')]=qs[_0x0486('0x18')](_0x2fb689[_0x0486('0x30')][_0x0486('0x18')]);}return _0x5cf5ef[_0x0486('0x4b')](_0x10d6cb);}})[_0x0486('0x23')](function(_0x43563f){if(_0x43563f){return _0x43563f?{'count':_0x5c9a98,'rows':_0x43563f}:null;}})[_0x0486('0x23')](respondWithResult(_0x2717b8,null))['catch'](handleError(_0x2717b8,null));};exports[_0x0486('0x4d')]=function(_0x452941,_0x14415d,_0x20dbc5){var _0x3f6423={};var _0x323778={};var _0x495692;var _0x5a1cdb;return db['FreshdeskConfiguration'][_0x0486('0x4e')]({'where':{'id':_0x452941[_0x0486('0x44')]['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x14415d,null))[_0x0486('0x23')](function(_0x159382){if(_0x159382){_0x495692=_0x159382;_0x323778[_0x0486('0x2f')]=_[_0x0486('0x31')](db['FreshdeskField'][_0x0486('0x45')]);_0x323778['query']=_['keys'](_0x452941[_0x0486('0x30')]);_0x323778['filters']=_['intersection'](_0x323778[_0x0486('0x2f')],_0x323778[_0x0486('0x30')]);_0x3f6423[_0x0486('0x33')]=_['intersection'](_0x323778['model'],qs[_0x0486('0x46')](_0x452941[_0x0486('0x30')][_0x0486('0x46')]));_0x3f6423[_0x0486('0x33')]=_0x3f6423[_0x0486('0x33')]['length']?_0x3f6423[_0x0486('0x33')]:_0x323778[_0x0486('0x2f')];_0x3f6423[_0x0486('0x37')]=qs[_0x0486('0x38')](_0x452941['query'][_0x0486('0x38')]);_0x3f6423[_0x0486('0x39')]=qs['filters'](_[_0x0486('0x3b')](_0x452941[_0x0486('0x30')],_0x323778[_0x0486('0x3a')]));if(_0x452941[_0x0486('0x30')][_0x0486('0x3c')]){_0x3f6423['where']=_[_0x0486('0x3d')](_0x3f6423[_0x0486('0x39')],{'$or':_[_0x0486('0x2a')](_0x3f6423[_0x0486('0x33')],function(_0x27098b){var _0x3e401b={};_0x3e401b[_0x27098b]={'$like':'%'+_0x452941['query'][_0x0486('0x3c')]+'%'};return _0x3e401b;})});}_0x3f6423=_[_0x0486('0x3d')]({},_0x3f6423,_0x452941[_0x0486('0x3e')]);return _0x495692[_0x0486('0x4d')](_0x3f6423);}})[_0x0486('0x23')](function(_0x582bc1){if(_0x582bc1){_0x5a1cdb=_0x582bc1[_0x0486('0x34')];if(!_0x452941['query'][_0x0486('0x35')]('nolimit')){_0x3f6423[_0x0486('0x1b')]=qs[_0x0486('0x1b')](_0x452941[_0x0486('0x30')][_0x0486('0x1b')]);_0x3f6423['offset']=qs[_0x0486('0x18')](_0x452941['query'][_0x0486('0x18')]);}return _0x495692[_0x0486('0x4d')](_0x3f6423);}})[_0x0486('0x23')](function(_0x8d90d3){if(_0x8d90d3){return _0x8d90d3?{'count':_0x5a1cdb,'rows':_0x8d90d3}:null;}})['then'](respondWithResult(_0x14415d,null))[_0x0486('0x42')](handleError(_0x14415d,null));};exports['getDescriptions']=function(_0xd237a0,_0x1e7223,_0x2f4eee){var _0xd6d0e0={};var _0x452bfd={};var _0x2f3d00;var _0x330273;return db['FreshdeskConfiguration'][_0x0486('0x4e')]({'where':{'id':_0xd237a0[_0x0486('0x44')]['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x1e7223,null))['then'](function(_0x3018cd){if(_0x3018cd){_0x2f3d00=_0x3018cd;_0x452bfd[_0x0486('0x2f')]=_[_0x0486('0x31')](db['FreshdeskField'][_0x0486('0x45')]);_0x452bfd['query']=_[_0x0486('0x31')](_0xd237a0[_0x0486('0x30')]);_0x452bfd[_0x0486('0x3a')]=_[_0x0486('0x32')](_0x452bfd[_0x0486('0x2f')],_0x452bfd[_0x0486('0x30')]);_0xd6d0e0[_0x0486('0x33')]=_[_0x0486('0x32')](_0x452bfd['model'],qs['fields'](_0xd237a0['query']['fields']));_0xd6d0e0['attributes']=_0xd6d0e0[_0x0486('0x33')][_0x0486('0x34')]?_0xd6d0e0[_0x0486('0x33')]:_0x452bfd[_0x0486('0x2f')];_0xd6d0e0['order']=qs['sort'](_0xd237a0[_0x0486('0x30')][_0x0486('0x38')]);_0xd6d0e0[_0x0486('0x39')]=qs[_0x0486('0x3a')](_[_0x0486('0x3b')](_0xd237a0[_0x0486('0x30')],_0x452bfd[_0x0486('0x3a')]));if(_0xd237a0[_0x0486('0x30')]['filter']){_0xd6d0e0['where']=_[_0x0486('0x3d')](_0xd6d0e0[_0x0486('0x39')],{'$or':_[_0x0486('0x2a')](_0xd6d0e0['attributes'],function(_0x330679){var _0x41855f={};_0x41855f[_0x330679]={'$like':'%'+_0xd237a0['query']['filter']+'%'};return _0x41855f;})});}_0xd6d0e0=_[_0x0486('0x3d')]({},_0xd6d0e0,_0xd237a0[_0x0486('0x3e')]);return _0x2f3d00['getDescriptions'](_0xd6d0e0);}})[_0x0486('0x23')](function(_0x57b084){if(_0x57b084){_0x330273=_0x57b084['length'];if(!_0xd237a0[_0x0486('0x30')][_0x0486('0x35')](_0x0486('0x36'))){_0xd6d0e0[_0x0486('0x1b')]=qs['limit'](_0xd237a0['query']['limit']);_0xd6d0e0[_0x0486('0x18')]=qs[_0x0486('0x18')](_0xd237a0[_0x0486('0x30')][_0x0486('0x18')]);}return _0x2f3d00['getDescriptions'](_0xd6d0e0);}})['then'](function(_0x33967c){if(_0x33967c){return _0x33967c?{'count':_0x330273,'rows':_0x33967c}:null;}})[_0x0486('0x23')](respondWithResult(_0x1e7223,null))[_0x0486('0x42')](handleError(_0x1e7223,null));};exports[_0x0486('0x4f')]=function(_0x9c3fa2,_0x41e6b6,_0xad5ed3){var _0x3b8b71={};var _0x4ed65e={};var _0x58d538;var _0xa3a266;return db['FreshdeskConfiguration'][_0x0486('0x4e')]({'where':{'id':_0x9c3fa2['params']['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x41e6b6,null))['then'](function(_0x51df20){if(_0x51df20){_0x58d538=_0x51df20;_0x4ed65e['model']=_['keys'](db[_0x0486('0x50')][_0x0486('0x45')]);_0x4ed65e[_0x0486('0x30')]=_[_0x0486('0x31')](_0x9c3fa2[_0x0486('0x30')]);_0x4ed65e[_0x0486('0x3a')]=_[_0x0486('0x32')](_0x4ed65e[_0x0486('0x2f')],_0x4ed65e[_0x0486('0x30')]);_0x3b8b71[_0x0486('0x33')]=_['intersection'](_0x4ed65e[_0x0486('0x2f')],qs[_0x0486('0x46')](_0x9c3fa2['query']['fields']));_0x3b8b71[_0x0486('0x33')]=_0x3b8b71[_0x0486('0x33')][_0x0486('0x34')]?_0x3b8b71[_0x0486('0x33')]:_0x4ed65e[_0x0486('0x2f')];_0x3b8b71[_0x0486('0x37')]=qs[_0x0486('0x38')](_0x9c3fa2[_0x0486('0x30')][_0x0486('0x38')]);_0x3b8b71['where']=qs['filters'](_[_0x0486('0x3b')](_0x9c3fa2[_0x0486('0x30')],_0x4ed65e[_0x0486('0x3a')]));if(_0x9c3fa2[_0x0486('0x30')][_0x0486('0x3c')]){_0x3b8b71[_0x0486('0x39')]=_['merge'](_0x3b8b71[_0x0486('0x39')],{'$or':_[_0x0486('0x2a')](_0x3b8b71[_0x0486('0x33')],function(_0x299854){var _0x4e923d={};_0x4e923d[_0x299854]={'$like':'%'+_0x9c3fa2[_0x0486('0x30')][_0x0486('0x3c')]+'%'};return _0x4e923d;})});}_0x3b8b71=_[_0x0486('0x3d')]({},_0x3b8b71,_0x9c3fa2[_0x0486('0x3e')]);return _0x58d538['getTags'](_0x3b8b71);}})[_0x0486('0x23')](function(_0x13b6dd){if(_0x13b6dd){_0xa3a266=_0x13b6dd[_0x0486('0x34')];if(!_0x9c3fa2[_0x0486('0x30')]['hasOwnProperty'](_0x0486('0x36'))){_0x3b8b71[_0x0486('0x1b')]=qs[_0x0486('0x1b')](_0x9c3fa2[_0x0486('0x30')][_0x0486('0x1b')]);_0x3b8b71['offset']=qs[_0x0486('0x18')](_0x9c3fa2[_0x0486('0x30')][_0x0486('0x18')]);}return _0x58d538[_0x0486('0x4f')](_0x3b8b71);}})['then'](function(_0x58eb73){if(_0x58eb73){return _0x58eb73?{'count':_0xa3a266,'rows':_0x58eb73}:null;}})[_0x0486('0x23')](respondWithResult(_0x41e6b6,null))[_0x0486('0x42')](handleError(_0x41e6b6,null));};exports[_0x0486('0x51')]=function(_0x232a95,_0x15cda8,_0x314697){if(_0x232a95[_0x0486('0x4a')]['id']){delete _0x232a95[_0x0486('0x4a')]['id'];}return db['FreshdeskConfiguration'][_0x0486('0x4e')]({'where':{'id':_0x232a95[_0x0486('0x44')]['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x15cda8,null))[_0x0486('0x23')](function(_0x544144){if(_0x544144){return _0x544144['setTags'](_0x232a95['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x15cda8,null))[_0x0486('0x42')](handleError(_0x15cda8,null));}; \ No newline at end of file +var _0xc92f=['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/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','Content-Range','json','reject','then','destroy','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','FreshdeskConfiguration','include','findAll','rows','show','length','includeAll','find','catch','create','update','body','params','findOne','FreshdeskField','order','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0xc92f,0x156));var _0xfc92=function(_0x522241,_0x14b87a){_0x522241=_0x522241-0x0;var _0x16cb7e=_0xc92f[_0x522241];return _0x16cb7e;};'use strict';var emlformat=require(_0xfc92('0x0'));var rimraf=require(_0xfc92('0x1'));var zipdir=require(_0xfc92('0x2'));var jsonpatch=require(_0xfc92('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfc92('0x4'));var Mustache=require(_0xfc92('0x5'));var util=require(_0xfc92('0x6'));var path=require(_0xfc92('0x7'));var sox=require(_0xfc92('0x8'));var csv=require(_0xfc92('0x9'));var ejs=require(_0xfc92('0xa'));var fs=require('fs');var fs_extra=require(_0xfc92('0xb'));var _=require(_0xfc92('0xc'));var squel=require('squel');var crypto=require(_0xfc92('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfc92('0xe'));var toCsv=require(_0xfc92('0x9'));var querystring=require(_0xfc92('0xf'));var Papa=require(_0xfc92('0x10'));var Redis=require(_0xfc92('0x11'));var authService=require(_0xfc92('0x12'));var qs=require(_0xfc92('0x13'));var as=require(_0xfc92('0x14'));var hardwareService=require(_0xfc92('0x15'));var logger=require(_0xfc92('0x16'))(_0xfc92('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc92('0x18'));var db=require(_0xfc92('0x19'))['db'];function respondWithStatusCode(_0x5839bb,_0x345a6d){_0x345a6d=_0x345a6d||0xcc;return function(_0x3d67c4){if(_0x3d67c4){return _0x5839bb['sendStatus'](_0x345a6d);}return _0x5839bb['status'](_0x345a6d)[_0xfc92('0x1a')]();};}function respondWithResult(_0x10a419,_0x49fff6){_0x49fff6=_0x49fff6||0xc8;return function(_0x6d6f6b){if(_0x6d6f6b){return _0x10a419['status'](_0x49fff6)['json'](_0x6d6f6b);}};}function respondWithFilteredResult(_0x17feac,_0x31d2c0){return function(_0x49ca73){if(_0x49ca73){var _0x475457=typeof _0x31d2c0[_0xfc92('0x1b')]===_0xfc92('0x1c')&&typeof _0x31d2c0[_0xfc92('0x1d')]===_0xfc92('0x1c');var _0x250196=_0x49ca73[_0xfc92('0x1e')];var _0x49d4f7=_0x475457?0x0:_0x31d2c0[_0xfc92('0x1b')];var _0x2b79ae=_0x475457?_0x49ca73['count']:_0x31d2c0[_0xfc92('0x1b')]+_0x31d2c0[_0xfc92('0x1d')];var _0x325bef;if(_0x2b79ae>=_0x250196){_0x2b79ae=_0x250196;_0x325bef=0xc8;}else{_0x325bef=0xce;}_0x17feac[_0xfc92('0x1f')](_0x325bef);return _0x17feac[_0xfc92('0x20')](_0xfc92('0x21'),_0x49d4f7+'-'+_0x2b79ae+'/'+_0x250196)[_0xfc92('0x22')](_0x49ca73);}return null;};}function patchUpdates(_0x189370){return function(_0x4d808e){try{jsonpatch['apply'](_0x4d808e,_0x189370,!![]);}catch(_0x262955){return BPromise[_0xfc92('0x23')](_0x262955);}return _0x4d808e['save']();};}function saveUpdates(_0x53e0d7,_0x535d77){return function(_0x4791ac){if(_0x4791ac){return _0x4791ac['update'](_0x53e0d7)[_0xfc92('0x24')](function(_0x24b444){return _0x24b444;});}return null;};}function removeEntity(_0x1a0fd1,_0x2b5253){return function(_0x131c88){if(_0x131c88){return _0x131c88[_0xfc92('0x25')]()[_0xfc92('0x24')](function(){_0x1a0fd1['status'](0xcc)[_0xfc92('0x1a')]();});}};}function handleEntityNotFound(_0x137b62,_0x10849c){return function(_0x42661e){if(!_0x42661e){_0x137b62[_0xfc92('0x26')](0x194);}return _0x42661e;};}function handleError(_0xc6acd4,_0x497429){_0x497429=_0x497429||0x1f4;return function(_0x276be1){logger[_0xfc92('0x27')](_0x276be1[_0xfc92('0x28')]);if(_0x276be1['name']){delete _0x276be1[_0xfc92('0x29')];}_0xc6acd4['status'](_0x497429)[_0xfc92('0x2a')](_0x276be1);};}exports['index']=function(_0x33c4da,_0x54d1b3){var _0x54188d={},_0x45c4a6={},_0x2aa914={'count':0x0,'rows':[]};var _0x27b3b0=_['map'](db['FreshdeskConfiguration'][_0xfc92('0x2b')],function(_0x37e603){return{'name':_0x37e603[_0xfc92('0x2c')],'type':_0x37e603[_0xfc92('0x2d')][_0xfc92('0x2e')]};});_0x45c4a6[_0xfc92('0x2f')]=_[_0xfc92('0x30')](_0x27b3b0,_0xfc92('0x29'));_0x45c4a6[_0xfc92('0x31')]=_[_0xfc92('0x32')](_0x33c4da[_0xfc92('0x31')]);_0x45c4a6[_0xfc92('0x33')]=_['intersection'](_0x45c4a6[_0xfc92('0x2f')],_0x45c4a6['query']);_0x54188d[_0xfc92('0x34')]=_[_0xfc92('0x35')](_0x45c4a6[_0xfc92('0x2f')],qs[_0xfc92('0x36')](_0x33c4da[_0xfc92('0x31')][_0xfc92('0x36')]));_0x54188d[_0xfc92('0x34')]=_0x54188d[_0xfc92('0x34')]['length']?_0x54188d['attributes']:_0x45c4a6[_0xfc92('0x2f')];if(!_0x33c4da['query'][_0xfc92('0x37')](_0xfc92('0x38'))){_0x54188d[_0xfc92('0x1d')]=qs[_0xfc92('0x1d')](_0x33c4da[_0xfc92('0x31')][_0xfc92('0x1d')]);_0x54188d[_0xfc92('0x1b')]=qs[_0xfc92('0x1b')](_0x33c4da[_0xfc92('0x31')][_0xfc92('0x1b')]);}_0x54188d['order']=qs[_0xfc92('0x39')](_0x33c4da[_0xfc92('0x31')][_0xfc92('0x39')]);_0x54188d[_0xfc92('0x3a')]=qs['filters'](_[_0xfc92('0x3b')](_0x33c4da[_0xfc92('0x31')],_0x45c4a6['filters']),_0x27b3b0);if(_0x33c4da[_0xfc92('0x31')][_0xfc92('0x3c')]){_0x54188d[_0xfc92('0x3a')]=_['merge'](_0x54188d[_0xfc92('0x3a')],{'$or':_['map'](_0x27b3b0,function(_0x44d675){if(_0x44d675[_0xfc92('0x2d')]!==_0xfc92('0x3d')){var _0x2af384={};_0x2af384[_0x44d675[_0xfc92('0x29')]]={'$like':'%'+_0x33c4da['query'][_0xfc92('0x3c')]+'%'};return _0x2af384;}})});}_0x54188d=_[_0xfc92('0x3e')]({},_0x54188d,_0x33c4da[_0xfc92('0x3f')]);var _0x11f6a8={'where':_0x54188d[_0xfc92('0x3a')]};return db[_0xfc92('0x40')][_0xfc92('0x1e')](_0x11f6a8)['then'](function(_0xb628f8){_0x2aa914[_0xfc92('0x1e')]=_0xb628f8;if(_0x33c4da[_0xfc92('0x31')]['includeAll']){_0x54188d[_0xfc92('0x41')]=[{'all':!![]}];}return db[_0xfc92('0x40')][_0xfc92('0x42')](_0x54188d);})[_0xfc92('0x24')](function(_0x5327e2){_0x2aa914[_0xfc92('0x43')]=_0x5327e2;return _0x2aa914;})[_0xfc92('0x24')](respondWithFilteredResult(_0x54d1b3,_0x54188d))['catch'](handleError(_0x54d1b3,null));};exports[_0xfc92('0x44')]=function(_0x173224,_0x271404){var _0x475f76={'raw':![],'where':{'id':_0x173224['params']['id']}},_0x5b58f8={};_0x5b58f8[_0xfc92('0x2f')]=_[_0xfc92('0x32')](db[_0xfc92('0x40')][_0xfc92('0x2b')]);_0x5b58f8[_0xfc92('0x31')]=_[_0xfc92('0x32')](_0x173224['query']);_0x5b58f8[_0xfc92('0x33')]=_[_0xfc92('0x35')](_0x5b58f8['model'],_0x5b58f8['query']);_0x475f76[_0xfc92('0x34')]=_['intersection'](_0x5b58f8[_0xfc92('0x2f')],qs['fields'](_0x173224['query'][_0xfc92('0x36')]));_0x475f76[_0xfc92('0x34')]=_0x475f76[_0xfc92('0x34')][_0xfc92('0x45')]?_0x475f76['attributes']:_0x5b58f8[_0xfc92('0x2f')];if(_0x173224['query'][_0xfc92('0x46')]){_0x475f76[_0xfc92('0x41')]=[{'all':!![]}];}_0x475f76=_[_0xfc92('0x3e')]({},_0x475f76,_0x173224[_0xfc92('0x3f')]);return db[_0xfc92('0x40')][_0xfc92('0x47')](_0x475f76)[_0xfc92('0x24')](handleEntityNotFound(_0x271404,null))[_0xfc92('0x24')](respondWithResult(_0x271404,null))[_0xfc92('0x48')](handleError(_0x271404,null));};exports[_0xfc92('0x49')]=function(_0x531e6b,_0x226f0a){return db['FreshdeskConfiguration'][_0xfc92('0x49')](_0x531e6b['body'],{})['then'](respondWithResult(_0x226f0a,0xc9))[_0xfc92('0x48')](handleError(_0x226f0a,null));};exports[_0xfc92('0x4a')]=function(_0x54642b,_0x4752d1){if(_0x54642b[_0xfc92('0x4b')]['id']){delete _0x54642b[_0xfc92('0x4b')]['id'];}return db[_0xfc92('0x40')][_0xfc92('0x47')]({'where':{'id':_0x54642b[_0xfc92('0x4c')]['id']}})[_0xfc92('0x24')](handleEntityNotFound(_0x4752d1,null))[_0xfc92('0x24')](saveUpdates(_0x54642b['body'],null))['then'](respondWithResult(_0x4752d1,null))[_0xfc92('0x48')](handleError(_0x4752d1,null));};exports[_0xfc92('0x25')]=function(_0x5d318a,_0x4821ae){return db[_0xfc92('0x40')][_0xfc92('0x47')]({'where':{'id':_0x5d318a['params']['id']}})[_0xfc92('0x24')](handleEntityNotFound(_0x4821ae,null))['then'](removeEntity(_0x4821ae,null))[_0xfc92('0x48')](handleError(_0x4821ae,null));};exports['getFields']=function(_0x71683e,_0x538d6e,_0x5cf172){var _0x5ac7ff={};var _0x2643aa={};var _0xf76d5e;var _0x34966e;return db['FreshdeskConfiguration'][_0xfc92('0x4d')]({'where':{'id':_0x71683e[_0xfc92('0x4c')]['id']}})[_0xfc92('0x24')](handleEntityNotFound(_0x538d6e,null))[_0xfc92('0x24')](function(_0x4c6952){if(_0x4c6952){_0xf76d5e=_0x4c6952;_0x2643aa['model']=_[_0xfc92('0x32')](db[_0xfc92('0x4e')]['rawAttributes']);_0x2643aa['query']=_[_0xfc92('0x32')](_0x71683e[_0xfc92('0x31')]);_0x2643aa[_0xfc92('0x33')]=_[_0xfc92('0x35')](_0x2643aa[_0xfc92('0x2f')],_0x2643aa['query']);_0x5ac7ff[_0xfc92('0x34')]=_[_0xfc92('0x35')](_0x2643aa[_0xfc92('0x2f')],qs[_0xfc92('0x36')](_0x71683e[_0xfc92('0x31')][_0xfc92('0x36')]));_0x5ac7ff['attributes']=_0x5ac7ff['attributes'][_0xfc92('0x45')]?_0x5ac7ff['attributes']:_0x2643aa[_0xfc92('0x2f')];_0x5ac7ff[_0xfc92('0x4f')]=qs[_0xfc92('0x39')](_0x71683e['query']['sort']);_0x5ac7ff[_0xfc92('0x3a')]=qs['filters'](_[_0xfc92('0x3b')](_0x71683e['query'],_0x2643aa[_0xfc92('0x33')]));if(_0x71683e[_0xfc92('0x31')][_0xfc92('0x3c')]){_0x5ac7ff['where']=_[_0xfc92('0x3e')](_0x5ac7ff[_0xfc92('0x3a')],{'$or':_[_0xfc92('0x30')](_0x5ac7ff['attributes'],function(_0x368d41){var _0x11dbce={};_0x11dbce[_0x368d41]={'$like':'%'+_0x71683e[_0xfc92('0x31')][_0xfc92('0x3c')]+'%'};return _0x11dbce;})});}_0x5ac7ff=_['merge']({},_0x5ac7ff,_0x71683e[_0xfc92('0x3f')]);return _0xf76d5e[_0xfc92('0x50')](_0x5ac7ff);}})[_0xfc92('0x24')](function(_0xa49371){if(_0xa49371){_0x34966e=_0xa49371[_0xfc92('0x45')];if(!_0x71683e[_0xfc92('0x31')][_0xfc92('0x37')](_0xfc92('0x38'))){_0x5ac7ff['limit']=qs['limit'](_0x71683e[_0xfc92('0x31')][_0xfc92('0x1d')]);_0x5ac7ff[_0xfc92('0x1b')]=qs['offset'](_0x71683e[_0xfc92('0x31')][_0xfc92('0x1b')]);}return _0xf76d5e['getFields'](_0x5ac7ff);}})[_0xfc92('0x24')](function(_0x58802b){if(_0x58802b){return _0x58802b?{'count':_0x34966e,'rows':_0x58802b}:null;}})['then'](respondWithResult(_0x538d6e,null))[_0xfc92('0x48')](handleError(_0x538d6e,null));};exports[_0xfc92('0x51')]=function(_0x21b2e8,_0x270e4d,_0x3d961d){var _0x4d893c={};var _0x20acd8={};var _0x1565a2;var _0x23fec5;return db[_0xfc92('0x40')][_0xfc92('0x4d')]({'where':{'id':_0x21b2e8['params']['id']}})['then'](handleEntityNotFound(_0x270e4d,null))[_0xfc92('0x24')](function(_0x33aa01){if(_0x33aa01){_0x1565a2=_0x33aa01;_0x20acd8[_0xfc92('0x2f')]=_[_0xfc92('0x32')](db[_0xfc92('0x4e')][_0xfc92('0x2b')]);_0x20acd8[_0xfc92('0x31')]=_[_0xfc92('0x32')](_0x21b2e8[_0xfc92('0x31')]);_0x20acd8[_0xfc92('0x33')]=_[_0xfc92('0x35')](_0x20acd8[_0xfc92('0x2f')],_0x20acd8[_0xfc92('0x31')]);_0x4d893c[_0xfc92('0x34')]=_[_0xfc92('0x35')](_0x20acd8[_0xfc92('0x2f')],qs[_0xfc92('0x36')](_0x21b2e8[_0xfc92('0x31')][_0xfc92('0x36')]));_0x4d893c['attributes']=_0x4d893c[_0xfc92('0x34')][_0xfc92('0x45')]?_0x4d893c[_0xfc92('0x34')]:_0x20acd8[_0xfc92('0x2f')];_0x4d893c['order']=qs[_0xfc92('0x39')](_0x21b2e8['query'][_0xfc92('0x39')]);_0x4d893c['where']=qs['filters'](_[_0xfc92('0x3b')](_0x21b2e8['query'],_0x20acd8[_0xfc92('0x33')]));if(_0x21b2e8[_0xfc92('0x31')][_0xfc92('0x3c')]){_0x4d893c[_0xfc92('0x3a')]=_['merge'](_0x4d893c['where'],{'$or':_['map'](_0x4d893c[_0xfc92('0x34')],function(_0x180470){var _0x142df4={};_0x142df4[_0x180470]={'$like':'%'+_0x21b2e8['query'][_0xfc92('0x3c')]+'%'};return _0x142df4;})});}_0x4d893c=_['merge']({},_0x4d893c,_0x21b2e8['options']);return _0x1565a2[_0xfc92('0x51')](_0x4d893c);}})[_0xfc92('0x24')](function(_0x5dee10){if(_0x5dee10){_0x23fec5=_0x5dee10[_0xfc92('0x45')];if(!_0x21b2e8[_0xfc92('0x31')][_0xfc92('0x37')](_0xfc92('0x38'))){_0x4d893c[_0xfc92('0x1d')]=qs['limit'](_0x21b2e8['query'][_0xfc92('0x1d')]);_0x4d893c[_0xfc92('0x1b')]=qs['offset'](_0x21b2e8[_0xfc92('0x31')][_0xfc92('0x1b')]);}return _0x1565a2[_0xfc92('0x51')](_0x4d893c);}})[_0xfc92('0x24')](function(_0x2de537){if(_0x2de537){return _0x2de537?{'count':_0x23fec5,'rows':_0x2de537}:null;}})['then'](respondWithResult(_0x270e4d,null))[_0xfc92('0x48')](handleError(_0x270e4d,null));};exports[_0xfc92('0x52')]=function(_0x34b730,_0xbee76f,_0x51a63f){var _0x9fdd9a={};var _0x2d1aa3={};var _0x5a69a8;var _0x5ec98e;return db[_0xfc92('0x40')][_0xfc92('0x4d')]({'where':{'id':_0x34b730[_0xfc92('0x4c')]['id']}})[_0xfc92('0x24')](handleEntityNotFound(_0xbee76f,null))[_0xfc92('0x24')](function(_0x32e471){if(_0x32e471){_0x5a69a8=_0x32e471;_0x2d1aa3[_0xfc92('0x2f')]=_['keys'](db[_0xfc92('0x4e')][_0xfc92('0x2b')]);_0x2d1aa3[_0xfc92('0x31')]=_[_0xfc92('0x32')](_0x34b730['query']);_0x2d1aa3['filters']=_['intersection'](_0x2d1aa3[_0xfc92('0x2f')],_0x2d1aa3[_0xfc92('0x31')]);_0x9fdd9a[_0xfc92('0x34')]=_[_0xfc92('0x35')](_0x2d1aa3[_0xfc92('0x2f')],qs[_0xfc92('0x36')](_0x34b730[_0xfc92('0x31')][_0xfc92('0x36')]));_0x9fdd9a['attributes']=_0x9fdd9a[_0xfc92('0x34')][_0xfc92('0x45')]?_0x9fdd9a['attributes']:_0x2d1aa3[_0xfc92('0x2f')];_0x9fdd9a[_0xfc92('0x4f')]=qs[_0xfc92('0x39')](_0x34b730['query'][_0xfc92('0x39')]);_0x9fdd9a[_0xfc92('0x3a')]=qs['filters'](_[_0xfc92('0x3b')](_0x34b730[_0xfc92('0x31')],_0x2d1aa3['filters']));if(_0x34b730[_0xfc92('0x31')][_0xfc92('0x3c')]){_0x9fdd9a[_0xfc92('0x3a')]=_['merge'](_0x9fdd9a[_0xfc92('0x3a')],{'$or':_['map'](_0x9fdd9a[_0xfc92('0x34')],function(_0x277b27){var _0x550d8e={};_0x550d8e[_0x277b27]={'$like':'%'+_0x34b730[_0xfc92('0x31')][_0xfc92('0x3c')]+'%'};return _0x550d8e;})});}_0x9fdd9a=_['merge']({},_0x9fdd9a,_0x34b730['options']);return _0x5a69a8['getDescriptions'](_0x9fdd9a);}})[_0xfc92('0x24')](function(_0x5ca8d9){if(_0x5ca8d9){_0x5ec98e=_0x5ca8d9[_0xfc92('0x45')];if(!_0x34b730[_0xfc92('0x31')][_0xfc92('0x37')](_0xfc92('0x38'))){_0x9fdd9a[_0xfc92('0x1d')]=qs['limit'](_0x34b730[_0xfc92('0x31')][_0xfc92('0x1d')]);_0x9fdd9a[_0xfc92('0x1b')]=qs[_0xfc92('0x1b')](_0x34b730[_0xfc92('0x31')][_0xfc92('0x1b')]);}return _0x5a69a8['getDescriptions'](_0x9fdd9a);}})[_0xfc92('0x24')](function(_0x5ae96c){if(_0x5ae96c){return _0x5ae96c?{'count':_0x5ec98e,'rows':_0x5ae96c}:null;}})[_0xfc92('0x24')](respondWithResult(_0xbee76f,null))[_0xfc92('0x48')](handleError(_0xbee76f,null));};exports['getTags']=function(_0x507e7b,_0x500e13,_0x6e502b){var _0x183df4={};var _0x10599e={};var _0x5c7188;var _0x1a4b5c;return db['FreshdeskConfiguration'][_0xfc92('0x4d')]({'where':{'id':_0x507e7b[_0xfc92('0x4c')]['id']}})['then'](handleEntityNotFound(_0x500e13,null))[_0xfc92('0x24')](function(_0x42dccb){if(_0x42dccb){_0x5c7188=_0x42dccb;_0x10599e[_0xfc92('0x2f')]=_[_0xfc92('0x32')](db[_0xfc92('0x53')][_0xfc92('0x2b')]);_0x10599e['query']=_['keys'](_0x507e7b['query']);_0x10599e[_0xfc92('0x33')]=_[_0xfc92('0x35')](_0x10599e[_0xfc92('0x2f')],_0x10599e[_0xfc92('0x31')]);_0x183df4[_0xfc92('0x34')]=_['intersection'](_0x10599e[_0xfc92('0x2f')],qs[_0xfc92('0x36')](_0x507e7b['query'][_0xfc92('0x36')]));_0x183df4[_0xfc92('0x34')]=_0x183df4[_0xfc92('0x34')][_0xfc92('0x45')]?_0x183df4[_0xfc92('0x34')]:_0x10599e[_0xfc92('0x2f')];_0x183df4[_0xfc92('0x4f')]=qs['sort'](_0x507e7b[_0xfc92('0x31')][_0xfc92('0x39')]);_0x183df4[_0xfc92('0x3a')]=qs[_0xfc92('0x33')](_[_0xfc92('0x3b')](_0x507e7b[_0xfc92('0x31')],_0x10599e[_0xfc92('0x33')]));if(_0x507e7b[_0xfc92('0x31')][_0xfc92('0x3c')]){_0x183df4[_0xfc92('0x3a')]=_[_0xfc92('0x3e')](_0x183df4[_0xfc92('0x3a')],{'$or':_[_0xfc92('0x30')](_0x183df4[_0xfc92('0x34')],function(_0x1ac992){var _0x3c5dbe={};_0x3c5dbe[_0x1ac992]={'$like':'%'+_0x507e7b[_0xfc92('0x31')][_0xfc92('0x3c')]+'%'};return _0x3c5dbe;})});}_0x183df4=_[_0xfc92('0x3e')]({},_0x183df4,_0x507e7b['options']);return _0x5c7188[_0xfc92('0x54')](_0x183df4);}})[_0xfc92('0x24')](function(_0xb95a5b){if(_0xb95a5b){_0x1a4b5c=_0xb95a5b['length'];if(!_0x507e7b[_0xfc92('0x31')]['hasOwnProperty'](_0xfc92('0x38'))){_0x183df4[_0xfc92('0x1d')]=qs[_0xfc92('0x1d')](_0x507e7b[_0xfc92('0x31')]['limit']);_0x183df4[_0xfc92('0x1b')]=qs[_0xfc92('0x1b')](_0x507e7b['query'][_0xfc92('0x1b')]);}return _0x5c7188[_0xfc92('0x54')](_0x183df4);}})[_0xfc92('0x24')](function(_0xa92ac2){if(_0xa92ac2){return _0xa92ac2?{'count':_0x1a4b5c,'rows':_0xa92ac2}:null;}})['then'](respondWithResult(_0x500e13,null))[_0xfc92('0x48')](handleError(_0x500e13,null));};exports['setTags']=function(_0x3f5d14,_0x483ea5,_0x3682c2){if(_0x3f5d14['body']['id']){delete _0x3f5d14[_0xfc92('0x4b')]['id'];}return db[_0xfc92('0x40')][_0xfc92('0x4d')]({'where':{'id':_0x3f5d14[_0xfc92('0x4c')]['id']}})[_0xfc92('0x24')](handleEntityNotFound(_0x483ea5,null))[_0xfc92('0x24')](function(_0x39e9c6){if(_0x39e9c6){return _0x39e9c6[_0xfc92('0x55')](_0x3f5d14[_0xfc92('0x4b')][_0xfc92('0x56')]||[]);}return null;})[_0xfc92('0x24')](respondWithResult(_0x483ea5,null))['catch'](handleError(_0x483ea5,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 5a130ec..703ad2c 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 _0xbb81=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations'];(function(_0x35940f,_0x1a8d9a){var _0x3ca801=function(_0x4ff9b5){while(--_0x4ff9b5){_0x35940f['push'](_0x35940f['shift']());}};_0x3ca801(++_0x1a8d9a);}(_0xbb81,0x16c));var _0x1bb8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb81[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1bb8('0x0'));var util=require(_0x1bb8('0x1'));var logger=require(_0x1bb8('0x2'))(_0x1bb8('0x3'));var moment=require(_0x1bb8('0x4'));var BPromise=require('bluebird');var rp=require(_0x1bb8('0x5'));var fs=require('fs');var path=require(_0x1bb8('0x6'));var rimraf=require(_0x1bb8('0x7'));var config=require(_0x1bb8('0x8'));var attributes=require(_0x1bb8('0x9'));module[_0x1bb8('0xa')]=function(_0x34481c,_0x440252){return _0x34481c[_0x1bb8('0xb')]('FreshdeskConfiguration',attributes,{'tableName':_0x1bb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eea=['exports','define','FreshdeskConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x3514bc,_0x2688a8){var _0x12d9a8=function(_0x57b828){while(--_0x57b828){_0x3514bc['push'](_0x3514bc['shift']());}};_0x12d9a8(++_0x2688a8);}(_0x5eea,0x189));var _0xa5ee=function(_0x2024a6,_0x4f1ced){_0x2024a6=_0x2024a6-0x0;var _0x456e9e=_0x5eea[_0x2024a6];return _0x456e9e;};'use strict';var _=require(_0xa5ee('0x0'));var util=require(_0xa5ee('0x1'));var logger=require(_0xa5ee('0x2'))(_0xa5ee('0x3'));var moment=require('moment');var BPromise=require(_0xa5ee('0x4'));var rp=require(_0xa5ee('0x5'));var fs=require('fs');var path=require(_0xa5ee('0x6'));var rimraf=require(_0xa5ee('0x7'));var config=require(_0xa5ee('0x8'));var attributes=require(_0xa5ee('0x9'));module[_0xa5ee('0xa')]=function(_0x230386,_0x4f13ea){return _0x230386[_0xa5ee('0xb')](_0xa5ee('0xc'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 4af2ac1..c681770 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 _0x9415=['code','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5c41e9,_0x435daf){var _0x2dcb5c=function(_0x3e8ebb){while(--_0x3e8ebb){_0x5c41e9['push'](_0x5c41e9['shift']());}};_0x2dcb5c(++_0x435daf);}(_0x9415,0xad));var _0x5941=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0x9415[_0x122e9b];return _0x22c247;};'use strict';var _=require(_0x5941('0x0'));var util=require(_0x5941('0x1'));var moment=require(_0x5941('0x2'));var BPromise=require(_0x5941('0x3'));var rs=require(_0x5941('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5941('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5941('0x6'));var jayson=require(_0x5941('0x7'));var client=jayson[_0x5941('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16c375,_0x81d6,_0x26f164){return new BPromise(function(_0x4e9094,_0x584909){return client[_0x5941('0x9')](_0x16c375,_0x26f164)['then'](function(_0x52af70){logger[_0x5941('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x81d6,_0x5941('0xb'));logger[_0x5941('0xc')](_0x5941('0xd'),_0x81d6,_0x5941('0xb'),JSON[_0x5941('0xe')](_0x52af70));if(_0x52af70[_0x5941('0xf')]){if(_0x52af70[_0x5941('0xf')][_0x5941('0x10')]===0x1f4){logger[_0x5941('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x81d6,_0x52af70[_0x5941('0xf')]['message']);return _0x584909(_0x52af70[_0x5941('0xf')][_0x5941('0x11')]);}logger[_0x5941('0xf')](_0x5941('0x12'),_0x81d6,_0x52af70['error'][_0x5941('0x11')]);return _0x4e9094(_0x52af70[_0x5941('0xf')][_0x5941('0x11')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x81d6,_0x5941('0xb'));_0x4e9094(_0x52af70[_0x5941('0x13')][_0x5941('0x11')]);}})[_0x5941('0x14')](function(_0x310e59){logger[_0x5941('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x81d6,_0x310e59);_0x584909(_0x310e59);});});} \ No newline at end of file +var _0x7fea=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x16a679,_0x290e45){var _0x11daf=function(_0x5e6e6e){while(--_0x5e6e6e){_0x16a679['push'](_0x16a679['shift']());}};_0x11daf(++_0x290e45);}(_0x7fea,0x109));var _0xa7fe=function(_0x4f1f7d,_0x3d76b1){_0x4f1f7d=_0x4f1f7d-0x0;var _0x144246=_0x7fea[_0x4f1f7d];return _0x144246;};'use strict';var _=require(_0xa7fe('0x0'));var util=require(_0xa7fe('0x1'));var moment=require(_0xa7fe('0x2'));var BPromise=require(_0xa7fe('0x3'));var rs=require(_0xa7fe('0x4'));var fs=require('fs');var Redis=require(_0xa7fe('0x5'));var db=require(_0xa7fe('0x6'))['db'];var utils=require(_0xa7fe('0x7'));var logger=require(_0xa7fe('0x8'))(_0xa7fe('0x9'));var config=require(_0xa7fe('0xa'));var jayson=require(_0xa7fe('0xb'));var client=jayson[_0xa7fe('0xc')][_0xa7fe('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d1c0a,_0x5b09d0,_0x5a5b58){return new BPromise(function(_0xe9c94b,_0x39ae59){return client[_0xa7fe('0xe')](_0x4d1c0a,_0x5a5b58)[_0xa7fe('0xf')](function(_0x579777){logger['info'](_0xa7fe('0x10'),_0x5b09d0,_0xa7fe('0x11'));logger[_0xa7fe('0x12')](_0xa7fe('0x13'),_0x5b09d0,_0xa7fe('0x11'),JSON[_0xa7fe('0x14')](_0x579777));if(_0x579777[_0xa7fe('0x15')]){if(_0x579777['error'][_0xa7fe('0x16')]===0x1f4){logger[_0xa7fe('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5b09d0,_0x579777[_0xa7fe('0x15')][_0xa7fe('0x17')]);return _0x39ae59(_0x579777[_0xa7fe('0x15')][_0xa7fe('0x17')]);}logger[_0xa7fe('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5b09d0,_0x579777[_0xa7fe('0x15')][_0xa7fe('0x17')]);return _0xe9c94b(_0x579777['error'][_0xa7fe('0x17')]);}else{logger[_0xa7fe('0x18')](_0xa7fe('0x10'),_0x5b09d0,_0xa7fe('0x11'));_0xe9c94b(_0x579777[_0xa7fe('0x19')][_0xa7fe('0x17')]);}})[_0xa7fe('0x1a')](function(_0x55bb48){logger[_0xa7fe('0x15')](_0xa7fe('0x10'),_0x5b09d0,_0x55bb48);_0x39ae59(_0x55bb48);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 7158efc..5deb056 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 _0xdae9=['create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x5a4c25,_0x47bc4c){var _0x2b4881=function(_0x2e7e67){while(--_0x2e7e67){_0x5a4c25['push'](_0x5a4c25['shift']());}};_0x2b4881(++_0x47bc4c);}(_0xdae9,0x65));var _0x9dae=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0xdae9[_0x58965a];return _0x254efc;};'use strict';var multer=require(_0x9dae('0x0'));var util=require('util');var path=require(_0x9dae('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9dae('0x2')]();var fs_extra=require(_0x9dae('0x3'));var auth=require(_0x9dae('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9dae('0x5'));var controller=require(_0x9dae('0x6'));router[_0x9dae('0x7')]('/',auth[_0x9dae('0x8')](),controller[_0x9dae('0x9')]);router[_0x9dae('0x7')](_0x9dae('0xa'),auth[_0x9dae('0x8')](),controller[_0x9dae('0xb')]);router[_0x9dae('0xc')]('/',auth[_0x9dae('0x8')](),controller[_0x9dae('0xd')]);router[_0x9dae('0xe')](_0x9dae('0xa'),auth['isAuthenticated'](),controller[_0x9dae('0xf')]);router[_0x9dae('0x10')](_0x9dae('0xa'),auth[_0x9dae('0x8')](),controller[_0x9dae('0x11')]);module[_0x9dae('0x12')]=router; \ No newline at end of file +var _0x6c68=['multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x955ced,_0x2947ed){var _0x29eac3=function(_0x1b215b){while(--_0x1b215b){_0x955ced['push'](_0x955ced['shift']());}};_0x29eac3(++_0x2947ed);}(_0x6c68,0x1b8));var _0x86c6=function(_0x5f207b,_0x2bd4f2){_0x5f207b=_0x5f207b-0x0;var _0x4a1825=_0x6c68[_0x5f207b];return _0x4a1825;};'use strict';var multer=require(_0x86c6('0x0'));var util=require(_0x86c6('0x1'));var path=require('path');var timeout=require(_0x86c6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86c6('0x3'));var auth=require(_0x86c6('0x4'));var interaction=require(_0x86c6('0x5'));var config=require(_0x86c6('0x6'));var controller=require(_0x86c6('0x7'));router[_0x86c6('0x8')]('/',auth[_0x86c6('0x9')](),controller[_0x86c6('0xa')]);router['get'](_0x86c6('0xb'),auth[_0x86c6('0x9')](),controller[_0x86c6('0xc')]);router[_0x86c6('0xd')]('/',auth[_0x86c6('0x9')](),controller[_0x86c6('0xe')]);router[_0x86c6('0xf')](_0x86c6('0xb'),auth[_0x86c6('0x9')](),controller[_0x86c6('0x10')]);router[_0x86c6('0x11')](_0x86c6('0xb'),auth[_0x86c6('0x9')](),controller[_0x86c6('0x12')]);module[_0x86c6('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 387618c..079e54a 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 _0xc3a2=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x323419,_0x2a6172){var _0x4c0be7=function(_0x5ae2df){while(--_0x5ae2df){_0x323419['push'](_0x323419['shift']());}};_0x4c0be7(++_0x2a6172);}(_0xc3a2,0xfb));var _0x2c3a=function(_0x52e8c1,_0x47ca37){_0x52e8c1=_0x52e8c1-0x0;var _0x1e6bc8=_0xc3a2[_0x52e8c1];return _0x1e6bc8;};'use strict';var Sequelize=require(_0x2c3a('0x0'));module['exports']={'type':{'type':Sequelize[_0x2c3a('0x1')](_0x2c3a('0x2'),_0x2c3a('0x3'),_0x2c3a('0x4'),_0x2c3a('0x5'),_0x2c3a('0x6')),'defaultValue':_0x2c3a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2c3a('0x7')]},'keyType':{'type':Sequelize[_0x2c3a('0x1')]('string',_0x2c3a('0x3'),_0x2c3a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2c3a('0x7')]},'nameField':{'type':Sequelize[_0x2c3a('0x7')]},'customField':{'type':Sequelize[_0x2c3a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2c3a('0x7')]}}; \ No newline at end of file +var _0x0265=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x31882d,_0x1d961c){var _0x5f547b=function(_0x27564d){while(--_0x27564d){_0x31882d['push'](_0x31882d['shift']());}};_0x5f547b(++_0x1d961c);}(_0x0265,0x7b));var _0x5026=function(_0x2556e1,_0xf1cf2f){_0x2556e1=_0x2556e1-0x0;var _0x332c19=_0x0265[_0x2556e1];return _0x332c19;};'use strict';var Sequelize=require(_0x5026('0x0'));module[_0x5026('0x1')]={'type':{'type':Sequelize[_0x5026('0x2')](_0x5026('0x3'),'variable',_0x5026('0x4'),_0x5026('0x5'),_0x5026('0x6')),'defaultValue':_0x5026('0x3')},'content':{'type':Sequelize[_0x5026('0x7')]},'key':{'type':Sequelize[_0x5026('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x5026('0x3'),_0x5026('0x8'),_0x5026('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5026('0x7')]},'nameField':{'type':Sequelize[_0x5026('0x7')]},'customField':{'type':Sequelize[_0x5026('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5026('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index a5fa755..2da7bb0 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 _0xb6b1=['set','Content-Range','apply','reject','save','update','then','error','name','send','map','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x4bb234,_0xac641f){var _0x21eba7=function(_0x2d2d96){while(--_0x2d2d96){_0x4bb234['push'](_0x4bb234['shift']());}};_0x21eba7(++_0xac641f);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0xb6b1[_0x119705];return _0x2affc2;};'use strict';var emlformat=require(_0x1b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6b('0x2'));var moment=require(_0x1b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6b('0x4'));var util=require('util');var path=require(_0x1b6b('0x5'));var sox=require(_0x1b6b('0x6'));var csv=require(_0x1b6b('0x7'));var ejs=require(_0x1b6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x7'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var hardwareService=require(_0x1b6b('0x10'));var logger=require(_0x1b6b('0x11'))(_0x1b6b('0x12'));var utils=require(_0x1b6b('0x13'));var config=require(_0x1b6b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b6b('0x15'))['db'];function respondWithStatusCode(_0x3554b5,_0xf6a4be){_0xf6a4be=_0xf6a4be||0xcc;return function(_0x5abe44){if(_0x5abe44){return _0x3554b5[_0x1b6b('0x16')](_0xf6a4be);}return _0x3554b5['status'](_0xf6a4be)['end']();};}function respondWithResult(_0x2f540f,_0x20a2d7){_0x20a2d7=_0x20a2d7||0xc8;return function(_0x1e474f){if(_0x1e474f){return _0x2f540f[_0x1b6b('0x17')](_0x20a2d7)[_0x1b6b('0x18')](_0x1e474f);}};}function respondWithFilteredResult(_0x268fe9,_0x321263){return function(_0x553a6d){if(_0x553a6d){var _0x1069a4=typeof _0x321263[_0x1b6b('0x19')]===_0x1b6b('0x1a')&&typeof _0x321263[_0x1b6b('0x1b')]==='undefined';var _0x26345c=_0x553a6d[_0x1b6b('0x1c')];var _0x2e608b=_0x1069a4?0x0:_0x321263['offset'];var _0x923711=_0x1069a4?_0x553a6d[_0x1b6b('0x1c')]:_0x321263[_0x1b6b('0x19')]+_0x321263[_0x1b6b('0x1b')];var _0xacd21b;if(_0x923711>=_0x26345c){_0x923711=_0x26345c;_0xacd21b=0xc8;}else{_0xacd21b=0xce;}_0x268fe9[_0x1b6b('0x17')](_0xacd21b);return _0x268fe9[_0x1b6b('0x1d')](_0x1b6b('0x1e'),_0x2e608b+'-'+_0x923711+'/'+_0x26345c)[_0x1b6b('0x18')](_0x553a6d);}return null;};}function patchUpdates(_0x20a5a3){return function(_0x5dbd46){try{jsonpatch[_0x1b6b('0x1f')](_0x5dbd46,_0x20a5a3,!![]);}catch(_0x395118){return BPromise[_0x1b6b('0x20')](_0x395118);}return _0x5dbd46[_0x1b6b('0x21')]();};}function saveUpdates(_0x27974f,_0x276713){return function(_0x3d4ec2){if(_0x3d4ec2){return _0x3d4ec2[_0x1b6b('0x22')](_0x27974f)[_0x1b6b('0x23')](function(_0x4987ee){return _0x4987ee;});}return null;};}function removeEntity(_0x1b2cdf,_0x489e7a){return function(_0x4efab0){if(_0x4efab0){return _0x4efab0['destroy']()[_0x1b6b('0x23')](function(){_0x1b2cdf[_0x1b6b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a317c,_0x47c318){return function(_0x15dfc7){if(!_0x15dfc7){_0x6a317c[_0x1b6b('0x16')](0x194);}return _0x15dfc7;};}function handleError(_0x466c0c,_0x308955){_0x308955=_0x308955||0x1f4;return function(_0xd41b04){logger[_0x1b6b('0x24')](_0xd41b04['stack']);if(_0xd41b04[_0x1b6b('0x25')]){delete _0xd41b04[_0x1b6b('0x25')];}_0x466c0c[_0x1b6b('0x17')](_0x308955)[_0x1b6b('0x26')](_0xd41b04);};}exports['index']=function(_0x23dac4,_0x5a46bd){var _0x5bbcd8={},_0x39b055={},_0x4e9843={'count':0x0,'rows':[]};var _0x165fe8=_[_0x1b6b('0x27')](db['FreshdeskField']['rawAttributes'],function(_0x36878c){return{'name':_0x36878c[_0x1b6b('0x28')],'type':_0x36878c['type']['key']};});_0x39b055[_0x1b6b('0x29')]=_[_0x1b6b('0x27')](_0x165fe8,_0x1b6b('0x25'));_0x39b055[_0x1b6b('0x2a')]=_['keys'](_0x23dac4[_0x1b6b('0x2a')]);_0x39b055[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],_0x39b055[_0x1b6b('0x2a')]);_0x5bbcd8[_0x1b6b('0x2d')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x23dac4['query'][_0x1b6b('0x2e')]));_0x5bbcd8[_0x1b6b('0x2d')]=_0x5bbcd8[_0x1b6b('0x2d')][_0x1b6b('0x2f')]?_0x5bbcd8['attributes']:_0x39b055[_0x1b6b('0x29')];if(!_0x23dac4['query'][_0x1b6b('0x30')]('nolimit')){_0x5bbcd8['limit']=qs[_0x1b6b('0x1b')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x1b')]);_0x5bbcd8['offset']=qs[_0x1b6b('0x19')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x19')]);}_0x5bbcd8[_0x1b6b('0x31')]=qs[_0x1b6b('0x32')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x32')]);_0x5bbcd8[_0x1b6b('0x33')]=qs[_0x1b6b('0x2b')](_[_0x1b6b('0x34')](_0x23dac4[_0x1b6b('0x2a')],_0x39b055[_0x1b6b('0x2b')]),_0x165fe8);if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x35')]){_0x5bbcd8['where']=_[_0x1b6b('0x36')](_0x5bbcd8[_0x1b6b('0x33')],{'$or':_['map'](_0x165fe8,function(_0x41e0db){if(_0x41e0db['type']!==_0x1b6b('0x37')){var _0x19049f={};_0x19049f[_0x41e0db[_0x1b6b('0x25')]]={'$like':'%'+_0x23dac4['query'][_0x1b6b('0x35')]+'%'};return _0x19049f;}})});}_0x5bbcd8=_[_0x1b6b('0x36')]({},_0x5bbcd8,_0x23dac4[_0x1b6b('0x38')]);var _0x5578d9={'where':_0x5bbcd8[_0x1b6b('0x33')]};return db[_0x1b6b('0x39')][_0x1b6b('0x1c')](_0x5578d9)['then'](function(_0x48ece6){_0x4e9843['count']=_0x48ece6;if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x3a')]){_0x5bbcd8[_0x1b6b('0x3b')]=[{'all':!![]}];}return db[_0x1b6b('0x39')][_0x1b6b('0x3c')](_0x5bbcd8);})[_0x1b6b('0x23')](function(_0xe8bea5){_0x4e9843['rows']=_0xe8bea5;return _0x4e9843;})[_0x1b6b('0x23')](respondWithFilteredResult(_0x5a46bd,_0x5bbcd8))[_0x1b6b('0x3d')](handleError(_0x5a46bd,null));};exports[_0x1b6b('0x3e')]=function(_0x31c2bf,_0x1dcba5){var _0x3d8374={'raw':!![],'where':{'id':_0x31c2bf[_0x1b6b('0x3f')]['id']}},_0x5cb83a={};_0x5cb83a[_0x1b6b('0x29')]=_[_0x1b6b('0x40')](db[_0x1b6b('0x39')][_0x1b6b('0x41')]);_0x5cb83a[_0x1b6b('0x2a')]=_[_0x1b6b('0x40')](_0x31c2bf[_0x1b6b('0x2a')]);_0x5cb83a[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],_0x5cb83a[_0x1b6b('0x2a')]);_0x3d8374['attributes']=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x31c2bf[_0x1b6b('0x2a')][_0x1b6b('0x2e')]));_0x3d8374[_0x1b6b('0x2d')]=_0x3d8374['attributes']['length']?_0x3d8374[_0x1b6b('0x2d')]:_0x5cb83a['model'];if(_0x31c2bf[_0x1b6b('0x2a')]['includeAll']){_0x3d8374[_0x1b6b('0x3b')]=[{'all':!![]}];}_0x3d8374=_[_0x1b6b('0x36')]({},_0x3d8374,_0x31c2bf[_0x1b6b('0x38')]);return db[_0x1b6b('0x39')]['find'](_0x3d8374)[_0x1b6b('0x23')](handleEntityNotFound(_0x1dcba5,null))['then'](respondWithResult(_0x1dcba5,null))['catch'](handleError(_0x1dcba5,null));};exports[_0x1b6b('0x42')]=function(_0x123045,_0x151774){return db[_0x1b6b('0x39')]['create'](_0x123045[_0x1b6b('0x43')],{})['then'](respondWithResult(_0x151774,0xc9))[_0x1b6b('0x3d')](handleError(_0x151774,null));};exports[_0x1b6b('0x22')]=function(_0x281f19,_0x4b0b47){if(_0x281f19[_0x1b6b('0x43')]['id']){delete _0x281f19['body']['id'];}return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x281f19[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x4b0b47,null))[_0x1b6b('0x23')](saveUpdates(_0x281f19[_0x1b6b('0x43')],null))[_0x1b6b('0x23')](respondWithResult(_0x4b0b47,null))[_0x1b6b('0x3d')](handleError(_0x4b0b47,null));};exports['destroy']=function(_0x4c1e02,_0x2be336){return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x4c1e02[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x2be336,null))[_0x1b6b('0x23')](removeEntity(_0x2be336,null))[_0x1b6b('0x3d')](handleError(_0x2be336,null));}; \ No newline at end of file +var _0x7794=['status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','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'];(function(_0x1293fa,_0x446d6b){var _0x1dd054=function(_0x1b2d93){while(--_0x1b2d93){_0x1293fa['push'](_0x1293fa['shift']());}};_0x1dd054(++_0x446d6b);}(_0x7794,0x7b));var _0x4779=function(_0x27c63e,_0x31c9a0){_0x27c63e=_0x27c63e-0x0;var _0x34ac47=_0x7794[_0x27c63e];return _0x34ac47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4779('0x0'));var zipdir=require(_0x4779('0x1'));var jsonpatch=require(_0x4779('0x2'));var rp=require(_0x4779('0x3'));var moment=require('moment');var BPromise=require(_0x4779('0x4'));var Mustache=require(_0x4779('0x5'));var util=require('util');var path=require(_0x4779('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4779('0x7'));var _=require(_0x4779('0x8'));var squel=require('squel');var crypto=require(_0x4779('0x9'));var jsforce=require(_0x4779('0xa'));var deskjs=require(_0x4779('0xb'));var toCsv=require(_0x4779('0xc'));var querystring=require(_0x4779('0xd'));var Papa=require(_0x4779('0xe'));var Redis=require(_0x4779('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4779('0x10'));var as=require(_0x4779('0x11'));var hardwareService=require(_0x4779('0x12'));var logger=require(_0x4779('0x13'))(_0x4779('0x14'));var utils=require(_0x4779('0x15'));var config=require(_0x4779('0x16'));var licenseUtil=require(_0x4779('0x17'));var db=require(_0x4779('0x18'))['db'];function respondWithStatusCode(_0x13c989,_0x50e17e){_0x50e17e=_0x50e17e||0xcc;return function(_0x5b1219){if(_0x5b1219){return _0x13c989['sendStatus'](_0x50e17e);}return _0x13c989[_0x4779('0x19')](_0x50e17e)[_0x4779('0x1a')]();};}function respondWithResult(_0xb9a06f,_0xddf5cd){_0xddf5cd=_0xddf5cd||0xc8;return function(_0x4fe370){if(_0x4fe370){return _0xb9a06f[_0x4779('0x19')](_0xddf5cd)[_0x4779('0x1b')](_0x4fe370);}};}function respondWithFilteredResult(_0x4d71a0,_0x599deb){return function(_0x1dbbe1){if(_0x1dbbe1){var _0x2de2be=typeof _0x599deb[_0x4779('0x1c')]===_0x4779('0x1d')&&typeof _0x599deb['limit']==='undefined';var _0x445e0b=_0x1dbbe1[_0x4779('0x1e')];var _0x19fbb6=_0x2de2be?0x0:_0x599deb['offset'];var _0x3dbe70=_0x2de2be?_0x1dbbe1['count']:_0x599deb[_0x4779('0x1c')]+_0x599deb[_0x4779('0x1f')];var _0x478fa5;if(_0x3dbe70>=_0x445e0b){_0x3dbe70=_0x445e0b;_0x478fa5=0xc8;}else{_0x478fa5=0xce;}_0x4d71a0[_0x4779('0x19')](_0x478fa5);return _0x4d71a0['set'](_0x4779('0x20'),_0x19fbb6+'-'+_0x3dbe70+'/'+_0x445e0b)[_0x4779('0x1b')](_0x1dbbe1);}return null;};}function patchUpdates(_0x143ef6){return function(_0x298e25){try{jsonpatch[_0x4779('0x21')](_0x298e25,_0x143ef6,!![]);}catch(_0x1ce270){return BPromise['reject'](_0x1ce270);}return _0x298e25[_0x4779('0x22')]();};}function saveUpdates(_0x4f2158,_0x4ad246){return function(_0xd983f0){if(_0xd983f0){return _0xd983f0[_0x4779('0x23')](_0x4f2158)[_0x4779('0x24')](function(_0x2b7ab6){return _0x2b7ab6;});}return null;};}function removeEntity(_0x555cd6,_0x152887){return function(_0x29a39a){if(_0x29a39a){return _0x29a39a[_0x4779('0x25')]()['then'](function(){_0x555cd6[_0x4779('0x19')](0xcc)[_0x4779('0x1a')]();});}};}function handleEntityNotFound(_0x577b13,_0x1ce2d2){return function(_0x38af24){if(!_0x38af24){_0x577b13['sendStatus'](0x194);}return _0x38af24;};}function handleError(_0x20db7e,_0x277f55){_0x277f55=_0x277f55||0x1f4;return function(_0x211af1){logger[_0x4779('0x26')](_0x211af1[_0x4779('0x27')]);if(_0x211af1[_0x4779('0x28')]){delete _0x211af1[_0x4779('0x28')];}_0x20db7e[_0x4779('0x19')](_0x277f55)['send'](_0x211af1);};}exports[_0x4779('0x29')]=function(_0x1607a5,_0xb028f){var _0x28a261={},_0x8b4c42={},_0x40fb18={'count':0x0,'rows':[]};var _0x13ec28=_[_0x4779('0x2a')](db['FreshdeskField']['rawAttributes'],function(_0x179717){return{'name':_0x179717[_0x4779('0x2b')],'type':_0x179717[_0x4779('0x2c')][_0x4779('0x2d')]};});_0x8b4c42[_0x4779('0x2e')]=_['map'](_0x13ec28,_0x4779('0x28'));_0x8b4c42[_0x4779('0x2f')]=_[_0x4779('0x30')](_0x1607a5[_0x4779('0x2f')]);_0x8b4c42['filters']=_['intersection'](_0x8b4c42[_0x4779('0x2e')],_0x8b4c42['query']);_0x28a261[_0x4779('0x31')]=_[_0x4779('0x32')](_0x8b4c42[_0x4779('0x2e')],qs[_0x4779('0x33')](_0x1607a5[_0x4779('0x2f')][_0x4779('0x33')]));_0x28a261[_0x4779('0x31')]=_0x28a261[_0x4779('0x31')][_0x4779('0x34')]?_0x28a261[_0x4779('0x31')]:_0x8b4c42[_0x4779('0x2e')];if(!_0x1607a5[_0x4779('0x2f')]['hasOwnProperty']('nolimit')){_0x28a261[_0x4779('0x1f')]=qs['limit'](_0x1607a5[_0x4779('0x2f')]['limit']);_0x28a261[_0x4779('0x1c')]=qs[_0x4779('0x1c')](_0x1607a5[_0x4779('0x2f')][_0x4779('0x1c')]);}_0x28a261[_0x4779('0x35')]=qs['sort'](_0x1607a5['query'][_0x4779('0x36')]);_0x28a261[_0x4779('0x37')]=qs[_0x4779('0x38')](_[_0x4779('0x39')](_0x1607a5[_0x4779('0x2f')],_0x8b4c42[_0x4779('0x38')]),_0x13ec28);if(_0x1607a5[_0x4779('0x2f')][_0x4779('0x3a')]){_0x28a261[_0x4779('0x37')]=_[_0x4779('0x3b')](_0x28a261[_0x4779('0x37')],{'$or':_[_0x4779('0x2a')](_0x13ec28,function(_0x88603f){if(_0x88603f[_0x4779('0x2c')]!==_0x4779('0x3c')){var _0x1a2c16={};_0x1a2c16[_0x88603f[_0x4779('0x28')]]={'$like':'%'+_0x1607a5[_0x4779('0x2f')][_0x4779('0x3a')]+'%'};return _0x1a2c16;}})});}_0x28a261=_['merge']({},_0x28a261,_0x1607a5[_0x4779('0x3d')]);var _0x58ca36={'where':_0x28a261[_0x4779('0x37')]};return db[_0x4779('0x3e')][_0x4779('0x1e')](_0x58ca36)[_0x4779('0x24')](function(_0xc9873e){_0x40fb18[_0x4779('0x1e')]=_0xc9873e;if(_0x1607a5['query'][_0x4779('0x3f')]){_0x28a261['include']=[{'all':!![]}];}return db[_0x4779('0x3e')][_0x4779('0x40')](_0x28a261);})[_0x4779('0x24')](function(_0x3a3589){_0x40fb18[_0x4779('0x41')]=_0x3a3589;return _0x40fb18;})[_0x4779('0x24')](respondWithFilteredResult(_0xb028f,_0x28a261))['catch'](handleError(_0xb028f,null));};exports[_0x4779('0x42')]=function(_0x5cdc2b,_0x20abf7){var _0x3f1889={'raw':!![],'where':{'id':_0x5cdc2b['params']['id']}},_0x2e60ab={};_0x2e60ab[_0x4779('0x2e')]=_[_0x4779('0x30')](db[_0x4779('0x3e')][_0x4779('0x43')]);_0x2e60ab[_0x4779('0x2f')]=_[_0x4779('0x30')](_0x5cdc2b[_0x4779('0x2f')]);_0x2e60ab[_0x4779('0x38')]=_[_0x4779('0x32')](_0x2e60ab[_0x4779('0x2e')],_0x2e60ab[_0x4779('0x2f')]);_0x3f1889[_0x4779('0x31')]=_[_0x4779('0x32')](_0x2e60ab[_0x4779('0x2e')],qs[_0x4779('0x33')](_0x5cdc2b['query']['fields']));_0x3f1889[_0x4779('0x31')]=_0x3f1889[_0x4779('0x31')][_0x4779('0x34')]?_0x3f1889[_0x4779('0x31')]:_0x2e60ab[_0x4779('0x2e')];if(_0x5cdc2b[_0x4779('0x2f')][_0x4779('0x3f')]){_0x3f1889[_0x4779('0x44')]=[{'all':!![]}];}_0x3f1889=_['merge']({},_0x3f1889,_0x5cdc2b[_0x4779('0x3d')]);return db[_0x4779('0x3e')][_0x4779('0x45')](_0x3f1889)[_0x4779('0x24')](handleEntityNotFound(_0x20abf7,null))[_0x4779('0x24')](respondWithResult(_0x20abf7,null))[_0x4779('0x46')](handleError(_0x20abf7,null));};exports['create']=function(_0x7f419c,_0x39ecb5){return db[_0x4779('0x3e')][_0x4779('0x47')](_0x7f419c[_0x4779('0x48')],{})['then'](respondWithResult(_0x39ecb5,0xc9))[_0x4779('0x46')](handleError(_0x39ecb5,null));};exports[_0x4779('0x23')]=function(_0x3873d4,_0x4a1040){if(_0x3873d4[_0x4779('0x48')]['id']){delete _0x3873d4['body']['id'];}return db[_0x4779('0x3e')][_0x4779('0x45')]({'where':{'id':_0x3873d4[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a1040,null))[_0x4779('0x24')](saveUpdates(_0x3873d4['body'],null))[_0x4779('0x24')](respondWithResult(_0x4a1040,null))[_0x4779('0x46')](handleError(_0x4a1040,null));};exports[_0x4779('0x25')]=function(_0x58e14e,_0x5dfdb7){return db['FreshdeskField'][_0x4779('0x45')]({'where':{'id':_0x58e14e[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x5dfdb7,null))[_0x4779('0x24')](removeEntity(_0x5dfdb7,null))[_0x4779('0x46')](handleError(_0x5dfdb7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index fb8a711..a2470ec 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 _0x5615=['define','FreshdeskField','freshdesk_unique_index','FieldId','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x1e4b93,_0x3a4c8d){var _0x51aa4f=function(_0x2aa9af){while(--_0x2aa9af){_0x1e4b93['push'](_0x1e4b93['shift']());}};_0x51aa4f(++_0x3a4c8d);}(_0x5615,0xa0));var _0x5561=function(_0x2d4fca,_0x17d3f5){_0x2d4fca=_0x2d4fca-0x0;var _0xadb8c8=_0x5615[_0x2d4fca];return _0xadb8c8;};'use strict';var _=require(_0x5561('0x0'));var util=require(_0x5561('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5561('0x2'));var BPromise=require(_0x5561('0x3'));var rp=require(_0x5561('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5561('0x5'));var config=require(_0x5561('0x6'));var attributes=require(_0x5561('0x7'));module['exports']=function(_0x3aaddb,_0x1ef83c){return _0x3aaddb[_0x5561('0x8')](_0x5561('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x5561('0xa'),'fields':['idField',_0x5561('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xebec=['path','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4b49c9,_0x290d55){var _0xab2d67=function(_0x3a8e9c){while(--_0x3a8e9c){_0x4b49c9['push'](_0x4b49c9['shift']());}};_0xab2d67(++_0x290d55);}(_0xebec,0x135));var _0xcebe=function(_0x4e02bc,_0x5aa8ea){_0x4e02bc=_0x4e02bc-0x0;var _0x38f644=_0xebec[_0x4e02bc];return _0x38f644;};'use strict';var _=require(_0xcebe('0x0'));var util=require(_0xcebe('0x1'));var logger=require(_0xcebe('0x2'))('api');var moment=require(_0xcebe('0x3'));var BPromise=require(_0xcebe('0x4'));var rp=require(_0xcebe('0x5'));var fs=require('fs');var path=require(_0xcebe('0x6'));var rimraf=require('rimraf');var config=require(_0xcebe('0x7'));var attributes=require(_0xcebe('0x8'));module[_0xcebe('0x9')]=function(_0x348d0c,_0x45c7c9){return _0x348d0c[_0xcebe('0xa')](_0xcebe('0xb'),attributes,{'tableName':_0xcebe('0xc'),'paranoid':![],'indexes':[{'name':_0xcebe('0xd'),'fields':['idField',_0xcebe('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 ebce343..86c378d 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 _0xceba=['lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0xaa6529,_0x52f7db){var _0x39b304=function(_0x366394){while(--_0x366394){_0xaa6529['push'](_0xaa6529['shift']());}};_0x39b304(++_0x52f7db);}(_0xceba,0xd2));var _0xaceb=function(_0x340ec7,_0x31436a){_0x340ec7=_0x340ec7-0x0;var _0x2c553a=_0xceba[_0x340ec7];return _0x2c553a;};'use strict';var _=require(_0xaceb('0x0'));var util=require(_0xaceb('0x1'));var moment=require(_0xaceb('0x2'));var BPromise=require(_0xaceb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaceb('0x4'));var logger=require(_0xaceb('0x5'))(_0xaceb('0x6'));var config=require(_0xaceb('0x7'));var jayson=require(_0xaceb('0x8'));var client=jayson[_0xaceb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x943cae,_0x4f2209,_0x9554d1){return new BPromise(function(_0x2dc985,_0x289c26){return client['request'](_0x943cae,_0x9554d1)[_0xaceb('0xa')](function(_0x4900e){logger[_0xaceb('0xb')](_0xaceb('0xc'),_0x4f2209,'request\x20sent');logger[_0xaceb('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x4f2209,_0xaceb('0xe'),JSON[_0xaceb('0xf')](_0x4900e));if(_0x4900e[_0xaceb('0x10')]){if(_0x4900e[_0xaceb('0x10')][_0xaceb('0x11')]===0x1f4){logger[_0xaceb('0x10')](_0xaceb('0xc'),_0x4f2209,_0x4900e[_0xaceb('0x10')]['message']);return _0x289c26(_0x4900e[_0xaceb('0x10')][_0xaceb('0x12')]);}logger[_0xaceb('0x10')](_0xaceb('0xc'),_0x4f2209,_0x4900e[_0xaceb('0x10')][_0xaceb('0x12')]);return _0x2dc985(_0x4900e[_0xaceb('0x10')][_0xaceb('0x12')]);}else{logger[_0xaceb('0xb')](_0xaceb('0xc'),_0x4f2209,'request\x20sent');_0x2dc985(_0x4900e[_0xaceb('0x13')][_0xaceb('0x12')]);}})[_0xaceb('0x14')](function(_0x3b2b99){logger['error'](_0xaceb('0xc'),_0x4f2209,_0x3b2b99);_0x289c26(_0x3b2b99);});});} \ No newline at end of file +var _0xed80=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskField,\x20%s,\x20%s','message','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xed80,0x113));var _0x0ed8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xed80[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x0ed8('0x0'));var moment=require(_0x0ed8('0x1'));var BPromise=require('bluebird');var rs=require(_0x0ed8('0x2'));var fs=require('fs');var Redis=require(_0x0ed8('0x3'));var db=require(_0x0ed8('0x4'))['db'];var utils=require(_0x0ed8('0x5'));var logger=require(_0x0ed8('0x6'))(_0x0ed8('0x7'));var config=require(_0x0ed8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0ed8('0x9')][_0x0ed8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3519de,_0x4a1c38,_0x35cd78){return new BPromise(function(_0x3396a5,_0x510d09){return client[_0x0ed8('0xb')](_0x3519de,_0x35cd78)['then'](function(_0x34c009){logger[_0x0ed8('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x4a1c38,_0x0ed8('0xd'));logger[_0x0ed8('0xe')](_0x0ed8('0xf'),_0x4a1c38,_0x0ed8('0xd'),JSON[_0x0ed8('0x10')](_0x34c009));if(_0x34c009[_0x0ed8('0x11')]){if(_0x34c009[_0x0ed8('0x11')]['code']===0x1f4){logger[_0x0ed8('0x11')](_0x0ed8('0x12'),_0x4a1c38,_0x34c009['error']['message']);return _0x510d09(_0x34c009[_0x0ed8('0x11')]['message']);}logger[_0x0ed8('0x11')](_0x0ed8('0x12'),_0x4a1c38,_0x34c009[_0x0ed8('0x11')][_0x0ed8('0x13')]);return _0x3396a5(_0x34c009[_0x0ed8('0x11')][_0x0ed8('0x13')]);}else{logger[_0x0ed8('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x4a1c38,_0x0ed8('0xd'));_0x3396a5(_0x34c009['result'][_0x0ed8('0x13')]);}})['catch'](function(_0x588e49){logger[_0x0ed8('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x4a1c38,_0x588e49);_0x510d09(_0x588e49);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a61cdbb..9dc92ac 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 _0xee5b=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','delete','/:id'];(function(_0x2e03bd,_0x4f3058){var _0x580d3a=function(_0x2de8ff){while(--_0x2de8ff){_0x2e03bd['push'](_0x2e03bd['shift']());}};_0x580d3a(++_0x4f3058);}(_0xee5b,0x1f4));var _0xbee5=function(_0x32fac0,_0x433566){_0x32fac0=_0x32fac0-0x0;var _0xe919c2=_0xee5b[_0x32fac0];return _0xe919c2;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0x7')](_0xbee5('0xb'),auth['isAuthenticated'](),controller[_0xbee5('0xc')]);router[_0xbee5('0xd')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0xe')]);router[_0xbee5('0xd')](_0xbee5('0xf'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x10')]);router[_0xbee5('0x11')]('/:id',auth[_0xbee5('0x8')](),controller['update']);router[_0xbee5('0x12')](_0xbee5('0x13'),auth[_0xbee5('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3f8c=['index','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','Router','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f8c,0x104));var _0xc3f8=function(_0x9d14f6,_0x1b4cce){_0x9d14f6=_0x9d14f6-0x0;var _0x258b6e=_0x3f8c[_0x9d14f6];return _0x258b6e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3f8('0x0'));var timeout=require(_0xc3f8('0x1'));var express=require(_0xc3f8('0x2'));var router=express[_0xc3f8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xc3f8('0x4')]('/',auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x6')]);router[_0xc3f8('0x4')](_0xc3f8('0x7'),auth[_0xc3f8('0x5')](),controller['show']);router[_0xc3f8('0x4')](_0xc3f8('0x8'),auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x9')]);router[_0xc3f8('0x4')](_0xc3f8('0xa'),auth[_0xc3f8('0x5')](),controller['getFields']);router[_0xc3f8('0xb')]('/',auth[_0xc3f8('0x5')](),controller[_0xc3f8('0xc')]);router[_0xc3f8('0xb')]('/:id/configurations',auth[_0xc3f8('0x5')](),controller[_0xc3f8('0xd')]);router[_0xc3f8('0xe')](_0xc3f8('0x7'),auth['isAuthenticated'](),controller[_0xc3f8('0xf')]);router[_0xc3f8('0x10')](_0xc3f8('0x7'),auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x11')]);module[_0xc3f8('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 148fdca..62d708c 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 _0x77e6=['STRING','username','sequelize','exports'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x77e6,0x1a6));var _0x677e=function(_0x51981e,_0x2965d8){_0x51981e=_0x51981e-0x0;var _0x2c9bd2=_0x77e6[_0x51981e];return _0x2c9bd2;};'use strict';var Sequelize=require(_0x677e('0x0'));module[_0x677e('0x1')]={'name':{'type':Sequelize[_0x677e('0x2')]},'description':{'type':Sequelize[_0x677e('0x2')]},'username':{'type':Sequelize[_0x677e('0x2')],'unique':_0x677e('0x3')},'apiKey':{'type':Sequelize[_0x677e('0x2')]},'remoteUri':{'type':Sequelize[_0x677e('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x677e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x32b6=['remoteUri','sequelize','exports','STRING'];(function(_0x27d443,_0x4ee5ec){var _0x21b822=function(_0x4c6296){while(--_0x4c6296){_0x27d443['push'](_0x27d443['shift']());}};_0x21b822(++_0x4ee5ec);}(_0x32b6,0x1d1));var _0x632b=function(_0x509d6e,_0x1de6e0){_0x509d6e=_0x509d6e-0x0;var _0x1dcc7f=_0x32b6[_0x509d6e];return _0x1dcc7f;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x632b('0x2')]},'username':{'type':Sequelize[_0x632b('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x632b('0x2')],'unique':_0x632b('0x3')},'serverUrl':{'type':Sequelize[_0x632b('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 72aa367..39d3db0 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 _0x43f5=['name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','length','create','body','find','params','getConfigurations','FreshsalesConfiguration','hasOwnProperty','addConfiguration','findOne','getSubjects','getDescriptions','channel','FreshsalesField','Subjects','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0xa6c94a,_0x55a8b1){var _0x2f7674=function(_0x1df5fe){while(--_0x1df5fe){_0xa6c94a['push'](_0xa6c94a['shift']());}};_0x2f7674(++_0x55a8b1);}(_0x43f5,0x175));var _0x543f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x43f5[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x543f('0x0'));var zipdir=require(_0x543f('0x1'));var jsonpatch=require(_0x543f('0x2'));var rp=require(_0x543f('0x3'));var moment=require(_0x543f('0x4'));var BPromise=require(_0x543f('0x5'));var Mustache=require('mustache');var util=require(_0x543f('0x6'));var path=require(_0x543f('0x7'));var sox=require(_0x543f('0x8'));var csv=require(_0x543f('0x9'));var ejs=require(_0x543f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x543f('0xb'));var jsforce=require(_0x543f('0xc'));var deskjs=require(_0x543f('0xd'));var toCsv=require(_0x543f('0x9'));var querystring=require(_0x543f('0xe'));var Papa=require(_0x543f('0xf'));var Redis=require(_0x543f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x543f('0x11'));var as=require(_0x543f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x543f('0x13'));var utils=require(_0x543f('0x14'));var config=require(_0x543f('0x15'));var licenseUtil=require(_0x543f('0x16'));var db=require(_0x543f('0x17'))['db'];var integrations=require(_0x543f('0x18'));function respondWithStatusCode(_0x3b80d2,_0x4d6311){_0x4d6311=_0x4d6311||0xcc;return function(_0x207aec){if(_0x207aec){return _0x3b80d2[_0x543f('0x19')](_0x4d6311);}return _0x3b80d2[_0x543f('0x1a')](_0x4d6311)[_0x543f('0x1b')]();};}function respondWithResult(_0x43f82f,_0x4f7e94){_0x4f7e94=_0x4f7e94||0xc8;return function(_0xe1adc6){if(_0xe1adc6){return _0x43f82f[_0x543f('0x1a')](_0x4f7e94)[_0x543f('0x1c')](_0xe1adc6);}};}function respondWithFilteredResult(_0x2ca4c9,_0x28ed34){return function(_0x21154d){if(_0x21154d){var _0xa858be=typeof _0x28ed34['offset']===_0x543f('0x1d')&&typeof _0x28ed34[_0x543f('0x1e')]==='undefined';var _0x337c77=_0x21154d[_0x543f('0x1f')];var _0x1696dd=_0xa858be?0x0:_0x28ed34[_0x543f('0x20')];var _0x5f395b=_0xa858be?_0x21154d[_0x543f('0x1f')]:_0x28ed34[_0x543f('0x20')]+_0x28ed34[_0x543f('0x1e')];var _0x55053e;if(_0x5f395b>=_0x337c77){_0x5f395b=_0x337c77;_0x55053e=0xc8;}else{_0x55053e=0xce;}_0x2ca4c9[_0x543f('0x1a')](_0x55053e);return _0x2ca4c9[_0x543f('0x21')](_0x543f('0x22'),_0x1696dd+'-'+_0x5f395b+'/'+_0x337c77)[_0x543f('0x1c')](_0x21154d);}return null;};}function patchUpdates(_0x5a5f6a){return function(_0x5b7924){try{jsonpatch[_0x543f('0x23')](_0x5b7924,_0x5a5f6a,!![]);}catch(_0x487ca3){return BPromise[_0x543f('0x24')](_0x487ca3);}return _0x5b7924[_0x543f('0x25')]();};}function saveUpdates(_0x15243e,_0x39d508){return function(_0x418b20){if(_0x418b20){return _0x418b20[_0x543f('0x26')](_0x15243e)[_0x543f('0x27')](function(_0x37a6a7){return _0x37a6a7;});}return null;};}function removeEntity(_0x426609,_0x142ce9){return function(_0x1eb064){if(_0x1eb064){return _0x1eb064[_0x543f('0x28')]()[_0x543f('0x27')](function(){_0x426609['status'](0xcc)[_0x543f('0x1b')]();});}};}function handleEntityNotFound(_0x58861f,_0x1548f9){return function(_0x1a4cf4){if(!_0x1a4cf4){_0x58861f[_0x543f('0x19')](0x194);}return _0x1a4cf4;};}function handleError(_0x2ebbc4,_0x4b3698){_0x4b3698=_0x4b3698||0x1f4;return function(_0x3e3a65){logger[_0x543f('0x29')](_0x3e3a65[_0x543f('0x2a')]);if(_0x3e3a65[_0x543f('0x2b')]){delete _0x3e3a65[_0x543f('0x2b')];}_0x2ebbc4[_0x543f('0x1a')](_0x4b3698)['send'](_0x3e3a65);};}exports[_0x543f('0x2c')]=function(_0x24c402,_0x362963){var _0x30b1ae={},_0x6a50fa={},_0x3602e4={'count':0x0,'rows':[]};var _0x32d298=_[_0x543f('0x2d')](db[_0x543f('0x2e')][_0x543f('0x2f')],function(_0x2508e8){return{'name':_0x2508e8[_0x543f('0x30')],'type':_0x2508e8[_0x543f('0x31')][_0x543f('0x32')]};});_0x6a50fa[_0x543f('0x33')]=_[_0x543f('0x2d')](_0x32d298,_0x543f('0x2b'));_0x6a50fa[_0x543f('0x34')]=_[_0x543f('0x35')](_0x24c402[_0x543f('0x34')]);_0x6a50fa[_0x543f('0x36')]=_[_0x543f('0x37')](_0x6a50fa[_0x543f('0x33')],_0x6a50fa[_0x543f('0x34')]);_0x30b1ae[_0x543f('0x38')]=_[_0x543f('0x37')](_0x6a50fa['model'],qs['fields'](_0x24c402[_0x543f('0x34')][_0x543f('0x39')]));_0x30b1ae['attributes']=_0x30b1ae[_0x543f('0x38')]['length']?_0x30b1ae[_0x543f('0x38')]:_0x6a50fa[_0x543f('0x33')];if(!_0x24c402['query']['hasOwnProperty'](_0x543f('0x3a'))){_0x30b1ae[_0x543f('0x1e')]=qs['limit'](_0x24c402[_0x543f('0x34')][_0x543f('0x1e')]);_0x30b1ae[_0x543f('0x20')]=qs[_0x543f('0x20')](_0x24c402[_0x543f('0x34')][_0x543f('0x20')]);}_0x30b1ae[_0x543f('0x3b')]=qs[_0x543f('0x3c')](_0x24c402['query'][_0x543f('0x3c')]);_0x30b1ae[_0x543f('0x3d')]=qs['filters'](_[_0x543f('0x3e')](_0x24c402[_0x543f('0x34')],_0x6a50fa[_0x543f('0x36')]),_0x32d298);if(_0x24c402[_0x543f('0x34')][_0x543f('0x3f')]){_0x30b1ae[_0x543f('0x3d')]=_[_0x543f('0x40')](_0x30b1ae['where'],{'$or':_[_0x543f('0x2d')](_0x32d298,function(_0x40768e){if(_0x40768e[_0x543f('0x31')]!=='VIRTUAL'){var _0x1f0c81={};_0x1f0c81[_0x40768e[_0x543f('0x2b')]]={'$like':'%'+_0x24c402[_0x543f('0x34')][_0x543f('0x3f')]+'%'};return _0x1f0c81;}})});}_0x30b1ae=_[_0x543f('0x40')]({},_0x30b1ae,_0x24c402[_0x543f('0x41')]);var _0x4e74e8={'where':_0x30b1ae[_0x543f('0x3d')]};return db['FreshsalesAccount'][_0x543f('0x1f')](_0x4e74e8)[_0x543f('0x27')](function(_0x28d30a){_0x3602e4[_0x543f('0x1f')]=_0x28d30a;if(_0x24c402[_0x543f('0x34')][_0x543f('0x42')]){_0x30b1ae[_0x543f('0x43')]=[{'all':!![]}];}return db[_0x543f('0x2e')][_0x543f('0x44')](_0x30b1ae);})['then'](function(_0x384ba8){_0x3602e4[_0x543f('0x45')]=_0x384ba8;return _0x3602e4;})[_0x543f('0x27')](respondWithFilteredResult(_0x362963,_0x30b1ae))[_0x543f('0x46')](handleError(_0x362963,null));};exports['show']=function(_0x27dd8e,_0x39c537){var _0x3cfb5e={'raw':![],'where':{'id':_0x27dd8e['params']['id']}},_0x275af8={};_0x275af8[_0x543f('0x33')]=_['keys'](db['FreshsalesAccount'][_0x543f('0x2f')]);_0x275af8[_0x543f('0x34')]=_[_0x543f('0x35')](_0x27dd8e['query']);_0x275af8['filters']=_['intersection'](_0x275af8[_0x543f('0x33')],_0x275af8[_0x543f('0x34')]);_0x3cfb5e[_0x543f('0x38')]=_[_0x543f('0x37')](_0x275af8['model'],qs[_0x543f('0x39')](_0x27dd8e[_0x543f('0x34')][_0x543f('0x39')]));_0x3cfb5e[_0x543f('0x38')]=_0x3cfb5e[_0x543f('0x38')][_0x543f('0x47')]?_0x3cfb5e['attributes']:_0x275af8[_0x543f('0x33')];if(_0x27dd8e[_0x543f('0x34')][_0x543f('0x42')]){_0x3cfb5e[_0x543f('0x43')]=[{'all':!![]}];}_0x3cfb5e=_[_0x543f('0x40')]({},_0x3cfb5e,_0x27dd8e[_0x543f('0x41')]);return db[_0x543f('0x2e')]['find'](_0x3cfb5e)['then'](handleEntityNotFound(_0x39c537,null))[_0x543f('0x27')](respondWithResult(_0x39c537,null))[_0x543f('0x46')](handleError(_0x39c537,null));};exports[_0x543f('0x48')]=function(_0x1d5fd1,_0x2b7f29){return db[_0x543f('0x2e')][_0x543f('0x48')](_0x1d5fd1[_0x543f('0x49')],{})[_0x543f('0x27')](respondWithResult(_0x2b7f29,0xc9))[_0x543f('0x46')](handleError(_0x2b7f29,null));};exports[_0x543f('0x26')]=function(_0x284616,_0x3e879d){if(_0x284616['body']['id']){delete _0x284616[_0x543f('0x49')]['id'];}return db[_0x543f('0x2e')][_0x543f('0x4a')]({'where':{'id':_0x284616[_0x543f('0x4b')]['id']}})[_0x543f('0x27')](handleEntityNotFound(_0x3e879d,null))[_0x543f('0x27')](saveUpdates(_0x284616['body'],null))['then'](respondWithResult(_0x3e879d,null))[_0x543f('0x46')](handleError(_0x3e879d,null));};exports[_0x543f('0x28')]=function(_0x52115a,_0x1cd8fe){return db[_0x543f('0x2e')][_0x543f('0x4a')]({'where':{'id':_0x52115a['params']['id']}})[_0x543f('0x27')](handleEntityNotFound(_0x1cd8fe,null))[_0x543f('0x27')](removeEntity(_0x1cd8fe,null))[_0x543f('0x46')](handleError(_0x1cd8fe,null));};exports[_0x543f('0x4c')]=function(_0xcb777a,_0xa845b1,_0x2c0a02){var _0x27e4e9={};var _0x18300={};var _0x11c7a8;var _0x457ac2;return db[_0x543f('0x2e')]['findOne']({'where':{'id':_0xcb777a[_0x543f('0x4b')]['id']}})[_0x543f('0x27')](handleEntityNotFound(_0xa845b1,null))[_0x543f('0x27')](function(_0x1d0d28){if(_0x1d0d28){_0x11c7a8=_0x1d0d28;_0x18300['model']=_['keys'](db[_0x543f('0x4d')]['rawAttributes']);_0x18300[_0x543f('0x34')]=_['keys'](_0xcb777a[_0x543f('0x34')]);_0x18300[_0x543f('0x36')]=_['intersection'](_0x18300[_0x543f('0x33')],_0x18300[_0x543f('0x34')]);_0x27e4e9[_0x543f('0x38')]=_[_0x543f('0x37')](_0x18300[_0x543f('0x33')],qs[_0x543f('0x39')](_0xcb777a[_0x543f('0x34')][_0x543f('0x39')]));_0x27e4e9['attributes']=_0x27e4e9[_0x543f('0x38')]['length']?_0x27e4e9['attributes']:_0x18300['model'];_0x27e4e9[_0x543f('0x3b')]=qs[_0x543f('0x3c')](_0xcb777a[_0x543f('0x34')][_0x543f('0x3c')]);_0x27e4e9[_0x543f('0x3d')]=qs['filters'](_[_0x543f('0x3e')](_0xcb777a[_0x543f('0x34')],_0x18300[_0x543f('0x36')]));if(_0xcb777a[_0x543f('0x34')][_0x543f('0x3f')]){_0x27e4e9[_0x543f('0x3d')]=_[_0x543f('0x40')](_0x27e4e9[_0x543f('0x3d')],{'$or':_['map'](_0x27e4e9['attributes'],function(_0xa72e66){var _0x3efcf7={};_0x3efcf7[_0xa72e66]={'$like':'%'+_0xcb777a[_0x543f('0x34')][_0x543f('0x3f')]+'%'};return _0x3efcf7;})});}_0x27e4e9=_[_0x543f('0x40')]({},_0x27e4e9,_0xcb777a[_0x543f('0x41')]);return _0x11c7a8[_0x543f('0x4c')](_0x27e4e9);}})[_0x543f('0x27')](function(_0x2c1c9e){if(_0x2c1c9e){_0x457ac2=_0x2c1c9e['length'];if(!_0xcb777a[_0x543f('0x34')][_0x543f('0x4e')](_0x543f('0x3a'))){_0x27e4e9[_0x543f('0x1e')]=qs[_0x543f('0x1e')](_0xcb777a[_0x543f('0x34')][_0x543f('0x1e')]);_0x27e4e9['offset']=qs[_0x543f('0x20')](_0xcb777a[_0x543f('0x34')]['offset']);}return _0x11c7a8[_0x543f('0x4c')](_0x27e4e9);}})[_0x543f('0x27')](function(_0xcf46a8){if(_0xcf46a8){return _0xcf46a8?{'count':_0x457ac2,'rows':_0xcf46a8}:null;}})['then'](respondWithResult(_0xa845b1,null))[_0x543f('0x46')](handleError(_0xa845b1,null));};exports[_0x543f('0x4f')]=function(_0x3c76da,_0x5525bc,_0x33652f){if(_0x3c76da['body']['id']){delete _0x3c76da[_0x543f('0x49')]['id'];}return db[_0x543f('0x2e')][_0x543f('0x50')]({'where':{'id':_0x3c76da[_0x543f('0x4b')]['id']}})[_0x543f('0x27')](handleEntityNotFound(_0x5525bc,null))['then'](function(_0x6baf47){if(_0x6baf47){_0x3c76da['body']['AccountId']=_0x6baf47['id'];_0x3c76da[_0x543f('0x49')]['Subjects']=integrations[_0x543f('0x51')](_0x3c76da[_0x543f('0x49')]['channel'],_0x3c76da[_0x543f('0x49')][_0x543f('0x31')]);_0x3c76da[_0x543f('0x49')]['Descriptions']=integrations[_0x543f('0x52')](_0x3c76da[_0x543f('0x49')][_0x543f('0x53')],_0x3c76da['body'][_0x543f('0x31')]);return db[_0x543f('0x4d')][_0x543f('0x48')](_0x3c76da[_0x543f('0x49')],{'include':[{'model':db[_0x543f('0x54')],'as':_0x543f('0x55')},{'model':db[_0x543f('0x54')],'as':_0x543f('0x56')}]});}return null;})[_0x543f('0x27')](respondWithResult(_0x5525bc,null))[_0x543f('0x46')](handleError(_0x5525bc,null));};exports[_0x543f('0x57')]=function(_0x378585,_0x39c076,_0x3418e4){var _0x5a8a1e='';var _0x4d061a='';return db[_0x543f('0x2e')]['findOne']({'where':{'id':_0x378585[_0x543f('0x4b')]['id']},'attributes':['id',_0x543f('0x58'),_0x543f('0x59'),_0x543f('0x5a')]})[_0x543f('0x27')](handleEntityNotFound(_0x39c076,null))[_0x543f('0x27')](function(_0x42e255){if(_0x42e255){_0x4d061a=_0x42e255[_0x543f('0x58')];_0x5a8a1e=_0x42e255[_0x543f('0x59')];var _0x5bfbd7=_0x42e255[_0x543f('0x59')][_0x543f('0x5b')](-0x1);if(_0x5bfbd7==='/'){_0x5a8a1e=_0x5a8a1e[_0x543f('0x5c')](0x0,_0x5a8a1e[_0x543f('0x5d')](_0x5bfbd7));}return rp({'method':_0x543f('0x5e'),'uri':util[_0x543f('0x5f')](_0x543f('0x60'),_0x5a8a1e,'/api/selector/owners'),'headers':{'Authorization':_0x543f('0x61')+_0x42e255[_0x543f('0x5a')]},'json':!![]});}})[_0x543f('0x27')](function(_0x5f1047){if(_0x5f1047){var _0x37bbce=_0x5f1047[_0x543f('0x62')];var _0x55dced=![];var _0x239e2e=null;for(_0x239e2e=0x0;_0x239e2e<_0x37bbce['length'];_0x239e2e++){if(_0x37bbce[_0x239e2e][_0x543f('0x63')]===_0x4d061a){_0x55dced=!![];}}if(_0x55dced){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x543f('0x64')});}}})[_0x543f('0x27')](respondWithResult(_0x39c076,null))[_0x543f('0x46')](function(_0x4000e5){var _0xcde883=_0x378585[_0x543f('0x34')][_0x543f('0x65')]?0x1f4:_0x4000e5['statusCode']||0x1f4;logger[_0x543f('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x543f('0x57'),_0xcde883,JSON[_0x543f('0x66')](_0x4000e5));delete _0x4000e5['name'];if(_0xcde883===0x191){_0xcde883=0x190;}_0x39c076[_0x543f('0x1a')](_0xcde883)['send'](_0x378585['query'][_0x543f('0x65')]?{'message':_0x543f('0x67'),'statusCode':_0x4000e5['statusCode']}:_0x4000e5);});}; \ No newline at end of file +var _0x28e4=['%s%s','Token\x20token=','apiKey','users','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','index','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','FreshsalesAccount','includeAll','include','rows','catch','show','length','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','pick','options','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format'];(function(_0x15eb24,_0x3d50d0){var _0x549ec9=function(_0x3e7c89){while(--_0x3e7c89){_0x15eb24['push'](_0x15eb24['shift']());}};_0x549ec9(++_0x3d50d0);}(_0x28e4,0x1ae));var _0x428e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28e4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x428e('0x0'));var rimraf=require(_0x428e('0x1'));var zipdir=require(_0x428e('0x2'));var jsonpatch=require(_0x428e('0x3'));var rp=require(_0x428e('0x4'));var moment=require(_0x428e('0x5'));var BPromise=require(_0x428e('0x6'));var Mustache=require(_0x428e('0x7'));var util=require(_0x428e('0x8'));var path=require('path');var sox=require(_0x428e('0x9'));var csv=require(_0x428e('0xa'));var ejs=require(_0x428e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x428e('0xc'));var squel=require(_0x428e('0xd'));var crypto=require('crypto');var jsforce=require(_0x428e('0xe'));var deskjs=require(_0x428e('0xf'));var toCsv=require(_0x428e('0xa'));var querystring=require(_0x428e('0x10'));var Papa=require(_0x428e('0x11'));var Redis=require(_0x428e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x428e('0x13'));var as=require(_0x428e('0x14'));var hardwareService=require(_0x428e('0x15'));var logger=require('../../config/logger')(_0x428e('0x16'));var utils=require(_0x428e('0x17'));var config=require(_0x428e('0x18'));var licenseUtil=require(_0x428e('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x428e('0x1a'));function respondWithStatusCode(_0x544c40,_0x22903c){_0x22903c=_0x22903c||0xcc;return function(_0x3721a4){if(_0x3721a4){return _0x544c40[_0x428e('0x1b')](_0x22903c);}return _0x544c40['status'](_0x22903c)[_0x428e('0x1c')]();};}function respondWithResult(_0x8ea4b3,_0x15b206){_0x15b206=_0x15b206||0xc8;return function(_0x50109d){if(_0x50109d){return _0x8ea4b3[_0x428e('0x1d')](_0x15b206)[_0x428e('0x1e')](_0x50109d);}};}function respondWithFilteredResult(_0x474102,_0xb7b979){return function(_0x357e2e){if(_0x357e2e){var _0x28870d=typeof _0xb7b979[_0x428e('0x1f')]===_0x428e('0x20')&&typeof _0xb7b979[_0x428e('0x21')]===_0x428e('0x20');var _0x31d2ed=_0x357e2e[_0x428e('0x22')];var _0x126b72=_0x28870d?0x0:_0xb7b979[_0x428e('0x1f')];var _0x5dbd0d=_0x28870d?_0x357e2e[_0x428e('0x22')]:_0xb7b979[_0x428e('0x1f')]+_0xb7b979['limit'];var _0x1e8708;if(_0x5dbd0d>=_0x31d2ed){_0x5dbd0d=_0x31d2ed;_0x1e8708=0xc8;}else{_0x1e8708=0xce;}_0x474102[_0x428e('0x1d')](_0x1e8708);return _0x474102[_0x428e('0x23')](_0x428e('0x24'),_0x126b72+'-'+_0x5dbd0d+'/'+_0x31d2ed)[_0x428e('0x1e')](_0x357e2e);}return null;};}function patchUpdates(_0xdf8fd7){return function(_0x24bc04){try{jsonpatch[_0x428e('0x25')](_0x24bc04,_0xdf8fd7,!![]);}catch(_0x56af62){return BPromise[_0x428e('0x26')](_0x56af62);}return _0x24bc04[_0x428e('0x27')]();};}function saveUpdates(_0x3518fc,_0xa507d4){return function(_0x3ea728){if(_0x3ea728){return _0x3ea728['update'](_0x3518fc)[_0x428e('0x28')](function(_0x4cfca4){return _0x4cfca4;});}return null;};}function removeEntity(_0x1007b0,_0x2c9b05){return function(_0x418607){if(_0x418607){return _0x418607[_0x428e('0x29')]()[_0x428e('0x28')](function(){_0x1007b0['status'](0xcc)[_0x428e('0x1c')]();});}};}function handleEntityNotFound(_0x134f86,_0x5c88bf){return function(_0x4a064c){if(!_0x4a064c){_0x134f86['sendStatus'](0x194);}return _0x4a064c;};}function handleError(_0x313fea,_0x2204d0){_0x2204d0=_0x2204d0||0x1f4;return function(_0x5f5190){logger[_0x428e('0x2a')](_0x5f5190['stack']);if(_0x5f5190[_0x428e('0x2b')]){delete _0x5f5190[_0x428e('0x2b')];}_0x313fea[_0x428e('0x1d')](_0x2204d0)['send'](_0x5f5190);};}exports[_0x428e('0x2c')]=function(_0x3f7712,_0x13d10c){var _0x43daf5={},_0x480f14={},_0x2d7b81={'count':0x0,'rows':[]};var _0x94e0fd=_['map'](db['FreshsalesAccount'][_0x428e('0x2d')],function(_0xf175ca){return{'name':_0xf175ca[_0x428e('0x2e')],'type':_0xf175ca['type']['key']};});_0x480f14[_0x428e('0x2f')]=_[_0x428e('0x30')](_0x94e0fd,_0x428e('0x2b'));_0x480f14[_0x428e('0x31')]=_[_0x428e('0x32')](_0x3f7712['query']);_0x480f14['filters']=_[_0x428e('0x33')](_0x480f14['model'],_0x480f14[_0x428e('0x31')]);_0x43daf5[_0x428e('0x34')]=_[_0x428e('0x33')](_0x480f14['model'],qs[_0x428e('0x35')](_0x3f7712['query'][_0x428e('0x35')]));_0x43daf5['attributes']=_0x43daf5[_0x428e('0x34')]['length']?_0x43daf5[_0x428e('0x34')]:_0x480f14['model'];if(!_0x3f7712[_0x428e('0x31')][_0x428e('0x36')](_0x428e('0x37'))){_0x43daf5[_0x428e('0x21')]=qs[_0x428e('0x21')](_0x3f7712[_0x428e('0x31')][_0x428e('0x21')]);_0x43daf5[_0x428e('0x1f')]=qs[_0x428e('0x1f')](_0x3f7712[_0x428e('0x31')][_0x428e('0x1f')]);}_0x43daf5[_0x428e('0x38')]=qs[_0x428e('0x39')](_0x3f7712[_0x428e('0x31')][_0x428e('0x39')]);_0x43daf5[_0x428e('0x3a')]=qs[_0x428e('0x3b')](_['pick'](_0x3f7712[_0x428e('0x31')],_0x480f14[_0x428e('0x3b')]),_0x94e0fd);if(_0x3f7712['query'][_0x428e('0x3c')]){_0x43daf5[_0x428e('0x3a')]=_[_0x428e('0x3d')](_0x43daf5[_0x428e('0x3a')],{'$or':_[_0x428e('0x30')](_0x94e0fd,function(_0x36f221){if(_0x36f221[_0x428e('0x3e')]!==_0x428e('0x3f')){var _0x167976={};_0x167976[_0x36f221['name']]={'$like':'%'+_0x3f7712['query'][_0x428e('0x3c')]+'%'};return _0x167976;}})});}_0x43daf5=_[_0x428e('0x3d')]({},_0x43daf5,_0x3f7712['options']);var _0xc43d30={'where':_0x43daf5[_0x428e('0x3a')]};return db[_0x428e('0x40')][_0x428e('0x22')](_0xc43d30)['then'](function(_0x582821){_0x2d7b81['count']=_0x582821;if(_0x3f7712['query'][_0x428e('0x41')]){_0x43daf5[_0x428e('0x42')]=[{'all':!![]}];}return db[_0x428e('0x40')]['findAll'](_0x43daf5);})[_0x428e('0x28')](function(_0x50b2b1){_0x2d7b81[_0x428e('0x43')]=_0x50b2b1;return _0x2d7b81;})[_0x428e('0x28')](respondWithFilteredResult(_0x13d10c,_0x43daf5))[_0x428e('0x44')](handleError(_0x13d10c,null));};exports[_0x428e('0x45')]=function(_0x21a5a1,_0x25354e){var _0x4a788e={'raw':![],'where':{'id':_0x21a5a1['params']['id']}},_0x21b84c={};_0x21b84c[_0x428e('0x2f')]=_[_0x428e('0x32')](db[_0x428e('0x40')][_0x428e('0x2d')]);_0x21b84c['query']=_[_0x428e('0x32')](_0x21a5a1[_0x428e('0x31')]);_0x21b84c[_0x428e('0x3b')]=_[_0x428e('0x33')](_0x21b84c[_0x428e('0x2f')],_0x21b84c[_0x428e('0x31')]);_0x4a788e[_0x428e('0x34')]=_[_0x428e('0x33')](_0x21b84c['model'],qs[_0x428e('0x35')](_0x21a5a1['query'][_0x428e('0x35')]));_0x4a788e[_0x428e('0x34')]=_0x4a788e[_0x428e('0x34')][_0x428e('0x46')]?_0x4a788e[_0x428e('0x34')]:_0x21b84c[_0x428e('0x2f')];if(_0x21a5a1[_0x428e('0x31')][_0x428e('0x41')]){_0x4a788e[_0x428e('0x42')]=[{'all':!![]}];}_0x4a788e=_['merge']({},_0x4a788e,_0x21a5a1['options']);return db[_0x428e('0x40')][_0x428e('0x47')](_0x4a788e)[_0x428e('0x28')](handleEntityNotFound(_0x25354e,null))[_0x428e('0x28')](respondWithResult(_0x25354e,null))[_0x428e('0x44')](handleError(_0x25354e,null));};exports[_0x428e('0x48')]=function(_0xd52d9f,_0x177c2f){return db[_0x428e('0x40')][_0x428e('0x48')](_0xd52d9f[_0x428e('0x49')],{})[_0x428e('0x28')](respondWithResult(_0x177c2f,0xc9))[_0x428e('0x44')](handleError(_0x177c2f,null));};exports['update']=function(_0x2c84fe,_0x45dd1d){if(_0x2c84fe['body']['id']){delete _0x2c84fe[_0x428e('0x49')]['id'];}return db['FreshsalesAccount'][_0x428e('0x47')]({'where':{'id':_0x2c84fe[_0x428e('0x4a')]['id']}})[_0x428e('0x28')](handleEntityNotFound(_0x45dd1d,null))[_0x428e('0x28')](saveUpdates(_0x2c84fe[_0x428e('0x49')],null))[_0x428e('0x28')](respondWithResult(_0x45dd1d,null))[_0x428e('0x44')](handleError(_0x45dd1d,null));};exports['destroy']=function(_0x232247,_0x5bce41){return db[_0x428e('0x40')][_0x428e('0x47')]({'where':{'id':_0x232247['params']['id']}})[_0x428e('0x28')](handleEntityNotFound(_0x5bce41,null))[_0x428e('0x28')](removeEntity(_0x5bce41,null))['catch'](handleError(_0x5bce41,null));};exports[_0x428e('0x4b')]=function(_0x2527eb,_0xffd22f,_0x404e48){var _0x11de3f={};var _0x4dcbbb={};var _0x49d2e6;var _0x3c993c;return db[_0x428e('0x40')][_0x428e('0x4c')]({'where':{'id':_0x2527eb['params']['id']}})['then'](handleEntityNotFound(_0xffd22f,null))[_0x428e('0x28')](function(_0x3a4e57){if(_0x3a4e57){_0x49d2e6=_0x3a4e57;_0x4dcbbb[_0x428e('0x2f')]=_[_0x428e('0x32')](db[_0x428e('0x4d')][_0x428e('0x2d')]);_0x4dcbbb[_0x428e('0x31')]=_[_0x428e('0x32')](_0x2527eb['query']);_0x4dcbbb[_0x428e('0x3b')]=_[_0x428e('0x33')](_0x4dcbbb['model'],_0x4dcbbb[_0x428e('0x31')]);_0x11de3f[_0x428e('0x34')]=_[_0x428e('0x33')](_0x4dcbbb[_0x428e('0x2f')],qs[_0x428e('0x35')](_0x2527eb['query'][_0x428e('0x35')]));_0x11de3f[_0x428e('0x34')]=_0x11de3f[_0x428e('0x34')][_0x428e('0x46')]?_0x11de3f[_0x428e('0x34')]:_0x4dcbbb[_0x428e('0x2f')];_0x11de3f['order']=qs['sort'](_0x2527eb['query'][_0x428e('0x39')]);_0x11de3f[_0x428e('0x3a')]=qs['filters'](_[_0x428e('0x4e')](_0x2527eb[_0x428e('0x31')],_0x4dcbbb[_0x428e('0x3b')]));if(_0x2527eb[_0x428e('0x31')]['filter']){_0x11de3f[_0x428e('0x3a')]=_[_0x428e('0x3d')](_0x11de3f[_0x428e('0x3a')],{'$or':_[_0x428e('0x30')](_0x11de3f['attributes'],function(_0xcbdaf5){var _0x20fb06={};_0x20fb06[_0xcbdaf5]={'$like':'%'+_0x2527eb[_0x428e('0x31')][_0x428e('0x3c')]+'%'};return _0x20fb06;})});}_0x11de3f=_[_0x428e('0x3d')]({},_0x11de3f,_0x2527eb[_0x428e('0x4f')]);return _0x49d2e6[_0x428e('0x4b')](_0x11de3f);}})[_0x428e('0x28')](function(_0x4093ff){if(_0x4093ff){_0x3c993c=_0x4093ff['length'];if(!_0x2527eb[_0x428e('0x31')][_0x428e('0x36')](_0x428e('0x37'))){_0x11de3f[_0x428e('0x21')]=qs[_0x428e('0x21')](_0x2527eb['query'][_0x428e('0x21')]);_0x11de3f['offset']=qs[_0x428e('0x1f')](_0x2527eb[_0x428e('0x31')][_0x428e('0x1f')]);}return _0x49d2e6[_0x428e('0x4b')](_0x11de3f);}})[_0x428e('0x28')](function(_0x416955){if(_0x416955){return _0x416955?{'count':_0x3c993c,'rows':_0x416955}:null;}})['then'](respondWithResult(_0xffd22f,null))[_0x428e('0x44')](handleError(_0xffd22f,null));};exports[_0x428e('0x50')]=function(_0x38a712,_0x260767,_0x3463b3){if(_0x38a712[_0x428e('0x49')]['id']){delete _0x38a712['body']['id'];}return db[_0x428e('0x40')]['findOne']({'where':{'id':_0x38a712[_0x428e('0x4a')]['id']}})[_0x428e('0x28')](handleEntityNotFound(_0x260767,null))[_0x428e('0x28')](function(_0x64bace){if(_0x64bace){_0x38a712[_0x428e('0x49')][_0x428e('0x51')]=_0x64bace['id'];_0x38a712[_0x428e('0x49')][_0x428e('0x52')]=integrations['getSubjects'](_0x38a712[_0x428e('0x49')][_0x428e('0x53')],_0x38a712[_0x428e('0x49')][_0x428e('0x3e')]);_0x38a712[_0x428e('0x49')][_0x428e('0x54')]=integrations[_0x428e('0x55')](_0x38a712[_0x428e('0x49')][_0x428e('0x53')],_0x38a712[_0x428e('0x49')][_0x428e('0x3e')]);return db[_0x428e('0x4d')][_0x428e('0x48')](_0x38a712[_0x428e('0x49')],{'include':[{'model':db[_0x428e('0x56')],'as':'Subjects'},{'model':db[_0x428e('0x56')],'as':_0x428e('0x54')}]});}return null;})[_0x428e('0x28')](respondWithResult(_0x260767,null))[_0x428e('0x44')](handleError(_0x260767,null));};exports[_0x428e('0x57')]=function(_0x263e75,_0x4bc266,_0x1ee031){var _0x158ccf='';var _0x50da15='';return db[_0x428e('0x40')][_0x428e('0x4c')]({'where':{'id':_0x263e75[_0x428e('0x4a')]['id']},'attributes':['id',_0x428e('0x58'),_0x428e('0x59'),'apiKey']})[_0x428e('0x28')](handleEntityNotFound(_0x4bc266,null))[_0x428e('0x28')](function(_0x1c9b65){if(_0x1c9b65){_0x50da15=_0x1c9b65[_0x428e('0x58')];_0x158ccf=_0x1c9b65[_0x428e('0x59')];var _0x55a9f9=_0x1c9b65['remoteUri'][_0x428e('0x5a')](-0x1);if(_0x55a9f9==='/'){_0x158ccf=_0x158ccf[_0x428e('0x5b')](0x0,_0x158ccf[_0x428e('0x5c')](_0x55a9f9));}return rp({'method':_0x428e('0x5d'),'uri':util[_0x428e('0x5e')](_0x428e('0x5f'),_0x158ccf,'/api/selector/owners'),'headers':{'Authorization':_0x428e('0x60')+_0x1c9b65[_0x428e('0x61')]},'json':!![]});}})[_0x428e('0x28')](function(_0x5d11d5){if(_0x5d11d5){var _0x1a3ba9=_0x5d11d5[_0x428e('0x62')];var _0xddc545=![];var _0x5e1878=null;for(_0x5e1878=0x0;_0x5e1878<_0x1a3ba9[_0x428e('0x46')];_0x5e1878++){if(_0x1a3ba9[_0x5e1878]['email']===_0x50da15){_0xddc545=!![];}}if(_0xddc545){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x428e('0x28')](respondWithResult(_0x4bc266,null))['catch'](function(_0x2a8f38){var _0x2cb6d4=_0x263e75[_0x428e('0x31')][_0x428e('0x63')]?0x1f4:_0x2a8f38[_0x428e('0x64')]||0x1f4;logger['error'](_0x428e('0x65'),'getFields',_0x2cb6d4,JSON[_0x428e('0x66')](_0x2a8f38));delete _0x2a8f38['name'];if(_0x2cb6d4===0x191){_0x2cb6d4=0x190;}_0x4bc266['status'](_0x2cb6d4)[_0x428e('0x67')](_0x263e75[_0x428e('0x31')][_0x428e('0x63')]?{'message':_0x428e('0x68'),'statusCode':_0x2a8f38[_0x428e('0x64')]}:_0x2a8f38);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index fafc589..b3d5ccf 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 _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x209f9c,_0x4ea385){var _0x13c1ef=function(_0x455599){while(--_0x455599){_0x209f9c['push'](_0x209f9c['shift']());}};_0x13c1ef(++_0x4ea385);}(_0xdb28,0x106));var _0x8db2=function(_0x4f3679,_0x3c93cc){_0x4f3679=_0x4f3679-0x0;var _0x8678a0=_0xdb28[_0x4f3679];return _0x8678a0;};'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 +var _0x57ca=['exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x57ca,0x108));var _0xa57c=function(_0x446869,_0x1bfc0c){_0x446869=_0x446869-0x0;var _0x2c9a3a=_0x57ca[_0x446869];return _0x2c9a3a;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));var integrations=require(_0xa57c('0x8'));module[_0xa57c('0x9')]=function(_0x19473f,_0xbdfffb){return _0x19473f[_0xa57c('0xa')](_0xa57c('0xb'),attributes,{'tableName':_0xa57c('0xc'),'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 a22562b..08c40dd 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 _0x627e=['request','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','raw','options','where','map','model','attributes','include','then','debug','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0xcf69e4,_0x22359f){var _0x3ae183=function(_0x34d0fc){while(--_0x34d0fc){_0xcf69e4['push'](_0xcf69e4['shift']());}};_0x3ae183(++_0x22359f);}(_0x627e,0x14a));var _0xe627=function(_0x1ea7cd,_0x512062){_0x1ea7cd=_0x1ea7cd-0x0;var _0xd78427=_0x627e[_0x1ea7cd];return _0xd78427;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});}exports[_0xe627('0x14')]=function(_0x56559b){var _0x2fe46a=this;return new Promise(function(_0x538b22,_0x24fddd){return db['FreshsalesAccount'][_0xe627('0x15')]({'raw':_0x56559b['options']?_0x56559b['options'][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x56559b['options']?_0x56559b[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x56559b['options']?_0x56559b['options']['attributes']||null:null,'limit':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['limit']||null:null,'include':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['include']?_[_0xe627('0x19')](_0x56559b[_0xe627('0x17')]['include'],function(_0x42f3d1){return{'model':db[_0x42f3d1[_0xe627('0x1a')]],'as':_0x42f3d1['as'],'attributes':_0x42f3d1[_0xe627('0x1b')],'include':_0x42f3d1['include']?_[_0xe627('0x19')](_0x42f3d1[_0xe627('0x1c')],function(_0x1a5081){return{'model':db[_0x1a5081[_0xe627('0x1a')]],'as':_0x1a5081['as'],'attributes':_0x1a5081['attributes'],'include':_0x1a5081[_0xe627('0x1c')]?_[_0xe627('0x19')](_0x1a5081[_0xe627('0x1c')],function(_0x29eb8e){return{'model':db[_0x29eb8e[_0xe627('0x1a')]],'as':_0x29eb8e['as'],'attributes':_0x29eb8e[_0xe627('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x44c9f7){logger[_0xe627('0xb')]('GetFreshsalesAccount',_0x56559b);logger[_0xe627('0x1e')]('GetFreshsalesAccount',_0x56559b,JSON['stringify'](_0x44c9f7));_0x538b22(_0x44c9f7);})[_0xe627('0x13')](function(_0xdf63c8){logger['error'](_0xe627('0x14'),_0xdf63c8['message'],_0x56559b);_0x24fddd(_0x2fe46a[_0xe627('0x10')](0x1f4,_0xdf63c8['message']));});});};exports[_0xe627('0x1f')]=function(_0x26833a){var _0x5d8992=this;return new Promise(function(_0x33e9dd,_0x4f92c9){return db[_0xe627('0x20')][_0xe627('0x21')]({'raw':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x1b')]||null:null,'include':_0x26833a['options']?_0x26833a['options'][_0xe627('0x1c')]?_['map'](_0x26833a[_0xe627('0x17')]['include'],function(_0x56d1d7){return{'model':db[_0x56d1d7[_0xe627('0x1a')]],'as':_0x56d1d7['as'],'attributes':_0x56d1d7['attributes'],'include':_0x56d1d7['include']?_[_0xe627('0x19')](_0x56d1d7[_0xe627('0x1c')],function(_0x55f001){return{'model':db[_0x55f001['model']],'as':_0x55f001['as'],'attributes':_0x55f001['attributes'],'include':_0x55f001['include']?_[_0xe627('0x19')](_0x55f001['include'],function(_0x39338c){return{'model':db[_0x39338c[_0xe627('0x1a')]],'as':_0x39338c['as'],'attributes':_0x39338c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x35a303){logger['info'](_0xe627('0x1f'),_0x26833a);logger[_0xe627('0x1e')](_0xe627('0x1f'),_0x26833a,JSON[_0xe627('0xf')](_0x35a303));_0x33e9dd(_0x35a303);})[_0xe627('0x13')](function(_0x28fd59){logger['error'](_0xe627('0x1f'),_0x28fd59['message'],_0x26833a);_0x4f92c9(_0x5d8992[_0xe627('0x10')](0x1f4,_0x28fd59['message']));});});}; \ No newline at end of file +var _0x01d9=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','ShowFreshsalesAccount','find','where','stringify','lodash','util','moment'];(function(_0x2ceed4,_0x25ccd9){var _0x1b3081=function(_0x2711ff){while(--_0x2711ff){_0x2ceed4['push'](_0x2ceed4['shift']());}};_0x1b3081(++_0x25ccd9);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});}exports[_0x901d('0x17')]=function(_0x285353){var _0x403db9=this;return new Promise(function(_0x38f42b,_0x414171){return db[_0x901d('0x18')][_0x901d('0x19')]({'raw':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1b')]===undefined?!![]:![]:!![],'where':_0x285353['options']?_0x285353['options']['where']||null:null,'attributes':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1c')]||null:null,'limit':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1d')]||null:null,'include':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1e')]?_[_0x901d('0x1f')](_0x285353[_0x901d('0x1a')][_0x901d('0x1e')],function(_0x1818d3){return{'model':db[_0x1818d3[_0x901d('0x20')]],'as':_0x1818d3['as'],'attributes':_0x1818d3[_0x901d('0x1c')],'include':_0x1818d3['include']?_[_0x901d('0x1f')](_0x1818d3[_0x901d('0x1e')],function(_0xbc89a5){return{'model':db[_0xbc89a5[_0x901d('0x20')]],'as':_0xbc89a5['as'],'attributes':_0xbc89a5['attributes'],'include':_0xbc89a5[_0x901d('0x1e')]?_[_0x901d('0x1f')](_0xbc89a5[_0x901d('0x1e')],function(_0x3cbe43){return{'model':db[_0x3cbe43[_0x901d('0x20')]],'as':_0x3cbe43['as'],'attributes':_0x3cbe43['attributes']};}):[]};}):[]};}):[]:[]})[_0x901d('0xd')](function(_0xc52d0f){logger[_0x901d('0xe')](_0x901d('0x17'),_0x285353);logger[_0x901d('0x11')](_0x901d('0x17'),_0x285353,JSON['stringify'](_0xc52d0f));_0x38f42b(_0xc52d0f);})[_0x901d('0x16')](function(_0x533038){logger[_0x901d('0x12')](_0x901d('0x17'),_0x533038[_0x901d('0x14')],_0x285353);_0x414171(_0x403db9[_0x901d('0x12')](0x1f4,_0x533038[_0x901d('0x14')]));});});};exports[_0x901d('0x21')]=function(_0x4137b7){var _0x115676=this;return new Promise(function(_0x530c4b,_0x336f28){return db[_0x901d('0x18')][_0x901d('0x22')]({'raw':_0x4137b7[_0x901d('0x1a')]?_0x4137b7[_0x901d('0x1a')][_0x901d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4137b7['options']?_0x4137b7[_0x901d('0x1a')][_0x901d('0x23')]||null:null,'attributes':_0x4137b7[_0x901d('0x1a')]?_0x4137b7['options'][_0x901d('0x1c')]||null:null,'include':_0x4137b7[_0x901d('0x1a')]?_0x4137b7[_0x901d('0x1a')][_0x901d('0x1e')]?_[_0x901d('0x1f')](_0x4137b7[_0x901d('0x1a')][_0x901d('0x1e')],function(_0x1b8d3){return{'model':db[_0x1b8d3[_0x901d('0x20')]],'as':_0x1b8d3['as'],'attributes':_0x1b8d3[_0x901d('0x1c')],'include':_0x1b8d3['include']?_['map'](_0x1b8d3[_0x901d('0x1e')],function(_0x4e66b4){return{'model':db[_0x4e66b4[_0x901d('0x20')]],'as':_0x4e66b4['as'],'attributes':_0x4e66b4[_0x901d('0x1c')],'include':_0x4e66b4['include']?_[_0x901d('0x1f')](_0x4e66b4[_0x901d('0x1e')],function(_0x2f5e22){return{'model':db[_0x2f5e22['model']],'as':_0x2f5e22['as'],'attributes':_0x2f5e22[_0x901d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x901d('0xd')](function(_0x1a1f9c){logger[_0x901d('0xe')](_0x901d('0x21'),_0x4137b7);logger[_0x901d('0x11')](_0x901d('0x21'),_0x4137b7,JSON[_0x901d('0x24')](_0x1a1f9c));_0x530c4b(_0x1a1f9c);})[_0x901d('0x16')](function(_0x384d82){logger[_0x901d('0x12')](_0x901d('0x21'),_0x384d82[_0x901d('0x14')],_0x4137b7);_0x336f28(_0x115676[_0x901d('0x12')](0x1f4,_0x384d82[_0x901d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 301f9df..4ec42b0 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 _0xc8a9=['isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x3c3603,_0xb16e87){var _0x588811=function(_0x1b27f3){while(--_0x1b27f3){_0x3c3603['push'](_0x3c3603['shift']());}};_0x588811(++_0xb16e87);}(_0xc8a9,0x1da));var _0x9c8a=function(_0x340f57,_0x41e0ac){_0x340f57=_0x340f57-0x0;var _0x5bd435=_0xc8a9[_0x340f57];return _0x5bd435;};'use strict';var multer=require(_0x9c8a('0x0'));var util=require(_0x9c8a('0x1'));var path=require(_0x9c8a('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c8a('0x3'));var router=express[_0x9c8a('0x4')]();var fs_extra=require(_0x9c8a('0x5'));var auth=require(_0x9c8a('0x6'));var interaction=require(_0x9c8a('0x7'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0x9c8a('0x8')]('/',auth[_0x9c8a('0x9')](),controller[_0x9c8a('0xa')]);router[_0x9c8a('0x8')](_0x9c8a('0xb'),auth['isAuthenticated'](),controller[_0x9c8a('0xc')]);router[_0x9c8a('0x8')]('/:id/subjects',auth[_0x9c8a('0x9')](),controller[_0x9c8a('0xd')]);router['get'](_0x9c8a('0xe'),auth[_0x9c8a('0x9')](),controller[_0x9c8a('0xf')]);router[_0x9c8a('0x8')](_0x9c8a('0x10'),auth[_0x9c8a('0x9')](),controller[_0x9c8a('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9c8a('0x12')]);router[_0x9c8a('0x13')](_0x9c8a('0xb'),auth[_0x9c8a('0x9')](),controller[_0x9c8a('0x14')]);router['delete']('/:id',auth[_0x9c8a('0x9')](),controller[_0x9c8a('0x15')]);module[_0x9c8a('0x16')]=router; \ No newline at end of file +var _0xc412=['getDescriptions','/:id/fields','post','create','put','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions'];(function(_0x5e3f55,_0x2d0ff3){var _0x10411f=function(_0xcc903b){while(--_0xcc903b){_0x5e3f55['push'](_0x5e3f55['shift']());}};_0x10411f(++_0x2d0ff3);}(_0xc412,0x1d6));var _0x2c41=function(_0x298b79,_0x43534d){_0x298b79=_0x298b79-0x0;var _0x2c8b35=_0xc412[_0x298b79];return _0x2c8b35;};'use strict';var multer=require(_0x2c41('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2c41('0x1'));var router=express[_0x2c41('0x2')]();var fs_extra=require(_0x2c41('0x3'));var auth=require(_0x2c41('0x4'));var interaction=require(_0x2c41('0x5'));var config=require(_0x2c41('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x2c41('0x7')]('/',auth[_0x2c41('0x8')](),controller[_0x2c41('0x9')]);router['get'](_0x2c41('0xa'),auth['isAuthenticated'](),controller[_0x2c41('0xb')]);router[_0x2c41('0x7')]('/:id/subjects',auth[_0x2c41('0x8')](),controller[_0x2c41('0xc')]);router['get'](_0x2c41('0xd'),auth[_0x2c41('0x8')](),controller[_0x2c41('0xe')]);router[_0x2c41('0x7')](_0x2c41('0xf'),auth[_0x2c41('0x8')](),controller['getFields']);router[_0x2c41('0x10')]('/',auth[_0x2c41('0x8')](),controller[_0x2c41('0x11')]);router[_0x2c41('0x12')](_0x2c41('0xa'),auth[_0x2c41('0x8')](),controller['update']);router[_0x2c41('0x13')](_0x2c41('0xa'),auth[_0x2c41('0x8')](),controller[_0x2c41('0x14')]);module[_0x2c41('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index a9cab9c..5aba68a 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 _0xe519=['STRING','sequelize','exports'];(function(_0x51e838,_0x3e066a){var _0x4983e7=function(_0x3d5a95){while(--_0x3d5a95){_0x51e838['push'](_0x51e838['shift']());}};_0x4983e7(++_0x3e066a);}(_0xe519,0x1d8));var _0x9e51=function(_0x3dbc19,_0x66da4){_0x3dbc19=_0x3dbc19-0x0;var _0x1b0df2=_0xe519[_0x3dbc19];return _0x1b0df2;};'use strict';var Sequelize=require(_0x9e51('0x0'));module[_0x9e51('0x1')]={'name':{'type':Sequelize[_0x9e51('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa7c3=['exports','STRING'];(function(_0x5aa2ed,_0x2836b4){var _0x26f014=function(_0x2f6ca4){while(--_0x2f6ca4){_0x5aa2ed['push'](_0x5aa2ed['shift']());}};_0x26f014(++_0x2836b4);}(_0xa7c3,0x1ea));var _0x3a7c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa7c3[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x3a7c('0x0')]={'name':{'type':Sequelize[_0x3a7c('0x1')]},'description':{'type':Sequelize[_0x3a7c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 153545a..a0d14fb 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 _0x853e=['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','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesConfiguration','include','findAll','show','params','intersection','find','catch','create','body','getSubjects','findOne','FreshsalesField','order','getFields','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0x853e,0x93));var _0xe853=function(_0x1351d2,_0x5ce945){_0x1351d2=_0x1351d2-0x0;var _0x4412ad=_0x853e[_0x1351d2];return _0x4412ad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe853('0x0'));var jsonpatch=require(_0xe853('0x1'));var rp=require(_0xe853('0x2'));var moment=require(_0xe853('0x3'));var BPromise=require(_0xe853('0x4'));var Mustache=require(_0xe853('0x5'));var util=require(_0xe853('0x6'));var path=require(_0xe853('0x7'));var sox=require(_0xe853('0x8'));var csv=require(_0xe853('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe853('0xa'));var _=require(_0xe853('0xb'));var squel=require(_0xe853('0xc'));var crypto=require('crypto');var jsforce=require(_0xe853('0xd'));var deskjs=require(_0xe853('0xe'));var toCsv=require(_0xe853('0x9'));var querystring=require(_0xe853('0xf'));var Papa=require(_0xe853('0x10'));var Redis=require(_0xe853('0x11'));var authService=require(_0xe853('0x12'));var qs=require(_0xe853('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe853('0x14'));var logger=require(_0xe853('0x15'))(_0xe853('0x16'));var utils=require(_0xe853('0x17'));var config=require(_0xe853('0x18'));var licenseUtil=require(_0xe853('0x19'));var db=require(_0xe853('0x1a'))['db'];function respondWithStatusCode(_0x324c6e,_0x38c1c8){_0x38c1c8=_0x38c1c8||0xcc;return function(_0x2d2ba9){if(_0x2d2ba9){return _0x324c6e[_0xe853('0x1b')](_0x38c1c8);}return _0x324c6e[_0xe853('0x1c')](_0x38c1c8)[_0xe853('0x1d')]();};}function respondWithResult(_0x5e593f,_0x3f4efb){_0x3f4efb=_0x3f4efb||0xc8;return function(_0x1f85eb){if(_0x1f85eb){return _0x5e593f[_0xe853('0x1c')](_0x3f4efb)[_0xe853('0x1e')](_0x1f85eb);}};}function respondWithFilteredResult(_0x3f4cd7,_0x20f1c1){return function(_0x3f5bfb){if(_0x3f5bfb){var _0x4c282d=typeof _0x20f1c1[_0xe853('0x1f')]===_0xe853('0x20')&&typeof _0x20f1c1[_0xe853('0x21')]===_0xe853('0x20');var _0x17eab4=_0x3f5bfb['count'];var _0x32072f=_0x4c282d?0x0:_0x20f1c1[_0xe853('0x1f')];var _0xe1ed33=_0x4c282d?_0x3f5bfb[_0xe853('0x22')]:_0x20f1c1[_0xe853('0x1f')]+_0x20f1c1[_0xe853('0x21')];var _0x34832d;if(_0xe1ed33>=_0x17eab4){_0xe1ed33=_0x17eab4;_0x34832d=0xc8;}else{_0x34832d=0xce;}_0x3f4cd7['status'](_0x34832d);return _0x3f4cd7['set'](_0xe853('0x23'),_0x32072f+'-'+_0xe1ed33+'/'+_0x17eab4)['json'](_0x3f5bfb);}return null;};}function patchUpdates(_0x5debca){return function(_0x495121){try{jsonpatch[_0xe853('0x24')](_0x495121,_0x5debca,!![]);}catch(_0x53f35a){return BPromise[_0xe853('0x25')](_0x53f35a);}return _0x495121[_0xe853('0x26')]();};}function saveUpdates(_0x486d78,_0x21584e){return function(_0x39e074){if(_0x39e074){return _0x39e074[_0xe853('0x27')](_0x486d78)[_0xe853('0x28')](function(_0x5cae3f){return _0x5cae3f;});}return null;};}function removeEntity(_0x529076,_0x37af61){return function(_0x3da3ce){if(_0x3da3ce){return _0x3da3ce[_0xe853('0x29')]()['then'](function(){_0x529076[_0xe853('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x575607,_0x9285f9){return function(_0x3f1d64){if(!_0x3f1d64){_0x575607[_0xe853('0x1b')](0x194);}return _0x3f1d64;};}function handleError(_0x17a26c,_0x169cce){_0x169cce=_0x169cce||0x1f4;return function(_0x549874){logger[_0xe853('0x2a')](_0x549874['stack']);if(_0x549874[_0xe853('0x2b')]){delete _0x549874[_0xe853('0x2b')];}_0x17a26c[_0xe853('0x1c')](_0x169cce)['send'](_0x549874);};}exports['index']=function(_0x87c6a5,_0x11b3e0){var _0x1ffe79={},_0x15497a={},_0x363758={'count':0x0,'rows':[]};var _0x4df92b=_['map'](db['FreshsalesConfiguration'][_0xe853('0x2c')],function(_0x10e277){return{'name':_0x10e277[_0xe853('0x2d')],'type':_0x10e277[_0xe853('0x2e')]['key']};});_0x15497a[_0xe853('0x2f')]=_[_0xe853('0x30')](_0x4df92b,_0xe853('0x2b'));_0x15497a[_0xe853('0x31')]=_[_0xe853('0x32')](_0x87c6a5[_0xe853('0x31')]);_0x15497a[_0xe853('0x33')]=_['intersection'](_0x15497a[_0xe853('0x2f')],_0x15497a[_0xe853('0x31')]);_0x1ffe79[_0xe853('0x34')]=_['intersection'](_0x15497a[_0xe853('0x2f')],qs[_0xe853('0x35')](_0x87c6a5[_0xe853('0x31')][_0xe853('0x35')]));_0x1ffe79['attributes']=_0x1ffe79[_0xe853('0x34')][_0xe853('0x36')]?_0x1ffe79['attributes']:_0x15497a['model'];if(!_0x87c6a5['query'][_0xe853('0x37')](_0xe853('0x38'))){_0x1ffe79[_0xe853('0x21')]=qs[_0xe853('0x21')](_0x87c6a5['query'][_0xe853('0x21')]);_0x1ffe79[_0xe853('0x1f')]=qs[_0xe853('0x1f')](_0x87c6a5[_0xe853('0x31')][_0xe853('0x1f')]);}_0x1ffe79['order']=qs[_0xe853('0x39')](_0x87c6a5[_0xe853('0x31')][_0xe853('0x39')]);_0x1ffe79[_0xe853('0x3a')]=qs[_0xe853('0x33')](_[_0xe853('0x3b')](_0x87c6a5[_0xe853('0x31')],_0x15497a[_0xe853('0x33')]),_0x4df92b);if(_0x87c6a5['query'][_0xe853('0x3c')]){_0x1ffe79[_0xe853('0x3a')]=_[_0xe853('0x3d')](_0x1ffe79[_0xe853('0x3a')],{'$or':_['map'](_0x4df92b,function(_0x35d0f3){if(_0x35d0f3[_0xe853('0x2e')]!==_0xe853('0x3e')){var _0x2e7f73={};_0x2e7f73[_0x35d0f3['name']]={'$like':'%'+_0x87c6a5[_0xe853('0x31')]['filter']+'%'};return _0x2e7f73;}})});}_0x1ffe79=_[_0xe853('0x3d')]({},_0x1ffe79,_0x87c6a5[_0xe853('0x3f')]);var _0x4e7d40={'where':_0x1ffe79[_0xe853('0x3a')]};return db[_0xe853('0x40')]['count'](_0x4e7d40)[_0xe853('0x28')](function(_0xbd1745){_0x363758[_0xe853('0x22')]=_0xbd1745;if(_0x87c6a5[_0xe853('0x31')]['includeAll']){_0x1ffe79[_0xe853('0x41')]=[{'all':!![]}];}return db[_0xe853('0x40')][_0xe853('0x42')](_0x1ffe79);})[_0xe853('0x28')](function(_0x82fd73){_0x363758['rows']=_0x82fd73;return _0x363758;})[_0xe853('0x28')](respondWithFilteredResult(_0x11b3e0,_0x1ffe79))['catch'](handleError(_0x11b3e0,null));};exports[_0xe853('0x43')]=function(_0x414034,_0x274db8){var _0x5ad50a={'raw':![],'where':{'id':_0x414034[_0xe853('0x44')]['id']}},_0x789e1d={};_0x789e1d['model']=_[_0xe853('0x32')](db[_0xe853('0x40')]['rawAttributes']);_0x789e1d[_0xe853('0x31')]=_[_0xe853('0x32')](_0x414034[_0xe853('0x31')]);_0x789e1d[_0xe853('0x33')]=_[_0xe853('0x45')](_0x789e1d[_0xe853('0x2f')],_0x789e1d[_0xe853('0x31')]);_0x5ad50a[_0xe853('0x34')]=_[_0xe853('0x45')](_0x789e1d[_0xe853('0x2f')],qs['fields'](_0x414034[_0xe853('0x31')][_0xe853('0x35')]));_0x5ad50a['attributes']=_0x5ad50a['attributes']['length']?_0x5ad50a['attributes']:_0x789e1d[_0xe853('0x2f')];if(_0x414034[_0xe853('0x31')]['includeAll']){_0x5ad50a[_0xe853('0x41')]=[{'all':!![]}];}_0x5ad50a=_[_0xe853('0x3d')]({},_0x5ad50a,_0x414034[_0xe853('0x3f')]);return db[_0xe853('0x40')][_0xe853('0x46')](_0x5ad50a)[_0xe853('0x28')](handleEntityNotFound(_0x274db8,null))['then'](respondWithResult(_0x274db8,null))[_0xe853('0x47')](handleError(_0x274db8,null));};exports['create']=function(_0x46fcd6,_0x3fb95a){return db[_0xe853('0x40')][_0xe853('0x48')](_0x46fcd6[_0xe853('0x49')],{})[_0xe853('0x28')](respondWithResult(_0x3fb95a,0xc9))[_0xe853('0x47')](handleError(_0x3fb95a,null));};exports[_0xe853('0x27')]=function(_0x7f7e1,_0x35be0d){if(_0x7f7e1['body']['id']){delete _0x7f7e1[_0xe853('0x49')]['id'];}return db[_0xe853('0x40')][_0xe853('0x46')]({'where':{'id':_0x7f7e1[_0xe853('0x44')]['id']}})[_0xe853('0x28')](handleEntityNotFound(_0x35be0d,null))[_0xe853('0x28')](saveUpdates(_0x7f7e1[_0xe853('0x49')],null))[_0xe853('0x28')](respondWithResult(_0x35be0d,null))[_0xe853('0x47')](handleError(_0x35be0d,null));};exports['destroy']=function(_0x4226c9,_0xa5b464){return db[_0xe853('0x40')]['find']({'where':{'id':_0x4226c9['params']['id']}})['then'](handleEntityNotFound(_0xa5b464,null))['then'](removeEntity(_0xa5b464,null))['catch'](handleError(_0xa5b464,null));};exports[_0xe853('0x4a')]=function(_0x16a586,_0x1f0cdf,_0x11ba42){var _0x56339d={};var _0x70c8db={};var _0x3b42ae;var _0x2d77d5;return db[_0xe853('0x40')][_0xe853('0x4b')]({'where':{'id':_0x16a586['params']['id']}})[_0xe853('0x28')](handleEntityNotFound(_0x1f0cdf,null))[_0xe853('0x28')](function(_0x3f4d34){if(_0x3f4d34){_0x3b42ae=_0x3f4d34;_0x70c8db[_0xe853('0x2f')]=_['keys'](db[_0xe853('0x4c')][_0xe853('0x2c')]);_0x70c8db['query']=_['keys'](_0x16a586[_0xe853('0x31')]);_0x70c8db[_0xe853('0x33')]=_[_0xe853('0x45')](_0x70c8db[_0xe853('0x2f')],_0x70c8db[_0xe853('0x31')]);_0x56339d[_0xe853('0x34')]=_['intersection'](_0x70c8db[_0xe853('0x2f')],qs['fields'](_0x16a586[_0xe853('0x31')][_0xe853('0x35')]));_0x56339d[_0xe853('0x34')]=_0x56339d['attributes'][_0xe853('0x36')]?_0x56339d['attributes']:_0x70c8db[_0xe853('0x2f')];_0x56339d[_0xe853('0x4d')]=qs[_0xe853('0x39')](_0x16a586[_0xe853('0x31')][_0xe853('0x39')]);_0x56339d[_0xe853('0x3a')]=qs[_0xe853('0x33')](_[_0xe853('0x3b')](_0x16a586[_0xe853('0x31')],_0x70c8db['filters']));if(_0x16a586[_0xe853('0x31')]['filter']){_0x56339d[_0xe853('0x3a')]=_[_0xe853('0x3d')](_0x56339d[_0xe853('0x3a')],{'$or':_[_0xe853('0x30')](_0x56339d[_0xe853('0x34')],function(_0x5d3323){var _0x220941={};_0x220941[_0x5d3323]={'$like':'%'+_0x16a586['query'][_0xe853('0x3c')]+'%'};return _0x220941;})});}_0x56339d=_[_0xe853('0x3d')]({},_0x56339d,_0x16a586['options']);return _0x3b42ae[_0xe853('0x4a')](_0x56339d);}})[_0xe853('0x28')](function(_0xe37ce8){if(_0xe37ce8){_0x2d77d5=_0xe37ce8[_0xe853('0x36')];if(!_0x16a586[_0xe853('0x31')][_0xe853('0x37')](_0xe853('0x38'))){_0x56339d[_0xe853('0x21')]=qs[_0xe853('0x21')](_0x16a586[_0xe853('0x31')]['limit']);_0x56339d[_0xe853('0x1f')]=qs[_0xe853('0x1f')](_0x16a586[_0xe853('0x31')][_0xe853('0x1f')]);}return _0x3b42ae[_0xe853('0x4a')](_0x56339d);}})[_0xe853('0x28')](function(_0x146679){if(_0x146679){return _0x146679?{'count':_0x2d77d5,'rows':_0x146679}:null;}})[_0xe853('0x28')](respondWithResult(_0x1f0cdf,null))[_0xe853('0x47')](handleError(_0x1f0cdf,null));};exports['getDescriptions']=function(_0x11d431,_0x4cbf7f,_0x16af41){var _0x1cba43={};var _0x886cc9={};var _0x3943d7;var _0x5f5b7a;return db[_0xe853('0x40')][_0xe853('0x4b')]({'where':{'id':_0x11d431[_0xe853('0x44')]['id']}})[_0xe853('0x28')](handleEntityNotFound(_0x4cbf7f,null))[_0xe853('0x28')](function(_0x4d0d72){if(_0x4d0d72){_0x3943d7=_0x4d0d72;_0x886cc9[_0xe853('0x2f')]=_[_0xe853('0x32')](db[_0xe853('0x4c')][_0xe853('0x2c')]);_0x886cc9['query']=_[_0xe853('0x32')](_0x11d431[_0xe853('0x31')]);_0x886cc9[_0xe853('0x33')]=_['intersection'](_0x886cc9[_0xe853('0x2f')],_0x886cc9[_0xe853('0x31')]);_0x1cba43[_0xe853('0x34')]=_[_0xe853('0x45')](_0x886cc9['model'],qs[_0xe853('0x35')](_0x11d431[_0xe853('0x31')][_0xe853('0x35')]));_0x1cba43[_0xe853('0x34')]=_0x1cba43[_0xe853('0x34')][_0xe853('0x36')]?_0x1cba43[_0xe853('0x34')]:_0x886cc9[_0xe853('0x2f')];_0x1cba43[_0xe853('0x4d')]=qs[_0xe853('0x39')](_0x11d431[_0xe853('0x31')][_0xe853('0x39')]);_0x1cba43[_0xe853('0x3a')]=qs[_0xe853('0x33')](_[_0xe853('0x3b')](_0x11d431['query'],_0x886cc9['filters']));if(_0x11d431[_0xe853('0x31')]['filter']){_0x1cba43[_0xe853('0x3a')]=_[_0xe853('0x3d')](_0x1cba43['where'],{'$or':_[_0xe853('0x30')](_0x1cba43['attributes'],function(_0x4d73d7){var _0x1a3279={};_0x1a3279[_0x4d73d7]={'$like':'%'+_0x11d431[_0xe853('0x31')][_0xe853('0x3c')]+'%'};return _0x1a3279;})});}_0x1cba43=_[_0xe853('0x3d')]({},_0x1cba43,_0x11d431[_0xe853('0x3f')]);return _0x3943d7['getDescriptions'](_0x1cba43);}})[_0xe853('0x28')](function(_0x22cb4b){if(_0x22cb4b){_0x5f5b7a=_0x22cb4b[_0xe853('0x36')];if(!_0x11d431[_0xe853('0x31')][_0xe853('0x37')](_0xe853('0x38'))){_0x1cba43[_0xe853('0x21')]=qs['limit'](_0x11d431[_0xe853('0x31')][_0xe853('0x21')]);_0x1cba43[_0xe853('0x1f')]=qs[_0xe853('0x1f')](_0x11d431[_0xe853('0x31')][_0xe853('0x1f')]);}return _0x3943d7['getDescriptions'](_0x1cba43);}})['then'](function(_0x312dae){if(_0x312dae){return _0x312dae?{'count':_0x5f5b7a,'rows':_0x312dae}:null;}})[_0xe853('0x28')](respondWithResult(_0x4cbf7f,null))['catch'](handleError(_0x4cbf7f,null));};exports[_0xe853('0x4e')]=function(_0x413fb2,_0x589d44,_0x25e0a4){var _0xd1ca92={};var _0x4bf877={};var _0x5def41;var _0x3ade92;return db[_0xe853('0x40')]['findOne']({'where':{'id':_0x413fb2['params']['id']}})[_0xe853('0x28')](handleEntityNotFound(_0x589d44,null))[_0xe853('0x28')](function(_0x2c1d77){if(_0x2c1d77){_0x5def41=_0x2c1d77;_0x4bf877[_0xe853('0x2f')]=_['keys'](db['FreshsalesField'][_0xe853('0x2c')]);_0x4bf877[_0xe853('0x31')]=_[_0xe853('0x32')](_0x413fb2['query']);_0x4bf877[_0xe853('0x33')]=_['intersection'](_0x4bf877[_0xe853('0x2f')],_0x4bf877[_0xe853('0x31')]);_0xd1ca92[_0xe853('0x34')]=_['intersection'](_0x4bf877['model'],qs[_0xe853('0x35')](_0x413fb2['query'][_0xe853('0x35')]));_0xd1ca92[_0xe853('0x34')]=_0xd1ca92['attributes'][_0xe853('0x36')]?_0xd1ca92[_0xe853('0x34')]:_0x4bf877[_0xe853('0x2f')];_0xd1ca92[_0xe853('0x4d')]=qs[_0xe853('0x39')](_0x413fb2['query'][_0xe853('0x39')]);_0xd1ca92[_0xe853('0x3a')]=qs[_0xe853('0x33')](_[_0xe853('0x3b')](_0x413fb2[_0xe853('0x31')],_0x4bf877[_0xe853('0x33')]));if(_0x413fb2[_0xe853('0x31')][_0xe853('0x3c')]){_0xd1ca92[_0xe853('0x3a')]=_[_0xe853('0x3d')](_0xd1ca92[_0xe853('0x3a')],{'$or':_['map'](_0xd1ca92['attributes'],function(_0x19c7b0){var _0x18a655={};_0x18a655[_0x19c7b0]={'$like':'%'+_0x413fb2[_0xe853('0x31')][_0xe853('0x3c')]+'%'};return _0x18a655;})});}_0xd1ca92=_[_0xe853('0x3d')]({},_0xd1ca92,_0x413fb2[_0xe853('0x3f')]);return _0x5def41[_0xe853('0x4e')](_0xd1ca92);}})[_0xe853('0x28')](function(_0x301e07){if(_0x301e07){_0x3ade92=_0x301e07[_0xe853('0x36')];if(!_0x413fb2[_0xe853('0x31')]['hasOwnProperty'](_0xe853('0x38'))){_0xd1ca92['limit']=qs[_0xe853('0x21')](_0x413fb2[_0xe853('0x31')][_0xe853('0x21')]);_0xd1ca92['offset']=qs[_0xe853('0x1f')](_0x413fb2[_0xe853('0x31')]['offset']);}return _0x5def41[_0xe853('0x4e')](_0xd1ca92);}})[_0xe853('0x28')](function(_0x4e5c4d){if(_0x4e5c4d){return _0x4e5c4d?{'count':_0x3ade92,'rows':_0x4e5c4d}:null;}})[_0xe853('0x28')](respondWithResult(_0x589d44,null))[_0xe853('0x47')](handleError(_0x589d44,null));}; \ No newline at end of file +var _0xb8ab=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','FreshsalesConfiguration','rawAttributes','type','key','map','query','keys','intersection','model','fields','length','attributes','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getSubjects','findOne','FreshsalesField','nolimit','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0xb8ab,0x96));var _0xbb8a=function(_0x210418,_0x5e9db4){_0x210418=_0x210418-0x0;var _0x5f6ae=_0xb8ab[_0x210418];return _0x5f6ae;};'use strict';var emlformat=require(_0xbb8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb8a('0x1'));var jsonpatch=require(_0xbb8a('0x2'));var rp=require(_0xbb8a('0x3'));var moment=require(_0xbb8a('0x4'));var BPromise=require(_0xbb8a('0x5'));var Mustache=require(_0xbb8a('0x6'));var util=require(_0xbb8a('0x7'));var path=require(_0xbb8a('0x8'));var sox=require(_0xbb8a('0x9'));var csv=require(_0xbb8a('0xa'));var ejs=require(_0xbb8a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb8a('0xc'));var squel=require(_0xbb8a('0xd'));var crypto=require(_0xbb8a('0xe'));var jsforce=require(_0xbb8a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbb8a('0xa'));var querystring=require(_0xbb8a('0x10'));var Papa=require(_0xbb8a('0x11'));var Redis=require('ioredis');var authService=require(_0xbb8a('0x12'));var qs=require(_0xbb8a('0x13'));var as=require(_0xbb8a('0x14'));var hardwareService=require(_0xbb8a('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xbb8a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb8a('0x17'));var db=require(_0xbb8a('0x18'))['db'];function respondWithStatusCode(_0x85b815,_0x54271e){_0x54271e=_0x54271e||0xcc;return function(_0x321b5c){if(_0x321b5c){return _0x85b815[_0xbb8a('0x19')](_0x54271e);}return _0x85b815[_0xbb8a('0x1a')](_0x54271e)['end']();};}function respondWithResult(_0x5ac7a8,_0x20673a){_0x20673a=_0x20673a||0xc8;return function(_0x343452){if(_0x343452){return _0x5ac7a8[_0xbb8a('0x1a')](_0x20673a)[_0xbb8a('0x1b')](_0x343452);}};}function respondWithFilteredResult(_0x49f670,_0x5ed1fa){return function(_0x1d4531){if(_0x1d4531){var _0x539060=typeof _0x5ed1fa[_0xbb8a('0x1c')]===_0xbb8a('0x1d')&&typeof _0x5ed1fa[_0xbb8a('0x1e')]===_0xbb8a('0x1d');var _0x1edc89=_0x1d4531[_0xbb8a('0x1f')];var _0x1e755d=_0x539060?0x0:_0x5ed1fa[_0xbb8a('0x1c')];var _0x23393f=_0x539060?_0x1d4531[_0xbb8a('0x1f')]:_0x5ed1fa['offset']+_0x5ed1fa[_0xbb8a('0x1e')];var _0x44e537;if(_0x23393f>=_0x1edc89){_0x23393f=_0x1edc89;_0x44e537=0xc8;}else{_0x44e537=0xce;}_0x49f670[_0xbb8a('0x1a')](_0x44e537);return _0x49f670[_0xbb8a('0x20')](_0xbb8a('0x21'),_0x1e755d+'-'+_0x23393f+'/'+_0x1edc89)[_0xbb8a('0x1b')](_0x1d4531);}return null;};}function patchUpdates(_0x160519){return function(_0x327c94){try{jsonpatch[_0xbb8a('0x22')](_0x327c94,_0x160519,!![]);}catch(_0x3f33d5){return BPromise[_0xbb8a('0x23')](_0x3f33d5);}return _0x327c94[_0xbb8a('0x24')]();};}function saveUpdates(_0x559050,_0x2fbf75){return function(_0x56a037){if(_0x56a037){return _0x56a037[_0xbb8a('0x25')](_0x559050)[_0xbb8a('0x26')](function(_0x3af278){return _0x3af278;});}return null;};}function removeEntity(_0x1d1c11,_0x2b1885){return function(_0x8714b2){if(_0x8714b2){return _0x8714b2['destroy']()[_0xbb8a('0x26')](function(){_0x1d1c11[_0xbb8a('0x1a')](0xcc)[_0xbb8a('0x27')]();});}};}function handleEntityNotFound(_0x580e39,_0x475116){return function(_0x34f869){if(!_0x34f869){_0x580e39[_0xbb8a('0x19')](0x194);}return _0x34f869;};}function handleError(_0x187769,_0x317925){_0x317925=_0x317925||0x1f4;return function(_0x55a688){logger[_0xbb8a('0x28')](_0x55a688[_0xbb8a('0x29')]);if(_0x55a688['name']){delete _0x55a688[_0xbb8a('0x2a')];}_0x187769['status'](_0x317925)[_0xbb8a('0x2b')](_0x55a688);};}exports['index']=function(_0x58cedd,_0x4ab849){var _0x1031d8={},_0x1b3b80={},_0x1809da={'count':0x0,'rows':[]};var _0x4fa956=_['map'](db[_0xbb8a('0x2c')][_0xbb8a('0x2d')],function(_0x3a31b0){return{'name':_0x3a31b0['fieldName'],'type':_0x3a31b0[_0xbb8a('0x2e')][_0xbb8a('0x2f')]};});_0x1b3b80['model']=_[_0xbb8a('0x30')](_0x4fa956,'name');_0x1b3b80[_0xbb8a('0x31')]=_[_0xbb8a('0x32')](_0x58cedd[_0xbb8a('0x31')]);_0x1b3b80['filters']=_[_0xbb8a('0x33')](_0x1b3b80[_0xbb8a('0x34')],_0x1b3b80[_0xbb8a('0x31')]);_0x1031d8['attributes']=_['intersection'](_0x1b3b80[_0xbb8a('0x34')],qs[_0xbb8a('0x35')](_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x35')]));_0x1031d8['attributes']=_0x1031d8['attributes'][_0xbb8a('0x36')]?_0x1031d8[_0xbb8a('0x37')]:_0x1b3b80['model'];if(!_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x38')]('nolimit')){_0x1031d8[_0xbb8a('0x1e')]=qs[_0xbb8a('0x1e')](_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x1e')]);_0x1031d8['offset']=qs[_0xbb8a('0x1c')](_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x1c')]);}_0x1031d8[_0xbb8a('0x39')]=qs[_0xbb8a('0x3a')](_0x58cedd[_0xbb8a('0x31')]['sort']);_0x1031d8['where']=qs[_0xbb8a('0x3b')](_[_0xbb8a('0x3c')](_0x58cedd['query'],_0x1b3b80['filters']),_0x4fa956);if(_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x3d')]){_0x1031d8[_0xbb8a('0x3e')]=_[_0xbb8a('0x3f')](_0x1031d8[_0xbb8a('0x3e')],{'$or':_[_0xbb8a('0x30')](_0x4fa956,function(_0x21dd9d){if(_0x21dd9d[_0xbb8a('0x2e')]!==_0xbb8a('0x40')){var _0x373c92={};_0x373c92[_0x21dd9d[_0xbb8a('0x2a')]]={'$like':'%'+_0x58cedd['query']['filter']+'%'};return _0x373c92;}})});}_0x1031d8=_[_0xbb8a('0x3f')]({},_0x1031d8,_0x58cedd['options']);var _0x37b257={'where':_0x1031d8[_0xbb8a('0x3e')]};return db['FreshsalesConfiguration'][_0xbb8a('0x1f')](_0x37b257)[_0xbb8a('0x26')](function(_0x3ed575){_0x1809da[_0xbb8a('0x1f')]=_0x3ed575;if(_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x41')]){_0x1031d8[_0xbb8a('0x42')]=[{'all':!![]}];}return db[_0xbb8a('0x2c')][_0xbb8a('0x43')](_0x1031d8);})[_0xbb8a('0x26')](function(_0x455f9a){_0x1809da[_0xbb8a('0x44')]=_0x455f9a;return _0x1809da;})[_0xbb8a('0x26')](respondWithFilteredResult(_0x4ab849,_0x1031d8))[_0xbb8a('0x45')](handleError(_0x4ab849,null));};exports[_0xbb8a('0x46')]=function(_0x410dc0,_0x3e68fd){var _0x9fd113={'raw':![],'where':{'id':_0x410dc0[_0xbb8a('0x47')]['id']}},_0x5bd663={};_0x5bd663[_0xbb8a('0x34')]=_[_0xbb8a('0x32')](db[_0xbb8a('0x2c')][_0xbb8a('0x2d')]);_0x5bd663[_0xbb8a('0x31')]=_[_0xbb8a('0x32')](_0x410dc0[_0xbb8a('0x31')]);_0x5bd663[_0xbb8a('0x3b')]=_[_0xbb8a('0x33')](_0x5bd663[_0xbb8a('0x34')],_0x5bd663[_0xbb8a('0x31')]);_0x9fd113[_0xbb8a('0x37')]=_[_0xbb8a('0x33')](_0x5bd663[_0xbb8a('0x34')],qs[_0xbb8a('0x35')](_0x410dc0['query'][_0xbb8a('0x35')]));_0x9fd113['attributes']=_0x9fd113[_0xbb8a('0x37')][_0xbb8a('0x36')]?_0x9fd113[_0xbb8a('0x37')]:_0x5bd663[_0xbb8a('0x34')];if(_0x410dc0[_0xbb8a('0x31')][_0xbb8a('0x41')]){_0x9fd113[_0xbb8a('0x42')]=[{'all':!![]}];}_0x9fd113=_[_0xbb8a('0x3f')]({},_0x9fd113,_0x410dc0[_0xbb8a('0x48')]);return db[_0xbb8a('0x2c')][_0xbb8a('0x49')](_0x9fd113)[_0xbb8a('0x26')](handleEntityNotFound(_0x3e68fd,null))['then'](respondWithResult(_0x3e68fd,null))[_0xbb8a('0x45')](handleError(_0x3e68fd,null));};exports[_0xbb8a('0x4a')]=function(_0x29cdb7,_0x5a8e95){return db[_0xbb8a('0x2c')][_0xbb8a('0x4a')](_0x29cdb7[_0xbb8a('0x4b')],{})[_0xbb8a('0x26')](respondWithResult(_0x5a8e95,0xc9))['catch'](handleError(_0x5a8e95,null));};exports[_0xbb8a('0x25')]=function(_0x3367c9,_0x47ed44){if(_0x3367c9[_0xbb8a('0x4b')]['id']){delete _0x3367c9['body']['id'];}return db['FreshsalesConfiguration'][_0xbb8a('0x49')]({'where':{'id':_0x3367c9[_0xbb8a('0x47')]['id']}})[_0xbb8a('0x26')](handleEntityNotFound(_0x47ed44,null))['then'](saveUpdates(_0x3367c9[_0xbb8a('0x4b')],null))[_0xbb8a('0x26')](respondWithResult(_0x47ed44,null))[_0xbb8a('0x45')](handleError(_0x47ed44,null));};exports[_0xbb8a('0x4c')]=function(_0xe7e673,_0x308c24){return db[_0xbb8a('0x2c')][_0xbb8a('0x49')]({'where':{'id':_0xe7e673['params']['id']}})[_0xbb8a('0x26')](handleEntityNotFound(_0x308c24,null))[_0xbb8a('0x26')](removeEntity(_0x308c24,null))[_0xbb8a('0x45')](handleError(_0x308c24,null));};exports[_0xbb8a('0x4d')]=function(_0x1e05de,_0x590cb9,_0x451d68){var _0x4e8f9c={};var _0xc36d8e={};var _0x30c588;var _0x42bd15;return db['FreshsalesConfiguration'][_0xbb8a('0x4e')]({'where':{'id':_0x1e05de[_0xbb8a('0x47')]['id']}})[_0xbb8a('0x26')](handleEntityNotFound(_0x590cb9,null))[_0xbb8a('0x26')](function(_0x172cf1){if(_0x172cf1){_0x30c588=_0x172cf1;_0xc36d8e[_0xbb8a('0x34')]=_[_0xbb8a('0x32')](db[_0xbb8a('0x4f')][_0xbb8a('0x2d')]);_0xc36d8e[_0xbb8a('0x31')]=_[_0xbb8a('0x32')](_0x1e05de['query']);_0xc36d8e[_0xbb8a('0x3b')]=_[_0xbb8a('0x33')](_0xc36d8e[_0xbb8a('0x34')],_0xc36d8e[_0xbb8a('0x31')]);_0x4e8f9c[_0xbb8a('0x37')]=_[_0xbb8a('0x33')](_0xc36d8e['model'],qs['fields'](_0x1e05de[_0xbb8a('0x31')][_0xbb8a('0x35')]));_0x4e8f9c[_0xbb8a('0x37')]=_0x4e8f9c['attributes'][_0xbb8a('0x36')]?_0x4e8f9c[_0xbb8a('0x37')]:_0xc36d8e[_0xbb8a('0x34')];_0x4e8f9c[_0xbb8a('0x39')]=qs[_0xbb8a('0x3a')](_0x1e05de[_0xbb8a('0x31')][_0xbb8a('0x3a')]);_0x4e8f9c[_0xbb8a('0x3e')]=qs['filters'](_[_0xbb8a('0x3c')](_0x1e05de['query'],_0xc36d8e[_0xbb8a('0x3b')]));if(_0x1e05de[_0xbb8a('0x31')][_0xbb8a('0x3d')]){_0x4e8f9c[_0xbb8a('0x3e')]=_['merge'](_0x4e8f9c[_0xbb8a('0x3e')],{'$or':_['map'](_0x4e8f9c[_0xbb8a('0x37')],function(_0x1b0c9c){var _0x2e0ec9={};_0x2e0ec9[_0x1b0c9c]={'$like':'%'+_0x1e05de[_0xbb8a('0x31')][_0xbb8a('0x3d')]+'%'};return _0x2e0ec9;})});}_0x4e8f9c=_[_0xbb8a('0x3f')]({},_0x4e8f9c,_0x1e05de[_0xbb8a('0x48')]);return _0x30c588[_0xbb8a('0x4d')](_0x4e8f9c);}})[_0xbb8a('0x26')](function(_0x24ca80){if(_0x24ca80){_0x42bd15=_0x24ca80[_0xbb8a('0x36')];if(!_0x1e05de['query']['hasOwnProperty'](_0xbb8a('0x50'))){_0x4e8f9c[_0xbb8a('0x1e')]=qs[_0xbb8a('0x1e')](_0x1e05de[_0xbb8a('0x31')][_0xbb8a('0x1e')]);_0x4e8f9c[_0xbb8a('0x1c')]=qs[_0xbb8a('0x1c')](_0x1e05de[_0xbb8a('0x31')]['offset']);}return _0x30c588[_0xbb8a('0x4d')](_0x4e8f9c);}})[_0xbb8a('0x26')](function(_0x401ccb){if(_0x401ccb){return _0x401ccb?{'count':_0x42bd15,'rows':_0x401ccb}:null;}})[_0xbb8a('0x26')](respondWithResult(_0x590cb9,null))[_0xbb8a('0x45')](handleError(_0x590cb9,null));};exports[_0xbb8a('0x51')]=function(_0x530aab,_0x1e975c,_0x1fc62b){var _0x5bbcee={};var _0x24a7d9={};var _0x15f43d;var _0x37c53b;return db[_0xbb8a('0x2c')][_0xbb8a('0x4e')]({'where':{'id':_0x530aab['params']['id']}})['then'](handleEntityNotFound(_0x1e975c,null))['then'](function(_0x485aeb){if(_0x485aeb){_0x15f43d=_0x485aeb;_0x24a7d9[_0xbb8a('0x34')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x24a7d9['query']=_[_0xbb8a('0x32')](_0x530aab[_0xbb8a('0x31')]);_0x24a7d9[_0xbb8a('0x3b')]=_[_0xbb8a('0x33')](_0x24a7d9['model'],_0x24a7d9['query']);_0x5bbcee[_0xbb8a('0x37')]=_[_0xbb8a('0x33')](_0x24a7d9['model'],qs[_0xbb8a('0x35')](_0x530aab[_0xbb8a('0x31')]['fields']));_0x5bbcee['attributes']=_0x5bbcee[_0xbb8a('0x37')]['length']?_0x5bbcee[_0xbb8a('0x37')]:_0x24a7d9[_0xbb8a('0x34')];_0x5bbcee[_0xbb8a('0x39')]=qs[_0xbb8a('0x3a')](_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x3a')]);_0x5bbcee[_0xbb8a('0x3e')]=qs[_0xbb8a('0x3b')](_[_0xbb8a('0x3c')](_0x530aab[_0xbb8a('0x31')],_0x24a7d9[_0xbb8a('0x3b')]));if(_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x3d')]){_0x5bbcee[_0xbb8a('0x3e')]=_[_0xbb8a('0x3f')](_0x5bbcee[_0xbb8a('0x3e')],{'$or':_[_0xbb8a('0x30')](_0x5bbcee[_0xbb8a('0x37')],function(_0x3865cf){var _0x49f395={};_0x49f395[_0x3865cf]={'$like':'%'+_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x3d')]+'%'};return _0x49f395;})});}_0x5bbcee=_[_0xbb8a('0x3f')]({},_0x5bbcee,_0x530aab[_0xbb8a('0x48')]);return _0x15f43d[_0xbb8a('0x51')](_0x5bbcee);}})[_0xbb8a('0x26')](function(_0x5f4339){if(_0x5f4339){_0x37c53b=_0x5f4339[_0xbb8a('0x36')];if(!_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x38')](_0xbb8a('0x50'))){_0x5bbcee['limit']=qs['limit'](_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x1e')]);_0x5bbcee['offset']=qs['offset'](_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x1c')]);}return _0x15f43d[_0xbb8a('0x51')](_0x5bbcee);}})[_0xbb8a('0x26')](function(_0x2b16cd){if(_0x2b16cd){return _0x2b16cd?{'count':_0x37c53b,'rows':_0x2b16cd}:null;}})[_0xbb8a('0x26')](respondWithResult(_0x1e975c,null))[_0xbb8a('0x45')](handleError(_0x1e975c,null));};exports['getFields']=function(_0xd71203,_0x2d9ed7,_0x23f80c){var _0x411d5f={};var _0x40e4ec={};var _0x1264d4;var _0x5a34ed;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0xd71203[_0xbb8a('0x47')]['id']}})[_0xbb8a('0x26')](handleEntityNotFound(_0x2d9ed7,null))[_0xbb8a('0x26')](function(_0x572690){if(_0x572690){_0x1264d4=_0x572690;_0x40e4ec[_0xbb8a('0x34')]=_[_0xbb8a('0x32')](db['FreshsalesField']['rawAttributes']);_0x40e4ec[_0xbb8a('0x31')]=_['keys'](_0xd71203[_0xbb8a('0x31')]);_0x40e4ec[_0xbb8a('0x3b')]=_[_0xbb8a('0x33')](_0x40e4ec[_0xbb8a('0x34')],_0x40e4ec[_0xbb8a('0x31')]);_0x411d5f[_0xbb8a('0x37')]=_[_0xbb8a('0x33')](_0x40e4ec[_0xbb8a('0x34')],qs[_0xbb8a('0x35')](_0xd71203['query'][_0xbb8a('0x35')]));_0x411d5f[_0xbb8a('0x37')]=_0x411d5f[_0xbb8a('0x37')][_0xbb8a('0x36')]?_0x411d5f[_0xbb8a('0x37')]:_0x40e4ec[_0xbb8a('0x34')];_0x411d5f['order']=qs['sort'](_0xd71203[_0xbb8a('0x31')][_0xbb8a('0x3a')]);_0x411d5f[_0xbb8a('0x3e')]=qs[_0xbb8a('0x3b')](_[_0xbb8a('0x3c')](_0xd71203[_0xbb8a('0x31')],_0x40e4ec['filters']));if(_0xd71203[_0xbb8a('0x31')]['filter']){_0x411d5f[_0xbb8a('0x3e')]=_[_0xbb8a('0x3f')](_0x411d5f[_0xbb8a('0x3e')],{'$or':_[_0xbb8a('0x30')](_0x411d5f[_0xbb8a('0x37')],function(_0x436595){var _0x47d0de={};_0x47d0de[_0x436595]={'$like':'%'+_0xd71203[_0xbb8a('0x31')]['filter']+'%'};return _0x47d0de;})});}_0x411d5f=_['merge']({},_0x411d5f,_0xd71203[_0xbb8a('0x48')]);return _0x1264d4[_0xbb8a('0x52')](_0x411d5f);}})['then'](function(_0x3e749a){if(_0x3e749a){_0x5a34ed=_0x3e749a[_0xbb8a('0x36')];if(!_0xd71203[_0xbb8a('0x31')][_0xbb8a('0x38')](_0xbb8a('0x50'))){_0x411d5f[_0xbb8a('0x1e')]=qs[_0xbb8a('0x1e')](_0xd71203[_0xbb8a('0x31')]['limit']);_0x411d5f['offset']=qs[_0xbb8a('0x1c')](_0xd71203[_0xbb8a('0x31')][_0xbb8a('0x1c')]);}return _0x1264d4[_0xbb8a('0x52')](_0x411d5f);}})[_0xbb8a('0x26')](function(_0x486faa){if(_0x486faa){return _0x486faa?{'count':_0x5a34ed,'rows':_0x486faa}:null;}})[_0xbb8a('0x26')](respondWithResult(_0x2d9ed7,null))[_0xbb8a('0x45')](handleError(_0x2d9ed7,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index a607341..613b001 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 _0x68f8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','../../config/logger','api'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x68f8,0x14f));var _0x868f=function(_0x435abe,_0x3d3682){_0x435abe=_0x435abe-0x0;var _0x4349e0=_0x68f8[_0x435abe];return _0x4349e0;};'use strict';var _=require(_0x868f('0x0'));var util=require('util');var logger=require(_0x868f('0x1'))(_0x868f('0x2'));var moment=require(_0x868f('0x3'));var BPromise=require(_0x868f('0x4'));var rp=require(_0x868f('0x5'));var fs=require('fs');var path=require(_0x868f('0x6'));var rimraf=require(_0x868f('0x7'));var config=require(_0x868f('0x8'));var attributes=require(_0x868f('0x9'));module[_0x868f('0xa')]=function(_0x4ca7e6,_0x22d1ec){return _0x4ca7e6[_0x868f('0xb')]('FreshsalesConfiguration',attributes,{'tableName':_0x868f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x021c=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x6f8972,_0x343da7){var _0x5677d9=function(_0x5eb51f){while(--_0x5eb51f){_0x6f8972['push'](_0x6f8972['shift']());}};_0x5677d9(++_0x343da7);}(_0x021c,0x1eb));var _0xc021=function(_0x3e8f4d,_0x2973ed){_0x3e8f4d=_0x3e8f4d-0x0;var _0x590a2e=_0x021c[_0x3e8f4d];return _0x590a2e;};'use strict';var _=require(_0xc021('0x0'));var util=require(_0xc021('0x1'));var logger=require(_0xc021('0x2'))(_0xc021('0x3'));var moment=require('moment');var BPromise=require(_0xc021('0x4'));var rp=require(_0xc021('0x5'));var fs=require('fs');var path=require(_0xc021('0x6'));var rimraf=require(_0xc021('0x7'));var config=require(_0xc021('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xc021('0x9')]=function(_0x5f3c5c,_0x1ca669){return _0x5f3c5c[_0xc021('0xa')](_0xc021('0xb'),attributes,{'tableName':_0xc021('0xc'),'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 549565a..0914d58 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 _0xbde0=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x38f38f,_0xfb83e2){var _0x58377d=function(_0x5177f4){while(--_0x5177f4){_0x38f38f['push'](_0x38f38f['shift']());}};_0x58377d(++_0xfb83e2);}(_0xbde0,0x8a));var _0x0bde=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xbde0[_0x1589dd];return _0x1bddd1;};'use strict';var _=require('lodash');var util=require(_0x0bde('0x0'));var moment=require(_0x0bde('0x1'));var BPromise=require(_0x0bde('0x2'));var rs=require(_0x0bde('0x3'));var fs=require('fs');var Redis=require(_0x0bde('0x4'));var db=require(_0x0bde('0x5'))['db'];var utils=require(_0x0bde('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0bde('0x7'));var jayson=require(_0x0bde('0x8'));var client=jayson[_0x0bde('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53e098,_0x2c8cd0,_0x54e379){return new BPromise(function(_0x297233,_0x53e708){return client[_0x0bde('0xa')](_0x53e098,_0x54e379)[_0x0bde('0xb')](function(_0x58695c){logger[_0x0bde('0xc')](_0x0bde('0xd'),_0x2c8cd0,_0x0bde('0xe'));logger['debug'](_0x0bde('0xf'),_0x2c8cd0,_0x0bde('0xe'),JSON[_0x0bde('0x10')](_0x58695c));if(_0x58695c[_0x0bde('0x11')]){if(_0x58695c['error'][_0x0bde('0x12')]===0x1f4){logger['error'](_0x0bde('0xd'),_0x2c8cd0,_0x58695c[_0x0bde('0x11')][_0x0bde('0x13')]);return _0x53e708(_0x58695c['error'][_0x0bde('0x13')]);}logger[_0x0bde('0x11')](_0x0bde('0xd'),_0x2c8cd0,_0x58695c[_0x0bde('0x11')][_0x0bde('0x13')]);return _0x297233(_0x58695c[_0x0bde('0x11')][_0x0bde('0x13')]);}else{logger[_0x0bde('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2c8cd0,_0x0bde('0xe'));_0x297233(_0x58695c[_0x0bde('0x14')][_0x0bde('0x13')]);}})[_0x0bde('0x15')](function(_0x573e68){logger[_0x0bde('0x11')](_0x0bde('0xd'),_0x2c8cd0,_0x573e68);_0x53e708(_0x573e68);});});} \ No newline at end of file +var _0xadb7=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','request\x20sent','debug'];(function(_0x55a8d0,_0x3d6044){var _0x4726b3=function(_0x16ec11){while(--_0x16ec11){_0x55a8d0['push'](_0x55a8d0['shift']());}};_0x4726b3(++_0x3d6044);}(_0xadb7,0x71));var _0x7adb=function(_0x1f5ba9,_0x5ae73e){_0x1f5ba9=_0x1f5ba9-0x0;var _0x653277=_0xadb7[_0x1f5ba9];return _0x653277;};'use strict';var _=require(_0x7adb('0x0'));var util=require(_0x7adb('0x1'));var moment=require('moment');var BPromise=require(_0x7adb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7adb('0x3'));var db=require(_0x7adb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7adb('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7adb('0x6')][_0x7adb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e6b76,_0x21b0ea,_0x3eece8){return new BPromise(function(_0x5b38df,_0x1790a9){return client[_0x7adb('0x8')](_0x4e6b76,_0x3eece8)[_0x7adb('0x9')](function(_0x57698f){logger[_0x7adb('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x21b0ea,_0x7adb('0xb'));logger[_0x7adb('0xc')](_0x7adb('0xd'),_0x21b0ea,_0x7adb('0xb'),JSON[_0x7adb('0xe')](_0x57698f));if(_0x57698f[_0x7adb('0xf')]){if(_0x57698f[_0x7adb('0xf')][_0x7adb('0x10')]===0x1f4){logger[_0x7adb('0xf')](_0x7adb('0x11'),_0x21b0ea,_0x57698f[_0x7adb('0xf')][_0x7adb('0x12')]);return _0x1790a9(_0x57698f['error']['message']);}logger[_0x7adb('0xf')](_0x7adb('0x11'),_0x21b0ea,_0x57698f[_0x7adb('0xf')][_0x7adb('0x12')]);return _0x5b38df(_0x57698f[_0x7adb('0xf')][_0x7adb('0x12')]);}else{logger[_0x7adb('0xa')](_0x7adb('0x11'),_0x21b0ea,'request\x20sent');_0x5b38df(_0x57698f[_0x7adb('0x13')]['message']);}})[_0x7adb('0x14')](function(_0x475490){logger[_0x7adb('0xf')](_0x7adb('0x11'),_0x21b0ea,_0x475490);_0x1790a9(_0x475490);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 88cec09..d746b31 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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x564cda,_0x5bb97f){var _0xc09e18=function(_0x222d60){while(--_0x222d60){_0x564cda['push'](_0x564cda['shift']());}};_0xc09e18(++_0x5bb97f);}(_0x008c,0x188));var _0xc008=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0x008c[_0x4d0df6];return _0x4e2615;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0x9a62=['delete','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','put','/:id','update'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x9a62,0x1bc));var _0x29a6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9a62[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x29a6('0x0'));var path=require(_0x29a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x29a6('0x2'));var router=express[_0x29a6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x29a6('0x4'));var config=require(_0x29a6('0x5'));var controller=require(_0x29a6('0x6'));router[_0x29a6('0x7')]('/',auth[_0x29a6('0x8')](),controller[_0x29a6('0x9')]);router[_0x29a6('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x29a6('0xa')]);router[_0x29a6('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x29a6('0xc')](_0x29a6('0xd'),auth[_0x29a6('0x8')](),controller[_0x29a6('0xe')]);router[_0x29a6('0xf')](_0x29a6('0xd'),auth[_0x29a6('0x8')](),controller['destroy']);module[_0x29a6('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 cb93ea5..5e235f4 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 _0xd888=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x1abace,_0x453116){var _0x3eac5d=function(_0x33ff55){while(--_0x33ff55){_0x1abace['push'](_0x1abace['shift']());}};_0x3eac5d(++_0x453116);}(_0xd888,0x77));var _0x8d88=function(_0x389da3,_0x1208ed){_0x389da3=_0x389da3-0x0;var _0x5a8e6c=_0xd888[_0x389da3];return _0x5a8e6c;};'use strict';var Sequelize=require(_0x8d88('0x0'));module[_0x8d88('0x1')]={'type':{'type':Sequelize[_0x8d88('0x2')]('string',_0x8d88('0x3'),_0x8d88('0x4'),_0x8d88('0x5'),_0x8d88('0x6')),'defaultValue':_0x8d88('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8d88('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x8d88('0x7'),_0x8d88('0x3'),_0x8d88('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8d88('0x8')]},'customField':{'type':Sequelize[_0x8d88('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8d88('0x8')]}}; \ No newline at end of file +var _0x8def=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x4a4760,_0x7ce6b4){var _0x3c2c17=function(_0x201577){while(--_0x201577){_0x4a4760['push'](_0x4a4760['shift']());}};_0x3c2c17(++_0x7ce6b4);}(_0x8def,0x1f2));var _0xf8de=function(_0x1de7f3,_0x4d0ba0){_0x1de7f3=_0x1de7f3-0x0;var _0x52df61=_0x8def[_0x1de7f3];return _0x52df61;};'use strict';var Sequelize=require(_0xf8de('0x0'));module[_0xf8de('0x1')]={'type':{'type':Sequelize[_0xf8de('0x2')](_0xf8de('0x3'),'variable',_0xf8de('0x4'),_0xf8de('0x5'),_0xf8de('0x6')),'defaultValue':_0xf8de('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf8de('0x7')]},'keyType':{'type':Sequelize[_0xf8de('0x2')](_0xf8de('0x3'),_0xf8de('0x8'),_0xf8de('0x4'))},'keyContent':{'type':Sequelize[_0xf8de('0x7')]},'idField':{'type':Sequelize[_0xf8de('0x7')]},'nameField':{'type':Sequelize[_0xf8de('0x7')]},'customField':{'type':Sequelize[_0xf8de('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf8de('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 9c54bbc..90925a9 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 _0x48e6=['crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','FreshsalesField','rawAttributes','type','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','merge','where','map','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash'];(function(_0x20ea8e,_0x46a195){var _0x4a8598=function(_0x2d3981){while(--_0x2d3981){_0x20ea8e['push'](_0x20ea8e['shift']());}};_0x4a8598(++_0x46a195);}(_0x48e6,0x1a0));var _0x648e=function(_0x45fb5c,_0xcf432a){_0x45fb5c=_0x45fb5c-0x0;var _0x410841=_0x48e6[_0x45fb5c];return _0x410841;};'use strict';var emlformat=require(_0x648e('0x0'));var rimraf=require(_0x648e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x648e('0x2'));var moment=require('moment');var BPromise=require(_0x648e('0x3'));var Mustache=require(_0x648e('0x4'));var util=require('util');var path=require(_0x648e('0x5'));var sox=require(_0x648e('0x6'));var csv=require('to-csv');var ejs=require(_0x648e('0x7'));var fs=require('fs');var fs_extra=require(_0x648e('0x8'));var _=require(_0x648e('0x9'));var squel=require('squel');var crypto=require(_0x648e('0xa'));var jsforce=require(_0x648e('0xb'));var deskjs=require(_0x648e('0xc'));var toCsv=require(_0x648e('0xd'));var querystring=require('querystring');var Papa=require(_0x648e('0xe'));var Redis=require(_0x648e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x648e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x648e('0x11'));var logger=require('../../config/logger')(_0x648e('0x12'));var utils=require(_0x648e('0x13'));var config=require(_0x648e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x648e('0x15'))['db'];function respondWithStatusCode(_0x449a06,_0x3fb327){_0x3fb327=_0x3fb327||0xcc;return function(_0x23695e){if(_0x23695e){return _0x449a06['sendStatus'](_0x3fb327);}return _0x449a06['status'](_0x3fb327)[_0x648e('0x16')]();};}function respondWithResult(_0x2b9be4,_0x2ea0ba){_0x2ea0ba=_0x2ea0ba||0xc8;return function(_0x4cc58f){if(_0x4cc58f){return _0x2b9be4[_0x648e('0x17')](_0x2ea0ba)[_0x648e('0x18')](_0x4cc58f);}};}function respondWithFilteredResult(_0x57a1f9,_0x260cb5){return function(_0x1bb34d){if(_0x1bb34d){var _0x3f158a=typeof _0x260cb5[_0x648e('0x19')]===_0x648e('0x1a')&&typeof _0x260cb5[_0x648e('0x1b')]==='undefined';var _0xf6df2f=_0x1bb34d['count'];var _0x227927=_0x3f158a?0x0:_0x260cb5[_0x648e('0x19')];var _0x14433c=_0x3f158a?_0x1bb34d[_0x648e('0x1c')]:_0x260cb5[_0x648e('0x19')]+_0x260cb5[_0x648e('0x1b')];var _0x58ed4a;if(_0x14433c>=_0xf6df2f){_0x14433c=_0xf6df2f;_0x58ed4a=0xc8;}else{_0x58ed4a=0xce;}_0x57a1f9[_0x648e('0x17')](_0x58ed4a);return _0x57a1f9[_0x648e('0x1d')](_0x648e('0x1e'),_0x227927+'-'+_0x14433c+'/'+_0xf6df2f)[_0x648e('0x18')](_0x1bb34d);}return null;};}function patchUpdates(_0x2c7157){return function(_0x425de2){try{jsonpatch[_0x648e('0x1f')](_0x425de2,_0x2c7157,!![]);}catch(_0x6d7137){return BPromise[_0x648e('0x20')](_0x6d7137);}return _0x425de2[_0x648e('0x21')]();};}function saveUpdates(_0x41f3dc,_0x3a7c24){return function(_0x162608){if(_0x162608){return _0x162608[_0x648e('0x22')](_0x41f3dc)[_0x648e('0x23')](function(_0x4b9282){return _0x4b9282;});}return null;};}function removeEntity(_0x532533,_0x535e61){return function(_0x199713){if(_0x199713){return _0x199713[_0x648e('0x24')]()[_0x648e('0x23')](function(){_0x532533[_0x648e('0x17')](0xcc)[_0x648e('0x16')]();});}};}function handleEntityNotFound(_0x22caf5,_0x4d9374){return function(_0x20f6fa){if(!_0x20f6fa){_0x22caf5[_0x648e('0x25')](0x194);}return _0x20f6fa;};}function handleError(_0x4390f1,_0x3aef32){_0x3aef32=_0x3aef32||0x1f4;return function(_0x3fe017){logger[_0x648e('0x26')](_0x3fe017[_0x648e('0x27')]);if(_0x3fe017[_0x648e('0x28')]){delete _0x3fe017[_0x648e('0x28')];}_0x4390f1[_0x648e('0x17')](_0x3aef32)[_0x648e('0x29')](_0x3fe017);};}exports[_0x648e('0x2a')]=function(_0x2bcce7,_0x1f023a){var _0x5e4713={},_0x5613a0={},_0x5458f9={'count':0x0,'rows':[]};var _0x400168=_['map'](db[_0x648e('0x2b')][_0x648e('0x2c')],function(_0x416702){return{'name':_0x416702['fieldName'],'type':_0x416702[_0x648e('0x2d')]['key']};});_0x5613a0[_0x648e('0x2e')]=_['map'](_0x400168,_0x648e('0x28'));_0x5613a0['query']=_[_0x648e('0x2f')](_0x2bcce7['query']);_0x5613a0['filters']=_[_0x648e('0x30')](_0x5613a0[_0x648e('0x2e')],_0x5613a0[_0x648e('0x31')]);_0x5e4713[_0x648e('0x32')]=_[_0x648e('0x30')](_0x5613a0['model'],qs[_0x648e('0x33')](_0x2bcce7['query']['fields']));_0x5e4713['attributes']=_0x5e4713[_0x648e('0x32')][_0x648e('0x34')]?_0x5e4713['attributes']:_0x5613a0[_0x648e('0x2e')];if(!_0x2bcce7[_0x648e('0x31')][_0x648e('0x35')](_0x648e('0x36'))){_0x5e4713['limit']=qs[_0x648e('0x1b')](_0x2bcce7[_0x648e('0x31')][_0x648e('0x1b')]);_0x5e4713[_0x648e('0x19')]=qs[_0x648e('0x19')](_0x2bcce7[_0x648e('0x31')][_0x648e('0x19')]);}_0x5e4713[_0x648e('0x37')]=qs[_0x648e('0x38')](_0x2bcce7[_0x648e('0x31')][_0x648e('0x38')]);_0x5e4713['where']=qs[_0x648e('0x39')](_['pick'](_0x2bcce7[_0x648e('0x31')],_0x5613a0[_0x648e('0x39')]),_0x400168);if(_0x2bcce7['query']['filter']){_0x5e4713['where']=_[_0x648e('0x3a')](_0x5e4713[_0x648e('0x3b')],{'$or':_[_0x648e('0x3c')](_0x400168,function(_0x45b55e){if(_0x45b55e[_0x648e('0x2d')]!==_0x648e('0x3d')){var _0x3c5a59={};_0x3c5a59[_0x45b55e[_0x648e('0x28')]]={'$like':'%'+_0x2bcce7['query']['filter']+'%'};return _0x3c5a59;}})});}_0x5e4713=_[_0x648e('0x3a')]({},_0x5e4713,_0x2bcce7[_0x648e('0x3e')]);var _0x2ee5f0={'where':_0x5e4713['where']};return db[_0x648e('0x2b')][_0x648e('0x1c')](_0x2ee5f0)[_0x648e('0x23')](function(_0x513b16){_0x5458f9[_0x648e('0x1c')]=_0x513b16;if(_0x2bcce7[_0x648e('0x31')][_0x648e('0x3f')]){_0x5e4713[_0x648e('0x40')]=[{'all':!![]}];}return db[_0x648e('0x2b')][_0x648e('0x41')](_0x5e4713);})[_0x648e('0x23')](function(_0x306ea6){_0x5458f9['rows']=_0x306ea6;return _0x5458f9;})[_0x648e('0x23')](respondWithFilteredResult(_0x1f023a,_0x5e4713))[_0x648e('0x42')](handleError(_0x1f023a,null));};exports['show']=function(_0x4da9dc,_0x2209b2){var _0x26d00c={'raw':!![],'where':{'id':_0x4da9dc[_0x648e('0x43')]['id']}},_0x5eeb57={};_0x5eeb57['model']=_[_0x648e('0x2f')](db[_0x648e('0x2b')][_0x648e('0x2c')]);_0x5eeb57['query']=_['keys'](_0x4da9dc[_0x648e('0x31')]);_0x5eeb57[_0x648e('0x39')]=_['intersection'](_0x5eeb57[_0x648e('0x2e')],_0x5eeb57[_0x648e('0x31')]);_0x26d00c['attributes']=_['intersection'](_0x5eeb57[_0x648e('0x2e')],qs[_0x648e('0x33')](_0x4da9dc[_0x648e('0x31')]['fields']));_0x26d00c['attributes']=_0x26d00c[_0x648e('0x32')]['length']?_0x26d00c[_0x648e('0x32')]:_0x5eeb57[_0x648e('0x2e')];if(_0x4da9dc[_0x648e('0x31')]['includeAll']){_0x26d00c[_0x648e('0x40')]=[{'all':!![]}];}_0x26d00c=_[_0x648e('0x3a')]({},_0x26d00c,_0x4da9dc[_0x648e('0x3e')]);return db['FreshsalesField'][_0x648e('0x44')](_0x26d00c)['then'](handleEntityNotFound(_0x2209b2,null))['then'](respondWithResult(_0x2209b2,null))['catch'](handleError(_0x2209b2,null));};exports[_0x648e('0x45')]=function(_0x152c26,_0x25c5ab){return db[_0x648e('0x2b')][_0x648e('0x45')](_0x152c26[_0x648e('0x46')],{})[_0x648e('0x23')](respondWithResult(_0x25c5ab,0xc9))[_0x648e('0x42')](handleError(_0x25c5ab,null));};exports[_0x648e('0x22')]=function(_0x98c50b,_0x4a0438){if(_0x98c50b[_0x648e('0x46')]['id']){delete _0x98c50b[_0x648e('0x46')]['id'];}return db[_0x648e('0x2b')][_0x648e('0x44')]({'where':{'id':_0x98c50b['params']['id']}})[_0x648e('0x23')](handleEntityNotFound(_0x4a0438,null))[_0x648e('0x23')](saveUpdates(_0x98c50b[_0x648e('0x46')],null))[_0x648e('0x23')](respondWithResult(_0x4a0438,null))[_0x648e('0x42')](handleError(_0x4a0438,null));};exports[_0x648e('0x24')]=function(_0x28299b,_0x10e779){return db[_0x648e('0x2b')][_0x648e('0x44')]({'where':{'id':_0x28299b[_0x648e('0x43')]['id']}})[_0x648e('0x23')](handleEntityNotFound(_0x10e779,null))[_0x648e('0x23')](removeEntity(_0x10e779,null))[_0x648e('0x42')](handleError(_0x10e779,null));}; \ No newline at end of file +var _0xe218=['find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','stack','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','FreshsalesField','includeAll','include','findAll','catch','show','params'];(function(_0x5942cb,_0x4ae1df){var _0x375d21=function(_0x30fc10){while(--_0x30fc10){_0x5942cb['push'](_0x5942cb['shift']());}};_0x375d21(++_0x4ae1df);}(_0xe218,0xd9));var _0x8e21=function(_0x509880,_0x462c05){_0x509880=_0x509880-0x0;var _0x243e82=_0xe218[_0x509880];return _0x243e82;};'use strict';var emlformat=require(_0x8e21('0x0'));var rimraf=require(_0x8e21('0x1'));var zipdir=require(_0x8e21('0x2'));var jsonpatch=require(_0x8e21('0x3'));var rp=require('request-promise');var moment=require(_0x8e21('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8e21('0x5'));var util=require(_0x8e21('0x6'));var path=require('path');var sox=require(_0x8e21('0x7'));var csv=require(_0x8e21('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e21('0x9'));var _=require(_0x8e21('0xa'));var squel=require(_0x8e21('0xb'));var crypto=require(_0x8e21('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8e21('0xd'));var toCsv=require(_0x8e21('0x8'));var querystring=require('querystring');var Papa=require(_0x8e21('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8e21('0xf'));var as=require(_0x8e21('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8e21('0x11'));var config=require(_0x8e21('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e21('0x13'))['db'];function respondWithStatusCode(_0x4025e3,_0x4bb266){_0x4bb266=_0x4bb266||0xcc;return function(_0x5e0e98){if(_0x5e0e98){return _0x4025e3[_0x8e21('0x14')](_0x4bb266);}return _0x4025e3[_0x8e21('0x15')](_0x4bb266)[_0x8e21('0x16')]();};}function respondWithResult(_0x480493,_0x4860cf){_0x4860cf=_0x4860cf||0xc8;return function(_0x59424e){if(_0x59424e){return _0x480493[_0x8e21('0x15')](_0x4860cf)['json'](_0x59424e);}};}function respondWithFilteredResult(_0x166415,_0x1fd6ca){return function(_0x3e8bf9){if(_0x3e8bf9){var _0x1b8f06=typeof _0x1fd6ca[_0x8e21('0x17')]===_0x8e21('0x18')&&typeof _0x1fd6ca[_0x8e21('0x19')]===_0x8e21('0x18');var _0x5c1338=_0x3e8bf9[_0x8e21('0x1a')];var _0x4b102e=_0x1b8f06?0x0:_0x1fd6ca[_0x8e21('0x17')];var _0x49392c=_0x1b8f06?_0x3e8bf9[_0x8e21('0x1a')]:_0x1fd6ca[_0x8e21('0x17')]+_0x1fd6ca[_0x8e21('0x19')];var _0x602900;if(_0x49392c>=_0x5c1338){_0x49392c=_0x5c1338;_0x602900=0xc8;}else{_0x602900=0xce;}_0x166415[_0x8e21('0x15')](_0x602900);return _0x166415[_0x8e21('0x1b')](_0x8e21('0x1c'),_0x4b102e+'-'+_0x49392c+'/'+_0x5c1338)[_0x8e21('0x1d')](_0x3e8bf9);}return null;};}function patchUpdates(_0x2218e1){return function(_0x4495e1){try{jsonpatch[_0x8e21('0x1e')](_0x4495e1,_0x2218e1,!![]);}catch(_0x329318){return BPromise[_0x8e21('0x1f')](_0x329318);}return _0x4495e1[_0x8e21('0x20')]();};}function saveUpdates(_0x155f07,_0x7cc43b){return function(_0x2f3d5c){if(_0x2f3d5c){return _0x2f3d5c['update'](_0x155f07)[_0x8e21('0x21')](function(_0x25a653){return _0x25a653;});}return null;};}function removeEntity(_0xec1d07,_0x481261){return function(_0x2e3e03){if(_0x2e3e03){return _0x2e3e03['destroy']()[_0x8e21('0x21')](function(){_0xec1d07['status'](0xcc)[_0x8e21('0x16')]();});}};}function handleEntityNotFound(_0x5a89f4,_0x53fd5e){return function(_0x26c181){if(!_0x26c181){_0x5a89f4[_0x8e21('0x14')](0x194);}return _0x26c181;};}function handleError(_0x2c2070,_0x1b132e){_0x1b132e=_0x1b132e||0x1f4;return function(_0x3d2825){logger['error'](_0x3d2825[_0x8e21('0x22')]);if(_0x3d2825['name']){delete _0x3d2825[_0x8e21('0x23')];}_0x2c2070[_0x8e21('0x15')](_0x1b132e)[_0x8e21('0x24')](_0x3d2825);};}exports[_0x8e21('0x25')]=function(_0x1c36c5,_0x8034ca){var _0x4d66ef={},_0x565b7f={},_0x4f2695={'count':0x0,'rows':[]};var _0x3a9032=_[_0x8e21('0x26')](db['FreshsalesField']['rawAttributes'],function(_0x226cf6){return{'name':_0x226cf6[_0x8e21('0x27')],'type':_0x226cf6[_0x8e21('0x28')][_0x8e21('0x29')]};});_0x565b7f['model']=_[_0x8e21('0x26')](_0x3a9032,_0x8e21('0x23'));_0x565b7f['query']=_[_0x8e21('0x2a')](_0x1c36c5[_0x8e21('0x2b')]);_0x565b7f[_0x8e21('0x2c')]=_[_0x8e21('0x2d')](_0x565b7f[_0x8e21('0x2e')],_0x565b7f[_0x8e21('0x2b')]);_0x4d66ef[_0x8e21('0x2f')]=_[_0x8e21('0x2d')](_0x565b7f[_0x8e21('0x2e')],qs[_0x8e21('0x30')](_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x30')]));_0x4d66ef[_0x8e21('0x2f')]=_0x4d66ef[_0x8e21('0x2f')][_0x8e21('0x31')]?_0x4d66ef[_0x8e21('0x2f')]:_0x565b7f[_0x8e21('0x2e')];if(!_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x32')](_0x8e21('0x33'))){_0x4d66ef[_0x8e21('0x19')]=qs[_0x8e21('0x19')](_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x19')]);_0x4d66ef[_0x8e21('0x17')]=qs[_0x8e21('0x17')](_0x1c36c5[_0x8e21('0x2b')]['offset']);}_0x4d66ef[_0x8e21('0x34')]=qs[_0x8e21('0x35')](_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x35')]);_0x4d66ef['where']=qs[_0x8e21('0x2c')](_[_0x8e21('0x36')](_0x1c36c5[_0x8e21('0x2b')],_0x565b7f[_0x8e21('0x2c')]),_0x3a9032);if(_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x37')]){_0x4d66ef[_0x8e21('0x38')]=_['merge'](_0x4d66ef[_0x8e21('0x38')],{'$or':_[_0x8e21('0x26')](_0x3a9032,function(_0x522c36){if(_0x522c36[_0x8e21('0x28')]!==_0x8e21('0x39')){var _0x139008={};_0x139008[_0x522c36[_0x8e21('0x23')]]={'$like':'%'+_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x37')]+'%'};return _0x139008;}})});}_0x4d66ef=_[_0x8e21('0x3a')]({},_0x4d66ef,_0x1c36c5[_0x8e21('0x3b')]);var _0x3cc62f={'where':_0x4d66ef[_0x8e21('0x38')]};return db[_0x8e21('0x3c')][_0x8e21('0x1a')](_0x3cc62f)['then'](function(_0x1f3b74){_0x4f2695[_0x8e21('0x1a')]=_0x1f3b74;if(_0x1c36c5['query'][_0x8e21('0x3d')]){_0x4d66ef[_0x8e21('0x3e')]=[{'all':!![]}];}return db[_0x8e21('0x3c')][_0x8e21('0x3f')](_0x4d66ef);})[_0x8e21('0x21')](function(_0x2236f4){_0x4f2695['rows']=_0x2236f4;return _0x4f2695;})[_0x8e21('0x21')](respondWithFilteredResult(_0x8034ca,_0x4d66ef))[_0x8e21('0x40')](handleError(_0x8034ca,null));};exports[_0x8e21('0x41')]=function(_0x315645,_0xcaab6){var _0x4b559b={'raw':!![],'where':{'id':_0x315645[_0x8e21('0x42')]['id']}},_0x1c4c7b={};_0x1c4c7b[_0x8e21('0x2e')]=_[_0x8e21('0x2a')](db[_0x8e21('0x3c')]['rawAttributes']);_0x1c4c7b['query']=_[_0x8e21('0x2a')](_0x315645[_0x8e21('0x2b')]);_0x1c4c7b[_0x8e21('0x2c')]=_[_0x8e21('0x2d')](_0x1c4c7b[_0x8e21('0x2e')],_0x1c4c7b[_0x8e21('0x2b')]);_0x4b559b[_0x8e21('0x2f')]=_['intersection'](_0x1c4c7b[_0x8e21('0x2e')],qs['fields'](_0x315645[_0x8e21('0x2b')][_0x8e21('0x30')]));_0x4b559b['attributes']=_0x4b559b[_0x8e21('0x2f')][_0x8e21('0x31')]?_0x4b559b[_0x8e21('0x2f')]:_0x1c4c7b[_0x8e21('0x2e')];if(_0x315645['query'][_0x8e21('0x3d')]){_0x4b559b[_0x8e21('0x3e')]=[{'all':!![]}];}_0x4b559b=_[_0x8e21('0x3a')]({},_0x4b559b,_0x315645[_0x8e21('0x3b')]);return db[_0x8e21('0x3c')][_0x8e21('0x43')](_0x4b559b)[_0x8e21('0x21')](handleEntityNotFound(_0xcaab6,null))[_0x8e21('0x21')](respondWithResult(_0xcaab6,null))['catch'](handleError(_0xcaab6,null));};exports[_0x8e21('0x44')]=function(_0x3572ef,_0x1db877){return db['FreshsalesField'][_0x8e21('0x44')](_0x3572ef['body'],{})[_0x8e21('0x21')](respondWithResult(_0x1db877,0xc9))[_0x8e21('0x40')](handleError(_0x1db877,null));};exports['update']=function(_0x490d9b,_0x4844ad){if(_0x490d9b[_0x8e21('0x45')]['id']){delete _0x490d9b[_0x8e21('0x45')]['id'];}return db[_0x8e21('0x3c')][_0x8e21('0x43')]({'where':{'id':_0x490d9b[_0x8e21('0x42')]['id']}})['then'](handleEntityNotFound(_0x4844ad,null))[_0x8e21('0x21')](saveUpdates(_0x490d9b[_0x8e21('0x45')],null))['then'](respondWithResult(_0x4844ad,null))[_0x8e21('0x40')](handleError(_0x4844ad,null));};exports[_0x8e21('0x46')]=function(_0x34c83e,_0x11a40a){return db[_0x8e21('0x3c')][_0x8e21('0x43')]({'where':{'id':_0x34c83e['params']['id']}})[_0x8e21('0x21')](handleEntityNotFound(_0x11a40a,null))['then'](removeEntity(_0x11a40a,null))['catch'](handleError(_0x11a40a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e55d4ae..ede7faa 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 _0x2dd8=['FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','freshsales_unique_index','idField'];(function(_0x3cd546,_0x4c9db7){var _0x5e0ac1=function(_0x2aa5aa){while(--_0x2aa5aa){_0x3cd546['push'](_0x3cd546['shift']());}};_0x5e0ac1(++_0x4c9db7);}(_0x2dd8,0x143));var _0x82dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2dd8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x82dd('0x2'));var BPromise=require(_0x82dd('0x3'));var rp=require(_0x82dd('0x4'));var fs=require('fs');var path=require(_0x82dd('0x5'));var rimraf=require(_0x82dd('0x6'));var config=require(_0x82dd('0x7'));var attributes=require(_0x82dd('0x8'));module['exports']=function(_0x4026c3,_0x1cfdce){return _0x4026c3[_0x82dd('0x9')](_0x82dd('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x82dd('0xb'),'fields':[_0x82dd('0xc'),_0x82dd('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd49=['idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','int_freshsales_fields'];(function(_0x2c8904,_0x222507){var _0xac620f=function(_0x3d0ccb){while(--_0x3d0ccb){_0x2c8904['push'](_0x2c8904['shift']());}};_0xac620f(++_0x222507);}(_0xfd49,0x121));var _0x9fd4=function(_0x38ae31,_0x3b3d51){_0x38ae31=_0x38ae31-0x0;var _0x55589a=_0xfd49[_0x38ae31];return _0x55589a;};'use strict';var _=require(_0x9fd4('0x0'));var util=require(_0x9fd4('0x1'));var logger=require(_0x9fd4('0x2'))(_0x9fd4('0x3'));var moment=require(_0x9fd4('0x4'));var BPromise=require('bluebird');var rp=require(_0x9fd4('0x5'));var fs=require('fs');var path=require(_0x9fd4('0x6'));var rimraf=require(_0x9fd4('0x7'));var config=require(_0x9fd4('0x8'));var attributes=require(_0x9fd4('0x9'));module['exports']=function(_0x5d8420,_0x89e59b){return _0x5d8420['define']('FreshsalesField',attributes,{'tableName':_0x9fd4('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x9fd4('0xb'),'FieldId'],'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 0b18d54..ebecc1f 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(_0xc14a52,_0x5b84b9){var _0x2e5227=function(_0x580348){while(--_0x580348){_0xc14a52['push'](_0xc14a52['shift']());}};_0x2e5227(++_0x5b84b9);}(_0x7c09,0x102));var _0x97c0=function(_0x1b3a7a,_0x11c287){_0x1b3a7a=_0x1b3a7a-0x0;var _0x4881e8=_0x7c09[_0x1b3a7a];return _0x4881e8;};'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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x53ec,0x192));var _0xc53e=function(_0x3f52d9,_0x1d748c){_0x3f52d9=_0x3f52d9-0x0;var _0x21e01f=_0x53ec[_0x3f52d9];return _0x21e01f;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 06fdf48..5d2f42b 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x36d79e,_0x47381e){var _0x4230c8=function(_0x2e35d5){while(--_0x2e35d5){_0x36d79e['push'](_0x36d79e['shift']());}};_0x4230c8(++_0x47381e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x33b034,_0x369348){var _0x3a6f82=function(_0x3712a8){while(--_0x3712a8){_0x33b034['push'](_0x33b034['shift']());}};_0x3a6f82(++_0x369348);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index debbaf7..2b96c83 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 _0x99e7=['username','integrationTab','sequelize','exports','STRING'];(function(_0x1a7809,_0x392d2b){var _0x10c780=function(_0x5a6219){while(--_0x5a6219){_0x1a7809['push'](_0x1a7809['shift']());}};_0x10c780(++_0x392d2b);}(_0x99e7,0x1b5));var _0x799e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x99e7[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x799e('0x0'));module[_0x799e('0x1')]={'name':{'type':Sequelize[_0x799e('0x2')]},'description':{'type':Sequelize[_0x799e('0x2')]},'username':{'type':Sequelize[_0x799e('0x2')],'unique':_0x799e('0x3')},'remoteUri':{'type':Sequelize[_0x799e('0x2')]},'password':{'type':Sequelize[_0x799e('0x2')]},'clientId':{'type':Sequelize[_0x799e('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x799e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x799e('0x4'),'newTab'),'defaultValue':_0x799e('0x4')}}; \ No newline at end of file +var _0xf1d4=['newTab','integrationTab','sequelize','STRING','username','ENUM'];(function(_0x247b94,_0x57ed01){var _0x50029f=function(_0x51013d){while(--_0x51013d){_0x247b94['push'](_0x247b94['shift']());}};_0x50029f(++_0x57ed01);}(_0xf1d4,0x158));var _0x4f1d=function(_0x4d2089,_0x46e360){_0x4d2089=_0x4d2089-0x0;var _0x10c1fb=_0xf1d4[_0x4d2089];return _0x10c1fb;};'use strict';var Sequelize=require(_0x4f1d('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f1d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4f1d('0x1')],'unique':_0x4f1d('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4f1d('0x1')]},'clientId':{'type':Sequelize[_0x4f1d('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x4f1d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4f1d('0x3')]('integrationTab',_0x4f1d('0x4')),'defaultValue':_0x4f1d('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index f01fa28..eedd20e 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 _0xc4d4=['../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','end','status','json','offset','undefined','count','limit','set','reject','update','destroy','sendStatus','error','name','send','model','map','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','SalesforceAccount','then','includeAll','include','findAll','catch','show','params','rawAttributes','length','create','body','find','getConfigurations','findOne','SalesforceConfiguration','pick','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','password','slice','lastIndexOf','Connection','clientSecret','login','username','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','int','textarea','phone','remove','includes','label','custom','picklistValues','value','boolean','True','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x46ce21,_0x254327){var _0x4901ba=function(_0x528f1c){while(--_0x528f1c){_0x46ce21['push'](_0x46ce21['shift']());}};_0x4901ba(++_0x254327);}(_0xc4d4,0x1cc));var _0x4c4d=function(_0x50514b,_0x83db65){_0x50514b=_0x50514b-0x0;var _0x5d8587=_0xc4d4[_0x50514b];return _0x5d8587;};'use strict';var emlformat=require(_0x4c4d('0x0'));var rimraf=require(_0x4c4d('0x1'));var zipdir=require(_0x4c4d('0x2'));var jsonpatch=require(_0x4c4d('0x3'));var rp=require(_0x4c4d('0x4'));var moment=require('moment');var BPromise=require(_0x4c4d('0x5'));var Mustache=require('mustache');var util=require(_0x4c4d('0x6'));var path=require('path');var sox=require(_0x4c4d('0x7'));var csv=require(_0x4c4d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c4d('0x9'));var _=require(_0x4c4d('0xa'));var squel=require(_0x4c4d('0xb'));var crypto=require(_0x4c4d('0xc'));var jsforce=require(_0x4c4d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4c4d('0x8'));var querystring=require(_0x4c4d('0xe'));var Papa=require(_0x4c4d('0xf'));var Redis=require('ioredis');var authService=require(_0x4c4d('0x10'));var qs=require(_0x4c4d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c4d('0x12'));var logger=require('../../config/logger')(_0x4c4d('0x13'));var utils=require(_0x4c4d('0x14'));var config=require(_0x4c4d('0x15'));var licenseUtil=require(_0x4c4d('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4c4d('0x17'));function respondWithStatusCode(_0x2b2601,_0x6d319a){_0x6d319a=_0x6d319a||0xcc;return function(_0x5200ae){if(_0x5200ae){return _0x2b2601['sendStatus'](_0x6d319a);}return _0x2b2601['status'](_0x6d319a)[_0x4c4d('0x18')]();};}function respondWithResult(_0x501af,_0x254fdd){_0x254fdd=_0x254fdd||0xc8;return function(_0x1b462a){if(_0x1b462a){return _0x501af[_0x4c4d('0x19')](_0x254fdd)[_0x4c4d('0x1a')](_0x1b462a);}};}function respondWithFilteredResult(_0x500a4d,_0x5c4ae0){return function(_0x416718){if(_0x416718){var _0x5a75f4=typeof _0x5c4ae0[_0x4c4d('0x1b')]===_0x4c4d('0x1c')&&typeof _0x5c4ae0['limit']===_0x4c4d('0x1c');var _0x369c2e=_0x416718['count'];var _0x5cec9d=_0x5a75f4?0x0:_0x5c4ae0[_0x4c4d('0x1b')];var _0x5a3d63=_0x5a75f4?_0x416718[_0x4c4d('0x1d')]:_0x5c4ae0[_0x4c4d('0x1b')]+_0x5c4ae0[_0x4c4d('0x1e')];var _0x183ce3;if(_0x5a3d63>=_0x369c2e){_0x5a3d63=_0x369c2e;_0x183ce3=0xc8;}else{_0x183ce3=0xce;}_0x500a4d[_0x4c4d('0x19')](_0x183ce3);return _0x500a4d[_0x4c4d('0x1f')]('Content-Range',_0x5cec9d+'-'+_0x5a3d63+'/'+_0x369c2e)['json'](_0x416718);}return null;};}function patchUpdates(_0x571095){return function(_0x4f9d29){try{jsonpatch['apply'](_0x4f9d29,_0x571095,!![]);}catch(_0x2f6261){return BPromise[_0x4c4d('0x20')](_0x2f6261);}return _0x4f9d29['save']();};}function saveUpdates(_0x33488d,_0x17ecf5){return function(_0x96e3f7){if(_0x96e3f7){return _0x96e3f7[_0x4c4d('0x21')](_0x33488d)['then'](function(_0x347c68){return _0x347c68;});}return null;};}function removeEntity(_0x5dcaaa,_0x53e3fd){return function(_0x4a3dd1){if(_0x4a3dd1){return _0x4a3dd1[_0x4c4d('0x22')]()['then'](function(){_0x5dcaaa[_0x4c4d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d8139,_0x2d9be6){return function(_0x34fb28){if(!_0x34fb28){_0x5d8139[_0x4c4d('0x23')](0x194);}return _0x34fb28;};}function handleError(_0x245eca,_0x2398c9){_0x2398c9=_0x2398c9||0x1f4;return function(_0x3ee0f7){logger[_0x4c4d('0x24')](_0x3ee0f7['stack']);if(_0x3ee0f7[_0x4c4d('0x25')]){delete _0x3ee0f7['name'];}_0x245eca[_0x4c4d('0x19')](_0x2398c9)[_0x4c4d('0x26')](_0x3ee0f7);};}exports['index']=function(_0x3dfac9,_0x58e191){var _0x1db2b0={},_0x3d56c4={},_0x2ca339={'count':0x0,'rows':[]};var _0x235987=_['map'](db['SalesforceAccount']['rawAttributes'],function(_0x49b0cf){return{'name':_0x49b0cf['fieldName'],'type':_0x49b0cf['type']['key']};});_0x3d56c4[_0x4c4d('0x27')]=_[_0x4c4d('0x28')](_0x235987,_0x4c4d('0x25'));_0x3d56c4['query']=_[_0x4c4d('0x29')](_0x3dfac9[_0x4c4d('0x2a')]);_0x3d56c4[_0x4c4d('0x2b')]=_[_0x4c4d('0x2c')](_0x3d56c4[_0x4c4d('0x27')],_0x3d56c4['query']);_0x1db2b0[_0x4c4d('0x2d')]=_[_0x4c4d('0x2c')](_0x3d56c4[_0x4c4d('0x27')],qs[_0x4c4d('0x2e')](_0x3dfac9[_0x4c4d('0x2a')][_0x4c4d('0x2e')]));_0x1db2b0[_0x4c4d('0x2d')]=_0x1db2b0[_0x4c4d('0x2d')]['length']?_0x1db2b0[_0x4c4d('0x2d')]:_0x3d56c4['model'];if(!_0x3dfac9['query']['hasOwnProperty'](_0x4c4d('0x2f'))){_0x1db2b0[_0x4c4d('0x1e')]=qs['limit'](_0x3dfac9['query']['limit']);_0x1db2b0['offset']=qs[_0x4c4d('0x1b')](_0x3dfac9[_0x4c4d('0x2a')][_0x4c4d('0x1b')]);}_0x1db2b0[_0x4c4d('0x30')]=qs[_0x4c4d('0x31')](_0x3dfac9[_0x4c4d('0x2a')][_0x4c4d('0x31')]);_0x1db2b0['where']=qs[_0x4c4d('0x2b')](_['pick'](_0x3dfac9['query'],_0x3d56c4[_0x4c4d('0x2b')]),_0x235987);if(_0x3dfac9[_0x4c4d('0x2a')][_0x4c4d('0x32')]){_0x1db2b0[_0x4c4d('0x33')]=_[_0x4c4d('0x34')](_0x1db2b0[_0x4c4d('0x33')],{'$or':_['map'](_0x235987,function(_0x502c1b){if(_0x502c1b[_0x4c4d('0x35')]!==_0x4c4d('0x36')){var _0x438a3f={};_0x438a3f[_0x502c1b[_0x4c4d('0x25')]]={'$like':'%'+_0x3dfac9[_0x4c4d('0x2a')]['filter']+'%'};return _0x438a3f;}})});}_0x1db2b0=_['merge']({},_0x1db2b0,_0x3dfac9[_0x4c4d('0x37')]);var _0x303572={'where':_0x1db2b0[_0x4c4d('0x33')]};return db[_0x4c4d('0x38')]['count'](_0x303572)[_0x4c4d('0x39')](function(_0x529697){_0x2ca339[_0x4c4d('0x1d')]=_0x529697;if(_0x3dfac9[_0x4c4d('0x2a')][_0x4c4d('0x3a')]){_0x1db2b0[_0x4c4d('0x3b')]=[{'all':!![]}];}return db[_0x4c4d('0x38')][_0x4c4d('0x3c')](_0x1db2b0);})[_0x4c4d('0x39')](function(_0x281c89){_0x2ca339['rows']=_0x281c89;return _0x2ca339;})['then'](respondWithFilteredResult(_0x58e191,_0x1db2b0))[_0x4c4d('0x3d')](handleError(_0x58e191,null));};exports[_0x4c4d('0x3e')]=function(_0x3d48f9,_0x1797a2){var _0x5d5600={'raw':![],'where':{'id':_0x3d48f9[_0x4c4d('0x3f')]['id']}},_0x8e52d7={};_0x8e52d7[_0x4c4d('0x27')]=_[_0x4c4d('0x29')](db[_0x4c4d('0x38')][_0x4c4d('0x40')]);_0x8e52d7['query']=_[_0x4c4d('0x29')](_0x3d48f9['query']);_0x8e52d7[_0x4c4d('0x2b')]=_[_0x4c4d('0x2c')](_0x8e52d7[_0x4c4d('0x27')],_0x8e52d7['query']);_0x5d5600[_0x4c4d('0x2d')]=_[_0x4c4d('0x2c')](_0x8e52d7[_0x4c4d('0x27')],qs[_0x4c4d('0x2e')](_0x3d48f9['query'][_0x4c4d('0x2e')]));_0x5d5600[_0x4c4d('0x2d')]=_0x5d5600['attributes'][_0x4c4d('0x41')]?_0x5d5600['attributes']:_0x8e52d7[_0x4c4d('0x27')];if(_0x3d48f9[_0x4c4d('0x2a')][_0x4c4d('0x3a')]){_0x5d5600[_0x4c4d('0x3b')]=[{'all':!![]}];}_0x5d5600=_[_0x4c4d('0x34')]({},_0x5d5600,_0x3d48f9[_0x4c4d('0x37')]);return db[_0x4c4d('0x38')]['find'](_0x5d5600)['then'](handleEntityNotFound(_0x1797a2,null))['then'](respondWithResult(_0x1797a2,null))[_0x4c4d('0x3d')](handleError(_0x1797a2,null));};exports[_0x4c4d('0x42')]=function(_0x2457ab,_0x31a1a1){return db[_0x4c4d('0x38')][_0x4c4d('0x42')](_0x2457ab[_0x4c4d('0x43')],{})[_0x4c4d('0x39')](respondWithResult(_0x31a1a1,0xc9))['catch'](handleError(_0x31a1a1,null));};exports[_0x4c4d('0x21')]=function(_0x58a55b,_0x5bfd7b){if(_0x58a55b[_0x4c4d('0x43')]['id']){delete _0x58a55b[_0x4c4d('0x43')]['id'];}return db[_0x4c4d('0x38')][_0x4c4d('0x44')]({'where':{'id':_0x58a55b[_0x4c4d('0x3f')]['id']}})[_0x4c4d('0x39')](handleEntityNotFound(_0x5bfd7b,null))[_0x4c4d('0x39')](saveUpdates(_0x58a55b['body'],null))[_0x4c4d('0x39')](respondWithResult(_0x5bfd7b,null))[_0x4c4d('0x3d')](handleError(_0x5bfd7b,null));};exports[_0x4c4d('0x22')]=function(_0xc4eec7,_0x36abb3){return db['SalesforceAccount'][_0x4c4d('0x44')]({'where':{'id':_0xc4eec7['params']['id']}})[_0x4c4d('0x39')](handleEntityNotFound(_0x36abb3,null))[_0x4c4d('0x39')](removeEntity(_0x36abb3,null))[_0x4c4d('0x3d')](handleError(_0x36abb3,null));};exports[_0x4c4d('0x45')]=function(_0x2a35d1,_0x3ecfdf,_0x1f16f0){var _0x296780={};var _0x507a22={};var _0x384ea4;var _0x1957de;return db[_0x4c4d('0x38')][_0x4c4d('0x46')]({'where':{'id':_0x2a35d1[_0x4c4d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3ecfdf,null))['then'](function(_0x42a27c){if(_0x42a27c){_0x384ea4=_0x42a27c;_0x507a22['model']=_[_0x4c4d('0x29')](db[_0x4c4d('0x47')][_0x4c4d('0x40')]);_0x507a22[_0x4c4d('0x2a')]=_[_0x4c4d('0x29')](_0x2a35d1[_0x4c4d('0x2a')]);_0x507a22[_0x4c4d('0x2b')]=_['intersection'](_0x507a22[_0x4c4d('0x27')],_0x507a22[_0x4c4d('0x2a')]);_0x296780[_0x4c4d('0x2d')]=_[_0x4c4d('0x2c')](_0x507a22['model'],qs[_0x4c4d('0x2e')](_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x2e')]));_0x296780[_0x4c4d('0x2d')]=_0x296780[_0x4c4d('0x2d')][_0x4c4d('0x41')]?_0x296780[_0x4c4d('0x2d')]:_0x507a22[_0x4c4d('0x27')];_0x296780[_0x4c4d('0x30')]=qs['sort'](_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x31')]);_0x296780[_0x4c4d('0x33')]=qs[_0x4c4d('0x2b')](_[_0x4c4d('0x48')](_0x2a35d1[_0x4c4d('0x2a')],_0x507a22[_0x4c4d('0x2b')]));if(_0x2a35d1['query']['filter']){_0x296780[_0x4c4d('0x33')]=_[_0x4c4d('0x34')](_0x296780['where'],{'$or':_[_0x4c4d('0x28')](_0x296780[_0x4c4d('0x2d')],function(_0x426084){var _0x57d15b={};_0x57d15b[_0x426084]={'$like':'%'+_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x32')]+'%'};return _0x57d15b;})});}_0x296780=_[_0x4c4d('0x34')]({},_0x296780,_0x2a35d1[_0x4c4d('0x37')]);return _0x384ea4[_0x4c4d('0x45')](_0x296780);}})[_0x4c4d('0x39')](function(_0x400ca9){if(_0x400ca9){_0x1957de=_0x400ca9[_0x4c4d('0x41')];if(!_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x49')](_0x4c4d('0x2f'))){_0x296780[_0x4c4d('0x1e')]=qs[_0x4c4d('0x1e')](_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x1e')]);_0x296780[_0x4c4d('0x1b')]=qs['offset'](_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x1b')]);}return _0x384ea4[_0x4c4d('0x45')](_0x296780);}})[_0x4c4d('0x39')](function(_0x5c0320){if(_0x5c0320){return _0x5c0320?{'count':_0x1957de,'rows':_0x5c0320}:null;}})[_0x4c4d('0x39')](respondWithResult(_0x3ecfdf,null))['catch'](handleError(_0x3ecfdf,null));};exports[_0x4c4d('0x4a')]=function(_0x26f55e,_0x224c2a,_0x304915){if(_0x26f55e[_0x4c4d('0x43')]['id']){delete _0x26f55e[_0x4c4d('0x43')]['id'];}return db[_0x4c4d('0x38')][_0x4c4d('0x46')]({'where':{'id':_0x26f55e[_0x4c4d('0x3f')]['id']}})[_0x4c4d('0x39')](handleEntityNotFound(_0x224c2a,null))[_0x4c4d('0x39')](function(_0x4df04e){if(_0x4df04e){_0x26f55e[_0x4c4d('0x43')][_0x4c4d('0x4b')]=_0x4df04e['id'];_0x26f55e['body']['Subjects']=integrations[_0x4c4d('0x4c')](_0x26f55e[_0x4c4d('0x43')][_0x4c4d('0x4d')],_0x26f55e[_0x4c4d('0x43')][_0x4c4d('0x35')]);_0x26f55e[_0x4c4d('0x43')]['Descriptions']=integrations['getDescriptions'](_0x26f55e['body']['channel'],_0x26f55e[_0x4c4d('0x43')][_0x4c4d('0x35')]);return db['SalesforceConfiguration']['create'](_0x26f55e[_0x4c4d('0x43')],{'include':[{'model':db[_0x4c4d('0x4e')],'as':'Subjects'},{'model':db[_0x4c4d('0x4e')],'as':_0x4c4d('0x4f')}]});}return null;})[_0x4c4d('0x39')](respondWithResult(_0x224c2a,null))[_0x4c4d('0x3d')](handleError(_0x224c2a,null));};exports[_0x4c4d('0x50')]=function(_0x465f2e,_0x3298d1,_0x38f0d6){var _0x5a3833;var _0x366923='';var _0x105246=_0x4c4d('0x51');return db['SalesforceAccount'][_0x4c4d('0x46')]({'where':{'id':_0x465f2e[_0x4c4d('0x3f')]['id']},'attributes':['id',_0x4c4d('0x52'),_0x4c4d('0x53'),'clientSecret','username',_0x4c4d('0x54'),'securityToken']})[_0x4c4d('0x39')](handleEntityNotFound(_0x3298d1,null))[_0x4c4d('0x39')](function(_0x2eeeee){if(_0x2eeeee){_0x366923=_0x2eeeee['remoteUri'];var _0x2ff0cd=_0x366923[_0x4c4d('0x55')](-0x1);if(_0x2ff0cd==='/'){_0x366923=_0x366923['substring'](0x0,_0x366923[_0x4c4d('0x56')](_0x2ff0cd));}_0x5a3833=new jsforce[(_0x4c4d('0x57'))]({'oauth2':{'loginUrl':_0x366923,'clientId':_0x2eeeee[_0x4c4d('0x53')],'clientSecret':_0x2eeeee[_0x4c4d('0x58')]}});return _0x5a3833[_0x4c4d('0x59')](_0x2eeeee[_0x4c4d('0x5a')],_0x2eeeee[_0x4c4d('0x54')][_0x4c4d('0x5b')](_0x2eeeee['securityToken']));}})[_0x4c4d('0x39')](function(_0x137b01){if(_0x137b01){if(!_[_0x4c4d('0x5c')](_0x465f2e['query'][_0x4c4d('0x5d')])){_0x105246=_0x465f2e[_0x4c4d('0x2a')][_0x4c4d('0x5d')];}return _0x5a3833[_0x4c4d('0x5e')](_0x105246)[_0x4c4d('0x5f')]();}})[_0x4c4d('0x39')](function(_0x5b0d28){var _0x10a69a=[_0x4c4d('0x60'),_0x4c4d('0x61'),'IsReminderSet',_0x4c4d('0x62'),_0x4c4d('0x63'),_0x4c4d('0x64')];var _0x4cf068=[_0x4c4d('0x65'),_0x4c4d('0x66'),'picklist','boolean','email',_0x4c4d('0x67'),_0x4c4d('0x68')];if(_0x5b0d28){_[_0x4c4d('0x69')](_0x5b0d28[_0x4c4d('0x2e')],function(_0x49acc3){return _0x10a69a[_0x4c4d('0x6a')](_0x49acc3['name'])||!_0x4cf068[_0x4c4d('0x6a')](_0x49acc3['type']);});return{'count':_0x5b0d28[_0x4c4d('0x2e')][_0x4c4d('0x41')],'rows':_['map'](_0x5b0d28[_0x4c4d('0x2e')],function(_0xbc7fda){return{'id':_0xbc7fda[_0x4c4d('0x25')],'name':_0xbc7fda[_0x4c4d('0x6b')],'custom':_0xbc7fda[_0x4c4d('0x6c')],'options':_0xbc7fda[_0x4c4d('0x6d')][_0x4c4d('0x41')]>0x0?_[_0x4c4d('0x28')](_0xbc7fda[_0x4c4d('0x6d')],function(_0x246c07){return{'name':_0x246c07['label'],'value':_0x246c07[_0x4c4d('0x6e')]};}):_0xbc7fda[_0x4c4d('0x35')]==_0x4c4d('0x6f')?[{'name':_0x4c4d('0x70'),'value':'true'},{'name':_0x4c4d('0x71'),'value':_0x4c4d('0x72')}]:[]};})};}})[_0x4c4d('0x39')](respondWithResult(_0x3298d1,null))[_0x4c4d('0x3d')](function(_0x302941){var _0x57b222=_0x465f2e[_0x4c4d('0x2a')][_0x4c4d('0x73')]?0x1f4:_0x302941['statusCode']||0x1f4;logger[_0x4c4d('0x24')](_0x4c4d('0x74'),_0x4c4d('0x50'),_0x57b222,JSON[_0x4c4d('0x75')](_0x302941));delete _0x302941[_0x4c4d('0x25')];if(_0x57b222===0x191){_0x57b222=0x190;}_0x3298d1[_0x4c4d('0x19')](_0x57b222)['send'](_0x465f2e['query'][_0x4c4d('0x73')]?{'message':_0x4c4d('0x76'),'statusCode':_0x302941[_0x4c4d('0x77')]}:_0x302941);});}; \ No newline at end of file +var _0xff5f=['sendStatus','error','stack','name','send','index','SalesforceAccount','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','catch','params','length','include','options','find','create','body','getConfigurations','findOne','SalesforceConfiguration','AccountId','getSubjects','channel','SalesforceField','Subjects','Descriptions','getFields','Task','clientId','username','password','securityToken','remoteUri','substring','lastIndexOf','Connection','clientSecret','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','Subject','int','picklist','boolean','phone','includes','label','custom','picklistValues','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','status','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x20bbd3,_0x2fbaa4){var _0x3fe1f1=function(_0x40950c){while(--_0x40950c){_0x20bbd3['push'](_0x20bbd3['shift']());}};_0x3fe1f1(++_0x2fbaa4);}(_0xff5f,0x1cc));var _0xfff5=function(_0x38626b,_0x4a615d){_0x38626b=_0x38626b-0x0;var _0x4f9913=_0xff5f[_0x38626b];return _0x4f9913;};'use strict';var emlformat=require(_0xfff5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfff5('0x1'));var rp=require(_0xfff5('0x2'));var moment=require(_0xfff5('0x3'));var BPromise=require(_0xfff5('0x4'));var Mustache=require(_0xfff5('0x5'));var util=require(_0xfff5('0x6'));var path=require(_0xfff5('0x7'));var sox=require(_0xfff5('0x8'));var csv=require(_0xfff5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfff5('0xa'));var _=require(_0xfff5('0xb'));var squel=require(_0xfff5('0xc'));var crypto=require(_0xfff5('0xd'));var jsforce=require(_0xfff5('0xe'));var deskjs=require(_0xfff5('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfff5('0x10'));var Papa=require(_0xfff5('0x11'));var Redis=require(_0xfff5('0x12'));var authService=require(_0xfff5('0x13'));var qs=require(_0xfff5('0x14'));var as=require(_0xfff5('0x15'));var hardwareService=require(_0xfff5('0x16'));var logger=require(_0xfff5('0x17'))(_0xfff5('0x18'));var utils=require(_0xfff5('0x19'));var config=require(_0xfff5('0x1a'));var licenseUtil=require(_0xfff5('0x1b'));var db=require(_0xfff5('0x1c'))['db'];var integrations=require(_0xfff5('0x1d'));function respondWithStatusCode(_0x5d99b7,_0x291cb0){_0x291cb0=_0x291cb0||0xcc;return function(_0x38bf54){if(_0x38bf54){return _0x5d99b7['sendStatus'](_0x291cb0);}return _0x5d99b7['status'](_0x291cb0)[_0xfff5('0x1e')]();};}function respondWithResult(_0x192d97,_0x59c157){_0x59c157=_0x59c157||0xc8;return function(_0x887160){if(_0x887160){return _0x192d97['status'](_0x59c157)[_0xfff5('0x1f')](_0x887160);}};}function respondWithFilteredResult(_0x74b661,_0x49273b){return function(_0x4f1924){if(_0x4f1924){var _0x56a9e8=typeof _0x49273b[_0xfff5('0x20')]===_0xfff5('0x21')&&typeof _0x49273b[_0xfff5('0x22')]===_0xfff5('0x21');var _0x3790f2=_0x4f1924[_0xfff5('0x23')];var _0x4407f1=_0x56a9e8?0x0:_0x49273b['offset'];var _0x143bec=_0x56a9e8?_0x4f1924[_0xfff5('0x23')]:_0x49273b[_0xfff5('0x20')]+_0x49273b[_0xfff5('0x22')];var _0x28c9f3;if(_0x143bec>=_0x3790f2){_0x143bec=_0x3790f2;_0x28c9f3=0xc8;}else{_0x28c9f3=0xce;}_0x74b661['status'](_0x28c9f3);return _0x74b661[_0xfff5('0x24')](_0xfff5('0x25'),_0x4407f1+'-'+_0x143bec+'/'+_0x3790f2)[_0xfff5('0x1f')](_0x4f1924);}return null;};}function patchUpdates(_0x316f92){return function(_0x141075){try{jsonpatch[_0xfff5('0x26')](_0x141075,_0x316f92,!![]);}catch(_0x174f26){return BPromise[_0xfff5('0x27')](_0x174f26);}return _0x141075[_0xfff5('0x28')]();};}function saveUpdates(_0xcc4884,_0x7aee21){return function(_0x2a0b18){if(_0x2a0b18){return _0x2a0b18[_0xfff5('0x29')](_0xcc4884)['then'](function(_0x383691){return _0x383691;});}return null;};}function removeEntity(_0x4b369b,_0x176049){return function(_0x18f211){if(_0x18f211){return _0x18f211[_0xfff5('0x2a')]()[_0xfff5('0x2b')](function(){_0x4b369b['status'](0xcc)[_0xfff5('0x1e')]();});}};}function handleEntityNotFound(_0x298b9c,_0x345d8d){return function(_0x19f6ec){if(!_0x19f6ec){_0x298b9c[_0xfff5('0x2c')](0x194);}return _0x19f6ec;};}function handleError(_0x27b06d,_0x44858b){_0x44858b=_0x44858b||0x1f4;return function(_0x178b97){logger[_0xfff5('0x2d')](_0x178b97[_0xfff5('0x2e')]);if(_0x178b97[_0xfff5('0x2f')]){delete _0x178b97[_0xfff5('0x2f')];}_0x27b06d['status'](_0x44858b)[_0xfff5('0x30')](_0x178b97);};}exports[_0xfff5('0x31')]=function(_0x7aa619,_0x10c78b){var _0x5286ae={},_0x2639af={},_0x1db454={'count':0x0,'rows':[]};var _0x3281c6=_['map'](db[_0xfff5('0x32')][_0xfff5('0x33')],function(_0x4c634d){return{'name':_0x4c634d['fieldName'],'type':_0x4c634d[_0xfff5('0x34')]['key']};});_0x2639af[_0xfff5('0x35')]=_['map'](_0x3281c6,'name');_0x2639af['query']=_[_0xfff5('0x36')](_0x7aa619[_0xfff5('0x37')]);_0x2639af[_0xfff5('0x38')]=_[_0xfff5('0x39')](_0x2639af[_0xfff5('0x35')],_0x2639af['query']);_0x5286ae[_0xfff5('0x3a')]=_[_0xfff5('0x39')](_0x2639af[_0xfff5('0x35')],qs[_0xfff5('0x3b')](_0x7aa619[_0xfff5('0x37')]['fields']));_0x5286ae[_0xfff5('0x3a')]=_0x5286ae['attributes']['length']?_0x5286ae[_0xfff5('0x3a')]:_0x2639af['model'];if(!_0x7aa619[_0xfff5('0x37')][_0xfff5('0x3c')](_0xfff5('0x3d'))){_0x5286ae[_0xfff5('0x22')]=qs[_0xfff5('0x22')](_0x7aa619[_0xfff5('0x37')][_0xfff5('0x22')]);_0x5286ae['offset']=qs[_0xfff5('0x20')](_0x7aa619[_0xfff5('0x37')][_0xfff5('0x20')]);}_0x5286ae[_0xfff5('0x3e')]=qs[_0xfff5('0x3f')](_0x7aa619[_0xfff5('0x37')]['sort']);_0x5286ae[_0xfff5('0x40')]=qs['filters'](_[_0xfff5('0x41')](_0x7aa619[_0xfff5('0x37')],_0x2639af['filters']),_0x3281c6);if(_0x7aa619['query'][_0xfff5('0x42')]){_0x5286ae[_0xfff5('0x40')]=_[_0xfff5('0x43')](_0x5286ae['where'],{'$or':_[_0xfff5('0x44')](_0x3281c6,function(_0x4ee303){if(_0x4ee303['type']!==_0xfff5('0x45')){var _0x1f2918={};_0x1f2918[_0x4ee303[_0xfff5('0x2f')]]={'$like':'%'+_0x7aa619[_0xfff5('0x37')][_0xfff5('0x42')]+'%'};return _0x1f2918;}})});}_0x5286ae=_['merge']({},_0x5286ae,_0x7aa619['options']);var _0x2b24d5={'where':_0x5286ae['where']};return db[_0xfff5('0x32')][_0xfff5('0x23')](_0x2b24d5)[_0xfff5('0x2b')](function(_0x3db551){_0x1db454[_0xfff5('0x23')]=_0x3db551;if(_0x7aa619[_0xfff5('0x37')][_0xfff5('0x46')]){_0x5286ae['include']=[{'all':!![]}];}return db[_0xfff5('0x32')][_0xfff5('0x47')](_0x5286ae);})['then'](function(_0xf42737){_0x1db454['rows']=_0xf42737;return _0x1db454;})[_0xfff5('0x2b')](respondWithFilteredResult(_0x10c78b,_0x5286ae))[_0xfff5('0x48')](handleError(_0x10c78b,null));};exports['show']=function(_0x2bcc45,_0x1cd401){var _0x1741c9={'raw':![],'where':{'id':_0x2bcc45[_0xfff5('0x49')]['id']}},_0x4c0de5={};_0x4c0de5[_0xfff5('0x35')]=_[_0xfff5('0x36')](db[_0xfff5('0x32')][_0xfff5('0x33')]);_0x4c0de5[_0xfff5('0x37')]=_[_0xfff5('0x36')](_0x2bcc45[_0xfff5('0x37')]);_0x4c0de5[_0xfff5('0x38')]=_[_0xfff5('0x39')](_0x4c0de5[_0xfff5('0x35')],_0x4c0de5[_0xfff5('0x37')]);_0x1741c9[_0xfff5('0x3a')]=_[_0xfff5('0x39')](_0x4c0de5[_0xfff5('0x35')],qs[_0xfff5('0x3b')](_0x2bcc45[_0xfff5('0x37')][_0xfff5('0x3b')]));_0x1741c9[_0xfff5('0x3a')]=_0x1741c9[_0xfff5('0x3a')][_0xfff5('0x4a')]?_0x1741c9[_0xfff5('0x3a')]:_0x4c0de5[_0xfff5('0x35')];if(_0x2bcc45['query']['includeAll']){_0x1741c9[_0xfff5('0x4b')]=[{'all':!![]}];}_0x1741c9=_[_0xfff5('0x43')]({},_0x1741c9,_0x2bcc45[_0xfff5('0x4c')]);return db[_0xfff5('0x32')][_0xfff5('0x4d')](_0x1741c9)[_0xfff5('0x2b')](handleEntityNotFound(_0x1cd401,null))[_0xfff5('0x2b')](respondWithResult(_0x1cd401,null))[_0xfff5('0x48')](handleError(_0x1cd401,null));};exports[_0xfff5('0x4e')]=function(_0x3f9f00,_0x582791){return db['SalesforceAccount']['create'](_0x3f9f00[_0xfff5('0x4f')],{})[_0xfff5('0x2b')](respondWithResult(_0x582791,0xc9))[_0xfff5('0x48')](handleError(_0x582791,null));};exports[_0xfff5('0x29')]=function(_0x4087c4,_0x1b43ef){if(_0x4087c4[_0xfff5('0x4f')]['id']){delete _0x4087c4[_0xfff5('0x4f')]['id'];}return db[_0xfff5('0x32')][_0xfff5('0x4d')]({'where':{'id':_0x4087c4[_0xfff5('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b43ef,null))[_0xfff5('0x2b')](saveUpdates(_0x4087c4[_0xfff5('0x4f')],null))[_0xfff5('0x2b')](respondWithResult(_0x1b43ef,null))[_0xfff5('0x48')](handleError(_0x1b43ef,null));};exports[_0xfff5('0x2a')]=function(_0x151506,_0x4aaf0f){return db['SalesforceAccount'][_0xfff5('0x4d')]({'where':{'id':_0x151506['params']['id']}})[_0xfff5('0x2b')](handleEntityNotFound(_0x4aaf0f,null))[_0xfff5('0x2b')](removeEntity(_0x4aaf0f,null))[_0xfff5('0x48')](handleError(_0x4aaf0f,null));};exports[_0xfff5('0x50')]=function(_0x4bbf93,_0x60b957,_0xd5ed57){var _0x26272e={};var _0x10d246={};var _0x2d94fb;var _0x1a69be;return db[_0xfff5('0x32')][_0xfff5('0x51')]({'where':{'id':_0x4bbf93[_0xfff5('0x49')]['id']}})[_0xfff5('0x2b')](handleEntityNotFound(_0x60b957,null))[_0xfff5('0x2b')](function(_0x286f7a){if(_0x286f7a){_0x2d94fb=_0x286f7a;_0x10d246['model']=_['keys'](db[_0xfff5('0x52')][_0xfff5('0x33')]);_0x10d246[_0xfff5('0x37')]=_[_0xfff5('0x36')](_0x4bbf93[_0xfff5('0x37')]);_0x10d246[_0xfff5('0x38')]=_[_0xfff5('0x39')](_0x10d246[_0xfff5('0x35')],_0x10d246[_0xfff5('0x37')]);_0x26272e['attributes']=_['intersection'](_0x10d246[_0xfff5('0x35')],qs[_0xfff5('0x3b')](_0x4bbf93[_0xfff5('0x37')]['fields']));_0x26272e[_0xfff5('0x3a')]=_0x26272e[_0xfff5('0x3a')][_0xfff5('0x4a')]?_0x26272e[_0xfff5('0x3a')]:_0x10d246[_0xfff5('0x35')];_0x26272e[_0xfff5('0x3e')]=qs[_0xfff5('0x3f')](_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x3f')]);_0x26272e[_0xfff5('0x40')]=qs[_0xfff5('0x38')](_[_0xfff5('0x41')](_0x4bbf93[_0xfff5('0x37')],_0x10d246['filters']));if(_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x42')]){_0x26272e['where']=_['merge'](_0x26272e[_0xfff5('0x40')],{'$or':_[_0xfff5('0x44')](_0x26272e['attributes'],function(_0x406544){var _0x12e9e0={};_0x12e9e0[_0x406544]={'$like':'%'+_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x42')]+'%'};return _0x12e9e0;})});}_0x26272e=_[_0xfff5('0x43')]({},_0x26272e,_0x4bbf93[_0xfff5('0x4c')]);return _0x2d94fb[_0xfff5('0x50')](_0x26272e);}})[_0xfff5('0x2b')](function(_0x463175){if(_0x463175){_0x1a69be=_0x463175[_0xfff5('0x4a')];if(!_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x3c')]('nolimit')){_0x26272e[_0xfff5('0x22')]=qs[_0xfff5('0x22')](_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x22')]);_0x26272e[_0xfff5('0x20')]=qs[_0xfff5('0x20')](_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x20')]);}return _0x2d94fb[_0xfff5('0x50')](_0x26272e);}})[_0xfff5('0x2b')](function(_0x488aeb){if(_0x488aeb){return _0x488aeb?{'count':_0x1a69be,'rows':_0x488aeb}:null;}})['then'](respondWithResult(_0x60b957,null))['catch'](handleError(_0x60b957,null));};exports['addConfiguration']=function(_0x3b3e79,_0x434a53,_0x14c6eb){if(_0x3b3e79['body']['id']){delete _0x3b3e79[_0xfff5('0x4f')]['id'];}return db[_0xfff5('0x32')][_0xfff5('0x51')]({'where':{'id':_0x3b3e79[_0xfff5('0x49')]['id']}})[_0xfff5('0x2b')](handleEntityNotFound(_0x434a53,null))['then'](function(_0x19a29b){if(_0x19a29b){_0x3b3e79[_0xfff5('0x4f')][_0xfff5('0x53')]=_0x19a29b['id'];_0x3b3e79[_0xfff5('0x4f')]['Subjects']=integrations[_0xfff5('0x54')](_0x3b3e79['body'][_0xfff5('0x55')],_0x3b3e79['body'][_0xfff5('0x34')]);_0x3b3e79[_0xfff5('0x4f')]['Descriptions']=integrations['getDescriptions'](_0x3b3e79['body'][_0xfff5('0x55')],_0x3b3e79[_0xfff5('0x4f')][_0xfff5('0x34')]);return db[_0xfff5('0x52')][_0xfff5('0x4e')](_0x3b3e79[_0xfff5('0x4f')],{'include':[{'model':db[_0xfff5('0x56')],'as':_0xfff5('0x57')},{'model':db[_0xfff5('0x56')],'as':_0xfff5('0x58')}]});}return null;})[_0xfff5('0x2b')](respondWithResult(_0x434a53,null))[_0xfff5('0x48')](handleError(_0x434a53,null));};exports[_0xfff5('0x59')]=function(_0x4f0e10,_0xd8372f,_0x5df0e9){var _0x3cc63b;var _0x3e11af='';var _0x27011e=_0xfff5('0x5a');return db[_0xfff5('0x32')][_0xfff5('0x51')]({'where':{'id':_0x4f0e10['params']['id']},'attributes':['id','remoteUri',_0xfff5('0x5b'),'clientSecret',_0xfff5('0x5c'),_0xfff5('0x5d'),_0xfff5('0x5e')]})[_0xfff5('0x2b')](handleEntityNotFound(_0xd8372f,null))[_0xfff5('0x2b')](function(_0xc60095){if(_0xc60095){_0x3e11af=_0xc60095[_0xfff5('0x5f')];var _0x5cb531=_0x3e11af['slice'](-0x1);if(_0x5cb531==='/'){_0x3e11af=_0x3e11af[_0xfff5('0x60')](0x0,_0x3e11af[_0xfff5('0x61')](_0x5cb531));}_0x3cc63b=new jsforce[(_0xfff5('0x62'))]({'oauth2':{'loginUrl':_0x3e11af,'clientId':_0xc60095[_0xfff5('0x5b')],'clientSecret':_0xc60095[_0xfff5('0x63')]}});return _0x3cc63b[_0xfff5('0x64')](_0xc60095[_0xfff5('0x5c')],_0xc60095[_0xfff5('0x5d')][_0xfff5('0x65')](_0xc60095[_0xfff5('0x5e')]));}})['then'](function(_0x34c868){if(_0x34c868){if(!_[_0xfff5('0x66')](_0x4f0e10[_0xfff5('0x37')]['ticketType'])){_0x27011e=_0x4f0e10['query'][_0xfff5('0x67')];}return _0x3cc63b[_0xfff5('0x68')](_0x27011e)['describe']();}})[_0xfff5('0x2b')](function(_0x39dff5){var _0x50a919=[_0xfff5('0x69'),_0xfff5('0x6a'),_0xfff5('0x6b'),'IsRecurrence',_0xfff5('0x6c'),'Description'];var _0x2144cd=['string',_0xfff5('0x6d'),_0xfff5('0x6e'),_0xfff5('0x6f'),'email','textarea',_0xfff5('0x70')];if(_0x39dff5){_['remove'](_0x39dff5[_0xfff5('0x3b')],function(_0x4a4e79){return _0x50a919[_0xfff5('0x71')](_0x4a4e79[_0xfff5('0x2f')])||!_0x2144cd[_0xfff5('0x71')](_0x4a4e79[_0xfff5('0x34')]);});return{'count':_0x39dff5[_0xfff5('0x3b')][_0xfff5('0x4a')],'rows':_[_0xfff5('0x44')](_0x39dff5[_0xfff5('0x3b')],function(_0x2c65cc){return{'id':_0x2c65cc['name'],'name':_0x2c65cc[_0xfff5('0x72')],'custom':_0x2c65cc[_0xfff5('0x73')],'options':_0x2c65cc['picklistValues']['length']>0x0?_['map'](_0x2c65cc[_0xfff5('0x74')],function(_0x446c64){return{'name':_0x446c64[_0xfff5('0x72')],'value':_0x446c64['value']};}):_0x2c65cc[_0xfff5('0x34')]==_0xfff5('0x6f')?[{'name':_0xfff5('0x75'),'value':_0xfff5('0x76')},{'name':_0xfff5('0x77'),'value':_0xfff5('0x78')}]:[]};})};}})[_0xfff5('0x2b')](respondWithResult(_0xd8372f,null))[_0xfff5('0x48')](function(_0x138638){var _0x54e205=_0x4f0e10[_0xfff5('0x37')][_0xfff5('0x79')]?0x1f4:_0x138638[_0xfff5('0x7a')]||0x1f4;logger['error'](_0xfff5('0x7b'),_0xfff5('0x59'),_0x54e205,JSON['stringify'](_0x138638));delete _0x138638[_0xfff5('0x2f')];if(_0x54e205===0x191){_0x54e205=0x190;}_0xd8372f[_0xfff5('0x7c')](_0x54e205)[_0xfff5('0x30')](_0x4f0e10[_0xfff5('0x37')][_0xfff5('0x79')]?{'message':_0xfff5('0x7d'),'statusCode':_0x138638[_0xfff5('0x7a')]}:_0x138638);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 6826e04..40a88bb 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 _0x0178=['rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','api','moment','bluebird','request-promise','path'];(function(_0x3ba38b,_0x39c0be){var _0x574206=function(_0x138d19){while(--_0x138d19){_0x3ba38b['push'](_0x3ba38b['shift']());}};_0x574206(++_0x39c0be);}(_0x0178,0x1e6));var _0x8017=function(_0x5133a0,_0x2289a0){_0x5133a0=_0x5133a0-0x0;var _0x1f6247=_0x0178[_0x5133a0];return _0x1f6247;};'use strict';var _=require(_0x8017('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8017('0x1'));var moment=require(_0x8017('0x2'));var BPromise=require(_0x8017('0x3'));var rp=require(_0x8017('0x4'));var fs=require('fs');var path=require(_0x8017('0x5'));var rimraf=require(_0x8017('0x6'));var config=require('../../config/environment');var attributes=require(_0x8017('0x7'));var integrations=require(_0x8017('0x8'));module['exports']=function(_0x4ff3f7,_0x5dab34){return _0x4ff3f7[_0x8017('0x9')](_0x8017('0xa'),attributes,{'tableName':_0x8017('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e49=['path','rimraf','./intSalesforceAccount.attributes','define','SalesforceAccount','lodash','util','../../config/logger','bluebird'];(function(_0x109638,_0x3e2ddf){var _0x2af141=function(_0xc47504){while(--_0xc47504){_0x109638['push'](_0x109638['shift']());}};_0x2af141(++_0x3e2ddf);}(_0x5e49,0x152));var _0x95e4=function(_0x3dc190,_0xa6c975){_0x3dc190=_0x3dc190-0x0;var _0x5bde76=_0x5e49[_0x3dc190];return _0x5bde76;};'use strict';var _=require(_0x95e4('0x0'));var util=require(_0x95e4('0x1'));var logger=require(_0x95e4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x95e4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x95e4('0x4'));var rimraf=require(_0x95e4('0x5'));var config=require('../../config/environment');var attributes=require(_0x95e4('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x515e57,_0x1c5ba0){return _0x515e57[_0x95e4('0x7')](_0x95e4('0x8'),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 edbfa34..02c1619 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 _0x9953=['http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSalesforceAccount','SalesforceAccount','findAll','raw','where','attributes','options','limit','include','model','map','then','catch','ShowSalesforceAccount','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2a1575,_0x50a230){var _0x5a1b4c=function(_0x2da545){while(--_0x2da545){_0x2a1575['push'](_0x2a1575['shift']());}};_0x5a1b4c(++_0x50a230);}(_0x9953,0x1d7));var _0x3995=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x9953[_0x81dcac];return _0xc7803b;};'use strict';var _=require('lodash');var util=require(_0x3995('0x0'));var moment=require(_0x3995('0x1'));var BPromise=require(_0x3995('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3995('0x3'));var db=require(_0x3995('0x4'))['db'];var utils=require(_0x3995('0x5'));var logger=require(_0x3995('0x6'))(_0x3995('0x7'));var config=require(_0x3995('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3995('0x9')][_0x3995('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x224056,_0x9ecd5b,_0x3cafcf){return new BPromise(function(_0x23c0f7,_0x473f1d){return client[_0x3995('0xb')](_0x224056,_0x3cafcf)['then'](function(_0x3b5854){logger[_0x3995('0xc')](_0x3995('0xd'),_0x9ecd5b,_0x3995('0xe'));logger[_0x3995('0xf')](_0x3995('0x10'),_0x9ecd5b,_0x3995('0xe'),JSON[_0x3995('0x11')](_0x3b5854));if(_0x3b5854[_0x3995('0x12')]){if(_0x3b5854[_0x3995('0x12')][_0x3995('0x13')]===0x1f4){logger[_0x3995('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x9ecd5b,_0x3b5854['error'][_0x3995('0x14')]);return _0x473f1d(_0x3b5854[_0x3995('0x12')][_0x3995('0x14')]);}logger[_0x3995('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x9ecd5b,_0x3b5854[_0x3995('0x12')][_0x3995('0x14')]);return _0x23c0f7(_0x3b5854['error']['message']);}else{logger[_0x3995('0xc')](_0x3995('0xd'),_0x9ecd5b,'request\x20sent');_0x23c0f7(_0x3b5854[_0x3995('0x15')]['message']);}})['catch'](function(_0xebc4fc){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x9ecd5b,_0xebc4fc);_0x473f1d(_0xebc4fc);});});}exports[_0x3995('0x16')]=function(_0x7708d3){var _0x1e5c3b=this;return new Promise(function(_0x3ab1d9,_0x5ae951){return db[_0x3995('0x17')][_0x3995('0x18')]({'raw':_0x7708d3['options']?_0x7708d3['options'][_0x3995('0x19')]===undefined?!![]:![]:!![],'where':_0x7708d3['options']?_0x7708d3['options'][_0x3995('0x1a')]||null:null,'attributes':_0x7708d3['options']?_0x7708d3['options'][_0x3995('0x1b')]||null:null,'limit':_0x7708d3[_0x3995('0x1c')]?_0x7708d3['options'][_0x3995('0x1d')]||null:null,'include':_0x7708d3[_0x3995('0x1c')]?_0x7708d3[_0x3995('0x1c')][_0x3995('0x1e')]?_['map'](_0x7708d3['options']['include'],function(_0x4e0827){return{'model':db[_0x4e0827[_0x3995('0x1f')]],'as':_0x4e0827['as'],'attributes':_0x4e0827[_0x3995('0x1b')],'include':_0x4e0827[_0x3995('0x1e')]?_['map'](_0x4e0827[_0x3995('0x1e')],function(_0x38379c){return{'model':db[_0x38379c[_0x3995('0x1f')]],'as':_0x38379c['as'],'attributes':_0x38379c[_0x3995('0x1b')],'include':_0x38379c[_0x3995('0x1e')]?_[_0x3995('0x20')](_0x38379c['include'],function(_0x185289){return{'model':db[_0x185289[_0x3995('0x1f')]],'as':_0x185289['as'],'attributes':_0x185289[_0x3995('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3995('0x21')](function(_0x28efd8){logger[_0x3995('0xc')]('GetSalesforceAccount',_0x7708d3);logger[_0x3995('0xf')](_0x3995('0x16'),_0x7708d3,JSON[_0x3995('0x11')](_0x28efd8));_0x3ab1d9(_0x28efd8);})[_0x3995('0x22')](function(_0x1c0592){logger['error'](_0x3995('0x16'),_0x1c0592[_0x3995('0x14')],_0x7708d3);_0x5ae951(_0x1e5c3b[_0x3995('0x12')](0x1f4,_0x1c0592[_0x3995('0x14')]));});});};exports[_0x3995('0x23')]=function(_0x20004a){var _0xc332c5=this;return new Promise(function(_0x303312,_0x306f7c){return db[_0x3995('0x17')][_0x3995('0x24')]({'raw':_0x20004a[_0x3995('0x1c')]?_0x20004a[_0x3995('0x1c')][_0x3995('0x19')]===undefined?!![]:![]:!![],'where':_0x20004a[_0x3995('0x1c')]?_0x20004a[_0x3995('0x1c')]['where']||null:null,'attributes':_0x20004a['options']?_0x20004a[_0x3995('0x1c')][_0x3995('0x1b')]||null:null,'include':_0x20004a[_0x3995('0x1c')]?_0x20004a['options'][_0x3995('0x1e')]?_[_0x3995('0x20')](_0x20004a[_0x3995('0x1c')][_0x3995('0x1e')],function(_0x16fece){return{'model':db[_0x16fece[_0x3995('0x1f')]],'as':_0x16fece['as'],'attributes':_0x16fece[_0x3995('0x1b')],'include':_0x16fece[_0x3995('0x1e')]?_[_0x3995('0x20')](_0x16fece[_0x3995('0x1e')],function(_0x376b89){return{'model':db[_0x376b89['model']],'as':_0x376b89['as'],'attributes':_0x376b89[_0x3995('0x1b')],'include':_0x376b89[_0x3995('0x1e')]?_[_0x3995('0x20')](_0x376b89[_0x3995('0x1e')],function(_0x4490f2){return{'model':db[_0x4490f2[_0x3995('0x1f')]],'as':_0x4490f2['as'],'attributes':_0x4490f2[_0x3995('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3995('0x21')](function(_0x2438a6){logger[_0x3995('0xc')](_0x3995('0x23'),_0x20004a);logger[_0x3995('0xf')](_0x3995('0x23'),_0x20004a,JSON['stringify'](_0x2438a6));_0x303312(_0x2438a6);})[_0x3995('0x22')](function(_0x3116bc){logger['error'](_0x3995('0x23'),_0x3116bc['message'],_0x20004a);_0x306f7c(_0xc332c5[_0x3995('0x12')](0x1f4,_0x3116bc[_0x3995('0x14')]));});});}; \ No newline at end of file +var _0x860c=['catch','SalesforceAccount','find','where','ShowSalesforceAccount','lodash','moment','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetSalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','debug'];(function(_0x493e2c,_0x4ba39c){var _0x5ec0d8=function(_0x465107){while(--_0x465107){_0x493e2c['push'](_0x493e2c['shift']());}};_0x5ec0d8(++_0x4ba39c);}(_0x860c,0x14f));var _0xc860=function(_0x344fc3,_0x2612ed){_0x344fc3=_0x344fc3-0x0;var _0x1c8a58=_0x860c[_0x344fc3];return _0x1c8a58;};'use strict';var _=require(_0xc860('0x0'));var util=require('util');var moment=require(_0xc860('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc860('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc860('0x3'));var logger=require('../../config/logger')(_0xc860('0x4'));var config=require('../../config/environment');var jayson=require(_0xc860('0x5'));var client=jayson[_0xc860('0x6')][_0xc860('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfc9741,_0x3557e1,_0x266441){return new BPromise(function(_0x38f86c,_0x106dda){return client[_0xc860('0x8')](_0xfc9741,_0x266441)[_0xc860('0x9')](function(_0x344047){logger[_0xc860('0xa')](_0xc860('0xb'),_0x3557e1,'request\x20sent');logger['debug'](_0xc860('0xc'),_0x3557e1,_0xc860('0xd'),JSON[_0xc860('0xe')](_0x344047));if(_0x344047[_0xc860('0xf')]){if(_0x344047[_0xc860('0xf')][_0xc860('0x10')]===0x1f4){logger[_0xc860('0xf')](_0xc860('0xb'),_0x3557e1,_0x344047['error'][_0xc860('0x11')]);return _0x106dda(_0x344047[_0xc860('0xf')][_0xc860('0x11')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x3557e1,_0x344047['error'][_0xc860('0x11')]);return _0x38f86c(_0x344047[_0xc860('0xf')][_0xc860('0x11')]);}else{logger[_0xc860('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x3557e1,'request\x20sent');_0x38f86c(_0x344047['result'][_0xc860('0x11')]);}})['catch'](function(_0x4069c7){logger[_0xc860('0xf')](_0xc860('0xb'),_0x3557e1,_0x4069c7);_0x106dda(_0x4069c7);});});}exports[_0xc860('0x12')]=function(_0x19f244){var _0x4c06a8=this;return new Promise(function(_0x2241dc,_0x28a99c){return db['SalesforceAccount'][_0xc860('0x13')]({'raw':_0x19f244[_0xc860('0x14')]?_0x19f244[_0xc860('0x14')][_0xc860('0x15')]===undefined?!![]:![]:!![],'where':_0x19f244['options']?_0x19f244[_0xc860('0x14')]['where']||null:null,'attributes':_0x19f244[_0xc860('0x14')]?_0x19f244[_0xc860('0x14')][_0xc860('0x16')]||null:null,'limit':_0x19f244[_0xc860('0x14')]?_0x19f244[_0xc860('0x14')][_0xc860('0x17')]||null:null,'include':_0x19f244['options']?_0x19f244[_0xc860('0x14')][_0xc860('0x18')]?_[_0xc860('0x19')](_0x19f244['options'][_0xc860('0x18')],function(_0x4688cd){return{'model':db[_0x4688cd['model']],'as':_0x4688cd['as'],'attributes':_0x4688cd[_0xc860('0x16')],'include':_0x4688cd[_0xc860('0x18')]?_[_0xc860('0x19')](_0x4688cd[_0xc860('0x18')],function(_0x424a55){return{'model':db[_0x424a55[_0xc860('0x1a')]],'as':_0x424a55['as'],'attributes':_0x424a55['attributes'],'include':_0x424a55['include']?_[_0xc860('0x19')](_0x424a55[_0xc860('0x18')],function(_0x47a39e){return{'model':db[_0x47a39e[_0xc860('0x1a')]],'as':_0x47a39e['as'],'attributes':_0x47a39e[_0xc860('0x16')]};}):[]};}):[]};}):[]:[]})[_0xc860('0x9')](function(_0x16e404){logger['info'](_0xc860('0x12'),_0x19f244);logger[_0xc860('0x1b')](_0xc860('0x12'),_0x19f244,JSON[_0xc860('0xe')](_0x16e404));_0x2241dc(_0x16e404);})[_0xc860('0x1c')](function(_0x439d21){logger[_0xc860('0xf')](_0xc860('0x12'),_0x439d21[_0xc860('0x11')],_0x19f244);_0x28a99c(_0x4c06a8['error'](0x1f4,_0x439d21['message']));});});};exports['ShowSalesforceAccount']=function(_0x530ad4){var _0x1f28c2=this;return new Promise(function(_0x41b095,_0x63b583){return db[_0xc860('0x1d')][_0xc860('0x1e')]({'raw':_0x530ad4[_0xc860('0x14')]?_0x530ad4[_0xc860('0x14')][_0xc860('0x15')]===undefined?!![]:![]:!![],'where':_0x530ad4[_0xc860('0x14')]?_0x530ad4[_0xc860('0x14')][_0xc860('0x1f')]||null:null,'attributes':_0x530ad4[_0xc860('0x14')]?_0x530ad4[_0xc860('0x14')][_0xc860('0x16')]||null:null,'include':_0x530ad4[_0xc860('0x14')]?_0x530ad4[_0xc860('0x14')]['include']?_[_0xc860('0x19')](_0x530ad4[_0xc860('0x14')][_0xc860('0x18')],function(_0x1146d6){return{'model':db[_0x1146d6[_0xc860('0x1a')]],'as':_0x1146d6['as'],'attributes':_0x1146d6[_0xc860('0x16')],'include':_0x1146d6[_0xc860('0x18')]?_['map'](_0x1146d6[_0xc860('0x18')],function(_0x17d57e){return{'model':db[_0x17d57e[_0xc860('0x1a')]],'as':_0x17d57e['as'],'attributes':_0x17d57e[_0xc860('0x16')],'include':_0x17d57e[_0xc860('0x18')]?_[_0xc860('0x19')](_0x17d57e[_0xc860('0x18')],function(_0x58f6e0){return{'model':db[_0x58f6e0[_0xc860('0x1a')]],'as':_0x58f6e0['as'],'attributes':_0x58f6e0['attributes']};}):[]};}):[]};}):[]:[]})[_0xc860('0x9')](function(_0xf90fde){logger[_0xc860('0xa')](_0xc860('0x20'),_0x530ad4);logger[_0xc860('0x1b')]('ShowSalesforceAccount',_0x530ad4,JSON[_0xc860('0xe')](_0xf90fde));_0x41b095(_0xf90fde);})[_0xc860('0x1c')](function(_0x47fe21){logger[_0xc860('0xf')](_0xc860('0x20'),_0x47fe21['message'],_0x530ad4);_0x63b583(_0x1f28c2[_0xc860('0xf')](0x1f4,_0x47fe21['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index f6e05dd..30a24f4 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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x43f34e,_0x90a749){var _0x93eac8=function(_0x319e57){while(--_0x319e57){_0x43f34e['push'](_0x43f34e['shift']());}};_0x93eac8(++_0x90a749);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x0b0e,0x187));var _0xe0b0=function(_0x25f805,_0x59caf3){_0x25f805=_0x25f805-0x0;var _0xf6628f=_0x0b0e[_0x25f805];return _0xf6628f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 26a04f5..30d9533 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 _0xa57f=['account','contact','exports','STRING','Case','Task','ENUM','contact_lead','lead'];(function(_0x4eb156,_0x4fb47a){var _0x5dc502=function(_0x1899d8){while(--_0x1899d8){_0x4eb156['push'](_0x4eb156['shift']());}};_0x5dc502(++_0x4fb47a);}(_0xa57f,0x77));var _0xfa57=function(_0xa2e43d,_0x3d08aa){_0xa2e43d=_0xa2e43d-0x0;var _0x13fe43=_0xa57f[_0xa2e43d];return _0x13fe43;};'use strict';var Sequelize=require('sequelize');module[_0xfa57('0x0')]={'name':{'type':Sequelize[_0xfa57('0x1')]},'description':{'type':Sequelize[_0xfa57('0x1')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0xfa57('0x2')),'defaultValue':_0xfa57('0x3')},'moduleSearch':{'type':Sequelize[_0xfa57('0x4')](_0xfa57('0x5'),'contact',_0xfa57('0x6'),'account_contact_lead',_0xfa57('0x7')),'defaultValue':_0xfa57('0x5')},'moduleCreate':{'type':Sequelize[_0xfa57('0x4')]('nothing',_0xfa57('0x8'),_0xfa57('0x6'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xfa57('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xfa57('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xfa57('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xfa57('0x1')]}}; \ No newline at end of file +var _0xe90f=['lead','account_contact_lead','nothing','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x1230ea,_0x499a33){var _0xe946e2=function(_0x29a4e9){while(--_0x29a4e9){_0x1230ea['push'](_0x1230ea['shift']());}};_0xe946e2(++_0x499a33);}(_0xe90f,0xc9));var _0xfe90=function(_0x27c021,_0x190f72){_0x27c021=_0x27c021-0x0;var _0x1d0700=_0xe90f[_0x27c021];return _0x1d0700;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfe90('0x0')]},'description':{'type':Sequelize[_0xfe90('0x0')]},'ticketType':{'type':Sequelize[_0xfe90('0x1')](_0xfe90('0x2'),_0xfe90('0x3')),'defaultValue':_0xfe90('0x2')},'moduleSearch':{'type':Sequelize[_0xfe90('0x1')](_0xfe90('0x4'),_0xfe90('0x5'),_0xfe90('0x6'),_0xfe90('0x7'),'account'),'defaultValue':_0xfe90('0x4')},'moduleCreate':{'type':Sequelize[_0xfe90('0x1')](_0xfe90('0x8'),'contact','lead','account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xfe90('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0xfe90('0x0')]},'additionalSearchContact':{'type':Sequelize[_0xfe90('0x0')]},'additionalSearchLead':{'type':Sequelize[_0xfe90('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 18e8ec8..a2bc245 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 _0x6a46=['reject','update','destroy','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','type','VIRTUAL','filter','merge','options','then','includeAll','include','rows','catch','show','params','length','find','create','body','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x527e74,_0x56115d){var _0x10acf7=function(_0x1c53b0){while(--_0x1c53b0){_0x527e74['push'](_0x527e74['shift']());}};_0x10acf7(++_0x56115d);}(_0x6a46,0x1cd));var _0x66a4=function(_0xc2261,_0x545d7b){_0xc2261=_0xc2261-0x0;var _0x57c043=_0x6a46[_0xc2261];return _0x57c043;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x66a4('0x0'));var jsonpatch=require(_0x66a4('0x1'));var rp=require(_0x66a4('0x2'));var moment=require(_0x66a4('0x3'));var BPromise=require(_0x66a4('0x4'));var Mustache=require(_0x66a4('0x5'));var util=require(_0x66a4('0x6'));var path=require(_0x66a4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x66a4('0x8'));var fs=require('fs');var fs_extra=require(_0x66a4('0x9'));var _=require(_0x66a4('0xa'));var squel=require(_0x66a4('0xb'));var crypto=require(_0x66a4('0xc'));var jsforce=require(_0x66a4('0xd'));var deskjs=require(_0x66a4('0xe'));var toCsv=require(_0x66a4('0xf'));var querystring=require(_0x66a4('0x10'));var Papa=require(_0x66a4('0x11'));var Redis=require(_0x66a4('0x12'));var authService=require(_0x66a4('0x13'));var qs=require(_0x66a4('0x14'));var as=require(_0x66a4('0x15'));var hardwareService=require(_0x66a4('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x66a4('0x17'));var licenseUtil=require(_0x66a4('0x18'));var db=require(_0x66a4('0x19'))['db'];function respondWithStatusCode(_0x19e148,_0x1f2e1a){_0x1f2e1a=_0x1f2e1a||0xcc;return function(_0x1d7bdd){if(_0x1d7bdd){return _0x19e148[_0x66a4('0x1a')](_0x1f2e1a);}return _0x19e148[_0x66a4('0x1b')](_0x1f2e1a)[_0x66a4('0x1c')]();};}function respondWithResult(_0x649ba9,_0x18a23b){_0x18a23b=_0x18a23b||0xc8;return function(_0xfe049b){if(_0xfe049b){return _0x649ba9[_0x66a4('0x1b')](_0x18a23b)[_0x66a4('0x1d')](_0xfe049b);}};}function respondWithFilteredResult(_0x414c2e,_0xaedf94){return function(_0x467884){if(_0x467884){var _0x34cbb8=typeof _0xaedf94[_0x66a4('0x1e')]==='undefined'&&typeof _0xaedf94[_0x66a4('0x1f')]===_0x66a4('0x20');var _0x4b464a=_0x467884['count'];var _0x6b58d0=_0x34cbb8?0x0:_0xaedf94[_0x66a4('0x1e')];var _0x4e1820=_0x34cbb8?_0x467884[_0x66a4('0x21')]:_0xaedf94['offset']+_0xaedf94[_0x66a4('0x1f')];var _0x35500;if(_0x4e1820>=_0x4b464a){_0x4e1820=_0x4b464a;_0x35500=0xc8;}else{_0x35500=0xce;}_0x414c2e[_0x66a4('0x1b')](_0x35500);return _0x414c2e[_0x66a4('0x22')](_0x66a4('0x23'),_0x6b58d0+'-'+_0x4e1820+'/'+_0x4b464a)['json'](_0x467884);}return null;};}function patchUpdates(_0x3385e8){return function(_0x101e28){try{jsonpatch[_0x66a4('0x24')](_0x101e28,_0x3385e8,!![]);}catch(_0x8dde4){return BPromise[_0x66a4('0x25')](_0x8dde4);}return _0x101e28['save']();};}function saveUpdates(_0x365d8f,_0x5d6ad5){return function(_0x2bcbc9){if(_0x2bcbc9){return _0x2bcbc9[_0x66a4('0x26')](_0x365d8f)['then'](function(_0x57c330){return _0x57c330;});}return null;};}function removeEntity(_0x4c0016,_0xeb2828){return function(_0x20a3ef){if(_0x20a3ef){return _0x20a3ef[_0x66a4('0x27')]()['then'](function(){_0x4c0016[_0x66a4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf036c1,_0x2d4ad4){return function(_0xd30ef6){if(!_0xd30ef6){_0xf036c1['sendStatus'](0x194);}return _0xd30ef6;};}function handleError(_0x43107c,_0x27a125){_0x27a125=_0x27a125||0x1f4;return function(_0x5552a2){logger[_0x66a4('0x28')](_0x5552a2['stack']);if(_0x5552a2[_0x66a4('0x29')]){delete _0x5552a2[_0x66a4('0x29')];}_0x43107c['status'](_0x27a125)[_0x66a4('0x2a')](_0x5552a2);};}exports[_0x66a4('0x2b')]=function(_0x55d5b4,_0x5bbf65){var _0x2ba516={},_0x3a8fa8={},_0x5ee1b6={'count':0x0,'rows':[]};var _0x46d77a=_[_0x66a4('0x2c')](db[_0x66a4('0x2d')][_0x66a4('0x2e')],function(_0x1820fa){return{'name':_0x1820fa[_0x66a4('0x2f')],'type':_0x1820fa['type'][_0x66a4('0x30')]};});_0x3a8fa8[_0x66a4('0x31')]=_[_0x66a4('0x2c')](_0x46d77a,_0x66a4('0x29'));_0x3a8fa8[_0x66a4('0x32')]=_[_0x66a4('0x33')](_0x55d5b4[_0x66a4('0x32')]);_0x3a8fa8['filters']=_[_0x66a4('0x34')](_0x3a8fa8['model'],_0x3a8fa8[_0x66a4('0x32')]);_0x2ba516[_0x66a4('0x35')]=_['intersection'](_0x3a8fa8['model'],qs['fields'](_0x55d5b4[_0x66a4('0x32')][_0x66a4('0x36')]));_0x2ba516['attributes']=_0x2ba516[_0x66a4('0x35')]['length']?_0x2ba516[_0x66a4('0x35')]:_0x3a8fa8[_0x66a4('0x31')];if(!_0x55d5b4['query'][_0x66a4('0x37')](_0x66a4('0x38'))){_0x2ba516[_0x66a4('0x1f')]=qs[_0x66a4('0x1f')](_0x55d5b4[_0x66a4('0x32')][_0x66a4('0x1f')]);_0x2ba516[_0x66a4('0x1e')]=qs[_0x66a4('0x1e')](_0x55d5b4[_0x66a4('0x32')]['offset']);}_0x2ba516[_0x66a4('0x39')]=qs[_0x66a4('0x3a')](_0x55d5b4['query'][_0x66a4('0x3a')]);_0x2ba516[_0x66a4('0x3b')]=qs[_0x66a4('0x3c')](_['pick'](_0x55d5b4[_0x66a4('0x32')],_0x3a8fa8[_0x66a4('0x3c')]),_0x46d77a);if(_0x55d5b4[_0x66a4('0x32')]['filter']){_0x2ba516[_0x66a4('0x3b')]=_['merge'](_0x2ba516[_0x66a4('0x3b')],{'$or':_[_0x66a4('0x2c')](_0x46d77a,function(_0x35eaa5){if(_0x35eaa5[_0x66a4('0x3d')]!==_0x66a4('0x3e')){var _0x36e39a={};_0x36e39a[_0x35eaa5['name']]={'$like':'%'+_0x55d5b4['query'][_0x66a4('0x3f')]+'%'};return _0x36e39a;}})});}_0x2ba516=_[_0x66a4('0x40')]({},_0x2ba516,_0x55d5b4[_0x66a4('0x41')]);var _0x4a7ac0={'where':_0x2ba516[_0x66a4('0x3b')]};return db['SalesforceConfiguration'][_0x66a4('0x21')](_0x4a7ac0)[_0x66a4('0x42')](function(_0x258ac8){_0x5ee1b6['count']=_0x258ac8;if(_0x55d5b4[_0x66a4('0x32')][_0x66a4('0x43')]){_0x2ba516[_0x66a4('0x44')]=[{'all':!![]}];}return db[_0x66a4('0x2d')]['findAll'](_0x2ba516);})[_0x66a4('0x42')](function(_0x59d31e){_0x5ee1b6[_0x66a4('0x45')]=_0x59d31e;return _0x5ee1b6;})['then'](respondWithFilteredResult(_0x5bbf65,_0x2ba516))[_0x66a4('0x46')](handleError(_0x5bbf65,null));};exports[_0x66a4('0x47')]=function(_0x49bb66,_0xeb5e74){var _0x1c4d4f={'raw':![],'where':{'id':_0x49bb66[_0x66a4('0x48')]['id']}},_0x1c2ecb={};_0x1c2ecb[_0x66a4('0x31')]=_['keys'](db[_0x66a4('0x2d')][_0x66a4('0x2e')]);_0x1c2ecb['query']=_[_0x66a4('0x33')](_0x49bb66[_0x66a4('0x32')]);_0x1c2ecb[_0x66a4('0x3c')]=_[_0x66a4('0x34')](_0x1c2ecb[_0x66a4('0x31')],_0x1c2ecb['query']);_0x1c4d4f[_0x66a4('0x35')]=_[_0x66a4('0x34')](_0x1c2ecb[_0x66a4('0x31')],qs[_0x66a4('0x36')](_0x49bb66[_0x66a4('0x32')]['fields']));_0x1c4d4f[_0x66a4('0x35')]=_0x1c4d4f[_0x66a4('0x35')][_0x66a4('0x49')]?_0x1c4d4f[_0x66a4('0x35')]:_0x1c2ecb[_0x66a4('0x31')];if(_0x49bb66[_0x66a4('0x32')][_0x66a4('0x43')]){_0x1c4d4f[_0x66a4('0x44')]=[{'all':!![]}];}_0x1c4d4f=_[_0x66a4('0x40')]({},_0x1c4d4f,_0x49bb66[_0x66a4('0x41')]);return db[_0x66a4('0x2d')][_0x66a4('0x4a')](_0x1c4d4f)[_0x66a4('0x42')](handleEntityNotFound(_0xeb5e74,null))[_0x66a4('0x42')](respondWithResult(_0xeb5e74,null))[_0x66a4('0x46')](handleError(_0xeb5e74,null));};exports[_0x66a4('0x4b')]=function(_0x27440d,_0x6212a0){return db[_0x66a4('0x2d')][_0x66a4('0x4b')](_0x27440d[_0x66a4('0x4c')],{})[_0x66a4('0x42')](respondWithResult(_0x6212a0,0xc9))['catch'](handleError(_0x6212a0,null));};exports[_0x66a4('0x26')]=function(_0x3de166,_0x1a8e88){if(_0x3de166[_0x66a4('0x4c')]['id']){delete _0x3de166[_0x66a4('0x4c')]['id'];}return db[_0x66a4('0x2d')]['find']({'where':{'id':_0x3de166[_0x66a4('0x48')]['id']}})[_0x66a4('0x42')](handleEntityNotFound(_0x1a8e88,null))[_0x66a4('0x42')](saveUpdates(_0x3de166[_0x66a4('0x4c')],null))[_0x66a4('0x42')](respondWithResult(_0x1a8e88,null))[_0x66a4('0x46')](handleError(_0x1a8e88,null));};exports['destroy']=function(_0x3df273,_0x42d26c){return db[_0x66a4('0x2d')][_0x66a4('0x4a')]({'where':{'id':_0x3df273[_0x66a4('0x48')]['id']}})[_0x66a4('0x42')](handleEntityNotFound(_0x42d26c,null))[_0x66a4('0x42')](removeEntity(_0x42d26c,null))[_0x66a4('0x46')](handleError(_0x42d26c,null));};exports[_0x66a4('0x4d')]=function(_0x188a6d,_0x273109,_0x2d5e8b){var _0x402370={};var _0x141c3e={};var _0x309e83;var _0x570024;return db[_0x66a4('0x2d')][_0x66a4('0x4e')]({'where':{'id':_0x188a6d['params']['id']}})['then'](handleEntityNotFound(_0x273109,null))[_0x66a4('0x42')](function(_0x11119){if(_0x11119){_0x309e83=_0x11119;_0x141c3e[_0x66a4('0x31')]=_[_0x66a4('0x33')](db[_0x66a4('0x4f')]['rawAttributes']);_0x141c3e[_0x66a4('0x32')]=_[_0x66a4('0x33')](_0x188a6d['query']);_0x141c3e['filters']=_['intersection'](_0x141c3e[_0x66a4('0x31')],_0x141c3e[_0x66a4('0x32')]);_0x402370[_0x66a4('0x35')]=_[_0x66a4('0x34')](_0x141c3e[_0x66a4('0x31')],qs[_0x66a4('0x36')](_0x188a6d[_0x66a4('0x32')][_0x66a4('0x36')]));_0x402370[_0x66a4('0x35')]=_0x402370[_0x66a4('0x35')][_0x66a4('0x49')]?_0x402370[_0x66a4('0x35')]:_0x141c3e[_0x66a4('0x31')];_0x402370[_0x66a4('0x39')]=qs[_0x66a4('0x3a')](_0x188a6d[_0x66a4('0x32')][_0x66a4('0x3a')]);_0x402370[_0x66a4('0x3b')]=qs['filters'](_[_0x66a4('0x50')](_0x188a6d['query'],_0x141c3e[_0x66a4('0x3c')]));if(_0x188a6d['query'][_0x66a4('0x3f')]){_0x402370['where']=_[_0x66a4('0x40')](_0x402370['where'],{'$or':_[_0x66a4('0x2c')](_0x402370[_0x66a4('0x35')],function(_0x22eeb3){var _0xca2c6c={};_0xca2c6c[_0x22eeb3]={'$like':'%'+_0x188a6d[_0x66a4('0x32')][_0x66a4('0x3f')]+'%'};return _0xca2c6c;})});}_0x402370=_[_0x66a4('0x40')]({},_0x402370,_0x188a6d['options']);return _0x309e83['getFields'](_0x402370);}})[_0x66a4('0x42')](function(_0x4114f8){if(_0x4114f8){_0x570024=_0x4114f8[_0x66a4('0x49')];if(!_0x188a6d[_0x66a4('0x32')][_0x66a4('0x37')]('nolimit')){_0x402370[_0x66a4('0x1f')]=qs[_0x66a4('0x1f')](_0x188a6d[_0x66a4('0x32')][_0x66a4('0x1f')]);_0x402370['offset']=qs[_0x66a4('0x1e')](_0x188a6d[_0x66a4('0x32')][_0x66a4('0x1e')]);}return _0x309e83[_0x66a4('0x4d')](_0x402370);}})['then'](function(_0x4bc837){if(_0x4bc837){return _0x4bc837?{'count':_0x570024,'rows':_0x4bc837}:null;}})[_0x66a4('0x42')](respondWithResult(_0x273109,null))[_0x66a4('0x46')](handleError(_0x273109,null));};exports[_0x66a4('0x51')]=function(_0x5653a0,_0x59fa98,_0x224810){var _0x2c2d8c={};var _0x42c62f={};var _0x4e7dca;var _0x3a6350;return db['SalesforceConfiguration'][_0x66a4('0x4e')]({'where':{'id':_0x5653a0[_0x66a4('0x48')]['id']}})[_0x66a4('0x42')](handleEntityNotFound(_0x59fa98,null))['then'](function(_0x99a03){if(_0x99a03){_0x4e7dca=_0x99a03;_0x42c62f[_0x66a4('0x31')]=_[_0x66a4('0x33')](db[_0x66a4('0x4f')][_0x66a4('0x2e')]);_0x42c62f['query']=_[_0x66a4('0x33')](_0x5653a0[_0x66a4('0x32')]);_0x42c62f['filters']=_['intersection'](_0x42c62f[_0x66a4('0x31')],_0x42c62f[_0x66a4('0x32')]);_0x2c2d8c[_0x66a4('0x35')]=_[_0x66a4('0x34')](_0x42c62f[_0x66a4('0x31')],qs[_0x66a4('0x36')](_0x5653a0[_0x66a4('0x32')]['fields']));_0x2c2d8c[_0x66a4('0x35')]=_0x2c2d8c[_0x66a4('0x35')]['length']?_0x2c2d8c[_0x66a4('0x35')]:_0x42c62f[_0x66a4('0x31')];_0x2c2d8c[_0x66a4('0x39')]=qs[_0x66a4('0x3a')](_0x5653a0[_0x66a4('0x32')][_0x66a4('0x3a')]);_0x2c2d8c['where']=qs[_0x66a4('0x3c')](_[_0x66a4('0x50')](_0x5653a0[_0x66a4('0x32')],_0x42c62f['filters']));if(_0x5653a0[_0x66a4('0x32')][_0x66a4('0x3f')]){_0x2c2d8c[_0x66a4('0x3b')]=_[_0x66a4('0x40')](_0x2c2d8c[_0x66a4('0x3b')],{'$or':_[_0x66a4('0x2c')](_0x2c2d8c[_0x66a4('0x35')],function(_0x546327){var _0x5d5dc2={};_0x5d5dc2[_0x546327]={'$like':'%'+_0x5653a0['query'][_0x66a4('0x3f')]+'%'};return _0x5d5dc2;})});}_0x2c2d8c=_['merge']({},_0x2c2d8c,_0x5653a0[_0x66a4('0x41')]);return _0x4e7dca['getSubjects'](_0x2c2d8c);}})[_0x66a4('0x42')](function(_0xaf4ca8){if(_0xaf4ca8){_0x3a6350=_0xaf4ca8['length'];if(!_0x5653a0['query']['hasOwnProperty'](_0x66a4('0x38'))){_0x2c2d8c[_0x66a4('0x1f')]=qs[_0x66a4('0x1f')](_0x5653a0[_0x66a4('0x32')][_0x66a4('0x1f')]);_0x2c2d8c['offset']=qs['offset'](_0x5653a0[_0x66a4('0x32')][_0x66a4('0x1e')]);}return _0x4e7dca[_0x66a4('0x51')](_0x2c2d8c);}})[_0x66a4('0x42')](function(_0x49d7b5){if(_0x49d7b5){return _0x49d7b5?{'count':_0x3a6350,'rows':_0x49d7b5}:null;}})[_0x66a4('0x42')](respondWithResult(_0x59fa98,null))[_0x66a4('0x46')](handleError(_0x59fa98,null));};exports[_0x66a4('0x52')]=function(_0xbba75a,_0x5a5bdc,_0x970c04){var _0x18b0fa={};var _0xdc0975={};var _0x2395e9;var _0xef77f5;return db[_0x66a4('0x2d')][_0x66a4('0x4e')]({'where':{'id':_0xbba75a['params']['id']}})[_0x66a4('0x42')](handleEntityNotFound(_0x5a5bdc,null))['then'](function(_0x5eddb3){if(_0x5eddb3){_0x2395e9=_0x5eddb3;_0xdc0975[_0x66a4('0x31')]=_[_0x66a4('0x33')](db[_0x66a4('0x4f')][_0x66a4('0x2e')]);_0xdc0975[_0x66a4('0x32')]=_[_0x66a4('0x33')](_0xbba75a['query']);_0xdc0975[_0x66a4('0x3c')]=_[_0x66a4('0x34')](_0xdc0975[_0x66a4('0x31')],_0xdc0975['query']);_0x18b0fa[_0x66a4('0x35')]=_[_0x66a4('0x34')](_0xdc0975[_0x66a4('0x31')],qs[_0x66a4('0x36')](_0xbba75a['query'][_0x66a4('0x36')]));_0x18b0fa[_0x66a4('0x35')]=_0x18b0fa[_0x66a4('0x35')][_0x66a4('0x49')]?_0x18b0fa[_0x66a4('0x35')]:_0xdc0975[_0x66a4('0x31')];_0x18b0fa[_0x66a4('0x39')]=qs['sort'](_0xbba75a[_0x66a4('0x32')][_0x66a4('0x3a')]);_0x18b0fa[_0x66a4('0x3b')]=qs[_0x66a4('0x3c')](_['pick'](_0xbba75a[_0x66a4('0x32')],_0xdc0975[_0x66a4('0x3c')]));if(_0xbba75a[_0x66a4('0x32')][_0x66a4('0x3f')]){_0x18b0fa[_0x66a4('0x3b')]=_[_0x66a4('0x40')](_0x18b0fa[_0x66a4('0x3b')],{'$or':_[_0x66a4('0x2c')](_0x18b0fa['attributes'],function(_0x5849f9){var _0x5aca65={};_0x5aca65[_0x5849f9]={'$like':'%'+_0xbba75a[_0x66a4('0x32')][_0x66a4('0x3f')]+'%'};return _0x5aca65;})});}_0x18b0fa=_[_0x66a4('0x40')]({},_0x18b0fa,_0xbba75a[_0x66a4('0x41')]);return _0x2395e9[_0x66a4('0x52')](_0x18b0fa);}})[_0x66a4('0x42')](function(_0x44b7c1){if(_0x44b7c1){_0xef77f5=_0x44b7c1[_0x66a4('0x49')];if(!_0xbba75a[_0x66a4('0x32')]['hasOwnProperty'](_0x66a4('0x38'))){_0x18b0fa[_0x66a4('0x1f')]=qs[_0x66a4('0x1f')](_0xbba75a['query'][_0x66a4('0x1f')]);_0x18b0fa[_0x66a4('0x1e')]=qs[_0x66a4('0x1e')](_0xbba75a[_0x66a4('0x32')][_0x66a4('0x1e')]);}return _0x2395e9[_0x66a4('0x52')](_0x18b0fa);}})[_0x66a4('0x42')](function(_0x219587){if(_0x219587){return _0x219587?{'count':_0xef77f5,'rows':_0x219587}:null;}})[_0x66a4('0x42')](respondWithResult(_0x5a5bdc,null))[_0x66a4('0x46')](handleError(_0x5a5bdc,null));}; \ No newline at end of file +var _0x2cca=['getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','merge','where','VIRTUAL','options','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getFields','findOne','length','pick','hasOwnProperty','SalesforceField'];(function(_0x577421,_0x560726){var _0x4daac7=function(_0xcd00aa){while(--_0xcd00aa){_0x577421['push'](_0x577421['shift']());}};_0x4daac7(++_0x560726);}(_0x2cca,0xa4));var _0xa2cc=function(_0x2a0e75,_0x313149){_0x2a0e75=_0x2a0e75-0x0;var _0x396e82=_0x2cca[_0x2a0e75];return _0x396e82;};'use strict';var emlformat=require(_0xa2cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa2cc('0x1'));var jsonpatch=require(_0xa2cc('0x2'));var rp=require(_0xa2cc('0x3'));var moment=require(_0xa2cc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa2cc('0x5'));var path=require(_0xa2cc('0x6'));var sox=require(_0xa2cc('0x7'));var csv=require(_0xa2cc('0x8'));var ejs=require(_0xa2cc('0x9'));var fs=require('fs');var fs_extra=require(_0xa2cc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa2cc('0xb'));var deskjs=require(_0xa2cc('0xc'));var toCsv=require(_0xa2cc('0x8'));var querystring=require(_0xa2cc('0xd'));var Papa=require(_0xa2cc('0xe'));var Redis=require(_0xa2cc('0xf'));var authService=require(_0xa2cc('0x10'));var qs=require(_0xa2cc('0x11'));var as=require(_0xa2cc('0x12'));var hardwareService=require(_0xa2cc('0x13'));var logger=require('../../config/logger')(_0xa2cc('0x14'));var utils=require('../../config/utils');var config=require(_0xa2cc('0x15'));var licenseUtil=require(_0xa2cc('0x16'));var db=require(_0xa2cc('0x17'))['db'];function respondWithStatusCode(_0x51e82a,_0x2301c5){_0x2301c5=_0x2301c5||0xcc;return function(_0x4615bb){if(_0x4615bb){return _0x51e82a['sendStatus'](_0x2301c5);}return _0x51e82a[_0xa2cc('0x18')](_0x2301c5)[_0xa2cc('0x19')]();};}function respondWithResult(_0x4765c7,_0x10cfd0){_0x10cfd0=_0x10cfd0||0xc8;return function(_0xe8bd31){if(_0xe8bd31){return _0x4765c7[_0xa2cc('0x18')](_0x10cfd0)[_0xa2cc('0x1a')](_0xe8bd31);}};}function respondWithFilteredResult(_0x4418cf,_0x21f5f7){return function(_0x9d9847){if(_0x9d9847){var _0x299c3e=typeof _0x21f5f7[_0xa2cc('0x1b')]==='undefined'&&typeof _0x21f5f7[_0xa2cc('0x1c')]==='undefined';var _0x392a89=_0x9d9847[_0xa2cc('0x1d')];var _0x11a3ae=_0x299c3e?0x0:_0x21f5f7['offset'];var _0x2610b0=_0x299c3e?_0x9d9847[_0xa2cc('0x1d')]:_0x21f5f7[_0xa2cc('0x1b')]+_0x21f5f7[_0xa2cc('0x1c')];var _0x1fb9ac;if(_0x2610b0>=_0x392a89){_0x2610b0=_0x392a89;_0x1fb9ac=0xc8;}else{_0x1fb9ac=0xce;}_0x4418cf[_0xa2cc('0x18')](_0x1fb9ac);return _0x4418cf[_0xa2cc('0x1e')](_0xa2cc('0x1f'),_0x11a3ae+'-'+_0x2610b0+'/'+_0x392a89)['json'](_0x9d9847);}return null;};}function patchUpdates(_0xd46c38){return function(_0x283736){try{jsonpatch[_0xa2cc('0x20')](_0x283736,_0xd46c38,!![]);}catch(_0x274124){return BPromise[_0xa2cc('0x21')](_0x274124);}return _0x283736[_0xa2cc('0x22')]();};}function saveUpdates(_0x3407d4,_0x58b197){return function(_0x2a16ab){if(_0x2a16ab){return _0x2a16ab['update'](_0x3407d4)[_0xa2cc('0x23')](function(_0x278de9){return _0x278de9;});}return null;};}function removeEntity(_0x561f32,_0xf8c404){return function(_0x1afb8f){if(_0x1afb8f){return _0x1afb8f[_0xa2cc('0x24')]()[_0xa2cc('0x23')](function(){_0x561f32[_0xa2cc('0x18')](0xcc)[_0xa2cc('0x19')]();});}};}function handleEntityNotFound(_0x394ea8,_0x4def0f){return function(_0x4c6592){if(!_0x4c6592){_0x394ea8[_0xa2cc('0x25')](0x194);}return _0x4c6592;};}function handleError(_0x3b2123,_0x3a478b){_0x3a478b=_0x3a478b||0x1f4;return function(_0x1b8309){logger[_0xa2cc('0x26')](_0x1b8309['stack']);if(_0x1b8309['name']){delete _0x1b8309['name'];}_0x3b2123['status'](_0x3a478b)[_0xa2cc('0x27')](_0x1b8309);};}exports[_0xa2cc('0x28')]=function(_0x5a6b3c,_0x1d8217){var _0x2077b4={},_0x234171={},_0x2186d3={'count':0x0,'rows':[]};var _0x5a833c=_[_0xa2cc('0x29')](db['SalesforceConfiguration'][_0xa2cc('0x2a')],function(_0x3b93e6){return{'name':_0x3b93e6['fieldName'],'type':_0x3b93e6[_0xa2cc('0x2b')][_0xa2cc('0x2c')]};});_0x234171[_0xa2cc('0x2d')]=_['map'](_0x5a833c,_0xa2cc('0x2e'));_0x234171[_0xa2cc('0x2f')]=_[_0xa2cc('0x30')](_0x5a6b3c[_0xa2cc('0x2f')]);_0x234171[_0xa2cc('0x31')]=_[_0xa2cc('0x32')](_0x234171[_0xa2cc('0x2d')],_0x234171[_0xa2cc('0x2f')]);_0x2077b4[_0xa2cc('0x33')]=_[_0xa2cc('0x32')](_0x234171[_0xa2cc('0x2d')],qs[_0xa2cc('0x34')](_0x5a6b3c[_0xa2cc('0x2f')][_0xa2cc('0x34')]));_0x2077b4[_0xa2cc('0x33')]=_0x2077b4[_0xa2cc('0x33')]['length']?_0x2077b4['attributes']:_0x234171[_0xa2cc('0x2d')];if(!_0x5a6b3c['query']['hasOwnProperty'](_0xa2cc('0x35'))){_0x2077b4[_0xa2cc('0x1c')]=qs[_0xa2cc('0x1c')](_0x5a6b3c['query']['limit']);_0x2077b4['offset']=qs[_0xa2cc('0x1b')](_0x5a6b3c[_0xa2cc('0x2f')][_0xa2cc('0x1b')]);}_0x2077b4[_0xa2cc('0x36')]=qs['sort'](_0x5a6b3c[_0xa2cc('0x2f')][_0xa2cc('0x37')]);_0x2077b4['where']=qs[_0xa2cc('0x31')](_['pick'](_0x5a6b3c['query'],_0x234171[_0xa2cc('0x31')]),_0x5a833c);if(_0x5a6b3c[_0xa2cc('0x2f')][_0xa2cc('0x38')]){_0x2077b4['where']=_[_0xa2cc('0x39')](_0x2077b4[_0xa2cc('0x3a')],{'$or':_[_0xa2cc('0x29')](_0x5a833c,function(_0x490958){if(_0x490958['type']!==_0xa2cc('0x3b')){var _0x3e0b8b={};_0x3e0b8b[_0x490958['name']]={'$like':'%'+_0x5a6b3c[_0xa2cc('0x2f')]['filter']+'%'};return _0x3e0b8b;}})});}_0x2077b4=_['merge']({},_0x2077b4,_0x5a6b3c[_0xa2cc('0x3c')]);var _0x50a900={'where':_0x2077b4[_0xa2cc('0x3a')]};return db[_0xa2cc('0x3d')][_0xa2cc('0x1d')](_0x50a900)[_0xa2cc('0x23')](function(_0x23d181){_0x2186d3[_0xa2cc('0x1d')]=_0x23d181;if(_0x5a6b3c[_0xa2cc('0x2f')][_0xa2cc('0x3e')]){_0x2077b4[_0xa2cc('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xa2cc('0x40')](_0x2077b4);})[_0xa2cc('0x23')](function(_0x460890){_0x2186d3[_0xa2cc('0x41')]=_0x460890;return _0x2186d3;})[_0xa2cc('0x23')](respondWithFilteredResult(_0x1d8217,_0x2077b4))[_0xa2cc('0x42')](handleError(_0x1d8217,null));};exports[_0xa2cc('0x43')]=function(_0x1b6b22,_0x5b4630){var _0x432db4={'raw':![],'where':{'id':_0x1b6b22[_0xa2cc('0x44')]['id']}},_0xd4710d={};_0xd4710d[_0xa2cc('0x2d')]=_[_0xa2cc('0x30')](db[_0xa2cc('0x3d')][_0xa2cc('0x2a')]);_0xd4710d[_0xa2cc('0x2f')]=_['keys'](_0x1b6b22[_0xa2cc('0x2f')]);_0xd4710d['filters']=_[_0xa2cc('0x32')](_0xd4710d[_0xa2cc('0x2d')],_0xd4710d['query']);_0x432db4[_0xa2cc('0x33')]=_[_0xa2cc('0x32')](_0xd4710d['model'],qs['fields'](_0x1b6b22['query'][_0xa2cc('0x34')]));_0x432db4[_0xa2cc('0x33')]=_0x432db4[_0xa2cc('0x33')]['length']?_0x432db4[_0xa2cc('0x33')]:_0xd4710d[_0xa2cc('0x2d')];if(_0x1b6b22[_0xa2cc('0x2f')][_0xa2cc('0x3e')]){_0x432db4['include']=[{'all':!![]}];}_0x432db4=_['merge']({},_0x432db4,_0x1b6b22['options']);return db[_0xa2cc('0x3d')][_0xa2cc('0x45')](_0x432db4)[_0xa2cc('0x23')](handleEntityNotFound(_0x5b4630,null))[_0xa2cc('0x23')](respondWithResult(_0x5b4630,null))['catch'](handleError(_0x5b4630,null));};exports['create']=function(_0xcaaaaf,_0xf5c13e){return db[_0xa2cc('0x3d')][_0xa2cc('0x46')](_0xcaaaaf[_0xa2cc('0x47')],{})[_0xa2cc('0x23')](respondWithResult(_0xf5c13e,0xc9))[_0xa2cc('0x42')](handleError(_0xf5c13e,null));};exports[_0xa2cc('0x48')]=function(_0xb625,_0x4a6235){if(_0xb625[_0xa2cc('0x47')]['id']){delete _0xb625['body']['id'];}return db[_0xa2cc('0x3d')]['find']({'where':{'id':_0xb625[_0xa2cc('0x44')]['id']}})[_0xa2cc('0x23')](handleEntityNotFound(_0x4a6235,null))['then'](saveUpdates(_0xb625[_0xa2cc('0x47')],null))[_0xa2cc('0x23')](respondWithResult(_0x4a6235,null))[_0xa2cc('0x42')](handleError(_0x4a6235,null));};exports['destroy']=function(_0xb06878,_0x28825a){return db['SalesforceConfiguration']['find']({'where':{'id':_0xb06878['params']['id']}})['then'](handleEntityNotFound(_0x28825a,null))[_0xa2cc('0x23')](removeEntity(_0x28825a,null))['catch'](handleError(_0x28825a,null));};exports[_0xa2cc('0x49')]=function(_0x4463d9,_0x369b44,_0x4842f3){var _0x31e26e={};var _0x4d0088={};var _0x31609c;var _0x1ff94c;return db['SalesforceConfiguration'][_0xa2cc('0x4a')]({'where':{'id':_0x4463d9['params']['id']}})[_0xa2cc('0x23')](handleEntityNotFound(_0x369b44,null))[_0xa2cc('0x23')](function(_0x52fb7f){if(_0x52fb7f){_0x31609c=_0x52fb7f;_0x4d0088[_0xa2cc('0x2d')]=_[_0xa2cc('0x30')](db['SalesforceField'][_0xa2cc('0x2a')]);_0x4d0088[_0xa2cc('0x2f')]=_['keys'](_0x4463d9[_0xa2cc('0x2f')]);_0x4d0088[_0xa2cc('0x31')]=_[_0xa2cc('0x32')](_0x4d0088['model'],_0x4d0088[_0xa2cc('0x2f')]);_0x31e26e['attributes']=_['intersection'](_0x4d0088['model'],qs['fields'](_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x34')]));_0x31e26e[_0xa2cc('0x33')]=_0x31e26e[_0xa2cc('0x33')][_0xa2cc('0x4b')]?_0x31e26e['attributes']:_0x4d0088['model'];_0x31e26e[_0xa2cc('0x36')]=qs[_0xa2cc('0x37')](_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x37')]);_0x31e26e['where']=qs[_0xa2cc('0x31')](_[_0xa2cc('0x4c')](_0x4463d9[_0xa2cc('0x2f')],_0x4d0088[_0xa2cc('0x31')]));if(_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x38')]){_0x31e26e['where']=_['merge'](_0x31e26e[_0xa2cc('0x3a')],{'$or':_['map'](_0x31e26e['attributes'],function(_0x64ebe7){var _0x5ede46={};_0x5ede46[_0x64ebe7]={'$like':'%'+_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x38')]+'%'};return _0x5ede46;})});}_0x31e26e=_['merge']({},_0x31e26e,_0x4463d9[_0xa2cc('0x3c')]);return _0x31609c[_0xa2cc('0x49')](_0x31e26e);}})[_0xa2cc('0x23')](function(_0x56dda9){if(_0x56dda9){_0x1ff94c=_0x56dda9[_0xa2cc('0x4b')];if(!_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x4d')](_0xa2cc('0x35'))){_0x31e26e[_0xa2cc('0x1c')]=qs[_0xa2cc('0x1c')](_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x1c')]);_0x31e26e[_0xa2cc('0x1b')]=qs[_0xa2cc('0x1b')](_0x4463d9['query'][_0xa2cc('0x1b')]);}return _0x31609c[_0xa2cc('0x49')](_0x31e26e);}})[_0xa2cc('0x23')](function(_0x285455){if(_0x285455){return _0x285455?{'count':_0x1ff94c,'rows':_0x285455}:null;}})[_0xa2cc('0x23')](respondWithResult(_0x369b44,null))[_0xa2cc('0x42')](handleError(_0x369b44,null));};exports['getSubjects']=function(_0x696e3e,_0x273279,_0x166baa){var _0x1b1b9c={};var _0x41d290={};var _0x28deea;var _0x219708;return db[_0xa2cc('0x3d')]['findOne']({'where':{'id':_0x696e3e[_0xa2cc('0x44')]['id']}})['then'](handleEntityNotFound(_0x273279,null))[_0xa2cc('0x23')](function(_0x38c4b9){if(_0x38c4b9){_0x28deea=_0x38c4b9;_0x41d290['model']=_[_0xa2cc('0x30')](db[_0xa2cc('0x4e')][_0xa2cc('0x2a')]);_0x41d290[_0xa2cc('0x2f')]=_[_0xa2cc('0x30')](_0x696e3e[_0xa2cc('0x2f')]);_0x41d290[_0xa2cc('0x31')]=_['intersection'](_0x41d290[_0xa2cc('0x2d')],_0x41d290['query']);_0x1b1b9c[_0xa2cc('0x33')]=_[_0xa2cc('0x32')](_0x41d290['model'],qs[_0xa2cc('0x34')](_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x34')]));_0x1b1b9c[_0xa2cc('0x33')]=_0x1b1b9c[_0xa2cc('0x33')]['length']?_0x1b1b9c[_0xa2cc('0x33')]:_0x41d290[_0xa2cc('0x2d')];_0x1b1b9c[_0xa2cc('0x36')]=qs[_0xa2cc('0x37')](_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x37')]);_0x1b1b9c[_0xa2cc('0x3a')]=qs[_0xa2cc('0x31')](_['pick'](_0x696e3e[_0xa2cc('0x2f')],_0x41d290['filters']));if(_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x38')]){_0x1b1b9c[_0xa2cc('0x3a')]=_[_0xa2cc('0x39')](_0x1b1b9c[_0xa2cc('0x3a')],{'$or':_[_0xa2cc('0x29')](_0x1b1b9c[_0xa2cc('0x33')],function(_0x1d5b7b){var _0x27bc44={};_0x27bc44[_0x1d5b7b]={'$like':'%'+_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x38')]+'%'};return _0x27bc44;})});}_0x1b1b9c=_[_0xa2cc('0x39')]({},_0x1b1b9c,_0x696e3e[_0xa2cc('0x3c')]);return _0x28deea['getSubjects'](_0x1b1b9c);}})[_0xa2cc('0x23')](function(_0x3dc6b6){if(_0x3dc6b6){_0x219708=_0x3dc6b6['length'];if(!_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x4d')]('nolimit')){_0x1b1b9c[_0xa2cc('0x1c')]=qs[_0xa2cc('0x1c')](_0x696e3e[_0xa2cc('0x2f')]['limit']);_0x1b1b9c[_0xa2cc('0x1b')]=qs['offset'](_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x1b')]);}return _0x28deea[_0xa2cc('0x4f')](_0x1b1b9c);}})[_0xa2cc('0x23')](function(_0x3b8310){if(_0x3b8310){return _0x3b8310?{'count':_0x219708,'rows':_0x3b8310}:null;}})[_0xa2cc('0x23')](respondWithResult(_0x273279,null))[_0xa2cc('0x42')](handleError(_0x273279,null));};exports[_0xa2cc('0x50')]=function(_0x22d423,_0x23360f,_0xac2efe){var _0x15caf4={};var _0x12f941={};var _0x16b212;var _0x106974;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x22d423[_0xa2cc('0x44')]['id']}})['then'](handleEntityNotFound(_0x23360f,null))['then'](function(_0x2d0153){if(_0x2d0153){_0x16b212=_0x2d0153;_0x12f941[_0xa2cc('0x2d')]=_['keys'](db[_0xa2cc('0x4e')][_0xa2cc('0x2a')]);_0x12f941[_0xa2cc('0x2f')]=_[_0xa2cc('0x30')](_0x22d423[_0xa2cc('0x2f')]);_0x12f941['filters']=_[_0xa2cc('0x32')](_0x12f941[_0xa2cc('0x2d')],_0x12f941[_0xa2cc('0x2f')]);_0x15caf4[_0xa2cc('0x33')]=_['intersection'](_0x12f941[_0xa2cc('0x2d')],qs[_0xa2cc('0x34')](_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x34')]));_0x15caf4['attributes']=_0x15caf4[_0xa2cc('0x33')][_0xa2cc('0x4b')]?_0x15caf4[_0xa2cc('0x33')]:_0x12f941[_0xa2cc('0x2d')];_0x15caf4[_0xa2cc('0x36')]=qs[_0xa2cc('0x37')](_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x37')]);_0x15caf4[_0xa2cc('0x3a')]=qs[_0xa2cc('0x31')](_['pick'](_0x22d423[_0xa2cc('0x2f')],_0x12f941[_0xa2cc('0x31')]));if(_0x22d423[_0xa2cc('0x2f')]['filter']){_0x15caf4[_0xa2cc('0x3a')]=_['merge'](_0x15caf4[_0xa2cc('0x3a')],{'$or':_[_0xa2cc('0x29')](_0x15caf4['attributes'],function(_0x4784ae){var _0x2b7d22={};_0x2b7d22[_0x4784ae]={'$like':'%'+_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x38')]+'%'};return _0x2b7d22;})});}_0x15caf4=_[_0xa2cc('0x39')]({},_0x15caf4,_0x22d423[_0xa2cc('0x3c')]);return _0x16b212[_0xa2cc('0x50')](_0x15caf4);}})['then'](function(_0x519773){if(_0x519773){_0x106974=_0x519773['length'];if(!_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x4d')](_0xa2cc('0x35'))){_0x15caf4[_0xa2cc('0x1c')]=qs['limit'](_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x1c')]);_0x15caf4['offset']=qs[_0xa2cc('0x1b')](_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x1b')]);}return _0x16b212['getDescriptions'](_0x15caf4);}})[_0xa2cc('0x23')](function(_0x46f3aa){if(_0x46f3aa){return _0x46f3aa?{'count':_0x106974,'rows':_0x46f3aa}:null;}})[_0xa2cc('0x23')](respondWithResult(_0x23360f,null))[_0xa2cc('0x42')](handleError(_0x23360f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 3608cf1..47c3a42 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 _0xa4c7=['int_salesforce_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration'];(function(_0x3b45e8,_0x628af6){var _0x370099=function(_0x80765f){while(--_0x80765f){_0x3b45e8['push'](_0x3b45e8['shift']());}};_0x370099(++_0x628af6);}(_0xa4c7,0x91));var _0x7a4c=function(_0x39e511,_0x3937ca){_0x39e511=_0x39e511-0x0;var _0x12712e=_0xa4c7[_0x39e511];return _0x12712e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7a4c('0x0'))(_0x7a4c('0x1'));var moment=require(_0x7a4c('0x2'));var BPromise=require(_0x7a4c('0x3'));var rp=require(_0x7a4c('0x4'));var fs=require('fs');var path=require(_0x7a4c('0x5'));var rimraf=require(_0x7a4c('0x6'));var config=require(_0x7a4c('0x7'));var attributes=require(_0x7a4c('0x8'));module[_0x7a4c('0x9')]=function(_0x2bc019,_0x1d2871){return _0x2bc019['define'](_0x7a4c('0xa'),attributes,{'tableName':_0x7a4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf87b=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x4f9993,_0x5e6642){var _0x51e017=function(_0x1ef350){while(--_0x1ef350){_0x4f9993['push'](_0x4f9993['shift']());}};_0x51e017(++_0x5e6642);}(_0xf87b,0x195));var _0xbf87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf87b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbf87('0x0'));var util=require(_0xbf87('0x1'));var logger=require(_0xbf87('0x2'))('api');var moment=require(_0xbf87('0x3'));var BPromise=require(_0xbf87('0x4'));var rp=require(_0xbf87('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf87('0x6'));var config=require(_0xbf87('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xbf87('0x8')]=function(_0x11952e,_0x3443d5){return _0x11952e[_0xbf87('0x9')](_0xbf87('0xa'),attributes,{'tableName':_0xbf87('0xb'),'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 2fdf064..a3f219b 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 _0xe637=['SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x27fedb,_0x31c693){var _0x58ab78=function(_0x532732){while(--_0x532732){_0x27fedb['push'](_0x27fedb['shift']());}};_0x58ab78(++_0x31c693);}(_0xe637,0x82));var _0x7e63=function(_0x2a5866,_0x525d41){_0x2a5866=_0x2a5866-0x0;var _0x47b6b5=_0xe637[_0x2a5866];return _0x47b6b5;};'use strict';var _=require(_0x7e63('0x0'));var util=require(_0x7e63('0x1'));var moment=require('moment');var BPromise=require(_0x7e63('0x2'));var rs=require(_0x7e63('0x3'));var fs=require('fs');var Redis=require(_0x7e63('0x4'));var db=require(_0x7e63('0x5'))['db'];var utils=require(_0x7e63('0x6'));var logger=require(_0x7e63('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7e63('0x8'));var client=jayson[_0x7e63('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x430b05,_0x886517,_0x17573a){return new BPromise(function(_0x182718,_0x539763){return client[_0x7e63('0xa')](_0x430b05,_0x17573a)[_0x7e63('0xb')](function(_0x43031a){logger[_0x7e63('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x886517,'request\x20sent');logger[_0x7e63('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x886517,_0x7e63('0xe'),JSON[_0x7e63('0xf')](_0x43031a));if(_0x43031a[_0x7e63('0x10')]){if(_0x43031a[_0x7e63('0x10')]['code']===0x1f4){logger[_0x7e63('0x10')](_0x7e63('0x11'),_0x886517,_0x43031a[_0x7e63('0x10')][_0x7e63('0x12')]);return _0x539763(_0x43031a[_0x7e63('0x10')][_0x7e63('0x12')]);}logger['error'](_0x7e63('0x11'),_0x886517,_0x43031a[_0x7e63('0x10')][_0x7e63('0x12')]);return _0x182718(_0x43031a['error'][_0x7e63('0x12')]);}else{logger[_0x7e63('0xc')](_0x7e63('0x11'),_0x886517,_0x7e63('0xe'));_0x182718(_0x43031a[_0x7e63('0x13')][_0x7e63('0x12')]);}})[_0x7e63('0x14')](function(_0x53812a){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x886517,_0x53812a);_0x539763(_0x53812a);});});} \ No newline at end of file +var _0x5f04=['request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x5f04,0x1a4));var _0x45f0=function(_0x1a8132,_0x1d4978){_0x1a8132=_0x1a8132-0x0;var _0x5b9329=_0x5f04[_0x1a8132];return _0x5b9329;};'use strict';var _=require(_0x45f0('0x0'));var util=require(_0x45f0('0x1'));var moment=require('moment');var BPromise=require(_0x45f0('0x2'));var rs=require(_0x45f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45f0('0x4'))['db'];var utils=require(_0x45f0('0x5'));var logger=require(_0x45f0('0x6'))(_0x45f0('0x7'));var config=require(_0x45f0('0x8'));var jayson=require(_0x45f0('0x9'));var client=jayson[_0x45f0('0xa')][_0x45f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6237,_0x3a077c,_0x670dba){return new BPromise(function(_0x475577,_0x501e8b){return client[_0x45f0('0xc')](_0x4c6237,_0x670dba)[_0x45f0('0xd')](function(_0x335c2f){logger[_0x45f0('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3a077c,_0x45f0('0xf'));logger[_0x45f0('0x10')](_0x45f0('0x11'),_0x3a077c,_0x45f0('0xf'),JSON[_0x45f0('0x12')](_0x335c2f));if(_0x335c2f[_0x45f0('0x13')]){if(_0x335c2f[_0x45f0('0x13')][_0x45f0('0x14')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x3a077c,_0x335c2f[_0x45f0('0x13')]['message']);return _0x501e8b(_0x335c2f[_0x45f0('0x13')][_0x45f0('0x15')]);}logger[_0x45f0('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3a077c,_0x335c2f['error']['message']);return _0x475577(_0x335c2f[_0x45f0('0x13')]['message']);}else{logger[_0x45f0('0xe')](_0x45f0('0x16'),_0x3a077c,_0x45f0('0xf'));_0x475577(_0x335c2f['result'][_0x45f0('0x15')]);}})[_0x45f0('0x17')](function(_0x53d442){logger[_0x45f0('0x13')](_0x45f0('0x16'),_0x3a077c,_0x53d442);_0x501e8b(_0x53d442);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 994b42c..6f76aad 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 _0x277a=['delete','exports','multer','util','connect-timeout','Router','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x2af100,_0x74d2b){var _0x25948a=function(_0xc3e717){while(--_0xc3e717){_0x2af100['push'](_0x2af100['shift']());}};_0x25948a(++_0x74d2b);}(_0x277a,0x1c2));var _0xa277=function(_0x969859,_0x77c4b2){_0x969859=_0x969859-0x0;var _0x129fc8=_0x277a[_0x969859];return _0x129fc8;};'use strict';var multer=require(_0xa277('0x0'));var util=require(_0xa277('0x1'));var path=require('path');var timeout=require(_0xa277('0x2'));var express=require('express');var router=express[_0xa277('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa277('0x4'));router[_0xa277('0x5')]('/',auth[_0xa277('0x6')](),controller[_0xa277('0x7')]);router[_0xa277('0x5')](_0xa277('0x8'),auth[_0xa277('0x6')](),controller[_0xa277('0x9')]);router[_0xa277('0xa')]('/',auth['isAuthenticated'](),controller[_0xa277('0xb')]);router[_0xa277('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xa277('0xd')]);router[_0xa277('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa277('0xf')]=router; \ No newline at end of file +var _0x57ba=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','/:id','show','post'];(function(_0x28ee74,_0x376b00){var _0x2ada79=function(_0x2ee2bc){while(--_0x2ee2bc){_0x28ee74['push'](_0x28ee74['shift']());}};_0x2ada79(++_0x376b00);}(_0x57ba,0x15c));var _0xa57b=function(_0x566a86,_0x1e19da){_0x566a86=_0x566a86-0x0;var _0x448990=_0x57ba[_0x566a86];return _0x448990;};'use strict';var multer=require(_0xa57b('0x0'));var util=require(_0xa57b('0x1'));var path=require(_0xa57b('0x2'));var timeout=require('connect-timeout');var express=require(_0xa57b('0x3'));var router=express[_0xa57b('0x4')]();var fs_extra=require(_0xa57b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa57b('0x6'));var controller=require(_0xa57b('0x7'));router['get']('/',auth[_0xa57b('0x8')](),controller[_0xa57b('0x9')]);router['get'](_0xa57b('0xa'),auth[_0xa57b('0x8')](),controller[_0xa57b('0xb')]);router[_0xa57b('0xc')]('/',auth[_0xa57b('0x8')](),controller[_0xa57b('0xd')]);router[_0xa57b('0xe')](_0xa57b('0xa'),auth[_0xa57b('0x8')](),controller[_0xa57b('0xf')]);router[_0xa57b('0x10')](_0xa57b('0xa'),auth['isAuthenticated'](),controller[_0xa57b('0x11')]);module[_0xa57b('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index d4c7cfa..692e141 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 _0x73e6=['ENUM','exports','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x73e6,0x1d9));var _0x673e=function(_0x2294b6,_0x3df3c5){_0x2294b6=_0x2294b6-0x0;var _0x5e8208=_0x73e6[_0x2294b6];return _0x5e8208;};'use strict';var Sequelize=require('sequelize');module[_0x673e('0x0')]={'type':{'type':Sequelize['ENUM'](_0x673e('0x1'),_0x673e('0x2'),_0x673e('0x3'),_0x673e('0x4'),_0x673e('0x5')),'defaultValue':_0x673e('0x1')},'content':{'type':Sequelize[_0x673e('0x6')]},'key':{'type':Sequelize[_0x673e('0x6')]},'keyType':{'type':Sequelize[_0x673e('0x7')](_0x673e('0x1'),_0x673e('0x2'),_0x673e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x673e('0x6')]}}; \ No newline at end of file +var _0x90dc=['variable','keyValue','picklist','STRING','ENUM','string'];(function(_0x1ec6ec,_0x2528f9){var _0xf1363=function(_0xfd0aea){while(--_0xfd0aea){_0x1ec6ec['push'](_0x1ec6ec['shift']());}};_0xf1363(++_0x2528f9);}(_0x90dc,0x1de));var _0xc90d=function(_0x9b7e86,_0x1ea146){_0x9b7e86=_0x9b7e86-0x0;var _0x43d3aa=_0x90dc[_0x9b7e86];return _0x43d3aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc90d('0x0')](_0xc90d('0x1'),_0xc90d('0x2'),'customVariable',_0xc90d('0x3'),_0xc90d('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc90d('0x5')]},'key':{'type':Sequelize[_0xc90d('0x5')]},'keyType':{'type':Sequelize[_0xc90d('0x0')]('string',_0xc90d('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc90d('0x5')]},'idField':{'type':Sequelize[_0xc90d('0x5')]},'variableName':{'type':Sequelize[_0xc90d('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index ab57003..ff32859 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 _0xd18a=['apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','merge','filter','SalesforceField','includeAll','include','findAll','rows','catch','fields','options','find','create','body','params','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xd18a,0x106));var _0xad18=function(_0x13c9c8,_0x51d14d){_0x13c9c8=_0x13c9c8-0x0;var _0x39e0e2=_0xd18a[_0x13c9c8];return _0x39e0e2;};'use strict';var emlformat=require(_0xad18('0x0'));var rimraf=require(_0xad18('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad18('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xad18('0x3'));var Mustache=require(_0xad18('0x4'));var util=require(_0xad18('0x5'));var path=require('path');var sox=require(_0xad18('0x6'));var csv=require(_0xad18('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad18('0x8'));var _=require(_0xad18('0x9'));var squel=require(_0xad18('0xa'));var crypto=require(_0xad18('0xb'));var jsforce=require(_0xad18('0xc'));var deskjs=require(_0xad18('0xd'));var toCsv=require(_0xad18('0x7'));var querystring=require(_0xad18('0xe'));var Papa=require(_0xad18('0xf'));var Redis=require('ioredis');var authService=require(_0xad18('0x10'));var qs=require(_0xad18('0x11'));var as=require(_0xad18('0x12'));var hardwareService=require(_0xad18('0x13'));var logger=require('../../config/logger')(_0xad18('0x14'));var utils=require(_0xad18('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xad18('0x16'));var db=require(_0xad18('0x17'))['db'];function respondWithStatusCode(_0x1fda28,_0x19c044){_0x19c044=_0x19c044||0xcc;return function(_0x307377){if(_0x307377){return _0x1fda28[_0xad18('0x18')](_0x19c044);}return _0x1fda28[_0xad18('0x19')](_0x19c044)[_0xad18('0x1a')]();};}function respondWithResult(_0x1ec538,_0x41ca0b){_0x41ca0b=_0x41ca0b||0xc8;return function(_0x448be7){if(_0x448be7){return _0x1ec538[_0xad18('0x19')](_0x41ca0b)[_0xad18('0x1b')](_0x448be7);}};}function respondWithFilteredResult(_0xc02630,_0x372a51){return function(_0x35c136){if(_0x35c136){var _0x45fa10=typeof _0x372a51[_0xad18('0x1c')]===_0xad18('0x1d')&&typeof _0x372a51[_0xad18('0x1e')]===_0xad18('0x1d');var _0x45fe01=_0x35c136[_0xad18('0x1f')];var _0x5d50e3=_0x45fa10?0x0:_0x372a51['offset'];var _0x18691a=_0x45fa10?_0x35c136['count']:_0x372a51['offset']+_0x372a51[_0xad18('0x1e')];var _0x1ccb13;if(_0x18691a>=_0x45fe01){_0x18691a=_0x45fe01;_0x1ccb13=0xc8;}else{_0x1ccb13=0xce;}_0xc02630[_0xad18('0x19')](_0x1ccb13);return _0xc02630[_0xad18('0x20')](_0xad18('0x21'),_0x5d50e3+'-'+_0x18691a+'/'+_0x45fe01)[_0xad18('0x1b')](_0x35c136);}return null;};}function patchUpdates(_0x16bc71){return function(_0x1bbd0e){try{jsonpatch[_0xad18('0x22')](_0x1bbd0e,_0x16bc71,!![]);}catch(_0x4b57d8){return BPromise[_0xad18('0x23')](_0x4b57d8);}return _0x1bbd0e[_0xad18('0x24')]();};}function saveUpdates(_0x5a4a6f,_0x39078a){return function(_0x495fee){if(_0x495fee){return _0x495fee[_0xad18('0x25')](_0x5a4a6f)[_0xad18('0x26')](function(_0x1e58c9){return _0x1e58c9;});}return null;};}function removeEntity(_0x50738e,_0x49c5be){return function(_0x336a9a){if(_0x336a9a){return _0x336a9a[_0xad18('0x27')]()[_0xad18('0x26')](function(){_0x50738e[_0xad18('0x19')](0xcc)[_0xad18('0x1a')]();});}};}function handleEntityNotFound(_0x3801ea,_0x504cdd){return function(_0x410ab6){if(!_0x410ab6){_0x3801ea[_0xad18('0x18')](0x194);}return _0x410ab6;};}function handleError(_0x77700,_0x5293aa){_0x5293aa=_0x5293aa||0x1f4;return function(_0x217c62){logger[_0xad18('0x28')](_0x217c62['stack']);if(_0x217c62[_0xad18('0x29')]){delete _0x217c62[_0xad18('0x29')];}_0x77700[_0xad18('0x19')](_0x5293aa)[_0xad18('0x2a')](_0x217c62);};}exports[_0xad18('0x2b')]=function(_0x5ffc81,_0x2f1cec){var _0x59a234={},_0x34a9d4={},_0x7bbc64={'count':0x0,'rows':[]};var _0xb16e54=_[_0xad18('0x2c')](db['SalesforceField'][_0xad18('0x2d')],function(_0x3307b6){return{'name':_0x3307b6[_0xad18('0x2e')],'type':_0x3307b6[_0xad18('0x2f')][_0xad18('0x30')]};});_0x34a9d4[_0xad18('0x31')]=_[_0xad18('0x2c')](_0xb16e54,'name');_0x34a9d4[_0xad18('0x32')]=_[_0xad18('0x33')](_0x5ffc81[_0xad18('0x32')]);_0x34a9d4[_0xad18('0x34')]=_[_0xad18('0x35')](_0x34a9d4[_0xad18('0x31')],_0x34a9d4['query']);_0x59a234['attributes']=_[_0xad18('0x35')](_0x34a9d4['model'],qs['fields'](_0x5ffc81[_0xad18('0x32')]['fields']));_0x59a234['attributes']=_0x59a234[_0xad18('0x36')][_0xad18('0x37')]?_0x59a234[_0xad18('0x36')]:_0x34a9d4[_0xad18('0x31')];if(!_0x5ffc81[_0xad18('0x32')]['hasOwnProperty'](_0xad18('0x38'))){_0x59a234[_0xad18('0x1e')]=qs['limit'](_0x5ffc81[_0xad18('0x32')][_0xad18('0x1e')]);_0x59a234[_0xad18('0x1c')]=qs['offset'](_0x5ffc81['query'][_0xad18('0x1c')]);}_0x59a234[_0xad18('0x39')]=qs['sort'](_0x5ffc81['query'][_0xad18('0x3a')]);_0x59a234[_0xad18('0x3b')]=qs[_0xad18('0x34')](_['pick'](_0x5ffc81[_0xad18('0x32')],_0x34a9d4[_0xad18('0x34')]),_0xb16e54);if(_0x5ffc81[_0xad18('0x32')]['filter']){_0x59a234[_0xad18('0x3b')]=_[_0xad18('0x3c')](_0x59a234['where'],{'$or':_[_0xad18('0x2c')](_0xb16e54,function(_0xeee56d){if(_0xeee56d[_0xad18('0x2f')]!=='VIRTUAL'){var _0x206e31={};_0x206e31[_0xeee56d[_0xad18('0x29')]]={'$like':'%'+_0x5ffc81['query'][_0xad18('0x3d')]+'%'};return _0x206e31;}})});}_0x59a234=_[_0xad18('0x3c')]({},_0x59a234,_0x5ffc81['options']);var _0x1a1683={'where':_0x59a234['where']};return db[_0xad18('0x3e')][_0xad18('0x1f')](_0x1a1683)[_0xad18('0x26')](function(_0x303ce5){_0x7bbc64[_0xad18('0x1f')]=_0x303ce5;if(_0x5ffc81[_0xad18('0x32')][_0xad18('0x3f')]){_0x59a234[_0xad18('0x40')]=[{'all':!![]}];}return db['SalesforceField'][_0xad18('0x41')](_0x59a234);})[_0xad18('0x26')](function(_0x4f6391){_0x7bbc64[_0xad18('0x42')]=_0x4f6391;return _0x7bbc64;})[_0xad18('0x26')](respondWithFilteredResult(_0x2f1cec,_0x59a234))[_0xad18('0x43')](handleError(_0x2f1cec,null));};exports['show']=function(_0x338e70,_0x2fe06b){var _0x1f4b82={'raw':!![],'where':{'id':_0x338e70['params']['id']}},_0x595641={};_0x595641['model']=_[_0xad18('0x33')](db['SalesforceField']['rawAttributes']);_0x595641[_0xad18('0x32')]=_[_0xad18('0x33')](_0x338e70[_0xad18('0x32')]);_0x595641[_0xad18('0x34')]=_[_0xad18('0x35')](_0x595641[_0xad18('0x31')],_0x595641[_0xad18('0x32')]);_0x1f4b82[_0xad18('0x36')]=_[_0xad18('0x35')](_0x595641['model'],qs[_0xad18('0x44')](_0x338e70[_0xad18('0x32')][_0xad18('0x44')]));_0x1f4b82[_0xad18('0x36')]=_0x1f4b82[_0xad18('0x36')]['length']?_0x1f4b82[_0xad18('0x36')]:_0x595641[_0xad18('0x31')];if(_0x338e70['query']['includeAll']){_0x1f4b82[_0xad18('0x40')]=[{'all':!![]}];}_0x1f4b82=_['merge']({},_0x1f4b82,_0x338e70[_0xad18('0x45')]);return db[_0xad18('0x3e')][_0xad18('0x46')](_0x1f4b82)[_0xad18('0x26')](handleEntityNotFound(_0x2fe06b,null))[_0xad18('0x26')](respondWithResult(_0x2fe06b,null))[_0xad18('0x43')](handleError(_0x2fe06b,null));};exports['create']=function(_0x167553,_0x590c59){return db[_0xad18('0x3e')][_0xad18('0x47')](_0x167553['body'],{})[_0xad18('0x26')](respondWithResult(_0x590c59,0xc9))[_0xad18('0x43')](handleError(_0x590c59,null));};exports[_0xad18('0x25')]=function(_0x3ff499,_0x520cc9){if(_0x3ff499[_0xad18('0x48')]['id']){delete _0x3ff499[_0xad18('0x48')]['id'];}return db[_0xad18('0x3e')][_0xad18('0x46')]({'where':{'id':_0x3ff499['params']['id']}})[_0xad18('0x26')](handleEntityNotFound(_0x520cc9,null))[_0xad18('0x26')](saveUpdates(_0x3ff499[_0xad18('0x48')],null))[_0xad18('0x26')](respondWithResult(_0x520cc9,null))[_0xad18('0x43')](handleError(_0x520cc9,null));};exports['destroy']=function(_0x45deb3,_0x17deff){return db[_0xad18('0x3e')][_0xad18('0x46')]({'where':{'id':_0x45deb3[_0xad18('0x49')]['id']}})[_0xad18('0x26')](handleEntityNotFound(_0x17deff,null))[_0xad18('0x26')](removeEntity(_0x17deff,null))['catch'](handleError(_0x17deff,null));}; \ No newline at end of file +var _0xe845=['SalesforceField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','name','send','map'];(function(_0x3f8364,_0xc5bb3){var _0x1590fa=function(_0x16cf02){while(--_0x16cf02){_0x3f8364['push'](_0x3f8364['shift']());}};_0x1590fa(++_0xc5bb3);}(_0xe845,0xab));var _0x5e84=function(_0x4181a6,_0x43536a){_0x4181a6=_0x4181a6-0x0;var _0x18d67c=_0xe845[_0x4181a6];return _0x18d67c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e84('0x0'));var zipdir=require(_0x5e84('0x1'));var jsonpatch=require(_0x5e84('0x2'));var rp=require(_0x5e84('0x3'));var moment=require(_0x5e84('0x4'));var BPromise=require(_0x5e84('0x5'));var Mustache=require(_0x5e84('0x6'));var util=require(_0x5e84('0x7'));var path=require(_0x5e84('0x8'));var sox=require(_0x5e84('0x9'));var csv=require(_0x5e84('0xa'));var ejs=require(_0x5e84('0xb'));var fs=require('fs');var fs_extra=require(_0x5e84('0xc'));var _=require(_0x5e84('0xd'));var squel=require(_0x5e84('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e84('0xf'));var toCsv=require(_0x5e84('0xa'));var querystring=require('querystring');var Papa=require(_0x5e84('0x10'));var Redis=require(_0x5e84('0x11'));var authService=require(_0x5e84('0x12'));var qs=require(_0x5e84('0x13'));var as=require(_0x5e84('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5e84('0x15'));var utils=require(_0x5e84('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5e84('0x17'));var db=require(_0x5e84('0x18'))['db'];function respondWithStatusCode(_0x1d025a,_0x41125a){_0x41125a=_0x41125a||0xcc;return function(_0x1eeeee){if(_0x1eeeee){return _0x1d025a[_0x5e84('0x19')](_0x41125a);}return _0x1d025a[_0x5e84('0x1a')](_0x41125a)['end']();};}function respondWithResult(_0x4c0a96,_0x20ceb1){_0x20ceb1=_0x20ceb1||0xc8;return function(_0x3189cd){if(_0x3189cd){return _0x4c0a96[_0x5e84('0x1a')](_0x20ceb1)['json'](_0x3189cd);}};}function respondWithFilteredResult(_0x41dc17,_0x50147f){return function(_0x2dc943){if(_0x2dc943){var _0x3057e1=typeof _0x50147f[_0x5e84('0x1b')]==='undefined'&&typeof _0x50147f[_0x5e84('0x1c')]===_0x5e84('0x1d');var _0x46b7be=_0x2dc943[_0x5e84('0x1e')];var _0x40e863=_0x3057e1?0x0:_0x50147f[_0x5e84('0x1b')];var _0xc96e2b=_0x3057e1?_0x2dc943[_0x5e84('0x1e')]:_0x50147f[_0x5e84('0x1b')]+_0x50147f[_0x5e84('0x1c')];var _0x1610bb;if(_0xc96e2b>=_0x46b7be){_0xc96e2b=_0x46b7be;_0x1610bb=0xc8;}else{_0x1610bb=0xce;}_0x41dc17[_0x5e84('0x1a')](_0x1610bb);return _0x41dc17[_0x5e84('0x1f')](_0x5e84('0x20'),_0x40e863+'-'+_0xc96e2b+'/'+_0x46b7be)[_0x5e84('0x21')](_0x2dc943);}return null;};}function patchUpdates(_0x13dec6){return function(_0x35e627){try{jsonpatch[_0x5e84('0x22')](_0x35e627,_0x13dec6,!![]);}catch(_0x505b58){return BPromise['reject'](_0x505b58);}return _0x35e627[_0x5e84('0x23')]();};}function saveUpdates(_0x650fb2,_0x33c2f4){return function(_0x17f50e){if(_0x17f50e){return _0x17f50e[_0x5e84('0x24')](_0x650fb2)[_0x5e84('0x25')](function(_0x351e5a){return _0x351e5a;});}return null;};}function removeEntity(_0x5c25ba,_0x5d7d9d){return function(_0x3c166d){if(_0x3c166d){return _0x3c166d[_0x5e84('0x26')]()[_0x5e84('0x25')](function(){_0x5c25ba[_0x5e84('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56bb54,_0x4c4504){return function(_0x47ebdd){if(!_0x47ebdd){_0x56bb54[_0x5e84('0x19')](0x194);}return _0x47ebdd;};}function handleError(_0x4af6e5,_0x902e68){_0x902e68=_0x902e68||0x1f4;return function(_0x34b8e2){logger['error'](_0x34b8e2['stack']);if(_0x34b8e2[_0x5e84('0x27')]){delete _0x34b8e2['name'];}_0x4af6e5['status'](_0x902e68)[_0x5e84('0x28')](_0x34b8e2);};}exports['index']=function(_0x99acd1,_0x241d50){var _0x48c833={},_0x40e209={},_0x1aa947={'count':0x0,'rows':[]};var _0x386531=_[_0x5e84('0x29')](db[_0x5e84('0x2a')][_0x5e84('0x2b')],function(_0x1848e8){return{'name':_0x1848e8[_0x5e84('0x2c')],'type':_0x1848e8['type'][_0x5e84('0x2d')]};});_0x40e209[_0x5e84('0x2e')]=_['map'](_0x386531,_0x5e84('0x27'));_0x40e209[_0x5e84('0x2f')]=_['keys'](_0x99acd1[_0x5e84('0x2f')]);_0x40e209[_0x5e84('0x30')]=_[_0x5e84('0x31')](_0x40e209[_0x5e84('0x2e')],_0x40e209['query']);_0x48c833[_0x5e84('0x32')]=_[_0x5e84('0x31')](_0x40e209[_0x5e84('0x2e')],qs[_0x5e84('0x33')](_0x99acd1[_0x5e84('0x2f')]['fields']));_0x48c833[_0x5e84('0x32')]=_0x48c833[_0x5e84('0x32')][_0x5e84('0x34')]?_0x48c833[_0x5e84('0x32')]:_0x40e209['model'];if(!_0x99acd1['query'][_0x5e84('0x35')]('nolimit')){_0x48c833[_0x5e84('0x1c')]=qs[_0x5e84('0x1c')](_0x99acd1['query'][_0x5e84('0x1c')]);_0x48c833[_0x5e84('0x1b')]=qs[_0x5e84('0x1b')](_0x99acd1[_0x5e84('0x2f')][_0x5e84('0x1b')]);}_0x48c833['order']=qs[_0x5e84('0x36')](_0x99acd1[_0x5e84('0x2f')][_0x5e84('0x36')]);_0x48c833[_0x5e84('0x37')]=qs[_0x5e84('0x30')](_[_0x5e84('0x38')](_0x99acd1['query'],_0x40e209['filters']),_0x386531);if(_0x99acd1[_0x5e84('0x2f')][_0x5e84('0x39')]){_0x48c833[_0x5e84('0x37')]=_[_0x5e84('0x3a')](_0x48c833[_0x5e84('0x37')],{'$or':_[_0x5e84('0x29')](_0x386531,function(_0x18202a){if(_0x18202a['type']!==_0x5e84('0x3b')){var _0x4f56e8={};_0x4f56e8[_0x18202a[_0x5e84('0x27')]]={'$like':'%'+_0x99acd1['query'][_0x5e84('0x39')]+'%'};return _0x4f56e8;}})});}_0x48c833=_[_0x5e84('0x3a')]({},_0x48c833,_0x99acd1[_0x5e84('0x3c')]);var _0x45f4aa={'where':_0x48c833[_0x5e84('0x37')]};return db[_0x5e84('0x2a')][_0x5e84('0x1e')](_0x45f4aa)[_0x5e84('0x25')](function(_0x5798c8){_0x1aa947[_0x5e84('0x1e')]=_0x5798c8;if(_0x99acd1[_0x5e84('0x2f')][_0x5e84('0x3d')]){_0x48c833[_0x5e84('0x3e')]=[{'all':!![]}];}return db[_0x5e84('0x2a')][_0x5e84('0x3f')](_0x48c833);})[_0x5e84('0x25')](function(_0x3ab319){_0x1aa947['rows']=_0x3ab319;return _0x1aa947;})[_0x5e84('0x25')](respondWithFilteredResult(_0x241d50,_0x48c833))[_0x5e84('0x40')](handleError(_0x241d50,null));};exports[_0x5e84('0x41')]=function(_0x418101,_0x2d9e80){var _0x4954d7={'raw':!![],'where':{'id':_0x418101[_0x5e84('0x42')]['id']}},_0x5dcdbf={};_0x5dcdbf[_0x5e84('0x2e')]=_[_0x5e84('0x43')](db['SalesforceField'][_0x5e84('0x2b')]);_0x5dcdbf[_0x5e84('0x2f')]=_['keys'](_0x418101[_0x5e84('0x2f')]);_0x5dcdbf[_0x5e84('0x30')]=_[_0x5e84('0x31')](_0x5dcdbf[_0x5e84('0x2e')],_0x5dcdbf[_0x5e84('0x2f')]);_0x4954d7[_0x5e84('0x32')]=_['intersection'](_0x5dcdbf[_0x5e84('0x2e')],qs[_0x5e84('0x33')](_0x418101[_0x5e84('0x2f')][_0x5e84('0x33')]));_0x4954d7[_0x5e84('0x32')]=_0x4954d7[_0x5e84('0x32')][_0x5e84('0x34')]?_0x4954d7[_0x5e84('0x32')]:_0x5dcdbf['model'];if(_0x418101[_0x5e84('0x2f')][_0x5e84('0x3d')]){_0x4954d7[_0x5e84('0x3e')]=[{'all':!![]}];}_0x4954d7=_[_0x5e84('0x3a')]({},_0x4954d7,_0x418101[_0x5e84('0x3c')]);return db[_0x5e84('0x2a')][_0x5e84('0x44')](_0x4954d7)[_0x5e84('0x25')](handleEntityNotFound(_0x2d9e80,null))[_0x5e84('0x25')](respondWithResult(_0x2d9e80,null))[_0x5e84('0x40')](handleError(_0x2d9e80,null));};exports['create']=function(_0x3b7b9e,_0x1c6707){return db[_0x5e84('0x2a')][_0x5e84('0x45')](_0x3b7b9e['body'],{})['then'](respondWithResult(_0x1c6707,0xc9))[_0x5e84('0x40')](handleError(_0x1c6707,null));};exports[_0x5e84('0x24')]=function(_0x5b3f27,_0x1a77b8){if(_0x5b3f27[_0x5e84('0x46')]['id']){delete _0x5b3f27[_0x5e84('0x46')]['id'];}return db['SalesforceField'][_0x5e84('0x44')]({'where':{'id':_0x5b3f27[_0x5e84('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a77b8,null))['then'](saveUpdates(_0x5b3f27[_0x5e84('0x46')],null))[_0x5e84('0x25')](respondWithResult(_0x1a77b8,null))['catch'](handleError(_0x1a77b8,null));};exports[_0x5e84('0x26')]=function(_0x4b864a,_0x68d273){return db[_0x5e84('0x2a')]['find']({'where':{'id':_0x4b864a[_0x5e84('0x42')]['id']}})['then'](handleEntityNotFound(_0x68d273,null))[_0x5e84('0x25')](removeEntity(_0x68d273,null))[_0x5e84('0x40')](handleError(_0x68d273,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index c041f5b..bfac50b 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 _0x9fd4=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash'];(function(_0x56fc59,_0x1d808a){var _0x426b31=function(_0xcc23a8){while(--_0xcc23a8){_0x56fc59['push'](_0x56fc59['shift']());}};_0x426b31(++_0x1d808a);}(_0x9fd4,0x151));var _0x49fd=function(_0x5b8608,_0x527731){_0x5b8608=_0x5b8608-0x0;var _0x3f8d3d=_0x9fd4[_0x5b8608];return _0x3f8d3d;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var logger=require(_0x49fd('0x2'))(_0x49fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x49fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x49fd('0x5'));var config=require(_0x49fd('0x6'));var attributes=require(_0x49fd('0x7'));module[_0x49fd('0x8')]=function(_0x5b5bbc,_0x33efa4){return _0x5b5bbc['define'](_0x49fd('0x9'),attributes,{'tableName':_0x49fd('0xa'),'paranoid':![],'indexes':[{'name':_0x49fd('0xb'),'fields':[_0x49fd('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9df=['api','moment','bluebird','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x11360b,_0x5a55aa){var _0x169c46=function(_0x53504e){while(--_0x53504e){_0x11360b['push'](_0x11360b['shift']());}};_0x169c46(++_0x5a55aa);}(_0xd9df,0xd0));var _0xfd9d=function(_0x18d51a,_0x538984){_0x18d51a=_0x18d51a-0x0;var _0x5780bc=_0xd9df[_0x18d51a];return _0x5780bc;};'use strict';var _=require(_0xfd9d('0x0'));var util=require('util');var logger=require(_0xfd9d('0x1'))(_0xfd9d('0x2'));var moment=require(_0xfd9d('0x3'));var BPromise=require(_0xfd9d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfd9d('0x5'));var config=require(_0xfd9d('0x6'));var attributes=require(_0xfd9d('0x7'));module[_0xfd9d('0x8')]=function(_0xa015e5,_0x44a4e9){return _0xa015e5['define'](_0xfd9d('0x9'),attributes,{'tableName':_0xfd9d('0xa'),'paranoid':![],'indexes':[{'name':_0xfd9d('0xb'),'fields':[_0xfd9d('0xc'),_0xfd9d('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 c5b3d89..48e98f0 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 _0x2485=['../../config/logger','../../config/environment','client','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x15abc6,_0x40eeb5){var _0x20b05b=function(_0x365802){while(--_0x365802){_0x15abc6['push'](_0x15abc6['shift']());}};_0x20b05b(++_0x40eeb5);}(_0x2485,0x1b1));var _0x5248=function(_0x543eac,_0x3a39a1){_0x543eac=_0x543eac-0x0;var _0x16c036=_0x2485[_0x543eac];return _0x16c036;};'use strict';var _=require(_0x5248('0x0'));var util=require('util');var moment=require(_0x5248('0x1'));var BPromise=require(_0x5248('0x2'));var rs=require(_0x5248('0x3'));var fs=require('fs');var Redis=require(_0x5248('0x4'));var db=require(_0x5248('0x5'))['db'];var utils=require(_0x5248('0x6'));var logger=require(_0x5248('0x7'))('rpc');var config=require(_0x5248('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5248('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf77b1a,_0x59d018,_0x59b051){return new BPromise(function(_0x90d3b,_0x289985){return client[_0x5248('0xa')](_0xf77b1a,_0x59b051)[_0x5248('0xb')](function(_0x205ce3){logger['info'](_0x5248('0xc'),_0x59d018,_0x5248('0xd'));logger[_0x5248('0xe')](_0x5248('0xf'),_0x59d018,'request\x20sent',JSON['stringify'](_0x205ce3));if(_0x205ce3[_0x5248('0x10')]){if(_0x205ce3[_0x5248('0x10')][_0x5248('0x11')]===0x1f4){logger[_0x5248('0x10')]('SalesforceField,\x20%s,\x20%s',_0x59d018,_0x205ce3['error'][_0x5248('0x12')]);return _0x289985(_0x205ce3[_0x5248('0x10')][_0x5248('0x12')]);}logger[_0x5248('0x10')](_0x5248('0xc'),_0x59d018,_0x205ce3[_0x5248('0x10')]['message']);return _0x90d3b(_0x205ce3[_0x5248('0x10')][_0x5248('0x12')]);}else{logger[_0x5248('0x13')]('SalesforceField,\x20%s,\x20%s',_0x59d018,_0x5248('0xd'));_0x90d3b(_0x205ce3[_0x5248('0x14')]['message']);}})[_0x5248('0x15')](function(_0x54bf58){logger['error']('SalesforceField,\x20%s,\x20%s',_0x59d018,_0x54bf58);_0x289985(_0x54bf58);});});} \ No newline at end of file +var _0x101f=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x508926,_0xa05b4f){var _0x49ab00=function(_0x360b74){while(--_0x360b74){_0x508926['push'](_0x508926['shift']());}};_0x49ab00(++_0xa05b4f);}(_0x101f,0xa3));var _0xf101=function(_0xabe2c0,_0x4c4e5f){_0xabe2c0=_0xabe2c0-0x0;var _0x26791f=_0x101f[_0xabe2c0];return _0x26791f;};'use strict';var _=require(_0xf101('0x0'));var util=require('util');var moment=require(_0xf101('0x1'));var BPromise=require(_0xf101('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf101('0x3'));var db=require(_0xf101('0x4'))['db'];var utils=require(_0xf101('0x5'));var logger=require(_0xf101('0x6'))('rpc');var config=require(_0xf101('0x7'));var jayson=require(_0xf101('0x8'));var client=jayson[_0xf101('0x9')][_0xf101('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ec246,_0x155066,_0x1ab516){return new BPromise(function(_0x38ea4d,_0x3f97d8){return client[_0xf101('0xb')](_0x2ec246,_0x1ab516)[_0xf101('0xc')](function(_0xfdb07d){logger[_0xf101('0xd')](_0xf101('0xe'),_0x155066,'request\x20sent');logger['debug'](_0xf101('0xf'),_0x155066,_0xf101('0x10'),JSON['stringify'](_0xfdb07d));if(_0xfdb07d[_0xf101('0x11')]){if(_0xfdb07d[_0xf101('0x11')][_0xf101('0x12')]===0x1f4){logger['error'](_0xf101('0xe'),_0x155066,_0xfdb07d[_0xf101('0x11')][_0xf101('0x13')]);return _0x3f97d8(_0xfdb07d[_0xf101('0x11')]['message']);}logger[_0xf101('0x11')](_0xf101('0xe'),_0x155066,_0xfdb07d['error']['message']);return _0x38ea4d(_0xfdb07d[_0xf101('0x11')][_0xf101('0x13')]);}else{logger['info'](_0xf101('0xe'),_0x155066,_0xf101('0x10'));_0x38ea4d(_0xfdb07d['result'][_0xf101('0x13')]);}})[_0xf101('0x14')](function(_0x15043d){logger[_0xf101('0x11')]('SalesforceField,\x20%s,\x20%s',_0x155066,_0x15043d);_0x3f97d8(_0x15043d);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index d8a6e16..e1b67e6 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 _0xa900=['./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xa900,0x101));var _0x0a90=function(_0x29f6f8,_0x370292){_0x29f6f8=_0x29f6f8-0x0;var _0x379929=_0xa900[_0x29f6f8];return _0x379929;};'use strict';var multer=require(_0x0a90('0x0'));var util=require(_0x0a90('0x1'));var path=require(_0x0a90('0x2'));var timeout=require(_0x0a90('0x3'));var express=require(_0x0a90('0x4'));var router=express[_0x0a90('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0a90('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a90('0x7'));router[_0x0a90('0x8')]('/',auth[_0x0a90('0x9')](),controller[_0x0a90('0xa')]);router['get'](_0x0a90('0xb'),auth[_0x0a90('0x9')](),controller[_0x0a90('0xc')]);router['get'](_0x0a90('0xd'),auth[_0x0a90('0x9')](),controller[_0x0a90('0xe')]);router['get'](_0x0a90('0xf'),auth['isAuthenticated'](),controller[_0x0a90('0x10')]);router[_0x0a90('0x11')]('/',auth['isAuthenticated'](),controller[_0x0a90('0x12')]);router[_0x0a90('0x11')](_0x0a90('0xd'),auth[_0x0a90('0x9')](),controller[_0x0a90('0x13')]);router[_0x0a90('0x14')](_0x0a90('0xb'),auth[_0x0a90('0x9')](),controller[_0x0a90('0x15')]);router[_0x0a90('0x16')](_0x0a90('0xb'),auth[_0x0a90('0x9')](),controller[_0x0a90('0x17')]);module['exports']=router; \ No newline at end of file +var _0xdff8=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','index','/:id','isAuthenticated','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','delete','destroy','multer','util','path'];(function(_0x22594f,_0x32c4b1){var _0x4a03e8=function(_0x321def){while(--_0x321def){_0x22594f['push'](_0x22594f['shift']());}};_0x4a03e8(++_0x32c4b1);}(_0xdff8,0xc3));var _0x8dff=function(_0x2b950c,_0x57cc37){_0x2b950c=_0x2b950c-0x0;var _0x592648=_0xdff8[_0x2b950c];return _0x592648;};'use strict';var multer=require(_0x8dff('0x0'));var util=require(_0x8dff('0x1'));var path=require(_0x8dff('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8dff('0x3')]();var fs_extra=require(_0x8dff('0x4'));var auth=require(_0x8dff('0x5'));var interaction=require(_0x8dff('0x6'));var config=require(_0x8dff('0x7'));var controller=require(_0x8dff('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8dff('0x9')]);router['get'](_0x8dff('0xa'),auth[_0x8dff('0xb')](),controller['show']);router[_0x8dff('0xc')](_0x8dff('0xd'),auth['isAuthenticated'](),controller[_0x8dff('0xe')]);router['get'](_0x8dff('0xf'),auth[_0x8dff('0xb')](),controller[_0x8dff('0x10')]);router[_0x8dff('0x11')]('/',auth[_0x8dff('0xb')](),controller['create']);router[_0x8dff('0x11')]('/:id/configurations',auth[_0x8dff('0xb')](),controller[_0x8dff('0x12')]);router['put'](_0x8dff('0xa'),auth['isAuthenticated'](),controller[_0x8dff('0x13')]);router[_0x8dff('0x14')](_0x8dff('0xa'),auth[_0x8dff('0xb')](),controller[_0x8dff('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 1566c29..f9d97c3 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 _0xc8db=['sequelize','exports','STRING','remoteUri'];(function(_0x129534,_0x560a44){var _0x430eb4=function(_0x3454ab){while(--_0x3454ab){_0x129534['push'](_0x129534['shift']());}};_0x430eb4(++_0x560a44);}(_0xc8db,0x150));var _0xbc8d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc8db[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xbc8d('0x0'));module[_0xbc8d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbc8d('0x2')]},'username':{'type':Sequelize[_0xbc8d('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbc8d('0x2')],'unique':_0xbc8d('0x3')},'serverUrl':{'type':Sequelize[_0xbc8d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e3=['sequelize','exports','STRING','username','remoteUri'];(function(_0x551b81,_0x1d23b5){var _0xe0b2d6=function(_0x1ee5d9){while(--_0x1ee5d9){_0x551b81['push'](_0x551b81['shift']());}};_0xe0b2d6(++_0x1d23b5);}(_0xa9e3,0x113));var _0x3a9e=function(_0x46e40f,_0x6794d4){_0x46e40f=_0x46e40f-0x0;var _0x3f2663=_0xa9e3[_0x46e40f];return _0x3f2663;};'use strict';var Sequelize=require(_0x3a9e('0x0'));module[_0x3a9e('0x1')]={'name':{'type':Sequelize[_0x3a9e('0x2')]},'description':{'type':Sequelize[_0x3a9e('0x2')]},'username':{'type':Sequelize[_0x3a9e('0x2')],'unique':_0x3a9e('0x3')},'password':{'type':Sequelize[_0x3a9e('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3a9e('0x2')],'unique':_0x3a9e('0x4')},'serverUrl':{'type':Sequelize[_0x3a9e('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 7070486..b879ad8 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 _0xd773=['params','keys','includeAll','merge','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','subcategory','notify','incident_state','severity','category','parent','made_sla','caused_by','sys_updated_on','child_incidents','hold_reason','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','delivery_task','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','serverUrl','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd773,0x79));var _0x3d77=function(_0x13c204,_0x509d52){_0x13c204=_0x13c204-0x0;var _0x23080f=_0xd773[_0x13c204];return _0x23080f;};'use strict';var emlformat=require(_0x3d77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d77('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d77('0x2'));var Mustache=require('mustache');var util=require(_0x3d77('0x3'));var path=require(_0x3d77('0x4'));var sox=require(_0x3d77('0x5'));var csv=require(_0x3d77('0x6'));var ejs=require(_0x3d77('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d77('0x8'));var squel=require(_0x3d77('0x9'));var crypto=require(_0x3d77('0xa'));var jsforce=require(_0x3d77('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3d77('0x6'));var querystring=require(_0x3d77('0xc'));var Papa=require(_0x3d77('0xd'));var Redis=require(_0x3d77('0xe'));var authService=require(_0x3d77('0xf'));var qs=require(_0x3d77('0x10'));var as=require(_0x3d77('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d77('0x12'))(_0x3d77('0x13'));var utils=require(_0x3d77('0x14'));var config=require(_0x3d77('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d77('0x16'))['db'];var integrations=require(_0x3d77('0x17'));function respondWithStatusCode(_0x55ac6a,_0x1b2e58){_0x1b2e58=_0x1b2e58||0xcc;return function(_0x1fca4f){if(_0x1fca4f){return _0x55ac6a[_0x3d77('0x18')](_0x1b2e58);}return _0x55ac6a[_0x3d77('0x19')](_0x1b2e58)['end']();};}function respondWithResult(_0x337487,_0x5e3d8e){_0x5e3d8e=_0x5e3d8e||0xc8;return function(_0x4475f7){if(_0x4475f7){return _0x337487[_0x3d77('0x19')](_0x5e3d8e)[_0x3d77('0x1a')](_0x4475f7);}};}function respondWithFilteredResult(_0x32ccd4,_0x2b7b32){return function(_0x52653b){if(_0x52653b){var _0x469ac6=typeof _0x2b7b32[_0x3d77('0x1b')]===_0x3d77('0x1c')&&typeof _0x2b7b32['limit']==='undefined';var _0xcb5789=_0x52653b[_0x3d77('0x1d')];var _0x5ad7c3=_0x469ac6?0x0:_0x2b7b32[_0x3d77('0x1b')];var _0x1cf3c5=_0x469ac6?_0x52653b[_0x3d77('0x1d')]:_0x2b7b32[_0x3d77('0x1b')]+_0x2b7b32[_0x3d77('0x1e')];var _0x478492;if(_0x1cf3c5>=_0xcb5789){_0x1cf3c5=_0xcb5789;_0x478492=0xc8;}else{_0x478492=0xce;}_0x32ccd4[_0x3d77('0x19')](_0x478492);return _0x32ccd4[_0x3d77('0x1f')](_0x3d77('0x20'),_0x5ad7c3+'-'+_0x1cf3c5+'/'+_0xcb5789)[_0x3d77('0x1a')](_0x52653b);}return null;};}function patchUpdates(_0xb60eaf){return function(_0x21423b){try{jsonpatch[_0x3d77('0x21')](_0x21423b,_0xb60eaf,!![]);}catch(_0x5ce9c2){return BPromise[_0x3d77('0x22')](_0x5ce9c2);}return _0x21423b[_0x3d77('0x23')]();};}function saveUpdates(_0x1a6a9e,_0x2c133a){return function(_0x373ddf){if(_0x373ddf){return _0x373ddf[_0x3d77('0x24')](_0x1a6a9e)[_0x3d77('0x25')](function(_0x8e2d01){return _0x8e2d01;});}return null;};}function removeEntity(_0x40ae84,_0x2b5af9){return function(_0x2027db){if(_0x2027db){return _0x2027db['destroy']()[_0x3d77('0x25')](function(){_0x40ae84[_0x3d77('0x19')](0xcc)[_0x3d77('0x26')]();});}};}function handleEntityNotFound(_0x92b21c,_0x37112a){return function(_0x555aee){if(!_0x555aee){_0x92b21c[_0x3d77('0x18')](0x194);}return _0x555aee;};}function handleError(_0x135f35,_0x3dc9aa){_0x3dc9aa=_0x3dc9aa||0x1f4;return function(_0x506140){logger[_0x3d77('0x27')](_0x506140[_0x3d77('0x28')]);if(_0x506140[_0x3d77('0x29')]){delete _0x506140[_0x3d77('0x29')];}_0x135f35[_0x3d77('0x19')](_0x3dc9aa)[_0x3d77('0x2a')](_0x506140);};}exports['index']=function(_0x388532,_0x202a8c){var _0x5811cf={},_0x404d19={},_0x2675cc={'count':0x0,'rows':[]};var _0x2760be=_['map'](db[_0x3d77('0x2b')][_0x3d77('0x2c')],function(_0x5822a8){return{'name':_0x5822a8[_0x3d77('0x2d')],'type':_0x5822a8[_0x3d77('0x2e')][_0x3d77('0x2f')]};});_0x404d19[_0x3d77('0x30')]=_[_0x3d77('0x31')](_0x2760be,_0x3d77('0x29'));_0x404d19['query']=_['keys'](_0x388532[_0x3d77('0x32')]);_0x404d19[_0x3d77('0x33')]=_['intersection'](_0x404d19[_0x3d77('0x30')],_0x404d19['query']);_0x5811cf[_0x3d77('0x34')]=_[_0x3d77('0x35')](_0x404d19[_0x3d77('0x30')],qs['fields'](_0x388532[_0x3d77('0x32')][_0x3d77('0x36')]));_0x5811cf[_0x3d77('0x34')]=_0x5811cf[_0x3d77('0x34')][_0x3d77('0x37')]?_0x5811cf[_0x3d77('0x34')]:_0x404d19[_0x3d77('0x30')];if(!_0x388532[_0x3d77('0x32')][_0x3d77('0x38')]('nolimit')){_0x5811cf[_0x3d77('0x1e')]=qs['limit'](_0x388532[_0x3d77('0x32')][_0x3d77('0x1e')]);_0x5811cf[_0x3d77('0x1b')]=qs['offset'](_0x388532[_0x3d77('0x32')]['offset']);}_0x5811cf[_0x3d77('0x39')]=qs[_0x3d77('0x3a')](_0x388532[_0x3d77('0x32')][_0x3d77('0x3a')]);_0x5811cf[_0x3d77('0x3b')]=qs[_0x3d77('0x33')](_[_0x3d77('0x3c')](_0x388532[_0x3d77('0x32')],_0x404d19[_0x3d77('0x33')]),_0x2760be);if(_0x388532[_0x3d77('0x32')][_0x3d77('0x3d')]){_0x5811cf[_0x3d77('0x3b')]=_['merge'](_0x5811cf['where'],{'$or':_[_0x3d77('0x31')](_0x2760be,function(_0x53b2c3){if(_0x53b2c3[_0x3d77('0x2e')]!==_0x3d77('0x3e')){var _0x4738d7={};_0x4738d7[_0x53b2c3[_0x3d77('0x29')]]={'$like':'%'+_0x388532[_0x3d77('0x32')][_0x3d77('0x3d')]+'%'};return _0x4738d7;}})});}_0x5811cf=_['merge']({},_0x5811cf,_0x388532[_0x3d77('0x3f')]);var _0x4282f3={'where':_0x5811cf['where']};return db[_0x3d77('0x2b')]['count'](_0x4282f3)[_0x3d77('0x25')](function(_0x3fa44f){_0x2675cc[_0x3d77('0x1d')]=_0x3fa44f;if(_0x388532['query']['includeAll']){_0x5811cf[_0x3d77('0x40')]=[{'all':!![]}];}return db[_0x3d77('0x2b')][_0x3d77('0x41')](_0x5811cf);})[_0x3d77('0x25')](function(_0x83b1d5){_0x2675cc[_0x3d77('0x42')]=_0x83b1d5;return _0x2675cc;})[_0x3d77('0x25')](respondWithFilteredResult(_0x202a8c,_0x5811cf))[_0x3d77('0x43')](handleError(_0x202a8c,null));};exports[_0x3d77('0x44')]=function(_0x394181,_0x3d5be4){var _0x2fcd69={'raw':![],'where':{'id':_0x394181[_0x3d77('0x45')]['id']}},_0x2bda5e={};_0x2bda5e[_0x3d77('0x30')]=_['keys'](db[_0x3d77('0x2b')][_0x3d77('0x2c')]);_0x2bda5e[_0x3d77('0x32')]=_[_0x3d77('0x46')](_0x394181['query']);_0x2bda5e[_0x3d77('0x33')]=_[_0x3d77('0x35')](_0x2bda5e['model'],_0x2bda5e[_0x3d77('0x32')]);_0x2fcd69[_0x3d77('0x34')]=_[_0x3d77('0x35')](_0x2bda5e[_0x3d77('0x30')],qs[_0x3d77('0x36')](_0x394181[_0x3d77('0x32')][_0x3d77('0x36')]));_0x2fcd69[_0x3d77('0x34')]=_0x2fcd69[_0x3d77('0x34')][_0x3d77('0x37')]?_0x2fcd69['attributes']:_0x2bda5e['model'];if(_0x394181['query'][_0x3d77('0x47')]){_0x2fcd69[_0x3d77('0x40')]=[{'all':!![]}];}_0x2fcd69=_[_0x3d77('0x48')]({},_0x2fcd69,_0x394181[_0x3d77('0x3f')]);return db[_0x3d77('0x2b')][_0x3d77('0x49')](_0x2fcd69)[_0x3d77('0x25')](handleEntityNotFound(_0x3d5be4,null))['then'](respondWithResult(_0x3d5be4,null))['catch'](handleError(_0x3d5be4,null));};exports['create']=function(_0x49047c,_0xb9a57c){return db['ServicenowAccount'][_0x3d77('0x4a')](_0x49047c[_0x3d77('0x4b')],{})[_0x3d77('0x25')](respondWithResult(_0xb9a57c,0xc9))[_0x3d77('0x43')](handleError(_0xb9a57c,null));};exports[_0x3d77('0x24')]=function(_0x451b4b,_0x5be5ad){if(_0x451b4b[_0x3d77('0x4b')]['id']){delete _0x451b4b['body']['id'];}return db['ServicenowAccount'][_0x3d77('0x49')]({'where':{'id':_0x451b4b['params']['id']}})[_0x3d77('0x25')](handleEntityNotFound(_0x5be5ad,null))[_0x3d77('0x25')](saveUpdates(_0x451b4b[_0x3d77('0x4b')],null))[_0x3d77('0x25')](respondWithResult(_0x5be5ad,null))['catch'](handleError(_0x5be5ad,null));};exports['destroy']=function(_0x25c77b,_0x40247c){return db[_0x3d77('0x2b')]['find']({'where':{'id':_0x25c77b[_0x3d77('0x45')]['id']}})['then'](handleEntityNotFound(_0x40247c,null))[_0x3d77('0x25')](removeEntity(_0x40247c,null))[_0x3d77('0x43')](handleError(_0x40247c,null));};exports['getConfigurations']=function(_0x5654b8,_0x4ce314,_0x4ddbe9){var _0x4157a2={};var _0x1dc095={};var _0x49fdc5;var _0x1d6a86;return db['ServicenowAccount']['findOne']({'where':{'id':_0x5654b8['params']['id']}})[_0x3d77('0x25')](handleEntityNotFound(_0x4ce314,null))[_0x3d77('0x25')](function(_0x3cfa3f){if(_0x3cfa3f){_0x49fdc5=_0x3cfa3f;_0x1dc095[_0x3d77('0x30')]=_[_0x3d77('0x46')](db['ServicenowConfiguration'][_0x3d77('0x2c')]);_0x1dc095[_0x3d77('0x32')]=_[_0x3d77('0x46')](_0x5654b8['query']);_0x1dc095[_0x3d77('0x33')]=_[_0x3d77('0x35')](_0x1dc095[_0x3d77('0x30')],_0x1dc095['query']);_0x4157a2[_0x3d77('0x34')]=_[_0x3d77('0x35')](_0x1dc095[_0x3d77('0x30')],qs[_0x3d77('0x36')](_0x5654b8[_0x3d77('0x32')]['fields']));_0x4157a2[_0x3d77('0x34')]=_0x4157a2[_0x3d77('0x34')][_0x3d77('0x37')]?_0x4157a2['attributes']:_0x1dc095[_0x3d77('0x30')];_0x4157a2[_0x3d77('0x39')]=qs[_0x3d77('0x3a')](_0x5654b8['query'][_0x3d77('0x3a')]);_0x4157a2['where']=qs[_0x3d77('0x33')](_['pick'](_0x5654b8[_0x3d77('0x32')],_0x1dc095[_0x3d77('0x33')]));if(_0x5654b8[_0x3d77('0x32')]['filter']){_0x4157a2[_0x3d77('0x3b')]=_[_0x3d77('0x48')](_0x4157a2['where'],{'$or':_[_0x3d77('0x31')](_0x4157a2[_0x3d77('0x34')],function(_0x33975e){var _0x319d57={};_0x319d57[_0x33975e]={'$like':'%'+_0x5654b8[_0x3d77('0x32')][_0x3d77('0x3d')]+'%'};return _0x319d57;})});}_0x4157a2=_[_0x3d77('0x48')]({},_0x4157a2,_0x5654b8['options']);return _0x49fdc5[_0x3d77('0x4c')](_0x4157a2);}})['then'](function(_0x5c6083){if(_0x5c6083){_0x1d6a86=_0x5c6083[_0x3d77('0x37')];if(!_0x5654b8['query'][_0x3d77('0x38')]('nolimit')){_0x4157a2['limit']=qs[_0x3d77('0x1e')](_0x5654b8[_0x3d77('0x32')][_0x3d77('0x1e')]);_0x4157a2[_0x3d77('0x1b')]=qs['offset'](_0x5654b8['query'][_0x3d77('0x1b')]);}return _0x49fdc5[_0x3d77('0x4c')](_0x4157a2);}})[_0x3d77('0x25')](function(_0x22b577){if(_0x22b577){return _0x22b577?{'count':_0x1d6a86,'rows':_0x22b577}:null;}})[_0x3d77('0x25')](respondWithResult(_0x4ce314,null))[_0x3d77('0x43')](handleError(_0x4ce314,null));};exports[_0x3d77('0x4d')]=function(_0x97592d,_0x4582e9,_0x491af4){if(_0x97592d[_0x3d77('0x4b')]['id']){delete _0x97592d[_0x3d77('0x4b')]['id'];}return db[_0x3d77('0x2b')][_0x3d77('0x4e')]({'where':{'id':_0x97592d[_0x3d77('0x45')]['id']}})[_0x3d77('0x25')](handleEntityNotFound(_0x4582e9,null))[_0x3d77('0x25')](function(_0x464012){if(_0x464012){_0x97592d[_0x3d77('0x4b')][_0x3d77('0x4f')]=_0x464012['id'];_0x97592d[_0x3d77('0x4b')][_0x3d77('0x50')]=integrations['getSubjects'](_0x97592d[_0x3d77('0x4b')][_0x3d77('0x51')],_0x97592d[_0x3d77('0x4b')][_0x3d77('0x2e')]);_0x97592d['body'][_0x3d77('0x52')]=integrations[_0x3d77('0x53')](_0x97592d[_0x3d77('0x4b')][_0x3d77('0x51')],_0x97592d[_0x3d77('0x4b')][_0x3d77('0x2e')]);return db[_0x3d77('0x54')][_0x3d77('0x4a')](_0x97592d[_0x3d77('0x4b')],{'include':[{'model':db[_0x3d77('0x55')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x3d77('0x52')}]});}return null;})[_0x3d77('0x25')](respondWithResult(_0x4582e9,null))[_0x3d77('0x43')](handleError(_0x4582e9,null));};exports[_0x3d77('0x56')]=function(_0x166f79,_0x43a55c,_0x1db1c2){var _0x48f258=['made_sla','hold_reason','knowledge',_0x3d77('0x57'),'close_code',_0x3d77('0x58'),_0x3d77('0x59'),_0x3d77('0x5a'),_0x3d77('0x5b')];var _0x1ffef1=[_0x3d77('0x5c'),_0x3d77('0x5d'),_0x3d77('0x5e'),'watch_list','upon_reject',_0x3d77('0x5f'),_0x3d77('0x60'),_0x3d77('0x61'),_0x3d77('0x62'),_0x3d77('0x63'),'resolved_by',_0x3d77('0x64'),_0x3d77('0x65'),_0x3d77('0x66'),_0x3d77('0x67'),'sys_domain','state',_0x3d77('0x68'),_0x3d77('0x69'),_0x3d77('0x39'),_0x3d77('0x6a'),_0x3d77('0x6b'),_0x3d77('0x6c'),_0x3d77('0x6d'),_0x3d77('0x6e'),_0x3d77('0x6f'),_0x3d77('0x70'),_0x3d77('0x71'),_0x3d77('0x72'),_0x3d77('0x73'),_0x3d77('0x74'),'time_worked',_0x3d77('0x75'),_0x3d77('0x76'),_0x3d77('0x77'),_0x3d77('0x78'),_0x3d77('0x79'),_0x3d77('0x7a'),_0x3d77('0x7b'),_0x3d77('0x7c'),_0x3d77('0x7d'),'subcategory',_0x3d77('0x7e'),_0x3d77('0x7f'),_0x3d77('0x80'),'correlation_display',_0x3d77('0x81'),'work_start',_0x3d77('0x82'),_0x3d77('0x83'),_0x3d77('0x84'),_0x3d77('0x85'),'calendar_duration','notify',_0x3d77('0x86'),_0x3d77('0x87'),_0x3d77('0x88'),_0x3d77('0x89'),_0x3d77('0x8a'),_0x3d77('0x8b'),_0x3d77('0x8c'),_0x3d77('0x8d'),_0x3d77('0x59'),_0x3d77('0x8e'),_0x3d77('0x8f'),'company',_0x3d77('0x90'),_0x3d77('0x91'),_0x3d77('0x92'),_0x3d77('0x5a'),'comments',_0x3d77('0x93'),_0x3d77('0x94'),_0x3d77('0x95'),'due_date',_0x3d77('0x96'),_0x3d77('0x97'),_0x3d77('0x98'),_0x3d77('0x99'),_0x3d77('0x9a'),_0x3d77('0x9b'),_0x3d77('0x9c'),_0x3d77('0x5b')];var _0xaeaf35='';var _0x312d3e='';var _0x5b96b7=[];var _0x42cc7f='';var _0x56b295='';var _0x5336d4=[];var _0x60a9b4='';var _0x510f7b='';var _0x578e8c={};var _0x3f7970='';return db[_0x3d77('0x2b')][_0x3d77('0x4e')]({'where':{'id':_0x166f79['params']['id']},'attributes':['id',_0x3d77('0x9d'),_0x3d77('0x9e'),_0x3d77('0x9f'),'remoteUri',_0x3d77('0xa0')]})[_0x3d77('0x25')](handleEntityNotFound(_0x43a55c,null))[_0x3d77('0x25')](function(_0x578ecc){if(_0x578ecc){_0x3f7970=_0x578ecc[_0x3d77('0xa1')];var _0x4cbb22=_0x3f7970[_0x3d77('0xa2')](-0x1);if(_0x4cbb22==='/'){_0x3f7970=_0x3f7970[_0x3d77('0xa3')](0x0,_0x3f7970['lastIndexOf'](_0x4cbb22));}_0x510f7b=util[_0x3d77('0xa4')](_0x3d77('0xa5'),_0x3f7970);_0x60a9b4=util[_0x3d77('0xa4')](_0x3d77('0xa6'),_0x3f7970);_0x578e8c={'user':_0x578ecc['username'],'pass':_0x578ecc[_0x3d77('0x9e')]};var _0x510acb={'method':_0x3d77('0xa7'),'uri':_0x510f7b+'incident?sysparm_display_value=all','auth':_0x578e8c,'json':!![]};return rp(_0x510acb);}})[_0x3d77('0x25')](function(_0x5747fd){if(_0x5747fd['result'][_0x3d77('0x37')]>0x0){_0xaeaf35=_0x5747fd[_0x3d77('0xa8')];}console[_0x3d77('0xa9')](_0x3d77('0xaa'),_0xaeaf35);_0x5336d4=[];_0x312d3e=Object[_0x3d77('0xab')]([],_0xaeaf35);_[_0x3d77('0xac')](_0x312d3e,function(_0x3f46af){return!_0x48f258[_0x3d77('0xad')](_0x3f46af[_0x3d77('0x29')]);});_0x312d3e[_0x3d77('0xae')](function(_0x31bdc9){var _0x3707de=createFieldObject(_0x60a9b4,_0x578e8c,_0x31bdc9[_0x3d77('0xaf')],_0x31bdc9[_0x3d77('0x29')],_0x31bdc9[_0x3d77('0xb0')],![]);_0x5336d4[_0x3d77('0xb1')](_0x3707de);});return Promise[_0x3d77('0xb2')](_0x5336d4);})[_0x3d77('0x25')](function(_0x118e65){_0x5b96b7=_0x118e65;_0x42cc7f=Object[_0x3d77('0xab')]([],_0xaeaf35);console[_0x3d77('0xa9')]('TCL:\x20_object',_0xaeaf35);_[_0x3d77('0xac')](_0x42cc7f,function(_0x472e01){return _0x1ffef1['includes'](_0x472e01['name']);});console[_0x3d77('0xa9')](_0x3d77('0xb3'),_0x42cc7f);_0x5336d4=[];_0x42cc7f['forEach'](function(_0x445fe){var _0x3776dc=createFieldObject(_0x60a9b4,_0x578e8c,_0x445fe[_0x3d77('0xaf')],_0x445fe[_0x3d77('0x29')],_0x445fe['label'],!![]);_0x5336d4[_0x3d77('0xb1')](_0x3776dc);});return Promise['all'](_0x5336d4);})[_0x3d77('0x25')](function(_0x551675){_0x56b295=_0x551675;var _0x36e22e=_0x5b96b7[_0x3d77('0xb4')](_0x56b295);return{'count':_0x36e22e[_0x3d77('0x37')],'rows':_0x36e22e};})[_0x3d77('0x25')](respondWithResult(_0x43a55c,null))['catch'](function(_0xe6e738){console[_0x3d77('0xa9')](_0x3d77('0xb5')+_0xe6e738);var _0x30ddd2=_0x166f79['query'][_0x3d77('0xb6')]?0x1f4:_0xe6e738['statusCode']||0x1f4;logger['error'](_0xe6e738[_0x3d77('0x28')]);delete _0xe6e738[_0x3d77('0x29')];if(_0x30ddd2===0x191){_0x30ddd2=0x190;}_0x43a55c[_0x3d77('0x19')](_0x30ddd2)[_0x3d77('0x2a')](_0x166f79[_0x3d77('0x32')][_0x3d77('0xb6')]?{'message':'Wrong\x20credentials','statusCode':_0xe6e738['statusCode']}:_0xe6e738);});};function createFieldObject(_0x57df77,_0x29ed63,_0xb8665,_0x144cca,_0x6af9e0,_0x212103){return new Promise(function(_0x24e898,_0x9c5ba4){var _0x3017f3={'id':_0x144cca,'name':_0x6af9e0,'custom':_0x212103};if(_0xb8665===_0x3d77('0xb7')){_0x3017f3[_0x3d77('0x3f')]=[{'name':_0x3d77('0xb8'),'value':_0x3d77('0xb9')},{'name':_0x3d77('0xba'),'value':_0x3d77('0xbb')}];_0x24e898(_0x3017f3);}else{var _0x472d6d={'method':_0x3d77('0xa7'),'uri':_0x57df77+_0x3d77('0xbc')+_0x144cca,'auth':_0x29ed63,'json':!![]};return rp(_0x472d6d)[_0x3d77('0x25')](function(_0x8f2eb1){var _0x5b95fb=[];if(_0x8f2eb1[_0x3d77('0xa8')][_0x3d77('0x37')]>0x0){_0x8f2eb1[_0x3d77('0xa8')][_0x3d77('0xae')](function(_0xf336b7){if(_0xf336b7[_0x3d77('0xbd')]===_0x3d77('0xbb')){var _0x21ebda={'name':_0xf336b7['label'],'value':_0xf336b7['value']};_0x5b95fb[_0x3d77('0xb1')](_0x21ebda);}});}_0x3017f3[_0x3d77('0x3f')]=_0x5b95fb;if(_0x3017f3['options'][_0x3d77('0x37')]>0x0){_0x24e898(_0x3017f3);}else{if(_0x212103==![]){_0x24e898();}else{_0x24e898(_0x3017f3);}}});}});} \ No newline at end of file +var _0x91b6=['filter','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','correlation_id','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','concat','ServiceNow\x20error:\x20','test','stack','Wrong\x20credentials','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','error','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','findOne','ServicenowConfiguration'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x91b6,0x130));var _0x691b=function(_0xf89dab,_0x3aed37){_0xf89dab=_0xf89dab-0x0;var _0x548c35=_0x91b6[_0xf89dab];return _0x548c35;};'use strict';var emlformat=require(_0x691b('0x0'));var rimraf=require(_0x691b('0x1'));var zipdir=require(_0x691b('0x2'));var jsonpatch=require(_0x691b('0x3'));var rp=require(_0x691b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x691b('0x5'));var util=require(_0x691b('0x6'));var path=require(_0x691b('0x7'));var sox=require(_0x691b('0x8'));var csv=require(_0x691b('0x9'));var ejs=require(_0x691b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x691b('0xb'));var crypto=require(_0x691b('0xc'));var jsforce=require(_0x691b('0xd'));var deskjs=require(_0x691b('0xe'));var toCsv=require(_0x691b('0x9'));var querystring=require(_0x691b('0xf'));var Papa=require(_0x691b('0x10'));var Redis=require(_0x691b('0x11'));var authService=require(_0x691b('0x12'));var qs=require(_0x691b('0x13'));var as=require(_0x691b('0x14'));var hardwareService=require(_0x691b('0x15'));var logger=require(_0x691b('0x16'))(_0x691b('0x17'));var utils=require(_0x691b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x691b('0x19'));var db=require(_0x691b('0x1a'))['db'];var integrations=require(_0x691b('0x1b'));function respondWithStatusCode(_0x1d766e,_0x122e3f){_0x122e3f=_0x122e3f||0xcc;return function(_0x1a912c){if(_0x1a912c){return _0x1d766e[_0x691b('0x1c')](_0x122e3f);}return _0x1d766e[_0x691b('0x1d')](_0x122e3f)[_0x691b('0x1e')]();};}function respondWithResult(_0xbe1117,_0x12d7c7){_0x12d7c7=_0x12d7c7||0xc8;return function(_0x3b48b8){if(_0x3b48b8){return _0xbe1117[_0x691b('0x1d')](_0x12d7c7)['json'](_0x3b48b8);}};}function respondWithFilteredResult(_0x49e0c5,_0x3ee738){return function(_0x214652){if(_0x214652){var _0x58495c=typeof _0x3ee738[_0x691b('0x1f')]===_0x691b('0x20')&&typeof _0x3ee738['limit']==='undefined';var _0x53f940=_0x214652['count'];var _0x507d9d=_0x58495c?0x0:_0x3ee738[_0x691b('0x1f')];var _0x17778f=_0x58495c?_0x214652[_0x691b('0x21')]:_0x3ee738[_0x691b('0x1f')]+_0x3ee738[_0x691b('0x22')];var _0x12709d;if(_0x17778f>=_0x53f940){_0x17778f=_0x53f940;_0x12709d=0xc8;}else{_0x12709d=0xce;}_0x49e0c5['status'](_0x12709d);return _0x49e0c5[_0x691b('0x23')](_0x691b('0x24'),_0x507d9d+'-'+_0x17778f+'/'+_0x53f940)[_0x691b('0x25')](_0x214652);}return null;};}function patchUpdates(_0x5de500){return function(_0x3ec3b5){try{jsonpatch['apply'](_0x3ec3b5,_0x5de500,!![]);}catch(_0x1eb272){return BPromise['reject'](_0x1eb272);}return _0x3ec3b5['save']();};}function saveUpdates(_0x369fd1,_0x1bb741){return function(_0x5ca5ac){if(_0x5ca5ac){return _0x5ca5ac[_0x691b('0x26')](_0x369fd1)[_0x691b('0x27')](function(_0x258bb1){return _0x258bb1;});}return null;};}function removeEntity(_0xa0e35a,_0x4107d6){return function(_0x3103d8){if(_0x3103d8){return _0x3103d8[_0x691b('0x28')]()[_0x691b('0x27')](function(){_0xa0e35a[_0x691b('0x1d')](0xcc)[_0x691b('0x1e')]();});}};}function handleEntityNotFound(_0x2d782f,_0x4183d2){return function(_0x578cda){if(!_0x578cda){_0x2d782f['sendStatus'](0x194);}return _0x578cda;};}function handleError(_0x28210f,_0x5018cc){_0x5018cc=_0x5018cc||0x1f4;return function(_0x1ef755){logger[_0x691b('0x29')](_0x1ef755['stack']);if(_0x1ef755[_0x691b('0x2a')]){delete _0x1ef755[_0x691b('0x2a')];}_0x28210f[_0x691b('0x1d')](_0x5018cc)[_0x691b('0x2b')](_0x1ef755);};}exports[_0x691b('0x2c')]=function(_0x40369b,_0x2ff5f1){var _0x4cb177={},_0xe7d9f8={},_0x551313={'count':0x0,'rows':[]};var _0xe7b98a=_[_0x691b('0x2d')](db[_0x691b('0x2e')][_0x691b('0x2f')],function(_0x523ff7){return{'name':_0x523ff7[_0x691b('0x30')],'type':_0x523ff7['type'][_0x691b('0x31')]};});_0xe7d9f8['model']=_[_0x691b('0x2d')](_0xe7b98a,_0x691b('0x2a'));_0xe7d9f8['query']=_['keys'](_0x40369b['query']);_0xe7d9f8['filters']=_['intersection'](_0xe7d9f8['model'],_0xe7d9f8[_0x691b('0x32')]);_0x4cb177[_0x691b('0x33')]=_[_0x691b('0x34')](_0xe7d9f8[_0x691b('0x35')],qs['fields'](_0x40369b['query'][_0x691b('0x36')]));_0x4cb177[_0x691b('0x33')]=_0x4cb177[_0x691b('0x33')][_0x691b('0x37')]?_0x4cb177[_0x691b('0x33')]:_0xe7d9f8['model'];if(!_0x40369b[_0x691b('0x32')][_0x691b('0x38')](_0x691b('0x39'))){_0x4cb177['limit']=qs[_0x691b('0x22')](_0x40369b[_0x691b('0x32')][_0x691b('0x22')]);_0x4cb177[_0x691b('0x1f')]=qs[_0x691b('0x1f')](_0x40369b[_0x691b('0x32')][_0x691b('0x1f')]);}_0x4cb177[_0x691b('0x3a')]=qs[_0x691b('0x3b')](_0x40369b[_0x691b('0x32')]['sort']);_0x4cb177[_0x691b('0x3c')]=qs[_0x691b('0x3d')](_[_0x691b('0x3e')](_0x40369b[_0x691b('0x32')],_0xe7d9f8[_0x691b('0x3d')]),_0xe7b98a);if(_0x40369b[_0x691b('0x32')]['filter']){_0x4cb177[_0x691b('0x3c')]=_[_0x691b('0x3f')](_0x4cb177[_0x691b('0x3c')],{'$or':_['map'](_0xe7b98a,function(_0x211442){if(_0x211442['type']!==_0x691b('0x40')){var _0xe4bde3={};_0xe4bde3[_0x211442[_0x691b('0x2a')]]={'$like':'%'+_0x40369b['query']['filter']+'%'};return _0xe4bde3;}})});}_0x4cb177=_[_0x691b('0x3f')]({},_0x4cb177,_0x40369b[_0x691b('0x41')]);var _0x2853da={'where':_0x4cb177['where']};return db['ServicenowAccount']['count'](_0x2853da)['then'](function(_0x46e767){_0x551313[_0x691b('0x21')]=_0x46e767;if(_0x40369b[_0x691b('0x32')][_0x691b('0x42')]){_0x4cb177['include']=[{'all':!![]}];}return db[_0x691b('0x2e')][_0x691b('0x43')](_0x4cb177);})[_0x691b('0x27')](function(_0xd0075f){_0x551313[_0x691b('0x44')]=_0xd0075f;return _0x551313;})[_0x691b('0x27')](respondWithFilteredResult(_0x2ff5f1,_0x4cb177))[_0x691b('0x45')](handleError(_0x2ff5f1,null));};exports[_0x691b('0x46')]=function(_0x5f5408,_0x44cbd2){var _0x101ec2={'raw':![],'where':{'id':_0x5f5408[_0x691b('0x47')]['id']}},_0xdc3ba={};_0xdc3ba['model']=_[_0x691b('0x48')](db[_0x691b('0x2e')][_0x691b('0x2f')]);_0xdc3ba[_0x691b('0x32')]=_['keys'](_0x5f5408[_0x691b('0x32')]);_0xdc3ba[_0x691b('0x3d')]=_[_0x691b('0x34')](_0xdc3ba[_0x691b('0x35')],_0xdc3ba['query']);_0x101ec2[_0x691b('0x33')]=_['intersection'](_0xdc3ba[_0x691b('0x35')],qs[_0x691b('0x36')](_0x5f5408['query']['fields']));_0x101ec2['attributes']=_0x101ec2['attributes']['length']?_0x101ec2['attributes']:_0xdc3ba[_0x691b('0x35')];if(_0x5f5408[_0x691b('0x32')][_0x691b('0x42')]){_0x101ec2['include']=[{'all':!![]}];}_0x101ec2=_[_0x691b('0x3f')]({},_0x101ec2,_0x5f5408[_0x691b('0x41')]);return db[_0x691b('0x2e')][_0x691b('0x49')](_0x101ec2)[_0x691b('0x27')](handleEntityNotFound(_0x44cbd2,null))[_0x691b('0x27')](respondWithResult(_0x44cbd2,null))[_0x691b('0x45')](handleError(_0x44cbd2,null));};exports[_0x691b('0x4a')]=function(_0x332f74,_0x4f3831){return db[_0x691b('0x2e')][_0x691b('0x4a')](_0x332f74[_0x691b('0x4b')],{})[_0x691b('0x27')](respondWithResult(_0x4f3831,0xc9))[_0x691b('0x45')](handleError(_0x4f3831,null));};exports[_0x691b('0x26')]=function(_0x16ecf,_0x5a01f7){if(_0x16ecf[_0x691b('0x4b')]['id']){delete _0x16ecf[_0x691b('0x4b')]['id'];}return db[_0x691b('0x2e')][_0x691b('0x49')]({'where':{'id':_0x16ecf['params']['id']}})[_0x691b('0x27')](handleEntityNotFound(_0x5a01f7,null))[_0x691b('0x27')](saveUpdates(_0x16ecf['body'],null))[_0x691b('0x27')](respondWithResult(_0x5a01f7,null))[_0x691b('0x45')](handleError(_0x5a01f7,null));};exports[_0x691b('0x28')]=function(_0x3d0f37,_0x1df423){return db[_0x691b('0x2e')][_0x691b('0x49')]({'where':{'id':_0x3d0f37[_0x691b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1df423,null))[_0x691b('0x27')](removeEntity(_0x1df423,null))[_0x691b('0x45')](handleError(_0x1df423,null));};exports['getConfigurations']=function(_0x21ba6a,_0x54db37,_0x37da0a){var _0x12eab5={};var _0x57ed01={};var _0x1b3c21;var _0x5e1b78;return db[_0x691b('0x2e')][_0x691b('0x4c')]({'where':{'id':_0x21ba6a[_0x691b('0x47')]['id']}})['then'](handleEntityNotFound(_0x54db37,null))['then'](function(_0x50785f){if(_0x50785f){_0x1b3c21=_0x50785f;_0x57ed01['model']=_[_0x691b('0x48')](db[_0x691b('0x4d')][_0x691b('0x2f')]);_0x57ed01[_0x691b('0x32')]=_['keys'](_0x21ba6a[_0x691b('0x32')]);_0x57ed01[_0x691b('0x3d')]=_[_0x691b('0x34')](_0x57ed01['model'],_0x57ed01['query']);_0x12eab5[_0x691b('0x33')]=_[_0x691b('0x34')](_0x57ed01[_0x691b('0x35')],qs[_0x691b('0x36')](_0x21ba6a[_0x691b('0x32')][_0x691b('0x36')]));_0x12eab5[_0x691b('0x33')]=_0x12eab5[_0x691b('0x33')][_0x691b('0x37')]?_0x12eab5[_0x691b('0x33')]:_0x57ed01['model'];_0x12eab5[_0x691b('0x3a')]=qs[_0x691b('0x3b')](_0x21ba6a['query']['sort']);_0x12eab5['where']=qs['filters'](_['pick'](_0x21ba6a['query'],_0x57ed01[_0x691b('0x3d')]));if(_0x21ba6a[_0x691b('0x32')][_0x691b('0x4e')]){_0x12eab5[_0x691b('0x3c')]=_[_0x691b('0x3f')](_0x12eab5[_0x691b('0x3c')],{'$or':_[_0x691b('0x2d')](_0x12eab5[_0x691b('0x33')],function(_0x54f10b){var _0x2940a8={};_0x2940a8[_0x54f10b]={'$like':'%'+_0x21ba6a[_0x691b('0x32')][_0x691b('0x4e')]+'%'};return _0x2940a8;})});}_0x12eab5=_[_0x691b('0x3f')]({},_0x12eab5,_0x21ba6a[_0x691b('0x41')]);return _0x1b3c21[_0x691b('0x4f')](_0x12eab5);}})[_0x691b('0x27')](function(_0x523176){if(_0x523176){_0x5e1b78=_0x523176[_0x691b('0x37')];if(!_0x21ba6a['query']['hasOwnProperty'](_0x691b('0x39'))){_0x12eab5[_0x691b('0x22')]=qs['limit'](_0x21ba6a[_0x691b('0x32')][_0x691b('0x22')]);_0x12eab5[_0x691b('0x1f')]=qs[_0x691b('0x1f')](_0x21ba6a[_0x691b('0x32')][_0x691b('0x1f')]);}return _0x1b3c21[_0x691b('0x4f')](_0x12eab5);}})[_0x691b('0x27')](function(_0x2d28f8){if(_0x2d28f8){return _0x2d28f8?{'count':_0x5e1b78,'rows':_0x2d28f8}:null;}})[_0x691b('0x27')](respondWithResult(_0x54db37,null))[_0x691b('0x45')](handleError(_0x54db37,null));};exports[_0x691b('0x50')]=function(_0x1ad1b4,_0x28de99,_0x4e14dd){if(_0x1ad1b4[_0x691b('0x4b')]['id']){delete _0x1ad1b4[_0x691b('0x4b')]['id'];}return db[_0x691b('0x2e')][_0x691b('0x4c')]({'where':{'id':_0x1ad1b4['params']['id']}})[_0x691b('0x27')](handleEntityNotFound(_0x28de99,null))[_0x691b('0x27')](function(_0x4d9620){if(_0x4d9620){_0x1ad1b4['body'][_0x691b('0x51')]=_0x4d9620['id'];_0x1ad1b4[_0x691b('0x4b')][_0x691b('0x52')]=integrations[_0x691b('0x53')](_0x1ad1b4['body'][_0x691b('0x54')],_0x1ad1b4[_0x691b('0x4b')][_0x691b('0x55')]);_0x1ad1b4[_0x691b('0x4b')][_0x691b('0x56')]=integrations[_0x691b('0x57')](_0x1ad1b4['body']['channel'],_0x1ad1b4[_0x691b('0x4b')][_0x691b('0x55')]);return db[_0x691b('0x4d')][_0x691b('0x4a')](_0x1ad1b4[_0x691b('0x4b')],{'include':[{'model':db[_0x691b('0x58')],'as':_0x691b('0x52')},{'model':db[_0x691b('0x58')],'as':_0x691b('0x56')}]});}return null;})[_0x691b('0x27')](respondWithResult(_0x28de99,null))[_0x691b('0x45')](handleError(_0x28de99,null));};exports[_0x691b('0x59')]=function(_0x2ad481,_0x21e65a,_0x1889f3){var _0x2049b=[_0x691b('0x5a'),_0x691b('0x5b'),'knowledge',_0x691b('0x5c'),_0x691b('0x5d'),_0x691b('0x5e'),_0x691b('0x5f'),_0x691b('0x60'),_0x691b('0x61')];var _0x537748=[_0x691b('0x62'),_0x691b('0x5a'),'caused_by',_0x691b('0x63'),_0x691b('0x64'),_0x691b('0x65'),_0x691b('0x66'),'hold_reason',_0x691b('0x67'),_0x691b('0x68'),_0x691b('0x69'),_0x691b('0x6a'),_0x691b('0x6b'),'user_input',_0x691b('0x6c'),_0x691b('0x6d'),_0x691b('0x6e'),_0x691b('0x6f'),_0x691b('0x70'),_0x691b('0x3a'),_0x691b('0x71'),_0x691b('0x72'),_0x691b('0x73'),'delivery_plan',_0x691b('0x74'),_0x691b('0x75'),_0x691b('0x76'),_0x691b('0x77'),_0x691b('0x78'),_0x691b('0x79'),_0x691b('0x7a'),_0x691b('0x7b'),_0x691b('0x7c'),_0x691b('0x7d'),_0x691b('0x7e'),_0x691b('0x7f'),_0x691b('0x80'),_0x691b('0x81'),_0x691b('0x82'),_0x691b('0x83'),_0x691b('0x84'),'subcategory',_0x691b('0x85'),_0x691b('0x86'),_0x691b('0x5d'),_0x691b('0x87'),_0x691b('0x88'),'work_start',_0x691b('0x89'),_0x691b('0x8a'),_0x691b('0x8b'),_0x691b('0x8c'),_0x691b('0x8d'),_0x691b('0x5e'),_0x691b('0x8e'),_0x691b('0x8f'),_0x691b('0x90'),'follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency',_0x691b('0x91'),_0x691b('0x92'),_0x691b('0x93'),_0x691b('0x94'),_0x691b('0x95'),_0x691b('0x60'),_0x691b('0x96'),_0x691b('0x97'),'approval',_0x691b('0x98'),_0x691b('0x99'),_0x691b('0x9a'),_0x691b('0x9b'),'sys_tags',_0x691b('0x9c'),'upon_approval',_0x691b('0x9d'),'location',_0x691b('0x61')];var _0x588c45='';var _0x453f6c='';var _0x17e2ee=[];var _0x2bbe89='';var _0x946bac='';var _0x1afbb6=[];var _0x4466d8='';var _0x3a17ae='';var _0x169144={};var _0x2b8086='';return db[_0x691b('0x2e')][_0x691b('0x4c')]({'where':{'id':_0x2ad481[_0x691b('0x47')]['id']},'attributes':['id','username','password',_0x691b('0x9e'),_0x691b('0x9f'),_0x691b('0xa0')]})[_0x691b('0x27')](handleEntityNotFound(_0x21e65a,null))[_0x691b('0x27')](function(_0x58d71e){if(_0x58d71e){_0x2b8086=_0x58d71e[_0x691b('0x9f')];var _0x557db7=_0x2b8086[_0x691b('0xa1')](-0x1);if(_0x557db7==='/'){_0x2b8086=_0x2b8086['substring'](0x0,_0x2b8086[_0x691b('0xa2')](_0x557db7));}_0x3a17ae=util[_0x691b('0xa3')](_0x691b('0xa4'),_0x2b8086);_0x4466d8=util[_0x691b('0xa3')]('%s/api/now/table/',_0x2b8086);_0x169144={'user':_0x58d71e[_0x691b('0xa5')],'pass':_0x58d71e['password']};var _0x5a0d23={'method':_0x691b('0xa6'),'uri':_0x3a17ae+_0x691b('0xa7'),'auth':_0x169144,'json':!![]};return rp(_0x5a0d23);}})[_0x691b('0x27')](function(_0xa59fb8){if(_0xa59fb8['result'][_0x691b('0x37')]>0x0){_0x588c45=_0xa59fb8[_0x691b('0xa8')];}console[_0x691b('0xa9')](_0x691b('0xaa'),_0x588c45);_0x1afbb6=[];_0x453f6c=Object['assign']([],_0x588c45);_[_0x691b('0xab')](_0x453f6c,function(_0x58abe5){return!_0x2049b[_0x691b('0xac')](_0x58abe5[_0x691b('0x2a')]);});_0x453f6c[_0x691b('0xad')](function(_0x5cce21){var _0x253e87=createFieldObject(_0x4466d8,_0x169144,_0x5cce21[_0x691b('0xae')],_0x5cce21[_0x691b('0x2a')],_0x5cce21[_0x691b('0xaf')],![]);_0x1afbb6[_0x691b('0xb0')](_0x253e87);});return Promise['all'](_0x1afbb6);})[_0x691b('0x27')](function(_0x12857f){_0x17e2ee=_0x12857f;_0x2bbe89=Object['assign']([],_0x588c45);console['log']('TCL:\x20_object',_0x588c45);_[_0x691b('0xab')](_0x2bbe89,function(_0x1a671d){return _0x537748['includes'](_0x1a671d[_0x691b('0x2a')]);});console[_0x691b('0xa9')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2bbe89);_0x1afbb6=[];_0x2bbe89[_0x691b('0xad')](function(_0x689573){var _0x567f67=createFieldObject(_0x4466d8,_0x169144,_0x689573[_0x691b('0xae')],_0x689573[_0x691b('0x2a')],_0x689573['label'],!![]);_0x1afbb6[_0x691b('0xb0')](_0x567f67);});return Promise[_0x691b('0xb1')](_0x1afbb6);})[_0x691b('0x27')](function(_0x188c46){_0x946bac=_0x188c46;var _0x46cbf4=_0x17e2ee[_0x691b('0xb2')](_0x946bac);return{'count':_0x46cbf4[_0x691b('0x37')],'rows':_0x46cbf4};})[_0x691b('0x27')](respondWithResult(_0x21e65a,null))[_0x691b('0x45')](function(_0x1e9965){console[_0x691b('0xa9')](_0x691b('0xb3')+_0x1e9965);var _0x2e4852=_0x2ad481[_0x691b('0x32')][_0x691b('0xb4')]?0x1f4:_0x1e9965['statusCode']||0x1f4;logger[_0x691b('0x29')](_0x1e9965[_0x691b('0xb5')]);delete _0x1e9965['name'];if(_0x2e4852===0x191){_0x2e4852=0x190;}_0x21e65a['status'](_0x2e4852)[_0x691b('0x2b')](_0x2ad481[_0x691b('0x32')][_0x691b('0xb4')]?{'message':_0x691b('0xb6'),'statusCode':_0x1e9965[_0x691b('0xb7')]}:_0x1e9965);});};function createFieldObject(_0x578a6c,_0x403a14,_0x4975de,_0x297f2f,_0x3523be,_0x54823b){return new Promise(function(_0x589712,_0x5bf14b){var _0x2c16ba={'id':_0x297f2f,'name':_0x3523be,'custom':_0x54823b};if(_0x4975de===_0x691b('0xb8')){_0x2c16ba[_0x691b('0x41')]=[{'name':_0x691b('0xb9'),'value':_0x691b('0xba')},{'name':_0x691b('0xbb'),'value':_0x691b('0xbc')}];_0x589712(_0x2c16ba);}else{var _0x4f9744={'method':_0x691b('0xa6'),'uri':_0x578a6c+_0x691b('0xbd')+_0x297f2f,'auth':_0x403a14,'json':!![]};return rp(_0x4f9744)[_0x691b('0x27')](function(_0x2b1d92){var _0x169a2d=[];if(_0x2b1d92[_0x691b('0xa8')][_0x691b('0x37')]>0x0){_0x2b1d92[_0x691b('0xa8')][_0x691b('0xad')](function(_0x5a0853){if(_0x5a0853[_0x691b('0xbe')]===_0x691b('0xbc')){var _0x3d5f75={'name':_0x5a0853[_0x691b('0xaf')],'value':_0x5a0853['value']};_0x169a2d[_0x691b('0xb0')](_0x3d5f75);}});}_0x2c16ba[_0x691b('0x41')]=_0x169a2d;if(_0x2c16ba[_0x691b('0x41')][_0x691b('0x37')]>0x0){_0x589712(_0x2c16ba);}else{if(_0x54823b==![]){_0x589712();}else{_0x589712(_0x2c16ba);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index c76d97c..27c8f20 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 _0x9c5a=['int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x46ccb7,_0x13eae4){var _0x29c02d=function(_0x561b82){while(--_0x561b82){_0x46ccb7['push'](_0x46ccb7['shift']());}};_0x29c02d(++_0x13eae4);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x50b6da,_0x4e71a8){_0x50b6da=_0x50b6da-0x0;var _0x343d24=_0x9c5a[_0x50b6da];return _0x343d24;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xa9c5('0x8'));module['exports']=function(_0x394d84,_0x3df556){return _0x394d84['define']('ServicenowAccount',attributes,{'tableName':_0xa9c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1623=['path','./intServicenowAccount.attributes','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','api','moment','bluebird','request-promise'];(function(_0x354892,_0x5ccbc6){var _0x81d20b=function(_0x50eb5a){while(--_0x50eb5a){_0x354892['push'](_0x354892['shift']());}};_0x81d20b(++_0x5ccbc6);}(_0x1623,0xab));var _0x3162=function(_0x435558,_0x1f5d50){_0x435558=_0x435558-0x0;var _0x2898a1=_0x1623[_0x435558];return _0x2898a1;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x3162('0x7')]=function(_0x428de6,_0x53260d){return _0x428de6[_0x3162('0x8')](_0x3162('0x9'),attributes,{'tableName':_0x3162('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 4b74cc8..1be2e7c 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 _0x12d0=['http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','include','model','map','ShowServicenowAccount','find','raw','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x12d0,0xea));var _0x012d=function(_0xa99346,_0x4d0753){_0xa99346=_0xa99346-0x0;var _0x27925c=_0x12d0[_0xa99346];return _0x27925c;};'use strict';var _=require(_0x012d('0x0'));var util=require(_0x012d('0x1'));var moment=require(_0x012d('0x2'));var BPromise=require('bluebird');var rs=require(_0x012d('0x3'));var fs=require('fs');var Redis=require(_0x012d('0x4'));var db=require(_0x012d('0x5'))['db'];var utils=require(_0x012d('0x6'));var logger=require(_0x012d('0x7'))(_0x012d('0x8'));var config=require('../../config/environment');var jayson=require(_0x012d('0x9'));var client=jayson[_0x012d('0xa')][_0x012d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a5bef,_0x1a8ea3,_0xbc5711){return new BPromise(function(_0x38685c,_0x265042){return client[_0x012d('0xc')](_0x3a5bef,_0xbc5711)[_0x012d('0xd')](function(_0x1e1d69){logger[_0x012d('0xe')](_0x012d('0xf'),_0x1a8ea3,'request\x20sent');logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1a8ea3,_0x012d('0x10'),JSON[_0x012d('0x11')](_0x1e1d69));if(_0x1e1d69[_0x012d('0x12')]){if(_0x1e1d69[_0x012d('0x12')]['code']===0x1f4){logger['error'](_0x012d('0xf'),_0x1a8ea3,_0x1e1d69[_0x012d('0x12')]['message']);return _0x265042(_0x1e1d69[_0x012d('0x12')][_0x012d('0x13')]);}logger[_0x012d('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x1a8ea3,_0x1e1d69['error']['message']);return _0x38685c(_0x1e1d69[_0x012d('0x12')]['message']);}else{logger[_0x012d('0xe')](_0x012d('0xf'),_0x1a8ea3,_0x012d('0x10'));_0x38685c(_0x1e1d69[_0x012d('0x14')][_0x012d('0x13')]);}})['catch'](function(_0x2b08b7){logger[_0x012d('0x12')](_0x012d('0xf'),_0x1a8ea3,_0x2b08b7);_0x265042(_0x2b08b7);});});}exports[_0x012d('0x15')]=function(_0x317f32){var _0x22fa15=this;return new Promise(function(_0x379cd3,_0x21f256){return db[_0x012d('0x16')][_0x012d('0x17')]({'raw':_0x317f32[_0x012d('0x18')]?_0x317f32[_0x012d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x317f32[_0x012d('0x18')]?_0x317f32[_0x012d('0x18')][_0x012d('0x19')]||null:null,'attributes':_0x317f32[_0x012d('0x18')]?_0x317f32[_0x012d('0x18')][_0x012d('0x1a')]||null:null,'limit':_0x317f32['options']?_0x317f32['options']['limit']||null:null,'include':_0x317f32[_0x012d('0x18')]?_0x317f32[_0x012d('0x18')][_0x012d('0x1b')]?_['map'](_0x317f32[_0x012d('0x18')][_0x012d('0x1b')],function(_0x118843){return{'model':db[_0x118843[_0x012d('0x1c')]],'as':_0x118843['as'],'attributes':_0x118843['attributes'],'include':_0x118843[_0x012d('0x1b')]?_[_0x012d('0x1d')](_0x118843[_0x012d('0x1b')],function(_0x1ed4d3){return{'model':db[_0x1ed4d3[_0x012d('0x1c')]],'as':_0x1ed4d3['as'],'attributes':_0x1ed4d3[_0x012d('0x1a')],'include':_0x1ed4d3[_0x012d('0x1b')]?_[_0x012d('0x1d')](_0x1ed4d3[_0x012d('0x1b')],function(_0x4e6ced){return{'model':db[_0x4e6ced[_0x012d('0x1c')]],'as':_0x4e6ced['as'],'attributes':_0x4e6ced[_0x012d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x012d('0xd')](function(_0x3d4f9b){logger[_0x012d('0xe')](_0x012d('0x15'),_0x317f32);logger['debug'](_0x012d('0x15'),_0x317f32,JSON['stringify'](_0x3d4f9b));_0x379cd3(_0x3d4f9b);})['catch'](function(_0x558784){logger[_0x012d('0x12')](_0x012d('0x15'),_0x558784[_0x012d('0x13')],_0x317f32);_0x21f256(_0x22fa15[_0x012d('0x12')](0x1f4,_0x558784[_0x012d('0x13')]));});});};exports[_0x012d('0x1e')]=function(_0xbb048d){var _0x131d2d=this;return new Promise(function(_0x42e4a7,_0xa7c001){return db['ServicenowAccount'][_0x012d('0x1f')]({'raw':_0xbb048d[_0x012d('0x18')]?_0xbb048d['options'][_0x012d('0x20')]===undefined?!![]:![]:!![],'where':_0xbb048d[_0x012d('0x18')]?_0xbb048d[_0x012d('0x18')]['where']||null:null,'attributes':_0xbb048d['options']?_0xbb048d[_0x012d('0x18')][_0x012d('0x1a')]||null:null,'include':_0xbb048d[_0x012d('0x18')]?_0xbb048d[_0x012d('0x18')][_0x012d('0x1b')]?_['map'](_0xbb048d[_0x012d('0x18')]['include'],function(_0x1b443f){return{'model':db[_0x1b443f[_0x012d('0x1c')]],'as':_0x1b443f['as'],'attributes':_0x1b443f[_0x012d('0x1a')],'include':_0x1b443f['include']?_[_0x012d('0x1d')](_0x1b443f[_0x012d('0x1b')],function(_0x528f99){return{'model':db[_0x528f99[_0x012d('0x1c')]],'as':_0x528f99['as'],'attributes':_0x528f99[_0x012d('0x1a')],'include':_0x528f99['include']?_[_0x012d('0x1d')](_0x528f99['include'],function(_0x514275){return{'model':db[_0x514275['model']],'as':_0x514275['as'],'attributes':_0x514275['attributes']};}):[]};}):[]};}):[]:[]})[_0x012d('0xd')](function(_0x38cf65){logger['info'](_0x012d('0x1e'),_0xbb048d);logger[_0x012d('0x21')]('ShowServicenowAccount',_0xbb048d,JSON[_0x012d('0x11')](_0x38cf65));_0x42e4a7(_0x38cf65);})[_0x012d('0x22')](function(_0x246e60){logger[_0x012d('0x12')](_0x012d('0x1e'),_0x246e60[_0x012d('0x13')],_0xbb048d);_0xa7c001(_0x131d2d[_0x012d('0x12')](0x1f4,_0x246e60[_0x012d('0x13')]));});});}; \ No newline at end of file +var _0x4100=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x348fdc,_0x509cf0){var _0x479630=function(_0x3568be){while(--_0x3568be){_0x348fdc['push'](_0x348fdc['shift']());}};_0x479630(++_0x509cf0);}(_0x4100,0x1d5));var _0x0410=function(_0x2444e0,_0x58b3f3){_0x2444e0=_0x2444e0-0x0;var _0x3c253c=_0x4100[_0x2444e0];return _0x3c253c;};'use strict';var _=require('lodash');var util=require(_0x0410('0x0'));var moment=require(_0x0410('0x1'));var BPromise=require(_0x0410('0x2'));var rs=require(_0x0410('0x3'));var fs=require('fs');var Redis=require(_0x0410('0x4'));var db=require(_0x0410('0x5'))['db'];var utils=require(_0x0410('0x6'));var logger=require(_0x0410('0x7'))(_0x0410('0x8'));var config=require(_0x0410('0x9'));var jayson=require(_0x0410('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27f9a9,_0x31a244,_0x44d1cb){return new BPromise(function(_0x1d9fe1,_0xb8c74b){return client[_0x0410('0xb')](_0x27f9a9,_0x44d1cb)[_0x0410('0xc')](function(_0x1129ab){logger[_0x0410('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x31a244,_0x0410('0xe'));logger[_0x0410('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x31a244,_0x0410('0xe'),JSON['stringify'](_0x1129ab));if(_0x1129ab[_0x0410('0x10')]){if(_0x1129ab[_0x0410('0x10')][_0x0410('0x11')]===0x1f4){logger[_0x0410('0x10')](_0x0410('0x12'),_0x31a244,_0x1129ab[_0x0410('0x10')][_0x0410('0x13')]);return _0xb8c74b(_0x1129ab[_0x0410('0x10')][_0x0410('0x13')]);}logger['error'](_0x0410('0x12'),_0x31a244,_0x1129ab[_0x0410('0x10')][_0x0410('0x13')]);return _0x1d9fe1(_0x1129ab[_0x0410('0x10')][_0x0410('0x13')]);}else{logger[_0x0410('0xd')](_0x0410('0x12'),_0x31a244,'request\x20sent');_0x1d9fe1(_0x1129ab[_0x0410('0x14')][_0x0410('0x13')]);}})[_0x0410('0x15')](function(_0x3954ea){logger[_0x0410('0x10')](_0x0410('0x12'),_0x31a244,_0x3954ea);_0xb8c74b(_0x3954ea);});});}exports[_0x0410('0x16')]=function(_0xf510fd){var _0x92e9ac=this;return new Promise(function(_0x4eff2b,_0xd4041f){return db[_0x0410('0x17')]['findAll']({'raw':_0xf510fd[_0x0410('0x18')]?_0xf510fd[_0x0410('0x18')][_0x0410('0x19')]===undefined?!![]:![]:!![],'where':_0xf510fd[_0x0410('0x18')]?_0xf510fd[_0x0410('0x18')][_0x0410('0x1a')]||null:null,'attributes':_0xf510fd[_0x0410('0x18')]?_0xf510fd['options'][_0x0410('0x1b')]||null:null,'limit':_0xf510fd[_0x0410('0x18')]?_0xf510fd[_0x0410('0x18')][_0x0410('0x1c')]||null:null,'include':_0xf510fd['options']?_0xf510fd[_0x0410('0x18')][_0x0410('0x1d')]?_[_0x0410('0x1e')](_0xf510fd['options'][_0x0410('0x1d')],function(_0x16745f){return{'model':db[_0x16745f['model']],'as':_0x16745f['as'],'attributes':_0x16745f[_0x0410('0x1b')],'include':_0x16745f[_0x0410('0x1d')]?_[_0x0410('0x1e')](_0x16745f[_0x0410('0x1d')],function(_0x52d927){return{'model':db[_0x52d927['model']],'as':_0x52d927['as'],'attributes':_0x52d927['attributes'],'include':_0x52d927['include']?_[_0x0410('0x1e')](_0x52d927[_0x0410('0x1d')],function(_0x1388fe){return{'model':db[_0x1388fe[_0x0410('0x1f')]],'as':_0x1388fe['as'],'attributes':_0x1388fe[_0x0410('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0410('0xc')](function(_0x155529){logger[_0x0410('0xd')](_0x0410('0x16'),_0xf510fd);logger['debug'](_0x0410('0x16'),_0xf510fd,JSON['stringify'](_0x155529));_0x4eff2b(_0x155529);})[_0x0410('0x15')](function(_0x35ee3a){logger['error']('GetServicenowAccount',_0x35ee3a[_0x0410('0x13')],_0xf510fd);_0xd4041f(_0x92e9ac[_0x0410('0x10')](0x1f4,_0x35ee3a[_0x0410('0x13')]));});});};exports[_0x0410('0x20')]=function(_0x229a2d){var _0x46f74e=this;return new Promise(function(_0x1ec265,_0x34fc97){return db[_0x0410('0x17')]['find']({'raw':_0x229a2d[_0x0410('0x18')]?_0x229a2d[_0x0410('0x18')][_0x0410('0x19')]===undefined?!![]:![]:!![],'where':_0x229a2d[_0x0410('0x18')]?_0x229a2d[_0x0410('0x18')][_0x0410('0x1a')]||null:null,'attributes':_0x229a2d['options']?_0x229a2d[_0x0410('0x18')][_0x0410('0x1b')]||null:null,'include':_0x229a2d[_0x0410('0x18')]?_0x229a2d[_0x0410('0x18')][_0x0410('0x1d')]?_[_0x0410('0x1e')](_0x229a2d[_0x0410('0x18')][_0x0410('0x1d')],function(_0x3695fe){return{'model':db[_0x3695fe[_0x0410('0x1f')]],'as':_0x3695fe['as'],'attributes':_0x3695fe['attributes'],'include':_0x3695fe['include']?_[_0x0410('0x1e')](_0x3695fe[_0x0410('0x1d')],function(_0x402592){return{'model':db[_0x402592['model']],'as':_0x402592['as'],'attributes':_0x402592[_0x0410('0x1b')],'include':_0x402592[_0x0410('0x1d')]?_['map'](_0x402592[_0x0410('0x1d')],function(_0x1bba38){return{'model':db[_0x1bba38[_0x0410('0x1f')]],'as':_0x1bba38['as'],'attributes':_0x1bba38[_0x0410('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0410('0xc')](function(_0x45f39b){logger[_0x0410('0xd')](_0x0410('0x20'),_0x229a2d);logger[_0x0410('0xf')]('ShowServicenowAccount',_0x229a2d,JSON[_0x0410('0x21')](_0x45f39b));_0x1ec265(_0x45f39b);})[_0x0410('0x15')](function(_0xd504c6){logger[_0x0410('0x10')](_0x0410('0x20'),_0xd504c6[_0x0410('0x13')],_0x229a2d);_0x34fc97(_0x46f74e[_0x0410('0x10')](0x1f4,_0xd504c6[_0x0410('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 362ad4f..777a018 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 _0x8367=['get','isAuthenticated','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x1131e1,_0x584dda){var _0x24688e=function(_0x2334d6){while(--_0x2334d6){_0x1131e1['push'](_0x1131e1['shift']());}};_0x24688e(++_0x584dda);}(_0x8367,0x167));var _0x7836=function(_0x10a1ac,_0x25f5b0){_0x10a1ac=_0x10a1ac-0x0;var _0x45b99e=_0x8367[_0x10a1ac];return _0x45b99e;};'use strict';var multer=require('multer');var util=require(_0x7836('0x0'));var path=require('path');var timeout=require(_0x7836('0x1'));var express=require(_0x7836('0x2'));var router=express[_0x7836('0x3')]();var fs_extra=require(_0x7836('0x4'));var auth=require(_0x7836('0x5'));var interaction=require(_0x7836('0x6'));var config=require(_0x7836('0x7'));var controller=require(_0x7836('0x8'));router[_0x7836('0x9')]('/',auth[_0x7836('0xa')](),controller['index']);router[_0x7836('0x9')](_0x7836('0xb'),auth[_0x7836('0xa')](),controller[_0x7836('0xc')]);router[_0x7836('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7836('0xd')]);router[_0x7836('0x9')](_0x7836('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x7836('0xf'),auth[_0x7836('0xa')](),controller[_0x7836('0x10')]);router['post']('/',auth[_0x7836('0xa')](),controller[_0x7836('0x11')]);router[_0x7836('0x12')](_0x7836('0xb'),auth[_0x7836('0xa')](),controller[_0x7836('0x13')]);router[_0x7836('0x14')](_0x7836('0xb'),auth['isAuthenticated'](),controller[_0x7836('0x15')]);module[_0x7836('0x16')]=router; \ No newline at end of file +var _0x9b3c=['index','/:id','show','/:id/fields','/:id/subjects','getDescriptions','create','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated'];(function(_0x5e5ba8,_0x40cab6){var _0x3633ef=function(_0xa5a0a8){while(--_0xa5a0a8){_0x5e5ba8['push'](_0x5e5ba8['shift']());}};_0x3633ef(++_0x40cab6);}(_0x9b3c,0x1d8));var _0xc9b3=function(_0x15268c,_0x52ca76){_0x15268c=_0x15268c-0x0;var _0x496f25=_0x9b3c[_0x15268c];return _0x496f25;};'use strict';var multer=require(_0xc9b3('0x0'));var util=require('util');var path=require(_0xc9b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9b3('0x2'));var router=express[_0xc9b3('0x3')]();var fs_extra=require(_0xc9b3('0x4'));var auth=require(_0xc9b3('0x5'));var interaction=require(_0xc9b3('0x6'));var config=require(_0xc9b3('0x7'));var controller=require(_0xc9b3('0x8'));router[_0xc9b3('0x9')]('/',auth[_0xc9b3('0xa')](),controller[_0xc9b3('0xb')]);router[_0xc9b3('0x9')](_0xc9b3('0xc'),auth[_0xc9b3('0xa')](),controller[_0xc9b3('0xd')]);router[_0xc9b3('0x9')](_0xc9b3('0xe'),auth[_0xc9b3('0xa')](),controller['getFields']);router['get'](_0xc9b3('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xc9b3('0x9')]('/:id/descriptions',auth[_0xc9b3('0xa')](),controller[_0xc9b3('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc9b3('0x11')]);router[_0xc9b3('0x12')](_0xc9b3('0xc'),auth[_0xc9b3('0xa')](),controller['update']);router[_0xc9b3('0x13')](_0xc9b3('0xc'),auth['isAuthenticated'](),controller[_0xc9b3('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 5e70345..acc8c4b 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 _0x0bd7=['sequelize','STRING'];(function(_0x2f89f0,_0x20d04d){var _0x2bc11f=function(_0xfe3a47){while(--_0xfe3a47){_0x2f89f0['push'](_0x2f89f0['shift']());}};_0x2bc11f(++_0x20d04d);}(_0x0bd7,0x96));var _0x70bd=function(_0x1a4a06,_0x36a5c2){_0x1a4a06=_0x1a4a06-0x0;var _0x49ec08=_0x0bd7[_0x1a4a06];return _0x49ec08;};'use strict';var Sequelize=require(_0x70bd('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x70bd('0x1')]}}; \ No newline at end of file +var _0x2ce8=['sequelize','exports'];(function(_0x2e68db,_0x275d04){var _0x12df4c=function(_0x1b6701){while(--_0x1b6701){_0x2e68db['push'](_0x2e68db['shift']());}};_0x12df4c(++_0x275d04);}(_0x2ce8,0xb6));var _0x82ce=function(_0x32007b,_0x16a2f5){_0x32007b=_0x32007b-0x0;var _0x1bd22a=_0x2ce8[_0x32007b];return _0x1bd22a;};'use strict';var Sequelize=require(_0x82ce('0x0'));module[_0x82ce('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index f466cf2..ceeae92 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 _0x2f6e=['../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','ServicenowConfiguration','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','params','getFields','findOne','ServicenowField','merge','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x34c22e,_0x5bc5cb){var _0x139908=function(_0x16af47){while(--_0x16af47){_0x34c22e['push'](_0x34c22e['shift']());}};_0x139908(++_0x5bc5cb);}(_0x2f6e,0xd7));var _0xe2f6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2f6e[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xe2f6('0x0'));var rimraf=require(_0xe2f6('0x1'));var zipdir=require(_0xe2f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe2f6('0x3'));var Mustache=require(_0xe2f6('0x4'));var util=require(_0xe2f6('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe2f6('0x6'));var fs=require('fs');var fs_extra=require(_0xe2f6('0x7'));var _=require(_0xe2f6('0x8'));var squel=require(_0xe2f6('0x9'));var crypto=require(_0xe2f6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe2f6('0xb'));var querystring=require(_0xe2f6('0xc'));var Papa=require(_0xe2f6('0xd'));var Redis=require('ioredis');var authService=require(_0xe2f6('0xe'));var qs=require(_0xe2f6('0xf'));var as=require(_0xe2f6('0x10'));var hardwareService=require(_0xe2f6('0x11'));var logger=require(_0xe2f6('0x12'))('api');var utils=require(_0xe2f6('0x13'));var config=require(_0xe2f6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2f6('0x15'))['db'];function respondWithStatusCode(_0x35bdc1,_0x3eaf74){_0x3eaf74=_0x3eaf74||0xcc;return function(_0x2757a6){if(_0x2757a6){return _0x35bdc1['sendStatus'](_0x3eaf74);}return _0x35bdc1[_0xe2f6('0x16')](_0x3eaf74)[_0xe2f6('0x17')]();};}function respondWithResult(_0x5e992b,_0xaba54){_0xaba54=_0xaba54||0xc8;return function(_0x419cf0){if(_0x419cf0){return _0x5e992b[_0xe2f6('0x16')](_0xaba54)['json'](_0x419cf0);}};}function respondWithFilteredResult(_0x3a7df4,_0x12661d){return function(_0x226afe){if(_0x226afe){var _0x521ce8=typeof _0x12661d[_0xe2f6('0x18')]===_0xe2f6('0x19')&&typeof _0x12661d[_0xe2f6('0x1a')]===_0xe2f6('0x19');var _0xed49c7=_0x226afe[_0xe2f6('0x1b')];var _0x288b2f=_0x521ce8?0x0:_0x12661d[_0xe2f6('0x18')];var _0x58134b=_0x521ce8?_0x226afe[_0xe2f6('0x1b')]:_0x12661d[_0xe2f6('0x18')]+_0x12661d[_0xe2f6('0x1a')];var _0x326dee;if(_0x58134b>=_0xed49c7){_0x58134b=_0xed49c7;_0x326dee=0xc8;}else{_0x326dee=0xce;}_0x3a7df4[_0xe2f6('0x16')](_0x326dee);return _0x3a7df4['set'](_0xe2f6('0x1c'),_0x288b2f+'-'+_0x58134b+'/'+_0xed49c7)[_0xe2f6('0x1d')](_0x226afe);}return null;};}function patchUpdates(_0x3fd610){return function(_0x20d425){try{jsonpatch[_0xe2f6('0x1e')](_0x20d425,_0x3fd610,!![]);}catch(_0x22f4fc){return BPromise[_0xe2f6('0x1f')](_0x22f4fc);}return _0x20d425['save']();};}function saveUpdates(_0x4f70ad,_0x35b2ee){return function(_0x4b540b){if(_0x4b540b){return _0x4b540b[_0xe2f6('0x20')](_0x4f70ad)[_0xe2f6('0x21')](function(_0x59f05f){return _0x59f05f;});}return null;};}function removeEntity(_0x4a9a2b,_0x19257d){return function(_0x30fedc){if(_0x30fedc){return _0x30fedc[_0xe2f6('0x22')]()[_0xe2f6('0x21')](function(){_0x4a9a2b[_0xe2f6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1154d4,_0x573563){return function(_0x371736){if(!_0x371736){_0x1154d4[_0xe2f6('0x23')](0x194);}return _0x371736;};}function handleError(_0x5cd584,_0x595d98){_0x595d98=_0x595d98||0x1f4;return function(_0x42b911){logger[_0xe2f6('0x24')](_0x42b911[_0xe2f6('0x25')]);if(_0x42b911[_0xe2f6('0x26')]){delete _0x42b911[_0xe2f6('0x26')];}_0x5cd584['status'](_0x595d98)[_0xe2f6('0x27')](_0x42b911);};}exports[_0xe2f6('0x28')]=function(_0x3e0556,_0x44d941){var _0x3e93e8={},_0x27aa96={},_0xb28d4c={'count':0x0,'rows':[]};var _0x3eecb0=_[_0xe2f6('0x29')](db['ServicenowConfiguration'][_0xe2f6('0x2a')],function(_0x346e04){return{'name':_0x346e04['fieldName'],'type':_0x346e04[_0xe2f6('0x2b')][_0xe2f6('0x2c')]};});_0x27aa96[_0xe2f6('0x2d')]=_['map'](_0x3eecb0,_0xe2f6('0x26'));_0x27aa96['query']=_['keys'](_0x3e0556[_0xe2f6('0x2e')]);_0x27aa96['filters']=_['intersection'](_0x27aa96[_0xe2f6('0x2d')],_0x27aa96[_0xe2f6('0x2e')]);_0x3e93e8[_0xe2f6('0x2f')]=_[_0xe2f6('0x30')](_0x27aa96[_0xe2f6('0x2d')],qs[_0xe2f6('0x31')](_0x3e0556[_0xe2f6('0x2e')]['fields']));_0x3e93e8['attributes']=_0x3e93e8[_0xe2f6('0x2f')]['length']?_0x3e93e8[_0xe2f6('0x2f')]:_0x27aa96['model'];if(!_0x3e0556['query'][_0xe2f6('0x32')](_0xe2f6('0x33'))){_0x3e93e8['limit']=qs[_0xe2f6('0x1a')](_0x3e0556[_0xe2f6('0x2e')][_0xe2f6('0x1a')]);_0x3e93e8['offset']=qs['offset'](_0x3e0556[_0xe2f6('0x2e')]['offset']);}_0x3e93e8[_0xe2f6('0x34')]=qs[_0xe2f6('0x35')](_0x3e0556[_0xe2f6('0x2e')][_0xe2f6('0x35')]);_0x3e93e8[_0xe2f6('0x36')]=qs[_0xe2f6('0x37')](_[_0xe2f6('0x38')](_0x3e0556[_0xe2f6('0x2e')],_0x27aa96[_0xe2f6('0x37')]),_0x3eecb0);if(_0x3e0556[_0xe2f6('0x2e')][_0xe2f6('0x39')]){_0x3e93e8['where']=_['merge'](_0x3e93e8['where'],{'$or':_[_0xe2f6('0x29')](_0x3eecb0,function(_0x51827a){if(_0x51827a[_0xe2f6('0x2b')]!=='VIRTUAL'){var _0x2df01f={};_0x2df01f[_0x51827a[_0xe2f6('0x26')]]={'$like':'%'+_0x3e0556[_0xe2f6('0x2e')][_0xe2f6('0x39')]+'%'};return _0x2df01f;}})});}_0x3e93e8=_['merge']({},_0x3e93e8,_0x3e0556[_0xe2f6('0x3a')]);var _0x4256fc={'where':_0x3e93e8[_0xe2f6('0x36')]};return db[_0xe2f6('0x3b')]['count'](_0x4256fc)[_0xe2f6('0x21')](function(_0x4817e3){_0xb28d4c[_0xe2f6('0x1b')]=_0x4817e3;if(_0x3e0556['query']['includeAll']){_0x3e93e8[_0xe2f6('0x3c')]=[{'all':!![]}];}return db[_0xe2f6('0x3b')][_0xe2f6('0x3d')](_0x3e93e8);})[_0xe2f6('0x21')](function(_0xc488d5){_0xb28d4c[_0xe2f6('0x3e')]=_0xc488d5;return _0xb28d4c;})[_0xe2f6('0x21')](respondWithFilteredResult(_0x44d941,_0x3e93e8))[_0xe2f6('0x3f')](handleError(_0x44d941,null));};exports[_0xe2f6('0x40')]=function(_0x52a1b4,_0x271b9b){var _0x4f2f4a={'raw':![],'where':{'id':_0x52a1b4['params']['id']}},_0x3fcc06={};_0x3fcc06['model']=_[_0xe2f6('0x41')](db['ServicenowConfiguration'][_0xe2f6('0x2a')]);_0x3fcc06[_0xe2f6('0x2e')]=_[_0xe2f6('0x41')](_0x52a1b4[_0xe2f6('0x2e')]);_0x3fcc06[_0xe2f6('0x37')]=_[_0xe2f6('0x30')](_0x3fcc06[_0xe2f6('0x2d')],_0x3fcc06[_0xe2f6('0x2e')]);_0x4f2f4a['attributes']=_[_0xe2f6('0x30')](_0x3fcc06[_0xe2f6('0x2d')],qs['fields'](_0x52a1b4[_0xe2f6('0x2e')][_0xe2f6('0x31')]));_0x4f2f4a[_0xe2f6('0x2f')]=_0x4f2f4a[_0xe2f6('0x2f')][_0xe2f6('0x42')]?_0x4f2f4a[_0xe2f6('0x2f')]:_0x3fcc06[_0xe2f6('0x2d')];if(_0x52a1b4[_0xe2f6('0x2e')][_0xe2f6('0x43')]){_0x4f2f4a[_0xe2f6('0x3c')]=[{'all':!![]}];}_0x4f2f4a=_['merge']({},_0x4f2f4a,_0x52a1b4[_0xe2f6('0x3a')]);return db[_0xe2f6('0x3b')][_0xe2f6('0x44')](_0x4f2f4a)[_0xe2f6('0x21')](handleEntityNotFound(_0x271b9b,null))['then'](respondWithResult(_0x271b9b,null))['catch'](handleError(_0x271b9b,null));};exports['create']=function(_0x119c51,_0x1d5ecc){return db['ServicenowConfiguration'][_0xe2f6('0x45')](_0x119c51['body'],{})[_0xe2f6('0x21')](respondWithResult(_0x1d5ecc,0xc9))[_0xe2f6('0x3f')](handleError(_0x1d5ecc,null));};exports['update']=function(_0x40aa66,_0x11fca7){if(_0x40aa66[_0xe2f6('0x46')]['id']){delete _0x40aa66[_0xe2f6('0x46')]['id'];}return db[_0xe2f6('0x3b')]['find']({'where':{'id':_0x40aa66['params']['id']}})[_0xe2f6('0x21')](handleEntityNotFound(_0x11fca7,null))[_0xe2f6('0x21')](saveUpdates(_0x40aa66['body'],null))[_0xe2f6('0x21')](respondWithResult(_0x11fca7,null))[_0xe2f6('0x3f')](handleError(_0x11fca7,null));};exports[_0xe2f6('0x22')]=function(_0x1f9eef,_0x1fd9e6){return db[_0xe2f6('0x3b')][_0xe2f6('0x44')]({'where':{'id':_0x1f9eef[_0xe2f6('0x47')]['id']}})[_0xe2f6('0x21')](handleEntityNotFound(_0x1fd9e6,null))[_0xe2f6('0x21')](removeEntity(_0x1fd9e6,null))[_0xe2f6('0x3f')](handleError(_0x1fd9e6,null));};exports[_0xe2f6('0x48')]=function(_0x4fbdda,_0x4cffbc,_0x521db1){var _0x45290c={};var _0x1849b1={};var _0x1b6662;var _0x1ab411;return db[_0xe2f6('0x3b')][_0xe2f6('0x49')]({'where':{'id':_0x4fbdda['params']['id']}})[_0xe2f6('0x21')](handleEntityNotFound(_0x4cffbc,null))[_0xe2f6('0x21')](function(_0x30b67c){if(_0x30b67c){_0x1b6662=_0x30b67c;_0x1849b1[_0xe2f6('0x2d')]=_[_0xe2f6('0x41')](db[_0xe2f6('0x4a')]['rawAttributes']);_0x1849b1[_0xe2f6('0x2e')]=_[_0xe2f6('0x41')](_0x4fbdda[_0xe2f6('0x2e')]);_0x1849b1[_0xe2f6('0x37')]=_[_0xe2f6('0x30')](_0x1849b1[_0xe2f6('0x2d')],_0x1849b1['query']);_0x45290c[_0xe2f6('0x2f')]=_[_0xe2f6('0x30')](_0x1849b1[_0xe2f6('0x2d')],qs['fields'](_0x4fbdda['query'][_0xe2f6('0x31')]));_0x45290c['attributes']=_0x45290c[_0xe2f6('0x2f')][_0xe2f6('0x42')]?_0x45290c[_0xe2f6('0x2f')]:_0x1849b1[_0xe2f6('0x2d')];_0x45290c[_0xe2f6('0x34')]=qs[_0xe2f6('0x35')](_0x4fbdda['query'][_0xe2f6('0x35')]);_0x45290c[_0xe2f6('0x36')]=qs[_0xe2f6('0x37')](_['pick'](_0x4fbdda[_0xe2f6('0x2e')],_0x1849b1[_0xe2f6('0x37')]));if(_0x4fbdda[_0xe2f6('0x2e')][_0xe2f6('0x39')]){_0x45290c['where']=_[_0xe2f6('0x4b')](_0x45290c[_0xe2f6('0x36')],{'$or':_[_0xe2f6('0x29')](_0x45290c[_0xe2f6('0x2f')],function(_0x3a1385){var _0x1fac74={};_0x1fac74[_0x3a1385]={'$like':'%'+_0x4fbdda[_0xe2f6('0x2e')][_0xe2f6('0x39')]+'%'};return _0x1fac74;})});}_0x45290c=_[_0xe2f6('0x4b')]({},_0x45290c,_0x4fbdda['options']);return _0x1b6662[_0xe2f6('0x48')](_0x45290c);}})[_0xe2f6('0x21')](function(_0x5788f5){if(_0x5788f5){_0x1ab411=_0x5788f5[_0xe2f6('0x42')];if(!_0x4fbdda[_0xe2f6('0x2e')][_0xe2f6('0x32')](_0xe2f6('0x33'))){_0x45290c[_0xe2f6('0x1a')]=qs[_0xe2f6('0x1a')](_0x4fbdda[_0xe2f6('0x2e')]['limit']);_0x45290c[_0xe2f6('0x18')]=qs['offset'](_0x4fbdda[_0xe2f6('0x2e')][_0xe2f6('0x18')]);}return _0x1b6662[_0xe2f6('0x48')](_0x45290c);}})[_0xe2f6('0x21')](function(_0x17d9d0){if(_0x17d9d0){return _0x17d9d0?{'count':_0x1ab411,'rows':_0x17d9d0}:null;}})[_0xe2f6('0x21')](respondWithResult(_0x4cffbc,null))[_0xe2f6('0x3f')](handleError(_0x4cffbc,null));};exports['getSubjects']=function(_0xa82e5e,_0x4460ed,_0x1fd6a0){var _0x2c7a4c={};var _0x334022={};var _0x55b840;var _0x20e8c0;return db[_0xe2f6('0x3b')][_0xe2f6('0x49')]({'where':{'id':_0xa82e5e[_0xe2f6('0x47')]['id']}})[_0xe2f6('0x21')](handleEntityNotFound(_0x4460ed,null))[_0xe2f6('0x21')](function(_0x1d3bb5){if(_0x1d3bb5){_0x55b840=_0x1d3bb5;_0x334022[_0xe2f6('0x2d')]=_['keys'](db['ServicenowField'][_0xe2f6('0x2a')]);_0x334022[_0xe2f6('0x2e')]=_['keys'](_0xa82e5e['query']);_0x334022[_0xe2f6('0x37')]=_['intersection'](_0x334022[_0xe2f6('0x2d')],_0x334022[_0xe2f6('0x2e')]);_0x2c7a4c['attributes']=_['intersection'](_0x334022[_0xe2f6('0x2d')],qs[_0xe2f6('0x31')](_0xa82e5e[_0xe2f6('0x2e')][_0xe2f6('0x31')]));_0x2c7a4c[_0xe2f6('0x2f')]=_0x2c7a4c['attributes'][_0xe2f6('0x42')]?_0x2c7a4c[_0xe2f6('0x2f')]:_0x334022[_0xe2f6('0x2d')];_0x2c7a4c['order']=qs['sort'](_0xa82e5e[_0xe2f6('0x2e')]['sort']);_0x2c7a4c['where']=qs[_0xe2f6('0x37')](_[_0xe2f6('0x38')](_0xa82e5e['query'],_0x334022[_0xe2f6('0x37')]));if(_0xa82e5e[_0xe2f6('0x2e')][_0xe2f6('0x39')]){_0x2c7a4c['where']=_['merge'](_0x2c7a4c[_0xe2f6('0x36')],{'$or':_[_0xe2f6('0x29')](_0x2c7a4c[_0xe2f6('0x2f')],function(_0x2f2b70){var _0x5c576f={};_0x5c576f[_0x2f2b70]={'$like':'%'+_0xa82e5e[_0xe2f6('0x2e')]['filter']+'%'};return _0x5c576f;})});}_0x2c7a4c=_[_0xe2f6('0x4b')]({},_0x2c7a4c,_0xa82e5e[_0xe2f6('0x3a')]);return _0x55b840[_0xe2f6('0x4c')](_0x2c7a4c);}})[_0xe2f6('0x21')](function(_0x2c17e3){if(_0x2c17e3){_0x20e8c0=_0x2c17e3[_0xe2f6('0x42')];if(!_0xa82e5e[_0xe2f6('0x2e')]['hasOwnProperty'](_0xe2f6('0x33'))){_0x2c7a4c[_0xe2f6('0x1a')]=qs[_0xe2f6('0x1a')](_0xa82e5e[_0xe2f6('0x2e')][_0xe2f6('0x1a')]);_0x2c7a4c[_0xe2f6('0x18')]=qs[_0xe2f6('0x18')](_0xa82e5e[_0xe2f6('0x2e')][_0xe2f6('0x18')]);}return _0x55b840['getSubjects'](_0x2c7a4c);}})[_0xe2f6('0x21')](function(_0x31a19e){if(_0x31a19e){return _0x31a19e?{'count':_0x20e8c0,'rows':_0x31a19e}:null;}})[_0xe2f6('0x21')](respondWithResult(_0x4460ed,null))[_0xe2f6('0x3f')](handleError(_0x4460ed,null));};exports[_0xe2f6('0x4d')]=function(_0x2796f8,_0xf1bb54,_0x16af8a){var _0x4ddcb8={};var _0x459ef={};var _0x159313;var _0x5b881b;return db['ServicenowConfiguration'][_0xe2f6('0x49')]({'where':{'id':_0x2796f8[_0xe2f6('0x47')]['id']}})[_0xe2f6('0x21')](handleEntityNotFound(_0xf1bb54,null))[_0xe2f6('0x21')](function(_0x45984d){if(_0x45984d){_0x159313=_0x45984d;_0x459ef[_0xe2f6('0x2d')]=_['keys'](db[_0xe2f6('0x4a')][_0xe2f6('0x2a')]);_0x459ef[_0xe2f6('0x2e')]=_['keys'](_0x2796f8[_0xe2f6('0x2e')]);_0x459ef[_0xe2f6('0x37')]=_[_0xe2f6('0x30')](_0x459ef[_0xe2f6('0x2d')],_0x459ef[_0xe2f6('0x2e')]);_0x4ddcb8[_0xe2f6('0x2f')]=_[_0xe2f6('0x30')](_0x459ef[_0xe2f6('0x2d')],qs['fields'](_0x2796f8['query'][_0xe2f6('0x31')]));_0x4ddcb8[_0xe2f6('0x2f')]=_0x4ddcb8[_0xe2f6('0x2f')][_0xe2f6('0x42')]?_0x4ddcb8[_0xe2f6('0x2f')]:_0x459ef[_0xe2f6('0x2d')];_0x4ddcb8['order']=qs[_0xe2f6('0x35')](_0x2796f8[_0xe2f6('0x2e')][_0xe2f6('0x35')]);_0x4ddcb8['where']=qs[_0xe2f6('0x37')](_[_0xe2f6('0x38')](_0x2796f8[_0xe2f6('0x2e')],_0x459ef[_0xe2f6('0x37')]));if(_0x2796f8[_0xe2f6('0x2e')]['filter']){_0x4ddcb8['where']=_['merge'](_0x4ddcb8[_0xe2f6('0x36')],{'$or':_[_0xe2f6('0x29')](_0x4ddcb8[_0xe2f6('0x2f')],function(_0x16bca6){var _0xf94060={};_0xf94060[_0x16bca6]={'$like':'%'+_0x2796f8[_0xe2f6('0x2e')][_0xe2f6('0x39')]+'%'};return _0xf94060;})});}_0x4ddcb8=_[_0xe2f6('0x4b')]({},_0x4ddcb8,_0x2796f8[_0xe2f6('0x3a')]);return _0x159313[_0xe2f6('0x4d')](_0x4ddcb8);}})[_0xe2f6('0x21')](function(_0x3606d4){if(_0x3606d4){_0x5b881b=_0x3606d4[_0xe2f6('0x42')];if(!_0x2796f8['query']['hasOwnProperty'](_0xe2f6('0x33'))){_0x4ddcb8[_0xe2f6('0x1a')]=qs[_0xe2f6('0x1a')](_0x2796f8[_0xe2f6('0x2e')][_0xe2f6('0x1a')]);_0x4ddcb8[_0xe2f6('0x18')]=qs['offset'](_0x2796f8['query']['offset']);}return _0x159313[_0xe2f6('0x4d')](_0x4ddcb8);}})[_0xe2f6('0x21')](function(_0x2c0dc9){if(_0x2c0dc9){return _0x2c0dc9?{'count':_0x5b881b,'rows':_0x2c0dc9}:null;}})[_0xe2f6('0x21')](respondWithResult(_0xf1bb54,null))[_0xe2f6('0x3f')](handleError(_0xf1bb54,null));}; \ No newline at end of file +var _0x85e8=['undefined','limit','count','set','apply','save','update','then','destroy','end','sendStatus','error','name','send','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','ServicenowConfiguration','include','findAll','catch','show','params','includeAll','find','create','body','findOne','ServicenowField','order','pick','getFields','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset'];(function(_0x3dac40,_0xd87b79){var _0x3183e9=function(_0xde3aec){while(--_0xde3aec){_0x3dac40['push'](_0x3dac40['shift']());}};_0x3183e9(++_0xd87b79);}(_0x85e8,0x114));var _0x885e=function(_0x4ab9a7,_0x291df1){_0x4ab9a7=_0x4ab9a7-0x0;var _0xd08799=_0x85e8[_0x4ab9a7];return _0xd08799;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x885e('0x0'));var zipdir=require(_0x885e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x885e('0x2'));var moment=require(_0x885e('0x3'));var BPromise=require(_0x885e('0x4'));var Mustache=require(_0x885e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x885e('0x6'));var csv=require(_0x885e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x885e('0x8'));var _=require('lodash');var squel=require(_0x885e('0x9'));var crypto=require(_0x885e('0xa'));var jsforce=require(_0x885e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x885e('0x7'));var querystring=require(_0x885e('0xc'));var Papa=require(_0x885e('0xd'));var Redis=require(_0x885e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x885e('0xf'));var as=require(_0x885e('0x10'));var hardwareService=require(_0x885e('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x885e('0x12'));var licenseUtil=require(_0x885e('0x13'));var db=require(_0x885e('0x14'))['db'];function respondWithStatusCode(_0x36f6d3,_0x1c46bc){_0x1c46bc=_0x1c46bc||0xcc;return function(_0x4f7b7a){if(_0x4f7b7a){return _0x36f6d3['sendStatus'](_0x1c46bc);}return _0x36f6d3[_0x885e('0x15')](_0x1c46bc)['end']();};}function respondWithResult(_0x1d2bf3,_0x20941b){_0x20941b=_0x20941b||0xc8;return function(_0x2628e0){if(_0x2628e0){return _0x1d2bf3[_0x885e('0x15')](_0x20941b)[_0x885e('0x16')](_0x2628e0);}};}function respondWithFilteredResult(_0x32a491,_0x23613e){return function(_0x28ccb6){if(_0x28ccb6){var _0x4063f5=typeof _0x23613e[_0x885e('0x17')]===_0x885e('0x18')&&typeof _0x23613e[_0x885e('0x19')]==='undefined';var _0x2d3a9d=_0x28ccb6[_0x885e('0x1a')];var _0x2f493a=_0x4063f5?0x0:_0x23613e['offset'];var _0x49a429=_0x4063f5?_0x28ccb6[_0x885e('0x1a')]:_0x23613e[_0x885e('0x17')]+_0x23613e['limit'];var _0x4bc471;if(_0x49a429>=_0x2d3a9d){_0x49a429=_0x2d3a9d;_0x4bc471=0xc8;}else{_0x4bc471=0xce;}_0x32a491[_0x885e('0x15')](_0x4bc471);return _0x32a491[_0x885e('0x1b')]('Content-Range',_0x2f493a+'-'+_0x49a429+'/'+_0x2d3a9d)[_0x885e('0x16')](_0x28ccb6);}return null;};}function patchUpdates(_0x205114){return function(_0xb64dc8){try{jsonpatch[_0x885e('0x1c')](_0xb64dc8,_0x205114,!![]);}catch(_0x1ebab9){return BPromise['reject'](_0x1ebab9);}return _0xb64dc8[_0x885e('0x1d')]();};}function saveUpdates(_0x21fde1,_0x3e45e5){return function(_0x3460a3){if(_0x3460a3){return _0x3460a3[_0x885e('0x1e')](_0x21fde1)[_0x885e('0x1f')](function(_0x20a290){return _0x20a290;});}return null;};}function removeEntity(_0x10a5e8,_0x3b8a36){return function(_0x37e1b7){if(_0x37e1b7){return _0x37e1b7[_0x885e('0x20')]()[_0x885e('0x1f')](function(){_0x10a5e8[_0x885e('0x15')](0xcc)[_0x885e('0x21')]();});}};}function handleEntityNotFound(_0x1a420a,_0x107fc0){return function(_0x44b2be){if(!_0x44b2be){_0x1a420a[_0x885e('0x22')](0x194);}return _0x44b2be;};}function handleError(_0x22749b,_0x5da3c4){_0x5da3c4=_0x5da3c4||0x1f4;return function(_0x4ceb32){logger[_0x885e('0x23')](_0x4ceb32['stack']);if(_0x4ceb32[_0x885e('0x24')]){delete _0x4ceb32[_0x885e('0x24')];}_0x22749b[_0x885e('0x15')](_0x5da3c4)[_0x885e('0x25')](_0x4ceb32);};}exports['index']=function(_0x3ab3a8,_0xa546a7){var _0x3536e7={},_0x373bb7={},_0x2db03f={'count':0x0,'rows':[]};var _0x22ef33=_[_0x885e('0x26')](db['ServicenowConfiguration'][_0x885e('0x27')],function(_0x2e9309){return{'name':_0x2e9309['fieldName'],'type':_0x2e9309['type'][_0x885e('0x28')]};});_0x373bb7[_0x885e('0x29')]=_[_0x885e('0x26')](_0x22ef33,_0x885e('0x24'));_0x373bb7[_0x885e('0x2a')]=_[_0x885e('0x2b')](_0x3ab3a8[_0x885e('0x2a')]);_0x373bb7['filters']=_[_0x885e('0x2c')](_0x373bb7[_0x885e('0x29')],_0x373bb7['query']);_0x3536e7[_0x885e('0x2d')]=_['intersection'](_0x373bb7['model'],qs[_0x885e('0x2e')](_0x3ab3a8[_0x885e('0x2a')][_0x885e('0x2e')]));_0x3536e7[_0x885e('0x2d')]=_0x3536e7[_0x885e('0x2d')][_0x885e('0x2f')]?_0x3536e7['attributes']:_0x373bb7['model'];if(!_0x3ab3a8[_0x885e('0x2a')][_0x885e('0x30')](_0x885e('0x31'))){_0x3536e7[_0x885e('0x19')]=qs[_0x885e('0x19')](_0x3ab3a8[_0x885e('0x2a')][_0x885e('0x19')]);_0x3536e7[_0x885e('0x17')]=qs[_0x885e('0x17')](_0x3ab3a8[_0x885e('0x2a')][_0x885e('0x17')]);}_0x3536e7['order']=qs[_0x885e('0x32')](_0x3ab3a8[_0x885e('0x2a')][_0x885e('0x32')]);_0x3536e7[_0x885e('0x33')]=qs[_0x885e('0x34')](_['pick'](_0x3ab3a8[_0x885e('0x2a')],_0x373bb7['filters']),_0x22ef33);if(_0x3ab3a8['query'][_0x885e('0x35')]){_0x3536e7[_0x885e('0x33')]=_[_0x885e('0x36')](_0x3536e7['where'],{'$or':_['map'](_0x22ef33,function(_0x2b81f8){if(_0x2b81f8[_0x885e('0x37')]!==_0x885e('0x38')){var _0x495bdb={};_0x495bdb[_0x2b81f8[_0x885e('0x24')]]={'$like':'%'+_0x3ab3a8[_0x885e('0x2a')]['filter']+'%'};return _0x495bdb;}})});}_0x3536e7=_[_0x885e('0x36')]({},_0x3536e7,_0x3ab3a8[_0x885e('0x39')]);var _0x3bfa85={'where':_0x3536e7[_0x885e('0x33')]};return db[_0x885e('0x3a')]['count'](_0x3bfa85)[_0x885e('0x1f')](function(_0x473080){_0x2db03f['count']=_0x473080;if(_0x3ab3a8[_0x885e('0x2a')]['includeAll']){_0x3536e7[_0x885e('0x3b')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x885e('0x3c')](_0x3536e7);})[_0x885e('0x1f')](function(_0x482162){_0x2db03f['rows']=_0x482162;return _0x2db03f;})['then'](respondWithFilteredResult(_0xa546a7,_0x3536e7))[_0x885e('0x3d')](handleError(_0xa546a7,null));};exports[_0x885e('0x3e')]=function(_0x233c10,_0x3f2481){var _0x326c30={'raw':![],'where':{'id':_0x233c10[_0x885e('0x3f')]['id']}},_0x55b390={};_0x55b390['model']=_[_0x885e('0x2b')](db[_0x885e('0x3a')][_0x885e('0x27')]);_0x55b390[_0x885e('0x2a')]=_[_0x885e('0x2b')](_0x233c10['query']);_0x55b390[_0x885e('0x34')]=_[_0x885e('0x2c')](_0x55b390[_0x885e('0x29')],_0x55b390[_0x885e('0x2a')]);_0x326c30['attributes']=_[_0x885e('0x2c')](_0x55b390['model'],qs[_0x885e('0x2e')](_0x233c10['query'][_0x885e('0x2e')]));_0x326c30[_0x885e('0x2d')]=_0x326c30[_0x885e('0x2d')][_0x885e('0x2f')]?_0x326c30[_0x885e('0x2d')]:_0x55b390[_0x885e('0x29')];if(_0x233c10[_0x885e('0x2a')][_0x885e('0x40')]){_0x326c30[_0x885e('0x3b')]=[{'all':!![]}];}_0x326c30=_[_0x885e('0x36')]({},_0x326c30,_0x233c10[_0x885e('0x39')]);return db[_0x885e('0x3a')][_0x885e('0x41')](_0x326c30)[_0x885e('0x1f')](handleEntityNotFound(_0x3f2481,null))[_0x885e('0x1f')](respondWithResult(_0x3f2481,null))[_0x885e('0x3d')](handleError(_0x3f2481,null));};exports['create']=function(_0x19989,_0x12844e){return db[_0x885e('0x3a')][_0x885e('0x42')](_0x19989[_0x885e('0x43')],{})[_0x885e('0x1f')](respondWithResult(_0x12844e,0xc9))[_0x885e('0x3d')](handleError(_0x12844e,null));};exports[_0x885e('0x1e')]=function(_0x1a3c97,_0x46359c){if(_0x1a3c97['body']['id']){delete _0x1a3c97[_0x885e('0x43')]['id'];}return db[_0x885e('0x3a')]['find']({'where':{'id':_0x1a3c97[_0x885e('0x3f')]['id']}})[_0x885e('0x1f')](handleEntityNotFound(_0x46359c,null))[_0x885e('0x1f')](saveUpdates(_0x1a3c97[_0x885e('0x43')],null))['then'](respondWithResult(_0x46359c,null))['catch'](handleError(_0x46359c,null));};exports[_0x885e('0x20')]=function(_0x2cfe95,_0x4d0c74){return db['ServicenowConfiguration']['find']({'where':{'id':_0x2cfe95['params']['id']}})[_0x885e('0x1f')](handleEntityNotFound(_0x4d0c74,null))['then'](removeEntity(_0x4d0c74,null))[_0x885e('0x3d')](handleError(_0x4d0c74,null));};exports['getFields']=function(_0x573e4a,_0x41067a,_0xb687d4){var _0x5cc27b={};var _0x2bc303={};var _0x11ac39;var _0x1858f6;return db[_0x885e('0x3a')][_0x885e('0x44')]({'where':{'id':_0x573e4a[_0x885e('0x3f')]['id']}})[_0x885e('0x1f')](handleEntityNotFound(_0x41067a,null))[_0x885e('0x1f')](function(_0x4b243e){if(_0x4b243e){_0x11ac39=_0x4b243e;_0x2bc303[_0x885e('0x29')]=_[_0x885e('0x2b')](db[_0x885e('0x45')][_0x885e('0x27')]);_0x2bc303[_0x885e('0x2a')]=_[_0x885e('0x2b')](_0x573e4a[_0x885e('0x2a')]);_0x2bc303[_0x885e('0x34')]=_[_0x885e('0x2c')](_0x2bc303[_0x885e('0x29')],_0x2bc303[_0x885e('0x2a')]);_0x5cc27b[_0x885e('0x2d')]=_[_0x885e('0x2c')](_0x2bc303[_0x885e('0x29')],qs[_0x885e('0x2e')](_0x573e4a[_0x885e('0x2a')][_0x885e('0x2e')]));_0x5cc27b[_0x885e('0x2d')]=_0x5cc27b[_0x885e('0x2d')][_0x885e('0x2f')]?_0x5cc27b[_0x885e('0x2d')]:_0x2bc303[_0x885e('0x29')];_0x5cc27b[_0x885e('0x46')]=qs[_0x885e('0x32')](_0x573e4a[_0x885e('0x2a')][_0x885e('0x32')]);_0x5cc27b[_0x885e('0x33')]=qs[_0x885e('0x34')](_[_0x885e('0x47')](_0x573e4a['query'],_0x2bc303[_0x885e('0x34')]));if(_0x573e4a['query']['filter']){_0x5cc27b['where']=_[_0x885e('0x36')](_0x5cc27b[_0x885e('0x33')],{'$or':_[_0x885e('0x26')](_0x5cc27b[_0x885e('0x2d')],function(_0x554185){var _0xc1d6a7={};_0xc1d6a7[_0x554185]={'$like':'%'+_0x573e4a[_0x885e('0x2a')][_0x885e('0x35')]+'%'};return _0xc1d6a7;})});}_0x5cc27b=_[_0x885e('0x36')]({},_0x5cc27b,_0x573e4a[_0x885e('0x39')]);return _0x11ac39[_0x885e('0x48')](_0x5cc27b);}})['then'](function(_0x4eb244){if(_0x4eb244){_0x1858f6=_0x4eb244[_0x885e('0x2f')];if(!_0x573e4a[_0x885e('0x2a')]['hasOwnProperty'](_0x885e('0x31'))){_0x5cc27b[_0x885e('0x19')]=qs['limit'](_0x573e4a[_0x885e('0x2a')][_0x885e('0x19')]);_0x5cc27b[_0x885e('0x17')]=qs[_0x885e('0x17')](_0x573e4a[_0x885e('0x2a')][_0x885e('0x17')]);}return _0x11ac39[_0x885e('0x48')](_0x5cc27b);}})[_0x885e('0x1f')](function(_0x4c9736){if(_0x4c9736){return _0x4c9736?{'count':_0x1858f6,'rows':_0x4c9736}:null;}})['then'](respondWithResult(_0x41067a,null))[_0x885e('0x3d')](handleError(_0x41067a,null));};exports[_0x885e('0x49')]=function(_0x596266,_0x4594bc,_0x2866c8){var _0x10fb50={};var _0x837e60={};var _0x2f9698;var _0x756d9a;return db[_0x885e('0x3a')]['findOne']({'where':{'id':_0x596266[_0x885e('0x3f')]['id']}})[_0x885e('0x1f')](handleEntityNotFound(_0x4594bc,null))[_0x885e('0x1f')](function(_0xc322f5){if(_0xc322f5){_0x2f9698=_0xc322f5;_0x837e60[_0x885e('0x29')]=_['keys'](db['ServicenowField'][_0x885e('0x27')]);_0x837e60[_0x885e('0x2a')]=_['keys'](_0x596266[_0x885e('0x2a')]);_0x837e60[_0x885e('0x34')]=_['intersection'](_0x837e60['model'],_0x837e60[_0x885e('0x2a')]);_0x10fb50[_0x885e('0x2d')]=_[_0x885e('0x2c')](_0x837e60[_0x885e('0x29')],qs[_0x885e('0x2e')](_0x596266[_0x885e('0x2a')][_0x885e('0x2e')]));_0x10fb50[_0x885e('0x2d')]=_0x10fb50[_0x885e('0x2d')][_0x885e('0x2f')]?_0x10fb50[_0x885e('0x2d')]:_0x837e60['model'];_0x10fb50[_0x885e('0x46')]=qs[_0x885e('0x32')](_0x596266[_0x885e('0x2a')][_0x885e('0x32')]);_0x10fb50['where']=qs[_0x885e('0x34')](_[_0x885e('0x47')](_0x596266[_0x885e('0x2a')],_0x837e60[_0x885e('0x34')]));if(_0x596266[_0x885e('0x2a')][_0x885e('0x35')]){_0x10fb50[_0x885e('0x33')]=_[_0x885e('0x36')](_0x10fb50[_0x885e('0x33')],{'$or':_['map'](_0x10fb50[_0x885e('0x2d')],function(_0x4460a5){var _0x5ba403={};_0x5ba403[_0x4460a5]={'$like':'%'+_0x596266['query'][_0x885e('0x35')]+'%'};return _0x5ba403;})});}_0x10fb50=_['merge']({},_0x10fb50,_0x596266[_0x885e('0x39')]);return _0x2f9698[_0x885e('0x49')](_0x10fb50);}})[_0x885e('0x1f')](function(_0xe6817e){if(_0xe6817e){_0x756d9a=_0xe6817e['length'];if(!_0x596266[_0x885e('0x2a')][_0x885e('0x30')](_0x885e('0x31'))){_0x10fb50[_0x885e('0x19')]=qs[_0x885e('0x19')](_0x596266['query'][_0x885e('0x19')]);_0x10fb50[_0x885e('0x17')]=qs[_0x885e('0x17')](_0x596266[_0x885e('0x2a')][_0x885e('0x17')]);}return _0x2f9698[_0x885e('0x49')](_0x10fb50);}})[_0x885e('0x1f')](function(_0x4fa234){if(_0x4fa234){return _0x4fa234?{'count':_0x756d9a,'rows':_0x4fa234}:null;}})[_0x885e('0x1f')](respondWithResult(_0x4594bc,null))[_0x885e('0x3d')](handleError(_0x4594bc,null));};exports[_0x885e('0x4a')]=function(_0x596ef5,_0x352d92,_0x30038b){var _0x5d6564={};var _0x2bf42c={};var _0x51be14;var _0xac6dd7;return db['ServicenowConfiguration'][_0x885e('0x44')]({'where':{'id':_0x596ef5[_0x885e('0x3f')]['id']}})[_0x885e('0x1f')](handleEntityNotFound(_0x352d92,null))['then'](function(_0x3704af){if(_0x3704af){_0x51be14=_0x3704af;_0x2bf42c[_0x885e('0x29')]=_[_0x885e('0x2b')](db[_0x885e('0x45')][_0x885e('0x27')]);_0x2bf42c['query']=_['keys'](_0x596ef5[_0x885e('0x2a')]);_0x2bf42c['filters']=_[_0x885e('0x2c')](_0x2bf42c['model'],_0x2bf42c[_0x885e('0x2a')]);_0x5d6564[_0x885e('0x2d')]=_[_0x885e('0x2c')](_0x2bf42c[_0x885e('0x29')],qs[_0x885e('0x2e')](_0x596ef5[_0x885e('0x2a')][_0x885e('0x2e')]));_0x5d6564[_0x885e('0x2d')]=_0x5d6564[_0x885e('0x2d')][_0x885e('0x2f')]?_0x5d6564[_0x885e('0x2d')]:_0x2bf42c[_0x885e('0x29')];_0x5d6564[_0x885e('0x46')]=qs[_0x885e('0x32')](_0x596ef5[_0x885e('0x2a')][_0x885e('0x32')]);_0x5d6564['where']=qs[_0x885e('0x34')](_[_0x885e('0x47')](_0x596ef5[_0x885e('0x2a')],_0x2bf42c[_0x885e('0x34')]));if(_0x596ef5[_0x885e('0x2a')][_0x885e('0x35')]){_0x5d6564[_0x885e('0x33')]=_[_0x885e('0x36')](_0x5d6564[_0x885e('0x33')],{'$or':_[_0x885e('0x26')](_0x5d6564['attributes'],function(_0x8253bf){var _0x99d4ec={};_0x99d4ec[_0x8253bf]={'$like':'%'+_0x596ef5[_0x885e('0x2a')]['filter']+'%'};return _0x99d4ec;})});}_0x5d6564=_[_0x885e('0x36')]({},_0x5d6564,_0x596ef5['options']);return _0x51be14[_0x885e('0x4a')](_0x5d6564);}})[_0x885e('0x1f')](function(_0x41ee19){if(_0x41ee19){_0xac6dd7=_0x41ee19[_0x885e('0x2f')];if(!_0x596ef5['query'][_0x885e('0x30')](_0x885e('0x31'))){_0x5d6564[_0x885e('0x19')]=qs[_0x885e('0x19')](_0x596ef5['query'][_0x885e('0x19')]);_0x5d6564[_0x885e('0x17')]=qs['offset'](_0x596ef5['query'][_0x885e('0x17')]);}return _0x51be14[_0x885e('0x4a')](_0x5d6564);}})[_0x885e('0x1f')](function(_0x50c8eb){if(_0x50c8eb){return _0x50c8eb?{'count':_0xac6dd7,'rows':_0x50c8eb}:null;}})['then'](respondWithResult(_0x352d92,null))[_0x885e('0x3d')](handleError(_0x352d92,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index b8e8b08..949ebe0 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 _0xb1fa=['./intServicenowConfiguration.attributes','define','int_servicenow_configurations','../../config/logger','moment'];(function(_0x123d91,_0x511da7){var _0x1f9d90=function(_0x49560a){while(--_0x49560a){_0x123d91['push'](_0x123d91['shift']());}};_0x1f9d90(++_0x511da7);}(_0xb1fa,0x9e));var _0xab1f=function(_0x2ddff1,_0x4b135d){_0x2ddff1=_0x2ddff1-0x0;var _0x5232e0=_0xb1fa[_0x2ddff1];return _0x5232e0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab1f('0x0'))('api');var moment=require(_0xab1f('0x1'));var BPromise=require('bluebird');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(_0xab1f('0x2'));module['exports']=function(_0x50ada8,_0x4ee73b){return _0x50ada8[_0xab1f('0x3')]('ServicenowConfiguration',attributes,{'tableName':_0xab1f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85f8=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x53e6f2,_0x5e87ce){var _0xb45883=function(_0xa0ea91){while(--_0xa0ea91){_0x53e6f2['push'](_0x53e6f2['shift']());}};_0xb45883(++_0x5e87ce);}(_0x85f8,0xd7));var _0x885f=function(_0x1337ed,_0x3c321d){_0x1337ed=_0x1337ed-0x0;var _0x3677cb=_0x85f8[_0x1337ed];return _0x3677cb;};'use strict';var _=require(_0x885f('0x0'));var util=require(_0x885f('0x1'));var logger=require(_0x885f('0x2'))(_0x885f('0x3'));var moment=require(_0x885f('0x4'));var BPromise=require(_0x885f('0x5'));var rp=require(_0x885f('0x6'));var fs=require('fs');var path=require(_0x885f('0x7'));var rimraf=require('rimraf');var config=require(_0x885f('0x8'));var attributes=require(_0x885f('0x9'));module[_0x885f('0xa')]=function(_0x52404d,_0x3800c6){return _0x52404d[_0x885f('0xb')](_0x885f('0xc'),attributes,{'tableName':_0x885f('0xd'),'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 52ae5bf..363f53d 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 _0xb1fc=['ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xb1fc,0xb3));var _0xcb1f=function(_0x1bb8ec,_0x429b95){_0x1bb8ec=_0x1bb8ec-0x0;var _0x5f1b72=_0xb1fc[_0x1bb8ec];return _0x5f1b72;};'use strict';var _=require(_0xcb1f('0x0'));var util=require(_0xcb1f('0x1'));var moment=require('moment');var BPromise=require(_0xcb1f('0x2'));var rs=require(_0xcb1f('0x3'));var fs=require('fs');var Redis=require(_0xcb1f('0x4'));var db=require(_0xcb1f('0x5'))['db'];var utils=require(_0xcb1f('0x6'));var logger=require(_0xcb1f('0x7'))(_0xcb1f('0x8'));var config=require(_0xcb1f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcb1f('0xa')][_0xcb1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fcf0c,_0x348b02,_0x372433){return new BPromise(function(_0x3a79cb,_0x44281a){return client[_0xcb1f('0xc')](_0x2fcf0c,_0x372433)['then'](function(_0x423aac){logger['info'](_0xcb1f('0xd'),_0x348b02,'request\x20sent');logger[_0xcb1f('0xe')](_0xcb1f('0xf'),_0x348b02,_0xcb1f('0x10'),JSON[_0xcb1f('0x11')](_0x423aac));if(_0x423aac[_0xcb1f('0x12')]){if(_0x423aac[_0xcb1f('0x12')][_0xcb1f('0x13')]===0x1f4){logger[_0xcb1f('0x12')](_0xcb1f('0xd'),_0x348b02,_0x423aac['error'][_0xcb1f('0x14')]);return _0x44281a(_0x423aac[_0xcb1f('0x12')][_0xcb1f('0x14')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x348b02,_0x423aac[_0xcb1f('0x12')][_0xcb1f('0x14')]);return _0x3a79cb(_0x423aac[_0xcb1f('0x12')]['message']);}else{logger[_0xcb1f('0x15')](_0xcb1f('0xd'),_0x348b02,'request\x20sent');_0x3a79cb(_0x423aac[_0xcb1f('0x16')]['message']);}})[_0xcb1f('0x17')](function(_0x1e5873){logger[_0xcb1f('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x348b02,_0x1e5873);_0x44281a(_0x1e5873);});});} \ No newline at end of file +var _0xc00e=['error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc00e,0xe1));var _0xec00=function(_0x5e90f4,_0xa3ce1d){_0x5e90f4=_0x5e90f4-0x0;var _0x56613a=_0xc00e[_0x5e90f4];return _0x56613a;};'use strict';var _=require(_0xec00('0x0'));var util=require(_0xec00('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xec00('0x2'));var fs=require('fs');var Redis=require(_0xec00('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xec00('0x4'))('rpc');var config=require(_0xec00('0x5'));var jayson=require(_0xec00('0x6'));var client=jayson[_0xec00('0x7')][_0xec00('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x743aa3,_0x5e33c3,_0x5791b1){return new BPromise(function(_0x545cbc,_0xf45578){return client[_0xec00('0x9')](_0x743aa3,_0x5791b1)[_0xec00('0xa')](function(_0x1e3b7c){logger[_0xec00('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5e33c3,_0xec00('0xc'));logger['debug'](_0xec00('0xd'),_0x5e33c3,_0xec00('0xc'),JSON[_0xec00('0xe')](_0x1e3b7c));if(_0x1e3b7c['error']){if(_0x1e3b7c[_0xec00('0xf')][_0xec00('0x10')]===0x1f4){logger['error'](_0xec00('0x11'),_0x5e33c3,_0x1e3b7c[_0xec00('0xf')][_0xec00('0x12')]);return _0xf45578(_0x1e3b7c[_0xec00('0xf')][_0xec00('0x12')]);}logger[_0xec00('0xf')](_0xec00('0x11'),_0x5e33c3,_0x1e3b7c[_0xec00('0xf')][_0xec00('0x12')]);return _0x545cbc(_0x1e3b7c[_0xec00('0xf')]['message']);}else{logger[_0xec00('0xb')](_0xec00('0x11'),_0x5e33c3,'request\x20sent');_0x545cbc(_0x1e3b7c[_0xec00('0x13')][_0xec00('0x12')]);}})['catch'](function(_0x5441bd){logger[_0xec00('0xf')](_0xec00('0x11'),_0x5e33c3,_0x5441bd);_0xf45578(_0x5441bd);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 9942e35..fc1e354 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 _0xb97f=['../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','Router','../../components/auth/service'];(function(_0x1b1e9c,_0x5c77d8){var _0x5de36a=function(_0x39a0cb){while(--_0x39a0cb){_0x1b1e9c['push'](_0x1b1e9c['shift']());}};_0x5de36a(++_0x5c77d8);}(_0xb97f,0x12d));var _0xfb97=function(_0x18c32e,_0x1ffd75){_0x18c32e=_0x18c32e-0x0;var _0xfc3c5=_0xb97f[_0x18c32e];return _0xfc3c5;};'use strict';var multer=require('multer');var util=require(_0xfb97('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfb97('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xfb97('0x2'));var interaction=require(_0xfb97('0x3'));var config=require('../../config/environment');var controller=require(_0xfb97('0x4'));router[_0xfb97('0x5')]('/',auth[_0xfb97('0x6')](),controller[_0xfb97('0x7')]);router[_0xfb97('0x5')](_0xfb97('0x8'),auth['isAuthenticated'](),controller[_0xfb97('0x9')]);router[_0xfb97('0xa')]('/',auth[_0xfb97('0x6')](),controller[_0xfb97('0xb')]);router[_0xfb97('0xc')](_0xfb97('0x8'),auth[_0xfb97('0x6')](),controller['update']);router[_0xfb97('0xd')]('/:id',auth[_0xfb97('0x6')](),controller[_0xfb97('0xe')]);module[_0xfb97('0xf')]=router; \ No newline at end of file +var _0x7246=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','show','post','update','destroy','exports'];(function(_0x552c49,_0xecf1a8){var _0x1cdc85=function(_0x5d9566){while(--_0x5d9566){_0x552c49['push'](_0x552c49['shift']());}};_0x1cdc85(++_0xecf1a8);}(_0x7246,0xc6));var _0x6724=function(_0x10e7d9,_0x217ead){_0x10e7d9=_0x10e7d9-0x0;var _0x2e0ba5=_0x7246[_0x10e7d9];return _0x2e0ba5;};'use strict';var multer=require(_0x6724('0x0'));var util=require('util');var path=require(_0x6724('0x1'));var timeout=require(_0x6724('0x2'));var express=require('express');var router=express[_0x6724('0x3')]();var fs_extra=require(_0x6724('0x4'));var auth=require(_0x6724('0x5'));var interaction=require(_0x6724('0x6'));var config=require(_0x6724('0x7'));var controller=require(_0x6724('0x8'));router['get']('/',auth[_0x6724('0x9')](),controller[_0x6724('0xa')]);router[_0x6724('0xb')](_0x6724('0xc'),auth[_0x6724('0x9')](),controller[_0x6724('0xd')]);router[_0x6724('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6724('0xc'),auth[_0x6724('0x9')](),controller[_0x6724('0xf')]);router['delete'](_0x6724('0xc'),auth[_0x6724('0x9')](),controller[_0x6724('0x10')]);module[_0x6724('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index e3def25..6444bfe 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 _0x3990=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3ee7e4,_0x304097){var _0x1aec5e=function(_0x5ec005){while(--_0x5ec005){_0x3ee7e4['push'](_0x3ee7e4['shift']());}};_0x1aec5e(++_0x304097);}(_0x3990,0x14a));var _0x0399=function(_0x49965d,_0x11f614){_0x49965d=_0x49965d-0x0;var _0x46e0ae=_0x3990[_0x49965d];return _0x46e0ae;};'use strict';var Sequelize=require(_0x0399('0x0'));module[_0x0399('0x1')]={'type':{'type':Sequelize[_0x0399('0x2')](_0x0399('0x3'),_0x0399('0x4'),_0x0399('0x5'),'keyValue',_0x0399('0x6')),'defaultValue':_0x0399('0x3')},'content':{'type':Sequelize[_0x0399('0x7')]},'key':{'type':Sequelize[_0x0399('0x7')]},'keyType':{'type':Sequelize[_0x0399('0x2')](_0x0399('0x3'),_0x0399('0x4'),_0x0399('0x5'))},'keyContent':{'type':Sequelize[_0x0399('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0399('0x7')]},'customField':{'type':Sequelize[_0x0399('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7d8c=['exports','ENUM','variable','keyValue','picklist','string','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x5c73c8,_0x34d882){var _0x5dcf7e=function(_0x59857f){while(--_0x59857f){_0x5c73c8['push'](_0x5c73c8['shift']());}};_0x5dcf7e(++_0x34d882);}(_0x7d8c,0x121));var _0xc7d8=function(_0x175f6f,_0x4561fe){_0x175f6f=_0x175f6f-0x0;var _0x5a9bc4=_0x7d8c[_0x175f6f];return _0x5a9bc4;};'use strict';var Sequelize=require(_0xc7d8('0x0'));module[_0xc7d8('0x1')]={'type':{'type':Sequelize[_0xc7d8('0x2')]('string',_0xc7d8('0x3'),'customVariable',_0xc7d8('0x4'),_0xc7d8('0x5')),'defaultValue':_0xc7d8('0x6')},'content':{'type':Sequelize[_0xc7d8('0x7')]},'key':{'type':Sequelize[_0xc7d8('0x7')]},'keyType':{'type':Sequelize[_0xc7d8('0x2')](_0xc7d8('0x6'),_0xc7d8('0x3'),_0xc7d8('0x8'))},'keyContent':{'type':Sequelize[_0xc7d8('0x7')]},'idField':{'type':Sequelize[_0xc7d8('0x7')]},'nameField':{'type':Sequelize[_0xc7d8('0x7')]},'customField':{'type':Sequelize[_0xc7d8('0x9')],'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 9780eeb..87a4137 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 _0x0c96=['order','sort','where','filter','merge','VIRTUAL','options','ServicenowField','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x7c326a,_0x54361e){var _0x2a64ba=function(_0xc9f2c5){while(--_0xc9f2c5){_0x7c326a['push'](_0x7c326a['shift']());}};_0x2a64ba(++_0x54361e);}(_0x0c96,0x131));var _0x60c9=function(_0x2aa395,_0xd33991){_0x2aa395=_0x2aa395-0x0;var _0x2efa31=_0x0c96[_0x2aa395];return _0x2efa31;};'use strict';var emlformat=require(_0x60c9('0x0'));var rimraf=require(_0x60c9('0x1'));var zipdir=require(_0x60c9('0x2'));var jsonpatch=require(_0x60c9('0x3'));var rp=require(_0x60c9('0x4'));var moment=require('moment');var BPromise=require(_0x60c9('0x5'));var Mustache=require(_0x60c9('0x6'));var util=require(_0x60c9('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x60c9('0x8'));var ejs=require(_0x60c9('0x9'));var fs=require('fs');var fs_extra=require(_0x60c9('0xa'));var _=require(_0x60c9('0xb'));var squel=require(_0x60c9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x60c9('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x60c9('0xe'));var Redis=require(_0x60c9('0xf'));var authService=require(_0x60c9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x60c9('0x11'));var hardwareService=require(_0x60c9('0x12'));var logger=require(_0x60c9('0x13'))(_0x60c9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x60c9('0x15'));var db=require(_0x60c9('0x16'))['db'];function respondWithStatusCode(_0x1334cf,_0x3a32e4){_0x3a32e4=_0x3a32e4||0xcc;return function(_0x2ba9c7){if(_0x2ba9c7){return _0x1334cf[_0x60c9('0x17')](_0x3a32e4);}return _0x1334cf[_0x60c9('0x18')](_0x3a32e4)[_0x60c9('0x19')]();};}function respondWithResult(_0x3ed6d9,_0xbf47bc){_0xbf47bc=_0xbf47bc||0xc8;return function(_0x542c9a){if(_0x542c9a){return _0x3ed6d9[_0x60c9('0x18')](_0xbf47bc)[_0x60c9('0x1a')](_0x542c9a);}};}function respondWithFilteredResult(_0x435fe3,_0x58714f){return function(_0x2905ee){if(_0x2905ee){var _0xe61068=typeof _0x58714f[_0x60c9('0x1b')]===_0x60c9('0x1c')&&typeof _0x58714f['limit']===_0x60c9('0x1c');var _0x543bbc=_0x2905ee['count'];var _0x2e3b69=_0xe61068?0x0:_0x58714f[_0x60c9('0x1b')];var _0x237363=_0xe61068?_0x2905ee[_0x60c9('0x1d')]:_0x58714f[_0x60c9('0x1b')]+_0x58714f['limit'];var _0x5161c7;if(_0x237363>=_0x543bbc){_0x237363=_0x543bbc;_0x5161c7=0xc8;}else{_0x5161c7=0xce;}_0x435fe3[_0x60c9('0x18')](_0x5161c7);return _0x435fe3[_0x60c9('0x1e')]('Content-Range',_0x2e3b69+'-'+_0x237363+'/'+_0x543bbc)['json'](_0x2905ee);}return null;};}function patchUpdates(_0x4a3505){return function(_0x1b8139){try{jsonpatch[_0x60c9('0x1f')](_0x1b8139,_0x4a3505,!![]);}catch(_0x47d65b){return BPromise['reject'](_0x47d65b);}return _0x1b8139['save']();};}function saveUpdates(_0x754a8,_0x21ed62){return function(_0x46ac87){if(_0x46ac87){return _0x46ac87[_0x60c9('0x20')](_0x754a8)['then'](function(_0x1f0374){return _0x1f0374;});}return null;};}function removeEntity(_0x1ba3a9,_0x331f1a){return function(_0x279ce8){if(_0x279ce8){return _0x279ce8[_0x60c9('0x21')]()[_0x60c9('0x22')](function(){_0x1ba3a9['status'](0xcc)[_0x60c9('0x19')]();});}};}function handleEntityNotFound(_0x46354e,_0x5789f4){return function(_0x4415fb){if(!_0x4415fb){_0x46354e['sendStatus'](0x194);}return _0x4415fb;};}function handleError(_0x3d0e81,_0x297532){_0x297532=_0x297532||0x1f4;return function(_0x45ebc0){logger[_0x60c9('0x23')](_0x45ebc0[_0x60c9('0x24')]);if(_0x45ebc0[_0x60c9('0x25')]){delete _0x45ebc0[_0x60c9('0x25')];}_0x3d0e81[_0x60c9('0x18')](_0x297532)['send'](_0x45ebc0);};}exports[_0x60c9('0x26')]=function(_0x53df63,_0xee9852){var _0x4ba2dc={},_0xe4e2eb={},_0x2f0281={'count':0x0,'rows':[]};var _0x2b6489=_[_0x60c9('0x27')](db['ServicenowField'][_0x60c9('0x28')],function(_0x5c9db9){return{'name':_0x5c9db9[_0x60c9('0x29')],'type':_0x5c9db9[_0x60c9('0x2a')][_0x60c9('0x2b')]};});_0xe4e2eb[_0x60c9('0x2c')]=_[_0x60c9('0x27')](_0x2b6489,_0x60c9('0x25'));_0xe4e2eb[_0x60c9('0x2d')]=_[_0x60c9('0x2e')](_0x53df63[_0x60c9('0x2d')]);_0xe4e2eb[_0x60c9('0x2f')]=_['intersection'](_0xe4e2eb[_0x60c9('0x2c')],_0xe4e2eb[_0x60c9('0x2d')]);_0x4ba2dc[_0x60c9('0x30')]=_[_0x60c9('0x31')](_0xe4e2eb[_0x60c9('0x2c')],qs[_0x60c9('0x32')](_0x53df63['query'][_0x60c9('0x32')]));_0x4ba2dc[_0x60c9('0x30')]=_0x4ba2dc['attributes'][_0x60c9('0x33')]?_0x4ba2dc[_0x60c9('0x30')]:_0xe4e2eb[_0x60c9('0x2c')];if(!_0x53df63[_0x60c9('0x2d')][_0x60c9('0x34')](_0x60c9('0x35'))){_0x4ba2dc[_0x60c9('0x36')]=qs[_0x60c9('0x36')](_0x53df63[_0x60c9('0x2d')][_0x60c9('0x36')]);_0x4ba2dc[_0x60c9('0x1b')]=qs[_0x60c9('0x1b')](_0x53df63['query']['offset']);}_0x4ba2dc[_0x60c9('0x37')]=qs['sort'](_0x53df63[_0x60c9('0x2d')][_0x60c9('0x38')]);_0x4ba2dc[_0x60c9('0x39')]=qs[_0x60c9('0x2f')](_['pick'](_0x53df63[_0x60c9('0x2d')],_0xe4e2eb[_0x60c9('0x2f')]),_0x2b6489);if(_0x53df63['query'][_0x60c9('0x3a')]){_0x4ba2dc[_0x60c9('0x39')]=_[_0x60c9('0x3b')](_0x4ba2dc[_0x60c9('0x39')],{'$or':_[_0x60c9('0x27')](_0x2b6489,function(_0x5ed06c){if(_0x5ed06c[_0x60c9('0x2a')]!==_0x60c9('0x3c')){var _0x2e9def={};_0x2e9def[_0x5ed06c[_0x60c9('0x25')]]={'$like':'%'+_0x53df63['query'][_0x60c9('0x3a')]+'%'};return _0x2e9def;}})});}_0x4ba2dc=_[_0x60c9('0x3b')]({},_0x4ba2dc,_0x53df63[_0x60c9('0x3d')]);var _0x124e4c={'where':_0x4ba2dc[_0x60c9('0x39')]};return db[_0x60c9('0x3e')][_0x60c9('0x1d')](_0x124e4c)[_0x60c9('0x22')](function(_0x52e4c7){_0x2f0281[_0x60c9('0x1d')]=_0x52e4c7;if(_0x53df63[_0x60c9('0x2d')][_0x60c9('0x3f')]){_0x4ba2dc[_0x60c9('0x40')]=[{'all':!![]}];}return db[_0x60c9('0x3e')]['findAll'](_0x4ba2dc);})[_0x60c9('0x22')](function(_0x5277cc){_0x2f0281[_0x60c9('0x41')]=_0x5277cc;return _0x2f0281;})[_0x60c9('0x22')](respondWithFilteredResult(_0xee9852,_0x4ba2dc))[_0x60c9('0x42')](handleError(_0xee9852,null));};exports[_0x60c9('0x43')]=function(_0x4b6dc0,_0x4afb4f){var _0x55a422={'raw':!![],'where':{'id':_0x4b6dc0[_0x60c9('0x44')]['id']}},_0x332713={};_0x332713['model']=_[_0x60c9('0x2e')](db[_0x60c9('0x3e')][_0x60c9('0x28')]);_0x332713[_0x60c9('0x2d')]=_['keys'](_0x4b6dc0[_0x60c9('0x2d')]);_0x332713[_0x60c9('0x2f')]=_[_0x60c9('0x31')](_0x332713['model'],_0x332713[_0x60c9('0x2d')]);_0x55a422[_0x60c9('0x30')]=_[_0x60c9('0x31')](_0x332713[_0x60c9('0x2c')],qs['fields'](_0x4b6dc0[_0x60c9('0x2d')][_0x60c9('0x32')]));_0x55a422[_0x60c9('0x30')]=_0x55a422[_0x60c9('0x30')][_0x60c9('0x33')]?_0x55a422[_0x60c9('0x30')]:_0x332713['model'];if(_0x4b6dc0[_0x60c9('0x2d')][_0x60c9('0x3f')]){_0x55a422['include']=[{'all':!![]}];}_0x55a422=_['merge']({},_0x55a422,_0x4b6dc0[_0x60c9('0x3d')]);return db[_0x60c9('0x3e')][_0x60c9('0x45')](_0x55a422)['then'](handleEntityNotFound(_0x4afb4f,null))['then'](respondWithResult(_0x4afb4f,null))['catch'](handleError(_0x4afb4f,null));};exports[_0x60c9('0x46')]=function(_0x495a21,_0x4a7770){return db[_0x60c9('0x3e')][_0x60c9('0x46')](_0x495a21[_0x60c9('0x47')],{})[_0x60c9('0x22')](respondWithResult(_0x4a7770,0xc9))['catch'](handleError(_0x4a7770,null));};exports['update']=function(_0x4b2d2e,_0x4be57f){if(_0x4b2d2e[_0x60c9('0x47')]['id']){delete _0x4b2d2e['body']['id'];}return db[_0x60c9('0x3e')][_0x60c9('0x45')]({'where':{'id':_0x4b2d2e[_0x60c9('0x44')]['id']}})[_0x60c9('0x22')](handleEntityNotFound(_0x4be57f,null))['then'](saveUpdates(_0x4b2d2e['body'],null))[_0x60c9('0x22')](respondWithResult(_0x4be57f,null))[_0x60c9('0x42')](handleError(_0x4be57f,null));};exports[_0x60c9('0x21')]=function(_0x506efb,_0x1b43d3){return db[_0x60c9('0x3e')][_0x60c9('0x45')]({'where':{'id':_0x506efb[_0x60c9('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b43d3,null))[_0x60c9('0x22')](removeEntity(_0x1b43d3,null))[_0x60c9('0x42')](handleError(_0x1b43d3,null));}; \ No newline at end of file +var _0xc0bc=['includeAll','include','findAll','rows','catch','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','type','options','ServicenowField'];(function(_0x30cfdc,_0x5a0260){var _0x54e0ac=function(_0x5497d3){while(--_0x5497d3){_0x30cfdc['push'](_0x30cfdc['shift']());}};_0x54e0ac(++_0x5a0260);}(_0xc0bc,0xee));var _0xcc0b=function(_0xc4b67f,_0x2539ac){_0xc4b67f=_0xc4b67f-0x0;var _0x361aed=_0xc0bc[_0xc4b67f];return _0x361aed;};'use strict';var emlformat=require(_0xcc0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc0b('0x1'));var jsonpatch=require(_0xcc0b('0x2'));var rp=require(_0xcc0b('0x3'));var moment=require('moment');var BPromise=require(_0xcc0b('0x4'));var Mustache=require(_0xcc0b('0x5'));var util=require(_0xcc0b('0x6'));var path=require('path');var sox=require(_0xcc0b('0x7'));var csv=require('to-csv');var ejs=require(_0xcc0b('0x8'));var fs=require('fs');var fs_extra=require(_0xcc0b('0x9'));var _=require(_0xcc0b('0xa'));var squel=require(_0xcc0b('0xb'));var crypto=require(_0xcc0b('0xc'));var jsforce=require(_0xcc0b('0xd'));var deskjs=require(_0xcc0b('0xe'));var toCsv=require(_0xcc0b('0xf'));var querystring=require(_0xcc0b('0x10'));var Papa=require(_0xcc0b('0x11'));var Redis=require(_0xcc0b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcc0b('0x13'));var as=require(_0xcc0b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc0b('0x15'))('api');var utils=require(_0xcc0b('0x16'));var config=require(_0xcc0b('0x17'));var licenseUtil=require(_0xcc0b('0x18'));var db=require(_0xcc0b('0x19'))['db'];function respondWithStatusCode(_0x4b0626,_0xc4b4f2){_0xc4b4f2=_0xc4b4f2||0xcc;return function(_0x5cebc3){if(_0x5cebc3){return _0x4b0626[_0xcc0b('0x1a')](_0xc4b4f2);}return _0x4b0626[_0xcc0b('0x1b')](_0xc4b4f2)[_0xcc0b('0x1c')]();};}function respondWithResult(_0x3ad862,_0x249ae7){_0x249ae7=_0x249ae7||0xc8;return function(_0x496bc5){if(_0x496bc5){return _0x3ad862[_0xcc0b('0x1b')](_0x249ae7)[_0xcc0b('0x1d')](_0x496bc5);}};}function respondWithFilteredResult(_0x372457,_0x380a81){return function(_0x161214){if(_0x161214){var _0x1157b5=typeof _0x380a81['offset']==='undefined'&&typeof _0x380a81[_0xcc0b('0x1e')]===_0xcc0b('0x1f');var _0x44aab9=_0x161214['count'];var _0x313d22=_0x1157b5?0x0:_0x380a81[_0xcc0b('0x20')];var _0x36bbbe=_0x1157b5?_0x161214[_0xcc0b('0x21')]:_0x380a81[_0xcc0b('0x20')]+_0x380a81[_0xcc0b('0x1e')];var _0x4fc016;if(_0x36bbbe>=_0x44aab9){_0x36bbbe=_0x44aab9;_0x4fc016=0xc8;}else{_0x4fc016=0xce;}_0x372457[_0xcc0b('0x1b')](_0x4fc016);return _0x372457['set'](_0xcc0b('0x22'),_0x313d22+'-'+_0x36bbbe+'/'+_0x44aab9)[_0xcc0b('0x1d')](_0x161214);}return null;};}function patchUpdates(_0x2cc4ce){return function(_0x5139d9){try{jsonpatch[_0xcc0b('0x23')](_0x5139d9,_0x2cc4ce,!![]);}catch(_0x594dd2){return BPromise[_0xcc0b('0x24')](_0x594dd2);}return _0x5139d9[_0xcc0b('0x25')]();};}function saveUpdates(_0xb0e1e7,_0x1f554b){return function(_0x20bf75){if(_0x20bf75){return _0x20bf75['update'](_0xb0e1e7)[_0xcc0b('0x26')](function(_0x2769c8){return _0x2769c8;});}return null;};}function removeEntity(_0x19e165,_0xa634d7){return function(_0x2b73bf){if(_0x2b73bf){return _0x2b73bf[_0xcc0b('0x27')]()[_0xcc0b('0x26')](function(){_0x19e165[_0xcc0b('0x1b')](0xcc)[_0xcc0b('0x1c')]();});}};}function handleEntityNotFound(_0x4849df,_0xc8284b){return function(_0x51e6a0){if(!_0x51e6a0){_0x4849df[_0xcc0b('0x1a')](0x194);}return _0x51e6a0;};}function handleError(_0xaa48c6,_0x421f3c){_0x421f3c=_0x421f3c||0x1f4;return function(_0x40c04d){logger[_0xcc0b('0x28')](_0x40c04d[_0xcc0b('0x29')]);if(_0x40c04d[_0xcc0b('0x2a')]){delete _0x40c04d[_0xcc0b('0x2a')];}_0xaa48c6[_0xcc0b('0x1b')](_0x421f3c)[_0xcc0b('0x2b')](_0x40c04d);};}exports[_0xcc0b('0x2c')]=function(_0x25c601,_0x491a23){var _0x1cc064={},_0x125401={},_0x1661b2={'count':0x0,'rows':[]};var _0x554d8a=_[_0xcc0b('0x2d')](db['ServicenowField'][_0xcc0b('0x2e')],function(_0x1ae6ce){return{'name':_0x1ae6ce[_0xcc0b('0x2f')],'type':_0x1ae6ce['type']['key']};});_0x125401['model']=_[_0xcc0b('0x2d')](_0x554d8a,'name');_0x125401[_0xcc0b('0x30')]=_[_0xcc0b('0x31')](_0x25c601[_0xcc0b('0x30')]);_0x125401['filters']=_[_0xcc0b('0x32')](_0x125401[_0xcc0b('0x33')],_0x125401['query']);_0x1cc064[_0xcc0b('0x34')]=_[_0xcc0b('0x32')](_0x125401['model'],qs[_0xcc0b('0x35')](_0x25c601['query'][_0xcc0b('0x35')]));_0x1cc064[_0xcc0b('0x34')]=_0x1cc064[_0xcc0b('0x34')][_0xcc0b('0x36')]?_0x1cc064['attributes']:_0x125401[_0xcc0b('0x33')];if(!_0x25c601[_0xcc0b('0x30')]['hasOwnProperty'](_0xcc0b('0x37'))){_0x1cc064[_0xcc0b('0x1e')]=qs['limit'](_0x25c601['query']['limit']);_0x1cc064[_0xcc0b('0x20')]=qs['offset'](_0x25c601[_0xcc0b('0x30')][_0xcc0b('0x20')]);}_0x1cc064[_0xcc0b('0x38')]=qs[_0xcc0b('0x39')](_0x25c601[_0xcc0b('0x30')][_0xcc0b('0x39')]);_0x1cc064[_0xcc0b('0x3a')]=qs['filters'](_[_0xcc0b('0x3b')](_0x25c601[_0xcc0b('0x30')],_0x125401[_0xcc0b('0x3c')]),_0x554d8a);if(_0x25c601[_0xcc0b('0x30')][_0xcc0b('0x3d')]){_0x1cc064[_0xcc0b('0x3a')]=_[_0xcc0b('0x3e')](_0x1cc064[_0xcc0b('0x3a')],{'$or':_[_0xcc0b('0x2d')](_0x554d8a,function(_0x255a65){if(_0x255a65[_0xcc0b('0x3f')]!=='VIRTUAL'){var _0x13fa0b={};_0x13fa0b[_0x255a65[_0xcc0b('0x2a')]]={'$like':'%'+_0x25c601[_0xcc0b('0x30')][_0xcc0b('0x3d')]+'%'};return _0x13fa0b;}})});}_0x1cc064=_[_0xcc0b('0x3e')]({},_0x1cc064,_0x25c601[_0xcc0b('0x40')]);var _0x30f21e={'where':_0x1cc064[_0xcc0b('0x3a')]};return db[_0xcc0b('0x41')][_0xcc0b('0x21')](_0x30f21e)[_0xcc0b('0x26')](function(_0x417161){_0x1661b2[_0xcc0b('0x21')]=_0x417161;if(_0x25c601[_0xcc0b('0x30')][_0xcc0b('0x42')]){_0x1cc064[_0xcc0b('0x43')]=[{'all':!![]}];}return db[_0xcc0b('0x41')][_0xcc0b('0x44')](_0x1cc064);})['then'](function(_0x960fd9){_0x1661b2[_0xcc0b('0x45')]=_0x960fd9;return _0x1661b2;})[_0xcc0b('0x26')](respondWithFilteredResult(_0x491a23,_0x1cc064))[_0xcc0b('0x46')](handleError(_0x491a23,null));};exports['show']=function(_0x43a9ff,_0x392a2a){var _0x5f1310={'raw':!![],'where':{'id':_0x43a9ff[_0xcc0b('0x47')]['id']}},_0x251752={};_0x251752[_0xcc0b('0x33')]=_[_0xcc0b('0x31')](db[_0xcc0b('0x41')][_0xcc0b('0x2e')]);_0x251752['query']=_[_0xcc0b('0x31')](_0x43a9ff[_0xcc0b('0x30')]);_0x251752[_0xcc0b('0x3c')]=_['intersection'](_0x251752[_0xcc0b('0x33')],_0x251752[_0xcc0b('0x30')]);_0x5f1310[_0xcc0b('0x34')]=_['intersection'](_0x251752['model'],qs[_0xcc0b('0x35')](_0x43a9ff['query'][_0xcc0b('0x35')]));_0x5f1310[_0xcc0b('0x34')]=_0x5f1310[_0xcc0b('0x34')]['length']?_0x5f1310['attributes']:_0x251752[_0xcc0b('0x33')];if(_0x43a9ff[_0xcc0b('0x30')][_0xcc0b('0x42')]){_0x5f1310[_0xcc0b('0x43')]=[{'all':!![]}];}_0x5f1310=_[_0xcc0b('0x3e')]({},_0x5f1310,_0x43a9ff['options']);return db[_0xcc0b('0x41')][_0xcc0b('0x48')](_0x5f1310)[_0xcc0b('0x26')](handleEntityNotFound(_0x392a2a,null))[_0xcc0b('0x26')](respondWithResult(_0x392a2a,null))[_0xcc0b('0x46')](handleError(_0x392a2a,null));};exports[_0xcc0b('0x49')]=function(_0x570235,_0x7f6306){return db[_0xcc0b('0x41')]['create'](_0x570235[_0xcc0b('0x4a')],{})['then'](respondWithResult(_0x7f6306,0xc9))[_0xcc0b('0x46')](handleError(_0x7f6306,null));};exports[_0xcc0b('0x4b')]=function(_0x4592b3,_0x221f06){if(_0x4592b3[_0xcc0b('0x4a')]['id']){delete _0x4592b3[_0xcc0b('0x4a')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x4592b3[_0xcc0b('0x47')]['id']}})[_0xcc0b('0x26')](handleEntityNotFound(_0x221f06,null))[_0xcc0b('0x26')](saveUpdates(_0x4592b3['body'],null))[_0xcc0b('0x26')](respondWithResult(_0x221f06,null))['catch'](handleError(_0x221f06,null));};exports[_0xcc0b('0x27')]=function(_0x44d4d7,_0x1e6e7b){return db[_0xcc0b('0x41')][_0xcc0b('0x48')]({'where':{'id':_0x44d4d7[_0xcc0b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e6e7b,null))[_0xcc0b('0x26')](removeEntity(_0x1e6e7b,null))['catch'](handleError(_0x1e6e7b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index dfcdb4f..c7f3ce4 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 _0xa748=['define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intServicenowField.attributes'];(function(_0x4b0b3b,_0x2cabb4){var _0x243eec=function(_0x51af60){while(--_0x51af60){_0x4b0b3b['push'](_0x4b0b3b['shift']());}};_0x243eec(++_0x2cabb4);}(_0xa748,0xbb));var _0x8a74=function(_0x885c8a,_0x47960a){_0x885c8a=_0x885c8a-0x0;var _0x2624ae=_0xa748[_0x885c8a];return _0x2624ae;};'use strict';var _=require(_0x8a74('0x0'));var util=require(_0x8a74('0x1'));var logger=require(_0x8a74('0x2'))(_0x8a74('0x3'));var moment=require(_0x8a74('0x4'));var BPromise=require(_0x8a74('0x5'));var rp=require(_0x8a74('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a74('0x7'));var config=require('../../config/environment');var attributes=require(_0x8a74('0x8'));module['exports']=function(_0x1d5b48,_0x25c238){return _0x1d5b48[_0x8a74('0x9')](_0x8a74('0xa'),attributes,{'tableName':_0x8a74('0xb'),'paranoid':![],'indexes':[{'name':_0x8a74('0xc'),'fields':['idField',_0x8a74('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a1c=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields'];(function(_0x1ada4f,_0x1ad6fe){var _0x5336ca=function(_0x41bad2){while(--_0x41bad2){_0x1ada4f['push'](_0x1ada4f['shift']());}};_0x5336ca(++_0x1ad6fe);}(_0x9a1c,0xec));var _0xc9a1=function(_0x3cd803,_0x1dd6ef){_0x3cd803=_0x3cd803-0x0;var _0x46f497=_0x9a1c[_0x3cd803];return _0x46f497;};'use strict';var _=require(_0xc9a1('0x0'));var util=require(_0xc9a1('0x1'));var logger=require(_0xc9a1('0x2'))(_0xc9a1('0x3'));var moment=require('moment');var BPromise=require(_0xc9a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9a1('0x5'));var rimraf=require(_0xc9a1('0x6'));var config=require('../../config/environment');var attributes=require(_0xc9a1('0x7'));module['exports']=function(_0x51ff16,_0x890b66){return _0x51ff16[_0xc9a1('0x8')](_0xc9a1('0x9'),attributes,{'tableName':_0xc9a1('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xc9a1('0xb'),_0xc9a1('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 0e3ca83..4ad154c 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x1a65e8,_0x3354ec){var _0x1508d9=function(_0x186946){while(--_0x186946){_0x1a65e8['push'](_0x1a65e8['shift']());}};_0x1508d9(++_0x3354ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5005f8,_0x224a58){var _0x31f0f2=function(_0x3deaf2){while(--_0x3deaf2){_0x5005f8['push'](_0x5005f8['shift']());}};_0x31f0f2(++_0x224a58);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5d5722,_0x12c42e){_0x5d5722=_0x5d5722-0x0;var _0x456902=_0xb43b[_0x5d5722];return _0x456902;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 09e05c8..742c72b 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x44f642,_0x5c0b1c){var _0x3cedf3=function(_0x443fd1){while(--_0x443fd1){_0x44f642['push'](_0x44f642['shift']());}};_0x3cedf3(++_0x5c0b1c);}(_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 +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x43fcb1,_0x59f11b){var _0x528a61=function(_0x4874d8){while(--_0x4874d8){_0x43fcb1['push'](_0x43fcb1['shift']());}};_0x528a61(++_0x59f11b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index fdd8335..a4a5f48 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(_0x7f4d13,_0xe9aa0e){var _0x4ab736=function(_0x336f05){while(--_0x336f05){_0x7f4d13['push'](_0x7f4d13['shift']());}};_0x4ab736(++_0xe9aa0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5ca455,_0x2da58d){var _0x224f52=function(_0x5071b2){while(--_0x5071b2){_0x5ca455['push'](_0x5ca455['shift']());}};_0x224f52(++_0x2da58d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 4042b79..bbbd277 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 _0xec75=['xCALLY\x20Motion\x20Integration','Password\x20Expired','Calls','values','remove','includes','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SugarcrmAccount','includeAll','include','rows','catch','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','remoteUri','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','username','PLAIN'];(function(_0x15965a,_0x4bbec6){var _0xe6145d=function(_0x1d1cae){while(--_0x1d1cae){_0x15965a['push'](_0x15965a['shift']());}};_0xe6145d(++_0x4bbec6);}(_0xec75,0xec));var _0x5ec7=function(_0x20b543,_0xb1a972){_0x20b543=_0x20b543-0x0;var _0x390150=_0xec75[_0x20b543];return _0x390150;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ec7('0x0'));var jsonpatch=require(_0x5ec7('0x1'));var rp=require(_0x5ec7('0x2'));var moment=require(_0x5ec7('0x3'));var BPromise=require(_0x5ec7('0x4'));var Mustache=require(_0x5ec7('0x5'));var util=require(_0x5ec7('0x6'));var path=require('path');var sox=require(_0x5ec7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ec7('0x8'));var _=require(_0x5ec7('0x9'));var squel=require(_0x5ec7('0xa'));var crypto=require(_0x5ec7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5ec7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5ec7('0xd'));var Papa=require(_0x5ec7('0xe'));var Redis=require(_0x5ec7('0xf'));var authService=require(_0x5ec7('0x10'));var qs=require(_0x5ec7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5ec7('0x12'));var utils=require('../../config/utils');var config=require(_0x5ec7('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x5ec7('0x14'));function respondWithStatusCode(_0x5ea268,_0x523824){_0x523824=_0x523824||0xcc;return function(_0x10a84e){if(_0x10a84e){return _0x5ea268[_0x5ec7('0x15')](_0x523824);}return _0x5ea268['status'](_0x523824)[_0x5ec7('0x16')]();};}function respondWithResult(_0x5c4231,_0x253886){_0x253886=_0x253886||0xc8;return function(_0x5486d9){if(_0x5486d9){return _0x5c4231[_0x5ec7('0x17')](_0x253886)[_0x5ec7('0x18')](_0x5486d9);}};}function respondWithFilteredResult(_0x56835b,_0x42841c){return function(_0x553280){if(_0x553280){var _0x56e5fc=typeof _0x42841c[_0x5ec7('0x19')]===_0x5ec7('0x1a')&&typeof _0x42841c['limit']===_0x5ec7('0x1a');var _0x281426=_0x553280['count'];var _0xcaec31=_0x56e5fc?0x0:_0x42841c[_0x5ec7('0x19')];var _0x37850b=_0x56e5fc?_0x553280[_0x5ec7('0x1b')]:_0x42841c[_0x5ec7('0x19')]+_0x42841c[_0x5ec7('0x1c')];var _0x389d4b;if(_0x37850b>=_0x281426){_0x37850b=_0x281426;_0x389d4b=0xc8;}else{_0x389d4b=0xce;}_0x56835b[_0x5ec7('0x17')](_0x389d4b);return _0x56835b['set'](_0x5ec7('0x1d'),_0xcaec31+'-'+_0x37850b+'/'+_0x281426)[_0x5ec7('0x18')](_0x553280);}return null;};}function patchUpdates(_0x5ce956){return function(_0x5062e6){try{jsonpatch[_0x5ec7('0x1e')](_0x5062e6,_0x5ce956,!![]);}catch(_0xa0f00){return BPromise['reject'](_0xa0f00);}return _0x5062e6[_0x5ec7('0x1f')]();};}function saveUpdates(_0x4a113b,_0x2ed688){return function(_0x2ba17a){if(_0x2ba17a){return _0x2ba17a['update'](_0x4a113b)[_0x5ec7('0x20')](function(_0xa35f17){return _0xa35f17;});}return null;};}function removeEntity(_0x451adc,_0x33ed62){return function(_0x547743){if(_0x547743){return _0x547743[_0x5ec7('0x21')]()[_0x5ec7('0x20')](function(){_0x451adc['status'](0xcc)[_0x5ec7('0x16')]();});}};}function handleEntityNotFound(_0x3185e5,_0x53e656){return function(_0x93afb7){if(!_0x93afb7){_0x3185e5[_0x5ec7('0x15')](0x194);}return _0x93afb7;};}function handleError(_0x7ceb9d,_0x4bf8af){_0x4bf8af=_0x4bf8af||0x1f4;return function(_0x48c9c2){logger[_0x5ec7('0x22')](_0x48c9c2['stack']);if(_0x48c9c2[_0x5ec7('0x23')]){delete _0x48c9c2[_0x5ec7('0x23')];}_0x7ceb9d[_0x5ec7('0x17')](_0x4bf8af)[_0x5ec7('0x24')](_0x48c9c2);};}exports[_0x5ec7('0x25')]=function(_0x322c86,_0x352bf2){var _0x1cfeae={},_0x3d59c2={},_0x5177c5={'count':0x0,'rows':[]};var _0x4f7639=_['map'](db['SugarcrmAccount']['rawAttributes'],function(_0x179a10){return{'name':_0x179a10[_0x5ec7('0x26')],'type':_0x179a10[_0x5ec7('0x27')][_0x5ec7('0x28')]};});_0x3d59c2[_0x5ec7('0x29')]=_[_0x5ec7('0x2a')](_0x4f7639,_0x5ec7('0x23'));_0x3d59c2[_0x5ec7('0x2b')]=_[_0x5ec7('0x2c')](_0x322c86[_0x5ec7('0x2b')]);_0x3d59c2[_0x5ec7('0x2d')]=_[_0x5ec7('0x2e')](_0x3d59c2[_0x5ec7('0x29')],_0x3d59c2[_0x5ec7('0x2b')]);_0x1cfeae['attributes']=_[_0x5ec7('0x2e')](_0x3d59c2['model'],qs['fields'](_0x322c86['query'][_0x5ec7('0x2f')]));_0x1cfeae['attributes']=_0x1cfeae[_0x5ec7('0x30')][_0x5ec7('0x31')]?_0x1cfeae[_0x5ec7('0x30')]:_0x3d59c2[_0x5ec7('0x29')];if(!_0x322c86[_0x5ec7('0x2b')][_0x5ec7('0x32')](_0x5ec7('0x33'))){_0x1cfeae[_0x5ec7('0x1c')]=qs[_0x5ec7('0x1c')](_0x322c86[_0x5ec7('0x2b')][_0x5ec7('0x1c')]);_0x1cfeae[_0x5ec7('0x19')]=qs[_0x5ec7('0x19')](_0x322c86[_0x5ec7('0x2b')]['offset']);}_0x1cfeae[_0x5ec7('0x34')]=qs[_0x5ec7('0x35')](_0x322c86[_0x5ec7('0x2b')][_0x5ec7('0x35')]);_0x1cfeae[_0x5ec7('0x36')]=qs[_0x5ec7('0x2d')](_[_0x5ec7('0x37')](_0x322c86[_0x5ec7('0x2b')],_0x3d59c2['filters']),_0x4f7639);if(_0x322c86['query'][_0x5ec7('0x38')]){_0x1cfeae['where']=_[_0x5ec7('0x39')](_0x1cfeae['where'],{'$or':_[_0x5ec7('0x2a')](_0x4f7639,function(_0x56e188){if(_0x56e188[_0x5ec7('0x27')]!=='VIRTUAL'){var _0x327503={};_0x327503[_0x56e188[_0x5ec7('0x23')]]={'$like':'%'+_0x322c86[_0x5ec7('0x2b')][_0x5ec7('0x38')]+'%'};return _0x327503;}})});}_0x1cfeae=_[_0x5ec7('0x39')]({},_0x1cfeae,_0x322c86[_0x5ec7('0x3a')]);var _0x31f7fa={'where':_0x1cfeae['where']};return db[_0x5ec7('0x3b')][_0x5ec7('0x1b')](_0x31f7fa)['then'](function(_0x12e7ae){_0x5177c5[_0x5ec7('0x1b')]=_0x12e7ae;if(_0x322c86[_0x5ec7('0x2b')][_0x5ec7('0x3c')]){_0x1cfeae[_0x5ec7('0x3d')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x1cfeae);})[_0x5ec7('0x20')](function(_0xba3a90){_0x5177c5[_0x5ec7('0x3e')]=_0xba3a90;return _0x5177c5;})['then'](respondWithFilteredResult(_0x352bf2,_0x1cfeae))[_0x5ec7('0x3f')](handleError(_0x352bf2,null));};exports['show']=function(_0x4b25b6,_0x15cecc){var _0x12cc88={'raw':![],'where':{'id':_0x4b25b6[_0x5ec7('0x40')]['id']}},_0x10ce9b={};_0x10ce9b['model']=_[_0x5ec7('0x2c')](db[_0x5ec7('0x3b')][_0x5ec7('0x41')]);_0x10ce9b[_0x5ec7('0x2b')]=_[_0x5ec7('0x2c')](_0x4b25b6[_0x5ec7('0x2b')]);_0x10ce9b[_0x5ec7('0x2d')]=_[_0x5ec7('0x2e')](_0x10ce9b['model'],_0x10ce9b[_0x5ec7('0x2b')]);_0x12cc88[_0x5ec7('0x30')]=_[_0x5ec7('0x2e')](_0x10ce9b['model'],qs[_0x5ec7('0x2f')](_0x4b25b6[_0x5ec7('0x2b')][_0x5ec7('0x2f')]));_0x12cc88[_0x5ec7('0x30')]=_0x12cc88[_0x5ec7('0x30')]['length']?_0x12cc88['attributes']:_0x10ce9b[_0x5ec7('0x29')];if(_0x4b25b6[_0x5ec7('0x2b')]['includeAll']){_0x12cc88[_0x5ec7('0x3d')]=[{'all':!![]}];}_0x12cc88=_[_0x5ec7('0x39')]({},_0x12cc88,_0x4b25b6[_0x5ec7('0x3a')]);return db[_0x5ec7('0x3b')][_0x5ec7('0x42')](_0x12cc88)['then'](handleEntityNotFound(_0x15cecc,null))[_0x5ec7('0x20')](respondWithResult(_0x15cecc,null))[_0x5ec7('0x3f')](handleError(_0x15cecc,null));};exports[_0x5ec7('0x43')]=function(_0x454bf2,_0x539d02){return db['SugarcrmAccount']['create'](_0x454bf2[_0x5ec7('0x44')],{})[_0x5ec7('0x20')](respondWithResult(_0x539d02,0xc9))[_0x5ec7('0x3f')](handleError(_0x539d02,null));};exports['update']=function(_0x105ab3,_0x38405b){if(_0x105ab3['body']['id']){delete _0x105ab3[_0x5ec7('0x44')]['id'];}return db[_0x5ec7('0x3b')][_0x5ec7('0x42')]({'where':{'id':_0x105ab3['params']['id']}})[_0x5ec7('0x20')](handleEntityNotFound(_0x38405b,null))[_0x5ec7('0x20')](saveUpdates(_0x105ab3[_0x5ec7('0x44')],null))[_0x5ec7('0x20')](respondWithResult(_0x38405b,null))[_0x5ec7('0x3f')](handleError(_0x38405b,null));};exports[_0x5ec7('0x21')]=function(_0x1eb3d9,_0x3964f6){return db['SugarcrmAccount']['find']({'where':{'id':_0x1eb3d9[_0x5ec7('0x40')]['id']}})[_0x5ec7('0x20')](handleEntityNotFound(_0x3964f6,null))[_0x5ec7('0x20')](removeEntity(_0x3964f6,null))[_0x5ec7('0x3f')](handleError(_0x3964f6,null));};exports[_0x5ec7('0x45')]=function(_0x4fde54,_0x284fa0,_0x203d90){var _0x496c66={};var _0x19eb46={};var _0x39d0dc;var _0x3ae122;return db[_0x5ec7('0x3b')][_0x5ec7('0x46')]({'where':{'id':_0x4fde54['params']['id']}})['then'](handleEntityNotFound(_0x284fa0,null))[_0x5ec7('0x20')](function(_0x32ddaa){if(_0x32ddaa){_0x39d0dc=_0x32ddaa;_0x19eb46['model']=_[_0x5ec7('0x2c')](db[_0x5ec7('0x47')][_0x5ec7('0x41')]);_0x19eb46[_0x5ec7('0x2b')]=_[_0x5ec7('0x2c')](_0x4fde54[_0x5ec7('0x2b')]);_0x19eb46[_0x5ec7('0x2d')]=_[_0x5ec7('0x2e')](_0x19eb46[_0x5ec7('0x29')],_0x19eb46[_0x5ec7('0x2b')]);_0x496c66['attributes']=_[_0x5ec7('0x2e')](_0x19eb46[_0x5ec7('0x29')],qs[_0x5ec7('0x2f')](_0x4fde54[_0x5ec7('0x2b')][_0x5ec7('0x2f')]));_0x496c66[_0x5ec7('0x30')]=_0x496c66[_0x5ec7('0x30')][_0x5ec7('0x31')]?_0x496c66[_0x5ec7('0x30')]:_0x19eb46['model'];_0x496c66['order']=qs['sort'](_0x4fde54['query'][_0x5ec7('0x35')]);_0x496c66['where']=qs['filters'](_[_0x5ec7('0x37')](_0x4fde54[_0x5ec7('0x2b')],_0x19eb46[_0x5ec7('0x2d')]));if(_0x4fde54[_0x5ec7('0x2b')][_0x5ec7('0x38')]){_0x496c66[_0x5ec7('0x36')]=_[_0x5ec7('0x39')](_0x496c66[_0x5ec7('0x36')],{'$or':_[_0x5ec7('0x2a')](_0x496c66['attributes'],function(_0x163d55){var _0xad7b61={};_0xad7b61[_0x163d55]={'$like':'%'+_0x4fde54[_0x5ec7('0x2b')]['filter']+'%'};return _0xad7b61;})});}_0x496c66=_[_0x5ec7('0x39')]({},_0x496c66,_0x4fde54['options']);return _0x39d0dc[_0x5ec7('0x45')](_0x496c66);}})[_0x5ec7('0x20')](function(_0x30fbd8){if(_0x30fbd8){_0x3ae122=_0x30fbd8[_0x5ec7('0x31')];if(!_0x4fde54['query'][_0x5ec7('0x32')](_0x5ec7('0x33'))){_0x496c66[_0x5ec7('0x1c')]=qs[_0x5ec7('0x1c')](_0x4fde54[_0x5ec7('0x2b')][_0x5ec7('0x1c')]);_0x496c66[_0x5ec7('0x19')]=qs[_0x5ec7('0x19')](_0x4fde54['query'][_0x5ec7('0x19')]);}return _0x39d0dc[_0x5ec7('0x45')](_0x496c66);}})[_0x5ec7('0x20')](function(_0x2e0b82){if(_0x2e0b82){return _0x2e0b82?{'count':_0x3ae122,'rows':_0x2e0b82}:null;}})[_0x5ec7('0x20')](respondWithResult(_0x284fa0,null))['catch'](handleError(_0x284fa0,null));};exports[_0x5ec7('0x48')]=function(_0x2d505c,_0x46a7fa,_0x167a9d){if(_0x2d505c[_0x5ec7('0x44')]['id']){delete _0x2d505c['body']['id'];}return db[_0x5ec7('0x3b')]['findOne']({'where':{'id':_0x2d505c[_0x5ec7('0x40')]['id']}})['then'](handleEntityNotFound(_0x46a7fa,null))[_0x5ec7('0x20')](function(_0x35b3d8){if(_0x35b3d8){_0x2d505c[_0x5ec7('0x44')][_0x5ec7('0x49')]=_0x35b3d8['id'];_0x2d505c['body'][_0x5ec7('0x4a')]=integrations[_0x5ec7('0x4b')](_0x2d505c[_0x5ec7('0x44')][_0x5ec7('0x4c')],_0x2d505c[_0x5ec7('0x44')][_0x5ec7('0x27')]);_0x2d505c[_0x5ec7('0x44')][_0x5ec7('0x4d')]=integrations[_0x5ec7('0x4e')](_0x2d505c['body'][_0x5ec7('0x4c')],_0x2d505c[_0x5ec7('0x44')]['type']);return db[_0x5ec7('0x47')][_0x5ec7('0x43')](_0x2d505c[_0x5ec7('0x44')],{'include':[{'model':db[_0x5ec7('0x4f')],'as':'Subjects'},{'model':db[_0x5ec7('0x4f')],'as':_0x5ec7('0x4d')}]});}return null;})[_0x5ec7('0x20')](respondWithResult(_0x46a7fa,null))[_0x5ec7('0x3f')](handleError(_0x46a7fa,null));};exports[_0x5ec7('0x50')]=function(_0x4edf06,_0x24266e,_0xf76168){var _0x5b6376='';var _0x404bf9=['id',_0x5ec7('0x23'),_0x5ec7('0x51'),_0x5ec7('0x52'),'description',_0x5ec7('0x53'),_0x5ec7('0x54'),_0x5ec7('0x55'),_0x5ec7('0x56'),_0x5ec7('0x57'),_0x5ec7('0x58'),_0x5ec7('0x59')];return db[_0x5ec7('0x3b')]['findOne']({'where':{'id':_0x4edf06[_0x5ec7('0x40')]['id']},'attributes':['id','username','password',_0x5ec7('0x5a')]})['then'](handleEntityNotFound(_0x24266e,null))[_0x5ec7('0x20')](function(_0x39b986){if(_0x39b986){_0x5b6376=_0x39b986['remoteUri'];var _0x43218d=_0x5b6376['slice'](-0x1);if(_0x43218d==='/'){_0x5b6376=_0x5b6376['substring'](0x0,_0x5b6376[_0x5ec7('0x5b')](_0x43218d));}return rp({'method':_0x5ec7('0x5c'),'uri':util[_0x5ec7('0x5d')](_0x5ec7('0x5e'),_0x5b6376,_0x5ec7('0x5f')),'json':!![],'form':{'method':'login','input_type':_0x5ec7('0x60'),'response_type':_0x5ec7('0x60'),'rest_data':JSON[_0x5ec7('0x61')]({'user_auth':{'user_name':_0x39b986[_0x5ec7('0x62')],'password':_0x39b986['password'],'encryption':_0x5ec7('0x63')},'application':_0x5ec7('0x64')})}});}})[_0x5ec7('0x20')](function(_0x1143d6){if(_0x1143d6&&_0x1143d6[_0x5ec7('0x23')]!=='Invalid\x20Login'&&_0x1143d6[_0x5ec7('0x23')]!==_0x5ec7('0x65')){return rp({'method':_0x5ec7('0x5c'),'uri':util[_0x5ec7('0x5d')]('%s%s',_0x5b6376,_0x5ec7('0x5f')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x5ec7('0x60'),'response_type':_0x5ec7('0x60'),'rest_data':JSON[_0x5ec7('0x61')]({'session':_0x1143d6['id'],'module_name':_0x5ec7('0x66')})}})[_0x5ec7('0x20')](function(_0x433e9e){if(_0x433e9e){var _0x563605=_[_0x5ec7('0x67')](_0x433e9e['module_fields']);_[_0x5ec7('0x68')](_0x563605,function(_0x2f8da0){return _0x404bf9[_0x5ec7('0x69')](_0x2f8da0[_0x5ec7('0x23')]);});return{'count':_0x563605['length'],'rows':_['map'](_0x563605,function(_0x943cc8){return{'id':_0x943cc8[_0x5ec7('0x23')],'name':_0x943cc8[_0x5ec7('0x6a')],'custom':_[_0x5ec7('0x6b')](_0x943cc8[_0x5ec7('0x23')],'_c')?!![]:![],'options':_0x943cc8[_0x5ec7('0x3a')]?_[_0x5ec7('0x2a')](_['values'](_0x943cc8[_0x5ec7('0x3a')]),function(_0x37563e){return{'name':_0x37563e[_0x5ec7('0x6c')],'value':_0x37563e[_0x5ec7('0x23')]};}):[]};})};}})['then'](respondWithResult(_0x24266e,null))[_0x5ec7('0x3f')](function(_0x33089d){var _0x21b58e=_0x4edf06[_0x5ec7('0x2b')][_0x5ec7('0x6d')]?0x1f4:_0x33089d['statusCode']||0x1f4;logger[_0x5ec7('0x22')](_0x5ec7('0x6e'),_0x5ec7('0x50'),_0x21b58e,JSON[_0x5ec7('0x61')](_0x33089d));delete _0x33089d[_0x5ec7('0x23')];if(_0x21b58e===0x191){_0x21b58e=0x190;}_0x24266e[_0x5ec7('0x17')](_0x21b58e)[_0x5ec7('0x24')](_0x4edf06[_0x5ec7('0x2b')][_0x5ec7('0x6d')]?{'message':_0x5ec7('0x6f'),'statusCode':_0x33089d['statusCode']}:_0x33089d);});}else{var _0x37cb8a=0x1f4;_0x24266e[_0x5ec7('0x17')](_0x37cb8a)[_0x5ec7('0x24')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x45ea=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','include','catch','params','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring'];(function(_0x8b10df,_0x3e8405){var _0x3cb4e8=function(_0x2a65ed){while(--_0x2a65ed){_0x8b10df['push'](_0x8b10df['shift']());}};_0x3cb4e8(++_0x3e8405);}(_0x45ea,0x160));var _0xa45e=function(_0x2f7825,_0x361076){_0x2f7825=_0x2f7825-0x0;var _0xa89e46=_0x45ea[_0x2f7825];return _0xa89e46;};'use strict';var emlformat=require(_0xa45e('0x0'));var rimraf=require(_0xa45e('0x1'));var zipdir=require(_0xa45e('0x2'));var jsonpatch=require(_0xa45e('0x3'));var rp=require(_0xa45e('0x4'));var moment=require(_0xa45e('0x5'));var BPromise=require(_0xa45e('0x6'));var Mustache=require('mustache');var util=require(_0xa45e('0x7'));var path=require(_0xa45e('0x8'));var sox=require(_0xa45e('0x9'));var csv=require(_0xa45e('0xa'));var ejs=require(_0xa45e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa45e('0xc'));var squel=require(_0xa45e('0xd'));var crypto=require(_0xa45e('0xe'));var jsforce=require(_0xa45e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa45e('0xa'));var querystring=require(_0xa45e('0x10'));var Papa=require(_0xa45e('0x11'));var Redis=require(_0xa45e('0x12'));var authService=require(_0xa45e('0x13'));var qs=require(_0xa45e('0x14'));var as=require(_0xa45e('0x15'));var hardwareService=require(_0xa45e('0x16'));var logger=require(_0xa45e('0x17'))(_0xa45e('0x18'));var utils=require(_0xa45e('0x19'));var config=require(_0xa45e('0x1a'));var licenseUtil=require(_0xa45e('0x1b'));var db=require(_0xa45e('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x373aed,_0x1c7664){_0x1c7664=_0x1c7664||0xcc;return function(_0x559940){if(_0x559940){return _0x373aed[_0xa45e('0x1d')](_0x1c7664);}return _0x373aed[_0xa45e('0x1e')](_0x1c7664)[_0xa45e('0x1f')]();};}function respondWithResult(_0x5d118e,_0x27344b){_0x27344b=_0x27344b||0xc8;return function(_0x1e63c2){if(_0x1e63c2){return _0x5d118e[_0xa45e('0x1e')](_0x27344b)[_0xa45e('0x20')](_0x1e63c2);}};}function respondWithFilteredResult(_0x5a39e6,_0x59925d){return function(_0x912a97){if(_0x912a97){var _0x23691c=typeof _0x59925d['offset']===_0xa45e('0x21')&&typeof _0x59925d[_0xa45e('0x22')]===_0xa45e('0x21');var _0x2012f8=_0x912a97[_0xa45e('0x23')];var _0x170d07=_0x23691c?0x0:_0x59925d[_0xa45e('0x24')];var _0x2136c2=_0x23691c?_0x912a97[_0xa45e('0x23')]:_0x59925d[_0xa45e('0x24')]+_0x59925d[_0xa45e('0x22')];var _0x38f915;if(_0x2136c2>=_0x2012f8){_0x2136c2=_0x2012f8;_0x38f915=0xc8;}else{_0x38f915=0xce;}_0x5a39e6[_0xa45e('0x1e')](_0x38f915);return _0x5a39e6['set']('Content-Range',_0x170d07+'-'+_0x2136c2+'/'+_0x2012f8)[_0xa45e('0x20')](_0x912a97);}return null;};}function patchUpdates(_0x4506bd){return function(_0x12d100){try{jsonpatch[_0xa45e('0x25')](_0x12d100,_0x4506bd,!![]);}catch(_0x106f98){return BPromise[_0xa45e('0x26')](_0x106f98);}return _0x12d100[_0xa45e('0x27')]();};}function saveUpdates(_0x1db5f6,_0x3c35eb){return function(_0x5ad888){if(_0x5ad888){return _0x5ad888[_0xa45e('0x28')](_0x1db5f6)[_0xa45e('0x29')](function(_0x52a8a1){return _0x52a8a1;});}return null;};}function removeEntity(_0x22c935,_0x445259){return function(_0x1c5193){if(_0x1c5193){return _0x1c5193[_0xa45e('0x2a')]()[_0xa45e('0x29')](function(){_0x22c935[_0xa45e('0x1e')](0xcc)[_0xa45e('0x1f')]();});}};}function handleEntityNotFound(_0x3c7605,_0x619451){return function(_0x62775f){if(!_0x62775f){_0x3c7605[_0xa45e('0x1d')](0x194);}return _0x62775f;};}function handleError(_0x21f082,_0x5e13f7){_0x5e13f7=_0x5e13f7||0x1f4;return function(_0x1a7f33){logger[_0xa45e('0x2b')](_0x1a7f33[_0xa45e('0x2c')]);if(_0x1a7f33[_0xa45e('0x2d')]){delete _0x1a7f33['name'];}_0x21f082[_0xa45e('0x1e')](_0x5e13f7)[_0xa45e('0x2e')](_0x1a7f33);};}exports[_0xa45e('0x2f')]=function(_0x3e6e5d,_0x450ddf){var _0x47101f={},_0x3d2de6={},_0x59eda0={'count':0x0,'rows':[]};var _0x2b300f=_[_0xa45e('0x30')](db[_0xa45e('0x31')]['rawAttributes'],function(_0x3bf9ff){return{'name':_0x3bf9ff['fieldName'],'type':_0x3bf9ff[_0xa45e('0x32')][_0xa45e('0x33')]};});_0x3d2de6[_0xa45e('0x34')]=_[_0xa45e('0x30')](_0x2b300f,'name');_0x3d2de6[_0xa45e('0x35')]=_[_0xa45e('0x36')](_0x3e6e5d['query']);_0x3d2de6[_0xa45e('0x37')]=_[_0xa45e('0x38')](_0x3d2de6[_0xa45e('0x34')],_0x3d2de6['query']);_0x47101f[_0xa45e('0x39')]=_[_0xa45e('0x38')](_0x3d2de6[_0xa45e('0x34')],qs[_0xa45e('0x3a')](_0x3e6e5d['query'][_0xa45e('0x3a')]));_0x47101f[_0xa45e('0x39')]=_0x47101f[_0xa45e('0x39')][_0xa45e('0x3b')]?_0x47101f['attributes']:_0x3d2de6[_0xa45e('0x34')];if(!_0x3e6e5d[_0xa45e('0x35')][_0xa45e('0x3c')](_0xa45e('0x3d'))){_0x47101f[_0xa45e('0x22')]=qs['limit'](_0x3e6e5d['query'][_0xa45e('0x22')]);_0x47101f[_0xa45e('0x24')]=qs[_0xa45e('0x24')](_0x3e6e5d[_0xa45e('0x35')]['offset']);}_0x47101f['order']=qs[_0xa45e('0x3e')](_0x3e6e5d[_0xa45e('0x35')][_0xa45e('0x3e')]);_0x47101f[_0xa45e('0x3f')]=qs[_0xa45e('0x37')](_[_0xa45e('0x40')](_0x3e6e5d[_0xa45e('0x35')],_0x3d2de6['filters']),_0x2b300f);if(_0x3e6e5d['query']['filter']){_0x47101f[_0xa45e('0x3f')]=_['merge'](_0x47101f[_0xa45e('0x3f')],{'$or':_[_0xa45e('0x30')](_0x2b300f,function(_0x2fef74){if(_0x2fef74['type']!==_0xa45e('0x41')){var _0x39f0dc={};_0x39f0dc[_0x2fef74[_0xa45e('0x2d')]]={'$like':'%'+_0x3e6e5d[_0xa45e('0x35')][_0xa45e('0x42')]+'%'};return _0x39f0dc;}})});}_0x47101f=_[_0xa45e('0x43')]({},_0x47101f,_0x3e6e5d[_0xa45e('0x44')]);var _0x2268b8={'where':_0x47101f[_0xa45e('0x3f')]};return db[_0xa45e('0x31')][_0xa45e('0x23')](_0x2268b8)[_0xa45e('0x29')](function(_0x502c7d){_0x59eda0[_0xa45e('0x23')]=_0x502c7d;if(_0x3e6e5d[_0xa45e('0x35')]['includeAll']){_0x47101f[_0xa45e('0x45')]=[{'all':!![]}];}return db[_0xa45e('0x31')]['findAll'](_0x47101f);})[_0xa45e('0x29')](function(_0x3dde25){_0x59eda0['rows']=_0x3dde25;return _0x59eda0;})[_0xa45e('0x29')](respondWithFilteredResult(_0x450ddf,_0x47101f))[_0xa45e('0x46')](handleError(_0x450ddf,null));};exports['show']=function(_0x2f7f2e,_0x452432){var _0x589527={'raw':![],'where':{'id':_0x2f7f2e[_0xa45e('0x47')]['id']}},_0x15463b={};_0x15463b[_0xa45e('0x34')]=_['keys'](db[_0xa45e('0x31')][_0xa45e('0x48')]);_0x15463b['query']=_['keys'](_0x2f7f2e['query']);_0x15463b[_0xa45e('0x37')]=_[_0xa45e('0x38')](_0x15463b[_0xa45e('0x34')],_0x15463b['query']);_0x589527[_0xa45e('0x39')]=_['intersection'](_0x15463b['model'],qs[_0xa45e('0x3a')](_0x2f7f2e[_0xa45e('0x35')][_0xa45e('0x3a')]));_0x589527[_0xa45e('0x39')]=_0x589527[_0xa45e('0x39')][_0xa45e('0x3b')]?_0x589527[_0xa45e('0x39')]:_0x15463b[_0xa45e('0x34')];if(_0x2f7f2e[_0xa45e('0x35')][_0xa45e('0x49')]){_0x589527[_0xa45e('0x45')]=[{'all':!![]}];}_0x589527=_[_0xa45e('0x43')]({},_0x589527,_0x2f7f2e[_0xa45e('0x44')]);return db[_0xa45e('0x31')][_0xa45e('0x4a')](_0x589527)[_0xa45e('0x29')](handleEntityNotFound(_0x452432,null))[_0xa45e('0x29')](respondWithResult(_0x452432,null))[_0xa45e('0x46')](handleError(_0x452432,null));};exports[_0xa45e('0x4b')]=function(_0x324479,_0xa25a92){return db[_0xa45e('0x31')]['create'](_0x324479[_0xa45e('0x4c')],{})[_0xa45e('0x29')](respondWithResult(_0xa25a92,0xc9))['catch'](handleError(_0xa25a92,null));};exports[_0xa45e('0x28')]=function(_0x49e42d,_0x484d4c){if(_0x49e42d[_0xa45e('0x4c')]['id']){delete _0x49e42d[_0xa45e('0x4c')]['id'];}return db[_0xa45e('0x31')]['find']({'where':{'id':_0x49e42d['params']['id']}})[_0xa45e('0x29')](handleEntityNotFound(_0x484d4c,null))['then'](saveUpdates(_0x49e42d['body'],null))[_0xa45e('0x29')](respondWithResult(_0x484d4c,null))['catch'](handleError(_0x484d4c,null));};exports[_0xa45e('0x2a')]=function(_0x21da8c,_0x102b5a){return db[_0xa45e('0x31')][_0xa45e('0x4a')]({'where':{'id':_0x21da8c[_0xa45e('0x47')]['id']}})['then'](handleEntityNotFound(_0x102b5a,null))[_0xa45e('0x29')](removeEntity(_0x102b5a,null))[_0xa45e('0x46')](handleError(_0x102b5a,null));};exports[_0xa45e('0x4d')]=function(_0x5a7ff0,_0x13a4e8,_0x28ad6c){var _0x52c9fb={};var _0x5442ef={};var _0x4951e4;var _0x17d503;return db[_0xa45e('0x31')][_0xa45e('0x4e')]({'where':{'id':_0x5a7ff0[_0xa45e('0x47')]['id']}})[_0xa45e('0x29')](handleEntityNotFound(_0x13a4e8,null))[_0xa45e('0x29')](function(_0x18fbf5){if(_0x18fbf5){_0x4951e4=_0x18fbf5;_0x5442ef[_0xa45e('0x34')]=_[_0xa45e('0x36')](db[_0xa45e('0x4f')]['rawAttributes']);_0x5442ef[_0xa45e('0x35')]=_[_0xa45e('0x36')](_0x5a7ff0[_0xa45e('0x35')]);_0x5442ef[_0xa45e('0x37')]=_[_0xa45e('0x38')](_0x5442ef['model'],_0x5442ef['query']);_0x52c9fb['attributes']=_['intersection'](_0x5442ef[_0xa45e('0x34')],qs[_0xa45e('0x3a')](_0x5a7ff0[_0xa45e('0x35')]['fields']));_0x52c9fb[_0xa45e('0x39')]=_0x52c9fb[_0xa45e('0x39')]['length']?_0x52c9fb['attributes']:_0x5442ef[_0xa45e('0x34')];_0x52c9fb[_0xa45e('0x50')]=qs[_0xa45e('0x3e')](_0x5a7ff0[_0xa45e('0x35')][_0xa45e('0x3e')]);_0x52c9fb[_0xa45e('0x3f')]=qs[_0xa45e('0x37')](_[_0xa45e('0x40')](_0x5a7ff0[_0xa45e('0x35')],_0x5442ef[_0xa45e('0x37')]));if(_0x5a7ff0[_0xa45e('0x35')]['filter']){_0x52c9fb[_0xa45e('0x3f')]=_[_0xa45e('0x43')](_0x52c9fb['where'],{'$or':_[_0xa45e('0x30')](_0x52c9fb[_0xa45e('0x39')],function(_0x783136){var _0x4b5042={};_0x4b5042[_0x783136]={'$like':'%'+_0x5a7ff0[_0xa45e('0x35')][_0xa45e('0x42')]+'%'};return _0x4b5042;})});}_0x52c9fb=_['merge']({},_0x52c9fb,_0x5a7ff0[_0xa45e('0x44')]);return _0x4951e4[_0xa45e('0x4d')](_0x52c9fb);}})['then'](function(_0x319dd7){if(_0x319dd7){_0x17d503=_0x319dd7[_0xa45e('0x3b')];if(!_0x5a7ff0[_0xa45e('0x35')][_0xa45e('0x3c')](_0xa45e('0x3d'))){_0x52c9fb['limit']=qs[_0xa45e('0x22')](_0x5a7ff0[_0xa45e('0x35')][_0xa45e('0x22')]);_0x52c9fb[_0xa45e('0x24')]=qs[_0xa45e('0x24')](_0x5a7ff0['query'][_0xa45e('0x24')]);}return _0x4951e4['getConfigurations'](_0x52c9fb);}})[_0xa45e('0x29')](function(_0x317947){if(_0x317947){return _0x317947?{'count':_0x17d503,'rows':_0x317947}:null;}})[_0xa45e('0x29')](respondWithResult(_0x13a4e8,null))[_0xa45e('0x46')](handleError(_0x13a4e8,null));};exports['addConfiguration']=function(_0x1f8ba2,_0x359b15,_0x17e334){if(_0x1f8ba2[_0xa45e('0x4c')]['id']){delete _0x1f8ba2[_0xa45e('0x4c')]['id'];}return db[_0xa45e('0x31')]['findOne']({'where':{'id':_0x1f8ba2[_0xa45e('0x47')]['id']}})[_0xa45e('0x29')](handleEntityNotFound(_0x359b15,null))['then'](function(_0x1316cb){if(_0x1316cb){_0x1f8ba2['body'][_0xa45e('0x51')]=_0x1316cb['id'];_0x1f8ba2[_0xa45e('0x4c')]['Subjects']=integrations[_0xa45e('0x52')](_0x1f8ba2[_0xa45e('0x4c')][_0xa45e('0x53')],_0x1f8ba2[_0xa45e('0x4c')][_0xa45e('0x32')]);_0x1f8ba2[_0xa45e('0x4c')][_0xa45e('0x54')]=integrations[_0xa45e('0x55')](_0x1f8ba2[_0xa45e('0x4c')][_0xa45e('0x53')],_0x1f8ba2[_0xa45e('0x4c')]['type']);return db[_0xa45e('0x4f')][_0xa45e('0x4b')](_0x1f8ba2['body'],{'include':[{'model':db[_0xa45e('0x56')],'as':'Subjects'},{'model':db[_0xa45e('0x56')],'as':_0xa45e('0x54')}]});}return null;})[_0xa45e('0x29')](respondWithResult(_0x359b15,null))[_0xa45e('0x46')](handleError(_0x359b15,null));};exports[_0xa45e('0x57')]=function(_0x2447e3,_0x2ae35a,_0x3ef2c3){var _0x1515c9='';var _0x635271=['id',_0xa45e('0x2d'),_0xa45e('0x58'),_0xa45e('0x59'),_0xa45e('0x5a'),_0xa45e('0x5b'),_0xa45e('0x5c'),_0xa45e('0x5d'),_0xa45e('0x5e'),_0xa45e('0x5f'),_0xa45e('0x60'),_0xa45e('0x61')];return db[_0xa45e('0x31')][_0xa45e('0x4e')]({'where':{'id':_0x2447e3['params']['id']},'attributes':['id',_0xa45e('0x62'),_0xa45e('0x63'),_0xa45e('0x64')]})[_0xa45e('0x29')](handleEntityNotFound(_0x2ae35a,null))['then'](function(_0x38ab2f){if(_0x38ab2f){_0x1515c9=_0x38ab2f[_0xa45e('0x64')];var _0x3f0195=_0x1515c9[_0xa45e('0x65')](-0x1);if(_0x3f0195==='/'){_0x1515c9=_0x1515c9[_0xa45e('0x66')](0x0,_0x1515c9[_0xa45e('0x67')](_0x3f0195));}return rp({'method':_0xa45e('0x68'),'uri':util['format'](_0xa45e('0x69'),_0x1515c9,_0xa45e('0x6a')),'json':!![],'form':{'method':_0xa45e('0x6b'),'input_type':_0xa45e('0x6c'),'response_type':_0xa45e('0x6c'),'rest_data':JSON[_0xa45e('0x6d')]({'user_auth':{'user_name':_0x38ab2f['username'],'password':_0x38ab2f['password'],'encryption':_0xa45e('0x6e')},'application':_0xa45e('0x6f')})}});}})[_0xa45e('0x29')](function(_0x4e385f){if(_0x4e385f&&_0x4e385f[_0xa45e('0x2d')]!=='Invalid\x20Login'&&_0x4e385f['name']!==_0xa45e('0x70')){return rp({'method':'POST','uri':util['format']('%s%s',_0x1515c9,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa45e('0x71'),'input_type':'JSON','response_type':_0xa45e('0x6c'),'rest_data':JSON['stringify']({'session':_0x4e385f['id'],'module_name':_0xa45e('0x72')})}})[_0xa45e('0x29')](function(_0x26b250){if(_0x26b250){var _0x915800=_[_0xa45e('0x73')](_0x26b250[_0xa45e('0x74')]);_[_0xa45e('0x75')](_0x915800,function(_0x156e0d){return _0x635271['includes'](_0x156e0d[_0xa45e('0x2d')]);});return{'count':_0x915800[_0xa45e('0x3b')],'rows':_[_0xa45e('0x30')](_0x915800,function(_0x49a71c){return{'id':_0x49a71c[_0xa45e('0x2d')],'name':_0x49a71c['label'],'custom':_[_0xa45e('0x76')](_0x49a71c['name'],'_c')?!![]:![],'options':_0x49a71c['options']?_[_0xa45e('0x30')](_[_0xa45e('0x73')](_0x49a71c[_0xa45e('0x44')]),function(_0x2b0970){return{'name':_0x2b0970[_0xa45e('0x77')],'value':_0x2b0970[_0xa45e('0x2d')]};}):[]};})};}})[_0xa45e('0x29')](respondWithResult(_0x2ae35a,null))[_0xa45e('0x46')](function(_0x43a786){var _0x134ba9=_0x2447e3[_0xa45e('0x35')][_0xa45e('0x78')]?0x1f4:_0x43a786[_0xa45e('0x79')]||0x1f4;logger[_0xa45e('0x2b')](_0xa45e('0x7a'),_0xa45e('0x57'),_0x134ba9,JSON['stringify'](_0x43a786));delete _0x43a786[_0xa45e('0x2d')];if(_0x134ba9===0x191){_0x134ba9=0x190;}_0x2ae35a[_0xa45e('0x1e')](_0x134ba9)[_0xa45e('0x2e')](_0x2447e3[_0xa45e('0x35')][_0xa45e('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x43a786[_0xa45e('0x79')]}:_0x43a786);});}else{var _0x4a88e9=0x1f4;_0x2ae35a[_0xa45e('0x1e')](_0x4a88e9)[_0xa45e('0x2e')]({'message':'Wrong\x20credentials','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 d68e70f..8310c5c 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 _0xdffb=['api','moment','bluebird','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash'];(function(_0x2a2e1b,_0x533801){var _0xd4402b=function(_0x5eb43f){while(--_0x5eb43f){_0x2a2e1b['push'](_0x2a2e1b['shift']());}};_0xd4402b(++_0x533801);}(_0xdffb,0xa9));var _0xbdff=function(_0x1ea464,_0x40648c){_0x1ea464=_0x1ea464-0x0;var _0x81ca73=_0xdffb[_0x1ea464];return _0x81ca73;};'use strict';var _=require(_0xbdff('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbdff('0x1'));var moment=require(_0xbdff('0x2'));var BPromise=require(_0xbdff('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbdff('0x4'));var attributes=require(_0xbdff('0x5'));var integrations=require(_0xbdff('0x6'));module[_0xbdff('0x7')]=function(_0x3f878b,_0x1e2654){return _0x3f878b[_0xbdff('0x8')](_0xbdff('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x431c=['SugarcrmAccount','int_sugarcrm_accounts','util','api','moment','bluebird','request-promise','./intSugarcrmAccount.attributes','define'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x431c,0x1e8));var _0xc431=function(_0x440a1d,_0x32107a){_0x440a1d=_0x440a1d-0x0;var _0x2f4ee1=_0x431c[_0x440a1d];return _0x2f4ee1;};'use strict';var _=require('lodash');var util=require(_0xc431('0x0'));var logger=require('../../config/logger')(_0xc431('0x1'));var moment=require(_0xc431('0x2'));var BPromise=require(_0xc431('0x3'));var rp=require(_0xc431('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc431('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5e8dad,_0x422995){return _0x5e8dad[_0xc431('0x6')](_0xc431('0x7'),attributes,{'tableName':_0xc431('0x8'),'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 00dfcfd..5dc430e 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 _0x4610=['stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','SugarcrmAccount','findAll','options','raw','attributes','limit','include','model','map','GetSugarcrmAccount','find','where','ShowSugarcrmAccount'];(function(_0x266e60,_0x485526){var _0x20ae1d=function(_0x5516a){while(--_0x5516a){_0x266e60['push'](_0x266e60['shift']());}};_0x20ae1d(++_0x485526);}(_0x4610,0x182));var _0x0461=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0x4610[_0x5ed54b];return _0x4b58c7;};'use strict';var _=require(_0x0461('0x0'));var util=require(_0x0461('0x1'));var moment=require('moment');var BPromise=require(_0x0461('0x2'));var rs=require(_0x0461('0x3'));var fs=require('fs');var Redis=require(_0x0461('0x4'));var db=require(_0x0461('0x5'))['db'];var utils=require(_0x0461('0x6'));var logger=require(_0x0461('0x7'))(_0x0461('0x8'));var config=require(_0x0461('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0461('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x103a5e,_0x1420cd,_0x3a87b3){return new BPromise(function(_0x249367,_0x436f78){return client['request'](_0x103a5e,_0x3a87b3)[_0x0461('0xb')](function(_0x1d6594){logger[_0x0461('0xc')](_0x0461('0xd'),_0x1420cd,'request\x20sent');logger[_0x0461('0xe')](_0x0461('0xf'),_0x1420cd,'request\x20sent',JSON['stringify'](_0x1d6594));if(_0x1d6594[_0x0461('0x10')]){if(_0x1d6594[_0x0461('0x10')]['code']===0x1f4){logger[_0x0461('0x10')](_0x0461('0xd'),_0x1420cd,_0x1d6594['error'][_0x0461('0x11')]);return _0x436f78(_0x1d6594[_0x0461('0x10')][_0x0461('0x11')]);}logger[_0x0461('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x1420cd,_0x1d6594[_0x0461('0x10')][_0x0461('0x11')]);return _0x249367(_0x1d6594[_0x0461('0x10')][_0x0461('0x11')]);}else{logger[_0x0461('0xc')](_0x0461('0xd'),_0x1420cd,_0x0461('0x12'));_0x249367(_0x1d6594[_0x0461('0x13')][_0x0461('0x11')]);}})[_0x0461('0x14')](function(_0x1da994){logger[_0x0461('0x10')](_0x0461('0xd'),_0x1420cd,_0x1da994);_0x436f78(_0x1da994);});});}exports['GetSugarcrmAccount']=function(_0x5b7656){var _0x31ad22=this;return new Promise(function(_0x18e440,_0x17948e){return db[_0x0461('0x15')][_0x0461('0x16')]({'raw':_0x5b7656[_0x0461('0x17')]?_0x5b7656[_0x0461('0x17')][_0x0461('0x18')]===undefined?!![]:![]:!![],'where':_0x5b7656['options']?_0x5b7656[_0x0461('0x17')]['where']||null:null,'attributes':_0x5b7656[_0x0461('0x17')]?_0x5b7656['options'][_0x0461('0x19')]||null:null,'limit':_0x5b7656['options']?_0x5b7656['options'][_0x0461('0x1a')]||null:null,'include':_0x5b7656[_0x0461('0x17')]?_0x5b7656[_0x0461('0x17')]['include']?_['map'](_0x5b7656[_0x0461('0x17')][_0x0461('0x1b')],function(_0x23a7aa){return{'model':db[_0x23a7aa[_0x0461('0x1c')]],'as':_0x23a7aa['as'],'attributes':_0x23a7aa[_0x0461('0x19')],'include':_0x23a7aa['include']?_['map'](_0x23a7aa[_0x0461('0x1b')],function(_0x38df0d){return{'model':db[_0x38df0d[_0x0461('0x1c')]],'as':_0x38df0d['as'],'attributes':_0x38df0d['attributes'],'include':_0x38df0d['include']?_[_0x0461('0x1d')](_0x38df0d[_0x0461('0x1b')],function(_0x23da82){return{'model':db[_0x23da82[_0x0461('0x1c')]],'as':_0x23da82['as'],'attributes':_0x23da82[_0x0461('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0461('0xb')](function(_0x106ba3){logger[_0x0461('0xc')](_0x0461('0x1e'),_0x5b7656);logger[_0x0461('0xe')](_0x0461('0x1e'),_0x5b7656,JSON['stringify'](_0x106ba3));_0x18e440(_0x106ba3);})['catch'](function(_0x3c3ec8){logger[_0x0461('0x10')](_0x0461('0x1e'),_0x3c3ec8[_0x0461('0x11')],_0x5b7656);_0x17948e(_0x31ad22[_0x0461('0x10')](0x1f4,_0x3c3ec8[_0x0461('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x378e87){var _0x1329ba=this;return new Promise(function(_0x11472a,_0xf806c6){return db[_0x0461('0x15')][_0x0461('0x1f')]({'raw':_0x378e87[_0x0461('0x17')]?_0x378e87['options'][_0x0461('0x18')]===undefined?!![]:![]:!![],'where':_0x378e87[_0x0461('0x17')]?_0x378e87[_0x0461('0x17')][_0x0461('0x20')]||null:null,'attributes':_0x378e87[_0x0461('0x17')]?_0x378e87[_0x0461('0x17')]['attributes']||null:null,'include':_0x378e87[_0x0461('0x17')]?_0x378e87['options'][_0x0461('0x1b')]?_[_0x0461('0x1d')](_0x378e87[_0x0461('0x17')][_0x0461('0x1b')],function(_0x5c23c6){return{'model':db[_0x5c23c6['model']],'as':_0x5c23c6['as'],'attributes':_0x5c23c6[_0x0461('0x19')],'include':_0x5c23c6[_0x0461('0x1b')]?_['map'](_0x5c23c6[_0x0461('0x1b')],function(_0x18b87d){return{'model':db[_0x18b87d[_0x0461('0x1c')]],'as':_0x18b87d['as'],'attributes':_0x18b87d[_0x0461('0x19')],'include':_0x18b87d['include']?_['map'](_0x18b87d[_0x0461('0x1b')],function(_0x520910){return{'model':db[_0x520910['model']],'as':_0x520910['as'],'attributes':_0x520910[_0x0461('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0461('0xb')](function(_0x5b9745){logger[_0x0461('0xc')](_0x0461('0x21'),_0x378e87);logger['debug']('ShowSugarcrmAccount',_0x378e87,JSON[_0x0461('0x22')](_0x5b9745));_0x11472a(_0x5b9745);})[_0x0461('0x14')](function(_0x460c33){logger['error'](_0x0461('0x21'),_0x460c33[_0x0461('0x11')],_0x378e87);_0xf806c6(_0x1329ba[_0x0461('0x10')](0x1f4,_0x460c33[_0x0461('0x11')]));});});}; \ No newline at end of file +var _0xec17=['moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','ShowSugarcrmAccount','find','where','lodash'];(function(_0x1927da,_0x470064){var _0x1d41ae=function(_0x1d4ae4){while(--_0x1d4ae4){_0x1927da['push'](_0x1927da['shift']());}};_0x1d41ae(++_0x470064);}(_0xec17,0xe6));var _0x7ec1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xec17[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7ec1('0x0'));var util=require('util');var moment=require(_0x7ec1('0x1'));var BPromise=require(_0x7ec1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7ec1('0x3'))(_0x7ec1('0x4'));var config=require(_0x7ec1('0x5'));var jayson=require(_0x7ec1('0x6'));var client=jayson['client'][_0x7ec1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f0bc7,_0x145204,_0x458616){return new BPromise(function(_0x48fe87,_0x566505){return client[_0x7ec1('0x8')](_0x1f0bc7,_0x458616)[_0x7ec1('0x9')](function(_0x49d730){logger[_0x7ec1('0xa')](_0x7ec1('0xb'),_0x145204,_0x7ec1('0xc'));logger[_0x7ec1('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x145204,_0x7ec1('0xc'),JSON[_0x7ec1('0xe')](_0x49d730));if(_0x49d730[_0x7ec1('0xf')]){if(_0x49d730[_0x7ec1('0xf')][_0x7ec1('0x10')]===0x1f4){logger['error'](_0x7ec1('0xb'),_0x145204,_0x49d730['error'][_0x7ec1('0x11')]);return _0x566505(_0x49d730[_0x7ec1('0xf')]['message']);}logger[_0x7ec1('0xf')](_0x7ec1('0xb'),_0x145204,_0x49d730[_0x7ec1('0xf')][_0x7ec1('0x11')]);return _0x48fe87(_0x49d730['error'][_0x7ec1('0x11')]);}else{logger[_0x7ec1('0xa')](_0x7ec1('0xb'),_0x145204,'request\x20sent');_0x48fe87(_0x49d730[_0x7ec1('0x12')][_0x7ec1('0x11')]);}})[_0x7ec1('0x13')](function(_0x2f5857){logger[_0x7ec1('0xf')](_0x7ec1('0xb'),_0x145204,_0x2f5857);_0x566505(_0x2f5857);});});}exports[_0x7ec1('0x14')]=function(_0x2d3b62){var _0x43bbd7=this;return new Promise(function(_0x93aab5,_0x255f7c){return db[_0x7ec1('0x15')][_0x7ec1('0x16')]({'raw':_0x2d3b62[_0x7ec1('0x17')]?_0x2d3b62[_0x7ec1('0x17')][_0x7ec1('0x18')]===undefined?!![]:![]:!![],'where':_0x2d3b62[_0x7ec1('0x17')]?_0x2d3b62[_0x7ec1('0x17')]['where']||null:null,'attributes':_0x2d3b62['options']?_0x2d3b62[_0x7ec1('0x17')][_0x7ec1('0x19')]||null:null,'limit':_0x2d3b62[_0x7ec1('0x17')]?_0x2d3b62[_0x7ec1('0x17')][_0x7ec1('0x1a')]||null:null,'include':_0x2d3b62[_0x7ec1('0x17')]?_0x2d3b62[_0x7ec1('0x17')][_0x7ec1('0x1b')]?_[_0x7ec1('0x1c')](_0x2d3b62['options'][_0x7ec1('0x1b')],function(_0x5376f8){return{'model':db[_0x5376f8[_0x7ec1('0x1d')]],'as':_0x5376f8['as'],'attributes':_0x5376f8[_0x7ec1('0x19')],'include':_0x5376f8['include']?_['map'](_0x5376f8[_0x7ec1('0x1b')],function(_0x561d6e){return{'model':db[_0x561d6e[_0x7ec1('0x1d')]],'as':_0x561d6e['as'],'attributes':_0x561d6e['attributes'],'include':_0x561d6e[_0x7ec1('0x1b')]?_[_0x7ec1('0x1c')](_0x561d6e[_0x7ec1('0x1b')],function(_0x4370e0){return{'model':db[_0x4370e0[_0x7ec1('0x1d')]],'as':_0x4370e0['as'],'attributes':_0x4370e0[_0x7ec1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x485daf){logger[_0x7ec1('0xa')]('GetSugarcrmAccount',_0x2d3b62);logger[_0x7ec1('0xd')](_0x7ec1('0x14'),_0x2d3b62,JSON[_0x7ec1('0xe')](_0x485daf));_0x93aab5(_0x485daf);})[_0x7ec1('0x13')](function(_0x267122){logger[_0x7ec1('0xf')](_0x7ec1('0x14'),_0x267122[_0x7ec1('0x11')],_0x2d3b62);_0x255f7c(_0x43bbd7[_0x7ec1('0xf')](0x1f4,_0x267122['message']));});});};exports[_0x7ec1('0x1e')]=function(_0x380050){var _0xd9f36=this;return new Promise(function(_0x683304,_0x53e8da){return db[_0x7ec1('0x15')][_0x7ec1('0x1f')]({'raw':_0x380050[_0x7ec1('0x17')]?_0x380050[_0x7ec1('0x17')][_0x7ec1('0x18')]===undefined?!![]:![]:!![],'where':_0x380050[_0x7ec1('0x17')]?_0x380050[_0x7ec1('0x17')][_0x7ec1('0x20')]||null:null,'attributes':_0x380050[_0x7ec1('0x17')]?_0x380050[_0x7ec1('0x17')][_0x7ec1('0x19')]||null:null,'include':_0x380050[_0x7ec1('0x17')]?_0x380050[_0x7ec1('0x17')][_0x7ec1('0x1b')]?_[_0x7ec1('0x1c')](_0x380050[_0x7ec1('0x17')][_0x7ec1('0x1b')],function(_0x39aa6c){return{'model':db[_0x39aa6c[_0x7ec1('0x1d')]],'as':_0x39aa6c['as'],'attributes':_0x39aa6c['attributes'],'include':_0x39aa6c[_0x7ec1('0x1b')]?_[_0x7ec1('0x1c')](_0x39aa6c[_0x7ec1('0x1b')],function(_0xa99ec1){return{'model':db[_0xa99ec1[_0x7ec1('0x1d')]],'as':_0xa99ec1['as'],'attributes':_0xa99ec1['attributes'],'include':_0xa99ec1['include']?_[_0x7ec1('0x1c')](_0xa99ec1['include'],function(_0x3f5bcf){return{'model':db[_0x3f5bcf[_0x7ec1('0x1d')]],'as':_0x3f5bcf['as'],'attributes':_0x3f5bcf[_0x7ec1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7ec1('0x9')](function(_0x2c4875){logger[_0x7ec1('0xa')]('ShowSugarcrmAccount',_0x380050);logger['debug']('ShowSugarcrmAccount',_0x380050,JSON['stringify'](_0x2c4875));_0x683304(_0x2c4875);})[_0x7ec1('0x13')](function(_0x38d2a9){logger['error']('ShowSugarcrmAccount',_0x38d2a9[_0x7ec1('0x11')],_0x380050);_0x53e8da(_0xd9f36[_0x7ec1('0xf')](0x1f4,_0x38d2a9[_0x7ec1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index d528c7f..f01691d 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 _0x45e8=['delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x45e8,0x12e));var _0x845e=function(_0x794207,_0x54a989){_0x794207=_0x794207-0x0;var _0x4ee1c9=_0x45e8[_0x794207];return _0x4ee1c9;};'use strict';var multer=require('multer');var util=require(_0x845e('0x0'));var path=require(_0x845e('0x1'));var timeout=require('connect-timeout');var express=require(_0x845e('0x2'));var router=express['Router']();var fs_extra=require(_0x845e('0x3'));var auth=require(_0x845e('0x4'));var interaction=require(_0x845e('0x5'));var config=require(_0x845e('0x6'));var controller=require(_0x845e('0x7'));router[_0x845e('0x8')]('/',auth[_0x845e('0x9')](),controller[_0x845e('0xa')]);router[_0x845e('0x8')](_0x845e('0xb'),auth[_0x845e('0x9')](),controller[_0x845e('0xc')]);router['get'](_0x845e('0xd'),auth[_0x845e('0x9')](),controller[_0x845e('0xe')]);router['get'](_0x845e('0xf'),auth[_0x845e('0x9')](),controller['getSubjects']);router[_0x845e('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x845e('0x10')]);router[_0x845e('0x11')]('/',auth['isAuthenticated'](),controller[_0x845e('0x12')]);router['put']('/:id',auth[_0x845e('0x9')](),controller[_0x845e('0x13')]);router[_0x845e('0x14')]('/:id',auth[_0x845e('0x9')](),controller[_0x845e('0x15')]);module[_0x845e('0x16')]=router; \ No newline at end of file +var _0x9691=['update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','create','put'];(function(_0x554c40,_0x35674b){var _0x1cc873=function(_0x1f24d7){while(--_0x1f24d7){_0x554c40['push'](_0x554c40['shift']());}};_0x1cc873(++_0x35674b);}(_0x9691,0x6d));var _0x1969=function(_0x15871b,_0x2044f5){_0x15871b=_0x15871b-0x0;var _0x450516=_0x9691[_0x15871b];return _0x450516;};'use strict';var multer=require('multer');var util=require(_0x1969('0x0'));var path=require('path');var timeout=require(_0x1969('0x1'));var express=require(_0x1969('0x2'));var router=express[_0x1969('0x3')]();var fs_extra=require(_0x1969('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1969('0x5'));var config=require('../../config/environment');var controller=require(_0x1969('0x6'));router[_0x1969('0x7')]('/',auth[_0x1969('0x8')](),controller['index']);router['get'](_0x1969('0x9'),auth[_0x1969('0x8')](),controller[_0x1969('0xa')]);router[_0x1969('0x7')](_0x1969('0xb'),auth[_0x1969('0x8')](),controller[_0x1969('0xc')]);router[_0x1969('0x7')](_0x1969('0xd'),auth[_0x1969('0x8')](),controller[_0x1969('0xe')]);router[_0x1969('0x7')]('/:id/descriptions',auth[_0x1969('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x1969('0x8')](),controller[_0x1969('0xf')]);router[_0x1969('0x10')]('/:id',auth[_0x1969('0x8')](),controller[_0x1969('0x11')]);router[_0x1969('0x12')](_0x1969('0x9'),auth['isAuthenticated'](),controller[_0x1969('0x13')]);module[_0x1969('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 9e48fb9..88aca89 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 _0xcf28=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf28,0x76));var _0x8cf2=function(_0x38b72e,_0x2d4e01){_0x38b72e=_0x38b72e-0x0;var _0x284562=_0xcf28[_0x38b72e];return _0x284562;};'use strict';var Sequelize=require(_0x8cf2('0x0'));module[_0x8cf2('0x1')]={'name':{'type':Sequelize[_0x8cf2('0x2')]},'description':{'type':Sequelize[_0x8cf2('0x2')]}}; \ No newline at end of file +var _0x8690=['STRING','exports'];(function(_0x5580ef,_0x7c8842){var _0x2d5e26=function(_0x4d0c53){while(--_0x4d0c53){_0x5580ef['push'](_0x5580ef['shift']());}};_0x2d5e26(++_0x7c8842);}(_0x8690,0x19d));var _0x0869=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x8690[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require('sequelize');module[_0x0869('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0869('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 7555ca2..c630e0b 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 _0xd194=['include','findAll','rows','params','length','find','catch','create','body','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0x5b5cbc,_0x5602cb){var _0x45dc47=function(_0x49e90b){while(--_0x49e90b){_0x5b5cbc['push'](_0x5b5cbc['shift']());}};_0x45dc47(++_0x5602cb);}(_0xd194,0x153));var _0x4d19=function(_0x4f550e,_0x396412){_0x4f550e=_0x4f550e-0x0;var _0x56691b=_0xd194[_0x4f550e];return _0x56691b;};'use strict';var emlformat=require(_0x4d19('0x0'));var rimraf=require(_0x4d19('0x1'));var zipdir=require(_0x4d19('0x2'));var jsonpatch=require(_0x4d19('0x3'));var rp=require(_0x4d19('0x4'));var moment=require(_0x4d19('0x5'));var BPromise=require(_0x4d19('0x6'));var Mustache=require(_0x4d19('0x7'));var util=require(_0x4d19('0x8'));var path=require('path');var sox=require(_0x4d19('0x9'));var csv=require(_0x4d19('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d19('0xb'));var _=require(_0x4d19('0xc'));var squel=require(_0x4d19('0xd'));var crypto=require(_0x4d19('0xe'));var jsforce=require(_0x4d19('0xf'));var deskjs=require(_0x4d19('0x10'));var toCsv=require(_0x4d19('0xa'));var querystring=require(_0x4d19('0x11'));var Papa=require(_0x4d19('0x12'));var Redis=require(_0x4d19('0x13'));var authService=require(_0x4d19('0x14'));var qs=require(_0x4d19('0x15'));var as=require(_0x4d19('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4d19('0x17'));var utils=require(_0x4d19('0x18'));var config=require(_0x4d19('0x19'));var licenseUtil=require(_0x4d19('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e4ef0,_0xb3f32a){_0xb3f32a=_0xb3f32a||0xcc;return function(_0x59bcae){if(_0x59bcae){return _0x4e4ef0[_0x4d19('0x1b')](_0xb3f32a);}return _0x4e4ef0[_0x4d19('0x1c')](_0xb3f32a)[_0x4d19('0x1d')]();};}function respondWithResult(_0x20781f,_0x4e9965){_0x4e9965=_0x4e9965||0xc8;return function(_0x36835b){if(_0x36835b){return _0x20781f[_0x4d19('0x1c')](_0x4e9965)[_0x4d19('0x1e')](_0x36835b);}};}function respondWithFilteredResult(_0x137978,_0x46ef4b){return function(_0xb3692f){if(_0xb3692f){var _0x286226=typeof _0x46ef4b[_0x4d19('0x1f')]==='undefined'&&typeof _0x46ef4b[_0x4d19('0x20')]===_0x4d19('0x21');var _0x128c9f=_0xb3692f['count'];var _0x76a9c=_0x286226?0x0:_0x46ef4b[_0x4d19('0x1f')];var _0x5c725e=_0x286226?_0xb3692f[_0x4d19('0x22')]:_0x46ef4b[_0x4d19('0x1f')]+_0x46ef4b[_0x4d19('0x20')];var _0x300bc3;if(_0x5c725e>=_0x128c9f){_0x5c725e=_0x128c9f;_0x300bc3=0xc8;}else{_0x300bc3=0xce;}_0x137978['status'](_0x300bc3);return _0x137978['set'](_0x4d19('0x23'),_0x76a9c+'-'+_0x5c725e+'/'+_0x128c9f)['json'](_0xb3692f);}return null;};}function patchUpdates(_0x34a7bb){return function(_0x363a4c){try{jsonpatch[_0x4d19('0x24')](_0x363a4c,_0x34a7bb,!![]);}catch(_0x3e2e0a){return BPromise['reject'](_0x3e2e0a);}return _0x363a4c[_0x4d19('0x25')]();};}function saveUpdates(_0x503e3c,_0x59a64c){return function(_0xd35efa){if(_0xd35efa){return _0xd35efa[_0x4d19('0x26')](_0x503e3c)[_0x4d19('0x27')](function(_0x569083){return _0x569083;});}return null;};}function removeEntity(_0x399b22,_0xb0bc35){return function(_0x4600e1){if(_0x4600e1){return _0x4600e1[_0x4d19('0x28')]()[_0x4d19('0x27')](function(){_0x399b22[_0x4d19('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc79c,_0x5a1387){return function(_0x5626ed){if(!_0x5626ed){_0x2dc79c[_0x4d19('0x1b')](0x194);}return _0x5626ed;};}function handleError(_0x59dc56,_0x224d2){_0x224d2=_0x224d2||0x1f4;return function(_0x39578b){logger[_0x4d19('0x29')](_0x39578b['stack']);if(_0x39578b[_0x4d19('0x2a')]){delete _0x39578b[_0x4d19('0x2a')];}_0x59dc56['status'](_0x224d2)[_0x4d19('0x2b')](_0x39578b);};}exports[_0x4d19('0x2c')]=function(_0x3bb20a,_0x1a72fc){var _0x2bc2fd={},_0xa5451e={},_0x4e99d7={'count':0x0,'rows':[]};var _0xb75681=_['map'](db[_0x4d19('0x2d')][_0x4d19('0x2e')],function(_0x5ef12a){return{'name':_0x5ef12a[_0x4d19('0x2f')],'type':_0x5ef12a[_0x4d19('0x30')]['key']};});_0xa5451e['model']=_[_0x4d19('0x31')](_0xb75681,_0x4d19('0x2a'));_0xa5451e[_0x4d19('0x32')]=_[_0x4d19('0x33')](_0x3bb20a[_0x4d19('0x32')]);_0xa5451e[_0x4d19('0x34')]=_['intersection'](_0xa5451e[_0x4d19('0x35')],_0xa5451e[_0x4d19('0x32')]);_0x2bc2fd[_0x4d19('0x36')]=_[_0x4d19('0x37')](_0xa5451e[_0x4d19('0x35')],qs[_0x4d19('0x38')](_0x3bb20a['query']['fields']));_0x2bc2fd[_0x4d19('0x36')]=_0x2bc2fd[_0x4d19('0x36')]['length']?_0x2bc2fd[_0x4d19('0x36')]:_0xa5451e[_0x4d19('0x35')];if(!_0x3bb20a[_0x4d19('0x32')][_0x4d19('0x39')]('nolimit')){_0x2bc2fd[_0x4d19('0x20')]=qs[_0x4d19('0x20')](_0x3bb20a['query'][_0x4d19('0x20')]);_0x2bc2fd[_0x4d19('0x1f')]=qs[_0x4d19('0x1f')](_0x3bb20a['query'][_0x4d19('0x1f')]);}_0x2bc2fd[_0x4d19('0x3a')]=qs[_0x4d19('0x3b')](_0x3bb20a['query']['sort']);_0x2bc2fd[_0x4d19('0x3c')]=qs['filters'](_[_0x4d19('0x3d')](_0x3bb20a[_0x4d19('0x32')],_0xa5451e[_0x4d19('0x34')]),_0xb75681);if(_0x3bb20a['query']['filter']){_0x2bc2fd[_0x4d19('0x3c')]=_[_0x4d19('0x3e')](_0x2bc2fd[_0x4d19('0x3c')],{'$or':_[_0x4d19('0x31')](_0xb75681,function(_0x3be404){if(_0x3be404[_0x4d19('0x30')]!==_0x4d19('0x3f')){var _0x57235f={};_0x57235f[_0x3be404[_0x4d19('0x2a')]]={'$like':'%'+_0x3bb20a[_0x4d19('0x32')][_0x4d19('0x40')]+'%'};return _0x57235f;}})});}_0x2bc2fd=_[_0x4d19('0x3e')]({},_0x2bc2fd,_0x3bb20a[_0x4d19('0x41')]);var _0x315818={'where':_0x2bc2fd[_0x4d19('0x3c')]};return db[_0x4d19('0x2d')][_0x4d19('0x22')](_0x315818)[_0x4d19('0x27')](function(_0x4b9386){_0x4e99d7[_0x4d19('0x22')]=_0x4b9386;if(_0x3bb20a[_0x4d19('0x32')]['includeAll']){_0x2bc2fd[_0x4d19('0x42')]=[{'all':!![]}];}return db[_0x4d19('0x2d')][_0x4d19('0x43')](_0x2bc2fd);})[_0x4d19('0x27')](function(_0x1a1e16){_0x4e99d7[_0x4d19('0x44')]=_0x1a1e16;return _0x4e99d7;})[_0x4d19('0x27')](respondWithFilteredResult(_0x1a72fc,_0x2bc2fd))['catch'](handleError(_0x1a72fc,null));};exports['show']=function(_0x46b8ef,_0xe7ef4){var _0x1833d8={'raw':![],'where':{'id':_0x46b8ef[_0x4d19('0x45')]['id']}},_0x3be6e1={};_0x3be6e1['model']=_[_0x4d19('0x33')](db['SugarcrmConfiguration'][_0x4d19('0x2e')]);_0x3be6e1[_0x4d19('0x32')]=_[_0x4d19('0x33')](_0x46b8ef[_0x4d19('0x32')]);_0x3be6e1[_0x4d19('0x34')]=_[_0x4d19('0x37')](_0x3be6e1[_0x4d19('0x35')],_0x3be6e1[_0x4d19('0x32')]);_0x1833d8[_0x4d19('0x36')]=_[_0x4d19('0x37')](_0x3be6e1[_0x4d19('0x35')],qs[_0x4d19('0x38')](_0x46b8ef[_0x4d19('0x32')][_0x4d19('0x38')]));_0x1833d8[_0x4d19('0x36')]=_0x1833d8[_0x4d19('0x36')][_0x4d19('0x46')]?_0x1833d8[_0x4d19('0x36')]:_0x3be6e1['model'];if(_0x46b8ef['query']['includeAll']){_0x1833d8[_0x4d19('0x42')]=[{'all':!![]}];}_0x1833d8=_[_0x4d19('0x3e')]({},_0x1833d8,_0x46b8ef[_0x4d19('0x41')]);return db[_0x4d19('0x2d')][_0x4d19('0x47')](_0x1833d8)[_0x4d19('0x27')](handleEntityNotFound(_0xe7ef4,null))['then'](respondWithResult(_0xe7ef4,null))[_0x4d19('0x48')](handleError(_0xe7ef4,null));};exports['create']=function(_0xef70bc,_0x4dd56d){return db[_0x4d19('0x2d')][_0x4d19('0x49')](_0xef70bc[_0x4d19('0x4a')],{})[_0x4d19('0x27')](respondWithResult(_0x4dd56d,0xc9))['catch'](handleError(_0x4dd56d,null));};exports[_0x4d19('0x26')]=function(_0x23c668,_0x1159ea){if(_0x23c668[_0x4d19('0x4a')]['id']){delete _0x23c668[_0x4d19('0x4a')]['id'];}return db[_0x4d19('0x2d')][_0x4d19('0x47')]({'where':{'id':_0x23c668[_0x4d19('0x45')]['id']}})[_0x4d19('0x27')](handleEntityNotFound(_0x1159ea,null))['then'](saveUpdates(_0x23c668[_0x4d19('0x4a')],null))[_0x4d19('0x27')](respondWithResult(_0x1159ea,null))[_0x4d19('0x48')](handleError(_0x1159ea,null));};exports['destroy']=function(_0x47c785,_0x35f4be){return db[_0x4d19('0x2d')][_0x4d19('0x47')]({'where':{'id':_0x47c785[_0x4d19('0x45')]['id']}})[_0x4d19('0x27')](handleEntityNotFound(_0x35f4be,null))[_0x4d19('0x27')](removeEntity(_0x35f4be,null))['catch'](handleError(_0x35f4be,null));};exports[_0x4d19('0x4b')]=function(_0x485771,_0x47593f,_0x3f82af){var _0x148950={};var _0x20e0ab={};var _0x4c24c2;var _0x4a735c;return db[_0x4d19('0x2d')][_0x4d19('0x4c')]({'where':{'id':_0x485771['params']['id']}})[_0x4d19('0x27')](handleEntityNotFound(_0x47593f,null))['then'](function(_0xd5983c){if(_0xd5983c){_0x4c24c2=_0xd5983c;_0x20e0ab[_0x4d19('0x35')]=_[_0x4d19('0x33')](db[_0x4d19('0x4d')][_0x4d19('0x2e')]);_0x20e0ab['query']=_[_0x4d19('0x33')](_0x485771[_0x4d19('0x32')]);_0x20e0ab[_0x4d19('0x34')]=_[_0x4d19('0x37')](_0x20e0ab[_0x4d19('0x35')],_0x20e0ab[_0x4d19('0x32')]);_0x148950[_0x4d19('0x36')]=_['intersection'](_0x20e0ab['model'],qs[_0x4d19('0x38')](_0x485771[_0x4d19('0x32')][_0x4d19('0x38')]));_0x148950[_0x4d19('0x36')]=_0x148950[_0x4d19('0x36')][_0x4d19('0x46')]?_0x148950[_0x4d19('0x36')]:_0x20e0ab[_0x4d19('0x35')];_0x148950[_0x4d19('0x3a')]=qs['sort'](_0x485771['query'][_0x4d19('0x3b')]);_0x148950[_0x4d19('0x3c')]=qs[_0x4d19('0x34')](_[_0x4d19('0x3d')](_0x485771[_0x4d19('0x32')],_0x20e0ab[_0x4d19('0x34')]));if(_0x485771[_0x4d19('0x32')][_0x4d19('0x40')]){_0x148950['where']=_[_0x4d19('0x3e')](_0x148950[_0x4d19('0x3c')],{'$or':_['map'](_0x148950[_0x4d19('0x36')],function(_0x4ec803){var _0x2977ae={};_0x2977ae[_0x4ec803]={'$like':'%'+_0x485771[_0x4d19('0x32')][_0x4d19('0x40')]+'%'};return _0x2977ae;})});}_0x148950=_[_0x4d19('0x3e')]({},_0x148950,_0x485771[_0x4d19('0x41')]);return _0x4c24c2[_0x4d19('0x4b')](_0x148950);}})[_0x4d19('0x27')](function(_0x394b7e){if(_0x394b7e){_0x4a735c=_0x394b7e['length'];if(!_0x485771['query']['hasOwnProperty'](_0x4d19('0x4e'))){_0x148950[_0x4d19('0x20')]=qs[_0x4d19('0x20')](_0x485771[_0x4d19('0x32')][_0x4d19('0x20')]);_0x148950['offset']=qs[_0x4d19('0x1f')](_0x485771[_0x4d19('0x32')][_0x4d19('0x1f')]);}return _0x4c24c2['getFields'](_0x148950);}})[_0x4d19('0x27')](function(_0x294619){if(_0x294619){return _0x294619?{'count':_0x4a735c,'rows':_0x294619}:null;}})['then'](respondWithResult(_0x47593f,null))[_0x4d19('0x48')](handleError(_0x47593f,null));};exports[_0x4d19('0x4f')]=function(_0x36b712,_0x284691,_0x390e77){var _0x223cb4={};var _0x33ea35={};var _0x11a018;var _0x1af13e;return db[_0x4d19('0x2d')][_0x4d19('0x4c')]({'where':{'id':_0x36b712[_0x4d19('0x45')]['id']}})[_0x4d19('0x27')](handleEntityNotFound(_0x284691,null))[_0x4d19('0x27')](function(_0x1c0bdc){if(_0x1c0bdc){_0x11a018=_0x1c0bdc;_0x33ea35[_0x4d19('0x35')]=_[_0x4d19('0x33')](db[_0x4d19('0x4d')][_0x4d19('0x2e')]);_0x33ea35[_0x4d19('0x32')]=_[_0x4d19('0x33')](_0x36b712[_0x4d19('0x32')]);_0x33ea35['filters']=_[_0x4d19('0x37')](_0x33ea35['model'],_0x33ea35[_0x4d19('0x32')]);_0x223cb4[_0x4d19('0x36')]=_[_0x4d19('0x37')](_0x33ea35[_0x4d19('0x35')],qs[_0x4d19('0x38')](_0x36b712[_0x4d19('0x32')][_0x4d19('0x38')]));_0x223cb4[_0x4d19('0x36')]=_0x223cb4[_0x4d19('0x36')][_0x4d19('0x46')]?_0x223cb4[_0x4d19('0x36')]:_0x33ea35[_0x4d19('0x35')];_0x223cb4['order']=qs['sort'](_0x36b712['query'][_0x4d19('0x3b')]);_0x223cb4[_0x4d19('0x3c')]=qs[_0x4d19('0x34')](_[_0x4d19('0x3d')](_0x36b712['query'],_0x33ea35[_0x4d19('0x34')]));if(_0x36b712[_0x4d19('0x32')]['filter']){_0x223cb4[_0x4d19('0x3c')]=_['merge'](_0x223cb4[_0x4d19('0x3c')],{'$or':_[_0x4d19('0x31')](_0x223cb4[_0x4d19('0x36')],function(_0x44ee23){var _0x45797b={};_0x45797b[_0x44ee23]={'$like':'%'+_0x36b712[_0x4d19('0x32')]['filter']+'%'};return _0x45797b;})});}_0x223cb4=_['merge']({},_0x223cb4,_0x36b712[_0x4d19('0x41')]);return _0x11a018[_0x4d19('0x4f')](_0x223cb4);}})[_0x4d19('0x27')](function(_0x1c3bc6){if(_0x1c3bc6){_0x1af13e=_0x1c3bc6['length'];if(!_0x36b712[_0x4d19('0x32')][_0x4d19('0x39')](_0x4d19('0x4e'))){_0x223cb4[_0x4d19('0x20')]=qs['limit'](_0x36b712['query'][_0x4d19('0x20')]);_0x223cb4['offset']=qs['offset'](_0x36b712['query'][_0x4d19('0x1f')]);}return _0x11a018[_0x4d19('0x4f')](_0x223cb4);}})[_0x4d19('0x27')](function(_0x3313a2){if(_0x3313a2){return _0x3313a2?{'count':_0x1af13e,'rows':_0x3313a2}:null;}})[_0x4d19('0x27')](respondWithResult(_0x284691,null))[_0x4d19('0x48')](handleError(_0x284691,null));};exports[_0x4d19('0x50')]=function(_0x536936,_0x4bf269,_0x5b1b81){var _0x537243={};var _0x4d0de6={};var _0x186769;var _0x3face1;return db[_0x4d19('0x2d')][_0x4d19('0x4c')]({'where':{'id':_0x536936[_0x4d19('0x45')]['id']}})[_0x4d19('0x27')](handleEntityNotFound(_0x4bf269,null))[_0x4d19('0x27')](function(_0x3e91d4){if(_0x3e91d4){_0x186769=_0x3e91d4;_0x4d0de6['model']=_[_0x4d19('0x33')](db[_0x4d19('0x4d')]['rawAttributes']);_0x4d0de6['query']=_[_0x4d19('0x33')](_0x536936['query']);_0x4d0de6[_0x4d19('0x34')]=_[_0x4d19('0x37')](_0x4d0de6['model'],_0x4d0de6['query']);_0x537243[_0x4d19('0x36')]=_[_0x4d19('0x37')](_0x4d0de6['model'],qs['fields'](_0x536936['query'][_0x4d19('0x38')]));_0x537243['attributes']=_0x537243['attributes'][_0x4d19('0x46')]?_0x537243[_0x4d19('0x36')]:_0x4d0de6[_0x4d19('0x35')];_0x537243['order']=qs['sort'](_0x536936[_0x4d19('0x32')][_0x4d19('0x3b')]);_0x537243[_0x4d19('0x3c')]=qs[_0x4d19('0x34')](_[_0x4d19('0x3d')](_0x536936[_0x4d19('0x32')],_0x4d0de6[_0x4d19('0x34')]));if(_0x536936[_0x4d19('0x32')]['filter']){_0x537243['where']=_[_0x4d19('0x3e')](_0x537243[_0x4d19('0x3c')],{'$or':_['map'](_0x537243[_0x4d19('0x36')],function(_0x54d60d){var _0x23a827={};_0x23a827[_0x54d60d]={'$like':'%'+_0x536936[_0x4d19('0x32')][_0x4d19('0x40')]+'%'};return _0x23a827;})});}_0x537243=_[_0x4d19('0x3e')]({},_0x537243,_0x536936[_0x4d19('0x41')]);return _0x186769['getDescriptions'](_0x537243);}})[_0x4d19('0x27')](function(_0x53e353){if(_0x53e353){_0x3face1=_0x53e353[_0x4d19('0x46')];if(!_0x536936['query'][_0x4d19('0x39')](_0x4d19('0x4e'))){_0x537243[_0x4d19('0x20')]=qs[_0x4d19('0x20')](_0x536936[_0x4d19('0x32')][_0x4d19('0x20')]);_0x537243[_0x4d19('0x1f')]=qs[_0x4d19('0x1f')](_0x536936[_0x4d19('0x32')]['offset']);}return _0x186769[_0x4d19('0x50')](_0x537243);}})[_0x4d19('0x27')](function(_0x32b87b){if(_0x32b87b){return _0x32b87b?{'count':_0x3face1,'rows':_0x32b87b}:null;}})[_0x4d19('0x27')](respondWithResult(_0x4bf269,null))[_0x4d19('0x48')](handleError(_0x4bf269,null));}; \ No newline at end of file +var _0xbcc9=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','SugarcrmConfiguration','rows','catch','show','params','keys','find','create','body','update','destroy','getFields','findOne','length','getSubjects','order','getDescriptions','SugarcrmField','eml-format','rimraf','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x2bef51,_0x3549d3){var _0x29097d=function(_0x29ca79){while(--_0x29ca79){_0x2bef51['push'](_0x2bef51['shift']());}};_0x29097d(++_0x3549d3);}(_0xbcc9,0x85));var _0x9bcc=function(_0x2fe50f,_0x292fbf){_0x2fe50f=_0x2fe50f-0x0;var _0x5d5033=_0xbcc9[_0x2fe50f];return _0x5d5033;};'use strict';var emlformat=require(_0x9bcc('0x0'));var rimraf=require(_0x9bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9bcc('0x2'));var moment=require(_0x9bcc('0x3'));var BPromise=require(_0x9bcc('0x4'));var Mustache=require(_0x9bcc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9bcc('0x6'));var ejs=require(_0x9bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x9bcc('0x8'));var _=require(_0x9bcc('0x9'));var squel=require(_0x9bcc('0xa'));var crypto=require(_0x9bcc('0xb'));var jsforce=require(_0x9bcc('0xc'));var deskjs=require(_0x9bcc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9bcc('0xe'));var Papa=require('papaparse');var Redis=require(_0x9bcc('0xf'));var authService=require(_0x9bcc('0x10'));var qs=require(_0x9bcc('0x11'));var as=require(_0x9bcc('0x12'));var hardwareService=require(_0x9bcc('0x13'));var logger=require('../../config/logger')(_0x9bcc('0x14'));var utils=require('../../config/utils');var config=require(_0x9bcc('0x15'));var licenseUtil=require(_0x9bcc('0x16'));var db=require(_0x9bcc('0x17'))['db'];function respondWithStatusCode(_0x2f3173,_0x411a8e){_0x411a8e=_0x411a8e||0xcc;return function(_0x433034){if(_0x433034){return _0x2f3173[_0x9bcc('0x18')](_0x411a8e);}return _0x2f3173[_0x9bcc('0x19')](_0x411a8e)[_0x9bcc('0x1a')]();};}function respondWithResult(_0x4c92ce,_0x52bab9){_0x52bab9=_0x52bab9||0xc8;return function(_0x3c7bc0){if(_0x3c7bc0){return _0x4c92ce[_0x9bcc('0x19')](_0x52bab9)[_0x9bcc('0x1b')](_0x3c7bc0);}};}function respondWithFilteredResult(_0x4eee56,_0x20ff9e){return function(_0xbd4b1f){if(_0xbd4b1f){var _0x1f1faf=typeof _0x20ff9e['offset']===_0x9bcc('0x1c')&&typeof _0x20ff9e[_0x9bcc('0x1d')]===_0x9bcc('0x1c');var _0x3e2b10=_0xbd4b1f[_0x9bcc('0x1e')];var _0x332077=_0x1f1faf?0x0:_0x20ff9e[_0x9bcc('0x1f')];var _0x5d7d9a=_0x1f1faf?_0xbd4b1f[_0x9bcc('0x1e')]:_0x20ff9e['offset']+_0x20ff9e[_0x9bcc('0x1d')];var _0x527ab2;if(_0x5d7d9a>=_0x3e2b10){_0x5d7d9a=_0x3e2b10;_0x527ab2=0xc8;}else{_0x527ab2=0xce;}_0x4eee56[_0x9bcc('0x19')](_0x527ab2);return _0x4eee56[_0x9bcc('0x20')](_0x9bcc('0x21'),_0x332077+'-'+_0x5d7d9a+'/'+_0x3e2b10)['json'](_0xbd4b1f);}return null;};}function patchUpdates(_0x2ac1f5){return function(_0x73b8f0){try{jsonpatch[_0x9bcc('0x22')](_0x73b8f0,_0x2ac1f5,!![]);}catch(_0x370117){return BPromise[_0x9bcc('0x23')](_0x370117);}return _0x73b8f0[_0x9bcc('0x24')]();};}function saveUpdates(_0x4fd668,_0x499bae){return function(_0x2474f4){if(_0x2474f4){return _0x2474f4['update'](_0x4fd668)[_0x9bcc('0x25')](function(_0x2aaf45){return _0x2aaf45;});}return null;};}function removeEntity(_0x39a87c,_0x1a6dc1){return function(_0x4fbd4a){if(_0x4fbd4a){return _0x4fbd4a['destroy']()[_0x9bcc('0x25')](function(){_0x39a87c[_0x9bcc('0x19')](0xcc)[_0x9bcc('0x1a')]();});}};}function handleEntityNotFound(_0x5340a2,_0x528b3e){return function(_0x3626e0){if(!_0x3626e0){_0x5340a2['sendStatus'](0x194);}return _0x3626e0;};}function handleError(_0x46d983,_0x17afaf){_0x17afaf=_0x17afaf||0x1f4;return function(_0x1c5760){logger['error'](_0x1c5760['stack']);if(_0x1c5760[_0x9bcc('0x26')]){delete _0x1c5760[_0x9bcc('0x26')];}_0x46d983['status'](_0x17afaf)[_0x9bcc('0x27')](_0x1c5760);};}exports[_0x9bcc('0x28')]=function(_0x14c9bd,_0x214501){var _0x272818={},_0x4f0f5a={},_0x390f74={'count':0x0,'rows':[]};var _0x1bd804=_[_0x9bcc('0x29')](db['SugarcrmConfiguration'][_0x9bcc('0x2a')],function(_0xafe151){return{'name':_0xafe151[_0x9bcc('0x2b')],'type':_0xafe151[_0x9bcc('0x2c')][_0x9bcc('0x2d')]};});_0x4f0f5a[_0x9bcc('0x2e')]=_[_0x9bcc('0x29')](_0x1bd804,_0x9bcc('0x26'));_0x4f0f5a[_0x9bcc('0x2f')]=_['keys'](_0x14c9bd[_0x9bcc('0x2f')]);_0x4f0f5a[_0x9bcc('0x30')]=_[_0x9bcc('0x31')](_0x4f0f5a[_0x9bcc('0x2e')],_0x4f0f5a[_0x9bcc('0x2f')]);_0x272818[_0x9bcc('0x32')]=_['intersection'](_0x4f0f5a['model'],qs[_0x9bcc('0x33')](_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x33')]));_0x272818['attributes']=_0x272818[_0x9bcc('0x32')]['length']?_0x272818[_0x9bcc('0x32')]:_0x4f0f5a['model'];if(!_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x34')](_0x9bcc('0x35'))){_0x272818['limit']=qs['limit'](_0x14c9bd['query']['limit']);_0x272818['offset']=qs[_0x9bcc('0x1f')](_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x1f')]);}_0x272818['order']=qs['sort'](_0x14c9bd['query'][_0x9bcc('0x36')]);_0x272818[_0x9bcc('0x37')]=qs['filters'](_[_0x9bcc('0x38')](_0x14c9bd[_0x9bcc('0x2f')],_0x4f0f5a['filters']),_0x1bd804);if(_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x39')]){_0x272818[_0x9bcc('0x37')]=_[_0x9bcc('0x3a')](_0x272818[_0x9bcc('0x37')],{'$or':_[_0x9bcc('0x29')](_0x1bd804,function(_0x3cc69e){if(_0x3cc69e[_0x9bcc('0x2c')]!=='VIRTUAL'){var _0x92407b={};_0x92407b[_0x3cc69e['name']]={'$like':'%'+_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x39')]+'%'};return _0x92407b;}})});}_0x272818=_[_0x9bcc('0x3a')]({},_0x272818,_0x14c9bd[_0x9bcc('0x3b')]);var _0x1457ce={'where':_0x272818[_0x9bcc('0x37')]};return db['SugarcrmConfiguration'][_0x9bcc('0x1e')](_0x1457ce)[_0x9bcc('0x25')](function(_0x598832){_0x390f74[_0x9bcc('0x1e')]=_0x598832;if(_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x3c')]){_0x272818[_0x9bcc('0x3d')]=[{'all':!![]}];}return db[_0x9bcc('0x3e')]['findAll'](_0x272818);})['then'](function(_0x3e138e){_0x390f74[_0x9bcc('0x3f')]=_0x3e138e;return _0x390f74;})[_0x9bcc('0x25')](respondWithFilteredResult(_0x214501,_0x272818))[_0x9bcc('0x40')](handleError(_0x214501,null));};exports[_0x9bcc('0x41')]=function(_0x46e105,_0x5ac685){var _0x51668a={'raw':![],'where':{'id':_0x46e105[_0x9bcc('0x42')]['id']}},_0x1d8462={};_0x1d8462['model']=_[_0x9bcc('0x43')](db[_0x9bcc('0x3e')]['rawAttributes']);_0x1d8462[_0x9bcc('0x2f')]=_[_0x9bcc('0x43')](_0x46e105[_0x9bcc('0x2f')]);_0x1d8462[_0x9bcc('0x30')]=_['intersection'](_0x1d8462['model'],_0x1d8462[_0x9bcc('0x2f')]);_0x51668a[_0x9bcc('0x32')]=_['intersection'](_0x1d8462['model'],qs['fields'](_0x46e105[_0x9bcc('0x2f')]['fields']));_0x51668a['attributes']=_0x51668a['attributes']['length']?_0x51668a[_0x9bcc('0x32')]:_0x1d8462[_0x9bcc('0x2e')];if(_0x46e105['query']['includeAll']){_0x51668a['include']=[{'all':!![]}];}_0x51668a=_[_0x9bcc('0x3a')]({},_0x51668a,_0x46e105[_0x9bcc('0x3b')]);return db[_0x9bcc('0x3e')][_0x9bcc('0x44')](_0x51668a)[_0x9bcc('0x25')](handleEntityNotFound(_0x5ac685,null))[_0x9bcc('0x25')](respondWithResult(_0x5ac685,null))[_0x9bcc('0x40')](handleError(_0x5ac685,null));};exports[_0x9bcc('0x45')]=function(_0x237f61,_0x551055){return db[_0x9bcc('0x3e')]['create'](_0x237f61[_0x9bcc('0x46')],{})[_0x9bcc('0x25')](respondWithResult(_0x551055,0xc9))[_0x9bcc('0x40')](handleError(_0x551055,null));};exports[_0x9bcc('0x47')]=function(_0x43850d,_0x46d2f8){if(_0x43850d['body']['id']){delete _0x43850d['body']['id'];}return db[_0x9bcc('0x3e')][_0x9bcc('0x44')]({'where':{'id':_0x43850d[_0x9bcc('0x42')]['id']}})[_0x9bcc('0x25')](handleEntityNotFound(_0x46d2f8,null))[_0x9bcc('0x25')](saveUpdates(_0x43850d['body'],null))[_0x9bcc('0x25')](respondWithResult(_0x46d2f8,null))[_0x9bcc('0x40')](handleError(_0x46d2f8,null));};exports[_0x9bcc('0x48')]=function(_0x240a14,_0x25bcd6){return db[_0x9bcc('0x3e')][_0x9bcc('0x44')]({'where':{'id':_0x240a14[_0x9bcc('0x42')]['id']}})['then'](handleEntityNotFound(_0x25bcd6,null))[_0x9bcc('0x25')](removeEntity(_0x25bcd6,null))['catch'](handleError(_0x25bcd6,null));};exports[_0x9bcc('0x49')]=function(_0x5081c5,_0x289699,_0x47d2e2){var _0x189f50={};var _0x44f4d9={};var _0x16c730;var _0x15909f;return db[_0x9bcc('0x3e')][_0x9bcc('0x4a')]({'where':{'id':_0x5081c5['params']['id']}})['then'](handleEntityNotFound(_0x289699,null))[_0x9bcc('0x25')](function(_0x237e2d){if(_0x237e2d){_0x16c730=_0x237e2d;_0x44f4d9['model']=_[_0x9bcc('0x43')](db['SugarcrmField']['rawAttributes']);_0x44f4d9['query']=_[_0x9bcc('0x43')](_0x5081c5[_0x9bcc('0x2f')]);_0x44f4d9[_0x9bcc('0x30')]=_[_0x9bcc('0x31')](_0x44f4d9[_0x9bcc('0x2e')],_0x44f4d9['query']);_0x189f50[_0x9bcc('0x32')]=_[_0x9bcc('0x31')](_0x44f4d9[_0x9bcc('0x2e')],qs[_0x9bcc('0x33')](_0x5081c5[_0x9bcc('0x2f')][_0x9bcc('0x33')]));_0x189f50[_0x9bcc('0x32')]=_0x189f50['attributes'][_0x9bcc('0x4b')]?_0x189f50[_0x9bcc('0x32')]:_0x44f4d9[_0x9bcc('0x2e')];_0x189f50['order']=qs[_0x9bcc('0x36')](_0x5081c5[_0x9bcc('0x2f')][_0x9bcc('0x36')]);_0x189f50[_0x9bcc('0x37')]=qs['filters'](_[_0x9bcc('0x38')](_0x5081c5['query'],_0x44f4d9[_0x9bcc('0x30')]));if(_0x5081c5[_0x9bcc('0x2f')]['filter']){_0x189f50[_0x9bcc('0x37')]=_[_0x9bcc('0x3a')](_0x189f50[_0x9bcc('0x37')],{'$or':_[_0x9bcc('0x29')](_0x189f50[_0x9bcc('0x32')],function(_0x5dfbdb){var _0x29970e={};_0x29970e[_0x5dfbdb]={'$like':'%'+_0x5081c5[_0x9bcc('0x2f')]['filter']+'%'};return _0x29970e;})});}_0x189f50=_[_0x9bcc('0x3a')]({},_0x189f50,_0x5081c5[_0x9bcc('0x3b')]);return _0x16c730[_0x9bcc('0x49')](_0x189f50);}})[_0x9bcc('0x25')](function(_0x1f67d0){if(_0x1f67d0){_0x15909f=_0x1f67d0[_0x9bcc('0x4b')];if(!_0x5081c5[_0x9bcc('0x2f')][_0x9bcc('0x34')](_0x9bcc('0x35'))){_0x189f50[_0x9bcc('0x1d')]=qs['limit'](_0x5081c5['query'][_0x9bcc('0x1d')]);_0x189f50[_0x9bcc('0x1f')]=qs[_0x9bcc('0x1f')](_0x5081c5[_0x9bcc('0x2f')]['offset']);}return _0x16c730[_0x9bcc('0x49')](_0x189f50);}})[_0x9bcc('0x25')](function(_0x532770){if(_0x532770){return _0x532770?{'count':_0x15909f,'rows':_0x532770}:null;}})[_0x9bcc('0x25')](respondWithResult(_0x289699,null))[_0x9bcc('0x40')](handleError(_0x289699,null));};exports[_0x9bcc('0x4c')]=function(_0x450fa9,_0x111de9,_0x2abe14){var _0x32bce0={};var _0x28ab6f={};var _0x1474e0;var _0x5bb286;return db[_0x9bcc('0x3e')][_0x9bcc('0x4a')]({'where':{'id':_0x450fa9['params']['id']}})['then'](handleEntityNotFound(_0x111de9,null))[_0x9bcc('0x25')](function(_0x1ad0bf){if(_0x1ad0bf){_0x1474e0=_0x1ad0bf;_0x28ab6f[_0x9bcc('0x2e')]=_['keys'](db['SugarcrmField'][_0x9bcc('0x2a')]);_0x28ab6f[_0x9bcc('0x2f')]=_[_0x9bcc('0x43')](_0x450fa9[_0x9bcc('0x2f')]);_0x28ab6f[_0x9bcc('0x30')]=_[_0x9bcc('0x31')](_0x28ab6f[_0x9bcc('0x2e')],_0x28ab6f[_0x9bcc('0x2f')]);_0x32bce0['attributes']=_[_0x9bcc('0x31')](_0x28ab6f['model'],qs['fields'](_0x450fa9[_0x9bcc('0x2f')][_0x9bcc('0x33')]));_0x32bce0['attributes']=_0x32bce0['attributes']['length']?_0x32bce0[_0x9bcc('0x32')]:_0x28ab6f['model'];_0x32bce0[_0x9bcc('0x4d')]=qs[_0x9bcc('0x36')](_0x450fa9[_0x9bcc('0x2f')][_0x9bcc('0x36')]);_0x32bce0['where']=qs[_0x9bcc('0x30')](_['pick'](_0x450fa9[_0x9bcc('0x2f')],_0x28ab6f['filters']));if(_0x450fa9['query'][_0x9bcc('0x39')]){_0x32bce0[_0x9bcc('0x37')]=_[_0x9bcc('0x3a')](_0x32bce0[_0x9bcc('0x37')],{'$or':_[_0x9bcc('0x29')](_0x32bce0[_0x9bcc('0x32')],function(_0x3a0f2d){var _0x1e017b={};_0x1e017b[_0x3a0f2d]={'$like':'%'+_0x450fa9['query'][_0x9bcc('0x39')]+'%'};return _0x1e017b;})});}_0x32bce0=_[_0x9bcc('0x3a')]({},_0x32bce0,_0x450fa9[_0x9bcc('0x3b')]);return _0x1474e0[_0x9bcc('0x4c')](_0x32bce0);}})[_0x9bcc('0x25')](function(_0x31da42){if(_0x31da42){_0x5bb286=_0x31da42[_0x9bcc('0x4b')];if(!_0x450fa9['query']['hasOwnProperty']('nolimit')){_0x32bce0[_0x9bcc('0x1d')]=qs['limit'](_0x450fa9[_0x9bcc('0x2f')][_0x9bcc('0x1d')]);_0x32bce0[_0x9bcc('0x1f')]=qs['offset'](_0x450fa9['query']['offset']);}return _0x1474e0[_0x9bcc('0x4c')](_0x32bce0);}})[_0x9bcc('0x25')](function(_0x2db804){if(_0x2db804){return _0x2db804?{'count':_0x5bb286,'rows':_0x2db804}:null;}})[_0x9bcc('0x25')](respondWithResult(_0x111de9,null))[_0x9bcc('0x40')](handleError(_0x111de9,null));};exports[_0x9bcc('0x4e')]=function(_0x8dd12c,_0x30749f,_0x10b80e){var _0x5db8e2={};var _0x5c35a1={};var _0xc2a1f0;var _0x26bd45;return db[_0x9bcc('0x3e')]['findOne']({'where':{'id':_0x8dd12c[_0x9bcc('0x42')]['id']}})[_0x9bcc('0x25')](handleEntityNotFound(_0x30749f,null))[_0x9bcc('0x25')](function(_0x585c64){if(_0x585c64){_0xc2a1f0=_0x585c64;_0x5c35a1[_0x9bcc('0x2e')]=_[_0x9bcc('0x43')](db[_0x9bcc('0x4f')][_0x9bcc('0x2a')]);_0x5c35a1[_0x9bcc('0x2f')]=_[_0x9bcc('0x43')](_0x8dd12c[_0x9bcc('0x2f')]);_0x5c35a1[_0x9bcc('0x30')]=_['intersection'](_0x5c35a1[_0x9bcc('0x2e')],_0x5c35a1['query']);_0x5db8e2[_0x9bcc('0x32')]=_[_0x9bcc('0x31')](_0x5c35a1[_0x9bcc('0x2e')],qs[_0x9bcc('0x33')](_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x33')]));_0x5db8e2[_0x9bcc('0x32')]=_0x5db8e2[_0x9bcc('0x32')][_0x9bcc('0x4b')]?_0x5db8e2[_0x9bcc('0x32')]:_0x5c35a1['model'];_0x5db8e2[_0x9bcc('0x4d')]=qs[_0x9bcc('0x36')](_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x36')]);_0x5db8e2[_0x9bcc('0x37')]=qs[_0x9bcc('0x30')](_[_0x9bcc('0x38')](_0x8dd12c['query'],_0x5c35a1[_0x9bcc('0x30')]));if(_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x39')]){_0x5db8e2['where']=_['merge'](_0x5db8e2[_0x9bcc('0x37')],{'$or':_[_0x9bcc('0x29')](_0x5db8e2[_0x9bcc('0x32')],function(_0x477eb7){var _0x19e05b={};_0x19e05b[_0x477eb7]={'$like':'%'+_0x8dd12c[_0x9bcc('0x2f')]['filter']+'%'};return _0x19e05b;})});}_0x5db8e2=_[_0x9bcc('0x3a')]({},_0x5db8e2,_0x8dd12c['options']);return _0xc2a1f0[_0x9bcc('0x4e')](_0x5db8e2);}})['then'](function(_0x7976ea){if(_0x7976ea){_0x26bd45=_0x7976ea['length'];if(!_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x34')]('nolimit')){_0x5db8e2['limit']=qs[_0x9bcc('0x1d')](_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x1d')]);_0x5db8e2['offset']=qs[_0x9bcc('0x1f')](_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x1f')]);}return _0xc2a1f0[_0x9bcc('0x4e')](_0x5db8e2);}})[_0x9bcc('0x25')](function(_0x447af9){if(_0x447af9){return _0x447af9?{'count':_0x26bd45,'rows':_0x447af9}:null;}})[_0x9bcc('0x25')](respondWithResult(_0x30749f,null))[_0x9bcc('0x40')](handleError(_0x30749f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 856de9e..51b2b2b 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 _0x5ea3=['bluebird','request-promise','../../config/environment','exports','define','int_sugarcrm_configurations','util','../../config/logger','moment'];(function(_0x2b4736,_0x5079b7){var _0x357cd0=function(_0x2ed3f3){while(--_0x2ed3f3){_0x2b4736['push'](_0x2b4736['shift']());}};_0x357cd0(++_0x5079b7);}(_0x5ea3,0x14a));var _0x35ea=function(_0x1b12ec,_0x31f00d){_0x1b12ec=_0x1b12ec-0x0;var _0x43c4c0=_0x5ea3[_0x1b12ec];return _0x43c4c0;};'use strict';var _=require('lodash');var util=require(_0x35ea('0x0'));var logger=require(_0x35ea('0x1'))('api');var moment=require(_0x35ea('0x2'));var BPromise=require(_0x35ea('0x3'));var rp=require(_0x35ea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x35ea('0x5'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x35ea('0x6')]=function(_0x2f76c8,_0x8f851f){return _0x2f76c8[_0x35ea('0x7')]('SugarcrmConfiguration',attributes,{'tableName':_0x35ea('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb82a=['request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x1b24eb,_0x39029e){var _0x157b17=function(_0x2ddb83){while(--_0x2ddb83){_0x1b24eb['push'](_0x1b24eb['shift']());}};_0x157b17(++_0x39029e);}(_0xb82a,0xbe));var _0xab82=function(_0x1dfab5,_0x41cc42){_0x1dfab5=_0x1dfab5-0x0;var _0x425a53=_0xb82a[_0x1dfab5];return _0x425a53;};'use strict';var _=require(_0xab82('0x0'));var util=require(_0xab82('0x1'));var logger=require(_0xab82('0x2'))(_0xab82('0x3'));var moment=require(_0xab82('0x4'));var BPromise=require('bluebird');var rp=require(_0xab82('0x5'));var fs=require('fs');var path=require(_0xab82('0x6'));var rimraf=require(_0xab82('0x7'));var config=require(_0xab82('0x8'));var attributes=require(_0xab82('0x9'));module[_0xab82('0xa')]=function(_0x3d88c6,_0x2d0080){return _0x3d88c6[_0xab82('0xb')](_0xab82('0xc'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index c41cd19..32be02f 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 _0x0842=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x500853,_0xbffce1){var _0x5c6c98=function(_0x56847d){while(--_0x56847d){_0x500853['push'](_0x500853['shift']());}};_0x5c6c98(++_0xbffce1);}(_0x0842,0x85));var _0x2084=function(_0x4b034d,_0x4503f0){_0x4b034d=_0x4b034d-0x0;var _0x144c84=_0x0842[_0x4b034d];return _0x144c84;};'use strict';var _=require(_0x2084('0x0'));var util=require('util');var moment=require(_0x2084('0x1'));var BPromise=require(_0x2084('0x2'));var rs=require(_0x2084('0x3'));var fs=require('fs');var Redis=require(_0x2084('0x4'));var db=require(_0x2084('0x5'))['db'];var utils=require(_0x2084('0x6'));var logger=require(_0x2084('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2084('0x8'));var client=jayson[_0x2084('0x9')][_0x2084('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e9f16,_0x4f16d2,_0x23c452){return new BPromise(function(_0x1672df,_0x175f3c){return client['request'](_0x1e9f16,_0x23c452)[_0x2084('0xb')](function(_0x3ef95b){logger['info'](_0x2084('0xc'),_0x4f16d2,_0x2084('0xd'));logger[_0x2084('0xe')](_0x2084('0xf'),_0x4f16d2,_0x2084('0xd'),JSON[_0x2084('0x10')](_0x3ef95b));if(_0x3ef95b['error']){if(_0x3ef95b[_0x2084('0x11')][_0x2084('0x12')]===0x1f4){logger[_0x2084('0x11')](_0x2084('0xc'),_0x4f16d2,_0x3ef95b['error'][_0x2084('0x13')]);return _0x175f3c(_0x3ef95b[_0x2084('0x11')][_0x2084('0x13')]);}logger[_0x2084('0x11')](_0x2084('0xc'),_0x4f16d2,_0x3ef95b['error'][_0x2084('0x13')]);return _0x1672df(_0x3ef95b['error']['message']);}else{logger[_0x2084('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f16d2,'request\x20sent');_0x1672df(_0x3ef95b[_0x2084('0x15')][_0x2084('0x13')]);}})[_0x2084('0x16')](function(_0x2cd1d1){logger[_0x2084('0x11')](_0x2084('0xc'),_0x4f16d2,_0x2cd1d1);_0x175f3c(_0x2cd1d1);});});} \ No newline at end of file +var _0x4d1b=['../../config/environment','jayson/promise','client','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x4d1b,0x186));var _0xb4d1=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x4d1b[_0x56ba92];return _0x8fe94d;};'use strict';var _=require(_0xb4d1('0x0'));var util=require(_0xb4d1('0x1'));var moment=require(_0xb4d1('0x2'));var BPromise=require(_0xb4d1('0x3'));var rs=require(_0xb4d1('0x4'));var fs=require('fs');var Redis=require(_0xb4d1('0x5'));var db=require(_0xb4d1('0x6'))['db'];var utils=require(_0xb4d1('0x7'));var logger=require(_0xb4d1('0x8'))('rpc');var config=require(_0xb4d1('0x9'));var jayson=require(_0xb4d1('0xa'));var client=jayson[_0xb4d1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24fc78,_0x4ed9cf,_0x4c408b){return new BPromise(function(_0x15a974,_0x39caeb){return client[_0xb4d1('0xc')](_0x24fc78,_0x4c408b)['then'](function(_0xebd1c1){logger[_0xb4d1('0xd')](_0xb4d1('0xe'),_0x4ed9cf,'request\x20sent');logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4ed9cf,_0xb4d1('0xf'),JSON['stringify'](_0xebd1c1));if(_0xebd1c1[_0xb4d1('0x10')]){if(_0xebd1c1[_0xb4d1('0x10')][_0xb4d1('0x11')]===0x1f4){logger[_0xb4d1('0x10')](_0xb4d1('0xe'),_0x4ed9cf,_0xebd1c1[_0xb4d1('0x10')][_0xb4d1('0x12')]);return _0x39caeb(_0xebd1c1[_0xb4d1('0x10')][_0xb4d1('0x12')]);}logger[_0xb4d1('0x10')](_0xb4d1('0xe'),_0x4ed9cf,_0xebd1c1['error'][_0xb4d1('0x12')]);return _0x15a974(_0xebd1c1[_0xb4d1('0x10')]['message']);}else{logger[_0xb4d1('0xd')](_0xb4d1('0xe'),_0x4ed9cf,_0xb4d1('0xf'));_0x15a974(_0xebd1c1[_0xb4d1('0x13')][_0xb4d1('0x12')]);}})[_0xb4d1('0x14')](function(_0x27bef5){logger[_0xb4d1('0x10')](_0xb4d1('0xe'),_0x4ed9cf,_0x27bef5);_0x39caeb(_0x27bef5);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index a4ed3b1..331a8c1 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 _0x0bf6=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete'];(function(_0x3edbfc,_0x4d1508){var _0x54438e=function(_0x40b578){while(--_0x40b578){_0x3edbfc['push'](_0x3edbfc['shift']());}};_0x54438e(++_0x4d1508);}(_0x0bf6,0xd8));var _0x60bf=function(_0x3c4b08,_0xfd606c){_0x3c4b08=_0x3c4b08-0x0;var _0xdfa64=_0x0bf6[_0x3c4b08];return _0xdfa64;};'use strict';var multer=require(_0x60bf('0x0'));var util=require(_0x60bf('0x1'));var path=require(_0x60bf('0x2'));var timeout=require('connect-timeout');var express=require(_0x60bf('0x3'));var router=express[_0x60bf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x60bf('0x5'));var interaction=require(_0x60bf('0x6'));var config=require(_0x60bf('0x7'));var controller=require(_0x60bf('0x8'));router[_0x60bf('0x9')]('/',auth[_0x60bf('0xa')](),controller[_0x60bf('0xb')]);router[_0x60bf('0x9')]('/:id',auth[_0x60bf('0xa')](),controller[_0x60bf('0xc')]);router[_0x60bf('0xd')]('/',auth[_0x60bf('0xa')](),controller[_0x60bf('0xe')]);router['put'](_0x60bf('0xf'),auth[_0x60bf('0xa')](),controller[_0x60bf('0x10')]);router[_0x60bf('0x11')](_0x60bf('0xf'),auth[_0x60bf('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa164=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','util','path','express'];(function(_0x41cd72,_0x21ec2d){var _0x135784=function(_0x2ab205){while(--_0x2ab205){_0x41cd72['push'](_0x41cd72['shift']());}};_0x135784(++_0x21ec2d);}(_0xa164,0x106));var _0x4a16=function(_0x1af1e8,_0x3527e9){_0x1af1e8=_0x1af1e8-0x0;var _0x4659ae=_0xa164[_0x1af1e8];return _0x4659ae;};'use strict';var multer=require(_0x4a16('0x0'));var util=require(_0x4a16('0x1'));var path=require(_0x4a16('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a16('0x3'));var router=express[_0x4a16('0x4')]();var fs_extra=require(_0x4a16('0x5'));var auth=require(_0x4a16('0x6'));var interaction=require(_0x4a16('0x7'));var config=require(_0x4a16('0x8'));var controller=require(_0x4a16('0x9'));router[_0x4a16('0xa')]('/',auth[_0x4a16('0xb')](),controller['index']);router[_0x4a16('0xa')](_0x4a16('0xc'),auth[_0x4a16('0xb')](),controller[_0x4a16('0xd')]);router[_0x4a16('0xe')]('/',auth[_0x4a16('0xb')](),controller[_0x4a16('0xf')]);router['put'](_0x4a16('0xc'),auth[_0x4a16('0xb')](),controller[_0x4a16('0x10')]);router['delete']('/:id',auth[_0x4a16('0xb')](),controller[_0x4a16('0x11')]);module[_0x4a16('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 8874f7d..a099fea 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 _0xf930=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x4f388f,_0x5bc1df){var _0x2e5fa2=function(_0x4bdb85){while(--_0x4bdb85){_0x4f388f['push'](_0x4f388f['shift']());}};_0x2e5fa2(++_0x5bc1df);}(_0xf930,0x129));var _0x0f93=function(_0x4fb930,_0x4141c4){_0x4fb930=_0x4fb930-0x0;var _0x59adc4=_0xf930[_0x4fb930];return _0x59adc4;};'use strict';var Sequelize=require('sequelize');module[_0x0f93('0x0')]={'type':{'type':Sequelize[_0x0f93('0x1')](_0x0f93('0x2'),_0x0f93('0x3'),_0x0f93('0x4'),_0x0f93('0x5'),_0x0f93('0x6')),'defaultValue':_0x0f93('0x2')},'content':{'type':Sequelize[_0x0f93('0x7')]},'key':{'type':Sequelize[_0x0f93('0x7')]},'keyType':{'type':Sequelize[_0x0f93('0x1')]('string',_0x0f93('0x3'),_0x0f93('0x4'))},'keyContent':{'type':Sequelize[_0x0f93('0x7')]},'idField':{'type':Sequelize[_0x0f93('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0f93('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x53ab=['customVariable','picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x53ab,0x75));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb53a('0x0'));module['exports']={'type':{'type':Sequelize[_0xb53a('0x1')]('string',_0xb53a('0x2'),_0xb53a('0x3'),'keyValue',_0xb53a('0x4')),'defaultValue':_0xb53a('0x5')},'content':{'type':Sequelize[_0xb53a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb53a('0x1')](_0xb53a('0x5'),_0xb53a('0x2'),_0xb53a('0x3'))},'keyContent':{'type':Sequelize[_0xb53a('0x6')]},'idField':{'type':Sequelize[_0xb53a('0x6')]},'nameField':{'type':Sequelize[_0xb53a('0x6')]},'customField':{'type':Sequelize[_0xb53a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb53a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 9e0842f..9f055e5 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 _0x6f86=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmField','includeAll','include','findAll','catch','show','params','find','create','body','update','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','reject','save','then','destroy','error','name','send','map','rawAttributes','type','key','model'];(function(_0x5318f5,_0x43bf80){var _0xdea691=function(_0x51c30d){while(--_0x51c30d){_0x5318f5['push'](_0x5318f5['shift']());}};_0xdea691(++_0x43bf80);}(_0x6f86,0xa9));var _0x66f8=function(_0xbd2356,_0x441dc9){_0xbd2356=_0xbd2356-0x0;var _0xf0b100=_0x6f86[_0xbd2356];return _0xf0b100;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x66f8('0x0'));var jsonpatch=require(_0x66f8('0x1'));var rp=require(_0x66f8('0x2'));var moment=require(_0x66f8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x66f8('0x4'));var util=require(_0x66f8('0x5'));var path=require(_0x66f8('0x6'));var sox=require(_0x66f8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66f8('0x8'));var _=require(_0x66f8('0x9'));var squel=require(_0x66f8('0xa'));var crypto=require(_0x66f8('0xb'));var jsforce=require(_0x66f8('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x66f8('0xd'));var Papa=require('papaparse');var Redis=require(_0x66f8('0xe'));var authService=require(_0x66f8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x66f8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x66f8('0x11'))(_0x66f8('0x12'));var utils=require(_0x66f8('0x13'));var config=require(_0x66f8('0x14'));var licenseUtil=require(_0x66f8('0x15'));var db=require(_0x66f8('0x16'))['db'];function respondWithStatusCode(_0x4580de,_0x356afb){_0x356afb=_0x356afb||0xcc;return function(_0x5c7dcc){if(_0x5c7dcc){return _0x4580de[_0x66f8('0x17')](_0x356afb);}return _0x4580de['status'](_0x356afb)[_0x66f8('0x18')]();};}function respondWithResult(_0x117679,_0x493039){_0x493039=_0x493039||0xc8;return function(_0xded6f){if(_0xded6f){return _0x117679['status'](_0x493039)['json'](_0xded6f);}};}function respondWithFilteredResult(_0x192ba4,_0x34e77b){return function(_0x19e480){if(_0x19e480){var _0x47bef8=typeof _0x34e77b[_0x66f8('0x19')]===_0x66f8('0x1a')&&typeof _0x34e77b[_0x66f8('0x1b')]===_0x66f8('0x1a');var _0x2fc8b2=_0x19e480[_0x66f8('0x1c')];var _0x5bedb3=_0x47bef8?0x0:_0x34e77b[_0x66f8('0x19')];var _0x468982=_0x47bef8?_0x19e480[_0x66f8('0x1c')]:_0x34e77b['offset']+_0x34e77b[_0x66f8('0x1b')];var _0x57b125;if(_0x468982>=_0x2fc8b2){_0x468982=_0x2fc8b2;_0x57b125=0xc8;}else{_0x57b125=0xce;}_0x192ba4[_0x66f8('0x1d')](_0x57b125);return _0x192ba4[_0x66f8('0x1e')](_0x66f8('0x1f'),_0x5bedb3+'-'+_0x468982+'/'+_0x2fc8b2)['json'](_0x19e480);}return null;};}function patchUpdates(_0x4ba1aa){return function(_0x5f3d64){try{jsonpatch['apply'](_0x5f3d64,_0x4ba1aa,!![]);}catch(_0x1b0049){return BPromise[_0x66f8('0x20')](_0x1b0049);}return _0x5f3d64[_0x66f8('0x21')]();};}function saveUpdates(_0x471092,_0x571e18){return function(_0x924aab){if(_0x924aab){return _0x924aab['update'](_0x471092)[_0x66f8('0x22')](function(_0x4a17a6){return _0x4a17a6;});}return null;};}function removeEntity(_0x4fe122,_0x482525){return function(_0x2a71cc){if(_0x2a71cc){return _0x2a71cc[_0x66f8('0x23')]()[_0x66f8('0x22')](function(){_0x4fe122[_0x66f8('0x1d')](0xcc)[_0x66f8('0x18')]();});}};}function handleEntityNotFound(_0x478e59,_0x3fe028){return function(_0x266adf){if(!_0x266adf){_0x478e59[_0x66f8('0x17')](0x194);}return _0x266adf;};}function handleError(_0x2499ac,_0x14beef){_0x14beef=_0x14beef||0x1f4;return function(_0x1af183){logger[_0x66f8('0x24')](_0x1af183['stack']);if(_0x1af183[_0x66f8('0x25')]){delete _0x1af183[_0x66f8('0x25')];}_0x2499ac[_0x66f8('0x1d')](_0x14beef)[_0x66f8('0x26')](_0x1af183);};}exports['index']=function(_0x2ac3c7,_0xacd121){var _0x134c69={},_0x498347={},_0x191559={'count':0x0,'rows':[]};var _0x53f12e=_[_0x66f8('0x27')](db['SugarcrmField'][_0x66f8('0x28')],function(_0x524a61){return{'name':_0x524a61['fieldName'],'type':_0x524a61[_0x66f8('0x29')][_0x66f8('0x2a')]};});_0x498347[_0x66f8('0x2b')]=_['map'](_0x53f12e,_0x66f8('0x25'));_0x498347[_0x66f8('0x2c')]=_[_0x66f8('0x2d')](_0x2ac3c7[_0x66f8('0x2c')]);_0x498347[_0x66f8('0x2e')]=_[_0x66f8('0x2f')](_0x498347[_0x66f8('0x2b')],_0x498347[_0x66f8('0x2c')]);_0x134c69[_0x66f8('0x30')]=_[_0x66f8('0x2f')](_0x498347['model'],qs[_0x66f8('0x31')](_0x2ac3c7[_0x66f8('0x2c')][_0x66f8('0x31')]));_0x134c69[_0x66f8('0x30')]=_0x134c69['attributes'][_0x66f8('0x32')]?_0x134c69[_0x66f8('0x30')]:_0x498347[_0x66f8('0x2b')];if(!_0x2ac3c7['query'][_0x66f8('0x33')](_0x66f8('0x34'))){_0x134c69[_0x66f8('0x1b')]=qs['limit'](_0x2ac3c7[_0x66f8('0x2c')][_0x66f8('0x1b')]);_0x134c69['offset']=qs[_0x66f8('0x19')](_0x2ac3c7['query']['offset']);}_0x134c69['order']=qs[_0x66f8('0x35')](_0x2ac3c7[_0x66f8('0x2c')]['sort']);_0x134c69['where']=qs[_0x66f8('0x2e')](_[_0x66f8('0x36')](_0x2ac3c7[_0x66f8('0x2c')],_0x498347[_0x66f8('0x2e')]),_0x53f12e);if(_0x2ac3c7['query'][_0x66f8('0x37')]){_0x134c69[_0x66f8('0x38')]=_[_0x66f8('0x39')](_0x134c69[_0x66f8('0x38')],{'$or':_[_0x66f8('0x27')](_0x53f12e,function(_0x12a28d){if(_0x12a28d[_0x66f8('0x29')]!==_0x66f8('0x3a')){var _0x59df51={};_0x59df51[_0x12a28d[_0x66f8('0x25')]]={'$like':'%'+_0x2ac3c7[_0x66f8('0x2c')][_0x66f8('0x37')]+'%'};return _0x59df51;}})});}_0x134c69=_[_0x66f8('0x39')]({},_0x134c69,_0x2ac3c7[_0x66f8('0x3b')]);var _0x1da2d4={'where':_0x134c69[_0x66f8('0x38')]};return db[_0x66f8('0x3c')][_0x66f8('0x1c')](_0x1da2d4)[_0x66f8('0x22')](function(_0x482421){_0x191559['count']=_0x482421;if(_0x2ac3c7[_0x66f8('0x2c')][_0x66f8('0x3d')]){_0x134c69[_0x66f8('0x3e')]=[{'all':!![]}];}return db[_0x66f8('0x3c')][_0x66f8('0x3f')](_0x134c69);})[_0x66f8('0x22')](function(_0x17a9f9){_0x191559['rows']=_0x17a9f9;return _0x191559;})[_0x66f8('0x22')](respondWithFilteredResult(_0xacd121,_0x134c69))[_0x66f8('0x40')](handleError(_0xacd121,null));};exports[_0x66f8('0x41')]=function(_0x1ea30e,_0x34870f){var _0x341378={'raw':!![],'where':{'id':_0x1ea30e[_0x66f8('0x42')]['id']}},_0x1f8016={};_0x1f8016[_0x66f8('0x2b')]=_[_0x66f8('0x2d')](db['SugarcrmField'][_0x66f8('0x28')]);_0x1f8016[_0x66f8('0x2c')]=_[_0x66f8('0x2d')](_0x1ea30e['query']);_0x1f8016[_0x66f8('0x2e')]=_[_0x66f8('0x2f')](_0x1f8016[_0x66f8('0x2b')],_0x1f8016[_0x66f8('0x2c')]);_0x341378[_0x66f8('0x30')]=_[_0x66f8('0x2f')](_0x1f8016[_0x66f8('0x2b')],qs['fields'](_0x1ea30e[_0x66f8('0x2c')][_0x66f8('0x31')]));_0x341378[_0x66f8('0x30')]=_0x341378[_0x66f8('0x30')]['length']?_0x341378['attributes']:_0x1f8016[_0x66f8('0x2b')];if(_0x1ea30e[_0x66f8('0x2c')][_0x66f8('0x3d')]){_0x341378[_0x66f8('0x3e')]=[{'all':!![]}];}_0x341378=_['merge']({},_0x341378,_0x1ea30e[_0x66f8('0x3b')]);return db[_0x66f8('0x3c')][_0x66f8('0x43')](_0x341378)['then'](handleEntityNotFound(_0x34870f,null))[_0x66f8('0x22')](respondWithResult(_0x34870f,null))[_0x66f8('0x40')](handleError(_0x34870f,null));};exports[_0x66f8('0x44')]=function(_0x99e9c4,_0xf37361){return db[_0x66f8('0x3c')][_0x66f8('0x44')](_0x99e9c4[_0x66f8('0x45')],{})[_0x66f8('0x22')](respondWithResult(_0xf37361,0xc9))[_0x66f8('0x40')](handleError(_0xf37361,null));};exports[_0x66f8('0x46')]=function(_0x53dcba,_0x5f41b5){if(_0x53dcba[_0x66f8('0x45')]['id']){delete _0x53dcba['body']['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x53dcba['params']['id']}})[_0x66f8('0x22')](handleEntityNotFound(_0x5f41b5,null))[_0x66f8('0x22')](saveUpdates(_0x53dcba[_0x66f8('0x45')],null))[_0x66f8('0x22')](respondWithResult(_0x5f41b5,null))[_0x66f8('0x40')](handleError(_0x5f41b5,null));};exports[_0x66f8('0x23')]=function(_0x64b367,_0xedfff8){return db[_0x66f8('0x3c')][_0x66f8('0x43')]({'where':{'id':_0x64b367['params']['id']}})[_0x66f8('0x22')](handleEntityNotFound(_0xedfff8,null))[_0x66f8('0x22')](removeEntity(_0xedfff8,null))['catch'](handleError(_0xedfff8,null));}; \ No newline at end of file +var _0xd9ca=['end','undefined','count','offset','limit','set','json','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','sort','where','filter','merge','VIRTUAL','options','includeAll','include','SugarcrmField','findAll','rows','catch','show','params','length','create','body','find','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status'];(function(_0x2a7aeb,_0x1c6f4e){var _0x3dd4d6=function(_0x238e36){while(--_0x238e36){_0x2a7aeb['push'](_0x2a7aeb['shift']());}};_0x3dd4d6(++_0x1c6f4e);}(_0xd9ca,0xaf));var _0xad9c=function(_0x53f800,_0x562d45){_0x53f800=_0x53f800-0x0;var _0x3cbaa5=_0xd9ca[_0x53f800];return _0x3cbaa5;};'use strict';var emlformat=require(_0xad9c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad9c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xad9c('0x2'));var moment=require('moment');var BPromise=require(_0xad9c('0x3'));var Mustache=require(_0xad9c('0x4'));var util=require('util');var path=require(_0xad9c('0x5'));var sox=require(_0xad9c('0x6'));var csv=require(_0xad9c('0x7'));var ejs=require(_0xad9c('0x8'));var fs=require('fs');var fs_extra=require(_0xad9c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xad9c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xad9c('0xb'));var toCsv=require(_0xad9c('0x7'));var querystring=require(_0xad9c('0xc'));var Papa=require(_0xad9c('0xd'));var Redis=require(_0xad9c('0xe'));var authService=require(_0xad9c('0xf'));var qs=require(_0xad9c('0x10'));var as=require(_0xad9c('0x11'));var hardwareService=require(_0xad9c('0x12'));var logger=require('../../config/logger')(_0xad9c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xad9c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f9f09,_0xf1b201){_0xf1b201=_0xf1b201||0xcc;return function(_0x3ea273){if(_0x3ea273){return _0x4f9f09[_0xad9c('0x15')](_0xf1b201);}return _0x4f9f09[_0xad9c('0x16')](_0xf1b201)[_0xad9c('0x17')]();};}function respondWithResult(_0x34673a,_0x2d60ce){_0x2d60ce=_0x2d60ce||0xc8;return function(_0x44a89a){if(_0x44a89a){return _0x34673a[_0xad9c('0x16')](_0x2d60ce)['json'](_0x44a89a);}};}function respondWithFilteredResult(_0x448671,_0x281668){return function(_0x3c0fda){if(_0x3c0fda){var _0x2c7e00=typeof _0x281668['offset']===_0xad9c('0x18')&&typeof _0x281668['limit']==='undefined';var _0x1171c6=_0x3c0fda[_0xad9c('0x19')];var _0x22faaf=_0x2c7e00?0x0:_0x281668[_0xad9c('0x1a')];var _0x58acb9=_0x2c7e00?_0x3c0fda[_0xad9c('0x19')]:_0x281668[_0xad9c('0x1a')]+_0x281668[_0xad9c('0x1b')];var _0x27080d;if(_0x58acb9>=_0x1171c6){_0x58acb9=_0x1171c6;_0x27080d=0xc8;}else{_0x27080d=0xce;}_0x448671[_0xad9c('0x16')](_0x27080d);return _0x448671[_0xad9c('0x1c')]('Content-Range',_0x22faaf+'-'+_0x58acb9+'/'+_0x1171c6)[_0xad9c('0x1d')](_0x3c0fda);}return null;};}function patchUpdates(_0x2c1fb5){return function(_0x964bf2){try{jsonpatch['apply'](_0x964bf2,_0x2c1fb5,!![]);}catch(_0x334616){return BPromise['reject'](_0x334616);}return _0x964bf2[_0xad9c('0x1e')]();};}function saveUpdates(_0x2cd0b8,_0xda17be){return function(_0x50b33c){if(_0x50b33c){return _0x50b33c[_0xad9c('0x1f')](_0x2cd0b8)[_0xad9c('0x20')](function(_0x4d1fa5){return _0x4d1fa5;});}return null;};}function removeEntity(_0x1cd284,_0x5a9453){return function(_0x4458c4){if(_0x4458c4){return _0x4458c4[_0xad9c('0x21')]()[_0xad9c('0x20')](function(){_0x1cd284[_0xad9c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2866dd,_0x1680ba){return function(_0x314212){if(!_0x314212){_0x2866dd[_0xad9c('0x15')](0x194);}return _0x314212;};}function handleError(_0x113b7b,_0x415f41){_0x415f41=_0x415f41||0x1f4;return function(_0x2ed2e0){logger[_0xad9c('0x22')](_0x2ed2e0[_0xad9c('0x23')]);if(_0x2ed2e0['name']){delete _0x2ed2e0[_0xad9c('0x24')];}_0x113b7b[_0xad9c('0x16')](_0x415f41)['send'](_0x2ed2e0);};}exports[_0xad9c('0x25')]=function(_0x4d2f02,_0x1ca399){var _0x27c9d3={},_0x450548={},_0x232ef8={'count':0x0,'rows':[]};var _0x426fdd=_[_0xad9c('0x26')](db['SugarcrmField'][_0xad9c('0x27')],function(_0xda3559){return{'name':_0xda3559[_0xad9c('0x28')],'type':_0xda3559[_0xad9c('0x29')]['key']};});_0x450548[_0xad9c('0x2a')]=_[_0xad9c('0x26')](_0x426fdd,_0xad9c('0x24'));_0x450548[_0xad9c('0x2b')]=_['keys'](_0x4d2f02[_0xad9c('0x2b')]);_0x450548[_0xad9c('0x2c')]=_[_0xad9c('0x2d')](_0x450548['model'],_0x450548[_0xad9c('0x2b')]);_0x27c9d3[_0xad9c('0x2e')]=_[_0xad9c('0x2d')](_0x450548[_0xad9c('0x2a')],qs[_0xad9c('0x2f')](_0x4d2f02['query']['fields']));_0x27c9d3['attributes']=_0x27c9d3[_0xad9c('0x2e')]['length']?_0x27c9d3['attributes']:_0x450548['model'];if(!_0x4d2f02['query']['hasOwnProperty']('nolimit')){_0x27c9d3['limit']=qs[_0xad9c('0x1b')](_0x4d2f02[_0xad9c('0x2b')]['limit']);_0x27c9d3['offset']=qs['offset'](_0x4d2f02['query']['offset']);}_0x27c9d3['order']=qs[_0xad9c('0x30')](_0x4d2f02[_0xad9c('0x2b')][_0xad9c('0x30')]);_0x27c9d3[_0xad9c('0x31')]=qs[_0xad9c('0x2c')](_['pick'](_0x4d2f02[_0xad9c('0x2b')],_0x450548['filters']),_0x426fdd);if(_0x4d2f02[_0xad9c('0x2b')][_0xad9c('0x32')]){_0x27c9d3[_0xad9c('0x31')]=_[_0xad9c('0x33')](_0x27c9d3['where'],{'$or':_[_0xad9c('0x26')](_0x426fdd,function(_0x13dd36){if(_0x13dd36['type']!==_0xad9c('0x34')){var _0x353ebd={};_0x353ebd[_0x13dd36['name']]={'$like':'%'+_0x4d2f02[_0xad9c('0x2b')][_0xad9c('0x32')]+'%'};return _0x353ebd;}})});}_0x27c9d3=_[_0xad9c('0x33')]({},_0x27c9d3,_0x4d2f02[_0xad9c('0x35')]);var _0x3ae0d1={'where':_0x27c9d3['where']};return db['SugarcrmField']['count'](_0x3ae0d1)[_0xad9c('0x20')](function(_0x165757){_0x232ef8[_0xad9c('0x19')]=_0x165757;if(_0x4d2f02['query'][_0xad9c('0x36')]){_0x27c9d3[_0xad9c('0x37')]=[{'all':!![]}];}return db[_0xad9c('0x38')][_0xad9c('0x39')](_0x27c9d3);})[_0xad9c('0x20')](function(_0x4edfb2){_0x232ef8[_0xad9c('0x3a')]=_0x4edfb2;return _0x232ef8;})[_0xad9c('0x20')](respondWithFilteredResult(_0x1ca399,_0x27c9d3))[_0xad9c('0x3b')](handleError(_0x1ca399,null));};exports[_0xad9c('0x3c')]=function(_0x4a3e73,_0x2d7efc){var _0x3d2c04={'raw':!![],'where':{'id':_0x4a3e73[_0xad9c('0x3d')]['id']}},_0x3dab58={};_0x3dab58[_0xad9c('0x2a')]=_['keys'](db[_0xad9c('0x38')]['rawAttributes']);_0x3dab58[_0xad9c('0x2b')]=_['keys'](_0x4a3e73[_0xad9c('0x2b')]);_0x3dab58['filters']=_[_0xad9c('0x2d')](_0x3dab58[_0xad9c('0x2a')],_0x3dab58['query']);_0x3d2c04[_0xad9c('0x2e')]=_[_0xad9c('0x2d')](_0x3dab58[_0xad9c('0x2a')],qs[_0xad9c('0x2f')](_0x4a3e73[_0xad9c('0x2b')]['fields']));_0x3d2c04[_0xad9c('0x2e')]=_0x3d2c04[_0xad9c('0x2e')][_0xad9c('0x3e')]?_0x3d2c04[_0xad9c('0x2e')]:_0x3dab58[_0xad9c('0x2a')];if(_0x4a3e73[_0xad9c('0x2b')]['includeAll']){_0x3d2c04[_0xad9c('0x37')]=[{'all':!![]}];}_0x3d2c04=_[_0xad9c('0x33')]({},_0x3d2c04,_0x4a3e73[_0xad9c('0x35')]);return db['SugarcrmField']['find'](_0x3d2c04)['then'](handleEntityNotFound(_0x2d7efc,null))[_0xad9c('0x20')](respondWithResult(_0x2d7efc,null))[_0xad9c('0x3b')](handleError(_0x2d7efc,null));};exports['create']=function(_0x5e012a,_0x10c59a){return db['SugarcrmField'][_0xad9c('0x3f')](_0x5e012a[_0xad9c('0x40')],{})[_0xad9c('0x20')](respondWithResult(_0x10c59a,0xc9))[_0xad9c('0x3b')](handleError(_0x10c59a,null));};exports['update']=function(_0xba6ea0,_0x3e612f){if(_0xba6ea0[_0xad9c('0x40')]['id']){delete _0xba6ea0[_0xad9c('0x40')]['id'];}return db[_0xad9c('0x38')]['find']({'where':{'id':_0xba6ea0[_0xad9c('0x3d')]['id']}})[_0xad9c('0x20')](handleEntityNotFound(_0x3e612f,null))[_0xad9c('0x20')](saveUpdates(_0xba6ea0[_0xad9c('0x40')],null))['then'](respondWithResult(_0x3e612f,null))[_0xad9c('0x3b')](handleError(_0x3e612f,null));};exports[_0xad9c('0x21')]=function(_0x57e218,_0x3a5bee){return db[_0xad9c('0x38')][_0xad9c('0x41')]({'where':{'id':_0x57e218[_0xad9c('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3a5bee,null))['then'](removeEntity(_0x3a5bee,null))[_0xad9c('0x3b')](handleError(_0x3a5bee,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 72e3caf..cfe4d83 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 _0x7a33=['FieldId','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0x7a33,0x8d));var _0x37a3=function(_0x554d5c,_0x40b847){_0x554d5c=_0x554d5c-0x0;var _0x3ffd5e=_0x7a33[_0x554d5c];return _0x3ffd5e;};'use strict';var _=require(_0x37a3('0x0'));var util=require(_0x37a3('0x1'));var logger=require(_0x37a3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x37a3('0x3'));var rp=require(_0x37a3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x37a3('0x5'));var attributes=require(_0x37a3('0x6'));module[_0x37a3('0x7')]=function(_0x42257d,_0x7205b7){return _0x42257d[_0x37a3('0x8')](_0x37a3('0x9'),attributes,{'tableName':_0x37a3('0xa'),'paranoid':![],'indexes':[{'name':_0x37a3('0xb'),'fields':[_0x37a3('0xc'),_0x37a3('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd6f9=['int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField'];(function(_0xd05f88,_0x32d7ff){var _0x350b5d=function(_0x220566){while(--_0x220566){_0xd05f88['push'](_0xd05f88['shift']());}};_0x350b5d(++_0x32d7ff);}(_0xd6f9,0x198));var _0x9d6f=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xd6f9[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0x9d6f('0x0'));var util=require(_0x9d6f('0x1'));var logger=require(_0x9d6f('0x2'))(_0x9d6f('0x3'));var moment=require(_0x9d6f('0x4'));var BPromise=require(_0x9d6f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d6f('0x6'));var rimraf=require(_0x9d6f('0x7'));var config=require(_0x9d6f('0x8'));var attributes=require(_0x9d6f('0x9'));module[_0x9d6f('0xa')]=function(_0x4d737b,_0x58e447){return _0x4d737b['define'](_0x9d6f('0xb'),attributes,{'tableName':_0x9d6f('0xc'),'paranoid':![],'indexes':[{'name':_0x9d6f('0xd'),'fields':[_0x9d6f('0xe'),'FieldId'],'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 a0d55a3..7662c7b 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 _0x7382=['error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7382,0xe3));var _0x2738=function(_0x31e7ce,_0x409619){_0x31e7ce=_0x31e7ce-0x0;var _0x3b2616=_0x7382[_0x31e7ce];return _0x3b2616;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require(_0x2738('0x1'));var BPromise=require(_0x2738('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2738('0x3'));var db=require(_0x2738('0x4'))['db'];var utils=require(_0x2738('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2738('0x6')][_0x2738('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43b4a6,_0x41bea9,_0x51d199){return new BPromise(function(_0x259e5f,_0x233cda){return client[_0x2738('0x8')](_0x43b4a6,_0x51d199)[_0x2738('0x9')](function(_0x2262fc){logger[_0x2738('0xa')](_0x2738('0xb'),_0x41bea9,_0x2738('0xc'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x41bea9,_0x2738('0xc'),JSON['stringify'](_0x2262fc));if(_0x2262fc[_0x2738('0xd')]){if(_0x2262fc[_0x2738('0xd')]['code']===0x1f4){logger[_0x2738('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x41bea9,_0x2262fc[_0x2738('0xd')][_0x2738('0xe')]);return _0x233cda(_0x2262fc[_0x2738('0xd')][_0x2738('0xe')]);}logger[_0x2738('0xd')](_0x2738('0xb'),_0x41bea9,_0x2262fc['error'][_0x2738('0xe')]);return _0x259e5f(_0x2262fc[_0x2738('0xd')]['message']);}else{logger[_0x2738('0xa')](_0x2738('0xb'),_0x41bea9,'request\x20sent');_0x259e5f(_0x2262fc[_0x2738('0xf')][_0x2738('0xe')]);}})['catch'](function(_0x596bb3){logger[_0x2738('0xd')](_0x2738('0xb'),_0x41bea9,_0x596bb3);_0x233cda(_0x596bb3);});});} \ No newline at end of file +var _0xb404=['stringify','error','code','message','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x4de579,_0x254d42){var _0x455490=function(_0x3a7df8){while(--_0x3a7df8){_0x4de579['push'](_0x4de579['shift']());}};_0x455490(++_0x254d42);}(_0xb404,0x155));var _0x4b40=function(_0x14c879,_0x12d49e){_0x14c879=_0x14c879-0x0;var _0x10ad52=_0xb404[_0x14c879];return _0x10ad52;};'use strict';var _=require('lodash');var util=require(_0x4b40('0x0'));var moment=require(_0x4b40('0x1'));var BPromise=require(_0x4b40('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4b40('0x3'));var logger=require(_0x4b40('0x4'))(_0x4b40('0x5'));var config=require(_0x4b40('0x6'));var jayson=require(_0x4b40('0x7'));var client=jayson[_0x4b40('0x8')][_0x4b40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3390d9,_0x4faf62,_0x4f857d){return new BPromise(function(_0x19d6f6,_0x6998a6){return client['request'](_0x3390d9,_0x4f857d)[_0x4b40('0xa')](function(_0x477881){logger[_0x4b40('0xb')](_0x4b40('0xc'),_0x4faf62,_0x4b40('0xd'));logger[_0x4b40('0xe')](_0x4b40('0xf'),_0x4faf62,_0x4b40('0xd'),JSON[_0x4b40('0x10')](_0x477881));if(_0x477881['error']){if(_0x477881[_0x4b40('0x11')][_0x4b40('0x12')]===0x1f4){logger[_0x4b40('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x4faf62,_0x477881[_0x4b40('0x11')]['message']);return _0x6998a6(_0x477881[_0x4b40('0x11')][_0x4b40('0x13')]);}logger['error'](_0x4b40('0xc'),_0x4faf62,_0x477881[_0x4b40('0x11')][_0x4b40('0x13')]);return _0x19d6f6(_0x477881[_0x4b40('0x11')][_0x4b40('0x13')]);}else{logger[_0x4b40('0xb')](_0x4b40('0xc'),_0x4faf62,_0x4b40('0xd'));_0x19d6f6(_0x477881['result'][_0x4b40('0x13')]);}})[_0x4b40('0x14')](function(_0x1c1586){logger[_0x4b40('0x11')](_0x4b40('0xc'),_0x4faf62,_0x1c1586);_0x6998a6(_0x1c1586);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 453e3ca..8066ae0 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 _0xfe3f=['getFields','create','/:id/configurations','addConfiguration','put','update','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0xfe3f,0x194));var _0xffe3=function(_0x56d082,_0xc597d6){_0x56d082=_0x56d082-0x0;var _0x2c4c19=_0xfe3f[_0x56d082];return _0x2c4c19;};'use strict';var multer=require(_0xffe3('0x0'));var util=require(_0xffe3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xffe3('0x2')]();var fs_extra=require(_0xffe3('0x3'));var auth=require(_0xffe3('0x4'));var interaction=require(_0xffe3('0x5'));var config=require(_0xffe3('0x6'));var controller=require(_0xffe3('0x7'));router[_0xffe3('0x8')]('/',auth[_0xffe3('0x9')](),controller[_0xffe3('0xa')]);router[_0xffe3('0x8')](_0xffe3('0xb'),auth['isAuthenticated'](),controller[_0xffe3('0xc')]);router[_0xffe3('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xffe3('0x8')](_0xffe3('0xd'),auth[_0xffe3('0x9')](),controller[_0xffe3('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xffe3('0xf')]);router['post'](_0xffe3('0x10'),auth[_0xffe3('0x9')](),controller[_0xffe3('0x11')]);router[_0xffe3('0x12')](_0xffe3('0xb'),auth[_0xffe3('0x9')](),controller[_0xffe3('0x13')]);router['delete'](_0xffe3('0xb'),auth[_0xffe3('0x9')](),controller[_0xffe3('0x14')]);module[_0xffe3('0x15')]=router; \ No newline at end of file +var _0xa952=['post','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields'];(function(_0x4c6ad2,_0x51092b){var _0x215c13=function(_0xf76c84){while(--_0xf76c84){_0x4c6ad2['push'](_0x4c6ad2['shift']());}};_0x215c13(++_0x51092b);}(_0xa952,0x98));var _0x2a95=function(_0x2a87fe,_0x52c61c){_0x2a87fe=_0x2a87fe-0x0;var _0x539085=_0xa952[_0x2a87fe];return _0x539085;};'use strict';var multer=require(_0x2a95('0x0'));var util=require(_0x2a95('0x1'));var path=require(_0x2a95('0x2'));var timeout=require(_0x2a95('0x3'));var express=require(_0x2a95('0x4'));var router=express['Router']();var fs_extra=require(_0x2a95('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2a95('0x6'));var config=require(_0x2a95('0x7'));var controller=require(_0x2a95('0x8'));router[_0x2a95('0x9')]('/',auth[_0x2a95('0xa')](),controller[_0x2a95('0xb')]);router[_0x2a95('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2a95('0xc')]);router['get'](_0x2a95('0xd'),auth[_0x2a95('0xa')](),controller['getConfigurations']);router['get'](_0x2a95('0xe'),auth['isAuthenticated'](),controller[_0x2a95('0xf')]);router[_0x2a95('0x10')]('/',auth[_0x2a95('0xa')](),controller['create']);router[_0x2a95('0x10')](_0x2a95('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x2a95('0x11'),auth['isAuthenticated'](),controller[_0x2a95('0x12')]);router[_0x2a95('0x13')](_0x2a95('0x11'),auth[_0x2a95('0xa')](),controller[_0x2a95('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 99b3ae5..759e14e 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 _0x4fae=['sequelize','exports','STRING','HelpDesk'];(function(_0xdfeed1,_0x4d8e7e){var _0x2976fc=function(_0x148e85){while(--_0x148e85){_0xdfeed1['push'](_0xdfeed1['shift']());}};_0x2976fc(++_0x4d8e7e);}(_0x4fae,0x68));var _0xe4fa=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x4fae[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xe4fa('0x0'));module[_0xe4fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe4fa('0x2')]},'username':{'type':Sequelize[_0xe4fa('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe4fa('0x2')],'allowNull':![],'defaultValue':_0xe4fa('0x3')},'remoteUri':{'type':Sequelize[_0xe4fa('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe4fa('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe4fa('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xfeb3=['STRING','sequelize','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xfeb3,0x160));var _0x3feb=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfeb3[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x3feb('0x0'));module[_0x3feb('0x1')]={'name':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3feb('0x2')]},'username':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 3dce554..1302f13 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 _0xbf7c=['params','findOne','VtigerConfiguration','order','nolimit','getConfigurations','AccountId','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','accessKey','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','token','sessionName','autogenerated','reference','includes','remove','editable','label','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','include','find','create','body'];(function(_0x472f1f,_0x10121d){var _0xe1ace8=function(_0x5a96b2){while(--_0x5a96b2){_0x472f1f['push'](_0x472f1f['shift']());}};_0xe1ace8(++_0x10121d);}(_0xbf7c,0x184));var _0xcbf7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf7c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcbf7('0x0'));var zipdir=require(_0xcbf7('0x1'));var jsonpatch=require(_0xcbf7('0x2'));var rp=require(_0xcbf7('0x3'));var moment=require('moment');var BPromise=require(_0xcbf7('0x4'));var Mustache=require('mustache');var util=require(_0xcbf7('0x5'));var path=require('path');var sox=require(_0xcbf7('0x6'));var csv=require(_0xcbf7('0x7'));var ejs=require(_0xcbf7('0x8'));var fs=require('fs');var fs_extra=require(_0xcbf7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcbf7('0xa'));var jsforce=require(_0xcbf7('0xb'));var deskjs=require(_0xcbf7('0xc'));var toCsv=require(_0xcbf7('0x7'));var querystring=require('querystring');var Papa=require(_0xcbf7('0xd'));var Redis=require(_0xcbf7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcbf7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbf7('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xcbf7('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xcbf7('0x12'));function respondWithStatusCode(_0x5966d4,_0x1a5b68){_0x1a5b68=_0x1a5b68||0xcc;return function(_0x28774c){if(_0x28774c){return _0x5966d4[_0xcbf7('0x13')](_0x1a5b68);}return _0x5966d4[_0xcbf7('0x14')](_0x1a5b68)[_0xcbf7('0x15')]();};}function respondWithResult(_0x555e89,_0x413954){_0x413954=_0x413954||0xc8;return function(_0x156597){if(_0x156597){return _0x555e89[_0xcbf7('0x14')](_0x413954)[_0xcbf7('0x16')](_0x156597);}};}function respondWithFilteredResult(_0x961ca9,_0x579100){return function(_0x56ace5){if(_0x56ace5){var _0x28f929=typeof _0x579100[_0xcbf7('0x17')]===_0xcbf7('0x18')&&typeof _0x579100[_0xcbf7('0x19')]===_0xcbf7('0x18');var _0x2fb281=_0x56ace5[_0xcbf7('0x1a')];var _0x15cbb0=_0x28f929?0x0:_0x579100[_0xcbf7('0x17')];var _0x2b0070=_0x28f929?_0x56ace5[_0xcbf7('0x1a')]:_0x579100[_0xcbf7('0x17')]+_0x579100['limit'];var _0x29c020;if(_0x2b0070>=_0x2fb281){_0x2b0070=_0x2fb281;_0x29c020=0xc8;}else{_0x29c020=0xce;}_0x961ca9[_0xcbf7('0x14')](_0x29c020);return _0x961ca9['set'](_0xcbf7('0x1b'),_0x15cbb0+'-'+_0x2b0070+'/'+_0x2fb281)[_0xcbf7('0x16')](_0x56ace5);}return null;};}function patchUpdates(_0x3130c3){return function(_0x26e705){try{jsonpatch[_0xcbf7('0x1c')](_0x26e705,_0x3130c3,!![]);}catch(_0x589df7){return BPromise[_0xcbf7('0x1d')](_0x589df7);}return _0x26e705[_0xcbf7('0x1e')]();};}function saveUpdates(_0x557529,_0x9eae4){return function(_0x44e454){if(_0x44e454){return _0x44e454[_0xcbf7('0x1f')](_0x557529)[_0xcbf7('0x20')](function(_0x3b3bfc){return _0x3b3bfc;});}return null;};}function removeEntity(_0x532b6c,_0x1caa38){return function(_0x5e6aef){if(_0x5e6aef){return _0x5e6aef[_0xcbf7('0x21')]()['then'](function(){_0x532b6c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12150c,_0x1fd8d2){return function(_0x21313e){if(!_0x21313e){_0x12150c[_0xcbf7('0x13')](0x194);}return _0x21313e;};}function handleError(_0x26f1d7,_0x397bdc){_0x397bdc=_0x397bdc||0x1f4;return function(_0x53d39c){logger[_0xcbf7('0x22')](_0x53d39c[_0xcbf7('0x23')]);if(_0x53d39c[_0xcbf7('0x24')]){delete _0x53d39c['name'];}_0x26f1d7['status'](_0x397bdc)[_0xcbf7('0x25')](_0x53d39c);};}exports[_0xcbf7('0x26')]=function(_0x2d41a2,_0x46f616){var _0x5b6d19={},_0x11672a={},_0x4ef673={'count':0x0,'rows':[]};var _0x2f250a=_[_0xcbf7('0x27')](db[_0xcbf7('0x28')][_0xcbf7('0x29')],function(_0x1ec0e1){return{'name':_0x1ec0e1['fieldName'],'type':_0x1ec0e1[_0xcbf7('0x2a')][_0xcbf7('0x2b')]};});_0x11672a['model']=_[_0xcbf7('0x27')](_0x2f250a,_0xcbf7('0x24'));_0x11672a[_0xcbf7('0x2c')]=_[_0xcbf7('0x2d')](_0x2d41a2[_0xcbf7('0x2c')]);_0x11672a['filters']=_[_0xcbf7('0x2e')](_0x11672a[_0xcbf7('0x2f')],_0x11672a[_0xcbf7('0x2c')]);_0x5b6d19[_0xcbf7('0x30')]=_[_0xcbf7('0x2e')](_0x11672a['model'],qs[_0xcbf7('0x31')](_0x2d41a2[_0xcbf7('0x2c')][_0xcbf7('0x31')]));_0x5b6d19[_0xcbf7('0x30')]=_0x5b6d19['attributes'][_0xcbf7('0x32')]?_0x5b6d19[_0xcbf7('0x30')]:_0x11672a[_0xcbf7('0x2f')];if(!_0x2d41a2[_0xcbf7('0x2c')][_0xcbf7('0x33')]('nolimit')){_0x5b6d19[_0xcbf7('0x19')]=qs[_0xcbf7('0x19')](_0x2d41a2['query'][_0xcbf7('0x19')]);_0x5b6d19[_0xcbf7('0x17')]=qs[_0xcbf7('0x17')](_0x2d41a2['query'][_0xcbf7('0x17')]);}_0x5b6d19['order']=qs[_0xcbf7('0x34')](_0x2d41a2[_0xcbf7('0x2c')]['sort']);_0x5b6d19['where']=qs[_0xcbf7('0x35')](_[_0xcbf7('0x36')](_0x2d41a2[_0xcbf7('0x2c')],_0x11672a['filters']),_0x2f250a);if(_0x2d41a2[_0xcbf7('0x2c')][_0xcbf7('0x37')]){_0x5b6d19[_0xcbf7('0x38')]=_[_0xcbf7('0x39')](_0x5b6d19[_0xcbf7('0x38')],{'$or':_[_0xcbf7('0x27')](_0x2f250a,function(_0x3edb43){if(_0x3edb43[_0xcbf7('0x2a')]!==_0xcbf7('0x3a')){var _0x1cefda={};_0x1cefda[_0x3edb43['name']]={'$like':'%'+_0x2d41a2[_0xcbf7('0x2c')][_0xcbf7('0x37')]+'%'};return _0x1cefda;}})});}_0x5b6d19=_[_0xcbf7('0x39')]({},_0x5b6d19,_0x2d41a2[_0xcbf7('0x3b')]);var _0x44976b={'where':_0x5b6d19[_0xcbf7('0x38')]};return db[_0xcbf7('0x28')][_0xcbf7('0x1a')](_0x44976b)[_0xcbf7('0x20')](function(_0x53d4fe){_0x4ef673[_0xcbf7('0x1a')]=_0x53d4fe;if(_0x2d41a2['query'][_0xcbf7('0x3c')]){_0x5b6d19['include']=[{'all':!![]}];}return db[_0xcbf7('0x28')][_0xcbf7('0x3d')](_0x5b6d19);})[_0xcbf7('0x20')](function(_0x346678){_0x4ef673['rows']=_0x346678;return _0x4ef673;})[_0xcbf7('0x20')](respondWithFilteredResult(_0x46f616,_0x5b6d19))[_0xcbf7('0x3e')](handleError(_0x46f616,null));};exports[_0xcbf7('0x3f')]=function(_0x24708b,_0x525599){var _0x4000d9={'raw':![],'where':{'id':_0x24708b['params']['id']}},_0x493a06={};_0x493a06[_0xcbf7('0x2f')]=_[_0xcbf7('0x2d')](db[_0xcbf7('0x28')]['rawAttributes']);_0x493a06[_0xcbf7('0x2c')]=_['keys'](_0x24708b['query']);_0x493a06['filters']=_[_0xcbf7('0x2e')](_0x493a06['model'],_0x493a06[_0xcbf7('0x2c')]);_0x4000d9[_0xcbf7('0x30')]=_[_0xcbf7('0x2e')](_0x493a06[_0xcbf7('0x2f')],qs[_0xcbf7('0x31')](_0x24708b[_0xcbf7('0x2c')][_0xcbf7('0x31')]));_0x4000d9['attributes']=_0x4000d9['attributes'][_0xcbf7('0x32')]?_0x4000d9['attributes']:_0x493a06[_0xcbf7('0x2f')];if(_0x24708b[_0xcbf7('0x2c')][_0xcbf7('0x3c')]){_0x4000d9[_0xcbf7('0x40')]=[{'all':!![]}];}_0x4000d9=_[_0xcbf7('0x39')]({},_0x4000d9,_0x24708b[_0xcbf7('0x3b')]);return db['VtigerAccount'][_0xcbf7('0x41')](_0x4000d9)[_0xcbf7('0x20')](handleEntityNotFound(_0x525599,null))[_0xcbf7('0x20')](respondWithResult(_0x525599,null))['catch'](handleError(_0x525599,null));};exports['create']=function(_0x11cc25,_0x158cce){return db[_0xcbf7('0x28')][_0xcbf7('0x42')](_0x11cc25['body'],{})[_0xcbf7('0x20')](respondWithResult(_0x158cce,0xc9))[_0xcbf7('0x3e')](handleError(_0x158cce,null));};exports[_0xcbf7('0x1f')]=function(_0x33f44e,_0x31e22d){if(_0x33f44e[_0xcbf7('0x43')]['id']){delete _0x33f44e[_0xcbf7('0x43')]['id'];}return db[_0xcbf7('0x28')][_0xcbf7('0x41')]({'where':{'id':_0x33f44e[_0xcbf7('0x44')]['id']}})[_0xcbf7('0x20')](handleEntityNotFound(_0x31e22d,null))['then'](saveUpdates(_0x33f44e[_0xcbf7('0x43')],null))['then'](respondWithResult(_0x31e22d,null))[_0xcbf7('0x3e')](handleError(_0x31e22d,null));};exports[_0xcbf7('0x21')]=function(_0x39e5c1,_0x5ce12c){return db[_0xcbf7('0x28')][_0xcbf7('0x41')]({'where':{'id':_0x39e5c1['params']['id']}})[_0xcbf7('0x20')](handleEntityNotFound(_0x5ce12c,null))['then'](removeEntity(_0x5ce12c,null))[_0xcbf7('0x3e')](handleError(_0x5ce12c,null));};exports['getConfigurations']=function(_0x9c11f6,_0x2972f1,_0x548c8a){var _0xd3124e={};var _0x389786={};var _0x18b8a6;var _0x1df2f0;return db['VtigerAccount'][_0xcbf7('0x45')]({'where':{'id':_0x9c11f6[_0xcbf7('0x44')]['id']}})[_0xcbf7('0x20')](handleEntityNotFound(_0x2972f1,null))[_0xcbf7('0x20')](function(_0x18d9c3){if(_0x18d9c3){_0x18b8a6=_0x18d9c3;_0x389786['model']=_[_0xcbf7('0x2d')](db[_0xcbf7('0x46')][_0xcbf7('0x29')]);_0x389786[_0xcbf7('0x2c')]=_[_0xcbf7('0x2d')](_0x9c11f6[_0xcbf7('0x2c')]);_0x389786['filters']=_[_0xcbf7('0x2e')](_0x389786[_0xcbf7('0x2f')],_0x389786[_0xcbf7('0x2c')]);_0xd3124e[_0xcbf7('0x30')]=_[_0xcbf7('0x2e')](_0x389786[_0xcbf7('0x2f')],qs[_0xcbf7('0x31')](_0x9c11f6[_0xcbf7('0x2c')][_0xcbf7('0x31')]));_0xd3124e[_0xcbf7('0x30')]=_0xd3124e['attributes'][_0xcbf7('0x32')]?_0xd3124e['attributes']:_0x389786['model'];_0xd3124e[_0xcbf7('0x47')]=qs[_0xcbf7('0x34')](_0x9c11f6[_0xcbf7('0x2c')]['sort']);_0xd3124e[_0xcbf7('0x38')]=qs[_0xcbf7('0x35')](_[_0xcbf7('0x36')](_0x9c11f6[_0xcbf7('0x2c')],_0x389786[_0xcbf7('0x35')]));if(_0x9c11f6['query'][_0xcbf7('0x37')]){_0xd3124e[_0xcbf7('0x38')]=_[_0xcbf7('0x39')](_0xd3124e['where'],{'$or':_['map'](_0xd3124e[_0xcbf7('0x30')],function(_0x1d1cde){var _0x19989c={};_0x19989c[_0x1d1cde]={'$like':'%'+_0x9c11f6[_0xcbf7('0x2c')][_0xcbf7('0x37')]+'%'};return _0x19989c;})});}_0xd3124e=_[_0xcbf7('0x39')]({},_0xd3124e,_0x9c11f6[_0xcbf7('0x3b')]);return _0x18b8a6['getConfigurations'](_0xd3124e);}})[_0xcbf7('0x20')](function(_0x5a57cc){if(_0x5a57cc){_0x1df2f0=_0x5a57cc[_0xcbf7('0x32')];if(!_0x9c11f6[_0xcbf7('0x2c')][_0xcbf7('0x33')](_0xcbf7('0x48'))){_0xd3124e[_0xcbf7('0x19')]=qs[_0xcbf7('0x19')](_0x9c11f6[_0xcbf7('0x2c')][_0xcbf7('0x19')]);_0xd3124e[_0xcbf7('0x17')]=qs[_0xcbf7('0x17')](_0x9c11f6[_0xcbf7('0x2c')]['offset']);}return _0x18b8a6[_0xcbf7('0x49')](_0xd3124e);}})[_0xcbf7('0x20')](function(_0xb93e8a){if(_0xb93e8a){return _0xb93e8a?{'count':_0x1df2f0,'rows':_0xb93e8a}:null;}})[_0xcbf7('0x20')](respondWithResult(_0x2972f1,null))['catch'](handleError(_0x2972f1,null));};exports['addConfiguration']=function(_0x5e7f87,_0x56a9b1,_0x503388){if(_0x5e7f87[_0xcbf7('0x43')]['id']){delete _0x5e7f87['body']['id'];}return db[_0xcbf7('0x28')][_0xcbf7('0x45')]({'where':{'id':_0x5e7f87[_0xcbf7('0x44')]['id']}})[_0xcbf7('0x20')](handleEntityNotFound(_0x56a9b1,null))[_0xcbf7('0x20')](function(_0x123994){if(_0x123994){_0x5e7f87['body'][_0xcbf7('0x4a')]=_0x123994['id'];_0x5e7f87[_0xcbf7('0x43')]['Subjects']=integrations['getSubjects'](_0x5e7f87[_0xcbf7('0x43')][_0xcbf7('0x4b')],_0x5e7f87[_0xcbf7('0x43')][_0xcbf7('0x2a')]);_0x5e7f87['body'][_0xcbf7('0x4c')]=integrations[_0xcbf7('0x4d')](_0x5e7f87[_0xcbf7('0x43')]['channel'],_0x5e7f87['body'][_0xcbf7('0x2a')]);return db['VtigerConfiguration'][_0xcbf7('0x42')](_0x5e7f87[_0xcbf7('0x43')],{'include':[{'model':db[_0xcbf7('0x4e')],'as':'Subjects'},{'model':db[_0xcbf7('0x4e')],'as':_0xcbf7('0x4c')}]});}return null;})[_0xcbf7('0x20')](respondWithResult(_0x56a9b1,null))['catch'](handleError(_0x56a9b1,null));};var md5=require(_0xcbf7('0x4f'));exports[_0xcbf7('0x50')]=function(_0x3e1d46,_0x347db4,_0x372f69){var _0x8c1e51=null;var _0x58668d=null;var _0x39e127=null;var _0x45bb64=null;var _0x459f22='';return db[_0xcbf7('0x28')]['findOne']({'where':{'id':_0x3e1d46[_0xcbf7('0x44')]['id']},'attributes':['id',_0xcbf7('0x24'),_0xcbf7('0x51'),_0xcbf7('0x52'),_0xcbf7('0x53'),'remoteUri','serverUrl','accessKey']})['then'](handleEntityNotFound(_0x347db4,null))[_0xcbf7('0x20')](function(_0x4678fb){if(_0x4678fb){_0x8c1e51=_0x4678fb[_0xcbf7('0x51')];_0x58668d=_0x4678fb[_0xcbf7('0x54')];_0x39e127=_0x4678fb[_0xcbf7('0x53')];_0x459f22=_0x4678fb[_0xcbf7('0x55')];var _0x5eb932=_0x459f22[_0xcbf7('0x56')](-0x1);if(_0x5eb932==='/'){_0x459f22=_0x459f22[_0xcbf7('0x57')](0x0,_0x459f22[_0xcbf7('0x58')](_0x5eb932));}_0x45bb64=util[_0xcbf7('0x59')](_0xcbf7('0x5a'),_0x459f22);var _0x452924={'method':_0xcbf7('0x5b'),'uri':_0x45bb64,'qs':{'operation':'getchallenge','username':_0x4678fb[_0xcbf7('0x51')]},'json':!![]};return rp(_0x452924);}})[_0xcbf7('0x20')](function(_0x15cf40){if(_0x15cf40[_0xcbf7('0x5c')]){var _0x2f87ba={'method':_0xcbf7('0x5d'),'uri':_0x45bb64,'form':{'operation':_0xcbf7('0x5e'),'username':_0x8c1e51,'accessKey':md5(_0x15cf40[_0xcbf7('0x5f')][_0xcbf7('0x60')]+_0x58668d)},'json':!![]};return rp(_0x2f87ba);}})[_0xcbf7('0x20')](function(_0x48ddd1){if(_0x48ddd1[_0xcbf7('0x5c')]){var _0x11bbae={'method':_0xcbf7('0x5b'),'uri':_0x45bb64,'qs':{'operation':'describe','username':_0x8c1e51,'sessionName':_0x48ddd1[_0xcbf7('0x5f')][_0xcbf7('0x61')],'elementType':_0x39e127},'json':!![]};return rp(_0x11bbae);}})['then'](function(_0x16876a){if(_0x16876a[_0xcbf7('0x5c')]){var _0x28ea30=[_0xcbf7('0x62'),_0xcbf7('0x63'),'owner'];_['remove'](_0x16876a[_0xcbf7('0x5f')][_0xcbf7('0x31')],function(_0x16762c){return _0x28ea30[_0xcbf7('0x64')](_0x16762c[_0xcbf7('0x2a')][_0xcbf7('0x24')]);});_[_0xcbf7('0x65')](_0x16876a[_0xcbf7('0x5f')][_0xcbf7('0x31')],function(_0x3f8d54){return _0x3f8d54[_0xcbf7('0x66')]==='false';});return{'count':_0x16876a['result']['fields'][_0xcbf7('0x32')],'rows':_[_0xcbf7('0x27')](_0x16876a['result'][_0xcbf7('0x31')],function(_0x128bdd){return{'id':_0x128bdd[_0xcbf7('0x24')],'name':_0x128bdd[_0xcbf7('0x67')],'custom':_['startsWith'](_0x128bdd[_0xcbf7('0x24')],_0xcbf7('0x68'))?!![]:![],'options':_0x128bdd['type'][_0xcbf7('0x24')]===_0xcbf7('0x69')&&_0x128bdd[_0xcbf7('0x2a')][_0xcbf7('0x6a')][_0xcbf7('0x32')]>0x0?_[_0xcbf7('0x27')](_0x128bdd[_0xcbf7('0x2a')][_0xcbf7('0x6a')],function(_0x2824a3){return{'name':_0x2824a3[_0xcbf7('0x67')],'value':_0x2824a3[_0xcbf7('0x6b')]};}):[]};})};}})[_0xcbf7('0x20')](respondWithResult(_0x347db4,null))[_0xcbf7('0x3e')](function(_0x541369){console['log'](_0xcbf7('0x6c')+_0x541369);var _0x2c3107=_0x3e1d46[_0xcbf7('0x2c')][_0xcbf7('0x6d')]?0x1f4:_0x541369['statusCode']||0x1f4;logger[_0xcbf7('0x22')](_0xcbf7('0x6e'),_0xcbf7('0x50'),_0x2c3107,JSON[_0xcbf7('0x6f')](_0x541369));delete _0x541369[_0xcbf7('0x24')];if(_0x2c3107===0x191){_0x2c3107=0x190;}_0x347db4[_0xcbf7('0x14')](_0x2c3107)[_0xcbf7('0x25')](_0x3e1d46[_0xcbf7('0x2c')][_0xcbf7('0x6d')]?{'message':_0xcbf7('0x70'),'statusCode':_0x541369[_0xcbf7('0x71')]}:_0x541369);});}; \ No newline at end of file +var _0xebe4=['undefined','count','limit','status','set','Content-Range','apply','update','destroy','error','name','send','map','VtigerAccount','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','create','body','getConfigurations','VtigerConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','VtigerField','md5','getFields','findOne','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','GET','success','POST','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','picklistValues','label','value','log','vTiger\x20error:\x20','statusCode','stringify','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xebe4,0xc5));var _0x4ebe=function(_0x363232,_0x2b5c48){_0x363232=_0x363232-0x0;var _0x2d12d5=_0xebe4[_0x363232];return _0x2d12d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ebe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ebe('0x1'));var rp=require(_0x4ebe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ebe('0x3'));var util=require(_0x4ebe('0x4'));var path=require(_0x4ebe('0x5'));var sox=require(_0x4ebe('0x6'));var csv=require('to-csv');var ejs=require(_0x4ebe('0x7'));var fs=require('fs');var fs_extra=require(_0x4ebe('0x8'));var _=require(_0x4ebe('0x9'));var squel=require(_0x4ebe('0xa'));var crypto=require(_0x4ebe('0xb'));var jsforce=require(_0x4ebe('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4ebe('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4ebe('0xe'));var qs=require(_0x4ebe('0xf'));var as=require(_0x4ebe('0x10'));var hardwareService=require(_0x4ebe('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x4ebe('0x12'));var config=require(_0x4ebe('0x13'));var licenseUtil=require(_0x4ebe('0x14'));var db=require(_0x4ebe('0x15'))['db'];var integrations=require(_0x4ebe('0x16'));function respondWithStatusCode(_0x3b0037,_0x427f4e){_0x427f4e=_0x427f4e||0xcc;return function(_0x5b9f7d){if(_0x5b9f7d){return _0x3b0037[_0x4ebe('0x17')](_0x427f4e);}return _0x3b0037['status'](_0x427f4e)[_0x4ebe('0x18')]();};}function respondWithResult(_0x1fdef7,_0x13d7b0){_0x13d7b0=_0x13d7b0||0xc8;return function(_0x34e12a){if(_0x34e12a){return _0x1fdef7['status'](_0x13d7b0)[_0x4ebe('0x19')](_0x34e12a);}};}function respondWithFilteredResult(_0x3ec83d,_0x1ecf6c){return function(_0x90f8bf){if(_0x90f8bf){var _0x132269=typeof _0x1ecf6c[_0x4ebe('0x1a')]===_0x4ebe('0x1b')&&typeof _0x1ecf6c['limit']===_0x4ebe('0x1b');var _0x4b403f=_0x90f8bf['count'];var _0x256ddc=_0x132269?0x0:_0x1ecf6c[_0x4ebe('0x1a')];var _0x46a718=_0x132269?_0x90f8bf[_0x4ebe('0x1c')]:_0x1ecf6c[_0x4ebe('0x1a')]+_0x1ecf6c[_0x4ebe('0x1d')];var _0x27243e;if(_0x46a718>=_0x4b403f){_0x46a718=_0x4b403f;_0x27243e=0xc8;}else{_0x27243e=0xce;}_0x3ec83d[_0x4ebe('0x1e')](_0x27243e);return _0x3ec83d[_0x4ebe('0x1f')](_0x4ebe('0x20'),_0x256ddc+'-'+_0x46a718+'/'+_0x4b403f)[_0x4ebe('0x19')](_0x90f8bf);}return null;};}function patchUpdates(_0x1a4943){return function(_0x1129ee){try{jsonpatch[_0x4ebe('0x21')](_0x1129ee,_0x1a4943,!![]);}catch(_0x2e0a23){return BPromise['reject'](_0x2e0a23);}return _0x1129ee['save']();};}function saveUpdates(_0x3bfe4c,_0x12d903){return function(_0x1d0029){if(_0x1d0029){return _0x1d0029[_0x4ebe('0x22')](_0x3bfe4c)['then'](function(_0x388ef7){return _0x388ef7;});}return null;};}function removeEntity(_0x5c8a1e,_0x1f9db9){return function(_0x5dfccf){if(_0x5dfccf){return _0x5dfccf[_0x4ebe('0x23')]()['then'](function(){_0x5c8a1e[_0x4ebe('0x1e')](0xcc)[_0x4ebe('0x18')]();});}};}function handleEntityNotFound(_0x4376e3,_0x41b652){return function(_0x27aa55){if(!_0x27aa55){_0x4376e3[_0x4ebe('0x17')](0x194);}return _0x27aa55;};}function handleError(_0x5523a9,_0x2963cb){_0x2963cb=_0x2963cb||0x1f4;return function(_0x53d6a3){logger[_0x4ebe('0x24')](_0x53d6a3['stack']);if(_0x53d6a3['name']){delete _0x53d6a3[_0x4ebe('0x25')];}_0x5523a9['status'](_0x2963cb)[_0x4ebe('0x26')](_0x53d6a3);};}exports['index']=function(_0x52370c,_0x139197){var _0x4759fd={},_0x102593={},_0x25ed7e={'count':0x0,'rows':[]};var _0xbeac14=_[_0x4ebe('0x27')](db[_0x4ebe('0x28')][_0x4ebe('0x29')],function(_0x4bfd4e){return{'name':_0x4bfd4e['fieldName'],'type':_0x4bfd4e['type'][_0x4ebe('0x2a')]};});_0x102593[_0x4ebe('0x2b')]=_[_0x4ebe('0x27')](_0xbeac14,_0x4ebe('0x25'));_0x102593[_0x4ebe('0x2c')]=_[_0x4ebe('0x2d')](_0x52370c[_0x4ebe('0x2c')]);_0x102593['filters']=_[_0x4ebe('0x2e')](_0x102593['model'],_0x102593[_0x4ebe('0x2c')]);_0x4759fd[_0x4ebe('0x2f')]=_['intersection'](_0x102593[_0x4ebe('0x2b')],qs[_0x4ebe('0x30')](_0x52370c['query'][_0x4ebe('0x30')]));_0x4759fd['attributes']=_0x4759fd[_0x4ebe('0x2f')][_0x4ebe('0x31')]?_0x4759fd['attributes']:_0x102593[_0x4ebe('0x2b')];if(!_0x52370c[_0x4ebe('0x2c')]['hasOwnProperty']('nolimit')){_0x4759fd[_0x4ebe('0x1d')]=qs[_0x4ebe('0x1d')](_0x52370c[_0x4ebe('0x2c')][_0x4ebe('0x1d')]);_0x4759fd[_0x4ebe('0x1a')]=qs[_0x4ebe('0x1a')](_0x52370c[_0x4ebe('0x2c')][_0x4ebe('0x1a')]);}_0x4759fd[_0x4ebe('0x32')]=qs[_0x4ebe('0x33')](_0x52370c['query'][_0x4ebe('0x33')]);_0x4759fd[_0x4ebe('0x34')]=qs[_0x4ebe('0x35')](_[_0x4ebe('0x36')](_0x52370c['query'],_0x102593[_0x4ebe('0x35')]),_0xbeac14);if(_0x52370c[_0x4ebe('0x2c')][_0x4ebe('0x37')]){_0x4759fd[_0x4ebe('0x34')]=_[_0x4ebe('0x38')](_0x4759fd[_0x4ebe('0x34')],{'$or':_[_0x4ebe('0x27')](_0xbeac14,function(_0xfced02){if(_0xfced02[_0x4ebe('0x39')]!==_0x4ebe('0x3a')){var _0x4b5ed3={};_0x4b5ed3[_0xfced02[_0x4ebe('0x25')]]={'$like':'%'+_0x52370c[_0x4ebe('0x2c')][_0x4ebe('0x37')]+'%'};return _0x4b5ed3;}})});}_0x4759fd=_[_0x4ebe('0x38')]({},_0x4759fd,_0x52370c[_0x4ebe('0x3b')]);var _0x386364={'where':_0x4759fd[_0x4ebe('0x34')]};return db[_0x4ebe('0x28')][_0x4ebe('0x1c')](_0x386364)[_0x4ebe('0x3c')](function(_0x2d002e){_0x25ed7e[_0x4ebe('0x1c')]=_0x2d002e;if(_0x52370c[_0x4ebe('0x2c')][_0x4ebe('0x3d')]){_0x4759fd[_0x4ebe('0x3e')]=[{'all':!![]}];}return db['VtigerAccount'][_0x4ebe('0x3f')](_0x4759fd);})['then'](function(_0x2386fa){_0x25ed7e[_0x4ebe('0x40')]=_0x2386fa;return _0x25ed7e;})[_0x4ebe('0x3c')](respondWithFilteredResult(_0x139197,_0x4759fd))[_0x4ebe('0x41')](handleError(_0x139197,null));};exports['show']=function(_0x19ab8c,_0x167629){var _0x555ea5={'raw':![],'where':{'id':_0x19ab8c[_0x4ebe('0x42')]['id']}},_0x4f95ad={};_0x4f95ad[_0x4ebe('0x2b')]=_[_0x4ebe('0x2d')](db[_0x4ebe('0x28')][_0x4ebe('0x29')]);_0x4f95ad['query']=_[_0x4ebe('0x2d')](_0x19ab8c['query']);_0x4f95ad[_0x4ebe('0x35')]=_['intersection'](_0x4f95ad['model'],_0x4f95ad[_0x4ebe('0x2c')]);_0x555ea5[_0x4ebe('0x2f')]=_['intersection'](_0x4f95ad[_0x4ebe('0x2b')],qs['fields'](_0x19ab8c[_0x4ebe('0x2c')]['fields']));_0x555ea5['attributes']=_0x555ea5['attributes'][_0x4ebe('0x31')]?_0x555ea5[_0x4ebe('0x2f')]:_0x4f95ad['model'];if(_0x19ab8c['query'][_0x4ebe('0x3d')]){_0x555ea5[_0x4ebe('0x3e')]=[{'all':!![]}];}_0x555ea5=_[_0x4ebe('0x38')]({},_0x555ea5,_0x19ab8c['options']);return db[_0x4ebe('0x28')]['find'](_0x555ea5)['then'](handleEntityNotFound(_0x167629,null))['then'](respondWithResult(_0x167629,null))['catch'](handleError(_0x167629,null));};exports[_0x4ebe('0x43')]=function(_0x4211a0,_0xdb79ce){return db[_0x4ebe('0x28')]['create'](_0x4211a0['body'],{})['then'](respondWithResult(_0xdb79ce,0xc9))[_0x4ebe('0x41')](handleError(_0xdb79ce,null));};exports[_0x4ebe('0x22')]=function(_0x567c68,_0x2d343b){if(_0x567c68[_0x4ebe('0x44')]['id']){delete _0x567c68[_0x4ebe('0x44')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x567c68['params']['id']}})[_0x4ebe('0x3c')](handleEntityNotFound(_0x2d343b,null))[_0x4ebe('0x3c')](saveUpdates(_0x567c68[_0x4ebe('0x44')],null))[_0x4ebe('0x3c')](respondWithResult(_0x2d343b,null))[_0x4ebe('0x41')](handleError(_0x2d343b,null));};exports[_0x4ebe('0x23')]=function(_0xfb3949,_0x2abc2d){return db[_0x4ebe('0x28')]['find']({'where':{'id':_0xfb3949[_0x4ebe('0x42')]['id']}})['then'](handleEntityNotFound(_0x2abc2d,null))[_0x4ebe('0x3c')](removeEntity(_0x2abc2d,null))['catch'](handleError(_0x2abc2d,null));};exports[_0x4ebe('0x45')]=function(_0x401e59,_0x3304a9,_0x35221a){var _0xb7427c={};var _0x3a117b={};var _0x2b2e73;var _0x2bf2a1;return db[_0x4ebe('0x28')]['findOne']({'where':{'id':_0x401e59[_0x4ebe('0x42')]['id']}})[_0x4ebe('0x3c')](handleEntityNotFound(_0x3304a9,null))['then'](function(_0x5251a6){if(_0x5251a6){_0x2b2e73=_0x5251a6;_0x3a117b[_0x4ebe('0x2b')]=_[_0x4ebe('0x2d')](db[_0x4ebe('0x46')]['rawAttributes']);_0x3a117b[_0x4ebe('0x2c')]=_[_0x4ebe('0x2d')](_0x401e59[_0x4ebe('0x2c')]);_0x3a117b['filters']=_['intersection'](_0x3a117b['model'],_0x3a117b[_0x4ebe('0x2c')]);_0xb7427c[_0x4ebe('0x2f')]=_[_0x4ebe('0x2e')](_0x3a117b[_0x4ebe('0x2b')],qs[_0x4ebe('0x30')](_0x401e59['query'][_0x4ebe('0x30')]));_0xb7427c[_0x4ebe('0x2f')]=_0xb7427c[_0x4ebe('0x2f')][_0x4ebe('0x31')]?_0xb7427c[_0x4ebe('0x2f')]:_0x3a117b['model'];_0xb7427c[_0x4ebe('0x32')]=qs[_0x4ebe('0x33')](_0x401e59['query'][_0x4ebe('0x33')]);_0xb7427c[_0x4ebe('0x34')]=qs['filters'](_[_0x4ebe('0x36')](_0x401e59[_0x4ebe('0x2c')],_0x3a117b[_0x4ebe('0x35')]));if(_0x401e59[_0x4ebe('0x2c')][_0x4ebe('0x37')]){_0xb7427c[_0x4ebe('0x34')]=_[_0x4ebe('0x38')](_0xb7427c[_0x4ebe('0x34')],{'$or':_[_0x4ebe('0x27')](_0xb7427c[_0x4ebe('0x2f')],function(_0x40c2ad){var _0x29b182={};_0x29b182[_0x40c2ad]={'$like':'%'+_0x401e59['query'][_0x4ebe('0x37')]+'%'};return _0x29b182;})});}_0xb7427c=_['merge']({},_0xb7427c,_0x401e59[_0x4ebe('0x3b')]);return _0x2b2e73[_0x4ebe('0x45')](_0xb7427c);}})[_0x4ebe('0x3c')](function(_0x1c2d37){if(_0x1c2d37){_0x2bf2a1=_0x1c2d37[_0x4ebe('0x31')];if(!_0x401e59['query'][_0x4ebe('0x47')](_0x4ebe('0x48'))){_0xb7427c['limit']=qs['limit'](_0x401e59[_0x4ebe('0x2c')][_0x4ebe('0x1d')]);_0xb7427c[_0x4ebe('0x1a')]=qs['offset'](_0x401e59[_0x4ebe('0x2c')][_0x4ebe('0x1a')]);}return _0x2b2e73['getConfigurations'](_0xb7427c);}})[_0x4ebe('0x3c')](function(_0x3e6e4f){if(_0x3e6e4f){return _0x3e6e4f?{'count':_0x2bf2a1,'rows':_0x3e6e4f}:null;}})[_0x4ebe('0x3c')](respondWithResult(_0x3304a9,null))[_0x4ebe('0x41')](handleError(_0x3304a9,null));};exports[_0x4ebe('0x49')]=function(_0x4d75bc,_0x28153d,_0x554443){if(_0x4d75bc[_0x4ebe('0x44')]['id']){delete _0x4d75bc[_0x4ebe('0x44')]['id'];}return db[_0x4ebe('0x28')]['findOne']({'where':{'id':_0x4d75bc['params']['id']}})[_0x4ebe('0x3c')](handleEntityNotFound(_0x28153d,null))[_0x4ebe('0x3c')](function(_0x37259e){if(_0x37259e){_0x4d75bc[_0x4ebe('0x44')][_0x4ebe('0x4a')]=_0x37259e['id'];_0x4d75bc[_0x4ebe('0x44')][_0x4ebe('0x4b')]=integrations['getSubjects'](_0x4d75bc[_0x4ebe('0x44')]['channel'],_0x4d75bc[_0x4ebe('0x44')][_0x4ebe('0x39')]);_0x4d75bc[_0x4ebe('0x44')][_0x4ebe('0x4c')]=integrations[_0x4ebe('0x4d')](_0x4d75bc[_0x4ebe('0x44')]['channel'],_0x4d75bc[_0x4ebe('0x44')][_0x4ebe('0x39')]);return db[_0x4ebe('0x46')]['create'](_0x4d75bc[_0x4ebe('0x44')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x4ebe('0x4e')],'as':'Descriptions'}]});}return null;})[_0x4ebe('0x3c')](respondWithResult(_0x28153d,null))['catch'](handleError(_0x28153d,null));};var md5=require(_0x4ebe('0x4f'));exports[_0x4ebe('0x50')]=function(_0x32be3f,_0x66b382,_0x24c00d){var _0x388ede=null;var _0x5aa268=null;var _0x40def4=null;var _0x142609=null;var _0x4a8145='';return db[_0x4ebe('0x28')][_0x4ebe('0x51')]({'where':{'id':_0x32be3f[_0x4ebe('0x42')]['id']},'attributes':['id',_0x4ebe('0x25'),_0x4ebe('0x52'),'description',_0x4ebe('0x53'),_0x4ebe('0x54'),_0x4ebe('0x55'),'accessKey']})['then'](handleEntityNotFound(_0x66b382,null))[_0x4ebe('0x3c')](function(_0x44a6cb){if(_0x44a6cb){_0x388ede=_0x44a6cb[_0x4ebe('0x52')];_0x5aa268=_0x44a6cb[_0x4ebe('0x56')];_0x40def4=_0x44a6cb[_0x4ebe('0x53')];_0x4a8145=_0x44a6cb['remoteUri'];var _0x49d579=_0x4a8145[_0x4ebe('0x57')](-0x1);if(_0x49d579==='/'){_0x4a8145=_0x4a8145[_0x4ebe('0x58')](0x0,_0x4a8145['lastIndexOf'](_0x49d579));}_0x142609=util[_0x4ebe('0x59')](_0x4ebe('0x5a'),_0x4a8145);var _0x4d93ff={'method':_0x4ebe('0x5b'),'uri':_0x142609,'qs':{'operation':'getchallenge','username':_0x44a6cb[_0x4ebe('0x52')]},'json':!![]};return rp(_0x4d93ff);}})[_0x4ebe('0x3c')](function(_0x26b051){if(_0x26b051[_0x4ebe('0x5c')]){var _0x5b3e02={'method':_0x4ebe('0x5d'),'uri':_0x142609,'form':{'operation':'login','username':_0x388ede,'accessKey':md5(_0x26b051[_0x4ebe('0x5e')][_0x4ebe('0x5f')]+_0x5aa268)},'json':!![]};return rp(_0x5b3e02);}})[_0x4ebe('0x3c')](function(_0x3df061){if(_0x3df061['success']){var _0x12fcba={'method':'GET','uri':_0x142609,'qs':{'operation':_0x4ebe('0x60'),'username':_0x388ede,'sessionName':_0x3df061[_0x4ebe('0x5e')][_0x4ebe('0x61')],'elementType':_0x40def4},'json':!![]};return rp(_0x12fcba);}})[_0x4ebe('0x3c')](function(_0x1663ec){if(_0x1663ec[_0x4ebe('0x5c')]){var _0x5d18a5=[_0x4ebe('0x62'),_0x4ebe('0x63'),_0x4ebe('0x64')];_[_0x4ebe('0x65')](_0x1663ec[_0x4ebe('0x5e')][_0x4ebe('0x30')],function(_0x3d0560){return _0x5d18a5[_0x4ebe('0x66')](_0x3d0560[_0x4ebe('0x39')]['name']);});_[_0x4ebe('0x65')](_0x1663ec[_0x4ebe('0x5e')][_0x4ebe('0x30')],function(_0x1279b5){return _0x1279b5['editable']==='false';});return{'count':_0x1663ec['result'][_0x4ebe('0x30')][_0x4ebe('0x31')],'rows':_[_0x4ebe('0x27')](_0x1663ec[_0x4ebe('0x5e')]['fields'],function(_0x5d7b25){return{'id':_0x5d7b25[_0x4ebe('0x25')],'name':_0x5d7b25['label'],'custom':_['startsWith'](_0x5d7b25[_0x4ebe('0x25')],'cf_')?!![]:![],'options':_0x5d7b25[_0x4ebe('0x39')][_0x4ebe('0x25')]==='picklist'&&_0x5d7b25[_0x4ebe('0x39')][_0x4ebe('0x67')][_0x4ebe('0x31')]>0x0?_[_0x4ebe('0x27')](_0x5d7b25['type']['picklistValues'],function(_0x8353bf){return{'name':_0x8353bf[_0x4ebe('0x68')],'value':_0x8353bf[_0x4ebe('0x69')]};}):[]};})};}})['then'](respondWithResult(_0x66b382,null))['catch'](function(_0x2c9c81){console[_0x4ebe('0x6a')](_0x4ebe('0x6b')+_0x2c9c81);var _0x1ebed2=_0x32be3f[_0x4ebe('0x2c')]['test']?0x1f4:_0x2c9c81[_0x4ebe('0x6c')]||0x1f4;logger[_0x4ebe('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x4ebe('0x50'),_0x1ebed2,JSON[_0x4ebe('0x6d')](_0x2c9c81));delete _0x2c9c81['name'];if(_0x1ebed2===0x191){_0x1ebed2=0x190;}_0x66b382['status'](_0x1ebed2)['send'](_0x32be3f[_0x4ebe('0x2c')][_0x4ebe('0x6e')]?{'message':_0x4ebe('0x6f'),'statusCode':_0x2c9c81[_0x4ebe('0x6c')]}:_0x2c9c81);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index ba27ad6..da77934 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 _0x2a4d=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','util','moment'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x2a4d,0x1ab));var _0xd2a4=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x2a4d[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require('lodash');var util=require(_0xd2a4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd2a4('0x1'));var BPromise=require(_0xd2a4('0x2'));var rp=require(_0xd2a4('0x3'));var fs=require('fs');var path=require(_0xd2a4('0x4'));var rimraf=require(_0xd2a4('0x5'));var config=require(_0xd2a4('0x6'));var attributes=require(_0xd2a4('0x7'));var integrations=require(_0xd2a4('0x8'));module[_0xd2a4('0x9')]=function(_0x2b119b,_0x4acf11){return _0x2b119b[_0xd2a4('0xa')](_0xd2a4('0xb'),attributes,{'tableName':_0xd2a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75d4=['moment','bluebird','request-promise','./intVtigerAccount.attributes','../../components/integrations/configuration','VtigerAccount','lodash','../../config/logger','api'];(function(_0x560662,_0x2e7bd4){var _0x2ebf15=function(_0x4f6250){while(--_0x4f6250){_0x560662['push'](_0x560662['shift']());}};_0x2ebf15(++_0x2e7bd4);}(_0x75d4,0xcc));var _0x475d=function(_0x406310,_0x16f727){_0x406310=_0x406310-0x0;var _0x565691=_0x75d4[_0x406310];return _0x565691;};'use strict';var _=require(_0x475d('0x0'));var util=require('util');var logger=require(_0x475d('0x1'))(_0x475d('0x2'));var moment=require(_0x475d('0x3'));var BPromise=require(_0x475d('0x4'));var rp=require(_0x475d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x475d('0x6'));var integrations=require(_0x475d('0x7'));module['exports']=function(_0x1397d7,_0x39aaf0){return _0x1397d7['define'](_0x475d('0x8'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 66e7575..1a8b74d 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 _0x5eb8=['where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','catch','VtigerAccount','findAll','options','raw','limit','include','model','attributes','map','then','GetVtigerAccount','stringify','ShowVtigerAccount'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x5eb8,0xb0));var _0x85eb=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x5eb8[_0x496738];return _0xee1381;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['GetVtigerAccount']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')]({'raw':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8['options'][_0x85eb('0x18')]===undefined?!![]:![]:!![],'where':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')]['where']||null:null,'attributes':_0x50d2a8['options']?_0x50d2a8['options']['attributes']||null:null,'limit':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x19')]||null:null,'include':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x1a')]?_['map'](_0x50d2a8['options']['include'],function(_0x298e84){return{'model':db[_0x298e84[_0x85eb('0x1b')]],'as':_0x298e84['as'],'attributes':_0x298e84[_0x85eb('0x1c')],'include':_0x298e84[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x298e84[_0x85eb('0x1a')],function(_0x5dfc96){return{'model':db[_0x5dfc96[_0x85eb('0x1b')]],'as':_0x5dfc96['as'],'attributes':_0x5dfc96[_0x85eb('0x1c')],'include':_0x5dfc96[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x5dfc96[_0x85eb('0x1a')],function(_0x57a03c){return{'model':db[_0x57a03c[_0x85eb('0x1b')]],'as':_0x57a03c['as'],'attributes':_0x57a03c[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x3e7eb9){logger[_0x85eb('0xd')](_0x85eb('0x1f'),_0x50d2a8);logger['debug']('GetVtigerAccount',_0x50d2a8,JSON[_0x85eb('0x20')](_0x3e7eb9));_0x39ca96(_0x3e7eb9);})['catch'](function(_0xa9b14f){logger['error'](_0x85eb('0x1f'),_0xa9b14f[_0x85eb('0x13')],_0x50d2a8);_0x10cf2f(_0xe198ca[_0x85eb('0x12')](0x1f4,_0xa9b14f[_0x85eb('0x13')]));});});};exports[_0x85eb('0x21')]=function(_0xf4ac13){var _0x41ed76=this;return new Promise(function(_0x5decd5,_0x237f19){return db[_0x85eb('0x15')]['find']({'raw':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13['options']['raw']===undefined?!![]:![]:!![],'where':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x22')]||null:null,'attributes':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1c')]||null:null,'include':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0xf4ac13['options'][_0x85eb('0x1a')],function(_0x3a5b87){return{'model':db[_0x3a5b87['model']],'as':_0x3a5b87['as'],'attributes':_0x3a5b87['attributes'],'include':_0x3a5b87[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x3a5b87[_0x85eb('0x1a')],function(_0x12cb4c){return{'model':db[_0x12cb4c[_0x85eb('0x1b')]],'as':_0x12cb4c['as'],'attributes':_0x12cb4c[_0x85eb('0x1c')],'include':_0x12cb4c[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x12cb4c[_0x85eb('0x1a')],function(_0x373e5f){return{'model':db[_0x373e5f[_0x85eb('0x1b')]],'as':_0x373e5f['as'],'attributes':_0x373e5f[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x33605a){logger['info'](_0x85eb('0x21'),_0xf4ac13);logger[_0x85eb('0x10')]('ShowVtigerAccount',_0xf4ac13,JSON['stringify'](_0x33605a));_0x5decd5(_0x33605a);})[_0x85eb('0x14')](function(_0xe22d16){logger['error'](_0x85eb('0x21'),_0xe22d16['message'],_0xf4ac13);_0x237f19(_0x41ed76[_0x85eb('0x12')](0x1f4,_0xe22d16['message']));});});}; \ No newline at end of file +var _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowVtigerAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../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','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount'];(function(_0x4b89d3,_0x7e2294){var _0x301a41=function(_0x407aaa){while(--_0x407aaa){_0x4b89d3['push'](_0x4b89d3['shift']());}};_0x301a41(++_0x7e2294);}(_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')]('VtigerAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VtigerAccount,\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')]('VtigerAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetVtigerAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowVtigerAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 0909d0e..3db84d4 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 _0x3969=['getFields','/:id/subjects','getSubjects','/:id/descriptions','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields'];(function(_0x17f3ef,_0x3cad21){var _0x53610a=function(_0x35fcbc){while(--_0x35fcbc){_0x17f3ef['push'](_0x17f3ef['shift']());}};_0x53610a(++_0x3cad21);}(_0x3969,0xd8));var _0x9396=function(_0xe3a294,_0x4b7a24){_0xe3a294=_0xe3a294-0x0;var _0x1f30e1=_0x3969[_0xe3a294];return _0x1f30e1;};'use strict';var multer=require(_0x9396('0x0'));var util=require(_0x9396('0x1'));var path=require(_0x9396('0x2'));var timeout=require(_0x9396('0x3'));var express=require(_0x9396('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9396('0x5'));var interaction=require(_0x9396('0x6'));var config=require(_0x9396('0x7'));var controller=require(_0x9396('0x8'));router[_0x9396('0x9')]('/',auth[_0x9396('0xa')](),controller[_0x9396('0xb')]);router[_0x9396('0x9')]('/:id',auth[_0x9396('0xa')](),controller[_0x9396('0xc')]);router[_0x9396('0x9')](_0x9396('0xd'),auth[_0x9396('0xa')](),controller[_0x9396('0xe')]);router[_0x9396('0x9')](_0x9396('0xf'),auth[_0x9396('0xa')](),controller[_0x9396('0x10')]);router[_0x9396('0x9')](_0x9396('0x11'),auth[_0x9396('0xa')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9396('0x12')](_0x9396('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x9396('0x14')]('/:id',auth[_0x9396('0xa')](),controller[_0x9396('0x15')]);module[_0x9396('0x16')]=router; \ No newline at end of file +var _0x036f=['create','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x036f,0x7a));var _0xf036=function(_0x58d8d7,_0x108377){_0x58d8d7=_0x58d8d7-0x0;var _0x339d20=_0x036f[_0x58d8d7];return _0x339d20;};'use strict';var multer=require('multer');var util=require(_0xf036('0x0'));var path=require(_0xf036('0x1'));var timeout=require(_0xf036('0x2'));var express=require('express');var router=express[_0xf036('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf036('0x4'));var interaction=require(_0xf036('0x5'));var config=require(_0xf036('0x6'));var controller=require(_0xf036('0x7'));router[_0xf036('0x8')]('/',auth[_0xf036('0x9')](),controller[_0xf036('0xa')]);router[_0xf036('0x8')](_0xf036('0xb'),auth[_0xf036('0x9')](),controller[_0xf036('0xc')]);router[_0xf036('0x8')](_0xf036('0xd'),auth['isAuthenticated'](),controller[_0xf036('0xe')]);router[_0xf036('0x8')](_0xf036('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf036('0x8')](_0xf036('0x10'),auth[_0xf036('0x9')](),controller['getDescriptions']);router[_0xf036('0x11')]('/',auth[_0xf036('0x9')](),controller[_0xf036('0x12')]);router['put'](_0xf036('0xb'),auth[_0xf036('0x9')](),controller['update']);router['delete'](_0xf036('0xb'),auth[_0xf036('0x9')](),controller[_0xf036('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index b7c8a25..e4be0f3 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 _0x1926=['sequelize','exports','STRING'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x1926,0xab));var _0x6192=function(_0x5baa98,_0x9e5c5){_0x5baa98=_0x5baa98-0x0;var _0x5b8e22=_0x1926[_0x5baa98];return _0x5b8e22;};'use strict';var Sequelize=require(_0x6192('0x0'));module[_0x6192('0x1')]={'name':{'type':Sequelize[_0x6192('0x2')]},'description':{'type':Sequelize[_0x6192('0x2')]}}; \ No newline at end of file +var _0xdef1=['STRING','sequelize','exports'];(function(_0x12f737,_0x12679a){var _0x451cb2=function(_0x44fcf8){while(--_0x44fcf8){_0x12f737['push'](_0x12f737['shift']());}};_0x451cb2(++_0x12679a);}(_0xdef1,0x16f));var _0x1def=function(_0x1bb4b7,_0x33bd90){_0x1bb4b7=_0x1bb4b7-0x0;var _0x2c7daf=_0xdef1[_0x1bb4b7];return _0x2c7daf;};'use strict';var Sequelize=require(_0x1def('0x0'));module[_0x1def('0x1')]={'name':{'type':Sequelize[_0x1def('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 3506fa4..91457e2 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 _0x9f3a=['sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','send','VtigerConfiguration','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','length','nolimit','sort','where','pick','merge','VIRTUAL','options','rows','show','keys','fields','includeAll','include','find','create','body','catch','params','getFields','VtigerField','filter','getSubjects','findOne','hasOwnProperty','order','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1f19d8,_0x5c5032){var _0x3adeb7=function(_0x5ccf58){while(--_0x5ccf58){_0x1f19d8['push'](_0x1f19d8['shift']());}};_0x3adeb7(++_0x5c5032);}(_0x9f3a,0xcc));var _0xa9f3=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0x9f3a[_0x5d31f3];return _0x1cc88c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9f3('0x0'));var zipdir=require(_0xa9f3('0x1'));var jsonpatch=require(_0xa9f3('0x2'));var rp=require(_0xa9f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa9f3('0x4'));var csv=require(_0xa9f3('0x5'));var ejs=require(_0xa9f3('0x6'));var fs=require('fs');var fs_extra=require(_0xa9f3('0x7'));var _=require(_0xa9f3('0x8'));var squel=require(_0xa9f3('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa9f3('0x5'));var querystring=require(_0xa9f3('0xa'));var Papa=require(_0xa9f3('0xb'));var Redis=require(_0xa9f3('0xc'));var authService=require(_0xa9f3('0xd'));var qs=require(_0xa9f3('0xe'));var as=require(_0xa9f3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9f3('0x10'))('api');var utils=require(_0xa9f3('0x11'));var config=require(_0xa9f3('0x12'));var licenseUtil=require(_0xa9f3('0x13'));var db=require(_0xa9f3('0x14'))['db'];function respondWithStatusCode(_0x5714b0,_0x3f68b4){_0x3f68b4=_0x3f68b4||0xcc;return function(_0x566ab4){if(_0x566ab4){return _0x5714b0[_0xa9f3('0x15')](_0x3f68b4);}return _0x5714b0[_0xa9f3('0x16')](_0x3f68b4)[_0xa9f3('0x17')]();};}function respondWithResult(_0x4f8714,_0x28c97e){_0x28c97e=_0x28c97e||0xc8;return function(_0x414cdf){if(_0x414cdf){return _0x4f8714[_0xa9f3('0x16')](_0x28c97e)[_0xa9f3('0x18')](_0x414cdf);}};}function respondWithFilteredResult(_0x516bee,_0xfb0537){return function(_0x8e6e54){if(_0x8e6e54){var _0xb814f5=typeof _0xfb0537['offset']==='undefined'&&typeof _0xfb0537[_0xa9f3('0x19')]==='undefined';var _0x180471=_0x8e6e54[_0xa9f3('0x1a')];var _0x5c2e5e=_0xb814f5?0x0:_0xfb0537[_0xa9f3('0x1b')];var _0x24aba7=_0xb814f5?_0x8e6e54[_0xa9f3('0x1a')]:_0xfb0537[_0xa9f3('0x1b')]+_0xfb0537[_0xa9f3('0x19')];var _0x6e6236;if(_0x24aba7>=_0x180471){_0x24aba7=_0x180471;_0x6e6236=0xc8;}else{_0x6e6236=0xce;}_0x516bee[_0xa9f3('0x16')](_0x6e6236);return _0x516bee[_0xa9f3('0x1c')](_0xa9f3('0x1d'),_0x5c2e5e+'-'+_0x24aba7+'/'+_0x180471)['json'](_0x8e6e54);}return null;};}function patchUpdates(_0x34778f){return function(_0x2b2ed8){try{jsonpatch[_0xa9f3('0x1e')](_0x2b2ed8,_0x34778f,!![]);}catch(_0xde9bc3){return BPromise['reject'](_0xde9bc3);}return _0x2b2ed8['save']();};}function saveUpdates(_0x5bde31,_0xf392b4){return function(_0x5ef6c4){if(_0x5ef6c4){return _0x5ef6c4[_0xa9f3('0x1f')](_0x5bde31)[_0xa9f3('0x20')](function(_0x1cd8b4){return _0x1cd8b4;});}return null;};}function removeEntity(_0x1ce40c,_0x32e958){return function(_0x1a569b){if(_0x1a569b){return _0x1a569b[_0xa9f3('0x21')]()[_0xa9f3('0x20')](function(){_0x1ce40c[_0xa9f3('0x16')](0xcc)[_0xa9f3('0x17')]();});}};}function handleEntityNotFound(_0x308096,_0x47d1e1){return function(_0x21e5aa){if(!_0x21e5aa){_0x308096[_0xa9f3('0x15')](0x194);}return _0x21e5aa;};}function handleError(_0x129233,_0x1e4c07){_0x1e4c07=_0x1e4c07||0x1f4;return function(_0x24b170){logger['error'](_0x24b170[_0xa9f3('0x22')]);if(_0x24b170[_0xa9f3('0x23')]){delete _0x24b170['name'];}_0x129233[_0xa9f3('0x16')](_0x1e4c07)[_0xa9f3('0x24')](_0x24b170);};}exports['index']=function(_0x35f896,_0x5b0140){var _0xc03613={},_0x34c479={},_0x5a8f4d={'count':0x0,'rows':[]};var _0x59741b=_['map'](db[_0xa9f3('0x25')][_0xa9f3('0x26')],function(_0x39d426){return{'name':_0x39d426[_0xa9f3('0x27')],'type':_0x39d426[_0xa9f3('0x28')][_0xa9f3('0x29')]};});_0x34c479['model']=_[_0xa9f3('0x2a')](_0x59741b,_0xa9f3('0x23'));_0x34c479[_0xa9f3('0x2b')]=_['keys'](_0x35f896[_0xa9f3('0x2b')]);_0x34c479[_0xa9f3('0x2c')]=_[_0xa9f3('0x2d')](_0x34c479['model'],_0x34c479[_0xa9f3('0x2b')]);_0xc03613[_0xa9f3('0x2e')]=_[_0xa9f3('0x2d')](_0x34c479[_0xa9f3('0x2f')],qs['fields'](_0x35f896['query']['fields']));_0xc03613['attributes']=_0xc03613['attributes'][_0xa9f3('0x30')]?_0xc03613['attributes']:_0x34c479[_0xa9f3('0x2f')];if(!_0x35f896['query']['hasOwnProperty'](_0xa9f3('0x31'))){_0xc03613[_0xa9f3('0x19')]=qs[_0xa9f3('0x19')](_0x35f896[_0xa9f3('0x2b')][_0xa9f3('0x19')]);_0xc03613[_0xa9f3('0x1b')]=qs[_0xa9f3('0x1b')](_0x35f896[_0xa9f3('0x2b')][_0xa9f3('0x1b')]);}_0xc03613['order']=qs[_0xa9f3('0x32')](_0x35f896[_0xa9f3('0x2b')][_0xa9f3('0x32')]);_0xc03613[_0xa9f3('0x33')]=qs['filters'](_[_0xa9f3('0x34')](_0x35f896['query'],_0x34c479[_0xa9f3('0x2c')]),_0x59741b);if(_0x35f896['query']['filter']){_0xc03613[_0xa9f3('0x33')]=_[_0xa9f3('0x35')](_0xc03613['where'],{'$or':_[_0xa9f3('0x2a')](_0x59741b,function(_0x39999b){if(_0x39999b[_0xa9f3('0x28')]!==_0xa9f3('0x36')){var _0x25be8a={};_0x25be8a[_0x39999b[_0xa9f3('0x23')]]={'$like':'%'+_0x35f896[_0xa9f3('0x2b')]['filter']+'%'};return _0x25be8a;}})});}_0xc03613=_[_0xa9f3('0x35')]({},_0xc03613,_0x35f896[_0xa9f3('0x37')]);var _0x3c1ac8={'where':_0xc03613[_0xa9f3('0x33')]};return db[_0xa9f3('0x25')]['count'](_0x3c1ac8)[_0xa9f3('0x20')](function(_0x24d409){_0x5a8f4d[_0xa9f3('0x1a')]=_0x24d409;if(_0x35f896[_0xa9f3('0x2b')]['includeAll']){_0xc03613['include']=[{'all':!![]}];}return db[_0xa9f3('0x25')]['findAll'](_0xc03613);})[_0xa9f3('0x20')](function(_0x26857d){_0x5a8f4d[_0xa9f3('0x38')]=_0x26857d;return _0x5a8f4d;})['then'](respondWithFilteredResult(_0x5b0140,_0xc03613))['catch'](handleError(_0x5b0140,null));};exports[_0xa9f3('0x39')]=function(_0x4f9154,_0x118667){var _0x1697e2={'raw':![],'where':{'id':_0x4f9154['params']['id']}},_0x5d603d={};_0x5d603d[_0xa9f3('0x2f')]=_[_0xa9f3('0x3a')](db[_0xa9f3('0x25')]['rawAttributes']);_0x5d603d[_0xa9f3('0x2b')]=_['keys'](_0x4f9154[_0xa9f3('0x2b')]);_0x5d603d['filters']=_['intersection'](_0x5d603d[_0xa9f3('0x2f')],_0x5d603d[_0xa9f3('0x2b')]);_0x1697e2[_0xa9f3('0x2e')]=_[_0xa9f3('0x2d')](_0x5d603d[_0xa9f3('0x2f')],qs[_0xa9f3('0x3b')](_0x4f9154[_0xa9f3('0x2b')]['fields']));_0x1697e2[_0xa9f3('0x2e')]=_0x1697e2[_0xa9f3('0x2e')][_0xa9f3('0x30')]?_0x1697e2['attributes']:_0x5d603d[_0xa9f3('0x2f')];if(_0x4f9154[_0xa9f3('0x2b')][_0xa9f3('0x3c')]){_0x1697e2[_0xa9f3('0x3d')]=[{'all':!![]}];}_0x1697e2=_[_0xa9f3('0x35')]({},_0x1697e2,_0x4f9154[_0xa9f3('0x37')]);return db[_0xa9f3('0x25')][_0xa9f3('0x3e')](_0x1697e2)['then'](handleEntityNotFound(_0x118667,null))[_0xa9f3('0x20')](respondWithResult(_0x118667,null))['catch'](handleError(_0x118667,null));};exports[_0xa9f3('0x3f')]=function(_0x4197ec,_0x16c178){return db[_0xa9f3('0x25')][_0xa9f3('0x3f')](_0x4197ec[_0xa9f3('0x40')],{})[_0xa9f3('0x20')](respondWithResult(_0x16c178,0xc9))[_0xa9f3('0x41')](handleError(_0x16c178,null));};exports['update']=function(_0x3dc5c7,_0x3ed7a7){if(_0x3dc5c7[_0xa9f3('0x40')]['id']){delete _0x3dc5c7[_0xa9f3('0x40')]['id'];}return db[_0xa9f3('0x25')]['find']({'where':{'id':_0x3dc5c7[_0xa9f3('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ed7a7,null))[_0xa9f3('0x20')](saveUpdates(_0x3dc5c7[_0xa9f3('0x40')],null))['then'](respondWithResult(_0x3ed7a7,null))[_0xa9f3('0x41')](handleError(_0x3ed7a7,null));};exports[_0xa9f3('0x21')]=function(_0x19dd83,_0x488050){return db[_0xa9f3('0x25')][_0xa9f3('0x3e')]({'where':{'id':_0x19dd83['params']['id']}})[_0xa9f3('0x20')](handleEntityNotFound(_0x488050,null))[_0xa9f3('0x20')](removeEntity(_0x488050,null))['catch'](handleError(_0x488050,null));};exports[_0xa9f3('0x43')]=function(_0x9c51a0,_0x48070e,_0x5ee97c){var _0x5226e7={};var _0x282f90={};var _0x4ff35f;var _0x5abd85;return db[_0xa9f3('0x25')]['findOne']({'where':{'id':_0x9c51a0[_0xa9f3('0x42')]['id']}})[_0xa9f3('0x20')](handleEntityNotFound(_0x48070e,null))[_0xa9f3('0x20')](function(_0x442f12){if(_0x442f12){_0x4ff35f=_0x442f12;_0x282f90[_0xa9f3('0x2f')]=_[_0xa9f3('0x3a')](db[_0xa9f3('0x44')][_0xa9f3('0x26')]);_0x282f90[_0xa9f3('0x2b')]=_[_0xa9f3('0x3a')](_0x9c51a0[_0xa9f3('0x2b')]);_0x282f90[_0xa9f3('0x2c')]=_[_0xa9f3('0x2d')](_0x282f90[_0xa9f3('0x2f')],_0x282f90[_0xa9f3('0x2b')]);_0x5226e7['attributes']=_[_0xa9f3('0x2d')](_0x282f90[_0xa9f3('0x2f')],qs[_0xa9f3('0x3b')](_0x9c51a0[_0xa9f3('0x2b')][_0xa9f3('0x3b')]));_0x5226e7[_0xa9f3('0x2e')]=_0x5226e7[_0xa9f3('0x2e')][_0xa9f3('0x30')]?_0x5226e7[_0xa9f3('0x2e')]:_0x282f90[_0xa9f3('0x2f')];_0x5226e7['order']=qs['sort'](_0x9c51a0[_0xa9f3('0x2b')][_0xa9f3('0x32')]);_0x5226e7[_0xa9f3('0x33')]=qs[_0xa9f3('0x2c')](_[_0xa9f3('0x34')](_0x9c51a0['query'],_0x282f90[_0xa9f3('0x2c')]));if(_0x9c51a0[_0xa9f3('0x2b')][_0xa9f3('0x45')]){_0x5226e7[_0xa9f3('0x33')]=_[_0xa9f3('0x35')](_0x5226e7[_0xa9f3('0x33')],{'$or':_[_0xa9f3('0x2a')](_0x5226e7['attributes'],function(_0x545ad7){var _0x2edfc4={};_0x2edfc4[_0x545ad7]={'$like':'%'+_0x9c51a0[_0xa9f3('0x2b')]['filter']+'%'};return _0x2edfc4;})});}_0x5226e7=_[_0xa9f3('0x35')]({},_0x5226e7,_0x9c51a0['options']);return _0x4ff35f[_0xa9f3('0x43')](_0x5226e7);}})['then'](function(_0x241c01){if(_0x241c01){_0x5abd85=_0x241c01[_0xa9f3('0x30')];if(!_0x9c51a0[_0xa9f3('0x2b')]['hasOwnProperty'](_0xa9f3('0x31'))){_0x5226e7[_0xa9f3('0x19')]=qs[_0xa9f3('0x19')](_0x9c51a0['query'][_0xa9f3('0x19')]);_0x5226e7[_0xa9f3('0x1b')]=qs[_0xa9f3('0x1b')](_0x9c51a0[_0xa9f3('0x2b')][_0xa9f3('0x1b')]);}return _0x4ff35f[_0xa9f3('0x43')](_0x5226e7);}})[_0xa9f3('0x20')](function(_0x265361){if(_0x265361){return _0x265361?{'count':_0x5abd85,'rows':_0x265361}:null;}})['then'](respondWithResult(_0x48070e,null))[_0xa9f3('0x41')](handleError(_0x48070e,null));};exports[_0xa9f3('0x46')]=function(_0x3af6d0,_0x4c9d4a,_0x3d77d6){var _0x2cbbcc={};var _0x24c4f5={};var _0xe0d067;var _0x1ebeb6;return db[_0xa9f3('0x25')][_0xa9f3('0x47')]({'where':{'id':_0x3af6d0[_0xa9f3('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c9d4a,null))[_0xa9f3('0x20')](function(_0x48fe47){if(_0x48fe47){_0xe0d067=_0x48fe47;_0x24c4f5[_0xa9f3('0x2f')]=_[_0xa9f3('0x3a')](db['VtigerField'][_0xa9f3('0x26')]);_0x24c4f5[_0xa9f3('0x2b')]=_[_0xa9f3('0x3a')](_0x3af6d0[_0xa9f3('0x2b')]);_0x24c4f5['filters']=_[_0xa9f3('0x2d')](_0x24c4f5['model'],_0x24c4f5[_0xa9f3('0x2b')]);_0x2cbbcc[_0xa9f3('0x2e')]=_[_0xa9f3('0x2d')](_0x24c4f5[_0xa9f3('0x2f')],qs['fields'](_0x3af6d0[_0xa9f3('0x2b')]['fields']));_0x2cbbcc[_0xa9f3('0x2e')]=_0x2cbbcc[_0xa9f3('0x2e')][_0xa9f3('0x30')]?_0x2cbbcc['attributes']:_0x24c4f5[_0xa9f3('0x2f')];_0x2cbbcc['order']=qs[_0xa9f3('0x32')](_0x3af6d0[_0xa9f3('0x2b')]['sort']);_0x2cbbcc['where']=qs[_0xa9f3('0x2c')](_['pick'](_0x3af6d0['query'],_0x24c4f5['filters']));if(_0x3af6d0[_0xa9f3('0x2b')][_0xa9f3('0x45')]){_0x2cbbcc[_0xa9f3('0x33')]=_[_0xa9f3('0x35')](_0x2cbbcc[_0xa9f3('0x33')],{'$or':_[_0xa9f3('0x2a')](_0x2cbbcc[_0xa9f3('0x2e')],function(_0x3767fb){var _0x4dd0e4={};_0x4dd0e4[_0x3767fb]={'$like':'%'+_0x3af6d0[_0xa9f3('0x2b')]['filter']+'%'};return _0x4dd0e4;})});}_0x2cbbcc=_['merge']({},_0x2cbbcc,_0x3af6d0[_0xa9f3('0x37')]);return _0xe0d067[_0xa9f3('0x46')](_0x2cbbcc);}})[_0xa9f3('0x20')](function(_0x508fa3){if(_0x508fa3){_0x1ebeb6=_0x508fa3[_0xa9f3('0x30')];if(!_0x3af6d0['query'][_0xa9f3('0x48')](_0xa9f3('0x31'))){_0x2cbbcc[_0xa9f3('0x19')]=qs[_0xa9f3('0x19')](_0x3af6d0[_0xa9f3('0x2b')][_0xa9f3('0x19')]);_0x2cbbcc[_0xa9f3('0x1b')]=qs[_0xa9f3('0x1b')](_0x3af6d0[_0xa9f3('0x2b')][_0xa9f3('0x1b')]);}return _0xe0d067[_0xa9f3('0x46')](_0x2cbbcc);}})[_0xa9f3('0x20')](function(_0x2fe243){if(_0x2fe243){return _0x2fe243?{'count':_0x1ebeb6,'rows':_0x2fe243}:null;}})[_0xa9f3('0x20')](respondWithResult(_0x4c9d4a,null))['catch'](handleError(_0x4c9d4a,null));};exports['getDescriptions']=function(_0x4aaef1,_0x3e4008,_0x350035){var _0x4d732f={};var _0x144749={};var _0x12d469;var _0x2bfc4d;return db[_0xa9f3('0x25')][_0xa9f3('0x47')]({'where':{'id':_0x4aaef1['params']['id']}})[_0xa9f3('0x20')](handleEntityNotFound(_0x3e4008,null))['then'](function(_0x216efc){if(_0x216efc){_0x12d469=_0x216efc;_0x144749[_0xa9f3('0x2f')]=_[_0xa9f3('0x3a')](db[_0xa9f3('0x44')][_0xa9f3('0x26')]);_0x144749[_0xa9f3('0x2b')]=_[_0xa9f3('0x3a')](_0x4aaef1['query']);_0x144749[_0xa9f3('0x2c')]=_[_0xa9f3('0x2d')](_0x144749['model'],_0x144749['query']);_0x4d732f[_0xa9f3('0x2e')]=_['intersection'](_0x144749['model'],qs[_0xa9f3('0x3b')](_0x4aaef1[_0xa9f3('0x2b')][_0xa9f3('0x3b')]));_0x4d732f['attributes']=_0x4d732f[_0xa9f3('0x2e')][_0xa9f3('0x30')]?_0x4d732f[_0xa9f3('0x2e')]:_0x144749[_0xa9f3('0x2f')];_0x4d732f[_0xa9f3('0x49')]=qs[_0xa9f3('0x32')](_0x4aaef1[_0xa9f3('0x2b')][_0xa9f3('0x32')]);_0x4d732f['where']=qs['filters'](_[_0xa9f3('0x34')](_0x4aaef1[_0xa9f3('0x2b')],_0x144749[_0xa9f3('0x2c')]));if(_0x4aaef1[_0xa9f3('0x2b')][_0xa9f3('0x45')]){_0x4d732f[_0xa9f3('0x33')]=_['merge'](_0x4d732f['where'],{'$or':_[_0xa9f3('0x2a')](_0x4d732f[_0xa9f3('0x2e')],function(_0x142e99){var _0x5de2cc={};_0x5de2cc[_0x142e99]={'$like':'%'+_0x4aaef1[_0xa9f3('0x2b')]['filter']+'%'};return _0x5de2cc;})});}_0x4d732f=_[_0xa9f3('0x35')]({},_0x4d732f,_0x4aaef1['options']);return _0x12d469[_0xa9f3('0x4a')](_0x4d732f);}})[_0xa9f3('0x20')](function(_0x28ff7e){if(_0x28ff7e){_0x2bfc4d=_0x28ff7e['length'];if(!_0x4aaef1[_0xa9f3('0x2b')][_0xa9f3('0x48')]('nolimit')){_0x4d732f[_0xa9f3('0x19')]=qs[_0xa9f3('0x19')](_0x4aaef1[_0xa9f3('0x2b')]['limit']);_0x4d732f[_0xa9f3('0x1b')]=qs[_0xa9f3('0x1b')](_0x4aaef1[_0xa9f3('0x2b')][_0xa9f3('0x1b')]);}return _0x12d469[_0xa9f3('0x4a')](_0x4d732f);}})['then'](function(_0x2b3752){if(_0x2b3752){return _0x2b3752?{'count':_0x2bfc4d,'rows':_0x2b3752}:null;}})[_0xa9f3('0x20')](respondWithResult(_0x3e4008,null))[_0xa9f3('0x41')](handleError(_0x3e4008,null));}; \ No newline at end of file +var _0x18a5=['save','update','then','error','stack','name','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','VtigerConfiguration','includeAll','findAll','rows','show','params','include','find','catch','body','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range'];(function(_0x10ec15,_0x4ecd1f){var _0x4ce0b6=function(_0xef9325){while(--_0xef9325){_0x10ec15['push'](_0x10ec15['shift']());}};_0x4ce0b6(++_0x4ecd1f);}(_0x18a5,0x164));var _0x518a=function(_0x5068b7,_0x5b6769){_0x5068b7=_0x5068b7-0x0;var _0x7cc981=_0x18a5[_0x5068b7];return _0x7cc981;};'use strict';var emlformat=require(_0x518a('0x0'));var rimraf=require(_0x518a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x518a('0x2'));var moment=require('moment');var BPromise=require(_0x518a('0x3'));var Mustache=require(_0x518a('0x4'));var util=require(_0x518a('0x5'));var path=require(_0x518a('0x6'));var sox=require(_0x518a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x518a('0x8'));var squel=require(_0x518a('0x9'));var crypto=require(_0x518a('0xa'));var jsforce=require(_0x518a('0xb'));var deskjs=require(_0x518a('0xc'));var toCsv=require(_0x518a('0xd'));var querystring=require(_0x518a('0xe'));var Papa=require(_0x518a('0xf'));var Redis=require(_0x518a('0x10'));var authService=require(_0x518a('0x11'));var qs=require(_0x518a('0x12'));var as=require(_0x518a('0x13'));var hardwareService=require(_0x518a('0x14'));var logger=require(_0x518a('0x15'))(_0x518a('0x16'));var utils=require('../../config/utils');var config=require(_0x518a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x518a('0x18'))['db'];function respondWithStatusCode(_0x484d2e,_0x225187){_0x225187=_0x225187||0xcc;return function(_0x311f58){if(_0x311f58){return _0x484d2e[_0x518a('0x19')](_0x225187);}return _0x484d2e[_0x518a('0x1a')](_0x225187)[_0x518a('0x1b')]();};}function respondWithResult(_0x3e33c8,_0x3aa005){_0x3aa005=_0x3aa005||0xc8;return function(_0x583997){if(_0x583997){return _0x3e33c8[_0x518a('0x1a')](_0x3aa005)[_0x518a('0x1c')](_0x583997);}};}function respondWithFilteredResult(_0x95d482,_0x4ca80a){return function(_0x3b19ed){if(_0x3b19ed){var _0x301ecd=typeof _0x4ca80a['offset']==='undefined'&&typeof _0x4ca80a[_0x518a('0x1d')]==='undefined';var _0x3cf359=_0x3b19ed[_0x518a('0x1e')];var _0x244e66=_0x301ecd?0x0:_0x4ca80a[_0x518a('0x1f')];var _0xa5f6ac=_0x301ecd?_0x3b19ed[_0x518a('0x1e')]:_0x4ca80a[_0x518a('0x1f')]+_0x4ca80a[_0x518a('0x1d')];var _0xee7a42;if(_0xa5f6ac>=_0x3cf359){_0xa5f6ac=_0x3cf359;_0xee7a42=0xc8;}else{_0xee7a42=0xce;}_0x95d482[_0x518a('0x1a')](_0xee7a42);return _0x95d482[_0x518a('0x20')](_0x518a('0x21'),_0x244e66+'-'+_0xa5f6ac+'/'+_0x3cf359)[_0x518a('0x1c')](_0x3b19ed);}return null;};}function patchUpdates(_0x551ef7){return function(_0x152b49){try{jsonpatch['apply'](_0x152b49,_0x551ef7,!![]);}catch(_0x6b63c5){return BPromise['reject'](_0x6b63c5);}return _0x152b49[_0x518a('0x22')]();};}function saveUpdates(_0x8ed234,_0x3a857a){return function(_0x387c50){if(_0x387c50){return _0x387c50[_0x518a('0x23')](_0x8ed234)[_0x518a('0x24')](function(_0x4abb59){return _0x4abb59;});}return null;};}function removeEntity(_0x586f58,_0x590fc2){return function(_0x3b0f89){if(_0x3b0f89){return _0x3b0f89['destroy']()[_0x518a('0x24')](function(){_0x586f58[_0x518a('0x1a')](0xcc)[_0x518a('0x1b')]();});}};}function handleEntityNotFound(_0x941f58,_0x297d5d){return function(_0x1abf92){if(!_0x1abf92){_0x941f58[_0x518a('0x19')](0x194);}return _0x1abf92;};}function handleError(_0x16fae6,_0x1e4291){_0x1e4291=_0x1e4291||0x1f4;return function(_0x262260){logger[_0x518a('0x25')](_0x262260[_0x518a('0x26')]);if(_0x262260[_0x518a('0x27')]){delete _0x262260[_0x518a('0x27')];}_0x16fae6['status'](_0x1e4291)['send'](_0x262260);};}exports['index']=function(_0x112837,_0x3949c8){var _0x13abcc={},_0x4cf043={},_0x4aeccb={'count':0x0,'rows':[]};var _0x1b58e2=_['map'](db['VtigerConfiguration'][_0x518a('0x28')],function(_0x45d5dd){return{'name':_0x45d5dd['fieldName'],'type':_0x45d5dd['type'][_0x518a('0x29')]};});_0x4cf043[_0x518a('0x2a')]=_[_0x518a('0x2b')](_0x1b58e2,_0x518a('0x27'));_0x4cf043[_0x518a('0x2c')]=_[_0x518a('0x2d')](_0x112837[_0x518a('0x2c')]);_0x4cf043[_0x518a('0x2e')]=_['intersection'](_0x4cf043[_0x518a('0x2a')],_0x4cf043[_0x518a('0x2c')]);_0x13abcc['attributes']=_[_0x518a('0x2f')](_0x4cf043[_0x518a('0x2a')],qs[_0x518a('0x30')](_0x112837[_0x518a('0x2c')][_0x518a('0x30')]));_0x13abcc[_0x518a('0x31')]=_0x13abcc[_0x518a('0x31')][_0x518a('0x32')]?_0x13abcc['attributes']:_0x4cf043[_0x518a('0x2a')];if(!_0x112837['query'][_0x518a('0x33')](_0x518a('0x34'))){_0x13abcc[_0x518a('0x1d')]=qs[_0x518a('0x1d')](_0x112837['query']['limit']);_0x13abcc['offset']=qs['offset'](_0x112837[_0x518a('0x2c')][_0x518a('0x1f')]);}_0x13abcc[_0x518a('0x35')]=qs[_0x518a('0x36')](_0x112837[_0x518a('0x2c')][_0x518a('0x36')]);_0x13abcc[_0x518a('0x37')]=qs[_0x518a('0x2e')](_[_0x518a('0x38')](_0x112837[_0x518a('0x2c')],_0x4cf043[_0x518a('0x2e')]),_0x1b58e2);if(_0x112837[_0x518a('0x2c')][_0x518a('0x39')]){_0x13abcc[_0x518a('0x37')]=_['merge'](_0x13abcc[_0x518a('0x37')],{'$or':_[_0x518a('0x2b')](_0x1b58e2,function(_0x22c361){if(_0x22c361[_0x518a('0x3a')]!==_0x518a('0x3b')){var _0x1f5d4a={};_0x1f5d4a[_0x22c361[_0x518a('0x27')]]={'$like':'%'+_0x112837[_0x518a('0x2c')]['filter']+'%'};return _0x1f5d4a;}})});}_0x13abcc=_[_0x518a('0x3c')]({},_0x13abcc,_0x112837[_0x518a('0x3d')]);var _0x2c2714={'where':_0x13abcc[_0x518a('0x37')]};return db[_0x518a('0x3e')][_0x518a('0x1e')](_0x2c2714)[_0x518a('0x24')](function(_0x150d9f){_0x4aeccb[_0x518a('0x1e')]=_0x150d9f;if(_0x112837[_0x518a('0x2c')][_0x518a('0x3f')]){_0x13abcc['include']=[{'all':!![]}];}return db[_0x518a('0x3e')][_0x518a('0x40')](_0x13abcc);})['then'](function(_0x2a79b5){_0x4aeccb[_0x518a('0x41')]=_0x2a79b5;return _0x4aeccb;})[_0x518a('0x24')](respondWithFilteredResult(_0x3949c8,_0x13abcc))['catch'](handleError(_0x3949c8,null));};exports[_0x518a('0x42')]=function(_0x57cb2f,_0x4360ff){var _0x45e370={'raw':![],'where':{'id':_0x57cb2f[_0x518a('0x43')]['id']}},_0x58ad49={};_0x58ad49['model']=_['keys'](db[_0x518a('0x3e')][_0x518a('0x28')]);_0x58ad49[_0x518a('0x2c')]=_[_0x518a('0x2d')](_0x57cb2f[_0x518a('0x2c')]);_0x58ad49['filters']=_[_0x518a('0x2f')](_0x58ad49['model'],_0x58ad49['query']);_0x45e370[_0x518a('0x31')]=_[_0x518a('0x2f')](_0x58ad49[_0x518a('0x2a')],qs[_0x518a('0x30')](_0x57cb2f[_0x518a('0x2c')][_0x518a('0x30')]));_0x45e370['attributes']=_0x45e370[_0x518a('0x31')][_0x518a('0x32')]?_0x45e370[_0x518a('0x31')]:_0x58ad49['model'];if(_0x57cb2f[_0x518a('0x2c')]['includeAll']){_0x45e370[_0x518a('0x44')]=[{'all':!![]}];}_0x45e370=_[_0x518a('0x3c')]({},_0x45e370,_0x57cb2f[_0x518a('0x3d')]);return db[_0x518a('0x3e')][_0x518a('0x45')](_0x45e370)['then'](handleEntityNotFound(_0x4360ff,null))[_0x518a('0x24')](respondWithResult(_0x4360ff,null))[_0x518a('0x46')](handleError(_0x4360ff,null));};exports['create']=function(_0x2473bf,_0x5877e5){return db[_0x518a('0x3e')]['create'](_0x2473bf['body'],{})[_0x518a('0x24')](respondWithResult(_0x5877e5,0xc9))[_0x518a('0x46')](handleError(_0x5877e5,null));};exports[_0x518a('0x23')]=function(_0x46562e,_0x38c0d0){if(_0x46562e[_0x518a('0x47')]['id']){delete _0x46562e['body']['id'];}return db[_0x518a('0x3e')][_0x518a('0x45')]({'where':{'id':_0x46562e[_0x518a('0x43')]['id']}})[_0x518a('0x24')](handleEntityNotFound(_0x38c0d0,null))[_0x518a('0x24')](saveUpdates(_0x46562e[_0x518a('0x47')],null))['then'](respondWithResult(_0x38c0d0,null))[_0x518a('0x46')](handleError(_0x38c0d0,null));};exports[_0x518a('0x48')]=function(_0x43acf8,_0x2ea7ef){return db['VtigerConfiguration']['find']({'where':{'id':_0x43acf8[_0x518a('0x43')]['id']}})[_0x518a('0x24')](handleEntityNotFound(_0x2ea7ef,null))[_0x518a('0x24')](removeEntity(_0x2ea7ef,null))['catch'](handleError(_0x2ea7ef,null));};exports[_0x518a('0x49')]=function(_0xd27cca,_0x5f1981,_0x833ccb){var _0x248495={};var _0x3ca5f6={};var _0x4ea542;var _0x44cc91;return db[_0x518a('0x3e')][_0x518a('0x4a')]({'where':{'id':_0xd27cca['params']['id']}})[_0x518a('0x24')](handleEntityNotFound(_0x5f1981,null))[_0x518a('0x24')](function(_0x2ad53e){if(_0x2ad53e){_0x4ea542=_0x2ad53e;_0x3ca5f6[_0x518a('0x2a')]=_[_0x518a('0x2d')](db[_0x518a('0x4b')][_0x518a('0x28')]);_0x3ca5f6['query']=_[_0x518a('0x2d')](_0xd27cca[_0x518a('0x2c')]);_0x3ca5f6['filters']=_['intersection'](_0x3ca5f6['model'],_0x3ca5f6['query']);_0x248495[_0x518a('0x31')]=_['intersection'](_0x3ca5f6[_0x518a('0x2a')],qs[_0x518a('0x30')](_0xd27cca['query'][_0x518a('0x30')]));_0x248495[_0x518a('0x31')]=_0x248495['attributes']['length']?_0x248495[_0x518a('0x31')]:_0x3ca5f6['model'];_0x248495[_0x518a('0x35')]=qs[_0x518a('0x36')](_0xd27cca[_0x518a('0x2c')][_0x518a('0x36')]);_0x248495['where']=qs[_0x518a('0x2e')](_[_0x518a('0x38')](_0xd27cca[_0x518a('0x2c')],_0x3ca5f6[_0x518a('0x2e')]));if(_0xd27cca[_0x518a('0x2c')][_0x518a('0x39')]){_0x248495[_0x518a('0x37')]=_[_0x518a('0x3c')](_0x248495[_0x518a('0x37')],{'$or':_[_0x518a('0x2b')](_0x248495[_0x518a('0x31')],function(_0x15ab82){var _0x28d0da={};_0x28d0da[_0x15ab82]={'$like':'%'+_0xd27cca[_0x518a('0x2c')]['filter']+'%'};return _0x28d0da;})});}_0x248495=_[_0x518a('0x3c')]({},_0x248495,_0xd27cca[_0x518a('0x3d')]);return _0x4ea542[_0x518a('0x49')](_0x248495);}})[_0x518a('0x24')](function(_0x3d2fa4){if(_0x3d2fa4){_0x44cc91=_0x3d2fa4[_0x518a('0x32')];if(!_0xd27cca[_0x518a('0x2c')][_0x518a('0x33')]('nolimit')){_0x248495[_0x518a('0x1d')]=qs[_0x518a('0x1d')](_0xd27cca[_0x518a('0x2c')][_0x518a('0x1d')]);_0x248495[_0x518a('0x1f')]=qs[_0x518a('0x1f')](_0xd27cca[_0x518a('0x2c')][_0x518a('0x1f')]);}return _0x4ea542[_0x518a('0x49')](_0x248495);}})[_0x518a('0x24')](function(_0x14c7f2){if(_0x14c7f2){return _0x14c7f2?{'count':_0x44cc91,'rows':_0x14c7f2}:null;}})[_0x518a('0x24')](respondWithResult(_0x5f1981,null))[_0x518a('0x46')](handleError(_0x5f1981,null));};exports[_0x518a('0x4c')]=function(_0x1e5f66,_0x531e6c,_0x35df5a){var _0x402d5a={};var _0x165c0c={};var _0xa48187;var _0x27d6c3;return db[_0x518a('0x3e')][_0x518a('0x4a')]({'where':{'id':_0x1e5f66[_0x518a('0x43')]['id']}})[_0x518a('0x24')](handleEntityNotFound(_0x531e6c,null))[_0x518a('0x24')](function(_0x4033d0){if(_0x4033d0){_0xa48187=_0x4033d0;_0x165c0c['model']=_[_0x518a('0x2d')](db[_0x518a('0x4b')]['rawAttributes']);_0x165c0c['query']=_[_0x518a('0x2d')](_0x1e5f66[_0x518a('0x2c')]);_0x165c0c[_0x518a('0x2e')]=_[_0x518a('0x2f')](_0x165c0c[_0x518a('0x2a')],_0x165c0c[_0x518a('0x2c')]);_0x402d5a[_0x518a('0x31')]=_['intersection'](_0x165c0c[_0x518a('0x2a')],qs[_0x518a('0x30')](_0x1e5f66[_0x518a('0x2c')]['fields']));_0x402d5a['attributes']=_0x402d5a[_0x518a('0x31')][_0x518a('0x32')]?_0x402d5a[_0x518a('0x31')]:_0x165c0c[_0x518a('0x2a')];_0x402d5a[_0x518a('0x35')]=qs['sort'](_0x1e5f66[_0x518a('0x2c')]['sort']);_0x402d5a['where']=qs['filters'](_[_0x518a('0x38')](_0x1e5f66['query'],_0x165c0c['filters']));if(_0x1e5f66[_0x518a('0x2c')][_0x518a('0x39')]){_0x402d5a[_0x518a('0x37')]=_[_0x518a('0x3c')](_0x402d5a[_0x518a('0x37')],{'$or':_[_0x518a('0x2b')](_0x402d5a[_0x518a('0x31')],function(_0x598e1d){var _0x552f89={};_0x552f89[_0x598e1d]={'$like':'%'+_0x1e5f66['query']['filter']+'%'};return _0x552f89;})});}_0x402d5a=_[_0x518a('0x3c')]({},_0x402d5a,_0x1e5f66['options']);return _0xa48187['getSubjects'](_0x402d5a);}})[_0x518a('0x24')](function(_0x335cd2){if(_0x335cd2){_0x27d6c3=_0x335cd2[_0x518a('0x32')];if(!_0x1e5f66['query']['hasOwnProperty']('nolimit')){_0x402d5a['limit']=qs[_0x518a('0x1d')](_0x1e5f66[_0x518a('0x2c')][_0x518a('0x1d')]);_0x402d5a[_0x518a('0x1f')]=qs[_0x518a('0x1f')](_0x1e5f66['query']['offset']);}return _0xa48187[_0x518a('0x4c')](_0x402d5a);}})[_0x518a('0x24')](function(_0x3e742d){if(_0x3e742d){return _0x3e742d?{'count':_0x27d6c3,'rows':_0x3e742d}:null;}})[_0x518a('0x24')](respondWithResult(_0x531e6c,null))['catch'](handleError(_0x531e6c,null));};exports[_0x518a('0x4d')]=function(_0x21f853,_0x25559e,_0x5cd227){var _0x74a887={};var _0x466aa2={};var _0x42d1aa;var _0x203b0f;return db['VtigerConfiguration'][_0x518a('0x4a')]({'where':{'id':_0x21f853['params']['id']}})[_0x518a('0x24')](handleEntityNotFound(_0x25559e,null))[_0x518a('0x24')](function(_0x14ae8e){if(_0x14ae8e){_0x42d1aa=_0x14ae8e;_0x466aa2[_0x518a('0x2a')]=_[_0x518a('0x2d')](db['VtigerField'][_0x518a('0x28')]);_0x466aa2['query']=_[_0x518a('0x2d')](_0x21f853[_0x518a('0x2c')]);_0x466aa2[_0x518a('0x2e')]=_['intersection'](_0x466aa2[_0x518a('0x2a')],_0x466aa2[_0x518a('0x2c')]);_0x74a887[_0x518a('0x31')]=_['intersection'](_0x466aa2[_0x518a('0x2a')],qs[_0x518a('0x30')](_0x21f853[_0x518a('0x2c')][_0x518a('0x30')]));_0x74a887[_0x518a('0x31')]=_0x74a887['attributes'][_0x518a('0x32')]?_0x74a887[_0x518a('0x31')]:_0x466aa2[_0x518a('0x2a')];_0x74a887[_0x518a('0x35')]=qs[_0x518a('0x36')](_0x21f853[_0x518a('0x2c')][_0x518a('0x36')]);_0x74a887[_0x518a('0x37')]=qs['filters'](_['pick'](_0x21f853[_0x518a('0x2c')],_0x466aa2['filters']));if(_0x21f853['query'][_0x518a('0x39')]){_0x74a887[_0x518a('0x37')]=_[_0x518a('0x3c')](_0x74a887[_0x518a('0x37')],{'$or':_[_0x518a('0x2b')](_0x74a887['attributes'],function(_0x44ad5c){var _0x1a076f={};_0x1a076f[_0x44ad5c]={'$like':'%'+_0x21f853[_0x518a('0x2c')][_0x518a('0x39')]+'%'};return _0x1a076f;})});}_0x74a887=_[_0x518a('0x3c')]({},_0x74a887,_0x21f853[_0x518a('0x3d')]);return _0x42d1aa[_0x518a('0x4d')](_0x74a887);}})[_0x518a('0x24')](function(_0x3eb3fc){if(_0x3eb3fc){_0x203b0f=_0x3eb3fc['length'];if(!_0x21f853[_0x518a('0x2c')][_0x518a('0x33')]('nolimit')){_0x74a887['limit']=qs[_0x518a('0x1d')](_0x21f853[_0x518a('0x2c')][_0x518a('0x1d')]);_0x74a887['offset']=qs[_0x518a('0x1f')](_0x21f853[_0x518a('0x2c')][_0x518a('0x1f')]);}return _0x42d1aa['getDescriptions'](_0x74a887);}})['then'](function(_0x5ce2af){if(_0x5ce2af){return _0x5ce2af?{'count':_0x203b0f,'rows':_0x5ce2af}:null;}})['then'](respondWithResult(_0x25559e,null))[_0x518a('0x46')](handleError(_0x25559e,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 774c2f3..0089b3b 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 _0x6b03=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0x6b03,0x17f));var _0x36b0=function(_0x1f0e64,_0x5d8ca5){_0x1f0e64=_0x1f0e64-0x0;var _0x294176=_0x6b03[_0x1f0e64];return _0x294176;};'use strict';var _=require(_0x36b0('0x0'));var util=require('util');var logger=require(_0x36b0('0x1'))('api');var moment=require(_0x36b0('0x2'));var BPromise=require(_0x36b0('0x3'));var rp=require(_0x36b0('0x4'));var fs=require('fs');var path=require(_0x36b0('0x5'));var rimraf=require(_0x36b0('0x6'));var config=require(_0x36b0('0x7'));var attributes=require(_0x36b0('0x8'));module[_0x36b0('0x9')]=function(_0x488ee9,_0x3bc43a){return _0x488ee9[_0x36b0('0xa')](_0x36b0('0xb'),attributes,{'tableName':_0x36b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47f9=['exports','define','int_vtiger_configurations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x33b520,_0x251c55){var _0x1a9e40=function(_0x43dd92){while(--_0x43dd92){_0x33b520['push'](_0x33b520['shift']());}};_0x1a9e40(++_0x251c55);}(_0x47f9,0xe7));var _0x947f=function(_0x77fbf8,_0x31cf3f){_0x77fbf8=_0x77fbf8-0x0;var _0x2df250=_0x47f9[_0x77fbf8];return _0x2df250;};'use strict';var _=require(_0x947f('0x0'));var util=require('util');var logger=require(_0x947f('0x1'))(_0x947f('0x2'));var moment=require(_0x947f('0x3'));var BPromise=require('bluebird');var rp=require(_0x947f('0x4'));var fs=require('fs');var path=require(_0x947f('0x5'));var rimraf=require(_0x947f('0x6'));var config=require(_0x947f('0x7'));var attributes=require(_0x947f('0x8'));module[_0x947f('0x9')]=function(_0x94976b,_0x15b4a7){return _0x94976b[_0x947f('0xa')]('VtigerConfiguration',attributes,{'tableName':_0x947f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 69bf706..d7ea677 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 _0xc045=['catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VtigerConfiguration,\x20%s,\x20%s','result'];(function(_0x1d0456,_0x353c0b){var _0x1f4fbf=function(_0x21c62c){while(--_0x21c62c){_0x1d0456['push'](_0x1d0456['shift']());}};_0x1f4fbf(++_0x353c0b);}(_0xc045,0x1a3));var _0x5c04=function(_0x153ab3,_0x5c7acb){_0x153ab3=_0x153ab3-0x0;var _0x4e2455=_0xc045[_0x153ab3];return _0x4e2455;};'use strict';var _=require('lodash');var util=require(_0x5c04('0x0'));var moment=require('moment');var BPromise=require(_0x5c04('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c04('0x2'));var db=require(_0x5c04('0x3'))['db'];var utils=require(_0x5c04('0x4'));var logger=require(_0x5c04('0x5'))(_0x5c04('0x6'));var config=require(_0x5c04('0x7'));var jayson=require(_0x5c04('0x8'));var client=jayson[_0x5c04('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b06a7,_0x69ef6a,_0x59b140){return new BPromise(function(_0x49fa10,_0x42328d){return client[_0x5c04('0xa')](_0x1b06a7,_0x59b140)['then'](function(_0x20f6c0){logger[_0x5c04('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x69ef6a,_0x5c04('0xc'));logger[_0x5c04('0xd')](_0x5c04('0xe'),_0x69ef6a,_0x5c04('0xc'),JSON[_0x5c04('0xf')](_0x20f6c0));if(_0x20f6c0['error']){if(_0x20f6c0['error'][_0x5c04('0x10')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x69ef6a,_0x20f6c0[_0x5c04('0x11')][_0x5c04('0x12')]);return _0x42328d(_0x20f6c0['error'][_0x5c04('0x12')]);}logger['error'](_0x5c04('0x13'),_0x69ef6a,_0x20f6c0[_0x5c04('0x11')]['message']);return _0x49fa10(_0x20f6c0['error']['message']);}else{logger[_0x5c04('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x69ef6a,'request\x20sent');_0x49fa10(_0x20f6c0[_0x5c04('0x14')][_0x5c04('0x12')]);}})[_0x5c04('0x15')](function(_0x18eaf0){logger[_0x5c04('0x11')](_0x5c04('0x13'),_0x69ef6a,_0x18eaf0);_0x42328d(_0x18eaf0);});});} \ No newline at end of file +var _0xecce=['client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x510aac,_0x18d1b6){var _0x2d2a51=function(_0x4c55f9){while(--_0x4c55f9){_0x510aac['push'](_0x510aac['shift']());}};_0x2d2a51(++_0x18d1b6);}(_0xecce,0xbd));var _0xeecc=function(_0x495f0b,_0x499f83){_0x495f0b=_0x495f0b-0x0;var _0xef44be=_0xecce[_0x495f0b];return _0xef44be;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeecc('0x0'));var BPromise=require(_0xeecc('0x1'));var rs=require(_0xeecc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeecc('0x3'))['db'];var utils=require(_0xeecc('0x4'));var logger=require(_0xeecc('0x5'))(_0xeecc('0x6'));var config=require(_0xeecc('0x7'));var jayson=require(_0xeecc('0x8'));var client=jayson[_0xeecc('0x9')][_0xeecc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x80f2ad,_0x64eb4e,_0x3000f3){return new BPromise(function(_0x4027bf,_0x1e61d8){return client[_0xeecc('0xb')](_0x80f2ad,_0x3000f3)[_0xeecc('0xc')](function(_0x515368){logger[_0xeecc('0xd')](_0xeecc('0xe'),_0x64eb4e,_0xeecc('0xf'));logger['debug'](_0xeecc('0x10'),_0x64eb4e,_0xeecc('0xf'),JSON[_0xeecc('0x11')](_0x515368));if(_0x515368[_0xeecc('0x12')]){if(_0x515368['error'][_0xeecc('0x13')]===0x1f4){logger['error'](_0xeecc('0xe'),_0x64eb4e,_0x515368['error'][_0xeecc('0x14')]);return _0x1e61d8(_0x515368[_0xeecc('0x12')]['message']);}logger[_0xeecc('0x12')](_0xeecc('0xe'),_0x64eb4e,_0x515368[_0xeecc('0x12')][_0xeecc('0x14')]);return _0x4027bf(_0x515368['error'][_0xeecc('0x14')]);}else{logger[_0xeecc('0xd')](_0xeecc('0xe'),_0x64eb4e,'request\x20sent');_0x4027bf(_0x515368['result'][_0xeecc('0x14')]);}})[_0xeecc('0x15')](function(_0x4c991a){logger[_0xeecc('0x12')](_0xeecc('0xe'),_0x64eb4e,_0x4c991a);_0x1e61d8(_0x4c991a);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 1a4c20c..2518490 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 _0x42ce=['create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x42ce,0x77));var _0xe42c=function(_0x133156,_0x109b02){_0x133156=_0x133156-0x0;var _0xb6d904=_0x42ce[_0x133156];return _0xb6d904;};'use strict';var multer=require(_0xe42c('0x0'));var util=require(_0xe42c('0x1'));var path=require(_0xe42c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe42c('0x3'));var router=express[_0xe42c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe42c('0x5'));var interaction=require(_0xe42c('0x6'));var config=require(_0xe42c('0x7'));var controller=require('./intVtigerField.controller');router[_0xe42c('0x8')]('/',auth[_0xe42c('0x9')](),controller[_0xe42c('0xa')]);router[_0xe42c('0x8')](_0xe42c('0xb'),auth[_0xe42c('0x9')](),controller[_0xe42c('0xc')]);router[_0xe42c('0xd')]('/',auth[_0xe42c('0x9')](),controller[_0xe42c('0xe')]);router[_0xe42c('0xf')](_0xe42c('0xb'),auth[_0xe42c('0x9')](),controller['update']);router[_0xe42c('0x10')](_0xe42c('0xb'),auth[_0xe42c('0x9')](),controller[_0xe42c('0x11')]);module[_0xe42c('0x12')]=router; \ No newline at end of file +var _0x64b2=['get','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','./intVtigerField.controller','isAuthenticated','index'];(function(_0x363b89,_0x2f2e75){var _0x2ffc54=function(_0x314260){while(--_0x314260){_0x363b89['push'](_0x363b89['shift']());}};_0x2ffc54(++_0x2f2e75);}(_0x64b2,0x129));var _0x264b=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x64b2[_0x5834bc];return _0x3e183a;};'use strict';var multer=require(_0x264b('0x0'));var util=require(_0x264b('0x1'));var path=require(_0x264b('0x2'));var timeout=require(_0x264b('0x3'));var express=require(_0x264b('0x4'));var router=express[_0x264b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x264b('0x6'));router['get']('/',auth[_0x264b('0x7')](),controller[_0x264b('0x8')]);router[_0x264b('0x9')](_0x264b('0xa'),auth[_0x264b('0x7')](),controller['show']);router[_0x264b('0xb')]('/',auth[_0x264b('0x7')](),controller['create']);router[_0x264b('0xc')](_0x264b('0xa'),auth['isAuthenticated'](),controller[_0x264b('0xd')]);router[_0x264b('0xe')](_0x264b('0xa'),auth[_0x264b('0x7')](),controller[_0x264b('0xf')]);module[_0x264b('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 40eee29..a2a4304 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 _0x5547=['keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x4c4a86,_0x2d9f53){var _0x3ece53=function(_0xfed791){while(--_0xfed791){_0x4c4a86['push'](_0x4c4a86['shift']());}};_0x3ece53(++_0x2d9f53);}(_0x5547,0x1ab));var _0x7554=function(_0x3ce4a5,_0x50bc4b){_0x3ce4a5=_0x3ce4a5-0x0;var _0x3f5809=_0x5547[_0x3ce4a5];return _0x3f5809;};'use strict';var Sequelize=require(_0x7554('0x0'));module['exports']={'type':{'type':Sequelize[_0x7554('0x1')](_0x7554('0x2'),_0x7554('0x3'),_0x7554('0x4'),_0x7554('0x5'),_0x7554('0x6')),'defaultValue':_0x7554('0x2')},'content':{'type':Sequelize[_0x7554('0x7')]},'key':{'type':Sequelize[_0x7554('0x7')]},'keyType':{'type':Sequelize[_0x7554('0x1')](_0x7554('0x2'),_0x7554('0x3'),_0x7554('0x4'))},'keyContent':{'type':Sequelize[_0x7554('0x7')]},'idField':{'type':Sequelize[_0x7554('0x7')]},'nameField':{'type':Sequelize[_0x7554('0x7')]},'customField':{'type':Sequelize[_0x7554('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7554('0x7')]}}; \ No newline at end of file +var _0x1bdb=['keyValue','string','STRING','variable','BOOLEAN','exports','ENUM','customVariable'];(function(_0x32c0dc,_0x2d16bb){var _0xbb5fb3=function(_0x1e57a6){while(--_0x1e57a6){_0x32c0dc['push'](_0x32c0dc['shift']());}};_0xbb5fb3(++_0x2d16bb);}(_0x1bdb,0x1dd));var _0xb1bd=function(_0x1e58e5,_0x414034){_0x1e58e5=_0x1e58e5-0x0;var _0x3b7576=_0x1bdb[_0x1e58e5];return _0x3b7576;};'use strict';var Sequelize=require('sequelize');module[_0xb1bd('0x0')]={'type':{'type':Sequelize[_0xb1bd('0x1')]('string','variable',_0xb1bd('0x2'),_0xb1bd('0x3'),'picklist'),'defaultValue':_0xb1bd('0x4')},'content':{'type':Sequelize[_0xb1bd('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb1bd('0x1')](_0xb1bd('0x4'),_0xb1bd('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xb1bd('0x5')]},'idField':{'type':Sequelize[_0xb1bd('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb1bd('0x7')],'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 aca9767..7562aca 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 _0x3a7c=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','VtigerField','includeAll','include','rows','catch','params','rawAttributes','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','fieldName'];(function(_0x1daf09,_0x3e0a2f){var _0x12b53c=function(_0x29faab){while(--_0x29faab){_0x1daf09['push'](_0x1daf09['shift']());}};_0x12b53c(++_0x3e0a2f);}(_0x3a7c,0x6a));var _0xc3a7=function(_0x126f42,_0x57f1ad){_0x126f42=_0x126f42-0x0;var _0x219119=_0x3a7c[_0x126f42];return _0x219119;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3a7('0x0'));var zipdir=require(_0xc3a7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc3a7('0x2'));var moment=require(_0xc3a7('0x3'));var BPromise=require(_0xc3a7('0x4'));var Mustache=require(_0xc3a7('0x5'));var util=require('util');var path=require(_0xc3a7('0x6'));var sox=require(_0xc3a7('0x7'));var csv=require('to-csv');var ejs=require(_0xc3a7('0x8'));var fs=require('fs');var fs_extra=require(_0xc3a7('0x9'));var _=require(_0xc3a7('0xa'));var squel=require(_0xc3a7('0xb'));var crypto=require(_0xc3a7('0xc'));var jsforce=require(_0xc3a7('0xd'));var deskjs=require(_0xc3a7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc3a7('0xf'));var Papa=require(_0xc3a7('0x10'));var Redis=require(_0xc3a7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc3a7('0x12'));var as=require(_0xc3a7('0x13'));var hardwareService=require(_0xc3a7('0x14'));var logger=require(_0xc3a7('0x15'))(_0xc3a7('0x16'));var utils=require(_0xc3a7('0x17'));var config=require(_0xc3a7('0x18'));var licenseUtil=require(_0xc3a7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1896f9,_0x3c0e32){_0x3c0e32=_0x3c0e32||0xcc;return function(_0x3dfad7){if(_0x3dfad7){return _0x1896f9[_0xc3a7('0x1a')](_0x3c0e32);}return _0x1896f9['status'](_0x3c0e32)[_0xc3a7('0x1b')]();};}function respondWithResult(_0x9cce96,_0x51d93e){_0x51d93e=_0x51d93e||0xc8;return function(_0x1adf90){if(_0x1adf90){return _0x9cce96['status'](_0x51d93e)[_0xc3a7('0x1c')](_0x1adf90);}};}function respondWithFilteredResult(_0x40caad,_0x2e7dc6){return function(_0x138d61){if(_0x138d61){var _0x27b00c=typeof _0x2e7dc6[_0xc3a7('0x1d')]===_0xc3a7('0x1e')&&typeof _0x2e7dc6[_0xc3a7('0x1f')]==='undefined';var _0xb9e743=_0x138d61[_0xc3a7('0x20')];var _0xdb8056=_0x27b00c?0x0:_0x2e7dc6['offset'];var _0xedd437=_0x27b00c?_0x138d61[_0xc3a7('0x20')]:_0x2e7dc6[_0xc3a7('0x1d')]+_0x2e7dc6['limit'];var _0x5ec295;if(_0xedd437>=_0xb9e743){_0xedd437=_0xb9e743;_0x5ec295=0xc8;}else{_0x5ec295=0xce;}_0x40caad[_0xc3a7('0x21')](_0x5ec295);return _0x40caad[_0xc3a7('0x22')](_0xc3a7('0x23'),_0xdb8056+'-'+_0xedd437+'/'+_0xb9e743)['json'](_0x138d61);}return null;};}function patchUpdates(_0x10db0){return function(_0x338fe1){try{jsonpatch[_0xc3a7('0x24')](_0x338fe1,_0x10db0,!![]);}catch(_0x3f8f4c){return BPromise[_0xc3a7('0x25')](_0x3f8f4c);}return _0x338fe1['save']();};}function saveUpdates(_0x2c4ac3,_0x290442){return function(_0x48179b){if(_0x48179b){return _0x48179b[_0xc3a7('0x26')](_0x2c4ac3)[_0xc3a7('0x27')](function(_0x40986d){return _0x40986d;});}return null;};}function removeEntity(_0x117222,_0x398c25){return function(_0x1a81ef){if(_0x1a81ef){return _0x1a81ef[_0xc3a7('0x28')]()['then'](function(){_0x117222[_0xc3a7('0x21')](0xcc)[_0xc3a7('0x1b')]();});}};}function handleEntityNotFound(_0x202121,_0x264e40){return function(_0x4831b6){if(!_0x4831b6){_0x202121[_0xc3a7('0x1a')](0x194);}return _0x4831b6;};}function handleError(_0x24fec6,_0xe371a5){_0xe371a5=_0xe371a5||0x1f4;return function(_0x42fbdb){logger[_0xc3a7('0x29')](_0x42fbdb[_0xc3a7('0x2a')]);if(_0x42fbdb['name']){delete _0x42fbdb[_0xc3a7('0x2b')];}_0x24fec6[_0xc3a7('0x21')](_0xe371a5)[_0xc3a7('0x2c')](_0x42fbdb);};}exports[_0xc3a7('0x2d')]=function(_0x34b59f,_0x3487b0){var _0x114d18={},_0x3d9b7e={},_0x2835d7={'count':0x0,'rows':[]};var _0x10750d=_[_0xc3a7('0x2e')](db['VtigerField']['rawAttributes'],function(_0x47b1eb){return{'name':_0x47b1eb[_0xc3a7('0x2f')],'type':_0x47b1eb[_0xc3a7('0x30')][_0xc3a7('0x31')]};});_0x3d9b7e[_0xc3a7('0x32')]=_[_0xc3a7('0x2e')](_0x10750d,_0xc3a7('0x2b'));_0x3d9b7e[_0xc3a7('0x33')]=_[_0xc3a7('0x34')](_0x34b59f[_0xc3a7('0x33')]);_0x3d9b7e[_0xc3a7('0x35')]=_[_0xc3a7('0x36')](_0x3d9b7e['model'],_0x3d9b7e[_0xc3a7('0x33')]);_0x114d18[_0xc3a7('0x37')]=_[_0xc3a7('0x36')](_0x3d9b7e[_0xc3a7('0x32')],qs[_0xc3a7('0x38')](_0x34b59f['query'][_0xc3a7('0x38')]));_0x114d18[_0xc3a7('0x37')]=_0x114d18['attributes'][_0xc3a7('0x39')]?_0x114d18[_0xc3a7('0x37')]:_0x3d9b7e[_0xc3a7('0x32')];if(!_0x34b59f['query'][_0xc3a7('0x3a')]('nolimit')){_0x114d18[_0xc3a7('0x1f')]=qs['limit'](_0x34b59f[_0xc3a7('0x33')][_0xc3a7('0x1f')]);_0x114d18[_0xc3a7('0x1d')]=qs['offset'](_0x34b59f[_0xc3a7('0x33')][_0xc3a7('0x1d')]);}_0x114d18[_0xc3a7('0x3b')]=qs[_0xc3a7('0x3c')](_0x34b59f['query'][_0xc3a7('0x3c')]);_0x114d18['where']=qs['filters'](_[_0xc3a7('0x3d')](_0x34b59f['query'],_0x3d9b7e[_0xc3a7('0x35')]),_0x10750d);if(_0x34b59f['query']['filter']){_0x114d18[_0xc3a7('0x3e')]=_[_0xc3a7('0x3f')](_0x114d18[_0xc3a7('0x3e')],{'$or':_[_0xc3a7('0x2e')](_0x10750d,function(_0x26ecad){if(_0x26ecad[_0xc3a7('0x30')]!==_0xc3a7('0x40')){var _0x46def0={};_0x46def0[_0x26ecad[_0xc3a7('0x2b')]]={'$like':'%'+_0x34b59f[_0xc3a7('0x33')][_0xc3a7('0x41')]+'%'};return _0x46def0;}})});}_0x114d18=_[_0xc3a7('0x3f')]({},_0x114d18,_0x34b59f[_0xc3a7('0x42')]);var _0x34946e={'where':_0x114d18[_0xc3a7('0x3e')]};return db[_0xc3a7('0x43')][_0xc3a7('0x20')](_0x34946e)[_0xc3a7('0x27')](function(_0x1fdd81){_0x2835d7[_0xc3a7('0x20')]=_0x1fdd81;if(_0x34b59f[_0xc3a7('0x33')][_0xc3a7('0x44')]){_0x114d18[_0xc3a7('0x45')]=[{'all':!![]}];}return db[_0xc3a7('0x43')]['findAll'](_0x114d18);})['then'](function(_0x5e62e9){_0x2835d7[_0xc3a7('0x46')]=_0x5e62e9;return _0x2835d7;})[_0xc3a7('0x27')](respondWithFilteredResult(_0x3487b0,_0x114d18))[_0xc3a7('0x47')](handleError(_0x3487b0,null));};exports['show']=function(_0x4e6095,_0x16b37b){var _0x307d73={'raw':!![],'where':{'id':_0x4e6095[_0xc3a7('0x48')]['id']}},_0x2a1743={};_0x2a1743[_0xc3a7('0x32')]=_[_0xc3a7('0x34')](db[_0xc3a7('0x43')][_0xc3a7('0x49')]);_0x2a1743[_0xc3a7('0x33')]=_['keys'](_0x4e6095[_0xc3a7('0x33')]);_0x2a1743['filters']=_[_0xc3a7('0x36')](_0x2a1743[_0xc3a7('0x32')],_0x2a1743['query']);_0x307d73['attributes']=_[_0xc3a7('0x36')](_0x2a1743['model'],qs[_0xc3a7('0x38')](_0x4e6095[_0xc3a7('0x33')][_0xc3a7('0x38')]));_0x307d73['attributes']=_0x307d73['attributes'][_0xc3a7('0x39')]?_0x307d73['attributes']:_0x2a1743[_0xc3a7('0x32')];if(_0x4e6095['query']['includeAll']){_0x307d73[_0xc3a7('0x45')]=[{'all':!![]}];}_0x307d73=_[_0xc3a7('0x3f')]({},_0x307d73,_0x4e6095[_0xc3a7('0x42')]);return db[_0xc3a7('0x43')]['find'](_0x307d73)[_0xc3a7('0x27')](handleEntityNotFound(_0x16b37b,null))[_0xc3a7('0x27')](respondWithResult(_0x16b37b,null))['catch'](handleError(_0x16b37b,null));};exports['create']=function(_0x276595,_0x535229){return db[_0xc3a7('0x43')][_0xc3a7('0x4a')](_0x276595[_0xc3a7('0x4b')],{})[_0xc3a7('0x27')](respondWithResult(_0x535229,0xc9))['catch'](handleError(_0x535229,null));};exports['update']=function(_0x3a1ca8,_0xeac996){if(_0x3a1ca8['body']['id']){delete _0x3a1ca8[_0xc3a7('0x4b')]['id'];}return db[_0xc3a7('0x43')][_0xc3a7('0x4c')]({'where':{'id':_0x3a1ca8['params']['id']}})['then'](handleEntityNotFound(_0xeac996,null))[_0xc3a7('0x27')](saveUpdates(_0x3a1ca8['body'],null))[_0xc3a7('0x27')](respondWithResult(_0xeac996,null))[_0xc3a7('0x47')](handleError(_0xeac996,null));};exports[_0xc3a7('0x28')]=function(_0x3c68e9,_0x117e6d){return db[_0xc3a7('0x43')][_0xc3a7('0x4c')]({'where':{'id':_0x3c68e9['params']['id']}})[_0xc3a7('0x27')](handleEntityNotFound(_0x117e6d,null))[_0xc3a7('0x27')](removeEntity(_0x117e6d,null))['catch'](handleError(_0x117e6d,null));}; \ No newline at end of file +var _0x4b27=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','VtigerField','type','map','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b27,0x19f));var _0x74b2=function(_0x351a39,_0x42326c){_0x351a39=_0x351a39-0x0;var _0x255618=_0x4b27[_0x351a39];return _0x255618;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74b2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74b2('0x1'));var rp=require(_0x74b2('0x2'));var moment=require(_0x74b2('0x3'));var BPromise=require(_0x74b2('0x4'));var Mustache=require(_0x74b2('0x5'));var util=require(_0x74b2('0x6'));var path=require(_0x74b2('0x7'));var sox=require('sox');var csv=require(_0x74b2('0x8'));var ejs=require(_0x74b2('0x9'));var fs=require('fs');var fs_extra=require(_0x74b2('0xa'));var _=require(_0x74b2('0xb'));var squel=require(_0x74b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x74b2('0xd'));var deskjs=require(_0x74b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x74b2('0xf'));var Papa=require(_0x74b2('0x10'));var Redis=require('ioredis');var authService=require(_0x74b2('0x11'));var qs=require(_0x74b2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x74b2('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x74b2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554cda,_0x4476c3){_0x4476c3=_0x4476c3||0xcc;return function(_0x5909c0){if(_0x5909c0){return _0x554cda[_0x74b2('0x15')](_0x4476c3);}return _0x554cda['status'](_0x4476c3)[_0x74b2('0x16')]();};}function respondWithResult(_0xb80845,_0x1e450b){_0x1e450b=_0x1e450b||0xc8;return function(_0x397be7){if(_0x397be7){return _0xb80845[_0x74b2('0x17')](_0x1e450b)[_0x74b2('0x18')](_0x397be7);}};}function respondWithFilteredResult(_0x160393,_0x21864a){return function(_0x285430){if(_0x285430){var _0x35ebbf=typeof _0x21864a['offset']==='undefined'&&typeof _0x21864a[_0x74b2('0x19')]===_0x74b2('0x1a');var _0x3368c2=_0x285430[_0x74b2('0x1b')];var _0x14879f=_0x35ebbf?0x0:_0x21864a[_0x74b2('0x1c')];var _0x3f1ad4=_0x35ebbf?_0x285430['count']:_0x21864a['offset']+_0x21864a[_0x74b2('0x19')];var _0x3be14c;if(_0x3f1ad4>=_0x3368c2){_0x3f1ad4=_0x3368c2;_0x3be14c=0xc8;}else{_0x3be14c=0xce;}_0x160393['status'](_0x3be14c);return _0x160393[_0x74b2('0x1d')](_0x74b2('0x1e'),_0x14879f+'-'+_0x3f1ad4+'/'+_0x3368c2)['json'](_0x285430);}return null;};}function patchUpdates(_0x25dfc6){return function(_0xaf0734){try{jsonpatch[_0x74b2('0x1f')](_0xaf0734,_0x25dfc6,!![]);}catch(_0x59ec95){return BPromise[_0x74b2('0x20')](_0x59ec95);}return _0xaf0734['save']();};}function saveUpdates(_0x3d85d9,_0x544953){return function(_0x3fb96d){if(_0x3fb96d){return _0x3fb96d[_0x74b2('0x21')](_0x3d85d9)[_0x74b2('0x22')](function(_0xa8bf4b){return _0xa8bf4b;});}return null;};}function removeEntity(_0x24deea,_0x2e9c25){return function(_0x4479cc){if(_0x4479cc){return _0x4479cc[_0x74b2('0x23')]()[_0x74b2('0x22')](function(){_0x24deea['status'](0xcc)[_0x74b2('0x16')]();});}};}function handleEntityNotFound(_0x370ac9,_0xbdcc94){return function(_0x5ec93a){if(!_0x5ec93a){_0x370ac9[_0x74b2('0x15')](0x194);}return _0x5ec93a;};}function handleError(_0x39a21f,_0x80be03){_0x80be03=_0x80be03||0x1f4;return function(_0x333491){logger[_0x74b2('0x24')](_0x333491[_0x74b2('0x25')]);if(_0x333491[_0x74b2('0x26')]){delete _0x333491['name'];}_0x39a21f['status'](_0x80be03)['send'](_0x333491);};}exports[_0x74b2('0x27')]=function(_0x27250a,_0x4feaf4){var _0x344587={},_0x1b611e={},_0x2fa322={'count':0x0,'rows':[]};var _0x39bda7=_['map'](db[_0x74b2('0x28')]['rawAttributes'],function(_0x3232fa){return{'name':_0x3232fa['fieldName'],'type':_0x3232fa[_0x74b2('0x29')]['key']};});_0x1b611e['model']=_[_0x74b2('0x2a')](_0x39bda7,'name');_0x1b611e[_0x74b2('0x2b')]=_[_0x74b2('0x2c')](_0x27250a['query']);_0x1b611e[_0x74b2('0x2d')]=_['intersection'](_0x1b611e[_0x74b2('0x2e')],_0x1b611e[_0x74b2('0x2b')]);_0x344587['attributes']=_[_0x74b2('0x2f')](_0x1b611e[_0x74b2('0x2e')],qs[_0x74b2('0x30')](_0x27250a['query'][_0x74b2('0x30')]));_0x344587['attributes']=_0x344587[_0x74b2('0x31')]['length']?_0x344587['attributes']:_0x1b611e['model'];if(!_0x27250a[_0x74b2('0x2b')][_0x74b2('0x32')](_0x74b2('0x33'))){_0x344587[_0x74b2('0x19')]=qs[_0x74b2('0x19')](_0x27250a[_0x74b2('0x2b')][_0x74b2('0x19')]);_0x344587[_0x74b2('0x1c')]=qs[_0x74b2('0x1c')](_0x27250a[_0x74b2('0x2b')][_0x74b2('0x1c')]);}_0x344587['order']=qs[_0x74b2('0x34')](_0x27250a['query']['sort']);_0x344587['where']=qs[_0x74b2('0x2d')](_['pick'](_0x27250a['query'],_0x1b611e['filters']),_0x39bda7);if(_0x27250a[_0x74b2('0x2b')][_0x74b2('0x35')]){_0x344587[_0x74b2('0x36')]=_['merge'](_0x344587[_0x74b2('0x36')],{'$or':_[_0x74b2('0x2a')](_0x39bda7,function(_0x4d81cd){if(_0x4d81cd[_0x74b2('0x29')]!==_0x74b2('0x37')){var _0x285545={};_0x285545[_0x4d81cd['name']]={'$like':'%'+_0x27250a[_0x74b2('0x2b')][_0x74b2('0x35')]+'%'};return _0x285545;}})});}_0x344587=_[_0x74b2('0x38')]({},_0x344587,_0x27250a[_0x74b2('0x39')]);var _0x480f75={'where':_0x344587['where']};return db[_0x74b2('0x28')][_0x74b2('0x1b')](_0x480f75)[_0x74b2('0x22')](function(_0x3988d6){_0x2fa322[_0x74b2('0x1b')]=_0x3988d6;if(_0x27250a['query'][_0x74b2('0x3a')]){_0x344587[_0x74b2('0x3b')]=[{'all':!![]}];}return db[_0x74b2('0x28')][_0x74b2('0x3c')](_0x344587);})[_0x74b2('0x22')](function(_0x150358){_0x2fa322[_0x74b2('0x3d')]=_0x150358;return _0x2fa322;})[_0x74b2('0x22')](respondWithFilteredResult(_0x4feaf4,_0x344587))[_0x74b2('0x3e')](handleError(_0x4feaf4,null));};exports[_0x74b2('0x3f')]=function(_0xf4e60b,_0x592636){var _0x2fe4af={'raw':!![],'where':{'id':_0xf4e60b[_0x74b2('0x40')]['id']}},_0x82d1fb={};_0x82d1fb[_0x74b2('0x2e')]=_['keys'](db[_0x74b2('0x28')][_0x74b2('0x41')]);_0x82d1fb[_0x74b2('0x2b')]=_[_0x74b2('0x2c')](_0xf4e60b['query']);_0x82d1fb[_0x74b2('0x2d')]=_[_0x74b2('0x2f')](_0x82d1fb[_0x74b2('0x2e')],_0x82d1fb[_0x74b2('0x2b')]);_0x2fe4af[_0x74b2('0x31')]=_[_0x74b2('0x2f')](_0x82d1fb['model'],qs['fields'](_0xf4e60b['query'][_0x74b2('0x30')]));_0x2fe4af[_0x74b2('0x31')]=_0x2fe4af[_0x74b2('0x31')][_0x74b2('0x42')]?_0x2fe4af[_0x74b2('0x31')]:_0x82d1fb[_0x74b2('0x2e')];if(_0xf4e60b['query']['includeAll']){_0x2fe4af['include']=[{'all':!![]}];}_0x2fe4af=_[_0x74b2('0x38')]({},_0x2fe4af,_0xf4e60b[_0x74b2('0x39')]);return db[_0x74b2('0x28')][_0x74b2('0x43')](_0x2fe4af)['then'](handleEntityNotFound(_0x592636,null))['then'](respondWithResult(_0x592636,null))[_0x74b2('0x3e')](handleError(_0x592636,null));};exports[_0x74b2('0x44')]=function(_0x529a86,_0x52204f){return db[_0x74b2('0x28')][_0x74b2('0x44')](_0x529a86[_0x74b2('0x45')],{})[_0x74b2('0x22')](respondWithResult(_0x52204f,0xc9))['catch'](handleError(_0x52204f,null));};exports[_0x74b2('0x21')]=function(_0x1a599f,_0x56bd81){if(_0x1a599f[_0x74b2('0x45')]['id']){delete _0x1a599f[_0x74b2('0x45')]['id'];}return db[_0x74b2('0x28')]['find']({'where':{'id':_0x1a599f['params']['id']}})[_0x74b2('0x22')](handleEntityNotFound(_0x56bd81,null))['then'](saveUpdates(_0x1a599f[_0x74b2('0x45')],null))['then'](respondWithResult(_0x56bd81,null))[_0x74b2('0x3e')](handleError(_0x56bd81,null));};exports['destroy']=function(_0x289911,_0x13083c){return db[_0x74b2('0x28')]['find']({'where':{'id':_0x289911[_0x74b2('0x40')]['id']}})[_0x74b2('0x22')](handleEntityNotFound(_0x13083c,null))[_0x74b2('0x22')](removeEntity(_0x13083c,null))[_0x74b2('0x3e')](handleError(_0x13083c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 6406b87..7d966f7 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 _0x1d56=['exports','vtiger_unique_index','idField','FieldId','util','moment','path','../../config/environment','./intVtigerField.attributes'];(function(_0x94cefc,_0x601961){var _0x2b62cd=function(_0x2a0a30){while(--_0x2a0a30){_0x94cefc['push'](_0x94cefc['shift']());}};_0x2b62cd(++_0x601961);}(_0x1d56,0x163));var _0x61d5=function(_0x2bc454,_0x2b1ad5){_0x2bc454=_0x2bc454-0x0;var _0x4d6a07=_0x1d56[_0x2bc454];return _0x4d6a07;};'use strict';var _=require('lodash');var util=require(_0x61d5('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x61d5('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x61d5('0x2'));var rimraf=require('rimraf');var config=require(_0x61d5('0x3'));var attributes=require(_0x61d5('0x4'));module[_0x61d5('0x5')]=function(_0x8947fd,_0x3cb431){return _0x8947fd['define']('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x61d5('0x6'),'fields':[_0x61d5('0x7'),_0x61d5('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x673e=['rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','util','api','bluebird','request-promise','path'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x673e,0x1d7));var _0xe673=function(_0x55c479,_0x3459e0){_0x55c479=_0x55c479-0x0;var _0x617df5=_0x673e[_0x55c479];return _0x617df5;};'use strict';var _=require('lodash');var util=require(_0xe673('0x0'));var logger=require('../../config/logger')(_0xe673('0x1'));var moment=require('moment');var BPromise=require(_0xe673('0x2'));var rp=require(_0xe673('0x3'));var fs=require('fs');var path=require(_0xe673('0x4'));var rimraf=require(_0xe673('0x5'));var config=require(_0xe673('0x6'));var attributes=require(_0xe673('0x7'));module[_0xe673('0x8')]=function(_0xc2caa0,_0x51379f){return _0xc2caa0[_0xe673('0x9')](_0xe673('0xa'),attributes,{'tableName':_0xe673('0xb'),'paranoid':![],'indexes':[{'name':_0xe673('0xc'),'fields':['idField',_0xe673('0xd')],'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 3cc8f31..685f58f 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 _0x27ba=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','debug','stringify','error','VtigerField,\x20%s,\x20%s','message','result','catch','util'];(function(_0x57265d,_0x31fa8b){var _0x1c4476=function(_0x3261a9){while(--_0x3261a9){_0x57265d['push'](_0x57265d['shift']());}};_0x1c4476(++_0x31fa8b);}(_0x27ba,0x1c7));var _0xa27b=function(_0x566500,_0x4e665a){_0x566500=_0x566500-0x0;var _0xb1aba7=_0x27ba[_0x566500];return _0xb1aba7;};'use strict';var _=require('lodash');var util=require(_0xa27b('0x0'));var moment=require('moment');var BPromise=require(_0xa27b('0x1'));var rs=require(_0xa27b('0x2'));var fs=require('fs');var Redis=require(_0xa27b('0x3'));var db=require(_0xa27b('0x4'))['db'];var utils=require(_0xa27b('0x5'));var logger=require(_0xa27b('0x6'))('rpc');var config=require(_0xa27b('0x7'));var jayson=require(_0xa27b('0x8'));var client=jayson['client'][_0xa27b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d1ee9,_0x3be3b4,_0x37634b){return new BPromise(function(_0x549ce7,_0x40d81b){return client['request'](_0x1d1ee9,_0x37634b)['then'](function(_0x4f3e1f){logger[_0xa27b('0xa')]('VtigerField,\x20%s,\x20%s',_0x3be3b4,_0xa27b('0xb'));logger[_0xa27b('0xc')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x3be3b4,_0xa27b('0xb'),JSON[_0xa27b('0xd')](_0x4f3e1f));if(_0x4f3e1f[_0xa27b('0xe')]){if(_0x4f3e1f[_0xa27b('0xe')]['code']===0x1f4){logger[_0xa27b('0xe')](_0xa27b('0xf'),_0x3be3b4,_0x4f3e1f[_0xa27b('0xe')]['message']);return _0x40d81b(_0x4f3e1f[_0xa27b('0xe')][_0xa27b('0x10')]);}logger[_0xa27b('0xe')](_0xa27b('0xf'),_0x3be3b4,_0x4f3e1f['error'][_0xa27b('0x10')]);return _0x549ce7(_0x4f3e1f[_0xa27b('0xe')][_0xa27b('0x10')]);}else{logger[_0xa27b('0xa')](_0xa27b('0xf'),_0x3be3b4,'request\x20sent');_0x549ce7(_0x4f3e1f[_0xa27b('0x11')][_0xa27b('0x10')]);}})[_0xa27b('0x12')](function(_0x2bc083){logger[_0xa27b('0xe')](_0xa27b('0xf'),_0x3be3b4,_0x2bc083);_0x40d81b(_0x2bc083);});});} \ No newline at end of file +var _0x9cb4=['client','request','then','info','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4d9c78,_0x112034){var _0x555bea=function(_0x247b8b){while(--_0x247b8b){_0x4d9c78['push'](_0x4d9c78['shift']());}};_0x555bea(++_0x112034);}(_0x9cb4,0xe7));var _0x49cb=function(_0x1c619b,_0x1e367f){_0x1c619b=_0x1c619b-0x0;var _0x111f0c=_0x9cb4[_0x1c619b];return _0x111f0c;};'use strict';var _=require(_0x49cb('0x0'));var util=require(_0x49cb('0x1'));var moment=require('moment');var BPromise=require(_0x49cb('0x2'));var rs=require(_0x49cb('0x3'));var fs=require('fs');var Redis=require(_0x49cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x49cb('0x5'))(_0x49cb('0x6'));var config=require(_0x49cb('0x7'));var jayson=require(_0x49cb('0x8'));var client=jayson[_0x49cb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3de180,_0x432782,_0x26c144){return new BPromise(function(_0x4b3c4c,_0x40f359){return client[_0x49cb('0xa')](_0x3de180,_0x26c144)[_0x49cb('0xb')](function(_0x3b1bec){logger[_0x49cb('0xc')]('VtigerField,\x20%s,\x20%s',_0x432782,'request\x20sent');logger['debug'](_0x49cb('0xd'),_0x432782,_0x49cb('0xe'),JSON['stringify'](_0x3b1bec));if(_0x3b1bec[_0x49cb('0xf')]){if(_0x3b1bec[_0x49cb('0xf')]['code']===0x1f4){logger['error'](_0x49cb('0x10'),_0x432782,_0x3b1bec[_0x49cb('0xf')][_0x49cb('0x11')]);return _0x40f359(_0x3b1bec[_0x49cb('0xf')][_0x49cb('0x11')]);}logger[_0x49cb('0xf')](_0x49cb('0x10'),_0x432782,_0x3b1bec[_0x49cb('0xf')][_0x49cb('0x11')]);return _0x4b3c4c(_0x3b1bec[_0x49cb('0xf')][_0x49cb('0x11')]);}else{logger[_0x49cb('0xc')](_0x49cb('0x10'),_0x432782,_0x49cb('0xe'));_0x4b3c4c(_0x3b1bec[_0x49cb('0x12')][_0x49cb('0x11')]);}})[_0x49cb('0x13')](function(_0x54725a){logger[_0x49cb('0xf')](_0x49cb('0x10'),_0x432782,_0x54725a);_0x40f359(_0x54725a);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 8d4635c..df710a4 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 _0x05e8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','index','/:id','show','get','isAuthenticated','getConfigurations','create','post','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x05e8,0x1aa));var _0x805e=function(_0x3e496d,_0x134a3a){_0x3e496d=_0x3e496d-0x0;var _0x4aeada=_0x05e8[_0x3e496d];return _0x4aeada;};'use strict';var multer=require(_0x805e('0x0'));var util=require('util');var path=require(_0x805e('0x1'));var timeout=require(_0x805e('0x2'));var express=require(_0x805e('0x3'));var router=express[_0x805e('0x4')]();var fs_extra=require(_0x805e('0x5'));var auth=require(_0x805e('0x6'));var interaction=require(_0x805e('0x7'));var config=require(_0x805e('0x8'));var controller=require(_0x805e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x805e('0xa')]);router['get'](_0x805e('0xb'),auth['isAuthenticated'](),controller[_0x805e('0xc')]);router[_0x805e('0xd')]('/:id/configurations',auth[_0x805e('0xe')](),controller[_0x805e('0xf')]);router['get']('/:id/fields',auth[_0x805e('0xe')](),controller['getFields']);router['post']('/',auth[_0x805e('0xe')](),controller[_0x805e('0x10')]);router[_0x805e('0x11')](_0x805e('0x12'),auth['isAuthenticated'](),controller[_0x805e('0x13')]);router['put']('/:id',auth[_0x805e('0xe')](),controller[_0x805e('0x14')]);router[_0x805e('0x15')](_0x805e('0xb'),auth[_0x805e('0xe')](),controller[_0x805e('0x16')]);module[_0x805e('0x17')]=router; \ No newline at end of file +var _0xa2c5=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x54d46c,_0x18a0b7){var _0x1f0cae=function(_0x4e70b2){while(--_0x4e70b2){_0x54d46c['push'](_0x54d46c['shift']());}};_0x1f0cae(++_0x18a0b7);}(_0xa2c5,0x10c));var _0x5a2c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa2c5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5a2c('0x0'));var util=require(_0x5a2c('0x1'));var path=require(_0x5a2c('0x2'));var timeout=require('connect-timeout');var express=require(_0x5a2c('0x3'));var router=express[_0x5a2c('0x4')]();var fs_extra=require(_0x5a2c('0x5'));var auth=require(_0x5a2c('0x6'));var interaction=require(_0x5a2c('0x7'));var config=require(_0x5a2c('0x8'));var controller=require(_0x5a2c('0x9'));router[_0x5a2c('0xa')]('/',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0xc')]);router['get']('/:id',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0xd')]);router[_0x5a2c('0xa')](_0x5a2c('0xe'),auth[_0x5a2c('0xb')](),controller[_0x5a2c('0xf')]);router[_0x5a2c('0xa')](_0x5a2c('0x10'),auth[_0x5a2c('0xb')](),controller['getFields']);router[_0x5a2c('0x11')]('/',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0x12')]);router[_0x5a2c('0x11')]('/:id/configurations',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0x13')]);router[_0x5a2c('0x14')]('/:id',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0x15')]);router[_0x5a2c('0x16')]('/:id',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0x17')]);module[_0x5a2c('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 6551073..b45d789 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 _0xde81=['integrationTab','sequelize','exports','STRING','username','ENUM','password','token'];(function(_0x4f8e06,_0x3226b1){var _0x327dad=function(_0x4dced3){while(--_0x4dced3){_0x4f8e06['push'](_0x4f8e06['shift']());}};_0x327dad(++_0x3226b1);}(_0xde81,0x109));var _0x1de8=function(_0x222612,_0x57b680){_0x222612=_0x222612-0x0;var _0x576df2=_0xde81[_0x222612];return _0x576df2;};'use strict';var Sequelize=require(_0x1de8('0x0'));module[_0x1de8('0x1')]={'name':{'type':Sequelize[_0x1de8('0x2')]},'description':{'type':Sequelize[_0x1de8('0x2')]},'username':{'type':Sequelize[_0x1de8('0x2')],'unique':_0x1de8('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1de8('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x1de8('0x4')](_0x1de8('0x5'),_0x1de8('0x6')),'defaultValue':_0x1de8('0x5')},'serverUrl':{'type':Sequelize[_0x1de8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1de8('0x4')](_0x1de8('0x7'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x187d=['password','integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM','token'];(function(_0x273f7f,_0x153b7c){var _0x51eb0e=function(_0x115b2f){while(--_0x115b2f){_0x273f7f['push'](_0x273f7f['shift']());}};_0x51eb0e(++_0x153b7c);}(_0x187d,0x93));var _0xd187=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x187d[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xd187('0x0'));module['exports']={'name':{'type':Sequelize[_0xd187('0x1')]},'description':{'type':Sequelize[_0xd187('0x1')]},'username':{'type':Sequelize[_0xd187('0x1')],'unique':_0xd187('0x2')},'password':{'type':Sequelize[_0xd187('0x1')]},'token':{'type':Sequelize[_0xd187('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd187('0x3')},'authType':{'type':Sequelize[_0xd187('0x4')]('password',_0xd187('0x5')),'defaultValue':_0xd187('0x6')},'serverUrl':{'type':Sequelize[_0xd187('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd187('0x4')](_0xd187('0x7'),_0xd187('0x8')),'defaultValue':_0xd187('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index dc2a530..2e65360 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 _0x351d=['Subjects','Descriptions','getFields','password','token','remoteUri','slice','substring','lastIndexOf','format','%s/%s','authType','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','ticket_fields','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','status','end','json','undefined','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','stack','index','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','catch','params','include','find','create','body','update','findOne','ZendeskConfiguration','order','sort','getConfigurations','addConfiguration','AccountId','getSubjects','getDescriptions','channel','ZendeskField'];(function(_0x31cd31,_0x4480e1){var _0x2db328=function(_0x54f954){while(--_0x54f954){_0x31cd31['push'](_0x31cd31['shift']());}};_0x2db328(++_0x4480e1);}(_0x351d,0x90));var _0xd351=function(_0x4a58f2,_0x4483c2){_0x4a58f2=_0x4a58f2-0x0;var _0x5ef971=_0x351d[_0x4a58f2];return _0x5ef971;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd351('0x13'));function respondWithStatusCode(_0x15549a,_0x23445f){_0x23445f=_0x23445f||0xcc;return function(_0x1eb2a9){if(_0x1eb2a9){return _0x15549a['sendStatus'](_0x23445f);}return _0x15549a[_0xd351('0x14')](_0x23445f)[_0xd351('0x15')]();};}function respondWithResult(_0x597d7c,_0xc5a145){_0xc5a145=_0xc5a145||0xc8;return function(_0xb106ef){if(_0xb106ef){return _0x597d7c[_0xd351('0x14')](_0xc5a145)[_0xd351('0x16')](_0xb106ef);}};}function respondWithFilteredResult(_0x3867fb,_0x4d238c){return function(_0x9f790f){if(_0x9f790f){var _0x49d8bb=typeof _0x4d238c['offset']===_0xd351('0x17')&&typeof _0x4d238c['limit']===_0xd351('0x17');var _0x1de35f=_0x9f790f[_0xd351('0x18')];var _0x4c6693=_0x49d8bb?0x0:_0x4d238c[_0xd351('0x19')];var _0x2bfc53=_0x49d8bb?_0x9f790f[_0xd351('0x18')]:_0x4d238c[_0xd351('0x19')]+_0x4d238c['limit'];var _0xc2d2c0;if(_0x2bfc53>=_0x1de35f){_0x2bfc53=_0x1de35f;_0xc2d2c0=0xc8;}else{_0xc2d2c0=0xce;}_0x3867fb['status'](_0xc2d2c0);return _0x3867fb['set'](_0xd351('0x1a'),_0x4c6693+'-'+_0x2bfc53+'/'+_0x1de35f)['json'](_0x9f790f);}return null;};}function patchUpdates(_0x33b1e5){return function(_0x2d75dd){try{jsonpatch[_0xd351('0x1b')](_0x2d75dd,_0x33b1e5,!![]);}catch(_0x42631b){return BPromise[_0xd351('0x1c')](_0x42631b);}return _0x2d75dd['save']();};}function saveUpdates(_0x18625b,_0xbbc58){return function(_0x241265){if(_0x241265){return _0x241265['update'](_0x18625b)[_0xd351('0x1d')](function(_0x2d9aa0){return _0x2d9aa0;});}return null;};}function removeEntity(_0x365bbc,_0x59fb6d){return function(_0x1ce279){if(_0x1ce279){return _0x1ce279[_0xd351('0x1e')]()[_0xd351('0x1d')](function(){_0x365bbc[_0xd351('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f7f3,_0x483c92){return function(_0x358bff){if(!_0x358bff){_0x40f7f3[_0xd351('0x1f')](0x194);}return _0x358bff;};}function handleError(_0x54f471,_0x2648d0){_0x2648d0=_0x2648d0||0x1f4;return function(_0x55b4d3){logger['error'](_0x55b4d3[_0xd351('0x20')]);if(_0x55b4d3['name']){delete _0x55b4d3['name'];}_0x54f471[_0xd351('0x14')](_0x2648d0)['send'](_0x55b4d3);};}exports[_0xd351('0x21')]=function(_0x2ddae8,_0x407b50){var _0x4d3f48={},_0x71ce9c={},_0x4aa902={'count':0x0,'rows':[]};var _0x1c826b=_['map'](db['ZendeskAccount'][_0xd351('0x22')],function(_0x38c82f){return{'name':_0x38c82f[_0xd351('0x23')],'type':_0x38c82f[_0xd351('0x24')]['key']};});_0x71ce9c[_0xd351('0x25')]=_[_0xd351('0x26')](_0x1c826b,_0xd351('0x27'));_0x71ce9c[_0xd351('0x28')]=_[_0xd351('0x29')](_0x2ddae8[_0xd351('0x28')]);_0x71ce9c[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],_0x71ce9c['query']);_0x4d3f48[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x2ddae8['query'][_0xd351('0x2d')]));_0x4d3f48[_0xd351('0x2c')]=_0x4d3f48[_0xd351('0x2c')][_0xd351('0x2e')]?_0x4d3f48[_0xd351('0x2c')]:_0x71ce9c[_0xd351('0x25')];if(!_0x2ddae8[_0xd351('0x28')][_0xd351('0x2f')](_0xd351('0x30'))){_0x4d3f48['limit']=qs['limit'](_0x2ddae8[_0xd351('0x28')][_0xd351('0x31')]);_0x4d3f48[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x2ddae8[_0xd351('0x28')][_0xd351('0x19')]);}_0x4d3f48['order']=qs['sort'](_0x2ddae8[_0xd351('0x28')]['sort']);_0x4d3f48[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x2ddae8[_0xd351('0x28')],_0x71ce9c[_0xd351('0x2a')]),_0x1c826b);if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]){_0x4d3f48[_0xd351('0x32')]=_[_0xd351('0x35')](_0x4d3f48[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x1c826b,function(_0x4b15db){if(_0x4b15db[_0xd351('0x24')]!=='VIRTUAL'){var _0x22631={};_0x22631[_0x4b15db[_0xd351('0x27')]]={'$like':'%'+_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]+'%'};return _0x22631;}})});}_0x4d3f48=_[_0xd351('0x35')]({},_0x4d3f48,_0x2ddae8[_0xd351('0x36')]);var _0x545bfc={'where':_0x4d3f48[_0xd351('0x32')]};return db[_0xd351('0x37')]['count'](_0x545bfc)[_0xd351('0x1d')](function(_0x2d8ea8){_0x4aa902[_0xd351('0x18')]=_0x2d8ea8;if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x38')]){_0x4d3f48['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xd351('0x39')](_0x4d3f48);})[_0xd351('0x1d')](function(_0x5dae6d){_0x4aa902['rows']=_0x5dae6d;return _0x4aa902;})[_0xd351('0x1d')](respondWithFilteredResult(_0x407b50,_0x4d3f48))[_0xd351('0x3a')](handleError(_0x407b50,null));};exports['show']=function(_0x570d57,_0x46af23){var _0x18f9d1={'raw':![],'where':{'id':_0x570d57[_0xd351('0x3b')]['id']}},_0x3b8526={};_0x3b8526[_0xd351('0x25')]=_[_0xd351('0x29')](db[_0xd351('0x37')][_0xd351('0x22')]);_0x3b8526[_0xd351('0x28')]=_['keys'](_0x570d57['query']);_0x3b8526[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],_0x3b8526[_0xd351('0x28')]);_0x18f9d1[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x570d57[_0xd351('0x28')][_0xd351('0x2d')]));_0x18f9d1[_0xd351('0x2c')]=_0x18f9d1[_0xd351('0x2c')][_0xd351('0x2e')]?_0x18f9d1[_0xd351('0x2c')]:_0x3b8526[_0xd351('0x25')];if(_0x570d57[_0xd351('0x28')]['includeAll']){_0x18f9d1[_0xd351('0x3c')]=[{'all':!![]}];}_0x18f9d1=_[_0xd351('0x35')]({},_0x18f9d1,_0x570d57[_0xd351('0x36')]);return db['ZendeskAccount'][_0xd351('0x3d')](_0x18f9d1)[_0xd351('0x1d')](handleEntityNotFound(_0x46af23,null))[_0xd351('0x1d')](respondWithResult(_0x46af23,null))[_0xd351('0x3a')](handleError(_0x46af23,null));};exports[_0xd351('0x3e')]=function(_0x5bc86a,_0x5adea4){return db['ZendeskAccount'][_0xd351('0x3e')](_0x5bc86a[_0xd351('0x3f')],{})['then'](respondWithResult(_0x5adea4,0xc9))['catch'](handleError(_0x5adea4,null));};exports[_0xd351('0x40')]=function(_0x444206,_0x2af877){if(_0x444206['body']['id']){delete _0x444206[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')]['find']({'where':{'id':_0x444206[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2af877,null))[_0xd351('0x1d')](saveUpdates(_0x444206[_0xd351('0x3f')],null))['then'](respondWithResult(_0x2af877,null))['catch'](handleError(_0x2af877,null));};exports[_0xd351('0x1e')]=function(_0x58ce5a,_0xf9f375){return db[_0xd351('0x37')][_0xd351('0x3d')]({'where':{'id':_0x58ce5a['params']['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0xf9f375,null))['then'](removeEntity(_0xf9f375,null))['catch'](handleError(_0xf9f375,null));};exports['getConfigurations']=function(_0x7e4bad,_0x292af3,_0x334029){var _0x5a2e9b={};var _0x554e3a={};var _0x1748f0;var _0x42f248;return db['ZendeskAccount'][_0xd351('0x41')]({'where':{'id':_0x7e4bad[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x292af3,null))[_0xd351('0x1d')](function(_0x59ab0f){if(_0x59ab0f){_0x1748f0=_0x59ab0f;_0x554e3a[_0xd351('0x25')]=_['keys'](db[_0xd351('0x42')][_0xd351('0x22')]);_0x554e3a[_0xd351('0x28')]=_[_0xd351('0x29')](_0x7e4bad[_0xd351('0x28')]);_0x554e3a[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x554e3a['model'],_0x554e3a['query']);_0x5a2e9b[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x554e3a['model'],qs[_0xd351('0x2d')](_0x7e4bad[_0xd351('0x28')][_0xd351('0x2d')]));_0x5a2e9b['attributes']=_0x5a2e9b[_0xd351('0x2c')]['length']?_0x5a2e9b['attributes']:_0x554e3a[_0xd351('0x25')];_0x5a2e9b[_0xd351('0x43')]=qs['sort'](_0x7e4bad[_0xd351('0x28')][_0xd351('0x44')]);_0x5a2e9b[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x7e4bad[_0xd351('0x28')],_0x554e3a['filters']));if(_0x7e4bad[_0xd351('0x28')][_0xd351('0x34')]){_0x5a2e9b[_0xd351('0x32')]=_[_0xd351('0x35')](_0x5a2e9b[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x5a2e9b[_0xd351('0x2c')],function(_0x4b2029){var _0x24dcdb={};_0x24dcdb[_0x4b2029]={'$like':'%'+_0x7e4bad['query'][_0xd351('0x34')]+'%'};return _0x24dcdb;})});}_0x5a2e9b=_[_0xd351('0x35')]({},_0x5a2e9b,_0x7e4bad[_0xd351('0x36')]);return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x4eaf18){if(_0x4eaf18){_0x42f248=_0x4eaf18[_0xd351('0x2e')];if(!_0x7e4bad['query'][_0xd351('0x2f')](_0xd351('0x30'))){_0x5a2e9b[_0xd351('0x31')]=qs[_0xd351('0x31')](_0x7e4bad[_0xd351('0x28')]['limit']);_0x5a2e9b['offset']=qs[_0xd351('0x19')](_0x7e4bad[_0xd351('0x28')]['offset']);}return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x2718e9){if(_0x2718e9){return _0x2718e9?{'count':_0x42f248,'rows':_0x2718e9}:null;}})['then'](respondWithResult(_0x292af3,null))[_0xd351('0x3a')](handleError(_0x292af3,null));};exports[_0xd351('0x46')]=function(_0x284d12,_0x5dbdef,_0x5d13ec){if(_0x284d12['body']['id']){delete _0x284d12[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x284d12[_0xd351('0x3b')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x5dbdef,null))[_0xd351('0x1d')](function(_0x2c83fe){if(_0x2c83fe){_0x284d12['body'][_0xd351('0x47')]=_0x2c83fe['id'];_0x284d12['body']['Subjects']=integrations[_0xd351('0x48')](_0x284d12[_0xd351('0x3f')]['channel'],_0x284d12[_0xd351('0x3f')]['type']);_0x284d12['body']['Descriptions']=integrations[_0xd351('0x49')](_0x284d12[_0xd351('0x3f')][_0xd351('0x4a')],_0x284d12['body'][_0xd351('0x24')]);return db[_0xd351('0x42')][_0xd351('0x3e')](_0x284d12[_0xd351('0x3f')],{'include':[{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4c')},{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4d')}]});}return null;})[_0xd351('0x1d')](respondWithResult(_0x5dbdef,null))[_0xd351('0x3a')](handleError(_0x5dbdef,null));};exports[_0xd351('0x4e')]=function(_0x4d20af,_0x2fcede,_0x2d59a5){var _0x431e91='';return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x4d20af[_0xd351('0x3b')]['id']},'attributes':['id','username',_0xd351('0x4f'),_0xd351('0x50'),'authType','remoteUri']})[_0xd351('0x1d')](handleEntityNotFound(_0x2fcede,null))[_0xd351('0x1d')](function(_0x44dc58){if(_0x44dc58){_0x431e91=_0x44dc58[_0xd351('0x51')];var _0x1db455=_0x431e91[_0xd351('0x52')](-0x1);if(_0x1db455==='/'){_0x431e91=_0x431e91[_0xd351('0x53')](0x0,_0x431e91[_0xd351('0x54')](_0x1db455));}var _0x3ce2b9={'method':'GET','uri':util[_0xd351('0x55')](_0xd351('0x56'),_0x431e91,'ticket_fields'),'json':!![]};switch(_0x44dc58[_0xd351('0x57')]){case'password':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util['format'](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5a'),_0x44dc58[_0xd351('0x5b')],_0x44dc58[_0xd351('0x4f')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;case'token':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util[_0xd351('0x55')](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5e'),_0x44dc58['username'],_0x44dc58[_0xd351('0x50')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;default:throw new db['Sequelize'][(_0xd351('0x5f'))](_0xd351('0x60'));}return rp(_0x3ce2b9);}})[_0xd351('0x1d')](function(_0x3f0d27){if(_0x3f0d27){var _0x3635ad=[_0xd351('0x61'),_0xd351('0x62'),_0xd351('0x63'),_0xd351('0x64')];_['remove'](_0x3f0d27[_0xd351('0x65')],function(_0x190a00){return _0x3635ad['includes'](_0x190a00[_0xd351('0x24')]);});return{'count':_0x3f0d27['ticket_fields']['length'],'rows':_['map'](_0x3f0d27[_0xd351('0x65')],function(_0x3367f8){return{'id':_0x3367f8['id'],'name':_0x3367f8[_0xd351('0x66')]>0x7?_0x3367f8['title']:_0x3367f8[_0xd351('0x24')],'custom':_0x3367f8['position']>0x7?!![]:![],'options':_0x3367f8[_0xd351('0x67')]?_0x3367f8['system_field_options']:_0x3367f8[_0xd351('0x68')]?_0x3367f8[_0xd351('0x68')]:[]};})};}})[_0xd351('0x1d')](respondWithResult(_0x2fcede,null))[_0xd351('0x3a')](function(_0x35b148){var _0x1bb955=_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?0x1f4:_0x35b148[_0xd351('0x6a')]||0x1f4;logger[_0xd351('0x6b')](_0xd351('0x6c'),_0xd351('0x4e'),_0x1bb955,JSON['stringify'](_0x35b148));delete _0x35b148[_0xd351('0x27')];if(_0x1bb955===0x191){_0x1bb955=0x190;}_0x2fcede[_0xd351('0x14')](_0x1bb955)[_0xd351('0x6d')](_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x35b148[_0xd351('0x6a')]}:_0x35b148);});}; \ No newline at end of file +var _0x9ffd=['catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','findOne','username','password','token','authType','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','stack','name','index','map','ZendeskAccount','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x12ee46,_0x316fd4){var _0x218f80=function(_0x2f81c8){while(--_0x2f81c8){_0x12ee46['push'](_0x12ee46['shift']());}};_0x218f80(++_0x316fd4);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x27754d,_0x11511a){_0x27754d=_0x27754d-0x0;var _0x211607=_0x9ffd[_0x27754d];return _0x211607;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x47b0d7,_0xaaf7af){_0xaaf7af=_0xaaf7af||0xcc;return function(_0x16a0d9){if(_0x16a0d9){return _0x47b0d7[_0xd9ff('0x1a')](_0xaaf7af);}return _0x47b0d7[_0xd9ff('0x1b')](_0xaaf7af)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x556aa4,_0x2f78c1){_0x2f78c1=_0x2f78c1||0xc8;return function(_0x3c9ace){if(_0x3c9ace){return _0x556aa4['status'](_0x2f78c1)[_0xd9ff('0x1d')](_0x3c9ace);}};}function respondWithFilteredResult(_0x5db010,_0x4ffe54){return function(_0x547e28){if(_0x547e28){var _0x4c5718=typeof _0x4ffe54[_0xd9ff('0x1e')]==='undefined'&&typeof _0x4ffe54[_0xd9ff('0x1f')]===_0xd9ff('0x20');var _0x39c6ce=_0x547e28[_0xd9ff('0x21')];var _0x5f45c4=_0x4c5718?0x0:_0x4ffe54[_0xd9ff('0x1e')];var _0x3ccf15=_0x4c5718?_0x547e28[_0xd9ff('0x21')]:_0x4ffe54[_0xd9ff('0x1e')]+_0x4ffe54[_0xd9ff('0x1f')];var _0x3ea97d;if(_0x3ccf15>=_0x39c6ce){_0x3ccf15=_0x39c6ce;_0x3ea97d=0xc8;}else{_0x3ea97d=0xce;}_0x5db010[_0xd9ff('0x1b')](_0x3ea97d);return _0x5db010[_0xd9ff('0x22')]('Content-Range',_0x5f45c4+'-'+_0x3ccf15+'/'+_0x39c6ce)['json'](_0x547e28);}return null;};}function patchUpdates(_0x264a3d){return function(_0x3eed13){try{jsonpatch['apply'](_0x3eed13,_0x264a3d,!![]);}catch(_0x588151){return BPromise['reject'](_0x588151);}return _0x3eed13['save']();};}function saveUpdates(_0x1f4d9e,_0x58eb5f){return function(_0x4c486a){if(_0x4c486a){return _0x4c486a[_0xd9ff('0x23')](_0x1f4d9e)[_0xd9ff('0x24')](function(_0x9f074e){return _0x9f074e;});}return null;};}function removeEntity(_0x278b66,_0x42a828){return function(_0x4b058a){if(_0x4b058a){return _0x4b058a['destroy']()[_0xd9ff('0x24')](function(){_0x278b66['status'](0xcc)[_0xd9ff('0x1c')]();});}};}function handleEntityNotFound(_0x4d86fe,_0x285002){return function(_0x5d45b3){if(!_0x5d45b3){_0x4d86fe[_0xd9ff('0x1a')](0x194);}return _0x5d45b3;};}function handleError(_0x159e56,_0x2138b4){_0x2138b4=_0x2138b4||0x1f4;return function(_0x2970e8){logger['error'](_0x2970e8[_0xd9ff('0x25')]);if(_0x2970e8[_0xd9ff('0x26')]){delete _0x2970e8[_0xd9ff('0x26')];}_0x159e56[_0xd9ff('0x1b')](_0x2138b4)['send'](_0x2970e8);};}exports[_0xd9ff('0x27')]=function(_0x3792d9,_0x44b5a7){var _0x45fb63={},_0x263d3a={},_0xe516e2={'count':0x0,'rows':[]};var _0x420ffa=_[_0xd9ff('0x28')](db[_0xd9ff('0x29')]['rawAttributes'],function(_0xcea5db){return{'name':_0xcea5db['fieldName'],'type':_0xcea5db[_0xd9ff('0x2a')][_0xd9ff('0x2b')]};});_0x263d3a[_0xd9ff('0x2c')]=_['map'](_0x420ffa,_0xd9ff('0x26'));_0x263d3a[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x3792d9[_0xd9ff('0x2d')]);_0x263d3a['filters']=_[_0xd9ff('0x2f')](_0x263d3a['model'],_0x263d3a[_0xd9ff('0x2d')]);_0x45fb63[_0xd9ff('0x30')]=_[_0xd9ff('0x2f')](_0x263d3a[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x45fb63[_0xd9ff('0x30')]=_0x45fb63[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x45fb63[_0xd9ff('0x30')]:_0x263d3a[_0xd9ff('0x2c')];if(!_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x33')]('nolimit')){_0x45fb63[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x3792d9[_0xd9ff('0x2d')]['limit']);_0x45fb63[_0xd9ff('0x1e')]=qs['offset'](_0x3792d9[_0xd9ff('0x2d')]['offset']);}_0x45fb63[_0xd9ff('0x34')]=qs['sort'](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x45fb63[_0xd9ff('0x36')]=qs['filters'](_['pick'](_0x3792d9['query'],_0x263d3a[_0xd9ff('0x37')]),_0x420ffa);if(_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x45fb63[_0xd9ff('0x36')]=_[_0xd9ff('0x39')](_0x45fb63[_0xd9ff('0x36')],{'$or':_['map'](_0x420ffa,function(_0x4c00c2){if(_0x4c00c2['type']!==_0xd9ff('0x3a')){var _0x252edc={};_0x252edc[_0x4c00c2[_0xd9ff('0x26')]]={'$like':'%'+_0x3792d9[_0xd9ff('0x2d')]['filter']+'%'};return _0x252edc;}})});}_0x45fb63=_[_0xd9ff('0x39')]({},_0x45fb63,_0x3792d9['options']);var _0x3cff52={'where':_0x45fb63[_0xd9ff('0x36')]};return db[_0xd9ff('0x29')][_0xd9ff('0x21')](_0x3cff52)['then'](function(_0x1e34da){_0xe516e2[_0xd9ff('0x21')]=_0x1e34da;if(_0x3792d9['query'][_0xd9ff('0x3b')]){_0x45fb63[_0xd9ff('0x3c')]=[{'all':!![]}];}return db[_0xd9ff('0x29')][_0xd9ff('0x3d')](_0x45fb63);})[_0xd9ff('0x24')](function(_0x1cc848){_0xe516e2['rows']=_0x1cc848;return _0xe516e2;})[_0xd9ff('0x24')](respondWithFilteredResult(_0x44b5a7,_0x45fb63))[_0xd9ff('0x3e')](handleError(_0x44b5a7,null));};exports[_0xd9ff('0x3f')]=function(_0x39fbbb,_0x472724){var _0x52aab8={'raw':![],'where':{'id':_0x39fbbb[_0xd9ff('0x40')]['id']}},_0x3178cd={};_0x3178cd[_0xd9ff('0x2c')]=_['keys'](db['ZendeskAccount'][_0xd9ff('0x41')]);_0x3178cd[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x39fbbb[_0xd9ff('0x2d')]);_0x3178cd[_0xd9ff('0x37')]=_[_0xd9ff('0x2f')](_0x3178cd['model'],_0x3178cd[_0xd9ff('0x2d')]);_0x52aab8[_0xd9ff('0x30')]=_['intersection'](_0x3178cd[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x39fbbb[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x52aab8[_0xd9ff('0x30')]=_0x52aab8['attributes']['length']?_0x52aab8['attributes']:_0x3178cd[_0xd9ff('0x2c')];if(_0x39fbbb['query'][_0xd9ff('0x3b')]){_0x52aab8[_0xd9ff('0x3c')]=[{'all':!![]}];}_0x52aab8=_[_0xd9ff('0x39')]({},_0x52aab8,_0x39fbbb['options']);return db[_0xd9ff('0x29')][_0xd9ff('0x42')](_0x52aab8)['then'](handleEntityNotFound(_0x472724,null))[_0xd9ff('0x24')](respondWithResult(_0x472724,null))[_0xd9ff('0x3e')](handleError(_0x472724,null));};exports[_0xd9ff('0x43')]=function(_0x316854,_0x559101){return db[_0xd9ff('0x29')]['create'](_0x316854[_0xd9ff('0x44')],{})['then'](respondWithResult(_0x559101,0xc9))[_0xd9ff('0x3e')](handleError(_0x559101,null));};exports[_0xd9ff('0x23')]=function(_0x2bf37a,_0x1760c3){if(_0x2bf37a[_0xd9ff('0x44')]['id']){delete _0x2bf37a['body']['id'];}return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x2bf37a[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x1760c3,null))['then'](saveUpdates(_0x2bf37a['body'],null))['then'](respondWithResult(_0x1760c3,null))[_0xd9ff('0x3e')](handleError(_0x1760c3,null));};exports[_0xd9ff('0x45')]=function(_0x29c6bd,_0x572618){return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x29c6bd[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x572618,null))[_0xd9ff('0x24')](removeEntity(_0x572618,null))[_0xd9ff('0x3e')](handleError(_0x572618,null));};exports[_0xd9ff('0x46')]=function(_0x1e1364,_0x1ad160,_0x10d9d0){var _0x5dcb5={};var _0x3d6143={};var _0x2533d7;var _0x487b07;return db[_0xd9ff('0x29')]['findOne']({'where':{'id':_0x1e1364[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x1ad160,null))[_0xd9ff('0x24')](function(_0x49623d){if(_0x49623d){_0x2533d7=_0x49623d;_0x3d6143[_0xd9ff('0x2c')]=_['keys'](db[_0xd9ff('0x47')]['rawAttributes']);_0x3d6143[_0xd9ff('0x2d')]=_['keys'](_0x1e1364[_0xd9ff('0x2d')]);_0x3d6143['filters']=_[_0xd9ff('0x2f')](_0x3d6143[_0xd9ff('0x2c')],_0x3d6143[_0xd9ff('0x2d')]);_0x5dcb5[_0xd9ff('0x30')]=_['intersection'](_0x3d6143[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x1e1364[_0xd9ff('0x2d')]['fields']));_0x5dcb5[_0xd9ff('0x30')]=_0x5dcb5[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x5dcb5[_0xd9ff('0x30')]:_0x3d6143[_0xd9ff('0x2c')];_0x5dcb5['order']=qs[_0xd9ff('0x35')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x5dcb5[_0xd9ff('0x36')]=qs[_0xd9ff('0x37')](_[_0xd9ff('0x48')](_0x1e1364[_0xd9ff('0x2d')],_0x3d6143['filters']));if(_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x5dcb5['where']=_[_0xd9ff('0x39')](_0x5dcb5[_0xd9ff('0x36')],{'$or':_['map'](_0x5dcb5[_0xd9ff('0x30')],function(_0x36d5c2){var _0x25d8d1={};_0x25d8d1[_0x36d5c2]={'$like':'%'+_0x1e1364['query']['filter']+'%'};return _0x25d8d1;})});}_0x5dcb5=_[_0xd9ff('0x39')]({},_0x5dcb5,_0x1e1364['options']);return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x31907e){if(_0x31907e){_0x487b07=_0x31907e[_0xd9ff('0x32')];if(!_0x1e1364['query']['hasOwnProperty']('nolimit')){_0x5dcb5[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x1f')]);_0x5dcb5[_0xd9ff('0x1e')]=qs['offset'](_0x1e1364[_0xd9ff('0x2d')]['offset']);}return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x3f92c3){if(_0x3f92c3){return _0x3f92c3?{'count':_0x487b07,'rows':_0x3f92c3}:null;}})[_0xd9ff('0x24')](respondWithResult(_0x1ad160,null))[_0xd9ff('0x3e')](handleError(_0x1ad160,null));};exports[_0xd9ff('0x49')]=function(_0xed12df,_0xfcafbe,_0x5d633b){if(_0xed12df[_0xd9ff('0x44')]['id']){delete _0xed12df[_0xd9ff('0x44')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0xed12df[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0xfcafbe,null))[_0xd9ff('0x24')](function(_0x34fca4){if(_0x34fca4){_0xed12df['body'][_0xd9ff('0x4a')]=_0x34fca4['id'];_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4b')]=integrations[_0xd9ff('0x4c')](_0xed12df[_0xd9ff('0x44')]['channel'],_0xed12df[_0xd9ff('0x44')]['type']);_0xed12df['body'][_0xd9ff('0x4d')]=integrations[_0xd9ff('0x4e')](_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4f')],_0xed12df['body'][_0xd9ff('0x2a')]);return db[_0xd9ff('0x47')][_0xd9ff('0x43')](_0xed12df[_0xd9ff('0x44')],{'include':[{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4b')},{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4d')}]});}return null;})['then'](respondWithResult(_0xfcafbe,null))['catch'](handleError(_0xfcafbe,null));};exports['getFields']=function(_0x275fb9,_0x31db27,_0x514d59){var _0x196670='';return db[_0xd9ff('0x29')][_0xd9ff('0x51')]({'where':{'id':_0x275fb9[_0xd9ff('0x40')]['id']},'attributes':['id',_0xd9ff('0x52'),_0xd9ff('0x53'),_0xd9ff('0x54'),_0xd9ff('0x55'),'remoteUri']})[_0xd9ff('0x24')](handleEntityNotFound(_0x31db27,null))[_0xd9ff('0x24')](function(_0x228413){if(_0x228413){_0x196670=_0x228413['remoteUri'];var _0x14e936=_0x196670['slice'](-0x1);if(_0x14e936==='/'){_0x196670=_0x196670[_0xd9ff('0x56')](0x0,_0x196670[_0xd9ff('0x57')](_0x14e936));}var _0x25ee82={'method':'GET','uri':util[_0xd9ff('0x58')](_0xd9ff('0x59'),_0x196670,_0xd9ff('0x5a')),'json':!![]};switch(_0x228413[_0xd9ff('0x55')]){case'password':_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5d'),_0x228413[_0xd9ff('0x52')],_0x228413[_0xd9ff('0x53')]))['toString'](_0xd9ff('0x5e')))};break;case _0xd9ff('0x54'):_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5f'),_0x228413[_0xd9ff('0x52')],_0x228413['token']))[_0xd9ff('0x60')](_0xd9ff('0x5e')))};break;default:throw new db[(_0xd9ff('0x61'))]['ValidationError'](_0xd9ff('0x62'));}return rp(_0x25ee82);}})['then'](function(_0x1e46fc){if(_0x1e46fc){var _0x478e0d=[_0xd9ff('0x63'),_0xd9ff('0x64'),_0xd9ff('0x65'),_0xd9ff('0x66')];_[_0xd9ff('0x67')](_0x1e46fc[_0xd9ff('0x5a')],function(_0xda0003){return _0x478e0d[_0xd9ff('0x68')](_0xda0003[_0xd9ff('0x2a')]);});return{'count':_0x1e46fc[_0xd9ff('0x5a')]['length'],'rows':_[_0xd9ff('0x28')](_0x1e46fc[_0xd9ff('0x5a')],function(_0x1f6cb9){return{'id':_0x1f6cb9['id'],'name':_0x1f6cb9[_0xd9ff('0x69')]>0x7?_0x1f6cb9[_0xd9ff('0x6a')]:_0x1f6cb9[_0xd9ff('0x2a')],'custom':_0x1f6cb9['position']>0x7?!![]:![],'options':_0x1f6cb9['system_field_options']?_0x1f6cb9[_0xd9ff('0x6b')]:_0x1f6cb9[_0xd9ff('0x6c')]?_0x1f6cb9[_0xd9ff('0x6c')]:[]};})};}})[_0xd9ff('0x24')](respondWithResult(_0x31db27,null))[_0xd9ff('0x3e')](function(_0x183199){var _0x5b234c=_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?0x1f4:_0x183199[_0xd9ff('0x6e')]||0x1f4;logger[_0xd9ff('0x6f')](_0xd9ff('0x70'),_0xd9ff('0x71'),_0x5b234c,JSON['stringify'](_0x183199));delete _0x183199[_0xd9ff('0x26')];if(_0x5b234c===0x191){_0x5b234c=0x190;}_0x31db27[_0xd9ff('0x1b')](_0x5b234c)[_0xd9ff('0x72')](_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?{'message':_0xd9ff('0x73'),'statusCode':_0x183199[_0xd9ff('0x6e')]}:_0x183199);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index fde334b..67e9ba2 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 _0xba37=['ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','bluebird','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xba37,0x13d));var _0x7ba3=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xba37[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x7ba3('0x0'));var util=require('util');var logger=require(_0x7ba3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7ba3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7ba3('0x3'));var config=require('../../config/environment');var attributes=require(_0x7ba3('0x4'));var integrations=require(_0x7ba3('0x5'));module[_0x7ba3('0x6')]=function(_0x4123d0,_0x267c2a){return _0x4123d0['define'](_0x7ba3('0x7'),attributes,{'tableName':_0x7ba3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1472=['../../config/logger','api','bluebird','request-promise','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1472,0x107));var _0x2147=function(_0x90e575,_0x48c2ec){_0x90e575=_0x90e575-0x0;var _0x1aae60=_0x1472[_0x90e575];return _0x1aae60;};'use strict';var _=require(_0x2147('0x0'));var util=require('util');var logger=require(_0x2147('0x1'))(_0x2147('0x2'));var moment=require('moment');var BPromise=require(_0x2147('0x3'));var rp=require(_0x2147('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2147('0x5'));var config=require('../../config/environment');var attributes=require(_0x2147('0x6'));var integrations=require(_0x2147('0x7'));module[_0x2147('0x8')]=function(_0x12b49d,_0x28bc93){return _0x12b49d[_0x2147('0x9')](_0x2147('0xa'),attributes,{'tableName':_0x2147('0xb'),'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 8919349..c4435d5 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 _0xea98=['../../config/environment','jayson/promise','client','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','ZendeskAccount','find','ShowZendeskAccount','lodash','util','moment','randomstring','../../mysqldb','rpc'];(function(_0x1e37be,_0x405f43){var _0x749eca=function(_0x4c2126){while(--_0x4c2126){_0x1e37be['push'](_0x1e37be['shift']());}};_0x749eca(++_0x405f43);}(_0xea98,0x19e));var _0x8ea9=function(_0x433f44,_0xa365ce){_0x433f44=_0x433f44-0x0;var _0x73664=_0xea98[_0x433f44];return _0x73664;};'use strict';var _=require(_0x8ea9('0x0'));var util=require(_0x8ea9('0x1'));var moment=require(_0x8ea9('0x2'));var BPromise=require('bluebird');var rs=require(_0x8ea9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ea9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ea9('0x5'));var config=require(_0x8ea9('0x6'));var jayson=require(_0x8ea9('0x7'));var client=jayson[_0x8ea9('0x8')][_0x8ea9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfc7eb5,_0x4847c0,_0x4ea298){return new BPromise(function(_0xef01,_0x34dcf2){return client['request'](_0xfc7eb5,_0x4ea298)['then'](function(_0x13a6c3){logger[_0x8ea9('0xa')](_0x8ea9('0xb'),_0x4847c0,_0x8ea9('0xc'));logger[_0x8ea9('0xd')](_0x8ea9('0xe'),_0x4847c0,_0x8ea9('0xc'),JSON[_0x8ea9('0xf')](_0x13a6c3));if(_0x13a6c3[_0x8ea9('0x10')]){if(_0x13a6c3[_0x8ea9('0x10')][_0x8ea9('0x11')]===0x1f4){logger['error'](_0x8ea9('0xb'),_0x4847c0,_0x13a6c3['error'][_0x8ea9('0x12')]);return _0x34dcf2(_0x13a6c3[_0x8ea9('0x10')]['message']);}logger[_0x8ea9('0x10')](_0x8ea9('0xb'),_0x4847c0,_0x13a6c3[_0x8ea9('0x10')][_0x8ea9('0x12')]);return _0xef01(_0x13a6c3[_0x8ea9('0x10')][_0x8ea9('0x12')]);}else{logger['info'](_0x8ea9('0xb'),_0x4847c0,_0x8ea9('0xc'));_0xef01(_0x13a6c3[_0x8ea9('0x13')][_0x8ea9('0x12')]);}})[_0x8ea9('0x14')](function(_0x5809fd){logger[_0x8ea9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4847c0,_0x5809fd);_0x34dcf2(_0x5809fd);});});}exports[_0x8ea9('0x15')]=function(_0x134953){var _0x5c82af=this;return new Promise(function(_0x2b5b14,_0x5263dd){return db['ZendeskAccount'][_0x8ea9('0x16')]({'raw':_0x134953['options']?_0x134953[_0x8ea9('0x17')][_0x8ea9('0x18')]===undefined?!![]:![]:!![],'where':_0x134953['options']?_0x134953[_0x8ea9('0x17')][_0x8ea9('0x19')]||null:null,'attributes':_0x134953[_0x8ea9('0x17')]?_0x134953['options'][_0x8ea9('0x1a')]||null:null,'limit':_0x134953['options']?_0x134953[_0x8ea9('0x17')][_0x8ea9('0x1b')]||null:null,'include':_0x134953[_0x8ea9('0x17')]?_0x134953[_0x8ea9('0x17')]['include']?_['map'](_0x134953['options'][_0x8ea9('0x1c')],function(_0x5a7962){return{'model':db[_0x5a7962[_0x8ea9('0x1d')]],'as':_0x5a7962['as'],'attributes':_0x5a7962['attributes'],'include':_0x5a7962[_0x8ea9('0x1c')]?_[_0x8ea9('0x1e')](_0x5a7962[_0x8ea9('0x1c')],function(_0x58392b){return{'model':db[_0x58392b[_0x8ea9('0x1d')]],'as':_0x58392b['as'],'attributes':_0x58392b[_0x8ea9('0x1a')],'include':_0x58392b[_0x8ea9('0x1c')]?_[_0x8ea9('0x1e')](_0x58392b['include'],function(_0x123827){return{'model':db[_0x123827['model']],'as':_0x123827['as'],'attributes':_0x123827['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ea9('0x1f')](function(_0x2744fc){logger[_0x8ea9('0xa')](_0x8ea9('0x15'),_0x134953);logger['debug']('GetZendeskAccount',_0x134953,JSON['stringify'](_0x2744fc));_0x2b5b14(_0x2744fc);})[_0x8ea9('0x14')](function(_0xbddbff){logger['error'](_0x8ea9('0x15'),_0xbddbff[_0x8ea9('0x12')],_0x134953);_0x5263dd(_0x5c82af['error'](0x1f4,_0xbddbff[_0x8ea9('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x2f3a7a){var _0x80afa5=this;return new Promise(function(_0x422f97,_0x96822f){return db[_0x8ea9('0x20')][_0x8ea9('0x21')]({'raw':_0x2f3a7a['options']?_0x2f3a7a['options'][_0x8ea9('0x18')]===undefined?!![]:![]:!![],'where':_0x2f3a7a['options']?_0x2f3a7a[_0x8ea9('0x17')][_0x8ea9('0x19')]||null:null,'attributes':_0x2f3a7a['options']?_0x2f3a7a[_0x8ea9('0x17')][_0x8ea9('0x1a')]||null:null,'include':_0x2f3a7a[_0x8ea9('0x17')]?_0x2f3a7a['options'][_0x8ea9('0x1c')]?_[_0x8ea9('0x1e')](_0x2f3a7a[_0x8ea9('0x17')][_0x8ea9('0x1c')],function(_0x1c01db){return{'model':db[_0x1c01db[_0x8ea9('0x1d')]],'as':_0x1c01db['as'],'attributes':_0x1c01db['attributes'],'include':_0x1c01db[_0x8ea9('0x1c')]?_[_0x8ea9('0x1e')](_0x1c01db[_0x8ea9('0x1c')],function(_0x4e1c6d){return{'model':db[_0x4e1c6d[_0x8ea9('0x1d')]],'as':_0x4e1c6d['as'],'attributes':_0x4e1c6d[_0x8ea9('0x1a')],'include':_0x4e1c6d['include']?_['map'](_0x4e1c6d['include'],function(_0x5ea208){return{'model':db[_0x5ea208[_0x8ea9('0x1d')]],'as':_0x5ea208['as'],'attributes':_0x5ea208[_0x8ea9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8ea9('0x1f')](function(_0x4952bc){logger['info'](_0x8ea9('0x22'),_0x2f3a7a);logger[_0x8ea9('0xd')](_0x8ea9('0x22'),_0x2f3a7a,JSON[_0x8ea9('0xf')](_0x4952bc));_0x422f97(_0x4952bc);})[_0x8ea9('0x14')](function(_0x2251cb){logger[_0x8ea9('0x10')](_0x8ea9('0x22'),_0x2251cb['message'],_0x2f3a7a);_0x96822f(_0x80afa5['error'](0x1f4,_0x2251cb[_0x8ea9('0x12')]));});});}; \ No newline at end of file +var _0x873e=['result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x873e,0x141));var _0xe873=function(_0xc05531,_0x3a57fe){_0xc05531=_0xc05531-0x0;var _0x273103=_0x873e[_0xc05531];return _0x273103;};'use strict';var _=require(_0xe873('0x0'));var util=require(_0xe873('0x1'));var moment=require(_0xe873('0x2'));var BPromise=require(_0xe873('0x3'));var rs=require(_0xe873('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe873('0x5'));var config=require(_0xe873('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe873('0x7')][_0xe873('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e82f9,_0xe089f1,_0xbdca0e){return new BPromise(function(_0x440748,_0x56d55a){return client[_0xe873('0x9')](_0x4e82f9,_0xbdca0e)[_0xe873('0xa')](function(_0x1d2141){logger['info'](_0xe873('0xb'),_0xe089f1,_0xe873('0xc'));logger[_0xe873('0xd')](_0xe873('0xe'),_0xe089f1,_0xe873('0xc'),JSON[_0xe873('0xf')](_0x1d2141));if(_0x1d2141[_0xe873('0x10')]){if(_0x1d2141[_0xe873('0x10')][_0xe873('0x11')]===0x1f4){logger[_0xe873('0x10')](_0xe873('0xb'),_0xe089f1,_0x1d2141[_0xe873('0x10')][_0xe873('0x12')]);return _0x56d55a(_0x1d2141[_0xe873('0x10')]['message']);}logger[_0xe873('0x10')](_0xe873('0xb'),_0xe089f1,_0x1d2141[_0xe873('0x10')][_0xe873('0x12')]);return _0x440748(_0x1d2141[_0xe873('0x10')][_0xe873('0x12')]);}else{logger['info'](_0xe873('0xb'),_0xe089f1,_0xe873('0xc'));_0x440748(_0x1d2141[_0xe873('0x13')][_0xe873('0x12')]);}})[_0xe873('0x14')](function(_0x27b5e8){logger[_0xe873('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0xe089f1,_0x27b5e8);_0x56d55a(_0x27b5e8);});});}exports[_0xe873('0x15')]=function(_0x284338){var _0x3bcd6c=this;return new Promise(function(_0x1fd766,_0x1e9e84){return db[_0xe873('0x16')][_0xe873('0x17')]({'raw':_0x284338[_0xe873('0x18')]?_0x284338[_0xe873('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x284338['options']?_0x284338[_0xe873('0x18')][_0xe873('0x19')]||null:null,'attributes':_0x284338[_0xe873('0x18')]?_0x284338[_0xe873('0x18')][_0xe873('0x1a')]||null:null,'limit':_0x284338[_0xe873('0x18')]?_0x284338[_0xe873('0x18')][_0xe873('0x1b')]||null:null,'include':_0x284338[_0xe873('0x18')]?_0x284338[_0xe873('0x18')][_0xe873('0x1c')]?_[_0xe873('0x1d')](_0x284338[_0xe873('0x18')][_0xe873('0x1c')],function(_0x10b469){return{'model':db[_0x10b469[_0xe873('0x1e')]],'as':_0x10b469['as'],'attributes':_0x10b469[_0xe873('0x1a')],'include':_0x10b469['include']?_[_0xe873('0x1d')](_0x10b469['include'],function(_0x1e02fa){return{'model':db[_0x1e02fa[_0xe873('0x1e')]],'as':_0x1e02fa['as'],'attributes':_0x1e02fa['attributes'],'include':_0x1e02fa[_0xe873('0x1c')]?_['map'](_0x1e02fa[_0xe873('0x1c')],function(_0x1fad34){return{'model':db[_0x1fad34[_0xe873('0x1e')]],'as':_0x1fad34['as'],'attributes':_0x1fad34[_0xe873('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe873('0xa')](function(_0x38eac3){logger['info'](_0xe873('0x15'),_0x284338);logger[_0xe873('0xd')]('GetZendeskAccount',_0x284338,JSON[_0xe873('0xf')](_0x38eac3));_0x1fd766(_0x38eac3);})[_0xe873('0x14')](function(_0x3998c3){logger[_0xe873('0x10')](_0xe873('0x15'),_0x3998c3['message'],_0x284338);_0x1e9e84(_0x3bcd6c[_0xe873('0x10')](0x1f4,_0x3998c3['message']));});});};exports['ShowZendeskAccount']=function(_0x9ab5f8){var _0x2658fd=this;return new Promise(function(_0x45908c,_0x238eb0){return db[_0xe873('0x16')][_0xe873('0x1f')]({'raw':_0x9ab5f8['options']?_0x9ab5f8['options'][_0xe873('0x20')]===undefined?!![]:![]:!![],'where':_0x9ab5f8[_0xe873('0x18')]?_0x9ab5f8[_0xe873('0x18')]['where']||null:null,'attributes':_0x9ab5f8[_0xe873('0x18')]?_0x9ab5f8[_0xe873('0x18')][_0xe873('0x1a')]||null:null,'include':_0x9ab5f8[_0xe873('0x18')]?_0x9ab5f8[_0xe873('0x18')][_0xe873('0x1c')]?_['map'](_0x9ab5f8[_0xe873('0x18')][_0xe873('0x1c')],function(_0x5d8c63){return{'model':db[_0x5d8c63['model']],'as':_0x5d8c63['as'],'attributes':_0x5d8c63[_0xe873('0x1a')],'include':_0x5d8c63['include']?_[_0xe873('0x1d')](_0x5d8c63[_0xe873('0x1c')],function(_0x258d0b){return{'model':db[_0x258d0b[_0xe873('0x1e')]],'as':_0x258d0b['as'],'attributes':_0x258d0b[_0xe873('0x1a')],'include':_0x258d0b[_0xe873('0x1c')]?_[_0xe873('0x1d')](_0x258d0b[_0xe873('0x1c')],function(_0x495bd2){return{'model':db[_0x495bd2['model']],'as':_0x495bd2['as'],'attributes':_0x495bd2[_0xe873('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe873('0xa')](function(_0x4e1d1b){logger['info'](_0xe873('0x21'),_0x9ab5f8);logger['debug'](_0xe873('0x21'),_0x9ab5f8,JSON['stringify'](_0x4e1d1b));_0x45908c(_0x4e1d1b);})[_0xe873('0x14')](function(_0x4c5bb1){logger['error'](_0xe873('0x21'),_0x4c5bb1[_0xe873('0x12')],_0x9ab5f8);_0x238eb0(_0x2658fd['error'](0x1f4,_0x4c5bb1[_0xe873('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 0a502ee..b524afe 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 _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0x267a92,_0x144bb1){var _0x41c589=function(_0x4ceae2){while(--_0x4ceae2){_0x267a92['push'](_0x267a92['shift']());}};_0x41c589(++_0x144bb1);}(_0x4483,0x1a3));var _0x3448=function(_0x534bd8,_0xe4bdd2){_0x534bd8=_0x534bd8-0x0;var _0x304f99=_0x4483[_0x534bd8];return _0x304f99;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router; \ No newline at end of file +var _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x417505,_0x56ecfe){var _0x5ac87d=function(_0x13e009){while(--_0x13e009){_0x417505['push'](_0x417505['shift']());}};_0x5ac87d(++_0x56ecfe);}(_0x4fc2,0x111));var _0x24fc=function(_0x57957f,_0x4e70f7){_0x57957f=_0x57957f-0x0;var _0x46c750=_0x4fc2[_0x57957f];return _0x46c750;};'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')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('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 ebd4924..b833cf0 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 _0xde9c=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde9c,0x1ad));var _0xcde9=function(_0x394ded,_0x397091){_0x394ded=_0x394ded-0x0;var _0x188301=_0xde9c[_0x394ded];return _0x188301;};'use strict';var Sequelize=require(_0xcde9('0x0'));module[_0xcde9('0x1')]={'name':{'type':Sequelize[_0xcde9('0x2')]},'description':{'type':Sequelize[_0xcde9('0x2')]}}; \ No newline at end of file +var _0xc475=['sequelize','exports','STRING'];(function(_0x41a4e9,_0x3d1124){var _0x43cf9a=function(_0x361990){while(--_0x361990){_0x41a4e9['push'](_0x41a4e9['shift']());}};_0x43cf9a(++_0x3d1124);}(_0xc475,0xe4));var _0x5c47=function(_0x510329,_0x1ea936){_0x510329=_0x510329-0x0;var _0xf772f3=_0xc475[_0x510329];return _0xf772f3;};'use strict';var Sequelize=require(_0x5c47('0x0'));module[_0x5c47('0x1')]={'name':{'type':Sequelize[_0x5c47('0x2')]},'description':{'type':Sequelize[_0x5c47('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 45353b8..e8282ea 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 _0x094a=['send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','name'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x094a,0x11f));var _0xa094=function(_0x270e98,_0x6bc28c){_0x270e98=_0x270e98-0x0;var _0x278e24=_0x094a[_0x270e98];return _0x278e24;};'use strict';var emlformat=require(_0xa094('0x0'));var rimraf=require(_0xa094('0x1'));var zipdir=require(_0xa094('0x2'));var jsonpatch=require(_0xa094('0x3'));var rp=require('request-promise');var moment=require(_0xa094('0x4'));var BPromise=require(_0xa094('0x5'));var Mustache=require('mustache');var util=require(_0xa094('0x6'));var path=require(_0xa094('0x7'));var sox=require(_0xa094('0x8'));var csv=require('to-csv');var ejs=require(_0xa094('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa094('0xa'));var squel=require(_0xa094('0xb'));var crypto=require(_0xa094('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa094('0xd'));var toCsv=require(_0xa094('0xe'));var querystring=require(_0xa094('0xf'));var Papa=require(_0xa094('0x10'));var Redis=require('ioredis');var authService=require(_0xa094('0x11'));var qs=require(_0xa094('0x12'));var as=require(_0xa094('0x13'));var hardwareService=require(_0xa094('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa094('0x15'));var config=require(_0xa094('0x16'));var licenseUtil=require(_0xa094('0x17'));var db=require(_0xa094('0x18'))['db'];function respondWithStatusCode(_0x862e4,_0x2eb122){_0x2eb122=_0x2eb122||0xcc;return function(_0x50dd47){if(_0x50dd47){return _0x862e4[_0xa094('0x19')](_0x2eb122);}return _0x862e4[_0xa094('0x1a')](_0x2eb122)[_0xa094('0x1b')]();};}function respondWithResult(_0x17076a,_0x3b4760){_0x3b4760=_0x3b4760||0xc8;return function(_0x59163c){if(_0x59163c){return _0x17076a[_0xa094('0x1a')](_0x3b4760)[_0xa094('0x1c')](_0x59163c);}};}function respondWithFilteredResult(_0x34699f,_0x2b340c){return function(_0x16dc14){if(_0x16dc14){var _0x2e63ce=typeof _0x2b340c[_0xa094('0x1d')]===_0xa094('0x1e')&&typeof _0x2b340c[_0xa094('0x1f')]===_0xa094('0x1e');var _0x1319c8=_0x16dc14[_0xa094('0x20')];var _0x115990=_0x2e63ce?0x0:_0x2b340c[_0xa094('0x1d')];var _0x1f3abd=_0x2e63ce?_0x16dc14[_0xa094('0x20')]:_0x2b340c[_0xa094('0x1d')]+_0x2b340c[_0xa094('0x1f')];var _0x262d3a;if(_0x1f3abd>=_0x1319c8){_0x1f3abd=_0x1319c8;_0x262d3a=0xc8;}else{_0x262d3a=0xce;}_0x34699f[_0xa094('0x1a')](_0x262d3a);return _0x34699f[_0xa094('0x21')](_0xa094('0x22'),_0x115990+'-'+_0x1f3abd+'/'+_0x1319c8)[_0xa094('0x1c')](_0x16dc14);}return null;};}function patchUpdates(_0x2335c){return function(_0x4feae1){try{jsonpatch['apply'](_0x4feae1,_0x2335c,!![]);}catch(_0x5a2344){return BPromise['reject'](_0x5a2344);}return _0x4feae1[_0xa094('0x23')]();};}function saveUpdates(_0x16acac,_0x41b069){return function(_0xf9be6b){if(_0xf9be6b){return _0xf9be6b[_0xa094('0x24')](_0x16acac)['then'](function(_0x130562){return _0x130562;});}return null;};}function removeEntity(_0x581223,_0x4f8b58){return function(_0x31c88){if(_0x31c88){return _0x31c88[_0xa094('0x25')]()[_0xa094('0x26')](function(){_0x581223[_0xa094('0x1a')](0xcc)[_0xa094('0x1b')]();});}};}function handleEntityNotFound(_0x541f21,_0x43c629){return function(_0x1eabf7){if(!_0x1eabf7){_0x541f21[_0xa094('0x19')](0x194);}return _0x1eabf7;};}function handleError(_0x4da869,_0xde1de0){_0xde1de0=_0xde1de0||0x1f4;return function(_0x180e30){logger[_0xa094('0x27')](_0x180e30['stack']);if(_0x180e30[_0xa094('0x28')]){delete _0x180e30[_0xa094('0x28')];}_0x4da869[_0xa094('0x1a')](_0xde1de0)[_0xa094('0x29')](_0x180e30);};}exports[_0xa094('0x2a')]=function(_0x2e82d8,_0x408c1d){var _0x5bd5d0={},_0x5b28cb={},_0x16176f={'count':0x0,'rows':[]};var _0x59aeef=_[_0xa094('0x2b')](db[_0xa094('0x2c')][_0xa094('0x2d')],function(_0x47ce0b){return{'name':_0x47ce0b[_0xa094('0x2e')],'type':_0x47ce0b[_0xa094('0x2f')]['key']};});_0x5b28cb[_0xa094('0x30')]=_[_0xa094('0x2b')](_0x59aeef,_0xa094('0x28'));_0x5b28cb[_0xa094('0x31')]=_[_0xa094('0x32')](_0x2e82d8[_0xa094('0x31')]);_0x5b28cb[_0xa094('0x33')]=_[_0xa094('0x34')](_0x5b28cb[_0xa094('0x30')],_0x5b28cb[_0xa094('0x31')]);_0x5bd5d0[_0xa094('0x35')]=_[_0xa094('0x34')](_0x5b28cb['model'],qs['fields'](_0x2e82d8[_0xa094('0x31')][_0xa094('0x36')]));_0x5bd5d0[_0xa094('0x35')]=_0x5bd5d0[_0xa094('0x35')][_0xa094('0x37')]?_0x5bd5d0[_0xa094('0x35')]:_0x5b28cb['model'];if(!_0x2e82d8['query'][_0xa094('0x38')](_0xa094('0x39'))){_0x5bd5d0['limit']=qs['limit'](_0x2e82d8[_0xa094('0x31')]['limit']);_0x5bd5d0[_0xa094('0x1d')]=qs['offset'](_0x2e82d8[_0xa094('0x31')]['offset']);}_0x5bd5d0[_0xa094('0x3a')]=qs[_0xa094('0x3b')](_0x2e82d8[_0xa094('0x31')][_0xa094('0x3b')]);_0x5bd5d0['where']=qs[_0xa094('0x33')](_[_0xa094('0x3c')](_0x2e82d8['query'],_0x5b28cb[_0xa094('0x33')]),_0x59aeef);if(_0x2e82d8[_0xa094('0x31')][_0xa094('0x3d')]){_0x5bd5d0['where']=_[_0xa094('0x3e')](_0x5bd5d0['where'],{'$or':_[_0xa094('0x2b')](_0x59aeef,function(_0x305a9c){if(_0x305a9c['type']!=='VIRTUAL'){var _0x2b2c9d={};_0x2b2c9d[_0x305a9c[_0xa094('0x28')]]={'$like':'%'+_0x2e82d8['query'][_0xa094('0x3d')]+'%'};return _0x2b2c9d;}})});}_0x5bd5d0=_[_0xa094('0x3e')]({},_0x5bd5d0,_0x2e82d8[_0xa094('0x3f')]);var _0x1ac617={'where':_0x5bd5d0[_0xa094('0x40')]};return db[_0xa094('0x2c')]['count'](_0x1ac617)[_0xa094('0x26')](function(_0x8683db){_0x16176f['count']=_0x8683db;if(_0x2e82d8[_0xa094('0x31')][_0xa094('0x41')]){_0x5bd5d0[_0xa094('0x42')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xa094('0x43')](_0x5bd5d0);})[_0xa094('0x26')](function(_0x1a36a0){_0x16176f[_0xa094('0x44')]=_0x1a36a0;return _0x16176f;})[_0xa094('0x26')](respondWithFilteredResult(_0x408c1d,_0x5bd5d0))[_0xa094('0x45')](handleError(_0x408c1d,null));};exports[_0xa094('0x46')]=function(_0x30d044,_0x14e642){var _0x292f8a={'raw':![],'where':{'id':_0x30d044[_0xa094('0x47')]['id']}},_0x1a2bfa={};_0x1a2bfa[_0xa094('0x30')]=_[_0xa094('0x32')](db['ZendeskConfiguration'][_0xa094('0x2d')]);_0x1a2bfa[_0xa094('0x31')]=_[_0xa094('0x32')](_0x30d044[_0xa094('0x31')]);_0x1a2bfa[_0xa094('0x33')]=_[_0xa094('0x34')](_0x1a2bfa[_0xa094('0x30')],_0x1a2bfa[_0xa094('0x31')]);_0x292f8a[_0xa094('0x35')]=_[_0xa094('0x34')](_0x1a2bfa[_0xa094('0x30')],qs['fields'](_0x30d044[_0xa094('0x31')][_0xa094('0x36')]));_0x292f8a[_0xa094('0x35')]=_0x292f8a['attributes'][_0xa094('0x37')]?_0x292f8a[_0xa094('0x35')]:_0x1a2bfa[_0xa094('0x30')];if(_0x30d044['query'][_0xa094('0x41')]){_0x292f8a[_0xa094('0x42')]=[{'all':!![]}];}_0x292f8a=_[_0xa094('0x3e')]({},_0x292f8a,_0x30d044['options']);return db[_0xa094('0x2c')][_0xa094('0x48')](_0x292f8a)[_0xa094('0x26')](handleEntityNotFound(_0x14e642,null))[_0xa094('0x26')](respondWithResult(_0x14e642,null))[_0xa094('0x45')](handleError(_0x14e642,null));};exports['create']=function(_0xe8a9d9,_0x5acf6a){return db[_0xa094('0x2c')][_0xa094('0x49')](_0xe8a9d9[_0xa094('0x4a')],{})[_0xa094('0x26')](respondWithResult(_0x5acf6a,0xc9))[_0xa094('0x45')](handleError(_0x5acf6a,null));};exports['update']=function(_0x3e2b38,_0x2c78f5){if(_0x3e2b38[_0xa094('0x4a')]['id']){delete _0x3e2b38[_0xa094('0x4a')]['id'];}return db[_0xa094('0x2c')][_0xa094('0x48')]({'where':{'id':_0x3e2b38[_0xa094('0x47')]['id']}})[_0xa094('0x26')](handleEntityNotFound(_0x2c78f5,null))[_0xa094('0x26')](saveUpdates(_0x3e2b38['body'],null))[_0xa094('0x26')](respondWithResult(_0x2c78f5,null))[_0xa094('0x45')](handleError(_0x2c78f5,null));};exports[_0xa094('0x25')]=function(_0x1ea48c,_0x35b073){return db[_0xa094('0x2c')][_0xa094('0x48')]({'where':{'id':_0x1ea48c[_0xa094('0x47')]['id']}})['then'](handleEntityNotFound(_0x35b073,null))[_0xa094('0x26')](removeEntity(_0x35b073,null))['catch'](handleError(_0x35b073,null));};exports[_0xa094('0x4b')]=function(_0x306007,_0x965235,_0x4238ce){var _0x39a21a={};var _0x4b70a0={};var _0x30be7b;var _0x4e454a;return db['ZendeskConfiguration'][_0xa094('0x4c')]({'where':{'id':_0x306007[_0xa094('0x47')]['id']}})[_0xa094('0x26')](handleEntityNotFound(_0x965235,null))[_0xa094('0x26')](function(_0x39c121){if(_0x39c121){_0x30be7b=_0x39c121;_0x4b70a0[_0xa094('0x30')]=_[_0xa094('0x32')](db['ZendeskField']['rawAttributes']);_0x4b70a0['query']=_[_0xa094('0x32')](_0x306007[_0xa094('0x31')]);_0x4b70a0[_0xa094('0x33')]=_[_0xa094('0x34')](_0x4b70a0[_0xa094('0x30')],_0x4b70a0['query']);_0x39a21a[_0xa094('0x35')]=_['intersection'](_0x4b70a0[_0xa094('0x30')],qs['fields'](_0x306007[_0xa094('0x31')]['fields']));_0x39a21a[_0xa094('0x35')]=_0x39a21a[_0xa094('0x35')][_0xa094('0x37')]?_0x39a21a[_0xa094('0x35')]:_0x4b70a0[_0xa094('0x30')];_0x39a21a['order']=qs['sort'](_0x306007[_0xa094('0x31')]['sort']);_0x39a21a['where']=qs[_0xa094('0x33')](_[_0xa094('0x3c')](_0x306007[_0xa094('0x31')],_0x4b70a0[_0xa094('0x33')]));if(_0x306007[_0xa094('0x31')][_0xa094('0x3d')]){_0x39a21a[_0xa094('0x40')]=_[_0xa094('0x3e')](_0x39a21a[_0xa094('0x40')],{'$or':_[_0xa094('0x2b')](_0x39a21a[_0xa094('0x35')],function(_0x164398){var _0x3459b6={};_0x3459b6[_0x164398]={'$like':'%'+_0x306007[_0xa094('0x31')][_0xa094('0x3d')]+'%'};return _0x3459b6;})});}_0x39a21a=_['merge']({},_0x39a21a,_0x306007['options']);return _0x30be7b[_0xa094('0x4b')](_0x39a21a);}})[_0xa094('0x26')](function(_0x1c1413){if(_0x1c1413){_0x4e454a=_0x1c1413[_0xa094('0x37')];if(!_0x306007[_0xa094('0x31')]['hasOwnProperty'](_0xa094('0x39'))){_0x39a21a[_0xa094('0x1f')]=qs['limit'](_0x306007[_0xa094('0x31')]['limit']);_0x39a21a[_0xa094('0x1d')]=qs[_0xa094('0x1d')](_0x306007['query']['offset']);}return _0x30be7b[_0xa094('0x4b')](_0x39a21a);}})['then'](function(_0x62e947){if(_0x62e947){return _0x62e947?{'count':_0x4e454a,'rows':_0x62e947}:null;}})['then'](respondWithResult(_0x965235,null))[_0xa094('0x45')](handleError(_0x965235,null));};exports['getSubjects']=function(_0x439212,_0x48e841,_0x554e7a){var _0x1aad82={};var _0x32a074={};var _0x2fb64b;var _0x70755d;return db[_0xa094('0x2c')][_0xa094('0x4c')]({'where':{'id':_0x439212[_0xa094('0x47')]['id']}})['then'](handleEntityNotFound(_0x48e841,null))[_0xa094('0x26')](function(_0x47a42c){if(_0x47a42c){_0x2fb64b=_0x47a42c;_0x32a074[_0xa094('0x30')]=_[_0xa094('0x32')](db['ZendeskField'][_0xa094('0x2d')]);_0x32a074['query']=_[_0xa094('0x32')](_0x439212[_0xa094('0x31')]);_0x32a074[_0xa094('0x33')]=_['intersection'](_0x32a074['model'],_0x32a074[_0xa094('0x31')]);_0x1aad82[_0xa094('0x35')]=_[_0xa094('0x34')](_0x32a074[_0xa094('0x30')],qs['fields'](_0x439212[_0xa094('0x31')][_0xa094('0x36')]));_0x1aad82[_0xa094('0x35')]=_0x1aad82[_0xa094('0x35')][_0xa094('0x37')]?_0x1aad82[_0xa094('0x35')]:_0x32a074[_0xa094('0x30')];_0x1aad82['order']=qs[_0xa094('0x3b')](_0x439212[_0xa094('0x31')]['sort']);_0x1aad82[_0xa094('0x40')]=qs[_0xa094('0x33')](_[_0xa094('0x3c')](_0x439212[_0xa094('0x31')],_0x32a074[_0xa094('0x33')]));if(_0x439212[_0xa094('0x31')][_0xa094('0x3d')]){_0x1aad82['where']=_[_0xa094('0x3e')](_0x1aad82[_0xa094('0x40')],{'$or':_['map'](_0x1aad82[_0xa094('0x35')],function(_0xc3d12){var _0x36b937={};_0x36b937[_0xc3d12]={'$like':'%'+_0x439212[_0xa094('0x31')][_0xa094('0x3d')]+'%'};return _0x36b937;})});}_0x1aad82=_[_0xa094('0x3e')]({},_0x1aad82,_0x439212[_0xa094('0x3f')]);return _0x2fb64b[_0xa094('0x4d')](_0x1aad82);}})['then'](function(_0x16ddeb){if(_0x16ddeb){_0x70755d=_0x16ddeb[_0xa094('0x37')];if(!_0x439212['query'][_0xa094('0x38')](_0xa094('0x39'))){_0x1aad82[_0xa094('0x1f')]=qs[_0xa094('0x1f')](_0x439212[_0xa094('0x31')][_0xa094('0x1f')]);_0x1aad82[_0xa094('0x1d')]=qs[_0xa094('0x1d')](_0x439212[_0xa094('0x31')][_0xa094('0x1d')]);}return _0x2fb64b[_0xa094('0x4d')](_0x1aad82);}})[_0xa094('0x26')](function(_0x586a86){if(_0x586a86){return _0x586a86?{'count':_0x70755d,'rows':_0x586a86}:null;}})[_0xa094('0x26')](respondWithResult(_0x48e841,null))[_0xa094('0x45')](handleError(_0x48e841,null));};exports[_0xa094('0x4e')]=function(_0x2af0fc,_0x3a3c3b,_0x2a78e7){var _0x12ad76={};var _0x535982={};var _0x19a979;var _0x5bbbb8;return db[_0xa094('0x2c')][_0xa094('0x4c')]({'where':{'id':_0x2af0fc['params']['id']}})[_0xa094('0x26')](handleEntityNotFound(_0x3a3c3b,null))[_0xa094('0x26')](function(_0x152a4c){if(_0x152a4c){_0x19a979=_0x152a4c;_0x535982[_0xa094('0x30')]=_['keys'](db['ZendeskField'][_0xa094('0x2d')]);_0x535982[_0xa094('0x31')]=_['keys'](_0x2af0fc[_0xa094('0x31')]);_0x535982['filters']=_[_0xa094('0x34')](_0x535982['model'],_0x535982['query']);_0x12ad76[_0xa094('0x35')]=_[_0xa094('0x34')](_0x535982['model'],qs['fields'](_0x2af0fc[_0xa094('0x31')][_0xa094('0x36')]));_0x12ad76[_0xa094('0x35')]=_0x12ad76[_0xa094('0x35')][_0xa094('0x37')]?_0x12ad76['attributes']:_0x535982[_0xa094('0x30')];_0x12ad76[_0xa094('0x3a')]=qs['sort'](_0x2af0fc[_0xa094('0x31')][_0xa094('0x3b')]);_0x12ad76['where']=qs[_0xa094('0x33')](_[_0xa094('0x3c')](_0x2af0fc[_0xa094('0x31')],_0x535982[_0xa094('0x33')]));if(_0x2af0fc[_0xa094('0x31')]['filter']){_0x12ad76['where']=_[_0xa094('0x3e')](_0x12ad76[_0xa094('0x40')],{'$or':_[_0xa094('0x2b')](_0x12ad76['attributes'],function(_0x324464){var _0x5dcc02={};_0x5dcc02[_0x324464]={'$like':'%'+_0x2af0fc['query'][_0xa094('0x3d')]+'%'};return _0x5dcc02;})});}_0x12ad76=_['merge']({},_0x12ad76,_0x2af0fc[_0xa094('0x3f')]);return _0x19a979['getDescriptions'](_0x12ad76);}})[_0xa094('0x26')](function(_0x33c367){if(_0x33c367){_0x5bbbb8=_0x33c367['length'];if(!_0x2af0fc[_0xa094('0x31')][_0xa094('0x38')](_0xa094('0x39'))){_0x12ad76[_0xa094('0x1f')]=qs[_0xa094('0x1f')](_0x2af0fc['query'][_0xa094('0x1f')]);_0x12ad76[_0xa094('0x1d')]=qs[_0xa094('0x1d')](_0x2af0fc[_0xa094('0x31')][_0xa094('0x1d')]);}return _0x19a979[_0xa094('0x4e')](_0x12ad76);}})[_0xa094('0x26')](function(_0x42bf86){if(_0x42bf86){return _0x42bf86?{'count':_0x5bbbb8,'rows':_0x42bf86}:null;}})[_0xa094('0x26')](respondWithResult(_0x3a3c3b,null))[_0xa094('0x45')](handleError(_0x3a3c3b,null));};exports[_0xa094('0x4f')]=function(_0x487d9e,_0x7c71ab,_0x2266a9){var _0x41aba2={};var _0x1f5864={};var _0x33842c;var _0x3bdd0a;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x487d9e[_0xa094('0x47')]['id']}})[_0xa094('0x26')](handleEntityNotFound(_0x7c71ab,null))[_0xa094('0x26')](function(_0x22a416){if(_0x22a416){_0x33842c=_0x22a416;_0x1f5864[_0xa094('0x30')]=_['keys'](db['Tag']['rawAttributes']);_0x1f5864[_0xa094('0x31')]=_[_0xa094('0x32')](_0x487d9e['query']);_0x1f5864[_0xa094('0x33')]=_[_0xa094('0x34')](_0x1f5864[_0xa094('0x30')],_0x1f5864[_0xa094('0x31')]);_0x41aba2[_0xa094('0x35')]=_['intersection'](_0x1f5864[_0xa094('0x30')],qs[_0xa094('0x36')](_0x487d9e[_0xa094('0x31')][_0xa094('0x36')]));_0x41aba2['attributes']=_0x41aba2[_0xa094('0x35')][_0xa094('0x37')]?_0x41aba2[_0xa094('0x35')]:_0x1f5864[_0xa094('0x30')];_0x41aba2['order']=qs['sort'](_0x487d9e[_0xa094('0x31')][_0xa094('0x3b')]);_0x41aba2[_0xa094('0x40')]=qs[_0xa094('0x33')](_[_0xa094('0x3c')](_0x487d9e[_0xa094('0x31')],_0x1f5864[_0xa094('0x33')]));if(_0x487d9e[_0xa094('0x31')][_0xa094('0x3d')]){_0x41aba2[_0xa094('0x40')]=_[_0xa094('0x3e')](_0x41aba2[_0xa094('0x40')],{'$or':_[_0xa094('0x2b')](_0x41aba2[_0xa094('0x35')],function(_0x5d1ee7){var _0x55abd2={};_0x55abd2[_0x5d1ee7]={'$like':'%'+_0x487d9e[_0xa094('0x31')]['filter']+'%'};return _0x55abd2;})});}_0x41aba2=_[_0xa094('0x3e')]({},_0x41aba2,_0x487d9e[_0xa094('0x3f')]);return _0x33842c[_0xa094('0x4f')](_0x41aba2);}})[_0xa094('0x26')](function(_0x10c673){if(_0x10c673){_0x3bdd0a=_0x10c673[_0xa094('0x37')];if(!_0x487d9e[_0xa094('0x31')][_0xa094('0x38')]('nolimit')){_0x41aba2[_0xa094('0x1f')]=qs[_0xa094('0x1f')](_0x487d9e[_0xa094('0x31')][_0xa094('0x1f')]);_0x41aba2[_0xa094('0x1d')]=qs['offset'](_0x487d9e[_0xa094('0x31')][_0xa094('0x1d')]);}return _0x33842c[_0xa094('0x4f')](_0x41aba2);}})['then'](function(_0x23effd){if(_0x23effd){return _0x23effd?{'count':_0x3bdd0a,'rows':_0x23effd}:null;}})[_0xa094('0x26')](respondWithResult(_0x7c71ab,null))[_0xa094('0x45')](handleError(_0x7c71ab,null));};exports['setTags']=function(_0x354613,_0x4dc994,_0x33f543){if(_0x354613[_0xa094('0x4a')]['id']){delete _0x354613[_0xa094('0x4a')]['id'];}return db[_0xa094('0x2c')]['findOne']({'where':{'id':_0x354613[_0xa094('0x47')]['id']}})[_0xa094('0x26')](handleEntityNotFound(_0x4dc994,null))[_0xa094('0x26')](function(_0xbb9226){if(_0xbb9226){return _0xbb9226[_0xa094('0x50')](_0x354613[_0xa094('0x4a')][_0xa094('0x51')]||[]);}return null;})[_0xa094('0x26')](respondWithResult(_0x4dc994,null))[_0xa094('0x45')](handleError(_0x4dc994,null));}; \ No newline at end of file +var _0x366a=['getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','params','find','create','body','findOne','ZendeskField'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0x366a,0x144));var _0xa366=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0x366a[_0x1f5887];return _0x21774b;};'use strict';var emlformat=require(_0xa366('0x0'));var rimraf=require(_0xa366('0x1'));var zipdir=require(_0xa366('0x2'));var jsonpatch=require(_0xa366('0x3'));var rp=require(_0xa366('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa366('0x5'));var util=require(_0xa366('0x6'));var path=require(_0xa366('0x7'));var sox=require('sox');var csv=require(_0xa366('0x8'));var ejs=require(_0xa366('0x9'));var fs=require('fs');var fs_extra=require(_0xa366('0xa'));var _=require(_0xa366('0xb'));var squel=require('squel');var crypto=require(_0xa366('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa366('0x8'));var querystring=require(_0xa366('0xd'));var Papa=require(_0xa366('0xe'));var Redis=require(_0xa366('0xf'));var authService=require(_0xa366('0x10'));var qs=require(_0xa366('0x11'));var as=require(_0xa366('0x12'));var hardwareService=require(_0xa366('0x13'));var logger=require(_0xa366('0x14'))(_0xa366('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa366('0x16'))['db'];function respondWithStatusCode(_0x114801,_0xee73d0){_0xee73d0=_0xee73d0||0xcc;return function(_0x345016){if(_0x345016){return _0x114801[_0xa366('0x17')](_0xee73d0);}return _0x114801[_0xa366('0x18')](_0xee73d0)['end']();};}function respondWithResult(_0xeb83dd,_0x257819){_0x257819=_0x257819||0xc8;return function(_0x169381){if(_0x169381){return _0xeb83dd[_0xa366('0x18')](_0x257819)[_0xa366('0x19')](_0x169381);}};}function respondWithFilteredResult(_0x3230dc,_0xada482){return function(_0x506f24){if(_0x506f24){var _0x2d553e=typeof _0xada482[_0xa366('0x1a')]===_0xa366('0x1b')&&typeof _0xada482[_0xa366('0x1c')]===_0xa366('0x1b');var _0x401610=_0x506f24[_0xa366('0x1d')];var _0x42b0b0=_0x2d553e?0x0:_0xada482[_0xa366('0x1a')];var _0x36cbf7=_0x2d553e?_0x506f24[_0xa366('0x1d')]:_0xada482[_0xa366('0x1a')]+_0xada482[_0xa366('0x1c')];var _0x397521;if(_0x36cbf7>=_0x401610){_0x36cbf7=_0x401610;_0x397521=0xc8;}else{_0x397521=0xce;}_0x3230dc[_0xa366('0x18')](_0x397521);return _0x3230dc[_0xa366('0x1e')](_0xa366('0x1f'),_0x42b0b0+'-'+_0x36cbf7+'/'+_0x401610)[_0xa366('0x19')](_0x506f24);}return null;};}function patchUpdates(_0x5af2eb){return function(_0x143136){try{jsonpatch[_0xa366('0x20')](_0x143136,_0x5af2eb,!![]);}catch(_0x1f2f38){return BPromise['reject'](_0x1f2f38);}return _0x143136[_0xa366('0x21')]();};}function saveUpdates(_0xf6e1f5,_0x96214d){return function(_0x3fd648){if(_0x3fd648){return _0x3fd648['update'](_0xf6e1f5)[_0xa366('0x22')](function(_0x3643e2){return _0x3643e2;});}return null;};}function removeEntity(_0x5d8439,_0x55f8b8){return function(_0x5144de){if(_0x5144de){return _0x5144de[_0xa366('0x23')]()[_0xa366('0x22')](function(){_0x5d8439[_0xa366('0x18')](0xcc)[_0xa366('0x24')]();});}};}function handleEntityNotFound(_0x4611c7,_0x460aa4){return function(_0x193c9c){if(!_0x193c9c){_0x4611c7[_0xa366('0x17')](0x194);}return _0x193c9c;};}function handleError(_0xe376c2,_0x41ef31){_0x41ef31=_0x41ef31||0x1f4;return function(_0x1343af){logger[_0xa366('0x25')](_0x1343af[_0xa366('0x26')]);if(_0x1343af[_0xa366('0x27')]){delete _0x1343af['name'];}_0xe376c2[_0xa366('0x18')](_0x41ef31)[_0xa366('0x28')](_0x1343af);};}exports[_0xa366('0x29')]=function(_0xf44afd,_0x4b12e2){var _0x538c9a={},_0x178aa2={},_0x50000c={'count':0x0,'rows':[]};var _0x4bc658=_[_0xa366('0x2a')](db['ZendeskConfiguration'][_0xa366('0x2b')],function(_0x52dc80){return{'name':_0x52dc80['fieldName'],'type':_0x52dc80[_0xa366('0x2c')][_0xa366('0x2d')]};});_0x178aa2[_0xa366('0x2e')]=_[_0xa366('0x2a')](_0x4bc658,_0xa366('0x27'));_0x178aa2[_0xa366('0x2f')]=_[_0xa366('0x30')](_0xf44afd[_0xa366('0x2f')]);_0x178aa2[_0xa366('0x31')]=_[_0xa366('0x32')](_0x178aa2[_0xa366('0x2e')],_0x178aa2[_0xa366('0x2f')]);_0x538c9a[_0xa366('0x33')]=_[_0xa366('0x32')](_0x178aa2['model'],qs['fields'](_0xf44afd[_0xa366('0x2f')][_0xa366('0x34')]));_0x538c9a['attributes']=_0x538c9a[_0xa366('0x33')][_0xa366('0x35')]?_0x538c9a['attributes']:_0x178aa2[_0xa366('0x2e')];if(!_0xf44afd[_0xa366('0x2f')][_0xa366('0x36')](_0xa366('0x37'))){_0x538c9a[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0xf44afd[_0xa366('0x2f')][_0xa366('0x1c')]);_0x538c9a['offset']=qs[_0xa366('0x1a')](_0xf44afd[_0xa366('0x2f')][_0xa366('0x1a')]);}_0x538c9a[_0xa366('0x38')]=qs['sort'](_0xf44afd[_0xa366('0x2f')][_0xa366('0x39')]);_0x538c9a[_0xa366('0x3a')]=qs[_0xa366('0x31')](_[_0xa366('0x3b')](_0xf44afd[_0xa366('0x2f')],_0x178aa2[_0xa366('0x31')]),_0x4bc658);if(_0xf44afd[_0xa366('0x2f')][_0xa366('0x3c')]){_0x538c9a[_0xa366('0x3a')]=_[_0xa366('0x3d')](_0x538c9a['where'],{'$or':_['map'](_0x4bc658,function(_0x4eb5a0){if(_0x4eb5a0[_0xa366('0x2c')]!==_0xa366('0x3e')){var _0x49965f={};_0x49965f[_0x4eb5a0[_0xa366('0x27')]]={'$like':'%'+_0xf44afd[_0xa366('0x2f')][_0xa366('0x3c')]+'%'};return _0x49965f;}})});}_0x538c9a=_[_0xa366('0x3d')]({},_0x538c9a,_0xf44afd[_0xa366('0x3f')]);var _0x2f0c26={'where':_0x538c9a['where']};return db[_0xa366('0x40')]['count'](_0x2f0c26)['then'](function(_0x15f6b9){_0x50000c[_0xa366('0x1d')]=_0x15f6b9;if(_0xf44afd[_0xa366('0x2f')][_0xa366('0x41')]){_0x538c9a[_0xa366('0x42')]=[{'all':!![]}];}return db[_0xa366('0x40')][_0xa366('0x43')](_0x538c9a);})[_0xa366('0x22')](function(_0x32def3){_0x50000c[_0xa366('0x44')]=_0x32def3;return _0x50000c;})[_0xa366('0x22')](respondWithFilteredResult(_0x4b12e2,_0x538c9a))[_0xa366('0x45')](handleError(_0x4b12e2,null));};exports['show']=function(_0x3fb591,_0xc450ed){var _0x4721e0={'raw':![],'where':{'id':_0x3fb591[_0xa366('0x46')]['id']}},_0xa00a47={};_0xa00a47[_0xa366('0x2e')]=_['keys'](db[_0xa366('0x40')]['rawAttributes']);_0xa00a47['query']=_[_0xa366('0x30')](_0x3fb591['query']);_0xa00a47[_0xa366('0x31')]=_[_0xa366('0x32')](_0xa00a47['model'],_0xa00a47['query']);_0x4721e0[_0xa366('0x33')]=_[_0xa366('0x32')](_0xa00a47['model'],qs[_0xa366('0x34')](_0x3fb591[_0xa366('0x2f')][_0xa366('0x34')]));_0x4721e0['attributes']=_0x4721e0[_0xa366('0x33')]['length']?_0x4721e0[_0xa366('0x33')]:_0xa00a47[_0xa366('0x2e')];if(_0x3fb591[_0xa366('0x2f')][_0xa366('0x41')]){_0x4721e0[_0xa366('0x42')]=[{'all':!![]}];}_0x4721e0=_[_0xa366('0x3d')]({},_0x4721e0,_0x3fb591[_0xa366('0x3f')]);return db[_0xa366('0x40')][_0xa366('0x47')](_0x4721e0)[_0xa366('0x22')](handleEntityNotFound(_0xc450ed,null))[_0xa366('0x22')](respondWithResult(_0xc450ed,null))[_0xa366('0x45')](handleError(_0xc450ed,null));};exports[_0xa366('0x48')]=function(_0xbcf8e1,_0x4da2d9){return db[_0xa366('0x40')][_0xa366('0x48')](_0xbcf8e1[_0xa366('0x49')],{})[_0xa366('0x22')](respondWithResult(_0x4da2d9,0xc9))[_0xa366('0x45')](handleError(_0x4da2d9,null));};exports['update']=function(_0x193a24,_0x58cb7d){if(_0x193a24[_0xa366('0x49')]['id']){delete _0x193a24['body']['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x193a24[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x58cb7d,null))[_0xa366('0x22')](saveUpdates(_0x193a24[_0xa366('0x49')],null))[_0xa366('0x22')](respondWithResult(_0x58cb7d,null))[_0xa366('0x45')](handleError(_0x58cb7d,null));};exports[_0xa366('0x23')]=function(_0x557bea,_0x1b1a7b){return db[_0xa366('0x40')][_0xa366('0x47')]({'where':{'id':_0x557bea[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x1b1a7b,null))[_0xa366('0x22')](removeEntity(_0x1b1a7b,null))['catch'](handleError(_0x1b1a7b,null));};exports['getFields']=function(_0x3de849,_0x511461,_0x4899de){var _0x336220={};var _0x5a09b5={};var _0x3c401f;var _0x427f35;return db[_0xa366('0x40')][_0xa366('0x4a')]({'where':{'id':_0x3de849[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x511461,null))[_0xa366('0x22')](function(_0x2ade78){if(_0x2ade78){_0x3c401f=_0x2ade78;_0x5a09b5['model']=_[_0xa366('0x30')](db[_0xa366('0x4b')]['rawAttributes']);_0x5a09b5[_0xa366('0x2f')]=_[_0xa366('0x30')](_0x3de849[_0xa366('0x2f')]);_0x5a09b5[_0xa366('0x31')]=_[_0xa366('0x32')](_0x5a09b5['model'],_0x5a09b5['query']);_0x336220[_0xa366('0x33')]=_[_0xa366('0x32')](_0x5a09b5[_0xa366('0x2e')],qs[_0xa366('0x34')](_0x3de849[_0xa366('0x2f')]['fields']));_0x336220[_0xa366('0x33')]=_0x336220[_0xa366('0x33')][_0xa366('0x35')]?_0x336220['attributes']:_0x5a09b5['model'];_0x336220[_0xa366('0x38')]=qs[_0xa366('0x39')](_0x3de849[_0xa366('0x2f')]['sort']);_0x336220['where']=qs[_0xa366('0x31')](_[_0xa366('0x3b')](_0x3de849[_0xa366('0x2f')],_0x5a09b5['filters']));if(_0x3de849[_0xa366('0x2f')][_0xa366('0x3c')]){_0x336220[_0xa366('0x3a')]=_[_0xa366('0x3d')](_0x336220['where'],{'$or':_['map'](_0x336220[_0xa366('0x33')],function(_0xfd53f0){var _0xccad4d={};_0xccad4d[_0xfd53f0]={'$like':'%'+_0x3de849['query'][_0xa366('0x3c')]+'%'};return _0xccad4d;})});}_0x336220=_['merge']({},_0x336220,_0x3de849[_0xa366('0x3f')]);return _0x3c401f['getFields'](_0x336220);}})['then'](function(_0x570554){if(_0x570554){_0x427f35=_0x570554['length'];if(!_0x3de849[_0xa366('0x2f')][_0xa366('0x36')](_0xa366('0x37'))){_0x336220[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0x3de849[_0xa366('0x2f')][_0xa366('0x1c')]);_0x336220[_0xa366('0x1a')]=qs['offset'](_0x3de849['query']['offset']);}return _0x3c401f['getFields'](_0x336220);}})[_0xa366('0x22')](function(_0x1404af){if(_0x1404af){return _0x1404af?{'count':_0x427f35,'rows':_0x1404af}:null;}})[_0xa366('0x22')](respondWithResult(_0x511461,null))[_0xa366('0x45')](handleError(_0x511461,null));};exports['getSubjects']=function(_0x4851c6,_0x21faa0,_0x58a00f){var _0x3b6154={};var _0x99f2c={};var _0x12ac56;var _0x57e3a7;return db[_0xa366('0x40')][_0xa366('0x4a')]({'where':{'id':_0x4851c6[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x21faa0,null))['then'](function(_0x2e7221){if(_0x2e7221){_0x12ac56=_0x2e7221;_0x99f2c[_0xa366('0x2e')]=_[_0xa366('0x30')](db[_0xa366('0x4b')][_0xa366('0x2b')]);_0x99f2c[_0xa366('0x2f')]=_['keys'](_0x4851c6[_0xa366('0x2f')]);_0x99f2c[_0xa366('0x31')]=_[_0xa366('0x32')](_0x99f2c['model'],_0x99f2c[_0xa366('0x2f')]);_0x3b6154['attributes']=_['intersection'](_0x99f2c[_0xa366('0x2e')],qs['fields'](_0x4851c6[_0xa366('0x2f')]['fields']));_0x3b6154[_0xa366('0x33')]=_0x3b6154[_0xa366('0x33')][_0xa366('0x35')]?_0x3b6154[_0xa366('0x33')]:_0x99f2c['model'];_0x3b6154['order']=qs[_0xa366('0x39')](_0x4851c6[_0xa366('0x2f')][_0xa366('0x39')]);_0x3b6154['where']=qs['filters'](_['pick'](_0x4851c6['query'],_0x99f2c['filters']));if(_0x4851c6[_0xa366('0x2f')][_0xa366('0x3c')]){_0x3b6154[_0xa366('0x3a')]=_[_0xa366('0x3d')](_0x3b6154[_0xa366('0x3a')],{'$or':_['map'](_0x3b6154['attributes'],function(_0x1c6272){var _0xda0486={};_0xda0486[_0x1c6272]={'$like':'%'+_0x4851c6[_0xa366('0x2f')][_0xa366('0x3c')]+'%'};return _0xda0486;})});}_0x3b6154=_['merge']({},_0x3b6154,_0x4851c6[_0xa366('0x3f')]);return _0x12ac56['getSubjects'](_0x3b6154);}})[_0xa366('0x22')](function(_0x1a1d8d){if(_0x1a1d8d){_0x57e3a7=_0x1a1d8d['length'];if(!_0x4851c6[_0xa366('0x2f')]['hasOwnProperty'](_0xa366('0x37'))){_0x3b6154[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0x4851c6[_0xa366('0x2f')]['limit']);_0x3b6154[_0xa366('0x1a')]=qs[_0xa366('0x1a')](_0x4851c6['query'][_0xa366('0x1a')]);}return _0x12ac56['getSubjects'](_0x3b6154);}})[_0xa366('0x22')](function(_0x16328c){if(_0x16328c){return _0x16328c?{'count':_0x57e3a7,'rows':_0x16328c}:null;}})['then'](respondWithResult(_0x21faa0,null))['catch'](handleError(_0x21faa0,null));};exports[_0xa366('0x4c')]=function(_0x2abea9,_0x57fa3b,_0x705dd){var _0xebdd4f={};var _0x5b26ce={};var _0x10abaf;var _0x435639;return db[_0xa366('0x40')][_0xa366('0x4a')]({'where':{'id':_0x2abea9[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x57fa3b,null))[_0xa366('0x22')](function(_0x5a8bf9){if(_0x5a8bf9){_0x10abaf=_0x5a8bf9;_0x5b26ce[_0xa366('0x2e')]=_['keys'](db[_0xa366('0x4b')][_0xa366('0x2b')]);_0x5b26ce['query']=_['keys'](_0x2abea9[_0xa366('0x2f')]);_0x5b26ce[_0xa366('0x31')]=_[_0xa366('0x32')](_0x5b26ce[_0xa366('0x2e')],_0x5b26ce[_0xa366('0x2f')]);_0xebdd4f[_0xa366('0x33')]=_[_0xa366('0x32')](_0x5b26ce[_0xa366('0x2e')],qs[_0xa366('0x34')](_0x2abea9['query']['fields']));_0xebdd4f[_0xa366('0x33')]=_0xebdd4f[_0xa366('0x33')][_0xa366('0x35')]?_0xebdd4f[_0xa366('0x33')]:_0x5b26ce[_0xa366('0x2e')];_0xebdd4f[_0xa366('0x38')]=qs[_0xa366('0x39')](_0x2abea9['query'][_0xa366('0x39')]);_0xebdd4f[_0xa366('0x3a')]=qs[_0xa366('0x31')](_[_0xa366('0x3b')](_0x2abea9['query'],_0x5b26ce['filters']));if(_0x2abea9[_0xa366('0x2f')][_0xa366('0x3c')]){_0xebdd4f[_0xa366('0x3a')]=_[_0xa366('0x3d')](_0xebdd4f[_0xa366('0x3a')],{'$or':_[_0xa366('0x2a')](_0xebdd4f['attributes'],function(_0x113c97){var _0x180f40={};_0x180f40[_0x113c97]={'$like':'%'+_0x2abea9[_0xa366('0x2f')][_0xa366('0x3c')]+'%'};return _0x180f40;})});}_0xebdd4f=_[_0xa366('0x3d')]({},_0xebdd4f,_0x2abea9[_0xa366('0x3f')]);return _0x10abaf[_0xa366('0x4c')](_0xebdd4f);}})[_0xa366('0x22')](function(_0x47ea4a){if(_0x47ea4a){_0x435639=_0x47ea4a[_0xa366('0x35')];if(!_0x2abea9[_0xa366('0x2f')][_0xa366('0x36')](_0xa366('0x37'))){_0xebdd4f[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0x2abea9[_0xa366('0x2f')][_0xa366('0x1c')]);_0xebdd4f['offset']=qs[_0xa366('0x1a')](_0x2abea9[_0xa366('0x2f')]['offset']);}return _0x10abaf[_0xa366('0x4c')](_0xebdd4f);}})[_0xa366('0x22')](function(_0x3292ae){if(_0x3292ae){return _0x3292ae?{'count':_0x435639,'rows':_0x3292ae}:null;}})[_0xa366('0x22')](respondWithResult(_0x57fa3b,null))[_0xa366('0x45')](handleError(_0x57fa3b,null));};exports[_0xa366('0x4d')]=function(_0x30de06,_0x5c53c3,_0xaabdf7){var _0x7a8a2={};var _0x5994e3={};var _0xd5edcd;var _0x4e1c87;return db[_0xa366('0x40')]['findOne']({'where':{'id':_0x30de06[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x5c53c3,null))['then'](function(_0xb248e3){if(_0xb248e3){_0xd5edcd=_0xb248e3;_0x5994e3['model']=_[_0xa366('0x30')](db[_0xa366('0x4e')]['rawAttributes']);_0x5994e3[_0xa366('0x2f')]=_[_0xa366('0x30')](_0x30de06[_0xa366('0x2f')]);_0x5994e3[_0xa366('0x31')]=_[_0xa366('0x32')](_0x5994e3[_0xa366('0x2e')],_0x5994e3[_0xa366('0x2f')]);_0x7a8a2[_0xa366('0x33')]=_[_0xa366('0x32')](_0x5994e3['model'],qs['fields'](_0x30de06[_0xa366('0x2f')][_0xa366('0x34')]));_0x7a8a2[_0xa366('0x33')]=_0x7a8a2['attributes'][_0xa366('0x35')]?_0x7a8a2[_0xa366('0x33')]:_0x5994e3[_0xa366('0x2e')];_0x7a8a2['order']=qs[_0xa366('0x39')](_0x30de06[_0xa366('0x2f')][_0xa366('0x39')]);_0x7a8a2[_0xa366('0x3a')]=qs[_0xa366('0x31')](_[_0xa366('0x3b')](_0x30de06[_0xa366('0x2f')],_0x5994e3['filters']));if(_0x30de06['query']['filter']){_0x7a8a2[_0xa366('0x3a')]=_[_0xa366('0x3d')](_0x7a8a2[_0xa366('0x3a')],{'$or':_['map'](_0x7a8a2[_0xa366('0x33')],function(_0x599456){var _0x11e1a3={};_0x11e1a3[_0x599456]={'$like':'%'+_0x30de06[_0xa366('0x2f')][_0xa366('0x3c')]+'%'};return _0x11e1a3;})});}_0x7a8a2=_['merge']({},_0x7a8a2,_0x30de06[_0xa366('0x3f')]);return _0xd5edcd['getTags'](_0x7a8a2);}})[_0xa366('0x22')](function(_0x28bdf6){if(_0x28bdf6){_0x4e1c87=_0x28bdf6[_0xa366('0x35')];if(!_0x30de06['query'][_0xa366('0x36')](_0xa366('0x37'))){_0x7a8a2[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0x30de06[_0xa366('0x2f')][_0xa366('0x1c')]);_0x7a8a2[_0xa366('0x1a')]=qs[_0xa366('0x1a')](_0x30de06[_0xa366('0x2f')][_0xa366('0x1a')]);}return _0xd5edcd[_0xa366('0x4d')](_0x7a8a2);}})[_0xa366('0x22')](function(_0x18a0fc){if(_0x18a0fc){return _0x18a0fc?{'count':_0x4e1c87,'rows':_0x18a0fc}:null;}})[_0xa366('0x22')](respondWithResult(_0x5c53c3,null))[_0xa366('0x45')](handleError(_0x5c53c3,null));};exports['setTags']=function(_0x294a99,_0x1426d1,_0x3fe3e7){if(_0x294a99['body']['id']){delete _0x294a99[_0xa366('0x49')]['id'];}return db[_0xa366('0x40')]['findOne']({'where':{'id':_0x294a99[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x1426d1,null))['then'](function(_0x43bf7e){if(_0x43bf7e){return _0x43bf7e[_0xa366('0x4f')](_0x294a99[_0xa366('0x49')]['ids']||[]);}return null;})['then'](respondWithResult(_0x1426d1,null))['catch'](handleError(_0x1426d1,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 62fd640..9986603 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 _0xd4f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x551386,_0x6c0c9){_0x551386=_0x551386-0x0;var _0xf5a5e2=_0xd4f4[_0x551386];return _0xf5a5e2;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var logger=require(_0x4d4f('0x2'))(_0x4d4f('0x3'));var moment=require(_0x4d4f('0x4'));var BPromise=require(_0x4d4f('0x5'));var rp=require(_0x4d4f('0x6'));var fs=require('fs');var path=require(_0x4d4f('0x7'));var rimraf=require(_0x4d4f('0x8'));var config=require(_0x4d4f('0x9'));var attributes=require(_0x4d4f('0xa'));module['exports']=function(_0x5f451b,_0x5e38d2){return _0x5f451b[_0x4d4f('0xb')](_0x4d4f('0xc'),attributes,{'tableName':_0x4d4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4213=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x50c866,_0x5871d2){var _0x488728=function(_0x293a32){while(--_0x293a32){_0x50c866['push'](_0x50c866['shift']());}};_0x488728(++_0x5871d2);}(_0x4213,0x77));var _0x3421=function(_0x5b4a97,_0x345d91){_0x5b4a97=_0x5b4a97-0x0;var _0x20ae1f=_0x4213[_0x5b4a97];return _0x20ae1f;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3421('0x7'));var config=require('../../config/environment');var attributes=require(_0x3421('0x8'));module[_0x3421('0x9')]=function(_0x2155f8,_0x2a04e0){return _0x2155f8['define'](_0x3421('0xa'),attributes,{'tableName':_0x3421('0xb'),'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 64a0f38..d00b228 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 _0xa10f=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x13071e,_0x302980){var _0x292049=function(_0x1a40db){while(--_0x1a40db){_0x13071e['push'](_0x13071e['shift']());}};_0x292049(++_0x302980);}(_0xa10f,0x1b9));var _0xfa10=function(_0x4215b0,_0x266efa){_0x4215b0=_0x4215b0-0x0;var _0x3275e0=_0xa10f[_0x4215b0];return _0x3275e0;};'use strict';var _=require(_0xfa10('0x0'));var util=require(_0xfa10('0x1'));var moment=require(_0xfa10('0x2'));var BPromise=require(_0xfa10('0x3'));var rs=require(_0xfa10('0x4'));var fs=require('fs');var Redis=require(_0xfa10('0x5'));var db=require(_0xfa10('0x6'))['db'];var utils=require(_0xfa10('0x7'));var logger=require(_0xfa10('0x8'))(_0xfa10('0x9'));var config=require('../../config/environment');var jayson=require(_0xfa10('0xa'));var client=jayson['client'][_0xfa10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c51b1,_0x8db338,_0x597bfd){return new BPromise(function(_0x323628,_0x2409d4){return client[_0xfa10('0xc')](_0x5c51b1,_0x597bfd)[_0xfa10('0xd')](function(_0x2e3cb1){logger['info'](_0xfa10('0xe'),_0x8db338,'request\x20sent');logger[_0xfa10('0xf')](_0xfa10('0x10'),_0x8db338,_0xfa10('0x11'),JSON[_0xfa10('0x12')](_0x2e3cb1));if(_0x2e3cb1[_0xfa10('0x13')]){if(_0x2e3cb1[_0xfa10('0x13')]['code']===0x1f4){logger[_0xfa10('0x13')](_0xfa10('0xe'),_0x8db338,_0x2e3cb1[_0xfa10('0x13')][_0xfa10('0x14')]);return _0x2409d4(_0x2e3cb1[_0xfa10('0x13')][_0xfa10('0x14')]);}logger[_0xfa10('0x13')](_0xfa10('0xe'),_0x8db338,_0x2e3cb1[_0xfa10('0x13')]['message']);return _0x323628(_0x2e3cb1[_0xfa10('0x13')][_0xfa10('0x14')]);}else{logger['info'](_0xfa10('0xe'),_0x8db338,'request\x20sent');_0x323628(_0x2e3cb1[_0xfa10('0x15')][_0xfa10('0x14')]);}})[_0xfa10('0x16')](function(_0x3da0){logger[_0xfa10('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x8db338,_0x3da0);_0x2409d4(_0x3da0);});});} \ No newline at end of file +var _0xe6d4=['request','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x5e5d7f,_0x3ce4ca){var _0x6b660f=function(_0x30dd28){while(--_0x30dd28){_0x5e5d7f['push'](_0x5e5d7f['shift']());}};_0x6b660f(++_0x3ce4ca);}(_0xe6d4,0x69));var _0x4e6d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe6d4[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x4e6d('0x0'));var util=require('util');var moment=require(_0x4e6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e6d('0x2'));var fs=require('fs');var Redis=require(_0x4e6d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e6d('0x4'));var logger=require(_0x4e6d('0x5'))(_0x4e6d('0x6'));var config=require('../../config/environment');var jayson=require(_0x4e6d('0x7'));var client=jayson['client'][_0x4e6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27175e,_0x2fab3c,_0x16ab99){return new BPromise(function(_0x2ba325,_0x1b92ff){return client[_0x4e6d('0x9')](_0x27175e,_0x16ab99)[_0x4e6d('0xa')](function(_0x33bb7c){logger[_0x4e6d('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2fab3c,_0x4e6d('0xc'));logger['debug'](_0x4e6d('0xd'),_0x2fab3c,_0x4e6d('0xc'),JSON[_0x4e6d('0xe')](_0x33bb7c));if(_0x33bb7c['error']){if(_0x33bb7c[_0x4e6d('0xf')][_0x4e6d('0x10')]===0x1f4){logger['error'](_0x4e6d('0x11'),_0x2fab3c,_0x33bb7c[_0x4e6d('0xf')][_0x4e6d('0x12')]);return _0x1b92ff(_0x33bb7c[_0x4e6d('0xf')][_0x4e6d('0x12')]);}logger[_0x4e6d('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2fab3c,_0x33bb7c[_0x4e6d('0xf')][_0x4e6d('0x12')]);return _0x2ba325(_0x33bb7c['error'][_0x4e6d('0x12')]);}else{logger['info'](_0x4e6d('0x11'),_0x2fab3c,_0x4e6d('0xc'));_0x2ba325(_0x33bb7c['result'][_0x4e6d('0x12')]);}})['catch'](function(_0x54112d){logger[_0x4e6d('0xf')](_0x4e6d('0x11'),_0x2fab3c,_0x54112d);_0x1b92ff(_0x54112d);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index d46aefb..d289ad0 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 _0x44bc=['create','put','/:id','update','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','post'];(function(_0x211808,_0x155be5){var _0x3ece86=function(_0x59f47b){while(--_0x59f47b){_0x211808['push'](_0x211808['shift']());}};_0x3ece86(++_0x155be5);}(_0x44bc,0x127));var _0xc44b=function(_0x5df34f,_0x196d57){_0x5df34f=_0x5df34f-0x0;var _0x2e2289=_0x44bc[_0x5df34f];return _0x2e2289;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc44b('0x0'));var timeout=require('connect-timeout');var express=require(_0xc44b('0x1'));var router=express['Router']();var fs_extra=require(_0xc44b('0x2'));var auth=require(_0xc44b('0x3'));var interaction=require(_0xc44b('0x4'));var config=require(_0xc44b('0x5'));var controller=require(_0xc44b('0x6'));router[_0xc44b('0x7')]('/',auth[_0xc44b('0x8')](),controller[_0xc44b('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc44b('0xa')]('/',auth[_0xc44b('0x8')](),controller[_0xc44b('0xb')]);router[_0xc44b('0xc')](_0xc44b('0xd'),auth[_0xc44b('0x8')](),controller[_0xc44b('0xe')]);router['delete'](_0xc44b('0xd'),auth[_0xc44b('0x8')](),controller[_0xc44b('0xf')]);module[_0xc44b('0x10')]=router; \ No newline at end of file +var _0x0dfd=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x3d740d,_0x373d2a){var _0x3e32be=function(_0x5438e5){while(--_0x5438e5){_0x3d740d['push'](_0x3d740d['shift']());}};_0x3e32be(++_0x373d2a);}(_0x0dfd,0x7a));var _0xd0df=function(_0x4dd532,_0x11241b){_0x4dd532=_0x4dd532-0x0;var _0x53602a=_0x0dfd[_0x4dd532];return _0x53602a;};'use strict';var multer=require(_0xd0df('0x0'));var util=require(_0xd0df('0x1'));var path=require('path');var timeout=require(_0xd0df('0x2'));var express=require(_0xd0df('0x3'));var router=express[_0xd0df('0x4')]();var fs_extra=require(_0xd0df('0x5'));var auth=require(_0xd0df('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0df('0x7'));var controller=require('./intZendeskField.controller');router[_0xd0df('0x8')]('/',auth[_0xd0df('0x9')](),controller[_0xd0df('0xa')]);router[_0xd0df('0x8')](_0xd0df('0xb'),auth[_0xd0df('0x9')](),controller[_0xd0df('0xc')]);router[_0xd0df('0xd')]('/',auth[_0xd0df('0x9')](),controller['create']);router[_0xd0df('0xe')](_0xd0df('0xb'),auth[_0xd0df('0x9')](),controller[_0xd0df('0xf')]);router[_0xd0df('0x10')](_0xd0df('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd0df('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index b04f806..2344d2e 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 _0x1df1=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x2034d2,_0x5b59bc){var _0x453d55=function(_0x56bd2a){while(--_0x56bd2a){_0x2034d2['push'](_0x2034d2['shift']());}};_0x453d55(++_0x5b59bc);}(_0x1df1,0x1d1));var _0x11df=function(_0x505d19,_0x5cc3d4){_0x505d19=_0x505d19-0x0;var _0x52546e=_0x1df1[_0x505d19];return _0x52546e;};'use strict';var Sequelize=require(_0x11df('0x0'));module[_0x11df('0x1')]={'type':{'type':Sequelize[_0x11df('0x2')](_0x11df('0x3'),_0x11df('0x4'),_0x11df('0x5'),_0x11df('0x6'),_0x11df('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x11df('0x8')]},'key':{'type':Sequelize[_0x11df('0x8')]},'keyType':{'type':Sequelize[_0x11df('0x2')](_0x11df('0x3'),_0x11df('0x4'),_0x11df('0x5'))},'keyContent':{'type':Sequelize[_0x11df('0x8')]},'idField':{'type':Sequelize[_0x11df('0x8')]},'nameField':{'type':Sequelize[_0x11df('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x11df('0x8')]}}; \ No newline at end of file +var _0x3473=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x541be5,_0xfd1657){var _0x5f256f=function(_0x44f20f){while(--_0x44f20f){_0x541be5['push'](_0x541be5['shift']());}};_0x5f256f(++_0xfd1657);}(_0x3473,0x16b));var _0x3347=function(_0x5645ad,_0x580ea3){_0x5645ad=_0x5645ad-0x0;var _0x17d292=_0x3473[_0x5645ad];return _0x17d292;};'use strict';var Sequelize=require(_0x3347('0x0'));module[_0x3347('0x1')]={'type':{'type':Sequelize[_0x3347('0x2')]('string',_0x3347('0x3'),_0x3347('0x4'),_0x3347('0x5'),_0x3347('0x6')),'defaultValue':_0x3347('0x7')},'content':{'type':Sequelize[_0x3347('0x8')]},'key':{'type':Sequelize[_0x3347('0x8')]},'keyType':{'type':Sequelize[_0x3347('0x2')](_0x3347('0x7'),_0x3347('0x3'),_0x3347('0x4'))},'keyContent':{'type':Sequelize[_0x3347('0x8')]},'idField':{'type':Sequelize[_0x3347('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3347('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3347('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index c235f05..052eeba 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 _0xf337=['VIRTUAL','options','ZendeskField','count','includeAll','include','catch','show','params','find','create','body','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf337,0x174));var _0x7f33=function(_0x16c39e,_0x383a5e){_0x16c39e=_0x16c39e-0x0;var _0x1448e1=_0xf337[_0x16c39e];return _0x1448e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f33('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7f33('0x1'));var moment=require(_0x7f33('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7f33('0x3'));var util=require(_0x7f33('0x4'));var path=require(_0x7f33('0x5'));var sox=require(_0x7f33('0x6'));var csv=require(_0x7f33('0x7'));var ejs=require(_0x7f33('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f33('0x9'));var squel=require(_0x7f33('0xa'));var crypto=require(_0x7f33('0xb'));var jsforce=require(_0x7f33('0xc'));var deskjs=require(_0x7f33('0xd'));var toCsv=require(_0x7f33('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7f33('0xe'));var authService=require(_0x7f33('0xf'));var qs=require(_0x7f33('0x10'));var as=require(_0x7f33('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f33('0x12'))('api');var utils=require(_0x7f33('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7f33('0x14'));var db=require(_0x7f33('0x15'))['db'];function respondWithStatusCode(_0x38294e,_0x3617c5){_0x3617c5=_0x3617c5||0xcc;return function(_0x2b13a3){if(_0x2b13a3){return _0x38294e[_0x7f33('0x16')](_0x3617c5);}return _0x38294e['status'](_0x3617c5)[_0x7f33('0x17')]();};}function respondWithResult(_0x22f4d6,_0x17f699){_0x17f699=_0x17f699||0xc8;return function(_0x5c23e2){if(_0x5c23e2){return _0x22f4d6[_0x7f33('0x18')](_0x17f699)['json'](_0x5c23e2);}};}function respondWithFilteredResult(_0x5ea40f,_0x4c12d7){return function(_0x1f0ec8){if(_0x1f0ec8){var _0x4ef498=typeof _0x4c12d7[_0x7f33('0x19')]===_0x7f33('0x1a')&&typeof _0x4c12d7[_0x7f33('0x1b')]==='undefined';var _0x2bbf16=_0x1f0ec8['count'];var _0x1f7ce9=_0x4ef498?0x0:_0x4c12d7[_0x7f33('0x19')];var _0x5cb525=_0x4ef498?_0x1f0ec8['count']:_0x4c12d7[_0x7f33('0x19')]+_0x4c12d7[_0x7f33('0x1b')];var _0x13e0b2;if(_0x5cb525>=_0x2bbf16){_0x5cb525=_0x2bbf16;_0x13e0b2=0xc8;}else{_0x13e0b2=0xce;}_0x5ea40f[_0x7f33('0x18')](_0x13e0b2);return _0x5ea40f[_0x7f33('0x1c')](_0x7f33('0x1d'),_0x1f7ce9+'-'+_0x5cb525+'/'+_0x2bbf16)[_0x7f33('0x1e')](_0x1f0ec8);}return null;};}function patchUpdates(_0x2328ab){return function(_0xdc2610){try{jsonpatch[_0x7f33('0x1f')](_0xdc2610,_0x2328ab,!![]);}catch(_0x3d014b){return BPromise['reject'](_0x3d014b);}return _0xdc2610[_0x7f33('0x20')]();};}function saveUpdates(_0x22109e,_0x583e8d){return function(_0x75804a){if(_0x75804a){return _0x75804a[_0x7f33('0x21')](_0x22109e)[_0x7f33('0x22')](function(_0x31f1ec){return _0x31f1ec;});}return null;};}function removeEntity(_0xf5fa60,_0x137cb0){return function(_0x1961a3){if(_0x1961a3){return _0x1961a3['destroy']()[_0x7f33('0x22')](function(){_0xf5fa60[_0x7f33('0x18')](0xcc)[_0x7f33('0x17')]();});}};}function handleEntityNotFound(_0x154966,_0x1f80ad){return function(_0x17a00f){if(!_0x17a00f){_0x154966[_0x7f33('0x16')](0x194);}return _0x17a00f;};}function handleError(_0x4602a8,_0x576f50){_0x576f50=_0x576f50||0x1f4;return function(_0x4f1498){logger[_0x7f33('0x23')](_0x4f1498[_0x7f33('0x24')]);if(_0x4f1498[_0x7f33('0x25')]){delete _0x4f1498[_0x7f33('0x25')];}_0x4602a8[_0x7f33('0x18')](_0x576f50)[_0x7f33('0x26')](_0x4f1498);};}exports['index']=function(_0x4296c3,_0x58ba21){var _0x1661b5={},_0x256cc0={},_0x2095fe={'count':0x0,'rows':[]};var _0x527c86=_['map'](db['ZendeskField'][_0x7f33('0x27')],function(_0x32b0ab){return{'name':_0x32b0ab[_0x7f33('0x28')],'type':_0x32b0ab[_0x7f33('0x29')][_0x7f33('0x2a')]};});_0x256cc0[_0x7f33('0x2b')]=_[_0x7f33('0x2c')](_0x527c86,_0x7f33('0x25'));_0x256cc0[_0x7f33('0x2d')]=_[_0x7f33('0x2e')](_0x4296c3[_0x7f33('0x2d')]);_0x256cc0[_0x7f33('0x2f')]=_[_0x7f33('0x30')](_0x256cc0[_0x7f33('0x2b')],_0x256cc0[_0x7f33('0x2d')]);_0x1661b5['attributes']=_[_0x7f33('0x30')](_0x256cc0[_0x7f33('0x2b')],qs[_0x7f33('0x31')](_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x31')]));_0x1661b5[_0x7f33('0x32')]=_0x1661b5[_0x7f33('0x32')][_0x7f33('0x33')]?_0x1661b5['attributes']:_0x256cc0[_0x7f33('0x2b')];if(!_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x34')](_0x7f33('0x35'))){_0x1661b5['limit']=qs[_0x7f33('0x1b')](_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x1b')]);_0x1661b5[_0x7f33('0x19')]=qs['offset'](_0x4296c3['query'][_0x7f33('0x19')]);}_0x1661b5[_0x7f33('0x36')]=qs[_0x7f33('0x37')](_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x37')]);_0x1661b5['where']=qs['filters'](_[_0x7f33('0x38')](_0x4296c3[_0x7f33('0x2d')],_0x256cc0['filters']),_0x527c86);if(_0x4296c3['query'][_0x7f33('0x39')]){_0x1661b5[_0x7f33('0x3a')]=_[_0x7f33('0x3b')](_0x1661b5[_0x7f33('0x3a')],{'$or':_[_0x7f33('0x2c')](_0x527c86,function(_0x4d5e3c){if(_0x4d5e3c[_0x7f33('0x29')]!==_0x7f33('0x3c')){var _0x15bd2b={};_0x15bd2b[_0x4d5e3c[_0x7f33('0x25')]]={'$like':'%'+_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x39')]+'%'};return _0x15bd2b;}})});}_0x1661b5=_[_0x7f33('0x3b')]({},_0x1661b5,_0x4296c3[_0x7f33('0x3d')]);var _0x33f5a9={'where':_0x1661b5[_0x7f33('0x3a')]};return db[_0x7f33('0x3e')]['count'](_0x33f5a9)[_0x7f33('0x22')](function(_0x4a84ef){_0x2095fe[_0x7f33('0x3f')]=_0x4a84ef;if(_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x40')]){_0x1661b5[_0x7f33('0x41')]=[{'all':!![]}];}return db[_0x7f33('0x3e')]['findAll'](_0x1661b5);})[_0x7f33('0x22')](function(_0x1d3f4b){_0x2095fe['rows']=_0x1d3f4b;return _0x2095fe;})['then'](respondWithFilteredResult(_0x58ba21,_0x1661b5))[_0x7f33('0x42')](handleError(_0x58ba21,null));};exports[_0x7f33('0x43')]=function(_0x1ced77,_0x1a2ba9){var _0x3f418e={'raw':!![],'where':{'id':_0x1ced77[_0x7f33('0x44')]['id']}},_0x4e2ae7={};_0x4e2ae7[_0x7f33('0x2b')]=_['keys'](db[_0x7f33('0x3e')][_0x7f33('0x27')]);_0x4e2ae7[_0x7f33('0x2d')]=_[_0x7f33('0x2e')](_0x1ced77[_0x7f33('0x2d')]);_0x4e2ae7[_0x7f33('0x2f')]=_[_0x7f33('0x30')](_0x4e2ae7[_0x7f33('0x2b')],_0x4e2ae7[_0x7f33('0x2d')]);_0x3f418e[_0x7f33('0x32')]=_[_0x7f33('0x30')](_0x4e2ae7[_0x7f33('0x2b')],qs['fields'](_0x1ced77[_0x7f33('0x2d')]['fields']));_0x3f418e[_0x7f33('0x32')]=_0x3f418e[_0x7f33('0x32')][_0x7f33('0x33')]?_0x3f418e[_0x7f33('0x32')]:_0x4e2ae7['model'];if(_0x1ced77[_0x7f33('0x2d')]['includeAll']){_0x3f418e['include']=[{'all':!![]}];}_0x3f418e=_['merge']({},_0x3f418e,_0x1ced77[_0x7f33('0x3d')]);return db[_0x7f33('0x3e')][_0x7f33('0x45')](_0x3f418e)['then'](handleEntityNotFound(_0x1a2ba9,null))[_0x7f33('0x22')](respondWithResult(_0x1a2ba9,null))['catch'](handleError(_0x1a2ba9,null));};exports[_0x7f33('0x46')]=function(_0x4bcddf,_0x4d42cb){return db[_0x7f33('0x3e')][_0x7f33('0x46')](_0x4bcddf['body'],{})[_0x7f33('0x22')](respondWithResult(_0x4d42cb,0xc9))[_0x7f33('0x42')](handleError(_0x4d42cb,null));};exports['update']=function(_0x4a9739,_0x3859ea){if(_0x4a9739[_0x7f33('0x47')]['id']){delete _0x4a9739['body']['id'];}return db[_0x7f33('0x3e')]['find']({'where':{'id':_0x4a9739[_0x7f33('0x44')]['id']}})[_0x7f33('0x22')](handleEntityNotFound(_0x3859ea,null))[_0x7f33('0x22')](saveUpdates(_0x4a9739[_0x7f33('0x47')],null))[_0x7f33('0x22')](respondWithResult(_0x3859ea,null))[_0x7f33('0x42')](handleError(_0x3859ea,null));};exports['destroy']=function(_0x20ccd9,_0x57c776){return db[_0x7f33('0x3e')][_0x7f33('0x45')]({'where':{'id':_0x20ccd9['params']['id']}})[_0x7f33('0x22')](handleEntityNotFound(_0x57c776,null))[_0x7f33('0x22')](removeEntity(_0x57c776,null))['catch'](handleError(_0x57c776,null));}; \ No newline at end of file +var _0x4b74=['json','apply','reject','save','then','destroy','stack','name','send','index','map','ZendeskField','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','params','keys','includeAll','catch','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range'];(function(_0x4062b9,_0x16bcb1){var _0x106fea=function(_0x4d5cb3){while(--_0x4d5cb3){_0x4062b9['push'](_0x4062b9['shift']());}};_0x106fea(++_0x16bcb1);}(_0x4b74,0x111));var _0x44b7=function(_0x1d5c36,_0x3e35ba){_0x1d5c36=_0x1d5c36-0x0;var _0x52d00e=_0x4b74[_0x1d5c36];return _0x52d00e;};'use strict';var emlformat=require(_0x44b7('0x0'));var rimraf=require(_0x44b7('0x1'));var zipdir=require(_0x44b7('0x2'));var jsonpatch=require(_0x44b7('0x3'));var rp=require(_0x44b7('0x4'));var moment=require(_0x44b7('0x5'));var BPromise=require(_0x44b7('0x6'));var Mustache=require(_0x44b7('0x7'));var util=require(_0x44b7('0x8'));var path=require(_0x44b7('0x9'));var sox=require(_0x44b7('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b7('0xb'));var _=require(_0x44b7('0xc'));var squel=require(_0x44b7('0xd'));var crypto=require(_0x44b7('0xe'));var jsforce=require(_0x44b7('0xf'));var deskjs=require(_0x44b7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x44b7('0x11'));var authService=require(_0x44b7('0x12'));var qs=require(_0x44b7('0x13'));var as=require(_0x44b7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x44b7('0x15'));var utils=require(_0x44b7('0x16'));var config=require(_0x44b7('0x17'));var licenseUtil=require(_0x44b7('0x18'));var db=require(_0x44b7('0x19'))['db'];function respondWithStatusCode(_0x4a6c54,_0x38f2f5){_0x38f2f5=_0x38f2f5||0xcc;return function(_0x1f18b5){if(_0x1f18b5){return _0x4a6c54[_0x44b7('0x1a')](_0x38f2f5);}return _0x4a6c54['status'](_0x38f2f5)[_0x44b7('0x1b')]();};}function respondWithResult(_0x3f635b,_0x31417e){_0x31417e=_0x31417e||0xc8;return function(_0x335123){if(_0x335123){return _0x3f635b[_0x44b7('0x1c')](_0x31417e)['json'](_0x335123);}};}function respondWithFilteredResult(_0x524229,_0x10d5c9){return function(_0x1370a3){if(_0x1370a3){var _0x58c8d7=typeof _0x10d5c9[_0x44b7('0x1d')]===_0x44b7('0x1e')&&typeof _0x10d5c9['limit']===_0x44b7('0x1e');var _0x3557c8=_0x1370a3[_0x44b7('0x1f')];var _0x41542e=_0x58c8d7?0x0:_0x10d5c9[_0x44b7('0x1d')];var _0xa0e71d=_0x58c8d7?_0x1370a3[_0x44b7('0x1f')]:_0x10d5c9[_0x44b7('0x1d')]+_0x10d5c9[_0x44b7('0x20')];var _0x1ef38f;if(_0xa0e71d>=_0x3557c8){_0xa0e71d=_0x3557c8;_0x1ef38f=0xc8;}else{_0x1ef38f=0xce;}_0x524229['status'](_0x1ef38f);return _0x524229[_0x44b7('0x21')](_0x44b7('0x22'),_0x41542e+'-'+_0xa0e71d+'/'+_0x3557c8)[_0x44b7('0x23')](_0x1370a3);}return null;};}function patchUpdates(_0x4b2a37){return function(_0x17842a){try{jsonpatch[_0x44b7('0x24')](_0x17842a,_0x4b2a37,!![]);}catch(_0x3ab41f){return BPromise[_0x44b7('0x25')](_0x3ab41f);}return _0x17842a[_0x44b7('0x26')]();};}function saveUpdates(_0x3f2dfd,_0xe3f082){return function(_0x3b37c3){if(_0x3b37c3){return _0x3b37c3['update'](_0x3f2dfd)[_0x44b7('0x27')](function(_0x4e6ab3){return _0x4e6ab3;});}return null;};}function removeEntity(_0x4cb04c,_0xd5cc41){return function(_0x37088d){if(_0x37088d){return _0x37088d[_0x44b7('0x28')]()[_0x44b7('0x27')](function(){_0x4cb04c[_0x44b7('0x1c')](0xcc)[_0x44b7('0x1b')]();});}};}function handleEntityNotFound(_0xa8afd7,_0x318b6f){return function(_0xa0fb66){if(!_0xa0fb66){_0xa8afd7[_0x44b7('0x1a')](0x194);}return _0xa0fb66;};}function handleError(_0x7d7b3b,_0x3080b9){_0x3080b9=_0x3080b9||0x1f4;return function(_0x21e26f){logger['error'](_0x21e26f[_0x44b7('0x29')]);if(_0x21e26f[_0x44b7('0x2a')]){delete _0x21e26f[_0x44b7('0x2a')];}_0x7d7b3b[_0x44b7('0x1c')](_0x3080b9)[_0x44b7('0x2b')](_0x21e26f);};}exports[_0x44b7('0x2c')]=function(_0x3e138b,_0x59ae73){var _0x4433ff={},_0x56f890={},_0x3d6969={'count':0x0,'rows':[]};var _0x12ad31=_[_0x44b7('0x2d')](db[_0x44b7('0x2e')][_0x44b7('0x2f')],function(_0x468799){return{'name':_0x468799['fieldName'],'type':_0x468799['type']['key']};});_0x56f890[_0x44b7('0x30')]=_[_0x44b7('0x2d')](_0x12ad31,'name');_0x56f890[_0x44b7('0x31')]=_['keys'](_0x3e138b[_0x44b7('0x31')]);_0x56f890[_0x44b7('0x32')]=_[_0x44b7('0x33')](_0x56f890[_0x44b7('0x30')],_0x56f890[_0x44b7('0x31')]);_0x4433ff['attributes']=_[_0x44b7('0x33')](_0x56f890['model'],qs[_0x44b7('0x34')](_0x3e138b['query'][_0x44b7('0x34')]));_0x4433ff[_0x44b7('0x35')]=_0x4433ff[_0x44b7('0x35')][_0x44b7('0x36')]?_0x4433ff[_0x44b7('0x35')]:_0x56f890[_0x44b7('0x30')];if(!_0x3e138b[_0x44b7('0x31')][_0x44b7('0x37')](_0x44b7('0x38'))){_0x4433ff['limit']=qs[_0x44b7('0x20')](_0x3e138b[_0x44b7('0x31')]['limit']);_0x4433ff[_0x44b7('0x1d')]=qs['offset'](_0x3e138b[_0x44b7('0x31')][_0x44b7('0x1d')]);}_0x4433ff[_0x44b7('0x39')]=qs[_0x44b7('0x3a')](_0x3e138b[_0x44b7('0x31')][_0x44b7('0x3a')]);_0x4433ff[_0x44b7('0x3b')]=qs['filters'](_[_0x44b7('0x3c')](_0x3e138b[_0x44b7('0x31')],_0x56f890[_0x44b7('0x32')]),_0x12ad31);if(_0x3e138b[_0x44b7('0x31')][_0x44b7('0x3d')]){_0x4433ff[_0x44b7('0x3b')]=_[_0x44b7('0x3e')](_0x4433ff['where'],{'$or':_[_0x44b7('0x2d')](_0x12ad31,function(_0x59930e){if(_0x59930e[_0x44b7('0x3f')]!==_0x44b7('0x40')){var _0x1579ae={};_0x1579ae[_0x59930e['name']]={'$like':'%'+_0x3e138b[_0x44b7('0x31')]['filter']+'%'};return _0x1579ae;}})});}_0x4433ff=_[_0x44b7('0x3e')]({},_0x4433ff,_0x3e138b[_0x44b7('0x41')]);var _0x38e653={'where':_0x4433ff[_0x44b7('0x3b')]};return db[_0x44b7('0x2e')][_0x44b7('0x1f')](_0x38e653)[_0x44b7('0x27')](function(_0x310bb0){_0x3d6969['count']=_0x310bb0;if(_0x3e138b[_0x44b7('0x31')]['includeAll']){_0x4433ff[_0x44b7('0x42')]=[{'all':!![]}];}return db[_0x44b7('0x2e')][_0x44b7('0x43')](_0x4433ff);})[_0x44b7('0x27')](function(_0x37c07e){_0x3d6969['rows']=_0x37c07e;return _0x3d6969;})[_0x44b7('0x27')](respondWithFilteredResult(_0x59ae73,_0x4433ff))['catch'](handleError(_0x59ae73,null));};exports[_0x44b7('0x44')]=function(_0x44f320,_0x479cb4){var _0x3fe76f={'raw':!![],'where':{'id':_0x44f320[_0x44b7('0x45')]['id']}},_0xc3a653={};_0xc3a653[_0x44b7('0x30')]=_[_0x44b7('0x46')](db['ZendeskField'][_0x44b7('0x2f')]);_0xc3a653[_0x44b7('0x31')]=_[_0x44b7('0x46')](_0x44f320[_0x44b7('0x31')]);_0xc3a653[_0x44b7('0x32')]=_[_0x44b7('0x33')](_0xc3a653['model'],_0xc3a653[_0x44b7('0x31')]);_0x3fe76f[_0x44b7('0x35')]=_[_0x44b7('0x33')](_0xc3a653[_0x44b7('0x30')],qs['fields'](_0x44f320['query'][_0x44b7('0x34')]));_0x3fe76f[_0x44b7('0x35')]=_0x3fe76f[_0x44b7('0x35')][_0x44b7('0x36')]?_0x3fe76f['attributes']:_0xc3a653['model'];if(_0x44f320['query'][_0x44b7('0x47')]){_0x3fe76f[_0x44b7('0x42')]=[{'all':!![]}];}_0x3fe76f=_[_0x44b7('0x3e')]({},_0x3fe76f,_0x44f320[_0x44b7('0x41')]);return db[_0x44b7('0x2e')]['find'](_0x3fe76f)['then'](handleEntityNotFound(_0x479cb4,null))[_0x44b7('0x27')](respondWithResult(_0x479cb4,null))[_0x44b7('0x48')](handleError(_0x479cb4,null));};exports[_0x44b7('0x49')]=function(_0x3770e8,_0x1c5e6f){return db[_0x44b7('0x2e')][_0x44b7('0x49')](_0x3770e8[_0x44b7('0x4a')],{})['then'](respondWithResult(_0x1c5e6f,0xc9))[_0x44b7('0x48')](handleError(_0x1c5e6f,null));};exports[_0x44b7('0x4b')]=function(_0x35e043,_0x1631cf){if(_0x35e043['body']['id']){delete _0x35e043[_0x44b7('0x4a')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x35e043[_0x44b7('0x45')]['id']}})[_0x44b7('0x27')](handleEntityNotFound(_0x1631cf,null))[_0x44b7('0x27')](saveUpdates(_0x35e043[_0x44b7('0x4a')],null))[_0x44b7('0x27')](respondWithResult(_0x1631cf,null))[_0x44b7('0x48')](handleError(_0x1631cf,null));};exports[_0x44b7('0x28')]=function(_0x402617,_0x505011){return db['ZendeskField'][_0x44b7('0x4c')]({'where':{'id':_0x402617[_0x44b7('0x45')]['id']}})[_0x44b7('0x27')](handleEntityNotFound(_0x505011,null))[_0x44b7('0x27')](removeEntity(_0x505011,null))[_0x44b7('0x48')](handleError(_0x505011,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index a6da4f5..3be3337 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 _0x9c50=['path','rimraf','./intZendeskField.attributes','ZendeskField','zendesk_unique_index','idField','lodash','util','api','request-promise'];(function(_0x350b82,_0x5bc7a2){var _0x2d2d36=function(_0x55fb10){while(--_0x55fb10){_0x350b82['push'](_0x350b82['shift']());}};_0x2d2d36(++_0x5bc7a2);}(_0x9c50,0x18c));var _0x09c5=function(_0x202e67,_0x4c7339){_0x202e67=_0x202e67-0x0;var _0x226a63=_0x9c50[_0x202e67];return _0x226a63;};'use strict';var _=require(_0x09c5('0x0'));var util=require(_0x09c5('0x1'));var logger=require('../../config/logger')(_0x09c5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x09c5('0x3'));var fs=require('fs');var path=require(_0x09c5('0x4'));var rimraf=require(_0x09c5('0x5'));var config=require('../../config/environment');var attributes=require(_0x09c5('0x6'));module['exports']=function(_0x1985b8,_0x3c864b){return _0x1985b8['define'](_0x09c5('0x7'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x09c5('0x8'),'fields':[_0x09c5('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa01f=['lodash','api','moment','bluebird','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x4ab440,_0x36e5a){var _0x1d44ac=function(_0x18563b){while(--_0x18563b){_0x4ab440['push'](_0x4ab440['shift']());}};_0x1d44ac(++_0x36e5a);}(_0xa01f,0x186));var _0xfa01=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xa01f[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xfa01('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfa01('0x1'));var moment=require(_0xfa01('0x2'));var BPromise=require(_0xfa01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfa01('0x4'));var config=require(_0xfa01('0x5'));var attributes=require(_0xfa01('0x6'));module[_0xfa01('0x7')]=function(_0x1a0861,_0x417f13){return _0x1a0861[_0xfa01('0x8')](_0xfa01('0x9'),attributes,{'tableName':_0xfa01('0xa'),'paranoid':![],'indexes':[{'name':_0xfa01('0xb'),'fields':[_0xfa01('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 b6f37c8..b568585 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 _0x9f33=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x9f33,0x1e1));var _0x39f3=function(_0x3bd9cb,_0x57c7ed){_0x3bd9cb=_0x3bd9cb-0x0;var _0x221a8f=_0x9f33[_0x3bd9cb];return _0x221a8f;};'use strict';var _=require(_0x39f3('0x0'));var util=require(_0x39f3('0x1'));var moment=require(_0x39f3('0x2'));var BPromise=require(_0x39f3('0x3'));var rs=require(_0x39f3('0x4'));var fs=require('fs');var Redis=require(_0x39f3('0x5'));var db=require(_0x39f3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x39f3('0x7'))(_0x39f3('0x8'));var config=require(_0x39f3('0x9'));var jayson=require(_0x39f3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25d256,_0x5bd88b,_0x4dcfdc){return new BPromise(function(_0xc10450,_0x40d076){return client[_0x39f3('0xb')](_0x25d256,_0x4dcfdc)[_0x39f3('0xc')](function(_0x502e71){logger[_0x39f3('0xd')](_0x39f3('0xe'),_0x5bd88b,'request\x20sent');logger[_0x39f3('0xf')](_0x39f3('0x10'),_0x5bd88b,_0x39f3('0x11'),JSON['stringify'](_0x502e71));if(_0x502e71[_0x39f3('0x12')]){if(_0x502e71[_0x39f3('0x12')][_0x39f3('0x13')]===0x1f4){logger[_0x39f3('0x12')](_0x39f3('0xe'),_0x5bd88b,_0x502e71[_0x39f3('0x12')]['message']);return _0x40d076(_0x502e71[_0x39f3('0x12')][_0x39f3('0x14')]);}logger[_0x39f3('0x12')]('ZendeskField,\x20%s,\x20%s',_0x5bd88b,_0x502e71['error'][_0x39f3('0x14')]);return _0xc10450(_0x502e71[_0x39f3('0x12')][_0x39f3('0x14')]);}else{logger[_0x39f3('0xd')](_0x39f3('0xe'),_0x5bd88b,_0x39f3('0x11'));_0xc10450(_0x502e71['result'][_0x39f3('0x14')]);}})['catch'](function(_0x36f96d){logger[_0x39f3('0x12')](_0x39f3('0xe'),_0x5bd88b,_0x36f96d);_0x40d076(_0x36f96d);});});} \ No newline at end of file +var _0x39af=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x485701,_0x7f0974){var _0x299bf8=function(_0x4393aa){while(--_0x4393aa){_0x485701['push'](_0x485701['shift']());}};_0x299bf8(++_0x7f0974);}(_0x39af,0x71));var _0xf39a=function(_0xc83573,_0x379370){_0xc83573=_0xc83573-0x0;var _0x4856e0=_0x39af[_0xc83573];return _0x4856e0;};'use strict';var _=require('lodash');var util=require(_0xf39a('0x0'));var moment=require('moment');var BPromise=require(_0xf39a('0x1'));var rs=require(_0xf39a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf39a('0x3'))['db'];var utils=require(_0xf39a('0x4'));var logger=require(_0xf39a('0x5'))('rpc');var config=require(_0xf39a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf39a('0x7')][_0xf39a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47642f,_0x32535d,_0x6c226a){return new BPromise(function(_0x20a1a7,_0x4bc761){return client[_0xf39a('0x9')](_0x47642f,_0x6c226a)['then'](function(_0x351e39){logger[_0xf39a('0xa')](_0xf39a('0xb'),_0x32535d,_0xf39a('0xc'));logger[_0xf39a('0xd')](_0xf39a('0xe'),_0x32535d,'request\x20sent',JSON[_0xf39a('0xf')](_0x351e39));if(_0x351e39[_0xf39a('0x10')]){if(_0x351e39[_0xf39a('0x10')][_0xf39a('0x11')]===0x1f4){logger[_0xf39a('0x10')](_0xf39a('0xb'),_0x32535d,_0x351e39['error'][_0xf39a('0x12')]);return _0x4bc761(_0x351e39[_0xf39a('0x10')]['message']);}logger[_0xf39a('0x10')](_0xf39a('0xb'),_0x32535d,_0x351e39['error'][_0xf39a('0x12')]);return _0x20a1a7(_0x351e39[_0xf39a('0x10')][_0xf39a('0x12')]);}else{logger['info'](_0xf39a('0xb'),_0x32535d,_0xf39a('0xc'));_0x20a1a7(_0x351e39[_0xf39a('0x13')][_0xf39a('0x12')]);}})[_0xf39a('0x14')](function(_0x1b436e){logger[_0xf39a('0x10')](_0xf39a('0xb'),_0x32535d,_0x1b436e);_0x4bc761(_0x1b436e);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 4c691f1..62b1b96 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 _0x2dec=['isAuthenticated','getFields','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','index','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x11362b,_0x3f1927){var _0x46d24d=function(_0x3feeff){while(--_0x3feeff){_0x11362b['push'](_0x11362b['shift']());}};_0x46d24d(++_0x3f1927);}(_0x2dec,0xda));var _0xc2de=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0x2dec[_0x540133];return _0x26b6e9;};'use strict';var multer=require(_0xc2de('0x0'));var util=require(_0xc2de('0x1'));var path=require(_0xc2de('0x2'));var timeout=require(_0xc2de('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc2de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc2de('0x5'));var config=require(_0xc2de('0x6'));var controller=require('./intZohoAccount.controller');router[_0xc2de('0x7')]('/',auth['isAuthenticated'](),controller[_0xc2de('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc2de('0x9')]);router[_0xc2de('0x7')](_0xc2de('0xa'),auth['isAuthenticated'](),controller[_0xc2de('0xb')]);router[_0xc2de('0x7')](_0xc2de('0xc'),auth[_0xc2de('0xd')](),controller[_0xc2de('0xe')]);router[_0xc2de('0xf')]('/',auth[_0xc2de('0xd')](),controller['create']);router[_0xc2de('0xf')]('/:id/configurations',auth[_0xc2de('0xd')](),controller['addConfiguration']);router[_0xc2de('0x10')](_0xc2de('0x11'),auth[_0xc2de('0xd')](),controller[_0xc2de('0x12')]);router[_0xc2de('0x13')](_0xc2de('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xc2de('0x14')]=router; \ No newline at end of file +var _0x15b6=['/:id/fields','getFields','post','create','update','/:id','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations'];(function(_0x43fa62,_0x3cff47){var _0x30fbf8=function(_0x52136a){while(--_0x52136a){_0x43fa62['push'](_0x43fa62['shift']());}};_0x30fbf8(++_0x3cff47);}(_0x15b6,0x1aa));var _0x615b=function(_0x37af90,_0x3fe010){_0x37af90=_0x37af90-0x0;var _0x51a27d=_0x15b6[_0x37af90];return _0x51a27d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x615b('0x0'));var timeout=require(_0x615b('0x1'));var express=require(_0x615b('0x2'));var router=express[_0x615b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x615b('0x4'));var interaction=require(_0x615b('0x5'));var config=require(_0x615b('0x6'));var controller=require(_0x615b('0x7'));router[_0x615b('0x8')]('/',auth[_0x615b('0x9')](),controller[_0x615b('0xa')]);router[_0x615b('0x8')]('/:id',auth[_0x615b('0x9')](),controller[_0x615b('0xb')]);router[_0x615b('0x8')](_0x615b('0xc'),auth[_0x615b('0x9')](),controller[_0x615b('0xd')]);router[_0x615b('0x8')](_0x615b('0xe'),auth['isAuthenticated'](),controller[_0x615b('0xf')]);router[_0x615b('0x10')]('/',auth[_0x615b('0x9')](),controller[_0x615b('0x11')]);router['post']('/:id/configurations',auth[_0x615b('0x9')](),controller['addConfiguration']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x615b('0x12')]);router['delete'](_0x615b('0x13'),auth[_0x615b('0x9')](),controller[_0x615b('0x14')]);module[_0x615b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index ca347e6..a922c7a 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 _0x41bb=['exports','STRING','sequelize'];(function(_0x4deff,_0x42c328){var _0x440123=function(_0x2d7dde){while(--_0x2d7dde){_0x4deff['push'](_0x4deff['shift']());}};_0x440123(++_0x42c328);}(_0x41bb,0xc5));var _0xb41b=function(_0x3c9817,_0x3a5e94){_0x3c9817=_0x3c9817-0x0;var _0x57b25b=_0x41bb[_0x3c9817];return _0x57b25b;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file +var _0x9bde=['STRING','exports'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0x9bde,0xe1));var _0xe9bd=function(_0x104b31,_0x5de982){_0x104b31=_0x104b31-0x0;var _0xbacd69=_0x9bde[_0x104b31];return _0xbacd69;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9bd('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xe9bd('0x1')]},'clientId':{'type':Sequelize[_0xe9bd('0x1')]},'clientSecret':{'type':Sequelize[_0xe9bd('0x1')]},'serverUrl':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe9bd('0x1')]},'refreshToken':{'type':Sequelize[_0xe9bd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 25e5c54..ec3bf90 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 _0x5ea2=['Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','serverUrl','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','picklist','pick_list_values','statusCode','stringify','test','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoAccount','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','sort','where','filter','VIRTUAL','merge','includeAll','include','catch','show','params','rawAttributes','options','create','body','update','find','pick','hasOwnProperty','nolimit','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','refresh_token','access_token'];(function(_0x588d8c,_0x43e6fe){var _0x35189c=function(_0x416cf5){while(--_0x416cf5){_0x588d8c['push'](_0x588d8c['shift']());}};_0x35189c(++_0x43e6fe);}(_0x5ea2,0x99));var _0x25ea=function(_0x1b27ca,_0x1292a5){_0x1b27ca=_0x1b27ca-0x0;var _0x1f276b=_0x5ea2[_0x1b27ca];return _0x1f276b;};'use strict';var emlformat=require(_0x25ea('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x25ea('0x1'));var rp=require(_0x25ea('0x2'));var moment=require(_0x25ea('0x3'));var BPromise=require(_0x25ea('0x4'));var Mustache=require(_0x25ea('0x5'));var util=require('util');var path=require(_0x25ea('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25ea('0x7'));var fs=require('fs');var fs_extra=require(_0x25ea('0x8'));var _=require(_0x25ea('0x9'));var squel=require(_0x25ea('0xa'));var crypto=require(_0x25ea('0xb'));var jsforce=require(_0x25ea('0xc'));var deskjs=require(_0x25ea('0xd'));var toCsv=require(_0x25ea('0xe'));var querystring=require(_0x25ea('0xf'));var Papa=require('papaparse');var Redis=require(_0x25ea('0x10'));var authService=require(_0x25ea('0x11'));var qs=require(_0x25ea('0x12'));var as=require(_0x25ea('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x25ea('0x14'))(_0x25ea('0x15'));var utils=require(_0x25ea('0x16'));var config=require(_0x25ea('0x17'));var licenseUtil=require(_0x25ea('0x18'));var db=require(_0x25ea('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5e1059,_0x138c9a){_0x138c9a=_0x138c9a||0xcc;return function(_0x1bdef2){if(_0x1bdef2){return _0x5e1059['sendStatus'](_0x138c9a);}return _0x5e1059[_0x25ea('0x1a')](_0x138c9a)[_0x25ea('0x1b')]();};}function respondWithResult(_0x1e247c,_0x190d5a){_0x190d5a=_0x190d5a||0xc8;return function(_0x41b47d){if(_0x41b47d){return _0x1e247c[_0x25ea('0x1a')](_0x190d5a)['json'](_0x41b47d);}};}function respondWithFilteredResult(_0x16c2e8,_0x81c080){return function(_0x4c60a0){if(_0x4c60a0){var _0x4705bc=typeof _0x81c080[_0x25ea('0x1c')]===_0x25ea('0x1d')&&typeof _0x81c080[_0x25ea('0x1e')]===_0x25ea('0x1d');var _0x3f8335=_0x4c60a0['count'];var _0x29878b=_0x4705bc?0x0:_0x81c080[_0x25ea('0x1c')];var _0x3b327e=_0x4705bc?_0x4c60a0[_0x25ea('0x1f')]:_0x81c080[_0x25ea('0x1c')]+_0x81c080[_0x25ea('0x1e')];var _0x43dee7;if(_0x3b327e>=_0x3f8335){_0x3b327e=_0x3f8335;_0x43dee7=0xc8;}else{_0x43dee7=0xce;}_0x16c2e8['status'](_0x43dee7);return _0x16c2e8[_0x25ea('0x20')](_0x25ea('0x21'),_0x29878b+'-'+_0x3b327e+'/'+_0x3f8335)['json'](_0x4c60a0);}return null;};}function patchUpdates(_0x13884d){return function(_0x58d927){try{jsonpatch['apply'](_0x58d927,_0x13884d,!![]);}catch(_0x3be0a2){return BPromise['reject'](_0x3be0a2);}return _0x58d927[_0x25ea('0x22')]();};}function saveUpdates(_0x3fdde6,_0x445100){return function(_0x3d1d2b){if(_0x3d1d2b){return _0x3d1d2b['update'](_0x3fdde6)[_0x25ea('0x23')](function(_0x35fee2){return _0x35fee2;});}return null;};}function removeEntity(_0xf34d84,_0x4ee5e6){return function(_0x2e98f9){if(_0x2e98f9){return _0x2e98f9[_0x25ea('0x24')]()['then'](function(){_0xf34d84[_0x25ea('0x1a')](0xcc)[_0x25ea('0x1b')]();});}};}function handleEntityNotFound(_0x5b9780,_0x260e8a){return function(_0x104361){if(!_0x104361){_0x5b9780[_0x25ea('0x25')](0x194);}return _0x104361;};}function handleError(_0x39de65,_0x20c65b){_0x20c65b=_0x20c65b||0x1f4;return function(_0xe63b85){logger[_0x25ea('0x26')](_0xe63b85[_0x25ea('0x27')]);if(_0xe63b85[_0x25ea('0x28')]){delete _0xe63b85[_0x25ea('0x28')];}_0x39de65[_0x25ea('0x1a')](_0x20c65b)[_0x25ea('0x29')](_0xe63b85);};}exports[_0x25ea('0x2a')]=function(_0x55020d,_0x4cb7a5){var _0x3599c3={},_0x21c4fc={},_0x576f56={'count':0x0,'rows':[]};var _0x1869d0=_[_0x25ea('0x2b')](db[_0x25ea('0x2c')]['rawAttributes'],function(_0x54459c){return{'name':_0x54459c[_0x25ea('0x2d')],'type':_0x54459c[_0x25ea('0x2e')]['key']};});_0x21c4fc[_0x25ea('0x2f')]=_[_0x25ea('0x2b')](_0x1869d0,'name');_0x21c4fc[_0x25ea('0x30')]=_[_0x25ea('0x31')](_0x55020d[_0x25ea('0x30')]);_0x21c4fc[_0x25ea('0x32')]=_['intersection'](_0x21c4fc[_0x25ea('0x2f')],_0x21c4fc['query']);_0x3599c3[_0x25ea('0x33')]=_[_0x25ea('0x34')](_0x21c4fc[_0x25ea('0x2f')],qs[_0x25ea('0x35')](_0x55020d['query']['fields']));_0x3599c3[_0x25ea('0x33')]=_0x3599c3['attributes'][_0x25ea('0x36')]?_0x3599c3[_0x25ea('0x33')]:_0x21c4fc['model'];if(!_0x55020d[_0x25ea('0x30')]['hasOwnProperty']('nolimit')){_0x3599c3[_0x25ea('0x1e')]=qs[_0x25ea('0x1e')](_0x55020d[_0x25ea('0x30')][_0x25ea('0x1e')]);_0x3599c3[_0x25ea('0x1c')]=qs[_0x25ea('0x1c')](_0x55020d['query']['offset']);}_0x3599c3['order']=qs[_0x25ea('0x37')](_0x55020d[_0x25ea('0x30')][_0x25ea('0x37')]);_0x3599c3[_0x25ea('0x38')]=qs[_0x25ea('0x32')](_['pick'](_0x55020d[_0x25ea('0x30')],_0x21c4fc[_0x25ea('0x32')]),_0x1869d0);if(_0x55020d[_0x25ea('0x30')][_0x25ea('0x39')]){_0x3599c3[_0x25ea('0x38')]=_['merge'](_0x3599c3[_0x25ea('0x38')],{'$or':_[_0x25ea('0x2b')](_0x1869d0,function(_0x349eb5){if(_0x349eb5[_0x25ea('0x2e')]!==_0x25ea('0x3a')){var _0x380ea1={};_0x380ea1[_0x349eb5[_0x25ea('0x28')]]={'$like':'%'+_0x55020d[_0x25ea('0x30')][_0x25ea('0x39')]+'%'};return _0x380ea1;}})});}_0x3599c3=_[_0x25ea('0x3b')]({},_0x3599c3,_0x55020d['options']);var _0x31f4d6={'where':_0x3599c3[_0x25ea('0x38')]};return db[_0x25ea('0x2c')][_0x25ea('0x1f')](_0x31f4d6)[_0x25ea('0x23')](function(_0x2c8eb4){_0x576f56[_0x25ea('0x1f')]=_0x2c8eb4;if(_0x55020d[_0x25ea('0x30')][_0x25ea('0x3c')]){_0x3599c3[_0x25ea('0x3d')]=[{'all':!![]}];}return db[_0x25ea('0x2c')]['findAll'](_0x3599c3);})[_0x25ea('0x23')](function(_0xafd268){_0x576f56['rows']=_0xafd268;return _0x576f56;})[_0x25ea('0x23')](respondWithFilteredResult(_0x4cb7a5,_0x3599c3))[_0x25ea('0x3e')](handleError(_0x4cb7a5,null));};exports[_0x25ea('0x3f')]=function(_0xf5cb77,_0x62acdb){var _0x307cc8={'raw':![],'where':{'id':_0xf5cb77[_0x25ea('0x40')]['id']}},_0x2cb146={};_0x2cb146[_0x25ea('0x2f')]=_[_0x25ea('0x31')](db[_0x25ea('0x2c')][_0x25ea('0x41')]);_0x2cb146[_0x25ea('0x30')]=_[_0x25ea('0x31')](_0xf5cb77[_0x25ea('0x30')]);_0x2cb146['filters']=_[_0x25ea('0x34')](_0x2cb146[_0x25ea('0x2f')],_0x2cb146[_0x25ea('0x30')]);_0x307cc8[_0x25ea('0x33')]=_[_0x25ea('0x34')](_0x2cb146[_0x25ea('0x2f')],qs[_0x25ea('0x35')](_0xf5cb77[_0x25ea('0x30')][_0x25ea('0x35')]));_0x307cc8['attributes']=_0x307cc8[_0x25ea('0x33')]['length']?_0x307cc8[_0x25ea('0x33')]:_0x2cb146[_0x25ea('0x2f')];if(_0xf5cb77[_0x25ea('0x30')][_0x25ea('0x3c')]){_0x307cc8[_0x25ea('0x3d')]=[{'all':!![]}];}_0x307cc8=_[_0x25ea('0x3b')]({},_0x307cc8,_0xf5cb77[_0x25ea('0x42')]);return db[_0x25ea('0x2c')]['find'](_0x307cc8)[_0x25ea('0x23')](handleEntityNotFound(_0x62acdb,null))['then'](respondWithResult(_0x62acdb,null))[_0x25ea('0x3e')](handleError(_0x62acdb,null));};exports[_0x25ea('0x43')]=function(_0x2e2ec6,_0x2e82a0){return db[_0x25ea('0x2c')][_0x25ea('0x43')](_0x2e2ec6[_0x25ea('0x44')],{})['then'](respondWithResult(_0x2e82a0,0xc9))[_0x25ea('0x3e')](handleError(_0x2e82a0,null));};exports[_0x25ea('0x45')]=function(_0x517fb0,_0x21dd22){if(_0x517fb0['body']['id']){delete _0x517fb0[_0x25ea('0x44')]['id'];}return db[_0x25ea('0x2c')][_0x25ea('0x46')]({'where':{'id':_0x517fb0[_0x25ea('0x40')]['id']}})[_0x25ea('0x23')](handleEntityNotFound(_0x21dd22,null))['then'](saveUpdates(_0x517fb0['body'],null))[_0x25ea('0x23')](respondWithResult(_0x21dd22,null))[_0x25ea('0x3e')](handleError(_0x21dd22,null));};exports[_0x25ea('0x24')]=function(_0x2e8d3c,_0x1dcf6a){return db[_0x25ea('0x2c')][_0x25ea('0x46')]({'where':{'id':_0x2e8d3c[_0x25ea('0x40')]['id']}})[_0x25ea('0x23')](handleEntityNotFound(_0x1dcf6a,null))[_0x25ea('0x23')](removeEntity(_0x1dcf6a,null))['catch'](handleError(_0x1dcf6a,null));};exports['getConfigurations']=function(_0x2b7ff4,_0x3a1bef,_0x5859ae){var _0x32c1f3={};var _0x150385={};var _0x4b015a;var _0x5588ef;return db[_0x25ea('0x2c')]['findOne']({'where':{'id':_0x2b7ff4[_0x25ea('0x40')]['id']}})[_0x25ea('0x23')](handleEntityNotFound(_0x3a1bef,null))[_0x25ea('0x23')](function(_0x9edb78){if(_0x9edb78){_0x4b015a=_0x9edb78;_0x150385[_0x25ea('0x2f')]=_['keys'](db['ZohoConfiguration'][_0x25ea('0x41')]);_0x150385['query']=_[_0x25ea('0x31')](_0x2b7ff4[_0x25ea('0x30')]);_0x150385[_0x25ea('0x32')]=_['intersection'](_0x150385[_0x25ea('0x2f')],_0x150385[_0x25ea('0x30')]);_0x32c1f3['attributes']=_[_0x25ea('0x34')](_0x150385[_0x25ea('0x2f')],qs[_0x25ea('0x35')](_0x2b7ff4['query']['fields']));_0x32c1f3[_0x25ea('0x33')]=_0x32c1f3['attributes'][_0x25ea('0x36')]?_0x32c1f3[_0x25ea('0x33')]:_0x150385[_0x25ea('0x2f')];_0x32c1f3['order']=qs[_0x25ea('0x37')](_0x2b7ff4[_0x25ea('0x30')][_0x25ea('0x37')]);_0x32c1f3[_0x25ea('0x38')]=qs[_0x25ea('0x32')](_[_0x25ea('0x47')](_0x2b7ff4['query'],_0x150385[_0x25ea('0x32')]));if(_0x2b7ff4['query']['filter']){_0x32c1f3[_0x25ea('0x38')]=_[_0x25ea('0x3b')](_0x32c1f3[_0x25ea('0x38')],{'$or':_[_0x25ea('0x2b')](_0x32c1f3[_0x25ea('0x33')],function(_0x2848e2){var _0x19b554={};_0x19b554[_0x2848e2]={'$like':'%'+_0x2b7ff4['query'][_0x25ea('0x39')]+'%'};return _0x19b554;})});}_0x32c1f3=_[_0x25ea('0x3b')]({},_0x32c1f3,_0x2b7ff4['options']);return _0x4b015a['getConfigurations'](_0x32c1f3);}})[_0x25ea('0x23')](function(_0x394841){if(_0x394841){_0x5588ef=_0x394841[_0x25ea('0x36')];if(!_0x2b7ff4['query'][_0x25ea('0x48')](_0x25ea('0x49'))){_0x32c1f3['limit']=qs[_0x25ea('0x1e')](_0x2b7ff4['query'][_0x25ea('0x1e')]);_0x32c1f3[_0x25ea('0x1c')]=qs[_0x25ea('0x1c')](_0x2b7ff4[_0x25ea('0x30')][_0x25ea('0x1c')]);}return _0x4b015a[_0x25ea('0x4a')](_0x32c1f3);}})[_0x25ea('0x23')](function(_0x3f04ad){if(_0x3f04ad){return _0x3f04ad?{'count':_0x5588ef,'rows':_0x3f04ad}:null;}})[_0x25ea('0x23')](respondWithResult(_0x3a1bef,null))[_0x25ea('0x3e')](handleError(_0x3a1bef,null));};exports[_0x25ea('0x4b')]=function(_0x40f790,_0x320a62,_0x36e097){if(_0x40f790[_0x25ea('0x44')]['id']){delete _0x40f790['body']['id'];}return db[_0x25ea('0x2c')][_0x25ea('0x4c')]({'where':{'id':_0x40f790[_0x25ea('0x40')]['id']}})[_0x25ea('0x23')](handleEntityNotFound(_0x320a62,null))[_0x25ea('0x23')](function(_0x2ae85d){if(_0x2ae85d){_0x40f790[_0x25ea('0x44')][_0x25ea('0x4d')]=_0x2ae85d['id'];_0x40f790[_0x25ea('0x44')][_0x25ea('0x4e')]=integrations[_0x25ea('0x4f')](_0x40f790[_0x25ea('0x44')][_0x25ea('0x50')],_0x40f790['body'][_0x25ea('0x2e')]);_0x40f790['body'][_0x25ea('0x51')]=integrations[_0x25ea('0x52')](_0x40f790[_0x25ea('0x44')][_0x25ea('0x50')],_0x40f790[_0x25ea('0x44')][_0x25ea('0x2e')]);return db[_0x25ea('0x53')]['create'](_0x40f790[_0x25ea('0x44')],{'include':[{'model':db[_0x25ea('0x54')],'as':_0x25ea('0x4e')},{'model':db[_0x25ea('0x54')],'as':_0x25ea('0x51')}]});}return null;})[_0x25ea('0x23')](respondWithResult(_0x320a62,null))[_0x25ea('0x3e')](handleError(_0x320a62,null));};function getAccessToken(_0x5897b4){return new Promise(function(_0x755f97,_0x5db6fe){var _0x4e605b;switch(_0x5897b4[_0x25ea('0x55')]){case'US':_0x4e605b='https://accounts.zoho.com';break;case'AU':_0x4e605b='https://accounts.zoho.com.au';break;case'EU':_0x4e605b='https://accounts.zoho.eu';break;case'IN':_0x4e605b=_0x25ea('0x56');break;case'CN':_0x4e605b=_0x25ea('0x57');break;default:_0x4e605b='https://accounts.zoho.eu';break;}var _0x100479={'method':_0x25ea('0x58'),'uri':_0x4e605b+'/oauth/v2/token','qs':{'refresh_token':_0x5897b4[_0x25ea('0x59')],'client_id':_0x5897b4[_0x25ea('0x5a')],'client_secret':_0x5897b4['clientSecret'],'grant_type':_0x25ea('0x5b')},'json':!![]};return rp(_0x100479)[_0x25ea('0x23')](function(_0x13dc42){if(_0x13dc42[_0x25ea('0x5c')]){_0x755f97(_0x13dc42[_0x25ea('0x5c')]);}else{_0x5db6fe(_0x25ea('0x5d'));}})['catch'](function(_0x3ef892){_0x5db6fe(_0x3ef892);});});}exports[_0x25ea('0x5e')]=function(_0x1f8643,_0x549a12,_0x36fac2){var _0x44f2df,_0xfa3099,_0x2a7d0b,_0x23411d,_0x2c9965;return db[_0x25ea('0x2c')][_0x25ea('0x4c')]({'where':{'id':_0x1f8643[_0x25ea('0x40')]['id']},'attributes':['id',_0x25ea('0x5f'),'zone',_0x25ea('0x5a'),_0x25ea('0x60'),_0x25ea('0x61'),'code','refreshToken']})[_0x25ea('0x23')](handleEntityNotFound(_0x549a12,null))['then'](function(_0x391696){_0x2c9965=_0x391696;_0x44f2df=_0x2c9965[_0x25ea('0x5f')];_0xfa3099=_0x44f2df==='zoho.eu'?'eu':_0x25ea('0x62');_0x2a7d0b=_0x2c9965[_0x25ea('0x61')];var _0x421abe=_0x2a7d0b['slice'](-0x1);if(_0x421abe==='/'||_0x421abe==='\x5c'||_0x421abe===':'){_0x2a7d0b=_0x2a7d0b[_0x25ea('0x63')](0x0,_0x2a7d0b[_0x25ea('0x64')](_0x421abe));}if(!_0x2c9965['refreshToken']){throw new Error(_0x25ea('0x65'));}return getAccessToken(_0x2c9965);})[_0x25ea('0x23')](function(_0x3b051d){if(_0x3b051d){return rp({'method':'GET','uri':util[_0x25ea('0x66')](_0x25ea('0x67'),_0xfa3099),'qs':{'module':'Calls'},'headers':{'Authorization':_0x25ea('0x68')+_0x3b051d},'json':!![]});}})[_0x25ea('0x23')](function(_0x5e452a){if(_0x5e452a){if(_0x5e452a[_0x25ea('0x69')]&&_0x5e452a[_0x25ea('0x69')][_0x25ea('0x26')]){throw new Error(_0x5e452a[_0x25ea('0x69')][_0x25ea('0x26')]['message']);}var _0x35d9bb=[];var _0x347294=[];var _0x6b0912=['Owner',_0x25ea('0x6a'),_0x25ea('0x6b'),_0x25ea('0x6c'),_0x25ea('0x6d'),_0x25ea('0x6e'),_0x25ea('0x6f'),_0x25ea('0x70')];_0x347294=_[_0x25ea('0x71')](_0x5e452a[_0x25ea('0x35')],function(_0x32d2f1){return _0x6b0912[_0x25ea('0x72')](_0x32d2f1[_0x25ea('0x73')]);});for(var _0x17abf5=0x0;_0x17abf5<_0x347294[_0x25ea('0x36')];_0x17abf5++){if(_0x347294[_0x17abf5][_0x25ea('0x74')]===![]){_0x35d9bb[_0x25ea('0x75')]({'id':_0x347294[_0x17abf5]['id'],'name':_0x347294[_0x17abf5]['display_label'],'custom':_0x347294[_0x17abf5]['custom_field'],'options':_0x347294[_0x17abf5]['data_type']===_0x25ea('0x76')&&_0x347294[_0x17abf5][_0x25ea('0x77')][_0x25ea('0x36')]>-0x1?_['map'](_0x347294[_0x17abf5][_0x25ea('0x77')],function(_0x57575f){return{'name':_0x57575f,'value':_0x57575f};}):[]});}}return{'count':_0x35d9bb[_0x25ea('0x36')],'rows':_0x35d9bb};}else{return{'count':0x0,'rows':[]};}})[_0x25ea('0x23')](respondWithResult(_0x549a12,null))[_0x25ea('0x3e')](function(_0x2728f8){var _0xc24832=_0x1f8643[_0x25ea('0x30')]['test']?0x1f4:_0x2728f8[_0x25ea('0x78')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x25ea('0x5e'),_0xc24832,JSON[_0x25ea('0x79')](_0x2728f8));delete _0x2728f8[_0x25ea('0x28')];if(_0xc24832===0x191){_0xc24832=0x190;}_0x549a12[_0x25ea('0x1a')](_0xc24832)['send'](_0x1f8643[_0x25ea('0x30')][_0x25ea('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x2728f8[_0x25ea('0x78')]}:_0x2728f8);});}; \ No newline at end of file +var _0xfd8f=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','findOne','code','host','zoho.eu','serverUrl','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x4fdbc3,_0x2aa95d){var _0x4bfbbc=function(_0x1f198e){while(--_0x1f198e){_0x4fdbc3['push'](_0x4fdbc3['shift']());}};_0x4bfbbc(++_0x2aa95d);}(_0xfd8f,0x76));var _0xffd8=function(_0xa34ef6,_0x252618){_0xa34ef6=_0xa34ef6-0x0;var _0x3dff5f=_0xfd8f[_0xa34ef6];return _0x3dff5f;};'use strict';var emlformat=require(_0xffd8('0x0'));var rimraf=require(_0xffd8('0x1'));var zipdir=require(_0xffd8('0x2'));var jsonpatch=require(_0xffd8('0x3'));var rp=require(_0xffd8('0x4'));var moment=require(_0xffd8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xffd8('0x6'));var util=require(_0xffd8('0x7'));var path=require(_0xffd8('0x8'));var sox=require(_0xffd8('0x9'));var csv=require(_0xffd8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffd8('0xb'));var squel=require(_0xffd8('0xc'));var crypto=require(_0xffd8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xffd8('0xe'));var toCsv=require(_0xffd8('0xa'));var querystring=require(_0xffd8('0xf'));var Papa=require(_0xffd8('0x10'));var Redis=require(_0xffd8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xffd8('0x12'));var as=require(_0xffd8('0x13'));var hardwareService=require(_0xffd8('0x14'));var logger=require(_0xffd8('0x15'))(_0xffd8('0x16'));var utils=require(_0xffd8('0x17'));var config=require(_0xffd8('0x18'));var licenseUtil=require(_0xffd8('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xffd8('0x1a'));function respondWithStatusCode(_0x4a5046,_0x3ecb05){_0x3ecb05=_0x3ecb05||0xcc;return function(_0x8703b7){if(_0x8703b7){return _0x4a5046['sendStatus'](_0x3ecb05);}return _0x4a5046[_0xffd8('0x1b')](_0x3ecb05)[_0xffd8('0x1c')]();};}function respondWithResult(_0x4c9a9e,_0x5d8bf1){_0x5d8bf1=_0x5d8bf1||0xc8;return function(_0x1ff9fd){if(_0x1ff9fd){return _0x4c9a9e[_0xffd8('0x1b')](_0x5d8bf1)[_0xffd8('0x1d')](_0x1ff9fd);}};}function respondWithFilteredResult(_0xed1e34,_0x28c404){return function(_0x455a17){if(_0x455a17){var _0x24d7c3=typeof _0x28c404[_0xffd8('0x1e')]===_0xffd8('0x1f')&&typeof _0x28c404[_0xffd8('0x20')]==='undefined';var _0x25e012=_0x455a17['count'];var _0x3ffffb=_0x24d7c3?0x0:_0x28c404['offset'];var _0x1c61ab=_0x24d7c3?_0x455a17[_0xffd8('0x21')]:_0x28c404[_0xffd8('0x1e')]+_0x28c404[_0xffd8('0x20')];var _0x1e6c92;if(_0x1c61ab>=_0x25e012){_0x1c61ab=_0x25e012;_0x1e6c92=0xc8;}else{_0x1e6c92=0xce;}_0xed1e34['status'](_0x1e6c92);return _0xed1e34[_0xffd8('0x22')](_0xffd8('0x23'),_0x3ffffb+'-'+_0x1c61ab+'/'+_0x25e012)[_0xffd8('0x1d')](_0x455a17);}return null;};}function patchUpdates(_0x5228d3){return function(_0x371df4){try{jsonpatch[_0xffd8('0x24')](_0x371df4,_0x5228d3,!![]);}catch(_0x1bc151){return BPromise['reject'](_0x1bc151);}return _0x371df4[_0xffd8('0x25')]();};}function saveUpdates(_0x56ec38,_0x4ad965){return function(_0x16c77f){if(_0x16c77f){return _0x16c77f[_0xffd8('0x26')](_0x56ec38)[_0xffd8('0x27')](function(_0x1e7e4f){return _0x1e7e4f;});}return null;};}function removeEntity(_0x566895,_0x2a6bc3){return function(_0x33e633){if(_0x33e633){return _0x33e633[_0xffd8('0x28')]()[_0xffd8('0x27')](function(){_0x566895[_0xffd8('0x1b')](0xcc)[_0xffd8('0x1c')]();});}};}function handleEntityNotFound(_0x227f34,_0x111eef){return function(_0x235345){if(!_0x235345){_0x227f34[_0xffd8('0x29')](0x194);}return _0x235345;};}function handleError(_0x2396d9,_0x4e7ab2){_0x4e7ab2=_0x4e7ab2||0x1f4;return function(_0xd61d0b){logger[_0xffd8('0x2a')](_0xd61d0b[_0xffd8('0x2b')]);if(_0xd61d0b['name']){delete _0xd61d0b[_0xffd8('0x2c')];}_0x2396d9[_0xffd8('0x1b')](_0x4e7ab2)['send'](_0xd61d0b);};}exports[_0xffd8('0x2d')]=function(_0x16aec6,_0x4f9fd0){var _0x418e0d={},_0x27f1a6={},_0x6945b2={'count':0x0,'rows':[]};var _0x587f2d=_[_0xffd8('0x2e')](db['ZohoAccount'][_0xffd8('0x2f')],function(_0x1ae06c){return{'name':_0x1ae06c[_0xffd8('0x30')],'type':_0x1ae06c[_0xffd8('0x31')][_0xffd8('0x32')]};});_0x27f1a6[_0xffd8('0x33')]=_['map'](_0x587f2d,'name');_0x27f1a6[_0xffd8('0x34')]=_[_0xffd8('0x35')](_0x16aec6[_0xffd8('0x34')]);_0x27f1a6[_0xffd8('0x36')]=_[_0xffd8('0x37')](_0x27f1a6[_0xffd8('0x33')],_0x27f1a6[_0xffd8('0x34')]);_0x418e0d[_0xffd8('0x38')]=_[_0xffd8('0x37')](_0x27f1a6[_0xffd8('0x33')],qs['fields'](_0x16aec6['query'][_0xffd8('0x39')]));_0x418e0d[_0xffd8('0x38')]=_0x418e0d[_0xffd8('0x38')][_0xffd8('0x3a')]?_0x418e0d['attributes']:_0x27f1a6['model'];if(!_0x16aec6[_0xffd8('0x34')]['hasOwnProperty'](_0xffd8('0x3b'))){_0x418e0d[_0xffd8('0x20')]=qs[_0xffd8('0x20')](_0x16aec6[_0xffd8('0x34')][_0xffd8('0x20')]);_0x418e0d[_0xffd8('0x1e')]=qs[_0xffd8('0x1e')](_0x16aec6['query'][_0xffd8('0x1e')]);}_0x418e0d['order']=qs[_0xffd8('0x3c')](_0x16aec6[_0xffd8('0x34')][_0xffd8('0x3c')]);_0x418e0d[_0xffd8('0x3d')]=qs[_0xffd8('0x36')](_['pick'](_0x16aec6['query'],_0x27f1a6[_0xffd8('0x36')]),_0x587f2d);if(_0x16aec6['query'][_0xffd8('0x3e')]){_0x418e0d['where']=_[_0xffd8('0x3f')](_0x418e0d[_0xffd8('0x3d')],{'$or':_[_0xffd8('0x2e')](_0x587f2d,function(_0x2e6e25){if(_0x2e6e25[_0xffd8('0x31')]!==_0xffd8('0x40')){var _0x342629={};_0x342629[_0x2e6e25[_0xffd8('0x2c')]]={'$like':'%'+_0x16aec6[_0xffd8('0x34')][_0xffd8('0x3e')]+'%'};return _0x342629;}})});}_0x418e0d=_[_0xffd8('0x3f')]({},_0x418e0d,_0x16aec6[_0xffd8('0x41')]);var _0xe2de29={'where':_0x418e0d[_0xffd8('0x3d')]};return db[_0xffd8('0x42')][_0xffd8('0x21')](_0xe2de29)[_0xffd8('0x27')](function(_0x3a9539){_0x6945b2[_0xffd8('0x21')]=_0x3a9539;if(_0x16aec6[_0xffd8('0x34')][_0xffd8('0x43')]){_0x418e0d[_0xffd8('0x44')]=[{'all':!![]}];}return db[_0xffd8('0x42')][_0xffd8('0x45')](_0x418e0d);})[_0xffd8('0x27')](function(_0x3f7742){_0x6945b2[_0xffd8('0x46')]=_0x3f7742;return _0x6945b2;})[_0xffd8('0x27')](respondWithFilteredResult(_0x4f9fd0,_0x418e0d))[_0xffd8('0x47')](handleError(_0x4f9fd0,null));};exports[_0xffd8('0x48')]=function(_0x408a33,_0x594354){var _0x18868a={'raw':![],'where':{'id':_0x408a33[_0xffd8('0x49')]['id']}},_0x4a0a6f={};_0x4a0a6f[_0xffd8('0x33')]=_['keys'](db[_0xffd8('0x42')][_0xffd8('0x2f')]);_0x4a0a6f[_0xffd8('0x34')]=_['keys'](_0x408a33['query']);_0x4a0a6f[_0xffd8('0x36')]=_[_0xffd8('0x37')](_0x4a0a6f[_0xffd8('0x33')],_0x4a0a6f[_0xffd8('0x34')]);_0x18868a[_0xffd8('0x38')]=_[_0xffd8('0x37')](_0x4a0a6f[_0xffd8('0x33')],qs[_0xffd8('0x39')](_0x408a33[_0xffd8('0x34')][_0xffd8('0x39')]));_0x18868a[_0xffd8('0x38')]=_0x18868a[_0xffd8('0x38')]['length']?_0x18868a[_0xffd8('0x38')]:_0x4a0a6f[_0xffd8('0x33')];if(_0x408a33[_0xffd8('0x34')][_0xffd8('0x43')]){_0x18868a[_0xffd8('0x44')]=[{'all':!![]}];}_0x18868a=_[_0xffd8('0x3f')]({},_0x18868a,_0x408a33[_0xffd8('0x41')]);return db[_0xffd8('0x42')][_0xffd8('0x4a')](_0x18868a)['then'](handleEntityNotFound(_0x594354,null))[_0xffd8('0x27')](respondWithResult(_0x594354,null))[_0xffd8('0x47')](handleError(_0x594354,null));};exports[_0xffd8('0x4b')]=function(_0x3594c7,_0xcc3735){return db['ZohoAccount']['create'](_0x3594c7[_0xffd8('0x4c')],{})[_0xffd8('0x27')](respondWithResult(_0xcc3735,0xc9))['catch'](handleError(_0xcc3735,null));};exports[_0xffd8('0x26')]=function(_0x51b5bf,_0x88f24b){if(_0x51b5bf[_0xffd8('0x4c')]['id']){delete _0x51b5bf[_0xffd8('0x4c')]['id'];}return db[_0xffd8('0x42')][_0xffd8('0x4a')]({'where':{'id':_0x51b5bf[_0xffd8('0x49')]['id']}})['then'](handleEntityNotFound(_0x88f24b,null))['then'](saveUpdates(_0x51b5bf[_0xffd8('0x4c')],null))[_0xffd8('0x27')](respondWithResult(_0x88f24b,null))[_0xffd8('0x47')](handleError(_0x88f24b,null));};exports[_0xffd8('0x28')]=function(_0x2d1f3,_0x37938e){return db['ZohoAccount'][_0xffd8('0x4a')]({'where':{'id':_0x2d1f3[_0xffd8('0x49')]['id']}})[_0xffd8('0x27')](handleEntityNotFound(_0x37938e,null))[_0xffd8('0x27')](removeEntity(_0x37938e,null))[_0xffd8('0x47')](handleError(_0x37938e,null));};exports[_0xffd8('0x4d')]=function(_0x50a921,_0x1bbfce,_0x316668){var _0x28e12a={};var _0x2231c2={};var _0x55f0d2;var _0x5e85bb;return db[_0xffd8('0x42')]['findOne']({'where':{'id':_0x50a921[_0xffd8('0x49')]['id']}})['then'](handleEntityNotFound(_0x1bbfce,null))[_0xffd8('0x27')](function(_0x4bba83){if(_0x4bba83){_0x55f0d2=_0x4bba83;_0x2231c2[_0xffd8('0x33')]=_[_0xffd8('0x35')](db['ZohoConfiguration'][_0xffd8('0x2f')]);_0x2231c2[_0xffd8('0x34')]=_[_0xffd8('0x35')](_0x50a921[_0xffd8('0x34')]);_0x2231c2[_0xffd8('0x36')]=_[_0xffd8('0x37')](_0x2231c2[_0xffd8('0x33')],_0x2231c2[_0xffd8('0x34')]);_0x28e12a[_0xffd8('0x38')]=_['intersection'](_0x2231c2['model'],qs[_0xffd8('0x39')](_0x50a921[_0xffd8('0x34')][_0xffd8('0x39')]));_0x28e12a['attributes']=_0x28e12a[_0xffd8('0x38')][_0xffd8('0x3a')]?_0x28e12a[_0xffd8('0x38')]:_0x2231c2['model'];_0x28e12a[_0xffd8('0x4e')]=qs[_0xffd8('0x3c')](_0x50a921[_0xffd8('0x34')][_0xffd8('0x3c')]);_0x28e12a[_0xffd8('0x3d')]=qs[_0xffd8('0x36')](_['pick'](_0x50a921['query'],_0x2231c2[_0xffd8('0x36')]));if(_0x50a921[_0xffd8('0x34')]['filter']){_0x28e12a['where']=_[_0xffd8('0x3f')](_0x28e12a[_0xffd8('0x3d')],{'$or':_[_0xffd8('0x2e')](_0x28e12a[_0xffd8('0x38')],function(_0x2b02ba){var _0x195380={};_0x195380[_0x2b02ba]={'$like':'%'+_0x50a921[_0xffd8('0x34')][_0xffd8('0x3e')]+'%'};return _0x195380;})});}_0x28e12a=_['merge']({},_0x28e12a,_0x50a921[_0xffd8('0x41')]);return _0x55f0d2[_0xffd8('0x4d')](_0x28e12a);}})['then'](function(_0x49b09c){if(_0x49b09c){_0x5e85bb=_0x49b09c[_0xffd8('0x3a')];if(!_0x50a921[_0xffd8('0x34')][_0xffd8('0x4f')](_0xffd8('0x3b'))){_0x28e12a['limit']=qs[_0xffd8('0x20')](_0x50a921[_0xffd8('0x34')]['limit']);_0x28e12a['offset']=qs[_0xffd8('0x1e')](_0x50a921[_0xffd8('0x34')][_0xffd8('0x1e')]);}return _0x55f0d2[_0xffd8('0x4d')](_0x28e12a);}})[_0xffd8('0x27')](function(_0x464124){if(_0x464124){return _0x464124?{'count':_0x5e85bb,'rows':_0x464124}:null;}})[_0xffd8('0x27')](respondWithResult(_0x1bbfce,null))[_0xffd8('0x47')](handleError(_0x1bbfce,null));};exports[_0xffd8('0x50')]=function(_0x3ce590,_0x12bdba,_0xb37c9a){if(_0x3ce590[_0xffd8('0x4c')]['id']){delete _0x3ce590[_0xffd8('0x4c')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x3ce590[_0xffd8('0x49')]['id']}})[_0xffd8('0x27')](handleEntityNotFound(_0x12bdba,null))['then'](function(_0x22fcc4){if(_0x22fcc4){_0x3ce590['body'][_0xffd8('0x51')]=_0x22fcc4['id'];_0x3ce590[_0xffd8('0x4c')][_0xffd8('0x52')]=integrations[_0xffd8('0x53')](_0x3ce590[_0xffd8('0x4c')][_0xffd8('0x54')],_0x3ce590[_0xffd8('0x4c')][_0xffd8('0x31')]);_0x3ce590[_0xffd8('0x4c')][_0xffd8('0x55')]=integrations[_0xffd8('0x56')](_0x3ce590['body'][_0xffd8('0x54')],_0x3ce590['body'][_0xffd8('0x31')]);return db[_0xffd8('0x57')][_0xffd8('0x4b')](_0x3ce590[_0xffd8('0x4c')],{'include':[{'model':db[_0xffd8('0x58')],'as':_0xffd8('0x52')},{'model':db[_0xffd8('0x58')],'as':_0xffd8('0x55')}]});}return null;})['then'](respondWithResult(_0x12bdba,null))[_0xffd8('0x47')](handleError(_0x12bdba,null));};function getAccessToken(_0x23a55f){return new Promise(function(_0x3ea40c,_0x5cd8b9){var _0x4ba480;switch(_0x23a55f[_0xffd8('0x59')]){case'US':_0x4ba480=_0xffd8('0x5a');break;case'AU':_0x4ba480=_0xffd8('0x5b');break;case'EU':_0x4ba480=_0xffd8('0x5c');break;case'IN':_0x4ba480=_0xffd8('0x5d');break;case'CN':_0x4ba480=_0xffd8('0x5e');break;default:_0x4ba480=_0xffd8('0x5c');break;}var _0xe83af8={'method':_0xffd8('0x5f'),'uri':_0x4ba480+'/oauth/v2/token','qs':{'refresh_token':_0x23a55f[_0xffd8('0x60')],'client_id':_0x23a55f[_0xffd8('0x61')],'client_secret':_0x23a55f[_0xffd8('0x62')],'grant_type':_0xffd8('0x63')},'json':!![]};return rp(_0xe83af8)[_0xffd8('0x27')](function(_0x286031){if(_0x286031['access_token']){_0x3ea40c(_0x286031[_0xffd8('0x64')]);}else{_0x5cd8b9(_0xffd8('0x65'));}})[_0xffd8('0x47')](function(_0x28f9da){_0x5cd8b9(_0x28f9da);});});}exports[_0xffd8('0x66')]=function(_0x1115c0,_0x495242,_0x57eb57){var _0x1b2bb3,_0x28096f,_0x149fc9,_0x324907,_0x2c14a5;return db[_0xffd8('0x42')][_0xffd8('0x67')]({'where':{'id':_0x1115c0[_0xffd8('0x49')]['id']},'attributes':['id','host',_0xffd8('0x59'),_0xffd8('0x61'),_0xffd8('0x62'),'serverUrl',_0xffd8('0x68'),_0xffd8('0x60')]})['then'](handleEntityNotFound(_0x495242,null))[_0xffd8('0x27')](function(_0x37685b){_0x2c14a5=_0x37685b;_0x1b2bb3=_0x2c14a5[_0xffd8('0x69')];_0x28096f=_0x1b2bb3===_0xffd8('0x6a')?'eu':'com';_0x149fc9=_0x2c14a5[_0xffd8('0x6b')];var _0x36a46b=_0x149fc9[_0xffd8('0x6c')](-0x1);if(_0x36a46b==='/'||_0x36a46b==='\x5c'||_0x36a46b===':'){_0x149fc9=_0x149fc9[_0xffd8('0x6d')](0x0,_0x149fc9['lastIndexOf'](_0x36a46b));}if(!_0x2c14a5[_0xffd8('0x60')]){throw new Error(_0xffd8('0x6e'));}return getAccessToken(_0x2c14a5);})['then'](function(_0x2f3f3c){if(_0x2f3f3c){return rp({'method':_0xffd8('0x6f'),'uri':util[_0xffd8('0x70')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x28096f),'qs':{'module':_0xffd8('0x71')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2f3f3c},'json':!![]});}})[_0xffd8('0x27')](function(_0x4a7fe2){if(_0x4a7fe2){if(_0x4a7fe2[_0xffd8('0x72')]&&_0x4a7fe2[_0xffd8('0x72')][_0xffd8('0x2a')]){throw new Error(_0x4a7fe2[_0xffd8('0x72')][_0xffd8('0x2a')][_0xffd8('0x73')]);}var _0x2b4f56=[];var _0x643963=[];var _0x1e9382=[_0xffd8('0x74'),_0xffd8('0x75'),_0xffd8('0x76'),'WhoId',_0xffd8('0x77'),_0xffd8('0x78'),_0xffd8('0x79'),_0xffd8('0x7a')];_0x643963=_[_0xffd8('0x7b')](_0x4a7fe2['fields'],function(_0x168eb9){return _0x1e9382[_0xffd8('0x7c')](_0x168eb9['api_name']);});for(var _0x3ba99e=0x0;_0x3ba99e<_0x643963[_0xffd8('0x3a')];_0x3ba99e++){if(_0x643963[_0x3ba99e][_0xffd8('0x7d')]===![]){_0x2b4f56[_0xffd8('0x7e')]({'id':_0x643963[_0x3ba99e]['id'],'name':_0x643963[_0x3ba99e][_0xffd8('0x7f')],'custom':_0x643963[_0x3ba99e][_0xffd8('0x80')],'options':_0x643963[_0x3ba99e][_0xffd8('0x81')]==='picklist'&&_0x643963[_0x3ba99e][_0xffd8('0x82')][_0xffd8('0x3a')]>-0x1?_['map'](_0x643963[_0x3ba99e][_0xffd8('0x82')],function(_0x3fd37d){return{'name':_0x3fd37d,'value':_0x3fd37d};}):[]});}}return{'count':_0x2b4f56['length'],'rows':_0x2b4f56};}else{return{'count':0x0,'rows':[]};}})[_0xffd8('0x27')](respondWithResult(_0x495242,null))[_0xffd8('0x47')](function(_0xa85b7f){var _0x119771=_0x1115c0[_0xffd8('0x34')]['test']?0x1f4:_0xa85b7f[_0xffd8('0x83')]||0x1f4;logger[_0xffd8('0x2a')](_0xffd8('0x84'),_0xffd8('0x66'),_0x119771,JSON[_0xffd8('0x85')](_0xa85b7f));delete _0xa85b7f['name'];if(_0x119771===0x191){_0x119771=0x190;}_0x495242['status'](_0x119771)[_0xffd8('0x86')](_0x1115c0[_0xffd8('0x34')][_0xffd8('0x87')]?{'message':_0xffd8('0x88'),'statusCode':_0xa85b7f[_0xffd8('0x83')]}:_0xa85b7f);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 596d8f0..ba1f2e3 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 _0x3ea4=['clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','format','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','name','https://accounts.zoho.com','info','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','ZohoAccount','int_zoho_accounts','zone','serverUrl','changed','clientId'];(function(_0x10acc2,_0x381818){var _0x5159f0=function(_0x272676){while(--_0x272676){_0x10acc2['push'](_0x10acc2['shift']());}};_0x5159f0(++_0x381818);}(_0x3ea4,0x18a));var _0x43ea=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x3ea4[_0x5538d5];return _0x323b1a;};'use strict';var _=require(_0x43ea('0x0'));var util=require(_0x43ea('0x1'));var logger=require(_0x43ea('0x2'))('api');var moment=require(_0x43ea('0x3'));var BPromise=require(_0x43ea('0x4'));var rp=require(_0x43ea('0x5'));var fs=require('fs');var path=require(_0x43ea('0x6'));var rimraf=require(_0x43ea('0x7'));var config=require(_0x43ea('0x8'));var attributes=require(_0x43ea('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4e34ea,_0x317eb7){return _0x4e34ea['define'](_0x43ea('0xa'),attributes,{'tableName':_0x43ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x29f8de,_0x4cb813,_0x44d4f1){if(_0x29f8de['changed'](_0x43ea('0xc'))||_0x29f8de['changed'](_0x43ea('0xd'))||_0x29f8de[_0x43ea('0xe')](_0x43ea('0xf'))||_0x29f8de[_0x43ea('0xe')](_0x43ea('0x10'))||_0x29f8de['changed'](_0x43ea('0x11'))||_0x29f8de[_0x43ea('0xe')](_0x43ea('0x12'))){var _0x1ea827,_0x46e401;_0x1ea827=_0x29f8de[_0x43ea('0xd')];var _0x5a00de=_0x1ea827[_0x43ea('0x13')](-0x1);if(_0x5a00de==='/'||_0x5a00de==='\x5c'||_0x5a00de===':'){_0x1ea827=_0x1ea827[_0x43ea('0x14')](0x0,_0x1ea827[_0x43ea('0x15')](_0x5a00de));}switch(_0x29f8de['zone']){case'US':_0x46e401='https://accounts.zoho.com';break;case'AU':_0x46e401=_0x43ea('0x16');break;case'IN':_0x46e401=_0x43ea('0x17');break;case'CN':_0x46e401=_0x43ea('0x18');break;default:_0x46e401=_0x43ea('0x19');break;}var _0xd55419={'method':_0x43ea('0x1a'),'uri':_0x46e401+_0x43ea('0x1b'),'form':{'grant_type':_0x43ea('0x1c'),'client_id':_0x29f8de['clientId'],'client_secret':_0x29f8de[_0x43ea('0x10')],'redirect_uri':_0x29f8de[_0x43ea('0xd')],'code':_0x29f8de[_0x43ea('0x11')]},'headers':{'Content-Type':_0x43ea('0x1d')}};return rp(_0xd55419)[_0x43ea('0x1e')](function(_0x485931){var _0x2f16ac=JSON['parse'](_0x485931);if(_0x2f16ac[_0x43ea('0x1f')]){_0x29f8de[_0x43ea('0x20')]=_0x2f16ac['refresh_token'];logger['info'](util[_0x43ea('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x29f8de['name'],_0x29f8de['id']));}else{logger[_0x43ea('0x22')](util[_0x43ea('0x21')](_0x43ea('0x23'),_0x29f8de['name'],_0x29f8de['id']),util[_0x43ea('0x24')](_0x2f16ac,{'showHidden':![],'depth':null}));}return _0x44d4f1(null,_0x4cb813);})[_0x43ea('0x25')](function(_0x8673fe){logger[_0x43ea('0x22')](util[_0x43ea('0x21')](_0x43ea('0x23'),_0x29f8de[_0x43ea('0x26')],_0x29f8de['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x44d4f1(_0x8673fe);});}else{return _0x44d4f1(null,_0x4cb813);}},'beforeUpdate':function(_0x2f9eb2,_0x1e7442,_0x457f29){if(_0x2f9eb2[_0x43ea('0xe')](_0x43ea('0xc'))||_0x2f9eb2['changed']('serverUrl')||_0x2f9eb2[_0x43ea('0xe')](_0x43ea('0xf'))||_0x2f9eb2[_0x43ea('0xe')]('clientSecret')||_0x2f9eb2[_0x43ea('0xe')](_0x43ea('0x11'))||_0x2f9eb2['changed'](_0x43ea('0x12'))){var _0x564411,_0x2f3242;_0x564411=_0x2f9eb2[_0x43ea('0xd')];var _0x47987e=_0x564411[_0x43ea('0x13')](-0x1);if(_0x47987e==='/'||_0x47987e==='\x5c'||_0x47987e===':'){_0x564411=_0x564411['substring'](0x0,_0x564411[_0x43ea('0x15')](_0x47987e));}switch(_0x2f9eb2[_0x43ea('0xc')]){case'US':_0x2f3242=_0x43ea('0x27');break;case'AU':_0x2f3242=_0x43ea('0x16');break;case'IN':_0x2f3242=_0x43ea('0x17');break;case'CN':_0x2f3242=_0x43ea('0x18');break;default:_0x2f3242=_0x43ea('0x19');break;}var _0xc2090d={'method':_0x43ea('0x1a'),'uri':_0x2f3242+'/oauth/v2/token','form':{'grant_type':_0x43ea('0x1c'),'client_id':_0x2f9eb2['clientId'],'client_secret':_0x2f9eb2['clientSecret'],'redirect_uri':_0x2f9eb2[_0x43ea('0xd')],'code':_0x2f9eb2['code']},'headers':{'Content-Type':_0x43ea('0x1d')}};return rp(_0xc2090d)[_0x43ea('0x1e')](function(_0x2de514){var _0x25d9d3=JSON['parse'](_0x2de514);if(_0x25d9d3[_0x43ea('0x1f')]){_0x2f9eb2[_0x43ea('0x20')]=_0x25d9d3['refresh_token'];logger[_0x43ea('0x28')](util[_0x43ea('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2f9eb2[_0x43ea('0x26')],_0x2f9eb2['id']));}else{logger[_0x43ea('0x22')](util[_0x43ea('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2f9eb2[_0x43ea('0x26')],_0x2f9eb2['id']),util[_0x43ea('0x24')](_0x25d9d3,{'showHidden':![],'depth':null}));}return _0x457f29(null,_0x1e7442);})[_0x43ea('0x25')](function(_0x548d5a){logger[_0x43ea('0x22')](util[_0x43ea('0x21')](_0x43ea('0x23'),_0x2f9eb2[_0x43ea('0x26')],_0x2f9eb2['id']),util[_0x43ea('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x457f29(_0x548d5a);});}else{return _0x457f29(null,_0x1e7442);}}}});}; \ No newline at end of file +var _0x6f57=['then','parse','refreshToken','refresh_token','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','zone','slice','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','serverUrl','clientId','changed','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','clientSecret','code','application/x-www-form-urlencoded'];(function(_0x4194d6,_0x3ab3e5){var _0x33ddab=function(_0x43ceb7){while(--_0x43ceb7){_0x4194d6['push'](_0x4194d6['shift']());}};_0x33ddab(++_0x3ab3e5);}(_0x6f57,0x171));var _0x76f5=function(_0x5777da,_0x16a7f6){_0x5777da=_0x5777da-0x0;var _0x36f031=_0x6f57[_0x5777da];return _0x36f031;};'use strict';var _=require(_0x76f5('0x0'));var util=require(_0x76f5('0x1'));var logger=require('../../config/logger')(_0x76f5('0x2'));var moment=require(_0x76f5('0x3'));var BPromise=require('bluebird');var rp=require(_0x76f5('0x4'));var fs=require('fs');var path=require(_0x76f5('0x5'));var rimraf=require(_0x76f5('0x6'));var config=require(_0x76f5('0x7'));var attributes=require(_0x76f5('0x8'));var integrations=require(_0x76f5('0x9'));module['exports']=function(_0x4ee091,_0x2f402e){return _0x4ee091[_0x76f5('0xa')](_0x76f5('0xb'),attributes,{'tableName':_0x76f5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b3648,_0x119217,_0x3af3a1){if(_0x2b3648['changed']('zone')||_0x2b3648['changed'](_0x76f5('0xd'))||_0x2b3648['changed'](_0x76f5('0xe'))||_0x2b3648[_0x76f5('0xf')]('clientSecret')||_0x2b3648[_0x76f5('0xf')]('code')||_0x2b3648[_0x76f5('0xf')](_0x76f5('0x10'))){var _0x51930b,_0x38a5ae;_0x51930b=_0x2b3648[_0x76f5('0xd')];var _0x216005=_0x51930b['slice'](-0x1);if(_0x216005==='/'||_0x216005==='\x5c'||_0x216005===':'){_0x51930b=_0x51930b[_0x76f5('0x11')](0x0,_0x51930b[_0x76f5('0x12')](_0x216005));}switch(_0x2b3648['zone']){case'US':_0x38a5ae=_0x76f5('0x13');break;case'AU':_0x38a5ae='https://accounts.zoho.com.au';break;case'IN':_0x38a5ae=_0x76f5('0x14');break;case'CN':_0x38a5ae=_0x76f5('0x15');break;default:_0x38a5ae='https://accounts.zoho.eu';break;}var _0x2c44ff={'method':'POST','uri':_0x38a5ae+_0x76f5('0x16'),'form':{'grant_type':_0x76f5('0x17'),'client_id':_0x2b3648[_0x76f5('0xe')],'client_secret':_0x2b3648[_0x76f5('0x18')],'redirect_uri':_0x2b3648[_0x76f5('0xd')],'code':_0x2b3648[_0x76f5('0x19')]},'headers':{'Content-Type':_0x76f5('0x1a')}};return rp(_0x2c44ff)[_0x76f5('0x1b')](function(_0x336e82){var _0x4feb25=JSON[_0x76f5('0x1c')](_0x336e82);if(_0x4feb25['refresh_token']){_0x2b3648[_0x76f5('0x1d')]=_0x4feb25[_0x76f5('0x1e')];logger[_0x76f5('0x1f')](util[_0x76f5('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2b3648[_0x76f5('0x21')],_0x2b3648['id']));}else{logger[_0x76f5('0x22')](util['format'](_0x76f5('0x23'),_0x2b3648[_0x76f5('0x21')],_0x2b3648['id']),util[_0x76f5('0x24')](_0x4feb25,{'showHidden':![],'depth':null}));}return _0x3af3a1(null,_0x119217);})[_0x76f5('0x25')](function(_0x2bd89f){logger[_0x76f5('0x22')](util[_0x76f5('0x20')](_0x76f5('0x23'),_0x2b3648[_0x76f5('0x21')],_0x2b3648['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x3af3a1(_0x2bd89f);});}else{return _0x3af3a1(null,_0x119217);}},'beforeUpdate':function(_0x4eb664,_0x36fb91,_0x193d09){if(_0x4eb664[_0x76f5('0xf')](_0x76f5('0x26'))||_0x4eb664['changed'](_0x76f5('0xd'))||_0x4eb664[_0x76f5('0xf')](_0x76f5('0xe'))||_0x4eb664[_0x76f5('0xf')]('clientSecret')||_0x4eb664[_0x76f5('0xf')](_0x76f5('0x19'))||_0x4eb664[_0x76f5('0xf')](_0x76f5('0x10'))){var _0x29d2e5,_0x53be60;_0x29d2e5=_0x4eb664[_0x76f5('0xd')];var _0x328f3c=_0x29d2e5[_0x76f5('0x27')](-0x1);if(_0x328f3c==='/'||_0x328f3c==='\x5c'||_0x328f3c===':'){_0x29d2e5=_0x29d2e5[_0x76f5('0x11')](0x0,_0x29d2e5[_0x76f5('0x12')](_0x328f3c));}switch(_0x4eb664[_0x76f5('0x26')]){case'US':_0x53be60=_0x76f5('0x13');break;case'AU':_0x53be60=_0x76f5('0x28');break;case'IN':_0x53be60=_0x76f5('0x14');break;case'CN':_0x53be60='https://accounts.zoho.com.cn';break;default:_0x53be60=_0x76f5('0x29');break;}var _0x103b79={'method':_0x76f5('0x2a'),'uri':_0x53be60+_0x76f5('0x16'),'form':{'grant_type':_0x76f5('0x17'),'client_id':_0x4eb664[_0x76f5('0xe')],'client_secret':_0x4eb664[_0x76f5('0x18')],'redirect_uri':_0x4eb664['serverUrl'],'code':_0x4eb664['code']},'headers':{'Content-Type':_0x76f5('0x1a')}};return rp(_0x103b79)[_0x76f5('0x1b')](function(_0x2d117b){var _0x3200d4=JSON[_0x76f5('0x1c')](_0x2d117b);if(_0x3200d4[_0x76f5('0x1e')]){_0x4eb664[_0x76f5('0x1d')]=_0x3200d4['refresh_token'];logger['info'](util['format'](_0x76f5('0x2b'),_0x4eb664[_0x76f5('0x21')],_0x4eb664['id']));}else{logger[_0x76f5('0x22')](util[_0x76f5('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4eb664['name'],_0x4eb664['id']),util['inspect'](_0x3200d4,{'showHidden':![],'depth':null}));}return _0x193d09(null,_0x36fb91);})['catch'](function(_0x28e0eb){logger[_0x76f5('0x22')](util['format'](_0x76f5('0x23'),_0x4eb664['name'],_0x4eb664['id']),util[_0x76f5('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x193d09(_0x28e0eb);});}else{return _0x193d09(null,_0x36fb91);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 81887e8..05f8794 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 _0xfff0=['model','info','GetZohoAccount','catch','ShowZohoAccount','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ZohoAccount','findAll','options','raw','attributes','include','map'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfff0,0x139));var _0x0fff=function(_0x46a0fd,_0x10ae4e){_0x46a0fd=_0x46a0fd-0x0;var _0x41e574=_0xfff0[_0x46a0fd];return _0x41e574;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});}exports['GetZohoAccount']=function(_0x48f36d){var _0x2337f=this;return new Promise(function(_0x606792,_0x46a02d){return db[_0x0fff('0x14')][_0x0fff('0x15')]({'raw':_0x48f36d[_0x0fff('0x16')]?_0x48f36d['options'][_0x0fff('0x17')]===undefined?!![]:![]:!![],'where':_0x48f36d[_0x0fff('0x16')]?_0x48f36d[_0x0fff('0x16')]['where']||null:null,'attributes':_0x48f36d['options']?_0x48f36d[_0x0fff('0x16')][_0x0fff('0x18')]||null:null,'limit':_0x48f36d[_0x0fff('0x16')]?_0x48f36d[_0x0fff('0x16')]['limit']||null:null,'include':_0x48f36d[_0x0fff('0x16')]?_0x48f36d[_0x0fff('0x16')][_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x48f36d[_0x0fff('0x16')][_0x0fff('0x19')],function(_0x580b8e){return{'model':db[_0x580b8e[_0x0fff('0x1b')]],'as':_0x580b8e['as'],'attributes':_0x580b8e[_0x0fff('0x18')],'include':_0x580b8e[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x580b8e[_0x0fff('0x19')],function(_0x23d9f8){return{'model':db[_0x23d9f8['model']],'as':_0x23d9f8['as'],'attributes':_0x23d9f8[_0x0fff('0x18')],'include':_0x23d9f8[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x23d9f8[_0x0fff('0x19')],function(_0x36d268){return{'model':db[_0x36d268[_0x0fff('0x1b')]],'as':_0x36d268['as'],'attributes':_0x36d268[_0x0fff('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0fff('0xa')](function(_0x44e54a){logger[_0x0fff('0x1c')](_0x0fff('0x1d'),_0x48f36d);logger[_0x0fff('0xd')]('GetZohoAccount',_0x48f36d,JSON[_0x0fff('0xf')](_0x44e54a));_0x606792(_0x44e54a);})[_0x0fff('0x1e')](function(_0x17ab6f){logger[_0x0fff('0x10')](_0x0fff('0x1d'),_0x17ab6f[_0x0fff('0x12')],_0x48f36d);_0x46a02d(_0x2337f['error'](0x1f4,_0x17ab6f[_0x0fff('0x12')]));});});};exports[_0x0fff('0x1f')]=function(_0x351102){var _0x48f1d1=this;return new Promise(function(_0x1016fa,_0x3fa6fc){return db['ZohoAccount'][_0x0fff('0x20')]({'raw':_0x351102[_0x0fff('0x16')]?_0x351102[_0x0fff('0x16')][_0x0fff('0x17')]===undefined?!![]:![]:!![],'where':_0x351102[_0x0fff('0x16')]?_0x351102[_0x0fff('0x16')][_0x0fff('0x21')]||null:null,'attributes':_0x351102[_0x0fff('0x16')]?_0x351102[_0x0fff('0x16')][_0x0fff('0x18')]||null:null,'include':_0x351102['options']?_0x351102[_0x0fff('0x16')][_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x351102[_0x0fff('0x16')][_0x0fff('0x19')],function(_0x5967dc){return{'model':db[_0x5967dc['model']],'as':_0x5967dc['as'],'attributes':_0x5967dc[_0x0fff('0x18')],'include':_0x5967dc[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x5967dc[_0x0fff('0x19')],function(_0x5c1797){return{'model':db[_0x5c1797[_0x0fff('0x1b')]],'as':_0x5c1797['as'],'attributes':_0x5c1797[_0x0fff('0x18')],'include':_0x5c1797[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x5c1797['include'],function(_0x36a233){return{'model':db[_0x36a233[_0x0fff('0x1b')]],'as':_0x36a233['as'],'attributes':_0x36a233[_0x0fff('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0fff('0xa')](function(_0x191369){logger[_0x0fff('0x1c')](_0x0fff('0x1f'),_0x351102);logger[_0x0fff('0xd')](_0x0fff('0x1f'),_0x351102,JSON[_0x0fff('0xf')](_0x191369));_0x1016fa(_0x191369);})[_0x0fff('0x1e')](function(_0xeea9a7){logger['error'](_0x0fff('0x1f'),_0xeea9a7[_0x0fff('0x12')],_0x351102);_0x3fa6fc(_0x48f1d1[_0x0fff('0x10')](0x1f4,_0xeea9a7[_0x0fff('0x12')]));});});}; \ No newline at end of file +var _0xcefd=['ShowZohoAccount','find','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','ZohoAccount','options','raw','where','attributes','limit','map','model','include','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcefd,0x1bd));var _0xdcef=function(_0x417383,_0x1d8a41){_0x417383=_0x417383-0x0;var _0x3ed230=_0xcefd[_0x417383];return _0x3ed230;};'use strict';var _=require('lodash');var util=require(_0xdcef('0x0'));var moment=require(_0xdcef('0x1'));var BPromise=require(_0xdcef('0x2'));var rs=require(_0xdcef('0x3'));var fs=require('fs');var Redis=require(_0xdcef('0x4'));var db=require(_0xdcef('0x5'))['db'];var utils=require(_0xdcef('0x6'));var logger=require('../../config/logger')(_0xdcef('0x7'));var config=require(_0xdcef('0x8'));var jayson=require(_0xdcef('0x9'));var client=jayson[_0xdcef('0xa')][_0xdcef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ba458,_0x3b9fec,_0x25dfd5){return new BPromise(function(_0x3dc2b0,_0x11a5a6){return client['request'](_0x4ba458,_0x25dfd5)[_0xdcef('0xc')](function(_0xbb7067){logger[_0xdcef('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x3b9fec,_0xdcef('0xe'));logger['debug'](_0xdcef('0xf'),_0x3b9fec,_0xdcef('0xe'),JSON[_0xdcef('0x10')](_0xbb7067));if(_0xbb7067[_0xdcef('0x11')]){if(_0xbb7067[_0xdcef('0x11')]['code']===0x1f4){logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0xbb7067['error'][_0xdcef('0x13')]);return _0x11a5a6(_0xbb7067['error'][_0xdcef('0x13')]);}logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0xbb7067[_0xdcef('0x11')]['message']);return _0x3dc2b0(_0xbb7067[_0xdcef('0x11')][_0xdcef('0x13')]);}else{logger['info'](_0xdcef('0x12'),_0x3b9fec,_0xdcef('0xe'));_0x3dc2b0(_0xbb7067[_0xdcef('0x14')]['message']);}})['catch'](function(_0x386368){logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0x386368);_0x11a5a6(_0x386368);});});}exports['GetZohoAccount']=function(_0x1a79f8){var _0x3e2df7=this;return new Promise(function(_0x4d97ae,_0x54cc61){return db[_0xdcef('0x15')]['findAll']({'raw':_0x1a79f8[_0xdcef('0x16')]?_0x1a79f8[_0xdcef('0x16')][_0xdcef('0x17')]===undefined?!![]:![]:!![],'where':_0x1a79f8[_0xdcef('0x16')]?_0x1a79f8[_0xdcef('0x16')][_0xdcef('0x18')]||null:null,'attributes':_0x1a79f8[_0xdcef('0x16')]?_0x1a79f8[_0xdcef('0x16')][_0xdcef('0x19')]||null:null,'limit':_0x1a79f8['options']?_0x1a79f8[_0xdcef('0x16')][_0xdcef('0x1a')]||null:null,'include':_0x1a79f8[_0xdcef('0x16')]?_0x1a79f8[_0xdcef('0x16')]['include']?_[_0xdcef('0x1b')](_0x1a79f8[_0xdcef('0x16')]['include'],function(_0x32eeac){return{'model':db[_0x32eeac[_0xdcef('0x1c')]],'as':_0x32eeac['as'],'attributes':_0x32eeac[_0xdcef('0x19')],'include':_0x32eeac[_0xdcef('0x1d')]?_['map'](_0x32eeac[_0xdcef('0x1d')],function(_0x4dc915){return{'model':db[_0x4dc915['model']],'as':_0x4dc915['as'],'attributes':_0x4dc915[_0xdcef('0x19')],'include':_0x4dc915[_0xdcef('0x1d')]?_[_0xdcef('0x1b')](_0x4dc915[_0xdcef('0x1d')],function(_0x27b6bb){return{'model':db[_0x27b6bb[_0xdcef('0x1c')]],'as':_0x27b6bb['as'],'attributes':_0x27b6bb[_0xdcef('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdcef('0xc')](function(_0x38e03f){logger[_0xdcef('0xd')]('GetZohoAccount',_0x1a79f8);logger[_0xdcef('0x1e')]('GetZohoAccount',_0x1a79f8,JSON[_0xdcef('0x10')](_0x38e03f));_0x4d97ae(_0x38e03f);})['catch'](function(_0x3dfcc8){logger['error']('GetZohoAccount',_0x3dfcc8[_0xdcef('0x13')],_0x1a79f8);_0x54cc61(_0x3e2df7[_0xdcef('0x11')](0x1f4,_0x3dfcc8[_0xdcef('0x13')]));});});};exports[_0xdcef('0x1f')]=function(_0x23f68e){var _0x538866=this;return new Promise(function(_0x4952e1,_0x58849e){return db[_0xdcef('0x15')][_0xdcef('0x20')]({'raw':_0x23f68e[_0xdcef('0x16')]?_0x23f68e[_0xdcef('0x16')][_0xdcef('0x17')]===undefined?!![]:![]:!![],'where':_0x23f68e[_0xdcef('0x16')]?_0x23f68e['options'][_0xdcef('0x18')]||null:null,'attributes':_0x23f68e[_0xdcef('0x16')]?_0x23f68e[_0xdcef('0x16')]['attributes']||null:null,'include':_0x23f68e[_0xdcef('0x16')]?_0x23f68e[_0xdcef('0x16')]['include']?_[_0xdcef('0x1b')](_0x23f68e['options'][_0xdcef('0x1d')],function(_0x3c71a8){return{'model':db[_0x3c71a8[_0xdcef('0x1c')]],'as':_0x3c71a8['as'],'attributes':_0x3c71a8[_0xdcef('0x19')],'include':_0x3c71a8[_0xdcef('0x1d')]?_['map'](_0x3c71a8['include'],function(_0x51d1aa){return{'model':db[_0x51d1aa[_0xdcef('0x1c')]],'as':_0x51d1aa['as'],'attributes':_0x51d1aa[_0xdcef('0x19')],'include':_0x51d1aa[_0xdcef('0x1d')]?_[_0xdcef('0x1b')](_0x51d1aa['include'],function(_0x46a0a2){return{'model':db[_0x46a0a2[_0xdcef('0x1c')]],'as':_0x46a0a2['as'],'attributes':_0x46a0a2[_0xdcef('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdcef('0xc')](function(_0x47589f){logger[_0xdcef('0xd')](_0xdcef('0x1f'),_0x23f68e);logger[_0xdcef('0x1e')](_0xdcef('0x1f'),_0x23f68e,JSON['stringify'](_0x47589f));_0x4952e1(_0x47589f);})[_0xdcef('0x21')](function(_0x14516d){logger[_0xdcef('0x11')](_0xdcef('0x1f'),_0x14516d['message'],_0x23f68e);_0x58849e(_0x538866[_0xdcef('0x11')](0x1f4,_0x14516d['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 52835dd..12043e8 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 _0x542e=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x5b3a3c,_0x4f5d7e){var _0x5b8add=function(_0x93362d){while(--_0x93362d){_0x5b3a3c['push'](_0x5b3a3c['shift']());}};_0x5b8add(++_0x4f5d7e);}(_0x542e,0x7a));var _0xe542=function(_0x557ada,_0x271ee9){_0x557ada=_0x557ada-0x0;var _0x46d30f=_0x542e[_0x557ada];return _0x46d30f;};'use strict';var multer=require(_0xe542('0x0'));var util=require(_0xe542('0x1'));var path=require(_0xe542('0x2'));var timeout=require(_0xe542('0x3'));var express=require(_0xe542('0x4'));var router=express['Router']();var fs_extra=require(_0xe542('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe542('0x6'));var config=require(_0xe542('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0xe542('0x8')]('/',auth[_0xe542('0x9')](),controller[_0xe542('0xa')]);router[_0xe542('0x8')](_0xe542('0xb'),auth[_0xe542('0x9')](),controller['show']);router[_0xe542('0x8')](_0xe542('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xe542('0x8')]('/:id/subjects',auth[_0xe542('0x9')](),controller[_0xe542('0xd')]);router[_0xe542('0x8')](_0xe542('0xe'),auth[_0xe542('0x9')](),controller[_0xe542('0xf')]);router[_0xe542('0x10')]('/',auth[_0xe542('0x9')](),controller[_0xe542('0x11')]);router[_0xe542('0x12')](_0xe542('0xb'),auth[_0xe542('0x9')](),controller[_0xe542('0x13')]);router[_0xe542('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe542('0x15')]);module[_0xe542('0x16')]=router; \ No newline at end of file +var _0xe61f=['create','put','update','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post'];(function(_0x38a7c9,_0x5cb247){var _0x52b3b2=function(_0x87907e){while(--_0x87907e){_0x38a7c9['push'](_0x38a7c9['shift']());}};_0x52b3b2(++_0x5cb247);}(_0xe61f,0x1bc));var _0xfe61=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe61f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xfe61('0x0'));var path=require(_0xfe61('0x1'));var timeout=require(_0xfe61('0x2'));var express=require(_0xfe61('0x3'));var router=express['Router']();var fs_extra=require(_0xfe61('0x4'));var auth=require(_0xfe61('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfe61('0x6'));var controller=require(_0xfe61('0x7'));router[_0xfe61('0x8')]('/',auth[_0xfe61('0x9')](),controller[_0xfe61('0xa')]);router[_0xfe61('0x8')](_0xfe61('0xb'),auth[_0xfe61('0x9')](),controller[_0xfe61('0xc')]);router[_0xfe61('0x8')](_0xfe61('0xd'),auth[_0xfe61('0x9')](),controller[_0xfe61('0xe')]);router['get']('/:id/subjects',auth[_0xfe61('0x9')](),controller['getSubjects']);router[_0xfe61('0x8')](_0xfe61('0xf'),auth[_0xfe61('0x9')](),controller[_0xfe61('0x10')]);router[_0xfe61('0x11')]('/',auth[_0xfe61('0x9')](),controller[_0xfe61('0x12')]);router[_0xfe61('0x13')](_0xfe61('0xb'),auth[_0xfe61('0x9')](),controller[_0xfe61('0x14')]);router['delete'](_0xfe61('0xb'),auth[_0xfe61('0x9')](),controller[_0xfe61('0x15')]);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 7de4b6a..17a096d 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 _0x6a4f=['contact','exports','STRING','lead','ENUM'];(function(_0x3e8ba4,_0x2d1af1){var _0x5721d9=function(_0x4477b9){while(--_0x4477b9){_0x3e8ba4['push'](_0x3e8ba4['shift']());}};_0x5721d9(++_0x2d1af1);}(_0x6a4f,0x17d));var _0xf6a4=function(_0x193ad3,_0x3cd54e){_0x193ad3=_0x193ad3-0x0;var _0x1d12f2=_0x6a4f[_0x193ad3];return _0x1d12f2;};'use strict';var Sequelize=require('sequelize');module[_0xf6a4('0x0')]={'name':{'type':Sequelize[_0xf6a4('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xf6a4('0x2'),'contact','nothing'),'defaultValue':_0xf6a4('0x2')},'moduleSearch':{'type':Sequelize[_0xf6a4('0x3')]('contact_lead',_0xf6a4('0x4'),_0xf6a4('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xf6a4('0x1')]}}; \ No newline at end of file +var _0x1d99=['contact','nothing','contact_lead','exports','STRING','ENUM','lead'];(function(_0x5c07bf,_0x3abb20){var _0x5490e0=function(_0x14aaa5){while(--_0x14aaa5){_0x5c07bf['push'](_0x5c07bf['shift']());}};_0x5490e0(++_0x3abb20);}(_0x1d99,0x16f));var _0x91d9=function(_0x57010f,_0x2dccba){_0x57010f=_0x57010f-0x0;var _0x1538c5=_0x1d99[_0x57010f];return _0x1538c5;};'use strict';var Sequelize=require('sequelize');module[_0x91d9('0x0')]={'name':{'type':Sequelize[_0x91d9('0x1')]},'moduleCreate':{'type':Sequelize[_0x91d9('0x2')](_0x91d9('0x3'),_0x91d9('0x4'),_0x91d9('0x5')),'defaultValue':_0x91d9('0x3')},'moduleSearch':{'type':Sequelize[_0x91d9('0x2')](_0x91d9('0x6'),_0x91d9('0x4'),_0x91d9('0x3')),'defaultValue':_0x91d9('0x6')},'description':{'type':Sequelize[_0x91d9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 613719f..d9be6b0 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 _0xdcde=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','name','fieldName','query','keys','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','includeAll','ZohoConfiguration','findAll','rows','show','params','rawAttributes','include','options','find','catch','create','body','getFields','findOne','ZohoField','sort','map','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','jsforce','desk.js'];(function(_0x4d53d0,_0x32076a){var _0xf4203c=function(_0x8782aa){while(--_0x8782aa){_0x4d53d0['push'](_0x4d53d0['shift']());}};_0xf4203c(++_0x32076a);}(_0xdcde,0x8d));var _0xedcd=function(_0x5f3e99,_0xe7e8bf){_0x5f3e99=_0x5f3e99-0x0;var _0x17dc01=_0xdcde[_0x5f3e99];return _0x17dc01;};'use strict';var emlformat=require(_0xedcd('0x0'));var rimraf=require(_0xedcd('0x1'));var zipdir=require(_0xedcd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedcd('0x3'));var moment=require(_0xedcd('0x4'));var BPromise=require(_0xedcd('0x5'));var Mustache=require(_0xedcd('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xedcd('0x7'));var ejs=require(_0xedcd('0x8'));var fs=require('fs');var fs_extra=require(_0xedcd('0x9'));var _=require(_0xedcd('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xedcd('0xb'));var deskjs=require(_0xedcd('0xc'));var toCsv=require(_0xedcd('0x7'));var querystring=require(_0xedcd('0xd'));var Papa=require(_0xedcd('0xe'));var Redis=require('ioredis');var authService=require(_0xedcd('0xf'));var qs=require(_0xedcd('0x10'));var as=require(_0xedcd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xedcd('0x12'))(_0xedcd('0x13'));var utils=require(_0xedcd('0x14'));var config=require(_0xedcd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xedcd('0x16'))['db'];function respondWithStatusCode(_0x3b83a4,_0x52d0fb){_0x52d0fb=_0x52d0fb||0xcc;return function(_0x2ec46c){if(_0x2ec46c){return _0x3b83a4[_0xedcd('0x17')](_0x52d0fb);}return _0x3b83a4[_0xedcd('0x18')](_0x52d0fb)['end']();};}function respondWithResult(_0x22bedf,_0x28eb02){_0x28eb02=_0x28eb02||0xc8;return function(_0x4af453){if(_0x4af453){return _0x22bedf[_0xedcd('0x18')](_0x28eb02)[_0xedcd('0x19')](_0x4af453);}};}function respondWithFilteredResult(_0x3e7d79,_0x3ce025){return function(_0xbbe937){if(_0xbbe937){var _0x8a151=typeof _0x3ce025['offset']===_0xedcd('0x1a')&&typeof _0x3ce025[_0xedcd('0x1b')]===_0xedcd('0x1a');var _0x5a9711=_0xbbe937[_0xedcd('0x1c')];var _0x333fb6=_0x8a151?0x0:_0x3ce025[_0xedcd('0x1d')];var _0x2c7448=_0x8a151?_0xbbe937[_0xedcd('0x1c')]:_0x3ce025[_0xedcd('0x1d')]+_0x3ce025[_0xedcd('0x1b')];var _0x25d98a;if(_0x2c7448>=_0x5a9711){_0x2c7448=_0x5a9711;_0x25d98a=0xc8;}else{_0x25d98a=0xce;}_0x3e7d79[_0xedcd('0x18')](_0x25d98a);return _0x3e7d79[_0xedcd('0x1e')](_0xedcd('0x1f'),_0x333fb6+'-'+_0x2c7448+'/'+_0x5a9711)['json'](_0xbbe937);}return null;};}function patchUpdates(_0x48fc4e){return function(_0x294d04){try{jsonpatch['apply'](_0x294d04,_0x48fc4e,!![]);}catch(_0x4f730a){return BPromise['reject'](_0x4f730a);}return _0x294d04[_0xedcd('0x20')]();};}function saveUpdates(_0x57ebe2,_0x5e9a38){return function(_0x4f9bad){if(_0x4f9bad){return _0x4f9bad[_0xedcd('0x21')](_0x57ebe2)[_0xedcd('0x22')](function(_0x464c56){return _0x464c56;});}return null;};}function removeEntity(_0x47223b,_0x141732){return function(_0x28e12a){if(_0x28e12a){return _0x28e12a[_0xedcd('0x23')]()[_0xedcd('0x22')](function(){_0x47223b[_0xedcd('0x18')](0xcc)[_0xedcd('0x24')]();});}};}function handleEntityNotFound(_0x39e8e6,_0x4484a2){return function(_0x396fbf){if(!_0x396fbf){_0x39e8e6[_0xedcd('0x17')](0x194);}return _0x396fbf;};}function handleError(_0x366df5,_0x3043dd){_0x3043dd=_0x3043dd||0x1f4;return function(_0x3ceaa7){logger[_0xedcd('0x25')](_0x3ceaa7[_0xedcd('0x26')]);if(_0x3ceaa7[_0xedcd('0x27')]){delete _0x3ceaa7[_0xedcd('0x27')];}_0x366df5[_0xedcd('0x18')](_0x3043dd)['send'](_0x3ceaa7);};}exports['index']=function(_0x3e65b3,_0x1e6fd8){var _0x4c8cc6={},_0x32f096={},_0x2e8ac0={'count':0x0,'rows':[]};var _0x5877bb=_['map'](db['ZohoConfiguration']['rawAttributes'],function(_0x1ba80f){return{'name':_0x1ba80f[_0xedcd('0x28')],'type':_0x1ba80f['type']['key']};});_0x32f096['model']=_['map'](_0x5877bb,_0xedcd('0x27'));_0x32f096[_0xedcd('0x29')]=_[_0xedcd('0x2a')](_0x3e65b3[_0xedcd('0x29')]);_0x32f096['filters']=_[_0xedcd('0x2b')](_0x32f096['model'],_0x32f096[_0xedcd('0x29')]);_0x4c8cc6['attributes']=_[_0xedcd('0x2b')](_0x32f096['model'],qs[_0xedcd('0x2c')](_0x3e65b3['query'][_0xedcd('0x2c')]));_0x4c8cc6[_0xedcd('0x2d')]=_0x4c8cc6[_0xedcd('0x2d')][_0xedcd('0x2e')]?_0x4c8cc6[_0xedcd('0x2d')]:_0x32f096[_0xedcd('0x2f')];if(!_0x3e65b3[_0xedcd('0x29')][_0xedcd('0x30')](_0xedcd('0x31'))){_0x4c8cc6['limit']=qs[_0xedcd('0x1b')](_0x3e65b3[_0xedcd('0x29')][_0xedcd('0x1b')]);_0x4c8cc6[_0xedcd('0x1d')]=qs[_0xedcd('0x1d')](_0x3e65b3['query'][_0xedcd('0x1d')]);}_0x4c8cc6[_0xedcd('0x32')]=qs['sort'](_0x3e65b3[_0xedcd('0x29')]['sort']);_0x4c8cc6[_0xedcd('0x33')]=qs['filters'](_[_0xedcd('0x34')](_0x3e65b3['query'],_0x32f096[_0xedcd('0x35')]),_0x5877bb);if(_0x3e65b3[_0xedcd('0x29')][_0xedcd('0x36')]){_0x4c8cc6[_0xedcd('0x33')]=_[_0xedcd('0x37')](_0x4c8cc6[_0xedcd('0x33')],{'$or':_['map'](_0x5877bb,function(_0x2c7fb7){if(_0x2c7fb7['type']!==_0xedcd('0x38')){var _0x82aaa1={};_0x82aaa1[_0x2c7fb7['name']]={'$like':'%'+_0x3e65b3[_0xedcd('0x29')][_0xedcd('0x36')]+'%'};return _0x82aaa1;}})});}_0x4c8cc6=_['merge']({},_0x4c8cc6,_0x3e65b3['options']);var _0x516766={'where':_0x4c8cc6['where']};return db['ZohoConfiguration']['count'](_0x516766)[_0xedcd('0x22')](function(_0x2fb7f1){_0x2e8ac0[_0xedcd('0x1c')]=_0x2fb7f1;if(_0x3e65b3[_0xedcd('0x29')][_0xedcd('0x39')]){_0x4c8cc6['include']=[{'all':!![]}];}return db[_0xedcd('0x3a')][_0xedcd('0x3b')](_0x4c8cc6);})[_0xedcd('0x22')](function(_0x20c771){_0x2e8ac0[_0xedcd('0x3c')]=_0x20c771;return _0x2e8ac0;})[_0xedcd('0x22')](respondWithFilteredResult(_0x1e6fd8,_0x4c8cc6))['catch'](handleError(_0x1e6fd8,null));};exports[_0xedcd('0x3d')]=function(_0x42dcd7,_0x38df62){var _0x2b7dca={'raw':![],'where':{'id':_0x42dcd7[_0xedcd('0x3e')]['id']}},_0x228133={};_0x228133['model']=_[_0xedcd('0x2a')](db[_0xedcd('0x3a')][_0xedcd('0x3f')]);_0x228133['query']=_[_0xedcd('0x2a')](_0x42dcd7[_0xedcd('0x29')]);_0x228133[_0xedcd('0x35')]=_['intersection'](_0x228133['model'],_0x228133[_0xedcd('0x29')]);_0x2b7dca[_0xedcd('0x2d')]=_[_0xedcd('0x2b')](_0x228133[_0xedcd('0x2f')],qs[_0xedcd('0x2c')](_0x42dcd7[_0xedcd('0x29')]['fields']));_0x2b7dca[_0xedcd('0x2d')]=_0x2b7dca[_0xedcd('0x2d')][_0xedcd('0x2e')]?_0x2b7dca[_0xedcd('0x2d')]:_0x228133['model'];if(_0x42dcd7[_0xedcd('0x29')][_0xedcd('0x39')]){_0x2b7dca[_0xedcd('0x40')]=[{'all':!![]}];}_0x2b7dca=_[_0xedcd('0x37')]({},_0x2b7dca,_0x42dcd7[_0xedcd('0x41')]);return db[_0xedcd('0x3a')][_0xedcd('0x42')](_0x2b7dca)[_0xedcd('0x22')](handleEntityNotFound(_0x38df62,null))[_0xedcd('0x22')](respondWithResult(_0x38df62,null))[_0xedcd('0x43')](handleError(_0x38df62,null));};exports[_0xedcd('0x44')]=function(_0x195c28,_0x4735c5){return db['ZohoConfiguration'][_0xedcd('0x44')](_0x195c28['body'],{})[_0xedcd('0x22')](respondWithResult(_0x4735c5,0xc9))[_0xedcd('0x43')](handleError(_0x4735c5,null));};exports[_0xedcd('0x21')]=function(_0x17aa42,_0x450220){if(_0x17aa42[_0xedcd('0x45')]['id']){delete _0x17aa42['body']['id'];}return db[_0xedcd('0x3a')][_0xedcd('0x42')]({'where':{'id':_0x17aa42[_0xedcd('0x3e')]['id']}})['then'](handleEntityNotFound(_0x450220,null))['then'](saveUpdates(_0x17aa42[_0xedcd('0x45')],null))[_0xedcd('0x22')](respondWithResult(_0x450220,null))[_0xedcd('0x43')](handleError(_0x450220,null));};exports[_0xedcd('0x23')]=function(_0x303ba2,_0xb3cf84){return db[_0xedcd('0x3a')][_0xedcd('0x42')]({'where':{'id':_0x303ba2[_0xedcd('0x3e')]['id']}})['then'](handleEntityNotFound(_0xb3cf84,null))[_0xedcd('0x22')](removeEntity(_0xb3cf84,null))[_0xedcd('0x43')](handleError(_0xb3cf84,null));};exports[_0xedcd('0x46')]=function(_0x2e7d31,_0x4aa21f,_0x565633){var _0xc85a1={};var _0x4dee3a={};var _0x3d0ce2;var _0x49bfd0;return db[_0xedcd('0x3a')][_0xedcd('0x47')]({'where':{'id':_0x2e7d31[_0xedcd('0x3e')]['id']}})[_0xedcd('0x22')](handleEntityNotFound(_0x4aa21f,null))['then'](function(_0x302715){if(_0x302715){_0x3d0ce2=_0x302715;_0x4dee3a[_0xedcd('0x2f')]=_[_0xedcd('0x2a')](db[_0xedcd('0x48')][_0xedcd('0x3f')]);_0x4dee3a[_0xedcd('0x29')]=_[_0xedcd('0x2a')](_0x2e7d31[_0xedcd('0x29')]);_0x4dee3a[_0xedcd('0x35')]=_[_0xedcd('0x2b')](_0x4dee3a[_0xedcd('0x2f')],_0x4dee3a[_0xedcd('0x29')]);_0xc85a1['attributes']=_[_0xedcd('0x2b')](_0x4dee3a[_0xedcd('0x2f')],qs[_0xedcd('0x2c')](_0x2e7d31[_0xedcd('0x29')]['fields']));_0xc85a1[_0xedcd('0x2d')]=_0xc85a1[_0xedcd('0x2d')][_0xedcd('0x2e')]?_0xc85a1[_0xedcd('0x2d')]:_0x4dee3a[_0xedcd('0x2f')];_0xc85a1[_0xedcd('0x32')]=qs[_0xedcd('0x49')](_0x2e7d31[_0xedcd('0x29')][_0xedcd('0x49')]);_0xc85a1['where']=qs[_0xedcd('0x35')](_[_0xedcd('0x34')](_0x2e7d31['query'],_0x4dee3a[_0xedcd('0x35')]));if(_0x2e7d31[_0xedcd('0x29')][_0xedcd('0x36')]){_0xc85a1[_0xedcd('0x33')]=_[_0xedcd('0x37')](_0xc85a1['where'],{'$or':_[_0xedcd('0x4a')](_0xc85a1[_0xedcd('0x2d')],function(_0x57406f){var _0x3adcfe={};_0x3adcfe[_0x57406f]={'$like':'%'+_0x2e7d31[_0xedcd('0x29')][_0xedcd('0x36')]+'%'};return _0x3adcfe;})});}_0xc85a1=_[_0xedcd('0x37')]({},_0xc85a1,_0x2e7d31[_0xedcd('0x41')]);return _0x3d0ce2[_0xedcd('0x46')](_0xc85a1);}})[_0xedcd('0x22')](function(_0x5ac808){if(_0x5ac808){_0x49bfd0=_0x5ac808['length'];if(!_0x2e7d31[_0xedcd('0x29')]['hasOwnProperty'](_0xedcd('0x31'))){_0xc85a1[_0xedcd('0x1b')]=qs['limit'](_0x2e7d31[_0xedcd('0x29')][_0xedcd('0x1b')]);_0xc85a1[_0xedcd('0x1d')]=qs[_0xedcd('0x1d')](_0x2e7d31[_0xedcd('0x29')]['offset']);}return _0x3d0ce2[_0xedcd('0x46')](_0xc85a1);}})[_0xedcd('0x22')](function(_0x56f2f0){if(_0x56f2f0){return _0x56f2f0?{'count':_0x49bfd0,'rows':_0x56f2f0}:null;}})['then'](respondWithResult(_0x4aa21f,null))[_0xedcd('0x43')](handleError(_0x4aa21f,null));};exports[_0xedcd('0x4b')]=function(_0xf2d996,_0x535679,_0xbbd405){var _0x598401={};var _0x1bf301={};var _0x1edb8e;var _0x79f6d1;return db[_0xedcd('0x3a')][_0xedcd('0x47')]({'where':{'id':_0xf2d996['params']['id']}})['then'](handleEntityNotFound(_0x535679,null))[_0xedcd('0x22')](function(_0x4f7add){if(_0x4f7add){_0x1edb8e=_0x4f7add;_0x1bf301[_0xedcd('0x2f')]=_[_0xedcd('0x2a')](db[_0xedcd('0x48')][_0xedcd('0x3f')]);_0x1bf301['query']=_[_0xedcd('0x2a')](_0xf2d996[_0xedcd('0x29')]);_0x1bf301[_0xedcd('0x35')]=_[_0xedcd('0x2b')](_0x1bf301['model'],_0x1bf301['query']);_0x598401[_0xedcd('0x2d')]=_[_0xedcd('0x2b')](_0x1bf301[_0xedcd('0x2f')],qs[_0xedcd('0x2c')](_0xf2d996[_0xedcd('0x29')][_0xedcd('0x2c')]));_0x598401[_0xedcd('0x2d')]=_0x598401[_0xedcd('0x2d')][_0xedcd('0x2e')]?_0x598401[_0xedcd('0x2d')]:_0x1bf301[_0xedcd('0x2f')];_0x598401[_0xedcd('0x32')]=qs['sort'](_0xf2d996['query']['sort']);_0x598401['where']=qs['filters'](_[_0xedcd('0x34')](_0xf2d996[_0xedcd('0x29')],_0x1bf301['filters']));if(_0xf2d996[_0xedcd('0x29')][_0xedcd('0x36')]){_0x598401[_0xedcd('0x33')]=_['merge'](_0x598401[_0xedcd('0x33')],{'$or':_['map'](_0x598401[_0xedcd('0x2d')],function(_0x21ede2){var _0x244c8c={};_0x244c8c[_0x21ede2]={'$like':'%'+_0xf2d996[_0xedcd('0x29')][_0xedcd('0x36')]+'%'};return _0x244c8c;})});}_0x598401=_[_0xedcd('0x37')]({},_0x598401,_0xf2d996[_0xedcd('0x41')]);return _0x1edb8e[_0xedcd('0x4b')](_0x598401);}})[_0xedcd('0x22')](function(_0x512e76){if(_0x512e76){_0x79f6d1=_0x512e76[_0xedcd('0x2e')];if(!_0xf2d996['query']['hasOwnProperty'](_0xedcd('0x31'))){_0x598401[_0xedcd('0x1b')]=qs[_0xedcd('0x1b')](_0xf2d996[_0xedcd('0x29')]['limit']);_0x598401[_0xedcd('0x1d')]=qs[_0xedcd('0x1d')](_0xf2d996[_0xedcd('0x29')]['offset']);}return _0x1edb8e[_0xedcd('0x4b')](_0x598401);}})['then'](function(_0x1b21ed){if(_0x1b21ed){return _0x1b21ed?{'count':_0x79f6d1,'rows':_0x1b21ed}:null;}})[_0xedcd('0x22')](respondWithResult(_0x535679,null))[_0xedcd('0x43')](handleError(_0x535679,null));};exports[_0xedcd('0x4c')]=function(_0x121a2c,_0x6e8136,_0x332a2a){var _0x4f0b09={};var _0x1f35c5={};var _0x4bbfe5;var _0x48c543;return db['ZohoConfiguration'][_0xedcd('0x47')]({'where':{'id':_0x121a2c[_0xedcd('0x3e')]['id']}})[_0xedcd('0x22')](handleEntityNotFound(_0x6e8136,null))[_0xedcd('0x22')](function(_0x385f19){if(_0x385f19){_0x4bbfe5=_0x385f19;_0x1f35c5[_0xedcd('0x2f')]=_['keys'](db[_0xedcd('0x48')][_0xedcd('0x3f')]);_0x1f35c5[_0xedcd('0x29')]=_[_0xedcd('0x2a')](_0x121a2c[_0xedcd('0x29')]);_0x1f35c5[_0xedcd('0x35')]=_[_0xedcd('0x2b')](_0x1f35c5[_0xedcd('0x2f')],_0x1f35c5[_0xedcd('0x29')]);_0x4f0b09['attributes']=_['intersection'](_0x1f35c5[_0xedcd('0x2f')],qs[_0xedcd('0x2c')](_0x121a2c[_0xedcd('0x29')]['fields']));_0x4f0b09['attributes']=_0x4f0b09[_0xedcd('0x2d')][_0xedcd('0x2e')]?_0x4f0b09[_0xedcd('0x2d')]:_0x1f35c5[_0xedcd('0x2f')];_0x4f0b09[_0xedcd('0x32')]=qs[_0xedcd('0x49')](_0x121a2c[_0xedcd('0x29')][_0xedcd('0x49')]);_0x4f0b09[_0xedcd('0x33')]=qs[_0xedcd('0x35')](_[_0xedcd('0x34')](_0x121a2c['query'],_0x1f35c5[_0xedcd('0x35')]));if(_0x121a2c[_0xedcd('0x29')][_0xedcd('0x36')]){_0x4f0b09[_0xedcd('0x33')]=_['merge'](_0x4f0b09[_0xedcd('0x33')],{'$or':_['map'](_0x4f0b09[_0xedcd('0x2d')],function(_0xa0f567){var _0x2659b2={};_0x2659b2[_0xa0f567]={'$like':'%'+_0x121a2c[_0xedcd('0x29')][_0xedcd('0x36')]+'%'};return _0x2659b2;})});}_0x4f0b09=_[_0xedcd('0x37')]({},_0x4f0b09,_0x121a2c['options']);return _0x4bbfe5[_0xedcd('0x4c')](_0x4f0b09);}})['then'](function(_0xc2bfec){if(_0xc2bfec){_0x48c543=_0xc2bfec[_0xedcd('0x2e')];if(!_0x121a2c[_0xedcd('0x29')][_0xedcd('0x30')](_0xedcd('0x31'))){_0x4f0b09[_0xedcd('0x1b')]=qs[_0xedcd('0x1b')](_0x121a2c[_0xedcd('0x29')]['limit']);_0x4f0b09[_0xedcd('0x1d')]=qs[_0xedcd('0x1d')](_0x121a2c[_0xedcd('0x29')][_0xedcd('0x1d')]);}return _0x4bbfe5[_0xedcd('0x4c')](_0x4f0b09);}})[_0xedcd('0x22')](function(_0x57fa47){if(_0x57fa47){return _0x57fa47?{'count':_0x48c543,'rows':_0x57fa47}:null;}})[_0xedcd('0x22')](respondWithResult(_0x6e8136,null))['catch'](handleError(_0x6e8136,null));}; \ No newline at end of file +var _0xd4e6=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ZohoConfiguration','includeAll','findAll','rows','catch','show','params','include','find','create','body','getFields','ZohoField','length','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x349743,_0x2b67cd){var _0x48eabd=function(_0xc29b05){while(--_0xc29b05){_0x349743['push'](_0x349743['shift']());}};_0x48eabd(++_0x2b67cd);}(_0xd4e6,0x199));var _0x6d4e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xd4e6[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x6d4e('0x0'));var rimraf=require(_0x6d4e('0x1'));var zipdir=require(_0x6d4e('0x2'));var jsonpatch=require(_0x6d4e('0x3'));var rp=require(_0x6d4e('0x4'));var moment=require(_0x6d4e('0x5'));var BPromise=require(_0x6d4e('0x6'));var Mustache=require(_0x6d4e('0x7'));var util=require(_0x6d4e('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6d4e('0x9'));var ejs=require(_0x6d4e('0xa'));var fs=require('fs');var fs_extra=require(_0x6d4e('0xb'));var _=require(_0x6d4e('0xc'));var squel=require(_0x6d4e('0xd'));var crypto=require(_0x6d4e('0xe'));var jsforce=require(_0x6d4e('0xf'));var deskjs=require(_0x6d4e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6d4e('0x11'));var Papa=require(_0x6d4e('0x12'));var Redis=require(_0x6d4e('0x13'));var authService=require(_0x6d4e('0x14'));var qs=require(_0x6d4e('0x15'));var as=require(_0x6d4e('0x16'));var hardwareService=require(_0x6d4e('0x17'));var logger=require(_0x6d4e('0x18'))(_0x6d4e('0x19'));var utils=require(_0x6d4e('0x1a'));var config=require(_0x6d4e('0x1b'));var licenseUtil=require(_0x6d4e('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51ce63,_0x4b9d3b){_0x4b9d3b=_0x4b9d3b||0xcc;return function(_0x313ab0){if(_0x313ab0){return _0x51ce63[_0x6d4e('0x1d')](_0x4b9d3b);}return _0x51ce63['status'](_0x4b9d3b)[_0x6d4e('0x1e')]();};}function respondWithResult(_0x233929,_0xf40809){_0xf40809=_0xf40809||0xc8;return function(_0xc51979){if(_0xc51979){return _0x233929[_0x6d4e('0x1f')](_0xf40809)[_0x6d4e('0x20')](_0xc51979);}};}function respondWithFilteredResult(_0x427ce2,_0x245a92){return function(_0x18ba3b){if(_0x18ba3b){var _0x35a663=typeof _0x245a92['offset']===_0x6d4e('0x21')&&typeof _0x245a92['limit']===_0x6d4e('0x21');var _0x3eda60=_0x18ba3b[_0x6d4e('0x22')];var _0x4570b0=_0x35a663?0x0:_0x245a92[_0x6d4e('0x23')];var _0x4e4745=_0x35a663?_0x18ba3b[_0x6d4e('0x22')]:_0x245a92[_0x6d4e('0x23')]+_0x245a92[_0x6d4e('0x24')];var _0x14626a;if(_0x4e4745>=_0x3eda60){_0x4e4745=_0x3eda60;_0x14626a=0xc8;}else{_0x14626a=0xce;}_0x427ce2[_0x6d4e('0x1f')](_0x14626a);return _0x427ce2[_0x6d4e('0x25')](_0x6d4e('0x26'),_0x4570b0+'-'+_0x4e4745+'/'+_0x3eda60)[_0x6d4e('0x20')](_0x18ba3b);}return null;};}function patchUpdates(_0x2e7f05){return function(_0x126035){try{jsonpatch[_0x6d4e('0x27')](_0x126035,_0x2e7f05,!![]);}catch(_0x6d4b02){return BPromise['reject'](_0x6d4b02);}return _0x126035[_0x6d4e('0x28')]();};}function saveUpdates(_0x35dca1,_0x2de652){return function(_0x24c76f){if(_0x24c76f){return _0x24c76f[_0x6d4e('0x29')](_0x35dca1)[_0x6d4e('0x2a')](function(_0x3d3caf){return _0x3d3caf;});}return null;};}function removeEntity(_0x81597b,_0x546633){return function(_0x4e6a94){if(_0x4e6a94){return _0x4e6a94[_0x6d4e('0x2b')]()[_0x6d4e('0x2a')](function(){_0x81597b['status'](0xcc)[_0x6d4e('0x1e')]();});}};}function handleEntityNotFound(_0x43e9a7,_0x159a27){return function(_0x1fc514){if(!_0x1fc514){_0x43e9a7[_0x6d4e('0x1d')](0x194);}return _0x1fc514;};}function handleError(_0x2b946b,_0x1d44a2){_0x1d44a2=_0x1d44a2||0x1f4;return function(_0x184551){logger['error'](_0x184551[_0x6d4e('0x2c')]);if(_0x184551[_0x6d4e('0x2d')]){delete _0x184551[_0x6d4e('0x2d')];}_0x2b946b['status'](_0x1d44a2)['send'](_0x184551);};}exports[_0x6d4e('0x2e')]=function(_0x31d7b7,_0x44885e){var _0x41750d={},_0xfe56c5={},_0x33a365={'count':0x0,'rows':[]};var _0x321bcd=_[_0x6d4e('0x2f')](db['ZohoConfiguration'][_0x6d4e('0x30')],function(_0x4cecbf){return{'name':_0x4cecbf[_0x6d4e('0x31')],'type':_0x4cecbf[_0x6d4e('0x32')][_0x6d4e('0x33')]};});_0xfe56c5[_0x6d4e('0x34')]=_[_0x6d4e('0x2f')](_0x321bcd,_0x6d4e('0x2d'));_0xfe56c5[_0x6d4e('0x35')]=_[_0x6d4e('0x36')](_0x31d7b7['query']);_0xfe56c5['filters']=_[_0x6d4e('0x37')](_0xfe56c5[_0x6d4e('0x34')],_0xfe56c5['query']);_0x41750d[_0x6d4e('0x38')]=_['intersection'](_0xfe56c5['model'],qs[_0x6d4e('0x39')](_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x39')]));_0x41750d[_0x6d4e('0x38')]=_0x41750d['attributes']['length']?_0x41750d['attributes']:_0xfe56c5[_0x6d4e('0x34')];if(!_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x3a')]('nolimit')){_0x41750d[_0x6d4e('0x24')]=qs[_0x6d4e('0x24')](_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x24')]);_0x41750d[_0x6d4e('0x23')]=qs[_0x6d4e('0x23')](_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x23')]);}_0x41750d[_0x6d4e('0x3b')]=qs['sort'](_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x3c')]);_0x41750d[_0x6d4e('0x3d')]=qs[_0x6d4e('0x3e')](_[_0x6d4e('0x3f')](_0x31d7b7[_0x6d4e('0x35')],_0xfe56c5[_0x6d4e('0x3e')]),_0x321bcd);if(_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x40')]){_0x41750d[_0x6d4e('0x3d')]=_['merge'](_0x41750d[_0x6d4e('0x3d')],{'$or':_[_0x6d4e('0x2f')](_0x321bcd,function(_0x3a1551){if(_0x3a1551[_0x6d4e('0x32')]!==_0x6d4e('0x41')){var _0x34b25a={};_0x34b25a[_0x3a1551[_0x6d4e('0x2d')]]={'$like':'%'+_0x31d7b7[_0x6d4e('0x35')]['filter']+'%'};return _0x34b25a;}})});}_0x41750d=_[_0x6d4e('0x42')]({},_0x41750d,_0x31d7b7[_0x6d4e('0x43')]);var _0x26980d={'where':_0x41750d[_0x6d4e('0x3d')]};return db[_0x6d4e('0x44')][_0x6d4e('0x22')](_0x26980d)[_0x6d4e('0x2a')](function(_0x5ebd55){_0x33a365['count']=_0x5ebd55;if(_0x31d7b7['query'][_0x6d4e('0x45')]){_0x41750d['include']=[{'all':!![]}];}return db[_0x6d4e('0x44')][_0x6d4e('0x46')](_0x41750d);})[_0x6d4e('0x2a')](function(_0x2be5d5){_0x33a365[_0x6d4e('0x47')]=_0x2be5d5;return _0x33a365;})[_0x6d4e('0x2a')](respondWithFilteredResult(_0x44885e,_0x41750d))[_0x6d4e('0x48')](handleError(_0x44885e,null));};exports[_0x6d4e('0x49')]=function(_0x19b497,_0x44dc5e){var _0x3935a9={'raw':![],'where':{'id':_0x19b497[_0x6d4e('0x4a')]['id']}},_0x328f8d={};_0x328f8d[_0x6d4e('0x34')]=_['keys'](db['ZohoConfiguration'][_0x6d4e('0x30')]);_0x328f8d['query']=_[_0x6d4e('0x36')](_0x19b497[_0x6d4e('0x35')]);_0x328f8d[_0x6d4e('0x3e')]=_[_0x6d4e('0x37')](_0x328f8d[_0x6d4e('0x34')],_0x328f8d['query']);_0x3935a9[_0x6d4e('0x38')]=_[_0x6d4e('0x37')](_0x328f8d[_0x6d4e('0x34')],qs[_0x6d4e('0x39')](_0x19b497[_0x6d4e('0x35')][_0x6d4e('0x39')]));_0x3935a9[_0x6d4e('0x38')]=_0x3935a9['attributes']['length']?_0x3935a9[_0x6d4e('0x38')]:_0x328f8d[_0x6d4e('0x34')];if(_0x19b497['query'][_0x6d4e('0x45')]){_0x3935a9[_0x6d4e('0x4b')]=[{'all':!![]}];}_0x3935a9=_[_0x6d4e('0x42')]({},_0x3935a9,_0x19b497[_0x6d4e('0x43')]);return db[_0x6d4e('0x44')][_0x6d4e('0x4c')](_0x3935a9)[_0x6d4e('0x2a')](handleEntityNotFound(_0x44dc5e,null))['then'](respondWithResult(_0x44dc5e,null))[_0x6d4e('0x48')](handleError(_0x44dc5e,null));};exports[_0x6d4e('0x4d')]=function(_0x25f9e6,_0x214ec7){return db[_0x6d4e('0x44')]['create'](_0x25f9e6[_0x6d4e('0x4e')],{})[_0x6d4e('0x2a')](respondWithResult(_0x214ec7,0xc9))[_0x6d4e('0x48')](handleError(_0x214ec7,null));};exports[_0x6d4e('0x29')]=function(_0x3ac41e,_0x398b26){if(_0x3ac41e[_0x6d4e('0x4e')]['id']){delete _0x3ac41e[_0x6d4e('0x4e')]['id'];}return db[_0x6d4e('0x44')][_0x6d4e('0x4c')]({'where':{'id':_0x3ac41e[_0x6d4e('0x4a')]['id']}})[_0x6d4e('0x2a')](handleEntityNotFound(_0x398b26,null))[_0x6d4e('0x2a')](saveUpdates(_0x3ac41e[_0x6d4e('0x4e')],null))['then'](respondWithResult(_0x398b26,null))['catch'](handleError(_0x398b26,null));};exports[_0x6d4e('0x2b')]=function(_0x2d6922,_0x5d3c12){return db[_0x6d4e('0x44')][_0x6d4e('0x4c')]({'where':{'id':_0x2d6922[_0x6d4e('0x4a')]['id']}})[_0x6d4e('0x2a')](handleEntityNotFound(_0x5d3c12,null))['then'](removeEntity(_0x5d3c12,null))[_0x6d4e('0x48')](handleError(_0x5d3c12,null));};exports[_0x6d4e('0x4f')]=function(_0x387f16,_0x1bc673,_0x24baa8){var _0x49a8ed={};var _0x50e489={};var _0x40bd5a;var _0x73cbc8;return db[_0x6d4e('0x44')]['findOne']({'where':{'id':_0x387f16[_0x6d4e('0x4a')]['id']}})[_0x6d4e('0x2a')](handleEntityNotFound(_0x1bc673,null))[_0x6d4e('0x2a')](function(_0x21b776){if(_0x21b776){_0x40bd5a=_0x21b776;_0x50e489[_0x6d4e('0x34')]=_['keys'](db[_0x6d4e('0x50')][_0x6d4e('0x30')]);_0x50e489[_0x6d4e('0x35')]=_[_0x6d4e('0x36')](_0x387f16[_0x6d4e('0x35')]);_0x50e489['filters']=_[_0x6d4e('0x37')](_0x50e489[_0x6d4e('0x34')],_0x50e489[_0x6d4e('0x35')]);_0x49a8ed[_0x6d4e('0x38')]=_['intersection'](_0x50e489[_0x6d4e('0x34')],qs[_0x6d4e('0x39')](_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x39')]));_0x49a8ed[_0x6d4e('0x38')]=_0x49a8ed[_0x6d4e('0x38')][_0x6d4e('0x51')]?_0x49a8ed[_0x6d4e('0x38')]:_0x50e489['model'];_0x49a8ed[_0x6d4e('0x3b')]=qs[_0x6d4e('0x3c')](_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x3c')]);_0x49a8ed[_0x6d4e('0x3d')]=qs[_0x6d4e('0x3e')](_[_0x6d4e('0x3f')](_0x387f16[_0x6d4e('0x35')],_0x50e489[_0x6d4e('0x3e')]));if(_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x40')]){_0x49a8ed[_0x6d4e('0x3d')]=_['merge'](_0x49a8ed['where'],{'$or':_['map'](_0x49a8ed[_0x6d4e('0x38')],function(_0x5aea4f){var _0x4ae29e={};_0x4ae29e[_0x5aea4f]={'$like':'%'+_0x387f16[_0x6d4e('0x35')]['filter']+'%'};return _0x4ae29e;})});}_0x49a8ed=_['merge']({},_0x49a8ed,_0x387f16[_0x6d4e('0x43')]);return _0x40bd5a[_0x6d4e('0x4f')](_0x49a8ed);}})[_0x6d4e('0x2a')](function(_0x47f042){if(_0x47f042){_0x73cbc8=_0x47f042[_0x6d4e('0x51')];if(!_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x3a')](_0x6d4e('0x52'))){_0x49a8ed[_0x6d4e('0x24')]=qs[_0x6d4e('0x24')](_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x24')]);_0x49a8ed['offset']=qs[_0x6d4e('0x23')](_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x23')]);}return _0x40bd5a[_0x6d4e('0x4f')](_0x49a8ed);}})['then'](function(_0x2bb2e8){if(_0x2bb2e8){return _0x2bb2e8?{'count':_0x73cbc8,'rows':_0x2bb2e8}:null;}})['then'](respondWithResult(_0x1bc673,null))[_0x6d4e('0x48')](handleError(_0x1bc673,null));};exports[_0x6d4e('0x53')]=function(_0x141455,_0x1dcbcc,_0x28c9f3){var _0x499595={};var _0x5bb504={};var _0x5f251e;var _0x17030a;return db[_0x6d4e('0x44')]['findOne']({'where':{'id':_0x141455[_0x6d4e('0x4a')]['id']}})[_0x6d4e('0x2a')](handleEntityNotFound(_0x1dcbcc,null))[_0x6d4e('0x2a')](function(_0xe8b72e){if(_0xe8b72e){_0x5f251e=_0xe8b72e;_0x5bb504[_0x6d4e('0x34')]=_[_0x6d4e('0x36')](db[_0x6d4e('0x50')]['rawAttributes']);_0x5bb504['query']=_[_0x6d4e('0x36')](_0x141455[_0x6d4e('0x35')]);_0x5bb504[_0x6d4e('0x3e')]=_[_0x6d4e('0x37')](_0x5bb504['model'],_0x5bb504['query']);_0x499595[_0x6d4e('0x38')]=_['intersection'](_0x5bb504[_0x6d4e('0x34')],qs[_0x6d4e('0x39')](_0x141455[_0x6d4e('0x35')]['fields']));_0x499595[_0x6d4e('0x38')]=_0x499595[_0x6d4e('0x38')][_0x6d4e('0x51')]?_0x499595['attributes']:_0x5bb504[_0x6d4e('0x34')];_0x499595['order']=qs[_0x6d4e('0x3c')](_0x141455[_0x6d4e('0x35')][_0x6d4e('0x3c')]);_0x499595[_0x6d4e('0x3d')]=qs['filters'](_[_0x6d4e('0x3f')](_0x141455[_0x6d4e('0x35')],_0x5bb504[_0x6d4e('0x3e')]));if(_0x141455[_0x6d4e('0x35')][_0x6d4e('0x40')]){_0x499595[_0x6d4e('0x3d')]=_[_0x6d4e('0x42')](_0x499595[_0x6d4e('0x3d')],{'$or':_[_0x6d4e('0x2f')](_0x499595[_0x6d4e('0x38')],function(_0x22beed){var _0x40b9d0={};_0x40b9d0[_0x22beed]={'$like':'%'+_0x141455[_0x6d4e('0x35')]['filter']+'%'};return _0x40b9d0;})});}_0x499595=_['merge']({},_0x499595,_0x141455[_0x6d4e('0x43')]);return _0x5f251e[_0x6d4e('0x53')](_0x499595);}})[_0x6d4e('0x2a')](function(_0x1f8ccd){if(_0x1f8ccd){_0x17030a=_0x1f8ccd[_0x6d4e('0x51')];if(!_0x141455[_0x6d4e('0x35')][_0x6d4e('0x3a')](_0x6d4e('0x52'))){_0x499595[_0x6d4e('0x24')]=qs[_0x6d4e('0x24')](_0x141455[_0x6d4e('0x35')][_0x6d4e('0x24')]);_0x499595[_0x6d4e('0x23')]=qs[_0x6d4e('0x23')](_0x141455[_0x6d4e('0x35')]['offset']);}return _0x5f251e[_0x6d4e('0x53')](_0x499595);}})['then'](function(_0x1b27a7){if(_0x1b27a7){return _0x1b27a7?{'count':_0x17030a,'rows':_0x1b27a7}:null;}})['then'](respondWithResult(_0x1dcbcc,null))[_0x6d4e('0x48')](handleError(_0x1dcbcc,null));};exports[_0x6d4e('0x54')]=function(_0x27bc4d,_0x1b8901,_0x9c3dd6){var _0x1ea6f5={};var _0x2119b5={};var _0x2163fe;var _0x53da42;return db[_0x6d4e('0x44')]['findOne']({'where':{'id':_0x27bc4d['params']['id']}})[_0x6d4e('0x2a')](handleEntityNotFound(_0x1b8901,null))['then'](function(_0x2ad264){if(_0x2ad264){_0x2163fe=_0x2ad264;_0x2119b5[_0x6d4e('0x34')]=_[_0x6d4e('0x36')](db['ZohoField'][_0x6d4e('0x30')]);_0x2119b5[_0x6d4e('0x35')]=_[_0x6d4e('0x36')](_0x27bc4d[_0x6d4e('0x35')]);_0x2119b5[_0x6d4e('0x3e')]=_['intersection'](_0x2119b5['model'],_0x2119b5[_0x6d4e('0x35')]);_0x1ea6f5[_0x6d4e('0x38')]=_[_0x6d4e('0x37')](_0x2119b5[_0x6d4e('0x34')],qs[_0x6d4e('0x39')](_0x27bc4d['query']['fields']));_0x1ea6f5['attributes']=_0x1ea6f5['attributes'][_0x6d4e('0x51')]?_0x1ea6f5[_0x6d4e('0x38')]:_0x2119b5['model'];_0x1ea6f5[_0x6d4e('0x3b')]=qs[_0x6d4e('0x3c')](_0x27bc4d[_0x6d4e('0x35')]['sort']);_0x1ea6f5[_0x6d4e('0x3d')]=qs[_0x6d4e('0x3e')](_[_0x6d4e('0x3f')](_0x27bc4d[_0x6d4e('0x35')],_0x2119b5[_0x6d4e('0x3e')]));if(_0x27bc4d[_0x6d4e('0x35')]['filter']){_0x1ea6f5[_0x6d4e('0x3d')]=_[_0x6d4e('0x42')](_0x1ea6f5[_0x6d4e('0x3d')],{'$or':_[_0x6d4e('0x2f')](_0x1ea6f5[_0x6d4e('0x38')],function(_0x1aee7d){var _0x34c6fe={};_0x34c6fe[_0x1aee7d]={'$like':'%'+_0x27bc4d[_0x6d4e('0x35')][_0x6d4e('0x40')]+'%'};return _0x34c6fe;})});}_0x1ea6f5=_[_0x6d4e('0x42')]({},_0x1ea6f5,_0x27bc4d[_0x6d4e('0x43')]);return _0x2163fe[_0x6d4e('0x54')](_0x1ea6f5);}})[_0x6d4e('0x2a')](function(_0x4de3da){if(_0x4de3da){_0x53da42=_0x4de3da['length'];if(!_0x27bc4d[_0x6d4e('0x35')][_0x6d4e('0x3a')](_0x6d4e('0x52'))){_0x1ea6f5[_0x6d4e('0x24')]=qs['limit'](_0x27bc4d[_0x6d4e('0x35')][_0x6d4e('0x24')]);_0x1ea6f5[_0x6d4e('0x23')]=qs['offset'](_0x27bc4d['query'][_0x6d4e('0x23')]);}return _0x2163fe[_0x6d4e('0x54')](_0x1ea6f5);}})[_0x6d4e('0x2a')](function(_0x4f98db){if(_0x4f98db){return _0x4f98db?{'count':_0x53da42,'rows':_0x4f98db}:null;}})['then'](respondWithResult(_0x1b8901,null))['catch'](handleError(_0x1b8901,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 0f3bae4..62d1b10 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 _0xe334=['../../config/environment','exports','define','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1ab4e8,_0x5b75f4){var _0x23bf8b=function(_0xd0fbfb){while(--_0xd0fbfb){_0x1ab4e8['push'](_0x1ab4e8['shift']());}};_0x23bf8b(++_0x5b75f4);}(_0xe334,0x138));var _0x4e33=function(_0x40096c,_0x425333){_0x40096c=_0x40096c-0x0;var _0x562d63=_0xe334[_0x40096c];return _0x562d63;};'use strict';var _=require(_0x4e33('0x0'));var util=require(_0x4e33('0x1'));var logger=require(_0x4e33('0x2'))(_0x4e33('0x3'));var moment=require('moment');var BPromise=require(_0x4e33('0x4'));var rp=require(_0x4e33('0x5'));var fs=require('fs');var path=require(_0x4e33('0x6'));var rimraf=require('rimraf');var config=require(_0x4e33('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x4e33('0x8')]=function(_0x1ab2f1,_0x484a71){return _0x1ab2f1[_0x4e33('0x9')]('ZohoConfiguration',attributes,{'tableName':_0x4e33('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e95=['exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','./intZohoConfiguration.attributes'];(function(_0x190343,_0x42789b){var _0x53556a=function(_0x159fa2){while(--_0x159fa2){_0x190343['push'](_0x190343['shift']());}};_0x53556a(++_0x42789b);}(_0x7e95,0x184));var _0x57e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e95[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x57e9('0x0'));var util=require(_0x57e9('0x1'));var logger=require(_0x57e9('0x2'))(_0x57e9('0x3'));var moment=require('moment');var BPromise=require(_0x57e9('0x4'));var rp=require(_0x57e9('0x5'));var fs=require('fs');var path=require(_0x57e9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x57e9('0x7'));module[_0x57e9('0x8')]=function(_0x309a2b,_0x4230d3){return _0x309a2b['define'](_0x57e9('0x9'),attributes,{'tableName':_0x57e9('0xa'),'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 ba0e59d..d226d14 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 _0xf450=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x59dc07,_0x13221a){var _0x14e62b=function(_0x4a79cc){while(--_0x4a79cc){_0x59dc07['push'](_0x59dc07['shift']());}};_0x14e62b(++_0x13221a);}(_0xf450,0x1ab));var _0x0f45=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf450[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x0f45('0x0'));var util=require(_0x0f45('0x1'));var moment=require(_0x0f45('0x2'));var BPromise=require(_0x0f45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f45('0x4'));var db=require(_0x0f45('0x5'))['db'];var utils=require(_0x0f45('0x6'));var logger=require(_0x0f45('0x7'))(_0x0f45('0x8'));var config=require(_0x0f45('0x9'));var jayson=require(_0x0f45('0xa'));var client=jayson[_0x0f45('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3046e6,_0x3101ae,_0x5026cd){return new BPromise(function(_0x56e736,_0x4730bb){return client[_0x0f45('0xc')](_0x3046e6,_0x5026cd)[_0x0f45('0xd')](function(_0x180400){logger[_0x0f45('0xe')](_0x0f45('0xf'),_0x3101ae,_0x0f45('0x10'));logger[_0x0f45('0x11')](_0x0f45('0x12'),_0x3101ae,'request\x20sent',JSON['stringify'](_0x180400));if(_0x180400['error']){if(_0x180400['error'][_0x0f45('0x13')]===0x1f4){logger[_0x0f45('0x14')](_0x0f45('0xf'),_0x3101ae,_0x180400[_0x0f45('0x14')][_0x0f45('0x15')]);return _0x4730bb(_0x180400['error'][_0x0f45('0x15')]);}logger['error'](_0x0f45('0xf'),_0x3101ae,_0x180400['error']['message']);return _0x56e736(_0x180400['error'][_0x0f45('0x15')]);}else{logger['info'](_0x0f45('0xf'),_0x3101ae,_0x0f45('0x10'));_0x56e736(_0x180400[_0x0f45('0x16')][_0x0f45('0x15')]);}})[_0x0f45('0x17')](function(_0xbf83b4){logger[_0x0f45('0x14')](_0x0f45('0xf'),_0x3101ae,_0xbf83b4);_0x4730bb(_0xbf83b4);});});} \ No newline at end of file +var _0x5f34=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x584270,_0x2ef074){var _0x5f11e7=function(_0x353126){while(--_0x353126){_0x584270['push'](_0x584270['shift']());}};_0x5f11e7(++_0x2ef074);}(_0x5f34,0x1e3));var _0x45f3=function(_0x21e50b,_0x59dfc0){_0x21e50b=_0x21e50b-0x0;var _0x281315=_0x5f34[_0x21e50b];return _0x281315;};'use strict';var _=require(_0x45f3('0x0'));var util=require(_0x45f3('0x1'));var moment=require(_0x45f3('0x2'));var BPromise=require(_0x45f3('0x3'));var rs=require(_0x45f3('0x4'));var fs=require('fs');var Redis=require(_0x45f3('0x5'));var db=require(_0x45f3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x45f3('0x7'))('rpc');var config=require(_0x45f3('0x8'));var jayson=require(_0x45f3('0x9'));var client=jayson[_0x45f3('0xa')][_0x45f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a53cf,_0x1fe37e,_0x44a42a){return new BPromise(function(_0x3cb77e,_0x3707fb){return client[_0x45f3('0xc')](_0x3a53cf,_0x44a42a)[_0x45f3('0xd')](function(_0x154876){logger[_0x45f3('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x1fe37e,_0x45f3('0xf'));logger[_0x45f3('0x10')](_0x45f3('0x11'),_0x1fe37e,'request\x20sent',JSON[_0x45f3('0x12')](_0x154876));if(_0x154876[_0x45f3('0x13')]){if(_0x154876[_0x45f3('0x13')][_0x45f3('0x14')]===0x1f4){logger[_0x45f3('0x13')](_0x45f3('0x15'),_0x1fe37e,_0x154876[_0x45f3('0x13')][_0x45f3('0x16')]);return _0x3707fb(_0x154876['error'][_0x45f3('0x16')]);}logger[_0x45f3('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x1fe37e,_0x154876['error'][_0x45f3('0x16')]);return _0x3cb77e(_0x154876[_0x45f3('0x13')][_0x45f3('0x16')]);}else{logger[_0x45f3('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x1fe37e,_0x45f3('0xf'));_0x3cb77e(_0x154876[_0x45f3('0x17')][_0x45f3('0x16')]);}})[_0x45f3('0x18')](function(_0x44bdfc){logger['error'](_0x45f3('0x15'),_0x1fe37e,_0x44bdfc);_0x3707fb(_0x44bdfc);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 27881aa..cb7c3c8 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 _0xce59=['./intZohoField.controller','isAuthenticated','index','get','/:id','post','create','put','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x12019a,_0x407485){var _0x49520a=function(_0x150fb6){while(--_0x150fb6){_0x12019a['push'](_0x12019a['shift']());}};_0x49520a(++_0x407485);}(_0xce59,0x1d4));var _0x9ce5=function(_0x594c6d,_0x4d984f){_0x594c6d=_0x594c6d-0x0;var _0x522757=_0xce59[_0x594c6d];return _0x522757;};'use strict';var multer=require(_0x9ce5('0x0'));var util=require(_0x9ce5('0x1'));var path=require(_0x9ce5('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ce5('0x3'));var router=express[_0x9ce5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ce5('0x5'));var interaction=require(_0x9ce5('0x6'));var config=require(_0x9ce5('0x7'));var controller=require(_0x9ce5('0x8'));router['get']('/',auth[_0x9ce5('0x9')](),controller[_0x9ce5('0xa')]);router[_0x9ce5('0xb')](_0x9ce5('0xc'),auth[_0x9ce5('0x9')](),controller['show']);router[_0x9ce5('0xd')]('/',auth['isAuthenticated'](),controller[_0x9ce5('0xe')]);router[_0x9ce5('0xf')]('/:id',auth[_0x9ce5('0x9')](),controller[_0x9ce5('0x10')]);router['delete'](_0x9ce5('0xc'),auth[_0x9ce5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x60f0=['show','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x60f0,0x1ab));var _0x060f=function(_0x192474,_0x2f1866){_0x192474=_0x192474-0x0;var _0xbfd1ed=_0x60f0[_0x192474];return _0xbfd1ed;};'use strict';var multer=require(_0x060f('0x0'));var util=require('util');var path=require(_0x060f('0x1'));var timeout=require('connect-timeout');var express=require(_0x060f('0x2'));var router=express[_0x060f('0x3')]();var fs_extra=require(_0x060f('0x4'));var auth=require(_0x060f('0x5'));var interaction=require(_0x060f('0x6'));var config=require(_0x060f('0x7'));var controller=require(_0x060f('0x8'));router[_0x060f('0x9')]('/',auth[_0x060f('0xa')](),controller[_0x060f('0xb')]);router['get'](_0x060f('0xc'),auth[_0x060f('0xa')](),controller[_0x060f('0xd')]);router[_0x060f('0xe')]('/',auth[_0x060f('0xa')](),controller[_0x060f('0xf')]);router['put'](_0x060f('0xc'),auth[_0x060f('0xa')](),controller[_0x060f('0x10')]);router[_0x060f('0x11')](_0x060f('0xc'),auth[_0x060f('0xa')](),controller[_0x060f('0x12')]);module[_0x060f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index abdca6f..0ebe9cc 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 _0x2612=['customVariable','keyValue','picklist','STRING','sequelize','exports','string','variable'];(function(_0x306059,_0x4b5a8b){var _0x554a87=function(_0x2188d3){while(--_0x2188d3){_0x306059['push'](_0x306059['shift']());}};_0x554a87(++_0x4b5a8b);}(_0x2612,0x114));var _0x2261=function(_0x4c1fb6,_0x16eaff){_0x4c1fb6=_0x4c1fb6-0x0;var _0x303cba=_0x2612[_0x4c1fb6];return _0x303cba;};'use strict';var Sequelize=require(_0x2261('0x0'));module[_0x2261('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2261('0x2'),_0x2261('0x3'),_0x2261('0x4'),_0x2261('0x5'),_0x2261('0x6')),'defaultValue':_0x2261('0x2')},'content':{'type':Sequelize[_0x2261('0x7')]},'key':{'type':Sequelize[_0x2261('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x2261('0x2'),_0x2261('0x3'),_0x2261('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2261('0x7')]},'nameField':{'type':Sequelize[_0x2261('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2261('0x7')]}}; \ No newline at end of file +var _0x7276=['customVariable','picklist','string','STRING','BOOLEAN','exports','variable'];(function(_0x7bc444,_0x1280c9){var _0xfe9695=function(_0x5612f5){while(--_0x5612f5){_0x7bc444['push'](_0x7bc444['shift']());}};_0xfe9695(++_0x1280c9);}(_0x7276,0x1be));var _0x6727=function(_0x1b7e0c,_0x318d81){_0x1b7e0c=_0x1b7e0c-0x0;var _0x20548d=_0x7276[_0x1b7e0c];return _0x20548d;};'use strict';var Sequelize=require('sequelize');module[_0x6727('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x6727('0x1'),_0x6727('0x2'),'keyValue',_0x6727('0x3')),'defaultValue':_0x6727('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6727('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x6727('0x4'),_0x6727('0x1'),_0x6727('0x2'))},'keyContent':{'type':Sequelize[_0x6727('0x5')]},'idField':{'type':Sequelize[_0x6727('0x5')]},'nameField':{'type':Sequelize[_0x6727('0x5')]},'customField':{'type':Sequelize[_0x6727('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6727('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index b316bd8..02816cb 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 _0x9025=['map','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','ZohoField','count','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','params','destroy','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','fieldName','type','model'];(function(_0x5ca48a,_0x5a02fd){var _0x10348b=function(_0x167999){while(--_0x167999){_0x5ca48a['push'](_0x5ca48a['shift']());}};_0x10348b(++_0x5a02fd);}(_0x9025,0x17c));var _0x5902=function(_0x53ef23,_0x25ebc1){_0x53ef23=_0x53ef23-0x0;var _0x4f1dd5=_0x9025[_0x53ef23];return _0x4f1dd5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5902('0x0'));var rp=require(_0x5902('0x1'));var moment=require(_0x5902('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5902('0x3'));var util=require(_0x5902('0x4'));var path=require(_0x5902('0x5'));var sox=require(_0x5902('0x6'));var csv=require(_0x5902('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5902('0x8'));var jsforce=require(_0x5902('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x5902('0x7'));var querystring=require(_0x5902('0xa'));var Papa=require(_0x5902('0xb'));var Redis=require(_0x5902('0xc'));var authService=require(_0x5902('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5902('0xe'));var hardwareService=require(_0x5902('0xf'));var logger=require(_0x5902('0x10'))(_0x5902('0x11'));var utils=require(_0x5902('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ca7b,_0x52137d){_0x52137d=_0x52137d||0xcc;return function(_0x341bf1){if(_0x341bf1){return _0x24ca7b[_0x5902('0x13')](_0x52137d);}return _0x24ca7b['status'](_0x52137d)[_0x5902('0x14')]();};}function respondWithResult(_0x5b4fcd,_0x4979da){_0x4979da=_0x4979da||0xc8;return function(_0x40da85){if(_0x40da85){return _0x5b4fcd[_0x5902('0x15')](_0x4979da)[_0x5902('0x16')](_0x40da85);}};}function respondWithFilteredResult(_0x78ccf4,_0x5e867d){return function(_0x58cfb9){if(_0x58cfb9){var _0x1a3aee=typeof _0x5e867d[_0x5902('0x17')]===_0x5902('0x18')&&typeof _0x5e867d[_0x5902('0x19')]==='undefined';var _0x48043a=_0x58cfb9['count'];var _0x465bc6=_0x1a3aee?0x0:_0x5e867d[_0x5902('0x17')];var _0x3025d6=_0x1a3aee?_0x58cfb9['count']:_0x5e867d[_0x5902('0x17')]+_0x5e867d[_0x5902('0x19')];var _0x37ba3d;if(_0x3025d6>=_0x48043a){_0x3025d6=_0x48043a;_0x37ba3d=0xc8;}else{_0x37ba3d=0xce;}_0x78ccf4[_0x5902('0x15')](_0x37ba3d);return _0x78ccf4[_0x5902('0x1a')](_0x5902('0x1b'),_0x465bc6+'-'+_0x3025d6+'/'+_0x48043a)[_0x5902('0x16')](_0x58cfb9);}return null;};}function patchUpdates(_0x40f498){return function(_0x596073){try{jsonpatch[_0x5902('0x1c')](_0x596073,_0x40f498,!![]);}catch(_0x3bba88){return BPromise[_0x5902('0x1d')](_0x3bba88);}return _0x596073[_0x5902('0x1e')]();};}function saveUpdates(_0x4028ef,_0xdfabd7){return function(_0x37465a){if(_0x37465a){return _0x37465a[_0x5902('0x1f')](_0x4028ef)[_0x5902('0x20')](function(_0x2a6919){return _0x2a6919;});}return null;};}function removeEntity(_0x4ce6ee,_0x219200){return function(_0x3fd220){if(_0x3fd220){return _0x3fd220['destroy']()[_0x5902('0x20')](function(){_0x4ce6ee[_0x5902('0x15')](0xcc)[_0x5902('0x14')]();});}};}function handleEntityNotFound(_0x3506a,_0x5b403d){return function(_0x347fab){if(!_0x347fab){_0x3506a['sendStatus'](0x194);}return _0x347fab;};}function handleError(_0x472bf1,_0x45a08e){_0x45a08e=_0x45a08e||0x1f4;return function(_0x5c0a3d){logger[_0x5902('0x21')](_0x5c0a3d['stack']);if(_0x5c0a3d['name']){delete _0x5c0a3d[_0x5902('0x22')];}_0x472bf1[_0x5902('0x15')](_0x45a08e)[_0x5902('0x23')](_0x5c0a3d);};}exports[_0x5902('0x24')]=function(_0x26c9f8,_0xff4cbd){var _0x497370={},_0x137987={},_0x1f7915={'count':0x0,'rows':[]};var _0x41613c=_['map'](db['ZohoField']['rawAttributes'],function(_0x132b22){return{'name':_0x132b22[_0x5902('0x25')],'type':_0x132b22[_0x5902('0x26')]['key']};});_0x137987[_0x5902('0x27')]=_[_0x5902('0x28')](_0x41613c,_0x5902('0x22'));_0x137987['query']=_[_0x5902('0x29')](_0x26c9f8[_0x5902('0x2a')]);_0x137987[_0x5902('0x2b')]=_['intersection'](_0x137987[_0x5902('0x27')],_0x137987['query']);_0x497370['attributes']=_['intersection'](_0x137987['model'],qs['fields'](_0x26c9f8['query'][_0x5902('0x2c')]));_0x497370['attributes']=_0x497370[_0x5902('0x2d')][_0x5902('0x2e')]?_0x497370[_0x5902('0x2d')]:_0x137987[_0x5902('0x27')];if(!_0x26c9f8[_0x5902('0x2a')][_0x5902('0x2f')](_0x5902('0x30'))){_0x497370[_0x5902('0x19')]=qs[_0x5902('0x19')](_0x26c9f8['query'][_0x5902('0x19')]);_0x497370[_0x5902('0x17')]=qs[_0x5902('0x17')](_0x26c9f8['query']['offset']);}_0x497370[_0x5902('0x31')]=qs[_0x5902('0x32')](_0x26c9f8['query'][_0x5902('0x32')]);_0x497370[_0x5902('0x33')]=qs[_0x5902('0x2b')](_[_0x5902('0x34')](_0x26c9f8['query'],_0x137987[_0x5902('0x2b')]),_0x41613c);if(_0x26c9f8[_0x5902('0x2a')][_0x5902('0x35')]){_0x497370['where']=_['merge'](_0x497370[_0x5902('0x33')],{'$or':_['map'](_0x41613c,function(_0x3219bb){if(_0x3219bb[_0x5902('0x26')]!==_0x5902('0x36')){var _0x4df884={};_0x4df884[_0x3219bb[_0x5902('0x22')]]={'$like':'%'+_0x26c9f8[_0x5902('0x2a')]['filter']+'%'};return _0x4df884;}})});}_0x497370=_[_0x5902('0x37')]({},_0x497370,_0x26c9f8['options']);var _0x4bfe76={'where':_0x497370[_0x5902('0x33')]};return db[_0x5902('0x38')][_0x5902('0x39')](_0x4bfe76)[_0x5902('0x20')](function(_0x463820){_0x1f7915[_0x5902('0x39')]=_0x463820;if(_0x26c9f8[_0x5902('0x2a')][_0x5902('0x3a')]){_0x497370[_0x5902('0x3b')]=[{'all':!![]}];}return db[_0x5902('0x38')][_0x5902('0x3c')](_0x497370);})['then'](function(_0x3c4361){_0x1f7915[_0x5902('0x3d')]=_0x3c4361;return _0x1f7915;})[_0x5902('0x20')](respondWithFilteredResult(_0xff4cbd,_0x497370))[_0x5902('0x3e')](handleError(_0xff4cbd,null));};exports[_0x5902('0x3f')]=function(_0x5f1347,_0x3a942d){var _0x1e56bd={'raw':!![],'where':{'id':_0x5f1347['params']['id']}},_0x15f14e={};_0x15f14e[_0x5902('0x27')]=_[_0x5902('0x29')](db[_0x5902('0x38')]['rawAttributes']);_0x15f14e['query']=_['keys'](_0x5f1347[_0x5902('0x2a')]);_0x15f14e['filters']=_[_0x5902('0x40')](_0x15f14e[_0x5902('0x27')],_0x15f14e[_0x5902('0x2a')]);_0x1e56bd['attributes']=_[_0x5902('0x40')](_0x15f14e[_0x5902('0x27')],qs[_0x5902('0x2c')](_0x5f1347[_0x5902('0x2a')][_0x5902('0x2c')]));_0x1e56bd[_0x5902('0x2d')]=_0x1e56bd[_0x5902('0x2d')][_0x5902('0x2e')]?_0x1e56bd[_0x5902('0x2d')]:_0x15f14e[_0x5902('0x27')];if(_0x5f1347[_0x5902('0x2a')][_0x5902('0x3a')]){_0x1e56bd['include']=[{'all':!![]}];}_0x1e56bd=_['merge']({},_0x1e56bd,_0x5f1347['options']);return db[_0x5902('0x38')][_0x5902('0x41')](_0x1e56bd)['then'](handleEntityNotFound(_0x3a942d,null))[_0x5902('0x20')](respondWithResult(_0x3a942d,null))[_0x5902('0x3e')](handleError(_0x3a942d,null));};exports['create']=function(_0x609cc,_0x4ef8fa){return db[_0x5902('0x38')][_0x5902('0x42')](_0x609cc[_0x5902('0x43')],{})[_0x5902('0x20')](respondWithResult(_0x4ef8fa,0xc9))[_0x5902('0x3e')](handleError(_0x4ef8fa,null));};exports[_0x5902('0x1f')]=function(_0x96d719,_0x155009){if(_0x96d719[_0x5902('0x43')]['id']){delete _0x96d719[_0x5902('0x43')]['id'];}return db[_0x5902('0x38')][_0x5902('0x41')]({'where':{'id':_0x96d719[_0x5902('0x44')]['id']}})[_0x5902('0x20')](handleEntityNotFound(_0x155009,null))[_0x5902('0x20')](saveUpdates(_0x96d719[_0x5902('0x43')],null))[_0x5902('0x20')](respondWithResult(_0x155009,null))['catch'](handleError(_0x155009,null));};exports[_0x5902('0x45')]=function(_0x5a3267,_0x295561){return db[_0x5902('0x38')][_0x5902('0x41')]({'where':{'id':_0x5a3267['params']['id']}})['then'](handleEntityNotFound(_0x295561,null))['then'](removeEntity(_0x295561,null))['catch'](handleError(_0x295561,null));}; \ No newline at end of file +var _0xb22f=['options','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','end','error','stack','index','ZohoField','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params'];(function(_0x459912,_0x58250c){var _0x1b83a8=function(_0x1f854d){while(--_0x1f854d){_0x459912['push'](_0x459912['shift']());}};_0x1b83a8(++_0x58250c);}(_0xb22f,0x141));var _0xfb22=function(_0x3c6a7d,_0x343e60){_0x3c6a7d=_0x3c6a7d-0x0;var _0x554bb1=_0xb22f[_0x3c6a7d];return _0x554bb1;};'use strict';var emlformat=require(_0xfb22('0x0'));var rimraf=require(_0xfb22('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb22('0x2'));var rp=require(_0xfb22('0x3'));var moment=require('moment');var BPromise=require(_0xfb22('0x4'));var Mustache=require(_0xfb22('0x5'));var util=require(_0xfb22('0x6'));var path=require(_0xfb22('0x7'));var sox=require(_0xfb22('0x8'));var csv=require(_0xfb22('0x9'));var ejs=require(_0xfb22('0xa'));var fs=require('fs');var fs_extra=require(_0xfb22('0xb'));var _=require(_0xfb22('0xc'));var squel=require(_0xfb22('0xd'));var crypto=require(_0xfb22('0xe'));var jsforce=require(_0xfb22('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfb22('0x9'));var querystring=require(_0xfb22('0x10'));var Papa=require(_0xfb22('0x11'));var Redis=require(_0xfb22('0x12'));var authService=require(_0xfb22('0x13'));var qs=require(_0xfb22('0x14'));var as=require(_0xfb22('0x15'));var hardwareService=require(_0xfb22('0x16'));var logger=require(_0xfb22('0x17'))(_0xfb22('0x18'));var utils=require(_0xfb22('0x19'));var config=require(_0xfb22('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xfb22('0x1b'))['db'];function respondWithStatusCode(_0x30559a,_0x25db1b){_0x25db1b=_0x25db1b||0xcc;return function(_0x19a8aa){if(_0x19a8aa){return _0x30559a[_0xfb22('0x1c')](_0x25db1b);}return _0x30559a['status'](_0x25db1b)['end']();};}function respondWithResult(_0x2d7c49,_0x547b73){_0x547b73=_0x547b73||0xc8;return function(_0x4d28b7){if(_0x4d28b7){return _0x2d7c49[_0xfb22('0x1d')](_0x547b73)[_0xfb22('0x1e')](_0x4d28b7);}};}function respondWithFilteredResult(_0x11295f,_0x1ff940){return function(_0x3cd98c){if(_0x3cd98c){var _0xe0cd54=typeof _0x1ff940[_0xfb22('0x1f')]==='undefined'&&typeof _0x1ff940['limit']===_0xfb22('0x20');var _0x579d82=_0x3cd98c['count'];var _0x4c2d98=_0xe0cd54?0x0:_0x1ff940[_0xfb22('0x1f')];var _0x4a42b9=_0xe0cd54?_0x3cd98c[_0xfb22('0x21')]:_0x1ff940[_0xfb22('0x1f')]+_0x1ff940['limit'];var _0x15c547;if(_0x4a42b9>=_0x579d82){_0x4a42b9=_0x579d82;_0x15c547=0xc8;}else{_0x15c547=0xce;}_0x11295f['status'](_0x15c547);return _0x11295f[_0xfb22('0x22')](_0xfb22('0x23'),_0x4c2d98+'-'+_0x4a42b9+'/'+_0x579d82)['json'](_0x3cd98c);}return null;};}function patchUpdates(_0x2b17d8){return function(_0x528ccc){try{jsonpatch[_0xfb22('0x24')](_0x528ccc,_0x2b17d8,!![]);}catch(_0x49bd71){return BPromise[_0xfb22('0x25')](_0x49bd71);}return _0x528ccc['save']();};}function saveUpdates(_0x7a5cad,_0x25ae0c){return function(_0x2f5442){if(_0x2f5442){return _0x2f5442[_0xfb22('0x26')](_0x7a5cad)[_0xfb22('0x27')](function(_0x450b0e){return _0x450b0e;});}return null;};}function removeEntity(_0x56421c,_0x34fc28){return function(_0xe13db6){if(_0xe13db6){return _0xe13db6['destroy']()[_0xfb22('0x27')](function(){_0x56421c[_0xfb22('0x1d')](0xcc)[_0xfb22('0x28')]();});}};}function handleEntityNotFound(_0x5b852b,_0x4da339){return function(_0x4ac9cd){if(!_0x4ac9cd){_0x5b852b[_0xfb22('0x1c')](0x194);}return _0x4ac9cd;};}function handleError(_0x408ded,_0xeef9d4){_0xeef9d4=_0xeef9d4||0x1f4;return function(_0x372ef8){logger[_0xfb22('0x29')](_0x372ef8[_0xfb22('0x2a')]);if(_0x372ef8['name']){delete _0x372ef8['name'];}_0x408ded[_0xfb22('0x1d')](_0xeef9d4)['send'](_0x372ef8);};}exports[_0xfb22('0x2b')]=function(_0x3dc13b,_0x1ccdbc){var _0x1582e6={},_0x615bd1={},_0x3228b6={'count':0x0,'rows':[]};var _0x189f79=_['map'](db[_0xfb22('0x2c')][_0xfb22('0x2d')],function(_0x56b8a8){return{'name':_0x56b8a8[_0xfb22('0x2e')],'type':_0x56b8a8[_0xfb22('0x2f')][_0xfb22('0x30')]};});_0x615bd1[_0xfb22('0x31')]=_[_0xfb22('0x32')](_0x189f79,_0xfb22('0x33'));_0x615bd1[_0xfb22('0x34')]=_[_0xfb22('0x35')](_0x3dc13b['query']);_0x615bd1[_0xfb22('0x36')]=_[_0xfb22('0x37')](_0x615bd1[_0xfb22('0x31')],_0x615bd1['query']);_0x1582e6[_0xfb22('0x38')]=_['intersection'](_0x615bd1['model'],qs[_0xfb22('0x39')](_0x3dc13b['query']['fields']));_0x1582e6[_0xfb22('0x38')]=_0x1582e6['attributes'][_0xfb22('0x3a')]?_0x1582e6[_0xfb22('0x38')]:_0x615bd1['model'];if(!_0x3dc13b[_0xfb22('0x34')][_0xfb22('0x3b')](_0xfb22('0x3c'))){_0x1582e6['limit']=qs['limit'](_0x3dc13b[_0xfb22('0x34')][_0xfb22('0x3d')]);_0x1582e6[_0xfb22('0x1f')]=qs[_0xfb22('0x1f')](_0x3dc13b[_0xfb22('0x34')]['offset']);}_0x1582e6[_0xfb22('0x3e')]=qs[_0xfb22('0x3f')](_0x3dc13b[_0xfb22('0x34')][_0xfb22('0x3f')]);_0x1582e6[_0xfb22('0x40')]=qs[_0xfb22('0x36')](_['pick'](_0x3dc13b[_0xfb22('0x34')],_0x615bd1[_0xfb22('0x36')]),_0x189f79);if(_0x3dc13b[_0xfb22('0x34')][_0xfb22('0x41')]){_0x1582e6[_0xfb22('0x40')]=_[_0xfb22('0x42')](_0x1582e6[_0xfb22('0x40')],{'$or':_[_0xfb22('0x32')](_0x189f79,function(_0x393e16){if(_0x393e16[_0xfb22('0x2f')]!==_0xfb22('0x43')){var _0xa0a0fb={};_0xa0a0fb[_0x393e16[_0xfb22('0x33')]]={'$like':'%'+_0x3dc13b[_0xfb22('0x34')]['filter']+'%'};return _0xa0a0fb;}})});}_0x1582e6=_[_0xfb22('0x42')]({},_0x1582e6,_0x3dc13b['options']);var _0x3c2bbe={'where':_0x1582e6[_0xfb22('0x40')]};return db[_0xfb22('0x2c')][_0xfb22('0x21')](_0x3c2bbe)[_0xfb22('0x27')](function(_0x45813e){_0x3228b6[_0xfb22('0x21')]=_0x45813e;if(_0x3dc13b[_0xfb22('0x34')][_0xfb22('0x44')]){_0x1582e6[_0xfb22('0x45')]=[{'all':!![]}];}return db[_0xfb22('0x2c')][_0xfb22('0x46')](_0x1582e6);})[_0xfb22('0x27')](function(_0x5a248b){_0x3228b6['rows']=_0x5a248b;return _0x3228b6;})[_0xfb22('0x27')](respondWithFilteredResult(_0x1ccdbc,_0x1582e6))[_0xfb22('0x47')](handleError(_0x1ccdbc,null));};exports[_0xfb22('0x48')]=function(_0x42a46f,_0xae8d02){var _0x268c8f={'raw':!![],'where':{'id':_0x42a46f[_0xfb22('0x49')]['id']}},_0x5048ed={};_0x5048ed['model']=_[_0xfb22('0x35')](db[_0xfb22('0x2c')][_0xfb22('0x2d')]);_0x5048ed[_0xfb22('0x34')]=_[_0xfb22('0x35')](_0x42a46f[_0xfb22('0x34')]);_0x5048ed[_0xfb22('0x36')]=_['intersection'](_0x5048ed['model'],_0x5048ed[_0xfb22('0x34')]);_0x268c8f[_0xfb22('0x38')]=_[_0xfb22('0x37')](_0x5048ed['model'],qs[_0xfb22('0x39')](_0x42a46f[_0xfb22('0x34')][_0xfb22('0x39')]));_0x268c8f[_0xfb22('0x38')]=_0x268c8f[_0xfb22('0x38')][_0xfb22('0x3a')]?_0x268c8f[_0xfb22('0x38')]:_0x5048ed['model'];if(_0x42a46f[_0xfb22('0x34')][_0xfb22('0x44')]){_0x268c8f['include']=[{'all':!![]}];}_0x268c8f=_['merge']({},_0x268c8f,_0x42a46f[_0xfb22('0x4a')]);return db[_0xfb22('0x2c')][_0xfb22('0x4b')](_0x268c8f)['then'](handleEntityNotFound(_0xae8d02,null))[_0xfb22('0x27')](respondWithResult(_0xae8d02,null))[_0xfb22('0x47')](handleError(_0xae8d02,null));};exports[_0xfb22('0x4c')]=function(_0x4eb126,_0x1a9b42){return db[_0xfb22('0x2c')]['create'](_0x4eb126[_0xfb22('0x4d')],{})[_0xfb22('0x27')](respondWithResult(_0x1a9b42,0xc9))[_0xfb22('0x47')](handleError(_0x1a9b42,null));};exports[_0xfb22('0x26')]=function(_0x32ff59,_0x378afe){if(_0x32ff59[_0xfb22('0x4d')]['id']){delete _0x32ff59[_0xfb22('0x4d')]['id'];}return db[_0xfb22('0x2c')]['find']({'where':{'id':_0x32ff59['params']['id']}})[_0xfb22('0x27')](handleEntityNotFound(_0x378afe,null))[_0xfb22('0x27')](saveUpdates(_0x32ff59[_0xfb22('0x4d')],null))[_0xfb22('0x27')](respondWithResult(_0x378afe,null))[_0xfb22('0x47')](handleError(_0x378afe,null));};exports[_0xfb22('0x4e')]=function(_0x19bb66,_0x5c0146){return db['ZohoField'][_0xfb22('0x4b')]({'where':{'id':_0x19bb66[_0xfb22('0x49')]['id']}})[_0xfb22('0x27')](handleEntityNotFound(_0x5c0146,null))[_0xfb22('0x27')](removeEntity(_0x5c0146,null))[_0xfb22('0x47')](handleError(_0x5c0146,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 2b3bcd2..797ceed 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 _0xadb5=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xadb5,0xad));var _0x5adb=function(_0x5a34b5,_0x50a057){_0x5a34b5=_0x5a34b5-0x0;var _0x161468=_0xadb5[_0x5a34b5];return _0x161468;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./intZohoField.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[{'name':_0x5adb('0xb'),'fields':[_0x5adb('0xc'),_0x5adb('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['bluebird','request-promise','path','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x2f4779,_0x4b8c48){var _0x251396=function(_0xfe34ec){while(--_0xfe34ec){_0x2f4779['push'](_0x2f4779['shift']());}};_0x251396(++_0x4b8c48);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1587f9,_0x253d0c){_0x1587f9=_0x1587f9-0x0;var _0x3dc02e=_0x5f2f[_0x1587f9];return _0x3dc02e;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xf5f2('0xc'),'fields':[_0xf5f2('0xd'),_0xf5f2('0xe')],'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 ca81061..713f60c 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 _0x7a84=['code','message','ZohoField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error'];(function(_0x196e93,_0x2c1643){var _0x525b38=function(_0x2e206c){while(--_0x2e206c){_0x196e93['push'](_0x196e93['shift']());}};_0x525b38(++_0x2c1643);}(_0x7a84,0xec));var _0x47a8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a84[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x47a8('0x0'));var util=require(_0x47a8('0x1'));var moment=require(_0x47a8('0x2'));var BPromise=require(_0x47a8('0x3'));var rs=require(_0x47a8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47a8('0x5'))['db'];var utils=require(_0x47a8('0x6'));var logger=require(_0x47a8('0x7'))(_0x47a8('0x8'));var config=require('../../config/environment');var jayson=require(_0x47a8('0x9'));var client=jayson[_0x47a8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1be2c2,_0x4f604d,_0x2007a4){return new BPromise(function(_0x12ad74,_0x48c302){return client[_0x47a8('0xb')](_0x1be2c2,_0x2007a4)['then'](function(_0x50dfa2){logger[_0x47a8('0xc')]('ZohoField,\x20%s,\x20%s',_0x4f604d,_0x47a8('0xd'));logger['debug'](_0x47a8('0xe'),_0x4f604d,'request\x20sent',JSON['stringify'](_0x50dfa2));if(_0x50dfa2[_0x47a8('0xf')]){if(_0x50dfa2[_0x47a8('0xf')][_0x47a8('0x10')]===0x1f4){logger[_0x47a8('0xf')]('ZohoField,\x20%s,\x20%s',_0x4f604d,_0x50dfa2[_0x47a8('0xf')][_0x47a8('0x11')]);return _0x48c302(_0x50dfa2[_0x47a8('0xf')][_0x47a8('0x11')]);}logger[_0x47a8('0xf')](_0x47a8('0x12'),_0x4f604d,_0x50dfa2[_0x47a8('0xf')]['message']);return _0x12ad74(_0x50dfa2[_0x47a8('0xf')][_0x47a8('0x11')]);}else{logger['info'](_0x47a8('0x12'),_0x4f604d,_0x47a8('0xd'));_0x12ad74(_0x50dfa2[_0x47a8('0x13')][_0x47a8('0x11')]);}})[_0x47a8('0x14')](function(_0x3d8003){logger['error'](_0x47a8('0x12'),_0x4f604d,_0x3d8003);_0x48c302(_0x3d8003);});});} \ No newline at end of file +var _0x37e2=['info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoField,\x20%s,\x20%s','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x37e2,0x191));var _0x237e=function(_0x891ee5,_0x54cca6){_0x891ee5=_0x891ee5-0x0;var _0x58ce79=_0x37e2[_0x891ee5];return _0x58ce79;};'use strict';var _=require(_0x237e('0x0'));var util=require(_0x237e('0x1'));var moment=require('moment');var BPromise=require(_0x237e('0x2'));var rs=require(_0x237e('0x3'));var fs=require('fs');var Redis=require(_0x237e('0x4'));var db=require(_0x237e('0x5'))['db'];var utils=require(_0x237e('0x6'));var logger=require('../../config/logger')(_0x237e('0x7'));var config=require('../../config/environment');var jayson=require(_0x237e('0x8'));var client=jayson[_0x237e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43e229,_0x197e9c,_0x50f011){return new BPromise(function(_0x4f4778,_0x2266eb){return client['request'](_0x43e229,_0x50f011)[_0x237e('0xa')](function(_0x2600e0){logger['info']('ZohoField,\x20%s,\x20%s',_0x197e9c,'request\x20sent');logger[_0x237e('0xb')](_0x237e('0xc'),_0x197e9c,_0x237e('0xd'),JSON[_0x237e('0xe')](_0x2600e0));if(_0x2600e0['error']){if(_0x2600e0[_0x237e('0xf')][_0x237e('0x10')]===0x1f4){logger[_0x237e('0xf')](_0x237e('0x11'),_0x197e9c,_0x2600e0[_0x237e('0xf')][_0x237e('0x12')]);return _0x2266eb(_0x2600e0['error'][_0x237e('0x12')]);}logger[_0x237e('0xf')](_0x237e('0x11'),_0x197e9c,_0x2600e0['error']['message']);return _0x4f4778(_0x2600e0[_0x237e('0xf')][_0x237e('0x12')]);}else{logger[_0x237e('0x13')]('ZohoField,\x20%s,\x20%s',_0x197e9c,_0x237e('0xd'));_0x4f4778(_0x2600e0['result'][_0x237e('0x12')]);}})['catch'](function(_0x1e40e9){logger[_0x237e('0xf')](_0x237e('0x11'),_0x197e9c,_0x1e40e9);_0x2266eb(_0x1e40e9);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 910ff36..c37a758 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x15fed8,_0x2f722b){var _0x381a80=function(_0x250fbc){while(--_0x250fbc){_0x15fed8['push'](_0x15fed8['shift']());}};_0x381a80(++_0x2f722b);}(_0x70e0,0x17b));var _0x070e=function(_0x2f7b93,_0xa9e304){_0x2f7b93=_0x2f7b93-0x0;var _0x3e0c9a=_0x70e0[_0x2f7b93];return _0x3e0c9a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x69209b,_0x6859f1){var _0x425388=function(_0x3b6542){while(--_0x3b6542){_0x69209b['push'](_0x69209b['shift']());}};_0x425388(++_0x6859f1);}(_0x70e0,0x17b));var _0x070e=function(_0x28504a,_0x26e351){_0x28504a=_0x28504a-0x0;var _0x434667=_0x70e0[_0x28504a];return _0x434667;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 6f1535b..6bb0a81 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 _0xaedf=['sequelize','STRING','unique_name_and_version','app.js','INTEGER','state'];(function(_0x189df2,_0x296866){var _0x33518b=function(_0x4a1dae){while(--_0x4a1dae){_0x189df2['push'](_0x189df2['shift']());}};_0x33518b(++_0x296866);}(_0xaedf,0x13e));var _0xfaed=function(_0x21343f,_0x360b84){_0x21343f=_0x21343f-0x0;var _0x191d29=_0xaedf[_0x21343f];return _0x191d29;};'use strict';var Sequelize=require(_0xfaed('0x0'));module['exports']={'name':{'type':Sequelize[_0xfaed('0x1')],'allowNull':![],'unique':_0xfaed('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfaed('0x2')},'main':{'type':Sequelize[_0xfaed('0x1')],'defaultValue':_0xfaed('0x3')},'filename':{'type':Sequelize[_0xfaed('0x1')]},'path':{'type':Sequelize[_0xfaed('0x1')]},'type':{'type':Sequelize[_0xfaed('0x1')]},'size':{'type':Sequelize[_0xfaed('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xfaed('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xfaed('0x1')],'unique':_0xfaed('0x5')},'description':{'type':Sequelize[_0xfaed('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfaed('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xada1=['INTEGER','BOOLEAN','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0x2522b7,_0x491e1e){var _0x5bb952=function(_0x44f1c4){while(--_0x44f1c4){_0x2522b7['push'](_0x2522b7['shift']());}};_0x5bb952(++_0x491e1e);}(_0xada1,0xfe));var _0x1ada=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xada1[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require(_0x1ada('0x0'));module[_0x1ada('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1ada('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x1ada('0x3')],'defaultValue':_0x1ada('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x1ada('0x3')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x1ada('0x5')]},'active':{'type':Sequelize[_0x1ada('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x1ada('0x3')],'unique':'state'},'description':{'type':Sequelize[_0x1ada('0x3')]},'title':{'type':Sequelize[_0x1ada('0x3')]},'remoteUri':{'type':Sequelize[_0x1ada('0x3')]},'link':{'type':Sequelize[_0x1ada('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index ba8fd5e..f91f606 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 _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Integration','includeAll','rows','catch','show'];(function(_0x575a16,_0x18eefa){var _0x298d59=function(_0x48dfa0){while(--_0x48dfa0){_0x575a16['push'](_0x575a16['shift']());}};_0x298d59(++_0x18eefa);}(_0x0295,0x1f0));var _0x5029=function(_0x581dd6,_0x23847f){_0x581dd6=_0x581dd6-0x0;var _0x4faeb3=_0x0295[_0x581dd6];return _0x4faeb3;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['Integration'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['Integration'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));}; \ No newline at end of file +var _0x57ca=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','Integration','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','rimraf','zip-dir','request-promise','moment'];(function(_0x4967cd,_0x2fee96){var _0x1a6fd5=function(_0x33d73f){while(--_0x33d73f){_0x4967cd['push'](_0x4967cd['shift']());}};_0x1a6fd5(++_0x2fee96);}(_0x57ca,0x108));var _0xa57c=function(_0x274668,_0x554174){_0x274668=_0x274668-0x0;var _0x3cfb24=_0x57ca[_0x274668];return _0x3cfb24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['Integration']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['Integration'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 7bd801a..d366c7f 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 _0xc81b=['lodash','moment','bluebird','request-promise','path','../../config/environment','./integration.attributes','exports','Integration','integrations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc81b,0x19a));var _0xbc81=function(_0x584fc1,_0x2ea272){_0x584fc1=_0x584fc1-0x0;var _0xa4958=_0xc81b[_0x584fc1];return _0xa4958;};'use strict';var _=require(_0xbc81('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbc81('0x1'));var BPromise=require(_0xbc81('0x2'));var rp=require(_0xbc81('0x3'));var fs=require('fs');var path=require(_0xbc81('0x4'));var rimraf=require('rimraf');var config=require(_0xbc81('0x5'));var attributes=require(_0xbc81('0x6'));module[_0xbc81('0x7')]=function(_0x12e3e8,_0x232827){return _0x12e3e8['define'](_0xbc81('0x8'),attributes,{'tableName':_0xbc81('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18ee=['integrations','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x18ee,0xfe));var _0xe18e=function(_0x212e3a,_0x396549){_0x212e3a=_0x212e3a-0x0;var _0x3882d7=_0x18ee[_0x212e3a];return _0x3882d7;};'use strict';var _=require('lodash');var util=require(_0xe18e('0x0'));var logger=require('../../config/logger')(_0xe18e('0x1'));var moment=require(_0xe18e('0x2'));var BPromise=require(_0xe18e('0x3'));var rp=require(_0xe18e('0x4'));var fs=require('fs');var path=require(_0xe18e('0x5'));var rimraf=require(_0xe18e('0x6'));var config=require(_0xe18e('0x7'));var attributes=require('./integration.attributes');module[_0xe18e('0x8')]=function(_0x4296bd,_0x5ad5fc){return _0x4296bd[_0xe18e('0x9')]('Integration',attributes,{'tableName':_0xe18e('0xa'),'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 12f543e..a78b321 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x815b7c,_0xd1e418){var _0x3f9964=function(_0x9f77f){while(--_0x9f77f){_0x815b7c['push'](_0x815b7c['shift']());}};_0x3f9964(++_0xd1e418);}(_0xdb28,0x106));var _0x8db2=function(_0x53c8a6,_0x7ddbee){_0x53c8a6=_0x53c8a6-0x0;var _0x33691a=_0xdb28[_0x53c8a6];return _0x33691a;};'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')]('Integration,\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 +var _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0xe261f8,_0x4925ef){var _0x4afc23=function(_0x521616){while(--_0x521616){_0xe261f8['push'](_0xe261f8['shift']());}};_0x4afc23(++_0x4925ef);}(_0x1a85,0x178));var _0x51a8=function(_0x54abca,_0x105466){_0x54abca=_0x54abca-0x0;var _0x83d195=_0x1a85[_0x54abca];return _0x83d195;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Integration,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index a0162ba..954d26d 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 _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x10677c,_0x57bd1d){var _0x3e6748=function(_0xb4a6e5){while(--_0xb4a6e5){_0x10677c['push'](_0x10677c['shift']());}};_0x3e6748(++_0x57bd1d);}(_0xba34,0x119));var _0x4ba3=function(_0x32f54b,_0x37c05b){_0x32f54b=_0x32f54b-0x0;var _0x517f64=_0xba34[_0x32f54b];return _0x517f64;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router; \ No newline at end of file +var _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x1b4846,_0x107dbd){var _0x221422=function(_0x10afc6){while(--_0x10afc6){_0x1b4846['push'](_0x1b4846['shift']());}};_0x221422(++_0x107dbd);}(_0x7880,0x1f4));var _0x0788=function(_0x336a6e,_0x4c454f){_0x336a6e=_0x336a6e-0x0;var _0x4c0b21=_0x7880[_0x336a6e];return _0x4c0b21;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 2204317..b4d0e9a 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 _0x86bc=['DATE','TEXT','ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x42b39a,_0x52f5fd){var _0x38b81d=function(_0x44c86c){while(--_0x44c86c){_0x42b39a['push'](_0x42b39a['shift']());}};_0x38b81d(++_0x52f5fd);}(_0x86bc,0x1d4));var _0xc86b=function(_0x3f8259,_0x43e923){_0x3f8259=_0x3f8259-0x0;var _0x4581d9=_0x86bc[_0x3f8259];return _0x4581d9;};'use strict';var Sequelize=require(_0xc86b('0x0'));module[_0xc86b('0x1')]={'integration':{'type':Sequelize[_0xc86b('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xc86b('0x2')]},'ticketId':{'type':Sequelize[_0xc86b('0x2')]},'integrationId':{'type':Sequelize[_0xc86b('0x3')]},'contacts':{'type':Sequelize[_0xc86b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc86b('0x2')]},'calleridname':{'type':Sequelize[_0xc86b('0x2')]},'queue':{'type':Sequelize[_0xc86b('0x2')]},'interface':{'type':Sequelize[_0xc86b('0x2')]},'membername':{'type':Sequelize[_0xc86b('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xc86b('0x3')]},'agentcomplete':{'type':Sequelize[_0xc86b('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xc86b('0x5')]},'talktime':{'type':Sequelize[_0xc86b('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc86b('0x3')]},'reason':{'type':Sequelize[_0xc86b('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xc86b('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xc86b('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc86b('0x5')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc86b('0x2')]},'channelstate':{'type':Sequelize[_0xc86b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc86b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc86b('0x2')]},'language':{'type':Sequelize[_0xc86b('0x2')]},'accountcode':{'type':Sequelize[_0xc86b('0x2')]},'context':{'type':Sequelize[_0xc86b('0x2')]},'exten':{'type':Sequelize[_0xc86b('0x2')]},'priority':{'type':Sequelize[_0xc86b('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc86b('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xc86b('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xc86b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc86b('0x2')]},'destlanguage':{'type':Sequelize[_0xc86b('0x2')]},'destaccountcode':{'type':Sequelize[_0xc86b('0x2')]},'destcontext':{'type':Sequelize[_0xc86b('0x2')]},'destexten':{'type':Sequelize[_0xc86b('0x2')]},'destpriority':{'type':Sequelize[_0xc86b('0x2')]},'destuniqueid':{'type':Sequelize[_0xc86b('0x2')]},'messageId':{'type':Sequelize[_0xc86b('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xc86b('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xc86b('0x2')]},'attachment':{'type':Sequelize[_0xc86b('0x6')]},'html':{'type':Sequelize[_0xc86b('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xc86b('0x7')](_0xc86b('0x8'),'SENDING',_0xc86b('0x9'),_0xc86b('0xa'))},'url':{'type':Sequelize[_0xc86b('0x2')]},'app':{'type':Sequelize[_0xc86b('0x2')]},'appdata':{'type':Sequelize[_0xc86b('0x2')]},'projectId':{'type':Sequelize[_0xc86b('0x3')]}}; \ No newline at end of file +var _0xd7d6=['SENDING','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT'];(function(_0x288b6c,_0x39742c){var _0x1b905=function(_0x13b48b){while(--_0x13b48b){_0x288b6c['push'](_0x288b6c['shift']());}};_0x1b905(++_0x39742c);}(_0xd7d6,0xf4));var _0x6d7d=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0xd7d6[_0x2ed7d1];return _0x38ae3c;};'use strict';var Sequelize=require(_0x6d7d('0x0'));module[_0x6d7d('0x1')]={'integration':{'type':Sequelize[_0x6d7d('0x2')]},'eventChannel':{'type':Sequelize[_0x6d7d('0x2')]},'exitStatus':{'type':Sequelize[_0x6d7d('0x2')]},'ticketId':{'type':Sequelize[_0x6d7d('0x2')]},'integrationId':{'type':Sequelize[_0x6d7d('0x3')]},'contacts':{'type':Sequelize[_0x6d7d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6d7d('0x2')]},'calleridname':{'type':Sequelize[_0x6d7d('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x6d7d('0x2')]},'membername':{'type':Sequelize[_0x6d7d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6d7d('0x4')]},'agentconnectAt':{'type':Sequelize[_0x6d7d('0x4')]},'holdtime':{'type':Sequelize[_0x6d7d('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6d7d('0x4')]},'talktime':{'type':Sequelize[_0x6d7d('0x3')]},'agentacw':{'type':Sequelize[_0x6d7d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x6d7d('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x6d7d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6d7d('0x4')]},'agentdump':{'type':Sequelize[_0x6d7d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6d7d('0x4')]},'lastevent':{'type':Sequelize[_0x6d7d('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6d7d('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6d7d('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6d7d('0x2')]},'accountcode':{'type':Sequelize[_0x6d7d('0x2')]},'context':{'type':Sequelize[_0x6d7d('0x2')]},'exten':{'type':Sequelize[_0x6d7d('0x2')]},'priority':{'type':Sequelize[_0x6d7d('0x2')]},'destchannel':{'type':Sequelize[_0x6d7d('0x2')]},'destchannelstate':{'type':Sequelize[_0x6d7d('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x6d7d('0x2')]},'destcalleridname':{'type':Sequelize[_0x6d7d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6d7d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6d7d('0x2')]},'destlanguage':{'type':Sequelize[_0x6d7d('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6d7d('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6d7d('0x2')]},'destuniqueid':{'type':Sequelize[_0x6d7d('0x2')]},'messageId':{'type':Sequelize[_0x6d7d('0x2')]},'inReplyTo':{'type':Sequelize[_0x6d7d('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x6d7d('0x2')]},'to':{'type':Sequelize[_0x6d7d('0x2')]},'cc':{'type':Sequelize[_0x6d7d('0x2')]},'attachment':{'type':Sequelize[_0x6d7d('0x6')]},'html':{'type':Sequelize[_0x6d7d('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0x6d7d('0x7'),_0x6d7d('0x8'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x6d7d('0x2')]},'app':{'type':Sequelize[_0x6d7d('0x2')]},'appdata':{'type':Sequelize[_0x6d7d('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index b9477ed..a902b47 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 _0xe887=['find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','IntegrationReport','rawAttributes','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','name','options','includeAll','include','findAll','catch','show','params','intersection'];(function(_0x2d9a6c,_0x4f3d0){var _0x47ca03=function(_0x5ed8c6){while(--_0x5ed8c6){_0x2d9a6c['push'](_0x2d9a6c['shift']());}};_0x47ca03(++_0x4f3d0);}(_0xe887,0x1bf));var _0x7e88=function(_0x158918,_0x4c6082){_0x158918=_0x158918-0x0;var _0x171089=_0xe887[_0x158918];return _0x171089;};'use strict';var emlformat=require(_0x7e88('0x0'));var rimraf=require(_0x7e88('0x1'));var zipdir=require(_0x7e88('0x2'));var jsonpatch=require(_0x7e88('0x3'));var rp=require(_0x7e88('0x4'));var moment=require(_0x7e88('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7e88('0x6'));var util=require(_0x7e88('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7e88('0x8'));var ejs=require(_0x7e88('0x9'));var fs=require('fs');var fs_extra=require(_0x7e88('0xa'));var _=require(_0x7e88('0xb'));var squel=require('squel');var crypto=require(_0x7e88('0xc'));var jsforce=require(_0x7e88('0xd'));var deskjs=require(_0x7e88('0xe'));var toCsv=require(_0x7e88('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7e88('0xf'));var hardwareService=require(_0x7e88('0x10'));var logger=require('../../config/logger')(_0x7e88('0x11'));var utils=require(_0x7e88('0x12'));var config=require(_0x7e88('0x13'));var licenseUtil=require(_0x7e88('0x14'));var db=require(_0x7e88('0x15'))['db'];function respondWithStatusCode(_0x5d05b4,_0x573877){_0x573877=_0x573877||0xcc;return function(_0x2100e9){if(_0x2100e9){return _0x5d05b4[_0x7e88('0x16')](_0x573877);}return _0x5d05b4[_0x7e88('0x17')](_0x573877)[_0x7e88('0x18')]();};}function respondWithResult(_0xf0ee26,_0x482205){_0x482205=_0x482205||0xc8;return function(_0x55d863){if(_0x55d863){return _0xf0ee26[_0x7e88('0x17')](_0x482205)[_0x7e88('0x19')](_0x55d863);}};}function respondWithFilteredResult(_0x46b147,_0x14b527){return function(_0x20750c){if(_0x20750c){var _0x252424=typeof _0x14b527[_0x7e88('0x1a')]===_0x7e88('0x1b')&&typeof _0x14b527[_0x7e88('0x1c')]===_0x7e88('0x1b');var _0x1fa465=_0x20750c[_0x7e88('0x1d')];var _0x5b3fa3=_0x252424?0x0:_0x14b527[_0x7e88('0x1a')];var _0x53565a=_0x252424?_0x20750c[_0x7e88('0x1d')]:_0x14b527[_0x7e88('0x1a')]+_0x14b527[_0x7e88('0x1c')];var _0x441cb3;if(_0x53565a>=_0x1fa465){_0x53565a=_0x1fa465;_0x441cb3=0xc8;}else{_0x441cb3=0xce;}_0x46b147[_0x7e88('0x17')](_0x441cb3);return _0x46b147[_0x7e88('0x1e')](_0x7e88('0x1f'),_0x5b3fa3+'-'+_0x53565a+'/'+_0x1fa465)[_0x7e88('0x19')](_0x20750c);}return null;};}function patchUpdates(_0xef416a){return function(_0x4bca43){try{jsonpatch[_0x7e88('0x20')](_0x4bca43,_0xef416a,!![]);}catch(_0x34811b){return BPromise[_0x7e88('0x21')](_0x34811b);}return _0x4bca43[_0x7e88('0x22')]();};}function saveUpdates(_0x13039f,_0x34377e){return function(_0x229c63){if(_0x229c63){return _0x229c63[_0x7e88('0x23')](_0x13039f)[_0x7e88('0x24')](function(_0x33c113){return _0x33c113;});}return null;};}function removeEntity(_0x1035d1,_0x554619){return function(_0x4aee13){if(_0x4aee13){return _0x4aee13[_0x7e88('0x25')]()[_0x7e88('0x24')](function(){_0x1035d1[_0x7e88('0x17')](0xcc)[_0x7e88('0x18')]();});}};}function handleEntityNotFound(_0x3c27ef,_0x39e2f7){return function(_0x2242fc){if(!_0x2242fc){_0x3c27ef['sendStatus'](0x194);}return _0x2242fc;};}function handleError(_0x3de99f,_0x3994d1){_0x3994d1=_0x3994d1||0x1f4;return function(_0x12f7e8){logger[_0x7e88('0x26')](_0x12f7e8[_0x7e88('0x27')]);if(_0x12f7e8['name']){delete _0x12f7e8['name'];}_0x3de99f[_0x7e88('0x17')](_0x3994d1)[_0x7e88('0x28')](_0x12f7e8);};}exports[_0x7e88('0x29')]=function(_0x592e18,_0xd2b2c8){var _0x20affb={},_0x4aed61={},_0x49fa4a={'count':0x0,'rows':[]};var _0x48f36c=_['map'](db[_0x7e88('0x2a')][_0x7e88('0x2b')],function(_0xd1432a){return{'name':_0xd1432a['fieldName'],'type':_0xd1432a['type']['key']};});_0x4aed61[_0x7e88('0x2c')]=_['map'](_0x48f36c,'name');_0x4aed61[_0x7e88('0x2d')]=_[_0x7e88('0x2e')](_0x592e18[_0x7e88('0x2d')]);_0x4aed61[_0x7e88('0x2f')]=_['intersection'](_0x4aed61[_0x7e88('0x2c')],_0x4aed61['query']);_0x20affb[_0x7e88('0x30')]=_['intersection'](_0x4aed61[_0x7e88('0x2c')],qs[_0x7e88('0x31')](_0x592e18[_0x7e88('0x2d')][_0x7e88('0x31')]));_0x20affb['attributes']=_0x20affb[_0x7e88('0x30')][_0x7e88('0x32')]?_0x20affb['attributes']:_0x4aed61['model'];if(!_0x592e18['query'][_0x7e88('0x33')](_0x7e88('0x34'))){_0x20affb[_0x7e88('0x1c')]=qs[_0x7e88('0x1c')](_0x592e18['query']['limit']);_0x20affb['offset']=qs[_0x7e88('0x1a')](_0x592e18[_0x7e88('0x2d')][_0x7e88('0x1a')]);}_0x20affb[_0x7e88('0x35')]=qs[_0x7e88('0x36')](_0x592e18['query'][_0x7e88('0x36')]);_0x20affb[_0x7e88('0x37')]=qs[_0x7e88('0x2f')](_[_0x7e88('0x38')](_0x592e18[_0x7e88('0x2d')],_0x4aed61['filters']),_0x48f36c);if(_0x592e18[_0x7e88('0x2d')][_0x7e88('0x39')]){_0x20affb[_0x7e88('0x37')]=_[_0x7e88('0x3a')](_0x20affb[_0x7e88('0x37')],{'$or':_[_0x7e88('0x3b')](_0x48f36c,function(_0x224586){if(_0x224586[_0x7e88('0x3c')]!==_0x7e88('0x3d')){var _0x5a2e30={};_0x5a2e30[_0x224586[_0x7e88('0x3e')]]={'$like':'%'+_0x592e18[_0x7e88('0x2d')][_0x7e88('0x39')]+'%'};return _0x5a2e30;}})});}_0x20affb=_[_0x7e88('0x3a')]({},_0x20affb,_0x592e18[_0x7e88('0x3f')]);var _0x1e6b5b={'where':_0x20affb[_0x7e88('0x37')]};return db['IntegrationReport'][_0x7e88('0x1d')](_0x1e6b5b)[_0x7e88('0x24')](function(_0xe361b3){_0x49fa4a[_0x7e88('0x1d')]=_0xe361b3;if(_0x592e18[_0x7e88('0x2d')][_0x7e88('0x40')]){_0x20affb[_0x7e88('0x41')]=[{'all':!![]}];}return db[_0x7e88('0x2a')][_0x7e88('0x42')](_0x20affb);})[_0x7e88('0x24')](function(_0x5a30cb){_0x49fa4a['rows']=_0x5a30cb;return _0x49fa4a;})[_0x7e88('0x24')](respondWithFilteredResult(_0xd2b2c8,_0x20affb))[_0x7e88('0x43')](handleError(_0xd2b2c8,null));};exports[_0x7e88('0x44')]=function(_0x5149ef,_0x1418fc){var _0x509cb3={'raw':![],'where':{'id':_0x5149ef[_0x7e88('0x45')]['id']}},_0x2ced16={};_0x2ced16[_0x7e88('0x2c')]=_[_0x7e88('0x2e')](db['IntegrationReport'][_0x7e88('0x2b')]);_0x2ced16[_0x7e88('0x2d')]=_[_0x7e88('0x2e')](_0x5149ef['query']);_0x2ced16['filters']=_[_0x7e88('0x46')](_0x2ced16[_0x7e88('0x2c')],_0x2ced16[_0x7e88('0x2d')]);_0x509cb3[_0x7e88('0x30')]=_[_0x7e88('0x46')](_0x2ced16[_0x7e88('0x2c')],qs[_0x7e88('0x31')](_0x5149ef[_0x7e88('0x2d')]['fields']));_0x509cb3[_0x7e88('0x30')]=_0x509cb3[_0x7e88('0x30')][_0x7e88('0x32')]?_0x509cb3['attributes']:_0x2ced16[_0x7e88('0x2c')];if(_0x5149ef[_0x7e88('0x2d')]['includeAll']){_0x509cb3[_0x7e88('0x41')]=[{'all':!![]}];}_0x509cb3=_['merge']({},_0x509cb3,_0x5149ef['options']);return db[_0x7e88('0x2a')][_0x7e88('0x47')](_0x509cb3)['then'](handleEntityNotFound(_0x1418fc,null))[_0x7e88('0x24')](respondWithResult(_0x1418fc,null))[_0x7e88('0x43')](handleError(_0x1418fc,null));};exports['create']=function(_0x2ba428,_0x25cd51){return db['IntegrationReport']['create'](_0x2ba428[_0x7e88('0x48')],{})[_0x7e88('0x24')](respondWithResult(_0x25cd51,0xc9))['catch'](handleError(_0x25cd51,null));};exports['update']=function(_0x424243,_0x1ef55e){if(_0x424243[_0x7e88('0x48')]['id']){delete _0x424243['body']['id'];}return db[_0x7e88('0x2a')][_0x7e88('0x47')]({'where':{'id':_0x424243[_0x7e88('0x45')]['id']}})[_0x7e88('0x24')](handleEntityNotFound(_0x1ef55e,null))[_0x7e88('0x24')](saveUpdates(_0x424243[_0x7e88('0x48')],null))['then'](respondWithResult(_0x1ef55e,null))[_0x7e88('0x43')](handleError(_0x1ef55e,null));};exports['destroy']=function(_0x574520,_0x496cb6){return db[_0x7e88('0x2a')][_0x7e88('0x47')]({'where':{'id':_0x574520['params']['id']}})[_0x7e88('0x24')](handleEntityNotFound(_0x496cb6,null))[_0x7e88('0x24')](removeEntity(_0x496cb6,null))['catch'](handleError(_0x496cb6,null));};exports[_0x7e88('0x49')]=function(_0xbefbaf,_0x1b07f2){return db[_0x7e88('0x2a')]['describe']()['then'](respondWithResult(_0x1b07f2,null))[_0x7e88('0x43')](handleError(_0x1b07f2,null));}; \ No newline at end of file +var _0x6415=['json','undefined','limit','count','offset','status','set','Content-Range','reject','update','then','error','stack','name','map','IntegrationReport','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0x6415,0x19b));var _0x5641=function(_0xd00657,_0x54aeb1){_0xd00657=_0xd00657-0x0;var _0x4946b6=_0x6415[_0xd00657];return _0x4946b6;};'use strict';var emlformat=require(_0x5641('0x0'));var rimraf=require(_0x5641('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5641('0x2'));var rp=require(_0x5641('0x3'));var moment=require(_0x5641('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5641('0x5'));var util=require(_0x5641('0x6'));var path=require(_0x5641('0x7'));var sox=require(_0x5641('0x8'));var csv=require(_0x5641('0x9'));var ejs=require(_0x5641('0xa'));var fs=require('fs');var fs_extra=require(_0x5641('0xb'));var _=require(_0x5641('0xc'));var squel=require('squel');var crypto=require(_0x5641('0xd'));var jsforce=require(_0x5641('0xe'));var deskjs=require(_0x5641('0xf'));var toCsv=require(_0x5641('0x9'));var querystring=require('querystring');var Papa=require(_0x5641('0x10'));var Redis=require(_0x5641('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5641('0x12'));var hardwareService=require(_0x5641('0x13'));var logger=require(_0x5641('0x14'))('api');var utils=require(_0x5641('0x15'));var config=require(_0x5641('0x16'));var licenseUtil=require(_0x5641('0x17'));var db=require(_0x5641('0x18'))['db'];function respondWithStatusCode(_0x4b2253,_0x3ea4bf){_0x3ea4bf=_0x3ea4bf||0xcc;return function(_0x212951){if(_0x212951){return _0x4b2253[_0x5641('0x19')](_0x3ea4bf);}return _0x4b2253['status'](_0x3ea4bf)[_0x5641('0x1a')]();};}function respondWithResult(_0x4c4b02,_0x1f9e78){_0x1f9e78=_0x1f9e78||0xc8;return function(_0x184544){if(_0x184544){return _0x4c4b02['status'](_0x1f9e78)[_0x5641('0x1b')](_0x184544);}};}function respondWithFilteredResult(_0x4ea9df,_0x95d4f3){return function(_0x3539b4){if(_0x3539b4){var _0x399111=typeof _0x95d4f3['offset']===_0x5641('0x1c')&&typeof _0x95d4f3[_0x5641('0x1d')]===_0x5641('0x1c');var _0xc37f31=_0x3539b4[_0x5641('0x1e')];var _0x2b9662=_0x399111?0x0:_0x95d4f3[_0x5641('0x1f')];var _0x4238d5=_0x399111?_0x3539b4[_0x5641('0x1e')]:_0x95d4f3[_0x5641('0x1f')]+_0x95d4f3[_0x5641('0x1d')];var _0x56ac42;if(_0x4238d5>=_0xc37f31){_0x4238d5=_0xc37f31;_0x56ac42=0xc8;}else{_0x56ac42=0xce;}_0x4ea9df[_0x5641('0x20')](_0x56ac42);return _0x4ea9df[_0x5641('0x21')](_0x5641('0x22'),_0x2b9662+'-'+_0x4238d5+'/'+_0xc37f31)[_0x5641('0x1b')](_0x3539b4);}return null;};}function patchUpdates(_0x19387f){return function(_0x52f753){try{jsonpatch['apply'](_0x52f753,_0x19387f,!![]);}catch(_0x5438f6){return BPromise[_0x5641('0x23')](_0x5438f6);}return _0x52f753['save']();};}function saveUpdates(_0x21c315,_0x5d8263){return function(_0x77499b){if(_0x77499b){return _0x77499b[_0x5641('0x24')](_0x21c315)['then'](function(_0x5c91be){return _0x5c91be;});}return null;};}function removeEntity(_0x5d1eed,_0x8f560d){return function(_0x304ba2){if(_0x304ba2){return _0x304ba2['destroy']()[_0x5641('0x25')](function(){_0x5d1eed[_0x5641('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ca981,_0x57fae3){return function(_0x2a61f3){if(!_0x2a61f3){_0x1ca981[_0x5641('0x19')](0x194);}return _0x2a61f3;};}function handleError(_0x23e462,_0xc54a47){_0xc54a47=_0xc54a47||0x1f4;return function(_0x53b957){logger[_0x5641('0x26')](_0x53b957[_0x5641('0x27')]);if(_0x53b957[_0x5641('0x28')]){delete _0x53b957[_0x5641('0x28')];}_0x23e462[_0x5641('0x20')](_0xc54a47)['send'](_0x53b957);};}exports['index']=function(_0x4e760c,_0x182520){var _0x589273={},_0x1e2f2a={},_0xfa52a2={'count':0x0,'rows':[]};var _0x3fe940=_[_0x5641('0x29')](db[_0x5641('0x2a')]['rawAttributes'],function(_0x1bf726){return{'name':_0x1bf726[_0x5641('0x2b')],'type':_0x1bf726['type']['key']};});_0x1e2f2a[_0x5641('0x2c')]=_[_0x5641('0x29')](_0x3fe940,'name');_0x1e2f2a[_0x5641('0x2d')]=_[_0x5641('0x2e')](_0x4e760c['query']);_0x1e2f2a[_0x5641('0x2f')]=_['intersection'](_0x1e2f2a['model'],_0x1e2f2a[_0x5641('0x2d')]);_0x589273[_0x5641('0x30')]=_['intersection'](_0x1e2f2a[_0x5641('0x2c')],qs[_0x5641('0x31')](_0x4e760c[_0x5641('0x2d')][_0x5641('0x31')]));_0x589273['attributes']=_0x589273[_0x5641('0x30')][_0x5641('0x32')]?_0x589273[_0x5641('0x30')]:_0x1e2f2a[_0x5641('0x2c')];if(!_0x4e760c['query'][_0x5641('0x33')](_0x5641('0x34'))){_0x589273['limit']=qs['limit'](_0x4e760c[_0x5641('0x2d')][_0x5641('0x1d')]);_0x589273[_0x5641('0x1f')]=qs[_0x5641('0x1f')](_0x4e760c[_0x5641('0x2d')][_0x5641('0x1f')]);}_0x589273[_0x5641('0x35')]=qs[_0x5641('0x36')](_0x4e760c['query']['sort']);_0x589273['where']=qs[_0x5641('0x2f')](_['pick'](_0x4e760c[_0x5641('0x2d')],_0x1e2f2a[_0x5641('0x2f')]),_0x3fe940);if(_0x4e760c[_0x5641('0x2d')][_0x5641('0x37')]){_0x589273[_0x5641('0x38')]=_[_0x5641('0x39')](_0x589273[_0x5641('0x38')],{'$or':_[_0x5641('0x29')](_0x3fe940,function(_0x364860){if(_0x364860[_0x5641('0x3a')]!=='VIRTUAL'){var _0x4e6c26={};_0x4e6c26[_0x364860[_0x5641('0x28')]]={'$like':'%'+_0x4e760c['query'][_0x5641('0x37')]+'%'};return _0x4e6c26;}})});}_0x589273=_[_0x5641('0x39')]({},_0x589273,_0x4e760c[_0x5641('0x3b')]);var _0x304867={'where':_0x589273[_0x5641('0x38')]};return db['IntegrationReport']['count'](_0x304867)[_0x5641('0x25')](function(_0x2e84e2){_0xfa52a2[_0x5641('0x1e')]=_0x2e84e2;if(_0x4e760c[_0x5641('0x2d')][_0x5641('0x3c')]){_0x589273[_0x5641('0x3d')]=[{'all':!![]}];}return db[_0x5641('0x2a')][_0x5641('0x3e')](_0x589273);})['then'](function(_0x2a52cd){_0xfa52a2[_0x5641('0x3f')]=_0x2a52cd;return _0xfa52a2;})[_0x5641('0x25')](respondWithFilteredResult(_0x182520,_0x589273))[_0x5641('0x40')](handleError(_0x182520,null));};exports[_0x5641('0x41')]=function(_0x59cdd7,_0x997cb6){var _0x24513e={'raw':![],'where':{'id':_0x59cdd7[_0x5641('0x42')]['id']}},_0x337b65={};_0x337b65[_0x5641('0x2c')]=_[_0x5641('0x2e')](db['IntegrationReport'][_0x5641('0x43')]);_0x337b65[_0x5641('0x2d')]=_['keys'](_0x59cdd7['query']);_0x337b65['filters']=_['intersection'](_0x337b65[_0x5641('0x2c')],_0x337b65[_0x5641('0x2d')]);_0x24513e[_0x5641('0x30')]=_[_0x5641('0x44')](_0x337b65['model'],qs[_0x5641('0x31')](_0x59cdd7[_0x5641('0x2d')][_0x5641('0x31')]));_0x24513e[_0x5641('0x30')]=_0x24513e['attributes'][_0x5641('0x32')]?_0x24513e[_0x5641('0x30')]:_0x337b65[_0x5641('0x2c')];if(_0x59cdd7['query']['includeAll']){_0x24513e[_0x5641('0x3d')]=[{'all':!![]}];}_0x24513e=_['merge']({},_0x24513e,_0x59cdd7[_0x5641('0x3b')]);return db[_0x5641('0x2a')][_0x5641('0x45')](_0x24513e)[_0x5641('0x25')](handleEntityNotFound(_0x997cb6,null))[_0x5641('0x25')](respondWithResult(_0x997cb6,null))[_0x5641('0x40')](handleError(_0x997cb6,null));};exports['create']=function(_0x28b0fc,_0x3202dc){return db[_0x5641('0x2a')][_0x5641('0x46')](_0x28b0fc[_0x5641('0x47')],{})[_0x5641('0x25')](respondWithResult(_0x3202dc,0xc9))[_0x5641('0x40')](handleError(_0x3202dc,null));};exports['update']=function(_0x1aa40f,_0x1ebb8c){if(_0x1aa40f[_0x5641('0x47')]['id']){delete _0x1aa40f['body']['id'];}return db[_0x5641('0x2a')][_0x5641('0x45')]({'where':{'id':_0x1aa40f[_0x5641('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ebb8c,null))[_0x5641('0x25')](saveUpdates(_0x1aa40f[_0x5641('0x47')],null))['then'](respondWithResult(_0x1ebb8c,null))[_0x5641('0x40')](handleError(_0x1ebb8c,null));};exports['destroy']=function(_0x2ca986,_0x5605e1){return db[_0x5641('0x2a')]['find']({'where':{'id':_0x2ca986[_0x5641('0x42')]['id']}})[_0x5641('0x25')](handleEntityNotFound(_0x5605e1,null))[_0x5641('0x25')](removeEntity(_0x5605e1,null))[_0x5641('0x40')](handleError(_0x5605e1,null));};exports[_0x5641('0x48')]=function(_0x3421f5,_0x3783b2){return db[_0x5641('0x2a')][_0x5641('0x48')]()[_0x5641('0x25')](respondWithResult(_0x3783b2,null))[_0x5641('0x40')](handleError(_0x3783b2,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 6698c25..38db8ba 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 _0x6f55=['exports','define','report_integration','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x26d2ba,_0xc51eca){var _0x7548ed=function(_0x190d7a){while(--_0x190d7a){_0x26d2ba['push'](_0x26d2ba['shift']());}};_0x7548ed(++_0xc51eca);}(_0x6f55,0xd4));var _0x56f5=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x6f55[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x56f5('0x0'));var util=require('util');var logger=require(_0x56f5('0x1'))('api');var moment=require(_0x56f5('0x2'));var BPromise=require('bluebird');var rp=require(_0x56f5('0x3'));var fs=require('fs');var path=require(_0x56f5('0x4'));var rimraf=require(_0x56f5('0x5'));var config=require(_0x56f5('0x6'));var attributes=require(_0x56f5('0x7'));module[_0x56f5('0x8')]=function(_0x337352,_0x24b6b4){return _0x337352[_0x56f5('0x9')]('IntegrationReport',attributes,{'tableName':_0x56f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd250=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash','util'];(function(_0x172478,_0x1c736d){var _0x574ce1=function(_0x551aae){while(--_0x551aae){_0x172478['push'](_0x172478['shift']());}};_0x574ce1(++_0x1c736d);}(_0xd250,0x1da));var _0x0d25=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0xd250[_0x434783];return _0x13efcf;};'use strict';var _=require(_0x0d25('0x0'));var util=require(_0x0d25('0x1'));var logger=require(_0x0d25('0x2'))(_0x0d25('0x3'));var moment=require(_0x0d25('0x4'));var BPromise=require(_0x0d25('0x5'));var rp=require(_0x0d25('0x6'));var fs=require('fs');var path=require(_0x0d25('0x7'));var rimraf=require(_0x0d25('0x8'));var config=require(_0x0d25('0x9'));var attributes=require(_0x0d25('0xa'));module[_0x0d25('0xb')]=function(_0x1a8f03,_0x2f0718){return _0x1a8f03[_0x0d25('0xc')]('IntegrationReport',attributes,{'tableName':_0x0d25('0xd'),'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 7081d0a..e25f134 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(_0x2abca8,_0x4c63d3){var _0x45d797=function(_0x101a14){while(--_0x101a14){_0x2abca8['push'](_0x2abca8['shift']());}};_0x45d797(++_0x4c63d3);}(_0x2ef3,0xba));var _0x32ef=function(_0x2c204d,_0x496228){_0x2c204d=_0x2c204d-0x0;var _0x4374e3=_0x2ef3[_0x2c204d];return _0x4374e3;};'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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x4137,0xf8));var _0x7413=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4137[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index cadd2c3..8b6a7f4 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 _0x1f2b=['path','Router','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','addIntervals','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1f2b,0x76));var _0xb1f2=function(_0x45a9b1,_0x260076){_0x45a9b1=_0x45a9b1-0x0;var _0x15de97=_0x1f2b[_0x45a9b1];return _0x15de97;};'use strict';var multer=require(_0xb1f2('0x0'));var util=require(_0xb1f2('0x1'));var path=require(_0xb1f2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1f2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb1f2('0x4'));var config=require('../../config/environment');var controller=require(_0xb1f2('0x5'));router[_0xb1f2('0x6')]('/',auth[_0xb1f2('0x7')](),controller[_0xb1f2('0x8')]);router[_0xb1f2('0x6')]('/:id',auth[_0xb1f2('0x7')](),controller[_0xb1f2('0x9')]);router['get'](_0xb1f2('0xa'),auth['isAuthenticated'](),controller[_0xb1f2('0xb')]);router[_0xb1f2('0xc')]('/',auth[_0xb1f2('0x7')](),controller['create']);router[_0xb1f2('0xc')](_0xb1f2('0xa'),auth[_0xb1f2('0x7')](),controller['addInterval']);router[_0xb1f2('0xc')]('/:id/sub_intervals/create_many',auth[_0xb1f2('0x7')](),controller[_0xb1f2('0xd')]);router[_0xb1f2('0xe')](_0xb1f2('0xf'),auth[_0xb1f2('0x7')](),controller[_0xb1f2('0x10')]);router[_0xb1f2('0x11')](_0xb1f2('0xf'),auth['isAuthenticated'](),controller[_0xb1f2('0x12')]);module[_0xb1f2('0x13')]=router; \ No newline at end of file +var _0x7b27=['isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./interval.controller','get'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x7b27,0x186));var _0x77b2=function(_0xc2c01d,_0x4fab5c){_0xc2c01d=_0xc2c01d-0x0;var _0x157abd=_0x7b27[_0xc2c01d];return _0x157abd;};'use strict';var multer=require(_0x77b2('0x0'));var util=require('util');var path=require(_0x77b2('0x1'));var timeout=require(_0x77b2('0x2'));var express=require(_0x77b2('0x3'));var router=express[_0x77b2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x77b2('0x5'));var interaction=require(_0x77b2('0x6'));var config=require('../../config/environment');var controller=require(_0x77b2('0x7'));router[_0x77b2('0x8')]('/',auth[_0x77b2('0x9')](),controller['index']);router[_0x77b2('0x8')](_0x77b2('0xa'),auth[_0x77b2('0x9')](),controller[_0x77b2('0xb')]);router['get'](_0x77b2('0xc'),auth[_0x77b2('0x9')](),controller[_0x77b2('0xd')]);router[_0x77b2('0xe')]('/',auth[_0x77b2('0x9')](),controller[_0x77b2('0xf')]);router[_0x77b2('0xe')](_0x77b2('0xc'),auth['isAuthenticated'](),controller[_0x77b2('0x10')]);router[_0x77b2('0xe')]('/:id/sub_intervals/create_many',auth[_0x77b2('0x9')](),controller['addIntervals']);router[_0x77b2('0x11')](_0x77b2('0xa'),auth['isAuthenticated'](),controller[_0x77b2('0x12')]);router['delete'](_0x77b2('0xa'),auth[_0x77b2('0x9')](),controller[_0x77b2('0x13')]);module[_0x77b2('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 0509d6a..b5b403a 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 _0x48d5=['exports','STRING','sequelize'];(function(_0x4b47eb,_0x3c9321){var _0x3bb8d9=function(_0x5682ca){while(--_0x5682ca){_0x4b47eb['push'](_0x4b47eb['shift']());}};_0x3bb8d9(++_0x3c9321);}(_0x48d5,0x18e));var _0x548d=function(_0x339f67,_0x3eef63){_0x339f67=_0x339f67-0x0;var _0x9d6b2=_0x48d5[_0x339f67];return _0x9d6b2;};'use strict';var Sequelize=require(_0x548d('0x0'));module[_0x548d('0x1')]={'name':{'type':Sequelize[_0x548d('0x2')]},'description':{'type':Sequelize[_0x548d('0x2')]},'interval':{'type':Sequelize[_0x548d('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xdd17=['sequelize','STRING'];(function(_0x4c8e59,_0x39016e){var _0x124f73=function(_0x1357c2){while(--_0x1357c2){_0x4c8e59['push'](_0x4c8e59['shift']());}};_0x124f73(++_0x39016e);}(_0xdd17,0x112));var _0x7dd1=function(_0x1e7777,_0x4874d3){_0x1e7777=_0x1e7777-0x0;var _0x21eaca=_0xdd17[_0x1e7777];return _0x21eaca;};'use strict';var Sequelize=require(_0x7dd1('0x0'));module['exports']={'name':{'type':Sequelize[_0x7dd1('0x1')]},'description':{'type':Sequelize[_0x7dd1('0x1')]},'interval':{'type':Sequelize[_0x7dd1('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 585d753..2ba996e 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 _0x42dc=['user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Intervals','UserProfileResource','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Interval','findAll','rows','catch','show','params','includeAll','include','find','create','body'];(function(_0x17a47d,_0x3a048f){var _0x230e35=function(_0x40be){while(--_0x40be){_0x17a47d['push'](_0x17a47d['shift']());}};_0x230e35(++_0x3a048f);}(_0x42dc,0x6c));var _0xc42d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x42dc[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xc42d('0x0'));var rimraf=require(_0xc42d('0x1'));var zipdir=require(_0xc42d('0x2'));var jsonpatch=require(_0xc42d('0x3'));var rp=require(_0xc42d('0x4'));var moment=require(_0xc42d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc42d('0x6'));var util=require(_0xc42d('0x7'));var path=require('path');var sox=require(_0xc42d('0x8'));var csv=require(_0xc42d('0x9'));var ejs=require(_0xc42d('0xa'));var fs=require('fs');var fs_extra=require(_0xc42d('0xb'));var _=require(_0xc42d('0xc'));var squel=require('squel');var crypto=require(_0xc42d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc42d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc42d('0xf'));var Papa=require(_0xc42d('0x10'));var Redis=require(_0xc42d('0x11'));var authService=require(_0xc42d('0x12'));var qs=require(_0xc42d('0x13'));var as=require(_0xc42d('0x14'));var hardwareService=require(_0xc42d('0x15'));var logger=require(_0xc42d('0x16'))(_0xc42d('0x17'));var utils=require(_0xc42d('0x18'));var config=require(_0xc42d('0x19'));var licenseUtil=require(_0xc42d('0x1a'));var db=require(_0xc42d('0x1b'))['db'];var extensions=require(_0xc42d('0x1c'));function respondWithStatusCode(_0x589f29,_0x144598){_0x144598=_0x144598||0xcc;return function(_0x5c2a3b){if(_0x5c2a3b){return _0x589f29[_0xc42d('0x1d')](_0x144598);}return _0x589f29[_0xc42d('0x1e')](_0x144598)[_0xc42d('0x1f')]();};}function respondWithResult(_0x43797c,_0x589187){_0x589187=_0x589187||0xc8;return function(_0x5ac7fb){if(_0x5ac7fb){return _0x43797c[_0xc42d('0x1e')](_0x589187)[_0xc42d('0x20')](_0x5ac7fb);}};}function respondWithFilteredResult(_0x5a58df,_0x32b079){return function(_0x7a9dfd){if(_0x7a9dfd){var _0xf28c99=typeof _0x32b079[_0xc42d('0x21')]===_0xc42d('0x22')&&typeof _0x32b079[_0xc42d('0x23')]===_0xc42d('0x22');var _0x37dfeb=_0x7a9dfd[_0xc42d('0x24')];var _0x1c48fe=_0xf28c99?0x0:_0x32b079['offset'];var _0x1f8633=_0xf28c99?_0x7a9dfd['count']:_0x32b079[_0xc42d('0x21')]+_0x32b079[_0xc42d('0x23')];var _0x1af620;if(_0x1f8633>=_0x37dfeb){_0x1f8633=_0x37dfeb;_0x1af620=0xc8;}else{_0x1af620=0xce;}_0x5a58df[_0xc42d('0x1e')](_0x1af620);return _0x5a58df[_0xc42d('0x25')](_0xc42d('0x26'),_0x1c48fe+'-'+_0x1f8633+'/'+_0x37dfeb)[_0xc42d('0x20')](_0x7a9dfd);}return null;};}function patchUpdates(_0xc3e1b5){return function(_0x487754){try{jsonpatch[_0xc42d('0x27')](_0x487754,_0xc3e1b5,!![]);}catch(_0x6d8e7e){return BPromise['reject'](_0x6d8e7e);}return _0x487754[_0xc42d('0x28')]();};}function saveUpdates(_0x20f3b4,_0x5773ac){return function(_0x191f70){if(_0x191f70){return _0x191f70[_0xc42d('0x29')](_0x20f3b4)[_0xc42d('0x2a')](function(_0x52bd39){return _0x52bd39;});}return null;};}function removeEntity(_0x267c8b,_0x4c0bfc){return function(_0x46cbe2){if(_0x46cbe2){return _0x46cbe2[_0xc42d('0x2b')]()[_0xc42d('0x2a')](function(){var _0x5ac65a=_0x46cbe2[_0xc42d('0x2c')]({'plain':!![]});var _0x3edd6d=_0xc42d('0x2d');return db[_0xc42d('0x2e')]['destroy']({'where':{'type':_0x3edd6d,'resourceId':_0x5ac65a['id']}})[_0xc42d('0x2a')](function(){return _0x46cbe2;});})[_0xc42d('0x2a')](function(){_0x267c8b[_0xc42d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3033b9,_0x2cb672){return function(_0x137cd9){if(!_0x137cd9){_0x3033b9[_0xc42d('0x1d')](0x194);}return _0x137cd9;};}function handleError(_0x138cd6,_0x2de605){_0x2de605=_0x2de605||0x1f4;return function(_0x18479d){logger['error'](_0x18479d['stack']);if(_0x18479d[_0xc42d('0x2f')]){delete _0x18479d['name'];}_0x138cd6['status'](_0x2de605)[_0xc42d('0x30')](_0x18479d);};}exports[_0xc42d('0x31')]=function(_0x62d529,_0x4626b8){var _0xd6f03b={},_0x1296a5={},_0xb637ac={'count':0x0,'rows':[]};var _0x1ff281=_[_0xc42d('0x32')](db['Interval'][_0xc42d('0x33')],function(_0x23f546){return{'name':_0x23f546[_0xc42d('0x34')],'type':_0x23f546['type']['key']};});_0x1296a5[_0xc42d('0x35')]=_[_0xc42d('0x32')](_0x1ff281,'name');_0x1296a5[_0xc42d('0x36')]=_[_0xc42d('0x37')](_0x62d529[_0xc42d('0x36')]);_0x1296a5[_0xc42d('0x38')]=_[_0xc42d('0x39')](_0x1296a5[_0xc42d('0x35')],_0x1296a5[_0xc42d('0x36')]);_0xd6f03b[_0xc42d('0x3a')]=_[_0xc42d('0x39')](_0x1296a5[_0xc42d('0x35')],qs[_0xc42d('0x3b')](_0x62d529[_0xc42d('0x36')]['fields']));_0xd6f03b['attributes']=_0xd6f03b[_0xc42d('0x3a')][_0xc42d('0x3c')]?_0xd6f03b[_0xc42d('0x3a')]:_0x1296a5[_0xc42d('0x35')];if(!_0x62d529[_0xc42d('0x36')][_0xc42d('0x3d')]('nolimit')){_0xd6f03b[_0xc42d('0x23')]=qs[_0xc42d('0x23')](_0x62d529[_0xc42d('0x36')][_0xc42d('0x23')]);_0xd6f03b[_0xc42d('0x21')]=qs[_0xc42d('0x21')](_0x62d529['query']['offset']);}_0xd6f03b[_0xc42d('0x3e')]=qs[_0xc42d('0x3f')](_0x62d529[_0xc42d('0x36')][_0xc42d('0x3f')]);_0xd6f03b[_0xc42d('0x40')]=qs[_0xc42d('0x38')](_[_0xc42d('0x41')](_0x62d529['query'],_0x1296a5[_0xc42d('0x38')]),_0x1ff281);if(_0x62d529[_0xc42d('0x36')][_0xc42d('0x42')]){_0xd6f03b[_0xc42d('0x40')]=_[_0xc42d('0x43')](_0xd6f03b[_0xc42d('0x40')],{'$or':_[_0xc42d('0x32')](_0x1ff281,function(_0x1aecb6){if(_0x1aecb6[_0xc42d('0x44')]!==_0xc42d('0x45')){var _0x597ad9={};_0x597ad9[_0x1aecb6[_0xc42d('0x2f')]]={'$like':'%'+_0x62d529['query']['filter']+'%'};return _0x597ad9;}})});}_0xd6f03b=_[_0xc42d('0x43')]({},_0xd6f03b,_0x62d529[_0xc42d('0x46')]);var _0x4c2dd9={'where':_0xd6f03b[_0xc42d('0x40')]};return db[_0xc42d('0x47')][_0xc42d('0x24')](_0x4c2dd9)[_0xc42d('0x2a')](function(_0x53e570){_0xb637ac[_0xc42d('0x24')]=_0x53e570;if(_0x62d529[_0xc42d('0x36')]['includeAll']){_0xd6f03b['include']=[{'all':!![]}];}return db[_0xc42d('0x47')][_0xc42d('0x48')](_0xd6f03b);})[_0xc42d('0x2a')](function(_0x341d09){_0xb637ac[_0xc42d('0x49')]=_0x341d09;return _0xb637ac;})['then'](respondWithFilteredResult(_0x4626b8,_0xd6f03b))[_0xc42d('0x4a')](handleError(_0x4626b8,null));};exports[_0xc42d('0x4b')]=function(_0x56434a,_0x268b6d){var _0x432083={'raw':!![],'where':{'id':_0x56434a[_0xc42d('0x4c')]['id']}},_0x5b50b2={};_0x5b50b2[_0xc42d('0x35')]=_[_0xc42d('0x37')](db[_0xc42d('0x47')][_0xc42d('0x33')]);_0x5b50b2[_0xc42d('0x36')]=_[_0xc42d('0x37')](_0x56434a['query']);_0x5b50b2['filters']=_[_0xc42d('0x39')](_0x5b50b2['model'],_0x5b50b2[_0xc42d('0x36')]);_0x432083[_0xc42d('0x3a')]=_[_0xc42d('0x39')](_0x5b50b2[_0xc42d('0x35')],qs[_0xc42d('0x3b')](_0x56434a[_0xc42d('0x36')][_0xc42d('0x3b')]));_0x432083[_0xc42d('0x3a')]=_0x432083[_0xc42d('0x3a')][_0xc42d('0x3c')]?_0x432083[_0xc42d('0x3a')]:_0x5b50b2[_0xc42d('0x35')];if(_0x56434a[_0xc42d('0x36')][_0xc42d('0x4d')]){_0x432083[_0xc42d('0x4e')]=[{'all':!![]}];}_0x432083=_[_0xc42d('0x43')]({},_0x432083,_0x56434a[_0xc42d('0x46')]);return db[_0xc42d('0x47')][_0xc42d('0x4f')](_0x432083)[_0xc42d('0x2a')](handleEntityNotFound(_0x268b6d,null))[_0xc42d('0x2a')](respondWithResult(_0x268b6d,null))[_0xc42d('0x4a')](handleError(_0x268b6d,null));};exports[_0xc42d('0x50')]=function(_0x4b7b71,_0x2fea1f){return db[_0xc42d('0x47')][_0xc42d('0x50')](_0x4b7b71[_0xc42d('0x51')],{})[_0xc42d('0x2a')](function(_0x13000a){var _0x25c03e=_0x4b7b71[_0xc42d('0x52')][_0xc42d('0x2c')]({'plain':!![]});if(!_0x25c03e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25c03e['role']===_0xc42d('0x52')){var _0x58eaa4=_0x13000a[_0xc42d('0x2c')]({'plain':!![]});var _0x505d3b=_0xc42d('0x2d');return db[_0xc42d('0x53')][_0xc42d('0x4f')]({'where':{'name':_0x505d3b,'userProfileId':_0x25c03e['userProfileId']},'raw':!![]})[_0xc42d('0x2a')](function(_0x4dd17b){if(_0x4dd17b&&_0x4dd17b[_0xc42d('0x54')]===0x0){return db[_0xc42d('0x2e')][_0xc42d('0x50')]({'name':_0x58eaa4[_0xc42d('0x2f')],'resourceId':_0x58eaa4['id'],'type':_0x4dd17b[_0xc42d('0x2f')],'sectionId':_0x4dd17b['id']},{})[_0xc42d('0x2a')](function(){return _0x13000a;});}else{return _0x13000a;}})[_0xc42d('0x4a')](function(_0xa57d40){logger[_0xc42d('0x55')](_0xc42d('0x56'),_0xa57d40);throw _0xa57d40;});}return _0x13000a;})[_0xc42d('0x2a')](respondWithResult(_0x2fea1f,0xc9))[_0xc42d('0x4a')](handleError(_0x2fea1f,null));};exports[_0xc42d('0x29')]=function(_0x453109,_0x51aaed){if(_0x453109[_0xc42d('0x51')]['id']){delete _0x453109[_0xc42d('0x51')]['id'];}return db['Interval']['find']({'where':{'id':_0x453109[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2a')](handleEntityNotFound(_0x51aaed,null))[_0xc42d('0x2a')](saveUpdates(_0x453109[_0xc42d('0x51')],null))[_0xc42d('0x2a')](respondWithResult(_0x51aaed,null))[_0xc42d('0x4a')](handleError(_0x51aaed,null));};exports[_0xc42d('0x2b')]=function(_0x4b0798,_0x1e5f86){return db['Interval']['find']({'where':{'id':_0x4b0798[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2a')](handleEntityNotFound(_0x1e5f86,null))['then'](removeEntity(_0x1e5f86,null))[_0xc42d('0x4a')](handleError(_0x1e5f86,null));};exports[_0xc42d('0x57')]=function(_0x499d83,_0x4965ad,_0x48f1ba){if(_0x499d83[_0xc42d('0x51')]['id']){delete _0x499d83[_0xc42d('0x51')]['id'];}return db[_0xc42d('0x47')][_0xc42d('0x4f')]({'where':{'id':_0x499d83[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2a')](handleEntityNotFound(_0x4965ad,null))[_0xc42d('0x2a')](function(_0x5b16f3){if(_0x5b16f3){_0x499d83[_0xc42d('0x51')][_0xc42d('0x58')]=_0x5b16f3['id'];return db['Interval'][_0xc42d('0x50')](_0x499d83['body']);}})['then'](respondWithResult(_0x4965ad,null))[_0xc42d('0x4a')](handleError(_0x4965ad,null));};exports[_0xc42d('0x59')]=function(_0x2eab8d,_0x23db1e,_0x3e1785){var _0xd808e1={};var _0xd3f1aa={};var _0x10e0c0;var _0x547cf3;return db['Interval'][_0xc42d('0x5a')]({'where':{'id':_0x2eab8d[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2a')](handleEntityNotFound(_0x23db1e,null))[_0xc42d('0x2a')](function(_0x2215fe){if(_0x2215fe){_0x10e0c0=_0x2215fe;_0xd3f1aa[_0xc42d('0x35')]=_[_0xc42d('0x37')](db[_0xc42d('0x47')][_0xc42d('0x33')]);_0xd3f1aa[_0xc42d('0x36')]=_[_0xc42d('0x37')](_0x2eab8d[_0xc42d('0x36')]);_0xd3f1aa[_0xc42d('0x38')]=_[_0xc42d('0x39')](_0xd3f1aa[_0xc42d('0x35')],_0xd3f1aa[_0xc42d('0x36')]);_0xd808e1[_0xc42d('0x3a')]=_[_0xc42d('0x39')](_0xd3f1aa['model'],qs[_0xc42d('0x3b')](_0x2eab8d['query'][_0xc42d('0x3b')]));_0xd808e1[_0xc42d('0x3a')]=_0xd808e1[_0xc42d('0x3a')][_0xc42d('0x3c')]?_0xd808e1[_0xc42d('0x3a')]:_0xd3f1aa['model'];_0xd808e1[_0xc42d('0x3e')]=qs[_0xc42d('0x3f')](_0x2eab8d[_0xc42d('0x36')]['sort']);_0xd808e1[_0xc42d('0x40')]=qs['filters'](_['pick'](_0x2eab8d[_0xc42d('0x36')],_0xd3f1aa[_0xc42d('0x38')]));if(_0x2eab8d[_0xc42d('0x36')]['filter']){_0xd808e1[_0xc42d('0x40')]=_['merge'](_0xd808e1[_0xc42d('0x40')],{'$or':_[_0xc42d('0x32')](_0xd808e1[_0xc42d('0x3a')],function(_0x4c0e29){var _0x50a574={};_0x50a574[_0x4c0e29]={'$like':'%'+_0x2eab8d[_0xc42d('0x36')][_0xc42d('0x42')]+'%'};return _0x50a574;})});}_0xd808e1=_[_0xc42d('0x43')]({},_0xd808e1,_0x2eab8d[_0xc42d('0x46')]);return _0x10e0c0[_0xc42d('0x59')](_0xd808e1);}})[_0xc42d('0x2a')](function(_0x50ba3e){if(_0x50ba3e){_0x547cf3=_0x50ba3e[_0xc42d('0x3c')];if(!_0x2eab8d[_0xc42d('0x36')][_0xc42d('0x3d')]('nolimit')){_0xd808e1[_0xc42d('0x23')]=qs[_0xc42d('0x23')](_0x2eab8d[_0xc42d('0x36')][_0xc42d('0x23')]);_0xd808e1['offset']=qs[_0xc42d('0x21')](_0x2eab8d[_0xc42d('0x36')][_0xc42d('0x21')]);}return _0x10e0c0[_0xc42d('0x59')](_0xd808e1);}})[_0xc42d('0x2a')](function(_0x1bff16){if(_0x1bff16){return _0x1bff16?{'count':_0x547cf3,'rows':_0x1bff16}:null;}})[_0xc42d('0x2a')](respondWithResult(_0x23db1e,null))['catch'](handleError(_0x23db1e,null));};exports[_0xc42d('0x5b')]=function(_0x1237f0,_0x776cdf,_0x2bae89){return db[_0xc42d('0x47')][_0xc42d('0x5a')]({'where':{'id':_0x1237f0[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2a')](handleEntityNotFound(_0x776cdf,null))[_0xc42d('0x2a')](function(_0x2973f8){if(_0x2973f8){return db[_0xc42d('0x5c')][_0xc42d('0x5d')](function(_0x232524){return db[_0xc42d('0x47')][_0xc42d('0x2b')]({'where':{'IntervalId':_0x1237f0[_0xc42d('0x4c')]['id']},'transaction':_0x232524})['then'](function(_0x175b63){var _0x352b46=_['map'](_0x1237f0['body'],function(_0x4a8703){delete _0x4a8703['id'];_0x4a8703[_0xc42d('0x58')]=_0x1237f0[_0xc42d('0x4c')]['id'];return _0x4a8703;});return db[_0xc42d('0x47')][_0xc42d('0x5e')](_0x352b46,{'transaction':_0x232524});});})['then'](function(){return db[_0xc42d('0x47')][_0xc42d('0x48')]({'where':{'IntervalId':_0x1237f0[_0xc42d('0x4c')]['id']}});});}})[_0xc42d('0x2a')](respondWithResult(_0x776cdf,null))['catch'](handleError(_0x776cdf,null));}; \ No newline at end of file +var _0xb291=['name','send','map','Interval','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','order','addIntervals','sequelize','transaction','findAll','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','then','destroy','get','Intervals','UserProfileResource','end','stack'];(function(_0x165d3c,_0x3ba20d){var _0xc27339=function(_0x1f279f){while(--_0x1f279f){_0x165d3c['push'](_0x165d3c['shift']());}};_0xc27339(++_0x3ba20d);}(_0xb291,0xe4));var _0x1b29=function(_0x464cee,_0x302661){_0x464cee=_0x464cee-0x0;var _0x1f6d44=_0xb291[_0x464cee];return _0x1f6d44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b29('0x0'));var zipdir=require(_0x1b29('0x1'));var jsonpatch=require(_0x1b29('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b29('0x3'));var path=require(_0x1b29('0x4'));var sox=require(_0x1b29('0x5'));var csv=require(_0x1b29('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b29('0x7'));var _=require(_0x1b29('0x8'));var squel=require(_0x1b29('0x9'));var crypto=require(_0x1b29('0xa'));var jsforce=require(_0x1b29('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1b29('0x6'));var querystring=require(_0x1b29('0xc'));var Papa=require(_0x1b29('0xd'));var Redis=require('ioredis');var authService=require(_0x1b29('0xe'));var qs=require(_0x1b29('0xf'));var as=require(_0x1b29('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b29('0x11'))(_0x1b29('0x12'));var utils=require(_0x1b29('0x13'));var config=require(_0x1b29('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b29('0x15'))['db'];var extensions=require(_0x1b29('0x16'));function respondWithStatusCode(_0xc756a4,_0x523d2f){_0x523d2f=_0x523d2f||0xcc;return function(_0x3369c0){if(_0x3369c0){return _0xc756a4[_0x1b29('0x17')](_0x523d2f);}return _0xc756a4[_0x1b29('0x18')](_0x523d2f)['end']();};}function respondWithResult(_0x58bb8f,_0x35094b){_0x35094b=_0x35094b||0xc8;return function(_0x2dc7d6){if(_0x2dc7d6){return _0x58bb8f[_0x1b29('0x18')](_0x35094b)[_0x1b29('0x19')](_0x2dc7d6);}};}function respondWithFilteredResult(_0x26762a,_0x10232d){return function(_0x524f9c){if(_0x524f9c){var _0x241426=typeof _0x10232d['offset']===_0x1b29('0x1a')&&typeof _0x10232d['limit']===_0x1b29('0x1a');var _0x4acc8c=_0x524f9c['count'];var _0xcaad2b=_0x241426?0x0:_0x10232d[_0x1b29('0x1b')];var _0x32c2b6=_0x241426?_0x524f9c[_0x1b29('0x1c')]:_0x10232d['offset']+_0x10232d[_0x1b29('0x1d')];var _0x5bbdf6;if(_0x32c2b6>=_0x4acc8c){_0x32c2b6=_0x4acc8c;_0x5bbdf6=0xc8;}else{_0x5bbdf6=0xce;}_0x26762a['status'](_0x5bbdf6);return _0x26762a[_0x1b29('0x1e')](_0x1b29('0x1f'),_0xcaad2b+'-'+_0x32c2b6+'/'+_0x4acc8c)[_0x1b29('0x19')](_0x524f9c);}return null;};}function patchUpdates(_0x40fcf2){return function(_0x5e5541){try{jsonpatch[_0x1b29('0x20')](_0x5e5541,_0x40fcf2,!![]);}catch(_0x431476){return BPromise['reject'](_0x431476);}return _0x5e5541[_0x1b29('0x21')]();};}function saveUpdates(_0x3aabe4,_0x2b7fc9){return function(_0x56892c){if(_0x56892c){return _0x56892c[_0x1b29('0x22')](_0x3aabe4)[_0x1b29('0x23')](function(_0x494457){return _0x494457;});}return null;};}function removeEntity(_0x56f9a9,_0x41b3cd){return function(_0x58e102){if(_0x58e102){return _0x58e102[_0x1b29('0x24')]()['then'](function(){var _0x11f2b5=_0x58e102[_0x1b29('0x25')]({'plain':!![]});var _0x5a04a1=_0x1b29('0x26');return db[_0x1b29('0x27')][_0x1b29('0x24')]({'where':{'type':_0x5a04a1,'resourceId':_0x11f2b5['id']}})['then'](function(){return _0x58e102;});})[_0x1b29('0x23')](function(){_0x56f9a9[_0x1b29('0x18')](0xcc)[_0x1b29('0x28')]();});}};}function handleEntityNotFound(_0x2ef6f0,_0x2a23ec){return function(_0x571c7e){if(!_0x571c7e){_0x2ef6f0[_0x1b29('0x17')](0x194);}return _0x571c7e;};}function handleError(_0x41366d,_0x2a9bed){_0x2a9bed=_0x2a9bed||0x1f4;return function(_0x14951b){logger['error'](_0x14951b[_0x1b29('0x29')]);if(_0x14951b[_0x1b29('0x2a')]){delete _0x14951b[_0x1b29('0x2a')];}_0x41366d[_0x1b29('0x18')](_0x2a9bed)[_0x1b29('0x2b')](_0x14951b);};}exports['index']=function(_0x2d31c8,_0x3dc76a){var _0x2967aa={},_0x293f5e={},_0x5e9148={'count':0x0,'rows':[]};var _0x1ed5f2=_[_0x1b29('0x2c')](db[_0x1b29('0x2d')][_0x1b29('0x2e')],function(_0x3e01b2){return{'name':_0x3e01b2[_0x1b29('0x2f')],'type':_0x3e01b2[_0x1b29('0x30')][_0x1b29('0x31')]};});_0x293f5e['model']=_['map'](_0x1ed5f2,_0x1b29('0x2a'));_0x293f5e[_0x1b29('0x32')]=_['keys'](_0x2d31c8['query']);_0x293f5e[_0x1b29('0x33')]=_[_0x1b29('0x34')](_0x293f5e[_0x1b29('0x35')],_0x293f5e[_0x1b29('0x32')]);_0x2967aa[_0x1b29('0x36')]=_[_0x1b29('0x34')](_0x293f5e[_0x1b29('0x35')],qs[_0x1b29('0x37')](_0x2d31c8['query'][_0x1b29('0x37')]));_0x2967aa['attributes']=_0x2967aa[_0x1b29('0x36')][_0x1b29('0x38')]?_0x2967aa[_0x1b29('0x36')]:_0x293f5e[_0x1b29('0x35')];if(!_0x2d31c8[_0x1b29('0x32')][_0x1b29('0x39')](_0x1b29('0x3a'))){_0x2967aa[_0x1b29('0x1d')]=qs[_0x1b29('0x1d')](_0x2d31c8[_0x1b29('0x32')]['limit']);_0x2967aa[_0x1b29('0x1b')]=qs[_0x1b29('0x1b')](_0x2d31c8['query'][_0x1b29('0x1b')]);}_0x2967aa['order']=qs[_0x1b29('0x3b')](_0x2d31c8[_0x1b29('0x32')]['sort']);_0x2967aa[_0x1b29('0x3c')]=qs[_0x1b29('0x33')](_[_0x1b29('0x3d')](_0x2d31c8['query'],_0x293f5e[_0x1b29('0x33')]),_0x1ed5f2);if(_0x2d31c8[_0x1b29('0x32')][_0x1b29('0x3e')]){_0x2967aa[_0x1b29('0x3c')]=_[_0x1b29('0x3f')](_0x2967aa['where'],{'$or':_[_0x1b29('0x2c')](_0x1ed5f2,function(_0x35e2b8){if(_0x35e2b8[_0x1b29('0x30')]!=='VIRTUAL'){var _0x423d33={};_0x423d33[_0x35e2b8['name']]={'$like':'%'+_0x2d31c8[_0x1b29('0x32')]['filter']+'%'};return _0x423d33;}})});}_0x2967aa=_[_0x1b29('0x3f')]({},_0x2967aa,_0x2d31c8[_0x1b29('0x40')]);var _0x2628fc={'where':_0x2967aa[_0x1b29('0x3c')]};return db[_0x1b29('0x2d')][_0x1b29('0x1c')](_0x2628fc)[_0x1b29('0x23')](function(_0x3cd81b){_0x5e9148['count']=_0x3cd81b;if(_0x2d31c8['query'][_0x1b29('0x41')]){_0x2967aa[_0x1b29('0x42')]=[{'all':!![]}];}return db[_0x1b29('0x2d')]['findAll'](_0x2967aa);})[_0x1b29('0x23')](function(_0x4d7005){_0x5e9148['rows']=_0x4d7005;return _0x5e9148;})['then'](respondWithFilteredResult(_0x3dc76a,_0x2967aa))[_0x1b29('0x43')](handleError(_0x3dc76a,null));};exports[_0x1b29('0x44')]=function(_0x180cab,_0x2664fd){var _0x3f953a={'raw':!![],'where':{'id':_0x180cab[_0x1b29('0x45')]['id']}},_0x9f44ae={};_0x9f44ae['model']=_[_0x1b29('0x46')](db[_0x1b29('0x2d')][_0x1b29('0x2e')]);_0x9f44ae['query']=_[_0x1b29('0x46')](_0x180cab[_0x1b29('0x32')]);_0x9f44ae[_0x1b29('0x33')]=_[_0x1b29('0x34')](_0x9f44ae[_0x1b29('0x35')],_0x9f44ae[_0x1b29('0x32')]);_0x3f953a['attributes']=_['intersection'](_0x9f44ae[_0x1b29('0x35')],qs[_0x1b29('0x37')](_0x180cab[_0x1b29('0x32')][_0x1b29('0x37')]));_0x3f953a[_0x1b29('0x36')]=_0x3f953a[_0x1b29('0x36')][_0x1b29('0x38')]?_0x3f953a[_0x1b29('0x36')]:_0x9f44ae[_0x1b29('0x35')];if(_0x180cab['query'][_0x1b29('0x41')]){_0x3f953a['include']=[{'all':!![]}];}_0x3f953a=_[_0x1b29('0x3f')]({},_0x3f953a,_0x180cab[_0x1b29('0x40')]);return db[_0x1b29('0x2d')][_0x1b29('0x47')](_0x3f953a)[_0x1b29('0x23')](handleEntityNotFound(_0x2664fd,null))[_0x1b29('0x23')](respondWithResult(_0x2664fd,null))[_0x1b29('0x43')](handleError(_0x2664fd,null));};exports['create']=function(_0x1004eb,_0x556d96){return db['Interval'][_0x1b29('0x48')](_0x1004eb[_0x1b29('0x49')],{})[_0x1b29('0x23')](function(_0x1f054b){var _0x48cef2=_0x1004eb[_0x1b29('0x4a')]['get']({'plain':!![]});if(!_0x48cef2)throw new Error(_0x1b29('0x4b'));if(_0x48cef2[_0x1b29('0x4c')]===_0x1b29('0x4a')){var _0x56ec89=_0x1f054b['get']({'plain':!![]});var _0x4b5fd7=_0x1b29('0x26');return db[_0x1b29('0x4d')][_0x1b29('0x47')]({'where':{'name':_0x4b5fd7,'userProfileId':_0x48cef2[_0x1b29('0x4e')]},'raw':!![]})['then'](function(_0x3f48d5){if(_0x3f48d5&&_0x3f48d5[_0x1b29('0x4f')]===0x0){return db[_0x1b29('0x27')][_0x1b29('0x48')]({'name':_0x56ec89[_0x1b29('0x2a')],'resourceId':_0x56ec89['id'],'type':_0x3f48d5[_0x1b29('0x2a')],'sectionId':_0x3f48d5['id']},{})['then'](function(){return _0x1f054b;});}else{return _0x1f054b;}})[_0x1b29('0x43')](function(_0xbabdf1){logger['error'](_0x1b29('0x50'),_0xbabdf1);throw _0xbabdf1;});}return _0x1f054b;})[_0x1b29('0x23')](respondWithResult(_0x556d96,0xc9))['catch'](handleError(_0x556d96,null));};exports[_0x1b29('0x22')]=function(_0x4bbd54,_0x13c712){if(_0x4bbd54[_0x1b29('0x49')]['id']){delete _0x4bbd54['body']['id'];}return db[_0x1b29('0x2d')][_0x1b29('0x47')]({'where':{'id':_0x4bbd54[_0x1b29('0x45')]['id']}})[_0x1b29('0x23')](handleEntityNotFound(_0x13c712,null))[_0x1b29('0x23')](saveUpdates(_0x4bbd54['body'],null))[_0x1b29('0x23')](respondWithResult(_0x13c712,null))['catch'](handleError(_0x13c712,null));};exports[_0x1b29('0x24')]=function(_0x1a22fb,_0x4156b1){return db[_0x1b29('0x2d')][_0x1b29('0x47')]({'where':{'id':_0x1a22fb[_0x1b29('0x45')]['id']}})[_0x1b29('0x23')](handleEntityNotFound(_0x4156b1,null))[_0x1b29('0x23')](removeEntity(_0x4156b1,null))[_0x1b29('0x43')](handleError(_0x4156b1,null));};exports[_0x1b29('0x51')]=function(_0x3a7ad8,_0x5d7ac4,_0x5c734c){if(_0x3a7ad8[_0x1b29('0x49')]['id']){delete _0x3a7ad8[_0x1b29('0x49')]['id'];}return db[_0x1b29('0x2d')][_0x1b29('0x47')]({'where':{'id':_0x3a7ad8[_0x1b29('0x45')]['id']}})[_0x1b29('0x23')](handleEntityNotFound(_0x5d7ac4,null))['then'](function(_0x464042){if(_0x464042){_0x3a7ad8[_0x1b29('0x49')][_0x1b29('0x52')]=_0x464042['id'];return db[_0x1b29('0x2d')][_0x1b29('0x48')](_0x3a7ad8[_0x1b29('0x49')]);}})[_0x1b29('0x23')](respondWithResult(_0x5d7ac4,null))[_0x1b29('0x43')](handleError(_0x5d7ac4,null));};exports[_0x1b29('0x53')]=function(_0x3cdb08,_0x3ca87c,_0x28ca22){var _0x586c1c={};var _0x4bc446={};var _0x12a1c3;var _0x283184;return db[_0x1b29('0x2d')][_0x1b29('0x54')]({'where':{'id':_0x3cdb08['params']['id']}})[_0x1b29('0x23')](handleEntityNotFound(_0x3ca87c,null))['then'](function(_0x39891c){if(_0x39891c){_0x12a1c3=_0x39891c;_0x4bc446[_0x1b29('0x35')]=_[_0x1b29('0x46')](db[_0x1b29('0x2d')][_0x1b29('0x2e')]);_0x4bc446[_0x1b29('0x32')]=_[_0x1b29('0x46')](_0x3cdb08[_0x1b29('0x32')]);_0x4bc446[_0x1b29('0x33')]=_[_0x1b29('0x34')](_0x4bc446[_0x1b29('0x35')],_0x4bc446['query']);_0x586c1c[_0x1b29('0x36')]=_[_0x1b29('0x34')](_0x4bc446['model'],qs[_0x1b29('0x37')](_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x37')]));_0x586c1c[_0x1b29('0x36')]=_0x586c1c[_0x1b29('0x36')][_0x1b29('0x38')]?_0x586c1c[_0x1b29('0x36')]:_0x4bc446[_0x1b29('0x35')];_0x586c1c[_0x1b29('0x55')]=qs[_0x1b29('0x3b')](_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x3b')]);_0x586c1c[_0x1b29('0x3c')]=qs[_0x1b29('0x33')](_[_0x1b29('0x3d')](_0x3cdb08[_0x1b29('0x32')],_0x4bc446[_0x1b29('0x33')]));if(_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x3e')]){_0x586c1c[_0x1b29('0x3c')]=_[_0x1b29('0x3f')](_0x586c1c[_0x1b29('0x3c')],{'$or':_['map'](_0x586c1c[_0x1b29('0x36')],function(_0x11247a){var _0x29d633={};_0x29d633[_0x11247a]={'$like':'%'+_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x3e')]+'%'};return _0x29d633;})});}_0x586c1c=_[_0x1b29('0x3f')]({},_0x586c1c,_0x3cdb08['options']);return _0x12a1c3[_0x1b29('0x53')](_0x586c1c);}})[_0x1b29('0x23')](function(_0x2a6c78){if(_0x2a6c78){_0x283184=_0x2a6c78[_0x1b29('0x38')];if(!_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x39')](_0x1b29('0x3a'))){_0x586c1c['limit']=qs['limit'](_0x3cdb08['query'][_0x1b29('0x1d')]);_0x586c1c[_0x1b29('0x1b')]=qs['offset'](_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x1b')]);}return _0x12a1c3[_0x1b29('0x53')](_0x586c1c);}})[_0x1b29('0x23')](function(_0x38259f){if(_0x38259f){return _0x38259f?{'count':_0x283184,'rows':_0x38259f}:null;}})['then'](respondWithResult(_0x3ca87c,null))[_0x1b29('0x43')](handleError(_0x3ca87c,null));};exports[_0x1b29('0x56')]=function(_0x177920,_0x46d5b3,_0x139a46){return db[_0x1b29('0x2d')][_0x1b29('0x54')]({'where':{'id':_0x177920[_0x1b29('0x45')]['id']}})[_0x1b29('0x23')](handleEntityNotFound(_0x46d5b3,null))[_0x1b29('0x23')](function(_0x5a8593){if(_0x5a8593){return db[_0x1b29('0x57')][_0x1b29('0x58')](function(_0x2948f4){return db['Interval'][_0x1b29('0x24')]({'where':{'IntervalId':_0x177920[_0x1b29('0x45')]['id']},'transaction':_0x2948f4})['then'](function(_0x10275d){var _0x3abc0f=_[_0x1b29('0x2c')](_0x177920['body'],function(_0x33aad2){delete _0x33aad2['id'];_0x33aad2[_0x1b29('0x52')]=_0x177920[_0x1b29('0x45')]['id'];return _0x33aad2;});return db[_0x1b29('0x2d')]['bulkCreate'](_0x3abc0f,{'transaction':_0x2948f4});});})[_0x1b29('0x23')](function(){return db[_0x1b29('0x2d')][_0x1b29('0x59')]({'where':{'IntervalId':_0x177920['params']['id']}});});}})[_0x1b29('0x23')](respondWithResult(_0x46d5b3,null))[_0x1b29('0x43')](handleError(_0x46d5b3,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 1010b6f..15a63b2 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 _0x9152=['Interval','tools_intervals','rewrite','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x3fa709,_0x2ddd85){var _0x2a7350=function(_0x360c47){while(--_0x360c47){_0x3fa709['push'](_0x3fa709['shift']());}};_0x2a7350(++_0x2ddd85);}(_0x9152,0x198));var _0x2915=function(_0x170ce1,_0x59f0fd){_0x170ce1=_0x170ce1-0x0;var _0x5d0b27=_0x9152[_0x170ce1];return _0x5d0b27;};'use strict';var _=require(_0x2915('0x0'));var util=require(_0x2915('0x1'));var logger=require(_0x2915('0x2'))('api');var moment=require(_0x2915('0x3'));var BPromise=require(_0x2915('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2915('0x5'));var rimraf=require(_0x2915('0x6'));var config=require(_0x2915('0x7'));var attributes=require(_0x2915('0x8'));var extensions=require(_0x2915('0x9'));module[_0x2915('0xa')]=function(_0x155737,_0x2fc5e3){return _0x155737[_0x2915('0xb')](_0x2915('0xc'),attributes,{'tableName':_0x2915('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x27db52,_0x4f9482){extensions[_0x2915('0xe')](_0x155737,_0x27db52);},'afterBulkCreate':function(_0x128da7,_0x4baba5,_0x1e0005){_0x1e0005();extensions[_0x2915('0xe')](_0x155737,_0x128da7[0x0]);},'afterUpdate':function(_0x21fb4c,_0x49362e){extensions['rewrite'](_0x155737,_0x21fb4c);},'afterDestroy':function(_0x2f2fcf,_0x4a790d){extensions[_0x2915('0xe')](_0x155737,_0x2f2fcf);}}});}; \ No newline at end of file +var _0x2558=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Interval','tools_intervals','rewrite'];(function(_0x261174,_0x33d545){var _0x20dfbd=function(_0x49c140){while(--_0x49c140){_0x261174['push'](_0x261174['shift']());}};_0x20dfbd(++_0x33d545);}(_0x2558,0x1a0));var _0x8255=function(_0x490d09,_0x4d9eed){_0x490d09=_0x490d09-0x0;var _0x5a9666=_0x2558[_0x490d09];return _0x5a9666;};'use strict';var _=require('lodash');var util=require(_0x8255('0x0'));var logger=require(_0x8255('0x1'))(_0x8255('0x2'));var moment=require(_0x8255('0x3'));var BPromise=require(_0x8255('0x4'));var rp=require(_0x8255('0x5'));var fs=require('fs');var path=require(_0x8255('0x6'));var rimraf=require(_0x8255('0x7'));var config=require(_0x8255('0x8'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x29ab2b,_0x4792c9){return _0x29ab2b[_0x8255('0x9')](_0x8255('0xa'),attributes,{'tableName':_0x8255('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x58d27b,_0x51fd5d){extensions[_0x8255('0xc')](_0x29ab2b,_0x58d27b);},'afterBulkCreate':function(_0x5e0c4c,_0x3496e9,_0x56b08f){_0x56b08f();extensions['rewrite'](_0x29ab2b,_0x5e0c4c[0x0]);},'afterUpdate':function(_0xc555da,_0x132425){extensions[_0x8255('0xc')](_0x29ab2b,_0xc555da);},'afterDestroy':function(_0x794695,_0x28ba88){extensions[_0x8255('0xc')](_0x29ab2b,_0x794695);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 30661c4..c077d32 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 _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x136a0d,_0x476fe2){var _0x212ea5=function(_0xa288e){while(--_0xa288e){_0x136a0d['push'](_0x136a0d['shift']());}};_0x212ea5(++_0x476fe2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 4be527d..85abaa3 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(_0x48725a,_0x578535){var _0x40f856=function(_0x2726da){while(--_0x2726da){_0x48725a['push'](_0x48725a['shift']());}};_0x40f856(++_0x578535);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4f9b88,_0x39065a){_0x4f9b88=_0x4f9b88-0x0;var _0x2521aa=_0x5f2f[_0x4f9b88];return _0x2521aa;};'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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x6978c0,_0x1f6765){_0x6978c0=_0x6978c0-0x0;var _0x361377=_0x0b0e[_0x6978c0];return _0x361377;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 00c0f74..a06c239 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 _0x2ed0=['request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','api.jira','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x2ed0,0x1f4));var _0x02ed=function(_0x4e89dd,_0x42a780){_0x4e89dd=_0x4e89dd-0x0;var _0x13ef0c=_0x2ed0[_0x4e89dd];return _0x13ef0c;};'use strict';var BPromise=require(_0x02ed('0x0'));var https=require('https');var logger=require(_0x02ed('0x1'))('api');var USERNAME=_0x02ed('0x2');var PASSWORD=_0x02ed('0x3');function openIssue(_0x46c8a4,_0x5c1a90){var _0x55cbd1={'fields':{'project':{'key':_0x46c8a4[_0x02ed('0x4')]||_0x02ed('0x5')},'summary':(_0x46c8a4[_0x02ed('0x6')]||_0x02ed('0x7'))+_0x02ed('0x8')+_0x46c8a4['ip'],'description':_0x46c8a4[_0x02ed('0x9')]||JSON[_0x02ed('0xa')](_0x46c8a4),'issuetype':{'name':_0x46c8a4[_0x02ed('0xb')]||_0x02ed('0xc')}}};_0x55cbd1[_0x02ed('0xd')][_0x02ed('0xe')]=_0x46c8a4[_0x02ed('0xf')];_0x55cbd1[_0x02ed('0xd')][_0x02ed('0x10')]=_0x46c8a4[_0x02ed('0x11')];_0x55cbd1[_0x02ed('0xd')][_0x02ed('0x12')]=_0x46c8a4['newToken'];_0x55cbd1[_0x02ed('0xd')][_0x02ed('0x13')]=_0x46c8a4['name'];_0x55cbd1[_0x02ed('0xd')][_0x02ed('0x14')]=_0x46c8a4[_0x02ed('0x15')];_0x55cbd1[_0x02ed('0xd')][_0x02ed('0x16')]=_0x46c8a4['ip'];var _0x1d4dd4={'host':_0x02ed('0x17'),'port':0x1bb,'path':_0x02ed('0x18'),'method':_0x02ed('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0x02ed('0x1a'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x02ed('0x1b')]('base64')}};var _0x54abc5=JSON[_0x02ed('0xa')](_0x55cbd1);var _0x190933=https[_0x02ed('0x1c')](_0x1d4dd4,function(_0x279d01){_0x279d01[_0x02ed('0x1d')](_0x02ed('0x1e'));var _0x3ce651='';_0x279d01['on'](_0x02ed('0x1f'),function(_0xf8ee7b){_0x3ce651+=_0xf8ee7b;});_0x279d01['on'](_0x02ed('0x20'),function(){if(_0x5c1a90){return _0x5c1a90[_0x02ed('0x21')](_0x279d01[_0x02ed('0x22')])[_0x02ed('0x23')](JSON[_0x02ed('0x24')](_0x3ce651));}});});_0x190933['on'](_0x02ed('0x25'),function(_0x200242){if(_0x5c1a90){return _0x5c1a90['status'](0x1f4)[_0x02ed('0x23')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x02ed('0x26')}]});}});_0x190933['write'](_0x54abc5);_0x190933[_0x02ed('0x20')]();}exports['openIssue']=openIssue;exports['send']=function(_0xbc9069,_0x47c83d){_0xbc9069['body']['ip']=_0xbc9069[_0x02ed('0x27')][_0x02ed('0x28')]||_0xbc9069[_0x02ed('0x29')]['remoteAddress']||_0xbc9069['socket'][_0x02ed('0x2a')]||_0xbc9069[_0x02ed('0x29')][_0x02ed('0x2b')][_0x02ed('0x2a')];return openIssue(_0xbc9069['body'],_0x47c83d);}; \ No newline at end of file +var _0xf138=['customfield_11501','oldToken','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','request','setEncoding','utf8','data','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','https','api','support','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','email','fields'];(function(_0xade445,_0x2e53c4){var _0x5519d3=function(_0x286be3){while(--_0x286be3){_0xade445['push'](_0xade445['shift']());}};_0x5519d3(++_0x2e53c4);}(_0xf138,0x12b));var _0x8f13=function(_0x45ea10,_0xd51e0e){_0x45ea10=_0x45ea10-0x0;var _0x4cece8=_0xf138[_0x45ea10];return _0x4cece8;};'use strict';var BPromise=require(_0x8f13('0x0'));var https=require(_0x8f13('0x1'));var logger=require('../../config/logger')(_0x8f13('0x2'));var USERNAME=_0x8f13('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0xecba5b,_0x361ef7){var _0x2cc44c={'fields':{'project':{'key':_0xecba5b[_0x8f13('0x4')]||_0x8f13('0x5')},'summary':(_0xecba5b[_0x8f13('0x6')]||_0x8f13('0x7'))+_0x8f13('0x8')+_0xecba5b['ip'],'description':_0xecba5b[_0x8f13('0x9')]||JSON[_0x8f13('0xa')](_0xecba5b),'issuetype':{'name':_0xecba5b[_0x8f13('0xb')]||_0x8f13('0xc')}}};_0x2cc44c['fields'][_0x8f13('0xd')]=_0xecba5b[_0x8f13('0xe')];_0x2cc44c[_0x8f13('0xf')][_0x8f13('0x10')]=_0xecba5b[_0x8f13('0x11')];_0x2cc44c['fields']['customfield_11502']=_0xecba5b[_0x8f13('0x12')];_0x2cc44c['fields'][_0x8f13('0x13')]=_0xecba5b[_0x8f13('0x14')];_0x2cc44c['fields']['customfield_11504']=_0xecba5b['reason'];_0x2cc44c['fields'][_0x8f13('0x15')]=_0xecba5b['ip'];var _0xe2a264={'host':_0x8f13('0x16'),'port':0x1bb,'path':_0x8f13('0x17'),'method':_0x8f13('0x18'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x8f13('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x8f13('0x1a')]('base64')}};var _0x17accc=JSON[_0x8f13('0xa')](_0x2cc44c);var _0x3f482d=https[_0x8f13('0x1b')](_0xe2a264,function(_0x3ffd61){_0x3ffd61[_0x8f13('0x1c')](_0x8f13('0x1d'));var _0x38d5c2='';_0x3ffd61['on'](_0x8f13('0x1e'),function(_0x945061){_0x38d5c2+=_0x945061;});_0x3ffd61['on'](_0x8f13('0x1f'),function(){if(_0x361ef7){return _0x361ef7[_0x8f13('0x20')](_0x3ffd61[_0x8f13('0x21')])[_0x8f13('0x22')](JSON[_0x8f13('0x23')](_0x38d5c2));}});});_0x3f482d['on']('error',function(_0x1aeda8){if(_0x361ef7){return _0x361ef7['status'](0x1f4)[_0x8f13('0x22')]({'errors':[{'message':_0x8f13('0x24'),'type':'api.jira'}]});}});_0x3f482d[_0x8f13('0x25')](_0x17accc);_0x3f482d['end']();}exports[_0x8f13('0x26')]=openIssue;exports[_0x8f13('0x27')]=function(_0x556248,_0x4bc245){_0x556248[_0x8f13('0x28')]['ip']=_0x556248[_0x8f13('0x29')]['x-forwarded-for']||_0x556248[_0x8f13('0x2a')]['remoteAddress']||_0x556248['socket'][_0x8f13('0x2b')]||_0x556248[_0x8f13('0x2a')][_0x8f13('0x2c')]['remoteAddress'];return openIssue(_0x556248[_0x8f13('0x28')],_0x4bc245);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 08bc7a0..204c66c 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 _0xf4eb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0xf77fc1,_0x1b5f46){var _0xf8faa7=function(_0x23a364){while(--_0x23a364){_0xf77fc1['push'](_0xf77fc1['shift']());}};_0xf8faa7(++_0x1b5f46);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4ef061,_0x5b3fd4){_0x4ef061=_0x4ef061-0x0;var _0x3a21ea=_0xf4eb[_0x4ef061];return _0x3a21ea;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['delete'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0xe')]=router; \ No newline at end of file +var _0x2dae=['show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2dae,0xc3));var _0xe2da=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x2dae[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xd')]);router[_0xe2da('0x9')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xf')]);router['post']('/',auth[_0xe2da('0xc')](),controller[_0xe2da('0x10')]);router[_0xe2da('0x11')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0x12')]);router[_0xe2da('0x13')](_0xe2da('0xe'),auth['isAuthenticated'](),controller[_0xe2da('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 21caa71..9e11a4a 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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x496afc,_0x11062b){_0x496afc=_0x496afc-0x0;var _0x3e19ac=_0x7a54[_0x496afc];return _0x3e19ac;};'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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x2b047a,_0x1b7abe){_0x2b047a=_0x2b047a-0x0;var _0x1f5549=_0x7a54[_0x2b047a];return _0x1f5549;};'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 e23c98b..6e89956 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 _0xf987=['attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','keys','filters','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf987,0x18a));var _0x7f98=function(_0x4735d9,_0x11db6f){_0x4735d9=_0x4735d9-0x0;var _0x2ee54e=_0xf987[_0x4735d9];return _0x2ee54e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f98('0x0'));var jsonpatch=require(_0x7f98('0x1'));var rp=require('request-promise');var moment=require(_0x7f98('0x2'));var BPromise=require(_0x7f98('0x3'));var Mustache=require(_0x7f98('0x4'));var util=require(_0x7f98('0x5'));var path=require(_0x7f98('0x6'));var sox=require(_0x7f98('0x7'));var csv=require(_0x7f98('0x8'));var ejs=require(_0x7f98('0x9'));var fs=require('fs');var fs_extra=require(_0x7f98('0xa'));var _=require(_0x7f98('0xb'));var squel=require(_0x7f98('0xc'));var crypto=require(_0x7f98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f98('0xe'));var toCsv=require(_0x7f98('0x8'));var querystring=require(_0x7f98('0xf'));var Papa=require(_0x7f98('0x10'));var Redis=require(_0x7f98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f98('0x13'))(_0x7f98('0x14'));var utils=require(_0x7f98('0x15'));var config=require(_0x7f98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f98('0x17'))['db'];function respondWithStatusCode(_0x4c4ae9,_0x9c2633){_0x9c2633=_0x9c2633||0xcc;return function(_0x2c26d8){if(_0x2c26d8){return _0x4c4ae9[_0x7f98('0x18')](_0x9c2633);}return _0x4c4ae9[_0x7f98('0x19')](_0x9c2633)[_0x7f98('0x1a')]();};}function respondWithResult(_0x11b1f8,_0x33108e){_0x33108e=_0x33108e||0xc8;return function(_0x3044d4){if(_0x3044d4){return _0x11b1f8[_0x7f98('0x19')](_0x33108e)[_0x7f98('0x1b')](_0x3044d4);}};}function respondWithFilteredResult(_0x2d366a,_0x1fa829){return function(_0x5e3bb5){if(_0x5e3bb5){var _0xcab406=typeof _0x1fa829['offset']==='undefined'&&typeof _0x1fa829[_0x7f98('0x1c')]===_0x7f98('0x1d');var _0x585a1a=_0x5e3bb5['count'];var _0x5f27dd=_0xcab406?0x0:_0x1fa829['offset'];var _0x111385=_0xcab406?_0x5e3bb5[_0x7f98('0x1e')]:_0x1fa829['offset']+_0x1fa829['limit'];var _0x4f3ac0;if(_0x111385>=_0x585a1a){_0x111385=_0x585a1a;_0x4f3ac0=0xc8;}else{_0x4f3ac0=0xce;}_0x2d366a[_0x7f98('0x19')](_0x4f3ac0);return _0x2d366a['set'](_0x7f98('0x1f'),_0x5f27dd+'-'+_0x111385+'/'+_0x585a1a)[_0x7f98('0x1b')](_0x5e3bb5);}return null;};}function patchUpdates(_0x3e78e2){return function(_0x446dd5){try{jsonpatch[_0x7f98('0x20')](_0x446dd5,_0x3e78e2,!![]);}catch(_0x1f2e6c){return BPromise[_0x7f98('0x21')](_0x1f2e6c);}return _0x446dd5[_0x7f98('0x22')]();};}function saveUpdates(_0x20ad36,_0x53c1ef){return function(_0x55189b){if(_0x55189b){return _0x55189b[_0x7f98('0x23')](_0x20ad36)['then'](function(_0xf39ff1){return _0xf39ff1;});}return null;};}function removeEntity(_0x2d9e09,_0x51eca3){return function(_0x417ad4){if(_0x417ad4){return _0x417ad4[_0x7f98('0x24')]()['then'](function(){_0x2d9e09[_0x7f98('0x19')](0xcc)[_0x7f98('0x1a')]();});}};}function handleEntityNotFound(_0x1d6bdb,_0x1a5788){return function(_0x3e1cd5){if(!_0x3e1cd5){_0x1d6bdb[_0x7f98('0x18')](0x194);}return _0x3e1cd5;};}function handleError(_0x2b58d0,_0x8b27a4){_0x8b27a4=_0x8b27a4||0x1f4;return function(_0x1d086f){logger[_0x7f98('0x25')](_0x1d086f[_0x7f98('0x26')]);if(_0x1d086f[_0x7f98('0x27')]){delete _0x1d086f[_0x7f98('0x27')];}_0x2b58d0['status'](_0x8b27a4)['send'](_0x1d086f);};}exports[_0x7f98('0x28')]=function(_0x2122f4,_0x186519){var _0x1dd8d5={},_0xc8f69f={},_0x16a8cb={'count':0x0,'rows':[]};var _0x20ff8d=_[_0x7f98('0x29')](db[_0x7f98('0x2a')][_0x7f98('0x2b')],function(_0x544bae){return{'name':_0x544bae[_0x7f98('0x2c')],'type':_0x544bae[_0x7f98('0x2d')]['key']};});_0xc8f69f[_0x7f98('0x2e')]=_[_0x7f98('0x29')](_0x20ff8d,_0x7f98('0x27'));_0xc8f69f['query']=_[_0x7f98('0x2f')](_0x2122f4['query']);_0xc8f69f[_0x7f98('0x30')]=_['intersection'](_0xc8f69f[_0x7f98('0x2e')],_0xc8f69f[_0x7f98('0x31')]);_0x1dd8d5[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0xc8f69f[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x2122f4[_0x7f98('0x31')]['fields']));_0x1dd8d5['attributes']=_0x1dd8d5[_0x7f98('0x32')][_0x7f98('0x35')]?_0x1dd8d5[_0x7f98('0x32')]:_0xc8f69f[_0x7f98('0x2e')];if(!_0x2122f4[_0x7f98('0x31')][_0x7f98('0x36')](_0x7f98('0x37'))){_0x1dd8d5['limit']=qs['limit'](_0x2122f4[_0x7f98('0x31')]['limit']);_0x1dd8d5[_0x7f98('0x38')]=qs['offset'](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x38')]);}_0x1dd8d5[_0x7f98('0x39')]=qs[_0x7f98('0x3a')](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3a')]);_0x1dd8d5[_0x7f98('0x3b')]=qs[_0x7f98('0x30')](_[_0x7f98('0x3c')](_0x2122f4[_0x7f98('0x31')],_0xc8f69f[_0x7f98('0x30')]),_0x20ff8d);if(_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3d')]){_0x1dd8d5[_0x7f98('0x3b')]=_[_0x7f98('0x3e')](_0x1dd8d5[_0x7f98('0x3b')],{'$or':_[_0x7f98('0x29')](_0x20ff8d,function(_0x45f280){if(_0x45f280[_0x7f98('0x2d')]!==_0x7f98('0x3f')){var _0x1b82cc={};_0x1b82cc[_0x45f280[_0x7f98('0x27')]]={'$like':'%'+_0x2122f4[_0x7f98('0x31')]['filter']+'%'};return _0x1b82cc;}})});}_0x1dd8d5=_[_0x7f98('0x3e')]({},_0x1dd8d5,_0x2122f4[_0x7f98('0x40')]);var _0x57a855={'where':_0x1dd8d5[_0x7f98('0x3b')]};return db['JscriptyAnswerReport']['count'](_0x57a855)[_0x7f98('0x41')](function(_0x24bbdc){_0x16a8cb['count']=_0x24bbdc;if(_0x2122f4[_0x7f98('0x31')]['includeAll']){_0x1dd8d5['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x7f98('0x42')](_0x1dd8d5);})['then'](function(_0x2ab479){_0x16a8cb['rows']=_0x2ab479;return _0x16a8cb;})[_0x7f98('0x41')](respondWithFilteredResult(_0x186519,_0x1dd8d5))[_0x7f98('0x43')](handleError(_0x186519,null));};exports[_0x7f98('0x44')]=function(_0x1d53eb,_0x48ede9){var _0x55a8cc={'raw':!![],'where':{'id':_0x1d53eb[_0x7f98('0x45')]['id']}},_0x5b8fef={};_0x5b8fef[_0x7f98('0x2e')]=_['keys'](db['JscriptyAnswerReport'][_0x7f98('0x2b')]);_0x5b8fef[_0x7f98('0x31')]=_[_0x7f98('0x2f')](_0x1d53eb[_0x7f98('0x31')]);_0x5b8fef[_0x7f98('0x30')]=_[_0x7f98('0x33')](_0x5b8fef['model'],_0x5b8fef[_0x7f98('0x31')]);_0x55a8cc[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0x5b8fef[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x1d53eb[_0x7f98('0x31')][_0x7f98('0x34')]));_0x55a8cc[_0x7f98('0x32')]=_0x55a8cc[_0x7f98('0x32')][_0x7f98('0x35')]?_0x55a8cc[_0x7f98('0x32')]:_0x5b8fef[_0x7f98('0x2e')];if(_0x1d53eb['query']['includeAll']){_0x55a8cc['include']=[{'all':!![]}];}_0x55a8cc=_[_0x7f98('0x3e')]({},_0x55a8cc,_0x1d53eb[_0x7f98('0x40')]);return db['JscriptyAnswerReport'][_0x7f98('0x46')](_0x55a8cc)[_0x7f98('0x41')](handleEntityNotFound(_0x48ede9,null))[_0x7f98('0x41')](respondWithResult(_0x48ede9,null))[_0x7f98('0x43')](handleError(_0x48ede9,null));};exports[_0x7f98('0x47')]=function(_0x83db32,_0x157723){return db[_0x7f98('0x2a')][_0x7f98('0x47')](_0x83db32['body'],{})[_0x7f98('0x41')](respondWithResult(_0x157723,0xc9))[_0x7f98('0x43')](handleError(_0x157723,null));};exports[_0x7f98('0x23')]=function(_0x32e242,_0x3396a7){if(_0x32e242['body']['id']){delete _0x32e242[_0x7f98('0x48')]['id'];}return db[_0x7f98('0x2a')]['find']({'where':{'id':_0x32e242[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3396a7,null))[_0x7f98('0x41')](saveUpdates(_0x32e242[_0x7f98('0x48')],null))['then'](respondWithResult(_0x3396a7,null))[_0x7f98('0x43')](handleError(_0x3396a7,null));};exports['destroy']=function(_0x513c2f,_0x3467ad){return db[_0x7f98('0x2a')][_0x7f98('0x46')]({'where':{'id':_0x513c2f[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3467ad,null))[_0x7f98('0x41')](removeEntity(_0x3467ad,null))[_0x7f98('0x43')](handleError(_0x3467ad,null));};exports[_0x7f98('0x49')]=function(_0x3b268d,_0x203a53){return db['JscriptyAnswerReport'][_0x7f98('0x49')]()[_0x7f98('0x41')](respondWithResult(_0x203a53,null))[_0x7f98('0x43')](handleError(_0x203a53,null));}; \ No newline at end of file +var _0xdb70=['catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','key','map','query','filters','attributes','intersection','fields','length','model','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find'];(function(_0x3ed9ed,_0x5841b0){var _0x4e9106=function(_0x20949b){while(--_0x20949b){_0x3ed9ed['push'](_0x3ed9ed['shift']());}};_0x4e9106(++_0x5841b0);}(_0xdb70,0xa0));var _0x0db7=function(_0x2ec1a1,_0x2e6e6e){_0x2ec1a1=_0x2ec1a1-0x0;var _0x3f1ccb=_0xdb70[_0x2ec1a1];return _0x3f1ccb;};'use strict';var emlformat=require(_0x0db7('0x0'));var rimraf=require(_0x0db7('0x1'));var zipdir=require(_0x0db7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0db7('0x3'));var moment=require(_0x0db7('0x4'));var BPromise=require(_0x0db7('0x5'));var Mustache=require(_0x0db7('0x6'));var util=require(_0x0db7('0x7'));var path=require(_0x0db7('0x8'));var sox=require(_0x0db7('0x9'));var csv=require(_0x0db7('0xa'));var ejs=require(_0x0db7('0xb'));var fs=require('fs');var fs_extra=require(_0x0db7('0xc'));var _=require(_0x0db7('0xd'));var squel=require('squel');var crypto=require(_0x0db7('0xe'));var jsforce=require(_0x0db7('0xf'));var deskjs=require(_0x0db7('0x10'));var toCsv=require(_0x0db7('0xa'));var querystring=require(_0x0db7('0x11'));var Papa=require(_0x0db7('0x12'));var Redis=require('ioredis');var authService=require(_0x0db7('0x13'));var qs=require(_0x0db7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0db7('0x15'));var logger=require(_0x0db7('0x16'))(_0x0db7('0x17'));var utils=require(_0x0db7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0db7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9aed4f,_0x2959a2){_0x2959a2=_0x2959a2||0xcc;return function(_0x33ec07){if(_0x33ec07){return _0x9aed4f[_0x0db7('0x1a')](_0x2959a2);}return _0x9aed4f[_0x0db7('0x1b')](_0x2959a2)['end']();};}function respondWithResult(_0x76c036,_0x195556){_0x195556=_0x195556||0xc8;return function(_0x45f594){if(_0x45f594){return _0x76c036[_0x0db7('0x1b')](_0x195556)[_0x0db7('0x1c')](_0x45f594);}};}function respondWithFilteredResult(_0x446448,_0x41b2b3){return function(_0x2edbe9){if(_0x2edbe9){var _0xb9127d=typeof _0x41b2b3[_0x0db7('0x1d')]==='undefined'&&typeof _0x41b2b3[_0x0db7('0x1e')]===_0x0db7('0x1f');var _0x18cf37=_0x2edbe9[_0x0db7('0x20')];var _0x31082b=_0xb9127d?0x0:_0x41b2b3[_0x0db7('0x1d')];var _0x52e95e=_0xb9127d?_0x2edbe9['count']:_0x41b2b3[_0x0db7('0x1d')]+_0x41b2b3[_0x0db7('0x1e')];var _0xe9a55d;if(_0x52e95e>=_0x18cf37){_0x52e95e=_0x18cf37;_0xe9a55d=0xc8;}else{_0xe9a55d=0xce;}_0x446448['status'](_0xe9a55d);return _0x446448[_0x0db7('0x21')](_0x0db7('0x22'),_0x31082b+'-'+_0x52e95e+'/'+_0x18cf37)[_0x0db7('0x1c')](_0x2edbe9);}return null;};}function patchUpdates(_0x211fc0){return function(_0x5a0b04){try{jsonpatch[_0x0db7('0x23')](_0x5a0b04,_0x211fc0,!![]);}catch(_0x48feb2){return BPromise[_0x0db7('0x24')](_0x48feb2);}return _0x5a0b04['save']();};}function saveUpdates(_0x59b7e4,_0x135429){return function(_0x156aaa){if(_0x156aaa){return _0x156aaa[_0x0db7('0x25')](_0x59b7e4)[_0x0db7('0x26')](function(_0x18fc1c){return _0x18fc1c;});}return null;};}function removeEntity(_0x368243,_0xc05009){return function(_0x274bf1){if(_0x274bf1){return _0x274bf1[_0x0db7('0x27')]()[_0x0db7('0x26')](function(){_0x368243[_0x0db7('0x1b')](0xcc)[_0x0db7('0x28')]();});}};}function handleEntityNotFound(_0x299c22,_0x55f339){return function(_0x521565){if(!_0x521565){_0x299c22['sendStatus'](0x194);}return _0x521565;};}function handleError(_0x594e6a,_0x568e60){_0x568e60=_0x568e60||0x1f4;return function(_0x5d2e46){logger[_0x0db7('0x29')](_0x5d2e46[_0x0db7('0x2a')]);if(_0x5d2e46[_0x0db7('0x2b')]){delete _0x5d2e46['name'];}_0x594e6a['status'](_0x568e60)[_0x0db7('0x2c')](_0x5d2e46);};}exports[_0x0db7('0x2d')]=function(_0x3f2169,_0x37ade4){var _0x29ed0a={},_0xfc7311={},_0x4ca418={'count':0x0,'rows':[]};var _0x2de626=_['map'](db[_0x0db7('0x2e')][_0x0db7('0x2f')],function(_0x1481aa){return{'name':_0x1481aa[_0x0db7('0x30')],'type':_0x1481aa['type'][_0x0db7('0x31')]};});_0xfc7311['model']=_[_0x0db7('0x32')](_0x2de626,_0x0db7('0x2b'));_0xfc7311[_0x0db7('0x33')]=_['keys'](_0x3f2169[_0x0db7('0x33')]);_0xfc7311[_0x0db7('0x34')]=_['intersection'](_0xfc7311['model'],_0xfc7311[_0x0db7('0x33')]);_0x29ed0a[_0x0db7('0x35')]=_[_0x0db7('0x36')](_0xfc7311['model'],qs['fields'](_0x3f2169[_0x0db7('0x33')][_0x0db7('0x37')]));_0x29ed0a[_0x0db7('0x35')]=_0x29ed0a['attributes'][_0x0db7('0x38')]?_0x29ed0a[_0x0db7('0x35')]:_0xfc7311[_0x0db7('0x39')];if(!_0x3f2169[_0x0db7('0x33')]['hasOwnProperty'](_0x0db7('0x3a'))){_0x29ed0a['limit']=qs[_0x0db7('0x1e')](_0x3f2169['query'][_0x0db7('0x1e')]);_0x29ed0a[_0x0db7('0x1d')]=qs[_0x0db7('0x1d')](_0x3f2169['query']['offset']);}_0x29ed0a[_0x0db7('0x3b')]=qs[_0x0db7('0x3c')](_0x3f2169[_0x0db7('0x33')][_0x0db7('0x3c')]);_0x29ed0a[_0x0db7('0x3d')]=qs[_0x0db7('0x34')](_['pick'](_0x3f2169[_0x0db7('0x33')],_0xfc7311[_0x0db7('0x34')]),_0x2de626);if(_0x3f2169['query'][_0x0db7('0x3e')]){_0x29ed0a['where']=_[_0x0db7('0x3f')](_0x29ed0a['where'],{'$or':_[_0x0db7('0x32')](_0x2de626,function(_0x27ed23){if(_0x27ed23['type']!==_0x0db7('0x40')){var _0x100ef9={};_0x100ef9[_0x27ed23['name']]={'$like':'%'+_0x3f2169[_0x0db7('0x33')]['filter']+'%'};return _0x100ef9;}})});}_0x29ed0a=_[_0x0db7('0x3f')]({},_0x29ed0a,_0x3f2169[_0x0db7('0x41')]);var _0x32c295={'where':_0x29ed0a[_0x0db7('0x3d')]};return db[_0x0db7('0x2e')]['count'](_0x32c295)[_0x0db7('0x26')](function(_0x2545bf){_0x4ca418[_0x0db7('0x20')]=_0x2545bf;if(_0x3f2169[_0x0db7('0x33')][_0x0db7('0x42')]){_0x29ed0a[_0x0db7('0x43')]=[{'all':!![]}];}return db[_0x0db7('0x2e')][_0x0db7('0x44')](_0x29ed0a);})[_0x0db7('0x26')](function(_0x4591fe){_0x4ca418[_0x0db7('0x45')]=_0x4591fe;return _0x4ca418;})[_0x0db7('0x26')](respondWithFilteredResult(_0x37ade4,_0x29ed0a))['catch'](handleError(_0x37ade4,null));};exports[_0x0db7('0x46')]=function(_0x4a9066,_0x23558a){var _0x150936={'raw':!![],'where':{'id':_0x4a9066[_0x0db7('0x47')]['id']}},_0x55732f={};_0x55732f['model']=_[_0x0db7('0x48')](db[_0x0db7('0x2e')][_0x0db7('0x2f')]);_0x55732f[_0x0db7('0x33')]=_[_0x0db7('0x48')](_0x4a9066[_0x0db7('0x33')]);_0x55732f[_0x0db7('0x34')]=_[_0x0db7('0x36')](_0x55732f[_0x0db7('0x39')],_0x55732f['query']);_0x150936['attributes']=_['intersection'](_0x55732f[_0x0db7('0x39')],qs[_0x0db7('0x37')](_0x4a9066[_0x0db7('0x33')][_0x0db7('0x37')]));_0x150936[_0x0db7('0x35')]=_0x150936[_0x0db7('0x35')]['length']?_0x150936[_0x0db7('0x35')]:_0x55732f[_0x0db7('0x39')];if(_0x4a9066['query'][_0x0db7('0x42')]){_0x150936[_0x0db7('0x43')]=[{'all':!![]}];}_0x150936=_[_0x0db7('0x3f')]({},_0x150936,_0x4a9066['options']);return db[_0x0db7('0x2e')][_0x0db7('0x49')](_0x150936)[_0x0db7('0x26')](handleEntityNotFound(_0x23558a,null))[_0x0db7('0x26')](respondWithResult(_0x23558a,null))[_0x0db7('0x4a')](handleError(_0x23558a,null));};exports['create']=function(_0x23d9b3,_0x2388fa){return db[_0x0db7('0x2e')][_0x0db7('0x4b')](_0x23d9b3['body'],{})['then'](respondWithResult(_0x2388fa,0xc9))[_0x0db7('0x4a')](handleError(_0x2388fa,null));};exports['update']=function(_0x534daa,_0x3281bd){if(_0x534daa[_0x0db7('0x4c')]['id']){delete _0x534daa['body']['id'];}return db[_0x0db7('0x2e')][_0x0db7('0x49')]({'where':{'id':_0x534daa[_0x0db7('0x47')]['id']}})[_0x0db7('0x26')](handleEntityNotFound(_0x3281bd,null))['then'](saveUpdates(_0x534daa['body'],null))['then'](respondWithResult(_0x3281bd,null))[_0x0db7('0x4a')](handleError(_0x3281bd,null));};exports[_0x0db7('0x27')]=function(_0x1ac5df,_0x10863b){return db['JscriptyAnswerReport'][_0x0db7('0x49')]({'where':{'id':_0x1ac5df['params']['id']}})['then'](handleEntityNotFound(_0x10863b,null))['then'](removeEntity(_0x10863b,null))[_0x0db7('0x4a')](handleError(_0x10863b,null));};exports[_0x0db7('0x4d')]=function(_0x12bfda,_0x31f2a7){return db[_0x0db7('0x2e')]['describe']()[_0x0db7('0x26')](respondWithResult(_0x31f2a7,null))[_0x0db7('0x4a')](handleError(_0x31f2a7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index f13df37..4ef0b93 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 _0x6d05=['path','rimraf','../../config/environment','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','moment','bluebird'];(function(_0x2f6b7d,_0x2868ce){var _0x3de713=function(_0x7a9410){while(--_0x7a9410){_0x2f6b7d['push'](_0x2f6b7d['shift']());}};_0x3de713(++_0x2868ce);}(_0x6d05,0xd4));var _0x56d0=function(_0x3a4488,_0x40055a){_0x3a4488=_0x3a4488-0x0;var _0x314e18=_0x6d05[_0x3a4488];return _0x314e18;};'use strict';var _=require('lodash');var util=require(_0x56d0('0x0'));var logger=require(_0x56d0('0x1'))('api');var moment=require(_0x56d0('0x2'));var BPromise=require(_0x56d0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56d0('0x4'));var rimraf=require(_0x56d0('0x5'));var config=require(_0x56d0('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x518a61,_0x39fb85){return _0x518a61['define'](_0x56d0('0x7'),attributes,{'tableName':_0x56d0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9489=['util','api','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x301402,_0x448b7c){var _0x742adc=function(_0x1c4f69){while(--_0x1c4f69){_0x301402['push'](_0x301402['shift']());}};_0x742adc(++_0x448b7c);}(_0x9489,0x18b));var _0x9948=function(_0x54bf8f,_0x51f523){_0x54bf8f=_0x54bf8f-0x0;var _0x5541d6=_0x9489[_0x54bf8f];return _0x5541d6;};'use strict';var _=require(_0x9948('0x0'));var util=require(_0x9948('0x1'));var logger=require('../../config/logger')(_0x9948('0x2'));var moment=require('moment');var BPromise=require(_0x9948('0x3'));var rp=require(_0x9948('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9948('0x5'));var config=require(_0x9948('0x6'));var attributes=require(_0x9948('0x7'));module[_0x9948('0x8')]=function(_0x228808,_0x5abfce){return _0x228808[_0x9948('0x9')](_0x9948('0xa'),attributes,{'tableName':_0x9948('0xb'),'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 d75da33..df70dcc 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 _0x9b8a=['jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x278874,_0x527f6a){var _0x1f16d1=function(_0x58bde9){while(--_0x58bde9){_0x278874['push'](_0x278874['shift']());}};_0x1f16d1(++_0x527f6a);}(_0x9b8a,0xb4));var _0xa9b8=function(_0x2134b2,_0x5a82aa){_0x2134b2=_0x2134b2-0x0;var _0x4e4bc8=_0x9b8a[_0x2134b2];return _0x4e4bc8;};'use strict';var _=require(_0xa9b8('0x0'));var util=require(_0xa9b8('0x1'));var moment=require(_0xa9b8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9b8('0x3'));var db=require(_0xa9b8('0x4'))['db'];var utils=require(_0xa9b8('0x5'));var logger=require(_0xa9b8('0x6'))(_0xa9b8('0x7'));var config=require(_0xa9b8('0x8'));var jayson=require(_0xa9b8('0x9'));var client=jayson['client'][_0xa9b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x118aac,_0x5c4ede,_0xfbbf13){return new BPromise(function(_0x4991c4,_0x510425){return client[_0xa9b8('0xb')](_0x118aac,_0xfbbf13)[_0xa9b8('0xc')](function(_0x59b00b){logger[_0xa9b8('0xd')](_0xa9b8('0xe'),_0x5c4ede,_0xa9b8('0xf'));logger[_0xa9b8('0x10')](_0xa9b8('0x11'),_0x5c4ede,_0xa9b8('0xf'),JSON['stringify'](_0x59b00b));if(_0x59b00b[_0xa9b8('0x12')]){if(_0x59b00b[_0xa9b8('0x12')]['code']===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x5c4ede,_0x59b00b[_0xa9b8('0x12')][_0xa9b8('0x13')]);return _0x510425(_0x59b00b['error'][_0xa9b8('0x13')]);}logger[_0xa9b8('0x12')](_0xa9b8('0xe'),_0x5c4ede,_0x59b00b[_0xa9b8('0x12')][_0xa9b8('0x13')]);return _0x4991c4(_0x59b00b[_0xa9b8('0x12')]['message']);}else{logger[_0xa9b8('0xd')](_0xa9b8('0xe'),_0x5c4ede,_0xa9b8('0xf'));_0x4991c4(_0x59b00b['result'][_0xa9b8('0x13')]);}})[_0xa9b8('0x14')](function(_0x53d42c){logger[_0xa9b8('0x12')](_0xa9b8('0xe'),_0x5c4ede,_0x53d42c);_0x510425(_0x53d42c);});});} \ No newline at end of file +var _0x4c2c=['../../config/environment','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x35ccf1,_0x29037b){var _0x9c5dd5=function(_0x30f50c){while(--_0x30f50c){_0x35ccf1['push'](_0x35ccf1['shift']());}};_0x9c5dd5(++_0x29037b);}(_0x4c2c,0x1c1));var _0xc4c2=function(_0x1fb94f,_0x2812e7){_0x1fb94f=_0x1fb94f-0x0;var _0x2a1bd0=_0x4c2c[_0x1fb94f];return _0x2a1bd0;};'use strict';var _=require(_0xc4c2('0x0'));var util=require('util');var moment=require(_0xc4c2('0x1'));var BPromise=require(_0xc4c2('0x2'));var rs=require(_0xc4c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc4c2('0x5'))(_0xc4c2('0x6'));var config=require(_0xc4c2('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc4c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f55c5,_0x4b5bb5,_0x3e93d0){return new BPromise(function(_0x244e8e,_0xf2f83){return client[_0xc4c2('0x9')](_0x4f55c5,_0x3e93d0)[_0xc4c2('0xa')](function(_0x166b08){logger['info'](_0xc4c2('0xb'),_0x4b5bb5,_0xc4c2('0xc'));logger[_0xc4c2('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4b5bb5,_0xc4c2('0xc'),JSON[_0xc4c2('0xe')](_0x166b08));if(_0x166b08[_0xc4c2('0xf')]){if(_0x166b08['error'][_0xc4c2('0x10')]===0x1f4){logger['error'](_0xc4c2('0xb'),_0x4b5bb5,_0x166b08['error'][_0xc4c2('0x11')]);return _0xf2f83(_0x166b08[_0xc4c2('0xf')][_0xc4c2('0x11')]);}logger[_0xc4c2('0xf')](_0xc4c2('0xb'),_0x4b5bb5,_0x166b08[_0xc4c2('0xf')]['message']);return _0x244e8e(_0x166b08[_0xc4c2('0xf')][_0xc4c2('0x11')]);}else{logger['info'](_0xc4c2('0xb'),_0x4b5bb5,'request\x20sent');_0x244e8e(_0x166b08[_0xc4c2('0x12')][_0xc4c2('0x11')]);}})['catch'](function(_0x1214e2){logger[_0xc4c2('0xf')](_0xc4c2('0xb'),_0x4b5bb5,_0x1214e2);_0xf2f83(_0x1214e2);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 6c253aa..1cb9730 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 _0x6e20=['exports','multer','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','put','update','delete','destroy'];(function(_0x38300b,_0x2a50f9){var _0x304b10=function(_0x29e02a){while(--_0x29e02a){_0x38300b['push'](_0x38300b['shift']());}};_0x304b10(++_0x2a50f9);}(_0x6e20,0x190));var _0x06e2=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x6e20[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0x06e2('0x0'));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(_0x06e2('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x06e2('0x2'));var controller=require(_0x06e2('0x3'));router[_0x06e2('0x4')]('/',auth[_0x06e2('0x5')](),controller[_0x06e2('0x6')]);router[_0x06e2('0x4')](_0x06e2('0x7'),auth[_0x06e2('0x5')](),controller['show']);router[_0x06e2('0x4')]('/:id/sessions',auth[_0x06e2('0x5')](),controller['getSessions']);router[_0x06e2('0x4')](_0x06e2('0x8'),auth[_0x06e2('0x5')](),controller[_0x06e2('0x9')]);router['get'](_0x06e2('0xa'),auth[_0x06e2('0x5')](),timeout(_0x06e2('0xb')),controller[_0x06e2('0xc')]);router['post']('/',auth[_0x06e2('0x5')](),controller[_0x06e2('0xd')]);router[_0x06e2('0xe')](_0x06e2('0xf'),auth['isAuthenticated'](),controller['clone']);router[_0x06e2('0x10')](_0x06e2('0x7'),auth['isAuthenticated'](),controller[_0x06e2('0x11')]);router[_0x06e2('0x12')](_0x06e2('0x7'),auth[_0x06e2('0x5')](),controller[_0x06e2('0x13')]);module[_0x06e2('0x14')]=router; \ No newline at end of file +var _0xda28=['show','/:id/sessions','/:id/answers','getAnswers','getSummary','post','/:id/clone','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xda28,0xfc));var _0x8da2=function(_0x2b36b0,_0x331282){_0x2b36b0=_0x2b36b0-0x0;var _0x3c0a23=_0xda28[_0x2b36b0];return _0x3c0a23;};'use strict';var multer=require(_0x8da2('0x0'));var util=require(_0x8da2('0x1'));var path=require('path');var timeout=require(_0x8da2('0x2'));var express=require(_0x8da2('0x3'));var router=express[_0x8da2('0x4')]();var fs_extra=require(_0x8da2('0x5'));var auth=require(_0x8da2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8da2('0x7'));var controller=require(_0x8da2('0x8'));router[_0x8da2('0x9')]('/',auth[_0x8da2('0xa')](),controller[_0x8da2('0xb')]);router[_0x8da2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8da2('0xc')]);router[_0x8da2('0x9')](_0x8da2('0xd'),auth['isAuthenticated'](),controller['getSessions']);router[_0x8da2('0x9')](_0x8da2('0xe'),auth[_0x8da2('0xa')](),controller[_0x8da2('0xf')]);router['get']('/:id/summary',auth[_0x8da2('0xa')](),timeout('30s'),controller[_0x8da2('0x10')]);router[_0x8da2('0x11')]('/',auth[_0x8da2('0xa')](),controller['create']);router[_0x8da2('0x11')](_0x8da2('0x12'),auth['isAuthenticated'](),controller['clone']);router['put'](_0x8da2('0x13'),auth['isAuthenticated'](),controller[_0x8da2('0x14')]);router[_0x8da2('0x15')](_0x8da2('0x13'),auth['isAuthenticated'](),controller[_0x8da2('0x16')]);module[_0x8da2('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 099b890..f6de107 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 _0x4483=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format'];(function(_0x562c93,_0x18cb82){var _0xae2b2c=function(_0x3b50a8){while(--_0x3b50a8){_0x562c93['push'](_0x562c93['shift']());}};_0xae2b2c(++_0x18cb82);}(_0x4483,0x1e0));var _0x3448=function(_0x4e4f4b,_0x33706a){_0x4e4f4b=_0x4e4f4b-0x0;var _0x4f674d=_0x4483[_0x4e4f4b];return _0x4f674d;};'use strict';var Sequelize=require(_0x3448('0x0'));var _=require('lodash');var util=require(_0x3448('0x1'));module[_0x3448('0x2')]={'name':{'type':Sequelize[_0x3448('0x3')],'unique':_0x3448('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x3448('0x5')](_0x3448('0x6')),'set':function(_0x2e9a18){if(_[_0x3448('0x7')](_0x2e9a18)){this[_0x3448('0x8')](_0x3448('0x9'),JSON[_0x3448('0xa')](_0x2e9a18));}else if(_[_0x3448('0xb')](_0x2e9a18)){this[_0x3448('0x8')](_0x3448('0x9'),_0x2e9a18);}else{this[_0x3448('0x8')](_0x3448('0x9'),util[_0x3448('0xc')](_0x3448('0xd'),this['getDataValue'](_0x3448('0x4'))||'',this[_0x3448('0xe')](_0x3448('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x3448('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x3448('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0xf4c6=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','exports','STRING','long','isObjectLike','setDataValue','formData','stringify','isString'];(function(_0x13a0cb,_0x5bf463){var _0x415fe3=function(_0x2fbc7d){while(--_0x2fbc7d){_0x13a0cb['push'](_0x13a0cb['shift']());}};_0x415fe3(++_0x5bf463);}(_0xf4c6,0xc1));var _0x6f4c=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0xf4c6[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require(_0x6f4c('0x0'));var _=require(_0x6f4c('0x1'));var util=require(_0x6f4c('0x2'));module[_0x6f4c('0x3')]={'name':{'type':Sequelize[_0x6f4c('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x6f4c('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x6f4c('0x5')),'set':function(_0x49f6bd){if(_[_0x6f4c('0x6')](_0x49f6bd)){this[_0x6f4c('0x7')](_0x6f4c('0x8'),JSON[_0x6f4c('0x9')](_0x49f6bd));}else if(_[_0x6f4c('0xa')](_0x49f6bd)){this['setDataValue']('formData',_0x49f6bd);}else{this[_0x6f4c('0x7')](_0x6f4c('0x8'),util[_0x6f4c('0xb')](_0x6f4c('0xc'),this[_0x6f4c('0xd')](_0x6f4c('0xe'))||'',this[_0x6f4c('0xd')](_0x6f4c('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6f4c('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6f4c('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 6ee1315..397d44c 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 _0x8f4c=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','intersection','updatedAt','body','omit','createdAt','update','findOne','order','JscriptySessionReport','findAll','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','toString','indexOf','replace','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','now','writeFileSync','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','Projects','error','stack','name','send','map','JscriptyProject','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f4c,0x113));var _0xc8f4=function(_0xd921ef,_0x285f09){_0xd921ef=_0xd921ef-0x0;var _0x48da14=_0x8f4c[_0xd921ef];return _0x48da14;};'use strict';var emlformat=require(_0xc8f4('0x0'));var rimraf=require(_0xc8f4('0x1'));var zipdir=require(_0xc8f4('0x2'));var jsonpatch=require(_0xc8f4('0x3'));var rp=require(_0xc8f4('0x4'));var moment=require(_0xc8f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc8f4('0x6'));var util=require(_0xc8f4('0x7'));var path=require(_0xc8f4('0x8'));var sox=require('sox');var csv=require(_0xc8f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0x9'));var querystring=require(_0xc8f4('0xd'));var Papa=require(_0xc8f4('0xe'));var Redis=require('ioredis');var authService=require(_0xc8f4('0xf'));var qs=require(_0xc8f4('0x10'));var as=require(_0xc8f4('0x11'));var hardwareService=require(_0xc8f4('0x12'));var logger=require('../../config/logger')(_0xc8f4('0x13'));var utils=require('../../config/utils');var config=require(_0xc8f4('0x14'));var licenseUtil=require(_0xc8f4('0x15'));var db=require(_0xc8f4('0x16'))['db'];function respondWithStatusCode(_0x729f8f,_0x39b785){_0x39b785=_0x39b785||0xcc;return function(_0x4e31cf){if(_0x4e31cf){return _0x729f8f[_0xc8f4('0x17')](_0x39b785);}return _0x729f8f[_0xc8f4('0x18')](_0x39b785)[_0xc8f4('0x19')]();};}function respondWithResult(_0x14bc11,_0x1dcee5){_0x1dcee5=_0x1dcee5||0xc8;return function(_0x411c5c){if(_0x411c5c){return _0x14bc11['status'](_0x1dcee5)[_0xc8f4('0x1a')](_0x411c5c);}};}function respondWithFilteredResult(_0x2c7bc1,_0x1518a6){return function(_0x46ac15){if(_0x46ac15){var _0x22c08a=typeof _0x1518a6['offset']===_0xc8f4('0x1b')&&typeof _0x1518a6['limit']==='undefined';var _0x14bc02=_0x46ac15[_0xc8f4('0x1c')];var _0x108076=_0x22c08a?0x0:_0x1518a6[_0xc8f4('0x1d')];var _0x4763c1=_0x22c08a?_0x46ac15[_0xc8f4('0x1c')]:_0x1518a6[_0xc8f4('0x1d')]+_0x1518a6[_0xc8f4('0x1e')];var _0x1982bb;if(_0x4763c1>=_0x14bc02){_0x4763c1=_0x14bc02;_0x1982bb=0xc8;}else{_0x1982bb=0xce;}_0x2c7bc1[_0xc8f4('0x18')](_0x1982bb);return _0x2c7bc1[_0xc8f4('0x1f')](_0xc8f4('0x20'),_0x108076+'-'+_0x4763c1+'/'+_0x14bc02)[_0xc8f4('0x1a')](_0x46ac15);}return null;};}function patchUpdates(_0x5f3264){return function(_0x378f56){try{jsonpatch[_0xc8f4('0x21')](_0x378f56,_0x5f3264,!![]);}catch(_0x29e52d){return BPromise[_0xc8f4('0x22')](_0x29e52d);}return _0x378f56[_0xc8f4('0x23')]();};}function saveUpdates(_0x3b42ee,_0xaeee7d){return function(_0x43eb57){if(_0x43eb57){return _0x43eb57['update'](_0x3b42ee)[_0xc8f4('0x24')](function(_0x205c41){return _0x205c41;});}return null;};}function removeEntity(_0x3195ff,_0x1d159e){return function(_0x5d54a9){if(_0x5d54a9){return _0x5d54a9[_0xc8f4('0x25')]()['then'](function(){var _0x3782fd=_0x5d54a9['get']({'plain':!![]});var _0x177a44=_0xc8f4('0x26');return db['UserProfileResource'][_0xc8f4('0x25')]({'where':{'type':_0x177a44,'resourceId':_0x3782fd['id']}})[_0xc8f4('0x24')](function(){return _0x5d54a9;});})[_0xc8f4('0x24')](function(){_0x3195ff[_0xc8f4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3db490,_0x3484b6){return function(_0x5db666){if(!_0x5db666){_0x3db490[_0xc8f4('0x17')](0x194);}return _0x5db666;};}function handleError(_0x37957c,_0x157ad5){_0x157ad5=_0x157ad5||0x1f4;return function(_0x1b70bc){logger[_0xc8f4('0x27')](_0x1b70bc[_0xc8f4('0x28')]);if(_0x1b70bc['name']){delete _0x1b70bc[_0xc8f4('0x29')];}_0x37957c[_0xc8f4('0x18')](_0x157ad5)[_0xc8f4('0x2a')](_0x1b70bc);};}exports['index']=function(_0xf4a556,_0x3a4b1b){var _0x5ab6cb={},_0x56ec4b={},_0x4d6c43={'count':0x0,'rows':[]};var _0x2717ff=_[_0xc8f4('0x2b')](db[_0xc8f4('0x2c')][_0xc8f4('0x2d')],function(_0x273e73){return{'name':_0x273e73[_0xc8f4('0x2e')],'type':_0x273e73[_0xc8f4('0x2f')][_0xc8f4('0x30')]};});_0x56ec4b['model']=_[_0xc8f4('0x2b')](_0x2717ff,_0xc8f4('0x29'));_0x56ec4b[_0xc8f4('0x31')]=_['keys'](_0xf4a556[_0xc8f4('0x31')]);_0x56ec4b[_0xc8f4('0x32')]=_['intersection'](_0x56ec4b[_0xc8f4('0x33')],_0x56ec4b[_0xc8f4('0x31')]);_0x5ab6cb[_0xc8f4('0x34')]=_['intersection'](_0x56ec4b[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0xf4a556[_0xc8f4('0x31')]['fields']));_0x5ab6cb[_0xc8f4('0x34')]=_0x5ab6cb[_0xc8f4('0x34')][_0xc8f4('0x36')]?_0x5ab6cb[_0xc8f4('0x34')]:_0x56ec4b[_0xc8f4('0x33')];if(!_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x37')](_0xc8f4('0x38'))){_0x5ab6cb[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x1e')]);_0x5ab6cb[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x1d')]);}_0x5ab6cb['order']=qs[_0xc8f4('0x39')](_0xf4a556['query'][_0xc8f4('0x39')]);_0x5ab6cb['where']=qs[_0xc8f4('0x32')](_[_0xc8f4('0x3a')](_0xf4a556[_0xc8f4('0x31')],_0x56ec4b[_0xc8f4('0x32')]),_0x2717ff);if(_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3b')]){_0x5ab6cb[_0xc8f4('0x3c')]=_['merge'](_0x5ab6cb[_0xc8f4('0x3c')],{'$or':_[_0xc8f4('0x2b')](_0x2717ff,function(_0x3963f4){if(_0x3963f4[_0xc8f4('0x2f')]!=='VIRTUAL'){var _0x172836={};_0x172836[_0x3963f4[_0xc8f4('0x29')]]={'$like':'%'+_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3b')]+'%'};return _0x172836;}})});}_0x5ab6cb=_[_0xc8f4('0x3d')]({},_0x5ab6cb,_0xf4a556[_0xc8f4('0x3e')]);var _0xca3cc={'where':_0x5ab6cb[_0xc8f4('0x3c')]};return db[_0xc8f4('0x2c')][_0xc8f4('0x1c')](_0xca3cc)[_0xc8f4('0x24')](function(_0xd56415){_0x4d6c43['count']=_0xd56415;if(_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3f')]){_0x5ab6cb[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x2c')]['findAll'](_0x5ab6cb);})['then'](function(_0x413a55){_0x4d6c43[_0xc8f4('0x41')]=_0x413a55;return _0x4d6c43;})['then'](respondWithFilteredResult(_0x3a4b1b,_0x5ab6cb))[_0xc8f4('0x42')](handleError(_0x3a4b1b,null));};exports[_0xc8f4('0x43')]=function(_0x530b69,_0x5a85bb){var _0x3c8569={'raw':![],'where':{'id':_0x530b69[_0xc8f4('0x44')]['id']}},_0x342c28={};_0x342c28[_0xc8f4('0x33')]=_[_0xc8f4('0x45')](db[_0xc8f4('0x2c')]['rawAttributes']);_0x342c28['query']=_[_0xc8f4('0x45')](_0x530b69[_0xc8f4('0x31')]);_0x342c28[_0xc8f4('0x32')]=_['intersection'](_0x342c28['model'],_0x342c28['query']);_0x3c8569['attributes']=_['intersection'](_0x342c28[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0x530b69[_0xc8f4('0x31')][_0xc8f4('0x35')]));_0x3c8569[_0xc8f4('0x34')]=_0x3c8569[_0xc8f4('0x34')]['length']?_0x3c8569[_0xc8f4('0x34')]:_0x342c28[_0xc8f4('0x33')];if(_0x530b69['query']['includeAll']){_0x3c8569[_0xc8f4('0x40')]=[{'all':!![]}];}_0x3c8569=_[_0xc8f4('0x3d')]({},_0x3c8569,_0x530b69[_0xc8f4('0x3e')]);return db[_0xc8f4('0x2c')]['find'](_0x3c8569)['then'](handleEntityNotFound(_0x5a85bb,null))[_0xc8f4('0x24')](respondWithResult(_0x5a85bb,null))[_0xc8f4('0x42')](handleError(_0x5a85bb,null));};exports[_0xc8f4('0x46')]=function(_0x2bc4db,_0x141f81){return db[_0xc8f4('0x2c')]['create'](_0x2bc4db['body'],{})[_0xc8f4('0x24')](function(_0x447473){var _0x199b7d=_0x2bc4db[_0xc8f4('0x47')][_0xc8f4('0x48')]({'plain':!![]});if(!_0x199b7d)throw new Error(_0xc8f4('0x49'));if(_0x199b7d[_0xc8f4('0x4a')]===_0xc8f4('0x47')){var _0x3d9d67=_0x447473['get']({'plain':!![]});var _0x5c7768=_0xc8f4('0x26');return db[_0xc8f4('0x4b')][_0xc8f4('0x4c')]({'where':{'name':_0x5c7768,'userProfileId':_0x199b7d[_0xc8f4('0x4d')]},'raw':!![]})[_0xc8f4('0x24')](function(_0x165aac){if(_0x165aac&&_0x165aac[_0xc8f4('0x4e')]===0x0){return db[_0xc8f4('0x4f')][_0xc8f4('0x46')]({'name':_0x3d9d67[_0xc8f4('0x29')],'resourceId':_0x3d9d67['id'],'type':_0x165aac[_0xc8f4('0x29')],'sectionId':_0x165aac['id']},{})[_0xc8f4('0x24')](function(){return _0x447473;});}else{return _0x447473;}})[_0xc8f4('0x42')](function(_0x4ec67d){logger[_0xc8f4('0x27')](_0xc8f4('0x50'),_0x4ec67d);throw _0x4ec67d;});}return _0x447473;})[_0xc8f4('0x24')](respondWithResult(_0x141f81,0xc9))[_0xc8f4('0x42')](handleError(_0x141f81,null));};exports['clone']=function(_0xd6052d,_0x450059){var _0x4b4de3={'where':{'id':_0xd6052d[_0xc8f4('0x44')]['id']}},_0x47995c={};_0x47995c['model']=_[_0xc8f4('0x45')](db[_0xc8f4('0x2c')][_0xc8f4('0x2d')]);_0x4b4de3[_0xc8f4('0x34')]=_[_0xc8f4('0x51')](_0x47995c[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0xd6052d[_0xc8f4('0x31')][_0xc8f4('0x35')]));_0x4b4de3[_0xc8f4('0x34')]=_0x4b4de3[_0xc8f4('0x34')]['length']?_0x4b4de3[_0xc8f4('0x34')]:_0x47995c[_0xc8f4('0x33')];if(_0xd6052d[_0xc8f4('0x31')][_0xc8f4('0x3f')]){_0x4b4de3['include']=[{'all':!![]}];}_0x4b4de3=_[_0xc8f4('0x3d')]({},_0x4b4de3,_0xd6052d['options']);return db['JscriptyProject'][_0xc8f4('0x4c')](_0x4b4de3)[_0xc8f4('0x24')](handleEntityNotFound(_0x450059,null))[_0xc8f4('0x24')](function(_0x39cb77){if(_0x39cb77){var _0x2bfb92=_0x39cb77[_0xc8f4('0x48')]({'plain':!![]});_0x2bfb92=qs['omit'](_0x2bfb92,['id','createdAt',_0xc8f4('0x52')]);_0xd6052d[_0xc8f4('0x53')]=_[_0xc8f4('0x54')](_0xd6052d[_0xc8f4('0x53')],['id',_0xc8f4('0x55'),_0xc8f4('0x52')]);return db[_0xc8f4('0x2c')]['create'](_[_0xc8f4('0x3d')](_0x2bfb92,_0xd6052d[_0xc8f4('0x53')]),{'include':_0xd6052d['query'][_0xc8f4('0x3f')]?[{'all':!![]}]:undefined})[_0xc8f4('0x24')](function(_0x9dbf80){var _0x5b8bf4=_0xd6052d[_0xc8f4('0x47')][_0xc8f4('0x48')]({'plain':!![]});if(!_0x5b8bf4)throw new Error(_0xc8f4('0x49'));if(_0x5b8bf4['role']===_0xc8f4('0x47')){var _0x470593=_0x9dbf80['get']({'plain':!![]});var _0x52e295=_0xc8f4('0x26');return db['UserProfileSection'][_0xc8f4('0x4c')]({'where':{'name':_0x52e295,'userProfileId':_0x5b8bf4[_0xc8f4('0x4d')]},'raw':!![]})['then'](function(_0x5f2781){if(_0x5f2781&&_0x5f2781['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x470593['name'],'resourceId':_0x470593['id'],'type':_0x5f2781[_0xc8f4('0x29')],'sectionId':_0x5f2781['id']},{})['then'](function(){return _0x9dbf80;});}else{return _0x9dbf80;}})[_0xc8f4('0x42')](function(_0x357e45){logger[_0xc8f4('0x27')](_0xc8f4('0x50'),_0x357e45);throw _0x357e45;});}return _0x9dbf80;});}})['then'](respondWithResult(_0x450059,0xc9))[_0xc8f4('0x42')](handleError(_0x450059,null));};exports[_0xc8f4('0x56')]=function(_0x3ca2ca,_0xb50e61){if(_0x3ca2ca['body']['id']){delete _0x3ca2ca[_0xc8f4('0x53')]['id'];}return db[_0xc8f4('0x2c')][_0xc8f4('0x4c')]({'where':{'id':_0x3ca2ca[_0xc8f4('0x44')]['id']}})['then'](handleEntityNotFound(_0xb50e61,null))[_0xc8f4('0x24')](saveUpdates(_0x3ca2ca[_0xc8f4('0x53')],null))['then'](respondWithResult(_0xb50e61,null))[_0xc8f4('0x42')](handleError(_0xb50e61,null));};exports[_0xc8f4('0x25')]=function(_0x42b9df,_0x262fca){return db[_0xc8f4('0x2c')][_0xc8f4('0x4c')]({'where':{'id':_0x42b9df['params']['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x262fca,null))[_0xc8f4('0x24')](removeEntity(_0x262fca,null))[_0xc8f4('0x42')](handleError(_0x262fca,null));};exports['getSessions']=function(_0x28db1f,_0x2b6510,_0x3cc1cb){var _0x498578={'raw':!![],'where':{}};var _0x199873={};var _0x38a486={'count':0x0,'rows':[]};return db[_0xc8f4('0x2c')][_0xc8f4('0x57')]({'where':{'id':_0x28db1f['params']['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x2b6510,null))[_0xc8f4('0x24')](function(_0x5500a9){if(_0x5500a9){_0x199873[_0xc8f4('0x33')]=_[_0xc8f4('0x45')](db['JscriptySessionReport'][_0xc8f4('0x2d')]);_0x199873[_0xc8f4('0x31')]=_[_0xc8f4('0x45')](_0x28db1f[_0xc8f4('0x31')]);_0x199873[_0xc8f4('0x32')]=_[_0xc8f4('0x51')](_0x199873[_0xc8f4('0x33')],_0x199873[_0xc8f4('0x31')]);_0x498578['attributes']=_[_0xc8f4('0x51')](_0x199873[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0x28db1f[_0xc8f4('0x31')][_0xc8f4('0x35')]));_0x498578['attributes']=_0x498578[_0xc8f4('0x34')]['length']?_0x498578[_0xc8f4('0x34')]:_0x199873[_0xc8f4('0x33')];if(!_0x28db1f[_0xc8f4('0x31')][_0xc8f4('0x37')](_0xc8f4('0x38'))){_0x498578[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0x28db1f[_0xc8f4('0x31')][_0xc8f4('0x1e')]);_0x498578[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0x28db1f['query'][_0xc8f4('0x1d')]);}_0x498578[_0xc8f4('0x58')]=qs[_0xc8f4('0x39')](_0x28db1f[_0xc8f4('0x31')]['sort']);_0x498578['where']=qs[_0xc8f4('0x32')](_['pick'](_0x28db1f[_0xc8f4('0x31')],_0x199873['filters']));_0x498578[_0xc8f4('0x3c')]['ProjectId']=_0x5500a9['id'];if(_0x28db1f['query']['filter']){_0x498578['where']=_['merge'](_0x498578['where'],{'$or':_[_0xc8f4('0x2b')](_0x498578['attributes'],function(_0x1db7ea){var _0x3ad7dd={};_0x3ad7dd[_0x1db7ea]={'$like':'%'+_0x28db1f[_0xc8f4('0x31')][_0xc8f4('0x3b')]+'%'};return _0x3ad7dd;})});}_0x498578=_[_0xc8f4('0x3d')]({},_0x498578,_0x28db1f['options']);return db[_0xc8f4('0x59')][_0xc8f4('0x1c')]({'where':_0x498578[_0xc8f4('0x3c')]})['then'](function(_0x6da52){_0x38a486[_0xc8f4('0x1c')]=_0x6da52;if(_0x28db1f[_0xc8f4('0x31')][_0xc8f4('0x3f')]){_0x498578[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x59')][_0xc8f4('0x5a')](_0x498578);})[_0xc8f4('0x24')](function(_0x4d7018){_0x38a486[_0xc8f4('0x41')]=_0x4d7018;return _0x38a486;});}})[_0xc8f4('0x24')](respondWithFilteredResult(_0x2b6510,_0x498578))[_0xc8f4('0x42')](handleError(_0x2b6510,null));};exports[_0xc8f4('0x5b')]=function(_0xf2a4d7,_0x17c918,_0x16daa0){var _0xd17d2b={'raw':!![],'where':{}};var _0x14abbe={};var _0x2534ed={'count':0x0,'rows':[]};return db[_0xc8f4('0x2c')]['findOne']({'where':{'id':_0xf2a4d7[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x17c918,null))['then'](function(_0x412695){if(_0x412695){_0x14abbe[_0xc8f4('0x33')]=_['keys'](db[_0xc8f4('0x5c')][_0xc8f4('0x2d')]);_0x14abbe['query']=_['keys'](_0xf2a4d7[_0xc8f4('0x31')]);_0x14abbe[_0xc8f4('0x32')]=_[_0xc8f4('0x51')](_0x14abbe['model'],_0x14abbe[_0xc8f4('0x31')]);_0xd17d2b[_0xc8f4('0x34')]=_['intersection'](_0x14abbe['model'],qs[_0xc8f4('0x35')](_0xf2a4d7[_0xc8f4('0x31')][_0xc8f4('0x35')]));_0xd17d2b['attributes']=_0xd17d2b[_0xc8f4('0x34')][_0xc8f4('0x36')]?_0xd17d2b[_0xc8f4('0x34')]:_0x14abbe['model'];if(!_0xf2a4d7[_0xc8f4('0x31')][_0xc8f4('0x37')](_0xc8f4('0x38'))){_0xd17d2b[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0xf2a4d7[_0xc8f4('0x31')][_0xc8f4('0x1e')]);_0xd17d2b[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0xf2a4d7[_0xc8f4('0x31')][_0xc8f4('0x1d')]);}_0xd17d2b['order']=qs[_0xc8f4('0x39')](_0xf2a4d7['query'][_0xc8f4('0x39')]);_0xd17d2b[_0xc8f4('0x3c')]=qs[_0xc8f4('0x32')](_[_0xc8f4('0x3a')](_0xf2a4d7[_0xc8f4('0x31')],_0x14abbe[_0xc8f4('0x32')]));_0xd17d2b[_0xc8f4('0x3c')][_0xc8f4('0x5d')]=_0x412695['id'];if(_0xf2a4d7['query'][_0xc8f4('0x3b')]){_0xd17d2b['where']=_['merge'](_0xd17d2b[_0xc8f4('0x3c')],{'$or':_[_0xc8f4('0x2b')](_0xd17d2b[_0xc8f4('0x34')],function(_0x4fedd9){var _0x4c8e98={};_0x4c8e98[_0x4fedd9]={'$like':'%'+_0xf2a4d7[_0xc8f4('0x31')][_0xc8f4('0x3b')]+'%'};return _0x4c8e98;})});}_0xd17d2b=_[_0xc8f4('0x3d')]({},_0xd17d2b,_0xf2a4d7['options']);return db[_0xc8f4('0x5c')]['count']({'where':_0xd17d2b[_0xc8f4('0x3c')]})[_0xc8f4('0x24')](function(_0x30a87f){_0x2534ed[_0xc8f4('0x1c')]=_0x30a87f;if(_0xf2a4d7[_0xc8f4('0x31')]['includeAll']){_0xd17d2b[_0xc8f4('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc8f4('0x5a')](_0xd17d2b);})[_0xc8f4('0x24')](function(_0x1499fe){_0x2534ed[_0xc8f4('0x41')]=_0x1499fe;return _0x2534ed;});}})[_0xc8f4('0x24')](respondWithFilteredResult(_0x17c918,_0xd17d2b))[_0xc8f4('0x42')](handleError(_0x17c918,null));};function char(_0x3f1852){return _0xc8f4('0x5e')===typeof _0x3f1852?String[_0xc8f4('0x5f')][_0xc8f4('0x21')](null,arguments):_0x3f1852;}function needsEncapsulation(_0x28bcf0){return!!_0x28bcf0&&(_0x28bcf0['toString']()['indexOf'](char(0xd))>=0x0||_0x28bcf0[_0xc8f4('0x60')]()[_0xc8f4('0x61')](char(0xa))>=0x0||_0x28bcf0[_0xc8f4('0x60')]()[_0xc8f4('0x61')](char(0x2c))>=0x0||_0x28bcf0[_0xc8f4('0x60')]()[_0xc8f4('0x61')](char(0x22))>=0x0);}function encapsulate(_0x1c4763){var _0x13b1ad=char(0x22),_0xa6af22='\x5c'+char(0x22),_0x7758c2=_0x1c4763[_0xc8f4('0x60')]()[_0xc8f4('0x62')](new RegExp(_0x13b1ad,'g'),_0xa6af22);return _0x13b1ad+_0x7758c2+_0x13b1ad;}exports['getSummary']=function(_0x4971f7,_0x41a76a,_0x57c332){var _0x51ea01,_0x169ef3;var _0x4c525e={'where':{'ProjectId':_0x4971f7['params']['id']}};if(_0x4971f7['query']['startTime']){_0x4c525e['where'][_0xc8f4('0x63')]=JSON[_0xc8f4('0x64')](_0x4971f7[_0xc8f4('0x31')][_0xc8f4('0x65')]);}return db[_0xc8f4('0x59')][_0xc8f4('0x5a')](_0x4c525e)[_0xc8f4('0x24')](handleEntityNotFound(_0x41a76a,null))[_0xc8f4('0x24')](function(_0x1425c7){if(_0x1425c7){_0x51ea01=_0x1425c7;return db[_0xc8f4('0x66')][_0xc8f4('0x5a')]({'where':{'SessionId':{'$in':_[_0xc8f4('0x2b')](_0x51ea01,'id')},'ProjectId':_0x4971f7[_0xc8f4('0x44')]['id']},'order':_0xc8f4('0x67')});}})[_0xc8f4('0x24')](handleEntityNotFound(_0x41a76a,null))[_0xc8f4('0x24')](function(_0x3a86b2){if(_0x3a86b2){_0x169ef3=_0x3a86b2;var _0x20ea4d={};for(var _0xd8a37c=0x0,_0x35c5e9=_0x169ef3[_0xc8f4('0x36')];_0xd8a37c<_0x35c5e9;_0xd8a37c++){if(!_0x20ea4d[_0xc8f4('0x37')](_0x169ef3[_0xd8a37c][_0xc8f4('0x68')])){_0x20ea4d[_0x169ef3[_0xd8a37c]['questionId']]=needsEncapsulation(_0x169ef3[_0xd8a37c]['question'])?encapsulate(_0x169ef3[_0xd8a37c][_0xc8f4('0x69')]):_0x169ef3[_0xd8a37c][_0xc8f4('0x69')];}}var _0x35190f=[],_0xe6b7eb={};for(var _0x1f5a30=0x0,_0x427f72=_0x51ea01[_0xc8f4('0x36')];_0x1f5a30<_0x427f72;_0x1f5a30++){_0xe6b7eb={'ProjectId':_0x4971f7[_0xc8f4('0x44')]['id'],'SessionId':_0x51ea01[_0x1f5a30]['id'],'StartTime':moment(_0x51ea01[_0x1f5a30][_0xc8f4('0x63')])[_0xc8f4('0x6a')](_0xc8f4('0x6b'))};for(var _0x1bd476=0x0,_0x697807=_0x169ef3[_0xc8f4('0x36')];_0x1bd476<_0x697807;_0x1bd476++){if(_0x169ef3[_0x1bd476]['SessionId']==_0x51ea01[_0x1f5a30]['id']&&_0x20ea4d[_0xc8f4('0x37')](_0x169ef3[_0x1bd476][_0xc8f4('0x68')])){_0xe6b7eb[_0x20ea4d[_0x169ef3[_0x1bd476][_0xc8f4('0x68')]]]=_0x169ef3[_0x1bd476][_0xc8f4('0x6c')];}}for(var _0x464b77 in _0x20ea4d){if(!_0xe6b7eb['hasOwnProperty'](_0x20ea4d[_0x464b77])){_0xe6b7eb[_0x20ea4d[_0x464b77]]=null;}}_0x35190f[_0xc8f4('0x6d')](_0xe6b7eb);}return _0x35190f;}})[_0xc8f4('0x24')](function(_0x5a5f87){if(!_['isEmpty'](_0x5a5f87)){var _0x3930c1=toCsv(_0x5a5f87);var _0x18e362=Date[_0xc8f4('0x6e')]();fs[_0xc8f4('0x6f')](util[_0xc8f4('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4971f7['params']['id'],_0x18e362),_0x3930c1);_0x41a76a[_0xc8f4('0x70')](_0xc8f4('0x71'),'attachment;\x20filename='+util[_0xc8f4('0x6a')](_0xc8f4('0x72'),_0x4971f7[_0xc8f4('0x44')]['id'],_0x18e362));_0x41a76a[_0xc8f4('0x70')](_0xc8f4('0x73'),_0xc8f4('0x74'));return _0x41a76a[_0xc8f4('0x75')](util[_0xc8f4('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4971f7[_0xc8f4('0x44')]['id'],_0x18e362));}else{return _0x41a76a[_0xc8f4('0x17')](0xcc);}})[_0xc8f4('0x42')](handleError(_0x41a76a,null));}; \ No newline at end of file +var _0x0598=['pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','body','createdAt','updatedAt','UserProfileSection','autoAssociation','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','rows','fromCharCode','toString','indexOf','replace','getSummary','starttime','parse','startTime','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','limit','count','offset','set','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0x0598,0x19e));var _0x8059=function(_0x1ca4d5,_0x261e11){_0x1ca4d5=_0x1ca4d5-0x0;var _0x236fbb=_0x0598[_0x1ca4d5];return _0x236fbb;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8059('0x1'));var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8059('0x3'));var util=require(_0x8059('0x4'));var path=require(_0x8059('0x5'));var sox=require(_0x8059('0x6'));var csv=require(_0x8059('0x7'));var ejs=require(_0x8059('0x8'));var fs=require('fs');var fs_extra=require(_0x8059('0x9'));var _=require('lodash');var squel=require(_0x8059('0xa'));var crypto=require(_0x8059('0xb'));var jsforce=require(_0x8059('0xc'));var deskjs=require(_0x8059('0xd'));var toCsv=require(_0x8059('0x7'));var querystring=require('querystring');var Papa=require(_0x8059('0xe'));var Redis=require('ioredis');var authService=require(_0x8059('0xf'));var qs=require(_0x8059('0x10'));var as=require(_0x8059('0x11'));var hardwareService=require(_0x8059('0x12'));var logger=require(_0x8059('0x13'))(_0x8059('0x14'));var utils=require(_0x8059('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8059('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403d4e,_0x1e3f7d){_0x1e3f7d=_0x1e3f7d||0xcc;return function(_0x256943){if(_0x256943){return _0x403d4e['sendStatus'](_0x1e3f7d);}return _0x403d4e[_0x8059('0x17')](_0x1e3f7d)['end']();};}function respondWithResult(_0x47ab03,_0x1f0470){_0x1f0470=_0x1f0470||0xc8;return function(_0x34a816){if(_0x34a816){return _0x47ab03['status'](_0x1f0470)[_0x8059('0x18')](_0x34a816);}};}function respondWithFilteredResult(_0x78a304,_0x47a863){return function(_0x572260){if(_0x572260){var _0x1a14da=typeof _0x47a863['offset']==='undefined'&&typeof _0x47a863[_0x8059('0x19')]==='undefined';var _0x3c4421=_0x572260[_0x8059('0x1a')];var _0x2514da=_0x1a14da?0x0:_0x47a863[_0x8059('0x1b')];var _0x465414=_0x1a14da?_0x572260[_0x8059('0x1a')]:_0x47a863[_0x8059('0x1b')]+_0x47a863[_0x8059('0x19')];var _0x10bdc4;if(_0x465414>=_0x3c4421){_0x465414=_0x3c4421;_0x10bdc4=0xc8;}else{_0x10bdc4=0xce;}_0x78a304['status'](_0x10bdc4);return _0x78a304[_0x8059('0x1c')]('Content-Range',_0x2514da+'-'+_0x465414+'/'+_0x3c4421)['json'](_0x572260);}return null;};}function patchUpdates(_0xe52f75){return function(_0xec2b4a){try{jsonpatch[_0x8059('0x1d')](_0xec2b4a,_0xe52f75,!![]);}catch(_0x1f05ec){return BPromise[_0x8059('0x1e')](_0x1f05ec);}return _0xec2b4a[_0x8059('0x1f')]();};}function saveUpdates(_0x5c81af,_0x5bd347){return function(_0x202706){if(_0x202706){return _0x202706[_0x8059('0x20')](_0x5c81af)[_0x8059('0x21')](function(_0x93078c){return _0x93078c;});}return null;};}function removeEntity(_0x3241d0,_0x244c8b){return function(_0x285396){if(_0x285396){return _0x285396[_0x8059('0x22')]()[_0x8059('0x21')](function(){var _0x2e02d4=_0x285396[_0x8059('0x23')]({'plain':!![]});var _0x3cdb8a=_0x8059('0x24');return db[_0x8059('0x25')][_0x8059('0x22')]({'where':{'type':_0x3cdb8a,'resourceId':_0x2e02d4['id']}})['then'](function(){return _0x285396;});})[_0x8059('0x21')](function(){_0x3241d0['status'](0xcc)[_0x8059('0x26')]();});}};}function handleEntityNotFound(_0x5696e0,_0x5bd428){return function(_0x2820e6){if(!_0x2820e6){_0x5696e0[_0x8059('0x27')](0x194);}return _0x2820e6;};}function handleError(_0x1efb6c,_0x4af7f2){_0x4af7f2=_0x4af7f2||0x1f4;return function(_0xc6dcb6){logger[_0x8059('0x28')](_0xc6dcb6[_0x8059('0x29')]);if(_0xc6dcb6[_0x8059('0x2a')]){delete _0xc6dcb6[_0x8059('0x2a')];}_0x1efb6c[_0x8059('0x17')](_0x4af7f2)[_0x8059('0x2b')](_0xc6dcb6);};}exports[_0x8059('0x2c')]=function(_0x12fdf8,_0x2621f5){var _0x162a9={},_0xbb1c09={},_0x296995={'count':0x0,'rows':[]};var _0x5cd879=_[_0x8059('0x2d')](db[_0x8059('0x2e')][_0x8059('0x2f')],function(_0x2764b2){return{'name':_0x2764b2[_0x8059('0x30')],'type':_0x2764b2['type'][_0x8059('0x31')]};});_0xbb1c09['model']=_[_0x8059('0x2d')](_0x5cd879,_0x8059('0x2a'));_0xbb1c09[_0x8059('0x32')]=_['keys'](_0x12fdf8[_0x8059('0x32')]);_0xbb1c09[_0x8059('0x33')]=_[_0x8059('0x34')](_0xbb1c09[_0x8059('0x35')],_0xbb1c09['query']);_0x162a9[_0x8059('0x36')]=_[_0x8059('0x34')](_0xbb1c09['model'],qs[_0x8059('0x37')](_0x12fdf8[_0x8059('0x32')][_0x8059('0x37')]));_0x162a9[_0x8059('0x36')]=_0x162a9[_0x8059('0x36')][_0x8059('0x38')]?_0x162a9[_0x8059('0x36')]:_0xbb1c09[_0x8059('0x35')];if(!_0x12fdf8[_0x8059('0x32')][_0x8059('0x39')](_0x8059('0x3a'))){_0x162a9[_0x8059('0x19')]=qs[_0x8059('0x19')](_0x12fdf8[_0x8059('0x32')][_0x8059('0x19')]);_0x162a9[_0x8059('0x1b')]=qs[_0x8059('0x1b')](_0x12fdf8[_0x8059('0x32')][_0x8059('0x1b')]);}_0x162a9[_0x8059('0x3b')]=qs[_0x8059('0x3c')](_0x12fdf8[_0x8059('0x32')][_0x8059('0x3c')]);_0x162a9[_0x8059('0x3d')]=qs['filters'](_[_0x8059('0x3e')](_0x12fdf8[_0x8059('0x32')],_0xbb1c09[_0x8059('0x33')]),_0x5cd879);if(_0x12fdf8[_0x8059('0x32')][_0x8059('0x3f')]){_0x162a9[_0x8059('0x3d')]=_[_0x8059('0x40')](_0x162a9['where'],{'$or':_['map'](_0x5cd879,function(_0xc730a2){if(_0xc730a2[_0x8059('0x41')]!==_0x8059('0x42')){var _0x11a77b={};_0x11a77b[_0xc730a2['name']]={'$like':'%'+_0x12fdf8[_0x8059('0x32')][_0x8059('0x3f')]+'%'};return _0x11a77b;}})});}_0x162a9=_[_0x8059('0x40')]({},_0x162a9,_0x12fdf8[_0x8059('0x43')]);var _0x19cf88={'where':_0x162a9[_0x8059('0x3d')]};return db[_0x8059('0x2e')][_0x8059('0x1a')](_0x19cf88)[_0x8059('0x21')](function(_0x3cd03f){_0x296995[_0x8059('0x1a')]=_0x3cd03f;if(_0x12fdf8[_0x8059('0x32')][_0x8059('0x44')]){_0x162a9['include']=[{'all':!![]}];}return db[_0x8059('0x2e')][_0x8059('0x45')](_0x162a9);})[_0x8059('0x21')](function(_0x5df832){_0x296995['rows']=_0x5df832;return _0x296995;})['then'](respondWithFilteredResult(_0x2621f5,_0x162a9))[_0x8059('0x46')](handleError(_0x2621f5,null));};exports[_0x8059('0x47')]=function(_0x19c6a7,_0x1b514d){var _0xb28c07={'raw':![],'where':{'id':_0x19c6a7['params']['id']}},_0x5e500e={};_0x5e500e['model']=_[_0x8059('0x48')](db['JscriptyProject'][_0x8059('0x2f')]);_0x5e500e[_0x8059('0x32')]=_[_0x8059('0x48')](_0x19c6a7[_0x8059('0x32')]);_0x5e500e[_0x8059('0x33')]=_['intersection'](_0x5e500e['model'],_0x5e500e[_0x8059('0x32')]);_0xb28c07[_0x8059('0x36')]=_[_0x8059('0x34')](_0x5e500e['model'],qs[_0x8059('0x37')](_0x19c6a7[_0x8059('0x32')][_0x8059('0x37')]));_0xb28c07[_0x8059('0x36')]=_0xb28c07[_0x8059('0x36')][_0x8059('0x38')]?_0xb28c07[_0x8059('0x36')]:_0x5e500e['model'];if(_0x19c6a7[_0x8059('0x32')][_0x8059('0x44')]){_0xb28c07[_0x8059('0x49')]=[{'all':!![]}];}_0xb28c07=_[_0x8059('0x40')]({},_0xb28c07,_0x19c6a7[_0x8059('0x43')]);return db[_0x8059('0x2e')][_0x8059('0x4a')](_0xb28c07)[_0x8059('0x21')](handleEntityNotFound(_0x1b514d,null))['then'](respondWithResult(_0x1b514d,null))[_0x8059('0x46')](handleError(_0x1b514d,null));};exports[_0x8059('0x4b')]=function(_0x43603a,_0x3a21c1){return db[_0x8059('0x2e')][_0x8059('0x4b')](_0x43603a['body'],{})[_0x8059('0x21')](function(_0x199588){var _0x52405e=_0x43603a[_0x8059('0x4c')][_0x8059('0x23')]({'plain':!![]});if(!_0x52405e)throw new Error(_0x8059('0x4d'));if(_0x52405e[_0x8059('0x4e')]===_0x8059('0x4c')){var _0x2eea90=_0x199588[_0x8059('0x23')]({'plain':!![]});var _0x2a3fb0=_0x8059('0x24');return db['UserProfileSection'][_0x8059('0x4a')]({'where':{'name':_0x2a3fb0,'userProfileId':_0x52405e[_0x8059('0x4f')]},'raw':!![]})['then'](function(_0x102b01){if(_0x102b01&&_0x102b01['autoAssociation']===0x0){return db[_0x8059('0x25')][_0x8059('0x4b')]({'name':_0x2eea90[_0x8059('0x2a')],'resourceId':_0x2eea90['id'],'type':_0x102b01[_0x8059('0x2a')],'sectionId':_0x102b01['id']},{})[_0x8059('0x21')](function(){return _0x199588;});}else{return _0x199588;}})[_0x8059('0x46')](function(_0x2c74f3){logger[_0x8059('0x28')](_0x8059('0x50'),_0x2c74f3);throw _0x2c74f3;});}return _0x199588;})[_0x8059('0x21')](respondWithResult(_0x3a21c1,0xc9))[_0x8059('0x46')](handleError(_0x3a21c1,null));};exports[_0x8059('0x51')]=function(_0x451f03,_0x5993f4){var _0x4b4465={'where':{'id':_0x451f03[_0x8059('0x52')]['id']}},_0x2ee2b5={};_0x2ee2b5[_0x8059('0x35')]=_[_0x8059('0x48')](db[_0x8059('0x2e')][_0x8059('0x2f')]);_0x4b4465[_0x8059('0x36')]=_[_0x8059('0x34')](_0x2ee2b5[_0x8059('0x35')],qs[_0x8059('0x37')](_0x451f03[_0x8059('0x32')][_0x8059('0x37')]));_0x4b4465[_0x8059('0x36')]=_0x4b4465[_0x8059('0x36')]['length']?_0x4b4465[_0x8059('0x36')]:_0x2ee2b5['model'];if(_0x451f03[_0x8059('0x32')]['includeAll']){_0x4b4465[_0x8059('0x49')]=[{'all':!![]}];}_0x4b4465=_['merge']({},_0x4b4465,_0x451f03['options']);return db[_0x8059('0x2e')][_0x8059('0x4a')](_0x4b4465)[_0x8059('0x21')](handleEntityNotFound(_0x5993f4,null))[_0x8059('0x21')](function(_0x31b56a){if(_0x31b56a){var _0x3d6baf=_0x31b56a[_0x8059('0x23')]({'plain':!![]});_0x3d6baf=qs[_0x8059('0x53')](_0x3d6baf,['id','createdAt','updatedAt']);_0x451f03['body']=_[_0x8059('0x53')](_0x451f03[_0x8059('0x54')],['id',_0x8059('0x55'),_0x8059('0x56')]);return db[_0x8059('0x2e')][_0x8059('0x4b')](_['merge'](_0x3d6baf,_0x451f03['body']),{'include':_0x451f03[_0x8059('0x32')][_0x8059('0x44')]?[{'all':!![]}]:undefined})[_0x8059('0x21')](function(_0x19cde3){var _0x2fe950=_0x451f03[_0x8059('0x4c')]['get']({'plain':!![]});if(!_0x2fe950)throw new Error(_0x8059('0x4d'));if(_0x2fe950[_0x8059('0x4e')]==='user'){var _0x31218a=_0x19cde3[_0x8059('0x23')]({'plain':!![]});var _0x3406a7=_0x8059('0x24');return db[_0x8059('0x57')]['find']({'where':{'name':_0x3406a7,'userProfileId':_0x2fe950[_0x8059('0x4f')]},'raw':!![]})[_0x8059('0x21')](function(_0x5f3479){if(_0x5f3479&&_0x5f3479[_0x8059('0x58')]===0x0){return db['UserProfileResource'][_0x8059('0x4b')]({'name':_0x31218a[_0x8059('0x2a')],'resourceId':_0x31218a['id'],'type':_0x5f3479[_0x8059('0x2a')],'sectionId':_0x5f3479['id']},{})[_0x8059('0x21')](function(){return _0x19cde3;});}else{return _0x19cde3;}})[_0x8059('0x46')](function(_0x41a599){logger['error'](_0x8059('0x50'),_0x41a599);throw _0x41a599;});}return _0x19cde3;});}})['then'](respondWithResult(_0x5993f4,0xc9))[_0x8059('0x46')](handleError(_0x5993f4,null));};exports[_0x8059('0x20')]=function(_0x3f4cac,_0x48c0fb){if(_0x3f4cac[_0x8059('0x54')]['id']){delete _0x3f4cac[_0x8059('0x54')]['id'];}return db[_0x8059('0x2e')][_0x8059('0x4a')]({'where':{'id':_0x3f4cac[_0x8059('0x52')]['id']}})[_0x8059('0x21')](handleEntityNotFound(_0x48c0fb,null))[_0x8059('0x21')](saveUpdates(_0x3f4cac[_0x8059('0x54')],null))[_0x8059('0x21')](respondWithResult(_0x48c0fb,null))[_0x8059('0x46')](handleError(_0x48c0fb,null));};exports[_0x8059('0x22')]=function(_0x50da4f,_0x274d7f){return db[_0x8059('0x2e')][_0x8059('0x4a')]({'where':{'id':_0x50da4f[_0x8059('0x52')]['id']}})['then'](handleEntityNotFound(_0x274d7f,null))[_0x8059('0x21')](removeEntity(_0x274d7f,null))[_0x8059('0x46')](handleError(_0x274d7f,null));};exports[_0x8059('0x59')]=function(_0x596974,_0x5be542,_0x185287){var _0x423133={'raw':!![],'where':{}};var _0x3a9f83={};var _0x47a599={'count':0x0,'rows':[]};return db[_0x8059('0x2e')][_0x8059('0x5a')]({'where':{'id':_0x596974[_0x8059('0x52')]['id']}})[_0x8059('0x21')](handleEntityNotFound(_0x5be542,null))[_0x8059('0x21')](function(_0x2c9ab3){if(_0x2c9ab3){_0x3a9f83[_0x8059('0x35')]=_[_0x8059('0x48')](db[_0x8059('0x5b')][_0x8059('0x2f')]);_0x3a9f83[_0x8059('0x32')]=_[_0x8059('0x48')](_0x596974[_0x8059('0x32')]);_0x3a9f83[_0x8059('0x33')]=_['intersection'](_0x3a9f83['model'],_0x3a9f83[_0x8059('0x32')]);_0x423133[_0x8059('0x36')]=_['intersection'](_0x3a9f83[_0x8059('0x35')],qs[_0x8059('0x37')](_0x596974[_0x8059('0x32')][_0x8059('0x37')]));_0x423133['attributes']=_0x423133[_0x8059('0x36')][_0x8059('0x38')]?_0x423133[_0x8059('0x36')]:_0x3a9f83['model'];if(!_0x596974[_0x8059('0x32')][_0x8059('0x39')](_0x8059('0x3a'))){_0x423133[_0x8059('0x19')]=qs[_0x8059('0x19')](_0x596974[_0x8059('0x32')][_0x8059('0x19')]);_0x423133[_0x8059('0x1b')]=qs[_0x8059('0x1b')](_0x596974[_0x8059('0x32')][_0x8059('0x1b')]);}_0x423133[_0x8059('0x3b')]=qs[_0x8059('0x3c')](_0x596974[_0x8059('0x32')][_0x8059('0x3c')]);_0x423133['where']=qs[_0x8059('0x33')](_[_0x8059('0x3e')](_0x596974[_0x8059('0x32')],_0x3a9f83[_0x8059('0x33')]));_0x423133[_0x8059('0x3d')][_0x8059('0x5c')]=_0x2c9ab3['id'];if(_0x596974[_0x8059('0x32')][_0x8059('0x3f')]){_0x423133[_0x8059('0x3d')]=_[_0x8059('0x40')](_0x423133[_0x8059('0x3d')],{'$or':_[_0x8059('0x2d')](_0x423133[_0x8059('0x36')],function(_0x458c2d){var _0x1dc840={};_0x1dc840[_0x458c2d]={'$like':'%'+_0x596974[_0x8059('0x32')][_0x8059('0x3f')]+'%'};return _0x1dc840;})});}_0x423133=_[_0x8059('0x40')]({},_0x423133,_0x596974[_0x8059('0x43')]);return db[_0x8059('0x5b')]['count']({'where':_0x423133[_0x8059('0x3d')]})[_0x8059('0x21')](function(_0x4a8249){_0x47a599[_0x8059('0x1a')]=_0x4a8249;if(_0x596974[_0x8059('0x32')][_0x8059('0x44')]){_0x423133[_0x8059('0x49')]=[{'all':!![]}];}return db[_0x8059('0x5b')][_0x8059('0x45')](_0x423133);})[_0x8059('0x21')](function(_0x20c6fe){_0x47a599['rows']=_0x20c6fe;return _0x47a599;});}})['then'](respondWithFilteredResult(_0x5be542,_0x423133))[_0x8059('0x46')](handleError(_0x5be542,null));};exports[_0x8059('0x5d')]=function(_0x1739cb,_0x43765c,_0x297d13){var _0x29a42f={'raw':!![],'where':{}};var _0x1c7b00={};var _0x22ce95={'count':0x0,'rows':[]};return db[_0x8059('0x2e')][_0x8059('0x5a')]({'where':{'id':_0x1739cb[_0x8059('0x52')]['id']}})['then'](handleEntityNotFound(_0x43765c,null))['then'](function(_0x4e940b){if(_0x4e940b){_0x1c7b00[_0x8059('0x35')]=_[_0x8059('0x48')](db[_0x8059('0x5e')][_0x8059('0x2f')]);_0x1c7b00[_0x8059('0x32')]=_[_0x8059('0x48')](_0x1739cb[_0x8059('0x32')]);_0x1c7b00[_0x8059('0x33')]=_[_0x8059('0x34')](_0x1c7b00[_0x8059('0x35')],_0x1c7b00[_0x8059('0x32')]);_0x29a42f[_0x8059('0x36')]=_[_0x8059('0x34')](_0x1c7b00[_0x8059('0x35')],qs[_0x8059('0x37')](_0x1739cb['query'][_0x8059('0x37')]));_0x29a42f['attributes']=_0x29a42f[_0x8059('0x36')][_0x8059('0x38')]?_0x29a42f[_0x8059('0x36')]:_0x1c7b00['model'];if(!_0x1739cb[_0x8059('0x32')][_0x8059('0x39')](_0x8059('0x3a'))){_0x29a42f['limit']=qs[_0x8059('0x19')](_0x1739cb[_0x8059('0x32')][_0x8059('0x19')]);_0x29a42f['offset']=qs['offset'](_0x1739cb['query'][_0x8059('0x1b')]);}_0x29a42f[_0x8059('0x3b')]=qs[_0x8059('0x3c')](_0x1739cb[_0x8059('0x32')]['sort']);_0x29a42f['where']=qs[_0x8059('0x33')](_['pick'](_0x1739cb[_0x8059('0x32')],_0x1c7b00[_0x8059('0x33')]));_0x29a42f[_0x8059('0x3d')][_0x8059('0x5c')]=_0x4e940b['id'];if(_0x1739cb[_0x8059('0x32')][_0x8059('0x3f')]){_0x29a42f[_0x8059('0x3d')]=_[_0x8059('0x40')](_0x29a42f['where'],{'$or':_['map'](_0x29a42f[_0x8059('0x36')],function(_0x243e3a){var _0x437e68={};_0x437e68[_0x243e3a]={'$like':'%'+_0x1739cb[_0x8059('0x32')][_0x8059('0x3f')]+'%'};return _0x437e68;})});}_0x29a42f=_['merge']({},_0x29a42f,_0x1739cb[_0x8059('0x43')]);return db[_0x8059('0x5e')]['count']({'where':_0x29a42f[_0x8059('0x3d')]})[_0x8059('0x21')](function(_0x3f5fd8){_0x22ce95['count']=_0x3f5fd8;if(_0x1739cb[_0x8059('0x32')]['includeAll']){_0x29a42f[_0x8059('0x49')]=[{'all':!![]}];}return db[_0x8059('0x5e')]['findAll'](_0x29a42f);})[_0x8059('0x21')](function(_0x34b4be){_0x22ce95[_0x8059('0x5f')]=_0x34b4be;return _0x22ce95;});}})[_0x8059('0x21')](respondWithFilteredResult(_0x43765c,_0x29a42f))[_0x8059('0x46')](handleError(_0x43765c,null));};function char(_0xca3425){return'number'===typeof _0xca3425?String[_0x8059('0x60')][_0x8059('0x1d')](null,arguments):_0xca3425;}function needsEncapsulation(_0x15c8ca){return!!_0x15c8ca&&(_0x15c8ca[_0x8059('0x61')]()['indexOf'](char(0xd))>=0x0||_0x15c8ca[_0x8059('0x61')]()['indexOf'](char(0xa))>=0x0||_0x15c8ca[_0x8059('0x61')]()[_0x8059('0x62')](char(0x2c))>=0x0||_0x15c8ca[_0x8059('0x61')]()[_0x8059('0x62')](char(0x22))>=0x0);}function encapsulate(_0x9a0410){var _0x39181c=char(0x22),_0x44f9e1='\x5c'+char(0x22),_0x22438f=_0x9a0410[_0x8059('0x61')]()[_0x8059('0x63')](new RegExp(_0x39181c,'g'),_0x44f9e1);return _0x39181c+_0x22438f+_0x39181c;}exports[_0x8059('0x64')]=function(_0x2885f0,_0x589760,_0x7fd63c){var _0x4d077c,_0x3c05f8;var _0x578749={'where':{'ProjectId':_0x2885f0[_0x8059('0x52')]['id']}};if(_0x2885f0[_0x8059('0x32')]['startTime']){_0x578749[_0x8059('0x3d')][_0x8059('0x65')]=JSON[_0x8059('0x66')](_0x2885f0[_0x8059('0x32')][_0x8059('0x67')]);}return db[_0x8059('0x5b')][_0x8059('0x45')](_0x578749)[_0x8059('0x21')](handleEntityNotFound(_0x589760,null))[_0x8059('0x21')](function(_0x51ab15){if(_0x51ab15){_0x4d077c=_0x51ab15;return db['JscriptyQuestionReport'][_0x8059('0x45')]({'where':{'SessionId':{'$in':_[_0x8059('0x2d')](_0x4d077c,'id')},'ProjectId':_0x2885f0[_0x8059('0x52')]['id']},'order':'-createdAt'});}})[_0x8059('0x21')](handleEntityNotFound(_0x589760,null))['then'](function(_0xf785b4){if(_0xf785b4){_0x3c05f8=_0xf785b4;var _0x352883={};for(var _0x3aee8b=0x0,_0x32ce71=_0x3c05f8[_0x8059('0x38')];_0x3aee8b<_0x32ce71;_0x3aee8b++){if(!_0x352883[_0x8059('0x39')](_0x3c05f8[_0x3aee8b][_0x8059('0x68')])){_0x352883[_0x3c05f8[_0x3aee8b][_0x8059('0x68')]]=needsEncapsulation(_0x3c05f8[_0x3aee8b][_0x8059('0x69')])?encapsulate(_0x3c05f8[_0x3aee8b][_0x8059('0x69')]):_0x3c05f8[_0x3aee8b][_0x8059('0x69')];}}var _0x28bdfd=[],_0x3b2b36={};for(var _0x54749d=0x0,_0x280652=_0x4d077c[_0x8059('0x38')];_0x54749d<_0x280652;_0x54749d++){_0x3b2b36={'ProjectId':_0x2885f0[_0x8059('0x52')]['id'],'SessionId':_0x4d077c[_0x54749d]['id'],'StartTime':moment(_0x4d077c[_0x54749d][_0x8059('0x65')])[_0x8059('0x6a')](_0x8059('0x6b'))};for(var _0x44b2fb=0x0,_0x3e341e=_0x3c05f8[_0x8059('0x38')];_0x44b2fb<_0x3e341e;_0x44b2fb++){if(_0x3c05f8[_0x44b2fb][_0x8059('0x6c')]==_0x4d077c[_0x54749d]['id']&&_0x352883[_0x8059('0x39')](_0x3c05f8[_0x44b2fb][_0x8059('0x68')])){_0x3b2b36[_0x352883[_0x3c05f8[_0x44b2fb][_0x8059('0x68')]]]=_0x3c05f8[_0x44b2fb][_0x8059('0x6d')];}}for(var _0x178e4d in _0x352883){if(!_0x3b2b36[_0x8059('0x39')](_0x352883[_0x178e4d])){_0x3b2b36[_0x352883[_0x178e4d]]=null;}}_0x28bdfd[_0x8059('0x6e')](_0x3b2b36);}return _0x28bdfd;}})[_0x8059('0x21')](function(_0x3708d2){if(!_[_0x8059('0x6f')](_0x3708d2)){var _0x1fe485=toCsv(_0x3708d2);var _0x5aec47=Date['now']();fs[_0x8059('0x70')](util[_0x8059('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2885f0[_0x8059('0x52')]['id'],_0x5aec47),_0x1fe485);_0x589760['setHeader'](_0x8059('0x71'),'attachment;\x20filename='+util[_0x8059('0x6a')](_0x8059('0x72'),_0x2885f0['params']['id'],_0x5aec47));_0x589760['setHeader'](_0x8059('0x73'),_0x8059('0x74'));return _0x589760[_0x8059('0x75')](util[_0x8059('0x6a')](_0x8059('0x76'),_0x2885f0[_0x8059('0x52')]['id'],_0x5aec47));}else{return _0x589760[_0x8059('0x27')](0xcc);}})[_0x8059('0x46')](handleError(_0x589760,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index fec6001..37bfe04 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 _0x0dec=['bluebird','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api'];(function(_0x1efc03,_0x494189){var _0x14c07e=function(_0x4d5004){while(--_0x4d5004){_0x1efc03['push'](_0x1efc03['shift']());}};_0x14c07e(++_0x494189);}(_0x0dec,0x11c));var _0xc0de=function(_0x382ea4,_0x391c9a){_0x382ea4=_0x382ea4-0x0;var _0x2fd31f=_0x0dec[_0x382ea4];return _0x2fd31f;};'use strict';var _=require(_0xc0de('0x0'));var util=require(_0xc0de('0x1'));var logger=require(_0xc0de('0x2'))(_0xc0de('0x3'));var moment=require('moment');var BPromise=require(_0xc0de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc0de('0x5'));var config=require(_0xc0de('0x6'));var attributes=require(_0xc0de('0x7'));module[_0xc0de('0x8')]=function(_0xae49db,_0x194937){return _0xae49db[_0xc0de('0x9')](_0xc0de('0xa'),attributes,{'tableName':_0xc0de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67a2=['define','jscripty_projects','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4acf63,_0x2a7330){var _0x26bcd0=function(_0x3b3b18){while(--_0x3b3b18){_0x4acf63['push'](_0x4acf63['shift']());}};_0x26bcd0(++_0x2a7330);}(_0x67a2,0xd3));var _0x267a=function(_0xdcec58,_0x3e2028){_0xdcec58=_0xdcec58-0x0;var _0x23931c=_0x67a2[_0xdcec58];return _0x23931c;};'use strict';var _=require(_0x267a('0x0'));var util=require(_0x267a('0x1'));var logger=require('../../config/logger')(_0x267a('0x2'));var moment=require(_0x267a('0x3'));var BPromise=require(_0x267a('0x4'));var rp=require(_0x267a('0x5'));var fs=require('fs');var path=require(_0x267a('0x6'));var rimraf=require(_0x267a('0x7'));var config=require(_0x267a('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x17090d,_0x3539d5){return _0x17090d[_0x267a('0x9')]('JscriptyProject',attributes,{'tableName':_0x267a('0xa'),'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 5247ecf..13ac871 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 _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b7a1e,_0x216d92){var _0x1af4ab=function(_0x26368f){while(--_0x26368f){_0x2b7a1e['push'](_0x2b7a1e['shift']());}};_0x1af4ab(++_0x216d92);}(_0xe706,0xa3));var _0x6e70=function(_0x297dcf,_0x448cf5){_0x297dcf=_0x297dcf-0x0;var _0xe1699b=_0xe706[_0x297dcf];return _0xe1699b;};'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']('JscriptyProject,\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']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x9e575,_0x5894d4){var _0x522277=function(_0x1f5458){while(--_0x1f5458){_0x9e575['push'](_0x9e575['shift']());}};_0x522277(++_0x5894d4);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 92d70a9..ba9243a 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 _0x8696=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','exports','multer','util','path'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8696,0x1eb));var _0x6869=function(_0x54ccac,_0x5777a1){_0x54ccac=_0x54ccac-0x0;var _0x3c63f1=_0x8696[_0x54ccac];return _0x3c63f1;};'use strict';var multer=require(_0x6869('0x0'));var util=require(_0x6869('0x1'));var path=require(_0x6869('0x2'));var timeout=require(_0x6869('0x3'));var express=require('express');var router=express[_0x6869('0x4')]();var fs_extra=require(_0x6869('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6869('0x6'));var config=require(_0x6869('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x6869('0x8')]('/',auth[_0x6869('0x9')](),controller[_0x6869('0xa')]);router[_0x6869('0x8')](_0x6869('0xb'),auth[_0x6869('0x9')](),controller[_0x6869('0xc')]);router[_0x6869('0x8')](_0x6869('0xd'),auth[_0x6869('0x9')](),controller['show']);router[_0x6869('0xe')]('/',auth[_0x6869('0x9')](),controller[_0x6869('0xf')]);router[_0x6869('0x10')](_0x6869('0xd'),auth[_0x6869('0x9')](),controller['update']);router[_0x6869('0x11')](_0x6869('0xd'),auth[_0x6869('0x9')](),controller['destroy']);module[_0x6869('0x12')]=router; \ No newline at end of file +var _0x14bf=['isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get'];(function(_0x56683a,_0x335f95){var _0x13c620=function(_0x31027b){while(--_0x31027b){_0x56683a['push'](_0x56683a['shift']());}};_0x13c620(++_0x335f95);}(_0x14bf,0x89));var _0xf14b=function(_0x1227d9,_0x396428){_0x1227d9=_0x1227d9-0x0;var _0x2e329e=_0x14bf[_0x1227d9];return _0x2e329e;};'use strict';var multer=require(_0xf14b('0x0'));var util=require(_0xf14b('0x1'));var path=require('path');var timeout=require(_0xf14b('0x2'));var express=require(_0xf14b('0x3'));var router=express[_0xf14b('0x4')]();var fs_extra=require(_0xf14b('0x5'));var auth=require(_0xf14b('0x6'));var interaction=require(_0xf14b('0x7'));var config=require('../../config/environment');var controller=require(_0xf14b('0x8'));router[_0xf14b('0x9')]('/',auth[_0xf14b('0xa')](),controller[_0xf14b('0xb')]);router[_0xf14b('0x9')](_0xf14b('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xf14b('0x9')](_0xf14b('0xd'),auth[_0xf14b('0xa')](),controller[_0xf14b('0xe')]);router[_0xf14b('0xf')]('/',auth['isAuthenticated'](),controller[_0xf14b('0x10')]);router[_0xf14b('0x11')](_0xf14b('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf14b('0x12')](_0xf14b('0xd'),auth['isAuthenticated'](),controller[_0xf14b('0x13')]);module[_0xf14b('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 8f09bbf..8060f21 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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x4ad22c,_0x57dc67){_0x4ad22c=_0x4ad22c-0x0;var _0x121dd1=_0x7a54[_0x4ad22c];return _0x121dd1;};'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x107d8f,_0x47d401){_0x107d8f=_0x107d8f-0x0;var _0x3cf3b8=_0x7a54[_0x107d8f];return _0x3cf3b8;};'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 4adb60a..f1852bd 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 _0x52d1=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes'];(function(_0x1b510d,_0x2fce0d){var _0x4aec7a=function(_0x13fbdb){while(--_0x13fbdb){_0x1b510d['push'](_0x1b510d['shift']());}};_0x4aec7a(++_0x2fce0d);}(_0x52d1,0x66));var _0x152d=function(_0x2e472b,_0x363a0f){_0x2e472b=_0x2e472b-0x0;var _0xbb844a=_0x52d1[_0x2e472b];return _0xbb844a;};'use strict';var emlformat=require(_0x152d('0x0'));var rimraf=require(_0x152d('0x1'));var zipdir=require(_0x152d('0x2'));var jsonpatch=require(_0x152d('0x3'));var rp=require(_0x152d('0x4'));var moment=require(_0x152d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x152d('0x6'));var sox=require(_0x152d('0x7'));var csv=require(_0x152d('0x8'));var ejs=require(_0x152d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x152d('0xa'));var crypto=require(_0x152d('0xb'));var jsforce=require(_0x152d('0xc'));var deskjs=require(_0x152d('0xd'));var toCsv=require(_0x152d('0x8'));var querystring=require('querystring');var Papa=require(_0x152d('0xe'));var Redis=require(_0x152d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x152d('0x10'));var as=require(_0x152d('0x11'));var hardwareService=require(_0x152d('0x12'));var logger=require(_0x152d('0x13'))(_0x152d('0x14'));var utils=require(_0x152d('0x15'));var config=require(_0x152d('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a3596,_0xb353b){_0xb353b=_0xb353b||0xcc;return function(_0x4c6d75){if(_0x4c6d75){return _0x1a3596['sendStatus'](_0xb353b);}return _0x1a3596[_0x152d('0x17')](_0xb353b)[_0x152d('0x18')]();};}function respondWithResult(_0x59e5f6,_0x5a866e){_0x5a866e=_0x5a866e||0xc8;return function(_0x3e3518){if(_0x3e3518){return _0x59e5f6[_0x152d('0x17')](_0x5a866e)[_0x152d('0x19')](_0x3e3518);}};}function respondWithFilteredResult(_0x14a10a,_0x1ac87e){return function(_0x346613){if(_0x346613){var _0x2de9e8=typeof _0x1ac87e[_0x152d('0x1a')]===_0x152d('0x1b')&&typeof _0x1ac87e[_0x152d('0x1c')]===_0x152d('0x1b');var _0x50582d=_0x346613['count'];var _0x544074=_0x2de9e8?0x0:_0x1ac87e[_0x152d('0x1a')];var _0x4f8105=_0x2de9e8?_0x346613[_0x152d('0x1d')]:_0x1ac87e['offset']+_0x1ac87e[_0x152d('0x1c')];var _0x898e01;if(_0x4f8105>=_0x50582d){_0x4f8105=_0x50582d;_0x898e01=0xc8;}else{_0x898e01=0xce;}_0x14a10a[_0x152d('0x17')](_0x898e01);return _0x14a10a['set'](_0x152d('0x1e'),_0x544074+'-'+_0x4f8105+'/'+_0x50582d)['json'](_0x346613);}return null;};}function patchUpdates(_0x418d1a){return function(_0x194d25){try{jsonpatch[_0x152d('0x1f')](_0x194d25,_0x418d1a,!![]);}catch(_0x3a05bb){return BPromise[_0x152d('0x20')](_0x3a05bb);}return _0x194d25[_0x152d('0x21')]();};}function saveUpdates(_0x5189d4,_0x190488){return function(_0x2b9e15){if(_0x2b9e15){return _0x2b9e15['update'](_0x5189d4)['then'](function(_0x560e41){return _0x560e41;});}return null;};}function removeEntity(_0x53b802,_0x242d94){return function(_0xb50079){if(_0xb50079){return _0xb50079['destroy']()[_0x152d('0x22')](function(){_0x53b802[_0x152d('0x17')](0xcc)[_0x152d('0x18')]();});}};}function handleEntityNotFound(_0x5808f0,_0x48deb4){return function(_0x3fc9ef){if(!_0x3fc9ef){_0x5808f0['sendStatus'](0x194);}return _0x3fc9ef;};}function handleError(_0x17a852,_0x76d992){_0x76d992=_0x76d992||0x1f4;return function(_0x430f46){logger[_0x152d('0x23')](_0x430f46[_0x152d('0x24')]);if(_0x430f46[_0x152d('0x25')]){delete _0x430f46[_0x152d('0x25')];}_0x17a852[_0x152d('0x17')](_0x76d992)[_0x152d('0x26')](_0x430f46);};}exports[_0x152d('0x27')]=function(_0x19830d,_0x4e2102){var _0xc9f5b4={},_0x2dd536={},_0x19c4f7={'count':0x0,'rows':[]};var _0x390da7=_[_0x152d('0x28')](db[_0x152d('0x29')][_0x152d('0x2a')],function(_0x5354c5){return{'name':_0x5354c5[_0x152d('0x2b')],'type':_0x5354c5[_0x152d('0x2c')][_0x152d('0x2d')]};});_0x2dd536['model']=_[_0x152d('0x28')](_0x390da7,_0x152d('0x25'));_0x2dd536[_0x152d('0x2e')]=_[_0x152d('0x2f')](_0x19830d[_0x152d('0x2e')]);_0x2dd536[_0x152d('0x30')]=_[_0x152d('0x31')](_0x2dd536[_0x152d('0x32')],_0x2dd536['query']);_0xc9f5b4[_0x152d('0x33')]=_['intersection'](_0x2dd536[_0x152d('0x32')],qs[_0x152d('0x34')](_0x19830d['query'][_0x152d('0x34')]));_0xc9f5b4[_0x152d('0x33')]=_0xc9f5b4[_0x152d('0x33')][_0x152d('0x35')]?_0xc9f5b4[_0x152d('0x33')]:_0x2dd536[_0x152d('0x32')];if(!_0x19830d[_0x152d('0x2e')][_0x152d('0x36')](_0x152d('0x37'))){_0xc9f5b4[_0x152d('0x1c')]=qs[_0x152d('0x1c')](_0x19830d[_0x152d('0x2e')][_0x152d('0x1c')]);_0xc9f5b4[_0x152d('0x1a')]=qs['offset'](_0x19830d['query'][_0x152d('0x1a')]);}_0xc9f5b4[_0x152d('0x38')]=qs[_0x152d('0x39')](_0x19830d[_0x152d('0x2e')][_0x152d('0x39')]);_0xc9f5b4[_0x152d('0x3a')]=qs['filters'](_[_0x152d('0x3b')](_0x19830d[_0x152d('0x2e')],_0x2dd536[_0x152d('0x30')]),_0x390da7);if(_0x19830d['query'][_0x152d('0x3c')]){_0xc9f5b4[_0x152d('0x3a')]=_['merge'](_0xc9f5b4['where'],{'$or':_[_0x152d('0x28')](_0x390da7,function(_0xe08c94){if(_0xe08c94['type']!==_0x152d('0x3d')){var _0x4a9a99={};_0x4a9a99[_0xe08c94[_0x152d('0x25')]]={'$like':'%'+_0x19830d[_0x152d('0x2e')]['filter']+'%'};return _0x4a9a99;}})});}_0xc9f5b4=_[_0x152d('0x3e')]({},_0xc9f5b4,_0x19830d['options']);var _0x32c9d7={'where':_0xc9f5b4[_0x152d('0x3a')]};return db[_0x152d('0x29')][_0x152d('0x1d')](_0x32c9d7)['then'](function(_0x16b30e){_0x19c4f7[_0x152d('0x1d')]=_0x16b30e;if(_0x19830d['query'][_0x152d('0x3f')]){_0xc9f5b4['include']=[{'all':!![]}];}return db[_0x152d('0x29')][_0x152d('0x40')](_0xc9f5b4);})[_0x152d('0x22')](function(_0x32e8da){_0x19c4f7[_0x152d('0x41')]=_0x32e8da;return _0x19c4f7;})[_0x152d('0x22')](respondWithFilteredResult(_0x4e2102,_0xc9f5b4))['catch'](handleError(_0x4e2102,null));};exports[_0x152d('0x42')]=function(_0x44595e,_0x35053b){var _0x3954b4={'raw':!![],'where':{'id':_0x44595e[_0x152d('0x43')]['id']}},_0x362841={};_0x362841[_0x152d('0x32')]=_['keys'](db[_0x152d('0x29')][_0x152d('0x2a')]);_0x362841['query']=_['keys'](_0x44595e['query']);_0x362841[_0x152d('0x30')]=_[_0x152d('0x31')](_0x362841[_0x152d('0x32')],_0x362841[_0x152d('0x2e')]);_0x3954b4[_0x152d('0x33')]=_[_0x152d('0x31')](_0x362841[_0x152d('0x32')],qs[_0x152d('0x34')](_0x44595e[_0x152d('0x2e')]['fields']));_0x3954b4['attributes']=_0x3954b4['attributes']['length']?_0x3954b4[_0x152d('0x33')]:_0x362841[_0x152d('0x32')];if(_0x44595e[_0x152d('0x2e')][_0x152d('0x3f')]){_0x3954b4[_0x152d('0x44')]=[{'all':!![]}];}_0x3954b4=_[_0x152d('0x3e')]({},_0x3954b4,_0x44595e[_0x152d('0x45')]);return db[_0x152d('0x29')][_0x152d('0x46')](_0x3954b4)[_0x152d('0x22')](handleEntityNotFound(_0x35053b,null))[_0x152d('0x22')](respondWithResult(_0x35053b,null))[_0x152d('0x47')](handleError(_0x35053b,null));};exports[_0x152d('0x48')]=function(_0x48c360,_0x3f99f3){return db[_0x152d('0x29')][_0x152d('0x48')](_0x48c360[_0x152d('0x49')],{})['then'](respondWithResult(_0x3f99f3,0xc9))[_0x152d('0x47')](handleError(_0x3f99f3,null));};exports[_0x152d('0x4a')]=function(_0x44ff66,_0x260dbd){if(_0x44ff66[_0x152d('0x49')]['id']){delete _0x44ff66[_0x152d('0x49')]['id'];}return db[_0x152d('0x29')][_0x152d('0x46')]({'where':{'id':_0x44ff66[_0x152d('0x43')]['id']}})[_0x152d('0x22')](handleEntityNotFound(_0x260dbd,null))[_0x152d('0x22')](saveUpdates(_0x44ff66['body'],null))[_0x152d('0x22')](respondWithResult(_0x260dbd,null))[_0x152d('0x47')](handleError(_0x260dbd,null));};exports[_0x152d('0x4b')]=function(_0x2f506c,_0x57a1fb){return db[_0x152d('0x29')][_0x152d('0x46')]({'where':{'id':_0x2f506c[_0x152d('0x43')]['id']}})[_0x152d('0x22')](handleEntityNotFound(_0x57a1fb,null))[_0x152d('0x22')](removeEntity(_0x57a1fb,null))['catch'](handleError(_0x57a1fb,null));};exports[_0x152d('0x4c')]=function(_0x14fc68,_0x4e5d7e){return db[_0x152d('0x29')]['describe']()['then'](respondWithResult(_0x4e5d7e,null))['catch'](handleError(_0x4e5d7e,null));}; \ No newline at end of file +var _0xaef2=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','stack','name','map','JscriptyQuestionReport','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs'];(function(_0x235326,_0x251051){var _0x43a1d7=function(_0x1e79d9){while(--_0x1e79d9){_0x235326['push'](_0x235326['shift']());}};_0x43a1d7(++_0x251051);}(_0xaef2,0x169));var _0x2aef=function(_0x45d8b0,_0x42b4ea){_0x45d8b0=_0x45d8b0-0x0;var _0x4b04c8=_0xaef2[_0x45d8b0];return _0x4b04c8;};'use strict';var emlformat=require(_0x2aef('0x0'));var rimraf=require(_0x2aef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2aef('0x2'));var moment=require(_0x2aef('0x3'));var BPromise=require(_0x2aef('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2aef('0x5'));var sox=require(_0x2aef('0x6'));var csv=require(_0x2aef('0x7'));var ejs=require(_0x2aef('0x8'));var fs=require('fs');var fs_extra=require(_0x2aef('0x9'));var _=require('lodash');var squel=require(_0x2aef('0xa'));var crypto=require(_0x2aef('0xb'));var jsforce=require(_0x2aef('0xc'));var deskjs=require(_0x2aef('0xd'));var toCsv=require(_0x2aef('0x7'));var querystring=require(_0x2aef('0xe'));var Papa=require(_0x2aef('0xf'));var Redis=require('ioredis');var authService=require(_0x2aef('0x10'));var qs=require(_0x2aef('0x11'));var as=require(_0x2aef('0x12'));var hardwareService=require(_0x2aef('0x13'));var logger=require(_0x2aef('0x14'))('api');var utils=require(_0x2aef('0x15'));var config=require(_0x2aef('0x16'));var licenseUtil=require(_0x2aef('0x17'));var db=require(_0x2aef('0x18'))['db'];function respondWithStatusCode(_0x38e36b,_0x4cc0c6){_0x4cc0c6=_0x4cc0c6||0xcc;return function(_0x5311fa){if(_0x5311fa){return _0x38e36b[_0x2aef('0x19')](_0x4cc0c6);}return _0x38e36b[_0x2aef('0x1a')](_0x4cc0c6)[_0x2aef('0x1b')]();};}function respondWithResult(_0x35749b,_0x316f9b){_0x316f9b=_0x316f9b||0xc8;return function(_0x253cc0){if(_0x253cc0){return _0x35749b['status'](_0x316f9b)[_0x2aef('0x1c')](_0x253cc0);}};}function respondWithFilteredResult(_0x122972,_0x1162ee){return function(_0x525141){if(_0x525141){var _0x15409b=typeof _0x1162ee['offset']===_0x2aef('0x1d')&&typeof _0x1162ee[_0x2aef('0x1e')]===_0x2aef('0x1d');var _0x3469c7=_0x525141['count'];var _0x3bd59a=_0x15409b?0x0:_0x1162ee[_0x2aef('0x1f')];var _0x21706e=_0x15409b?_0x525141[_0x2aef('0x20')]:_0x1162ee[_0x2aef('0x1f')]+_0x1162ee[_0x2aef('0x1e')];var _0x805394;if(_0x21706e>=_0x3469c7){_0x21706e=_0x3469c7;_0x805394=0xc8;}else{_0x805394=0xce;}_0x122972[_0x2aef('0x1a')](_0x805394);return _0x122972['set'](_0x2aef('0x21'),_0x3bd59a+'-'+_0x21706e+'/'+_0x3469c7)[_0x2aef('0x1c')](_0x525141);}return null;};}function patchUpdates(_0x16a967){return function(_0x4044e9){try{jsonpatch[_0x2aef('0x22')](_0x4044e9,_0x16a967,!![]);}catch(_0x4af020){return BPromise[_0x2aef('0x23')](_0x4af020);}return _0x4044e9[_0x2aef('0x24')]();};}function saveUpdates(_0x2d25c2,_0x1b9900){return function(_0x5df463){if(_0x5df463){return _0x5df463[_0x2aef('0x25')](_0x2d25c2)['then'](function(_0x2ad495){return _0x2ad495;});}return null;};}function removeEntity(_0x226314,_0x26c2ac){return function(_0x675f3){if(_0x675f3){return _0x675f3[_0x2aef('0x26')]()['then'](function(){_0x226314[_0x2aef('0x1a')](0xcc)[_0x2aef('0x1b')]();});}};}function handleEntityNotFound(_0x2eb081,_0x475752){return function(_0x130ad7){if(!_0x130ad7){_0x2eb081[_0x2aef('0x19')](0x194);}return _0x130ad7;};}function handleError(_0x52423c,_0x95aabf){_0x95aabf=_0x95aabf||0x1f4;return function(_0x2e1b34){logger['error'](_0x2e1b34[_0x2aef('0x27')]);if(_0x2e1b34[_0x2aef('0x28')]){delete _0x2e1b34[_0x2aef('0x28')];}_0x52423c[_0x2aef('0x1a')](_0x95aabf)['send'](_0x2e1b34);};}exports['index']=function(_0x8b7c44,_0x2b8deb){var _0x6e8150={},_0x1ce6ab={},_0x5215a1={'count':0x0,'rows':[]};var _0x3bc273=_[_0x2aef('0x29')](db[_0x2aef('0x2a')]['rawAttributes'],function(_0x1c1805){return{'name':_0x1c1805[_0x2aef('0x2b')],'type':_0x1c1805['type'][_0x2aef('0x2c')]};});_0x1ce6ab[_0x2aef('0x2d')]=_[_0x2aef('0x29')](_0x3bc273,_0x2aef('0x28'));_0x1ce6ab['query']=_[_0x2aef('0x2e')](_0x8b7c44[_0x2aef('0x2f')]);_0x1ce6ab[_0x2aef('0x30')]=_[_0x2aef('0x31')](_0x1ce6ab[_0x2aef('0x2d')],_0x1ce6ab['query']);_0x6e8150[_0x2aef('0x32')]=_[_0x2aef('0x31')](_0x1ce6ab['model'],qs['fields'](_0x8b7c44[_0x2aef('0x2f')][_0x2aef('0x33')]));_0x6e8150[_0x2aef('0x32')]=_0x6e8150['attributes'][_0x2aef('0x34')]?_0x6e8150[_0x2aef('0x32')]:_0x1ce6ab['model'];if(!_0x8b7c44['query'][_0x2aef('0x35')](_0x2aef('0x36'))){_0x6e8150['limit']=qs['limit'](_0x8b7c44[_0x2aef('0x2f')][_0x2aef('0x1e')]);_0x6e8150['offset']=qs[_0x2aef('0x1f')](_0x8b7c44[_0x2aef('0x2f')][_0x2aef('0x1f')]);}_0x6e8150[_0x2aef('0x37')]=qs[_0x2aef('0x38')](_0x8b7c44[_0x2aef('0x2f')][_0x2aef('0x38')]);_0x6e8150[_0x2aef('0x39')]=qs[_0x2aef('0x30')](_[_0x2aef('0x3a')](_0x8b7c44[_0x2aef('0x2f')],_0x1ce6ab[_0x2aef('0x30')]),_0x3bc273);if(_0x8b7c44[_0x2aef('0x2f')][_0x2aef('0x3b')]){_0x6e8150[_0x2aef('0x39')]=_[_0x2aef('0x3c')](_0x6e8150[_0x2aef('0x39')],{'$or':_[_0x2aef('0x29')](_0x3bc273,function(_0x280613){if(_0x280613['type']!==_0x2aef('0x3d')){var _0x44266f={};_0x44266f[_0x280613[_0x2aef('0x28')]]={'$like':'%'+_0x8b7c44['query'][_0x2aef('0x3b')]+'%'};return _0x44266f;}})});}_0x6e8150=_[_0x2aef('0x3c')]({},_0x6e8150,_0x8b7c44[_0x2aef('0x3e')]);var _0x7904eb={'where':_0x6e8150[_0x2aef('0x39')]};return db[_0x2aef('0x2a')][_0x2aef('0x20')](_0x7904eb)[_0x2aef('0x3f')](function(_0x5b491d){_0x5215a1[_0x2aef('0x20')]=_0x5b491d;if(_0x8b7c44[_0x2aef('0x2f')]['includeAll']){_0x6e8150[_0x2aef('0x40')]=[{'all':!![]}];}return db[_0x2aef('0x2a')]['findAll'](_0x6e8150);})['then'](function(_0x386e70){_0x5215a1['rows']=_0x386e70;return _0x5215a1;})[_0x2aef('0x3f')](respondWithFilteredResult(_0x2b8deb,_0x6e8150))[_0x2aef('0x41')](handleError(_0x2b8deb,null));};exports[_0x2aef('0x42')]=function(_0x8f616f,_0xc07c21){var _0x2e39b9={'raw':!![],'where':{'id':_0x8f616f[_0x2aef('0x43')]['id']}},_0x20f91a={};_0x20f91a[_0x2aef('0x2d')]=_[_0x2aef('0x2e')](db['JscriptyQuestionReport'][_0x2aef('0x44')]);_0x20f91a['query']=_[_0x2aef('0x2e')](_0x8f616f[_0x2aef('0x2f')]);_0x20f91a[_0x2aef('0x30')]=_[_0x2aef('0x31')](_0x20f91a['model'],_0x20f91a[_0x2aef('0x2f')]);_0x2e39b9[_0x2aef('0x32')]=_[_0x2aef('0x31')](_0x20f91a[_0x2aef('0x2d')],qs[_0x2aef('0x33')](_0x8f616f['query'][_0x2aef('0x33')]));_0x2e39b9['attributes']=_0x2e39b9[_0x2aef('0x32')][_0x2aef('0x34')]?_0x2e39b9[_0x2aef('0x32')]:_0x20f91a['model'];if(_0x8f616f[_0x2aef('0x2f')][_0x2aef('0x45')]){_0x2e39b9['include']=[{'all':!![]}];}_0x2e39b9=_['merge']({},_0x2e39b9,_0x8f616f[_0x2aef('0x3e')]);return db[_0x2aef('0x2a')][_0x2aef('0x46')](_0x2e39b9)[_0x2aef('0x3f')](handleEntityNotFound(_0xc07c21,null))[_0x2aef('0x3f')](respondWithResult(_0xc07c21,null))[_0x2aef('0x41')](handleError(_0xc07c21,null));};exports['create']=function(_0x20a7d2,_0x34a82d){return db[_0x2aef('0x2a')][_0x2aef('0x47')](_0x20a7d2[_0x2aef('0x48')],{})[_0x2aef('0x3f')](respondWithResult(_0x34a82d,0xc9))[_0x2aef('0x41')](handleError(_0x34a82d,null));};exports['update']=function(_0x1a5966,_0x572638){if(_0x1a5966[_0x2aef('0x48')]['id']){delete _0x1a5966[_0x2aef('0x48')]['id'];}return db[_0x2aef('0x2a')]['find']({'where':{'id':_0x1a5966['params']['id']}})[_0x2aef('0x3f')](handleEntityNotFound(_0x572638,null))[_0x2aef('0x3f')](saveUpdates(_0x1a5966['body'],null))[_0x2aef('0x3f')](respondWithResult(_0x572638,null))[_0x2aef('0x41')](handleError(_0x572638,null));};exports[_0x2aef('0x26')]=function(_0x5c849c,_0x9c994f){return db['JscriptyQuestionReport'][_0x2aef('0x46')]({'where':{'id':_0x5c849c[_0x2aef('0x43')]['id']}})['then'](handleEntityNotFound(_0x9c994f,null))[_0x2aef('0x3f')](removeEntity(_0x9c994f,null))[_0x2aef('0x41')](handleError(_0x9c994f,null));};exports[_0x2aef('0x49')]=function(_0xc6aba3,_0x2878e2){return db[_0x2aef('0x2a')]['describe']()['then'](respondWithResult(_0x2878e2,null))[_0x2aef('0x41')](handleError(_0x2878e2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 7a6939a..2847b6b 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 _0xfaca=['define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyQuestionReport.attributes'];(function(_0x3efdca,_0xa17654){var _0x2d9479=function(_0xe3cf18){while(--_0xe3cf18){_0x3efdca['push'](_0x3efdca['shift']());}};_0x2d9479(++_0xa17654);}(_0xfaca,0x1dc));var _0xafac=function(_0xff410d,_0x4cdc44){_0xff410d=_0xff410d-0x0;var _0x2c9bb1=_0xfaca[_0xff410d];return _0x2c9bb1;};'use strict';var _=require('lodash');var util=require(_0xafac('0x0'));var logger=require(_0xafac('0x1'))(_0xafac('0x2'));var moment=require(_0xafac('0x3'));var BPromise=require(_0xafac('0x4'));var rp=require(_0xafac('0x5'));var fs=require('fs');var path=require(_0xafac('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xafac('0x7'));module['exports']=function(_0x58755c,_0x2f09fe){return _0x58755c[_0xafac('0x8')](_0xafac('0x9'),attributes,{'tableName':_0xafac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafb3=['exports','JscriptyQuestionReport','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xafb3,0xb6));var _0x3afb=function(_0x37f740,_0x30f03c){_0x37f740=_0x37f740-0x0;var _0x2e4df7=_0xafb3[_0x37f740];return _0x2e4df7;};'use strict';var _=require(_0x3afb('0x0'));var util=require(_0x3afb('0x1'));var logger=require(_0x3afb('0x2'))(_0x3afb('0x3'));var moment=require('moment');var BPromise=require(_0x3afb('0x4'));var rp=require(_0x3afb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3afb('0x6'));var attributes=require(_0x3afb('0x7'));module[_0x3afb('0x8')]=function(_0x136444,_0x1c939f){return _0x136444['define'](_0x3afb('0x9'),attributes,{'tableName':'report_jscripty_questions','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 7ebc307..101850c 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 _0xae4c=['request','then','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3966c0,_0x50c500){var _0x24ebbf=function(_0x40086d){while(--_0x40086d){_0x3966c0['push'](_0x3966c0['shift']());}};_0x24ebbf(++_0x50c500);}(_0xae4c,0x6b));var _0xcae4=function(_0x4f768a,_0x413685){_0x4f768a=_0x4f768a-0x0;var _0x4ab541=_0xae4c[_0x4f768a];return _0x4ab541;};'use strict';var _=require(_0xcae4('0x0'));var util=require(_0xcae4('0x1'));var moment=require(_0xcae4('0x2'));var BPromise=require(_0xcae4('0x3'));var rs=require(_0xcae4('0x4'));var fs=require('fs');var Redis=require(_0xcae4('0x5'));var db=require(_0xcae4('0x6'))['db'];var utils=require(_0xcae4('0x7'));var logger=require(_0xcae4('0x8'))(_0xcae4('0x9'));var config=require(_0xcae4('0xa'));var jayson=require(_0xcae4('0xb'));var client=jayson['client'][_0xcae4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f5b7e,_0x1cd165,_0x5087e1){return new BPromise(function(_0x3990c1,_0x3bd145){return client[_0xcae4('0xd')](_0x3f5b7e,_0x5087e1)[_0xcae4('0xe')](function(_0x49de2c){logger[_0xcae4('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1cd165,_0xcae4('0x10'));logger['debug'](_0xcae4('0x11'),_0x1cd165,'request\x20sent',JSON[_0xcae4('0x12')](_0x49de2c));if(_0x49de2c['error']){if(_0x49de2c[_0xcae4('0x13')][_0xcae4('0x14')]===0x1f4){logger[_0xcae4('0x13')](_0xcae4('0x15'),_0x1cd165,_0x49de2c[_0xcae4('0x13')][_0xcae4('0x16')]);return _0x3bd145(_0x49de2c[_0xcae4('0x13')][_0xcae4('0x16')]);}logger[_0xcae4('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1cd165,_0x49de2c[_0xcae4('0x13')][_0xcae4('0x16')]);return _0x3990c1(_0x49de2c[_0xcae4('0x13')]['message']);}else{logger[_0xcae4('0xf')](_0xcae4('0x15'),_0x1cd165,'request\x20sent');_0x3990c1(_0x49de2c[_0xcae4('0x17')][_0xcae4('0x16')]);}})['catch'](function(_0x2b578c){logger[_0xcae4('0x13')](_0xcae4('0x15'),_0x1cd165,_0x2b578c);_0x3bd145(_0x2b578c);});});} \ No newline at end of file +var _0x974f=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x974f,0xc2));var _0xf974=function(_0x5238f3,_0x3e3669){_0x5238f3=_0x5238f3-0x0;var _0x52dd5f=_0x974f[_0x5238f3];return _0x52dd5f;};'use strict';var _=require(_0xf974('0x0'));var util=require(_0xf974('0x1'));var moment=require(_0xf974('0x2'));var BPromise=require('bluebird');var rs=require(_0xf974('0x3'));var fs=require('fs');var Redis=require(_0xf974('0x4'));var db=require(_0xf974('0x5'))['db'];var utils=require(_0xf974('0x6'));var logger=require(_0xf974('0x7'))(_0xf974('0x8'));var config=require(_0xf974('0x9'));var jayson=require(_0xf974('0xa'));var client=jayson[_0xf974('0xb')][_0xf974('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57302e,_0x2dd491,_0x3d0147){return new BPromise(function(_0x1355cb,_0x2eec58){return client[_0xf974('0xd')](_0x57302e,_0x3d0147)['then'](function(_0x2ea9f1){logger[_0xf974('0xe')](_0xf974('0xf'),_0x2dd491,_0xf974('0x10'));logger[_0xf974('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2dd491,_0xf974('0x10'),JSON[_0xf974('0x12')](_0x2ea9f1));if(_0x2ea9f1['error']){if(_0x2ea9f1['error'][_0xf974('0x13')]===0x1f4){logger[_0xf974('0x14')](_0xf974('0xf'),_0x2dd491,_0x2ea9f1[_0xf974('0x14')]['message']);return _0x2eec58(_0x2ea9f1[_0xf974('0x14')][_0xf974('0x15')]);}logger[_0xf974('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2dd491,_0x2ea9f1['error'][_0xf974('0x15')]);return _0x1355cb(_0x2ea9f1['error'][_0xf974('0x15')]);}else{logger[_0xf974('0xe')](_0xf974('0xf'),_0x2dd491,'request\x20sent');_0x1355cb(_0x2ea9f1[_0xf974('0x16')]['message']);}})[_0xf974('0x17')](function(_0x45c741){logger[_0xf974('0x14')](_0xf974('0xf'),_0x2dd491,_0x45c741);_0x2eec58(_0x45c741);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index bd8a8d1..0f96dea 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 _0xa21d=['show','/:id/questions','getQuestions','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x15e717,_0x3251ce){var _0x4bb9ad=function(_0x1db82a){while(--_0x1db82a){_0x15e717['push'](_0x15e717['shift']());}};_0x4bb9ad(++_0x3251ce);}(_0xa21d,0x7a));var _0xda21=function(_0x15c39e,_0x2b52f9){_0x15c39e=_0x15c39e-0x0;var _0xf1c6d9=_0xa21d[_0x15c39e];return _0xf1c6d9;};'use strict';var multer=require(_0xda21('0x0'));var util=require(_0xda21('0x1'));var path=require(_0xda21('0x2'));var timeout=require(_0xda21('0x3'));var express=require(_0xda21('0x4'));var router=express[_0xda21('0x5')]();var fs_extra=require(_0xda21('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xda21('0x7'));var config=require(_0xda21('0x8'));var controller=require(_0xda21('0x9'));router[_0xda21('0xa')]('/',auth['isAuthenticated'](),controller[_0xda21('0xb')]);router[_0xda21('0xa')](_0xda21('0xc'),auth[_0xda21('0xd')](),controller[_0xda21('0xe')]);router[_0xda21('0xa')](_0xda21('0xf'),auth[_0xda21('0xd')](),controller[_0xda21('0x10')]);router[_0xda21('0xa')](_0xda21('0x11'),auth['isAuthenticated'](),controller[_0xda21('0x12')]);router['post']('/',auth[_0xda21('0xd')](),controller[_0xda21('0x13')]);router[_0xda21('0x14')]('/:id',auth[_0xda21('0xd')](),controller['update']);router[_0xda21('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xda21('0x16')]=router; \ No newline at end of file +var _0x2845=['/:id/questions','getQuestions','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x1bda5d,_0x473011){var _0x2f045c=function(_0x36d67c){while(--_0x36d67c){_0x1bda5d['push'](_0x1bda5d['shift']());}};_0x2f045c(++_0x473011);}(_0x2845,0xd8));var _0x5284=function(_0x22ee96,_0x348cb5){_0x22ee96=_0x22ee96-0x0;var _0xf0c37b=_0x2845[_0x22ee96];return _0xf0c37b;};'use strict';var multer=require(_0x5284('0x0'));var util=require('util');var path=require(_0x5284('0x1'));var timeout=require(_0x5284('0x2'));var express=require(_0x5284('0x3'));var router=express['Router']();var fs_extra=require(_0x5284('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5284('0x5'));var config=require(_0x5284('0x6'));var controller=require(_0x5284('0x7'));router[_0x5284('0x8')]('/',auth[_0x5284('0x9')](),controller[_0x5284('0xa')]);router['get'](_0x5284('0xb'),auth['isAuthenticated'](),controller[_0x5284('0xc')]);router[_0x5284('0x8')]('/:id',auth[_0x5284('0x9')](),controller[_0x5284('0xd')]);router['get'](_0x5284('0xe'),auth[_0x5284('0x9')](),controller[_0x5284('0xf')]);router['post']('/',auth[_0x5284('0x9')](),controller[_0x5284('0x10')]);router[_0x5284('0x11')]('/:id',auth[_0x5284('0x9')](),controller[_0x5284('0x12')]);router[_0x5284('0x13')](_0x5284('0x14'),auth['isAuthenticated'](),controller[_0x5284('0x15')]);module[_0x5284('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 a5c04a1..ffe3d03 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 _0xd497=['exports','DATE','starttime','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x4a4d88,_0x2be95a){var _0x479329=function(_0x37bb8e){while(--_0x37bb8e){_0x4a4d88['push'](_0x4a4d88['shift']());}};_0x479329(++_0x2be95a);}(_0xd497,0x170));var _0x7d49=function(_0x48daf0,_0x5af26b){_0x48daf0=_0x48daf0-0x0;var _0x40028e=_0xd497[_0x48daf0];return _0x40028e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x7d49('0x0')]={'starttime':{'type':Sequelize[_0x7d49('0x1')],'set':function(_0x43f1d8){this['setDataValue'](_0x7d49('0x2'),_0x43f1d8);this[_0x7d49('0x3')](_0x7d49('0x4'),moment()['format'](_0x7d49('0x5')));}},'endtime':{'type':Sequelize[_0x7d49('0x1')]},'membername':{'type':Sequelize[_0x7d49('0x6')]},'projectname':{'type':Sequelize[_0x7d49('0x6')]},'queue':{'type':Sequelize[_0x7d49('0x6')]},'uniqueid':{'type':Sequelize[_0x7d49('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7d49('0x6')]},'completed':{'type':Sequelize[_0x7d49('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x6c4b=['starttime','format','STRING','BOOLEAN','moment','DATE','setDataValue'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6c4b,0x9e));var _0xb6c4=function(_0x5ae09f,_0x33a81b){_0x5ae09f=_0x5ae09f-0x0;var _0x5cdc22=_0x6c4b[_0x5ae09f];return _0x5cdc22;};'use strict';var moment=require(_0xb6c4('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xb6c4('0x1')],'set':function(_0x2e7b19){this[_0xb6c4('0x2')](_0xb6c4('0x3'),_0x2e7b19);this[_0xb6c4('0x2')]('endtime',moment()[_0xb6c4('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xb6c4('0x5')]},'projectname':{'type':Sequelize[_0xb6c4('0x5')]},'queue':{'type':Sequelize[_0xb6c4('0x5')]},'uniqueid':{'type':Sequelize[_0xb6c4('0x5')]},'calleridname':{'type':Sequelize[_0xb6c4('0x5')]},'calleridnum':{'type':Sequelize[_0xb6c4('0x5')]},'completed':{'type':Sequelize[_0xb6c4('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 334bf31..6ef1da6 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 _0x0e6e=['rows','catch','params','keys','include','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','order','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','end','error','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0e6e,0x1c9));var _0xe0e6=function(_0x3a8f81,_0x15b8b1){_0x3a8f81=_0x3a8f81-0x0;var _0x865f3e=_0x0e6e[_0x3a8f81];return _0x865f3e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0e6('0x0'));var zipdir=require(_0xe0e6('0x1'));var jsonpatch=require(_0xe0e6('0x2'));var rp=require(_0xe0e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe0e6('0x4'));var util=require(_0xe0e6('0x5'));var path=require(_0xe0e6('0x6'));var sox=require('sox');var csv=require(_0xe0e6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0e6('0x8'));var squel=require('squel');var crypto=require(_0xe0e6('0x9'));var jsforce=require(_0xe0e6('0xa'));var deskjs=require(_0xe0e6('0xb'));var toCsv=require(_0xe0e6('0x7'));var querystring=require(_0xe0e6('0xc'));var Papa=require(_0xe0e6('0xd'));var Redis=require(_0xe0e6('0xe'));var authService=require(_0xe0e6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe0e6('0x10'));var hardwareService=require(_0xe0e6('0x11'));var logger=require('../../config/logger')(_0xe0e6('0x12'));var utils=require('../../config/utils');var config=require(_0xe0e6('0x13'));var licenseUtil=require(_0xe0e6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b9bce,_0x383dfd){_0x383dfd=_0x383dfd||0xcc;return function(_0x5155a6){if(_0x5155a6){return _0x3b9bce[_0xe0e6('0x15')](_0x383dfd);}return _0x3b9bce[_0xe0e6('0x16')](_0x383dfd)['end']();};}function respondWithResult(_0x4bca1b,_0x11ef8a){_0x11ef8a=_0x11ef8a||0xc8;return function(_0x3b004e){if(_0x3b004e){return _0x4bca1b[_0xe0e6('0x16')](_0x11ef8a)[_0xe0e6('0x17')](_0x3b004e);}};}function respondWithFilteredResult(_0x3a35c7,_0x92f2ea){return function(_0xb5463d){if(_0xb5463d){var _0xda8603=typeof _0x92f2ea[_0xe0e6('0x18')]===_0xe0e6('0x19')&&typeof _0x92f2ea['limit']===_0xe0e6('0x19');var _0x9300c=_0xb5463d[_0xe0e6('0x1a')];var _0x2bab0a=_0xda8603?0x0:_0x92f2ea[_0xe0e6('0x18')];var _0x1b8a12=_0xda8603?_0xb5463d[_0xe0e6('0x1a')]:_0x92f2ea[_0xe0e6('0x18')]+_0x92f2ea[_0xe0e6('0x1b')];var _0x250341;if(_0x1b8a12>=_0x9300c){_0x1b8a12=_0x9300c;_0x250341=0xc8;}else{_0x250341=0xce;}_0x3a35c7[_0xe0e6('0x16')](_0x250341);return _0x3a35c7['set'](_0xe0e6('0x1c'),_0x2bab0a+'-'+_0x1b8a12+'/'+_0x9300c)['json'](_0xb5463d);}return null;};}function patchUpdates(_0x519077){return function(_0x1bc7e5){try{jsonpatch[_0xe0e6('0x1d')](_0x1bc7e5,_0x519077,!![]);}catch(_0x353bcb){return BPromise['reject'](_0x353bcb);}return _0x1bc7e5[_0xe0e6('0x1e')]();};}function saveUpdates(_0x59d605,_0x232b09){return function(_0x51fc82){if(_0x51fc82){return _0x51fc82[_0xe0e6('0x1f')](_0x59d605)[_0xe0e6('0x20')](function(_0x5b83a3){return _0x5b83a3;});}return null;};}function removeEntity(_0xa80e8a,_0x3a62d0){return function(_0x369d86){if(_0x369d86){return _0x369d86['destroy']()[_0xe0e6('0x20')](function(){_0xa80e8a[_0xe0e6('0x16')](0xcc)[_0xe0e6('0x21')]();});}};}function handleEntityNotFound(_0x4f8b81,_0x27a4ab){return function(_0x43fab8){if(!_0x43fab8){_0x4f8b81['sendStatus'](0x194);}return _0x43fab8;};}function handleError(_0x4e1fce,_0x268f63){_0x268f63=_0x268f63||0x1f4;return function(_0x5c7e1a){logger[_0xe0e6('0x22')](_0x5c7e1a[_0xe0e6('0x23')]);if(_0x5c7e1a['name']){delete _0x5c7e1a[_0xe0e6('0x24')];}_0x4e1fce['status'](_0x268f63)[_0xe0e6('0x25')](_0x5c7e1a);};}exports['index']=function(_0xfebba4,_0x4c9805){var _0x43693f={},_0x1f0ba9={},_0x3ccbd6={'count':0x0,'rows':[]};var _0x15cf8f=_[_0xe0e6('0x26')](db[_0xe0e6('0x27')][_0xe0e6('0x28')],function(_0x11d2f2){return{'name':_0x11d2f2[_0xe0e6('0x29')],'type':_0x11d2f2['type'][_0xe0e6('0x2a')]};});_0x1f0ba9[_0xe0e6('0x2b')]=_['map'](_0x15cf8f,'name');_0x1f0ba9[_0xe0e6('0x2c')]=_['keys'](_0xfebba4['query']);_0x1f0ba9['filters']=_[_0xe0e6('0x2d')](_0x1f0ba9['model'],_0x1f0ba9[_0xe0e6('0x2c')]);_0x43693f[_0xe0e6('0x2e')]=_[_0xe0e6('0x2d')](_0x1f0ba9[_0xe0e6('0x2b')],qs[_0xe0e6('0x2f')](_0xfebba4['query'][_0xe0e6('0x2f')]));_0x43693f['attributes']=_0x43693f[_0xe0e6('0x2e')][_0xe0e6('0x30')]?_0x43693f[_0xe0e6('0x2e')]:_0x1f0ba9['model'];if(!_0xfebba4['query'][_0xe0e6('0x31')](_0xe0e6('0x32'))){_0x43693f[_0xe0e6('0x1b')]=qs[_0xe0e6('0x1b')](_0xfebba4['query']['limit']);_0x43693f[_0xe0e6('0x18')]=qs[_0xe0e6('0x18')](_0xfebba4[_0xe0e6('0x2c')][_0xe0e6('0x18')]);}_0x43693f['order']=qs[_0xe0e6('0x33')](_0xfebba4['query']['sort']);_0x43693f[_0xe0e6('0x34')]=qs['filters'](_[_0xe0e6('0x35')](_0xfebba4[_0xe0e6('0x2c')],_0x1f0ba9[_0xe0e6('0x36')]),_0x15cf8f);if(_0xfebba4[_0xe0e6('0x2c')][_0xe0e6('0x37')]){_0x43693f[_0xe0e6('0x34')]=_[_0xe0e6('0x38')](_0x43693f[_0xe0e6('0x34')],{'$or':_[_0xe0e6('0x26')](_0x15cf8f,function(_0x251dfd){if(_0x251dfd['type']!==_0xe0e6('0x39')){var _0x39a315={};_0x39a315[_0x251dfd['name']]={'$like':'%'+_0xfebba4[_0xe0e6('0x2c')][_0xe0e6('0x37')]+'%'};return _0x39a315;}})});}_0x43693f=_[_0xe0e6('0x38')]({},_0x43693f,_0xfebba4[_0xe0e6('0x3a')]);var _0x5763db={'where':_0x43693f[_0xe0e6('0x34')]};return db[_0xe0e6('0x27')][_0xe0e6('0x1a')](_0x5763db)[_0xe0e6('0x20')](function(_0x49af78){_0x3ccbd6['count']=_0x49af78;if(_0xfebba4['query'][_0xe0e6('0x3b')]){_0x43693f['include']=[{'all':!![]}];}return db[_0xe0e6('0x27')][_0xe0e6('0x3c')](_0x43693f);})['then'](function(_0x4cd978){_0x3ccbd6[_0xe0e6('0x3d')]=_0x4cd978;return _0x3ccbd6;})[_0xe0e6('0x20')](respondWithFilteredResult(_0x4c9805,_0x43693f))[_0xe0e6('0x3e')](handleError(_0x4c9805,null));};exports['show']=function(_0x30e75e,_0x35fdc2){var _0x3c398a={'raw':!![],'where':{'id':_0x30e75e[_0xe0e6('0x3f')]['id']}},_0x552fb7={};_0x552fb7[_0xe0e6('0x2b')]=_[_0xe0e6('0x40')](db[_0xe0e6('0x27')][_0xe0e6('0x28')]);_0x552fb7[_0xe0e6('0x2c')]=_['keys'](_0x30e75e[_0xe0e6('0x2c')]);_0x552fb7[_0xe0e6('0x36')]=_[_0xe0e6('0x2d')](_0x552fb7[_0xe0e6('0x2b')],_0x552fb7['query']);_0x3c398a[_0xe0e6('0x2e')]=_[_0xe0e6('0x2d')](_0x552fb7[_0xe0e6('0x2b')],qs[_0xe0e6('0x2f')](_0x30e75e[_0xe0e6('0x2c')][_0xe0e6('0x2f')]));_0x3c398a[_0xe0e6('0x2e')]=_0x3c398a[_0xe0e6('0x2e')][_0xe0e6('0x30')]?_0x3c398a[_0xe0e6('0x2e')]:_0x552fb7[_0xe0e6('0x2b')];if(_0x30e75e[_0xe0e6('0x2c')][_0xe0e6('0x3b')]){_0x3c398a[_0xe0e6('0x41')]=[{'all':!![]}];}_0x3c398a=_[_0xe0e6('0x38')]({},_0x3c398a,_0x30e75e[_0xe0e6('0x3a')]);return db[_0xe0e6('0x27')]['find'](_0x3c398a)[_0xe0e6('0x20')](handleEntityNotFound(_0x35fdc2,null))[_0xe0e6('0x20')](respondWithResult(_0x35fdc2,null))['catch'](handleError(_0x35fdc2,null));};exports[_0xe0e6('0x42')]=function(_0xf09aae,_0x33e916){return db[_0xe0e6('0x27')][_0xe0e6('0x42')](_0xf09aae[_0xe0e6('0x43')],{})[_0xe0e6('0x20')](respondWithResult(_0x33e916,0xc9))[_0xe0e6('0x3e')](handleError(_0x33e916,null));};exports[_0xe0e6('0x1f')]=function(_0x178c76,_0x292ba6){if(_0x178c76[_0xe0e6('0x43')]['id']){delete _0x178c76[_0xe0e6('0x43')]['id'];}return db[_0xe0e6('0x27')][_0xe0e6('0x44')]({'where':{'id':_0x178c76[_0xe0e6('0x3f')]['id']}})[_0xe0e6('0x20')](handleEntityNotFound(_0x292ba6,null))['then'](saveUpdates(_0x178c76['body'],null))[_0xe0e6('0x20')](respondWithResult(_0x292ba6,null))['catch'](handleError(_0x292ba6,null));};exports['destroy']=function(_0x347007,_0x1acdac){return db[_0xe0e6('0x27')][_0xe0e6('0x44')]({'where':{'id':_0x347007[_0xe0e6('0x3f')]['id']}})[_0xe0e6('0x20')](handleEntityNotFound(_0x1acdac,null))['then'](removeEntity(_0x1acdac,null))['catch'](handleError(_0x1acdac,null));};exports[_0xe0e6('0x45')]=function(_0x2f2c1d,_0x48340a){return db[_0xe0e6('0x27')][_0xe0e6('0x45')]()[_0xe0e6('0x20')](respondWithResult(_0x48340a,null))[_0xe0e6('0x3e')](handleError(_0x48340a,null));};exports[_0xe0e6('0x46')]=function(_0x23af65,_0x4f1cba,_0x51bf19){var _0xa9580a={'raw':!![],'where':{}};var _0x243645={};var _0x1dfc55={'count':0x0,'rows':[]};return db[_0xe0e6('0x27')][_0xe0e6('0x47')]({'where':{'id':_0x23af65[_0xe0e6('0x3f')]['id']}})[_0xe0e6('0x20')](handleEntityNotFound(_0x4f1cba,null))[_0xe0e6('0x20')](function(_0x215b73){if(_0x215b73){_0x243645['model']=_[_0xe0e6('0x40')](db[_0xe0e6('0x48')][_0xe0e6('0x28')]);_0x243645[_0xe0e6('0x2c')]=_[_0xe0e6('0x40')](_0x23af65[_0xe0e6('0x2c')]);_0x243645[_0xe0e6('0x36')]=_[_0xe0e6('0x2d')](_0x243645['model'],_0x243645[_0xe0e6('0x2c')]);_0xa9580a['attributes']=_[_0xe0e6('0x2d')](_0x243645['model'],qs['fields'](_0x23af65[_0xe0e6('0x2c')]['fields']));_0xa9580a[_0xe0e6('0x2e')]=_0xa9580a['attributes'][_0xe0e6('0x30')]?_0xa9580a[_0xe0e6('0x2e')]:_0x243645[_0xe0e6('0x2b')];if(!_0x23af65['query'][_0xe0e6('0x31')]('nolimit')){_0xa9580a[_0xe0e6('0x1b')]=qs[_0xe0e6('0x1b')](_0x23af65['query']['limit']);_0xa9580a[_0xe0e6('0x18')]=qs['offset'](_0x23af65[_0xe0e6('0x2c')][_0xe0e6('0x18')]);}_0xa9580a[_0xe0e6('0x49')]=qs[_0xe0e6('0x33')](_0x23af65[_0xe0e6('0x2c')][_0xe0e6('0x33')]);_0xa9580a['where']=qs[_0xe0e6('0x36')](_[_0xe0e6('0x35')](_0x23af65[_0xe0e6('0x2c')],_0x243645[_0xe0e6('0x36')]));_0xa9580a[_0xe0e6('0x34')]['SessionId']=_0x215b73['id'];if(_0x23af65[_0xe0e6('0x2c')]['filter']){_0xa9580a[_0xe0e6('0x34')]=_[_0xe0e6('0x38')](_0xa9580a[_0xe0e6('0x34')],{'$or':_[_0xe0e6('0x26')](_0xa9580a[_0xe0e6('0x2e')],function(_0x5789d2){var _0xa7e8a0={};_0xa7e8a0[_0x5789d2]={'$like':'%'+_0x23af65[_0xe0e6('0x2c')][_0xe0e6('0x37')]+'%'};return _0xa7e8a0;})});}_0xa9580a=_['merge']({},_0xa9580a,_0x23af65[_0xe0e6('0x3a')]);return db['JscriptyQuestionReport'][_0xe0e6('0x1a')]({'where':_0xa9580a['where']})[_0xe0e6('0x20')](function(_0x93c470){_0x1dfc55['count']=_0x93c470;if(_0x23af65[_0xe0e6('0x2c')][_0xe0e6('0x3b')]){_0xa9580a[_0xe0e6('0x41')]=[{'all':!![]}];}return db[_0xe0e6('0x48')][_0xe0e6('0x3c')](_0xa9580a);})['then'](function(_0x25f237){_0x1dfc55[_0xe0e6('0x3d')]=_0x25f237;return _0x1dfc55;});}})['then'](respondWithFilteredResult(_0x4f1cba,_0xa9580a))['catch'](handleError(_0x4f1cba,null));}; \ No newline at end of file +var _0xacbe=['sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','sort','where','merge','VIRTUAL','filter','JscriptySessionReport','include','findAll','catch','show','keys','includeAll','options','create','body','find','params','describe','findOne','hasOwnProperty','JscriptyQuestionReport','rows','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x57fc2a,_0x14bbe5){var _0xa839b=function(_0x26572c){while(--_0x26572c){_0x57fc2a['push'](_0x57fc2a['shift']());}};_0xa839b(++_0x14bbe5);}(_0xacbe,0x82));var _0xeacb=function(_0x1337ef,_0x3963f6){_0x1337ef=_0x1337ef-0x0;var _0x532a6d=_0xacbe[_0x1337ef];return _0x532a6d;};'use strict';var emlformat=require(_0xeacb('0x0'));var rimraf=require(_0xeacb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeacb('0x2'));var rp=require(_0xeacb('0x3'));var moment=require(_0xeacb('0x4'));var BPromise=require(_0xeacb('0x5'));var Mustache=require(_0xeacb('0x6'));var util=require(_0xeacb('0x7'));var path=require('path');var sox=require(_0xeacb('0x8'));var csv=require(_0xeacb('0x9'));var ejs=require(_0xeacb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeacb('0xb'));var squel=require(_0xeacb('0xc'));var crypto=require(_0xeacb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeacb('0xe'));var toCsv=require(_0xeacb('0x9'));var querystring=require(_0xeacb('0xf'));var Papa=require(_0xeacb('0x10'));var Redis=require('ioredis');var authService=require(_0xeacb('0x11'));var qs=require(_0xeacb('0x12'));var as=require(_0xeacb('0x13'));var hardwareService=require(_0xeacb('0x14'));var logger=require(_0xeacb('0x15'))(_0xeacb('0x16'));var utils=require('../../config/utils');var config=require(_0xeacb('0x17'));var licenseUtil=require(_0xeacb('0x18'));var db=require(_0xeacb('0x19'))['db'];function respondWithStatusCode(_0x58e681,_0x346bed){_0x346bed=_0x346bed||0xcc;return function(_0x8bd73d){if(_0x8bd73d){return _0x58e681[_0xeacb('0x1a')](_0x346bed);}return _0x58e681['status'](_0x346bed)[_0xeacb('0x1b')]();};}function respondWithResult(_0x2da589,_0xcf2970){_0xcf2970=_0xcf2970||0xc8;return function(_0x35f9af){if(_0x35f9af){return _0x2da589[_0xeacb('0x1c')](_0xcf2970)[_0xeacb('0x1d')](_0x35f9af);}};}function respondWithFilteredResult(_0x488e3e,_0x2200a0){return function(_0x395fc0){if(_0x395fc0){var _0xd28aec=typeof _0x2200a0[_0xeacb('0x1e')]===_0xeacb('0x1f')&&typeof _0x2200a0[_0xeacb('0x20')]===_0xeacb('0x1f');var _0x504be8=_0x395fc0[_0xeacb('0x21')];var _0x1b1fee=_0xd28aec?0x0:_0x2200a0['offset'];var _0x2e1f97=_0xd28aec?_0x395fc0[_0xeacb('0x21')]:_0x2200a0['offset']+_0x2200a0['limit'];var _0x389d4b;if(_0x2e1f97>=_0x504be8){_0x2e1f97=_0x504be8;_0x389d4b=0xc8;}else{_0x389d4b=0xce;}_0x488e3e[_0xeacb('0x1c')](_0x389d4b);return _0x488e3e[_0xeacb('0x22')]('Content-Range',_0x1b1fee+'-'+_0x2e1f97+'/'+_0x504be8)[_0xeacb('0x1d')](_0x395fc0);}return null;};}function patchUpdates(_0x4ff796){return function(_0x26ffbc){try{jsonpatch[_0xeacb('0x23')](_0x26ffbc,_0x4ff796,!![]);}catch(_0xd9805f){return BPromise['reject'](_0xd9805f);}return _0x26ffbc[_0xeacb('0x24')]();};}function saveUpdates(_0x2554f3,_0x15b37b){return function(_0x8d1bf9){if(_0x8d1bf9){return _0x8d1bf9[_0xeacb('0x25')](_0x2554f3)[_0xeacb('0x26')](function(_0x276a31){return _0x276a31;});}return null;};}function removeEntity(_0x30a517,_0x127997){return function(_0x25b66b){if(_0x25b66b){return _0x25b66b[_0xeacb('0x27')]()['then'](function(){_0x30a517[_0xeacb('0x1c')](0xcc)[_0xeacb('0x1b')]();});}};}function handleEntityNotFound(_0x2eaa75,_0x2f325f){return function(_0x2f5b7f){if(!_0x2f5b7f){_0x2eaa75[_0xeacb('0x1a')](0x194);}return _0x2f5b7f;};}function handleError(_0x46d6c5,_0x415bab){_0x415bab=_0x415bab||0x1f4;return function(_0x2e17a1){logger[_0xeacb('0x28')](_0x2e17a1[_0xeacb('0x29')]);if(_0x2e17a1[_0xeacb('0x2a')]){delete _0x2e17a1['name'];}_0x46d6c5[_0xeacb('0x1c')](_0x415bab)['send'](_0x2e17a1);};}exports[_0xeacb('0x2b')]=function(_0x211c09,_0x31ec8d){var _0x339b2d={},_0x5b5255={},_0x479447={'count':0x0,'rows':[]};var _0x38fbfb=_[_0xeacb('0x2c')](db['JscriptySessionReport'][_0xeacb('0x2d')],function(_0x1bfae9){return{'name':_0x1bfae9[_0xeacb('0x2e')],'type':_0x1bfae9[_0xeacb('0x2f')][_0xeacb('0x30')]};});_0x5b5255[_0xeacb('0x31')]=_[_0xeacb('0x2c')](_0x38fbfb,'name');_0x5b5255[_0xeacb('0x32')]=_['keys'](_0x211c09[_0xeacb('0x32')]);_0x5b5255[_0xeacb('0x33')]=_['intersection'](_0x5b5255[_0xeacb('0x31')],_0x5b5255[_0xeacb('0x32')]);_0x339b2d[_0xeacb('0x34')]=_[_0xeacb('0x35')](_0x5b5255[_0xeacb('0x31')],qs[_0xeacb('0x36')](_0x211c09[_0xeacb('0x32')][_0xeacb('0x36')]));_0x339b2d[_0xeacb('0x34')]=_0x339b2d[_0xeacb('0x34')][_0xeacb('0x37')]?_0x339b2d[_0xeacb('0x34')]:_0x5b5255[_0xeacb('0x31')];if(!_0x211c09[_0xeacb('0x32')]['hasOwnProperty']('nolimit')){_0x339b2d[_0xeacb('0x20')]=qs[_0xeacb('0x20')](_0x211c09[_0xeacb('0x32')][_0xeacb('0x20')]);_0x339b2d['offset']=qs[_0xeacb('0x1e')](_0x211c09[_0xeacb('0x32')][_0xeacb('0x1e')]);}_0x339b2d['order']=qs[_0xeacb('0x38')](_0x211c09[_0xeacb('0x32')][_0xeacb('0x38')]);_0x339b2d['where']=qs['filters'](_['pick'](_0x211c09[_0xeacb('0x32')],_0x5b5255[_0xeacb('0x33')]),_0x38fbfb);if(_0x211c09[_0xeacb('0x32')]['filter']){_0x339b2d[_0xeacb('0x39')]=_[_0xeacb('0x3a')](_0x339b2d[_0xeacb('0x39')],{'$or':_[_0xeacb('0x2c')](_0x38fbfb,function(_0x433d92){if(_0x433d92[_0xeacb('0x2f')]!==_0xeacb('0x3b')){var _0x42564f={};_0x42564f[_0x433d92[_0xeacb('0x2a')]]={'$like':'%'+_0x211c09[_0xeacb('0x32')][_0xeacb('0x3c')]+'%'};return _0x42564f;}})});}_0x339b2d=_[_0xeacb('0x3a')]({},_0x339b2d,_0x211c09['options']);var _0x2c3611={'where':_0x339b2d[_0xeacb('0x39')]};return db[_0xeacb('0x3d')][_0xeacb('0x21')](_0x2c3611)[_0xeacb('0x26')](function(_0xb50bfe){_0x479447['count']=_0xb50bfe;if(_0x211c09[_0xeacb('0x32')]['includeAll']){_0x339b2d[_0xeacb('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xeacb('0x3f')](_0x339b2d);})['then'](function(_0x3974ed){_0x479447['rows']=_0x3974ed;return _0x479447;})[_0xeacb('0x26')](respondWithFilteredResult(_0x31ec8d,_0x339b2d))[_0xeacb('0x40')](handleError(_0x31ec8d,null));};exports[_0xeacb('0x41')]=function(_0x819483,_0x32f9cc){var _0x3abc19={'raw':!![],'where':{'id':_0x819483['params']['id']}},_0x40e6ca={};_0x40e6ca['model']=_[_0xeacb('0x42')](db['JscriptySessionReport']['rawAttributes']);_0x40e6ca['query']=_[_0xeacb('0x42')](_0x819483[_0xeacb('0x32')]);_0x40e6ca['filters']=_[_0xeacb('0x35')](_0x40e6ca[_0xeacb('0x31')],_0x40e6ca[_0xeacb('0x32')]);_0x3abc19[_0xeacb('0x34')]=_[_0xeacb('0x35')](_0x40e6ca[_0xeacb('0x31')],qs[_0xeacb('0x36')](_0x819483[_0xeacb('0x32')]['fields']));_0x3abc19[_0xeacb('0x34')]=_0x3abc19[_0xeacb('0x34')][_0xeacb('0x37')]?_0x3abc19['attributes']:_0x40e6ca[_0xeacb('0x31')];if(_0x819483['query'][_0xeacb('0x43')]){_0x3abc19[_0xeacb('0x3e')]=[{'all':!![]}];}_0x3abc19=_[_0xeacb('0x3a')]({},_0x3abc19,_0x819483[_0xeacb('0x44')]);return db['JscriptySessionReport']['find'](_0x3abc19)[_0xeacb('0x26')](handleEntityNotFound(_0x32f9cc,null))['then'](respondWithResult(_0x32f9cc,null))[_0xeacb('0x40')](handleError(_0x32f9cc,null));};exports[_0xeacb('0x45')]=function(_0x19f509,_0x5e449c){return db['JscriptySessionReport'][_0xeacb('0x45')](_0x19f509[_0xeacb('0x46')],{})[_0xeacb('0x26')](respondWithResult(_0x5e449c,0xc9))['catch'](handleError(_0x5e449c,null));};exports['update']=function(_0x1aa8b9,_0x5016c0){if(_0x1aa8b9[_0xeacb('0x46')]['id']){delete _0x1aa8b9[_0xeacb('0x46')]['id'];}return db[_0xeacb('0x3d')][_0xeacb('0x47')]({'where':{'id':_0x1aa8b9[_0xeacb('0x48')]['id']}})[_0xeacb('0x26')](handleEntityNotFound(_0x5016c0,null))[_0xeacb('0x26')](saveUpdates(_0x1aa8b9['body'],null))[_0xeacb('0x26')](respondWithResult(_0x5016c0,null))['catch'](handleError(_0x5016c0,null));};exports['destroy']=function(_0x1e3052,_0x135997){return db[_0xeacb('0x3d')]['find']({'where':{'id':_0x1e3052[_0xeacb('0x48')]['id']}})['then'](handleEntityNotFound(_0x135997,null))['then'](removeEntity(_0x135997,null))[_0xeacb('0x40')](handleError(_0x135997,null));};exports[_0xeacb('0x49')]=function(_0x597290,_0x4bade9){return db['JscriptySessionReport'][_0xeacb('0x49')]()[_0xeacb('0x26')](respondWithResult(_0x4bade9,null))[_0xeacb('0x40')](handleError(_0x4bade9,null));};exports['getQuestions']=function(_0x40bfb9,_0x3da2b1,_0x9501e8){var _0x18ac46={'raw':!![],'where':{}};var _0x47a27f={};var _0x5be749={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xeacb('0x4a')]({'where':{'id':_0x40bfb9[_0xeacb('0x48')]['id']}})[_0xeacb('0x26')](handleEntityNotFound(_0x3da2b1,null))[_0xeacb('0x26')](function(_0x5870dd){if(_0x5870dd){_0x47a27f[_0xeacb('0x31')]=_[_0xeacb('0x42')](db['JscriptyQuestionReport']['rawAttributes']);_0x47a27f[_0xeacb('0x32')]=_['keys'](_0x40bfb9[_0xeacb('0x32')]);_0x47a27f[_0xeacb('0x33')]=_['intersection'](_0x47a27f[_0xeacb('0x31')],_0x47a27f['query']);_0x18ac46[_0xeacb('0x34')]=_[_0xeacb('0x35')](_0x47a27f[_0xeacb('0x31')],qs['fields'](_0x40bfb9[_0xeacb('0x32')][_0xeacb('0x36')]));_0x18ac46[_0xeacb('0x34')]=_0x18ac46['attributes'][_0xeacb('0x37')]?_0x18ac46[_0xeacb('0x34')]:_0x47a27f[_0xeacb('0x31')];if(!_0x40bfb9['query'][_0xeacb('0x4b')]('nolimit')){_0x18ac46['limit']=qs[_0xeacb('0x20')](_0x40bfb9[_0xeacb('0x32')][_0xeacb('0x20')]);_0x18ac46[_0xeacb('0x1e')]=qs[_0xeacb('0x1e')](_0x40bfb9[_0xeacb('0x32')]['offset']);}_0x18ac46['order']=qs['sort'](_0x40bfb9[_0xeacb('0x32')]['sort']);_0x18ac46['where']=qs['filters'](_['pick'](_0x40bfb9[_0xeacb('0x32')],_0x47a27f['filters']));_0x18ac46['where']['SessionId']=_0x5870dd['id'];if(_0x40bfb9[_0xeacb('0x32')][_0xeacb('0x3c')]){_0x18ac46[_0xeacb('0x39')]=_[_0xeacb('0x3a')](_0x18ac46[_0xeacb('0x39')],{'$or':_[_0xeacb('0x2c')](_0x18ac46[_0xeacb('0x34')],function(_0x3de4a3){var _0xa0b83f={};_0xa0b83f[_0x3de4a3]={'$like':'%'+_0x40bfb9[_0xeacb('0x32')][_0xeacb('0x3c')]+'%'};return _0xa0b83f;})});}_0x18ac46=_['merge']({},_0x18ac46,_0x40bfb9[_0xeacb('0x44')]);return db[_0xeacb('0x4c')][_0xeacb('0x21')]({'where':_0x18ac46[_0xeacb('0x39')]})[_0xeacb('0x26')](function(_0x2d912b){_0x5be749[_0xeacb('0x21')]=_0x2d912b;if(_0x40bfb9[_0xeacb('0x32')]['includeAll']){_0x18ac46['include']=[{'all':!![]}];}return db[_0xeacb('0x4c')][_0xeacb('0x3f')](_0x18ac46);})['then'](function(_0x4a07cd){_0x5be749[_0xeacb('0x4d')]=_0x4a07cd;return _0x5be749;});}})[_0xeacb('0x26')](respondWithFilteredResult(_0x3da2b1,_0x18ac46))[_0xeacb('0x40')](handleError(_0x3da2b1,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 70d064f..d5b5016 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 _0x1883=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a9765,_0x323732){var _0x1c363c=function(_0x4667d8){while(--_0x4667d8){_0x4a9765['push'](_0x4a9765['shift']());}};_0x1c363c(++_0x323732);}(_0x1883,0xab));var _0x3188=function(_0x200c95,_0x387ecb){_0x200c95=_0x200c95-0x0;var _0xef7c28=_0x1883[_0x200c95];return _0xef7c28;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6050=['../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x42be10,_0xe19651){var _0x4174f3=function(_0x285b30){while(--_0x285b30){_0x42be10['push'](_0x42be10['shift']());}};_0x4174f3(++_0xe19651);}(_0x6050,0x196));var _0x0605=function(_0x4b735c,_0x52f2b5){_0x4b735c=_0x4b735c-0x0;var _0x34daaf=_0x6050[_0x4b735c];return _0x34daaf;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','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 2356837..be8222c 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 _0x5496=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x8a9658,_0x5eb82b){var _0x32a841=function(_0x4f3181){while(--_0x4f3181){_0x8a9658['push'](_0x8a9658['shift']());}};_0x32a841(++_0x5eb82b);}(_0x5496,0x175));var _0x6549=function(_0x5dcdc6,_0xf99848){_0x5dcdc6=_0x5dcdc6-0x0;var _0xb5b636=_0x5496[_0x5dcdc6];return _0xb5b636;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8cea,_0x4fcffd,_0x1ca8fc){return new BPromise(function(_0x3442c3,_0x1ef2a6){return client['request'](_0x1d8cea,_0x1ca8fc)[_0x6549('0xa')](function(_0x35d008){logger[_0x6549('0xb')](_0x6549('0xc'),_0x4fcffd,_0x6549('0xd'));logger[_0x6549('0xe')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x4fcffd,'request\x20sent',JSON[_0x6549('0xf')](_0x35d008));if(_0x35d008[_0x6549('0x10')]){if(_0x35d008[_0x6549('0x10')][_0x6549('0x11')]===0x1f4){logger[_0x6549('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x4fcffd,_0x35d008['error'][_0x6549('0x12')]);return _0x1ef2a6(_0x35d008[_0x6549('0x10')]['message']);}logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);return _0x3442c3(_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x4fcffd,_0x6549('0xd'));_0x3442c3(_0x35d008[_0x6549('0x13')]['message']);}})[_0x6549('0x14')](function(_0x67acc0){logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x67acc0);_0x1ef2a6(_0x67acc0);});});} \ No newline at end of file +var _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch'];(function(_0xfdd79e,_0x4f3a03){var _0x190157=function(_0x1859ec){while(--_0x1859ec){_0xfdd79e['push'](_0xfdd79e['shift']());}};_0x190157(++_0x4f3a03);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index adafc6a..d504ccf 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 _0xb453=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','multer','util'];(function(_0x58416a,_0x2ff095){var _0x5b1573=function(_0xda0167){while(--_0xda0167){_0x58416a['push'](_0x58416a['shift']());}};_0x5b1573(++_0x2ff095);}(_0xb453,0x1e8));var _0x3b45=function(_0x1132cb,_0x415664){_0x1132cb=_0x1132cb-0x0;var _0x486604=_0xb453[_0x1132cb];return _0x486604;};'use strict';var multer=require(_0x3b45('0x0'));var util=require(_0x3b45('0x1'));var path=require('path');var timeout=require(_0x3b45('0x2'));var express=require(_0x3b45('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3b45('0x4'));var interaction=require(_0x3b45('0x5'));var config=require(_0x3b45('0x6'));var controller=require(_0x3b45('0x7'));router[_0x3b45('0x8')]('/',controller[_0x3b45('0x9')]);router[_0x3b45('0xa')](_0x3b45('0xb'),auth[_0x3b45('0xc')](),controller[_0x3b45('0xd')]);module['exports']=router; \ No newline at end of file +var _0xcb70=['../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','update','exports','multer','util','fs-extra','../../components/auth/service'];(function(_0x4e81eb,_0x1a1e7c){var _0x4f52e3=function(_0x509e73){while(--_0x509e73){_0x4e81eb['push'](_0x4e81eb['shift']());}};_0x4f52e3(++_0x1a1e7c);}(_0xcb70,0xf3));var _0x0cb7=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xcb70[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x0cb7('0x0'));var util=require(_0x0cb7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0cb7('0x2'));var auth=require(_0x0cb7('0x3'));var interaction=require(_0x0cb7('0x4'));var config=require(_0x0cb7('0x5'));var controller=require(_0x0cb7('0x6'));router[_0x0cb7('0x7')]('/',controller[_0x0cb7('0x8')]);router['put'](_0x0cb7('0x9'),auth[_0x0cb7('0xa')](),controller[_0x0cb7('0xb')]);module[_0x0cb7('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index d5075b8..6ebcb4e 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 _0xf18a=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0xf18a,0xde));var _0xaf18=function(_0xeb1c7,_0x3327b1){_0xeb1c7=_0xeb1c7-0x0;var _0x4d374d=_0xf18a[_0xeb1c7];return _0x4d374d;};'use strict';var Sequelize=require(_0xaf18('0x0'));module[_0xaf18('0x1')]={'license':{'type':Sequelize[_0xaf18('0x2')]},'data1':{'type':Sequelize[_0xaf18('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xaf18('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8649=['STRING','exports','TEXT'];(function(_0x52b3c2,_0x2890a9){var _0x1ff3b9=function(_0x257ac1){while(--_0x257ac1){_0x52b3c2['push'](_0x52b3c2['shift']());}};_0x1ff3b9(++_0x2890a9);}(_0x8649,0xa9));var _0x9864=function(_0x3d8637,_0x29e08d){_0x3d8637=_0x3d8637-0x0;var _0x11381d=_0x8649[_0x3d8637];return _0x11381d;};'use strict';var Sequelize=require('sequelize');module[_0x9864('0x0')]={'license':{'type':Sequelize[_0x9864('0x1')]},'data1':{'type':Sequelize[_0x9864('0x2')]},'data2':{'type':Sequelize[_0x9864('0x2')]},'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 71f4eb3..5806ceb 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 _0x814b=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','model','keys','rawAttributes','intersection','query','attributes','fields','length','merge','options','getLicense','catch','body','License','params','get','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x81a9b6,_0x3bf064){var _0x1f130f=function(_0x54d47a){while(--_0x54d47a){_0x81a9b6['push'](_0x81a9b6['shift']());}};_0x1f130f(++_0x3bf064);}(_0x814b,0x1a2));var _0xb814=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x814b[_0x2431d6];return _0x4d0f9b;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}var utilLicense=require(_0xb814('0x19'));exports['index']=function(_0x9008b2,_0x37d24d){var _0x530744={'raw':!![],'where':{'id':0x1}},_0x499f22={};_0x499f22[_0xb814('0x2e')]=_[_0xb814('0x2f')](db['License'][_0xb814('0x30')]);_0x499f22['query']=_[_0xb814('0x2f')](_0x9008b2['query']);_0x499f22['filters']=_[_0xb814('0x31')](_0x499f22['model'],_0x499f22[_0xb814('0x32')]);_0x530744[_0xb814('0x33')]=_[_0xb814('0x31')](_0x499f22['model'],qs['fields'](_0x9008b2[_0xb814('0x32')][_0xb814('0x34')]));_0x530744['attributes']=_0x530744[_0xb814('0x33')][_0xb814('0x35')]?_0x530744[_0xb814('0x33')]:_0x499f22[_0xb814('0x2e')];_0x530744=_[_0xb814('0x36')]({},_0x530744,_0x9008b2[_0xb814('0x37')]);return utilLicense[_0xb814('0x38')](_0x530744)['then'](respondWithResult(_0x37d24d,null))[_0xb814('0x39')](handleError(_0x37d24d,null));};exports[_0xb814('0x27')]=function(_0x30de5a,_0x424e2b){if(_0x30de5a[_0xb814('0x3a')]['id']){delete _0x30de5a['body']['id'];}return db[_0xb814('0x3b')]['find']({'where':{'id':_0x30de5a[_0xb814('0x3c')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x424e2b,null))[_0xb814('0x28')](function(_0x492d5e){var _0x40b885=_0x492d5e[_0xb814('0x3d')]({'plain':!![]});return utilLicense['checkLicense'](_0x40b885,_0x30de5a[_0xb814('0x3a')][_0xb814('0x3e')]);})[_0xb814('0x28')](function(_0x1f7cd8){if(!_0x1f7cd8[_0xb814('0x3f')]){return saveUpdates(_0x30de5a[_0xb814('0x3a')],null);}return _0x1f7cd8;})['then'](respondWithResult(_0x424e2b,null))[_0xb814('0x39')](handleError(_0x424e2b,null));}; \ No newline at end of file +var _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xf494,0x1c6));var _0x4f49=function(_0x465614,_0x477fb3){_0x465614=_0x465614-0x0;var _0x5a0074=_0xf494[_0x465614];return _0x5a0074;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 54ac77d..83ce9ce 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 _0xbc33=['./license.attributes','exports','License','api','bluebird','path','rimraf','../../config/environment'];(function(_0x15a676,_0x4036a1){var _0x48d768=function(_0x1e59c5){while(--_0x1e59c5){_0x15a676['push'](_0x15a676['shift']());}};_0x48d768(++_0x4036a1);}(_0xbc33,0x19b));var _0x3bc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3bc3('0x0'));var moment=require('moment');var BPromise=require(_0x3bc3('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bc3('0x2'));var rimraf=require(_0x3bc3('0x3'));var config=require(_0x3bc3('0x4'));var attributes=require(_0x3bc3('0x5'));module[_0x3bc3('0x6')]=function(_0x1cda43,_0x3d8600){return _0x1cda43['define'](_0x3bc3('0x7'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafbc=['rimraf','../../config/environment','./license.attributes','define','util','api','moment','bluebird','request-promise'];(function(_0x23f3a2,_0x329e9e){var _0x455aa9=function(_0x304471){while(--_0x304471){_0x23f3a2['push'](_0x23f3a2['shift']());}};_0x455aa9(++_0x329e9e);}(_0xafbc,0x1ab));var _0xcafb=function(_0xf19155,_0x161362){_0xf19155=_0xf19155-0x0;var _0x5365ab=_0xafbc[_0xf19155];return _0x5365ab;};'use strict';var _=require('lodash');var util=require(_0xcafb('0x0'));var logger=require('../../config/logger')(_0xcafb('0x1'));var moment=require(_0xcafb('0x2'));var BPromise=require(_0xcafb('0x3'));var rp=require(_0xcafb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcafb('0x5'));var config=require(_0xcafb('0x6'));var attributes=require(_0xcafb('0x7'));module['exports']=function(_0xad038f,_0x474427){return _0xad038f[_0xcafb('0x8')]('License',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 2e507c8..8258bba 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 _0x9b3e=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x39a184,_0x163ee9){var _0xdb5097=function(_0xba55c0){while(--_0xba55c0){_0x39a184['push'](_0x39a184['shift']());}};_0xdb5097(++_0x163ee9);}(_0x9b3e,0xc5));var _0xe9b3=function(_0x10ca5d,_0x5cb7bd){_0x10ca5d=_0x10ca5d-0x0;var _0x2998e7=_0x9b3e[_0x10ca5d];return _0x2998e7;};'use strict';var _=require(_0xe9b3('0x0'));var util=require(_0xe9b3('0x1'));var moment=require(_0xe9b3('0x2'));var BPromise=require(_0xe9b3('0x3'));var rs=require(_0xe9b3('0x4'));var fs=require('fs');var Redis=require(_0xe9b3('0x5'));var db=require(_0xe9b3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9b3('0x7'))('rpc');var config=require(_0xe9b3('0x8'));var jayson=require(_0xe9b3('0x9'));var client=jayson[_0xe9b3('0xa')][_0xe9b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa4e3a5,_0x1a585f,_0x34df12){return new BPromise(function(_0xf7d134,_0x4fc379){return client[_0xe9b3('0xc')](_0xa4e3a5,_0x34df12)[_0xe9b3('0xd')](function(_0x2cf17f){logger[_0xe9b3('0xe')](_0xe9b3('0xf'),_0x1a585f,_0xe9b3('0x10'));logger[_0xe9b3('0x11')](_0xe9b3('0x12'),_0x1a585f,_0xe9b3('0x10'),JSON[_0xe9b3('0x13')](_0x2cf17f));if(_0x2cf17f[_0xe9b3('0x14')]){if(_0x2cf17f[_0xe9b3('0x14')][_0xe9b3('0x15')]===0x1f4){logger[_0xe9b3('0x14')](_0xe9b3('0xf'),_0x1a585f,_0x2cf17f[_0xe9b3('0x14')][_0xe9b3('0x16')]);return _0x4fc379(_0x2cf17f[_0xe9b3('0x14')]['message']);}logger[_0xe9b3('0x14')](_0xe9b3('0xf'),_0x1a585f,_0x2cf17f[_0xe9b3('0x14')]['message']);return _0xf7d134(_0x2cf17f['error']['message']);}else{logger[_0xe9b3('0xe')]('License,\x20%s,\x20%s',_0x1a585f,'request\x20sent');_0xf7d134(_0x2cf17f[_0xe9b3('0x17')][_0xe9b3('0x16')]);}})['catch'](function(_0x1e4db4){logger[_0xe9b3('0x14')](_0xe9b3('0xf'),_0x1a585f,_0x1e4db4);_0x4fc379(_0x1e4db4);});});} \ No newline at end of file +var _0xbca0=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ece53,_0x485cb4){var _0x4fcc68=function(_0x566d96){while(--_0x566d96){_0x4ece53['push'](_0x4ece53['shift']());}};_0x4fcc68(++_0x485cb4);}(_0xbca0,0xa1));var _0x0bca=function(_0x3b1917,_0x49d088){_0x3b1917=_0x3b1917-0x0;var _0x16d449=_0xbca0[_0x3b1917];return _0x16d449;};'use strict';var _=require(_0x0bca('0x0'));var util=require(_0x0bca('0x1'));var moment=require('moment');var BPromise=require(_0x0bca('0x2'));var rs=require(_0x0bca('0x3'));var fs=require('fs');var Redis=require(_0x0bca('0x4'));var db=require(_0x0bca('0x5'))['db'];var utils=require(_0x0bca('0x6'));var logger=require(_0x0bca('0x7'))('rpc');var config=require(_0x0bca('0x8'));var jayson=require(_0x0bca('0x9'));var client=jayson[_0x0bca('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4825eb,_0x490988,_0x3aaae2){return new BPromise(function(_0x56528d,_0x2c7e74){return client[_0x0bca('0xb')](_0x4825eb,_0x3aaae2)[_0x0bca('0xc')](function(_0x179b0f){logger[_0x0bca('0xd')](_0x0bca('0xe'),_0x490988,_0x0bca('0xf'));logger[_0x0bca('0x10')](_0x0bca('0x11'),_0x490988,_0x0bca('0xf'),JSON[_0x0bca('0x12')](_0x179b0f));if(_0x179b0f[_0x0bca('0x13')]){if(_0x179b0f[_0x0bca('0x13')][_0x0bca('0x14')]===0x1f4){logger[_0x0bca('0x13')](_0x0bca('0xe'),_0x490988,_0x179b0f[_0x0bca('0x13')][_0x0bca('0x15')]);return _0x2c7e74(_0x179b0f[_0x0bca('0x13')][_0x0bca('0x15')]);}logger[_0x0bca('0x13')](_0x0bca('0xe'),_0x490988,_0x179b0f[_0x0bca('0x13')][_0x0bca('0x15')]);return _0x56528d(_0x179b0f[_0x0bca('0x13')][_0x0bca('0x15')]);}else{logger[_0x0bca('0xd')](_0x0bca('0xe'),_0x490988,_0x0bca('0xf'));_0x56528d(_0x179b0f[_0x0bca('0x16')][_0x0bca('0x15')]);}})[_0x0bca('0x17')](function(_0x3ce6cc){logger[_0x0bca('0x13')](_0x0bca('0xe'),_0x490988,_0x3ce6cc);_0x2c7e74(_0x3ce6cc);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0f1b72f..8451b23 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 _0xbb8c=['index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','post','addDisposition','create','addSmtp','/:id/interactions','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated'];(function(_0x9011a6,_0x55b87d){var _0x312856=function(_0x554f60){while(--_0x554f60){_0x9011a6['push'](_0x9011a6['shift']());}};_0x312856(++_0x55b87d);}(_0xbb8c,0x14d));var _0xcbb8=function(_0x30b545,_0x2a29bb){_0x30b545=_0x30b545-0x0;var _0x3c092e=_0xbb8c[_0x30b545];return _0x3c092e;};'use strict';var multer=require('multer');var util=require(_0xcbb8('0x0'));var path=require(_0xcbb8('0x1'));var timeout=require(_0xcbb8('0x2'));var express=require(_0xcbb8('0x3'));var router=express[_0xcbb8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcbb8('0x5'));var interaction=require(_0xcbb8('0x6'));var config=require(_0xcbb8('0x7'));var controller=require(_0xcbb8('0x8'));router[_0xcbb8('0x9')]('/',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0xb')]);router[_0xcbb8('0x9')](_0xcbb8('0xc'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0xd')]);router[_0xcbb8('0x9')](_0xcbb8('0xe'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0xf')]);router[_0xcbb8('0x9')]('/:id/dispositions',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x10')]);router['get'](_0xcbb8('0x11'),auth[_0xcbb8('0xa')](),controller['getAnswers']);router[_0xcbb8('0x9')](_0xcbb8('0x12'),auth[_0xcbb8('0xa')](),controller['getImap']);router[_0xcbb8('0x9')](_0xcbb8('0x13'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x14')]);router[_0xcbb8('0x9')]('/:id/interactions',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x15')]);router[_0xcbb8('0x9')](_0xcbb8('0x16'),auth['isAuthenticated'](),controller['getApplications']);router[_0xcbb8('0x9')](_0xcbb8('0x17'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x18')]);router[_0xcbb8('0x9')]('/:id/verify',auth[_0xcbb8('0xa')](),controller['verifySmtp']);router['get'](_0xcbb8('0x19'),auth[_0xcbb8('0xa')](),controller['getAgents']);router[_0xcbb8('0x1a')]('/:id/dispositions',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x1b')]);router['post'](_0xcbb8('0x11'),auth[_0xcbb8('0xa')](),controller['addAnswer']);router[_0xcbb8('0x1a')]('/',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x1c')]);router[_0xcbb8('0x1a')](_0xcbb8('0x12'),auth[_0xcbb8('0xa')](),controller['addImap']);router[_0xcbb8('0x1a')](_0xcbb8('0x13'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x1d')]);router[_0xcbb8('0x1a')](_0xcbb8('0x1e'),auth[_0xcbb8('0xa')](),controller['addInteraction']);router['post'](_0xcbb8('0x16'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x1f')]);router[_0xcbb8('0x1a')](_0xcbb8('0x20'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x21')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xcbb8('0x22')]);router[_0xcbb8('0x23')](_0xcbb8('0xe'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x24')]);router[_0xcbb8('0x25')]('/:id/dispositions',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x26')]);router[_0xcbb8('0x25')]('/:id/canned_answers',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x27')]);router[_0xcbb8('0x25')](_0xcbb8('0x12'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x28')]);router[_0xcbb8('0x25')]('/:id/out_servers',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x29')]);router[_0xcbb8('0x25')](_0xcbb8('0xe'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x2a')]);router[_0xcbb8('0x25')](_0xcbb8('0x19'),auth[_0xcbb8('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xc32f=['/:id','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','/:id/canned_answers','addAnswer','post','create','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xc32f,0x84));var _0xfc32=function(_0x4f2c32,_0x14a8d7){_0x4f2c32=_0x4f2c32-0x0;var _0x33a857=_0xc32f[_0x4f2c32];return _0x33a857;};'use strict';var multer=require(_0xfc32('0x0'));var util=require('util');var path=require(_0xfc32('0x1'));var timeout=require('connect-timeout');var express=require(_0xfc32('0x2'));var router=express[_0xfc32('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfc32('0x4'));var interaction=require(_0xfc32('0x5'));var config=require(_0xfc32('0x6'));var controller=require(_0xfc32('0x7'));router[_0xfc32('0x8')]('/',auth[_0xfc32('0x9')](),controller[_0xfc32('0xa')]);router[_0xfc32('0x8')]('/describe',auth[_0xfc32('0x9')](),controller[_0xfc32('0xb')]);router[_0xfc32('0x8')](_0xfc32('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfc32('0x8')](_0xfc32('0xd'),auth[_0xfc32('0x9')](),controller[_0xfc32('0xe')]);router[_0xfc32('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xfc32('0xf')]);router[_0xfc32('0x8')](_0xfc32('0x10'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x11')]);router[_0xfc32('0x8')](_0xfc32('0x12'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x13')]);router[_0xfc32('0x8')](_0xfc32('0x14'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x15')]);router[_0xfc32('0x8')](_0xfc32('0x16'),auth['isAuthenticated'](),controller[_0xfc32('0x17')]);router[_0xfc32('0x8')](_0xfc32('0x18'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x19')]);router['get'](_0xfc32('0x1a'),auth[_0xfc32('0x9')](),controller['verifySmtp']);router[_0xfc32('0x8')](_0xfc32('0x1b'),auth[_0xfc32('0x9')](),controller['getAgents']);router['post'](_0xfc32('0xd'),auth[_0xfc32('0x9')](),controller['addDisposition']);router['post'](_0xfc32('0x1c'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x1d')]);router[_0xfc32('0x1e')]('/',auth[_0xfc32('0x9')](),controller[_0xfc32('0x1f')]);router[_0xfc32('0x1e')]('/:id/in_servers',auth[_0xfc32('0x9')](),controller['addImap']);router[_0xfc32('0x1e')](_0xfc32('0x12'),auth['isAuthenticated'](),controller[_0xfc32('0x20')]);router[_0xfc32('0x1e')](_0xfc32('0x14'),auth['isAuthenticated'](),controller[_0xfc32('0x21')]);router[_0xfc32('0x1e')]('/:id/applications',auth[_0xfc32('0x9')](),controller[_0xfc32('0x22')]);router[_0xfc32('0x1e')](_0xfc32('0x23'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x24')]);router[_0xfc32('0x1e')](_0xfc32('0x1b'),auth['isAuthenticated'](),controller[_0xfc32('0x25')]);router[_0xfc32('0x26')](_0xfc32('0xc'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x27')]);router['delete'](_0xfc32('0xd'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x28')]);router[_0xfc32('0x29')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xfc32('0x2a')]);router['delete'](_0xfc32('0x10'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x2b')]);router['delete'](_0xfc32('0x12'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x2c')]);router[_0xfc32('0x29')](_0xfc32('0xc'),auth['isAuthenticated'](),controller[_0xfc32('0x2d')]);router[_0xfc32('0x29')](_0xfc32('0x1b'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x2e')]);module[_0xfc32('0x2f')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index ae22b7a..74a37d4 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 _0x4b19=['BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0x4b19,0x195));var _0x94b1=function(_0x486919,_0x1ff17d){_0x486919=_0x486919-0x0;var _0x30d637=_0x4b19[_0x486919];return _0x30d637;};'use strict';var Sequelize=require(_0x94b1('0x0'));module['exports']={'description':{'type':Sequelize[_0x94b1('0x1')]},'name':{'type':Sequelize[_0x94b1('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x94b1('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x94b1('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x94b1('0x1')],'allowNull':![],'defaultValue':_0x94b1('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x94b1('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x94b1('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[_0x94b1('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x94b1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x94b1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x94b1('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x94b1('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![],'comment':_0x94b1('0x8'),'set':function(_0x162995){if(!_0x162995)this[_0x94b1('0x9')]('mandatoryDispositionPauseId',null);this[_0x94b1('0x9')](_0x94b1('0xa'),_0x162995);}}}; \ No newline at end of file +var _0x089f=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports'];(function(_0x2a2f10,_0x1b2ce0){var _0x2984e9=function(_0x208e1a){while(--_0x208e1a){_0x2a2f10['push'](_0x2a2f10['shift']());}};_0x2984e9(++_0x1b2ce0);}(_0x089f,0x1c7));var _0xf089=function(_0x93d132,_0x2f5249){_0x93d132=_0x93d132-0x0;var _0x17578b=_0x089f[_0x93d132];return _0x17578b;};'use strict';var Sequelize=require('sequelize');module[_0xf089('0x0')]={'description':{'type':Sequelize[_0xf089('0x1')]},'name':{'type':Sequelize[_0xf089('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xf089('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xf089('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xf089('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xf089('0x3')]},'markAsUnread':{'type':Sequelize[_0xf089('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf089('0x4')},'fontSize':{'type':Sequelize[_0xf089('0x5')](0x2)[_0xf089('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf089('0x7');}},'notificationSound':{'type':Sequelize[_0xf089('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf089('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf089('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf089('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf089('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf089('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf089('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xf089('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf089('0x9'),'set':function(_0x2221a4){if(!_0x2221a4)this[_0xf089('0xa')]('mandatoryDispositionPauseId',null);this[_0xf089('0xa')](_0xf089('0xb'),_0x2221a4);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index a016ca8..ea81647 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 _0x71d0=['update','UserProfileResource','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','rawAttributes','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','description','isNil','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','get','role','MailAccounts','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','CmContact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','secure','auth','SendMail','sendMail','List\x20not\x20found','subject','attach','out','messageId','Interaction','Messages','verifySmtp','ValidationError','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','html-to-text','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save'];(function(_0x59dc77,_0x19d1db){var _0x3fb199=function(_0x33e12d){while(--_0x33e12d){_0x59dc77['push'](_0x59dc77['shift']());}};_0x3fb199(++_0x19d1db);}(_0x71d0,0x152));var _0x071d=function(_0xef4841,_0x51a756){_0xef4841=_0xef4841-0x0;var _0x1b37f8=_0x71d0[_0xef4841];return _0x1b37f8;};'use strict';var emlformat=require(_0x071d('0x0'));var rimraf=require(_0x071d('0x1'));var zipdir=require(_0x071d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x071d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x071d('0x4'));var path=require(_0x071d('0x5'));var sox=require(_0x071d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x071d('0x7'));var _=require(_0x071d('0x8'));var squel=require(_0x071d('0x9'));var crypto=require(_0x071d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x071d('0xb'));var toCsv=require(_0x071d('0xc'));var querystring=require(_0x071d('0xd'));var Papa=require(_0x071d('0xe'));var htmlToText=require(_0x071d('0xf'));var juice=require(_0x071d('0x10'));var Redis=require(_0x071d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x071d('0x12'));var as=require(_0x071d('0x13'));var hardwareService=require(_0x071d('0x14'));var logger=require(_0x071d('0x15'))('api');var utils=require(_0x071d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x071d('0x17'))['db'];config['redis']=_[_0x071d('0x18')](config[_0x071d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x071d('0x1a'))(new Redis(config[_0x071d('0x19')]));require(_0x071d('0x1b'))[_0x071d('0x1c')](socket);var jayson=require(_0x071d('0x1d'));var client=jayson['client'][_0x071d('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x1c454c,_0x3eb270,_0x264666,_0x2553bc){return new BPromise(function(_0x4e9070,_0x597219){var _0x473da8=_0x2553bc||client;return _0x473da8[_0x071d('0x1f')](_0x1c454c,_0x264666)[_0x071d('0x20')](function(_0x40856f){logger[_0x071d('0x21')](_0x071d('0x22'),_0x3eb270,_0x071d('0x23'));logger[_0x071d('0x24')](_0x071d('0x25'),_0x3eb270,_0x071d('0x23'),JSON[_0x071d('0x26')](_0x40856f));if(_0x40856f[_0x071d('0x27')]){if(_0x40856f[_0x071d('0x27')]['code']===0x1f4){logger[_0x071d('0x27')](_0x071d('0x22'),_0x3eb270,_0x40856f['error']['message']);return _0x597219(_0x40856f[_0x071d('0x27')][_0x071d('0x28')]);}logger['error'](_0x071d('0x22'),_0x3eb270,_0x40856f[_0x071d('0x27')][_0x071d('0x28')]);return _0x4e9070(_0x40856f[_0x071d('0x27')][_0x071d('0x28')]);}else{logger[_0x071d('0x21')]('MailAccount,\x20%s,\x20%s',_0x3eb270,'request\x20sent');_0x4e9070(_0x40856f[_0x071d('0x29')][_0x071d('0x28')]);}})[_0x071d('0x2a')](function(_0x3f6e9e){logger['error']('MailAccount,\x20%s,\x20%s',_0x3eb270,_0x3f6e9e);_0x597219(_0x3f6e9e);});});}function respondWithStatusCode(_0x2dd70d,_0x396608){_0x396608=_0x396608||0xcc;return function(_0x422df1){if(_0x422df1){return _0x2dd70d[_0x071d('0x2b')](_0x396608);}return _0x2dd70d[_0x071d('0x2c')](_0x396608)['end']();};}function respondWithResult(_0x1e2993,_0x43fe52){_0x43fe52=_0x43fe52||0xc8;return function(_0x3f60d0){if(_0x3f60d0){return _0x1e2993['status'](_0x43fe52)[_0x071d('0x2d')](_0x3f60d0);}};}function respondWithFilteredResult(_0x54eb6e,_0x117159){return function(_0x9a4202){if(_0x9a4202){var _0x176137=typeof _0x117159[_0x071d('0x2e')]===_0x071d('0x2f')&&typeof _0x117159[_0x071d('0x30')]===_0x071d('0x2f');var _0x3aac7a=_0x9a4202[_0x071d('0x31')];var _0xc12fd0=_0x176137?0x0:_0x117159[_0x071d('0x2e')];var _0x1563de=_0x176137?_0x9a4202['count']:_0x117159[_0x071d('0x2e')]+_0x117159[_0x071d('0x30')];var _0x448261;if(_0x1563de>=_0x3aac7a){_0x1563de=_0x3aac7a;_0x448261=0xc8;}else{_0x448261=0xce;}_0x54eb6e[_0x071d('0x2c')](_0x448261);return _0x54eb6e[_0x071d('0x32')](_0x071d('0x33'),_0xc12fd0+'-'+_0x1563de+'/'+_0x3aac7a)['json'](_0x9a4202);}return null;};}function patchUpdates(_0x466bdd){return function(_0x215201){try{jsonpatch[_0x071d('0x34')](_0x215201,_0x466bdd,!![]);}catch(_0x44b90c){return BPromise['reject'](_0x44b90c);}return _0x215201[_0x071d('0x35')]();};}function saveUpdates(_0x2a5f2e,_0x326753){return function(_0x51fb1b){if(_0x51fb1b){return _0x51fb1b[_0x071d('0x36')](_0x2a5f2e)[_0x071d('0x20')](function(_0x13e582){return _0x13e582;});}return null;};}function removeEntity(_0x44752d,_0x4760d9){return function(_0xbb491a){if(_0xbb491a){return _0xbb491a['destroy']()['then'](function(){var _0x4ca4e7=_0xbb491a['get']({'plain':!![]});var _0x17f894='MailAccounts';return db[_0x071d('0x37')][_0x071d('0x38')]({'where':{'type':_0x17f894,'resourceId':_0x4ca4e7['id']}})['then'](function(){return _0xbb491a;});})[_0x071d('0x20')](function(){_0x44752d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55bfcb,_0x4788bb){return function(_0x5329dc){if(!_0x5329dc){_0x55bfcb[_0x071d('0x2b')](0x194);}return _0x5329dc;};}function handleError(_0x52604a,_0xc5a55e){_0xc5a55e=_0xc5a55e||0x1f4;return function(_0x153b05){logger['error'](_0x153b05[_0x071d('0x39')]);if(_0x153b05[_0x071d('0x3a')]){delete _0x153b05[_0x071d('0x3a')];}_0x52604a[_0x071d('0x2c')](_0xc5a55e)[_0x071d('0x3b')](_0x153b05);};}exports[_0x071d('0x3c')]=function(_0x224ba0,_0x48dd9a){var _0x22c754={'include':[{'model':db[_0x071d('0x3d')],'as':_0x071d('0x3e')},{'model':db[_0x071d('0x3f')],'as':_0x071d('0x40')},{'model':db['Pause'],'as':_0x071d('0x41')}]},_0x161b8a={},_0x5c236e={'count':0x0,'rows':[]};var _0x22a38b=_[_0x071d('0x42')](db[_0x071d('0x43')]['rawAttributes'],function(_0x1afab7){return{'name':_0x1afab7[_0x071d('0x44')],'type':_0x1afab7[_0x071d('0x45')][_0x071d('0x46')]};});_0x161b8a['model']=_[_0x071d('0x42')](_0x22a38b,_0x071d('0x3a'));_0x161b8a[_0x071d('0x47')]=_[_0x071d('0x48')](_0x224ba0[_0x071d('0x47')]);_0x161b8a[_0x071d('0x49')]=_['intersection'](_0x161b8a['model'],_0x161b8a[_0x071d('0x47')]);_0x22c754[_0x071d('0x4a')]=_[_0x071d('0x4b')](_0x161b8a[_0x071d('0x4c')],qs[_0x071d('0x4d')](_0x224ba0['query'][_0x071d('0x4d')]));_0x22c754[_0x071d('0x4a')]=_0x22c754[_0x071d('0x4a')][_0x071d('0x4e')]?_0x22c754[_0x071d('0x4a')]:_0x161b8a['model'];if(!_0x224ba0[_0x071d('0x47')][_0x071d('0x4f')](_0x071d('0x50'))){_0x22c754[_0x071d('0x30')]=qs[_0x071d('0x30')](_0x224ba0[_0x071d('0x47')][_0x071d('0x30')]);_0x22c754[_0x071d('0x2e')]=qs[_0x071d('0x2e')](_0x224ba0[_0x071d('0x47')][_0x071d('0x2e')]);}_0x22c754['order']=qs['sort'](_0x224ba0[_0x071d('0x47')][_0x071d('0x51')]);_0x22c754[_0x071d('0x52')]=qs['filters'](_[_0x071d('0x53')](_0x224ba0[_0x071d('0x47')],_0x161b8a[_0x071d('0x49')]),_0x22a38b);if(_0x224ba0[_0x071d('0x47')][_0x071d('0x54')]){_0x22c754[_0x071d('0x52')]=_[_0x071d('0x55')](_0x22c754['where'],{'$or':_[_0x071d('0x42')](_0x22a38b,function(_0x2d6710){if(_0x2d6710['type']!==_0x071d('0x56')){var _0x5203a3={};_0x5203a3[_0x2d6710[_0x071d('0x3a')]]={'$like':'%'+_0x224ba0[_0x071d('0x47')]['filter']+'%'};return _0x5203a3;}})});}_0x22c754=_[_0x071d('0x55')]({},_0x22c754,_0x224ba0[_0x071d('0x57')]);var _0x2b2bc5={'where':_0x22c754[_0x071d('0x52')]};return db[_0x071d('0x43')][_0x071d('0x31')](_0x2b2bc5)['then'](function(_0x3159be){_0x5c236e[_0x071d('0x31')]=_0x3159be;if(_0x224ba0[_0x071d('0x47')][_0x071d('0x58')]){_0x22c754[_0x071d('0x59')]=[{'all':!![]}];}return db['MailAccount'][_0x071d('0x5a')](_0x22c754);})[_0x071d('0x20')](function(_0x18080f){_0x5c236e[_0x071d('0x5b')]=_0x18080f;return _0x5c236e;})[_0x071d('0x20')](respondWithFilteredResult(_0x48dd9a,_0x22c754))[_0x071d('0x2a')](handleError(_0x48dd9a,null));};exports[_0x071d('0x5c')]=function(_0x1fa141,_0x11e292){var _0x509027={'raw':![],'where':{'id':_0x1fa141[_0x071d('0x5d')]['id']},'include':[{'model':db[_0x071d('0x3d')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x071d('0x5e')],'as':_0x071d('0x41')}]},_0x2de0d2={};_0x2de0d2[_0x071d('0x4c')]=_['keys'](db[_0x071d('0x43')]['rawAttributes']);_0x2de0d2[_0x071d('0x47')]=_[_0x071d('0x48')](_0x1fa141[_0x071d('0x47')]);_0x2de0d2[_0x071d('0x49')]=_[_0x071d('0x4b')](_0x2de0d2['model'],_0x2de0d2['query']);_0x509027[_0x071d('0x4a')]=_[_0x071d('0x4b')](_0x2de0d2['model'],qs[_0x071d('0x4d')](_0x1fa141[_0x071d('0x47')][_0x071d('0x4d')]));_0x509027['attributes']=_0x509027[_0x071d('0x4a')][_0x071d('0x4e')]?_0x509027[_0x071d('0x4a')]:_0x2de0d2[_0x071d('0x4c')];if(_0x1fa141['query'][_0x071d('0x58')]){_0x509027[_0x071d('0x59')]=[{'all':!![]}];}_0x509027=_[_0x071d('0x55')]({},_0x509027,_0x1fa141['options']);return db[_0x071d('0x43')][_0x071d('0x5f')](_0x509027)['then'](handleEntityNotFound(_0x11e292,null))[_0x071d('0x20')](respondWithResult(_0x11e292,null))['catch'](handleError(_0x11e292,null));};exports[_0x071d('0x36')]=function(_0x45be8a,_0x172242){if(_0x45be8a[_0x071d('0x60')]['id']){delete _0x45be8a['body']['id'];}return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x45be8a[_0x071d('0x5d')]['id']},'include':[{'model':db[_0x071d('0x3d')],'as':'Imap'},{'model':db[_0x071d('0x3f')],'as':_0x071d('0x40')},{'model':db[_0x071d('0x5e')],'as':'mandatoryDispositionPause'}]})[_0x071d('0x20')](handleEntityNotFound(_0x172242,null))['then'](saveUpdates(_0x45be8a[_0x071d('0x60')],null))[_0x071d('0x20')](function(_0x45b40d){if(_0x45b40d&&_0x45be8a[_0x071d('0x60')][_0x071d('0x3e')]){return db[_0x071d('0x3d')][_0x071d('0x36')](_0x45be8a['body'][_0x071d('0x3e')],{'where':{'MailAccountId':_0x45b40d['id']}})[_0x071d('0x20')](function(){return _0x45b40d;});}return _0x45b40d;})[_0x071d('0x20')](function(_0x42a5d3){if(_0x42a5d3&&_0x45be8a[_0x071d('0x60')][_0x071d('0x40')]){return db[_0x071d('0x3f')][_0x071d('0x36')](_0x45be8a[_0x071d('0x60')][_0x071d('0x40')],{'where':{'MailAccountId':_0x42a5d3['id']}})['then'](function(){return _0x42a5d3;});}return _0x42a5d3;})[_0x071d('0x20')](respondWithResult(_0x172242,null))[_0x071d('0x2a')](handleError(_0x172242,null));};exports[_0x071d('0x61')]=function(_0x565350,_0x376807){return db[_0x071d('0x43')][_0x071d('0x61')]()[_0x071d('0x20')](respondWithResult(_0x376807,null))[_0x071d('0x2a')](handleError(_0x376807,null));};exports[_0x071d('0x62')]=function(_0x47a2a5,_0x53335b,_0x514d47){if(_0x47a2a5[_0x071d('0x60')]['id']){delete _0x47a2a5[_0x071d('0x60')]['id'];}return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x47a2a5[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x53335b,null))[_0x071d('0x20')](function(_0xee895a){if(_0xee895a){_0x47a2a5[_0x071d('0x60')][_0x071d('0x63')]=_0xee895a['id'];return db[_0x071d('0x64')][_0x071d('0x65')](_0x47a2a5[_0x071d('0x60')]);}})[_0x071d('0x20')](respondWithResult(_0x53335b,null))['catch'](handleError(_0x53335b,null));};exports[_0x071d('0x66')]=function(_0x198f68,_0x15b489,_0x4c2c93){var _0x4ba614={'raw':![],'where':{}};var _0xb09a53={};var _0x2cc82c={'count':0x0,'rows':[]};return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x198f68[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x15b489,null))[_0x071d('0x20')](function(_0x9350a6){if(_0x9350a6){_0xb09a53[_0x071d('0x4c')]=_[_0x071d('0x48')](db[_0x071d('0x64')][_0x071d('0x68')]);_0xb09a53['query']=_[_0x071d('0x48')](_0x198f68[_0x071d('0x47')]);_0xb09a53[_0x071d('0x49')]=_[_0x071d('0x4b')](_0xb09a53[_0x071d('0x4c')],_0xb09a53[_0x071d('0x47')]);_0x4ba614[_0x071d('0x4a')]=_['intersection'](_0xb09a53[_0x071d('0x4c')],qs[_0x071d('0x4d')](_0x198f68[_0x071d('0x47')]['fields']));_0x4ba614[_0x071d('0x4a')]=_0x4ba614['attributes'][_0x071d('0x4e')]?_0x4ba614[_0x071d('0x4a')]:_0xb09a53['model'];if(!_0x198f68[_0x071d('0x47')][_0x071d('0x4f')](_0x071d('0x50'))){_0x4ba614[_0x071d('0x30')]=qs['limit'](_0x198f68[_0x071d('0x47')][_0x071d('0x30')]);_0x4ba614['offset']=qs[_0x071d('0x2e')](_0x198f68[_0x071d('0x47')][_0x071d('0x2e')]);}_0x4ba614[_0x071d('0x69')]=qs[_0x071d('0x51')](_0x198f68[_0x071d('0x47')][_0x071d('0x51')]);_0x4ba614[_0x071d('0x52')]=qs['filters'](_['pick'](_0x198f68['query'],_0xb09a53[_0x071d('0x49')]));_0x4ba614[_0x071d('0x52')][_0x071d('0x63')]=_0x9350a6['id'];if(_0x198f68[_0x071d('0x47')][_0x071d('0x54')]){_0x4ba614[_0x071d('0x52')]=_[_0x071d('0x55')](_0x4ba614[_0x071d('0x52')],{'$or':_[_0x071d('0x42')](_0x4ba614['attributes'],function(_0x2d8be0){var _0x199750={};_0x199750[_0x2d8be0]={'$like':'%'+_0x198f68['query'][_0x071d('0x54')]+'%'};return _0x199750;})});}_0x4ba614=_[_0x071d('0x55')]({},_0x4ba614,_0x198f68[_0x071d('0x57')]);return db[_0x071d('0x64')]['count']({'where':_0x4ba614[_0x071d('0x52')]})['then'](function(_0x42236e){_0x2cc82c[_0x071d('0x31')]=_0x42236e;if(_0x198f68['query'][_0x071d('0x58')]){_0x4ba614[_0x071d('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x071d('0x5a')](_0x4ba614);})['then'](function(_0x58d064){_0x2cc82c[_0x071d('0x5b')]=_0x58d064;return _0x2cc82c;});}})[_0x071d('0x20')](respondWithFilteredResult(_0x15b489,_0x4ba614))['catch'](handleError(_0x15b489,null));};exports['removeDispositions']=function(_0x4feb03,_0x3fc37a,_0xafc6c0){return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x4feb03[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x3fc37a,null))[_0x071d('0x20')](function(_0x4ac880){if(_0x4ac880){return _0x4ac880[_0x071d('0x6a')](_0x4feb03[_0x071d('0x47')][_0x071d('0x6b')]);}})[_0x071d('0x20')](respondWithStatusCode(_0x3fc37a,null))[_0x071d('0x2a')](handleError(_0x3fc37a,null));};exports[_0x071d('0x6c')]=function(_0x4ed6af,_0x544228,_0x3a2ac0){if(_0x4ed6af[_0x071d('0x60')]['id']){delete _0x4ed6af[_0x071d('0x60')]['id'];}return db[_0x071d('0x43')]['find']({'where':{'id':_0x4ed6af[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x544228,null))[_0x071d('0x20')](function(_0x24285b){if(_0x24285b){_0x4ed6af[_0x071d('0x60')]['MailAccountId']=_0x24285b['id'];return db[_0x071d('0x6d')][_0x071d('0x65')](_0x4ed6af[_0x071d('0x60')]);}})[_0x071d('0x20')](respondWithResult(_0x544228,null))[_0x071d('0x2a')](handleError(_0x544228,null));};exports[_0x071d('0x6e')]=function(_0x2acd7f,_0x11154b,_0x444cec){var _0x291780={'raw':![],'where':{}};var _0x5792b7={};var _0x3d856d={'count':0x0,'rows':[]};return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x2acd7f[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x11154b,null))[_0x071d('0x20')](function(_0xce0cc6){if(_0xce0cc6){_0x5792b7[_0x071d('0x4c')]=_[_0x071d('0x48')](db[_0x071d('0x6d')][_0x071d('0x68')]);_0x5792b7[_0x071d('0x47')]=_[_0x071d('0x48')](_0x2acd7f['query']);_0x5792b7[_0x071d('0x49')]=_[_0x071d('0x4b')](_0x5792b7[_0x071d('0x4c')],_0x5792b7[_0x071d('0x47')]);_0x291780['attributes']=_[_0x071d('0x4b')](_0x5792b7['model'],qs['fields'](_0x2acd7f[_0x071d('0x47')][_0x071d('0x4d')]));_0x291780[_0x071d('0x4a')]=_0x291780[_0x071d('0x4a')][_0x071d('0x4e')]?_0x291780[_0x071d('0x4a')]:_0x5792b7[_0x071d('0x4c')];if(!_0x2acd7f['query'][_0x071d('0x4f')]('nolimit')){_0x291780[_0x071d('0x30')]=qs[_0x071d('0x30')](_0x2acd7f[_0x071d('0x47')][_0x071d('0x30')]);_0x291780['offset']=qs[_0x071d('0x2e')](_0x2acd7f['query'][_0x071d('0x2e')]);}_0x291780[_0x071d('0x69')]=qs['sort'](_0x2acd7f[_0x071d('0x47')][_0x071d('0x51')]);_0x291780[_0x071d('0x52')]=qs[_0x071d('0x49')](_['pick'](_0x2acd7f[_0x071d('0x47')],_0x5792b7['filters']));_0x291780[_0x071d('0x52')][_0x071d('0x63')]=_0xce0cc6['id'];if(_0x2acd7f['query'][_0x071d('0x54')]){_0x291780[_0x071d('0x52')]=_[_0x071d('0x55')](_0x291780[_0x071d('0x52')],{'$or':_[_0x071d('0x42')](_0x291780['attributes'],function(_0x4e8083){var _0x3c2d05={};_0x3c2d05[_0x4e8083]={'$like':'%'+_0x2acd7f[_0x071d('0x47')][_0x071d('0x54')]+'%'};return _0x3c2d05;})});}_0x291780=_[_0x071d('0x55')]({},_0x291780,_0x2acd7f[_0x071d('0x57')]);return db[_0x071d('0x6d')]['count']({'where':_0x291780[_0x071d('0x52')]})['then'](function(_0x4c9a54){_0x3d856d[_0x071d('0x31')]=_0x4c9a54;if(_0x2acd7f[_0x071d('0x47')][_0x071d('0x58')]){_0x291780['include']=[{'all':!![]}];}return db[_0x071d('0x6d')][_0x071d('0x5a')](_0x291780);})[_0x071d('0x20')](function(_0x3887a4){_0x3d856d[_0x071d('0x5b')]=_0x3887a4;return _0x3d856d;});}})[_0x071d('0x20')](respondWithFilteredResult(_0x11154b,_0x291780))['catch'](handleError(_0x11154b,null));};exports['removeAnswers']=function(_0x5e07cd,_0x132db2,_0x54f346){return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x5e07cd['params']['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x132db2,null))[_0x071d('0x20')](function(_0xc37142){if(_0xc37142){return _0xc37142[_0x071d('0x6f')](_0x5e07cd[_0x071d('0x47')][_0x071d('0x6b')]);}})[_0x071d('0x20')](respondWithStatusCode(_0x132db2,null))[_0x071d('0x2a')](handleError(_0x132db2,null));};exports[_0x071d('0x65')]=function(_0x31fcf8,_0x6655bd){var _0x273c29={'name':_0x31fcf8['body']['name'],'key':_0x31fcf8[_0x071d('0x60')]['key'],'email':_0x31fcf8[_0x071d('0x60')][_0x071d('0x70')],'ListId':_0x31fcf8[_0x071d('0x60')][_0x071d('0x71')],'active':!_['isNil'](_0x31fcf8[_0x071d('0x60')][_0x071d('0x72')])?_0x31fcf8[_0x071d('0x60')][_0x071d('0x72')]:!![],'description':_0x31fcf8[_0x071d('0x60')][_0x071d('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0x071d('0x74')](_0x31fcf8[_0x071d('0x60')][_0x071d('0x75')])){if(_0x31fcf8[_0x071d('0x60')][_0x071d('0x76')]){_0x273c29['Imap'][_0x071d('0x77')]=_0x273c29[_0x071d('0x40')]['user']=_0x31fcf8[_0x071d('0x60')][_0x071d('0x78')];_0x273c29[_0x071d('0x3e')][_0x071d('0x79')]=_0x273c29[_0x071d('0x40')][_0x071d('0x7a')]=_0x31fcf8['body'][_0x071d('0x7b')];}else{_0x273c29[_0x071d('0x3e')][_0x071d('0x7c')]=_0x273c29['Smtp'][_0x071d('0x7c')]=![];}_0x273c29[_0x071d('0x3e')][_0x071d('0x7d')]=_0x31fcf8[_0x071d('0x60')][_0x071d('0x3e')]['host'];_0x273c29['Imap'][_0x071d('0x7e')]=_0x31fcf8[_0x071d('0x60')]['Imap'][_0x071d('0x7e')];_0x273c29['Smtp'][_0x071d('0x7d')]=_0x31fcf8[_0x071d('0x60')][_0x071d('0x40')][_0x071d('0x7d')];_0x273c29[_0x071d('0x40')][_0x071d('0x7e')]=_0x31fcf8[_0x071d('0x60')][_0x071d('0x40')][_0x071d('0x7e')];}else{_0x273c29['Imap'][_0x071d('0x7f')]=_0x273c29[_0x071d('0x40')]['service']=_0x31fcf8['body'][_0x071d('0x75')];_0x273c29['Imap']['user']=_0x273c29[_0x071d('0x40')][_0x071d('0x77')]=_0x31fcf8[_0x071d('0x60')][_0x071d('0x78')];_0x273c29[_0x071d('0x3e')][_0x071d('0x79')]=_0x273c29[_0x071d('0x40')]['pass']=_0x31fcf8['body'][_0x071d('0x7b')];}return db[_0x071d('0x43')][_0x071d('0x65')](_0x273c29,{'include':[{'model':db[_0x071d('0x3f')],'as':_0x071d('0x40')},{'model':db[_0x071d('0x3d')],'as':_0x071d('0x3e')}]})['then'](function(_0xa5144){var _0x5a8bf5=_0x31fcf8[_0x071d('0x77')][_0x071d('0x80')]({'plain':!![]});if(!_0x5a8bf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a8bf5[_0x071d('0x81')]===_0x071d('0x77')){var _0xf07221=_0xa5144[_0x071d('0x80')]({'plain':!![]});return db['UserProfileSection'][_0x071d('0x5f')]({'where':{'name':_0x071d('0x82'),'userProfileId':_0x5a8bf5['userProfileId']},'raw':!![]})[_0x071d('0x20')](function(_0x32d600){if(_0x32d600&&_0x32d600['autoAssociation']===0x0){return db[_0x071d('0x37')][_0x071d('0x65')]({'name':_0xf07221['name'],'resourceId':_0xf07221['id'],'type':_0x32d600[_0x071d('0x3a')],'sectionId':_0x32d600['id']},{})[_0x071d('0x20')](function(){return _0xa5144;});}else{return _0xa5144;}})[_0x071d('0x2a')](function(_0x46ec5a){logger[_0x071d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46ec5a);throw _0x46ec5a;});}return _0xa5144;})[_0x071d('0x20')](respondWithResult(_0x6655bd,0xc9))[_0x071d('0x2a')](handleError(_0x6655bd,null));};exports[_0x071d('0x83')]=function(_0x1afb88,_0x27fcc8,_0x3cac71){return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x1afb88[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x27fcc8,null))[_0x071d('0x20')](function(_0x13ceea){if(_0x13ceea){return _0x13ceea['getImap']();}return null;})[_0x071d('0x20')](respondWithResult(_0x27fcc8,null))['catch'](handleError(_0x27fcc8,null));};exports['addImap']=function(_0xc3a2de,_0xc2eee,_0x21283d){if(_0xc3a2de[_0x071d('0x60')]['id']){delete _0xc3a2de['body']['id'];}return db[_0x071d('0x43')]['find']({'where':{'id':_0xc3a2de[_0x071d('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc2eee,null))[_0x071d('0x20')](function(_0xaaf731){if(_0xaaf731){_0xc3a2de[_0x071d('0x60')][_0x071d('0x63')]=_0xaaf731['id'];return db['MailServerIn'][_0x071d('0x65')](_0xc3a2de[_0x071d('0x60')]);}})[_0x071d('0x20')](respondWithResult(_0xc2eee,null))[_0x071d('0x2a')](handleError(_0xc2eee,null));};exports[_0x071d('0x84')]=function(_0xe13132,_0xf085d8,_0xe9b007){return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0xe13132[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0xf085d8,null))['then'](function(_0xa60300){if(_0xa60300){return _0xa60300[_0x071d('0x85')](null);}return null;})['then'](respondWithStatusCode(_0xf085d8,null))[_0x071d('0x2a')](handleError(_0xf085d8,null));};exports[_0x071d('0x86')]=function(_0x5d5b48,_0x2ee9fa,_0x2c8937){return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x5d5b48[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x2ee9fa,null))['then'](function(_0x3def83){if(_0x3def83){return _0x3def83[_0x071d('0x86')]();}return null;})['then'](respondWithResult(_0x2ee9fa,null))[_0x071d('0x2a')](handleError(_0x2ee9fa,null));};exports[_0x071d('0x87')]=function(_0x151c32,_0xebf02f,_0xedc32c){if(_0x151c32[_0x071d('0x60')]['id']){delete _0x151c32[_0x071d('0x60')]['id'];}return db['MailAccount'][_0x071d('0x5f')]({'where':{'id':_0x151c32['params']['id']}})['then'](handleEntityNotFound(_0xebf02f,null))[_0x071d('0x20')](function(_0x23863b){if(_0x23863b){_0x151c32[_0x071d('0x60')][_0x071d('0x63')]=_0x23863b['id'];return db[_0x071d('0x3f')][_0x071d('0x65')](_0x151c32[_0x071d('0x60')]);}})[_0x071d('0x20')](respondWithResult(_0xebf02f,null))['catch'](handleError(_0xebf02f,null));};exports[_0x071d('0x88')]=function(_0xddc18d,_0x5e78d9,_0x1d4435){return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0xddc18d['params']['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x5e78d9,null))[_0x071d('0x20')](function(_0x1563c8){if(_0x1563c8){return _0x1563c8[_0x071d('0x89')](null);}return null;})[_0x071d('0x20')](respondWithStatusCode(_0x5e78d9,null))[_0x071d('0x2a')](handleError(_0x5e78d9,null));};exports['addInteraction']=function(_0x342edf,_0x4db4b7,_0xebd1d9){return db[_0x071d('0x8a')][_0x071d('0x5f')]({'where':{'id':_0x342edf['params']['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x4db4b7,null))['then'](function(_0x90cdd2){if(_0x90cdd2){return _0x90cdd2[_0x071d('0x8b')](_0x342edf[_0x071d('0x60')]['ids'],_[_0x071d('0x8c')](_0x342edf[_0x071d('0x60')],[_0x071d('0x6b'),'id'])||{});}})[_0x071d('0x20')](respondWithResult(_0x4db4b7,null))[_0x071d('0x2a')](handleError(_0x4db4b7,null));};exports['getInteractions']=function(_0x3f885a,_0x196185,_0x1688cd){var _0x4dac0f={'raw':![],'where':{}};var _0x248bff={};var _0x3e9013={'count':0x0,'rows':[]};return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x3f885a[_0x071d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x196185,null))[_0x071d('0x20')](function(_0x43342f){if(_0x43342f){_0x248bff['model']=_[_0x071d('0x48')](db[_0x071d('0x8a')][_0x071d('0x68')]);_0x248bff[_0x071d('0x47')]=_[_0x071d('0x48')](_0x3f885a['query']);_0x248bff[_0x071d('0x49')]=_[_0x071d('0x4b')](_0x248bff['model'],_0x248bff[_0x071d('0x47')]);_0x4dac0f[_0x071d('0x4a')]=_['intersection'](_0x248bff[_0x071d('0x4c')],qs['fields'](_0x3f885a[_0x071d('0x47')][_0x071d('0x4d')]));_0x4dac0f['attributes']=_0x4dac0f[_0x071d('0x4a')][_0x071d('0x4e')]?_0x4dac0f[_0x071d('0x4a')]:_0x248bff[_0x071d('0x4c')];if(!_0x3f885a[_0x071d('0x47')]['hasOwnProperty'](_0x071d('0x50'))){_0x4dac0f[_0x071d('0x30')]=qs['limit'](_0x3f885a['query'][_0x071d('0x30')]);_0x4dac0f[_0x071d('0x2e')]=qs['offset'](_0x3f885a[_0x071d('0x47')][_0x071d('0x2e')]);}_0x4dac0f[_0x071d('0x69')]=qs[_0x071d('0x51')](_0x3f885a[_0x071d('0x47')][_0x071d('0x51')]);_0x4dac0f[_0x071d('0x52')]=qs['filters'](_[_0x071d('0x53')](_0x3f885a[_0x071d('0x47')],_0x248bff[_0x071d('0x49')]));_0x4dac0f[_0x071d('0x52')]['MailAccountId']=_0x43342f['id'];if(_0x3f885a[_0x071d('0x47')][_0x071d('0x54')]){_0x4dac0f['where']=_[_0x071d('0x55')](_0x4dac0f[_0x071d('0x52')],{'$or':_[_0x071d('0x42')](_0x4dac0f['attributes'],function(_0x33b899){var _0x2f1046={};_0x2f1046[_0x33b899]={'$like':'%'+_0x3f885a[_0x071d('0x47')]['filter']+'%'};return _0x2f1046;})});}_0x4dac0f=_[_0x071d('0x55')]({},_0x4dac0f,_0x3f885a[_0x071d('0x57')]);return db['MailInteraction'][_0x071d('0x31')]({'where':_0x4dac0f[_0x071d('0x52')]})['then'](function(_0x24828a){_0x3e9013['count']=_0x24828a;if(_0x3f885a[_0x071d('0x47')][_0x071d('0x58')]){_0x4dac0f[_0x071d('0x59')]=[{'model':db[_0x071d('0x8d')],'as':'Contact','required':![]},{'model':db[_0x071d('0x8e')],'as':_0x071d('0x8f'),'attributes':[_0x071d('0x3a'),_0x071d('0x90'),_0x071d('0x91')],'required':![]},{'model':db[_0x071d('0x92')],'as':_0x071d('0x93'),'attributes':['id','name',_0x071d('0x94')],'where':_0x3f885a['query'][_0x071d('0x95')]?{'id':_0x3f885a[_0x071d('0x47')][_0x071d('0x95')]}:undefined,'required':_0x3f885a[_0x071d('0x47')][_0x071d('0x95')]?!![]:![]}];}return db[_0x071d('0x8a')][_0x071d('0x5a')](_0x4dac0f);})[_0x071d('0x20')](function(_0x406c7e){_0x3e9013[_0x071d('0x5b')]=_0x406c7e;return _0x3e9013;});}})[_0x071d('0x20')](respondWithFilteredResult(_0x196185,_0x4dac0f))[_0x071d('0x2a')](handleError(_0x196185,null));};exports[_0x071d('0x96')]=function(_0x49fd1d,_0x2d3e63,_0x40fd21){return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x49fd1d['params']['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x2d3e63,null))[_0x071d('0x20')](function(_0x42debf){if(_0x42debf){return db[_0x071d('0x97')][_0x071d('0x98')](function(_0x91cba4){return db[_0x071d('0x99')][_0x071d('0x38')]({'where':{'MailAccountId':_0x49fd1d[_0x071d('0x5d')]['id']},'transaction':_0x91cba4})[_0x071d('0x20')](function(_0x3cdd23){var _0x40092d=_['map'](_0x49fd1d[_0x071d('0x60')],function(_0x1b6963){_0x1b6963[_0x071d('0x63')]=_0x49fd1d[_0x071d('0x5d')]['id'];return _0x1b6963;});return db[_0x071d('0x99')][_0x071d('0x9a')](_0x40092d,{'transaction':_0x91cba4});});})[_0x071d('0x20')](function(){return db[_0x071d('0x99')][_0x071d('0x9b')]({'where':{'MailAccountId':_0x49fd1d[_0x071d('0x5d')]['id']},'order':_0x071d('0x9c')});});}})[_0x071d('0x20')](respondWithResult(_0x2d3e63,null))[_0x071d('0x2a')](handleError(_0x2d3e63,null));};exports[_0x071d('0x9d')]=function(_0x37da3e,_0x34f321,_0x11b8c9){var _0x1945e4={};var _0x213dd9={};var _0x14a0da;var _0x2b93c0;return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x37da3e[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x34f321,null))['then'](function(_0x1be6b5){if(_0x1be6b5){_0x14a0da=_0x1be6b5;_0x213dd9[_0x071d('0x4c')]=_[_0x071d('0x48')](db[_0x071d('0x99')][_0x071d('0x68')]);_0x213dd9[_0x071d('0x47')]=_[_0x071d('0x48')](_0x37da3e[_0x071d('0x47')]);_0x213dd9['filters']=_[_0x071d('0x4b')](_0x213dd9[_0x071d('0x4c')],_0x213dd9[_0x071d('0x47')]);_0x1945e4[_0x071d('0x4a')]=_['intersection'](_0x213dd9[_0x071d('0x4c')],qs['fields'](_0x37da3e[_0x071d('0x47')][_0x071d('0x4d')]));_0x1945e4['attributes']=_0x1945e4[_0x071d('0x4a')]['length']?_0x1945e4[_0x071d('0x4a')]:_0x213dd9['model'];_0x1945e4[_0x071d('0x69')]=qs[_0x071d('0x51')](_0x37da3e['query'][_0x071d('0x51')]);_0x1945e4[_0x071d('0x52')]=qs['filters'](_[_0x071d('0x53')](_0x37da3e[_0x071d('0x47')],_0x213dd9[_0x071d('0x49')]));if(_0x37da3e[_0x071d('0x47')][_0x071d('0x54')]){_0x1945e4[_0x071d('0x52')]=_['merge'](_0x1945e4[_0x071d('0x52')],{'$or':_['map'](_0x1945e4['attributes'],function(_0x36da64){var _0x926321={};_0x926321[_0x36da64]={'$like':'%'+_0x37da3e[_0x071d('0x47')]['filter']+'%'};return _0x926321;})});}_0x1945e4=_[_0x071d('0x55')]({},_0x1945e4,_0x37da3e[_0x071d('0x57')]);return _0x14a0da['getApplications'](_0x1945e4);}})[_0x071d('0x20')](function(_0x36c930){if(_0x36c930){_0x2b93c0=_0x36c930[_0x071d('0x4e')];if(!_0x37da3e[_0x071d('0x47')]['hasOwnProperty'](_0x071d('0x50'))){_0x1945e4[_0x071d('0x30')]=qs[_0x071d('0x30')](_0x37da3e[_0x071d('0x47')][_0x071d('0x30')]);_0x1945e4[_0x071d('0x2e')]=qs[_0x071d('0x2e')](_0x37da3e[_0x071d('0x47')][_0x071d('0x2e')]);}return _0x14a0da[_0x071d('0x9d')](_0x1945e4);}})[_0x071d('0x20')](function(_0x4b7500){if(_0x4b7500){return _0x4b7500?{'count':_0x2b93c0,'rows':_0x4b7500}:null;}})[_0x071d('0x20')](respondWithResult(_0x34f321,null))[_0x071d('0x2a')](handleError(_0x34f321,null));};exports['getMessages']=function(_0x50054b,_0x475a98,_0x42e08d){var _0x380db5={'raw':!![],'where':{}};var _0x263389={};var _0x385310={'count':0x0,'rows':[]};return db['MailAccount'][_0x071d('0x67')]({'where':{'id':_0x50054b[_0x071d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x475a98,null))[_0x071d('0x20')](function(_0x55109a){if(_0x55109a){_0x263389[_0x071d('0x4c')]=_[_0x071d('0x48')](db[_0x071d('0x9e')][_0x071d('0x68')]);_0x263389[_0x071d('0x47')]=_[_0x071d('0x48')](_0x50054b[_0x071d('0x47')]);_0x263389['filters']=_['intersection'](_0x263389[_0x071d('0x4c')],_0x263389[_0x071d('0x47')]);_0x380db5[_0x071d('0x4a')]=_[_0x071d('0x4b')](_0x263389['model'],qs['fields'](_0x50054b[_0x071d('0x47')][_0x071d('0x4d')]));_0x380db5['attributes']=_0x380db5[_0x071d('0x4a')][_0x071d('0x4e')]?_0x380db5[_0x071d('0x4a')]:_0x263389[_0x071d('0x4c')];if(!_0x50054b['query'][_0x071d('0x4f')]('nolimit')){_0x380db5[_0x071d('0x30')]=qs[_0x071d('0x30')](_0x50054b[_0x071d('0x47')][_0x071d('0x30')]);_0x380db5[_0x071d('0x2e')]=qs[_0x071d('0x2e')](_0x50054b['query']['offset']);}_0x380db5['order']=qs['sort'](_0x50054b['query']['sort']);_0x380db5[_0x071d('0x52')]=qs['filters'](_[_0x071d('0x53')](_0x50054b['query'],_0x263389[_0x071d('0x49')]));_0x380db5[_0x071d('0x52')][_0x071d('0x63')]=_0x55109a['id'];if(_0x50054b['query'][_0x071d('0x54')]){_0x380db5[_0x071d('0x52')]=_[_0x071d('0x55')](_0x380db5[_0x071d('0x52')],{'$or':_[_0x071d('0x42')](_0x380db5[_0x071d('0x4a')],function(_0x127050){var _0x5cd5a8={};_0x5cd5a8[_0x127050]={'$like':'%'+_0x50054b[_0x071d('0x47')][_0x071d('0x54')]+'%'};return _0x5cd5a8;})});}if(_0x50054b[_0x071d('0x47')][_0x071d('0x9f')]){var _0x3433a4=_0x50054b[_0x071d('0x47')]['$gte'][_0x071d('0xa0')](',');var _0x206fb1={};_0x206fb1[_0x3433a4[0x0]]={'$gte':moment(_0x3433a4[0x1])[_0x071d('0xa1')](_0x071d('0xa2'))};_0x380db5['where']=_[_0x071d('0x55')](_0x380db5['where'],_0x206fb1);}_0x380db5=_['merge']({},_0x380db5,_0x50054b[_0x071d('0x57')]);return db[_0x071d('0x9e')][_0x071d('0x31')]({'where':_0x380db5[_0x071d('0x52')]})[_0x071d('0x20')](function(_0xdb8a4f){_0x385310[_0x071d('0x31')]=_0xdb8a4f;if(_0x50054b[_0x071d('0x47')][_0x071d('0x58')]){_0x380db5[_0x071d('0x59')]=[{'all':!![]}];}return db['MailMessage'][_0x071d('0x5a')](_0x380db5);})[_0x071d('0x20')](function(_0x5b5300){if(_0x50054b['query'][_0x071d('0xa3')]===_0x071d('0xa4')){for(var _0x53cdfa=0x0;_0x53cdfa<_0x5b5300[_0x071d('0x4e')];_0x53cdfa++){_0x5b5300[_0x53cdfa][_0x071d('0x60')]=juice(_0x5b5300[_0x53cdfa][_0x071d('0x60')]);}}_0x385310[_0x071d('0x5b')]=_0x5b5300;return _0x385310;});}})['then'](respondWithFilteredResult(_0x475a98,_0x380db5))['catch'](handleError(_0x475a98,null));};exports[_0x071d('0x3b')]=function(_0x32e4ad,_0x431a9a,_0x496513){var _0x1e67b3,_0x2d140a={},_0x301f83;if(_0x32e4ad[_0x071d('0x60')]['to']){_0x301f83=_0x32e4ad[_0x071d('0x60')]['to']['split'](',')[0x0];}return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x32e4ad[_0x071d('0x5d')]['id']},'include':[{'model':db[_0x071d('0xa5')],'as':_0x071d('0xa6'),'include':[{'model':db[_0x071d('0x8d')],'as':_0x071d('0xa7'),'where':{'email':_0x301f83},'limit':0x1,'order':[[_0x071d('0xa8'),_0x071d('0xa9')]]}]},{'model':db['MailServerOut'],'as':_0x071d('0x40'),'raw':!![]}]})['then'](handleEntityNotFound(_0x431a9a,null))[_0x071d('0x20')](function(_0x419181){if(_0x419181){_0x1e67b3=_0x419181;if(_0x419181[_0x071d('0x40')]){if(_[_0x071d('0x74')](_0x32e4ad['body'][_0x071d('0xaa')])){_0x32e4ad[_0x071d('0x60')]['from']=util[_0x071d('0xa1')](_0x071d('0xab'),_0x419181['name'],_0x419181['email']||_0x419181['Smtp'][_0x071d('0x77')]);}if(_0x32e4ad['body'][_0x071d('0xac')]&&_0x32e4ad['body'][_0x071d('0xac')]['length']){for(var _0x36bb1b=0x0;_0x36bb1b<_0x32e4ad[_0x071d('0x60')][_0x071d('0xac')][_0x071d('0x4e')];_0x36bb1b+=0x1){_0x32e4ad[_0x071d('0x60')][_0x071d('0xac')][_0x36bb1b]={'filename':_0x32e4ad[_0x071d('0x60')]['attachments'][_0x36bb1b][_0x071d('0x3a')],'path':path[_0x071d('0xad')](config['root'],_0x071d('0xae'),_0x32e4ad[_0x071d('0x60')][_0x071d('0xac')][_0x36bb1b]['basename'])};}}var _0x16b291={'tls':{'rejectUnauthorized':![]}};if(_[_0x071d('0x74')](_0x419181['Smtp'][_0x071d('0x7f')])){if(_0x419181[_0x071d('0x40')][_0x071d('0x7c')]){_0x16b291['auth']={'user':_0x419181['Smtp'][_0x071d('0x77')],'pass':_0x419181[_0x071d('0x40')]['pass']};}_0x16b291[_0x071d('0x7d')]=_0x419181[_0x071d('0x40')][_0x071d('0x7d')];_0x16b291['port']=_0x419181[_0x071d('0x40')][_0x071d('0x7e')];_0x16b291[_0x071d('0xaf')]=_0x419181['Smtp']['secure'];}else{_0x16b291[_0x071d('0x7f')]=_0x419181[_0x071d('0x40')][_0x071d('0x7f')];_0x16b291[_0x071d('0xb0')]={'user':_0x419181[_0x071d('0x40')][_0x071d('0x77')],'pass':_0x419181['Smtp'][_0x071d('0x7a')]};}return respondWithRpcPromise(_0x071d('0xb1'),_0x071d('0xb2'),{'account':_0x16b291,'message':_0x32e4ad[_0x071d('0x60')]});}else{throw new Error('List\x20not\x20found');}}})[_0x071d('0x20')](function(_0x21cd3e){if(_0x21cd3e){_0x2d140a=_0x21cd3e;if(_0x1e67b3[_0x071d('0xa6')]){if(_0x1e67b3[_0x071d('0xa6')]['Contacts'][_0x071d('0x4e')]){return _0x1e67b3[_0x071d('0xa6')][_0x071d('0xa7')][0x0];}else{return db[_0x071d('0x8d')]['create'](_[_0x071d('0x18')](_0x32e4ad['body'],{'firstName':_0x32e4ad[_0x071d('0x60')]['to'],'email':_0x32e4ad[_0x071d('0x60')]['to'],'phone':_0x32e4ad[_0x071d('0x60')]['to'],'ListId':_0x1e67b3[_0x071d('0x71')]}));}}else{throw new Error(_0x071d('0xb3'));}}})[_0x071d('0x20')](function(_0x163b8f){if(_0x163b8f){var _0x2403d0={'UserId':_0x32e4ad[_0x071d('0x77')]['id'],'ContactId':_0x163b8f['id'],'MailAccountId':_0x1e67b3['id'],'inReplyTo':_0x2d140a['messageId'],'to':_0x32e4ad[_0x071d('0x60')]['from'],'cc':_0x32e4ad[_0x071d('0x60')]['cc'],'subject':_0x32e4ad[_0x071d('0x60')][_0x071d('0xb4')],'attach':_0x32e4ad[_0x071d('0x60')][_0x071d('0xb5')],'firstMsgDirection':_0x071d('0xb6'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x071d('0xb6'),'Messages':[_[_0x071d('0x55')](_0x32e4ad[_0x071d('0x60')],{'messageId':_0x2d140a[_0x071d('0xb7')],'sentAt':moment()[_0x071d('0xa1')](_0x071d('0xa2')),'read':!![],'MailAccountId':_0x1e67b3['id'],'UserId':_0x32e4ad[_0x071d('0x77')]['id'],'ContactId':_0x163b8f['id']})]};if(_0x32e4ad[_0x071d('0x60')][_0x071d('0xb8')]){_0x2403d0=_[_0x071d('0x55')](_0x2403d0,_0x32e4ad[_0x071d('0x60')]['Interaction']);}return db['MailInteraction'][_0x071d('0x65')](_0x2403d0,{'include':[{'model':db['MailMessage'],'as':_0x071d('0xb9')}]});}})['then'](respondWithResult(_0x431a9a,null))[_0x071d('0x2a')](handleError(_0x431a9a,null));};exports[_0x071d('0xba')]=function(_0x5cdf39,_0x18842c,_0x5ff9ea){return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x5cdf39[_0x071d('0x5d')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x071d('0x40'),'raw':!![]}]})[_0x071d('0x20')](handleEntityNotFound(_0x18842c,null))[_0x071d('0x20')](function(_0x298a33){if(_0x298a33&&_0x298a33[_0x071d('0x40')]){var _0x2db17f={'id':_0x298a33['id'],'tls':{'rejectUnauthorized':![]}};if(_0x298a33['Smtp'][_0x071d('0x7f')]){_0x2db17f[_0x071d('0x7f')]=_0x298a33[_0x071d('0x40')][_0x071d('0x7f')];}else{_0x2db17f[_0x071d('0x7d')]=_0x298a33[_0x071d('0x40')][_0x071d('0x7d')];_0x2db17f[_0x071d('0x7e')]=_0x298a33[_0x071d('0x40')][_0x071d('0x7e')];_0x2db17f['secure']=_0x298a33['Smtp'][_0x071d('0xaf')];}if(_0x298a33[_0x071d('0x40')][_0x071d('0x7c')]){_0x2db17f['auth']={'user':_0x298a33[_0x071d('0x40')][_0x071d('0x77')],'pass':_0x298a33[_0x071d('0x40')]['pass']};}return respondWithRpcPromise('VerifySmtp',_0x071d('0xba'),{'account':_0x2db17f});}})[_0x071d('0x20')](respondWithResult(_0x18842c,null))[_0x071d('0x2a')](handleError(_0x18842c,null));};exports[_0x071d('0x38')]=function(_0x47d214,_0x4bac0f){return db[_0x071d('0x43')]['find']({'where':{'id':_0x47d214[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x4bac0f,null))[_0x071d('0x20')](function(_0x2a86ab){if(_0x2a86ab&&_0x2a86ab[_0x071d('0x7f')]){throw new db['Sequelize'][(_0x071d('0xbb'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x2a86ab;})[_0x071d('0x20')](removeEntity(_0x4bac0f,null))[_0x071d('0x2a')](handleError(_0x4bac0f,null));};exports[_0x071d('0xbc')]=function(_0x43efc6,_0x1334d5,_0x5f5267){return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x43efc6[_0x071d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1334d5,null))[_0x071d('0x20')](function(_0x47e01d){if(_0x47e01d){return _0x47e01d[_0x071d('0xbc')](_0x43efc6['body'][_0x071d('0x6b')],_[_0x071d('0x8c')](_0x43efc6[_0x071d('0x60')],['ids','id'])||{})[_0x071d('0xbd')](function(_0x97401c){for(var _0x50955d=0x0;_0x50955d<_0x43efc6[_0x071d('0x60')][_0x071d('0x6b')][_0x071d('0x4e')];_0x50955d+=0x1){socket['emit'](_0x071d('0xbe'),{'UserId':Number(_0x43efc6[_0x071d('0x60')][_0x071d('0x6b')][_0x50955d]),'MailAccountId':Number(_0x43efc6[_0x071d('0x5d')]['id'])});}return _0x97401c;});}})[_0x071d('0x20')](respondWithResult(_0x1334d5,null))[_0x071d('0x2a')](handleError(_0x1334d5,null));};exports['removeAgents']=function(_0x4ba40b,_0x19eb32,_0x78e36c){return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x4ba40b['params']['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x19eb32,null))['then'](function(_0x1b0670){if(_0x1b0670){return _0x1b0670[_0x071d('0xbf')](_0x4ba40b['query'][_0x071d('0x6b')])[_0x071d('0x20')](function(){if(_[_0x071d('0xc0')](_0x4ba40b[_0x071d('0x47')][_0x071d('0x6b')])){for(var _0x48dda0=0x0;_0x48dda0<_0x4ba40b['query'][_0x071d('0x6b')][_0x071d('0x4e')];_0x48dda0+=0x1){socket[_0x071d('0xc1')](_0x071d('0xc2'),{'UserId':Number(_0x4ba40b['query'][_0x071d('0x6b')][_0x48dda0]),'MailAccountId':Number(_0x4ba40b[_0x071d('0x5d')]['id'])});}}else{socket[_0x071d('0xc1')](_0x071d('0xc2'),{'UserId':Number(_0x4ba40b[_0x071d('0x47')]['ids']),'MailAccountId':Number(_0x4ba40b[_0x071d('0x5d')]['id'])});}});}})[_0x071d('0x20')](respondWithStatusCode(_0x19eb32,null))[_0x071d('0x2a')](handleError(_0x19eb32,null));};exports[_0x071d('0xc3')]=function(_0x1041c0,_0x2857a1,_0x1b26c1){var _0x59e051={};var _0x5798fe={};var _0x2116a3;var _0x5605ca;return db[_0x071d('0x43')]['findOne']({'where':{'id':_0x1041c0[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x2857a1,null))[_0x071d('0x20')](function(_0x2e3d4f){if(_0x2e3d4f){_0x2116a3=_0x2e3d4f;_0x5798fe['model']=_['keys'](db[_0x071d('0x8e')][_0x071d('0x68')]);_0x5798fe[_0x071d('0x47')]=_[_0x071d('0x48')](_0x1041c0[_0x071d('0x47')]);_0x5798fe[_0x071d('0x49')]=_[_0x071d('0x4b')](_0x5798fe[_0x071d('0x4c')],_0x5798fe[_0x071d('0x47')]);_0x59e051['attributes']=_[_0x071d('0x4b')](_0x5798fe[_0x071d('0x4c')],qs[_0x071d('0x4d')](_0x1041c0['query'][_0x071d('0x4d')]));_0x59e051[_0x071d('0x4a')]=_0x59e051[_0x071d('0x4a')][_0x071d('0x4e')]?_0x59e051[_0x071d('0x4a')]:_0x5798fe[_0x071d('0x4c')];_0x59e051['order']=qs[_0x071d('0x51')](_0x1041c0[_0x071d('0x47')]['sort']);_0x59e051[_0x071d('0x52')]=qs[_0x071d('0x49')](_['pick'](_0x1041c0['query'],_0x5798fe[_0x071d('0x49')]));if(_0x1041c0[_0x071d('0x47')][_0x071d('0x54')]){_0x59e051[_0x071d('0x52')]=_[_0x071d('0x55')](_0x59e051['where'],{'$or':_[_0x071d('0x42')](_0x59e051['attributes'],function(_0x17d41a){var _0x59b95b={};_0x59b95b[_0x17d41a]={'$like':'%'+_0x1041c0[_0x071d('0x47')]['filter']+'%'};return _0x59b95b;})});}_0x59e051=_[_0x071d('0x55')]({},_0x59e051,_0x1041c0['options']);return _0x2116a3[_0x071d('0xc3')](_0x59e051);}})[_0x071d('0x20')](function(_0x10b07e){if(_0x10b07e){_0x5605ca=_0x10b07e[_0x071d('0x4e')];if(!_0x1041c0['query'][_0x071d('0x4f')](_0x071d('0x50'))){_0x59e051[_0x071d('0x30')]=qs[_0x071d('0x30')](_0x1041c0[_0x071d('0x47')][_0x071d('0x30')]);_0x59e051['offset']=qs[_0x071d('0x2e')](_0x1041c0[_0x071d('0x47')][_0x071d('0x2e')]);}return _0x2116a3[_0x071d('0xc3')](_0x59e051);}})['then'](function(_0x5c9450){if(_0x5c9450){return _0x5c9450?{'count':_0x5605ca,'rows':_0x5c9450}:null;}})[_0x071d('0x20')](respondWithResult(_0x2857a1,null))[_0x071d('0x2a')](handleError(_0x2857a1,null));}; \ No newline at end of file +var _0xb564=['role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','send','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','MailAccounts','UserProfileResource','stack','name','index','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','MailServerIn','merge','find','body','Smtp','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','isNil','active','description','cservice','user','cuser','password','authentication','host','port','service','pass','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0xb564,0x1d9));var _0x4b56=function(_0x2e05fc,_0x528437){_0x2e05fc=_0x2e05fc-0x0;var _0x21820c=_0xb564[_0x2e05fc];return _0x21820c;};'use strict';var emlformat=require(_0x4b56('0x0'));var rimraf=require(_0x4b56('0x1'));var zipdir=require(_0x4b56('0x2'));var jsonpatch=require(_0x4b56('0x3'));var rp=require(_0x4b56('0x4'));var moment=require(_0x4b56('0x5'));var BPromise=require(_0x4b56('0x6'));var Mustache=require(_0x4b56('0x7'));var util=require(_0x4b56('0x8'));var path=require(_0x4b56('0x9'));var sox=require(_0x4b56('0xa'));var csv=require(_0x4b56('0xb'));var ejs=require(_0x4b56('0xc'));var fs=require('fs');var fs_extra=require(_0x4b56('0xd'));var _=require('lodash');var squel=require(_0x4b56('0xe'));var crypto=require(_0x4b56('0xf'));var jsforce=require(_0x4b56('0x10'));var deskjs=require(_0x4b56('0x11'));var toCsv=require(_0x4b56('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0x4b56('0x12'));var juice=require(_0x4b56('0x13'));var Redis=require(_0x4b56('0x14'));var authService=require(_0x4b56('0x15'));var qs=require(_0x4b56('0x16'));var as=require(_0x4b56('0x17'));var hardwareService=require(_0x4b56('0x18'));var logger=require('../../config/logger')(_0x4b56('0x19'));var utils=require(_0x4b56('0x1a'));var config=require(_0x4b56('0x1b'));var licenseUtil=require(_0x4b56('0x1c'));var db=require('../../mysqldb')['db'];config[_0x4b56('0x1d')]=_[_0x4b56('0x1e')](config['redis'],{'host':_0x4b56('0x1f'),'port':0x18eb});var socket=require(_0x4b56('0x20'))(new Redis(config[_0x4b56('0x1d')]));require(_0x4b56('0x21'))[_0x4b56('0x22')](socket);var jayson=require(_0x4b56('0x23'));var client=jayson[_0x4b56('0x24')][_0x4b56('0x25')]({'port':0x232b});function respondWithRpcPromise(_0x1d9951,_0x386a3f,_0x2d4e66,_0x90d210){return new BPromise(function(_0x1da126,_0x31a0fd){var _0x520860=_0x90d210||client;return _0x520860[_0x4b56('0x26')](_0x1d9951,_0x2d4e66)['then'](function(_0x5d9044){logger[_0x4b56('0x27')](_0x4b56('0x28'),_0x386a3f,_0x4b56('0x29'));logger[_0x4b56('0x2a')](_0x4b56('0x2b'),_0x386a3f,_0x4b56('0x29'),JSON[_0x4b56('0x2c')](_0x5d9044));if(_0x5d9044[_0x4b56('0x2d')]){if(_0x5d9044['error'][_0x4b56('0x2e')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x386a3f,_0x5d9044[_0x4b56('0x2d')][_0x4b56('0x2f')]);return _0x31a0fd(_0x5d9044[_0x4b56('0x2d')]['message']);}logger['error'](_0x4b56('0x28'),_0x386a3f,_0x5d9044['error'][_0x4b56('0x2f')]);return _0x1da126(_0x5d9044[_0x4b56('0x2d')][_0x4b56('0x2f')]);}else{logger[_0x4b56('0x27')](_0x4b56('0x28'),_0x386a3f,_0x4b56('0x29'));_0x1da126(_0x5d9044[_0x4b56('0x30')][_0x4b56('0x2f')]);}})[_0x4b56('0x31')](function(_0x2fbdc5){logger[_0x4b56('0x2d')]('MailAccount,\x20%s,\x20%s',_0x386a3f,_0x2fbdc5);_0x31a0fd(_0x2fbdc5);});});}function respondWithStatusCode(_0x18f46a,_0x249aea){_0x249aea=_0x249aea||0xcc;return function(_0x528b73){if(_0x528b73){return _0x18f46a[_0x4b56('0x32')](_0x249aea);}return _0x18f46a[_0x4b56('0x33')](_0x249aea)[_0x4b56('0x34')]();};}function respondWithResult(_0x5ca7c1,_0x8db296){_0x8db296=_0x8db296||0xc8;return function(_0x8c76be){if(_0x8c76be){return _0x5ca7c1[_0x4b56('0x33')](_0x8db296)[_0x4b56('0x35')](_0x8c76be);}};}function respondWithFilteredResult(_0x272c98,_0x3c9756){return function(_0x50c2ba){if(_0x50c2ba){var _0x499669=typeof _0x3c9756['offset']===_0x4b56('0x36')&&typeof _0x3c9756[_0x4b56('0x37')]===_0x4b56('0x36');var _0x48cdbc=_0x50c2ba[_0x4b56('0x38')];var _0x265aa4=_0x499669?0x0:_0x3c9756[_0x4b56('0x39')];var _0x472961=_0x499669?_0x50c2ba['count']:_0x3c9756['offset']+_0x3c9756[_0x4b56('0x37')];var _0x288410;if(_0x472961>=_0x48cdbc){_0x472961=_0x48cdbc;_0x288410=0xc8;}else{_0x288410=0xce;}_0x272c98['status'](_0x288410);return _0x272c98[_0x4b56('0x3a')](_0x4b56('0x3b'),_0x265aa4+'-'+_0x472961+'/'+_0x48cdbc)['json'](_0x50c2ba);}return null;};}function patchUpdates(_0x594ab5){return function(_0x4f541f){try{jsonpatch[_0x4b56('0x3c')](_0x4f541f,_0x594ab5,!![]);}catch(_0x15d11d){return BPromise['reject'](_0x15d11d);}return _0x4f541f[_0x4b56('0x3d')]();};}function saveUpdates(_0x3454ef,_0x56ea63){return function(_0x5a2ee5){if(_0x5a2ee5){return _0x5a2ee5[_0x4b56('0x3e')](_0x3454ef)[_0x4b56('0x3f')](function(_0x46fff4){return _0x46fff4;});}return null;};}function removeEntity(_0x47f957,_0x2837d2){return function(_0xb96386){if(_0xb96386){return _0xb96386[_0x4b56('0x40')]()[_0x4b56('0x3f')](function(){var _0xd682c3=_0xb96386[_0x4b56('0x41')]({'plain':!![]});var _0x1a6f55=_0x4b56('0x42');return db[_0x4b56('0x43')][_0x4b56('0x40')]({'where':{'type':_0x1a6f55,'resourceId':_0xd682c3['id']}})[_0x4b56('0x3f')](function(){return _0xb96386;});})[_0x4b56('0x3f')](function(){_0x47f957[_0x4b56('0x33')](0xcc)[_0x4b56('0x34')]();});}};}function handleEntityNotFound(_0x2226cf,_0x4339c1){return function(_0x53149f){if(!_0x53149f){_0x2226cf['sendStatus'](0x194);}return _0x53149f;};}function handleError(_0x2fc621,_0x192e30){_0x192e30=_0x192e30||0x1f4;return function(_0x5ec64e){logger[_0x4b56('0x2d')](_0x5ec64e[_0x4b56('0x44')]);if(_0x5ec64e['name']){delete _0x5ec64e[_0x4b56('0x45')];}_0x2fc621[_0x4b56('0x33')](_0x192e30)['send'](_0x5ec64e);};}exports[_0x4b56('0x46')]=function(_0xb4dbc8,_0xf5db24){var _0x1d8dc7={'include':[{'model':db['MailServerIn'],'as':_0x4b56('0x47')},{'model':db[_0x4b56('0x48')],'as':'Smtp'},{'model':db[_0x4b56('0x49')],'as':_0x4b56('0x4a')}]},_0x383f36={},_0x4d76e2={'count':0x0,'rows':[]};var _0x3fe798=_[_0x4b56('0x4b')](db[_0x4b56('0x4c')][_0x4b56('0x4d')],function(_0x2161c5){return{'name':_0x2161c5[_0x4b56('0x4e')],'type':_0x2161c5[_0x4b56('0x4f')][_0x4b56('0x50')]};});_0x383f36[_0x4b56('0x51')]=_[_0x4b56('0x4b')](_0x3fe798,_0x4b56('0x45'));_0x383f36[_0x4b56('0x52')]=_[_0x4b56('0x53')](_0xb4dbc8[_0x4b56('0x52')]);_0x383f36[_0x4b56('0x54')]=_[_0x4b56('0x55')](_0x383f36[_0x4b56('0x51')],_0x383f36[_0x4b56('0x52')]);_0x1d8dc7[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x383f36[_0x4b56('0x51')],qs[_0x4b56('0x57')](_0xb4dbc8[_0x4b56('0x52')][_0x4b56('0x57')]));_0x1d8dc7[_0x4b56('0x56')]=_0x1d8dc7[_0x4b56('0x56')][_0x4b56('0x58')]?_0x1d8dc7[_0x4b56('0x56')]:_0x383f36['model'];if(!_0xb4dbc8['query'][_0x4b56('0x59')]('nolimit')){_0x1d8dc7['limit']=qs[_0x4b56('0x37')](_0xb4dbc8[_0x4b56('0x52')]['limit']);_0x1d8dc7[_0x4b56('0x39')]=qs[_0x4b56('0x39')](_0xb4dbc8[_0x4b56('0x52')][_0x4b56('0x39')]);}_0x1d8dc7[_0x4b56('0x5a')]=qs[_0x4b56('0x5b')](_0xb4dbc8[_0x4b56('0x52')][_0x4b56('0x5b')]);_0x1d8dc7[_0x4b56('0x5c')]=qs[_0x4b56('0x54')](_[_0x4b56('0x5d')](_0xb4dbc8[_0x4b56('0x52')],_0x383f36[_0x4b56('0x54')]),_0x3fe798);if(_0xb4dbc8[_0x4b56('0x52')][_0x4b56('0x5e')]){_0x1d8dc7['where']=_['merge'](_0x1d8dc7[_0x4b56('0x5c')],{'$or':_['map'](_0x3fe798,function(_0x39cc68){if(_0x39cc68[_0x4b56('0x4f')]!==_0x4b56('0x5f')){var _0x3b5c5b={};_0x3b5c5b[_0x39cc68[_0x4b56('0x45')]]={'$like':'%'+_0xb4dbc8[_0x4b56('0x52')]['filter']+'%'};return _0x3b5c5b;}})});}_0x1d8dc7=_['merge']({},_0x1d8dc7,_0xb4dbc8[_0x4b56('0x60')]);var _0x2437cc={'where':_0x1d8dc7[_0x4b56('0x5c')]};return db[_0x4b56('0x4c')][_0x4b56('0x38')](_0x2437cc)[_0x4b56('0x3f')](function(_0x5202af){_0x4d76e2[_0x4b56('0x38')]=_0x5202af;if(_0xb4dbc8[_0x4b56('0x52')][_0x4b56('0x61')]){_0x1d8dc7[_0x4b56('0x62')]=[{'all':!![]}];}return db[_0x4b56('0x4c')][_0x4b56('0x63')](_0x1d8dc7);})[_0x4b56('0x3f')](function(_0x28de27){_0x4d76e2[_0x4b56('0x64')]=_0x28de27;return _0x4d76e2;})['then'](respondWithFilteredResult(_0xf5db24,_0x1d8dc7))['catch'](handleError(_0xf5db24,null));};exports[_0x4b56('0x65')]=function(_0x49e47a,_0x50ff56){var _0x31e453={'raw':![],'where':{'id':_0x49e47a[_0x4b56('0x66')]['id']},'include':[{'model':db[_0x4b56('0x67')],'as':_0x4b56('0x47')},{'model':db[_0x4b56('0x48')],'as':'Smtp'},{'model':db[_0x4b56('0x49')],'as':_0x4b56('0x4a')}]},_0x33d179={};_0x33d179['model']=_[_0x4b56('0x53')](db[_0x4b56('0x4c')]['rawAttributes']);_0x33d179[_0x4b56('0x52')]=_['keys'](_0x49e47a[_0x4b56('0x52')]);_0x33d179[_0x4b56('0x54')]=_[_0x4b56('0x55')](_0x33d179[_0x4b56('0x51')],_0x33d179[_0x4b56('0x52')]);_0x31e453[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x33d179[_0x4b56('0x51')],qs[_0x4b56('0x57')](_0x49e47a['query'][_0x4b56('0x57')]));_0x31e453[_0x4b56('0x56')]=_0x31e453[_0x4b56('0x56')][_0x4b56('0x58')]?_0x31e453[_0x4b56('0x56')]:_0x33d179['model'];if(_0x49e47a[_0x4b56('0x52')]['includeAll']){_0x31e453['include']=[{'all':!![]}];}_0x31e453=_[_0x4b56('0x68')]({},_0x31e453,_0x49e47a[_0x4b56('0x60')]);return db['MailAccount'][_0x4b56('0x69')](_0x31e453)['then'](handleEntityNotFound(_0x50ff56,null))['then'](respondWithResult(_0x50ff56,null))['catch'](handleError(_0x50ff56,null));};exports[_0x4b56('0x3e')]=function(_0x5f9534,_0x305a40){if(_0x5f9534[_0x4b56('0x6a')]['id']){delete _0x5f9534['body']['id'];}return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x5f9534[_0x4b56('0x66')]['id']},'include':[{'model':db[_0x4b56('0x67')],'as':_0x4b56('0x47')},{'model':db['MailServerOut'],'as':_0x4b56('0x6b')},{'model':db[_0x4b56('0x49')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x305a40,null))[_0x4b56('0x3f')](saveUpdates(_0x5f9534[_0x4b56('0x6a')],null))[_0x4b56('0x3f')](function(_0x78be57){if(_0x78be57&&_0x5f9534[_0x4b56('0x6a')][_0x4b56('0x47')]){return db[_0x4b56('0x67')][_0x4b56('0x3e')](_0x5f9534['body'][_0x4b56('0x47')],{'where':{'MailAccountId':_0x78be57['id']}})['then'](function(){return _0x78be57;});}return _0x78be57;})[_0x4b56('0x3f')](function(_0x27380c){if(_0x27380c&&_0x5f9534['body'][_0x4b56('0x6b')]){return db[_0x4b56('0x48')]['update'](_0x5f9534['body'][_0x4b56('0x6b')],{'where':{'MailAccountId':_0x27380c['id']}})[_0x4b56('0x3f')](function(){return _0x27380c;});}return _0x27380c;})[_0x4b56('0x3f')](respondWithResult(_0x305a40,null))[_0x4b56('0x31')](handleError(_0x305a40,null));};exports['describe']=function(_0x5093e9,_0x1d162c){return db[_0x4b56('0x4c')][_0x4b56('0x6c')]()[_0x4b56('0x3f')](respondWithResult(_0x1d162c,null))[_0x4b56('0x31')](handleError(_0x1d162c,null));};exports[_0x4b56('0x6d')]=function(_0x419048,_0x436060,_0x25cd9c){if(_0x419048['body']['id']){delete _0x419048['body']['id'];}return db[_0x4b56('0x4c')]['find']({'where':{'id':_0x419048[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x436060,null))['then'](function(_0x446210){if(_0x446210){_0x419048[_0x4b56('0x6a')][_0x4b56('0x6e')]=_0x446210['id'];return db[_0x4b56('0x6f')][_0x4b56('0x70')](_0x419048[_0x4b56('0x6a')]);}})[_0x4b56('0x3f')](respondWithResult(_0x436060,null))[_0x4b56('0x31')](handleError(_0x436060,null));};exports[_0x4b56('0x71')]=function(_0x58c06a,_0x59c812,_0x109e41){var _0x5b7f8d={'raw':![],'where':{}};var _0x57e281={};var _0x5118f9={'count':0x0,'rows':[]};return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x58c06a['params']['id']}})['then'](handleEntityNotFound(_0x59c812,null))[_0x4b56('0x3f')](function(_0x374528){if(_0x374528){_0x57e281[_0x4b56('0x51')]=_[_0x4b56('0x53')](db[_0x4b56('0x6f')][_0x4b56('0x4d')]);_0x57e281[_0x4b56('0x52')]=_[_0x4b56('0x53')](_0x58c06a['query']);_0x57e281[_0x4b56('0x54')]=_[_0x4b56('0x55')](_0x57e281[_0x4b56('0x51')],_0x57e281['query']);_0x5b7f8d[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x57e281[_0x4b56('0x51')],qs[_0x4b56('0x57')](_0x58c06a['query'][_0x4b56('0x57')]));_0x5b7f8d[_0x4b56('0x56')]=_0x5b7f8d['attributes']['length']?_0x5b7f8d[_0x4b56('0x56')]:_0x57e281[_0x4b56('0x51')];if(!_0x58c06a[_0x4b56('0x52')][_0x4b56('0x59')](_0x4b56('0x73'))){_0x5b7f8d[_0x4b56('0x37')]=qs[_0x4b56('0x37')](_0x58c06a[_0x4b56('0x52')][_0x4b56('0x37')]);_0x5b7f8d[_0x4b56('0x39')]=qs[_0x4b56('0x39')](_0x58c06a['query'][_0x4b56('0x39')]);}_0x5b7f8d[_0x4b56('0x5a')]=qs[_0x4b56('0x5b')](_0x58c06a['query'][_0x4b56('0x5b')]);_0x5b7f8d[_0x4b56('0x5c')]=qs['filters'](_[_0x4b56('0x5d')](_0x58c06a[_0x4b56('0x52')],_0x57e281[_0x4b56('0x54')]));_0x5b7f8d[_0x4b56('0x5c')][_0x4b56('0x6e')]=_0x374528['id'];if(_0x58c06a[_0x4b56('0x52')][_0x4b56('0x5e')]){_0x5b7f8d['where']=_[_0x4b56('0x68')](_0x5b7f8d['where'],{'$or':_[_0x4b56('0x4b')](_0x5b7f8d[_0x4b56('0x56')],function(_0x46666d){var _0x1b343c={};_0x1b343c[_0x46666d]={'$like':'%'+_0x58c06a['query'][_0x4b56('0x5e')]+'%'};return _0x1b343c;})});}_0x5b7f8d=_[_0x4b56('0x68')]({},_0x5b7f8d,_0x58c06a[_0x4b56('0x60')]);return db[_0x4b56('0x6f')][_0x4b56('0x38')]({'where':_0x5b7f8d['where']})[_0x4b56('0x3f')](function(_0x16865a){_0x5118f9['count']=_0x16865a;if(_0x58c06a[_0x4b56('0x52')]['includeAll']){_0x5b7f8d[_0x4b56('0x62')]=[{'all':!![]}];}return db[_0x4b56('0x6f')][_0x4b56('0x63')](_0x5b7f8d);})['then'](function(_0x47ebb2){_0x5118f9[_0x4b56('0x64')]=_0x47ebb2;return _0x5118f9;});}})['then'](respondWithFilteredResult(_0x59c812,_0x5b7f8d))[_0x4b56('0x31')](handleError(_0x59c812,null));};exports[_0x4b56('0x74')]=function(_0x341875,_0x4a272d,_0x375958){return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x341875['params']['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x4a272d,null))[_0x4b56('0x3f')](function(_0x2b3d12){if(_0x2b3d12){return _0x2b3d12[_0x4b56('0x74')](_0x341875['query'][_0x4b56('0x75')]);}})['then'](respondWithStatusCode(_0x4a272d,null))[_0x4b56('0x31')](handleError(_0x4a272d,null));};exports[_0x4b56('0x76')]=function(_0x31ce56,_0x3442c0,_0x480cbb){if(_0x31ce56[_0x4b56('0x6a')]['id']){delete _0x31ce56['body']['id'];}return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x31ce56[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x3442c0,null))[_0x4b56('0x3f')](function(_0x510492){if(_0x510492){_0x31ce56[_0x4b56('0x6a')][_0x4b56('0x6e')]=_0x510492['id'];return db[_0x4b56('0x77')][_0x4b56('0x70')](_0x31ce56['body']);}})['then'](respondWithResult(_0x3442c0,null))['catch'](handleError(_0x3442c0,null));};exports['getAnswers']=function(_0x2279df,_0x116ba8,_0x3518c2){var _0x359557={'raw':![],'where':{}};var _0x4257ea={};var _0xde410d={'count':0x0,'rows':[]};return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x2279df[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x116ba8,null))[_0x4b56('0x3f')](function(_0x4ef344){if(_0x4ef344){_0x4257ea[_0x4b56('0x51')]=_[_0x4b56('0x53')](db[_0x4b56('0x77')]['rawAttributes']);_0x4257ea[_0x4b56('0x52')]=_[_0x4b56('0x53')](_0x2279df[_0x4b56('0x52')]);_0x4257ea[_0x4b56('0x54')]=_['intersection'](_0x4257ea[_0x4b56('0x51')],_0x4257ea[_0x4b56('0x52')]);_0x359557[_0x4b56('0x56')]=_['intersection'](_0x4257ea[_0x4b56('0x51')],qs[_0x4b56('0x57')](_0x2279df[_0x4b56('0x52')]['fields']));_0x359557[_0x4b56('0x56')]=_0x359557[_0x4b56('0x56')][_0x4b56('0x58')]?_0x359557[_0x4b56('0x56')]:_0x4257ea[_0x4b56('0x51')];if(!_0x2279df[_0x4b56('0x52')][_0x4b56('0x59')](_0x4b56('0x73'))){_0x359557['limit']=qs[_0x4b56('0x37')](_0x2279df[_0x4b56('0x52')][_0x4b56('0x37')]);_0x359557['offset']=qs[_0x4b56('0x39')](_0x2279df[_0x4b56('0x52')]['offset']);}_0x359557['order']=qs[_0x4b56('0x5b')](_0x2279df['query'][_0x4b56('0x5b')]);_0x359557[_0x4b56('0x5c')]=qs['filters'](_[_0x4b56('0x5d')](_0x2279df[_0x4b56('0x52')],_0x4257ea[_0x4b56('0x54')]));_0x359557['where'][_0x4b56('0x6e')]=_0x4ef344['id'];if(_0x2279df['query'][_0x4b56('0x5e')]){_0x359557['where']=_[_0x4b56('0x68')](_0x359557[_0x4b56('0x5c')],{'$or':_[_0x4b56('0x4b')](_0x359557['attributes'],function(_0x289c42){var _0x14ee2c={};_0x14ee2c[_0x289c42]={'$like':'%'+_0x2279df[_0x4b56('0x52')]['filter']+'%'};return _0x14ee2c;})});}_0x359557=_['merge']({},_0x359557,_0x2279df['options']);return db[_0x4b56('0x77')][_0x4b56('0x38')]({'where':_0x359557['where']})[_0x4b56('0x3f')](function(_0x244396){_0xde410d['count']=_0x244396;if(_0x2279df[_0x4b56('0x52')][_0x4b56('0x61')]){_0x359557['include']=[{'all':!![]}];}return db[_0x4b56('0x77')][_0x4b56('0x63')](_0x359557);})[_0x4b56('0x3f')](function(_0x4075ab){_0xde410d[_0x4b56('0x64')]=_0x4075ab;return _0xde410d;});}})[_0x4b56('0x3f')](respondWithFilteredResult(_0x116ba8,_0x359557))[_0x4b56('0x31')](handleError(_0x116ba8,null));};exports[_0x4b56('0x78')]=function(_0x1a1e5a,_0x56fd51,_0x199fa4){return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x1a1e5a[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x56fd51,null))[_0x4b56('0x3f')](function(_0x31b9e6){if(_0x31b9e6){return _0x31b9e6[_0x4b56('0x78')](_0x1a1e5a['query'][_0x4b56('0x75')]);}})[_0x4b56('0x3f')](respondWithStatusCode(_0x56fd51,null))[_0x4b56('0x31')](handleError(_0x56fd51,null));};exports[_0x4b56('0x70')]=function(_0x227e62,_0x5835a3){var _0x2dc108={'name':_0x227e62['body']['name'],'key':_0x227e62[_0x4b56('0x6a')]['key'],'email':_0x227e62[_0x4b56('0x6a')][_0x4b56('0x79')],'ListId':_0x227e62['body']['ListId'],'active':!_[_0x4b56('0x7a')](_0x227e62[_0x4b56('0x6a')]['active'])?_0x227e62['body'][_0x4b56('0x7b')]:!![],'description':_0x227e62[_0x4b56('0x6a')][_0x4b56('0x7c')]||null,'Imap':{},'Smtp':{}};if(_[_0x4b56('0x7a')](_0x227e62[_0x4b56('0x6a')][_0x4b56('0x7d')])){if(_0x227e62[_0x4b56('0x6a')]['cauthentication']){_0x2dc108[_0x4b56('0x47')][_0x4b56('0x7e')]=_0x2dc108['Smtp'][_0x4b56('0x7e')]=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x7f')];_0x2dc108[_0x4b56('0x47')][_0x4b56('0x80')]=_0x2dc108['Smtp']['pass']=_0x227e62[_0x4b56('0x6a')]['cpassword'];}else{_0x2dc108[_0x4b56('0x47')]['authentication']=_0x2dc108[_0x4b56('0x6b')][_0x4b56('0x81')]=![];}_0x2dc108['Imap'][_0x4b56('0x82')]=_0x227e62['body'][_0x4b56('0x47')][_0x4b56('0x82')];_0x2dc108[_0x4b56('0x47')][_0x4b56('0x83')]=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x47')][_0x4b56('0x83')];_0x2dc108[_0x4b56('0x6b')]['host']=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x6b')][_0x4b56('0x82')];_0x2dc108[_0x4b56('0x6b')][_0x4b56('0x83')]=_0x227e62['body'][_0x4b56('0x6b')][_0x4b56('0x83')];}else{_0x2dc108[_0x4b56('0x47')][_0x4b56('0x84')]=_0x2dc108[_0x4b56('0x6b')]['service']=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x7d')];_0x2dc108[_0x4b56('0x47')]['user']=_0x2dc108[_0x4b56('0x6b')][_0x4b56('0x7e')]=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x7f')];_0x2dc108['Imap']['password']=_0x2dc108[_0x4b56('0x6b')][_0x4b56('0x85')]=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x86')];}return db[_0x4b56('0x4c')][_0x4b56('0x70')](_0x2dc108,{'include':[{'model':db[_0x4b56('0x48')],'as':_0x4b56('0x6b')},{'model':db[_0x4b56('0x67')],'as':_0x4b56('0x47')}]})[_0x4b56('0x3f')](function(_0x546f04){var _0x5ec89f=_0x227e62['user'][_0x4b56('0x41')]({'plain':!![]});if(!_0x5ec89f)throw new Error(_0x4b56('0x87'));if(_0x5ec89f[_0x4b56('0x88')]===_0x4b56('0x7e')){var _0x5ba8de=_0x546f04[_0x4b56('0x41')]({'plain':!![]});return db['UserProfileSection'][_0x4b56('0x69')]({'where':{'name':_0x4b56('0x42'),'userProfileId':_0x5ec89f[_0x4b56('0x89')]},'raw':!![]})[_0x4b56('0x3f')](function(_0x4a4426){if(_0x4a4426&&_0x4a4426['autoAssociation']===0x0){return db[_0x4b56('0x43')]['create']({'name':_0x5ba8de[_0x4b56('0x45')],'resourceId':_0x5ba8de['id'],'type':_0x4a4426[_0x4b56('0x45')],'sectionId':_0x4a4426['id']},{})[_0x4b56('0x3f')](function(){return _0x546f04;});}else{return _0x546f04;}})[_0x4b56('0x31')](function(_0x5485ce){logger[_0x4b56('0x2d')](_0x4b56('0x8a'),_0x5485ce);throw _0x5485ce;});}return _0x546f04;})[_0x4b56('0x3f')](respondWithResult(_0x5835a3,0xc9))[_0x4b56('0x31')](handleError(_0x5835a3,null));};exports[_0x4b56('0x8b')]=function(_0x19baf4,_0x5a96c2,_0x852f4a){return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x19baf4[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x5a96c2,null))['then'](function(_0x39a9c1){if(_0x39a9c1){return _0x39a9c1[_0x4b56('0x8b')]();}return null;})['then'](respondWithResult(_0x5a96c2,null))[_0x4b56('0x31')](handleError(_0x5a96c2,null));};exports['addImap']=function(_0x50108f,_0x425998,_0x45e578){if(_0x50108f['body']['id']){delete _0x50108f[_0x4b56('0x6a')]['id'];}return db[_0x4b56('0x4c')]['find']({'where':{'id':_0x50108f['params']['id']}})['then'](handleEntityNotFound(_0x425998,null))['then'](function(_0x4dbe4a){if(_0x4dbe4a){_0x50108f[_0x4b56('0x6a')][_0x4b56('0x6e')]=_0x4dbe4a['id'];return db[_0x4b56('0x67')][_0x4b56('0x70')](_0x50108f[_0x4b56('0x6a')]);}})['then'](respondWithResult(_0x425998,null))[_0x4b56('0x31')](handleError(_0x425998,null));};exports['removeImap']=function(_0x20efe2,_0x35a67f,_0x111e6d){return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x20efe2['params']['id']}})['then'](handleEntityNotFound(_0x35a67f,null))[_0x4b56('0x3f')](function(_0xeee40f){if(_0xeee40f){return _0xeee40f[_0x4b56('0x8c')](null);}return null;})[_0x4b56('0x3f')](respondWithStatusCode(_0x35a67f,null))[_0x4b56('0x31')](handleError(_0x35a67f,null));};exports['getSmtp']=function(_0x22952c,_0xc13975,_0xaf3553){return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x22952c[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0xc13975,null))[_0x4b56('0x3f')](function(_0x32e4b7){if(_0x32e4b7){return _0x32e4b7[_0x4b56('0x8d')]();}return null;})[_0x4b56('0x3f')](respondWithResult(_0xc13975,null))['catch'](handleError(_0xc13975,null));};exports[_0x4b56('0x8e')]=function(_0x42f2f9,_0x275ed8,_0x24150f){if(_0x42f2f9[_0x4b56('0x6a')]['id']){delete _0x42f2f9[_0x4b56('0x6a')]['id'];}return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x42f2f9[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x275ed8,null))[_0x4b56('0x3f')](function(_0x43749c){if(_0x43749c){_0x42f2f9[_0x4b56('0x6a')][_0x4b56('0x6e')]=_0x43749c['id'];return db[_0x4b56('0x48')]['create'](_0x42f2f9[_0x4b56('0x6a')]);}})[_0x4b56('0x3f')](respondWithResult(_0x275ed8,null))['catch'](handleError(_0x275ed8,null));};exports[_0x4b56('0x8f')]=function(_0x187572,_0xfe2b46,_0x2ca9e6){return db[_0x4b56('0x4c')]['findOne']({'where':{'id':_0x187572[_0x4b56('0x66')]['id']}})['then'](handleEntityNotFound(_0xfe2b46,null))[_0x4b56('0x3f')](function(_0x25c228){if(_0x25c228){return _0x25c228[_0x4b56('0x90')](null);}return null;})[_0x4b56('0x3f')](respondWithStatusCode(_0xfe2b46,null))[_0x4b56('0x31')](handleError(_0xfe2b46,null));};exports[_0x4b56('0x91')]=function(_0x1d04a7,_0x35dbcf,_0x487454){return db['MailInteraction']['find']({'where':{'id':_0x1d04a7[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x35dbcf,null))[_0x4b56('0x3f')](function(_0x25954e){if(_0x25954e){return _0x25954e['addInteraction'](_0x1d04a7['body'][_0x4b56('0x75')],_[_0x4b56('0x92')](_0x1d04a7[_0x4b56('0x6a')],[_0x4b56('0x75'),'id'])||{});}})[_0x4b56('0x3f')](respondWithResult(_0x35dbcf,null))[_0x4b56('0x31')](handleError(_0x35dbcf,null));};exports[_0x4b56('0x93')]=function(_0x4fc01c,_0x365cbe,_0x292670){var _0x4d5c1a={'raw':![],'where':{}};var _0x18c557={};var _0x293ac2={'count':0x0,'rows':[]};return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x4fc01c[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x365cbe,null))[_0x4b56('0x3f')](function(_0x32fce7){if(_0x32fce7){_0x18c557[_0x4b56('0x51')]=_['keys'](db[_0x4b56('0x94')][_0x4b56('0x4d')]);_0x18c557['query']=_['keys'](_0x4fc01c[_0x4b56('0x52')]);_0x18c557[_0x4b56('0x54')]=_[_0x4b56('0x55')](_0x18c557['model'],_0x18c557[_0x4b56('0x52')]);_0x4d5c1a['attributes']=_[_0x4b56('0x55')](_0x18c557[_0x4b56('0x51')],qs['fields'](_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x57')]));_0x4d5c1a[_0x4b56('0x56')]=_0x4d5c1a[_0x4b56('0x56')]['length']?_0x4d5c1a[_0x4b56('0x56')]:_0x18c557[_0x4b56('0x51')];if(!_0x4fc01c['query'][_0x4b56('0x59')](_0x4b56('0x73'))){_0x4d5c1a[_0x4b56('0x37')]=qs[_0x4b56('0x37')](_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x37')]);_0x4d5c1a['offset']=qs[_0x4b56('0x39')](_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x39')]);}_0x4d5c1a['order']=qs[_0x4b56('0x5b')](_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x5b')]);_0x4d5c1a[_0x4b56('0x5c')]=qs[_0x4b56('0x54')](_[_0x4b56('0x5d')](_0x4fc01c[_0x4b56('0x52')],_0x18c557['filters']));_0x4d5c1a['where']['MailAccountId']=_0x32fce7['id'];if(_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x5e')]){_0x4d5c1a[_0x4b56('0x5c')]=_[_0x4b56('0x68')](_0x4d5c1a['where'],{'$or':_['map'](_0x4d5c1a[_0x4b56('0x56')],function(_0x4a4e7b){var _0x4cfba7={};_0x4cfba7[_0x4a4e7b]={'$like':'%'+_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x5e')]+'%'};return _0x4cfba7;})});}_0x4d5c1a=_[_0x4b56('0x68')]({},_0x4d5c1a,_0x4fc01c[_0x4b56('0x60')]);return db[_0x4b56('0x94')][_0x4b56('0x38')]({'where':_0x4d5c1a[_0x4b56('0x5c')]})[_0x4b56('0x3f')](function(_0x3039c8){_0x293ac2[_0x4b56('0x38')]=_0x3039c8;if(_0x4fc01c[_0x4b56('0x52')]['includeAll']){_0x4d5c1a['include']=[{'model':db[_0x4b56('0x95')],'as':_0x4b56('0x96'),'required':![]},{'model':db[_0x4b56('0x97')],'as':_0x4b56('0x98'),'attributes':['name',_0x4b56('0x99'),'internal'],'required':![]},{'model':db[_0x4b56('0x9a')],'as':_0x4b56('0x9b'),'attributes':['id','name',_0x4b56('0x9c')],'where':_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x9d')]?{'id':_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x9d')]}:undefined,'required':_0x4fc01c[_0x4b56('0x52')]['tag']?!![]:![]}];}return db[_0x4b56('0x94')][_0x4b56('0x63')](_0x4d5c1a);})[_0x4b56('0x3f')](function(_0x32deaa){_0x293ac2['rows']=_0x32deaa;return _0x293ac2;});}})['then'](respondWithFilteredResult(_0x365cbe,_0x4d5c1a))[_0x4b56('0x31')](handleError(_0x365cbe,null));};exports[_0x4b56('0x9e')]=function(_0x2bdc75,_0x4bdcbc,_0x28f500){return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x2bdc75['params']['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x4bdcbc,null))[_0x4b56('0x3f')](function(_0x45f7e2){if(_0x45f7e2){return db['sequelize'][_0x4b56('0x9f')](function(_0x94e241){return db[_0x4b56('0xa0')][_0x4b56('0x40')]({'where':{'MailAccountId':_0x2bdc75['params']['id']},'transaction':_0x94e241})[_0x4b56('0x3f')](function(_0x5e9e0a){var _0x2f861c=_[_0x4b56('0x4b')](_0x2bdc75[_0x4b56('0x6a')],function(_0xb29f76){_0xb29f76[_0x4b56('0x6e')]=_0x2bdc75[_0x4b56('0x66')]['id'];return _0xb29f76;});return db[_0x4b56('0xa0')]['bulkCreate'](_0x2f861c,{'transaction':_0x94e241});});})[_0x4b56('0x3f')](function(){return db[_0x4b56('0xa0')][_0x4b56('0xa1')]({'where':{'MailAccountId':_0x2bdc75[_0x4b56('0x66')]['id']},'order':_0x4b56('0xa2')});});}})['then'](respondWithResult(_0x4bdcbc,null))[_0x4b56('0x31')](handleError(_0x4bdcbc,null));};exports[_0x4b56('0xa3')]=function(_0x3a96c7,_0x13e294,_0x4e12e6){var _0x433ece={};var _0x104e1a={};var _0x186e05;var _0x15f50e;return db[_0x4b56('0x4c')]['findOne']({'where':{'id':_0x3a96c7[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x13e294,null))[_0x4b56('0x3f')](function(_0x1c67f6){if(_0x1c67f6){_0x186e05=_0x1c67f6;_0x104e1a[_0x4b56('0x51')]=_[_0x4b56('0x53')](db[_0x4b56('0xa0')][_0x4b56('0x4d')]);_0x104e1a[_0x4b56('0x52')]=_['keys'](_0x3a96c7[_0x4b56('0x52')]);_0x104e1a['filters']=_['intersection'](_0x104e1a[_0x4b56('0x51')],_0x104e1a[_0x4b56('0x52')]);_0x433ece[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x104e1a[_0x4b56('0x51')],qs[_0x4b56('0x57')](_0x3a96c7[_0x4b56('0x52')][_0x4b56('0x57')]));_0x433ece['attributes']=_0x433ece[_0x4b56('0x56')][_0x4b56('0x58')]?_0x433ece[_0x4b56('0x56')]:_0x104e1a['model'];_0x433ece['order']=qs['sort'](_0x3a96c7[_0x4b56('0x52')][_0x4b56('0x5b')]);_0x433ece[_0x4b56('0x5c')]=qs[_0x4b56('0x54')](_['pick'](_0x3a96c7['query'],_0x104e1a['filters']));if(_0x3a96c7[_0x4b56('0x52')]['filter']){_0x433ece[_0x4b56('0x5c')]=_[_0x4b56('0x68')](_0x433ece[_0x4b56('0x5c')],{'$or':_['map'](_0x433ece[_0x4b56('0x56')],function(_0x5e7786){var _0x3c88e2={};_0x3c88e2[_0x5e7786]={'$like':'%'+_0x3a96c7[_0x4b56('0x52')][_0x4b56('0x5e')]+'%'};return _0x3c88e2;})});}_0x433ece=_[_0x4b56('0x68')]({},_0x433ece,_0x3a96c7['options']);return _0x186e05['getApplications'](_0x433ece);}})[_0x4b56('0x3f')](function(_0x1cc394){if(_0x1cc394){_0x15f50e=_0x1cc394['length'];if(!_0x3a96c7['query'][_0x4b56('0x59')](_0x4b56('0x73'))){_0x433ece[_0x4b56('0x37')]=qs['limit'](_0x3a96c7['query'][_0x4b56('0x37')]);_0x433ece[_0x4b56('0x39')]=qs[_0x4b56('0x39')](_0x3a96c7[_0x4b56('0x52')][_0x4b56('0x39')]);}return _0x186e05[_0x4b56('0xa3')](_0x433ece);}})['then'](function(_0x5675e4){if(_0x5675e4){return _0x5675e4?{'count':_0x15f50e,'rows':_0x5675e4}:null;}})[_0x4b56('0x3f')](respondWithResult(_0x13e294,null))['catch'](handleError(_0x13e294,null));};exports[_0x4b56('0xa4')]=function(_0x3f57ac,_0x2d6823,_0x19c1ed){var _0x3ece96={'raw':!![],'where':{}};var _0x141cb3={};var _0x5a6d53={'count':0x0,'rows':[]};return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x3f57ac[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x2d6823,null))[_0x4b56('0x3f')](function(_0x4b1040){if(_0x4b1040){_0x141cb3[_0x4b56('0x51')]=_[_0x4b56('0x53')](db[_0x4b56('0xa5')][_0x4b56('0x4d')]);_0x141cb3[_0x4b56('0x52')]=_[_0x4b56('0x53')](_0x3f57ac['query']);_0x141cb3['filters']=_[_0x4b56('0x55')](_0x141cb3[_0x4b56('0x51')],_0x141cb3[_0x4b56('0x52')]);_0x3ece96[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x141cb3[_0x4b56('0x51')],qs['fields'](_0x3f57ac[_0x4b56('0x52')][_0x4b56('0x57')]));_0x3ece96[_0x4b56('0x56')]=_0x3ece96[_0x4b56('0x56')][_0x4b56('0x58')]?_0x3ece96[_0x4b56('0x56')]:_0x141cb3[_0x4b56('0x51')];if(!_0x3f57ac[_0x4b56('0x52')][_0x4b56('0x59')](_0x4b56('0x73'))){_0x3ece96['limit']=qs[_0x4b56('0x37')](_0x3f57ac['query'][_0x4b56('0x37')]);_0x3ece96[_0x4b56('0x39')]=qs[_0x4b56('0x39')](_0x3f57ac['query']['offset']);}_0x3ece96['order']=qs['sort'](_0x3f57ac[_0x4b56('0x52')]['sort']);_0x3ece96[_0x4b56('0x5c')]=qs[_0x4b56('0x54')](_[_0x4b56('0x5d')](_0x3f57ac[_0x4b56('0x52')],_0x141cb3[_0x4b56('0x54')]));_0x3ece96['where']['MailAccountId']=_0x4b1040['id'];if(_0x3f57ac['query'][_0x4b56('0x5e')]){_0x3ece96['where']=_['merge'](_0x3ece96[_0x4b56('0x5c')],{'$or':_[_0x4b56('0x4b')](_0x3ece96['attributes'],function(_0x171dca){var _0x555f22={};_0x555f22[_0x171dca]={'$like':'%'+_0x3f57ac['query'][_0x4b56('0x5e')]+'%'};return _0x555f22;})});}if(_0x3f57ac[_0x4b56('0x52')][_0x4b56('0xa6')]){var _0x4bb06f=_0x3f57ac[_0x4b56('0x52')][_0x4b56('0xa6')][_0x4b56('0xa7')](',');var _0x4c1584={};_0x4c1584[_0x4bb06f[0x0]]={'$gte':moment(_0x4bb06f[0x1])[_0x4b56('0xa8')](_0x4b56('0xa9'))};_0x3ece96['where']=_[_0x4b56('0x68')](_0x3ece96[_0x4b56('0x5c')],_0x4c1584);}_0x3ece96=_['merge']({},_0x3ece96,_0x3f57ac[_0x4b56('0x60')]);return db[_0x4b56('0xa5')][_0x4b56('0x38')]({'where':_0x3ece96[_0x4b56('0x5c')]})[_0x4b56('0x3f')](function(_0x29667a){_0x5a6d53[_0x4b56('0x38')]=_0x29667a;if(_0x3f57ac['query']['includeAll']){_0x3ece96[_0x4b56('0x62')]=[{'all':!![]}];}return db[_0x4b56('0xa5')][_0x4b56('0x63')](_0x3ece96);})['then'](function(_0x178d93){if(_0x3f57ac[_0x4b56('0x52')][_0x4b56('0xaa')]===_0x4b56('0xab')){for(var _0x1a3673=0x0;_0x1a3673<_0x178d93[_0x4b56('0x58')];_0x1a3673++){_0x178d93[_0x1a3673][_0x4b56('0x6a')]=juice(_0x178d93[_0x1a3673][_0x4b56('0x6a')]);}}_0x5a6d53[_0x4b56('0x64')]=_0x178d93;return _0x5a6d53;});}})[_0x4b56('0x3f')](respondWithFilteredResult(_0x2d6823,_0x3ece96))[_0x4b56('0x31')](handleError(_0x2d6823,null));};exports[_0x4b56('0xac')]=function(_0x2f02be,_0x1221c9,_0x5f2a3e){var _0x1cdde8,_0x401596={},_0x22030b;if(_0x2f02be['body']['to']){_0x22030b=_0x2f02be[_0x4b56('0x6a')]['to'][_0x4b56('0xa7')](',')[0x0];}return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x2f02be[_0x4b56('0x66')]['id']},'include':[{'model':db[_0x4b56('0xad')],'as':_0x4b56('0xae'),'include':[{'model':db[_0x4b56('0x95')],'as':_0x4b56('0xaf'),'where':{'email':_0x22030b},'limit':0x1,'order':[[_0x4b56('0xb0'),_0x4b56('0xb1')]]}]},{'model':db['MailServerOut'],'as':_0x4b56('0x6b'),'raw':!![]}]})[_0x4b56('0x3f')](handleEntityNotFound(_0x1221c9,null))['then'](function(_0x21134a){if(_0x21134a){_0x1cdde8=_0x21134a;if(_0x21134a[_0x4b56('0x6b')]){if(_[_0x4b56('0x7a')](_0x2f02be['body'][_0x4b56('0xb2')])){_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xb2')]=util['format'](_0x4b56('0xb3'),_0x21134a[_0x4b56('0x45')],_0x21134a[_0x4b56('0x79')]||_0x21134a[_0x4b56('0x6b')][_0x4b56('0x7e')]);}if(_0x2f02be['body'][_0x4b56('0xb4')]&&_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xb4')][_0x4b56('0x58')]){for(var _0x232692=0x0;_0x232692<_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xb4')]['length'];_0x232692+=0x1){_0x2f02be['body'][_0x4b56('0xb4')][_0x232692]={'filename':_0x2f02be['body'][_0x4b56('0xb4')][_0x232692][_0x4b56('0x45')],'path':path[_0x4b56('0xb5')](config['root'],_0x4b56('0xb6'),_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xb4')][_0x232692][_0x4b56('0xb7')])};}}var _0x1d81a0={'tls':{'rejectUnauthorized':![]}};if(_[_0x4b56('0x7a')](_0x21134a[_0x4b56('0x6b')][_0x4b56('0x84')])){if(_0x21134a[_0x4b56('0x6b')][_0x4b56('0x81')]){_0x1d81a0[_0x4b56('0xb8')]={'user':_0x21134a['Smtp'][_0x4b56('0x7e')],'pass':_0x21134a[_0x4b56('0x6b')][_0x4b56('0x85')]};}_0x1d81a0['host']=_0x21134a[_0x4b56('0x6b')]['host'];_0x1d81a0[_0x4b56('0x83')]=_0x21134a[_0x4b56('0x6b')]['port'];_0x1d81a0[_0x4b56('0xb9')]=_0x21134a[_0x4b56('0x6b')][_0x4b56('0xb9')];}else{_0x1d81a0['service']=_0x21134a[_0x4b56('0x6b')]['service'];_0x1d81a0['auth']={'user':_0x21134a[_0x4b56('0x6b')]['user'],'pass':_0x21134a[_0x4b56('0x6b')][_0x4b56('0x85')]};}return respondWithRpcPromise(_0x4b56('0xba'),'sendMail',{'account':_0x1d81a0,'message':_0x2f02be[_0x4b56('0x6a')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x5419ff){if(_0x5419ff){_0x401596=_0x5419ff;if(_0x1cdde8['List']){if(_0x1cdde8[_0x4b56('0xae')][_0x4b56('0xaf')][_0x4b56('0x58')]){return _0x1cdde8[_0x4b56('0xae')][_0x4b56('0xaf')][0x0];}else{return db[_0x4b56('0x95')][_0x4b56('0x70')](_['defaults'](_0x2f02be[_0x4b56('0x6a')],{'firstName':_0x2f02be[_0x4b56('0x6a')]['to'],'email':_0x2f02be[_0x4b56('0x6a')]['to'],'phone':_0x2f02be['body']['to'],'ListId':_0x1cdde8['ListId']}));}}else{throw new Error(_0x4b56('0xbb'));}}})[_0x4b56('0x3f')](function(_0x2056be){if(_0x2056be){var _0x4df62c={'UserId':_0x2f02be['user']['id'],'ContactId':_0x2056be['id'],'MailAccountId':_0x1cdde8['id'],'inReplyTo':_0x401596[_0x4b56('0xbc')],'to':_0x2f02be['body']['from'],'cc':_0x2f02be[_0x4b56('0x6a')]['cc'],'subject':_0x2f02be['body'][_0x4b56('0xbd')],'attach':_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xbe')],'firstMsgDirection':_0x4b56('0xbf'),'lastMsgAt':moment()[_0x4b56('0xa8')](_0x4b56('0xa9')),'lastMsgDirection':_0x4b56('0xbf'),'Messages':[_['merge'](_0x2f02be[_0x4b56('0x6a')],{'messageId':_0x401596[_0x4b56('0xbc')],'sentAt':moment()['format'](_0x4b56('0xa9')),'read':!![],'MailAccountId':_0x1cdde8['id'],'UserId':_0x2f02be['user']['id'],'ContactId':_0x2056be['id']})]};if(_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xc0')]){_0x4df62c=_[_0x4b56('0x68')](_0x4df62c,_0x2f02be[_0x4b56('0x6a')]['Interaction']);}return db[_0x4b56('0x94')][_0x4b56('0x70')](_0x4df62c,{'include':[{'model':db[_0x4b56('0xa5')],'as':_0x4b56('0xc1')}]});}})[_0x4b56('0x3f')](respondWithResult(_0x1221c9,null))[_0x4b56('0x31')](handleError(_0x1221c9,null));};exports[_0x4b56('0xc2')]=function(_0x434c2d,_0x3a8813,_0x4ad171){return db['MailAccount'][_0x4b56('0x69')]({'where':{'id':_0x434c2d[_0x4b56('0x66')]['id']},'include':[{'model':db[_0x4b56('0x48')],'as':_0x4b56('0x6b'),'raw':!![]}]})[_0x4b56('0x3f')](handleEntityNotFound(_0x3a8813,null))[_0x4b56('0x3f')](function(_0xb626fe){if(_0xb626fe&&_0xb626fe[_0x4b56('0x6b')]){var _0x1abc47={'id':_0xb626fe['id'],'tls':{'rejectUnauthorized':![]}};if(_0xb626fe[_0x4b56('0x6b')][_0x4b56('0x84')]){_0x1abc47[_0x4b56('0x84')]=_0xb626fe['Smtp'][_0x4b56('0x84')];}else{_0x1abc47[_0x4b56('0x82')]=_0xb626fe[_0x4b56('0x6b')][_0x4b56('0x82')];_0x1abc47[_0x4b56('0x83')]=_0xb626fe['Smtp'][_0x4b56('0x83')];_0x1abc47[_0x4b56('0xb9')]=_0xb626fe[_0x4b56('0x6b')][_0x4b56('0xb9')];}if(_0xb626fe[_0x4b56('0x6b')][_0x4b56('0x81')]){_0x1abc47['auth']={'user':_0xb626fe[_0x4b56('0x6b')][_0x4b56('0x7e')],'pass':_0xb626fe[_0x4b56('0x6b')][_0x4b56('0x85')]};}return respondWithRpcPromise(_0x4b56('0xc3'),_0x4b56('0xc2'),{'account':_0x1abc47});}})[_0x4b56('0x3f')](respondWithResult(_0x3a8813,null))[_0x4b56('0x31')](handleError(_0x3a8813,null));};exports[_0x4b56('0x40')]=function(_0x199842,_0x436a68){return db['MailAccount']['find']({'where':{'id':_0x199842['params']['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x436a68,null))[_0x4b56('0x3f')](function(_0x167786){if(_0x167786&&_0x167786[_0x4b56('0x84')]){throw new db['Sequelize']['ValidationError'](_0x4b56('0xc4'));}return _0x167786;})['then'](removeEntity(_0x436a68,null))[_0x4b56('0x31')](handleError(_0x436a68,null));};exports['addAgents']=function(_0xaaa29e,_0x369ae8,_0x4c4a6a){return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0xaaa29e[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x369ae8,null))['then'](function(_0x41d71c){if(_0x41d71c){return _0x41d71c[_0x4b56('0xc5')](_0xaaa29e[_0x4b56('0x6a')][_0x4b56('0x75')],_['omit'](_0xaaa29e[_0x4b56('0x6a')],[_0x4b56('0x75'),'id'])||{})[_0x4b56('0xc6')](function(_0x4a7acd){for(var _0x3b1e5b=0x0;_0x3b1e5b<_0xaaa29e[_0x4b56('0x6a')]['ids'][_0x4b56('0x58')];_0x3b1e5b+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0xaaa29e[_0x4b56('0x6a')]['ids'][_0x3b1e5b]),'MailAccountId':Number(_0xaaa29e[_0x4b56('0x66')]['id'])});}return _0x4a7acd;});}})[_0x4b56('0x3f')](respondWithResult(_0x369ae8,null))[_0x4b56('0x31')](handleError(_0x369ae8,null));};exports[_0x4b56('0xc7')]=function(_0x572768,_0x1ba800,_0x2c53a2){return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x572768[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x1ba800,null))[_0x4b56('0x3f')](function(_0x38a2b4){if(_0x38a2b4){return _0x38a2b4[_0x4b56('0xc7')](_0x572768[_0x4b56('0x52')][_0x4b56('0x75')])['then'](function(){if(_[_0x4b56('0xc8')](_0x572768[_0x4b56('0x52')][_0x4b56('0x75')])){for(var _0x4fe9d5=0x0;_0x4fe9d5<_0x572768[_0x4b56('0x52')][_0x4b56('0x75')][_0x4b56('0x58')];_0x4fe9d5+=0x1){socket['emit'](_0x4b56('0xc9'),{'UserId':Number(_0x572768[_0x4b56('0x52')]['ids'][_0x4fe9d5]),'MailAccountId':Number(_0x572768['params']['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x572768[_0x4b56('0x52')]['ids']),'MailAccountId':Number(_0x572768[_0x4b56('0x66')]['id'])});}});}})[_0x4b56('0x3f')](respondWithStatusCode(_0x1ba800,null))[_0x4b56('0x31')](handleError(_0x1ba800,null));};exports['getAgents']=function(_0x16fa4d,_0x3586d4,_0x16ed38){var _0x3bd2a5={};var _0x2b89e0={};var _0x603f3;var _0x22706f;return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x16fa4d[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x3586d4,null))[_0x4b56('0x3f')](function(_0x50e856){if(_0x50e856){_0x603f3=_0x50e856;_0x2b89e0['model']=_[_0x4b56('0x53')](db[_0x4b56('0x97')][_0x4b56('0x4d')]);_0x2b89e0['query']=_['keys'](_0x16fa4d[_0x4b56('0x52')]);_0x2b89e0[_0x4b56('0x54')]=_[_0x4b56('0x55')](_0x2b89e0[_0x4b56('0x51')],_0x2b89e0['query']);_0x3bd2a5[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x2b89e0['model'],qs[_0x4b56('0x57')](_0x16fa4d[_0x4b56('0x52')][_0x4b56('0x57')]));_0x3bd2a5[_0x4b56('0x56')]=_0x3bd2a5[_0x4b56('0x56')][_0x4b56('0x58')]?_0x3bd2a5[_0x4b56('0x56')]:_0x2b89e0['model'];_0x3bd2a5[_0x4b56('0x5a')]=qs[_0x4b56('0x5b')](_0x16fa4d['query']['sort']);_0x3bd2a5[_0x4b56('0x5c')]=qs[_0x4b56('0x54')](_[_0x4b56('0x5d')](_0x16fa4d[_0x4b56('0x52')],_0x2b89e0[_0x4b56('0x54')]));if(_0x16fa4d[_0x4b56('0x52')][_0x4b56('0x5e')]){_0x3bd2a5[_0x4b56('0x5c')]=_[_0x4b56('0x68')](_0x3bd2a5[_0x4b56('0x5c')],{'$or':_[_0x4b56('0x4b')](_0x3bd2a5[_0x4b56('0x56')],function(_0x34d532){var _0x53afd2={};_0x53afd2[_0x34d532]={'$like':'%'+_0x16fa4d[_0x4b56('0x52')][_0x4b56('0x5e')]+'%'};return _0x53afd2;})});}_0x3bd2a5=_[_0x4b56('0x68')]({},_0x3bd2a5,_0x16fa4d['options']);return _0x603f3[_0x4b56('0xca')](_0x3bd2a5);}})[_0x4b56('0x3f')](function(_0x12371b){if(_0x12371b){_0x22706f=_0x12371b['length'];if(!_0x16fa4d[_0x4b56('0x52')][_0x4b56('0x59')](_0x4b56('0x73'))){_0x3bd2a5[_0x4b56('0x37')]=qs[_0x4b56('0x37')](_0x16fa4d[_0x4b56('0x52')]['limit']);_0x3bd2a5['offset']=qs[_0x4b56('0x39')](_0x16fa4d['query']['offset']);}return _0x603f3[_0x4b56('0xca')](_0x3bd2a5);}})[_0x4b56('0x3f')](function(_0x4cd64f){if(_0x4cd64f){return _0x4cd64f?{'count':_0x22706f,'rows':_0x4cd64f}:null;}})['then'](respondWithResult(_0x3586d4,null))[_0x4b56('0x31')](handleError(_0x3586d4,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index a0eb7d5..8daabd1 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 _0x87f1=['MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x1f1d4f,_0xf024bb){var _0xa70fc=function(_0x2d03f5){while(--_0x2d03f5){_0x1f1d4f['push'](_0x1f1d4f['shift']());}};_0xa70fc(++_0xf024bb);}(_0x87f1,0x170));var _0x187f=function(_0x2613e1,_0x6065a8){_0x2613e1=_0x2613e1-0x0;var _0x5a05bb=_0x87f1[_0x2613e1];return _0x5a05bb;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x187f('0x0'))['db'][_0x187f('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x187f('0x2')](0x0);var events={'afterCreate':_0x187f('0x3'),'afterUpdate':_0x187f('0x4'),'afterDestroy':_0x187f('0x5')};function emitEvent(_0x233cda){return function(_0x5eafdc,_0x19e8fb,_0x4c6db8){MailAccountEvents[_0x187f('0x6')](_0x233cda+':'+_0x5eafdc['id'],_0x5eafdc);MailAccountEvents['emit'](_0x233cda,_0x5eafdc);_0x4c6db8(null);};}for(var e in events){if(events[_0x187f('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x187f('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xc3f3=['../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x41c76c,_0x35ea63){var _0x1ef927=function(_0x1b814b){while(--_0x1b814b){_0x41c76c['push'](_0x41c76c['shift']());}};_0x1ef927(++_0x35ea63);}(_0xc3f3,0xd2));var _0x3c3f=function(_0x7814cd,_0x44b892){_0x7814cd=_0x7814cd-0x0;var _0x482941=_0xc3f3[_0x7814cd];return _0x482941;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x3c3f('0x0'))['db'][_0x3c3f('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3c3f('0x2')](0x0);var events={'afterCreate':_0x3c3f('0x3'),'afterUpdate':_0x3c3f('0x4'),'afterDestroy':_0x3c3f('0x5')};function emitEvent(_0x377170){return function(_0x3a901e,_0x3ec810,_0x199c58){MailAccountEvents[_0x3c3f('0x6')](_0x377170+':'+_0x3a901e['id'],_0x3a901e);MailAccountEvents[_0x3c3f('0x6')](_0x377170,_0x3a901e);_0x199c58(null);};}for(var e in events){if(events[_0x3c3f('0x7')](e)){var event=events[e];MailAccount[_0x3c3f('0x8')](e,emitEvent(event));}}module[_0x3c3f('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 5de5386..2f9c0bf 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 _0x45ed=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x72c89e,_0x1d17bd){var _0x16a4cb=function(_0x399bed){while(--_0x399bed){_0x72c89e['push'](_0x72c89e['shift']());}};_0x16a4cb(++_0x1d17bd);}(_0x45ed,0x149));var _0xd45e=function(_0x5585a6,_0x1ad47d){_0x5585a6=_0x5585a6-0x0;var _0x36a760=_0x45ed[_0x5585a6];return _0x36a760;};'use strict';var _=require(_0xd45e('0x0'));var util=require(_0xd45e('0x1'));var logger=require(_0xd45e('0x2'))(_0xd45e('0x3'));var moment=require('moment');var BPromise=require(_0xd45e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd45e('0x5'));var rimraf=require(_0xd45e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd45e('0x7'));module[_0xd45e('0x8')]=function(_0x56187e,_0x376812){return _0x56187e[_0xd45e('0x9')](_0xd45e('0xa'),attributes,{'tableName':_0xd45e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ee4=['exports','define','MailAccount','mail_accounts','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./mailAccount.attributes'];(function(_0x321730,_0x1fb230){var _0x4344eb=function(_0x33163a){while(--_0x33163a){_0x321730['push'](_0x321730['shift']());}};_0x4344eb(++_0x1fb230);}(_0x1ee4,0x1c7));var _0x41ee=function(_0x183c58,_0x57c42f){_0x183c58=_0x183c58-0x0;var _0x41b2cd=_0x1ee4[_0x183c58];return _0x41b2cd;};'use strict';var _=require(_0x41ee('0x0'));var util=require('util');var logger=require(_0x41ee('0x1'))(_0x41ee('0x2'));var moment=require('moment');var BPromise=require(_0x41ee('0x3'));var rp=require(_0x41ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x41ee('0x5'));var attributes=require(_0x41ee('0x6'));module[_0x41ee('0x7')]=function(_0x32289b,_0x206e6c){return _0x32289b[_0x41ee('0x8')](_0x41ee('0x9'),attributes,{'tableName':_0x41ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index e69d130..653e979 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 _0xa2a1=['autoclose','create','List\x20not\x20found','contact','messageId','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','Email','ChatOfflineMessageId','Attachment','Attachments','name','UserId','unshift','*,*,*,*','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','raw','options','attributes','include','map','model','ShowMailAccount','find','where','NotifyMailAccount','body','mail','keys','updatedAt','CompanyId','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','priority','asc','push','close'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa2a1,0x147));var _0x1a2a=function(_0x1fefce,_0x5da114){_0x1fefce=_0x1fefce-0x0;var _0x5586de=_0xa2a1[_0x1fefce];return _0x5586de;};'use strict';var _=require(_0x1a2a('0x0'));var util=require(_0x1a2a('0x1'));var moment=require('moment');var BPromise=require(_0x1a2a('0x2'));var rs=require(_0x1a2a('0x3'));var fs=require('fs');var Redis=require(_0x1a2a('0x4'));var db=require(_0x1a2a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a2a('0x6'))('rpc');var config=require(_0x1a2a('0x7'));var jayson=require(_0x1a2a('0x8'));var client=jayson[_0x1a2a('0x9')]['http']({'port':0x232c});config[_0x1a2a('0xa')]=_[_0x1a2a('0xb')](config[_0x1a2a('0xa')],{'host':_0x1a2a('0xc'),'port':0x18eb});var socket=require(_0x1a2a('0xd'))(new Redis(config['redis']));require(_0x1a2a('0xe'))['register'](socket);function respondWithRpcPromise(_0x5598c9,_0x16eec7,_0x21133b){return new BPromise(function(_0x5e7b6e,_0x4b8fb6){return client['request'](_0x5598c9,_0x21133b)[_0x1a2a('0xf')](function(_0xf2a882){logger['info'](_0x1a2a('0x10'),_0x16eec7,_0x1a2a('0x11'));logger[_0x1a2a('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x16eec7,'request\x20sent',JSON[_0x1a2a('0x13')](_0xf2a882));if(_0xf2a882[_0x1a2a('0x14')]){if(_0xf2a882[_0x1a2a('0x14')][_0x1a2a('0x15')]===0x1f4){logger[_0x1a2a('0x14')]('MailAccount,\x20%s,\x20%s',_0x16eec7,_0xf2a882[_0x1a2a('0x14')][_0x1a2a('0x16')]);return _0x4b8fb6(_0xf2a882[_0x1a2a('0x14')]['message']);}logger['error'](_0x1a2a('0x10'),_0x16eec7,_0xf2a882[_0x1a2a('0x14')]['message']);return _0x5e7b6e(_0xf2a882[_0x1a2a('0x14')][_0x1a2a('0x16')]);}else{logger[_0x1a2a('0x17')](_0x1a2a('0x10'),_0x16eec7,_0x1a2a('0x11'));_0x5e7b6e(_0xf2a882[_0x1a2a('0x18')][_0x1a2a('0x16')]);}})[_0x1a2a('0x19')](function(_0x44d6fe){logger[_0x1a2a('0x14')](_0x1a2a('0x10'),_0x16eec7,_0x44d6fe);_0x4b8fb6(_0x44d6fe);});});}exports[_0x1a2a('0x1a')]=function(_0x5372e0){var _0x1c1311=this;return new Promise(function(_0x4c3b2f,_0x51f1ac){return db[_0x1a2a('0x1b')][_0x1a2a('0x1c')]({'raw':_0x5372e0['options']?_0x5372e0['options'][_0x1a2a('0x1d')]===undefined?!![]:![]:!![],'where':_0x5372e0[_0x1a2a('0x1e')]?_0x5372e0[_0x1a2a('0x1e')]['where']||null:null,'attributes':_0x5372e0[_0x1a2a('0x1e')]?_0x5372e0[_0x1a2a('0x1e')][_0x1a2a('0x1f')]||null:null,'limit':_0x5372e0[_0x1a2a('0x1e')]?_0x5372e0[_0x1a2a('0x1e')]['limit']||null:null,'include':_0x5372e0['options']?_0x5372e0['options'][_0x1a2a('0x20')]?_[_0x1a2a('0x21')](_0x5372e0[_0x1a2a('0x1e')]['include'],function(_0x490423){return{'model':db[_0x490423['model']],'as':_0x490423['as'],'attributes':_0x490423[_0x1a2a('0x1f')],'include':_0x490423[_0x1a2a('0x20')]?_[_0x1a2a('0x21')](_0x490423['include'],function(_0xac2615){return{'model':db[_0xac2615[_0x1a2a('0x22')]],'as':_0xac2615['as'],'attributes':_0xac2615[_0x1a2a('0x1f')],'include':_0xac2615['include']?_[_0x1a2a('0x21')](_0xac2615['include'],function(_0x4888d1){return{'model':db[_0x4888d1[_0x1a2a('0x22')]],'as':_0x4888d1['as'],'attributes':_0x4888d1[_0x1a2a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1a2a('0xf')](function(_0x3f920a){logger[_0x1a2a('0x17')](_0x1a2a('0x1a'),_0x5372e0);logger['debug'](_0x1a2a('0x1a'),_0x5372e0,JSON[_0x1a2a('0x13')](_0x3f920a));_0x4c3b2f(_0x3f920a);})[_0x1a2a('0x19')](function(_0x187288){logger['error'](_0x1a2a('0x1a'),_0x187288['message'],_0x5372e0);_0x51f1ac(_0x1c1311[_0x1a2a('0x14')](0x1f4,_0x187288[_0x1a2a('0x16')]));});});};exports[_0x1a2a('0x23')]=function(_0x271d29){var _0x18ff3b=this;return new Promise(function(_0x3d4e8c,_0x1e88ce){return db[_0x1a2a('0x1b')][_0x1a2a('0x24')]({'raw':_0x271d29[_0x1a2a('0x1e')]?_0x271d29[_0x1a2a('0x1e')][_0x1a2a('0x1d')]===undefined?!![]:![]:!![],'where':_0x271d29[_0x1a2a('0x1e')]?_0x271d29['options'][_0x1a2a('0x25')]||null:null,'attributes':_0x271d29[_0x1a2a('0x1e')]?_0x271d29[_0x1a2a('0x1e')][_0x1a2a('0x1f')]||null:null,'include':_0x271d29[_0x1a2a('0x1e')]?_0x271d29[_0x1a2a('0x1e')][_0x1a2a('0x20')]?_[_0x1a2a('0x21')](_0x271d29[_0x1a2a('0x1e')][_0x1a2a('0x20')],function(_0x309420){return{'model':db[_0x309420[_0x1a2a('0x22')]],'as':_0x309420['as'],'attributes':_0x309420[_0x1a2a('0x1f')],'include':_0x309420[_0x1a2a('0x20')]?_[_0x1a2a('0x21')](_0x309420['include'],function(_0x515c46){return{'model':db[_0x515c46[_0x1a2a('0x22')]],'as':_0x515c46['as'],'attributes':_0x515c46['attributes'],'include':_0x515c46[_0x1a2a('0x20')]?_['map'](_0x515c46[_0x1a2a('0x20')],function(_0x1b9623){return{'model':db[_0x1b9623[_0x1a2a('0x22')]],'as':_0x1b9623['as'],'attributes':_0x1b9623[_0x1a2a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1a2a('0xf')](function(_0x44eec5){logger[_0x1a2a('0x17')](_0x1a2a('0x23'),_0x271d29);logger['debug']('ShowMailAccount',_0x271d29,JSON['stringify'](_0x44eec5));_0x3d4e8c(_0x44eec5);})['catch'](function(_0x1a3caf){logger[_0x1a2a('0x14')](_0x1a2a('0x23'),_0x1a3caf['message'],_0x271d29);_0x1e88ce(_0x18ff3b[_0x1a2a('0x14')](0x1f4,_0x1a3caf['message']));});});};exports[_0x1a2a('0x26')]=function(_0x55dbef){var _0x4e9fe9=this;return new Promise(function(_0x3db1d1,_0x1b9322){var _0x57b8b6={'body':_0x55dbef[_0x1a2a('0x27')],'channel':_0x1a2a('0x28')};var _0x95676e=_['difference'](_[_0x1a2a('0x29')](db['CmContact']['rawAttributes']),['createdAt',_0x1a2a('0x2a'),_0x1a2a('0x2b'),_0x1a2a('0x2c')]);var _0x39c100=![];if(_0x55dbef[_0x1a2a('0x27')]['id']){delete _0x55dbef[_0x1a2a('0x27')]['id'];}if(_[_0x1a2a('0x2d')](_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2e')])){return _0x1b9322(_0x4e9fe9[_0x1a2a('0x14')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x55dbef[_0x1a2a('0x27')]['body'])||_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x27')]===''){return _0x1b9322(_0x4e9fe9[_0x1a2a('0x14')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1a2a('0x2d')](_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2f')])){return _0x1b9322(_0x4e9fe9[_0x1a2a('0x14')](0x1f4,_0x1a2a('0x30')+_0x95676e));}if(!_[_0x1a2a('0x31')](_0x95676e,_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2f')])){return _0x1b9322(_0x4e9fe9[_0x1a2a('0x14')](0x1f4,_0x1a2a('0x32')+_0x95676e));}var _0x47b252={};_0x47b252[_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2f')]]=_0x55dbef['body']['from'];return db['MailAccount'][_0x1a2a('0x24')]({'where':{'id':_0x55dbef[_0x1a2a('0x33')]['id']},'include':[{'model':db[_0x1a2a('0x34')],'as':_0x1a2a('0x35'),'include':[{'model':db['CmContact'],'as':_0x1a2a('0x36'),'where':_0x47b252,'limit':0x1,'order':[[_0x1a2a('0x2a'),_0x1a2a('0x37')]]}]},{'model':db[_0x1a2a('0x38')],'as':_0x1a2a('0x39')},{'model':db[_0x1a2a('0x3a')],'as':_0x1a2a('0x3b')}]})['then'](function(_0x5259f3){if(_0x5259f3&&_0x5259f3[_0x1a2a('0x35')]){var _0x2dd47d=_0x5259f3[_0x1a2a('0x3c')]({'plain':!![]});_0x57b8b6[_0x1a2a('0x33')]=_[_0x1a2a('0x3d')](_0x2dd47d,[_0x1a2a('0x39'),_0x1a2a('0x35')]);_0x57b8b6[_0x1a2a('0x3e')]=_0x2dd47d[_0x1a2a('0x39')];_0x57b8b6[_0x1a2a('0x3f')]=_0x2dd47d[_0x1a2a('0x35')];_0x57b8b6['applications']=_[_0x1a2a('0x40')](_0x57b8b6[_0x1a2a('0x3e')],[_0x1a2a('0x41')],[_0x1a2a('0x42')]);if(_0x57b8b6[_0x1a2a('0x33')]&&_0x57b8b6[_0x1a2a('0x33')]['autoclose']){_0x57b8b6[_0x1a2a('0x3e')][_0x1a2a('0x43')]({'id':0x0,'priority':_0x57b8b6[_0x1a2a('0x3e')]['length']+0x1,'app':_0x1a2a('0x44'),'appdata':_0x1a2a('0x45'),'interval':'*,*,*,*'});}if(_0x57b8b6[_0x1a2a('0x33')][_0x1a2a('0x39')]){delete _0x57b8b6[_0x1a2a('0x33')][_0x1a2a('0x39')];}if(_0x57b8b6[_0x1a2a('0x33')][_0x1a2a('0x35')]){delete _0x57b8b6[_0x1a2a('0x33')][_0x1a2a('0x35')];}if(_0x2dd47d[_0x1a2a('0x35')][_0x1a2a('0x36')]['length']){return _0x2dd47d[_0x1a2a('0x35')][_0x1a2a('0x36')][0x0];}var _0x13c526=_[_0x1a2a('0xb')](_0x55dbef['body'],{'firstName':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2e')],'ListId':_0x2dd47d[_0x1a2a('0x2c')]});_0x13c526[_0x55dbef[_0x1a2a('0x27')]['mapKey']]=_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2e')];return db['CmContact'][_0x1a2a('0x46')](_0x13c526);}else{throw new Error(_0x1a2a('0x47'));}})[_0x1a2a('0xf')](function(_0x57e06e){_0x57b8b6[_0x1a2a('0x48')]=_0x57e06e;if(_0x57e06e){if(!_0x55dbef[_0x1a2a('0x27')]['message'][_0x1a2a('0x49')]){_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x49')]=rs['generate']()+'\x20'+_0x55dbef[_0x1a2a('0x27')]['message']['from'];}var _0x588113={'ContactId':_0x57e06e['id'],'MailAccountId':_0x55dbef['account']['id'],'inReplyTo':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['messageId'],'to':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x2e')],'cc':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['cc'],'subject':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['subject'],'attach':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['attach'],'lastMsgAt':moment()[_0x1a2a('0x4a')](_0x1a2a('0x4b')),'lastMsgDirection':'in'};return db[_0x1a2a('0x4c')][_0x1a2a('0x24')]({'where':{'closed':![],'MailAccountId':_0x55dbef[_0x1a2a('0x33')]['id']},'include':[{'model':db[_0x1a2a('0x4d')],'as':'Messages','attributes':[_0x1a2a('0x49')],'where':{'messageId':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x4e')]}}]})[_0x1a2a('0xf')](function(_0x57fe11){if(_0x57fe11){return[_0x57fe11,![]];}return db[_0x1a2a('0x4c')][_0x1a2a('0x46')](_0x588113)['then'](function(_0x3a0704){return[_0x3a0704,!![]];});});}else{throw new Error(_0x1a2a('0x4f'));}})[_0x1a2a('0x50')](function(_0x37c033,_0x49807c){if(_0x37c033){_0x39c100=_0x49807c;if(!_0x49807c){return _0x37c033[_0x1a2a('0x51')]({'inReplyTo':_0x55dbef[_0x1a2a('0x27')]['message'][_0x1a2a('0x49')],'to':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x2e')],'cc':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['cc'],'subject':_0x55dbef['body'][_0x1a2a('0x16')]['subject'],'attach':_0x37c033[_0x1a2a('0x52')]?_0x37c033[_0x1a2a('0x52')]:_0x55dbef['body'][_0x1a2a('0x16')][_0x1a2a('0x52')],'substatus':null,'substatusAt':moment()['format'](_0x1a2a('0x4b')),'lastMsgAt':moment()[_0x1a2a('0x4a')](_0x1a2a('0x4b')),'lastMsgDirection':'in'});}else{return _0x37c033;}}})[_0x1a2a('0xf')](function(_0x32b12f){_0x57b8b6[_0x1a2a('0x53')]=_0x32b12f[_0x1a2a('0x3c')]({'plain':!![]});_0x57b8b6[_0x1a2a('0x53')][_0x1a2a('0x54')]=_0x39c100;return db[_0x1a2a('0x4d')]['create']({'body':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x27')],'MailAccountId':_0x55dbef['account']['id'],'MailInteractionId':_0x32b12f['id'],'direction':'in','ContactId':_0x57b8b6[_0x1a2a('0x48')]['id'],'messageId':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x49')],'from':_0x55dbef['body']['message'][_0x1a2a('0x2e')],'to':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['to'],'cc':_0x55dbef['body'][_0x1a2a('0x16')]['cc'],'subject':_0x55dbef['body']['message']['subject'],'attach':_0x55dbef['body'][_0x1a2a('0x16')]['attach'],'Attachments':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x55')],'originTo':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x56')],'originCc':_0x55dbef['body'][_0x1a2a('0x16')][_0x1a2a('0x57')],'bcc':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x58')],'ChatWebsiteId':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['ChatWebsiteId']||null,'originChannel':_0x55dbef['body'][_0x1a2a('0x16')]['originChannel']||_0x1a2a('0x59'),'ChatOfflineMessageId':_0x55dbef['body'][_0x1a2a('0x16')][_0x1a2a('0x5a')]||null},{'include':[{'model':db[_0x1a2a('0x5b')],'as':_0x1a2a('0x5c')}]});})[_0x1a2a('0xf')](function(_0x508a0a){_0x57b8b6[_0x1a2a('0x16')]=_0x508a0a;if(_0x57b8b6[_0x1a2a('0x53')]['UserId']){return db['User'][_0x1a2a('0x24')]({'attributes':['id',_0x1a2a('0x5d')],'where':{'id':_0x57b8b6['interaction'][_0x1a2a('0x5e')]}})['then'](function(_0x17b949){if(_0x17b949){_0x57b8b6[_0x1a2a('0x3e')][_0x1a2a('0x5f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x17b949['name']+','+(_0x57b8b6[_0x1a2a('0x33')]['waitForTheAssignedAgent']||0xa),'interval':_0x1a2a('0x60')});}return respondWithRpcPromise(_0x1a2a('0x61'),_0x1a2a('0x62'),_0x57b8b6);});}return respondWithRpcPromise(_0x1a2a('0x61'),'startRouting',_0x57b8b6);})['then'](function(_0x2ad8f6){_0x3db1d1(_0x2ad8f6);})[_0x1a2a('0x19')](function(_0x59776c){_0x1b9322(_0x4e9fe9[_0x1a2a('0x14')](0x1f4,_0x59776c[_0x1a2a('0x16')]));});});}; \ No newline at end of file +var _0x27a0=['format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetMailAccount','MailAccount','findAll','options','raw','map','include','attributes','model','then','debug','stringify','catch','ShowMailAccount','find','NotifyMailAccount','body','keys','CmContact','rawAttributes','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','get','applications','list','orderBy','priority','asc','autoclose','push','length','close','contact','messageId','generate','subject'];(function(_0x3391a2,_0x4daa14){var _0x1c4da1=function(_0x2528fa){while(--_0x2528fa){_0x3391a2['push'](_0x3391a2['shift']());}};_0x1c4da1(++_0x4daa14);}(_0x27a0,0x145));var _0x027a=function(_0x592821,_0x3c0090){_0x592821=_0x592821-0x0;var _0x1c2d87=_0x27a0[_0x592821];return _0x1c2d87;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var BPromise=require('bluebird');var rs=require(_0x027a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x027a('0x3'));var logger=require(_0x027a('0x4'))('rpc');var config=require(_0x027a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x027a('0x6')]({'port':0x232c});config['redis']=_[_0x027a('0x7')](config[_0x027a('0x8')],{'host':_0x027a('0x9'),'port':0x18eb});var socket=require(_0x027a('0xa'))(new Redis(config[_0x027a('0x8')]));require('./mailAccount.socket')[_0x027a('0xb')](socket);function respondWithRpcPromise(_0x456f34,_0x2fe6c5,_0x432158){return new BPromise(function(_0x569588,_0x3949a6){return client[_0x027a('0xc')](_0x456f34,_0x432158)['then'](function(_0x2f2a9d){logger[_0x027a('0xd')](_0x027a('0xe'),_0x2fe6c5,_0x027a('0xf'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x2fe6c5,'request\x20sent',JSON['stringify'](_0x2f2a9d));if(_0x2f2a9d[_0x027a('0x10')]){if(_0x2f2a9d['error'][_0x027a('0x11')]===0x1f4){logger[_0x027a('0x10')](_0x027a('0xe'),_0x2fe6c5,_0x2f2a9d['error'][_0x027a('0x12')]);return _0x3949a6(_0x2f2a9d[_0x027a('0x10')][_0x027a('0x12')]);}logger[_0x027a('0x10')](_0x027a('0xe'),_0x2fe6c5,_0x2f2a9d[_0x027a('0x10')]['message']);return _0x569588(_0x2f2a9d['error'][_0x027a('0x12')]);}else{logger[_0x027a('0xd')]('MailAccount,\x20%s,\x20%s',_0x2fe6c5,_0x027a('0xf'));_0x569588(_0x2f2a9d[_0x027a('0x13')]['message']);}})['catch'](function(_0x364591){logger[_0x027a('0x10')](_0x027a('0xe'),_0x2fe6c5,_0x364591);_0x3949a6(_0x364591);});});}exports[_0x027a('0x14')]=function(_0x1a8a57){var _0x4b71af=this;return new Promise(function(_0x5e6694,_0x575ba9){return db[_0x027a('0x15')][_0x027a('0x16')]({'raw':_0x1a8a57[_0x027a('0x17')]?_0x1a8a57[_0x027a('0x17')][_0x027a('0x18')]===undefined?!![]:![]:!![],'where':_0x1a8a57['options']?_0x1a8a57[_0x027a('0x17')]['where']||null:null,'attributes':_0x1a8a57[_0x027a('0x17')]?_0x1a8a57[_0x027a('0x17')]['attributes']||null:null,'limit':_0x1a8a57[_0x027a('0x17')]?_0x1a8a57['options']['limit']||null:null,'include':_0x1a8a57[_0x027a('0x17')]?_0x1a8a57[_0x027a('0x17')]['include']?_[_0x027a('0x19')](_0x1a8a57[_0x027a('0x17')][_0x027a('0x1a')],function(_0xed3700){return{'model':db[_0xed3700['model']],'as':_0xed3700['as'],'attributes':_0xed3700[_0x027a('0x1b')],'include':_0xed3700['include']?_[_0x027a('0x19')](_0xed3700[_0x027a('0x1a')],function(_0x2a1bba){return{'model':db[_0x2a1bba[_0x027a('0x1c')]],'as':_0x2a1bba['as'],'attributes':_0x2a1bba['attributes'],'include':_0x2a1bba['include']?_[_0x027a('0x19')](_0x2a1bba[_0x027a('0x1a')],function(_0x2fd795){return{'model':db[_0x2fd795['model']],'as':_0x2fd795['as'],'attributes':_0x2fd795[_0x027a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x027a('0x1d')](function(_0x4d4510){logger['info'](_0x027a('0x14'),_0x1a8a57);logger[_0x027a('0x1e')](_0x027a('0x14'),_0x1a8a57,JSON[_0x027a('0x1f')](_0x4d4510));_0x5e6694(_0x4d4510);})[_0x027a('0x20')](function(_0x53efed){logger[_0x027a('0x10')](_0x027a('0x14'),_0x53efed[_0x027a('0x12')],_0x1a8a57);_0x575ba9(_0x4b71af[_0x027a('0x10')](0x1f4,_0x53efed[_0x027a('0x12')]));});});};exports[_0x027a('0x21')]=function(_0x29182c){var _0x1e3ffa=this;return new Promise(function(_0x3ed46e,_0x1de787){return db[_0x027a('0x15')][_0x027a('0x22')]({'raw':_0x29182c['options']?_0x29182c['options'][_0x027a('0x18')]===undefined?!![]:![]:!![],'where':_0x29182c[_0x027a('0x17')]?_0x29182c[_0x027a('0x17')]['where']||null:null,'attributes':_0x29182c[_0x027a('0x17')]?_0x29182c[_0x027a('0x17')]['attributes']||null:null,'include':_0x29182c[_0x027a('0x17')]?_0x29182c[_0x027a('0x17')][_0x027a('0x1a')]?_[_0x027a('0x19')](_0x29182c['options'][_0x027a('0x1a')],function(_0x27f324){return{'model':db[_0x27f324[_0x027a('0x1c')]],'as':_0x27f324['as'],'attributes':_0x27f324[_0x027a('0x1b')],'include':_0x27f324[_0x027a('0x1a')]?_[_0x027a('0x19')](_0x27f324['include'],function(_0x488348){return{'model':db[_0x488348[_0x027a('0x1c')]],'as':_0x488348['as'],'attributes':_0x488348[_0x027a('0x1b')],'include':_0x488348[_0x027a('0x1a')]?_[_0x027a('0x19')](_0x488348['include'],function(_0x408eb6){return{'model':db[_0x408eb6[_0x027a('0x1c')]],'as':_0x408eb6['as'],'attributes':_0x408eb6['attributes']};}):[]};}):[]};}):[]:[]})[_0x027a('0x1d')](function(_0x499b36){logger['info'](_0x027a('0x21'),_0x29182c);logger['debug'](_0x027a('0x21'),_0x29182c,JSON[_0x027a('0x1f')](_0x499b36));_0x3ed46e(_0x499b36);})[_0x027a('0x20')](function(_0x4da565){logger[_0x027a('0x10')](_0x027a('0x21'),_0x4da565[_0x027a('0x12')],_0x29182c);_0x1de787(_0x1e3ffa[_0x027a('0x10')](0x1f4,_0x4da565['message']));});});};exports[_0x027a('0x23')]=function(_0x54dd53){var _0x461f7a=this;return new Promise(function(_0x1037c2,_0x51e092){var _0x1487f6={'body':_0x54dd53[_0x027a('0x24')],'channel':'mail'};var _0x251c7f=_['difference'](_[_0x027a('0x25')](db[_0x027a('0x26')][_0x027a('0x27')]),['createdAt','updatedAt',_0x027a('0x28'),_0x027a('0x29')]);var _0x137eb8=![];if(_0x54dd53[_0x027a('0x24')]['id']){delete _0x54dd53[_0x027a('0x24')]['id'];}if(_[_0x027a('0x2a')](_0x54dd53[_0x027a('0x24')][_0x027a('0x2b')])){return _0x51e092(_0x461f7a[_0x027a('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x027a('0x2a')](_0x54dd53[_0x027a('0x24')]['body'])||_0x54dd53['body'][_0x027a('0x24')]===''){return _0x51e092(_0x461f7a[_0x027a('0x10')](0x1f4,_0x027a('0x2c')));}if(_['isNil'](_0x54dd53[_0x027a('0x24')][_0x027a('0x2d')])){return _0x51e092(_0x461f7a[_0x027a('0x10')](0x1f4,_0x027a('0x2e')+_0x251c7f));}if(!_['includes'](_0x251c7f,_0x54dd53['body'][_0x027a('0x2d')])){return _0x51e092(_0x461f7a['error'](0x1f4,_0x027a('0x2f')+_0x251c7f));}var _0x32ba00={};_0x32ba00[_0x54dd53[_0x027a('0x24')][_0x027a('0x2d')]]=_0x54dd53[_0x027a('0x24')]['from'];return db[_0x027a('0x15')]['find']({'where':{'id':_0x54dd53[_0x027a('0x30')]['id']},'include':[{'model':db['CmList'],'as':_0x027a('0x31'),'include':[{'model':db[_0x027a('0x26')],'as':_0x027a('0x32'),'where':_0x32ba00,'limit':0x1,'order':[[_0x027a('0x33'),_0x027a('0x34')]]}]},{'model':db[_0x027a('0x35')],'as':_0x027a('0x36')},{'model':db[_0x027a('0x37')],'as':_0x027a('0x38')}]})[_0x027a('0x1d')](function(_0x2cd3d8){if(_0x2cd3d8&&_0x2cd3d8[_0x027a('0x31')]){var _0x28ad93=_0x2cd3d8[_0x027a('0x39')]({'plain':!![]});_0x1487f6[_0x027a('0x30')]=_['omit'](_0x28ad93,[_0x027a('0x36'),_0x027a('0x31')]);_0x1487f6[_0x027a('0x3a')]=_0x28ad93[_0x027a('0x36')];_0x1487f6[_0x027a('0x3b')]=_0x28ad93[_0x027a('0x31')];_0x1487f6['applications']=_[_0x027a('0x3c')](_0x1487f6['applications'],[_0x027a('0x3d')],[_0x027a('0x3e')]);if(_0x1487f6[_0x027a('0x30')]&&_0x1487f6['account'][_0x027a('0x3f')]){_0x1487f6[_0x027a('0x3a')][_0x027a('0x40')]({'id':0x0,'priority':_0x1487f6[_0x027a('0x3a')][_0x027a('0x41')]+0x1,'app':_0x027a('0x42'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x1487f6[_0x027a('0x30')][_0x027a('0x36')]){delete _0x1487f6['account'][_0x027a('0x36')];}if(_0x1487f6[_0x027a('0x30')]['List']){delete _0x1487f6[_0x027a('0x30')][_0x027a('0x31')];}if(_0x28ad93[_0x027a('0x31')][_0x027a('0x32')]['length']){return _0x28ad93[_0x027a('0x31')][_0x027a('0x32')][0x0];}var _0x39a905=_['defaults'](_0x54dd53[_0x027a('0x24')],{'firstName':_0x54dd53[_0x027a('0x24')][_0x027a('0x2b')],'ListId':_0x28ad93[_0x027a('0x29')]});_0x39a905[_0x54dd53[_0x027a('0x24')][_0x027a('0x2d')]]=_0x54dd53[_0x027a('0x24')][_0x027a('0x2b')];return db[_0x027a('0x26')]['create'](_0x39a905);}else{throw new Error('List\x20not\x20found');}})[_0x027a('0x1d')](function(_0x416e9d){_0x1487f6[_0x027a('0x43')]=_0x416e9d;if(_0x416e9d){if(!_0x54dd53[_0x027a('0x24')][_0x027a('0x12')][_0x027a('0x44')]){_0x54dd53[_0x027a('0x24')]['message']['messageId']=rs[_0x027a('0x45')]()+'\x20'+_0x54dd53['body'][_0x027a('0x12')][_0x027a('0x2b')];}var _0x1b73da={'ContactId':_0x416e9d['id'],'MailAccountId':_0x54dd53[_0x027a('0x30')]['id'],'inReplyTo':_0x54dd53['body'][_0x027a('0x12')][_0x027a('0x44')],'to':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['from'],'cc':_0x54dd53[_0x027a('0x24')]['message']['cc'],'subject':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')][_0x027a('0x46')],'attach':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['attach'],'lastMsgAt':moment()[_0x027a('0x47')](_0x027a('0x48')),'lastMsgDirection':'in'};return db[_0x027a('0x49')][_0x027a('0x22')]({'where':{'closed':![],'MailAccountId':_0x54dd53[_0x027a('0x30')]['id']},'include':[{'model':db[_0x027a('0x4a')],'as':_0x027a('0x4b'),'attributes':['messageId'],'where':{'messageId':_0x54dd53[_0x027a('0x24')]['message'][_0x027a('0x4c')]}}]})[_0x027a('0x1d')](function(_0xea1ac5){if(_0xea1ac5){return[_0xea1ac5,![]];}return db[_0x027a('0x49')][_0x027a('0x4d')](_0x1b73da)[_0x027a('0x1d')](function(_0x9d4c4f){return[_0x9d4c4f,!![]];});});}else{throw new Error(_0x027a('0x4e'));}})[_0x027a('0x4f')](function(_0xcd9357,_0x920096){if(_0xcd9357){_0x137eb8=_0x920096;if(!_0x920096){return _0xcd9357['update']({'inReplyTo':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['messageId'],'to':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['from'],'cc':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['cc'],'subject':_0x54dd53['body']['message'][_0x027a('0x46')],'attach':_0xcd9357[_0x027a('0x50')]?_0xcd9357[_0x027a('0x50')]:_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['attach'],'substatus':null,'substatusAt':moment()[_0x027a('0x47')](_0x027a('0x48')),'lastMsgAt':moment()[_0x027a('0x47')](_0x027a('0x48')),'lastMsgDirection':'in'});}else{return _0xcd9357;}}})[_0x027a('0x1d')](function(_0x2feaa0){_0x1487f6[_0x027a('0x51')]=_0x2feaa0[_0x027a('0x39')]({'plain':!![]});_0x1487f6[_0x027a('0x51')][_0x027a('0x52')]=_0x137eb8;return db[_0x027a('0x4a')][_0x027a('0x4d')]({'body':_0x54dd53['body']['body'],'MailAccountId':_0x54dd53['account']['id'],'MailInteractionId':_0x2feaa0['id'],'direction':'in','ContactId':_0x1487f6[_0x027a('0x43')]['id'],'messageId':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')][_0x027a('0x44')],'from':_0x54dd53['body'][_0x027a('0x12')]['from'],'to':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['to'],'cc':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['cc'],'subject':_0x54dd53[_0x027a('0x24')]['message']['subject'],'attach':_0x54dd53['body'][_0x027a('0x12')]['attach'],'Attachments':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')][_0x027a('0x53')],'originTo':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')][_0x027a('0x54')],'originCc':_0x54dd53[_0x027a('0x24')]['message'][_0x027a('0x55')],'bcc':_0x54dd53[_0x027a('0x24')]['message'][_0x027a('0x56')],'ChatWebsiteId':_0x54dd53['body']['message'][_0x027a('0x57')]||null,'originChannel':_0x54dd53[_0x027a('0x24')]['message'][_0x027a('0x58')]||'Email','ChatOfflineMessageId':_0x54dd53['body'][_0x027a('0x12')][_0x027a('0x59')]||null},{'include':[{'model':db[_0x027a('0x5a')],'as':'Attachments'}]});})[_0x027a('0x1d')](function(_0x1b49cf){_0x1487f6[_0x027a('0x12')]=_0x1b49cf;if(_0x1487f6[_0x027a('0x51')][_0x027a('0x5b')]){return db[_0x027a('0x5c')][_0x027a('0x22')]({'attributes':['id',_0x027a('0x5d')],'where':{'id':_0x1487f6[_0x027a('0x51')]['UserId']}})[_0x027a('0x1d')](function(_0x4681f7){if(_0x4681f7){_0x1487f6['applications'][_0x027a('0x5e')]({'id':0x0,'priority':0x0,'app':_0x027a('0x5f'),'appdata':_0x4681f7[_0x027a('0x5d')]+','+(_0x1487f6[_0x027a('0x30')][_0x027a('0x60')]||0xa),'interval':_0x027a('0x61')});}return respondWithRpcPromise('Start','startRouting',_0x1487f6);});}return respondWithRpcPromise(_0x027a('0x62'),'startRouting',_0x1487f6);})['then'](function(_0x4405a5){_0x1037c2(_0x4405a5);})[_0x027a('0x20')](function(_0x279075){_0x51e092(_0x461f7a[_0x027a('0x10')](0x1f4,_0x279075['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index c39f3d0..200d073 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 _0x26d0=['mailAccount:','./mailAccount.events','save','emit','removeListener','length'];(function(_0x5aa2e9,_0x51c0fc){var _0x39c38d=function(_0x5812cc){while(--_0x5812cc){_0x5aa2e9['push'](_0x5aa2e9['shift']());}};_0x39c38d(++_0x51c0fc);}(_0x26d0,0x67));var _0x026d=function(_0x26aa2a,_0x150360){_0x26aa2a=_0x26aa2a-0x0;var _0x1058c8=_0x26d0[_0x26aa2a];return _0x1058c8;};'use strict';var MailAccountEvents=require(_0x026d('0x0'));var events=[_0x026d('0x1'),'remove','update'];function createListener(_0x4a3831,_0x4e2a17){return function(_0x4c4630){_0x4e2a17[_0x026d('0x2')](_0x4a3831,_0x4c4630);};}function removeListener(_0x8e4ee1,_0x377256){return function(){MailAccountEvents[_0x026d('0x3')](_0x8e4ee1,_0x377256);};}exports['register']=function(_0x467135){for(var _0x2c39be=0x0,_0x5906d0=events[_0x026d('0x4')];_0x2c39be<_0x5906d0;_0x2c39be++){var _0x4a465b=events[_0x2c39be];var _0x3ab647=createListener(_0x026d('0x5')+_0x4a465b,_0x467135);MailAccountEvents['on'](_0x4a465b,_0x3ab647);}}; \ No newline at end of file +var _0xfddb=['remove','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x2e7ef1,_0x50221d){var _0x39fa56=function(_0x3559d4){while(--_0x3559d4){_0x2e7ef1['push'](_0x2e7ef1['shift']());}};_0x39fa56(++_0x50221d);}(_0xfddb,0x1ea));var _0xbfdd=function(_0x49db31,_0x561cc9){_0x49db31=_0x49db31-0x0;var _0x23e28f=_0xfddb[_0x49db31];return _0x23e28f;};'use strict';var MailAccountEvents=require(_0xbfdd('0x0'));var events=[_0xbfdd('0x1'),_0xbfdd('0x2'),'update'];function createListener(_0x1b48cf,_0x4dbf55){return function(_0x503db0){_0x4dbf55['emit'](_0x1b48cf,_0x503db0);};}function removeListener(_0x5b2d47,_0x3ac703){return function(){MailAccountEvents['removeListener'](_0x5b2d47,_0x3ac703);};}exports[_0xbfdd('0x3')]=function(_0x113b76){for(var _0x99f0a8=0x0,_0x1be58d=events[_0xbfdd('0x4')];_0x99f0a8<_0x1be58d;_0x99f0a8++){var _0x3505ad=events[_0x99f0a8];var _0x1b2b3e=createListener(_0xbfdd('0x5')+_0x3505ad,_0x113b76);MailAccountEvents['on'](_0x3505ad,_0x1b2b3e);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 7716b55..3791b00 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 _0xf42b=['show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailApplication.controller','get','isAuthenticated'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xf42b,0x116));var _0xbf42=function(_0x3a5367,_0x55f4fe){_0x3a5367=_0x3a5367-0x0;var _0x124c0a=_0xf42b[_0x3a5367];return _0x124c0a;};'use strict';var multer=require('multer');var util=require(_0xbf42('0x0'));var path=require(_0xbf42('0x1'));var timeout=require(_0xbf42('0x2'));var express=require(_0xbf42('0x3'));var router=express[_0xbf42('0x4')]();var fs_extra=require(_0xbf42('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbf42('0x6'));var config=require('../../config/environment');var controller=require(_0xbf42('0x7'));router[_0xbf42('0x8')]('/:id',auth[_0xbf42('0x9')](),controller[_0xbf42('0xa')]);router[_0xbf42('0xb')]('/:id',auth[_0xbf42('0x9')](),controller[_0xbf42('0xc')]);router[_0xbf42('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xbf42('0xe')]);module[_0xbf42('0xf')]=router; \ No newline at end of file +var _0x3c78=['../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x3259ef,_0x2eb118){var _0x4a923f=function(_0x5c3835){while(--_0x5c3835){_0x3259ef['push'](_0x3259ef['shift']());}};_0x4a923f(++_0x2eb118);}(_0x3c78,0x162));var _0x83c7=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0x3c78[_0x3fa37f];return _0x5a01d5;};'use strict';var multer=require(_0x83c7('0x0'));var util=require(_0x83c7('0x1'));var path=require(_0x83c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x83c7('0x3'));var router=express['Router']();var fs_extra=require(_0x83c7('0x4'));var auth=require(_0x83c7('0x5'));var interaction=require(_0x83c7('0x6'));var config=require('../../config/environment');var controller=require(_0x83c7('0x7'));router['get'](_0x83c7('0x8'),auth[_0x83c7('0x9')](),controller[_0x83c7('0xa')]);router[_0x83c7('0xb')](_0x83c7('0x8'),auth[_0x83c7('0x9')](),controller[_0x83c7('0xc')]);router[_0x83c7('0xd')](_0x83c7('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x83c7('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 5114fbb..143f318 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 _0x0372=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x23096b,_0x35ebc1){var _0x24c0f4=function(_0x3ddd78){while(--_0x3ddd78){_0x23096b['push'](_0x23096b['shift']());}};_0x24c0f4(++_0x35ebc1);}(_0x0372,0x123));var _0x2037=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0x0372[_0x21b36c];return _0x236627;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2037('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x2037('0x1')],'allowNull':![],'defaultValue':_0x2037('0x2')},'appdata':{'type':Sequelize[_0x2037('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2037('0x4')}}; \ No newline at end of file +var _0xe209=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x46c657,_0x2bd0bc){var _0x4381f1=function(_0x60212d){while(--_0x60212d){_0x46c657['push'](_0x46c657['shift']());}};_0x4381f1(++_0x2bd0bc);}(_0xe209,0x92));var _0x9e20=function(_0x2f865f,_0x43c2df){_0x2f865f=_0x2f865f-0x0;var _0x15f18f=_0xe209[_0x2f865f];return _0x15f18f;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9e20('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9e20('0x1')],'allowNull':![],'defaultValue':_0x9e20('0x2')},'appdata':{'type':Sequelize[_0x9e20('0x3')]()},'description':{'type':Sequelize[_0x9e20('0x1')]},'interval':{'type':Sequelize[_0x9e20('0x1')],'defaultValue':_0x9e20('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index f8e95e4..ab622b4 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 _0xb43b=['name','status','send','show','params','keys','MailApplication','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(_0x105191,_0x485b8b){var _0x2fb62d=function(_0x3ae184){while(--_0x3ae184){_0x105191['push'](_0x105191['shift']());}};_0x2fb62d(++_0x485b8b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x49972c,_0x1cb014){_0x49972c=_0x49972c-0x0;var _0x443084=_0xb43b[_0x49972c];return _0x443084;};'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['MailApplication']['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 _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x4e6af9,_0x1fc28f){var _0x57033d=function(_0x21d7f8){while(--_0x21d7f8){_0x4e6af9['push'](_0x4e6af9['shift']());}};_0x57033d(++_0x1fc28f);}(_0xac4a,0x13f));var _0xaac4=function(_0x280568,_0x1acbba){_0x280568=_0x280568-0x0;var _0x11842f=_0xac4a[_0x280568];return _0x11842f;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 6a9094c..bede960 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 _0xc7eb=['moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2dd359,_0x456fd7){var _0x5485ab=function(_0x5a83f9){while(--_0x5a83f9){_0x2dd359['push'](_0x2dd359['shift']());}};_0x5485ab(++_0x456fd7);}(_0xc7eb,0xa5));var _0xbc7e=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0xc7eb[_0x393d69];return _0x3cee37;};'use strict';var _=require(_0xbc7e('0x0'));var util=require(_0xbc7e('0x1'));var logger=require(_0xbc7e('0x2'))('api');var moment=require(_0xbc7e('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc7e('0x4'));var fs=require('fs');var path=require(_0xbc7e('0x5'));var rimraf=require(_0xbc7e('0x6'));var config=require(_0xbc7e('0x7'));var attributes=require(_0xbc7e('0x8'));module[_0xbc7e('0x9')]=function(_0x3ac590,_0x5e045b){return _0x3ac590[_0xbc7e('0xa')](_0xbc7e('0xb'),attributes,{'tableName':_0xbc7e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbc7e('0xd')});}; \ No newline at end of file +var _0x4d66=['lodash','util','api','request-promise','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4_unicode_ci'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x4d66,0x8f));var _0x64d6=function(_0x3c719e,_0x19719d){_0x3c719e=_0x3c719e-0x0;var _0x2d09af=_0x4d66[_0x3c719e];return _0x2d09af;};'use strict';var _=require(_0x64d6('0x0'));var util=require(_0x64d6('0x1'));var logger=require('../../config/logger')(_0x64d6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64d6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64d6('0x4'));var config=require(_0x64d6('0x5'));var attributes=require(_0x64d6('0x6'));module['exports']=function(_0x1b30ed,_0x304b19){return _0x1b30ed[_0x64d6('0x7')](_0x64d6('0x8'),attributes,{'tableName':_0x64d6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x64d6('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6e071ce..e2de59c 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 _0xc926=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateMailApplication','MailApplication','update','options','raw','where','limit','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xc926,0x11b));var _0x6c92=function(_0x431778,_0x261a44){_0x431778=_0x431778-0x0;var _0x15182a=_0xc926[_0x431778];return _0x15182a;};'use strict';var _=require(_0x6c92('0x0'));var util=require(_0x6c92('0x1'));var moment=require(_0x6c92('0x2'));var BPromise=require(_0x6c92('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c92('0x4'));var db=require(_0x6c92('0x5'))['db'];var utils=require(_0x6c92('0x6'));var logger=require(_0x6c92('0x7'))(_0x6c92('0x8'));var config=require(_0x6c92('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6c92('0xa')][_0x6c92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29f13e,_0x5c578e,_0x55da07){return new BPromise(function(_0x385898,_0x4c5582){return client[_0x6c92('0xc')](_0x29f13e,_0x55da07)[_0x6c92('0xd')](function(_0x1b1f1d){logger['info'](_0x6c92('0xe'),_0x5c578e,_0x6c92('0xf'));logger[_0x6c92('0x10')](_0x6c92('0x11'),_0x5c578e,'request\x20sent',JSON[_0x6c92('0x12')](_0x1b1f1d));if(_0x1b1f1d[_0x6c92('0x13')]){if(_0x1b1f1d['error'][_0x6c92('0x14')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x5c578e,_0x1b1f1d[_0x6c92('0x13')][_0x6c92('0x15')]);return _0x4c5582(_0x1b1f1d[_0x6c92('0x13')][_0x6c92('0x15')]);}logger[_0x6c92('0x13')](_0x6c92('0xe'),_0x5c578e,_0x1b1f1d['error'][_0x6c92('0x15')]);return _0x385898(_0x1b1f1d[_0x6c92('0x13')]['message']);}else{logger[_0x6c92('0x16')]('MailApplication,\x20%s,\x20%s',_0x5c578e,_0x6c92('0xf'));_0x385898(_0x1b1f1d[_0x6c92('0x17')]['message']);}})['catch'](function(_0x12510d){logger['error'](_0x6c92('0xe'),_0x5c578e,_0x12510d);_0x4c5582(_0x12510d);});});}exports[_0x6c92('0x18')]=function(_0x4c9575){var _0x128212=this;return new Promise(function(_0x3f35f4,_0x4b332a){return db[_0x6c92('0x19')][_0x6c92('0x1a')](_0x4c9575['body'],{'raw':_0x4c9575[_0x6c92('0x1b')]?_0x4c9575[_0x6c92('0x1b')][_0x6c92('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c9575[_0x6c92('0x1b')]?_0x4c9575['options'][_0x6c92('0x1d')]||null:null,'attributes':_0x4c9575[_0x6c92('0x1b')]?_0x4c9575['options']['attributes']||null:null,'limit':_0x4c9575[_0x6c92('0x1b')]?_0x4c9575[_0x6c92('0x1b')][_0x6c92('0x1e')]||null:null})[_0x6c92('0xd')](function(_0x2b9ca1){logger[_0x6c92('0x16')](_0x6c92('0x18'),_0x4c9575);logger[_0x6c92('0x10')](_0x6c92('0x18'),_0x4c9575,JSON[_0x6c92('0x12')](_0x2b9ca1));_0x3f35f4(_0x2b9ca1);})[_0x6c92('0x1f')](function(_0x22c996){logger[_0x6c92('0x13')]('UpdateMailApplication',_0x22c996['message'],_0x4c9575);_0x4b332a(_0x128212[_0x6c92('0x13')](0x1f4,_0x22c996[_0x6c92('0x15')]));});});}; \ No newline at end of file +var _0xf87b=['error','code','message','MailApplication,\x20%s,\x20%s','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x58f758,_0x1ef3e9){var _0x152b43=function(_0x24cc04){while(--_0x24cc04){_0x58f758['push'](_0x58f758['shift']());}};_0x152b43(++_0x1ef3e9);}(_0xf87b,0x102));var _0xbf87=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf87b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbf87('0x0'));var util=require('util');var moment=require(_0xbf87('0x1'));var BPromise=require(_0xbf87('0x2'));var rs=require(_0xbf87('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf87('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbf87('0x5'));var client=jayson[_0xbf87('0x6')][_0xbf87('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52ee42,_0x5eee62,_0x132fb2){return new BPromise(function(_0x45b1d4,_0x132be5){return client['request'](_0x52ee42,_0x132fb2)[_0xbf87('0x8')](function(_0x3a1706){logger[_0xbf87('0x9')]('MailApplication,\x20%s,\x20%s',_0x5eee62,_0xbf87('0xa'));logger[_0xbf87('0xb')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x5eee62,_0xbf87('0xa'),JSON['stringify'](_0x3a1706));if(_0x3a1706[_0xbf87('0xc')]){if(_0x3a1706['error'][_0xbf87('0xd')]===0x1f4){logger[_0xbf87('0xc')]('MailApplication,\x20%s,\x20%s',_0x5eee62,_0x3a1706[_0xbf87('0xc')]['message']);return _0x132be5(_0x3a1706[_0xbf87('0xc')][_0xbf87('0xe')]);}logger['error'](_0xbf87('0xf'),_0x5eee62,_0x3a1706[_0xbf87('0xc')][_0xbf87('0xe')]);return _0x45b1d4(_0x3a1706[_0xbf87('0xc')][_0xbf87('0xe')]);}else{logger[_0xbf87('0x9')]('MailApplication,\x20%s,\x20%s',_0x5eee62,_0xbf87('0xa'));_0x45b1d4(_0x3a1706['result'][_0xbf87('0xe')]);}})[_0xbf87('0x10')](function(_0x17ce1a){logger['error'](_0xbf87('0xf'),_0x5eee62,_0x17ce1a);_0x132be5(_0x17ce1a);});});}exports[_0xbf87('0x11')]=function(_0x29e307){var _0x5b8e0d=this;return new Promise(function(_0x2119c4,_0x43aa33){return db[_0xbf87('0x12')][_0xbf87('0x13')](_0x29e307[_0xbf87('0x14')],{'raw':_0x29e307['options']?_0x29e307[_0xbf87('0x15')][_0xbf87('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29e307[_0xbf87('0x15')]?_0x29e307[_0xbf87('0x15')][_0xbf87('0x17')]||null:null,'attributes':_0x29e307[_0xbf87('0x15')]?_0x29e307['options'][_0xbf87('0x18')]||null:null,'limit':_0x29e307[_0xbf87('0x15')]?_0x29e307['options'][_0xbf87('0x19')]||null:null})['then'](function(_0x5f2341){logger[_0xbf87('0x9')]('UpdateMailApplication',_0x29e307);logger[_0xbf87('0xb')](_0xbf87('0x11'),_0x29e307,JSON[_0xbf87('0x1a')](_0x5f2341));_0x2119c4(_0x5f2341);})[_0xbf87('0x10')](function(_0x44f882){logger[_0xbf87('0xc')](_0xbf87('0x11'),_0x44f882[_0xbf87('0xe')],_0x29e307);_0x43aa33(_0x5b8e0d['error'](0x1f4,_0x44f882[_0xbf87('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 0831190..d70543d 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 _0x0491=['getMessages','/:id/download','download','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5bffd7,_0x1ac4f4){var _0x48e5dd=function(_0xdc6b8a){while(--_0xdc6b8a){_0x5bffd7['push'](_0x5bffd7['shift']());}};_0x48e5dd(++_0x1ac4f4);}(_0x0491,0xa3));var _0x1049=function(_0xcd49bd,_0x2a12a3){_0xcd49bd=_0xcd49bd-0x0;var _0xb6ee44=_0x0491[_0xcd49bd];return _0xb6ee44;};'use strict';var express=require('express');var router=express[_0x1049('0x0')]();var auth=require(_0x1049('0x1'));var interaction=require(_0x1049('0x2'));var controller=require(_0x1049('0x3'));router[_0x1049('0x4')]('/',auth[_0x1049('0x5')](),controller[_0x1049('0x6')]);router[_0x1049('0x4')](_0x1049('0x7'),auth[_0x1049('0x5')](),controller[_0x1049('0x8')]);router[_0x1049('0x4')](_0x1049('0x9'),auth[_0x1049('0x5')](),controller[_0x1049('0xa')]);router[_0x1049('0x4')]('/:id/messages',auth[_0x1049('0x5')](),controller[_0x1049('0xb')]);router[_0x1049('0x4')](_0x1049('0xc'),auth['isAuthenticated'](),controller[_0x1049('0xd')]);router['post']('/',auth[_0x1049('0x5')](),controller[_0x1049('0xe')]);router['post']('/:id/messages',auth[_0x1049('0x5')](),controller[_0x1049('0xf')]);router['post'](_0x1049('0x10'),auth[_0x1049('0x5')](),interaction[_0x1049('0x11')](_0x1049('0x12'),_0x1049('0x13')),controller[_0x1049('0x14')]);router[_0x1049('0x15')]('/:id',auth[_0x1049('0x5')](),interaction[_0x1049('0x11')](_0x1049('0x12'),_0x1049('0x16')),controller[_0x1049('0x17')]);router[_0x1049('0x18')](_0x1049('0x9'),auth[_0x1049('0x5')](),interaction[_0x1049('0x11')](_0x1049('0x12'),_0x1049('0x19')),controller[_0x1049('0x1a')]);router[_0x1049('0x18')](_0x1049('0x10'),auth[_0x1049('0x5')](),controller[_0x1049('0x1b')]);module[_0x1049('0x1c')]=router; \ No newline at end of file +var _0x3fd5=['index','get','/describe','describe','isAuthenticated','show','/:id/messages','download','post','create','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','exports','express','Router','../../components/auth/service'];(function(_0x5b5c04,_0x4ec7a0){var _0x63631b=function(_0x312f60){while(--_0x312f60){_0x5b5c04['push'](_0x5b5c04['shift']());}};_0x63631b(++_0x4ec7a0);}(_0x3fd5,0xac));var _0x53fd=function(_0x1e1a6c,_0xae65bf){_0x1e1a6c=_0x1e1a6c-0x0;var _0x32d55c=_0x3fd5[_0x1e1a6c];return _0x32d55c;};'use strict';var express=require(_0x53fd('0x0'));var router=express[_0x53fd('0x1')]();var auth=require(_0x53fd('0x2'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x53fd('0x3')]);router[_0x53fd('0x4')](_0x53fd('0x5'),auth['isAuthenticated'](),controller[_0x53fd('0x6')]);router[_0x53fd('0x4')]('/:id',auth[_0x53fd('0x7')](),controller[_0x53fd('0x8')]);router['get'](_0x53fd('0x9'),auth[_0x53fd('0x7')](),controller['getMessages']);router[_0x53fd('0x4')]('/:id/download',auth[_0x53fd('0x7')](),controller[_0x53fd('0xa')]);router[_0x53fd('0xb')]('/',auth[_0x53fd('0x7')](),controller[_0x53fd('0xc')]);router[_0x53fd('0xb')]('/:id/messages',auth[_0x53fd('0x7')](),controller[_0x53fd('0xd')]);router['post']('/:id/tags',auth[_0x53fd('0x7')](),interaction[_0x53fd('0xe')](_0x53fd('0xf'),_0x53fd('0x10')),controller[_0x53fd('0x11')]);router[_0x53fd('0x12')]('/:id',auth[_0x53fd('0x7')](),interaction[_0x53fd('0xe')](_0x53fd('0xf'),_0x53fd('0x13')),controller[_0x53fd('0x14')]);router[_0x53fd('0x15')]('/:id',auth['isAuthenticated'](),interaction[_0x53fd('0xe')](_0x53fd('0xf'),_0x53fd('0x16')),controller['destroy']);router[_0x53fd('0x15')]('/:id/tags',auth[_0x53fd('0x7')](),controller[_0x53fd('0x17')]);module[_0x53fd('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 327790c..a4aa090 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 _0x4598=['exports','DATE','STRING','TEXT','long','ENUM','out','BOOLEAN'];(function(_0xf08c35,_0x2fd33c){var _0x10ea65=function(_0x542588){while(--_0x542588){_0xf08c35['push'](_0xf08c35['shift']());}};_0x10ea65(++_0x2fd33c);}(_0x4598,0x110));var _0x8459=function(_0x8a4494,_0x561354){_0x8a4494=_0x8a4494-0x0;var _0x9bb700=_0x4598[_0x8a4494];return _0x9bb700;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0x8459('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8459('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8459('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8459('0x2')]},'inReplyTo':{'type':Sequelize[_0x8459('0x2')](0x1fe)},'to':{'type':Sequelize[_0x8459('0x2')]},'cc':{'type':Sequelize[_0x8459('0x3')](_0x8459('0x4'))},'subject':{'type':Sequelize[_0x8459('0x3')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x8459('0x1')]},'substatus':{'type':Sequelize[_0x8459('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x8459('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x8459('0x5')]('in',_0x8459('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8459('0x5')]('in',_0x8459('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8459('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x5885=['DATE','STRING','TEXT','long','ENUM','out','BOOLEAN','sequelize','iconv','exports'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0x5885,0x1f1));var _0x5588=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5885[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5588('0x0'));var iconv=require(_0x5588('0x1'));module[_0x5588('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5588('0x3')]},'disposition':{'type':Sequelize[_0x5588('0x4')]},'secondDisposition':{'type':Sequelize[_0x5588('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5588('0x4')]},'note':{'type':Sequelize[_0x5588('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x5588('0x4')]},'cc':{'type':Sequelize[_0x5588('0x5')](_0x5588('0x6'))},'subject':{'type':Sequelize[_0x5588('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5588('0x3')]},'substatus':{'type':Sequelize[_0x5588('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x5588('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x5588('0x7')]('in',_0x5588('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5588('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5588('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5588('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index e7da748..a8fb746 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 _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c68e4,_0x20e968){_0x3c68e4=_0x3c68e4-0x0;var _0x2b35e7=_0xb10b[_0x3c68e4];return _0x2b35e7;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file +var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x36ceb0,_0x400094){var _0x36498a=function(_0x3b0f19){while(--_0x3b0f19){_0x36ceb0['push'](_0x36ceb0['shift']());}};_0x36498a(++_0x400094);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 27ed284..d15dcc0 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 _0x64de=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','length','emit','hasOwnProperty','hook','exports','events'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0x64de,0x158));var _0xe64d=function(_0xc2b77f,_0x4788ef){_0xc2b77f=_0xc2b77f-0x0;var _0x2cbf84=_0x64de[_0xc2b77f];return _0x2cbf84;};'use strict';var EventEmitter=require(_0xe64d('0x0'));var MailInteraction=require(_0xe64d('0x1'))['db'][_0xe64d('0x2')];var MailMessage=require(_0xe64d('0x1'))['db'][_0xe64d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xe64d('0x4')](0x0);var events={'afterCreate':_0xe64d('0x5'),'afterUpdate':'update','afterDestroy':_0xe64d('0x6')};function emitEvent(_0x26f08e){return function(_0x51dfe8,_0x4c3b99,_0x1f68c9){_0x51dfe8[_0xe64d('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xf2ed88){_0x51dfe8[_0xe64d('0x8')](_0xe64d('0x9'),_0xf2ed88['map'](function(_0x498e77){return{'id':_0x498e77['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x51dfe8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xb92ba2){_0x51dfe8[_0xe64d('0x8')]('unreadMessages',_0xb92ba2[_0xe64d('0xa')]);MailInteractionEvents[_0xe64d('0xb')](_0x26f08e+':'+_0x51dfe8['id'],_0x51dfe8);MailInteractionEvents[_0xe64d('0xb')](_0x26f08e,_0x51dfe8);_0x1f68c9(null);})['catch'](_0x1f68c9(null));};}for(var e in events){if(events[_0xe64d('0xc')](e)){var event=events[e];MailInteraction[_0xe64d('0xd')](e,emitEvent(event));}}module[_0xe64d('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0xa022=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','setDataValue','map','findAll','then','unreadMessages','length'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xa022,0x1d9));var _0x2a02=function(_0x58d47d,_0x3bf136){_0x58d47d=_0x58d47d-0x0;var _0x5a3030=_0xa022[_0x58d47d];return _0x5a3030;};'use strict';var EventEmitter=require(_0x2a02('0x0'));var MailInteraction=require(_0x2a02('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x2a02('0x1'))['db'][_0x2a02('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2a02('0x3')](0x0);var events={'afterCreate':_0x2a02('0x4'),'afterUpdate':_0x2a02('0x5'),'afterDestroy':_0x2a02('0x6')};function emitEvent(_0x5a6ebe){return function(_0x35a562,_0x22348e,_0x898dee){_0x35a562['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x28ff31){_0x35a562[_0x2a02('0x7')]('Users',_0x28ff31[_0x2a02('0x8')](function(_0x271d81){return{'id':_0x271d81['id']};}));return MailMessage[_0x2a02('0x9')]({'where':{'MailInteractionId':_0x35a562['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2a02('0xa')](function(_0x59fb5){_0x35a562[_0x2a02('0x7')](_0x2a02('0xb'),_0x59fb5[_0x2a02('0xc')]);MailInteractionEvents[_0x2a02('0xd')](_0x5a6ebe+':'+_0x35a562['id'],_0x35a562);MailInteractionEvents[_0x2a02('0xd')](_0x5a6ebe,_0x35a562);_0x898dee(null);})[_0x2a02('0xe')](_0x898dee(null));};}for(var e in events){if(events[_0x2a02('0xf')](e)){var event=events[e];MailInteraction[_0x2a02('0x10')](e,emitEvent(event));}}module[_0x2a02('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index a366a0b..0acf06b 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 _0x1975=['FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','models','get','MailMessage','update','catch','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions'];(function(_0x210ebb,_0x19685f){var _0x3c181=function(_0x2ce128){while(--_0x2ce128){_0x210ebb['push'](_0x210ebb['shift']());}};_0x3c181(++_0x19685f);}(_0x1975,0x16c));var _0x5197=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x1975[_0x43a1b8];return _0x324ecc;};'use strict';var _=require(_0x5197('0x0'));var util=require(_0x5197('0x1'));var logger=require('../../config/logger')(_0x5197('0x2'));var moment=require(_0x5197('0x3'));var BPromise=require(_0x5197('0x4'));var rp=require(_0x5197('0x5'));var fs=require('fs');var path=require(_0x5197('0x6'));var rimraf=require(_0x5197('0x7'));var config=require('../../config/environment');var attributes=require(_0x5197('0x8'));module[_0x5197('0x9')]=function(_0xe1ac81,_0x3f2d82){return _0xe1ac81[_0x5197('0xa')](_0x5197('0xb'),attributes,{'tableName':_0x5197('0xc'),'paranoid':![],'indexes':[{'name':_0x5197('0xd'),'fields':['subject','to'],'type':_0x5197('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x57ff39,_0x1693d3,_0x3784a5){if(_0x57ff39['substatus']){_0x57ff39[_0x5197('0xf')]=moment()[_0x5197('0x10')](_0x5197('0x11'));}if(_0x57ff39[_0x5197('0x12')]){_0x57ff39[_0x5197('0x13')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3784a5(null,_0x1693d3);},'beforeUpdate':function(_0x25afbf,_0xc7be73,_0xf2f737){if(_0x25afbf[_0x5197('0x14')]('substatus')){_0x25afbf['substatusAt']=_0x25afbf['substatus']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x25afbf[_0x5197('0x14')](_0x5197('0x12'))){_0x25afbf[_0x5197('0x13')]=moment()[_0x5197('0x10')](_0x5197('0x11'));_0x25afbf[_0x5197('0x15')]=null;_0x25afbf['substatusAt']=null;}_0xf2f737(null,_0x25afbf);},'afterUpdate':function(_0x20ca57,_0x126a20,_0x1dacb7){var _0x2637c8=_0xe1ac81[_0x5197('0x16')];var _0x3d0b6d=_0x20ca57[_0x5197('0x17')]({'plain':!![]});if(_0x3d0b6d[_0x5197('0x12')]){return _0x2637c8[_0x5197('0x18')][_0x5197('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x3d0b6d['id']}})['then'](function(){_0x1dacb7();})[_0x5197('0x1a')](function(_0x55bf04){_0x1dacb7(_0x55bf04);});}else{_0x1dacb7();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb1a1=['FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','substatus','changed','closedAt','models','get','MailMessage','update','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','fti_mail_interactions','subject'];(function(_0x181dfe,_0xf84557){var _0x40c38f=function(_0x3aa818){while(--_0x3aa818){_0x181dfe['push'](_0x181dfe['shift']());}};_0x40c38f(++_0xf84557);}(_0xb1a1,0x74));var _0x1b1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1a1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1b1a('0x0'));var util=require(_0x1b1a('0x1'));var logger=require(_0x1b1a('0x2'))(_0x1b1a('0x3'));var moment=require('moment');var BPromise=require(_0x1b1a('0x4'));var rp=require(_0x1b1a('0x5'));var fs=require('fs');var path=require(_0x1b1a('0x6'));var rimraf=require(_0x1b1a('0x7'));var config=require(_0x1b1a('0x8'));var attributes=require(_0x1b1a('0x9'));module[_0x1b1a('0xa')]=function(_0x4b0273,_0x4eab19){return _0x4b0273['define'](_0x1b1a('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x1b1a('0xc'),'fields':[_0x1b1a('0xd'),'to'],'type':_0x1b1a('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10cd2f,_0x1a5f09,_0x3ca8e8){if(_0x10cd2f['substatus']){_0x10cd2f[_0x1b1a('0xf')]=moment()[_0x1b1a('0x10')](_0x1b1a('0x11'));}if(_0x10cd2f['closed']){_0x10cd2f['closedAt']=moment()[_0x1b1a('0x10')](_0x1b1a('0x11'));}_0x3ca8e8(null,_0x1a5f09);},'beforeUpdate':function(_0x26ffd0,_0x75c7bf,_0x118fc0){if(_0x26ffd0['changed'](_0x1b1a('0x12'))){_0x26ffd0[_0x1b1a('0xf')]=_0x26ffd0['substatus']?moment()['format'](_0x1b1a('0x11')):null;}if(_0x26ffd0[_0x1b1a('0x13')]('closed')){_0x26ffd0[_0x1b1a('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x26ffd0['substatus']=null;_0x26ffd0[_0x1b1a('0xf')]=null;}_0x118fc0(null,_0x26ffd0);},'afterUpdate':function(_0x4722d7,_0x14773a,_0x354a95){var _0x43adad=_0x4b0273[_0x1b1a('0x15')];var _0x522796=_0x4722d7[_0x1b1a('0x16')]({'plain':!![]});if(_0x522796['closed']){return _0x43adad[_0x1b1a('0x17')][_0x1b1a('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x522796['id']}})['then'](function(){_0x354a95();})['catch'](function(_0x356684){_0x354a95(_0x356684);});}else{_0x354a95();}}},'charset':_0x1b1a('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 787e529..5eb8feb 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 _0xc963=['addTags','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','info','catch','UpdateMailInteraction','MailInteraction','update','body','options','attributes','then','find','where'];(function(_0x50576d,_0x5cbaa3){var _0x8e7110=function(_0x364226){while(--_0x364226){_0x50576d['push'](_0x50576d['shift']());}};_0x8e7110(++_0x5cbaa3);}(_0xc963,0x17f));var _0x3c96=function(_0xcf5436,_0x4632c3){_0xcf5436=_0xcf5436-0x0;var _0xc4f5c8=_0xc963[_0xcf5436];return _0xc4f5c8;};'use strict';var _=require(_0x3c96('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3c96('0x1'));var rs=require(_0x3c96('0x2'));var fs=require('fs');var Redis=require(_0x3c96('0x3'));var db=require(_0x3c96('0x4'))['db'];var utils=require(_0x3c96('0x5'));var logger=require('../../config/logger')(_0x3c96('0x6'));var config=require(_0x3c96('0x7'));var jayson=require(_0x3c96('0x8'));var client=jayson[_0x3c96('0x9')][_0x3c96('0xa')]({'port':0x232a});config['redis']=_[_0x3c96('0xb')](config[_0x3c96('0xc')],{'host':_0x3c96('0xd'),'port':0x18eb});var socket=require(_0x3c96('0xe'))(new Redis(config[_0x3c96('0xc')]));require(_0x3c96('0xf'))[_0x3c96('0x10')](socket);function respondWithRpcPromise(_0x2e3490,_0x51e375,_0x389618){return new BPromise(function(_0x4d6407,_0x31fa8f){return client[_0x3c96('0x11')](_0x2e3490,_0x389618)['then'](function(_0x4cbf3){logger['info']('MailInteraction,\x20%s,\x20%s',_0x51e375,_0x3c96('0x12'));logger[_0x3c96('0x13')](_0x3c96('0x14'),_0x51e375,_0x3c96('0x12'),JSON[_0x3c96('0x15')](_0x4cbf3));if(_0x4cbf3[_0x3c96('0x16')]){if(_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x17')]===0x1f4){logger[_0x3c96('0x16')](_0x3c96('0x18'),_0x51e375,_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x19')]);return _0x31fa8f(_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x19')]);}logger['error'](_0x3c96('0x18'),_0x51e375,_0x4cbf3[_0x3c96('0x16')]['message']);return _0x4d6407(_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x19')]);}else{logger[_0x3c96('0x1a')](_0x3c96('0x18'),_0x51e375,'request\x20sent');_0x4d6407(_0x4cbf3['result'][_0x3c96('0x19')]);}})[_0x3c96('0x1b')](function(_0x1ce943){logger[_0x3c96('0x16')](_0x3c96('0x18'),_0x51e375,_0x1ce943);_0x31fa8f(_0x1ce943);});});}exports[_0x3c96('0x1c')]=function(_0x15aa1d){var _0xa1abd4=this;return new Promise(function(_0x4eca85,_0x363a60){return db[_0x3c96('0x1d')][_0x3c96('0x1e')](_0x15aa1d[_0x3c96('0x1f')],{'raw':_0x15aa1d[_0x3c96('0x20')]?_0x15aa1d[_0x3c96('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15aa1d[_0x3c96('0x20')]?_0x15aa1d[_0x3c96('0x20')]['where']||null:null,'attributes':_0x15aa1d[_0x3c96('0x20')]?_0x15aa1d[_0x3c96('0x20')][_0x3c96('0x21')]||null:null,'limit':_0x15aa1d[_0x3c96('0x20')]?_0x15aa1d[_0x3c96('0x20')]['limit']||null:null})[_0x3c96('0x22')](function(_0x5d5145){logger[_0x3c96('0x1a')](_0x3c96('0x1c'),_0x15aa1d);logger[_0x3c96('0x13')](_0x3c96('0x1c'),_0x15aa1d,JSON[_0x3c96('0x15')](_0x5d5145));_0x4eca85(_0x5d5145);})[_0x3c96('0x1b')](function(_0x390e85){logger['error'](_0x3c96('0x1c'),_0x390e85['message'],_0x15aa1d);_0x363a60(_0xa1abd4[_0x3c96('0x16')](0x1f4,_0x390e85['message']));});});};exports['AddTagsToMailInteraction']=function(_0x253cf0){return new Promise(function(_0x3a237e,_0x76c23c){return db[_0x3c96('0x1d')][_0x3c96('0x23')]({'where':_0x253cf0[_0x3c96('0x20')]?_0x253cf0[_0x3c96('0x20')][_0x3c96('0x24')]||null:null})[_0x3c96('0x22')](function(_0x1e9206){if(_0x1e9206){return _0x1e9206[_0x3c96('0x25')](_0x253cf0[_0x3c96('0x1f')][_0x3c96('0x26')],_[_0x3c96('0x27')](_0x253cf0['body'],[_0x3c96('0x26'),'id'])||{});}})[_0x3c96('0x28')](function(_0x22e8e1){logger['info'](_0x3c96('0x29'),_0x253cf0);logger[_0x3c96('0x13')]('AddTags',_0x253cf0,JSON[_0x3c96('0x15')](_0x22e8e1));_0x3a237e(_0x22e8e1);})[_0x3c96('0x1b')](function(_0x511cfa){logger[_0x3c96('0x16')](_0x3c96('0x29'),_0x511cfa[_0x3c96('0x19')],_0x253cf0);_0x76c23c(_this[_0x3c96('0x16')](0x1f4,_0x511cfa[_0x3c96('0x19')]));});});}; \ No newline at end of file +var _0x3dd7=['client','redis','localhost','./mailInteraction.socket','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','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ef48d,_0x203c73){var _0x450096=function(_0x1df6b9){while(--_0x1df6b9){_0x1ef48d['push'](_0x1ef48d['shift']());}};_0x450096(++_0x203c73);}(_0x3dd7,0x1f2));var _0x73dd=function(_0x259beb,_0x4cc158){_0x259beb=_0x259beb-0x0;var _0x34e1cd=_0x3dd7[_0x259beb];return _0x34e1cd;};'use strict';var _=require('lodash');var util=require(_0x73dd('0x0'));var moment=require(_0x73dd('0x1'));var BPromise=require(_0x73dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73dd('0x3'))['db'];var utils=require(_0x73dd('0x4'));var logger=require(_0x73dd('0x5'))(_0x73dd('0x6'));var config=require(_0x73dd('0x7'));var jayson=require(_0x73dd('0x8'));var client=jayson[_0x73dd('0x9')]['http']({'port':0x232a});config[_0x73dd('0xa')]=_['defaults'](config[_0x73dd('0xa')],{'host':_0x73dd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73dd('0xa')]));require(_0x73dd('0xc'))['register'](socket);function respondWithRpcPromise(_0x10a0a9,_0x288fe3,_0x57edaa){return new BPromise(function(_0x116063,_0x42bfec){return client['request'](_0x10a0a9,_0x57edaa)[_0x73dd('0xd')](function(_0x5db71c){logger[_0x73dd('0xe')](_0x73dd('0xf'),_0x288fe3,_0x73dd('0x10'));logger[_0x73dd('0x11')](_0x73dd('0x12'),_0x288fe3,_0x73dd('0x10'),JSON[_0x73dd('0x13')](_0x5db71c));if(_0x5db71c[_0x73dd('0x14')]){if(_0x5db71c['error'][_0x73dd('0x15')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x288fe3,_0x5db71c['error'][_0x73dd('0x16')]);return _0x42bfec(_0x5db71c[_0x73dd('0x14')][_0x73dd('0x16')]);}logger[_0x73dd('0x14')](_0x73dd('0xf'),_0x288fe3,_0x5db71c[_0x73dd('0x14')][_0x73dd('0x16')]);return _0x116063(_0x5db71c['error'][_0x73dd('0x16')]);}else{logger['info'](_0x73dd('0xf'),_0x288fe3,'request\x20sent');_0x116063(_0x5db71c[_0x73dd('0x17')][_0x73dd('0x16')]);}})[_0x73dd('0x18')](function(_0x3137bd){logger[_0x73dd('0x14')](_0x73dd('0xf'),_0x288fe3,_0x3137bd);_0x42bfec(_0x3137bd);});});}exports[_0x73dd('0x19')]=function(_0x4b07b7){var _0x65eb=this;return new Promise(function(_0x5f491f,_0x103c7c){return db[_0x73dd('0x1a')]['update'](_0x4b07b7[_0x73dd('0x1b')],{'raw':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7[_0x73dd('0x1c')][_0x73dd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7['options'][_0x73dd('0x1e')]||null:null,'attributes':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7[_0x73dd('0x1c')][_0x73dd('0x1f')]||null:null,'limit':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7[_0x73dd('0x1c')][_0x73dd('0x20')]||null:null})[_0x73dd('0xd')](function(_0x21e8a6){logger[_0x73dd('0xe')](_0x73dd('0x19'),_0x4b07b7);logger[_0x73dd('0x11')](_0x73dd('0x19'),_0x4b07b7,JSON[_0x73dd('0x13')](_0x21e8a6));_0x5f491f(_0x21e8a6);})[_0x73dd('0x18')](function(_0x1b3886){logger['error'](_0x73dd('0x19'),_0x1b3886[_0x73dd('0x16')],_0x4b07b7);_0x103c7c(_0x65eb[_0x73dd('0x14')](0x1f4,_0x1b3886['message']));});});};exports[_0x73dd('0x21')]=function(_0x8d669b){return new Promise(function(_0x450548,_0x26dabe){return db[_0x73dd('0x1a')]['find']({'where':_0x8d669b[_0x73dd('0x1c')]?_0x8d669b[_0x73dd('0x1c')][_0x73dd('0x1e')]||null:null})['then'](function(_0x49acb1){if(_0x49acb1){return _0x49acb1[_0x73dd('0x22')](_0x8d669b[_0x73dd('0x1b')][_0x73dd('0x23')],_[_0x73dd('0x24')](_0x8d669b[_0x73dd('0x1b')],['ids','id'])||{});}})[_0x73dd('0x25')](function(_0x153ed9){logger[_0x73dd('0xe')](_0x73dd('0x26'),_0x8d669b);logger['debug'](_0x73dd('0x26'),_0x8d669b,JSON[_0x73dd('0x13')](_0x153ed9));_0x450548(_0x153ed9);})['catch'](function(_0x5b2741){logger['error'](_0x73dd('0x26'),_0x5b2741[_0x73dd('0x16')],_0x8d669b);_0x26dabe(_this[_0x73dd('0x14')](0x1f4,_0x5b2741[_0x73dd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 3b63355..68b92f2 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 _0xee92=['mailInteraction:','./mailInteraction.events','remove','update','removeListener','register','length'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xee92,0xf6));var _0x2ee9=function(_0x5c3be9,_0x1c287a){_0x5c3be9=_0x5c3be9-0x0;var _0x37d54d=_0xee92[_0x5c3be9];return _0x37d54d;};'use strict';var MailInteractionEvents=require(_0x2ee9('0x0'));var events=['save',_0x2ee9('0x1'),_0x2ee9('0x2')];function createListener(_0x522e8a,_0x36cbab){return function(_0x4c94f6){_0x36cbab['emit'](_0x522e8a,_0x4c94f6);};}function removeListener(_0x169fd9,_0x1861aa){return function(){MailInteractionEvents[_0x2ee9('0x3')](_0x169fd9,_0x1861aa);};}exports[_0x2ee9('0x4')]=function(_0x1faed0){for(var _0x2478db=0x0,_0x24411d=events[_0x2ee9('0x5')];_0x2478db<_0x24411d;_0x2478db++){var _0x5d3219=events[_0x2478db];var _0x9ab3d1=createListener(_0x2ee9('0x6')+_0x5d3219,_0x1faed0);MailInteractionEvents['on'](_0x5d3219,_0x9ab3d1);}}; \ No newline at end of file +var _0x4a3e=['remove','emit','removeListener','length','mailInteraction:','save'];(function(_0x5eab9b,_0x113241){var _0x16bbc5=function(_0x523fae){while(--_0x523fae){_0x5eab9b['push'](_0x5eab9b['shift']());}};_0x16bbc5(++_0x113241);}(_0x4a3e,0x17f));var _0xe4a3=function(_0x16b519,_0x52560c){_0x16b519=_0x16b519-0x0;var _0x40e913=_0x4a3e[_0x16b519];return _0x40e913;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xe4a3('0x0'),_0xe4a3('0x1'),'update'];function createListener(_0x461aa0,_0x246dad){return function(_0x1572e6){_0x246dad[_0xe4a3('0x2')](_0x461aa0,_0x1572e6);};}function removeListener(_0x5e260a,_0x280c11){return function(){MailInteractionEvents[_0xe4a3('0x3')](_0x5e260a,_0x280c11);};}exports['register']=function(_0x8a1b98){for(var _0x5207f5=0x0,_0x2fbf7a=events[_0xe4a3('0x4')];_0x5207f5<_0x2fbf7a;_0x5207f5++){var _0x332f01=events[_0x5207f5];var _0x3c7d64=createListener(_0xe4a3('0x5')+_0x332f01,_0x8a1b98);MailInteractionEvents['on'](_0x332f01,_0x3c7d64);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 56209cf..9cb6bf0 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 _0x95c5=['./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x95c5,0x153));var _0x595c=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0x95c5[_0x36de10];return _0x58100f;};'use strict';var multer=require(_0x595c('0x0'));var util=require(_0x595c('0x1'));var path=require('path');var timeout=require(_0x595c('0x2'));var express=require(_0x595c('0x3'));var router=express[_0x595c('0x4')]();var fs_extra=require(_0x595c('0x5'));var auth=require(_0x595c('0x6'));var interaction=require(_0x595c('0x7'));var config=require(_0x595c('0x8'));var controller=require(_0x595c('0x9'));router[_0x595c('0xa')]('/',auth[_0x595c('0xb')](),controller['index']);router['get'](_0x595c('0xc'),auth[_0x595c('0xb')](),controller[_0x595c('0xd')]);router[_0x595c('0xa')](_0x595c('0xe'),auth[_0x595c('0xb')](),controller[_0x595c('0xf')]);router[_0x595c('0xa')](_0x595c('0x10'),auth['isAuthenticated'](),controller[_0x595c('0x11')]);router[_0x595c('0x12')]('/',auth[_0x595c('0xb')](),interaction['tracked'](_0x595c('0x13'),_0x595c('0x14')),controller[_0x595c('0x15')]);router[_0x595c('0x16')](_0x595c('0xe'),auth[_0x595c('0xb')](),controller[_0x595c('0x17')]);router[_0x595c('0x16')](_0x595c('0x18'),auth[_0x595c('0xb')](),controller[_0x595c('0x19')]);router[_0x595c('0x16')](_0x595c('0x1a'),auth[_0x595c('0xb')](),controller['reject']);router[_0x595c('0x1b')](_0x595c('0xe'),auth[_0x595c('0xb')](),controller[_0x595c('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x4dd2=['/:id','update','/:id/accept','/:id/reject','reject','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','get','/describe','isAuthenticated','describe','show','/:id/download','post','tracked','mail','mailmessage:create','create','put'];(function(_0x2950aa,_0x44b792){var _0x16b37b=function(_0x205837){while(--_0x205837){_0x2950aa['push'](_0x2950aa['shift']());}};_0x16b37b(++_0x44b792);}(_0x4dd2,0xf1));var _0x24dd=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0x4dd2[_0xf34b0a];return _0x5021e1;};'use strict';var multer=require('multer');var util=require(_0x24dd('0x0'));var path=require(_0x24dd('0x1'));var timeout=require(_0x24dd('0x2'));var express=require('express');var router=express[_0x24dd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x24dd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x24dd('0x5'));var controller=require(_0x24dd('0x6'));router[_0x24dd('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x24dd('0x7')](_0x24dd('0x8'),auth[_0x24dd('0x9')](),controller[_0x24dd('0xa')]);router[_0x24dd('0x7')]('/:id',auth[_0x24dd('0x9')](),controller[_0x24dd('0xb')]);router[_0x24dd('0x7')](_0x24dd('0xc'),auth[_0x24dd('0x9')](),controller['download']);router[_0x24dd('0xd')]('/',auth[_0x24dd('0x9')](),interaction[_0x24dd('0xe')](_0x24dd('0xf'),_0x24dd('0x10')),controller[_0x24dd('0x11')]);router[_0x24dd('0x12')](_0x24dd('0x13'),auth['isAuthenticated'](),controller[_0x24dd('0x14')]);router['put'](_0x24dd('0x15'),auth[_0x24dd('0x9')](),controller['accept']);router['put'](_0x24dd('0x16'),auth[_0x24dd('0x9')](),controller[_0x24dd('0x17')]);router['delete'](_0x24dd('0x13'),auth['isAuthenticated'](),controller[_0x24dd('0x18')]);module[_0x24dd('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index ac221a9..9959f98 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 _0xce38=['exports','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash'];(function(_0x541f0c,_0x1761c4){var _0x15ba48=function(_0x4b0f6c){while(--_0x4b0f6c){_0x541f0c['push'](_0x541f0c['shift']());}};_0x15ba48(++_0x1761c4);}(_0xce38,0x8d));var _0x8ce3=function(_0x1b857f,_0x286e31){_0x1b857f=_0x1b857f-0x0;var _0x5582e9=_0xce38[_0x1b857f];return _0x5582e9;};'use strict';var Sequelize=require(_0x8ce3('0x0'));var _=require(_0x8ce3('0x1'));module[_0x8ce3('0x2')]={'body':{'type':Sequelize[_0x8ce3('0x3')](_0x8ce3('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8ce3('0x3')]('medium')},'read':{'type':Sequelize[_0x8ce3('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8ce3('0x6')]('in',_0x8ce3('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x8ce3('0x8')](0x1fe)},'from':{'type':Sequelize[_0x8ce3('0x8')]},'to':{'type':Sequelize[_0x8ce3('0x3')]('long')},'cc':{'type':Sequelize[_0x8ce3('0x3')](_0x8ce3('0x4'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x8ce3('0x3')]},'sentAt':{'type':Sequelize[_0x8ce3('0x9')]},'attach':{'type':Sequelize[_0x8ce3('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8ce3('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8ce3('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x8ce3('0x4'))},'originCc':{'type':Sequelize[_0x8ce3('0x3')](_0x8ce3('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0x8ce3('0xb'),_0x8ce3('0xc')),'defaultValue':_0x8ce3('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x8bd6=['sequelize','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x8bd6,0x1e0));var _0x68bd=function(_0x5f3056,_0x3dd505){_0x5f3056=_0x5f3056-0x0;var _0x585675=_0x8bd6[_0x5f3056];return _0x585675;};'use strict';var Sequelize=require(_0x68bd('0x0'));var _=require('lodash');module[_0x68bd('0x1')]={'body':{'type':Sequelize[_0x68bd('0x2')](_0x68bd('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x68bd('0x2')](_0x68bd('0x4'))},'read':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x68bd('0x6')]('in',_0x68bd('0x7')),'defaultValue':_0x68bd('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x68bd('0x8')](0x1fe)},'from':{'type':Sequelize[_0x68bd('0x8')]},'to':{'type':Sequelize[_0x68bd('0x2')](_0x68bd('0x3'))},'cc':{'type':Sequelize[_0x68bd('0x2')]('long')},'bcc':{'type':Sequelize[_0x68bd('0x2')]('long')},'subject':{'type':Sequelize[_0x68bd('0x2')]},'sentAt':{'type':Sequelize[_0x68bd('0x9')]},'attach':{'type':Sequelize[_0x68bd('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x68bd('0x2')](_0x68bd('0x3'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x68bd('0x6')]('Email','Chat'),'defaultValue':_0x68bd('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index c90cdcd..58f193f 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 _0x55ca=['offset','limit','Content-Range','then','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','key','model','query','keys','attributes','length','nolimit','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','fields','include','options','find','update','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','user','pass','service','auth','attachments','join','root','server/files/attachments','basename','CmContact','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','get','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','channel','event','fromString','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','interface','SIP/%s','rejectmessage','unix','server','files','message-%s.eml','from','bcc','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','push','readFileSync','build','writeFileSync','download','eml-format','moment','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','jayson/promise','client','http','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','undefined','count'];(function(_0xd1c128,_0x1f20ef){var _0x510c2a=function(_0x518458){while(--_0x518458){_0xd1c128['push'](_0xd1c128['shift']());}};_0x510c2a(++_0x1f20ef);}(_0x55ca,0x126));var _0xa55c=function(_0x5db313,_0x3c8f0c){_0x5db313=_0x5db313-0x0;var _0x36d503=_0x55ca[_0x5db313];return _0x36d503;};'use strict';var emlformat=require(_0xa55c('0x0'));var moment=require(_0xa55c('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xa55c('0x2'));var Redis=require(_0xa55c('0x3'));var htmlToText=require('html-to-text');var qs=require(_0xa55c('0x4'));var logger=require(_0xa55c('0x5'))(_0xa55c('0x6'));var interaction_log=require(_0xa55c('0x5'))(_0xa55c('0x7'));var config=require(_0xa55c('0x8'));var db=require(_0xa55c('0x9'))['db'];config['redis']=_[_0xa55c('0xa')](config[_0xa55c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa55c('0xc'))(new Redis(config[_0xa55c('0xb')]));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xa55c('0xd'));var client=jayson[_0xa55c('0xe')][_0xa55c('0xf')]({'port':0x232c});var client9003=jayson[_0xa55c('0xe')][_0xa55c('0xf')]({'port':0x232b});var client9002=jayson[_0xa55c('0xe')][_0xa55c('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x70c2de,_0x3998f7,_0x15eec8,_0x5d47ff){return new BPromise(function(_0x59d84a,_0x2a35be){var _0x576044=_0x5d47ff||client;return _0x576044['request'](_0x70c2de,_0x15eec8)['then'](function(_0x18ee85){logger[_0xa55c('0x10')](_0xa55c('0x11'),_0x3998f7,_0xa55c('0x12'));logger[_0xa55c('0x13')](_0xa55c('0x14'),_0x3998f7,'request\x20sent',JSON[_0xa55c('0x15')](_0x18ee85));if(_0x18ee85[_0xa55c('0x16')]){if(_0x18ee85[_0xa55c('0x16')][_0xa55c('0x17')]===0x1f4){logger[_0xa55c('0x16')](_0xa55c('0x11'),_0x3998f7,_0x18ee85[_0xa55c('0x16')][_0xa55c('0x18')]);return _0x2a35be(_0x18ee85[_0xa55c('0x16')]['message']);}logger[_0xa55c('0x16')](_0xa55c('0x11'),_0x3998f7,_0x18ee85[_0xa55c('0x16')][_0xa55c('0x18')]);return _0x59d84a(_0x18ee85[_0xa55c('0x16')][_0xa55c('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x3998f7,_0xa55c('0x12'));_0x59d84a(_0x18ee85[_0xa55c('0x19')][_0xa55c('0x18')]);}})['catch'](function(_0x383d92){logger[_0xa55c('0x16')]('MailMessage,\x20%s,\x20%s',_0x3998f7,_0x383d92);_0x2a35be(_0x383d92);});});}function respondWithResult(_0x187a87,_0x133096){_0x133096=_0x133096||0xc8;return function(_0x940f28){if(_0x940f28){return _0x187a87[_0xa55c('0x1a')](_0x133096)[_0xa55c('0x1b')](_0x940f28);}};}function respondWithFilteredResult(_0x49ed04,_0x1fc828){return function(_0x504c24){if(_0x504c24){var _0x5ba836=typeof _0x1fc828['offset']===_0xa55c('0x1c')&&typeof _0x1fc828['limit']===_0xa55c('0x1c');var _0x190757=_0x504c24[_0xa55c('0x1d')];var _0xf0e574=_0x5ba836?0x0:_0x1fc828[_0xa55c('0x1e')];var _0x170ba4=_0x5ba836?_0x504c24[_0xa55c('0x1d')]:_0x1fc828[_0xa55c('0x1e')]+_0x1fc828[_0xa55c('0x1f')];var _0x3cd152;if(_0x170ba4>=_0x190757){_0x170ba4=_0x190757;_0x3cd152=0xc8;}else{_0x3cd152=0xce;}_0x49ed04[_0xa55c('0x1a')](_0x3cd152);return _0x49ed04['set'](_0xa55c('0x20'),_0xf0e574+'-'+_0x170ba4+'/'+_0x190757)[_0xa55c('0x1b')](_0x504c24);}return null;};}function saveUpdates(_0x1c9f6b){return function(_0x906caa){if(_0x906caa){return _0x906caa['update'](_0x1c9f6b)[_0xa55c('0x21')](function(_0x22f6b6){return _0x22f6b6;});}return null;};}function removeEntity(_0x1b8388){return function(_0x201941){if(_0x201941){return _0x201941[_0xa55c('0x22')]()[_0xa55c('0x21')](function(){_0x1b8388['status'](0xcc)[_0xa55c('0x23')]();});}};}function handleEntityNotFound(_0x490b7d){return function(_0x35c9c2){if(!_0x35c9c2){_0x490b7d[_0xa55c('0x24')](0x194);}return _0x35c9c2;};}function handleError(_0x1cc53e,_0x223813){_0x223813=_0x223813||0x1f4;return function(_0x4d8416){logger[_0xa55c('0x16')](_0x4d8416[_0xa55c('0x25')]);if(_0x4d8416[_0xa55c('0x26')]){delete _0x4d8416[_0xa55c('0x26')];}_0x1cc53e[_0xa55c('0x1a')](_0x223813)[_0xa55c('0x27')](_0x4d8416);};}exports[_0xa55c('0x28')]=function(_0x24d44d,_0x2808e9){var _0xcbaf2e={},_0x197099={},_0x4eb7c4={'count':0x0,'rows':[]};var _0x54ca97=_[_0xa55c('0x29')](db[_0xa55c('0x2a')]['rawAttributes'],function(_0x30fadd){return{'name':_0x30fadd[_0xa55c('0x2b')],'type':_0x30fadd[_0xa55c('0x2c')][_0xa55c('0x2d')]};});_0x197099[_0xa55c('0x2e')]=_[_0xa55c('0x29')](_0x54ca97,_0xa55c('0x26'));_0x197099[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x24d44d['query']);_0x197099['filters']=_['intersection'](_0x197099[_0xa55c('0x2e')],_0x197099[_0xa55c('0x2f')]);_0xcbaf2e[_0xa55c('0x31')]=_['intersection'](_0x197099[_0xa55c('0x2e')],qs['fields'](_0x24d44d[_0xa55c('0x2f')]['fields']));_0xcbaf2e[_0xa55c('0x31')]=_0xcbaf2e[_0xa55c('0x31')][_0xa55c('0x32')]?_0xcbaf2e['attributes']:_0x197099[_0xa55c('0x2e')];if(!_0x24d44d[_0xa55c('0x2f')]['hasOwnProperty'](_0xa55c('0x33'))){_0xcbaf2e[_0xa55c('0x1f')]=qs['limit'](_0x24d44d['query'][_0xa55c('0x1f')]);_0xcbaf2e['offset']=qs[_0xa55c('0x1e')](_0x24d44d[_0xa55c('0x2f')]['offset']);}_0xcbaf2e['order']=qs['sort'](_0x24d44d['query'][_0xa55c('0x34')]);_0xcbaf2e[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_[_0xa55c('0x37')](_0x24d44d[_0xa55c('0x2f')],_0x197099['filters']),_0x54ca97);if(_0x24d44d[_0xa55c('0x2f')][_0xa55c('0x38')]){_0xcbaf2e[_0xa55c('0x35')]=_[_0xa55c('0x39')](_0xcbaf2e[_0xa55c('0x35')],{'$or':_[_0xa55c('0x29')](_0x54ca97,function(_0x554620){if(_0x554620[_0xa55c('0x2c')]!=='VIRTUAL'){var _0x57a972={};_0x57a972[_0x554620[_0xa55c('0x26')]]={'$like':'%'+_0x24d44d[_0xa55c('0x2f')]['filter']+'%'};return _0x57a972;}})});}_0xcbaf2e=_[_0xa55c('0x39')]({},_0xcbaf2e,_0x24d44d['options']);var _0x5f25f7={'where':_0xcbaf2e[_0xa55c('0x35')]};return db[_0xa55c('0x2a')][_0xa55c('0x1d')](_0x5f25f7)['then'](function(_0x1b2708){_0x4eb7c4[_0xa55c('0x1d')]=_0x1b2708;if(_0x24d44d['query'][_0xa55c('0x3a')]){_0xcbaf2e['include']=[{'all':!![]}];}return db[_0xa55c('0x2a')][_0xa55c('0x3b')](_0xcbaf2e);})['then'](function(_0x66d1de){_0x4eb7c4[_0xa55c('0x3c')]=_0x66d1de;return _0x4eb7c4;})['then'](respondWithFilteredResult(_0x2808e9,_0xcbaf2e))[_0xa55c('0x3d')](handleError(_0x2808e9,null));};exports[_0xa55c('0x3e')]=function(_0x204767,_0x59a6c8){var _0x334f52={'raw':!![],'where':{'id':_0x204767[_0xa55c('0x3f')]['id']}},_0x582901={};_0x582901[_0xa55c('0x2e')]=_[_0xa55c('0x30')](db['MailMessage'][_0xa55c('0x40')]);_0x582901[_0xa55c('0x2f')]=_['keys'](_0x204767[_0xa55c('0x2f')]);_0x582901[_0xa55c('0x36')]=_['intersection'](_0x582901[_0xa55c('0x2e')],_0x582901[_0xa55c('0x2f')]);_0x334f52['attributes']=_[_0xa55c('0x41')](_0x582901[_0xa55c('0x2e')],qs[_0xa55c('0x42')](_0x204767[_0xa55c('0x2f')]['fields']));_0x334f52[_0xa55c('0x31')]=_0x334f52['attributes'][_0xa55c('0x32')]?_0x334f52[_0xa55c('0x31')]:_0x582901[_0xa55c('0x2e')];if(_0x204767['query'][_0xa55c('0x3a')]){_0x334f52[_0xa55c('0x43')]=[{'all':!![]}];}_0x334f52=_['merge']({},_0x334f52,_0x204767[_0xa55c('0x44')]);return db[_0xa55c('0x2a')][_0xa55c('0x45')](_0x334f52)[_0xa55c('0x21')](handleEntityNotFound(_0x59a6c8,null))[_0xa55c('0x21')](respondWithResult(_0x59a6c8,null))[_0xa55c('0x3d')](handleError(_0x59a6c8,null));};exports[_0xa55c('0x46')]=function(_0x129626,_0x3c147b){if(_0x129626[_0xa55c('0x47')]['id']){delete _0x129626['body']['id'];}return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x129626[_0xa55c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3c147b,null))[_0xa55c('0x21')](saveUpdates(_0x129626[_0xa55c('0x47')],null))['then'](respondWithResult(_0x3c147b,null))[_0xa55c('0x3d')](handleError(_0x3c147b,null));};exports['destroy']=function(_0x2b6a0e,_0x228df4){return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x2b6a0e[_0xa55c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x228df4,null))[_0xa55c('0x21')](removeEntity(_0x228df4,null))[_0xa55c('0x3d')](handleError(_0x228df4,null));};exports['describe']=function(_0x3929a6,_0x2291e0){return db[_0xa55c('0x2a')][_0xa55c('0x48')]()['then'](respondWithResult(_0x2291e0,null))['catch'](handleError(_0x2291e0,null));};exports[_0xa55c('0x49')]=function(_0x250dea,_0x3ca5b8){return db[_0xa55c('0x2a')]['create'](_0x250dea[_0xa55c('0x47')])['then'](function(_0x2742e4){if(_0x2742e4){if(_0x2742e4[_0xa55c('0x4a')]===_0xa55c('0x4b')&&!_0x2742e4[_0xa55c('0x4c')]){var _0xec640,_0x53b2f7,_0x1cb73b;if(_0x250dea['body']['to']){_0x53b2f7=_0x250dea[_0xa55c('0x47')]['to'][_0xa55c('0x4d')](',')[0x0];}return db[_0xa55c('0x4e')][_0xa55c('0x4f')]({'where':{'id':_0x2742e4[_0xa55c('0x50')]},'include':[{'model':db[_0xa55c('0x51')],'as':_0xa55c('0x52'),'include':[{'model':db['CmContact'],'as':_0xa55c('0x53'),'where':{'email':_0x53b2f7},'limit':0x1,'order':[[_0xa55c('0x54'),_0xa55c('0x55')]]}]},{'model':db[_0xa55c('0x56')],'as':_0xa55c('0x57'),'raw':!![]}]})['then'](function(_0xa72718){_0xec640=_0xa72718;if(_0xec640&&_0xec640[_0xa55c('0x57')]){var _0x28bac4={'tls':{'rejectUnauthorized':![]}};if(_[_0xa55c('0x58')](_0xec640[_0xa55c('0x57')]['service'])){_0x28bac4[_0xa55c('0x59')]=_0xec640[_0xa55c('0x57')][_0xa55c('0x59')];_0x28bac4[_0xa55c('0x5a')]=_0xec640[_0xa55c('0x57')]['port'];_0x28bac4[_0xa55c('0x5b')]=_0xec640['Smtp'][_0xa55c('0x5b')];if(_0xec640['Smtp'][_0xa55c('0x5c')]){_0x28bac4['auth']={'user':_0xec640[_0xa55c('0x57')][_0xa55c('0x5d')],'pass':_0xec640[_0xa55c('0x57')][_0xa55c('0x5e')]};}}else{_0x28bac4[_0xa55c('0x5f')]=_0xec640[_0xa55c('0x57')][_0xa55c('0x5f')];_0x28bac4[_0xa55c('0x60')]={'user':_0xec640[_0xa55c('0x57')][_0xa55c('0x5d')],'pass':_0xec640['Smtp'][_0xa55c('0x5e')]};_0x28bac4[_0xa55c('0x5b')]=_0xec640['Smtp'][_0xa55c('0x5b')];}if(_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')]&&_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')][_0xa55c('0x32')]){for(var _0x3cef1f=0x0;_0x3cef1f<_0x250dea[_0xa55c('0x47')]['attachments'][_0xa55c('0x32')];_0x3cef1f+=0x1){_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')][_0x3cef1f]={'filename':_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')][_0x3cef1f][_0xa55c('0x26')],'path':path[_0xa55c('0x62')](config[_0xa55c('0x63')],_0xa55c('0x64'),_0x250dea['body'][_0xa55c('0x61')][_0x3cef1f][_0xa55c('0x65')])};}}_0x1cb73b={'account':_0x28bac4,'message':_0x250dea[_0xa55c('0x47')]};return;}})[_0xa55c('0x21')](function(){if(_0xec640[_0xa55c('0x52')]){if(_0xec640[_0xa55c('0x52')][_0xa55c('0x53')][_0xa55c('0x32')]){return _0xec640[_0xa55c('0x52')][_0xa55c('0x53')][0x0];}else{return db[_0xa55c('0x66')]['create'](_[_0xa55c('0xa')](_0x250dea['body'],{'firstName':_0x250dea[_0xa55c('0x47')]['to'],'email':_0x250dea[_0xa55c('0x47')]['to'],'phone':_0x250dea[_0xa55c('0x47')]['to'],'ListId':_0xec640['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0xa55c('0x21')](function(){if(_0x1cb73b){return respondWithRpcPromise(_0xa55c('0x67'),_0xa55c('0x68'),_0x1cb73b,client9003)[_0xa55c('0x21')](function(_0x4c7ee1){return _0x2742e4[_0xa55c('0x46')]({'read':!![],'messageId':_0x4c7ee1[_0xa55c('0x69')],'sentAt':moment()[_0xa55c('0x6a')](_0xa55c('0x6b'))});})[_0xa55c('0x3d')](function(_0x500968){logger['error']('%s',JSON[_0xa55c('0x15')](_0x500968));return _0x2742e4;});}return _0x2742e4;});}return _0x2742e4;}})[_0xa55c('0x21')](respondWithResult(_0x3ca5b8,0xc9))[_0xa55c('0x3d')](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x6c')]=function(_0x1af9d5,_0x4b2032){var _0x14febc={'agent':{},'channel':_0xa55c('0x6d')};if(_0x1af9d5['body']['id']){delete _0x1af9d5[_0xa55c('0x47')]['id'];}_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x6e')]=!![];_0x1af9d5['body'][_0xa55c('0x6f')]=moment()[_0xa55c('0x6a')](_0xa55c('0x6b'));_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')]=_0x1af9d5['body'][_0xa55c('0x70')]||_0x1af9d5[_0xa55c('0x5d')]['id'];_0x14febc['agent']['id']=_0x1af9d5['body'][_0xa55c('0x70')];return db['MailMessage'][_0xa55c('0x45')]({'where':{'id':_0x1af9d5[_0xa55c('0x3f')]['id'],'UserId':null}})[_0xa55c('0x21')](handleEntityNotFound(_0x4b2032,null))[_0xa55c('0x21')](saveUpdates(_0x1af9d5[_0xa55c('0x47')],null))[_0xa55c('0x21')](function(_0x22b06f){if(_0x22b06f){_0x14febc[_0xa55c('0x18')]=_0x22b06f[_0xa55c('0x71')]({'plain':!![]});return db['MailInteraction'][_0xa55c('0x45')]({'where':{'id':_0x22b06f[_0xa55c('0x72')]}});}return null;})[_0xa55c('0x21')](handleEntityNotFound(_0x4b2032,null))[_0xa55c('0x21')](function(_0x4f0a26){if(_0x4f0a26){return _0x4f0a26[_0xa55c('0x46')]({'UserId':_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')],'read1stAt':_[_0xa55c('0x58')](_0x4f0a26['read1stAt'])?moment()['format'](_0xa55c('0x6b')):undefined});}return null;})[_0xa55c('0x21')](function(_0x12e3a8){if(_0x12e3a8){_0x14febc[_0xa55c('0x73')]=_0x12e3a8['get']({'plain':!![]});interaction_log['info'](_0xa55c('0x74'),_0x1af9d5[_0xa55c('0x5d')]['id'],_0x1af9d5[_0xa55c('0x5d')][_0xa55c('0x26')],_0x1af9d5[_0xa55c('0x5d')][_0xa55c('0x75')],_0x14febc[_0xa55c('0x73')]['id'],_0x1af9d5['body']?JSON[_0xa55c('0x15')](_0x1af9d5['body']):_0xa55c('0x76'));return respondWithRpcPromise('AcceptMessage',_0xa55c('0x77'),_0x14febc);}return null;})[_0xa55c('0x21')](function(_0x441c11){var _0xcc187f=_0xa55c('0x78')+_0x441c11[_0xa55c('0x18')][_0xa55c('0x79')];return db[_0xa55c('0x7a')]['query'](_0xcc187f,{'type':db['Sequelize'][_0xa55c('0x7b')][_0xa55c('0x7c')],'raw':!![]})[_0xa55c('0x21')](function(_0x256db0){return _0x256db0;});})[_0xa55c('0x21')](function(_0x137728){if(_0x137728){_0x14febc['message'][_0xa55c('0x7d')]=_0x137728[0x0];if(!_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')])return;return db[_0xa55c('0x7e')][_0xa55c('0x45')]({'where':{'id':_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')],'role':_0xa55c('0x7f')},'attributes':['id','name',_0xa55c('0x80'),_0xa55c('0x81'),_0xa55c('0x82')],'raw':!![]});}return null;})[_0xa55c('0x21')](function(_0xa957ad){if(!_0xa957ad)return null;_0x14febc['message'][_0xa55c('0x7f')]=_0xa957ad;return _0x14febc;})[_0xa55c('0x21')](function(_0x58296a){if(_0x58296a){if(_0x1af9d5['body'][_0xa55c('0x83')]){_0x14febc[_0xa55c('0x18')]['interface']=util['format']('SIP/%s',_0x1af9d5['user'][_0xa55c('0x26')]);_0x14febc[_0xa55c('0x18')][_0xa55c('0x84')]=_0x14febc[_0xa55c('0x84')];_0x14febc[_0xa55c('0x18')][_0xa55c('0x85')]='accept';_0x14febc[_0xa55c('0x18')][_0xa55c('0x47')]=htmlToText[_0xa55c('0x86')](_0x14febc[_0xa55c('0x18')]['body']);return respondWithRpcPromise(_0xa55c('0x87'),_0xa55c('0x87'),{'event':_0xa55c('0x88'),'message':_0x14febc['message']},client9002)[_0xa55c('0x21')](function(){return _0x14febc;});}return _0x14febc;}return null;})['then'](respondWithResult(_0x4b2032,null))['catch'](handleError(_0x4b2032,null));};exports[_0xa55c('0x89')]=function(_0x413b45,_0x1e298d){var _0x249b0c={'agent':{},'channel':_0xa55c('0x6d')};if(_0x413b45[_0xa55c('0x47')]['id']){delete _0x413b45[_0xa55c('0x47')]['id'];}_0x413b45['body']['UserId']=_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')]||_0x413b45[_0xa55c('0x5d')]['id'];_0x249b0c[_0xa55c('0x7f')]['id']=_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')];return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x413b45[_0xa55c('0x3f')]['id'],'UserId':null}})[_0xa55c('0x21')](handleEntityNotFound(_0x1e298d,null))['then'](function(_0xc9c3fa){if(_0xc9c3fa){_0x249b0c[_0xa55c('0x18')]=_0xc9c3fa['get']({'plain':!![]});return db[_0xa55c('0x8a')]['find']({'where':{'id':_0xc9c3fa[_0xa55c('0x72')]}});}return null;})[_0xa55c('0x21')](handleEntityNotFound(_0x1e298d,null))[_0xa55c('0x21')](function(_0x314205){if(_0x314205){_0x249b0c[_0xa55c('0x73')]=_0x314205['get']({'plain':!![]});interaction_log[_0xa55c('0x10')](_0xa55c('0x8b'),_0x413b45[_0xa55c('0x5d')]['id'],_0x413b45[_0xa55c('0x5d')][_0xa55c('0x26')],_0x413b45[_0xa55c('0x5d')][_0xa55c('0x75')],_0x249b0c['interaction']['id'],_0x413b45['body']?JSON['stringify'](_0x413b45[_0xa55c('0x47')]):'null');return respondWithRpcPromise(_0xa55c('0x8c'),_0xa55c('0x8d'),_0x249b0c);}return null;})[_0xa55c('0x21')](function(_0x73162a){var _0x26ca90='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x73162a[_0xa55c('0x18')]['ContactId'];return db[_0xa55c('0x7a')][_0xa55c('0x2f')](_0x26ca90,{'type':db[_0xa55c('0x8e')][_0xa55c('0x7b')]['SELECT'],'raw':!![]})[_0xa55c('0x21')](function(_0x46f8ab){return _0x46f8ab;});})[_0xa55c('0x21')](function(_0x17a36c){if(_0x17a36c){_0x249b0c[_0xa55c('0x18')][_0xa55c('0x7d')]=_0x17a36c[0x0];if(!_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')])return;return db['User'][_0xa55c('0x45')]({'where':{'id':_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')],'role':_0xa55c('0x7f')},'attributes':['id',_0xa55c('0x26'),_0xa55c('0x80'),'email',_0xa55c('0x82')],'raw':!![]});}return null;})['then'](function(_0x3b9712){if(!_0x3b9712)return null;_0x249b0c['message'][_0xa55c('0x7f')]=_0x3b9712;return _0x249b0c;})[_0xa55c('0x21')](function(_0x17312b){if(_0x17312b){_0x17312b['message'][_0xa55c('0x8f')]=util[_0xa55c('0x6a')](_0xa55c('0x90'),_0x413b45['user'][_0xa55c('0x26')]);_0x17312b['message'][_0xa55c('0x84')]=_0x249b0c[_0xa55c('0x84')];_0x17312b['message'][_0xa55c('0x85')]='reject';_0x17312b[_0xa55c('0x18')][_0xa55c('0x47')]=htmlToText['fromString'](_0x249b0c[_0xa55c('0x18')][_0xa55c('0x47')]);respondWithRpcPromise('EventManager',_0xa55c('0x87'),{'event':_0xa55c('0x91'),'message':_0x17312b['message']},client9002);return _0x249b0c;}return null;})[_0xa55c('0x21')](respondWithResult(_0x1e298d,null))['catch'](handleError(_0x1e298d,null));};exports['download']=function(_0x28a26d,_0x3113b9){var _0x28a71e=moment()[_0xa55c('0x92')]()['toString']();var _0x307895=path['join'](config[_0xa55c('0x63')],'server','files','tmp');var _0x999114=path['join'](config['root'],_0xa55c('0x93'),_0xa55c('0x94'),_0xa55c('0x61'));var _0x4046ae=util[_0xa55c('0x6a')](_0xa55c('0x95'),_0x28a71e);return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x28a26d[_0xa55c('0x3f')]['id']},'attributes':['id',_0xa55c('0x47'),_0xa55c('0x96'),'to','cc',_0xa55c('0x97'),_0xa55c('0x98'),'createdAt'],'include':_0x28a26d[_0xa55c('0x2f')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0xa55c('0x21')](handleEntityNotFound(_0x3113b9,null))['then'](function(_0xd5a27a){if(_0xd5a27a){var _0x55e447=_0xd5a27a;var _0x3169dd={'from':_0x55e447['from'],'to':_0x55e447['to'],'subject':_0x55e447['subject'],'html':_0x55e447[_0xa55c('0x47')],'headers':{'Date':moment(_0x55e447['createdAt'])['format'](_0xa55c('0x99'))},'attachments':[]};if(_0xd5a27a['cc']){_0x3169dd[_0xa55c('0x9a')]['Cc']=_0xd5a27a['cc'];}if(_0xd5a27a['bcc']){_0x3169dd[_0xa55c('0x9a')]['Bcc']=_0xd5a27a[_0xa55c('0x97')];}return new BPromise(function(_0x403dff,_0x1dcd8a){if(_0xd5a27a['Attachments']){for(var _0x50df67=0x0;_0x50df67<_0xd5a27a[_0xa55c('0x9b')][_0xa55c('0x32')];_0x50df67++){var _0x36064f=_0xd5a27a[_0xa55c('0x9b')][_0x50df67];var _0x4297bf=path[_0xa55c('0x62')](_0x999114,_0x36064f[_0xa55c('0x65')]);if(fs[_0xa55c('0x9c')](_0x4297bf)){_0x3169dd['attachments'][_0xa55c('0x9d')]({'name':_0x36064f[_0xa55c('0x26')],'contentType':_0x36064f[_0xa55c('0x2c')],'data':fs[_0xa55c('0x9e')](_0x4297bf)});}}}emlformat[_0xa55c('0x9f')](_0x3169dd,function(_0x1a01de,_0x2fa186){if(_0x1a01de)return _0x1dcd8a(_0x1a01de);fs[_0xa55c('0xa0')](path[_0xa55c('0x62')](_0x307895,_0x4046ae),_0x2fa186);return _0x403dff(_0x2fa186);});});}})['then'](function(_0x19ebd5){if(_0x19ebd5){return _0x3113b9[_0xa55c('0xa1')](path[_0xa55c('0x62')](_0x307895,_0x4046ae),_0x4046ae,function(_0x5ea9c8){if(!_0x5ea9c8)fs['unlinkSync'](path['join'](_0x307895,_0x4046ae));});}})[_0xa55c('0x3d')](handleError(_0x3113b9,null));}; \ No newline at end of file +var _0x486d=['List','CmContact','MailServerOut','Smtp','host','port','secure','auth','user','pass','service','join','attachments','Contacts','ListId','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','read','UserId','agent','get','MailInteraction','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','accept','fromString','EventManager','acceptmessage','reject','mail','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','event','rejectmessage','download','unix','toString','server','files','root','message-%s.eml','from','bcc','createdAt','Attachment','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','jayson/promise','client','http','info','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','json','offset','undefined','count','limit','status','set','Content-Range','then','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','fields','update','body','find','describe','create','out','split','findOne','MailAccountId'];(function(_0x564644,_0x464acb){var _0x2c70f7=function(_0x3f14b5){while(--_0x3f14b5){_0x564644['push'](_0x564644['shift']());}};_0x2c70f7(++_0x464acb);}(_0x486d,0xea));var _0xd486=function(_0x253517,_0x4047e1){_0x253517=_0x253517-0x0;var _0x5b5960=_0x486d[_0x253517];return _0x5b5960;};'use strict';var emlformat=require(_0xd486('0x0'));var moment=require(_0xd486('0x1'));var BPromise=require(_0xd486('0x2'));var util=require(_0xd486('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xd486('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xd486('0x5'));var qs=require(_0xd486('0x6'));var logger=require(_0xd486('0x7'))(_0xd486('0x8'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0xd486('0x9'));var db=require(_0xd486('0xa'))['db'];config[_0xd486('0xb')]=_['defaults'](config[_0xd486('0xb')],{'host':_0xd486('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd486('0xb')]));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xd486('0xd'));var client=jayson[_0xd486('0xe')]['http']({'port':0x232c});var client9003=jayson[_0xd486('0xe')]['http']({'port':0x232b});var client9002=jayson[_0xd486('0xe')][_0xd486('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x5771f2,_0x3fe144,_0x17259f,_0x2e4f61){return new BPromise(function(_0xa65cd6,_0x2c2d55){var _0x43c27f=_0x2e4f61||client;return _0x43c27f['request'](_0x5771f2,_0x17259f)['then'](function(_0x10352f){logger[_0xd486('0x10')]('MailMessage,\x20%s,\x20%s',_0x3fe144,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x3fe144,_0xd486('0x11'),JSON[_0xd486('0x12')](_0x10352f));if(_0x10352f['error']){if(_0x10352f[_0xd486('0x13')][_0xd486('0x14')]===0x1f4){logger[_0xd486('0x13')](_0xd486('0x15'),_0x3fe144,_0x10352f[_0xd486('0x13')]['message']);return _0x2c2d55(_0x10352f[_0xd486('0x13')]['message']);}logger[_0xd486('0x13')](_0xd486('0x15'),_0x3fe144,_0x10352f[_0xd486('0x13')][_0xd486('0x16')]);return _0xa65cd6(_0x10352f[_0xd486('0x13')]['message']);}else{logger[_0xd486('0x10')]('MailMessage,\x20%s,\x20%s',_0x3fe144,_0xd486('0x11'));_0xa65cd6(_0x10352f[_0xd486('0x17')]['message']);}})[_0xd486('0x18')](function(_0x3b1650){logger[_0xd486('0x13')](_0xd486('0x15'),_0x3fe144,_0x3b1650);_0x2c2d55(_0x3b1650);});});}function respondWithResult(_0x28674e,_0x4bdd44){_0x4bdd44=_0x4bdd44||0xc8;return function(_0x524ce9){if(_0x524ce9){return _0x28674e['status'](_0x4bdd44)[_0xd486('0x19')](_0x524ce9);}};}function respondWithFilteredResult(_0x18cda5,_0x5990c4){return function(_0x38a38c){if(_0x38a38c){var _0xf39078=typeof _0x5990c4[_0xd486('0x1a')]==='undefined'&&typeof _0x5990c4['limit']===_0xd486('0x1b');var _0xdc7533=_0x38a38c['count'];var _0x10b6c4=_0xf39078?0x0:_0x5990c4[_0xd486('0x1a')];var _0x41b999=_0xf39078?_0x38a38c[_0xd486('0x1c')]:_0x5990c4[_0xd486('0x1a')]+_0x5990c4[_0xd486('0x1d')];var _0x3d50cb;if(_0x41b999>=_0xdc7533){_0x41b999=_0xdc7533;_0x3d50cb=0xc8;}else{_0x3d50cb=0xce;}_0x18cda5[_0xd486('0x1e')](_0x3d50cb);return _0x18cda5[_0xd486('0x1f')](_0xd486('0x20'),_0x10b6c4+'-'+_0x41b999+'/'+_0xdc7533)[_0xd486('0x19')](_0x38a38c);}return null;};}function saveUpdates(_0x11b912){return function(_0x53722e){if(_0x53722e){return _0x53722e['update'](_0x11b912)[_0xd486('0x21')](function(_0x5c97ad){return _0x5c97ad;});}return null;};}function removeEntity(_0x2454fc){return function(_0x11556d){if(_0x11556d){return _0x11556d[_0xd486('0x22')]()[_0xd486('0x21')](function(){_0x2454fc[_0xd486('0x1e')](0xcc)[_0xd486('0x23')]();});}};}function handleEntityNotFound(_0x11c6da){return function(_0x156bd9){if(!_0x156bd9){_0x11c6da[_0xd486('0x24')](0x194);}return _0x156bd9;};}function handleError(_0xbe6d83,_0x10b59c){_0x10b59c=_0x10b59c||0x1f4;return function(_0x1ac5ef){logger['error'](_0x1ac5ef[_0xd486('0x25')]);if(_0x1ac5ef[_0xd486('0x26')]){delete _0x1ac5ef['name'];}_0xbe6d83[_0xd486('0x1e')](_0x10b59c)[_0xd486('0x27')](_0x1ac5ef);};}exports[_0xd486('0x28')]=function(_0xd8fcc8,_0x510fcb){var _0x2acac4={},_0x9a1858={},_0x58276b={'count':0x0,'rows':[]};var _0x28ac7a=_[_0xd486('0x29')](db[_0xd486('0x2a')][_0xd486('0x2b')],function(_0x4a7d36){return{'name':_0x4a7d36['fieldName'],'type':_0x4a7d36[_0xd486('0x2c')][_0xd486('0x2d')]};});_0x9a1858[_0xd486('0x2e')]=_[_0xd486('0x29')](_0x28ac7a,'name');_0x9a1858[_0xd486('0x2f')]=_[_0xd486('0x30')](_0xd8fcc8[_0xd486('0x2f')]);_0x9a1858[_0xd486('0x31')]=_[_0xd486('0x32')](_0x9a1858[_0xd486('0x2e')],_0x9a1858[_0xd486('0x2f')]);_0x2acac4[_0xd486('0x33')]=_[_0xd486('0x32')](_0x9a1858['model'],qs['fields'](_0xd8fcc8['query']['fields']));_0x2acac4[_0xd486('0x33')]=_0x2acac4[_0xd486('0x33')][_0xd486('0x34')]?_0x2acac4[_0xd486('0x33')]:_0x9a1858[_0xd486('0x2e')];if(!_0xd8fcc8['query'][_0xd486('0x35')](_0xd486('0x36'))){_0x2acac4[_0xd486('0x1d')]=qs['limit'](_0xd8fcc8[_0xd486('0x2f')][_0xd486('0x1d')]);_0x2acac4[_0xd486('0x1a')]=qs[_0xd486('0x1a')](_0xd8fcc8[_0xd486('0x2f')]['offset']);}_0x2acac4[_0xd486('0x37')]=qs[_0xd486('0x38')](_0xd8fcc8[_0xd486('0x2f')]['sort']);_0x2acac4[_0xd486('0x39')]=qs[_0xd486('0x31')](_[_0xd486('0x3a')](_0xd8fcc8[_0xd486('0x2f')],_0x9a1858[_0xd486('0x31')]),_0x28ac7a);if(_0xd8fcc8[_0xd486('0x2f')][_0xd486('0x3b')]){_0x2acac4['where']=_[_0xd486('0x3c')](_0x2acac4[_0xd486('0x39')],{'$or':_[_0xd486('0x29')](_0x28ac7a,function(_0x32d48a){if(_0x32d48a[_0xd486('0x2c')]!==_0xd486('0x3d')){var _0x2a2e2e={};_0x2a2e2e[_0x32d48a[_0xd486('0x26')]]={'$like':'%'+_0xd8fcc8[_0xd486('0x2f')][_0xd486('0x3b')]+'%'};return _0x2a2e2e;}})});}_0x2acac4=_[_0xd486('0x3c')]({},_0x2acac4,_0xd8fcc8[_0xd486('0x3e')]);var _0x46b358={'where':_0x2acac4[_0xd486('0x39')]};return db['MailMessage'][_0xd486('0x1c')](_0x46b358)[_0xd486('0x21')](function(_0x27ad39){_0x58276b['count']=_0x27ad39;if(_0xd8fcc8[_0xd486('0x2f')]['includeAll']){_0x2acac4[_0xd486('0x3f')]=[{'all':!![]}];}return db['MailMessage'][_0xd486('0x40')](_0x2acac4);})[_0xd486('0x21')](function(_0x100422){_0x58276b[_0xd486('0x41')]=_0x100422;return _0x58276b;})['then'](respondWithFilteredResult(_0x510fcb,_0x2acac4))[_0xd486('0x18')](handleError(_0x510fcb,null));};exports[_0xd486('0x42')]=function(_0x3764b2,_0x10a5d2){var _0x3da748={'raw':!![],'where':{'id':_0x3764b2[_0xd486('0x43')]['id']}},_0x3c12bd={};_0x3c12bd[_0xd486('0x2e')]=_[_0xd486('0x30')](db[_0xd486('0x2a')][_0xd486('0x2b')]);_0x3c12bd['query']=_['keys'](_0x3764b2['query']);_0x3c12bd[_0xd486('0x31')]=_[_0xd486('0x32')](_0x3c12bd['model'],_0x3c12bd['query']);_0x3da748['attributes']=_[_0xd486('0x32')](_0x3c12bd['model'],qs[_0xd486('0x44')](_0x3764b2[_0xd486('0x2f')][_0xd486('0x44')]));_0x3da748['attributes']=_0x3da748['attributes'][_0xd486('0x34')]?_0x3da748[_0xd486('0x33')]:_0x3c12bd[_0xd486('0x2e')];if(_0x3764b2[_0xd486('0x2f')]['includeAll']){_0x3da748[_0xd486('0x3f')]=[{'all':!![]}];}_0x3da748=_[_0xd486('0x3c')]({},_0x3da748,_0x3764b2[_0xd486('0x3e')]);return db[_0xd486('0x2a')]['find'](_0x3da748)['then'](handleEntityNotFound(_0x10a5d2,null))[_0xd486('0x21')](respondWithResult(_0x10a5d2,null))[_0xd486('0x18')](handleError(_0x10a5d2,null));};exports[_0xd486('0x45')]=function(_0x4e54ec,_0x51ef4b){if(_0x4e54ec[_0xd486('0x46')]['id']){delete _0x4e54ec[_0xd486('0x46')]['id'];}return db[_0xd486('0x2a')][_0xd486('0x47')]({'where':{'id':_0x4e54ec[_0xd486('0x43')]['id']}})[_0xd486('0x21')](handleEntityNotFound(_0x51ef4b,null))['then'](saveUpdates(_0x4e54ec[_0xd486('0x46')],null))[_0xd486('0x21')](respondWithResult(_0x51ef4b,null))['catch'](handleError(_0x51ef4b,null));};exports[_0xd486('0x22')]=function(_0x436f27,_0x235cfe){return db[_0xd486('0x2a')]['find']({'where':{'id':_0x436f27[_0xd486('0x43')]['id']}})['then'](handleEntityNotFound(_0x235cfe,null))[_0xd486('0x21')](removeEntity(_0x235cfe,null))['catch'](handleError(_0x235cfe,null));};exports[_0xd486('0x48')]=function(_0x50c313,_0x30343a){return db[_0xd486('0x2a')][_0xd486('0x48')]()[_0xd486('0x21')](respondWithResult(_0x30343a,null))[_0xd486('0x18')](handleError(_0x30343a,null));};exports[_0xd486('0x49')]=function(_0x3bb9ce,_0x2727ed){return db[_0xd486('0x2a')][_0xd486('0x49')](_0x3bb9ce[_0xd486('0x46')])[_0xd486('0x21')](function(_0x340050){if(_0x340050){if(_0x340050['direction']===_0xd486('0x4a')&&!_0x340050['secret']){var _0x40df35,_0x2e4133,_0x410bdc;if(_0x3bb9ce[_0xd486('0x46')]['to']){_0x2e4133=_0x3bb9ce[_0xd486('0x46')]['to'][_0xd486('0x4b')](',')[0x0];}return db['MailAccount'][_0xd486('0x4c')]({'where':{'id':_0x340050[_0xd486('0x4d')]},'include':[{'model':db['CmList'],'as':_0xd486('0x4e'),'include':[{'model':db[_0xd486('0x4f')],'as':'Contacts','where':{'email':_0x2e4133},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xd486('0x50')],'as':_0xd486('0x51'),'raw':!![]}]})[_0xd486('0x21')](function(_0x4ab5b9){_0x40df35=_0x4ab5b9;if(_0x40df35&&_0x40df35['Smtp']){var _0xba4c9={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x40df35['Smtp']['service'])){_0xba4c9[_0xd486('0x52')]=_0x40df35[_0xd486('0x51')][_0xd486('0x52')];_0xba4c9[_0xd486('0x53')]=_0x40df35[_0xd486('0x51')][_0xd486('0x53')];_0xba4c9[_0xd486('0x54')]=_0x40df35[_0xd486('0x51')][_0xd486('0x54')];if(_0x40df35[_0xd486('0x51')]['authentication']){_0xba4c9[_0xd486('0x55')]={'user':_0x40df35[_0xd486('0x51')][_0xd486('0x56')],'pass':_0x40df35[_0xd486('0x51')][_0xd486('0x57')]};}}else{_0xba4c9[_0xd486('0x58')]=_0x40df35[_0xd486('0x51')][_0xd486('0x58')];_0xba4c9[_0xd486('0x55')]={'user':_0x40df35[_0xd486('0x51')]['user'],'pass':_0x40df35[_0xd486('0x51')][_0xd486('0x57')]};_0xba4c9[_0xd486('0x54')]=_0x40df35['Smtp'][_0xd486('0x54')];}if(_0x3bb9ce[_0xd486('0x46')]['attachments']&&_0x3bb9ce[_0xd486('0x46')]['attachments'][_0xd486('0x34')]){for(var _0x30d632=0x0;_0x30d632<_0x3bb9ce['body']['attachments'][_0xd486('0x34')];_0x30d632+=0x1){_0x3bb9ce[_0xd486('0x46')]['attachments'][_0x30d632]={'filename':_0x3bb9ce['body']['attachments'][_0x30d632][_0xd486('0x26')],'path':path[_0xd486('0x59')](config['root'],'server/files/attachments',_0x3bb9ce[_0xd486('0x46')][_0xd486('0x5a')][_0x30d632]['basename'])};}}_0x410bdc={'account':_0xba4c9,'message':_0x3bb9ce[_0xd486('0x46')]};return;}})[_0xd486('0x21')](function(){if(_0x40df35[_0xd486('0x4e')]){if(_0x40df35[_0xd486('0x4e')]['Contacts'][_0xd486('0x34')]){return _0x40df35[_0xd486('0x4e')][_0xd486('0x5b')][0x0];}else{return db[_0xd486('0x4f')]['create'](_['defaults'](_0x3bb9ce['body'],{'firstName':_0x3bb9ce[_0xd486('0x46')]['to'],'email':_0x3bb9ce[_0xd486('0x46')]['to'],'phone':_0x3bb9ce[_0xd486('0x46')]['to'],'ListId':_0x40df35[_0xd486('0x5c')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xd486('0x21')](function(){if(_0x410bdc){return respondWithRpcPromise(_0xd486('0x5d'),'sendMail',_0x410bdc,client9003)[_0xd486('0x21')](function(_0x20a17d){return _0x340050[_0xd486('0x45')]({'read':!![],'messageId':_0x20a17d[_0xd486('0x5e')],'sentAt':moment()[_0xd486('0x5f')](_0xd486('0x60'))});})[_0xd486('0x18')](function(_0x9b761){logger[_0xd486('0x13')]('%s',JSON[_0xd486('0x12')](_0x9b761));return _0x340050;});}return _0x340050;});}return _0x340050;}})['then'](respondWithResult(_0x2727ed,0xc9))['catch'](handleError(_0x2727ed,null));};exports['accept']=function(_0x157697,_0x5a0a48){var _0x1feb0d={'agent':{},'channel':'mail'};if(_0x157697['body']['id']){delete _0x157697[_0xd486('0x46')]['id'];}_0x157697['body'][_0xd486('0x61')]=!![];_0x157697[_0xd486('0x46')]['readAt']=moment()[_0xd486('0x5f')](_0xd486('0x60'));_0x157697['body'][_0xd486('0x62')]=_0x157697['body'][_0xd486('0x62')]||_0x157697[_0xd486('0x56')]['id'];_0x1feb0d[_0xd486('0x63')]['id']=_0x157697[_0xd486('0x46')]['UserId'];return db[_0xd486('0x2a')][_0xd486('0x47')]({'where':{'id':_0x157697['params']['id'],'UserId':null}})[_0xd486('0x21')](handleEntityNotFound(_0x5a0a48,null))[_0xd486('0x21')](saveUpdates(_0x157697[_0xd486('0x46')],null))[_0xd486('0x21')](function(_0x112b9c){if(_0x112b9c){_0x1feb0d[_0xd486('0x16')]=_0x112b9c[_0xd486('0x64')]({'plain':!![]});return db[_0xd486('0x65')]['find']({'where':{'id':_0x112b9c['MailInteractionId']}});}return null;})[_0xd486('0x21')](handleEntityNotFound(_0x5a0a48,null))['then'](function(_0x2edfe2){if(_0x2edfe2){return _0x2edfe2[_0xd486('0x45')]({'UserId':_0x157697['body']['UserId'],'read1stAt':_[_0xd486('0x66')](_0x2edfe2[_0xd486('0x67')])?moment()['format'](_0xd486('0x60')):undefined});}return null;})[_0xd486('0x21')](function(_0x1d5093){if(_0x1d5093){_0x1feb0d[_0xd486('0x68')]=_0x1d5093[_0xd486('0x64')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x157697['user']['id'],_0x157697[_0xd486('0x56')][_0xd486('0x26')],_0x157697[_0xd486('0x56')][_0xd486('0x69')],_0x1feb0d[_0xd486('0x68')]['id'],_0x157697[_0xd486('0x46')]?JSON['stringify'](_0x157697['body']):_0xd486('0x6a'));return respondWithRpcPromise(_0xd486('0x6b'),_0xd486('0x6c'),_0x1feb0d);}return null;})['then'](function(_0x4020f3){var _0x31f9cf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4020f3[_0xd486('0x16')][_0xd486('0x6d')];return db[_0xd486('0x6e')][_0xd486('0x2f')](_0x31f9cf,{'type':db[_0xd486('0x6f')][_0xd486('0x70')][_0xd486('0x71')],'raw':!![]})['then'](function(_0x54b001){return _0x54b001;});})[_0xd486('0x21')](function(_0x759361){if(_0x759361){_0x1feb0d[_0xd486('0x16')][_0xd486('0x72')]=_0x759361[0x0];if(!_0x157697[_0xd486('0x46')][_0xd486('0x62')])return;return db[_0xd486('0x73')][_0xd486('0x47')]({'where':{'id':_0x157697['body'][_0xd486('0x62')],'role':_0xd486('0x63')},'attributes':['id','name',_0xd486('0x74'),'email',_0xd486('0x75')],'raw':!![]});}return null;})['then'](function(_0xf5e04){if(!_0xf5e04)return null;_0x1feb0d[_0xd486('0x16')][_0xd486('0x63')]=_0xf5e04;return _0x1feb0d;})[_0xd486('0x21')](function(_0x30ca53){if(_0x30ca53){if(_0x157697['body'][_0xd486('0x76')]){_0x1feb0d['message']['interface']=util[_0xd486('0x5f')](_0xd486('0x77'),_0x157697[_0xd486('0x56')]['name']);_0x1feb0d[_0xd486('0x16')][_0xd486('0x78')]=_0x1feb0d[_0xd486('0x78')];_0x1feb0d[_0xd486('0x16')][_0xd486('0x79')]=_0x1feb0d[_0xd486('0x78')];_0x1feb0d[_0xd486('0x16')]['event']=_0xd486('0x7a');_0x1feb0d[_0xd486('0x16')][_0xd486('0x46')]=htmlToText[_0xd486('0x7b')](_0x1feb0d[_0xd486('0x16')][_0xd486('0x46')]);return respondWithRpcPromise(_0xd486('0x7c'),_0xd486('0x7c'),{'event':_0xd486('0x7d'),'message':_0x1feb0d[_0xd486('0x16')]},client9002)[_0xd486('0x21')](function(){return _0x1feb0d;});}return _0x1feb0d;}return null;})[_0xd486('0x21')](respondWithResult(_0x5a0a48,null))[_0xd486('0x18')](handleError(_0x5a0a48,null));};exports[_0xd486('0x7e')]=function(_0x47a4b8,_0x5eb415){var _0x570ced={'agent':{},'channel':_0xd486('0x7f')};if(_0x47a4b8[_0xd486('0x46')]['id']){delete _0x47a4b8['body']['id'];}_0x47a4b8[_0xd486('0x46')][_0xd486('0x62')]=_0x47a4b8['body']['UserId']||_0x47a4b8[_0xd486('0x56')]['id'];_0x570ced['agent']['id']=_0x47a4b8['body'][_0xd486('0x62')];return db[_0xd486('0x2a')][_0xd486('0x47')]({'where':{'id':_0x47a4b8[_0xd486('0x43')]['id'],'UserId':null}})[_0xd486('0x21')](handleEntityNotFound(_0x5eb415,null))['then'](function(_0x169fda){if(_0x169fda){_0x570ced[_0xd486('0x16')]=_0x169fda[_0xd486('0x64')]({'plain':!![]});return db[_0xd486('0x65')][_0xd486('0x47')]({'where':{'id':_0x169fda[_0xd486('0x80')]}});}return null;})[_0xd486('0x21')](handleEntityNotFound(_0x5eb415,null))[_0xd486('0x21')](function(_0x18ae03){if(_0x18ae03){_0x570ced[_0xd486('0x68')]=_0x18ae03[_0xd486('0x64')]({'plain':!![]});interaction_log[_0xd486('0x10')](_0xd486('0x81'),_0x47a4b8['user']['id'],_0x47a4b8['user']['name'],_0x47a4b8[_0xd486('0x56')][_0xd486('0x69')],_0x570ced['interaction']['id'],_0x47a4b8['body']?JSON[_0xd486('0x12')](_0x47a4b8[_0xd486('0x46')]):_0xd486('0x6a'));return respondWithRpcPromise(_0xd486('0x82'),'rejectMessage',_0x570ced);}return null;})[_0xd486('0x21')](function(_0x2e2a2e){var _0x50064f=_0xd486('0x83')+_0x2e2a2e[_0xd486('0x16')][_0xd486('0x6d')];return db[_0xd486('0x6e')][_0xd486('0x2f')](_0x50064f,{'type':db[_0xd486('0x6f')]['QueryTypes'][_0xd486('0x71')],'raw':!![]})['then'](function(_0x11418d){return _0x11418d;});})['then'](function(_0x1c022e){if(_0x1c022e){_0x570ced[_0xd486('0x16')][_0xd486('0x72')]=_0x1c022e[0x0];if(!_0x47a4b8[_0xd486('0x46')][_0xd486('0x62')])return;return db['User']['find']({'where':{'id':_0x47a4b8[_0xd486('0x46')][_0xd486('0x62')],'role':'agent'},'attributes':['id','name',_0xd486('0x74'),_0xd486('0x84'),_0xd486('0x75')],'raw':!![]});}return null;})[_0xd486('0x21')](function(_0x4c7fcf){if(!_0x4c7fcf)return null;_0x570ced[_0xd486('0x16')]['agent']=_0x4c7fcf;return _0x570ced;})['then'](function(_0x3e4a41){if(_0x3e4a41){_0x3e4a41[_0xd486('0x16')]['interface']=util[_0xd486('0x5f')](_0xd486('0x77'),_0x47a4b8[_0xd486('0x56')][_0xd486('0x26')]);_0x3e4a41['message']['channel']=_0x570ced['channel'];_0x3e4a41[_0xd486('0x16')]['motionChannel']=_0x570ced['channel'];_0x3e4a41['message'][_0xd486('0x85')]=_0xd486('0x7e');_0x3e4a41[_0xd486('0x16')][_0xd486('0x46')]=htmlToText[_0xd486('0x7b')](_0x570ced[_0xd486('0x16')][_0xd486('0x46')]);respondWithRpcPromise(_0xd486('0x7c'),_0xd486('0x7c'),{'event':_0xd486('0x86'),'message':_0x3e4a41['message']},client9002);return _0x570ced;}return null;})[_0xd486('0x21')](respondWithResult(_0x5eb415,null))[_0xd486('0x18')](handleError(_0x5eb415,null));};exports[_0xd486('0x87')]=function(_0x2263d5,_0x1bb4f3){var _0x7ac065=moment()[_0xd486('0x88')]()[_0xd486('0x89')]();var _0x47c5bd=path[_0xd486('0x59')](config['root'],_0xd486('0x8a'),_0xd486('0x8b'),'tmp');var _0x1c9eb8=path[_0xd486('0x59')](config[_0xd486('0x8c')],_0xd486('0x8a'),_0xd486('0x8b'),_0xd486('0x5a'));var _0x20f923=util[_0xd486('0x5f')](_0xd486('0x8d'),_0x7ac065);return db[_0xd486('0x2a')]['find']({'where':{'id':_0x2263d5['params']['id']},'attributes':['id',_0xd486('0x46'),_0xd486('0x8e'),'to','cc',_0xd486('0x8f'),'subject',_0xd486('0x90')],'include':_0x2263d5[_0xd486('0x2f')]['attachments']?[{'model':db[_0xd486('0x91')],'as':'Attachments'}]:undefined})[_0xd486('0x21')](handleEntityNotFound(_0x1bb4f3,null))[_0xd486('0x21')](function(_0x422030){if(_0x422030){var _0x54107d=_0x422030;var _0x4b8a4a={'from':_0x54107d[_0xd486('0x8e')],'to':_0x54107d['to'],'subject':_0x54107d[_0xd486('0x92')],'html':_0x54107d['body'],'headers':{'Date':moment(_0x54107d['createdAt'])[_0xd486('0x5f')](_0xd486('0x93'))},'attachments':[]};if(_0x422030['cc']){_0x4b8a4a[_0xd486('0x94')]['Cc']=_0x422030['cc'];}if(_0x422030[_0xd486('0x8f')]){_0x4b8a4a['headers'][_0xd486('0x95')]=_0x422030[_0xd486('0x8f')];}return new BPromise(function(_0x4e2ffa,_0x20edf8){if(_0x422030[_0xd486('0x96')]){for(var _0x1020f5=0x0;_0x1020f5<_0x422030['Attachments'][_0xd486('0x34')];_0x1020f5++){var _0x49314a=_0x422030[_0xd486('0x96')][_0x1020f5];var _0x5d83d2=path[_0xd486('0x59')](_0x1c9eb8,_0x49314a['basename']);if(fs[_0xd486('0x97')](_0x5d83d2)){_0x4b8a4a[_0xd486('0x5a')][_0xd486('0x98')]({'name':_0x49314a[_0xd486('0x26')],'contentType':_0x49314a[_0xd486('0x2c')],'data':fs['readFileSync'](_0x5d83d2)});}}}emlformat[_0xd486('0x99')](_0x4b8a4a,function(_0x425f99,_0x355131){if(_0x425f99)return _0x20edf8(_0x425f99);fs[_0xd486('0x9a')](path[_0xd486('0x59')](_0x47c5bd,_0x20f923),_0x355131);return _0x4e2ffa(_0x355131);});});}})[_0xd486('0x21')](function(_0xe09849){if(_0xe09849){return _0x1bb4f3[_0xd486('0x87')](path[_0xd486('0x59')](_0x47c5bd,_0x20f923),_0x20f923,function(_0x4de852){if(!_0x4de852)fs[_0xd486('0x9b')](path[_0xd486('0x59')](_0x47c5bd,_0x20f923));});}})['catch'](handleError(_0x1bb4f3,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8e34f98..452a089 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 _0x7abf=['emit','hasOwnProperty','hook','exports','events','save','update','remove'];(function(_0x358e87,_0x14d9d3){var _0x452ca1=function(_0x5321f9){while(--_0x5321f9){_0x358e87['push'](_0x358e87['shift']());}};_0x452ca1(++_0x14d9d3);}(_0x7abf,0xfc));var _0xf7ab=function(_0x4996d2,_0xe42b4){_0x4996d2=_0x4996d2-0x0;var _0x5f506a=_0x7abf[_0x4996d2];return _0x5f506a;};'use strict';var EventEmitter=require(_0xf7ab('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf7ab('0x1'),'afterUpdate':_0xf7ab('0x2'),'afterDestroy':_0xf7ab('0x3')};function emitEvent(_0x3175eb){return function(_0x22765f,_0x117991,_0x5a2377){MailMessageEvents[_0xf7ab('0x4')](_0x3175eb+':'+_0x22765f['id'],_0x22765f);MailMessageEvents[_0xf7ab('0x4')](_0x3175eb,_0x22765f);_0x5a2377(null);};}for(var e in events){if(events[_0xf7ab('0x5')](e)){var event=events[e];MailMessage[_0xf7ab('0x6')](e,emitEvent(event));}}module[_0xf7ab('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x0969=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x47936b,_0x55eda3){var _0x2183d5=function(_0x3bede0){while(--_0x3bede0){_0x47936b['push'](_0x47936b['shift']());}};_0x2183d5(++_0x55eda3);}(_0x0969,0x1c5));var _0x9096=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x0969[_0x134c2e];return _0x2825db;};'use strict';var EventEmitter=require(_0x9096('0x0'));var MailMessage=require(_0x9096('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9096('0x2')](0x0);var events={'afterCreate':_0x9096('0x3'),'afterUpdate':_0x9096('0x4'),'afterDestroy':_0x9096('0x5')};function emitEvent(_0x4f0def){return function(_0x7f1c7a,_0x226b40,_0x2976b5){MailMessageEvents[_0x9096('0x6')](_0x4f0def+':'+_0x7f1c7a['id'],_0x7f1c7a);MailMessageEvents[_0x9096('0x6')](_0x4f0def,_0x7f1c7a);_0x2976b5(null);};}for(var e in events){if(events[_0x9096('0x7')](e)){var event=events[e];MailMessage[_0x9096('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 11bab79..eed812b 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 _0x0b85=['plainBody','subject','FULLTEXT','body','get','direction','toLowerCase','out','secret','MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','./mailMessage.attributes','define','MailMessage','messageId','fti_mail_messages'];(function(_0x4f646e,_0x1d1b25){var _0x459c10=function(_0x3d60a5){while(--_0x3d60a5){_0x4f646e['push'](_0x4f646e['shift']());}};_0x459c10(++_0x1d1b25);}(_0x0b85,0x92));var _0x50b8=function(_0x5f1341,_0x18f3e9){_0x5f1341=_0x5f1341-0x0;var _0x52a405=_0x0b85[_0x5f1341];return _0x52a405;};'use strict';var _=require(_0x50b8('0x0'));var util=require(_0x50b8('0x1'));var logger=require(_0x50b8('0x2'))(_0x50b8('0x3'));var moment=require(_0x50b8('0x4'));var BPromise=require(_0x50b8('0x5'));var rp=require('request-promise');var htmlToText=require(_0x50b8('0x6'));var fs=require('fs');var path=require(_0x50b8('0x7'));var rimraf=require(_0x50b8('0x8'));var config=require('../../config/environment');var attributes=require(_0x50b8('0x9'));module['exports']=function(_0x25992e,_0x3fa860){return _0x25992e[_0x50b8('0xa')](_0x50b8('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x50b8('0xc'),'fields':['messageId']},{'name':_0x50b8('0xd'),'fields':[_0x50b8('0xe'),_0x50b8('0xf')],'type':_0x50b8('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x20fb8f,_0x56db27,_0x452d25){if(_0x20fb8f[_0x50b8('0x11')]){_0x20fb8f[_0x50b8('0xe')]=htmlToText['fromString'](_0x20fb8f[_0x50b8('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x452d25(null,_0x56db27);},'afterCreate':function(_0x563982,_0x1d0d39,_0x1d33a7){var _0x540075=_0x25992e['models'];var _0x1a840e=_0x563982[_0x50b8('0x12')]({'plain':!![]});if(_0x1a840e[_0x50b8('0x13')][_0x50b8('0x14')]()==='in'||_0x1a840e[_0x50b8('0x13')][_0x50b8('0x14')]()===_0x50b8('0x15')&&!_0x1a840e[_0x50b8('0x16')]&&!_['isNil'](_0x1a840e['UserId'])){_0x540075[_0x50b8('0x17')][_0x50b8('0x18')]({'where':{'id':_0x1a840e['MailInteractionId']}})[_0x50b8('0x19')](function(_0x5a978a){if(_0x5a978a){_0x5a978a[_0x50b8('0x1a')]({'lastMsgAt':_0x1a840e[_0x50b8('0x1b')],'lastMsgDirection':_0x1a840e[_0x50b8('0x13')][_0x50b8('0x14')]()});}})[_0x50b8('0x1c')](function(_0x14d41f){console[_0x50b8('0x1d')](_0x14d41f);});}_0x1d33a7();}},'charset':_0x50b8('0x1e'),'collate':_0x50b8('0x1f')});}; \ No newline at end of file +var _0xe4a1=['bluebird','rimraf','../../config/environment','./mailMessage.attributes','define','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','fromString','body','models','get','direction','toLowerCase','isNil','MailInteraction','findOne','then','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x11ad65,_0x352d3c){var _0x35590c=function(_0x2c3845){while(--_0x2c3845){_0x11ad65['push'](_0x11ad65['shift']());}};_0x35590c(++_0x352d3c);}(_0xe4a1,0x1c7));var _0x1e4a=function(_0x17479d,_0x593129){_0x17479d=_0x17479d-0x0;var _0x2d461c=_0xe4a1[_0x17479d];return _0x2d461c;};'use strict';var _=require(_0x1e4a('0x0'));var util=require(_0x1e4a('0x1'));var logger=require(_0x1e4a('0x2'))('api');var moment=require(_0x1e4a('0x3'));var BPromise=require(_0x1e4a('0x4'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x1e4a('0x5'));var config=require(_0x1e4a('0x6'));var attributes=require(_0x1e4a('0x7'));module['exports']=function(_0x5cbda6,_0x17fa5d){return _0x5cbda6[_0x1e4a('0x8')]('MailMessage',attributes,{'tableName':_0x1e4a('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x1e4a('0xa')]},{'name':_0x1e4a('0xb'),'fields':[_0x1e4a('0xc'),'subject'],'type':_0x1e4a('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x57904e,_0xef06c6,_0x34f6db){if(_0x57904e['body']){_0x57904e[_0x1e4a('0xc')]=htmlToText[_0x1e4a('0xe')](_0x57904e[_0x1e4a('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x34f6db(null,_0xef06c6);},'afterCreate':function(_0x334b4b,_0x51655b,_0xf8cb26){var _0x4628eb=_0x5cbda6[_0x1e4a('0x10')];var _0x16b02c=_0x334b4b[_0x1e4a('0x11')]({'plain':!![]});if(_0x16b02c[_0x1e4a('0x12')][_0x1e4a('0x13')]()==='in'||_0x16b02c[_0x1e4a('0x12')]['toLowerCase']()==='out'&&!_0x16b02c['secret']&&!_[_0x1e4a('0x14')](_0x16b02c['UserId'])){_0x4628eb[_0x1e4a('0x15')][_0x1e4a('0x16')]({'where':{'id':_0x16b02c['MailInteractionId']}})[_0x1e4a('0x17')](function(_0x59e7fd){if(_0x59e7fd){_0x59e7fd['update']({'lastMsgAt':_0x16b02c[_0x1e4a('0x18')],'lastMsgDirection':_0x16b02c[_0x1e4a('0x12')]['toLowerCase']()});}})['catch'](function(_0x5217b0){console['error'](_0x5217b0);});}_0xf8cb26();}},'charset':_0x1e4a('0x19'),'collate':_0x1e4a('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index b2cf70c..2010dd0 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 _0xab40=['raw','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','then','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateMailMessage','MailMessage','create','options'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xab40,0xcd));var _0x0ab4=function(_0x288ab0,_0x5d8823){_0x288ab0=_0x288ab0-0x0;var _0x4f0a2c=_0xab40[_0x288ab0];return _0x4f0a2c;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});config[_0x0ab4('0x8')]=_[_0x0ab4('0x9')](config[_0x0ab4('0x8')],{'host':_0x0ab4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0x0ab4('0xb')](socket);function respondWithRpcPromise(_0x30e726,_0x40e4d1,_0x464f7e){return new BPromise(function(_0x413d9b,_0x24c6c1){return client[_0x0ab4('0xc')](_0x30e726,_0x464f7e)[_0x0ab4('0xd')](function(_0x4e1708){logger['info'](_0x0ab4('0xe'),_0x40e4d1,'request\x20sent');logger[_0x0ab4('0xf')](_0x0ab4('0x10'),_0x40e4d1,_0x0ab4('0x11'),JSON[_0x0ab4('0x12')](_0x4e1708));if(_0x4e1708[_0x0ab4('0x13')]){if(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x14')]===0x1f4){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x24c6c1(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);}logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x413d9b(_0x4e1708[_0x0ab4('0x13')]['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x40e4d1,_0x0ab4('0x11'));_0x413d9b(_0x4e1708[_0x0ab4('0x16')][_0x0ab4('0x15')]);}})['catch'](function(_0x1e3fe2){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x1e3fe2);_0x24c6c1(_0x1e3fe2);});});}exports[_0x0ab4('0x17')]=function(_0x4e7852){var _0x4ff836=this;return new Promise(function(_0xdb0797,_0x5b1ed5){return db[_0x0ab4('0x18')][_0x0ab4('0x19')](_0x4e7852['body'],{'raw':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![]})[_0x0ab4('0xd')](function(_0x12d06d){logger['info']('CreateMailMessage',_0x4e7852);logger[_0x0ab4('0xf')](_0x0ab4('0x17'),_0x4e7852,JSON[_0x0ab4('0x12')](_0x12d06d));_0xdb0797(_0x12d06d);})[_0x0ab4('0x1c')](function(_0x4e4b80){logger[_0x0ab4('0x13')](_0x0ab4('0x17'),_0x4e4b80[_0x0ab4('0x15')],_0x4e7852);_0x5b1ed5(_0x4ff836['error'](0x1f4,_0x4e4b80['message']));});});}; \ No newline at end of file +var _0x0972=['message','catch','CreateMailMessage','MailMessage','body','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14b62c,_0x23d29f){var _0x36f174=function(_0x32e66d){while(--_0x32e66d){_0x14b62c['push'](_0x14b62c['shift']());}};_0x36f174(++_0x23d29f);}(_0x0972,0x64));var _0x2097=function(_0x33b9c6,_0x2837c8){_0x33b9c6=_0x33b9c6-0x0;var _0x50e998=_0x0972[_0x33b9c6];return _0x50e998;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var moment=require('moment');var BPromise=require(_0x2097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2097('0x2'));var db=require(_0x2097('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2097('0x4'))(_0x2097('0x5'));var config=require(_0x2097('0x6'));var jayson=require(_0x2097('0x7'));var client=jayson[_0x2097('0x8')][_0x2097('0x9')]({'port':0x232a});config[_0x2097('0xa')]=_['defaults'](config[_0x2097('0xa')],{'host':_0x2097('0xb'),'port':0x18eb});var socket=require(_0x2097('0xc'))(new Redis(config[_0x2097('0xa')]));require(_0x2097('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e0024,_0x3b8b76,_0x131f06){return new BPromise(function(_0x430754,_0x7baeb3){return client[_0x2097('0xe')](_0x2e0024,_0x131f06)[_0x2097('0xf')](function(_0x1d1166){logger[_0x2097('0x10')](_0x2097('0x11'),_0x3b8b76,_0x2097('0x12'));logger[_0x2097('0x13')](_0x2097('0x14'),_0x3b8b76,_0x2097('0x12'),JSON[_0x2097('0x15')](_0x1d1166));if(_0x1d1166[_0x2097('0x16')]){if(_0x1d1166[_0x2097('0x16')][_0x2097('0x17')]===0x1f4){logger[_0x2097('0x16')](_0x2097('0x11'),_0x3b8b76,_0x1d1166['error'][_0x2097('0x18')]);return _0x7baeb3(_0x1d1166[_0x2097('0x16')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3b8b76,_0x1d1166[_0x2097('0x16')]['message']);return _0x430754(_0x1d1166[_0x2097('0x16')][_0x2097('0x18')]);}else{logger[_0x2097('0x10')](_0x2097('0x11'),_0x3b8b76,_0x2097('0x12'));_0x430754(_0x1d1166['result'][_0x2097('0x18')]);}})[_0x2097('0x19')](function(_0x451584){logger[_0x2097('0x16')](_0x2097('0x11'),_0x3b8b76,_0x451584);_0x7baeb3(_0x451584);});});}exports[_0x2097('0x1a')]=function(_0x253f5d){var _0x46b5e0=this;return new Promise(function(_0x5d8b9e,_0x4d957e){return db[_0x2097('0x1b')]['create'](_0x253f5d[_0x2097('0x1c')],{'raw':_0x253f5d[_0x2097('0x1d')]?_0x253f5d['options'][_0x2097('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x2e17c8){logger[_0x2097('0x10')](_0x2097('0x1a'),_0x253f5d);logger[_0x2097('0x13')](_0x2097('0x1a'),_0x253f5d,JSON[_0x2097('0x15')](_0x2e17c8));_0x5d8b9e(_0x2e17c8);})['catch'](function(_0xae5f9){logger['error'](_0x2097('0x1a'),_0xae5f9[_0x2097('0x18')],_0x253f5d);_0x4d957e(_0x46b5e0[_0x2097('0x16')](0x1f4,_0xae5f9[_0x2097('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 723c11d..0be791c 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 _0xb6a5=['removeListener','register','length','save','remove','emit'];(function(_0x4bccd7,_0x213c94){var _0x196ceb=function(_0x2accb0){while(--_0x2accb0){_0x4bccd7['push'](_0x4bccd7['shift']());}};_0x196ceb(++_0x213c94);}(_0xb6a5,0x7b));var _0x5b6a=function(_0x55642e,_0x3f7ab6){_0x55642e=_0x55642e-0x0;var _0x3e5fc9=_0xb6a5[_0x55642e];return _0x3e5fc9;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x5b6a('0x0'),_0x5b6a('0x1'),'update'];function createListener(_0x4b9d28,_0x5b681f){return function(_0x40d255){_0x5b681f[_0x5b6a('0x2')](_0x4b9d28,_0x40d255);};}function removeListener(_0x4dcab0,_0x5e2451){return function(){MailMessageEvents[_0x5b6a('0x3')](_0x4dcab0,_0x5e2451);};}exports[_0x5b6a('0x4')]=function(_0x1c8ad1){for(var _0x35633d=0x0,_0x28223e=events[_0x5b6a('0x5')];_0x35633d<_0x28223e;_0x35633d++){var _0xcc3db=events[_0x35633d];var _0x812619=createListener('mailMessage:'+_0xcc3db,_0x1c8ad1);MailMessageEvents['on'](_0xcc3db,_0x812619);}}; \ No newline at end of file +var _0x07fb=['remove','update','removeListener','register','mailMessage:','./mailMessage.events','save'];(function(_0x3b66ab,_0x21df36){var _0x1ab3c8=function(_0x3b0bc2){while(--_0x3b0bc2){_0x3b66ab['push'](_0x3b66ab['shift']());}};_0x1ab3c8(++_0x21df36);}(_0x07fb,0x10f));var _0xb07f=function(_0x4c30a3,_0x2e393e){_0x4c30a3=_0x4c30a3-0x0;var _0x28d428=_0x07fb[_0x4c30a3];return _0x28d428;};'use strict';var MailMessageEvents=require(_0xb07f('0x0'));var events=[_0xb07f('0x1'),_0xb07f('0x2'),_0xb07f('0x3')];function createListener(_0x178fe8,_0x2e07c2){return function(_0x51a115){_0x2e07c2['emit'](_0x178fe8,_0x51a115);};}function removeListener(_0x1b7ba8,_0x4ef90f){return function(){MailMessageEvents[_0xb07f('0x4')](_0x1b7ba8,_0x4ef90f);};}exports[_0xb07f('0x5')]=function(_0x245faf){for(var _0xbd8ec3=0x0,_0x282684=events['length'];_0xbd8ec3<_0x282684;_0xbd8ec3++){var _0xfcec7c=events[_0xbd8ec3];var _0x1d337d=createListener(_0xb07f('0x6')+_0xfcec7c,_0x245faf);MailMessageEvents['on'](_0xfcec7c,_0x1d337d);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index bcf1d1e..47fe985 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 _0xddf5=['getAgents','post','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','describe','get','/:id','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xddf5,0xa6));var _0x5ddf=function(_0x5a36d9,_0x5b6735){_0x5a36d9=_0x5a36d9-0x0;var _0x3ea031=_0xddf5[_0x5a36d9];return _0x3ea031;};'use strict';var multer=require('multer');var util=require(_0x5ddf('0x0'));var path=require('path');var timeout=require(_0x5ddf('0x1'));var express=require(_0x5ddf('0x2'));var router=express[_0x5ddf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5ddf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5ddf('0x5'));var controller=require(_0x5ddf('0x6'));router['get']('/',auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5ddf('0x9')]);router[_0x5ddf('0xa')](_0x5ddf('0xb'),auth[_0x5ddf('0x7')](),controller['show']);router[_0x5ddf('0xa')](_0x5ddf('0xc'),auth[_0x5ddf('0x7')](),controller['getMembers']);router[_0x5ddf('0xa')](_0x5ddf('0xd'),auth[_0x5ddf('0x7')](),controller[_0x5ddf('0xe')]);router[_0x5ddf('0xa')](_0x5ddf('0xf'),auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x10')]);router[_0x5ddf('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5ddf('0x11')](_0x5ddf('0xd'),auth[_0x5ddf('0x7')](),controller['addTeams']);router['post'](_0x5ddf('0xf'),auth['isAuthenticated'](),controller[_0x5ddf('0x12')]);router[_0x5ddf('0x13')](_0x5ddf('0xb'),auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x14')]);router[_0x5ddf('0x15')]('/:id',auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x16')]);router[_0x5ddf('0x15')](_0x5ddf('0xd'),auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x17')]);router['delete'](_0x5ddf('0xf'),auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x18')]);module[_0x5ddf('0x19')]=router; \ No newline at end of file +var _0xc308=['/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','index','/describe','get','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x408e97,_0x4b23e2){var _0x227b62=function(_0x5477a4){while(--_0x5477a4){_0x408e97['push'](_0x408e97['shift']());}};_0x227b62(++_0x4b23e2);}(_0xc308,0x1bd));var _0x8c30=function(_0x582e18,_0x4fd856){_0x582e18=_0x582e18-0x0;var _0x445d03=_0xc308[_0x582e18];return _0x445d03;};'use strict';var multer=require(_0x8c30('0x0'));var util=require(_0x8c30('0x1'));var path=require(_0x8c30('0x2'));var timeout=require(_0x8c30('0x3'));var express=require(_0x8c30('0x4'));var router=express[_0x8c30('0x5')]();var fs_extra=require(_0x8c30('0x6'));var auth=require(_0x8c30('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8c30('0x8'));var controller=require(_0x8c30('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8c30('0xa')]);router['get'](_0x8c30('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8c30('0xc')](_0x8c30('0xd'),auth[_0x8c30('0xe')](),controller[_0x8c30('0xf')]);router[_0x8c30('0xc')](_0x8c30('0x10'),auth[_0x8c30('0xe')](),controller[_0x8c30('0x11')]);router[_0x8c30('0xc')](_0x8c30('0x12'),auth[_0x8c30('0xe')](),controller[_0x8c30('0x13')]);router[_0x8c30('0xc')](_0x8c30('0x14'),auth[_0x8c30('0xe')](),controller[_0x8c30('0x15')]);router[_0x8c30('0x16')]('/',auth[_0x8c30('0xe')](),controller[_0x8c30('0x17')]);router[_0x8c30('0x16')]('/:id/teams',auth[_0x8c30('0xe')](),controller[_0x8c30('0x18')]);router[_0x8c30('0x16')](_0x8c30('0x14'),auth[_0x8c30('0xe')](),controller[_0x8c30('0x19')]);router[_0x8c30('0x1a')](_0x8c30('0xd'),auth[_0x8c30('0xe')](),controller['update']);router[_0x8c30('0x1b')](_0x8c30('0xd'),auth[_0x8c30('0xe')](),controller['destroy']);router[_0x8c30('0x1b')](_0x8c30('0x12'),auth[_0x8c30('0xe')](),controller[_0x8c30('0x1c')]);router[_0x8c30('0x1b')](_0x8c30('0x14'),auth['isAuthenticated'](),controller[_0x8c30('0x1d')]);module[_0x8c30('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index f637056..6fe716f 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 _0xb510=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x29766f,_0x3d6aa8){var _0x3a23a0=function(_0x8a0df2){while(--_0x8a0df2){_0x29766f['push'](_0x29766f['shift']());}};_0x3a23a0(++_0x3d6aa8);}(_0xb510,0x16c));var _0x0b51=function(_0x4ae13b,_0x45e85e){_0x4ae13b=_0x4ae13b-0x0;var _0x427906=_0xb510[_0x4ae13b];return _0x427906;};'use strict';var Sequelize=require(_0x0b51('0x0'));module[_0x0b51('0x1')]={'name':{'type':Sequelize[_0x0b51('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0b51('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b51('0x4')](_0x0b51('0x5'),_0x0b51('0x6'),_0x0b51('0x7'))}}; \ No newline at end of file +var _0x9360=['roundrobin','sequelize','exports','rrmemory','beepall'];(function(_0x59efe6,_0x3e0ca2){var _0x9660fa=function(_0x496fd0){while(--_0x496fd0){_0x59efe6['push'](_0x59efe6['shift']());}};_0x9660fa(++_0x3e0ca2);}(_0x9360,0x16e));var _0x0936=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9360[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x0936('0x0'));module[_0x0936('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0936('0x2'),_0x0936('0x3'),_0x0936('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index a7ae979..4fba2e6 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 _0x6690=['../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','end','error','name','send','index','map','MailQueue','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','describe','getMembers','findOne','UserMailQueue','order','pick','MailQueueId','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x6690,0x7a));var _0x0669=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6690[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0669('0x0'));var zipdir=require(_0x0669('0x1'));var jsonpatch=require(_0x0669('0x2'));var rp=require(_0x0669('0x3'));var moment=require('moment');var BPromise=require(_0x0669('0x4'));var Mustache=require(_0x0669('0x5'));var util=require(_0x0669('0x6'));var path=require(_0x0669('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0669('0x8'));var _=require(_0x0669('0x9'));var squel=require(_0x0669('0xa'));var crypto=require('crypto');var jsforce=require(_0x0669('0xb'));var deskjs=require(_0x0669('0xc'));var toCsv=require(_0x0669('0xd'));var querystring=require('querystring');var Papa=require(_0x0669('0xe'));var Redis=require('ioredis');var authService=require(_0x0669('0xf'));var qs=require(_0x0669('0x10'));var as=require(_0x0669('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0669('0x12'))('api');var utils=require(_0x0669('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0669('0x14'))['db'];config[_0x0669('0x15')]=_['defaults'](config[_0x0669('0x15')],{'host':_0x0669('0x16'),'port':0x18eb});var socket=require(_0x0669('0x17'))(new Redis(config[_0x0669('0x15')]));require(_0x0669('0x18'))[_0x0669('0x19')](socket);function respondWithStatusCode(_0x382ad1,_0x24ee8b){_0x24ee8b=_0x24ee8b||0xcc;return function(_0x124daf){if(_0x124daf){return _0x382ad1['sendStatus'](_0x24ee8b);}return _0x382ad1[_0x0669('0x1a')](_0x24ee8b)['end']();};}function respondWithResult(_0x3f1a35,_0x27d3aa){_0x27d3aa=_0x27d3aa||0xc8;return function(_0x5ddef6){if(_0x5ddef6){return _0x3f1a35[_0x0669('0x1a')](_0x27d3aa)[_0x0669('0x1b')](_0x5ddef6);}};}function respondWithFilteredResult(_0x437849,_0x848712){return function(_0x599c45){if(_0x599c45){var _0x21fd18=typeof _0x848712['offset']===_0x0669('0x1c')&&typeof _0x848712[_0x0669('0x1d')]===_0x0669('0x1c');var _0x9e6d41=_0x599c45[_0x0669('0x1e')];var _0x489ad3=_0x21fd18?0x0:_0x848712['offset'];var _0x23abc1=_0x21fd18?_0x599c45['count']:_0x848712[_0x0669('0x1f')]+_0x848712[_0x0669('0x1d')];var _0xdf95f2;if(_0x23abc1>=_0x9e6d41){_0x23abc1=_0x9e6d41;_0xdf95f2=0xc8;}else{_0xdf95f2=0xce;}_0x437849[_0x0669('0x1a')](_0xdf95f2);return _0x437849[_0x0669('0x20')]('Content-Range',_0x489ad3+'-'+_0x23abc1+'/'+_0x9e6d41)['json'](_0x599c45);}return null;};}function patchUpdates(_0x31d1df){return function(_0x312e4a){try{jsonpatch[_0x0669('0x21')](_0x312e4a,_0x31d1df,!![]);}catch(_0x30cb44){return BPromise[_0x0669('0x22')](_0x30cb44);}return _0x312e4a[_0x0669('0x23')]();};}function saveUpdates(_0x557d33,_0x276b45){return function(_0x2dfeb8){if(_0x2dfeb8){return _0x2dfeb8['update'](_0x557d33)[_0x0669('0x24')](function(_0x184cbf){return _0x184cbf;});}return null;};}function removeEntity(_0xe21283,_0x4a9416){return function(_0x4fc05a){if(_0x4fc05a){return _0x4fc05a[_0x0669('0x25')]()[_0x0669('0x24')](function(){var _0x2757f7=_0x4fc05a[_0x0669('0x26')]({'plain':!![]});var _0x52aa83=_0x0669('0x27');return db[_0x0669('0x28')][_0x0669('0x25')]({'where':{'type':_0x52aa83,'resourceId':_0x2757f7['id']}})[_0x0669('0x24')](function(){return _0x4fc05a;});})[_0x0669('0x24')](function(){_0xe21283['status'](0xcc)[_0x0669('0x29')]();});}};}function handleEntityNotFound(_0x3a2c24,_0x250997){return function(_0x149636){if(!_0x149636){_0x3a2c24['sendStatus'](0x194);}return _0x149636;};}function handleError(_0x3c3a80,_0x3bfbea){_0x3bfbea=_0x3bfbea||0x1f4;return function(_0x1f82b2){logger[_0x0669('0x2a')](_0x1f82b2['stack']);if(_0x1f82b2[_0x0669('0x2b')]){delete _0x1f82b2['name'];}_0x3c3a80[_0x0669('0x1a')](_0x3bfbea)[_0x0669('0x2c')](_0x1f82b2);};}exports[_0x0669('0x2d')]=function(_0x4c50af,_0x24787b){var _0x39f7af={},_0x53b5d1={},_0x28ef2e={'count':0x0,'rows':[]};var _0x3dea96=_[_0x0669('0x2e')](db[_0x0669('0x2f')][_0x0669('0x30')],function(_0xc9a34){return{'name':_0xc9a34['fieldName'],'type':_0xc9a34['type'][_0x0669('0x31')]};});_0x53b5d1[_0x0669('0x32')]=_[_0x0669('0x2e')](_0x3dea96,_0x0669('0x2b'));_0x53b5d1[_0x0669('0x33')]=_[_0x0669('0x34')](_0x4c50af['query']);_0x53b5d1[_0x0669('0x35')]=_['intersection'](_0x53b5d1['model'],_0x53b5d1[_0x0669('0x33')]);_0x39f7af['attributes']=_[_0x0669('0x36')](_0x53b5d1['model'],qs[_0x0669('0x37')](_0x4c50af[_0x0669('0x33')][_0x0669('0x37')]));_0x39f7af[_0x0669('0x38')]=_0x39f7af[_0x0669('0x38')][_0x0669('0x39')]?_0x39f7af[_0x0669('0x38')]:_0x53b5d1[_0x0669('0x32')];if(!_0x4c50af['query'][_0x0669('0x3a')](_0x0669('0x3b'))){_0x39f7af[_0x0669('0x1d')]=qs[_0x0669('0x1d')](_0x4c50af[_0x0669('0x33')][_0x0669('0x1d')]);_0x39f7af[_0x0669('0x1f')]=qs[_0x0669('0x1f')](_0x4c50af[_0x0669('0x33')]['offset']);}_0x39f7af['order']=qs[_0x0669('0x3c')](_0x4c50af[_0x0669('0x33')][_0x0669('0x3c')]);_0x39f7af['where']=qs['filters'](_['pick'](_0x4c50af[_0x0669('0x33')],_0x53b5d1[_0x0669('0x35')]),_0x3dea96);if(_0x4c50af[_0x0669('0x33')][_0x0669('0x3d')]){_0x39f7af[_0x0669('0x3e')]=_[_0x0669('0x3f')](_0x39f7af[_0x0669('0x3e')],{'$or':_[_0x0669('0x2e')](_0x3dea96,function(_0x4215a0){if(_0x4215a0[_0x0669('0x40')]!==_0x0669('0x41')){var _0x3fcd4f={};_0x3fcd4f[_0x4215a0[_0x0669('0x2b')]]={'$like':'%'+_0x4c50af[_0x0669('0x33')]['filter']+'%'};return _0x3fcd4f;}})});}_0x39f7af=_[_0x0669('0x3f')]({},_0x39f7af,_0x4c50af['options']);var _0x3e87b1={'where':_0x39f7af[_0x0669('0x3e')]};return db[_0x0669('0x2f')][_0x0669('0x1e')](_0x3e87b1)[_0x0669('0x24')](function(_0x3a7690){_0x28ef2e['count']=_0x3a7690;if(_0x4c50af['query']['includeAll']){_0x39f7af[_0x0669('0x42')]=[{'all':!![]}];}return db[_0x0669('0x2f')][_0x0669('0x43')](_0x39f7af);})[_0x0669('0x24')](function(_0x31ca7e){_0x28ef2e[_0x0669('0x44')]=_0x31ca7e;return _0x28ef2e;})[_0x0669('0x24')](respondWithFilteredResult(_0x24787b,_0x39f7af))[_0x0669('0x45')](handleError(_0x24787b,null));};exports[_0x0669('0x46')]=function(_0xd89bd5,_0x5d3d38){var _0x49e854={'raw':!![],'where':{'id':_0xd89bd5[_0x0669('0x47')]['id']}},_0x80caef={};_0x80caef['model']=_[_0x0669('0x34')](db[_0x0669('0x2f')][_0x0669('0x30')]);_0x80caef[_0x0669('0x33')]=_[_0x0669('0x34')](_0xd89bd5[_0x0669('0x33')]);_0x80caef[_0x0669('0x35')]=_[_0x0669('0x36')](_0x80caef[_0x0669('0x32')],_0x80caef['query']);_0x49e854[_0x0669('0x38')]=_[_0x0669('0x36')](_0x80caef[_0x0669('0x32')],qs[_0x0669('0x37')](_0xd89bd5[_0x0669('0x33')][_0x0669('0x37')]));_0x49e854[_0x0669('0x38')]=_0x49e854[_0x0669('0x38')][_0x0669('0x39')]?_0x49e854[_0x0669('0x38')]:_0x80caef[_0x0669('0x32')];if(_0xd89bd5[_0x0669('0x33')][_0x0669('0x48')]){_0x49e854[_0x0669('0x42')]=[{'all':!![]}];}_0x49e854=_[_0x0669('0x3f')]({},_0x49e854,_0xd89bd5[_0x0669('0x49')]);return db['MailQueue'][_0x0669('0x4a')](_0x49e854)[_0x0669('0x24')](handleEntityNotFound(_0x5d3d38,null))[_0x0669('0x24')](respondWithResult(_0x5d3d38,null))[_0x0669('0x45')](handleError(_0x5d3d38,null));};exports[_0x0669('0x4b')]=function(_0x4963dd,_0x4a36ea){return db[_0x0669('0x2f')]['create'](_0x4963dd['body'],{})['then'](function(_0x30124c){var _0x3a8279=_0x4963dd[_0x0669('0x4c')][_0x0669('0x26')]({'plain':!![]});if(!_0x3a8279)throw new Error(_0x0669('0x4d'));if(_0x3a8279[_0x0669('0x4e')]===_0x0669('0x4c')){var _0x40a33f=_0x30124c[_0x0669('0x26')]({'plain':!![]});var _0x25d254=_0x0669('0x27');return db[_0x0669('0x4f')][_0x0669('0x4a')]({'where':{'name':_0x25d254,'userProfileId':_0x3a8279[_0x0669('0x50')]},'raw':!![]})[_0x0669('0x24')](function(_0x2f0eeb){if(_0x2f0eeb&&_0x2f0eeb[_0x0669('0x51')]===0x0){return db[_0x0669('0x28')][_0x0669('0x4b')]({'name':_0x40a33f['name'],'resourceId':_0x40a33f['id'],'type':_0x2f0eeb['name'],'sectionId':_0x2f0eeb['id']},{})[_0x0669('0x24')](function(){return _0x30124c;});}else{return _0x30124c;}})['catch'](function(_0x2e05dc){logger[_0x0669('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e05dc);throw _0x2e05dc;});}return _0x30124c;})[_0x0669('0x24')](respondWithResult(_0x4a36ea,0xc9))['catch'](handleError(_0x4a36ea,null));};exports[_0x0669('0x52')]=function(_0x3f3125,_0x3e3bdb){if(_0x3f3125[_0x0669('0x53')]['id']){delete _0x3f3125['body']['id'];}return db[_0x0669('0x2f')][_0x0669('0x4a')]({'where':{'id':_0x3f3125[_0x0669('0x47')]['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x3e3bdb,null))[_0x0669('0x24')](saveUpdates(_0x3f3125[_0x0669('0x53')],null))[_0x0669('0x24')](respondWithResult(_0x3e3bdb,null))[_0x0669('0x45')](handleError(_0x3e3bdb,null));};exports[_0x0669('0x25')]=function(_0x228661,_0x45a73a){return db[_0x0669('0x2f')][_0x0669('0x4a')]({'where':{'id':_0x228661[_0x0669('0x47')]['id']}})['then'](handleEntityNotFound(_0x45a73a,null))[_0x0669('0x24')](removeEntity(_0x45a73a,null))[_0x0669('0x45')](handleError(_0x45a73a,null));};exports[_0x0669('0x54')]=function(_0x353c77,_0x1b3b9f){return db[_0x0669('0x2f')][_0x0669('0x54')]()[_0x0669('0x24')](respondWithResult(_0x1b3b9f,null))[_0x0669('0x45')](handleError(_0x1b3b9f,null));};exports[_0x0669('0x55')]=function(_0x4d2db8,_0x4648e3,_0x1850ae){var _0x36a9f1={'raw':!![],'where':{}},_0x5c729e={},_0x10bdd8;return db[_0x0669('0x2f')][_0x0669('0x56')]({'where':{'id':_0x4d2db8['params']['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x4648e3,null))['then'](function(_0x32ad3c){if(_0x32ad3c){_0x10bdd8=_0x32ad3c['get']({'plain':!![]});_0x5c729e[_0x0669('0x32')]=_[_0x0669('0x34')](db[_0x0669('0x57')][_0x0669('0x30')]);_0x5c729e[_0x0669('0x33')]=_[_0x0669('0x34')](_0x4d2db8[_0x0669('0x33')]);_0x5c729e['filters']=_[_0x0669('0x36')](_0x5c729e[_0x0669('0x32')],_0x5c729e[_0x0669('0x33')]);_0x36a9f1[_0x0669('0x38')]=_[_0x0669('0x36')](_0x5c729e[_0x0669('0x32')],qs[_0x0669('0x37')](_0x4d2db8[_0x0669('0x33')][_0x0669('0x37')]));_0x36a9f1[_0x0669('0x38')]=_0x36a9f1['attributes'][_0x0669('0x39')]?_0x36a9f1['attributes']:_0x5c729e['model'];if(!_0x4d2db8[_0x0669('0x33')][_0x0669('0x3a')](_0x0669('0x3b'))){_0x36a9f1[_0x0669('0x1d')]=qs[_0x0669('0x1d')](_0x4d2db8[_0x0669('0x33')][_0x0669('0x1d')]);_0x36a9f1[_0x0669('0x1f')]=qs[_0x0669('0x1f')](_0x4d2db8['query'][_0x0669('0x1f')]);}_0x36a9f1[_0x0669('0x58')]=qs['sort'](_0x4d2db8['query']['sort']);_0x36a9f1[_0x0669('0x3e')]=qs[_0x0669('0x35')](_[_0x0669('0x59')](_0x4d2db8['query'],_0x5c729e[_0x0669('0x35')]));_0x36a9f1[_0x0669('0x3e')][_0x0669('0x5a')]=_0x32ad3c['id'];if(_0x4d2db8[_0x0669('0x33')]['filter']){_0x36a9f1[_0x0669('0x3e')]=_[_0x0669('0x3f')](_0x36a9f1[_0x0669('0x3e')],{'$or':_['map'](_0x36a9f1['attributes'],function(_0x218b4c){var _0x11a4c3={};_0x11a4c3[_0x218b4c]={'$like':'%'+_0x4d2db8[_0x0669('0x33')][_0x0669('0x3d')]+'%'};return _0x11a4c3;})});}_0x36a9f1=_[_0x0669('0x3f')]({},_0x36a9f1,_0x4d2db8[_0x0669('0x49')]);return db[_0x0669('0x57')][_0x0669('0x43')](_0x36a9f1);}})[_0x0669('0x24')](function(_0x19a807){if(_0x19a807){return db[_0x0669('0x5b')][_0x0669('0x5c')]({'where':{'id':_[_0x0669('0x2e')](_0x19a807,'UserId'),'role':_0x0669('0x5d')},'attributes':['id',_0x0669('0x2b'),_0x0669('0x5e'),_0x0669('0x5f'),_0x0669('0x60')]});}})[_0x0669('0x24')](function(_0x1dbdaa){if(_0x1dbdaa){return{'count':_0x1dbdaa[_0x0669('0x1e')],'rows':_[_0x0669('0x2e')](_0x1dbdaa[_0x0669('0x44')],function(_0x319d13){return{'membername':_0x319d13['name'],'UserId':_0x319d13['id'],'queue_name':_0x10bdd8[_0x0669('0x2b')],'MailQueueId':_0x10bdd8['id'],'interface':util[_0x0669('0x61')](_0x0669('0x62'),_0x0669('0x63'),_0x319d13[_0x0669('0x2b')]),'penalty':0x0,'paused':_0x319d13[_0x0669('0x5e')],'createdAt':_0x319d13['createdAt'],'updatedAt':_0x319d13[_0x0669('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0669('0x24')](respondWithFilteredResult(_0x4648e3,_0x36a9f1))['catch'](handleError(_0x4648e3,null));};exports[_0x0669('0x64')]=function(_0xb5580,_0x53f64b,_0x26da00){var _0xd4e881={};var _0x52a6b8={};var _0x597976;var _0x2c995d;return db[_0x0669('0x2f')][_0x0669('0x56')]({'where':{'id':_0xb5580['params']['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x53f64b,null))['then'](function(_0x534c00){if(_0x534c00){_0x597976=_0x534c00;_0x52a6b8[_0x0669('0x32')]=_[_0x0669('0x34')](db['Team'][_0x0669('0x30')]);_0x52a6b8[_0x0669('0x33')]=_[_0x0669('0x34')](_0xb5580[_0x0669('0x33')]);_0x52a6b8[_0x0669('0x35')]=_[_0x0669('0x36')](_0x52a6b8[_0x0669('0x32')],_0x52a6b8[_0x0669('0x33')]);_0xd4e881[_0x0669('0x38')]=_[_0x0669('0x36')](_0x52a6b8[_0x0669('0x32')],qs['fields'](_0xb5580[_0x0669('0x33')][_0x0669('0x37')]));_0xd4e881['attributes']=_0xd4e881[_0x0669('0x38')][_0x0669('0x39')]?_0xd4e881[_0x0669('0x38')]:_0x52a6b8[_0x0669('0x32')];_0xd4e881[_0x0669('0x58')]=qs['sort'](_0xb5580[_0x0669('0x33')]['sort']);_0xd4e881[_0x0669('0x3e')]=qs['filters'](_[_0x0669('0x59')](_0xb5580[_0x0669('0x33')],_0x52a6b8['filters']));if(_0xb5580[_0x0669('0x33')][_0x0669('0x3d')]){_0xd4e881[_0x0669('0x3e')]=_[_0x0669('0x3f')](_0xd4e881[_0x0669('0x3e')],{'$or':_[_0x0669('0x2e')](_0xd4e881[_0x0669('0x38')],function(_0x1fe83a){var _0x30ed62={};_0x30ed62[_0x1fe83a]={'$like':'%'+_0xb5580[_0x0669('0x33')][_0x0669('0x3d')]+'%'};return _0x30ed62;})});}_0xd4e881=_['merge']({},_0xd4e881,_0xb5580[_0x0669('0x49')]);return _0x597976[_0x0669('0x64')](_0xd4e881);}})[_0x0669('0x24')](function(_0x54e4cb){if(_0x54e4cb){_0x2c995d=_0x54e4cb[_0x0669('0x39')];if(!_0xb5580[_0x0669('0x33')][_0x0669('0x3a')]('nolimit')){_0xd4e881['limit']=qs[_0x0669('0x1d')](_0xb5580[_0x0669('0x33')][_0x0669('0x1d')]);_0xd4e881[_0x0669('0x1f')]=qs[_0x0669('0x1f')](_0xb5580[_0x0669('0x33')]['offset']);}return _0x597976[_0x0669('0x64')](_0xd4e881);}})[_0x0669('0x24')](function(_0x354eb7){if(_0x354eb7){return _0x354eb7?{'count':_0x2c995d,'rows':_0x354eb7}:null;}})['then'](respondWithResult(_0x53f64b,null))[_0x0669('0x45')](handleError(_0x53f64b,null));};exports['addTeams']=function(_0x15a6eb,_0x566e96,_0x1952b0){var _0x3243ff=_0x15a6eb[_0x0669('0x53')][_0x0669('0x65')];return db[_0x0669('0x66')][_0x0669('0x43')]({'where':{'id':_0x3243ff},'attributes':['id'],'include':[{'model':db[_0x0669('0x5b')],'as':_0x0669('0x67'),'attributes':['id','name',_0x0669('0x68'),_0x0669('0x69'),_0x0669('0x6a')],'raw':!![]}]})[_0x0669('0x24')](function(_0x1311dc){if(_0x1311dc){var _0x55b1bb=_[_0x0669('0x6b')](_0x1311dc,function(_0x57f077){var _0xf78b5=_0x57f077['get']({'plain':!![]});return _0xf78b5[_0x0669('0x67')];});return db[_0x0669('0x2f')]['find']({'where':{'id':_0x15a6eb[_0x0669('0x47')]['id']}})[_0x0669('0x24')](function(_0x44093e){return db[_0x0669('0x6c')][_0x0669('0x6d')](function(_0x5511f0){return _0x44093e[_0x0669('0x6e')](_0x3243ff,{'transaction':_0x5511f0})['then'](function(){return BPromise['each'](_0x55b1bb,function(_0x2eac2c){return db[_0x0669('0x57')][_0x0669('0x6f')]({'where':{'UserId':_0x2eac2c['id'],'MailQueueId':_0x15a6eb[_0x0669('0x47')]['id']},'transaction':_0x5511f0});});})[_0x0669('0x24')](function(){_0x55b1bb['forEach'](function(_0x47b16e){socket[_0x0669('0x70')](_0x0669('0x71'),{'UserId':_0x47b16e['id'],'MailQueueId':_0x44093e['id']});});});});});}})[_0x0669('0x24')](respondWithStatusCode(_0x566e96,null))['catch'](handleError(_0x566e96,null));};exports[_0x0669('0x72')]=function(_0x47bdba,_0x59878b,_0x25e970){return db[_0x0669('0x66')]['findAll']({'where':{'id':_0x47bdba[_0x0669('0x33')][_0x0669('0x65')]},'attributes':['id'],'include':[{'model':db[_0x0669('0x5b')],'as':_0x0669('0x67'),'attributes':['id'],'raw':!![]}]})[_0x0669('0x24')](handleEntityNotFound(_0x59878b,null))[_0x0669('0x24')](function(_0xcdd208){var _0x7a5a19=_[_0x0669('0x2e')](_0xcdd208,'id');var _0x663b6e=[];var _0x2d4330=[];var _0x59132b=squel[_0x0669('0x73')]();_0x59132b[_0x0669('0x74')](_0x0669('0x75'))[_0x0669('0x76')]('team_has_mail_queues','tq')['join'](_0x0669('0x77'),'ut',_0x0669('0x78'))[_0x0669('0x3e')](_0x0669('0x79'),_0x47bdba['params']['id']);for(var _0x4d6397=0x0;_0x4d6397<_0xcdd208['length'];_0x4d6397+=0x1){let _0x21a377=_0xcdd208[_0x4d6397];for(var _0x488fa8=0x0;_0x488fa8<_0x21a377[_0x0669('0x67')][_0x0669('0x39')];_0x488fa8+=0x1){let _0x36f1e5=_0x21a377[_0x0669('0x67')][_0x488fa8];var _0x6eb66b=_0x59132b[_0x0669('0x7a')]();_0x6eb66b[_0x0669('0x3e')]('ut.UserId\x20=\x20?',_0x36f1e5['id']);_0x2d4330[_0x0669('0x7b')](db[_0x0669('0x6c')][_0x0669('0x33')](_0x6eb66b['toString'](),{'type':db['sequelize'][_0x0669('0x7c')][_0x0669('0x7d')]})[_0x0669('0x24')](function(_0x6a31ff){if(_0x6a31ff['length']===0x1){return _0x36f1e5['id'];}else{var _0x5ec32c=_[_0x0669('0x7e')](_[_0x0669('0x2e')](_0x6a31ff,_0x0669('0x7f')),function(_0x138ca4){return _[_0x0669('0x80')](_0x7a5a19,_0x138ca4);});if(_0x5ec32c){return _0x36f1e5['id'];}}}));}}return BPromise[_0x0669('0x81')](_0x2d4330)[_0x0669('0x24')](function(_0x31e9ed){_0x663b6e=_(_0x663b6e)[_0x0669('0x82')](_0x31e9ed)[_0x0669('0x83')]()[_0x0669('0x84')]();return db['MailQueue'][_0x0669('0x4a')]({'where':{'id':_0x47bdba[_0x0669('0x47')]['id']}})[_0x0669('0x24')](function(_0x1ce38b){return db[_0x0669('0x6c')][_0x0669('0x6d')](function(_0x4090df){return _0x1ce38b[_0x0669('0x72')](_0x47bdba[_0x0669('0x33')]['ids'],{'transaction':_0x4090df})[_0x0669('0x24')](function(){if(!_[_0x0669('0x85')](_0x663b6e)){return _0x1ce38b[_0x0669('0x86')](_0x663b6e,{'transaction':_0x4090df});}})['then'](function(){_0x663b6e[_0x0669('0x87')](function(_0x2e852b){socket[_0x0669('0x70')](_0x0669('0x88'),{'UserId':_0x2e852b,'MailQueueId':_0x1ce38b['id']});});});});});});})['then'](respondWithStatusCode(_0x59878b,null))[_0x0669('0x45')](handleError(_0x59878b,null));};exports[_0x0669('0x89')]=function(_0x10fc0f,_0x293a86,_0x3eb990){return db[_0x0669('0x2f')][_0x0669('0x4a')]({'where':{'id':_0x10fc0f[_0x0669('0x47')]['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x293a86,null))[_0x0669('0x24')](function(_0x88cef1){if(_0x88cef1){return _0x88cef1[_0x0669('0x89')](_0x10fc0f['body'][_0x0669('0x65')],_[_0x0669('0x8a')](_0x10fc0f['body'],[_0x0669('0x65'),'id'])||{})['spread'](function(_0x5d6104){for(var _0x4a05b9=0x0;_0x4a05b9<_0x10fc0f[_0x0669('0x53')]['ids'][_0x0669('0x39')];_0x4a05b9+=0x1){socket['emit'](_0x0669('0x71'),{'UserId':Number(_0x10fc0f[_0x0669('0x53')][_0x0669('0x65')][_0x4a05b9]),'MailQueueId':Number(_0x10fc0f['params']['id'])});}return _0x5d6104;});}})[_0x0669('0x24')](respondWithResult(_0x293a86,null))[_0x0669('0x45')](handleError(_0x293a86,null));};exports[_0x0669('0x86')]=function(_0xf5a792,_0x33f271,_0x964b05){return db[_0x0669('0x2f')]['find']({'where':{'id':_0xf5a792[_0x0669('0x47')]['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x33f271,null))[_0x0669('0x24')](function(_0x59e4b9){if(_0x59e4b9){return _0x59e4b9[_0x0669('0x86')](_0xf5a792[_0x0669('0x33')]['ids'])['then'](function(){if(_[_0x0669('0x8b')](_0xf5a792[_0x0669('0x33')][_0x0669('0x65')])){for(var _0x429c70=0x0;_0x429c70<_0xf5a792['query'][_0x0669('0x65')][_0x0669('0x39')];_0x429c70+=0x1){socket[_0x0669('0x70')](_0x0669('0x88'),{'UserId':Number(_0xf5a792[_0x0669('0x33')]['ids'][_0x429c70]),'MailQueueId':Number(_0xf5a792[_0x0669('0x47')]['id'])});}}else{socket['emit'](_0x0669('0x88'),{'UserId':Number(_0xf5a792[_0x0669('0x33')][_0x0669('0x65')]),'MailQueueId':Number(_0xf5a792[_0x0669('0x47')]['id'])});}});}})[_0x0669('0x24')](respondWithStatusCode(_0x33f271,null))[_0x0669('0x45')](handleError(_0x33f271,null));};exports[_0x0669('0x8c')]=function(_0x1986b8,_0x135f38,_0x35d4fe){var _0x3ec358={};var _0x49af65={};var _0x5ab0f0;var _0x5707b8;return db[_0x0669('0x2f')][_0x0669('0x56')]({'where':{'id':_0x1986b8[_0x0669('0x47')]['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x135f38,null))[_0x0669('0x24')](function(_0x4a2ee0){if(_0x4a2ee0){_0x5ab0f0=_0x4a2ee0;_0x49af65[_0x0669('0x32')]=_['keys'](db[_0x0669('0x5b')][_0x0669('0x30')]);_0x49af65['query']=_[_0x0669('0x34')](_0x1986b8[_0x0669('0x33')]);_0x49af65[_0x0669('0x35')]=_[_0x0669('0x36')](_0x49af65[_0x0669('0x32')],_0x49af65[_0x0669('0x33')]);_0x3ec358[_0x0669('0x38')]=_[_0x0669('0x36')](_0x49af65[_0x0669('0x32')],qs['fields'](_0x1986b8[_0x0669('0x33')][_0x0669('0x37')]));_0x3ec358[_0x0669('0x38')]=_0x3ec358[_0x0669('0x38')][_0x0669('0x39')]?_0x3ec358['attributes']:_0x49af65[_0x0669('0x32')];_0x3ec358['order']=qs[_0x0669('0x3c')](_0x1986b8[_0x0669('0x33')]['sort']);_0x3ec358[_0x0669('0x3e')]=qs[_0x0669('0x35')](_['pick'](_0x1986b8[_0x0669('0x33')],_0x49af65[_0x0669('0x35')]));if(_0x1986b8['query']['filter']){_0x3ec358['where']=_[_0x0669('0x3f')](_0x3ec358[_0x0669('0x3e')],{'$or':_['map'](_0x3ec358['attributes'],function(_0x449854){var _0x90473a={};_0x90473a[_0x449854]={'$like':'%'+_0x1986b8[_0x0669('0x33')][_0x0669('0x3d')]+'%'};return _0x90473a;})});}_0x3ec358=_[_0x0669('0x3f')]({},_0x3ec358,_0x1986b8[_0x0669('0x49')]);return _0x5ab0f0[_0x0669('0x8c')](_0x3ec358);}})[_0x0669('0x24')](function(_0x24ad9f){if(_0x24ad9f){_0x5707b8=_0x24ad9f['length'];if(!_0x1986b8[_0x0669('0x33')]['hasOwnProperty'](_0x0669('0x3b'))){_0x3ec358[_0x0669('0x1d')]=qs[_0x0669('0x1d')](_0x1986b8['query']['limit']);_0x3ec358[_0x0669('0x1f')]=qs[_0x0669('0x1f')](_0x1986b8[_0x0669('0x33')][_0x0669('0x1f')]);}return _0x5ab0f0[_0x0669('0x8c')](_0x3ec358);}})['then'](function(_0x1ae9a6){if(_0x1ae9a6){return _0x1ae9a6?{'count':_0x5707b8,'rows':_0x1ae9a6}:null;}})[_0x0669('0x24')](respondWithResult(_0x135f38,null))[_0x0669('0x45')](handleError(_0x135f38,null));}; \ No newline at end of file +var _0x142b=['mailPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','User','online','voicePause','Agents','sequelize','transaction','each','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','error','stack','name','send','MailQueue','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','hasOwnProperty','order','agent'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x142b,0x1bb));var _0xb142=function(_0xc8a1c5,_0x2c0c9a){_0xc8a1c5=_0xc8a1c5-0x0;var _0x14b5ae=_0x142b[_0xc8a1c5];return _0x14b5ae;};'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(_0xb142('0x0'));var moment=require(_0xb142('0x1'));var BPromise=require(_0xb142('0x2'));var Mustache=require(_0xb142('0x3'));var util=require(_0xb142('0x4'));var path=require('path');var sox=require(_0xb142('0x5'));var csv=require(_0xb142('0x6'));var ejs=require(_0xb142('0x7'));var fs=require('fs');var fs_extra=require(_0xb142('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb142('0x9'));var jsforce=require(_0xb142('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb142('0x6'));var querystring=require(_0xb142('0xb'));var Papa=require(_0xb142('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb142('0xd'));var hardwareService=require(_0xb142('0xe'));var logger=require(_0xb142('0xf'))('api');var utils=require(_0xb142('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb142('0x11')]=_[_0xb142('0x12')](config['redis'],{'host':_0xb142('0x13'),'port':0x18eb});var socket=require(_0xb142('0x14'))(new Redis(config[_0xb142('0x11')]));require('./mailQueue.socket')[_0xb142('0x15')](socket);function respondWithStatusCode(_0x2e5219,_0x12211d){_0x12211d=_0x12211d||0xcc;return function(_0x53673a){if(_0x53673a){return _0x2e5219[_0xb142('0x16')](_0x12211d);}return _0x2e5219['status'](_0x12211d)[_0xb142('0x17')]();};}function respondWithResult(_0x4c8539,_0x49984a){_0x49984a=_0x49984a||0xc8;return function(_0x579b83){if(_0x579b83){return _0x4c8539[_0xb142('0x18')](_0x49984a)[_0xb142('0x19')](_0x579b83);}};}function respondWithFilteredResult(_0x2b85fe,_0x4b4fb6){return function(_0x3f6313){if(_0x3f6313){var _0x16465d=typeof _0x4b4fb6[_0xb142('0x1a')]===_0xb142('0x1b')&&typeof _0x4b4fb6[_0xb142('0x1c')]===_0xb142('0x1b');var _0x284e59=_0x3f6313[_0xb142('0x1d')];var _0x77852c=_0x16465d?0x0:_0x4b4fb6['offset'];var _0x38b982=_0x16465d?_0x3f6313[_0xb142('0x1d')]:_0x4b4fb6[_0xb142('0x1a')]+_0x4b4fb6[_0xb142('0x1c')];var _0x5bc5b8;if(_0x38b982>=_0x284e59){_0x38b982=_0x284e59;_0x5bc5b8=0xc8;}else{_0x5bc5b8=0xce;}_0x2b85fe['status'](_0x5bc5b8);return _0x2b85fe['set'](_0xb142('0x1e'),_0x77852c+'-'+_0x38b982+'/'+_0x284e59)['json'](_0x3f6313);}return null;};}function patchUpdates(_0x320b14){return function(_0x109358){try{jsonpatch[_0xb142('0x1f')](_0x109358,_0x320b14,!![]);}catch(_0x251805){return BPromise[_0xb142('0x20')](_0x251805);}return _0x109358[_0xb142('0x21')]();};}function saveUpdates(_0xf7c23d,_0xd27bc8){return function(_0x49521a){if(_0x49521a){return _0x49521a[_0xb142('0x22')](_0xf7c23d)[_0xb142('0x23')](function(_0x2985fb){return _0x2985fb;});}return null;};}function removeEntity(_0x490abc,_0x5ed608){return function(_0x4c103e){if(_0x4c103e){return _0x4c103e[_0xb142('0x24')]()[_0xb142('0x23')](function(){var _0x34463c=_0x4c103e[_0xb142('0x25')]({'plain':!![]});var _0x1a6827=_0xb142('0x26');return db['UserProfileResource'][_0xb142('0x24')]({'where':{'type':_0x1a6827,'resourceId':_0x34463c['id']}})[_0xb142('0x23')](function(){return _0x4c103e;});})['then'](function(){_0x490abc[_0xb142('0x18')](0xcc)[_0xb142('0x17')]();});}};}function handleEntityNotFound(_0x5dad4f,_0xdafdb1){return function(_0x19aa42){if(!_0x19aa42){_0x5dad4f[_0xb142('0x16')](0x194);}return _0x19aa42;};}function handleError(_0x517cb3,_0x3d3752){_0x3d3752=_0x3d3752||0x1f4;return function(_0x137d0d){logger[_0xb142('0x27')](_0x137d0d[_0xb142('0x28')]);if(_0x137d0d[_0xb142('0x29')]){delete _0x137d0d[_0xb142('0x29')];}_0x517cb3[_0xb142('0x18')](_0x3d3752)[_0xb142('0x2a')](_0x137d0d);};}exports['index']=function(_0x30a35f,_0x441d5f){var _0x3a298a={},_0x3eb0b9={},_0x5e98dc={'count':0x0,'rows':[]};var _0x4de48d=_['map'](db[_0xb142('0x2b')][_0xb142('0x2c')],function(_0x5d5e3e){return{'name':_0x5d5e3e[_0xb142('0x2d')],'type':_0x5d5e3e[_0xb142('0x2e')]['key']};});_0x3eb0b9[_0xb142('0x2f')]=_[_0xb142('0x30')](_0x4de48d,'name');_0x3eb0b9[_0xb142('0x31')]=_[_0xb142('0x32')](_0x30a35f['query']);_0x3eb0b9[_0xb142('0x33')]=_['intersection'](_0x3eb0b9[_0xb142('0x2f')],_0x3eb0b9[_0xb142('0x31')]);_0x3a298a[_0xb142('0x34')]=_['intersection'](_0x3eb0b9['model'],qs['fields'](_0x30a35f[_0xb142('0x31')][_0xb142('0x35')]));_0x3a298a[_0xb142('0x34')]=_0x3a298a[_0xb142('0x34')][_0xb142('0x36')]?_0x3a298a[_0xb142('0x34')]:_0x3eb0b9[_0xb142('0x2f')];if(!_0x30a35f[_0xb142('0x31')]['hasOwnProperty'](_0xb142('0x37'))){_0x3a298a[_0xb142('0x1c')]=qs[_0xb142('0x1c')](_0x30a35f[_0xb142('0x31')][_0xb142('0x1c')]);_0x3a298a[_0xb142('0x1a')]=qs[_0xb142('0x1a')](_0x30a35f[_0xb142('0x31')][_0xb142('0x1a')]);}_0x3a298a['order']=qs[_0xb142('0x38')](_0x30a35f[_0xb142('0x31')][_0xb142('0x38')]);_0x3a298a[_0xb142('0x39')]=qs['filters'](_[_0xb142('0x3a')](_0x30a35f[_0xb142('0x31')],_0x3eb0b9['filters']),_0x4de48d);if(_0x30a35f[_0xb142('0x31')][_0xb142('0x3b')]){_0x3a298a['where']=_[_0xb142('0x3c')](_0x3a298a['where'],{'$or':_['map'](_0x4de48d,function(_0x1cff97){if(_0x1cff97[_0xb142('0x2e')]!=='VIRTUAL'){var _0x307eeb={};_0x307eeb[_0x1cff97['name']]={'$like':'%'+_0x30a35f[_0xb142('0x31')][_0xb142('0x3b')]+'%'};return _0x307eeb;}})});}_0x3a298a=_[_0xb142('0x3c')]({},_0x3a298a,_0x30a35f[_0xb142('0x3d')]);var _0x19f2f2={'where':_0x3a298a[_0xb142('0x39')]};return db['MailQueue'][_0xb142('0x1d')](_0x19f2f2)[_0xb142('0x23')](function(_0xf37f8d){_0x5e98dc[_0xb142('0x1d')]=_0xf37f8d;if(_0x30a35f[_0xb142('0x31')][_0xb142('0x3e')]){_0x3a298a[_0xb142('0x3f')]=[{'all':!![]}];}return db[_0xb142('0x2b')][_0xb142('0x40')](_0x3a298a);})[_0xb142('0x23')](function(_0x2f4807){_0x5e98dc[_0xb142('0x41')]=_0x2f4807;return _0x5e98dc;})[_0xb142('0x23')](respondWithFilteredResult(_0x441d5f,_0x3a298a))[_0xb142('0x42')](handleError(_0x441d5f,null));};exports['show']=function(_0x3613fe,_0x5f52b3){var _0x1b6205={'raw':!![],'where':{'id':_0x3613fe[_0xb142('0x43')]['id']}},_0x4112b2={};_0x4112b2[_0xb142('0x2f')]=_[_0xb142('0x32')](db['MailQueue'][_0xb142('0x2c')]);_0x4112b2['query']=_[_0xb142('0x32')](_0x3613fe[_0xb142('0x31')]);_0x4112b2[_0xb142('0x33')]=_[_0xb142('0x44')](_0x4112b2[_0xb142('0x2f')],_0x4112b2[_0xb142('0x31')]);_0x1b6205[_0xb142('0x34')]=_[_0xb142('0x44')](_0x4112b2[_0xb142('0x2f')],qs[_0xb142('0x35')](_0x3613fe[_0xb142('0x31')]['fields']));_0x1b6205[_0xb142('0x34')]=_0x1b6205[_0xb142('0x34')][_0xb142('0x36')]?_0x1b6205[_0xb142('0x34')]:_0x4112b2[_0xb142('0x2f')];if(_0x3613fe[_0xb142('0x31')][_0xb142('0x3e')]){_0x1b6205['include']=[{'all':!![]}];}_0x1b6205=_[_0xb142('0x3c')]({},_0x1b6205,_0x3613fe[_0xb142('0x3d')]);return db[_0xb142('0x2b')][_0xb142('0x45')](_0x1b6205)['then'](handleEntityNotFound(_0x5f52b3,null))[_0xb142('0x23')](respondWithResult(_0x5f52b3,null))[_0xb142('0x42')](handleError(_0x5f52b3,null));};exports[_0xb142('0x46')]=function(_0x2653e1,_0x5ea023){return db[_0xb142('0x2b')][_0xb142('0x46')](_0x2653e1[_0xb142('0x47')],{})[_0xb142('0x23')](function(_0x339bd0){var _0x456f92=_0x2653e1['user'][_0xb142('0x25')]({'plain':!![]});if(!_0x456f92)throw new Error(_0xb142('0x48'));if(_0x456f92[_0xb142('0x49')]===_0xb142('0x4a')){var _0x5c6eeb=_0x339bd0[_0xb142('0x25')]({'plain':!![]});var _0x2629a7=_0xb142('0x26');return db[_0xb142('0x4b')][_0xb142('0x45')]({'where':{'name':_0x2629a7,'userProfileId':_0x456f92[_0xb142('0x4c')]},'raw':!![]})[_0xb142('0x23')](function(_0x30ed36){if(_0x30ed36&&_0x30ed36[_0xb142('0x4d')]===0x0){return db['UserProfileResource'][_0xb142('0x46')]({'name':_0x5c6eeb[_0xb142('0x29')],'resourceId':_0x5c6eeb['id'],'type':_0x30ed36[_0xb142('0x29')],'sectionId':_0x30ed36['id']},{})['then'](function(){return _0x339bd0;});}else{return _0x339bd0;}})[_0xb142('0x42')](function(_0x515c47){logger['error'](_0xb142('0x4e'),_0x515c47);throw _0x515c47;});}return _0x339bd0;})[_0xb142('0x23')](respondWithResult(_0x5ea023,0xc9))[_0xb142('0x42')](handleError(_0x5ea023,null));};exports['update']=function(_0x264fb4,_0x4cb62a){if(_0x264fb4[_0xb142('0x47')]['id']){delete _0x264fb4[_0xb142('0x47')]['id'];}return db[_0xb142('0x2b')]['find']({'where':{'id':_0x264fb4[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x4cb62a,null))['then'](saveUpdates(_0x264fb4[_0xb142('0x47')],null))[_0xb142('0x23')](respondWithResult(_0x4cb62a,null))[_0xb142('0x42')](handleError(_0x4cb62a,null));};exports['destroy']=function(_0x680f7f,_0x225967){return db['MailQueue']['find']({'where':{'id':_0x680f7f[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x225967,null))[_0xb142('0x23')](removeEntity(_0x225967,null))['catch'](handleError(_0x225967,null));};exports['describe']=function(_0x51e0e3,_0x40addd){return db['MailQueue'][_0xb142('0x4f')]()[_0xb142('0x23')](respondWithResult(_0x40addd,null))[_0xb142('0x42')](handleError(_0x40addd,null));};exports[_0xb142('0x50')]=function(_0x4b9bfa,_0x169f37,_0x4f0136){var _0x4cb46a={'raw':!![],'where':{}},_0x4bde45={},_0x3e3df6;return db[_0xb142('0x2b')]['findOne']({'where':{'id':_0x4b9bfa[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x169f37,null))[_0xb142('0x23')](function(_0x2d1412){if(_0x2d1412){_0x3e3df6=_0x2d1412[_0xb142('0x25')]({'plain':!![]});_0x4bde45[_0xb142('0x2f')]=_[_0xb142('0x32')](db[_0xb142('0x51')]['rawAttributes']);_0x4bde45['query']=_[_0xb142('0x32')](_0x4b9bfa[_0xb142('0x31')]);_0x4bde45[_0xb142('0x33')]=_[_0xb142('0x44')](_0x4bde45[_0xb142('0x2f')],_0x4bde45['query']);_0x4cb46a[_0xb142('0x34')]=_[_0xb142('0x44')](_0x4bde45[_0xb142('0x2f')],qs['fields'](_0x4b9bfa[_0xb142('0x31')][_0xb142('0x35')]));_0x4cb46a[_0xb142('0x34')]=_0x4cb46a['attributes'][_0xb142('0x36')]?_0x4cb46a[_0xb142('0x34')]:_0x4bde45[_0xb142('0x2f')];if(!_0x4b9bfa[_0xb142('0x31')][_0xb142('0x52')]('nolimit')){_0x4cb46a[_0xb142('0x1c')]=qs[_0xb142('0x1c')](_0x4b9bfa[_0xb142('0x31')][_0xb142('0x1c')]);_0x4cb46a[_0xb142('0x1a')]=qs[_0xb142('0x1a')](_0x4b9bfa['query'][_0xb142('0x1a')]);}_0x4cb46a[_0xb142('0x53')]=qs[_0xb142('0x38')](_0x4b9bfa[_0xb142('0x31')][_0xb142('0x38')]);_0x4cb46a['where']=qs[_0xb142('0x33')](_[_0xb142('0x3a')](_0x4b9bfa[_0xb142('0x31')],_0x4bde45['filters']));_0x4cb46a[_0xb142('0x39')]['MailQueueId']=_0x2d1412['id'];if(_0x4b9bfa[_0xb142('0x31')][_0xb142('0x3b')]){_0x4cb46a[_0xb142('0x39')]=_[_0xb142('0x3c')](_0x4cb46a[_0xb142('0x39')],{'$or':_[_0xb142('0x30')](_0x4cb46a['attributes'],function(_0x247c4b){var _0x278773={};_0x278773[_0x247c4b]={'$like':'%'+_0x4b9bfa['query']['filter']+'%'};return _0x278773;})});}_0x4cb46a=_['merge']({},_0x4cb46a,_0x4b9bfa[_0xb142('0x3d')]);return db[_0xb142('0x51')]['findAll'](_0x4cb46a);}})[_0xb142('0x23')](function(_0x459a70){if(_0x459a70){return db['User']['findAndCountAll']({'where':{'id':_[_0xb142('0x30')](_0x459a70,'UserId'),'role':_0xb142('0x54')},'attributes':['id','name',_0xb142('0x55'),_0xb142('0x56'),_0xb142('0x57')]});}})[_0xb142('0x23')](function(_0x31b69d){if(_0x31b69d){return{'count':_0x31b69d[_0xb142('0x1d')],'rows':_['map'](_0x31b69d[_0xb142('0x41')],function(_0x50af23){return{'membername':_0x50af23[_0xb142('0x29')],'UserId':_0x50af23['id'],'queue_name':_0x3e3df6[_0xb142('0x29')],'MailQueueId':_0x3e3df6['id'],'interface':util[_0xb142('0x58')](_0xb142('0x59'),'SIP',_0x50af23[_0xb142('0x29')]),'penalty':0x0,'paused':_0x50af23[_0xb142('0x55')],'createdAt':_0x50af23[_0xb142('0x57')],'updatedAt':_0x50af23[_0xb142('0x56')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb142('0x23')](respondWithFilteredResult(_0x169f37,_0x4cb46a))[_0xb142('0x42')](handleError(_0x169f37,null));};exports[_0xb142('0x5a')]=function(_0x46c9d5,_0x3176e4,_0x51be38){var _0x50f178={};var _0x3212e3={};var _0xeca79c;var _0x5ec2c1;return db[_0xb142('0x2b')][_0xb142('0x5b')]({'where':{'id':_0x46c9d5[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x3176e4,null))[_0xb142('0x23')](function(_0x4bf9cd){if(_0x4bf9cd){_0xeca79c=_0x4bf9cd;_0x3212e3[_0xb142('0x2f')]=_[_0xb142('0x32')](db[_0xb142('0x5c')][_0xb142('0x2c')]);_0x3212e3['query']=_[_0xb142('0x32')](_0x46c9d5[_0xb142('0x31')]);_0x3212e3[_0xb142('0x33')]=_[_0xb142('0x44')](_0x3212e3['model'],_0x3212e3[_0xb142('0x31')]);_0x50f178['attributes']=_[_0xb142('0x44')](_0x3212e3['model'],qs[_0xb142('0x35')](_0x46c9d5[_0xb142('0x31')][_0xb142('0x35')]));_0x50f178[_0xb142('0x34')]=_0x50f178[_0xb142('0x34')]['length']?_0x50f178[_0xb142('0x34')]:_0x3212e3[_0xb142('0x2f')];_0x50f178[_0xb142('0x53')]=qs[_0xb142('0x38')](_0x46c9d5[_0xb142('0x31')][_0xb142('0x38')]);_0x50f178[_0xb142('0x39')]=qs['filters'](_[_0xb142('0x3a')](_0x46c9d5[_0xb142('0x31')],_0x3212e3['filters']));if(_0x46c9d5[_0xb142('0x31')][_0xb142('0x3b')]){_0x50f178['where']=_['merge'](_0x50f178[_0xb142('0x39')],{'$or':_[_0xb142('0x30')](_0x50f178[_0xb142('0x34')],function(_0x3a1c44){var _0x145c58={};_0x145c58[_0x3a1c44]={'$like':'%'+_0x46c9d5[_0xb142('0x31')]['filter']+'%'};return _0x145c58;})});}_0x50f178=_[_0xb142('0x3c')]({},_0x50f178,_0x46c9d5['options']);return _0xeca79c[_0xb142('0x5a')](_0x50f178);}})[_0xb142('0x23')](function(_0x24a054){if(_0x24a054){_0x5ec2c1=_0x24a054[_0xb142('0x36')];if(!_0x46c9d5[_0xb142('0x31')][_0xb142('0x52')]('nolimit')){_0x50f178['limit']=qs[_0xb142('0x1c')](_0x46c9d5[_0xb142('0x31')][_0xb142('0x1c')]);_0x50f178[_0xb142('0x1a')]=qs['offset'](_0x46c9d5[_0xb142('0x31')][_0xb142('0x1a')]);}return _0xeca79c[_0xb142('0x5a')](_0x50f178);}})['then'](function(_0x23a72d){if(_0x23a72d){return _0x23a72d?{'count':_0x5ec2c1,'rows':_0x23a72d}:null;}})[_0xb142('0x23')](respondWithResult(_0x3176e4,null))[_0xb142('0x42')](handleError(_0x3176e4,null));};exports[_0xb142('0x5d')]=function(_0x19d74c,_0x41c14a,_0x5ad74b){var _0x859488=_0x19d74c[_0xb142('0x47')][_0xb142('0x5e')];return db[_0xb142('0x5c')]['findAll']({'where':{'id':_0x859488},'attributes':['id'],'include':[{'model':db[_0xb142('0x5f')],'as':'Agents','attributes':['id',_0xb142('0x29'),_0xb142('0x60'),_0xb142('0x61'),'interface'],'raw':!![]}]})[_0xb142('0x23')](function(_0x37c785){if(_0x37c785){var _0xa6e22b=_['flatMap'](_0x37c785,function(_0x28b6a1){var _0x250a58=_0x28b6a1[_0xb142('0x25')]({'plain':!![]});return _0x250a58[_0xb142('0x62')];});return db['MailQueue'][_0xb142('0x45')]({'where':{'id':_0x19d74c[_0xb142('0x43')]['id']}})[_0xb142('0x23')](function(_0x46810d){return db[_0xb142('0x63')][_0xb142('0x64')](function(_0x119bd9){return _0x46810d[_0xb142('0x5d')](_0x859488,{'transaction':_0x119bd9})['then'](function(){return BPromise[_0xb142('0x65')](_0xa6e22b,function(_0x3410ef){return db[_0xb142('0x51')]['findOrCreate']({'where':{'UserId':_0x3410ef['id'],'MailQueueId':_0x19d74c['params']['id']},'transaction':_0x119bd9});});})[_0xb142('0x23')](function(){_0xa6e22b[_0xb142('0x66')](function(_0x5e2285){socket['emit'](_0xb142('0x67'),{'UserId':_0x5e2285['id'],'MailQueueId':_0x46810d['id']});});});});});}})[_0xb142('0x23')](respondWithStatusCode(_0x41c14a,null))['catch'](handleError(_0x41c14a,null));};exports[_0xb142('0x68')]=function(_0x49a69e,_0x2e970d,_0x51871d){return db[_0xb142('0x5c')][_0xb142('0x40')]({'where':{'id':_0x49a69e[_0xb142('0x31')][_0xb142('0x5e')]},'attributes':['id'],'include':[{'model':db[_0xb142('0x5f')],'as':_0xb142('0x62'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e970d,null))[_0xb142('0x23')](function(_0x44568d){var _0xedb2a=_['map'](_0x44568d,'id');var _0x58481b=[];var _0x2ff781=[];var _0x439d95=squel[_0xb142('0x69')]();_0x439d95[_0xb142('0x6a')](_0xb142('0x6b'))[_0xb142('0x6c')](_0xb142('0x6d'),'tq')[_0xb142('0x6e')](_0xb142('0x6f'),'ut',_0xb142('0x70'))[_0xb142('0x39')](_0xb142('0x71'),_0x49a69e[_0xb142('0x43')]['id']);for(var _0x4f10e3=0x0;_0x4f10e3<_0x44568d[_0xb142('0x36')];_0x4f10e3+=0x1){let _0x10aace=_0x44568d[_0x4f10e3];for(var _0x161870=0x0;_0x161870<_0x10aace['Agents'][_0xb142('0x36')];_0x161870+=0x1){let _0x553504=_0x10aace[_0xb142('0x62')][_0x161870];var _0x577454=_0x439d95[_0xb142('0x72')]();_0x577454[_0xb142('0x39')](_0xb142('0x73'),_0x553504['id']);_0x2ff781['push'](db['sequelize'][_0xb142('0x31')](_0x577454[_0xb142('0x74')](),{'type':db[_0xb142('0x63')][_0xb142('0x75')][_0xb142('0x76')]})[_0xb142('0x23')](function(_0x3668fd){if(_0x3668fd['length']===0x1){return _0x553504['id'];}else{var _0x1e167a=_['every'](_[_0xb142('0x30')](_0x3668fd,'TeamId'),function(_0x3174a2){return _[_0xb142('0x77')](_0xedb2a,_0x3174a2);});if(_0x1e167a){return _0x553504['id'];}}}));}}return BPromise[_0xb142('0x78')](_0x2ff781)['then'](function(_0x2518d3){_0x58481b=_(_0x58481b)['union'](_0x2518d3)[_0xb142('0x79')]()[_0xb142('0x7a')]();return db[_0xb142('0x2b')][_0xb142('0x45')]({'where':{'id':_0x49a69e[_0xb142('0x43')]['id']}})[_0xb142('0x23')](function(_0x290a24){return db[_0xb142('0x63')][_0xb142('0x64')](function(_0x3a4509){return _0x290a24[_0xb142('0x68')](_0x49a69e[_0xb142('0x31')][_0xb142('0x5e')],{'transaction':_0x3a4509})[_0xb142('0x23')](function(){if(!_[_0xb142('0x7b')](_0x58481b)){return _0x290a24[_0xb142('0x7c')](_0x58481b,{'transaction':_0x3a4509});}})[_0xb142('0x23')](function(){_0x58481b['forEach'](function(_0x29607d){socket[_0xb142('0x7d')](_0xb142('0x7e'),{'UserId':_0x29607d,'MailQueueId':_0x290a24['id']});});});});});});})[_0xb142('0x23')](respondWithStatusCode(_0x2e970d,null))[_0xb142('0x42')](handleError(_0x2e970d,null));};exports[_0xb142('0x7f')]=function(_0x208a0b,_0x558581,_0x79433a){return db['MailQueue'][_0xb142('0x45')]({'where':{'id':_0x208a0b[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x558581,null))[_0xb142('0x23')](function(_0x3881f7){if(_0x3881f7){return _0x3881f7[_0xb142('0x7f')](_0x208a0b[_0xb142('0x47')][_0xb142('0x5e')],_[_0xb142('0x80')](_0x208a0b[_0xb142('0x47')],['ids','id'])||{})[_0xb142('0x81')](function(_0x493e16){for(var _0x491085=0x0;_0x491085<_0x208a0b[_0xb142('0x47')]['ids'][_0xb142('0x36')];_0x491085+=0x1){socket[_0xb142('0x7d')]('userMailQueue:save',{'UserId':Number(_0x208a0b[_0xb142('0x47')][_0xb142('0x5e')][_0x491085]),'MailQueueId':Number(_0x208a0b[_0xb142('0x43')]['id'])});}return _0x493e16;});}})[_0xb142('0x23')](respondWithResult(_0x558581,null))['catch'](handleError(_0x558581,null));};exports['removeAgents']=function(_0x47f9b4,_0x3deafa,_0x4ff803){return db[_0xb142('0x2b')]['find']({'where':{'id':_0x47f9b4[_0xb142('0x43')]['id']}})['then'](handleEntityNotFound(_0x3deafa,null))['then'](function(_0x45d968){if(_0x45d968){return _0x45d968[_0xb142('0x7c')](_0x47f9b4['query'][_0xb142('0x5e')])['then'](function(){if(_[_0xb142('0x82')](_0x47f9b4[_0xb142('0x31')][_0xb142('0x5e')])){for(var _0xd795e6=0x0;_0xd795e6<_0x47f9b4['query'][_0xb142('0x5e')]['length'];_0xd795e6+=0x1){socket[_0xb142('0x7d')](_0xb142('0x7e'),{'UserId':Number(_0x47f9b4[_0xb142('0x31')][_0xb142('0x5e')][_0xd795e6]),'MailQueueId':Number(_0x47f9b4[_0xb142('0x43')]['id'])});}}else{socket[_0xb142('0x7d')](_0xb142('0x7e'),{'UserId':Number(_0x47f9b4[_0xb142('0x31')][_0xb142('0x5e')]),'MailQueueId':Number(_0x47f9b4[_0xb142('0x43')]['id'])});}});}})[_0xb142('0x23')](respondWithStatusCode(_0x3deafa,null))[_0xb142('0x42')](handleError(_0x3deafa,null));};exports[_0xb142('0x83')]=function(_0x246a9a,_0x2f0ae2,_0x12cb94){var _0x4bfc53={};var _0x3d6739={};var _0x4a00b9;var _0x9ffc58;return db[_0xb142('0x2b')]['findOne']({'where':{'id':_0x246a9a[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x2f0ae2,null))['then'](function(_0x4c3376){if(_0x4c3376){_0x4a00b9=_0x4c3376;_0x3d6739[_0xb142('0x2f')]=_['keys'](db[_0xb142('0x5f')][_0xb142('0x2c')]);_0x3d6739[_0xb142('0x31')]=_[_0xb142('0x32')](_0x246a9a[_0xb142('0x31')]);_0x3d6739[_0xb142('0x33')]=_[_0xb142('0x44')](_0x3d6739[_0xb142('0x2f')],_0x3d6739[_0xb142('0x31')]);_0x4bfc53[_0xb142('0x34')]=_[_0xb142('0x44')](_0x3d6739['model'],qs[_0xb142('0x35')](_0x246a9a['query']['fields']));_0x4bfc53[_0xb142('0x34')]=_0x4bfc53[_0xb142('0x34')][_0xb142('0x36')]?_0x4bfc53['attributes']:_0x3d6739[_0xb142('0x2f')];_0x4bfc53[_0xb142('0x53')]=qs[_0xb142('0x38')](_0x246a9a[_0xb142('0x31')]['sort']);_0x4bfc53[_0xb142('0x39')]=qs[_0xb142('0x33')](_['pick'](_0x246a9a[_0xb142('0x31')],_0x3d6739[_0xb142('0x33')]));if(_0x246a9a['query']['filter']){_0x4bfc53[_0xb142('0x39')]=_['merge'](_0x4bfc53[_0xb142('0x39')],{'$or':_['map'](_0x4bfc53[_0xb142('0x34')],function(_0x12c445){var _0x494d75={};_0x494d75[_0x12c445]={'$like':'%'+_0x246a9a[_0xb142('0x31')][_0xb142('0x3b')]+'%'};return _0x494d75;})});}_0x4bfc53=_[_0xb142('0x3c')]({},_0x4bfc53,_0x246a9a[_0xb142('0x3d')]);return _0x4a00b9['getAgents'](_0x4bfc53);}})['then'](function(_0xaeadfc){if(_0xaeadfc){_0x9ffc58=_0xaeadfc[_0xb142('0x36')];if(!_0x246a9a['query'][_0xb142('0x52')]('nolimit')){_0x4bfc53['limit']=qs[_0xb142('0x1c')](_0x246a9a[_0xb142('0x31')][_0xb142('0x1c')]);_0x4bfc53[_0xb142('0x1a')]=qs[_0xb142('0x1a')](_0x246a9a[_0xb142('0x31')][_0xb142('0x1a')]);}return _0x4a00b9[_0xb142('0x83')](_0x4bfc53);}})[_0xb142('0x23')](function(_0x38ea7d){if(_0x38ea7d){return _0x38ea7d?{'count':_0x9ffc58,'rows':_0x38ea7d}:null;}})['then'](respondWithResult(_0x2f0ae2,null))['catch'](handleError(_0x2f0ae2,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 2048a1c..936972b 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 _0xecd8=['hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xecd8,0x183));var _0x8ecd=function(_0x2c6ad1,_0x391436){_0x2c6ad1=_0x2c6ad1-0x0;var _0x243d0c=_0xecd8[_0x2c6ad1];return _0x243d0c;};'use strict';var EventEmitter=require(_0x8ecd('0x0'));var MailQueue=require(_0x8ecd('0x1'))['db'][_0x8ecd('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8ecd('0x3')](0x0);var events={'afterCreate':_0x8ecd('0x4'),'afterUpdate':_0x8ecd('0x5'),'afterDestroy':_0x8ecd('0x6')};function emitEvent(_0x226184){return function(_0x285642,_0x22afdd,_0x2e9f6f){MailQueueEvents[_0x8ecd('0x7')](_0x226184+':'+_0x285642['id'],_0x285642);MailQueueEvents[_0x8ecd('0x7')](_0x226184,_0x285642);_0x2e9f6f(null);};}for(var e in events){if(events[_0x8ecd('0x8')](e)){var event=events[e];MailQueue[_0x8ecd('0x9')](e,emitEvent(event));}}module[_0x8ecd('0xa')]=MailQueueEvents; \ No newline at end of file +var _0x7090=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue'];(function(_0x12d040,_0x328000){var _0x3b5e0c=function(_0x35e4be){while(--_0x35e4be){_0x12d040['push'](_0x12d040['shift']());}};_0x3b5e0c(++_0x328000);}(_0x7090,0x151));var _0x0709=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0x7090[_0x3c487b];return _0x1d65f6;};'use strict';var EventEmitter=require(_0x0709('0x0'));var MailQueue=require(_0x0709('0x1'))['db'][_0x0709('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0709('0x3'),'afterUpdate':_0x0709('0x4'),'afterDestroy':_0x0709('0x5')};function emitEvent(_0x55d0e2){return function(_0x390fb9,_0x50053a,_0xc0221){MailQueueEvents[_0x0709('0x6')](_0x55d0e2+':'+_0x390fb9['id'],_0x390fb9);MailQueueEvents[_0x0709('0x6')](_0x55d0e2,_0x390fb9);_0xc0221(null);};}for(var e in events){if(events[_0x0709('0x7')](e)){var event=events[e];MailQueue[_0x0709('0x8')](e,emitEvent(event));}}module[_0x0709('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 1a83af5..25c845b 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 _0xfc7a=['path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x44e4ad,_0x40710b){var _0xb2d6b6=function(_0x413449){while(--_0x413449){_0x44e4ad['push'](_0x44e4ad['shift']());}};_0xb2d6b6(++_0x40710b);}(_0xfc7a,0xf0));var _0xafc7=function(_0x4214da,_0x586705){_0x4214da=_0x4214da-0x0;var _0x64da0=_0xfc7a[_0x4214da];return _0x64da0;};'use strict';var _=require(_0xafc7('0x0'));var util=require(_0xafc7('0x1'));var logger=require(_0xafc7('0x2'))(_0xafc7('0x3'));var moment=require(_0xafc7('0x4'));var BPromise=require(_0xafc7('0x5'));var rp=require(_0xafc7('0x6'));var fs=require('fs');var path=require(_0xafc7('0x7'));var rimraf=require('rimraf');var config=require(_0xafc7('0x8'));var attributes=require(_0xafc7('0x9'));module[_0xafc7('0xa')]=function(_0x2f6fba,_0x1a34eb){return _0x2f6fba[_0xafc7('0xb')](_0xafc7('0xc'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x009f=['../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4ecbaf,_0x2c1e70){var _0xe2e141=function(_0x51d03e){while(--_0x51d03e){_0x4ecbaf['push'](_0x4ecbaf['shift']());}};_0xe2e141(++_0x2c1e70);}(_0x009f,0x15f));var _0xf009=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0x009f[_0x1269c6];return _0x4868c7;};'use strict';var _=require(_0xf009('0x0'));var util=require(_0xf009('0x1'));var logger=require(_0xf009('0x2'))(_0xf009('0x3'));var moment=require(_0xf009('0x4'));var BPromise=require(_0xf009('0x5'));var rp=require(_0xf009('0x6'));var fs=require('fs');var path=require(_0xf009('0x7'));var rimraf=require(_0xf009('0x8'));var config=require(_0xf009('0x9'));var attributes=require(_0xf009('0xa'));module[_0xf009('0xb')]=function(_0x8331f4,_0x5c6a55){return _0x8331f4[_0xf009('0xc')](_0xf009('0xd'),attributes,{'tableName':_0xf009('0xe'),'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 e45eef7..585d793 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 _0xfb3f=['MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','where','attributes','limit','include','map','model','GetMailQueue','ShowMailQueue','MailQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0xfb3f,0xb2));var _0xffb3=function(_0x2e627a,_0x582afe){_0x2e627a=_0x2e627a-0x0;var _0x2ecc48=_0xfb3f[_0x2e627a];return _0x2ecc48;};'use strict';var _=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var moment=require(_0xffb3('0x2'));var BPromise=require(_0xffb3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffb3('0x4'));var db=require(_0xffb3('0x5'))['db'];var utils=require(_0xffb3('0x6'));var logger=require(_0xffb3('0x7'))('rpc');var config=require(_0xffb3('0x8'));var jayson=require(_0xffb3('0x9'));var client=jayson['client'][_0xffb3('0xa')]({'port':0x232a});config[_0xffb3('0xb')]=_[_0xffb3('0xc')](config['redis'],{'host':_0xffb3('0xd'),'port':0x18eb});var socket=require(_0xffb3('0xe'))(new Redis(config[_0xffb3('0xb')]));require(_0xffb3('0xf'))['register'](socket);function respondWithRpcPromise(_0x2bfa0d,_0x670db7,_0x256512){return new BPromise(function(_0x5410b8,_0x10a86e){return client[_0xffb3('0x10')](_0x2bfa0d,_0x256512)[_0xffb3('0x11')](function(_0x5ccc80){logger[_0xffb3('0x12')](_0xffb3('0x13'),_0x670db7,_0xffb3('0x14'));logger[_0xffb3('0x15')](_0xffb3('0x16'),_0x670db7,_0xffb3('0x14'),JSON[_0xffb3('0x17')](_0x5ccc80));if(_0x5ccc80[_0xffb3('0x18')]){if(_0x5ccc80[_0xffb3('0x18')][_0xffb3('0x19')]===0x1f4){logger['error'](_0xffb3('0x13'),_0x670db7,_0x5ccc80[_0xffb3('0x18')][_0xffb3('0x1a')]);return _0x10a86e(_0x5ccc80['error'][_0xffb3('0x1a')]);}logger[_0xffb3('0x18')](_0xffb3('0x13'),_0x670db7,_0x5ccc80[_0xffb3('0x18')][_0xffb3('0x1a')]);return _0x5410b8(_0x5ccc80[_0xffb3('0x18')][_0xffb3('0x1a')]);}else{logger[_0xffb3('0x12')](_0xffb3('0x13'),_0x670db7,_0xffb3('0x14'));_0x5410b8(_0x5ccc80[_0xffb3('0x1b')][_0xffb3('0x1a')]);}})[_0xffb3('0x1c')](function(_0x445db8){logger[_0xffb3('0x18')](_0xffb3('0x13'),_0x670db7,_0x445db8);_0x10a86e(_0x445db8);});});}exports['GetMailQueue']=function(_0x3a2793){var _0x13c5cf=this;return new Promise(function(_0x1123fa,_0x9a3f54){return db['MailQueue']['findAll']({'raw':_0x3a2793[_0xffb3('0x1d')]?_0x3a2793['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a2793[_0xffb3('0x1d')]?_0x3a2793[_0xffb3('0x1d')][_0xffb3('0x1e')]||null:null,'attributes':_0x3a2793[_0xffb3('0x1d')]?_0x3a2793[_0xffb3('0x1d')][_0xffb3('0x1f')]||null:null,'limit':_0x3a2793[_0xffb3('0x1d')]?_0x3a2793[_0xffb3('0x1d')][_0xffb3('0x20')]||null:null,'include':_0x3a2793[_0xffb3('0x1d')]?_0x3a2793[_0xffb3('0x1d')][_0xffb3('0x21')]?_[_0xffb3('0x22')](_0x3a2793[_0xffb3('0x1d')]['include'],function(_0x4f4bb9){return{'model':db[_0x4f4bb9['model']],'as':_0x4f4bb9['as'],'attributes':_0x4f4bb9['attributes'],'include':_0x4f4bb9[_0xffb3('0x21')]?_['map'](_0x4f4bb9[_0xffb3('0x21')],function(_0x1edc06){return{'model':db[_0x1edc06['model']],'as':_0x1edc06['as'],'attributes':_0x1edc06[_0xffb3('0x1f')],'include':_0x1edc06['include']?_[_0xffb3('0x22')](_0x1edc06['include'],function(_0xec3f80){return{'model':db[_0xec3f80[_0xffb3('0x23')]],'as':_0xec3f80['as'],'attributes':_0xec3f80[_0xffb3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xffb3('0x11')](function(_0x50e6ab){logger[_0xffb3('0x12')](_0xffb3('0x24'),_0x3a2793);logger[_0xffb3('0x15')](_0xffb3('0x24'),_0x3a2793,JSON[_0xffb3('0x17')](_0x50e6ab));_0x1123fa(_0x50e6ab);})[_0xffb3('0x1c')](function(_0x5c81fd){logger[_0xffb3('0x18')](_0xffb3('0x24'),_0x5c81fd[_0xffb3('0x1a')],_0x3a2793);_0x9a3f54(_0x13c5cf['error'](0x1f4,_0x5c81fd['message']));});});};exports[_0xffb3('0x25')]=function(_0x2a3119){var _0x56a4d9=this;return new Promise(function(_0x446722,_0x31b0f3){return db[_0xffb3('0x26')][_0xffb3('0x27')]({'raw':_0x2a3119[_0xffb3('0x1d')]?_0x2a3119[_0xffb3('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2a3119[_0xffb3('0x1d')]?_0x2a3119['options'][_0xffb3('0x1e')]||null:null,'attributes':_0x2a3119[_0xffb3('0x1d')]?_0x2a3119[_0xffb3('0x1d')][_0xffb3('0x1f')]||null:null,'include':_0x2a3119[_0xffb3('0x1d')]?_0x2a3119[_0xffb3('0x1d')]['include']?_[_0xffb3('0x22')](_0x2a3119['options']['include'],function(_0x48779b){return{'model':db[_0x48779b['model']],'as':_0x48779b['as'],'attributes':_0x48779b['attributes'],'include':_0x48779b[_0xffb3('0x21')]?_[_0xffb3('0x22')](_0x48779b[_0xffb3('0x21')],function(_0x7fcf4e){return{'model':db[_0x7fcf4e[_0xffb3('0x23')]],'as':_0x7fcf4e['as'],'attributes':_0x7fcf4e['attributes'],'include':_0x7fcf4e['include']?_[_0xffb3('0x22')](_0x7fcf4e[_0xffb3('0x21')],function(_0x4e2786){return{'model':db[_0x4e2786[_0xffb3('0x23')]],'as':_0x4e2786['as'],'attributes':_0x4e2786[_0xffb3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1645a5){logger[_0xffb3('0x12')](_0xffb3('0x25'),_0x2a3119);logger['debug'](_0xffb3('0x25'),_0x2a3119,JSON[_0xffb3('0x17')](_0x1645a5));_0x446722(_0x1645a5);})[_0xffb3('0x1c')](function(_0x36201f){logger[_0xffb3('0x18')](_0xffb3('0x25'),_0x36201f['message'],_0x2a3119);_0x31b0f3(_0x56a4d9[_0xffb3('0x18')](0x1f4,_0x36201f[_0xffb3('0x1a')]));});});}; \ No newline at end of file +var _0x61a3=['ShowMailQueue','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','map','model'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x61a3,0x1ef));var _0x361a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x61a3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x361a('0x0'));var util=require(_0x361a('0x1'));var moment=require(_0x361a('0x2'));var BPromise=require('bluebird');var rs=require(_0x361a('0x3'));var fs=require('fs');var Redis=require(_0x361a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x361a('0x5'));var logger=require(_0x361a('0x6'))(_0x361a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x361a('0x8')][_0x361a('0x9')]({'port':0x232a});config['redis']=_[_0x361a('0xa')](config[_0x361a('0xb')],{'host':_0x361a('0xc'),'port':0x18eb});var socket=require(_0x361a('0xd'))(new Redis(config['redis']));require(_0x361a('0xe'))['register'](socket);function respondWithRpcPromise(_0x4a6831,_0x467920,_0x55cfd7){return new BPromise(function(_0x4ec0a3,_0x32a99e){return client[_0x361a('0xf')](_0x4a6831,_0x55cfd7)[_0x361a('0x10')](function(_0x3fff96){logger[_0x361a('0x11')](_0x361a('0x12'),_0x467920,'request\x20sent');logger[_0x361a('0x13')](_0x361a('0x14'),_0x467920,_0x361a('0x15'),JSON[_0x361a('0x16')](_0x3fff96));if(_0x3fff96[_0x361a('0x17')]){if(_0x3fff96[_0x361a('0x17')]['code']===0x1f4){logger[_0x361a('0x17')](_0x361a('0x12'),_0x467920,_0x3fff96['error'][_0x361a('0x18')]);return _0x32a99e(_0x3fff96[_0x361a('0x17')][_0x361a('0x18')]);}logger[_0x361a('0x17')]('MailQueue,\x20%s,\x20%s',_0x467920,_0x3fff96[_0x361a('0x17')]['message']);return _0x4ec0a3(_0x3fff96[_0x361a('0x17')]['message']);}else{logger[_0x361a('0x11')](_0x361a('0x12'),_0x467920,_0x361a('0x15'));_0x4ec0a3(_0x3fff96[_0x361a('0x19')][_0x361a('0x18')]);}})[_0x361a('0x1a')](function(_0x12423e){logger[_0x361a('0x17')](_0x361a('0x12'),_0x467920,_0x12423e);_0x32a99e(_0x12423e);});});}exports[_0x361a('0x1b')]=function(_0x6b2ecb){var _0x5eb846=this;return new Promise(function(_0x2e61a8,_0x114032){return db[_0x361a('0x1c')][_0x361a('0x1d')]({'raw':_0x6b2ecb[_0x361a('0x1e')]?_0x6b2ecb[_0x361a('0x1e')][_0x361a('0x1f')]===undefined?!![]:![]:!![],'where':_0x6b2ecb[_0x361a('0x1e')]?_0x6b2ecb[_0x361a('0x1e')][_0x361a('0x20')]||null:null,'attributes':_0x6b2ecb[_0x361a('0x1e')]?_0x6b2ecb['options'][_0x361a('0x21')]||null:null,'limit':_0x6b2ecb[_0x361a('0x1e')]?_0x6b2ecb[_0x361a('0x1e')]['limit']||null:null,'include':_0x6b2ecb[_0x361a('0x1e')]?_0x6b2ecb[_0x361a('0x1e')][_0x361a('0x22')]?_[_0x361a('0x23')](_0x6b2ecb[_0x361a('0x1e')][_0x361a('0x22')],function(_0x4789a1){return{'model':db[_0x4789a1[_0x361a('0x24')]],'as':_0x4789a1['as'],'attributes':_0x4789a1[_0x361a('0x21')],'include':_0x4789a1['include']?_[_0x361a('0x23')](_0x4789a1[_0x361a('0x22')],function(_0x4f65d7){return{'model':db[_0x4f65d7[_0x361a('0x24')]],'as':_0x4f65d7['as'],'attributes':_0x4f65d7[_0x361a('0x21')],'include':_0x4f65d7[_0x361a('0x22')]?_[_0x361a('0x23')](_0x4f65d7[_0x361a('0x22')],function(_0x4179c4){return{'model':db[_0x4179c4['model']],'as':_0x4179c4['as'],'attributes':_0x4179c4[_0x361a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x361a('0x10')](function(_0x3895a1){logger[_0x361a('0x11')]('GetMailQueue',_0x6b2ecb);logger[_0x361a('0x13')](_0x361a('0x1b'),_0x6b2ecb,JSON['stringify'](_0x3895a1));_0x2e61a8(_0x3895a1);})[_0x361a('0x1a')](function(_0x309bd8){logger['error'](_0x361a('0x1b'),_0x309bd8[_0x361a('0x18')],_0x6b2ecb);_0x114032(_0x5eb846[_0x361a('0x17')](0x1f4,_0x309bd8['message']));});});};exports['ShowMailQueue']=function(_0x4d1775){var _0x1cef5e=this;return new Promise(function(_0x110441,_0xe0b267){return db['MailQueue']['find']({'raw':_0x4d1775['options']?_0x4d1775[_0x361a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4d1775[_0x361a('0x1e')]?_0x4d1775[_0x361a('0x1e')][_0x361a('0x20')]||null:null,'attributes':_0x4d1775[_0x361a('0x1e')]?_0x4d1775[_0x361a('0x1e')][_0x361a('0x21')]||null:null,'include':_0x4d1775[_0x361a('0x1e')]?_0x4d1775[_0x361a('0x1e')][_0x361a('0x22')]?_['map'](_0x4d1775['options'][_0x361a('0x22')],function(_0x370e15){return{'model':db[_0x370e15[_0x361a('0x24')]],'as':_0x370e15['as'],'attributes':_0x370e15['attributes'],'include':_0x370e15['include']?_[_0x361a('0x23')](_0x370e15['include'],function(_0x4119d7){return{'model':db[_0x4119d7[_0x361a('0x24')]],'as':_0x4119d7['as'],'attributes':_0x4119d7[_0x361a('0x21')],'include':_0x4119d7[_0x361a('0x22')]?_['map'](_0x4119d7[_0x361a('0x22')],function(_0x1b4401){return{'model':db[_0x1b4401['model']],'as':_0x1b4401['as'],'attributes':_0x1b4401['attributes']};}):[]};}):[]};}):[]:[]})[_0x361a('0x10')](function(_0xb5695){logger['info'](_0x361a('0x25'),_0x4d1775);logger['debug'](_0x361a('0x25'),_0x4d1775,JSON[_0x361a('0x16')](_0xb5695));_0x110441(_0xb5695);})[_0x361a('0x1a')](function(_0x5b4c32){logger[_0x361a('0x17')](_0x361a('0x25'),_0x5b4c32[_0x361a('0x18')],_0x4d1775);_0xe0b267(_0x1cef5e[_0x361a('0x17')](0x1f4,_0x5b4c32['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 96b1d60..fab1000 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 _0x071d=['removeListener','register','length','mailQueue:','remove','update','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x071d,0x82));var _0xd071=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x071d[_0xa30766];return _0x24e780;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xd071('0x0'),_0xd071('0x1')];function createListener(_0xcc3d6,_0x25d637){return function(_0x4a7fba){_0x25d637[_0xd071('0x2')](_0xcc3d6,_0x4a7fba);};}function removeListener(_0x1a29a3,_0x54d8f0){return function(){MailQueueEvents[_0xd071('0x3')](_0x1a29a3,_0x54d8f0);};}exports[_0xd071('0x4')]=function(_0x187756){for(var _0x12025a=0x0,_0x30216a=events[_0xd071('0x5')];_0x12025a<_0x30216a;_0x12025a++){var _0x80236a=events[_0x12025a];var _0x3f09fb=createListener(_0xd071('0x6')+_0x80236a,_0x187756);MailQueueEvents['on'](_0x80236a,_0x3f09fb);}}; \ No newline at end of file +var _0x0630=['remove','update','emit','register','mailQueue:','./mailQueue.events','save'];(function(_0x17549e,_0x42dfdb){var _0x55d0e3=function(_0x283eeb){while(--_0x283eeb){_0x17549e['push'](_0x17549e['shift']());}};_0x55d0e3(++_0x42dfdb);}(_0x0630,0xde));var _0x0063=function(_0x5edeb9,_0x1221d3){_0x5edeb9=_0x5edeb9-0x0;var _0xf78954=_0x0630[_0x5edeb9];return _0xf78954;};'use strict';var MailQueueEvents=require(_0x0063('0x0'));var events=[_0x0063('0x1'),_0x0063('0x2'),_0x0063('0x3')];function createListener(_0x1d8469,_0x252b42){return function(_0x4d9183){_0x252b42[_0x0063('0x4')](_0x1d8469,_0x4d9183);};}function removeListener(_0x1490f7,_0x389dec){return function(){MailQueueEvents['removeListener'](_0x1490f7,_0x389dec);};}exports[_0x0063('0x5')]=function(_0x57a966){for(var _0x14ff3d=0x0,_0x51e3e2=events['length'];_0x14ff3d<_0x51e3e2;_0x14ff3d++){var _0x19aeb2=events[_0x14ff3d];var _0x5c3dda=createListener(_0x0063('0x6')+_0x19aeb2,_0x57a966);MailQueueEvents['on'](_0x19aeb2,_0x5c3dda);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index c24cd28..ccf7bd1 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 _0x37a0=['get','index','/describe','isAuthenticated','describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment'];(function(_0x65e618,_0x4883d8){var _0x2f627=function(_0x426720){while(--_0x426720){_0x65e618['push'](_0x65e618['shift']());}};_0x2f627(++_0x4883d8);}(_0x37a0,0xb7));var _0x037a=function(_0x2155bb,_0x204d49){_0x2155bb=_0x2155bb-0x0;var _0x5cb3cc=_0x37a0[_0x2155bb];return _0x5cb3cc;};'use strict';var multer=require(_0x037a('0x0'));var util=require(_0x037a('0x1'));var path=require(_0x037a('0x2'));var timeout=require(_0x037a('0x3'));var express=require(_0x037a('0x4'));var router=express['Router']();var fs_extra=require(_0x037a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x037a('0x6'));var controller=require('./mailQueueReport.controller');router[_0x037a('0x7')]('/',auth['isAuthenticated'](),controller[_0x037a('0x8')]);router[_0x037a('0x7')](_0x037a('0x9'),auth[_0x037a('0xa')](),controller[_0x037a('0xb')]);router['get'](_0x037a('0xc'),auth[_0x037a('0xa')](),controller[_0x037a('0xd')]);router['post']('/',auth[_0x037a('0xa')](),controller[_0x037a('0xe')]);router[_0x037a('0xf')](_0x037a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x037a('0x10')](_0x037a('0xc'),auth['isAuthenticated'](),controller[_0x037a('0x11')]);module[_0x037a('0x12')]=router; \ No newline at end of file +var _0x2e6c=['../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x579eba,_0x42c908){var _0x385fd4=function(_0x1ba91b){while(--_0x1ba91b){_0x579eba['push'](_0x579eba['shift']());}};_0x385fd4(++_0x42c908);}(_0x2e6c,0xc6));var _0xc2e6=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2e6c[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xc2e6('0x0'));var util=require(_0xc2e6('0x1'));var path=require(_0xc2e6('0x2'));var timeout=require(_0xc2e6('0x3'));var express=require(_0xc2e6('0x4'));var router=express[_0xc2e6('0x5')]();var fs_extra=require(_0xc2e6('0x6'));var auth=require(_0xc2e6('0x7'));var interaction=require(_0xc2e6('0x8'));var config=require(_0xc2e6('0x9'));var controller=require(_0xc2e6('0xa'));router[_0xc2e6('0xb')]('/',auth[_0xc2e6('0xc')](),controller[_0xc2e6('0xd')]);router[_0xc2e6('0xb')](_0xc2e6('0xe'),auth['isAuthenticated'](),controller[_0xc2e6('0xf')]);router[_0xc2e6('0xb')]('/:id',auth[_0xc2e6('0xc')](),controller[_0xc2e6('0x10')]);router['post']('/',auth[_0xc2e6('0xc')](),controller[_0xc2e6('0x11')]);router[_0xc2e6('0x12')](_0xc2e6('0x13'),auth[_0xc2e6('0xc')](),controller[_0xc2e6('0x14')]);router[_0xc2e6('0x15')](_0xc2e6('0x13'),auth[_0xc2e6('0xc')](),controller[_0xc2e6('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 7dfed83..d83e29d 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 _0x9bf7=['DATE','sequelize','exports','STRING'];(function(_0x38e09f,_0x490e2a){var _0x3e820f=function(_0x18dc6d){while(--_0x18dc6d){_0x38e09f['push'](_0x38e09f['shift']());}};_0x3e820f(++_0x490e2a);}(_0x9bf7,0x11d));var _0x79bf=function(_0x24979d,_0x44b374){_0x24979d=_0x24979d-0x0;var _0x2533c4=_0x9bf7[_0x24979d];return _0x2533c4;};'use strict';var moment=require('moment');var Sequelize=require(_0x79bf('0x0'));module[_0x79bf('0x1')]={'uniqueid':{'type':Sequelize[_0x79bf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x79bf('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x79bf('0x3')]},'acceptAt':{'type':Sequelize[_0x79bf('0x3')]},'exitAt':{'type':Sequelize[_0x79bf('0x3')]},'reason':{'type':Sequelize[_0x79bf('0x2')]}}; \ No newline at end of file +var _0x7e44=['moment','sequelize','exports','DATE'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x7e44,0x114));var _0x47e4=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0x7e44[_0x3457b4];return _0xaa8fa9;};'use strict';var moment=require(_0x47e4('0x0'));var Sequelize=require(_0x47e4('0x1'));module[_0x47e4('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47e4('0x3')]},'leaveAt':{'type':Sequelize[_0x47e4('0x3')]},'acceptAt':{'type':Sequelize[_0x47e4('0x3')]},'exitAt':{'type':Sequelize[_0x47e4('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 2a016fe..8339475 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 _0x0120=['name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x2097f5,_0x360195){var _0x3b5f3f=function(_0xc554ac){while(--_0xc554ac){_0x2097f5['push'](_0x2097f5['shift']());}};_0x3b5f3f(++_0x360195);}(_0x0120,0x6f));var _0x0012=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0120[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x0012('0x0'));var rimraf=require(_0x0012('0x1'));var zipdir=require(_0x0012('0x2'));var jsonpatch=require(_0x0012('0x3'));var rp=require(_0x0012('0x4'));var moment=require(_0x0012('0x5'));var BPromise=require(_0x0012('0x6'));var Mustache=require(_0x0012('0x7'));var util=require(_0x0012('0x8'));var path=require(_0x0012('0x9'));var sox=require(_0x0012('0xa'));var csv=require(_0x0012('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0012('0xc'));var crypto=require(_0x0012('0xd'));var jsforce=require(_0x0012('0xe'));var deskjs=require(_0x0012('0xf'));var toCsv=require(_0x0012('0xb'));var querystring=require('querystring');var Papa=require(_0x0012('0x10'));var Redis=require(_0x0012('0x11'));var authService=require(_0x0012('0x12'));var qs=require(_0x0012('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0012('0x14'));var logger=require('../../config/logger')(_0x0012('0x15'));var utils=require(_0x0012('0x16'));var config=require(_0x0012('0x17'));var licenseUtil=require(_0x0012('0x18'));var db=require(_0x0012('0x19'))['db'];function respondWithStatusCode(_0x4d3e7a,_0x6d4a1a){_0x6d4a1a=_0x6d4a1a||0xcc;return function(_0x4f0ee1){if(_0x4f0ee1){return _0x4d3e7a['sendStatus'](_0x6d4a1a);}return _0x4d3e7a['status'](_0x6d4a1a)['end']();};}function respondWithResult(_0x3a7d50,_0x496a2b){_0x496a2b=_0x496a2b||0xc8;return function(_0x3995fd){if(_0x3995fd){return _0x3a7d50[_0x0012('0x1a')](_0x496a2b)['json'](_0x3995fd);}};}function respondWithFilteredResult(_0x24f4ed,_0x1a0c0d){return function(_0x348810){if(_0x348810){var _0x3b8dfc=typeof _0x1a0c0d['offset']==='undefined'&&typeof _0x1a0c0d[_0x0012('0x1b')]===_0x0012('0x1c');var _0x3948bf=_0x348810[_0x0012('0x1d')];var _0x1d0423=_0x3b8dfc?0x0:_0x1a0c0d[_0x0012('0x1e')];var _0x1e78ee=_0x3b8dfc?_0x348810[_0x0012('0x1d')]:_0x1a0c0d['offset']+_0x1a0c0d[_0x0012('0x1b')];var _0x56b0e1;if(_0x1e78ee>=_0x3948bf){_0x1e78ee=_0x3948bf;_0x56b0e1=0xc8;}else{_0x56b0e1=0xce;}_0x24f4ed['status'](_0x56b0e1);return _0x24f4ed[_0x0012('0x1f')](_0x0012('0x20'),_0x1d0423+'-'+_0x1e78ee+'/'+_0x3948bf)[_0x0012('0x21')](_0x348810);}return null;};}function patchUpdates(_0x2c837e){return function(_0x53ac2d){try{jsonpatch['apply'](_0x53ac2d,_0x2c837e,!![]);}catch(_0x460d82){return BPromise[_0x0012('0x22')](_0x460d82);}return _0x53ac2d[_0x0012('0x23')]();};}function saveUpdates(_0x7177bc,_0x190f07){return function(_0x2e6a2c){if(_0x2e6a2c){return _0x2e6a2c[_0x0012('0x24')](_0x7177bc)[_0x0012('0x25')](function(_0x57487e){return _0x57487e;});}return null;};}function removeEntity(_0x24674c,_0x24a280){return function(_0x4cf4bd){if(_0x4cf4bd){return _0x4cf4bd[_0x0012('0x26')]()[_0x0012('0x25')](function(){_0x24674c[_0x0012('0x1a')](0xcc)[_0x0012('0x27')]();});}};}function handleEntityNotFound(_0x42bcd7,_0x5e820b){return function(_0x351ffd){if(!_0x351ffd){_0x42bcd7[_0x0012('0x28')](0x194);}return _0x351ffd;};}function handleError(_0xbb5b55,_0x2a0302){_0x2a0302=_0x2a0302||0x1f4;return function(_0x173cb3){logger[_0x0012('0x29')](_0x173cb3[_0x0012('0x2a')]);if(_0x173cb3[_0x0012('0x2b')]){delete _0x173cb3[_0x0012('0x2b')];}_0xbb5b55[_0x0012('0x1a')](_0x2a0302)[_0x0012('0x2c')](_0x173cb3);};}exports[_0x0012('0x2d')]=function(_0x45c3ca,_0x3ce788){var _0x1282bb={},_0x276389={},_0x1b676d={'count':0x0,'rows':[]};var _0x1f4a0a=_[_0x0012('0x2e')](db[_0x0012('0x2f')][_0x0012('0x30')],function(_0x4d0998){return{'name':_0x4d0998[_0x0012('0x31')],'type':_0x4d0998[_0x0012('0x32')]['key']};});_0x276389[_0x0012('0x33')]=_[_0x0012('0x2e')](_0x1f4a0a,_0x0012('0x2b'));_0x276389[_0x0012('0x34')]=_[_0x0012('0x35')](_0x45c3ca['query']);_0x276389[_0x0012('0x36')]=_[_0x0012('0x37')](_0x276389[_0x0012('0x33')],_0x276389['query']);_0x1282bb[_0x0012('0x38')]=_[_0x0012('0x37')](_0x276389[_0x0012('0x33')],qs[_0x0012('0x39')](_0x45c3ca[_0x0012('0x34')][_0x0012('0x39')]));_0x1282bb['attributes']=_0x1282bb[_0x0012('0x38')][_0x0012('0x3a')]?_0x1282bb[_0x0012('0x38')]:_0x276389[_0x0012('0x33')];if(!_0x45c3ca['query']['hasOwnProperty'](_0x0012('0x3b'))){_0x1282bb[_0x0012('0x1b')]=qs[_0x0012('0x1b')](_0x45c3ca[_0x0012('0x34')][_0x0012('0x1b')]);_0x1282bb[_0x0012('0x1e')]=qs[_0x0012('0x1e')](_0x45c3ca['query'][_0x0012('0x1e')]);}_0x1282bb[_0x0012('0x3c')]=qs['sort'](_0x45c3ca[_0x0012('0x34')][_0x0012('0x3d')]);_0x1282bb[_0x0012('0x3e')]=qs[_0x0012('0x36')](_[_0x0012('0x3f')](_0x45c3ca[_0x0012('0x34')],_0x276389[_0x0012('0x36')]),_0x1f4a0a);if(_0x45c3ca['query'][_0x0012('0x40')]){_0x1282bb['where']=_[_0x0012('0x41')](_0x1282bb['where'],{'$or':_['map'](_0x1f4a0a,function(_0x1c35aa){if(_0x1c35aa[_0x0012('0x32')]!==_0x0012('0x42')){var _0x4e4424={};_0x4e4424[_0x1c35aa[_0x0012('0x2b')]]={'$like':'%'+_0x45c3ca[_0x0012('0x34')][_0x0012('0x40')]+'%'};return _0x4e4424;}})});}_0x1282bb=_[_0x0012('0x41')]({},_0x1282bb,_0x45c3ca[_0x0012('0x43')]);var _0x379780={'where':_0x1282bb[_0x0012('0x3e')]};return db[_0x0012('0x2f')]['count'](_0x379780)[_0x0012('0x25')](function(_0x25aff1){_0x1b676d[_0x0012('0x1d')]=_0x25aff1;if(_0x45c3ca[_0x0012('0x34')][_0x0012('0x44')]){_0x1282bb[_0x0012('0x45')]=[{'all':!![]}];}return db[_0x0012('0x2f')]['findAll'](_0x1282bb);})['then'](function(_0x1c54de){_0x1b676d['rows']=_0x1c54de;return _0x1b676d;})[_0x0012('0x25')](respondWithFilteredResult(_0x3ce788,_0x1282bb))[_0x0012('0x46')](handleError(_0x3ce788,null));};exports[_0x0012('0x47')]=function(_0x40f80d,_0x32c1f9){var _0x5348a2={'raw':!![],'where':{'id':_0x40f80d[_0x0012('0x48')]['id']}},_0x1bd93a={};_0x1bd93a['model']=_[_0x0012('0x35')](db[_0x0012('0x2f')][_0x0012('0x30')]);_0x1bd93a[_0x0012('0x34')]=_['keys'](_0x40f80d['query']);_0x1bd93a[_0x0012('0x36')]=_['intersection'](_0x1bd93a[_0x0012('0x33')],_0x1bd93a['query']);_0x5348a2[_0x0012('0x38')]=_[_0x0012('0x37')](_0x1bd93a[_0x0012('0x33')],qs[_0x0012('0x39')](_0x40f80d['query'][_0x0012('0x39')]));_0x5348a2['attributes']=_0x5348a2[_0x0012('0x38')][_0x0012('0x3a')]?_0x5348a2[_0x0012('0x38')]:_0x1bd93a[_0x0012('0x33')];if(_0x40f80d[_0x0012('0x34')][_0x0012('0x44')]){_0x5348a2[_0x0012('0x45')]=[{'all':!![]}];}_0x5348a2=_['merge']({},_0x5348a2,_0x40f80d[_0x0012('0x43')]);return db[_0x0012('0x2f')][_0x0012('0x49')](_0x5348a2)[_0x0012('0x25')](handleEntityNotFound(_0x32c1f9,null))[_0x0012('0x25')](respondWithResult(_0x32c1f9,null))[_0x0012('0x46')](handleError(_0x32c1f9,null));};exports['create']=function(_0x5894ee,_0x48de64){return db['MailQueueReport'][_0x0012('0x4a')](_0x5894ee[_0x0012('0x4b')],{})[_0x0012('0x25')](respondWithResult(_0x48de64,0xc9))[_0x0012('0x46')](handleError(_0x48de64,null));};exports[_0x0012('0x24')]=function(_0x53d552,_0x44ffaf){if(_0x53d552[_0x0012('0x4b')]['id']){delete _0x53d552[_0x0012('0x4b')]['id'];}return db[_0x0012('0x2f')][_0x0012('0x49')]({'where':{'id':_0x53d552[_0x0012('0x48')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x44ffaf,null))[_0x0012('0x25')](saveUpdates(_0x53d552[_0x0012('0x4b')],null))[_0x0012('0x25')](respondWithResult(_0x44ffaf,null))[_0x0012('0x46')](handleError(_0x44ffaf,null));};exports['destroy']=function(_0x2389cd,_0x12cb8f){return db[_0x0012('0x2f')]['find']({'where':{'id':_0x2389cd[_0x0012('0x48')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x12cb8f,null))[_0x0012('0x25')](removeEntity(_0x12cb8f,null))[_0x0012('0x46')](handleError(_0x12cb8f,null));};exports[_0x0012('0x4c')]=function(_0x5f283f,_0xd11428){return db['MailQueueReport'][_0x0012('0x4c')]()[_0x0012('0x25')](respondWithResult(_0xd11428,null))['catch'](handleError(_0xd11428,null));}; \ No newline at end of file +var _0x90b1=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','MailQueueReport','includeAll','rows','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters'];(function(_0x162c32,_0x1bbbbb){var _0xfb6f69=function(_0xf394f8){while(--_0xf394f8){_0x162c32['push'](_0x162c32['shift']());}};_0xfb6f69(++_0x1bbbbb);}(_0x90b1,0x1bb));var _0x190b=function(_0x13b3f2,_0x1f230e){_0x13b3f2=_0x13b3f2-0x0;var _0x476495=_0x90b1[_0x13b3f2];return _0x476495;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['MailQueueReport'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['MailQueueReport'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));};exports[_0x190b('0x45')]=function(_0x33cc78,_0x2ea1c8){return db[_0x190b('0x3d')][_0x190b('0x45')]()[_0x190b('0x22')](respondWithResult(_0x2ea1c8,null))['catch'](handleError(_0x2ea1c8,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 8b83eaa..ec791f5 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 _0x091a=['moment','bluebird','request-promise','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api'];(function(_0x3e5d32,_0x19ce13){var _0x3e7822=function(_0x5c192c){while(--_0x5c192c){_0x3e5d32['push'](_0x3e5d32['shift']());}};_0x3e7822(++_0x19ce13);}(_0x091a,0x76));var _0xa091=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x091a[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xa091('0x0'));var util=require('util');var logger=require(_0xa091('0x1'))(_0xa091('0x2'));var moment=require(_0xa091('0x3'));var BPromise=require(_0xa091('0x4'));var rp=require(_0xa091('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0xa091('0x6')]=function(_0x6cabfd,_0x1aa57d){return _0x6cabfd[_0xa091('0x7')](_0xa091('0x8'),attributes,{'tableName':_0xa091('0x9'),'paranoid':![],'indexes':[{'name':_0xa091('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x395b=['lodash','moment','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid'];(function(_0x1bebe5,_0x32e0d3){var _0x568429=function(_0x2306f0){while(--_0x2306f0){_0x1bebe5['push'](_0x1bebe5['shift']());}};_0x568429(++_0x32e0d3);}(_0x395b,0x79));var _0xb395=function(_0x246cbe,_0x19305c){_0x246cbe=_0x246cbe-0x0;var _0x855b0=_0x395b[_0x246cbe];return _0x855b0;};'use strict';var _=require(_0xb395('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb395('0x1'));var BPromise=require(_0xb395('0x2'));var rp=require(_0xb395('0x3'));var fs=require('fs');var path=require(_0xb395('0x4'));var rimraf=require(_0xb395('0x5'));var config=require('../../config/environment');var attributes=require(_0xb395('0x6'));module[_0xb395('0x7')]=function(_0x14b806,_0x4bb8fa){return _0x14b806[_0xb395('0x8')]('MailQueueReport',attributes,{'tableName':_0xb395('0x9'),'paranoid':![],'indexes':[{'name':_0xb395('0xa'),'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 3f764be..b16604c 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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b90b4,_0x1d72e4){var _0x32eafe=function(_0x157e2b){while(--_0x157e2b){_0x2b90b4['push'](_0x2b90b4['shift']());}};_0x32eafe(++_0x1d72e4);}(_0x326f,0xd1));var _0xf326=function(_0x4d1ae1,_0x31ae71){_0x4d1ae1=_0x4d1ae1-0x0;var _0x21f9d4=_0x326f[_0x4d1ae1];return _0x21f9d4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x58e30d,_0x52a0a0){var _0x4732d8=function(_0x232642){while(--_0x232642){_0x58e30d['push'](_0x58e30d['shift']());}};_0x4732d8(++_0x52a0a0);}(_0x7a54,0x106));var _0x47a5=function(_0x59e23b,_0x4a84c1){_0x59e23b=_0x59e23b-0x0;var _0x5b0826=_0x7a54[_0x59e23b];return _0x5b0826;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 710d14f..985a9b3 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x8ee03d,_0x5b9f25){var _0x33f72b=function(_0xffd67b){while(--_0xffd67b){_0x8ee03d['push'](_0x8ee03d['shift']());}};_0x33f72b(++_0x5b9f25);}(_0xe706,0xa3));var _0x6e70=function(_0x3fbb91,_0x5ec106){_0x3fbb91=_0x3fbb91-0x0;var _0x3eb213=_0xe706[_0x3fbb91];return _0x3eb213;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x29682e,_0x45ba07){var _0x2a2617=function(_0x16874b){while(--_0x16874b){_0x29682e['push'](_0x29682e['shift']());}};_0x2a2617(++_0x45ba07);}(_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 diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index ebf875b..0a7685a 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 _0xd547=['INTEGER','STRING','BOOLEAN','INBOX'];(function(_0x554203,_0x461a63){var _0x7cb135=function(_0x27873b){while(--_0x27873b){_0x554203['push'](_0x554203['shift']());}};_0x7cb135(++_0x461a63);}(_0xd547,0x1c1));var _0x7d54=function(_0x5d5ab2,_0x1d3681){_0x5d5ab2=_0x5d5ab2-0x0;var _0xb8fe37=_0xd547[_0x5d5ab2];return _0xb8fe37;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7d54('0x0')]},'host':{'type':Sequelize[_0x7d54('0x0')]},'authentication':{'type':Sequelize[_0x7d54('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x7d54('0x0')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x7d54('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x7d54('0x2')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7d54('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7d54('0x0')]}}; \ No newline at end of file +var _0xd4f4=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x16c87d,_0xdd8e34){var _0x2b577e=function(_0x4f20f2){while(--_0x4f20f2){_0x16c87d['push'](_0x16c87d['shift']());}};_0x2b577e(++_0xdd8e34);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x51a3a8,_0x279784){_0x51a3a8=_0x51a3a8-0x0;var _0x5e5d7b=_0xd4f4[_0x51a3a8];return _0x5e5d7b;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'description':{'type':Sequelize[_0x4d4f('0x2')]},'host':{'type':Sequelize[_0x4d4f('0x2')]},'authentication':{'type':Sequelize[_0x4d4f('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x4d4f('0x2')]},'password':{'type':Sequelize[_0x4d4f('0x2')]},'port':{'type':Sequelize[_0x4d4f('0x4')]},'tls':{'type':Sequelize[_0x4d4f('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4d4f('0x2')],'defaultValue':_0x4d4f('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 8620ee3..38a6dd4 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 _0xb8d5=['MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3cef5f,_0x3e71b2){var _0x26f6f1=function(_0x34c676){while(--_0x34c676){_0x3cef5f['push'](_0x3cef5f['shift']());}};_0x26f6f1(++_0x3e71b2);}(_0xb8d5,0x160));var _0x5b8d=function(_0x5f263e,_0x3f4194){_0x5f263e=_0x5f263e-0x0;var _0xc69fb1=_0xb8d5[_0x5f263e];return _0xc69fb1;};'use strict';var _=require(_0x5b8d('0x0'));var util=require(_0x5b8d('0x1'));var logger=require(_0x5b8d('0x2'))(_0x5b8d('0x3'));var moment=require('moment');var BPromise=require(_0x5b8d('0x4'));var rp=require(_0x5b8d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b8d('0x6'));var config=require(_0x5b8d('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x498fa1,_0x395dd0){return _0x498fa1['define'](_0x5b8d('0x8'),attributes,{'tableName':_0x5b8d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b03=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in'];(function(_0x2966c1,_0x529da1){var _0xfd97d0=function(_0x455efe){while(--_0x455efe){_0x2966c1['push'](_0x2966c1['shift']());}};_0xfd97d0(++_0x529da1);}(_0x6b03,0x70));var _0x36b0=function(_0x317821,_0x28b1c7){_0x317821=_0x317821-0x0;var _0xd6a558=_0x6b03[_0x317821];return _0xd6a558;};'use strict';var _=require(_0x36b0('0x0'));var util=require(_0x36b0('0x1'));var logger=require(_0x36b0('0x2'))(_0x36b0('0x3'));var moment=require(_0x36b0('0x4'));var BPromise=require(_0x36b0('0x5'));var rp=require(_0x36b0('0x6'));var fs=require('fs');var path=require(_0x36b0('0x7'));var rimraf=require('rimraf');var config=require(_0x36b0('0x8'));var attributes=require(_0x36b0('0x9'));module[_0x36b0('0xa')]=function(_0x59f170,_0x271a67){return _0x59f170[_0x36b0('0xb')](_0x36b0('0xc'),attributes,{'tableName':_0x36b0('0xd'),'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 1553f9c..620c3bb 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 _0xc737=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','request\x20sent','debug','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','MailServerIn','findAll','options','where','limit','include','map','model','attributes','GetMailServerIn','stringify','lodash'];(function(_0x59175d,_0x431b73){var _0x372dcf=function(_0x32621c){while(--_0x32621c){_0x59175d['push'](_0x59175d['shift']());}};_0x372dcf(++_0x431b73);}(_0xc737,0x154));var _0x7c73=function(_0x10afae,_0x3a08d4){_0x10afae=_0x10afae-0x0;var _0x5c2718=_0xc737[_0x10afae];return _0x5c2718;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var moment=require(_0x7c73('0x2'));var BPromise=require(_0x7c73('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c73('0x4'));var db=require(_0x7c73('0x5'))['db'];var utils=require(_0x7c73('0x6'));var logger=require('../../config/logger')(_0x7c73('0x7'));var config=require(_0x7c73('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f6f81,_0x57e442,_0x9264a9){return new BPromise(function(_0x3281fe,_0x5bf225){return client['request'](_0x3f6f81,_0x9264a9)[_0x7c73('0xa')](function(_0x8237f){logger[_0x7c73('0xb')]('MailServerIn,\x20%s,\x20%s',_0x57e442,_0x7c73('0xc'));logger[_0x7c73('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x57e442,_0x7c73('0xc'),JSON['stringify'](_0x8237f));if(_0x8237f[_0x7c73('0xe')]){if(_0x8237f[_0x7c73('0xe')][_0x7c73('0xf')]===0x1f4){logger['error'](_0x7c73('0x10'),_0x57e442,_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);return _0x5bf225(_0x8237f[_0x7c73('0xe')]['message']);}logger[_0x7c73('0xe')]('MailServerIn,\x20%s,\x20%s',_0x57e442,_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);return _0x3281fe(_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);}else{logger[_0x7c73('0xb')](_0x7c73('0x10'),_0x57e442,_0x7c73('0xc'));_0x3281fe(_0x8237f[_0x7c73('0x12')]['message']);}})[_0x7c73('0x13')](function(_0x562b50){logger[_0x7c73('0xe')](_0x7c73('0x10'),_0x57e442,_0x562b50);_0x5bf225(_0x562b50);});});}exports['GetMailServerIn']=function(_0x534a39){var _0x1932c2=this;return new Promise(function(_0x4a2ebc,_0x5cc261){return db[_0x7c73('0x14')][_0x7c73('0x15')]({'raw':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x17')]||null:null,'attributes':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')]['attributes']||null:null,'limit':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x18')]||null:null,'include':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x19')]?_[_0x7c73('0x1a')](_0x534a39[_0x7c73('0x16')][_0x7c73('0x19')],function(_0x4c8933){return{'model':db[_0x4c8933[_0x7c73('0x1b')]],'as':_0x4c8933['as'],'attributes':_0x4c8933['attributes'],'include':_0x4c8933[_0x7c73('0x19')]?_['map'](_0x4c8933[_0x7c73('0x19')],function(_0x57dd84){return{'model':db[_0x57dd84[_0x7c73('0x1b')]],'as':_0x57dd84['as'],'attributes':_0x57dd84['attributes'],'include':_0x57dd84[_0x7c73('0x19')]?_[_0x7c73('0x1a')](_0x57dd84[_0x7c73('0x19')],function(_0x5b8bc9){return{'model':db[_0x5b8bc9[_0x7c73('0x1b')]],'as':_0x5b8bc9['as'],'attributes':_0x5b8bc9[_0x7c73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7c73('0xa')](function(_0x5ad41e){logger[_0x7c73('0xb')](_0x7c73('0x1d'),_0x534a39);logger[_0x7c73('0xd')](_0x7c73('0x1d'),_0x534a39,JSON[_0x7c73('0x1e')](_0x5ad41e));_0x4a2ebc(_0x5ad41e);})[_0x7c73('0x13')](function(_0x5800eb){logger['error']('GetMailServerIn',_0x5800eb[_0x7c73('0x11')],_0x534a39);_0x5cc261(_0x1932c2[_0x7c73('0xe')](0x1f4,_0x5800eb[_0x7c73('0x11')]));});});}; \ No newline at end of file +var _0x851d=['options','raw','where','attributes','limit','include','map','model','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','GetMailServerIn','findAll'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd851('0x0'));var util=require('util');var moment=require(_0xd851('0x1'));var BPromise=require(_0xd851('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd851('0x3'));var db=require(_0xd851('0x4'))['db'];var utils=require(_0xd851('0x5'));var logger=require(_0xd851('0x6'))(_0xd851('0x7'));var config=require(_0xd851('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd851('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b63e4,_0x3d2383,_0x2f9540){return new BPromise(function(_0x60bef0,_0x4554d8){return client['request'](_0x2b63e4,_0x2f9540)[_0xd851('0xa')](function(_0x51bf16){logger[_0xd851('0xb')](_0xd851('0xc'),_0x3d2383,'request\x20sent');logger[_0xd851('0xd')](_0xd851('0xe'),_0x3d2383,_0xd851('0xf'),JSON[_0xd851('0x10')](_0x51bf16));if(_0x51bf16['error']){if(_0x51bf16['error'][_0xd851('0x11')]===0x1f4){logger[_0xd851('0x12')](_0xd851('0xc'),_0x3d2383,_0x51bf16[_0xd851('0x12')]['message']);return _0x4554d8(_0x51bf16[_0xd851('0x12')][_0xd851('0x13')]);}logger['error'](_0xd851('0xc'),_0x3d2383,_0x51bf16[_0xd851('0x12')][_0xd851('0x13')]);return _0x60bef0(_0x51bf16['error'][_0xd851('0x13')]);}else{logger[_0xd851('0xb')](_0xd851('0xc'),_0x3d2383,_0xd851('0xf'));_0x60bef0(_0x51bf16[_0xd851('0x14')][_0xd851('0x13')]);}})['catch'](function(_0x448e31){logger[_0xd851('0x12')](_0xd851('0xc'),_0x3d2383,_0x448e31);_0x4554d8(_0x448e31);});});}exports[_0xd851('0x15')]=function(_0x12b309){var _0x2be9c9=this;return new Promise(function(_0x3559a1,_0x5e7bb0){return db['MailServerIn'][_0xd851('0x16')]({'raw':_0x12b309[_0xd851('0x17')]?_0x12b309[_0xd851('0x17')][_0xd851('0x18')]===undefined?!![]:![]:!![],'where':_0x12b309[_0xd851('0x17')]?_0x12b309[_0xd851('0x17')][_0xd851('0x19')]||null:null,'attributes':_0x12b309[_0xd851('0x17')]?_0x12b309[_0xd851('0x17')][_0xd851('0x1a')]||null:null,'limit':_0x12b309[_0xd851('0x17')]?_0x12b309[_0xd851('0x17')][_0xd851('0x1b')]||null:null,'include':_0x12b309['options']?_0x12b309[_0xd851('0x17')][_0xd851('0x1c')]?_['map'](_0x12b309[_0xd851('0x17')][_0xd851('0x1c')],function(_0x2f888e){return{'model':db[_0x2f888e['model']],'as':_0x2f888e['as'],'attributes':_0x2f888e['attributes'],'include':_0x2f888e['include']?_[_0xd851('0x1d')](_0x2f888e[_0xd851('0x1c')],function(_0x2f2009){return{'model':db[_0x2f2009[_0xd851('0x1e')]],'as':_0x2f2009['as'],'attributes':_0x2f2009[_0xd851('0x1a')],'include':_0x2f2009['include']?_[_0xd851('0x1d')](_0x2f2009['include'],function(_0x412bbc){return{'model':db[_0x412bbc[_0xd851('0x1e')]],'as':_0x412bbc['as'],'attributes':_0x412bbc[_0xd851('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd851('0xa')](function(_0x337da5){logger[_0xd851('0xb')]('GetMailServerIn',_0x12b309);logger[_0xd851('0xd')](_0xd851('0x15'),_0x12b309,JSON[_0xd851('0x10')](_0x337da5));_0x3559a1(_0x337da5);})[_0xd851('0x1f')](function(_0x6c52fb){logger[_0xd851('0x12')](_0xd851('0x15'),_0x6c52fb[_0xd851('0x13')],_0x12b309);_0x5e7bb0(_0x2be9c9[_0xd851('0x12')](0x1f4,_0x6c52fb[_0xd851('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index db80a14..62cd1dd 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 _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(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x25ba2a,_0x406834){_0x25ba2a=_0x25ba2a-0x0;var _0x979e1e=_0x7a54[_0x25ba2a];return _0x979e1e;};'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 diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 0645132..c1fc582 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 _0x1c6c=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x240b0a,_0x50335f){var _0x35346a=function(_0x56d904){while(--_0x56d904){_0x240b0a['push'](_0x240b0a['shift']());}};_0x35346a(++_0x50335f);}(_0x1c6c,0x13f));var _0xc1c6=function(_0x27f941,_0x3a82cc){_0x27f941=_0x27f941-0x0;var _0x14bc85=_0x1c6c[_0x27f941];return _0x14bc85;};'use strict';var Sequelize=require(_0xc1c6('0x0'));module['exports']={'description':{'type':Sequelize[_0xc1c6('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xc1c6('0x1')]},'pass':{'type':Sequelize[_0xc1c6('0x1')]},'port':{'type':Sequelize[_0xc1c6('0x2')]},'secure':{'type':Sequelize[_0xc1c6('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x1673=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x54caec,_0xb1a2ff){var _0x3d564a=function(_0x3263a2){while(--_0x3263a2){_0x54caec['push'](_0x54caec['shift']());}};_0x3d564a(++_0xb1a2ff);}(_0x1673,0xf1));var _0x3167=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1673[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x3167('0x0')]={'description':{'type':Sequelize[_0x3167('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x3167('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3167('0x2')]},'secure':{'type':Sequelize[_0x3167('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x3167('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index d8ba8ac..73077eb 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 _0x87a3=['then','destroy','error','stack','name','index','map','MailServerOut','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','keys','include','options','catch','create','body','find','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update'];(function(_0x40a9c2,_0x449c0e){var _0x4c1cf9=function(_0x2548f5){while(--_0x2548f5){_0x40a9c2['push'](_0x40a9c2['shift']());}};_0x4c1cf9(++_0x449c0e);}(_0x87a3,0x1e9));var _0x387a=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x87a3[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x387a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x387a('0x1'));var moment=require(_0x387a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x387a('0x3'));var util=require(_0x387a('0x4'));var path=require(_0x387a('0x5'));var sox=require(_0x387a('0x6'));var csv=require(_0x387a('0x7'));var ejs=require(_0x387a('0x8'));var fs=require('fs');var fs_extra=require(_0x387a('0x9'));var _=require(_0x387a('0xa'));var squel=require(_0x387a('0xb'));var crypto=require('crypto');var jsforce=require(_0x387a('0xc'));var deskjs=require(_0x387a('0xd'));var toCsv=require(_0x387a('0x7'));var querystring=require(_0x387a('0xe'));var Papa=require(_0x387a('0xf'));var Redis=require(_0x387a('0x10'));var authService=require(_0x387a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x387a('0x12'));var logger=require(_0x387a('0x13'))(_0x387a('0x14'));var utils=require('../../config/utils');var config=require(_0x387a('0x15'));var licenseUtil=require(_0x387a('0x16'));var db=require(_0x387a('0x17'))['db'];function respondWithStatusCode(_0x8d6ff8,_0x8d4e38){_0x8d4e38=_0x8d4e38||0xcc;return function(_0x4f9478){if(_0x4f9478){return _0x8d6ff8[_0x387a('0x18')](_0x8d4e38);}return _0x8d6ff8[_0x387a('0x19')](_0x8d4e38)[_0x387a('0x1a')]();};}function respondWithResult(_0x4b7577,_0x15932f){_0x15932f=_0x15932f||0xc8;return function(_0x4a74ff){if(_0x4a74ff){return _0x4b7577[_0x387a('0x19')](_0x15932f)[_0x387a('0x1b')](_0x4a74ff);}};}function respondWithFilteredResult(_0x5e2eef,_0x1025a5){return function(_0x1936b9){if(_0x1936b9){var _0x374a75=typeof _0x1025a5[_0x387a('0x1c')]==='undefined'&&typeof _0x1025a5[_0x387a('0x1d')]===_0x387a('0x1e');var _0x4c49bf=_0x1936b9[_0x387a('0x1f')];var _0x433ac6=_0x374a75?0x0:_0x1025a5[_0x387a('0x1c')];var _0x591dbf=_0x374a75?_0x1936b9[_0x387a('0x1f')]:_0x1025a5[_0x387a('0x1c')]+_0x1025a5[_0x387a('0x1d')];var _0x54fab2;if(_0x591dbf>=_0x4c49bf){_0x591dbf=_0x4c49bf;_0x54fab2=0xc8;}else{_0x54fab2=0xce;}_0x5e2eef[_0x387a('0x19')](_0x54fab2);return _0x5e2eef['set']('Content-Range',_0x433ac6+'-'+_0x591dbf+'/'+_0x4c49bf)['json'](_0x1936b9);}return null;};}function patchUpdates(_0x4f7c9e){return function(_0x45e983){try{jsonpatch[_0x387a('0x20')](_0x45e983,_0x4f7c9e,!![]);}catch(_0x5e3a85){return BPromise[_0x387a('0x21')](_0x5e3a85);}return _0x45e983[_0x387a('0x22')]();};}function saveUpdates(_0x58e5d7,_0x83cd35){return function(_0x1a015a){if(_0x1a015a){return _0x1a015a[_0x387a('0x23')](_0x58e5d7)[_0x387a('0x24')](function(_0x29aae1){return _0x29aae1;});}return null;};}function removeEntity(_0x231db0,_0x2df3ee){return function(_0x262b4e){if(_0x262b4e){return _0x262b4e[_0x387a('0x25')]()[_0x387a('0x24')](function(){_0x231db0[_0x387a('0x19')](0xcc)[_0x387a('0x1a')]();});}};}function handleEntityNotFound(_0xc79057,_0x31fae3){return function(_0x190028){if(!_0x190028){_0xc79057[_0x387a('0x18')](0x194);}return _0x190028;};}function handleError(_0x41a770,_0xe46590){_0xe46590=_0xe46590||0x1f4;return function(_0x492a12){logger[_0x387a('0x26')](_0x492a12[_0x387a('0x27')]);if(_0x492a12['name']){delete _0x492a12[_0x387a('0x28')];}_0x41a770[_0x387a('0x19')](_0xe46590)['send'](_0x492a12);};}exports[_0x387a('0x29')]=function(_0x6aaafc,_0xa738b8){var _0xf4c6d2={},_0x5118ce={},_0x682332={'count':0x0,'rows':[]};var _0x578b95=_[_0x387a('0x2a')](db[_0x387a('0x2b')][_0x387a('0x2c')],function(_0x3b3a6e){return{'name':_0x3b3a6e['fieldName'],'type':_0x3b3a6e[_0x387a('0x2d')][_0x387a('0x2e')]};});_0x5118ce['model']=_[_0x387a('0x2a')](_0x578b95,'name');_0x5118ce[_0x387a('0x2f')]=_['keys'](_0x6aaafc[_0x387a('0x2f')]);_0x5118ce[_0x387a('0x30')]=_[_0x387a('0x31')](_0x5118ce[_0x387a('0x32')],_0x5118ce['query']);_0xf4c6d2[_0x387a('0x33')]=_[_0x387a('0x31')](_0x5118ce['model'],qs[_0x387a('0x34')](_0x6aaafc['query'][_0x387a('0x34')]));_0xf4c6d2[_0x387a('0x33')]=_0xf4c6d2[_0x387a('0x33')][_0x387a('0x35')]?_0xf4c6d2[_0x387a('0x33')]:_0x5118ce[_0x387a('0x32')];if(!_0x6aaafc[_0x387a('0x2f')][_0x387a('0x36')](_0x387a('0x37'))){_0xf4c6d2[_0x387a('0x1d')]=qs[_0x387a('0x1d')](_0x6aaafc['query'][_0x387a('0x1d')]);_0xf4c6d2[_0x387a('0x1c')]=qs[_0x387a('0x1c')](_0x6aaafc[_0x387a('0x2f')][_0x387a('0x1c')]);}_0xf4c6d2[_0x387a('0x38')]=qs['sort'](_0x6aaafc[_0x387a('0x2f')][_0x387a('0x39')]);_0xf4c6d2[_0x387a('0x3a')]=qs['filters'](_[_0x387a('0x3b')](_0x6aaafc[_0x387a('0x2f')],_0x5118ce[_0x387a('0x30')]),_0x578b95);if(_0x6aaafc[_0x387a('0x2f')][_0x387a('0x3c')]){_0xf4c6d2[_0x387a('0x3a')]=_[_0x387a('0x3d')](_0xf4c6d2[_0x387a('0x3a')],{'$or':_['map'](_0x578b95,function(_0x5170f5){if(_0x5170f5[_0x387a('0x2d')]!==_0x387a('0x3e')){var _0x1cb7ca={};_0x1cb7ca[_0x5170f5['name']]={'$like':'%'+_0x6aaafc[_0x387a('0x2f')]['filter']+'%'};return _0x1cb7ca;}})});}_0xf4c6d2=_[_0x387a('0x3d')]({},_0xf4c6d2,_0x6aaafc['options']);var _0x20df07={'where':_0xf4c6d2[_0x387a('0x3a')]};return db[_0x387a('0x2b')][_0x387a('0x1f')](_0x20df07)['then'](function(_0x362083){_0x682332['count']=_0x362083;if(_0x6aaafc[_0x387a('0x2f')][_0x387a('0x3f')]){_0xf4c6d2['include']=[{'all':!![]}];}return db['MailServerOut'][_0x387a('0x40')](_0xf4c6d2);})[_0x387a('0x24')](function(_0x5a45b5){_0x682332[_0x387a('0x41')]=_0x5a45b5;return _0x682332;})[_0x387a('0x24')](respondWithFilteredResult(_0xa738b8,_0xf4c6d2))['catch'](handleError(_0xa738b8,null));};exports[_0x387a('0x42')]=function(_0xf7f2e7,_0x4e6614){var _0x233a50={'raw':!![],'where':{'id':_0xf7f2e7[_0x387a('0x43')]['id']}},_0x20461a={};_0x20461a['model']=_[_0x387a('0x44')](db['MailServerOut']['rawAttributes']);_0x20461a[_0x387a('0x2f')]=_[_0x387a('0x44')](_0xf7f2e7[_0x387a('0x2f')]);_0x20461a['filters']=_[_0x387a('0x31')](_0x20461a[_0x387a('0x32')],_0x20461a[_0x387a('0x2f')]);_0x233a50[_0x387a('0x33')]=_[_0x387a('0x31')](_0x20461a['model'],qs[_0x387a('0x34')](_0xf7f2e7[_0x387a('0x2f')][_0x387a('0x34')]));_0x233a50[_0x387a('0x33')]=_0x233a50[_0x387a('0x33')][_0x387a('0x35')]?_0x233a50['attributes']:_0x20461a[_0x387a('0x32')];if(_0xf7f2e7['query'][_0x387a('0x3f')]){_0x233a50[_0x387a('0x45')]=[{'all':!![]}];}_0x233a50=_[_0x387a('0x3d')]({},_0x233a50,_0xf7f2e7[_0x387a('0x46')]);return db['MailServerOut']['find'](_0x233a50)['then'](handleEntityNotFound(_0x4e6614,null))[_0x387a('0x24')](respondWithResult(_0x4e6614,null))[_0x387a('0x47')](handleError(_0x4e6614,null));};exports[_0x387a('0x48')]=function(_0x4ba864,_0x4f2046){return db[_0x387a('0x2b')][_0x387a('0x48')](_0x4ba864['body'],{})['then'](respondWithResult(_0x4f2046,0xc9))[_0x387a('0x47')](handleError(_0x4f2046,null));};exports['update']=function(_0x136c39,_0x495298){if(_0x136c39[_0x387a('0x49')]['id']){delete _0x136c39[_0x387a('0x49')]['id'];}return db[_0x387a('0x2b')][_0x387a('0x4a')]({'where':{'id':_0x136c39[_0x387a('0x43')]['id']}})[_0x387a('0x24')](handleEntityNotFound(_0x495298,null))[_0x387a('0x24')](saveUpdates(_0x136c39['body'],null))['then'](respondWithResult(_0x495298,null))['catch'](handleError(_0x495298,null));};exports[_0x387a('0x25')]=function(_0x4b7379,_0x45ad13){return db[_0x387a('0x2b')][_0x387a('0x4a')]({'where':{'id':_0x4b7379[_0x387a('0x43')]['id']}})['then'](handleEntityNotFound(_0x45ad13,null))[_0x387a('0x24')](removeEntity(_0x45ad13,null))[_0x387a('0x47')](handleError(_0x45ad13,null));}; \ No newline at end of file +var _0x2f0a=['attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','MailServerOut','includeAll','include','findAll','rows','catch','params','keys','filters','options','find','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection'];(function(_0x4da6ba,_0x554ea7){var _0x4b8317=function(_0x573de2){while(--_0x573de2){_0x4da6ba['push'](_0x4da6ba['shift']());}};_0x4b8317(++_0x554ea7);}(_0x2f0a,0x148));var _0xa2f0=function(_0x357f44,_0x4c0d19){_0x357f44=_0x357f44-0x0;var _0x5d4680=_0x2f0a[_0x357f44];return _0x5d4680;};'use strict';var emlformat=require(_0xa2f0('0x0'));var rimraf=require(_0xa2f0('0x1'));var zipdir=require(_0xa2f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa2f0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa2f0('0x4'));var util=require(_0xa2f0('0x5'));var path=require(_0xa2f0('0x6'));var sox=require(_0xa2f0('0x7'));var csv=require(_0xa2f0('0x8'));var ejs=require(_0xa2f0('0x9'));var fs=require('fs');var fs_extra=require(_0xa2f0('0xa'));var _=require(_0xa2f0('0xb'));var squel=require(_0xa2f0('0xc'));var crypto=require('crypto');var jsforce=require(_0xa2f0('0xd'));var deskjs=require(_0xa2f0('0xe'));var toCsv=require(_0xa2f0('0x8'));var querystring=require(_0xa2f0('0xf'));var Papa=require(_0xa2f0('0x10'));var Redis=require(_0xa2f0('0x11'));var authService=require(_0xa2f0('0x12'));var qs=require(_0xa2f0('0x13'));var as=require(_0xa2f0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa2f0('0x15'));var utils=require(_0xa2f0('0x16'));var config=require(_0xa2f0('0x17'));var licenseUtil=require(_0xa2f0('0x18'));var db=require(_0xa2f0('0x19'))['db'];function respondWithStatusCode(_0xebeb3e,_0x5a99e8){_0x5a99e8=_0x5a99e8||0xcc;return function(_0x4b72c4){if(_0x4b72c4){return _0xebeb3e[_0xa2f0('0x1a')](_0x5a99e8);}return _0xebeb3e[_0xa2f0('0x1b')](_0x5a99e8)[_0xa2f0('0x1c')]();};}function respondWithResult(_0x2c3f5c,_0x1094b0){_0x1094b0=_0x1094b0||0xc8;return function(_0x2875fb){if(_0x2875fb){return _0x2c3f5c['status'](_0x1094b0)[_0xa2f0('0x1d')](_0x2875fb);}};}function respondWithFilteredResult(_0x89ed15,_0x48407d){return function(_0x353566){if(_0x353566){var _0x60c7d7=typeof _0x48407d['offset']===_0xa2f0('0x1e')&&typeof _0x48407d[_0xa2f0('0x1f')]===_0xa2f0('0x1e');var _0x48501e=_0x353566[_0xa2f0('0x20')];var _0x5f0a3b=_0x60c7d7?0x0:_0x48407d[_0xa2f0('0x21')];var _0x4ccf6f=_0x60c7d7?_0x353566[_0xa2f0('0x20')]:_0x48407d[_0xa2f0('0x21')]+_0x48407d[_0xa2f0('0x1f')];var _0x3bdceb;if(_0x4ccf6f>=_0x48501e){_0x4ccf6f=_0x48501e;_0x3bdceb=0xc8;}else{_0x3bdceb=0xce;}_0x89ed15[_0xa2f0('0x1b')](_0x3bdceb);return _0x89ed15['set'](_0xa2f0('0x22'),_0x5f0a3b+'-'+_0x4ccf6f+'/'+_0x48501e)[_0xa2f0('0x1d')](_0x353566);}return null;};}function patchUpdates(_0x5b7e36){return function(_0x408dc7){try{jsonpatch[_0xa2f0('0x23')](_0x408dc7,_0x5b7e36,!![]);}catch(_0x4c4571){return BPromise[_0xa2f0('0x24')](_0x4c4571);}return _0x408dc7[_0xa2f0('0x25')]();};}function saveUpdates(_0x3ae04f,_0x2e67bb){return function(_0x2b7ef9){if(_0x2b7ef9){return _0x2b7ef9[_0xa2f0('0x26')](_0x3ae04f)[_0xa2f0('0x27')](function(_0x2f6459){return _0x2f6459;});}return null;};}function removeEntity(_0x325caf,_0x59105a){return function(_0x4a11ee){if(_0x4a11ee){return _0x4a11ee[_0xa2f0('0x28')]()[_0xa2f0('0x27')](function(){_0x325caf[_0xa2f0('0x1b')](0xcc)[_0xa2f0('0x1c')]();});}};}function handleEntityNotFound(_0x146869,_0x13399e){return function(_0x285174){if(!_0x285174){_0x146869[_0xa2f0('0x1a')](0x194);}return _0x285174;};}function handleError(_0x2c79d0,_0x4890b4){_0x4890b4=_0x4890b4||0x1f4;return function(_0x11faf2){logger['error'](_0x11faf2[_0xa2f0('0x29')]);if(_0x11faf2['name']){delete _0x11faf2[_0xa2f0('0x2a')];}_0x2c79d0[_0xa2f0('0x1b')](_0x4890b4)[_0xa2f0('0x2b')](_0x11faf2);};}exports['index']=function(_0xd635a,_0x285967){var _0xe4410c={},_0x59a259={},_0x1f831c={'count':0x0,'rows':[]};var _0x3c8e67=_[_0xa2f0('0x2c')](db['MailServerOut'][_0xa2f0('0x2d')],function(_0x333aae){return{'name':_0x333aae[_0xa2f0('0x2e')],'type':_0x333aae[_0xa2f0('0x2f')][_0xa2f0('0x30')]};});_0x59a259[_0xa2f0('0x31')]=_[_0xa2f0('0x2c')](_0x3c8e67,_0xa2f0('0x2a'));_0x59a259[_0xa2f0('0x32')]=_['keys'](_0xd635a[_0xa2f0('0x32')]);_0x59a259['filters']=_[_0xa2f0('0x33')](_0x59a259['model'],_0x59a259['query']);_0xe4410c[_0xa2f0('0x34')]=_['intersection'](_0x59a259[_0xa2f0('0x31')],qs[_0xa2f0('0x35')](_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x35')]));_0xe4410c['attributes']=_0xe4410c[_0xa2f0('0x34')][_0xa2f0('0x36')]?_0xe4410c[_0xa2f0('0x34')]:_0x59a259[_0xa2f0('0x31')];if(!_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x37')](_0xa2f0('0x38'))){_0xe4410c[_0xa2f0('0x1f')]=qs[_0xa2f0('0x1f')](_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x1f')]);_0xe4410c[_0xa2f0('0x21')]=qs[_0xa2f0('0x21')](_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x21')]);}_0xe4410c[_0xa2f0('0x39')]=qs['sort'](_0xd635a[_0xa2f0('0x32')]['sort']);_0xe4410c[_0xa2f0('0x3a')]=qs['filters'](_[_0xa2f0('0x3b')](_0xd635a[_0xa2f0('0x32')],_0x59a259['filters']),_0x3c8e67);if(_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x3c')]){_0xe4410c[_0xa2f0('0x3a')]=_[_0xa2f0('0x3d')](_0xe4410c[_0xa2f0('0x3a')],{'$or':_[_0xa2f0('0x2c')](_0x3c8e67,function(_0x5790a7){if(_0x5790a7[_0xa2f0('0x2f')]!==_0xa2f0('0x3e')){var _0x2cddbd={};_0x2cddbd[_0x5790a7[_0xa2f0('0x2a')]]={'$like':'%'+_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x3c')]+'%'};return _0x2cddbd;}})});}_0xe4410c=_[_0xa2f0('0x3d')]({},_0xe4410c,_0xd635a['options']);var _0x410b01={'where':_0xe4410c[_0xa2f0('0x3a')]};return db[_0xa2f0('0x3f')][_0xa2f0('0x20')](_0x410b01)[_0xa2f0('0x27')](function(_0x5a10af){_0x1f831c[_0xa2f0('0x20')]=_0x5a10af;if(_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x40')]){_0xe4410c[_0xa2f0('0x41')]=[{'all':!![]}];}return db[_0xa2f0('0x3f')][_0xa2f0('0x42')](_0xe4410c);})[_0xa2f0('0x27')](function(_0x273d69){_0x1f831c[_0xa2f0('0x43')]=_0x273d69;return _0x1f831c;})[_0xa2f0('0x27')](respondWithFilteredResult(_0x285967,_0xe4410c))[_0xa2f0('0x44')](handleError(_0x285967,null));};exports['show']=function(_0x1cb61a,_0x2bad9e){var _0x2b45ed={'raw':!![],'where':{'id':_0x1cb61a[_0xa2f0('0x45')]['id']}},_0x112cdd={};_0x112cdd[_0xa2f0('0x31')]=_[_0xa2f0('0x46')](db[_0xa2f0('0x3f')]['rawAttributes']);_0x112cdd[_0xa2f0('0x32')]=_[_0xa2f0('0x46')](_0x1cb61a['query']);_0x112cdd[_0xa2f0('0x47')]=_[_0xa2f0('0x33')](_0x112cdd['model'],_0x112cdd[_0xa2f0('0x32')]);_0x2b45ed[_0xa2f0('0x34')]=_[_0xa2f0('0x33')](_0x112cdd[_0xa2f0('0x31')],qs[_0xa2f0('0x35')](_0x1cb61a[_0xa2f0('0x32')]['fields']));_0x2b45ed[_0xa2f0('0x34')]=_0x2b45ed[_0xa2f0('0x34')][_0xa2f0('0x36')]?_0x2b45ed[_0xa2f0('0x34')]:_0x112cdd[_0xa2f0('0x31')];if(_0x1cb61a['query'][_0xa2f0('0x40')]){_0x2b45ed[_0xa2f0('0x41')]=[{'all':!![]}];}_0x2b45ed=_[_0xa2f0('0x3d')]({},_0x2b45ed,_0x1cb61a[_0xa2f0('0x48')]);return db[_0xa2f0('0x3f')][_0xa2f0('0x49')](_0x2b45ed)[_0xa2f0('0x27')](handleEntityNotFound(_0x2bad9e,null))[_0xa2f0('0x27')](respondWithResult(_0x2bad9e,null))[_0xa2f0('0x44')](handleError(_0x2bad9e,null));};exports[_0xa2f0('0x4a')]=function(_0x154b60,_0x45bd5c){return db['MailServerOut'][_0xa2f0('0x4a')](_0x154b60[_0xa2f0('0x4b')],{})['then'](respondWithResult(_0x45bd5c,0xc9))['catch'](handleError(_0x45bd5c,null));};exports[_0xa2f0('0x26')]=function(_0x18877c,_0x4ac620){if(_0x18877c[_0xa2f0('0x4b')]['id']){delete _0x18877c[_0xa2f0('0x4b')]['id'];}return db[_0xa2f0('0x3f')][_0xa2f0('0x49')]({'where':{'id':_0x18877c[_0xa2f0('0x45')]['id']}})[_0xa2f0('0x27')](handleEntityNotFound(_0x4ac620,null))[_0xa2f0('0x27')](saveUpdates(_0x18877c[_0xa2f0('0x4b')],null))[_0xa2f0('0x27')](respondWithResult(_0x4ac620,null))[_0xa2f0('0x44')](handleError(_0x4ac620,null));};exports[_0xa2f0('0x28')]=function(_0x27bc8a,_0x59de78){return db[_0xa2f0('0x3f')][_0xa2f0('0x49')]({'where':{'id':_0x27bc8a[_0xa2f0('0x45')]['id']}})[_0xa2f0('0x27')](handleEntityNotFound(_0x59de78,null))[_0xa2f0('0x27')](removeEntity(_0x59de78,null))[_0xa2f0('0x44')](handleError(_0x59de78,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 146a773..e70806e 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 _0x840f=['exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x29ab1e,_0x398ec2){var _0x1bffd8=function(_0x26621c){while(--_0x26621c){_0x29ab1e['push'](_0x29ab1e['shift']());}};_0x1bffd8(++_0x398ec2);}(_0x840f,0x1cc));var _0xf840=function(_0x8e1ff1,_0x24381a){_0x8e1ff1=_0x8e1ff1-0x0;var _0xe5d601=_0x840f[_0x8e1ff1];return _0xe5d601;};'use strict';var _=require(_0xf840('0x0'));var util=require(_0xf840('0x1'));var logger=require(_0xf840('0x2'))(_0xf840('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf840('0x4'));var fs=require('fs');var path=require(_0xf840('0x5'));var rimraf=require(_0xf840('0x6'));var config=require(_0xf840('0x7'));var attributes=require('./mailServerOut.attributes');module[_0xf840('0x8')]=function(_0x11567b,_0x1ffef2){return _0x11567b[_0xf840('0x9')](_0xf840('0xa'),attributes,{'tableName':_0xf840('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8337=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','mail_servers_out'];(function(_0x13a1ff,_0x43588e){var _0x33477c=function(_0x519b21){while(--_0x519b21){_0x13a1ff['push'](_0x13a1ff['shift']());}};_0x33477c(++_0x43588e);}(_0x8337,0x84));var _0x7833=function(_0x13c787,_0x3fa0eb){_0x13c787=_0x13c787-0x0;var _0x1a0324=_0x8337[_0x13c787];return _0x1a0324;};'use strict';var _=require('lodash');var util=require(_0x7833('0x0'));var logger=require(_0x7833('0x1'))(_0x7833('0x2'));var moment=require(_0x7833('0x3'));var BPromise=require('bluebird');var rp=require(_0x7833('0x4'));var fs=require('fs');var path=require(_0x7833('0x5'));var rimraf=require(_0x7833('0x6'));var config=require(_0x7833('0x7'));var attributes=require(_0x7833('0x8'));module[_0x7833('0x9')]=function(_0x47e389,_0x3ffb91){return _0x47e389['define']('MailServerOut',attributes,{'tableName':_0x7833('0xa'),'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 03bcef0..98d556d 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x18d48d,_0x2ff7ab){var _0x4ce6a3=function(_0x5e32f3){while(--_0x5e32f3){_0x18d48d['push'](_0x18d48d['shift']());}};_0x4ce6a3(++_0x2ff7ab);}(_0x5f2f,0x73));var _0xf5f2=function(_0xbbce8,_0x1b0c1d){_0xbbce8=_0xbbce8-0x0;var _0x4c6b0f=_0x5f2f[_0xbbce8];return _0x4c6b0f;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _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(_0x598efc,_0x5e971c){var _0x435e4f=function(_0x3e0596){while(--_0x3e0596){_0x598efc['push'](_0x598efc['shift']());}};_0x435e4f(++_0x5e971c);}(_0xadb5,0xad));var _0x5adb=function(_0x429ffc,_0x549dd6){_0x429ffc=_0x429ffc-0x0;var _0x44b539=_0xadb5[_0x429ffc];return _0x44b539;};'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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 1545ca5..99344a2 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 _0xb966=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/:id','show','post','create','put','exports','multer','path','connect-timeout'];(function(_0x66b9f9,_0x32d667){var _0x241ce9=function(_0x2b3426){while(--_0x2b3426){_0x66b9f9['push'](_0x66b9f9['shift']());}};_0x241ce9(++_0x32d667);}(_0xb966,0xc3));var _0x6b96=function(_0x3d6011,_0x10fbc7){_0x3d6011=_0x3d6011-0x0;var _0x181b1a=_0xb966[_0x3d6011];return _0x181b1a;};'use strict';var multer=require(_0x6b96('0x0'));var util=require('util');var path=require(_0x6b96('0x1'));var timeout=require(_0x6b96('0x2'));var express=require(_0x6b96('0x3'));var router=express[_0x6b96('0x4')]();var fs_extra=require(_0x6b96('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6b96('0x6'));var config=require(_0x6b96('0x7'));var controller=require(_0x6b96('0x8'));router[_0x6b96('0x9')]('/',auth[_0x6b96('0xa')](),controller[_0x6b96('0xb')]);router[_0x6b96('0x9')]('/describe',auth[_0x6b96('0xa')](),controller['describe']);router[_0x6b96('0x9')](_0x6b96('0xc'),auth[_0x6b96('0xa')](),controller[_0x6b96('0xd')]);router[_0x6b96('0xe')]('/',auth[_0x6b96('0xa')](),controller[_0x6b96('0xf')]);router[_0x6b96('0x10')](_0x6b96('0xc'),auth[_0x6b96('0xa')](),controller['update']);router['delete'](_0x6b96('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x6b96('0x11')]=router; \ No newline at end of file +var _0xab60=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2b2d29,_0x126419){var _0x3c370a=function(_0x9d5e54){while(--_0x9d5e54){_0x2b2d29['push'](_0x2b2d29['shift']());}};_0x3c370a(++_0x126419);}(_0xab60,0x1f4));var _0x0ab6=function(_0x399869,_0x11b444){_0x399869=_0x399869-0x0;var _0x4ff731=_0xab60[_0x399869];return _0x4ff731;};'use strict';var multer=require(_0x0ab6('0x0'));var util=require(_0x0ab6('0x1'));var path=require(_0x0ab6('0x2'));var timeout=require(_0x0ab6('0x3'));var express=require(_0x0ab6('0x4'));var router=express[_0x0ab6('0x5')]();var fs_extra=require(_0x0ab6('0x6'));var auth=require(_0x0ab6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0ab6('0x8'));var controller=require('./mailSubstatus.controller');router[_0x0ab6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0ab6('0xa'),auth[_0x0ab6('0xb')](),controller[_0x0ab6('0xc')]);router['get'](_0x0ab6('0xd'),auth[_0x0ab6('0xb')](),controller[_0x0ab6('0xe')]);router[_0x0ab6('0xf')]('/',auth[_0x0ab6('0xb')](),controller[_0x0ab6('0x10')]);router[_0x0ab6('0x11')](_0x0ab6('0xd'),auth[_0x0ab6('0xb')](),controller['update']);router[_0x0ab6('0x12')](_0x0ab6('0xd'),auth['isAuthenticated'](),controller[_0x0ab6('0x13')]);module[_0x0ab6('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 627bfab..3f13e0c 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 _0x323f=['name','STRING','exports'];(function(_0x2f4311,_0xd2d511){var _0x309ccb=function(_0x3ddf5c){while(--_0x3ddf5c){_0x2f4311['push'](_0x2f4311['shift']());}};_0x309ccb(++_0xd2d511);}(_0x323f,0x1ee));var _0xf323=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x323f[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0xf323('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf323('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf323('0x2')]}}; \ No newline at end of file +var _0xe944=['sequelize','name'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe944,0x174));var _0x4e94=function(_0x436a9a,_0x13a559){_0x436a9a=_0x436a9a-0x0;var _0x49279b=_0xe944[_0x436a9a];return _0x49279b;};'use strict';var Sequelize=require(_0x4e94('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4e94('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index ca7d453..1741ebf 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 _0x9214=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path'];(function(_0xd739b,_0x1b7978){var _0x2391ed=function(_0x2e6f74){while(--_0x2e6f74){_0xd739b['push'](_0xd739b['shift']());}};_0x2391ed(++_0x1b7978);}(_0x9214,0x8c));var _0x4921=function(_0x682183,_0x278f1b){_0x682183=_0x682183-0x0;var _0x20682d=_0x9214[_0x682183];return _0x20682d;};'use strict';var emlformat=require(_0x4921('0x0'));var rimraf=require(_0x4921('0x1'));var zipdir=require(_0x4921('0x2'));var jsonpatch=require(_0x4921('0x3'));var rp=require('request-promise');var moment=require(_0x4921('0x4'));var BPromise=require(_0x4921('0x5'));var Mustache=require('mustache');var util=require(_0x4921('0x6'));var path=require(_0x4921('0x7'));var sox=require(_0x4921('0x8'));var csv=require('to-csv');var ejs=require(_0x4921('0x9'));var fs=require('fs');var fs_extra=require(_0x4921('0xa'));var _=require(_0x4921('0xb'));var squel=require(_0x4921('0xc'));var crypto=require(_0x4921('0xd'));var jsforce=require(_0x4921('0xe'));var deskjs=require(_0x4921('0xf'));var toCsv=require(_0x4921('0x10'));var querystring=require('querystring');var Papa=require(_0x4921('0x11'));var Redis=require(_0x4921('0x12'));var authService=require(_0x4921('0x13'));var qs=require(_0x4921('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4921('0x15'));var logger=require(_0x4921('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4921('0x17'));var licenseUtil=require(_0x4921('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcafa32,_0x507c89){_0x507c89=_0x507c89||0xcc;return function(_0x28563f){if(_0x28563f){return _0xcafa32[_0x4921('0x19')](_0x507c89);}return _0xcafa32[_0x4921('0x1a')](_0x507c89)[_0x4921('0x1b')]();};}function respondWithResult(_0x4488d4,_0x194e0e){_0x194e0e=_0x194e0e||0xc8;return function(_0x586a5e){if(_0x586a5e){return _0x4488d4[_0x4921('0x1a')](_0x194e0e)[_0x4921('0x1c')](_0x586a5e);}};}function respondWithFilteredResult(_0x4b3715,_0x4aa7c1){return function(_0x5dbee4){if(_0x5dbee4){var _0x18f35a=typeof _0x4aa7c1[_0x4921('0x1d')]===_0x4921('0x1e')&&typeof _0x4aa7c1[_0x4921('0x1f')]==='undefined';var _0x1c1e3d=_0x5dbee4[_0x4921('0x20')];var _0x128ab4=_0x18f35a?0x0:_0x4aa7c1[_0x4921('0x1d')];var _0x2e08fb=_0x18f35a?_0x5dbee4[_0x4921('0x20')]:_0x4aa7c1[_0x4921('0x1d')]+_0x4aa7c1[_0x4921('0x1f')];var _0x121b79;if(_0x2e08fb>=_0x1c1e3d){_0x2e08fb=_0x1c1e3d;_0x121b79=0xc8;}else{_0x121b79=0xce;}_0x4b3715[_0x4921('0x1a')](_0x121b79);return _0x4b3715[_0x4921('0x21')](_0x4921('0x22'),_0x128ab4+'-'+_0x2e08fb+'/'+_0x1c1e3d)['json'](_0x5dbee4);}return null;};}function patchUpdates(_0x385d3c){return function(_0x28bee8){try{jsonpatch['apply'](_0x28bee8,_0x385d3c,!![]);}catch(_0x1f6ce1){return BPromise[_0x4921('0x23')](_0x1f6ce1);}return _0x28bee8['save']();};}function saveUpdates(_0x32c437,_0x456f5f){return function(_0x1587e7){if(_0x1587e7){return _0x1587e7['update'](_0x32c437)[_0x4921('0x24')](function(_0xab9996){return _0xab9996;});}return null;};}function removeEntity(_0x4bd9b0,_0x93c0b){return function(_0x28ab04){if(_0x28ab04){return _0x28ab04[_0x4921('0x25')]()['then'](function(){_0x4bd9b0[_0x4921('0x1a')](0xcc)[_0x4921('0x1b')]();});}};}function handleEntityNotFound(_0x2d60c9,_0x148615){return function(_0x4128b9){if(!_0x4128b9){_0x2d60c9[_0x4921('0x19')](0x194);}return _0x4128b9;};}function handleError(_0x26488f,_0xaef70d){_0xaef70d=_0xaef70d||0x1f4;return function(_0x586fc1){logger['error'](_0x586fc1['stack']);if(_0x586fc1[_0x4921('0x26')]){delete _0x586fc1[_0x4921('0x26')];}_0x26488f[_0x4921('0x1a')](_0xaef70d)['send'](_0x586fc1);};}exports[_0x4921('0x27')]=function(_0x5a76d2,_0xe92fab){var _0x2c83d7={},_0x37d8bd={},_0x4176de={'count':0x0,'rows':[]};var _0x534762=_[_0x4921('0x28')](db[_0x4921('0x29')][_0x4921('0x2a')],function(_0x293591){return{'name':_0x293591[_0x4921('0x2b')],'type':_0x293591[_0x4921('0x2c')][_0x4921('0x2d')]};});_0x37d8bd['model']=_[_0x4921('0x28')](_0x534762,_0x4921('0x26'));_0x37d8bd[_0x4921('0x2e')]=_['keys'](_0x5a76d2[_0x4921('0x2e')]);_0x37d8bd[_0x4921('0x2f')]=_[_0x4921('0x30')](_0x37d8bd[_0x4921('0x31')],_0x37d8bd[_0x4921('0x2e')]);_0x2c83d7[_0x4921('0x32')]=_[_0x4921('0x30')](_0x37d8bd['model'],qs['fields'](_0x5a76d2[_0x4921('0x2e')]['fields']));_0x2c83d7[_0x4921('0x32')]=_0x2c83d7[_0x4921('0x32')][_0x4921('0x33')]?_0x2c83d7['attributes']:_0x37d8bd['model'];if(!_0x5a76d2[_0x4921('0x2e')]['hasOwnProperty'](_0x4921('0x34'))){_0x2c83d7[_0x4921('0x1f')]=qs[_0x4921('0x1f')](_0x5a76d2[_0x4921('0x2e')][_0x4921('0x1f')]);_0x2c83d7[_0x4921('0x1d')]=qs['offset'](_0x5a76d2[_0x4921('0x2e')][_0x4921('0x1d')]);}_0x2c83d7[_0x4921('0x35')]=qs[_0x4921('0x36')](_0x5a76d2[_0x4921('0x2e')]['sort']);_0x2c83d7[_0x4921('0x37')]=qs[_0x4921('0x2f')](_[_0x4921('0x38')](_0x5a76d2[_0x4921('0x2e')],_0x37d8bd[_0x4921('0x2f')]),_0x534762);if(_0x5a76d2[_0x4921('0x2e')][_0x4921('0x39')]){_0x2c83d7[_0x4921('0x37')]=_[_0x4921('0x3a')](_0x2c83d7[_0x4921('0x37')],{'$or':_[_0x4921('0x28')](_0x534762,function(_0x4eff45){if(_0x4eff45[_0x4921('0x2c')]!==_0x4921('0x3b')){var _0x4c59b1={};_0x4c59b1[_0x4eff45[_0x4921('0x26')]]={'$like':'%'+_0x5a76d2[_0x4921('0x2e')][_0x4921('0x39')]+'%'};return _0x4c59b1;}})});}_0x2c83d7=_['merge']({},_0x2c83d7,_0x5a76d2[_0x4921('0x3c')]);var _0x3ab455={'where':_0x2c83d7[_0x4921('0x37')]};return db['MailSubstatus']['count'](_0x3ab455)['then'](function(_0x453002){_0x4176de['count']=_0x453002;if(_0x5a76d2['query']['includeAll']){_0x2c83d7[_0x4921('0x3d')]=[{'all':!![]}];}return db['MailSubstatus'][_0x4921('0x3e')](_0x2c83d7);})[_0x4921('0x24')](function(_0x42f909){_0x4176de[_0x4921('0x3f')]=_0x42f909;return _0x4176de;})[_0x4921('0x24')](respondWithFilteredResult(_0xe92fab,_0x2c83d7))[_0x4921('0x40')](handleError(_0xe92fab,null));};exports[_0x4921('0x41')]=function(_0x519cf0,_0x2faa74){var _0x2e9801={'raw':!![],'where':{'id':_0x519cf0[_0x4921('0x42')]['id']}},_0x96fb02={};_0x96fb02['model']=_[_0x4921('0x43')](db['MailSubstatus'][_0x4921('0x2a')]);_0x96fb02['query']=_['keys'](_0x519cf0[_0x4921('0x2e')]);_0x96fb02[_0x4921('0x2f')]=_[_0x4921('0x30')](_0x96fb02[_0x4921('0x31')],_0x96fb02[_0x4921('0x2e')]);_0x2e9801[_0x4921('0x32')]=_[_0x4921('0x30')](_0x96fb02[_0x4921('0x31')],qs[_0x4921('0x44')](_0x519cf0['query'][_0x4921('0x44')]));_0x2e9801[_0x4921('0x32')]=_0x2e9801[_0x4921('0x32')][_0x4921('0x33')]?_0x2e9801[_0x4921('0x32')]:_0x96fb02[_0x4921('0x31')];if(_0x519cf0[_0x4921('0x2e')][_0x4921('0x45')]){_0x2e9801[_0x4921('0x3d')]=[{'all':!![]}];}_0x2e9801=_[_0x4921('0x3a')]({},_0x2e9801,_0x519cf0[_0x4921('0x3c')]);return db['MailSubstatus']['find'](_0x2e9801)[_0x4921('0x24')](handleEntityNotFound(_0x2faa74,null))[_0x4921('0x24')](respondWithResult(_0x2faa74,null))[_0x4921('0x40')](handleError(_0x2faa74,null));};exports[_0x4921('0x46')]=function(_0x33107b,_0x136959){return db[_0x4921('0x29')][_0x4921('0x46')](_0x33107b[_0x4921('0x47')],{})[_0x4921('0x24')](respondWithResult(_0x136959,0xc9))[_0x4921('0x40')](handleError(_0x136959,null));};exports['update']=function(_0x391909,_0x589802){if(_0x391909[_0x4921('0x47')]['id']){delete _0x391909['body']['id'];}return db[_0x4921('0x29')][_0x4921('0x48')]({'where':{'id':_0x391909['params']['id']}})[_0x4921('0x24')](handleEntityNotFound(_0x589802,null))['then'](saveUpdates(_0x391909[_0x4921('0x47')],null))[_0x4921('0x24')](respondWithResult(_0x589802,null))['catch'](handleError(_0x589802,null));};exports[_0x4921('0x25')]=function(_0x3d6b7e,_0x3e5aae){return db[_0x4921('0x29')]['find']({'where':{'id':_0x3d6b7e[_0x4921('0x42')]['id']}})[_0x4921('0x24')](handleEntityNotFound(_0x3e5aae,null))['then'](removeEntity(_0x3e5aae,null))['catch'](handleError(_0x3e5aae,null));};exports[_0x4921('0x49')]=function(_0x17366c,_0x3cf888){return db[_0x4921('0x29')][_0x4921('0x49')]()[_0x4921('0x24')](respondWithResult(_0x3cf888,null))[_0x4921('0x40')](handleError(_0x3cf888,null));}; \ No newline at end of file +var _0xd7b0=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','findAll','rows','show','params','rawAttributes','includeAll','include','merge','options','find','catch','create','body','describe','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','MailSubstatus','fieldName','type','model','query','keys','filters'];(function(_0x52d7fe,_0x4792c6){var _0x44b22a=function(_0x22bfca){while(--_0x22bfca){_0x52d7fe['push'](_0x52d7fe['shift']());}};_0x44b22a(++_0x4792c6);}(_0xd7b0,0x139));var _0x0d7b=function(_0x4b236d,_0x5eed49){_0x4b236d=_0x4b236d-0x0;var _0x32420b=_0xd7b0[_0x4b236d];return _0x32420b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0d7b('0x0'));var rp=require(_0x0d7b('0x1'));var moment=require('moment');var BPromise=require(_0x0d7b('0x2'));var Mustache=require(_0x0d7b('0x3'));var util=require(_0x0d7b('0x4'));var path=require(_0x0d7b('0x5'));var sox=require('sox');var csv=require(_0x0d7b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d7b('0x7'));var _=require('lodash');var squel=require(_0x0d7b('0x8'));var crypto=require(_0x0d7b('0x9'));var jsforce=require(_0x0d7b('0xa'));var deskjs=require(_0x0d7b('0xb'));var toCsv=require(_0x0d7b('0x6'));var querystring=require(_0x0d7b('0xc'));var Papa=require(_0x0d7b('0xd'));var Redis=require(_0x0d7b('0xe'));var authService=require(_0x0d7b('0xf'));var qs=require(_0x0d7b('0x10'));var as=require(_0x0d7b('0x11'));var hardwareService=require(_0x0d7b('0x12'));var logger=require(_0x0d7b('0x13'))('api');var utils=require(_0x0d7b('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0d7b('0x15'))['db'];function respondWithStatusCode(_0xc522d3,_0x5c422c){_0x5c422c=_0x5c422c||0xcc;return function(_0x2593ef){if(_0x2593ef){return _0xc522d3[_0x0d7b('0x16')](_0x5c422c);}return _0xc522d3[_0x0d7b('0x17')](_0x5c422c)[_0x0d7b('0x18')]();};}function respondWithResult(_0x5052a7,_0x5d128f){_0x5d128f=_0x5d128f||0xc8;return function(_0x1f3699){if(_0x1f3699){return _0x5052a7[_0x0d7b('0x17')](_0x5d128f)['json'](_0x1f3699);}};}function respondWithFilteredResult(_0x365113,_0x189cee){return function(_0x5bb037){if(_0x5bb037){var _0x321dc5=typeof _0x189cee[_0x0d7b('0x19')]==='undefined'&&typeof _0x189cee[_0x0d7b('0x1a')]==='undefined';var _0x36ad7f=_0x5bb037[_0x0d7b('0x1b')];var _0x1edad1=_0x321dc5?0x0:_0x189cee[_0x0d7b('0x19')];var _0x36a103=_0x321dc5?_0x5bb037[_0x0d7b('0x1b')]:_0x189cee[_0x0d7b('0x19')]+_0x189cee[_0x0d7b('0x1a')];var _0x5c9638;if(_0x36a103>=_0x36ad7f){_0x36a103=_0x36ad7f;_0x5c9638=0xc8;}else{_0x5c9638=0xce;}_0x365113[_0x0d7b('0x17')](_0x5c9638);return _0x365113[_0x0d7b('0x1c')]('Content-Range',_0x1edad1+'-'+_0x36a103+'/'+_0x36ad7f)[_0x0d7b('0x1d')](_0x5bb037);}return null;};}function patchUpdates(_0x218db3){return function(_0x112d12){try{jsonpatch['apply'](_0x112d12,_0x218db3,!![]);}catch(_0x525b43){return BPromise[_0x0d7b('0x1e')](_0x525b43);}return _0x112d12[_0x0d7b('0x1f')]();};}function saveUpdates(_0x126491,_0x53b22c){return function(_0x3e1250){if(_0x3e1250){return _0x3e1250[_0x0d7b('0x20')](_0x126491)[_0x0d7b('0x21')](function(_0x3913ca){return _0x3913ca;});}return null;};}function removeEntity(_0x2c74f9,_0x392334){return function(_0x3bf686){if(_0x3bf686){return _0x3bf686[_0x0d7b('0x22')]()[_0x0d7b('0x21')](function(){_0x2c74f9[_0x0d7b('0x17')](0xcc)[_0x0d7b('0x18')]();});}};}function handleEntityNotFound(_0x5cd6ab,_0x36015e){return function(_0x2894b9){if(!_0x2894b9){_0x5cd6ab[_0x0d7b('0x16')](0x194);}return _0x2894b9;};}function handleError(_0x34c6ea,_0x4da6a1){_0x4da6a1=_0x4da6a1||0x1f4;return function(_0x26b7bd){logger[_0x0d7b('0x23')](_0x26b7bd['stack']);if(_0x26b7bd['name']){delete _0x26b7bd[_0x0d7b('0x24')];}_0x34c6ea[_0x0d7b('0x17')](_0x4da6a1)[_0x0d7b('0x25')](_0x26b7bd);};}exports[_0x0d7b('0x26')]=function(_0x3672f7,_0x1270de){var _0x991640={},_0xe0725d={},_0x285624={'count':0x0,'rows':[]};var _0xd395fe=_[_0x0d7b('0x27')](db[_0x0d7b('0x28')]['rawAttributes'],function(_0xc71f2a){return{'name':_0xc71f2a[_0x0d7b('0x29')],'type':_0xc71f2a[_0x0d7b('0x2a')]['key']};});_0xe0725d[_0x0d7b('0x2b')]=_[_0x0d7b('0x27')](_0xd395fe,_0x0d7b('0x24'));_0xe0725d[_0x0d7b('0x2c')]=_[_0x0d7b('0x2d')](_0x3672f7[_0x0d7b('0x2c')]);_0xe0725d[_0x0d7b('0x2e')]=_['intersection'](_0xe0725d['model'],_0xe0725d[_0x0d7b('0x2c')]);_0x991640[_0x0d7b('0x2f')]=_[_0x0d7b('0x30')](_0xe0725d['model'],qs[_0x0d7b('0x31')](_0x3672f7[_0x0d7b('0x2c')][_0x0d7b('0x31')]));_0x991640['attributes']=_0x991640[_0x0d7b('0x2f')][_0x0d7b('0x32')]?_0x991640[_0x0d7b('0x2f')]:_0xe0725d[_0x0d7b('0x2b')];if(!_0x3672f7[_0x0d7b('0x2c')][_0x0d7b('0x33')](_0x0d7b('0x34'))){_0x991640[_0x0d7b('0x1a')]=qs[_0x0d7b('0x1a')](_0x3672f7['query'][_0x0d7b('0x1a')]);_0x991640[_0x0d7b('0x19')]=qs[_0x0d7b('0x19')](_0x3672f7[_0x0d7b('0x2c')][_0x0d7b('0x19')]);}_0x991640[_0x0d7b('0x35')]=qs[_0x0d7b('0x36')](_0x3672f7[_0x0d7b('0x2c')][_0x0d7b('0x36')]);_0x991640[_0x0d7b('0x37')]=qs[_0x0d7b('0x2e')](_['pick'](_0x3672f7[_0x0d7b('0x2c')],_0xe0725d[_0x0d7b('0x2e')]),_0xd395fe);if(_0x3672f7[_0x0d7b('0x2c')]['filter']){_0x991640[_0x0d7b('0x37')]=_['merge'](_0x991640[_0x0d7b('0x37')],{'$or':_[_0x0d7b('0x27')](_0xd395fe,function(_0x2f403f){if(_0x2f403f[_0x0d7b('0x2a')]!==_0x0d7b('0x38')){var _0x222735={};_0x222735[_0x2f403f[_0x0d7b('0x24')]]={'$like':'%'+_0x3672f7[_0x0d7b('0x2c')][_0x0d7b('0x39')]+'%'};return _0x222735;}})});}_0x991640=_['merge']({},_0x991640,_0x3672f7['options']);var _0x488805={'where':_0x991640['where']};return db[_0x0d7b('0x28')]['count'](_0x488805)[_0x0d7b('0x21')](function(_0x2a5356){_0x285624[_0x0d7b('0x1b')]=_0x2a5356;if(_0x3672f7[_0x0d7b('0x2c')]['includeAll']){_0x991640['include']=[{'all':!![]}];}return db[_0x0d7b('0x28')][_0x0d7b('0x3a')](_0x991640);})[_0x0d7b('0x21')](function(_0x1ee39b){_0x285624[_0x0d7b('0x3b')]=_0x1ee39b;return _0x285624;})['then'](respondWithFilteredResult(_0x1270de,_0x991640))['catch'](handleError(_0x1270de,null));};exports[_0x0d7b('0x3c')]=function(_0x490cd1,_0x52ef2e){var _0x2f51e7={'raw':!![],'where':{'id':_0x490cd1[_0x0d7b('0x3d')]['id']}},_0x6d2b6f={};_0x6d2b6f[_0x0d7b('0x2b')]=_[_0x0d7b('0x2d')](db['MailSubstatus'][_0x0d7b('0x3e')]);_0x6d2b6f[_0x0d7b('0x2c')]=_[_0x0d7b('0x2d')](_0x490cd1[_0x0d7b('0x2c')]);_0x6d2b6f['filters']=_[_0x0d7b('0x30')](_0x6d2b6f[_0x0d7b('0x2b')],_0x6d2b6f[_0x0d7b('0x2c')]);_0x2f51e7[_0x0d7b('0x2f')]=_[_0x0d7b('0x30')](_0x6d2b6f[_0x0d7b('0x2b')],qs[_0x0d7b('0x31')](_0x490cd1[_0x0d7b('0x2c')][_0x0d7b('0x31')]));_0x2f51e7[_0x0d7b('0x2f')]=_0x2f51e7[_0x0d7b('0x2f')]['length']?_0x2f51e7[_0x0d7b('0x2f')]:_0x6d2b6f[_0x0d7b('0x2b')];if(_0x490cd1[_0x0d7b('0x2c')][_0x0d7b('0x3f')]){_0x2f51e7[_0x0d7b('0x40')]=[{'all':!![]}];}_0x2f51e7=_[_0x0d7b('0x41')]({},_0x2f51e7,_0x490cd1[_0x0d7b('0x42')]);return db[_0x0d7b('0x28')][_0x0d7b('0x43')](_0x2f51e7)['then'](handleEntityNotFound(_0x52ef2e,null))[_0x0d7b('0x21')](respondWithResult(_0x52ef2e,null))[_0x0d7b('0x44')](handleError(_0x52ef2e,null));};exports['create']=function(_0xe38c42,_0x5428e7){return db['MailSubstatus'][_0x0d7b('0x45')](_0xe38c42['body'],{})['then'](respondWithResult(_0x5428e7,0xc9))[_0x0d7b('0x44')](handleError(_0x5428e7,null));};exports[_0x0d7b('0x20')]=function(_0x47a244,_0x3ba541){if(_0x47a244[_0x0d7b('0x46')]['id']){delete _0x47a244[_0x0d7b('0x46')]['id'];}return db['MailSubstatus'][_0x0d7b('0x43')]({'where':{'id':_0x47a244['params']['id']}})[_0x0d7b('0x21')](handleEntityNotFound(_0x3ba541,null))[_0x0d7b('0x21')](saveUpdates(_0x47a244[_0x0d7b('0x46')],null))[_0x0d7b('0x21')](respondWithResult(_0x3ba541,null))[_0x0d7b('0x44')](handleError(_0x3ba541,null));};exports[_0x0d7b('0x22')]=function(_0x106ef3,_0x1d89cc){return db['MailSubstatus'][_0x0d7b('0x43')]({'where':{'id':_0x106ef3[_0x0d7b('0x3d')]['id']}})[_0x0d7b('0x21')](handleEntityNotFound(_0x1d89cc,null))[_0x0d7b('0x21')](removeEntity(_0x1d89cc,null))[_0x0d7b('0x44')](handleError(_0x1d89cc,null));};exports['describe']=function(_0x1acfca,_0x499021){return db[_0x0d7b('0x28')][_0x0d7b('0x47')]()['then'](respondWithResult(_0x499021,null))[_0x0d7b('0x44')](handleError(_0x499021,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index eb0f51a..ba6a437 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 _0xee0e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','mail_substatuses','lodash','util','api'];(function(_0x5e4d07,_0x3cadfb){var _0x2758c8=function(_0x56737e){while(--_0x56737e){_0x5e4d07['push'](_0x5e4d07['shift']());}};_0x2758c8(++_0x3cadfb);}(_0xee0e,0x1d1));var _0xeee0=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0xee0e[_0x136619];return _0x38c4a5;};'use strict';var _=require(_0xeee0('0x0'));var util=require(_0xeee0('0x1'));var logger=require('../../config/logger')(_0xeee0('0x2'));var moment=require(_0xeee0('0x3'));var BPromise=require(_0xeee0('0x4'));var rp=require(_0xeee0('0x5'));var fs=require('fs');var path=require(_0xeee0('0x6'));var rimraf=require(_0xeee0('0x7'));var config=require(_0xeee0('0x8'));var attributes=require(_0xeee0('0x9'));module[_0xeee0('0xa')]=function(_0x3703fb,_0x134c1a){return _0x3703fb[_0xeee0('0xb')]('MailSubstatus',attributes,{'tableName':_0xeee0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3406=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x734a6,_0x4d8531){var _0x3933a5=function(_0x294599){while(--_0x294599){_0x734a6['push'](_0x734a6['shift']());}};_0x3933a5(++_0x4d8531);}(_0x3406,0x19a));var _0x6340=function(_0x2fdeaf,_0x1777c9){_0x2fdeaf=_0x2fdeaf-0x0;var _0x27e551=_0x3406[_0x2fdeaf];return _0x27e551;};'use strict';var _=require(_0x6340('0x0'));var util=require(_0x6340('0x1'));var logger=require(_0x6340('0x2'))(_0x6340('0x3'));var moment=require(_0x6340('0x4'));var BPromise=require(_0x6340('0x5'));var rp=require(_0x6340('0x6'));var fs=require('fs');var path=require(_0x6340('0x7'));var rimraf=require(_0x6340('0x8'));var config=require(_0x6340('0x9'));var attributes=require(_0x6340('0xa'));module['exports']=function(_0x25f4b7,_0x22dd56){return _0x25f4b7[_0x6340('0xb')]('MailSubstatus',attributes,{'tableName':_0x6340('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 874db29..1033ec1 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 _0x3285=['MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2c094f,_0xe5a1b0){var _0x2f7176=function(_0x28e5f5){while(--_0x28e5f5){_0x2c094f['push'](_0x2c094f['shift']());}};_0x2f7176(++_0xe5a1b0);}(_0x3285,0x11c));var _0x5328=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x3285[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x5328('0x0'));var util=require(_0x5328('0x1'));var moment=require(_0x5328('0x2'));var BPromise=require(_0x5328('0x3'));var rs=require(_0x5328('0x4'));var fs=require('fs');var Redis=require(_0x5328('0x5'));var db=require(_0x5328('0x6'))['db'];var utils=require(_0x5328('0x7'));var logger=require(_0x5328('0x8'))('rpc');var config=require(_0x5328('0x9'));var jayson=require(_0x5328('0xa'));var client=jayson[_0x5328('0xb')][_0x5328('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4aeda0,_0x5cd34c,_0x1380ca){return new BPromise(function(_0x20d845,_0x372549){return client[_0x5328('0xd')](_0x4aeda0,_0x1380ca)[_0x5328('0xe')](function(_0x5af796){logger[_0x5328('0xf')](_0x5328('0x10'),_0x5cd34c,_0x5328('0x11'));logger['debug'](_0x5328('0x12'),_0x5cd34c,_0x5328('0x11'),JSON[_0x5328('0x13')](_0x5af796));if(_0x5af796[_0x5328('0x14')]){if(_0x5af796[_0x5328('0x14')][_0x5328('0x15')]===0x1f4){logger[_0x5328('0x14')](_0x5328('0x10'),_0x5cd34c,_0x5af796[_0x5328('0x14')][_0x5328('0x16')]);return _0x372549(_0x5af796[_0x5328('0x14')][_0x5328('0x16')]);}logger[_0x5328('0x14')](_0x5328('0x10'),_0x5cd34c,_0x5af796[_0x5328('0x14')]['message']);return _0x20d845(_0x5af796[_0x5328('0x14')][_0x5328('0x16')]);}else{logger[_0x5328('0xf')](_0x5328('0x10'),_0x5cd34c,_0x5328('0x11'));_0x20d845(_0x5af796[_0x5328('0x17')][_0x5328('0x16')]);}})[_0x5328('0x18')](function(_0x2ddb1){logger['error'](_0x5328('0x10'),_0x5cd34c,_0x2ddb1);_0x372549(_0x2ddb1);});});} \ No newline at end of file +var _0x20fb=['request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','MailSubstatus,\x20%s,\x20%s','debug'];(function(_0xa50370,_0x58aa74){var _0x38d6ff=function(_0x58844c){while(--_0x58844c){_0xa50370['push'](_0xa50370['shift']());}};_0x38d6ff(++_0x58aa74);}(_0x20fb,0x1ea));var _0xb20f=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x20fb[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xb20f('0x0'));var util=require(_0xb20f('0x1'));var moment=require(_0xb20f('0x2'));var BPromise=require(_0xb20f('0x3'));var rs=require(_0xb20f('0x4'));var fs=require('fs');var Redis=require(_0xb20f('0x5'));var db=require(_0xb20f('0x6'))['db'];var utils=require(_0xb20f('0x7'));var logger=require(_0xb20f('0x8'))(_0xb20f('0x9'));var config=require(_0xb20f('0xa'));var jayson=require(_0xb20f('0xb'));var client=jayson[_0xb20f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353b4b,_0x1200f3,_0x312764){return new BPromise(function(_0x558436,_0xb29acb){return client[_0xb20f('0xd')](_0x353b4b,_0x312764)['then'](function(_0x2cbb49){logger['info'](_0xb20f('0xe'),_0x1200f3,'request\x20sent');logger[_0xb20f('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1200f3,_0xb20f('0x10'),JSON[_0xb20f('0x11')](_0x2cbb49));if(_0x2cbb49[_0xb20f('0x12')]){if(_0x2cbb49[_0xb20f('0x12')][_0xb20f('0x13')]===0x1f4){logger[_0xb20f('0x12')](_0xb20f('0xe'),_0x1200f3,_0x2cbb49[_0xb20f('0x12')]['message']);return _0xb29acb(_0x2cbb49[_0xb20f('0x12')][_0xb20f('0x14')]);}logger[_0xb20f('0x12')](_0xb20f('0xe'),_0x1200f3,_0x2cbb49['error'][_0xb20f('0x14')]);return _0x558436(_0x2cbb49[_0xb20f('0x12')]['message']);}else{logger[_0xb20f('0x15')]('MailSubstatus,\x20%s,\x20%s',_0x1200f3,_0xb20f('0x10'));_0x558436(_0x2cbb49['result'][_0xb20f('0x14')]);}})[_0xb20f('0x16')](function(_0x245169){logger['error'](_0xb20f('0xe'),_0x1200f3,_0x245169);_0xb29acb(_0x245169);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index f6e2007..de51fd2 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 _0x6b7a=['Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','/describe','describe','get','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x6b7a,0x87));var _0xa6b7=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x6b7a[_0x255ac0];return _0x437bf1;};'use strict';var multer=require(_0xa6b7('0x0'));var util=require(_0xa6b7('0x1'));var path=require(_0xa6b7('0x2'));var timeout=require(_0xa6b7('0x3'));var express=require(_0xa6b7('0x4'));var router=express[_0xa6b7('0x5')]();var fs_extra=require(_0xa6b7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa6b7('0x7'));var config=require(_0xa6b7('0x8'));var controller=require(_0xa6b7('0x9'));router['get']('/',auth[_0xa6b7('0xa')](),controller['index']);router['get'](_0xa6b7('0xb'),auth[_0xa6b7('0xa')](),controller[_0xa6b7('0xc')]);router[_0xa6b7('0xd')](_0xa6b7('0xe'),auth[_0xa6b7('0xa')](),controller[_0xa6b7('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa6b7('0x10')](_0xa6b7('0xe'),auth[_0xa6b7('0xa')](),controller[_0xa6b7('0x11')]);router[_0xa6b7('0x12')](_0xa6b7('0xe'),auth[_0xa6b7('0xa')](),controller[_0xa6b7('0x13')]);module['exports']=router; \ No newline at end of file +var _0x290c=['express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0x290c,0x11d));var _0xc290=function(_0x4dd648,_0x23d7bb){_0x4dd648=_0x4dd648-0x0;var _0xdf9546=_0x290c[_0x4dd648];return _0xdf9546;};'use strict';var multer=require('multer');var util=require(_0xc290('0x0'));var path=require(_0xc290('0x1'));var timeout=require(_0xc290('0x2'));var express=require(_0xc290('0x3'));var router=express[_0xc290('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc290('0x5'));var interaction=require(_0xc290('0x6'));var config=require('../../config/environment');var controller=require(_0xc290('0x7'));router[_0xc290('0x8')]('/',auth[_0xc290('0x9')](),controller[_0xc290('0xa')]);router['get'](_0xc290('0xb'),auth['isAuthenticated'](),controller[_0xc290('0xc')]);router[_0xc290('0x8')](_0xc290('0xd'),auth[_0xc290('0x9')](),controller['show']);router['post']('/',auth[_0xc290('0x9')](),controller['create']);router[_0xc290('0xe')](_0xc290('0xd'),auth[_0xc290('0x9')](),controller[_0xc290('0xf')]);router['delete']('/:id',auth[_0xc290('0x9')](),controller[_0xc290('0x10')]);module[_0xc290('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index b2aec9b..67eb59f 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xac8c2f,_0x3959f8){var _0x287723=function(_0x37b49c){while(--_0x37b49c){_0xac8c2f['push'](_0xac8c2f['shift']());}};_0x287723(++_0x3959f8);}(_0xedd9,0xfc));var _0x9edd=function(_0x143cfd,_0x2912b3){_0x143cfd=_0x143cfd-0x0;var _0x4355a6=_0xedd9[_0x143cfd];return _0x4355a6;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x5d1c9d,_0x8bb82d){var _0x8edfe4=function(_0x30fdc4){while(--_0x30fdc4){_0x5d1c9d['push'](_0x5d1c9d['shift']());}};_0x8edfe4(++_0x8bb82d);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'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 72192bf..0124327 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 _0x4789=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','status','set','apply','reject','save','update','then','destroy','error','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','length','create','body','find','describe','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service'];(function(_0x186496,_0x52bcd2){var _0x2a98aa=function(_0x149939){while(--_0x149939){_0x186496['push'](_0x186496['shift']());}};_0x2a98aa(++_0x52bcd2);}(_0x4789,0x10e));var _0x9478=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x4789[_0x39e84d];return _0x1991bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9478('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9478('0x1'));var moment=require(_0x9478('0x2'));var BPromise=require(_0x9478('0x3'));var Mustache=require('mustache');var util=require(_0x9478('0x4'));var path=require(_0x9478('0x5'));var sox=require(_0x9478('0x6'));var csv=require(_0x9478('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9478('0x8'));var _=require('lodash');var squel=require(_0x9478('0x9'));var crypto=require(_0x9478('0xa'));var jsforce=require(_0x9478('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9478('0x7'));var querystring=require('querystring');var Papa=require(_0x9478('0xc'));var Redis=require('ioredis');var authService=require(_0x9478('0xd'));var qs=require(_0x9478('0xe'));var as=require(_0x9478('0xf'));var hardwareService=require(_0x9478('0x10'));var logger=require(_0x9478('0x11'))(_0x9478('0x12'));var utils=require(_0x9478('0x13'));var config=require(_0x9478('0x14'));var licenseUtil=require(_0x9478('0x15'));var db=require(_0x9478('0x16'))['db'];function respondWithStatusCode(_0x1db250,_0x114a1e){_0x114a1e=_0x114a1e||0xcc;return function(_0x42b819){if(_0x42b819){return _0x1db250[_0x9478('0x17')](_0x114a1e);}return _0x1db250['status'](_0x114a1e)[_0x9478('0x18')]();};}function respondWithResult(_0x3e6e7b,_0x5a82f1){_0x5a82f1=_0x5a82f1||0xc8;return function(_0x3eeda2){if(_0x3eeda2){return _0x3e6e7b['status'](_0x5a82f1)[_0x9478('0x19')](_0x3eeda2);}};}function respondWithFilteredResult(_0x362b6c,_0x5dc976){return function(_0x5b2c4a){if(_0x5b2c4a){var _0x339aae=typeof _0x5dc976['offset']===_0x9478('0x1a')&&typeof _0x5dc976['limit']==='undefined';var _0x51fca0=_0x5b2c4a[_0x9478('0x1b')];var _0x2e4bc9=_0x339aae?0x0:_0x5dc976[_0x9478('0x1c')];var _0x59a7bc=_0x339aae?_0x5b2c4a[_0x9478('0x1b')]:_0x5dc976[_0x9478('0x1c')]+_0x5dc976[_0x9478('0x1d')];var _0x5e1570;if(_0x59a7bc>=_0x51fca0){_0x59a7bc=_0x51fca0;_0x5e1570=0xc8;}else{_0x5e1570=0xce;}_0x362b6c[_0x9478('0x1e')](_0x5e1570);return _0x362b6c[_0x9478('0x1f')]('Content-Range',_0x2e4bc9+'-'+_0x59a7bc+'/'+_0x51fca0)[_0x9478('0x19')](_0x5b2c4a);}return null;};}function patchUpdates(_0x3ac261){return function(_0x157f99){try{jsonpatch[_0x9478('0x20')](_0x157f99,_0x3ac261,!![]);}catch(_0x455e77){return BPromise[_0x9478('0x21')](_0x455e77);}return _0x157f99[_0x9478('0x22')]();};}function saveUpdates(_0x29a3f1,_0x135397){return function(_0x41a770){if(_0x41a770){return _0x41a770[_0x9478('0x23')](_0x29a3f1)[_0x9478('0x24')](function(_0x16f562){return _0x16f562;});}return null;};}function removeEntity(_0x447121,_0xb764b2){return function(_0x1f270f){if(_0x1f270f){return _0x1f270f[_0x9478('0x25')]()['then'](function(){_0x447121[_0x9478('0x1e')](0xcc)[_0x9478('0x18')]();});}};}function handleEntityNotFound(_0x3b0fa0,_0x491120){return function(_0x5249a9){if(!_0x5249a9){_0x3b0fa0[_0x9478('0x17')](0x194);}return _0x5249a9;};}function handleError(_0x2b5cd3,_0x22e14){_0x22e14=_0x22e14||0x1f4;return function(_0x5e140a){logger[_0x9478('0x26')](_0x5e140a['stack']);if(_0x5e140a['name']){delete _0x5e140a[_0x9478('0x27')];}_0x2b5cd3[_0x9478('0x1e')](_0x22e14)['send'](_0x5e140a);};}exports[_0x9478('0x28')]=function(_0x166058,_0x4e5391){var _0x118673={},_0x1a0905={},_0x412a79={'count':0x0,'rows':[]};var _0x59d179=_[_0x9478('0x29')](db[_0x9478('0x2a')][_0x9478('0x2b')],function(_0x2f20c5){return{'name':_0x2f20c5[_0x9478('0x2c')],'type':_0x2f20c5[_0x9478('0x2d')][_0x9478('0x2e')]};});_0x1a0905[_0x9478('0x2f')]=_['map'](_0x59d179,'name');_0x1a0905[_0x9478('0x30')]=_[_0x9478('0x31')](_0x166058[_0x9478('0x30')]);_0x1a0905[_0x9478('0x32')]=_['intersection'](_0x1a0905['model'],_0x1a0905[_0x9478('0x30')]);_0x118673['attributes']=_[_0x9478('0x33')](_0x1a0905[_0x9478('0x2f')],qs[_0x9478('0x34')](_0x166058[_0x9478('0x30')]['fields']));_0x118673[_0x9478('0x35')]=_0x118673[_0x9478('0x35')]['length']?_0x118673[_0x9478('0x35')]:_0x1a0905[_0x9478('0x2f')];if(!_0x166058[_0x9478('0x30')][_0x9478('0x36')]('nolimit')){_0x118673[_0x9478('0x1d')]=qs['limit'](_0x166058[_0x9478('0x30')][_0x9478('0x1d')]);_0x118673[_0x9478('0x1c')]=qs[_0x9478('0x1c')](_0x166058['query']['offset']);}_0x118673['order']=qs[_0x9478('0x37')](_0x166058['query'][_0x9478('0x37')]);_0x118673[_0x9478('0x38')]=qs['filters'](_[_0x9478('0x39')](_0x166058[_0x9478('0x30')],_0x1a0905[_0x9478('0x32')]),_0x59d179);if(_0x166058[_0x9478('0x30')][_0x9478('0x3a')]){_0x118673[_0x9478('0x38')]=_[_0x9478('0x3b')](_0x118673[_0x9478('0x38')],{'$or':_[_0x9478('0x29')](_0x59d179,function(_0x24baec){if(_0x24baec['type']!==_0x9478('0x3c')){var _0x25bc87={};_0x25bc87[_0x24baec[_0x9478('0x27')]]={'$like':'%'+_0x166058[_0x9478('0x30')][_0x9478('0x3a')]+'%'};return _0x25bc87;}})});}_0x118673=_['merge']({},_0x118673,_0x166058[_0x9478('0x3d')]);var _0x57690a={'where':_0x118673[_0x9478('0x38')]};return db[_0x9478('0x2a')]['count'](_0x57690a)['then'](function(_0x55e460){_0x412a79['count']=_0x55e460;if(_0x166058[_0x9478('0x30')]['includeAll']){_0x118673[_0x9478('0x3e')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x118673);})['then'](function(_0x3b5703){_0x412a79['rows']=_0x3b5703;return _0x412a79;})[_0x9478('0x24')](respondWithFilteredResult(_0x4e5391,_0x118673))[_0x9478('0x3f')](handleError(_0x4e5391,null));};exports[_0x9478('0x40')]=function(_0x1452ea,_0x4e0b32){var _0x27da97={'raw':!![],'where':{'id':_0x1452ea[_0x9478('0x41')]['id']}},_0x5288c2={};_0x5288c2['model']=_[_0x9478('0x31')](db[_0x9478('0x2a')]['rawAttributes']);_0x5288c2[_0x9478('0x30')]=_['keys'](_0x1452ea[_0x9478('0x30')]);_0x5288c2[_0x9478('0x32')]=_['intersection'](_0x5288c2[_0x9478('0x2f')],_0x5288c2['query']);_0x27da97['attributes']=_[_0x9478('0x33')](_0x5288c2['model'],qs[_0x9478('0x34')](_0x1452ea['query']['fields']));_0x27da97[_0x9478('0x35')]=_0x27da97['attributes'][_0x9478('0x42')]?_0x27da97['attributes']:_0x5288c2['model'];if(_0x1452ea[_0x9478('0x30')]['includeAll']){_0x27da97[_0x9478('0x3e')]=[{'all':!![]}];}_0x27da97=_[_0x9478('0x3b')]({},_0x27da97,_0x1452ea[_0x9478('0x3d')]);return db[_0x9478('0x2a')]['find'](_0x27da97)[_0x9478('0x24')](handleEntityNotFound(_0x4e0b32,null))[_0x9478('0x24')](respondWithResult(_0x4e0b32,null))[_0x9478('0x3f')](handleError(_0x4e0b32,null));};exports[_0x9478('0x43')]=function(_0x2f0462,_0x391572){return db[_0x9478('0x2a')][_0x9478('0x43')](_0x2f0462[_0x9478('0x44')],{})['then'](respondWithResult(_0x391572,0xc9))[_0x9478('0x3f')](handleError(_0x391572,null));};exports[_0x9478('0x23')]=function(_0x400c47,_0x56c09a){if(_0x400c47[_0x9478('0x44')]['id']){delete _0x400c47['body']['id'];}return db[_0x9478('0x2a')][_0x9478('0x45')]({'where':{'id':_0x400c47[_0x9478('0x41')]['id']}})['then'](handleEntityNotFound(_0x56c09a,null))[_0x9478('0x24')](saveUpdates(_0x400c47[_0x9478('0x44')],null))[_0x9478('0x24')](respondWithResult(_0x56c09a,null))[_0x9478('0x3f')](handleError(_0x56c09a,null));};exports[_0x9478('0x25')]=function(_0x1439c8,_0x1bbe4c){return db[_0x9478('0x2a')]['find']({'where':{'id':_0x1439c8[_0x9478('0x41')]['id']}})[_0x9478('0x24')](handleEntityNotFound(_0x1bbe4c,null))[_0x9478('0x24')](removeEntity(_0x1bbe4c,null))[_0x9478('0x3f')](handleError(_0x1bbe4c,null));};exports[_0x9478('0x46')]=function(_0x27501a,_0x5a1a4f){return db[_0x9478('0x2a')][_0x9478('0x46')]()['then'](respondWithResult(_0x5a1a4f,null))[_0x9478('0x3f')](handleError(_0x5a1a4f,null));}; \ No newline at end of file +var _0x669d=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise'];(function(_0x13e2d4,_0x1593a3){var _0x48146c=function(_0x5eae48){while(--_0x5eae48){_0x13e2d4['push'](_0x13e2d4['shift']());}};_0x48146c(++_0x1593a3);}(_0x669d,0x1dc));var _0xd669=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x669d[_0x122096];return _0x3d1966;};'use strict';var emlformat=require(_0xd669('0x0'));var rimraf=require(_0xd669('0x1'));var zipdir=require(_0xd669('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd669('0x3'));var moment=require('moment');var BPromise=require(_0xd669('0x4'));var Mustache=require(_0xd669('0x5'));var util=require(_0xd669('0x6'));var path=require(_0xd669('0x7'));var sox=require('sox');var csv=require(_0xd669('0x8'));var ejs=require(_0xd669('0x9'));var fs=require('fs');var fs_extra=require(_0xd669('0xa'));var _=require(_0xd669('0xb'));var squel=require(_0xd669('0xc'));var crypto=require(_0xd669('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd669('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd669('0xf'));var Papa=require(_0xd669('0x10'));var Redis=require('ioredis');var authService=require(_0xd669('0x11'));var qs=require(_0xd669('0x12'));var as=require(_0xd669('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd669('0x14'))(_0xd669('0x15'));var utils=require(_0xd669('0x16'));var config=require(_0xd669('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd669('0x18'))['db'];function respondWithStatusCode(_0x2ea942,_0x2cc8e5){_0x2cc8e5=_0x2cc8e5||0xcc;return function(_0x4b1969){if(_0x4b1969){return _0x2ea942[_0xd669('0x19')](_0x2cc8e5);}return _0x2ea942[_0xd669('0x1a')](_0x2cc8e5)[_0xd669('0x1b')]();};}function respondWithResult(_0x38006e,_0x5597f4){_0x5597f4=_0x5597f4||0xc8;return function(_0xb6e23e){if(_0xb6e23e){return _0x38006e[_0xd669('0x1a')](_0x5597f4)[_0xd669('0x1c')](_0xb6e23e);}};}function respondWithFilteredResult(_0x4815c4,_0xac229a){return function(_0x5cecc9){if(_0x5cecc9){var _0x411eb6=typeof _0xac229a['offset']===_0xd669('0x1d')&&typeof _0xac229a[_0xd669('0x1e')]===_0xd669('0x1d');var _0x30a7c1=_0x5cecc9[_0xd669('0x1f')];var _0x3c3f0a=_0x411eb6?0x0:_0xac229a[_0xd669('0x20')];var _0x488487=_0x411eb6?_0x5cecc9[_0xd669('0x1f')]:_0xac229a[_0xd669('0x20')]+_0xac229a[_0xd669('0x1e')];var _0xef9325;if(_0x488487>=_0x30a7c1){_0x488487=_0x30a7c1;_0xef9325=0xc8;}else{_0xef9325=0xce;}_0x4815c4[_0xd669('0x1a')](_0xef9325);return _0x4815c4[_0xd669('0x21')](_0xd669('0x22'),_0x3c3f0a+'-'+_0x488487+'/'+_0x30a7c1)[_0xd669('0x1c')](_0x5cecc9);}return null;};}function patchUpdates(_0x4c366d){return function(_0x20e3ce){try{jsonpatch[_0xd669('0x23')](_0x20e3ce,_0x4c366d,!![]);}catch(_0xd897cd){return BPromise[_0xd669('0x24')](_0xd897cd);}return _0x20e3ce[_0xd669('0x25')]();};}function saveUpdates(_0x4380ff,_0x3a9228){return function(_0x269db8){if(_0x269db8){return _0x269db8[_0xd669('0x26')](_0x4380ff)[_0xd669('0x27')](function(_0xe0ffa9){return _0xe0ffa9;});}return null;};}function removeEntity(_0x152827,_0x3552e8){return function(_0x4454e0){if(_0x4454e0){return _0x4454e0[_0xd669('0x28')]()[_0xd669('0x27')](function(){_0x152827[_0xd669('0x1a')](0xcc)[_0xd669('0x1b')]();});}};}function handleEntityNotFound(_0x3247fe,_0xf43442){return function(_0x47c908){if(!_0x47c908){_0x3247fe['sendStatus'](0x194);}return _0x47c908;};}function handleError(_0x55b01d,_0xc20cf0){_0xc20cf0=_0xc20cf0||0x1f4;return function(_0x5a927f){logger[_0xd669('0x29')](_0x5a927f['stack']);if(_0x5a927f[_0xd669('0x2a')]){delete _0x5a927f[_0xd669('0x2a')];}_0x55b01d['status'](_0xc20cf0)[_0xd669('0x2b')](_0x5a927f);};}exports[_0xd669('0x2c')]=function(_0x5e14f3,_0x2c6a23){var _0x86d194={},_0x225b5f={},_0x29d65e={'count':0x0,'rows':[]};var _0x43d031=_[_0xd669('0x2d')](db[_0xd669('0x2e')][_0xd669('0x2f')],function(_0x433acb){return{'name':_0x433acb[_0xd669('0x30')],'type':_0x433acb[_0xd669('0x31')][_0xd669('0x32')]};});_0x225b5f[_0xd669('0x33')]=_[_0xd669('0x2d')](_0x43d031,_0xd669('0x2a'));_0x225b5f[_0xd669('0x34')]=_[_0xd669('0x35')](_0x5e14f3[_0xd669('0x34')]);_0x225b5f[_0xd669('0x36')]=_[_0xd669('0x37')](_0x225b5f['model'],_0x225b5f['query']);_0x86d194[_0xd669('0x38')]=_['intersection'](_0x225b5f['model'],qs[_0xd669('0x39')](_0x5e14f3[_0xd669('0x34')][_0xd669('0x39')]));_0x86d194[_0xd669('0x38')]=_0x86d194[_0xd669('0x38')][_0xd669('0x3a')]?_0x86d194[_0xd669('0x38')]:_0x225b5f[_0xd669('0x33')];if(!_0x5e14f3[_0xd669('0x34')][_0xd669('0x3b')](_0xd669('0x3c'))){_0x86d194[_0xd669('0x1e')]=qs[_0xd669('0x1e')](_0x5e14f3[_0xd669('0x34')][_0xd669('0x1e')]);_0x86d194[_0xd669('0x20')]=qs['offset'](_0x5e14f3['query'][_0xd669('0x20')]);}_0x86d194[_0xd669('0x3d')]=qs[_0xd669('0x3e')](_0x5e14f3[_0xd669('0x34')][_0xd669('0x3e')]);_0x86d194[_0xd669('0x3f')]=qs[_0xd669('0x36')](_[_0xd669('0x40')](_0x5e14f3[_0xd669('0x34')],_0x225b5f[_0xd669('0x36')]),_0x43d031);if(_0x5e14f3[_0xd669('0x34')][_0xd669('0x41')]){_0x86d194[_0xd669('0x3f')]=_[_0xd669('0x42')](_0x86d194[_0xd669('0x3f')],{'$or':_[_0xd669('0x2d')](_0x43d031,function(_0x4fa7ab){if(_0x4fa7ab['type']!==_0xd669('0x43')){var _0x2bc67d={};_0x2bc67d[_0x4fa7ab['name']]={'$like':'%'+_0x5e14f3[_0xd669('0x34')][_0xd669('0x41')]+'%'};return _0x2bc67d;}})});}_0x86d194=_[_0xd669('0x42')]({},_0x86d194,_0x5e14f3[_0xd669('0x44')]);var _0x235892={'where':_0x86d194['where']};return db[_0xd669('0x2e')]['count'](_0x235892)[_0xd669('0x27')](function(_0x4b61e1){_0x29d65e[_0xd669('0x1f')]=_0x4b61e1;if(_0x5e14f3[_0xd669('0x34')][_0xd669('0x45')]){_0x86d194[_0xd669('0x46')]=[{'all':!![]}];}return db['MailTransferReport'][_0xd669('0x47')](_0x86d194);})[_0xd669('0x27')](function(_0x3c7729){_0x29d65e[_0xd669('0x48')]=_0x3c7729;return _0x29d65e;})[_0xd669('0x27')](respondWithFilteredResult(_0x2c6a23,_0x86d194))[_0xd669('0x49')](handleError(_0x2c6a23,null));};exports[_0xd669('0x4a')]=function(_0x31dcc3,_0x40ac98){var _0x155b6a={'raw':!![],'where':{'id':_0x31dcc3[_0xd669('0x4b')]['id']}},_0xbb005={};_0xbb005[_0xd669('0x33')]=_['keys'](db[_0xd669('0x2e')][_0xd669('0x2f')]);_0xbb005[_0xd669('0x34')]=_[_0xd669('0x35')](_0x31dcc3[_0xd669('0x34')]);_0xbb005['filters']=_['intersection'](_0xbb005[_0xd669('0x33')],_0xbb005[_0xd669('0x34')]);_0x155b6a['attributes']=_['intersection'](_0xbb005[_0xd669('0x33')],qs[_0xd669('0x39')](_0x31dcc3[_0xd669('0x34')]['fields']));_0x155b6a[_0xd669('0x38')]=_0x155b6a['attributes']['length']?_0x155b6a[_0xd669('0x38')]:_0xbb005[_0xd669('0x33')];if(_0x31dcc3[_0xd669('0x34')][_0xd669('0x45')]){_0x155b6a[_0xd669('0x46')]=[{'all':!![]}];}_0x155b6a=_[_0xd669('0x42')]({},_0x155b6a,_0x31dcc3[_0xd669('0x44')]);return db['MailTransferReport'][_0xd669('0x4c')](_0x155b6a)[_0xd669('0x27')](handleEntityNotFound(_0x40ac98,null))[_0xd669('0x27')](respondWithResult(_0x40ac98,null))[_0xd669('0x49')](handleError(_0x40ac98,null));};exports[_0xd669('0x4d')]=function(_0x2ee108,_0x10fa26){return db['MailTransferReport'][_0xd669('0x4d')](_0x2ee108[_0xd669('0x4e')],{})[_0xd669('0x27')](respondWithResult(_0x10fa26,0xc9))[_0xd669('0x49')](handleError(_0x10fa26,null));};exports[_0xd669('0x26')]=function(_0x104999,_0xcd8676){if(_0x104999[_0xd669('0x4e')]['id']){delete _0x104999[_0xd669('0x4e')]['id'];}return db[_0xd669('0x2e')][_0xd669('0x4c')]({'where':{'id':_0x104999[_0xd669('0x4b')]['id']}})[_0xd669('0x27')](handleEntityNotFound(_0xcd8676,null))[_0xd669('0x27')](saveUpdates(_0x104999[_0xd669('0x4e')],null))['then'](respondWithResult(_0xcd8676,null))[_0xd669('0x49')](handleError(_0xcd8676,null));};exports[_0xd669('0x28')]=function(_0x2bf900,_0xb5294d){return db['MailTransferReport'][_0xd669('0x4c')]({'where':{'id':_0x2bf900['params']['id']}})['then'](handleEntityNotFound(_0xb5294d,null))[_0xd669('0x27')](removeEntity(_0xb5294d,null))[_0xd669('0x49')](handleError(_0xb5294d,null));};exports[_0xd669('0x4f')]=function(_0x24d350,_0x286b34){return db[_0xd669('0x2e')][_0xd669('0x4f')]()['then'](respondWithResult(_0x286b34,null))['catch'](handleError(_0x286b34,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 543547d..7a8a575 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 _0x8524=['MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define'];(function(_0x5032fd,_0x4a84b4){var _0x3d9d94=function(_0x6366c4){while(--_0x6366c4){_0x5032fd['push'](_0x5032fd['shift']());}};_0x3d9d94(++_0x4a84b4);}(_0x8524,0x1d4));var _0x4852=function(_0x2fab49,_0x11c590){_0x2fab49=_0x2fab49-0x0;var _0x5da65a=_0x8524[_0x2fab49];return _0x5da65a;};'use strict';var _=require(_0x4852('0x0'));var util=require(_0x4852('0x1'));var logger=require(_0x4852('0x2'))(_0x4852('0x3'));var moment=require(_0x4852('0x4'));var BPromise=require(_0x4852('0x5'));var rp=require(_0x4852('0x6'));var fs=require('fs');var path=require(_0x4852('0x7'));var rimraf=require(_0x4852('0x8'));var config=require(_0x4852('0x9'));var attributes=require(_0x4852('0xa'));module['exports']=function(_0x45089f,_0x3f70eb){return _0x45089f[_0x4852('0xb')](_0x4852('0xc'),attributes,{'tableName':_0x4852('0xd'),'paranoid':![],'indexes':[{'name':_0x4852('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ab2=['report_mail_transfer','uniqueid','../../config/logger','moment','bluebird','rimraf','./mailTransferReport.attributes','define','MailTransferReport'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0ab2,0x92));var _0x20ab=function(_0x23af8d,_0x5f0e9c){_0x23af8d=_0x23af8d-0x0;var _0x164819=_0x0ab2[_0x23af8d];return _0x164819;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x20ab('0x0'))('api');var moment=require(_0x20ab('0x1'));var BPromise=require(_0x20ab('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x20ab('0x3'));var config=require('../../config/environment');var attributes=require(_0x20ab('0x4'));module['exports']=function(_0x44fdb2,_0x259548){return _0x44fdb2[_0x20ab('0x5')](_0x20ab('0x6'),attributes,{'tableName':_0x20ab('0x7'),'paranoid':![],'indexes':[{'name':_0x20ab('0x8'),'fields':[_0x20ab('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index fdb4087..955db8a 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 _0x4806=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util'];(function(_0x4c34c1,_0x558eb0){var _0x1ed2f2=function(_0x320209){while(--_0x320209){_0x4c34c1['push'](_0x4c34c1['shift']());}};_0x1ed2f2(++_0x558eb0);}(_0x4806,0x112));var _0x6480=function(_0x3c56b7,_0x4def2f){_0x3c56b7=_0x3c56b7-0x0;var _0x800221=_0x4806[_0x3c56b7];return _0x800221;};'use strict';var _=require(_0x6480('0x0'));var util=require(_0x6480('0x1'));var moment=require(_0x6480('0x2'));var BPromise=require(_0x6480('0x3'));var rs=require(_0x6480('0x4'));var fs=require('fs');var Redis=require(_0x6480('0x5'));var db=require(_0x6480('0x6'))['db'];var utils=require(_0x6480('0x7'));var logger=require(_0x6480('0x8'))(_0x6480('0x9'));var config=require(_0x6480('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6480('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c9d18,_0x426f3e,_0x3ef913){return new BPromise(function(_0x3d22b0,_0x37b42d){return client[_0x6480('0xc')](_0x1c9d18,_0x3ef913)[_0x6480('0xd')](function(_0x29afed){logger['info'](_0x6480('0xe'),_0x426f3e,_0x6480('0xf'));logger[_0x6480('0x10')](_0x6480('0x11'),_0x426f3e,_0x6480('0xf'),JSON['stringify'](_0x29afed));if(_0x29afed[_0x6480('0x12')]){if(_0x29afed[_0x6480('0x12')][_0x6480('0x13')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x426f3e,_0x29afed[_0x6480('0x12')][_0x6480('0x14')]);return _0x37b42d(_0x29afed['error'][_0x6480('0x14')]);}logger['error'](_0x6480('0xe'),_0x426f3e,_0x29afed['error'][_0x6480('0x14')]);return _0x3d22b0(_0x29afed[_0x6480('0x12')][_0x6480('0x14')]);}else{logger[_0x6480('0x15')]('MailTransferReport,\x20%s,\x20%s',_0x426f3e,_0x6480('0xf'));_0x3d22b0(_0x29afed[_0x6480('0x16')]['message']);}})['catch'](function(_0x1f9ab0){logger[_0x6480('0x12')](_0x6480('0xe'),_0x426f3e,_0x1f9ab0);_0x37b42d(_0x1f9ab0);});});} \ No newline at end of file +var _0x3bd3=['jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x425036,_0x39bebc){var _0x7fc880=function(_0x54493c){while(--_0x54493c){_0x425036['push'](_0x425036['shift']());}};_0x7fc880(++_0x39bebc);}(_0x3bd3,0x1b0));var _0x33bd=function(_0x71ef5c,_0x7b5528){_0x71ef5c=_0x71ef5c-0x0;var _0x1d34d0=_0x3bd3[_0x71ef5c];return _0x1d34d0;};'use strict';var _=require(_0x33bd('0x0'));var util=require('util');var moment=require(_0x33bd('0x1'));var BPromise=require(_0x33bd('0x2'));var rs=require(_0x33bd('0x3'));var fs=require('fs');var Redis=require(_0x33bd('0x4'));var db=require(_0x33bd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x33bd('0x6'));var config=require(_0x33bd('0x7'));var jayson=require(_0x33bd('0x8'));var client=jayson[_0x33bd('0x9')][_0x33bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49a410,_0x575a05,_0x467d9f){return new BPromise(function(_0x45cd29,_0x122778){return client[_0x33bd('0xb')](_0x49a410,_0x467d9f)[_0x33bd('0xc')](function(_0x79d682){logger[_0x33bd('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x575a05,'request\x20sent');logger['debug'](_0x33bd('0xe'),_0x575a05,_0x33bd('0xf'),JSON[_0x33bd('0x10')](_0x79d682));if(_0x79d682[_0x33bd('0x11')]){if(_0x79d682['error']['code']===0x1f4){logger['error'](_0x33bd('0x12'),_0x575a05,_0x79d682['error']['message']);return _0x122778(_0x79d682[_0x33bd('0x11')][_0x33bd('0x13')]);}logger[_0x33bd('0x11')](_0x33bd('0x12'),_0x575a05,_0x79d682['error']['message']);return _0x45cd29(_0x79d682[_0x33bd('0x11')]['message']);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x575a05,_0x33bd('0xf'));_0x45cd29(_0x79d682[_0x33bd('0x14')][_0x33bd('0x13')]);}})[_0x33bd('0x15')](function(_0x143feb){logger[_0x33bd('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x575a05,_0x143feb);_0x122778(_0x143feb);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 4c0b81c..a765567 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 _0x001d=['put','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x188002,_0x29395a){var _0x47fa4d=function(_0x36c2f5){while(--_0x36c2f5){_0x188002['push'](_0x188002['shift']());}};_0x47fa4d(++_0x29395a);}(_0x001d,0x1c5));var _0xd001=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x001d[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0xd001('0x0'));var util=require(_0xd001('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd001('0x2'));var router=express[_0xd001('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd001('0x4'));var interaction=require(_0xd001('0x5'));var config=require(_0xd001('0x6'));var controller=require(_0xd001('0x7'));router[_0xd001('0x8')]('/',auth[_0xd001('0x9')](),controller['index']);router[_0xd001('0x8')](_0xd001('0xa'),auth[_0xd001('0x9')](),controller[_0xd001('0xb')]);router[_0xd001('0x8')](_0xd001('0xc'),auth[_0xd001('0x9')](),controller[_0xd001('0xd')]);router[_0xd001('0xe')]('/',auth[_0xd001('0x9')](),controller['create']);router[_0xd001('0xf')](_0xd001('0xc'),auth[_0xd001('0x9')](),controller['update']);router[_0xd001('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd001('0x11')]);module['exports']=router; \ No newline at end of file +var _0x62f9=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','show','put','update','delete','/:id','destroy','exports','multer'];(function(_0x351cef,_0x2355ac){var _0x2d5c2a=function(_0x236a83){while(--_0x236a83){_0x351cef['push'](_0x351cef['shift']());}};_0x2d5c2a(++_0x2355ac);}(_0x62f9,0x109));var _0x962f=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x62f9[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x962f('0x0'));var util=require(_0x962f('0x1'));var path=require('path');var timeout=require(_0x962f('0x2'));var express=require(_0x962f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x962f('0x4'));var interaction=require(_0x962f('0x5'));var config=require(_0x962f('0x6'));var controller=require(_0x962f('0x7'));router[_0x962f('0x8')]('/',auth['isAuthenticated'](),controller[_0x962f('0x9')]);router['get'](_0x962f('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x962f('0xb')](),controller[_0x962f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x962f('0xd')]('/:id',auth[_0x962f('0xb')](),controller[_0x962f('0xe')]);router[_0x962f('0xf')](_0x962f('0x10'),auth[_0x962f('0xb')](),controller[_0x962f('0x11')]);module[_0x962f('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index b39f4f1..77fe267 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 _0x9181=['INTEGER','DATE','getDataValue','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x1c922e,_0x26d9e1){var _0x4af09b=function(_0x368598){while(--_0x368598){_0x1c922e['push'](_0x1c922e['shift']());}};_0x4af09b(++_0x26d9e1);}(_0x9181,0x182));var _0x1918=function(_0x295e48,_0x2e23ca){_0x295e48=_0x295e48-0x0;var _0x2ef9a7=_0x9181[_0x295e48];return _0x2ef9a7;};'use strict';var Sequelize=require(_0x1918('0x0'));var moment=require(_0x1918('0x1'));module[_0x1918('0x2')]={'channel':{'type':Sequelize[_0x1918('0x3')]},'membername':{'type':Sequelize[_0x1918('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1918('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x1918('0x4')},'duration':{'type':Sequelize[_0x1918('0x5')]},'enterAt':{'type':Sequelize[_0x1918('0x6')]},'exitAt':{'type':Sequelize[_0x1918('0x6')],'set':function(_0x424951){var _0x4106d7=moment(_0x424951);var _0x4cf696=moment(this[_0x1918('0x7')]('enterAt'));var _0x434acb=_0x4106d7['diff'](_0x4cf696,_0x1918('0x8'));this[_0x1918('0x9')](_0x1918('0xa'),_0x424951);this[_0x1918('0x9')](_0x1918('0xb'),_0x434acb||null);}},'data1':{'type':Sequelize[_0x1918('0x3')],'comment':_0x1918('0xc')},'data2':{'type':Sequelize[_0x1918('0x3')],'comment':_0x1918('0xd')},'data3':{'type':Sequelize[_0x1918('0x3')],'comment':_0x1918('0xe')},'data4':{'type':Sequelize[_0x1918('0x3')],'comment':_0x1918('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0x1918('0x10')},'role':{'type':Sequelize[_0x1918('0x3')]},'internal':{'type':Sequelize[_0x1918('0x5')]},'uniqueid':{'type':Sequelize[_0x1918('0x3')]}}; \ No newline at end of file +var _0xd110=['DATE','getDataValue','diff','seconds','setDataValue','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd110,0x1e8));var _0x0d11=function(_0x36c79c,_0x441e3f){_0x36c79c=_0x36c79c-0x0;var _0x38230a=_0xd110[_0x36c79c];return _0x38230a;};'use strict';var Sequelize=require(_0x0d11('0x0'));var moment=require(_0x0d11('0x1'));module[_0x0d11('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0d11('0x3')]},'interface':{'type':Sequelize[_0x0d11('0x3')]},'type':{'type':Sequelize[_0x0d11('0x3')],'defaultValue':_0x0d11('0x4'),'comment':_0x0d11('0x5')},'duration':{'type':Sequelize[_0x0d11('0x6')]},'enterAt':{'type':Sequelize[_0x0d11('0x7')]},'exitAt':{'type':Sequelize[_0x0d11('0x7')],'set':function(_0x578537){var _0xf61dad=moment(_0x578537);var _0x5a889c=moment(this[_0x0d11('0x8')]('enterAt'));var _0x47a493=_0xf61dad[_0x0d11('0x9')](_0x5a889c,_0x0d11('0xa'));this[_0x0d11('0xb')]('exitAt',_0x578537);this[_0x0d11('0xb')]('duration',_0x47a493||null);}},'data1':{'type':Sequelize[_0x0d11('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x0d11('0x3')],'comment':_0x0d11('0xc')},'data3':{'type':Sequelize[_0x0d11('0x3')],'comment':_0x0d11('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x0d11('0xe')},'data5':{'type':Sequelize[_0x0d11('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x0d11('0x3')]},'internal':{'type':Sequelize[_0x0d11('0x6')]},'uniqueid':{'type':Sequelize[_0x0d11('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 633d827..9d98d57 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(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xedd9,0xfc));var _0x9edd=function(_0x46aa71,_0x38ed7f){_0x46aa71=_0x46aa71-0x0;var _0x27798c=_0xedd9[_0x46aa71];return _0x27798c;};'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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x2304ce,_0x5e2bb0){var _0x503964=function(_0x13e9f2){while(--_0x13e9f2){_0x2304ce['push'](_0x2304ce['shift']());}};_0x503964(++_0x5e2bb0);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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['MemberReport']['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['MemberReport'][_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['MemberReport'][_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('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index bff26c2..1cbaa8b 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 _0x7097=['path','rimraf','../../config/environment','exports','MemberReport','report_member','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x5314c9,_0x232b58){var _0x54b066=function(_0x258713){while(--_0x258713){_0x5314c9['push'](_0x5314c9['shift']());}};_0x54b066(++_0x232b58);}(_0x7097,0x1be));var _0x7709=function(_0x51e5ce,_0xff47ae){_0x51e5ce=_0x51e5ce-0x0;var _0x146167=_0x7097[_0x51e5ce];return _0x146167;};'use strict';var _=require(_0x7709('0x0'));var util=require(_0x7709('0x1'));var logger=require(_0x7709('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7709('0x3'));var rp=require(_0x7709('0x4'));var fs=require('fs');var path=require(_0x7709('0x5'));var rimraf=require(_0x7709('0x6'));var config=require(_0x7709('0x7'));var attributes=require('./memberReport.attributes');module[_0x7709('0x8')]=function(_0x5811bf,_0xa77e55){return _0x5811bf['define'](_0x7709('0x9'),attributes,{'tableName':_0x7709('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8afd=['../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername','interface','lodash','util','api','moment','bluebird','path'];(function(_0x27f146,_0x5515bf){var _0xd45e2a=function(_0x51dce2){while(--_0x51dce2){_0x27f146['push'](_0x27f146['shift']());}};_0xd45e2a(++_0x5515bf);}(_0x8afd,0xf1));var _0xd8af=function(_0x12ed4e,_0x16c05c){_0x12ed4e=_0x12ed4e-0x0;var _0x1f71a9=_0x8afd[_0x12ed4e];return _0x1f71a9;};'use strict';var _=require(_0xd8af('0x0'));var util=require(_0xd8af('0x1'));var logger=require('../../config/logger')(_0xd8af('0x2'));var moment=require(_0xd8af('0x3'));var BPromise=require(_0xd8af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8af('0x5'));var rimraf=require('rimraf');var config=require(_0xd8af('0x6'));var attributes=require(_0xd8af('0x7'));module['exports']=function(_0x54a2b8,_0x44d69c){return _0x54a2b8[_0xd8af('0x8')](_0xd8af('0x9'),attributes,{'tableName':_0xd8af('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xd8af('0xb'),_0xd8af('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index f3f6357..82997b8 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 _0x6003=['info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','MemberReport','create','CreateMemberReport','UpdateMemberReport','body','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x6d8628,_0x435cca){var _0x220d1a=function(_0x356d50){while(--_0x356d50){_0x6d8628['push'](_0x6d8628['shift']());}};_0x220d1a(++_0x435cca);}(_0x6003,0xae));var _0x3600=function(_0x4b719f,_0x25d358){_0x4b719f=_0x4b719f-0x0;var _0x47d18b=_0x6003[_0x4b719f];return _0x47d18b;};'use strict';var _=require(_0x3600('0x0'));var util=require(_0x3600('0x1'));var moment=require(_0x3600('0x2'));var BPromise=require(_0x3600('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3600('0x4'))['db'];var utils=require(_0x3600('0x5'));var logger=require(_0x3600('0x6'))('rpc');var config=require(_0x3600('0x7'));var jayson=require(_0x3600('0x8'));var client=jayson['client'][_0x3600('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f4130,_0x4880c7,_0x177f11){return new BPromise(function(_0x4a5962,_0x145243){return client['request'](_0x4f4130,_0x177f11)[_0x3600('0xa')](function(_0x22f1b3){logger[_0x3600('0xb')](_0x3600('0xc'),_0x4880c7,'request\x20sent');logger[_0x3600('0xd')](_0x3600('0xe'),_0x4880c7,_0x3600('0xf'),JSON[_0x3600('0x10')](_0x22f1b3));if(_0x22f1b3[_0x3600('0x11')]){if(_0x22f1b3[_0x3600('0x11')][_0x3600('0x12')]===0x1f4){logger[_0x3600('0x11')](_0x3600('0xc'),_0x4880c7,_0x22f1b3[_0x3600('0x11')][_0x3600('0x13')]);return _0x145243(_0x22f1b3[_0x3600('0x11')]['message']);}logger[_0x3600('0x11')]('MemberReport,\x20%s,\x20%s',_0x4880c7,_0x22f1b3['error'][_0x3600('0x13')]);return _0x4a5962(_0x22f1b3[_0x3600('0x11')][_0x3600('0x13')]);}else{logger['info'](_0x3600('0xc'),_0x4880c7,'request\x20sent');_0x4a5962(_0x22f1b3[_0x3600('0x14')]['message']);}})[_0x3600('0x15')](function(_0xb11c9d){logger[_0x3600('0x11')]('MemberReport,\x20%s,\x20%s',_0x4880c7,_0xb11c9d);_0x145243(_0xb11c9d);});});}exports['GetMemberReport']=function(_0x680b80){var _0x274012=this;return new Promise(function(_0xcb98b5,_0x2d8f10){return db['MemberReport'][_0x3600('0x16')]({'raw':_0x680b80['options']?_0x680b80[_0x3600('0x17')][_0x3600('0x18')]===undefined?!![]:![]:!![],'where':_0x680b80[_0x3600('0x17')]?_0x680b80['options'][_0x3600('0x19')]||null:null,'attributes':_0x680b80['options']?_0x680b80[_0x3600('0x17')][_0x3600('0x1a')]||null:null,'limit':_0x680b80[_0x3600('0x17')]?_0x680b80[_0x3600('0x17')][_0x3600('0x1b')]||null:null,'include':_0x680b80['options']?_0x680b80[_0x3600('0x17')][_0x3600('0x1c')]?_[_0x3600('0x1d')](_0x680b80[_0x3600('0x17')][_0x3600('0x1c')],function(_0x148155){return{'model':db[_0x148155[_0x3600('0x1e')]],'as':_0x148155['as'],'attributes':_0x148155[_0x3600('0x1a')],'include':_0x148155[_0x3600('0x1c')]?_[_0x3600('0x1d')](_0x148155[_0x3600('0x1c')],function(_0x51bdb8){return{'model':db[_0x51bdb8[_0x3600('0x1e')]],'as':_0x51bdb8['as'],'attributes':_0x51bdb8['attributes'],'include':_0x51bdb8[_0x3600('0x1c')]?_['map'](_0x51bdb8[_0x3600('0x1c')],function(_0x1c6b74){return{'model':db[_0x1c6b74[_0x3600('0x1e')]],'as':_0x1c6b74['as'],'attributes':_0x1c6b74[_0x3600('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3600('0xa')](function(_0x20c68d){logger['info'](_0x3600('0x1f'),_0x680b80);logger[_0x3600('0xd')]('GetMemberReport',_0x680b80,JSON[_0x3600('0x10')](_0x20c68d));_0xcb98b5(_0x20c68d);})[_0x3600('0x15')](function(_0x2854cd){logger[_0x3600('0x11')](_0x3600('0x1f'),_0x2854cd[_0x3600('0x13')],_0x680b80);_0x2d8f10(_0x274012[_0x3600('0x11')](0x1f4,_0x2854cd[_0x3600('0x13')]));});});};exports['CreateMemberReport']=function(_0x5cc2d9){var _0x386e47=this;return new Promise(function(_0x531845,_0x12b841){return db[_0x3600('0x20')][_0x3600('0x21')](_0x5cc2d9['body'],{'raw':_0x5cc2d9['options']?_0x5cc2d9[_0x3600('0x17')][_0x3600('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4511b4){logger[_0x3600('0xb')](_0x3600('0x22'),_0x5cc2d9);logger['debug'](_0x3600('0x22'),_0x5cc2d9,JSON[_0x3600('0x10')](_0x4511b4));_0x531845(_0x4511b4);})[_0x3600('0x15')](function(_0x16325c){logger[_0x3600('0x11')](_0x3600('0x22'),_0x16325c[_0x3600('0x13')],_0x5cc2d9);_0x12b841(_0x386e47[_0x3600('0x11')](0x1f4,_0x16325c[_0x3600('0x13')]));});});};exports[_0x3600('0x23')]=function(_0x13615){var _0x174b0b=this;return new Promise(function(_0x45380a,_0x5237ee){return db[_0x3600('0x20')]['update'](_0x13615[_0x3600('0x24')],{'raw':_0x13615['options']?_0x13615[_0x3600('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13615[_0x3600('0x17')]?_0x13615[_0x3600('0x17')][_0x3600('0x19')]||null:null,'attributes':_0x13615[_0x3600('0x17')]?_0x13615[_0x3600('0x17')][_0x3600('0x1a')]||null:null,'limit':_0x13615[_0x3600('0x17')]?_0x13615[_0x3600('0x17')]['limit']||null:null})['then'](function(_0x4189e0){logger[_0x3600('0xb')](_0x3600('0x23'),_0x13615);logger['debug'](_0x3600('0x23'),_0x13615,JSON['stringify'](_0x4189e0));_0x45380a(_0x4189e0);})[_0x3600('0x15')](function(_0x4232b0){logger['error'](_0x3600('0x23'),_0x4232b0[_0x3600('0x13')],_0x13615);_0x5237ee(_0x174b0b[_0x3600('0x11')](0x1f4,_0x4232b0[_0x3600('0x13')]));});});}; \ No newline at end of file +var _0xcd05=['MemberReport','create','body','UpdateMemberReport','update','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','findAll','options','raw','where','attributes','limit','map','include','model','GetMemberReport','catch','CreateMemberReport'];(function(_0x49a4b6,_0x170c9e){var _0x3d1f88=function(_0xbf0cb2){while(--_0xbf0cb2){_0x49a4b6['push'](_0x49a4b6['shift']());}};_0x3d1f88(++_0x170c9e);}(_0xcd05,0x163));var _0x5cd0=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xcd05[_0x363ef8];return _0x148822;};'use strict';var _=require(_0x5cd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5cd0('0x1'));var fs=require('fs');var Redis=require(_0x5cd0('0x2'));var db=require(_0x5cd0('0x3'))['db'];var utils=require(_0x5cd0('0x4'));var logger=require('../../config/logger')(_0x5cd0('0x5'));var config=require(_0x5cd0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10fd06,_0x3cfb51,_0x3f609e){return new BPromise(function(_0x2a95a6,_0x3c0593){return client[_0x5cd0('0x7')](_0x10fd06,_0x3f609e)[_0x5cd0('0x8')](function(_0x5b5682){logger[_0x5cd0('0x9')](_0x5cd0('0xa'),_0x3cfb51,_0x5cd0('0xb'));logger[_0x5cd0('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x3cfb51,_0x5cd0('0xb'),JSON[_0x5cd0('0xd')](_0x5b5682));if(_0x5b5682[_0x5cd0('0xe')]){if(_0x5b5682[_0x5cd0('0xe')][_0x5cd0('0xf')]===0x1f4){logger[_0x5cd0('0xe')](_0x5cd0('0xa'),_0x3cfb51,_0x5b5682[_0x5cd0('0xe')][_0x5cd0('0x10')]);return _0x3c0593(_0x5b5682[_0x5cd0('0xe')]['message']);}logger['error']('MemberReport,\x20%s,\x20%s',_0x3cfb51,_0x5b5682[_0x5cd0('0xe')][_0x5cd0('0x10')]);return _0x2a95a6(_0x5b5682['error'][_0x5cd0('0x10')]);}else{logger['info'](_0x5cd0('0xa'),_0x3cfb51,_0x5cd0('0xb'));_0x2a95a6(_0x5b5682[_0x5cd0('0x11')]['message']);}})['catch'](function(_0x489f62){logger[_0x5cd0('0xe')](_0x5cd0('0xa'),_0x3cfb51,_0x489f62);_0x3c0593(_0x489f62);});});}exports['GetMemberReport']=function(_0x57d81d){var _0x4b7dac=this;return new Promise(function(_0x1847dd,_0x106c1e){return db['MemberReport'][_0x5cd0('0x12')]({'raw':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x14')]===undefined?!![]:![]:!![],'where':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x15')]||null:null,'attributes':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x16')]||null:null,'limit':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x17')]||null:null,'include':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d['options']['include']?_[_0x5cd0('0x18')](_0x57d81d['options'][_0x5cd0('0x19')],function(_0x2e01b6){return{'model':db[_0x2e01b6[_0x5cd0('0x1a')]],'as':_0x2e01b6['as'],'attributes':_0x2e01b6[_0x5cd0('0x16')],'include':_0x2e01b6[_0x5cd0('0x19')]?_[_0x5cd0('0x18')](_0x2e01b6[_0x5cd0('0x19')],function(_0x5385db){return{'model':db[_0x5385db['model']],'as':_0x5385db['as'],'attributes':_0x5385db[_0x5cd0('0x16')],'include':_0x5385db[_0x5cd0('0x19')]?_[_0x5cd0('0x18')](_0x5385db[_0x5cd0('0x19')],function(_0x5bff8a){return{'model':db[_0x5bff8a[_0x5cd0('0x1a')]],'as':_0x5bff8a['as'],'attributes':_0x5bff8a[_0x5cd0('0x16')]};}):[]};}):[]};}):[]:[]})[_0x5cd0('0x8')](function(_0x53a6cf){logger['info'](_0x5cd0('0x1b'),_0x57d81d);logger[_0x5cd0('0xc')]('GetMemberReport',_0x57d81d,JSON[_0x5cd0('0xd')](_0x53a6cf));_0x1847dd(_0x53a6cf);})[_0x5cd0('0x1c')](function(_0x2dfb5d){logger[_0x5cd0('0xe')](_0x5cd0('0x1b'),_0x2dfb5d[_0x5cd0('0x10')],_0x57d81d);_0x106c1e(_0x4b7dac[_0x5cd0('0xe')](0x1f4,_0x2dfb5d['message']));});});};exports[_0x5cd0('0x1d')]=function(_0x1621f9){var _0x1b88ac=this;return new Promise(function(_0x3a4b2f,_0x400148){return db[_0x5cd0('0x1e')][_0x5cd0('0x1f')](_0x1621f9[_0x5cd0('0x20')],{'raw':_0x1621f9[_0x5cd0('0x13')]?_0x1621f9[_0x5cd0('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x5cd0('0x8')](function(_0x3fb346){logger['info'](_0x5cd0('0x1d'),_0x1621f9);logger['debug'](_0x5cd0('0x1d'),_0x1621f9,JSON[_0x5cd0('0xd')](_0x3fb346));_0x3a4b2f(_0x3fb346);})['catch'](function(_0x42974c){logger['error'](_0x5cd0('0x1d'),_0x42974c[_0x5cd0('0x10')],_0x1621f9);_0x400148(_0x1b88ac[_0x5cd0('0xe')](0x1f4,_0x42974c['message']));});});};exports[_0x5cd0('0x21')]=function(_0x5368ff){var _0xa84bd2=this;return new Promise(function(_0x1a4855,_0x599355){return db[_0x5cd0('0x1e')][_0x5cd0('0x22')](_0x5368ff[_0x5cd0('0x20')],{'raw':_0x5368ff[_0x5cd0('0x13')]?_0x5368ff[_0x5cd0('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5368ff['options']?_0x5368ff[_0x5cd0('0x13')][_0x5cd0('0x15')]||null:null,'attributes':_0x5368ff['options']?_0x5368ff[_0x5cd0('0x13')][_0x5cd0('0x16')]||null:null,'limit':_0x5368ff[_0x5cd0('0x13')]?_0x5368ff[_0x5cd0('0x13')][_0x5cd0('0x17')]||null:null})['then'](function(_0x2a67e6){logger[_0x5cd0('0x9')](_0x5cd0('0x21'),_0x5368ff);logger[_0x5cd0('0xc')](_0x5cd0('0x21'),_0x5368ff,JSON[_0x5cd0('0xd')](_0x2a67e6));_0x1a4855(_0x2a67e6);})[_0x5cd0('0x1c')](function(_0x1dc8e4){logger[_0x5cd0('0xe')](_0x5cd0('0x21'),_0x1dc8e4[_0x5cd0('0x10')],_0x5368ff);_0x599355(_0xa84bd2[_0x5cd0('0xe')](0x1f4,_0x1dc8e4[_0x5cd0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 382b535..4723aff 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 _0xb33b=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index','exports'];(function(_0x202b05,_0x5a246c){var _0x22a0a7=function(_0x5157f2){while(--_0x5157f2){_0x202b05['push'](_0x202b05['shift']());}};_0x22a0a7(++_0x5a246c);}(_0xb33b,0x1a2));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xbb33('0x0'));var path=require(_0xbb33('0x1'));var timeout=require(_0xbb33('0x2'));var express=require(_0xbb33('0x3'));var router=express[_0xbb33('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb33('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbb33('0x6'));var controller=require(_0xbb33('0x7'));router[_0xbb33('0x8')]('/',controller[_0xbb33('0x9')]);module[_0xbb33('0xa')]=router; \ No newline at end of file +var _0x28e1=['index','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x14d617,_0x1a2060){var _0x2967b6=function(_0x511e92){while(--_0x511e92){_0x14d617['push'](_0x14d617['shift']());}};_0x2967b6(++_0x1a2060);}(_0x28e1,0x85));var _0x128e=function(_0x9fe54,_0x55944a){_0x9fe54=_0x9fe54-0x0;var _0x5ef6d6=_0x28e1[_0x9fe54];return _0x5ef6d6;};'use strict';var multer=require(_0x128e('0x0'));var util=require('util');var path=require(_0x128e('0x1'));var timeout=require(_0x128e('0x2'));var express=require(_0x128e('0x3'));var router=express[_0x128e('0x4')]();var fs_extra=require(_0x128e('0x5'));var auth=require(_0x128e('0x6'));var interaction=require(_0x128e('0x7'));var config=require(_0x128e('0x8'));var controller=require('./migration.controller');router[_0x128e('0x9')]('/',controller[_0x128e('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 87449b5..1b62225 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 _0xf46c=['exports','STRING','sequelize'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0xf46c,0x16d));var _0xcf46=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf46c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcf46('0x0'));module[_0xcf46('0x1')]={'version':{'type':Sequelize[_0xcf46('0x2')],'unique':'version'}}; \ No newline at end of file +var _0xaa89=['sequelize','exports','STRING','version'];(function(_0x1aae33,_0x110a80){var _0x2e91e9=function(_0x218767){while(--_0x218767){_0x1aae33['push'](_0x1aae33['shift']());}};_0x2e91e9(++_0x110a80);}(_0xaa89,0x178));var _0x9aa8=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0xaa89[_0x168127];return _0x4c99ad;};'use strict';var Sequelize=require(_0x9aa8('0x0'));module[_0x9aa8('0x1')]={'version':{'type':Sequelize[_0x9aa8('0x2')],'unique':_0x9aa8('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 5c432d0..1c711b6 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 _0xc672=['reject','save','update','then','destroy','error','name','send','index','Migration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0xfaca81,_0x8971df){var _0x2ecdb4=function(_0xf4ff0b){while(--_0xf4ff0b){_0xfaca81['push'](_0xfaca81['shift']());}};_0x2ecdb4(++_0x8971df);}(_0xc672,0xf8));var _0x2c67=function(_0x283f84,_0x14b54f){_0x283f84=_0x283f84-0x0;var _0x50372f=_0xc672[_0x283f84];return _0x50372f;};'use strict';var emlformat=require(_0x2c67('0x0'));var rimraf=require(_0x2c67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c67('0x2'));var rp=require(_0x2c67('0x3'));var moment=require('moment');var BPromise=require(_0x2c67('0x4'));var Mustache=require(_0x2c67('0x5'));var util=require(_0x2c67('0x6'));var path=require(_0x2c67('0x7'));var sox=require('sox');var csv=require(_0x2c67('0x8'));var ejs=require(_0x2c67('0x9'));var fs=require('fs');var fs_extra=require(_0x2c67('0xa'));var _=require(_0x2c67('0xb'));var squel=require(_0x2c67('0xc'));var crypto=require('crypto');var jsforce=require(_0x2c67('0xd'));var deskjs=require(_0x2c67('0xe'));var toCsv=require(_0x2c67('0x8'));var querystring=require(_0x2c67('0xf'));var Papa=require(_0x2c67('0x10'));var Redis=require(_0x2c67('0x11'));var authService=require(_0x2c67('0x12'));var qs=require(_0x2c67('0x13'));var as=require(_0x2c67('0x14'));var hardwareService=require(_0x2c67('0x15'));var logger=require(_0x2c67('0x16'))(_0x2c67('0x17'));var utils=require(_0x2c67('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2c67('0x19'));var db=require(_0x2c67('0x1a'))['db'];function respondWithStatusCode(_0x3919d9,_0x54bf6c){_0x54bf6c=_0x54bf6c||0xcc;return function(_0x6d5615){if(_0x6d5615){return _0x3919d9[_0x2c67('0x1b')](_0x54bf6c);}return _0x3919d9[_0x2c67('0x1c')](_0x54bf6c)[_0x2c67('0x1d')]();};}function respondWithResult(_0x570be3,_0x220f6b){_0x220f6b=_0x220f6b||0xc8;return function(_0x335dbb){if(_0x335dbb){return _0x570be3['status'](_0x220f6b)[_0x2c67('0x1e')](_0x335dbb);}};}function respondWithFilteredResult(_0x1b25f2,_0x532df4){return function(_0x1e08b5){if(_0x1e08b5){var _0x363000=typeof _0x532df4['offset']===_0x2c67('0x1f')&&typeof _0x532df4[_0x2c67('0x20')]===_0x2c67('0x1f');var _0x4e3e63=_0x1e08b5[_0x2c67('0x21')];var _0x2a3971=_0x363000?0x0:_0x532df4[_0x2c67('0x22')];var _0x5bda50=_0x363000?_0x1e08b5[_0x2c67('0x21')]:_0x532df4[_0x2c67('0x22')]+_0x532df4[_0x2c67('0x20')];var _0x52f4fb;if(_0x5bda50>=_0x4e3e63){_0x5bda50=_0x4e3e63;_0x52f4fb=0xc8;}else{_0x52f4fb=0xce;}_0x1b25f2[_0x2c67('0x1c')](_0x52f4fb);return _0x1b25f2[_0x2c67('0x23')]('Content-Range',_0x2a3971+'-'+_0x5bda50+'/'+_0x4e3e63)['json'](_0x1e08b5);}return null;};}function patchUpdates(_0x4338f3){return function(_0x43f5e6){try{jsonpatch['apply'](_0x43f5e6,_0x4338f3,!![]);}catch(_0x2494bc){return BPromise[_0x2c67('0x24')](_0x2494bc);}return _0x43f5e6[_0x2c67('0x25')]();};}function saveUpdates(_0x19ae9f,_0x35f023){return function(_0x1a9623){if(_0x1a9623){return _0x1a9623[_0x2c67('0x26')](_0x19ae9f)[_0x2c67('0x27')](function(_0x314ff1){return _0x314ff1;});}return null;};}function removeEntity(_0x241b54,_0x3c3d97){return function(_0x439c5b){if(_0x439c5b){return _0x439c5b[_0x2c67('0x28')]()['then'](function(){_0x241b54['status'](0xcc)[_0x2c67('0x1d')]();});}};}function handleEntityNotFound(_0x41e1ed,_0x879d10){return function(_0x5b60e7){if(!_0x5b60e7){_0x41e1ed[_0x2c67('0x1b')](0x194);}return _0x5b60e7;};}function handleError(_0x52816c,_0x4b0312){_0x4b0312=_0x4b0312||0x1f4;return function(_0x56c06d){logger[_0x2c67('0x29')](_0x56c06d['stack']);if(_0x56c06d[_0x2c67('0x2a')]){delete _0x56c06d[_0x2c67('0x2a')];}_0x52816c[_0x2c67('0x1c')](_0x4b0312)[_0x2c67('0x2b')](_0x56c06d);};}exports[_0x2c67('0x2c')]=function(_0x58c379,_0x599cab){var _0x1be52b={},_0x567408={},_0x2df18f={'count':0x0,'rows':[]};var _0x26f4e3=_['map'](db[_0x2c67('0x2d')][_0x2c67('0x2e')],function(_0x5f8c92){return{'name':_0x5f8c92[_0x2c67('0x2f')],'type':_0x5f8c92[_0x2c67('0x30')][_0x2c67('0x31')]};});_0x567408[_0x2c67('0x32')]=_[_0x2c67('0x33')](_0x26f4e3,_0x2c67('0x2a'));_0x567408[_0x2c67('0x34')]=_[_0x2c67('0x35')](_0x58c379[_0x2c67('0x34')]);_0x567408[_0x2c67('0x36')]=_[_0x2c67('0x37')](_0x567408['model'],_0x567408[_0x2c67('0x34')]);_0x1be52b[_0x2c67('0x38')]=_['intersection'](_0x567408['model'],qs[_0x2c67('0x39')](_0x58c379['query'][_0x2c67('0x39')]));_0x1be52b[_0x2c67('0x38')]=_0x1be52b[_0x2c67('0x38')][_0x2c67('0x3a')]?_0x1be52b['attributes']:_0x567408[_0x2c67('0x32')];if(!_0x58c379[_0x2c67('0x34')][_0x2c67('0x3b')]('nolimit')){_0x1be52b[_0x2c67('0x20')]=qs[_0x2c67('0x20')](_0x58c379['query'][_0x2c67('0x20')]);_0x1be52b[_0x2c67('0x22')]=qs[_0x2c67('0x22')](_0x58c379[_0x2c67('0x34')][_0x2c67('0x22')]);}_0x1be52b['order']=qs[_0x2c67('0x3c')](_0x58c379['query']['sort']);_0x1be52b[_0x2c67('0x3d')]=qs[_0x2c67('0x36')](_[_0x2c67('0x3e')](_0x58c379[_0x2c67('0x34')],_0x567408[_0x2c67('0x36')]),_0x26f4e3);if(_0x58c379[_0x2c67('0x34')][_0x2c67('0x3f')]){_0x1be52b['where']=_[_0x2c67('0x40')](_0x1be52b[_0x2c67('0x3d')],{'$or':_[_0x2c67('0x33')](_0x26f4e3,function(_0x108cf4){if(_0x108cf4['type']!==_0x2c67('0x41')){var _0x5b5d35={};_0x5b5d35[_0x108cf4[_0x2c67('0x2a')]]={'$like':'%'+_0x58c379['query'][_0x2c67('0x3f')]+'%'};return _0x5b5d35;}})});}_0x1be52b=_[_0x2c67('0x40')]({},_0x1be52b,_0x58c379['options']);var _0x51547f={'where':_0x1be52b[_0x2c67('0x3d')]};return db['Migration'][_0x2c67('0x21')](_0x51547f)['then'](function(_0x103212){_0x2df18f[_0x2c67('0x21')]=_0x103212;if(_0x58c379[_0x2c67('0x34')][_0x2c67('0x42')]){_0x1be52b[_0x2c67('0x43')]=[{'all':!![]}];}return db[_0x2c67('0x2d')][_0x2c67('0x44')](_0x1be52b);})[_0x2c67('0x27')](function(_0x2a7416){_0x2df18f[_0x2c67('0x45')]=_0x2a7416;return _0x2df18f;})[_0x2c67('0x27')](respondWithFilteredResult(_0x599cab,_0x1be52b))[_0x2c67('0x46')](handleError(_0x599cab,null));}; \ No newline at end of file +var _0xc3c7=['options','includeAll','include','rows','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','Migration','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xc3c7,0x159));var _0x7c3c=function(_0x441d3a,_0x49bed8){_0x441d3a=_0x441d3a-0x0;var _0x32a7c3=_0xc3c7[_0x441d3a];return _0x32a7c3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7c3c('0x0'));var jsonpatch=require(_0x7c3c('0x1'));var rp=require(_0x7c3c('0x2'));var moment=require(_0x7c3c('0x3'));var BPromise=require(_0x7c3c('0x4'));var Mustache=require(_0x7c3c('0x5'));var util=require(_0x7c3c('0x6'));var path=require(_0x7c3c('0x7'));var sox=require(_0x7c3c('0x8'));var csv=require(_0x7c3c('0x9'));var ejs=require(_0x7c3c('0xa'));var fs=require('fs');var fs_extra=require(_0x7c3c('0xb'));var _=require(_0x7c3c('0xc'));var squel=require('squel');var crypto=require(_0x7c3c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7c3c('0xe'));var toCsv=require(_0x7c3c('0x9'));var querystring=require(_0x7c3c('0xf'));var Papa=require(_0x7c3c('0x10'));var Redis=require(_0x7c3c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7c3c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7c3c('0x13'));var config=require(_0x7c3c('0x14'));var licenseUtil=require(_0x7c3c('0x15'));var db=require(_0x7c3c('0x16'))['db'];function respondWithStatusCode(_0xa51a72,_0x334934){_0x334934=_0x334934||0xcc;return function(_0x81d4ba){if(_0x81d4ba){return _0xa51a72['sendStatus'](_0x334934);}return _0xa51a72[_0x7c3c('0x17')](_0x334934)['end']();};}function respondWithResult(_0x115ecd,_0x3ba8f5){_0x3ba8f5=_0x3ba8f5||0xc8;return function(_0x1c5740){if(_0x1c5740){return _0x115ecd['status'](_0x3ba8f5)['json'](_0x1c5740);}};}function respondWithFilteredResult(_0x2454bd,_0x43c91e){return function(_0x29df9e){if(_0x29df9e){var _0x2d1231=typeof _0x43c91e['offset']===_0x7c3c('0x18')&&typeof _0x43c91e[_0x7c3c('0x19')]===_0x7c3c('0x18');var _0x3a439b=_0x29df9e[_0x7c3c('0x1a')];var _0x4fce42=_0x2d1231?0x0:_0x43c91e['offset'];var _0x4b9a14=_0x2d1231?_0x29df9e[_0x7c3c('0x1a')]:_0x43c91e[_0x7c3c('0x1b')]+_0x43c91e['limit'];var _0x1006c4;if(_0x4b9a14>=_0x3a439b){_0x4b9a14=_0x3a439b;_0x1006c4=0xc8;}else{_0x1006c4=0xce;}_0x2454bd[_0x7c3c('0x17')](_0x1006c4);return _0x2454bd[_0x7c3c('0x1c')](_0x7c3c('0x1d'),_0x4fce42+'-'+_0x4b9a14+'/'+_0x3a439b)['json'](_0x29df9e);}return null;};}function patchUpdates(_0x576e18){return function(_0x25a057){try{jsonpatch['apply'](_0x25a057,_0x576e18,!![]);}catch(_0x50a282){return BPromise[_0x7c3c('0x1e')](_0x50a282);}return _0x25a057[_0x7c3c('0x1f')]();};}function saveUpdates(_0x5abfe1,_0x3a5235){return function(_0x1815a2){if(_0x1815a2){return _0x1815a2['update'](_0x5abfe1)[_0x7c3c('0x20')](function(_0x567a53){return _0x567a53;});}return null;};}function removeEntity(_0xf8f613,_0x16ef61){return function(_0xded16){if(_0xded16){return _0xded16[_0x7c3c('0x21')]()['then'](function(){_0xf8f613[_0x7c3c('0x17')](0xcc)[_0x7c3c('0x22')]();});}};}function handleEntityNotFound(_0x10dffa,_0x4d56bc){return function(_0x3e3566){if(!_0x3e3566){_0x10dffa[_0x7c3c('0x23')](0x194);}return _0x3e3566;};}function handleError(_0x16d926,_0xba7b68){_0xba7b68=_0xba7b68||0x1f4;return function(_0x477207){logger[_0x7c3c('0x24')](_0x477207[_0x7c3c('0x25')]);if(_0x477207['name']){delete _0x477207[_0x7c3c('0x26')];}_0x16d926[_0x7c3c('0x17')](_0xba7b68)[_0x7c3c('0x27')](_0x477207);};}exports[_0x7c3c('0x28')]=function(_0x26f258,_0x538533){var _0x98106b={},_0x3341ab={},_0x5bb148={'count':0x0,'rows':[]};var _0x211de6=_[_0x7c3c('0x29')](db[_0x7c3c('0x2a')]['rawAttributes'],function(_0x5ce728){return{'name':_0x5ce728[_0x7c3c('0x2b')],'type':_0x5ce728['type'][_0x7c3c('0x2c')]};});_0x3341ab[_0x7c3c('0x2d')]=_[_0x7c3c('0x29')](_0x211de6,_0x7c3c('0x26'));_0x3341ab[_0x7c3c('0x2e')]=_[_0x7c3c('0x2f')](_0x26f258[_0x7c3c('0x2e')]);_0x3341ab[_0x7c3c('0x30')]=_['intersection'](_0x3341ab[_0x7c3c('0x2d')],_0x3341ab[_0x7c3c('0x2e')]);_0x98106b[_0x7c3c('0x31')]=_[_0x7c3c('0x32')](_0x3341ab['model'],qs[_0x7c3c('0x33')](_0x26f258['query'][_0x7c3c('0x33')]));_0x98106b['attributes']=_0x98106b[_0x7c3c('0x31')][_0x7c3c('0x34')]?_0x98106b[_0x7c3c('0x31')]:_0x3341ab[_0x7c3c('0x2d')];if(!_0x26f258[_0x7c3c('0x2e')][_0x7c3c('0x35')](_0x7c3c('0x36'))){_0x98106b[_0x7c3c('0x19')]=qs['limit'](_0x26f258[_0x7c3c('0x2e')][_0x7c3c('0x19')]);_0x98106b[_0x7c3c('0x1b')]=qs[_0x7c3c('0x1b')](_0x26f258[_0x7c3c('0x2e')][_0x7c3c('0x1b')]);}_0x98106b[_0x7c3c('0x37')]=qs[_0x7c3c('0x38')](_0x26f258['query'][_0x7c3c('0x38')]);_0x98106b[_0x7c3c('0x39')]=qs[_0x7c3c('0x30')](_[_0x7c3c('0x3a')](_0x26f258[_0x7c3c('0x2e')],_0x3341ab[_0x7c3c('0x30')]),_0x211de6);if(_0x26f258['query']['filter']){_0x98106b[_0x7c3c('0x39')]=_[_0x7c3c('0x3b')](_0x98106b['where'],{'$or':_[_0x7c3c('0x29')](_0x211de6,function(_0x23464f){if(_0x23464f[_0x7c3c('0x3c')]!==_0x7c3c('0x3d')){var _0x159479={};_0x159479[_0x23464f['name']]={'$like':'%'+_0x26f258[_0x7c3c('0x2e')][_0x7c3c('0x3e')]+'%'};return _0x159479;}})});}_0x98106b=_[_0x7c3c('0x3b')]({},_0x98106b,_0x26f258[_0x7c3c('0x3f')]);var _0x3f0ba9={'where':_0x98106b[_0x7c3c('0x39')]};return db[_0x7c3c('0x2a')][_0x7c3c('0x1a')](_0x3f0ba9)[_0x7c3c('0x20')](function(_0x356034){_0x5bb148[_0x7c3c('0x1a')]=_0x356034;if(_0x26f258['query'][_0x7c3c('0x40')]){_0x98106b[_0x7c3c('0x41')]=[{'all':!![]}];}return db['Migration']['findAll'](_0x98106b);})[_0x7c3c('0x20')](function(_0x3ea35d){_0x5bb148[_0x7c3c('0x42')]=_0x3ea35d;return _0x5bb148;})[_0x7c3c('0x20')](respondWithFilteredResult(_0x538533,_0x98106b))[_0x7c3c('0x43')](handleError(_0x538533,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index b65f289..4501f7d 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 _0x03dc=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','Migration','migrations','util'];(function(_0x47b0d9,_0x41b561){var _0x599df3=function(_0x4c0c30){while(--_0x4c0c30){_0x47b0d9['push'](_0x47b0d9['shift']());}};_0x599df3(++_0x41b561);}(_0x03dc,0x13e));var _0xc03d=function(_0x58ee87,_0x479193){_0x58ee87=_0x58ee87-0x0;var _0x3ca144=_0x03dc[_0x58ee87];return _0x3ca144;};'use strict';var _=require('lodash');var util=require(_0xc03d('0x0'));var logger=require(_0xc03d('0x1'))(_0xc03d('0x2'));var moment=require(_0xc03d('0x3'));var BPromise=require('bluebird');var rp=require(_0xc03d('0x4'));var fs=require('fs');var path=require(_0xc03d('0x5'));var rimraf=require(_0xc03d('0x6'));var config=require(_0xc03d('0x7'));var attributes=require('./migration.attributes');module['exports']=function(_0x3adcd5,_0xfcb261){return _0x3adcd5[_0xc03d('0x8')](_0xc03d('0x9'),attributes,{'tableName':_0xc03d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc729=['../../config/logger','request-promise','path','../../config/environment','exports','define','migrations','util'];(function(_0x5a8c8a,_0x1d9810){var _0x5c4493=function(_0x15c688){while(--_0x15c688){_0x5a8c8a['push'](_0x5a8c8a['shift']());}};_0x5c4493(++_0x1d9810);}(_0xc729,0x1bf));var _0x9c72=function(_0x11a4d4,_0x4ac6c8){_0x11a4d4=_0x11a4d4-0x0;var _0x55c2f9=_0xc729[_0x11a4d4];return _0x55c2f9;};'use strict';var _=require('lodash');var util=require(_0x9c72('0x0'));var logger=require(_0x9c72('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9c72('0x2'));var fs=require('fs');var path=require(_0x9c72('0x3'));var rimraf=require('rimraf');var config=require(_0x9c72('0x4'));var attributes=require('./migration.attributes');module[_0x9c72('0x5')]=function(_0x5ae7a3,_0xe487f){return _0x5ae7a3[_0x9c72('0x6')]('Migration',attributes,{'tableName':_0x9c72('0x7'),'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 3b7d2fc..3db60b5 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 _0xbf5c=['request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s'];(function(_0x3638d9,_0x3e1868){var _0x17dd0f=function(_0x58b69f){while(--_0x58b69f){_0x3638d9['push'](_0x3638d9['shift']());}};_0x17dd0f(++_0x3e1868);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x27158d,_0x19ed77){_0x27158d=_0x27158d-0x0;var _0xb8f43f=_0xbf5c[_0x27158d];return _0xb8f43f;};'use strict';var _=require(_0xcbf5('0x0'));var util=require(_0xcbf5('0x1'));var moment=require(_0xcbf5('0x2'));var BPromise=require('bluebird');var rs=require(_0xcbf5('0x3'));var fs=require('fs');var Redis=require(_0xcbf5('0x4'));var db=require(_0xcbf5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbf5('0x6'))(_0xcbf5('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbf5('0x8'));var client=jayson[_0xcbf5('0x9')][_0xcbf5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522014,_0x4504dd,_0x31b6d1){return new BPromise(function(_0x54d2d4,_0x52f784){return client[_0xcbf5('0xb')](_0x522014,_0x31b6d1)[_0xcbf5('0xc')](function(_0x230a6c){logger['info'](_0xcbf5('0xd'),_0x4504dd,_0xcbf5('0xe'));logger[_0xcbf5('0xf')](_0xcbf5('0x10'),_0x4504dd,_0xcbf5('0xe'),JSON[_0xcbf5('0x11')](_0x230a6c));if(_0x230a6c['error']){if(_0x230a6c[_0xcbf5('0x12')][_0xcbf5('0x13')]===0x1f4){logger[_0xcbf5('0x12')]('Migration,\x20%s,\x20%s',_0x4504dd,_0x230a6c['error'][_0xcbf5('0x14')]);return _0x52f784(_0x230a6c['error'][_0xcbf5('0x14')]);}logger[_0xcbf5('0x12')](_0xcbf5('0xd'),_0x4504dd,_0x230a6c[_0xcbf5('0x12')]['message']);return _0x54d2d4(_0x230a6c['error'][_0xcbf5('0x14')]);}else{logger['info'](_0xcbf5('0xd'),_0x4504dd,'request\x20sent');_0x54d2d4(_0x230a6c['result'][_0xcbf5('0x14')]);}})[_0xcbf5('0x15')](function(_0x18753e){logger[_0xcbf5('0x12')](_0xcbf5('0xd'),_0x4504dd,_0x18753e);_0x52f784(_0x18753e);});});} \ No newline at end of file +var _0x19c3=['message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0x19c3,0xf9));var _0x319c=function(_0x1b8ffb,_0x88a3ca){_0x1b8ffb=_0x1b8ffb-0x0;var _0xb1280e=_0x19c3[_0x1b8ffb];return _0xb1280e;};'use strict';var _=require(_0x319c('0x0'));var util=require('util');var moment=require(_0x319c('0x1'));var BPromise=require(_0x319c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x319c('0x3'));var db=require(_0x319c('0x4'))['db'];var utils=require(_0x319c('0x5'));var logger=require(_0x319c('0x6'))(_0x319c('0x7'));var config=require(_0x319c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x319c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e38c4,_0x2df1a9,_0x9a5cf8){return new BPromise(function(_0x306a4b,_0x3662ed){return client['request'](_0x2e38c4,_0x9a5cf8)[_0x319c('0xa')](function(_0x1b7ffd){logger[_0x319c('0xb')](_0x319c('0xc'),_0x2df1a9,_0x319c('0xd'));logger[_0x319c('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x2df1a9,_0x319c('0xd'),JSON['stringify'](_0x1b7ffd));if(_0x1b7ffd[_0x319c('0xf')]){if(_0x1b7ffd[_0x319c('0xf')][_0x319c('0x10')]===0x1f4){logger[_0x319c('0xf')](_0x319c('0xc'),_0x2df1a9,_0x1b7ffd[_0x319c('0xf')][_0x319c('0x11')]);return _0x3662ed(_0x1b7ffd['error']['message']);}logger[_0x319c('0xf')](_0x319c('0xc'),_0x2df1a9,_0x1b7ffd['error'][_0x319c('0x11')]);return _0x306a4b(_0x1b7ffd[_0x319c('0xf')][_0x319c('0x11')]);}else{logger[_0x319c('0xb')](_0x319c('0xc'),_0x2df1a9,_0x319c('0xd'));_0x306a4b(_0x1b7ffd[_0x319c('0x12')]['message']);}})['catch'](function(_0x9415a5){logger[_0x319c('0xf')]('Migration,\x20%s,\x20%s',_0x2df1a9,_0x9415a5);_0x3662ed(_0x9415a5);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 7d5931f..3b065bb 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 _0xf1d4=['path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0xe8fd96,_0x16f429){var _0x2a0568=function(_0x581f60){while(--_0x581f60){_0xe8fd96['push'](_0xe8fd96['shift']());}};_0x2a0568(++_0x16f429);}(_0xf1d4,0x158));var _0x4f1d=function(_0x4a8226,_0x3dc1a5){_0x4a8226=_0x4a8226-0x0;var _0x1cbb1b=_0xf1d4[_0x4a8226];return _0x1cbb1b;};'use strict';var multer=require(_0x4f1d('0x0'));var util=require('util');var path=require(_0x4f1d('0x1'));var timeout=require('connect-timeout');var express=require(_0x4f1d('0x2'));var router=express[_0x4f1d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4f1d('0x4'));var interaction=require(_0x4f1d('0x5'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x4f1d('0x6')]('/',auth[_0x4f1d('0x7')](),controller['index']);router[_0x4f1d('0x6')](_0x4f1d('0x8'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x9')]);router[_0x4f1d('0xa')]('/',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0xb')]);router['put']('/:id',auth[_0x4f1d('0x7')](),controller['update']);router[_0x4f1d('0xc')](_0x4f1d('0x8'),auth['isAuthenticated'](),controller[_0x4f1d('0xd')]);module[_0x4f1d('0xe')]=router; \ No newline at end of file +var _0xcb22=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','post','put','update','delete','exports'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0xcb22,0xc8));var _0x2cb2=function(_0x24fdc7,_0x13b25d){_0x24fdc7=_0x24fdc7-0x0;var _0x321a1f=_0xcb22[_0x24fdc7];return _0x321a1f;};'use strict';var multer=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var path=require(_0x2cb2('0x2'));var timeout=require(_0x2cb2('0x3'));var express=require(_0x2cb2('0x4'));var router=express[_0x2cb2('0x5')]();var fs_extra=require(_0x2cb2('0x6'));var auth=require(_0x2cb2('0x7'));var interaction=require(_0x2cb2('0x8'));var config=require(_0x2cb2('0x9'));var controller=require(_0x2cb2('0xa'));router['get']('/',auth[_0x2cb2('0xb')](),controller[_0x2cb2('0xc')]);router[_0x2cb2('0xd')](_0x2cb2('0xe'),auth[_0x2cb2('0xb')](),controller['show']);router[_0x2cb2('0xf')]('/',auth[_0x2cb2('0xb')](),controller['create']);router[_0x2cb2('0x10')](_0x2cb2('0xe'),auth[_0x2cb2('0xb')](),controller[_0x2cb2('0x11')]);router[_0x2cb2('0x12')](_0x2cb2('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x2cb2('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index cdf6848..413ec52 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 _0x968f=['STRING','sequelize','exports','localnet','stun','turn'];(function(_0xa89d9c,_0x375f83){var _0x2cfe5e=function(_0x29fe06){while(--_0x29fe06){_0xa89d9c['push'](_0xa89d9c['shift']());}};_0x2cfe5e(++_0x375f83);}(_0x968f,0x181));var _0xf968=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x968f[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xf968('0x0'));module[_0xf968('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf968('0x2'),'externip',_0xf968('0x3'),_0xf968('0x4'))},'value':{'type':Sequelize[_0xf968('0x5')]},'username':{'type':Sequelize[_0xf968('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x15fe=['sequelize','exports','ENUM','localnet','stun','turn','STRING'];(function(_0x2fab5d,_0x531fbf){var _0x5e20c6=function(_0x3de054){while(--_0x3de054){_0x2fab5d['push'](_0x2fab5d['shift']());}};_0x5e20c6(++_0x531fbf);}(_0x15fe,0x150));var _0xe15f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x15fe[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xe15f('0x0'));module[_0xe15f('0x1')]={'type':{'type':Sequelize[_0xe15f('0x2')](_0xe15f('0x3'),'externip',_0xe15f('0x4'),_0xe15f('0x5'))},'value':{'type':Sequelize[_0xe15f('0x6')]},'username':{'type':Sequelize[_0xe15f('0x6')]},'password':{'type':Sequelize[_0xe15f('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 4b0acd9..15c3ece 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 _0x521a=['json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','stack','send','index','map','Network','fieldName','type','key','model','name','query','filters','attributes','intersection','length','nolimit','order','sort','where','pick','options','include','findAll','rows','catch','show','keys','rawAttributes','fields','includeAll','merge','create','transaction','toUpperCase','STUN','join','server/files/templates/stun_multiple.ejs','render','Reload','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','body','toLowerCase','chan_sip.so','sequelize','find','params','/etc/asterisk/stun_xcally.conf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','message','result','status','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x521a,0x184));var _0xa521=function(_0x39004d,_0x36de7d){_0x39004d=_0x39004d-0x0;var _0x569966=_0x521a[_0x39004d];return _0x569966;};'use strict';var emlformat=require(_0xa521('0x0'));var rimraf=require(_0xa521('0x1'));var zipdir=require(_0xa521('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa521('0x3'));var moment=require(_0xa521('0x4'));var BPromise=require(_0xa521('0x5'));var Mustache=require(_0xa521('0x6'));var util=require(_0xa521('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa521('0x8'));var fs=require('fs');var fs_extra=require(_0xa521('0x9'));var _=require(_0xa521('0xa'));var squel=require(_0xa521('0xb'));var crypto=require(_0xa521('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa521('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa521('0xe'));var Papa=require(_0xa521('0xf'));var Redis=require(_0xa521('0x10'));var authService=require(_0xa521('0x11'));var qs=require(_0xa521('0x12'));var as=require(_0xa521('0x13'));var hardwareService=require(_0xa521('0x14'));var logger=require(_0xa521('0x15'))(_0xa521('0x16'));var utils=require(_0xa521('0x17'));var config=require(_0xa521('0x18'));var licenseUtil=require(_0xa521('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa521('0x1a'));var client=jayson[_0xa521('0x1b')][_0xa521('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5b4f14,_0x4d7003,_0x1300d4,_0x48ea53){return new BPromise(function(_0x9537a3,_0x1ff4a8){var _0x2f0ccb=_0x48ea53||client;return _0x2f0ccb[_0xa521('0x1d')](_0x5b4f14,_0x1300d4)[_0xa521('0x1e')](function(_0x2683d7){logger[_0xa521('0x1f')](_0xa521('0x20'),_0x4d7003,_0xa521('0x21'));logger['debug'](_0xa521('0x22'),_0x4d7003,_0xa521('0x21'),JSON['stringify'](_0x2683d7));if(_0x2683d7[_0xa521('0x23')]){if(_0x2683d7[_0xa521('0x23')]['code']===0x1f4){logger['error'](_0xa521('0x20'),_0x4d7003,_0x2683d7['error'][_0xa521('0x24')]);return _0x1ff4a8(_0x2683d7['error']['message']);}logger[_0xa521('0x23')](_0xa521('0x20'),_0x4d7003,_0x2683d7[_0xa521('0x23')][_0xa521('0x24')]);return _0x9537a3(_0x2683d7[_0xa521('0x23')][_0xa521('0x24')]);}else{logger[_0xa521('0x1f')](_0xa521('0x20'),_0x4d7003,'request\x20sent');_0x9537a3(_0x2683d7[_0xa521('0x25')][_0xa521('0x24')]);}})['catch'](function(_0x2c13a8){logger[_0xa521('0x23')](_0xa521('0x20'),_0x4d7003,_0x2c13a8);_0x1ff4a8(_0x2c13a8);});});}function respondWithStatusCode(_0x28b6b7,_0x3b08cf){_0x3b08cf=_0x3b08cf||0xcc;return function(_0x22d475){if(_0x22d475){return _0x28b6b7['sendStatus'](_0x3b08cf);}return _0x28b6b7[_0xa521('0x26')](_0x3b08cf)[_0xa521('0x27')]();};}function respondWithResult(_0x45098f,_0x3507cc){_0x3507cc=_0x3507cc||0xc8;return function(_0x4ae9fa){if(_0x4ae9fa){return _0x45098f[_0xa521('0x26')](_0x3507cc)[_0xa521('0x28')](_0x4ae9fa);}};}function respondWithFilteredResult(_0x468182,_0x55b993){return function(_0x1087ef){if(_0x1087ef){var _0xc24686=typeof _0x55b993[_0xa521('0x29')]===_0xa521('0x2a')&&typeof _0x55b993[_0xa521('0x2b')]===_0xa521('0x2a');var _0x48f434=_0x1087ef[_0xa521('0x2c')];var _0x36f9ef=_0xc24686?0x0:_0x55b993[_0xa521('0x29')];var _0x30ea3e=_0xc24686?_0x1087ef['count']:_0x55b993['offset']+_0x55b993['limit'];var _0x138c9c;if(_0x30ea3e>=_0x48f434){_0x30ea3e=_0x48f434;_0x138c9c=0xc8;}else{_0x138c9c=0xce;}_0x468182[_0xa521('0x26')](_0x138c9c);return _0x468182['set'](_0xa521('0x2d'),_0x36f9ef+'-'+_0x30ea3e+'/'+_0x48f434)[_0xa521('0x28')](_0x1087ef);}return null;};}function patchUpdates(_0x277df6){return function(_0xf8c2de){try{jsonpatch[_0xa521('0x2e')](_0xf8c2de,_0x277df6,!![]);}catch(_0xf55e89){return BPromise['reject'](_0xf55e89);}return _0xf8c2de[_0xa521('0x2f')]();};}function saveUpdates(_0x4b3f56,_0x2d145f){return function(_0x56b1a4){if(_0x56b1a4){return _0x56b1a4[_0xa521('0x30')](_0x4b3f56)[_0xa521('0x1e')](function(_0x11dfdc){return _0x11dfdc;});}return null;};}function removeEntity(_0x3cb9af,_0xe7eb07){return function(_0x5c7a11){if(_0x5c7a11){return _0x5c7a11[_0xa521('0x31')]()[_0xa521('0x1e')](function(){_0x3cb9af[_0xa521('0x26')](0xcc)[_0xa521('0x27')]();});}};}function handleEntityNotFound(_0x32bd91,_0x2d6b49){return function(_0x5cacc4){if(!_0x5cacc4){_0x32bd91['sendStatus'](0x194);}return _0x5cacc4;};}function handleError(_0x29ed30,_0x1fd9ed){_0x1fd9ed=_0x1fd9ed||0x1f4;return function(_0x59ac41){logger[_0xa521('0x23')](_0x59ac41[_0xa521('0x32')]);if(_0x59ac41['name']){delete _0x59ac41['name'];}_0x29ed30[_0xa521('0x26')](_0x1fd9ed)[_0xa521('0x33')](_0x59ac41);};}exports[_0xa521('0x34')]=function(_0x352d60,_0x160de0){var _0x2638ff={},_0x2b9c3b={},_0x1fb063={'count':0x0,'rows':[]};var _0xfe36af=_[_0xa521('0x35')](db[_0xa521('0x36')]['rawAttributes'],function(_0x373019){return{'name':_0x373019[_0xa521('0x37')],'type':_0x373019[_0xa521('0x38')][_0xa521('0x39')]};});_0x2b9c3b[_0xa521('0x3a')]=_[_0xa521('0x35')](_0xfe36af,_0xa521('0x3b'));_0x2b9c3b[_0xa521('0x3c')]=_['keys'](_0x352d60['query']);_0x2b9c3b[_0xa521('0x3d')]=_['intersection'](_0x2b9c3b[_0xa521('0x3a')],_0x2b9c3b[_0xa521('0x3c')]);_0x2638ff[_0xa521('0x3e')]=_[_0xa521('0x3f')](_0x2b9c3b['model'],qs['fields'](_0x352d60[_0xa521('0x3c')]['fields']));_0x2638ff[_0xa521('0x3e')]=_0x2638ff['attributes'][_0xa521('0x40')]?_0x2638ff[_0xa521('0x3e')]:_0x2b9c3b[_0xa521('0x3a')];if(!_0x352d60['query']['hasOwnProperty'](_0xa521('0x41'))){_0x2638ff[_0xa521('0x2b')]=qs['limit'](_0x352d60[_0xa521('0x3c')][_0xa521('0x2b')]);_0x2638ff[_0xa521('0x29')]=qs[_0xa521('0x29')](_0x352d60['query'][_0xa521('0x29')]);}_0x2638ff[_0xa521('0x42')]=qs[_0xa521('0x43')](_0x352d60['query'][_0xa521('0x43')]);_0x2638ff[_0xa521('0x44')]=qs['filters'](_[_0xa521('0x45')](_0x352d60[_0xa521('0x3c')],_0x2b9c3b[_0xa521('0x3d')]),_0xfe36af);if(_0x352d60[_0xa521('0x3c')]['filter']){_0x2638ff[_0xa521('0x44')]=_['merge'](_0x2638ff[_0xa521('0x44')],{'$or':_['map'](_0xfe36af,function(_0x17a220){if(_0x17a220[_0xa521('0x38')]!=='VIRTUAL'){var _0x26d1e9={};_0x26d1e9[_0x17a220[_0xa521('0x3b')]]={'$like':'%'+_0x352d60[_0xa521('0x3c')]['filter']+'%'};return _0x26d1e9;}})});}_0x2638ff=_['merge']({},_0x2638ff,_0x352d60[_0xa521('0x46')]);var _0x3e6684={'where':_0x2638ff[_0xa521('0x44')]};return db[_0xa521('0x36')]['count'](_0x3e6684)[_0xa521('0x1e')](function(_0x1bee15){_0x1fb063[_0xa521('0x2c')]=_0x1bee15;if(_0x352d60[_0xa521('0x3c')]['includeAll']){_0x2638ff[_0xa521('0x47')]=[{'all':!![]}];}return db[_0xa521('0x36')][_0xa521('0x48')](_0x2638ff);})[_0xa521('0x1e')](function(_0x23077e){_0x1fb063[_0xa521('0x49')]=_0x23077e;return _0x1fb063;})[_0xa521('0x1e')](respondWithFilteredResult(_0x160de0,_0x2638ff))[_0xa521('0x4a')](handleError(_0x160de0,null));};exports[_0xa521('0x4b')]=function(_0x281215,_0x58ef7f){var _0x4cb8d1={'raw':!![],'where':{'id':_0x281215['params']['id']}},_0x1eb5e0={};_0x1eb5e0[_0xa521('0x3a')]=_[_0xa521('0x4c')](db['Network'][_0xa521('0x4d')]);_0x1eb5e0[_0xa521('0x3c')]=_[_0xa521('0x4c')](_0x281215[_0xa521('0x3c')]);_0x1eb5e0[_0xa521('0x3d')]=_[_0xa521('0x3f')](_0x1eb5e0[_0xa521('0x3a')],_0x1eb5e0[_0xa521('0x3c')]);_0x4cb8d1[_0xa521('0x3e')]=_[_0xa521('0x3f')](_0x1eb5e0['model'],qs[_0xa521('0x4e')](_0x281215[_0xa521('0x3c')]['fields']));_0x4cb8d1[_0xa521('0x3e')]=_0x4cb8d1[_0xa521('0x3e')]['length']?_0x4cb8d1[_0xa521('0x3e')]:_0x1eb5e0[_0xa521('0x3a')];if(_0x281215[_0xa521('0x3c')][_0xa521('0x4f')]){_0x4cb8d1[_0xa521('0x47')]=[{'all':!![]}];}_0x4cb8d1=_[_0xa521('0x50')]({},_0x4cb8d1,_0x281215[_0xa521('0x46')]);return db[_0xa521('0x36')]['find'](_0x4cb8d1)['then'](handleEntityNotFound(_0x58ef7f,null))[_0xa521('0x1e')](respondWithResult(_0x58ef7f,null))[_0xa521('0x4a')](handleError(_0x58ef7f,null));};exports[_0xa521('0x51')]=function(_0x36d00c,_0xc6134e,_0x4ac93d){var _0x4407a8;return db['sequelize'][_0xa521('0x52')](function(_0x374a7e){return db[_0xa521('0x36')][_0xa521('0x51')](_0x36d00c['body'],{'raw':!![]})[_0xa521('0x1e')](function(_0x131663){_0x4407a8=_0x131663;return db[_0xa521('0x36')][_0xa521('0x48')]({'where':{'type':_0x36d00c['body'][_0xa521('0x38')]},'raw':!![]});})[_0xa521('0x1e')](function(_0x21d78e){if(_0x4407a8[_0xa521('0x38')][_0xa521('0x53')]()==_0xa521('0x54')){var _0x2bfc6c=fs['readFileSync'](path[_0xa521('0x55')](config['root'],_0xa521('0x56')),'utf8');var _0x572257=ejs[_0xa521('0x57')](_0x2bfc6c,{'networks':_0x21d78e||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x572257);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x51'),{'module':_0xa521('0x59')});}else if(_0x4407a8[_0xa521('0x38')][_0xa521('0x53')]()==_0xa521('0x5a')){var _0x247193=fs[_0xa521('0x5b')](path[_0xa521('0x55')](config[_0xa521('0x5c')],_0xa521('0x5d')),_0xa521('0x5e'));var _0x5b16aa=ejs['render'](_0x247193,{'networks':_0x21d78e||[]});fs[_0xa521('0x5f')](_0xa521('0x60'),_0x5b16aa);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x51'),{'module':_0xa521('0x59')});}else{var _0x49a47b=fs[_0xa521('0x5b')](path[_0xa521('0x55')](config['root'],_0xa521('0x61')),_0xa521('0x5e'));var _0x46d4e4=ejs[_0xa521('0x57')](_0x49a47b,{'networks':_0x21d78e||[]});fs[_0xa521('0x5f')](util[_0xa521('0x62')](_0xa521('0x63'),_0x36d00c[_0xa521('0x64')]['type'][_0xa521('0x65')]()),_0x46d4e4);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x51'),{'module':_0xa521('0x66')});}return null;})[_0xa521('0x1e')](function(){return _0x4407a8;});})[_0xa521('0x1e')](respondWithResult(_0xc6134e,0xc9))[_0xa521('0x4a')](handleError(_0xc6134e,null));};exports['update']=function(_0x46f9fe,_0x1b186a,_0x165650){var _0x5d9943;return db[_0xa521('0x67')][_0xa521('0x52')](function(_0x53c2a0){return db[_0xa521('0x36')][_0xa521('0x68')]({'where':{'id':_0x46f9fe[_0xa521('0x69')]['id']}})[_0xa521('0x1e')](handleEntityNotFound(_0x1b186a,null))[_0xa521('0x1e')](saveUpdates(_0x46f9fe[_0xa521('0x64')],null))['then'](function(_0x3966e7){if(_0x3966e7){_0x5d9943=_0x3966e7;return db[_0xa521('0x36')]['findAll']({'where':{'type':_0x5d9943['type']},'raw':!![]});}return null;})[_0xa521('0x1e')](function(_0x47dc63){if(_0x5d9943[_0xa521('0x38')][_0xa521('0x53')]()==_0xa521('0x54')){var _0x29c9dc=fs[_0xa521('0x5b')](path[_0xa521('0x55')](config[_0xa521('0x5c')],_0xa521('0x56')),_0xa521('0x5e'));var _0x5a5978=ejs[_0xa521('0x57')](_0x29c9dc,{'networks':_0x47dc63||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x5a5978);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x30'),{'module':_0xa521('0x59')});}else if(_0x5d9943[_0xa521('0x38')][_0xa521('0x53')]()==_0xa521('0x5a')){var _0x330b8f=fs['readFileSync'](path[_0xa521('0x55')](config[_0xa521('0x5c')],_0xa521('0x5d')),_0xa521('0x5e'));var _0xe76ae=ejs['render'](_0x330b8f,{'networks':_0x47dc63||[]});fs[_0xa521('0x5f')](_0xa521('0x60'),_0xe76ae);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x30'),{'module':_0xa521('0x59')});}else{var _0x539231=fs[_0xa521('0x5b')](path['join'](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x12f749=ejs[_0xa521('0x57')](_0x539231,{'networks':_0x47dc63||[]});fs[_0xa521('0x5f')](util[_0xa521('0x62')](_0xa521('0x63'),_0x46f9fe[_0xa521('0x64')][_0xa521('0x38')][_0xa521('0x65')]()),_0x12f749);return respondWithRpcPromise(_0xa521('0x58'),'update',{'module':_0xa521('0x66')});}return null;})['then'](function(_0x188466){if(_0x188466){return _0x5d9943;}return null;});})['then'](respondWithResult(_0x1b186a,null))[_0xa521('0x4a')](handleError(_0x1b186a,null));};exports[_0xa521('0x31')]=function(_0xca72b,_0x1d20c0,_0x25ec21){var _0x2d084c;return db[_0xa521('0x36')][_0xa521('0x68')]({'where':{'id':_0xca72b[_0xa521('0x69')]['id']}})[_0xa521('0x1e')](function(_0x3700ba){_0x2d084c=_0x3700ba;return _0x3700ba;})[_0xa521('0x1e')](handleEntityNotFound(_0x1d20c0,null))[_0xa521('0x1e')](removeEntity(_0x1d20c0,null))['then'](function(){if(_0x2d084c){return db['Network'][_0xa521('0x48')]({'where':{'type':_0x2d084c[_0xa521('0x38')]},'raw':!![]});}})[_0xa521('0x1e')](function(_0x22290c){if(_0x2d084c['type']['toUpperCase']()==_0xa521('0x54')){var _0x163401=fs[_0xa521('0x5b')](path['join'](config[_0xa521('0x5c')],_0xa521('0x56')),_0xa521('0x5e'));var _0x457efc=ejs[_0xa521('0x57')](_0x163401,{'networks':_0x22290c||[]});fs[_0xa521('0x5f')](_0xa521('0x6a'),_0x457efc);return respondWithRpcPromise(_0xa521('0x58'),'destroy',{'module':_0xa521('0x59')});}else if(_0x2d084c[_0xa521('0x38')]['toUpperCase']()=='TURN'){var _0x5822e7=fs['readFileSync'](path[_0xa521('0x55')](config[_0xa521('0x5c')],_0xa521('0x5d')),_0xa521('0x5e'));var _0x3b36da=ejs['render'](_0x5822e7,{'networks':_0x22290c||[]});fs['writeFileSync'](_0xa521('0x60'),_0x3b36da);return respondWithRpcPromise(_0xa521('0x58'),'destroy',{'module':_0xa521('0x59')});}else{var _0x14230d=fs['readFileSync'](path[_0xa521('0x55')](config[_0xa521('0x5c')],'server/files/templates/network.ejs'),'utf8');var _0x50dc27=ejs[_0xa521('0x57')](_0x14230d,{'networks':_0x22290c||[]});fs['writeFileSync'](util['format'](_0xa521('0x63'),_0xca72b[_0xa521('0x64')]['type'][_0xa521('0x65')]()),_0x50dc27);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x31'),{'module':_0xa521('0x66')});}return null;})[_0xa521('0x4a')](handleError(_0x1d20c0,null));}; \ No newline at end of file +var _0xf50a=['readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','sequelize','transaction','/etc/asterisk/turn_xcally.conf','toLowerCase','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','Network','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','show','params','rawAttributes','includeAll','find','create','body','findAll','toUpperCase','STUN'];(function(_0x208aee,_0x17ac5b){var _0x4a5846=function(_0x18d385){while(--_0x18d385){_0x208aee['push'](_0x208aee['shift']());}};_0x4a5846(++_0x17ac5b);}(_0xf50a,0x1b8));var _0xaf50=function(_0x1ebe53,_0x35cc29){_0x1ebe53=_0x1ebe53-0x0;var _0x56cb47=_0xf50a[_0x1ebe53];return _0x56cb47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf50('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf50('0x1'));var rp=require('request-promise');var moment=require(_0xaf50('0x2'));var BPromise=require(_0xaf50('0x3'));var Mustache=require(_0xaf50('0x4'));var util=require('util');var path=require(_0xaf50('0x5'));var sox=require(_0xaf50('0x6'));var csv=require('to-csv');var ejs=require(_0xaf50('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf50('0x8'));var squel=require(_0xaf50('0x9'));var crypto=require(_0xaf50('0xa'));var jsforce=require(_0xaf50('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaf50('0xc'));var querystring=require(_0xaf50('0xd'));var Papa=require(_0xaf50('0xe'));var Redis=require(_0xaf50('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf50('0x10'));var logger=require(_0xaf50('0x11'))('api');var utils=require(_0xaf50('0x12'));var config=require(_0xaf50('0x13'));var licenseUtil=require(_0xaf50('0x14'));var db=require(_0xaf50('0x15'))['db'];var jayson=require(_0xaf50('0x16'));var client=jayson[_0xaf50('0x17')][_0xaf50('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x50a26c,_0x20e0a7,_0x34e30b,_0x3b4a85){return new BPromise(function(_0x23c74c,_0x3bbf3b){var _0x5b5dea=_0x3b4a85||client;return _0x5b5dea[_0xaf50('0x19')](_0x50a26c,_0x34e30b)['then'](function(_0x16355d){logger[_0xaf50('0x1a')](_0xaf50('0x1b'),_0x20e0a7,'request\x20sent');logger['debug'](_0xaf50('0x1c'),_0x20e0a7,_0xaf50('0x1d'),JSON['stringify'](_0x16355d));if(_0x16355d['error']){if(_0x16355d[_0xaf50('0x1e')]['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x20e0a7,_0x16355d[_0xaf50('0x1e')][_0xaf50('0x1f')]);return _0x3bbf3b(_0x16355d[_0xaf50('0x1e')]['message']);}logger['error'](_0xaf50('0x1b'),_0x20e0a7,_0x16355d[_0xaf50('0x1e')][_0xaf50('0x1f')]);return _0x23c74c(_0x16355d[_0xaf50('0x1e')][_0xaf50('0x1f')]);}else{logger['info'](_0xaf50('0x1b'),_0x20e0a7,'request\x20sent');_0x23c74c(_0x16355d[_0xaf50('0x20')]['message']);}})[_0xaf50('0x21')](function(_0x15f717){logger[_0xaf50('0x1e')](_0xaf50('0x1b'),_0x20e0a7,_0x15f717);_0x3bbf3b(_0x15f717);});});}function respondWithStatusCode(_0x13b337,_0x2480d1){_0x2480d1=_0x2480d1||0xcc;return function(_0x4acb49){if(_0x4acb49){return _0x13b337[_0xaf50('0x22')](_0x2480d1);}return _0x13b337['status'](_0x2480d1)[_0xaf50('0x23')]();};}function respondWithResult(_0x2fd1c9,_0x26f919){_0x26f919=_0x26f919||0xc8;return function(_0x3faaf6){if(_0x3faaf6){return _0x2fd1c9['status'](_0x26f919)['json'](_0x3faaf6);}};}function respondWithFilteredResult(_0x294c7f,_0x2a8c2b){return function(_0x58169f){if(_0x58169f){var _0x39fa7d=typeof _0x2a8c2b[_0xaf50('0x24')]===_0xaf50('0x25')&&typeof _0x2a8c2b[_0xaf50('0x26')]===_0xaf50('0x25');var _0x235a01=_0x58169f[_0xaf50('0x27')];var _0x3cbdc4=_0x39fa7d?0x0:_0x2a8c2b[_0xaf50('0x24')];var _0x586a19=_0x39fa7d?_0x58169f[_0xaf50('0x27')]:_0x2a8c2b['offset']+_0x2a8c2b[_0xaf50('0x26')];var _0x53a071;if(_0x586a19>=_0x235a01){_0x586a19=_0x235a01;_0x53a071=0xc8;}else{_0x53a071=0xce;}_0x294c7f[_0xaf50('0x28')](_0x53a071);return _0x294c7f['set'](_0xaf50('0x29'),_0x3cbdc4+'-'+_0x586a19+'/'+_0x235a01)[_0xaf50('0x2a')](_0x58169f);}return null;};}function patchUpdates(_0xbe8d68){return function(_0x3dfbb0){try{jsonpatch[_0xaf50('0x2b')](_0x3dfbb0,_0xbe8d68,!![]);}catch(_0x263d4d){return BPromise[_0xaf50('0x2c')](_0x263d4d);}return _0x3dfbb0[_0xaf50('0x2d')]();};}function saveUpdates(_0x41ba01,_0x1eff85){return function(_0x3f93db){if(_0x3f93db){return _0x3f93db[_0xaf50('0x2e')](_0x41ba01)[_0xaf50('0x2f')](function(_0x139552){return _0x139552;});}return null;};}function removeEntity(_0x33d830,_0x4c0b1d){return function(_0x1a80cf){if(_0x1a80cf){return _0x1a80cf[_0xaf50('0x30')]()[_0xaf50('0x2f')](function(){_0x33d830[_0xaf50('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5494f3,_0x1af5c2){return function(_0x409dc7){if(!_0x409dc7){_0x5494f3[_0xaf50('0x22')](0x194);}return _0x409dc7;};}function handleError(_0x1c08a3,_0x1e63aa){_0x1e63aa=_0x1e63aa||0x1f4;return function(_0xa74de9){logger[_0xaf50('0x1e')](_0xa74de9[_0xaf50('0x31')]);if(_0xa74de9[_0xaf50('0x32')]){delete _0xa74de9['name'];}_0x1c08a3[_0xaf50('0x28')](_0x1e63aa)[_0xaf50('0x33')](_0xa74de9);};}exports['index']=function(_0x56e002,_0x49576a){var _0x158383={},_0xe6e4e3={},_0x2b2fe2={'count':0x0,'rows':[]};var _0x134b3f=_[_0xaf50('0x34')](db[_0xaf50('0x35')]['rawAttributes'],function(_0x13563d){return{'name':_0x13563d[_0xaf50('0x36')],'type':_0x13563d[_0xaf50('0x37')][_0xaf50('0x38')]};});_0xe6e4e3[_0xaf50('0x39')]=_[_0xaf50('0x34')](_0x134b3f,_0xaf50('0x32'));_0xe6e4e3[_0xaf50('0x3a')]=_[_0xaf50('0x3b')](_0x56e002[_0xaf50('0x3a')]);_0xe6e4e3[_0xaf50('0x3c')]=_[_0xaf50('0x3d')](_0xe6e4e3[_0xaf50('0x39')],_0xe6e4e3[_0xaf50('0x3a')]);_0x158383['attributes']=_[_0xaf50('0x3d')](_0xe6e4e3[_0xaf50('0x39')],qs['fields'](_0x56e002[_0xaf50('0x3a')][_0xaf50('0x3e')]));_0x158383[_0xaf50('0x3f')]=_0x158383[_0xaf50('0x3f')][_0xaf50('0x40')]?_0x158383[_0xaf50('0x3f')]:_0xe6e4e3[_0xaf50('0x39')];if(!_0x56e002[_0xaf50('0x3a')][_0xaf50('0x41')](_0xaf50('0x42'))){_0x158383[_0xaf50('0x26')]=qs['limit'](_0x56e002[_0xaf50('0x3a')][_0xaf50('0x26')]);_0x158383[_0xaf50('0x24')]=qs['offset'](_0x56e002[_0xaf50('0x3a')]['offset']);}_0x158383[_0xaf50('0x43')]=qs[_0xaf50('0x44')](_0x56e002[_0xaf50('0x3a')][_0xaf50('0x44')]);_0x158383['where']=qs['filters'](_['pick'](_0x56e002[_0xaf50('0x3a')],_0xe6e4e3[_0xaf50('0x3c')]),_0x134b3f);if(_0x56e002[_0xaf50('0x3a')][_0xaf50('0x45')]){_0x158383[_0xaf50('0x46')]=_[_0xaf50('0x47')](_0x158383[_0xaf50('0x46')],{'$or':_[_0xaf50('0x34')](_0x134b3f,function(_0x206590){if(_0x206590[_0xaf50('0x37')]!=='VIRTUAL'){var _0x5e39d7={};_0x5e39d7[_0x206590[_0xaf50('0x32')]]={'$like':'%'+_0x56e002[_0xaf50('0x3a')][_0xaf50('0x45')]+'%'};return _0x5e39d7;}})});}_0x158383=_[_0xaf50('0x47')]({},_0x158383,_0x56e002[_0xaf50('0x48')]);var _0x5c462b={'where':_0x158383['where']};return db['Network'][_0xaf50('0x27')](_0x5c462b)['then'](function(_0x470063){_0x2b2fe2['count']=_0x470063;if(_0x56e002[_0xaf50('0x3a')]['includeAll']){_0x158383[_0xaf50('0x49')]=[{'all':!![]}];}return db[_0xaf50('0x35')]['findAll'](_0x158383);})[_0xaf50('0x2f')](function(_0x161646){_0x2b2fe2[_0xaf50('0x4a')]=_0x161646;return _0x2b2fe2;})[_0xaf50('0x2f')](respondWithFilteredResult(_0x49576a,_0x158383))['catch'](handleError(_0x49576a,null));};exports[_0xaf50('0x4b')]=function(_0x578286,_0x98688f){var _0x500975={'raw':!![],'where':{'id':_0x578286[_0xaf50('0x4c')]['id']}},_0x1e0ec0={};_0x1e0ec0[_0xaf50('0x39')]=_[_0xaf50('0x3b')](db[_0xaf50('0x35')][_0xaf50('0x4d')]);_0x1e0ec0['query']=_[_0xaf50('0x3b')](_0x578286[_0xaf50('0x3a')]);_0x1e0ec0[_0xaf50('0x3c')]=_[_0xaf50('0x3d')](_0x1e0ec0['model'],_0x1e0ec0[_0xaf50('0x3a')]);_0x500975[_0xaf50('0x3f')]=_[_0xaf50('0x3d')](_0x1e0ec0[_0xaf50('0x39')],qs['fields'](_0x578286[_0xaf50('0x3a')][_0xaf50('0x3e')]));_0x500975['attributes']=_0x500975['attributes'][_0xaf50('0x40')]?_0x500975[_0xaf50('0x3f')]:_0x1e0ec0['model'];if(_0x578286[_0xaf50('0x3a')][_0xaf50('0x4e')]){_0x500975['include']=[{'all':!![]}];}_0x500975=_[_0xaf50('0x47')]({},_0x500975,_0x578286[_0xaf50('0x48')]);return db[_0xaf50('0x35')][_0xaf50('0x4f')](_0x500975)[_0xaf50('0x2f')](handleEntityNotFound(_0x98688f,null))[_0xaf50('0x2f')](respondWithResult(_0x98688f,null))[_0xaf50('0x21')](handleError(_0x98688f,null));};exports[_0xaf50('0x50')]=function(_0xd2d966,_0x5e33e4,_0x442633){var _0x2531fe;return db['sequelize']['transaction'](function(_0x392e6d){return db[_0xaf50('0x35')][_0xaf50('0x50')](_0xd2d966[_0xaf50('0x51')],{'raw':!![]})[_0xaf50('0x2f')](function(_0x171e79){_0x2531fe=_0x171e79;return db['Network'][_0xaf50('0x52')]({'where':{'type':_0xd2d966[_0xaf50('0x51')][_0xaf50('0x37')]},'raw':!![]});})[_0xaf50('0x2f')](function(_0x4dac62){if(_0x2531fe[_0xaf50('0x37')][_0xaf50('0x53')]()==_0xaf50('0x54')){var _0x35efb7=fs[_0xaf50('0x55')](path['join'](config[_0xaf50('0x56')],_0xaf50('0x57')),_0xaf50('0x58'));var _0x13908a=ejs[_0xaf50('0x59')](_0x35efb7,{'networks':_0x4dac62||[]});fs[_0xaf50('0x5a')](_0xaf50('0x5b'),_0x13908a);return respondWithRpcPromise(_0xaf50('0x5c'),_0xaf50('0x50'),{'module':_0xaf50('0x5d')});}else if(_0x2531fe[_0xaf50('0x37')]['toUpperCase']()==_0xaf50('0x5e')){var _0x157cf4=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config[_0xaf50('0x56')],_0xaf50('0x60')),'utf8');var _0x43c5e6=ejs[_0xaf50('0x59')](_0x157cf4,{'networks':_0x4dac62||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x43c5e6);return respondWithRpcPromise('Reload',_0xaf50('0x50'),{'module':_0xaf50('0x5d')});}else{var _0x4b3721=fs[_0xaf50('0x55')](path['join'](config[_0xaf50('0x56')],_0xaf50('0x61')),'utf8');var _0x35f854=ejs[_0xaf50('0x59')](_0x4b3721,{'networks':_0x4dac62||[]});fs[_0xaf50('0x5a')](util[_0xaf50('0x62')](_0xaf50('0x63'),_0xd2d966['body']['type']['toLowerCase']()),_0x35f854);return respondWithRpcPromise('Reload',_0xaf50('0x50'),{'module':_0xaf50('0x64')});}return null;})['then'](function(){return _0x2531fe;});})[_0xaf50('0x2f')](respondWithResult(_0x5e33e4,0xc9))[_0xaf50('0x21')](handleError(_0x5e33e4,null));};exports[_0xaf50('0x2e')]=function(_0xd5514d,_0x272f52,_0x918520){var _0x2091ac;return db[_0xaf50('0x65')][_0xaf50('0x66')](function(_0x214ec5){return db[_0xaf50('0x35')][_0xaf50('0x4f')]({'where':{'id':_0xd5514d['params']['id']}})[_0xaf50('0x2f')](handleEntityNotFound(_0x272f52,null))[_0xaf50('0x2f')](saveUpdates(_0xd5514d[_0xaf50('0x51')],null))['then'](function(_0x445b37){if(_0x445b37){_0x2091ac=_0x445b37;return db[_0xaf50('0x35')][_0xaf50('0x52')]({'where':{'type':_0x2091ac['type']},'raw':!![]});}return null;})[_0xaf50('0x2f')](function(_0x563f90){if(_0x2091ac[_0xaf50('0x37')]['toUpperCase']()==_0xaf50('0x54')){var _0x547a80=fs[_0xaf50('0x55')](path['join'](config[_0xaf50('0x56')],_0xaf50('0x57')),'utf8');var _0x598b4c=ejs[_0xaf50('0x59')](_0x547a80,{'networks':_0x563f90||[]});fs[_0xaf50('0x5a')](_0xaf50('0x5b'),_0x598b4c);return respondWithRpcPromise(_0xaf50('0x5c'),'update',{'module':_0xaf50('0x5d')});}else if(_0x2091ac[_0xaf50('0x37')][_0xaf50('0x53')]()==_0xaf50('0x5e')){var _0x5c6c0f=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config[_0xaf50('0x56')],_0xaf50('0x60')),_0xaf50('0x58'));var _0x1acad2=ejs[_0xaf50('0x59')](_0x5c6c0f,{'networks':_0x563f90||[]});fs['writeFileSync'](_0xaf50('0x67'),_0x1acad2);return respondWithRpcPromise('Reload',_0xaf50('0x2e'),{'module':_0xaf50('0x5d')});}else{var _0x2e5a33=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config[_0xaf50('0x56')],'server/files/templates/network.ejs'),_0xaf50('0x58'));var _0x214a07=ejs['render'](_0x2e5a33,{'networks':_0x563f90||[]});fs[_0xaf50('0x5a')](util['format'](_0xaf50('0x63'),_0xd5514d[_0xaf50('0x51')][_0xaf50('0x37')][_0xaf50('0x68')]()),_0x214a07);return respondWithRpcPromise(_0xaf50('0x5c'),_0xaf50('0x2e'),{'module':_0xaf50('0x64')});}return null;})[_0xaf50('0x2f')](function(_0x1aea63){if(_0x1aea63){return _0x2091ac;}return null;});})[_0xaf50('0x2f')](respondWithResult(_0x272f52,null))[_0xaf50('0x21')](handleError(_0x272f52,null));};exports[_0xaf50('0x30')]=function(_0x470843,_0x40ae98,_0x205268){var _0x312fab;return db[_0xaf50('0x35')]['find']({'where':{'id':_0x470843['params']['id']}})[_0xaf50('0x2f')](function(_0x56f6a5){_0x312fab=_0x56f6a5;return _0x56f6a5;})[_0xaf50('0x2f')](handleEntityNotFound(_0x40ae98,null))[_0xaf50('0x2f')](removeEntity(_0x40ae98,null))[_0xaf50('0x2f')](function(){if(_0x312fab){return db[_0xaf50('0x35')][_0xaf50('0x52')]({'where':{'type':_0x312fab[_0xaf50('0x37')]},'raw':!![]});}})[_0xaf50('0x2f')](function(_0x45df4a){if(_0x312fab[_0xaf50('0x37')][_0xaf50('0x53')]()=='STUN'){var _0x89526f=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config[_0xaf50('0x56')],_0xaf50('0x57')),_0xaf50('0x58'));var _0x56544c=ejs['render'](_0x89526f,{'networks':_0x45df4a||[]});fs[_0xaf50('0x5a')](_0xaf50('0x5b'),_0x56544c);return respondWithRpcPromise(_0xaf50('0x5c'),_0xaf50('0x30'),{'module':_0xaf50('0x5d')});}else if(_0x312fab[_0xaf50('0x37')][_0xaf50('0x53')]()==_0xaf50('0x5e')){var _0x4303d8=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config['root'],_0xaf50('0x60')),_0xaf50('0x58'));var _0x32883c=ejs[_0xaf50('0x59')](_0x4303d8,{'networks':_0x45df4a||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x32883c);return respondWithRpcPromise(_0xaf50('0x5c'),_0xaf50('0x30'),{'module':_0xaf50('0x5d')});}else{var _0x1dcb9b=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config[_0xaf50('0x56')],_0xaf50('0x61')),'utf8');var _0x559300=ejs['render'](_0x1dcb9b,{'networks':_0x45df4a||[]});fs[_0xaf50('0x5a')](util[_0xaf50('0x62')](_0xaf50('0x63'),_0x470843[_0xaf50('0x51')][_0xaf50('0x37')][_0xaf50('0x68')]()),_0x559300);return respondWithRpcPromise(_0xaf50('0x5c'),_0xaf50('0x30'),{'module':_0xaf50('0x64')});}return null;})[_0xaf50('0x21')](handleError(_0x40ae98,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 9f8f46e..50d3219 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 _0xbec5=['request-promise','path','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','api','moment','bluebird'];(function(_0x3a990c,_0x270fce){var _0x50ca11=function(_0x36ead1){while(--_0x36ead1){_0x3a990c['push'](_0x3a990c['shift']());}};_0x50ca11(++_0x270fce);}(_0xbec5,0xe5));var _0x5bec=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0xbec5[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68fc=['bluebird','path','./network.attributes','exports','network','lodash','util','../../config/logger'];(function(_0xd12b3e,_0x583290){var _0x3fc263=function(_0x5ae0b8){while(--_0x5ae0b8){_0xd12b3e['push'](_0xd12b3e['shift']());}};_0x3fc263(++_0x583290);}(_0x68fc,0xa5));var _0xc68f=function(_0x5f45c6,_0x4717f5){_0x5f45c6=_0x5f45c6-0x0;var _0x5380d4=_0x68fc[_0x5f45c6];return _0x5380d4;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var logger=require(_0xc68f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc68f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc68f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc68f('0x5'));module[_0xc68f('0x6')]=function(_0x1c6df9,_0x363cdf){return _0x1c6df9['define']('Network',attributes,{'tableName':_0xc68f('0x7'),'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 db3893f..b1ee2ff 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 _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x1dfb19,_0x1bd5e4){_0x1dfb19=_0x1dfb19-0x0;var _0x315e23=_0x7a54[_0x1dfb19];return _0x315e23;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x1fb952,_0x570bf8){_0x1fb952=_0x1fb952-0x0;var _0x45f1a0=_0x7a54[_0x1fb952];return _0x45f1a0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 712708e..62d772f 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 _0x65ca=['../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addAgents','/:id','update','removeDispositions','delete','removeAnswers','exports','multer','util','path','Router','fs-extra'];(function(_0x42cc1f,_0xe9eb20){var _0x175df5=function(_0x2f3e22){while(--_0x2f3e22){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x175df5(++_0xe9eb20);}(_0x65ca,0x1c9));var _0xa65c=function(_0x4d3b77,_0x3c789c){_0x4d3b77=_0x4d3b77-0x0;var _0x1a716a=_0x65ca[_0x4d3b77];return _0x1a716a;};'use strict';var multer=require(_0xa65c('0x0'));var util=require(_0xa65c('0x1'));var path=require(_0xa65c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa65c('0x3')]();var fs_extra=require(_0xa65c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa65c('0x5'));var config=require(_0xa65c('0x6'));var controller=require(_0xa65c('0x7'));router[_0xa65c('0x8')]('/',auth[_0xa65c('0x9')](),controller[_0xa65c('0xa')]);router[_0xa65c('0x8')]('/describe',auth[_0xa65c('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa65c('0x8')](_0xa65c('0xb'),auth[_0xa65c('0x9')](),controller[_0xa65c('0xc')]);router[_0xa65c('0x8')](_0xa65c('0xd'),auth[_0xa65c('0x9')](),controller[_0xa65c('0xe')]);router[_0xa65c('0x8')](_0xa65c('0xf'),auth['isAuthenticated'](),controller[_0xa65c('0x10')]);router[_0xa65c('0x8')](_0xa65c('0x11'),auth['isAuthenticated'](),controller[_0xa65c('0x12')]);router['get'](_0xa65c('0x13'),auth[_0xa65c('0x9')](),controller['getAgents']);router[_0xa65c('0x14')]('/',auth[_0xa65c('0x9')](),controller[_0xa65c('0x15')]);router['post'](_0xa65c('0xb'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x16')]);router[_0xa65c('0x14')](_0xa65c('0xd'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x17')]);router['post'](_0xa65c('0x18'),controller[_0xa65c('0x19')]);router[_0xa65c('0x14')](_0xa65c('0xf'),auth[_0xa65c('0x9')](),controller['addApplications']);router[_0xa65c('0x14')](_0xa65c('0x13'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x1a')]);router[_0xa65c('0x14')]('/:id/send',auth[_0xa65c('0x9')](),controller['send']);router['put'](_0xa65c('0x1b'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x1c')]);router['delete'](_0xa65c('0x1b'),auth[_0xa65c('0x9')](),controller['destroy']);router['delete'](_0xa65c('0xb'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x1d')]);router[_0xa65c('0x1e')](_0xa65c('0xd'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x1f')]);router[_0xa65c('0x1e')](_0xa65c('0x13'),auth[_0xa65c('0x9')](),controller['removeAgents']);module[_0xa65c('0x20')]=router; \ No newline at end of file +var _0xcdb2=['addAnswer','/:id/notify','addApplications','/:id/users','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','describe','get','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create'];(function(_0x4f8a90,_0xe31f20){var _0x2e3efa=function(_0x88bff1){while(--_0x88bff1){_0x4f8a90['push'](_0x4f8a90['shift']());}};_0x2e3efa(++_0xe31f20);}(_0xcdb2,0x17f));var _0x2cdb=function(_0x30bff8,_0x3faceb){_0x30bff8=_0x30bff8-0x0;var _0x128b60=_0xcdb2[_0x30bff8];return _0x128b60;};'use strict';var multer=require(_0x2cdb('0x0'));var util=require(_0x2cdb('0x1'));var path=require(_0x2cdb('0x2'));var timeout=require('connect-timeout');var express=require(_0x2cdb('0x3'));var router=express[_0x2cdb('0x4')]();var fs_extra=require(_0x2cdb('0x5'));var auth=require(_0x2cdb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2cdb('0x7'));var controller=require(_0x2cdb('0x8'));router['get']('/',auth[_0x2cdb('0x9')](),controller['index']);router['get']('/describe',auth[_0x2cdb('0x9')](),controller[_0x2cdb('0xa')]);router[_0x2cdb('0xb')](_0x2cdb('0xc'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0xd')]);router[_0x2cdb('0xb')](_0x2cdb('0xe'),auth[_0x2cdb('0x9')](),controller['getDispositions']);router[_0x2cdb('0xb')](_0x2cdb('0xf'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x10')]);router[_0x2cdb('0xb')](_0x2cdb('0x11'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x12')]);router[_0x2cdb('0xb')](_0x2cdb('0x13'),auth['isAuthenticated'](),controller[_0x2cdb('0x14')]);router[_0x2cdb('0xb')]('/:id/users',auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x15')]);router[_0x2cdb('0x16')]('/',auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x17')]);router[_0x2cdb('0x16')](_0x2cdb('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x2cdb('0xf'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x18')]);router[_0x2cdb('0x16')](_0x2cdb('0x19'),controller['notify']);router['post'](_0x2cdb('0x11'),auth['isAuthenticated'](),controller[_0x2cdb('0x1a')]);router[_0x2cdb('0x16')](_0x2cdb('0x1b'),auth[_0x2cdb('0x9')](),controller['addAgents']);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x2cdb('0x1c')]);router[_0x2cdb('0x1d')](_0x2cdb('0xc'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x1e')]);router[_0x2cdb('0x1f')](_0x2cdb('0xc'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x20')]);router['delete'](_0x2cdb('0xe'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x21')]);router['delete'](_0x2cdb('0xf'),auth['isAuthenticated'](),controller[_0x2cdb('0x22')]);router[_0x2cdb('0x1f')]('/:id/users',auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x23')]);module[_0x2cdb('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 0d73500..6989831 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 _0x516f=['mandatoryDisposition','sequelize','randomstring','exports','STRING','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','setDataValue','mandatoryDispositionPauseId'];(function(_0xb093,_0x5403c4){var _0x516bac=function(_0x4564cb){while(--_0x4564cb){_0xb093['push'](_0xb093['shift']());}};_0x516bac(++_0x5403c4);}(_0x516f,0xef));var _0xf516=function(_0x4407bf,_0x5aff82){_0x4407bf=_0x4407bf-0x0;var _0x3ff276=_0x516f[_0x4407bf];return _0x3ff276;};'use strict';var Sequelize=require(_0xf516('0x0'));var rs=require(_0xf516('0x1'));module[_0xf516('0x2')]={'name':{'type':Sequelize[_0xf516('0x3')],'unique':_0xf516('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xf516('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf516('0x5')]();}},'replyUri':{'type':Sequelize[_0xf516('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf516('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf516('0x6')],'defaultValue':function(){return _0xf516('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf516('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf516('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf516('0x3')]},'queueTransfer':{'type':Sequelize[_0xf516('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf516('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xf516('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xf516('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xb3ed6){if(!_0xb3ed6)this[_0xf516('0xb')](_0xf516('0xc'),null);this[_0xf516('0xb')](_0xf516('0xd'),_0xb3ed6);}}}; \ No newline at end of file +var _0x778d=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name'];(function(_0x588bd1,_0x1c6010){var _0x1d5d27=function(_0x2ce03a){while(--_0x2ce03a){_0x588bd1['push'](_0x588bd1['shift']());}};_0x1d5d27(++_0x1c6010);}(_0x778d,0xf9));var _0xd778=function(_0x398b9d,_0x41737){_0x398b9d=_0x398b9d-0x0;var _0x5ee77a=_0x778d[_0x398b9d];return _0x5ee77a;};'use strict';var Sequelize=require(_0xd778('0x0'));var rs=require(_0xd778('0x1'));module['exports']={'name':{'type':Sequelize[_0xd778('0x2')],'unique':_0xd778('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd778('0x2')]},'token':{'type':Sequelize[_0xd778('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd778('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd778('0x4');}},'notificationSound':{'type':Sequelize[_0xd778('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd778('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd778('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xd778('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd778('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd778('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xd778('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xd778('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4bfe09){if(!_0x4bfe09)this[_0xd778('0x8')](_0xd778('0x9'),null);this[_0xd778('0x8')](_0xd778('0xa'),_0x4bfe09);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 324d851..ca5c9d2 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 _0x0035=['Tag','color','tag','addAgents','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','Pause','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','rows','show','rawAttributes','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','mandatoryDispositionPause','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','sort','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','contact','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal'];(function(_0x47a2d7,_0x1637ef){var _0x3dfeef=function(_0x14b8db){while(--_0x14b8db){_0x47a2d7['push'](_0x47a2d7['shift']());}};_0x3dfeef(++_0x1637ef);}(_0x0035,0xc6));var _0x5003=function(_0x59cda9,_0x47d4c4){_0x59cda9=_0x59cda9-0x0;var _0x26c18f=_0x0035[_0x59cda9];return _0x26c18f;};'use strict';var emlformat=require(_0x5003('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5003('0x1'));var jsonpatch=require(_0x5003('0x2'));var rp=require(_0x5003('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5003('0x4'));var util=require(_0x5003('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5003('0x6'));var fs=require('fs');var fs_extra=require(_0x5003('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5003('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x5003('0x9'));var querystring=require(_0x5003('0xa'));var Papa=require(_0x5003('0xb'));var Redis=require(_0x5003('0xc'));var authService=require(_0x5003('0xd'));var qs=require(_0x5003('0xe'));var as=require(_0x5003('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5003('0x10'));var config=require(_0x5003('0x11'));var licenseUtil=require(_0x5003('0x12'));var db=require(_0x5003('0x13'))['db'];config[_0x5003('0x14')]=_[_0x5003('0x15')](config[_0x5003('0x14')],{'host':_0x5003('0x16'),'port':0x18eb});var socket=require(_0x5003('0x17'))(new Redis(config[_0x5003('0x14')]));require(_0x5003('0x18'))[_0x5003('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5003('0x1a')][_0x5003('0x1b')]({'port':0x232c});var client9002=jayson[_0x5003('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x537eac,_0x21dfe0,_0x378c8e,_0x5c9c15){return new BPromise(function(_0x590f8c,_0x20c231){var _0x31eaa0=_0x5c9c15||client;return _0x31eaa0[_0x5003('0x1c')](_0x537eac,_0x378c8e)[_0x5003('0x1d')](function(_0x153323){logger[_0x5003('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x21dfe0,_0x5003('0x1f'));logger['debug'](_0x5003('0x20'),_0x21dfe0,_0x5003('0x1f'),JSON[_0x5003('0x21')](_0x153323));if(_0x153323['error']){if(_0x153323[_0x5003('0x22')]['code']===0x1f4){logger[_0x5003('0x22')](_0x5003('0x23'),_0x21dfe0,_0x153323[_0x5003('0x22')]['message']);return _0x20c231(_0x153323[_0x5003('0x22')]['message']);}logger[_0x5003('0x22')](_0x5003('0x23'),_0x21dfe0,_0x153323[_0x5003('0x22')][_0x5003('0x24')]);return _0x590f8c(_0x153323[_0x5003('0x22')]['message']);}else{logger[_0x5003('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x21dfe0,'request\x20sent');_0x590f8c(_0x153323['result']['message']);}})[_0x5003('0x25')](function(_0x1aaca8){logger[_0x5003('0x22')](_0x5003('0x23'),_0x21dfe0,_0x1aaca8);_0x20c231(_0x1aaca8);});});}function respondWithStatusCode(_0x53fbf3,_0x211748){_0x211748=_0x211748||0xcc;return function(_0x19154e){if(_0x19154e){return _0x53fbf3[_0x5003('0x26')](_0x211748);}return _0x53fbf3[_0x5003('0x27')](_0x211748)[_0x5003('0x28')]();};}function respondWithResult(_0x223a72,_0x5bf695){_0x5bf695=_0x5bf695||0xc8;return function(_0x3f2227){if(_0x3f2227){return _0x223a72[_0x5003('0x27')](_0x5bf695)[_0x5003('0x29')](_0x3f2227);}};}function respondWithFilteredResult(_0x56764f,_0x16e30c){return function(_0x3b5cb9){if(_0x3b5cb9){var _0x10932d=typeof _0x16e30c[_0x5003('0x2a')]===_0x5003('0x2b')&&typeof _0x16e30c[_0x5003('0x2c')]==='undefined';var _0xdd4b8e=_0x3b5cb9[_0x5003('0x2d')];var _0x472412=_0x10932d?0x0:_0x16e30c['offset'];var _0x2f915c=_0x10932d?_0x3b5cb9[_0x5003('0x2d')]:_0x16e30c[_0x5003('0x2a')]+_0x16e30c[_0x5003('0x2c')];var _0x29a41a;if(_0x2f915c>=_0xdd4b8e){_0x2f915c=_0xdd4b8e;_0x29a41a=0xc8;}else{_0x29a41a=0xce;}_0x56764f[_0x5003('0x27')](_0x29a41a);return _0x56764f[_0x5003('0x2e')](_0x5003('0x2f'),_0x472412+'-'+_0x2f915c+'/'+_0xdd4b8e)[_0x5003('0x29')](_0x3b5cb9);}return null;};}function patchUpdates(_0x6faea1){return function(_0x13634b){try{jsonpatch[_0x5003('0x30')](_0x13634b,_0x6faea1,!![]);}catch(_0x5bcb2d){return BPromise[_0x5003('0x31')](_0x5bcb2d);}return _0x13634b['save']();};}function saveUpdates(_0x8d3f91,_0x257edf){return function(_0x17e121){if(_0x17e121){return _0x17e121[_0x5003('0x32')](_0x8d3f91)['then'](function(_0x3d44a6){return _0x3d44a6;});}return null;};}function removeEntity(_0x12e571,_0x24f6a5){return function(_0x3fbdd9){if(_0x3fbdd9){return _0x3fbdd9[_0x5003('0x33')]()['then'](function(){var _0x441f78=_0x3fbdd9[_0x5003('0x34')]({'plain':!![]});var _0x222e0c=_0x5003('0x35');return db[_0x5003('0x36')][_0x5003('0x33')]({'where':{'type':_0x222e0c,'resourceId':_0x441f78['id']}})[_0x5003('0x1d')](function(){return _0x3fbdd9;});})['then'](function(){_0x12e571[_0x5003('0x27')](0xcc)[_0x5003('0x28')]();});}};}function handleEntityNotFound(_0x3d63cc,_0x59699c){return function(_0x3e8b9b){if(!_0x3e8b9b){_0x3d63cc[_0x5003('0x26')](0x194);}return _0x3e8b9b;};}function handleError(_0x15bc9a,_0x42001e){_0x42001e=_0x42001e||0x1f4;return function(_0x4298e2){logger[_0x5003('0x22')](_0x4298e2[_0x5003('0x37')]);if(_0x4298e2[_0x5003('0x38')]){delete _0x4298e2[_0x5003('0x38')];}_0x15bc9a['status'](_0x42001e)[_0x5003('0x39')](_0x4298e2);};}exports['index']=function(_0x24a47b,_0x56ba5f){var _0x31379c={'include':[{'model':db[_0x5003('0x3a')],'as':'mandatoryDispositionPause'}]},_0x595b30={},_0x5ceb7b={'count':0x0,'rows':[]};var _0x59445f=_[_0x5003('0x3b')](db['OpenchannelAccount']['rawAttributes'],function(_0x5d9a56){return{'name':_0x5d9a56[_0x5003('0x3c')],'type':_0x5d9a56[_0x5003('0x3d')]['key']};});_0x595b30[_0x5003('0x3e')]=_[_0x5003('0x3b')](_0x59445f,_0x5003('0x38'));_0x595b30[_0x5003('0x3f')]=_[_0x5003('0x40')](_0x24a47b[_0x5003('0x3f')]);_0x595b30[_0x5003('0x41')]=_[_0x5003('0x42')](_0x595b30[_0x5003('0x3e')],_0x595b30[_0x5003('0x3f')]);_0x31379c[_0x5003('0x43')]=_[_0x5003('0x42')](_0x595b30[_0x5003('0x3e')],qs['fields'](_0x24a47b[_0x5003('0x3f')][_0x5003('0x44')]));_0x31379c[_0x5003('0x43')]=_0x31379c[_0x5003('0x43')][_0x5003('0x45')]?_0x31379c[_0x5003('0x43')]:_0x595b30[_0x5003('0x3e')];if(!_0x24a47b[_0x5003('0x3f')][_0x5003('0x46')](_0x5003('0x47'))){_0x31379c[_0x5003('0x2c')]=qs[_0x5003('0x2c')](_0x24a47b['query'][_0x5003('0x2c')]);_0x31379c['offset']=qs[_0x5003('0x2a')](_0x24a47b[_0x5003('0x3f')]['offset']);}_0x31379c[_0x5003('0x48')]=qs['sort'](_0x24a47b[_0x5003('0x3f')]['sort']);_0x31379c[_0x5003('0x49')]=qs[_0x5003('0x41')](_[_0x5003('0x4a')](_0x24a47b[_0x5003('0x3f')],_0x595b30[_0x5003('0x41')]),_0x59445f);if(_0x24a47b['query'][_0x5003('0x4b')]){_0x31379c[_0x5003('0x49')]=_[_0x5003('0x4c')](_0x31379c[_0x5003('0x49')],{'$or':_[_0x5003('0x3b')](_0x59445f,function(_0x6ee620){if(_0x6ee620[_0x5003('0x3d')]!==_0x5003('0x4d')){var _0x326017={};_0x326017[_0x6ee620['name']]={'$like':'%'+_0x24a47b[_0x5003('0x3f')][_0x5003('0x4b')]+'%'};return _0x326017;}})});}_0x31379c=_[_0x5003('0x4c')]({},_0x31379c,_0x24a47b[_0x5003('0x4e')]);var _0x2d0cb0={'where':_0x31379c[_0x5003('0x49')]};return db[_0x5003('0x4f')][_0x5003('0x2d')](_0x2d0cb0)[_0x5003('0x1d')](function(_0x447032){_0x5ceb7b['count']=_0x447032;if(_0x24a47b[_0x5003('0x3f')][_0x5003('0x50')]){_0x31379c[_0x5003('0x51')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x31379c);})[_0x5003('0x1d')](function(_0xefd9f6){_0x5ceb7b[_0x5003('0x52')]=_0xefd9f6;return _0x5ceb7b;})[_0x5003('0x1d')](respondWithFilteredResult(_0x56ba5f,_0x31379c))[_0x5003('0x25')](handleError(_0x56ba5f,null));};exports[_0x5003('0x53')]=function(_0xebe26,_0x15c030){var _0x427eee={'raw':![],'where':{'id':_0xebe26['params']['id']},'include':[{'model':db[_0x5003('0x3a')],'as':'mandatoryDispositionPause'}]},_0x1a1ac8={};_0x1a1ac8[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x4f')][_0x5003('0x54')]);_0x1a1ac8['query']=_['keys'](_0xebe26[_0x5003('0x3f')]);_0x1a1ac8[_0x5003('0x41')]=_[_0x5003('0x42')](_0x1a1ac8['model'],_0x1a1ac8['query']);_0x427eee['attributes']=_[_0x5003('0x42')](_0x1a1ac8[_0x5003('0x3e')],qs[_0x5003('0x44')](_0xebe26['query'][_0x5003('0x44')]));_0x427eee['attributes']=_0x427eee['attributes'][_0x5003('0x45')]?_0x427eee[_0x5003('0x43')]:_0x1a1ac8[_0x5003('0x3e')];if(_0xebe26[_0x5003('0x3f')][_0x5003('0x50')]){_0x427eee[_0x5003('0x51')]=[{'all':!![]}];}_0x427eee=_[_0x5003('0x4c')]({},_0x427eee,_0xebe26[_0x5003('0x4e')]);return db[_0x5003('0x4f')]['find'](_0x427eee)[_0x5003('0x1d')](handleEntityNotFound(_0x15c030,null))[_0x5003('0x1d')](respondWithResult(_0x15c030,null))[_0x5003('0x25')](handleError(_0x15c030,null));};exports[_0x5003('0x55')]=function(_0x36e24f,_0x513dbd){return db['OpenchannelAccount'][_0x5003('0x55')](_0x36e24f[_0x5003('0x56')],{})[_0x5003('0x1d')](function(_0x3f0051){var _0x5c8e19=_0x36e24f[_0x5003('0x57')][_0x5003('0x34')]({'plain':!![]});if(!_0x5c8e19)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c8e19['role']==='user'){var _0x287867=_0x3f0051[_0x5003('0x34')]({'plain':!![]});var _0x487eed=_0x5003('0x35');return db[_0x5003('0x58')][_0x5003('0x59')]({'where':{'name':_0x487eed,'userProfileId':_0x5c8e19[_0x5003('0x5a')]},'raw':!![]})[_0x5003('0x1d')](function(_0x517f4b){if(_0x517f4b&&_0x517f4b[_0x5003('0x5b')]===0x0){return db[_0x5003('0x36')][_0x5003('0x55')]({'name':_0x287867['name'],'resourceId':_0x287867['id'],'type':_0x517f4b[_0x5003('0x38')],'sectionId':_0x517f4b['id']},{})['then'](function(){return _0x3f0051;});}else{return _0x3f0051;}})[_0x5003('0x25')](function(_0x321327){logger['error'](_0x5003('0x5c'),_0x321327);throw _0x321327;});}return _0x3f0051;})[_0x5003('0x1d')](respondWithResult(_0x513dbd,0xc9))[_0x5003('0x25')](handleError(_0x513dbd,null));};exports[_0x5003('0x32')]=function(_0x256dbd,_0x38e0aa){if(_0x256dbd[_0x5003('0x56')]['id']){delete _0x256dbd['body']['id'];}return db[_0x5003('0x4f')]['find']({'where':{'id':_0x256dbd[_0x5003('0x5d')]['id']},'include':[{'model':db[_0x5003('0x3a')],'as':_0x5003('0x5e')}]})[_0x5003('0x1d')](handleEntityNotFound(_0x38e0aa,null))['then'](saveUpdates(_0x256dbd[_0x5003('0x56')],null))['then'](respondWithResult(_0x38e0aa,null))[_0x5003('0x25')](handleError(_0x38e0aa,null));};exports[_0x5003('0x33')]=function(_0x13f72c,_0x277e54){return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x13f72c[_0x5003('0x5d')]['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x277e54,null))[_0x5003('0x1d')](removeEntity(_0x277e54,null))[_0x5003('0x25')](handleError(_0x277e54,null));};exports[_0x5003('0x5f')]=function(_0x47da7c,_0x3a81a3){return db[_0x5003('0x4f')][_0x5003('0x5f')]()['then'](respondWithResult(_0x3a81a3,null))[_0x5003('0x25')](handleError(_0x3a81a3,null));};exports[_0x5003('0x60')]=function(_0x576760,_0x342a13,_0x329beb){if(_0x576760[_0x5003('0x56')]['id']){delete _0x576760[_0x5003('0x56')]['id'];}return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x576760[_0x5003('0x5d')]['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x342a13,null))[_0x5003('0x1d')](function(_0x5a8033){if(_0x5a8033){_0x576760[_0x5003('0x56')][_0x5003('0x61')]=_0x5a8033['id'];return db['Disposition'][_0x5003('0x55')](_0x576760[_0x5003('0x56')]);}})[_0x5003('0x1d')](respondWithResult(_0x342a13,null))[_0x5003('0x25')](handleError(_0x342a13,null));};exports[_0x5003('0x62')]=function(_0x38cc9a,_0x3be448,_0x313704){var _0x3b398c={'raw':![],'where':{}};var _0x331ea5={};var _0x1cca21={'count':0x0,'rows':[]};return db[_0x5003('0x4f')][_0x5003('0x63')]({'where':{'id':_0x38cc9a[_0x5003('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3be448,null))[_0x5003('0x1d')](function(_0x2c5a2f){if(_0x2c5a2f){_0x331ea5[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x64')][_0x5003('0x54')]);_0x331ea5[_0x5003('0x3f')]=_[_0x5003('0x40')](_0x38cc9a[_0x5003('0x3f')]);_0x331ea5['filters']=_[_0x5003('0x42')](_0x331ea5[_0x5003('0x3e')],_0x331ea5[_0x5003('0x3f')]);_0x3b398c['attributes']=_[_0x5003('0x42')](_0x331ea5[_0x5003('0x3e')],qs[_0x5003('0x44')](_0x38cc9a['query']['fields']));_0x3b398c[_0x5003('0x43')]=_0x3b398c[_0x5003('0x43')][_0x5003('0x45')]?_0x3b398c[_0x5003('0x43')]:_0x331ea5[_0x5003('0x3e')];if(!_0x38cc9a['query']['hasOwnProperty']('nolimit')){_0x3b398c['limit']=qs[_0x5003('0x2c')](_0x38cc9a[_0x5003('0x3f')][_0x5003('0x2c')]);_0x3b398c[_0x5003('0x2a')]=qs[_0x5003('0x2a')](_0x38cc9a[_0x5003('0x3f')]['offset']);}_0x3b398c[_0x5003('0x48')]=qs['sort'](_0x38cc9a[_0x5003('0x3f')][_0x5003('0x65')]);_0x3b398c['where']=qs[_0x5003('0x41')](_['pick'](_0x38cc9a[_0x5003('0x3f')],_0x331ea5['filters']));_0x3b398c[_0x5003('0x49')][_0x5003('0x61')]=_0x2c5a2f['id'];if(_0x38cc9a[_0x5003('0x3f')][_0x5003('0x4b')]){_0x3b398c[_0x5003('0x49')]=_[_0x5003('0x4c')](_0x3b398c[_0x5003('0x49')],{'$or':_[_0x5003('0x3b')](_0x3b398c[_0x5003('0x43')],function(_0xde5275){var _0x36370e={};_0x36370e[_0xde5275]={'$like':'%'+_0x38cc9a[_0x5003('0x3f')][_0x5003('0x4b')]+'%'};return _0x36370e;})});}_0x3b398c=_[_0x5003('0x4c')]({},_0x3b398c,_0x38cc9a['options']);return db[_0x5003('0x64')][_0x5003('0x2d')]({'where':_0x3b398c[_0x5003('0x49')]})[_0x5003('0x1d')](function(_0x4c81bb){_0x1cca21[_0x5003('0x2d')]=_0x4c81bb;if(_0x38cc9a[_0x5003('0x3f')][_0x5003('0x50')]){_0x3b398c[_0x5003('0x51')]=[{'all':!![]}];}return db[_0x5003('0x64')]['findAll'](_0x3b398c);})[_0x5003('0x1d')](function(_0x5d583a){_0x1cca21[_0x5003('0x52')]=_0x5d583a;return _0x1cca21;});}})[_0x5003('0x1d')](respondWithFilteredResult(_0x3be448,_0x3b398c))['catch'](handleError(_0x3be448,null));};exports[_0x5003('0x66')]=function(_0x19aba6,_0x24b0ce,_0xc101bd){return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x19aba6[_0x5003('0x5d')]['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x24b0ce,null))['then'](function(_0x44d8ff){if(_0x44d8ff){return _0x44d8ff['removeDispositions'](_0x19aba6[_0x5003('0x3f')][_0x5003('0x67')]);}})[_0x5003('0x1d')](respondWithStatusCode(_0x24b0ce,null))[_0x5003('0x25')](handleError(_0x24b0ce,null));};exports[_0x5003('0x68')]=function(_0x14c10f,_0x12f776,_0x4837c4){if(_0x14c10f[_0x5003('0x56')]['id']){delete _0x14c10f[_0x5003('0x56')]['id'];}return db[_0x5003('0x4f')]['find']({'where':{'id':_0x14c10f['params']['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x12f776,null))[_0x5003('0x1d')](function(_0x74d915){if(_0x74d915){_0x14c10f[_0x5003('0x56')][_0x5003('0x61')]=_0x74d915['id'];return db[_0x5003('0x69')][_0x5003('0x55')](_0x14c10f[_0x5003('0x56')]);}})['then'](respondWithResult(_0x12f776,null))[_0x5003('0x25')](handleError(_0x12f776,null));};exports[_0x5003('0x6a')]=function(_0x41ec35,_0x19dc5b,_0x18f545){var _0xd43ead={'raw':![],'where':{}};var _0x4ccbc5={};var _0xe9693a={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x5003('0x63')]({'where':{'id':_0x41ec35['params']['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x19dc5b,null))[_0x5003('0x1d')](function(_0x544ccd){if(_0x544ccd){_0x4ccbc5[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x69')]['rawAttributes']);_0x4ccbc5[_0x5003('0x3f')]=_[_0x5003('0x40')](_0x41ec35[_0x5003('0x3f')]);_0x4ccbc5['filters']=_[_0x5003('0x42')](_0x4ccbc5[_0x5003('0x3e')],_0x4ccbc5[_0x5003('0x3f')]);_0xd43ead[_0x5003('0x43')]=_[_0x5003('0x42')](_0x4ccbc5['model'],qs[_0x5003('0x44')](_0x41ec35[_0x5003('0x3f')]['fields']));_0xd43ead['attributes']=_0xd43ead[_0x5003('0x43')][_0x5003('0x45')]?_0xd43ead[_0x5003('0x43')]:_0x4ccbc5['model'];if(!_0x41ec35[_0x5003('0x3f')]['hasOwnProperty'](_0x5003('0x47'))){_0xd43ead[_0x5003('0x2c')]=qs[_0x5003('0x2c')](_0x41ec35[_0x5003('0x3f')][_0x5003('0x2c')]);_0xd43ead[_0x5003('0x2a')]=qs[_0x5003('0x2a')](_0x41ec35[_0x5003('0x3f')]['offset']);}_0xd43ead[_0x5003('0x48')]=qs['sort'](_0x41ec35[_0x5003('0x3f')][_0x5003('0x65')]);_0xd43ead[_0x5003('0x49')]=qs[_0x5003('0x41')](_[_0x5003('0x4a')](_0x41ec35[_0x5003('0x3f')],_0x4ccbc5['filters']));_0xd43ead['where'][_0x5003('0x61')]=_0x544ccd['id'];if(_0x41ec35[_0x5003('0x3f')][_0x5003('0x4b')]){_0xd43ead[_0x5003('0x49')]=_['merge'](_0xd43ead[_0x5003('0x49')],{'$or':_[_0x5003('0x3b')](_0xd43ead['attributes'],function(_0xcb3af2){var _0x303eb4={};_0x303eb4[_0xcb3af2]={'$like':'%'+_0x41ec35[_0x5003('0x3f')][_0x5003('0x4b')]+'%'};return _0x303eb4;})});}_0xd43ead=_[_0x5003('0x4c')]({},_0xd43ead,_0x41ec35[_0x5003('0x4e')]);return db[_0x5003('0x69')][_0x5003('0x2d')]({'where':_0xd43ead['where']})[_0x5003('0x1d')](function(_0x55bc87){_0xe9693a[_0x5003('0x2d')]=_0x55bc87;if(_0x41ec35[_0x5003('0x3f')][_0x5003('0x50')]){_0xd43ead[_0x5003('0x51')]=[{'all':!![]}];}return db[_0x5003('0x69')][_0x5003('0x6b')](_0xd43ead);})[_0x5003('0x1d')](function(_0x145dba){_0xe9693a['rows']=_0x145dba;return _0xe9693a;});}})[_0x5003('0x1d')](respondWithFilteredResult(_0x19dc5b,_0xd43ead))[_0x5003('0x25')](handleError(_0x19dc5b,null));};exports[_0x5003('0x6c')]=function(_0x5e65f4,_0x4f7741,_0x14d2f5){return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x5e65f4[_0x5003('0x5d')]['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x4f7741,null))[_0x5003('0x1d')](function(_0x3ac144){if(_0x3ac144){return _0x3ac144[_0x5003('0x6c')](_0x5e65f4[_0x5003('0x3f')][_0x5003('0x67')]);}})[_0x5003('0x1d')](respondWithStatusCode(_0x4f7741,null))[_0x5003('0x25')](handleError(_0x4f7741,null));};exports['notify']=function(_0x3272f2,_0xb67a69,_0x34e22c){var _0x2a9d81={'body':_0x3272f2[_0x5003('0x56')],'channel':_0x5003('0x6d')};var _0x19ed15=[];var _0x5d7f5f=[];var _0x16caa4={};var _0x350fbd=![];return db[_0x5003('0x6e')][_0x5003('0x5f')]()['then'](function(_0x46c8d8){if(!_0x46c8d8){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))](_0x5003('0x71'));}_0x19ed15=_[_0x5003('0x72')](_[_0x5003('0x40')](_0x46c8d8),[_0x5003('0x73'),_0x5003('0x74')]);_0x5d7f5f=_[_0x5003('0x72')](_['keys'](_0x46c8d8),['createdAt',_0x5003('0x74'),_0x5003('0x75'),_0x5003('0x76')]);if(_0x3272f2[_0x5003('0x56')]['id']){delete _0x3272f2[_0x5003('0x56')]['id'];}if(_['isNil'](_0x3272f2['body']['from'])){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))](_0x5003('0x77'));}if(_['isNil'](_0x3272f2[_0x5003('0x56')][_0x5003('0x56')])||_0x3272f2[_0x5003('0x56')][_0x5003('0x56')]===''){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5003('0x78')](_0x3272f2[_0x5003('0x56')][_0x5003('0x79')])){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))](_0x5003('0x7a')+_0x5d7f5f);}if(!_[_0x5003('0x7b')](_0x5d7f5f,_0x3272f2[_0x5003('0x56')]['mapKey'])){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5d7f5f);}_0x16caa4[_0x3272f2[_0x5003('0x56')]['mapKey']]=_0x3272f2[_0x5003('0x56')][_0x5003('0x7c')];})[_0x5003('0x1d')](function(){return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x3272f2[_0x5003('0x5d')]['id']},'include':[{'model':db[_0x5003('0x7d')],'as':_0x5003('0x7e'),'include':[{'model':db[_0x5003('0x6e')],'as':_0x5003('0x7f'),'where':_0x16caa4,'limit':0x1,'order':[[_0x5003('0x74'),'DESC']]}]},{'model':db[_0x5003('0x80')],'as':_0x5003('0x81')}]});})[_0x5003('0x1d')](handleEntityNotFound(_0xb67a69,null))[_0x5003('0x1d')](function(_0x18c8d0){if(_0x18c8d0&&_0x18c8d0['List']){_0x2a9d81[_0x5003('0x82')]=_0x18c8d0;_0x2a9d81[_0x5003('0x83')]=_0x18c8d0[_0x5003('0x81')];_0x2a9d81[_0x5003('0x84')]=_0x18c8d0[_0x5003('0x7e')];_0x2a9d81[_0x5003('0x83')]=_[_0x5003('0x85')](_0x2a9d81[_0x5003('0x83')],[_0x5003('0x86')],['asc']);if(_0x2a9d81['account'][_0x5003('0x81')]){delete _0x2a9d81['account'][_0x5003('0x81')];}if(_0x2a9d81[_0x5003('0x82')][_0x5003('0x7e')]&&_0x2a9d81[_0x5003('0x82')][_0x5003('0x7e')][_0x5003('0x7f')]['length']){return _0x2a9d81[_0x5003('0x82')][_0x5003('0x7e')][_0x5003('0x7f')][0x0];}var _0x5e122d=_[_0x5003('0x15')](_0x3272f2['body'],{'firstName':_0x3272f2[_0x5003('0x56')][_0x5003('0x7c')],'ListId':_0x18c8d0[_0x5003('0x76')]});_0x5e122d[_0x3272f2[_0x5003('0x56')][_0x5003('0x79')]]=_0x3272f2[_0x5003('0x56')][_0x5003('0x7c')];return db['CmContact'][_0x5003('0x55')](_0x5e122d,{'fields':_0x19ed15,'raw':!![]});}})['then'](handleEntityNotFound(_0xb67a69,null))['then'](function(_0x8e9e08){_0x2a9d81[_0x5003('0x87')]=_0x8e9e08;if(_0x8e9e08){var _0x265305={'ContactId':_0x8e9e08['id'],'OpenchannelAccountId':_0x3272f2[_0x5003('0x5d')]['id'],'from':(_0x8e9e08['firstName']||'')+'\x20'+(_0x8e9e08['lastName']||'')};var _0x5ad027={'OpenchannelAccountId':_0x3272f2[_0x5003('0x5d')]['id'],'closed':![]};if(_0x3272f2[_0x5003('0x56')][_0x5003('0x88')]){_0x5ad027['threadId']=_0x3272f2[_0x5003('0x56')][_0x5003('0x88')];return db['OpenchannelInteraction'][_0x5003('0x59')]({'where':_0x5ad027})[_0x5003('0x1d')](function(_0x6de58e){if(_0x6de58e){return[_0x6de58e,![]];}_0x265305['threadId']=_0x3272f2[_0x5003('0x56')][_0x5003('0x88')];_0x265305[_0x5003('0x89')]=_0x3272f2[_0x5003('0x56')][_0x5003('0x89')];return db['OpenchannelInteraction'][_0x5003('0x55')](_0x265305)[_0x5003('0x1d')](function(_0x560c4d){return[_0x560c4d,!![]];});});}else{_0x5ad027[_0x5003('0x88')]=null;}_0x5ad027[_0x5003('0x8a')]=_0x8e9e08['id'];return db[_0x5003('0x8b')][_0x5003('0x59')]({'where':_0x5ad027})[_0x5003('0x1d')](function(_0x4e94eb){if(_0x4e94eb){return[_0x4e94eb,![]];}return db[_0x5003('0x8b')][_0x5003('0x55')](_0x265305)[_0x5003('0x1d')](function(_0x1f1b01){return[_0x1f1b01,!![]];});});}})[_0x5003('0x8c')](function(_0x45a430,_0x42a3b4){if(_0x45a430){_0x350fbd=_0x42a3b4;if(!_0x42a3b4){var _0x2d3f3d={'from':(_0x2a9d81['contact'][_0x5003('0x8d')]||'')+'\x20'+(_0x2a9d81['contact']['lastName']||'')};if(_0x3272f2['body'][_0x5003('0x88')]&&_0x3272f2[_0x5003('0x56')]['messageId']&&_0x3272f2[_0x5003('0x56')][_0x5003('0x88')]!=_0x3272f2[_0x5003('0x56')]['messageId']){_0x2d3f3d[_0x5003('0x88')]=_0x3272f2[_0x5003('0x56')][_0x5003('0x8e')];}return _0x45a430[_0x5003('0x32')](_0x2d3f3d);}else{return _0x45a430;}}})[_0x5003('0x1d')](function(_0x317f11){_0x2a9d81['interaction']=_0x317f11[_0x5003('0x34')]({'plain':!![]});_0x2a9d81[_0x5003('0x8f')][_0x5003('0x90')]=_0x350fbd;if(_0x2a9d81[_0x5003('0x8f')][_0x5003('0x90')]){if(_0x2a9d81[_0x5003('0x82')][_0x5003('0x91')]){_0x2a9d81[_0x5003('0x83')][_0x5003('0x92')]({'id':0x0,'priority':_0x2a9d81[_0x5003('0x83')][_0x5003('0x45')]+0x1,'app':_0x5003('0x93'),'appdata':_0x5003('0x94'),'interval':_0x5003('0x95')});}}return db[_0x5003('0x96')][_0x5003('0x55')]({'body':_0x3272f2[_0x5003('0x56')][_0x5003('0x56')],'OpenchannelAccountId':_0x3272f2[_0x5003('0x5d')]['id'],'OpenchannelInteractionId':_0x317f11['id'],'direction':'in','ContactId':_0x2a9d81[_0x5003('0x87')]['id'],'AttachmentId':_0x3272f2[_0x5003('0x56')][_0x5003('0x97')]});})[_0x5003('0x1d')](function(_0x53bd95){_0x2a9d81[_0x5003('0x24')]=_0x53bd95;if(_0x2a9d81['interaction'][_0x5003('0x98')]){return db[_0x5003('0x99')][_0x5003('0x59')]({'attributes':['id',_0x5003('0x38')],'where':{'id':_0x2a9d81[_0x5003('0x8f')][_0x5003('0x98')]}})[_0x5003('0x1d')](function(_0x2676b5){if(_0x2676b5){_0x2a9d81[_0x5003('0x83')][_0x5003('0x9a')]({'id':0x0,'priority':0x0,'app':_0x5003('0x9b'),'appdata':_0x2676b5['name']+','+(_0x2a9d81[_0x5003('0x82')][_0x5003('0x9c')]||0xa),'interval':'*,*,*,*'});_0x2a9d81[_0x5003('0x9d')]=![];}return respondWithRpcPromise(_0x5003('0x9e'),_0x5003('0x9f'),_0x2a9d81);});}return respondWithRpcPromise(_0x5003('0x9e'),_0x5003('0x9f'),_0x2a9d81);})[_0x5003('0x1d')](function(_0x5201f1){respondWithRpcPromise(_0x5003('0xa0'),_0x5003('0xa0'),{'event':_0x5003('0xa1'),'message':_0x5201f1},client9002);return _0x5201f1;})['then'](respondWithResult(_0xb67a69,null))[_0x5003('0x25')](handleError(_0xb67a69,null));};exports[_0x5003('0xa2')]=function(_0x30af5b,_0x444b4c,_0xe57311){return db[_0x5003('0x4f')][_0x5003('0x63')]({'where':{'id':_0x30af5b[_0x5003('0x5d')]['id']}})['then'](handleEntityNotFound(_0x444b4c,null))['then'](function(_0x57d04f){if(_0x57d04f){return db[_0x5003('0xa3')]['transaction'](function(_0x276117){return db[_0x5003('0x80')]['destroy']({'where':{'OpenchannelAccountId':_0x30af5b['params']['id']},'transaction':_0x276117})[_0x5003('0x1d')](function(_0x59d08f){var _0x16ccae=_[_0x5003('0x3b')](_0x30af5b[_0x5003('0x56')],function(_0x300578){_0x300578[_0x5003('0x61')]=_0x30af5b[_0x5003('0x5d')]['id'];return _0x300578;});return db[_0x5003('0x80')][_0x5003('0xa4')](_0x16ccae,{'transaction':_0x276117});});})[_0x5003('0x1d')](function(){return db[_0x5003('0x80')][_0x5003('0xa5')]({'where':{'OpenchannelAccountId':_0x30af5b[_0x5003('0x5d')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x444b4c,null))[_0x5003('0x25')](handleError(_0x444b4c,null));};exports['getApplications']=function(_0x455694,_0x1f5bcf,_0x393fbe){var _0x5c0e95={};var _0x55601f={};var _0x23d6fc;var _0x56e61d;return db[_0x5003('0x4f')][_0x5003('0x63')]({'where':{'id':_0x455694['params']['id']}})['then'](handleEntityNotFound(_0x1f5bcf,null))[_0x5003('0x1d')](function(_0x1c544c){if(_0x1c544c){_0x23d6fc=_0x1c544c;_0x55601f[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x80')]['rawAttributes']);_0x55601f[_0x5003('0x3f')]=_[_0x5003('0x40')](_0x455694[_0x5003('0x3f')]);_0x55601f[_0x5003('0x41')]=_['intersection'](_0x55601f[_0x5003('0x3e')],_0x55601f[_0x5003('0x3f')]);_0x5c0e95['attributes']=_[_0x5003('0x42')](_0x55601f[_0x5003('0x3e')],qs[_0x5003('0x44')](_0x455694['query']['fields']));_0x5c0e95['attributes']=_0x5c0e95[_0x5003('0x43')]['length']?_0x5c0e95[_0x5003('0x43')]:_0x55601f[_0x5003('0x3e')];_0x5c0e95[_0x5003('0x48')]=qs[_0x5003('0x65')](_0x455694[_0x5003('0x3f')][_0x5003('0x65')]);_0x5c0e95[_0x5003('0x49')]=qs[_0x5003('0x41')](_[_0x5003('0x4a')](_0x455694[_0x5003('0x3f')],_0x55601f[_0x5003('0x41')]));if(_0x455694['query'][_0x5003('0x4b')]){_0x5c0e95[_0x5003('0x49')]=_[_0x5003('0x4c')](_0x5c0e95['where'],{'$or':_[_0x5003('0x3b')](_0x5c0e95[_0x5003('0x43')],function(_0x4c940a){var _0x4f2fbc={};_0x4f2fbc[_0x4c940a]={'$like':'%'+_0x455694[_0x5003('0x3f')][_0x5003('0x4b')]+'%'};return _0x4f2fbc;})});}_0x5c0e95=_[_0x5003('0x4c')]({},_0x5c0e95,_0x455694[_0x5003('0x4e')]);return _0x23d6fc[_0x5003('0xa6')](_0x5c0e95);}})[_0x5003('0x1d')](function(_0x415cc1){if(_0x415cc1){_0x56e61d=_0x415cc1[_0x5003('0x45')];if(!_0x455694[_0x5003('0x3f')]['hasOwnProperty']('nolimit')){_0x5c0e95[_0x5003('0x2c')]=qs[_0x5003('0x2c')](_0x455694['query']['limit']);_0x5c0e95[_0x5003('0x2a')]=qs[_0x5003('0x2a')](_0x455694[_0x5003('0x3f')]['offset']);}return _0x23d6fc[_0x5003('0xa6')](_0x5c0e95);}})[_0x5003('0x1d')](function(_0x87017e){if(_0x87017e){return _0x87017e?{'count':_0x56e61d,'rows':_0x87017e}:null;}})[_0x5003('0x1d')](respondWithResult(_0x1f5bcf,null))[_0x5003('0x25')](handleError(_0x1f5bcf,null));};exports[_0x5003('0xa7')]=function(_0x18756b,_0x23d0dd,_0x11d161){var _0x102989={'raw':![],'where':{}};var _0x56c551={};var _0x3fd016={'count':0x0,'rows':[]};return db[_0x5003('0x4f')][_0x5003('0x63')]({'where':{'id':_0x18756b[_0x5003('0x5d')]['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x23d0dd,null))[_0x5003('0x1d')](function(_0x17cfaa){if(_0x17cfaa){_0x56c551[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x8b')][_0x5003('0x54')]);_0x56c551['query']=_['keys'](_0x18756b[_0x5003('0x3f')]);_0x56c551[_0x5003('0x41')]=_[_0x5003('0x42')](_0x56c551[_0x5003('0x3e')],_0x56c551[_0x5003('0x3f')]);_0x102989[_0x5003('0x43')]=_[_0x5003('0x42')](_0x56c551['model'],qs['fields'](_0x18756b[_0x5003('0x3f')][_0x5003('0x44')]));_0x102989['attributes']=_0x102989[_0x5003('0x43')]['length']?_0x102989['attributes']:_0x56c551['model'];if(!_0x18756b[_0x5003('0x3f')][_0x5003('0x46')](_0x5003('0x47'))){_0x102989['limit']=qs[_0x5003('0x2c')](_0x18756b['query']['limit']);_0x102989['offset']=qs[_0x5003('0x2a')](_0x18756b['query'][_0x5003('0x2a')]);}_0x102989[_0x5003('0x48')]=qs[_0x5003('0x65')](_0x18756b[_0x5003('0x3f')][_0x5003('0x65')]);_0x102989[_0x5003('0x49')]=qs[_0x5003('0x41')](_[_0x5003('0x4a')](_0x18756b[_0x5003('0x3f')],_0x56c551[_0x5003('0x41')]));_0x102989[_0x5003('0x49')][_0x5003('0x61')]=_0x17cfaa['id'];if(_0x18756b[_0x5003('0x3f')][_0x5003('0x4b')]){_0x102989[_0x5003('0x49')]=_[_0x5003('0x4c')](_0x102989[_0x5003('0x49')],{'$or':_[_0x5003('0x3b')](_0x102989[_0x5003('0x43')],function(_0x526f45){var _0xe5ab0f={};_0xe5ab0f[_0x526f45]={'$like':'%'+_0x18756b[_0x5003('0x3f')][_0x5003('0x4b')]+'%'};return _0xe5ab0f;})});}_0x102989=_['merge']({},_0x102989,_0x18756b[_0x5003('0x4e')]);return db[_0x5003('0x8b')][_0x5003('0x2d')]({'where':_0x102989['where']})[_0x5003('0x1d')](function(_0x53dc86){_0x3fd016[_0x5003('0x2d')]=_0x53dc86;if(_0x18756b[_0x5003('0x3f')][_0x5003('0x50')]){_0x102989[_0x5003('0x51')]=[{'model':db[_0x5003('0x6e')],'as':_0x5003('0xa8'),'required':![]},{'model':db['User'],'as':_0x5003('0xa9'),'attributes':['name',_0x5003('0xaa'),_0x5003('0xab')],'required':![]},{'model':db[_0x5003('0xac')],'as':'Tags','attributes':['id',_0x5003('0x38'),_0x5003('0xad')],'where':_0x18756b[_0x5003('0x3f')][_0x5003('0xae')]?{'id':_0x18756b['query'][_0x5003('0xae')]}:undefined,'required':_0x18756b['query'][_0x5003('0xae')]?!![]:![]}];}return db[_0x5003('0x8b')][_0x5003('0x6b')](_0x102989);})[_0x5003('0x1d')](function(_0x35b5e3){_0x3fd016[_0x5003('0x52')]=_0x35b5e3;return _0x3fd016;});}})[_0x5003('0x1d')](respondWithFilteredResult(_0x23d0dd,_0x102989))[_0x5003('0x25')](handleError(_0x23d0dd,null));};exports[_0x5003('0xaf')]=function(_0x2dc002,_0x2a3b62,_0x365802){return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x2dc002['params']['id']}})['then'](handleEntityNotFound(_0x2a3b62,null))['then'](function(_0x5ad8a3){if(_0x5ad8a3){return _0x5ad8a3[_0x5003('0xaf')](_0x2dc002[_0x5003('0x56')][_0x5003('0x67')],_['omit'](_0x2dc002[_0x5003('0x56')],[_0x5003('0x67'),'id'])||{})[_0x5003('0x8c')](function(_0x550213){for(var _0x4ddd46=0x0;_0x4ddd46<_0x2dc002[_0x5003('0x56')][_0x5003('0x67')][_0x5003('0x45')];_0x4ddd46+=0x1){socket[_0x5003('0xb0')]('userOpenchannelAccount:save',{'UserId':Number(_0x2dc002[_0x5003('0x56')][_0x5003('0x67')][_0x4ddd46]),'OpenchannelAccountId':Number(_0x2dc002[_0x5003('0x5d')]['id'])});}return _0x550213;});}})[_0x5003('0x1d')](respondWithResult(_0x2a3b62,null))[_0x5003('0x25')](handleError(_0x2a3b62,null));};exports[_0x5003('0xb1')]=function(_0x153a8e,_0x561c88,_0x561310){return db['OpenchannelAccount'][_0x5003('0x59')]({'where':{'id':_0x153a8e['params']['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x561c88,null))['then'](function(_0x1be0c6){if(_0x1be0c6){return _0x1be0c6[_0x5003('0xb1')](_0x153a8e[_0x5003('0x3f')][_0x5003('0x67')])[_0x5003('0x1d')](function(){if(_[_0x5003('0xb2')](_0x153a8e[_0x5003('0x3f')][_0x5003('0x67')])){for(var _0x584601=0x0;_0x584601<_0x153a8e[_0x5003('0x3f')][_0x5003('0x67')][_0x5003('0x45')];_0x584601+=0x1){socket['emit'](_0x5003('0xb3'),{'UserId':Number(_0x153a8e[_0x5003('0x3f')][_0x5003('0x67')][_0x584601]),'OpenchannelAccountId':Number(_0x153a8e['params']['id'])});}}else{socket[_0x5003('0xb0')](_0x5003('0xb3'),{'UserId':Number(_0x153a8e[_0x5003('0x3f')][_0x5003('0x67')]),'OpenchannelAccountId':Number(_0x153a8e[_0x5003('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x561c88,null))[_0x5003('0x25')](handleError(_0x561c88,null));};exports['getAgents']=function(_0x181a8e,_0x25a859,_0x27cff1){var _0x294007={};var _0xc297e7={};var _0x118271;var _0x5f0635;return db['OpenchannelAccount'][_0x5003('0x63')]({'where':{'id':_0x181a8e[_0x5003('0x5d')]['id']}})['then'](handleEntityNotFound(_0x25a859,null))[_0x5003('0x1d')](function(_0x8d8d60){if(_0x8d8d60){_0x118271=_0x8d8d60;_0xc297e7[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x99')][_0x5003('0x54')]);_0xc297e7[_0x5003('0x3f')]=_[_0x5003('0x40')](_0x181a8e[_0x5003('0x3f')]);_0xc297e7[_0x5003('0x41')]=_[_0x5003('0x42')](_0xc297e7[_0x5003('0x3e')],_0xc297e7[_0x5003('0x3f')]);_0x294007[_0x5003('0x43')]=_['intersection'](_0xc297e7[_0x5003('0x3e')],qs[_0x5003('0x44')](_0x181a8e[_0x5003('0x3f')][_0x5003('0x44')]));_0x294007[_0x5003('0x43')]=_0x294007[_0x5003('0x43')]['length']?_0x294007[_0x5003('0x43')]:_0xc297e7[_0x5003('0x3e')];_0x294007[_0x5003('0x48')]=qs['sort'](_0x181a8e[_0x5003('0x3f')][_0x5003('0x65')]);_0x294007[_0x5003('0x49')]=qs['filters'](_['pick'](_0x181a8e[_0x5003('0x3f')],_0xc297e7[_0x5003('0x41')]));if(_0x181a8e[_0x5003('0x3f')][_0x5003('0x4b')]){_0x294007[_0x5003('0x49')]=_[_0x5003('0x4c')](_0x294007[_0x5003('0x49')],{'$or':_[_0x5003('0x3b')](_0x294007[_0x5003('0x43')],function(_0x2c39b2){var _0x25df5f={};_0x25df5f[_0x2c39b2]={'$like':'%'+_0x181a8e['query'][_0x5003('0x4b')]+'%'};return _0x25df5f;})});}_0x294007=_[_0x5003('0x4c')]({},_0x294007,_0x181a8e[_0x5003('0x4e')]);return _0x118271[_0x5003('0xb4')](_0x294007);}})[_0x5003('0x1d')](function(_0x1ecb27){if(_0x1ecb27){_0x5f0635=_0x1ecb27['length'];if(!_0x181a8e[_0x5003('0x3f')][_0x5003('0x46')](_0x5003('0x47'))){_0x294007[_0x5003('0x2c')]=qs[_0x5003('0x2c')](_0x181a8e[_0x5003('0x3f')][_0x5003('0x2c')]);_0x294007[_0x5003('0x2a')]=qs[_0x5003('0x2a')](_0x181a8e[_0x5003('0x3f')][_0x5003('0x2a')]);}return _0x118271['getAgents'](_0x294007);}})[_0x5003('0x1d')](function(_0x35b162){if(_0x35b162){return _0x35b162?{'count':_0x5f0635,'rows':_0x35b162}:null;}})['then'](respondWithResult(_0x25a859,null))[_0x5003('0x25')](handleError(_0x25a859,null));};exports['send']=function(_0x41ed0f,_0x477573,_0x2f395d){var _0x5c0eab,_0x16f871,_0xa39a47;if(_[_0x5003('0x78')](_0x41ed0f['body'][_0x5003('0x56')])||_0x41ed0f[_0x5003('0x56')]['body']===''){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5003('0x78')](_0x41ed0f[_0x5003('0x56')]['to'])){}_0x5c0eab=_0x41ed0f[_0x5003('0x56')]['to'];return db[_0x5003('0x4f')]['findOne']({'where':{'id':_0x41ed0f[_0x5003('0x5d')]['id']}})['then'](handleEntityNotFound(_0x477573,null))[_0x5003('0x1d')](function(_0x166d56){if(_0x166d56){return db[_0x5003('0x4f')]['find']({'where':{'id':_0x166d56['id']},'include':[{'model':db[_0x5003('0x7d')],'as':'List','include':[{'model':db[_0x5003('0x6e')],'as':_0x5003('0x7f'),'where':{[_0x166d56[_0x5003('0x79')]]:_0x5c0eab},'limit':0x1,'order':[[_0x5003('0x74'),_0x5003('0xb5')]]}]}]})['then'](handleEntityNotFound(_0x477573,null))[_0x5003('0x1d')](function(_0x4f8413){if(_0x4f8413&&_0x4f8413['List']){_0x16f871=_0x4f8413[_0x5003('0x34')]({'plain':!![]});if(_0x16f871[_0x5003('0x7e')]&&_0x16f871[_0x5003('0x7e')][_0x5003('0x7f')][_0x5003('0x45')]){return _0x16f871['List'][_0x5003('0x7f')][0x0];}return db['CmContact'][_0x5003('0x55')](_[_0x5003('0x15')](_0x41ed0f['body'],{'firstName':_0x5c0eab,[_0x4f8413[_0x5003('0x79')]]:_0x5c0eab,'phone':_0x5c0eab,'ListId':_0x16f871[_0x5003('0x76')]}));}})['then'](handleEntityNotFound(_0x477573,null))[_0x5003('0x1d')](function(_0x5f3879){if(_0x5f3879){_0xa39a47=_0x5f3879;return db['OpenchannelInteraction'][_0x5003('0x59')]({'where':{'ContactId':_0xa39a47['id'],'closed':![],'OpenchannelAccountId':_0x16f871['id']}})['then'](function(_0x12eba9){if(_0x12eba9){return[_0x12eba9,![]];}return db[_0x5003('0x8b')][_0x5003('0x55')]({'UserId':_0x41ed0f[_0x5003('0x57')]['id'],'ContactId':_0xa39a47['id'],'OpenchannelAccountId':_0x16f871['id'],'lastMsgDirection':_0x5003('0xb6'),'Messages':[_[_0x5003('0x4c')](_0x41ed0f[_0x5003('0x56')],{'read':![],'body':_0x41ed0f['body'][_0x5003('0x56')],'OpenchannelAccountId':_0x16f871['id'],'UserId':_0x41ed0f['user']['id'],'ContactId':_0xa39a47['id']})]},{'include':[{'model':db[_0x5003('0x96')],'as':_0x5003('0xb7')}]})[_0x5003('0x1d')](function(_0x268d5e){return[_0x268d5e,!![]];});});}})[_0x5003('0x8c')](function(_0x2e4b1c,_0x1c6760){if(_0x1c6760){return _0x2e4b1c;}return db[_0x5003('0x96')][_0x5003('0x55')](_[_0x5003('0x4c')](_0x41ed0f[_0x5003('0x56')],{'read':![],'body':_0x41ed0f[_0x5003('0x56')][_0x5003('0x56')],'OpenchannelAccountId':_0x16f871['id'],'OpenchannelInteractionId':_0x2e4b1c['id'],'UserId':_0x41ed0f[_0x5003('0x57')]['id'],'ContactId':_0xa39a47['id']}))[_0x5003('0x1d')](function(_0x5e5a1a){_0x2e4b1c['dataValues'][_0x5003('0xb7')]=[];_0x2e4b1c['dataValues'][_0x5003('0xb7')]['push'](_0x5e5a1a[_0x5003('0xb8')]);return _0x2e4b1c;});});}})[_0x5003('0x1d')](respondWithResult(_0x477573,null))[_0x5003('0x25')](handleError(_0x477573,null));}; \ No newline at end of file +var _0x8572=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','params','mandatoryDispositionPause','length','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Applications','list','applications','orderBy','priority','asc','account','Contacts','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','push','rimraf','zip-dir','moment','mustache'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x8572,0x17a));var _0x2857=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x8572[_0xc0a3d3];return _0x3386e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2857('0x0'));var zipdir=require(_0x2857('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2857('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2857('0x3'));var util=require(_0x2857('0x4'));var path=require(_0x2857('0x5'));var sox=require(_0x2857('0x6'));var csv=require(_0x2857('0x7'));var ejs=require(_0x2857('0x8'));var fs=require('fs');var fs_extra=require(_0x2857('0x9'));var _=require(_0x2857('0xa'));var squel=require(_0x2857('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2857('0xc'));var toCsv=require(_0x2857('0x7'));var querystring=require(_0x2857('0xd'));var Papa=require(_0x2857('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2857('0xf'));var hardwareService=require(_0x2857('0x10'));var logger=require('../../config/logger')(_0x2857('0x11'));var utils=require(_0x2857('0x12'));var config=require(_0x2857('0x13'));var licenseUtil=require(_0x2857('0x14'));var db=require(_0x2857('0x15'))['db'];config[_0x2857('0x16')]=_[_0x2857('0x17')](config[_0x2857('0x16')],{'host':_0x2857('0x18'),'port':0x18eb});var socket=require(_0x2857('0x19'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x2857('0x1a')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c43d4,_0x36684b,_0x5f209b,_0x51d0cd){return new BPromise(function(_0x4463fa,_0x3a9d86){var _0x11e008=_0x51d0cd||client;return _0x11e008[_0x2857('0x1b')](_0x2c43d4,_0x5f209b)[_0x2857('0x1c')](function(_0x18610a){logger[_0x2857('0x1d')](_0x2857('0x1e'),_0x36684b,_0x2857('0x1f'));logger[_0x2857('0x20')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x36684b,_0x2857('0x1f'),JSON[_0x2857('0x21')](_0x18610a));if(_0x18610a[_0x2857('0x22')]){if(_0x18610a[_0x2857('0x22')][_0x2857('0x23')]===0x1f4){logger['error'](_0x2857('0x1e'),_0x36684b,_0x18610a['error']['message']);return _0x3a9d86(_0x18610a[_0x2857('0x22')][_0x2857('0x24')]);}logger['error'](_0x2857('0x1e'),_0x36684b,_0x18610a[_0x2857('0x22')][_0x2857('0x24')]);return _0x4463fa(_0x18610a[_0x2857('0x22')][_0x2857('0x24')]);}else{logger['info'](_0x2857('0x1e'),_0x36684b,_0x2857('0x1f'));_0x4463fa(_0x18610a[_0x2857('0x25')][_0x2857('0x24')]);}})[_0x2857('0x26')](function(_0x41ced8){logger[_0x2857('0x22')](_0x2857('0x1e'),_0x36684b,_0x41ced8);_0x3a9d86(_0x41ced8);});});}function respondWithStatusCode(_0x45e178,_0x3cd526){_0x3cd526=_0x3cd526||0xcc;return function(_0x4a7133){if(_0x4a7133){return _0x45e178['sendStatus'](_0x3cd526);}return _0x45e178[_0x2857('0x27')](_0x3cd526)[_0x2857('0x28')]();};}function respondWithResult(_0x5ca2e3,_0x46c6ad){_0x46c6ad=_0x46c6ad||0xc8;return function(_0xda29d0){if(_0xda29d0){return _0x5ca2e3[_0x2857('0x27')](_0x46c6ad)[_0x2857('0x29')](_0xda29d0);}};}function respondWithFilteredResult(_0x3091b4,_0x3d9146){return function(_0x103454){if(_0x103454){var _0x3dfd82=typeof _0x3d9146[_0x2857('0x2a')]===_0x2857('0x2b')&&typeof _0x3d9146['limit']==='undefined';var _0x1090d5=_0x103454['count'];var _0xc3f078=_0x3dfd82?0x0:_0x3d9146[_0x2857('0x2a')];var _0x3aca53=_0x3dfd82?_0x103454[_0x2857('0x2c')]:_0x3d9146[_0x2857('0x2a')]+_0x3d9146[_0x2857('0x2d')];var _0x3d9829;if(_0x3aca53>=_0x1090d5){_0x3aca53=_0x1090d5;_0x3d9829=0xc8;}else{_0x3d9829=0xce;}_0x3091b4[_0x2857('0x27')](_0x3d9829);return _0x3091b4[_0x2857('0x2e')](_0x2857('0x2f'),_0xc3f078+'-'+_0x3aca53+'/'+_0x1090d5)[_0x2857('0x29')](_0x103454);}return null;};}function patchUpdates(_0x5176d3){return function(_0x40d639){try{jsonpatch[_0x2857('0x30')](_0x40d639,_0x5176d3,!![]);}catch(_0x39dd2c){return BPromise[_0x2857('0x31')](_0x39dd2c);}return _0x40d639[_0x2857('0x32')]();};}function saveUpdates(_0x270fe7,_0x5d47b2){return function(_0x113ef5){if(_0x113ef5){return _0x113ef5[_0x2857('0x33')](_0x270fe7)[_0x2857('0x1c')](function(_0x525a37){return _0x525a37;});}return null;};}function removeEntity(_0xeaffb3,_0x47a37e){return function(_0x1afff6){if(_0x1afff6){return _0x1afff6[_0x2857('0x34')]()[_0x2857('0x1c')](function(){var _0x4a9f96=_0x1afff6[_0x2857('0x35')]({'plain':!![]});var _0x15c027=_0x2857('0x36');return db[_0x2857('0x37')][_0x2857('0x34')]({'where':{'type':_0x15c027,'resourceId':_0x4a9f96['id']}})[_0x2857('0x1c')](function(){return _0x1afff6;});})['then'](function(){_0xeaffb3[_0x2857('0x27')](0xcc)[_0x2857('0x28')]();});}};}function handleEntityNotFound(_0x21079e,_0x25817d){return function(_0x3daeeb){if(!_0x3daeeb){_0x21079e[_0x2857('0x38')](0x194);}return _0x3daeeb;};}function handleError(_0x4bd951,_0x539ac9){_0x539ac9=_0x539ac9||0x1f4;return function(_0x137f7b){logger[_0x2857('0x22')](_0x137f7b[_0x2857('0x39')]);if(_0x137f7b['name']){delete _0x137f7b[_0x2857('0x3a')];}_0x4bd951[_0x2857('0x27')](_0x539ac9)[_0x2857('0x3b')](_0x137f7b);};}exports[_0x2857('0x3c')]=function(_0x3c90be,_0x23e4c8){var _0x54c234={'include':[{'model':db[_0x2857('0x3d')],'as':'mandatoryDispositionPause'}]},_0x15ab52={},_0x14e903={'count':0x0,'rows':[]};var _0x94584b=_[_0x2857('0x3e')](db[_0x2857('0x3f')][_0x2857('0x40')],function(_0x3b5b17){return{'name':_0x3b5b17[_0x2857('0x41')],'type':_0x3b5b17[_0x2857('0x42')][_0x2857('0x43')]};});_0x15ab52[_0x2857('0x44')]=_[_0x2857('0x3e')](_0x94584b,_0x2857('0x3a'));_0x15ab52['query']=_[_0x2857('0x45')](_0x3c90be[_0x2857('0x46')]);_0x15ab52[_0x2857('0x47')]=_['intersection'](_0x15ab52[_0x2857('0x44')],_0x15ab52['query']);_0x54c234[_0x2857('0x48')]=_[_0x2857('0x49')](_0x15ab52['model'],qs[_0x2857('0x4a')](_0x3c90be[_0x2857('0x46')]['fields']));_0x54c234[_0x2857('0x48')]=_0x54c234[_0x2857('0x48')]['length']?_0x54c234['attributes']:_0x15ab52[_0x2857('0x44')];if(!_0x3c90be[_0x2857('0x46')][_0x2857('0x4b')](_0x2857('0x4c'))){_0x54c234[_0x2857('0x2d')]=qs[_0x2857('0x2d')](_0x3c90be[_0x2857('0x46')][_0x2857('0x2d')]);_0x54c234[_0x2857('0x2a')]=qs[_0x2857('0x2a')](_0x3c90be[_0x2857('0x46')][_0x2857('0x2a')]);}_0x54c234[_0x2857('0x4d')]=qs[_0x2857('0x4e')](_0x3c90be[_0x2857('0x46')]['sort']);_0x54c234[_0x2857('0x4f')]=qs['filters'](_[_0x2857('0x50')](_0x3c90be[_0x2857('0x46')],_0x15ab52[_0x2857('0x47')]),_0x94584b);if(_0x3c90be[_0x2857('0x46')]['filter']){_0x54c234[_0x2857('0x4f')]=_[_0x2857('0x51')](_0x54c234[_0x2857('0x4f')],{'$or':_[_0x2857('0x3e')](_0x94584b,function(_0x5176de){if(_0x5176de[_0x2857('0x42')]!==_0x2857('0x52')){var _0x2a7f60={};_0x2a7f60[_0x5176de['name']]={'$like':'%'+_0x3c90be[_0x2857('0x46')][_0x2857('0x53')]+'%'};return _0x2a7f60;}})});}_0x54c234=_[_0x2857('0x51')]({},_0x54c234,_0x3c90be[_0x2857('0x54')]);var _0x20c78f={'where':_0x54c234['where']};return db['OpenchannelAccount'][_0x2857('0x2c')](_0x20c78f)[_0x2857('0x1c')](function(_0x388be3){_0x14e903[_0x2857('0x2c')]=_0x388be3;if(_0x3c90be['query']['includeAll']){_0x54c234[_0x2857('0x55')]=[{'all':!![]}];}return db[_0x2857('0x3f')]['findAll'](_0x54c234);})['then'](function(_0x223c3a){_0x14e903[_0x2857('0x56')]=_0x223c3a;return _0x14e903;})[_0x2857('0x1c')](respondWithFilteredResult(_0x23e4c8,_0x54c234))[_0x2857('0x26')](handleError(_0x23e4c8,null));};exports['show']=function(_0x2c83c1,_0x267129){var _0x300add={'raw':![],'where':{'id':_0x2c83c1[_0x2857('0x57')]['id']},'include':[{'model':db[_0x2857('0x3d')],'as':_0x2857('0x58')}]},_0x4c1c08={};_0x4c1c08[_0x2857('0x44')]=_[_0x2857('0x45')](db[_0x2857('0x3f')]['rawAttributes']);_0x4c1c08[_0x2857('0x46')]=_[_0x2857('0x45')](_0x2c83c1[_0x2857('0x46')]);_0x4c1c08[_0x2857('0x47')]=_['intersection'](_0x4c1c08[_0x2857('0x44')],_0x4c1c08[_0x2857('0x46')]);_0x300add[_0x2857('0x48')]=_[_0x2857('0x49')](_0x4c1c08[_0x2857('0x44')],qs[_0x2857('0x4a')](_0x2c83c1[_0x2857('0x46')][_0x2857('0x4a')]));_0x300add[_0x2857('0x48')]=_0x300add[_0x2857('0x48')][_0x2857('0x59')]?_0x300add[_0x2857('0x48')]:_0x4c1c08[_0x2857('0x44')];if(_0x2c83c1['query'][_0x2857('0x5a')]){_0x300add[_0x2857('0x55')]=[{'all':!![]}];}_0x300add=_[_0x2857('0x51')]({},_0x300add,_0x2c83c1['options']);return db[_0x2857('0x3f')]['find'](_0x300add)[_0x2857('0x1c')](handleEntityNotFound(_0x267129,null))[_0x2857('0x1c')](respondWithResult(_0x267129,null))[_0x2857('0x26')](handleError(_0x267129,null));};exports[_0x2857('0x5b')]=function(_0x4ad363,_0x211bef){return db['OpenchannelAccount'][_0x2857('0x5b')](_0x4ad363['body'],{})[_0x2857('0x1c')](function(_0x16e39d){var _0x36dd88=_0x4ad363[_0x2857('0x5c')][_0x2857('0x35')]({'plain':!![]});if(!_0x36dd88)throw new Error(_0x2857('0x5d'));if(_0x36dd88[_0x2857('0x5e')]===_0x2857('0x5c')){var _0x3bf527=_0x16e39d[_0x2857('0x35')]({'plain':!![]});var _0x4affb0='OpenchannelAccounts';return db[_0x2857('0x5f')][_0x2857('0x60')]({'where':{'name':_0x4affb0,'userProfileId':_0x36dd88[_0x2857('0x61')]},'raw':!![]})[_0x2857('0x1c')](function(_0x391f3f){if(_0x391f3f&&_0x391f3f['autoAssociation']===0x0){return db[_0x2857('0x37')][_0x2857('0x5b')]({'name':_0x3bf527[_0x2857('0x3a')],'resourceId':_0x3bf527['id'],'type':_0x391f3f[_0x2857('0x3a')],'sectionId':_0x391f3f['id']},{})[_0x2857('0x1c')](function(){return _0x16e39d;});}else{return _0x16e39d;}})[_0x2857('0x26')](function(_0x45efbd){logger[_0x2857('0x22')](_0x2857('0x62'),_0x45efbd);throw _0x45efbd;});}return _0x16e39d;})[_0x2857('0x1c')](respondWithResult(_0x211bef,0xc9))[_0x2857('0x26')](handleError(_0x211bef,null));};exports[_0x2857('0x33')]=function(_0x3f3346,_0x539b67){if(_0x3f3346[_0x2857('0x63')]['id']){delete _0x3f3346[_0x2857('0x63')]['id'];}return db[_0x2857('0x3f')]['find']({'where':{'id':_0x3f3346[_0x2857('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x539b67,null))[_0x2857('0x1c')](saveUpdates(_0x3f3346['body'],null))[_0x2857('0x1c')](respondWithResult(_0x539b67,null))[_0x2857('0x26')](handleError(_0x539b67,null));};exports['destroy']=function(_0x50ac7f,_0x4b9956){return db[_0x2857('0x3f')][_0x2857('0x60')]({'where':{'id':_0x50ac7f[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x4b9956,null))['then'](removeEntity(_0x4b9956,null))['catch'](handleError(_0x4b9956,null));};exports[_0x2857('0x64')]=function(_0x4b1690,_0x434beb){return db['OpenchannelAccount'][_0x2857('0x64')]()[_0x2857('0x1c')](respondWithResult(_0x434beb,null))[_0x2857('0x26')](handleError(_0x434beb,null));};exports['addDisposition']=function(_0x1d29b5,_0x376365,_0xcec02e){if(_0x1d29b5[_0x2857('0x63')]['id']){delete _0x1d29b5['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x1d29b5[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x376365,null))[_0x2857('0x1c')](function(_0x98eb7f){if(_0x98eb7f){_0x1d29b5['body'][_0x2857('0x65')]=_0x98eb7f['id'];return db[_0x2857('0x66')][_0x2857('0x5b')](_0x1d29b5[_0x2857('0x63')]);}})[_0x2857('0x1c')](respondWithResult(_0x376365,null))[_0x2857('0x26')](handleError(_0x376365,null));};exports[_0x2857('0x67')]=function(_0x318a0b,_0x534e2c,_0x2dcafd){var _0x384c95={'raw':![],'where':{}};var _0x2c49db={};var _0x4d0e6c={'count':0x0,'rows':[]};return db[_0x2857('0x3f')][_0x2857('0x68')]({'where':{'id':_0x318a0b['params']['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x534e2c,null))[_0x2857('0x1c')](function(_0x725c0c){if(_0x725c0c){_0x2c49db[_0x2857('0x44')]=_[_0x2857('0x45')](db[_0x2857('0x66')]['rawAttributes']);_0x2c49db[_0x2857('0x46')]=_[_0x2857('0x45')](_0x318a0b[_0x2857('0x46')]);_0x2c49db[_0x2857('0x47')]=_[_0x2857('0x49')](_0x2c49db[_0x2857('0x44')],_0x2c49db['query']);_0x384c95[_0x2857('0x48')]=_[_0x2857('0x49')](_0x2c49db['model'],qs['fields'](_0x318a0b[_0x2857('0x46')][_0x2857('0x4a')]));_0x384c95[_0x2857('0x48')]=_0x384c95[_0x2857('0x48')][_0x2857('0x59')]?_0x384c95[_0x2857('0x48')]:_0x2c49db[_0x2857('0x44')];if(!_0x318a0b['query']['hasOwnProperty'](_0x2857('0x4c'))){_0x384c95['limit']=qs[_0x2857('0x2d')](_0x318a0b[_0x2857('0x46')][_0x2857('0x2d')]);_0x384c95[_0x2857('0x2a')]=qs[_0x2857('0x2a')](_0x318a0b[_0x2857('0x46')][_0x2857('0x2a')]);}_0x384c95[_0x2857('0x4d')]=qs[_0x2857('0x4e')](_0x318a0b[_0x2857('0x46')][_0x2857('0x4e')]);_0x384c95[_0x2857('0x4f')]=qs[_0x2857('0x47')](_[_0x2857('0x50')](_0x318a0b[_0x2857('0x46')],_0x2c49db[_0x2857('0x47')]));_0x384c95[_0x2857('0x4f')]['OpenchannelAccountId']=_0x725c0c['id'];if(_0x318a0b[_0x2857('0x46')]['filter']){_0x384c95['where']=_['merge'](_0x384c95[_0x2857('0x4f')],{'$or':_['map'](_0x384c95[_0x2857('0x48')],function(_0x10a553){var _0x42abd8={};_0x42abd8[_0x10a553]={'$like':'%'+_0x318a0b[_0x2857('0x46')][_0x2857('0x53')]+'%'};return _0x42abd8;})});}_0x384c95=_[_0x2857('0x51')]({},_0x384c95,_0x318a0b[_0x2857('0x54')]);return db['Disposition'][_0x2857('0x2c')]({'where':_0x384c95[_0x2857('0x4f')]})[_0x2857('0x1c')](function(_0x5592f9){_0x4d0e6c[_0x2857('0x2c')]=_0x5592f9;if(_0x318a0b['query'][_0x2857('0x5a')]){_0x384c95['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x384c95);})[_0x2857('0x1c')](function(_0x5883ef){_0x4d0e6c['rows']=_0x5883ef;return _0x4d0e6c;});}})[_0x2857('0x1c')](respondWithFilteredResult(_0x534e2c,_0x384c95))[_0x2857('0x26')](handleError(_0x534e2c,null));};exports[_0x2857('0x69')]=function(_0x1efbaf,_0x14b38b,_0x544e57){return db['OpenchannelAccount'][_0x2857('0x60')]({'where':{'id':_0x1efbaf[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x14b38b,null))[_0x2857('0x1c')](function(_0x251fb2){if(_0x251fb2){return _0x251fb2['removeDispositions'](_0x1efbaf[_0x2857('0x46')][_0x2857('0x6a')]);}})[_0x2857('0x1c')](respondWithStatusCode(_0x14b38b,null))[_0x2857('0x26')](handleError(_0x14b38b,null));};exports[_0x2857('0x6b')]=function(_0x375c17,_0x4fc757,_0x24a8be){if(_0x375c17['body']['id']){delete _0x375c17['body']['id'];}return db['OpenchannelAccount'][_0x2857('0x60')]({'where':{'id':_0x375c17[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x4fc757,null))[_0x2857('0x1c')](function(_0x5bb684){if(_0x5bb684){_0x375c17[_0x2857('0x63')]['OpenchannelAccountId']=_0x5bb684['id'];return db['CannedAnswer']['create'](_0x375c17[_0x2857('0x63')]);}})[_0x2857('0x1c')](respondWithResult(_0x4fc757,null))['catch'](handleError(_0x4fc757,null));};exports[_0x2857('0x6c')]=function(_0x565644,_0x51c9b3,_0x1c32d8){var _0x3c3869={'raw':![],'where':{}};var _0x2d37ab={};var _0x543a5e={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x2857('0x68')]({'where':{'id':_0x565644['params']['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x51c9b3,null))[_0x2857('0x1c')](function(_0x4edddb){if(_0x4edddb){_0x2d37ab[_0x2857('0x44')]=_[_0x2857('0x45')](db[_0x2857('0x6d')][_0x2857('0x40')]);_0x2d37ab[_0x2857('0x46')]=_[_0x2857('0x45')](_0x565644['query']);_0x2d37ab[_0x2857('0x47')]=_[_0x2857('0x49')](_0x2d37ab[_0x2857('0x44')],_0x2d37ab[_0x2857('0x46')]);_0x3c3869[_0x2857('0x48')]=_['intersection'](_0x2d37ab[_0x2857('0x44')],qs[_0x2857('0x4a')](_0x565644[_0x2857('0x46')][_0x2857('0x4a')]));_0x3c3869['attributes']=_0x3c3869[_0x2857('0x48')][_0x2857('0x59')]?_0x3c3869[_0x2857('0x48')]:_0x2d37ab[_0x2857('0x44')];if(!_0x565644[_0x2857('0x46')][_0x2857('0x4b')]('nolimit')){_0x3c3869[_0x2857('0x2d')]=qs[_0x2857('0x2d')](_0x565644[_0x2857('0x46')][_0x2857('0x2d')]);_0x3c3869[_0x2857('0x2a')]=qs['offset'](_0x565644[_0x2857('0x46')]['offset']);}_0x3c3869[_0x2857('0x4d')]=qs[_0x2857('0x4e')](_0x565644[_0x2857('0x46')][_0x2857('0x4e')]);_0x3c3869[_0x2857('0x4f')]=qs[_0x2857('0x47')](_['pick'](_0x565644[_0x2857('0x46')],_0x2d37ab[_0x2857('0x47')]));_0x3c3869['where'][_0x2857('0x65')]=_0x4edddb['id'];if(_0x565644[_0x2857('0x46')][_0x2857('0x53')]){_0x3c3869[_0x2857('0x4f')]=_[_0x2857('0x51')](_0x3c3869[_0x2857('0x4f')],{'$or':_[_0x2857('0x3e')](_0x3c3869[_0x2857('0x48')],function(_0x34c952){var _0x9bddee={};_0x9bddee[_0x34c952]={'$like':'%'+_0x565644[_0x2857('0x46')]['filter']+'%'};return _0x9bddee;})});}_0x3c3869=_['merge']({},_0x3c3869,_0x565644[_0x2857('0x54')]);return db[_0x2857('0x6d')][_0x2857('0x2c')]({'where':_0x3c3869[_0x2857('0x4f')]})['then'](function(_0x4bdc01){_0x543a5e[_0x2857('0x2c')]=_0x4bdc01;if(_0x565644[_0x2857('0x46')][_0x2857('0x5a')]){_0x3c3869['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3c3869);})[_0x2857('0x1c')](function(_0x31bec9){_0x543a5e[_0x2857('0x56')]=_0x31bec9;return _0x543a5e;});}})[_0x2857('0x1c')](respondWithFilteredResult(_0x51c9b3,_0x3c3869))[_0x2857('0x26')](handleError(_0x51c9b3,null));};exports[_0x2857('0x6e')]=function(_0x388eb6,_0x2989ca,_0x5e6f48){return db[_0x2857('0x3f')]['find']({'where':{'id':_0x388eb6[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x2989ca,null))['then'](function(_0x468e40){if(_0x468e40){return _0x468e40[_0x2857('0x6e')](_0x388eb6[_0x2857('0x46')][_0x2857('0x6a')]);}})[_0x2857('0x1c')](respondWithStatusCode(_0x2989ca,null))[_0x2857('0x26')](handleError(_0x2989ca,null));};exports[_0x2857('0x6f')]=function(_0x29f4ee,_0x5299d3,_0x240f2f){var _0x1f810b={'body':_0x29f4ee[_0x2857('0x63')],'channel':_0x2857('0x70')};var _0x5c73cd=[];var _0x2625d0=[];var _0x3f3c5e={};var _0x4f0449=![];return db[_0x2857('0x71')][_0x2857('0x64')]()[_0x2857('0x1c')](function(_0x1af67a){if(!_0x1af67a){throw new db[(_0x2857('0x72'))]['ValidationError'](_0x2857('0x73'));}_0x5c73cd=_[_0x2857('0x74')](_[_0x2857('0x45')](_0x1af67a),[_0x2857('0x75'),'updatedAt']);_0x2625d0=_[_0x2857('0x74')](_[_0x2857('0x45')](_0x1af67a),['createdAt',_0x2857('0x76'),_0x2857('0x77'),_0x2857('0x78')]);if(_0x29f4ee['body']['id']){delete _0x29f4ee[_0x2857('0x63')]['id'];}if(_['isNil'](_0x29f4ee[_0x2857('0x63')][_0x2857('0x79')])){throw new db[(_0x2857('0x72'))]['ValidationError'](_0x2857('0x7a'));}if(_[_0x2857('0x7b')](_0x29f4ee['body'][_0x2857('0x63')])||_0x29f4ee[_0x2857('0x63')]['body']===''){throw new db[(_0x2857('0x72'))][(_0x2857('0x7c'))](_0x2857('0x7d'));}if(_[_0x2857('0x7b')](_0x29f4ee['body'][_0x2857('0x7e')])){throw new db[(_0x2857('0x72'))]['ValidationError'](_0x2857('0x7f')+_0x2625d0);}if(!_['includes'](_0x2625d0,_0x29f4ee['body'][_0x2857('0x7e')])){throw new db[(_0x2857('0x72'))][(_0x2857('0x7c'))](_0x2857('0x80')+_0x2625d0);}_0x3f3c5e[_0x29f4ee[_0x2857('0x63')][_0x2857('0x7e')]]=_0x29f4ee['body'][_0x2857('0x79')];})[_0x2857('0x1c')](function(){return db[_0x2857('0x3f')][_0x2857('0x60')]({'where':{'id':_0x29f4ee[_0x2857('0x57')]['id']},'include':[{'model':db[_0x2857('0x81')],'as':'List','include':[{'model':db[_0x2857('0x71')],'as':'Contacts','where':_0x3f3c5e,'limit':0x1,'order':[[_0x2857('0x76'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x2857('0x1c')](handleEntityNotFound(_0x5299d3,null))[_0x2857('0x1c')](function(_0x4f9cb8){if(_0x4f9cb8&&_0x4f9cb8[_0x2857('0x82')]){_0x1f810b['account']=_0x4f9cb8;_0x1f810b['applications']=_0x4f9cb8[_0x2857('0x83')];_0x1f810b[_0x2857('0x84')]=_0x4f9cb8[_0x2857('0x82')];_0x1f810b[_0x2857('0x85')]=_[_0x2857('0x86')](_0x1f810b[_0x2857('0x85')],[_0x2857('0x87')],[_0x2857('0x88')]);if(_0x1f810b[_0x2857('0x89')]['Applications']){delete _0x1f810b['account'][_0x2857('0x83')];}if(_0x1f810b[_0x2857('0x89')][_0x2857('0x82')]&&_0x1f810b[_0x2857('0x89')][_0x2857('0x82')][_0x2857('0x8a')]['length']){return _0x1f810b[_0x2857('0x89')][_0x2857('0x82')]['Contacts'][0x0];}var _0x20cd3a=_['defaults'](_0x29f4ee['body'],{'firstName':_0x29f4ee[_0x2857('0x63')]['from'],'ListId':_0x4f9cb8['ListId']});_0x20cd3a[_0x29f4ee[_0x2857('0x63')][_0x2857('0x7e')]]=_0x29f4ee['body']['from'];return db[_0x2857('0x71')][_0x2857('0x5b')](_0x20cd3a,{'fields':_0x5c73cd,'raw':!![]});}})[_0x2857('0x1c')](handleEntityNotFound(_0x5299d3,null))[_0x2857('0x1c')](function(_0x36db44){_0x1f810b['contact']=_0x36db44;if(_0x36db44){var _0x3f7800={'ContactId':_0x36db44['id'],'OpenchannelAccountId':_0x29f4ee[_0x2857('0x57')]['id'],'from':(_0x36db44[_0x2857('0x8b')]||'')+'\x20'+(_0x36db44[_0x2857('0x8c')]||'')};var _0x5efb91={'OpenchannelAccountId':_0x29f4ee[_0x2857('0x57')]['id'],'closed':![]};if(_0x29f4ee[_0x2857('0x63')][_0x2857('0x8d')]){_0x5efb91[_0x2857('0x8d')]=_0x29f4ee['body']['threadId'];return db['OpenchannelInteraction'][_0x2857('0x60')]({'where':_0x5efb91})[_0x2857('0x1c')](function(_0x481d0a){if(_0x481d0a){return[_0x481d0a,![]];}_0x3f7800['threadId']=_0x29f4ee['body']['threadId'];_0x3f7800[_0x2857('0x8e')]=_0x29f4ee[_0x2857('0x63')][_0x2857('0x8e')];return db[_0x2857('0x8f')][_0x2857('0x5b')](_0x3f7800)[_0x2857('0x1c')](function(_0x4b8003){return[_0x4b8003,!![]];});});}else{_0x5efb91[_0x2857('0x8d')]=null;}_0x5efb91[_0x2857('0x90')]=_0x36db44['id'];return db[_0x2857('0x8f')][_0x2857('0x60')]({'where':_0x5efb91})['then'](function(_0xf1d066){if(_0xf1d066){return[_0xf1d066,![]];}return db['OpenchannelInteraction'][_0x2857('0x5b')](_0x3f7800)[_0x2857('0x1c')](function(_0x4475e7){return[_0x4475e7,!![]];});});}})[_0x2857('0x91')](function(_0x44e319,_0x333204){if(_0x44e319){_0x4f0449=_0x333204;if(!_0x333204){var _0x7c9676={'from':(_0x1f810b[_0x2857('0x92')][_0x2857('0x8b')]||'')+'\x20'+(_0x1f810b[_0x2857('0x92')][_0x2857('0x8c')]||'')};if(_0x29f4ee[_0x2857('0x63')][_0x2857('0x8d')]&&_0x29f4ee[_0x2857('0x63')][_0x2857('0x93')]&&_0x29f4ee[_0x2857('0x63')]['threadId']!=_0x29f4ee['body'][_0x2857('0x93')]){_0x7c9676[_0x2857('0x8d')]=_0x29f4ee[_0x2857('0x63')][_0x2857('0x93')];}return _0x44e319[_0x2857('0x33')](_0x7c9676);}else{return _0x44e319;}}})[_0x2857('0x1c')](function(_0x1a3ba6){_0x1f810b[_0x2857('0x94')]=_0x1a3ba6[_0x2857('0x35')]({'plain':!![]});_0x1f810b[_0x2857('0x94')][_0x2857('0x95')]=_0x4f0449;if(_0x1f810b[_0x2857('0x94')][_0x2857('0x95')]){if(_0x1f810b['account'][_0x2857('0x96')]){_0x1f810b[_0x2857('0x85')]['push']({'id':0x0,'priority':_0x1f810b[_0x2857('0x85')][_0x2857('0x59')]+0x1,'app':_0x2857('0x97'),'appdata':_0x2857('0x98'),'interval':_0x2857('0x99')});}}return db[_0x2857('0x9a')][_0x2857('0x5b')]({'body':_0x29f4ee[_0x2857('0x63')]['body'],'OpenchannelAccountId':_0x29f4ee[_0x2857('0x57')]['id'],'OpenchannelInteractionId':_0x1a3ba6['id'],'direction':'in','ContactId':_0x1f810b[_0x2857('0x92')]['id'],'AttachmentId':_0x29f4ee[_0x2857('0x63')][_0x2857('0x9b')]});})[_0x2857('0x1c')](function(_0x516903){_0x1f810b['message']=_0x516903;if(_0x1f810b[_0x2857('0x94')]['UserId']){return db[_0x2857('0x9c')][_0x2857('0x60')]({'attributes':['id',_0x2857('0x3a')],'where':{'id':_0x1f810b[_0x2857('0x94')][_0x2857('0x9d')]}})[_0x2857('0x1c')](function(_0x449617){if(_0x449617){_0x1f810b['applications'][_0x2857('0x9e')]({'id':0x0,'priority':0x0,'app':_0x2857('0x9f'),'appdata':_0x449617[_0x2857('0x3a')]+','+(_0x1f810b[_0x2857('0x89')][_0x2857('0xa0')]||0xa),'interval':_0x2857('0x99')});_0x1f810b[_0x2857('0xa1')]=![];}return respondWithRpcPromise(_0x2857('0xa2'),_0x2857('0xa3'),_0x1f810b);});}return respondWithRpcPromise(_0x2857('0xa2'),'startRouting',_0x1f810b);})[_0x2857('0x1c')](function(_0x343237){respondWithRpcPromise(_0x2857('0xa4'),_0x2857('0xa4'),{'event':_0x2857('0x6f'),'message':_0x343237},client9002);return _0x343237;})['then'](respondWithResult(_0x5299d3,null))[_0x2857('0x26')](handleError(_0x5299d3,null));};exports[_0x2857('0xa5')]=function(_0x1a0860,_0x3165fb,_0x24d9ec){return db['OpenchannelAccount'][_0x2857('0x68')]({'where':{'id':_0x1a0860['params']['id']}})['then'](handleEntityNotFound(_0x3165fb,null))[_0x2857('0x1c')](function(_0x1ac7d7){if(_0x1ac7d7){return db[_0x2857('0xa6')][_0x2857('0xa7')](function(_0x2db43f){return db[_0x2857('0xa8')][_0x2857('0x34')]({'where':{'OpenchannelAccountId':_0x1a0860['params']['id']},'transaction':_0x2db43f})[_0x2857('0x1c')](function(_0x572cfe){var _0x150052=_[_0x2857('0x3e')](_0x1a0860[_0x2857('0x63')],function(_0x53aff9){_0x53aff9['OpenchannelAccountId']=_0x1a0860[_0x2857('0x57')]['id'];return _0x53aff9;});return db[_0x2857('0xa8')]['bulkCreate'](_0x150052,{'transaction':_0x2db43f});});})[_0x2857('0x1c')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x1a0860['params']['id']},'order':_0x2857('0x87')});});}})[_0x2857('0x1c')](respondWithResult(_0x3165fb,null))[_0x2857('0x26')](handleError(_0x3165fb,null));};exports[_0x2857('0xa9')]=function(_0x10bf7a,_0x554754,_0x5391bf){var _0x28218c={};var _0x4c7a9b={};var _0x54f460;var _0x823126;return db['OpenchannelAccount'][_0x2857('0x68')]({'where':{'id':_0x10bf7a[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x554754,null))['then'](function(_0x54a83e){if(_0x54a83e){_0x54f460=_0x54a83e;_0x4c7a9b[_0x2857('0x44')]=_[_0x2857('0x45')](db[_0x2857('0xa8')][_0x2857('0x40')]);_0x4c7a9b[_0x2857('0x46')]=_['keys'](_0x10bf7a[_0x2857('0x46')]);_0x4c7a9b[_0x2857('0x47')]=_['intersection'](_0x4c7a9b[_0x2857('0x44')],_0x4c7a9b[_0x2857('0x46')]);_0x28218c[_0x2857('0x48')]=_['intersection'](_0x4c7a9b[_0x2857('0x44')],qs[_0x2857('0x4a')](_0x10bf7a['query'][_0x2857('0x4a')]));_0x28218c[_0x2857('0x48')]=_0x28218c['attributes'][_0x2857('0x59')]?_0x28218c[_0x2857('0x48')]:_0x4c7a9b[_0x2857('0x44')];_0x28218c[_0x2857('0x4d')]=qs['sort'](_0x10bf7a[_0x2857('0x46')][_0x2857('0x4e')]);_0x28218c[_0x2857('0x4f')]=qs[_0x2857('0x47')](_[_0x2857('0x50')](_0x10bf7a['query'],_0x4c7a9b[_0x2857('0x47')]));if(_0x10bf7a[_0x2857('0x46')][_0x2857('0x53')]){_0x28218c[_0x2857('0x4f')]=_[_0x2857('0x51')](_0x28218c[_0x2857('0x4f')],{'$or':_['map'](_0x28218c[_0x2857('0x48')],function(_0x5bfdfc){var _0x51046b={};_0x51046b[_0x5bfdfc]={'$like':'%'+_0x10bf7a[_0x2857('0x46')][_0x2857('0x53')]+'%'};return _0x51046b;})});}_0x28218c=_[_0x2857('0x51')]({},_0x28218c,_0x10bf7a[_0x2857('0x54')]);return _0x54f460[_0x2857('0xa9')](_0x28218c);}})[_0x2857('0x1c')](function(_0xf43ba4){if(_0xf43ba4){_0x823126=_0xf43ba4[_0x2857('0x59')];if(!_0x10bf7a['query']['hasOwnProperty'](_0x2857('0x4c'))){_0x28218c[_0x2857('0x2d')]=qs['limit'](_0x10bf7a['query']['limit']);_0x28218c[_0x2857('0x2a')]=qs[_0x2857('0x2a')](_0x10bf7a[_0x2857('0x46')]['offset']);}return _0x54f460[_0x2857('0xa9')](_0x28218c);}})[_0x2857('0x1c')](function(_0x3bd6fd){if(_0x3bd6fd){return _0x3bd6fd?{'count':_0x823126,'rows':_0x3bd6fd}:null;}})[_0x2857('0x1c')](respondWithResult(_0x554754,null))[_0x2857('0x26')](handleError(_0x554754,null));};exports[_0x2857('0xaa')]=function(_0x2f5108,_0x403443,_0x2950dc){var _0x2f167a={'raw':![],'where':{}};var _0x4e57d4={};var _0x34d2c4={'count':0x0,'rows':[]};return db[_0x2857('0x3f')][_0x2857('0x68')]({'where':{'id':_0x2f5108['params']['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x403443,null))['then'](function(_0x276a5e){if(_0x276a5e){_0x4e57d4['model']=_[_0x2857('0x45')](db['OpenchannelInteraction'][_0x2857('0x40')]);_0x4e57d4['query']=_[_0x2857('0x45')](_0x2f5108[_0x2857('0x46')]);_0x4e57d4[_0x2857('0x47')]=_[_0x2857('0x49')](_0x4e57d4[_0x2857('0x44')],_0x4e57d4[_0x2857('0x46')]);_0x2f167a[_0x2857('0x48')]=_[_0x2857('0x49')](_0x4e57d4['model'],qs[_0x2857('0x4a')](_0x2f5108[_0x2857('0x46')][_0x2857('0x4a')]));_0x2f167a[_0x2857('0x48')]=_0x2f167a[_0x2857('0x48')]['length']?_0x2f167a[_0x2857('0x48')]:_0x4e57d4[_0x2857('0x44')];if(!_0x2f5108[_0x2857('0x46')][_0x2857('0x4b')]('nolimit')){_0x2f167a[_0x2857('0x2d')]=qs[_0x2857('0x2d')](_0x2f5108['query']['limit']);_0x2f167a[_0x2857('0x2a')]=qs[_0x2857('0x2a')](_0x2f5108[_0x2857('0x46')][_0x2857('0x2a')]);}_0x2f167a['order']=qs[_0x2857('0x4e')](_0x2f5108[_0x2857('0x46')][_0x2857('0x4e')]);_0x2f167a[_0x2857('0x4f')]=qs[_0x2857('0x47')](_[_0x2857('0x50')](_0x2f5108[_0x2857('0x46')],_0x4e57d4[_0x2857('0x47')]));_0x2f167a[_0x2857('0x4f')][_0x2857('0x65')]=_0x276a5e['id'];if(_0x2f5108[_0x2857('0x46')][_0x2857('0x53')]){_0x2f167a['where']=_[_0x2857('0x51')](_0x2f167a[_0x2857('0x4f')],{'$or':_[_0x2857('0x3e')](_0x2f167a[_0x2857('0x48')],function(_0x565c22){var _0xd9243c={};_0xd9243c[_0x565c22]={'$like':'%'+_0x2f5108['query'][_0x2857('0x53')]+'%'};return _0xd9243c;})});}_0x2f167a=_[_0x2857('0x51')]({},_0x2f167a,_0x2f5108[_0x2857('0x54')]);return db[_0x2857('0x8f')][_0x2857('0x2c')]({'where':_0x2f167a[_0x2857('0x4f')]})[_0x2857('0x1c')](function(_0x42f5b3){_0x34d2c4['count']=_0x42f5b3;if(_0x2f5108[_0x2857('0x46')][_0x2857('0x5a')]){_0x2f167a[_0x2857('0x55')]=[{'model':db[_0x2857('0x71')],'as':_0x2857('0xab'),'required':![]},{'model':db[_0x2857('0x9c')],'as':'Owner','attributes':[_0x2857('0x3a'),_0x2857('0xac'),_0x2857('0xad')],'required':![]},{'model':db[_0x2857('0xae')],'as':_0x2857('0xaf'),'attributes':['id',_0x2857('0x3a'),_0x2857('0xb0')],'where':_0x2f5108[_0x2857('0x46')]['tag']?{'id':_0x2f5108[_0x2857('0x46')][_0x2857('0xb1')]}:undefined,'required':_0x2f5108[_0x2857('0x46')]['tag']?!![]:![]}];}return db[_0x2857('0x8f')]['findAll'](_0x2f167a);})[_0x2857('0x1c')](function(_0x55df4d){_0x34d2c4['rows']=_0x55df4d;return _0x34d2c4;});}})[_0x2857('0x1c')](respondWithFilteredResult(_0x403443,_0x2f167a))[_0x2857('0x26')](handleError(_0x403443,null));};exports[_0x2857('0xb2')]=function(_0x4a6ce4,_0x90ea0,_0x5d8b9d){return db[_0x2857('0x3f')][_0x2857('0x60')]({'where':{'id':_0x4a6ce4['params']['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x90ea0,null))[_0x2857('0x1c')](function(_0x19960f){if(_0x19960f){return _0x19960f[_0x2857('0xb2')](_0x4a6ce4[_0x2857('0x63')]['ids'],_[_0x2857('0xb3')](_0x4a6ce4[_0x2857('0x63')],['ids','id'])||{})['spread'](function(_0xdd63c9){for(var _0x385f7a=0x0;_0x385f7a<_0x4a6ce4[_0x2857('0x63')]['ids'][_0x2857('0x59')];_0x385f7a+=0x1){socket[_0x2857('0xb4')](_0x2857('0xb5'),{'UserId':Number(_0x4a6ce4['body'][_0x2857('0x6a')][_0x385f7a]),'OpenchannelAccountId':Number(_0x4a6ce4[_0x2857('0x57')]['id'])});}return _0xdd63c9;});}})[_0x2857('0x1c')](respondWithResult(_0x90ea0,null))['catch'](handleError(_0x90ea0,null));};exports[_0x2857('0xb6')]=function(_0x225766,_0x3ced61,_0x5b648f){return db[_0x2857('0x3f')][_0x2857('0x60')]({'where':{'id':_0x225766[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x3ced61,null))[_0x2857('0x1c')](function(_0x39dce3){if(_0x39dce3){return _0x39dce3['removeAgents'](_0x225766[_0x2857('0x46')][_0x2857('0x6a')])['then'](function(){if(_[_0x2857('0xb7')](_0x225766[_0x2857('0x46')][_0x2857('0x6a')])){for(var _0x192d0b=0x0;_0x192d0b<_0x225766[_0x2857('0x46')][_0x2857('0x6a')][_0x2857('0x59')];_0x192d0b+=0x1){socket[_0x2857('0xb4')](_0x2857('0xb8'),{'UserId':Number(_0x225766[_0x2857('0x46')][_0x2857('0x6a')][_0x192d0b]),'OpenchannelAccountId':Number(_0x225766[_0x2857('0x57')]['id'])});}}else{socket[_0x2857('0xb4')](_0x2857('0xb8'),{'UserId':Number(_0x225766[_0x2857('0x46')]['ids']),'OpenchannelAccountId':Number(_0x225766[_0x2857('0x57')]['id'])});}});}})[_0x2857('0x1c')](respondWithStatusCode(_0x3ced61,null))['catch'](handleError(_0x3ced61,null));};exports['getAgents']=function(_0x46fde3,_0xb9dd08,_0x4bd581){var _0x5d7ba6={};var _0x114f27={};var _0x2549c5;var _0x4ea189;return db['OpenchannelAccount'][_0x2857('0x68')]({'where':{'id':_0x46fde3[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0xb9dd08,null))[_0x2857('0x1c')](function(_0x48c556){if(_0x48c556){_0x2549c5=_0x48c556;_0x114f27[_0x2857('0x44')]=_[_0x2857('0x45')](db['User']['rawAttributes']);_0x114f27['query']=_[_0x2857('0x45')](_0x46fde3[_0x2857('0x46')]);_0x114f27['filters']=_[_0x2857('0x49')](_0x114f27[_0x2857('0x44')],_0x114f27[_0x2857('0x46')]);_0x5d7ba6[_0x2857('0x48')]=_[_0x2857('0x49')](_0x114f27[_0x2857('0x44')],qs['fields'](_0x46fde3['query'][_0x2857('0x4a')]));_0x5d7ba6[_0x2857('0x48')]=_0x5d7ba6['attributes'][_0x2857('0x59')]?_0x5d7ba6[_0x2857('0x48')]:_0x114f27[_0x2857('0x44')];_0x5d7ba6[_0x2857('0x4d')]=qs[_0x2857('0x4e')](_0x46fde3['query'][_0x2857('0x4e')]);_0x5d7ba6[_0x2857('0x4f')]=qs[_0x2857('0x47')](_[_0x2857('0x50')](_0x46fde3['query'],_0x114f27['filters']));if(_0x46fde3[_0x2857('0x46')][_0x2857('0x53')]){_0x5d7ba6[_0x2857('0x4f')]=_[_0x2857('0x51')](_0x5d7ba6[_0x2857('0x4f')],{'$or':_['map'](_0x5d7ba6['attributes'],function(_0xc4dc85){var _0x4a3174={};_0x4a3174[_0xc4dc85]={'$like':'%'+_0x46fde3[_0x2857('0x46')]['filter']+'%'};return _0x4a3174;})});}_0x5d7ba6=_[_0x2857('0x51')]({},_0x5d7ba6,_0x46fde3[_0x2857('0x54')]);return _0x2549c5[_0x2857('0xb9')](_0x5d7ba6);}})[_0x2857('0x1c')](function(_0x2a89dd){if(_0x2a89dd){_0x4ea189=_0x2a89dd[_0x2857('0x59')];if(!_0x46fde3[_0x2857('0x46')][_0x2857('0x4b')](_0x2857('0x4c'))){_0x5d7ba6[_0x2857('0x2d')]=qs['limit'](_0x46fde3[_0x2857('0x46')][_0x2857('0x2d')]);_0x5d7ba6['offset']=qs[_0x2857('0x2a')](_0x46fde3['query'][_0x2857('0x2a')]);}return _0x2549c5[_0x2857('0xb9')](_0x5d7ba6);}})[_0x2857('0x1c')](function(_0x1cd731){if(_0x1cd731){return _0x1cd731?{'count':_0x4ea189,'rows':_0x1cd731}:null;}})[_0x2857('0x1c')](respondWithResult(_0xb9dd08,null))[_0x2857('0x26')](handleError(_0xb9dd08,null));};exports[_0x2857('0x3b')]=function(_0x3f8a21,_0x5da302,_0x8c5ca9){var _0x4fb07d,_0x286757,_0x5192db;if(_['isNil'](_0x3f8a21['body']['body'])||_0x3f8a21[_0x2857('0x63')][_0x2857('0x63')]===''){throw new db[(_0x2857('0x72'))][(_0x2857('0x7c'))](_0x2857('0x7d'));}if(_[_0x2857('0x7b')](_0x3f8a21[_0x2857('0x63')]['to'])){}_0x4fb07d=_0x3f8a21[_0x2857('0x63')]['to'];return db[_0x2857('0x3f')][_0x2857('0x68')]({'where':{'id':_0x3f8a21['params']['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x5da302,null))[_0x2857('0x1c')](function(_0x4e45e7){if(_0x4e45e7){return db[_0x2857('0x3f')][_0x2857('0x60')]({'where':{'id':_0x4e45e7['id']},'include':[{'model':db[_0x2857('0x81')],'as':_0x2857('0x82'),'include':[{'model':db[_0x2857('0x71')],'as':_0x2857('0x8a'),'where':{[_0x4e45e7[_0x2857('0x7e')]]:_0x4fb07d},'limit':0x1,'order':[[_0x2857('0x76'),_0x2857('0xba')]]}]}]})[_0x2857('0x1c')](handleEntityNotFound(_0x5da302,null))[_0x2857('0x1c')](function(_0x3201e0){if(_0x3201e0&&_0x3201e0[_0x2857('0x82')]){_0x286757=_0x3201e0[_0x2857('0x35')]({'plain':!![]});if(_0x286757[_0x2857('0x82')]&&_0x286757[_0x2857('0x82')]['Contacts'][_0x2857('0x59')]){return _0x286757[_0x2857('0x82')][_0x2857('0x8a')][0x0];}return db['CmContact'][_0x2857('0x5b')](_[_0x2857('0x17')](_0x3f8a21[_0x2857('0x63')],{'firstName':_0x4fb07d,[_0x3201e0['mapKey']]:_0x4fb07d,'phone':_0x4fb07d,'ListId':_0x286757[_0x2857('0x78')]}));}})['then'](handleEntityNotFound(_0x5da302,null))['then'](function(_0x290c9c){if(_0x290c9c){_0x5192db=_0x290c9c;return db[_0x2857('0x8f')]['find']({'where':{'ContactId':_0x5192db['id'],'closed':![],'OpenchannelAccountId':_0x286757['id']}})[_0x2857('0x1c')](function(_0x19a768){if(_0x19a768){return[_0x19a768,![]];}return db[_0x2857('0x8f')]['create']({'UserId':_0x3f8a21[_0x2857('0x5c')]['id'],'ContactId':_0x5192db['id'],'OpenchannelAccountId':_0x286757['id'],'lastMsgDirection':_0x2857('0xbb'),'Messages':[_['merge'](_0x3f8a21[_0x2857('0x63')],{'read':![],'body':_0x3f8a21['body'][_0x2857('0x63')],'OpenchannelAccountId':_0x286757['id'],'UserId':_0x3f8a21[_0x2857('0x5c')]['id'],'ContactId':_0x5192db['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x2857('0xbc')}]})['then'](function(_0x559b01){return[_0x559b01,!![]];});});}})[_0x2857('0x91')](function(_0x453ba7,_0x4db466){if(_0x4db466){return _0x453ba7;}return db[_0x2857('0x9a')]['create'](_['merge'](_0x3f8a21[_0x2857('0x63')],{'read':![],'body':_0x3f8a21['body']['body'],'OpenchannelAccountId':_0x286757['id'],'OpenchannelInteractionId':_0x453ba7['id'],'UserId':_0x3f8a21[_0x2857('0x5c')]['id'],'ContactId':_0x5192db['id']}))[_0x2857('0x1c')](function(_0x58869a){_0x453ba7['dataValues'][_0x2857('0xbc')]=[];_0x453ba7[_0x2857('0xbd')][_0x2857('0xbc')][_0x2857('0xbe')](_0x58869a[_0x2857('0xbd')]);return _0x453ba7;});});}})[_0x2857('0x1c')](respondWithResult(_0x5da302,null))[_0x2857('0x26')](handleError(_0x5da302,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index fefe745..ded79f7 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 _0x1339=['update','remove','emit','hasOwnProperty','exports','OpenchannelAccount','setMaxListeners','save'];(function(_0x31d1c0,_0x144a26){var _0x45e84d=function(_0x5e6860){while(--_0x5e6860){_0x31d1c0['push'](_0x31d1c0['shift']());}};_0x45e84d(++_0x144a26);}(_0x1339,0x1ed));var _0x9133=function(_0x5322ec,_0x25b7f4){_0x5322ec=_0x5322ec-0x0;var _0x3164ca=_0x1339[_0x5322ec];return _0x3164ca;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x9133('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x9133('0x1')](0x0);var events={'afterCreate':_0x9133('0x2'),'afterUpdate':_0x9133('0x3'),'afterDestroy':_0x9133('0x4')};function emitEvent(_0x192d48){return function(_0x176e80,_0x110c51,_0x558345){OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48+':'+_0x176e80['id'],_0x176e80);OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48,_0x176e80);_0x558345(null);};}for(var e in events){if(events[_0x9133('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x9133('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xec56=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x3ce301,_0x858468){var _0x323499=function(_0x789e5b){while(--_0x789e5b){_0x3ce301['push'](_0x3ce301['shift']());}};_0x323499(++_0x858468);}(_0xec56,0x1bd));var _0x6ec5=function(_0x31b12f,_0x575288){_0x31b12f=_0x31b12f-0x0;var _0x39f7b0=_0xec56[_0x31b12f];return _0x39f7b0;};'use strict';var EventEmitter=require(_0x6ec5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6ec5('0x1')](0x0);var events={'afterCreate':_0x6ec5('0x2'),'afterUpdate':_0x6ec5('0x3'),'afterDestroy':_0x6ec5('0x4')};function emitEvent(_0x43c2cd){return function(_0x399441,_0x469679,_0x173aeb){OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd+':'+_0x399441['id'],_0x399441);OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd,_0x399441);_0x173aeb(null);};}for(var e in events){if(events[_0x6ec5('0x6')](e)){var event=events[e];OpenchannelAccount[_0x6ec5('0x7')](e,emitEvent(event));}}module[_0x6ec5('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index a9a1e3c..33d6d87 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(_0x1ee5d7,_0x2f88b0){var _0x3827ef=function(_0x3f5272){while(--_0x3f5272){_0x1ee5d7['push'](_0x1ee5d7['shift']());}};_0x3827ef(++_0x2f88b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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(_0x365197,_0x52c74c){var _0x2eff59=function(_0x263e77){while(--_0x263e77){_0x365197['push'](_0x365197['shift']());}};_0x2eff59(++_0x52c74c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 f826937..8c95dc1 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 _0x4483=['defaults','localhost','./openchannelAccount.socket','register','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x51e2eb,_0x4a9973){var _0x517eaa=function(_0x36f2e3){while(--_0x36f2e3){_0x51e2eb['push'](_0x51e2eb['shift']());}};_0x517eaa(++_0x4a9973);}(_0x4483,0x1a3));var _0x3448=function(_0x510ec1,_0x3ad15f){_0x510ec1=_0x510ec1-0x0;var _0x1aa319=_0x4483[_0x510ec1];return _0x1aa319;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});config[_0x3448('0xc')]=_[_0x3448('0xd')](config[_0x3448('0xc')],{'host':_0x3448('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3448('0xf'))[_0x3448('0x10')](socket);function respondWithRpcPromise(_0xc36409,_0x6f82ca,_0x3f4364){return new BPromise(function(_0x1e645a,_0x2bdf02){return client[_0x3448('0x11')](_0xc36409,_0x3f4364)[_0x3448('0x12')](function(_0x35bb7b){logger[_0x3448('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x6f82ca,'request\x20sent');logger[_0x3448('0x14')](_0x3448('0x15'),_0x6f82ca,'request\x20sent',JSON[_0x3448('0x16')](_0x35bb7b));if(_0x35bb7b[_0x3448('0x17')]){if(_0x35bb7b[_0x3448('0x17')]['code']===0x1f4){logger[_0x3448('0x17')](_0x3448('0x18'),_0x6f82ca,_0x35bb7b['error'][_0x3448('0x19')]);return _0x2bdf02(_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);}logger['error'](_0x3448('0x18'),_0x6f82ca,_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);return _0x1e645a(_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);}else{logger[_0x3448('0x13')](_0x3448('0x18'),_0x6f82ca,_0x3448('0x1a'));_0x1e645a(_0x35bb7b['result'][_0x3448('0x19')]);}})['catch'](function(_0x48f94a){logger['error'](_0x3448('0x18'),_0x6f82ca,_0x48f94a);_0x2bdf02(_0x48f94a);});});} \ No newline at end of file +var _0xa5fa=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x10a08d,_0x1bab5d){_0x10a08d=_0x10a08d-0x0;var _0x27abcc=_0xa5fa[_0x10a08d];return _0x27abcc;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});config[_0xaa5f('0xb')]=_[_0xaa5f('0xc')](config[_0xaa5f('0xb')],{'host':_0xaa5f('0xd'),'port':0x18eb});var socket=require(_0xaa5f('0xe'))(new Redis(config[_0xaa5f('0xb')]));require('./openchannelAccount.socket')[_0xaa5f('0xf')](socket);function respondWithRpcPromise(_0x227ebb,_0x4d3d16,_0x538865){return new BPromise(function(_0x3fa93f,_0x4bb69d){return client['request'](_0x227ebb,_0x538865)[_0xaa5f('0x10')](function(_0x4d24d2){logger[_0xaa5f('0x11')](_0xaa5f('0x12'),_0x4d3d16,_0xaa5f('0x13'));logger[_0xaa5f('0x14')](_0xaa5f('0x15'),_0x4d3d16,'request\x20sent',JSON[_0xaa5f('0x16')](_0x4d24d2));if(_0x4d24d2['error']){if(_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x18')]===0x1f4){logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x4d24d2[_0xaa5f('0x17')]['message']);return _0x4bb69d(_0x4d24d2['error'][_0xaa5f('0x19')]);}logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x19')]);return _0x3fa93f(_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x19')]);}else{logger[_0xaa5f('0x11')](_0xaa5f('0x12'),_0x4d3d16,_0xaa5f('0x13'));_0x3fa93f(_0x4d24d2[_0xaa5f('0x1a')][_0xaa5f('0x19')]);}})['catch'](function(_0x1c072){logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x1c072);_0x4bb69d(_0x1c072);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 223a438..00a7b8a 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 _0x477a=['length','openchannelAccount:','./openchannelAccount.events','remove','update','removeListener'];(function(_0x1cb40e,_0x58e8c6){var _0x2d2e57=function(_0x2a5e40){while(--_0x2a5e40){_0x1cb40e['push'](_0x1cb40e['shift']());}};_0x2d2e57(++_0x58e8c6);}(_0x477a,0x1e2));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require(_0xa477('0x0'));var events=['save',_0xa477('0x1'),_0xa477('0x2')];function createListener(_0x4d9a0f,_0x3fbed2){return function(_0x3fae2d){_0x3fbed2['emit'](_0x4d9a0f,_0x3fae2d);};}function removeListener(_0x5b9d1c,_0x111534){return function(){OpenchannelAccountEvents[_0xa477('0x3')](_0x5b9d1c,_0x111534);};}exports['register']=function(_0x1e75a5){for(var _0x819ac9=0x0,_0x203871=events[_0xa477('0x4')];_0x819ac9<_0x203871;_0x819ac9++){var _0x422a5d=events[_0x819ac9];var _0x788380=createListener(_0xa477('0x5')+_0x422a5d,_0x1e75a5);OpenchannelAccountEvents['on'](_0x422a5d,_0x788380);}}; \ No newline at end of file +var _0x81a5=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','length'];(function(_0x14e220,_0x57056){var _0x746d60=function(_0x376042){while(--_0x376042){_0x14e220['push'](_0x14e220['shift']());}};_0x746d60(++_0x57056);}(_0x81a5,0x1c8));var _0x581a=function(_0x468d2d,_0x588715){_0x468d2d=_0x468d2d-0x0;var _0x6b41fe=_0x81a5[_0x468d2d];return _0x6b41fe;};'use strict';var OpenchannelAccountEvents=require(_0x581a('0x0'));var events=[_0x581a('0x1'),_0x581a('0x2'),_0x581a('0x3')];function createListener(_0x24ad81,_0x362572){return function(_0x4d0685){_0x362572[_0x581a('0x4')](_0x24ad81,_0x4d0685);};}function removeListener(_0x5125ac,_0x4f5f9a){return function(){OpenchannelAccountEvents['removeListener'](_0x5125ac,_0x4f5f9a);};}exports['register']=function(_0x21fea7){for(var _0x56065e=0x0,_0xdcb7c0=events[_0x581a('0x5')];_0x56065e<_0xdcb7c0;_0x56065e++){var _0x148bc7=events[_0x56065e];var _0x18dec1=createListener(_0x581a('0x6')+_0x148bc7,_0x21fea7);OpenchannelAccountEvents['on'](_0x148bc7,_0x18dec1);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index fd87284..88f6bbf 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 _0xc098=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','create','/:id','destroy','exports','multer'];(function(_0x5895dc,_0x4c3b31){var _0x458e58=function(_0x193a6c){while(--_0x193a6c){_0x5895dc['push'](_0x5895dc['shift']());}};_0x458e58(++_0x4c3b31);}(_0xc098,0xfb));var _0x8c09=function(_0x2b65f4,_0x4a5622){_0x2b65f4=_0x2b65f4-0x0;var _0x56383b=_0xc098[_0x2b65f4];return _0x56383b;};'use strict';var multer=require(_0x8c09('0x0'));var util=require(_0x8c09('0x1'));var path=require(_0x8c09('0x2'));var timeout=require(_0x8c09('0x3'));var express=require(_0x8c09('0x4'));var router=express[_0x8c09('0x5')]();var fs_extra=require(_0x8c09('0x6'));var auth=require(_0x8c09('0x7'));var interaction=require(_0x8c09('0x8'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x8c09('0x9')]('/',auth[_0x8c09('0xa')](),controller[_0x8c09('0xb')]);router[_0x8c09('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8c09('0xc')]);router[_0x8c09('0xd')]('/',auth[_0x8c09('0xa')](),controller[_0x8c09('0xe')]);router['put']('/:id',auth[_0x8c09('0xa')](),controller['update']);router['delete'](_0x8c09('0xf'),auth[_0x8c09('0xa')](),controller[_0x8c09('0x10')]);module[_0x8c09('0x11')]=router; \ No newline at end of file +var _0x644f=['fs-extra','../../components/auth/service','get','/:id','isAuthenticated','show','put','update','exports','multer','util','path','Router'];(function(_0x4a8a35,_0x41d776){var _0x4a3af3=function(_0x2ac1a2){while(--_0x2ac1a2){_0x4a8a35['push'](_0x4a8a35['shift']());}};_0x4a3af3(++_0x41d776);}(_0x644f,0x182));var _0xf644=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0x644f[_0x5c5c52];return _0x4229ff;};'use strict';var multer=require(_0xf644('0x0'));var util=require(_0xf644('0x1'));var path=require(_0xf644('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf644('0x3')]();var fs_extra=require(_0xf644('0x4'));var auth=require(_0xf644('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0xf644('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf644('0x6')](_0xf644('0x7'),auth[_0xf644('0x8')](),controller[_0xf644('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf644('0xa')](_0xf644('0x7'),auth['isAuthenticated'](),controller[_0xf644('0xb')]);router['delete'](_0xf644('0x7'),auth[_0xf644('0x8')](),controller['destroy']);module[_0xf644('0xc')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index f8d2cc4..0f9373c 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 _0xb8ef=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x165c8a,_0x5bbdee){var _0x44d715=function(_0x3f7335){while(--_0x3f7335){_0x165c8a['push'](_0x165c8a['shift']());}};_0x44d715(++_0x5bbdee);}(_0xb8ef,0x1dd));var _0xfb8e=function(_0xf9ece9,_0x5e367b){_0xf9ece9=_0xf9ece9-0x0;var _0x5a3665=_0xb8ef[_0xf9ece9];return _0x5a3665;};'use strict';var Sequelize=require(_0xfb8e('0x0'));module[_0xfb8e('0x1')]={'priority':{'type':Sequelize[_0xfb8e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfb8e('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfb8e('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfb8e('0x3')],'defaultValue':_0xfb8e('0x5')}}; \ No newline at end of file +var _0xfb72=['INTEGER','STRING','exports'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0xfb72,0x86));var _0x2fb7=function(_0x4edac5,_0x41d853){_0x4edac5=_0x4edac5-0x0;var _0x572b3b=_0xfb72[_0x4edac5];return _0x572b3b;};'use strict';var Sequelize=require('sequelize');module[_0x2fb7('0x0')]={'priority':{'type':Sequelize[_0x2fb7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2fb7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2fb7('0x2')]},'interval':{'type':Sequelize[_0x2fb7('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 35be6ef..90e16b9 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 _0xf622=['rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x1d2cb4,_0x313244){var _0x1a6b7b=function(_0x1c84c2){while(--_0x1c84c2){_0x1d2cb4['push'](_0x1d2cb4['shift']());}};_0x1a6b7b(++_0x313244);}(_0xf622,0x144));var _0x2f62=function(_0x3a702e,_0x489d6a){_0x3a702e=_0x3a702e-0x0;var _0x1779f7=_0xf622[_0x3a702e];return _0x1779f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f62('0x0'));var zipdir=require(_0x2f62('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f62('0x2'));var moment=require(_0x2f62('0x3'));var BPromise=require(_0x2f62('0x4'));var Mustache=require(_0x2f62('0x5'));var util=require(_0x2f62('0x6'));var path=require(_0x2f62('0x7'));var sox=require(_0x2f62('0x8'));var csv=require(_0x2f62('0x9'));var ejs=require(_0x2f62('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f62('0xb'));var squel=require(_0x2f62('0xc'));var crypto=require(_0x2f62('0xd'));var jsforce=require(_0x2f62('0xe'));var deskjs=require(_0x2f62('0xf'));var toCsv=require(_0x2f62('0x9'));var querystring=require('querystring');var Papa=require(_0x2f62('0x10'));var Redis=require(_0x2f62('0x11'));var authService=require(_0x2f62('0x12'));var qs=require(_0x2f62('0x13'));var as=require(_0x2f62('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f62('0x15'))(_0x2f62('0x16'));var utils=require(_0x2f62('0x17'));var config=require(_0x2f62('0x18'));var licenseUtil=require(_0x2f62('0x19'));var db=require(_0x2f62('0x1a'))['db'];function respondWithStatusCode(_0x16def2,_0x257ed2){_0x257ed2=_0x257ed2||0xcc;return function(_0x5dd178){if(_0x5dd178){return _0x16def2['sendStatus'](_0x257ed2);}return _0x16def2[_0x2f62('0x1b')](_0x257ed2)['end']();};}function respondWithResult(_0x32625a,_0x40869c){_0x40869c=_0x40869c||0xc8;return function(_0x151577){if(_0x151577){return _0x32625a[_0x2f62('0x1b')](_0x40869c)[_0x2f62('0x1c')](_0x151577);}};}function respondWithFilteredResult(_0x2c180b,_0x2ab4f8){return function(_0x33263a){if(_0x33263a){var _0x32c6d2=typeof _0x2ab4f8[_0x2f62('0x1d')]==='undefined'&&typeof _0x2ab4f8[_0x2f62('0x1e')]===_0x2f62('0x1f');var _0x41a4e8=_0x33263a[_0x2f62('0x20')];var _0x3b15d0=_0x32c6d2?0x0:_0x2ab4f8[_0x2f62('0x1d')];var _0x3a0227=_0x32c6d2?_0x33263a[_0x2f62('0x20')]:_0x2ab4f8[_0x2f62('0x1d')]+_0x2ab4f8[_0x2f62('0x1e')];var _0x2518cd;if(_0x3a0227>=_0x41a4e8){_0x3a0227=_0x41a4e8;_0x2518cd=0xc8;}else{_0x2518cd=0xce;}_0x2c180b['status'](_0x2518cd);return _0x2c180b[_0x2f62('0x21')]('Content-Range',_0x3b15d0+'-'+_0x3a0227+'/'+_0x41a4e8)[_0x2f62('0x1c')](_0x33263a);}return null;};}function patchUpdates(_0x473163){return function(_0x1bd019){try{jsonpatch[_0x2f62('0x22')](_0x1bd019,_0x473163,!![]);}catch(_0x280987){return BPromise[_0x2f62('0x23')](_0x280987);}return _0x1bd019[_0x2f62('0x24')]();};}function saveUpdates(_0x25c264,_0x3a763f){return function(_0x327c9e){if(_0x327c9e){return _0x327c9e[_0x2f62('0x25')](_0x25c264)[_0x2f62('0x26')](function(_0x59016b){return _0x59016b;});}return null;};}function removeEntity(_0x5383a6,_0x3ad061){return function(_0x426b24){if(_0x426b24){return _0x426b24[_0x2f62('0x27')]()[_0x2f62('0x26')](function(){_0x5383a6[_0x2f62('0x1b')](0xcc)[_0x2f62('0x28')]();});}};}function handleEntityNotFound(_0x11783f,_0x38ebd1){return function(_0x505352){if(!_0x505352){_0x11783f[_0x2f62('0x29')](0x194);}return _0x505352;};}function handleError(_0x1190d4,_0x515ab4){_0x515ab4=_0x515ab4||0x1f4;return function(_0x24244c){logger[_0x2f62('0x2a')](_0x24244c[_0x2f62('0x2b')]);if(_0x24244c[_0x2f62('0x2c')]){delete _0x24244c[_0x2f62('0x2c')];}_0x1190d4[_0x2f62('0x1b')](_0x515ab4)['send'](_0x24244c);};}exports[_0x2f62('0x2d')]=function(_0x23c535,_0x375e9e){var _0x4f8008={},_0x5df546={},_0x4d8252={'count':0x0,'rows':[]};var _0x246686=_[_0x2f62('0x2e')](db[_0x2f62('0x2f')][_0x2f62('0x30')],function(_0x254f01){return{'name':_0x254f01[_0x2f62('0x31')],'type':_0x254f01[_0x2f62('0x32')][_0x2f62('0x33')]};});_0x5df546[_0x2f62('0x34')]=_[_0x2f62('0x2e')](_0x246686,'name');_0x5df546[_0x2f62('0x35')]=_['keys'](_0x23c535['query']);_0x5df546[_0x2f62('0x36')]=_[_0x2f62('0x37')](_0x5df546[_0x2f62('0x34')],_0x5df546[_0x2f62('0x35')]);_0x4f8008[_0x2f62('0x38')]=_['intersection'](_0x5df546[_0x2f62('0x34')],qs[_0x2f62('0x39')](_0x23c535[_0x2f62('0x35')][_0x2f62('0x39')]));_0x4f8008[_0x2f62('0x38')]=_0x4f8008[_0x2f62('0x38')][_0x2f62('0x3a')]?_0x4f8008[_0x2f62('0x38')]:_0x5df546[_0x2f62('0x34')];if(!_0x23c535[_0x2f62('0x35')][_0x2f62('0x3b')](_0x2f62('0x3c'))){_0x4f8008['limit']=qs[_0x2f62('0x1e')](_0x23c535['query'][_0x2f62('0x1e')]);_0x4f8008[_0x2f62('0x1d')]=qs[_0x2f62('0x1d')](_0x23c535[_0x2f62('0x35')][_0x2f62('0x1d')]);}_0x4f8008['order']=qs[_0x2f62('0x3d')](_0x23c535['query']['sort']);_0x4f8008[_0x2f62('0x3e')]=qs[_0x2f62('0x36')](_[_0x2f62('0x3f')](_0x23c535[_0x2f62('0x35')],_0x5df546[_0x2f62('0x36')]),_0x246686);if(_0x23c535[_0x2f62('0x35')][_0x2f62('0x40')]){_0x4f8008['where']=_[_0x2f62('0x41')](_0x4f8008[_0x2f62('0x3e')],{'$or':_[_0x2f62('0x2e')](_0x246686,function(_0x5eb54e){if(_0x5eb54e[_0x2f62('0x32')]!==_0x2f62('0x42')){var _0x5b41d8={};_0x5b41d8[_0x5eb54e[_0x2f62('0x2c')]]={'$like':'%'+_0x23c535[_0x2f62('0x35')][_0x2f62('0x40')]+'%'};return _0x5b41d8;}})});}_0x4f8008=_[_0x2f62('0x41')]({},_0x4f8008,_0x23c535[_0x2f62('0x43')]);var _0x19def3={'where':_0x4f8008[_0x2f62('0x3e')]};return db[_0x2f62('0x2f')][_0x2f62('0x20')](_0x19def3)['then'](function(_0x399b27){_0x4d8252['count']=_0x399b27;if(_0x23c535[_0x2f62('0x35')][_0x2f62('0x44')]){_0x4f8008[_0x2f62('0x45')]=[{'all':!![]}];}return db[_0x2f62('0x2f')][_0x2f62('0x46')](_0x4f8008);})['then'](function(_0x5bb71e){_0x4d8252[_0x2f62('0x47')]=_0x5bb71e;return _0x4d8252;})[_0x2f62('0x26')](respondWithFilteredResult(_0x375e9e,_0x4f8008))[_0x2f62('0x48')](handleError(_0x375e9e,null));};exports[_0x2f62('0x49')]=function(_0x16904c,_0x1a0ca9){var _0x4818c8={'raw':!![],'where':{'id':_0x16904c[_0x2f62('0x4a')]['id']}},_0x2f4942={};_0x2f4942[_0x2f62('0x34')]=_[_0x2f62('0x4b')](db[_0x2f62('0x2f')][_0x2f62('0x30')]);_0x2f4942[_0x2f62('0x35')]=_[_0x2f62('0x4b')](_0x16904c[_0x2f62('0x35')]);_0x2f4942[_0x2f62('0x36')]=_[_0x2f62('0x37')](_0x2f4942[_0x2f62('0x34')],_0x2f4942[_0x2f62('0x35')]);_0x4818c8[_0x2f62('0x38')]=_[_0x2f62('0x37')](_0x2f4942[_0x2f62('0x34')],qs[_0x2f62('0x39')](_0x16904c[_0x2f62('0x35')]['fields']));_0x4818c8[_0x2f62('0x38')]=_0x4818c8[_0x2f62('0x38')][_0x2f62('0x3a')]?_0x4818c8[_0x2f62('0x38')]:_0x2f4942[_0x2f62('0x34')];if(_0x16904c[_0x2f62('0x35')][_0x2f62('0x44')]){_0x4818c8[_0x2f62('0x45')]=[{'all':!![]}];}_0x4818c8=_[_0x2f62('0x41')]({},_0x4818c8,_0x16904c[_0x2f62('0x43')]);return db[_0x2f62('0x2f')][_0x2f62('0x4c')](_0x4818c8)['then'](handleEntityNotFound(_0x1a0ca9,null))[_0x2f62('0x26')](respondWithResult(_0x1a0ca9,null))['catch'](handleError(_0x1a0ca9,null));};exports['create']=function(_0x3a057e,_0x2d2b8b){return db[_0x2f62('0x2f')][_0x2f62('0x4d')](_0x3a057e[_0x2f62('0x4e')],{})['then'](respondWithResult(_0x2d2b8b,0xc9))[_0x2f62('0x48')](handleError(_0x2d2b8b,null));};exports[_0x2f62('0x25')]=function(_0x50ec46,_0x2b41c5){if(_0x50ec46[_0x2f62('0x4e')]['id']){delete _0x50ec46[_0x2f62('0x4e')]['id'];}return db[_0x2f62('0x2f')]['find']({'where':{'id':_0x50ec46[_0x2f62('0x4a')]['id']}})[_0x2f62('0x26')](handleEntityNotFound(_0x2b41c5,null))['then'](saveUpdates(_0x50ec46[_0x2f62('0x4e')],null))[_0x2f62('0x26')](respondWithResult(_0x2b41c5,null))[_0x2f62('0x48')](handleError(_0x2b41c5,null));};exports[_0x2f62('0x27')]=function(_0xc9d48b,_0x21e078){return db[_0x2f62('0x2f')]['find']({'where':{'id':_0xc9d48b['params']['id']}})[_0x2f62('0x26')](handleEntityNotFound(_0x21e078,null))['then'](removeEntity(_0x21e078,null))[_0x2f62('0x48')](handleError(_0x21e078,null));}; \ No newline at end of file +var _0xbd6c=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','count','status','Content-Range','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','key','map','query','intersection','model','length','attributes','limit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','OpenchannelApplication','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xbd6c,0x80));var _0xcbd6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbd6c[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcbd6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbd6('0x1'));var moment=require(_0xcbd6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xcbd6('0x3'));var util=require('util');var path=require(_0xcbd6('0x4'));var sox=require(_0xcbd6('0x5'));var csv=require(_0xcbd6('0x6'));var ejs=require(_0xcbd6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcbd6('0x8'));var crypto=require(_0xcbd6('0x9'));var jsforce=require(_0xcbd6('0xa'));var deskjs=require(_0xcbd6('0xb'));var toCsv=require(_0xcbd6('0x6'));var querystring=require(_0xcbd6('0xc'));var Papa=require(_0xcbd6('0xd'));var Redis=require(_0xcbd6('0xe'));var authService=require(_0xcbd6('0xf'));var qs=require(_0xcbd6('0x10'));var as=require(_0xcbd6('0x11'));var hardwareService=require(_0xcbd6('0x12'));var logger=require(_0xcbd6('0x13'))(_0xcbd6('0x14'));var utils=require(_0xcbd6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcbd6('0x16'));var db=require(_0xcbd6('0x17'))['db'];function respondWithStatusCode(_0x8a2b1b,_0x1f3010){_0x1f3010=_0x1f3010||0xcc;return function(_0x10de75){if(_0x10de75){return _0x8a2b1b[_0xcbd6('0x18')](_0x1f3010);}return _0x8a2b1b['status'](_0x1f3010)[_0xcbd6('0x19')]();};}function respondWithResult(_0x2c7de8,_0x14d28c){_0x14d28c=_0x14d28c||0xc8;return function(_0x3cc58e){if(_0x3cc58e){return _0x2c7de8['status'](_0x14d28c)[_0xcbd6('0x1a')](_0x3cc58e);}};}function respondWithFilteredResult(_0x52d9a7,_0x52561a){return function(_0x2e1246){if(_0x2e1246){var _0x649466=typeof _0x52561a[_0xcbd6('0x1b')]==='undefined'&&typeof _0x52561a['limit']==='undefined';var _0x491c18=_0x2e1246[_0xcbd6('0x1c')];var _0x2cb878=_0x649466?0x0:_0x52561a[_0xcbd6('0x1b')];var _0x89295c=_0x649466?_0x2e1246[_0xcbd6('0x1c')]:_0x52561a['offset']+_0x52561a['limit'];var _0x361ec8;if(_0x89295c>=_0x491c18){_0x89295c=_0x491c18;_0x361ec8=0xc8;}else{_0x361ec8=0xce;}_0x52d9a7[_0xcbd6('0x1d')](_0x361ec8);return _0x52d9a7['set'](_0xcbd6('0x1e'),_0x2cb878+'-'+_0x89295c+'/'+_0x491c18)['json'](_0x2e1246);}return null;};}function patchUpdates(_0x12c1f9){return function(_0x1abc30){try{jsonpatch['apply'](_0x1abc30,_0x12c1f9,!![]);}catch(_0x4a3722){return BPromise[_0xcbd6('0x1f')](_0x4a3722);}return _0x1abc30[_0xcbd6('0x20')]();};}function saveUpdates(_0x5d2db2,_0x3bf909){return function(_0x45571b){if(_0x45571b){return _0x45571b[_0xcbd6('0x21')](_0x5d2db2)[_0xcbd6('0x22')](function(_0x534298){return _0x534298;});}return null;};}function removeEntity(_0x554678,_0x24acbb){return function(_0x13b38f){if(_0x13b38f){return _0x13b38f[_0xcbd6('0x23')]()['then'](function(){_0x554678['status'](0xcc)[_0xcbd6('0x19')]();});}};}function handleEntityNotFound(_0x5b567c,_0x27811f){return function(_0x494f20){if(!_0x494f20){_0x5b567c[_0xcbd6('0x18')](0x194);}return _0x494f20;};}function handleError(_0x15551f,_0x50f54e){_0x50f54e=_0x50f54e||0x1f4;return function(_0x262449){logger[_0xcbd6('0x24')](_0x262449[_0xcbd6('0x25')]);if(_0x262449[_0xcbd6('0x26')]){delete _0x262449[_0xcbd6('0x26')];}_0x15551f[_0xcbd6('0x1d')](_0x50f54e)['send'](_0x262449);};}exports[_0xcbd6('0x27')]=function(_0x45f271,_0x2911ad){var _0x4ca1d1={},_0x29818b={},_0x2fcd94={'count':0x0,'rows':[]};var _0x119610=_['map'](db['OpenchannelApplication'][_0xcbd6('0x28')],function(_0x3c2072){return{'name':_0x3c2072[_0xcbd6('0x29')],'type':_0x3c2072['type'][_0xcbd6('0x2a')]};});_0x29818b['model']=_[_0xcbd6('0x2b')](_0x119610,_0xcbd6('0x26'));_0x29818b['query']=_['keys'](_0x45f271[_0xcbd6('0x2c')]);_0x29818b['filters']=_[_0xcbd6('0x2d')](_0x29818b['model'],_0x29818b[_0xcbd6('0x2c')]);_0x4ca1d1['attributes']=_[_0xcbd6('0x2d')](_0x29818b[_0xcbd6('0x2e')],qs['fields'](_0x45f271['query']['fields']));_0x4ca1d1['attributes']=_0x4ca1d1['attributes'][_0xcbd6('0x2f')]?_0x4ca1d1[_0xcbd6('0x30')]:_0x29818b[_0xcbd6('0x2e')];if(!_0x45f271[_0xcbd6('0x2c')]['hasOwnProperty']('nolimit')){_0x4ca1d1[_0xcbd6('0x31')]=qs['limit'](_0x45f271[_0xcbd6('0x2c')][_0xcbd6('0x31')]);_0x4ca1d1['offset']=qs[_0xcbd6('0x1b')](_0x45f271[_0xcbd6('0x2c')][_0xcbd6('0x1b')]);}_0x4ca1d1[_0xcbd6('0x32')]=qs[_0xcbd6('0x33')](_0x45f271['query'][_0xcbd6('0x33')]);_0x4ca1d1[_0xcbd6('0x34')]=qs[_0xcbd6('0x35')](_['pick'](_0x45f271[_0xcbd6('0x2c')],_0x29818b[_0xcbd6('0x35')]),_0x119610);if(_0x45f271[_0xcbd6('0x2c')]['filter']){_0x4ca1d1[_0xcbd6('0x34')]=_[_0xcbd6('0x36')](_0x4ca1d1[_0xcbd6('0x34')],{'$or':_[_0xcbd6('0x2b')](_0x119610,function(_0x38bd07){if(_0x38bd07[_0xcbd6('0x37')]!==_0xcbd6('0x38')){var _0x136224={};_0x136224[_0x38bd07[_0xcbd6('0x26')]]={'$like':'%'+_0x45f271[_0xcbd6('0x2c')][_0xcbd6('0x39')]+'%'};return _0x136224;}})});}_0x4ca1d1=_[_0xcbd6('0x36')]({},_0x4ca1d1,_0x45f271[_0xcbd6('0x3a')]);var _0x31c8dc={'where':_0x4ca1d1[_0xcbd6('0x34')]};return db[_0xcbd6('0x3b')][_0xcbd6('0x1c')](_0x31c8dc)['then'](function(_0x551775){_0x2fcd94['count']=_0x551775;if(_0x45f271['query'][_0xcbd6('0x3c')]){_0x4ca1d1[_0xcbd6('0x3d')]=[{'all':!![]}];}return db[_0xcbd6('0x3b')][_0xcbd6('0x3e')](_0x4ca1d1);})['then'](function(_0x16e621){_0x2fcd94[_0xcbd6('0x3f')]=_0x16e621;return _0x2fcd94;})[_0xcbd6('0x22')](respondWithFilteredResult(_0x2911ad,_0x4ca1d1))[_0xcbd6('0x40')](handleError(_0x2911ad,null));};exports[_0xcbd6('0x41')]=function(_0x237249,_0x547623){var _0x5c9fea={'raw':!![],'where':{'id':_0x237249[_0xcbd6('0x42')]['id']}},_0x4b4bf8={};_0x4b4bf8[_0xcbd6('0x2e')]=_['keys'](db['OpenchannelApplication'][_0xcbd6('0x28')]);_0x4b4bf8[_0xcbd6('0x2c')]=_['keys'](_0x237249['query']);_0x4b4bf8[_0xcbd6('0x35')]=_[_0xcbd6('0x2d')](_0x4b4bf8[_0xcbd6('0x2e')],_0x4b4bf8[_0xcbd6('0x2c')]);_0x5c9fea[_0xcbd6('0x30')]=_[_0xcbd6('0x2d')](_0x4b4bf8[_0xcbd6('0x2e')],qs[_0xcbd6('0x43')](_0x237249[_0xcbd6('0x2c')]['fields']));_0x5c9fea[_0xcbd6('0x30')]=_0x5c9fea[_0xcbd6('0x30')][_0xcbd6('0x2f')]?_0x5c9fea[_0xcbd6('0x30')]:_0x4b4bf8[_0xcbd6('0x2e')];if(_0x237249[_0xcbd6('0x2c')][_0xcbd6('0x3c')]){_0x5c9fea[_0xcbd6('0x3d')]=[{'all':!![]}];}_0x5c9fea=_[_0xcbd6('0x36')]({},_0x5c9fea,_0x237249[_0xcbd6('0x3a')]);return db['OpenchannelApplication']['find'](_0x5c9fea)[_0xcbd6('0x22')](handleEntityNotFound(_0x547623,null))['then'](respondWithResult(_0x547623,null))[_0xcbd6('0x40')](handleError(_0x547623,null));};exports[_0xcbd6('0x44')]=function(_0x1f382e,_0x56e8df){return db['OpenchannelApplication'][_0xcbd6('0x44')](_0x1f382e[_0xcbd6('0x45')],{})[_0xcbd6('0x22')](respondWithResult(_0x56e8df,0xc9))[_0xcbd6('0x40')](handleError(_0x56e8df,null));};exports[_0xcbd6('0x21')]=function(_0x304dd0,_0x3f15ea){if(_0x304dd0[_0xcbd6('0x45')]['id']){delete _0x304dd0[_0xcbd6('0x45')]['id'];}return db[_0xcbd6('0x3b')]['find']({'where':{'id':_0x304dd0[_0xcbd6('0x42')]['id']}})[_0xcbd6('0x22')](handleEntityNotFound(_0x3f15ea,null))[_0xcbd6('0x22')](saveUpdates(_0x304dd0[_0xcbd6('0x45')],null))[_0xcbd6('0x22')](respondWithResult(_0x3f15ea,null))['catch'](handleError(_0x3f15ea,null));};exports['destroy']=function(_0x4e423c,_0xf9f40){return db[_0xcbd6('0x3b')][_0xcbd6('0x46')]({'where':{'id':_0x4e423c[_0xcbd6('0x42')]['id']}})[_0xcbd6('0x22')](handleEntityNotFound(_0xf9f40,null))[_0xcbd6('0x22')](removeEntity(_0xf9f40,null))[_0xcbd6('0x40')](handleError(_0xf9f40,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index e297c15..11a9d9a 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 _0x181f=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x181f,0x97));var _0xf181=function(_0xc52f0f,_0x47602e){_0xc52f0f=_0xc52f0f-0x0;var _0x13d6f6=_0x181f[_0xc52f0f];return _0x13d6f6;};'use strict';var _=require('lodash');var util=require(_0xf181('0x0'));var logger=require(_0xf181('0x1'))(_0xf181('0x2'));var moment=require(_0xf181('0x3'));var BPromise=require(_0xf181('0x4'));var rp=require(_0xf181('0x5'));var fs=require('fs');var path=require(_0xf181('0x6'));var rimraf=require(_0xf181('0x7'));var config=require(_0xf181('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0xf181('0x9')]=function(_0x2e10a5,_0x16f0f8){return _0x2e10a5[_0xf181('0xa')](_0xf181('0xb'),attributes,{'tableName':_0xf181('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf181('0xd'),'collate':_0xf181('0xe')});}; \ No newline at end of file +var _0xcaf7=['moment','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x3bcb7c,_0x5af870){var _0x584411=function(_0x4b9a67){while(--_0x4b9a67){_0x3bcb7c['push'](_0x3bcb7c['shift']());}};_0x584411(++_0x5af870);}(_0xcaf7,0x97));var _0x7caf=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xcaf7[_0xea8947];return _0x2455e9;};'use strict';var _=require('lodash');var util=require(_0x7caf('0x0'));var logger=require(_0x7caf('0x1'))(_0x7caf('0x2'));var moment=require(_0x7caf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7caf('0x4'));var config=require('../../config/environment');var attributes=require(_0x7caf('0x5'));module[_0x7caf('0x6')]=function(_0x560b6e,_0x3c6164){return _0x560b6e[_0x7caf('0x7')](_0x7caf('0x8'),attributes,{'tableName':_0x7caf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7caf('0xa')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 2e97684..54b3c95 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 _0x1ba8=['code','message','info','result','catch','OpenchannelApplication','update','body','options','raw','attributes','limit','UpdateOpenchannelApplication','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x1ba8,0x1cd));var _0x81ba=function(_0x8fb951,_0x1a3a8c){_0x8fb951=_0x8fb951-0x0;var _0x3368f6=_0x1ba8[_0x8fb951];return _0x3368f6;};'use strict';var _=require(_0x81ba('0x0'));var util=require(_0x81ba('0x1'));var moment=require('moment');var BPromise=require(_0x81ba('0x2'));var rs=require(_0x81ba('0x3'));var fs=require('fs');var Redis=require(_0x81ba('0x4'));var db=require(_0x81ba('0x5'))['db'];var utils=require(_0x81ba('0x6'));var logger=require(_0x81ba('0x7'))('rpc');var config=require(_0x81ba('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x81ba('0x9')][_0x81ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21f07d,_0xf40e56,_0x313f8a){return new BPromise(function(_0x42a781,_0x460764){return client[_0x81ba('0xb')](_0x21f07d,_0x313f8a)[_0x81ba('0xc')](function(_0x49780a){logger['info'](_0x81ba('0xd'),_0xf40e56,_0x81ba('0xe'));logger[_0x81ba('0xf')](_0x81ba('0x10'),_0xf40e56,_0x81ba('0xe'),JSON[_0x81ba('0x11')](_0x49780a));if(_0x49780a[_0x81ba('0x12')]){if(_0x49780a['error'][_0x81ba('0x13')]===0x1f4){logger['error'](_0x81ba('0xd'),_0xf40e56,_0x49780a['error'][_0x81ba('0x14')]);return _0x460764(_0x49780a['error']['message']);}logger[_0x81ba('0x12')](_0x81ba('0xd'),_0xf40e56,_0x49780a['error'][_0x81ba('0x14')]);return _0x42a781(_0x49780a[_0x81ba('0x12')]['message']);}else{logger[_0x81ba('0x15')]('OpenchannelApplication,\x20%s,\x20%s',_0xf40e56,_0x81ba('0xe'));_0x42a781(_0x49780a[_0x81ba('0x16')][_0x81ba('0x14')]);}})[_0x81ba('0x17')](function(_0x13481b){logger[_0x81ba('0x12')](_0x81ba('0xd'),_0xf40e56,_0x13481b);_0x460764(_0x13481b);});});}exports['UpdateOpenchannelApplication']=function(_0x1bff0b){var _0x3e3017=this;return new Promise(function(_0x57812f,_0x50f429){return db[_0x81ba('0x18')][_0x81ba('0x19')](_0x1bff0b[_0x81ba('0x1a')],{'raw':_0x1bff0b[_0x81ba('0x1b')]?_0x1bff0b[_0x81ba('0x1b')][_0x81ba('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bff0b[_0x81ba('0x1b')]?_0x1bff0b[_0x81ba('0x1b')]['where']||null:null,'attributes':_0x1bff0b[_0x81ba('0x1b')]?_0x1bff0b[_0x81ba('0x1b')][_0x81ba('0x1d')]||null:null,'limit':_0x1bff0b[_0x81ba('0x1b')]?_0x1bff0b[_0x81ba('0x1b')][_0x81ba('0x1e')]||null:null})[_0x81ba('0xc')](function(_0x1719b7){logger[_0x81ba('0x15')](_0x81ba('0x1f'),_0x1bff0b);logger[_0x81ba('0xf')](_0x81ba('0x1f'),_0x1bff0b,JSON[_0x81ba('0x11')](_0x1719b7));_0x57812f(_0x1719b7);})[_0x81ba('0x17')](function(_0x5ee451){logger[_0x81ba('0x12')]('UpdateOpenchannelApplication',_0x5ee451[_0x81ba('0x14')],_0x1bff0b);_0x50f429(_0x3e3017[_0x81ba('0x12')](0x1f4,_0x5ee451[_0x81ba('0x14')]));});});}; \ No newline at end of file +var _0xfffa=['catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','where','attributes','limit','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelApplication,\x20%s,\x20%s','result'];(function(_0x520f7a,_0xf7bc99){var _0x2992f0=function(_0x3ed71a){while(--_0x3ed71a){_0x520f7a['push'](_0x520f7a['shift']());}};_0x2992f0(++_0xf7bc99);}(_0xfffa,0x1e8));var _0xafff=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfffa[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xafff('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xafff('0x1'));var fs=require('fs');var Redis=require(_0xafff('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xafff('0x3'));var logger=require(_0xafff('0x4'))(_0xafff('0x5'));var config=require(_0xafff('0x6'));var jayson=require(_0xafff('0x7'));var client=jayson[_0xafff('0x8')][_0xafff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dd70e,_0x23afaf,_0x388416){return new BPromise(function(_0x1dfc99,_0xa72acf){return client[_0xafff('0xa')](_0x2dd70e,_0x388416)[_0xafff('0xb')](function(_0x36ecf5){logger[_0xafff('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x23afaf,'request\x20sent');logger[_0xafff('0xd')](_0xafff('0xe'),_0x23afaf,_0xafff('0xf'),JSON[_0xafff('0x10')](_0x36ecf5));if(_0x36ecf5[_0xafff('0x11')]){if(_0x36ecf5[_0xafff('0x11')][_0xafff('0x12')]===0x1f4){logger[_0xafff('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x23afaf,_0x36ecf5[_0xafff('0x11')][_0xafff('0x13')]);return _0xa72acf(_0x36ecf5[_0xafff('0x11')][_0xafff('0x13')]);}logger[_0xafff('0x11')](_0xafff('0x14'),_0x23afaf,_0x36ecf5[_0xafff('0x11')]['message']);return _0x1dfc99(_0x36ecf5[_0xafff('0x11')][_0xafff('0x13')]);}else{logger[_0xafff('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x23afaf,_0xafff('0xf'));_0x1dfc99(_0x36ecf5[_0xafff('0x15')]['message']);}})[_0xafff('0x16')](function(_0x14488a){logger[_0xafff('0x11')](_0xafff('0x14'),_0x23afaf,_0x14488a);_0xa72acf(_0x14488a);});});}exports[_0xafff('0x17')]=function(_0x881a2){var _0x4a4dff=this;return new Promise(function(_0x4bd7f9,_0x75c511){return db[_0xafff('0x18')]['update'](_0x881a2[_0xafff('0x19')],{'raw':_0x881a2[_0xafff('0x1a')]?_0x881a2['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x881a2[_0xafff('0x1a')]?_0x881a2[_0xafff('0x1a')][_0xafff('0x1b')]||null:null,'attributes':_0x881a2[_0xafff('0x1a')]?_0x881a2[_0xafff('0x1a')][_0xafff('0x1c')]||null:null,'limit':_0x881a2['options']?_0x881a2[_0xafff('0x1a')][_0xafff('0x1d')]||null:null})['then'](function(_0x1753b3){logger['info'](_0xafff('0x17'),_0x881a2);logger[_0xafff('0xd')](_0xafff('0x17'),_0x881a2,JSON[_0xafff('0x10')](_0x1753b3));_0x4bd7f9(_0x1753b3);})[_0xafff('0x16')](function(_0x55318d){logger[_0xafff('0x11')](_0xafff('0x17'),_0x55318d['message'],_0x881a2);_0x75c511(_0x4a4dff[_0xafff('0x11')](0x1f4,_0x55318d[_0xafff('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 485cd00..ebdf1f9 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 _0xdb2d=['post','/:id/messages','addMessage','/:id/tags','openchannelinteraction:update','update','delete','tracked','openchannel','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','create'];(function(_0x20dfe7,_0x3847dc){var _0x1375d8=function(_0x4d1bff){while(--_0x4d1bff){_0x20dfe7['push'](_0x20dfe7['shift']());}};_0x1375d8(++_0x3847dc);}(_0xdb2d,0xa7));var _0xddb2=function(_0x4b6a07,_0x661c52){_0x4b6a07=_0x4b6a07-0x0;var _0x3996b3=_0xdb2d[_0x4b6a07];return _0x3996b3;};'use strict';var multer=require(_0xddb2('0x0'));var util=require(_0xddb2('0x1'));var path=require(_0xddb2('0x2'));var timeout=require(_0xddb2('0x3'));var express=require('express');var router=express[_0xddb2('0x4')]();var fs_extra=require(_0xddb2('0x5'));var auth=require(_0xddb2('0x6'));var interaction=require(_0xddb2('0x7'));var config=require(_0xddb2('0x8'));var controller=require(_0xddb2('0x9'));router[_0xddb2('0xa')]('/',auth[_0xddb2('0xb')](),controller[_0xddb2('0xc')]);router[_0xddb2('0xa')](_0xddb2('0xd'),auth[_0xddb2('0xb')](),controller[_0xddb2('0xe')]);router[_0xddb2('0xa')](_0xddb2('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xddb2('0xa')]('/:id/messages',auth[_0xddb2('0xb')](),controller[_0xddb2('0x10')]);router[_0xddb2('0xa')](_0xddb2('0x11'),auth[_0xddb2('0xb')](),controller['download']);router['post']('/',auth[_0xddb2('0xb')](),controller[_0xddb2('0x12')]);router[_0xddb2('0x13')](_0xddb2('0x14'),auth[_0xddb2('0xb')](),controller[_0xddb2('0x15')]);router[_0xddb2('0x13')](_0xddb2('0x16'),auth[_0xddb2('0xb')](),interaction['tracked']('openchannel','openchannelinteraction:addtags'),controller['addTags']);router['put'](_0xddb2('0xf'),auth[_0xddb2('0xb')](),interaction['tracked']('openchannel',_0xddb2('0x17')),controller[_0xddb2('0x18')]);router[_0xddb2('0x19')](_0xddb2('0xf'),auth[_0xddb2('0xb')](),interaction[_0xddb2('0x1a')](_0xddb2('0x1b'),_0xddb2('0x1c')),controller[_0xddb2('0x1d')]);router[_0xddb2('0x19')](_0xddb2('0x16'),auth['isAuthenticated'](),controller[_0xddb2('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xadc3=['/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','/:id','tracked','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x43b59d,_0xd7b2ae){var _0x37f43b=function(_0x6ccf5c){while(--_0x6ccf5c){_0x43b59d['push'](_0x43b59d['shift']());}};_0x37f43b(++_0xd7b2ae);}(_0xadc3,0xcb));var _0x3adc=function(_0xef2a2a,_0x261325){_0xef2a2a=_0xef2a2a-0x0;var _0x5dac30=_0xadc3[_0xef2a2a];return _0x5dac30;};'use strict';var multer=require('multer');var util=require(_0x3adc('0x0'));var path=require(_0x3adc('0x1'));var timeout=require(_0x3adc('0x2'));var express=require(_0x3adc('0x3'));var router=express['Router']();var fs_extra=require(_0x3adc('0x4'));var auth=require(_0x3adc('0x5'));var interaction=require(_0x3adc('0x6'));var config=require(_0x3adc('0x7'));var controller=require(_0x3adc('0x8'));router[_0x3adc('0x9')]('/',auth[_0x3adc('0xa')](),controller['index']);router['get'](_0x3adc('0xb'),auth[_0x3adc('0xa')](),controller[_0x3adc('0xc')]);router[_0x3adc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3adc('0xd')]);router[_0x3adc('0x9')](_0x3adc('0xe'),auth['isAuthenticated'](),controller[_0x3adc('0xf')]);router[_0x3adc('0x9')]('/:id/download',auth[_0x3adc('0xa')](),controller[_0x3adc('0x10')]);router['post']('/',auth[_0x3adc('0xa')](),controller[_0x3adc('0x11')]);router[_0x3adc('0x12')](_0x3adc('0xe'),auth[_0x3adc('0xa')](),controller[_0x3adc('0x13')]);router[_0x3adc('0x12')](_0x3adc('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x3adc('0x15'),_0x3adc('0x16')),controller[_0x3adc('0x17')]);router['put'](_0x3adc('0x18'),auth[_0x3adc('0xa')](),interaction[_0x3adc('0x19')](_0x3adc('0x15'),_0x3adc('0x1a')),controller[_0x3adc('0x1b')]);router['delete']('/:id',auth[_0x3adc('0xa')](),interaction['tracked'](_0x3adc('0x15'),_0x3adc('0x1c')),controller['destroy']);router[_0x3adc('0x1d')](_0x3adc('0x14'),auth[_0x3adc('0xa')](),controller['removeTags']);module[_0x3adc('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 8461dee..b12866f 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 _0x2dab=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0x2dab,0x120));var _0xb2da=function(_0x191ff6,_0x497a69){_0x191ff6=_0x191ff6-0x0;var _0x15dd12=_0x2dab[_0x191ff6];return _0x15dd12;};'use strict';var Sequelize=require(_0xb2da('0x0'));module[_0xb2da('0x1')]={'closed':{'type':Sequelize[_0xb2da('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb2da('0x3')]},'disposition':{'type':Sequelize[_0xb2da('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb2da('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb2da('0x3')]},'threadId':{'type':Sequelize[_0xb2da('0x4')]},'externalUrl':{'type':Sequelize[_0xb2da('0x4')]},'lastMsgAt':{'type':Sequelize[_0xb2da('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb2da('0x5')]('in',_0xb2da('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb2da('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7070=['STRING','DATE','ENUM','out','BOOLEAN'];(function(_0x8931a8,_0x8ad68a){var _0x4624ee=function(_0x12545f){while(--_0x12545f){_0x8931a8['push'](_0x8931a8['shift']());}};_0x4624ee(++_0x8ad68a);}(_0x7070,0xa4));var _0x0707=function(_0x1bc66c,_0x24c527){_0x1bc66c=_0x1bc66c-0x0;var _0x223214=_0x7070[_0x1bc66c];return _0x223214;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x0707('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0707('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0707('0x1')]},'note':{'type':Sequelize[_0x0707('0x1')]},'read1stAt':{'type':Sequelize[_0x0707('0x2')]},'threadId':{'type':Sequelize[_0x0707('0x1')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x0707('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0707('0x3')]('in',_0x0707('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0707('0x1')]},'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 5a7838d..0a38877 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 _0x416b=['field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','users','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','OpenchannelAccountId','createdAt','$gte','$lte','where','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','Account.key','a.mandatoryDisposition','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','i.*','c.firstName','c.lastName','Contact.lastName','c.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','rows','show','params','includeAll','create','describe','addMessage','omit','ids','findOne','OpenchannelMessage','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','join','fullname','CmContact','firstName','lastName','attachments','Attachment','Messages','secret','OpenchannelAccount','Openchannel','Account','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','name','send','Users','map','Tags','TagIds','split','forEach','catch','index','OpenchannelInteraction','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','select'];(function(_0x5ae702,_0x5b70a9){var _0x3a12ad=function(_0x2e3989){while(--_0x2e3989){_0x5ae702['push'](_0x5ae702['shift']());}};_0x3a12ad(++_0x5b70a9);}(_0x416b,0x9f));var _0xb416=function(_0x74895e,_0x298c35){_0x74895e=_0x74895e-0x0;var _0x40bc2a=_0x416b[_0x74895e];return _0x40bc2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb416('0x0'));var zipdir=require(_0xb416('0x1'));var jsonpatch=require(_0xb416('0x2'));var rp=require(_0xb416('0x3'));var moment=require(_0xb416('0x4'));var BPromise=require(_0xb416('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb416('0x6'));var sox=require(_0xb416('0x7'));var csv=require(_0xb416('0x8'));var ejs=require(_0xb416('0x9'));var fs=require('fs');var fs_extra=require(_0xb416('0xa'));var _=require(_0xb416('0xb'));var squel=require(_0xb416('0xc'));var crypto=require(_0xb416('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb416('0xe'));var toCsv=require(_0xb416('0x8'));var querystring=require(_0xb416('0xf'));var Papa=require(_0xb416('0x10'));var Redis=require(_0xb416('0x11'));var authService=require(_0xb416('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb416('0x13'));var pdf=require(_0xb416('0x14'));var hardwareService=require(_0xb416('0x15'));var logger=require(_0xb416('0x16'))(_0xb416('0x17'));var utils=require('../../config/utils');var config=require(_0xb416('0x18'));var licenseUtil=require(_0xb416('0x19'));var db=require(_0xb416('0x1a'))['db'];config[_0xb416('0x1b')]=_[_0xb416('0x1c')](config[_0xb416('0x1b')],{'host':_0xb416('0x1d'),'port':0x18eb});var socket=require(_0xb416('0x1e'))(new Redis(config[_0xb416('0x1b')]));require(_0xb416('0x1f'))['register'](socket);function respondWithStatusCode(_0x1f4b30,_0x5820d0){_0x5820d0=_0x5820d0||0xcc;return function(_0x7dbf6){if(_0x7dbf6){return _0x1f4b30[_0xb416('0x20')](_0x5820d0);}return _0x1f4b30[_0xb416('0x21')](_0x5820d0)[_0xb416('0x22')]();};}function respondWithResult(_0xdc5d50,_0x368fe9){_0x368fe9=_0x368fe9||0xc8;return function(_0x4201bf){if(_0x4201bf){return _0xdc5d50[_0xb416('0x21')](_0x368fe9)[_0xb416('0x23')](_0x4201bf);}};}function respondWithFilteredResult(_0x103561,_0x21c19a){return function(_0x51b65b){if(_0x51b65b){var _0x2b9494=typeof _0x21c19a[_0xb416('0x24')]===_0xb416('0x25')&&typeof _0x21c19a[_0xb416('0x26')]==='undefined';var _0x588406=_0x51b65b['count'];var _0x36e780=_0x2b9494?0x0:_0x21c19a[_0xb416('0x24')];var _0x5c722a=_0x2b9494?_0x51b65b[_0xb416('0x27')]:_0x21c19a[_0xb416('0x24')]+_0x21c19a[_0xb416('0x26')];var _0x255d52;if(_0x5c722a>=_0x588406){_0x5c722a=_0x588406;_0x255d52=0xc8;}else{_0x255d52=0xce;}_0x103561[_0xb416('0x21')](_0x255d52);return _0x103561[_0xb416('0x28')](_0xb416('0x29'),_0x36e780+'-'+_0x5c722a+'/'+_0x588406)[_0xb416('0x23')](_0x51b65b);}return null;};}function patchUpdates(_0x15cb00){return function(_0xa7ff0){try{jsonpatch['apply'](_0xa7ff0,_0x15cb00,!![]);}catch(_0x543df7){return BPromise['reject'](_0x543df7);}return _0xa7ff0[_0xb416('0x2a')]();};}function saveUpdates(_0x301913,_0x143380){return function(_0x2568c3){if(_0x2568c3){return _0x2568c3[_0xb416('0x2b')](_0x301913)['then'](function(_0x395e83){return _0x395e83;});}return null;};}function removeEntity(_0x5bfd91,_0x3da35f){return function(_0x4870e0){if(_0x4870e0){return _0x4870e0[_0xb416('0x2c')]()[_0xb416('0x2d')](function(){_0x5bfd91[_0xb416('0x21')](0xcc)[_0xb416('0x22')]();});}};}function handleEntityNotFound(_0x53eb01,_0xb0ec9){return function(_0xf62124){if(!_0xf62124){_0x53eb01['sendStatus'](0x194);}return _0xf62124;};}function handleError(_0x1ce502,_0x478fa7){_0x478fa7=_0x478fa7||0x1f4;return function(_0x32eb3c){logger[_0xb416('0x2e')](_0x32eb3c[_0xb416('0x2f')]);if(_0x32eb3c[_0xb416('0x30')]){delete _0x32eb3c[_0xb416('0x30')];}_0x1ce502[_0xb416('0x21')](_0x478fa7)[_0xb416('0x31')](_0x32eb3c);};}function getInteractionUsers(_0xec7282,_0x39fcc3){return new BPromise(function(_0x1aacb0,_0x482328){try{if(_0x39fcc3[_0xec7282['id']]){_0xec7282[_0xb416('0x32')]=_[_0xb416('0x33')](_0x39fcc3[_0xec7282['id']],function(_0xb83073){return{'id':_0xb83073['id'],'fullname':_0xb83073['fullname']};});}}catch(_0x29877f){_0x482328(_0x29877f);}_0x1aacb0(_0xec7282);});}function getInteractionTags(_0x4a44f0,_0x372315){return new BPromise(function(_0x475429,_0x4368f8){try{if(_0x4a44f0['TagIds']){_0x4a44f0[_0xb416('0x34')]=[];_0x4a44f0[_0xb416('0x35')][_0xb416('0x36')](',')[_0xb416('0x37')](function(_0x591063){_0x4a44f0[_0xb416('0x34')]['push'](_0x372315[_0x591063]);});}delete _0x4a44f0['TagIds'];}catch(_0x226460){_0x4368f8(_0x226460);}_0x475429(_0x4a44f0);});}function updateOpenchannelInteraction(_0x2f96bf,_0x46fa91,_0x3c7e34){return new BPromise(function(_0x2480f7,_0x4c4226){return getInteractionUsers(_0x2f96bf,_0x3c7e34)[_0xb416('0x2d')](function(_0x297b13){return getInteractionTags(_0x297b13,_0x46fa91);})['then'](function(_0x198a41){_0x2480f7(_0x198a41);})[_0xb416('0x38')](function(_0x31dbe8){_0x4c4226(_0x31dbe8);});});}exports[_0xb416('0x39')]=function(_0x2f76a5,_0x57b453){var _0x11a8a6={},_0x21b2a5={},_0x1b60bd={'count':0x0,'rows':[]};var _0x17c958=_['map'](db[_0xb416('0x3a')][_0xb416('0x3b')],function(_0x2ff794){return{'name':_0x2ff794[_0xb416('0x3c')],'type':_0x2ff794['type']['key']};});_0x21b2a5[_0xb416('0x3d')]=_[_0xb416('0x33')](_0x17c958,'name');_0x21b2a5['query']=_[_0xb416('0x3e')](_0x2f76a5[_0xb416('0x3f')]);_0x21b2a5[_0xb416('0x40')]=_[_0xb416('0x41')](_0x21b2a5[_0xb416('0x3d')],_0x21b2a5[_0xb416('0x3f')]);_0x11a8a6[_0xb416('0x42')]=_[_0xb416('0x41')](_0x21b2a5['model'],qs['fields'](_0x2f76a5['query'][_0xb416('0x43')]));_0x11a8a6[_0xb416('0x42')]=_0x11a8a6[_0xb416('0x42')][_0xb416('0x44')]?_0x11a8a6[_0xb416('0x42')]:_0x21b2a5[_0xb416('0x3d')];if(!_0x2f76a5[_0xb416('0x3f')][_0xb416('0x45')](_0xb416('0x46'))){_0x11a8a6[_0xb416('0x26')]=qs[_0xb416('0x26')](_0x2f76a5[_0xb416('0x3f')]['limit']);_0x11a8a6[_0xb416('0x24')]=qs[_0xb416('0x24')](_0x2f76a5['query'][_0xb416('0x24')]);}_0x11a8a6[_0xb416('0x47')]=qs[_0xb416('0x48')](_0x2f76a5[_0xb416('0x3f')]['sort']);_0x11a8a6['where']=qs['filters'](_['pick'](_0x2f76a5[_0xb416('0x3f')],_0x21b2a5[_0xb416('0x40')]),_0x17c958);var _0x36d825=[];var _0x33eace=squel[_0xb416('0x49')]()['field']('id')[_0xb416('0x4a')](_0xb416('0x30'))['field']('color')[_0xb416('0x4b')](_0xb416('0x4c'));var _0x22084f=squel['select']()[_0xb416('0x4a')](_0xb416('0x4d'))[_0xb416('0x4a')](_0xb416('0x4e'))['field'](_0xb416('0x4f'))[_0xb416('0x4b')]('user_has_openchannel_interactions','ui')['left_join']('users','u',_0xb416('0x50'));var _0x50fd57=squel[_0xb416('0x49')]()[_0xb416('0x4b')](_0xb416('0x51'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb416('0x52')](_0xb416('0x53'),'o',_0xb416('0x54'))[_0xb416('0x52')](_0xb416('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xb416('0x52')](_0xb416('0x56'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xb416('0x57'),'it',_0xb416('0x58'))[_0xb416('0x52')](_0xb416('0x4c'),'t',_0xb416('0x59'));var _0x180de6=squel[_0xb416('0x5a')]();var _0x4989b8=[];var _0x760cf8=squel[_0xb416('0x5a')]();var _0xf4ad25;if(_0x2f76a5['query']['search']){_0xf4ad25=as[_0xb416('0x5b')](_0x2f76a5[_0xb416('0x3f')][_0xb416('0x5c')]);var _0xc86bf1=_0xf4ad25[_0xb416('0x5d')];for(var _0x229e4f=0x0;_0x229e4f<_0xf4ad25['conditions'][_0xb416('0x44')];_0x229e4f++){var _0x517ead=_0xf4ad25[_0xb416('0x5e')][_0x229e4f];var _0xbe2d53='i';var _0x146394=_[_0xb416('0x5f')](_0x17c958,[_0xb416('0x30'),_0x517ead['field']]);if(!_0x146394){switch(_0x517ead[_0xb416('0x4a')]){case _0xb416('0x60'):if(_0x517ead[_0xb416('0x61')]==0x1){_0x50fd57[_0xb416('0x62')]('`'+_0x517ead['field']+_0xb416('0x63'));}else{_0x50fd57[_0xb416('0x62')]('`'+_0x517ead[_0xb416('0x4a')]+'`\x20>\x200');}break;case _0xb416('0x64'):if(_0x517ead[_0xb416('0x65')]===_0xb416('0x66')){if(_0x517ead[_0xb416('0x61')][_0xb416('0x36')]('\x20')[_0xb416('0x44')]>0x1){_0x180de6[_0xc86bf1](_0xb416('0x67'),qs[_0xb416('0x68')](_0x517ead[_0xb416('0x61')]),null);}else{var _0x2b155e='%'+_0x517ead['value']+'%';_0x180de6[_0xc86bf1]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2b155e,_0x2b155e,_0x2b155e);}}else{_0x146394=_[_0xb416('0x5f')](_0x17c958,['name',_0xb416('0x69')]);_0x517ead[_0xb416('0x4a')]=_0xb416('0x69');_0x3a0103=as[_0xb416('0x6a')](_0xbe2d53,_0x146394[_0xb416('0x6b')],_0x517ead);_0x180de6[_0xc86bf1](_0x3a0103[_0xb416('0x6c')],_0x3a0103['value'][_0xb416('0x6d')],_0x3a0103[_0xb416('0x61')][_0xb416('0x22')]);}break;case _0xb416('0x6e'):var _0x22f297=_0x517ead[_0xb416('0x61')][_0xb416('0x36')](',')[_0xb416('0x33')](function(_0x1748f7){return Number(_0x1748f7);});_0x22f297[_0xb416('0x37')](function(_0x1fc3d7){_0x760cf8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1fc3d7+',%');});_0x4989b8=_[_0xb416('0x6f')](_0x4989b8,_0x22f297);break;case _0xb416('0x70'):if(_0x517ead[_0xb416('0x65')]===_0xb416('0x66')){_0x180de6[_0xc86bf1](_0xb416('0x71'),'%'+_0x517ead['value']+'%',null);}else{_0x146394=_[_0xb416('0x5f')](_0x17c958,[_0xb416('0x30'),'UserId']);_0x517ead['field']='UserId';_0x3a0103=as[_0xb416('0x6a')](_0xbe2d53,_0x146394['type'],_0x517ead);_0x180de6[_0xc86bf1](_0x3a0103[_0xb416('0x6c')],_0x3a0103[_0xb416('0x61')][_0xb416('0x6d')],_0x3a0103[_0xb416('0x61')]['end']);}break;case _0xb416('0x72'):_0x3a0103=as[_0xb416('0x6a')]('me',null,_0x517ead);_0x180de6[_0xc86bf1](_0x3a0103[_0xb416('0x6c')],_0x3a0103['value'][_0xb416('0x6d')],_0x3a0103[_0xb416('0x61')][_0xb416('0x22')]);break;}}else{var _0x3a0103=as[_0xb416('0x6a')](_0xbe2d53,_0x146394[_0xb416('0x6b')],_0x517ead);_0x180de6[_0xc86bf1](_0x3a0103[_0xb416('0x6c')],_0x3a0103[_0xb416('0x61')]['start'],_0x3a0103[_0xb416('0x61')][_0xb416('0x22')]);}}}else{var _0xc42d3d=_(_0x2f76a5[_0xb416('0x3f')])['keys']()[_0xb416('0x33')](function(_0x46749e){return _[_0xb416('0x73')](_0x17c958,[_0xb416('0x30'),_0x46749e])?_0x46749e:undefined;})[_0xb416('0x74')]()[_0xb416('0x61')]();if(!_['isEmpty'](_0xc42d3d)){_0xc42d3d[_0xb416('0x37')](function(_0x5348eb){if(_0x5348eb===_0xb416('0x75')){_0x50fd57['where']('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x2f76a5[_0xb416('0x3f')][_0x5348eb]));}else if(_0x5348eb===_0xb416('0x76')){var _0x118da7=JSON['parse'](_0x2f76a5[_0xb416('0x3f')][_0x5348eb])[_0xb416('0x77')];var _0x5d41a7=JSON['parse'](_0x2f76a5['query'][_0x5348eb])[_0xb416('0x78')];_0x50fd57[_0xb416('0x79')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x118da7,_0x5d41a7);}else{if(_0x2f76a5['query'][_0x5348eb]===_0xb416('0x7a')){_0x50fd57[_0xb416('0x79')]('i.'+_0x5348eb+_0xb416('0x7b'));}else{_0x50fd57['where']('i.'+_0x5348eb+'\x20=\x20?',_0x2f76a5[_0xb416('0x3f')][_0x5348eb]);}}});}if(_0x2f76a5[_0xb416('0x3f')]['read']){if(_0x2f76a5[_0xb416('0x3f')][_0xb416('0x7c')]==0x1){_0x50fd57[_0xb416('0x62')](_0xb416('0x7d'));}else{_0x50fd57[_0xb416('0x62')](_0xb416('0x7e'));}}if(_0x2f76a5['query']['tag']){_0x4989b8=_[_0xb416('0x7f')](_0x2f76a5[_0xb416('0x3f')][_0xb416('0x80')])?_0x2f76a5['query'][_0xb416('0x80')]:new Array(_0x2f76a5[_0xb416('0x3f')][_0xb416('0x80')]);_0x4989b8[_0xb416('0x37')](function(_0x23d5e0){_0x760cf8['or'](_0xb416('0x81'),'%,'+_0x23d5e0+',%');});}if(_0x2f76a5[_0xb416('0x3f')]['filter']){var _0x1a487e=_0x2f76a5[_0xb416('0x3f')][_0xb416('0x82')][_0xb416('0x83')]('\x5c','\x5c\x5c')[_0xb416('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1a487e)){_0x180de6['or']('i.id\x20LIKE\x20?',_0x1a487e+'%');}else{_0x180de6['or'](_0xb416('0x84'),qs['getFullTextValue'](_0x1a487e))['or'](_0xb416('0x85'),_0x1a487e+'%')['or'](_0xb416('0x86'),_0x1a487e+'%');}}}_0x50fd57[_0xb416('0x79')](_0x180de6);_0x50fd57['group']('i.id');var _0x3af0fa={'type':db[_0xb416('0x87')][_0xb416('0x88')][_0xb416('0x89')],'raw':!![]};var _0xa33fec=_0x50fd57[_0xb416('0x8a')]();_0xa33fec['field'](_0xb416('0x8b'));_0xa33fec[_0xb416('0x4a')](_0xb416('0x8c'),_0xb416('0x60'));if(_0x11a8a6['order']){_0x11a8a6[_0xb416('0x47')][_0xb416('0x37')](function(_0x57f892){var _0xd10032=_0x57f892[0x0]===_0xb416('0x8d')?_0x57f892[0x0]:'i.'+_0x57f892[0x0];_0x50fd57['order'](_0xd10032,_0x57f892[0x1]===_0xb416('0x8e')?![]:!![]);});}if(!_[_0xb416('0x8f')](_0x4989b8)){_0x50fd57[_0xb416('0x62')](_0x760cf8);_0xa33fec[_0xb416('0x79')](_0xb416('0x90'),_0x4989b8);}BPromise['resolve']()['then'](function(){if(!_0xf4ad25){if(_0x2f76a5[_0xb416('0x3f')][_0xb416('0x75')])return;_0xa33fec[_0xb416('0x79')](_0xb416('0x91'));_0x50fd57['where'](_0xb416('0x91'));return;}if(_0x2f76a5[_0xb416('0x92')][_0xb416('0x93')]!==_0xb416('0x94'))return;return _0x2f76a5['user'][_0xb416('0x95')]({'attributes':['id'],'raw':!![]})[_0xb416('0x2d')](function(_0x3792e5){if(_[_0xb416('0x8f')](_0x3792e5)){_0xa33fec[_0xb416('0x79')](_0xb416('0x96'));_0x50fd57[_0xb416('0x79')](_0xb416('0x96'));}else{_0xa33fec[_0xb416('0x79')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xb416('0x33')](_0x3792e5,'id'));_0x50fd57[_0xb416('0x79')](_0xb416('0x97'),_[_0xb416('0x33')](_0x3792e5,'id'));}});})[_0xb416('0x2d')](function(){if(_0x2f76a5[_0xb416('0x92')][_0xb416('0x93')]==='agent'&&!_0xf4ad25&&!_0x2f76a5[_0xb416('0x3f')][_0xb416('0x75')])return[];return db['sequelize'][_0xb416('0x3f')](_0xa33fec[_0xb416('0x98')](),_0x3af0fa);})[_0xb416('0x2d')](function(_0x7e55cb){_0x1b60bd[_0xb416('0x27')]=_0x7e55cb[_0xb416('0x44')];if(_0x1b60bd[_0xb416('0x27')]===0x0)return[];return db[_0xb416('0x99')][_0xb416('0x3f')](_0x33eace[_0xb416('0x98')](),_0x3af0fa)['then'](function(_0x3b39b7){_0x36d825=_[_0xb416('0x9a')](_0x3b39b7,'id');_0x3af0fa=_[_0xb416('0x9b')](_0x3af0fa,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f76a5[_0xb416('0x3f')][_0xb416('0x43')]){_0x11a8a6['attributes'][_0xb416('0x37')](function(_0x3744b1){_0x50fd57[_0xb416('0x4a')]('i.'+_0x3744b1);});}else{_0x50fd57[_0xb416('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb416('0x60'));_0x50fd57[_0xb416('0x4a')]('a.key',_0xb416('0x9c'));_0x50fd57[_0xb416('0x4a')](_0xb416('0x9d'),'Account.mandatoryDisposition');_0x50fd57[_0xb416('0x4a')](_0xb416('0x9e'),_0xb416('0x8d'));_0x50fd57[_0xb416('0x4a')](_0xb416('0x9f'));_0x50fd57[_0xb416('0x4a')](_0xb416('0xa0'),'Contact.firstName');_0x50fd57[_0xb416('0x4a')](_0xb416('0xa1'),_0xb416('0xa2'));_0x50fd57[_0xb416('0x4a')]('c.email','Contact.email');_0x50fd57['field'](_0xb416('0xa3'),'Contact.phone');_0x50fd57[_0xb416('0x4a')](_0xb416('0xa4'),'Contact.mobile');_0x50fd57[_0xb416('0x4a')](_0xb416('0xa5'),_0xb416('0xa6'));_0x50fd57[_0xb416('0x4a')]('o.fullname',_0xb416('0xa7'));_0x50fd57['field'](_0xb416('0xa8'),'Owner.internal');_0x50fd57[_0xb416('0x4a')](_0xb416('0xa9'),_0xb416('0x35'));}if(_0x11a8a6['limit'])_0x50fd57[_0xb416('0x26')](_0x11a8a6[_0xb416('0x26')]);if(_0x11a8a6['offset'])_0x50fd57['offset'](_0x11a8a6[_0xb416('0x24')]);return db[_0xb416('0x99')]['query'](_0x50fd57[_0xb416('0x98')](),_0x3af0fa);})[_0xb416('0x2d')](function(_0x429a12){if(_0x429a12['length']>0x0)_0x22084f[_0xb416('0x79')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x429a12,'id'));return db['sequelize'][_0xb416('0x3f')](_0x22084f[_0xb416('0x98')](),_0x3af0fa)['then'](function(_0x5b325c){var _0x2524da=_[_0xb416('0xaa')](_0x5b325c,'OpenchannelInteractionId');var _0x533395=[];_0x429a12['forEach'](function(_0x4791aa){_0x533395[_0xb416('0xab')](updateOpenchannelInteraction(_0x4791aa,_0x36d825,_0x2524da));});return BPromise['all'](_0x533395);});});})['then'](function(_0x519d3c){_0x1b60bd[_0xb416('0xac')]=_0x519d3c;return _0x1b60bd;})[_0xb416('0x2d')](respondWithFilteredResult(_0x57b453,_0x11a8a6))[_0xb416('0x38')](handleError(_0x57b453,null));};exports[_0xb416('0xad')]=function(_0x509136,_0x1b8271){var _0x4f8ed4={};if(_0x509136[_0xb416('0x3f')][_0xb416('0x6b')]&&_0x509136['query'][_0xb416('0x6b')]===_0xb416('0x4b')){_0x4f8ed4[_0xb416('0x4b')]=_0x509136[_0xb416('0xae')]['id'];}else{_0x4f8ed4['id']=_0x509136[_0xb416('0xae')]['id'];}var _0x4422c1={'raw':![],'where':_0x4f8ed4},_0x4bc674={};_0x4bc674[_0xb416('0x3d')]=_[_0xb416('0x3e')](db['OpenchannelInteraction'][_0xb416('0x3b')]);_0x4bc674[_0xb416('0x3f')]=_[_0xb416('0x3e')](_0x509136[_0xb416('0x3f')]);_0x4bc674[_0xb416('0x40')]=_[_0xb416('0x41')](_0x4bc674[_0xb416('0x3d')],_0x4bc674[_0xb416('0x3f')]);_0x4422c1[_0xb416('0x42')]=_[_0xb416('0x41')](_0x4bc674[_0xb416('0x3d')],qs[_0xb416('0x43')](_0x509136[_0xb416('0x3f')][_0xb416('0x43')]));_0x4422c1['attributes']=_0x4422c1[_0xb416('0x42')][_0xb416('0x44')]?_0x4422c1[_0xb416('0x42')]:_0x4bc674[_0xb416('0x3d')];if(_0x509136[_0xb416('0x3f')][_0xb416('0xaf')]){_0x4422c1['include']=[{'all':!![]}];}_0x4422c1=_['merge']({},_0x4422c1,_0x509136['options']);return db[_0xb416('0x3a')][_0xb416('0x5f')](_0x4422c1)['then'](handleEntityNotFound(_0x1b8271,null))['then'](respondWithResult(_0x1b8271,null))['catch'](handleError(_0x1b8271,null));};exports['create']=function(_0x4764cf,_0x450aa5){return db[_0xb416('0x3a')][_0xb416('0xb0')](_0x4764cf[_0xb416('0x72')],{})[_0xb416('0x2d')](respondWithResult(_0x450aa5,0xc9))['catch'](handleError(_0x450aa5,null));};exports[_0xb416('0x2b')]=function(_0x4e1563,_0x33c9b3){if(_0x4e1563[_0xb416('0x72')]['id']){delete _0x4e1563[_0xb416('0x72')]['id'];}return db['OpenchannelInteraction'][_0xb416('0x5f')]({'where':{'id':_0x4e1563[_0xb416('0xae')]['id']}})['then'](handleEntityNotFound(_0x33c9b3,null))[_0xb416('0x2d')](saveUpdates(_0x4e1563[_0xb416('0x72')],null))[_0xb416('0x2d')](respondWithResult(_0x33c9b3,null))['catch'](handleError(_0x33c9b3,null));};exports[_0xb416('0x2c')]=function(_0x206127,_0x17ed2e){return db[_0xb416('0x3a')][_0xb416('0x5f')]({'where':{'id':_0x206127[_0xb416('0xae')]['id']}})[_0xb416('0x2d')](handleEntityNotFound(_0x17ed2e,null))[_0xb416('0x2d')](removeEntity(_0x17ed2e,null))[_0xb416('0x38')](handleError(_0x17ed2e,null));};exports[_0xb416('0xb1')]=function(_0x4ce050,_0x5161d7){return db[_0xb416('0x3a')][_0xb416('0xb1')]()['then'](respondWithResult(_0x5161d7,null))[_0xb416('0x38')](handleError(_0x5161d7,null));};exports[_0xb416('0xb2')]=function(_0x42ea76,_0x1f7e3a,_0x3bac10){return db['OpenchannelMessage'][_0xb416('0x5f')]({'where':{'id':_0x42ea76['params']['id']}})[_0xb416('0x2d')](handleEntityNotFound(_0x1f7e3a,null))[_0xb416('0x2d')](function(_0x2a6b32){if(_0x2a6b32){return _0x2a6b32['addMessage'](_0x42ea76['body']['ids'],_[_0xb416('0xb3')](_0x42ea76[_0xb416('0x72')],[_0xb416('0xb4'),'id'])||{});}})[_0xb416('0x2d')](respondWithResult(_0x1f7e3a,null))[_0xb416('0x38')](handleError(_0x1f7e3a,null));};exports['getMessages']=function(_0x1bc7aa,_0x19c6be,_0xe23f8){var _0x4db59e={'raw':![],'where':{}};var _0x32e178={};var _0x44dc9b={'count':0x0,'rows':[]};return db[_0xb416('0x3a')][_0xb416('0xb5')]({'where':{'id':_0x1bc7aa[_0xb416('0xae')]['id']}})[_0xb416('0x2d')](handleEntityNotFound(_0x19c6be,null))[_0xb416('0x2d')](function(_0x1ddc55){if(_0x1ddc55){_0x32e178[_0xb416('0x3d')]=_['keys'](db[_0xb416('0xb6')]['rawAttributes']);_0x32e178[_0xb416('0x3f')]=_[_0xb416('0x3e')](_0x1bc7aa['query']);_0x32e178['filters']=_[_0xb416('0x41')](_0x32e178['model'],_0x32e178[_0xb416('0x3f')]);_0x4db59e[_0xb416('0x42')]=_[_0xb416('0x41')](_0x32e178[_0xb416('0x3d')],qs[_0xb416('0x43')](_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x43')]));_0x4db59e[_0xb416('0x42')]=_0x4db59e['attributes'][_0xb416('0x44')]?_0x4db59e[_0xb416('0x42')]:_0x32e178[_0xb416('0x3d')];if(!_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x45')](_0xb416('0x46'))){_0x4db59e[_0xb416('0x26')]=qs[_0xb416('0x26')](_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x26')]);_0x4db59e[_0xb416('0x24')]=qs['offset'](_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x24')]);}_0x4db59e[_0xb416('0x47')]=qs[_0xb416('0x48')](_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x48')]);_0x4db59e[_0xb416('0x79')]=qs[_0xb416('0x40')](_['pick'](_0x1bc7aa[_0xb416('0x3f')],_0x32e178['filters']));_0x4db59e[_0xb416('0x79')][_0xb416('0xb7')]=_0x1ddc55['id'];if(_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x82')]){_0x4db59e[_0xb416('0x79')]=_['merge'](_0x4db59e[_0xb416('0x79')],{'$or':_[_0xb416('0x33')](_0x4db59e[_0xb416('0x42')],function(_0x292c80){var _0x309e82={};_0x309e82[_0x292c80]={'$like':'%'+_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x82')]+'%'};return _0x309e82;})});}if(_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x77')]){var _0x48f072=_0x1bc7aa[_0xb416('0x3f')]['$gte'][_0xb416('0x36')](',');var _0x566505={};_0x566505[_0x48f072[0x0]]={'$gte':moment(_0x48f072[0x1])[_0xb416('0xb8')](_0xb416('0xb9'))};_0x4db59e[_0xb416('0x79')]=_[_0xb416('0x9b')](_0x4db59e[_0xb416('0x79')],_0x566505);}_0x4db59e=_[_0xb416('0x9b')]({},_0x4db59e,_0x1bc7aa[_0xb416('0xba')]);return db[_0xb416('0xb6')][_0xb416('0x27')]({'where':_0x4db59e[_0xb416('0x79')]})[_0xb416('0x2d')](function(_0x1a2a7b){_0x44dc9b[_0xb416('0x27')]=_0x1a2a7b;if(_0x1bc7aa[_0xb416('0x3f')]['includeAll']){_0x4db59e['include']=[{'all':!![]}];}return db[_0xb416('0xb6')][_0xb416('0xbb')](_0x4db59e);})[_0xb416('0x2d')](function(_0x4d20fd){_0x44dc9b[_0xb416('0xac')]=_0x4d20fd;return _0x44dc9b;});}})['then'](respondWithFilteredResult(_0x19c6be,_0x4db59e))[_0xb416('0x38')](handleError(_0x19c6be,null));};exports['addTags']=function(_0x3d5504,_0x29df9b,_0x1d50b5){return db[_0xb416('0x3a')][_0xb416('0x5f')]({'where':{'id':_0x3d5504[_0xb416('0xae')]['id']}})['then'](handleEntityNotFound(_0x29df9b,null))[_0xb416('0x2d')](function(_0x198901){if(_0x198901){return _0x198901[_0xb416('0xbc')](_0x3d5504[_0xb416('0x72')][_0xb416('0xb4')],_[_0xb416('0xb3')](_0x3d5504[_0xb416('0x72')],[_0xb416('0xb4'),'id'])||{})[_0xb416('0xbd')](function(){return db['Tag'][_0xb416('0xbb')]({'attributes':['id','name',_0xb416('0xbe')],'where':{'id':_0x3d5504[_0xb416('0x72')][_0xb416('0xb4')]}});})[_0xb416('0x2d')](function(_0x4d5d44){socket[_0xb416('0xbf')](_0xb416('0xc0'),{'id':Number(_0x3d5504[_0xb416('0xae')]['id']),'tags':_0x4d5d44||[]});return{'id':Number(_0x3d5504['params']['id']),'tags':_0x4d5d44||[]};});}})[_0xb416('0x2d')](respondWithResult(_0x29df9b,null))[_0xb416('0x38')](handleError(_0x29df9b,null));};exports[_0xb416('0xc1')]=function(_0x2ae362,_0xfe31b1,_0xd9b563){return db[_0xb416('0x3a')][_0xb416('0x5f')]({'where':{'id':_0x2ae362['params']['id']}})[_0xb416('0x2d')](handleEntityNotFound(_0xfe31b1,null))[_0xb416('0x2d')](function(_0x586237){if(_0x586237){return _0x586237[_0xb416('0xc1')](_0x2ae362[_0xb416('0x3f')][_0xb416('0xb4')]);}})[_0xb416('0x2d')](respondWithStatusCode(_0xfe31b1,null))[_0xb416('0x38')](handleError(_0xfe31b1,null));};exports[_0xb416('0xc2')]=function(_0x3fe722,_0x5b1983){var _0x47cf14=moment()[_0xb416('0xc3')]()['toString']();var _0x5e3efc=path['join'](config[_0xb416('0xc4')],_0xb416('0xc5'),_0xb416('0xc6'),'tmp');var _0x119b9c=path[_0xb416('0xc7')](config[_0xb416('0xc4')],_0xb416('0xc5'),_0xb416('0xc6'),'attachments');var _0x4e870f=path[_0xb416('0xc7')](_0x5e3efc,_0x47cf14);var _0x3995a4=util[_0xb416('0xb8')]('transcript-%d-%s.zip',_0x3fe722[_0xb416('0xae')]['id'],_0x47cf14);var _0x30644e=path[_0xb416('0xc7')](_0x5e3efc,_0x3995a4);var _0x2cb85e=[];_0x2cb85e[_0xb416('0xab')]({'model':db['User'],'as':_0xb416('0x70'),'attributes':['id',_0xb416('0xc8')],'raw':!![]});_0x2cb85e[_0xb416('0xab')]({'model':db[_0xb416('0xc9')],'as':_0xb416('0x64'),'attributes':['id',_0xb416('0xca'),_0xb416('0xcb')],'raw':!![]});if(_0x3fe722['query'][_0xb416('0xcc')]){_0x2cb85e[_0xb416('0xab')]({'model':db[_0xb416('0xcd')],'as':_0xb416('0xcd'),'raw':!![]});}var _0xf53048=[{'model':db[_0xb416('0xb6')],'as':_0xb416('0xce'),'attributes':['id','body','createdAt','direction',_0xb416('0xcf'),_0xb416('0x7c')],'include':_0x2cb85e}];_0xf53048['push']({'model':db[_0xb416('0xd0')],'as':'Account','attributes':['id',_0xb416('0x30')]});_0xf53048[_0xb416('0xab')]({'model':db[_0xb416('0x70')],'as':'Owner','attributes':['id',_0xb416('0xc8')]});return db[_0xb416('0x3a')][_0xb416('0x5f')]({'where':{'id':_0x3fe722[_0xb416('0xae')]['id']},'include':_0xf53048})[_0xb416('0x2d')](handleEntityNotFound(_0x5b1983,null))['then'](function(_0x2d28f5){if(_0x2d28f5){var _0x14d5d8=_0x2d28f5['get']({'plain':!![]});fs['mkdirSync'](_0x4e870f);var _0x181c36={'channel':_0xb416('0xd1'),'account':_0x14d5d8[_0xb416('0xd2')][_0xb416('0x30')],'agent':_0x14d5d8[_0xb416('0xd3')]?_0x14d5d8[_0xb416('0xd3')][_0xb416('0xc8')]:_0xb416('0xd4'),'createdAt':moment(_0x14d5d8[_0xb416('0x76')])[_0xb416('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb416('0x98')](),'closedAt':_0x14d5d8[_0xb416('0xd5')]?moment(_0x14d5d8[_0xb416('0xd6')])[_0xb416('0xb8')](_0xb416('0xb9'))[_0xb416('0x98')]():'','disposition':_0x14d5d8[_0xb416('0xd7')],'visibility':_0x14d5d8[_0xb416('0xd8')]?_0xb416('0xd9'):_0xb416('0xda'),'messages':_(_0x14d5d8['Messages'])['filter']({'secret':![]})['map'](function(_0x5d60a9){if(_0x5d60a9[_0xb416('0xcd')]){var _0x187915=path[_0xb416('0xc7')](_0x119b9c,_0x5d60a9[_0xb416('0xcd')]['basename']);if(fs[_0xb416('0xdb')](_0x187915)){fs[_0xb416('0xdc')](_0x187915)[_0xb416('0xdd')](fs[_0xb416('0xde')](path[_0xb416('0xc7')](_0x4e870f,_0x5d60a9[_0xb416('0xcd')]['basename'])));}}return{'date':moment(_0x5d60a9[_0xb416('0x76')])[_0xb416('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb416('0x98')](),'sender':_0x5d60a9[_0xb416('0xdf')]===_0xb416('0xe0')?_0x5d60a9[_0xb416('0x70')]?_0x5d60a9[_0xb416('0x70')]['fullname']:_0xb416('0xe1'):_0x5d60a9['Contact'][_0xb416('0xca')]+(_0x5d60a9[_0xb416('0x64')][_0xb416('0xcb')]?'\x20'+_0x5d60a9['Contact'][_0xb416('0xcb')]:''),'body':_0x5d60a9[_0xb416('0xcd')]?_0x5d60a9[_0xb416('0xcd')]['basename']:_0x5d60a9[_0xb416('0x72')],'direction':_0x5d60a9[_0xb416('0xdf')]===_0xb416('0xe0')?'A':'C','secret':_0x5d60a9[_0xb416('0xcf')],'read':_0x5d60a9['read'],'attachment':_0x5d60a9[_0xb416('0xcd')]};})[_0xb416('0x61')]()};return ejs['renderFile'](path['join'](config['root'],_0xb416('0xc5'),_0xb416('0xe2'),_0xb416('0xe3')),{'interaction':_0x181c36})[_0xb416('0x2d')](function(_0x135094){var _0x3593f5=path[_0xb416('0xc7')](_0x4e870f,_0xb416('0xe4')+_0x14d5d8['id']+'-'+_0x47cf14+'.pdf');var _0x18fe72={'path':_0x3593f5,'channel':'Openchannel','interactionId':_0x14d5d8['id']};return pdf[_0xb416('0xe5')](_0x135094,_0x18fe72);})[_0xb416('0x2d')](function(){return new BPromise(function(_0x404cff,_0x260445){zipdir(_0x4e870f,{'saveTo':_0x30644e},function(_0x265b95,_0x3a7a4c){if(_0x265b95)return _0x260445(_0x265b95);return _0x404cff(_0x3a7a4c);});})[_0xb416('0x2d')](function(){return new BPromise(function(_0x4a69dc,_0x3396cc){rimraf(_0x4e870f,function(_0x316b80){if(_0x316b80)_0x3396cc(_0x316b80);return _0x4a69dc();});});})[_0xb416('0x2d')](function(){return _0x5b1983[_0xb416('0xc2')](_0x30644e,_0x3995a4,function(_0x586aad){if(_0x586aad){console[_0xb416('0xe6')](_0xb416('0xe7'),_0x586aad);}else{fs[_0xb416('0xe8')](_0x30644e);}});});});}else{return _0x5b1983['sendStatus'](0xc8);}})[_0xb416('0x38')](handleError(_0x5b1983,null));}; \ No newline at end of file +var _0x60f6=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','fullname','TagIds','Tags','forEach','index','OpenchannelInteraction','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20=\x200','Contact','operator','$substring','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','isEmpty','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','Contact.lastName','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','catch','params','rawAttributes','includeAll','options','create','body','update','destroy','addMessage','OpenchannelMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','emit','removeTags','download','unix','join','root','server','tmp','attachments','CmContact','firstName','Attachment','createdAt','direction','secret','Account','Owner','get','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','createWriteStream','out','System','lastName','renderFile','views','transcript-','.pdf','log','err','unlinkSync','eml-format'];(function(_0x487e84,_0x463808){var _0x11ee1f=function(_0x119e63){while(--_0x119e63){_0x487e84['push'](_0x487e84['shift']());}};_0x11ee1f(++_0x463808);}(_0x60f6,0xe3));var _0x660f=function(_0x3d7023,_0x42d120){_0x3d7023=_0x3d7023-0x0;var _0x5b9d9f=_0x60f6[_0x3d7023];return _0x5b9d9f;};'use strict';var emlformat=require(_0x660f('0x0'));var rimraf=require(_0x660f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x660f('0x2'));var rp=require(_0x660f('0x3'));var moment=require(_0x660f('0x4'));var BPromise=require(_0x660f('0x5'));var Mustache=require(_0x660f('0x6'));var util=require(_0x660f('0x7'));var path=require(_0x660f('0x8'));var sox=require(_0x660f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x660f('0xa'));var _=require(_0x660f('0xb'));var squel=require(_0x660f('0xc'));var crypto=require(_0x660f('0xd'));var jsforce=require(_0x660f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x660f('0xf'));var querystring=require('querystring');var Papa=require(_0x660f('0x10'));var Redis=require(_0x660f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x660f('0x12'));var as=require(_0x660f('0x13'));var pdf=require(_0x660f('0x14'));var hardwareService=require(_0x660f('0x15'));var logger=require('../../config/logger')(_0x660f('0x16'));var utils=require('../../config/utils');var config=require(_0x660f('0x17'));var licenseUtil=require(_0x660f('0x18'));var db=require(_0x660f('0x19'))['db'];config[_0x660f('0x1a')]=_[_0x660f('0x1b')](config['redis'],{'host':_0x660f('0x1c'),'port':0x18eb});var socket=require(_0x660f('0x1d'))(new Redis(config['redis']));require(_0x660f('0x1e'))[_0x660f('0x1f')](socket);function respondWithStatusCode(_0x147d3c,_0x4b4655){_0x4b4655=_0x4b4655||0xcc;return function(_0x3746e4){if(_0x3746e4){return _0x147d3c[_0x660f('0x20')](_0x4b4655);}return _0x147d3c[_0x660f('0x21')](_0x4b4655)[_0x660f('0x22')]();};}function respondWithResult(_0x3c5606,_0x394f09){_0x394f09=_0x394f09||0xc8;return function(_0x2d3f04){if(_0x2d3f04){return _0x3c5606[_0x660f('0x21')](_0x394f09)[_0x660f('0x23')](_0x2d3f04);}};}function respondWithFilteredResult(_0x5ed848,_0x38888a){return function(_0x2f7d37){if(_0x2f7d37){var _0x27b9ce=typeof _0x38888a[_0x660f('0x24')]===_0x660f('0x25')&&typeof _0x38888a[_0x660f('0x26')]==='undefined';var _0x14ca28=_0x2f7d37[_0x660f('0x27')];var _0x50fb53=_0x27b9ce?0x0:_0x38888a[_0x660f('0x24')];var _0x1267af=_0x27b9ce?_0x2f7d37['count']:_0x38888a[_0x660f('0x24')]+_0x38888a[_0x660f('0x26')];var _0x5c6f4b;if(_0x1267af>=_0x14ca28){_0x1267af=_0x14ca28;_0x5c6f4b=0xc8;}else{_0x5c6f4b=0xce;}_0x5ed848[_0x660f('0x21')](_0x5c6f4b);return _0x5ed848['set'](_0x660f('0x28'),_0x50fb53+'-'+_0x1267af+'/'+_0x14ca28)[_0x660f('0x23')](_0x2f7d37);}return null;};}function patchUpdates(_0x2a9817){return function(_0x318708){try{jsonpatch[_0x660f('0x29')](_0x318708,_0x2a9817,!![]);}catch(_0x2634dc){return BPromise[_0x660f('0x2a')](_0x2634dc);}return _0x318708[_0x660f('0x2b')]();};}function saveUpdates(_0x394d87,_0x1c2e4f){return function(_0x25c55f){if(_0x25c55f){return _0x25c55f['update'](_0x394d87)[_0x660f('0x2c')](function(_0x47beb7){return _0x47beb7;});}return null;};}function removeEntity(_0x5da042,_0x33f26e){return function(_0x13e19b){if(_0x13e19b){return _0x13e19b['destroy']()[_0x660f('0x2c')](function(){_0x5da042['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbbe0e0,_0x66f39f){return function(_0x110695){if(!_0x110695){_0xbbe0e0[_0x660f('0x20')](0x194);}return _0x110695;};}function handleError(_0x38634a,_0x229671){_0x229671=_0x229671||0x1f4;return function(_0x23f0fb){logger[_0x660f('0x2d')](_0x23f0fb[_0x660f('0x2e')]);if(_0x23f0fb[_0x660f('0x2f')]){delete _0x23f0fb[_0x660f('0x2f')];}_0x38634a[_0x660f('0x21')](_0x229671)[_0x660f('0x30')](_0x23f0fb);};}function getInteractionUsers(_0x25e3d4,_0x4f8dd0){return new BPromise(function(_0x297a01,_0x39f155){try{if(_0x4f8dd0[_0x25e3d4['id']]){_0x25e3d4['Users']=_['map'](_0x4f8dd0[_0x25e3d4['id']],function(_0x3edff8){return{'id':_0x3edff8['id'],'fullname':_0x3edff8[_0x660f('0x31')]};});}}catch(_0x2d41cf){_0x39f155(_0x2d41cf);}_0x297a01(_0x25e3d4);});}function getInteractionTags(_0xf89e4,_0x2b5d54){return new BPromise(function(_0x2a0e3f,_0x481d68){try{if(_0xf89e4[_0x660f('0x32')]){_0xf89e4[_0x660f('0x33')]=[];_0xf89e4[_0x660f('0x32')]['split'](',')[_0x660f('0x34')](function(_0x2bbb72){_0xf89e4[_0x660f('0x33')]['push'](_0x2b5d54[_0x2bbb72]);});}delete _0xf89e4['TagIds'];}catch(_0x1659e4){_0x481d68(_0x1659e4);}_0x2a0e3f(_0xf89e4);});}function updateOpenchannelInteraction(_0x8d95a3,_0x4de580,_0x3cddac){return new BPromise(function(_0x58e2bc,_0x40e76a){return getInteractionUsers(_0x8d95a3,_0x3cddac)[_0x660f('0x2c')](function(_0x37be3a){return getInteractionTags(_0x37be3a,_0x4de580);})[_0x660f('0x2c')](function(_0x565d68){_0x58e2bc(_0x565d68);})['catch'](function(_0x2559cb){_0x40e76a(_0x2559cb);});});}exports[_0x660f('0x35')]=function(_0x3f59af,_0x4a1b2d){var _0x278ca4={},_0x49a92d={},_0x5a8976={'count':0x0,'rows':[]};var _0x6c718a=_['map'](db[_0x660f('0x36')]['rawAttributes'],function(_0x1a185){return{'name':_0x1a185[_0x660f('0x37')],'type':_0x1a185[_0x660f('0x38')]['key']};});_0x49a92d[_0x660f('0x39')]=_[_0x660f('0x3a')](_0x6c718a,_0x660f('0x2f'));_0x49a92d[_0x660f('0x3b')]=_[_0x660f('0x3c')](_0x3f59af['query']);_0x49a92d[_0x660f('0x3d')]=_['intersection'](_0x49a92d[_0x660f('0x39')],_0x49a92d['query']);_0x278ca4[_0x660f('0x3e')]=_[_0x660f('0x3f')](_0x49a92d['model'],qs[_0x660f('0x40')](_0x3f59af[_0x660f('0x3b')][_0x660f('0x40')]));_0x278ca4[_0x660f('0x3e')]=_0x278ca4[_0x660f('0x3e')][_0x660f('0x41')]?_0x278ca4['attributes']:_0x49a92d['model'];if(!_0x3f59af[_0x660f('0x3b')][_0x660f('0x42')](_0x660f('0x43'))){_0x278ca4['limit']=qs[_0x660f('0x26')](_0x3f59af[_0x660f('0x3b')][_0x660f('0x26')]);_0x278ca4[_0x660f('0x24')]=qs[_0x660f('0x24')](_0x3f59af[_0x660f('0x3b')][_0x660f('0x24')]);}_0x278ca4['order']=qs['sort'](_0x3f59af[_0x660f('0x3b')][_0x660f('0x44')]);_0x278ca4[_0x660f('0x45')]=qs['filters'](_[_0x660f('0x46')](_0x3f59af[_0x660f('0x3b')],_0x49a92d[_0x660f('0x3d')]),_0x6c718a);var _0x2ee57b=[];var _0x1579ab=squel['select']()[_0x660f('0x47')]('id')['field'](_0x660f('0x2f'))['field']('color')[_0x660f('0x48')](_0x660f('0x49'));var _0x179351=squel[_0x660f('0x4a')]()['field'](_0x660f('0x4b'))[_0x660f('0x47')](_0x660f('0x4c'))[_0x660f('0x47')](_0x660f('0x4d'))[_0x660f('0x48')]('user_has_openchannel_interactions','ui')[_0x660f('0x4e')](_0x660f('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x4984c0=squel[_0x660f('0x4a')]()['from']('openchannel_interactions','i')[_0x660f('0x4e')](_0x660f('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x660f('0x4e')](_0x660f('0x4f'),'o',_0x660f('0x51'))[_0x660f('0x4e')]('openchannel_accounts','a',_0x660f('0x52'))['left_join']('openchannel_messages','me',_0x660f('0x53'))[_0x660f('0x4e')](_0x660f('0x54'),'it',_0x660f('0x55'))[_0x660f('0x4e')]('tools_tags','t',_0x660f('0x56'));var _0xb496b7=squel[_0x660f('0x57')]();var _0x587910=[];var _0x4c88a7=squel['expr']();var _0x423bba;if(_0x3f59af[_0x660f('0x3b')]['search']){_0x423bba=as[_0x660f('0x58')](_0x3f59af[_0x660f('0x3b')][_0x660f('0x59')]);var _0x3226e4=_0x423bba[_0x660f('0x5a')];for(var _0x223444=0x0;_0x223444<_0x423bba[_0x660f('0x5b')][_0x660f('0x41')];_0x223444++){var _0x231ffe=_0x423bba[_0x660f('0x5b')][_0x223444];var _0x5e299e='i';var _0x15d319=_[_0x660f('0x5c')](_0x6c718a,[_0x660f('0x2f'),_0x231ffe[_0x660f('0x47')]]);if(!_0x15d319){switch(_0x231ffe[_0x660f('0x47')]){case'unreadMessages':if(_0x231ffe[_0x660f('0x5d')]==0x1){_0x4984c0[_0x660f('0x5e')]('`'+_0x231ffe[_0x660f('0x47')]+_0x660f('0x5f'));}else{_0x4984c0[_0x660f('0x5e')]('`'+_0x231ffe[_0x660f('0x47')]+'`\x20>\x200');}break;case _0x660f('0x60'):if(_0x231ffe[_0x660f('0x61')]===_0x660f('0x62')){if(_0x231ffe['value'][_0x660f('0x63')]('\x20')[_0x660f('0x41')]>0x1){_0xb496b7[_0x3226e4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x660f('0x64')](_0x231ffe['value']),null);}else{var _0x558de0='%'+_0x231ffe[_0x660f('0x5d')]+'%';_0xb496b7[_0x3226e4](_0x660f('0x65'),_0x558de0,_0x558de0,_0x558de0);}}else{_0x15d319=_['find'](_0x6c718a,[_0x660f('0x2f'),_0x660f('0x66')]);_0x231ffe[_0x660f('0x47')]=_0x660f('0x66');_0x454833=as[_0x660f('0x67')](_0x5e299e,_0x15d319[_0x660f('0x38')],_0x231ffe);_0xb496b7[_0x3226e4](_0x454833[_0x660f('0x68')],_0x454833['value'][_0x660f('0x69')],_0x454833[_0x660f('0x5d')][_0x660f('0x22')]);}break;case _0x660f('0x6a'):var _0x2560b0=_0x231ffe[_0x660f('0x5d')][_0x660f('0x63')](',')[_0x660f('0x3a')](function(_0x4b50b4){return Number(_0x4b50b4);});_0x2560b0[_0x660f('0x34')](function(_0x2ad03e){_0x4c88a7['or'](_0x660f('0x6b'),'%,'+_0x2ad03e+',%');});_0x587910=_[_0x660f('0x6c')](_0x587910,_0x2560b0);break;case _0x660f('0x6d'):if(_0x231ffe[_0x660f('0x61')]===_0x660f('0x62')){_0xb496b7[_0x3226e4](_0x660f('0x6e'),'%'+_0x231ffe[_0x660f('0x5d')]+'%',null);}else{_0x15d319=_[_0x660f('0x5c')](_0x6c718a,[_0x660f('0x2f'),_0x660f('0x6f')]);_0x231ffe[_0x660f('0x47')]='UserId';_0x454833=as[_0x660f('0x67')](_0x5e299e,_0x15d319[_0x660f('0x38')],_0x231ffe);_0xb496b7[_0x3226e4](_0x454833[_0x660f('0x68')],_0x454833[_0x660f('0x5d')][_0x660f('0x69')],_0x454833[_0x660f('0x5d')][_0x660f('0x22')]);}break;case'body':_0x454833=as[_0x660f('0x67')]('me',null,_0x231ffe);_0xb496b7[_0x3226e4](_0x454833['text'],_0x454833[_0x660f('0x5d')][_0x660f('0x69')],_0x454833['value'][_0x660f('0x22')]);break;}}else{var _0x454833=as[_0x660f('0x67')](_0x5e299e,_0x15d319['type'],_0x231ffe);_0xb496b7[_0x3226e4](_0x454833['text'],_0x454833[_0x660f('0x5d')][_0x660f('0x69')],_0x454833[_0x660f('0x5d')][_0x660f('0x22')]);}}}else{var _0x4e3959=_(_0x3f59af[_0x660f('0x3b')])[_0x660f('0x3c')]()[_0x660f('0x3a')](function(_0x4bf9f4){return _[_0x660f('0x70')](_0x6c718a,['name',_0x4bf9f4])?_0x4bf9f4:undefined;})['compact']()[_0x660f('0x5d')]();if(!_['isEmpty'](_0x4e3959)){_0x4e3959[_0x660f('0x34')](function(_0x487783){if(_0x487783===_0x660f('0x71')){_0x4984c0[_0x660f('0x45')](_0x660f('0x72'),[][_0x660f('0x73')](_0x3f59af[_0x660f('0x3b')][_0x487783]));}else if(_0x487783==='createdAt'){var _0x268fce=JSON[_0x660f('0x74')](_0x3f59af[_0x660f('0x3b')][_0x487783])[_0x660f('0x75')];var _0x3fd1d6=JSON['parse'](_0x3f59af[_0x660f('0x3b')][_0x487783])[_0x660f('0x76')];_0x4984c0[_0x660f('0x45')](_0x660f('0x77'),_0x268fce,_0x3fd1d6);}else{if(_0x3f59af['query'][_0x487783]===_0x660f('0x78')){_0x4984c0[_0x660f('0x45')]('i.'+_0x487783+_0x660f('0x79'));}else{_0x4984c0[_0x660f('0x45')]('i.'+_0x487783+'\x20=\x20?',_0x3f59af['query'][_0x487783]);}}});}if(_0x3f59af['query']['read']){if(_0x3f59af[_0x660f('0x3b')][_0x660f('0x7a')]==0x1){_0x4984c0[_0x660f('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x4984c0[_0x660f('0x5e')](_0x660f('0x7b'));}}if(_0x3f59af['query']['tag']){_0x587910=_[_0x660f('0x7c')](_0x3f59af[_0x660f('0x3b')]['tag'])?_0x3f59af[_0x660f('0x3b')][_0x660f('0x7d')]:new Array(_0x3f59af['query']['tag']);_0x587910[_0x660f('0x34')](function(_0x108ead){_0x4c88a7['or'](_0x660f('0x6b'),'%,'+_0x108ead+',%');});}if(_0x3f59af['query'][_0x660f('0x7e')]){var _0x7f36af=_0x3f59af['query'][_0x660f('0x7e')][_0x660f('0x7f')]('\x5c','\x5c\x5c')[_0x660f('0x7f')](/'/g,'\x27\x27');if(qs[_0x660f('0x80')](_0x7f36af)){_0xb496b7['or']('i.id\x20LIKE\x20?',_0x7f36af+'%');}else{_0xb496b7['or'](_0x660f('0x81'),qs[_0x660f('0x64')](_0x7f36af))['or'](_0x660f('0x82'),_0x7f36af+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x7f36af+'%');}}}_0x4984c0[_0x660f('0x45')](_0xb496b7);_0x4984c0['group'](_0x660f('0x83'));var _0x285994={'type':db[_0x660f('0x84')][_0x660f('0x85')][_0x660f('0x86')],'raw':!![]};var _0x508b3d=_0x4984c0[_0x660f('0x87')]();_0x508b3d['field'](_0x660f('0x83'));_0x508b3d['field'](_0x660f('0x88'),_0x660f('0x89'));if(_0x278ca4[_0x660f('0x8a')]){_0x278ca4[_0x660f('0x8a')][_0x660f('0x34')](function(_0x3171b5){var _0x191d4a=_0x3171b5[0x0]===_0x660f('0x8b')?_0x3171b5[0x0]:'i.'+_0x3171b5[0x0];_0x4984c0[_0x660f('0x8a')](_0x191d4a,_0x3171b5[0x1]==='DESC'?![]:!![]);});}if(!_[_0x660f('0x8c')](_0x587910)){_0x4984c0[_0x660f('0x5e')](_0x4c88a7);_0x508b3d[_0x660f('0x45')]('t.id\x20IN\x20?',_0x587910);}BPromise['resolve']()['then'](function(){if(!_0x423bba){if(_0x3f59af[_0x660f('0x3b')][_0x660f('0x71')])return;_0x508b3d[_0x660f('0x45')](_0x660f('0x8d'));_0x4984c0[_0x660f('0x45')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3f59af[_0x660f('0x8e')]['role']!==_0x660f('0x8f'))return;return _0x3f59af[_0x660f('0x8e')][_0x660f('0x90')]({'attributes':['id'],'raw':!![]})[_0x660f('0x2c')](function(_0x4d8587){if(_[_0x660f('0x8c')](_0x4d8587)){_0x508b3d[_0x660f('0x45')](_0x660f('0x91'));_0x4984c0[_0x660f('0x45')](_0x660f('0x91'));}else{_0x508b3d['where'](_0x660f('0x72'),_[_0x660f('0x3a')](_0x4d8587,'id'));_0x4984c0[_0x660f('0x45')](_0x660f('0x72'),_[_0x660f('0x3a')](_0x4d8587,'id'));}});})[_0x660f('0x2c')](function(){if(_0x3f59af['user']['role']===_0x660f('0x8f')&&!_0x423bba&&!_0x3f59af['query'][_0x660f('0x71')])return[];return db[_0x660f('0x92')][_0x660f('0x3b')](_0x508b3d['toString'](),_0x285994);})[_0x660f('0x2c')](function(_0x371f9c){_0x5a8976[_0x660f('0x27')]=_0x371f9c[_0x660f('0x41')];if(_0x5a8976[_0x660f('0x27')]===0x0)return[];return db[_0x660f('0x92')]['query'](_0x1579ab[_0x660f('0x93')](),_0x285994)[_0x660f('0x2c')](function(_0x2f01f5){_0x2ee57b=_[_0x660f('0x94')](_0x2f01f5,'id');_0x285994=_[_0x660f('0x95')](_0x285994,{'model':db[_0x660f('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f59af[_0x660f('0x3b')][_0x660f('0x40')]){_0x278ca4[_0x660f('0x3e')]['forEach'](function(_0xb6ee60){_0x4984c0[_0x660f('0x47')]('i.'+_0xb6ee60);});}else{_0x4984c0[_0x660f('0x47')](_0x660f('0x88'),_0x660f('0x89'));_0x4984c0['field']('a.key','Account.key');_0x4984c0[_0x660f('0x47')](_0x660f('0x96'),_0x660f('0x97'));_0x4984c0[_0x660f('0x47')]('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',_0x660f('0x8b'));_0x4984c0[_0x660f('0x47')]('i.*');_0x4984c0[_0x660f('0x47')](_0x660f('0x98'),_0x660f('0x99'));_0x4984c0['field']('c.lastName',_0x660f('0x9a'));_0x4984c0[_0x660f('0x47')]('c.email','Contact.email');_0x4984c0[_0x660f('0x47')]('c.phone',_0x660f('0x9b'));_0x4984c0['field'](_0x660f('0x9c'),_0x660f('0x9d'));_0x4984c0[_0x660f('0x47')](_0x660f('0x9e'),_0x660f('0x9f'));_0x4984c0['field']('o.fullname','Owner.fullname');_0x4984c0[_0x660f('0x47')](_0x660f('0xa0'),_0x660f('0xa1'));_0x4984c0[_0x660f('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x660f('0x32'));}if(_0x278ca4['limit'])_0x4984c0[_0x660f('0x26')](_0x278ca4[_0x660f('0x26')]);if(_0x278ca4['offset'])_0x4984c0[_0x660f('0x24')](_0x278ca4['offset']);return db[_0x660f('0x92')][_0x660f('0x3b')](_0x4984c0[_0x660f('0x93')](),_0x285994);})[_0x660f('0x2c')](function(_0x3bd8da){if(_0x3bd8da[_0x660f('0x41')]>0x0)_0x179351[_0x660f('0x45')](_0x660f('0xa2'),_[_0x660f('0x3a')](_0x3bd8da,'id'));return db['sequelize'][_0x660f('0x3b')](_0x179351[_0x660f('0x93')](),_0x285994)[_0x660f('0x2c')](function(_0x5d3b20){var _0x1ea193=_[_0x660f('0xa3')](_0x5d3b20,_0x660f('0xa4'));var _0x3f8ee3=[];_0x3bd8da['forEach'](function(_0x110c46){_0x3f8ee3[_0x660f('0xa5')](updateOpenchannelInteraction(_0x110c46,_0x2ee57b,_0x1ea193));});return BPromise[_0x660f('0xa6')](_0x3f8ee3);});});})[_0x660f('0x2c')](function(_0x2f098e){_0x5a8976[_0x660f('0xa7')]=_0x2f098e;return _0x5a8976;})[_0x660f('0x2c')](respondWithFilteredResult(_0x4a1b2d,_0x278ca4))[_0x660f('0xa8')](handleError(_0x4a1b2d,null));};exports['show']=function(_0x2ff48e,_0x1f7973){var _0x40d783={};if(_0x2ff48e['query'][_0x660f('0x38')]&&_0x2ff48e['query'][_0x660f('0x38')]==='from'){_0x40d783[_0x660f('0x48')]=_0x2ff48e[_0x660f('0xa9')]['id'];}else{_0x40d783['id']=_0x2ff48e[_0x660f('0xa9')]['id'];}var _0x3a9895={'raw':![],'where':_0x40d783},_0x15065c={};_0x15065c['model']=_[_0x660f('0x3c')](db['OpenchannelInteraction'][_0x660f('0xaa')]);_0x15065c[_0x660f('0x3b')]=_[_0x660f('0x3c')](_0x2ff48e['query']);_0x15065c[_0x660f('0x3d')]=_['intersection'](_0x15065c[_0x660f('0x39')],_0x15065c[_0x660f('0x3b')]);_0x3a9895[_0x660f('0x3e')]=_[_0x660f('0x3f')](_0x15065c[_0x660f('0x39')],qs[_0x660f('0x40')](_0x2ff48e[_0x660f('0x3b')][_0x660f('0x40')]));_0x3a9895[_0x660f('0x3e')]=_0x3a9895[_0x660f('0x3e')]['length']?_0x3a9895[_0x660f('0x3e')]:_0x15065c[_0x660f('0x39')];if(_0x2ff48e[_0x660f('0x3b')][_0x660f('0xab')]){_0x3a9895['include']=[{'all':!![]}];}_0x3a9895=_[_0x660f('0x95')]({},_0x3a9895,_0x2ff48e[_0x660f('0xac')]);return db[_0x660f('0x36')]['find'](_0x3a9895)[_0x660f('0x2c')](handleEntityNotFound(_0x1f7973,null))[_0x660f('0x2c')](respondWithResult(_0x1f7973,null))['catch'](handleError(_0x1f7973,null));};exports[_0x660f('0xad')]=function(_0x3667b0,_0xd95987){return db['OpenchannelInteraction'][_0x660f('0xad')](_0x3667b0[_0x660f('0xae')],{})[_0x660f('0x2c')](respondWithResult(_0xd95987,0xc9))[_0x660f('0xa8')](handleError(_0xd95987,null));};exports[_0x660f('0xaf')]=function(_0x15e708,_0xe596f3){if(_0x15e708[_0x660f('0xae')]['id']){delete _0x15e708[_0x660f('0xae')]['id'];}return db[_0x660f('0x36')]['find']({'where':{'id':_0x15e708[_0x660f('0xa9')]['id']}})['then'](handleEntityNotFound(_0xe596f3,null))['then'](saveUpdates(_0x15e708['body'],null))['then'](respondWithResult(_0xe596f3,null))[_0x660f('0xa8')](handleError(_0xe596f3,null));};exports[_0x660f('0xb0')]=function(_0x53a343,_0x2d424f){return db[_0x660f('0x36')][_0x660f('0x5c')]({'where':{'id':_0x53a343['params']['id']}})[_0x660f('0x2c')](handleEntityNotFound(_0x2d424f,null))[_0x660f('0x2c')](removeEntity(_0x2d424f,null))[_0x660f('0xa8')](handleError(_0x2d424f,null));};exports['describe']=function(_0x374f36,_0x886a08){return db[_0x660f('0x36')]['describe']()['then'](respondWithResult(_0x886a08,null))[_0x660f('0xa8')](handleError(_0x886a08,null));};exports[_0x660f('0xb1')]=function(_0x369acd,_0x5dd800,_0x457377){return db[_0x660f('0xb2')]['find']({'where':{'id':_0x369acd[_0x660f('0xa9')]['id']}})[_0x660f('0x2c')](handleEntityNotFound(_0x5dd800,null))['then'](function(_0x15b40b){if(_0x15b40b){return _0x15b40b[_0x660f('0xb1')](_0x369acd[_0x660f('0xae')][_0x660f('0xb3')],_[_0x660f('0xb4')](_0x369acd[_0x660f('0xae')],[_0x660f('0xb3'),'id'])||{});}})['then'](respondWithResult(_0x5dd800,null))[_0x660f('0xa8')](handleError(_0x5dd800,null));};exports[_0x660f('0xb5')]=function(_0xd901fb,_0x149609,_0x80565f){var _0x5b3f18={'raw':![],'where':{}};var _0x150ee3={};var _0xe9b7f0={'count':0x0,'rows':[]};return db[_0x660f('0x36')]['findOne']({'where':{'id':_0xd901fb[_0x660f('0xa9')]['id']}})[_0x660f('0x2c')](handleEntityNotFound(_0x149609,null))['then'](function(_0x3cae9c){if(_0x3cae9c){_0x150ee3[_0x660f('0x39')]=_[_0x660f('0x3c')](db[_0x660f('0xb2')][_0x660f('0xaa')]);_0x150ee3['query']=_[_0x660f('0x3c')](_0xd901fb[_0x660f('0x3b')]);_0x150ee3[_0x660f('0x3d')]=_['intersection'](_0x150ee3[_0x660f('0x39')],_0x150ee3['query']);_0x5b3f18[_0x660f('0x3e')]=_[_0x660f('0x3f')](_0x150ee3['model'],qs[_0x660f('0x40')](_0xd901fb[_0x660f('0x3b')][_0x660f('0x40')]));_0x5b3f18['attributes']=_0x5b3f18[_0x660f('0x3e')][_0x660f('0x41')]?_0x5b3f18[_0x660f('0x3e')]:_0x150ee3[_0x660f('0x39')];if(!_0xd901fb[_0x660f('0x3b')][_0x660f('0x42')](_0x660f('0x43'))){_0x5b3f18[_0x660f('0x26')]=qs[_0x660f('0x26')](_0xd901fb['query'][_0x660f('0x26')]);_0x5b3f18[_0x660f('0x24')]=qs[_0x660f('0x24')](_0xd901fb[_0x660f('0x3b')]['offset']);}_0x5b3f18[_0x660f('0x8a')]=qs[_0x660f('0x44')](_0xd901fb[_0x660f('0x3b')][_0x660f('0x44')]);_0x5b3f18['where']=qs['filters'](_[_0x660f('0x46')](_0xd901fb[_0x660f('0x3b')],_0x150ee3[_0x660f('0x3d')]));_0x5b3f18[_0x660f('0x45')][_0x660f('0xa4')]=_0x3cae9c['id'];if(_0xd901fb[_0x660f('0x3b')][_0x660f('0x7e')]){_0x5b3f18[_0x660f('0x45')]=_[_0x660f('0x95')](_0x5b3f18[_0x660f('0x45')],{'$or':_[_0x660f('0x3a')](_0x5b3f18[_0x660f('0x3e')],function(_0x52ffe4){var _0xf11e58={};_0xf11e58[_0x52ffe4]={'$like':'%'+_0xd901fb[_0x660f('0x3b')][_0x660f('0x7e')]+'%'};return _0xf11e58;})});}if(_0xd901fb[_0x660f('0x3b')][_0x660f('0x75')]){var _0x50f874=_0xd901fb[_0x660f('0x3b')][_0x660f('0x75')][_0x660f('0x63')](',');var _0x1c110b={};_0x1c110b[_0x50f874[0x0]]={'$gte':moment(_0x50f874[0x1])[_0x660f('0xb6')](_0x660f('0xb7'))};_0x5b3f18[_0x660f('0x45')]=_['merge'](_0x5b3f18[_0x660f('0x45')],_0x1c110b);}_0x5b3f18=_[_0x660f('0x95')]({},_0x5b3f18,_0xd901fb[_0x660f('0xac')]);return db[_0x660f('0xb2')][_0x660f('0x27')]({'where':_0x5b3f18[_0x660f('0x45')]})['then'](function(_0x433eb5){_0xe9b7f0[_0x660f('0x27')]=_0x433eb5;if(_0xd901fb[_0x660f('0x3b')][_0x660f('0xab')]){_0x5b3f18[_0x660f('0xb8')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x5b3f18);})[_0x660f('0x2c')](function(_0x2f7483){_0xe9b7f0[_0x660f('0xa7')]=_0x2f7483;return _0xe9b7f0;});}})[_0x660f('0x2c')](respondWithFilteredResult(_0x149609,_0x5b3f18))[_0x660f('0xa8')](handleError(_0x149609,null));};exports[_0x660f('0xb9')]=function(_0x3e3a22,_0x5337a4,_0x34a7e3){return db['OpenchannelInteraction'][_0x660f('0x5c')]({'where':{'id':_0x3e3a22['params']['id']}})['then'](handleEntityNotFound(_0x5337a4,null))[_0x660f('0x2c')](function(_0x410a34){if(_0x410a34){return _0x410a34[_0x660f('0xba')](_0x3e3a22[_0x660f('0xae')][_0x660f('0xb3')],_[_0x660f('0xb4')](_0x3e3a22[_0x660f('0xae')],[_0x660f('0xb3'),'id'])||{})['spread'](function(){return db[_0x660f('0x6a')]['findAll']({'attributes':['id',_0x660f('0x2f'),'color'],'where':{'id':_0x3e3a22['body'][_0x660f('0xb3')]}});})['then'](function(_0x4c261c){socket[_0x660f('0xbb')]('openchannelInteractionTags:save',{'id':Number(_0x3e3a22[_0x660f('0xa9')]['id']),'tags':_0x4c261c||[]});return{'id':Number(_0x3e3a22[_0x660f('0xa9')]['id']),'tags':_0x4c261c||[]};});}})['then'](respondWithResult(_0x5337a4,null))[_0x660f('0xa8')](handleError(_0x5337a4,null));};exports[_0x660f('0xbc')]=function(_0x2e249b,_0xad9ac6,_0x1ed58f){return db[_0x660f('0x36')][_0x660f('0x5c')]({'where':{'id':_0x2e249b[_0x660f('0xa9')]['id']}})[_0x660f('0x2c')](handleEntityNotFound(_0xad9ac6,null))[_0x660f('0x2c')](function(_0x5708ca){if(_0x5708ca){return _0x5708ca[_0x660f('0xbc')](_0x2e249b['query'][_0x660f('0xb3')]);}})[_0x660f('0x2c')](respondWithStatusCode(_0xad9ac6,null))[_0x660f('0xa8')](handleError(_0xad9ac6,null));};exports[_0x660f('0xbd')]=function(_0x301888,_0x3d2996){var _0x280afa=moment()[_0x660f('0xbe')]()['toString']();var _0x3f5465=path[_0x660f('0xbf')](config[_0x660f('0xc0')],_0x660f('0xc1'),'files',_0x660f('0xc2'));var _0x485c40=path['join'](config['root'],_0x660f('0xc1'),'files',_0x660f('0xc3'));var _0x39803f=path[_0x660f('0xbf')](_0x3f5465,_0x280afa);var _0x184fc7=util['format']('transcript-%d-%s.zip',_0x301888['params']['id'],_0x280afa);var _0x97662=path[_0x660f('0xbf')](_0x3f5465,_0x184fc7);var _0x2a6725=[];_0x2a6725[_0x660f('0xa5')]({'model':db[_0x660f('0x6d')],'as':_0x660f('0x6d'),'attributes':['id','fullname'],'raw':!![]});_0x2a6725[_0x660f('0xa5')]({'model':db[_0x660f('0xc4')],'as':'Contact','attributes':['id',_0x660f('0xc5'),'lastName'],'raw':!![]});if(_0x301888['query'][_0x660f('0xc3')]){_0x2a6725[_0x660f('0xa5')]({'model':db[_0x660f('0xc6')],'as':_0x660f('0xc6'),'raw':!![]});}var _0x4258fd=[{'model':db[_0x660f('0xb2')],'as':'Messages','attributes':['id',_0x660f('0xae'),_0x660f('0xc7'),_0x660f('0xc8'),_0x660f('0xc9'),_0x660f('0x7a')],'include':_0x2a6725}];_0x4258fd[_0x660f('0xa5')]({'model':db['OpenchannelAccount'],'as':_0x660f('0xca'),'attributes':['id',_0x660f('0x2f')]});_0x4258fd[_0x660f('0xa5')]({'model':db[_0x660f('0x6d')],'as':_0x660f('0xcb'),'attributes':['id',_0x660f('0x31')]});return db['OpenchannelInteraction'][_0x660f('0x5c')]({'where':{'id':_0x301888[_0x660f('0xa9')]['id']},'include':_0x4258fd})[_0x660f('0x2c')](handleEntityNotFound(_0x3d2996,null))['then'](function(_0xee1129){if(_0xee1129){var _0x3502e7=_0xee1129[_0x660f('0xcc')]({'plain':!![]});fs['mkdirSync'](_0x39803f);var _0x5d3935={'channel':_0x660f('0xcd'),'account':_0x3502e7[_0x660f('0xca')][_0x660f('0x2f')],'agent':_0x3502e7['Owner']?_0x3502e7[_0x660f('0xcb')]['fullname']:_0x660f('0xce'),'createdAt':moment(_0x3502e7['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x3502e7[_0x660f('0xcf')]?moment(_0x3502e7[_0x660f('0xd0')])['format'](_0x660f('0xb7'))['toString']():'','disposition':_0x3502e7[_0x660f('0xd1')],'visibility':_0x3502e7[_0x660f('0xd2')]?_0x660f('0xd3'):_0x660f('0xd4'),'messages':_(_0x3502e7[_0x660f('0xd5')])[_0x660f('0x7e')]({'secret':![]})['map'](function(_0x5d426f){if(_0x5d426f['Attachment']){var _0x53213c=path[_0x660f('0xbf')](_0x485c40,_0x5d426f[_0x660f('0xc6')][_0x660f('0xd6')]);if(fs[_0x660f('0xd7')](_0x53213c)){fs[_0x660f('0xd8')](_0x53213c)['pipe'](fs[_0x660f('0xd9')](path[_0x660f('0xbf')](_0x39803f,_0x5d426f[_0x660f('0xc6')]['basename'])));}}return{'date':moment(_0x5d426f[_0x660f('0xc7')])['format'](_0x660f('0xb7'))[_0x660f('0x93')](),'sender':_0x5d426f[_0x660f('0xc8')]===_0x660f('0xda')?_0x5d426f['User']?_0x5d426f[_0x660f('0x6d')]['fullname']:_0x660f('0xdb'):_0x5d426f[_0x660f('0x60')]['firstName']+(_0x5d426f[_0x660f('0x60')]['lastName']?'\x20'+_0x5d426f['Contact'][_0x660f('0xdc')]:''),'body':_0x5d426f[_0x660f('0xc6')]?_0x5d426f['Attachment'][_0x660f('0xd6')]:_0x5d426f[_0x660f('0xae')],'direction':_0x5d426f[_0x660f('0xc8')]===_0x660f('0xda')?'A':'C','secret':_0x5d426f[_0x660f('0xc9')],'read':_0x5d426f[_0x660f('0x7a')],'attachment':_0x5d426f[_0x660f('0xc6')]};})[_0x660f('0x5d')]()};return ejs[_0x660f('0xdd')](path[_0x660f('0xbf')](config[_0x660f('0xc0')],_0x660f('0xc1'),_0x660f('0xde'),'downloadInteraction.ejs'),{'interaction':_0x5d3935})['then'](function(_0x54f122){var _0x512833=path[_0x660f('0xbf')](_0x39803f,_0x660f('0xdf')+_0x3502e7['id']+'-'+_0x280afa+_0x660f('0xe0'));var _0x33aece={'path':_0x512833,'channel':'Openchannel','interactionId':_0x3502e7['id']};return pdf['createPdfFromHTML'](_0x54f122,_0x33aece);})['then'](function(){return new BPromise(function(_0x12f3ab,_0x4d308d){zipdir(_0x39803f,{'saveTo':_0x97662},function(_0x3b45d7,_0x1e9dae){if(_0x3b45d7)return _0x4d308d(_0x3b45d7);return _0x12f3ab(_0x1e9dae);});})['then'](function(){return new BPromise(function(_0x47e67a,_0x161a2a){rimraf(_0x39803f,function(_0x52e750){if(_0x52e750)_0x161a2a(_0x52e750);return _0x47e67a();});});})['then'](function(){return _0x3d2996[_0x660f('0xbd')](_0x97662,_0x184fc7,function(_0xe5b652){if(_0xe5b652){console[_0x660f('0xe1')](_0x660f('0xe2'),_0xe5b652);}else{fs[_0x660f('0xe3')](_0x97662);}});});});}else{return _0x3d2996[_0x660f('0x20')](0xc8);}})[_0x660f('0xa8')](handleError(_0x3d2996,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 48f72a0..a7fa5c6 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 _0x72da=['hasOwnProperty','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','getUsers','setDataValue','Users','map','findAll','emit','catch'];(function(_0x2e3187,_0x3f2412){var _0x163bcb=function(_0x4ebdc5){while(--_0x4ebdc5){_0x2e3187['push'](_0x2e3187['shift']());}};_0x163bcb(++_0x3f2412);}(_0x72da,0x189));var _0xa72d=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x72da[_0x152678];return _0x311a9;};'use strict';var EventEmitter=require(_0xa72d('0x0'));var OpenchannelInteraction=require(_0xa72d('0x1'))['db'][_0xa72d('0x2')];var OpenchannelMessage=require(_0xa72d('0x1'))['db'][_0xa72d('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xa72d('0x4')](0x0);var events={'afterCreate':_0xa72d('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c2aa9){return function(_0x244bf7,_0x11f9ae,_0x53ed8c){_0x244bf7[_0xa72d('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x170e3d){_0x244bf7[_0xa72d('0x7')](_0xa72d('0x8'),_0x170e3d[_0xa72d('0x9')](function(_0x20d9fc){return{'id':_0x20d9fc['id']};}));return OpenchannelMessage[_0xa72d('0xa')]({'where':{'OpenchannelInteractionId':_0x244bf7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x47045d){_0x244bf7[_0xa72d('0x7')]('unreadMessages',_0x47045d['length']);OpenchannelInteractionEvents[_0xa72d('0xb')](_0x1c2aa9+':'+_0x244bf7['id'],_0x244bf7);OpenchannelInteractionEvents[_0xa72d('0xb')](_0x1c2aa9,_0x244bf7);_0x53ed8c(null);})[_0xa72d('0xc')](_0x53ed8c(null));};}for(var e in events){if(events[_0xa72d('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x88f1=['hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x5a3d49,_0x24b21a){var _0x4d5c23=function(_0x4f62b0){while(--_0x4f62b0){_0x5a3d49['push'](_0x5a3d49['shift']());}};_0x4d5c23(++_0x24b21a);}(_0x88f1,0x1a4));var _0x188f=function(_0x21c09c,_0x2a4240){_0x21c09c=_0x21c09c-0x0;var _0x372dc1=_0x88f1[_0x21c09c];return _0x372dc1;};'use strict';var EventEmitter=require(_0x188f('0x0'));var OpenchannelInteraction=require(_0x188f('0x1'))['db'][_0x188f('0x2')];var OpenchannelMessage=require(_0x188f('0x1'))['db'][_0x188f('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x188f('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x188f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2206c8){return function(_0x3cc456,_0x178e90,_0x55e297){_0x3cc456[_0x188f('0x6')]({'attributes':['id'],'raw':!![]})[_0x188f('0x7')](function(_0x3c1169){_0x3cc456['setDataValue'](_0x188f('0x8'),_0x3c1169[_0x188f('0x9')](function(_0x3dca1b){return{'id':_0x3dca1b['id']};}));return OpenchannelMessage[_0x188f('0xa')]({'where':{'OpenchannelInteractionId':_0x3cc456['id'],'direction':'in','read':![]},'raw':!![]});})[_0x188f('0x7')](function(_0x1c30f7){_0x3cc456[_0x188f('0xb')](_0x188f('0xc'),_0x1c30f7[_0x188f('0xd')]);OpenchannelInteractionEvents['emit'](_0x2206c8+':'+_0x3cc456['id'],_0x3cc456);OpenchannelInteractionEvents[_0x188f('0xe')](_0x2206c8,_0x3cc456);_0x55e297(null);})[_0x188f('0xf')](_0x55e297(null));};}for(var e in events){if(events[_0x188f('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x188f('0x11')](e,emitEvent(event));}}module[_0x188f('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index f6e5cd8..ca19e89 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 _0x9a96=['define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x9a96,0xd0));var _0x69a9=function(_0x55c374,_0x38cffb){_0x55c374=_0x55c374-0x0;var _0x5aa9d2=_0x9a96[_0x55c374];return _0x5aa9d2;};'use strict';var _=require(_0x69a9('0x0'));var util=require(_0x69a9('0x1'));var logger=require(_0x69a9('0x2'))(_0x69a9('0x3'));var moment=require(_0x69a9('0x4'));var BPromise=require(_0x69a9('0x5'));var rp=require(_0x69a9('0x6'));var fs=require('fs');var path=require(_0x69a9('0x7'));var rimraf=require(_0x69a9('0x8'));var config=require(_0x69a9('0x9'));var attributes=require(_0x69a9('0xa'));module[_0x69a9('0xb')]=function(_0x5a48bf,_0x245072){return _0x5a48bf[_0x69a9('0xc')](_0x69a9('0xd'),attributes,{'tableName':_0x69a9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x69a9('0xf'),'hooks':{'beforeUpdate':function(_0x2f4be6,_0x357e7b,_0x2587ef){if(_0x2f4be6[_0x69a9('0x10')](_0x69a9('0x11'))){_0x2f4be6[_0x69a9('0x12')]=moment()['format'](_0x69a9('0x13'));}_0x2587ef(null,_0x2f4be6);}}});}; \ No newline at end of file +var _0xd20d=['request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd20d,0x13a));var _0xdd20=function(_0x5554bd,_0x146451){_0x5554bd=_0x5554bd-0x0;var _0x8dffee=_0xd20d[_0x5554bd];return _0x8dffee;};'use strict';var _=require(_0xdd20('0x0'));var util=require(_0xdd20('0x1'));var logger=require(_0xdd20('0x2'))(_0xdd20('0x3'));var moment=require(_0xdd20('0x4'));var BPromise=require(_0xdd20('0x5'));var rp=require(_0xdd20('0x6'));var fs=require('fs');var path=require(_0xdd20('0x7'));var rimraf=require(_0xdd20('0x8'));var config=require(_0xdd20('0x9'));var attributes=require(_0xdd20('0xa'));module[_0xdd20('0xb')]=function(_0x493bf7,_0x2e2981){return _0x493bf7[_0xdd20('0xc')]('OpenchannelInteraction',attributes,{'tableName':_0xdd20('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdd20('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4ae781,_0x4e1665,_0x458d57){if(_0x4ae781[_0xdd20('0xf')](_0xdd20('0x10'))){_0x4ae781[_0xdd20('0x11')]=moment()[_0xdd20('0x12')](_0xdd20('0x13'));}_0x458d57(null,_0x4ae781);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 77d6c8d..a78b180 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 _0x0509=['http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','limit','debug','AddTagsToOpenchannelInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x35fc19,_0x4d538f){var _0x52233f=function(_0x46f60b){while(--_0x46f60b){_0x35fc19['push'](_0x35fc19['shift']());}};_0x52233f(++_0x4d538f);}(_0x0509,0x1e2));var _0x9050=function(_0x4ed239,_0x3bb2d8){_0x4ed239=_0x4ed239-0x0;var _0x19b898=_0x0509[_0x4ed239];return _0x19b898;};'use strict';var _=require(_0x9050('0x0'));var util=require(_0x9050('0x1'));var moment=require(_0x9050('0x2'));var BPromise=require(_0x9050('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9050('0x4'))['db'];var utils=require(_0x9050('0x5'));var logger=require(_0x9050('0x6'))('rpc');var config=require(_0x9050('0x7'));var jayson=require(_0x9050('0x8'));var client=jayson[_0x9050('0x9')][_0x9050('0xa')]({'port':0x232a});config[_0x9050('0xb')]=_[_0x9050('0xc')](config['redis'],{'host':_0x9050('0xd'),'port':0x18eb});var socket=require(_0x9050('0xe'))(new Redis(config[_0x9050('0xb')]));require(_0x9050('0xf'))[_0x9050('0x10')](socket);function respondWithRpcPromise(_0x12245f,_0x61ec9b,_0x31afb3){return new BPromise(function(_0x291c8f,_0x3e0a47){return client['request'](_0x12245f,_0x31afb3)[_0x9050('0x11')](function(_0x54ab78){logger[_0x9050('0x12')](_0x9050('0x13'),_0x61ec9b,_0x9050('0x14'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x61ec9b,_0x9050('0x14'),JSON[_0x9050('0x15')](_0x54ab78));if(_0x54ab78[_0x9050('0x16')]){if(_0x54ab78[_0x9050('0x16')][_0x9050('0x17')]===0x1f4){logger[_0x9050('0x16')](_0x9050('0x13'),_0x61ec9b,_0x54ab78[_0x9050('0x16')]['message']);return _0x3e0a47(_0x54ab78[_0x9050('0x16')][_0x9050('0x18')]);}logger['error'](_0x9050('0x13'),_0x61ec9b,_0x54ab78['error'][_0x9050('0x18')]);return _0x291c8f(_0x54ab78[_0x9050('0x16')][_0x9050('0x18')]);}else{logger[_0x9050('0x12')](_0x9050('0x13'),_0x61ec9b,_0x9050('0x14'));_0x291c8f(_0x54ab78['result'][_0x9050('0x18')]);}})[_0x9050('0x19')](function(_0x51db73){logger[_0x9050('0x16')](_0x9050('0x13'),_0x61ec9b,_0x51db73);_0x3e0a47(_0x51db73);});});}exports[_0x9050('0x1a')]=function(_0x3c9c48){var _0x3c52a9=this;return new Promise(function(_0x4560c7,_0xc684a0){return db[_0x9050('0x1b')][_0x9050('0x1c')](_0x3c9c48[_0x9050('0x1d')],{'raw':_0x3c9c48[_0x9050('0x1e')]?_0x3c9c48[_0x9050('0x1e')][_0x9050('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c9c48['options']?_0x3c9c48[_0x9050('0x1e')]['where']||null:null,'attributes':_0x3c9c48[_0x9050('0x1e')]?_0x3c9c48[_0x9050('0x1e')]['attributes']||null:null,'limit':_0x3c9c48[_0x9050('0x1e')]?_0x3c9c48[_0x9050('0x1e')][_0x9050('0x20')]||null:null})[_0x9050('0x11')](function(_0xb8f399){logger[_0x9050('0x12')]('UpdateOpenchannelInteraction',_0x3c9c48);logger[_0x9050('0x21')](_0x9050('0x1a'),_0x3c9c48,JSON['stringify'](_0xb8f399));_0x4560c7(_0xb8f399);})[_0x9050('0x19')](function(_0x48487a){logger[_0x9050('0x16')](_0x9050('0x1a'),_0x48487a[_0x9050('0x18')],_0x3c9c48);_0xc684a0(_0x3c52a9['error'](0x1f4,_0x48487a[_0x9050('0x18')]));});});};exports[_0x9050('0x22')]=function(_0x16f776){return new Promise(function(_0x5f7f94,_0x3b28bd){return db[_0x9050('0x1b')][_0x9050('0x23')]({'where':_0x16f776[_0x9050('0x1e')]?_0x16f776['options'][_0x9050('0x24')]||null:null})[_0x9050('0x11')](function(_0x42caa8){if(_0x42caa8){return _0x42caa8[_0x9050('0x25')](_0x16f776['body'][_0x9050('0x26')],_['omit'](_0x16f776[_0x9050('0x1d')],[_0x9050('0x26'),'id'])||{});}})[_0x9050('0x27')](function(_0x23abc0){logger[_0x9050('0x12')]('AddTags',_0x16f776);logger[_0x9050('0x21')](_0x9050('0x28'),_0x16f776,JSON[_0x9050('0x15')](_0x23abc0));_0x5f7f94(_0x23abc0);})[_0x9050('0x19')](function(_0x383079){logger[_0x9050('0x16')](_0x9050('0x28'),_0x383079[_0x9050('0x18')],_0x16f776);_0x3b28bd(_this[_0x9050('0x16')](0x1f4,_0x383079[_0x9050('0x18')]));});});}; \ No newline at end of file +var _0xd7d3=['options','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','where','then','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelInteraction','update','body'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xd7d3,0x1a6));var _0x3d7d=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0xd7d3[_0x381372];return _0x4e959a;};'use strict';var _=require(_0x3d7d('0x0'));var util=require(_0x3d7d('0x1'));var moment=require('moment');var BPromise=require(_0x3d7d('0x2'));var rs=require(_0x3d7d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3d7d('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3d7d('0x5'));var client=jayson[_0x3d7d('0x6')][_0x3d7d('0x7')]({'port':0x232a});config[_0x3d7d('0x8')]=_[_0x3d7d('0x9')](config[_0x3d7d('0x8')],{'host':_0x3d7d('0xa'),'port':0x18eb});var socket=require(_0x3d7d('0xb'))(new Redis(config[_0x3d7d('0x8')]));require(_0x3d7d('0xc'))[_0x3d7d('0xd')](socket);function respondWithRpcPromise(_0x48761b,_0x50a754,_0x2556a6){return new BPromise(function(_0x48020c,_0xcf2dbf){return client[_0x3d7d('0xe')](_0x48761b,_0x2556a6)['then'](function(_0x4d3862){logger[_0x3d7d('0xf')](_0x3d7d('0x10'),_0x50a754,_0x3d7d('0x11'));logger[_0x3d7d('0x12')](_0x3d7d('0x13'),_0x50a754,'request\x20sent',JSON[_0x3d7d('0x14')](_0x4d3862));if(_0x4d3862[_0x3d7d('0x15')]){if(_0x4d3862['error'][_0x3d7d('0x16')]===0x1f4){logger[_0x3d7d('0x15')](_0x3d7d('0x10'),_0x50a754,_0x4d3862['error'][_0x3d7d('0x17')]);return _0xcf2dbf(_0x4d3862[_0x3d7d('0x15')]['message']);}logger[_0x3d7d('0x15')](_0x3d7d('0x10'),_0x50a754,_0x4d3862[_0x3d7d('0x15')][_0x3d7d('0x17')]);return _0x48020c(_0x4d3862[_0x3d7d('0x15')]['message']);}else{logger[_0x3d7d('0xf')](_0x3d7d('0x10'),_0x50a754,'request\x20sent');_0x48020c(_0x4d3862[_0x3d7d('0x18')][_0x3d7d('0x17')]);}})[_0x3d7d('0x19')](function(_0x2fb972){logger[_0x3d7d('0x15')](_0x3d7d('0x10'),_0x50a754,_0x2fb972);_0xcf2dbf(_0x2fb972);});});}exports['UpdateOpenchannelInteraction']=function(_0x3fd468){var _0x1d9074=this;return new Promise(function(_0x33dfe7,_0x53e501){return db[_0x3d7d('0x1a')][_0x3d7d('0x1b')](_0x3fd468[_0x3d7d('0x1c')],{'raw':_0x3fd468[_0x3d7d('0x1d')]?_0x3fd468[_0x3d7d('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fd468['options']?_0x3fd468[_0x3d7d('0x1d')]['where']||null:null,'attributes':_0x3fd468['options']?_0x3fd468[_0x3d7d('0x1d')][_0x3d7d('0x1e')]||null:null,'limit':_0x3fd468[_0x3d7d('0x1d')]?_0x3fd468[_0x3d7d('0x1d')][_0x3d7d('0x1f')]||null:null})['then'](function(_0x27fd1e){logger['info'](_0x3d7d('0x20'),_0x3fd468);logger[_0x3d7d('0x12')](_0x3d7d('0x20'),_0x3fd468,JSON[_0x3d7d('0x14')](_0x27fd1e));_0x33dfe7(_0x27fd1e);})[_0x3d7d('0x19')](function(_0x3e878b){logger[_0x3d7d('0x15')](_0x3d7d('0x20'),_0x3e878b[_0x3d7d('0x17')],_0x3fd468);_0x53e501(_0x1d9074[_0x3d7d('0x15')](0x1f4,_0x3e878b[_0x3d7d('0x17')]));});});};exports[_0x3d7d('0x21')]=function(_0x63921f){return new Promise(function(_0x41f89c,_0x587dc6){return db['OpenchannelInteraction']['find']({'where':_0x63921f[_0x3d7d('0x1d')]?_0x63921f[_0x3d7d('0x1d')][_0x3d7d('0x22')]||null:null})[_0x3d7d('0x23')](function(_0x1ced5c){if(_0x1ced5c){return _0x1ced5c[_0x3d7d('0x24')](_0x63921f['body'][_0x3d7d('0x25')],_[_0x3d7d('0x26')](_0x63921f[_0x3d7d('0x1c')],[_0x3d7d('0x25'),'id'])||{});}})[_0x3d7d('0x27')](function(_0x2dab25){logger['info'](_0x3d7d('0x28'),_0x63921f);logger[_0x3d7d('0x12')](_0x3d7d('0x28'),_0x63921f,JSON[_0x3d7d('0x14')](_0x2dab25));_0x41f89c(_0x2dab25);})[_0x3d7d('0x19')](function(_0x18e69d){logger['error'](_0x3d7d('0x28'),_0x18e69d[_0x3d7d('0x17')],_0x63921f);_0x587dc6(_this[_0x3d7d('0x15')](0x1f4,_0x18e69d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 8794715..db43d9e 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 _0xa752=['openchannelInteraction:','./openchannelInteraction.events','remove','update','removeListener','length'];(function(_0x466c43,_0x35e257){var _0x43a795=function(_0x58509a){while(--_0x58509a){_0x466c43['push'](_0x466c43['shift']());}};_0x43a795(++_0x35e257);}(_0xa752,0x14b));var _0x2a75=function(_0x4057aa,_0x1657ac){_0x4057aa=_0x4057aa-0x0;var _0x31343a=_0xa752[_0x4057aa];return _0x31343a;};'use strict';var OpenchannelInteractionEvents=require(_0x2a75('0x0'));var events=['save',_0x2a75('0x1'),_0x2a75('0x2')];function createListener(_0x5dc1b3,_0x5d3662){return function(_0xbb699b){_0x5d3662['emit'](_0x5dc1b3,_0xbb699b);};}function removeListener(_0x300276,_0x313610){return function(){OpenchannelInteractionEvents[_0x2a75('0x3')](_0x300276,_0x313610);};}exports['register']=function(_0x45b071){for(var _0x2f92e7=0x0,_0x48725b=events[_0x2a75('0x4')];_0x2f92e7<_0x48725b;_0x2f92e7++){var _0x4da3f2=events[_0x2f92e7];var _0x1916c4=createListener(_0x2a75('0x5')+_0x4da3f2,_0x45b071);OpenchannelInteractionEvents['on'](_0x4da3f2,_0x1916c4);}}; \ No newline at end of file +var _0x2294=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x2aeca6,_0x565154){var _0x48c8c9=function(_0x739357){while(--_0x739357){_0x2aeca6['push'](_0x2aeca6['shift']());}};_0x48c8c9(++_0x565154);}(_0x2294,0x1ec));var _0x4229=function(_0x4dcbe6,_0x4f1ba6){_0x4dcbe6=_0x4dcbe6-0x0;var _0x5e5750=_0x2294[_0x4dcbe6];return _0x5e5750;};'use strict';var OpenchannelInteractionEvents=require(_0x4229('0x0'));var events=[_0x4229('0x1'),_0x4229('0x2'),_0x4229('0x3')];function createListener(_0x2da9fe,_0x56d1e0){return function(_0x214701){_0x56d1e0[_0x4229('0x4')](_0x2da9fe,_0x214701);};}function removeListener(_0x5f0b68,_0x193aba){return function(){OpenchannelInteractionEvents[_0x4229('0x5')](_0x5f0b68,_0x193aba);};}exports[_0x4229('0x6')]=function(_0x376000){for(var _0x13c1d8=0x0,_0x45fb19=events[_0x4229('0x7')];_0x13c1d8<_0x45fb19;_0x13c1d8++){var _0x47d764=events[_0x13c1d8];var _0x2180c6=createListener(_0x4229('0x8')+_0x47d764,_0x376000);OpenchannelInteractionEvents['on'](_0x47d764,_0x2180c6);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f3c568d..f18c0b4 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 _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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x1a80c2,_0x25e82d){_0x1a80c2=_0x1a80c2-0x0;var _0x58dee5=_0x70e0[_0x1a80c2];return _0x58dee5;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0xb4900e,_0x1661ec){_0xb4900e=_0xb4900e-0x0;var _0x34c6da=_0x70e0[_0xb4900e];return _0x34c6da;};'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 9b259c6..5f588e5 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 _0x0c1a=['STRING','sequelize','exports','TEXT','BOOLEAN','out','DATE'];(function(_0x42aa5c,_0x4061a4){var _0x565b5e=function(_0x381643){while(--_0x381643){_0x42aa5c['push'](_0x42aa5c['shift']());}};_0x565b5e(++_0x4061a4);}(_0x0c1a,0x127));var _0xa0c1=function(_0x43b019,_0x490d48){_0x43b019=_0x43b019-0x0;var _0x28021a=_0x0c1a[_0x43b019];return _0x28021a;};'use strict';var Sequelize=require(_0xa0c1('0x0'));module[_0xa0c1('0x1')]={'body':{'type':Sequelize[_0xa0c1('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xa0c1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa0c1('0x4')),'defaultValue':_0xa0c1('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa0c1('0x5')]},'providerName':{'type':Sequelize[_0xa0c1('0x6')]},'providerResponse':{'type':Sequelize[_0xa0c1('0x2')]}}; \ No newline at end of file +var _0x20df=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x20df,0x7c));var _0xf20d=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x20df[_0x3e32a8];return _0x2997b0;};'use strict';var Sequelize=require(_0xf20d('0x0'));module[_0xf20d('0x1')]={'body':{'type':Sequelize[_0xf20d('0x2')](_0xf20d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf20d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf20d('0x5')]('in',_0xf20d('0x6')),'defaultValue':_0xf20d('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf20d('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf20d('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 276ea66..18cb2a3 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 _0xeb26=['nolimit','order','sort','where','pick','filter','merge','options','OpenchannelMessage','includeAll','findAll','rows','show','params','rawAttributes','include','create','body','find','destroy','describe','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','EventManager','acceptmessage','../../config/logger','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','event','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','stack','send','index','map','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x24b7d9,_0x2808e8){var _0x549b61=function(_0x1fddcd){while(--_0x1fddcd){_0x24b7d9['push'](_0x24b7d9['shift']());}};_0x549b61(++_0x2808e8);}(_0xeb26,0x14b));var _0x6eb2=function(_0x480885,_0x431637){_0x480885=_0x480885-0x0;var _0x323f19=_0xeb26[_0x480885];return _0x323f19;};'use strict';var emlformat=require(_0x6eb2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6eb2('0x1'));var jsonpatch=require(_0x6eb2('0x2'));var rp=require(_0x6eb2('0x3'));var moment=require(_0x6eb2('0x4'));var BPromise=require(_0x6eb2('0x5'));var Mustache=require(_0x6eb2('0x6'));var util=require('util');var path=require(_0x6eb2('0x7'));var sox=require(_0x6eb2('0x8'));var csv=require(_0x6eb2('0x9'));var ejs=require(_0x6eb2('0xa'));var fs=require('fs');var fs_extra=require(_0x6eb2('0xb'));var _=require(_0x6eb2('0xc'));var squel=require(_0x6eb2('0xd'));var crypto=require(_0x6eb2('0xe'));var jsforce=require(_0x6eb2('0xf'));var deskjs=require(_0x6eb2('0x10'));var toCsv=require(_0x6eb2('0x9'));var querystring=require(_0x6eb2('0x11'));var Papa=require(_0x6eb2('0x12'));var Redis=require('ioredis');var authService=require(_0x6eb2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6eb2('0x14'));var hardwareService=require(_0x6eb2('0x15'));var logger=require('../../config/logger')(_0x6eb2('0x16'));var utils=require(_0x6eb2('0x17'));var config=require(_0x6eb2('0x18'));var licenseUtil=require(_0x6eb2('0x19'));var db=require(_0x6eb2('0x1a'))['db'];config[_0x6eb2('0x1b')]=_[_0x6eb2('0x1c')](config['redis'],{'host':_0x6eb2('0x1d'),'port':0x18eb});var socket=require(_0x6eb2('0x1e'))(new Redis(config[_0x6eb2('0x1b')]));require(_0x6eb2('0x1f'))[_0x6eb2('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6eb2('0x21')][_0x6eb2('0x22')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x211920,_0x288bbf,_0x185e65,_0x5f1849){return new BPromise(function(_0x4a70ea,_0x39b9fb){var _0x1eb270=_0x5f1849||client;return _0x1eb270[_0x6eb2('0x23')](_0x211920,_0x185e65)['then'](function(_0xcea0da){logger['info'](_0x6eb2('0x24'),_0x288bbf,_0x6eb2('0x25'));logger[_0x6eb2('0x26')](_0x6eb2('0x27'),_0x288bbf,_0x6eb2('0x25'),JSON[_0x6eb2('0x28')](_0xcea0da));if(_0xcea0da[_0x6eb2('0x29')]){if(_0xcea0da[_0x6eb2('0x29')]['code']===0x1f4){logger[_0x6eb2('0x29')](_0x6eb2('0x24'),_0x288bbf,_0xcea0da[_0x6eb2('0x29')]['message']);return _0x39b9fb(_0xcea0da[_0x6eb2('0x29')][_0x6eb2('0x2a')]);}logger['error'](_0x6eb2('0x24'),_0x288bbf,_0xcea0da[_0x6eb2('0x29')][_0x6eb2('0x2a')]);return _0x4a70ea(_0xcea0da[_0x6eb2('0x29')][_0x6eb2('0x2a')]);}else{logger[_0x6eb2('0x2b')](_0x6eb2('0x24'),_0x288bbf,'request\x20sent');_0x4a70ea(_0xcea0da['result'][_0x6eb2('0x2a')]);}})[_0x6eb2('0x2c')](function(_0xc64b27){logger[_0x6eb2('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x288bbf,_0xc64b27);_0x39b9fb(_0xc64b27);});});}function respondWithStatusCode(_0x2aebcd,_0x492fb6){_0x492fb6=_0x492fb6||0xcc;return function(_0x2754bc){if(_0x2754bc){return _0x2aebcd['sendStatus'](_0x492fb6);}return _0x2aebcd[_0x6eb2('0x2d')](_0x492fb6)[_0x6eb2('0x2e')]();};}function respondWithResult(_0xe0c6fb,_0x10d32c){_0x10d32c=_0x10d32c||0xc8;return function(_0xcc06c5){if(_0xcc06c5){return _0xe0c6fb[_0x6eb2('0x2d')](_0x10d32c)[_0x6eb2('0x2f')](_0xcc06c5);}};}function respondWithFilteredResult(_0x38020f,_0xf90a0){return function(_0x22e7b0){if(_0x22e7b0){var _0x22865f=typeof _0xf90a0[_0x6eb2('0x30')]===_0x6eb2('0x31')&&typeof _0xf90a0[_0x6eb2('0x32')]==='undefined';var _0xf2fd35=_0x22e7b0[_0x6eb2('0x33')];var _0x3bdd75=_0x22865f?0x0:_0xf90a0[_0x6eb2('0x30')];var _0x3ffeb2=_0x22865f?_0x22e7b0[_0x6eb2('0x33')]:_0xf90a0[_0x6eb2('0x30')]+_0xf90a0[_0x6eb2('0x32')];var _0xb97f05;if(_0x3ffeb2>=_0xf2fd35){_0x3ffeb2=_0xf2fd35;_0xb97f05=0xc8;}else{_0xb97f05=0xce;}_0x38020f['status'](_0xb97f05);return _0x38020f[_0x6eb2('0x34')](_0x6eb2('0x35'),_0x3bdd75+'-'+_0x3ffeb2+'/'+_0xf2fd35)[_0x6eb2('0x2f')](_0x22e7b0);}return null;};}function patchUpdates(_0x283f5a){return function(_0x166a27){try{jsonpatch[_0x6eb2('0x36')](_0x166a27,_0x283f5a,!![]);}catch(_0x578524){return BPromise['reject'](_0x578524);}return _0x166a27[_0x6eb2('0x37')]();};}function saveUpdates(_0x426dc4,_0x154676){return function(_0x2ebb96){if(_0x2ebb96){return _0x2ebb96[_0x6eb2('0x38')](_0x426dc4)[_0x6eb2('0x39')](function(_0x2109b1){return _0x2109b1;});}return null;};}function removeEntity(_0x1de83b,_0xa84719){return function(_0x35d893){if(_0x35d893){return _0x35d893['destroy']()['then'](function(){_0x1de83b['status'](0xcc)[_0x6eb2('0x2e')]();});}};}function handleEntityNotFound(_0x2a7bfe,_0x4d9909){return function(_0x417e64){if(!_0x417e64){_0x2a7bfe[_0x6eb2('0x3a')](0x194);}return _0x417e64;};}function handleError(_0x5cd6ee,_0x24d9cb){_0x24d9cb=_0x24d9cb||0x1f4;return function(_0x432458){logger[_0x6eb2('0x29')](_0x432458[_0x6eb2('0x3b')]);if(_0x432458['name']){delete _0x432458['name'];}_0x5cd6ee[_0x6eb2('0x2d')](_0x24d9cb)[_0x6eb2('0x3c')](_0x432458);};}exports[_0x6eb2('0x3d')]=function(_0xe642bd,_0x20ee5b){var _0x3b1972={},_0x505011={},_0x1fd64c={'count':0x0,'rows':[]};var _0x12874d=_[_0x6eb2('0x3e')](db['OpenchannelMessage']['rawAttributes'],function(_0x52e331){return{'name':_0x52e331['fieldName'],'type':_0x52e331['type'][_0x6eb2('0x3f')]};});_0x505011[_0x6eb2('0x40')]=_[_0x6eb2('0x3e')](_0x12874d,_0x6eb2('0x41'));_0x505011['query']=_[_0x6eb2('0x42')](_0xe642bd[_0x6eb2('0x43')]);_0x505011[_0x6eb2('0x44')]=_[_0x6eb2('0x45')](_0x505011['model'],_0x505011[_0x6eb2('0x43')]);_0x3b1972[_0x6eb2('0x46')]=_[_0x6eb2('0x45')](_0x505011[_0x6eb2('0x40')],qs[_0x6eb2('0x47')](_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x47')]));_0x3b1972[_0x6eb2('0x46')]=_0x3b1972['attributes'][_0x6eb2('0x48')]?_0x3b1972[_0x6eb2('0x46')]:_0x505011[_0x6eb2('0x40')];if(!_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x49')](_0x6eb2('0x4a'))){_0x3b1972[_0x6eb2('0x32')]=qs['limit'](_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x32')]);_0x3b1972[_0x6eb2('0x30')]=qs['offset'](_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x30')]);}_0x3b1972[_0x6eb2('0x4b')]=qs[_0x6eb2('0x4c')](_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x4c')]);_0x3b1972[_0x6eb2('0x4d')]=qs[_0x6eb2('0x44')](_[_0x6eb2('0x4e')](_0xe642bd['query'],_0x505011[_0x6eb2('0x44')]),_0x12874d);if(_0xe642bd['query'][_0x6eb2('0x4f')]){_0x3b1972[_0x6eb2('0x4d')]=_[_0x6eb2('0x50')](_0x3b1972[_0x6eb2('0x4d')],{'$or':_[_0x6eb2('0x3e')](_0x12874d,function(_0x381a0b){if(_0x381a0b['type']!=='VIRTUAL'){var _0x1d091c={};_0x1d091c[_0x381a0b[_0x6eb2('0x41')]]={'$like':'%'+_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x4f')]+'%'};return _0x1d091c;}})});}_0x3b1972=_[_0x6eb2('0x50')]({},_0x3b1972,_0xe642bd[_0x6eb2('0x51')]);var _0x2f2476={'where':_0x3b1972[_0x6eb2('0x4d')]};return db[_0x6eb2('0x52')]['count'](_0x2f2476)[_0x6eb2('0x39')](function(_0x33566e){_0x1fd64c['count']=_0x33566e;if(_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x53')]){_0x3b1972['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6eb2('0x54')](_0x3b1972);})[_0x6eb2('0x39')](function(_0x948f62){_0x1fd64c[_0x6eb2('0x55')]=_0x948f62;return _0x1fd64c;})[_0x6eb2('0x39')](respondWithFilteredResult(_0x20ee5b,_0x3b1972))[_0x6eb2('0x2c')](handleError(_0x20ee5b,null));};exports[_0x6eb2('0x56')]=function(_0x4d2a8f,_0x4a7cfc){var _0x495e90={'raw':!![],'where':{'id':_0x4d2a8f[_0x6eb2('0x57')]['id']}},_0x2adbb9={};_0x2adbb9[_0x6eb2('0x40')]=_[_0x6eb2('0x42')](db['OpenchannelMessage'][_0x6eb2('0x58')]);_0x2adbb9[_0x6eb2('0x43')]=_[_0x6eb2('0x42')](_0x4d2a8f[_0x6eb2('0x43')]);_0x2adbb9[_0x6eb2('0x44')]=_[_0x6eb2('0x45')](_0x2adbb9[_0x6eb2('0x40')],_0x2adbb9[_0x6eb2('0x43')]);_0x495e90[_0x6eb2('0x46')]=_[_0x6eb2('0x45')](_0x2adbb9[_0x6eb2('0x40')],qs[_0x6eb2('0x47')](_0x4d2a8f[_0x6eb2('0x43')][_0x6eb2('0x47')]));_0x495e90[_0x6eb2('0x46')]=_0x495e90[_0x6eb2('0x46')][_0x6eb2('0x48')]?_0x495e90['attributes']:_0x2adbb9[_0x6eb2('0x40')];if(_0x4d2a8f[_0x6eb2('0x43')][_0x6eb2('0x53')]){_0x495e90[_0x6eb2('0x59')]=[{'all':!![]}];}_0x495e90=_[_0x6eb2('0x50')]({},_0x495e90,_0x4d2a8f['options']);return db[_0x6eb2('0x52')]['find'](_0x495e90)[_0x6eb2('0x39')](handleEntityNotFound(_0x4a7cfc,null))['then'](respondWithResult(_0x4a7cfc,null))[_0x6eb2('0x2c')](handleError(_0x4a7cfc,null));};exports[_0x6eb2('0x5a')]=function(_0x2618dc,_0x1d55a2){return db[_0x6eb2('0x52')][_0x6eb2('0x5a')](_0x2618dc[_0x6eb2('0x5b')],{})[_0x6eb2('0x39')](respondWithResult(_0x1d55a2,0xc9))[_0x6eb2('0x2c')](handleError(_0x1d55a2,null));};exports[_0x6eb2('0x38')]=function(_0x58212e,_0x36c9bc){if(_0x58212e[_0x6eb2('0x5b')]['id']){delete _0x58212e[_0x6eb2('0x5b')]['id'];}return db['OpenchannelMessage'][_0x6eb2('0x5c')]({'where':{'id':_0x58212e[_0x6eb2('0x57')]['id']}})[_0x6eb2('0x39')](handleEntityNotFound(_0x36c9bc,null))[_0x6eb2('0x39')](saveUpdates(_0x58212e[_0x6eb2('0x5b')],null))[_0x6eb2('0x39')](respondWithResult(_0x36c9bc,null))[_0x6eb2('0x2c')](handleError(_0x36c9bc,null));};exports[_0x6eb2('0x5d')]=function(_0x4ac66b,_0x4995b9){return db[_0x6eb2('0x52')][_0x6eb2('0x5c')]({'where':{'id':_0x4ac66b[_0x6eb2('0x57')]['id']}})[_0x6eb2('0x39')](handleEntityNotFound(_0x4995b9,null))[_0x6eb2('0x39')](removeEntity(_0x4995b9,null))['catch'](handleError(_0x4995b9,null));};exports[_0x6eb2('0x5e')]=function(_0x580ec2,_0x543266){return db[_0x6eb2('0x52')][_0x6eb2('0x5e')]()[_0x6eb2('0x39')](respondWithResult(_0x543266,null))['catch'](handleError(_0x543266,null));};var interaction_log=require('../../config/logger')(_0x6eb2('0x5f'));exports[_0x6eb2('0x60')]=function(_0x37aa7d,_0x1bbbee,_0x2e3ec6){var _0x5f0734={'agent':{},'channel':_0x6eb2('0x61')};if(_0x37aa7d['body']['id']){delete _0x37aa7d[_0x6eb2('0x5b')]['id'];}_0x37aa7d[_0x6eb2('0x5b')]['read']=!![];_0x37aa7d[_0x6eb2('0x5b')][_0x6eb2('0x62')]=moment()[_0x6eb2('0x63')](_0x6eb2('0x64'));_0x37aa7d[_0x6eb2('0x5b')][_0x6eb2('0x65')]=_0x37aa7d['body']['UserId']||_0x37aa7d[_0x6eb2('0x66')]['id'];_0x5f0734[_0x6eb2('0x67')]['id']=_0x37aa7d[_0x6eb2('0x5b')][_0x6eb2('0x65')];return db[_0x6eb2('0x52')][_0x6eb2('0x5c')]({'where':{'id':_0x37aa7d[_0x6eb2('0x57')]['id'],'UserId':null}})[_0x6eb2('0x39')](handleEntityNotFound(_0x1bbbee,null))[_0x6eb2('0x39')](saveUpdates(_0x37aa7d[_0x6eb2('0x5b')],null))['then'](function(_0x453f78){if(_0x453f78){_0x5f0734[_0x6eb2('0x2a')]=_0x453f78[_0x6eb2('0x68')]({'plain':!![]});return db[_0x6eb2('0x69')]['find']({'where':{'id':_0x453f78[_0x6eb2('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x1bbbee,null))[_0x6eb2('0x39')](function(_0x163c08){if(_0x163c08){return _0x163c08['update']({'UserId':_0x37aa7d[_0x6eb2('0x5b')]['UserId'],'read1stAt':_[_0x6eb2('0x6b')](_0x163c08[_0x6eb2('0x6c')])?moment()[_0x6eb2('0x63')](_0x6eb2('0x64')):undefined});}return null;})['then'](function(_0x56568b){if(_0x56568b){_0x5f0734[_0x6eb2('0x6d')]=_0x56568b[_0x6eb2('0x68')]({'plain':!![]});interaction_log[_0x6eb2('0x2b')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x37aa7d[_0x6eb2('0x66')]['id'],_0x37aa7d[_0x6eb2('0x66')][_0x6eb2('0x41')],_0x37aa7d[_0x6eb2('0x66')][_0x6eb2('0x6e')],_0x5f0734['interaction']['id'],_0x37aa7d[_0x6eb2('0x5b')]?JSON[_0x6eb2('0x28')](_0x37aa7d[_0x6eb2('0x5b')]):_0x6eb2('0x6f'));return respondWithRpcPromise(_0x6eb2('0x70'),'acceptMessage',_0x5f0734);}return null;})[_0x6eb2('0x39')](function(_0x39fcdf){var _0x1d1ac0=_0x6eb2('0x71')+_0x39fcdf['message']['ContactId'];return db[_0x6eb2('0x72')]['query'](_0x1d1ac0,{'type':db[_0x6eb2('0x73')][_0x6eb2('0x74')][_0x6eb2('0x75')],'raw':!![]})[_0x6eb2('0x39')](function(_0x45f6c8){return _0x45f6c8;});})[_0x6eb2('0x39')](function(_0x582c6b){if(_0x582c6b){_0x5f0734[_0x6eb2('0x2a')][_0x6eb2('0x76')]=_0x582c6b[0x0];if(!_0x37aa7d[_0x6eb2('0x5b')][_0x6eb2('0x65')])return;return db[_0x6eb2('0x77')][_0x6eb2('0x5c')]({'where':{'id':_0x37aa7d[_0x6eb2('0x5b')][_0x6eb2('0x65')],'role':_0x6eb2('0x67')},'attributes':['id',_0x6eb2('0x41'),_0x6eb2('0x78'),_0x6eb2('0x79'),_0x6eb2('0x7a')],'raw':!![]});}return null;})[_0x6eb2('0x39')](function(_0xf8d7d4){if(!_0xf8d7d4)return null;_0x5f0734[_0x6eb2('0x2a')][_0x6eb2('0x67')]=_0xf8d7d4;return _0x5f0734;})[_0x6eb2('0x39')](function(_0x561c35){if(_0x561c35){if(_0x37aa7d[_0x6eb2('0x5b')]['manual']){_0x5f0734[_0x6eb2('0x2a')][_0x6eb2('0x7b')]=util[_0x6eb2('0x63')](_0x6eb2('0x7c'),_0x37aa7d[_0x6eb2('0x66')][_0x6eb2('0x41')]);_0x5f0734[_0x6eb2('0x2a')][_0x6eb2('0x7d')]=_0x5f0734[_0x6eb2('0x7d')];_0x5f0734[_0x6eb2('0x2a')]['event']='accept';return respondWithRpcPromise(_0x6eb2('0x7e'),_0x6eb2('0x7e'),{'event':_0x6eb2('0x7f'),'message':_0x5f0734['message']},client9002)[_0x6eb2('0x39')](function(){return _0x5f0734;});}return _0x5f0734;}return null;})[_0x6eb2('0x39')](respondWithResult(_0x1bbbee,null))[_0x6eb2('0x2c')](handleError(_0x1bbbee,null));};var interaction_log=require(_0x6eb2('0x80'))('openchannel-interactions');exports[_0x6eb2('0x81')]=function(_0x53264f,_0x149dc5,_0x12e029){var _0x1dc908={'agent':{},'channel':_0x6eb2('0x61')};if(_0x53264f[_0x6eb2('0x5b')]['id']){delete _0x53264f[_0x6eb2('0x5b')]['id'];}_0x53264f[_0x6eb2('0x5b')][_0x6eb2('0x65')]=_0x53264f[_0x6eb2('0x5b')]['UserId']||_0x53264f[_0x6eb2('0x66')]['id'];_0x1dc908[_0x6eb2('0x67')]['id']=_0x53264f[_0x6eb2('0x5b')]['UserId'];return db[_0x6eb2('0x52')][_0x6eb2('0x5c')]({'where':{'id':_0x53264f['params']['id'],'UserId':null}})[_0x6eb2('0x39')](handleEntityNotFound(_0x149dc5,null))['then'](function(_0x4a599e){if(_0x4a599e){_0x1dc908[_0x6eb2('0x2a')]=_0x4a599e[_0x6eb2('0x68')]({'plain':!![]});return db[_0x6eb2('0x69')]['find']({'where':{'id':_0x4a599e[_0x6eb2('0x6a')]}});}return null;})[_0x6eb2('0x39')](handleEntityNotFound(_0x149dc5,null))[_0x6eb2('0x39')](function(_0x18b7ff){if(_0x18b7ff){_0x1dc908[_0x6eb2('0x6d')]=_0x18b7ff[_0x6eb2('0x68')]({'plain':!![]});interaction_log[_0x6eb2('0x2b')](_0x6eb2('0x82'),_0x53264f[_0x6eb2('0x66')]['id'],_0x53264f[_0x6eb2('0x66')][_0x6eb2('0x41')],_0x53264f[_0x6eb2('0x66')]['role'],_0x1dc908[_0x6eb2('0x6d')]['id'],_0x53264f[_0x6eb2('0x5b')]?JSON[_0x6eb2('0x28')](_0x53264f['body']):_0x6eb2('0x6f'));return respondWithRpcPromise(_0x6eb2('0x83'),_0x6eb2('0x84'),_0x1dc908);}return null;})[_0x6eb2('0x39')](function(_0x23a1bf){var _0x561c72=_0x6eb2('0x71')+_0x23a1bf['message'][_0x6eb2('0x85')];return db['sequelize']['query'](_0x561c72,{'type':db[_0x6eb2('0x73')][_0x6eb2('0x74')][_0x6eb2('0x75')],'raw':!![]})[_0x6eb2('0x39')](function(_0x2177b1){return _0x2177b1;});})['then'](function(_0x1b0e90){if(_0x1b0e90){_0x1dc908[_0x6eb2('0x2a')]['contact']=_0x1b0e90[0x0];if(!_0x53264f[_0x6eb2('0x5b')][_0x6eb2('0x65')])return;return db[_0x6eb2('0x77')][_0x6eb2('0x5c')]({'where':{'id':_0x53264f['body'][_0x6eb2('0x65')],'role':_0x6eb2('0x67')},'attributes':['id',_0x6eb2('0x41'),_0x6eb2('0x78'),_0x6eb2('0x79'),_0x6eb2('0x7a')],'raw':!![]});}return null;})['then'](function(_0x832416){if(!_0x832416)return null;_0x1dc908['message'][_0x6eb2('0x67')]=_0x832416;return _0x1dc908;})[_0x6eb2('0x39')](function(_0x159de2){if(_0x159de2){_0x159de2[_0x6eb2('0x2a')][_0x6eb2('0x7b')]=util['format'](_0x6eb2('0x7c'),_0x53264f[_0x6eb2('0x66')]['name']);_0x159de2['message'][_0x6eb2('0x7d')]=_0x1dc908['channel'];_0x159de2[_0x6eb2('0x2a')][_0x6eb2('0x86')]=_0x6eb2('0x81');respondWithRpcPromise('EventManager',_0x6eb2('0x7e'),{'event':'rejectmessage','message':_0x159de2['message']},client9002);return _0x1dc908;}return null;})[_0x6eb2('0x39')](respondWithResult(_0x149dc5,null))[_0x6eb2('0x2c')](handleError(_0x149dc5,null));}; \ No newline at end of file +var _0x213f=['../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','status','json','undefined','limit','count','offset','Content-Range','reject','save','destroy','then','end','stack','name','send','index','map','OpenchannelMessage','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','update','params','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','contact','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3a1049,_0x1e410b){var _0x56c047=function(_0x237724){while(--_0x237724){_0x3a1049['push'](_0x3a1049['shift']());}};_0x56c047(++_0x1e410b);}(_0x213f,0x173));var _0xf213=function(_0x3df7e7,_0x98e148){_0x3df7e7=_0x3df7e7-0x0;var _0x28dca8=_0x213f[_0x3df7e7];return _0x28dca8;};'use strict';var emlformat=require(_0xf213('0x0'));var rimraf=require(_0xf213('0x1'));var zipdir=require(_0xf213('0x2'));var jsonpatch=require(_0xf213('0x3'));var rp=require(_0xf213('0x4'));var moment=require(_0xf213('0x5'));var BPromise=require(_0xf213('0x6'));var Mustache=require(_0xf213('0x7'));var util=require('util');var path=require(_0xf213('0x8'));var sox=require(_0xf213('0x9'));var csv=require(_0xf213('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf213('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf213('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf213('0xa'));var querystring=require('querystring');var Papa=require(_0xf213('0xd'));var Redis=require(_0xf213('0xe'));var authService=require(_0xf213('0xf'));var qs=require(_0xf213('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf213('0x11'));var logger=require('../../config/logger')(_0xf213('0x12'));var utils=require(_0xf213('0x13'));var config=require(_0xf213('0x14'));var licenseUtil=require(_0xf213('0x15'));var db=require(_0xf213('0x16'))['db'];config[_0xf213('0x17')]=_['defaults'](config[_0xf213('0x17')],{'host':_0xf213('0x18'),'port':0x18eb});var socket=require(_0xf213('0x19'))(new Redis(config[_0xf213('0x17')]));require(_0xf213('0x1a'))[_0xf213('0x1b')](socket);var jayson=require(_0xf213('0x1c'));var client=jayson[_0xf213('0x1d')][_0xf213('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ad789,_0x1c053c,_0x4435b8,_0x5285b6){return new BPromise(function(_0x16cbdb,_0x4188a){var _0x3bdd12=_0x5285b6||client;return _0x3bdd12[_0xf213('0x1f')](_0x4ad789,_0x4435b8)['then'](function(_0x39f060){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1c053c,_0xf213('0x20'));logger[_0xf213('0x21')](_0xf213('0x22'),_0x1c053c,'request\x20sent',JSON[_0xf213('0x23')](_0x39f060));if(_0x39f060[_0xf213('0x24')]){if(_0x39f060[_0xf213('0x24')][_0xf213('0x25')]===0x1f4){logger[_0xf213('0x24')](_0xf213('0x26'),_0x1c053c,_0x39f060[_0xf213('0x24')][_0xf213('0x27')]);return _0x4188a(_0x39f060[_0xf213('0x24')][_0xf213('0x27')]);}logger['error'](_0xf213('0x26'),_0x1c053c,_0x39f060[_0xf213('0x24')][_0xf213('0x27')]);return _0x16cbdb(_0x39f060['error'][_0xf213('0x27')]);}else{logger[_0xf213('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1c053c,_0xf213('0x20'));_0x16cbdb(_0x39f060[_0xf213('0x29')][_0xf213('0x27')]);}})[_0xf213('0x2a')](function(_0x2a7a2f){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x1c053c,_0x2a7a2f);_0x4188a(_0x2a7a2f);});});}function respondWithStatusCode(_0x46cc99,_0x27e02a){_0x27e02a=_0x27e02a||0xcc;return function(_0x50ff24){if(_0x50ff24){return _0x46cc99['sendStatus'](_0x27e02a);}return _0x46cc99[_0xf213('0x2b')](_0x27e02a)['end']();};}function respondWithResult(_0x1eb23b,_0x122b31){_0x122b31=_0x122b31||0xc8;return function(_0x348c2c){if(_0x348c2c){return _0x1eb23b['status'](_0x122b31)[_0xf213('0x2c')](_0x348c2c);}};}function respondWithFilteredResult(_0x7ef1f6,_0x35c5f5){return function(_0x450d9){if(_0x450d9){var _0x141c09=typeof _0x35c5f5['offset']===_0xf213('0x2d')&&typeof _0x35c5f5[_0xf213('0x2e')]===_0xf213('0x2d');var _0x38c932=_0x450d9[_0xf213('0x2f')];var _0x20d1db=_0x141c09?0x0:_0x35c5f5[_0xf213('0x30')];var _0xd5b5e1=_0x141c09?_0x450d9[_0xf213('0x2f')]:_0x35c5f5[_0xf213('0x30')]+_0x35c5f5[_0xf213('0x2e')];var _0x466de4;if(_0xd5b5e1>=_0x38c932){_0xd5b5e1=_0x38c932;_0x466de4=0xc8;}else{_0x466de4=0xce;}_0x7ef1f6[_0xf213('0x2b')](_0x466de4);return _0x7ef1f6['set'](_0xf213('0x31'),_0x20d1db+'-'+_0xd5b5e1+'/'+_0x38c932)[_0xf213('0x2c')](_0x450d9);}return null;};}function patchUpdates(_0x2070a8){return function(_0x58578e){try{jsonpatch['apply'](_0x58578e,_0x2070a8,!![]);}catch(_0x284652){return BPromise[_0xf213('0x32')](_0x284652);}return _0x58578e[_0xf213('0x33')]();};}function saveUpdates(_0x21c98a,_0x1986a6){return function(_0x133c9b){if(_0x133c9b){return _0x133c9b['update'](_0x21c98a)['then'](function(_0x2b67cd){return _0x2b67cd;});}return null;};}function removeEntity(_0x1541ef,_0x3c0e54){return function(_0x4c563e){if(_0x4c563e){return _0x4c563e[_0xf213('0x34')]()[_0xf213('0x35')](function(){_0x1541ef['status'](0xcc)[_0xf213('0x36')]();});}};}function handleEntityNotFound(_0x53be72,_0x772c19){return function(_0x5b8ec7){if(!_0x5b8ec7){_0x53be72['sendStatus'](0x194);}return _0x5b8ec7;};}function handleError(_0x3c6efd,_0x5b16e6){_0x5b16e6=_0x5b16e6||0x1f4;return function(_0x174bd4){logger[_0xf213('0x24')](_0x174bd4[_0xf213('0x37')]);if(_0x174bd4[_0xf213('0x38')]){delete _0x174bd4[_0xf213('0x38')];}_0x3c6efd[_0xf213('0x2b')](_0x5b16e6)[_0xf213('0x39')](_0x174bd4);};}exports[_0xf213('0x3a')]=function(_0x4d5b32,_0x336403){var _0x1c26b9={},_0x417fbe={},_0x48bc2b={'count':0x0,'rows':[]};var _0x201e0d=_[_0xf213('0x3b')](db[_0xf213('0x3c')]['rawAttributes'],function(_0x51648a){return{'name':_0x51648a[_0xf213('0x3d')],'type':_0x51648a[_0xf213('0x3e')]['key']};});_0x417fbe[_0xf213('0x3f')]=_[_0xf213('0x3b')](_0x201e0d,_0xf213('0x38'));_0x417fbe[_0xf213('0x40')]=_[_0xf213('0x41')](_0x4d5b32[_0xf213('0x40')]);_0x417fbe[_0xf213('0x42')]=_['intersection'](_0x417fbe['model'],_0x417fbe['query']);_0x1c26b9[_0xf213('0x43')]=_[_0xf213('0x44')](_0x417fbe['model'],qs[_0xf213('0x45')](_0x4d5b32['query'][_0xf213('0x45')]));_0x1c26b9[_0xf213('0x43')]=_0x1c26b9['attributes'][_0xf213('0x46')]?_0x1c26b9['attributes']:_0x417fbe[_0xf213('0x3f')];if(!_0x4d5b32[_0xf213('0x40')][_0xf213('0x47')]('nolimit')){_0x1c26b9[_0xf213('0x2e')]=qs[_0xf213('0x2e')](_0x4d5b32['query'][_0xf213('0x2e')]);_0x1c26b9[_0xf213('0x30')]=qs[_0xf213('0x30')](_0x4d5b32[_0xf213('0x40')]['offset']);}_0x1c26b9['order']=qs[_0xf213('0x48')](_0x4d5b32[_0xf213('0x40')][_0xf213('0x48')]);_0x1c26b9['where']=qs['filters'](_[_0xf213('0x49')](_0x4d5b32[_0xf213('0x40')],_0x417fbe[_0xf213('0x42')]),_0x201e0d);if(_0x4d5b32[_0xf213('0x40')][_0xf213('0x4a')]){_0x1c26b9[_0xf213('0x4b')]=_['merge'](_0x1c26b9['where'],{'$or':_[_0xf213('0x3b')](_0x201e0d,function(_0xcabb73){if(_0xcabb73['type']!==_0xf213('0x4c')){var _0x363175={};_0x363175[_0xcabb73['name']]={'$like':'%'+_0x4d5b32['query'][_0xf213('0x4a')]+'%'};return _0x363175;}})});}_0x1c26b9=_[_0xf213('0x4d')]({},_0x1c26b9,_0x4d5b32[_0xf213('0x4e')]);var _0x3cd13d={'where':_0x1c26b9[_0xf213('0x4b')]};return db[_0xf213('0x3c')]['count'](_0x3cd13d)[_0xf213('0x35')](function(_0x578cf5){_0x48bc2b[_0xf213('0x2f')]=_0x578cf5;if(_0x4d5b32[_0xf213('0x40')][_0xf213('0x4f')]){_0x1c26b9[_0xf213('0x50')]=[{'all':!![]}];}return db[_0xf213('0x3c')][_0xf213('0x51')](_0x1c26b9);})[_0xf213('0x35')](function(_0x498eff){_0x48bc2b[_0xf213('0x52')]=_0x498eff;return _0x48bc2b;})[_0xf213('0x35')](respondWithFilteredResult(_0x336403,_0x1c26b9))['catch'](handleError(_0x336403,null));};exports[_0xf213('0x53')]=function(_0x50174a,_0x5d44b8){var _0x59931d={'raw':!![],'where':{'id':_0x50174a['params']['id']}},_0x2adaca={};_0x2adaca[_0xf213('0x3f')]=_[_0xf213('0x41')](db['OpenchannelMessage'][_0xf213('0x54')]);_0x2adaca[_0xf213('0x40')]=_['keys'](_0x50174a['query']);_0x2adaca[_0xf213('0x42')]=_[_0xf213('0x44')](_0x2adaca[_0xf213('0x3f')],_0x2adaca[_0xf213('0x40')]);_0x59931d[_0xf213('0x43')]=_[_0xf213('0x44')](_0x2adaca[_0xf213('0x3f')],qs[_0xf213('0x45')](_0x50174a[_0xf213('0x40')][_0xf213('0x45')]));_0x59931d[_0xf213('0x43')]=_0x59931d[_0xf213('0x43')][_0xf213('0x46')]?_0x59931d[_0xf213('0x43')]:_0x2adaca[_0xf213('0x3f')];if(_0x50174a['query'][_0xf213('0x4f')]){_0x59931d[_0xf213('0x50')]=[{'all':!![]}];}_0x59931d=_[_0xf213('0x4d')]({},_0x59931d,_0x50174a['options']);return db[_0xf213('0x3c')][_0xf213('0x55')](_0x59931d)[_0xf213('0x35')](handleEntityNotFound(_0x5d44b8,null))['then'](respondWithResult(_0x5d44b8,null))[_0xf213('0x2a')](handleError(_0x5d44b8,null));};exports[_0xf213('0x56')]=function(_0x245155,_0x882100){return db[_0xf213('0x3c')][_0xf213('0x56')](_0x245155[_0xf213('0x57')],{})[_0xf213('0x35')](respondWithResult(_0x882100,0xc9))[_0xf213('0x2a')](handleError(_0x882100,null));};exports[_0xf213('0x58')]=function(_0x290411,_0x4fd581){if(_0x290411[_0xf213('0x57')]['id']){delete _0x290411[_0xf213('0x57')]['id'];}return db[_0xf213('0x3c')][_0xf213('0x55')]({'where':{'id':_0x290411['params']['id']}})[_0xf213('0x35')](handleEntityNotFound(_0x4fd581,null))[_0xf213('0x35')](saveUpdates(_0x290411['body'],null))[_0xf213('0x35')](respondWithResult(_0x4fd581,null))['catch'](handleError(_0x4fd581,null));};exports[_0xf213('0x34')]=function(_0x4f9c56,_0x3e044b){return db[_0xf213('0x3c')]['find']({'where':{'id':_0x4f9c56[_0xf213('0x59')]['id']}})[_0xf213('0x35')](handleEntityNotFound(_0x3e044b,null))[_0xf213('0x35')](removeEntity(_0x3e044b,null))[_0xf213('0x2a')](handleError(_0x3e044b,null));};exports[_0xf213('0x5a')]=function(_0x4633fb,_0x49dfa1){return db[_0xf213('0x3c')][_0xf213('0x5a')]()[_0xf213('0x35')](respondWithResult(_0x49dfa1,null))['catch'](handleError(_0x49dfa1,null));};var interaction_log=require(_0xf213('0x5b'))(_0xf213('0x5c'));exports[_0xf213('0x5d')]=function(_0x9e21e2,_0x5ad554,_0x54770f){var _0x368c5d={'agent':{},'channel':_0xf213('0x5e')};if(_0x9e21e2[_0xf213('0x57')]['id']){delete _0x9e21e2[_0xf213('0x57')]['id'];}_0x9e21e2[_0xf213('0x57')][_0xf213('0x5f')]=!![];_0x9e21e2[_0xf213('0x57')][_0xf213('0x60')]=moment()[_0xf213('0x61')](_0xf213('0x62'));_0x9e21e2['body'][_0xf213('0x63')]=_0x9e21e2[_0xf213('0x57')][_0xf213('0x63')]||_0x9e21e2[_0xf213('0x64')]['id'];_0x368c5d[_0xf213('0x65')]['id']=_0x9e21e2[_0xf213('0x57')][_0xf213('0x63')];return db['OpenchannelMessage']['find']({'where':{'id':_0x9e21e2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ad554,null))['then'](saveUpdates(_0x9e21e2[_0xf213('0x57')],null))['then'](function(_0x5d3549){if(_0x5d3549){_0x368c5d[_0xf213('0x27')]=_0x5d3549[_0xf213('0x66')]({'plain':!![]});return db['OpenchannelInteraction'][_0xf213('0x55')]({'where':{'id':_0x5d3549[_0xf213('0x67')]}});}return null;})[_0xf213('0x35')](handleEntityNotFound(_0x5ad554,null))[_0xf213('0x35')](function(_0x571829){if(_0x571829){return _0x571829['update']({'UserId':_0x9e21e2[_0xf213('0x57')][_0xf213('0x63')],'read1stAt':_['isNil'](_0x571829['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf213('0x35')](function(_0x5d8908){if(_0x5d8908){_0x368c5d[_0xf213('0x68')]=_0x5d8908[_0xf213('0x66')]({'plain':!![]});interaction_log[_0xf213('0x28')](_0xf213('0x69'),_0x9e21e2[_0xf213('0x64')]['id'],_0x9e21e2[_0xf213('0x64')]['name'],_0x9e21e2['user']['role'],_0x368c5d[_0xf213('0x68')]['id'],_0x9e21e2[_0xf213('0x57')]?JSON['stringify'](_0x9e21e2[_0xf213('0x57')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x368c5d);}return null;})[_0xf213('0x35')](function(_0xea2c43){var _0xb8b06b=_0xf213('0x6a')+_0xea2c43[_0xf213('0x27')][_0xf213('0x6b')];return db['sequelize'][_0xf213('0x40')](_0xb8b06b,{'type':db[_0xf213('0x6c')][_0xf213('0x6d')][_0xf213('0x6e')],'raw':!![]})[_0xf213('0x35')](function(_0x2a93db){return _0x2a93db;});})[_0xf213('0x35')](function(_0x50e514){if(_0x50e514){_0x368c5d[_0xf213('0x27')]['contact']=_0x50e514[0x0];if(!_0x9e21e2['body'][_0xf213('0x63')])return;return db[_0xf213('0x6f')][_0xf213('0x55')]({'where':{'id':_0x9e21e2[_0xf213('0x57')]['UserId'],'role':_0xf213('0x65')},'attributes':['id',_0xf213('0x38'),_0xf213('0x70'),_0xf213('0x71'),_0xf213('0x72')],'raw':!![]});}return null;})[_0xf213('0x35')](function(_0x4f6dd2){if(!_0x4f6dd2)return null;_0x368c5d[_0xf213('0x27')]['agent']=_0x4f6dd2;return _0x368c5d;})[_0xf213('0x35')](function(_0x240b2f){if(_0x240b2f){if(_0x9e21e2[_0xf213('0x57')][_0xf213('0x73')]){_0x368c5d[_0xf213('0x27')][_0xf213('0x74')]=util['format'](_0xf213('0x75'),_0x9e21e2[_0xf213('0x64')]['name']);_0x368c5d[_0xf213('0x27')][_0xf213('0x76')]=_0x368c5d[_0xf213('0x76')];_0x368c5d[_0xf213('0x27')][_0xf213('0x77')]=_0x368c5d[_0xf213('0x76')];_0x368c5d[_0xf213('0x27')][_0xf213('0x78')]=_0xf213('0x5d');return respondWithRpcPromise(_0xf213('0x79'),_0xf213('0x79'),{'event':_0xf213('0x7a'),'message':_0x368c5d['message']},client9002)[_0xf213('0x35')](function(){return _0x368c5d;});}return _0x368c5d;}return null;})[_0xf213('0x35')](respondWithResult(_0x5ad554,null))[_0xf213('0x2a')](handleError(_0x5ad554,null));};var interaction_log=require(_0xf213('0x5b'))(_0xf213('0x5c'));exports[_0xf213('0x32')]=function(_0x4960ac,_0x6d5a2b,_0x42c2d4){var _0x288a1d={'agent':{},'channel':_0xf213('0x5e')};if(_0x4960ac[_0xf213('0x57')]['id']){delete _0x4960ac['body']['id'];}_0x4960ac[_0xf213('0x57')]['UserId']=_0x4960ac[_0xf213('0x57')]['UserId']||_0x4960ac[_0xf213('0x64')]['id'];_0x288a1d[_0xf213('0x65')]['id']=_0x4960ac[_0xf213('0x57')][_0xf213('0x63')];return db[_0xf213('0x3c')][_0xf213('0x55')]({'where':{'id':_0x4960ac['params']['id'],'UserId':null}})[_0xf213('0x35')](handleEntityNotFound(_0x6d5a2b,null))[_0xf213('0x35')](function(_0x5237b2){if(_0x5237b2){_0x288a1d['message']=_0x5237b2[_0xf213('0x66')]({'plain':!![]});return db[_0xf213('0x7b')][_0xf213('0x55')]({'where':{'id':_0x5237b2['OpenchannelInteractionId']}});}return null;})[_0xf213('0x35')](handleEntityNotFound(_0x6d5a2b,null))[_0xf213('0x35')](function(_0x1fa812){if(_0x1fa812){_0x288a1d[_0xf213('0x68')]=_0x1fa812[_0xf213('0x66')]({'plain':!![]});interaction_log[_0xf213('0x28')](_0xf213('0x7c'),_0x4960ac['user']['id'],_0x4960ac[_0xf213('0x64')][_0xf213('0x38')],_0x4960ac['user'][_0xf213('0x7d')],_0x288a1d['interaction']['id'],_0x4960ac[_0xf213('0x57')]?JSON['stringify'](_0x4960ac['body']):'null');return respondWithRpcPromise(_0xf213('0x7e'),_0xf213('0x7f'),_0x288a1d);}return null;})[_0xf213('0x35')](function(_0x3819d2){var _0xc9080a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3819d2[_0xf213('0x27')]['ContactId'];return db[_0xf213('0x80')][_0xf213('0x40')](_0xc9080a,{'type':db[_0xf213('0x6c')]['QueryTypes'][_0xf213('0x6e')],'raw':!![]})[_0xf213('0x35')](function(_0x518f16){return _0x518f16;});})[_0xf213('0x35')](function(_0x2bd715){if(_0x2bd715){_0x288a1d[_0xf213('0x27')][_0xf213('0x81')]=_0x2bd715[0x0];if(!_0x4960ac[_0xf213('0x57')][_0xf213('0x63')])return;return db[_0xf213('0x6f')][_0xf213('0x55')]({'where':{'id':_0x4960ac['body'][_0xf213('0x63')],'role':_0xf213('0x65')},'attributes':['id',_0xf213('0x38'),_0xf213('0x70'),_0xf213('0x71'),_0xf213('0x72')],'raw':!![]});}return null;})['then'](function(_0xa760a){if(!_0xa760a)return null;_0x288a1d[_0xf213('0x27')][_0xf213('0x65')]=_0xa760a;return _0x288a1d;})[_0xf213('0x35')](function(_0x5293c4){if(_0x5293c4){_0x5293c4[_0xf213('0x27')][_0xf213('0x74')]=util[_0xf213('0x61')](_0xf213('0x75'),_0x4960ac[_0xf213('0x64')][_0xf213('0x38')]);_0x5293c4[_0xf213('0x27')][_0xf213('0x76')]=_0x288a1d['channel'];_0x5293c4[_0xf213('0x27')][_0xf213('0x77')]=_0x288a1d['channel'];_0x5293c4[_0xf213('0x27')][_0xf213('0x78')]=_0xf213('0x32');respondWithRpcPromise(_0xf213('0x79'),_0xf213('0x79'),{'event':_0xf213('0x82'),'message':_0x5293c4[_0xf213('0x27')]},client9002);return _0x288a1d;}return null;})['then'](respondWithResult(_0x6d5a2b,null))['catch'](handleError(_0x6d5a2b,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 8d69063..6a3cc59 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 _0xe4c5=['update','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xe4c5,0x12b));var _0x5e4c=function(_0x46d196,_0x1b5903){_0x46d196=_0x46d196-0x0;var _0x3039e3=_0xe4c5[_0x46d196];return _0x3039e3;};'use strict';var EventEmitter=require(_0x5e4c('0x0'));var OpenchannelMessage=require(_0x5e4c('0x1'))['db'][_0x5e4c('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5e4c('0x3')](0x0);var events={'afterCreate':_0x5e4c('0x4'),'afterUpdate':_0x5e4c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1ca565){return function(_0xf6ad02,_0x383ac9,_0x471128){OpenchannelMessageEvents['emit'](_0x1ca565+':'+_0xf6ad02['id'],_0xf6ad02);OpenchannelMessageEvents['emit'](_0x1ca565,_0xf6ad02);_0x471128(null);};}for(var e in events){if(events[_0x5e4c('0x6')](e)){var event=events[e];OpenchannelMessage[_0x5e4c('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xc389=['update','remove','emit','hook','exports','events','OpenchannelMessage','setMaxListeners','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc389,0x15b));var _0x9c38=function(_0x34397d,_0x590d88){_0x34397d=_0x34397d-0x0;var _0x5d66ff=_0xc389[_0x34397d];return _0x5d66ff;};'use strict';var EventEmitter=require(_0x9c38('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x9c38('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9c38('0x2')](0x0);var events={'afterCreate':_0x9c38('0x3'),'afterUpdate':_0x9c38('0x4'),'afterDestroy':_0x9c38('0x5')};function emitEvent(_0x5d9a20){return function(_0x3df1ab,_0x18694a,_0x50c9e3){OpenchannelMessageEvents['emit'](_0x5d9a20+':'+_0x3df1ab['id'],_0x3df1ab);OpenchannelMessageEvents[_0x9c38('0x6')](_0x5d9a20,_0x3df1ab);_0x50c9e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x9c38('0x7')](e,emitEvent(event));}}module[_0x9c38('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index ddce6c4..4f5e032 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 _0xd7d1=['OpenchannelMessage,\x20%s,\x20%s','inspect','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','findOne','OpenchannelInteractionId','update','createdAt','catch','error','secret','CmContact','describe','then','OpenchannelAccount','find','Interactions','Contact','keys','replyUri','info','afterCreate','format','length','omit','method','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','Interaction'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xb2c6d5,_0x243efa){_0xb2c6d5=_0xb2c6d5-0x0;var _0x4d77be=_0xd7d1[_0xb2c6d5];return _0x4d77be;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[{'name':_0x1d7d('0xf'),'fields':[_0x1d7d('0x10')],'type':_0x1d7d('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x155bfb,_0xa44223,_0x1ad06f){var _0x8b258b=_0x14b2b9[_0x1d7d('0x12')];var _0x547f7b=_0x155bfb[_0x1d7d('0x13')]({'plain':!![]});if(_0x547f7b['direction'][_0x1d7d('0x14')]()==='in'||_0x547f7b[_0x1d7d('0x15')][_0x1d7d('0x14')]()===_0x1d7d('0x16')&&!_0x547f7b['secret']&&!_[_0x1d7d('0x17')](_0x547f7b['UserId'])){_0x8b258b['OpenchannelInteraction'][_0x1d7d('0x18')]({'where':{'id':_0x547f7b[_0x1d7d('0x19')]}})['then'](function(_0x55dba7){if(_0x55dba7){_0x55dba7[_0x1d7d('0x1a')]({'lastMsgAt':_0x547f7b[_0x1d7d('0x1b')],'lastMsgDirection':_0x547f7b[_0x1d7d('0x15')][_0x1d7d('0x14')]()});}})[_0x1d7d('0x1c')](function(_0x53423f){console[_0x1d7d('0x1d')](_0x53423f);});}if(_0x547f7b[_0x1d7d('0x15')]==='out'&&!_0x547f7b[_0x1d7d('0x1e')]){var _0x162c3a;_0x8b258b[_0x1d7d('0x1f')][_0x1d7d('0x20')]()[_0x1d7d('0x21')](function(_0x4db4f2){return _0x8b258b[_0x1d7d('0x22')][_0x1d7d('0x23')]({'where':{'id':_0x547f7b['OpenchannelAccountId']},'include':[{'model':_0x8b258b['OpenchannelInteraction'],'as':_0x1d7d('0x24'),'where':{'id':_0x547f7b[_0x1d7d('0x19')]},'limit':0x1,'include':[{'model':_0x8b258b[_0x1d7d('0x1f')],'as':_0x1d7d('0x25'),'attributes':_[_0x1d7d('0x26')](_0x4db4f2)}]}]});})[_0x1d7d('0x21')](function(_0x54d401){_0x162c3a=_0x54d401[_0x1d7d('0x13')]({'plain':!![]});if(_0x162c3a&&_0x162c3a[_0x1d7d('0x27')]){logger[_0x1d7d('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d7d('0x29'),util[_0x1d7d('0x2a')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x547f7b['id'],_0x162c3a['replyUri']));if(_0x162c3a[_0x1d7d('0x24')]&&_0x162c3a[_0x1d7d('0x24')][_0x1d7d('0x2b')]){_0x547f7b['Interaction']=_[_0x1d7d('0x2c')](_0x162c3a[_0x1d7d('0x24')][0x0],_0x1d7d('0x25'));_0x547f7b[_0x1d7d('0x25')]=_0x162c3a['Interactions'][0x0][_0x1d7d('0x25')];}var _0xa44223={'method':'POST','uri':encodeURI(_0x162c3a['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xa44223[_0x1d7d('0x2d')]){case'GET':_0xa44223['qs']=_0x547f7b;break;case _0x1d7d('0x2e'):_0xa44223[_0x1d7d('0x10')]=_0x547f7b;break;}return rp(_0xa44223)[_0x1d7d('0x21')](function(_0x22c40d){logger[_0x1d7d('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d7d('0x29'),util[_0x1d7d('0x2a')](_0x1d7d('0x2f'),_0x547f7b['id'],_0x162c3a['replyUri']));if(_0x22c40d[_0x1d7d('0x10')][_0x1d7d('0x30')]&&_0x22c40d[_0x1d7d('0x10')]['threadId']!=_0x547f7b['Interaction']['threadId']){return _0x8b258b[_0x1d7d('0x31')][_0x1d7d('0x1a')]({'threadId':_0x22c40d['body'][_0x1d7d('0x30')]},{'logging':!![],'where':{'id':_0x547f7b[_0x1d7d('0x32')]['id']}});}else{return;}})[_0x1d7d('0x21')](function(){return _0x155bfb[_0x1d7d('0x1a')]({'read':!![]});})[_0x1d7d('0x1c')](function(_0x22fec9){logger[_0x1d7d('0x1d')](_0x1d7d('0x33'),_0x1d7d('0x29'),util[_0x1d7d('0x34')](_0x22fec9,{'showHidden':![],'depth':null}));_0x1ad06f();});}else{_0x1ad06f();}})['finally'](function(){_0x1ad06f();});}else{_0x1ad06f();}}},'charset':'utf8mb4','collate':_0x1d7d('0x35')});}; \ No newline at end of file +var _0xb688=['then','replyUri','info','format','length','Interaction','omit','Contact','POST','threadId','update','OpenchannelMessage,\x20%s,\x20%s','afterCreate','inspect','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','catch','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','keys'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb688,0xcf));var _0x8b68=function(_0x5a1378,_0x7ff4){_0x5a1378=_0x5a1378-0x0;var _0x405f6f=_0xb688[_0x5a1378];return _0x405f6f;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[{'name':_0x8b68('0xc'),'fields':[_0x8b68('0xd')],'type':_0x8b68('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f9685,_0x261753,_0x21d944){var _0x24e0b0=_0x583d16[_0x8b68('0xf')];var _0x418775=_0x3f9685[_0x8b68('0x10')]({'plain':!![]});if(_0x418775[_0x8b68('0x11')]['toLowerCase']()==='in'||_0x418775[_0x8b68('0x11')][_0x8b68('0x12')]()===_0x8b68('0x13')&&!_0x418775[_0x8b68('0x14')]&&!_[_0x8b68('0x15')](_0x418775[_0x8b68('0x16')])){_0x24e0b0[_0x8b68('0x17')][_0x8b68('0x18')]({'where':{'id':_0x418775[_0x8b68('0x19')]}})['then'](function(_0xb2df35){if(_0xb2df35){_0xb2df35['update']({'lastMsgAt':_0x418775['createdAt'],'lastMsgDirection':_0x418775[_0x8b68('0x11')][_0x8b68('0x12')]()});}})[_0x8b68('0x1a')](function(_0x5d3468){console['error'](_0x5d3468);});}if(_0x418775[_0x8b68('0x11')]==='out'&&!_0x418775[_0x8b68('0x14')]){var _0xb44923;_0x24e0b0[_0x8b68('0x1b')][_0x8b68('0x1c')]()['then'](function(_0xd17693){return _0x24e0b0[_0x8b68('0x1d')]['find']({'where':{'id':_0x418775[_0x8b68('0x1e')]},'include':[{'model':_0x24e0b0[_0x8b68('0x17')],'as':_0x8b68('0x1f'),'where':{'id':_0x418775[_0x8b68('0x19')]},'limit':0x1,'include':[{'model':_0x24e0b0[_0x8b68('0x1b')],'as':'Contact','attributes':_[_0x8b68('0x20')](_0xd17693)}]}]});})[_0x8b68('0x21')](function(_0x59e9b1){_0xb44923=_0x59e9b1[_0x8b68('0x10')]({'plain':!![]});if(_0xb44923&&_0xb44923[_0x8b68('0x22')]){logger[_0x8b68('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8b68('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x418775['id'],_0xb44923[_0x8b68('0x22')]));if(_0xb44923[_0x8b68('0x1f')]&&_0xb44923[_0x8b68('0x1f')][_0x8b68('0x25')]){_0x418775[_0x8b68('0x26')]=_[_0x8b68('0x27')](_0xb44923['Interactions'][0x0],_0x8b68('0x28'));_0x418775[_0x8b68('0x28')]=_0xb44923['Interactions'][0x0][_0x8b68('0x28')];}var _0x261753={'method':_0x8b68('0x29'),'uri':encodeURI(_0xb44923['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x261753['method']){case'GET':_0x261753['qs']=_0x418775;break;case _0x8b68('0x29'):_0x261753[_0x8b68('0xd')]=_0x418775;break;}return rp(_0x261753)[_0x8b68('0x21')](function(_0x583476){logger[_0x8b68('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8b68('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x418775['id'],_0xb44923[_0x8b68('0x22')]));if(_0x583476[_0x8b68('0xd')]['threadId']&&_0x583476['body'][_0x8b68('0x2a')]!=_0x418775[_0x8b68('0x26')][_0x8b68('0x2a')]){return _0x24e0b0[_0x8b68('0x17')][_0x8b68('0x2b')]({'threadId':_0x583476[_0x8b68('0xd')][_0x8b68('0x2a')]},{'logging':!![],'where':{'id':_0x418775['Interaction']['id']}});}else{return;}})[_0x8b68('0x21')](function(){return _0x3f9685['update']({'read':!![]});})[_0x8b68('0x1a')](function(_0x133b75){logger['error'](_0x8b68('0x2c'),_0x8b68('0x2d'),util[_0x8b68('0x2e')](_0x133b75,{'showHidden':![],'depth':null}));_0x21d944();});}else{_0x21d944();}})['finally'](function(){_0x21d944();});}else{_0x21d944();}}},'charset':'utf8mb4','collate':_0x8b68('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index e15d45e..5b3c5f1 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 _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(_0x3f7405,_0x146e08){var _0x4c5cb0=function(_0x22f07b){while(--_0x22f07b){_0x3f7405['push'](_0x3f7405['shift']());}};_0x4c5cb0(++_0x146e08);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _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(_0x57793b,_0x722733){var _0x3ac8ae=function(_0x5e00aa){while(--_0x5e00aa){_0x57793b['push'](_0x57793b['shift']());}};_0x3ac8ae(++_0x722733);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'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 e4ae430..1185365 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 _0x234f=['./openchannelMessage.events','save','remove','update','removeListener','register','openchannelMessage:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x234f,0xb6));var _0xf234=function(_0x568436,_0x20e511){_0x568436=_0x568436-0x0;var _0x418aed=_0x234f[_0x568436];return _0x418aed;};'use strict';var OpenchannelMessageEvents=require(_0xf234('0x0'));var events=[_0xf234('0x1'),_0xf234('0x2'),_0xf234('0x3')];function createListener(_0x3fa40d,_0x4aa60c){return function(_0x4ca67f){_0x4aa60c['emit'](_0x3fa40d,_0x4ca67f);};}function removeListener(_0x57b4f1,_0x2d3ec1){return function(){OpenchannelMessageEvents[_0xf234('0x4')](_0x57b4f1,_0x2d3ec1);};}exports[_0xf234('0x5')]=function(_0x3bfa94){for(var _0x334f1c=0x0,_0x508303=events['length'];_0x334f1c<_0x508303;_0x334f1c++){var _0x53fc91=events[_0x334f1c];var _0x2f08f3=createListener(_0xf234('0x6')+_0x53fc91,_0x3bfa94);OpenchannelMessageEvents['on'](_0x53fc91,_0x2f08f3);}}; \ No newline at end of file +var _0x1d19=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x479450,_0x4914a6){var _0x30d1a3=function(_0x215e35){while(--_0x215e35){_0x479450['push'](_0x479450['shift']());}};_0x30d1a3(++_0x4914a6);}(_0x1d19,0xb1));var _0x91d1=function(_0x27d4d5,_0x5072c8){_0x27d4d5=_0x27d4d5-0x0;var _0x3be690=_0x1d19[_0x27d4d5];return _0x3be690;};'use strict';var OpenchannelMessageEvents=require(_0x91d1('0x0'));var events=[_0x91d1('0x1'),_0x91d1('0x2'),_0x91d1('0x3')];function createListener(_0xa6cea1,_0x1826d4){return function(_0x468c3a){_0x1826d4[_0x91d1('0x4')](_0xa6cea1,_0x468c3a);};}function removeListener(_0x165633,_0x44b41b){return function(){OpenchannelMessageEvents[_0x91d1('0x5')](_0x165633,_0x44b41b);};}exports[_0x91d1('0x6')]=function(_0x5c9b2b){for(var _0x18b5a5=0x0,_0x500337=events['length'];_0x18b5a5<_0x500337;_0x18b5a5++){var _0x4fe83b=events[_0x18b5a5];var _0x20553c=createListener(_0x91d1('0x7')+_0x4fe83b,_0x5c9b2b);OpenchannelMessageEvents['on'](_0x4fe83b,_0x20553c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 535d253..66031fe 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 _0x795a=['get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','post','addTeams','put','/:id','delete','destroy','removeAgents','exports','util','path','express','fs-extra','../../components/auth/service','./openchannelQueue.controller'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x795a,0xa2));var _0xa795=function(_0x4ca11a,_0x45ed73){_0x4ca11a=_0x4ca11a-0x0;var _0xcd528c=_0x795a[_0x4ca11a];return _0xcd528c;};'use strict';var multer=require('multer');var util=require(_0xa795('0x0'));var path=require(_0xa795('0x1'));var timeout=require('connect-timeout');var express=require(_0xa795('0x2'));var router=express['Router']();var fs_extra=require(_0xa795('0x3'));var auth=require(_0xa795('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa795('0x5'));router[_0xa795('0x6')]('/',auth[_0xa795('0x7')](),controller[_0xa795('0x8')]);router['get'](_0xa795('0x9'),auth['isAuthenticated'](),controller[_0xa795('0xa')]);router['get']('/:id',auth[_0xa795('0x7')](),controller[_0xa795('0xb')]);router[_0xa795('0x6')](_0xa795('0xc'),auth[_0xa795('0x7')](),controller[_0xa795('0xd')]);router[_0xa795('0x6')](_0xa795('0xe'),auth['isAuthenticated'](),controller['getTeams']);router[_0xa795('0x6')](_0xa795('0xf'),auth[_0xa795('0x7')](),controller['getAgents']);router[_0xa795('0x10')]('/',auth[_0xa795('0x7')](),controller['create']);router[_0xa795('0x10')](_0xa795('0xe'),auth[_0xa795('0x7')](),controller[_0xa795('0x11')]);router[_0xa795('0x10')](_0xa795('0xf'),auth[_0xa795('0x7')](),controller['addAgents']);router[_0xa795('0x12')](_0xa795('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xa795('0x14')]('/:id',auth[_0xa795('0x7')](),controller[_0xa795('0x15')]);router[_0xa795('0x14')](_0xa795('0xe'),auth[_0xa795('0x7')](),controller['removeTeams']);router[_0xa795('0x14')](_0xa795('0xf'),auth[_0xa795('0x7')](),controller[_0xa795('0x16')]);module[_0xa795('0x17')]=router; \ No newline at end of file +var _0x8958=['util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','update','delete','destroy','removeTeams','removeAgents'];(function(_0xb04f1d,_0x518120){var _0x38b314=function(_0x379e6c){while(--_0x379e6c){_0xb04f1d['push'](_0xb04f1d['shift']());}};_0x38b314(++_0x518120);}(_0x8958,0x180));var _0x8895=function(_0x176943,_0x50969d){_0x176943=_0x176943-0x0;var _0x5c07e8=_0x8958[_0x176943];return _0x5c07e8;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require(_0x8895('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8895('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x3'));var config=require(_0x8895('0x4'));var controller=require(_0x8895('0x5'));router[_0x8895('0x6')]('/',auth['isAuthenticated'](),controller[_0x8895('0x7')]);router[_0x8895('0x6')](_0x8895('0x8'),auth[_0x8895('0x9')](),controller['describe']);router[_0x8895('0x6')](_0x8895('0xa'),auth[_0x8895('0x9')](),controller[_0x8895('0xb')]);router[_0x8895('0x6')](_0x8895('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x8895('0x6')](_0x8895('0xd'),auth['isAuthenticated'](),controller[_0x8895('0xe')]);router[_0x8895('0x6')](_0x8895('0xf'),auth[_0x8895('0x9')](),controller[_0x8895('0x10')]);router[_0x8895('0x11')]('/',auth[_0x8895('0x9')](),controller['create']);router['post'](_0x8895('0xd'),auth[_0x8895('0x9')](),controller['addTeams']);router[_0x8895('0x11')](_0x8895('0xf'),auth['isAuthenticated'](),controller[_0x8895('0x12')]);router['put'](_0x8895('0xa'),auth[_0x8895('0x9')](),controller[_0x8895('0x13')]);router[_0x8895('0x14')]('/:id',auth[_0x8895('0x9')](),controller[_0x8895('0x15')]);router['delete'](_0x8895('0xd'),auth[_0x8895('0x9')](),controller[_0x8895('0x16')]);router[_0x8895('0x14')]('/:id/users',auth[_0x8895('0x9')](),controller[_0x8895('0x17')]);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 2ec6e6b..aae828d 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 _0x85e1=['roundrobin','STRING','name','INTEGER','rrmemory'];(function(_0x57d8c7,_0x11acde){var _0x4d9bca=function(_0x4f494b){while(--_0x4f494b){_0x57d8c7['push'](_0x57d8c7['shift']());}};_0x4d9bca(++_0x11acde);}(_0x85e1,0x173));var _0x185e=function(_0xf781cd,_0x353cc2){_0xf781cd=_0xf781cd-0x0;var _0x4d2b92=_0x85e1[_0xf781cd];return _0x4d2b92;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x185e('0x0')],'unique':_0x185e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x185e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x185e('0x3'),'beepall',_0x185e('0x4'))}}; \ No newline at end of file +var _0x9872=['ENUM','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x562f75,_0x12ece1){var _0x574c95=function(_0x39e01c){while(--_0x39e01c){_0x562f75['push'](_0x562f75['shift']());}};_0x574c95(++_0x12ece1);}(_0x9872,0x8c));var _0x2987=function(_0x353897,_0x8c94b9){_0x353897=_0x353897-0x0;var _0x22529a=_0x9872[_0x353897];return _0x22529a;};'use strict';var Sequelize=require(_0x2987('0x0'));module[_0x2987('0x1')]={'name':{'type':Sequelize[_0x2987('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2987('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2987('0x4')]('rrmemory','beepall',_0x2987('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 5fdd6f4..c6cba51 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 _0x9acc=['body','get','role','user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserOpenchannelQueue','length','hasOwnProperty','nolimit','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','value','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','order','sort','pick','filter','where','VIRTUAL','merge','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','keys','find','create'];(function(_0x392886,_0x56f1d5){var _0x2bc44e=function(_0x209ae){while(--_0x209ae){_0x392886['push'](_0x392886['shift']());}};_0x2bc44e(++_0x56f1d5);}(_0x9acc,0x157));var _0xc9ac=function(_0x193b86,_0x47c614){_0x193b86=_0x193b86-0x0;var _0x1a20f0=_0x9acc[_0x193b86];return _0x1a20f0;};'use strict';var emlformat=require(_0xc9ac('0x0'));var rimraf=require(_0xc9ac('0x1'));var zipdir=require(_0xc9ac('0x2'));var jsonpatch=require(_0xc9ac('0x3'));var rp=require('request-promise');var moment=require(_0xc9ac('0x4'));var BPromise=require(_0xc9ac('0x5'));var Mustache=require(_0xc9ac('0x6'));var util=require(_0xc9ac('0x7'));var path=require(_0xc9ac('0x8'));var sox=require(_0xc9ac('0x9'));var csv=require(_0xc9ac('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9ac('0xb'));var _=require('lodash');var squel=require(_0xc9ac('0xc'));var crypto=require(_0xc9ac('0xd'));var jsforce=require(_0xc9ac('0xe'));var deskjs=require(_0xc9ac('0xf'));var toCsv=require(_0xc9ac('0xa'));var querystring=require(_0xc9ac('0x10'));var Papa=require('papaparse');var Redis=require(_0xc9ac('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc9ac('0x12'));var as=require(_0xc9ac('0x13'));var hardwareService=require(_0xc9ac('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc9ac('0x15'));var config=require(_0xc9ac('0x16'));var licenseUtil=require(_0xc9ac('0x17'));var db=require(_0xc9ac('0x18'))['db'];config[_0xc9ac('0x19')]=_[_0xc9ac('0x1a')](config[_0xc9ac('0x19')],{'host':_0xc9ac('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc9ac('0x1c'))['register'](socket);function respondWithStatusCode(_0x3b396d,_0x59d3f9){_0x59d3f9=_0x59d3f9||0xcc;return function(_0x24326f){if(_0x24326f){return _0x3b396d[_0xc9ac('0x1d')](_0x59d3f9);}return _0x3b396d['status'](_0x59d3f9)[_0xc9ac('0x1e')]();};}function respondWithResult(_0x573b6a,_0x2fa708){_0x2fa708=_0x2fa708||0xc8;return function(_0x3e0101){if(_0x3e0101){return _0x573b6a[_0xc9ac('0x1f')](_0x2fa708)[_0xc9ac('0x20')](_0x3e0101);}};}function respondWithFilteredResult(_0x2df29e,_0x50c054){return function(_0x1e0169){if(_0x1e0169){var _0x58ce17=typeof _0x50c054[_0xc9ac('0x21')]===_0xc9ac('0x22')&&typeof _0x50c054[_0xc9ac('0x23')]==='undefined';var _0x29056d=_0x1e0169[_0xc9ac('0x24')];var _0x24f42b=_0x58ce17?0x0:_0x50c054['offset'];var _0x45bedf=_0x58ce17?_0x1e0169[_0xc9ac('0x24')]:_0x50c054[_0xc9ac('0x21')]+_0x50c054[_0xc9ac('0x23')];var _0x4c12a2;if(_0x45bedf>=_0x29056d){_0x45bedf=_0x29056d;_0x4c12a2=0xc8;}else{_0x4c12a2=0xce;}_0x2df29e[_0xc9ac('0x1f')](_0x4c12a2);return _0x2df29e[_0xc9ac('0x25')]('Content-Range',_0x24f42b+'-'+_0x45bedf+'/'+_0x29056d)['json'](_0x1e0169);}return null;};}function patchUpdates(_0x142dd5){return function(_0x62d3eb){try{jsonpatch[_0xc9ac('0x26')](_0x62d3eb,_0x142dd5,!![]);}catch(_0x1cdcef){return BPromise[_0xc9ac('0x27')](_0x1cdcef);}return _0x62d3eb[_0xc9ac('0x28')]();};}function saveUpdates(_0x40f803,_0x18b595){return function(_0x213fbc){if(_0x213fbc){return _0x213fbc[_0xc9ac('0x29')](_0x40f803)[_0xc9ac('0x2a')](function(_0x5dbd41){return _0x5dbd41;});}return null;};}function removeEntity(_0x2f49b5,_0x233965){return function(_0x32857e){if(_0x32857e){return _0x32857e[_0xc9ac('0x2b')]()[_0xc9ac('0x2a')](function(){var _0x4bb7aa=_0x32857e['get']({'plain':!![]});var _0x2327dd=_0xc9ac('0x2c');return db[_0xc9ac('0x2d')][_0xc9ac('0x2b')]({'where':{'type':_0x2327dd,'resourceId':_0x4bb7aa['id']}})[_0xc9ac('0x2a')](function(){return _0x32857e;});})[_0xc9ac('0x2a')](function(){_0x2f49b5[_0xc9ac('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x94dea0,_0x310dee){return function(_0x279d3e){if(!_0x279d3e){_0x94dea0[_0xc9ac('0x1d')](0x194);}return _0x279d3e;};}function handleError(_0x4cf0bb,_0x319542){_0x319542=_0x319542||0x1f4;return function(_0x589589){logger[_0xc9ac('0x2e')](_0x589589[_0xc9ac('0x2f')]);if(_0x589589[_0xc9ac('0x30')]){delete _0x589589[_0xc9ac('0x30')];}_0x4cf0bb[_0xc9ac('0x1f')](_0x319542)[_0xc9ac('0x31')](_0x589589);};}exports[_0xc9ac('0x32')]=function(_0x2b04bf,_0x254140){var _0x5aea09={},_0x13f6cf={},_0x1c01fd={'count':0x0,'rows':[]};var _0xa1fea1=_[_0xc9ac('0x33')](db['OpenchannelQueue'][_0xc9ac('0x34')],function(_0x2790fa){return{'name':_0x2790fa[_0xc9ac('0x35')],'type':_0x2790fa[_0xc9ac('0x36')]['key']};});_0x13f6cf[_0xc9ac('0x37')]=_['map'](_0xa1fea1,_0xc9ac('0x30'));_0x13f6cf[_0xc9ac('0x38')]=_['keys'](_0x2b04bf[_0xc9ac('0x38')]);_0x13f6cf[_0xc9ac('0x39')]=_[_0xc9ac('0x3a')](_0x13f6cf[_0xc9ac('0x37')],_0x13f6cf[_0xc9ac('0x38')]);_0x5aea09[_0xc9ac('0x3b')]=_[_0xc9ac('0x3a')](_0x13f6cf[_0xc9ac('0x37')],qs[_0xc9ac('0x3c')](_0x2b04bf['query']['fields']));_0x5aea09[_0xc9ac('0x3b')]=_0x5aea09[_0xc9ac('0x3b')]['length']?_0x5aea09['attributes']:_0x13f6cf[_0xc9ac('0x37')];if(!_0x2b04bf['query']['hasOwnProperty']('nolimit')){_0x5aea09[_0xc9ac('0x23')]=qs['limit'](_0x2b04bf[_0xc9ac('0x38')][_0xc9ac('0x23')]);_0x5aea09[_0xc9ac('0x21')]=qs[_0xc9ac('0x21')](_0x2b04bf[_0xc9ac('0x38')]['offset']);}_0x5aea09[_0xc9ac('0x3d')]=qs[_0xc9ac('0x3e')](_0x2b04bf[_0xc9ac('0x38')][_0xc9ac('0x3e')]);_0x5aea09['where']=qs[_0xc9ac('0x39')](_[_0xc9ac('0x3f')](_0x2b04bf[_0xc9ac('0x38')],_0x13f6cf[_0xc9ac('0x39')]),_0xa1fea1);if(_0x2b04bf[_0xc9ac('0x38')][_0xc9ac('0x40')]){_0x5aea09[_0xc9ac('0x41')]=_['merge'](_0x5aea09[_0xc9ac('0x41')],{'$or':_[_0xc9ac('0x33')](_0xa1fea1,function(_0x364d96){if(_0x364d96[_0xc9ac('0x36')]!==_0xc9ac('0x42')){var _0x519c6a={};_0x519c6a[_0x364d96[_0xc9ac('0x30')]]={'$like':'%'+_0x2b04bf[_0xc9ac('0x38')][_0xc9ac('0x40')]+'%'};return _0x519c6a;}})});}_0x5aea09=_[_0xc9ac('0x43')]({},_0x5aea09,_0x2b04bf[_0xc9ac('0x44')]);var _0xabe6ca={'where':_0x5aea09[_0xc9ac('0x41')]};return db[_0xc9ac('0x45')][_0xc9ac('0x24')](_0xabe6ca)[_0xc9ac('0x2a')](function(_0x288b23){_0x1c01fd[_0xc9ac('0x24')]=_0x288b23;if(_0x2b04bf[_0xc9ac('0x38')][_0xc9ac('0x46')]){_0x5aea09[_0xc9ac('0x47')]=[{'all':!![]}];}return db[_0xc9ac('0x45')][_0xc9ac('0x48')](_0x5aea09);})[_0xc9ac('0x2a')](function(_0x3d4a71){_0x1c01fd[_0xc9ac('0x49')]=_0x3d4a71;return _0x1c01fd;})[_0xc9ac('0x2a')](respondWithFilteredResult(_0x254140,_0x5aea09))[_0xc9ac('0x4a')](handleError(_0x254140,null));};exports[_0xc9ac('0x4b')]=function(_0x1b7696,_0x6c0dcd){var _0x1c9136={'raw':!![],'where':{'id':_0x1b7696[_0xc9ac('0x4c')]['id']}},_0x1fae3d={};_0x1fae3d[_0xc9ac('0x37')]=_[_0xc9ac('0x4d')](db[_0xc9ac('0x45')][_0xc9ac('0x34')]);_0x1fae3d[_0xc9ac('0x38')]=_[_0xc9ac('0x4d')](_0x1b7696[_0xc9ac('0x38')]);_0x1fae3d['filters']=_[_0xc9ac('0x3a')](_0x1fae3d[_0xc9ac('0x37')],_0x1fae3d[_0xc9ac('0x38')]);_0x1c9136['attributes']=_[_0xc9ac('0x3a')](_0x1fae3d['model'],qs[_0xc9ac('0x3c')](_0x1b7696[_0xc9ac('0x38')][_0xc9ac('0x3c')]));_0x1c9136[_0xc9ac('0x3b')]=_0x1c9136[_0xc9ac('0x3b')]['length']?_0x1c9136[_0xc9ac('0x3b')]:_0x1fae3d[_0xc9ac('0x37')];if(_0x1b7696[_0xc9ac('0x38')][_0xc9ac('0x46')]){_0x1c9136['include']=[{'all':!![]}];}_0x1c9136=_['merge']({},_0x1c9136,_0x1b7696[_0xc9ac('0x44')]);return db[_0xc9ac('0x45')][_0xc9ac('0x4e')](_0x1c9136)['then'](handleEntityNotFound(_0x6c0dcd,null))['then'](respondWithResult(_0x6c0dcd,null))[_0xc9ac('0x4a')](handleError(_0x6c0dcd,null));};exports[_0xc9ac('0x4f')]=function(_0x3f590f,_0x398eac){return db[_0xc9ac('0x45')][_0xc9ac('0x4f')](_0x3f590f[_0xc9ac('0x50')],{})[_0xc9ac('0x2a')](function(_0x55c90a){var _0x184453=_0x3f590f['user'][_0xc9ac('0x51')]({'plain':!![]});if(!_0x184453)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x184453[_0xc9ac('0x52')]===_0xc9ac('0x53')){var _0x471194=_0x55c90a[_0xc9ac('0x51')]({'plain':!![]});var _0x1321e6=_0xc9ac('0x2c');return db[_0xc9ac('0x54')][_0xc9ac('0x4e')]({'where':{'name':_0x1321e6,'userProfileId':_0x184453[_0xc9ac('0x55')]},'raw':!![]})[_0xc9ac('0x2a')](function(_0x1dac85){if(_0x1dac85&&_0x1dac85[_0xc9ac('0x56')]===0x0){return db[_0xc9ac('0x2d')][_0xc9ac('0x4f')]({'name':_0x471194[_0xc9ac('0x30')],'resourceId':_0x471194['id'],'type':_0x1dac85[_0xc9ac('0x30')],'sectionId':_0x1dac85['id']},{})[_0xc9ac('0x2a')](function(){return _0x55c90a;});}else{return _0x55c90a;}})['catch'](function(_0xa5671f){logger[_0xc9ac('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa5671f);throw _0xa5671f;});}return _0x55c90a;})['then'](respondWithResult(_0x398eac,0xc9))[_0xc9ac('0x4a')](handleError(_0x398eac,null));};exports[_0xc9ac('0x29')]=function(_0x499daa,_0x2c932d){if(_0x499daa['body']['id']){delete _0x499daa[_0xc9ac('0x50')]['id'];}return db[_0xc9ac('0x45')]['find']({'where':{'id':_0x499daa[_0xc9ac('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c932d,null))['then'](saveUpdates(_0x499daa[_0xc9ac('0x50')],null))[_0xc9ac('0x2a')](respondWithResult(_0x2c932d,null))['catch'](handleError(_0x2c932d,null));};exports['destroy']=function(_0x261f21,_0x383bf7){return db['OpenchannelQueue'][_0xc9ac('0x4e')]({'where':{'id':_0x261f21[_0xc9ac('0x4c')]['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x383bf7,null))[_0xc9ac('0x2a')](removeEntity(_0x383bf7,null))[_0xc9ac('0x4a')](handleError(_0x383bf7,null));};exports['describe']=function(_0x3d52e2,_0x15adc5){return db['OpenchannelQueue'][_0xc9ac('0x57')]()[_0xc9ac('0x2a')](respondWithResult(_0x15adc5,null))[_0xc9ac('0x4a')](handleError(_0x15adc5,null));};exports[_0xc9ac('0x58')]=function(_0x2bfcca,_0x4fe09b,_0x1a34fb){var _0xd11fab={'raw':!![],'where':{}},_0x4e874a={},_0x1fdfd3;return db['OpenchannelQueue'][_0xc9ac('0x59')]({'where':{'id':_0x2bfcca['params']['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x4fe09b,null))[_0xc9ac('0x2a')](function(_0x5de8e1){if(_0x5de8e1){_0x1fdfd3=_0x5de8e1[_0xc9ac('0x51')]({'plain':!![]});_0x4e874a[_0xc9ac('0x37')]=_[_0xc9ac('0x4d')](db[_0xc9ac('0x5a')]['rawAttributes']);_0x4e874a[_0xc9ac('0x38')]=_[_0xc9ac('0x4d')](_0x2bfcca['query']);_0x4e874a[_0xc9ac('0x39')]=_[_0xc9ac('0x3a')](_0x4e874a[_0xc9ac('0x37')],_0x4e874a[_0xc9ac('0x38')]);_0xd11fab[_0xc9ac('0x3b')]=_['intersection'](_0x4e874a[_0xc9ac('0x37')],qs['fields'](_0x2bfcca[_0xc9ac('0x38')][_0xc9ac('0x3c')]));_0xd11fab[_0xc9ac('0x3b')]=_0xd11fab[_0xc9ac('0x3b')][_0xc9ac('0x5b')]?_0xd11fab['attributes']:_0x4e874a[_0xc9ac('0x37')];if(!_0x2bfcca['query'][_0xc9ac('0x5c')](_0xc9ac('0x5d'))){_0xd11fab[_0xc9ac('0x23')]=qs[_0xc9ac('0x23')](_0x2bfcca[_0xc9ac('0x38')][_0xc9ac('0x23')]);_0xd11fab[_0xc9ac('0x21')]=qs[_0xc9ac('0x21')](_0x2bfcca[_0xc9ac('0x38')][_0xc9ac('0x21')]);}_0xd11fab[_0xc9ac('0x3d')]=qs[_0xc9ac('0x3e')](_0x2bfcca['query']['sort']);_0xd11fab['where']=qs['filters'](_['pick'](_0x2bfcca[_0xc9ac('0x38')],_0x4e874a[_0xc9ac('0x39')]));_0xd11fab[_0xc9ac('0x41')][_0xc9ac('0x5e')]=_0x5de8e1['id'];if(_0x2bfcca[_0xc9ac('0x38')][_0xc9ac('0x40')]){_0xd11fab[_0xc9ac('0x41')]=_[_0xc9ac('0x43')](_0xd11fab[_0xc9ac('0x41')],{'$or':_[_0xc9ac('0x33')](_0xd11fab[_0xc9ac('0x3b')],function(_0x2cbfd0){var _0x26540a={};_0x26540a[_0x2cbfd0]={'$like':'%'+_0x2bfcca[_0xc9ac('0x38')][_0xc9ac('0x40')]+'%'};return _0x26540a;})});}_0xd11fab=_[_0xc9ac('0x43')]({},_0xd11fab,_0x2bfcca[_0xc9ac('0x44')]);return db['UserOpenchannelQueue']['findAll'](_0xd11fab);}})[_0xc9ac('0x2a')](function(_0x426585){if(_0x426585){return db[_0xc9ac('0x5f')][_0xc9ac('0x60')]({'where':{'id':_[_0xc9ac('0x33')](_0x426585,'UserId'),'role':_0xc9ac('0x61')},'attributes':['id',_0xc9ac('0x30'),_0xc9ac('0x62'),_0xc9ac('0x63'),_0xc9ac('0x64')]});}})[_0xc9ac('0x2a')](function(_0x5b0f34){if(_0x5b0f34){return{'count':_0x5b0f34[_0xc9ac('0x24')],'rows':_[_0xc9ac('0x33')](_0x5b0f34[_0xc9ac('0x49')],function(_0x12485e){return{'membername':_0x12485e[_0xc9ac('0x30')],'UserId':_0x12485e['id'],'queue_name':_0x1fdfd3['name'],'OpenchannelQueueId':_0x1fdfd3['id'],'interface':util[_0xc9ac('0x65')](_0xc9ac('0x66'),_0xc9ac('0x67'),_0x12485e[_0xc9ac('0x30')]),'penalty':0x0,'paused':_0x12485e[_0xc9ac('0x62')],'createdAt':_0x12485e[_0xc9ac('0x64')],'updatedAt':_0x12485e[_0xc9ac('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc9ac('0x2a')](respondWithFilteredResult(_0x4fe09b,_0xd11fab))[_0xc9ac('0x4a')](handleError(_0x4fe09b,null));};exports[_0xc9ac('0x68')]=function(_0x55c0bb,_0x20f063,_0x21c07a){var _0x223330={};var _0x1121dc={};var _0x5218ef;var _0x125e12;return db[_0xc9ac('0x45')]['findOne']({'where':{'id':_0x55c0bb['params']['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x20f063,null))['then'](function(_0x56610e){if(_0x56610e){_0x5218ef=_0x56610e;_0x1121dc[_0xc9ac('0x37')]=_[_0xc9ac('0x4d')](db[_0xc9ac('0x69')][_0xc9ac('0x34')]);_0x1121dc[_0xc9ac('0x38')]=_[_0xc9ac('0x4d')](_0x55c0bb['query']);_0x1121dc[_0xc9ac('0x39')]=_['intersection'](_0x1121dc[_0xc9ac('0x37')],_0x1121dc[_0xc9ac('0x38')]);_0x223330[_0xc9ac('0x3b')]=_[_0xc9ac('0x3a')](_0x1121dc[_0xc9ac('0x37')],qs['fields'](_0x55c0bb[_0xc9ac('0x38')][_0xc9ac('0x3c')]));_0x223330[_0xc9ac('0x3b')]=_0x223330[_0xc9ac('0x3b')][_0xc9ac('0x5b')]?_0x223330[_0xc9ac('0x3b')]:_0x1121dc['model'];_0x223330['order']=qs[_0xc9ac('0x3e')](_0x55c0bb[_0xc9ac('0x38')]['sort']);_0x223330['where']=qs[_0xc9ac('0x39')](_['pick'](_0x55c0bb[_0xc9ac('0x38')],_0x1121dc[_0xc9ac('0x39')]));if(_0x55c0bb[_0xc9ac('0x38')][_0xc9ac('0x40')]){_0x223330['where']=_[_0xc9ac('0x43')](_0x223330['where'],{'$or':_[_0xc9ac('0x33')](_0x223330['attributes'],function(_0x1a3e25){var _0x2d8603={};_0x2d8603[_0x1a3e25]={'$like':'%'+_0x55c0bb['query'][_0xc9ac('0x40')]+'%'};return _0x2d8603;})});}_0x223330=_[_0xc9ac('0x43')]({},_0x223330,_0x55c0bb[_0xc9ac('0x44')]);return _0x5218ef['getTeams'](_0x223330);}})[_0xc9ac('0x2a')](function(_0x14e3f7){if(_0x14e3f7){_0x125e12=_0x14e3f7[_0xc9ac('0x5b')];if(!_0x55c0bb[_0xc9ac('0x38')][_0xc9ac('0x5c')](_0xc9ac('0x5d'))){_0x223330[_0xc9ac('0x23')]=qs['limit'](_0x55c0bb['query'][_0xc9ac('0x23')]);_0x223330['offset']=qs[_0xc9ac('0x21')](_0x55c0bb[_0xc9ac('0x38')][_0xc9ac('0x21')]);}return _0x5218ef[_0xc9ac('0x68')](_0x223330);}})['then'](function(_0x477e50){if(_0x477e50){return _0x477e50?{'count':_0x125e12,'rows':_0x477e50}:null;}})[_0xc9ac('0x2a')](respondWithResult(_0x20f063,null))[_0xc9ac('0x4a')](handleError(_0x20f063,null));};exports[_0xc9ac('0x6a')]=function(_0x12a03d,_0x5d5d4e,_0x82ab5f){var _0x327bf2=_0x12a03d[_0xc9ac('0x50')][_0xc9ac('0x6b')];return db[_0xc9ac('0x69')][_0xc9ac('0x48')]({'where':{'id':_0x327bf2},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc9ac('0x6c'),'attributes':['id',_0xc9ac('0x30'),_0xc9ac('0x6d'),_0xc9ac('0x6e'),_0xc9ac('0x6f')],'raw':!![]}]})[_0xc9ac('0x2a')](function(_0x5de12a){if(_0x5de12a){var _0x4297dc=_['flatMap'](_0x5de12a,function(_0x1dabb5){var _0x5aac4c=_0x1dabb5['get']({'plain':!![]});return _0x5aac4c[_0xc9ac('0x6c')];});return db[_0xc9ac('0x45')][_0xc9ac('0x4e')]({'where':{'id':_0x12a03d[_0xc9ac('0x4c')]['id']}})[_0xc9ac('0x2a')](function(_0x136924){return db['sequelize'][_0xc9ac('0x70')](function(_0x1039ee){return _0x136924[_0xc9ac('0x6a')](_0x327bf2,{'transaction':_0x1039ee})[_0xc9ac('0x2a')](function(){return BPromise['each'](_0x4297dc,function(_0x32c3f3){return db[_0xc9ac('0x5a')]['findOrCreate']({'where':{'UserId':_0x32c3f3['id'],'OpenchannelQueueId':_0x12a03d[_0xc9ac('0x4c')]['id']},'transaction':_0x1039ee});});})[_0xc9ac('0x2a')](function(){_0x4297dc[_0xc9ac('0x71')](function(_0x59539e){socket[_0xc9ac('0x72')](_0xc9ac('0x73'),{'UserId':_0x59539e['id'],'OpenchannelQueueId':_0x136924['id']});});});});});}})[_0xc9ac('0x2a')](respondWithStatusCode(_0x5d5d4e,null))[_0xc9ac('0x4a')](handleError(_0x5d5d4e,null));};exports['removeTeams']=function(_0x3fdda8,_0x502614,_0x254fa5){return db[_0xc9ac('0x69')][_0xc9ac('0x48')]({'where':{'id':_0x3fdda8['query'][_0xc9ac('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc9ac('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xc9ac('0x2a')](handleEntityNotFound(_0x502614,null))[_0xc9ac('0x2a')](function(_0x4250ff){var _0x521b00=_[_0xc9ac('0x33')](_0x4250ff,'id');var _0x4442c7=[];var _0x5ad16c=[];var _0x5add6a=squel[_0xc9ac('0x74')]();_0x5add6a[_0xc9ac('0x75')](_0xc9ac('0x76'))['from'](_0xc9ac('0x77'),'tq')[_0xc9ac('0x78')]('user_has_teams','ut',_0xc9ac('0x79'))['where']('OpenchannelQueueId\x20=\x20?',_0x3fdda8[_0xc9ac('0x4c')]['id']);for(var _0x21a16a=0x0;_0x21a16a<_0x4250ff['length'];_0x21a16a+=0x1){let _0x33e5a6=_0x4250ff[_0x21a16a];for(var _0x1c4390=0x0;_0x1c4390<_0x33e5a6[_0xc9ac('0x6c')][_0xc9ac('0x5b')];_0x1c4390+=0x1){let _0x51ef75=_0x33e5a6[_0xc9ac('0x6c')][_0x1c4390];var _0x336925=_0x5add6a['clone']();_0x336925[_0xc9ac('0x41')](_0xc9ac('0x7a'),_0x51ef75['id']);_0x5ad16c[_0xc9ac('0x7b')](db[_0xc9ac('0x7c')][_0xc9ac('0x38')](_0x336925[_0xc9ac('0x7d')](),{'type':db[_0xc9ac('0x7c')][_0xc9ac('0x7e')][_0xc9ac('0x7f')]})[_0xc9ac('0x2a')](function(_0x5e2d0c){if(_0x5e2d0c[_0xc9ac('0x5b')]===0x1){return _0x51ef75['id'];}else{var _0x19122e=_[_0xc9ac('0x80')](_[_0xc9ac('0x33')](_0x5e2d0c,'TeamId'),function(_0x1f47ce){return _[_0xc9ac('0x81')](_0x521b00,_0x1f47ce);});if(_0x19122e){return _0x51ef75['id'];}}}));}}return BPromise[_0xc9ac('0x82')](_0x5ad16c)[_0xc9ac('0x2a')](function(_0x24c695){_0x4442c7=_(_0x4442c7)['union'](_0x24c695)['compact']()[_0xc9ac('0x83')]();return db[_0xc9ac('0x45')][_0xc9ac('0x4e')]({'where':{'id':_0x3fdda8[_0xc9ac('0x4c')]['id']}})[_0xc9ac('0x2a')](function(_0x479233){return db[_0xc9ac('0x7c')][_0xc9ac('0x70')](function(_0x272e94){return _0x479233[_0xc9ac('0x84')](_0x3fdda8['query'][_0xc9ac('0x6b')],{'transaction':_0x272e94})['then'](function(){if(!_[_0xc9ac('0x85')](_0x4442c7)){return _0x479233['removeAgents'](_0x4442c7,{'transaction':_0x272e94});}})[_0xc9ac('0x2a')](function(){_0x4442c7[_0xc9ac('0x71')](function(_0x58a1fb){socket[_0xc9ac('0x72')](_0xc9ac('0x86'),{'UserId':_0x58a1fb,'OpenchannelQueueId':_0x479233['id']});});});});});});})['then'](respondWithStatusCode(_0x502614,null))[_0xc9ac('0x4a')](handleError(_0x502614,null));};exports[_0xc9ac('0x87')]=function(_0x6daa2d,_0x2e73fb,_0x5b5f35){return db[_0xc9ac('0x45')][_0xc9ac('0x4e')]({'where':{'id':_0x6daa2d[_0xc9ac('0x4c')]['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x2e73fb,null))[_0xc9ac('0x2a')](function(_0x29d345){if(_0x29d345){return _0x29d345['addAgents'](_0x6daa2d[_0xc9ac('0x50')]['ids'],_[_0xc9ac('0x88')](_0x6daa2d[_0xc9ac('0x50')],[_0xc9ac('0x6b'),'id'])||{})[_0xc9ac('0x89')](function(_0x2d9e17){for(var _0x17c379=0x0;_0x17c379<_0x6daa2d['body'][_0xc9ac('0x6b')][_0xc9ac('0x5b')];_0x17c379+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x6daa2d[_0xc9ac('0x50')][_0xc9ac('0x6b')][_0x17c379]),'OpenchannelQueueId':Number(_0x6daa2d[_0xc9ac('0x4c')]['id'])});}return _0x2d9e17;});}})[_0xc9ac('0x2a')](respondWithResult(_0x2e73fb,null))[_0xc9ac('0x4a')](handleError(_0x2e73fb,null));};exports['removeAgents']=function(_0x2ecc13,_0x300bb0,_0x36090c){return db[_0xc9ac('0x45')][_0xc9ac('0x4e')]({'where':{'id':_0x2ecc13[_0xc9ac('0x4c')]['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x300bb0,null))['then'](function(_0x41848e){if(_0x41848e){return _0x41848e[_0xc9ac('0x8a')](_0x2ecc13[_0xc9ac('0x38')][_0xc9ac('0x6b')])[_0xc9ac('0x2a')](function(){if(_[_0xc9ac('0x8b')](_0x2ecc13['query'][_0xc9ac('0x6b')])){for(var _0x44e413=0x0;_0x44e413<_0x2ecc13[_0xc9ac('0x38')][_0xc9ac('0x6b')]['length'];_0x44e413+=0x1){socket['emit'](_0xc9ac('0x86'),{'UserId':Number(_0x2ecc13[_0xc9ac('0x38')][_0xc9ac('0x6b')][_0x44e413]),'OpenchannelQueueId':Number(_0x2ecc13[_0xc9ac('0x4c')]['id'])});}}else{socket[_0xc9ac('0x72')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2ecc13['query']['ids']),'OpenchannelQueueId':Number(_0x2ecc13[_0xc9ac('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x300bb0,null))['catch'](handleError(_0x300bb0,null));};exports[_0xc9ac('0x8c')]=function(_0x16a166,_0x5daa3e,_0x232e5b){var _0x440e90={};var _0x5b8011={};var _0x152cd0;var _0x4b3a05;return db[_0xc9ac('0x45')][_0xc9ac('0x59')]({'where':{'id':_0x16a166['params']['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x5daa3e,null))[_0xc9ac('0x2a')](function(_0x4217ee){if(_0x4217ee){_0x152cd0=_0x4217ee;_0x5b8011[_0xc9ac('0x37')]=_['keys'](db[_0xc9ac('0x5f')][_0xc9ac('0x34')]);_0x5b8011[_0xc9ac('0x38')]=_[_0xc9ac('0x4d')](_0x16a166['query']);_0x5b8011[_0xc9ac('0x39')]=_[_0xc9ac('0x3a')](_0x5b8011[_0xc9ac('0x37')],_0x5b8011['query']);_0x440e90[_0xc9ac('0x3b')]=_[_0xc9ac('0x3a')](_0x5b8011[_0xc9ac('0x37')],qs[_0xc9ac('0x3c')](_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x3c')]));_0x440e90[_0xc9ac('0x3b')]=_0x440e90[_0xc9ac('0x3b')][_0xc9ac('0x5b')]?_0x440e90['attributes']:_0x5b8011['model'];_0x440e90['order']=qs[_0xc9ac('0x3e')](_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x3e')]);_0x440e90[_0xc9ac('0x41')]=qs[_0xc9ac('0x39')](_['pick'](_0x16a166['query'],_0x5b8011[_0xc9ac('0x39')]));if(_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x40')]){_0x440e90[_0xc9ac('0x41')]=_[_0xc9ac('0x43')](_0x440e90['where'],{'$or':_[_0xc9ac('0x33')](_0x440e90[_0xc9ac('0x3b')],function(_0x393e5b){var _0xec61e5={};_0xec61e5[_0x393e5b]={'$like':'%'+_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x40')]+'%'};return _0xec61e5;})});}_0x440e90=_[_0xc9ac('0x43')]({},_0x440e90,_0x16a166[_0xc9ac('0x44')]);return _0x152cd0[_0xc9ac('0x8c')](_0x440e90);}})[_0xc9ac('0x2a')](function(_0x4c3e1c){if(_0x4c3e1c){_0x4b3a05=_0x4c3e1c[_0xc9ac('0x5b')];if(!_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x5c')](_0xc9ac('0x5d'))){_0x440e90['limit']=qs[_0xc9ac('0x23')](_0x16a166['query']['limit']);_0x440e90[_0xc9ac('0x21')]=qs[_0xc9ac('0x21')](_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x21')]);}return _0x152cd0[_0xc9ac('0x8c')](_0x440e90);}})[_0xc9ac('0x2a')](function(_0x233599){if(_0x233599){return _0x233599?{'count':_0x4b3a05,'rows':_0x233599}:null;}})[_0xc9ac('0x2a')](respondWithResult(_0x5daa3e,null))[_0xc9ac('0x4a')](handleError(_0x5daa3e,null));}; \ No newline at end of file +var _0xdc44=['desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','get','destroy','end','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','body','describe','getMembers','findOne','order','pick','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','forEach','emit','removeTeams','select','field','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','value','isEmpty','removeAgents','spread','userOpenchannelQueue:save','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','jsforce'];(function(_0x4b630,_0x151f86){var _0x24f855=function(_0x2ead2a){while(--_0x2ead2a){_0x4b630['push'](_0x4b630['shift']());}};_0x24f855(++_0x151f86);}(_0xdc44,0x17e));var _0x4dc4=function(_0x41bfbe,_0x5eebff){_0x41bfbe=_0x41bfbe-0x0;var _0x470d5c=_0xdc44[_0x41bfbe];return _0x470d5c;};'use strict';var emlformat=require(_0x4dc4('0x0'));var rimraf=require(_0x4dc4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4dc4('0x2'));var rp=require(_0x4dc4('0x3'));var moment=require(_0x4dc4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4dc4('0x5'));var util=require(_0x4dc4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4dc4('0x7'));var ejs=require(_0x4dc4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4dc4('0x9'));var crypto=require('crypto');var jsforce=require(_0x4dc4('0xa'));var deskjs=require(_0x4dc4('0xb'));var toCsv=require(_0x4dc4('0x7'));var querystring=require(_0x4dc4('0xc'));var Papa=require('papaparse');var Redis=require(_0x4dc4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4dc4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4dc4('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4dc4('0x10'));var db=require(_0x4dc4('0x11'))['db'];config['redis']=_[_0x4dc4('0x12')](config[_0x4dc4('0x13')],{'host':_0x4dc4('0x14'),'port':0x18eb});var socket=require(_0x4dc4('0x15'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x4dc4('0x16')](socket);function respondWithStatusCode(_0x403542,_0x36e9ab){_0x36e9ab=_0x36e9ab||0xcc;return function(_0x18d906){if(_0x18d906){return _0x403542['sendStatus'](_0x36e9ab);}return _0x403542[_0x4dc4('0x17')](_0x36e9ab)['end']();};}function respondWithResult(_0x30e9f2,_0x74b3c0){_0x74b3c0=_0x74b3c0||0xc8;return function(_0x89ce43){if(_0x89ce43){return _0x30e9f2[_0x4dc4('0x17')](_0x74b3c0)[_0x4dc4('0x18')](_0x89ce43);}};}function respondWithFilteredResult(_0x2a863f,_0x379747){return function(_0x2f91a9){if(_0x2f91a9){var _0x3c1a40=typeof _0x379747[_0x4dc4('0x19')]===_0x4dc4('0x1a')&&typeof _0x379747['limit']===_0x4dc4('0x1a');var _0x597eee=_0x2f91a9[_0x4dc4('0x1b')];var _0x1e0b60=_0x3c1a40?0x0:_0x379747[_0x4dc4('0x19')];var _0x357ce0=_0x3c1a40?_0x2f91a9[_0x4dc4('0x1b')]:_0x379747[_0x4dc4('0x19')]+_0x379747['limit'];var _0x378e06;if(_0x357ce0>=_0x597eee){_0x357ce0=_0x597eee;_0x378e06=0xc8;}else{_0x378e06=0xce;}_0x2a863f[_0x4dc4('0x17')](_0x378e06);return _0x2a863f[_0x4dc4('0x1c')](_0x4dc4('0x1d'),_0x1e0b60+'-'+_0x357ce0+'/'+_0x597eee)[_0x4dc4('0x18')](_0x2f91a9);}return null;};}function patchUpdates(_0x4d78d6){return function(_0x3d266c){try{jsonpatch['apply'](_0x3d266c,_0x4d78d6,!![]);}catch(_0x11cc3e){return BPromise[_0x4dc4('0x1e')](_0x11cc3e);}return _0x3d266c[_0x4dc4('0x1f')]();};}function saveUpdates(_0x2c7b04,_0x5a8361){return function(_0xabc04f){if(_0xabc04f){return _0xabc04f[_0x4dc4('0x20')](_0x2c7b04)[_0x4dc4('0x21')](function(_0x550612){return _0x550612;});}return null;};}function removeEntity(_0x2a9738,_0x473509){return function(_0x5c2680){if(_0x5c2680){return _0x5c2680['destroy']()['then'](function(){var _0x26ca86=_0x5c2680[_0x4dc4('0x22')]({'plain':!![]});var _0x377fba='OpenchannelQueues';return db['UserProfileResource'][_0x4dc4('0x23')]({'where':{'type':_0x377fba,'resourceId':_0x26ca86['id']}})[_0x4dc4('0x21')](function(){return _0x5c2680;});})[_0x4dc4('0x21')](function(){_0x2a9738[_0x4dc4('0x17')](0xcc)[_0x4dc4('0x24')]();});}};}function handleEntityNotFound(_0xd533b6,_0x2f24ed){return function(_0x18dd85){if(!_0x18dd85){_0xd533b6[_0x4dc4('0x25')](0x194);}return _0x18dd85;};}function handleError(_0x5f0966,_0x4cb19c){_0x4cb19c=_0x4cb19c||0x1f4;return function(_0x1622f5){logger[_0x4dc4('0x26')](_0x1622f5[_0x4dc4('0x27')]);if(_0x1622f5[_0x4dc4('0x28')]){delete _0x1622f5[_0x4dc4('0x28')];}_0x5f0966[_0x4dc4('0x17')](_0x4cb19c)['send'](_0x1622f5);};}exports['index']=function(_0x369ab9,_0x1b708d){var _0x379185={},_0x4b0881={},_0x1651e4={'count':0x0,'rows':[]};var _0x1c5799=_[_0x4dc4('0x29')](db['OpenchannelQueue'][_0x4dc4('0x2a')],function(_0x4d6c70){return{'name':_0x4d6c70[_0x4dc4('0x2b')],'type':_0x4d6c70[_0x4dc4('0x2c')][_0x4dc4('0x2d')]};});_0x4b0881['model']=_[_0x4dc4('0x29')](_0x1c5799,'name');_0x4b0881[_0x4dc4('0x2e')]=_[_0x4dc4('0x2f')](_0x369ab9[_0x4dc4('0x2e')]);_0x4b0881[_0x4dc4('0x30')]=_['intersection'](_0x4b0881['model'],_0x4b0881['query']);_0x379185['attributes']=_['intersection'](_0x4b0881[_0x4dc4('0x31')],qs[_0x4dc4('0x32')](_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x32')]));_0x379185['attributes']=_0x379185[_0x4dc4('0x33')][_0x4dc4('0x34')]?_0x379185['attributes']:_0x4b0881['model'];if(!_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x35')](_0x4dc4('0x36'))){_0x379185[_0x4dc4('0x37')]=qs[_0x4dc4('0x37')](_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x37')]);_0x379185[_0x4dc4('0x19')]=qs[_0x4dc4('0x19')](_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x19')]);}_0x379185['order']=qs[_0x4dc4('0x38')](_0x369ab9['query'][_0x4dc4('0x38')]);_0x379185['where']=qs['filters'](_['pick'](_0x369ab9['query'],_0x4b0881[_0x4dc4('0x30')]),_0x1c5799);if(_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x39')]){_0x379185[_0x4dc4('0x3a')]=_[_0x4dc4('0x3b')](_0x379185['where'],{'$or':_['map'](_0x1c5799,function(_0x2807d8){if(_0x2807d8[_0x4dc4('0x2c')]!==_0x4dc4('0x3c')){var _0x4380b8={};_0x4380b8[_0x2807d8[_0x4dc4('0x28')]]={'$like':'%'+_0x369ab9['query'][_0x4dc4('0x39')]+'%'};return _0x4380b8;}})});}_0x379185=_['merge']({},_0x379185,_0x369ab9[_0x4dc4('0x3d')]);var _0x1aabfb={'where':_0x379185[_0x4dc4('0x3a')]};return db[_0x4dc4('0x3e')][_0x4dc4('0x1b')](_0x1aabfb)[_0x4dc4('0x21')](function(_0x54c100){_0x1651e4[_0x4dc4('0x1b')]=_0x54c100;if(_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x3f')]){_0x379185[_0x4dc4('0x40')]=[{'all':!![]}];}return db[_0x4dc4('0x3e')][_0x4dc4('0x41')](_0x379185);})[_0x4dc4('0x21')](function(_0x5b9185){_0x1651e4[_0x4dc4('0x42')]=_0x5b9185;return _0x1651e4;})[_0x4dc4('0x21')](respondWithFilteredResult(_0x1b708d,_0x379185))[_0x4dc4('0x43')](handleError(_0x1b708d,null));};exports[_0x4dc4('0x44')]=function(_0x32d61a,_0x436f94){var _0x5ecb7a={'raw':!![],'where':{'id':_0x32d61a[_0x4dc4('0x45')]['id']}},_0x66991a={};_0x66991a['model']=_[_0x4dc4('0x2f')](db['OpenchannelQueue'][_0x4dc4('0x2a')]);_0x66991a[_0x4dc4('0x2e')]=_[_0x4dc4('0x2f')](_0x32d61a['query']);_0x66991a[_0x4dc4('0x30')]=_[_0x4dc4('0x46')](_0x66991a[_0x4dc4('0x31')],_0x66991a[_0x4dc4('0x2e')]);_0x5ecb7a[_0x4dc4('0x33')]=_[_0x4dc4('0x46')](_0x66991a[_0x4dc4('0x31')],qs['fields'](_0x32d61a[_0x4dc4('0x2e')][_0x4dc4('0x32')]));_0x5ecb7a[_0x4dc4('0x33')]=_0x5ecb7a[_0x4dc4('0x33')][_0x4dc4('0x34')]?_0x5ecb7a[_0x4dc4('0x33')]:_0x66991a['model'];if(_0x32d61a['query'][_0x4dc4('0x3f')]){_0x5ecb7a[_0x4dc4('0x40')]=[{'all':!![]}];}_0x5ecb7a=_[_0x4dc4('0x3b')]({},_0x5ecb7a,_0x32d61a['options']);return db[_0x4dc4('0x3e')][_0x4dc4('0x47')](_0x5ecb7a)['then'](handleEntityNotFound(_0x436f94,null))['then'](respondWithResult(_0x436f94,null))[_0x4dc4('0x43')](handleError(_0x436f94,null));};exports[_0x4dc4('0x48')]=function(_0x41feef,_0x5e11ca){return db['OpenchannelQueue'][_0x4dc4('0x48')](_0x41feef['body'],{})[_0x4dc4('0x21')](function(_0x294bab){var _0x347755=_0x41feef[_0x4dc4('0x49')]['get']({'plain':!![]});if(!_0x347755)throw new Error(_0x4dc4('0x4a'));if(_0x347755['role']===_0x4dc4('0x49')){var _0x54fe7b=_0x294bab[_0x4dc4('0x22')]({'plain':!![]});var _0x4a65b0='OpenchannelQueues';return db['UserProfileSection'][_0x4dc4('0x47')]({'where':{'name':_0x4a65b0,'userProfileId':_0x347755[_0x4dc4('0x4b')]},'raw':!![]})[_0x4dc4('0x21')](function(_0xe4d830){if(_0xe4d830&&_0xe4d830[_0x4dc4('0x4c')]===0x0){return db[_0x4dc4('0x4d')][_0x4dc4('0x48')]({'name':_0x54fe7b['name'],'resourceId':_0x54fe7b['id'],'type':_0xe4d830[_0x4dc4('0x28')],'sectionId':_0xe4d830['id']},{})[_0x4dc4('0x21')](function(){return _0x294bab;});}else{return _0x294bab;}})[_0x4dc4('0x43')](function(_0x387872){logger[_0x4dc4('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x387872);throw _0x387872;});}return _0x294bab;})[_0x4dc4('0x21')](respondWithResult(_0x5e11ca,0xc9))['catch'](handleError(_0x5e11ca,null));};exports[_0x4dc4('0x20')]=function(_0x3246b4,_0x5b925a){if(_0x3246b4['body']['id']){delete _0x3246b4['body']['id'];}return db[_0x4dc4('0x3e')][_0x4dc4('0x47')]({'where':{'id':_0x3246b4[_0x4dc4('0x45')]['id']}})[_0x4dc4('0x21')](handleEntityNotFound(_0x5b925a,null))[_0x4dc4('0x21')](saveUpdates(_0x3246b4[_0x4dc4('0x4e')],null))[_0x4dc4('0x21')](respondWithResult(_0x5b925a,null))[_0x4dc4('0x43')](handleError(_0x5b925a,null));};exports[_0x4dc4('0x23')]=function(_0x4727a9,_0x3f2aba){return db['OpenchannelQueue'][_0x4dc4('0x47')]({'where':{'id':_0x4727a9[_0x4dc4('0x45')]['id']}})[_0x4dc4('0x21')](handleEntityNotFound(_0x3f2aba,null))[_0x4dc4('0x21')](removeEntity(_0x3f2aba,null))[_0x4dc4('0x43')](handleError(_0x3f2aba,null));};exports[_0x4dc4('0x4f')]=function(_0x7eba7b,_0x5f55cb){return db[_0x4dc4('0x3e')][_0x4dc4('0x4f')]()[_0x4dc4('0x21')](respondWithResult(_0x5f55cb,null))[_0x4dc4('0x43')](handleError(_0x5f55cb,null));};exports[_0x4dc4('0x50')]=function(_0x4ed7bb,_0x4cb9b7,_0x4beb9a){var _0xddd9d2={'raw':!![],'where':{}},_0x4a7d4c={},_0x24c709;return db[_0x4dc4('0x3e')][_0x4dc4('0x51')]({'where':{'id':_0x4ed7bb[_0x4dc4('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cb9b7,null))[_0x4dc4('0x21')](function(_0x1401fe){if(_0x1401fe){_0x24c709=_0x1401fe[_0x4dc4('0x22')]({'plain':!![]});_0x4a7d4c[_0x4dc4('0x31')]=_[_0x4dc4('0x2f')](db['UserOpenchannelQueue'][_0x4dc4('0x2a')]);_0x4a7d4c[_0x4dc4('0x2e')]=_['keys'](_0x4ed7bb[_0x4dc4('0x2e')]);_0x4a7d4c['filters']=_[_0x4dc4('0x46')](_0x4a7d4c[_0x4dc4('0x31')],_0x4a7d4c[_0x4dc4('0x2e')]);_0xddd9d2['attributes']=_[_0x4dc4('0x46')](_0x4a7d4c['model'],qs[_0x4dc4('0x32')](_0x4ed7bb[_0x4dc4('0x2e')][_0x4dc4('0x32')]));_0xddd9d2[_0x4dc4('0x33')]=_0xddd9d2[_0x4dc4('0x33')][_0x4dc4('0x34')]?_0xddd9d2[_0x4dc4('0x33')]:_0x4a7d4c['model'];if(!_0x4ed7bb['query'][_0x4dc4('0x35')](_0x4dc4('0x36'))){_0xddd9d2[_0x4dc4('0x37')]=qs['limit'](_0x4ed7bb[_0x4dc4('0x2e')][_0x4dc4('0x37')]);_0xddd9d2[_0x4dc4('0x19')]=qs[_0x4dc4('0x19')](_0x4ed7bb[_0x4dc4('0x2e')][_0x4dc4('0x19')]);}_0xddd9d2[_0x4dc4('0x52')]=qs['sort'](_0x4ed7bb[_0x4dc4('0x2e')]['sort']);_0xddd9d2[_0x4dc4('0x3a')]=qs['filters'](_[_0x4dc4('0x53')](_0x4ed7bb[_0x4dc4('0x2e')],_0x4a7d4c[_0x4dc4('0x30')]));_0xddd9d2[_0x4dc4('0x3a')][_0x4dc4('0x54')]=_0x1401fe['id'];if(_0x4ed7bb['query'][_0x4dc4('0x39')]){_0xddd9d2['where']=_[_0x4dc4('0x3b')](_0xddd9d2[_0x4dc4('0x3a')],{'$or':_[_0x4dc4('0x29')](_0xddd9d2[_0x4dc4('0x33')],function(_0xcc06a){var _0x3baa72={};_0x3baa72[_0xcc06a]={'$like':'%'+_0x4ed7bb[_0x4dc4('0x2e')][_0x4dc4('0x39')]+'%'};return _0x3baa72;})});}_0xddd9d2=_[_0x4dc4('0x3b')]({},_0xddd9d2,_0x4ed7bb[_0x4dc4('0x3d')]);return db[_0x4dc4('0x55')][_0x4dc4('0x41')](_0xddd9d2);}})[_0x4dc4('0x21')](function(_0x5e1446){if(_0x5e1446){return db[_0x4dc4('0x56')][_0x4dc4('0x57')]({'where':{'id':_[_0x4dc4('0x29')](_0x5e1446,_0x4dc4('0x58')),'role':_0x4dc4('0x59')},'attributes':['id',_0x4dc4('0x28'),_0x4dc4('0x5a'),_0x4dc4('0x5b'),_0x4dc4('0x5c')]});}})['then'](function(_0x47a292){if(_0x47a292){return{'count':_0x47a292[_0x4dc4('0x1b')],'rows':_['map'](_0x47a292[_0x4dc4('0x42')],function(_0x539f6f){return{'membername':_0x539f6f[_0x4dc4('0x28')],'UserId':_0x539f6f['id'],'queue_name':_0x24c709[_0x4dc4('0x28')],'OpenchannelQueueId':_0x24c709['id'],'interface':util['format'](_0x4dc4('0x5d'),_0x4dc4('0x5e'),_0x539f6f[_0x4dc4('0x28')]),'penalty':0x0,'paused':_0x539f6f[_0x4dc4('0x5a')],'createdAt':_0x539f6f[_0x4dc4('0x5c')],'updatedAt':_0x539f6f[_0x4dc4('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4dc4('0x21')](respondWithFilteredResult(_0x4cb9b7,_0xddd9d2))['catch'](handleError(_0x4cb9b7,null));};exports[_0x4dc4('0x5f')]=function(_0x3008ea,_0x48e082,_0x1eb6db){var _0x5d8d47={};var _0x27d6c7={};var _0x2c8351;var _0x4a15dc;return db['OpenchannelQueue'][_0x4dc4('0x51')]({'where':{'id':_0x3008ea[_0x4dc4('0x45')]['id']}})[_0x4dc4('0x21')](handleEntityNotFound(_0x48e082,null))[_0x4dc4('0x21')](function(_0x451f0d){if(_0x451f0d){_0x2c8351=_0x451f0d;_0x27d6c7[_0x4dc4('0x31')]=_[_0x4dc4('0x2f')](db[_0x4dc4('0x60')][_0x4dc4('0x2a')]);_0x27d6c7['query']=_[_0x4dc4('0x2f')](_0x3008ea[_0x4dc4('0x2e')]);_0x27d6c7[_0x4dc4('0x30')]=_[_0x4dc4('0x46')](_0x27d6c7[_0x4dc4('0x31')],_0x27d6c7[_0x4dc4('0x2e')]);_0x5d8d47['attributes']=_[_0x4dc4('0x46')](_0x27d6c7[_0x4dc4('0x31')],qs[_0x4dc4('0x32')](_0x3008ea[_0x4dc4('0x2e')][_0x4dc4('0x32')]));_0x5d8d47[_0x4dc4('0x33')]=_0x5d8d47[_0x4dc4('0x33')][_0x4dc4('0x34')]?_0x5d8d47[_0x4dc4('0x33')]:_0x27d6c7['model'];_0x5d8d47['order']=qs[_0x4dc4('0x38')](_0x3008ea[_0x4dc4('0x2e')]['sort']);_0x5d8d47[_0x4dc4('0x3a')]=qs[_0x4dc4('0x30')](_['pick'](_0x3008ea[_0x4dc4('0x2e')],_0x27d6c7[_0x4dc4('0x30')]));if(_0x3008ea[_0x4dc4('0x2e')][_0x4dc4('0x39')]){_0x5d8d47[_0x4dc4('0x3a')]=_[_0x4dc4('0x3b')](_0x5d8d47[_0x4dc4('0x3a')],{'$or':_[_0x4dc4('0x29')](_0x5d8d47[_0x4dc4('0x33')],function(_0x14210d){var _0x32e90d={};_0x32e90d[_0x14210d]={'$like':'%'+_0x3008ea[_0x4dc4('0x2e')][_0x4dc4('0x39')]+'%'};return _0x32e90d;})});}_0x5d8d47=_[_0x4dc4('0x3b')]({},_0x5d8d47,_0x3008ea['options']);return _0x2c8351[_0x4dc4('0x5f')](_0x5d8d47);}})['then'](function(_0x22ba6f){if(_0x22ba6f){_0x4a15dc=_0x22ba6f[_0x4dc4('0x34')];if(!_0x3008ea['query'][_0x4dc4('0x35')](_0x4dc4('0x36'))){_0x5d8d47[_0x4dc4('0x37')]=qs[_0x4dc4('0x37')](_0x3008ea['query'][_0x4dc4('0x37')]);_0x5d8d47[_0x4dc4('0x19')]=qs['offset'](_0x3008ea[_0x4dc4('0x2e')]['offset']);}return _0x2c8351[_0x4dc4('0x5f')](_0x5d8d47);}})['then'](function(_0x2f411a){if(_0x2f411a){return _0x2f411a?{'count':_0x4a15dc,'rows':_0x2f411a}:null;}})[_0x4dc4('0x21')](respondWithResult(_0x48e082,null))[_0x4dc4('0x43')](handleError(_0x48e082,null));};exports['addTeams']=function(_0x4399d5,_0x266939,_0x2e2973){var _0x26f3d5=_0x4399d5['body'][_0x4dc4('0x61')];return db['Team'][_0x4dc4('0x41')]({'where':{'id':_0x26f3d5},'attributes':['id'],'include':[{'model':db[_0x4dc4('0x56')],'as':_0x4dc4('0x62'),'attributes':['id',_0x4dc4('0x28'),_0x4dc4('0x63'),_0x4dc4('0x64'),_0x4dc4('0x65')],'raw':!![]}]})[_0x4dc4('0x21')](function(_0x193bfe){if(_0x193bfe){var _0x28d701=_['flatMap'](_0x193bfe,function(_0x5c4ab0){var _0x546039=_0x5c4ab0[_0x4dc4('0x22')]({'plain':!![]});return _0x546039[_0x4dc4('0x62')];});return db[_0x4dc4('0x3e')][_0x4dc4('0x47')]({'where':{'id':_0x4399d5[_0x4dc4('0x45')]['id']}})['then'](function(_0x244207){return db[_0x4dc4('0x66')][_0x4dc4('0x67')](function(_0xe06d35){return _0x244207[_0x4dc4('0x68')](_0x26f3d5,{'transaction':_0xe06d35})[_0x4dc4('0x21')](function(){return BPromise['each'](_0x28d701,function(_0x2a29f6){return db[_0x4dc4('0x55')]['findOrCreate']({'where':{'UserId':_0x2a29f6['id'],'OpenchannelQueueId':_0x4399d5[_0x4dc4('0x45')]['id']},'transaction':_0xe06d35});});})['then'](function(){_0x28d701[_0x4dc4('0x69')](function(_0x3eb636){socket[_0x4dc4('0x6a')]('userOpenchannelQueue:save',{'UserId':_0x3eb636['id'],'OpenchannelQueueId':_0x244207['id']});});});});});}})[_0x4dc4('0x21')](respondWithStatusCode(_0x266939,null))[_0x4dc4('0x43')](handleError(_0x266939,null));};exports[_0x4dc4('0x6b')]=function(_0x2fd5fe,_0x591248,_0x342b9b){return db['Team'][_0x4dc4('0x41')]({'where':{'id':_0x2fd5fe[_0x4dc4('0x2e')][_0x4dc4('0x61')]},'attributes':['id'],'include':[{'model':db[_0x4dc4('0x56')],'as':_0x4dc4('0x62'),'attributes':['id'],'raw':!![]}]})[_0x4dc4('0x21')](handleEntityNotFound(_0x591248,null))[_0x4dc4('0x21')](function(_0x114820){var _0x4cf735=_[_0x4dc4('0x29')](_0x114820,'id');var _0x1df052=[];var _0x3f07fb=[];var _0x3c7c7e=squel[_0x4dc4('0x6c')]();_0x3c7c7e[_0x4dc4('0x6d')]('tq.TeamId')[_0x4dc4('0x6e')](_0x4dc4('0x6f'),'tq')['join'](_0x4dc4('0x70'),'ut',_0x4dc4('0x71'))[_0x4dc4('0x3a')](_0x4dc4('0x72'),_0x2fd5fe[_0x4dc4('0x45')]['id']);for(var _0x146f22=0x0;_0x146f22<_0x114820['length'];_0x146f22+=0x1){let _0x5d70d8=_0x114820[_0x146f22];for(var _0x21982d=0x0;_0x21982d<_0x5d70d8[_0x4dc4('0x62')][_0x4dc4('0x34')];_0x21982d+=0x1){let _0x51761b=_0x5d70d8['Agents'][_0x21982d];var _0x1639a5=_0x3c7c7e[_0x4dc4('0x73')]();_0x1639a5[_0x4dc4('0x3a')](_0x4dc4('0x74'),_0x51761b['id']);_0x3f07fb[_0x4dc4('0x75')](db['sequelize']['query'](_0x1639a5[_0x4dc4('0x76')](),{'type':db['sequelize'][_0x4dc4('0x77')]['SELECT']})['then'](function(_0x2e0066){if(_0x2e0066[_0x4dc4('0x34')]===0x1){return _0x51761b['id'];}else{var _0x30df8a=_[_0x4dc4('0x78')](_['map'](_0x2e0066,'TeamId'),function(_0xf0b897){return _[_0x4dc4('0x79')](_0x4cf735,_0xf0b897);});if(_0x30df8a){return _0x51761b['id'];}}}));}}return BPromise[_0x4dc4('0x7a')](_0x3f07fb)['then'](function(_0x5f2e16){_0x1df052=_(_0x1df052)[_0x4dc4('0x7b')](_0x5f2e16)['compact']()[_0x4dc4('0x7c')]();return db[_0x4dc4('0x3e')][_0x4dc4('0x47')]({'where':{'id':_0x2fd5fe[_0x4dc4('0x45')]['id']}})[_0x4dc4('0x21')](function(_0x2227bb){return db[_0x4dc4('0x66')]['transaction'](function(_0x2d1484){return _0x2227bb[_0x4dc4('0x6b')](_0x2fd5fe[_0x4dc4('0x2e')]['ids'],{'transaction':_0x2d1484})[_0x4dc4('0x21')](function(){if(!_[_0x4dc4('0x7d')](_0x1df052)){return _0x2227bb[_0x4dc4('0x7e')](_0x1df052,{'transaction':_0x2d1484});}})[_0x4dc4('0x21')](function(){_0x1df052[_0x4dc4('0x69')](function(_0xb1e43){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0xb1e43,'OpenchannelQueueId':_0x2227bb['id']});});});});});});})[_0x4dc4('0x21')](respondWithStatusCode(_0x591248,null))[_0x4dc4('0x43')](handleError(_0x591248,null));};exports['addAgents']=function(_0x5ae8cc,_0xe9173b,_0x5c581e){return db[_0x4dc4('0x3e')]['find']({'where':{'id':_0x5ae8cc[_0x4dc4('0x45')]['id']}})['then'](handleEntityNotFound(_0xe9173b,null))[_0x4dc4('0x21')](function(_0x4f4ed9){if(_0x4f4ed9){return _0x4f4ed9['addAgents'](_0x5ae8cc[_0x4dc4('0x4e')][_0x4dc4('0x61')],_['omit'](_0x5ae8cc[_0x4dc4('0x4e')],[_0x4dc4('0x61'),'id'])||{})[_0x4dc4('0x7f')](function(_0x59cf5c){for(var _0x387db0=0x0;_0x387db0<_0x5ae8cc['body'][_0x4dc4('0x61')]['length'];_0x387db0+=0x1){socket[_0x4dc4('0x6a')](_0x4dc4('0x80'),{'UserId':Number(_0x5ae8cc['body'][_0x4dc4('0x61')][_0x387db0]),'OpenchannelQueueId':Number(_0x5ae8cc[_0x4dc4('0x45')]['id'])});}return _0x59cf5c;});}})[_0x4dc4('0x21')](respondWithResult(_0xe9173b,null))[_0x4dc4('0x43')](handleError(_0xe9173b,null));};exports[_0x4dc4('0x7e')]=function(_0x54d71f,_0x26cd6e,_0x5cd64c){return db[_0x4dc4('0x3e')][_0x4dc4('0x47')]({'where':{'id':_0x54d71f['params']['id']}})[_0x4dc4('0x21')](handleEntityNotFound(_0x26cd6e,null))[_0x4dc4('0x21')](function(_0x49c56d){if(_0x49c56d){return _0x49c56d[_0x4dc4('0x7e')](_0x54d71f['query'][_0x4dc4('0x61')])['then'](function(){if(_['isArray'](_0x54d71f['query'][_0x4dc4('0x61')])){for(var _0xa96d6b=0x0;_0xa96d6b<_0x54d71f[_0x4dc4('0x2e')]['ids']['length'];_0xa96d6b+=0x1){socket[_0x4dc4('0x6a')](_0x4dc4('0x81'),{'UserId':Number(_0x54d71f[_0x4dc4('0x2e')]['ids'][_0xa96d6b]),'OpenchannelQueueId':Number(_0x54d71f[_0x4dc4('0x45')]['id'])});}}else{socket[_0x4dc4('0x6a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x54d71f[_0x4dc4('0x2e')][_0x4dc4('0x61')]),'OpenchannelQueueId':Number(_0x54d71f[_0x4dc4('0x45')]['id'])});}});}})[_0x4dc4('0x21')](respondWithStatusCode(_0x26cd6e,null))[_0x4dc4('0x43')](handleError(_0x26cd6e,null));};exports[_0x4dc4('0x82')]=function(_0x1593e0,_0xa326e5,_0x46c4ba){var _0x47836e={};var _0x38d75b={};var _0x389ee1;var _0x290326;return db[_0x4dc4('0x3e')][_0x4dc4('0x51')]({'where':{'id':_0x1593e0[_0x4dc4('0x45')]['id']}})['then'](handleEntityNotFound(_0xa326e5,null))[_0x4dc4('0x21')](function(_0x3b90b8){if(_0x3b90b8){_0x389ee1=_0x3b90b8;_0x38d75b['model']=_[_0x4dc4('0x2f')](db[_0x4dc4('0x56')][_0x4dc4('0x2a')]);_0x38d75b[_0x4dc4('0x2e')]=_['keys'](_0x1593e0[_0x4dc4('0x2e')]);_0x38d75b['filters']=_[_0x4dc4('0x46')](_0x38d75b[_0x4dc4('0x31')],_0x38d75b[_0x4dc4('0x2e')]);_0x47836e['attributes']=_[_0x4dc4('0x46')](_0x38d75b['model'],qs[_0x4dc4('0x32')](_0x1593e0[_0x4dc4('0x2e')][_0x4dc4('0x32')]));_0x47836e[_0x4dc4('0x33')]=_0x47836e['attributes'][_0x4dc4('0x34')]?_0x47836e[_0x4dc4('0x33')]:_0x38d75b['model'];_0x47836e[_0x4dc4('0x52')]=qs['sort'](_0x1593e0['query'][_0x4dc4('0x38')]);_0x47836e[_0x4dc4('0x3a')]=qs[_0x4dc4('0x30')](_['pick'](_0x1593e0[_0x4dc4('0x2e')],_0x38d75b['filters']));if(_0x1593e0[_0x4dc4('0x2e')][_0x4dc4('0x39')]){_0x47836e[_0x4dc4('0x3a')]=_[_0x4dc4('0x3b')](_0x47836e[_0x4dc4('0x3a')],{'$or':_['map'](_0x47836e[_0x4dc4('0x33')],function(_0xcd2bce){var _0x143b7f={};_0x143b7f[_0xcd2bce]={'$like':'%'+_0x1593e0[_0x4dc4('0x2e')][_0x4dc4('0x39')]+'%'};return _0x143b7f;})});}_0x47836e=_[_0x4dc4('0x3b')]({},_0x47836e,_0x1593e0[_0x4dc4('0x3d')]);return _0x389ee1[_0x4dc4('0x82')](_0x47836e);}})[_0x4dc4('0x21')](function(_0x4f2397){if(_0x4f2397){_0x290326=_0x4f2397[_0x4dc4('0x34')];if(!_0x1593e0['query'][_0x4dc4('0x35')](_0x4dc4('0x36'))){_0x47836e[_0x4dc4('0x37')]=qs['limit'](_0x1593e0[_0x4dc4('0x2e')][_0x4dc4('0x37')]);_0x47836e[_0x4dc4('0x19')]=qs['offset'](_0x1593e0[_0x4dc4('0x2e')][_0x4dc4('0x19')]);}return _0x389ee1[_0x4dc4('0x82')](_0x47836e);}})[_0x4dc4('0x21')](function(_0x1457d6){if(_0x1457d6){return _0x1457d6?{'count':_0x290326,'rows':_0x1457d6}:null;}})['then'](respondWithResult(_0xa326e5,null))['catch'](handleError(_0xa326e5,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index d965371..7a59a54 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 _0x7478=['setMaxListeners','save','update','remove','emit','../../mysqldb','OpenchannelQueue'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7478,0xf3));var _0x8747=function(_0x4c4ed0,_0x5bc06d){_0x4c4ed0=_0x4c4ed0-0x0;var _0x55d61e=_0x7478[_0x4c4ed0];return _0x55d61e;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x8747('0x0'))['db'][_0x8747('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8747('0x2')](0x0);var events={'afterCreate':_0x8747('0x3'),'afterUpdate':_0x8747('0x4'),'afterDestroy':_0x8747('0x5')};function emitEvent(_0x46a3ee){return function(_0x354300,_0x5e6ae1,_0x5d92c2){OpenchannelQueueEvents[_0x8747('0x6')](_0x46a3ee+':'+_0x354300['id'],_0x354300);OpenchannelQueueEvents[_0x8747('0x6')](_0x46a3ee,_0x354300);_0x5d92c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xb9ef=['exports','events','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x61b360,_0x5c9eee){var _0x1c7696=function(_0x42f578){while(--_0x42f578){_0x61b360['push'](_0x61b360['shift']());}};_0x1c7696(++_0x5c9eee);}(_0xb9ef,0x1c9));var _0xfb9e=function(_0x3f2719,_0x2282f9){_0x3f2719=_0x3f2719-0x0;var _0xb63d2e=_0xb9ef[_0x3f2719];return _0xb63d2e;};'use strict';var EventEmitter=require(_0xfb9e('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xfb9e('0x1')](0x0);var events={'afterCreate':_0xfb9e('0x2'),'afterUpdate':'update','afterDestroy':_0xfb9e('0x3')};function emitEvent(_0x6923){return function(_0x2f5416,_0x17187c,_0x523b2b){OpenchannelQueueEvents[_0xfb9e('0x4')](_0x6923+':'+_0x2f5416['id'],_0x2f5416);OpenchannelQueueEvents[_0xfb9e('0x4')](_0x6923,_0x2f5416);_0x523b2b(null);};}for(var e in events){if(events[_0xfb9e('0x5')](e)){var event=events[e];OpenchannelQueue[_0xfb9e('0x6')](e,emitEvent(event));}}module[_0xfb9e('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 46ebc06..ad37d45 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 _0x25d4=['moment','bluebird','path','rimraf','../../config/environment','exports','define','util','api'];(function(_0x2cbac9,_0x5ed58a){var _0x36fa22=function(_0x5a84da){while(--_0x5a84da){_0x2cbac9['push'](_0x2cbac9['shift']());}};_0x36fa22(++_0x5ed58a);}(_0x25d4,0x103));var _0x425d=function(_0x295ce7,_0x1545d3){_0x295ce7=_0x295ce7-0x0;var _0x359d04=_0x25d4[_0x295ce7];return _0x359d04;};'use strict';var _=require('lodash');var util=require(_0x425d('0x0'));var logger=require('../../config/logger')(_0x425d('0x1'));var moment=require(_0x425d('0x2'));var BPromise=require(_0x425d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x425d('0x4'));var rimraf=require(_0x425d('0x5'));var config=require(_0x425d('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0x425d('0x7')]=function(_0x200112,_0x3cda77){return _0x200112[_0x425d('0x8')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea71=['exports','define','OpenchannelQueue','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x3b3727,_0x408dac){var _0x3dde01=function(_0x54d171){while(--_0x54d171){_0x3b3727['push'](_0x3b3727['shift']());}};_0x3dde01(++_0x408dac);}(_0xea71,0xe7));var _0x1ea7=function(_0x325f75,_0x3b315c){_0x325f75=_0x325f75-0x0;var _0x3e2eb8=_0xea71[_0x325f75];return _0x3e2eb8;};'use strict';var _=require(_0x1ea7('0x0'));var util=require(_0x1ea7('0x1'));var logger=require(_0x1ea7('0x2'))(_0x1ea7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1ea7('0x4'));var fs=require('fs');var path=require(_0x1ea7('0x5'));var rimraf=require(_0x1ea7('0x6'));var config=require(_0x1ea7('0x7'));var attributes=require(_0x1ea7('0x8'));module[_0x1ea7('0x9')]=function(_0x548d0d,_0x1aee02){return _0x548d0d[_0x1ea7('0xa')](_0x1ea7('0xb'),attributes,{'tableName':'openchannel_queues','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 cd816bd..d0dfb20 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 _0x3cc4=['../../config/environment','jayson/promise','http','redis','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelQueue','findAll','options','where','attributes','limit','map','include','model','GetOpenchannelQueue','debug','catch','ShowOpenchannelQueue','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4fc3aa,_0x39ce2a){var _0x46e4fd=function(_0x3fffb9){while(--_0x3fffb9){_0x4fc3aa['push'](_0x4fc3aa['shift']());}};_0x46e4fd(++_0x39ce2a);}(_0x3cc4,0xdc));var _0x43cc=function(_0x3f4291,_0x20cf4c){_0x3f4291=_0x3f4291-0x0;var _0x359641=_0x3cc4[_0x3f4291];return _0x359641;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x43cc('0x0'));var BPromise=require(_0x43cc('0x1'));var rs=require(_0x43cc('0x2'));var fs=require('fs');var Redis=require(_0x43cc('0x3'));var db=require(_0x43cc('0x4'))['db'];var utils=require(_0x43cc('0x5'));var logger=require(_0x43cc('0x6'))(_0x43cc('0x7'));var config=require(_0x43cc('0x8'));var jayson=require(_0x43cc('0x9'));var client=jayson['client'][_0x43cc('0xa')]({'port':0x232a});config[_0x43cc('0xb')]=_['defaults'](config['redis'],{'host':_0x43cc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43cc('0xb')]));require(_0x43cc('0xd'))[_0x43cc('0xe')](socket);function respondWithRpcPromise(_0x205a12,_0x34d9f1,_0x5a79ba){return new BPromise(function(_0x5a9095,_0x402b4b){return client[_0x43cc('0xf')](_0x205a12,_0x5a79ba)[_0x43cc('0x10')](function(_0xbfe09){logger[_0x43cc('0x11')](_0x43cc('0x12'),_0x34d9f1,_0x43cc('0x13'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x34d9f1,'request\x20sent',JSON[_0x43cc('0x14')](_0xbfe09));if(_0xbfe09[_0x43cc('0x15')]){if(_0xbfe09[_0x43cc('0x15')][_0x43cc('0x16')]===0x1f4){logger[_0x43cc('0x15')](_0x43cc('0x12'),_0x34d9f1,_0xbfe09[_0x43cc('0x15')]['message']);return _0x402b4b(_0xbfe09[_0x43cc('0x15')][_0x43cc('0x17')]);}logger[_0x43cc('0x15')](_0x43cc('0x12'),_0x34d9f1,_0xbfe09['error']['message']);return _0x5a9095(_0xbfe09[_0x43cc('0x15')][_0x43cc('0x17')]);}else{logger[_0x43cc('0x11')](_0x43cc('0x12'),_0x34d9f1,_0x43cc('0x13'));_0x5a9095(_0xbfe09['result'][_0x43cc('0x17')]);}})['catch'](function(_0x15661c){logger[_0x43cc('0x15')](_0x43cc('0x12'),_0x34d9f1,_0x15661c);_0x402b4b(_0x15661c);});});}exports['GetOpenchannelQueue']=function(_0x22eee9){var _0x561456=this;return new Promise(function(_0x48a09c,_0x5aa25a){return db[_0x43cc('0x18')][_0x43cc('0x19')]({'raw':_0x22eee9[_0x43cc('0x1a')]?_0x22eee9[_0x43cc('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x22eee9[_0x43cc('0x1a')]?_0x22eee9[_0x43cc('0x1a')][_0x43cc('0x1b')]||null:null,'attributes':_0x22eee9[_0x43cc('0x1a')]?_0x22eee9[_0x43cc('0x1a')][_0x43cc('0x1c')]||null:null,'limit':_0x22eee9['options']?_0x22eee9[_0x43cc('0x1a')][_0x43cc('0x1d')]||null:null,'include':_0x22eee9[_0x43cc('0x1a')]?_0x22eee9[_0x43cc('0x1a')]['include']?_[_0x43cc('0x1e')](_0x22eee9[_0x43cc('0x1a')][_0x43cc('0x1f')],function(_0xf156ba){return{'model':db[_0xf156ba['model']],'as':_0xf156ba['as'],'attributes':_0xf156ba[_0x43cc('0x1c')],'include':_0xf156ba[_0x43cc('0x1f')]?_['map'](_0xf156ba[_0x43cc('0x1f')],function(_0x14613e){return{'model':db[_0x14613e[_0x43cc('0x20')]],'as':_0x14613e['as'],'attributes':_0x14613e[_0x43cc('0x1c')],'include':_0x14613e[_0x43cc('0x1f')]?_[_0x43cc('0x1e')](_0x14613e[_0x43cc('0x1f')],function(_0x3e771c){return{'model':db[_0x3e771c[_0x43cc('0x20')]],'as':_0x3e771c['as'],'attributes':_0x3e771c['attributes']};}):[]};}):[]};}):[]:[]})[_0x43cc('0x10')](function(_0x2c855a){logger[_0x43cc('0x11')](_0x43cc('0x21'),_0x22eee9);logger[_0x43cc('0x22')](_0x43cc('0x21'),_0x22eee9,JSON[_0x43cc('0x14')](_0x2c855a));_0x48a09c(_0x2c855a);})[_0x43cc('0x23')](function(_0x21a9b0){logger[_0x43cc('0x15')](_0x43cc('0x21'),_0x21a9b0['message'],_0x22eee9);_0x5aa25a(_0x561456['error'](0x1f4,_0x21a9b0[_0x43cc('0x17')]));});});};exports[_0x43cc('0x24')]=function(_0x3df303){var _0x1b4bf9=this;return new Promise(function(_0x9de7de,_0x41546d){return db[_0x43cc('0x18')][_0x43cc('0x25')]({'raw':_0x3df303[_0x43cc('0x1a')]?_0x3df303[_0x43cc('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3df303['options']?_0x3df303['options']['where']||null:null,'attributes':_0x3df303[_0x43cc('0x1a')]?_0x3df303[_0x43cc('0x1a')]['attributes']||null:null,'include':_0x3df303[_0x43cc('0x1a')]?_0x3df303['options'][_0x43cc('0x1f')]?_['map'](_0x3df303[_0x43cc('0x1a')][_0x43cc('0x1f')],function(_0x4fbb02){return{'model':db[_0x4fbb02[_0x43cc('0x20')]],'as':_0x4fbb02['as'],'attributes':_0x4fbb02[_0x43cc('0x1c')],'include':_0x4fbb02[_0x43cc('0x1f')]?_['map'](_0x4fbb02['include'],function(_0x4a2bc5){return{'model':db[_0x4a2bc5[_0x43cc('0x20')]],'as':_0x4a2bc5['as'],'attributes':_0x4a2bc5[_0x43cc('0x1c')],'include':_0x4a2bc5[_0x43cc('0x1f')]?_[_0x43cc('0x1e')](_0x4a2bc5[_0x43cc('0x1f')],function(_0x325bda){return{'model':db[_0x325bda[_0x43cc('0x20')]],'as':_0x325bda['as'],'attributes':_0x325bda['attributes']};}):[]};}):[]};}):[]:[]})[_0x43cc('0x10')](function(_0x1c1786){logger[_0x43cc('0x11')](_0x43cc('0x24'),_0x3df303);logger[_0x43cc('0x22')](_0x43cc('0x24'),_0x3df303,JSON[_0x43cc('0x14')](_0x1c1786));_0x9de7de(_0x1c1786);})[_0x43cc('0x23')](function(_0x10318b){logger[_0x43cc('0x15')]('ShowOpenchannelQueue',_0x10318b[_0x43cc('0x17')],_0x3df303);_0x41546d(_0x1b4bf9[_0x43cc('0x15')](0x1f4,_0x10318b[_0x43cc('0x17')]));});});}; \ No newline at end of file +var _0x3567=['debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','attributes','limit','include','map','model','then','GetOpenchannelQueue','ShowOpenchannelQueue','find','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x3567,0x8c));var _0x7356=function(_0x17a4cf,_0x5cfc25){_0x17a4cf=_0x17a4cf-0x0;var _0x2d4106=_0x3567[_0x17a4cf];return _0x2d4106;};'use strict';var _=require('lodash');var util=require(_0x7356('0x0'));var moment=require(_0x7356('0x1'));var BPromise=require(_0x7356('0x2'));var rs=require(_0x7356('0x3'));var fs=require('fs');var Redis=require(_0x7356('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7356('0x5'));var logger=require('../../config/logger')(_0x7356('0x6'));var config=require(_0x7356('0x7'));var jayson=require(_0x7356('0x8'));var client=jayson['client'][_0x7356('0x9')]({'port':0x232a});config[_0x7356('0xa')]=_[_0x7356('0xb')](config['redis'],{'host':_0x7356('0xc'),'port':0x18eb});var socket=require(_0x7356('0xd'))(new Redis(config[_0x7356('0xa')]));require(_0x7356('0xe'))[_0x7356('0xf')](socket);function respondWithRpcPromise(_0x48e0a1,_0x4e1456,_0x6f73c){return new BPromise(function(_0x1e52ea,_0x41ac10){return client[_0x7356('0x10')](_0x48e0a1,_0x6f73c)['then'](function(_0x125017){logger[_0x7356('0x11')](_0x7356('0x12'),_0x4e1456,_0x7356('0x13'));logger[_0x7356('0x14')](_0x7356('0x15'),_0x4e1456,_0x7356('0x13'),JSON[_0x7356('0x16')](_0x125017));if(_0x125017[_0x7356('0x17')]){if(_0x125017[_0x7356('0x17')]['code']===0x1f4){logger[_0x7356('0x17')](_0x7356('0x12'),_0x4e1456,_0x125017[_0x7356('0x17')][_0x7356('0x18')]);return _0x41ac10(_0x125017[_0x7356('0x17')][_0x7356('0x18')]);}logger[_0x7356('0x17')](_0x7356('0x12'),_0x4e1456,_0x125017[_0x7356('0x17')][_0x7356('0x18')]);return _0x1e52ea(_0x125017[_0x7356('0x17')]['message']);}else{logger[_0x7356('0x11')](_0x7356('0x12'),_0x4e1456,'request\x20sent');_0x1e52ea(_0x125017[_0x7356('0x19')]['message']);}})[_0x7356('0x1a')](function(_0x183881){logger['error'](_0x7356('0x12'),_0x4e1456,_0x183881);_0x41ac10(_0x183881);});});}exports['GetOpenchannelQueue']=function(_0x2e18e9){var _0x16c22f=this;return new Promise(function(_0x19f359,_0x13509f){return db['OpenchannelQueue'][_0x7356('0x1b')]({'raw':_0x2e18e9[_0x7356('0x1c')]?_0x2e18e9[_0x7356('0x1c')][_0x7356('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e18e9['options']?_0x2e18e9[_0x7356('0x1c')]['where']||null:null,'attributes':_0x2e18e9[_0x7356('0x1c')]?_0x2e18e9[_0x7356('0x1c')][_0x7356('0x1e')]||null:null,'limit':_0x2e18e9['options']?_0x2e18e9[_0x7356('0x1c')][_0x7356('0x1f')]||null:null,'include':_0x2e18e9['options']?_0x2e18e9[_0x7356('0x1c')][_0x7356('0x20')]?_[_0x7356('0x21')](_0x2e18e9[_0x7356('0x1c')][_0x7356('0x20')],function(_0x5beafa){return{'model':db[_0x5beafa['model']],'as':_0x5beafa['as'],'attributes':_0x5beafa[_0x7356('0x1e')],'include':_0x5beafa[_0x7356('0x20')]?_[_0x7356('0x21')](_0x5beafa[_0x7356('0x20')],function(_0x8212df){return{'model':db[_0x8212df[_0x7356('0x22')]],'as':_0x8212df['as'],'attributes':_0x8212df[_0x7356('0x1e')],'include':_0x8212df[_0x7356('0x20')]?_[_0x7356('0x21')](_0x8212df[_0x7356('0x20')],function(_0x39e85f){return{'model':db[_0x39e85f['model']],'as':_0x39e85f['as'],'attributes':_0x39e85f[_0x7356('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7356('0x23')](function(_0x1fd4cf){logger[_0x7356('0x11')](_0x7356('0x24'),_0x2e18e9);logger[_0x7356('0x14')](_0x7356('0x24'),_0x2e18e9,JSON['stringify'](_0x1fd4cf));_0x19f359(_0x1fd4cf);})['catch'](function(_0x41b78e){logger[_0x7356('0x17')]('GetOpenchannelQueue',_0x41b78e[_0x7356('0x18')],_0x2e18e9);_0x13509f(_0x16c22f[_0x7356('0x17')](0x1f4,_0x41b78e['message']));});});};exports[_0x7356('0x25')]=function(_0x1cf8aa){var _0x3d6045=this;return new Promise(function(_0x445720,_0x4fd508){return db['OpenchannelQueue'][_0x7356('0x26')]({'raw':_0x1cf8aa[_0x7356('0x1c')]?_0x1cf8aa['options'][_0x7356('0x1d')]===undefined?!![]:![]:!![],'where':_0x1cf8aa[_0x7356('0x1c')]?_0x1cf8aa['options'][_0x7356('0x27')]||null:null,'attributes':_0x1cf8aa[_0x7356('0x1c')]?_0x1cf8aa[_0x7356('0x1c')][_0x7356('0x1e')]||null:null,'include':_0x1cf8aa['options']?_0x1cf8aa[_0x7356('0x1c')][_0x7356('0x20')]?_[_0x7356('0x21')](_0x1cf8aa[_0x7356('0x1c')]['include'],function(_0x1596d1){return{'model':db[_0x1596d1[_0x7356('0x22')]],'as':_0x1596d1['as'],'attributes':_0x1596d1['attributes'],'include':_0x1596d1[_0x7356('0x20')]?_['map'](_0x1596d1[_0x7356('0x20')],function(_0x20ca9a){return{'model':db[_0x20ca9a[_0x7356('0x22')]],'as':_0x20ca9a['as'],'attributes':_0x20ca9a[_0x7356('0x1e')],'include':_0x20ca9a[_0x7356('0x20')]?_[_0x7356('0x21')](_0x20ca9a['include'],function(_0x4cdfea){return{'model':db[_0x4cdfea[_0x7356('0x22')]],'as':_0x4cdfea['as'],'attributes':_0x4cdfea[_0x7356('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7356('0x23')](function(_0x44ada6){logger[_0x7356('0x11')]('ShowOpenchannelQueue',_0x1cf8aa);logger['debug'](_0x7356('0x25'),_0x1cf8aa,JSON['stringify'](_0x44ada6));_0x445720(_0x44ada6);})[_0x7356('0x1a')](function(_0x3cb479){logger[_0x7356('0x17')](_0x7356('0x25'),_0x3cb479[_0x7356('0x18')],_0x1cf8aa);_0x4fd508(_0x3d6045[_0x7356('0x17')](0x1f4,_0x3cb479[_0x7356('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index b707b24..50c1829 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 _0x0d64=['openchannelQueue:','./openchannelQueue.events','save','remove','update','removeListener','register'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x0d64,0xbe));var _0x40d6=function(_0x3774c7,_0x361f2b){_0x3774c7=_0x3774c7-0x0;var _0x1db61e=_0x0d64[_0x3774c7];return _0x1db61e;};'use strict';var OpenchannelQueueEvents=require(_0x40d6('0x0'));var events=[_0x40d6('0x1'),_0x40d6('0x2'),_0x40d6('0x3')];function createListener(_0x126bdc,_0x461695){return function(_0x2ad898){_0x461695['emit'](_0x126bdc,_0x2ad898);};}function removeListener(_0x5c2c9b,_0xbea058){return function(){OpenchannelQueueEvents[_0x40d6('0x4')](_0x5c2c9b,_0xbea058);};}exports[_0x40d6('0x5')]=function(_0x514b90){for(var _0x387b67=0x0,_0x235418=events['length'];_0x387b67<_0x235418;_0x387b67++){var _0x25de51=events[_0x387b67];var _0x3519ae=createListener(_0x40d6('0x6')+_0x25de51,_0x514b90);OpenchannelQueueEvents['on'](_0x25de51,_0x3519ae);}}; \ No newline at end of file +var _0x5cdd=['emit','register','length','./openchannelQueue.events'];(function(_0x4c40f7,_0x11abfd){var _0x57e129=function(_0x5c0332){while(--_0x5c0332){_0x4c40f7['push'](_0x4c40f7['shift']());}};_0x57e129(++_0x11abfd);}(_0x5cdd,0x143));var _0xd5cd=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5cdd[_0x4b369d];return _0x571a98;};'use strict';var OpenchannelQueueEvents=require(_0xd5cd('0x0'));var events=['save','remove','update'];function createListener(_0x56c8c0,_0x252cb4){return function(_0x5334d6){_0x252cb4[_0xd5cd('0x1')](_0x56c8c0,_0x5334d6);};}function removeListener(_0x1d5fbd,_0x4ffa78){return function(){OpenchannelQueueEvents['removeListener'](_0x1d5fbd,_0x4ffa78);};}exports[_0xd5cd('0x2')]=function(_0x21b8a5){for(var _0x1e909e=0x0,_0x4bfd50=events[_0xd5cd('0x3')];_0x1e909e<_0x4bfd50;_0x1e909e++){var _0x20f4e4=events[_0x1e909e];var _0x2c0320=createListener('openchannelQueue:'+_0x20f4e4,_0x21b8a5);OpenchannelQueueEvents['on'](_0x20f4e4,_0x2c0320);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 55e2a5b..3ed161e 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 _0xa626=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x32fb8d,_0x567a64){var _0x37cf13=function(_0x28bf81){while(--_0x28bf81){_0x32fb8d['push'](_0x32fb8d['shift']());}};_0x37cf13(++_0x567a64);}(_0xa626,0x90));var _0x6a62=function(_0x2d3b8c,_0x21aeb5){_0x2d3b8c=_0x2d3b8c-0x0;var _0x47e80c=_0xa626[_0x2d3b8c];return _0x47e80c;};'use strict';var multer=require(_0x6a62('0x0'));var util=require(_0x6a62('0x1'));var path=require(_0x6a62('0x2'));var timeout=require(_0x6a62('0x3'));var express=require(_0x6a62('0x4'));var router=express[_0x6a62('0x5')]();var fs_extra=require(_0x6a62('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6a62('0x7'));var config=require(_0x6a62('0x8'));var controller=require(_0x6a62('0x9'));router[_0x6a62('0xa')]('/',auth[_0x6a62('0xb')](),controller[_0x6a62('0xc')]);router['get'](_0x6a62('0xd'),auth['isAuthenticated'](),controller[_0x6a62('0xe')]);router[_0x6a62('0xa')](_0x6a62('0xf'),auth[_0x6a62('0xb')](),controller[_0x6a62('0x10')]);router[_0x6a62('0x11')]('/',auth['isAuthenticated'](),controller[_0x6a62('0x12')]);router[_0x6a62('0x13')](_0x6a62('0xf'),auth['isAuthenticated'](),controller[_0x6a62('0x14')]);router[_0x6a62('0x15')](_0x6a62('0xf'),auth[_0x6a62('0xb')](),controller['destroy']);module[_0x6a62('0x16')]=router; \ No newline at end of file +var _0x39e8=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x39e8,0x8b));var _0x839e=function(_0x32cdbd,_0x2098c9){_0x32cdbd=_0x32cdbd-0x0;var _0x3e8e47=_0x39e8[_0x32cdbd];return _0x3e8e47;};'use strict';var multer=require('multer');var util=require(_0x839e('0x0'));var path=require(_0x839e('0x1'));var timeout=require('connect-timeout');var express=require(_0x839e('0x2'));var router=express['Router']();var fs_extra=require(_0x839e('0x3'));var auth=require(_0x839e('0x4'));var interaction=require(_0x839e('0x5'));var config=require(_0x839e('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0x839e('0x7')]('/',auth['isAuthenticated'](),controller[_0x839e('0x8')]);router[_0x839e('0x7')](_0x839e('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x839e('0xa'),auth[_0x839e('0xb')](),controller[_0x839e('0xc')]);router[_0x839e('0xd')]('/',auth[_0x839e('0xb')](),controller[_0x839e('0xe')]);router[_0x839e('0xf')]('/:id',auth[_0x839e('0xb')](),controller[_0x839e('0x10')]);router[_0x839e('0x11')](_0x839e('0xa'),auth[_0x839e('0xb')](),controller[_0x839e('0x12')]);module[_0x839e('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 3a1588b..804927a 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 _0x54f1=['DATE','STRING'];(function(_0x2381d0,_0xbc9b99){var _0xdea626=function(_0x49bdf7){while(--_0x49bdf7){_0x2381d0['push'](_0x2381d0['shift']());}};_0xdea626(++_0xbc9b99);}(_0x54f1,0x159));var _0x154f=function(_0x15c5cc,_0x2b0ca5){_0x15c5cc=_0x15c5cc-0x0;var _0x4b0ce6=_0x54f1[_0x15c5cc];return _0x4b0ce6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x154f('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x154f('0x0')]},'joinAt':{'type':Sequelize[_0x154f('0x1')]},'leaveAt':{'type':Sequelize[_0x154f('0x1')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x154f('0x1')]},'reason':{'type':Sequelize[_0x154f('0x0')]}}; \ No newline at end of file +var _0x186a=['exports','STRING','DATE','moment','sequelize'];(function(_0x4766e5,_0x25a5cc){var _0x54f0fc=function(_0x201d11){while(--_0x201d11){_0x4766e5['push'](_0x4766e5['shift']());}};_0x54f0fc(++_0x25a5cc);}(_0x186a,0x15c));var _0xa186=function(_0x5d1d55,_0x101459){_0x5d1d55=_0x5d1d55-0x0;var _0x5e3c4e=_0x186a[_0x5d1d55];return _0x5e3c4e;};'use strict';var moment=require(_0xa186('0x0'));var Sequelize=require(_0xa186('0x1'));module[_0xa186('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa186('0x3')]},'joinAt':{'type':Sequelize[_0xa186('0x4')]},'leaveAt':{'type':Sequelize[_0xa186('0x4')]},'acceptAt':{'type':Sequelize[_0xa186('0x4')]},'exitAt':{'type':Sequelize[_0xa186('0x4')]},'reason':{'type':Sequelize[_0xa186('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 0caa343..b3bc345 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 _0x8bd6=['path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3af40d,_0x5f38f6){var _0x363acb=function(_0x2ed0f8){while(--_0x2ed0f8){_0x3af40d['push'](_0x3af40d['shift']());}};_0x363acb(++_0x5f38f6);}(_0x8bd6,0x18c));var _0x68bd=function(_0x30b6b1,_0x36d020){_0x30b6b1=_0x30b6b1-0x0;var _0x35f27d=_0x8bd6[_0x30b6b1];return _0x35f27d;};'use strict';var emlformat=require(_0x68bd('0x0'));var rimraf=require(_0x68bd('0x1'));var zipdir=require(_0x68bd('0x2'));var jsonpatch=require(_0x68bd('0x3'));var rp=require(_0x68bd('0x4'));var moment=require(_0x68bd('0x5'));var BPromise=require(_0x68bd('0x6'));var Mustache=require(_0x68bd('0x7'));var util=require(_0x68bd('0x8'));var path=require(_0x68bd('0x9'));var sox=require(_0x68bd('0xa'));var csv=require(_0x68bd('0xb'));var ejs=require(_0x68bd('0xc'));var fs=require('fs');var fs_extra=require(_0x68bd('0xd'));var _=require(_0x68bd('0xe'));var squel=require(_0x68bd('0xf'));var crypto=require('crypto');var jsforce=require(_0x68bd('0x10'));var deskjs=require(_0x68bd('0x11'));var toCsv=require(_0x68bd('0xb'));var querystring=require(_0x68bd('0x12'));var Papa=require(_0x68bd('0x13'));var Redis=require(_0x68bd('0x14'));var authService=require(_0x68bd('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x68bd('0x16'));var utils=require(_0x68bd('0x17'));var config=require(_0x68bd('0x18'));var licenseUtil=require(_0x68bd('0x19'));var db=require(_0x68bd('0x1a'))['db'];function respondWithStatusCode(_0xd79db7,_0x3bc19d){_0x3bc19d=_0x3bc19d||0xcc;return function(_0x4d0bc0){if(_0x4d0bc0){return _0xd79db7['sendStatus'](_0x3bc19d);}return _0xd79db7['status'](_0x3bc19d)[_0x68bd('0x1b')]();};}function respondWithResult(_0x46ead6,_0xf4f5fc){_0xf4f5fc=_0xf4f5fc||0xc8;return function(_0x558297){if(_0x558297){return _0x46ead6[_0x68bd('0x1c')](_0xf4f5fc)['json'](_0x558297);}};}function respondWithFilteredResult(_0x48b69e,_0x46d412){return function(_0x1ab51f){if(_0x1ab51f){var _0x1f793b=typeof _0x46d412[_0x68bd('0x1d')]===_0x68bd('0x1e')&&typeof _0x46d412['limit']===_0x68bd('0x1e');var _0xce460d=_0x1ab51f[_0x68bd('0x1f')];var _0x2ef4e1=_0x1f793b?0x0:_0x46d412[_0x68bd('0x1d')];var _0x389a26=_0x1f793b?_0x1ab51f['count']:_0x46d412[_0x68bd('0x1d')]+_0x46d412[_0x68bd('0x20')];var _0xde4306;if(_0x389a26>=_0xce460d){_0x389a26=_0xce460d;_0xde4306=0xc8;}else{_0xde4306=0xce;}_0x48b69e['status'](_0xde4306);return _0x48b69e[_0x68bd('0x21')]('Content-Range',_0x2ef4e1+'-'+_0x389a26+'/'+_0xce460d)[_0x68bd('0x22')](_0x1ab51f);}return null;};}function patchUpdates(_0x36817c){return function(_0x309c3e){try{jsonpatch[_0x68bd('0x23')](_0x309c3e,_0x36817c,!![]);}catch(_0x4b2e83){return BPromise[_0x68bd('0x24')](_0x4b2e83);}return _0x309c3e[_0x68bd('0x25')]();};}function saveUpdates(_0x4b69a4,_0x2652e5){return function(_0x1dc845){if(_0x1dc845){return _0x1dc845['update'](_0x4b69a4)[_0x68bd('0x26')](function(_0x42bde){return _0x42bde;});}return null;};}function removeEntity(_0x3c89c7,_0x435435){return function(_0x2115ef){if(_0x2115ef){return _0x2115ef[_0x68bd('0x27')]()[_0x68bd('0x26')](function(){_0x3c89c7[_0x68bd('0x1c')](0xcc)[_0x68bd('0x1b')]();});}};}function handleEntityNotFound(_0x5d1ed0,_0x2d6255){return function(_0x3a1b51){if(!_0x3a1b51){_0x5d1ed0[_0x68bd('0x28')](0x194);}return _0x3a1b51;};}function handleError(_0x229bbc,_0x2b1ec4){_0x2b1ec4=_0x2b1ec4||0x1f4;return function(_0x38846e){logger[_0x68bd('0x29')](_0x38846e[_0x68bd('0x2a')]);if(_0x38846e[_0x68bd('0x2b')]){delete _0x38846e[_0x68bd('0x2b')];}_0x229bbc[_0x68bd('0x1c')](_0x2b1ec4)[_0x68bd('0x2c')](_0x38846e);};}exports[_0x68bd('0x2d')]=function(_0x35225d,_0x2c5473){var _0x370285={},_0x2a8a77={},_0x44c7ef={'count':0x0,'rows':[]};var _0x23f7e6=_['map'](db[_0x68bd('0x2e')][_0x68bd('0x2f')],function(_0x2cd458){return{'name':_0x2cd458[_0x68bd('0x30')],'type':_0x2cd458['type']['key']};});_0x2a8a77['model']=_[_0x68bd('0x31')](_0x23f7e6,_0x68bd('0x2b'));_0x2a8a77[_0x68bd('0x32')]=_[_0x68bd('0x33')](_0x35225d[_0x68bd('0x32')]);_0x2a8a77[_0x68bd('0x34')]=_[_0x68bd('0x35')](_0x2a8a77[_0x68bd('0x36')],_0x2a8a77[_0x68bd('0x32')]);_0x370285[_0x68bd('0x37')]=_[_0x68bd('0x35')](_0x2a8a77[_0x68bd('0x36')],qs[_0x68bd('0x38')](_0x35225d['query'][_0x68bd('0x38')]));_0x370285[_0x68bd('0x37')]=_0x370285['attributes'][_0x68bd('0x39')]?_0x370285[_0x68bd('0x37')]:_0x2a8a77[_0x68bd('0x36')];if(!_0x35225d[_0x68bd('0x32')][_0x68bd('0x3a')](_0x68bd('0x3b'))){_0x370285['limit']=qs['limit'](_0x35225d[_0x68bd('0x32')][_0x68bd('0x20')]);_0x370285[_0x68bd('0x1d')]=qs[_0x68bd('0x1d')](_0x35225d[_0x68bd('0x32')][_0x68bd('0x1d')]);}_0x370285[_0x68bd('0x3c')]=qs[_0x68bd('0x3d')](_0x35225d['query'][_0x68bd('0x3d')]);_0x370285[_0x68bd('0x3e')]=qs['filters'](_[_0x68bd('0x3f')](_0x35225d['query'],_0x2a8a77[_0x68bd('0x34')]),_0x23f7e6);if(_0x35225d[_0x68bd('0x32')][_0x68bd('0x40')]){_0x370285['where']=_[_0x68bd('0x41')](_0x370285[_0x68bd('0x3e')],{'$or':_[_0x68bd('0x31')](_0x23f7e6,function(_0x5f65e7){if(_0x5f65e7[_0x68bd('0x42')]!==_0x68bd('0x43')){var _0x40f364={};_0x40f364[_0x5f65e7[_0x68bd('0x2b')]]={'$like':'%'+_0x35225d[_0x68bd('0x32')][_0x68bd('0x40')]+'%'};return _0x40f364;}})});}_0x370285=_[_0x68bd('0x41')]({},_0x370285,_0x35225d[_0x68bd('0x44')]);var _0x2b88fa={'where':_0x370285[_0x68bd('0x3e')]};return db[_0x68bd('0x2e')][_0x68bd('0x1f')](_0x2b88fa)[_0x68bd('0x26')](function(_0x74a60c){_0x44c7ef[_0x68bd('0x1f')]=_0x74a60c;if(_0x35225d[_0x68bd('0x32')][_0x68bd('0x45')]){_0x370285[_0x68bd('0x46')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x68bd('0x47')](_0x370285);})[_0x68bd('0x26')](function(_0x39755a){_0x44c7ef[_0x68bd('0x48')]=_0x39755a;return _0x44c7ef;})['then'](respondWithFilteredResult(_0x2c5473,_0x370285))[_0x68bd('0x49')](handleError(_0x2c5473,null));};exports[_0x68bd('0x4a')]=function(_0x2a8e10,_0x39c612){var _0x52034f={'raw':!![],'where':{'id':_0x2a8e10[_0x68bd('0x4b')]['id']}},_0x54f874={};_0x54f874[_0x68bd('0x36')]=_[_0x68bd('0x33')](db['OpenchannelQueueReport'][_0x68bd('0x2f')]);_0x54f874[_0x68bd('0x32')]=_[_0x68bd('0x33')](_0x2a8e10[_0x68bd('0x32')]);_0x54f874[_0x68bd('0x34')]=_['intersection'](_0x54f874['model'],_0x54f874[_0x68bd('0x32')]);_0x52034f[_0x68bd('0x37')]=_[_0x68bd('0x35')](_0x54f874['model'],qs[_0x68bd('0x38')](_0x2a8e10[_0x68bd('0x32')][_0x68bd('0x38')]));_0x52034f[_0x68bd('0x37')]=_0x52034f['attributes'][_0x68bd('0x39')]?_0x52034f[_0x68bd('0x37')]:_0x54f874[_0x68bd('0x36')];if(_0x2a8e10[_0x68bd('0x32')]['includeAll']){_0x52034f[_0x68bd('0x46')]=[{'all':!![]}];}_0x52034f=_[_0x68bd('0x41')]({},_0x52034f,_0x2a8e10[_0x68bd('0x44')]);return db[_0x68bd('0x2e')][_0x68bd('0x4c')](_0x52034f)[_0x68bd('0x26')](handleEntityNotFound(_0x39c612,null))['then'](respondWithResult(_0x39c612,null))[_0x68bd('0x49')](handleError(_0x39c612,null));};exports[_0x68bd('0x4d')]=function(_0x434821,_0x609da8){return db['OpenchannelQueueReport'][_0x68bd('0x4d')](_0x434821[_0x68bd('0x4e')],{})['then'](respondWithResult(_0x609da8,0xc9))[_0x68bd('0x49')](handleError(_0x609da8,null));};exports[_0x68bd('0x4f')]=function(_0xe5e245,_0x39cc4a){if(_0xe5e245['body']['id']){delete _0xe5e245[_0x68bd('0x4e')]['id'];}return db[_0x68bd('0x2e')][_0x68bd('0x4c')]({'where':{'id':_0xe5e245[_0x68bd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39cc4a,null))[_0x68bd('0x26')](saveUpdates(_0xe5e245[_0x68bd('0x4e')],null))[_0x68bd('0x26')](respondWithResult(_0x39cc4a,null))[_0x68bd('0x49')](handleError(_0x39cc4a,null));};exports[_0x68bd('0x27')]=function(_0x45f2d5,_0x4a8203){return db[_0x68bd('0x2e')][_0x68bd('0x4c')]({'where':{'id':_0x45f2d5[_0x68bd('0x4b')]['id']}})[_0x68bd('0x26')](handleEntityNotFound(_0x4a8203,null))[_0x68bd('0x26')](removeEntity(_0x4a8203,null))[_0x68bd('0x49')](handleError(_0x4a8203,null));};exports[_0x68bd('0x50')]=function(_0x429701,_0x2b4786){return db[_0x68bd('0x2e')][_0x68bd('0x50')]()[_0x68bd('0x26')](respondWithResult(_0x2b4786,null))['catch'](handleError(_0x2b4786,null));}; \ No newline at end of file +var _0x7fcb=['end','json','offset','limit','count','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','VIRTUAL','include','findAll','rows','show','params','merge','options','OpenchannelQueueReport','find','catch','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7fcb,0x15f));var _0xb7fc=function(_0x5650b0,_0x1d1dff){_0x5650b0=_0x5650b0-0x0;var _0x311f58=_0x7fcb[_0x5650b0];return _0x311f58;};'use strict';var emlformat=require(_0xb7fc('0x0'));var rimraf=require(_0xb7fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb7fc('0x2'));var moment=require('moment');var BPromise=require(_0xb7fc('0x3'));var Mustache=require(_0xb7fc('0x4'));var util=require('util');var path=require(_0xb7fc('0x5'));var sox=require(_0xb7fc('0x6'));var csv=require(_0xb7fc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7fc('0x8'));var _=require(_0xb7fc('0x9'));var squel=require(_0xb7fc('0xa'));var crypto=require(_0xb7fc('0xb'));var jsforce=require(_0xb7fc('0xc'));var deskjs=require(_0xb7fc('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb7fc('0xe'));var authService=require(_0xb7fc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb7fc('0x10'));var hardwareService=require(_0xb7fc('0x11'));var logger=require(_0xb7fc('0x12'))(_0xb7fc('0x13'));var utils=require('../../config/utils');var config=require(_0xb7fc('0x14'));var licenseUtil=require(_0xb7fc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20b21a,_0x570da4){_0x570da4=_0x570da4||0xcc;return function(_0x3c8505){if(_0x3c8505){return _0x20b21a[_0xb7fc('0x16')](_0x570da4);}return _0x20b21a[_0xb7fc('0x17')](_0x570da4)[_0xb7fc('0x18')]();};}function respondWithResult(_0x144930,_0x321ef7){_0x321ef7=_0x321ef7||0xc8;return function(_0x5459d0){if(_0x5459d0){return _0x144930[_0xb7fc('0x17')](_0x321ef7)[_0xb7fc('0x19')](_0x5459d0);}};}function respondWithFilteredResult(_0x59bcdb,_0x550571){return function(_0x15793){if(_0x15793){var _0x5aefc6=typeof _0x550571[_0xb7fc('0x1a')]==='undefined'&&typeof _0x550571[_0xb7fc('0x1b')]==='undefined';var _0x22ef41=_0x15793[_0xb7fc('0x1c')];var _0x3f2ff1=_0x5aefc6?0x0:_0x550571['offset'];var _0x1fb1cd=_0x5aefc6?_0x15793[_0xb7fc('0x1c')]:_0x550571[_0xb7fc('0x1a')]+_0x550571['limit'];var _0x5746db;if(_0x1fb1cd>=_0x22ef41){_0x1fb1cd=_0x22ef41;_0x5746db=0xc8;}else{_0x5746db=0xce;}_0x59bcdb[_0xb7fc('0x17')](_0x5746db);return _0x59bcdb[_0xb7fc('0x1d')](_0xb7fc('0x1e'),_0x3f2ff1+'-'+_0x1fb1cd+'/'+_0x22ef41)['json'](_0x15793);}return null;};}function patchUpdates(_0x42759b){return function(_0x4663a0){try{jsonpatch[_0xb7fc('0x1f')](_0x4663a0,_0x42759b,!![]);}catch(_0x407534){return BPromise[_0xb7fc('0x20')](_0x407534);}return _0x4663a0['save']();};}function saveUpdates(_0x4f9d71,_0x3d452b){return function(_0x227fcc){if(_0x227fcc){return _0x227fcc[_0xb7fc('0x21')](_0x4f9d71)[_0xb7fc('0x22')](function(_0x2023b7){return _0x2023b7;});}return null;};}function removeEntity(_0xe1746b,_0x1254a8){return function(_0x2de29c){if(_0x2de29c){return _0x2de29c[_0xb7fc('0x23')]()['then'](function(){_0xe1746b[_0xb7fc('0x17')](0xcc)[_0xb7fc('0x18')]();});}};}function handleEntityNotFound(_0x363839,_0x3d72c2){return function(_0x26653b){if(!_0x26653b){_0x363839[_0xb7fc('0x16')](0x194);}return _0x26653b;};}function handleError(_0x1b6dcd,_0x39e916){_0x39e916=_0x39e916||0x1f4;return function(_0x3c03a2){logger[_0xb7fc('0x24')](_0x3c03a2[_0xb7fc('0x25')]);if(_0x3c03a2[_0xb7fc('0x26')]){delete _0x3c03a2[_0xb7fc('0x26')];}_0x1b6dcd[_0xb7fc('0x17')](_0x39e916)[_0xb7fc('0x27')](_0x3c03a2);};}exports[_0xb7fc('0x28')]=function(_0x404ee8,_0x543c3d){var _0x4517d0={},_0x584bf5={},_0x3e85ef={'count':0x0,'rows':[]};var _0x5c8613=_[_0xb7fc('0x29')](db['OpenchannelQueueReport'][_0xb7fc('0x2a')],function(_0x39dc57){return{'name':_0x39dc57[_0xb7fc('0x2b')],'type':_0x39dc57[_0xb7fc('0x2c')][_0xb7fc('0x2d')]};});_0x584bf5[_0xb7fc('0x2e')]=_[_0xb7fc('0x29')](_0x5c8613,'name');_0x584bf5[_0xb7fc('0x2f')]=_[_0xb7fc('0x30')](_0x404ee8['query']);_0x584bf5[_0xb7fc('0x31')]=_[_0xb7fc('0x32')](_0x584bf5[_0xb7fc('0x2e')],_0x584bf5['query']);_0x4517d0[_0xb7fc('0x33')]=_[_0xb7fc('0x32')](_0x584bf5[_0xb7fc('0x2e')],qs[_0xb7fc('0x34')](_0x404ee8[_0xb7fc('0x2f')]['fields']));_0x4517d0[_0xb7fc('0x33')]=_0x4517d0['attributes'][_0xb7fc('0x35')]?_0x4517d0[_0xb7fc('0x33')]:_0x584bf5[_0xb7fc('0x2e')];if(!_0x404ee8[_0xb7fc('0x2f')][_0xb7fc('0x36')](_0xb7fc('0x37'))){_0x4517d0[_0xb7fc('0x1b')]=qs[_0xb7fc('0x1b')](_0x404ee8[_0xb7fc('0x2f')][_0xb7fc('0x1b')]);_0x4517d0[_0xb7fc('0x1a')]=qs[_0xb7fc('0x1a')](_0x404ee8[_0xb7fc('0x2f')][_0xb7fc('0x1a')]);}_0x4517d0[_0xb7fc('0x38')]=qs[_0xb7fc('0x39')](_0x404ee8['query'][_0xb7fc('0x39')]);_0x4517d0['where']=qs['filters'](_[_0xb7fc('0x3a')](_0x404ee8[_0xb7fc('0x2f')],_0x584bf5[_0xb7fc('0x31')]),_0x5c8613);if(_0x404ee8[_0xb7fc('0x2f')][_0xb7fc('0x3b')]){_0x4517d0['where']=_['merge'](_0x4517d0[_0xb7fc('0x3c')],{'$or':_[_0xb7fc('0x29')](_0x5c8613,function(_0x157fb2){if(_0x157fb2[_0xb7fc('0x2c')]!==_0xb7fc('0x3d')){var _0x4c011d={};_0x4c011d[_0x157fb2[_0xb7fc('0x26')]]={'$like':'%'+_0x404ee8['query'][_0xb7fc('0x3b')]+'%'};return _0x4c011d;}})});}_0x4517d0=_['merge']({},_0x4517d0,_0x404ee8['options']);var _0x262739={'where':_0x4517d0[_0xb7fc('0x3c')]};return db['OpenchannelQueueReport'][_0xb7fc('0x1c')](_0x262739)[_0xb7fc('0x22')](function(_0x1dba03){_0x3e85ef[_0xb7fc('0x1c')]=_0x1dba03;if(_0x404ee8[_0xb7fc('0x2f')]['includeAll']){_0x4517d0[_0xb7fc('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xb7fc('0x3f')](_0x4517d0);})['then'](function(_0x4fd604){_0x3e85ef[_0xb7fc('0x40')]=_0x4fd604;return _0x3e85ef;})['then'](respondWithFilteredResult(_0x543c3d,_0x4517d0))['catch'](handleError(_0x543c3d,null));};exports[_0xb7fc('0x41')]=function(_0x2aa44b,_0x1e46ad){var _0x542e56={'raw':!![],'where':{'id':_0x2aa44b[_0xb7fc('0x42')]['id']}},_0x569504={};_0x569504['model']=_[_0xb7fc('0x30')](db['OpenchannelQueueReport'][_0xb7fc('0x2a')]);_0x569504[_0xb7fc('0x2f')]=_['keys'](_0x2aa44b[_0xb7fc('0x2f')]);_0x569504['filters']=_['intersection'](_0x569504[_0xb7fc('0x2e')],_0x569504[_0xb7fc('0x2f')]);_0x542e56[_0xb7fc('0x33')]=_[_0xb7fc('0x32')](_0x569504[_0xb7fc('0x2e')],qs['fields'](_0x2aa44b[_0xb7fc('0x2f')][_0xb7fc('0x34')]));_0x542e56['attributes']=_0x542e56[_0xb7fc('0x33')][_0xb7fc('0x35')]?_0x542e56[_0xb7fc('0x33')]:_0x569504[_0xb7fc('0x2e')];if(_0x2aa44b[_0xb7fc('0x2f')]['includeAll']){_0x542e56[_0xb7fc('0x3e')]=[{'all':!![]}];}_0x542e56=_[_0xb7fc('0x43')]({},_0x542e56,_0x2aa44b[_0xb7fc('0x44')]);return db[_0xb7fc('0x45')][_0xb7fc('0x46')](_0x542e56)[_0xb7fc('0x22')](handleEntityNotFound(_0x1e46ad,null))[_0xb7fc('0x22')](respondWithResult(_0x1e46ad,null))[_0xb7fc('0x47')](handleError(_0x1e46ad,null));};exports[_0xb7fc('0x48')]=function(_0x5abe7d,_0x3327c5){return db[_0xb7fc('0x45')][_0xb7fc('0x48')](_0x5abe7d[_0xb7fc('0x49')],{})[_0xb7fc('0x22')](respondWithResult(_0x3327c5,0xc9))[_0xb7fc('0x47')](handleError(_0x3327c5,null));};exports[_0xb7fc('0x21')]=function(_0x875d5c,_0x44578c){if(_0x875d5c[_0xb7fc('0x49')]['id']){delete _0x875d5c[_0xb7fc('0x49')]['id'];}return db[_0xb7fc('0x45')][_0xb7fc('0x46')]({'where':{'id':_0x875d5c[_0xb7fc('0x42')]['id']}})[_0xb7fc('0x22')](handleEntityNotFound(_0x44578c,null))['then'](saveUpdates(_0x875d5c[_0xb7fc('0x49')],null))['then'](respondWithResult(_0x44578c,null))[_0xb7fc('0x47')](handleError(_0x44578c,null));};exports[_0xb7fc('0x23')]=function(_0xd42df3,_0x722282){return db[_0xb7fc('0x45')][_0xb7fc('0x46')]({'where':{'id':_0xd42df3['params']['id']}})[_0xb7fc('0x22')](handleEntityNotFound(_0x722282,null))[_0xb7fc('0x22')](removeEntity(_0x722282,null))[_0xb7fc('0x47')](handleError(_0x722282,null));};exports[_0xb7fc('0x4a')]=function(_0x47239a,_0x195d90){return db[_0xb7fc('0x45')]['describe']()[_0xb7fc('0x22')](respondWithResult(_0x195d90,null))[_0xb7fc('0x47')](handleError(_0x195d90,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 6055c27..cdac3cf 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x2b8349,_0x369931){var _0x406af3=function(_0x444b03){while(--_0x444b03){_0x2b8349['push'](_0x2b8349['shift']());}};_0x406af3(++_0x369931);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xc4aa[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x814b,0x1a2));var _0xb814=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x814b[_0x57014b];return _0x2b258a;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 9acac58..a23d82b 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 _0xbb59=['then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateOpenchannelQueueReport','body','options','catch','UpdateOpenchannelQueueReport','update','where','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0xbb59,0xec));var _0x9bb5=function(_0x20266d,_0x5ae2f1){_0x20266d=_0x20266d-0x0;var _0x3a35c7=_0xbb59[_0x20266d];return _0x3a35c7;};'use strict';var _=require(_0x9bb5('0x0'));var util=require(_0x9bb5('0x1'));var moment=require(_0x9bb5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bb5('0x3'));var db=require(_0x9bb5('0x4'))['db'];var utils=require(_0x9bb5('0x5'));var logger=require(_0x9bb5('0x6'))(_0x9bb5('0x7'));var config=require('../../config/environment');var jayson=require(_0x9bb5('0x8'));var client=jayson[_0x9bb5('0x9')][_0x9bb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2df722,_0xe362e0,_0x83fd10){return new BPromise(function(_0x2d6cce,_0x4e3857){return client[_0x9bb5('0xb')](_0x2df722,_0x83fd10)[_0x9bb5('0xc')](function(_0x2fdbcb){logger[_0x9bb5('0xd')](_0x9bb5('0xe'),_0xe362e0,'request\x20sent');logger[_0x9bb5('0xf')](_0x9bb5('0x10'),_0xe362e0,_0x9bb5('0x11'),JSON[_0x9bb5('0x12')](_0x2fdbcb));if(_0x2fdbcb[_0x9bb5('0x13')]){if(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x14')]===0x1f4){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);return _0x4e3857(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);}logger[_0x9bb5('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe362e0,_0x2fdbcb['error'][_0x9bb5('0x15')]);return _0x2d6cce(_0x2fdbcb['error']['message']);}else{logger[_0x9bb5('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe362e0,_0x9bb5('0x11'));_0x2d6cce(_0x2fdbcb[_0x9bb5('0x16')][_0x9bb5('0x15')]);}})['catch'](function(_0xb471e){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0xb471e);_0x4e3857(_0xb471e);});});}exports[_0x9bb5('0x17')]=function(_0xba8392){var _0x19d1e9=this;return new Promise(function(_0x162815,_0xe44bdd){return db['OpenchannelQueueReport']['create'](_0xba8392[_0x9bb5('0x18')],{'raw':_0xba8392[_0x9bb5('0x19')]?_0xba8392['options']['raw']===undefined?!![]:![]:!![]})[_0x9bb5('0xc')](function(_0x182966){logger[_0x9bb5('0xd')]('CreateOpenchannelQueueReport',_0xba8392);logger[_0x9bb5('0xf')](_0x9bb5('0x17'),_0xba8392,JSON[_0x9bb5('0x12')](_0x182966));_0x162815(_0x182966);})[_0x9bb5('0x1a')](function(_0x51fa34){logger[_0x9bb5('0x13')](_0x9bb5('0x17'),_0x51fa34['message'],_0xba8392);_0xe44bdd(_0x19d1e9[_0x9bb5('0x13')](0x1f4,_0x51fa34['message']));});});};exports[_0x9bb5('0x1b')]=function(_0x5357e9){var _0x4be52b=this;return new Promise(function(_0x1d7195,_0x16db23){return db['OpenchannelQueueReport'][_0x9bb5('0x1c')](_0x5357e9[_0x9bb5('0x18')],{'raw':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9[_0x9bb5('0x19')][_0x9bb5('0x1d')]||null:null,'attributes':_0x5357e9['options']?_0x5357e9[_0x9bb5('0x19')][_0x9bb5('0x1e')]||null:null,'limit':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9['options']['limit']||null:null})['then'](function(_0x1ad67b){logger[_0x9bb5('0xd')](_0x9bb5('0x1b'),_0x5357e9);logger[_0x9bb5('0xf')](_0x9bb5('0x1b'),_0x5357e9,JSON['stringify'](_0x1ad67b));_0x1d7195(_0x1ad67b);})['catch'](function(_0x59ef00){logger[_0x9bb5('0x13')](_0x9bb5('0x1b'),_0x59ef00[_0x9bb5('0x15')],_0x5357e9);_0x16db23(_0x4be52b['error'](0x1f4,_0x59ef00['message']));});});}; \ No newline at end of file +var _0x4fc2=['limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0x4fc2,0x111));var _0x24fc=function(_0x4d95db,_0x28b7e9){_0x4d95db=_0x4d95db-0x0;var _0x1cc484=_0x4fc2[_0x4d95db];return _0x1cc484;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['CreateOpenchannelQueueReport']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['OpenchannelQueueReport'][_0x24fc('0x17')](_0x23873c[_0x24fc('0x18')],{'raw':_0x23873c[_0x24fc('0x19')]?_0x23873c['options'][_0x24fc('0x1a')]===undefined?!![]:![]:!![]})[_0x24fc('0xc')](function(_0xbf1d6b){logger[_0x24fc('0xd')]('CreateOpenchannelQueueReport',_0x23873c);logger[_0x24fc('0x10')]('CreateOpenchannelQueueReport',_0x23873c,JSON[_0x24fc('0x12')](_0xbf1d6b));_0x6cfa0a(_0xbf1d6b);})['catch'](function(_0x3ed464){logger[_0x24fc('0x13')](_0x24fc('0x1b'),_0x3ed464['message'],_0x23873c);_0x8ac114(_0x1cb3d0[_0x24fc('0x13')](0x1f4,_0x3ed464['message']));});});};exports[_0x24fc('0x1c')]=function(_0x2bb93a){var _0x36a9b4=this;return new Promise(function(_0x34b5b2,_0x3296fc){return db[_0x24fc('0x1d')][_0x24fc('0x1e')](_0x2bb93a[_0x24fc('0x18')],{'raw':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x1f')]||null:null,'attributes':_0x2bb93a['options']?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x20')]||null:null,'limit':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x21')]||null:null})[_0x24fc('0xc')](function(_0x5ac1f2){logger[_0x24fc('0xd')](_0x24fc('0x1c'),_0x2bb93a);logger[_0x24fc('0x10')](_0x24fc('0x1c'),_0x2bb93a,JSON[_0x24fc('0x12')](_0x5ac1f2));_0x34b5b2(_0x5ac1f2);})['catch'](function(_0x55c27f){logger['error'](_0x24fc('0x1c'),_0x55c27f['message'],_0x2bb93a);_0x3296fc(_0x36a9b4[_0x24fc('0x13')](0x1f4,_0x55c27f[_0x24fc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index ff7eed2..bbe998f 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 _0x539f=['put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x215393,_0x4c406d){var _0x595198=function(_0x5d641f){while(--_0x5d641f){_0x215393['push'](_0x215393['shift']());}};_0x595198(++_0x4c406d);}(_0x539f,0x1e8));var _0xf539=function(_0x57cfad,_0x584dab){_0x57cfad=_0x57cfad-0x0;var _0x5ad0cf=_0x539f[_0x57cfad];return _0x5ad0cf;};'use strict';var multer=require('multer');var util=require(_0xf539('0x0'));var path=require(_0xf539('0x1'));var timeout=require(_0xf539('0x2'));var express=require('express');var router=express[_0xf539('0x3')]();var fs_extra=require(_0xf539('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf539('0x5'));var config=require(_0xf539('0x6'));var controller=require(_0xf539('0x7'));router[_0xf539('0x8')]('/',auth[_0xf539('0x9')](),controller[_0xf539('0xa')]);router[_0xf539('0x8')](_0xf539('0xb'),auth[_0xf539('0x9')](),controller[_0xf539('0xc')]);router[_0xf539('0x8')](_0xf539('0xd'),auth[_0xf539('0x9')](),controller[_0xf539('0xe')]);router['post']('/',auth[_0xf539('0x9')](),controller[_0xf539('0xf')]);router[_0xf539('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf539('0x11')]);router[_0xf539('0x12')](_0xf539('0xd'),auth[_0xf539('0x9')](),controller[_0xf539('0x13')]);module[_0xf539('0x14')]=router; \ No newline at end of file +var _0xc9d8=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','path'];(function(_0x2c07f3,_0x57d203){var _0x159db4=function(_0x9d3cff){while(--_0x9d3cff){_0x2c07f3['push'](_0x2c07f3['shift']());}};_0x159db4(++_0x57d203);}(_0xc9d8,0xda));var _0x8c9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9d8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8c9d('0x0'));var util=require('util');var path=require(_0x8c9d('0x1'));var timeout=require(_0x8c9d('0x2'));var express=require(_0x8c9d('0x3'));var router=express[_0x8c9d('0x4')]();var fs_extra=require(_0x8c9d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8c9d('0x6'));var config=require('../../config/environment');var controller=require(_0x8c9d('0x7'));router[_0x8c9d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8c9d('0x8')](_0x8c9d('0x9'),auth['isAuthenticated'](),controller[_0x8c9d('0xa')]);router[_0x8c9d('0x8')](_0x8c9d('0xb'),auth[_0x8c9d('0xc')](),controller[_0x8c9d('0xd')]);router['post']('/',auth[_0x8c9d('0xc')](),controller[_0x8c9d('0xe')]);router[_0x8c9d('0xf')](_0x8c9d('0xb'),auth['isAuthenticated'](),controller[_0x8c9d('0x10')]);router[_0x8c9d('0x11')]('/:id',auth[_0x8c9d('0xc')](),controller[_0x8c9d('0x12')]);module[_0x8c9d('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 2b05898..b33e937 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x26b20c,_0x51238c){var _0x5b3fde=function(_0x37a5df){while(--_0x37a5df){_0x26b20c['push'](_0x26b20c['shift']());}};_0x5b3fde(++_0x51238c);}(_0xedd9,0xfc));var _0x9edd=function(_0x2bda6f,_0x2ac96c){_0x2bda6f=_0x2bda6f-0x0;var _0x139a57=_0xedd9[_0x2bda6f];return _0x139a57;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x465c0b,_0x157f99){var _0x321ae9=function(_0x24d8d0){while(--_0x24d8d0){_0x465c0b['push'](_0x465c0b['shift']());}};_0x321ae9(++_0x157f99);}(_0x00bb,0x1d8));var _0xb00b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x00bb[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 9236efc..ab9ddc9 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 _0x9851=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','json','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','OpenchannelTransferReport','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x837fbc,_0x2b72a6){var _0x919229=function(_0x5155cf){while(--_0x5155cf){_0x837fbc['push'](_0x837fbc['shift']());}};_0x919229(++_0x2b72a6);}(_0x9851,0x169));var _0x1985=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9851[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1985('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1985('0x1'));var moment=require(_0x1985('0x2'));var BPromise=require(_0x1985('0x3'));var Mustache=require(_0x1985('0x4'));var util=require(_0x1985('0x5'));var path=require(_0x1985('0x6'));var sox=require(_0x1985('0x7'));var csv=require(_0x1985('0x8'));var ejs=require(_0x1985('0x9'));var fs=require('fs');var fs_extra=require(_0x1985('0xa'));var _=require('lodash');var squel=require(_0x1985('0xb'));var crypto=require(_0x1985('0xc'));var jsforce=require(_0x1985('0xd'));var deskjs=require(_0x1985('0xe'));var toCsv=require(_0x1985('0x8'));var querystring=require(_0x1985('0xf'));var Papa=require(_0x1985('0x10'));var Redis=require(_0x1985('0x11'));var authService=require(_0x1985('0x12'));var qs=require(_0x1985('0x13'));var as=require(_0x1985('0x14'));var hardwareService=require(_0x1985('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x1985('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1985('0x17'))['db'];function respondWithStatusCode(_0xa1da2a,_0x2c6b0b){_0x2c6b0b=_0x2c6b0b||0xcc;return function(_0x1acea){if(_0x1acea){return _0xa1da2a[_0x1985('0x18')](_0x2c6b0b);}return _0xa1da2a[_0x1985('0x19')](_0x2c6b0b)[_0x1985('0x1a')]();};}function respondWithResult(_0x1c7d87,_0x2d84d6){_0x2d84d6=_0x2d84d6||0xc8;return function(_0x747aa){if(_0x747aa){return _0x1c7d87[_0x1985('0x19')](_0x2d84d6)['json'](_0x747aa);}};}function respondWithFilteredResult(_0x5c38c3,_0x553625){return function(_0x4da5ac){if(_0x4da5ac){var _0xa10721=typeof _0x553625[_0x1985('0x1b')]===_0x1985('0x1c')&&typeof _0x553625[_0x1985('0x1d')]===_0x1985('0x1c');var _0x57d96e=_0x4da5ac['count'];var _0x19bbaf=_0xa10721?0x0:_0x553625['offset'];var _0x1d063b=_0xa10721?_0x4da5ac['count']:_0x553625[_0x1985('0x1b')]+_0x553625[_0x1985('0x1d')];var _0x41766e;if(_0x1d063b>=_0x57d96e){_0x1d063b=_0x57d96e;_0x41766e=0xc8;}else{_0x41766e=0xce;}_0x5c38c3[_0x1985('0x19')](_0x41766e);return _0x5c38c3[_0x1985('0x1e')]('Content-Range',_0x19bbaf+'-'+_0x1d063b+'/'+_0x57d96e)[_0x1985('0x1f')](_0x4da5ac);}return null;};}function patchUpdates(_0x5ea25b){return function(_0x387ab1){try{jsonpatch['apply'](_0x387ab1,_0x5ea25b,!![]);}catch(_0x4fce29){return BPromise['reject'](_0x4fce29);}return _0x387ab1[_0x1985('0x20')]();};}function saveUpdates(_0xfaab0b,_0xa8f092){return function(_0x5b953f){if(_0x5b953f){return _0x5b953f[_0x1985('0x21')](_0xfaab0b)[_0x1985('0x22')](function(_0x469c4b){return _0x469c4b;});}return null;};}function removeEntity(_0x531ebf,_0x4c7f50){return function(_0x3f2ac8){if(_0x3f2ac8){return _0x3f2ac8[_0x1985('0x23')]()[_0x1985('0x22')](function(){_0x531ebf[_0x1985('0x19')](0xcc)[_0x1985('0x1a')]();});}};}function handleEntityNotFound(_0x19c2a2,_0xe63c7d){return function(_0x3b6e4f){if(!_0x3b6e4f){_0x19c2a2[_0x1985('0x18')](0x194);}return _0x3b6e4f;};}function handleError(_0x28fce1,_0x47fecc){_0x47fecc=_0x47fecc||0x1f4;return function(_0x3a3e87){logger['error'](_0x3a3e87[_0x1985('0x24')]);if(_0x3a3e87[_0x1985('0x25')]){delete _0x3a3e87[_0x1985('0x25')];}_0x28fce1[_0x1985('0x19')](_0x47fecc)[_0x1985('0x26')](_0x3a3e87);};}exports[_0x1985('0x27')]=function(_0x266c6e,_0x5e99be){var _0x1a5901={},_0x5ab605={},_0x582658={'count':0x0,'rows':[]};var _0x400c07=_['map'](db['OpenchannelTransferReport'][_0x1985('0x28')],function(_0x852426){return{'name':_0x852426[_0x1985('0x29')],'type':_0x852426[_0x1985('0x2a')][_0x1985('0x2b')]};});_0x5ab605['model']=_[_0x1985('0x2c')](_0x400c07,_0x1985('0x25'));_0x5ab605[_0x1985('0x2d')]=_[_0x1985('0x2e')](_0x266c6e[_0x1985('0x2d')]);_0x5ab605[_0x1985('0x2f')]=_[_0x1985('0x30')](_0x5ab605[_0x1985('0x31')],_0x5ab605[_0x1985('0x2d')]);_0x1a5901[_0x1985('0x32')]=_[_0x1985('0x30')](_0x5ab605[_0x1985('0x31')],qs[_0x1985('0x33')](_0x266c6e['query']['fields']));_0x1a5901[_0x1985('0x32')]=_0x1a5901[_0x1985('0x32')][_0x1985('0x34')]?_0x1a5901['attributes']:_0x5ab605[_0x1985('0x31')];if(!_0x266c6e[_0x1985('0x2d')][_0x1985('0x35')](_0x1985('0x36'))){_0x1a5901[_0x1985('0x1d')]=qs[_0x1985('0x1d')](_0x266c6e[_0x1985('0x2d')][_0x1985('0x1d')]);_0x1a5901[_0x1985('0x1b')]=qs[_0x1985('0x1b')](_0x266c6e[_0x1985('0x2d')][_0x1985('0x1b')]);}_0x1a5901[_0x1985('0x37')]=qs[_0x1985('0x38')](_0x266c6e[_0x1985('0x2d')][_0x1985('0x38')]);_0x1a5901[_0x1985('0x39')]=qs['filters'](_[_0x1985('0x3a')](_0x266c6e[_0x1985('0x2d')],_0x5ab605[_0x1985('0x2f')]),_0x400c07);if(_0x266c6e['query'][_0x1985('0x3b')]){_0x1a5901[_0x1985('0x39')]=_['merge'](_0x1a5901[_0x1985('0x39')],{'$or':_[_0x1985('0x2c')](_0x400c07,function(_0x3c946c){if(_0x3c946c[_0x1985('0x2a')]!==_0x1985('0x3c')){var _0xbc5367={};_0xbc5367[_0x3c946c[_0x1985('0x25')]]={'$like':'%'+_0x266c6e[_0x1985('0x2d')][_0x1985('0x3b')]+'%'};return _0xbc5367;}})});}_0x1a5901=_[_0x1985('0x3d')]({},_0x1a5901,_0x266c6e['options']);var _0x12aa52={'where':_0x1a5901[_0x1985('0x39')]};return db[_0x1985('0x3e')][_0x1985('0x3f')](_0x12aa52)[_0x1985('0x22')](function(_0x3d6e89){_0x582658['count']=_0x3d6e89;if(_0x266c6e[_0x1985('0x2d')][_0x1985('0x40')]){_0x1a5901[_0x1985('0x41')]=[{'all':!![]}];}return db[_0x1985('0x3e')][_0x1985('0x42')](_0x1a5901);})[_0x1985('0x22')](function(_0x109575){_0x582658[_0x1985('0x43')]=_0x109575;return _0x582658;})[_0x1985('0x22')](respondWithFilteredResult(_0x5e99be,_0x1a5901))[_0x1985('0x44')](handleError(_0x5e99be,null));};exports[_0x1985('0x45')]=function(_0x508249,_0x44e121){var _0x3e5213={'raw':!![],'where':{'id':_0x508249[_0x1985('0x46')]['id']}},_0x5bea23={};_0x5bea23[_0x1985('0x31')]=_['keys'](db['OpenchannelTransferReport'][_0x1985('0x28')]);_0x5bea23[_0x1985('0x2d')]=_[_0x1985('0x2e')](_0x508249['query']);_0x5bea23[_0x1985('0x2f')]=_[_0x1985('0x30')](_0x5bea23[_0x1985('0x31')],_0x5bea23[_0x1985('0x2d')]);_0x3e5213[_0x1985('0x32')]=_['intersection'](_0x5bea23[_0x1985('0x31')],qs[_0x1985('0x33')](_0x508249[_0x1985('0x2d')][_0x1985('0x33')]));_0x3e5213[_0x1985('0x32')]=_0x3e5213[_0x1985('0x32')][_0x1985('0x34')]?_0x3e5213[_0x1985('0x32')]:_0x5bea23[_0x1985('0x31')];if(_0x508249[_0x1985('0x2d')][_0x1985('0x40')]){_0x3e5213[_0x1985('0x41')]=[{'all':!![]}];}_0x3e5213=_[_0x1985('0x3d')]({},_0x3e5213,_0x508249[_0x1985('0x47')]);return db['OpenchannelTransferReport'][_0x1985('0x48')](_0x3e5213)[_0x1985('0x22')](handleEntityNotFound(_0x44e121,null))[_0x1985('0x22')](respondWithResult(_0x44e121,null))[_0x1985('0x44')](handleError(_0x44e121,null));};exports[_0x1985('0x49')]=function(_0x5c7427,_0xcd28ae){return db[_0x1985('0x3e')][_0x1985('0x49')](_0x5c7427[_0x1985('0x4a')],{})[_0x1985('0x22')](respondWithResult(_0xcd28ae,0xc9))[_0x1985('0x44')](handleError(_0xcd28ae,null));};exports[_0x1985('0x21')]=function(_0x59af03,_0x348c8b){if(_0x59af03[_0x1985('0x4a')]['id']){delete _0x59af03['body']['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x59af03[_0x1985('0x46')]['id']}})[_0x1985('0x22')](handleEntityNotFound(_0x348c8b,null))[_0x1985('0x22')](saveUpdates(_0x59af03[_0x1985('0x4a')],null))[_0x1985('0x22')](respondWithResult(_0x348c8b,null))[_0x1985('0x44')](handleError(_0x348c8b,null));};exports[_0x1985('0x23')]=function(_0x2fb9a4,_0x10c68a){return db['OpenchannelTransferReport'][_0x1985('0x48')]({'where':{'id':_0x2fb9a4['params']['id']}})[_0x1985('0x22')](handleEntityNotFound(_0x10c68a,null))[_0x1985('0x22')](removeEntity(_0x10c68a,null))[_0x1985('0x44')](handleError(_0x10c68a,null));};exports['describe']=function(_0xfbf5b7,_0x65c7df){return db[_0x1985('0x3e')][_0x1985('0x4b')]()[_0x1985('0x22')](respondWithResult(_0x65c7df,null))[_0x1985('0x44')](handleError(_0x65c7df,null));}; \ No newline at end of file +var _0x219e=['util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xe8078,_0x4b46e8){var _0x4b0b22=function(_0x2d0d48){while(--_0x2d0d48){_0xe8078['push'](_0xe8078['shift']());}};_0x4b0b22(++_0x4b46e8);}(_0x219e,0x1ce));var _0xe219=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x219e[_0x1beef3];return _0x5af964;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe219('0x0'));var zipdir=require(_0xe219('0x1'));var jsonpatch=require(_0xe219('0x2'));var rp=require(_0xe219('0x3'));var moment=require(_0xe219('0x4'));var BPromise=require(_0xe219('0x5'));var Mustache=require('mustache');var util=require(_0xe219('0x6'));var path=require(_0xe219('0x7'));var sox=require(_0xe219('0x8'));var csv=require('to-csv');var ejs=require(_0xe219('0x9'));var fs=require('fs');var fs_extra=require(_0xe219('0xa'));var _=require('lodash');var squel=require(_0xe219('0xb'));var crypto=require(_0xe219('0xc'));var jsforce=require(_0xe219('0xd'));var deskjs=require(_0xe219('0xe'));var toCsv=require(_0xe219('0xf'));var querystring=require(_0xe219('0x10'));var Papa=require(_0xe219('0x11'));var Redis=require(_0xe219('0x12'));var authService=require(_0xe219('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe219('0x14'));var hardwareService=require(_0xe219('0x15'));var logger=require('../../config/logger')(_0xe219('0x16'));var utils=require(_0xe219('0x17'));var config=require(_0xe219('0x18'));var licenseUtil=require(_0xe219('0x19'));var db=require(_0xe219('0x1a'))['db'];function respondWithStatusCode(_0x100342,_0x5ce156){_0x5ce156=_0x5ce156||0xcc;return function(_0x2e34a5){if(_0x2e34a5){return _0x100342[_0xe219('0x1b')](_0x5ce156);}return _0x100342['status'](_0x5ce156)[_0xe219('0x1c')]();};}function respondWithResult(_0x2dcf88,_0x33616b){_0x33616b=_0x33616b||0xc8;return function(_0x2a5459){if(_0x2a5459){return _0x2dcf88['status'](_0x33616b)[_0xe219('0x1d')](_0x2a5459);}};}function respondWithFilteredResult(_0x2c80c5,_0x197c1a){return function(_0x53f562){if(_0x53f562){var _0x592ad1=typeof _0x197c1a[_0xe219('0x1e')]===_0xe219('0x1f')&&typeof _0x197c1a['limit']===_0xe219('0x1f');var _0x542dd7=_0x53f562['count'];var _0x8ecd76=_0x592ad1?0x0:_0x197c1a[_0xe219('0x1e')];var _0x2db963=_0x592ad1?_0x53f562['count']:_0x197c1a['offset']+_0x197c1a[_0xe219('0x20')];var _0x43e99b;if(_0x2db963>=_0x542dd7){_0x2db963=_0x542dd7;_0x43e99b=0xc8;}else{_0x43e99b=0xce;}_0x2c80c5[_0xe219('0x21')](_0x43e99b);return _0x2c80c5[_0xe219('0x22')](_0xe219('0x23'),_0x8ecd76+'-'+_0x2db963+'/'+_0x542dd7)[_0xe219('0x1d')](_0x53f562);}return null;};}function patchUpdates(_0x699865){return function(_0x29a13b){try{jsonpatch[_0xe219('0x24')](_0x29a13b,_0x699865,!![]);}catch(_0x2129b5){return BPromise[_0xe219('0x25')](_0x2129b5);}return _0x29a13b[_0xe219('0x26')]();};}function saveUpdates(_0xa7bb1f,_0x1defe2){return function(_0xcae062){if(_0xcae062){return _0xcae062[_0xe219('0x27')](_0xa7bb1f)[_0xe219('0x28')](function(_0x5661c8){return _0x5661c8;});}return null;};}function removeEntity(_0x358733,_0x413927){return function(_0x33ee9a){if(_0x33ee9a){return _0x33ee9a[_0xe219('0x29')]()[_0xe219('0x28')](function(){_0x358733['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39821c,_0x4ef26d){return function(_0x7581dc){if(!_0x7581dc){_0x39821c['sendStatus'](0x194);}return _0x7581dc;};}function handleError(_0x1b8a00,_0x526620){_0x526620=_0x526620||0x1f4;return function(_0x9937d){logger[_0xe219('0x2a')](_0x9937d[_0xe219('0x2b')]);if(_0x9937d[_0xe219('0x2c')]){delete _0x9937d[_0xe219('0x2c')];}_0x1b8a00[_0xe219('0x21')](_0x526620)['send'](_0x9937d);};}exports['index']=function(_0x1aeb01,_0x33d063){var _0x44dfd5={},_0x4d10f6={},_0x5ea76b={'count':0x0,'rows':[]};var _0x4f99bc=_[_0xe219('0x2d')](db[_0xe219('0x2e')][_0xe219('0x2f')],function(_0x187c74){return{'name':_0x187c74[_0xe219('0x30')],'type':_0x187c74[_0xe219('0x31')][_0xe219('0x32')]};});_0x4d10f6[_0xe219('0x33')]=_[_0xe219('0x2d')](_0x4f99bc,_0xe219('0x2c'));_0x4d10f6[_0xe219('0x34')]=_[_0xe219('0x35')](_0x1aeb01[_0xe219('0x34')]);_0x4d10f6['filters']=_[_0xe219('0x36')](_0x4d10f6[_0xe219('0x33')],_0x4d10f6[_0xe219('0x34')]);_0x44dfd5[_0xe219('0x37')]=_['intersection'](_0x4d10f6[_0xe219('0x33')],qs[_0xe219('0x38')](_0x1aeb01['query'][_0xe219('0x38')]));_0x44dfd5[_0xe219('0x37')]=_0x44dfd5['attributes'][_0xe219('0x39')]?_0x44dfd5[_0xe219('0x37')]:_0x4d10f6['model'];if(!_0x1aeb01[_0xe219('0x34')][_0xe219('0x3a')]('nolimit')){_0x44dfd5[_0xe219('0x20')]=qs[_0xe219('0x20')](_0x1aeb01[_0xe219('0x34')][_0xe219('0x20')]);_0x44dfd5[_0xe219('0x1e')]=qs[_0xe219('0x1e')](_0x1aeb01['query'][_0xe219('0x1e')]);}_0x44dfd5[_0xe219('0x3b')]=qs[_0xe219('0x3c')](_0x1aeb01[_0xe219('0x34')]['sort']);_0x44dfd5[_0xe219('0x3d')]=qs[_0xe219('0x3e')](_['pick'](_0x1aeb01[_0xe219('0x34')],_0x4d10f6['filters']),_0x4f99bc);if(_0x1aeb01[_0xe219('0x34')][_0xe219('0x3f')]){_0x44dfd5['where']=_[_0xe219('0x40')](_0x44dfd5[_0xe219('0x3d')],{'$or':_[_0xe219('0x2d')](_0x4f99bc,function(_0x421dfe){if(_0x421dfe[_0xe219('0x31')]!=='VIRTUAL'){var _0x44c410={};_0x44c410[_0x421dfe[_0xe219('0x2c')]]={'$like':'%'+_0x1aeb01[_0xe219('0x34')][_0xe219('0x3f')]+'%'};return _0x44c410;}})});}_0x44dfd5=_['merge']({},_0x44dfd5,_0x1aeb01[_0xe219('0x41')]);var _0x2d8984={'where':_0x44dfd5[_0xe219('0x3d')]};return db[_0xe219('0x2e')][_0xe219('0x42')](_0x2d8984)[_0xe219('0x28')](function(_0x1072a6){_0x5ea76b[_0xe219('0x42')]=_0x1072a6;if(_0x1aeb01[_0xe219('0x34')][_0xe219('0x43')]){_0x44dfd5['include']=[{'all':!![]}];}return db[_0xe219('0x2e')][_0xe219('0x44')](_0x44dfd5);})[_0xe219('0x28')](function(_0x4fd72f){_0x5ea76b[_0xe219('0x45')]=_0x4fd72f;return _0x5ea76b;})['then'](respondWithFilteredResult(_0x33d063,_0x44dfd5))[_0xe219('0x46')](handleError(_0x33d063,null));};exports[_0xe219('0x47')]=function(_0x2c1297,_0x4ce55e){var _0x2af4be={'raw':!![],'where':{'id':_0x2c1297['params']['id']}},_0x1bb70c={};_0x1bb70c['model']=_[_0xe219('0x35')](db['OpenchannelTransferReport']['rawAttributes']);_0x1bb70c[_0xe219('0x34')]=_[_0xe219('0x35')](_0x2c1297[_0xe219('0x34')]);_0x1bb70c[_0xe219('0x3e')]=_[_0xe219('0x36')](_0x1bb70c[_0xe219('0x33')],_0x1bb70c[_0xe219('0x34')]);_0x2af4be[_0xe219('0x37')]=_['intersection'](_0x1bb70c[_0xe219('0x33')],qs[_0xe219('0x38')](_0x2c1297[_0xe219('0x34')][_0xe219('0x38')]));_0x2af4be[_0xe219('0x37')]=_0x2af4be[_0xe219('0x37')][_0xe219('0x39')]?_0x2af4be[_0xe219('0x37')]:_0x1bb70c['model'];if(_0x2c1297[_0xe219('0x34')]['includeAll']){_0x2af4be[_0xe219('0x48')]=[{'all':!![]}];}_0x2af4be=_['merge']({},_0x2af4be,_0x2c1297['options']);return db['OpenchannelTransferReport'][_0xe219('0x49')](_0x2af4be)['then'](handleEntityNotFound(_0x4ce55e,null))['then'](respondWithResult(_0x4ce55e,null))[_0xe219('0x46')](handleError(_0x4ce55e,null));};exports['create']=function(_0x4facba,_0x775e6a){return db[_0xe219('0x2e')][_0xe219('0x4a')](_0x4facba[_0xe219('0x4b')],{})[_0xe219('0x28')](respondWithResult(_0x775e6a,0xc9))[_0xe219('0x46')](handleError(_0x775e6a,null));};exports[_0xe219('0x27')]=function(_0x27fef8,_0x14ed83){if(_0x27fef8[_0xe219('0x4b')]['id']){delete _0x27fef8['body']['id'];}return db[_0xe219('0x2e')]['find']({'where':{'id':_0x27fef8[_0xe219('0x4c')]['id']}})[_0xe219('0x28')](handleEntityNotFound(_0x14ed83,null))[_0xe219('0x28')](saveUpdates(_0x27fef8[_0xe219('0x4b')],null))[_0xe219('0x28')](respondWithResult(_0x14ed83,null))[_0xe219('0x46')](handleError(_0x14ed83,null));};exports[_0xe219('0x29')]=function(_0x5b49fe,_0x43476e){return db[_0xe219('0x2e')][_0xe219('0x49')]({'where':{'id':_0x5b49fe[_0xe219('0x4c')]['id']}})[_0xe219('0x28')](handleEntityNotFound(_0x43476e,null))[_0xe219('0x28')](removeEntity(_0x43476e,null))[_0xe219('0x46')](handleError(_0x43476e,null));};exports[_0xe219('0x4d')]=function(_0x547bab,_0xfd0393){return db['OpenchannelTransferReport']['describe']()[_0xe219('0x28')](respondWithResult(_0xfd0393,null))[_0xe219('0x46')](handleError(_0xfd0393,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 6f489e1..836a396 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 _0x4db7=['util','../../config/logger','api','moment','path','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','lodash'];(function(_0x4ba86d,_0x28c896){var _0x52d473=function(_0x4c715a){while(--_0x4c715a){_0x4ba86d['push'](_0x4ba86d['shift']());}};_0x52d473(++_0x28c896);}(_0x4db7,0x1ee));var _0x74db=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x4db7[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x74db('0x0'));var util=require(_0x74db('0x1'));var logger=require(_0x74db('0x2'))(_0x74db('0x3'));var moment=require(_0x74db('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x74db('0x5'));var rimraf=require('rimraf');var config=require(_0x74db('0x6'));var attributes=require(_0x74db('0x7'));module[_0x74db('0x8')]=function(_0x23e803,_0x4214e5){return _0x23e803[_0x74db('0x9')](_0x74db('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xac26=['moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0xaf52f9,_0x3608bc){var _0xd9e03e=function(_0xaf82d3){while(--_0xaf82d3){_0xaf52f9['push'](_0xaf52f9['shift']());}};_0xd9e03e(++_0x3608bc);}(_0xac26,0x100));var _0x6ac2=function(_0x2c8546,_0xe13fa2){_0x2c8546=_0x2c8546-0x0;var _0x2a4016=_0xac26[_0x2c8546];return _0x2a4016;};'use strict';var _=require(_0x6ac2('0x0'));var util=require(_0x6ac2('0x1'));var logger=require(_0x6ac2('0x2'))(_0x6ac2('0x3'));var moment=require(_0x6ac2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ac2('0x5'));var rimraf=require(_0x6ac2('0x6'));var config=require(_0x6ac2('0x7'));var attributes=require(_0x6ac2('0x8'));module[_0x6ac2('0x9')]=function(_0x5dffa1,_0x5d4e82){return _0x5dffa1[_0x6ac2('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x6ac2('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6ac2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 96b4dcd..0da3013 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 _0x55d2=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelTransferReport,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','request\x20sent'];(function(_0x18fd21,_0x4af3d1){var _0x113f67=function(_0x45b480){while(--_0x45b480){_0x18fd21['push'](_0x18fd21['shift']());}};_0x113f67(++_0x4af3d1);}(_0x55d2,0x9f));var _0x255d=function(_0x8a7bcb,_0x2cf7d1){_0x8a7bcb=_0x8a7bcb-0x0;var _0x23ccc0=_0x55d2[_0x8a7bcb];return _0x23ccc0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x255d('0x0'));var BPromise=require(_0x255d('0x1'));var rs=require(_0x255d('0x2'));var fs=require('fs');var Redis=require(_0x255d('0x3'));var db=require(_0x255d('0x4'))['db'];var utils=require(_0x255d('0x5'));var logger=require('../../config/logger')(_0x255d('0x6'));var config=require(_0x255d('0x7'));var jayson=require(_0x255d('0x8'));var client=jayson[_0x255d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f93b4,_0x15469e,_0xcf66a2){return new BPromise(function(_0x253ac9,_0xdb6ea7){return client[_0x255d('0xa')](_0x4f93b4,_0xcf66a2)['then'](function(_0x5198d7){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x15469e,_0x255d('0xb'));logger['debug'](_0x255d('0xc'),_0x15469e,_0x255d('0xb'),JSON[_0x255d('0xd')](_0x5198d7));if(_0x5198d7['error']){if(_0x5198d7['error'][_0x255d('0xe')]===0x1f4){logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);return _0xdb6ea7(_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);}logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);return _0x253ac9(_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);}else{logger['info'](_0x255d('0x10'),_0x15469e,_0x255d('0xb'));_0x253ac9(_0x5198d7['result'][_0x255d('0x11')]);}})[_0x255d('0x12')](function(_0x37c217){logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x37c217);_0xdb6ea7(_0x37c217);});});} \ No newline at end of file +var _0x8c32=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird'];(function(_0xcaafa8,_0x14297c){var _0xd65de0=function(_0x4dc550){while(--_0x4dc550){_0xcaafa8['push'](_0xcaafa8['shift']());}};_0xd65de0(++_0x14297c);}(_0x8c32,0x130));var _0x28c3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8c32[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var moment=require(_0x28c3('0x2'));var BPromise=require(_0x28c3('0x3'));var rs=require(_0x28c3('0x4'));var fs=require('fs');var Redis=require(_0x28c3('0x5'));var db=require(_0x28c3('0x6'))['db'];var utils=require(_0x28c3('0x7'));var logger=require(_0x28c3('0x8'))(_0x28c3('0x9'));var config=require(_0x28c3('0xa'));var jayson=require(_0x28c3('0xb'));var client=jayson['client'][_0x28c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ed515,_0x2ce6c1,_0x482952){return new BPromise(function(_0xbaee6f,_0x2fb4cb){return client['request'](_0x4ed515,_0x482952)[_0x28c3('0xd')](function(_0x37bda3){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2ce6c1,'request\x20sent');logger[_0x28c3('0xe')](_0x28c3('0xf'),_0x2ce6c1,'request\x20sent',JSON[_0x28c3('0x10')](_0x37bda3));if(_0x37bda3[_0x28c3('0x11')]){if(_0x37bda3[_0x28c3('0x11')]['code']===0x1f4){logger[_0x28c3('0x11')](_0x28c3('0x12'),_0x2ce6c1,_0x37bda3[_0x28c3('0x11')][_0x28c3('0x13')]);return _0x2fb4cb(_0x37bda3[_0x28c3('0x11')]['message']);}logger[_0x28c3('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2ce6c1,_0x37bda3[_0x28c3('0x11')]['message']);return _0xbaee6f(_0x37bda3[_0x28c3('0x11')]['message']);}else{logger[_0x28c3('0x14')](_0x28c3('0x12'),_0x2ce6c1,'request\x20sent');_0xbaee6f(_0x37bda3[_0x28c3('0x15')]['message']);}})['catch'](function(_0x58e2b9){logger[_0x28c3('0x11')](_0x28c3('0x12'),_0x2ce6c1,_0x58e2b9);_0x2fb4cb(_0x58e2b9);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 434b132..cc09643 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 _0x276e=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','index','get','/:id','isAuthenticated','post','create','put','update'];(function(_0x3c28c6,_0x2afbc3){var _0x586708=function(_0x18d4e9){while(--_0x18d4e9){_0x3c28c6['push'](_0x3c28c6['shift']());}};_0x586708(++_0x2afbc3);}(_0x276e,0xec));var _0xe276=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0x276e[_0x4ffa64];return _0x5da001;};'use strict';var multer=require(_0xe276('0x0'));var util=require(_0xe276('0x1'));var path=require(_0xe276('0x2'));var timeout=require('connect-timeout');var express=require(_0xe276('0x3'));var router=express[_0xe276('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe276('0x5'));var interaction=require(_0xe276('0x6'));var config=require('../../config/environment');var controller=require(_0xe276('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe276('0x8')]);router[_0xe276('0x9')](_0xe276('0xa'),auth[_0xe276('0xb')](),controller['show']);router[_0xe276('0xc')]('/',auth[_0xe276('0xb')](),controller[_0xe276('0xd')]);router[_0xe276('0xe')](_0xe276('0xa'),auth['isAuthenticated'](),controller[_0xe276('0xf')]);router['delete'](_0xe276('0xa'),auth['isAuthenticated'](),controller[_0xe276('0x10')]);module[_0xe276('0x11')]=router; \ No newline at end of file +var _0x686d=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x686d,0x115));var _0xd686=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x686d[_0xcd0918];return _0x250704;};'use strict';var multer=require(_0xd686('0x0'));var util=require(_0xd686('0x1'));var path=require(_0xd686('0x2'));var timeout=require(_0xd686('0x3'));var express=require('express');var router=express[_0xd686('0x4')]();var fs_extra=require(_0xd686('0x5'));var auth=require(_0xd686('0x6'));var interaction=require(_0xd686('0x7'));var config=require(_0xd686('0x8'));var controller=require(_0xd686('0x9'));router[_0xd686('0xa')]('/',auth[_0xd686('0xb')](),controller[_0xd686('0xc')]);router['get'](_0xd686('0xd'),auth[_0xd686('0xb')](),controller[_0xd686('0xe')]);router[_0xd686('0xf')]('/',auth[_0xd686('0xb')](),controller[_0xd686('0x10')]);router[_0xd686('0x11')](_0xd686('0xd'),auth[_0xd686('0xb')](),controller[_0xd686('0x12')]);router['delete']('/:id',auth[_0xd686('0xb')](),controller['destroy']);module[_0xd686('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 402ab12..c4a5356 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 _0x0cc0=['STRING','sequelize','exports'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x0cc0,0x15a));var _0x00cc=function(_0x487e8e,_0x452414){_0x487e8e=_0x487e8e-0x0;var _0x4678db=_0x0cc0[_0x487e8e];return _0x4678db;};'use strict';var Sequelize=require(_0x00cc('0x0'));module[_0x00cc('0x1')]={'name':{'type':Sequelize[_0x00cc('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1d46=['sequelize','exports','STRING'];(function(_0x3212c7,_0x3eb2b5){var _0x125f7=function(_0x27675a){while(--_0x27675a){_0x3212c7['push'](_0x3212c7['shift']());}};_0x125f7(++_0x3eb2b5);}(_0x1d46,0xa8));var _0x61d4=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0x1d46[_0x3a07c1];return _0x2bbe15;};'use strict';var Sequelize=require(_0x61d4('0x0'));module[_0x61d4('0x1')]={'name':{'type':Sequelize[_0x61d4('0x2')],'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 08540c3..4cbbfeb 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 _0x6617=['model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Pauses','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','sendStatus','stack','name','send','index','map','Pause','rawAttributes','fieldName','type'];(function(_0x48a458,_0x2c08c2){var _0x4c5f26=function(_0x67fcdf){while(--_0x67fcdf){_0x48a458['push'](_0x48a458['shift']());}};_0x4c5f26(++_0x2c08c2);}(_0x6617,0x129));var _0x7661=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x6617[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x7661('0x0'));var rimraf=require(_0x7661('0x1'));var zipdir=require(_0x7661('0x2'));var jsonpatch=require(_0x7661('0x3'));var rp=require(_0x7661('0x4'));var moment=require(_0x7661('0x5'));var BPromise=require(_0x7661('0x6'));var Mustache=require(_0x7661('0x7'));var util=require(_0x7661('0x8'));var path=require(_0x7661('0x9'));var sox=require(_0x7661('0xa'));var csv=require('to-csv');var ejs=require(_0x7661('0xb'));var fs=require('fs');var fs_extra=require(_0x7661('0xc'));var _=require(_0x7661('0xd'));var squel=require(_0x7661('0xe'));var crypto=require(_0x7661('0xf'));var jsforce=require(_0x7661('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x7661('0x11'));var querystring=require('querystring');var Papa=require(_0x7661('0x12'));var Redis=require('ioredis');var authService=require(_0x7661('0x13'));var qs=require(_0x7661('0x14'));var as=require(_0x7661('0x15'));var hardwareService=require(_0x7661('0x16'));var logger=require(_0x7661('0x17'))(_0x7661('0x18'));var utils=require(_0x7661('0x19'));var config=require(_0x7661('0x1a'));var licenseUtil=require(_0x7661('0x1b'));var db=require(_0x7661('0x1c'))['db'];function respondWithStatusCode(_0x2d766d,_0x5cb403){_0x5cb403=_0x5cb403||0xcc;return function(_0x4f2ad9){if(_0x4f2ad9){return _0x2d766d['sendStatus'](_0x5cb403);}return _0x2d766d[_0x7661('0x1d')](_0x5cb403)[_0x7661('0x1e')]();};}function respondWithResult(_0x5dfec8,_0x2e134d){_0x2e134d=_0x2e134d||0xc8;return function(_0x16cd3c){if(_0x16cd3c){return _0x5dfec8[_0x7661('0x1d')](_0x2e134d)['json'](_0x16cd3c);}};}function respondWithFilteredResult(_0x264de4,_0x37170a){return function(_0x112bb6){if(_0x112bb6){var _0xf3dbe9=typeof _0x37170a[_0x7661('0x1f')]==='undefined'&&typeof _0x37170a[_0x7661('0x20')]===_0x7661('0x21');var _0x34fb0c=_0x112bb6[_0x7661('0x22')];var _0x5a4dbb=_0xf3dbe9?0x0:_0x37170a[_0x7661('0x1f')];var _0x5afe43=_0xf3dbe9?_0x112bb6[_0x7661('0x22')]:_0x37170a[_0x7661('0x1f')]+_0x37170a['limit'];var _0x464b23;if(_0x5afe43>=_0x34fb0c){_0x5afe43=_0x34fb0c;_0x464b23=0xc8;}else{_0x464b23=0xce;}_0x264de4[_0x7661('0x1d')](_0x464b23);return _0x264de4[_0x7661('0x23')](_0x7661('0x24'),_0x5a4dbb+'-'+_0x5afe43+'/'+_0x34fb0c)[_0x7661('0x25')](_0x112bb6);}return null;};}function patchUpdates(_0x44df91){return function(_0x507be5){try{jsonpatch[_0x7661('0x26')](_0x507be5,_0x44df91,!![]);}catch(_0x4e49c6){return BPromise[_0x7661('0x27')](_0x4e49c6);}return _0x507be5[_0x7661('0x28')]();};}function saveUpdates(_0x1abe72,_0x5e79fc){return function(_0x5b15eb){if(_0x5b15eb){return _0x5b15eb[_0x7661('0x29')](_0x1abe72)[_0x7661('0x2a')](function(_0x57bbe0){return _0x57bbe0;});}return null;};}function removeEntity(_0x3331f3,_0x22de48){return function(_0x255f7b){if(_0x255f7b){return _0x255f7b[_0x7661('0x2b')]()[_0x7661('0x2a')](function(){var _0x2c40db=_0x255f7b[_0x7661('0x2c')]({'plain':!![]});var _0x2b5679='Pauses';return db['UserProfileResource']['destroy']({'where':{'type':_0x2b5679,'resourceId':_0x2c40db['id']}})[_0x7661('0x2a')](function(){return _0x255f7b;});})['then'](function(){_0x3331f3[_0x7661('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e8fda,_0x47933e){return function(_0x933349){if(!_0x933349){_0x1e8fda[_0x7661('0x2d')](0x194);}return _0x933349;};}function handleError(_0x8a500,_0x4f0560){_0x4f0560=_0x4f0560||0x1f4;return function(_0x2a35e0){logger['error'](_0x2a35e0[_0x7661('0x2e')]);if(_0x2a35e0[_0x7661('0x2f')]){delete _0x2a35e0[_0x7661('0x2f')];}_0x8a500[_0x7661('0x1d')](_0x4f0560)[_0x7661('0x30')](_0x2a35e0);};}exports[_0x7661('0x31')]=function(_0x130ed9,_0x1a4aac){var _0x482098={},_0x51cf09={},_0x381631={'count':0x0,'rows':[]};var _0x401306=_[_0x7661('0x32')](db[_0x7661('0x33')][_0x7661('0x34')],function(_0x1b1225){return{'name':_0x1b1225[_0x7661('0x35')],'type':_0x1b1225[_0x7661('0x36')]['key']};});_0x51cf09[_0x7661('0x37')]=_[_0x7661('0x32')](_0x401306,'name');_0x51cf09[_0x7661('0x38')]=_[_0x7661('0x39')](_0x130ed9['query']);_0x51cf09['filters']=_['intersection'](_0x51cf09[_0x7661('0x37')],_0x51cf09[_0x7661('0x38')]);_0x482098[_0x7661('0x3a')]=_[_0x7661('0x3b')](_0x51cf09['model'],qs[_0x7661('0x3c')](_0x130ed9[_0x7661('0x38')][_0x7661('0x3c')]));_0x482098['attributes']=_0x482098['attributes'][_0x7661('0x3d')]?_0x482098[_0x7661('0x3a')]:_0x51cf09['model'];if(!_0x130ed9[_0x7661('0x38')][_0x7661('0x3e')]('nolimit')){_0x482098[_0x7661('0x20')]=qs[_0x7661('0x20')](_0x130ed9[_0x7661('0x38')]['limit']);_0x482098[_0x7661('0x1f')]=qs[_0x7661('0x1f')](_0x130ed9['query']['offset']);}_0x482098[_0x7661('0x3f')]=qs[_0x7661('0x40')](_0x130ed9['query'][_0x7661('0x40')]);_0x482098[_0x7661('0x41')]=qs[_0x7661('0x42')](_[_0x7661('0x43')](_0x130ed9['query'],_0x51cf09['filters']),_0x401306);if(_0x130ed9[_0x7661('0x38')][_0x7661('0x44')]){_0x482098['where']=_[_0x7661('0x45')](_0x482098['where'],{'$or':_[_0x7661('0x32')](_0x401306,function(_0x8f62d3){if(_0x8f62d3['type']!=='VIRTUAL'){var _0x435a43={};_0x435a43[_0x8f62d3[_0x7661('0x2f')]]={'$like':'%'+_0x130ed9[_0x7661('0x38')][_0x7661('0x44')]+'%'};return _0x435a43;}})});}_0x482098=_[_0x7661('0x45')]({},_0x482098,_0x130ed9['options']);var _0x1d1fd1={'where':_0x482098[_0x7661('0x41')]};return db['Pause'][_0x7661('0x22')](_0x1d1fd1)['then'](function(_0x7617c3){_0x381631['count']=_0x7617c3;if(_0x130ed9['query'][_0x7661('0x46')]){_0x482098[_0x7661('0x47')]=[{'all':!![]}];}return db[_0x7661('0x33')][_0x7661('0x48')](_0x482098);})[_0x7661('0x2a')](function(_0x351807){_0x381631[_0x7661('0x49')]=_0x351807;return _0x381631;})['then'](respondWithFilteredResult(_0x1a4aac,_0x482098))[_0x7661('0x4a')](handleError(_0x1a4aac,null));};exports[_0x7661('0x4b')]=function(_0x3bdc02,_0x3d0809){var _0xca6522={'raw':!![],'where':{'id':_0x3bdc02[_0x7661('0x4c')]['id']}},_0x49e47b={};_0x49e47b[_0x7661('0x37')]=_[_0x7661('0x39')](db['Pause']['rawAttributes']);_0x49e47b[_0x7661('0x38')]=_[_0x7661('0x39')](_0x3bdc02[_0x7661('0x38')]);_0x49e47b[_0x7661('0x42')]=_[_0x7661('0x3b')](_0x49e47b[_0x7661('0x37')],_0x49e47b[_0x7661('0x38')]);_0xca6522['attributes']=_['intersection'](_0x49e47b['model'],qs['fields'](_0x3bdc02['query'][_0x7661('0x3c')]));_0xca6522[_0x7661('0x3a')]=_0xca6522[_0x7661('0x3a')][_0x7661('0x3d')]?_0xca6522[_0x7661('0x3a')]:_0x49e47b['model'];if(_0x3bdc02['query'][_0x7661('0x46')]){_0xca6522['include']=[{'all':!![]}];}_0xca6522=_[_0x7661('0x45')]({},_0xca6522,_0x3bdc02[_0x7661('0x4d')]);return db[_0x7661('0x33')][_0x7661('0x4e')](_0xca6522)[_0x7661('0x2a')](handleEntityNotFound(_0x3d0809,null))[_0x7661('0x2a')](respondWithResult(_0x3d0809,null))[_0x7661('0x4a')](handleError(_0x3d0809,null));};exports[_0x7661('0x4f')]=function(_0x2e3462,_0x3223eb){return db['Pause']['create'](_0x2e3462['body'],{})[_0x7661('0x2a')](function(_0x2c6d41){var _0x88f627=_0x2e3462['user']['get']({'plain':!![]});if(!_0x88f627)throw new Error(_0x7661('0x50'));if(_0x88f627['role']===_0x7661('0x51')){var _0x29e864=_0x2c6d41[_0x7661('0x2c')]({'plain':!![]});var _0x45bf3e=_0x7661('0x52');return db[_0x7661('0x53')]['find']({'where':{'name':_0x45bf3e,'userProfileId':_0x88f627['userProfileId']},'raw':!![]})[_0x7661('0x2a')](function(_0x5eeffc){if(_0x5eeffc&&_0x5eeffc[_0x7661('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x29e864[_0x7661('0x2f')],'resourceId':_0x29e864['id'],'type':_0x5eeffc['name'],'sectionId':_0x5eeffc['id']},{})[_0x7661('0x2a')](function(){return _0x2c6d41;});}else{return _0x2c6d41;}})[_0x7661('0x4a')](function(_0x1aad84){logger[_0x7661('0x55')](_0x7661('0x56'),_0x1aad84);throw _0x1aad84;});}return _0x2c6d41;})[_0x7661('0x2a')](respondWithResult(_0x3223eb,0xc9))[_0x7661('0x4a')](handleError(_0x3223eb,null));};exports[_0x7661('0x29')]=function(_0xe03a67,_0x88eb88){if(_0xe03a67[_0x7661('0x57')]['id']){delete _0xe03a67['body']['id'];}return db['Pause'][_0x7661('0x4e')]({'where':{'id':_0xe03a67[_0x7661('0x4c')]['id']}})[_0x7661('0x2a')](handleEntityNotFound(_0x88eb88,null))['then'](saveUpdates(_0xe03a67['body'],null))[_0x7661('0x2a')](respondWithResult(_0x88eb88,null))[_0x7661('0x4a')](handleError(_0x88eb88,null));};exports[_0x7661('0x2b')]=function(_0x2a6f99,_0x504c01){return db[_0x7661('0x33')]['find']({'where':{'id':_0x2a6f99[_0x7661('0x4c')]['id']}})[_0x7661('0x2a')](handleEntityNotFound(_0x504c01,null))[_0x7661('0x2a')](removeEntity(_0x504c01,null))[_0x7661('0x4a')](handleError(_0x504c01,null));}; \ No newline at end of file +var _0x98a5=['VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','role','user','UserProfileSection','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','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','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','index','Pause','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','map'];(function(_0x3d30e3,_0x3f2c79){var _0x3b209a=function(_0x495aa5){while(--_0x495aa5){_0x3d30e3['push'](_0x3d30e3['shift']());}};_0x3b209a(++_0x3f2c79);}(_0x98a5,0x1d1));var _0x598a=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x98a5[_0x545bed];return _0x16c79c;};'use strict';var emlformat=require(_0x598a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x598a('0x1'));var jsonpatch=require(_0x598a('0x2'));var rp=require(_0x598a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x598a('0x4'));var path=require(_0x598a('0x5'));var sox=require(_0x598a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x598a('0x7'));var _=require(_0x598a('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x598a('0x9'));var deskjs=require(_0x598a('0xa'));var toCsv=require(_0x598a('0xb'));var querystring=require(_0x598a('0xc'));var Papa=require('papaparse');var Redis=require(_0x598a('0xd'));var authService=require(_0x598a('0xe'));var qs=require(_0x598a('0xf'));var as=require(_0x598a('0x10'));var hardwareService=require(_0x598a('0x11'));var logger=require(_0x598a('0x12'))(_0x598a('0x13'));var utils=require('../../config/utils');var config=require(_0x598a('0x14'));var licenseUtil=require(_0x598a('0x15'));var db=require(_0x598a('0x16'))['db'];function respondWithStatusCode(_0x4425c1,_0x5b63f1){_0x5b63f1=_0x5b63f1||0xcc;return function(_0x2eaa42){if(_0x2eaa42){return _0x4425c1['sendStatus'](_0x5b63f1);}return _0x4425c1[_0x598a('0x17')](_0x5b63f1)[_0x598a('0x18')]();};}function respondWithResult(_0xbd5765,_0x282fbf){_0x282fbf=_0x282fbf||0xc8;return function(_0xedcebf){if(_0xedcebf){return _0xbd5765['status'](_0x282fbf)[_0x598a('0x19')](_0xedcebf);}};}function respondWithFilteredResult(_0x2f2c8c,_0x339626){return function(_0x5edee4){if(_0x5edee4){var _0x1ac5db=typeof _0x339626['offset']==='undefined'&&typeof _0x339626[_0x598a('0x1a')]==='undefined';var _0x5aacd8=_0x5edee4[_0x598a('0x1b')];var _0x4e3918=_0x1ac5db?0x0:_0x339626[_0x598a('0x1c')];var _0x30c420=_0x1ac5db?_0x5edee4[_0x598a('0x1b')]:_0x339626[_0x598a('0x1c')]+_0x339626[_0x598a('0x1a')];var _0x527e3c;if(_0x30c420>=_0x5aacd8){_0x30c420=_0x5aacd8;_0x527e3c=0xc8;}else{_0x527e3c=0xce;}_0x2f2c8c[_0x598a('0x17')](_0x527e3c);return _0x2f2c8c[_0x598a('0x1d')](_0x598a('0x1e'),_0x4e3918+'-'+_0x30c420+'/'+_0x5aacd8)[_0x598a('0x19')](_0x5edee4);}return null;};}function patchUpdates(_0x38c6d6){return function(_0x1408d8){try{jsonpatch[_0x598a('0x1f')](_0x1408d8,_0x38c6d6,!![]);}catch(_0x55132b){return BPromise['reject'](_0x55132b);}return _0x1408d8['save']();};}function saveUpdates(_0x4dccaf,_0x2308ee){return function(_0xf07a0f){if(_0xf07a0f){return _0xf07a0f[_0x598a('0x20')](_0x4dccaf)[_0x598a('0x21')](function(_0x334c4e){return _0x334c4e;});}return null;};}function removeEntity(_0x20b7e0,_0x2d49e6){return function(_0x1a6a8c){if(_0x1a6a8c){return _0x1a6a8c[_0x598a('0x22')]()[_0x598a('0x21')](function(){var _0x2e1021=_0x1a6a8c[_0x598a('0x23')]({'plain':!![]});var _0x1a21cd=_0x598a('0x24');return db[_0x598a('0x25')][_0x598a('0x22')]({'where':{'type':_0x1a21cd,'resourceId':_0x2e1021['id']}})[_0x598a('0x21')](function(){return _0x1a6a8c;});})[_0x598a('0x21')](function(){_0x20b7e0[_0x598a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12ab9c,_0x5c2a4e){return function(_0x33b37f){if(!_0x33b37f){_0x12ab9c['sendStatus'](0x194);}return _0x33b37f;};}function handleError(_0x2bfb17,_0x48480b){_0x48480b=_0x48480b||0x1f4;return function(_0x4483c8){logger[_0x598a('0x26')](_0x4483c8[_0x598a('0x27')]);if(_0x4483c8['name']){delete _0x4483c8[_0x598a('0x28')];}_0x2bfb17[_0x598a('0x17')](_0x48480b)['send'](_0x4483c8);};}exports[_0x598a('0x29')]=function(_0x4e6cb1,_0x4733cd){var _0x14d79b={},_0x4d3b3a={},_0x57329a={'count':0x0,'rows':[]};var _0x227040=_['map'](db[_0x598a('0x2a')][_0x598a('0x2b')],function(_0x54dd22){return{'name':_0x54dd22['fieldName'],'type':_0x54dd22['type'][_0x598a('0x2c')]};});_0x4d3b3a['model']=_['map'](_0x227040,_0x598a('0x28'));_0x4d3b3a[_0x598a('0x2d')]=_[_0x598a('0x2e')](_0x4e6cb1[_0x598a('0x2d')]);_0x4d3b3a[_0x598a('0x2f')]=_[_0x598a('0x30')](_0x4d3b3a[_0x598a('0x31')],_0x4d3b3a[_0x598a('0x2d')]);_0x14d79b['attributes']=_['intersection'](_0x4d3b3a[_0x598a('0x31')],qs[_0x598a('0x32')](_0x4e6cb1[_0x598a('0x2d')]['fields']));_0x14d79b[_0x598a('0x33')]=_0x14d79b[_0x598a('0x33')][_0x598a('0x34')]?_0x14d79b[_0x598a('0x33')]:_0x4d3b3a[_0x598a('0x31')];if(!_0x4e6cb1[_0x598a('0x2d')][_0x598a('0x35')]('nolimit')){_0x14d79b['limit']=qs[_0x598a('0x1a')](_0x4e6cb1['query']['limit']);_0x14d79b[_0x598a('0x1c')]=qs[_0x598a('0x1c')](_0x4e6cb1[_0x598a('0x2d')][_0x598a('0x1c')]);}_0x14d79b[_0x598a('0x36')]=qs['sort'](_0x4e6cb1['query'][_0x598a('0x37')]);_0x14d79b[_0x598a('0x38')]=qs[_0x598a('0x2f')](_[_0x598a('0x39')](_0x4e6cb1[_0x598a('0x2d')],_0x4d3b3a[_0x598a('0x2f')]),_0x227040);if(_0x4e6cb1[_0x598a('0x2d')]['filter']){_0x14d79b['where']=_[_0x598a('0x3a')](_0x14d79b['where'],{'$or':_[_0x598a('0x3b')](_0x227040,function(_0x486d21){if(_0x486d21['type']!==_0x598a('0x3c')){var _0x4e3ae5={};_0x4e3ae5[_0x486d21[_0x598a('0x28')]]={'$like':'%'+_0x4e6cb1[_0x598a('0x2d')]['filter']+'%'};return _0x4e3ae5;}})});}_0x14d79b=_[_0x598a('0x3a')]({},_0x14d79b,_0x4e6cb1[_0x598a('0x3d')]);var _0x28f8a8={'where':_0x14d79b['where']};return db[_0x598a('0x2a')][_0x598a('0x1b')](_0x28f8a8)[_0x598a('0x21')](function(_0x29e43a){_0x57329a['count']=_0x29e43a;if(_0x4e6cb1[_0x598a('0x2d')][_0x598a('0x3e')]){_0x14d79b[_0x598a('0x3f')]=[{'all':!![]}];}return db[_0x598a('0x2a')][_0x598a('0x40')](_0x14d79b);})[_0x598a('0x21')](function(_0x124d15){_0x57329a['rows']=_0x124d15;return _0x57329a;})['then'](respondWithFilteredResult(_0x4733cd,_0x14d79b))[_0x598a('0x41')](handleError(_0x4733cd,null));};exports[_0x598a('0x42')]=function(_0x2d2adc,_0x2bed32){var _0x4ddab4={'raw':!![],'where':{'id':_0x2d2adc[_0x598a('0x43')]['id']}},_0xe1a840={};_0xe1a840[_0x598a('0x31')]=_[_0x598a('0x2e')](db[_0x598a('0x2a')][_0x598a('0x2b')]);_0xe1a840[_0x598a('0x2d')]=_[_0x598a('0x2e')](_0x2d2adc[_0x598a('0x2d')]);_0xe1a840[_0x598a('0x2f')]=_['intersection'](_0xe1a840[_0x598a('0x31')],_0xe1a840['query']);_0x4ddab4[_0x598a('0x33')]=_[_0x598a('0x30')](_0xe1a840[_0x598a('0x31')],qs[_0x598a('0x32')](_0x2d2adc['query'][_0x598a('0x32')]));_0x4ddab4['attributes']=_0x4ddab4[_0x598a('0x33')][_0x598a('0x34')]?_0x4ddab4[_0x598a('0x33')]:_0xe1a840[_0x598a('0x31')];if(_0x2d2adc[_0x598a('0x2d')][_0x598a('0x3e')]){_0x4ddab4[_0x598a('0x3f')]=[{'all':!![]}];}_0x4ddab4=_['merge']({},_0x4ddab4,_0x2d2adc[_0x598a('0x3d')]);return db[_0x598a('0x2a')][_0x598a('0x44')](_0x4ddab4)[_0x598a('0x21')](handleEntityNotFound(_0x2bed32,null))[_0x598a('0x21')](respondWithResult(_0x2bed32,null))[_0x598a('0x41')](handleError(_0x2bed32,null));};exports[_0x598a('0x45')]=function(_0x2534b2,_0x10ac25){return db['Pause'][_0x598a('0x45')](_0x2534b2[_0x598a('0x46')],{})['then'](function(_0xa41c32){var _0x1243d6=_0x2534b2['user'][_0x598a('0x23')]({'plain':!![]});if(!_0x1243d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1243d6[_0x598a('0x47')]===_0x598a('0x48')){var _0x163dc8=_0xa41c32['get']({'plain':!![]});var _0x55195f=_0x598a('0x24');return db[_0x598a('0x49')][_0x598a('0x44')]({'where':{'name':_0x55195f,'userProfileId':_0x1243d6['userProfileId']},'raw':!![]})['then'](function(_0x9c807c){if(_0x9c807c&&_0x9c807c[_0x598a('0x4a')]===0x0){return db['UserProfileResource'][_0x598a('0x45')]({'name':_0x163dc8['name'],'resourceId':_0x163dc8['id'],'type':_0x9c807c['name'],'sectionId':_0x9c807c['id']},{})[_0x598a('0x21')](function(){return _0xa41c32;});}else{return _0xa41c32;}})[_0x598a('0x41')](function(_0x4fc978){logger[_0x598a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fc978);throw _0x4fc978;});}return _0xa41c32;})[_0x598a('0x21')](respondWithResult(_0x10ac25,0xc9))[_0x598a('0x41')](handleError(_0x10ac25,null));};exports[_0x598a('0x20')]=function(_0x499cf1,_0x28ca9a){if(_0x499cf1[_0x598a('0x46')]['id']){delete _0x499cf1['body']['id'];}return db['Pause'][_0x598a('0x44')]({'where':{'id':_0x499cf1[_0x598a('0x43')]['id']}})[_0x598a('0x21')](handleEntityNotFound(_0x28ca9a,null))[_0x598a('0x21')](saveUpdates(_0x499cf1[_0x598a('0x46')],null))[_0x598a('0x21')](respondWithResult(_0x28ca9a,null))['catch'](handleError(_0x28ca9a,null));};exports[_0x598a('0x22')]=function(_0x18c293,_0x18f836){return db['Pause']['find']({'where':{'id':_0x18c293[_0x598a('0x43')]['id']}})['then'](handleEntityNotFound(_0x18f836,null))[_0x598a('0x21')](removeEntity(_0x18f836,null))[_0x598a('0x41')](handleError(_0x18f836,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index f61815a..0911b44 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x2cff36,_0x17552f){var _0x145315=function(_0x3f1d65){while(--_0x3f1d65){_0x2cff36['push'](_0x2cff36['shift']());}};_0x145315(++_0x17552f);}(_0xf494,0x1c6));var _0x4f49=function(_0x5a1a68,_0x39cb7a){_0x5a1a68=_0x5a1a68-0x0;var _0x584e5d=_0xf494[_0x5a1a68];return _0x584e5d;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x7217,0x19e));var _0x7721=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7217[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 8c58e92..8b87e89 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 _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(_0x347435,_0x1dae06){var _0x39ebc4=function(_0x5afbe0){while(--_0x5afbe0){_0x347435['push'](_0x347435['shift']());}};_0x39ebc4(++_0x1dae06);}(_0x7a54,0x106));var _0x47a5=function(_0x166b8f,_0x3d8204){_0x166b8f=_0x166b8f-0x0;var _0x3afd1f=_0x7a54[_0x166b8f];return _0x3afd1f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x4a4de9,_0x5e56d9){var _0x3cf978=function(_0xa7a081){while(--_0xa7a081){_0x4a4de9['push'](_0x4a4de9['shift']());}};_0x3cf978(++_0x5e56d9);}(_0xb10b,0x12a));var _0xbb10=function(_0x462042,_0x524279){_0x462042=_0x462042-0x0;var _0x585608=_0xb10b[_0x462042];return _0x585608;};'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 diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index a34b8dd..8780e2f 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 _0x9f62=['extname','now','post','single','file','upload','put','/:id','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id/download','isAuthenticated','join','root','originalname','replace','format','%s-%s%s','basename'];(function(_0x27f67d,_0x253765){var _0x4cfa37=function(_0x173454){while(--_0x173454){_0x27f67d['push'](_0x27f67d['shift']());}};_0x4cfa37(++_0x253765);}(_0x9f62,0x154));var _0x29f6=function(_0x1256b3,_0x1c6043){_0x1256b3=_0x1256b3-0x0;var _0x23e2fa=_0x9f62[_0x1256b3];return _0x23e2fa;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var controller=require(_0x29f6('0x6'));router[_0x29f6('0x7')]('/',auth['isAuthenticated'](),controller[_0x29f6('0x8')]);router[_0x29f6('0x7')](_0x29f6('0x9'),controller[_0x29f6('0xa')]);router[_0x29f6('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x29f6('0xb'),auth[_0x29f6('0xc')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29b3f5,_0x442623,_0x4909e0){_0x4909e0(null,path[_0x29f6('0xd')](config[_0x29f6('0xe')],'server/files/plugins'));},'filename':function(_0x5b9b6a,_0x559585,_0x57b2d2){_0x559585[_0x29f6('0xf')]=_0x559585[_0x29f6('0xf')][_0x29f6('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57b2d2(null,util[_0x29f6('0x11')](_0x29f6('0x12'),path[_0x29f6('0x13')](_0x559585[_0x29f6('0xf')],path[_0x29f6('0x14')](_0x559585[_0x29f6('0xf')])),Date[_0x29f6('0x15')](),path[_0x29f6('0x14')](_0x559585[_0x29f6('0xf')])));}})});router[_0x29f6('0x16')]('/',upload[_0x29f6('0x17')](_0x29f6('0x18')),controller[_0x29f6('0x19')]);router[_0x29f6('0x16')]('/webhook',controller['webhookPost']);router[_0x29f6('0x1a')](_0x29f6('0x1b'),auth[_0x29f6('0xc')](),controller['update']);router[_0x29f6('0x1c')](_0x29f6('0x1b'),auth['isAuthenticated'](),controller[_0x29f6('0x1c')]);module[_0x29f6('0x1d')]=router; \ No newline at end of file +var _0x425d=['isAuthenticated','index','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get'];(function(_0xdeeb18,_0x1a9e0a){var _0x456c67=function(_0xff5d3c){while(--_0xff5d3c){_0xdeeb18['push'](_0xdeeb18['shift']());}};_0x456c67(++_0x1a9e0a);}(_0x425d,0x1e0));var _0xd425=function(_0x57ff59,_0x4b9327){_0x57ff59=_0x57ff59-0x0;var _0x58e63f=_0x425d[_0x57ff59];return _0x58e63f;};'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'),controller['webhookGet']);router[_0xd425('0x9')](_0xd425('0xd'),auth[_0xd425('0xa')](),controller[_0xd425('0xe')]);router[_0xd425('0x9')](_0xd425('0xf'),auth[_0xd425('0xa')](),controller[_0xd425('0x10')]);var upload=multer({'storage':multer[_0xd425('0x11')]({'destination':function(_0x35a7f4,_0x3d2bcf,_0x10d463){_0x10d463(null,path[_0xd425('0x12')](config[_0xd425('0x13')],_0xd425('0x14')));},'filename':function(_0x2385a5,_0x9bb611,_0x3cacf7){_0x9bb611[_0xd425('0x15')]=_0x9bb611[_0xd425('0x15')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3cacf7(null,util[_0xd425('0x16')](_0xd425('0x17'),path[_0xd425('0x18')](_0x9bb611['originalname'],path[_0xd425('0x19')](_0x9bb611[_0xd425('0x15')])),Date[_0xd425('0x1a')](),path[_0xd425('0x19')](_0x9bb611[_0xd425('0x15')])));}})});router['post']('/',upload[_0xd425('0x1b')](_0xd425('0x1c')),controller[_0xd425('0x1d')]);router[_0xd425('0x1e')]('/webhook',controller[_0xd425('0x1f')]);router[_0xd425('0x20')](_0xd425('0xd'),auth[_0xd425('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd425('0x21')]);module[_0xd425('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index fcee757..103c67f 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 _0xfa04=['never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly'];(function(_0xb416ba,_0x2edaf9){var _0x32ce6d=function(_0x543644){while(--_0x543644){_0xb416ba['push'](_0xb416ba['shift']());}};_0x32ce6d(++_0x2edaf9);}(_0xfa04,0x93));var _0x4fa0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfa04[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x4fa0('0x0'));module[_0x4fa0('0x1')]={'name':{'type':Sequelize[_0x4fa0('0x2')]},'type':{'type':Sequelize[_0x4fa0('0x3')](_0x4fa0('0x4'),'script')},'description':{'type':Sequelize[_0x4fa0('0x5')]},'version':{'type':Sequelize[_0x4fa0('0x5')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x4fa0('0x6')],'defaultValue':0x0,'comment':_0x4fa0('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x4fa0('0x8'),'agentOnly','always',_0x4fa0('0x9')),'defaultValue':_0x4fa0('0xa'),'comment':_0x4fa0('0xb')},'icon':{'type':Sequelize[_0x4fa0('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x4fa0('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x4fa0('0x2')]}}; \ No newline at end of file +var _0x2689=['agentOnly','always','never','sequelize','exports','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly'];(function(_0x21bde7,_0x199391){var _0x2153b7=function(_0x3346d0){while(--_0x3346d0){_0x21bde7['push'](_0x21bde7['shift']());}};_0x2153b7(++_0x199391);}(_0x2689,0x1ed));var _0x9268=function(_0x1c27e1,_0x10cc1c){_0x1c27e1=_0x1c27e1-0x0;var _0x9a81ac=_0x2689[_0x1c27e1];return _0x9a81ac;};'use strict';var Sequelize=require(_0x9268('0x0'));module[_0x9268('0x1')]={'name':{'type':Sequelize[_0x9268('0x2')]},'type':{'type':Sequelize['ENUM'](_0x9268('0x3'),_0x9268('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x9268('0x5')]},'path':{'type':Sequelize[_0x9268('0x2')],'comment':_0x9268('0x6')},'active':{'type':Sequelize[_0x9268('0x7')],'defaultValue':0x0,'comment':_0x9268('0x8')},'sidebar':{'type':Sequelize[_0x9268('0x9')](_0x9268('0xa'),_0x9268('0xb'),_0x9268('0xc'),_0x9268('0xd')),'defaultValue':_0x9268('0xc'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x9268('0x2')]},'adminUrl':{'type':Sequelize[_0x9268('0x2')]},'agentUrl':{'type':Sequelize[_0x9268('0x2')]},'scriptName':{'type':Sequelize[_0x9268('0x2')]},'scriptPath':{'type':Sequelize[_0x9268('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 98da15e..b7f1c25 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 _0x8d64=['content-length','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','Plugin','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','download','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','existsSync','Plugin\x20not\x20found','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','userProfileId','role','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-type','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified'];(function(_0x2c9c6e,_0x107806){var _0x35f387=function(_0x107c46){while(--_0x107c46){_0x2c9c6e['push'](_0x2c9c6e['shift']());}};_0x35f387(++_0x107806);}(_0x8d64,0x15d));var _0x48d6=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x8d64[_0x18abd2];return _0x1dcad6;};'use strict';var emlformat=require(_0x48d6('0x0'));var rimraf=require(_0x48d6('0x1'));var zipdir=require(_0x48d6('0x2'));var jsonpatch=require(_0x48d6('0x3'));var rp=require(_0x48d6('0x4'));var moment=require(_0x48d6('0x5'));var BPromise=require(_0x48d6('0x6'));var Mustache=require(_0x48d6('0x7'));var util=require(_0x48d6('0x8'));var path=require(_0x48d6('0x9'));var sox=require(_0x48d6('0xa'));var csv=require(_0x48d6('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48d6('0xc'));var _=require(_0x48d6('0xd'));var squel=require(_0x48d6('0xe'));var crypto=require(_0x48d6('0xf'));var jsforce=require(_0x48d6('0x10'));var deskjs=require(_0x48d6('0x11'));var toCsv=require(_0x48d6('0xb'));var querystring=require(_0x48d6('0x12'));var Papa=require(_0x48d6('0x13'));var extract=require(_0x48d6('0x14'));var rimraf=require(_0x48d6('0x1'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x48d6('0x15'));var qs=require(_0x48d6('0x16'));var as=require(_0x48d6('0x17'));var hardwareService=require(_0x48d6('0x18'));var logger=require(_0x48d6('0x19'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x48d6('0x1a'));var db=require(_0x48d6('0x1b'))['db'];config[_0x48d6('0x1c')]=_[_0x48d6('0x1d')](config[_0x48d6('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x48d6('0x1e'))(new Redis(config[_0x48d6('0x1c')]));require(_0x48d6('0x1f'))[_0x48d6('0x20')](socket);function respondWithStatusCode(_0x417880,_0x2f2d0c){_0x2f2d0c=_0x2f2d0c||0xcc;return function(_0x571a03){if(_0x571a03){return _0x417880[_0x48d6('0x21')](_0x2f2d0c);}return _0x417880[_0x48d6('0x22')](_0x2f2d0c)[_0x48d6('0x23')]();};}function respondWithResult(_0x5461b5,_0x5f0451){_0x5f0451=_0x5f0451||0xc8;return function(_0x1693c3){if(_0x1693c3){return _0x5461b5[_0x48d6('0x22')](_0x5f0451)[_0x48d6('0x24')](_0x1693c3);}};}function respondWithFilteredResult(_0x40018b,_0x13337c){return function(_0x1cbce5){if(_0x1cbce5){var _0x151add=typeof _0x13337c['offset']==='undefined'&&typeof _0x13337c['limit']===_0x48d6('0x25');var _0x43d255=_0x1cbce5[_0x48d6('0x26')];var _0x273c0d=_0x151add?0x0:_0x13337c['offset'];var _0x48f535=_0x151add?_0x1cbce5[_0x48d6('0x26')]:_0x13337c['offset']+_0x13337c[_0x48d6('0x27')];var _0x268c97;if(_0x48f535>=_0x43d255){_0x48f535=_0x43d255;_0x268c97=0xc8;}else{_0x268c97=0xce;}_0x40018b[_0x48d6('0x22')](_0x268c97);return _0x40018b[_0x48d6('0x28')](_0x48d6('0x29'),_0x273c0d+'-'+_0x48f535+'/'+_0x43d255)[_0x48d6('0x24')](_0x1cbce5);}return null;};}function patchUpdates(_0x53f05b){return function(_0x9b9744){try{jsonpatch[_0x48d6('0x2a')](_0x9b9744,_0x53f05b,!![]);}catch(_0x1fc6b6){return BPromise[_0x48d6('0x2b')](_0x1fc6b6);}return _0x9b9744[_0x48d6('0x2c')]();};}function saveUpdates(_0x30ab5f,_0x345faf){return function(_0x595854){if(_0x595854){return _0x595854[_0x48d6('0x2d')](_0x30ab5f)[_0x48d6('0x2e')](function(_0x560371){return _0x560371;});}return null;};}function removeEntity(_0x5361d9,_0x5f0649){return function(_0x2d0795){if(_0x2d0795){return _0x2d0795['destroy']()['then'](function(){var _0x57996b=_0x2d0795[_0x48d6('0x2f')]({'plain':!![]});var _0x4bb37a='Plugins';return db[_0x48d6('0x30')][_0x48d6('0x31')]({'where':{'type':_0x4bb37a,'resourceId':_0x57996b['id']}})['then'](function(){return _0x2d0795;});})['then'](function(){_0x5361d9[_0x48d6('0x22')](0xcc)[_0x48d6('0x23')]();});}};}function handleEntityNotFound(_0x1b7677,_0x2cfdcd){return function(_0x51025c){if(!_0x51025c){_0x1b7677[_0x48d6('0x21')](0x194);}return _0x51025c;};}function handleError(_0x11ed8d,_0x852bbc){_0x852bbc=_0x852bbc||0x1f4;return function(_0x34ed80){logger[_0x48d6('0x32')](_0x34ed80[_0x48d6('0x33')]);if(_0x34ed80[_0x48d6('0x34')]){delete _0x34ed80[_0x48d6('0x34')];}_0x11ed8d[_0x48d6('0x22')](_0x852bbc)['send'](_0x34ed80);};}exports[_0x48d6('0x35')]=function(_0x3f31df,_0x5a8831){var _0x46c32a={},_0x49dff4={},_0x526c3d={'count':0x0,'rows':[]};var _0x2e9b7e=_['map'](db[_0x48d6('0x36')]['rawAttributes'],function(_0x87f87d){return{'name':_0x87f87d[_0x48d6('0x37')],'type':_0x87f87d[_0x48d6('0x38')]['key']};});_0x49dff4[_0x48d6('0x39')]=_[_0x48d6('0x3a')](_0x2e9b7e,_0x48d6('0x34'));_0x49dff4[_0x48d6('0x3b')]=_[_0x48d6('0x3c')](_0x3f31df[_0x48d6('0x3b')]);_0x49dff4[_0x48d6('0x3d')]=_[_0x48d6('0x3e')](_0x49dff4[_0x48d6('0x39')],_0x49dff4[_0x48d6('0x3b')]);_0x46c32a[_0x48d6('0x3f')]=_[_0x48d6('0x3e')](_0x49dff4[_0x48d6('0x39')],qs[_0x48d6('0x40')](_0x3f31df[_0x48d6('0x3b')]['fields']));_0x46c32a[_0x48d6('0x3f')]=_0x46c32a['attributes'][_0x48d6('0x41')]?_0x46c32a[_0x48d6('0x3f')]:_0x49dff4[_0x48d6('0x39')];if(!_0x3f31df[_0x48d6('0x3b')][_0x48d6('0x42')]('nolimit')){_0x46c32a[_0x48d6('0x27')]=qs[_0x48d6('0x27')](_0x3f31df[_0x48d6('0x3b')]['limit']);_0x46c32a[_0x48d6('0x43')]=qs[_0x48d6('0x43')](_0x3f31df[_0x48d6('0x3b')]['offset']);}_0x46c32a[_0x48d6('0x44')]=qs[_0x48d6('0x45')](_0x3f31df[_0x48d6('0x3b')][_0x48d6('0x45')]);_0x46c32a[_0x48d6('0x46')]=qs['filters'](_[_0x48d6('0x47')](_0x3f31df[_0x48d6('0x3b')],_0x49dff4[_0x48d6('0x3d')]),_0x2e9b7e);if(_0x3f31df['query'][_0x48d6('0x48')]){_0x46c32a[_0x48d6('0x46')]=_[_0x48d6('0x49')](_0x46c32a[_0x48d6('0x46')],{'$or':_[_0x48d6('0x3a')](_0x2e9b7e,function(_0x4d5576){if(_0x4d5576[_0x48d6('0x38')]!==_0x48d6('0x4a')){var _0x3dfc80={};_0x3dfc80[_0x4d5576['name']]={'$like':'%'+_0x3f31df[_0x48d6('0x3b')]['filter']+'%'};return _0x3dfc80;}})});}_0x46c32a=_[_0x48d6('0x49')]({},_0x46c32a,_0x3f31df[_0x48d6('0x4b')]);var _0x4f1816={'where':_0x46c32a[_0x48d6('0x46')]};return db[_0x48d6('0x36')][_0x48d6('0x26')](_0x4f1816)[_0x48d6('0x2e')](function(_0x5ab73b){_0x526c3d[_0x48d6('0x26')]=_0x5ab73b;if(_0x3f31df[_0x48d6('0x3b')][_0x48d6('0x4c')]){_0x46c32a[_0x48d6('0x4d')]=[{'all':!![]}];}return db['Plugin'][_0x48d6('0x4e')](_0x46c32a);})[_0x48d6('0x2e')](function(_0x3cbaaf){_0x526c3d[_0x48d6('0x4f')]=_0x3cbaaf;return _0x526c3d;})[_0x48d6('0x2e')](respondWithFilteredResult(_0x5a8831,_0x46c32a))['catch'](handleError(_0x5a8831,null));};exports['show']=function(_0x5848bf,_0x2da456){var _0x512708={'raw':!![],'where':{'id':_0x5848bf[_0x48d6('0x50')]['id']}},_0x2d894e={};_0x2d894e[_0x48d6('0x39')]=_[_0x48d6('0x3c')](db[_0x48d6('0x36')][_0x48d6('0x51')]);_0x2d894e[_0x48d6('0x3b')]=_[_0x48d6('0x3c')](_0x5848bf[_0x48d6('0x3b')]);_0x2d894e[_0x48d6('0x3d')]=_['intersection'](_0x2d894e[_0x48d6('0x39')],_0x2d894e[_0x48d6('0x3b')]);_0x512708[_0x48d6('0x3f')]=_[_0x48d6('0x3e')](_0x2d894e[_0x48d6('0x39')],qs[_0x48d6('0x40')](_0x5848bf[_0x48d6('0x3b')]['fields']));_0x512708[_0x48d6('0x3f')]=_0x512708['attributes']['length']?_0x512708[_0x48d6('0x3f')]:_0x2d894e[_0x48d6('0x39')];if(_0x5848bf[_0x48d6('0x3b')][_0x48d6('0x4c')]){_0x512708[_0x48d6('0x4d')]=[{'all':!![]}];}_0x512708=_['merge']({},_0x512708,_0x5848bf[_0x48d6('0x4b')]);return db[_0x48d6('0x36')][_0x48d6('0x52')](_0x512708)[_0x48d6('0x2e')](handleEntityNotFound(_0x2da456,null))[_0x48d6('0x2e')](respondWithResult(_0x2da456,null))[_0x48d6('0x53')](handleError(_0x2da456,null));};exports[_0x48d6('0x54')]=function(_0x4b89f3,_0x5ed58b,_0x5f819c){return db[_0x48d6('0x36')]['find']({'where':{'id':_0x4b89f3['params']['id']},'attributes':[_0x48d6('0x34'),'path'],'raw':!![]})[_0x48d6('0x2e')](handleEntityNotFound(_0x5ed58b,null))[_0x48d6('0x2e')](function(_0x52b092){if(_0x52b092){var _0x8471c2=path['join'](config[_0x48d6('0x55')],_0x48d6('0x56'),util[_0x48d6('0x57')](_0x48d6('0x58'),path[_0x48d6('0x59')](_0x52b092[_0x48d6('0x9')])));var _0x52ebcf=fs[_0x48d6('0x5a')](_0x8471c2);var _0x5ea62f=archiver(_0x48d6('0x5b'),{'zlib':{'level':0x9}});_0x5ea62f['on'](_0x48d6('0x5c'),function(_0x456410){if(_0x456410[_0x48d6('0x5d')]===_0x48d6('0x5e')){logger[_0x48d6('0x32')](_0x456410);}else{throw new db[(_0x48d6('0x5f'))][(_0x48d6('0x60'))](_0x48d6('0x61'));}});_0x5ea62f['on'](_0x48d6('0x32'),function(_0x97a682){throw new db['Sequelize']['Error'](_0x48d6('0x61'));});_0x5ea62f[_0x48d6('0x62')](_0x52ebcf);_0x5ea62f[_0x48d6('0x63')](_0x48d6('0x64'),{'cwd':path[_0x48d6('0x65')](config['root'],_0x48d6('0x56'),path[_0x48d6('0x66')](_0x52b092[_0x48d6('0x9')])),'ignore':[path[_0x48d6('0x65')](path[_0x48d6('0x59')](_0x52b092[_0x48d6('0x9')]),_0x48d6('0x67')),path[_0x48d6('0x65')](path[_0x48d6('0x59')](_0x52b092[_0x48d6('0x9')]),_0x48d6('0x68'))],'nodir':!![]})['finalize']();_0x52ebcf['on']('close',function(){if(!fs[_0x48d6('0x69')](_0x8471c2)){throw new db[(_0x48d6('0x5f'))][(_0x48d6('0x60'))](_0x48d6('0x6a'));}return _0x5ed58b[_0x48d6('0x54')](_0x8471c2,util[_0x48d6('0x57')](_0x48d6('0x58'),path[_0x48d6('0x59')](_0x52b092[_0x48d6('0x9')])),function(_0x17e363){if(_0x17e363){throw new db[(_0x48d6('0x5f'))][(_0x48d6('0x60'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x8471c2);logger[_0x48d6('0x6b')](_0x48d6('0x6c'));logger['info'](_0x48d6('0x6d'));});});}return null;})[_0x48d6('0x53')](handleError(_0x5ed58b,null));};exports[_0x48d6('0x6e')]=function(_0x86e6a,_0x3b5a00,_0x5e5601){var _0x5ddbf4=path[_0x48d6('0x59')](_0x86e6a[_0x48d6('0x6f')][_0x48d6('0x70')],path[_0x48d6('0x71')](_0x86e6a[_0x48d6('0x6f')][_0x48d6('0x70')]));var _0x5f0903=path['join'](config['root'],_0x48d6('0x56'),_0x86e6a[_0x48d6('0x6f')][_0x48d6('0x70')]);var _0x23582f=path[_0x48d6('0x65')](config['root'],_0x48d6('0x56'),_0x5ddbf4);logger[_0x48d6('0x6b')](_0x48d6('0x72'),_0x5f0903);logger[_0x48d6('0x6b')]('Plugin\x20upload\x20destination:\x20%s',_0x23582f);try{fs[_0x48d6('0x73')](_0x5f0903,parseInt(_0x48d6('0x74'),0x8));extract(_0x5f0903,{'dir':_0x23582f},function(_0x4863b4){if(_0x4863b4){logger[_0x48d6('0x32')](_0x4863b4);handleError(_0x4863b4,!![]);};var _0x537d9e=fs[_0x48d6('0x75')](_0x23582f);if(_0x537d9e[_0x48d6('0x41')]>0x1){removeReferences(_0x5f0903,_0x23582f);logger[_0x48d6('0x32')]('Invalid\x20plugin\x20structure');return _0x5e5601(new Error(_0x48d6('0x76')));}var _0x592a84=fs[_0x48d6('0x77')](path[_0x48d6('0x65')](_0x23582f,_0x537d9e[0x0]));if(_0x592a84['isFile']()){removeReferences(_0x5f0903,_0x23582f);logger['error'](_0x48d6('0x76'));return _0x5e5601(new Error(_0x48d6('0x76')));}if(_0x592a84[_0x48d6('0x78')]()){var _0x3b8388=fs[_0x48d6('0x75')](path[_0x48d6('0x65')](_0x23582f,_0x537d9e[0x0]));if(_0x3b8388[_0x48d6('0x41')]===0x0){removeReferences(_0x5f0903,_0x23582f);logger[_0x48d6('0x32')](_0x48d6('0x76'));return _0x5e5601(new Error(_0x48d6('0x76')));}var _0x543173=_0x3b8388['some'](function(_0x2ea0e3){return _0x2ea0e3===_0x48d6('0x79');});if(!_0x543173){return _0x5e5601(new Error('Plugin\x20manifest\x20missing'));}var _0x24edb8=fs[_0x48d6('0x7a')](path['join'](_0x23582f,_0x537d9e[0x0],_0x48d6('0x79')));var _0x4ccfec=JSON[_0x48d6('0x7b')](_0x24edb8);if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x34')]){return _0x5e5601(new Error(_0x48d6('0x7c')));}if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x38')]){return _0x5e5601(new Error(_0x48d6('0x7d')));}if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x7e')]){return _0x5e5601(new Error(_0x48d6('0x7f')));}if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x80')]){return _0x5e5601(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4ccfec[_0x48d6('0x38')]===_0x48d6('0x81')){if(_0x48d6('0x25')==typeof _0x4ccfec['parameters'][_0x48d6('0x82')]){return _0x5e5601(new Error(_0x48d6('0x83')));}if('undefined'==typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')][_0x48d6('0x84')]&&_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')][_0x48d6('0x85')]){return _0x5e5601(new Error(_0x48d6('0x86')));}}else if(_0x4ccfec['type']===_0x48d6('0x87')){if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x88')]){return _0x5e5601(new Error(_0x48d6('0x89')));}if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x8a')]){return _0x5e5601(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x5e5601(new Error(_0x48d6('0x8b')));}var _0x2b590d=_0x4ccfec['name'];var _0x5e8d23=_0x4ccfec['description'];var _0x2c5be2=_0x4ccfec[_0x48d6('0x38')];var _0x464c07=_0x4ccfec[_0x48d6('0x8c')]?_0x4ccfec[_0x48d6('0x8c')]:_0x48d6('0x8d');var _0x5352a6=_0x4ccfec[_0x48d6('0x8e')]?_0x4ccfec['icon']:_0x48d6('0x8f');var _0x223240='';var _0x4eb647='';var _0x3ebfc7='';var _0x1b0ae3='';var _0x5a6c87=_0x4ccfec[_0x48d6('0x7e')];if(_0x2c5be2===_0x48d6('0x81')){if(_0x48d6('0x25')!=typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')][_0x48d6('0x84')]){var _0x5a1aa0=_0x4ccfec[_0x48d6('0x80')]['views'][_0x48d6('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x48d6('0x90')](_0x5a1aa0)){_0x223240=path[_0x48d6('0x65')]('plugins',_0x5ddbf4,_0x537d9e[0x0],_0x5a1aa0);}else{_0x223240=_0x5a1aa0;}}else{logger[_0x48d6('0x6b')](_0x48d6('0x91'));}if(_0x48d6('0x25')!=typeof _0x4ccfec['parameters'][_0x48d6('0x82')][_0x48d6('0x85')]){var _0x1fb928=_0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x48d6('0x90')](_0x1fb928)){_0x4eb647=path['join'](_0x48d6('0x92'),_0x5ddbf4,_0x537d9e[0x0],_0x1fb928);}else{_0x4eb647=_0x1fb928;}}else{logger[_0x48d6('0x6b')](_0x48d6('0x93'));}}else if(_0x2c5be2===_0x48d6('0x87')){_0x3ebfc7=_0x4ccfec['parameters'][_0x48d6('0x88')];_0x1b0ae3=_0x4ccfec[_0x48d6('0x80')][_0x48d6('0x8a')];if(_0x48d6('0x25')!=typeof _0x4ccfec['parameters'][_0x48d6('0x82')]){if(_0x48d6('0x25')!=typeof _0x4ccfec['parameters']['views'][_0x48d6('0x84')]){var _0x5a1aa0=_0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')][_0x48d6('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x48d6('0x90')](_0x5a1aa0)){_0x223240=path['join'](_0x48d6('0x92'),_0x5ddbf4,_0x537d9e[0x0],_0x5a1aa0);}else{_0x223240=_0x5a1aa0;}}if(_0x48d6('0x25')!=typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')][_0x48d6('0x85')]){var _0x1fb928=_0x4ccfec['parameters'][_0x48d6('0x82')][_0x48d6('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1fb928)){_0x4eb647=path['join'](_0x48d6('0x92'),_0x5ddbf4,_0x537d9e[0x0],_0x1fb928);}else{_0x4eb647=_0x1fb928;}}}}var _0x2a397b={'name':_0x2b590d,'description':_0x5e8d23,'path':path['join'](_0x5ddbf4,_0x537d9e[0x0]),'type':_0x2c5be2,'sidebar':_0x464c07,'icon':_0x5352a6,'adminUrl':_0x223240,'agentUrl':_0x4eb647,'scriptName':_0x3ebfc7,'scriptPath':_0x1b0ae3,'version':_0x5a6c87};removeReferences(_0x5f0903,null);return db[_0x48d6('0x36')]['create'](_0x2a397b)['then'](function(_0x273285){var _0xb7075b={'role':_0x86e6a[_0x48d6('0x94')]['role'],'userProfileId':_0x86e6a[_0x48d6('0x94')][_0x48d6('0x95')]};if(!_0xb7075b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb7075b[_0x48d6('0x96')]===_0x48d6('0x97')){var _0x176d3b=_0x273285['get']({'plain':!![]});return db[_0x48d6('0x98')][_0x48d6('0x52')]({'where':{'name':'Plugins','userProfileId':_0xb7075b[_0x48d6('0x95')]},'raw':!![]})[_0x48d6('0x2e')](function(_0x4c258b){if(_0x4c258b&&_0x4c258b[_0x48d6('0x99')]===0x0){return db[_0x48d6('0x30')][_0x48d6('0x9a')]({'name':_0x176d3b[_0x48d6('0x34')],'resourceId':_0x176d3b['id'],'type':_0x4c258b[_0x48d6('0x34')],'sectionId':_0x4c258b['id']},{})[_0x48d6('0x2e')](function(){return _0x273285;});}else{return _0x273285;}})[_0x48d6('0x53')](function(_0x5159c4){logger['error'](_0x48d6('0x9b'),_0x5159c4);throw _0x5159c4;});}return _0x273285;})[_0x48d6('0x2e')](respondWithResult(_0x3b5a00,null))[_0x48d6('0x53')](handleError(_0x3b5a00,null));}});}catch(_0x370dd0){_0x3b5a00[_0x48d6('0x22')](0x1f4)[_0x48d6('0x9c')](_0x370dd0);}};function removeReferences(_0x2abeb2,_0x45d9bf){try{if(_0x2abeb2){fs['unlinkSync'](_0x2abeb2);logger[_0x48d6('0x6b')](_0x48d6('0x9d'));}if(_0x45d9bf){rimraf(_0x45d9bf,function(){});logger['info'](_0x48d6('0x9e'));}}catch(_0x5caa60){logger[_0x48d6('0x32')](_0x5caa60);}}exports[_0x48d6('0x2d')]=function(_0xee1db7,_0x44e41e,_0x14ba82){return db[_0x48d6('0x36')][_0x48d6('0x52')]({'where':{'id':_0xee1db7[_0x48d6('0x50')]['id']}})[_0x48d6('0x2e')](handleEntityNotFound(_0x44e41e,null))[_0x48d6('0x2e')](saveUpdates(_0xee1db7[_0x48d6('0x94')],null))[_0x48d6('0x2e')](respondWithResult(_0x44e41e,null))['catch'](handleError(_0x44e41e,null));};exports[_0x48d6('0x9f')]=function(_0x14ee21,_0x2e56ac,_0x561eff){return db[_0x48d6('0x36')][_0x48d6('0x52')]({'where':{'id':_0x14ee21[_0x48d6('0x50')]['id']}})['then'](function(_0x3d1c96){if(_0x3d1c96){return _0x3d1c96[_0x48d6('0x31')]();}})[_0x48d6('0x2e')](function(_0x5ed174){rimraf(path[_0x48d6('0x65')](config[_0x48d6('0x55')],_0x48d6('0x56'),path[_0x48d6('0x66')](_0x5ed174[_0x48d6('0x9')])),function(){});return _0x5ed174;})[_0x48d6('0x2e')](handleEntityNotFound(_0x2e56ac,null))['then'](respondWithStatusCode(_0x2e56ac,null))['catch'](handleError(_0x2e56ac,null));};exports['webhookGet']=function(_0x51f636,_0x4ed075,_0x3035ed){return BPromise[_0x48d6('0xa0')]()['then'](function(){if(!_0x51f636[_0x48d6('0x3b')][_0x48d6('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x51f636['query'][_0x48d6('0xa1')]){throw new Error(_0x48d6('0xa2'));}var _0x2938ea=_0x51f636['query'][_0x48d6('0xa3')]?_0x51f636[_0x48d6('0x3b')][_0x48d6('0xa3')]+':'+_0x51f636[_0x48d6('0x3b')]['port']:_0x48d6('0xa4')+_0x51f636['query'][_0x48d6('0xa1')];var _0xb52b97=_0x51f636[_0x48d6('0x3b')][_0x48d6('0x24')]?_0x51f636[_0x48d6('0x3b')][_0x48d6('0x24')]:!![];var _0x2bbc11=_0x51f636[_0x48d6('0x3b')]['encoding']?_0x51f636[_0x48d6('0x3b')][_0x48d6('0xa5')]:null;var _0x5798b1={'method':_0x51f636[_0x48d6('0xa6')],'uri':util['format'](_0x48d6('0xa7'),_0x2938ea,_0x51f636['query'][_0x48d6('0x9')]),'json':_0xb52b97,'resolveWithFullResponse':!![],'encoding':_0x2bbc11,'qs':_0x51f636[_0x48d6('0x3b')]};if(_0x51f636[_0x48d6('0xa8')]){_0x5798b1[_0x48d6('0xa8')]=_0x51f636[_0x48d6('0xa8')];if(_0x5798b1[_0x48d6('0xa8')]['content-length']){delete _0x5798b1[_0x48d6('0xa8')]['content-length'];}}if(_0x5798b1[_0x48d6('0xa8')][_0x48d6('0xa9')]){delete _0x5798b1[_0x48d6('0xa8')][_0x48d6('0xa9')];}return rp(_0x5798b1);})[_0x48d6('0x2e')](function(_0x105711){if(_0x105711){_0x4ed075[_0x48d6('0x28')](_0x105711[_0x48d6('0xa8')]);logger['info'](_0x105711[_0x48d6('0x94')]);if(_[_0x48d6('0xaa')](_0x51f636['query'][_0x48d6('0x9')],'download')&&_0x105711[_0x48d6('0xab')]==0x1f4){return _0x4ed075[_0x48d6('0x21')](_0x105711[_0x48d6('0xab')]);}else{return _0x4ed075[_0x48d6('0x22')](_0x105711[_0x48d6('0xab')])[_0x48d6('0x9c')](_0x105711[_0x48d6('0x94')]);}}else{return _0x4ed075[_0x48d6('0x21')](0xc8);}})[_0x48d6('0x53')](handleError(_0x4ed075,null));};exports['webhookPost']=function(_0x5f0da8,_0x17bb7d,_0x42e39c){return BPromise[_0x48d6('0xa0')]()[_0x48d6('0x2e')](function(){if(!_0x5f0da8['query'][_0x48d6('0x9')]){throw new Error(_0x48d6('0xac'));}if(!_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0xa1')]){throw new Error(_0x48d6('0xa2'));}var _0x481563=_0x5f0da8['query'][_0x48d6('0xa3')]?_0x5f0da8[_0x48d6('0x3b')]['hostname']+':'+_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0xa1')]:_0x48d6('0xa4')+_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0xa1')];var _0x393cd6=_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0x24')]?_0x5f0da8['query'][_0x48d6('0x24')]:!![];var _0x895585=_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0xa5')]?_0x5f0da8['query'][_0x48d6('0xa5')]:null;var _0x1501f0={'method':_0x5f0da8['method'],'uri':util['format'](_0x48d6('0xa7'),_0x481563,_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0x9')]),'json':_0x393cd6,'resolveWithFullResponse':!![],'encoding':_0x895585,'body':_0x5f0da8['body']};if(_0x5f0da8[_0x48d6('0xa8')]){_0x1501f0['headers']=_0x5f0da8[_0x48d6('0xa8')];if(_0x1501f0[_0x48d6('0xa8')][_0x48d6('0xad')]){delete _0x1501f0[_0x48d6('0xa8')][_0x48d6('0xad')];}}if(_0x1501f0['headers']['content-type']){delete _0x1501f0[_0x48d6('0xa8')][_0x48d6('0xa9')];}return rp(_0x1501f0);})[_0x48d6('0x2e')](function(_0x239f83){if(_0x239f83){_0x17bb7d[_0x48d6('0x28')](_0x239f83['headers']);logger[_0x48d6('0x6b')](_0x239f83[_0x48d6('0x94')]);return _0x17bb7d['status'](_0x239f83[_0x48d6('0xab')])[_0x48d6('0x9c')](_0x239f83['body']);}else{return _0x17bb7d[_0x48d6('0x21')](0xc8);}})[_0x48d6('0x53')](handleError(_0x17bb7d,null));}; \ No newline at end of file +var _0x1997=['send','index','Plugin','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','download','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','agent','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','method','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name'];(function(_0x520a50,_0x452885){var _0xab1017=function(_0x185128){while(--_0x185128){_0x520a50['push'](_0x520a50['shift']());}};_0xab1017(++_0x452885);}(_0x1997,0x1d2));var _0x7199=function(_0x1ab615,_0x5a536b){_0x1ab615=_0x1ab615-0x0;var _0x3cf729=_0x1997[_0x1ab615];return _0x3cf729;};'use strict';var emlformat=require(_0x7199('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7199('0x1'));var jsonpatch=require(_0x7199('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7199('0x3'));var Mustache=require(_0x7199('0x4'));var util=require(_0x7199('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x7199('0x6'));var ejs=require(_0x7199('0x7'));var fs=require('fs');var fs_extra=require(_0x7199('0x8'));var _=require(_0x7199('0x9'));var squel=require(_0x7199('0xa'));var crypto=require(_0x7199('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7199('0xc'));var Papa=require(_0x7199('0xd'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x7199('0xe'));var authService=require(_0x7199('0xf'));var qs=require(_0x7199('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7199('0x11'))(_0x7199('0x12'));var utils=require(_0x7199('0x13'));var config=require(_0x7199('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7199('0x15'))['db'];config[_0x7199('0x16')]=_['defaults'](config[_0x7199('0x16')],{'host':_0x7199('0x17'),'port':0x18eb});var socket=require(_0x7199('0x18'))(new Redis(config[_0x7199('0x16')]));require(_0x7199('0x19'))['register'](socket);function respondWithStatusCode(_0x46eccc,_0x11d967){_0x11d967=_0x11d967||0xcc;return function(_0x318750){if(_0x318750){return _0x46eccc[_0x7199('0x1a')](_0x11d967);}return _0x46eccc[_0x7199('0x1b')](_0x11d967)[_0x7199('0x1c')]();};}function respondWithResult(_0x4f8d39,_0x810274){_0x810274=_0x810274||0xc8;return function(_0x56b592){if(_0x56b592){return _0x4f8d39[_0x7199('0x1b')](_0x810274)['json'](_0x56b592);}};}function respondWithFilteredResult(_0xcf3104,_0x215304){return function(_0x2c046b){if(_0x2c046b){var _0x5651e5=typeof _0x215304['offset']===_0x7199('0x1d')&&typeof _0x215304[_0x7199('0x1e')]===_0x7199('0x1d');var _0x4c2bc5=_0x2c046b[_0x7199('0x1f')];var _0xd4100a=_0x5651e5?0x0:_0x215304[_0x7199('0x20')];var _0x602907=_0x5651e5?_0x2c046b[_0x7199('0x1f')]:_0x215304[_0x7199('0x20')]+_0x215304[_0x7199('0x1e')];var _0x40614b;if(_0x602907>=_0x4c2bc5){_0x602907=_0x4c2bc5;_0x40614b=0xc8;}else{_0x40614b=0xce;}_0xcf3104[_0x7199('0x1b')](_0x40614b);return _0xcf3104[_0x7199('0x21')](_0x7199('0x22'),_0xd4100a+'-'+_0x602907+'/'+_0x4c2bc5)[_0x7199('0x23')](_0x2c046b);}return null;};}function patchUpdates(_0x2f2278){return function(_0x190b76){try{jsonpatch[_0x7199('0x24')](_0x190b76,_0x2f2278,!![]);}catch(_0x27b6d2){return BPromise[_0x7199('0x25')](_0x27b6d2);}return _0x190b76['save']();};}function saveUpdates(_0x2937bb,_0x21fdfa){return function(_0x1f8c27){if(_0x1f8c27){return _0x1f8c27[_0x7199('0x26')](_0x2937bb)[_0x7199('0x27')](function(_0x331ac0){return _0x331ac0;});}return null;};}function removeEntity(_0x8ff480,_0x2ff96b){return function(_0x4f271b){if(_0x4f271b){return _0x4f271b[_0x7199('0x28')]()[_0x7199('0x27')](function(){var _0x3230b4=_0x4f271b[_0x7199('0x29')]({'plain':!![]});var _0x487c3d=_0x7199('0x2a');return db[_0x7199('0x2b')][_0x7199('0x28')]({'where':{'type':_0x487c3d,'resourceId':_0x3230b4['id']}})[_0x7199('0x27')](function(){return _0x4f271b;});})['then'](function(){_0x8ff480[_0x7199('0x1b')](0xcc)[_0x7199('0x1c')]();});}};}function handleEntityNotFound(_0x7cfdbe,_0xc507f1){return function(_0x4b2c25){if(!_0x4b2c25){_0x7cfdbe[_0x7199('0x1a')](0x194);}return _0x4b2c25;};}function handleError(_0x53e997,_0x20ccff){_0x20ccff=_0x20ccff||0x1f4;return function(_0x5ba6ca){logger[_0x7199('0x2c')](_0x5ba6ca[_0x7199('0x2d')]);if(_0x5ba6ca[_0x7199('0x2e')]){delete _0x5ba6ca[_0x7199('0x2e')];}_0x53e997[_0x7199('0x1b')](_0x20ccff)[_0x7199('0x2f')](_0x5ba6ca);};}exports[_0x7199('0x30')]=function(_0x160e35,_0x35f1da){var _0x1af0eb={},_0x2232bc={},_0x50942b={'count':0x0,'rows':[]};var _0x444aea=_['map'](db[_0x7199('0x31')][_0x7199('0x32')],function(_0x788010){return{'name':_0x788010[_0x7199('0x33')],'type':_0x788010[_0x7199('0x34')][_0x7199('0x35')]};});_0x2232bc['model']=_['map'](_0x444aea,_0x7199('0x2e'));_0x2232bc[_0x7199('0x36')]=_[_0x7199('0x37')](_0x160e35['query']);_0x2232bc[_0x7199('0x38')]=_['intersection'](_0x2232bc[_0x7199('0x39')],_0x2232bc[_0x7199('0x36')]);_0x1af0eb[_0x7199('0x3a')]=_[_0x7199('0x3b')](_0x2232bc[_0x7199('0x39')],qs[_0x7199('0x3c')](_0x160e35['query'][_0x7199('0x3c')]));_0x1af0eb[_0x7199('0x3a')]=_0x1af0eb[_0x7199('0x3a')][_0x7199('0x3d')]?_0x1af0eb[_0x7199('0x3a')]:_0x2232bc[_0x7199('0x39')];if(!_0x160e35['query'][_0x7199('0x3e')](_0x7199('0x3f'))){_0x1af0eb['limit']=qs[_0x7199('0x1e')](_0x160e35[_0x7199('0x36')][_0x7199('0x1e')]);_0x1af0eb['offset']=qs[_0x7199('0x20')](_0x160e35[_0x7199('0x36')][_0x7199('0x20')]);}_0x1af0eb[_0x7199('0x40')]=qs[_0x7199('0x41')](_0x160e35[_0x7199('0x36')][_0x7199('0x41')]);_0x1af0eb[_0x7199('0x42')]=qs[_0x7199('0x38')](_['pick'](_0x160e35[_0x7199('0x36')],_0x2232bc['filters']),_0x444aea);if(_0x160e35[_0x7199('0x36')][_0x7199('0x43')]){_0x1af0eb[_0x7199('0x42')]=_[_0x7199('0x44')](_0x1af0eb['where'],{'$or':_[_0x7199('0x45')](_0x444aea,function(_0x18d3b9){if(_0x18d3b9[_0x7199('0x34')]!==_0x7199('0x46')){var _0x20ac3a={};_0x20ac3a[_0x18d3b9[_0x7199('0x2e')]]={'$like':'%'+_0x160e35[_0x7199('0x36')]['filter']+'%'};return _0x20ac3a;}})});}_0x1af0eb=_[_0x7199('0x44')]({},_0x1af0eb,_0x160e35['options']);var _0x3421d1={'where':_0x1af0eb[_0x7199('0x42')]};return db[_0x7199('0x31')]['count'](_0x3421d1)[_0x7199('0x27')](function(_0x4c5b09){_0x50942b[_0x7199('0x1f')]=_0x4c5b09;if(_0x160e35[_0x7199('0x36')]['includeAll']){_0x1af0eb[_0x7199('0x47')]=[{'all':!![]}];}return db[_0x7199('0x31')][_0x7199('0x48')](_0x1af0eb);})['then'](function(_0x5ca80b){_0x50942b[_0x7199('0x49')]=_0x5ca80b;return _0x50942b;})[_0x7199('0x27')](respondWithFilteredResult(_0x35f1da,_0x1af0eb))[_0x7199('0x4a')](handleError(_0x35f1da,null));};exports[_0x7199('0x4b')]=function(_0x306e96,_0x1a52fa){var _0x3c62c8={'raw':!![],'where':{'id':_0x306e96[_0x7199('0x4c')]['id']}},_0x413526={};_0x413526[_0x7199('0x39')]=_[_0x7199('0x37')](db[_0x7199('0x31')][_0x7199('0x32')]);_0x413526[_0x7199('0x36')]=_[_0x7199('0x37')](_0x306e96[_0x7199('0x36')]);_0x413526[_0x7199('0x38')]=_[_0x7199('0x3b')](_0x413526[_0x7199('0x39')],_0x413526['query']);_0x3c62c8[_0x7199('0x3a')]=_[_0x7199('0x3b')](_0x413526['model'],qs[_0x7199('0x3c')](_0x306e96[_0x7199('0x36')][_0x7199('0x3c')]));_0x3c62c8['attributes']=_0x3c62c8['attributes'][_0x7199('0x3d')]?_0x3c62c8['attributes']:_0x413526[_0x7199('0x39')];if(_0x306e96[_0x7199('0x36')][_0x7199('0x4d')]){_0x3c62c8['include']=[{'all':!![]}];}_0x3c62c8=_['merge']({},_0x3c62c8,_0x306e96['options']);return db[_0x7199('0x31')][_0x7199('0x4e')](_0x3c62c8)[_0x7199('0x27')](handleEntityNotFound(_0x1a52fa,null))[_0x7199('0x27')](respondWithResult(_0x1a52fa,null))[_0x7199('0x4a')](handleError(_0x1a52fa,null));};exports[_0x7199('0x4f')]=function(_0x3ce041,_0x346962,_0x316d9e){return db['Plugin'][_0x7199('0x4e')]({'where':{'id':_0x3ce041['params']['id']},'attributes':[_0x7199('0x2e'),_0x7199('0x50')],'raw':!![]})[_0x7199('0x27')](handleEntityNotFound(_0x346962,null))[_0x7199('0x27')](function(_0x4d4c1c){if(_0x4d4c1c){var _0x4e4c06=path[_0x7199('0x51')](config[_0x7199('0x52')],_0x7199('0x53'),util[_0x7199('0x54')](_0x7199('0x55'),path[_0x7199('0x56')](_0x4d4c1c[_0x7199('0x50')])));var _0x268763=fs[_0x7199('0x57')](_0x4e4c06);var _0x1cf128=archiver('zip',{'zlib':{'level':0x9}});_0x1cf128['on'](_0x7199('0x58'),function(_0xc4b741){if(_0xc4b741[_0x7199('0x59')]===_0x7199('0x5a')){logger[_0x7199('0x2c')](_0xc4b741);}else{throw new db[(_0x7199('0x5b'))][(_0x7199('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1cf128['on']('error',function(_0x35a55c){throw new db['Sequelize']['Error'](_0x7199('0x5d'));});_0x1cf128[_0x7199('0x5e')](_0x268763);_0x1cf128[_0x7199('0x5f')](_0x7199('0x60'),{'cwd':path[_0x7199('0x51')](config[_0x7199('0x52')],_0x7199('0x53'),path[_0x7199('0x61')](_0x4d4c1c[_0x7199('0x50')])),'ignore':[path[_0x7199('0x51')](path[_0x7199('0x56')](_0x4d4c1c[_0x7199('0x50')]),_0x7199('0x62')),path[_0x7199('0x51')](path[_0x7199('0x56')](_0x4d4c1c[_0x7199('0x50')]),_0x7199('0x63'))],'nodir':!![]})['finalize']();_0x268763['on'](_0x7199('0x64'),function(){if(!fs[_0x7199('0x65')](_0x4e4c06)){throw new db[(_0x7199('0x5b'))][(_0x7199('0x5c'))](_0x7199('0x66'));}return _0x346962['download'](_0x4e4c06,util[_0x7199('0x54')](_0x7199('0x55'),path['basename'](_0x4d4c1c[_0x7199('0x50')])),function(_0x25c31c){if(_0x25c31c){throw new db[(_0x7199('0x5b'))]['Error'](_0x7199('0x67'));}fs[_0x7199('0x68')](_0x4e4c06);logger[_0x7199('0x69')](_0x7199('0x6a'));logger['info'](_0x7199('0x6b'));});});}return null;})[_0x7199('0x4a')](handleError(_0x346962,null));};exports[_0x7199('0x6c')]=function(_0x3fcc5d,_0x148b74,_0x965e01){var _0x46c732=path[_0x7199('0x56')](_0x3fcc5d[_0x7199('0x6d')][_0x7199('0x6e')],path[_0x7199('0x6f')](_0x3fcc5d[_0x7199('0x6d')][_0x7199('0x6e')]));var _0x205f87=path['join'](config[_0x7199('0x52')],'server/files/plugins',_0x3fcc5d[_0x7199('0x6d')][_0x7199('0x6e')]);var _0x557063=path[_0x7199('0x51')](config[_0x7199('0x52')],_0x7199('0x53'),_0x46c732);logger[_0x7199('0x69')]('Plugin\x20upload\x20filepath:\x20%s',_0x205f87);logger[_0x7199('0x69')](_0x7199('0x70'),_0x557063);try{fs['chmodSync'](_0x205f87,parseInt(_0x7199('0x71'),0x8));extract(_0x205f87,{'dir':_0x557063},function(_0x3e8024){if(_0x3e8024){logger[_0x7199('0x2c')](_0x3e8024);handleError(_0x3e8024,!![]);};var _0x1762dd=fs[_0x7199('0x72')](_0x557063);if(_0x1762dd['length']>0x1){removeReferences(_0x205f87,_0x557063);logger[_0x7199('0x2c')](_0x7199('0x73'));return _0x965e01(new Error(_0x7199('0x73')));}var _0x39b85e=fs[_0x7199('0x74')](path['join'](_0x557063,_0x1762dd[0x0]));if(_0x39b85e[_0x7199('0x75')]()){removeReferences(_0x205f87,_0x557063);logger[_0x7199('0x2c')]('Invalid\x20plugin\x20structure');return _0x965e01(new Error(_0x7199('0x73')));}if(_0x39b85e[_0x7199('0x76')]()){var _0x51d1ab=fs[_0x7199('0x72')](path['join'](_0x557063,_0x1762dd[0x0]));if(_0x51d1ab[_0x7199('0x3d')]===0x0){removeReferences(_0x205f87,_0x557063);logger[_0x7199('0x2c')](_0x7199('0x73'));return _0x965e01(new Error(_0x7199('0x73')));}var _0xe4305c=_0x51d1ab[_0x7199('0x77')](function(_0x25d5c5){return _0x25d5c5===_0x7199('0x78');});if(!_0xe4305c){return _0x965e01(new Error(_0x7199('0x79')));}var _0x22ada9=fs[_0x7199('0x7a')](path['join'](_0x557063,_0x1762dd[0x0],_0x7199('0x78')));var _0x33006=JSON['parse'](_0x22ada9);if(_0x7199('0x1d')==typeof _0x33006['name']){return _0x965e01(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x7199('0x1d')==typeof _0x33006['type']){return _0x965e01(new Error(_0x7199('0x7b')));}if(_0x7199('0x1d')==typeof _0x33006[_0x7199('0x7c')]){return _0x965e01(new Error(_0x7199('0x7d')));}if(_0x7199('0x1d')==typeof _0x33006[_0x7199('0x7e')]){return _0x965e01(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x33006['type']===_0x7199('0x7f')){if(_0x7199('0x1d')==typeof _0x33006[_0x7199('0x7e')][_0x7199('0x80')]){return _0x965e01(new Error(_0x7199('0x81')));}if('undefined'==typeof _0x33006[_0x7199('0x7e')][_0x7199('0x80')][_0x7199('0x82')]&&_0x7199('0x1d')==typeof _0x33006['parameters']['views']['agent']){return _0x965e01(new Error(_0x7199('0x83')));}}else if(_0x33006[_0x7199('0x34')]===_0x7199('0x84')){if(_0x7199('0x1d')==typeof _0x33006[_0x7199('0x7e')]['scriptName']){return _0x965e01(new Error(_0x7199('0x85')));}if('undefined'==typeof _0x33006[_0x7199('0x7e')][_0x7199('0x86')]){return _0x965e01(new Error(_0x7199('0x87')));}}else{return _0x965e01(new Error(_0x7199('0x88')));}var _0x148588=_0x33006[_0x7199('0x2e')];var _0x5f26e8=_0x33006[_0x7199('0x89')];var _0x3c04aa=_0x33006[_0x7199('0x34')];var _0x3a352d=_0x33006[_0x7199('0x8a')]?_0x33006[_0x7199('0x8a')]:_0x7199('0x8b');var _0x3dda71=_0x33006['icon']?_0x33006[_0x7199('0x8c')]:_0x7199('0x8d');var _0x52fe94='';var _0x397b2c='';var _0x3cf5e7='';var _0x288b93='';var _0x5ac071=_0x33006['version'];if(_0x3c04aa==='html'){if(_0x7199('0x1d')!=typeof _0x33006['parameters'][_0x7199('0x80')][_0x7199('0x82')]){var _0x500590=_0x33006[_0x7199('0x7e')][_0x7199('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x7199('0x8e')](_0x500590)){_0x52fe94=path[_0x7199('0x51')]('plugins',_0x46c732,_0x1762dd[0x0],_0x500590);}else{_0x52fe94=_0x500590;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x7199('0x1d')!=typeof _0x33006[_0x7199('0x7e')][_0x7199('0x80')]['agent']){var _0x31a71a=_0x33006[_0x7199('0x7e')][_0x7199('0x80')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x31a71a)){_0x397b2c=path[_0x7199('0x51')](_0x7199('0x8f'),_0x46c732,_0x1762dd[0x0],_0x31a71a);}else{_0x397b2c=_0x31a71a;}}else{logger[_0x7199('0x69')](_0x7199('0x90'));}}else if(_0x3c04aa===_0x7199('0x84')){_0x3cf5e7=_0x33006[_0x7199('0x7e')][_0x7199('0x91')];_0x288b93=_0x33006[_0x7199('0x7e')][_0x7199('0x86')];if(_0x7199('0x1d')!=typeof _0x33006[_0x7199('0x7e')][_0x7199('0x80')]){if('undefined'!=typeof _0x33006['parameters']['views'][_0x7199('0x82')]){var _0x500590=_0x33006[_0x7199('0x7e')][_0x7199('0x80')][_0x7199('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x500590)){_0x52fe94=path[_0x7199('0x51')](_0x7199('0x8f'),_0x46c732,_0x1762dd[0x0],_0x500590);}else{_0x52fe94=_0x500590;}}if(_0x7199('0x1d')!=typeof _0x33006['parameters'][_0x7199('0x80')]['agent']){var _0x31a71a=_0x33006[_0x7199('0x7e')][_0x7199('0x80')][_0x7199('0x92')];if(!/^(f|ht)tps?:\/\//i[_0x7199('0x8e')](_0x31a71a)){_0x397b2c=path[_0x7199('0x51')]('plugins',_0x46c732,_0x1762dd[0x0],_0x31a71a);}else{_0x397b2c=_0x31a71a;}}}}var _0x43abee={'name':_0x148588,'description':_0x5f26e8,'path':path[_0x7199('0x51')](_0x46c732,_0x1762dd[0x0]),'type':_0x3c04aa,'sidebar':_0x3a352d,'icon':_0x3dda71,'adminUrl':_0x52fe94,'agentUrl':_0x397b2c,'scriptName':_0x3cf5e7,'scriptPath':_0x288b93,'version':_0x5ac071};removeReferences(_0x205f87,null);return db['Plugin']['create'](_0x43abee)[_0x7199('0x27')](function(_0x8955f0){var _0x524e2d={'role':_0x3fcc5d['body'][_0x7199('0x93')],'userProfileId':_0x3fcc5d[_0x7199('0x94')][_0x7199('0x95')]};if(!_0x524e2d)throw new Error(_0x7199('0x96'));if(_0x524e2d['role']===_0x7199('0x97')){var _0x23508d=_0x8955f0[_0x7199('0x29')]({'plain':!![]});return db[_0x7199('0x98')][_0x7199('0x4e')]({'where':{'name':_0x7199('0x2a'),'userProfileId':_0x524e2d[_0x7199('0x95')]},'raw':!![]})[_0x7199('0x27')](function(_0x55d90e){if(_0x55d90e&&_0x55d90e[_0x7199('0x99')]===0x0){return db[_0x7199('0x2b')]['create']({'name':_0x23508d[_0x7199('0x2e')],'resourceId':_0x23508d['id'],'type':_0x55d90e[_0x7199('0x2e')],'sectionId':_0x55d90e['id']},{})['then'](function(){return _0x8955f0;});}else{return _0x8955f0;}})['catch'](function(_0x89f096){logger[_0x7199('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x89f096);throw _0x89f096;});}return _0x8955f0;})[_0x7199('0x27')](respondWithResult(_0x148b74,null))['catch'](handleError(_0x148b74,null));}});}catch(_0xad4e9c){_0x148b74[_0x7199('0x1b')](0x1f4)[_0x7199('0x2f')](_0xad4e9c);}};function removeReferences(_0xe457d4,_0x199997){try{if(_0xe457d4){fs[_0x7199('0x68')](_0xe457d4);logger['info'](_0x7199('0x9a'));}if(_0x199997){rimraf(_0x199997,function(){});logger[_0x7199('0x69')](_0x7199('0x9b'));}}catch(_0x328f4a){logger[_0x7199('0x2c')](_0x328f4a);}}exports[_0x7199('0x26')]=function(_0x3ffe87,_0x283057,_0x1babb0){return db[_0x7199('0x31')]['find']({'where':{'id':_0x3ffe87[_0x7199('0x4c')]['id']}})[_0x7199('0x27')](handleEntityNotFound(_0x283057,null))[_0x7199('0x27')](saveUpdates(_0x3ffe87['body'],null))[_0x7199('0x27')](respondWithResult(_0x283057,null))[_0x7199('0x4a')](handleError(_0x283057,null));};exports['delete']=function(_0x83ca14,_0x35c848,_0x2faccf){return db[_0x7199('0x31')][_0x7199('0x4e')]({'where':{'id':_0x83ca14[_0x7199('0x4c')]['id']}})[_0x7199('0x27')](function(_0x1362af){if(_0x1362af){return _0x1362af[_0x7199('0x28')]();}})[_0x7199('0x27')](function(_0x1eebdd){rimraf(path[_0x7199('0x51')](config['root'],_0x7199('0x53'),path[_0x7199('0x61')](_0x1eebdd['path'])),function(){});return _0x1eebdd;})[_0x7199('0x27')](handleEntityNotFound(_0x35c848,null))[_0x7199('0x27')](respondWithStatusCode(_0x35c848,null))[_0x7199('0x4a')](handleError(_0x35c848,null));};exports[_0x7199('0x9c')]=function(_0xc3eb96,_0x5b2319,_0x5c2d4a){return BPromise[_0x7199('0x9d')]()[_0x7199('0x27')](function(){if(!_0xc3eb96[_0x7199('0x36')]['path']){throw new Error(_0x7199('0x9e'));}if(!_0xc3eb96[_0x7199('0x36')][_0x7199('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x21271a=_0xc3eb96['query']['hostname']?_0xc3eb96[_0x7199('0x36')][_0x7199('0xa0')]+':'+_0xc3eb96['query']['port']:_0x7199('0xa1')+_0xc3eb96['query'][_0x7199('0x9f')];var _0x2c6c8f=_0xc3eb96[_0x7199('0x36')][_0x7199('0x23')]?_0xc3eb96[_0x7199('0x36')][_0x7199('0x23')]:!![];var _0x46bb92=_0xc3eb96[_0x7199('0x36')][_0x7199('0xa2')]?_0xc3eb96[_0x7199('0x36')][_0x7199('0xa2')]:null;var _0x4166e6={'method':_0xc3eb96['method'],'uri':util['format'](_0x7199('0xa3'),_0x21271a,_0xc3eb96[_0x7199('0x36')]['path']),'json':_0x2c6c8f,'resolveWithFullResponse':!![],'encoding':_0x46bb92,'qs':_0xc3eb96[_0x7199('0x36')]};if(_0xc3eb96['headers']){_0x4166e6[_0x7199('0xa4')]=_0xc3eb96[_0x7199('0xa4')];if(_0x4166e6['headers']['content-length']){delete _0x4166e6['headers'][_0x7199('0xa5')];}}if(_0x4166e6[_0x7199('0xa4')][_0x7199('0xa6')]){delete _0x4166e6[_0x7199('0xa4')]['content-type'];}return rp(_0x4166e6);})[_0x7199('0x27')](function(_0x59c436){if(_0x59c436){_0x5b2319[_0x7199('0x21')](_0x59c436[_0x7199('0xa4')]);logger[_0x7199('0x69')](_0x59c436[_0x7199('0x94')]);if(_[_0x7199('0xa7')](_0xc3eb96[_0x7199('0x36')][_0x7199('0x50')],_0x7199('0x4f'))&&_0x59c436['statusCode']==0x1f4){return _0x5b2319[_0x7199('0x1a')](_0x59c436[_0x7199('0xa8')]);}else{return _0x5b2319[_0x7199('0x1b')](_0x59c436[_0x7199('0xa8')])[_0x7199('0x2f')](_0x59c436[_0x7199('0x94')]);}}else{return _0x5b2319[_0x7199('0x1a')](0xc8);}})[_0x7199('0x4a')](handleError(_0x5b2319,null));};exports[_0x7199('0xa9')]=function(_0x25a850,_0x2f0ddd,_0x2a0465){return BPromise[_0x7199('0x9d')]()['then'](function(){if(!_0x25a850[_0x7199('0x36')]['path']){throw new Error(_0x7199('0x9e'));}if(!_0x25a850['query'][_0x7199('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1d10cb=_0x25a850[_0x7199('0x36')][_0x7199('0xa0')]?_0x25a850[_0x7199('0x36')][_0x7199('0xa0')]+':'+_0x25a850[_0x7199('0x36')][_0x7199('0x9f')]:_0x7199('0xa1')+_0x25a850[_0x7199('0x36')]['port'];var _0x3b40d1=_0x25a850[_0x7199('0x36')][_0x7199('0x23')]?_0x25a850[_0x7199('0x36')][_0x7199('0x23')]:!![];var _0x19dd16=_0x25a850[_0x7199('0x36')][_0x7199('0xa2')]?_0x25a850[_0x7199('0x36')][_0x7199('0xa2')]:null;var _0x1e489c={'method':_0x25a850[_0x7199('0xaa')],'uri':util[_0x7199('0x54')](_0x7199('0xa3'),_0x1d10cb,_0x25a850[_0x7199('0x36')][_0x7199('0x50')]),'json':_0x3b40d1,'resolveWithFullResponse':!![],'encoding':_0x19dd16,'body':_0x25a850[_0x7199('0x94')]};if(_0x25a850[_0x7199('0xa4')]){_0x1e489c[_0x7199('0xa4')]=_0x25a850[_0x7199('0xa4')];if(_0x1e489c[_0x7199('0xa4')][_0x7199('0xa5')]){delete _0x1e489c[_0x7199('0xa4')][_0x7199('0xa5')];}}if(_0x1e489c[_0x7199('0xa4')]['content-type']){delete _0x1e489c[_0x7199('0xa4')][_0x7199('0xa6')];}return rp(_0x1e489c);})['then'](function(_0x5c7066){if(_0x5c7066){_0x2f0ddd[_0x7199('0x21')](_0x5c7066[_0x7199('0xa4')]);logger[_0x7199('0x69')](_0x5c7066[_0x7199('0x94')]);return _0x2f0ddd[_0x7199('0x1b')](_0x5c7066[_0x7199('0xa8')])['send'](_0x5c7066[_0x7199('0x94')]);}else{return _0x2f0ddd['sendStatus'](0xc8);}})['catch'](handleError(_0x2f0ddd,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index c50eb61..813ad66 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 _0x8efc=['hasOwnProperty','hook','exports','Plugin','save','remove','emit'];(function(_0x1099d5,_0xc7ebe8){var _0x466bc1=function(_0x84e2da){while(--_0x84e2da){_0x1099d5['push'](_0x1099d5['shift']());}};_0x466bc1(++_0xc7ebe8);}(_0x8efc,0x8f));var _0xc8ef=function(_0x119e7a,_0x3949d3){_0x119e7a=_0x119e7a-0x0;var _0x1fb90a=_0x8efc[_0x119e7a];return _0x1fb90a;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0xc8ef('0x0')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc8ef('0x1'),'afterUpdate':'update','afterDestroy':_0xc8ef('0x2')};function emitEvent(_0xb39bee){return function(_0x4dbf24,_0x4ee0cc,_0x13b577){PluginEvents['emit'](_0xb39bee+':'+_0x4dbf24['id'],_0x4dbf24);PluginEvents[_0xc8ef('0x3')](_0xb39bee,_0x4dbf24);_0x13b577(null);};}for(var e in events){if(events[_0xc8ef('0x4')](e)){var event=events[e];Plugin[_0xc8ef('0x5')](e,emitEvent(event));}}module[_0xc8ef('0x6')]=PluginEvents; \ No newline at end of file +var _0x6bb4=['update','emit','exports','events','../../mysqldb','Plugin','save'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x33f12d,_0x25b899){_0x33f12d=_0x33f12d-0x0;var _0x5bb00f=_0x6bb4[_0x33f12d];return _0x5bb00f;};'use strict';var EventEmitter=require(_0x46bb('0x0'));var Plugin=require(_0x46bb('0x1'))['db'][_0x46bb('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x46bb('0x3'),'afterUpdate':_0x46bb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x74054){return function(_0x100be2,_0x2eefcc,_0x3c8bef){PluginEvents[_0x46bb('0x5')](_0x74054+':'+_0x100be2['id'],_0x100be2);PluginEvents[_0x46bb('0x5')](_0x74054,_0x100be2);_0x3c8bef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x46bb('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 9706e94..6010c3d 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 _0x0993=['./plugin.attributes','exports','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0x0993,0x13c));var _0x3099=function(_0x31e2b1,_0x3e6a08){_0x31e2b1=_0x31e2b1-0x0;var _0x10c4fc=_0x0993[_0x31e2b1];return _0x10c4fc;};'use strict';var _=require(_0x3099('0x0'));var util=require(_0x3099('0x1'));var logger=require(_0x3099('0x2'))(_0x3099('0x3'));var moment=require(_0x3099('0x4'));var BPromise=require(_0x3099('0x5'));var rp=require(_0x3099('0x6'));var fs=require('fs');var path=require(_0x3099('0x7'));var rimraf=require('rimraf');var config=require(_0x3099('0x8'));var attributes=require(_0x3099('0x9'));module[_0x3099('0xa')]=function(_0x562d2c,_0x479e3a){return _0x562d2c['define'](_0x3099('0xb'),attributes,{'tableName':_0x3099('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacd0=['Plugin','lodash','util','../../config/logger','moment','request-promise','rimraf','./plugin.attributes','exports','define'];(function(_0x3d30fc,_0x3f2e9e){var _0x233d4a=function(_0xe538cb){while(--_0xe538cb){_0x3d30fc['push'](_0x3d30fc['shift']());}};_0x233d4a(++_0x3f2e9e);}(_0xacd0,0xc9));var _0x0acd=function(_0x4d692a,_0x5c1506){_0x4d692a=_0x4d692a-0x0;var _0x9ef565=_0xacd0[_0x4d692a];return _0x9ef565;};'use strict';var _=require(_0x0acd('0x0'));var util=require(_0x0acd('0x1'));var logger=require(_0x0acd('0x2'))('api');var moment=require(_0x0acd('0x3'));var BPromise=require('bluebird');var rp=require(_0x0acd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0acd('0x5'));var config=require('../../config/environment');var attributes=require(_0x0acd('0x6'));module[_0x0acd('0x7')]=function(_0x46ed23,_0x3a5b39){return _0x46ed23[_0x0acd('0x8')](_0x0acd('0x9'),attributes,{'tableName':'plugins','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 1524159..d4ab9be 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 _0x910d=['body','raw','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./plugin.socket','register','request','then','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','Plugin,\x20%s,\x20%s','result','catch','CreatePlugin','Plugin','create'];(function(_0x4699d4,_0x1f20d1){var _0x27ca3e=function(_0x3a9c65){while(--_0x3a9c65){_0x4699d4['push'](_0x4699d4['shift']());}};_0x27ca3e(++_0x1f20d1);}(_0x910d,0x179));var _0xd910=function(_0x499549,_0x2e069b){_0x499549=_0x499549-0x0;var _0x51f5ff=_0x910d[_0x499549];return _0x51f5ff;};'use strict';var _=require(_0xd910('0x0'));var util=require('util');var moment=require(_0xd910('0x1'));var BPromise=require('bluebird');var rs=require(_0xd910('0x2'));var fs=require('fs');var Redis=require(_0xd910('0x3'));var db=require(_0xd910('0x4'))['db'];var utils=require(_0xd910('0x5'));var logger=require(_0xd910('0x6'))(_0xd910('0x7'));var config=require(_0xd910('0x8'));var jayson=require(_0xd910('0x9'));var client=jayson[_0xd910('0xa')][_0xd910('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd910('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd910('0xd'))(new Redis(config[_0xd910('0xc')]));require(_0xd910('0xe'))[_0xd910('0xf')](socket);function respondWithRpcPromise(_0x1c52d9,_0x207651,_0xd4c742){return new BPromise(function(_0x563fd7,_0x83b2fb){return client[_0xd910('0x10')](_0x1c52d9,_0xd4c742)[_0xd910('0x11')](function(_0x3717ac){logger['info']('Plugin,\x20%s,\x20%s',_0x207651,_0xd910('0x12'));logger['debug'](_0xd910('0x13'),_0x207651,_0xd910('0x12'),JSON[_0xd910('0x14')](_0x3717ac));if(_0x3717ac[_0xd910('0x15')]){if(_0x3717ac[_0xd910('0x15')][_0xd910('0x16')]===0x1f4){logger[_0xd910('0x15')]('Plugin,\x20%s,\x20%s',_0x207651,_0x3717ac['error'][_0xd910('0x17')]);return _0x83b2fb(_0x3717ac[_0xd910('0x15')][_0xd910('0x17')]);}logger[_0xd910('0x15')]('Plugin,\x20%s,\x20%s',_0x207651,_0x3717ac['error'][_0xd910('0x17')]);return _0x563fd7(_0x3717ac['error'][_0xd910('0x17')]);}else{logger[_0xd910('0x18')](_0xd910('0x19'),_0x207651,'request\x20sent');_0x563fd7(_0x3717ac[_0xd910('0x1a')]['message']);}})[_0xd910('0x1b')](function(_0x535f7b){logger[_0xd910('0x15')](_0xd910('0x19'),_0x207651,_0x535f7b);_0x83b2fb(_0x535f7b);});});}exports[_0xd910('0x1c')]=function(_0x20252){var _0x114a51=this;return new Promise(function(_0x1d68c8,_0x5293ed){return db[_0xd910('0x1d')][_0xd910('0x1e')](_0x20252[_0xd910('0x1f')],{'raw':_0x20252['options']?_0x20252['options'][_0xd910('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x144924){logger[_0xd910('0x18')](_0xd910('0x1c'),_0x20252);logger[_0xd910('0x21')](_0xd910('0x1c'),_0x20252,JSON[_0xd910('0x14')](_0x144924));_0x1d68c8(_0x144924);})[_0xd910('0x1b')](function(_0x39711c){logger['error'](_0xd910('0x1c'),_0x39711c[_0xd910('0x17')],_0x20252);_0x5293ed(_0x114a51[_0xd910('0x15')](0x1f4,_0x39711c[_0xd910('0x17')]));});});}; \ No newline at end of file +var _0x2f91=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','debug','lodash','util','moment'];(function(_0xaeedf9,_0x2832a5){var _0x3f1174=function(_0x271a9d){while(--_0x271a9d){_0xaeedf9['push'](_0xaeedf9['shift']());}};_0x3f1174(++_0x2832a5);}(_0x2f91,0xdd));var _0x12f9=function(_0x338775,_0x18d242){_0x338775=_0x338775-0x0;var _0x41394d=_0x2f91[_0x338775];return _0x41394d;};'use strict';var _=require(_0x12f9('0x0'));var util=require(_0x12f9('0x1'));var moment=require(_0x12f9('0x2'));var BPromise=require(_0x12f9('0x3'));var rs=require(_0x12f9('0x4'));var fs=require('fs');var Redis=require(_0x12f9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x12f9('0x6'))(_0x12f9('0x7'));var config=require(_0x12f9('0x8'));var jayson=require(_0x12f9('0x9'));var client=jayson['client'][_0x12f9('0xa')]({'port':0x232a});config[_0x12f9('0xb')]=_['defaults'](config[_0x12f9('0xb')],{'host':_0x12f9('0xc'),'port':0x18eb});var socket=require(_0x12f9('0xd'))(new Redis(config[_0x12f9('0xb')]));require('./plugin.socket')[_0x12f9('0xe')](socket);function respondWithRpcPromise(_0x1626f3,_0x2f8f18,_0x4d63ce){return new BPromise(function(_0x10df69,_0x4dd2b5){return client[_0x12f9('0xf')](_0x1626f3,_0x4d63ce)[_0x12f9('0x10')](function(_0xe5a6fc){logger['info'](_0x12f9('0x11'),_0x2f8f18,'request\x20sent');logger['debug'](_0x12f9('0x12'),_0x2f8f18,_0x12f9('0x13'),JSON['stringify'](_0xe5a6fc));if(_0xe5a6fc[_0x12f9('0x14')]){if(_0xe5a6fc[_0x12f9('0x14')][_0x12f9('0x15')]===0x1f4){logger[_0x12f9('0x14')](_0x12f9('0x11'),_0x2f8f18,_0xe5a6fc[_0x12f9('0x14')]['message']);return _0x4dd2b5(_0xe5a6fc[_0x12f9('0x14')][_0x12f9('0x16')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x2f8f18,_0xe5a6fc[_0x12f9('0x14')]['message']);return _0x10df69(_0xe5a6fc[_0x12f9('0x14')][_0x12f9('0x16')]);}else{logger['info'](_0x12f9('0x11'),_0x2f8f18,_0x12f9('0x13'));_0x10df69(_0xe5a6fc[_0x12f9('0x17')][_0x12f9('0x16')]);}})[_0x12f9('0x18')](function(_0x48441a){logger['error'](_0x12f9('0x11'),_0x2f8f18,_0x48441a);_0x4dd2b5(_0x48441a);});});}exports[_0x12f9('0x19')]=function(_0x549373){var _0x2f331e=this;return new Promise(function(_0x294b5b,_0xd69363){return db[_0x12f9('0x1a')][_0x12f9('0x1b')](_0x549373[_0x12f9('0x1c')],{'raw':_0x549373[_0x12f9('0x1d')]?_0x549373['options'][_0x12f9('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1bc018){logger['info'](_0x12f9('0x19'),_0x549373);logger[_0x12f9('0x1f')]('CreatePlugin',_0x549373,JSON['stringify'](_0x1bc018));_0x294b5b(_0x1bc018);})[_0x12f9('0x18')](function(_0x55ef0a){logger[_0x12f9('0x14')](_0x12f9('0x19'),_0x55ef0a[_0x12f9('0x16')],_0x549373);_0xd69363(_0x2f331e[_0x12f9('0x14')](0x1f4,_0x55ef0a['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 7ec5ec1..6b1c88d 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 _0xcd1c=['update','emit','removeListener','length','./plugin.events','save'];(function(_0x262bdf,_0x48e13c){var _0x54744d=function(_0x2e867a){while(--_0x2e867a){_0x262bdf['push'](_0x262bdf['shift']());}};_0x54744d(++_0x48e13c);}(_0xcd1c,0x124));var _0xccd1=function(_0x255dd7,_0x502dd6){_0x255dd7=_0x255dd7-0x0;var _0x1feee3=_0xcd1c[_0x255dd7];return _0x1feee3;};'use strict';var PluginEvents=require(_0xccd1('0x0'));var events=[_0xccd1('0x1'),'remove',_0xccd1('0x2')];function createListener(_0x12ff5e,_0x4492c8){return function(_0x3244cc){_0x4492c8[_0xccd1('0x3')](_0x12ff5e,_0x3244cc);};}function removeListener(_0x33eab7,_0x2abcc4){return function(){PluginEvents[_0xccd1('0x4')](_0x33eab7,_0x2abcc4);};}exports['register']=function(_0x190dfd){for(var _0x45a842=0x0,_0xcda4b9=events[_0xccd1('0x5')];_0x45a842<_0xcda4b9;_0x45a842++){var _0x66ae8=events[_0x45a842];var _0x5e76e8=createListener('plugin:'+_0x66ae8,_0x190dfd);PluginEvents['on'](_0x66ae8,_0x5e76e8);}}; \ No newline at end of file +var _0xf9c5=['emit','removeListener','length','plugin:','./plugin.events','save','remove','update'];(function(_0x5a6997,_0x284ce3){var _0x59aa09=function(_0xb6ab87){while(--_0xb6ab87){_0x5a6997['push'](_0x5a6997['shift']());}};_0x59aa09(++_0x284ce3);}(_0xf9c5,0x104));var _0x5f9c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xf9c5[_0x2070da];return _0x4f9fe1;};'use strict';var PluginEvents=require(_0x5f9c('0x0'));var events=[_0x5f9c('0x1'),_0x5f9c('0x2'),_0x5f9c('0x3')];function createListener(_0x3d0a07,_0x581399){return function(_0x178dae){_0x581399[_0x5f9c('0x4')](_0x3d0a07,_0x178dae);};}function removeListener(_0x24b9b6,_0x1d7fc4){return function(){PluginEvents[_0x5f9c('0x5')](_0x24b9b6,_0x1d7fc4);};}exports['register']=function(_0x268629){for(var _0xfa633b=0x0,_0x5517f6=events[_0x5f9c('0x6')];_0xfa633b<_0x5517f6;_0xfa633b++){var _0x447a6d=events[_0xfa633b];var _0x326eec=createListener(_0x5f9c('0x7')+_0x447a6d,_0x268629);PluginEvents['on'](_0x447a6d,_0x326eec);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 244ff85..206a120 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(_0x43400d,_0xa36a10){var _0xd304cf=function(_0x1a9ccb){while(--_0x1a9ccb){_0x43400d['push'](_0x43400d['shift']());}};_0xd304cf(++_0xa36a10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x156a77,_0x522c13){var _0x32398a=function(_0x55a47a){while(--_0x55a47a){_0x156a77['push'](_0x156a77['shift']());}};_0x32398a(++_0x522c13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 3543aed..26e361a 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 _0x99e9=['../../config/pm2','../../config/logger','api','path','exec','bluebird','status','error','stack','name','send','npm\x20install','info','index','list','then','motion2','length','catch','show','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','Missing\x20name\x20and/or\x20path','update','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id'];(function(_0x584c54,_0x2a2f73){var _0x207b05=function(_0x3911f7){while(--_0x3911f7){_0x584c54['push'](_0x584c54['shift']());}};_0x207b05(++_0x2a2f73);}(_0x99e9,0xb4));var _0x999e=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0x99e9[_0x158da6];return _0x429c30;};'use strict';var _=require('lodash');var pm2=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var path=require(_0x999e('0x3'));var exec=require('child_process')[_0x999e('0x4')];var BPromise=require(_0x999e('0x5'));function handleEntityNotFound(_0x3aac27,_0x4e2112){return function(_0x296411){if(!_0x296411){_0x3aac27['sendStatus'](0x194);;}return _0x296411;};}function respondWithResult(_0x25421f,_0x1bda0a){_0x1bda0a=_0x1bda0a||0xc8;return function(_0x100330){if(_0x100330){return _0x25421f[_0x999e('0x6')](_0x1bda0a)['json'](_0x100330);}return null;};}function handleError(_0x46aeae,_0x38a692){_0x38a692=_0x38a692||0x1f4;return function(_0x343a12){logger[_0x999e('0x7')](_0x343a12[_0x999e('0x8')]);if(_0x343a12[_0x999e('0x9')]){delete _0x343a12[_0x999e('0x9')];}_0x46aeae[_0x999e('0x6')](_0x38a692)[_0x999e('0xa')](_0x343a12);};}function execChildProcess(){return new BPromise(function(_0xf40130,_0x9368cf){exec(_0x999e('0xb'),function(_0x4246b1,_0x188d02,_0x3dfe2d){logger[_0x999e('0xc')](_0x188d02);logger[_0x999e('0xc')](_0x3dfe2d);if(_0x4246b1){logger['error'](_0x4246b1);return _0x9368cf(_0x4246b1);}return _0xf40130(_0x188d02);});});}exports[_0x999e('0xd')]=function(_0x54afad,_0x3e6f5a){return pm2[_0x999e('0xe')]()[_0x999e('0xf')](function(_0x538a92){if(_0x538a92){var _0x28bdd1=_['reject'](_0x538a92,function(_0xa44e4c){return _0xa44e4c['name']==='express'||_0xa44e4c[_0x999e('0x9')]===_0x999e('0x10');});return{'rows':_0x28bdd1,'count':_0x28bdd1[_0x999e('0x11')]};}return null;})[_0x999e('0xf')](respondWithResult(_0x3e6f5a,null))[_0x999e('0x12')](handleError(_0x3e6f5a,null));};exports[_0x999e('0x13')]=function(_0x4aac66,_0x5bb27e){return pm2['describe'](_0x4aac66[_0x999e('0x14')]['id'])[_0x999e('0xf')](respondWithResult(_0x5bb27e,null))[_0x999e('0xf')](handleEntityNotFound(_0x5bb27e,null))[_0x999e('0x12')](handleError(_0x5bb27e,null));};exports[_0x999e('0x15')]=function(_0x3ece5e,_0x5af4c3){if(_0x3ece5e['body'][_0x999e('0x9')]&&_0x3ece5e[_0x999e('0x16')][_0x999e('0x17')]){var _0x510fa2=path[_0x999e('0x18')](__dirname,_0x999e('0x19'),_0x3ece5e[_0x999e('0x16')][_0x999e('0x17')]);var _0x373b80=process[_0x999e('0x1a')]();process[_0x999e('0x1b')](path['dirname'](_0x510fa2));return execChildProcess()['then'](function(_0x11a6bf){process[_0x999e('0x1b')](_0x373b80);return pm2['start']({'name':_0x3ece5e[_0x999e('0x16')][_0x999e('0x9')],'script':_0x510fa2});})[_0x999e('0xf')](function(_0x13027c){pm2[_0x999e('0x1c')]();return _0x13027c[0x0];})[_0x999e('0xf')](respondWithResult(_0x5af4c3,0xc9))['catch'](handleError(_0x5af4c3,null));}else{return _0x5af4c3[_0x999e('0x6')](0x1f4)[_0x999e('0xa')]({'message':_0x999e('0x1d')});}};exports[_0x999e('0x1e')]=function(_0x1b7adb,_0x1d2dc6){if(_0x1b7adb[_0x999e('0x16')]['id']){delete _0x1b7adb['body']['id'];}var _0x28f803={'online':'restart','stopped':'stop'};if(_0x28f803[_0x999e('0x1f')](_0x1b7adb[_0x999e('0x16')][_0x999e('0x6')])){return pm2[_0x28f803[_0x1b7adb['body'][_0x999e('0x6')]]](_0x1b7adb[_0x999e('0x14')]['id'])[_0x999e('0xf')](respondWithResult(_0x1d2dc6,0xc8))[_0x999e('0x12')](handleError(_0x1d2dc6,null));}else{return _0x1d2dc6[_0x999e('0x6')](0x1f4)[_0x999e('0xa')]({'message':_0x999e('0x20')});}};exports[_0x999e('0x21')]=function(_0x27102b,_0x3ddacb){if(_0x27102b['body']['id']){delete _0x27102b[_0x999e('0x16')]['id'];}if(_0x27102b[_0x999e('0x14')]['id']){return pm2[_0x999e('0x22')](_0x27102b['params']['id'])[_0x999e('0xf')](function(_0x5af72c){pm2['dump']();return _0x5af72c[0x0];})[_0x999e('0xf')](respondWithResult(_0x3ddacb,null))[_0x999e('0x12')](handleError(_0x3ddacb,null));}else{return _0x3ddacb['status'](0x1f4)['send']({'message':_0x999e('0x23')});}}; \ No newline at end of file +var _0xee5b=['exec','bluebird','sendStatus','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script','join','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/logger','api','child_process'];(function(_0x403ff8,_0x459e58){var _0xfdee81=function(_0x2f65f8){while(--_0x2f65f8){_0x403ff8['push'](_0x403ff8['shift']());}};_0xfdee81(++_0x459e58);}(_0xee5b,0x1f4));var _0xbee5=function(_0xe18ed9,_0x1c128c){_0xe18ed9=_0xe18ed9-0x0;var _0x39e9b3=_0xee5b[_0xe18ed9];return _0x39e9b3;};'use strict';var _=require(_0xbee5('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var path=require('path');var exec=require(_0xbee5('0x3'))[_0xbee5('0x4')];var BPromise=require(_0xbee5('0x5'));function handleEntityNotFound(_0x210159,_0x4bd202){return function(_0x5200b1){if(!_0x5200b1){_0x210159[_0xbee5('0x6')](0x194);;}return _0x5200b1;};}function respondWithResult(_0x2c0bde,_0xab6e4d){_0xab6e4d=_0xab6e4d||0xc8;return function(_0x804ab8){if(_0x804ab8){return _0x2c0bde['status'](_0xab6e4d)['json'](_0x804ab8);}return null;};}function handleError(_0x53d5b9,_0x5baf5c){_0x5baf5c=_0x5baf5c||0x1f4;return function(_0x5536bd){logger[_0xbee5('0x7')](_0x5536bd[_0xbee5('0x8')]);if(_0x5536bd[_0xbee5('0x9')]){delete _0x5536bd[_0xbee5('0x9')];}_0x53d5b9['status'](_0x5baf5c)[_0xbee5('0xa')](_0x5536bd);};}function execChildProcess(){return new BPromise(function(_0x305921,_0x9b3d3b){exec(_0xbee5('0xb'),function(_0x16377d,_0x1509c7,_0x105e16){logger[_0xbee5('0xc')](_0x1509c7);logger[_0xbee5('0xc')](_0x105e16);if(_0x16377d){logger['error'](_0x16377d);return _0x9b3d3b(_0x16377d);}return _0x305921(_0x1509c7);});});}exports[_0xbee5('0xd')]=function(_0x532a78,_0x183877){return pm2[_0xbee5('0xe')]()[_0xbee5('0xf')](function(_0x593ecb){if(_0x593ecb){var _0x5092f2=_[_0xbee5('0x10')](_0x593ecb,function(_0x4cf5a8){return _0x4cf5a8[_0xbee5('0x9')]==='express'||_0x4cf5a8[_0xbee5('0x9')]===_0xbee5('0x11');});return{'rows':_0x5092f2,'count':_0x5092f2[_0xbee5('0x12')]};}return null;})['then'](respondWithResult(_0x183877,null))[_0xbee5('0x13')](handleError(_0x183877,null));};exports[_0xbee5('0x14')]=function(_0x5a0ae5,_0x254dd3){return pm2[_0xbee5('0x15')](_0x5a0ae5[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x254dd3,null))[_0xbee5('0xf')](handleEntityNotFound(_0x254dd3,null))[_0xbee5('0x13')](handleError(_0x254dd3,null));};exports[_0xbee5('0x17')]=function(_0xa50ec9,_0x20cf52){if(_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')]&&_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x19')]){var _0x40a06=path[_0xbee5('0x1a')](__dirname,'../../files/plugins',_0xa50ec9['body'][_0xbee5('0x19')]);var _0x48bfb5=process[_0xbee5('0x1b')]();process[_0xbee5('0x1c')](path[_0xbee5('0x1d')](_0x40a06));return execChildProcess()[_0xbee5('0xf')](function(_0x3f23c5){process[_0xbee5('0x1c')](_0x48bfb5);return pm2[_0xbee5('0x1e')]({'name':_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')],'script':_0x40a06});})['then'](function(_0x5b43b3){pm2['dump']();return _0x5b43b3[0x0];})['then'](respondWithResult(_0x20cf52,0xc9))['catch'](handleError(_0x20cf52,null));}else{return _0x20cf52[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x20')});}};exports[_0xbee5('0x21')]=function(_0x169042,_0x20e7e8){if(_0x169042[_0xbee5('0x18')]['id']){delete _0x169042['body']['id'];}var _0x36b50f={'online':_0xbee5('0x22'),'stopped':_0xbee5('0x23')};if(_0x36b50f[_0xbee5('0x24')](_0x169042[_0xbee5('0x18')]['status'])){return pm2[_0x36b50f[_0x169042[_0xbee5('0x18')][_0xbee5('0x1f')]]](_0x169042[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x20e7e8,0xc8))[_0xbee5('0x13')](handleError(_0x20e7e8,null));}else{return _0x20e7e8[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x25')});}};exports[_0xbee5('0x26')]=function(_0x59c2e4,_0x22df5f){if(_0x59c2e4['body']['id']){delete _0x59c2e4[_0xbee5('0x18')]['id'];}if(_0x59c2e4['params']['id']){return pm2[_0xbee5('0x27')](_0x59c2e4['params']['id'])[_0xbee5('0xf')](function(_0x5c1109){pm2[_0xbee5('0x28')]();return _0x5c1109[0x0];})[_0xbee5('0xf')](respondWithResult(_0x22df5f,null))[_0xbee5('0x13')](handleError(_0x22df5f,null));}else{return _0x22df5f[_0xbee5('0x1f')](0x1f4)['send']({'message':_0xbee5('0x29')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index caf0a44..7c724fb 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 _0x431b=['get','/queues','isAuthenticated','getQueues','exports','express','Router','../../components/auth/service'];(function(_0xe43bdd,_0x19de11){var _0x55a390=function(_0x44204f){while(--_0x44204f){_0xe43bdd['push'](_0xe43bdd['shift']());}};_0x55a390(++_0x19de11);}(_0x431b,0x18d));var _0xb431=function(_0x2f7c3c,_0x52b503){_0x2f7c3c=_0x2f7c3c-0x0;var _0x56ea57=_0x431b[_0x2f7c3c];return _0x56ea57;};'use strict';var express=require(_0xb431('0x0'));var router=express[_0xb431('0x1')]();var auth=require(_0xb431('0x2'));var controller=require('./realtime.controller');router[_0xb431('0x3')](_0xb431('0x4'),auth[_0xb431('0x5')](),controller[_0xb431('0x6')]);module[_0xb431('0x7')]=router; \ No newline at end of file +var _0xf03d=['Router','../../components/auth/service','get','/queues','isAuthenticated','getQueues','exports','express'];(function(_0x4ce540,_0x4f878b){var _0xd74e77=function(_0x70e89e){while(--_0x70e89e){_0x4ce540['push'](_0x4ce540['shift']());}};_0xd74e77(++_0x4f878b);}(_0xf03d,0x1a7));var _0xdf03=function(_0x532704,_0x576ef2){_0x532704=_0x532704-0x0;var _0x1b4635=_0xf03d[_0x532704];return _0x1b4635;};'use strict';var express=require(_0xdf03('0x0'));var router=express[_0xdf03('0x1')]();var auth=require(_0xdf03('0x2'));var controller=require('./realtime.controller');router[_0xdf03('0x3')](_0xdf03('0x4'),auth[_0xdf03('0x5')](),controller[_0xdf03('0x6')]);module[_0xdf03('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 74b54d2..48c5d52 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 _0x81c6=['rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','QueueCampaigns','Queues','filter','UserProfile','findAndCountAll','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','available','waiting','talking','originated','message','dialMethod','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','get','paused','outbound','pTalking','agents','find','rows','merge','pick','getAgents','online','getMembers','length','loggedInDb','User','Queue','Pause','findAll','QueueId','push','catch','lodash','api','../../mysqldb','client','http','offset','undefined','count','limit','status','json','error','name','send','getQueues','chat','sms','openchannel','fax','whatsapp','voice','resolve','then','channel','includes','Invalid\x20channel','query','toLowerCase','map'];(function(_0x363bb0,_0x2b4322){var _0x2773ea=function(_0x5660fe){while(--_0x5660fe){_0x363bb0['push'](_0x363bb0['shift']());}};_0x2773ea(++_0x2b4322);}(_0x81c6,0x1d5));var _0x681c=function(_0x1eff7c,_0x357ad0){_0x1eff7c=_0x1eff7c-0x0;var _0x304854=_0x81c6[_0x1eff7c];return _0x304854;};'use strict';var util=require('util');var _=require(_0x681c('0x0'));var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var client=jayson[_0x681c('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x681c('0x3')][_0x681c('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x1f2032,_0x1d31c8){return function(_0x4ea522){if(_0x4ea522){var _0x45331=typeof _0x1d31c8[_0x681c('0x5')]==='undefined'&&typeof _0x1d31c8['limit']===_0x681c('0x6');var _0x3fac39=_0x4ea522[_0x681c('0x7')];var _0x5de78e=_0x45331?0x0:_0x1d31c8['offset'];var _0x3e3770=_0x45331?_0x4ea522['count']:_0x1d31c8[_0x681c('0x5')]+_0x1d31c8[_0x681c('0x8')];var _0x2ac84d;if(_0x3e3770>=_0x3fac39){_0x3e3770=_0x3fac39;_0x2ac84d=0xc8;}else{_0x2ac84d=0xce;}_0x1f2032[_0x681c('0x9')](_0x2ac84d);return _0x1f2032['set']('Content-Range',_0x5de78e+'-'+_0x3e3770+'/'+_0x3fac39)[_0x681c('0xa')](_0x4ea522);}return null;};}function handleError(_0x1d1d5d,_0x2d379b){_0x2d379b=_0x2d379b||0x1f4;return function(_0x50cae8){logger[_0x681c('0xb')](_0x50cae8['stack']);if(_0x50cae8[_0x681c('0xc')]){delete _0x50cae8['name'];}_0x1d1d5d[_0x681c('0x9')](_0x2d379b)[_0x681c('0xd')](_0x50cae8);};}exports[_0x681c('0xe')]=function(_0x416723,_0x402aa2){var _0x2bc3fb=['mail',_0x681c('0xf'),_0x681c('0x10'),_0x681c('0x11'),_0x681c('0x12'),_0x681c('0x13'),_0x681c('0x14')];var _0x4e7df2={'count':0x0,'rows':[]},_0xf3c042={},_0x42f506;Promise[_0x681c('0x15')]()[_0x681c('0x16')](function(){if(_0x416723['query'][_0x681c('0x17')]){if(!_[_0x681c('0x18')](_0x2bc3fb,_0x416723['query'][_0x681c('0x17')]['toLowerCase']()))throw new Error(_0x681c('0x19'));_0x42f506=_0x416723[_0x681c('0x1a')][_0x681c('0x17')][_0x681c('0x1b')]();}var _0x4169b9=_['startCase'](_0x42f506)+'Queue';var _0x57772d=_[_0x681c('0x1c')](db[_0x4169b9][_0x681c('0x1d')],function(_0x3adfe3){return{'name':_0x3adfe3[_0x681c('0x1e')],'type':_0x3adfe3[_0x681c('0x1f')][_0x681c('0x20')]};});_0xf3c042=qs[_0x681c('0x21')](_0x57772d,_0x416723);if(_0x416723[_0x681c('0x22')][_0x681c('0x23')]===_0x681c('0x22')){var _0x2be552={'params':{'id':_0x416723[_0x681c('0x22')][_0x681c('0x24')]},'query':{'section':_0x42f506===_0x681c('0x14')&&_0x416723[_0x681c('0x1a')][_0x681c('0x1f')]==='outbound'?_0x681c('0x25'):_['startCase'](_0x42f506)+_0x681c('0x26'),'type':_0x416723['query']['type'],'nolimit':!![],'sort':_0x681c('0xc'),'filter':_0x416723[_0x681c('0x1a')][_0x681c('0x27')]}};return db[_0x681c('0x28')]['getResources'](_0x2be552);}return db[_0x4169b9][_0x681c('0x29')](_0xf3c042);})[_0x681c('0x16')](function(_0x2fde4b){_0x4e7df2[_0x681c('0x7')]=_0x2fde4b[_0x681c('0x7')];var _0x204006=_0x42f506===_0x681c('0x14')?client:routingClient;return _0x204006['request'](_[_0x681c('0x2a')](_0x42f506)+_0x681c('0x26'),_0x416723)[_0x681c('0x16')](function(_0x4af6aa){if(_0x4af6aa[_0x681c('0xb')])throw new Error(util[_0x681c('0x2b')](_0x681c('0x2c'),_0x42f506));var _0x5e8f58=_0x4af6aa[_0x681c('0x2d')];var _0x574ce7=['loggedIn',_0x681c('0x2e'),_0x681c('0x2f'),_0x681c('0x30'),'paused'];if(_0x42f506===_0x681c('0x14')&&_0x416723['query'][_0x681c('0x1f')]==='outbound'){_0x574ce7['push']('pTalking',_0x681c('0x31'),_0x681c('0x32'),'dialActive',_0x681c('0x33'),'Trunk','startPredictive',_0x681c('0x34'),'erlangCalls',_0x681c('0x35'),_0x681c('0x36'),_0x681c('0x37'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x681c('0x38'),_0x681c('0x39'),'predictiveIntervalTotalCalls',_0x681c('0x3a'),_0x681c('0x3b'),_0x681c('0x3c'),'predictiveIntervalAvgHoldtime',_0x681c('0x3d'));}var _0x147729=_0x2fde4b['rows'][_0x681c('0x1c')](function(_0x3c6851){var _0x83953c=_0x3c6851[_0x681c('0x3e')]({'plain':!![]});_0x83953c[_0x681c('0x3f')]=0x0;_0x83953c['loggedInDb']=0x0;_0x83953c['loggedIn']=0x0;_0x83953c[_0x681c('0x2e')]=0x0;_0x83953c[_0x681c('0x3f')]=0x0;_0x83953c['waiting']=0x0;if(_0x42f506===_0x681c('0x14')){_0x83953c[_0x681c('0x30')]=0x0;if(_0x416723['query'][_0x681c('0x1f')]===_0x681c('0x40')){_0x83953c[_0x681c('0x41')]=0x0;_0x83953c[_0x681c('0x31')]=0x0;}}_0x83953c[_0x681c('0x42')]=[];var _0x42c6bf=_[_0x681c('0x43')](_0x5e8f58[_0x681c('0x44')],['id',_0x83953c['id']]);if(_0x42c6bf)_[_0x681c('0x45')](_0x83953c,_[_0x681c('0x46')](_0x42c6bf,_0x574ce7));if(_0x42f506==='voice'){return _0x3c6851[_0x681c('0x47')]({'attributes':['id',_0x681c('0xc'),_0x681c('0x48')],'joinTableAttributes':[],'raw':!![]})[_0x681c('0x16')](function(_0x174f86){return _0x3c6851[_0x681c('0x49')]({'raw':!![]})[_0x681c('0x16')](function(_0x465083){for(var _0x2b8e6d=0x0;_0x2b8e6d<_0x174f86[_0x681c('0x4a')];_0x2b8e6d++){var _0x440f98=_[_0x681c('0x43')](_0x465083,['UserId',_0x174f86[_0x2b8e6d]['id']]);var _0x2143a9={'id':_0x174f86[_0x2b8e6d]['id'],'name':_0x174f86[_0x2b8e6d]['name'],'online':Boolean(_0x174f86[_0x2b8e6d]['online']),'paused':_0x440f98?Boolean(_0x440f98[_0x681c('0x3f')]):![]};if(_0x2143a9[_0x681c('0x48')])_0x83953c[_0x681c('0x4b')]++;if(_0x2143a9[_0x681c('0x3f')])_0x83953c['paused']++;_0x83953c[_0x681c('0x42')]['push'](_0x2143a9);}return _0x83953c;});});}else{var _0x4e72e4=_0x681c('0x4c')+_[_0x681c('0x2a')](_0x42f506)+_0x681c('0x4d');var _0x3912f2=_0x42f506+_0x681c('0x4e');return db[_0x4e72e4][_0x681c('0x4f')]({'where':{[_['startCase'](_0x42f506)+_0x681c('0x50')]:_0x3c6851['id']},'raw':!![]})[_0x681c('0x16')](function(_0x4e2705){return db['User'][_0x681c('0x4f')]({'attributes':['id','name',_0x681c('0x48'),_0x3912f2],'where':{'id':_['map'](_0x4e2705,'UserId'),'role':'agent'},'raw':!![]});})[_0x681c('0x16')](function(_0x41f2a2){for(var _0x8043a9=0x0;_0x8043a9<_0x41f2a2['length'];_0x8043a9++){var _0x3a9b26={'id':_0x41f2a2[_0x8043a9]['id'],'name':_0x41f2a2[_0x8043a9][_0x681c('0xc')],'online':Boolean(_0x41f2a2[_0x8043a9]['online']),'paused':Boolean(_0x41f2a2[_0x8043a9][_0x3912f2])};if(_0x3a9b26[_0x681c('0x48')])_0x83953c[_0x681c('0x4b')]++;if(_0x3a9b26[_0x681c('0x3f')])_0x83953c[_0x681c('0x3f')]++;_0x83953c['agents'][_0x681c('0x51')](_0x3a9b26);}return _0x83953c;});}});return Promise['all'](_0x147729);});})[_0x681c('0x16')](function(_0x29141d){_0x4e7df2[_0x681c('0x44')]=_0x29141d;return _0x4e7df2;})['then'](respondWithFilteredResult(_0x402aa2,_0xf3c042))[_0x681c('0x52')](handleError(_0x402aa2,null));}; \ No newline at end of file +var _0x4137=['../../config/logger','api','../../mysqldb','client','http','offset','undefined','count','limit','status','Content-Range','json','error','send','mail','openchannel','whatsapp','resolve','then','query','includes','channel','toLowerCase','startCase','Queue','map','fieldName','key','getOptions','user','role','userProfileId','voice','outbound','Queues','name','filter','UserProfile','getResources','findAndCountAll','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','available','waiting','talking','paused','type','push','pTalking','originated','dialActive','Trunk','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','loggedInDb','loggedIn','online','getMembers','find','UserId','agents','User','Pause','findAll','QueueId','agent','length','all','catch','util','lodash','jayson/promise','../../components/parsers/qs'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x4137,0xf8));var _0x7413=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4137[_0x5d6456];return _0x4d66c1;};'use strict';var util=require(_0x7413('0x0'));var _=require(_0x7413('0x1'));var jayson=require(_0x7413('0x2'));var qs=require(_0x7413('0x3'));var logger=require(_0x7413('0x4'))(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var client=jayson[_0x7413('0x7')][_0x7413('0x8')]({'port':0x232a});var routingClient=jayson[_0x7413('0x7')][_0x7413('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x3bb181,_0x4fbade){return function(_0xc808cd){if(_0xc808cd){var _0x188d89=typeof _0x4fbade[_0x7413('0x9')]===_0x7413('0xa')&&typeof _0x4fbade['limit']===_0x7413('0xa');var _0x120dc2=_0xc808cd['count'];var _0x422bf5=_0x188d89?0x0:_0x4fbade[_0x7413('0x9')];var _0x50fde0=_0x188d89?_0xc808cd[_0x7413('0xb')]:_0x4fbade[_0x7413('0x9')]+_0x4fbade[_0x7413('0xc')];var _0x3e026b;if(_0x50fde0>=_0x120dc2){_0x50fde0=_0x120dc2;_0x3e026b=0xc8;}else{_0x3e026b=0xce;}_0x3bb181[_0x7413('0xd')](_0x3e026b);return _0x3bb181['set'](_0x7413('0xe'),_0x422bf5+'-'+_0x50fde0+'/'+_0x120dc2)[_0x7413('0xf')](_0xc808cd);}return null;};}function handleError(_0x4bf07d,_0x18a874){_0x18a874=_0x18a874||0x1f4;return function(_0xa26ca4){logger[_0x7413('0x10')](_0xa26ca4['stack']);if(_0xa26ca4['name']){delete _0xa26ca4['name'];}_0x4bf07d[_0x7413('0xd')](_0x18a874)[_0x7413('0x11')](_0xa26ca4);};}exports['getQueues']=function(_0x1a42aa,_0x45bef0){var _0x4955d3=[_0x7413('0x12'),'chat','sms',_0x7413('0x13'),'fax',_0x7413('0x14'),'voice'];var _0x2036b6={'count':0x0,'rows':[]},_0x3230d8={},_0x19157f;Promise[_0x7413('0x15')]()[_0x7413('0x16')](function(){if(_0x1a42aa[_0x7413('0x17')]['channel']){if(!_[_0x7413('0x18')](_0x4955d3,_0x1a42aa[_0x7413('0x17')][_0x7413('0x19')][_0x7413('0x1a')]()))throw new Error('Invalid\x20channel');_0x19157f=_0x1a42aa[_0x7413('0x17')][_0x7413('0x19')][_0x7413('0x1a')]();}var _0x20d3d2=_[_0x7413('0x1b')](_0x19157f)+_0x7413('0x1c');var _0x4886e3=_[_0x7413('0x1d')](db[_0x20d3d2]['rawAttributes'],function(_0x5f12a2){return{'name':_0x5f12a2[_0x7413('0x1e')],'type':_0x5f12a2['type'][_0x7413('0x1f')]};});_0x3230d8=qs[_0x7413('0x20')](_0x4886e3,_0x1a42aa);if(_0x1a42aa[_0x7413('0x21')][_0x7413('0x22')]===_0x7413('0x21')){var _0x346ce8={'params':{'id':_0x1a42aa[_0x7413('0x21')][_0x7413('0x23')]},'query':{'section':_0x19157f===_0x7413('0x24')&&_0x1a42aa['query']['type']===_0x7413('0x25')?'QueueCampaigns':_[_0x7413('0x1b')](_0x19157f)+_0x7413('0x26'),'type':_0x1a42aa[_0x7413('0x17')]['type'],'nolimit':!![],'sort':_0x7413('0x27'),'filter':_0x1a42aa[_0x7413('0x17')][_0x7413('0x28')]}};return db[_0x7413('0x29')][_0x7413('0x2a')](_0x346ce8);}return db[_0x20d3d2][_0x7413('0x2b')](_0x3230d8);})['then'](function(_0x24dce7){_0x2036b6['count']=_0x24dce7[_0x7413('0xb')];var _0x23e682=_0x19157f===_0x7413('0x24')?client:routingClient;return _0x23e682[_0x7413('0x2c')](_[_0x7413('0x1b')](_0x19157f)+_0x7413('0x26'),_0x1a42aa)['then'](function(_0x1ffb6f){if(_0x1ffb6f[_0x7413('0x10')])throw new Error(util[_0x7413('0x2d')](_0x7413('0x2e'),_0x19157f));var _0x291268=_0x1ffb6f[_0x7413('0x2f')];var _0x185cfe=['loggedIn',_0x7413('0x30'),_0x7413('0x31'),_0x7413('0x32'),_0x7413('0x33')];if(_0x19157f===_0x7413('0x24')&&_0x1a42aa['query'][_0x7413('0x34')]==='outbound'){_0x185cfe[_0x7413('0x35')](_0x7413('0x36'),_0x7413('0x37'),'message',_0x7413('0x38'),'dialMethod',_0x7413('0x39'),_0x7413('0x3a'),'startProgressive','erlangCalls',_0x7413('0x3b'),_0x7413('0x3c'),_0x7413('0x3d'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x7413('0x3e'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0x7413('0x3f'),'predictiveIntervalDroppedCallsTimeout',_0x7413('0x40'),_0x7413('0x41'),_0x7413('0x42'));}var _0x2b178c=_0x24dce7[_0x7413('0x43')]['map'](function(_0xa58bd2){var _0x8dc047=_0xa58bd2[_0x7413('0x44')]({'plain':!![]});_0x8dc047[_0x7413('0x33')]=0x0;_0x8dc047[_0x7413('0x45')]=0x0;_0x8dc047[_0x7413('0x46')]=0x0;_0x8dc047[_0x7413('0x30')]=0x0;_0x8dc047[_0x7413('0x33')]=0x0;_0x8dc047[_0x7413('0x31')]=0x0;if(_0x19157f===_0x7413('0x24')){_0x8dc047[_0x7413('0x32')]=0x0;if(_0x1a42aa[_0x7413('0x17')]['type']===_0x7413('0x25')){_0x8dc047['pTalking']=0x0;_0x8dc047['originated']=0x0;}}_0x8dc047['agents']=[];var _0x53c47c=_['find'](_0x291268[_0x7413('0x43')],['id',_0x8dc047['id']]);if(_0x53c47c)_['merge'](_0x8dc047,_['pick'](_0x53c47c,_0x185cfe));if(_0x19157f===_0x7413('0x24')){return _0xa58bd2['getAgents']({'attributes':['id','name',_0x7413('0x47')],'joinTableAttributes':[],'raw':!![]})[_0x7413('0x16')](function(_0x18674c){return _0xa58bd2[_0x7413('0x48')]({'raw':!![]})[_0x7413('0x16')](function(_0x57cb9e){for(var _0x3f421c=0x0;_0x3f421c<_0x18674c['length'];_0x3f421c++){var _0x2e9e18=_[_0x7413('0x49')](_0x57cb9e,[_0x7413('0x4a'),_0x18674c[_0x3f421c]['id']]);var _0xfe0daa={'id':_0x18674c[_0x3f421c]['id'],'name':_0x18674c[_0x3f421c][_0x7413('0x27')],'online':Boolean(_0x18674c[_0x3f421c][_0x7413('0x47')]),'paused':_0x2e9e18?Boolean(_0x2e9e18[_0x7413('0x33')]):![]};if(_0xfe0daa[_0x7413('0x47')])_0x8dc047[_0x7413('0x45')]++;if(_0xfe0daa[_0x7413('0x33')])_0x8dc047[_0x7413('0x33')]++;_0x8dc047[_0x7413('0x4b')][_0x7413('0x35')](_0xfe0daa);}return _0x8dc047;});});}else{var _0x58ab17=_0x7413('0x4c')+_[_0x7413('0x1b')](_0x19157f)+_0x7413('0x1c');var _0x1fbbd5=_0x19157f+_0x7413('0x4d');return db[_0x58ab17][_0x7413('0x4e')]({'where':{[_[_0x7413('0x1b')](_0x19157f)+_0x7413('0x4f')]:_0xa58bd2['id']},'raw':!![]})[_0x7413('0x16')](function(_0x1c3af5){return db[_0x7413('0x4c')]['findAll']({'attributes':['id',_0x7413('0x27'),'online',_0x1fbbd5],'where':{'id':_[_0x7413('0x1d')](_0x1c3af5,_0x7413('0x4a')),'role':_0x7413('0x50')},'raw':!![]});})[_0x7413('0x16')](function(_0x479049){for(var _0x148b69=0x0;_0x148b69<_0x479049[_0x7413('0x51')];_0x148b69++){var _0x7de9d8={'id':_0x479049[_0x148b69]['id'],'name':_0x479049[_0x148b69][_0x7413('0x27')],'online':Boolean(_0x479049[_0x148b69][_0x7413('0x47')]),'paused':Boolean(_0x479049[_0x148b69][_0x1fbbd5])};if(_0x7de9d8['online'])_0x8dc047['loggedInDb']++;if(_0x7de9d8[_0x7413('0x33')])_0x8dc047['paused']++;_0x8dc047['agents'][_0x7413('0x35')](_0x7de9d8);}return _0x8dc047;});}});return Promise[_0x7413('0x52')](_0x2b178c);});})['then'](function(_0x2aa12c){_0x2036b6['rows']=_0x2aa12c;return _0x2036b6;})['then'](respondWithFilteredResult(_0x45bef0,_0x3230d8))[_0x7413('0x53')](handleError(_0x45bef0,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 660fe1f..99175d2 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x36e8bb,_0x20e767){var _0x40f797=function(_0x81cab4){while(--_0x81cab4){_0x36e8bb['push'](_0x36e8bb['shift']());}};_0x40f797(++_0x20e767);}(_0xedd9,0xfc));var _0x9edd=function(_0x3049ae,_0x462eec){_0x3049ae=_0x3049ae-0x0;var _0x3b9910=_0xedd9[_0x3049ae];return _0x3b9910;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x584b1e,_0x3f380e){var _0x56e471=function(_0x315cae){while(--_0x315cae){_0x584b1e['push'](_0x584b1e['shift']());}};_0x56e471(++_0x3f380e);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 6c2c7fd..0d1252e 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 _0xca84=['sequelize','exports','INTEGER','DATE','STRING'];(function(_0x13078b,_0x3bdc58){var _0x4605cf=function(_0x4025d9){while(--_0x4025d9){_0x13078b['push'](_0x13078b['shift']());}};_0x4605cf(++_0x3bdc58);}(_0xca84,0xf5));var _0x4ca8=function(_0x302f4e,_0x399ac7){_0x302f4e=_0x302f4e-0x0;var _0x887dc5=_0xca84[_0x302f4e];return _0x887dc5;};'use strict';var Sequelize=require(_0x4ca8('0x0'));module[_0x4ca8('0x1')]={'state':{'type':Sequelize[_0x4ca8('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4ca8('0x3')]},'uniqueid':{'type':Sequelize[_0x4ca8('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x4ca8('0x3')]},'ringtime':{'type':Sequelize[_0x4ca8('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4ca8('0x4')]},'campaigntype':{'type':Sequelize[_0x4ca8('0x4')]},'membername':{'type':Sequelize[_0x4ca8('0x4')]}}; \ No newline at end of file +var _0x0f89=['INTEGER','DATE','STRING','sequelize','exports'];(function(_0x51e99b,_0x2d7d42){var _0x2af489=function(_0xade5a3){while(--_0xade5a3){_0x51e99b['push'](_0x51e99b['shift']());}};_0x2af489(++_0x2d7d42);}(_0x0f89,0x111));var _0x90f8=function(_0x1202a2,_0x2912d9){_0x1202a2=_0x1202a2-0x0;var _0x3a8ac6=_0x0f89[_0x1202a2];return _0x3a8ac6;};'use strict';var Sequelize=require(_0x90f8('0x0'));module[_0x90f8('0x1')]={'state':{'type':Sequelize[_0x90f8('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x90f8('0x3')]},'uniqueid':{'type':Sequelize[_0x90f8('0x4')]},'starttime':{'type':Sequelize[_0x90f8('0x3')]},'responsetime':{'type':Sequelize[_0x90f8('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x90f8('0x4')]},'campaigntype':{'type':Sequelize[_0x90f8('0x4')]},'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 ba5cdfe..eef7a96 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 _0x0aff=['../../config/logger','api','moment','path','rimraf','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0xff1756,_0x11edb1){var _0x49d43f=function(_0x538068){while(--_0x538068){_0xff1756['push'](_0xff1756['shift']());}};_0x49d43f(++_0x11edb1);}(_0x0aff,0x132));var _0xf0af=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x0aff[_0x4c6d6f];return _0x2d4478;};'use strict';var _=require(_0xf0af('0x0'));var util=require(_0xf0af('0x1'));var logger=require(_0xf0af('0x2'))(_0xf0af('0x3'));var moment=require(_0xf0af('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0af('0x5'));var rimraf=require(_0xf0af('0x6'));var config=require('../../config/environment');var attributes=require(_0xf0af('0x7'));module['exports']=function(_0x2abeed,_0x3413d2){return _0x2abeed[_0xf0af('0x8')](_0xf0af('0x9'),attributes,{'tableName':_0xf0af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd66b=['../../config/logger','api','moment','bluebird','path','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util'];(function(_0x2ce57b,_0x57a83a){var _0x59bae9=function(_0x2e5611){while(--_0x2e5611){_0x2ce57b['push'](_0x2ce57b['shift']());}};_0x59bae9(++_0x57a83a);}(_0xd66b,0x153));var _0xbd66=function(_0x31f390,_0x1c5c83){_0x31f390=_0x31f390-0x0;var _0x2d7885=_0xd66b[_0x31f390];return _0x2d7885;};'use strict';var _=require(_0xbd66('0x0'));var util=require(_0xbd66('0x1'));var logger=require(_0xbd66('0x2'))(_0xbd66('0x3'));var moment=require(_0xbd66('0x4'));var BPromise=require(_0xbd66('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd66('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbd66('0x7'));module[_0xbd66('0x8')]=function(_0x321af6,_0x890554){return _0x321af6[_0xbd66('0x9')](_0xbd66('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 7b65607..ea09011 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 _0x8d91=['request','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','then','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x2586a2,_0x69eb21){var _0x4a29bf=function(_0x2503be){while(--_0x2503be){_0x2586a2['push'](_0x2586a2['shift']());}};_0x4a29bf(++_0x69eb21);}(_0x8d91,0x1e4));var _0x18d9=function(_0x2718c9,_0x55ad41){_0x2718c9=_0x2718c9-0x0;var _0x59fdeb=_0x8d91[_0x2718c9];return _0x59fdeb;};'use strict';var _=require(_0x18d9('0x0'));var util=require('util');var moment=require(_0x18d9('0x1'));var BPromise=require(_0x18d9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18d9('0x3'));var db=require(_0x18d9('0x4'))['db'];var utils=require(_0x18d9('0x5'));var logger=require(_0x18d9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x18d9('0x7'));var client=jayson[_0x18d9('0x8')][_0x18d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55a238,_0x142112,_0x36c9d0){return new BPromise(function(_0x32a41e,_0x458aef){return client[_0x18d9('0xa')](_0x55a238,_0x36c9d0)['then'](function(_0x448e93){logger[_0x18d9('0xb')](_0x18d9('0xc'),_0x142112,'request\x20sent');logger['debug'](_0x18d9('0xd'),_0x142112,_0x18d9('0xe'),JSON[_0x18d9('0xf')](_0x448e93));if(_0x448e93[_0x18d9('0x10')]){if(_0x448e93[_0x18d9('0x10')]['code']===0x1f4){logger[_0x18d9('0x10')](_0x18d9('0xc'),_0x142112,_0x448e93[_0x18d9('0x10')][_0x18d9('0x11')]);return _0x458aef(_0x448e93[_0x18d9('0x10')]['message']);}logger[_0x18d9('0x10')](_0x18d9('0xc'),_0x142112,_0x448e93[_0x18d9('0x10')][_0x18d9('0x11')]);return _0x32a41e(_0x448e93[_0x18d9('0x10')]['message']);}else{logger[_0x18d9('0xb')](_0x18d9('0xc'),_0x142112,'request\x20sent');_0x32a41e(_0x448e93['result'][_0x18d9('0x11')]);}})[_0x18d9('0x12')](function(_0x39c74d){logger[_0x18d9('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x142112,_0x39c74d);_0x458aef(_0x39c74d);});});}exports[_0x18d9('0x13')]=function(_0x4f71a6){var _0x2880f9=this;return new Promise(function(_0x47cb89,_0xc5ad9d){return db[_0x18d9('0x14')]['create'](_0x4f71a6[_0x18d9('0x15')],{'raw':_0x4f71a6[_0x18d9('0x16')]?_0x4f71a6[_0x18d9('0x16')][_0x18d9('0x17')]===undefined?!![]:![]:!![]})[_0x18d9('0x18')](function(_0x3d4c8c){logger['info'](_0x18d9('0x13'),_0x4f71a6);logger[_0x18d9('0x19')]('CreateReportAgentPreview',_0x4f71a6,JSON[_0x18d9('0xf')](_0x3d4c8c));_0x47cb89(_0x3d4c8c);})[_0x18d9('0x12')](function(_0x1f3c25){logger['error'](_0x18d9('0x13'),_0x1f3c25[_0x18d9('0x11')],_0x4f71a6);_0xc5ad9d(_0x2880f9[_0x18d9('0x10')](0x1f4,_0x1f3c25[_0x18d9('0x11')]));});});}; \ No newline at end of file +var _0x6666=['then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','raw','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x35aa18,_0x106eab){var _0x151ef2=function(_0x57d056){while(--_0x57d056){_0x35aa18['push'](_0x35aa18['shift']());}};_0x151ef2(++_0x106eab);}(_0x6666,0xa0));var _0x6666=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0x6666[_0x4afac5];return _0x2404b3;};'use strict';var _=require(_0x6666('0x0'));var util=require('util');var moment=require(_0x6666('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6666('0x2'))['db'];var utils=require(_0x6666('0x3'));var logger=require(_0x6666('0x4'))(_0x6666('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6666('0x6')][_0x6666('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45bdc7,_0x5b3111,_0x324bad){return new BPromise(function(_0x3f06a9,_0x5d3b5e){return client['request'](_0x45bdc7,_0x324bad)[_0x6666('0x8')](function(_0x1398f1){logger[_0x6666('0x9')](_0x6666('0xa'),_0x5b3111,_0x6666('0xb'));logger[_0x6666('0xc')](_0x6666('0xd'),_0x5b3111,_0x6666('0xb'),JSON[_0x6666('0xe')](_0x1398f1));if(_0x1398f1[_0x6666('0xf')]){if(_0x1398f1[_0x6666('0xf')][_0x6666('0x10')]===0x1f4){logger['error'](_0x6666('0xa'),_0x5b3111,_0x1398f1[_0x6666('0xf')]['message']);return _0x5d3b5e(_0x1398f1[_0x6666('0xf')][_0x6666('0x11')]);}logger['error'](_0x6666('0xa'),_0x5b3111,_0x1398f1['error'][_0x6666('0x11')]);return _0x3f06a9(_0x1398f1[_0x6666('0xf')]['message']);}else{logger[_0x6666('0x9')](_0x6666('0xa'),_0x5b3111,_0x6666('0xb'));_0x3f06a9(_0x1398f1['result'][_0x6666('0x11')]);}})[_0x6666('0x12')](function(_0x4731fe){logger[_0x6666('0xf')](_0x6666('0xa'),_0x5b3111,_0x4731fe);_0x5d3b5e(_0x4731fe);});});}exports[_0x6666('0x13')]=function(_0x5dd84f){var _0x3ed446=this;return new Promise(function(_0x221c92,_0x1cb409){return db[_0x6666('0x14')][_0x6666('0x15')](_0x5dd84f[_0x6666('0x16')],{'raw':_0x5dd84f['options']?_0x5dd84f['options'][_0x6666('0x17')]===undefined?!![]:![]:!![]})[_0x6666('0x8')](function(_0x4fd2ca){logger[_0x6666('0x9')](_0x6666('0x13'),_0x5dd84f);logger['debug'](_0x6666('0x13'),_0x5dd84f,JSON[_0x6666('0xe')](_0x4fd2ca));_0x221c92(_0x4fd2ca);})[_0x6666('0x12')](function(_0x83ce37){logger['error'](_0x6666('0x13'),_0x83ce37['message'],_0x5dd84f);_0x1cb409(_0x3ed446[_0x6666('0xf')](0x1f4,_0x83ce37[_0x6666('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 39077b6..f5fb246 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 _0xcf33=['openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','Router','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions'];(function(_0x34d003,_0x1c6826){var _0x401183=function(_0x17dd6f){while(--_0x17dd6f){_0x34d003['push'](_0x34d003['shift']());}};_0x401183(++_0x1c6826);}(_0xcf33,0x114));var _0x3cf3=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xcf33[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x3cf3('0x0'));var util=require(_0x3cf3('0x1'));var path=require(_0x3cf3('0x2'));var express=require('express');var router=express[_0x3cf3('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x3cf3('0x4'));router[_0x3cf3('0x5')](_0x3cf3('0x6'),auth['isAuthenticated'](),controller[_0x3cf3('0x7')]);router['get'](_0x3cf3('0x8'),auth[_0x3cf3('0x9')](),controller['voiceChannelMixMonitor']);router[_0x3cf3('0x5')](_0x3cf3('0xa'),auth[_0x3cf3('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0x3cf3('0x5')](_0x3cf3('0xb'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0xc')]);router[_0x3cf3('0x5')](_0x3cf3('0xd'),auth['isAuthenticated'](),controller['chatQueues']);router[_0x3cf3('0x5')](_0x3cf3('0xe'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0xf')]);router[_0x3cf3('0x5')](_0x3cf3('0x10'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0x3cf3('0x5')]('/openchannel/queues',auth[_0x3cf3('0x9')](),controller['openchannelQueues']);router[_0x3cf3('0x5')](_0x3cf3('0x11'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x12')]);router[_0x3cf3('0x5')](_0x3cf3('0x13'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x14')]);router[_0x3cf3('0x5')](_0x3cf3('0x15'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x16')]);router[_0x3cf3('0x5')](_0x3cf3('0x17'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x18')]);router[_0x3cf3('0x5')](_0x3cf3('0x19'),auth[_0x3cf3('0x9')](),controller['voiceQueuesChannels']);router[_0x3cf3('0x5')](_0x3cf3('0x1a'),auth[_0x3cf3('0x9')](),controller['voiceQueuesChannel']);router['get'](_0x3cf3('0x1b'),auth['isAuthenticated'](),controller[_0x3cf3('0x1c')]);router[_0x3cf3('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1d')]);router[_0x3cf3('0x5')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x3cf3('0x1e')]);router['put']('/voice/queues/:id',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1f')]);router['get']('/outbound',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x20')]);router[_0x3cf3('0x5')](_0x3cf3('0x21'),auth['isAuthenticated'](),controller[_0x3cf3('0x22')]);router[_0x3cf3('0x5')]('/agents',auth['isAuthenticated'](),controller[_0x3cf3('0x23')]);router[_0x3cf3('0x24')](_0x3cf3('0x25'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x26')]);router[_0x3cf3('0x5')](_0x3cf3('0x27'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x28')]);router[_0x3cf3('0x5')](_0x3cf3('0x29'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x2a')]);router[_0x3cf3('0x5')](_0x3cf3('0x2b'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x2c')]);router[_0x3cf3('0x5')](_0x3cf3('0x2d'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x2e')]);router['get'](_0x3cf3('0x2f'),auth['isAuthenticated'](),controller[_0x3cf3('0x30')]);router[_0x3cf3('0x5')](_0x3cf3('0x31'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x32')]);router[_0x3cf3('0x5')](_0x3cf3('0x33'),auth['isAuthenticated'](),controller[_0x3cf3('0x34')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x3cf3('0x35'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x3cf3('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x36')]);router[_0x3cf3('0x5')](_0x3cf3('0x37'),auth['isAuthenticated'](),controller[_0x3cf3('0x38')]);router[_0x3cf3('0x39')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0x3cf3('0x3a')](_0x3cf3('0x3b')));router[_0x3cf3('0x5')](_0x3cf3('0x3c'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3d')]);router[_0x3cf3('0x39')](_0x3cf3('0x3e'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3a')]('chat'));router[_0x3cf3('0x5')]('/chat/queues/:id',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3f')]);router[_0x3cf3('0x39')](_0x3cf3('0x40'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3a')](_0x3cf3('0x41')));router['get'](_0x3cf3('0x42'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x43')]);router[_0x3cf3('0x39')](_0x3cf3('0x44'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3a')](_0x3cf3('0x45')));router['get'](_0x3cf3('0x46'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x47')]);router['post'](_0x3cf3('0x48'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3a')](_0x3cf3('0x49')));router[_0x3cf3('0x39')](_0x3cf3('0x4a'),auth['isAuthenticated'](),controller[_0x3cf3('0x3a')](_0x3cf3('0x4b')));router[_0x3cf3('0x5')](_0x3cf3('0x4c'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x4d')]);router[_0x3cf3('0x5')](_0x3cf3('0x4e'),auth['isAuthenticated'](),controller[_0x3cf3('0x4f')]);router['post']('/agents/:id/notify',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x50')]);module[_0x3cf3('0x51')]=router; \ No newline at end of file +var _0xdbaa=['agents','/agents/:id/capacity','agentCapacity','/trunks','/campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents'];(function(_0x192105,_0x1e7690){var _0x5bb1c0=function(_0x218b46){while(--_0x218b46){_0x192105['push'](_0x192105['shift']());}};_0x5bb1c0(++_0x1e7690);}(_0xdbaa,0xc3));var _0xadba=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xdbaa[_0x725b8e];return _0x43ac45;};'use strict';var multer=require(_0xadba('0x0'));var util=require(_0xadba('0x1'));var path=require('path');var express=require(_0xadba('0x2'));var router=express[_0xadba('0x3')]();var auth=require(_0xadba('0x4'));var controller=require(_0xadba('0x5'));router[_0xadba('0x6')](_0xadba('0x7'),auth[_0xadba('0x8')](),controller[_0xadba('0x9')]);router[_0xadba('0x6')](_0xadba('0xa'),auth[_0xadba('0x8')](),controller[_0xadba('0xb')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0xadba('0xc')]);router['get'](_0xadba('0xd'),auth[_0xadba('0x8')](),controller['voiceQueues']);router['get']('/chat/queues',auth['isAuthenticated'](),controller[_0xadba('0xe')]);router['get'](_0xadba('0xf'),auth[_0xadba('0x8')](),controller['mailQueues']);router[_0xadba('0x6')](_0xadba('0x10'),auth['isAuthenticated'](),controller[_0xadba('0x11')]);router[_0xadba('0x6')](_0xadba('0x12'),auth[_0xadba('0x8')](),controller[_0xadba('0x13')]);router[_0xadba('0x6')](_0xadba('0x14'),auth['isAuthenticated'](),controller[_0xadba('0x15')]);router['get'](_0xadba('0x16'),auth[_0xadba('0x8')](),controller[_0xadba('0x17')]);router['get']('/fax/queues',auth[_0xadba('0x8')](),controller[_0xadba('0x18')]);router[_0xadba('0x6')](_0xadba('0x19'),auth[_0xadba('0x8')](),controller[_0xadba('0x1a')]);router['get']('/voice/queues/channels',auth[_0xadba('0x8')](),controller[_0xadba('0x1b')]);router[_0xadba('0x6')](_0xadba('0x1c'),auth[_0xadba('0x8')](),controller[_0xadba('0x1d')]);router[_0xadba('0x6')](_0xadba('0x1e'),auth[_0xadba('0x8')](),controller[_0xadba('0x1f')]);router[_0xadba('0x6')](_0xadba('0x20'),auth['isAuthenticated'](),controller[_0xadba('0x21')]);router[_0xadba('0x6')](_0xadba('0x22'),auth[_0xadba('0x8')](),controller[_0xadba('0x23')]);router[_0xadba('0x24')](_0xadba('0x22'),auth[_0xadba('0x8')](),controller[_0xadba('0x25')]);router[_0xadba('0x6')](_0xadba('0x26'),auth[_0xadba('0x8')](),controller[_0xadba('0x27')]);router[_0xadba('0x6')](_0xadba('0x28'),auth[_0xadba('0x8')](),controller['outboundChannels']);router[_0xadba('0x6')](_0xadba('0x29'),auth['isAuthenticated'](),controller[_0xadba('0x2a')]);router[_0xadba('0x24')](_0xadba('0x2b'),auth[_0xadba('0x8')](),controller[_0xadba('0x2c')]);router[_0xadba('0x6')]('/telephones',auth[_0xadba('0x8')](),controller['telephones']);router[_0xadba('0x6')](_0xadba('0x2d'),auth['isAuthenticated'](),controller['trunks']);router[_0xadba('0x6')](_0xadba('0x2e'),auth[_0xadba('0x8')](),controller['campaigns']);router['get'](_0xadba('0x2f'),auth['isAuthenticated'](),controller[_0xadba('0x30')]);router['get']('/chat/queues/waitinginteractions',auth[_0xadba('0x8')](),controller[_0xadba('0x31')]);router['get']('/mail/queues/waitinginteractions',auth[_0xadba('0x8')](),controller[_0xadba('0x32')]);router[_0xadba('0x6')](_0xadba('0x33'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xadba('0x6')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0xadba('0x34')]);router[_0xadba('0x6')](_0xadba('0x35'),auth['isAuthenticated'](),controller[_0xadba('0x36')]);router[_0xadba('0x6')]('/whatsapp/queues/waitinginteractions',auth[_0xadba('0x8')](),controller[_0xadba('0x37')]);router['get'](_0xadba('0x38'),auth[_0xadba('0x8')](),controller[_0xadba('0x39')]);router[_0xadba('0x3a')](_0xadba('0x3b'),auth[_0xadba('0x8')](),controller[_0xadba('0x3c')]('mail'));router['get'](_0xadba('0x3d'),auth[_0xadba('0x8')](),controller['showMailQueues']);router[_0xadba('0x3a')]('/chat/queues/:id/notify',auth[_0xadba('0x8')](),controller['queueNotify'](_0xadba('0x3e')));router['get'](_0xadba('0x3f'),auth['isAuthenticated'](),controller[_0xadba('0x40')]);router[_0xadba('0x3a')](_0xadba('0x41'),auth[_0xadba('0x8')](),controller['queueNotify'](_0xadba('0x42')));router[_0xadba('0x6')](_0xadba('0x43'),auth['isAuthenticated'](),controller[_0xadba('0x44')]);router[_0xadba('0x3a')]('/openchannel/queues/:id/notify',auth[_0xadba('0x8')](),controller[_0xadba('0x3c')]('openchannel'));router[_0xadba('0x6')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0xadba('0x45')]);router[_0xadba('0x3a')](_0xadba('0x46'),auth[_0xadba('0x8')](),controller[_0xadba('0x3c')](_0xadba('0x47')));router['post'](_0xadba('0x48'),auth[_0xadba('0x8')](),controller[_0xadba('0x3c')](_0xadba('0x49')));router[_0xadba('0x6')](_0xadba('0x4a'),auth[_0xadba('0x8')](),controller[_0xadba('0x4b')]);router[_0xadba('0x6')]('/whatsapp/queues/:id',auth[_0xadba('0x8')](),controller[_0xadba('0x4c')]);router[_0xadba('0x3a')](_0xadba('0x4d'),auth['isAuthenticated'](),controller[_0xadba('0x4e')]);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 7fda0e5..fd9e0c4 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 _0xa630=['user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','update','agentTransferTimeout','bluebird','moment','../../mysqldb','api','client','http','then','error','code','message','result','json','stack','name','status','isNil','rows','find','voiceChannels','VoiceChannels','catch','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity'];(function(_0x53273a,_0x5ed978){var _0x3c41db=function(_0x491a57){while(--_0x491a57){_0x53273a['push'](_0x53273a['shift']());}};_0x3c41db(++_0x5ed978);}(_0xa630,0xbe));var _0x0a63=function(_0xf6e574,_0x457137){_0xf6e574=_0xf6e574-0x0;var _0x1e13cd=_0xa630[_0xf6e574];return _0x1e13cd;};'use strict';var BPromise=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x0a63('0x2'))['db'];var logger=require('../../config/logger')(_0x0a63('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232a});var mailClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232b});var routingClient=jayson[_0x0a63('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2760b0,_0x3d5f0b,_0xc2dcd7){return new BPromise(function(_0x41d21d,_0x12a7df){var _0x2a1bd7=_0xc2dcd7?_0xc2dcd7:amiClient;return _0x2a1bd7['request'](_0x2760b0,_0x3d5f0b)[_0x0a63('0x6')](function(_0xb714c7){if(_0xb714c7[_0x0a63('0x7')]){if(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x8')]===0x1f4){return _0x12a7df(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}return _0x41d21d(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}else{_0x41d21d(_0xb714c7[_0x0a63('0xa')]);}})['catch'](function(_0x345f56){_0x12a7df(_0x345f56);});});}function respondWithResult(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xc8;return function(_0x3d6323){if(_0x3d6323){return _0x420043['status'](_0x2fce86)[_0x0a63('0xb')](_0x3d6323);}return _0x420043['sendStatus'](0x194);};}function handleError(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0x1f4;return function(_0x26b2bc){logger[_0x0a63('0x7')](_0x26b2bc[_0x0a63('0xc')]);if(_0x26b2bc[_0x0a63('0xd')]){delete _0x26b2bc[_0x0a63('0xd')];}_0x331e99[_0x0a63('0xe')](_0x19e922)['send'](_0x26b2bc);};}function findById(_0x47788e){return function(_0x56b314){if(!_[_0x0a63('0xf')](_0x47788e)&&!_[_0x0a63('0xf')](_0x56b314)&&!_[_0x0a63('0xf')](_0x56b314[_0x0a63('0x10')])){return _[_0x0a63('0x11')](_0x56b314[_0x0a63('0x10')],function(_0x30f292){return _0x30f292['id']==_0x47788e;});}return null;};}exports[_0x0a63('0x12')]=function(_0x2fd06c,_0x3cc74d){return respondWithRpcPromise(_0x0a63('0x13'),_0x2fd06c['query'])['then'](respondWithResult(_0x3cc74d,null))[_0x0a63('0x14')](handleError(_0x3cc74d,null));};exports['voiceChannelMixMonitor']=function(_0x2fc87c,_0x5937df){return respondWithRpcPromise(_0x0a63('0x15'),_[_0x0a63('0x16')](_0x2fc87c[_0x0a63('0x17')],_0x2fc87c[_0x0a63('0x18')]))['then'](respondWithResult(_0x5937df,null))[_0x0a63('0x14')](handleError(_0x5937df,null));};exports['voiceChannelStopMixMonitor']=function(_0x3a7f9d,_0x11fe64){return respondWithRpcPromise(_0x0a63('0x19'),_[_0x0a63('0x16')](_0x3a7f9d[_0x0a63('0x17')],_0x3a7f9d[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x11fe64,null))[_0x0a63('0x14')](handleError(_0x11fe64,null));};exports['voiceQueues']=function(_0x5e5987,_0x55fb70){return respondWithRpcPromise('VoiceQueues',_0x5e5987[_0x0a63('0x17')])['then'](respondWithResult(_0x55fb70,null))['catch'](handleError(_0x55fb70,null));};exports[_0x0a63('0x1a')]=function(_0x1d5448,_0x362d6a){return respondWithRpcPromise(_0x0a63('0x1b'),_0x1d5448['query'])[_0x0a63('0x6')](findById(_0x1d5448[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x362d6a,null))['catch'](handleError(_0x362d6a,null));};exports[_0x0a63('0x1c')]=function(_0xcf409,_0x1b7bdb){return respondWithRpcPromise(_0x0a63('0x1d'),_[_0x0a63('0x16')](_0xcf409[_0x0a63('0x1e')],_0xcf409[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x1b7bdb,null))['catch'](handleError(_0x1b7bdb,null));};exports[_0x0a63('0x1f')]=function(_0x574c06,_0x151cb6){return respondWithRpcPromise(_0x0a63('0x20'),_[_0x0a63('0x16')](_0x574c06[_0x0a63('0x17')],_0x574c06[_0x0a63('0x18')]))['then'](respondWithResult(_0x151cb6,null))[_0x0a63('0x14')](handleError(_0x151cb6,null));};exports[_0x0a63('0x21')]=function(_0x33a717,_0x46fb40){return respondWithRpcPromise('VoiceQueuesChannels',_0x33a717[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x46fb40,null))['catch'](handleError(_0x46fb40,null));};exports['voiceQueuesChannel']=function(_0x34a170,_0x51d959){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0a63('0x16')](_0x34a170[_0x0a63('0x17')],_0x34a170['params']))[_0x0a63('0x6')](respondWithResult(_0x51d959,null))[_0x0a63('0x14')](handleError(_0x51d959,null));};exports[_0x0a63('0x22')]=function(_0x333130,_0x395cce){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x333130[_0x0a63('0x17')],_0x333130[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x395cce,null))[_0x0a63('0x14')](handleError(_0x395cce,null));};exports[_0x0a63('0x23')]=function(_0x273bcf,_0x59912d){return respondWithRpcPromise(_0x0a63('0x24'),_[_0x0a63('0x16')](_0x273bcf['query'],_0x273bcf[_0x0a63('0x18')]))['then'](respondWithResult(_0x59912d,null))['catch'](handleError(_0x59912d,null));};exports[_0x0a63('0x25')]=function(_0x232388,_0xdc602c){return respondWithRpcPromise('Outbound',_0x232388[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0xdc602c,null))[_0x0a63('0x14')](handleError(_0xdc602c,null));};exports[_0x0a63('0x26')]=function(_0x3f88a1,_0x876bc6){return respondWithRpcPromise(_0x0a63('0x27'),_0x3f88a1['query'])[_0x0a63('0x6')](respondWithResult(_0x876bc6,null))[_0x0a63('0x14')](handleError(_0x876bc6,null));};exports[_0x0a63('0x28')]=function(_0x53d034,_0x5d9952){var _0x28f904;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')])[_0x0a63('0x6')](function(_0x128e9e){_0x28f904=_0x128e9e;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')],routingClient);})[_0x0a63('0x6')](function(_0x46b6ee){return _[_0x0a63('0x16')]({},_0x46b6ee,_0x28f904);})['then'](respondWithResult(_0x5d9952,null))[_0x0a63('0x14')](handleError(_0x5d9952,null));};exports[_0x0a63('0x29')]=function(_0x4234cd,_0x2ccd99){if(_0x4234cd[_0x0a63('0x1e')]&&_0x4234cd[_0x0a63('0x1e')]['interaction']&&_0x4234cd[_0x0a63('0x2a')]&&_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')]){for(var _0x793502 in _0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')]){if(_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x0a63('0x2c')](_0x793502)){db[_0x0a63('0x2d')][_0x0a63('0x2e')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'exitAt':null,'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]&&_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]['length']?{'$notIn':_0x4234cd[_0x0a63('0x1e')]['interaction'][_0x793502]}:{'$ne':null}}})['then'](function(_0xd9eddc){var _0x223ecf=moment()[_0x0a63('0x30')](_0x0a63('0x31'));for(var _0xd9149d=0x0,_0x9c89ed=_0xd9eddc[_0x0a63('0x32')];_0xd9149d<_0x9c89ed;_0xd9149d+=0x1){_0xd9eddc[_0xd9149d][_0x0a63('0x33')]({'exitAt':_0x223ecf});}});for(var _0x3d0667=0x0;_0x3d0667<_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x0a63('0x32')];_0x3d0667+=0x1){db[_0x0a63('0x2d')][_0x0a63('0x34')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x3d0667],'exitAt':null},'defaults':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')]['name'],'interface':_[_0x0a63('0xf')](_0x4234cd[_0x0a63('0x2a')]['interface'])?util['format']('SIP/%s',_0x4234cd['user'][_0x0a63('0xd')]):_0x4234cd[_0x0a63('0x2a')]['interface'],'type':_0x0a63('0x2f'),'enterAt':moment()['format'](_0x0a63('0x31')),'role':_0x0a63('0x35'),'internal':_0x4234cd['user']['internal'],'uniqueid':_0x4234cd['body'][_0x0a63('0x2b')][_0x793502][_0x3d0667]}});}}}}return respondWithRpcPromise(_0x0a63('0x36'),{'id':_0x4234cd[_0x0a63('0x18')]['id'],'capacity':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x37')]},routingClient)['then'](respondWithResult(_0x2ccd99,null))[_0x0a63('0x14')](handleError(_0x2ccd99,null));};exports[_0x0a63('0x38')]=function(_0x22b3ea,_0x10adf1){return respondWithRpcPromise(_0x0a63('0x39'),_0x22b3ea['query'])[_0x0a63('0x6')](respondWithResult(_0x10adf1,null))[_0x0a63('0x14')](handleError(_0x10adf1,null));};exports[_0x0a63('0x3a')]=function(_0x1fbd2b,_0x4f3414){return respondWithRpcPromise(_0x0a63('0x3b'),_0x1fbd2b[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4f3414,null))[_0x0a63('0x14')](handleError(_0x4f3414,null));};exports[_0x0a63('0x3c')]=function(_0x258ed3,_0x4d4e20){return respondWithRpcPromise(_0x0a63('0x3d'),_0x258ed3[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4d4e20,null))[_0x0a63('0x14')](handleError(_0x4d4e20,null));};exports['chatQueues']=function(_0x4c1e34,_0x2ac98b){return respondWithRpcPromise(_0x0a63('0x3e'),_0x4c1e34[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x2ac98b,null))[_0x0a63('0x14')](handleError(_0x2ac98b,null));};exports['showChatQueues']=function(_0x5e6aae,_0x58b3a8){return respondWithRpcPromise(_0x0a63('0x3e'),_0x5e6aae['query'],routingClient)[_0x0a63('0x6')](findById(_0x5e6aae[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x58b3a8,null))['catch'](handleError(_0x58b3a8,null));};exports['mailQueues']=function(_0x2d63c6,_0x226279){return respondWithRpcPromise(_0x0a63('0x3f'),_0x2d63c6[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x226279,null))[_0x0a63('0x14')](handleError(_0x226279,null));};exports[_0x0a63('0x40')]=function(_0xc3415c,_0xe454ef){return respondWithRpcPromise(_0x0a63('0x3f'),_0xc3415c[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0xc3415c[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0xe454ef,null))['catch'](handleError(_0xe454ef,null));};exports['mailAccounts']=function(_0x1adea6,_0x24c9e0){return respondWithRpcPromise('MailAccounts',_0x1adea6[_0x0a63('0x17')],mailClient)[_0x0a63('0x6')](respondWithResult(_0x24c9e0,null))['catch'](handleError(_0x24c9e0,null));};exports[_0x0a63('0x41')]=function(_0x3053e4,_0x5e5495){return respondWithRpcPromise('OpenchannelQueues',_0x3053e4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5e5495,null))[_0x0a63('0x14')](handleError(_0x5e5495,null));};exports['showOpenchannelQueues']=function(_0x116e05,_0x375acd){return respondWithRpcPromise(_0x0a63('0x42'),_0x116e05[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x116e05['params']['id']))[_0x0a63('0x6')](respondWithResult(_0x375acd,null))[_0x0a63('0x14')](handleError(_0x375acd,null));};exports[_0x0a63('0x43')]=function(_0x1fa9cd,_0x295c06){return respondWithRpcPromise(_0x0a63('0x44'),_0x1fa9cd[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x295c06,null))[_0x0a63('0x14')](handleError(_0x295c06,null));};exports[_0x0a63('0x45')]=function(_0x252f70,_0x1155f1){return respondWithRpcPromise(_0x0a63('0x44'),_0x252f70[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x252f70[_0x0a63('0x18')]['id']))['then'](respondWithResult(_0x1155f1,null))['catch'](handleError(_0x1155f1,null));};exports[_0x0a63('0x46')]=function(_0x30e5f0,_0x4137bc){return respondWithRpcPromise(_0x0a63('0x47'),_0x30e5f0[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x4137bc,null))[_0x0a63('0x14')](handleError(_0x4137bc,null));};exports[_0x0a63('0x48')]=function(_0x1aefc4,_0x2a2f1b){return respondWithRpcPromise(_0x0a63('0x47'),_0x1aefc4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x1aefc4[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x2a2f1b,null))[_0x0a63('0x14')](handleError(_0x2a2f1b,null));};exports[_0x0a63('0x49')]=function(_0x485969,_0x25276f){return respondWithRpcPromise('FaxQueues',_0x485969[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x25276f,null))['catch'](handleError(_0x25276f,null));};exports['showFaxQueues']=function(_0x480acb,_0x31481f){return respondWithRpcPromise(_0x0a63('0x4a'),_0x480acb[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x480acb[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x31481f,null))['catch'](handleError(_0x31481f,null));};exports['faxAccounts']=function(_0x5cb325,_0x1213a5){return respondWithRpcPromise(_0x0a63('0x4b'),_0x5cb325[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x1213a5,null))['catch'](handleError(_0x1213a5,null));};exports[_0x0a63('0x4c')]=function(_0x5ed2db,_0x5de3de){return respondWithRpcPromise(_0x0a63('0x4d'),_0x5ed2db['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5de3de,null))[_0x0a63('0x14')](handleError(_0x5de3de,null));};exports['mailQueuesWaitingInteractions']=function(_0x267583,_0x4d1e35){return respondWithRpcPromise(_0x0a63('0x4e'),_0x267583['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x4d1e35,null))[_0x0a63('0x14')](handleError(_0x4d1e35,null));};exports[_0x0a63('0x4f')]=function(_0x4fba49,_0x3b8442){return respondWithRpcPromise(_0x0a63('0x50'),_0x4fba49[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x3b8442,null))[_0x0a63('0x14')](handleError(_0x3b8442,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x55174c,_0x550dbb){return respondWithRpcPromise(_0x0a63('0x50'),_0x55174c['query'],routingClient)[_0x0a63('0x6')](function(_0xa27da4){if(_0x55174c[_0x0a63('0x17')][_0x0a63('0x51')]!==undefined){var _0x5540c6=_(_0xa27da4[_0x0a63('0x10')])[_0x0a63('0x52')]([_0x55174c['query'][_0x0a63('0x51')],_0x55174c[_0x0a63('0x18')]['id']])[_0x0a63('0x53')](_0x0a63('0x54'))[_0x0a63('0x55')]()['value']();return _0xa27da4[_0x0a63('0x10')][_0x0a63('0x52')](function(_0x3941f6){return _0x5540c6['indexOf'](_0x3941f6['queue_id'])>-0x1;});}else{return _0xa27da4['rows'][_0x0a63('0x52')](function(_0x3b94ae){return _0x3b94ae[_0x0a63('0x54')]===parseInt(_0x55174c[_0x0a63('0x18')]['id']);});}})[_0x0a63('0x6')](respondWithResult(_0x550dbb,null))[_0x0a63('0x14')](handleError(_0x550dbb,null));};exports[_0x0a63('0x56')]=function(_0x37255d,_0x1dc593){return respondWithRpcPromise(_0x0a63('0x57'),_0x37255d['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x1dc593,null))[_0x0a63('0x14')](handleError(_0x1dc593,null));};exports[_0x0a63('0x58')]=function(_0x229954,_0x3d62ca){return respondWithRpcPromise(_0x0a63('0x59'),_0x229954['query'],routingClient)['then'](respondWithResult(_0x3d62ca,null))[_0x0a63('0x14')](handleError(_0x3d62ca,null));};exports[_0x0a63('0x5a')]=function(_0x425c8c,_0x3caea6){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x425c8c[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x3caea6,null))[_0x0a63('0x14')](handleError(_0x3caea6,null));};exports[_0x0a63('0x5b')]=function(_0x1e256e){return function(_0xee586,_0x486ffc){var _0x3710fa,_0x2173ee;var _0x430065=_[_0x0a63('0x5c')](_0x1e256e);var _0x540953=_0x1e256e==='chat'?_0x0a63('0x5d'):'Account';return db[_0x430065+_0x0a63('0x5e')][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0xee586[_0x0a63('0x18')]['id']}})[_0x0a63('0x6')](function(_0x65a390){if(_['isNil'](_0x65a390)){throw new Error(_0x430065+_0x0a63('0x60'));}_0x3710fa=_0x65a390;return db[_0x430065+_0x0a63('0x61')][_0x0a63('0x5f')]({'where':{'id':_0xee586[_0x0a63('0x1e')][_0x0a63('0x62')]},'include':[{'model':db[_0x430065+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x430065+_0x540953],'as':'Account'}]});})[_0x0a63('0x6')](function(_0x1a329c){if(_[_0x0a63('0xf')](_0x1a329c)){throw new Error(_0x430065+_0x0a63('0x64'));}_0x2173ee=_0x1a329c;return _0x1a329c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0a63('0x6')](function(){var _0x148bbd={'uniqueid':_0x1e256e+'.'+_0x2173ee['id']+'.'+_0x2173ee[_0x0a63('0x63')]['id'],'FromUserId':_0xee586['user']['id'],'type':_0x0a63('0x65')};_0x148bbd[_0x430065+_0x0a63('0x66')]=_0x2173ee['id'];_0x148bbd[_0x430065+_0x0a63('0x67')]=_0x2173ee['Interaction']['id'];_0x148bbd[_0x0a63('0x68')+_0x430065+_0x540953+'Id']=_0x2173ee[_0x0a63('0x69')]['id'];_0x148bbd['To'+_0x430065+_0x0a63('0x6a')]=_0x3710fa['id'];return db[_0x430065+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x148bbd);})[_0x0a63('0x6')](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x1e256e,'interaction':_0x2173ee[_0x0a63('0x63')],'message':_0x2173ee,'account':_0x2173ee[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x65'),'appdata':_0x3710fa[_0x0a63('0xd')]+','+(_0x2173ee[_0x0a63('0x69')][_0x0a63('0x6e')]||0x12c),'interval':_0x0a63('0x6f')}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x486ffc,null))[_0x0a63('0x14')](handleError(_0x486ffc,null));};};exports['agentNotify']=function(_0x3ddf5e,_0x5f0510){var _0x19a46f,_0x36fd48;if(_['isNil'](_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')])){throw new Error(_0x0a63('0x71'));}var _0x2e1dc6=_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')];var _0x1030f7=_[_0x0a63('0x5c')](_0x2e1dc6);var _0x393399=_0x2e1dc6==='chat'?_0x0a63('0x5d'):'Account';return db['User'][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0x3ddf5e[_0x0a63('0x18')]['id'],'role':_0x0a63('0x35')}})[_0x0a63('0x6')](function(_0x5e1f76){if(_[_0x0a63('0xf')](_0x5e1f76)){throw new Error('Agent\x20not\x20found');}_0x19a46f=_0x5e1f76;return db[_0x1030f7+'Message'][_0x0a63('0x5f')]({'where':{'id':_0x3ddf5e['body']['messageId']},'include':[{'model':db[_0x1030f7+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x1030f7+_0x393399],'as':_0x0a63('0x69')}]});})[_0x0a63('0x6')](function(_0x52488a){if(_[_0x0a63('0xf')](_0x52488a)){throw new Error(_0x1030f7+'\x20Message\x20not\x20found');}_0x36fd48=_0x52488a;return _0x52488a[_0x0a63('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x11dd21={'uniqueid':_0x2e1dc6+'.'+_0x36fd48['id']+'.'+_0x36fd48['Interaction']['id'],'FromUserId':_0x3ddf5e[_0x0a63('0x2a')]['id'],'type':_0x0a63('0x65'),'ToUserId':_0x19a46f['id']};_0x11dd21[_0x1030f7+_0x0a63('0x66')]=_0x36fd48['id'];_0x11dd21[_0x1030f7+_0x0a63('0x67')]=_0x36fd48[_0x0a63('0x63')]['id'];_0x11dd21[_0x0a63('0x68')+_0x1030f7+_0x393399+'Id']=_0x36fd48[_0x0a63('0x69')]['id'];return db[_0x1030f7+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x11dd21);})['then'](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x2e1dc6,'interaction':_0x36fd48['Interaction'],'message':_0x36fd48,'account':_0x36fd48[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x35'),'appdata':_0x19a46f[_0x0a63('0xd')]+','+(_0x36fd48[_0x0a63('0x69')][_0x0a63('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x5f0510,null))[_0x0a63('0x14')](handleError(_0x5f0510,null));}; \ No newline at end of file +var _0x3eea=['whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','catch','status','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','Agents','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','format','SIP/%s','interface','agent','internal','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x23a367,_0x256e4d){_0x23a367=_0x23a367-0x0;var _0x4e6458=_0x3eea[_0x23a367];return _0x4e6458;};'use strict';var BPromise=require(_0xa3ee('0x0'));var moment=require('moment');var _=require(_0xa3ee('0x1'));var util=require(_0xa3ee('0x2'));var db=require(_0xa3ee('0x3'))['db'];var logger=require(_0xa3ee('0x4'))(_0xa3ee('0x5'));var jayson=require(_0xa3ee('0x6'));var amiClient=jayson[_0xa3ee('0x7')][_0xa3ee('0x8')]({'port':0x232a});var mailClient=jayson[_0xa3ee('0x7')][_0xa3ee('0x8')]({'port':0x232b});var routingClient=jayson[_0xa3ee('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x538bf9,_0x4183ee,_0x4e4588){return new BPromise(function(_0x37a3f0,_0x56f37b){var _0x1eeb5b=_0x4e4588?_0x4e4588:amiClient;return _0x1eeb5b['request'](_0x538bf9,_0x4183ee)[_0xa3ee('0x9')](function(_0x5ef236){if(_0x5ef236[_0xa3ee('0xa')]){if(_0x5ef236[_0xa3ee('0xa')][_0xa3ee('0xb')]===0x1f4){return _0x56f37b(_0x5ef236['error'][_0xa3ee('0xc')]);}return _0x37a3f0(_0x5ef236[_0xa3ee('0xa')]['message']);}else{_0x37a3f0(_0x5ef236['result']);}})[_0xa3ee('0xd')](function(_0x30e652){_0x56f37b(_0x30e652);});});}function respondWithResult(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xc8;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0xe')](_0x4363d1)['json'](_0x594c88);}return _0x403518[_0xa3ee('0xf')](0x194);};}function handleError(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0x1f4;return function(_0x150e20){logger['error'](_0x150e20[_0xa3ee('0x10')]);if(_0x150e20[_0xa3ee('0x11')]){delete _0x150e20['name'];}_0x20535f['status'](_0x2c34cf)['send'](_0x150e20);};}function findById(_0x40decb){return function(_0x7277cd){if(!_[_0xa3ee('0x12')](_0x40decb)&&!_[_0xa3ee('0x12')](_0x7277cd)&&!_['isNil'](_0x7277cd[_0xa3ee('0x13')])){return _[_0xa3ee('0x14')](_0x7277cd[_0xa3ee('0x13')],function(_0x299b1e){return _0x299b1e['id']==_0x40decb;});}return null;};}exports[_0xa3ee('0x15')]=function(_0x4aac0e,_0x377b9d){return respondWithRpcPromise(_0xa3ee('0x16'),_0x4aac0e[_0xa3ee('0x17')])[_0xa3ee('0x9')](respondWithResult(_0x377b9d,null))[_0xa3ee('0xd')](handleError(_0x377b9d,null));};exports[_0xa3ee('0x18')]=function(_0x4f8c56,_0x3f5d70){return respondWithRpcPromise(_0xa3ee('0x19'),_['merge'](_0x4f8c56[_0xa3ee('0x17')],_0x4f8c56['params']))[_0xa3ee('0x9')](respondWithResult(_0x3f5d70,null))[_0xa3ee('0xd')](handleError(_0x3f5d70,null));};exports[_0xa3ee('0x1a')]=function(_0x1bd196,_0x60b899){return respondWithRpcPromise(_0xa3ee('0x1b'),_[_0xa3ee('0x1c')](_0x1bd196[_0xa3ee('0x17')],_0x1bd196[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x60b899,null))['catch'](handleError(_0x60b899,null));};exports[_0xa3ee('0x1e')]=function(_0x1dca29,_0x157071){return respondWithRpcPromise(_0xa3ee('0x1f'),_0x1dca29[_0xa3ee('0x17')])['then'](respondWithResult(_0x157071,null))[_0xa3ee('0xd')](handleError(_0x157071,null));};exports[_0xa3ee('0x20')]=function(_0x146493,_0xd9a7f8){return respondWithRpcPromise(_0xa3ee('0x1f'),_0x146493[_0xa3ee('0x17')])[_0xa3ee('0x9')](findById(_0x146493[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0xd9a7f8,null))[_0xa3ee('0xd')](handleError(_0xd9a7f8,null));};exports['updateVoiceQueue']=function(_0x5ba571,_0x4abf49){return respondWithRpcPromise(_0xa3ee('0x21'),_['merge'](_0x5ba571[_0xa3ee('0x22')],_0x5ba571[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x4abf49,null))[_0xa3ee('0xd')](handleError(_0x4abf49,null));};exports[_0xa3ee('0x23')]=function(_0x14547d,_0x30ba4e){return respondWithRpcPromise(_0xa3ee('0x24'),_[_0xa3ee('0x1c')](_0x14547d[_0xa3ee('0x17')],_0x14547d['params']))[_0xa3ee('0x9')](respondWithResult(_0x30ba4e,null))['catch'](handleError(_0x30ba4e,null));};exports[_0xa3ee('0x25')]=function(_0x332d61,_0x496839){return respondWithRpcPromise(_0xa3ee('0x26'),_0x332d61['query'])[_0xa3ee('0x9')](respondWithResult(_0x496839,null))['catch'](handleError(_0x496839,null));};exports[_0xa3ee('0x27')]=function(_0x299099,_0x2f803c){return respondWithRpcPromise(_0xa3ee('0x28'),_[_0xa3ee('0x1c')](_0x299099['query'],_0x299099[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x2f803c,null))[_0xa3ee('0xd')](handleError(_0x2f803c,null));};exports['voiceQueuesChannelHangup']=function(_0x1599e4,_0x531f58){return respondWithRpcPromise(_0xa3ee('0x29'),_['merge'](_0x1599e4[_0xa3ee('0x17')],_0x1599e4['params']))[_0xa3ee('0x9')](respondWithResult(_0x531f58,null))[_0xa3ee('0xd')](handleError(_0x531f58,null));};exports[_0xa3ee('0x2a')]=function(_0x45be9b,_0x1717ba){return respondWithRpcPromise(_0xa3ee('0x2b'),_[_0xa3ee('0x1c')](_0x45be9b[_0xa3ee('0x17')],_0x45be9b[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x1717ba,null))[_0xa3ee('0xd')](handleError(_0x1717ba,null));};exports[_0xa3ee('0x2c')]=function(_0x447efd,_0x595b55){return respondWithRpcPromise(_0xa3ee('0x2d'),_0x447efd[_0xa3ee('0x17')])[_0xa3ee('0x9')](respondWithResult(_0x595b55,null))[_0xa3ee('0xd')](handleError(_0x595b55,null));};exports['outboundChannels']=function(_0x257627,_0x11a721){return respondWithRpcPromise(_0xa3ee('0x2e'),_0x257627['query'])[_0xa3ee('0x9')](respondWithResult(_0x11a721,null))[_0xa3ee('0xd')](handleError(_0x11a721,null));};exports['agents']=function(_0x319c26,_0x3ecbe6){var _0x4ef99a;return respondWithRpcPromise(_0xa3ee('0x2f'),_0x319c26[_0xa3ee('0x17')])[_0xa3ee('0x9')](function(_0x2c8873){_0x4ef99a=_0x2c8873;return respondWithRpcPromise(_0xa3ee('0x2f'),_0x319c26[_0xa3ee('0x17')],routingClient);})[_0xa3ee('0x9')](function(_0x3e0eec){return _[_0xa3ee('0x1c')]({},_0x3e0eec,_0x4ef99a);})[_0xa3ee('0x9')](respondWithResult(_0x3ecbe6,null))[_0xa3ee('0xd')](handleError(_0x3ecbe6,null));};exports['agentCapacity']=function(_0x5aa4b3,_0x548534){if(_0x5aa4b3[_0xa3ee('0x22')]&&_0x5aa4b3[_0xa3ee('0x22')]['interaction']&&_0x5aa4b3[_0xa3ee('0x30')]&&_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')]){for(var _0x55f47f in _0x5aa4b3[_0xa3ee('0x22')]['interaction']){if(_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0xa3ee('0x32')](_0x55f47f)){db[_0xa3ee('0x33')][_0xa3ee('0x34')]({'where':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')],'type':_0xa3ee('0x35'),'exitAt':null,'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f]&&_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0xa3ee('0x36')]?{'$notIn':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f]}:{'$ne':null}}})[_0xa3ee('0x9')](function(_0x25e0fe){var _0x4594e1=moment()['format'](_0xa3ee('0x37'));for(var _0xdca412=0x0,_0x112e80=_0x25e0fe[_0xa3ee('0x36')];_0xdca412<_0x112e80;_0xdca412+=0x1){_0x25e0fe[_0xdca412]['updateAttributes']({'exitAt':_0x4594e1});}});for(var _0x30fcf1=0x0;_0x30fcf1<_0x5aa4b3['body'][_0xa3ee('0x31')][_0x55f47f][_0xa3ee('0x36')];_0x30fcf1+=0x1){db[_0xa3ee('0x33')][_0xa3ee('0x38')]({'where':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')],'type':_0xa3ee('0x35'),'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0x30fcf1],'exitAt':null},'defaults':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')]['name'],'interface':_[_0xa3ee('0x12')](_0x5aa4b3['user']['interface'])?util[_0xa3ee('0x39')](_0xa3ee('0x3a'),_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')]):_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x3b')],'type':_0xa3ee('0x35'),'enterAt':moment()['format'](_0xa3ee('0x37')),'role':_0xa3ee('0x3c'),'internal':_0x5aa4b3['user'][_0xa3ee('0x3d')],'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0x30fcf1]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x5aa4b3['params']['id'],'capacity':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x3e')]},routingClient)[_0xa3ee('0x9')](respondWithResult(_0x548534,null))[_0xa3ee('0xd')](handleError(_0x548534,null));};exports[_0xa3ee('0x3f')]=function(_0x57e654,_0x55678e){return respondWithRpcPromise(_0xa3ee('0x40'),_0x57e654[_0xa3ee('0x17')])['then'](respondWithResult(_0x55678e,null))[_0xa3ee('0xd')](handleError(_0x55678e,null));};exports[_0xa3ee('0x41')]=function(_0x13cd8b,_0x579ec8){return respondWithRpcPromise('Trunks',_0x13cd8b[_0xa3ee('0x17')])['then'](respondWithResult(_0x579ec8,null))[_0xa3ee('0xd')](handleError(_0x579ec8,null));};exports[_0xa3ee('0x42')]=function(_0x5b8e79,_0x4232e0){return respondWithRpcPromise(_0xa3ee('0x43'),_0x5b8e79[_0xa3ee('0x17')])['then'](respondWithResult(_0x4232e0,null))[_0xa3ee('0xd')](handleError(_0x4232e0,null));};exports[_0xa3ee('0x44')]=function(_0x594034,_0x1d832c){return respondWithRpcPromise(_0xa3ee('0x45'),_0x594034[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x1d832c,null))['catch'](handleError(_0x1d832c,null));};exports[_0xa3ee('0x46')]=function(_0x17ac07,_0x4a1a2f){return respondWithRpcPromise(_0xa3ee('0x45'),_0x17ac07[_0xa3ee('0x17')],routingClient)['then'](findById(_0x17ac07['params']['id']))[_0xa3ee('0x9')](respondWithResult(_0x4a1a2f,null))[_0xa3ee('0xd')](handleError(_0x4a1a2f,null));};exports[_0xa3ee('0x47')]=function(_0x52b824,_0x11fb6e){return respondWithRpcPromise(_0xa3ee('0x48'),_0x52b824[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x11fb6e,null))[_0xa3ee('0xd')](handleError(_0x11fb6e,null));};exports[_0xa3ee('0x49')]=function(_0x497be4,_0x10f508){return respondWithRpcPromise(_0xa3ee('0x48'),_0x497be4['query'],routingClient)[_0xa3ee('0x9')](findById(_0x497be4[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0x10f508,null))[_0xa3ee('0xd')](handleError(_0x10f508,null));};exports[_0xa3ee('0x4a')]=function(_0x330778,_0x4a2255){return respondWithRpcPromise(_0xa3ee('0x4b'),_0x330778[_0xa3ee('0x17')],mailClient)[_0xa3ee('0x9')](respondWithResult(_0x4a2255,null))['catch'](handleError(_0x4a2255,null));};exports[_0xa3ee('0x4c')]=function(_0x13b81b,_0x519f10){return respondWithRpcPromise('OpenchannelQueues',_0x13b81b['query'],routingClient)['then'](respondWithResult(_0x519f10,null))[_0xa3ee('0xd')](handleError(_0x519f10,null));};exports[_0xa3ee('0x4d')]=function(_0x3adafb,_0x2f0424){return respondWithRpcPromise(_0xa3ee('0x4e'),_0x3adafb[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x3adafb['params']['id']))[_0xa3ee('0x9')](respondWithResult(_0x2f0424,null))[_0xa3ee('0xd')](handleError(_0x2f0424,null));};exports[_0xa3ee('0x4f')]=function(_0xaff641,_0x147024){return respondWithRpcPromise('SmsQueues',_0xaff641['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x147024,null))[_0xa3ee('0xd')](handleError(_0x147024,null));};exports[_0xa3ee('0x50')]=function(_0x24613d,_0x16aabe){return respondWithRpcPromise(_0xa3ee('0x51'),_0x24613d[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x24613d[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0x16aabe,null))[_0xa3ee('0xd')](handleError(_0x16aabe,null));};exports[_0xa3ee('0x52')]=function(_0x64f353,_0x224790){return respondWithRpcPromise(_0xa3ee('0x53'),_0x64f353['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x224790,null))['catch'](handleError(_0x224790,null));};exports['showWhatsappQueues']=function(_0x2b1c6e,_0x49daf9){return respondWithRpcPromise(_0xa3ee('0x53'),_0x2b1c6e[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x2b1c6e[_0xa3ee('0x1d')]['id']))['then'](respondWithResult(_0x49daf9,null))[_0xa3ee('0xd')](handleError(_0x49daf9,null));};exports[_0xa3ee('0x54')]=function(_0x179ae2,_0x370e3e){return respondWithRpcPromise('FaxQueues',_0x179ae2[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x370e3e,null))['catch'](handleError(_0x370e3e,null));};exports[_0xa3ee('0x55')]=function(_0x52a066,_0x4f3aac){return respondWithRpcPromise(_0xa3ee('0x56'),_0x52a066['query'],routingClient)['then'](findById(_0x52a066[_0xa3ee('0x1d')]['id']))['then'](respondWithResult(_0x4f3aac,null))['catch'](handleError(_0x4f3aac,null));};exports[_0xa3ee('0x57')]=function(_0xf8689f,_0x538a9b){return respondWithRpcPromise('FaxAccounts',_0xf8689f['query'])[_0xa3ee('0x9')](respondWithResult(_0x538a9b,null))[_0xa3ee('0xd')](handleError(_0x538a9b,null));};exports[_0xa3ee('0x58')]=function(_0x7844ae,_0x389547){return respondWithRpcPromise(_0xa3ee('0x59'),_0x7844ae['query'],routingClient)['then'](respondWithResult(_0x389547,null))[_0xa3ee('0xd')](handleError(_0x389547,null));};exports[_0xa3ee('0x5a')]=function(_0x42a79e,_0x5675fb){return respondWithRpcPromise(_0xa3ee('0x5b'),_0x42a79e[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x5675fb,null))[_0xa3ee('0xd')](handleError(_0x5675fb,null));};exports[_0xa3ee('0x5c')]=function(_0x3be877,_0x2ad745){return respondWithRpcPromise(_0xa3ee('0x5d'),_0x3be877['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x2ad745,null))[_0xa3ee('0xd')](handleError(_0x2ad745,null));};exports[_0xa3ee('0x5e')]=function(_0x37e1c2,_0xbfb429){return respondWithRpcPromise(_0xa3ee('0x5d'),_0x37e1c2[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](function(_0x448f14){if(_0x37e1c2['query']['type']!==undefined){var _0x228671=_(_0x448f14['rows'])[_0xa3ee('0x5f')]([_0x37e1c2[_0xa3ee('0x17')][_0xa3ee('0x60')],_0x37e1c2[_0xa3ee('0x1d')]['id']])['map'](_0xa3ee('0x61'))[_0xa3ee('0x62')]()[_0xa3ee('0x63')]();return _0x448f14[_0xa3ee('0x13')][_0xa3ee('0x5f')](function(_0x4e9473){return _0x228671[_0xa3ee('0x64')](_0x4e9473[_0xa3ee('0x61')])>-0x1;});}else{return _0x448f14[_0xa3ee('0x13')]['filter'](function(_0x3ca523){return _0x3ca523['queue_id']===parseInt(_0x37e1c2[_0xa3ee('0x1d')]['id']);});}})['then'](respondWithResult(_0xbfb429,null))[_0xa3ee('0xd')](handleError(_0xbfb429,null));};exports[_0xa3ee('0x65')]=function(_0x119c3d,_0x140ee0){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x119c3d[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x140ee0,null))['catch'](handleError(_0x140ee0,null));};exports[_0xa3ee('0x66')]=function(_0xa82482,_0x44b084){return respondWithRpcPromise(_0xa3ee('0x67'),_0xa82482[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x44b084,null))[_0xa3ee('0xd')](handleError(_0x44b084,null));};exports[_0xa3ee('0x68')]=function(_0x55a6b7,_0x2535ef){return respondWithRpcPromise(_0xa3ee('0x69'),_0x55a6b7[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x2535ef,null))[_0xa3ee('0xd')](handleError(_0x2535ef,null));};exports[_0xa3ee('0x6a')]=function(_0x31d3ca){return function(_0x329e32,_0x37bde3){var _0x25334c,_0x4f7ace;var _0x21fd56=_[_0xa3ee('0x6b')](_0x31d3ca);var _0x26a124=_0x31d3ca==='chat'?_0xa3ee('0x6c'):'Account';return db[_0x21fd56+_0xa3ee('0x6d')][_0xa3ee('0x6e')]({'raw':!![],'where':{'id':_0x329e32['params']['id']}})[_0xa3ee('0x9')](function(_0x44f27b){if(_['isNil'](_0x44f27b)){throw new Error(_0x21fd56+_0xa3ee('0x6f'));}_0x25334c=_0x44f27b;return db[_0x21fd56+_0xa3ee('0x70')][_0xa3ee('0x6e')]({'where':{'id':_0x329e32[_0xa3ee('0x22')][_0xa3ee('0x71')]},'include':[{'model':db[_0x21fd56+_0xa3ee('0x72')],'as':'Interaction'},{'model':db[_0x21fd56+_0x26a124],'as':'Account'}]});})['then'](function(_0x27454a){if(_['isNil'](_0x27454a)){throw new Error(_0x21fd56+_0xa3ee('0x73'));}_0x4f7ace=_0x27454a;return _0x27454a[_0xa3ee('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa3ee('0x9')](function(){var _0x312ad8={'uniqueid':_0x31d3ca+'.'+_0x4f7ace['id']+'.'+_0x4f7ace[_0xa3ee('0x72')]['id'],'FromUserId':_0x329e32[_0xa3ee('0x30')]['id'],'type':_0xa3ee('0x75')};_0x312ad8[_0x21fd56+_0xa3ee('0x76')]=_0x4f7ace['id'];_0x312ad8[_0x21fd56+_0xa3ee('0x77')]=_0x4f7ace[_0xa3ee('0x72')]['id'];_0x312ad8[_0xa3ee('0x78')+_0x21fd56+_0x26a124+'Id']=_0x4f7ace[_0xa3ee('0x79')]['id'];_0x312ad8['To'+_0x21fd56+_0xa3ee('0x7a')]=_0x25334c['id'];return db[_0x21fd56+_0xa3ee('0x7b')][_0xa3ee('0x7c')](_0x312ad8);})[_0xa3ee('0x9')](function(){return respondWithRpcPromise(_0xa3ee('0x7d'),{'channel':_0x31d3ca,'interaction':_0x4f7ace[_0xa3ee('0x72')],'message':_0x4f7ace,'account':_0x4f7ace[_0xa3ee('0x79')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x25334c[_0xa3ee('0x11')]+','+(_0x4f7ace[_0xa3ee('0x79')][_0xa3ee('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x37bde3,null))[_0xa3ee('0xd')](handleError(_0x37bde3,null));};};exports[_0xa3ee('0x7f')]=function(_0x591bfa,_0x5b53f1){var _0x24cbc9,_0x157436;if(_[_0xa3ee('0x12')](_0x591bfa[_0xa3ee('0x22')][_0xa3ee('0x80')])){throw new Error(_0xa3ee('0x81'));}var _0x18a74b=_0x591bfa[_0xa3ee('0x22')][_0xa3ee('0x80')];var _0x3e6657=_[_0xa3ee('0x6b')](_0x18a74b);var _0x3236b3=_0x18a74b===_0xa3ee('0x82')?'Website':_0xa3ee('0x79');return db[_0xa3ee('0x83')][_0xa3ee('0x6e')]({'raw':!![],'where':{'id':_0x591bfa[_0xa3ee('0x1d')]['id'],'role':_0xa3ee('0x3c')}})[_0xa3ee('0x9')](function(_0x4cc5e5){if(_['isNil'](_0x4cc5e5)){throw new Error(_0xa3ee('0x84'));}_0x24cbc9=_0x4cc5e5;return db[_0x3e6657+_0xa3ee('0x70')][_0xa3ee('0x6e')]({'where':{'id':_0x591bfa['body'][_0xa3ee('0x71')]},'include':[{'model':db[_0x3e6657+'Interaction'],'as':_0xa3ee('0x72')},{'model':db[_0x3e6657+_0x3236b3],'as':_0xa3ee('0x79')}]});})[_0xa3ee('0x9')](function(_0x10ec99){if(_[_0xa3ee('0x12')](_0x10ec99)){throw new Error(_0x3e6657+_0xa3ee('0x73'));}_0x157436=_0x10ec99;return _0x10ec99[_0xa3ee('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa3ee('0x9')](function(){var _0x116de1={'uniqueid':_0x18a74b+'.'+_0x157436['id']+'.'+_0x157436[_0xa3ee('0x72')]['id'],'FromUserId':_0x591bfa['user']['id'],'type':'queue','ToUserId':_0x24cbc9['id']};_0x116de1[_0x3e6657+'MessageId']=_0x157436['id'];_0x116de1[_0x3e6657+_0xa3ee('0x77')]=_0x157436['Interaction']['id'];_0x116de1[_0xa3ee('0x78')+_0x3e6657+_0x3236b3+'Id']=_0x157436[_0xa3ee('0x79')]['id'];return db[_0x3e6657+_0xa3ee('0x7b')][_0xa3ee('0x7c')](_0x116de1);})[_0xa3ee('0x9')](function(){return respondWithRpcPromise(_0xa3ee('0x7d'),{'channel':_0x18a74b,'interaction':_0x157436[_0xa3ee('0x72')],'message':_0x157436,'account':_0x157436[_0xa3ee('0x79')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa3ee('0x3c'),'appdata':_0x24cbc9['name']+','+(_0x157436['Account'][_0xa3ee('0x85')]||0x12c),'interval':_0xa3ee('0x86')}]},routingClient);})[_0xa3ee('0x9')](respondWithResult(_0x5b53f1,null))[_0xa3ee('0xd')](handleError(_0x5b53f1,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 4d5a733..4eec0e9 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 _0x9009=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','create','put','update','delete','destroy','exports'];(function(_0x475ed7,_0x401974){var _0x2c31ce=function(_0x31f03b){while(--_0x31f03b){_0x475ed7['push'](_0x475ed7['shift']());}};_0x2c31ce(++_0x401974);}(_0x9009,0x1cc));var _0x9900=function(_0x42e3d4,_0x19b941){_0x42e3d4=_0x42e3d4-0x0;var _0x173850=_0x9009[_0x42e3d4];return _0x173850;};'use strict';var multer=require(_0x9900('0x0'));var util=require(_0x9900('0x1'));var path=require(_0x9900('0x2'));var timeout=require(_0x9900('0x3'));var express=require(_0x9900('0x4'));var router=express[_0x9900('0x5')]();var fs_extra=require(_0x9900('0x6'));var auth=require(_0x9900('0x7'));var interaction=require(_0x9900('0x8'));var config=require('../../config/environment');var controller=require(_0x9900('0x9'));router[_0x9900('0xa')]('/',auth[_0x9900('0xb')](),controller[_0x9900('0xc')]);router['get'](_0x9900('0xd'),auth[_0x9900('0xb')](),controller[_0x9900('0xe')]);router[_0x9900('0xa')](_0x9900('0xf'),auth['isAuthenticated'](),controller[_0x9900('0x10')]);router['post']('/',auth[_0x9900('0xb')](),controller[_0x9900('0x11')]);router[_0x9900('0x12')](_0x9900('0xd'),auth['isAuthenticated'](),controller[_0x9900('0x13')]);router[_0x9900('0x14')](_0x9900('0xd'),auth['isAuthenticated'](),controller[_0x9900('0x15')]);module[_0x9900('0x16')]=router; \ No newline at end of file +var _0x4ce0=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/run','run','post','create'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4ce0,0x15f));var _0x04ce=function(_0x28ae11,_0x12043f){_0x28ae11=_0x28ae11-0x0;var _0x32bb34=_0x4ce0[_0x28ae11];return _0x32bb34;};'use strict';var multer=require(_0x04ce('0x0'));var util=require(_0x04ce('0x1'));var path=require(_0x04ce('0x2'));var timeout=require(_0x04ce('0x3'));var express=require(_0x04ce('0x4'));var router=express['Router']();var fs_extra=require(_0x04ce('0x5'));var auth=require(_0x04ce('0x6'));var interaction=require(_0x04ce('0x7'));var config=require(_0x04ce('0x8'));var controller=require('./schedule.controller');router[_0x04ce('0x9')]('/',auth[_0x04ce('0xa')](),controller[_0x04ce('0xb')]);router[_0x04ce('0x9')]('/:id',auth[_0x04ce('0xa')](),controller[_0x04ce('0xc')]);router[_0x04ce('0x9')](_0x04ce('0xd'),auth['isAuthenticated'](),controller[_0x04ce('0xe')]);router[_0x04ce('0xf')]('/',auth[_0x04ce('0xa')](),controller[_0x04ce('0x10')]);router[_0x04ce('0x11')](_0x04ce('0x12'),auth[_0x04ce('0xa')](),controller[_0x04ce('0x13')]);router[_0x04ce('0x14')](_0x04ce('0x12'),auth[_0x04ce('0xa')](),controller[_0x04ce('0x15')]);module[_0x04ce('0x16')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 182b005..3792049 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 _0xc1f9=['quarters','months','weeks','days','csv','pdf','xlsx','ENUM','custom','default','TEXT','BOOLEAN','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years'];(function(_0x49fdd5,_0x1004de){var _0x44f982=function(_0x20d97b){while(--_0x20d97b){_0x49fdd5['push'](_0x49fdd5['shift']());}};_0x44f982(++_0x1004de);}(_0xc1f9,0x91));var _0x9c1f=function(_0x42b953,_0x5ca10c){_0x42b953=_0x42b953-0x0;var _0x31bda6=_0xc1f9[_0x42b953];return _0x31bda6;};'use strict';var Sequelize=require(_0x9c1f('0x0'));module[_0x9c1f('0x1')]={'name':{'type':Sequelize[_0x9c1f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9c1f('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9c1f('0x2')],'allowNull':![],'defaultValue':_0x9c1f('0x3')},'startAt':{'type':Sequelize[_0x9c1f('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9c1f('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9c1f('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x9c1f('0x6'),_0x9c1f('0x7'),_0x9c1f('0x8'),_0x9c1f('0x9'),'days','hours','minutes'),'allowNull':![],'defaultValue':_0x9c1f('0xa')},'output':{'type':Sequelize['ENUM'](_0x9c1f('0xb'),_0x9c1f('0xc'),_0x9c1f('0xd')),'allowNull':![],'defaultValue':_0x9c1f('0xb')},'type':{'type':Sequelize[_0x9c1f('0xe')](_0x9c1f('0xf'),_0x9c1f('0x10')),'allowNull':![],'defaultValue':_0x9c1f('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x9c1f('0x2')]},'cc':{'type':Sequelize[_0x9c1f('0x11')]},'bcc':{'type':Sequelize[_0x9c1f('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x9c1f('0x12')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7fba=['custom','TEXT','sequelize','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','minutes','days','xlsx','csv','default'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fba,0x122));var _0xa7fb=function(_0x18fa1b,_0x3b6d3e){_0x18fa1b=_0x18fa1b-0x0;var _0x4036e6=_0x7fba[_0x18fa1b];return _0x4036e6;};'use strict';var Sequelize=require(_0xa7fb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xa7fb('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xa7fb('0x2')],'allowNull':![],'defaultValue':_0xa7fb('0x3')},'startAt':{'type':Sequelize[_0xa7fb('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xa7fb('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xa7fb('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa7fb('0x6')]('years',_0xa7fb('0x7'),_0xa7fb('0x8'),'weeks','days','hours',_0xa7fb('0x9')),'allowNull':![],'defaultValue':_0xa7fb('0xa')},'output':{'type':Sequelize[_0xa7fb('0x6')]('csv','pdf',_0xa7fb('0xb')),'allowNull':![],'defaultValue':_0xa7fb('0xc')},'type':{'type':Sequelize[_0xa7fb('0x6')]('custom',_0xa7fb('0xd')),'allowNull':![],'defaultValue':_0xa7fb('0xe')},'sendMail':{'type':Sequelize[_0xa7fb('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xa7fb('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xa7fb('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xa7fb('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 9dd11e5..ccb2b0a 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 _0x1daf=['index','Schedule','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','update','../../config/schedule','run','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','apply','reject','then','destroy','get','Scheduler','UserProfileResource','error','stack','name'];(function(_0xf75aa8,_0x156e9f){var _0xe3b4da=function(_0x330cc6){while(--_0x330cc6){_0xf75aa8['push'](_0xf75aa8['shift']());}};_0xe3b4da(++_0x156e9f);}(_0x1daf,0x17a));var _0xf1da=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1daf[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xf1da('0x0'));var rimraf=require(_0xf1da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1da('0x2'));var rp=require(_0xf1da('0x3'));var moment=require('moment');var BPromise=require(_0xf1da('0x4'));var Mustache=require(_0xf1da('0x5'));var util=require(_0xf1da('0x6'));var path=require(_0xf1da('0x7'));var sox=require('sox');var csv=require(_0xf1da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf1da('0x9'));var squel=require(_0xf1da('0xa'));var crypto=require(_0xf1da('0xb'));var jsforce=require(_0xf1da('0xc'));var deskjs=require(_0xf1da('0xd'));var toCsv=require(_0xf1da('0x8'));var querystring=require(_0xf1da('0xe'));var Papa=require(_0xf1da('0xf'));var Redis=require(_0xf1da('0x10'));var authService=require(_0xf1da('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf1da('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1da('0x13'))(_0xf1da('0x14'));var utils=require(_0xf1da('0x15'));var config=require(_0xf1da('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf1da('0x17'))['db'];function respondWithStatusCode(_0xf7348b,_0x360aa8){_0x360aa8=_0x360aa8||0xcc;return function(_0x4dc8c3){if(_0x4dc8c3){return _0xf7348b[_0xf1da('0x18')](_0x360aa8);}return _0xf7348b[_0xf1da('0x19')](_0x360aa8)[_0xf1da('0x1a')]();};}function respondWithResult(_0x2a3d3e,_0x59041d){_0x59041d=_0x59041d||0xc8;return function(_0x5619db){if(_0x5619db){return _0x2a3d3e[_0xf1da('0x19')](_0x59041d)[_0xf1da('0x1b')](_0x5619db);}};}function respondWithFilteredResult(_0x5e89c9,_0x3385f4){return function(_0x4afb79){if(_0x4afb79){var _0x253f86=typeof _0x3385f4['offset']==='undefined'&&typeof _0x3385f4['limit']===_0xf1da('0x1c');var _0x413e6d=_0x4afb79['count'];var _0x576f2f=_0x253f86?0x0:_0x3385f4['offset'];var _0x5a604a=_0x253f86?_0x4afb79[_0xf1da('0x1d')]:_0x3385f4['offset']+_0x3385f4[_0xf1da('0x1e')];var _0x4ee9c1;if(_0x5a604a>=_0x413e6d){_0x5a604a=_0x413e6d;_0x4ee9c1=0xc8;}else{_0x4ee9c1=0xce;}_0x5e89c9[_0xf1da('0x19')](_0x4ee9c1);return _0x5e89c9[_0xf1da('0x1f')]('Content-Range',_0x576f2f+'-'+_0x5a604a+'/'+_0x413e6d)['json'](_0x4afb79);}return null;};}function patchUpdates(_0x413aab){return function(_0x22e5ed){try{jsonpatch[_0xf1da('0x20')](_0x22e5ed,_0x413aab,!![]);}catch(_0x2ae001){return BPromise[_0xf1da('0x21')](_0x2ae001);}return _0x22e5ed['save']();};}function saveUpdates(_0x408e0e,_0x5f3418){return function(_0x12e7f3){if(_0x12e7f3){return _0x12e7f3['update'](_0x408e0e)[_0xf1da('0x22')](function(_0x22ef3c){return _0x22ef3c;});}return null;};}function removeEntity(_0x1789c2,_0x38fe75){return function(_0x38c3f4){if(_0x38c3f4){return _0x38c3f4[_0xf1da('0x23')]()[_0xf1da('0x22')](function(){var _0xad1782=_0x38c3f4[_0xf1da('0x24')]({'plain':!![]});var _0x19a932=_0xf1da('0x25');return db[_0xf1da('0x26')][_0xf1da('0x23')]({'where':{'type':_0x19a932,'resourceId':_0xad1782['id']}})['then'](function(){return _0x38c3f4;});})['then'](function(){_0x1789c2['status'](0xcc)[_0xf1da('0x1a')]();});}};}function handleEntityNotFound(_0x430cf4,_0x2de621){return function(_0x4625d3){if(!_0x4625d3){_0x430cf4[_0xf1da('0x18')](0x194);}return _0x4625d3;};}function handleError(_0x20080d,_0x825d59){_0x825d59=_0x825d59||0x1f4;return function(_0x2ec752){logger[_0xf1da('0x27')](_0x2ec752[_0xf1da('0x28')]);if(_0x2ec752[_0xf1da('0x29')]){delete _0x2ec752[_0xf1da('0x29')];}_0x20080d[_0xf1da('0x19')](_0x825d59)['send'](_0x2ec752);};}exports[_0xf1da('0x2a')]=function(_0xaaee72,_0x10d305){var _0xd37d8b={},_0x736818={},_0x233bd2={'count':0x0,'rows':[]};var _0x2778d6=_['map'](db[_0xf1da('0x2b')][_0xf1da('0x2c')],function(_0x3197b1){return{'name':_0x3197b1[_0xf1da('0x2d')],'type':_0x3197b1[_0xf1da('0x2e')][_0xf1da('0x2f')]};});_0x736818[_0xf1da('0x30')]=_[_0xf1da('0x31')](_0x2778d6,'name');_0x736818[_0xf1da('0x32')]=_[_0xf1da('0x33')](_0xaaee72[_0xf1da('0x32')]);_0x736818[_0xf1da('0x34')]=_[_0xf1da('0x35')](_0x736818['model'],_0x736818['query']);_0xd37d8b['attributes']=_['intersection'](_0x736818[_0xf1da('0x30')],qs[_0xf1da('0x36')](_0xaaee72[_0xf1da('0x32')][_0xf1da('0x36')]));_0xd37d8b[_0xf1da('0x37')]=_0xd37d8b[_0xf1da('0x37')][_0xf1da('0x38')]?_0xd37d8b[_0xf1da('0x37')]:_0x736818[_0xf1da('0x30')];if(!_0xaaee72[_0xf1da('0x32')][_0xf1da('0x39')](_0xf1da('0x3a'))){_0xd37d8b[_0xf1da('0x1e')]=qs[_0xf1da('0x1e')](_0xaaee72[_0xf1da('0x32')][_0xf1da('0x1e')]);_0xd37d8b['offset']=qs[_0xf1da('0x3b')](_0xaaee72['query']['offset']);}_0xd37d8b[_0xf1da('0x3c')]=qs[_0xf1da('0x3d')](_0xaaee72[_0xf1da('0x32')][_0xf1da('0x3d')]);_0xd37d8b[_0xf1da('0x3e')]=qs[_0xf1da('0x34')](_[_0xf1da('0x3f')](_0xaaee72['query'],_0x736818[_0xf1da('0x34')]),_0x2778d6);if(_0xaaee72['query']['filter']){_0xd37d8b[_0xf1da('0x3e')]=_[_0xf1da('0x40')](_0xd37d8b[_0xf1da('0x3e')],{'$or':_['map'](_0x2778d6,function(_0x52a2a5){if(_0x52a2a5[_0xf1da('0x2e')]!=='VIRTUAL'){var _0x444580={};_0x444580[_0x52a2a5[_0xf1da('0x29')]]={'$like':'%'+_0xaaee72[_0xf1da('0x32')][_0xf1da('0x41')]+'%'};return _0x444580;}})});}_0xd37d8b=_[_0xf1da('0x40')]({},_0xd37d8b,_0xaaee72['options']);var _0x456402={'where':_0xd37d8b[_0xf1da('0x3e')]};return db[_0xf1da('0x2b')][_0xf1da('0x1d')](_0x456402)[_0xf1da('0x22')](function(_0x2614c4){_0x233bd2[_0xf1da('0x1d')]=_0x2614c4;if(_0xaaee72[_0xf1da('0x32')][_0xf1da('0x42')]){_0xd37d8b[_0xf1da('0x43')]=[{'all':!![]}];}return db[_0xf1da('0x2b')][_0xf1da('0x44')](_0xd37d8b);})['then'](function(_0x5161d3){_0x233bd2[_0xf1da('0x45')]=_0x5161d3;return _0x233bd2;})['then'](respondWithFilteredResult(_0x10d305,_0xd37d8b))[_0xf1da('0x46')](handleError(_0x10d305,null));};exports[_0xf1da('0x47')]=function(_0x234ca9,_0x4fa51a){var _0x8e6364={'raw':![],'where':{'id':_0x234ca9[_0xf1da('0x48')]['id']}},_0x358a90={};_0x358a90[_0xf1da('0x30')]=_[_0xf1da('0x33')](db['Schedule'][_0xf1da('0x2c')]);_0x358a90['query']=_[_0xf1da('0x33')](_0x234ca9[_0xf1da('0x32')]);_0x358a90[_0xf1da('0x34')]=_[_0xf1da('0x35')](_0x358a90[_0xf1da('0x30')],_0x358a90['query']);_0x8e6364[_0xf1da('0x37')]=_[_0xf1da('0x35')](_0x358a90[_0xf1da('0x30')],qs[_0xf1da('0x36')](_0x234ca9[_0xf1da('0x32')]['fields']));_0x8e6364[_0xf1da('0x37')]=_0x8e6364[_0xf1da('0x37')][_0xf1da('0x38')]?_0x8e6364[_0xf1da('0x37')]:_0x358a90[_0xf1da('0x30')];if(_0x234ca9[_0xf1da('0x32')][_0xf1da('0x42')]){_0x8e6364[_0xf1da('0x43')]=[{'all':!![]}];}_0x8e6364=_['merge']({},_0x8e6364,_0x234ca9[_0xf1da('0x49')]);return db[_0xf1da('0x2b')][_0xf1da('0x4a')](_0x8e6364)[_0xf1da('0x22')](handleEntityNotFound(_0x4fa51a,null))[_0xf1da('0x22')](respondWithResult(_0x4fa51a,null))[_0xf1da('0x46')](handleError(_0x4fa51a,null));};exports[_0xf1da('0x4b')]=function(_0x459fd1,_0x281d74){return db[_0xf1da('0x2b')][_0xf1da('0x4b')](_0x459fd1[_0xf1da('0x4c')],{})['then'](function(_0xee6fe0){var _0x9d8de5=_0x459fd1[_0xf1da('0x4d')]['get']({'plain':!![]});if(!_0x9d8de5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9d8de5[_0xf1da('0x4e')]===_0xf1da('0x4d')){var _0x3c9074=_0xee6fe0['get']({'plain':!![]});var _0x38adb3=_0xf1da('0x25');return db[_0xf1da('0x4f')][_0xf1da('0x4a')]({'where':{'name':_0x38adb3,'userProfileId':_0x9d8de5[_0xf1da('0x50')]},'raw':!![]})['then'](function(_0x16dc7c){if(_0x16dc7c&&_0x16dc7c['autoAssociation']===0x0){return db[_0xf1da('0x26')][_0xf1da('0x4b')]({'name':_0x3c9074[_0xf1da('0x29')],'resourceId':_0x3c9074['id'],'type':_0x16dc7c[_0xf1da('0x29')],'sectionId':_0x16dc7c['id']},{})[_0xf1da('0x22')](function(){return _0xee6fe0;});}else{return _0xee6fe0;}})['catch'](function(_0x560569){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560569);throw _0x560569;});}return _0xee6fe0;})[_0xf1da('0x22')](respondWithResult(_0x281d74,0xc9))[_0xf1da('0x46')](handleError(_0x281d74,null));};exports[_0xf1da('0x51')]=function(_0x25148d,_0x8f7650){if(_0x25148d[_0xf1da('0x4c')]['id']){delete _0x25148d[_0xf1da('0x4c')]['id'];}return db['Schedule'][_0xf1da('0x4a')]({'where':{'id':_0x25148d['params']['id']}})[_0xf1da('0x22')](handleEntityNotFound(_0x8f7650,null))[_0xf1da('0x22')](saveUpdates(_0x25148d[_0xf1da('0x4c')],null))['then'](respondWithResult(_0x8f7650,null))[_0xf1da('0x46')](handleError(_0x8f7650,null));};exports[_0xf1da('0x23')]=function(_0x3d8905,_0x1b2eb8){return db[_0xf1da('0x2b')]['find']({'where':{'id':_0x3d8905[_0xf1da('0x48')]['id']}})[_0xf1da('0x22')](handleEntityNotFound(_0x1b2eb8,null))[_0xf1da('0x22')](removeEntity(_0x1b2eb8,null))[_0xf1da('0x46')](handleError(_0x1b2eb8,null));};exports['run']=function(_0x2c3802,_0x4d4257,_0x1c0efc){var _0x4f9151=require(_0xf1da('0x52'));return db[_0xf1da('0x2b')]['find']({'where':{'id':_0x2c3802[_0xf1da('0x48')]['id']},'raw':!![]})[_0xf1da('0x22')](handleEntityNotFound(_0x4d4257,null))[_0xf1da('0x22')](function(){_0x4f9151[_0xf1da('0x53')](_0x2c3802[_0xf1da('0x48')]['id']);})[_0xf1da('0x22')](respondWithStatusCode(_0x4d4257,null))['catch'](handleError(_0x4d4257,null));}; \ No newline at end of file +var _0x0497=['index','Schedule','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','count','includeAll','findAll','catch','show','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','error','stack','name','send'];(function(_0x1c1c95,_0x317616){var _0xf538c3=function(_0x1e7ec6){while(--_0x1e7ec6){_0x1c1c95['push'](_0x1c1c95['shift']());}};_0xf538c3(++_0x317616);}(_0x0497,0x83));var _0x7049=function(_0x4471f5,_0x4c8ac8){_0x4471f5=_0x4471f5-0x0;var _0x5a7082=_0x0497[_0x4471f5];return _0x5a7082;};'use strict';var emlformat=require(_0x7049('0x0'));var rimraf=require(_0x7049('0x1'));var zipdir=require(_0x7049('0x2'));var jsonpatch=require(_0x7049('0x3'));var rp=require(_0x7049('0x4'));var moment=require('moment');var BPromise=require(_0x7049('0x5'));var Mustache=require(_0x7049('0x6'));var util=require(_0x7049('0x7'));var path=require('path');var sox=require(_0x7049('0x8'));var csv=require(_0x7049('0x9'));var ejs=require(_0x7049('0xa'));var fs=require('fs');var fs_extra=require(_0x7049('0xb'));var _=require(_0x7049('0xc'));var squel=require(_0x7049('0xd'));var crypto=require(_0x7049('0xe'));var jsforce=require(_0x7049('0xf'));var deskjs=require(_0x7049('0x10'));var toCsv=require(_0x7049('0x9'));var querystring=require(_0x7049('0x11'));var Papa=require(_0x7049('0x12'));var Redis=require('ioredis');var authService=require(_0x7049('0x13'));var qs=require(_0x7049('0x14'));var as=require(_0x7049('0x15'));var hardwareService=require(_0x7049('0x16'));var logger=require('../../config/logger')(_0x7049('0x17'));var utils=require(_0x7049('0x18'));var config=require(_0x7049('0x19'));var licenseUtil=require(_0x7049('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2da892,_0x489d93){_0x489d93=_0x489d93||0xcc;return function(_0x5420f5){if(_0x5420f5){return _0x2da892[_0x7049('0x1b')](_0x489d93);}return _0x2da892[_0x7049('0x1c')](_0x489d93)[_0x7049('0x1d')]();};}function respondWithResult(_0x4b5c49,_0x401d1c){_0x401d1c=_0x401d1c||0xc8;return function(_0x10fd66){if(_0x10fd66){return _0x4b5c49[_0x7049('0x1c')](_0x401d1c)['json'](_0x10fd66);}};}function respondWithFilteredResult(_0x139c94,_0x239a22){return function(_0x523207){if(_0x523207){var _0xc3f088=typeof _0x239a22[_0x7049('0x1e')]===_0x7049('0x1f')&&typeof _0x239a22[_0x7049('0x20')]===_0x7049('0x1f');var _0x4570f8=_0x523207['count'];var _0xb05037=_0xc3f088?0x0:_0x239a22[_0x7049('0x1e')];var _0x32e4a3=_0xc3f088?_0x523207['count']:_0x239a22[_0x7049('0x1e')]+_0x239a22[_0x7049('0x20')];var _0x1bcd49;if(_0x32e4a3>=_0x4570f8){_0x32e4a3=_0x4570f8;_0x1bcd49=0xc8;}else{_0x1bcd49=0xce;}_0x139c94[_0x7049('0x1c')](_0x1bcd49);return _0x139c94[_0x7049('0x21')](_0x7049('0x22'),_0xb05037+'-'+_0x32e4a3+'/'+_0x4570f8)['json'](_0x523207);}return null;};}function patchUpdates(_0x4cd81d){return function(_0x4bb545){try{jsonpatch[_0x7049('0x23')](_0x4bb545,_0x4cd81d,!![]);}catch(_0x1fa1d8){return BPromise[_0x7049('0x24')](_0x1fa1d8);}return _0x4bb545[_0x7049('0x25')]();};}function saveUpdates(_0x3ee828,_0x5428ec){return function(_0x273cbc){if(_0x273cbc){return _0x273cbc['update'](_0x3ee828)[_0x7049('0x26')](function(_0x318818){return _0x318818;});}return null;};}function removeEntity(_0x4f1fd5,_0x2c7d50){return function(_0x4a1fa2){if(_0x4a1fa2){return _0x4a1fa2[_0x7049('0x27')]()[_0x7049('0x26')](function(){var _0x3f48f2=_0x4a1fa2[_0x7049('0x28')]({'plain':!![]});var _0x19d82e='Scheduler';return db['UserProfileResource']['destroy']({'where':{'type':_0x19d82e,'resourceId':_0x3f48f2['id']}})['then'](function(){return _0x4a1fa2;});})[_0x7049('0x26')](function(){_0x4f1fd5[_0x7049('0x1c')](0xcc)[_0x7049('0x1d')]();});}};}function handleEntityNotFound(_0x174733,_0xf0363d){return function(_0x56107a){if(!_0x56107a){_0x174733[_0x7049('0x1b')](0x194);}return _0x56107a;};}function handleError(_0x5ece2a,_0x2703dd){_0x2703dd=_0x2703dd||0x1f4;return function(_0x24378a){logger[_0x7049('0x29')](_0x24378a[_0x7049('0x2a')]);if(_0x24378a[_0x7049('0x2b')]){delete _0x24378a[_0x7049('0x2b')];}_0x5ece2a['status'](_0x2703dd)[_0x7049('0x2c')](_0x24378a);};}exports[_0x7049('0x2d')]=function(_0x245fde,_0x377ab8){var _0x530858={},_0x450c15={},_0x46975c={'count':0x0,'rows':[]};var _0x49fd5c=_['map'](db[_0x7049('0x2e')][_0x7049('0x2f')],function(_0x3f5fb3){return{'name':_0x3f5fb3['fieldName'],'type':_0x3f5fb3[_0x7049('0x30')][_0x7049('0x31')]};});_0x450c15[_0x7049('0x32')]=_['map'](_0x49fd5c,_0x7049('0x2b'));_0x450c15[_0x7049('0x33')]=_[_0x7049('0x34')](_0x245fde[_0x7049('0x33')]);_0x450c15[_0x7049('0x35')]=_['intersection'](_0x450c15['model'],_0x450c15[_0x7049('0x33')]);_0x530858[_0x7049('0x36')]=_['intersection'](_0x450c15[_0x7049('0x32')],qs[_0x7049('0x37')](_0x245fde[_0x7049('0x33')]['fields']));_0x530858[_0x7049('0x36')]=_0x530858[_0x7049('0x36')][_0x7049('0x38')]?_0x530858[_0x7049('0x36')]:_0x450c15[_0x7049('0x32')];if(!_0x245fde[_0x7049('0x33')][_0x7049('0x39')](_0x7049('0x3a'))){_0x530858[_0x7049('0x20')]=qs[_0x7049('0x20')](_0x245fde[_0x7049('0x33')]['limit']);_0x530858['offset']=qs['offset'](_0x245fde['query'][_0x7049('0x1e')]);}_0x530858['order']=qs[_0x7049('0x3b')](_0x245fde['query'][_0x7049('0x3b')]);_0x530858[_0x7049('0x3c')]=qs['filters'](_[_0x7049('0x3d')](_0x245fde[_0x7049('0x33')],_0x450c15[_0x7049('0x35')]),_0x49fd5c);if(_0x245fde[_0x7049('0x33')]['filter']){_0x530858[_0x7049('0x3c')]=_[_0x7049('0x3e')](_0x530858[_0x7049('0x3c')],{'$or':_[_0x7049('0x3f')](_0x49fd5c,function(_0x3f5dcd){if(_0x3f5dcd['type']!==_0x7049('0x40')){var _0xfdcf82={};_0xfdcf82[_0x3f5dcd['name']]={'$like':'%'+_0x245fde[_0x7049('0x33')][_0x7049('0x41')]+'%'};return _0xfdcf82;}})});}_0x530858=_[_0x7049('0x3e')]({},_0x530858,_0x245fde[_0x7049('0x42')]);var _0x4e1d57={'where':_0x530858['where']};return db[_0x7049('0x2e')][_0x7049('0x43')](_0x4e1d57)[_0x7049('0x26')](function(_0x55e0ea){_0x46975c[_0x7049('0x43')]=_0x55e0ea;if(_0x245fde[_0x7049('0x33')][_0x7049('0x44')]){_0x530858['include']=[{'all':!![]}];}return db[_0x7049('0x2e')][_0x7049('0x45')](_0x530858);})[_0x7049('0x26')](function(_0xeffab9){_0x46975c['rows']=_0xeffab9;return _0x46975c;})[_0x7049('0x26')](respondWithFilteredResult(_0x377ab8,_0x530858))[_0x7049('0x46')](handleError(_0x377ab8,null));};exports[_0x7049('0x47')]=function(_0x49543a,_0x2cf678){var _0x1ea681={'raw':![],'where':{'id':_0x49543a['params']['id']}},_0x1ef980={};_0x1ef980[_0x7049('0x32')]=_[_0x7049('0x34')](db[_0x7049('0x2e')]['rawAttributes']);_0x1ef980['query']=_['keys'](_0x49543a[_0x7049('0x33')]);_0x1ef980[_0x7049('0x35')]=_[_0x7049('0x48')](_0x1ef980['model'],_0x1ef980[_0x7049('0x33')]);_0x1ea681['attributes']=_['intersection'](_0x1ef980[_0x7049('0x32')],qs['fields'](_0x49543a['query'][_0x7049('0x37')]));_0x1ea681[_0x7049('0x36')]=_0x1ea681[_0x7049('0x36')]['length']?_0x1ea681[_0x7049('0x36')]:_0x1ef980[_0x7049('0x32')];if(_0x49543a['query'][_0x7049('0x44')]){_0x1ea681[_0x7049('0x49')]=[{'all':!![]}];}_0x1ea681=_['merge']({},_0x1ea681,_0x49543a['options']);return db['Schedule'][_0x7049('0x4a')](_0x1ea681)['then'](handleEntityNotFound(_0x2cf678,null))['then'](respondWithResult(_0x2cf678,null))[_0x7049('0x46')](handleError(_0x2cf678,null));};exports[_0x7049('0x4b')]=function(_0x2ba40b,_0x465bec){return db[_0x7049('0x2e')][_0x7049('0x4b')](_0x2ba40b[_0x7049('0x4c')],{})[_0x7049('0x26')](function(_0x316e3e){var _0x4f7964=_0x2ba40b[_0x7049('0x4d')][_0x7049('0x28')]({'plain':!![]});if(!_0x4f7964)throw new Error(_0x7049('0x4e'));if(_0x4f7964[_0x7049('0x4f')]===_0x7049('0x4d')){var _0x34c5eb=_0x316e3e[_0x7049('0x28')]({'plain':!![]});var _0x4ff1a0='Scheduler';return db[_0x7049('0x50')][_0x7049('0x4a')]({'where':{'name':_0x4ff1a0,'userProfileId':_0x4f7964[_0x7049('0x51')]},'raw':!![]})[_0x7049('0x26')](function(_0x26394d){if(_0x26394d&&_0x26394d[_0x7049('0x52')]===0x0){return db[_0x7049('0x53')][_0x7049('0x4b')]({'name':_0x34c5eb[_0x7049('0x2b')],'resourceId':_0x34c5eb['id'],'type':_0x26394d[_0x7049('0x2b')],'sectionId':_0x26394d['id']},{})[_0x7049('0x26')](function(){return _0x316e3e;});}else{return _0x316e3e;}})['catch'](function(_0x35403a){logger[_0x7049('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35403a);throw _0x35403a;});}return _0x316e3e;})[_0x7049('0x26')](respondWithResult(_0x465bec,0xc9))[_0x7049('0x46')](handleError(_0x465bec,null));};exports[_0x7049('0x54')]=function(_0x3ff81a,_0x3f97f2){if(_0x3ff81a[_0x7049('0x4c')]['id']){delete _0x3ff81a[_0x7049('0x4c')]['id'];}return db[_0x7049('0x2e')][_0x7049('0x4a')]({'where':{'id':_0x3ff81a['params']['id']}})[_0x7049('0x26')](handleEntityNotFound(_0x3f97f2,null))['then'](saveUpdates(_0x3ff81a[_0x7049('0x4c')],null))[_0x7049('0x26')](respondWithResult(_0x3f97f2,null))[_0x7049('0x46')](handleError(_0x3f97f2,null));};exports['destroy']=function(_0x1e27af,_0x4fadbd){return db[_0x7049('0x2e')][_0x7049('0x4a')]({'where':{'id':_0x1e27af[_0x7049('0x55')]['id']}})[_0x7049('0x26')](handleEntityNotFound(_0x4fadbd,null))[_0x7049('0x26')](removeEntity(_0x4fadbd,null))[_0x7049('0x46')](handleError(_0x4fadbd,null));};exports[_0x7049('0x56')]=function(_0x16e1dc,_0x41013d,_0x391dbe){var _0xb76499=require(_0x7049('0x57'));return db[_0x7049('0x2e')][_0x7049('0x4a')]({'where':{'id':_0x16e1dc[_0x7049('0x55')]['id']},'raw':!![]})[_0x7049('0x26')](handleEntityNotFound(_0x41013d,null))['then'](function(){_0xb76499[_0x7049('0x56')](_0x16e1dc[_0x7049('0x55')]['id']);})[_0x7049('0x26')](respondWithStatusCode(_0x41013d,null))[_0x7049('0x46')](handleError(_0x41013d,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index b3a69a7..5277547 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 _0x8cfd=['util','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8cfd,0x1c1));var _0xd8cf=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0x8cfd[_0x3bd52b];return _0x1e5b89;};'use strict';var _=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd8cf('0x2'));var rp=require(_0xd8cf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8cf('0x4'));var config=require(_0xd8cf('0x5'));var attributes=require(_0xd8cf('0x6'));module[_0xd8cf('0x7')]=function(_0x427ace,_0x580928){return _0x427ace[_0xd8cf('0x8')](_0xd8cf('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16bb=['bluebird','request-promise','path','../../config/environment','./schedule.attributes','exports','define','Schedule','util','../../config/logger','api','moment'];(function(_0x12aba8,_0x40a036){var _0x2aac66=function(_0x3e56b7){while(--_0x3e56b7){_0x12aba8['push'](_0x12aba8['shift']());}};_0x2aac66(++_0x40a036);}(_0x16bb,0x80));var _0xb16b=function(_0x1e5e63,_0x4a8ddb){_0x1e5e63=_0x1e5e63-0x0;var _0x5d9c31=_0x16bb[_0x1e5e63];return _0x5d9c31;};'use strict';var _=require('lodash');var util=require(_0xb16b('0x0'));var logger=require(_0xb16b('0x1'))(_0xb16b('0x2'));var moment=require(_0xb16b('0x3'));var BPromise=require(_0xb16b('0x4'));var rp=require(_0xb16b('0x5'));var fs=require('fs');var path=require(_0xb16b('0x6'));var rimraf=require('rimraf');var config=require(_0xb16b('0x7'));var attributes=require(_0xb16b('0x8'));module[_0xb16b('0x9')]=function(_0x31c3ba,_0x1bcf2b){return _0x31c3ba[_0xb16b('0xa')](_0xb16b('0xb'),attributes,{'tableName':'tools_schedules','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 fece990..1c6beaf 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 _0x3bfe=['../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3e6b2f,_0x1ffa07){var _0x323215=function(_0x5c4d82){while(--_0x5c4d82){_0x3e6b2f['push'](_0x3e6b2f['shift']());}};_0x323215(++_0x1ffa07);}(_0x3bfe,0x100));var _0xe3bf=function(_0x456f70,_0x66f4e5){_0x456f70=_0x456f70-0x0;var _0x12c9e8=_0x3bfe[_0x456f70];return _0x12c9e8;};'use strict';var _=require(_0xe3bf('0x0'));var util=require(_0xe3bf('0x1'));var moment=require(_0xe3bf('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3bf('0x3'));var fs=require('fs');var Redis=require(_0xe3bf('0x4'));var db=require(_0xe3bf('0x5'))['db'];var utils=require(_0xe3bf('0x6'));var logger=require('../../config/logger')(_0xe3bf('0x7'));var config=require(_0xe3bf('0x8'));var jayson=require(_0xe3bf('0x9'));var client=jayson[_0xe3bf('0xa')][_0xe3bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x487175,_0x355b6f,_0x1e2eee){return new BPromise(function(_0x394848,_0x49194a){return client[_0xe3bf('0xc')](_0x487175,_0x1e2eee)[_0xe3bf('0xd')](function(_0x30250f){logger[_0xe3bf('0xe')](_0xe3bf('0xf'),_0x355b6f,_0xe3bf('0x10'));logger[_0xe3bf('0x11')](_0xe3bf('0x12'),_0x355b6f,_0xe3bf('0x10'),JSON[_0xe3bf('0x13')](_0x30250f));if(_0x30250f[_0xe3bf('0x14')]){if(_0x30250f[_0xe3bf('0x14')]['code']===0x1f4){logger[_0xe3bf('0x14')](_0xe3bf('0xf'),_0x355b6f,_0x30250f[_0xe3bf('0x14')]['message']);return _0x49194a(_0x30250f['error'][_0xe3bf('0x15')]);}logger[_0xe3bf('0x14')](_0xe3bf('0xf'),_0x355b6f,_0x30250f[_0xe3bf('0x14')][_0xe3bf('0x15')]);return _0x394848(_0x30250f[_0xe3bf('0x14')]['message']);}else{logger[_0xe3bf('0xe')](_0xe3bf('0xf'),_0x355b6f,_0xe3bf('0x10'));_0x394848(_0x30250f[_0xe3bf('0x16')][_0xe3bf('0x15')]);}})[_0xe3bf('0x17')](function(_0x2ffe99){logger['error']('Schedule,\x20%s,\x20%s',_0x355b6f,_0x2ffe99);_0x49194a(_0x2ffe99);});});} \ No newline at end of file +var _0x318a=['request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x151ab5,_0x2d7459){var _0x46acfa=function(_0x5b331a){while(--_0x5b331a){_0x151ab5['push'](_0x151ab5['shift']());}};_0x46acfa(++_0x2d7459);}(_0x318a,0xde));var _0xa318=function(_0x59e0e1,_0x228668){_0x59e0e1=_0x59e0e1-0x0;var _0x2f781f=_0x318a[_0x59e0e1];return _0x2f781f;};'use strict';var _=require(_0xa318('0x0'));var util=require(_0xa318('0x1'));var moment=require('moment');var BPromise=require(_0xa318('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa318('0x3'))['db'];var utils=require(_0xa318('0x4'));var logger=require('../../config/logger')(_0xa318('0x5'));var config=require(_0xa318('0x6'));var jayson=require(_0xa318('0x7'));var client=jayson[_0xa318('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2762d8,_0x4c5616,_0x144222){return new BPromise(function(_0x30348b,_0x560acd){return client[_0xa318('0x9')](_0x2762d8,_0x144222)[_0xa318('0xa')](function(_0xe81a73){logger['info'](_0xa318('0xb'),_0x4c5616,_0xa318('0xc'));logger[_0xa318('0xd')](_0xa318('0xe'),_0x4c5616,_0xa318('0xc'),JSON[_0xa318('0xf')](_0xe81a73));if(_0xe81a73['error']){if(_0xe81a73['error'][_0xa318('0x10')]===0x1f4){logger[_0xa318('0x11')](_0xa318('0xb'),_0x4c5616,_0xe81a73[_0xa318('0x11')][_0xa318('0x12')]);return _0x560acd(_0xe81a73[_0xa318('0x11')][_0xa318('0x12')]);}logger['error'](_0xa318('0xb'),_0x4c5616,_0xe81a73[_0xa318('0x11')][_0xa318('0x12')]);return _0x30348b(_0xe81a73[_0xa318('0x11')]['message']);}else{logger[_0xa318('0x13')](_0xa318('0xb'),_0x4c5616,_0xa318('0xc'));_0x30348b(_0xe81a73['result']['message']);}})[_0xa318('0x14')](function(_0x214011){logger[_0xa318('0x11')](_0xa318('0xb'),_0x4c5616,_0x214011);_0x560acd(_0x214011);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 2e35918..e77a856 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 _0xe54e=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','download'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0xe54e,0x1e8));var _0xee54=function(_0xa46df1,_0x5135fa){_0xa46df1=_0xa46df1-0x0;var _0x9ba134=_0xe54e[_0xa46df1];return _0x9ba134;};'use strict';var multer=require(_0xee54('0x0'));var util=require(_0xee54('0x1'));var path=require(_0xee54('0x2'));var timeout=require(_0xee54('0x3'));var express=require(_0xee54('0x4'));var router=express[_0xee54('0x5')]();var fs_extra=require(_0xee54('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xee54('0x7'));var config=require('../../config/environment');var controller=require(_0xee54('0x8'));router[_0xee54('0x9')]('/',auth[_0xee54('0xa')](),controller[_0xee54('0xb')]);router[_0xee54('0x9')](_0xee54('0xc'),auth[_0xee54('0xa')](),controller['describe']);router[_0xee54('0x9')](_0xee54('0xd'),auth[_0xee54('0xa')](),controller[_0xee54('0xe')]);router[_0xee54('0x9')]('/:id/download',auth[_0xee54('0xa')](),controller[_0xee54('0xf')]);router['post']('/',auth[_0xee54('0xa')](),controller[_0xee54('0x10')]);router[_0xee54('0x11')]('/:id',auth[_0xee54('0xa')](),controller[_0xee54('0x12')]);router['delete']('/:id',auth[_0xee54('0xa')](),controller[_0xee54('0x13')]);module[_0xee54('0x14')]=router; \ No newline at end of file +var _0x4dc0=['isAuthenticated','index','/describe','/:id','show','/:id/download','post','create','put','update','delete','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get'];(function(_0x1685e6,_0x55ee67){var _0x346233=function(_0x421874){while(--_0x421874){_0x1685e6['push'](_0x1685e6['shift']());}};_0x346233(++_0x55ee67);}(_0x4dc0,0xb6));var _0x04dc=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4dc0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require('multer');var util=require(_0x04dc('0x0'));var path=require('path');var timeout=require(_0x04dc('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x04dc('0x2'));var auth=require(_0x04dc('0x3'));var interaction=require(_0x04dc('0x4'));var config=require(_0x04dc('0x5'));var controller=require(_0x04dc('0x6'));router[_0x04dc('0x7')]('/',auth[_0x04dc('0x8')](),controller[_0x04dc('0x9')]);router['get'](_0x04dc('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x04dc('0x7')](_0x04dc('0xb'),auth[_0x04dc('0x8')](),controller[_0x04dc('0xc')]);router[_0x04dc('0x7')](_0x04dc('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x04dc('0xe')]('/',auth[_0x04dc('0x8')](),controller[_0x04dc('0xf')]);router[_0x04dc('0x10')](_0x04dc('0xb'),auth[_0x04dc('0x8')](),controller[_0x04dc('0x11')]);router[_0x04dc('0x12')](_0x04dc('0xb'),auth[_0x04dc('0x8')](),controller['destroy']);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 e80c5e2..4e709f9 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 _0xd070=['startedAt','subtract','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','closedAt','format','createdAt','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER'];(function(_0x3d3e50,_0x67882c){var _0x4273cb=function(_0x2382b5){while(--_0x2382b5){_0x3d3e50['push'](_0x3d3e50['shift']());}};_0x4273cb(++_0x67882c);}(_0xd070,0x8e));var _0x0d07=function(_0xd14d39,_0x23b26c){_0xd14d39=_0xd14d39-0x0;var _0x5c727c=_0xd070[_0xd14d39];return _0x5c727c;};'use strict';var Sequelize=require(_0x0d07('0x0'));var moment=require('moment');var path=require(_0x0d07('0x1'));var config=require(_0x0d07('0x2'));module[_0x0d07('0x3')]={'format':{'type':Sequelize[_0x0d07('0x4')],'get':function(){return this[_0x0d07('0x5')](_0x0d07('0x6'))?path[_0x0d07('0x7')](this[_0x0d07('0x5')](_0x0d07('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x0d07('0x8')]},'channel':{'type':Sequelize[_0x0d07('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x13d75a){var _0x5a4366=_0x13d75a[_0x0d07('0x9')](/\\/g,'/');this[_0x0d07('0xa')](_0x0d07('0x6'),_0x5a4366);}},'rating':{'type':Sequelize[_0x0d07('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0d07('0xb')],'set':function(_0xc5b04d){this[_0x0d07('0xa')](_0x0d07('0xc'),moment()[_0x0d07('0xd')](_0xc5b04d,'ms'));this[_0x0d07('0xa')]('closedAt',moment());this['setDataValue'](_0x0d07('0xe'),_0xc5b04d);}},'startedAt':{'type':Sequelize[_0x0d07('0xf')],'get':function(){return moment(this['getDataValue'](_0x0d07('0xc')))['format'](_0x0d07('0x10'))[_0x0d07('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0d07('0x5')](_0x0d07('0x12')))[_0x0d07('0x13')](_0x0d07('0x10'))[_0x0d07('0x11')]();}},'createdAt':{'type':Sequelize[_0x0d07('0xf')],'get':function(){return moment(this['getDataValue'](_0x0d07('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0x0d07('0x11')]();}},'updatedAt':{'type':Sequelize[_0x0d07('0xf')],'get':function(){return moment(this[_0x0d07('0x5')](_0x0d07('0x15')))[_0x0d07('0x13')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0xce04=['sequelize','path','../../config/environment','exports','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','format','MM-DD-YYYY\x20HH:mm','DATE','toString'];(function(_0x477733,_0x25c3d4){var _0x4fbf31=function(_0x5471a3){while(--_0x5471a3){_0x477733['push'](_0x477733['shift']());}};_0x4fbf31(++_0x25c3d4);}(_0xce04,0xc0));var _0x4ce0=function(_0x4b7ee4,_0x79a135){_0x4b7ee4=_0x4b7ee4-0x0;var _0x52ac5d=_0xce04[_0x4b7ee4];return _0x52ac5d;};'use strict';var Sequelize=require(_0x4ce0('0x0'));var moment=require('moment');var path=require(_0x4ce0('0x1'));var config=require(_0x4ce0('0x2'));module[_0x4ce0('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4ce0('0x4')]('value')?path['extname'](this['getDataValue'](_0x4ce0('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x4ce0('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x4ce0('0x6')],'set':function(_0x462871){var _0x5377ab=_0x462871[_0x4ce0('0x7')](/\\/g,'/');this[_0x4ce0('0x8')](_0x4ce0('0x5'),_0x5377ab);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x4ce0('0x9')],'set':function(_0x29c627){this[_0x4ce0('0x8')](_0x4ce0('0xa'),moment()[_0x4ce0('0xb')](_0x29c627,'ms'));this[_0x4ce0('0x8')]('closedAt',moment());this[_0x4ce0('0x8')]('duration',_0x29c627);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x4ce0('0xa')))[_0x4ce0('0xc')](_0x4ce0('0xd'))['toString']();}},'closedAt':{'type':Sequelize[_0x4ce0('0xe')],'get':function(){return moment(this[_0x4ce0('0x4')]('closedAt'))[_0x4ce0('0xc')]('MM-DD-YYYY\x20HH:mm')[_0x4ce0('0xf')]();}},'createdAt':{'type':Sequelize[_0x4ce0('0xe')],'get':function(){return moment(this[_0x4ce0('0x4')]('createdAt'))[_0x4ce0('0xc')](_0x4ce0('0xd'))[_0x4ce0('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4ce0('0x4')]('updatedAt'))['format'](_0x4ce0('0xd'))[_0x4ce0('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index ba3fe3e..dc6481e 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 _0x032e=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','differenceBy','map','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ScreenRecording','rows','catch','show','find','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x579335,_0x51b314){var _0x367429=function(_0x2670b7){while(--_0x2670b7){_0x579335['push'](_0x579335['shift']());}};_0x367429(++_0x51b314);}(_0x032e,0x124));var _0xe032=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x032e[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['ScreenRecording'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_[_0xe032('0x30')](_0x4e8b72,_0xe032('0x29')),[_0xe032('0x31')]);_0x469290['query']=_[_0xe032('0x32')](_0x5573e4[_0xe032('0x33')]);_0x469290[_0xe032('0x34')]=_[_0xe032('0x35')](_0x469290['model'],_0x469290[_0xe032('0x33')]);_0x38e7ea['attributes']=_[_0xe032('0x35')](_0x469290['model'],qs[_0xe032('0x36')](_0x5573e4['query'][_0xe032('0x36')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x37')][_0xe032('0x38')]?_0x38e7ea['attributes']:_0x469290[_0xe032('0x2e')];if(!_0x5573e4[_0xe032('0x33')][_0xe032('0x39')](_0xe032('0x3a'))){_0x38e7ea['limit']=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea[_0xe032('0x1f')]=qs['offset'](_0x5573e4[_0xe032('0x33')][_0xe032('0x1f')]);}_0x38e7ea['order']=qs[_0xe032('0x3b')](_0x5573e4[_0xe032('0x33')][_0xe032('0x3b')]);_0x38e7ea[_0xe032('0x3c')]=qs[_0xe032('0x34')](_[_0xe032('0x3d')](_0x5573e4[_0xe032('0x33')],_0x469290[_0xe032('0x34')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x33')][_0xe032('0x3e')]){_0x38e7ea[_0xe032('0x3c')]=_[_0xe032('0x3f')](_0x38e7ea[_0xe032('0x3c')],{'$or':_[_0xe032('0x30')](_0x4e8b72,function(_0x39af44){if(_0x39af44[_0xe032('0x2d')]!==_0xe032('0x40')){var _0x555914={};_0x555914[_0x39af44[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3e')]+'%'};return _0x555914;}})});}_0x38e7ea=_[_0xe032('0x3f')]({},_0x38e7ea,_0x5573e4[_0xe032('0x41')]);var _0x119790={'where':_0x38e7ea[_0xe032('0x3c')]};return db['ScreenRecording'][_0xe032('0x22')](_0x119790)['then'](function(_0x46ea84){_0xae116e['count']=_0x46ea84;if(_0x5573e4[_0xe032('0x33')][_0xe032('0x42')]){_0x38e7ea[_0xe032('0x43')]=[{'all':!![]}];}return db[_0xe032('0x44')]['findAll'](_0x38e7ea);})[_0xe032('0x27')](function(_0x5a6450){_0xae116e[_0xe032('0x45')]=_0x5a6450;return _0xae116e;})[_0xe032('0x27')](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x46')](handleError(_0x3e2575,null));};exports[_0xe032('0x47')]=function(_0x4b58eb,_0x513b0c){var _0x45345d={'raw':![],'where':{'id':_0x4b58eb['params']['id']}},_0x203021={};_0x203021[_0xe032('0x2e')]=_[_0xe032('0x32')](db[_0xe032('0x44')][_0xe032('0x2b')]);_0x203021[_0xe032('0x33')]=_['keys'](_0x4b58eb[_0xe032('0x33')]);_0x203021[_0xe032('0x34')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],_0x203021[_0xe032('0x33')]);_0x45345d[_0xe032('0x37')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],qs['fields'](_0x4b58eb['query'][_0xe032('0x36')]));_0x45345d['attributes']=_0x45345d[_0xe032('0x37')][_0xe032('0x38')]?_0x45345d[_0xe032('0x37')]:_0x203021[_0xe032('0x2e')];if(_0x4b58eb[_0xe032('0x33')][_0xe032('0x42')]){_0x45345d[_0xe032('0x43')]=[{'all':!![]}];}_0x45345d=_[_0xe032('0x3f')]({},_0x45345d,_0x4b58eb[_0xe032('0x41')]);return db['ScreenRecording'][_0xe032('0x48')](_0x45345d)['then'](handleEntityNotFound(_0x513b0c,null))['then'](respondWithResult(_0x513b0c,null))[_0xe032('0x46')](handleError(_0x513b0c,null));};exports[_0xe032('0x49')]=function(_0x62bfc8,_0x1e54d3){return db['ScreenRecording'][_0xe032('0x49')](_0x62bfc8[_0xe032('0x4a')],{})[_0xe032('0x27')](respondWithResult(_0x1e54d3,0xc9))[_0xe032('0x46')](handleError(_0x1e54d3,null));};exports[_0xe032('0x26')]=function(_0x233d9e,_0x3774bc){if(_0x233d9e['body']['id']){delete _0x233d9e[_0xe032('0x4a')]['id'];}delete _0x233d9e[_0xe032('0x4a')]['duration'];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4b')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4c')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4d')];return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x233d9e[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x3774bc,null))[_0xe032('0x27')](saveUpdates(_0x233d9e[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x3774bc,null))[_0xe032('0x46')](handleError(_0x3774bc,null));};exports['describe']=function(_0x1c8b32,_0x53c8b2){return db[_0xe032('0x44')][_0xe032('0x4f')]()[_0xe032('0x27')](respondWithResult(_0x53c8b2,null))[_0xe032('0x46')](handleError(_0x53c8b2,null));};exports[_0xe032('0x50')]=function(_0x1b7a91,_0x2e29d3,_0xa98ee6){var _0x16c91e=require(_0xe032('0x51'));var _0x1b9012=![];var _0x564fe0={};if(_0x1b7a91[_0xe032('0x33')][_0xe032('0x2d')]&&_0x1b7a91['query'][_0xe032('0x2d')]==='uniqueid'){_0x564fe0[_0xe032('0x52')]=_0x1b7a91[_0xe032('0x4e')]['id'];}else{_0x564fe0['id']=_0x1b7a91[_0xe032('0x4e')]['id'];}return db[_0xe032('0x44')][_0xe032('0x48')]({'where':_0x564fe0,'attributes':['id','value'],'raw':!![]})[_0xe032('0x27')](handleEntityNotFound(_0x2e29d3,null))[_0xe032('0x27')](function(_0x1e1277){if(_0x1e1277){var _0x21a32f=path[_0xe032('0x53')](config[_0xe032('0x54')],_0xe032('0x55'),_0x1e1277['value']);var _0x3f46c0=util[_0xe032('0x31')](_0xe032('0x56'),_0x21a32f);if(fs[_0xe032('0x57')](_0x3f46c0)){_0x1b9012=!![];return _0x16c91e[_0xe032('0x58')](_0x3f46c0,_0x21a32f,config[_0xe032('0x59')][_0xe032('0x5a')])[_0xe032('0x27')](function(){return _0x1e1277;});}return _0x1e1277;}})[_0xe032('0x27')](function(_0x54c0b0){if(_0x54c0b0){var _0x795a58=path[_0xe032('0x53')](config[_0xe032('0x54')],'server/files/screen_recordings',_0x54c0b0[_0xe032('0x4d')]);if(!fs[_0xe032('0x57')](_0x795a58)){throw new db['Sequelize'][(_0xe032('0x5b'))](_0xe032('0x5c'));}if(_0x54c0b0[_0xe032('0x5d')]){return _0x2e29d3[_0xe032('0x50')](_0x795a58,_0x54c0b0[_0xe032('0x5d')]+path[_0xe032('0x5e')](_0x795a58),function(){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}else{return _0x2e29d3[_0xe032('0x50')](_0x795a58,function(_0x1aa18e){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}}})[_0xe032('0x46')](function(_0x505986){if(_0x505986[_0xe032('0x60')]===_0xe032('0x5c')){_0x2e29d3[_0xe032('0x1d')](0x194)[_0xe032('0x2a')](_0xe032('0x61'));}else{return handleError(_0x2e29d3,null);}});};exports['destroy']=function(_0x2b6ef8,_0x55e6b0){return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x2b6ef8[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](function(_0x3c5eb8){if(_[_0xe032('0x62')](_0x3c5eb8)){throw new ReferenceError(_0xe032('0x63'));}return _0x3c5eb8;})[_0xe032('0x27')](function(_0x22fd01){var _0x536510=path['join'](config['root'],_0xe032('0x55'),_0x22fd01[_0xe032('0x4d')]);logger[_0xe032('0x64')](_0xe032('0x65'),_0x536510);if(!_[_0xe032('0x62')](_0x22fd01[_0xe032('0x4d')])&&fs['existsSync'](_0x536510)){logger[_0xe032('0x64')](_0xe032('0x66')+_0x536510+_0xe032('0x67'));fs['unlinkSync'](_0x536510);}_0x536510=_0x536510+_0xe032('0x68');if(!_['isNil'](_0x22fd01[_0xe032('0x4d')])&&fs[_0xe032('0x57')](_0x536510)){logger['info']('File:\x20\x22'+_0x536510+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe032('0x69')](_0x536510);}return _0x22fd01;})['then'](function(_0x5157f7){if(!_0x5157f7)throw new InternalError();return _0x5157f7[_0xe032('0x6a')]();})[_0xe032('0x27')](function(){_0x55e6b0[_0xe032('0x1d')](0xcc)['end']();})[_0xe032('0x46')](handleError(_0x55e6b0,null));}; \ No newline at end of file +var _0x2eb2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','end','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf'];(function(_0x3ea4f4,_0x186e21){var _0x365eed=function(_0x32c7b1){while(--_0x32c7b1){_0x3ea4f4['push'](_0x3ea4f4['shift']());}};_0x365eed(++_0x186e21);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x2eb2[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22eb('0x0'));var zipdir=require(_0x22eb('0x1'));var jsonpatch=require(_0x22eb('0x2'));var rp=require(_0x22eb('0x3'));var moment=require(_0x22eb('0x4'));var BPromise=require(_0x22eb('0x5'));var Mustache=require('mustache');var util=require(_0x22eb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x22eb('0x7'));var ejs=require(_0x22eb('0x8'));var fs=require('fs');var fs_extra=require(_0x22eb('0x9'));var _=require(_0x22eb('0xa'));var squel=require(_0x22eb('0xb'));var crypto=require(_0x22eb('0xc'));var jsforce=require(_0x22eb('0xd'));var deskjs=require(_0x22eb('0xe'));var toCsv=require(_0x22eb('0x7'));var querystring=require(_0x22eb('0xf'));var Papa=require(_0x22eb('0x10'));var Redis=require(_0x22eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22eb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22eb('0x13'))('api');var utils=require(_0x22eb('0x14'));var config=require(_0x22eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xcc;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0x16')](_0x189f05);}return _0x1f286c[_0x22eb('0x17')](_0x189f05)['end']();};}function respondWithResult(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0xc8;return function(_0x1f5089){if(_0x1f5089){return _0x350ade['status'](_0x53f14e)[_0x22eb('0x18')](_0x1f5089);}};}function respondWithFilteredResult(_0x84c668,_0x53abbf){return function(_0x48b63c){if(_0x48b63c){var _0x4bc29a=typeof _0x53abbf[_0x22eb('0x19')]==='undefined'&&typeof _0x53abbf['limit']===_0x22eb('0x1a');var _0x4d9a71=_0x48b63c['count'];var _0xb7a73a=_0x4bc29a?0x0:_0x53abbf[_0x22eb('0x19')];var _0x385bcb=_0x4bc29a?_0x48b63c[_0x22eb('0x1b')]:_0x53abbf[_0x22eb('0x19')]+_0x53abbf['limit'];var _0x4182a8;if(_0x385bcb>=_0x4d9a71){_0x385bcb=_0x4d9a71;_0x4182a8=0xc8;}else{_0x4182a8=0xce;}_0x84c668[_0x22eb('0x17')](_0x4182a8);return _0x84c668[_0x22eb('0x1c')](_0x22eb('0x1d'),_0xb7a73a+'-'+_0x385bcb+'/'+_0x4d9a71)[_0x22eb('0x18')](_0x48b63c);}return null;};}function patchUpdates(_0x517313){return function(_0x2eb115){try{jsonpatch[_0x22eb('0x1e')](_0x2eb115,_0x517313,!![]);}catch(_0x2fc36e){return BPromise['reject'](_0x2fc36e);}return _0x2eb115['save']();};}function saveUpdates(_0x4335b7,_0x267d97){return function(_0x434ecb){if(_0x434ecb){return _0x434ecb[_0x22eb('0x1f')](_0x4335b7)[_0x22eb('0x20')](function(_0x3e8c1c){return _0x3e8c1c;});}return null;};}function removeEntity(_0x43dacb,_0x4e7e69){return function(_0x2e8f7c){if(_0x2e8f7c){return _0x2e8f7c[_0x22eb('0x21')]()[_0x22eb('0x20')](function(){_0x43dacb[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();});}};}function handleEntityNotFound(_0x4da252,_0x12c133){return function(_0x6f8ff3){if(!_0x6f8ff3){_0x4da252[_0x22eb('0x16')](0x194);}return _0x6f8ff3;};}function handleError(_0x5a001e,_0xe0783c){_0xe0783c=_0xe0783c||0x1f4;return function(_0x259847){logger['error'](_0x259847[_0x22eb('0x23')]);if(_0x259847[_0x22eb('0x24')]){delete _0x259847[_0x22eb('0x24')];}_0x5a001e[_0x22eb('0x17')](_0xe0783c)[_0x22eb('0x25')](_0x259847);};}exports['index']=function(_0x49dd59,_0x2a950e){var _0x25e5bc={},_0x44cf91={},_0x7c0119={'count':0x0,'rows':[]};var _0x1599c7=_[_0x22eb('0x26')](db[_0x22eb('0x27')][_0x22eb('0x28')],function(_0x382784){return{'name':_0x382784[_0x22eb('0x29')],'type':_0x382784[_0x22eb('0x2a')][_0x22eb('0x2b')]};});_0x44cf91['model']=_[_0x22eb('0x2c')](_['map'](_0x1599c7,_0x22eb('0x24')),[_0x22eb('0x2d')]);_0x44cf91[_0x22eb('0x2e')]=_[_0x22eb('0x2f')](_0x49dd59[_0x22eb('0x2e')]);_0x44cf91[_0x22eb('0x30')]=_[_0x22eb('0x31')](_0x44cf91[_0x22eb('0x32')],_0x44cf91[_0x22eb('0x2e')]);_0x25e5bc[_0x22eb('0x33')]=_['intersection'](_0x44cf91['model'],qs[_0x22eb('0x34')](_0x49dd59['query']['fields']));_0x25e5bc[_0x22eb('0x33')]=_0x25e5bc[_0x22eb('0x33')][_0x22eb('0x35')]?_0x25e5bc[_0x22eb('0x33')]:_0x44cf91[_0x22eb('0x32')];if(!_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x36')](_0x22eb('0x37'))){_0x25e5bc[_0x22eb('0x38')]=qs[_0x22eb('0x38')](_0x49dd59['query'][_0x22eb('0x38')]);_0x25e5bc['offset']=qs['offset'](_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x19')]);}_0x25e5bc['order']=qs[_0x22eb('0x39')](_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x39')]);_0x25e5bc[_0x22eb('0x3a')]=qs[_0x22eb('0x30')](_['pick'](_0x49dd59[_0x22eb('0x2e')],_0x44cf91[_0x22eb('0x30')]),_0x1599c7);if(_0x49dd59['query'][_0x22eb('0x3b')]){_0x25e5bc[_0x22eb('0x3a')]=_[_0x22eb('0x3c')](_0x25e5bc[_0x22eb('0x3a')],{'$or':_[_0x22eb('0x26')](_0x1599c7,function(_0x5382eb){if(_0x5382eb['type']!==_0x22eb('0x3d')){var _0x6cd651={};_0x6cd651[_0x5382eb['name']]={'$like':'%'+_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x3b')]+'%'};return _0x6cd651;}})});}_0x25e5bc=_[_0x22eb('0x3c')]({},_0x25e5bc,_0x49dd59['options']);var _0x1d977c={'where':_0x25e5bc[_0x22eb('0x3a')]};return db[_0x22eb('0x27')][_0x22eb('0x1b')](_0x1d977c)[_0x22eb('0x20')](function(_0x39778e){_0x7c0119['count']=_0x39778e;if(_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x3e')]){_0x25e5bc['include']=[{'all':!![]}];}return db[_0x22eb('0x27')][_0x22eb('0x3f')](_0x25e5bc);})[_0x22eb('0x20')](function(_0x30cb10){_0x7c0119[_0x22eb('0x40')]=_0x30cb10;return _0x7c0119;})[_0x22eb('0x20')](respondWithFilteredResult(_0x2a950e,_0x25e5bc))[_0x22eb('0x41')](handleError(_0x2a950e,null));};exports[_0x22eb('0x42')]=function(_0x1bafa3,_0x82ace8){var _0x3e1826={'raw':![],'where':{'id':_0x1bafa3[_0x22eb('0x43')]['id']}},_0x1cf1e0={};_0x1cf1e0[_0x22eb('0x32')]=_[_0x22eb('0x2f')](db[_0x22eb('0x27')][_0x22eb('0x28')]);_0x1cf1e0[_0x22eb('0x2e')]=_['keys'](_0x1bafa3[_0x22eb('0x2e')]);_0x1cf1e0[_0x22eb('0x30')]=_['intersection'](_0x1cf1e0[_0x22eb('0x32')],_0x1cf1e0[_0x22eb('0x2e')]);_0x3e1826['attributes']=_['intersection'](_0x1cf1e0['model'],qs[_0x22eb('0x34')](_0x1bafa3[_0x22eb('0x2e')]['fields']));_0x3e1826['attributes']=_0x3e1826[_0x22eb('0x33')][_0x22eb('0x35')]?_0x3e1826[_0x22eb('0x33')]:_0x1cf1e0[_0x22eb('0x32')];if(_0x1bafa3[_0x22eb('0x2e')][_0x22eb('0x3e')]){_0x3e1826[_0x22eb('0x44')]=[{'all':!![]}];}_0x3e1826=_[_0x22eb('0x3c')]({},_0x3e1826,_0x1bafa3['options']);return db['ScreenRecording'][_0x22eb('0x45')](_0x3e1826)['then'](handleEntityNotFound(_0x82ace8,null))[_0x22eb('0x20')](respondWithResult(_0x82ace8,null))['catch'](handleError(_0x82ace8,null));};exports[_0x22eb('0x46')]=function(_0x5c41c0,_0x4b2f86){return db['ScreenRecording']['create'](_0x5c41c0[_0x22eb('0x47')],{})['then'](respondWithResult(_0x4b2f86,0xc9))[_0x22eb('0x41')](handleError(_0x4b2f86,null));};exports[_0x22eb('0x1f')]=function(_0x490bef,_0x24e6ba){if(_0x490bef['body']['id']){delete _0x490bef[_0x22eb('0x47')]['id'];}delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x48')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x49')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x4a')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x4b')];return db['ScreenRecording'][_0x22eb('0x45')]({'where':{'id':_0x490bef[_0x22eb('0x43')]['id']}})['then'](handleEntityNotFound(_0x24e6ba,null))[_0x22eb('0x20')](saveUpdates(_0x490bef[_0x22eb('0x47')],null))[_0x22eb('0x20')](respondWithResult(_0x24e6ba,null))[_0x22eb('0x41')](handleError(_0x24e6ba,null));};exports['describe']=function(_0x6c0600,_0x169ae1){return db[_0x22eb('0x27')][_0x22eb('0x4c')]()[_0x22eb('0x20')](respondWithResult(_0x169ae1,null))[_0x22eb('0x41')](handleError(_0x169ae1,null));};exports['download']=function(_0x29d7ca,_0x4e5b9f,_0x3ff406){var _0x5eecef=require(_0x22eb('0x4d'));var _0x254b53=![];var _0x4028ef={};if(_0x29d7ca[_0x22eb('0x2e')][_0x22eb('0x2a')]&&_0x29d7ca['query']['type']===_0x22eb('0x4e')){_0x4028ef[_0x22eb('0x4e')]=_0x29d7ca['params']['id'];}else{_0x4028ef['id']=_0x29d7ca[_0x22eb('0x43')]['id'];}return db[_0x22eb('0x27')][_0x22eb('0x45')]({'where':_0x4028ef,'attributes':['id',_0x22eb('0x4b')],'raw':!![]})[_0x22eb('0x20')](handleEntityNotFound(_0x4e5b9f,null))[_0x22eb('0x20')](function(_0x3a8588){if(_0x3a8588){var _0x35c997=path[_0x22eb('0x4f')](config[_0x22eb('0x50')],_0x22eb('0x51'),_0x3a8588['value']);var _0x19cadf=util[_0x22eb('0x2d')](_0x22eb('0x52'),_0x35c997);if(fs[_0x22eb('0x53')](_0x19cadf)){_0x254b53=!![];return _0x5eecef[_0x22eb('0x54')](_0x19cadf,_0x35c997,config[_0x22eb('0x55')][_0x22eb('0x56')])[_0x22eb('0x20')](function(){return _0x3a8588;});}return _0x3a8588;}})[_0x22eb('0x20')](function(_0x9f8465){if(_0x9f8465){var _0x3e9ab5=path[_0x22eb('0x4f')](config[_0x22eb('0x50')],_0x22eb('0x51'),_0x9f8465['value']);if(!fs['existsSync'](_0x3e9ab5)){throw new db[(_0x22eb('0x57'))][(_0x22eb('0x58'))](_0x22eb('0x59'));}if(_0x9f8465[_0x22eb('0x5a')]){return _0x4e5b9f[_0x22eb('0x5b')](_0x3e9ab5,_0x9f8465['filename']+path[_0x22eb('0x5c')](_0x3e9ab5),function(){if(_0x254b53){fs[_0x22eb('0x5d')](_0x3e9ab5);}});}else{return _0x4e5b9f['download'](_0x3e9ab5,function(_0x485408){if(_0x254b53){fs[_0x22eb('0x5d')](_0x3e9ab5);}});}}})[_0x22eb('0x41')](function(_0xb5c8ae){if(_0xb5c8ae[_0x22eb('0x5e')]===_0x22eb('0x59')){_0x4e5b9f[_0x22eb('0x17')](0x194)[_0x22eb('0x25')](_0x22eb('0x5f'));}else{return handleError(_0x4e5b9f,null);}});};exports[_0x22eb('0x21')]=function(_0x19b579,_0x164645){return db[_0x22eb('0x27')][_0x22eb('0x45')]({'where':{'id':_0x19b579[_0x22eb('0x43')]['id']}})['then'](function(_0x29dd8b){if(_[_0x22eb('0x60')](_0x29dd8b)){throw new ReferenceError(_0x22eb('0x61'));}return _0x29dd8b;})['then'](function(_0x1787ec){var _0x5ac4c5=path[_0x22eb('0x4f')](config['root'],_0x22eb('0x51'),_0x1787ec[_0x22eb('0x4b')]);logger['info'](_0x22eb('0x62'),_0x5ac4c5);if(!_[_0x22eb('0x60')](_0x1787ec['value'])&&fs['existsSync'](_0x5ac4c5)){logger[_0x22eb('0x63')](_0x22eb('0x64')+_0x5ac4c5+_0x22eb('0x65'));fs[_0x22eb('0x66')](_0x5ac4c5);}_0x5ac4c5=_0x5ac4c5+_0x22eb('0x67');if(!_[_0x22eb('0x60')](_0x1787ec['value'])&&fs[_0x22eb('0x53')](_0x5ac4c5)){logger['info']('File:\x20\x22'+_0x5ac4c5+_0x22eb('0x65'));fs[_0x22eb('0x66')](_0x5ac4c5);}return _0x1787ec;})[_0x22eb('0x20')](function(_0x22b5c6){if(!_0x22b5c6)throw new InternalError();return _0x22b5c6[_0x22eb('0x21')]();})[_0x22eb('0x20')](function(){_0x164645[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();})['catch'](handleError(_0x164645,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 3c9fc52..0e4c70a 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 _0x032f=['interactionid','lodash','../../config/logger','api','bluebird','path','rimraf','./screenRecording.attributes','screen_recordings'];(function(_0x4f57db,_0x7373a9){var _0x3929fd=function(_0x2fdd06){while(--_0x2fdd06){_0x4f57db['push'](_0x4f57db['shift']());}};_0x3929fd(++_0x7373a9);}(_0x032f,0xb5));var _0xf032=function(_0x31724d,_0x386e5f){_0x31724d=_0x31724d-0x0;var _0x7473d5=_0x032f[_0x31724d];return _0x7473d5;};'use strict';var _=require(_0xf032('0x0'));var util=require('util');var logger=require(_0xf032('0x1'))(_0xf032('0x2'));var moment=require('moment');var BPromise=require(_0xf032('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf032('0x4'));var rimraf=require(_0xf032('0x5'));var config=require('../../config/environment');var attributes=require(_0xf032('0x6'));module['exports']=function(_0x29290b,_0x2bc1a3){return _0x29290b['define']('ScreenRecording',attributes,{'tableName':_0xf032('0x7'),'paranoid':![],'indexes':[{'name':_0xf032('0x8'),'fields':[_0xf032('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2088=['interactionid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings'];(function(_0x1dd242,_0x1c61a3){var _0x1c6510=function(_0x3df61b){while(--_0x3df61b){_0x1dd242['push'](_0x1dd242['shift']());}};_0x1c6510(++_0x1c61a3);}(_0x2088,0x189));var _0x8208=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0x2088[_0x296754];return _0x1d9f1d;};'use strict';var _=require(_0x8208('0x0'));var util=require(_0x8208('0x1'));var logger=require('../../config/logger')(_0x8208('0x2'));var moment=require(_0x8208('0x3'));var BPromise=require('bluebird');var rp=require(_0x8208('0x4'));var fs=require('fs');var path=require(_0x8208('0x5'));var rimraf=require(_0x8208('0x6'));var config=require(_0x8208('0x7'));var attributes=require(_0x8208('0x8'));module[_0x8208('0x9')]=function(_0x5eaac3,_0x1fa55a){return _0x5eaac3[_0x8208('0xa')](_0x8208('0xb'),attributes,{'tableName':_0x8208('0xc'),'paranoid':![],'indexes':[{'name':_0x8208('0xd'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index f56a206..90131ae 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 _0xb6d5=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x1e6fd1,_0x333352){var _0xcd8de1=function(_0x3a9e1f){while(--_0x3a9e1f){_0x1e6fd1['push'](_0x1e6fd1['shift']());}};_0xcd8de1(++_0x333352);}(_0xb6d5,0x67));var _0x5b6d=function(_0x165c96,_0x2269de){_0x165c96=_0x165c96-0x0;var _0x5c2420=_0xb6d5[_0x165c96];return _0x5c2420;};'use strict';var _=require(_0x5b6d('0x0'));var util=require(_0x5b6d('0x1'));var moment=require(_0x5b6d('0x2'));var BPromise=require(_0x5b6d('0x3'));var rs=require(_0x5b6d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b6d('0x5'))['db'];var utils=require(_0x5b6d('0x6'));var logger=require(_0x5b6d('0x7'))(_0x5b6d('0x8'));var config=require(_0x5b6d('0x9'));var jayson=require(_0x5b6d('0xa'));var client=jayson[_0x5b6d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x310a98,_0x58e636,_0x4056ba){return new BPromise(function(_0x1bc53c,_0xb565c8){return client[_0x5b6d('0xc')](_0x310a98,_0x4056ba)[_0x5b6d('0xd')](function(_0x24a70d){logger[_0x5b6d('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x58e636,_0x5b6d('0xf'));logger[_0x5b6d('0x10')](_0x5b6d('0x11'),_0x58e636,'request\x20sent',JSON[_0x5b6d('0x12')](_0x24a70d));if(_0x24a70d[_0x5b6d('0x13')]){if(_0x24a70d[_0x5b6d('0x13')]['code']===0x1f4){logger[_0x5b6d('0x13')](_0x5b6d('0x14'),_0x58e636,_0x24a70d['error']['message']);return _0xb565c8(_0x24a70d[_0x5b6d('0x13')][_0x5b6d('0x15')]);}logger['error'](_0x5b6d('0x14'),_0x58e636,_0x24a70d[_0x5b6d('0x13')][_0x5b6d('0x15')]);return _0x1bc53c(_0x24a70d[_0x5b6d('0x13')][_0x5b6d('0x15')]);}else{logger['info'](_0x5b6d('0x14'),_0x58e636,_0x5b6d('0xf'));_0x1bc53c(_0x24a70d[_0x5b6d('0x16')][_0x5b6d('0x15')]);}})[_0x5b6d('0x17')](function(_0x2fc4d0){logger[_0x5b6d('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x58e636,_0x2fc4d0);_0xb565c8(_0x2fc4d0);});});} \ No newline at end of file +var _0x535a=['request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x535a,0x136));var _0xa535=function(_0x496b59,_0x54283d){_0x496b59=_0x496b59-0x0;var _0x23b37f=_0x535a[_0x496b59];return _0x23b37f;};'use strict';var _=require(_0xa535('0x0'));var util=require(_0xa535('0x1'));var moment=require(_0xa535('0x2'));var BPromise=require(_0xa535('0x3'));var rs=require(_0xa535('0x4'));var fs=require('fs');var Redis=require(_0xa535('0x5'));var db=require(_0xa535('0x6'))['db'];var utils=require(_0xa535('0x7'));var logger=require(_0xa535('0x8'))(_0xa535('0x9'));var config=require(_0xa535('0xa'));var jayson=require(_0xa535('0xb'));var client=jayson[_0xa535('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f6a39,_0x400151,_0x54d974){return new BPromise(function(_0x38bd8a,_0x205a85){return client[_0xa535('0xd')](_0x2f6a39,_0x54d974)['then'](function(_0x5b1f84){logger[_0xa535('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x400151,_0xa535('0xf'));logger[_0xa535('0x10')](_0xa535('0x11'),_0x400151,_0xa535('0xf'),JSON[_0xa535('0x12')](_0x5b1f84));if(_0x5b1f84[_0xa535('0x13')]){if(_0x5b1f84[_0xa535('0x13')][_0xa535('0x14')]===0x1f4){logger['error'](_0xa535('0x15'),_0x400151,_0x5b1f84[_0xa535('0x13')]['message']);return _0x205a85(_0x5b1f84[_0xa535('0x13')][_0xa535('0x16')]);}logger[_0xa535('0x13')](_0xa535('0x15'),_0x400151,_0x5b1f84['error'][_0xa535('0x16')]);return _0x38bd8a(_0x5b1f84[_0xa535('0x13')][_0xa535('0x16')]);}else{logger[_0xa535('0xe')](_0xa535('0x15'),_0x400151,_0xa535('0xf'));_0x38bd8a(_0x5b1f84[_0xa535('0x17')][_0xa535('0x16')]);}})[_0xa535('0x18')](function(_0x4070bc){logger['error'](_0xa535('0x15'),_0x400151,_0x4070bc);_0x205a85(_0x4070bc);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 51d17dc..289e096 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 _0xa5f7=['file','join','/:id/logo_login','addLogoLogin','addPreferred','addFavicon','update','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/:id','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','extname','originalname','post','single'];(function(_0x3e1051,_0xe89bca){var _0x57bf77=function(_0x374cd5){while(--_0x374cd5){_0x3e1051['push'](_0x3e1051['shift']());}};_0x57bf77(++_0xe89bca);}(_0xa5f7,0x10f));var _0x7a5f=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0xa5f7[_0x368bba];return _0x409f8f;};'use strict';var multer=require(_0x7a5f('0x0'));var util=require(_0x7a5f('0x1'));var path=require(_0x7a5f('0x2'));var timeout=require(_0x7a5f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7a5f('0x4'));var interaction=require(_0x7a5f('0x5'));var config=require(_0x7a5f('0x6'));var controller=require(_0x7a5f('0x7'));router['get']('/',auth[_0x7a5f('0x8')](),controller[_0x7a5f('0x9')]);router[_0x7a5f('0xa')]('/now',controller['getDate']);router[_0x7a5f('0xa')](_0x7a5f('0xb'),controller['show']);router[_0x7a5f('0xa')]('/:id/logo',controller['getLogo']);router[_0x7a5f('0xa')]('/:id/logo_login',controller['getLogoLogin']);router[_0x7a5f('0xa')](_0x7a5f('0xc'),controller['gdpr']);router[_0x7a5f('0xa')](_0x7a5f('0xd'),controller[_0x7a5f('0xe')]);router[_0x7a5f('0xa')](_0x7a5f('0xf'),controller[_0x7a5f('0x10')]);var upload=multer({'storage':multer[_0x7a5f('0x11')]({'destination':function(_0x548fb0,_0x382f5c,_0x352166){_0x352166(null,path['join'](config[_0x7a5f('0x12')],_0x7a5f('0x13')));},'filename':function(_0x1e6c9f,_0x4accac,_0x406e07){_0x406e07(null,util[_0x7a5f('0x14')](_0x7a5f('0x15'),'logo',path[_0x7a5f('0x16')](_0x4accac[_0x7a5f('0x17')])));}})});router[_0x7a5f('0x18')]('/:id/logo',upload[_0x7a5f('0x19')](_0x7a5f('0x1a')),controller['addLogo']);var upload=multer({'storage':multer[_0x7a5f('0x11')]({'destination':function(_0x17235d,_0x4b81e6,_0x237eed){_0x237eed(null,path[_0x7a5f('0x1b')](config[_0x7a5f('0x12')],_0x7a5f('0x13')));},'filename':function(_0x8be8c9,_0x40f11a,_0x5f3ae8){_0x5f3ae8(null,util['format']('%s%s','logologin',path[_0x7a5f('0x16')](_0x40f11a['originalname'])));}})});router[_0x7a5f('0x18')](_0x7a5f('0x1c'),upload[_0x7a5f('0x19')](_0x7a5f('0x1a')),controller[_0x7a5f('0x1d')]);var upload=multer({'storage':multer[_0x7a5f('0x11')]({'destination':function(_0x216d9e,_0x510033,_0x349936){_0x349936(null,path[_0x7a5f('0x1b')](config[_0x7a5f('0x12')],_0x7a5f('0x13')));},'filename':function(_0x24395f,_0x7aa4b0,_0x21f6c4){_0x21f6c4(null,util[_0x7a5f('0x14')](_0x7a5f('0x15'),'preferred',path[_0x7a5f('0x16')](_0x7aa4b0['originalname'])));}})});router['post'](_0x7a5f('0xd'),upload['single']('file'),controller[_0x7a5f('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x33996b,_0x994835,_0x369dd9){_0x369dd9(null,path[_0x7a5f('0x1b')](config[_0x7a5f('0x12')],'server/files/images/logos/'));},'filename':function(_0x254602,_0x2e491e,_0x47c6d2){_0x47c6d2(null,util[_0x7a5f('0x14')](_0x7a5f('0x15'),'favicon',path[_0x7a5f('0x16')](_0x2e491e[_0x7a5f('0x17')])));}})});router[_0x7a5f('0x18')]('/:id/favicon',upload[_0x7a5f('0x19')](_0x7a5f('0x1a')),controller[_0x7a5f('0x1f')]);router['put']('/:id',auth[_0x7a5f('0x8')](),controller[_0x7a5f('0x20')]);module['exports']=router; \ No newline at end of file +var _0x0f27=['index','get','/now','getDate','/:id','show','/:id/logo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','logologin','post','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','addFavicon','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','isAuthenticated'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0x0f27,0x171));var _0x70f2=function(_0x32084f,_0x28fc38){_0x32084f=_0x32084f-0x0;var _0x187302=_0x0f27[_0x32084f];return _0x187302;};'use strict';var multer=require(_0x70f2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x70f2('0x1'));var express=require(_0x70f2('0x2'));var router=express[_0x70f2('0x3')]();var fs_extra=require(_0x70f2('0x4'));var auth=require(_0x70f2('0x5'));var interaction=require(_0x70f2('0x6'));var config=require('../../config/environment');var controller=require(_0x70f2('0x7'));router['get']('/',auth[_0x70f2('0x8')](),controller[_0x70f2('0x9')]);router[_0x70f2('0xa')](_0x70f2('0xb'),controller[_0x70f2('0xc')]);router[_0x70f2('0xa')](_0x70f2('0xd'),controller[_0x70f2('0xe')]);router[_0x70f2('0xa')](_0x70f2('0xf'),controller['getLogo']);router[_0x70f2('0xa')]('/:id/logo_login',controller[_0x70f2('0x10')]);router[_0x70f2('0xa')](_0x70f2('0x11'),controller[_0x70f2('0x12')]);router[_0x70f2('0xa')](_0x70f2('0x13'),controller[_0x70f2('0x14')]);router[_0x70f2('0xa')](_0x70f2('0x15'),controller[_0x70f2('0x16')]);var upload=multer({'storage':multer[_0x70f2('0x17')]({'destination':function(_0x339bf4,_0x2f9e60,_0x31d2d1){_0x31d2d1(null,path[_0x70f2('0x18')](config[_0x70f2('0x19')],_0x70f2('0x1a')));},'filename':function(_0x27b6d1,_0x3ee836,_0x23f98f){_0x23f98f(null,util[_0x70f2('0x1b')](_0x70f2('0x1c'),_0x70f2('0x1d'),path[_0x70f2('0x1e')](_0x3ee836[_0x70f2('0x1f')])));}})});router['post'](_0x70f2('0xf'),upload[_0x70f2('0x20')](_0x70f2('0x21')),controller['addLogo']);var upload=multer({'storage':multer[_0x70f2('0x17')]({'destination':function(_0x2ce844,_0x34a6c4,_0x4f739c){_0x4f739c(null,path[_0x70f2('0x18')](config[_0x70f2('0x19')],_0x70f2('0x1a')));},'filename':function(_0x42eca7,_0x6a8554,_0x3edd15){_0x3edd15(null,util[_0x70f2('0x1b')](_0x70f2('0x1c'),_0x70f2('0x22'),path[_0x70f2('0x1e')](_0x6a8554[_0x70f2('0x1f')])));}})});router[_0x70f2('0x23')](_0x70f2('0x24'),upload[_0x70f2('0x20')](_0x70f2('0x21')),controller[_0x70f2('0x25')]);var upload=multer({'storage':multer[_0x70f2('0x17')]({'destination':function(_0x2e31ba,_0x926bc,_0x5f3955){_0x5f3955(null,path['join'](config[_0x70f2('0x19')],_0x70f2('0x1a')));},'filename':function(_0x3e25ea,_0xe60a,_0x774f84){_0x774f84(null,util[_0x70f2('0x1b')](_0x70f2('0x1c'),_0x70f2('0x26'),path[_0x70f2('0x1e')](_0xe60a[_0x70f2('0x1f')])));}})});router[_0x70f2('0x23')](_0x70f2('0x13'),upload[_0x70f2('0x20')](_0x70f2('0x21')),controller[_0x70f2('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28121a,_0xce5cb8,_0x5bd851){_0x5bd851(null,path['join'](config['root'],_0x70f2('0x1a')));},'filename':function(_0x2c0fb1,_0x1f6c4d,_0x39d023){_0x39d023(null,util[_0x70f2('0x1b')](_0x70f2('0x1c'),_0x70f2('0x28'),path[_0x70f2('0x1e')](_0x1f6c4d[_0x70f2('0x1f')])));}})});router[_0x70f2('0x23')](_0x70f2('0x15'),upload[_0x70f2('0x20')]('file'),controller[_0x70f2('0x29')]);router['put'](_0x70f2('0xd'),auth[_0x70f2('0x8')](),controller['update']);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 f87307a..ef4fd49 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 _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0x472935,_0x5805db){var _0x3a68ee=function(_0x4abb83){while(--_0x4abb83){_0x472935['push'](_0x472935['shift']());}};_0x3a68ee(++_0x5805db);}(_0x5f2f,0x73));var _0xf5f2=function(_0x246a9c,_0x4df087){_0x246a9c=_0x246a9c-0x0;var _0x4bd0b3=_0x5f2f[_0x246a9c];return _0x4bd0b3;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xdb28=['INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x558486,_0xa89a21){_0x558486=_0x558486-0x0;var _0x15e0c1=_0xdb28[_0x558486];return _0x15e0c1;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'min_internal':{'type':Sequelize[_0x8db2('0x2')](0xb),'unique':_0x8db2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x8db2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x6')},'logo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnusername':{'type':Sequelize[_0x8db2('0x5')]},'turnpassword':{'type':Sequelize[_0x8db2('0x5')]},'pageTitle':{'type':Sequelize[_0x8db2('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x8db2('0x8')},'enableEmailPreview':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8db2('0x5')]},'defaultPreferred':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8db2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8db2('0x5')]},'defaultFavicon':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8db2('0x2')]},'transcribeRegion':{'type':Sequelize[_0x8db2('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8db2('0x2')]},'sentimentRegion':{'type':Sequelize[_0x8db2('0x5')]},'language':{'type':Sequelize[_0x8db2('0x5')]},'bucket':{'type':Sequelize[_0x8db2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x8db2('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8db2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index dbb5fc7..b83a2f8 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 _0xfa8a=['name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','Setting','findAll','rows','show','include','find','body','params','addLogo','file','filename','logo','addLogoLogin','getLicense','loginLogo','preferred','favicon','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','download','../../config/license/util','getLogoLogin','defaultLoginLogo','defaultFavicon','default','default_loginLogo.svg','Sequelize','ValidationError','securePassword','addPreferred','getPreferred','server/files/images/logos','defaultLogo','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','save','update'];(function(_0x248a92,_0x187863){var _0x56af9e=function(_0x29ae89){while(--_0x29ae89){_0x248a92['push'](_0x248a92['shift']());}};_0x56af9e(++_0x187863);}(_0xfa8a,0xc4));var _0xafa8=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xfa8a[_0x5216e0];return _0x5b3f40;};'use strict';var emlformat=require(_0xafa8('0x0'));var rimraf=require(_0xafa8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xafa8('0x2'));var rp=require(_0xafa8('0x3'));var moment=require(_0xafa8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xafa8('0x5'));var util=require(_0xafa8('0x6'));var path=require('path');var sox=require(_0xafa8('0x7'));var csv=require('to-csv');var ejs=require(_0xafa8('0x8'));var fs=require('fs');var fs_extra=require(_0xafa8('0x9'));var _=require(_0xafa8('0xa'));var squel=require(_0xafa8('0xb'));var crypto=require(_0xafa8('0xc'));var jsforce=require(_0xafa8('0xd'));var deskjs=require(_0xafa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xafa8('0xf'));var Papa=require('papaparse');var Redis=require(_0xafa8('0x10'));var authService=require(_0xafa8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xafa8('0x12'));var hardwareService=require(_0xafa8('0x13'));var logger=require(_0xafa8('0x14'))(_0xafa8('0x15'));var utils=require(_0xafa8('0x16'));var config=require(_0xafa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xafa8('0x18'))['db'];var jayson=require(_0xafa8('0x19'));var client=jayson['client'][_0xafa8('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xff5db6,_0xf07d17,_0x59cf8a,_0x36cc49){return new BPromise(function(_0x24225d,_0x4de89e){var _0x26ae47=_0x36cc49||client;return _0x26ae47[_0xafa8('0x1b')](_0xff5db6,_0x59cf8a)[_0xafa8('0x1c')](function(_0x38ca58){logger['info'](_0xafa8('0x1d'),_0xf07d17,_0xafa8('0x1e'));logger[_0xafa8('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0xf07d17,_0xafa8('0x1e'),JSON[_0xafa8('0x20')](_0x38ca58));if(_0x38ca58['error']){if(_0x38ca58[_0xafa8('0x21')][_0xafa8('0x22')]===0x1f4){logger['error'](_0xafa8('0x1d'),_0xf07d17,_0x38ca58[_0xafa8('0x21')][_0xafa8('0x23')]);return _0x4de89e(_0x38ca58[_0xafa8('0x21')][_0xafa8('0x23')]);}logger['error'](_0xafa8('0x1d'),_0xf07d17,_0x38ca58[_0xafa8('0x21')]['message']);return _0x24225d(_0x38ca58['error'][_0xafa8('0x23')]);}else{logger[_0xafa8('0x24')](_0xafa8('0x1d'),_0xf07d17,_0xafa8('0x1e'));_0x24225d(_0x38ca58['result'][_0xafa8('0x23')]);}})[_0xafa8('0x25')](function(_0x5735d6){logger['error'](_0xafa8('0x1d'),_0xf07d17,_0x5735d6);_0x4de89e(_0x5735d6);});});}function respondWithStatusCode(_0x59e1a6,_0x3785f9){_0x3785f9=_0x3785f9||0xcc;return function(_0x4f2786){if(_0x4f2786){return _0x59e1a6[_0xafa8('0x26')](_0x3785f9);}return _0x59e1a6['status'](_0x3785f9)[_0xafa8('0x27')]();};}function respondWithResult(_0x3f7bc0,_0x875a92){_0x875a92=_0x875a92||0xc8;return function(_0x52625e){if(_0x52625e){return _0x3f7bc0[_0xafa8('0x28')](_0x875a92)[_0xafa8('0x29')](_0x52625e);}};}function respondWithFilteredResult(_0x40e947,_0x3d29ec){return function(_0x158b5e){if(_0x158b5e){var _0x1286d5=typeof _0x3d29ec['offset']===_0xafa8('0x2a')&&typeof _0x3d29ec[_0xafa8('0x2b')]===_0xafa8('0x2a');var _0x55e1f9=_0x158b5e[_0xafa8('0x2c')];var _0x2a31be=_0x1286d5?0x0:_0x3d29ec[_0xafa8('0x2d')];var _0x489ccb=_0x1286d5?_0x158b5e[_0xafa8('0x2c')]:_0x3d29ec[_0xafa8('0x2d')]+_0x3d29ec['limit'];var _0xddaefd;if(_0x489ccb>=_0x55e1f9){_0x489ccb=_0x55e1f9;_0xddaefd=0xc8;}else{_0xddaefd=0xce;}_0x40e947['status'](_0xddaefd);return _0x40e947[_0xafa8('0x2e')]('Content-Range',_0x2a31be+'-'+_0x489ccb+'/'+_0x55e1f9)[_0xafa8('0x29')](_0x158b5e);}return null;};}function patchUpdates(_0x52ae54){return function(_0x54a357){try{jsonpatch[_0xafa8('0x2f')](_0x54a357,_0x52ae54,!![]);}catch(_0x409de0){return BPromise['reject'](_0x409de0);}return _0x54a357[_0xafa8('0x30')]();};}function saveUpdates(_0x23bd92,_0x1f16b2){return function(_0x524ae4){if(_0x524ae4){return _0x524ae4[_0xafa8('0x31')](_0x23bd92)[_0xafa8('0x1c')](function(_0x337f9c){return _0x337f9c;});}return null;};}function removeEntity(_0x78fee5,_0x50f7df){return function(_0x47d9f8){if(_0x47d9f8){return _0x47d9f8['destroy']()[_0xafa8('0x1c')](function(){_0x78fee5['status'](0xcc)[_0xafa8('0x27')]();});}};}function handleEntityNotFound(_0x3660a3,_0x187fab){return function(_0x16579b){if(!_0x16579b){_0x3660a3[_0xafa8('0x26')](0x194);}return _0x16579b;};}function handleError(_0x1d81c7,_0x10cfc3){_0x10cfc3=_0x10cfc3||0x1f4;return function(_0x285442){logger[_0xafa8('0x21')](_0x285442['stack']);if(_0x285442[_0xafa8('0x32')]){delete _0x285442[_0xafa8('0x32')];}_0x1d81c7[_0xafa8('0x28')](_0x10cfc3)[_0xafa8('0x33')](_0x285442);};}exports[_0xafa8('0x34')]=function(_0xce6727,_0x432294){var _0x1d5b14={},_0x3388d8={},_0x2f616b={'count':0x0,'rows':[]};var _0xa22eb9=_[_0xafa8('0x35')](db['Setting'][_0xafa8('0x36')],function(_0xaed6d8){return{'name':_0xaed6d8[_0xafa8('0x37')],'type':_0xaed6d8['type'][_0xafa8('0x38')]};});_0x3388d8[_0xafa8('0x39')]=_['map'](_0xa22eb9,_0xafa8('0x32'));_0x3388d8[_0xafa8('0x3a')]=_[_0xafa8('0x3b')](_0xce6727['query']);_0x3388d8[_0xafa8('0x3c')]=_[_0xafa8('0x3d')](_0x3388d8[_0xafa8('0x39')],_0x3388d8[_0xafa8('0x3a')]);_0x1d5b14[_0xafa8('0x3e')]=_[_0xafa8('0x3d')](_0x3388d8[_0xafa8('0x39')],qs[_0xafa8('0x3f')](_0xce6727['query']['fields']));_0x1d5b14['attributes']=_0x1d5b14['attributes'][_0xafa8('0x40')]?_0x1d5b14[_0xafa8('0x3e')]:_0x3388d8['model'];if(!_0xce6727[_0xafa8('0x3a')]['hasOwnProperty'](_0xafa8('0x41'))){_0x1d5b14[_0xafa8('0x2b')]=qs[_0xafa8('0x2b')](_0xce6727[_0xafa8('0x3a')]['limit']);_0x1d5b14['offset']=qs[_0xafa8('0x2d')](_0xce6727[_0xafa8('0x3a')]['offset']);}_0x1d5b14['order']=qs[_0xafa8('0x42')](_0xce6727[_0xafa8('0x3a')][_0xafa8('0x42')]);_0x1d5b14[_0xafa8('0x43')]=qs['filters'](_[_0xafa8('0x44')](_0xce6727[_0xafa8('0x3a')],_0x3388d8[_0xafa8('0x3c')]),_0xa22eb9);if(_0xce6727[_0xafa8('0x3a')][_0xafa8('0x45')]){_0x1d5b14['where']=_[_0xafa8('0x46')](_0x1d5b14[_0xafa8('0x43')],{'$or':_[_0xafa8('0x35')](_0xa22eb9,function(_0x18ae0c){if(_0x18ae0c[_0xafa8('0x47')]!==_0xafa8('0x48')){var _0x21a873={};_0x21a873[_0x18ae0c['name']]={'$like':'%'+_0xce6727[_0xafa8('0x3a')][_0xafa8('0x45')]+'%'};return _0x21a873;}})});}_0x1d5b14=_[_0xafa8('0x46')]({},_0x1d5b14,_0xce6727['options']);var _0x18a9dc={'where':_0x1d5b14[_0xafa8('0x43')]};return db['Setting'][_0xafa8('0x2c')](_0x18a9dc)['then'](function(_0x1d0447){_0x2f616b[_0xafa8('0x2c')]=_0x1d0447;if(_0xce6727[_0xafa8('0x3a')][_0xafa8('0x49')]){_0x1d5b14['include']=[{'all':!![]}];}return db[_0xafa8('0x4a')][_0xafa8('0x4b')](_0x1d5b14);})[_0xafa8('0x1c')](function(_0xa2cd0b){_0x2f616b[_0xafa8('0x4c')]=_0xa2cd0b;return _0x2f616b;})[_0xafa8('0x1c')](respondWithFilteredResult(_0x432294,_0x1d5b14))[_0xafa8('0x25')](handleError(_0x432294,null));};exports[_0xafa8('0x4d')]=function(_0x3f46c3,_0x2eaa91){var _0x1ebe55={'raw':![],'where':{'id':_0x3f46c3['params']['id']}},_0x2f9946={};_0x2f9946[_0xafa8('0x39')]=_['keys'](db[_0xafa8('0x4a')][_0xafa8('0x36')]);_0x2f9946[_0xafa8('0x3a')]=_[_0xafa8('0x3b')](_0x3f46c3['query']);_0x2f9946[_0xafa8('0x3c')]=_[_0xafa8('0x3d')](_0x2f9946[_0xafa8('0x39')],_0x2f9946[_0xafa8('0x3a')]);_0x1ebe55[_0xafa8('0x3e')]=_[_0xafa8('0x3d')](_0x2f9946[_0xafa8('0x39')],qs['fields'](_0x3f46c3[_0xafa8('0x3a')][_0xafa8('0x3f')]));_0x1ebe55[_0xafa8('0x3e')]=_0x1ebe55[_0xafa8('0x3e')]['length']?_0x1ebe55[_0xafa8('0x3e')]:_0x2f9946[_0xafa8('0x39')];if(_0x3f46c3['query'][_0xafa8('0x49')]){_0x1ebe55[_0xafa8('0x4e')]=[{'all':!![]}];}_0x1ebe55=_[_0xafa8('0x46')]({},_0x1ebe55,_0x3f46c3['options']);return db[_0xafa8('0x4a')][_0xafa8('0x4f')](_0x1ebe55)[_0xafa8('0x1c')](handleEntityNotFound(_0x2eaa91,null))[_0xafa8('0x1c')](respondWithResult(_0x2eaa91,null))['catch'](handleError(_0x2eaa91,null));};exports[_0xafa8('0x31')]=function(_0x60fc0d,_0x2a24ba){if(_0x60fc0d[_0xafa8('0x50')]['id']){delete _0x60fc0d['body']['id'];}return db[_0xafa8('0x4a')]['find']({'where':{'id':_0x60fc0d[_0xafa8('0x51')]['id']}})[_0xafa8('0x1c')](handleEntityNotFound(_0x2a24ba,null))[_0xafa8('0x1c')](saveUpdates(_0x60fc0d[_0xafa8('0x50')],null))[_0xafa8('0x1c')](respondWithResult(_0x2a24ba,null))[_0xafa8('0x25')](handleError(_0x2a24ba,null));};exports[_0xafa8('0x52')]=function(_0x928ebb,_0x1b0f16,_0x25292b){if(_0x928ebb[_0xafa8('0x53')]&&_0x928ebb[_0xafa8('0x53')][_0xafa8('0x54')]){_0x928ebb[_0xafa8('0x50')][_0xafa8('0x55')]=_0x928ebb['file']['filename'];}return db[_0xafa8('0x4a')][_0xafa8('0x4f')]({'where':{'id':_0x928ebb[_0xafa8('0x51')]['id']}})['then'](handleEntityNotFound(_0x1b0f16,null))[_0xafa8('0x1c')](saveUpdates(_0x928ebb['body'],null))['then'](respondWithResult(_0x1b0f16,null))[_0xafa8('0x25')](handleError(_0x1b0f16,null));};exports[_0xafa8('0x56')]=function(_0x10e199,_0x3f8868,_0x443e99){if(_0x10e199[_0xafa8('0x53')]&&_0x10e199[_0xafa8('0x53')]['filename']){_0x10e199[_0xafa8('0x50')]['loginLogo']=_0x10e199[_0xafa8('0x53')][_0xafa8('0x54')];}return db['Setting'][_0xafa8('0x4f')]({'where':{'id':_0x10e199['params']['id']}})['then'](handleEntityNotFound(_0x3f8868,null))[_0xafa8('0x1c')](saveUpdates(_0x10e199['body'],null))[_0xafa8('0x1c')](respondWithResult(_0x3f8868,null))[_0xafa8('0x25')](handleError(_0x3f8868,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x4a8f09,_0x3ae363,_0x1deea8){var _0x4769fa='server/files/images/logos';var _0x4fc780={'custom':![]};return utilLicense[_0xafa8('0x57')]()[_0xafa8('0x1c')](function(_0xf28058){if(_0xf28058){_0x4fc780=_0xf28058;}return db[_0xafa8('0x4a')]['find']({'where':{'id':_0x4a8f09[_0xafa8('0x51')]['id']},'attributes':[_0xafa8('0x55'),_0xafa8('0x58'),_0xafa8('0x59'),_0xafa8('0x5a'),'defaultLogo','defaultLoginLogo',_0xafa8('0x5b'),'defaultFavicon'],'raw':!![]});})[_0xafa8('0x1c')](handleEntityNotFound(_0x3ae363,null))['then'](function(_0xd406dd){if(_0xd406dd){var _0xbf9044=_0xd406dd[_0xafa8('0x55')]&&fs[_0xafa8('0x5c')](path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x4769fa,_['toLower'](_0xd406dd[_0xafa8('0x55')])))?path['join'](config[_0xafa8('0x5e')],_0x4769fa,_[_0xafa8('0x5f')](_0xd406dd[_0xafa8('0x55')])):path[_0xafa8('0x5d')](config['root'],_0x4769fa,_['toLower'](_0xafa8('0x60')));var _0x349fde='default'+_[_0xafa8('0x61')]('logo');if(_0xd406dd[_0x349fde]||!_0x4fc780[_0xafa8('0x62')]){_0xbf9044=path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x4769fa,_[_0xafa8('0x5f')](_0xafa8('0x60')));}if(!fs[_0xafa8('0x5c')](_0xbf9044)){throw new db['Sequelize']['ValidationError'](_[_0xafa8('0x61')](_0xafa8('0x55'))+'\x20not\x20found');}return _0x3ae363[_0xafa8('0x63')](_0xbf9044);}})[_0xafa8('0x25')](handleError(_0x3ae363,null));};var utilLicense=require(_0xafa8('0x64'));exports[_0xafa8('0x65')]=function(_0x51f45b,_0x47eff3,_0x5ae76d){var _0x30022b='server/files/images/logos';var _0x4b1de8={'custom':![]};return utilLicense[_0xafa8('0x57')]()[_0xafa8('0x1c')](function(_0x189282){if(_0x189282){_0x4b1de8=_0x189282;}return db[_0xafa8('0x4a')][_0xafa8('0x4f')]({'where':{'id':_0x51f45b[_0xafa8('0x51')]['id']},'attributes':[_0xafa8('0x55'),_0xafa8('0x58'),_0xafa8('0x59'),_0xafa8('0x5a'),'defaultLogo',_0xafa8('0x66'),_0xafa8('0x5b'),_0xafa8('0x67')],'raw':!![]});})[_0xafa8('0x1c')](handleEntityNotFound(_0x47eff3,null))['then'](function(_0x228d8a){if(_0x228d8a){var _0x4df0ec=_0x228d8a[_0xafa8('0x58')]&&fs[_0xafa8('0x5c')](path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x30022b,_[_0xafa8('0x5f')](_0x228d8a[_0xafa8('0x58')])))?path['join'](config[_0xafa8('0x5e')],_0x30022b,_[_0xafa8('0x5f')](_0x228d8a[_0xafa8('0x58')])):path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x30022b,_[_0xafa8('0x5f')]('default_loginLogo.svg'));var _0x5824f3=_0xafa8('0x68')+_['upperFirst']('loginLogo');if(_0x228d8a[_0x5824f3]||!_0x4b1de8[_0xafa8('0x62')]){_0x4df0ec=path[_0xafa8('0x5d')](config['root'],_0x30022b,_[_0xafa8('0x5f')](_0xafa8('0x69')));}if(!fs[_0xafa8('0x5c')](_0x4df0ec)){throw new db[(_0xafa8('0x6a'))][(_0xafa8('0x6b'))](_['upperFirst'](_0xafa8('0x58'))+'\x20not\x20found');}return _0x47eff3['download'](_0x4df0ec);}})[_0xafa8('0x25')](handleError(_0x47eff3,null));};exports['gdpr']=function(_0x51ed87,_0x4b8f8c){return db[_0xafa8('0x4a')][_0xafa8('0x4f')]({'where':{'id':_0x51ed87['params']['id']},'attributes':[_0xafa8('0x6c')]})[_0xafa8('0x1c')](respondWithResult(_0x4b8f8c,null))['catch'](handleError(_0x4b8f8c,null));};exports[_0xafa8('0x6d')]=function(_0x2a009a,_0x41fc83,_0x577870){if(_0x2a009a[_0xafa8('0x53')]&&_0x2a009a[_0xafa8('0x53')][_0xafa8('0x54')]){_0x2a009a[_0xafa8('0x50')][_0xafa8('0x59')]=_0x2a009a['file'][_0xafa8('0x54')];}return db['Setting']['find']({'where':{'id':_0x2a009a[_0xafa8('0x51')]['id']}})['then'](handleEntityNotFound(_0x41fc83,null))[_0xafa8('0x1c')](saveUpdates(_0x2a009a[_0xafa8('0x50')],null))[_0xafa8('0x1c')](respondWithResult(_0x41fc83,null))[_0xafa8('0x25')](handleError(_0x41fc83,null));};var utilLicense=require(_0xafa8('0x64'));exports[_0xafa8('0x6e')]=function(_0x2e336d,_0x536ec6,_0x3983d9){var _0x240ade=_0xafa8('0x6f');var _0x3b5435={'custom':![]};return utilLicense['getLicense']()[_0xafa8('0x1c')](function(_0x2e8538){if(_0x2e8538){_0x3b5435=_0x2e8538;}return db[_0xafa8('0x4a')][_0xafa8('0x4f')]({'where':{'id':_0x2e336d['params']['id']},'attributes':['logo',_0xafa8('0x58'),_0xafa8('0x59'),'favicon',_0xafa8('0x70'),'defaultLoginLogo',_0xafa8('0x5b'),_0xafa8('0x67')],'raw':!![]});})[_0xafa8('0x1c')](handleEntityNotFound(_0x536ec6,null))['then'](function(_0x3b6fe5){if(_0x3b6fe5){var _0x12e0af=_0x3b6fe5['preferred']&&fs[_0xafa8('0x5c')](path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x240ade,_['toLower'](_0x3b6fe5[_0xafa8('0x59')])))?path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x240ade,_[_0xafa8('0x5f')](_0x3b6fe5[_0xafa8('0x59')])):path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x240ade,_[_0xafa8('0x5f')](_0xafa8('0x71')));var _0x3b916f='default'+_[_0xafa8('0x61')](_0xafa8('0x59'));if(_0x3b6fe5[_0x3b916f]||!_0x3b5435['custom']||!_0x3b5435['preferred']){_0x12e0af=path[_0xafa8('0x5d')](config['root'],_0x240ade,_[_0xafa8('0x5f')]('default_preferred.png'));}if(!fs[_0xafa8('0x5c')](_0x12e0af)){throw new db[(_0xafa8('0x6a'))][(_0xafa8('0x6b'))](_[_0xafa8('0x61')](_0xafa8('0x59'))+_0xafa8('0x72'));}return _0x536ec6[_0xafa8('0x63')](_0x12e0af);}})[_0xafa8('0x25')](handleError(_0x536ec6,null));};exports[_0xafa8('0x73')]=function(_0x2fad0b,_0x53f5a7,_0x11fe79){if(_0x2fad0b[_0xafa8('0x53')]&&_0x2fad0b[_0xafa8('0x53')][_0xafa8('0x54')]){_0x2fad0b[_0xafa8('0x50')][_0xafa8('0x5a')]=_0x2fad0b[_0xafa8('0x53')][_0xafa8('0x54')];}return db[_0xafa8('0x4a')][_0xafa8('0x4f')]({'where':{'id':_0x2fad0b['params']['id']}})[_0xafa8('0x1c')](handleEntityNotFound(_0x53f5a7,null))['then'](saveUpdates(_0x2fad0b[_0xafa8('0x50')],null))['then'](respondWithResult(_0x53f5a7,null))[_0xafa8('0x25')](handleError(_0x53f5a7,null));};var utilLicense=require('../../config/license/util');exports[_0xafa8('0x74')]=function(_0x1b18d5,_0x412ffd,_0x10faf8){var _0x39c715=_0xafa8('0x6f');var _0x1fb987={'custom':![]};return utilLicense['getLicense']()[_0xafa8('0x1c')](function(_0xd7a603){if(_0xd7a603){_0x1fb987=_0xd7a603;}return db['Setting'][_0xafa8('0x4f')]({'where':{'id':_0x1b18d5[_0xafa8('0x51')]['id']},'attributes':[_0xafa8('0x55'),_0xafa8('0x58'),_0xafa8('0x59'),'favicon',_0xafa8('0x70'),_0xafa8('0x66'),_0xafa8('0x5b'),_0xafa8('0x67')],'raw':!![]});})[_0xafa8('0x1c')](handleEntityNotFound(_0x412ffd,null))[_0xafa8('0x1c')](function(_0x1f2caa){if(_0x1f2caa){var _0x2241e0=_0x1f2caa[_0xafa8('0x5a')]&&fs[_0xafa8('0x5c')](path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x39c715,_[_0xafa8('0x5f')](_0x1f2caa[_0xafa8('0x5a')])))?path[_0xafa8('0x5d')](config['root'],_0x39c715,_[_0xafa8('0x5f')](_0x1f2caa[_0xafa8('0x5a')])):path['join'](config[_0xafa8('0x5e')],_0x39c715,_['toLower'](_0xafa8('0x75')));var _0x1d6e38=_0xafa8('0x68')+_[_0xafa8('0x61')](_0xafa8('0x5a'));if(_0x1f2caa[_0x1d6e38]||!_0x1fb987[_0xafa8('0x62')]){_0x2241e0=path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x39c715,_[_0xafa8('0x5f')](_0xafa8('0x75')));}if(!fs[_0xafa8('0x5c')](_0x2241e0)){throw new db[(_0xafa8('0x6a'))][(_0xafa8('0x6b'))](_[_0xafa8('0x61')]('favicon')+'\x20not\x20found');}return _0x412ffd[_0xafa8('0x63')](_0x2241e0);}})[_0xafa8('0x25')](handleError(_0x412ffd,null));};exports[_0xafa8('0x76')]=function(_0x3b930d,_0x1e6f7e){var _0x182188={'offset':moment()['utcOffset']()};_0x182188[_0xafa8('0x77')]=moment()[_0xafa8('0x78')](_0x182188[_0xafa8('0x2d')])[_0xafa8('0x79')](_0xafa8('0x7a'));return _0x1e6f7e[_0xafa8('0x28')](0xc8)[_0xafa8('0x33')](_0x182188);}; \ No newline at end of file +var _0x5b96=['type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','body','file','logo','params','addLogoLogin','filename','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','toLower','root','join','default_logo.svg','upperFirst','existsSync','Sequelize','ValidationError','getLogoLogin','getLicense','defaultLoginLogo','loginLogo','default_loginLogo.svg','default','custom','download','getPreferred','default_preferred.png','\x20not\x20found','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','index','map','Setting','rawAttributes','fieldName'];(function(_0x149169,_0x5a0100){var _0x220e71=function(_0x388b5f){while(--_0x388b5f){_0x149169['push'](_0x149169['shift']());}};_0x220e71(++_0x5a0100);}(_0x5b96,0xbc));var _0x65b9=function(_0x3ef8f7,_0x35359a){_0x3ef8f7=_0x3ef8f7-0x0;var _0x3b097e=_0x5b96[_0x3ef8f7];return _0x3b097e;};'use strict';var emlformat=require(_0x65b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65b9('0x1'));var jsonpatch=require(_0x65b9('0x2'));var rp=require('request-promise');var moment=require(_0x65b9('0x3'));var BPromise=require(_0x65b9('0x4'));var Mustache=require(_0x65b9('0x5'));var util=require(_0x65b9('0x6'));var path=require(_0x65b9('0x7'));var sox=require(_0x65b9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x65b9('0x9'));var _=require(_0x65b9('0xa'));var squel=require(_0x65b9('0xb'));var crypto=require(_0x65b9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x65b9('0xd'));var toCsv=require(_0x65b9('0xe'));var querystring=require(_0x65b9('0xf'));var Papa=require(_0x65b9('0x10'));var Redis=require(_0x65b9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x65b9('0x12'));var hardwareService=require(_0x65b9('0x13'));var logger=require(_0x65b9('0x14'))(_0x65b9('0x15'));var utils=require(_0x65b9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x65b9('0x17'));var db=require(_0x65b9('0x18'))['db'];var jayson=require(_0x65b9('0x19'));var client=jayson['client'][_0x65b9('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xb25f17,_0x54b48d,_0x574cbe,_0x414cc2){return new BPromise(function(_0x807983,_0x5ac38e){var _0x52cc6e=_0x414cc2||client;return _0x52cc6e[_0x65b9('0x1b')](_0xb25f17,_0x574cbe)['then'](function(_0x339f2d){logger['info'](_0x65b9('0x1c'),_0x54b48d,_0x65b9('0x1d'));logger[_0x65b9('0x1e')](_0x65b9('0x1f'),_0x54b48d,'request\x20sent',JSON[_0x65b9('0x20')](_0x339f2d));if(_0x339f2d[_0x65b9('0x21')]){if(_0x339f2d[_0x65b9('0x21')][_0x65b9('0x22')]===0x1f4){logger[_0x65b9('0x21')](_0x65b9('0x1c'),_0x54b48d,_0x339f2d[_0x65b9('0x21')][_0x65b9('0x23')]);return _0x5ac38e(_0x339f2d[_0x65b9('0x21')]['message']);}logger[_0x65b9('0x21')](_0x65b9('0x1c'),_0x54b48d,_0x339f2d[_0x65b9('0x21')][_0x65b9('0x23')]);return _0x807983(_0x339f2d[_0x65b9('0x21')][_0x65b9('0x23')]);}else{logger[_0x65b9('0x24')](_0x65b9('0x1c'),_0x54b48d,_0x65b9('0x1d'));_0x807983(_0x339f2d[_0x65b9('0x25')]['message']);}})[_0x65b9('0x26')](function(_0x157edf){logger[_0x65b9('0x21')]('Setting,\x20%s,\x20%s',_0x54b48d,_0x157edf);_0x5ac38e(_0x157edf);});});}function respondWithStatusCode(_0x38d934,_0x3a25fc){_0x3a25fc=_0x3a25fc||0xcc;return function(_0x2cf0fc){if(_0x2cf0fc){return _0x38d934[_0x65b9('0x27')](_0x3a25fc);}return _0x38d934[_0x65b9('0x28')](_0x3a25fc)[_0x65b9('0x29')]();};}function respondWithResult(_0x2181d5,_0x5c910f){_0x5c910f=_0x5c910f||0xc8;return function(_0x46e3c2){if(_0x46e3c2){return _0x2181d5['status'](_0x5c910f)[_0x65b9('0x2a')](_0x46e3c2);}};}function respondWithFilteredResult(_0x343029,_0x406cf5){return function(_0x4e9851){if(_0x4e9851){var _0x1010a9=typeof _0x406cf5[_0x65b9('0x2b')]===_0x65b9('0x2c')&&typeof _0x406cf5[_0x65b9('0x2d')]===_0x65b9('0x2c');var _0x38b57c=_0x4e9851['count'];var _0x20f248=_0x1010a9?0x0:_0x406cf5[_0x65b9('0x2b')];var _0x4efb48=_0x1010a9?_0x4e9851[_0x65b9('0x2e')]:_0x406cf5['offset']+_0x406cf5[_0x65b9('0x2d')];var _0x3c9e6a;if(_0x4efb48>=_0x38b57c){_0x4efb48=_0x38b57c;_0x3c9e6a=0xc8;}else{_0x3c9e6a=0xce;}_0x343029[_0x65b9('0x28')](_0x3c9e6a);return _0x343029[_0x65b9('0x2f')](_0x65b9('0x30'),_0x20f248+'-'+_0x4efb48+'/'+_0x38b57c)[_0x65b9('0x2a')](_0x4e9851);}return null;};}function patchUpdates(_0x2ae8b0){return function(_0x2f6f46){try{jsonpatch['apply'](_0x2f6f46,_0x2ae8b0,!![]);}catch(_0x5974c6){return BPromise['reject'](_0x5974c6);}return _0x2f6f46[_0x65b9('0x31')]();};}function saveUpdates(_0x2b56c9,_0x20e74f){return function(_0x4f25e0){if(_0x4f25e0){return _0x4f25e0[_0x65b9('0x32')](_0x2b56c9)[_0x65b9('0x33')](function(_0x3d854f){return _0x3d854f;});}return null;};}function removeEntity(_0x144e00,_0x320594){return function(_0x26a668){if(_0x26a668){return _0x26a668[_0x65b9('0x34')]()[_0x65b9('0x33')](function(){_0x144e00[_0x65b9('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e326,_0x418411){return function(_0x4b4153){if(!_0x4b4153){_0x25e326[_0x65b9('0x27')](0x194);}return _0x4b4153;};}function handleError(_0x22721d,_0x1d1b8e){_0x1d1b8e=_0x1d1b8e||0x1f4;return function(_0x3627af){logger['error'](_0x3627af[_0x65b9('0x35')]);if(_0x3627af[_0x65b9('0x36')]){delete _0x3627af['name'];}_0x22721d[_0x65b9('0x28')](_0x1d1b8e)['send'](_0x3627af);};}exports[_0x65b9('0x37')]=function(_0x29bac7,_0x205e70){var _0x40c189={},_0x148580={},_0x267eeb={'count':0x0,'rows':[]};var _0x47c94a=_[_0x65b9('0x38')](db[_0x65b9('0x39')][_0x65b9('0x3a')],function(_0x523e85){return{'name':_0x523e85[_0x65b9('0x3b')],'type':_0x523e85[_0x65b9('0x3c')]['key']};});_0x148580[_0x65b9('0x3d')]=_[_0x65b9('0x38')](_0x47c94a,_0x65b9('0x36'));_0x148580[_0x65b9('0x3e')]=_[_0x65b9('0x3f')](_0x29bac7[_0x65b9('0x3e')]);_0x148580[_0x65b9('0x40')]=_[_0x65b9('0x41')](_0x148580[_0x65b9('0x3d')],_0x148580[_0x65b9('0x3e')]);_0x40c189[_0x65b9('0x42')]=_[_0x65b9('0x41')](_0x148580[_0x65b9('0x3d')],qs[_0x65b9('0x43')](_0x29bac7[_0x65b9('0x3e')][_0x65b9('0x43')]));_0x40c189[_0x65b9('0x42')]=_0x40c189[_0x65b9('0x42')][_0x65b9('0x44')]?_0x40c189[_0x65b9('0x42')]:_0x148580[_0x65b9('0x3d')];if(!_0x29bac7[_0x65b9('0x3e')]['hasOwnProperty'](_0x65b9('0x45'))){_0x40c189[_0x65b9('0x2d')]=qs[_0x65b9('0x2d')](_0x29bac7[_0x65b9('0x3e')][_0x65b9('0x2d')]);_0x40c189[_0x65b9('0x2b')]=qs['offset'](_0x29bac7['query'][_0x65b9('0x2b')]);}_0x40c189[_0x65b9('0x46')]=qs['sort'](_0x29bac7[_0x65b9('0x3e')][_0x65b9('0x47')]);_0x40c189['where']=qs[_0x65b9('0x40')](_[_0x65b9('0x48')](_0x29bac7[_0x65b9('0x3e')],_0x148580['filters']),_0x47c94a);if(_0x29bac7[_0x65b9('0x3e')][_0x65b9('0x49')]){_0x40c189[_0x65b9('0x4a')]=_[_0x65b9('0x4b')](_0x40c189['where'],{'$or':_[_0x65b9('0x38')](_0x47c94a,function(_0x2a913d){if(_0x2a913d[_0x65b9('0x3c')]!==_0x65b9('0x4c')){var _0x20bab5={};_0x20bab5[_0x2a913d[_0x65b9('0x36')]]={'$like':'%'+_0x29bac7[_0x65b9('0x3e')]['filter']+'%'};return _0x20bab5;}})});}_0x40c189=_[_0x65b9('0x4b')]({},_0x40c189,_0x29bac7[_0x65b9('0x4d')]);var _0x20e4a9={'where':_0x40c189[_0x65b9('0x4a')]};return db[_0x65b9('0x39')][_0x65b9('0x2e')](_0x20e4a9)[_0x65b9('0x33')](function(_0x100b67){_0x267eeb[_0x65b9('0x2e')]=_0x100b67;if(_0x29bac7['query'][_0x65b9('0x4e')]){_0x40c189[_0x65b9('0x4f')]=[{'all':!![]}];}return db[_0x65b9('0x39')][_0x65b9('0x50')](_0x40c189);})[_0x65b9('0x33')](function(_0x4ab458){_0x267eeb[_0x65b9('0x51')]=_0x4ab458;return _0x267eeb;})[_0x65b9('0x33')](respondWithFilteredResult(_0x205e70,_0x40c189))[_0x65b9('0x26')](handleError(_0x205e70,null));};exports[_0x65b9('0x52')]=function(_0x1024ae,_0x521750){var _0x144e53={'raw':![],'where':{'id':_0x1024ae['params']['id']}},_0x1f9ac4={};_0x1f9ac4[_0x65b9('0x3d')]=_['keys'](db['Setting']['rawAttributes']);_0x1f9ac4['query']=_[_0x65b9('0x3f')](_0x1024ae[_0x65b9('0x3e')]);_0x1f9ac4[_0x65b9('0x40')]=_[_0x65b9('0x41')](_0x1f9ac4[_0x65b9('0x3d')],_0x1f9ac4['query']);_0x144e53[_0x65b9('0x42')]=_['intersection'](_0x1f9ac4[_0x65b9('0x3d')],qs[_0x65b9('0x43')](_0x1024ae[_0x65b9('0x3e')]['fields']));_0x144e53[_0x65b9('0x42')]=_0x144e53['attributes'][_0x65b9('0x44')]?_0x144e53[_0x65b9('0x42')]:_0x1f9ac4[_0x65b9('0x3d')];if(_0x1024ae[_0x65b9('0x3e')][_0x65b9('0x4e')]){_0x144e53[_0x65b9('0x4f')]=[{'all':!![]}];}_0x144e53=_[_0x65b9('0x4b')]({},_0x144e53,_0x1024ae[_0x65b9('0x4d')]);return db[_0x65b9('0x39')][_0x65b9('0x53')](_0x144e53)['then'](handleEntityNotFound(_0x521750,null))[_0x65b9('0x33')](respondWithResult(_0x521750,null))['catch'](handleError(_0x521750,null));};exports[_0x65b9('0x32')]=function(_0x55e2e0,_0x495045){if(_0x55e2e0[_0x65b9('0x54')]['id']){delete _0x55e2e0[_0x65b9('0x54')]['id'];}return db['Setting'][_0x65b9('0x53')]({'where':{'id':_0x55e2e0['params']['id']}})['then'](handleEntityNotFound(_0x495045,null))['then'](saveUpdates(_0x55e2e0[_0x65b9('0x54')],null))['then'](respondWithResult(_0x495045,null))[_0x65b9('0x26')](handleError(_0x495045,null));};exports['addLogo']=function(_0x2c0aca,_0x370453,_0x36d121){if(_0x2c0aca[_0x65b9('0x55')]&&_0x2c0aca['file']['filename']){_0x2c0aca[_0x65b9('0x54')][_0x65b9('0x56')]=_0x2c0aca[_0x65b9('0x55')]['filename'];}return db[_0x65b9('0x39')]['find']({'where':{'id':_0x2c0aca[_0x65b9('0x57')]['id']}})[_0x65b9('0x33')](handleEntityNotFound(_0x370453,null))['then'](saveUpdates(_0x2c0aca[_0x65b9('0x54')],null))[_0x65b9('0x33')](respondWithResult(_0x370453,null))[_0x65b9('0x26')](handleError(_0x370453,null));};exports[_0x65b9('0x58')]=function(_0x2659df,_0x1dc74e,_0xe8597b){if(_0x2659df[_0x65b9('0x55')]&&_0x2659df[_0x65b9('0x55')][_0x65b9('0x59')]){_0x2659df[_0x65b9('0x54')]['loginLogo']=_0x2659df[_0x65b9('0x55')][_0x65b9('0x59')];}return db['Setting'][_0x65b9('0x53')]({'where':{'id':_0x2659df[_0x65b9('0x57')]['id']}})[_0x65b9('0x33')](handleEntityNotFound(_0x1dc74e,null))['then'](saveUpdates(_0x2659df[_0x65b9('0x54')],null))[_0x65b9('0x33')](respondWithResult(_0x1dc74e,null))[_0x65b9('0x26')](handleError(_0x1dc74e,null));};var utilLicense=require('../../config/license/util');exports[_0x65b9('0x5a')]=function(_0x147f47,_0x25ba32,_0x40dc12){var _0xc49f61=_0x65b9('0x5b');var _0x23615e={'custom':![]};return utilLicense['getLicense']()[_0x65b9('0x33')](function(_0x12e122){if(_0x12e122){_0x23615e=_0x12e122;}return db[_0x65b9('0x39')]['find']({'where':{'id':_0x147f47[_0x65b9('0x57')]['id']},'attributes':[_0x65b9('0x56'),'loginLogo',_0x65b9('0x5c'),_0x65b9('0x5d'),_0x65b9('0x5e'),'defaultLoginLogo',_0x65b9('0x5f'),_0x65b9('0x60')],'raw':!![]});})[_0x65b9('0x33')](handleEntityNotFound(_0x25ba32,null))[_0x65b9('0x33')](function(_0x50bff5){if(_0x50bff5){var _0x23745b=_0x50bff5[_0x65b9('0x56')]&&fs['existsSync'](path['join'](config['root'],_0xc49f61,_[_0x65b9('0x61')](_0x50bff5[_0x65b9('0x56')])))?path['join'](config[_0x65b9('0x62')],_0xc49f61,_[_0x65b9('0x61')](_0x50bff5[_0x65b9('0x56')])):path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0xc49f61,_['toLower'](_0x65b9('0x64')));var _0x56a544='default'+_[_0x65b9('0x65')](_0x65b9('0x56'));if(_0x50bff5[_0x56a544]||!_0x23615e['custom']){_0x23745b=path['join'](config[_0x65b9('0x62')],_0xc49f61,_[_0x65b9('0x61')](_0x65b9('0x64')));}if(!fs[_0x65b9('0x66')](_0x23745b)){throw new db[(_0x65b9('0x67'))][(_0x65b9('0x68'))](_[_0x65b9('0x65')](_0x65b9('0x56'))+'\x20not\x20found');}return _0x25ba32['download'](_0x23745b);}})[_0x65b9('0x26')](handleError(_0x25ba32,null));};var utilLicense=require(_0x65b9('0x17'));exports[_0x65b9('0x69')]=function(_0x35515f,_0x1a0def,_0x5401de){var _0x3b3eb9=_0x65b9('0x5b');var _0x3f9fff={'custom':![]};return utilLicense[_0x65b9('0x6a')]()[_0x65b9('0x33')](function(_0x1c0146){if(_0x1c0146){_0x3f9fff=_0x1c0146;}return db[_0x65b9('0x39')][_0x65b9('0x53')]({'where':{'id':_0x35515f['params']['id']},'attributes':[_0x65b9('0x56'),'loginLogo',_0x65b9('0x5c'),'favicon',_0x65b9('0x5e'),_0x65b9('0x6b'),_0x65b9('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x65b9('0x33')](handleEntityNotFound(_0x1a0def,null))[_0x65b9('0x33')](function(_0x1ed123){if(_0x1ed123){var _0x256746=_0x1ed123['loginLogo']&&fs[_0x65b9('0x66')](path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x3b3eb9,_[_0x65b9('0x61')](_0x1ed123[_0x65b9('0x6c')])))?path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x3b3eb9,_['toLower'](_0x1ed123[_0x65b9('0x6c')])):path[_0x65b9('0x63')](config['root'],_0x3b3eb9,_[_0x65b9('0x61')](_0x65b9('0x6d')));var _0x191e27=_0x65b9('0x6e')+_[_0x65b9('0x65')]('loginLogo');if(_0x1ed123[_0x191e27]||!_0x3f9fff[_0x65b9('0x6f')]){_0x256746=path['join'](config['root'],_0x3b3eb9,_[_0x65b9('0x61')](_0x65b9('0x6d')));}if(!fs[_0x65b9('0x66')](_0x256746)){throw new db[(_0x65b9('0x67'))][(_0x65b9('0x68'))](_[_0x65b9('0x65')]('loginLogo')+'\x20not\x20found');}return _0x1a0def[_0x65b9('0x70')](_0x256746);}})[_0x65b9('0x26')](handleError(_0x1a0def,null));};exports['gdpr']=function(_0x2688f5,_0x444cb3){return db[_0x65b9('0x39')][_0x65b9('0x53')]({'where':{'id':_0x2688f5['params']['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x444cb3,null))['catch'](handleError(_0x444cb3,null));};exports['addPreferred']=function(_0x4fc4f7,_0x493ed0,_0x3e65e7){if(_0x4fc4f7[_0x65b9('0x55')]&&_0x4fc4f7[_0x65b9('0x55')][_0x65b9('0x59')]){_0x4fc4f7[_0x65b9('0x54')]['preferred']=_0x4fc4f7['file'][_0x65b9('0x59')];}return db[_0x65b9('0x39')][_0x65b9('0x53')]({'where':{'id':_0x4fc4f7['params']['id']}})['then'](handleEntityNotFound(_0x493ed0,null))['then'](saveUpdates(_0x4fc4f7[_0x65b9('0x54')],null))[_0x65b9('0x33')](respondWithResult(_0x493ed0,null))[_0x65b9('0x26')](handleError(_0x493ed0,null));};var utilLicense=require(_0x65b9('0x17'));exports[_0x65b9('0x71')]=function(_0x51552b,_0x494076,_0x3d2668){var _0x1291bd=_0x65b9('0x5b');var _0x26ff83={'custom':![]};return utilLicense[_0x65b9('0x6a')]()['then'](function(_0x43bd8d){if(_0x43bd8d){_0x26ff83=_0x43bd8d;}return db[_0x65b9('0x39')][_0x65b9('0x53')]({'where':{'id':_0x51552b[_0x65b9('0x57')]['id']},'attributes':[_0x65b9('0x56'),_0x65b9('0x6c'),_0x65b9('0x5c'),_0x65b9('0x5d'),_0x65b9('0x5e'),'defaultLoginLogo',_0x65b9('0x5f'),_0x65b9('0x60')],'raw':!![]});})[_0x65b9('0x33')](handleEntityNotFound(_0x494076,null))[_0x65b9('0x33')](function(_0x3fab18){if(_0x3fab18){var _0x3d6510=_0x3fab18[_0x65b9('0x5c')]&&fs['existsSync'](path['join'](config[_0x65b9('0x62')],_0x1291bd,_[_0x65b9('0x61')](_0x3fab18[_0x65b9('0x5c')])))?path['join'](config[_0x65b9('0x62')],_0x1291bd,_[_0x65b9('0x61')](_0x3fab18[_0x65b9('0x5c')])):path['join'](config[_0x65b9('0x62')],_0x1291bd,_[_0x65b9('0x61')](_0x65b9('0x72')));var _0x38fce9=_0x65b9('0x6e')+_['upperFirst']('preferred');if(_0x3fab18[_0x38fce9]||!_0x26ff83[_0x65b9('0x6f')]||!_0x26ff83[_0x65b9('0x5c')]){_0x3d6510=path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x1291bd,_['toLower']('default_preferred.png'));}if(!fs[_0x65b9('0x66')](_0x3d6510)){throw new db[(_0x65b9('0x67'))][(_0x65b9('0x68'))](_['upperFirst'](_0x65b9('0x5c'))+_0x65b9('0x73'));}return _0x494076['download'](_0x3d6510);}})['catch'](handleError(_0x494076,null));};exports['addFavicon']=function(_0x51f0bb,_0x5a2977,_0x30be78){if(_0x51f0bb[_0x65b9('0x55')]&&_0x51f0bb[_0x65b9('0x55')][_0x65b9('0x59')]){_0x51f0bb[_0x65b9('0x54')]['favicon']=_0x51f0bb[_0x65b9('0x55')][_0x65b9('0x59')];}return db['Setting'][_0x65b9('0x53')]({'where':{'id':_0x51f0bb[_0x65b9('0x57')]['id']}})[_0x65b9('0x33')](handleEntityNotFound(_0x5a2977,null))[_0x65b9('0x33')](saveUpdates(_0x51f0bb[_0x65b9('0x54')],null))[_0x65b9('0x33')](respondWithResult(_0x5a2977,null))[_0x65b9('0x26')](handleError(_0x5a2977,null));};var utilLicense=require('../../config/license/util');exports[_0x65b9('0x74')]=function(_0x18c778,_0x313572,_0x1f15a5){var _0x38e64d='server/files/images/logos';var _0x2f4be2={'custom':![]};return utilLicense['getLicense']()[_0x65b9('0x33')](function(_0x198910){if(_0x198910){_0x2f4be2=_0x198910;}return db[_0x65b9('0x39')]['find']({'where':{'id':_0x18c778[_0x65b9('0x57')]['id']},'attributes':[_0x65b9('0x56'),'loginLogo',_0x65b9('0x5c'),_0x65b9('0x5d'),_0x65b9('0x5e'),_0x65b9('0x6b'),_0x65b9('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x65b9('0x33')](handleEntityNotFound(_0x313572,null))['then'](function(_0x293129){if(_0x293129){var _0x4ff304=_0x293129[_0x65b9('0x5d')]&&fs[_0x65b9('0x66')](path['join'](config['root'],_0x38e64d,_[_0x65b9('0x61')](_0x293129[_0x65b9('0x5d')])))?path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x38e64d,_[_0x65b9('0x61')](_0x293129[_0x65b9('0x5d')])):path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x38e64d,_[_0x65b9('0x61')](_0x65b9('0x75')));var _0x39a3c0=_0x65b9('0x6e')+_['upperFirst']('favicon');if(_0x293129[_0x39a3c0]||!_0x2f4be2[_0x65b9('0x6f')]){_0x4ff304=path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x38e64d,_[_0x65b9('0x61')](_0x65b9('0x75')));}if(!fs['existsSync'](_0x4ff304)){throw new db[(_0x65b9('0x67'))][(_0x65b9('0x68'))](_[_0x65b9('0x65')](_0x65b9('0x5d'))+_0x65b9('0x73'));}return _0x313572[_0x65b9('0x70')](_0x4ff304);}})[_0x65b9('0x26')](handleError(_0x313572,null));};exports[_0x65b9('0x76')]=function(_0x3d22ec,_0x4d7b9f){var _0x2ce468={'offset':moment()[_0x65b9('0x77')]()};_0x2ce468[_0x65b9('0x78')]=moment()[_0x65b9('0x77')](_0x2ce468[_0x65b9('0x2b')])[_0x65b9('0x79')](_0x65b9('0x7a'));return _0x4d7b9f[_0x65b9('0x28')](0xc8)[_0x65b9('0x7b')](_0x2ce468);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 521fa78..d3aa10f 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x1c498d,_0x355869){var _0x14787e=function(_0x306db7){while(--_0x306db7){_0x1c498d['push'](_0x1c498d['shift']());}};_0x14787e(++_0x355869);}(_0xedd9,0xfc));var _0x9edd=function(_0x142e59,_0x21b4a8){_0x142e59=_0x142e59-0x0;var _0x39f4ba=_0xedd9[_0x142e59];return _0x39f4ba;};'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 +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x69752e,_0x2579f6){var _0x506a36=function(_0x1793bc){while(--_0x1793bc){_0x69752e['push'](_0x69752e['shift']());}};_0x506a36(++_0x2579f6);}(_0x3e74,0x175));var _0x43e7=function(_0x493152,_0x14f99a){_0x493152=_0x493152-0x0;var _0x5a8e5a=_0x3e74[_0x493152];return _0x5a8e5a;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index fa97438..4af459a 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 _0x4c06=['include','model','map','then','ShowSetting','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Setting','find','options','where','attributes'];(function(_0x4cd825,_0x2d2a80){var _0x96c7a0=function(_0x4bf4ad){while(--_0x4bf4ad){_0x4cd825['push'](_0x4cd825['shift']());}};_0x96c7a0(++_0x2d2a80);}(_0x4c06,0xd8));var _0x64c0=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x4c06[_0x5de532];return _0x4e9192;};'use strict';var _=require(_0x64c0('0x0'));var util=require(_0x64c0('0x1'));var moment=require(_0x64c0('0x2'));var BPromise=require(_0x64c0('0x3'));var rs=require(_0x64c0('0x4'));var fs=require('fs');var Redis=require(_0x64c0('0x5'));var db=require(_0x64c0('0x6'))['db'];var utils=require(_0x64c0('0x7'));var logger=require(_0x64c0('0x8'))(_0x64c0('0x9'));var config=require(_0x64c0('0xa'));var jayson=require(_0x64c0('0xb'));var client=jayson[_0x64c0('0xc')][_0x64c0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28fb20,_0x401cb2,_0x526f62){return new BPromise(function(_0x2baa0b,_0x404dc5){return client[_0x64c0('0xe')](_0x28fb20,_0x526f62)['then'](function(_0x3f3857){logger[_0x64c0('0xf')](_0x64c0('0x10'),_0x401cb2,_0x64c0('0x11'));logger[_0x64c0('0x12')]('Setting,\x20%s,\x20%s,\x20%s',_0x401cb2,'request\x20sent',JSON[_0x64c0('0x13')](_0x3f3857));if(_0x3f3857[_0x64c0('0x14')]){if(_0x3f3857[_0x64c0('0x14')][_0x64c0('0x15')]===0x1f4){logger[_0x64c0('0x14')](_0x64c0('0x10'),_0x401cb2,_0x3f3857[_0x64c0('0x14')]['message']);return _0x404dc5(_0x3f3857[_0x64c0('0x14')][_0x64c0('0x16')]);}logger[_0x64c0('0x14')]('Setting,\x20%s,\x20%s',_0x401cb2,_0x3f3857[_0x64c0('0x14')]['message']);return _0x2baa0b(_0x3f3857[_0x64c0('0x14')][_0x64c0('0x16')]);}else{logger[_0x64c0('0xf')](_0x64c0('0x10'),_0x401cb2,'request\x20sent');_0x2baa0b(_0x3f3857[_0x64c0('0x17')][_0x64c0('0x16')]);}})['catch'](function(_0x3074bd){logger['error'](_0x64c0('0x10'),_0x401cb2,_0x3074bd);_0x404dc5(_0x3074bd);});});}exports['ShowSetting']=function(_0x26167f){var _0x1d7002=this;return new Promise(function(_0xd97985,_0x33a599){return db[_0x64c0('0x18')][_0x64c0('0x19')]({'raw':_0x26167f['options']?_0x26167f[_0x64c0('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x26167f[_0x64c0('0x1a')]?_0x26167f['options'][_0x64c0('0x1b')]||null:null,'attributes':_0x26167f['options']?_0x26167f[_0x64c0('0x1a')][_0x64c0('0x1c')]||null:null,'include':_0x26167f[_0x64c0('0x1a')]?_0x26167f[_0x64c0('0x1a')]['include']?_['map'](_0x26167f[_0x64c0('0x1a')][_0x64c0('0x1d')],function(_0x2ac997){return{'model':db[_0x2ac997[_0x64c0('0x1e')]],'as':_0x2ac997['as'],'attributes':_0x2ac997['attributes'],'include':_0x2ac997[_0x64c0('0x1d')]?_[_0x64c0('0x1f')](_0x2ac997[_0x64c0('0x1d')],function(_0x4a20e0){return{'model':db[_0x4a20e0['model']],'as':_0x4a20e0['as'],'attributes':_0x4a20e0[_0x64c0('0x1c')],'include':_0x4a20e0[_0x64c0('0x1d')]?_[_0x64c0('0x1f')](_0x4a20e0[_0x64c0('0x1d')],function(_0x42a7a2){return{'model':db[_0x42a7a2['model']],'as':_0x42a7a2['as'],'attributes':_0x42a7a2[_0x64c0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x64c0('0x20')](function(_0x18eb20){logger['info'](_0x64c0('0x21'),_0x26167f);logger[_0x64c0('0x12')]('ShowSetting',_0x26167f,JSON[_0x64c0('0x13')](_0x18eb20));_0xd97985(_0x18eb20);})[_0x64c0('0x22')](function(_0x61e9bd){logger[_0x64c0('0x14')](_0x64c0('0x21'),_0x61e9bd[_0x64c0('0x16')],_0x26167f);_0x33a599(_0x1d7002[_0x64c0('0x14')](0x1f4,_0x61e9bd['message']));});});}; \ No newline at end of file +var _0x3e56=['../../config/utils','rpc','../../config/environment','request','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','Setting,\x20%s,\x20%s','message','result','ShowSetting','Setting','options','raw','attributes','include','model','map','then','debug','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3d6baa,_0x92ddd7){var _0x32b8d1=function(_0x1a77d6){while(--_0x1a77d6){_0x3d6baa['push'](_0x3d6baa['shift']());}};_0x32b8d1(++_0x92ddd7);}(_0x3e56,0x1a0));var _0x63e5=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x3e56[_0x5cc8b9];return _0x58892e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x63e5('0x0'));var BPromise=require(_0x63e5('0x1'));var rs=require(_0x63e5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63e5('0x3'))['db'];var utils=require(_0x63e5('0x4'));var logger=require('../../config/logger')(_0x63e5('0x5'));var config=require(_0x63e5('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x514e32,_0x41f74d,_0x1e4eed){return new BPromise(function(_0x2b9a8c,_0xd186f7){return client[_0x63e5('0x7')](_0x514e32,_0x1e4eed)['then'](function(_0x377415){logger[_0x63e5('0x8')]('Setting,\x20%s,\x20%s',_0x41f74d,_0x63e5('0x9'));logger['debug'](_0x63e5('0xa'),_0x41f74d,_0x63e5('0x9'),JSON[_0x63e5('0xb')](_0x377415));if(_0x377415['error']){if(_0x377415['error'][_0x63e5('0xc')]===0x1f4){logger[_0x63e5('0xd')](_0x63e5('0xe'),_0x41f74d,_0x377415['error']['message']);return _0xd186f7(_0x377415[_0x63e5('0xd')][_0x63e5('0xf')]);}logger[_0x63e5('0xd')](_0x63e5('0xe'),_0x41f74d,_0x377415['error'][_0x63e5('0xf')]);return _0x2b9a8c(_0x377415['error'][_0x63e5('0xf')]);}else{logger[_0x63e5('0x8')]('Setting,\x20%s,\x20%s',_0x41f74d,_0x63e5('0x9'));_0x2b9a8c(_0x377415[_0x63e5('0x10')][_0x63e5('0xf')]);}})['catch'](function(_0x4b2a4c){logger[_0x63e5('0xd')](_0x63e5('0xe'),_0x41f74d,_0x4b2a4c);_0xd186f7(_0x4b2a4c);});});}exports[_0x63e5('0x11')]=function(_0x34158f){var _0x2d8d16=this;return new Promise(function(_0x3556d3,_0x568d4c){return db[_0x63e5('0x12')]['find']({'raw':_0x34158f[_0x63e5('0x13')]?_0x34158f['options'][_0x63e5('0x14')]===undefined?!![]:![]:!![],'where':_0x34158f[_0x63e5('0x13')]?_0x34158f[_0x63e5('0x13')]['where']||null:null,'attributes':_0x34158f[_0x63e5('0x13')]?_0x34158f[_0x63e5('0x13')][_0x63e5('0x15')]||null:null,'include':_0x34158f[_0x63e5('0x13')]?_0x34158f[_0x63e5('0x13')][_0x63e5('0x16')]?_['map'](_0x34158f[_0x63e5('0x13')][_0x63e5('0x16')],function(_0x1ab95f){return{'model':db[_0x1ab95f[_0x63e5('0x17')]],'as':_0x1ab95f['as'],'attributes':_0x1ab95f[_0x63e5('0x15')],'include':_0x1ab95f['include']?_[_0x63e5('0x18')](_0x1ab95f['include'],function(_0x564a85){return{'model':db[_0x564a85[_0x63e5('0x17')]],'as':_0x564a85['as'],'attributes':_0x564a85[_0x63e5('0x15')],'include':_0x564a85['include']?_['map'](_0x564a85[_0x63e5('0x16')],function(_0x596fc6){return{'model':db[_0x596fc6['model']],'as':_0x596fc6['as'],'attributes':_0x596fc6[_0x63e5('0x15')]};}):[]};}):[]};}):[]:[]})[_0x63e5('0x19')](function(_0xaf9128){logger[_0x63e5('0x8')](_0x63e5('0x11'),_0x34158f);logger[_0x63e5('0x1a')](_0x63e5('0x11'),_0x34158f,JSON['stringify'](_0xaf9128));_0x3556d3(_0xaf9128);})[_0x63e5('0x1b')](function(_0x58369f){logger[_0x63e5('0xd')](_0x63e5('0x11'),_0x58369f['message'],_0x34158f);_0x568d4c(_0x2d8d16['error'](0x1f4,_0x58369f[_0x63e5('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 5e9d26a..861d2f4 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(_0x4cb086,_0x4cc048){var _0x10d1af=function(_0x296e16){while(--_0x296e16){_0x4cb086['push'](_0x4cb086['shift']());}};_0x10d1af(++_0x4cc048);}(_0x814b,0x1a2));var _0xb814=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0x814b[_0x4d40dd];return _0x1c51f2;};'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 _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(_0x2ae22a,_0x4fe753){var _0x286a82=function(_0x256e58){while(--_0x256e58){_0x2ae22a['push'](_0x2ae22a['shift']());}};_0x286a82(++_0x4fe753);}(_0x814b,0x1a2));var _0xb814=function(_0x554047,_0x46ec41){_0x554047=_0x554047-0x0;var _0x5d11e4=_0x814b[_0x554047];return _0x5d11e4;};'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 diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 06dc0ba..520c84d 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 _0x50b6=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','twilio','skebby','plivo','bandwidth','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x252280,_0x1e7079){var _0x2fde19=function(_0x5eefbc){while(--_0x5eefbc){_0x252280['push'](_0x252280['shift']());}};_0x2fde19(++_0x1e7079);}(_0x50b6,0xa3));var _0x650b=function(_0x5dc980,_0xddcc83){_0x5dc980=_0x5dc980-0x0;var _0x3d6a8e=_0x50b6[_0x5dc980];return _0x3d6a8e;};'use strict';var Sequelize=require(_0x650b('0x0'));var rs=require(_0x650b('0x1'));module[_0x650b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x650b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x650b('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x650b('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x650b('0x5')]();}},'phone':{'type':Sequelize[_0x650b('0x4')]},'type':{'type':Sequelize['ENUM'](_0x650b('0x6'),_0x650b('0x7'),'connectel','clicksend',_0x650b('0x8'),'clickatell',_0x650b('0x9'),'csc',_0x650b('0xa'),_0x650b('0xb'))},'accountSid':{'type':Sequelize[_0x650b('0x4')]},'authId':{'type':Sequelize[_0x650b('0x4')]},'authToken':{'type':Sequelize[_0x650b('0x4')]},'smsMethod':{'type':Sequelize[_0x650b('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x650b('0x4')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x650b('0x4')]},'applicationId':{'type':Sequelize[_0x650b('0x4')]},'accountId':{'type':Sequelize[_0x650b('0x4')]},'senderString':{'type':Sequelize[_0x650b('0x4')]},'deliveryReport':{'type':Sequelize[_0x650b('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x650b('0x4')]},'notificationTemplate':{'type':Sequelize[_0x650b('0xe')],'defaultValue':function(){return _0x650b('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x650b('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x650b('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x650b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x650b('0xd')],'defaultValue':![],'comment':_0x650b('0x11'),'set':function(_0x33666c){if(!_0x33666c)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x650b('0x12')](_0x650b('0x13'),_0x33666c);}}}; \ No newline at end of file +var _0x3749=['twilio','skebby','connectel','clicksend','plivo','bandwidth','csc','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM'];(function(_0x13f632,_0x86a8aa){var _0x400e9f=function(_0x53d6d3){while(--_0x53d6d3){_0x13f632['push'](_0x13f632['shift']());}};_0x400e9f(++_0x86a8aa);}(_0x3749,0x68));var _0x9374=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x3749[_0x1bc0ae];return _0x501104;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9374('0x0'));module[_0x9374('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9374('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x9374('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x9374('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x9374('0x3')],'defaultValue':function(){return rs[_0x9374('0x4')]();}},'phone':{'type':Sequelize[_0x9374('0x3')]},'type':{'type':Sequelize[_0x9374('0x5')](_0x9374('0x6'),_0x9374('0x7'),_0x9374('0x8'),_0x9374('0x9'),_0x9374('0xa'),'clickatell',_0x9374('0xb'),_0x9374('0xc'),_0x9374('0xd'),'intelepeer')},'accountSid':{'type':Sequelize[_0x9374('0x3')]},'authId':{'type':Sequelize[_0x9374('0x3')]},'authToken':{'type':Sequelize[_0x9374('0x3')]},'smsMethod':{'type':Sequelize[_0x9374('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9374('0x3')]},'apiKey':{'type':Sequelize[_0x9374('0x3')]},'applicationId':{'type':Sequelize[_0x9374('0x3')]},'accountId':{'type':Sequelize[_0x9374('0x3')]},'senderString':{'type':Sequelize[_0x9374('0x3')]},'deliveryReport':{'type':Sequelize[_0x9374('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x9374('0xf')],'defaultValue':function(){return _0x9374('0x10');}},'notificationSound':{'type':Sequelize[_0x9374('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9374('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9374('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9374('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9374('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9374('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9374('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9374('0x11')],'comment':_0x9374('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x9374('0xe')],'defaultValue':![],'comment':_0x9374('0x13'),'set':function(_0x5a712e){if(!_0x5a712e)this['setDataValue'](_0x9374('0x14'),null);this['setDataValue'](_0x9374('0x15'),_0x5a712e);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index fa14c3d..80fc736 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 _0x46d5=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','options','SmsAccount','includeAll','include','findAll','rows','show','params','intersection','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','findOne','order','merge','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','notify','SmsApplication','Applications','asc','account','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','replyMessageId','bandwidth','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ListId','Contacts','omit','contact','SmsInteraction','created','autoclose','applications','close','*,*,*,*','interaction','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','List','DESC','out','Messages','spread','dataValues','push','SmsAccount,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','message_id','groupName','DELIVERED','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xffd1b5,_0x1ede18){var _0x3176d6=function(_0xe9ba48){while(--_0xe9ba48){_0xffd1b5['push'](_0xffd1b5['shift']());}};_0x3176d6(++_0x1ede18);}(_0x46d5,0x1b9));var _0x546d=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x46d5[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x546d('0x0'));var rimraf=require(_0x546d('0x1'));var zipdir=require(_0x546d('0x2'));var jsonpatch=require(_0x546d('0x3'));var rp=require(_0x546d('0x4'));var moment=require(_0x546d('0x5'));var BPromise=require(_0x546d('0x6'));var Mustache=require('mustache');var util=require(_0x546d('0x7'));var path=require('path');var sox=require(_0x546d('0x8'));var csv=require(_0x546d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x546d('0xa'));var squel=require(_0x546d('0xb'));var crypto=require(_0x546d('0xc'));var jsforce=require(_0x546d('0xd'));var deskjs=require(_0x546d('0xe'));var toCsv=require(_0x546d('0x9'));var querystring=require('querystring');var Papa=require(_0x546d('0xf'));var Redis=require(_0x546d('0x10'));var authService=require(_0x546d('0x11'));var qs=require(_0x546d('0x12'));var as=require(_0x546d('0x13'));var hardwareService=require(_0x546d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x546d('0x15'));var config=require(_0x546d('0x16'));var licenseUtil=require(_0x546d('0x17'));var db=require(_0x546d('0x18'))['db'];config[_0x546d('0x19')]=_[_0x546d('0x1a')](config[_0x546d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x546d('0x1b'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x546d('0x1c')](socket);var jayson=require(_0x546d('0x1d'));var client=jayson['client'][_0x546d('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x291e27,_0x20908d,_0x4dba21,_0x18dbc9){return new BPromise(function(_0x4cbf2e,_0x34f647){var _0x563892=_0x18dbc9||client;return _0x563892[_0x546d('0x1f')](_0x291e27,_0x4dba21)[_0x546d('0x20')](function(_0x423898){logger[_0x546d('0x21')](_0x546d('0x22'),_0x20908d,_0x546d('0x23'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x20908d,'request\x20sent',JSON[_0x546d('0x24')](_0x423898));if(_0x423898[_0x546d('0x25')]){if(_0x423898[_0x546d('0x25')]['code']===0x1f4){logger[_0x546d('0x25')]('SmsAccount,\x20%s,\x20%s',_0x20908d,_0x423898[_0x546d('0x25')]['message']);return _0x34f647(_0x423898[_0x546d('0x25')][_0x546d('0x26')]);}logger[_0x546d('0x25')]('SmsAccount,\x20%s,\x20%s',_0x20908d,_0x423898['error'][_0x546d('0x26')]);return _0x4cbf2e(_0x423898[_0x546d('0x25')][_0x546d('0x26')]);}else{logger[_0x546d('0x21')](_0x546d('0x22'),_0x20908d,_0x546d('0x23'));_0x4cbf2e(_0x423898[_0x546d('0x27')][_0x546d('0x26')]);}})[_0x546d('0x28')](function(_0xbf88fe){logger[_0x546d('0x25')](_0x546d('0x22'),_0x20908d,_0xbf88fe);_0x34f647(_0xbf88fe);});});}function respondWithStatusCode(_0x21331f,_0x33625d){_0x33625d=_0x33625d||0xcc;return function(_0x240e0f){if(_0x240e0f){return _0x21331f[_0x546d('0x29')](_0x33625d);}return _0x21331f['status'](_0x33625d)[_0x546d('0x2a')]();};}function respondWithResult(_0x3fa7e4,_0x159b4f){_0x159b4f=_0x159b4f||0xc8;return function(_0x3fb2cd){if(_0x3fb2cd){return _0x3fa7e4[_0x546d('0x2b')](_0x159b4f)[_0x546d('0x2c')](_0x3fb2cd);}};}function respondWithFilteredResult(_0x166f31,_0x1ca1d6){return function(_0x2d1b94){if(_0x2d1b94){var _0x2bf21e=typeof _0x1ca1d6['offset']===_0x546d('0x2d')&&typeof _0x1ca1d6[_0x546d('0x2e')]==='undefined';var _0x3cabe6=_0x2d1b94[_0x546d('0x2f')];var _0x3555e2=_0x2bf21e?0x0:_0x1ca1d6[_0x546d('0x30')];var _0x27bc0f=_0x2bf21e?_0x2d1b94[_0x546d('0x2f')]:_0x1ca1d6[_0x546d('0x30')]+_0x1ca1d6[_0x546d('0x2e')];var _0x3d3682;if(_0x27bc0f>=_0x3cabe6){_0x27bc0f=_0x3cabe6;_0x3d3682=0xc8;}else{_0x3d3682=0xce;}_0x166f31[_0x546d('0x2b')](_0x3d3682);return _0x166f31[_0x546d('0x31')](_0x546d('0x32'),_0x3555e2+'-'+_0x27bc0f+'/'+_0x3cabe6)[_0x546d('0x2c')](_0x2d1b94);}return null;};}function patchUpdates(_0x200056){return function(_0x20b4da){try{jsonpatch[_0x546d('0x33')](_0x20b4da,_0x200056,!![]);}catch(_0x51f2cd){return BPromise[_0x546d('0x34')](_0x51f2cd);}return _0x20b4da['save']();};}function saveUpdates(_0x54be57,_0x4d4109){return function(_0x54bbd0){if(_0x54bbd0){return _0x54bbd0['update'](_0x54be57)[_0x546d('0x20')](function(_0x45633c){return _0x45633c;});}return null;};}function removeEntity(_0x2f0ce0,_0x33e9d6){return function(_0x2fa2b5){if(_0x2fa2b5){return _0x2fa2b5[_0x546d('0x35')]()[_0x546d('0x20')](function(){var _0x232c90=_0x2fa2b5[_0x546d('0x36')]({'plain':!![]});var _0x5e834e=_0x546d('0x37');return db[_0x546d('0x38')][_0x546d('0x35')]({'where':{'type':_0x5e834e,'resourceId':_0x232c90['id']}})[_0x546d('0x20')](function(){return _0x2fa2b5;});})[_0x546d('0x20')](function(){_0x2f0ce0['status'](0xcc)[_0x546d('0x2a')]();});}};}function handleEntityNotFound(_0x40f632,_0x39e5fe){return function(_0x37deea){if(!_0x37deea){_0x40f632[_0x546d('0x29')](0x194);}return _0x37deea;};}function handleError(_0x29df39,_0x284cf4){_0x284cf4=_0x284cf4||0x1f4;return function(_0x376101){logger['error'](_0x376101[_0x546d('0x39')]);if(_0x376101[_0x546d('0x3a')]){delete _0x376101['name'];}_0x29df39[_0x546d('0x2b')](_0x284cf4)['send'](_0x376101);};}exports[_0x546d('0x3b')]=function(_0x3ebdbf,_0x154750){var _0x42f153={'include':[{'model':db[_0x546d('0x3c')],'as':_0x546d('0x3d')}]},_0x48e288={},_0x36f17c={'count':0x0,'rows':[]};var _0xe2ca44=_[_0x546d('0x3e')](db['SmsAccount'][_0x546d('0x3f')],function(_0x46cc4a){return{'name':_0x46cc4a['fieldName'],'type':_0x46cc4a['type'][_0x546d('0x40')]};});_0x48e288[_0x546d('0x41')]=_[_0x546d('0x3e')](_0xe2ca44,_0x546d('0x3a'));_0x48e288[_0x546d('0x42')]=_[_0x546d('0x43')](_0x3ebdbf[_0x546d('0x42')]);_0x48e288[_0x546d('0x44')]=_['intersection'](_0x48e288[_0x546d('0x41')],_0x48e288['query']);_0x42f153[_0x546d('0x45')]=_['intersection'](_0x48e288[_0x546d('0x41')],qs['fields'](_0x3ebdbf[_0x546d('0x42')][_0x546d('0x46')]));_0x42f153[_0x546d('0x45')]=_0x42f153[_0x546d('0x45')][_0x546d('0x47')]?_0x42f153['attributes']:_0x48e288[_0x546d('0x41')];if(!_0x3ebdbf[_0x546d('0x42')][_0x546d('0x48')](_0x546d('0x49'))){_0x42f153[_0x546d('0x2e')]=qs[_0x546d('0x2e')](_0x3ebdbf['query'][_0x546d('0x2e')]);_0x42f153[_0x546d('0x30')]=qs['offset'](_0x3ebdbf[_0x546d('0x42')]['offset']);}_0x42f153['order']=qs[_0x546d('0x4a')](_0x3ebdbf[_0x546d('0x42')][_0x546d('0x4a')]);_0x42f153['where']=qs[_0x546d('0x44')](_[_0x546d('0x4b')](_0x3ebdbf['query'],_0x48e288['filters']),_0xe2ca44);if(_0x3ebdbf[_0x546d('0x42')][_0x546d('0x4c')]){_0x42f153[_0x546d('0x4d')]=_['merge'](_0x42f153['where'],{'$or':_['map'](_0xe2ca44,function(_0x4da5e0){if(_0x4da5e0[_0x546d('0x4e')]!==_0x546d('0x4f')){var _0x46d44f={};_0x46d44f[_0x4da5e0[_0x546d('0x3a')]]={'$like':'%'+_0x3ebdbf[_0x546d('0x42')]['filter']+'%'};return _0x46d44f;}})});}_0x42f153=_['merge']({},_0x42f153,_0x3ebdbf[_0x546d('0x50')]);var _0x58fe2b={'where':_0x42f153[_0x546d('0x4d')]};return db[_0x546d('0x51')]['count'](_0x58fe2b)[_0x546d('0x20')](function(_0x246b07){_0x36f17c[_0x546d('0x2f')]=_0x246b07;if(_0x3ebdbf[_0x546d('0x42')][_0x546d('0x52')]){_0x42f153[_0x546d('0x53')]=[{'all':!![]}];}return db[_0x546d('0x51')][_0x546d('0x54')](_0x42f153);})[_0x546d('0x20')](function(_0x388a3c){_0x36f17c[_0x546d('0x55')]=_0x388a3c;return _0x36f17c;})[_0x546d('0x20')](respondWithFilteredResult(_0x154750,_0x42f153))[_0x546d('0x28')](handleError(_0x154750,null));};exports[_0x546d('0x56')]=function(_0x2c056d,_0x24ad7e){var _0x3bbedd={'raw':![],'where':{'id':_0x2c056d[_0x546d('0x57')]['id']},'include':[{'model':db[_0x546d('0x3c')],'as':_0x546d('0x3d')}]},_0x489201={};_0x489201[_0x546d('0x41')]=_[_0x546d('0x43')](db[_0x546d('0x51')][_0x546d('0x3f')]);_0x489201[_0x546d('0x42')]=_[_0x546d('0x43')](_0x2c056d[_0x546d('0x42')]);_0x489201[_0x546d('0x44')]=_[_0x546d('0x58')](_0x489201[_0x546d('0x41')],_0x489201[_0x546d('0x42')]);_0x3bbedd[_0x546d('0x45')]=_[_0x546d('0x58')](_0x489201['model'],qs[_0x546d('0x46')](_0x2c056d[_0x546d('0x42')][_0x546d('0x46')]));_0x3bbedd[_0x546d('0x45')]=_0x3bbedd[_0x546d('0x45')][_0x546d('0x47')]?_0x3bbedd[_0x546d('0x45')]:_0x489201[_0x546d('0x41')];if(_0x2c056d[_0x546d('0x42')]['includeAll']){_0x3bbedd[_0x546d('0x53')]=[{'all':!![]}];}_0x3bbedd=_['merge']({},_0x3bbedd,_0x2c056d[_0x546d('0x50')]);return db[_0x546d('0x51')][_0x546d('0x59')](_0x3bbedd)[_0x546d('0x20')](handleEntityNotFound(_0x24ad7e,null))[_0x546d('0x20')](respondWithResult(_0x24ad7e,null))[_0x546d('0x28')](handleError(_0x24ad7e,null));};exports[_0x546d('0x5a')]=function(_0x11e54a,_0x1bfae6){return db['SmsAccount']['create'](_0x11e54a[_0x546d('0x5b')],{})[_0x546d('0x20')](function(_0x25e173){var _0xef6198=_0x11e54a[_0x546d('0x5c')][_0x546d('0x36')]({'plain':!![]});if(!_0xef6198)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xef6198[_0x546d('0x5d')]===_0x546d('0x5c')){var _0x2f7158=_0x25e173[_0x546d('0x36')]({'plain':!![]});var _0x408909=_0x546d('0x37');return db[_0x546d('0x5e')]['find']({'where':{'name':_0x408909,'userProfileId':_0xef6198[_0x546d('0x5f')]},'raw':!![]})['then'](function(_0xbbfd49){if(_0xbbfd49&&_0xbbfd49['autoAssociation']===0x0){return db[_0x546d('0x38')][_0x546d('0x5a')]({'name':_0x2f7158['name'],'resourceId':_0x2f7158['id'],'type':_0xbbfd49['name'],'sectionId':_0xbbfd49['id']},{})[_0x546d('0x20')](function(){return _0x25e173;});}else{return _0x25e173;}})[_0x546d('0x28')](function(_0x1717ab){logger[_0x546d('0x25')](_0x546d('0x60'),_0x1717ab);throw _0x1717ab;});}return _0x25e173;})['then'](respondWithResult(_0x1bfae6,0xc9))['catch'](handleError(_0x1bfae6,null));};exports[_0x546d('0x61')]=function(_0x6ca0fe,_0x572e6b){if(_0x6ca0fe[_0x546d('0x5b')]['id']){delete _0x6ca0fe['body']['id'];}return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x6ca0fe[_0x546d('0x57')]['id']},'include':[{'model':db[_0x546d('0x3c')],'as':_0x546d('0x3d')}]})['then'](handleEntityNotFound(_0x572e6b,null))[_0x546d('0x20')](saveUpdates(_0x6ca0fe[_0x546d('0x5b')],null))['then'](respondWithResult(_0x572e6b,null))[_0x546d('0x28')](handleError(_0x572e6b,null));};exports[_0x546d('0x35')]=function(_0x1cdc45,_0x324408){return db['SmsAccount']['find']({'where':{'id':_0x1cdc45[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x324408,null))[_0x546d('0x20')](removeEntity(_0x324408,null))[_0x546d('0x28')](handleError(_0x324408,null));};exports[_0x546d('0x62')]=function(_0x5cab96,_0x2dec3a){return db[_0x546d('0x51')][_0x546d('0x62')]()[_0x546d('0x20')](respondWithResult(_0x2dec3a,null))[_0x546d('0x28')](handleError(_0x2dec3a,null));};exports[_0x546d('0x63')]=function(_0x132d74,_0x4a2154,_0x27d117){if(_0x132d74[_0x546d('0x5b')]['id']){delete _0x132d74[_0x546d('0x5b')]['id'];}return db['SmsAccount'][_0x546d('0x59')]({'where':{'id':_0x132d74[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x4a2154,null))[_0x546d('0x20')](function(_0x28ba34){if(_0x28ba34){_0x132d74[_0x546d('0x5b')][_0x546d('0x64')]=_0x28ba34['id'];return db[_0x546d('0x65')][_0x546d('0x5a')](_0x132d74[_0x546d('0x5b')]);}})[_0x546d('0x20')](respondWithResult(_0x4a2154,null))[_0x546d('0x28')](handleError(_0x4a2154,null));};exports['getDispositions']=function(_0x51851a,_0x331262,_0x334cea){var _0x160be3={'raw':![],'where':{}};var _0x21ae9f={};var _0x539ba1={'count':0x0,'rows':[]};return db['SmsAccount'][_0x546d('0x66')]({'where':{'id':_0x51851a['params']['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x331262,null))[_0x546d('0x20')](function(_0x4fd040){if(_0x4fd040){_0x21ae9f[_0x546d('0x41')]=_[_0x546d('0x43')](db[_0x546d('0x65')]['rawAttributes']);_0x21ae9f[_0x546d('0x42')]=_[_0x546d('0x43')](_0x51851a['query']);_0x21ae9f[_0x546d('0x44')]=_[_0x546d('0x58')](_0x21ae9f[_0x546d('0x41')],_0x21ae9f['query']);_0x160be3[_0x546d('0x45')]=_[_0x546d('0x58')](_0x21ae9f[_0x546d('0x41')],qs[_0x546d('0x46')](_0x51851a['query'][_0x546d('0x46')]));_0x160be3[_0x546d('0x45')]=_0x160be3[_0x546d('0x45')][_0x546d('0x47')]?_0x160be3[_0x546d('0x45')]:_0x21ae9f['model'];if(!_0x51851a['query'][_0x546d('0x48')]('nolimit')){_0x160be3[_0x546d('0x2e')]=qs[_0x546d('0x2e')](_0x51851a[_0x546d('0x42')][_0x546d('0x2e')]);_0x160be3[_0x546d('0x30')]=qs[_0x546d('0x30')](_0x51851a[_0x546d('0x42')]['offset']);}_0x160be3[_0x546d('0x67')]=qs['sort'](_0x51851a[_0x546d('0x42')][_0x546d('0x4a')]);_0x160be3[_0x546d('0x4d')]=qs[_0x546d('0x44')](_['pick'](_0x51851a['query'],_0x21ae9f[_0x546d('0x44')]));_0x160be3[_0x546d('0x4d')]['SmsAccountId']=_0x4fd040['id'];if(_0x51851a[_0x546d('0x42')][_0x546d('0x4c')]){_0x160be3[_0x546d('0x4d')]=_[_0x546d('0x68')](_0x160be3['where'],{'$or':_[_0x546d('0x3e')](_0x160be3[_0x546d('0x45')],function(_0x57c096){var _0x41d2dd={};_0x41d2dd[_0x57c096]={'$like':'%'+_0x51851a['query'][_0x546d('0x4c')]+'%'};return _0x41d2dd;})});}_0x160be3=_[_0x546d('0x68')]({},_0x160be3,_0x51851a[_0x546d('0x50')]);return db[_0x546d('0x65')][_0x546d('0x2f')]({'where':_0x160be3[_0x546d('0x4d')]})[_0x546d('0x20')](function(_0x3d3d26){_0x539ba1[_0x546d('0x2f')]=_0x3d3d26;if(_0x51851a[_0x546d('0x42')][_0x546d('0x52')]){_0x160be3['include']=[{'all':!![]}];}return db[_0x546d('0x65')][_0x546d('0x54')](_0x160be3);})['then'](function(_0x23b70e){_0x539ba1[_0x546d('0x55')]=_0x23b70e;return _0x539ba1;});}})[_0x546d('0x20')](respondWithFilteredResult(_0x331262,_0x160be3))[_0x546d('0x28')](handleError(_0x331262,null));};exports[_0x546d('0x69')]=function(_0x5790b7,_0x53ce16,_0x1458aa){return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x5790b7[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x53ce16,null))[_0x546d('0x20')](function(_0x4054f1){if(_0x4054f1){return _0x4054f1['removeDispositions'](_0x5790b7[_0x546d('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x53ce16,null))[_0x546d('0x28')](handleError(_0x53ce16,null));};exports[_0x546d('0x6a')]=function(_0x4b90e6,_0x466ff6,_0x2d32b5){if(_0x4b90e6[_0x546d('0x5b')]['id']){delete _0x4b90e6['body']['id'];}return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x4b90e6['params']['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x466ff6,null))[_0x546d('0x20')](function(_0x337aeb){if(_0x337aeb){_0x4b90e6['body'][_0x546d('0x64')]=_0x337aeb['id'];return db[_0x546d('0x6b')]['create'](_0x4b90e6['body']);}})[_0x546d('0x20')](respondWithResult(_0x466ff6,null))[_0x546d('0x28')](handleError(_0x466ff6,null));};exports['getAnswers']=function(_0x16b0c7,_0x445188,_0x446b81){var _0x77799d={'raw':![],'where':{}};var _0x50f045={};var _0x4d6c1d={'count':0x0,'rows':[]};return db[_0x546d('0x51')][_0x546d('0x66')]({'where':{'id':_0x16b0c7[_0x546d('0x57')]['id']}})['then'](handleEntityNotFound(_0x445188,null))['then'](function(_0x5f0470){if(_0x5f0470){_0x50f045[_0x546d('0x41')]=_[_0x546d('0x43')](db[_0x546d('0x6b')][_0x546d('0x3f')]);_0x50f045[_0x546d('0x42')]=_[_0x546d('0x43')](_0x16b0c7[_0x546d('0x42')]);_0x50f045['filters']=_['intersection'](_0x50f045[_0x546d('0x41')],_0x50f045[_0x546d('0x42')]);_0x77799d['attributes']=_[_0x546d('0x58')](_0x50f045[_0x546d('0x41')],qs[_0x546d('0x46')](_0x16b0c7['query'][_0x546d('0x46')]));_0x77799d[_0x546d('0x45')]=_0x77799d[_0x546d('0x45')][_0x546d('0x47')]?_0x77799d[_0x546d('0x45')]:_0x50f045['model'];if(!_0x16b0c7[_0x546d('0x42')]['hasOwnProperty'](_0x546d('0x49'))){_0x77799d[_0x546d('0x2e')]=qs[_0x546d('0x2e')](_0x16b0c7[_0x546d('0x42')][_0x546d('0x2e')]);_0x77799d['offset']=qs[_0x546d('0x30')](_0x16b0c7[_0x546d('0x42')][_0x546d('0x30')]);}_0x77799d[_0x546d('0x67')]=qs[_0x546d('0x4a')](_0x16b0c7[_0x546d('0x42')][_0x546d('0x4a')]);_0x77799d['where']=qs[_0x546d('0x44')](_[_0x546d('0x4b')](_0x16b0c7[_0x546d('0x42')],_0x50f045[_0x546d('0x44')]));_0x77799d['where'][_0x546d('0x64')]=_0x5f0470['id'];if(_0x16b0c7[_0x546d('0x42')]['filter']){_0x77799d[_0x546d('0x4d')]=_[_0x546d('0x68')](_0x77799d[_0x546d('0x4d')],{'$or':_[_0x546d('0x3e')](_0x77799d[_0x546d('0x45')],function(_0x3eec33){var _0x1ed68b={};_0x1ed68b[_0x3eec33]={'$like':'%'+_0x16b0c7['query'][_0x546d('0x4c')]+'%'};return _0x1ed68b;})});}_0x77799d=_[_0x546d('0x68')]({},_0x77799d,_0x16b0c7[_0x546d('0x50')]);return db['CannedAnswer'][_0x546d('0x2f')]({'where':_0x77799d[_0x546d('0x4d')]})[_0x546d('0x20')](function(_0x556f68){_0x4d6c1d[_0x546d('0x2f')]=_0x556f68;if(_0x16b0c7[_0x546d('0x42')][_0x546d('0x52')]){_0x77799d[_0x546d('0x53')]=[{'all':!![]}];}return db[_0x546d('0x6b')][_0x546d('0x54')](_0x77799d);})[_0x546d('0x20')](function(_0x551485){_0x4d6c1d[_0x546d('0x55')]=_0x551485;return _0x4d6c1d;});}})[_0x546d('0x20')](respondWithFilteredResult(_0x445188,_0x77799d))[_0x546d('0x28')](handleError(_0x445188,null));};exports['removeAnswers']=function(_0x410659,_0x45cc04,_0x1230f1){return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x410659['params']['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x45cc04,null))[_0x546d('0x20')](function(_0x334d22){if(_0x334d22){return _0x334d22[_0x546d('0x6c')](_0x410659[_0x546d('0x42')][_0x546d('0x6d')]);}})[_0x546d('0x20')](respondWithStatusCode(_0x45cc04,null))[_0x546d('0x28')](handleError(_0x45cc04,null));};exports[_0x546d('0x6e')]=function(_0x2c4383,_0x3d88e6,_0x454563){var _0x5704a8={'channel':'sms'};var _0xc65790=[];var _0x2a9687=[];var _0x391a02={};return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x2c4383['params']['id']},'include':[{'model':db[_0x546d('0x6f')],'as':_0x546d('0x70')}]})[_0x546d('0x20')](handleEntityNotFound(_0x3d88e6,null))[_0x546d('0x20')](function(_0x2bd42f){_0x5704a8['account']=_0x2bd42f;_0x5704a8['applications']=_['orderBy'](_0x2bd42f[_0x546d('0x70')],['priority'],[_0x546d('0x71')]);if(_0x5704a8['account'][_0x546d('0x70')]){delete _0x5704a8[_0x546d('0x72')]['Applications'];}return db[_0x546d('0x73')]['describe']();})['then'](function(_0x45ef0b){if(!_0x45ef0b){throw new db[(_0x546d('0x74'))]['ValidationError'](_0x546d('0x75'));}_0xc65790=_['difference'](_[_0x546d('0x43')](_0x45ef0b),[_0x546d('0x76'),_0x546d('0x77')]);_0x2a9687=_[_0x546d('0x78')](_[_0x546d('0x43')](_0x45ef0b),[_0x546d('0x76'),_0x546d('0x77'),_0x546d('0x79'),'ListId']);_0x5704a8['body']={'mapKey':_0x546d('0x7a')};if(_0x5704a8[_0x546d('0x72')][_0x546d('0x4e')]){switch(_0x5704a8[_0x546d('0x72')][_0x546d('0x4e')]){case _0x546d('0x7b'):_0x5704a8['body'][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x7d')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x7e')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x7f')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x80')];break;case _0x546d('0x81'):_0x5704a8[_0x546d('0x5b')]['from']='+'+_0x2c4383[_0x546d('0x5b')]['sender'];_0x5704a8['body'][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x82')];break;case _0x546d('0x83'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x7c')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x26')];break;case _0x546d('0x84'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x7c')];_0x5704a8[_0x546d('0x5b')]['body']=_0x2c4383[_0x546d('0x5b')][_0x546d('0x5b')];_0x5704a8['body']['messageId']=_0x2c4383[_0x546d('0x5b')]['message_id'];break;case _0x546d('0x85'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')]['From'];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x86')];_0x5704a8['body'][_0x546d('0x7f')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x87')];break;case _0x546d('0x88'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]='+'+_0x2c4383[_0x546d('0x5b')][_0x546d('0x89')][0x0][_0x546d('0x7c')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')]['results'][0x0][_0x546d('0x82')];_0x5704a8[_0x546d('0x5b')]['messageId']=_0x2c4383['body'][_0x546d('0x89')][0x0][_0x546d('0x7f')];break;case _0x546d('0x8a'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x8b')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383['body'][_0x546d('0x8c')][_0x546d('0x26')];break;case'clickatell':_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')]['fromNumber'];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x82')];_0x5704a8['body']['messageId']=_0x2c4383[_0x546d('0x5b')][_0x546d('0x8d')];break;case _0x546d('0x8e'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7f')]=_0x2c4383[_0x546d('0x5b')][0x0]['message']['id'];_0x5704a8[_0x546d('0x5b')]['from']=_0x2c4383['body'][0x0][_0x546d('0x26')]['from'];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383['body'][0x0][_0x546d('0x26')][_0x546d('0x82')];break;case _0x546d('0x8f'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383['body'][_0x546d('0x7c')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x26')];_0x5704a8[_0x546d('0x5b')]['messageId']=_0x2c4383[_0x546d('0x5b')][_0x546d('0x90')];break;}}if(_0x5704a8[_0x546d('0x5b')]['id']){delete _0x5704a8[_0x546d('0x5b')]['id'];}if(_[_0x546d('0x91')](_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')])){throw new db[(_0x546d('0x74'))][(_0x546d('0x92'))](_0x546d('0x93'));}if(_[_0x546d('0x91')](_0x5704a8['body'][_0x546d('0x5b')])||_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]===''){throw new db[(_0x546d('0x74'))][(_0x546d('0x92'))](_0x546d('0x94'));}if(_[_0x546d('0x91')](_0x5704a8[_0x546d('0x5b')][_0x546d('0x95')])){throw new db[(_0x546d('0x74'))][(_0x546d('0x92'))](_0x546d('0x96')+_0x2a9687);}if(!_[_0x546d('0x97')](_0x2a9687,_0x5704a8[_0x546d('0x5b')]['mapKey'])){throw new db[(_0x546d('0x74'))][(_0x546d('0x92'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a9687);}_0x391a02[_0x5704a8[_0x546d('0x5b')][_0x546d('0x95')]]=_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')];return db['CmList']['find']({'where':{'id':_0x5704a8[_0x546d('0x72')][_0x546d('0x98')]},'include':[{'model':db['CmContact'],'as':_0x546d('0x99'),'where':_0x391a02,'limit':0x1,'order':[[_0x546d('0x77'),'DESC']]}]});})[_0x546d('0x20')](handleEntityNotFound(_0x3d88e6,null))[_0x546d('0x20')](function(_0x101f19){if(_0x101f19){_0x5704a8['list']=_[_0x546d('0x9a')](_0x101f19,[_0x546d('0x99')]);if(_0x101f19[_0x546d('0x99')][_0x546d('0x47')]){return _0x101f19[_0x546d('0x99')][0x0];}var _0x55166b=_['defaults'](_0x5704a8['body'],{'firstName':_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')],'ListId':_0x101f19['id']});_0x55166b[_0x5704a8[_0x546d('0x5b')][_0x546d('0x95')]]=_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')];return db['CmContact'][_0x546d('0x5a')](_0x55166b,{'fields':_0xc65790,'raw':!![]});}})[_0x546d('0x20')](handleEntityNotFound(_0x3d88e6,null))[_0x546d('0x20')](function(_0xfb540e){if(_0xfb540e){_0x5704a8[_0x546d('0x9b')]=_0xfb540e;var _0x56693e={'ContactId':_0xfb540e['id'],'phone':_0x5704a8[_0x546d('0x5b')]['from'],'SmsAccountId':_0x2c4383[_0x546d('0x57')]['id']};var _0x38e30f={'ContactId':_0xfb540e['id'],'SmsAccountId':_0x2c4383[_0x546d('0x57')]['id'],'closed':![]};return db[_0x546d('0x9c')]['find']({'where':_0x38e30f})[_0x546d('0x20')](function(_0x1fb318){if(_0x1fb318){return[_0x1fb318,![]];}return db[_0x546d('0x9c')][_0x546d('0x5a')](_0x56693e)['then'](function(_0x322990){return[_0x322990,!![]];});});}})['spread'](function(_0x36bd67,_0x1a8087){_0x5704a8['interaction']=_0x36bd67[_0x546d('0x36')]({'plain':!![]});_0x5704a8['interaction'][_0x546d('0x9d')]=![];if(_0x1a8087){if(_0x5704a8['account'][_0x546d('0x9e')]){_0x5704a8[_0x546d('0x9f')]['push']({'id':0x0,'priority':_0x5704a8[_0x546d('0x9f')]['length']+0x1,'app':_0x546d('0xa0'),'appdata':'unmanaged','interval':_0x546d('0xa1')});}_0x5704a8[_0x546d('0xa2')][_0x546d('0x9d')]=!![];}return db[_0x546d('0xa3')][_0x546d('0x5a')]({'phone':_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')],'messageId':_0x5704a8[_0x546d('0x5b')][_0x546d('0x7f')],'body':_0x5704a8['body'][_0x546d('0x5b')],'SmsAccountId':_0x2c4383[_0x546d('0x57')]['id'],'SmsInteractionId':_0x36bd67['id'],'direction':'in','ContactId':_0x36bd67[_0x546d('0xa4')],'AttachmentId':_0x5704a8[_0x546d('0x5b')][_0x546d('0xa5')]});})['then'](function(_0x48009c){_0x5704a8[_0x546d('0x26')]=_0x48009c;if(_0x5704a8['interaction']['UserId']){return db['User']['find']({'attributes':['id',_0x546d('0x3a')],'where':{'id':_0x5704a8[_0x546d('0xa2')][_0x546d('0xa6')]}})['then'](function(_0x57b580){if(_0x57b580){_0x5704a8[_0x546d('0x9f')][_0x546d('0xa7')]({'id':0x0,'priority':0x0,'app':_0x546d('0xa8'),'appdata':_0x57b580['name']+','+(_0x5704a8[_0x546d('0x72')]['waitForTheAssignedAgent']||0xa),'interval':_0x546d('0xa1')});}return respondWithRpcPromise(_0x546d('0xa9'),_0x546d('0xaa'),_0x5704a8);});}return respondWithRpcPromise(_0x546d('0xa9'),_0x546d('0xaa'),_0x5704a8);})[_0x546d('0x20')](function(_0x479370){if(_0x479370){var _0x1eafc2=0xc8;var _0x5a6c79=_0x546d('0xab');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5a6c79,_0x1eafc2,'entity\x20found');logger[_0x546d('0xac')](_0x546d('0xad'),_0x5a6c79,_0x1eafc2,_0x546d('0xae'),JSON[_0x546d('0x24')](_0x479370));if(_0x5704a8['account'][_0x546d('0x4e')]===_0x546d('0x7b')){return _0x3d88e6['status'](_0x1eafc2)['set'](_0x546d('0xaf'),_0x546d('0xb0'))[_0x546d('0xb1')](_0x546d('0xb2'));}else{return _0x3d88e6[_0x546d('0x2b')](_0x1eafc2)['json'](_0x479370);}}})[_0x546d('0x28')](handleError(_0x3d88e6,null));};exports[_0x546d('0xb3')]=function(_0x1659e6,_0x3ea2e1,_0x2aca9e){return db[_0x546d('0x51')][_0x546d('0x66')]({'where':{'id':_0x1659e6['params']['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x3ea2e1,null))[_0x546d('0x20')](function(_0x529486){if(_0x529486){return db[_0x546d('0xb4')][_0x546d('0xb5')](function(_0x5a8edb){return db[_0x546d('0x6f')][_0x546d('0x35')]({'where':{'SmsAccountId':_0x1659e6[_0x546d('0x57')]['id']},'transaction':_0x5a8edb})['then'](function(_0x37d0ee){var _0x3c95c7=_[_0x546d('0x3e')](_0x1659e6['body'],function(_0x4c1ef1){_0x4c1ef1['SmsAccountId']=_0x1659e6[_0x546d('0x57')]['id'];return _0x4c1ef1;});return db['SmsApplication'][_0x546d('0xb6')](_0x3c95c7,{'transaction':_0x5a8edb});});})['then'](function(){return db[_0x546d('0x6f')][_0x546d('0xb7')]({'where':{'SmsAccountId':_0x1659e6[_0x546d('0x57')]['id']},'order':_0x546d('0xb8')});});}})['then'](respondWithResult(_0x3ea2e1,null))[_0x546d('0x28')](handleError(_0x3ea2e1,null));};exports[_0x546d('0xb9')]=function(_0x51efb5,_0x1cd0f0,_0xf431de){var _0x52c6e6={};var _0x5889b7={};var _0x15fb3f;var _0x4524cf;return db[_0x546d('0x51')][_0x546d('0x66')]({'where':{'id':_0x51efb5[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x1cd0f0,null))[_0x546d('0x20')](function(_0x3fff57){if(_0x3fff57){_0x15fb3f=_0x3fff57;_0x5889b7['model']=_[_0x546d('0x43')](db[_0x546d('0x6f')][_0x546d('0x3f')]);_0x5889b7[_0x546d('0x42')]=_[_0x546d('0x43')](_0x51efb5[_0x546d('0x42')]);_0x5889b7[_0x546d('0x44')]=_[_0x546d('0x58')](_0x5889b7[_0x546d('0x41')],_0x5889b7[_0x546d('0x42')]);_0x52c6e6[_0x546d('0x45')]=_[_0x546d('0x58')](_0x5889b7[_0x546d('0x41')],qs[_0x546d('0x46')](_0x51efb5[_0x546d('0x42')]['fields']));_0x52c6e6[_0x546d('0x45')]=_0x52c6e6[_0x546d('0x45')]['length']?_0x52c6e6[_0x546d('0x45')]:_0x5889b7[_0x546d('0x41')];_0x52c6e6['order']=qs[_0x546d('0x4a')](_0x51efb5[_0x546d('0x42')][_0x546d('0x4a')]);_0x52c6e6[_0x546d('0x4d')]=qs[_0x546d('0x44')](_[_0x546d('0x4b')](_0x51efb5[_0x546d('0x42')],_0x5889b7[_0x546d('0x44')]));if(_0x51efb5[_0x546d('0x42')][_0x546d('0x4c')]){_0x52c6e6['where']=_[_0x546d('0x68')](_0x52c6e6[_0x546d('0x4d')],{'$or':_[_0x546d('0x3e')](_0x52c6e6['attributes'],function(_0x4eab99){var _0x569aaf={};_0x569aaf[_0x4eab99]={'$like':'%'+_0x51efb5[_0x546d('0x42')][_0x546d('0x4c')]+'%'};return _0x569aaf;})});}_0x52c6e6=_[_0x546d('0x68')]({},_0x52c6e6,_0x51efb5[_0x546d('0x50')]);return _0x15fb3f[_0x546d('0xb9')](_0x52c6e6);}})[_0x546d('0x20')](function(_0xe383a){if(_0xe383a){_0x4524cf=_0xe383a[_0x546d('0x47')];if(!_0x51efb5[_0x546d('0x42')][_0x546d('0x48')](_0x546d('0x49'))){_0x52c6e6[_0x546d('0x2e')]=qs[_0x546d('0x2e')](_0x51efb5[_0x546d('0x42')][_0x546d('0x2e')]);_0x52c6e6[_0x546d('0x30')]=qs[_0x546d('0x30')](_0x51efb5[_0x546d('0x42')][_0x546d('0x30')]);}return _0x15fb3f['getApplications'](_0x52c6e6);}})['then'](function(_0x2099a7){if(_0x2099a7){return _0x2099a7?{'count':_0x4524cf,'rows':_0x2099a7}:null;}})[_0x546d('0x20')](respondWithResult(_0x1cd0f0,null))[_0x546d('0x28')](handleError(_0x1cd0f0,null));};exports[_0x546d('0xba')]=function(_0x1e75f2,_0x2536e3,_0x55f49c){var _0x2c60d7={'raw':![],'where':{}};var _0x22ec59={};var _0x2cba57={'count':0x0,'rows':[]};return db[_0x546d('0x51')]['findOne']({'where':{'id':_0x1e75f2[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x2536e3,null))['then'](function(_0x156e28){if(_0x156e28){_0x22ec59['model']=_[_0x546d('0x43')](db[_0x546d('0x9c')][_0x546d('0x3f')]);_0x22ec59[_0x546d('0x42')]=_[_0x546d('0x43')](_0x1e75f2[_0x546d('0x42')]);_0x22ec59['filters']=_[_0x546d('0x58')](_0x22ec59[_0x546d('0x41')],_0x22ec59[_0x546d('0x42')]);_0x2c60d7['attributes']=_[_0x546d('0x58')](_0x22ec59[_0x546d('0x41')],qs[_0x546d('0x46')](_0x1e75f2[_0x546d('0x42')][_0x546d('0x46')]));_0x2c60d7['attributes']=_0x2c60d7[_0x546d('0x45')]['length']?_0x2c60d7[_0x546d('0x45')]:_0x22ec59[_0x546d('0x41')];if(!_0x1e75f2[_0x546d('0x42')][_0x546d('0x48')]('nolimit')){_0x2c60d7[_0x546d('0x2e')]=qs[_0x546d('0x2e')](_0x1e75f2[_0x546d('0x42')][_0x546d('0x2e')]);_0x2c60d7[_0x546d('0x30')]=qs[_0x546d('0x30')](_0x1e75f2[_0x546d('0x42')][_0x546d('0x30')]);}_0x2c60d7[_0x546d('0x67')]=qs['sort'](_0x1e75f2[_0x546d('0x42')][_0x546d('0x4a')]);_0x2c60d7[_0x546d('0x4d')]=qs[_0x546d('0x44')](_[_0x546d('0x4b')](_0x1e75f2['query'],_0x22ec59['filters']));_0x2c60d7[_0x546d('0x4d')][_0x546d('0x64')]=_0x156e28['id'];if(_0x1e75f2[_0x546d('0x42')][_0x546d('0x4c')]){_0x2c60d7[_0x546d('0x4d')]=_['merge'](_0x2c60d7[_0x546d('0x4d')],{'$or':_['map'](_0x2c60d7[_0x546d('0x45')],function(_0x2e03bb){var _0x43a606={};_0x43a606[_0x2e03bb]={'$like':'%'+_0x1e75f2['query'][_0x546d('0x4c')]+'%'};return _0x43a606;})});}_0x2c60d7=_[_0x546d('0x68')]({},_0x2c60d7,_0x1e75f2['options']);return db[_0x546d('0x9c')]['count']({'where':_0x2c60d7[_0x546d('0x4d')]})[_0x546d('0x20')](function(_0x43dc89){_0x2cba57[_0x546d('0x2f')]=_0x43dc89;if(_0x1e75f2['query']['includeAll']){_0x2c60d7[_0x546d('0x53')]=[{'model':db[_0x546d('0x73')],'as':_0x546d('0xbb'),'required':![]},{'model':db['User'],'as':_0x546d('0xbc'),'attributes':[_0x546d('0x3a'),_0x546d('0xbd'),_0x546d('0xbe')],'required':![]},{'model':db[_0x546d('0xbf')],'as':_0x546d('0xc0'),'attributes':['id',_0x546d('0x3a'),_0x546d('0xc1')],'where':_0x1e75f2[_0x546d('0x42')][_0x546d('0xc2')]?{'id':_0x1e75f2[_0x546d('0x42')][_0x546d('0xc2')]}:undefined,'required':_0x1e75f2[_0x546d('0x42')][_0x546d('0xc2')]?!![]:![]}];}return db['SmsInteraction'][_0x546d('0x54')](_0x2c60d7);})['then'](function(_0x5aa4c6){_0x2cba57[_0x546d('0x55')]=_0x5aa4c6;return _0x2cba57;});}})[_0x546d('0x20')](respondWithFilteredResult(_0x2536e3,_0x2c60d7))['catch'](handleError(_0x2536e3,null));};exports[_0x546d('0xb1')]=function(_0x3c5e89,_0x458cb3,_0x18bb1a){var _0x49284c,_0x4a4110,_0x55bc6d;if(_[_0x546d('0x91')](_0x3c5e89[_0x546d('0x5b')][_0x546d('0x5b')])||_0x3c5e89[_0x546d('0x5b')][_0x546d('0x5b')]===''){throw new db[(_0x546d('0x74'))][(_0x546d('0x92'))](_0x546d('0x94'));}if(_[_0x546d('0x91')](_0x3c5e89[_0x546d('0x5b')]['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0x49284c=_0x3c5e89[_0x546d('0x5b')]['to'];return db[_0x546d('0x51')]['find']({'where':{'id':_0x3c5e89['params']['id']},'include':[{'model':db['CmList'],'as':_0x546d('0xc3'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x49284c},'limit':0x1,'order':[['updatedAt',_0x546d('0xc4')]]}]}]})['then'](handleEntityNotFound(_0x458cb3,null))[_0x546d('0x20')](function(_0x4cc538){if(_0x4cc538&&_0x4cc538[_0x546d('0xc3')]){_0x4a4110=_0x4cc538[_0x546d('0x36')]({'plain':!![]});if(_0x4a4110[_0x546d('0xc3')]&&_0x4a4110[_0x546d('0xc3')][_0x546d('0x99')][_0x546d('0x47')]){return _0x4a4110[_0x546d('0xc3')][_0x546d('0x99')][0x0];}return db['CmContact']['create'](_['defaults'](_0x3c5e89[_0x546d('0x5b')],{'firstName':_0x49284c,'mobile':_0x49284c,'phone':_0x49284c,'ListId':_0x4a4110['ListId']}));}})[_0x546d('0x20')](handleEntityNotFound(_0x458cb3,null))[_0x546d('0x20')](function(_0x3cd3e3){if(_0x3cd3e3){_0x55bc6d=_0x3cd3e3;return db[_0x546d('0x9c')][_0x546d('0x59')]({'where':{'ContactId':_0x55bc6d['id'],'closed':![],'SmsAccountId':_0x4a4110['id']}})[_0x546d('0x20')](function(_0x140fec){if(_0x140fec){return[_0x140fec,![]];}return db[_0x546d('0x9c')][_0x546d('0x5a')]({'UserId':_0x3c5e89[_0x546d('0x5c')]['id'],'ContactId':_0x55bc6d['id'],'SmsAccountId':_0x4a4110['id'],'phone':_0x49284c,'firstMsgDirection':_0x546d('0xc5'),'Messages':[_[_0x546d('0x68')](_0x3c5e89[_0x546d('0x5b')],{'read':![],'body':_0x3c5e89['body'][_0x546d('0x5b')],'phone':_0x49284c,'SmsAccountId':_0x4a4110['id'],'UserId':_0x3c5e89[_0x546d('0x5c')]['id'],'ContactId':_0x55bc6d['id']})]},{'include':[{'model':db[_0x546d('0xa3')],'as':_0x546d('0xc6')}]})[_0x546d('0x20')](function(_0x136371){return[_0x136371,!![]];});});}})[_0x546d('0xc7')](function(_0x2ddfc3,_0x103c93){if(_0x103c93){return _0x2ddfc3;}return db[_0x546d('0xa3')]['create'](_['merge'](_0x3c5e89[_0x546d('0x5b')],{'read':![],'body':_0x3c5e89[_0x546d('0x5b')][_0x546d('0x5b')],'phone':_0x49284c,'SmsAccountId':_0x4a4110['id'],'SmsInteractionId':_0x2ddfc3['id'],'UserId':_0x3c5e89[_0x546d('0x5c')]['id'],'ContactId':_0x55bc6d['id']}))[_0x546d('0x20')](function(_0x447923){_0x2ddfc3['dataValues'][_0x546d('0xc6')]=[];_0x2ddfc3[_0x546d('0xc8')][_0x546d('0xc6')][_0x546d('0xc9')](_0x447923['dataValues']);return _0x2ddfc3;});})['then'](respondWithResult(_0x458cb3,null))[_0x546d('0x28')](handleError(_0x458cb3,null));};exports[_0x546d('0x2b')]=function(_0x438a73,_0x19a1f9,_0x55b9b3){if(_0x438a73[_0x546d('0x5b')]['id']){delete _0x438a73['body']['id'];}var _0xe04e04,_0x177546,_0x2cf78;return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x438a73[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x19a1f9,null))[_0x546d('0x20')](function(_0x25cd15){if(_0x25cd15){_0x2cf78=_0x25cd15;logger[_0x546d('0xac')](_0x546d('0xca'),'status',_0x546d('0xcb'),_0x25cd15[_0x546d('0x4e')],util[_0x546d('0xcc')](_0x438a73['body'],{'showHidden':![],'depth':null}));switch(_0x25cd15[_0x546d('0x4e')]){case _0x546d('0x81'):if(_0x438a73[_0x546d('0x5b')][_0x546d('0xcd')]&&_0x438a73['body'][_0x546d('0x2b')]){_0x177546=_0x438a73[_0x546d('0x5b')][_0x546d('0x2b')];return db[_0x546d('0xa3')][_0x546d('0x59')]({'where':{'messageId':_0x438a73[_0x546d('0x5b')]['skebby_dispatch_id']}});}break;case _0x546d('0x83'):if(_0x438a73[_0x546d('0x5b')]['requestid']&&_0x438a73['body'][_0x546d('0xce')]){_0x177546=_0x438a73[_0x546d('0x5b')][_0x546d('0xce')];return db[_0x546d('0xa3')][_0x546d('0x59')]({'where':{'messageId':_0x438a73['body'][_0x546d('0xcf')]}});}break;case'clicksend':if(_0x438a73[_0x546d('0x5b')]['message_id']&&_0x438a73['body']['status_code']){_0x177546=_0x438a73[_0x546d('0x5b')][_0x546d('0xd0')];return db[_0x546d('0xa3')][_0x546d('0x59')]({'where':{'messageId':_0x438a73[_0x546d('0x5b')][_0x546d('0xd1')]}});}break;case _0x546d('0x88'):var _0x165293=_0x438a73['body']['results'][0x0];if(_0x165293[_0x546d('0x7f')]&&_0x165293[_0x546d('0x2b')][_0x546d('0xd2')]===_0x546d('0xd3')){_0x177546=_0x165293[_0x546d('0x2b')]['groupName'];return db[_0x546d('0xa3')][_0x546d('0x59')]({'where':{'messageId':_0x165293[_0x546d('0x7f')]}});}break;case _0x546d('0xd4'):if(_0x438a73['body']['messageId']&&_0x438a73[_0x546d('0x5b')]['status']){_0x177546=_0x438a73[_0x546d('0x5b')][_0x546d('0x2b')];return db['SmsMessage'][_0x546d('0x59')]({'where':{'messageId':_0x438a73['body'][_0x546d('0x7f')]}});}break;case _0x546d('0x8e'):if(_0x438a73[_0x546d('0x5b')][0x0][_0x546d('0x26')]['id']){_0x177546=_0x438a73['body'][0x0][_0x546d('0x4e')];return db[_0x546d('0xa3')]['find']({'where':{'messageId':_0x438a73[_0x546d('0x5b')][0x0][_0x546d('0x26')]['id']}});}break;case _0x546d('0x8f'):if(_0x438a73[_0x546d('0x5b')][_0x546d('0xd5')]&&_0x438a73[_0x546d('0x5b')][_0x546d('0x2b')]){_0x177546=_0x438a73[_0x546d('0x5b')]['status'];return db[_0x546d('0xa3')][_0x546d('0x59')]({'where':{'messageId':_0x438a73[_0x546d('0x5b')][_0x546d('0xd5')]}});}break;}}})[_0x546d('0x20')](handleEntityNotFound(_0x19a1f9,null))[_0x546d('0x20')](function(_0x23a750){if(_0x23a750){_0xe04e04=_0x23a750;switch(_0x2cf78[_0x546d('0x4e')]){case'skebby':if(_0x177546===_0x546d('0xd3')){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger[_0x546d('0x25')](_0x546d('0xca'),_0x546d('0x2b'),_0x546d('0x81'),util['inspect'](_0x438a73['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x177546==='1'){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger[_0x546d('0x25')](_0x546d('0xca'),'status','skebby',util[_0x546d('0xcc')](_0x438a73['body'],{'showHidden':![],'depth':null}));}break;case _0x546d('0x84'):if(!_0x438a73[_0x546d('0x5b')][_0x546d('0xd6')]&&_0x177546>=0xc8&&_0x177546<=0xce){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger[_0x546d('0x25')](_0x546d('0xca'),_0x546d('0x2b'),_0x546d('0x84'),util['inspect'](_0x438a73[_0x546d('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x546d('0x88'):var _0x58d729=_0x438a73[_0x546d('0x5b')]['results'][0x0];if(_0x58d729[_0x546d('0x2b')][_0x546d('0xd2')]===_0x546d('0xd3')){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger[_0x546d('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x546d('0x2b'),_0x546d('0x88'),util[_0x546d('0xcc')](_0x438a73[_0x546d('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x546d('0xd4'):if(_0x177546==_0x546d('0xd7')||_0x177546==_0x546d('0xd8')){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger['error'](_0x546d('0xca'),_0x546d('0x2b'),_0x546d('0xd4'),util[_0x546d('0xcc')](_0x438a73[_0x546d('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x546d('0x8e'):if(_0x177546==_0x546d('0xd9')){return _0xe04e04['update']({'read':!![]});}else{logger[_0x546d('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x546d('0x2b'),_0x546d('0x8e'),util[_0x546d('0xcc')](_0x438a73[_0x546d('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x546d('0x8f'):if(_0x177546===_0x546d('0xda')||_0x177546===_0x546d('0xdb')){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger[_0x546d('0x25')](_0x546d('0xca'),'status',_0x546d('0x8f'),util[_0x546d('0xcc')](_0x438a73[_0x546d('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0xe04e04;}})[_0x546d('0x20')](respondWithResult(_0x19a1f9,null))[_0x546d('0x28')](handleError(_0x19a1f9,null));};exports[_0x546d('0xdc')]=function(_0xa31d43,_0x135252,_0x27a7a6){var _0x481002,_0xa6a570,_0x175f9a;return db['SmsAccount']['find']({'where':{'id':_0xa31d43[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x135252,null))[_0x546d('0x20')](function(_0x19a5a9){if(_0x19a5a9){_0x175f9a=_0x19a5a9;logger[_0x546d('0xac')](_0x546d('0xca'),_0x546d('0x2b'),_0x546d('0xcb'),_0x19a5a9['type'],util[_0x546d('0xcc')](_0xa31d43[_0x546d('0x42')],{'showHidden':![],'depth':null}));switch(_0x19a5a9['type']){case _0x546d('0x8a'):if(_0xa31d43['query'][_0x546d('0xdd')]&&_0xa31d43[_0x546d('0x42')][_0x546d('0xde')]){_0xa6a570=_0xa31d43[_0x546d('0x42')][_0x546d('0xde')];return db['SmsMessage'][_0x546d('0x59')]({'where':{'messageId':_0xa31d43['query']['message-id']}});}break;}}})[_0x546d('0x20')](handleEntityNotFound(_0x135252,null))['then'](function(_0x438438){if(_0x438438){_0x481002=_0x438438;switch(_0x175f9a[_0x546d('0x4e')]){case'csc':if(_0xa6a570==='2'||_0xa6a570==='6'){return _0x481002['update']({'read':!![]});}else{logger[_0x546d('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x546d('0x2b'),_0x546d('0x8a'),util[_0x546d('0xcc')](_0xa31d43[_0x546d('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x481002;}})[_0x546d('0x20')](respondWithResult(_0x135252,null))[_0x546d('0x28')](handleError(_0x135252,null));};exports['addAgents']=function(_0x558d1f,_0x3514b9,_0x4a5940){return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x558d1f[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x3514b9,null))[_0x546d('0x20')](function(_0x39bfed){if(_0x39bfed){return _0x39bfed['addAgents'](_0x558d1f[_0x546d('0x5b')][_0x546d('0x6d')],_['omit'](_0x558d1f[_0x546d('0x5b')],['ids','id'])||{})[_0x546d('0xc7')](function(_0x520b55){for(var _0xd1cb95=0x0;_0xd1cb95<_0x558d1f[_0x546d('0x5b')]['ids'][_0x546d('0x47')];_0xd1cb95+=0x1){socket[_0x546d('0xdf')](_0x546d('0xe0'),{'UserId':Number(_0x558d1f[_0x546d('0x5b')][_0x546d('0x6d')][_0xd1cb95]),'SmsAccountId':Number(_0x558d1f[_0x546d('0x57')]['id'])});}return _0x520b55;});}})[_0x546d('0x20')](respondWithResult(_0x3514b9,null))[_0x546d('0x28')](handleError(_0x3514b9,null));};exports['removeAgents']=function(_0x31314c,_0x596306,_0x33837b){return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x31314c[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x596306,null))[_0x546d('0x20')](function(_0xd20932){if(_0xd20932){return _0xd20932[_0x546d('0xe1')](_0x31314c['query'][_0x546d('0x6d')])[_0x546d('0x20')](function(){if(_[_0x546d('0xe2')](_0x31314c['query'][_0x546d('0x6d')])){for(var _0x16249c=0x0;_0x16249c<_0x31314c['query']['ids'][_0x546d('0x47')];_0x16249c+=0x1){socket[_0x546d('0xdf')](_0x546d('0xe3'),{'UserId':Number(_0x31314c[_0x546d('0x42')][_0x546d('0x6d')][_0x16249c]),'SmsAccountId':Number(_0x31314c[_0x546d('0x57')]['id'])});}}else{socket[_0x546d('0xdf')](_0x546d('0xe3'),{'UserId':Number(_0x31314c[_0x546d('0x42')][_0x546d('0x6d')]),'SmsAccountId':Number(_0x31314c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x596306,null))['catch'](handleError(_0x596306,null));};exports[_0x546d('0xe4')]=function(_0xe2831,_0x3581fa,_0x4b63e3){var _0xb77f47={};var _0x3f83ae={};var _0x51f728;var _0x1b8849;return db[_0x546d('0x51')][_0x546d('0x66')]({'where':{'id':_0xe2831['params']['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x3581fa,null))[_0x546d('0x20')](function(_0x3eec0a){if(_0x3eec0a){_0x51f728=_0x3eec0a;_0x3f83ae[_0x546d('0x41')]=_[_0x546d('0x43')](db[_0x546d('0xe5')][_0x546d('0x3f')]);_0x3f83ae[_0x546d('0x42')]=_[_0x546d('0x43')](_0xe2831[_0x546d('0x42')]);_0x3f83ae[_0x546d('0x44')]=_[_0x546d('0x58')](_0x3f83ae[_0x546d('0x41')],_0x3f83ae[_0x546d('0x42')]);_0xb77f47[_0x546d('0x45')]=_['intersection'](_0x3f83ae[_0x546d('0x41')],qs['fields'](_0xe2831['query'][_0x546d('0x46')]));_0xb77f47[_0x546d('0x45')]=_0xb77f47[_0x546d('0x45')][_0x546d('0x47')]?_0xb77f47[_0x546d('0x45')]:_0x3f83ae[_0x546d('0x41')];_0xb77f47['order']=qs[_0x546d('0x4a')](_0xe2831[_0x546d('0x42')][_0x546d('0x4a')]);_0xb77f47[_0x546d('0x4d')]=qs[_0x546d('0x44')](_[_0x546d('0x4b')](_0xe2831[_0x546d('0x42')],_0x3f83ae[_0x546d('0x44')]));if(_0xe2831[_0x546d('0x42')][_0x546d('0x4c')]){_0xb77f47[_0x546d('0x4d')]=_['merge'](_0xb77f47[_0x546d('0x4d')],{'$or':_[_0x546d('0x3e')](_0xb77f47[_0x546d('0x45')],function(_0x428a49){var _0xa891c3={};_0xa891c3[_0x428a49]={'$like':'%'+_0xe2831[_0x546d('0x42')]['filter']+'%'};return _0xa891c3;})});}_0xb77f47=_[_0x546d('0x68')]({},_0xb77f47,_0xe2831[_0x546d('0x50')]);return _0x51f728['getAgents'](_0xb77f47);}})['then'](function(_0x51fe09){if(_0x51fe09){_0x1b8849=_0x51fe09['length'];if(!_0xe2831['query'][_0x546d('0x48')](_0x546d('0x49'))){_0xb77f47[_0x546d('0x2e')]=qs['limit'](_0xe2831[_0x546d('0x42')][_0x546d('0x2e')]);_0xb77f47[_0x546d('0x30')]=qs[_0x546d('0x30')](_0xe2831[_0x546d('0x42')][_0x546d('0x30')]);}return _0x51f728[_0x546d('0xe4')](_0xb77f47);}})['then'](function(_0x3562ec){if(_0x3562ec){return _0x3562ec?{'count':_0x1b8849,'rows':_0x3562ec}:null;}})[_0x546d('0x20')](respondWithResult(_0x3581fa,null))['catch'](handleError(_0x3581fa,null));}; \ No newline at end of file +var _0x597b=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','then','destroy','get','SmsAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','SmsAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','MessageSid','skebby','sender','text','connectel','message_id','MessageUUID','infobip','messageId','results','csc','originatingAddress','segmentedMessage','fromNumber','intelepeer','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','push','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','tag','to\x20is\x20mandatory','List','out','user','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','requestid','statusInt','clicksend','status_code','DELIVERED','groupName','clickatell','bandwidth','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x449b4e,_0x1ab937){var _0x32e387=function(_0x2b211e){while(--_0x2b211e){_0x449b4e['push'](_0x449b4e['shift']());}};_0x32e387(++_0x1ab937);}(_0x597b,0x1b3));var _0xb597=function(_0x3472d2,_0x3a8160){_0x3472d2=_0x3472d2-0x0;var _0x5d901f=_0x597b[_0x3472d2];return _0x5d901f;};'use strict';var emlformat=require(_0xb597('0x0'));var rimraf=require(_0xb597('0x1'));var zipdir=require(_0xb597('0x2'));var jsonpatch=require(_0xb597('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb597('0x4'));var Mustache=require('mustache');var util=require(_0xb597('0x5'));var path=require(_0xb597('0x6'));var sox=require(_0xb597('0x7'));var csv=require(_0xb597('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb597('0x9'));var _=require(_0xb597('0xa'));var squel=require(_0xb597('0xb'));var crypto=require(_0xb597('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb597('0x8'));var querystring=require(_0xb597('0xd'));var Papa=require('papaparse');var Redis=require(_0xb597('0xe'));var authService=require(_0xb597('0xf'));var qs=require(_0xb597('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb597('0x11'));var logger=require(_0xb597('0x12'))(_0xb597('0x13'));var utils=require(_0xb597('0x14'));var config=require(_0xb597('0x15'));var licenseUtil=require(_0xb597('0x16'));var db=require(_0xb597('0x17'))['db'];config[_0xb597('0x18')]=_[_0xb597('0x19')](config['redis'],{'host':_0xb597('0x1a'),'port':0x18eb});var socket=require(_0xb597('0x1b'))(new Redis(config['redis']));require(_0xb597('0x1c'))[_0xb597('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb597('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x21b2a2,_0x4d7352,_0x3eb8ac,_0x5d7ce3){return new BPromise(function(_0x4e3713,_0x280067){var _0x23eb88=_0x5d7ce3||client;return _0x23eb88[_0xb597('0x1f')](_0x21b2a2,_0x3eb8ac)['then'](function(_0x3c7f11){logger[_0xb597('0x20')](_0xb597('0x21'),_0x4d7352,_0xb597('0x22'));logger[_0xb597('0x23')](_0xb597('0x24'),_0x4d7352,_0xb597('0x22'),JSON['stringify'](_0x3c7f11));if(_0x3c7f11[_0xb597('0x25')]){if(_0x3c7f11[_0xb597('0x25')][_0xb597('0x26')]===0x1f4){logger['error'](_0xb597('0x21'),_0x4d7352,_0x3c7f11[_0xb597('0x25')][_0xb597('0x27')]);return _0x280067(_0x3c7f11[_0xb597('0x25')][_0xb597('0x27')]);}logger[_0xb597('0x25')]('SmsAccount,\x20%s,\x20%s',_0x4d7352,_0x3c7f11[_0xb597('0x25')][_0xb597('0x27')]);return _0x4e3713(_0x3c7f11[_0xb597('0x25')][_0xb597('0x27')]);}else{logger[_0xb597('0x20')](_0xb597('0x21'),_0x4d7352,_0xb597('0x22'));_0x4e3713(_0x3c7f11[_0xb597('0x28')]['message']);}})['catch'](function(_0x51b35){logger[_0xb597('0x25')]('SmsAccount,\x20%s,\x20%s',_0x4d7352,_0x51b35);_0x280067(_0x51b35);});});}function respondWithStatusCode(_0xec5882,_0x44fed1){_0x44fed1=_0x44fed1||0xcc;return function(_0x5ea296){if(_0x5ea296){return _0xec5882[_0xb597('0x29')](_0x44fed1);}return _0xec5882[_0xb597('0x2a')](_0x44fed1)[_0xb597('0x2b')]();};}function respondWithResult(_0xa3f95a,_0x45e3b4){_0x45e3b4=_0x45e3b4||0xc8;return function(_0x3389d7){if(_0x3389d7){return _0xa3f95a['status'](_0x45e3b4)[_0xb597('0x2c')](_0x3389d7);}};}function respondWithFilteredResult(_0x23b5ca,_0x329274){return function(_0x1fc87a){if(_0x1fc87a){var _0x432a76=typeof _0x329274[_0xb597('0x2d')]===_0xb597('0x2e')&&typeof _0x329274[_0xb597('0x2f')]===_0xb597('0x2e');var _0x5a722e=_0x1fc87a['count'];var _0x54c876=_0x432a76?0x0:_0x329274[_0xb597('0x2d')];var _0xa7ea22=_0x432a76?_0x1fc87a['count']:_0x329274[_0xb597('0x2d')]+_0x329274[_0xb597('0x2f')];var _0x253a05;if(_0xa7ea22>=_0x5a722e){_0xa7ea22=_0x5a722e;_0x253a05=0xc8;}else{_0x253a05=0xce;}_0x23b5ca[_0xb597('0x2a')](_0x253a05);return _0x23b5ca[_0xb597('0x30')]('Content-Range',_0x54c876+'-'+_0xa7ea22+'/'+_0x5a722e)[_0xb597('0x2c')](_0x1fc87a);}return null;};}function patchUpdates(_0x596681){return function(_0x21f71a){try{jsonpatch[_0xb597('0x31')](_0x21f71a,_0x596681,!![]);}catch(_0x16c131){return BPromise[_0xb597('0x32')](_0x16c131);}return _0x21f71a['save']();};}function saveUpdates(_0xbbd60f,_0x2f2467){return function(_0x29dd6){if(_0x29dd6){return _0x29dd6[_0xb597('0x33')](_0xbbd60f)[_0xb597('0x34')](function(_0x15fd2f){return _0x15fd2f;});}return null;};}function removeEntity(_0x12c704,_0x20a170){return function(_0x5e76a8){if(_0x5e76a8){return _0x5e76a8[_0xb597('0x35')]()['then'](function(){var _0x33584f=_0x5e76a8[_0xb597('0x36')]({'plain':!![]});var _0x5c33f2=_0xb597('0x37');return db[_0xb597('0x38')][_0xb597('0x35')]({'where':{'type':_0x5c33f2,'resourceId':_0x33584f['id']}})[_0xb597('0x34')](function(){return _0x5e76a8;});})['then'](function(){_0x12c704[_0xb597('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e428a,_0x1eae53){return function(_0x3b817a){if(!_0x3b817a){_0x3e428a[_0xb597('0x29')](0x194);}return _0x3b817a;};}function handleError(_0x3b6338,_0x4bb6e1){_0x4bb6e1=_0x4bb6e1||0x1f4;return function(_0x485b68){logger[_0xb597('0x25')](_0x485b68['stack']);if(_0x485b68[_0xb597('0x39')]){delete _0x485b68[_0xb597('0x39')];}_0x3b6338['status'](_0x4bb6e1)[_0xb597('0x3a')](_0x485b68);};}exports[_0xb597('0x3b')]=function(_0x24f9ef,_0x7117e4){var _0x2e8491={'include':[{'model':db['Pause'],'as':_0xb597('0x3c')}]},_0x19c594={},_0x368f8b={'count':0x0,'rows':[]};var _0xbb44af=_[_0xb597('0x3d')](db[_0xb597('0x3e')][_0xb597('0x3f')],function(_0xe59a23){return{'name':_0xe59a23[_0xb597('0x40')],'type':_0xe59a23[_0xb597('0x41')][_0xb597('0x42')]};});_0x19c594['model']=_['map'](_0xbb44af,_0xb597('0x39'));_0x19c594[_0xb597('0x43')]=_[_0xb597('0x44')](_0x24f9ef[_0xb597('0x43')]);_0x19c594[_0xb597('0x45')]=_[_0xb597('0x46')](_0x19c594['model'],_0x19c594['query']);_0x2e8491[_0xb597('0x47')]=_[_0xb597('0x46')](_0x19c594[_0xb597('0x48')],qs[_0xb597('0x49')](_0x24f9ef[_0xb597('0x43')][_0xb597('0x49')]));_0x2e8491[_0xb597('0x47')]=_0x2e8491['attributes'][_0xb597('0x4a')]?_0x2e8491[_0xb597('0x47')]:_0x19c594[_0xb597('0x48')];if(!_0x24f9ef['query'][_0xb597('0x4b')](_0xb597('0x4c'))){_0x2e8491[_0xb597('0x2f')]=qs[_0xb597('0x2f')](_0x24f9ef[_0xb597('0x43')][_0xb597('0x2f')]);_0x2e8491[_0xb597('0x2d')]=qs['offset'](_0x24f9ef[_0xb597('0x43')][_0xb597('0x2d')]);}_0x2e8491[_0xb597('0x4d')]=qs[_0xb597('0x4e')](_0x24f9ef[_0xb597('0x43')][_0xb597('0x4e')]);_0x2e8491['where']=qs[_0xb597('0x45')](_[_0xb597('0x4f')](_0x24f9ef[_0xb597('0x43')],_0x19c594[_0xb597('0x45')]),_0xbb44af);if(_0x24f9ef[_0xb597('0x43')][_0xb597('0x50')]){_0x2e8491[_0xb597('0x51')]=_[_0xb597('0x52')](_0x2e8491[_0xb597('0x51')],{'$or':_['map'](_0xbb44af,function(_0x94d5af){if(_0x94d5af['type']!==_0xb597('0x53')){var _0x5a10db={};_0x5a10db[_0x94d5af['name']]={'$like':'%'+_0x24f9ef[_0xb597('0x43')][_0xb597('0x50')]+'%'};return _0x5a10db;}})});}_0x2e8491=_[_0xb597('0x52')]({},_0x2e8491,_0x24f9ef[_0xb597('0x54')]);var _0x23bd63={'where':_0x2e8491[_0xb597('0x51')]};return db[_0xb597('0x3e')]['count'](_0x23bd63)['then'](function(_0x1bc170){_0x368f8b[_0xb597('0x55')]=_0x1bc170;if(_0x24f9ef[_0xb597('0x43')][_0xb597('0x56')]){_0x2e8491[_0xb597('0x57')]=[{'all':!![]}];}return db['SmsAccount'][_0xb597('0x58')](_0x2e8491);})[_0xb597('0x34')](function(_0x417a75){_0x368f8b[_0xb597('0x59')]=_0x417a75;return _0x368f8b;})['then'](respondWithFilteredResult(_0x7117e4,_0x2e8491))[_0xb597('0x5a')](handleError(_0x7117e4,null));};exports[_0xb597('0x5b')]=function(_0x1b4710,_0x4d2368){var _0x16185d={'raw':![],'where':{'id':_0x1b4710[_0xb597('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5637b4={};_0x5637b4[_0xb597('0x48')]=_[_0xb597('0x44')](db[_0xb597('0x3e')][_0xb597('0x3f')]);_0x5637b4[_0xb597('0x43')]=_[_0xb597('0x44')](_0x1b4710['query']);_0x5637b4[_0xb597('0x45')]=_[_0xb597('0x46')](_0x5637b4[_0xb597('0x48')],_0x5637b4[_0xb597('0x43')]);_0x16185d['attributes']=_['intersection'](_0x5637b4[_0xb597('0x48')],qs[_0xb597('0x49')](_0x1b4710[_0xb597('0x43')]['fields']));_0x16185d[_0xb597('0x47')]=_0x16185d[_0xb597('0x47')]['length']?_0x16185d[_0xb597('0x47')]:_0x5637b4[_0xb597('0x48')];if(_0x1b4710[_0xb597('0x43')][_0xb597('0x56')]){_0x16185d[_0xb597('0x57')]=[{'all':!![]}];}_0x16185d=_[_0xb597('0x52')]({},_0x16185d,_0x1b4710[_0xb597('0x54')]);return db[_0xb597('0x3e')]['find'](_0x16185d)['then'](handleEntityNotFound(_0x4d2368,null))[_0xb597('0x34')](respondWithResult(_0x4d2368,null))[_0xb597('0x5a')](handleError(_0x4d2368,null));};exports[_0xb597('0x5d')]=function(_0x1153b3,_0xdd9af6){return db[_0xb597('0x3e')]['create'](_0x1153b3['body'],{})[_0xb597('0x34')](function(_0x53f97e){var _0x5c1720=_0x1153b3['user'][_0xb597('0x36')]({'plain':!![]});if(!_0x5c1720)throw new Error(_0xb597('0x5e'));if(_0x5c1720['role']==='user'){var _0x2f4f3f=_0x53f97e[_0xb597('0x36')]({'plain':!![]});var _0x1cbd40=_0xb597('0x37');return db[_0xb597('0x5f')][_0xb597('0x60')]({'where':{'name':_0x1cbd40,'userProfileId':_0x5c1720['userProfileId']},'raw':!![]})['then'](function(_0x3f71b7){if(_0x3f71b7&&_0x3f71b7[_0xb597('0x61')]===0x0){return db[_0xb597('0x38')]['create']({'name':_0x2f4f3f['name'],'resourceId':_0x2f4f3f['id'],'type':_0x3f71b7[_0xb597('0x39')],'sectionId':_0x3f71b7['id']},{})[_0xb597('0x34')](function(){return _0x53f97e;});}else{return _0x53f97e;}})[_0xb597('0x5a')](function(_0x4c9a17){logger[_0xb597('0x25')](_0xb597('0x62'),_0x4c9a17);throw _0x4c9a17;});}return _0x53f97e;})[_0xb597('0x34')](respondWithResult(_0xdd9af6,0xc9))[_0xb597('0x5a')](handleError(_0xdd9af6,null));};exports[_0xb597('0x33')]=function(_0xdbabaf,_0x326d99){if(_0xdbabaf[_0xb597('0x63')]['id']){delete _0xdbabaf['body']['id'];}return db['SmsAccount'][_0xb597('0x60')]({'where':{'id':_0xdbabaf[_0xb597('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xb597('0x34')](handleEntityNotFound(_0x326d99,null))[_0xb597('0x34')](saveUpdates(_0xdbabaf[_0xb597('0x63')],null))[_0xb597('0x34')](respondWithResult(_0x326d99,null))[_0xb597('0x5a')](handleError(_0x326d99,null));};exports[_0xb597('0x35')]=function(_0x585ae9,_0x46f355){return db['SmsAccount'][_0xb597('0x60')]({'where':{'id':_0x585ae9['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x46f355,null))[_0xb597('0x34')](removeEntity(_0x46f355,null))[_0xb597('0x5a')](handleError(_0x46f355,null));};exports[_0xb597('0x64')]=function(_0x223526,_0x9db858){return db['SmsAccount']['describe']()['then'](respondWithResult(_0x9db858,null))[_0xb597('0x5a')](handleError(_0x9db858,null));};exports['addDisposition']=function(_0x52680b,_0x3bccc0,_0x372d26){if(_0x52680b[_0xb597('0x63')]['id']){delete _0x52680b[_0xb597('0x63')]['id'];}return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x52680b['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x3bccc0,null))[_0xb597('0x34')](function(_0x5acf39){if(_0x5acf39){_0x52680b['body'][_0xb597('0x65')]=_0x5acf39['id'];return db[_0xb597('0x66')][_0xb597('0x5d')](_0x52680b[_0xb597('0x63')]);}})['then'](respondWithResult(_0x3bccc0,null))[_0xb597('0x5a')](handleError(_0x3bccc0,null));};exports['getDispositions']=function(_0x37e63d,_0x18a6ae,_0x83fbf5){var _0x52ecf3={'raw':![],'where':{}};var _0x452946={};var _0x6eb7ca={'count':0x0,'rows':[]};return db[_0xb597('0x3e')][_0xb597('0x67')]({'where':{'id':_0x37e63d[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x18a6ae,null))['then'](function(_0x584d7d){if(_0x584d7d){_0x452946[_0xb597('0x48')]=_[_0xb597('0x44')](db[_0xb597('0x66')][_0xb597('0x3f')]);_0x452946[_0xb597('0x43')]=_[_0xb597('0x44')](_0x37e63d[_0xb597('0x43')]);_0x452946[_0xb597('0x45')]=_['intersection'](_0x452946[_0xb597('0x48')],_0x452946[_0xb597('0x43')]);_0x52ecf3['attributes']=_[_0xb597('0x46')](_0x452946[_0xb597('0x48')],qs['fields'](_0x37e63d['query'][_0xb597('0x49')]));_0x52ecf3['attributes']=_0x52ecf3[_0xb597('0x47')]['length']?_0x52ecf3[_0xb597('0x47')]:_0x452946['model'];if(!_0x37e63d[_0xb597('0x43')][_0xb597('0x4b')](_0xb597('0x4c'))){_0x52ecf3[_0xb597('0x2f')]=qs[_0xb597('0x2f')](_0x37e63d[_0xb597('0x43')][_0xb597('0x2f')]);_0x52ecf3[_0xb597('0x2d')]=qs[_0xb597('0x2d')](_0x37e63d['query'][_0xb597('0x2d')]);}_0x52ecf3[_0xb597('0x4d')]=qs[_0xb597('0x4e')](_0x37e63d[_0xb597('0x43')][_0xb597('0x4e')]);_0x52ecf3[_0xb597('0x51')]=qs['filters'](_[_0xb597('0x4f')](_0x37e63d[_0xb597('0x43')],_0x452946[_0xb597('0x45')]));_0x52ecf3[_0xb597('0x51')][_0xb597('0x65')]=_0x584d7d['id'];if(_0x37e63d[_0xb597('0x43')][_0xb597('0x50')]){_0x52ecf3[_0xb597('0x51')]=_['merge'](_0x52ecf3[_0xb597('0x51')],{'$or':_['map'](_0x52ecf3['attributes'],function(_0xfb7d4c){var _0x33bec4={};_0x33bec4[_0xfb7d4c]={'$like':'%'+_0x37e63d[_0xb597('0x43')]['filter']+'%'};return _0x33bec4;})});}_0x52ecf3=_[_0xb597('0x52')]({},_0x52ecf3,_0x37e63d[_0xb597('0x54')]);return db['Disposition']['count']({'where':_0x52ecf3[_0xb597('0x51')]})[_0xb597('0x34')](function(_0x1ec7fe){_0x6eb7ca[_0xb597('0x55')]=_0x1ec7fe;if(_0x37e63d[_0xb597('0x43')][_0xb597('0x56')]){_0x52ecf3['include']=[{'all':!![]}];}return db[_0xb597('0x66')][_0xb597('0x58')](_0x52ecf3);})['then'](function(_0x3aaafc){_0x6eb7ca[_0xb597('0x59')]=_0x3aaafc;return _0x6eb7ca;});}})[_0xb597('0x34')](respondWithFilteredResult(_0x18a6ae,_0x52ecf3))[_0xb597('0x5a')](handleError(_0x18a6ae,null));};exports[_0xb597('0x68')]=function(_0xb7ef12,_0x368aca,_0x42874c){return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0xb7ef12[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x368aca,null))[_0xb597('0x34')](function(_0x40f36f){if(_0x40f36f){return _0x40f36f[_0xb597('0x68')](_0xb7ef12['query'][_0xb597('0x69')]);}})[_0xb597('0x34')](respondWithStatusCode(_0x368aca,null))[_0xb597('0x5a')](handleError(_0x368aca,null));};exports[_0xb597('0x6a')]=function(_0x2d40f2,_0x2dbbe8,_0x2b4e56){if(_0x2d40f2[_0xb597('0x63')]['id']){delete _0x2d40f2[_0xb597('0x63')]['id'];}return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x2d40f2[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x2dbbe8,null))['then'](function(_0x17a4b3){if(_0x17a4b3){_0x2d40f2[_0xb597('0x63')][_0xb597('0x65')]=_0x17a4b3['id'];return db['CannedAnswer'][_0xb597('0x5d')](_0x2d40f2[_0xb597('0x63')]);}})['then'](respondWithResult(_0x2dbbe8,null))[_0xb597('0x5a')](handleError(_0x2dbbe8,null));};exports[_0xb597('0x6b')]=function(_0x2ee91a,_0x2fdbe5,_0x3e8736){var _0x4d4b25={'raw':![],'where':{}};var _0x306f25={};var _0x1fff10={'count':0x0,'rows':[]};return db['SmsAccount'][_0xb597('0x67')]({'where':{'id':_0x2ee91a['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x2fdbe5,null))[_0xb597('0x34')](function(_0x3331d3){if(_0x3331d3){_0x306f25[_0xb597('0x48')]=_['keys'](db[_0xb597('0x6c')][_0xb597('0x3f')]);_0x306f25[_0xb597('0x43')]=_[_0xb597('0x44')](_0x2ee91a[_0xb597('0x43')]);_0x306f25[_0xb597('0x45')]=_[_0xb597('0x46')](_0x306f25['model'],_0x306f25['query']);_0x4d4b25[_0xb597('0x47')]=_[_0xb597('0x46')](_0x306f25[_0xb597('0x48')],qs[_0xb597('0x49')](_0x2ee91a[_0xb597('0x43')][_0xb597('0x49')]));_0x4d4b25['attributes']=_0x4d4b25[_0xb597('0x47')][_0xb597('0x4a')]?_0x4d4b25[_0xb597('0x47')]:_0x306f25[_0xb597('0x48')];if(!_0x2ee91a[_0xb597('0x43')][_0xb597('0x4b')](_0xb597('0x4c'))){_0x4d4b25[_0xb597('0x2f')]=qs[_0xb597('0x2f')](_0x2ee91a[_0xb597('0x43')][_0xb597('0x2f')]);_0x4d4b25[_0xb597('0x2d')]=qs['offset'](_0x2ee91a[_0xb597('0x43')]['offset']);}_0x4d4b25[_0xb597('0x4d')]=qs['sort'](_0x2ee91a[_0xb597('0x43')]['sort']);_0x4d4b25[_0xb597('0x51')]=qs[_0xb597('0x45')](_[_0xb597('0x4f')](_0x2ee91a[_0xb597('0x43')],_0x306f25[_0xb597('0x45')]));_0x4d4b25[_0xb597('0x51')][_0xb597('0x65')]=_0x3331d3['id'];if(_0x2ee91a[_0xb597('0x43')]['filter']){_0x4d4b25[_0xb597('0x51')]=_[_0xb597('0x52')](_0x4d4b25[_0xb597('0x51')],{'$or':_[_0xb597('0x3d')](_0x4d4b25['attributes'],function(_0x30a30a){var _0x708ee1={};_0x708ee1[_0x30a30a]={'$like':'%'+_0x2ee91a[_0xb597('0x43')][_0xb597('0x50')]+'%'};return _0x708ee1;})});}_0x4d4b25=_[_0xb597('0x52')]({},_0x4d4b25,_0x2ee91a[_0xb597('0x54')]);return db[_0xb597('0x6c')][_0xb597('0x55')]({'where':_0x4d4b25[_0xb597('0x51')]})['then'](function(_0x4506c4){_0x1fff10[_0xb597('0x55')]=_0x4506c4;if(_0x2ee91a[_0xb597('0x43')][_0xb597('0x56')]){_0x4d4b25['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xb597('0x58')](_0x4d4b25);})[_0xb597('0x34')](function(_0x47cefa){_0x1fff10[_0xb597('0x59')]=_0x47cefa;return _0x1fff10;});}})[_0xb597('0x34')](respondWithFilteredResult(_0x2fdbe5,_0x4d4b25))[_0xb597('0x5a')](handleError(_0x2fdbe5,null));};exports[_0xb597('0x6d')]=function(_0x1599b1,_0xad8c52,_0x408d49){return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x1599b1[_0xb597('0x5c')]['id']}})['then'](handleEntityNotFound(_0xad8c52,null))[_0xb597('0x34')](function(_0x4b47e2){if(_0x4b47e2){return _0x4b47e2[_0xb597('0x6d')](_0x1599b1['query'][_0xb597('0x69')]);}})[_0xb597('0x34')](respondWithStatusCode(_0xad8c52,null))[_0xb597('0x5a')](handleError(_0xad8c52,null));};exports[_0xb597('0x6e')]=function(_0x2cf538,_0x37b93a,_0x4828f0){var _0x372549={'channel':'sms'};var _0x115e55=[];var _0x697c4e=[];var _0x4185a3={};return db[_0xb597('0x3e')]['find']({'where':{'id':_0x2cf538[_0xb597('0x5c')]['id']},'include':[{'model':db[_0xb597('0x6f')],'as':_0xb597('0x70')}]})[_0xb597('0x34')](handleEntityNotFound(_0x37b93a,null))[_0xb597('0x34')](function(_0x526cdc){_0x372549[_0xb597('0x71')]=_0x526cdc;_0x372549[_0xb597('0x72')]=_[_0xb597('0x73')](_0x526cdc[_0xb597('0x70')],['priority'],[_0xb597('0x74')]);if(_0x372549[_0xb597('0x71')][_0xb597('0x70')]){delete _0x372549[_0xb597('0x71')]['Applications'];}return db[_0xb597('0x75')][_0xb597('0x64')]();})[_0xb597('0x34')](function(_0x28d5fc){if(!_0x28d5fc){throw new db[(_0xb597('0x76'))][(_0xb597('0x77'))](_0xb597('0x78'));}_0x115e55=_[_0xb597('0x79')](_[_0xb597('0x44')](_0x28d5fc),[_0xb597('0x7a'),_0xb597('0x7b')]);_0x697c4e=_[_0xb597('0x79')](_['keys'](_0x28d5fc),['createdAt','updatedAt',_0xb597('0x7c'),_0xb597('0x7d')]);_0x372549[_0xb597('0x63')]={'mapKey':_0xb597('0x7e')};if(_0x372549['account'][_0xb597('0x41')]){switch(_0x372549[_0xb597('0x71')][_0xb597('0x41')]){case _0xb597('0x7f'):_0x372549['body'][_0xb597('0x80')]=_0x2cf538['body']['From'];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x81')];_0x372549[_0xb597('0x63')]['messageId']=_0x2cf538['body'][_0xb597('0x82')];break;case _0xb597('0x83'):_0x372549['body'][_0xb597('0x80')]='+'+_0x2cf538['body'][_0xb597('0x84')];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x85')];break;case _0xb597('0x86'):_0x372549[_0xb597('0x63')][_0xb597('0x80')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x80')];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')]['message'];break;case'clicksend':_0x372549['body'][_0xb597('0x80')]=_0x2cf538[_0xb597('0x63')]['from'];_0x372549[_0xb597('0x63')]['body']=_0x2cf538[_0xb597('0x63')][_0xb597('0x63')];_0x372549[_0xb597('0x63')]['messageId']=_0x2cf538[_0xb597('0x63')][_0xb597('0x87')];break;case'plivo':_0x372549[_0xb597('0x63')]['from']=_0x2cf538['body']['From'];_0x372549[_0xb597('0x63')]['body']=_0x2cf538['body']['Text'];_0x372549[_0xb597('0x63')]['messageId']=_0x2cf538[_0xb597('0x63')][_0xb597('0x88')];break;case _0xb597('0x89'):_0x372549[_0xb597('0x63')][_0xb597('0x80')]='+'+_0x2cf538[_0xb597('0x63')]['results'][0x0][_0xb597('0x80')];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538['body']['results'][0x0][_0xb597('0x85')];_0x372549[_0xb597('0x63')][_0xb597('0x8a')]=_0x2cf538['body'][_0xb597('0x8b')][0x0][_0xb597('0x8a')];break;case _0xb597('0x8c'):_0x372549[_0xb597('0x63')][_0xb597('0x80')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x8d')];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x8e')][_0xb597('0x27')];break;case'clickatell':_0x372549['body'][_0xb597('0x80')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x8f')];_0x372549['body'][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x85')];_0x372549['body'][_0xb597('0x8a')]=_0x2cf538[_0xb597('0x63')]['replyMessageId'];break;case'bandwidth':_0x372549[_0xb597('0x63')][_0xb597('0x8a')]=_0x2cf538['body'][0x0]['message']['id'];_0x372549[_0xb597('0x63')][_0xb597('0x80')]=_0x2cf538['body'][0x0][_0xb597('0x27')][_0xb597('0x80')];_0x372549[_0xb597('0x63')]['body']=_0x2cf538[_0xb597('0x63')][0x0][_0xb597('0x27')][_0xb597('0x85')];break;case _0xb597('0x90'):_0x372549['body']['from']=_0x2cf538[_0xb597('0x63')]['from'];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x27')];_0x372549[_0xb597('0x63')]['messageId']=_0x2cf538['body'][_0xb597('0x91')];break;}}if(_0x372549[_0xb597('0x63')]['id']){delete _0x372549['body']['id'];}if(_['isNil'](_0x372549['body'][_0xb597('0x80')])){throw new db[(_0xb597('0x76'))][(_0xb597('0x77'))](_0xb597('0x92'));}if(_[_0xb597('0x93')](_0x372549[_0xb597('0x63')][_0xb597('0x63')])||_0x372549['body'][_0xb597('0x63')]===''){throw new db[(_0xb597('0x76'))][(_0xb597('0x77'))](_0xb597('0x94'));}if(_[_0xb597('0x93')](_0x372549[_0xb597('0x63')][_0xb597('0x95')])){throw new db[(_0xb597('0x76'))][(_0xb597('0x77'))](_0xb597('0x96')+_0x697c4e);}if(!_[_0xb597('0x97')](_0x697c4e,_0x372549[_0xb597('0x63')]['mapKey'])){throw new db[(_0xb597('0x76'))]['ValidationError'](_0xb597('0x98')+_0x697c4e);}_0x4185a3[_0x372549['body'][_0xb597('0x95')]]=_0x372549['body'][_0xb597('0x80')];return db[_0xb597('0x99')][_0xb597('0x60')]({'where':{'id':_0x372549[_0xb597('0x71')][_0xb597('0x7d')]},'include':[{'model':db[_0xb597('0x75')],'as':_0xb597('0x9a'),'where':_0x4185a3,'limit':0x1,'order':[['updatedAt',_0xb597('0x9b')]]}]});})[_0xb597('0x34')](handleEntityNotFound(_0x37b93a,null))[_0xb597('0x34')](function(_0x4a6282){if(_0x4a6282){_0x372549[_0xb597('0x9c')]=_[_0xb597('0x9d')](_0x4a6282,['Contacts']);if(_0x4a6282[_0xb597('0x9a')][_0xb597('0x4a')]){return _0x4a6282['Contacts'][0x0];}var _0x12756f=_[_0xb597('0x19')](_0x372549[_0xb597('0x63')],{'firstName':_0x372549[_0xb597('0x63')]['from'],'ListId':_0x4a6282['id']});_0x12756f[_0x372549[_0xb597('0x63')][_0xb597('0x95')]]=_0x372549['body']['from'];return db['CmContact'][_0xb597('0x5d')](_0x12756f,{'fields':_0x115e55,'raw':!![]});}})[_0xb597('0x34')](handleEntityNotFound(_0x37b93a,null))[_0xb597('0x34')](function(_0x3cf025){if(_0x3cf025){_0x372549[_0xb597('0x9e')]=_0x3cf025;var _0xa3c98={'ContactId':_0x3cf025['id'],'phone':_0x372549['body'][_0xb597('0x80')],'SmsAccountId':_0x2cf538[_0xb597('0x5c')]['id']};var _0x3dfff8={'ContactId':_0x3cf025['id'],'SmsAccountId':_0x2cf538['params']['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x3dfff8})[_0xb597('0x34')](function(_0x3bdd6b){if(_0x3bdd6b){return[_0x3bdd6b,![]];}return db[_0xb597('0x9f')][_0xb597('0x5d')](_0xa3c98)[_0xb597('0x34')](function(_0x4c2092){return[_0x4c2092,!![]];});});}})[_0xb597('0xa0')](function(_0x371eba,_0x2a1d03){_0x372549[_0xb597('0xa1')]=_0x371eba[_0xb597('0x36')]({'plain':!![]});_0x372549['interaction'][_0xb597('0xa2')]=![];if(_0x2a1d03){if(_0x372549[_0xb597('0x71')]['autoclose']){_0x372549[_0xb597('0x72')][_0xb597('0xa3')]({'id':0x0,'priority':_0x372549[_0xb597('0x72')][_0xb597('0x4a')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x372549[_0xb597('0xa1')][_0xb597('0xa2')]=!![];}return db['SmsMessage'][_0xb597('0x5d')]({'phone':_0x372549[_0xb597('0x63')][_0xb597('0x80')],'messageId':_0x372549[_0xb597('0x63')][_0xb597('0x8a')],'body':_0x372549[_0xb597('0x63')]['body'],'SmsAccountId':_0x2cf538[_0xb597('0x5c')]['id'],'SmsInteractionId':_0x371eba['id'],'direction':'in','ContactId':_0x371eba[_0xb597('0xa4')],'AttachmentId':_0x372549[_0xb597('0x63')][_0xb597('0xa5')]});})[_0xb597('0x34')](function(_0x26d5e3){_0x372549['message']=_0x26d5e3;if(_0x372549[_0xb597('0xa1')][_0xb597('0xa6')]){return db[_0xb597('0xa7')][_0xb597('0x60')]({'attributes':['id',_0xb597('0x39')],'where':{'id':_0x372549[_0xb597('0xa1')][_0xb597('0xa6')]}})[_0xb597('0x34')](function(_0xc3a25b){if(_0xc3a25b){_0x372549[_0xb597('0x72')][_0xb597('0xa8')]({'id':0x0,'priority':0x0,'app':_0xb597('0xa9'),'appdata':_0xc3a25b[_0xb597('0x39')]+','+(_0x372549[_0xb597('0x71')][_0xb597('0xaa')]||0xa),'interval':_0xb597('0xab')});}return respondWithRpcPromise('Start',_0xb597('0xac'),_0x372549);});}return respondWithRpcPromise(_0xb597('0xad'),_0xb597('0xac'),_0x372549);})[_0xb597('0x34')](function(_0x3fc0dc){if(_0x3fc0dc){var _0x5221c4=0xc8;var _0x29f4ec=_0xb597('0xae');logger[_0xb597('0x20')](_0xb597('0x24'),_0x29f4ec,_0x5221c4,'entity\x20found');logger[_0xb597('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x29f4ec,_0x5221c4,_0xb597('0xaf'),JSON['stringify'](_0x3fc0dc));if(_0x372549[_0xb597('0x71')][_0xb597('0x41')]===_0xb597('0x7f')){return _0x37b93a[_0xb597('0x2a')](_0x5221c4)['set'](_0xb597('0xb0'),_0xb597('0xb1'))[_0xb597('0x3a')](_0xb597('0xb2'));}else{return _0x37b93a[_0xb597('0x2a')](_0x5221c4)[_0xb597('0x2c')](_0x3fc0dc);}}})['catch'](handleError(_0x37b93a,null));};exports[_0xb597('0xb3')]=function(_0xc38d57,_0x4d7fb5,_0x587f4b){return db['SmsAccount']['findOne']({'where':{'id':_0xc38d57['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x4d7fb5,null))['then'](function(_0x545dc2){if(_0x545dc2){return db[_0xb597('0xb4')][_0xb597('0xb5')](function(_0x114702){return db['SmsApplication'][_0xb597('0x35')]({'where':{'SmsAccountId':_0xc38d57[_0xb597('0x5c')]['id']},'transaction':_0x114702})[_0xb597('0x34')](function(_0x2f9d03){var _0x38afbc=_[_0xb597('0x3d')](_0xc38d57[_0xb597('0x63')],function(_0x4bcb39){_0x4bcb39['SmsAccountId']=_0xc38d57['params']['id'];return _0x4bcb39;});return db[_0xb597('0x6f')][_0xb597('0xb6')](_0x38afbc,{'transaction':_0x114702});});})[_0xb597('0x34')](function(){return db['SmsApplication'][_0xb597('0xb7')]({'where':{'SmsAccountId':_0xc38d57['params']['id']},'order':_0xb597('0xb8')});});}})[_0xb597('0x34')](respondWithResult(_0x4d7fb5,null))[_0xb597('0x5a')](handleError(_0x4d7fb5,null));};exports[_0xb597('0xb9')]=function(_0x1fcfa2,_0x1b0997,_0x16ad24){var _0x40c70c={};var _0x30397c={};var _0x47e5c8;var _0x4e3d20;return db['SmsAccount']['findOne']({'where':{'id':_0x1fcfa2[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x1b0997,null))[_0xb597('0x34')](function(_0x220d23){if(_0x220d23){_0x47e5c8=_0x220d23;_0x30397c['model']=_[_0xb597('0x44')](db[_0xb597('0x6f')][_0xb597('0x3f')]);_0x30397c[_0xb597('0x43')]=_[_0xb597('0x44')](_0x1fcfa2[_0xb597('0x43')]);_0x30397c[_0xb597('0x45')]=_[_0xb597('0x46')](_0x30397c[_0xb597('0x48')],_0x30397c[_0xb597('0x43')]);_0x40c70c[_0xb597('0x47')]=_[_0xb597('0x46')](_0x30397c[_0xb597('0x48')],qs[_0xb597('0x49')](_0x1fcfa2[_0xb597('0x43')][_0xb597('0x49')]));_0x40c70c[_0xb597('0x47')]=_0x40c70c[_0xb597('0x47')][_0xb597('0x4a')]?_0x40c70c[_0xb597('0x47')]:_0x30397c['model'];_0x40c70c['order']=qs[_0xb597('0x4e')](_0x1fcfa2['query'][_0xb597('0x4e')]);_0x40c70c[_0xb597('0x51')]=qs[_0xb597('0x45')](_[_0xb597('0x4f')](_0x1fcfa2[_0xb597('0x43')],_0x30397c['filters']));if(_0x1fcfa2[_0xb597('0x43')][_0xb597('0x50')]){_0x40c70c[_0xb597('0x51')]=_[_0xb597('0x52')](_0x40c70c[_0xb597('0x51')],{'$or':_[_0xb597('0x3d')](_0x40c70c[_0xb597('0x47')],function(_0x45fb9b){var _0x5efe2b={};_0x5efe2b[_0x45fb9b]={'$like':'%'+_0x1fcfa2[_0xb597('0x43')][_0xb597('0x50')]+'%'};return _0x5efe2b;})});}_0x40c70c=_[_0xb597('0x52')]({},_0x40c70c,_0x1fcfa2[_0xb597('0x54')]);return _0x47e5c8[_0xb597('0xb9')](_0x40c70c);}})[_0xb597('0x34')](function(_0x268cb3){if(_0x268cb3){_0x4e3d20=_0x268cb3[_0xb597('0x4a')];if(!_0x1fcfa2[_0xb597('0x43')][_0xb597('0x4b')](_0xb597('0x4c'))){_0x40c70c[_0xb597('0x2f')]=qs[_0xb597('0x2f')](_0x1fcfa2[_0xb597('0x43')][_0xb597('0x2f')]);_0x40c70c[_0xb597('0x2d')]=qs[_0xb597('0x2d')](_0x1fcfa2['query'][_0xb597('0x2d')]);}return _0x47e5c8[_0xb597('0xb9')](_0x40c70c);}})[_0xb597('0x34')](function(_0x1f6f72){if(_0x1f6f72){return _0x1f6f72?{'count':_0x4e3d20,'rows':_0x1f6f72}:null;}})[_0xb597('0x34')](respondWithResult(_0x1b0997,null))[_0xb597('0x5a')](handleError(_0x1b0997,null));};exports[_0xb597('0xba')]=function(_0x597171,_0x4b65d6,_0x271ace){var _0x112ea1={'raw':![],'where':{}};var _0x1a952b={};var _0x5aafe7={'count':0x0,'rows':[]};return db[_0xb597('0x3e')]['findOne']({'where':{'id':_0x597171[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x4b65d6,null))[_0xb597('0x34')](function(_0x5f32f9){if(_0x5f32f9){_0x1a952b[_0xb597('0x48')]=_[_0xb597('0x44')](db['SmsInteraction']['rawAttributes']);_0x1a952b[_0xb597('0x43')]=_['keys'](_0x597171[_0xb597('0x43')]);_0x1a952b['filters']=_[_0xb597('0x46')](_0x1a952b[_0xb597('0x48')],_0x1a952b[_0xb597('0x43')]);_0x112ea1[_0xb597('0x47')]=_[_0xb597('0x46')](_0x1a952b[_0xb597('0x48')],qs[_0xb597('0x49')](_0x597171[_0xb597('0x43')][_0xb597('0x49')]));_0x112ea1[_0xb597('0x47')]=_0x112ea1[_0xb597('0x47')]['length']?_0x112ea1[_0xb597('0x47')]:_0x1a952b[_0xb597('0x48')];if(!_0x597171[_0xb597('0x43')][_0xb597('0x4b')](_0xb597('0x4c'))){_0x112ea1[_0xb597('0x2f')]=qs[_0xb597('0x2f')](_0x597171[_0xb597('0x43')][_0xb597('0x2f')]);_0x112ea1[_0xb597('0x2d')]=qs[_0xb597('0x2d')](_0x597171['query']['offset']);}_0x112ea1[_0xb597('0x4d')]=qs[_0xb597('0x4e')](_0x597171['query'][_0xb597('0x4e')]);_0x112ea1[_0xb597('0x51')]=qs[_0xb597('0x45')](_[_0xb597('0x4f')](_0x597171[_0xb597('0x43')],_0x1a952b[_0xb597('0x45')]));_0x112ea1[_0xb597('0x51')][_0xb597('0x65')]=_0x5f32f9['id'];if(_0x597171[_0xb597('0x43')][_0xb597('0x50')]){_0x112ea1[_0xb597('0x51')]=_['merge'](_0x112ea1['where'],{'$or':_[_0xb597('0x3d')](_0x112ea1[_0xb597('0x47')],function(_0x231a10){var _0x32f5d5={};_0x32f5d5[_0x231a10]={'$like':'%'+_0x597171['query'][_0xb597('0x50')]+'%'};return _0x32f5d5;})});}_0x112ea1=_[_0xb597('0x52')]({},_0x112ea1,_0x597171[_0xb597('0x54')]);return db['SmsInteraction']['count']({'where':_0x112ea1[_0xb597('0x51')]})[_0xb597('0x34')](function(_0x326c6d){_0x5aafe7[_0xb597('0x55')]=_0x326c6d;if(_0x597171[_0xb597('0x43')][_0xb597('0x56')]){_0x112ea1[_0xb597('0x57')]=[{'model':db['CmContact'],'as':_0xb597('0xbb'),'required':![]},{'model':db[_0xb597('0xa7')],'as':_0xb597('0xbc'),'attributes':[_0xb597('0x39'),_0xb597('0xbd'),_0xb597('0xbe')],'required':![]},{'model':db['Tag'],'as':_0xb597('0xbf'),'attributes':['id','name','color'],'where':_0x597171[_0xb597('0x43')]['tag']?{'id':_0x597171[_0xb597('0x43')]['tag']}:undefined,'required':_0x597171[_0xb597('0x43')][_0xb597('0xc0')]?!![]:![]}];}return db['SmsInteraction'][_0xb597('0x58')](_0x112ea1);})[_0xb597('0x34')](function(_0x383397){_0x5aafe7[_0xb597('0x59')]=_0x383397;return _0x5aafe7;});}})['then'](respondWithFilteredResult(_0x4b65d6,_0x112ea1))['catch'](handleError(_0x4b65d6,null));};exports[_0xb597('0x3a')]=function(_0x27306f,_0x318031,_0x110874){var _0x43338f,_0x12838d,_0x2a8413;if(_[_0xb597('0x93')](_0x27306f[_0xb597('0x63')][_0xb597('0x63')])||_0x27306f[_0xb597('0x63')][_0xb597('0x63')]===''){throw new db[(_0xb597('0x76'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb597('0x93')](_0x27306f[_0xb597('0x63')]['to'])){throw new db[(_0xb597('0x76'))][(_0xb597('0x77'))](_0xb597('0xc1'));}_0x43338f=_0x27306f[_0xb597('0x63')]['to'];return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x27306f[_0xb597('0x5c')]['id']},'include':[{'model':db[_0xb597('0x99')],'as':'List','include':[{'model':db[_0xb597('0x75')],'as':_0xb597('0x9a'),'where':{'mobile':_0x43338f},'limit':0x1,'order':[[_0xb597('0x7b'),_0xb597('0x9b')]]}]}]})['then'](handleEntityNotFound(_0x318031,null))[_0xb597('0x34')](function(_0xe9818f){if(_0xe9818f&&_0xe9818f[_0xb597('0xc2')]){_0x12838d=_0xe9818f['get']({'plain':!![]});if(_0x12838d[_0xb597('0xc2')]&&_0x12838d[_0xb597('0xc2')][_0xb597('0x9a')][_0xb597('0x4a')]){return _0x12838d['List'][_0xb597('0x9a')][0x0];}return db[_0xb597('0x75')][_0xb597('0x5d')](_[_0xb597('0x19')](_0x27306f['body'],{'firstName':_0x43338f,'mobile':_0x43338f,'phone':_0x43338f,'ListId':_0x12838d[_0xb597('0x7d')]}));}})['then'](handleEntityNotFound(_0x318031,null))[_0xb597('0x34')](function(_0x474f8f){if(_0x474f8f){_0x2a8413=_0x474f8f;return db['SmsInteraction'][_0xb597('0x60')]({'where':{'ContactId':_0x2a8413['id'],'closed':![],'SmsAccountId':_0x12838d['id']}})[_0xb597('0x34')](function(_0x57689b){if(_0x57689b){return[_0x57689b,![]];}return db[_0xb597('0x9f')][_0xb597('0x5d')]({'UserId':_0x27306f['user']['id'],'ContactId':_0x2a8413['id'],'SmsAccountId':_0x12838d['id'],'phone':_0x43338f,'firstMsgDirection':_0xb597('0xc3'),'Messages':[_[_0xb597('0x52')](_0x27306f[_0xb597('0x63')],{'read':![],'body':_0x27306f[_0xb597('0x63')][_0xb597('0x63')],'phone':_0x43338f,'SmsAccountId':_0x12838d['id'],'UserId':_0x27306f[_0xb597('0xc4')]['id'],'ContactId':_0x2a8413['id']})]},{'include':[{'model':db[_0xb597('0xc5')],'as':_0xb597('0xc6')}]})['then'](function(_0x34d9b5){return[_0x34d9b5,!![]];});});}})['spread'](function(_0x286d6e,_0x527f4e){if(_0x527f4e){return _0x286d6e;}return db[_0xb597('0xc5')][_0xb597('0x5d')](_[_0xb597('0x52')](_0x27306f[_0xb597('0x63')],{'read':![],'body':_0x27306f['body'][_0xb597('0x63')],'phone':_0x43338f,'SmsAccountId':_0x12838d['id'],'SmsInteractionId':_0x286d6e['id'],'UserId':_0x27306f['user']['id'],'ContactId':_0x2a8413['id']}))[_0xb597('0x34')](function(_0xb4b3be){_0x286d6e[_0xb597('0xc7')][_0xb597('0xc6')]=[];_0x286d6e[_0xb597('0xc7')][_0xb597('0xc6')][_0xb597('0xa3')](_0xb4b3be[_0xb597('0xc7')]);return _0x286d6e;});})[_0xb597('0x34')](respondWithResult(_0x318031,null))['catch'](handleError(_0x318031,null));};exports[_0xb597('0x2a')]=function(_0x2f6658,_0x5da49b,_0x36d085){if(_0x2f6658[_0xb597('0x63')]['id']){delete _0x2f6658[_0xb597('0x63')]['id'];}var _0x21abd3,_0x324767,_0x11fc30;return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x2f6658['params']['id']}})['then'](handleEntityNotFound(_0x5da49b,null))[_0xb597('0x34')](function(_0x17d0b9){if(_0x17d0b9){_0x11fc30=_0x17d0b9;logger['debug'](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0xc8'),_0x17d0b9[_0xb597('0x41')],util['inspect'](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));switch(_0x17d0b9[_0xb597('0x41')]){case _0xb597('0x83'):if(_0x2f6658[_0xb597('0x63')]['skebby_dispatch_id']&&_0x2f6658['body'][_0xb597('0x2a')]){_0x324767=_0x2f6658[_0xb597('0x63')][_0xb597('0x2a')];return db[_0xb597('0xc5')]['find']({'where':{'messageId':_0x2f6658[_0xb597('0x63')]['skebby_dispatch_id']}});}break;case _0xb597('0x86'):if(_0x2f6658[_0xb597('0x63')][_0xb597('0xc9')]&&_0x2f6658['body'][_0xb597('0xca')]){_0x324767=_0x2f6658[_0xb597('0x63')][_0xb597('0xca')];return db[_0xb597('0xc5')]['find']({'where':{'messageId':_0x2f6658[_0xb597('0x63')][_0xb597('0xc9')]}});}break;case _0xb597('0xcb'):if(_0x2f6658[_0xb597('0x63')]['message_id']&&_0x2f6658[_0xb597('0x63')][_0xb597('0xcc')]){_0x324767=_0x2f6658[_0xb597('0x63')][_0xb597('0xcc')];return db['SmsMessage']['find']({'where':{'messageId':_0x2f6658[_0xb597('0x63')][_0xb597('0x87')]}});}break;case _0xb597('0x89'):var _0x3b8526=_0x2f6658['body'][_0xb597('0x8b')][0x0];if(_0x3b8526['messageId']&&_0x3b8526[_0xb597('0x2a')]['groupName']===_0xb597('0xcd')){_0x324767=_0x3b8526['status'][_0xb597('0xce')];return db['SmsMessage'][_0xb597('0x60')]({'where':{'messageId':_0x3b8526['messageId']}});}break;case _0xb597('0xcf'):if(_0x2f6658[_0xb597('0x63')]['messageId']&&_0x2f6658[_0xb597('0x63')][_0xb597('0x2a')]){_0x324767=_0x2f6658[_0xb597('0x63')]['status'];return db['SmsMessage'][_0xb597('0x60')]({'where':{'messageId':_0x2f6658[_0xb597('0x63')][_0xb597('0x8a')]}});}break;case _0xb597('0xd0'):if(_0x2f6658[_0xb597('0x63')][0x0][_0xb597('0x27')]['id']){_0x324767=_0x2f6658['body'][0x0][_0xb597('0x41')];return db[_0xb597('0xc5')][_0xb597('0x60')]({'where':{'messageId':_0x2f6658['body'][0x0][_0xb597('0x27')]['id']}});}break;case'intelepeer':if(_0x2f6658[_0xb597('0x63')][_0xb597('0xd1')]&&_0x2f6658[_0xb597('0x63')]['status']){_0x324767=_0x2f6658[_0xb597('0x63')][_0xb597('0x2a')];return db[_0xb597('0xc5')]['find']({'where':{'messageId':_0x2f6658['body']['redif']}});}break;}}})[_0xb597('0x34')](handleEntityNotFound(_0x5da49b,null))[_0xb597('0x34')](function(_0x27b9b9){if(_0x27b9b9){_0x21abd3=_0x27b9b9;switch(_0x11fc30[_0xb597('0x41')]){case _0xb597('0x83'):if(_0x324767===_0xb597('0xcd')){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger['error'](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0x83'),util[_0xb597('0xd2')](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;case _0xb597('0x86'):if(_0x324767==='1'){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger[_0xb597('0x25')](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0x83'),util[_0xb597('0xd2')](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;case _0xb597('0xcb'):if(!_0x2f6658['body'][_0xb597('0xd3')]&&_0x324767>=0xc8&&_0x324767<=0xce){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb597('0x2a'),_0xb597('0xcb'),util[_0xb597('0xd2')](_0x2f6658['body'],{'showHidden':![],'depth':null}));}break;case _0xb597('0x89'):var _0x2c6457=_0x2f6658[_0xb597('0x63')][_0xb597('0x8b')][0x0];if(_0x2c6457[_0xb597('0x2a')][_0xb597('0xce')]===_0xb597('0xcd')){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger['error'](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0x89'),util['inspect'](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x324767==_0xb597('0xd4')||_0x324767==_0xb597('0xd5')){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger[_0xb597('0x25')](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0xcf'),util[_0xb597('0xd2')](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x324767==_0xb597('0xd6')){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger[_0xb597('0x25')](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0xd0'),util[_0xb597('0xd2')](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;case _0xb597('0x90'):if(_0x324767===_0xb597('0xd7')||_0x324767===_0xb597('0xd8')){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger[_0xb597('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb597('0x2a'),_0xb597('0x90'),util[_0xb597('0xd2')](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x21abd3;}})['then'](respondWithResult(_0x5da49b,null))[_0xb597('0x5a')](handleError(_0x5da49b,null));};exports[_0xb597('0xd9')]=function(_0x1f6fdf,_0x1b3993,_0x3857ee){var _0x31fa50,_0x1e6cbb,_0x472669;return db[_0xb597('0x3e')]['find']({'where':{'id':_0x1f6fdf[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x1b3993,null))[_0xb597('0x34')](function(_0x59c6bb){if(_0x59c6bb){_0x472669=_0x59c6bb;logger[_0xb597('0x23')](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0xc8'),_0x59c6bb[_0xb597('0x41')],util['inspect'](_0x1f6fdf[_0xb597('0x43')],{'showHidden':![],'depth':null}));switch(_0x59c6bb['type']){case _0xb597('0x8c'):if(_0x1f6fdf[_0xb597('0x43')][_0xb597('0xda')]&&_0x1f6fdf[_0xb597('0x43')][_0xb597('0xdb')]){_0x1e6cbb=_0x1f6fdf[_0xb597('0x43')][_0xb597('0xdb')];return db[_0xb597('0xc5')][_0xb597('0x60')]({'where':{'messageId':_0x1f6fdf[_0xb597('0x43')][_0xb597('0xda')]}});}break;}}})[_0xb597('0x34')](handleEntityNotFound(_0x1b3993,null))['then'](function(_0x33145a){if(_0x33145a){_0x31fa50=_0x33145a;switch(_0x472669['type']){case _0xb597('0x8c'):if(_0x1e6cbb==='2'||_0x1e6cbb==='6'){return _0x31fa50['update']({'read':!![]});}else{logger[_0xb597('0x25')](_0xb597('0x24'),'status','csc',util[_0xb597('0xd2')](_0x1f6fdf[_0xb597('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x31fa50;}})[_0xb597('0x34')](respondWithResult(_0x1b3993,null))[_0xb597('0x5a')](handleError(_0x1b3993,null));};exports[_0xb597('0xdc')]=function(_0x36e010,_0x1b0105,_0x219273){return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x36e010['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x1b0105,null))[_0xb597('0x34')](function(_0x5bf8c3){if(_0x5bf8c3){return _0x5bf8c3[_0xb597('0xdc')](_0x36e010[_0xb597('0x63')][_0xb597('0x69')],_['omit'](_0x36e010[_0xb597('0x63')],['ids','id'])||{})['spread'](function(_0x3f686e){for(var _0x3319a4=0x0;_0x3319a4<_0x36e010[_0xb597('0x63')][_0xb597('0x69')][_0xb597('0x4a')];_0x3319a4+=0x1){socket[_0xb597('0xdd')](_0xb597('0xde'),{'UserId':Number(_0x36e010[_0xb597('0x63')][_0xb597('0x69')][_0x3319a4]),'SmsAccountId':Number(_0x36e010[_0xb597('0x5c')]['id'])});}return _0x3f686e;});}})[_0xb597('0x34')](respondWithResult(_0x1b0105,null))['catch'](handleError(_0x1b0105,null));};exports['removeAgents']=function(_0x3969f3,_0x35d491,_0x492502){return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x3969f3['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x35d491,null))[_0xb597('0x34')](function(_0x4190ac){if(_0x4190ac){return _0x4190ac[_0xb597('0xdf')](_0x3969f3['query'][_0xb597('0x69')])[_0xb597('0x34')](function(){if(_[_0xb597('0xe0')](_0x3969f3[_0xb597('0x43')][_0xb597('0x69')])){for(var _0x2ce57d=0x0;_0x2ce57d<_0x3969f3[_0xb597('0x43')]['ids'][_0xb597('0x4a')];_0x2ce57d+=0x1){socket[_0xb597('0xdd')](_0xb597('0xe1'),{'UserId':Number(_0x3969f3[_0xb597('0x43')][_0xb597('0x69')][_0x2ce57d]),'SmsAccountId':Number(_0x3969f3[_0xb597('0x5c')]['id'])});}}else{socket[_0xb597('0xdd')](_0xb597('0xe1'),{'UserId':Number(_0x3969f3[_0xb597('0x43')]['ids']),'SmsAccountId':Number(_0x3969f3[_0xb597('0x5c')]['id'])});}});}})[_0xb597('0x34')](respondWithStatusCode(_0x35d491,null))[_0xb597('0x5a')](handleError(_0x35d491,null));};exports['getAgents']=function(_0x32b239,_0x2cd1a9,_0x10eab5){var _0x439d8d={};var _0x500e42={};var _0x39504c;var _0x47771d;return db[_0xb597('0x3e')][_0xb597('0x67')]({'where':{'id':_0x32b239['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x2cd1a9,null))[_0xb597('0x34')](function(_0x3decfc){if(_0x3decfc){_0x39504c=_0x3decfc;_0x500e42[_0xb597('0x48')]=_[_0xb597('0x44')](db[_0xb597('0xa7')][_0xb597('0x3f')]);_0x500e42[_0xb597('0x43')]=_[_0xb597('0x44')](_0x32b239[_0xb597('0x43')]);_0x500e42[_0xb597('0x45')]=_[_0xb597('0x46')](_0x500e42['model'],_0x500e42[_0xb597('0x43')]);_0x439d8d['attributes']=_[_0xb597('0x46')](_0x500e42[_0xb597('0x48')],qs[_0xb597('0x49')](_0x32b239[_0xb597('0x43')][_0xb597('0x49')]));_0x439d8d[_0xb597('0x47')]=_0x439d8d['attributes']['length']?_0x439d8d['attributes']:_0x500e42[_0xb597('0x48')];_0x439d8d['order']=qs[_0xb597('0x4e')](_0x32b239[_0xb597('0x43')]['sort']);_0x439d8d[_0xb597('0x51')]=qs[_0xb597('0x45')](_['pick'](_0x32b239[_0xb597('0x43')],_0x500e42[_0xb597('0x45')]));if(_0x32b239[_0xb597('0x43')]['filter']){_0x439d8d[_0xb597('0x51')]=_[_0xb597('0x52')](_0x439d8d['where'],{'$or':_[_0xb597('0x3d')](_0x439d8d['attributes'],function(_0x1fd351){var _0x266d40={};_0x266d40[_0x1fd351]={'$like':'%'+_0x32b239[_0xb597('0x43')][_0xb597('0x50')]+'%'};return _0x266d40;})});}_0x439d8d=_[_0xb597('0x52')]({},_0x439d8d,_0x32b239[_0xb597('0x54')]);return _0x39504c['getAgents'](_0x439d8d);}})['then'](function(_0x183efa){if(_0x183efa){_0x47771d=_0x183efa[_0xb597('0x4a')];if(!_0x32b239[_0xb597('0x43')][_0xb597('0x4b')]('nolimit')){_0x439d8d[_0xb597('0x2f')]=qs['limit'](_0x32b239['query'][_0xb597('0x2f')]);_0x439d8d[_0xb597('0x2d')]=qs['offset'](_0x32b239['query'][_0xb597('0x2d')]);}return _0x39504c[_0xb597('0xe2')](_0x439d8d);}})['then'](function(_0x73ccea){if(_0x73ccea){return _0x73ccea?{'count':_0x47771d,'rows':_0x73ccea}:null;}})[_0xb597('0x34')](respondWithResult(_0x2cd1a9,null))[_0xb597('0x5a')](handleError(_0x2cd1a9,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 35d60f7..367e00b 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 _0x4220=['exports','events','../../mysqldb','SmsAccount','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x4220,0x169));var _0x0422=function(_0x98d4a7,_0x55746c){_0x98d4a7=_0x98d4a7-0x0;var _0x453fb6=_0x4220[_0x98d4a7];return _0x453fb6;};'use strict';var EventEmitter=require(_0x0422('0x0'));var SmsAccount=require(_0x0422('0x1'))['db'][_0x0422('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0422('0x3'),'afterUpdate':_0x0422('0x4'),'afterDestroy':_0x0422('0x5')};function emitEvent(_0x2d2207){return function(_0x33593e,_0x51cb0f,_0x1b2392){SmsAccountEvents['emit'](_0x2d2207+':'+_0x33593e['id'],_0x33593e);SmsAccountEvents[_0x0422('0x6')](_0x2d2207,_0x33593e);_0x1b2392(null);};}for(var e in events){if(events[_0x0422('0x7')](e)){var event=events[e];SmsAccount[_0x0422('0x8')](e,emitEvent(event));}}module[_0x0422('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x09f2=['emit','hasOwnProperty','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x14d05d,_0x5ef5c0){var _0x11e5d7=function(_0x446397){while(--_0x446397){_0x14d05d['push'](_0x14d05d['shift']());}};_0x11e5d7(++_0x5ef5c0);}(_0x09f2,0x1ca));var _0x209f=function(_0x1eb578,_0x14f617){_0x1eb578=_0x1eb578-0x0;var _0x5d1f47=_0x09f2[_0x1eb578];return _0x5d1f47;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x209f('0x0'))['db'][_0x209f('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x209f('0x2')](0x0);var events={'afterCreate':_0x209f('0x3'),'afterUpdate':_0x209f('0x4'),'afterDestroy':_0x209f('0x5')};function emitEvent(_0x53e4b1){return function(_0xfe06e2,_0x2adfae,_0xa08713){SmsAccountEvents['emit'](_0x53e4b1+':'+_0xfe06e2['id'],_0xfe06e2);SmsAccountEvents[_0x209f('0x6')](_0x53e4b1,_0xfe06e2);_0xa08713(null);};}for(var e in events){if(events[_0x209f('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index aed7b5a..5460e81 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 _0xdcec=['SmsAccount','sms_accounts','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./smsAccount.attributes','exports','define'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xdcec,0xf2));var _0xcdce=function(_0x4ec9e3,_0x15fbf4){_0x4ec9e3=_0x4ec9e3-0x0;var _0x2883ce=_0xdcec[_0x4ec9e3];return _0x2883ce;};'use strict';var _=require('lodash');var util=require(_0xcdce('0x0'));var logger=require(_0xcdce('0x1'))(_0xcdce('0x2'));var moment=require(_0xcdce('0x3'));var BPromise=require(_0xcdce('0x4'));var rp=require(_0xcdce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcdce('0x6'));var attributes=require(_0xcdce('0x7'));module[_0xcdce('0x8')]=function(_0x513bde,_0x559227){return _0x513bde[_0xcdce('0x9')](_0xcdce('0xa'),attributes,{'tableName':_0xcdce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff2f=['define','SmsAccount','sms_accounts','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsAccount.attributes','exports'];(function(_0xe775be,_0x4822af){var _0x49e73c=function(_0x225efd){while(--_0x225efd){_0xe775be['push'](_0xe775be['shift']());}};_0x49e73c(++_0x4822af);}(_0xff2f,0x1e7));var _0xfff2=function(_0x493720,_0x2e7724){_0x493720=_0x493720-0x0;var _0x3cfc8e=_0xff2f[_0x493720];return _0x3cfc8e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfff2('0x0'))(_0xfff2('0x1'));var moment=require(_0xfff2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfff2('0x3'));var rimraf=require(_0xfff2('0x4'));var config=require(_0xfff2('0x5'));var attributes=require(_0xfff2('0x6'));module[_0xfff2('0x7')]=function(_0x14ccc6,_0x1c972c){return _0x14ccc6[_0xfff2('0x8')](_0xfff2('0x9'),attributes,{'tableName':_0xfff2('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 7c0f82f..2c0b195 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 _0x7bf6=['code','message','request\x20sent','result','catch','SmsAccount','find','options','raw','where','attributes','include','model','map','ShowSmsAccount','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x23e926,_0x24d43d){var _0x1ffacf=function(_0x4fe707){while(--_0x4fe707){_0x23e926['push'](_0x23e926['shift']());}};_0x1ffacf(++_0x24d43d);}(_0x7bf6,0x177));var _0x67bf=function(_0x13cc75,_0x57fd07){_0x13cc75=_0x13cc75-0x0;var _0x5a595d=_0x7bf6[_0x13cc75];return _0x5a595d;};'use strict';var _=require(_0x67bf('0x0'));var util=require(_0x67bf('0x1'));var moment=require('moment');var BPromise=require(_0x67bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67bf('0x3'))['db'];var utils=require(_0x67bf('0x4'));var logger=require(_0x67bf('0x5'))(_0x67bf('0x6'));var config=require('../../config/environment');var jayson=require(_0x67bf('0x7'));var client=jayson[_0x67bf('0x8')]['http']({'port':0x232a});config[_0x67bf('0x9')]=_[_0x67bf('0xa')](config['redis'],{'host':_0x67bf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')[_0x67bf('0xc')](socket);function respondWithRpcPromise(_0x4fe26a,_0x11590d,_0x3e2edd){return new BPromise(function(_0x59e0b2,_0x205c05){return client[_0x67bf('0xd')](_0x4fe26a,_0x3e2edd)[_0x67bf('0xe')](function(_0x262a48){logger[_0x67bf('0xf')](_0x67bf('0x10'),_0x11590d,'request\x20sent');logger[_0x67bf('0x11')](_0x67bf('0x12'),_0x11590d,'request\x20sent',JSON[_0x67bf('0x13')](_0x262a48));if(_0x262a48[_0x67bf('0x14')]){if(_0x262a48[_0x67bf('0x14')][_0x67bf('0x15')]===0x1f4){logger[_0x67bf('0x14')](_0x67bf('0x10'),_0x11590d,_0x262a48[_0x67bf('0x14')][_0x67bf('0x16')]);return _0x205c05(_0x262a48[_0x67bf('0x14')][_0x67bf('0x16')]);}logger[_0x67bf('0x14')](_0x67bf('0x10'),_0x11590d,_0x262a48[_0x67bf('0x14')]['message']);return _0x59e0b2(_0x262a48['error'][_0x67bf('0x16')]);}else{logger[_0x67bf('0xf')](_0x67bf('0x10'),_0x11590d,_0x67bf('0x17'));_0x59e0b2(_0x262a48[_0x67bf('0x18')][_0x67bf('0x16')]);}})[_0x67bf('0x19')](function(_0x233746){logger[_0x67bf('0x14')](_0x67bf('0x10'),_0x11590d,_0x233746);_0x205c05(_0x233746);});});}exports['ShowSmsAccount']=function(_0x4c2964){var _0x19195a=this;return new Promise(function(_0x3fd621,_0x2a251f){return db[_0x67bf('0x1a')][_0x67bf('0x1b')]({'raw':_0x4c2964['options']?_0x4c2964[_0x67bf('0x1c')][_0x67bf('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c2964[_0x67bf('0x1c')]?_0x4c2964['options'][_0x67bf('0x1e')]||null:null,'attributes':_0x4c2964[_0x67bf('0x1c')]?_0x4c2964[_0x67bf('0x1c')][_0x67bf('0x1f')]||null:null,'include':_0x4c2964['options']?_0x4c2964[_0x67bf('0x1c')][_0x67bf('0x20')]?_['map'](_0x4c2964[_0x67bf('0x1c')][_0x67bf('0x20')],function(_0x45ecd0){return{'model':db[_0x45ecd0[_0x67bf('0x21')]],'as':_0x45ecd0['as'],'attributes':_0x45ecd0[_0x67bf('0x1f')],'include':_0x45ecd0[_0x67bf('0x20')]?_['map'](_0x45ecd0[_0x67bf('0x20')],function(_0x58aef1){return{'model':db[_0x58aef1[_0x67bf('0x21')]],'as':_0x58aef1['as'],'attributes':_0x58aef1[_0x67bf('0x1f')],'include':_0x58aef1['include']?_[_0x67bf('0x22')](_0x58aef1[_0x67bf('0x20')],function(_0x221259){return{'model':db[_0x221259[_0x67bf('0x21')]],'as':_0x221259['as'],'attributes':_0x221259[_0x67bf('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x67bf('0xe')](function(_0x18a366){logger[_0x67bf('0xf')](_0x67bf('0x23'),_0x4c2964);logger[_0x67bf('0x11')](_0x67bf('0x23'),_0x4c2964,JSON['stringify'](_0x18a366));_0x3fd621(_0x18a366);})[_0x67bf('0x19')](function(_0x124a36){logger[_0x67bf('0x14')](_0x67bf('0x23'),_0x124a36[_0x67bf('0x16')],_0x4c2964);_0x2a251f(_0x19195a[_0x67bf('0x14')](0x1f4,_0x124a36['message']));});});}; \ No newline at end of file +var _0x9277=['socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x45655c,_0x407b81){var _0x24a8d9=function(_0x1624c7){while(--_0x1624c7){_0x45655c['push'](_0x45655c['shift']());}};_0x24a8d9(++_0x407b81);}(_0x9277,0x151));var _0x7927=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0x9277[_0x425b19];return _0x15ecab;};'use strict';var _=require(_0x7927('0x0'));var util=require(_0x7927('0x1'));var moment=require(_0x7927('0x2'));var BPromise=require(_0x7927('0x3'));var rs=require(_0x7927('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7927('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7927('0x6'))(_0x7927('0x7'));var config=require(_0x7927('0x8'));var jayson=require(_0x7927('0x9'));var client=jayson[_0x7927('0xa')]['http']({'port':0x232a});config['redis']=_[_0x7927('0xb')](config[_0x7927('0xc')],{'host':_0x7927('0xd'),'port':0x18eb});var socket=require(_0x7927('0xe'))(new Redis(config['redis']));require(_0x7927('0xf'))[_0x7927('0x10')](socket);function respondWithRpcPromise(_0x38fb41,_0x305e80,_0xc1ade0){return new BPromise(function(_0x489f2d,_0x16bf69){return client[_0x7927('0x11')](_0x38fb41,_0xc1ade0)[_0x7927('0x12')](function(_0x63c2a2){logger['info'](_0x7927('0x13'),_0x305e80,_0x7927('0x14'));logger[_0x7927('0x15')](_0x7927('0x16'),_0x305e80,_0x7927('0x14'),JSON[_0x7927('0x17')](_0x63c2a2));if(_0x63c2a2[_0x7927('0x18')]){if(_0x63c2a2['error'][_0x7927('0x19')]===0x1f4){logger[_0x7927('0x18')](_0x7927('0x13'),_0x305e80,_0x63c2a2[_0x7927('0x18')][_0x7927('0x1a')]);return _0x16bf69(_0x63c2a2[_0x7927('0x18')][_0x7927('0x1a')]);}logger[_0x7927('0x18')](_0x7927('0x13'),_0x305e80,_0x63c2a2[_0x7927('0x18')][_0x7927('0x1a')]);return _0x489f2d(_0x63c2a2['error'][_0x7927('0x1a')]);}else{logger[_0x7927('0x1b')](_0x7927('0x13'),_0x305e80,_0x7927('0x14'));_0x489f2d(_0x63c2a2[_0x7927('0x1c')]['message']);}})[_0x7927('0x1d')](function(_0x158f1b){logger[_0x7927('0x18')](_0x7927('0x13'),_0x305e80,_0x158f1b);_0x16bf69(_0x158f1b);});});}exports[_0x7927('0x1e')]=function(_0x4a0200){var _0x5b92fc=this;return new Promise(function(_0x150e62,_0x335197){return db[_0x7927('0x1f')][_0x7927('0x20')]({'raw':_0x4a0200[_0x7927('0x21')]?_0x4a0200['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a0200[_0x7927('0x21')]?_0x4a0200['options'][_0x7927('0x22')]||null:null,'attributes':_0x4a0200[_0x7927('0x21')]?_0x4a0200[_0x7927('0x21')][_0x7927('0x23')]||null:null,'include':_0x4a0200[_0x7927('0x21')]?_0x4a0200[_0x7927('0x21')][_0x7927('0x24')]?_[_0x7927('0x25')](_0x4a0200[_0x7927('0x21')]['include'],function(_0x3864ac){return{'model':db[_0x3864ac[_0x7927('0x26')]],'as':_0x3864ac['as'],'attributes':_0x3864ac[_0x7927('0x23')],'include':_0x3864ac[_0x7927('0x24')]?_[_0x7927('0x25')](_0x3864ac[_0x7927('0x24')],function(_0x197c2e){return{'model':db[_0x197c2e[_0x7927('0x26')]],'as':_0x197c2e['as'],'attributes':_0x197c2e[_0x7927('0x23')],'include':_0x197c2e['include']?_['map'](_0x197c2e[_0x7927('0x24')],function(_0x45cdb7){return{'model':db[_0x45cdb7['model']],'as':_0x45cdb7['as'],'attributes':_0x45cdb7[_0x7927('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7927('0x12')](function(_0x5b044f){logger[_0x7927('0x1b')](_0x7927('0x1e'),_0x4a0200);logger[_0x7927('0x15')](_0x7927('0x1e'),_0x4a0200,JSON['stringify'](_0x5b044f));_0x150e62(_0x5b044f);})['catch'](function(_0x10b313){logger[_0x7927('0x18')](_0x7927('0x1e'),_0x10b313[_0x7927('0x1a')],_0x4a0200);_0x335197(_0x5b92fc[_0x7927('0x18')](0x1f4,_0x10b313[_0x7927('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 345b17f..36b9c77 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_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 diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index f1dd674..55eb768 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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x5ecb2c,_0x5e11fc){var _0x46efbe=function(_0x337eff){while(--_0x337eff){_0x5ecb2c['push'](_0x5ecb2c['shift']());}};_0x46efbe(++_0x5e11fc);}(_0x008c,0x188));var _0xc008=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0x008c[_0x2e986d];return _0x351c79;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +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(_0x2646ad,_0x2915ba){var _0x350cbb=function(_0x48a62c){while(--_0x48a62c){_0x2646ad['push'](_0x2646ad['shift']());}};_0x350cbb(++_0x2915ba);}(_0x3e74,0x175));var _0x43e7=function(_0x297a9a,_0x46047a){_0x297a9a=_0x297a9a-0x0;var _0x27d5fb=_0x3e74[_0x297a9a];return _0x27d5fb;};'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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 469965b..e1d7ff3 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 _0x2f33=['sequelize','INTEGER','noop','STRING','*,*,*,*'];(function(_0x402125,_0x3546a9){var _0x183c8b=function(_0x732136){while(--_0x732136){_0x402125['push'](_0x402125['shift']());}};_0x183c8b(++_0x3546a9);}(_0x2f33,0xb4));var _0x32f3=function(_0x1d6505,_0x183c95){_0x1d6505=_0x1d6505-0x0;var _0x548fc1=_0x2f33[_0x1d6505];return _0x548fc1;};'use strict';var Sequelize=require(_0x32f3('0x0'));module['exports']={'priority':{'type':Sequelize[_0x32f3('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x32f3('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x32f3('0x3')],'defaultValue':_0x32f3('0x4')}}; \ No newline at end of file +var _0x86e7=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0xe154ff,_0x112a21){var _0x12efc9=function(_0xbb6da8){while(--_0xbb6da8){_0xe154ff['push'](_0xe154ff['shift']());}};_0x12efc9(++_0x112a21);}(_0x86e7,0x1a4));var _0x786e=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x86e7[_0x2c1dcd];return _0x158ce5;};'use strict';var Sequelize=require(_0x786e('0x0'));module[_0x786e('0x1')]={'priority':{'type':Sequelize[_0x786e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x786e('0x3')],'allowNull':![],'defaultValue':_0x786e('0x4')},'appdata':{'type':Sequelize[_0x786e('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x786e('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9f7e74d..35672c8 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 _0x562b=['error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end'];(function(_0x8d001e,_0x4fa793){var _0x423818=function(_0x2258f7){while(--_0x2258f7){_0x8d001e['push'](_0x8d001e['shift']());}};_0x423818(++_0x4fa793);}(_0x562b,0x1b7));var _0xb562=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x562b[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0xb562('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb562('0x1'));var jsonpatch=require(_0xb562('0x2'));var rp=require(_0xb562('0x3'));var moment=require(_0xb562('0x4'));var BPromise=require(_0xb562('0x5'));var Mustache=require(_0xb562('0x6'));var util=require(_0xb562('0x7'));var path=require('path');var sox=require(_0xb562('0x8'));var csv=require(_0xb562('0x9'));var ejs=require(_0xb562('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb562('0xb'));var squel=require(_0xb562('0xc'));var crypto=require(_0xb562('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb562('0xe'));var toCsv=require(_0xb562('0x9'));var querystring=require(_0xb562('0xf'));var Papa=require(_0xb562('0x10'));var Redis=require(_0xb562('0x11'));var authService=require(_0xb562('0x12'));var qs=require(_0xb562('0x13'));var as=require(_0xb562('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb562('0x15'))(_0xb562('0x16'));var utils=require(_0xb562('0x17'));var config=require(_0xb562('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb562('0x19'))['db'];function respondWithStatusCode(_0x31ad19,_0x28effd){_0x28effd=_0x28effd||0xcc;return function(_0x5487c7){if(_0x5487c7){return _0x31ad19[_0xb562('0x1a')](_0x28effd);}return _0x31ad19[_0xb562('0x1b')](_0x28effd)['end']();};}function respondWithResult(_0x520e0d,_0x5d6bbd){_0x5d6bbd=_0x5d6bbd||0xc8;return function(_0x186c53){if(_0x186c53){return _0x520e0d['status'](_0x5d6bbd)[_0xb562('0x1c')](_0x186c53);}};}function respondWithFilteredResult(_0xa8cff7,_0x5292bb){return function(_0x499d4b){if(_0x499d4b){var _0x2d5a80=typeof _0x5292bb[_0xb562('0x1d')]===_0xb562('0x1e')&&typeof _0x5292bb[_0xb562('0x1f')]==='undefined';var _0x201a15=_0x499d4b[_0xb562('0x20')];var _0x36232f=_0x2d5a80?0x0:_0x5292bb[_0xb562('0x1d')];var _0x5de69d=_0x2d5a80?_0x499d4b[_0xb562('0x20')]:_0x5292bb['offset']+_0x5292bb[_0xb562('0x1f')];var _0x568cf9;if(_0x5de69d>=_0x201a15){_0x5de69d=_0x201a15;_0x568cf9=0xc8;}else{_0x568cf9=0xce;}_0xa8cff7[_0xb562('0x1b')](_0x568cf9);return _0xa8cff7[_0xb562('0x21')](_0xb562('0x22'),_0x36232f+'-'+_0x5de69d+'/'+_0x201a15)[_0xb562('0x1c')](_0x499d4b);}return null;};}function patchUpdates(_0x17116f){return function(_0x1bfc84){try{jsonpatch['apply'](_0x1bfc84,_0x17116f,!![]);}catch(_0x562d77){return BPromise[_0xb562('0x23')](_0x562d77);}return _0x1bfc84[_0xb562('0x24')]();};}function saveUpdates(_0x1b94d7,_0x44cb98){return function(_0x41c7fe){if(_0x41c7fe){return _0x41c7fe[_0xb562('0x25')](_0x1b94d7)[_0xb562('0x26')](function(_0x1e1e97){return _0x1e1e97;});}return null;};}function removeEntity(_0x24a7f1,_0x112724){return function(_0x5fa8d2){if(_0x5fa8d2){return _0x5fa8d2[_0xb562('0x27')]()[_0xb562('0x26')](function(){_0x24a7f1[_0xb562('0x1b')](0xcc)[_0xb562('0x28')]();});}};}function handleEntityNotFound(_0x46394a,_0x684563){return function(_0x4f4174){if(!_0x4f4174){_0x46394a[_0xb562('0x1a')](0x194);}return _0x4f4174;};}function handleError(_0x4817ed,_0x5e5165){_0x5e5165=_0x5e5165||0x1f4;return function(_0x1bd363){logger[_0xb562('0x29')](_0x1bd363[_0xb562('0x2a')]);if(_0x1bd363[_0xb562('0x2b')]){delete _0x1bd363[_0xb562('0x2b')];}_0x4817ed[_0xb562('0x1b')](_0x5e5165)[_0xb562('0x2c')](_0x1bd363);};}exports[_0xb562('0x2d')]=function(_0x14cf72,_0xa61eac){var _0x2eff23={},_0x29fc03={},_0x41b979={'count':0x0,'rows':[]};var _0x68b71e=_[_0xb562('0x2e')](db[_0xb562('0x2f')][_0xb562('0x30')],function(_0x3d84c6){return{'name':_0x3d84c6[_0xb562('0x31')],'type':_0x3d84c6[_0xb562('0x32')][_0xb562('0x33')]};});_0x29fc03[_0xb562('0x34')]=_[_0xb562('0x2e')](_0x68b71e,'name');_0x29fc03[_0xb562('0x35')]=_['keys'](_0x14cf72['query']);_0x29fc03[_0xb562('0x36')]=_[_0xb562('0x37')](_0x29fc03['model'],_0x29fc03['query']);_0x2eff23['attributes']=_[_0xb562('0x37')](_0x29fc03[_0xb562('0x34')],qs[_0xb562('0x38')](_0x14cf72[_0xb562('0x35')][_0xb562('0x38')]));_0x2eff23['attributes']=_0x2eff23[_0xb562('0x39')]['length']?_0x2eff23[_0xb562('0x39')]:_0x29fc03[_0xb562('0x34')];if(!_0x14cf72[_0xb562('0x35')][_0xb562('0x3a')](_0xb562('0x3b'))){_0x2eff23[_0xb562('0x1f')]=qs[_0xb562('0x1f')](_0x14cf72[_0xb562('0x35')][_0xb562('0x1f')]);_0x2eff23['offset']=qs[_0xb562('0x1d')](_0x14cf72['query'][_0xb562('0x1d')]);}_0x2eff23[_0xb562('0x3c')]=qs[_0xb562('0x3d')](_0x14cf72[_0xb562('0x35')][_0xb562('0x3d')]);_0x2eff23[_0xb562('0x3e')]=qs[_0xb562('0x36')](_[_0xb562('0x3f')](_0x14cf72[_0xb562('0x35')],_0x29fc03[_0xb562('0x36')]),_0x68b71e);if(_0x14cf72[_0xb562('0x35')][_0xb562('0x40')]){_0x2eff23['where']=_[_0xb562('0x41')](_0x2eff23[_0xb562('0x3e')],{'$or':_[_0xb562('0x2e')](_0x68b71e,function(_0x2569df){if(_0x2569df[_0xb562('0x32')]!==_0xb562('0x42')){var _0x841a93={};_0x841a93[_0x2569df[_0xb562('0x2b')]]={'$like':'%'+_0x14cf72[_0xb562('0x35')]['filter']+'%'};return _0x841a93;}})});}_0x2eff23=_[_0xb562('0x41')]({},_0x2eff23,_0x14cf72[_0xb562('0x43')]);var _0x325138={'where':_0x2eff23['where']};return db['SmsApplication'][_0xb562('0x20')](_0x325138)[_0xb562('0x26')](function(_0x3ed267){_0x41b979[_0xb562('0x20')]=_0x3ed267;if(_0x14cf72[_0xb562('0x35')][_0xb562('0x44')]){_0x2eff23[_0xb562('0x45')]=[{'all':!![]}];}return db['SmsApplication'][_0xb562('0x46')](_0x2eff23);})[_0xb562('0x26')](function(_0x41e1f3){_0x41b979[_0xb562('0x47')]=_0x41e1f3;return _0x41b979;})['then'](respondWithFilteredResult(_0xa61eac,_0x2eff23))['catch'](handleError(_0xa61eac,null));};exports[_0xb562('0x48')]=function(_0x31b329,_0x57ab70){var _0x28119a={'raw':!![],'where':{'id':_0x31b329[_0xb562('0x49')]['id']}},_0x59dcfb={};_0x59dcfb[_0xb562('0x34')]=_[_0xb562('0x4a')](db[_0xb562('0x2f')]['rawAttributes']);_0x59dcfb[_0xb562('0x35')]=_['keys'](_0x31b329[_0xb562('0x35')]);_0x59dcfb['filters']=_[_0xb562('0x37')](_0x59dcfb['model'],_0x59dcfb[_0xb562('0x35')]);_0x28119a[_0xb562('0x39')]=_[_0xb562('0x37')](_0x59dcfb[_0xb562('0x34')],qs[_0xb562('0x38')](_0x31b329['query'][_0xb562('0x38')]));_0x28119a[_0xb562('0x39')]=_0x28119a['attributes'][_0xb562('0x4b')]?_0x28119a[_0xb562('0x39')]:_0x59dcfb['model'];if(_0x31b329[_0xb562('0x35')][_0xb562('0x44')]){_0x28119a[_0xb562('0x45')]=[{'all':!![]}];}_0x28119a=_[_0xb562('0x41')]({},_0x28119a,_0x31b329['options']);return db[_0xb562('0x2f')][_0xb562('0x4c')](_0x28119a)['then'](handleEntityNotFound(_0x57ab70,null))['then'](respondWithResult(_0x57ab70,null))[_0xb562('0x4d')](handleError(_0x57ab70,null));};exports[_0xb562('0x4e')]=function(_0x5954e4,_0x5d87c9){return db['SmsApplication'][_0xb562('0x4e')](_0x5954e4['body'],{})[_0xb562('0x26')](respondWithResult(_0x5d87c9,0xc9))['catch'](handleError(_0x5d87c9,null));};exports[_0xb562('0x25')]=function(_0x5dff8c,_0x5a32bc){if(_0x5dff8c[_0xb562('0x4f')]['id']){delete _0x5dff8c['body']['id'];}return db['SmsApplication'][_0xb562('0x4c')]({'where':{'id':_0x5dff8c[_0xb562('0x49')]['id']}})[_0xb562('0x26')](handleEntityNotFound(_0x5a32bc,null))[_0xb562('0x26')](saveUpdates(_0x5dff8c[_0xb562('0x4f')],null))[_0xb562('0x26')](respondWithResult(_0x5a32bc,null))['catch'](handleError(_0x5a32bc,null));};exports[_0xb562('0x27')]=function(_0x198caa,_0xfe1409){return db['SmsApplication'][_0xb562('0x4c')]({'where':{'id':_0x198caa[_0xb562('0x49')]['id']}})[_0xb562('0x26')](handleEntityNotFound(_0xfe1409,null))[_0xb562('0x26')](removeEntity(_0xfe1409,null))[_0xb562('0x4d')](handleError(_0xfe1409,null));}; \ No newline at end of file +var _0x8092=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','SmsApplication','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto'];(function(_0x3be010,_0x3c3db0){var _0x8b1ec1=function(_0x2a7fcd){while(--_0x2a7fcd){_0x3be010['push'](_0x3be010['shift']());}};_0x8b1ec1(++_0x3c3db0);}(_0x8092,0x122));var _0x2809=function(_0x236b7b,_0x4617f8){_0x236b7b=_0x236b7b-0x0;var _0xa327a7=_0x8092[_0x236b7b];return _0xa327a7;};'use strict';var emlformat=require(_0x2809('0x0'));var rimraf=require(_0x2809('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2809('0x2'));var rp=require(_0x2809('0x3'));var moment=require(_0x2809('0x4'));var BPromise=require(_0x2809('0x5'));var Mustache=require(_0x2809('0x6'));var util=require(_0x2809('0x7'));var path=require(_0x2809('0x8'));var sox=require(_0x2809('0x9'));var csv=require('to-csv');var ejs=require(_0x2809('0xa'));var fs=require('fs');var fs_extra=require(_0x2809('0xb'));var _=require('lodash');var squel=require(_0x2809('0xc'));var crypto=require(_0x2809('0xd'));var jsforce=require(_0x2809('0xe'));var deskjs=require(_0x2809('0xf'));var toCsv=require(_0x2809('0x10'));var querystring=require('querystring');var Papa=require(_0x2809('0x11'));var Redis=require(_0x2809('0x12'));var authService=require(_0x2809('0x13'));var qs=require(_0x2809('0x14'));var as=require(_0x2809('0x15'));var hardwareService=require(_0x2809('0x16'));var logger=require('../../config/logger')(_0x2809('0x17'));var utils=require(_0x2809('0x18'));var config=require(_0x2809('0x19'));var licenseUtil=require(_0x2809('0x1a'));var db=require(_0x2809('0x1b'))['db'];function respondWithStatusCode(_0x2cf1f3,_0x384ac9){_0x384ac9=_0x384ac9||0xcc;return function(_0x22c3b9){if(_0x22c3b9){return _0x2cf1f3[_0x2809('0x1c')](_0x384ac9);}return _0x2cf1f3['status'](_0x384ac9)['end']();};}function respondWithResult(_0xcab3c5,_0x1cdae8){_0x1cdae8=_0x1cdae8||0xc8;return function(_0x5bd7bf){if(_0x5bd7bf){return _0xcab3c5[_0x2809('0x1d')](_0x1cdae8)[_0x2809('0x1e')](_0x5bd7bf);}};}function respondWithFilteredResult(_0x4d9adf,_0x32ebc8){return function(_0x1047f2){if(_0x1047f2){var _0x1aac60=typeof _0x32ebc8[_0x2809('0x1f')]==='undefined'&&typeof _0x32ebc8[_0x2809('0x20')]===_0x2809('0x21');var _0x28272f=_0x1047f2[_0x2809('0x22')];var _0x552bdf=_0x1aac60?0x0:_0x32ebc8['offset'];var _0x2c7792=_0x1aac60?_0x1047f2[_0x2809('0x22')]:_0x32ebc8[_0x2809('0x1f')]+_0x32ebc8[_0x2809('0x20')];var _0x14c1ee;if(_0x2c7792>=_0x28272f){_0x2c7792=_0x28272f;_0x14c1ee=0xc8;}else{_0x14c1ee=0xce;}_0x4d9adf[_0x2809('0x1d')](_0x14c1ee);return _0x4d9adf[_0x2809('0x23')](_0x2809('0x24'),_0x552bdf+'-'+_0x2c7792+'/'+_0x28272f)[_0x2809('0x1e')](_0x1047f2);}return null;};}function patchUpdates(_0x53e473){return function(_0x3d7268){try{jsonpatch[_0x2809('0x25')](_0x3d7268,_0x53e473,!![]);}catch(_0x1b8c55){return BPromise['reject'](_0x1b8c55);}return _0x3d7268[_0x2809('0x26')]();};}function saveUpdates(_0x11dcae,_0x3020b1){return function(_0x19c3d0){if(_0x19c3d0){return _0x19c3d0[_0x2809('0x27')](_0x11dcae)[_0x2809('0x28')](function(_0x27d44b){return _0x27d44b;});}return null;};}function removeEntity(_0x42a565,_0x4416f9){return function(_0x3c0ff4){if(_0x3c0ff4){return _0x3c0ff4[_0x2809('0x29')]()[_0x2809('0x28')](function(){_0x42a565['status'](0xcc)[_0x2809('0x2a')]();});}};}function handleEntityNotFound(_0x553f1d,_0x541b2b){return function(_0x65d68d){if(!_0x65d68d){_0x553f1d[_0x2809('0x1c')](0x194);}return _0x65d68d;};}function handleError(_0x10e1da,_0x106992){_0x106992=_0x106992||0x1f4;return function(_0x5f03d2){logger[_0x2809('0x2b')](_0x5f03d2[_0x2809('0x2c')]);if(_0x5f03d2[_0x2809('0x2d')]){delete _0x5f03d2[_0x2809('0x2d')];}_0x10e1da[_0x2809('0x1d')](_0x106992)['send'](_0x5f03d2);};}exports[_0x2809('0x2e')]=function(_0x3ff586,_0x13e67b){var _0x17adff={},_0x3544eb={},_0x5d4ff2={'count':0x0,'rows':[]};var _0x4360d2=_[_0x2809('0x2f')](db[_0x2809('0x30')]['rawAttributes'],function(_0x452edc){return{'name':_0x452edc['fieldName'],'type':_0x452edc[_0x2809('0x31')][_0x2809('0x32')]};});_0x3544eb[_0x2809('0x33')]=_[_0x2809('0x2f')](_0x4360d2,_0x2809('0x2d'));_0x3544eb[_0x2809('0x34')]=_[_0x2809('0x35')](_0x3ff586[_0x2809('0x34')]);_0x3544eb[_0x2809('0x36')]=_[_0x2809('0x37')](_0x3544eb[_0x2809('0x33')],_0x3544eb['query']);_0x17adff[_0x2809('0x38')]=_['intersection'](_0x3544eb[_0x2809('0x33')],qs['fields'](_0x3ff586['query'][_0x2809('0x39')]));_0x17adff['attributes']=_0x17adff[_0x2809('0x38')]['length']?_0x17adff['attributes']:_0x3544eb['model'];if(!_0x3ff586['query'][_0x2809('0x3a')](_0x2809('0x3b'))){_0x17adff[_0x2809('0x20')]=qs[_0x2809('0x20')](_0x3ff586[_0x2809('0x34')][_0x2809('0x20')]);_0x17adff[_0x2809('0x1f')]=qs[_0x2809('0x1f')](_0x3ff586[_0x2809('0x34')][_0x2809('0x1f')]);}_0x17adff[_0x2809('0x3c')]=qs[_0x2809('0x3d')](_0x3ff586[_0x2809('0x34')][_0x2809('0x3d')]);_0x17adff[_0x2809('0x3e')]=qs[_0x2809('0x36')](_[_0x2809('0x3f')](_0x3ff586[_0x2809('0x34')],_0x3544eb[_0x2809('0x36')]),_0x4360d2);if(_0x3ff586[_0x2809('0x34')][_0x2809('0x40')]){_0x17adff[_0x2809('0x3e')]=_[_0x2809('0x41')](_0x17adff['where'],{'$or':_[_0x2809('0x2f')](_0x4360d2,function(_0x401c68){if(_0x401c68[_0x2809('0x31')]!=='VIRTUAL'){var _0x4a1f39={};_0x4a1f39[_0x401c68[_0x2809('0x2d')]]={'$like':'%'+_0x3ff586[_0x2809('0x34')][_0x2809('0x40')]+'%'};return _0x4a1f39;}})});}_0x17adff=_[_0x2809('0x41')]({},_0x17adff,_0x3ff586[_0x2809('0x42')]);var _0x5104f6={'where':_0x17adff[_0x2809('0x3e')]};return db[_0x2809('0x30')]['count'](_0x5104f6)[_0x2809('0x28')](function(_0x202d19){_0x5d4ff2[_0x2809('0x22')]=_0x202d19;if(_0x3ff586['query'][_0x2809('0x43')]){_0x17adff[_0x2809('0x44')]=[{'all':!![]}];}return db[_0x2809('0x30')]['findAll'](_0x17adff);})['then'](function(_0x5057ff){_0x5d4ff2['rows']=_0x5057ff;return _0x5d4ff2;})[_0x2809('0x28')](respondWithFilteredResult(_0x13e67b,_0x17adff))['catch'](handleError(_0x13e67b,null));};exports[_0x2809('0x45')]=function(_0x11776d,_0x36c516){var _0x3ce79e={'raw':!![],'where':{'id':_0x11776d[_0x2809('0x46')]['id']}},_0x4e072c={};_0x4e072c[_0x2809('0x33')]=_[_0x2809('0x35')](db[_0x2809('0x30')][_0x2809('0x47')]);_0x4e072c[_0x2809('0x34')]=_[_0x2809('0x35')](_0x11776d[_0x2809('0x34')]);_0x4e072c[_0x2809('0x36')]=_['intersection'](_0x4e072c[_0x2809('0x33')],_0x4e072c[_0x2809('0x34')]);_0x3ce79e[_0x2809('0x38')]=_[_0x2809('0x37')](_0x4e072c[_0x2809('0x33')],qs[_0x2809('0x39')](_0x11776d['query'][_0x2809('0x39')]));_0x3ce79e[_0x2809('0x38')]=_0x3ce79e['attributes']['length']?_0x3ce79e['attributes']:_0x4e072c['model'];if(_0x11776d[_0x2809('0x34')]['includeAll']){_0x3ce79e[_0x2809('0x44')]=[{'all':!![]}];}_0x3ce79e=_['merge']({},_0x3ce79e,_0x11776d[_0x2809('0x42')]);return db[_0x2809('0x30')][_0x2809('0x48')](_0x3ce79e)['then'](handleEntityNotFound(_0x36c516,null))[_0x2809('0x28')](respondWithResult(_0x36c516,null))[_0x2809('0x49')](handleError(_0x36c516,null));};exports[_0x2809('0x4a')]=function(_0x288176,_0x110add){return db[_0x2809('0x30')]['create'](_0x288176[_0x2809('0x4b')],{})['then'](respondWithResult(_0x110add,0xc9))[_0x2809('0x49')](handleError(_0x110add,null));};exports[_0x2809('0x27')]=function(_0x20a81c,_0x3fe8ff){if(_0x20a81c[_0x2809('0x4b')]['id']){delete _0x20a81c[_0x2809('0x4b')]['id'];}return db[_0x2809('0x30')]['find']({'where':{'id':_0x20a81c[_0x2809('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fe8ff,null))[_0x2809('0x28')](saveUpdates(_0x20a81c[_0x2809('0x4b')],null))[_0x2809('0x28')](respondWithResult(_0x3fe8ff,null))[_0x2809('0x49')](handleError(_0x3fe8ff,null));};exports[_0x2809('0x29')]=function(_0x3ad9d8,_0x4ea9a6){return db[_0x2809('0x30')][_0x2809('0x48')]({'where':{'id':_0x3ad9d8['params']['id']}})[_0x2809('0x28')](handleEntityNotFound(_0x4ea9a6,null))['then'](removeEntity(_0x4ea9a6,null))['catch'](handleError(_0x4ea9a6,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index d22423e..076301a 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 _0xe1bc=['../../config/environment','./smsApplication.attributes','exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x20fcf2,_0x32ca81){var _0x40d150=function(_0x123b5f){while(--_0x123b5f){_0x20fcf2['push'](_0x20fcf2['shift']());}};_0x40d150(++_0x32ca81);}(_0xe1bc,0xf4));var _0xce1b=function(_0xc3b481,_0x1398d1){_0xc3b481=_0xc3b481-0x0;var _0x827af7=_0xe1bc[_0xc3b481];return _0x827af7;};'use strict';var _=require('lodash');var util=require(_0xce1b('0x0'));var logger=require(_0xce1b('0x1'))(_0xce1b('0x2'));var moment=require(_0xce1b('0x3'));var BPromise=require(_0xce1b('0x4'));var rp=require(_0xce1b('0x5'));var fs=require('fs');var path=require(_0xce1b('0x6'));var rimraf=require(_0xce1b('0x7'));var config=require(_0xce1b('0x8'));var attributes=require(_0xce1b('0x9'));module[_0xce1b('0xa')]=function(_0x2700a0,_0x286300){return _0x2700a0['define']('SmsApplication',attributes,{'tableName':_0xce1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xce1b('0xc'),'collate':_0xce1b('0xd')});}; \ No newline at end of file +var _0xf555=['path','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise'];(function(_0x288c1c,_0x583bfe){var _0x1fbb27=function(_0x1ced94){while(--_0x1ced94){_0x288c1c['push'](_0x288c1c['shift']());}};_0x1fbb27(++_0x583bfe);}(_0xf555,0x97));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5f55('0x0'));var util=require(_0x5f55('0x1'));var logger=require('../../config/logger')(_0x5f55('0x2'));var moment=require('moment');var BPromise=require(_0x5f55('0x3'));var rp=require(_0x5f55('0x4'));var fs=require('fs');var path=require(_0x5f55('0x5'));var rimraf=require('rimraf');var config=require(_0x5f55('0x6'));var attributes=require(_0x5f55('0x7'));module['exports']=function(_0x2c6a58,_0x113537){return _0x2c6a58[_0x5f55('0x8')](_0x5f55('0x9'),attributes,{'tableName':_0x5f55('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f55('0xb'),'collate':_0x5f55('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 51659b7..c93f8b4 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 _0xee2c=['jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x814d30,_0x313f75){var _0x1a444c=function(_0x30ce15){while(--_0x30ce15){_0x814d30['push'](_0x814d30['shift']());}};_0x1a444c(++_0x313f75);}(_0xee2c,0x1c7));var _0xcee2=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xee2c[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xcee2('0x0'));var util=require('util');var moment=require(_0xcee2('0x1'));var BPromise=require(_0xcee2('0x2'));var rs=require(_0xcee2('0x3'));var fs=require('fs');var Redis=require(_0xcee2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcee2('0x5'))(_0xcee2('0x6'));var config=require('../../config/environment');var jayson=require(_0xcee2('0x7'));var client=jayson[_0xcee2('0x8')][_0xcee2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d7611,_0x24ce33,_0x5a8219){return new BPromise(function(_0x52a4ac,_0xea6c3c){return client[_0xcee2('0xa')](_0x3d7611,_0x5a8219)[_0xcee2('0xb')](function(_0x23dd44){logger[_0xcee2('0xc')](_0xcee2('0xd'),_0x24ce33,_0xcee2('0xe'));logger[_0xcee2('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x24ce33,_0xcee2('0xe'),JSON[_0xcee2('0x10')](_0x23dd44));if(_0x23dd44[_0xcee2('0x11')]){if(_0x23dd44[_0xcee2('0x11')][_0xcee2('0x12')]===0x1f4){logger['error'](_0xcee2('0xd'),_0x24ce33,_0x23dd44['error']['message']);return _0xea6c3c(_0x23dd44['error'][_0xcee2('0x13')]);}logger[_0xcee2('0x11')](_0xcee2('0xd'),_0x24ce33,_0x23dd44[_0xcee2('0x11')]['message']);return _0x52a4ac(_0x23dd44[_0xcee2('0x11')][_0xcee2('0x13')]);}else{logger[_0xcee2('0xc')](_0xcee2('0xd'),_0x24ce33,_0xcee2('0xe'));_0x52a4ac(_0x23dd44[_0xcee2('0x14')][_0xcee2('0x13')]);}})[_0xcee2('0x15')](function(_0x45c680){logger['error'](_0xcee2('0xd'),_0x24ce33,_0x45c680);_0xea6c3c(_0x45c680);});});} \ No newline at end of file +var _0xb5fb=['request','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x319412,_0x3e5995){var _0x2d78b3=function(_0x295ed6){while(--_0x295ed6){_0x319412['push'](_0x319412['shift']());}};_0x2d78b3(++_0x3e5995);}(_0xb5fb,0x172));var _0xbb5f=function(_0x2ee93b,_0x82445f){_0x2ee93b=_0x2ee93b-0x0;var _0x37c343=_0xb5fb[_0x2ee93b];return _0x37c343;};'use strict';var _=require(_0xbb5f('0x0'));var util=require(_0xbb5f('0x1'));var moment=require(_0xbb5f('0x2'));var BPromise=require(_0xbb5f('0x3'));var rs=require(_0xbb5f('0x4'));var fs=require('fs');var Redis=require(_0xbb5f('0x5'));var db=require(_0xbb5f('0x6'))['db'];var utils=require(_0xbb5f('0x7'));var logger=require(_0xbb5f('0x8'))(_0xbb5f('0x9'));var config=require(_0xbb5f('0xa'));var jayson=require(_0xbb5f('0xb'));var client=jayson[_0xbb5f('0xc')][_0xbb5f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x487a1a,_0x597050,_0x317cd9){return new BPromise(function(_0x5e7943,_0x5b91){return client[_0xbb5f('0xe')](_0x487a1a,_0x317cd9)['then'](function(_0x4f13a9){logger[_0xbb5f('0xf')]('SmsApplication,\x20%s,\x20%s',_0x597050,_0xbb5f('0x10'));logger[_0xbb5f('0x11')](_0xbb5f('0x12'),_0x597050,_0xbb5f('0x10'),JSON[_0xbb5f('0x13')](_0x4f13a9));if(_0x4f13a9[_0xbb5f('0x14')]){if(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x15')]===0x1f4){logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9['error'][_0xbb5f('0x17')]);return _0x5b91(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9[_0xbb5f('0x14')]['message']);return _0x5e7943(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}else{logger[_0xbb5f('0xf')](_0xbb5f('0x16'),_0x597050,'request\x20sent');_0x5e7943(_0x4f13a9['result'][_0xbb5f('0x17')]);}})['catch'](function(_0xdf4ec8){logger[_0xbb5f('0x14')]('SmsApplication,\x20%s,\x20%s',_0x597050,_0xdf4ec8);_0x5b91(_0xdf4ec8);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index a702e3d..f1948d8 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 _0x4fc2=['removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy'];(function(_0x44715f,_0x7e0407){var _0x43c903=function(_0x2921af){while(--_0x2921af){_0x44715f['push'](_0x44715f['shift']());}};_0x43c903(++_0x7e0407);}(_0x4fc2,0x111));var _0x24fc=function(_0x1182bd,_0x52ebf2){_0x1182bd=_0x1182bd-0x0;var _0x5c868b=_0x4fc2[_0x1182bd];return _0x5c868b;};'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')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['show']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['post']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x13')]);router['post'](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')](_0x24fc('0x16'),auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x18')),controller[_0x24fc('0x19')]);router[_0x24fc('0x1a')]('/:id',auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x1b')),controller[_0x24fc('0x1c')]);router[_0x24fc('0x1d')](_0x24fc('0xe'),auth['isAuthenticated'](),interaction[_0x24fc('0x1e')](_0x24fc('0x17'),_0x24fc('0x1f')),controller[_0x24fc('0x20')]);router['delete'](_0x24fc('0x16'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x21')]);module['exports']=router; \ No newline at end of file +var _0x5c00=['smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x5c00,0x17e));var _0x05c0=function(_0x465b0c,_0x569d90){_0x465b0c=_0x465b0c-0x0;var _0x502ff0=_0x5c00[_0x465b0c];return _0x502ff0;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./smsInteraction.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/describe',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/download',auth[_0x05c0('0x9')](),controller['download']);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router['post'](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0xf')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x15')),controller[_0x05c0('0x16')]);router['put'](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x18')),controller[_0x05c0('0x19')]);router[_0x05c0('0x1a')](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction['tracked'](_0x05c0('0x14'),_0x05c0('0x1b')),controller[_0x05c0('0x1c')]);router['delete'](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x1d')]);module[_0x05c0('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 5d33787..c70ac11 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 _0x37c5=['exports','BOOLEAN','DATE','STRING','out','ENUM','moment'];(function(_0x304770,_0x1cc7f6){var _0x78292d=function(_0x4f7a8d){while(--_0x4f7a8d){_0x304770['push'](_0x304770['shift']());}};_0x78292d(++_0x1cc7f6);}(_0x37c5,0xa7));var _0x537c=function(_0x1cc9c0,_0x5e32c3){_0x1cc9c0=_0x1cc9c0-0x0;var _0x1bd5a0=_0x37c5[_0x1cc9c0];return _0x1bd5a0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x537c('0x0'));module[_0x537c('0x1')]={'closed':{'type':Sequelize[_0x537c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x537c('0x3')]},'disposition':{'type':Sequelize[_0x537c('0x4')]},'secondDisposition':{'type':Sequelize[_0x537c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x537c('0x4')]},'note':{'type':Sequelize[_0x537c('0x4')]},'phone':{'type':Sequelize[_0x537c('0x4')]},'read1stAt':{'type':Sequelize[_0x537c('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x537c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x537c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x537c('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x537c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x4819=['out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x404402,_0x3a3c3f){var _0x1df111=function(_0x479bb4){while(--_0x479bb4){_0x404402['push'](_0x404402['shift']());}};_0x1df111(++_0x3a3c3f);}(_0x4819,0xcd));var _0x9481=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x4819[_0x1064bc];return _0x5edc45;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9481('0x0'));module[_0x9481('0x1')]={'closed':{'type':Sequelize[_0x9481('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9481('0x3')]},'disposition':{'type':Sequelize[_0x9481('0x4')]},'secondDisposition':{'type':Sequelize[_0x9481('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9481('0x4')]},'note':{'type':Sequelize[_0x9481('0x4')]},'phone':{'type':Sequelize[_0x9481('0x4')]},'read1stAt':{'type':Sequelize[_0x9481('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9481('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9481('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9481('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 6b13f9e..44904e4 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 _0xd452=['c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','length','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','includeAll','merge','options','create','params','addMessage','SmsMessage','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','ids','omit','spread','emit','smsInteractionTags:save','removeTags','unix','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','CmContact','firstName','Messages','createdAt','secret','SmsAccount','Account','Owner','get','N.A.','closedAt','disposition','out','System','lastName','direction','renderFile','views','transcript-','.pdf','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','Users','map','fullname','TagIds','Tags','forEach','push','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','select','field','color','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xd452,0x98));var _0x2d45=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xd452[_0x3430aa];return _0x2ac5c;};'use strict';var emlformat=require(_0x2d45('0x0'));var rimraf=require(_0x2d45('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d45('0x2'));var rp=require(_0x2d45('0x3'));var moment=require(_0x2d45('0x4'));var BPromise=require(_0x2d45('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2d45('0x6'));var sox=require(_0x2d45('0x7'));var csv=require(_0x2d45('0x8'));var ejs=require(_0x2d45('0x9'));var fs=require('fs');var fs_extra=require(_0x2d45('0xa'));var _=require(_0x2d45('0xb'));var squel=require('squel');var crypto=require(_0x2d45('0xc'));var jsforce=require(_0x2d45('0xd'));var deskjs=require(_0x2d45('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2d45('0xf'));var Papa=require(_0x2d45('0x10'));var Redis=require(_0x2d45('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2d45('0x12'));var as=require(_0x2d45('0x13'));var pdf=require(_0x2d45('0x14'));var hardwareService=require(_0x2d45('0x15'));var logger=require(_0x2d45('0x16'))('api');var utils=require(_0x2d45('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2d45('0x18'));var db=require(_0x2d45('0x19'))['db'];config[_0x2d45('0x1a')]=_[_0x2d45('0x1b')](config[_0x2d45('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d45('0x1c'))(new Redis(config[_0x2d45('0x1a')]));require(_0x2d45('0x1d'))['register'](socket);function respondWithStatusCode(_0x23009d,_0x1df39b){_0x1df39b=_0x1df39b||0xcc;return function(_0x5c7937){if(_0x5c7937){return _0x23009d[_0x2d45('0x1e')](_0x1df39b);}return _0x23009d[_0x2d45('0x1f')](_0x1df39b)[_0x2d45('0x20')]();};}function respondWithResult(_0x3436fa,_0x14b3fa){_0x14b3fa=_0x14b3fa||0xc8;return function(_0x50753a){if(_0x50753a){return _0x3436fa[_0x2d45('0x1f')](_0x14b3fa)[_0x2d45('0x21')](_0x50753a);}};}function respondWithFilteredResult(_0x3735f6,_0x1d15d9){return function(_0x227cab){if(_0x227cab){var _0x1a33e1=typeof _0x1d15d9[_0x2d45('0x22')]===_0x2d45('0x23')&&typeof _0x1d15d9['limit']===_0x2d45('0x23');var _0xd19d72=_0x227cab['count'];var _0x29a324=_0x1a33e1?0x0:_0x1d15d9[_0x2d45('0x22')];var _0x18b9fa=_0x1a33e1?_0x227cab[_0x2d45('0x24')]:_0x1d15d9['offset']+_0x1d15d9[_0x2d45('0x25')];var _0x8065b1;if(_0x18b9fa>=_0xd19d72){_0x18b9fa=_0xd19d72;_0x8065b1=0xc8;}else{_0x8065b1=0xce;}_0x3735f6['status'](_0x8065b1);return _0x3735f6[_0x2d45('0x26')](_0x2d45('0x27'),_0x29a324+'-'+_0x18b9fa+'/'+_0xd19d72)[_0x2d45('0x21')](_0x227cab);}return null;};}function patchUpdates(_0x2ca070){return function(_0x5b9085){try{jsonpatch['apply'](_0x5b9085,_0x2ca070,!![]);}catch(_0x1c50ce){return BPromise[_0x2d45('0x28')](_0x1c50ce);}return _0x5b9085[_0x2d45('0x29')]();};}function saveUpdates(_0x50bf62,_0x344352){return function(_0x4a4a90){if(_0x4a4a90){return _0x4a4a90[_0x2d45('0x2a')](_0x50bf62)[_0x2d45('0x2b')](function(_0x330b35){return _0x330b35;});}return null;};}function removeEntity(_0x2bcffb,_0x33514c){return function(_0x5d0cb8){if(_0x5d0cb8){return _0x5d0cb8[_0x2d45('0x2c')]()[_0x2d45('0x2b')](function(){_0x2bcffb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11eff9,_0x141ce5){return function(_0x4f902e){if(!_0x4f902e){_0x11eff9[_0x2d45('0x1e')](0x194);}return _0x4f902e;};}function handleError(_0x2a91a0,_0x1fa14b){_0x1fa14b=_0x1fa14b||0x1f4;return function(_0x3f3634){logger[_0x2d45('0x2d')](_0x3f3634['stack']);if(_0x3f3634[_0x2d45('0x2e')]){delete _0x3f3634[_0x2d45('0x2e')];}_0x2a91a0['status'](_0x1fa14b)['send'](_0x3f3634);};}function getInteractionUsers(_0x291441,_0x2229e3){return new BPromise(function(_0x4eb58a,_0x59dfd3){try{if(_0x2229e3[_0x291441['id']]){_0x291441[_0x2d45('0x2f')]=_[_0x2d45('0x30')](_0x2229e3[_0x291441['id']],function(_0x4347da){return{'id':_0x4347da['id'],'fullname':_0x4347da[_0x2d45('0x31')]};});}}catch(_0x2f9c78){_0x59dfd3(_0x2f9c78);}_0x4eb58a(_0x291441);});}function getInteractionTags(_0x1c60b1,_0x288b9e){return new BPromise(function(_0xef47ea,_0x2c613f){try{if(_0x1c60b1[_0x2d45('0x32')]){_0x1c60b1[_0x2d45('0x33')]=[];_0x1c60b1[_0x2d45('0x32')]['split'](',')[_0x2d45('0x34')](function(_0x105f82){_0x1c60b1[_0x2d45('0x33')][_0x2d45('0x35')](_0x288b9e[_0x105f82]);});}delete _0x1c60b1[_0x2d45('0x32')];}catch(_0x37f5a7){_0x2c613f(_0x37f5a7);}_0xef47ea(_0x1c60b1);});}function updateSmsInteraction(_0x46d1df,_0x2950e4,_0x18faf0){return new BPromise(function(_0x2fbf38,_0x326fb7){return getInteractionUsers(_0x46d1df,_0x18faf0)[_0x2d45('0x2b')](function(_0x5a31b9){return getInteractionTags(_0x5a31b9,_0x2950e4);})[_0x2d45('0x2b')](function(_0x29c031){_0x2fbf38(_0x29c031);})[_0x2d45('0x36')](function(_0x19646e){_0x326fb7(_0x19646e);});});}exports[_0x2d45('0x37')]=function(_0x29c329,_0x281347){var _0x4b7921={},_0x175aad={},_0x38271b={'count':0x0,'rows':[]};var _0x4cec64=_[_0x2d45('0x30')](db[_0x2d45('0x38')][_0x2d45('0x39')],function(_0x4e4c7a){return{'name':_0x4e4c7a[_0x2d45('0x3a')],'type':_0x4e4c7a[_0x2d45('0x3b')][_0x2d45('0x3c')]};});_0x175aad[_0x2d45('0x3d')]=_[_0x2d45('0x30')](_0x4cec64,'name');_0x175aad['query']=_[_0x2d45('0x3e')](_0x29c329[_0x2d45('0x3f')]);_0x175aad[_0x2d45('0x40')]=_['intersection'](_0x175aad[_0x2d45('0x3d')],_0x175aad[_0x2d45('0x3f')]);_0x4b7921[_0x2d45('0x41')]=_[_0x2d45('0x42')](_0x175aad[_0x2d45('0x3d')],qs[_0x2d45('0x43')](_0x29c329[_0x2d45('0x3f')]['fields']));_0x4b7921[_0x2d45('0x41')]=_0x4b7921[_0x2d45('0x41')]['length']?_0x4b7921[_0x2d45('0x41')]:_0x175aad[_0x2d45('0x3d')];if(!_0x29c329['query']['hasOwnProperty'](_0x2d45('0x44'))){_0x4b7921[_0x2d45('0x25')]=qs[_0x2d45('0x25')](_0x29c329['query'][_0x2d45('0x25')]);_0x4b7921[_0x2d45('0x22')]=qs[_0x2d45('0x22')](_0x29c329[_0x2d45('0x3f')][_0x2d45('0x22')]);}_0x4b7921[_0x2d45('0x45')]=qs[_0x2d45('0x46')](_0x29c329[_0x2d45('0x3f')]['sort']);_0x4b7921[_0x2d45('0x47')]=qs[_0x2d45('0x40')](_['pick'](_0x29c329[_0x2d45('0x3f')],_0x175aad['filters']),_0x4cec64);var _0x4f5d50=[];var _0x63f5ad=squel[_0x2d45('0x48')]()['field']('id')['field']('name')[_0x2d45('0x49')](_0x2d45('0x4a'))[_0x2d45('0x4b')](_0x2d45('0x4c'));var _0x3df094=squel['select']()[_0x2d45('0x49')]('u.id')['field'](_0x2d45('0x4d'))[_0x2d45('0x49')](_0x2d45('0x4e'))['from'](_0x2d45('0x4f'),'ui')[_0x2d45('0x50')](_0x2d45('0x51'),'u',_0x2d45('0x52'));var _0x4d0db1=squel[_0x2d45('0x48')]()['from'](_0x2d45('0x53'),'i')[_0x2d45('0x50')](_0x2d45('0x54'),'c',_0x2d45('0x55'))[_0x2d45('0x50')](_0x2d45('0x51'),'o',_0x2d45('0x56'))[_0x2d45('0x50')](_0x2d45('0x57'),'a',_0x2d45('0x58'))[_0x2d45('0x50')](_0x2d45('0x59'),'me',_0x2d45('0x5a'))[_0x2d45('0x50')](_0x2d45('0x5b'),'it',_0x2d45('0x5c'))[_0x2d45('0x50')](_0x2d45('0x4c'),'t',_0x2d45('0x5d'));var _0x5310aa=squel['expr']();var _0x547d6a=[];var _0x1a009f=squel[_0x2d45('0x5e')]();var _0x57efdf;if(_0x29c329[_0x2d45('0x3f')]['search']){_0x57efdf=as['parseSearch'](_0x29c329[_0x2d45('0x3f')][_0x2d45('0x5f')]);var _0x4a5544=_0x57efdf[_0x2d45('0x60')];for(var _0x288955=0x0;_0x288955<_0x57efdf['conditions'][_0x2d45('0x61')];_0x288955++){var _0x3baa1a=_0x57efdf[_0x2d45('0x62')][_0x288955];var _0x19342f='i';var _0x1b1cd0=_['find'](_0x4cec64,[_0x2d45('0x2e'),_0x3baa1a[_0x2d45('0x49')]]);if(!_0x1b1cd0){switch(_0x3baa1a[_0x2d45('0x49')]){case _0x2d45('0x63'):if(_0x3baa1a[_0x2d45('0x64')]==0x1){_0x4d0db1['having']('`'+_0x3baa1a['field']+_0x2d45('0x65'));}else{_0x4d0db1[_0x2d45('0x66')]('`'+_0x3baa1a[_0x2d45('0x49')]+_0x2d45('0x67'));}break;case _0x2d45('0x68'):if(_0x3baa1a[_0x2d45('0x69')]==='$substring'){if(_0x3baa1a['value']['split']('\x20')['length']>0x1){_0x5310aa[_0x4a5544](_0x2d45('0x6a'),qs[_0x2d45('0x6b')](_0x3baa1a['value']),null);}else{var _0x2aa349='%'+_0x3baa1a['value']+'%';_0x5310aa[_0x4a5544](_0x2d45('0x6c'),_0x2aa349,_0x2aa349,_0x2aa349);}}else{_0x1b1cd0=_[_0x2d45('0x6d')](_0x4cec64,[_0x2d45('0x2e'),'ContactId']);_0x3baa1a[_0x2d45('0x49')]=_0x2d45('0x6e');_0x3284ff=as[_0x2d45('0x6f')](_0x19342f,_0x1b1cd0[_0x2d45('0x3b')],_0x3baa1a);_0x5310aa[_0x4a5544](_0x3284ff[_0x2d45('0x70')],_0x3284ff[_0x2d45('0x64')][_0x2d45('0x71')],_0x3284ff[_0x2d45('0x64')][_0x2d45('0x20')]);}break;case'Tag':var _0xbb8a97=_0x3baa1a[_0x2d45('0x64')][_0x2d45('0x72')](',')['map'](function(_0x3bc562){return Number(_0x3bc562);});_0xbb8a97[_0x2d45('0x34')](function(_0x299e94){_0x1a009f['or'](_0x2d45('0x73'),'%,'+_0x299e94+',%');});_0x547d6a=_[_0x2d45('0x74')](_0x547d6a,_0xbb8a97);break;case _0x2d45('0x75'):if(_0x3baa1a[_0x2d45('0x69')]===_0x2d45('0x76')){_0x5310aa[_0x4a5544](_0x2d45('0x77'),'%'+_0x3baa1a['value']+'%',null);}else{_0x1b1cd0=_['find'](_0x4cec64,[_0x2d45('0x2e'),_0x2d45('0x78')]);_0x3baa1a[_0x2d45('0x49')]=_0x2d45('0x78');_0x3284ff=as[_0x2d45('0x6f')](_0x19342f,_0x1b1cd0['type'],_0x3baa1a);_0x5310aa[_0x4a5544](_0x3284ff['text'],_0x3284ff['value'][_0x2d45('0x71')],_0x3284ff[_0x2d45('0x64')]['end']);}break;case _0x2d45('0x79'):_0x3284ff=as[_0x2d45('0x6f')]('me',null,_0x3baa1a);_0x5310aa[_0x4a5544](_0x3284ff[_0x2d45('0x70')],_0x3284ff['value'][_0x2d45('0x71')],_0x3284ff['value'][_0x2d45('0x20')]);break;}}else{var _0x3284ff=as['buildExpression'](_0x19342f,_0x1b1cd0[_0x2d45('0x3b')],_0x3baa1a);_0x5310aa[_0x4a5544](_0x3284ff[_0x2d45('0x70')],_0x3284ff['value'][_0x2d45('0x71')],_0x3284ff['value'][_0x2d45('0x20')]);}}}else{var _0x5b0d75=_(_0x29c329[_0x2d45('0x3f')])['keys']()[_0x2d45('0x30')](function(_0x1c6882){return _[_0x2d45('0x7a')](_0x4cec64,[_0x2d45('0x2e'),_0x1c6882])?_0x1c6882:undefined;})[_0x2d45('0x7b')]()['value']();if(!_[_0x2d45('0x7c')](_0x5b0d75)){_0x5b0d75[_0x2d45('0x34')](function(_0x469abb){if(_0x469abb===_0x2d45('0x7d')){_0x4d0db1['where']('i.SmsAccountId\x20IN\x20?',[][_0x2d45('0x7e')](_0x29c329['query'][_0x469abb]));}else if(_0x469abb==='createdAt'){var _0x485cf8=JSON[_0x2d45('0x7f')](_0x29c329['query'][_0x469abb])[_0x2d45('0x80')];var _0x1e1e97=JSON[_0x2d45('0x7f')](_0x29c329[_0x2d45('0x3f')][_0x469abb])[_0x2d45('0x81')];_0x4d0db1[_0x2d45('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x485cf8,_0x1e1e97);}else{if(_0x29c329[_0x2d45('0x3f')][_0x469abb]===_0x2d45('0x82')){_0x4d0db1['where']('i.'+_0x469abb+_0x2d45('0x83'));}else{_0x4d0db1[_0x2d45('0x47')]('i.'+_0x469abb+_0x2d45('0x84'),_0x29c329[_0x2d45('0x3f')][_0x469abb]);}}});}if(_0x29c329[_0x2d45('0x3f')]['read']){if(_0x29c329[_0x2d45('0x3f')][_0x2d45('0x85')]==0x1){_0x4d0db1[_0x2d45('0x66')](_0x2d45('0x86'));}else{_0x4d0db1[_0x2d45('0x66')](_0x2d45('0x87'));}}if(_0x29c329[_0x2d45('0x3f')][_0x2d45('0x88')]){_0x547d6a=_[_0x2d45('0x89')](_0x29c329[_0x2d45('0x3f')][_0x2d45('0x88')])?_0x29c329[_0x2d45('0x3f')][_0x2d45('0x88')]:new Array(_0x29c329['query'][_0x2d45('0x88')]);_0x547d6a['forEach'](function(_0x2e9e9a){_0x1a009f['or'](_0x2d45('0x73'),'%,'+_0x2e9e9a+',%');});}if(_0x29c329[_0x2d45('0x3f')][_0x2d45('0x8a')]){var _0x1d36a7=_0x29c329[_0x2d45('0x3f')][_0x2d45('0x8a')]['replace']('\x5c','\x5c\x5c')[_0x2d45('0x8b')](/'/g,'\x27\x27');if(qs[_0x2d45('0x8c')](_0x1d36a7)){_0x5310aa['or'](_0x2d45('0x8d'),_0x1d36a7+'%')['or'](_0x2d45('0x8e'),_0x1d36a7+'%');}else{_0x5310aa['or'](_0x2d45('0x8f'),qs['getFullTextValue'](_0x1d36a7))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1d36a7+'%');}}}_0x4d0db1[_0x2d45('0x47')](_0x5310aa);_0x4d0db1[_0x2d45('0x90')](_0x2d45('0x91'));var _0x32bf5c={'type':db[_0x2d45('0x92')][_0x2d45('0x93')][_0x2d45('0x94')],'raw':!![]};var _0x42383a=_0x4d0db1[_0x2d45('0x95')]();_0x42383a['field']('i.id');_0x42383a[_0x2d45('0x49')](_0x2d45('0x96'),'unreadMessages');if(_0x4b7921[_0x2d45('0x45')]){_0x4b7921[_0x2d45('0x45')][_0x2d45('0x34')](function(_0x54d7ea){var _0x42c2a3=_0x54d7ea[0x0]===_0x2d45('0x97')?_0x54d7ea[0x0]:'i.'+_0x54d7ea[0x0];_0x4d0db1['order'](_0x42c2a3,_0x54d7ea[0x1]===_0x2d45('0x98')?![]:!![]);});}if(!_[_0x2d45('0x7c')](_0x547d6a)){_0x4d0db1[_0x2d45('0x66')](_0x1a009f);_0x42383a['where']('t.id\x20IN\x20?',_0x547d6a);}BPromise[_0x2d45('0x99')]()['then'](function(){if(!_0x57efdf){if(_0x29c329[_0x2d45('0x3f')]['SmsAccountId'])return;_0x42383a[_0x2d45('0x47')](_0x2d45('0x9a'));_0x4d0db1[_0x2d45('0x47')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x29c329[_0x2d45('0x9b')][_0x2d45('0x9c')]!==_0x2d45('0x9d'))return;return _0x29c329['user'][_0x2d45('0x9e')]({'attributes':['id'],'raw':!![]})[_0x2d45('0x2b')](function(_0x529c0f){if(_[_0x2d45('0x7c')](_0x529c0f)){_0x42383a[_0x2d45('0x47')](_0x2d45('0x9f'));_0x4d0db1[_0x2d45('0x47')](_0x2d45('0x9f'));}else{_0x42383a['where'](_0x2d45('0xa0'),_[_0x2d45('0x30')](_0x529c0f,'id'));_0x4d0db1[_0x2d45('0x47')](_0x2d45('0xa0'),_[_0x2d45('0x30')](_0x529c0f,'id'));}});})[_0x2d45('0x2b')](function(){if(_0x29c329['user'][_0x2d45('0x9c')]==='agent'&&!_0x57efdf&&!_0x29c329['query']['SmsAccountId'])return[];return db[_0x2d45('0xa1')][_0x2d45('0x3f')](_0x42383a[_0x2d45('0xa2')](),_0x32bf5c);})['then'](function(_0xc050de){_0x38271b['count']=_0xc050de[_0x2d45('0x61')];if(_0x38271b[_0x2d45('0x24')]===0x0)return[];return db[_0x2d45('0xa1')][_0x2d45('0x3f')](_0x63f5ad[_0x2d45('0xa2')](),_0x32bf5c)[_0x2d45('0x2b')](function(_0xc728f8){_0x4f5d50=_[_0x2d45('0xa3')](_0xc728f8,'id');_0x32bf5c=_['merge'](_0x32bf5c,{'model':db[_0x2d45('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x29c329[_0x2d45('0x3f')][_0x2d45('0x43')]){_0x4b7921[_0x2d45('0x41')][_0x2d45('0x34')](function(_0x3d7129){_0x4d0db1[_0x2d45('0x49')]('i.'+_0x3d7129);});}else{_0x4d0db1[_0x2d45('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2d45('0x63'));_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xa4'),'Account.key');_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xa5'),'Account.mandatoryDisposition');_0x4d0db1[_0x2d45('0x49')]('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',_0x2d45('0x97'));_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xa6'));_0x4d0db1['field'](_0x2d45('0xa7'),'Contact.firstName');_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xa8'),_0x2d45('0xa9'));_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xaa'),_0x2d45('0xab'));_0x4d0db1['field']('c.phone',_0x2d45('0xac'));_0x4d0db1['field'](_0x2d45('0xad'),'Contact.mobile');_0x4d0db1['field'](_0x2d45('0xae'),_0x2d45('0xaf'));_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xb0'),'Owner.fullname');_0x4d0db1[_0x2d45('0x49')]('o.internal','Owner.internal');_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xb1'),'TagIds');}if(_0x4b7921[_0x2d45('0x25')])_0x4d0db1[_0x2d45('0x25')](_0x4b7921[_0x2d45('0x25')]);if(_0x4b7921['offset'])_0x4d0db1['offset'](_0x4b7921[_0x2d45('0x22')]);return db['sequelize'][_0x2d45('0x3f')](_0x4d0db1[_0x2d45('0xa2')](),_0x32bf5c);})['then'](function(_0xeeb5ff){if(_0xeeb5ff['length']>0x0)_0x3df094[_0x2d45('0x47')](_0x2d45('0xb2'),_['map'](_0xeeb5ff,'id'));return db[_0x2d45('0xa1')][_0x2d45('0x3f')](_0x3df094[_0x2d45('0xa2')](),_0x32bf5c)[_0x2d45('0x2b')](function(_0xf881ab){var _0x35c0fd=_[_0x2d45('0xb3')](_0xf881ab,_0x2d45('0xb4'));var _0x3bffb3=[];_0xeeb5ff['forEach'](function(_0x6156a9){_0x3bffb3[_0x2d45('0x35')](updateSmsInteraction(_0x6156a9,_0x4f5d50,_0x35c0fd));});return BPromise[_0x2d45('0xb5')](_0x3bffb3);});});})[_0x2d45('0x2b')](function(_0x5776fb){_0x38271b[_0x2d45('0xb6')]=_0x5776fb;return _0x38271b;})['then'](respondWithFilteredResult(_0x281347,_0x4b7921))['catch'](handleError(_0x281347,null));};exports[_0x2d45('0xb7')]=function(_0x5c5e15,_0x228fb5){var _0x3c47e4={'raw':![],'where':{'id':_0x5c5e15['params']['id']}},_0x55c843={};_0x55c843[_0x2d45('0x3d')]=_[_0x2d45('0x3e')](db[_0x2d45('0x38')]['rawAttributes']);_0x55c843[_0x2d45('0x3f')]=_['keys'](_0x5c5e15[_0x2d45('0x3f')]);_0x55c843['filters']=_[_0x2d45('0x42')](_0x55c843[_0x2d45('0x3d')],_0x55c843[_0x2d45('0x3f')]);_0x3c47e4[_0x2d45('0x41')]=_[_0x2d45('0x42')](_0x55c843['model'],qs[_0x2d45('0x43')](_0x5c5e15[_0x2d45('0x3f')]['fields']));_0x3c47e4['attributes']=_0x3c47e4['attributes'][_0x2d45('0x61')]?_0x3c47e4[_0x2d45('0x41')]:_0x55c843[_0x2d45('0x3d')];if(_0x5c5e15['query'][_0x2d45('0xb8')]){_0x3c47e4['include']=[{'all':!![]}];}_0x3c47e4=_[_0x2d45('0xb9')]({},_0x3c47e4,_0x5c5e15[_0x2d45('0xba')]);return db[_0x2d45('0x38')]['find'](_0x3c47e4)['then'](handleEntityNotFound(_0x228fb5,null))[_0x2d45('0x2b')](respondWithResult(_0x228fb5,null))[_0x2d45('0x36')](handleError(_0x228fb5,null));};exports[_0x2d45('0xbb')]=function(_0xe3ad2e,_0x145f0f){return db[_0x2d45('0x38')]['create'](_0xe3ad2e[_0x2d45('0x79')],{})['then'](respondWithResult(_0x145f0f,0xc9))[_0x2d45('0x36')](handleError(_0x145f0f,null));};exports[_0x2d45('0x2a')]=function(_0x12ca57,_0xad4727){if(_0x12ca57['body']['id']){delete _0x12ca57[_0x2d45('0x79')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x12ca57['params']['id']}})[_0x2d45('0x2b')](handleEntityNotFound(_0xad4727,null))['then'](saveUpdates(_0x12ca57['body'],null))[_0x2d45('0x2b')](respondWithResult(_0xad4727,null))[_0x2d45('0x36')](handleError(_0xad4727,null));};exports['destroy']=function(_0x267791,_0x4c2627){return db[_0x2d45('0x38')]['find']({'where':{'id':_0x267791[_0x2d45('0xbc')]['id']}})[_0x2d45('0x2b')](handleEntityNotFound(_0x4c2627,null))['then'](removeEntity(_0x4c2627,null))[_0x2d45('0x36')](handleError(_0x4c2627,null));};exports['describe']=function(_0x3a92bc,_0x1c4574){return db[_0x2d45('0x38')]['describe']()['then'](respondWithResult(_0x1c4574,null))[_0x2d45('0x36')](handleError(_0x1c4574,null));};exports[_0x2d45('0xbd')]=function(_0x382c1c,_0x226b54,_0x1711c2){return db[_0x2d45('0xbe')][_0x2d45('0x6d')]({'where':{'id':_0x382c1c[_0x2d45('0xbc')]['id']}})[_0x2d45('0x2b')](handleEntityNotFound(_0x226b54,null))['then'](function(_0x199bd2){if(_0x199bd2){return _0x199bd2[_0x2d45('0xbd')](_0x382c1c['body']['ids'],_['omit'](_0x382c1c[_0x2d45('0x79')],['ids','id'])||{});}})[_0x2d45('0x2b')](respondWithResult(_0x226b54,null))[_0x2d45('0x36')](handleError(_0x226b54,null));};exports[_0x2d45('0xbf')]=function(_0x200cf4,_0x5d7e3e,_0x4dfaaf){var _0x4a41d8={'raw':![],'where':{}};var _0x436837={};var _0x420059={'count':0x0,'rows':[]};return db[_0x2d45('0x38')][_0x2d45('0xc0')]({'where':{'id':_0x200cf4[_0x2d45('0xbc')]['id']}})['then'](handleEntityNotFound(_0x5d7e3e,null))['then'](function(_0x4b3ec9){if(_0x4b3ec9){_0x436837[_0x2d45('0x3d')]=_[_0x2d45('0x3e')](db[_0x2d45('0xbe')]['rawAttributes']);_0x436837[_0x2d45('0x3f')]=_[_0x2d45('0x3e')](_0x200cf4[_0x2d45('0x3f')]);_0x436837[_0x2d45('0x40')]=_['intersection'](_0x436837[_0x2d45('0x3d')],_0x436837[_0x2d45('0x3f')]);_0x4a41d8[_0x2d45('0x41')]=_[_0x2d45('0x42')](_0x436837['model'],qs[_0x2d45('0x43')](_0x200cf4['query'][_0x2d45('0x43')]));_0x4a41d8[_0x2d45('0x41')]=_0x4a41d8[_0x2d45('0x41')]['length']?_0x4a41d8[_0x2d45('0x41')]:_0x436837[_0x2d45('0x3d')];if(!_0x200cf4['query']['hasOwnProperty']('nolimit')){_0x4a41d8[_0x2d45('0x25')]=qs['limit'](_0x200cf4[_0x2d45('0x3f')][_0x2d45('0x25')]);_0x4a41d8[_0x2d45('0x22')]=qs[_0x2d45('0x22')](_0x200cf4['query'][_0x2d45('0x22')]);}_0x4a41d8[_0x2d45('0x45')]=qs[_0x2d45('0x46')](_0x200cf4['query'][_0x2d45('0x46')]);_0x4a41d8[_0x2d45('0x47')]=qs[_0x2d45('0x40')](_['pick'](_0x200cf4[_0x2d45('0x3f')],_0x436837['filters']));_0x4a41d8[_0x2d45('0x47')]['SmsInteractionId']=_0x4b3ec9['id'];if(_0x200cf4[_0x2d45('0x3f')][_0x2d45('0x8a')]){_0x4a41d8[_0x2d45('0x47')]=_[_0x2d45('0xb9')](_0x4a41d8[_0x2d45('0x47')],{'$or':_[_0x2d45('0x30')](_0x4a41d8[_0x2d45('0x41')],function(_0x48c8cc){var _0x3ae6ea={};_0x3ae6ea[_0x48c8cc]={'$like':'%'+_0x200cf4[_0x2d45('0x3f')][_0x2d45('0x8a')]+'%'};return _0x3ae6ea;})});}if(_0x200cf4[_0x2d45('0x3f')][_0x2d45('0x80')]){var _0x360177=_0x200cf4[_0x2d45('0x3f')][_0x2d45('0x80')]['split'](',');var _0xf2ec9d={};_0xf2ec9d[_0x360177[0x0]]={'$gte':moment(_0x360177[0x1])['format'](_0x2d45('0xc1'))};_0x4a41d8[_0x2d45('0x47')]=_[_0x2d45('0xb9')](_0x4a41d8[_0x2d45('0x47')],_0xf2ec9d);}_0x4a41d8=_[_0x2d45('0xb9')]({},_0x4a41d8,_0x200cf4[_0x2d45('0xba')]);return db[_0x2d45('0xbe')][_0x2d45('0x24')]({'where':_0x4a41d8['where']})['then'](function(_0x59eb75){_0x420059[_0x2d45('0x24')]=_0x59eb75;if(_0x200cf4[_0x2d45('0x3f')]['includeAll']){_0x4a41d8[_0x2d45('0xc2')]=[{'all':!![]}];}return db[_0x2d45('0xbe')][_0x2d45('0xc3')](_0x4a41d8);})['then'](function(_0x1a9b7f){_0x420059['rows']=_0x1a9b7f;return _0x420059;});}})[_0x2d45('0x2b')](respondWithFilteredResult(_0x5d7e3e,_0x4a41d8))['catch'](handleError(_0x5d7e3e,null));};exports[_0x2d45('0xc4')]=function(_0x162d66,_0x359be2,_0x1a2535){return db['SmsInteraction'][_0x2d45('0x6d')]({'where':{'id':_0x162d66[_0x2d45('0xbc')]['id']}})[_0x2d45('0x2b')](handleEntityNotFound(_0x359be2,null))[_0x2d45('0x2b')](function(_0x2cf8e9){if(_0x2cf8e9){return _0x2cf8e9[_0x2d45('0xc5')](_0x162d66[_0x2d45('0x79')][_0x2d45('0xc6')],_[_0x2d45('0xc7')](_0x162d66[_0x2d45('0x79')],[_0x2d45('0xc6'),'id'])||{})[_0x2d45('0xc8')](function(){return db['Tag'][_0x2d45('0xc3')]({'attributes':['id','name','color'],'where':{'id':_0x162d66[_0x2d45('0x79')]['ids']}});})[_0x2d45('0x2b')](function(_0xb65888){socket[_0x2d45('0xc9')](_0x2d45('0xca'),{'id':Number(_0x162d66[_0x2d45('0xbc')]['id']),'tags':_0xb65888||[]});return{'id':Number(_0x162d66['params']['id']),'tags':_0xb65888||[]};});}})['then'](respondWithResult(_0x359be2,null))[_0x2d45('0x36')](handleError(_0x359be2,null));};exports[_0x2d45('0xcb')]=function(_0x2e0d41,_0x1707bb,_0x5ae8af){return db[_0x2d45('0x38')][_0x2d45('0x6d')]({'where':{'id':_0x2e0d41[_0x2d45('0xbc')]['id']}})['then'](handleEntityNotFound(_0x1707bb,null))['then'](function(_0x19229a){if(_0x19229a){return _0x19229a[_0x2d45('0xcb')](_0x2e0d41[_0x2d45('0x3f')][_0x2d45('0xc6')]);}})[_0x2d45('0x2b')](respondWithStatusCode(_0x1707bb,null))['catch'](handleError(_0x1707bb,null));};exports['download']=function(_0x1e1fe4,_0x49c2c3){var _0x3959c9=moment()[_0x2d45('0xcc')]()[_0x2d45('0xa2')]();var _0x3ce804=path[_0x2d45('0xcd')](config[_0x2d45('0xce')],_0x2d45('0xcf'),'files',_0x2d45('0xd0'));var _0x548d03=path[_0x2d45('0xcd')](config[_0x2d45('0xce')],_0x2d45('0xcf'),_0x2d45('0xd1'),_0x2d45('0xd2'));var _0x431d03=path[_0x2d45('0xcd')](_0x3ce804,_0x3959c9);var _0x3389b0=util[_0x2d45('0xd3')](_0x2d45('0xd4'),_0x1e1fe4[_0x2d45('0xbc')]['id'],_0x3959c9);var _0x6001ad=path[_0x2d45('0xcd')](_0x3ce804,_0x3389b0);var _0xf9541e=[];_0xf9541e['push']({'model':db[_0x2d45('0x75')],'as':_0x2d45('0x75'),'attributes':['id',_0x2d45('0x31')],'raw':!![]});_0xf9541e[_0x2d45('0x35')]({'model':db[_0x2d45('0xd5')],'as':_0x2d45('0x68'),'attributes':['id',_0x2d45('0xd6'),'lastName'],'raw':!![]});var _0x33b01f=[{'model':db[_0x2d45('0xbe')],'as':_0x2d45('0xd7'),'attributes':['id',_0x2d45('0x79'),_0x2d45('0xd8'),'direction',_0x2d45('0xd9'),_0x2d45('0x85')],'include':_0xf9541e}];_0x33b01f[_0x2d45('0x35')]({'model':db[_0x2d45('0xda')],'as':_0x2d45('0xdb'),'attributes':['id','name']});_0x33b01f[_0x2d45('0x35')]({'model':db['User'],'as':_0x2d45('0xdc'),'attributes':['id','fullname']});return db[_0x2d45('0x38')][_0x2d45('0x6d')]({'where':{'id':_0x1e1fe4[_0x2d45('0xbc')]['id']},'include':_0x33b01f})['then'](handleEntityNotFound(_0x49c2c3,null))[_0x2d45('0x2b')](function(_0x2afdf0){if(_0x2afdf0){var _0x56abfb=_0x2afdf0[_0x2d45('0xdd')]({'plain':!![]});fs['mkdirSync'](_0x431d03);var _0x32f3f1={'channel':'Sms','account':_0x56abfb['Account'][_0x2d45('0x2e')],'agent':_0x56abfb[_0x2d45('0xdc')]?_0x56abfb[_0x2d45('0xdc')][_0x2d45('0x31')]:_0x2d45('0xde'),'createdAt':moment(_0x56abfb[_0x2d45('0xd8')])[_0x2d45('0xd3')](_0x2d45('0xc1'))[_0x2d45('0xa2')](),'closedAt':_0x56abfb['closed']?moment(_0x56abfb[_0x2d45('0xdf')])[_0x2d45('0xd3')](_0x2d45('0xc1'))[_0x2d45('0xa2')]():'','disposition':_0x56abfb[_0x2d45('0xe0')],'messages':_(_0x56abfb[_0x2d45('0xd7')])[_0x2d45('0x8a')]({'secret':![]})[_0x2d45('0x30')](function(_0x22c9c3){return{'date':moment(_0x22c9c3[_0x2d45('0xd8')])[_0x2d45('0xd3')](_0x2d45('0xc1'))[_0x2d45('0xa2')](),'sender':_0x22c9c3['direction']===_0x2d45('0xe1')?_0x22c9c3['User']?_0x22c9c3[_0x2d45('0x75')][_0x2d45('0x31')]:_0x2d45('0xe2'):_0x22c9c3[_0x2d45('0x68')]['firstName']+(_0x22c9c3['Contact'][_0x2d45('0xe3')]?'\x20'+_0x22c9c3['Contact']['lastName']:''),'body':_0x22c9c3[_0x2d45('0x79')],'direction':_0x22c9c3[_0x2d45('0xe4')]===_0x2d45('0xe1')?'A':'C','secret':_0x22c9c3[_0x2d45('0xd9')],'read':_0x22c9c3[_0x2d45('0x85')]};})['value']()};return ejs[_0x2d45('0xe5')](path[_0x2d45('0xcd')](config[_0x2d45('0xce')],'server',_0x2d45('0xe6'),'downloadInteraction.ejs'),{'interaction':_0x32f3f1})['then'](function(_0xb81d75){var _0x428f52=path['join'](_0x431d03,_0x2d45('0xe7')+_0x56abfb['id']+'-'+_0x3959c9+_0x2d45('0xe8'));var _0x2f151f={'path':_0x428f52,'channel':'Sms','interactionId':_0x56abfb['id']};return pdf['createPdfFromHTML'](_0xb81d75,_0x2f151f);})[_0x2d45('0x2b')](function(){return new BPromise(function(_0x2a1ed5,_0x54624c){zipdir(_0x431d03,{'saveTo':_0x6001ad},function(_0x5eb386,_0x229dc5){if(_0x5eb386)return _0x54624c(_0x5eb386);return _0x2a1ed5(_0x229dc5);});})[_0x2d45('0x2b')](function(){return new BPromise(function(_0x4896e5,_0x3d2cc8){rimraf(_0x431d03,function(_0x5c397f){if(_0x5c397f)_0x3d2cc8(_0x5c397f);return _0x4896e5();});});})[_0x2d45('0x2b')](function(){return _0x49c2c3[_0x2d45('0xe9')](_0x6001ad,_0x3389b0,function(_0x3bf958){if(_0x3bf958){console[_0x2d45('0xea')](_0x2d45('0xeb'),_0x3bf958);}else{fs[_0x2d45('0xec')](_0x6001ad);}});});});}else{return _0x49c2c3[_0x2d45('0x1e')](0xc8);}})['catch'](handleError(_0x49c2c3,null));}; \ No newline at end of file +var _0x791b=['../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','sms_accounts','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','createdAt','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','agent','toString','count','sequelize','keyBy','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','all','rows','show','includeAll','include','options','create','body','update','params','describe','addMessage','SmsMessage','ids','omit','SmsInteractionId','format','findAll','addTags','setTags','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','User','Messages','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','firstName','lastName','renderFile','views','downloadInteraction.ejs','transcript-','unlinkSync','eml-format','zip-dir','mustache','util','path','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x55cc98,_0x25441d){var _0x16d656=function(_0x25eef8){while(--_0x25eef8){_0x55cc98['push'](_0x55cc98['shift']());}};_0x16d656(++_0x25441d);}(_0x791b,0xcb));var _0xb791=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x791b[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xb791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb791('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb791('0x2'));var util=require(_0xb791('0x3'));var path=require(_0xb791('0x4'));var sox=require(_0xb791('0x5'));var csv=require(_0xb791('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb791('0x7'));var squel=require('squel');var crypto=require(_0xb791('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb791('0x6'));var querystring=require(_0xb791('0x9'));var Papa=require(_0xb791('0xa'));var Redis=require(_0xb791('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xb791('0xc'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xb791('0xd'));var logger=require(_0xb791('0xe'))(_0xb791('0xf'));var utils=require(_0xb791('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xb791('0x11'));var db=require(_0xb791('0x12'))['db'];config[_0xb791('0x13')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb791('0x14'))(new Redis(config[_0xb791('0x13')]));require('./smsInteraction.socket')[_0xb791('0x15')](socket);function respondWithStatusCode(_0x54b8b8,_0x278949){_0x278949=_0x278949||0xcc;return function(_0x1e1ad8){if(_0x1e1ad8){return _0x54b8b8[_0xb791('0x16')](_0x278949);}return _0x54b8b8[_0xb791('0x17')](_0x278949)[_0xb791('0x18')]();};}function respondWithResult(_0x3cebdb,_0x1cadf6){_0x1cadf6=_0x1cadf6||0xc8;return function(_0x2b5290){if(_0x2b5290){return _0x3cebdb[_0xb791('0x17')](_0x1cadf6)[_0xb791('0x19')](_0x2b5290);}};}function respondWithFilteredResult(_0xc59b66,_0x50d393){return function(_0x1dfce9){if(_0x1dfce9){var _0x36a9fe=typeof _0x50d393[_0xb791('0x1a')]===_0xb791('0x1b')&&typeof _0x50d393[_0xb791('0x1c')]===_0xb791('0x1b');var _0x550a79=_0x1dfce9['count'];var _0xc8e5e2=_0x36a9fe?0x0:_0x50d393[_0xb791('0x1a')];var _0x41f706=_0x36a9fe?_0x1dfce9['count']:_0x50d393[_0xb791('0x1a')]+_0x50d393[_0xb791('0x1c')];var _0x2d0088;if(_0x41f706>=_0x550a79){_0x41f706=_0x550a79;_0x2d0088=0xc8;}else{_0x2d0088=0xce;}_0xc59b66[_0xb791('0x17')](_0x2d0088);return _0xc59b66[_0xb791('0x1d')](_0xb791('0x1e'),_0xc8e5e2+'-'+_0x41f706+'/'+_0x550a79)[_0xb791('0x19')](_0x1dfce9);}return null;};}function patchUpdates(_0x2450bd){return function(_0x43624b){try{jsonpatch[_0xb791('0x1f')](_0x43624b,_0x2450bd,!![]);}catch(_0x7b01a4){return BPromise[_0xb791('0x20')](_0x7b01a4);}return _0x43624b[_0xb791('0x21')]();};}function saveUpdates(_0x1cdb17,_0x2c8a88){return function(_0x137575){if(_0x137575){return _0x137575['update'](_0x1cdb17)['then'](function(_0x3c7627){return _0x3c7627;});}return null;};}function removeEntity(_0x280384,_0x5c8d4f){return function(_0x3616fa){if(_0x3616fa){return _0x3616fa[_0xb791('0x22')]()[_0xb791('0x23')](function(){_0x280384[_0xb791('0x17')](0xcc)[_0xb791('0x18')]();});}};}function handleEntityNotFound(_0x3ef842,_0x1e0050){return function(_0x2706fe){if(!_0x2706fe){_0x3ef842[_0xb791('0x16')](0x194);}return _0x2706fe;};}function handleError(_0x35605d,_0x3e5ed0){_0x3e5ed0=_0x3e5ed0||0x1f4;return function(_0x1984b9){logger[_0xb791('0x24')](_0x1984b9[_0xb791('0x25')]);if(_0x1984b9[_0xb791('0x26')]){delete _0x1984b9['name'];}_0x35605d[_0xb791('0x17')](_0x3e5ed0)[_0xb791('0x27')](_0x1984b9);};}function getInteractionUsers(_0x23a14c,_0x5061f7){return new BPromise(function(_0x538a23,_0x392be5){try{if(_0x5061f7[_0x23a14c['id']]){_0x23a14c[_0xb791('0x28')]=_[_0xb791('0x29')](_0x5061f7[_0x23a14c['id']],function(_0x204b7b){return{'id':_0x204b7b['id'],'fullname':_0x204b7b[_0xb791('0x2a')]};});}}catch(_0x52b474){_0x392be5(_0x52b474);}_0x538a23(_0x23a14c);});}function getInteractionTags(_0x2cc187,_0x4c4766){return new BPromise(function(_0x3fddb9,_0x366220){try{if(_0x2cc187['TagIds']){_0x2cc187[_0xb791('0x2b')]=[];_0x2cc187[_0xb791('0x2c')][_0xb791('0x2d')](',')[_0xb791('0x2e')](function(_0x46f714){_0x2cc187['Tags'][_0xb791('0x2f')](_0x4c4766[_0x46f714]);});}delete _0x2cc187[_0xb791('0x2c')];}catch(_0x308794){_0x366220(_0x308794);}_0x3fddb9(_0x2cc187);});}function updateSmsInteraction(_0x141aa5,_0xd117aa,_0x4c212b){return new BPromise(function(_0x503e7a,_0x4538d7){return getInteractionUsers(_0x141aa5,_0x4c212b)[_0xb791('0x23')](function(_0x3a4b69){return getInteractionTags(_0x3a4b69,_0xd117aa);})[_0xb791('0x23')](function(_0x38af15){_0x503e7a(_0x38af15);})[_0xb791('0x30')](function(_0x2859d0){_0x4538d7(_0x2859d0);});});}exports['index']=function(_0x224d59,_0x2e7be9){var _0x26d1c7={},_0x6c77b3={},_0x43a271={'count':0x0,'rows':[]};var _0x388187=_[_0xb791('0x29')](db['SmsInteraction'][_0xb791('0x31')],function(_0x10e1ad){return{'name':_0x10e1ad[_0xb791('0x32')],'type':_0x10e1ad['type'][_0xb791('0x33')]};});_0x6c77b3[_0xb791('0x34')]=_[_0xb791('0x29')](_0x388187,_0xb791('0x26'));_0x6c77b3[_0xb791('0x35')]=_[_0xb791('0x36')](_0x224d59[_0xb791('0x35')]);_0x6c77b3[_0xb791('0x37')]=_[_0xb791('0x38')](_0x6c77b3[_0xb791('0x34')],_0x6c77b3['query']);_0x26d1c7[_0xb791('0x39')]=_['intersection'](_0x6c77b3['model'],qs[_0xb791('0x3a')](_0x224d59[_0xb791('0x35')][_0xb791('0x3a')]));_0x26d1c7[_0xb791('0x39')]=_0x26d1c7['attributes'][_0xb791('0x3b')]?_0x26d1c7[_0xb791('0x39')]:_0x6c77b3[_0xb791('0x34')];if(!_0x224d59[_0xb791('0x35')][_0xb791('0x3c')](_0xb791('0x3d'))){_0x26d1c7[_0xb791('0x1c')]=qs[_0xb791('0x1c')](_0x224d59[_0xb791('0x35')][_0xb791('0x1c')]);_0x26d1c7[_0xb791('0x1a')]=qs['offset'](_0x224d59[_0xb791('0x35')]['offset']);}_0x26d1c7[_0xb791('0x3e')]=qs[_0xb791('0x3f')](_0x224d59['query'][_0xb791('0x3f')]);_0x26d1c7[_0xb791('0x40')]=qs[_0xb791('0x37')](_[_0xb791('0x41')](_0x224d59[_0xb791('0x35')],_0x6c77b3[_0xb791('0x37')]),_0x388187);var _0x3f4f0e=[];var _0x2f7174=squel[_0xb791('0x42')]()[_0xb791('0x43')]('id')[_0xb791('0x43')](_0xb791('0x26'))[_0xb791('0x43')](_0xb791('0x44'))['from']('tools_tags');var _0x71380c=squel[_0xb791('0x42')]()[_0xb791('0x43')]('u.id')[_0xb791('0x43')](_0xb791('0x45'))[_0xb791('0x43')](_0xb791('0x46'))[_0xb791('0x47')](_0xb791('0x48'),'ui')[_0xb791('0x49')](_0xb791('0x4a'),'u','u.id\x20=\x20ui.UserId');var _0x3ad3f4=squel[_0xb791('0x42')]()[_0xb791('0x47')](_0xb791('0x4b'),'i')[_0xb791('0x49')](_0xb791('0x4c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb791('0x49')]('users','o','o.id\x20=\x20i.UserId')[_0xb791('0x49')](_0xb791('0x4d'),'a','a.id\x20=\x20i.SmsAccountId')['left_join']('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0xb791('0x4e'),'it',_0xb791('0x4f'))['left_join'](_0xb791('0x50'),'t','t.id\x20=\x20it.TagId');var _0x459f68=squel[_0xb791('0x51')]();var _0x20ab27=[];var _0x549106=squel[_0xb791('0x51')]();var _0xf2d0b7;if(_0x224d59[_0xb791('0x35')][_0xb791('0x52')]){_0xf2d0b7=as['parseSearch'](_0x224d59[_0xb791('0x35')][_0xb791('0x52')]);var _0x2ae25e=_0xf2d0b7[_0xb791('0x53')];for(var _0x223519=0x0;_0x223519<_0xf2d0b7[_0xb791('0x54')][_0xb791('0x3b')];_0x223519++){var _0x37f638=_0xf2d0b7['conditions'][_0x223519];var _0x588b63='i';var _0x96e47c=_[_0xb791('0x55')](_0x388187,[_0xb791('0x26'),_0x37f638[_0xb791('0x43')]]);if(!_0x96e47c){switch(_0x37f638[_0xb791('0x43')]){case _0xb791('0x56'):if(_0x37f638['value']==0x1){_0x3ad3f4['having']('`'+_0x37f638[_0xb791('0x43')]+_0xb791('0x57'));}else{_0x3ad3f4[_0xb791('0x58')]('`'+_0x37f638[_0xb791('0x43')]+'`\x20>\x200');}break;case _0xb791('0x59'):if(_0x37f638[_0xb791('0x5a')]==='$substring'){if(_0x37f638[_0xb791('0x5b')][_0xb791('0x2d')]('\x20')[_0xb791('0x3b')]>0x1){_0x459f68[_0x2ae25e](_0xb791('0x5c'),qs[_0xb791('0x5d')](_0x37f638['value']),null);}else{var _0x235d62='%'+_0x37f638[_0xb791('0x5b')]+'%';_0x459f68[_0x2ae25e](_0xb791('0x5e'),_0x235d62,_0x235d62,_0x235d62);}}else{_0x96e47c=_[_0xb791('0x55')](_0x388187,[_0xb791('0x26'),_0xb791('0x5f')]);_0x37f638[_0xb791('0x43')]=_0xb791('0x5f');_0x5020db=as['buildExpression'](_0x588b63,_0x96e47c[_0xb791('0x60')],_0x37f638);_0x459f68[_0x2ae25e](_0x5020db[_0xb791('0x61')],_0x5020db[_0xb791('0x5b')][_0xb791('0x62')],_0x5020db[_0xb791('0x5b')][_0xb791('0x18')]);}break;case _0xb791('0x63'):var _0x4dc651=_0x37f638[_0xb791('0x5b')]['split'](',')[_0xb791('0x29')](function(_0x22b346){return Number(_0x22b346);});_0x4dc651[_0xb791('0x2e')](function(_0x5a0e7b){_0x549106['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5a0e7b+',%');});_0x20ab27=_[_0xb791('0x64')](_0x20ab27,_0x4dc651);break;case'User':if(_0x37f638['operator']==='$substring'){_0x459f68[_0x2ae25e](_0xb791('0x65'),'%'+_0x37f638[_0xb791('0x5b')]+'%',null);}else{_0x96e47c=_[_0xb791('0x55')](_0x388187,['name',_0xb791('0x66')]);_0x37f638[_0xb791('0x43')]='UserId';_0x5020db=as[_0xb791('0x67')](_0x588b63,_0x96e47c[_0xb791('0x60')],_0x37f638);_0x459f68[_0x2ae25e](_0x5020db[_0xb791('0x61')],_0x5020db['value']['start'],_0x5020db['value']['end']);}break;case'body':_0x5020db=as[_0xb791('0x67')]('me',null,_0x37f638);_0x459f68[_0x2ae25e](_0x5020db[_0xb791('0x61')],_0x5020db[_0xb791('0x5b')][_0xb791('0x62')],_0x5020db[_0xb791('0x5b')][_0xb791('0x18')]);break;}}else{var _0x5020db=as[_0xb791('0x67')](_0x588b63,_0x96e47c['type'],_0x37f638);_0x459f68[_0x2ae25e](_0x5020db[_0xb791('0x61')],_0x5020db[_0xb791('0x5b')][_0xb791('0x62')],_0x5020db[_0xb791('0x5b')][_0xb791('0x18')]);}}}else{var _0x2dae87=_(_0x224d59[_0xb791('0x35')])['keys']()['map'](function(_0x1bbb05){return _[_0xb791('0x68')](_0x388187,['name',_0x1bbb05])?_0x1bbb05:undefined;})[_0xb791('0x69')]()[_0xb791('0x5b')]();if(!_[_0xb791('0x6a')](_0x2dae87)){_0x2dae87[_0xb791('0x2e')](function(_0x6eadd3){if(_0x6eadd3==='SmsAccountId'){_0x3ad3f4[_0xb791('0x40')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x224d59[_0xb791('0x35')][_0x6eadd3]));}else if(_0x6eadd3===_0xb791('0x6b')){var _0x293ce1=JSON[_0xb791('0x6c')](_0x224d59['query'][_0x6eadd3])[_0xb791('0x6d')];var _0x59121e=JSON['parse'](_0x224d59[_0xb791('0x35')][_0x6eadd3])[_0xb791('0x6e')];_0x3ad3f4[_0xb791('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x293ce1,_0x59121e);}else{if(_0x224d59[_0xb791('0x35')][_0x6eadd3]===_0xb791('0x6f')){_0x3ad3f4['where']('i.'+_0x6eadd3+'\x20IS\x20NULL');}else{_0x3ad3f4[_0xb791('0x40')]('i.'+_0x6eadd3+_0xb791('0x70'),_0x224d59[_0xb791('0x35')][_0x6eadd3]);}}});}if(_0x224d59[_0xb791('0x35')]['read']){if(_0x224d59[_0xb791('0x35')][_0xb791('0x71')]==0x1){_0x3ad3f4[_0xb791('0x58')](_0xb791('0x72'));}else{_0x3ad3f4['having'](_0xb791('0x73'));}}if(_0x224d59['query'][_0xb791('0x74')]){_0x20ab27=_[_0xb791('0x75')](_0x224d59[_0xb791('0x35')]['tag'])?_0x224d59[_0xb791('0x35')][_0xb791('0x74')]:new Array(_0x224d59['query'][_0xb791('0x74')]);_0x20ab27[_0xb791('0x2e')](function(_0x212e87){_0x549106['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x212e87+',%');});}if(_0x224d59['query'][_0xb791('0x76')]){var _0x409774=_0x224d59[_0xb791('0x35')][_0xb791('0x76')][_0xb791('0x77')]('\x5c','\x5c\x5c')[_0xb791('0x77')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x409774)){_0x459f68['or'](_0xb791('0x78'),_0x409774+'%')['or'](_0xb791('0x79'),_0x409774+'%');}else{_0x459f68['or'](_0xb791('0x7a'),qs[_0xb791('0x5d')](_0x409774))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x409774+'%');}}}_0x3ad3f4[_0xb791('0x40')](_0x459f68);_0x3ad3f4[_0xb791('0x7b')]('i.id');var _0x34371d={'type':db['Sequelize'][_0xb791('0x7c')][_0xb791('0x7d')],'raw':!![]};var _0x46a33d=_0x3ad3f4[_0xb791('0x7e')]();_0x46a33d[_0xb791('0x43')](_0xb791('0x7f'));_0x46a33d[_0xb791('0x43')](_0xb791('0x80'),_0xb791('0x56'));if(_0x26d1c7[_0xb791('0x3e')]){_0x26d1c7[_0xb791('0x3e')][_0xb791('0x2e')](function(_0x54c4d2){var _0x995ba5=_0x54c4d2[0x0]===_0xb791('0x81')?_0x54c4d2[0x0]:'i.'+_0x54c4d2[0x0];_0x3ad3f4[_0xb791('0x3e')](_0x995ba5,_0x54c4d2[0x1]===_0xb791('0x82')?![]:!![]);});}if(!_['isEmpty'](_0x20ab27)){_0x3ad3f4['having'](_0x549106);_0x46a33d['where'](_0xb791('0x83'),_0x20ab27);}BPromise[_0xb791('0x84')]()[_0xb791('0x23')](function(){if(!_0xf2d0b7){if(_0x224d59['query'][_0xb791('0x85')])return;_0x46a33d[_0xb791('0x40')](_0xb791('0x86'));_0x3ad3f4[_0xb791('0x40')](_0xb791('0x86'));return;}if(_0x224d59['user'][_0xb791('0x87')]!=='agent')return;return _0x224d59[_0xb791('0x88')][_0xb791('0x89')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4dd9b4){if(_[_0xb791('0x6a')](_0x4dd9b4)){_0x46a33d[_0xb791('0x40')](_0xb791('0x8a'));_0x3ad3f4['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x46a33d['where'](_0xb791('0x8b'),_[_0xb791('0x29')](_0x4dd9b4,'id'));_0x3ad3f4[_0xb791('0x40')]('i.SmsAccountId\x20IN\x20?',_[_0xb791('0x29')](_0x4dd9b4,'id'));}});})[_0xb791('0x23')](function(){if(_0x224d59[_0xb791('0x88')]['role']===_0xb791('0x8c')&&!_0xf2d0b7&&!_0x224d59[_0xb791('0x35')][_0xb791('0x85')])return[];return db['sequelize']['query'](_0x46a33d[_0xb791('0x8d')](),_0x34371d);})[_0xb791('0x23')](function(_0x157e98){_0x43a271[_0xb791('0x8e')]=_0x157e98['length'];if(_0x43a271['count']===0x0)return[];return db[_0xb791('0x8f')][_0xb791('0x35')](_0x2f7174['toString'](),_0x34371d)[_0xb791('0x23')](function(_0x406eb7){_0x3f4f0e=_[_0xb791('0x90')](_0x406eb7,'id');_0x34371d=_[_0xb791('0x91')](_0x34371d,{'model':db[_0xb791('0x92')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x224d59[_0xb791('0x35')][_0xb791('0x3a')]){_0x26d1c7['attributes'][_0xb791('0x2e')](function(_0x2bfbfc){_0x3ad3f4[_0xb791('0x43')]('i.'+_0x2bfbfc);});}else{_0x3ad3f4[_0xb791('0x43')](_0xb791('0x80'),_0xb791('0x56'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0x93'),_0xb791('0x94'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0x95'),_0xb791('0x96'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0x97'),_0xb791('0x81'));_0x3ad3f4['field'](_0xb791('0x98'));_0x3ad3f4[_0xb791('0x43')]('c.firstName',_0xb791('0x99'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0x9a'),_0xb791('0x9b'));_0x3ad3f4[_0xb791('0x43')]('c.email',_0xb791('0x9c'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0x9d'),'Contact.phone');_0x3ad3f4[_0xb791('0x43')](_0xb791('0x9e'),_0xb791('0x9f'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0xa0'),_0xb791('0xa1'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0xa2'),'Owner.fullname');_0x3ad3f4[_0xb791('0x43')](_0xb791('0xa3'),_0xb791('0xa4'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0xa5'),_0xb791('0x2c'));}if(_0x26d1c7[_0xb791('0x1c')])_0x3ad3f4[_0xb791('0x1c')](_0x26d1c7['limit']);if(_0x26d1c7[_0xb791('0x1a')])_0x3ad3f4[_0xb791('0x1a')](_0x26d1c7[_0xb791('0x1a')]);return db[_0xb791('0x8f')][_0xb791('0x35')](_0x3ad3f4[_0xb791('0x8d')](),_0x34371d);})[_0xb791('0x23')](function(_0x52cc35){if(_0x52cc35[_0xb791('0x3b')]>0x0)_0x71380c['where']('ui.SmsInteractionId\x20IN\x20?',_[_0xb791('0x29')](_0x52cc35,'id'));return db[_0xb791('0x8f')][_0xb791('0x35')](_0x71380c[_0xb791('0x8d')](),_0x34371d)[_0xb791('0x23')](function(_0x4aa02f){var _0x5186a6=_['groupBy'](_0x4aa02f,'SmsInteractionId');var _0x2fd768=[];_0x52cc35[_0xb791('0x2e')](function(_0x525347){_0x2fd768[_0xb791('0x2f')](updateSmsInteraction(_0x525347,_0x3f4f0e,_0x5186a6));});return BPromise[_0xb791('0xa6')](_0x2fd768);});});})[_0xb791('0x23')](function(_0x8c2168){_0x43a271[_0xb791('0xa7')]=_0x8c2168;return _0x43a271;})[_0xb791('0x23')](respondWithFilteredResult(_0x2e7be9,_0x26d1c7))[_0xb791('0x30')](handleError(_0x2e7be9,null));};exports[_0xb791('0xa8')]=function(_0x5ec1bc,_0x25a55d){var _0x3caa4a={'raw':![],'where':{'id':_0x5ec1bc['params']['id']}},_0x4be512={};_0x4be512[_0xb791('0x34')]=_[_0xb791('0x36')](db[_0xb791('0x92')]['rawAttributes']);_0x4be512['query']=_[_0xb791('0x36')](_0x5ec1bc[_0xb791('0x35')]);_0x4be512[_0xb791('0x37')]=_[_0xb791('0x38')](_0x4be512[_0xb791('0x34')],_0x4be512['query']);_0x3caa4a['attributes']=_['intersection'](_0x4be512['model'],qs['fields'](_0x5ec1bc['query'][_0xb791('0x3a')]));_0x3caa4a[_0xb791('0x39')]=_0x3caa4a[_0xb791('0x39')]['length']?_0x3caa4a['attributes']:_0x4be512[_0xb791('0x34')];if(_0x5ec1bc['query'][_0xb791('0xa9')]){_0x3caa4a[_0xb791('0xaa')]=[{'all':!![]}];}_0x3caa4a=_[_0xb791('0x91')]({},_0x3caa4a,_0x5ec1bc[_0xb791('0xab')]);return db[_0xb791('0x92')][_0xb791('0x55')](_0x3caa4a)[_0xb791('0x23')](handleEntityNotFound(_0x25a55d,null))[_0xb791('0x23')](respondWithResult(_0x25a55d,null))[_0xb791('0x30')](handleError(_0x25a55d,null));};exports['create']=function(_0xcd593c,_0x6ea25d){return db['SmsInteraction'][_0xb791('0xac')](_0xcd593c[_0xb791('0xad')],{})[_0xb791('0x23')](respondWithResult(_0x6ea25d,0xc9))[_0xb791('0x30')](handleError(_0x6ea25d,null));};exports[_0xb791('0xae')]=function(_0x414cfd,_0x488daf){if(_0x414cfd[_0xb791('0xad')]['id']){delete _0x414cfd[_0xb791('0xad')]['id'];}return db[_0xb791('0x92')][_0xb791('0x55')]({'where':{'id':_0x414cfd[_0xb791('0xaf')]['id']}})[_0xb791('0x23')](handleEntityNotFound(_0x488daf,null))[_0xb791('0x23')](saveUpdates(_0x414cfd[_0xb791('0xad')],null))[_0xb791('0x23')](respondWithResult(_0x488daf,null))[_0xb791('0x30')](handleError(_0x488daf,null));};exports[_0xb791('0x22')]=function(_0x56f62c,_0x424b1e){return db['SmsInteraction'][_0xb791('0x55')]({'where':{'id':_0x56f62c[_0xb791('0xaf')]['id']}})[_0xb791('0x23')](handleEntityNotFound(_0x424b1e,null))[_0xb791('0x23')](removeEntity(_0x424b1e,null))[_0xb791('0x30')](handleError(_0x424b1e,null));};exports[_0xb791('0xb0')]=function(_0x501748,_0x4ac774){return db[_0xb791('0x92')]['describe']()[_0xb791('0x23')](respondWithResult(_0x4ac774,null))['catch'](handleError(_0x4ac774,null));};exports[_0xb791('0xb1')]=function(_0x3c45f8,_0x6457e7,_0xebb605){return db[_0xb791('0xb2')]['find']({'where':{'id':_0x3c45f8[_0xb791('0xaf')]['id']}})[_0xb791('0x23')](handleEntityNotFound(_0x6457e7,null))[_0xb791('0x23')](function(_0x1253f0){if(_0x1253f0){return _0x1253f0[_0xb791('0xb1')](_0x3c45f8[_0xb791('0xad')][_0xb791('0xb3')],_[_0xb791('0xb4')](_0x3c45f8[_0xb791('0xad')],['ids','id'])||{});}})['then'](respondWithResult(_0x6457e7,null))[_0xb791('0x30')](handleError(_0x6457e7,null));};exports['getMessages']=function(_0x20a33b,_0xab6c83,_0x4334fd){var _0x523e88={'raw':![],'where':{}};var _0x10ff23={};var _0x5a47f3={'count':0x0,'rows':[]};return db[_0xb791('0x92')]['findOne']({'where':{'id':_0x20a33b[_0xb791('0xaf')]['id']}})[_0xb791('0x23')](handleEntityNotFound(_0xab6c83,null))[_0xb791('0x23')](function(_0x2217df){if(_0x2217df){_0x10ff23[_0xb791('0x34')]=_[_0xb791('0x36')](db[_0xb791('0xb2')][_0xb791('0x31')]);_0x10ff23[_0xb791('0x35')]=_[_0xb791('0x36')](_0x20a33b[_0xb791('0x35')]);_0x10ff23['filters']=_[_0xb791('0x38')](_0x10ff23[_0xb791('0x34')],_0x10ff23[_0xb791('0x35')]);_0x523e88[_0xb791('0x39')]=_[_0xb791('0x38')](_0x10ff23[_0xb791('0x34')],qs[_0xb791('0x3a')](_0x20a33b[_0xb791('0x35')][_0xb791('0x3a')]));_0x523e88[_0xb791('0x39')]=_0x523e88[_0xb791('0x39')][_0xb791('0x3b')]?_0x523e88[_0xb791('0x39')]:_0x10ff23[_0xb791('0x34')];if(!_0x20a33b[_0xb791('0x35')]['hasOwnProperty']('nolimit')){_0x523e88[_0xb791('0x1c')]=qs[_0xb791('0x1c')](_0x20a33b[_0xb791('0x35')][_0xb791('0x1c')]);_0x523e88['offset']=qs[_0xb791('0x1a')](_0x20a33b[_0xb791('0x35')][_0xb791('0x1a')]);}_0x523e88['order']=qs[_0xb791('0x3f')](_0x20a33b[_0xb791('0x35')][_0xb791('0x3f')]);_0x523e88[_0xb791('0x40')]=qs[_0xb791('0x37')](_[_0xb791('0x41')](_0x20a33b[_0xb791('0x35')],_0x10ff23[_0xb791('0x37')]));_0x523e88[_0xb791('0x40')][_0xb791('0xb5')]=_0x2217df['id'];if(_0x20a33b[_0xb791('0x35')]['filter']){_0x523e88[_0xb791('0x40')]=_['merge'](_0x523e88['where'],{'$or':_[_0xb791('0x29')](_0x523e88[_0xb791('0x39')],function(_0x352f83){var _0x1029d7={};_0x1029d7[_0x352f83]={'$like':'%'+_0x20a33b['query'][_0xb791('0x76')]+'%'};return _0x1029d7;})});}if(_0x20a33b[_0xb791('0x35')][_0xb791('0x6d')]){var _0x179736=_0x20a33b[_0xb791('0x35')][_0xb791('0x6d')][_0xb791('0x2d')](',');var _0x18abbe={};_0x18abbe[_0x179736[0x0]]={'$gte':moment(_0x179736[0x1])[_0xb791('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x523e88[_0xb791('0x40')]=_[_0xb791('0x91')](_0x523e88[_0xb791('0x40')],_0x18abbe);}_0x523e88=_['merge']({},_0x523e88,_0x20a33b[_0xb791('0xab')]);return db['SmsMessage'][_0xb791('0x8e')]({'where':_0x523e88[_0xb791('0x40')]})['then'](function(_0x54ccc0){_0x5a47f3['count']=_0x54ccc0;if(_0x20a33b['query'][_0xb791('0xa9')]){_0x523e88['include']=[{'all':!![]}];}return db[_0xb791('0xb2')][_0xb791('0xb7')](_0x523e88);})['then'](function(_0x572569){_0x5a47f3['rows']=_0x572569;return _0x5a47f3;});}})['then'](respondWithFilteredResult(_0xab6c83,_0x523e88))[_0xb791('0x30')](handleError(_0xab6c83,null));};exports[_0xb791('0xb8')]=function(_0x1d5fd9,_0x412e54,_0x1b2884){return db[_0xb791('0x92')][_0xb791('0x55')]({'where':{'id':_0x1d5fd9[_0xb791('0xaf')]['id']}})[_0xb791('0x23')](handleEntityNotFound(_0x412e54,null))[_0xb791('0x23')](function(_0x4bf532){if(_0x4bf532){return _0x4bf532[_0xb791('0xb9')](_0x1d5fd9['body']['ids'],_[_0xb791('0xb4')](_0x1d5fd9['body'],[_0xb791('0xb3'),'id'])||{})['spread'](function(){return db[_0xb791('0x63')]['findAll']({'attributes':['id',_0xb791('0x26'),_0xb791('0x44')],'where':{'id':_0x1d5fd9[_0xb791('0xad')][_0xb791('0xb3')]}});})[_0xb791('0x23')](function(_0x467f0d){socket[_0xb791('0xba')](_0xb791('0xbb'),{'id':Number(_0x1d5fd9['params']['id']),'tags':_0x467f0d||[]});return{'id':Number(_0x1d5fd9['params']['id']),'tags':_0x467f0d||[]};});}})[_0xb791('0x23')](respondWithResult(_0x412e54,null))[_0xb791('0x30')](handleError(_0x412e54,null));};exports['removeTags']=function(_0x5d428f,_0x5730fc,_0x1e3164){return db[_0xb791('0x92')][_0xb791('0x55')]({'where':{'id':_0x5d428f['params']['id']}})[_0xb791('0x23')](handleEntityNotFound(_0x5730fc,null))[_0xb791('0x23')](function(_0x24f26e){if(_0x24f26e){return _0x24f26e[_0xb791('0xbc')](_0x5d428f[_0xb791('0x35')][_0xb791('0xb3')]);}})['then'](respondWithStatusCode(_0x5730fc,null))[_0xb791('0x30')](handleError(_0x5730fc,null));};exports[_0xb791('0xbd')]=function(_0x5c0154,_0x5f205e){var _0x5d3335=moment()[_0xb791('0xbe')]()[_0xb791('0x8d')]();var _0xb21cea=path[_0xb791('0xbf')](config[_0xb791('0xc0')],_0xb791('0xc1'),'files',_0xb791('0xc2'));var _0x1f5ddf=path[_0xb791('0xbf')](config[_0xb791('0xc0')],_0xb791('0xc1'),_0xb791('0xc3'),_0xb791('0xc4'));var _0x27bf5d=path[_0xb791('0xbf')](_0xb21cea,_0x5d3335);var _0x502a0d=util[_0xb791('0xb6')](_0xb791('0xc5'),_0x5c0154[_0xb791('0xaf')]['id'],_0x5d3335);var _0x522c39=path[_0xb791('0xbf')](_0xb21cea,_0x502a0d);var _0x47b4fb=[];_0x47b4fb[_0xb791('0x2f')]({'model':db[_0xb791('0xc6')],'as':_0xb791('0xc6'),'attributes':['id','fullname'],'raw':!![]});_0x47b4fb['push']({'model':db['CmContact'],'as':_0xb791('0x59'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x303526=[{'model':db['SmsMessage'],'as':_0xb791('0xc7'),'attributes':['id',_0xb791('0xad'),_0xb791('0x6b'),_0xb791('0xc8'),_0xb791('0xc9'),_0xb791('0x71')],'include':_0x47b4fb}];_0x303526[_0xb791('0x2f')]({'model':db[_0xb791('0xca')],'as':_0xb791('0xcb'),'attributes':['id','name']});_0x303526['push']({'model':db['User'],'as':_0xb791('0xcc'),'attributes':['id',_0xb791('0x2a')]});return db['SmsInteraction']['find']({'where':{'id':_0x5c0154['params']['id']},'include':_0x303526})[_0xb791('0x23')](handleEntityNotFound(_0x5f205e,null))[_0xb791('0x23')](function(_0x1980c0){if(_0x1980c0){var _0xd2b004=_0x1980c0[_0xb791('0xcd')]({'plain':!![]});fs[_0xb791('0xce')](_0x27bf5d);var _0x37e3cb={'channel':_0xb791('0xcf'),'account':_0xd2b004[_0xb791('0xcb')][_0xb791('0x26')],'agent':_0xd2b004[_0xb791('0xcc')]?_0xd2b004[_0xb791('0xcc')][_0xb791('0x2a')]:_0xb791('0xd0'),'createdAt':moment(_0xd2b004[_0xb791('0x6b')])[_0xb791('0xb6')](_0xb791('0xd1'))[_0xb791('0x8d')](),'closedAt':_0xd2b004[_0xb791('0xd2')]?moment(_0xd2b004[_0xb791('0xd3')])[_0xb791('0xb6')](_0xb791('0xd1'))[_0xb791('0x8d')]():'','disposition':_0xd2b004[_0xb791('0xd4')],'messages':_(_0xd2b004['Messages'])['filter']({'secret':![]})['map'](function(_0x130675){return{'date':moment(_0x130675[_0xb791('0x6b')])[_0xb791('0xb6')](_0xb791('0xd1'))['toString'](),'sender':_0x130675[_0xb791('0xc8')]==='out'?_0x130675['User']?_0x130675[_0xb791('0xc6')][_0xb791('0x2a')]:'System':_0x130675[_0xb791('0x59')][_0xb791('0xd5')]+(_0x130675[_0xb791('0x59')]['lastName']?'\x20'+_0x130675['Contact'][_0xb791('0xd6')]:''),'body':_0x130675['body'],'direction':_0x130675['direction']==='out'?'A':'C','secret':_0x130675['secret'],'read':_0x130675[_0xb791('0x71')]};})[_0xb791('0x5b')]()};return ejs[_0xb791('0xd7')](path[_0xb791('0xbf')](config[_0xb791('0xc0')],_0xb791('0xc1'),_0xb791('0xd8'),_0xb791('0xd9')),{'interaction':_0x37e3cb})[_0xb791('0x23')](function(_0x42f011){var _0x2a392b=path[_0xb791('0xbf')](_0x27bf5d,_0xb791('0xda')+_0xd2b004['id']+'-'+_0x5d3335+'.pdf');var _0x40b36b={'path':_0x2a392b,'channel':_0xb791('0xcf'),'interactionId':_0xd2b004['id']};return pdf['createPdfFromHTML'](_0x42f011,_0x40b36b);})[_0xb791('0x23')](function(){return new BPromise(function(_0x3b45e3,_0x286d86){zipdir(_0x27bf5d,{'saveTo':_0x522c39},function(_0x26b622,_0xe3c800){if(_0x26b622)return _0x286d86(_0x26b622);return _0x3b45e3(_0xe3c800);});})['then'](function(){return new BPromise(function(_0x26d576,_0x197233){rimraf(_0x27bf5d,function(_0x4cb98b){if(_0x4cb98b)_0x197233(_0x4cb98b);return _0x26d576();});});})[_0xb791('0x23')](function(){return _0x5f205e[_0xb791('0xbd')](_0x522c39,_0x502a0d,function(_0x30cbdc){if(_0x30cbdc){console['log']('err',_0x30cbdc);}else{fs[_0xb791('0xdb')](_0x522c39);}});});});}else{return _0x5f205e['sendStatus'](0xc8);}})[_0xb791('0x30')](handleError(_0x5f205e,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index cb81688..0dd33a9 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 _0x056b=['hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x265eb8,_0x102b08){var _0x940494=function(_0x41ee4b){while(--_0x41ee4b){_0x265eb8['push'](_0x265eb8['shift']());}};_0x940494(++_0x102b08);}(_0x056b,0xb6));var _0xb056=function(_0x31a119,_0x17e6ca){_0x31a119=_0x31a119-0x0;var _0x2d6e6a=_0x056b[_0x31a119];return _0x2d6e6a;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xb056('0x0'))['db'][_0xb056('0x1')];var SmsMessage=require(_0xb056('0x0'))['db'][_0xb056('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xb056('0x3')](0x0);var events={'afterCreate':_0xb056('0x4'),'afterUpdate':_0xb056('0x5'),'afterDestroy':_0xb056('0x6')};function emitEvent(_0x343d88){return function(_0x2ff09d,_0x15a545,_0x515612){_0x2ff09d[_0xb056('0x7')]({'attributes':['id'],'raw':!![]})[_0xb056('0x8')](function(_0x3eae69){_0x2ff09d[_0xb056('0x9')](_0xb056('0xa'),_0x3eae69[_0xb056('0xb')](function(_0x539126){return{'id':_0x539126['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x2ff09d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb056('0x8')](function(_0x160c2a){_0x2ff09d[_0xb056('0x9')](_0xb056('0xc'),_0x160c2a['length']);SmsInteractionEvents[_0xb056('0xd')](_0x343d88+':'+_0x2ff09d['id'],_0x2ff09d);SmsInteractionEvents['emit'](_0x343d88,_0x2ff09d);_0x515612(null);})[_0xb056('0xe')](_0x515612(null));};}for(var e in events){if(events[_0xb056('0xf')](e)){var event=events[e];SmsInteraction[_0xb056('0x10')](e,emitEvent(event));}}module[_0xb056('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0xdd4f=['setMaxListeners','update','remove','getUsers','then','Users','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','SmsMessage'];(function(_0x555da1,_0xa82be7){var _0x372361=function(_0x4f6d2e){while(--_0x4f6d2e){_0x555da1['push'](_0x555da1['shift']());}};_0x372361(++_0xa82be7);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x3625f0,_0x33a66c){_0x3625f0=_0x3625f0-0x0;var _0x2312a1=_0xdd4f[_0x3625f0];return _0x2312a1;};'use strict';var EventEmitter=require(_0xfdd4('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db'][_0xfdd4('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xfdd4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfdd4('0x3'),'afterDestroy':_0xfdd4('0x4')};function emitEvent(_0x6b2b0d){return function(_0x554e44,_0x398015,_0x43cbcf){_0x554e44[_0xfdd4('0x5')]({'attributes':['id'],'raw':!![]})[_0xfdd4('0x6')](function(_0x3c72d4){_0x554e44['setDataValue'](_0xfdd4('0x7'),_0x3c72d4['map'](function(_0x4181d6){return{'id':_0x4181d6['id']};}));return SmsMessage[_0xfdd4('0x8')]({'where':{'SmsInteractionId':_0x554e44['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfdd4('0x6')](function(_0x4ee02f){_0x554e44[_0xfdd4('0x9')]('unreadMessages',_0x4ee02f[_0xfdd4('0xa')]);SmsInteractionEvents[_0xfdd4('0xb')](_0x6b2b0d+':'+_0x554e44['id'],_0x554e44);SmsInteractionEvents[_0xfdd4('0xb')](_0x6b2b0d,_0x554e44);_0x43cbcf(null);})[_0xfdd4('0xc')](_0x43cbcf(null));};}for(var e in events){if(events[_0xfdd4('0xd')](e)){var event=events[e];SmsInteraction[_0xfdd4('0xe')](e,emitEvent(event));}}module[_0xfdd4('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 83e4cfb..1bf6b9e 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 _0x1d50=['exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsInteraction.attributes'];(function(_0xe27810,_0x8b3e76){var _0x53dcec=function(_0x4a83c7){while(--_0x4a83c7){_0xe27810['push'](_0xe27810['shift']());}};_0x53dcec(++_0x8b3e76);}(_0x1d50,0x118));var _0x01d5=function(_0x442bf5,_0x18afae){_0x442bf5=_0x442bf5-0x0;var _0x5816a1=_0x1d50[_0x442bf5];return _0x5816a1;};'use strict';var _=require('lodash');var util=require(_0x01d5('0x0'));var logger=require(_0x01d5('0x1'))(_0x01d5('0x2'));var moment=require(_0x01d5('0x3'));var BPromise=require('bluebird');var rp=require(_0x01d5('0x4'));var fs=require('fs');var path=require(_0x01d5('0x5'));var rimraf=require('rimraf');var config=require(_0x01d5('0x6'));var attributes=require(_0x01d5('0x7'));module[_0x01d5('0x8')]=function(_0x4fc678,_0x2e96f1){return _0x4fc678[_0x01d5('0x9')](_0x01d5('0xa'),attributes,{'tableName':_0x01d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x444404,_0x2ceea7,_0x13ac25){if(_0x444404[_0x01d5('0xc')](_0x01d5('0xd'))){_0x444404[_0x01d5('0xe')]=moment()['format'](_0x01d5('0xf'));}_0x13ac25(null,_0x444404);}}});}; \ No newline at end of file +var _0x948d=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x54727a,_0x37d477){var _0x414e28=function(_0x332fdd){while(--_0x332fdd){_0x54727a['push'](_0x54727a['shift']());}};_0x414e28(++_0x37d477);}(_0x948d,0x1be));var _0xd948=function(_0x557e53,_0x1170e0){_0x557e53=_0x557e53-0x0;var _0x21ef9b=_0x948d[_0x557e53];return _0x21ef9b;};'use strict';var _=require(_0xd948('0x0'));var util=require(_0xd948('0x1'));var logger=require(_0xd948('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd948('0x3'));var rp=require(_0xd948('0x4'));var fs=require('fs');var path=require(_0xd948('0x5'));var rimraf=require(_0xd948('0x6'));var config=require(_0xd948('0x7'));var attributes=require(_0xd948('0x8'));module[_0xd948('0x9')]=function(_0x4c707a,_0x129484){return _0x4c707a['define'](_0xd948('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b5482,_0x41fe9a,_0x2e19e5){if(_0x3b5482[_0xd948('0xb')](_0xd948('0xc'))){_0x3b5482[_0xd948('0xd')]=moment()[_0xd948('0xe')](_0xd948('0xf'));}_0x2e19e5(null,_0x3b5482);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 2a38a0e..d5cb1bf 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 _0x319e=['UpdateSmsInteraction','stringify','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','SmsInteraction,\x20%s,\x20%s','message','catch','update','body','options','raw','where','attributes','limit'];(function(_0x59eab9,_0x33a4a7){var _0x47bda4=function(_0x30b5aa){while(--_0x30b5aa){_0x59eab9['push'](_0x59eab9['shift']());}};_0x47bda4(++_0x33a4a7);}(_0x319e,0xd7));var _0xe319=function(_0x2bbfdf,_0x39a7aa){_0x2bbfdf=_0x2bbfdf-0x0;var _0x3767fd=_0x319e[_0x2bbfdf];return _0x3767fd;};'use strict';var _=require(_0xe319('0x0'));var util=require(_0xe319('0x1'));var moment=require(_0xe319('0x2'));var BPromise=require(_0xe319('0x3'));var rs=require(_0xe319('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe319('0x5'))['db'];var utils=require(_0xe319('0x6'));var logger=require(_0xe319('0x7'))(_0xe319('0x8'));var config=require('../../config/environment');var jayson=require(_0xe319('0x9'));var client=jayson[_0xe319('0xa')]['http']({'port':0x232a});config[_0xe319('0xb')]=_[_0xe319('0xc')](config[_0xe319('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe319('0xd'))(new Redis(config[_0xe319('0xb')]));require('./smsInteraction.socket')[_0xe319('0xe')](socket);function respondWithRpcPromise(_0x2beb8a,_0xfc3fdd,_0x23b3d9){return new BPromise(function(_0x579862,_0x497bd7){return client['request'](_0x2beb8a,_0x23b3d9)[_0xe319('0xf')](function(_0x8d39fa){logger[_0xe319('0x10')]('SmsInteraction,\x20%s,\x20%s',_0xfc3fdd,_0xe319('0x11'));logger[_0xe319('0x12')](_0xe319('0x13'),_0xfc3fdd,_0xe319('0x11'),JSON['stringify'](_0x8d39fa));if(_0x8d39fa[_0xe319('0x14')]){if(_0x8d39fa[_0xe319('0x14')]['code']===0x1f4){logger[_0xe319('0x14')](_0xe319('0x15'),_0xfc3fdd,_0x8d39fa[_0xe319('0x14')][_0xe319('0x16')]);return _0x497bd7(_0x8d39fa[_0xe319('0x14')][_0xe319('0x16')]);}logger['error'](_0xe319('0x15'),_0xfc3fdd,_0x8d39fa['error'][_0xe319('0x16')]);return _0x579862(_0x8d39fa[_0xe319('0x14')][_0xe319('0x16')]);}else{logger[_0xe319('0x10')]('SmsInteraction,\x20%s,\x20%s',_0xfc3fdd,'request\x20sent');_0x579862(_0x8d39fa['result'][_0xe319('0x16')]);}})[_0xe319('0x17')](function(_0x1512fe){logger[_0xe319('0x14')](_0xe319('0x15'),_0xfc3fdd,_0x1512fe);_0x497bd7(_0x1512fe);});});}exports['UpdateSmsInteraction']=function(_0x19f4c0){var _0x387638=this;return new Promise(function(_0x1928f6,_0x2d8705){return db['SmsInteraction'][_0xe319('0x18')](_0x19f4c0[_0xe319('0x19')],{'raw':_0x19f4c0['options']?_0x19f4c0[_0xe319('0x1a')][_0xe319('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19f4c0[_0xe319('0x1a')]?_0x19f4c0[_0xe319('0x1a')][_0xe319('0x1c')]||null:null,'attributes':_0x19f4c0['options']?_0x19f4c0[_0xe319('0x1a')][_0xe319('0x1d')]||null:null,'limit':_0x19f4c0[_0xe319('0x1a')]?_0x19f4c0[_0xe319('0x1a')][_0xe319('0x1e')]||null:null})['then'](function(_0x28c4f6){logger[_0xe319('0x10')](_0xe319('0x1f'),_0x19f4c0);logger[_0xe319('0x12')](_0xe319('0x1f'),_0x19f4c0,JSON[_0xe319('0x20')](_0x28c4f6));_0x1928f6(_0x28c4f6);})['catch'](function(_0x534343){logger['error']('UpdateSmsInteraction',_0x534343[_0xe319('0x16')],_0x19f4c0);_0x2d8705(_0x387638[_0xe319('0x14')](0x1f4,_0x534343[_0xe319('0x16')]));});});};exports[_0xe319('0x21')]=function(_0x20160d){return new Promise(function(_0xd08837,_0x2bc343){return db[_0xe319('0x22')][_0xe319('0x23')]({'where':_0x20160d['options']?_0x20160d['options']['where']||null:null})[_0xe319('0xf')](function(_0x4fd70c){if(_0x4fd70c){return _0x4fd70c[_0xe319('0x24')](_0x20160d[_0xe319('0x19')][_0xe319('0x25')],_[_0xe319('0x26')](_0x20160d[_0xe319('0x19')],['ids','id'])||{});}})[_0xe319('0x27')](function(_0x398d05){logger[_0xe319('0x10')](_0xe319('0x28'),_0x20160d);logger[_0xe319('0x12')](_0xe319('0x28'),_0x20160d,JSON[_0xe319('0x20')](_0x398d05));_0xd08837(_0x398d05);})[_0xe319('0x17')](function(_0x45dc1c){logger[_0xe319('0x14')](_0xe319('0x28'),_0x45dc1c[_0xe319('0x16')],_0x20160d);_0x2bc343(_this[_0xe319('0x14')](0x1f4,_0x45dc1c[_0xe319('0x16')]));});});}; \ No newline at end of file +var _0xec7a=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','UpdateSmsInteraction','body','options','where','attributes','limit','stringify','catch','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x544d55,_0x4bb645){var _0x9c2cc=function(_0x196305){while(--_0x196305){_0x544d55['push'](_0x544d55['shift']());}};_0x9c2cc(++_0x4bb645);}(_0xec7a,0x12b));var _0xaec7=function(_0x4ed9ef,_0x381176){_0x4ed9ef=_0x4ed9ef-0x0;var _0x2bb85b=_0xec7a[_0x4ed9ef];return _0x2bb85b;};'use strict';var _=require(_0xaec7('0x0'));var util=require(_0xaec7('0x1'));var moment=require(_0xaec7('0x2'));var BPromise=require(_0xaec7('0x3'));var rs=require(_0xaec7('0x4'));var fs=require('fs');var Redis=require(_0xaec7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaec7('0x6'));var logger=require(_0xaec7('0x7'))(_0xaec7('0x8'));var config=require('../../config/environment');var jayson=require(_0xaec7('0x9'));var client=jayson[_0xaec7('0xa')]['http']({'port':0x232a});config[_0xaec7('0xb')]=_['defaults'](config[_0xaec7('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaec7('0xb')]));require('./smsInteraction.socket')[_0xaec7('0xc')](socket);function respondWithRpcPromise(_0x2dc48a,_0x3868f2,_0x24f396){return new BPromise(function(_0x448f9b,_0x56b678){return client[_0xaec7('0xd')](_0x2dc48a,_0x24f396)[_0xaec7('0xe')](function(_0x381250){logger[_0xaec7('0xf')](_0xaec7('0x10'),_0x3868f2,'request\x20sent');logger[_0xaec7('0x11')](_0xaec7('0x12'),_0x3868f2,_0xaec7('0x13'),JSON['stringify'](_0x381250));if(_0x381250[_0xaec7('0x14')]){if(_0x381250[_0xaec7('0x14')][_0xaec7('0x15')]===0x1f4){logger[_0xaec7('0x14')](_0xaec7('0x10'),_0x3868f2,_0x381250['error'][_0xaec7('0x16')]);return _0x56b678(_0x381250[_0xaec7('0x14')]['message']);}logger[_0xaec7('0x14')](_0xaec7('0x10'),_0x3868f2,_0x381250['error'][_0xaec7('0x16')]);return _0x448f9b(_0x381250[_0xaec7('0x14')][_0xaec7('0x16')]);}else{logger[_0xaec7('0xf')](_0xaec7('0x10'),_0x3868f2,_0xaec7('0x13'));_0x448f9b(_0x381250[_0xaec7('0x17')][_0xaec7('0x16')]);}})['catch'](function(_0x469746){logger[_0xaec7('0x14')](_0xaec7('0x10'),_0x3868f2,_0x469746);_0x56b678(_0x469746);});});}exports[_0xaec7('0x18')]=function(_0x4d1ef6){var _0x38e036=this;return new Promise(function(_0x588fa4,_0x45148d){return db['SmsInteraction']['update'](_0x4d1ef6[_0xaec7('0x19')],{'raw':_0x4d1ef6[_0xaec7('0x1a')]?_0x4d1ef6[_0xaec7('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d1ef6[_0xaec7('0x1a')]?_0x4d1ef6[_0xaec7('0x1a')][_0xaec7('0x1b')]||null:null,'attributes':_0x4d1ef6[_0xaec7('0x1a')]?_0x4d1ef6[_0xaec7('0x1a')][_0xaec7('0x1c')]||null:null,'limit':_0x4d1ef6[_0xaec7('0x1a')]?_0x4d1ef6[_0xaec7('0x1a')][_0xaec7('0x1d')]||null:null})[_0xaec7('0xe')](function(_0x5efa44){logger[_0xaec7('0xf')](_0xaec7('0x18'),_0x4d1ef6);logger[_0xaec7('0x11')]('UpdateSmsInteraction',_0x4d1ef6,JSON[_0xaec7('0x1e')](_0x5efa44));_0x588fa4(_0x5efa44);})[_0xaec7('0x1f')](function(_0x1fce62){logger[_0xaec7('0x14')](_0xaec7('0x18'),_0x1fce62['message'],_0x4d1ef6);_0x45148d(_0x38e036['error'](0x1f4,_0x1fce62[_0xaec7('0x16')]));});});};exports[_0xaec7('0x20')]=function(_0x1bcc9d){return new Promise(function(_0xa07929,_0x128d69){return db['SmsInteraction'][_0xaec7('0x21')]({'where':_0x1bcc9d[_0xaec7('0x1a')]?_0x1bcc9d[_0xaec7('0x1a')]['where']||null:null})[_0xaec7('0xe')](function(_0x127137){if(_0x127137){return _0x127137[_0xaec7('0x22')](_0x1bcc9d[_0xaec7('0x19')][_0xaec7('0x23')],_['omit'](_0x1bcc9d[_0xaec7('0x19')],[_0xaec7('0x23'),'id'])||{});}})[_0xaec7('0x24')](function(_0x209dd2){logger[_0xaec7('0xf')](_0xaec7('0x25'),_0x1bcc9d);logger['debug']('AddTags',_0x1bcc9d,JSON['stringify'](_0x209dd2));_0xa07929(_0x209dd2);})[_0xaec7('0x1f')](function(_0x5555cd){logger[_0xaec7('0x14')]('AddTags',_0x5555cd[_0xaec7('0x16')],_0x1bcc9d);_0x128d69(_this[_0xaec7('0x14')](0x1f4,_0x5555cd[_0xaec7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 0b3539e..f5e9913 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 _0x45ee=['length','smsInteraction:','save','emit','removeListener','register'];(function(_0x35204,_0x15c770){var _0x4d91f7=function(_0xe87cd1){while(--_0xe87cd1){_0x35204['push'](_0x35204['shift']());}};_0x4d91f7(++_0x15c770);}(_0x45ee,0x18e));var _0xe45e=function(_0x86597f,_0x5dc3b3){_0x86597f=_0x86597f-0x0;var _0x1f4e98=_0x45ee[_0x86597f];return _0x1f4e98;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xe45e('0x0'),'remove','update'];function createListener(_0x5bacac,_0x5417e1){return function(_0x37cc2c){_0x5417e1[_0xe45e('0x1')](_0x5bacac,_0x37cc2c);};}function removeListener(_0x415da1,_0x37d574){return function(){SmsInteractionEvents[_0xe45e('0x2')](_0x415da1,_0x37d574);};}exports[_0xe45e('0x3')]=function(_0x27a92d){for(var _0x16d2dd=0x0,_0x1a7ed9=events[_0xe45e('0x4')];_0x16d2dd<_0x1a7ed9;_0x16d2dd++){var _0x1e5316=events[_0x16d2dd];var _0x1b57a1=createListener(_0xe45e('0x5')+_0x1e5316,_0x27a92d);SmsInteractionEvents['on'](_0x1e5316,_0x1b57a1);}}; \ No newline at end of file +var _0xda51=['emit','removeListener','length','save'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0xda51,0xab));var _0x1da5=function(_0x26d9b3,_0x591f4e){_0x26d9b3=_0x26d9b3-0x0;var _0x15c226=_0xda51[_0x26d9b3];return _0x15c226;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x1da5('0x0'),'remove','update'];function createListener(_0x5b4b48,_0x5072b8){return function(_0x89bcfb){_0x5072b8[_0x1da5('0x1')](_0x5b4b48,_0x89bcfb);};}function removeListener(_0x14ae97,_0x30b3cc){return function(){SmsInteractionEvents[_0x1da5('0x2')](_0x14ae97,_0x30b3cc);};}exports['register']=function(_0x1caaa0){for(var _0x17b6be=0x0,_0x3dee37=events[_0x1da5('0x3')];_0x17b6be<_0x3dee37;_0x17b6be++){var _0x3f33c0=events[_0x17b6be];var _0x22cc7b=createListener('smsInteraction:'+_0x3f33c0,_0x1caaa0);SmsInteractionEvents['on'](_0x3f33c0,_0x22cc7b);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index b75f823..5ce90d8 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 _0x578d=['../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','tracked','smsmessage:create','create','status','put','/:id/accept','accept','reject','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x578d,0x11a));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd578('0x0'));var util=require('util');var path=require(_0xd578('0x1'));var timeout=require(_0xd578('0x2'));var express=require(_0xd578('0x3'));var router=express[_0xd578('0x4')]();var fs_extra=require(_0xd578('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd578('0x6'));var controller=require(_0xd578('0x7'));router[_0xd578('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd578('0x9'),auth[_0xd578('0xa')](),controller[_0xd578('0xb')]);router[_0xd578('0x8')](_0xd578('0xc'),auth[_0xd578('0xa')](),controller[_0xd578('0xd')]);router['post']('/',auth[_0xd578('0xa')](),interaction[_0xd578('0xe')]('sms',_0xd578('0xf')),controller[_0xd578('0x10')]);router['post']('/:id/status',controller[_0xd578('0x11')]);router['put'](_0xd578('0xc'),auth[_0xd578('0xa')](),controller['update']);router[_0xd578('0x12')](_0xd578('0x13'),auth['isAuthenticated'](),controller[_0xd578('0x14')]);router['put']('/:id/reject',auth[_0xd578('0xa')](),controller[_0xd578('0x15')]);router[_0xd578('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd578('0x17')]=router; \ No newline at end of file +var _0xcdd6=['tracked','sms','smsmessage:create','create','post','/:id/status','status','put','update','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xcdd6,0x1be));var _0x6cdd=function(_0x1db1f2,_0x238fb1){_0x1db1f2=_0x1db1f2-0x0;var _0x530e85=_0xcdd6[_0x1db1f2];return _0x530e85;};'use strict';var multer=require('multer');var util=require(_0x6cdd('0x0'));var path=require(_0x6cdd('0x1'));var timeout=require(_0x6cdd('0x2'));var express=require(_0x6cdd('0x3'));var router=express['Router']();var fs_extra=require(_0x6cdd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6cdd('0x5'));var config=require(_0x6cdd('0x6'));var controller=require(_0x6cdd('0x7'));router[_0x6cdd('0x8')]('/',auth[_0x6cdd('0x9')](),controller['index']);router[_0x6cdd('0x8')]('/describe',auth[_0x6cdd('0x9')](),controller[_0x6cdd('0xa')]);router[_0x6cdd('0x8')](_0x6cdd('0xb'),auth[_0x6cdd('0x9')](),controller[_0x6cdd('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x6cdd('0xd')](_0x6cdd('0xe'),_0x6cdd('0xf')),controller[_0x6cdd('0x10')]);router[_0x6cdd('0x11')](_0x6cdd('0x12'),controller[_0x6cdd('0x13')]);router[_0x6cdd('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6cdd('0x15')]);router[_0x6cdd('0x14')]('/:id/accept',auth[_0x6cdd('0x9')](),controller[_0x6cdd('0x16')]);router[_0x6cdd('0x14')](_0x6cdd('0x17'),auth[_0x6cdd('0x9')](),controller[_0x6cdd('0x18')]);router[_0x6cdd('0x19')](_0x6cdd('0xb'),auth[_0x6cdd('0x9')](),controller[_0x6cdd('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index a0542b2..583ae4c 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 _0x0ee1=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x3b0c9d,_0x3ddeb5){var _0xcfc8d7=function(_0x320dc6){while(--_0x320dc6){_0x3b0c9d['push'](_0x3b0c9d['shift']());}};_0xcfc8d7(++_0x3ddeb5);}(_0x0ee1,0x1b0));var _0x10ee=function(_0x3d1807,_0x4fabc2){_0x3d1807=_0x3d1807-0x0;var _0x2b15c0=_0x0ee1[_0x3d1807];return _0x2b15c0;};'use strict';var Sequelize=require(_0x10ee('0x0'));module[_0x10ee('0x1')]={'body':{'type':Sequelize[_0x10ee('0x2')](_0x10ee('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x10ee('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x10ee('0x5')]('in',_0x10ee('0x6')),'defaultValue':_0x10ee('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x10ee('0x7')](0xbe)},'phone':{'type':Sequelize[_0x10ee('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x10ee('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x10ee('0x2')]}}; \ No newline at end of file +var _0xd2e3=['sequelize','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x50f7e6,_0xa29d72){var _0x68d004=function(_0x4952b4){while(--_0x4952b4){_0x50f7e6['push'](_0x50f7e6['shift']());}};_0x68d004(++_0xa29d72);}(_0xd2e3,0x1e3));var _0x3d2e=function(_0x9cf49,_0x1c25f9){_0x9cf49=_0x9cf49-0x0;var _0x47816a=_0xd2e3[_0x9cf49];return _0x47816a;};'use strict';var Sequelize=require(_0x3d2e('0x0'));module['exports']={'body':{'type':Sequelize[_0x3d2e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3d2e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3d2e('0x3')]('in',_0x3d2e('0x4')),'defaultValue':_0x3d2e('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3d2e('0x5')](0xbe)},'phone':{'type':Sequelize[_0x3d2e('0x5')]},'readAt':{'type':Sequelize[_0x3d2e('0x6')]},'secret':{'type':Sequelize[_0x3d2e('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3d2e('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index e39ed44..7f7956e 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 _0xbd0a=['accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','interaction','[SMSMESSAGE: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','contact','User','fullname','internal','manual','interface','channel','event','EventManager','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT','email','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','delivered','Status','results','groupName','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','client','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','destroy','stack','name','send','index','SmsMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','create','body','update','find','describe','sms-interactions'];(function(_0x36114b,_0x3937fb){var _0x288623=function(_0x325cb9){while(--_0x325cb9){_0x36114b['push'](_0x36114b['shift']());}};_0x288623(++_0x3937fb);}(_0xbd0a,0x153));var _0xabd0=function(_0x5d52d2,_0x577cef){_0x5d52d2=_0x5d52d2-0x0;var _0x22281c=_0xbd0a[_0x5d52d2];return _0x22281c;};'use strict';var emlformat=require(_0xabd0('0x0'));var rimraf=require(_0xabd0('0x1'));var zipdir=require(_0xabd0('0x2'));var jsonpatch=require(_0xabd0('0x3'));var rp=require(_0xabd0('0x4'));var moment=require(_0xabd0('0x5'));var BPromise=require(_0xabd0('0x6'));var Mustache=require(_0xabd0('0x7'));var util=require(_0xabd0('0x8'));var path=require('path');var sox=require(_0xabd0('0x9'));var csv=require(_0xabd0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabd0('0xb'));var _=require(_0xabd0('0xc'));var squel=require(_0xabd0('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xabd0('0xe'));var toCsv=require(_0xabd0('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xabd0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xabd0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabd0('0x11'));var logger=require(_0xabd0('0x12'))(_0xabd0('0x13'));var utils=require(_0xabd0('0x14'));var config=require(_0xabd0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xabd0('0x16'))['db'];config['redis']=_[_0xabd0('0x17')](config[_0xabd0('0x18')],{'host':_0xabd0('0x19'),'port':0x18eb});var socket=require(_0xabd0('0x1a'))(new Redis(config[_0xabd0('0x18')]));require(_0xabd0('0x1b'))[_0xabd0('0x1c')](socket);var jayson=require(_0xabd0('0x1d'));var client=jayson['client'][_0xabd0('0x1e')]({'port':0x232c});var client9002=jayson[_0xabd0('0x1f')][_0xabd0('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x570e1c,_0x11629b,_0x516366,_0x316c97){return new BPromise(function(_0x1f3569,_0x11a202){var _0xf3225c=_0x316c97||client;return _0xf3225c['request'](_0x570e1c,_0x516366)[_0xabd0('0x20')](function(_0x29c3ca){logger['info'](_0xabd0('0x21'),_0x11629b,_0xabd0('0x22'));logger[_0xabd0('0x23')](_0xabd0('0x24'),_0x11629b,'request\x20sent',JSON[_0xabd0('0x25')](_0x29c3ca));if(_0x29c3ca[_0xabd0('0x26')]){if(_0x29c3ca[_0xabd0('0x26')][_0xabd0('0x27')]===0x1f4){logger['error'](_0xabd0('0x21'),_0x11629b,_0x29c3ca[_0xabd0('0x26')][_0xabd0('0x28')]);return _0x11a202(_0x29c3ca['error'][_0xabd0('0x28')]);}logger['error'](_0xabd0('0x21'),_0x11629b,_0x29c3ca['error'][_0xabd0('0x28')]);return _0x1f3569(_0x29c3ca['error'][_0xabd0('0x28')]);}else{logger[_0xabd0('0x29')](_0xabd0('0x21'),_0x11629b,_0xabd0('0x22'));_0x1f3569(_0x29c3ca[_0xabd0('0x2a')][_0xabd0('0x28')]);}})[_0xabd0('0x2b')](function(_0x283e09){logger[_0xabd0('0x26')](_0xabd0('0x21'),_0x11629b,_0x283e09);_0x11a202(_0x283e09);});});}function respondWithStatusCode(_0x254bc3,_0x406498){_0x406498=_0x406498||0xcc;return function(_0x1cb297){if(_0x1cb297){return _0x254bc3[_0xabd0('0x2c')](_0x406498);}return _0x254bc3[_0xabd0('0x2d')](_0x406498)[_0xabd0('0x2e')]();};}function respondWithResult(_0x5e4b77,_0x2af258){_0x2af258=_0x2af258||0xc8;return function(_0x32e697){if(_0x32e697){return _0x5e4b77[_0xabd0('0x2d')](_0x2af258)[_0xabd0('0x2f')](_0x32e697);}};}function respondWithFilteredResult(_0x17b8c6,_0x463f69){return function(_0x196fd4){if(_0x196fd4){var _0x1b855d=typeof _0x463f69[_0xabd0('0x30')]==='undefined'&&typeof _0x463f69[_0xabd0('0x31')]==='undefined';var _0x237974=_0x196fd4[_0xabd0('0x32')];var _0x5aa8ab=_0x1b855d?0x0:_0x463f69[_0xabd0('0x30')];var _0x18c452=_0x1b855d?_0x196fd4[_0xabd0('0x32')]:_0x463f69[_0xabd0('0x30')]+_0x463f69['limit'];var _0x506ece;if(_0x18c452>=_0x237974){_0x18c452=_0x237974;_0x506ece=0xc8;}else{_0x506ece=0xce;}_0x17b8c6[_0xabd0('0x2d')](_0x506ece);return _0x17b8c6['set'](_0xabd0('0x33'),_0x5aa8ab+'-'+_0x18c452+'/'+_0x237974)[_0xabd0('0x2f')](_0x196fd4);}return null;};}function patchUpdates(_0x1dd947){return function(_0x3a1545){try{jsonpatch[_0xabd0('0x34')](_0x3a1545,_0x1dd947,!![]);}catch(_0x5dc77a){return BPromise[_0xabd0('0x35')](_0x5dc77a);}return _0x3a1545[_0xabd0('0x36')]();};}function saveUpdates(_0x702a8,_0x4eb56a){return function(_0x12ce91){if(_0x12ce91){return _0x12ce91['update'](_0x702a8)[_0xabd0('0x20')](function(_0x11e9ce){return _0x11e9ce;});}return null;};}function removeEntity(_0x52f4f7,_0x1df7ab){return function(_0x2b8d1f){if(_0x2b8d1f){return _0x2b8d1f[_0xabd0('0x37')]()['then'](function(){_0x52f4f7[_0xabd0('0x2d')](0xcc)[_0xabd0('0x2e')]();});}};}function handleEntityNotFound(_0x2ded78,_0x5b6d10){return function(_0x18020b){if(!_0x18020b){_0x2ded78['sendStatus'](0x194);}return _0x18020b;};}function handleError(_0x16a474,_0x3ec88d){_0x3ec88d=_0x3ec88d||0x1f4;return function(_0x4eb2e2){logger['error'](_0x4eb2e2[_0xabd0('0x38')]);if(_0x4eb2e2[_0xabd0('0x39')]){delete _0x4eb2e2[_0xabd0('0x39')];}_0x16a474[_0xabd0('0x2d')](_0x3ec88d)[_0xabd0('0x3a')](_0x4eb2e2);};}exports[_0xabd0('0x3b')]=function(_0x182d1e,_0x3765cf){var _0x1db212={},_0x4da910={},_0x4068cb={'count':0x0,'rows':[]};var _0x1829f9=_['map'](db[_0xabd0('0x3c')][_0xabd0('0x3d')],function(_0x3dbba2){return{'name':_0x3dbba2['fieldName'],'type':_0x3dbba2[_0xabd0('0x3e')][_0xabd0('0x3f')]};});_0x4da910[_0xabd0('0x40')]=_['map'](_0x1829f9,_0xabd0('0x39'));_0x4da910[_0xabd0('0x41')]=_[_0xabd0('0x42')](_0x182d1e[_0xabd0('0x41')]);_0x4da910[_0xabd0('0x43')]=_[_0xabd0('0x44')](_0x4da910[_0xabd0('0x40')],_0x4da910['query']);_0x1db212[_0xabd0('0x45')]=_[_0xabd0('0x44')](_0x4da910[_0xabd0('0x40')],qs[_0xabd0('0x46')](_0x182d1e['query'][_0xabd0('0x46')]));_0x1db212[_0xabd0('0x45')]=_0x1db212[_0xabd0('0x45')][_0xabd0('0x47')]?_0x1db212['attributes']:_0x4da910[_0xabd0('0x40')];if(!_0x182d1e[_0xabd0('0x41')]['hasOwnProperty'](_0xabd0('0x48'))){_0x1db212[_0xabd0('0x31')]=qs['limit'](_0x182d1e['query'][_0xabd0('0x31')]);_0x1db212[_0xabd0('0x30')]=qs[_0xabd0('0x30')](_0x182d1e[_0xabd0('0x41')][_0xabd0('0x30')]);}_0x1db212['order']=qs['sort'](_0x182d1e[_0xabd0('0x41')][_0xabd0('0x49')]);_0x1db212[_0xabd0('0x4a')]=qs[_0xabd0('0x43')](_[_0xabd0('0x4b')](_0x182d1e['query'],_0x4da910[_0xabd0('0x43')]),_0x1829f9);if(_0x182d1e[_0xabd0('0x41')][_0xabd0('0x4c')]){_0x1db212[_0xabd0('0x4a')]=_[_0xabd0('0x4d')](_0x1db212[_0xabd0('0x4a')],{'$or':_['map'](_0x1829f9,function(_0x50ca6f){if(_0x50ca6f[_0xabd0('0x3e')]!==_0xabd0('0x4e')){var _0x5c1b10={};_0x5c1b10[_0x50ca6f[_0xabd0('0x39')]]={'$like':'%'+_0x182d1e[_0xabd0('0x41')][_0xabd0('0x4c')]+'%'};return _0x5c1b10;}})});}_0x1db212=_[_0xabd0('0x4d')]({},_0x1db212,_0x182d1e[_0xabd0('0x4f')]);var _0xfe7629={'where':_0x1db212[_0xabd0('0x4a')]};return db[_0xabd0('0x3c')][_0xabd0('0x32')](_0xfe7629)[_0xabd0('0x20')](function(_0x4b8154){_0x4068cb[_0xabd0('0x32')]=_0x4b8154;if(_0x182d1e[_0xabd0('0x41')][_0xabd0('0x50')]){_0x1db212[_0xabd0('0x51')]=[{'all':!![]}];}return db[_0xabd0('0x3c')]['findAll'](_0x1db212);})[_0xabd0('0x20')](function(_0x843a42){_0x4068cb[_0xabd0('0x52')]=_0x843a42;return _0x4068cb;})[_0xabd0('0x20')](respondWithFilteredResult(_0x3765cf,_0x1db212))['catch'](handleError(_0x3765cf,null));};exports['show']=function(_0x75f7d,_0x2088df){var _0x1b35af={'raw':!![],'where':{'id':_0x75f7d[_0xabd0('0x53')]['id']}},_0x1ac834={};_0x1ac834[_0xabd0('0x40')]=_[_0xabd0('0x42')](db[_0xabd0('0x3c')][_0xabd0('0x3d')]);_0x1ac834[_0xabd0('0x41')]=_[_0xabd0('0x42')](_0x75f7d['query']);_0x1ac834[_0xabd0('0x43')]=_[_0xabd0('0x44')](_0x1ac834['model'],_0x1ac834['query']);_0x1b35af[_0xabd0('0x45')]=_[_0xabd0('0x44')](_0x1ac834[_0xabd0('0x40')],qs[_0xabd0('0x46')](_0x75f7d[_0xabd0('0x41')][_0xabd0('0x46')]));_0x1b35af[_0xabd0('0x45')]=_0x1b35af[_0xabd0('0x45')]['length']?_0x1b35af[_0xabd0('0x45')]:_0x1ac834[_0xabd0('0x40')];if(_0x75f7d[_0xabd0('0x41')]['includeAll']){_0x1b35af[_0xabd0('0x51')]=[{'all':!![]}];}_0x1b35af=_[_0xabd0('0x4d')]({},_0x1b35af,_0x75f7d[_0xabd0('0x4f')]);return db[_0xabd0('0x3c')]['find'](_0x1b35af)[_0xabd0('0x20')](handleEntityNotFound(_0x2088df,null))[_0xabd0('0x20')](respondWithResult(_0x2088df,null))[_0xabd0('0x2b')](handleError(_0x2088df,null));};exports['create']=function(_0x4ff8c0,_0x2c443b){return db[_0xabd0('0x3c')][_0xabd0('0x54')](_0x4ff8c0[_0xabd0('0x55')],{})[_0xabd0('0x20')](respondWithResult(_0x2c443b,0xc9))[_0xabd0('0x2b')](handleError(_0x2c443b,null));};exports[_0xabd0('0x56')]=function(_0x5f1abf,_0x9b917d){if(_0x5f1abf[_0xabd0('0x55')]['id']){delete _0x5f1abf['body']['id'];}return db[_0xabd0('0x3c')][_0xabd0('0x57')]({'where':{'id':_0x5f1abf[_0xabd0('0x53')]['id']}})['then'](handleEntityNotFound(_0x9b917d,null))[_0xabd0('0x20')](saveUpdates(_0x5f1abf['body'],null))[_0xabd0('0x20')](respondWithResult(_0x9b917d,null))[_0xabd0('0x2b')](handleError(_0x9b917d,null));};exports['destroy']=function(_0x12166f,_0x5b73c7){return db['SmsMessage'][_0xabd0('0x57')]({'where':{'id':_0x12166f[_0xabd0('0x53')]['id']}})['then'](handleEntityNotFound(_0x5b73c7,null))[_0xabd0('0x20')](removeEntity(_0x5b73c7,null))['catch'](handleError(_0x5b73c7,null));};exports['describe']=function(_0x5c02ed,_0x1cd005){return db[_0xabd0('0x3c')][_0xabd0('0x58')]()['then'](respondWithResult(_0x1cd005,null))[_0xabd0('0x2b')](handleError(_0x1cd005,null));};var interaction_log=require(_0xabd0('0x12'))(_0xabd0('0x59'));exports[_0xabd0('0x5a')]=function(_0x2d3c93,_0x1ccfd7,_0x16a298){var _0x3cf171={'agent':{},'channel':'sms'};if(_0x2d3c93[_0xabd0('0x55')]['id']){delete _0x2d3c93[_0xabd0('0x55')]['id'];}_0x2d3c93['body'][_0xabd0('0x5b')]=!![];_0x2d3c93[_0xabd0('0x55')]['readAt']=moment()[_0xabd0('0x5c')](_0xabd0('0x5d'));_0x2d3c93[_0xabd0('0x55')]['UserId']=_0x2d3c93[_0xabd0('0x55')][_0xabd0('0x5e')]||_0x2d3c93[_0xabd0('0x5f')]['id'];_0x3cf171[_0xabd0('0x60')]['id']=_0x2d3c93[_0xabd0('0x55')][_0xabd0('0x5e')];return db[_0xabd0('0x3c')][_0xabd0('0x57')]({'where':{'id':_0x2d3c93[_0xabd0('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1ccfd7,null))[_0xabd0('0x20')](saveUpdates(_0x2d3c93[_0xabd0('0x55')],null))[_0xabd0('0x20')](function(_0xf09b13){if(_0xf09b13){_0x3cf171['message']=_0xf09b13[_0xabd0('0x61')]({'plain':!![]});return db[_0xabd0('0x62')][_0xabd0('0x57')]({'where':{'id':_0xf09b13['SmsInteractionId']}});}return null;})[_0xabd0('0x20')](handleEntityNotFound(_0x1ccfd7,null))[_0xabd0('0x20')](function(_0x355849){if(_0x355849){return _0x355849[_0xabd0('0x56')]({'UserId':_0x2d3c93[_0xabd0('0x55')][_0xabd0('0x5e')],'read1stAt':_[_0xabd0('0x63')](_0x355849['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xabd0('0x20')](function(_0x1df4e9){if(_0x1df4e9){_0x3cf171[_0xabd0('0x64')]=_0x1df4e9[_0xabd0('0x61')]({'plain':!![]});interaction_log[_0xabd0('0x29')](_0xabd0('0x65'),_0x2d3c93[_0xabd0('0x5f')]['id'],_0x2d3c93['user'][_0xabd0('0x39')],_0x2d3c93[_0xabd0('0x5f')]['role'],_0x3cf171[_0xabd0('0x64')]['id'],_0x2d3c93['body']?JSON[_0xabd0('0x25')](_0x2d3c93[_0xabd0('0x55')]):_0xabd0('0x66'));return respondWithRpcPromise(_0xabd0('0x67'),_0xabd0('0x68'),_0x3cf171);}return null;})['then'](function(_0x51a064){var _0x4e1819=_0xabd0('0x69')+_0x51a064[_0xabd0('0x28')][_0xabd0('0x6a')];return db[_0xabd0('0x6b')][_0xabd0('0x41')](_0x4e1819,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xabd0('0x20')](function(_0x56bd3e){return _0x56bd3e;});})[_0xabd0('0x20')](function(_0x11f8f2){if(_0x11f8f2){_0x3cf171[_0xabd0('0x28')][_0xabd0('0x6c')]=_0x11f8f2[0x0];if(!_0x2d3c93['body'][_0xabd0('0x5e')])return;return db[_0xabd0('0x6d')][_0xabd0('0x57')]({'where':{'id':_0x2d3c93[_0xabd0('0x55')][_0xabd0('0x5e')],'role':_0xabd0('0x60')},'attributes':['id',_0xabd0('0x39'),_0xabd0('0x6e'),'email',_0xabd0('0x6f')],'raw':!![]});}return null;})[_0xabd0('0x20')](function(_0x89e804){if(!_0x89e804)return null;_0x3cf171['message'][_0xabd0('0x60')]=_0x89e804;return _0x3cf171;})[_0xabd0('0x20')](function(_0x1d115d){if(_0x1d115d){if(_0x2d3c93[_0xabd0('0x55')][_0xabd0('0x70')]){_0x3cf171['message'][_0xabd0('0x71')]=util[_0xabd0('0x5c')]('SIP/%s',_0x2d3c93['user'][_0xabd0('0x39')]);_0x3cf171[_0xabd0('0x28')]['channel']=_0x3cf171[_0xabd0('0x72')];_0x3cf171[_0xabd0('0x28')][_0xabd0('0x73')]=_0xabd0('0x5a');return respondWithRpcPromise(_0xabd0('0x74'),_0xabd0('0x74'),{'event':'acceptmessage','message':_0x3cf171['message']},client9002)[_0xabd0('0x20')](function(){return _0x3cf171;});}return _0x3cf171;}return null;})[_0xabd0('0x20')](respondWithResult(_0x1ccfd7,null))['catch'](handleError(_0x1ccfd7,null));};var interaction_log=require(_0xabd0('0x12'))('sms-interactions');exports[_0xabd0('0x35')]=function(_0x9c0426,_0x3526e7,_0x293da8){var _0x37f089={'agent':{},'channel':'sms'};if(_0x9c0426['body']['id']){delete _0x9c0426[_0xabd0('0x55')]['id'];}_0x9c0426[_0xabd0('0x55')]['UserId']=_0x9c0426[_0xabd0('0x55')]['UserId']||_0x9c0426['user']['id'];_0x37f089[_0xabd0('0x60')]['id']=_0x9c0426[_0xabd0('0x55')]['UserId'];return db[_0xabd0('0x3c')][_0xabd0('0x57')]({'where':{'id':_0x9c0426[_0xabd0('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3526e7,null))[_0xabd0('0x20')](function(_0x5de396){if(_0x5de396){_0x37f089['message']=_0x5de396[_0xabd0('0x61')]({'plain':!![]});return db[_0xabd0('0x62')][_0xabd0('0x57')]({'where':{'id':_0x5de396[_0xabd0('0x75')]}});}return null;})[_0xabd0('0x20')](handleEntityNotFound(_0x3526e7,null))[_0xabd0('0x20')](function(_0x3793a3){if(_0x3793a3){_0x37f089['interaction']=_0x3793a3[_0xabd0('0x61')]({'plain':!![]});interaction_log['info'](_0xabd0('0x76'),_0x9c0426[_0xabd0('0x5f')]['id'],_0x9c0426[_0xabd0('0x5f')]['name'],_0x9c0426[_0xabd0('0x5f')][_0xabd0('0x77')],_0x37f089[_0xabd0('0x64')]['id'],_0x9c0426['body']?JSON[_0xabd0('0x25')](_0x9c0426[_0xabd0('0x55')]):_0xabd0('0x66'));return respondWithRpcPromise(_0xabd0('0x78'),_0xabd0('0x79'),_0x37f089);}return null;})[_0xabd0('0x20')](function(_0x205e99){var _0x4ba10f=_0xabd0('0x69')+_0x205e99[_0xabd0('0x28')]['ContactId'];return db['sequelize'][_0xabd0('0x41')](_0x4ba10f,{'type':db['Sequelize']['QueryTypes'][_0xabd0('0x7a')],'raw':!![]})[_0xabd0('0x20')](function(_0x436e1a){return _0x436e1a;});})[_0xabd0('0x20')](function(_0x23d94a){if(_0x23d94a){_0x37f089[_0xabd0('0x28')][_0xabd0('0x6c')]=_0x23d94a[0x0];if(!_0x9c0426[_0xabd0('0x55')][_0xabd0('0x5e')])return;return db[_0xabd0('0x6d')][_0xabd0('0x57')]({'where':{'id':_0x9c0426[_0xabd0('0x55')]['UserId'],'role':_0xabd0('0x60')},'attributes':['id',_0xabd0('0x39'),'fullname',_0xabd0('0x7b'),'internal'],'raw':!![]});}return null;})[_0xabd0('0x20')](function(_0x13cf1c){if(!_0x13cf1c)return null;_0x37f089['message'][_0xabd0('0x60')]=_0x13cf1c;return _0x37f089;})[_0xabd0('0x20')](function(_0x1d765b){if(_0x1d765b){_0x1d765b[_0xabd0('0x28')]['interface']=util[_0xabd0('0x5c')](_0xabd0('0x7c'),_0x9c0426[_0xabd0('0x5f')][_0xabd0('0x39')]);_0x1d765b[_0xabd0('0x28')][_0xabd0('0x72')]=_0x37f089['channel'];_0x1d765b['message']['event']=_0xabd0('0x35');respondWithRpcPromise('EventManager',_0xabd0('0x74'),{'event':_0xabd0('0x7d'),'message':_0x1d765b['message']},client9002);return _0x37f089;}return null;})[_0xabd0('0x20')](respondWithResult(_0x3526e7,null))[_0xabd0('0x2b')](handleError(_0x3526e7,null));};exports['status']=function(_0x95de25,_0x52bc3e,_0x5702c2){if(_0x95de25[_0xabd0('0x55')]['id']){delete _0x95de25['body']['id'];}var _0x2b2da7;return db[_0xabd0('0x3c')]['find']({'where':{'id':_0x95de25[_0xabd0('0x53')]['id']}})[_0xabd0('0x20')](handleEntityNotFound(_0x52bc3e,null))[_0xabd0('0x20')](function(_0x2e1792){if(_0x2e1792){_0x2b2da7=_0x2e1792;return db[_0xabd0('0x7e')][_0xabd0('0x57')]({'where':{'id':_0x2e1792[_0xabd0('0x7f')]}});}})[_0xabd0('0x20')](handleEntityNotFound(_0x52bc3e,null))['then'](function(_0xf01dd6){if(_0xf01dd6){logger[_0xabd0('0x23')](_0xabd0('0x24'),'status',_0xabd0('0x80'),_0xf01dd6[_0xabd0('0x3e')],util[_0xabd0('0x81')](_0x95de25[_0xabd0('0x55')],{'showHidden':![],'depth':null}));switch(_0xf01dd6[_0xabd0('0x3e')]){case _0xabd0('0x82'):if(_0x95de25[_0xabd0('0x55')][_0xabd0('0x83')]&&_0x95de25[_0xabd0('0x55')][_0xabd0('0x83')]===_0x2b2da7[_0xabd0('0x84')]){return _0x2b2da7[_0xabd0('0x56')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xabd0('0x2d'),_0xabd0('0x82'),util['inspect'](_0x95de25['body'],{'showHidden':![],'depth':null}));}break;case _0xabd0('0x85'):if(_0x95de25['body'][_0xabd0('0x86')]&&_0x95de25[_0xabd0('0x55')][_0xabd0('0x86')]===_0x2b2da7[_0xabd0('0x84')]&&_[_0xabd0('0x87')](['sent',_0xabd0('0x88')],_0x95de25[_0xabd0('0x55')][_0xabd0('0x89')])>=0x0){return _0x2b2da7[_0xabd0('0x56')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xabd0('0x2d'),'plivio',util[_0xabd0('0x81')](_0x95de25['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xf6d8bc=_0x95de25[_0xabd0('0x55')][_0xabd0('0x8a')][0x0];if(_0xf6d8bc[_0xabd0('0x2d')][_0xabd0('0x8b')]===_0xabd0('0x8c')){return _0x2b2da7[_0xabd0('0x56')]({'read':!![]});}else{logger[_0xabd0('0x26')](_0xabd0('0x8d'),'status',_0xabd0('0x8e'),util['inspect'](_0x95de25[_0xabd0('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x2b2da7;}})[_0xabd0('0x20')](respondWithResult(_0x52bc3e,null))[_0xabd0('0x2b')](handleError(_0x52bc3e,null));}; \ No newline at end of file +var _0x7b77=['model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','delivered','Status','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','debug','error','SmsMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','key'];(function(_0x49a4b5,_0x420d0c){var _0x343547=function(_0xdd6b78){while(--_0xdd6b78){_0x49a4b5['push'](_0x49a4b5['shift']());}};_0x343547(++_0x420d0c);}(_0x7b77,0x179));var _0x77b7=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x7b77[_0x178856];return _0x3c7fe7;};'use strict';var emlformat=require(_0x77b7('0x0'));var rimraf=require(_0x77b7('0x1'));var zipdir=require(_0x77b7('0x2'));var jsonpatch=require(_0x77b7('0x3'));var rp=require('request-promise');var moment=require(_0x77b7('0x4'));var BPromise=require(_0x77b7('0x5'));var Mustache=require(_0x77b7('0x6'));var util=require('util');var path=require(_0x77b7('0x7'));var sox=require(_0x77b7('0x8'));var csv=require(_0x77b7('0x9'));var ejs=require(_0x77b7('0xa'));var fs=require('fs');var fs_extra=require(_0x77b7('0xb'));var _=require(_0x77b7('0xc'));var squel=require('squel');var crypto=require(_0x77b7('0xd'));var jsforce=require(_0x77b7('0xe'));var deskjs=require(_0x77b7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x77b7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x77b7('0x11'));var as=require(_0x77b7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77b7('0x13'))(_0x77b7('0x14'));var utils=require(_0x77b7('0x15'));var config=require(_0x77b7('0x16'));var licenseUtil=require(_0x77b7('0x17'));var db=require(_0x77b7('0x18'))['db'];config[_0x77b7('0x19')]=_['defaults'](config[_0x77b7('0x19')],{'host':_0x77b7('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x77b7('0x1b')](socket);var jayson=require(_0x77b7('0x1c'));var client=jayson[_0x77b7('0x1d')][_0x77b7('0x1e')]({'port':0x232c});var client9002=jayson[_0x77b7('0x1d')][_0x77b7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4dbe04,_0x19d460,_0x253543,_0x3cb44b){return new BPromise(function(_0x2060df,_0x1cd7dd){var _0x25f361=_0x3cb44b||client;return _0x25f361[_0x77b7('0x1f')](_0x4dbe04,_0x253543)[_0x77b7('0x20')](function(_0x286046){logger['info']('SmsMessage,\x20%s,\x20%s',_0x19d460,'request\x20sent');logger[_0x77b7('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x19d460,'request\x20sent',JSON['stringify'](_0x286046));if(_0x286046['error']){if(_0x286046[_0x77b7('0x22')]['code']===0x1f4){logger[_0x77b7('0x22')]('SmsMessage,\x20%s,\x20%s',_0x19d460,_0x286046[_0x77b7('0x22')]['message']);return _0x1cd7dd(_0x286046[_0x77b7('0x22')]['message']);}logger[_0x77b7('0x22')](_0x77b7('0x23'),_0x19d460,_0x286046[_0x77b7('0x22')][_0x77b7('0x24')]);return _0x2060df(_0x286046[_0x77b7('0x22')][_0x77b7('0x24')]);}else{logger[_0x77b7('0x25')](_0x77b7('0x23'),_0x19d460,_0x77b7('0x26'));_0x2060df(_0x286046[_0x77b7('0x27')][_0x77b7('0x24')]);}})[_0x77b7('0x28')](function(_0x29c2aa){logger[_0x77b7('0x22')](_0x77b7('0x23'),_0x19d460,_0x29c2aa);_0x1cd7dd(_0x29c2aa);});});}function respondWithStatusCode(_0x359b23,_0x300de9){_0x300de9=_0x300de9||0xcc;return function(_0x1cfcbb){if(_0x1cfcbb){return _0x359b23['sendStatus'](_0x300de9);}return _0x359b23['status'](_0x300de9)[_0x77b7('0x29')]();};}function respondWithResult(_0x22c56d,_0x3cae5a){_0x3cae5a=_0x3cae5a||0xc8;return function(_0x4c6f8d){if(_0x4c6f8d){return _0x22c56d[_0x77b7('0x2a')](_0x3cae5a)[_0x77b7('0x2b')](_0x4c6f8d);}};}function respondWithFilteredResult(_0x20de87,_0x16b66a){return function(_0x114cf0){if(_0x114cf0){var _0x323363=typeof _0x16b66a[_0x77b7('0x2c')]===_0x77b7('0x2d')&&typeof _0x16b66a[_0x77b7('0x2e')]==='undefined';var _0x2afbf5=_0x114cf0[_0x77b7('0x2f')];var _0x23aa7e=_0x323363?0x0:_0x16b66a[_0x77b7('0x2c')];var _0x2e87e6=_0x323363?_0x114cf0[_0x77b7('0x2f')]:_0x16b66a[_0x77b7('0x2c')]+_0x16b66a[_0x77b7('0x2e')];var _0xcac9e;if(_0x2e87e6>=_0x2afbf5){_0x2e87e6=_0x2afbf5;_0xcac9e=0xc8;}else{_0xcac9e=0xce;}_0x20de87[_0x77b7('0x2a')](_0xcac9e);return _0x20de87['set'](_0x77b7('0x30'),_0x23aa7e+'-'+_0x2e87e6+'/'+_0x2afbf5)[_0x77b7('0x2b')](_0x114cf0);}return null;};}function patchUpdates(_0x15eb97){return function(_0x4c4ba5){try{jsonpatch[_0x77b7('0x31')](_0x4c4ba5,_0x15eb97,!![]);}catch(_0x4b8d1e){return BPromise[_0x77b7('0x32')](_0x4b8d1e);}return _0x4c4ba5[_0x77b7('0x33')]();};}function saveUpdates(_0x4b24a2,_0x31102a){return function(_0x4eb758){if(_0x4eb758){return _0x4eb758[_0x77b7('0x34')](_0x4b24a2)[_0x77b7('0x20')](function(_0xad1a3c){return _0xad1a3c;});}return null;};}function removeEntity(_0x50345e,_0x21fae3){return function(_0x108c6d){if(_0x108c6d){return _0x108c6d[_0x77b7('0x35')]()[_0x77b7('0x20')](function(){_0x50345e[_0x77b7('0x2a')](0xcc)[_0x77b7('0x29')]();});}};}function handleEntityNotFound(_0x214257,_0x26a52d){return function(_0x3cf95f){if(!_0x3cf95f){_0x214257[_0x77b7('0x36')](0x194);}return _0x3cf95f;};}function handleError(_0x3546d8,_0xacd0b7){_0xacd0b7=_0xacd0b7||0x1f4;return function(_0xb5f230){logger['error'](_0xb5f230[_0x77b7('0x37')]);if(_0xb5f230[_0x77b7('0x38')]){delete _0xb5f230[_0x77b7('0x38')];}_0x3546d8['status'](_0xacd0b7)['send'](_0xb5f230);};}exports[_0x77b7('0x39')]=function(_0x2c5c77,_0x42d245){var _0x2d11ef={},_0x1bdfec={},_0x1f5184={'count':0x0,'rows':[]};var _0x1330e9=_[_0x77b7('0x3a')](db[_0x77b7('0x3b')][_0x77b7('0x3c')],function(_0x17f4ca){return{'name':_0x17f4ca[_0x77b7('0x3d')],'type':_0x17f4ca[_0x77b7('0x3e')][_0x77b7('0x3f')]};});_0x1bdfec[_0x77b7('0x40')]=_[_0x77b7('0x3a')](_0x1330e9,_0x77b7('0x38'));_0x1bdfec[_0x77b7('0x41')]=_[_0x77b7('0x42')](_0x2c5c77[_0x77b7('0x41')]);_0x1bdfec[_0x77b7('0x43')]=_['intersection'](_0x1bdfec[_0x77b7('0x40')],_0x1bdfec[_0x77b7('0x41')]);_0x2d11ef['attributes']=_[_0x77b7('0x44')](_0x1bdfec['model'],qs[_0x77b7('0x45')](_0x2c5c77[_0x77b7('0x41')]['fields']));_0x2d11ef[_0x77b7('0x46')]=_0x2d11ef['attributes']['length']?_0x2d11ef[_0x77b7('0x46')]:_0x1bdfec['model'];if(!_0x2c5c77[_0x77b7('0x41')]['hasOwnProperty'](_0x77b7('0x47'))){_0x2d11ef[_0x77b7('0x2e')]=qs[_0x77b7('0x2e')](_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x2e')]);_0x2d11ef[_0x77b7('0x2c')]=qs['offset'](_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x2c')]);}_0x2d11ef[_0x77b7('0x48')]=qs[_0x77b7('0x49')](_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x49')]);_0x2d11ef[_0x77b7('0x4a')]=qs[_0x77b7('0x43')](_['pick'](_0x2c5c77[_0x77b7('0x41')],_0x1bdfec['filters']),_0x1330e9);if(_0x2c5c77[_0x77b7('0x41')]['filter']){_0x2d11ef[_0x77b7('0x4a')]=_[_0x77b7('0x4b')](_0x2d11ef[_0x77b7('0x4a')],{'$or':_[_0x77b7('0x3a')](_0x1330e9,function(_0x1250ad){if(_0x1250ad[_0x77b7('0x3e')]!==_0x77b7('0x4c')){var _0x52a73d={};_0x52a73d[_0x1250ad[_0x77b7('0x38')]]={'$like':'%'+_0x2c5c77[_0x77b7('0x41')]['filter']+'%'};return _0x52a73d;}})});}_0x2d11ef=_['merge']({},_0x2d11ef,_0x2c5c77[_0x77b7('0x4d')]);var _0x5dbb20={'where':_0x2d11ef[_0x77b7('0x4a')]};return db[_0x77b7('0x3b')][_0x77b7('0x2f')](_0x5dbb20)[_0x77b7('0x20')](function(_0x46d361){_0x1f5184[_0x77b7('0x2f')]=_0x46d361;if(_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x4e')]){_0x2d11ef[_0x77b7('0x4f')]=[{'all':!![]}];}return db[_0x77b7('0x3b')][_0x77b7('0x50')](_0x2d11ef);})[_0x77b7('0x20')](function(_0x272bfb){_0x1f5184[_0x77b7('0x51')]=_0x272bfb;return _0x1f5184;})[_0x77b7('0x20')](respondWithFilteredResult(_0x42d245,_0x2d11ef))['catch'](handleError(_0x42d245,null));};exports[_0x77b7('0x52')]=function(_0x59a29d,_0x2da729){var _0x4ffde2={'raw':!![],'where':{'id':_0x59a29d[_0x77b7('0x53')]['id']}},_0x37ba6b={};_0x37ba6b[_0x77b7('0x40')]=_[_0x77b7('0x42')](db['SmsMessage'][_0x77b7('0x3c')]);_0x37ba6b['query']=_[_0x77b7('0x42')](_0x59a29d[_0x77b7('0x41')]);_0x37ba6b['filters']=_['intersection'](_0x37ba6b['model'],_0x37ba6b[_0x77b7('0x41')]);_0x4ffde2['attributes']=_[_0x77b7('0x44')](_0x37ba6b[_0x77b7('0x40')],qs[_0x77b7('0x45')](_0x59a29d[_0x77b7('0x41')]['fields']));_0x4ffde2[_0x77b7('0x46')]=_0x4ffde2[_0x77b7('0x46')][_0x77b7('0x54')]?_0x4ffde2[_0x77b7('0x46')]:_0x37ba6b['model'];if(_0x59a29d[_0x77b7('0x41')][_0x77b7('0x4e')]){_0x4ffde2['include']=[{'all':!![]}];}_0x4ffde2=_[_0x77b7('0x4b')]({},_0x4ffde2,_0x59a29d[_0x77b7('0x4d')]);return db[_0x77b7('0x3b')][_0x77b7('0x55')](_0x4ffde2)[_0x77b7('0x20')](handleEntityNotFound(_0x2da729,null))[_0x77b7('0x20')](respondWithResult(_0x2da729,null))[_0x77b7('0x28')](handleError(_0x2da729,null));};exports['create']=function(_0x404f23,_0x29d52b){return db['SmsMessage'][_0x77b7('0x56')](_0x404f23[_0x77b7('0x57')],{})[_0x77b7('0x20')](respondWithResult(_0x29d52b,0xc9))[_0x77b7('0x28')](handleError(_0x29d52b,null));};exports['update']=function(_0x50e6ab,_0x3a4902){if(_0x50e6ab[_0x77b7('0x57')]['id']){delete _0x50e6ab['body']['id'];}return db['SmsMessage'][_0x77b7('0x55')]({'where':{'id':_0x50e6ab[_0x77b7('0x53')]['id']}})[_0x77b7('0x20')](handleEntityNotFound(_0x3a4902,null))[_0x77b7('0x20')](saveUpdates(_0x50e6ab[_0x77b7('0x57')],null))[_0x77b7('0x20')](respondWithResult(_0x3a4902,null))[_0x77b7('0x28')](handleError(_0x3a4902,null));};exports[_0x77b7('0x35')]=function(_0x58296f,_0x5aa315){return db[_0x77b7('0x3b')][_0x77b7('0x55')]({'where':{'id':_0x58296f[_0x77b7('0x53')]['id']}})[_0x77b7('0x20')](handleEntityNotFound(_0x5aa315,null))[_0x77b7('0x20')](removeEntity(_0x5aa315,null))['catch'](handleError(_0x5aa315,null));};exports['describe']=function(_0x642f7a,_0x1323fc){return db['SmsMessage'][_0x77b7('0x58')]()['then'](respondWithResult(_0x1323fc,null))[_0x77b7('0x28')](handleError(_0x1323fc,null));};var interaction_log=require(_0x77b7('0x13'))(_0x77b7('0x59'));exports[_0x77b7('0x5a')]=function(_0x136fb5,_0x346083,_0x325208){var _0x1f590e={'agent':{},'channel':_0x77b7('0x5b')};if(_0x136fb5[_0x77b7('0x57')]['id']){delete _0x136fb5[_0x77b7('0x57')]['id'];}_0x136fb5['body'][_0x77b7('0x5c')]=!![];_0x136fb5[_0x77b7('0x57')][_0x77b7('0x5d')]=moment()[_0x77b7('0x5e')](_0x77b7('0x5f'));_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')]=_0x136fb5['body'][_0x77b7('0x60')]||_0x136fb5[_0x77b7('0x61')]['id'];_0x1f590e[_0x77b7('0x62')]['id']=_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')];return db[_0x77b7('0x3b')][_0x77b7('0x55')]({'where':{'id':_0x136fb5[_0x77b7('0x53')]['id'],'UserId':null}})[_0x77b7('0x20')](handleEntityNotFound(_0x346083,null))[_0x77b7('0x20')](saveUpdates(_0x136fb5[_0x77b7('0x57')],null))[_0x77b7('0x20')](function(_0x1da758){if(_0x1da758){_0x1f590e[_0x77b7('0x24')]=_0x1da758[_0x77b7('0x63')]({'plain':!![]});return db[_0x77b7('0x64')][_0x77b7('0x55')]({'where':{'id':_0x1da758[_0x77b7('0x65')]}});}return null;})[_0x77b7('0x20')](handleEntityNotFound(_0x346083,null))[_0x77b7('0x20')](function(_0x5e4338){if(_0x5e4338){return _0x5e4338['update']({'UserId':_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')],'read1stAt':_[_0x77b7('0x66')](_0x5e4338[_0x77b7('0x67')])?moment()[_0x77b7('0x5e')](_0x77b7('0x5f')):undefined});}return null;})[_0x77b7('0x20')](function(_0x4ddf38){if(_0x4ddf38){_0x1f590e[_0x77b7('0x68')]=_0x4ddf38['get']({'plain':!![]});interaction_log[_0x77b7('0x25')](_0x77b7('0x69'),_0x136fb5[_0x77b7('0x61')]['id'],_0x136fb5[_0x77b7('0x61')][_0x77b7('0x38')],_0x136fb5['user'][_0x77b7('0x6a')],_0x1f590e[_0x77b7('0x68')]['id'],_0x136fb5['body']?JSON[_0x77b7('0x6b')](_0x136fb5[_0x77b7('0x57')]):'null');return respondWithRpcPromise('AcceptMessage',_0x77b7('0x6c'),_0x1f590e);}return null;})['then'](function(_0x2e1910){var _0x571041='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2e1910[_0x77b7('0x24')][_0x77b7('0x6d')];return db[_0x77b7('0x6e')]['query'](_0x571041,{'type':db[_0x77b7('0x6f')]['QueryTypes'][_0x77b7('0x70')],'raw':!![]})[_0x77b7('0x20')](function(_0x23911a){return _0x23911a;});})[_0x77b7('0x20')](function(_0x57ce8b){if(_0x57ce8b){_0x1f590e['message'][_0x77b7('0x71')]=_0x57ce8b[0x0];if(!_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')])return;return db[_0x77b7('0x72')][_0x77b7('0x55')]({'where':{'id':_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')],'role':_0x77b7('0x62')},'attributes':['id',_0x77b7('0x38'),_0x77b7('0x73'),_0x77b7('0x74'),'internal'],'raw':!![]});}return null;})[_0x77b7('0x20')](function(_0x5bca0e){if(!_0x5bca0e)return null;_0x1f590e['message']['agent']=_0x5bca0e;return _0x1f590e;})['then'](function(_0x20aa17){if(_0x20aa17){if(_0x136fb5[_0x77b7('0x57')][_0x77b7('0x75')]){_0x1f590e[_0x77b7('0x24')][_0x77b7('0x76')]=util[_0x77b7('0x5e')](_0x77b7('0x77'),_0x136fb5['user']['name']);_0x1f590e[_0x77b7('0x24')][_0x77b7('0x78')]=_0x1f590e[_0x77b7('0x78')];_0x1f590e[_0x77b7('0x24')][_0x77b7('0x79')]=_0x1f590e[_0x77b7('0x78')];_0x1f590e[_0x77b7('0x24')][_0x77b7('0x7a')]=_0x77b7('0x5a');return respondWithRpcPromise(_0x77b7('0x7b'),'EventManager',{'event':_0x77b7('0x7c'),'message':_0x1f590e[_0x77b7('0x24')]},client9002)[_0x77b7('0x20')](function(){return _0x1f590e;});}return _0x1f590e;}return null;})[_0x77b7('0x20')](respondWithResult(_0x346083,null))[_0x77b7('0x28')](handleError(_0x346083,null));};var interaction_log=require('../../config/logger')(_0x77b7('0x59'));exports[_0x77b7('0x32')]=function(_0x2dea85,_0x48924c,_0x4fd6ce){var _0xbdf72f={'agent':{},'channel':'sms'};if(_0x2dea85[_0x77b7('0x57')]['id']){delete _0x2dea85[_0x77b7('0x57')]['id'];}_0x2dea85['body']['UserId']=_0x2dea85['body']['UserId']||_0x2dea85[_0x77b7('0x61')]['id'];_0xbdf72f[_0x77b7('0x62')]['id']=_0x2dea85['body'][_0x77b7('0x60')];return db['SmsMessage']['find']({'where':{'id':_0x2dea85[_0x77b7('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48924c,null))[_0x77b7('0x20')](function(_0x56aa57){if(_0x56aa57){_0xbdf72f['message']=_0x56aa57[_0x77b7('0x63')]({'plain':!![]});return db[_0x77b7('0x64')][_0x77b7('0x55')]({'where':{'id':_0x56aa57[_0x77b7('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x48924c,null))['then'](function(_0x4e787f){if(_0x4e787f){_0xbdf72f[_0x77b7('0x68')]=_0x4e787f[_0x77b7('0x63')]({'plain':!![]});interaction_log[_0x77b7('0x25')](_0x77b7('0x7d'),_0x2dea85[_0x77b7('0x61')]['id'],_0x2dea85[_0x77b7('0x61')][_0x77b7('0x38')],_0x2dea85[_0x77b7('0x61')][_0x77b7('0x6a')],_0xbdf72f[_0x77b7('0x68')]['id'],_0x2dea85['body']?JSON['stringify'](_0x2dea85[_0x77b7('0x57')]):_0x77b7('0x7e'));return respondWithRpcPromise(_0x77b7('0x7f'),_0x77b7('0x80'),_0xbdf72f);}return null;})[_0x77b7('0x20')](function(_0x411810){var _0x385987=_0x77b7('0x81')+_0x411810[_0x77b7('0x24')][_0x77b7('0x6d')];return db['sequelize'][_0x77b7('0x41')](_0x385987,{'type':db[_0x77b7('0x6f')]['QueryTypes'][_0x77b7('0x70')],'raw':!![]})[_0x77b7('0x20')](function(_0x5d41fb){return _0x5d41fb;});})[_0x77b7('0x20')](function(_0x4ba5bd){if(_0x4ba5bd){_0xbdf72f[_0x77b7('0x24')][_0x77b7('0x71')]=_0x4ba5bd[0x0];if(!_0x2dea85[_0x77b7('0x57')][_0x77b7('0x60')])return;return db['User'][_0x77b7('0x55')]({'where':{'id':_0x2dea85['body'][_0x77b7('0x60')],'role':_0x77b7('0x62')},'attributes':['id',_0x77b7('0x38'),_0x77b7('0x73'),_0x77b7('0x74'),_0x77b7('0x82')],'raw':!![]});}return null;})[_0x77b7('0x20')](function(_0x2c4e23){if(!_0x2c4e23)return null;_0xbdf72f[_0x77b7('0x24')]['agent']=_0x2c4e23;return _0xbdf72f;})[_0x77b7('0x20')](function(_0x326b13){if(_0x326b13){_0x326b13[_0x77b7('0x24')][_0x77b7('0x76')]=util[_0x77b7('0x5e')](_0x77b7('0x77'),_0x2dea85['user']['name']);_0x326b13[_0x77b7('0x24')][_0x77b7('0x78')]=_0xbdf72f[_0x77b7('0x78')];_0x326b13['message'][_0x77b7('0x79')]=_0xbdf72f['channel'];_0x326b13[_0x77b7('0x24')][_0x77b7('0x7a')]=_0x77b7('0x32');respondWithRpcPromise(_0x77b7('0x7b'),_0x77b7('0x7b'),{'event':'rejectmessage','message':_0x326b13[_0x77b7('0x24')]},client9002);return _0xbdf72f;}return null;})['then'](respondWithResult(_0x48924c,null))[_0x77b7('0x28')](handleError(_0x48924c,null));};exports[_0x77b7('0x2a')]=function(_0x1a7afd,_0x2558fd,_0x11adb5){if(_0x1a7afd[_0x77b7('0x57')]['id']){delete _0x1a7afd['body']['id'];}var _0x1582ab;return db['SmsMessage'][_0x77b7('0x55')]({'where':{'id':_0x1a7afd['params']['id']}})[_0x77b7('0x20')](handleEntityNotFound(_0x2558fd,null))['then'](function(_0x2798da){if(_0x2798da){_0x1582ab=_0x2798da;return db['SmsAccount'][_0x77b7('0x55')]({'where':{'id':_0x2798da['SmsAccountId']}});}})[_0x77b7('0x20')](handleEntityNotFound(_0x2558fd,null))[_0x77b7('0x20')](function(_0x43faf7){if(_0x43faf7){logger['debug'](_0x77b7('0x83'),_0x77b7('0x2a'),_0x77b7('0x84'),_0x43faf7[_0x77b7('0x3e')],util['inspect'](_0x1a7afd[_0x77b7('0x57')],{'showHidden':![],'depth':null}));switch(_0x43faf7[_0x77b7('0x3e')]){case _0x77b7('0x85'):if(_0x1a7afd['body'][_0x77b7('0x86')]&&_0x1a7afd[_0x77b7('0x57')][_0x77b7('0x86')]===_0x1582ab[_0x77b7('0x87')]){return _0x1582ab[_0x77b7('0x34')]({'read':!![]});}else{logger['error'](_0x77b7('0x88'),_0x77b7('0x2a'),_0x77b7('0x85'),util[_0x77b7('0x89')](_0x1a7afd[_0x77b7('0x57')],{'showHidden':![],'depth':null}));}break;case _0x77b7('0x8a'):if(_0x1a7afd['body'][_0x77b7('0x8b')]&&_0x1a7afd[_0x77b7('0x57')][_0x77b7('0x8b')]===_0x1582ab['messageId']&&_[_0x77b7('0x8c')](['sent',_0x77b7('0x8d')],_0x1a7afd[_0x77b7('0x57')][_0x77b7('0x8e')])>=0x0){return _0x1582ab['update']({'read':!![]});}else{logger[_0x77b7('0x22')](_0x77b7('0x88'),_0x77b7('0x2a'),'plivio',util[_0x77b7('0x89')](_0x1a7afd['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5eb9de=_0x1a7afd['body'][_0x77b7('0x8f')][0x0];if(_0x5eb9de[_0x77b7('0x2a')][_0x77b7('0x90')]===_0x77b7('0x91')){return _0x1582ab[_0x77b7('0x34')]({'read':!![]});}else{logger[_0x77b7('0x22')](_0x77b7('0x88'),'status',_0x77b7('0x92'),util['inspect'](_0x1a7afd[_0x77b7('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x1582ab;}})[_0x77b7('0x20')](respondWithResult(_0x2558fd,null))[_0x77b7('0x28')](handleError(_0x2558fd,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index a8d745d..74b553b 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 _0xf214=['setMaxListeners','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x335ffa,_0x5ccc2b){var _0x5b242d=function(_0x57a48e){while(--_0x57a48e){_0x335ffa['push'](_0x335ffa['shift']());}};_0x5b242d(++_0x5ccc2b);}(_0xf214,0x133));var _0x4f21=function(_0x50a19b,_0x80c4d0){_0x50a19b=_0x50a19b-0x0;var _0x19b42d=_0xf214[_0x50a19b];return _0x19b42d;};'use strict';var EventEmitter=require(_0x4f21('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4f21('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4f21('0x2'),'afterDestroy':_0x4f21('0x3')};function emitEvent(_0x4b95fe){return function(_0x210f38,_0x47a70e,_0x392449){SmsMessageEvents['emit'](_0x4b95fe+':'+_0x210f38['id'],_0x210f38);SmsMessageEvents['emit'](_0x4b95fe,_0x210f38);_0x392449(null);};}for(var e in events){if(events[_0x4f21('0x4')](e)){var event=events[e];SmsMessage[_0x4f21('0x5')](e,emitEvent(event));}}module[_0x4f21('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0xde9d=['emit','hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','save','update','remove'];(function(_0x3db860,_0x4e3333){var _0x51d5ce=function(_0x1d25e1){while(--_0x1d25e1){_0x3db860['push'](_0x3db860['shift']());}};_0x51d5ce(++_0x4e3333);}(_0xde9d,0x18a));var _0xdde9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xde9d[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0xdde9('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xdde9('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdde9('0x2')](0x0);var events={'afterCreate':_0xdde9('0x3'),'afterUpdate':_0xdde9('0x4'),'afterDestroy':_0xdde9('0x5')};function emitEvent(_0x7f4cf9){return function(_0x3cf7bb,_0x775ab2,_0x1da865){SmsMessageEvents['emit'](_0x7f4cf9+':'+_0x3cf7bb['id'],_0x3cf7bb);SmsMessageEvents[_0xdde9('0x6')](_0x7f4cf9,_0x3cf7bb);_0x1da865(null);};}for(var e in events){if(events[_0xdde9('0x7')](e)){var event=events[e];SmsMessage[_0xdde9('0x8')](e,emitEvent(event));}}module[_0xdde9('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 198faf1..494762f 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 _0x0713=['phone','remote','/api/sms/messages/','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','clickSend','plivo','authId','senderString','/status?token=','token','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','login','keys','length','apiKey','createHash','digest','signature=','GET','/external/get/send.php?','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','Missing\x20parameters:\x20username,\x20password','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','application/json','refid','status','Token\x20not\x20received','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','isNil','SmsInteraction','findOne','then','update','createdAt','catch','error','out','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create'];(function(_0x515a7b,_0x55c5e7){var _0x32068c=function(_0x77aed4){while(--_0x77aed4){_0x515a7b['push'](_0x515a7b['shift']());}};_0x32068c(++_0x55c5e7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]},{'name':_0x3071('0xd'),'fields':[_0x3071('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3457cd,_0x2610b4,_0x937259){var _0xff9a29=_0xabd7b6[_0x3071('0xf')];var _0x4a470a=_0x3457cd[_0x3071('0x10')]({'plain':!![]});if(_0x4a470a[_0x3071('0x11')][_0x3071('0x12')]()==='in'||_0x4a470a[_0x3071('0x11')][_0x3071('0x12')]()==='out'&&!_0x4a470a['secret']&&!_[_0x3071('0x13')](_0x4a470a['UserId'])){_0xff9a29[_0x3071('0x14')][_0x3071('0x15')]({'where':{'id':_0x4a470a['SmsInteractionId']}})[_0x3071('0x16')](function(_0x4e1219){if(_0x4e1219){_0x4e1219[_0x3071('0x17')]({'lastMsgAt':_0x4a470a[_0x3071('0x18')],'lastMsgDirection':_0x4a470a[_0x3071('0x11')][_0x3071('0x12')]()});}})[_0x3071('0x19')](function(_0x2a6a4b){console[_0x3071('0x1a')](_0x2a6a4b);});}if(_0x4a470a[_0x3071('0x11')]===_0x3071('0x1b')&&!_0x4a470a[_0x3071('0x1c')]){var _0x5f3c22;_0xff9a29[_0x3071('0x1d')][_0x3071('0x1e')]({'where':{'id':_0x4a470a[_0x3071('0x1f')]},'raw':!![]})[_0x3071('0x16')](function(_0x3acf0e){_0x5f3c22=_0x3acf0e;if(_0x5f3c22&&_0x5f3c22[_0x3071('0x20')]){switch(_0x5f3c22[_0x3071('0x20')]){case _0x3071('0x21'):var _0x502a16=require(_0x3071('0x21'));if(_0x5f3c22[_0x3071('0x22')]&&_0x5f3c22[_0x3071('0x23')]&&_0x5f3c22['phone']){var _0xb8f4e3=new _0x502a16(_0x5f3c22['accountSid'],_0x5f3c22[_0x3071('0x23')]);_0xb8f4e3[_0x3071('0x24')][_0x3071('0x25')]({'body':_0x4a470a[_0x3071('0xe')],'to':_0x4a470a[_0x3071('0x26')],'from':_0x5f3c22[_0x3071('0x26')],'statusCallback':_0x5f3c22[_0x3071('0x27')]+_0x3071('0x28')+_0x4a470a['id']+'/status?token='+_0x5f3c22['token']})[_0x3071('0x16')](function(_0xb05b1d){if(_0xb05b1d[_0x3071('0x29')]){return _0x3457cd[_0x3071('0x17')]({'messageId':_0xb05b1d[_0x3071('0x29')]});}})[_0x3071('0x19')](function(_0x7a4cb4){logger[_0x3071('0x1a')](_0x3071('0x2a'),'afterCreate',_0x3071('0x21'),util[_0x3071('0x2b')](_0x7a4cb4,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x21'),_0x3071('0x2d'));}break;case _0x3071('0x2e'):var _0x3fa3b8=_0x3071('0x2f');if(_0x5f3c22[_0x3071('0x30')]&&_0x5f3c22[_0x3071('0x31')]){var _0x32f1b4={'recipient':[_0x4a470a[_0x3071('0x26')]],'message':_0x4a470a[_0x3071('0xe')],'message_type':_0x5f3c22['smsMethod']};if(_0x5f3c22['smsMethod']&&_0x5f3c22[_0x3071('0x32')]!=='SI'){_0x32f1b4[_0x3071('0x33')]=_0x5f3c22[_0x3071('0x26')];}var _0x32b2e2={'url':_0x3fa3b8+_0x3071('0x34')+_0x5f3c22[_0x3071('0x30')]+_0x3071('0x35')+_0x5f3c22[_0x3071('0x31')],'method':'GET'};rp(_0x32b2e2)['then'](function(_0x4ab983){var _0x1b0aaf=_0x4ab983[_0x3071('0x36')](';');var _0x5b5bf1={'user_key':_0x1b0aaf[0x0],'session_key':_0x1b0aaf[0x1]};_0x32b2e2={'url':_0x3fa3b8+_0x3071('0x37'),'method':_0x3071('0x38'),'headers':{'user_key':_0x5b5bf1[_0x3071('0x39')],'Session_key':_0x5b5bf1[_0x3071('0x3a')]},'json':!![],'body':_0x32f1b4};return rp(_0x32b2e2);})['then'](function(_0x218a82){if(_0x218a82[_0x3071('0x3b')]>=0x1){var _0x602719={'messageId':_0x218a82[_0x3071('0x3c')]};if(_0x5f3c22[_0x3071('0x32')]!=='GP'||!_0x5f3c22[_0x3071('0x3d')]){_0x602719[_0x3071('0x3e')]=!![];}return _0x3457cd[_0x3071('0x17')](_0x602719);}else{return logger['error'](_0x3071('0x2a'),'afterCreate','skebby',util[_0x3071('0x2b')](_0x218a82,{'showHidden':![],'depth':null}));}})[_0x3071('0x19')](function(_0x54d9c3){return logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x2e'),util[_0x3071('0x2b')](_0x54d9c3,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x2e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3071('0x3f'):if(_0x5f3c22['authToken']){var _0xda07a4={'recipient':_0x4a470a[_0x3071('0x26')],'message':_0x4a470a['body'],'sender':_0x5f3c22['senderString']||_0x5f3c22[_0x3071('0x26')],'authorization':_0x5f3c22[_0x3071('0x23')]};var _0x2610b4={'method':'POST','uri':_0x3071('0x40'),'body':_0xda07a4,'json':!![]};rp(_0x2610b4)['then'](function(_0x1ac90a){var _0x4b7928={'messageId':_0x1ac90a[_0x3071('0x41')]};if(!_0x5f3c22[_0x3071('0x3d')]){_0x4b7928[_0x3071('0x3e')]=!![];}return _0x3457cd[_0x3071('0x17')](_0x4b7928);})[_0x3071('0x19')](function(_0x593c9c){logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x3f'),util[_0x3071('0x2b')](_0x593c9c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x3f'),_0x3071('0x42'));}break;case _0x3071('0x43'):if(_0x5f3c22[_0x3071('0x30')]&&_0x5f3c22['password']){var _0xda07a4={'messages':[{'source':'xCALLY\x20Motion','to':_0x4a470a['phone'],'body':_0x4a470a['body'],'from':_0x5f3c22['senderString']||_0x5f3c22[_0x3071('0x26')]}]};var _0x456921=util[_0x3071('0x44')](_0x3071('0x45'),_0x5f3c22[_0x3071('0x30')],_0x5f3c22[_0x3071('0x31')]);var _0x2610b4={'method':_0x3071('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0xda07a4,'headers':{'Authorization':util[_0x3071('0x44')](_0x3071('0x46'),new Buffer(_0x456921)[_0x3071('0x47')](_0x3071('0x48')))},'json':!![]};rp(_0x2610b4)[_0x3071('0x16')](function(_0x5ef13f){if(_0x5ef13f['http_code']>=0xc8&&_0x5ef13f[_0x3071('0x49')]<=0xce){if(_0x5ef13f[_0x3071('0x4a')]&&_0x5ef13f[_0x3071('0x4a')][_0x3071('0x4b')]>0x0){var _0x606ef8=_['head'](_0x5ef13f[_0x3071('0x4a')]['messages']);var _0x18a773={'messageId':_0x606ef8['message_id']};if(!_0x5f3c22['deliveryReport']){_0x18a773[_0x3071('0x3e')]=!![];}return _0x3457cd['update'](_0x18a773);}else{logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x4c'),util[_0x3071('0x2b')](_0x5ef13f,{'showHidden':![],'depth':null}));}}else{logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),'clickSend',util[_0x3071('0x2b')](_0x5ef13f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x46924d){logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x4c'),util[_0x3071('0x2b')](_0x46924d,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x4c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3071('0x4d'):if(_0x5f3c22[_0x3071('0x4e')]&&_0x5f3c22[_0x3071('0x23')]){var _0xda07a4={'dst':_0x4a470a['phone'],'text':_0x4a470a[_0x3071('0xe')],'src':_0x5f3c22[_0x3071('0x4f')]||_0x5f3c22[_0x3071('0x26')],'url':_0x5f3c22[_0x3071('0x27')]+_0x3071('0x28')+_0x4a470a['id']+_0x3071('0x50')+_0x5f3c22[_0x3071('0x51')]};var _0x456921=util[_0x3071('0x44')](_0x3071('0x45'),_0x5f3c22[_0x3071('0x4e')],_0x5f3c22[_0x3071('0x23')]);var _0x2610b4={'method':_0x3071('0x38'),'uri':util[_0x3071('0x44')](_0x3071('0x52'),_0x5f3c22['authId']),'body':_0xda07a4,'headers':{'Authorization':util['format'](_0x3071('0x46'),new Buffer(_0x456921)['toString'](_0x3071('0x48')))},'json':!![]};rp(_0x2610b4)[_0x3071('0x16')](function(_0x15c6f8){var _0x514821={'messageId':_0x15c6f8[_0x3071('0x53')][0x0]};return _0x3457cd[_0x3071('0x17')](_0x514821);})['catch'](function(_0x4b8ec0){logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x4d'),util['inspect'](_0x4b8ec0,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x4d'),_0x3071('0x54'));}break;case'infobip':if(_0x5f3c22[_0x3071('0x30')]&&_0x5f3c22[_0x3071('0x31')]){if(_0x5f3c22[_0x3071('0x55')]){var _0x27bad1={'method':_0x3071('0x38'),'uri':_0x5f3c22[_0x3071('0x55')]+_0x3071('0x56'),'body':{'username':_0x5f3c22['username'],'password':_0x5f3c22['password']},'json':!![]};return rp(_0x27bad1)[_0x3071('0x16')](function(_0x4de4f3){var _0xe96994={'method':_0x3071('0x38'),'uri':_0x5f3c22['baseUrl']+_0x3071('0x57'),'body':{'messages':[{'from':_0x5f3c22[_0x3071('0x26')],'destinations':[{'to':_0x4a470a['phone']}],'text':_0x4a470a[_0x3071('0xe')],'notifyUrl':_0x5f3c22[_0x3071('0x27')]+_0x3071('0x28')+_0x4a470a['id']+_0x3071('0x50')+_0x5f3c22[_0x3071('0x51')],'notifyContentType':'application/json','callbackData':_0x5f3c22[_0x3071('0x26')]+';'+_0x4a470a[_0x3071('0xe')]}]},'headers':{'Authorization':_0x3071('0x58')+_0x4de4f3['token']},'json':!![]};return rp(_0xe96994)[_0x3071('0x16')](function(_0x238fa9){if(_0x238fa9[_0x3071('0x24')]){var _0x25680e={'messageId':_0x238fa9[_0x3071('0x24')][0x0][_0x3071('0xc')]};if(!_0x5f3c22[_0x3071('0x3d')]){_0x25680e[_0x3071('0x3e')]=!![];}return _0x3457cd[_0x3071('0x17')](_0x25680e);}else{return logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x59'),util[_0x3071('0x2b')](_0x238fa9,{'showHidden':![],'depth':null}));}});})[_0x3071('0x19')](function(_0x1543df){return logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x59'),util[_0x3071('0x2b')](_0x1543df,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x59'),_0x3071('0x5a'));}}else{logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x59'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3071('0x5b'):var _0x1ebd77=require('crypto');if(_0x5f3c22['apiKey']){var _0x147856={};_0x147856[_0x3071('0x5c')]=_0x5f3c22[_0x3071('0x30')];_0x147856[_0x3071('0x26')]=_0x4a470a['phone'];_0x147856['sender']=_0x5f3c22[_0x3071('0x26')];_0x147856['text']=_0x4a470a['body'];_0x147856['timestamp']=+new Date();var _0x58da43='';var _0xec6f46='';var _0x1da52c=Object[_0x3071('0x5d')](_0x147856);_0x1da52c['sort']();for(var _0x492328=0x0;_0x492328<_0x1da52c[_0x3071('0x5e')];_0x492328++){if(_0x58da43!=''){_0x58da43+='&';}_0x58da43+=_0x1da52c[_0x492328]+'='+encodeURIComponent(_0x147856[_0x1da52c[_0x492328]]);_0xec6f46+=_0x147856[_0x1da52c[_0x492328]];}_0xec6f46+=_0x5f3c22[_0x3071('0x5f')];_0xec6f46=_0x1ebd77[_0x3071('0x60')]('md5')[_0x3071('0x17')](_0xec6f46)[_0x3071('0x61')]('hex');if(_0x58da43!==''){_0x58da43+='&';}_0x58da43+=_0x3071('0x62')+_0xec6f46;var _0x32b2e2={'method':_0x3071('0x63'),'uri':_0x5f3c22[_0x3071('0x55')]+_0x3071('0x64')+_0x58da43,'json':!![]};return rp(_0x32b2e2)[_0x3071('0x16')](function(_0x2deac2){var _0x5d83aa=Object['keys'](_0x2deac2);if(_0x2deac2[_0x5d83aa[0x0]][_0x3071('0x1a')]&&parseInt(_0x2deac2[_0x5d83aa[0x0]][_0x3071('0x1a')])===0x0){var _0x1456ce={'messageId':_0x2deac2[_0x5d83aa[0x0]]['id_sms']};if(!_0x5f3c22['deliveryReport']){_0x1456ce[_0x3071('0x3e')]=!![];}return _0x3457cd[_0x3071('0x17')](_0x1456ce);}else{return logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x5b'),util[_0x3071('0x2b')](_0x2deac2[_0x3071('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4ce89b){return logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x5b'),util[_0x3071('0x2b')](_0x4ce89b,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x5b'),'Missing\x20parameters:\x20apiKey');}break;case _0x3071('0x65'):if(_0x5f3c22[_0x3071('0x5f')]){var _0x1da477={'method':'POST','uri':_0x3071('0x66'),'headers':{'Authorization':_0x5f3c22[_0x3071('0x5f')]},'body':{'content':_0x4a470a[_0x3071('0xe')],'to':[_0x4a470a['phone']],'from':_0x5f3c22['phone'],'binary':![],'clientMessageId':_0x3071('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0x1da477)[_0x3071('0x16')](function(_0x10a207){if(!_0x10a207[_0x3071('0x1a')]){var _0x23bc22={'messageId':_0x10a207[_0x3071('0x24')][0x0][_0x3071('0x68')]};if(!_0x5f3c22[_0x3071('0x3d')]){_0x23bc22['read']=!![];}return _0x3457cd[_0x3071('0x17')](_0x23bc22);}else{return logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x65'),util[_0x3071('0x2b')](_0x10a207[_0x3071('0x1a')],{'showHidden':![],'depth':null}));}})[_0x3071('0x19')](function(_0x4bc640){return logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x65'),util[_0x3071('0x2b')](_0x4bc640,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x65'),_0x3071('0x69'));}break;case _0x3071('0x6a'):if(_0x5f3c22[_0x3071('0x30')]&&_0x5f3c22['password']){var _0x456921=util[_0x3071('0x44')]('%s:%s',_0x5f3c22[_0x3071('0x30')],_0x5f3c22[_0x3071('0x31')]);var _0x2610b4={'method':_0x3071('0x38'),'uri':_0x3071('0x6b')+_0x5f3c22['accountId']+'/messages','body':{'to':[_0x4a470a[_0x3071('0x26')]],'text':_0x4a470a['body'],'from':_0x5f3c22[_0x3071('0x26')],'applicationId':_0x5f3c22[_0x3071('0x6c')]},'headers':{'Authorization':util[_0x3071('0x44')](_0x3071('0x46'),new Buffer(_0x456921)[_0x3071('0x47')](_0x3071('0x48')))},'json':!![]};rp(_0x2610b4)['then'](function(_0x290d1c){if(_0x290d1c['id']){var _0xa732ea={'messageId':_0x290d1c['id']};return _0x3457cd[_0x3071('0x17')](_0xa732ea);}else{logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x6a'),util['inspect'](_0x290d1c,{'showHidden':![],'depth':null}));}})[_0x3071('0x19')](function(_0x2ea7e9){logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),'bandwidth',util[_0x3071('0x2b')](_0x2ea7e9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x6a'),_0x3071('0x6d'));}break;case _0x3071('0x6e'):if(_0x5f3c22[_0x3071('0x5f')]){var _0x11d654={};var _0x32b2e2={'method':'POST','uri':_0x3071('0x6f'),'headers':{'Authorization':_0x3071('0x70')+_0x5f3c22[_0x3071('0x5f')],'Content-Type':'application/json'},'body':{'from':_0x5f3c22[_0x3071('0x26')],'to':_0x4a470a['phone'],'text':_0x4a470a[_0x3071('0xe')]},'json':!![]};return rp(_0x32b2e2)[_0x3071('0x16')](function(_0x2f1761){if(_0x2f1761['code']==0xca){_0x11d654[_0x3071('0x71')]=_0x2f1761;var _0x2ef706={'method':_0x3071('0x38'),'uri':_0x3071('0x72'),'headers':{'Authorization':_0x3071('0x70')+_0x5f3c22[_0x3071('0x5f')],'Content-Type':_0x3071('0x73')},'body':{'refid':_0x11d654[_0x3071('0x71')][_0x3071('0x74')]},'json':!![]};return rp(_0x2ef706)['then'](function(_0x1429d2){_0x11d654[_0x3071('0x75')]=_0x1429d2;var _0x34b376={'messageId':_0x11d654['message']['refid'],'read':!![]};return _0x3457cd['update'](_0x34b376);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x6e'),util['inspect'](_0x2f1761,{'showHidden':![],'depth':null}));}})[_0x3071('0x19')](function(_0x195227){return logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3071('0x6e'),util[_0x3071('0x2b')](_0x195227,{'showHidden':![],'depth':null}));});}else{return logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x6e'),_0x3071('0x76'));}break;}}})['finally'](function(){_0x937259();});}else{_0x937259();}}},'charset':'utf8mb4','collate':_0x3071('0x77')});}; \ No newline at end of file +var _0xe74e=['https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','messageId','fti_sms_messages','models','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','error','out','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','format','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','/auth/1/session','baseUrl','remote','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','keys','sort','length','createHash','md5','digest','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey'];(function(_0x31ffcf,_0x326559){var _0x53c38c=function(_0x28972b){while(--_0x28972b){_0x31ffcf['push'](_0x31ffcf['shift']());}};_0x53c38c(++_0x326559);}(_0xe74e,0x10a));var _0xee74=function(_0x57d566,_0x20eef6){_0x57d566=_0x57d566-0x0;var _0x106c44=_0xe74e[_0x57d566];return _0x106c44;};'use strict';var _=require('lodash');var util=require(_0xee74('0x0'));var logger=require(_0xee74('0x1'))(_0xee74('0x2'));var moment=require(_0xee74('0x3'));var BPromise=require(_0xee74('0x4'));var rp=require(_0xee74('0x5'));var fs=require('fs');var path=require(_0xee74('0x6'));var rimraf=require(_0xee74('0x7'));var config=require(_0xee74('0x8'));var attributes=require(_0xee74('0x9'));module['exports']=function(_0x483d0a,_0xbb9d43){return _0x483d0a[_0xee74('0xa')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xee74('0xb'),'fields':[_0xee74('0xb')]},{'name':_0xee74('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12f2b7,_0x28ae0d,_0xe6609e){var _0x1c68e8=_0x483d0a[_0xee74('0xd')];var _0x90033d=_0x12f2b7['get']({'plain':!![]});if(_0x90033d[_0xee74('0xe')][_0xee74('0xf')]()==='in'||_0x90033d[_0xee74('0xe')][_0xee74('0xf')]()==='out'&&!_0x90033d[_0xee74('0x10')]&&!_[_0xee74('0x11')](_0x90033d[_0xee74('0x12')])){_0x1c68e8[_0xee74('0x13')]['findOne']({'where':{'id':_0x90033d[_0xee74('0x14')]}})[_0xee74('0x15')](function(_0x2dfe0f){if(_0x2dfe0f){_0x2dfe0f[_0xee74('0x16')]({'lastMsgAt':_0x90033d[_0xee74('0x17')],'lastMsgDirection':_0x90033d[_0xee74('0xe')]['toLowerCase']()});}})[_0xee74('0x18')](function(_0x456c3f){console[_0xee74('0x19')](_0x456c3f);});}if(_0x90033d['direction']===_0xee74('0x1a')&&!_0x90033d[_0xee74('0x10')]){var _0x5aa1db;_0x1c68e8['SmsAccount'][_0xee74('0x1b')]({'where':{'id':_0x90033d[_0xee74('0x1c')]},'raw':!![]})[_0xee74('0x15')](function(_0x320c54){_0x5aa1db=_0x320c54;if(_0x5aa1db&&_0x5aa1db[_0xee74('0x1d')]){switch(_0x5aa1db['type']){case _0xee74('0x1e'):var _0x165059=require('twilio');if(_0x5aa1db[_0xee74('0x1f')]&&_0x5aa1db[_0xee74('0x20')]&&_0x5aa1db[_0xee74('0x21')]){var _0x23ab9e=new _0x165059(_0x5aa1db[_0xee74('0x1f')],_0x5aa1db['authToken']);_0x23ab9e[_0xee74('0x22')][_0xee74('0x23')]({'body':_0x90033d[_0xee74('0x24')],'to':_0x90033d[_0xee74('0x21')],'from':_0x5aa1db['phone'],'statusCallback':_0x5aa1db['remote']+'/api/sms/messages/'+_0x90033d['id']+_0xee74('0x25')+_0x5aa1db[_0xee74('0x26')]})[_0xee74('0x15')](function(_0x1aa325){if(_0x1aa325[_0xee74('0x27')]){return _0x12f2b7[_0xee74('0x16')]({'messageId':_0x1aa325[_0xee74('0x27')]});}})[_0xee74('0x18')](function(_0x7bbf7e){logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x1e'),util[_0xee74('0x2a')](_0x7bbf7e,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x1e'),_0xee74('0x2b'));}break;case _0xee74('0x2c'):var _0x5c6096=_0xee74('0x2d');if(_0x5aa1db[_0xee74('0x2e')]&&_0x5aa1db[_0xee74('0x2f')]){var _0x1da568={'recipient':[_0x90033d[_0xee74('0x21')]],'message':_0x90033d[_0xee74('0x24')],'message_type':_0x5aa1db['smsMethod']};if(_0x5aa1db[_0xee74('0x30')]&&_0x5aa1db[_0xee74('0x30')]!=='SI'){_0x1da568[_0xee74('0x31')]=_0x5aa1db['phone'];}var _0x170e5d={'url':_0x5c6096+_0xee74('0x32')+_0x5aa1db[_0xee74('0x2e')]+_0xee74('0x33')+_0x5aa1db[_0xee74('0x2f')],'method':_0xee74('0x34')};rp(_0x170e5d)[_0xee74('0x15')](function(_0xb8cc6f){var _0x378dbd=_0xb8cc6f[_0xee74('0x35')](';');var _0x5bad7c={'user_key':_0x378dbd[0x0],'session_key':_0x378dbd[0x1]};_0x170e5d={'url':_0x5c6096+_0xee74('0x36'),'method':'POST','headers':{'user_key':_0x5bad7c['user_key'],'Session_key':_0x5bad7c[_0xee74('0x37')]},'json':!![],'body':_0x1da568};return rp(_0x170e5d);})['then'](function(_0x569507){if(_0x569507[_0xee74('0x38')]>=0x1){var _0xbfdcf9={'messageId':_0x569507['internal_order_id']};if(_0x5aa1db[_0xee74('0x30')]!=='GP'||!_0x5aa1db[_0xee74('0x39')]){_0xbfdcf9[_0xee74('0x3a')]=!![];}return _0x12f2b7[_0xee74('0x16')](_0xbfdcf9);}else{return logger['error'](_0xee74('0x28'),'afterCreate',_0xee74('0x2c'),util[_0xee74('0x2a')](_0x569507,{'showHidden':![],'depth':null}));}})[_0xee74('0x18')](function(_0x5001e9){return logger[_0xee74('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xee74('0x2c'),util[_0xee74('0x2a')](_0x5001e9,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xee74('0x2c'),_0xee74('0x3b'));}break;case _0xee74('0x3c'):if(_0x5aa1db[_0xee74('0x20')]){var _0x56fc25={'recipient':_0x90033d[_0xee74('0x21')],'message':_0x90033d[_0xee74('0x24')],'sender':_0x5aa1db[_0xee74('0x3d')]||_0x5aa1db[_0xee74('0x21')],'authorization':_0x5aa1db[_0xee74('0x20')]};var _0x28ae0d={'method':_0xee74('0x3e'),'uri':_0xee74('0x3f'),'body':_0x56fc25,'json':!![]};rp(_0x28ae0d)[_0xee74('0x15')](function(_0x56dd55){var _0x28d7d8={'messageId':_0x56dd55[_0xee74('0x40')]};if(!_0x5aa1db[_0xee74('0x39')]){_0x28d7d8[_0xee74('0x3a')]=!![];}return _0x12f2b7['update'](_0x28d7d8);})['catch'](function(_0x3369bf){logger['error'](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x3c'),util[_0xee74('0x2a')](_0x3369bf,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),'afterCreate',_0xee74('0x3c'),_0xee74('0x41'));}break;case _0xee74('0x42'):if(_0x5aa1db[_0xee74('0x2e')]&&_0x5aa1db['password']){var _0x56fc25={'messages':[{'source':_0xee74('0x43'),'to':_0x90033d[_0xee74('0x21')],'body':_0x90033d[_0xee74('0x24')],'from':_0x5aa1db['senderString']||_0x5aa1db['phone']}]};var _0x3c8ec2=util['format'](_0xee74('0x44'),_0x5aa1db[_0xee74('0x2e')],_0x5aa1db[_0xee74('0x2f')]);var _0x28ae0d={'method':_0xee74('0x3e'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x56fc25,'headers':{'Authorization':util[_0xee74('0x45')](_0xee74('0x46'),new Buffer(_0x3c8ec2)[_0xee74('0x47')]('base64'))},'json':!![]};rp(_0x28ae0d)[_0xee74('0x15')](function(_0xa0bc6f){if(_0xa0bc6f['http_code']>=0xc8&&_0xa0bc6f[_0xee74('0x48')]<=0xce){if(_0xa0bc6f[_0xee74('0x49')]&&_0xa0bc6f['data'][_0xee74('0x4a')]>0x0){var _0x10416c=_[_0xee74('0x4b')](_0xa0bc6f[_0xee74('0x49')]['messages']);var _0x36a78a={'messageId':_0x10416c[_0xee74('0x4c')]};if(!_0x5aa1db['deliveryReport']){_0x36a78a[_0xee74('0x3a')]=!![];}return _0x12f2b7['update'](_0x36a78a);}else{logger['error'](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x4d'),util[_0xee74('0x2a')](_0xa0bc6f,{'showHidden':![],'depth':null}));}}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x4d'),util[_0xee74('0x2a')](_0xa0bc6f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5ad786){logger[_0xee74('0x19')](_0xee74('0x28'),'afterCreate',_0xee74('0x4d'),util[_0xee74('0x2a')](_0x5ad786,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x4d'),_0xee74('0x3b'));}break;case _0xee74('0x4e'):if(_0x5aa1db[_0xee74('0x4f')]&&_0x5aa1db[_0xee74('0x20')]){var _0x56fc25={'dst':_0x90033d[_0xee74('0x21')],'text':_0x90033d[_0xee74('0x24')],'src':_0x5aa1db[_0xee74('0x3d')]||_0x5aa1db['phone'],'url':_0x5aa1db['remote']+_0xee74('0x50')+_0x90033d['id']+_0xee74('0x25')+_0x5aa1db[_0xee74('0x26')]};var _0x3c8ec2=util[_0xee74('0x45')](_0xee74('0x44'),_0x5aa1db[_0xee74('0x4f')],_0x5aa1db['authToken']);var _0x28ae0d={'method':_0xee74('0x3e'),'uri':util[_0xee74('0x45')](_0xee74('0x51'),_0x5aa1db[_0xee74('0x4f')]),'body':_0x56fc25,'headers':{'Authorization':util[_0xee74('0x45')](_0xee74('0x46'),new Buffer(_0x3c8ec2)['toString'](_0xee74('0x52')))},'json':!![]};rp(_0x28ae0d)[_0xee74('0x15')](function(_0x25dfc4){var _0x23cae9={'messageId':_0x25dfc4[_0xee74('0x53')][0x0]};return _0x12f2b7[_0xee74('0x16')](_0x23cae9);})[_0xee74('0x18')](function(_0xa4a705){logger['error'](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x4e'),util['inspect'](_0xa4a705,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),'afterCreate',_0xee74('0x4e'),_0xee74('0x54'));}break;case'infobip':if(_0x5aa1db['username']&&_0x5aa1db[_0xee74('0x2f')]){if(_0x5aa1db['baseUrl']){var _0x194c24={'method':'POST','uri':_0x5aa1db['baseUrl']+_0xee74('0x55'),'body':{'username':_0x5aa1db['username'],'password':_0x5aa1db[_0xee74('0x2f')]},'json':!![]};return rp(_0x194c24)[_0xee74('0x15')](function(_0x5aa70a){var _0x530847={'method':_0xee74('0x3e'),'uri':_0x5aa1db[_0xee74('0x56')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5aa1db['phone'],'destinations':[{'to':_0x90033d[_0xee74('0x21')]}],'text':_0x90033d[_0xee74('0x24')],'notifyUrl':_0x5aa1db[_0xee74('0x57')]+_0xee74('0x50')+_0x90033d['id']+_0xee74('0x25')+_0x5aa1db[_0xee74('0x26')],'notifyContentType':'application/json','callbackData':_0x5aa1db[_0xee74('0x21')]+';'+_0x90033d[_0xee74('0x24')]}]},'headers':{'Authorization':_0xee74('0x58')+_0x5aa70a['token']},'json':!![]};return rp(_0x530847)[_0xee74('0x15')](function(_0x4531da){if(_0x4531da[_0xee74('0x22')]){var _0xbdc844={'messageId':_0x4531da['messages'][0x0][_0xee74('0xb')]};if(!_0x5aa1db[_0xee74('0x39')]){_0xbdc844[_0xee74('0x3a')]=!![];}return _0x12f2b7[_0xee74('0x16')](_0xbdc844);}else{return logger[_0xee74('0x19')](_0xee74('0x28'),'afterCreate','infobip',util['inspect'](_0x4531da,{'showHidden':![],'depth':null}));}});})[_0xee74('0x18')](function(_0x210d11){return logger['error'](_0xee74('0x28'),'afterCreate',_0xee74('0x59'),util[_0xee74('0x2a')](_0x210d11,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),'infobip',_0xee74('0x5a'));}}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x59'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xee74('0x5b'):var _0x6cc9f9=require(_0xee74('0x5c'));if(_0x5aa1db[_0xee74('0x5d')]){var _0xfcaaf0={};_0xfcaaf0[_0xee74('0x5e')]=_0x5aa1db[_0xee74('0x2e')];_0xfcaaf0['phone']=_0x90033d['phone'];_0xfcaaf0[_0xee74('0x31')]=_0x5aa1db[_0xee74('0x21')];_0xfcaaf0[_0xee74('0x5f')]=_0x90033d[_0xee74('0x24')];_0xfcaaf0['timestamp']=+new Date();var _0xca1d1d='';var _0x3d0a8e='';var _0x47d2b9=Object[_0xee74('0x60')](_0xfcaaf0);_0x47d2b9[_0xee74('0x61')]();for(var _0x2b09af=0x0;_0x2b09af<_0x47d2b9[_0xee74('0x62')];_0x2b09af++){if(_0xca1d1d!=''){_0xca1d1d+='&';}_0xca1d1d+=_0x47d2b9[_0x2b09af]+'='+encodeURIComponent(_0xfcaaf0[_0x47d2b9[_0x2b09af]]);_0x3d0a8e+=_0xfcaaf0[_0x47d2b9[_0x2b09af]];}_0x3d0a8e+=_0x5aa1db['apiKey'];_0x3d0a8e=_0x6cc9f9[_0xee74('0x63')](_0xee74('0x64'))[_0xee74('0x16')](_0x3d0a8e)[_0xee74('0x65')]('hex');if(_0xca1d1d!==''){_0xca1d1d+='&';}_0xca1d1d+=_0xee74('0x66')+_0x3d0a8e;var _0x170e5d={'method':'GET','uri':_0x5aa1db[_0xee74('0x56')]+_0xee74('0x67')+_0xca1d1d,'json':!![]};return rp(_0x170e5d)[_0xee74('0x15')](function(_0x210623){var _0x4929a9=Object[_0xee74('0x60')](_0x210623);if(_0x210623[_0x4929a9[0x0]][_0xee74('0x19')]&&parseInt(_0x210623[_0x4929a9[0x0]][_0xee74('0x19')])===0x0){var _0x592a60={'messageId':_0x210623[_0x4929a9[0x0]][_0xee74('0x68')]};if(!_0x5aa1db[_0xee74('0x39')]){_0x592a60[_0xee74('0x3a')]=!![];}return _0x12f2b7[_0xee74('0x16')](_0x592a60);}else{return logger[_0xee74('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xee74('0x29'),_0xee74('0x5b'),util[_0xee74('0x2a')](_0x210623['error'],{'showHidden':![],'depth':null}));}})[_0xee74('0x18')](function(_0x46c794){return logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x5b'),util['inspect'](_0x46c794,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x5b'),_0xee74('0x69'));}break;case'clickatell':if(_0x5aa1db[_0xee74('0x5d')]){var _0x21354a={'method':_0xee74('0x3e'),'uri':_0xee74('0x6a'),'headers':{'Authorization':_0x5aa1db[_0xee74('0x5d')]},'body':{'content':_0x90033d[_0xee74('0x24')],'to':[_0x90033d[_0xee74('0x21')]],'from':_0x5aa1db['phone'],'binary':![],'clientMessageId':_0xee74('0x6b'),'charset':_0xee74('0x6c')},'json':!![]};rp(_0x21354a)[_0xee74('0x15')](function(_0x234735){if(!_0x234735[_0xee74('0x19')]){var _0x577b1e={'messageId':_0x234735['messages'][0x0]['apiMessageId']};if(!_0x5aa1db['deliveryReport']){_0x577b1e[_0xee74('0x3a')]=!![];}return _0x12f2b7['update'](_0x577b1e);}else{return logger[_0xee74('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xee74('0x29'),'clickatell',util[_0xee74('0x2a')](_0x234735[_0xee74('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x55b382){return logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x6d'),util[_0xee74('0x2a')](_0x55b382,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xee74('0x29'),_0xee74('0x6d'),_0xee74('0x69'));}break;case _0xee74('0x6e'):if(_0x5aa1db['username']&&_0x5aa1db[_0xee74('0x2f')]){var _0x3c8ec2=util[_0xee74('0x45')](_0xee74('0x44'),_0x5aa1db[_0xee74('0x2e')],_0x5aa1db[_0xee74('0x2f')]);var _0x28ae0d={'method':_0xee74('0x3e'),'uri':_0xee74('0x6f')+_0x5aa1db[_0xee74('0x70')]+_0xee74('0x71'),'body':{'to':[_0x90033d['phone']],'text':_0x90033d[_0xee74('0x24')],'from':_0x5aa1db[_0xee74('0x21')],'applicationId':_0x5aa1db['applicationId']},'headers':{'Authorization':util[_0xee74('0x45')](_0xee74('0x46'),new Buffer(_0x3c8ec2)[_0xee74('0x47')](_0xee74('0x52')))},'json':!![]};rp(_0x28ae0d)[_0xee74('0x15')](function(_0x15cd5c){if(_0x15cd5c['id']){var _0x58a6ce={'messageId':_0x15cd5c['id']};return _0x12f2b7[_0xee74('0x16')](_0x58a6ce);}else{logger['error'](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x6e'),util['inspect'](_0x15cd5c,{'showHidden':![],'depth':null}));}})[_0xee74('0x18')](function(_0x17e148){logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x6e'),util[_0xee74('0x2a')](_0x17e148,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x6e'),_0xee74('0x3b'));}break;case _0xee74('0x72'):if(_0x5aa1db['apiKey']){var _0x1a768f={};var _0x170e5d={'method':_0xee74('0x3e'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xee74('0x73')+_0x5aa1db[_0xee74('0x5d')],'Content-Type':_0xee74('0x74')},'body':{'from':_0x5aa1db[_0xee74('0x21')],'to':_0x90033d['phone'],'text':_0x90033d[_0xee74('0x24')]},'json':!![]};return rp(_0x170e5d)[_0xee74('0x15')](function(_0x2e9329){if(_0x2e9329['code']==0xca){_0x1a768f[_0xee74('0x75')]=_0x2e9329;var _0x5480a3={'method':_0xee74('0x3e'),'uri':_0xee74('0x76'),'headers':{'Authorization':_0xee74('0x73')+_0x5aa1db[_0xee74('0x5d')],'Content-Type':_0xee74('0x74')},'body':{'refid':_0x1a768f[_0xee74('0x75')][_0xee74('0x77')]},'json':!![]};return rp(_0x5480a3)[_0xee74('0x15')](function(_0x45c563){_0x1a768f[_0xee74('0x78')]=_0x45c563;var _0x1dc3f1={'messageId':_0x1a768f['message'][_0xee74('0x77')],'read':!![]};return _0x12f2b7['update'](_0x1dc3f1);});}else{return logger[_0xee74('0x19')](_0xee74('0x28'),'afterCreate',_0xee74('0x72'),util['inspect'](_0x2e9329,{'showHidden':![],'depth':null}));}})[_0xee74('0x18')](function(_0x2fd7a4){return logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x72'),util['inspect'](_0x2fd7a4,{'showHidden':![],'depth':null}));});}else{return logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x72'),_0xee74('0x79'));}break;}}})[_0xee74('0x7a')](function(){_0xe6609e();});}else{_0xe6609e();}}},'charset':'utf8mb4','collate':_0xee74('0x7b')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 71294cc..ed410bd 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 _0xd251=['moment','bluebird','randomstring','ioredis','../../config/logger','client','http','redis','defaults','localhost','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','SmsMessage','create','body','options','raw','then','CreateSmsMessage','util'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xd251,0x117));var _0x1d25=function(_0x11fd79,_0x5b1707){_0x11fd79=_0x11fd79-0x0;var _0x15e462=_0xd251[_0x11fd79];return _0x15e462;};'use strict';var _=require('lodash');var util=require(_0x1d25('0x0'));var moment=require(_0x1d25('0x1'));var BPromise=require(_0x1d25('0x2'));var rs=require(_0x1d25('0x3'));var fs=require('fs');var Redis=require(_0x1d25('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1d25('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d25('0x6')][_0x1d25('0x7')]({'port':0x232a});config[_0x1d25('0x8')]=_[_0x1d25('0x9')](config['redis'],{'host':_0x1d25('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d25('0x8')]));require(_0x1d25('0xb'))[_0x1d25('0xc')](socket);function respondWithRpcPromise(_0x41057b,_0x44fe3b,_0x2d5759){return new BPromise(function(_0x10d70c,_0xeba472){return client[_0x1d25('0xd')](_0x41057b,_0x2d5759)['then'](function(_0x8959b9){logger[_0x1d25('0xe')](_0x1d25('0xf'),_0x44fe3b,_0x1d25('0x10'));logger[_0x1d25('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44fe3b,'request\x20sent',JSON['stringify'](_0x8959b9));if(_0x8959b9[_0x1d25('0x12')]){if(_0x8959b9[_0x1d25('0x12')]['code']===0x1f4){logger['error'](_0x1d25('0xf'),_0x44fe3b,_0x8959b9[_0x1d25('0x12')][_0x1d25('0x13')]);return _0xeba472(_0x8959b9[_0x1d25('0x12')][_0x1d25('0x13')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x44fe3b,_0x8959b9[_0x1d25('0x12')][_0x1d25('0x13')]);return _0x10d70c(_0x8959b9[_0x1d25('0x12')][_0x1d25('0x13')]);}else{logger[_0x1d25('0xe')](_0x1d25('0xf'),_0x44fe3b,_0x1d25('0x10'));_0x10d70c(_0x8959b9['result'][_0x1d25('0x13')]);}})[_0x1d25('0x14')](function(_0x571772){logger[_0x1d25('0x12')]('SmsMessage,\x20%s,\x20%s',_0x44fe3b,_0x571772);_0xeba472(_0x571772);});});}exports['CreateSmsMessage']=function(_0x190b97){var _0x484768=this;return new Promise(function(_0x4789be,_0x26c7f3){return db[_0x1d25('0x15')][_0x1d25('0x16')](_0x190b97[_0x1d25('0x17')],{'raw':_0x190b97[_0x1d25('0x18')]?_0x190b97['options'][_0x1d25('0x19')]===undefined?!![]:![]:!![]})[_0x1d25('0x1a')](function(_0x1f4ac6){logger['info']('CreateSmsMessage',_0x190b97);logger[_0x1d25('0x11')](_0x1d25('0x1b'),_0x190b97,JSON['stringify'](_0x1f4ac6));_0x4789be(_0x1f4ac6);})['catch'](function(_0x487ab7){logger[_0x1d25('0x12')](_0x1d25('0x1b'),_0x487ab7[_0x1d25('0x13')],_0x190b97);_0x26c7f3(_0x484768[_0x1d25('0x12')](0x1f4,_0x487ab7['message']));});});}; \ No newline at end of file +var _0x7cf6=['info','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','SmsMessage','body','options','raw','CreateSmsMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','then'];(function(_0x57bf00,_0x506b93){var _0x5a9564=function(_0x4ebda9){while(--_0x4ebda9){_0x57bf00['push'](_0x57bf00['shift']());}};_0x5a9564(++_0x506b93);}(_0x7cf6,0x18f));var _0x67cf=function(_0x3fddab,_0x355100){_0x3fddab=_0x3fddab-0x0;var _0x372a03=_0x7cf6[_0x3fddab];return _0x372a03;};'use strict';var _=require(_0x67cf('0x0'));var util=require(_0x67cf('0x1'));var moment=require(_0x67cf('0x2'));var BPromise=require('bluebird');var rs=require(_0x67cf('0x3'));var fs=require('fs');var Redis=require(_0x67cf('0x4'));var db=require(_0x67cf('0x5'))['db'];var utils=require(_0x67cf('0x6'));var logger=require(_0x67cf('0x7'))(_0x67cf('0x8'));var config=require('../../config/environment');var jayson=require(_0x67cf('0x9'));var client=jayson[_0x67cf('0xa')][_0x67cf('0xb')]({'port':0x232a});config[_0x67cf('0xc')]=_[_0x67cf('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x67cf('0xe'))(new Redis(config[_0x67cf('0xc')]));require(_0x67cf('0xf'))['register'](socket);function respondWithRpcPromise(_0x2ce9f5,_0x54a995,_0x106400){return new BPromise(function(_0x1d361d,_0x4fb013){return client['request'](_0x2ce9f5,_0x106400)[_0x67cf('0x10')](function(_0x5d7fe3){logger[_0x67cf('0x11')]('SmsMessage,\x20%s,\x20%s',_0x54a995,'request\x20sent');logger['debug'](_0x67cf('0x12'),_0x54a995,_0x67cf('0x13'),JSON[_0x67cf('0x14')](_0x5d7fe3));if(_0x5d7fe3['error']){if(_0x5d7fe3[_0x67cf('0x15')][_0x67cf('0x16')]===0x1f4){logger[_0x67cf('0x15')](_0x67cf('0x17'),_0x54a995,_0x5d7fe3[_0x67cf('0x15')]['message']);return _0x4fb013(_0x5d7fe3[_0x67cf('0x15')]['message']);}logger[_0x67cf('0x15')]('SmsMessage,\x20%s,\x20%s',_0x54a995,_0x5d7fe3[_0x67cf('0x15')][_0x67cf('0x18')]);return _0x1d361d(_0x5d7fe3[_0x67cf('0x15')][_0x67cf('0x18')]);}else{logger[_0x67cf('0x11')](_0x67cf('0x17'),_0x54a995,_0x67cf('0x13'));_0x1d361d(_0x5d7fe3[_0x67cf('0x19')]['message']);}})[_0x67cf('0x1a')](function(_0x40a4b8){logger[_0x67cf('0x15')](_0x67cf('0x17'),_0x54a995,_0x40a4b8);_0x4fb013(_0x40a4b8);});});}exports['CreateSmsMessage']=function(_0x5a191b){var _0x5f2f7e=this;return new Promise(function(_0x32b46e,_0x5695f7){return db[_0x67cf('0x1b')]['create'](_0x5a191b[_0x67cf('0x1c')],{'raw':_0x5a191b[_0x67cf('0x1d')]?_0x5a191b['options'][_0x67cf('0x1e')]===undefined?!![]:![]:!![]})[_0x67cf('0x10')](function(_0x5e1ce3){logger[_0x67cf('0x11')](_0x67cf('0x1f'),_0x5a191b);logger['debug']('CreateSmsMessage',_0x5a191b,JSON[_0x67cf('0x14')](_0x5e1ce3));_0x32b46e(_0x5e1ce3);})['catch'](function(_0x3fca65){logger[_0x67cf('0x15')](_0x67cf('0x1f'),_0x3fca65[_0x67cf('0x18')],_0x5a191b);_0x5695f7(_0x5f2f7e[_0x67cf('0x15')](0x1f4,_0x3fca65[_0x67cf('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 1e33082..339f755 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 _0x4e4f=['./smsMessage.events','save','remove','update','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4e4f,0x186));var _0xf4e4=function(_0xa50d5d,_0x2be88b){_0xa50d5d=_0xa50d5d-0x0;var _0xb6c97b=_0x4e4f[_0xa50d5d];return _0xb6c97b;};'use strict';var SmsMessageEvents=require(_0xf4e4('0x0'));var events=[_0xf4e4('0x1'),_0xf4e4('0x2'),_0xf4e4('0x3')];function createListener(_0x285fbc,_0x5d0417){return function(_0x5bb61d){_0x5d0417['emit'](_0x285fbc,_0x5bb61d);};}function removeListener(_0x23e878,_0xafde23){return function(){SmsMessageEvents['removeListener'](_0x23e878,_0xafde23);};}exports['register']=function(_0x127a59){for(var _0x3ea0cb=0x0,_0x119c4a=events[_0xf4e4('0x4')];_0x3ea0cb<_0x119c4a;_0x3ea0cb++){var _0x5d61cd=events[_0x3ea0cb];var _0x58ee04=createListener('smsMessage:'+_0x5d61cd,_0x127a59);SmsMessageEvents['on'](_0x5d61cd,_0x58ee04);}}; \ No newline at end of file +var _0x1ce9=['length','smsMessage:','./smsMessage.events','update','removeListener'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0x1ce9,0xde));var _0x91ce=function(_0x2dfcb2,_0x6757ee){_0x2dfcb2=_0x2dfcb2-0x0;var _0x41825d=_0x1ce9[_0x2dfcb2];return _0x41825d;};'use strict';var SmsMessageEvents=require(_0x91ce('0x0'));var events=['save','remove',_0x91ce('0x1')];function createListener(_0x4fb038,_0x2422eb){return function(_0x46bf7a){_0x2422eb['emit'](_0x4fb038,_0x46bf7a);};}function removeListener(_0x1d6ad1,_0x5608ba){return function(){SmsMessageEvents[_0x91ce('0x2')](_0x1d6ad1,_0x5608ba);};}exports['register']=function(_0x5bfca1){for(var _0x2f2afa=0x0,_0x193784=events[_0x91ce('0x3')];_0x2f2afa<_0x193784;_0x2f2afa++){var _0x318eff=events[_0x2f2afa];var _0x4c058b=createListener(_0x91ce('0x4')+_0x318eff,_0x5bfca1);SmsMessageEvents['on'](_0x318eff,_0x4c058b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 35a3e9e..1252593 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 _0x002f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','put','/:id','delete','destroy','removeTeams','exports','multer','util','path'];(function(_0xa218ce,_0x5aaf1a){var _0x561bb4=function(_0x474270){while(--_0x474270){_0xa218ce['push'](_0xa218ce['shift']());}};_0x561bb4(++_0x5aaf1a);}(_0x002f,0x8e));var _0xf002=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x002f[_0x5cab28];return _0xa3554d;};'use strict';var multer=require(_0xf002('0x0'));var util=require(_0xf002('0x1'));var path=require(_0xf002('0x2'));var timeout=require('connect-timeout');var express=require(_0xf002('0x3'));var router=express[_0xf002('0x4')]();var fs_extra=require(_0xf002('0x5'));var auth=require(_0xf002('0x6'));var interaction=require(_0xf002('0x7'));var config=require('../../config/environment');var controller=require(_0xf002('0x8'));router[_0xf002('0x9')]('/',auth['isAuthenticated'](),controller[_0xf002('0xa')]);router[_0xf002('0x9')](_0xf002('0xb'),auth[_0xf002('0xc')](),controller[_0xf002('0xd')]);router[_0xf002('0x9')]('/:id',auth[_0xf002('0xc')](),controller[_0xf002('0xe')]);router[_0xf002('0x9')](_0xf002('0xf'),auth[_0xf002('0xc')](),controller[_0xf002('0x10')]);router[_0xf002('0x9')]('/:id/teams',auth[_0xf002('0xc')](),controller[_0xf002('0x11')]);router[_0xf002('0x9')](_0xf002('0x12'),auth[_0xf002('0xc')](),controller[_0xf002('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf002('0x14')](_0xf002('0x15'),auth[_0xf002('0xc')](),controller[_0xf002('0x16')]);router[_0xf002('0x14')](_0xf002('0x12'),auth[_0xf002('0xc')](),controller['addAgents']);router[_0xf002('0x17')](_0xf002('0x18'),auth[_0xf002('0xc')](),controller['update']);router[_0xf002('0x19')](_0xf002('0x18'),auth['isAuthenticated'](),controller[_0xf002('0x1a')]);router[_0xf002('0x19')](_0xf002('0x15'),auth[_0xf002('0xc')](),controller[_0xf002('0x1b')]);router[_0xf002('0x19')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xf002('0x1c')]=router; \ No newline at end of file +var _0x7a10=['/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','getMembers'];(function(_0x3a2798,_0x2e2ec6){var _0x2c5a84=function(_0x5f3e94){while(--_0x5f3e94){_0x3a2798['push'](_0x3a2798['shift']());}};_0x2c5a84(++_0x2e2ec6);}(_0x7a10,0xe4));var _0x07a1=function(_0x25c9f6,_0x44c87b){_0x25c9f6=_0x25c9f6-0x0;var _0x87070c=_0x7a10[_0x25c9f6];return _0x87070c;};'use strict';var multer=require(_0x07a1('0x0'));var util=require(_0x07a1('0x1'));var path=require(_0x07a1('0x2'));var timeout=require(_0x07a1('0x3'));var express=require('express');var router=express[_0x07a1('0x4')]();var fs_extra=require(_0x07a1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x07a1('0x6'));var config=require(_0x07a1('0x7'));var controller=require(_0x07a1('0x8'));router[_0x07a1('0x9')]('/',auth[_0x07a1('0xa')](),controller[_0x07a1('0xb')]);router[_0x07a1('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x07a1('0xc')]);router[_0x07a1('0x9')](_0x07a1('0xd'),auth[_0x07a1('0xa')](),controller['show']);router[_0x07a1('0x9')]('/:id/members',auth[_0x07a1('0xa')](),controller[_0x07a1('0xe')]);router['get'](_0x07a1('0xf'),auth[_0x07a1('0xa')](),controller[_0x07a1('0x10')]);router[_0x07a1('0x9')](_0x07a1('0x11'),auth[_0x07a1('0xa')](),controller[_0x07a1('0x12')]);router[_0x07a1('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x07a1('0x14')]);router[_0x07a1('0x13')](_0x07a1('0x11'),auth['isAuthenticated'](),controller[_0x07a1('0x15')]);router[_0x07a1('0x16')]('/:id',auth[_0x07a1('0xa')](),controller[_0x07a1('0x17')]);router[_0x07a1('0x18')](_0x07a1('0xd'),auth[_0x07a1('0xa')](),controller['destroy']);router[_0x07a1('0x18')](_0x07a1('0xf'),auth[_0x07a1('0xa')](),controller[_0x07a1('0x19')]);router[_0x07a1('0x18')](_0x07a1('0x11'),auth['isAuthenticated'](),controller[_0x07a1('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index ed44251..2fee2a8 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 _0xc6b7=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x117692,_0x5ba99c){var _0x85d6b=function(_0x384ad4){while(--_0x384ad4){_0x117692['push'](_0x117692['shift']());}};_0x85d6b(++_0x5ba99c);}(_0xc6b7,0x8d));var _0x7c6b=function(_0x5ad53c,_0x582826){_0x5ad53c=_0x5ad53c-0x0;var _0x137e6e=_0xc6b7[_0x5ad53c];return _0x137e6e;};'use strict';var Sequelize=require(_0x7c6b('0x0'));module[_0x7c6b('0x1')]={'name':{'type':Sequelize[_0x7c6b('0x2')],'unique':_0x7c6b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7c6b('0x2')]},'timeout':{'type':Sequelize[_0x7c6b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7c6b('0x5')](_0x7c6b('0x6'),'beepall',_0x7c6b('0x7'))}}; \ No newline at end of file +var _0x1a93=['STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x56851f,_0x44069b){var _0x48cae9=function(_0x11c207){while(--_0x11c207){_0x56851f['push'](_0x56851f['shift']());}};_0x48cae9(++_0x44069b);}(_0x1a93,0xa6));var _0x31a9=function(_0x2c6e37,_0x49bc15){_0x2c6e37=_0x2c6e37-0x0;var _0x312114=_0x1a93[_0x2c6e37];return _0x312114;};'use strict';var Sequelize=require(_0x31a9('0x0'));module[_0x31a9('0x1')]={'name':{'type':Sequelize[_0x31a9('0x2')],'unique':_0x31a9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x31a9('0x2')]},'timeout':{'type':Sequelize[_0x31a9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x31a9('0x5')]('rrmemory',_0x31a9('0x6'),_0x31a9('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 210b3ed..ab944ea 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 _0x1cca=['flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','select','tq.TeamId','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','omit','isArray','userSmsQueue:remove','getAgents','eml-format','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','get','SmsQueues','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','filter','merge','options','SmsQueue','include','rows','catch','params','includeAll','find','create','body','user','UserProfileSection','autoAssociation','describe','findOne','order','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','online','voicePause','interface'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x1cca,0x12d));var _0xa1cc=function(_0x2e2d88,_0x56f02b){_0x2e2d88=_0x2e2d88-0x0;var _0x4ca255=_0x1cca[_0x2e2d88];return _0x4ca255;};'use strict';var emlformat=require(_0xa1cc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa1cc('0x1'));var rp=require(_0xa1cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1cc('0x3'));var util=require(_0xa1cc('0x4'));var path=require(_0xa1cc('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa1cc('0x6'));var fs=require('fs');var fs_extra=require(_0xa1cc('0x7'));var _=require(_0xa1cc('0x8'));var squel=require(_0xa1cc('0x9'));var crypto=require(_0xa1cc('0xa'));var jsforce=require(_0xa1cc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa1cc('0xc'));var querystring=require(_0xa1cc('0xd'));var Papa=require('papaparse');var Redis=require(_0xa1cc('0xe'));var authService=require(_0xa1cc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1cc('0x10'));var logger=require(_0xa1cc('0x11'))(_0xa1cc('0x12'));var utils=require(_0xa1cc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa1cc('0x14'));var db=require(_0xa1cc('0x15'))['db'];config[_0xa1cc('0x16')]=_['defaults'](config['redis'],{'host':_0xa1cc('0x17'),'port':0x18eb});var socket=require(_0xa1cc('0x18'))(new Redis(config[_0xa1cc('0x16')]));require('./smsQueue.socket')[_0xa1cc('0x19')](socket);function respondWithStatusCode(_0x989c7e,_0x5f925c){_0x5f925c=_0x5f925c||0xcc;return function(_0x5558c3){if(_0x5558c3){return _0x989c7e[_0xa1cc('0x1a')](_0x5f925c);}return _0x989c7e[_0xa1cc('0x1b')](_0x5f925c)[_0xa1cc('0x1c')]();};}function respondWithResult(_0x5e6764,_0x46c553){_0x46c553=_0x46c553||0xc8;return function(_0x12dde8){if(_0x12dde8){return _0x5e6764[_0xa1cc('0x1b')](_0x46c553)['json'](_0x12dde8);}};}function respondWithFilteredResult(_0x190768,_0x1134a9){return function(_0x992b0e){if(_0x992b0e){var _0x5a6c9f=typeof _0x1134a9[_0xa1cc('0x1d')]===_0xa1cc('0x1e')&&typeof _0x1134a9[_0xa1cc('0x1f')]===_0xa1cc('0x1e');var _0x4eb860=_0x992b0e[_0xa1cc('0x20')];var _0x201183=_0x5a6c9f?0x0:_0x1134a9['offset'];var _0x2067ad=_0x5a6c9f?_0x992b0e[_0xa1cc('0x20')]:_0x1134a9['offset']+_0x1134a9[_0xa1cc('0x1f')];var _0x44f054;if(_0x2067ad>=_0x4eb860){_0x2067ad=_0x4eb860;_0x44f054=0xc8;}else{_0x44f054=0xce;}_0x190768[_0xa1cc('0x1b')](_0x44f054);return _0x190768['set'](_0xa1cc('0x21'),_0x201183+'-'+_0x2067ad+'/'+_0x4eb860)[_0xa1cc('0x22')](_0x992b0e);}return null;};}function patchUpdates(_0xc7dd6c){return function(_0x32fa32){try{jsonpatch[_0xa1cc('0x23')](_0x32fa32,_0xc7dd6c,!![]);}catch(_0x213b32){return BPromise[_0xa1cc('0x24')](_0x213b32);}return _0x32fa32['save']();};}function saveUpdates(_0x2d6997,_0x1b25bb){return function(_0x231116){if(_0x231116){return _0x231116[_0xa1cc('0x25')](_0x2d6997)[_0xa1cc('0x26')](function(_0x1d716a){return _0x1d716a;});}return null;};}function removeEntity(_0x1f3f21,_0x45c3a4){return function(_0x206bb3){if(_0x206bb3){return _0x206bb3['destroy']()[_0xa1cc('0x26')](function(){var _0x3c49db=_0x206bb3[_0xa1cc('0x27')]({'plain':!![]});var _0x49f4ba=_0xa1cc('0x28');return db[_0xa1cc('0x29')][_0xa1cc('0x2a')]({'where':{'type':_0x49f4ba,'resourceId':_0x3c49db['id']}})[_0xa1cc('0x26')](function(){return _0x206bb3;});})[_0xa1cc('0x26')](function(){_0x1f3f21[_0xa1cc('0x1b')](0xcc)[_0xa1cc('0x1c')]();});}};}function handleEntityNotFound(_0x10f09c,_0xab50c2){return function(_0x353cc3){if(!_0x353cc3){_0x10f09c[_0xa1cc('0x1a')](0x194);}return _0x353cc3;};}function handleError(_0x49abc1,_0x38ac01){_0x38ac01=_0x38ac01||0x1f4;return function(_0x4c72da){logger[_0xa1cc('0x2b')](_0x4c72da[_0xa1cc('0x2c')]);if(_0x4c72da[_0xa1cc('0x2d')]){delete _0x4c72da[_0xa1cc('0x2d')];}_0x49abc1[_0xa1cc('0x1b')](_0x38ac01)[_0xa1cc('0x2e')](_0x4c72da);};}exports['index']=function(_0x3dd66f,_0x51b32c){var _0x39e1c5={},_0x5a464a={},_0x1c3b3f={'count':0x0,'rows':[]};var _0x4875ed=_[_0xa1cc('0x2f')](db['SmsQueue'][_0xa1cc('0x30')],function(_0x46cae1){return{'name':_0x46cae1[_0xa1cc('0x31')],'type':_0x46cae1[_0xa1cc('0x32')][_0xa1cc('0x33')]};});_0x5a464a[_0xa1cc('0x34')]=_[_0xa1cc('0x2f')](_0x4875ed,_0xa1cc('0x2d'));_0x5a464a[_0xa1cc('0x35')]=_[_0xa1cc('0x36')](_0x3dd66f[_0xa1cc('0x35')]);_0x5a464a[_0xa1cc('0x37')]=_[_0xa1cc('0x38')](_0x5a464a[_0xa1cc('0x34')],_0x5a464a[_0xa1cc('0x35')]);_0x39e1c5[_0xa1cc('0x39')]=_[_0xa1cc('0x38')](_0x5a464a[_0xa1cc('0x34')],qs['fields'](_0x3dd66f[_0xa1cc('0x35')][_0xa1cc('0x3a')]));_0x39e1c5[_0xa1cc('0x39')]=_0x39e1c5[_0xa1cc('0x39')][_0xa1cc('0x3b')]?_0x39e1c5['attributes']:_0x5a464a['model'];if(!_0x3dd66f['query'][_0xa1cc('0x3c')](_0xa1cc('0x3d'))){_0x39e1c5[_0xa1cc('0x1f')]=qs[_0xa1cc('0x1f')](_0x3dd66f['query'][_0xa1cc('0x1f')]);_0x39e1c5['offset']=qs[_0xa1cc('0x1d')](_0x3dd66f[_0xa1cc('0x35')][_0xa1cc('0x1d')]);}_0x39e1c5['order']=qs[_0xa1cc('0x3e')](_0x3dd66f[_0xa1cc('0x35')][_0xa1cc('0x3e')]);_0x39e1c5['where']=qs[_0xa1cc('0x37')](_[_0xa1cc('0x3f')](_0x3dd66f[_0xa1cc('0x35')],_0x5a464a[_0xa1cc('0x37')]),_0x4875ed);if(_0x3dd66f[_0xa1cc('0x35')]['filter']){_0x39e1c5[_0xa1cc('0x40')]=_['merge'](_0x39e1c5['where'],{'$or':_['map'](_0x4875ed,function(_0x1a427d){if(_0x1a427d['type']!=='VIRTUAL'){var _0x2f9584={};_0x2f9584[_0x1a427d[_0xa1cc('0x2d')]]={'$like':'%'+_0x3dd66f[_0xa1cc('0x35')][_0xa1cc('0x41')]+'%'};return _0x2f9584;}})});}_0x39e1c5=_[_0xa1cc('0x42')]({},_0x39e1c5,_0x3dd66f[_0xa1cc('0x43')]);var _0x524e49={'where':_0x39e1c5[_0xa1cc('0x40')]};return db[_0xa1cc('0x44')][_0xa1cc('0x20')](_0x524e49)['then'](function(_0x2be383){_0x1c3b3f[_0xa1cc('0x20')]=_0x2be383;if(_0x3dd66f[_0xa1cc('0x35')]['includeAll']){_0x39e1c5[_0xa1cc('0x45')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x39e1c5);})[_0xa1cc('0x26')](function(_0x289027){_0x1c3b3f[_0xa1cc('0x46')]=_0x289027;return _0x1c3b3f;})[_0xa1cc('0x26')](respondWithFilteredResult(_0x51b32c,_0x39e1c5))[_0xa1cc('0x47')](handleError(_0x51b32c,null));};exports['show']=function(_0x2a4e40,_0x23060b){var _0x5a5182={'raw':!![],'where':{'id':_0x2a4e40[_0xa1cc('0x48')]['id']}},_0x344334={};_0x344334[_0xa1cc('0x34')]=_[_0xa1cc('0x36')](db[_0xa1cc('0x44')]['rawAttributes']);_0x344334[_0xa1cc('0x35')]=_[_0xa1cc('0x36')](_0x2a4e40[_0xa1cc('0x35')]);_0x344334[_0xa1cc('0x37')]=_[_0xa1cc('0x38')](_0x344334[_0xa1cc('0x34')],_0x344334[_0xa1cc('0x35')]);_0x5a5182[_0xa1cc('0x39')]=_[_0xa1cc('0x38')](_0x344334[_0xa1cc('0x34')],qs[_0xa1cc('0x3a')](_0x2a4e40[_0xa1cc('0x35')][_0xa1cc('0x3a')]));_0x5a5182[_0xa1cc('0x39')]=_0x5a5182[_0xa1cc('0x39')][_0xa1cc('0x3b')]?_0x5a5182[_0xa1cc('0x39')]:_0x344334['model'];if(_0x2a4e40[_0xa1cc('0x35')][_0xa1cc('0x49')]){_0x5a5182[_0xa1cc('0x45')]=[{'all':!![]}];}_0x5a5182=_[_0xa1cc('0x42')]({},_0x5a5182,_0x2a4e40[_0xa1cc('0x43')]);return db[_0xa1cc('0x44')][_0xa1cc('0x4a')](_0x5a5182)[_0xa1cc('0x26')](handleEntityNotFound(_0x23060b,null))[_0xa1cc('0x26')](respondWithResult(_0x23060b,null))[_0xa1cc('0x47')](handleError(_0x23060b,null));};exports[_0xa1cc('0x4b')]=function(_0x31a622,_0x333f8c){return db[_0xa1cc('0x44')][_0xa1cc('0x4b')](_0x31a622[_0xa1cc('0x4c')],{})[_0xa1cc('0x26')](function(_0x64c5bb){var _0x270334=_0x31a622['user'][_0xa1cc('0x27')]({'plain':!![]});if(!_0x270334)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x270334['role']===_0xa1cc('0x4d')){var _0x1df649=_0x64c5bb[_0xa1cc('0x27')]({'plain':!![]});var _0x513ec5=_0xa1cc('0x28');return db[_0xa1cc('0x4e')][_0xa1cc('0x4a')]({'where':{'name':_0x513ec5,'userProfileId':_0x270334['userProfileId']},'raw':!![]})['then'](function(_0xdcb7fe){if(_0xdcb7fe&&_0xdcb7fe[_0xa1cc('0x4f')]===0x0){return db[_0xa1cc('0x29')][_0xa1cc('0x4b')]({'name':_0x1df649[_0xa1cc('0x2d')],'resourceId':_0x1df649['id'],'type':_0xdcb7fe[_0xa1cc('0x2d')],'sectionId':_0xdcb7fe['id']},{})['then'](function(){return _0x64c5bb;});}else{return _0x64c5bb;}})['catch'](function(_0x27caba){logger[_0xa1cc('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27caba);throw _0x27caba;});}return _0x64c5bb;})[_0xa1cc('0x26')](respondWithResult(_0x333f8c,0xc9))['catch'](handleError(_0x333f8c,null));};exports[_0xa1cc('0x25')]=function(_0x53497f,_0x1559f6){if(_0x53497f[_0xa1cc('0x4c')]['id']){delete _0x53497f[_0xa1cc('0x4c')]['id'];}return db[_0xa1cc('0x44')][_0xa1cc('0x4a')]({'where':{'id':_0x53497f[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](handleEntityNotFound(_0x1559f6,null))['then'](saveUpdates(_0x53497f[_0xa1cc('0x4c')],null))['then'](respondWithResult(_0x1559f6,null))[_0xa1cc('0x47')](handleError(_0x1559f6,null));};exports[_0xa1cc('0x2a')]=function(_0x21b8dc,_0x5f0701){return db[_0xa1cc('0x44')][_0xa1cc('0x4a')]({'where':{'id':_0x21b8dc[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](handleEntityNotFound(_0x5f0701,null))[_0xa1cc('0x26')](removeEntity(_0x5f0701,null))[_0xa1cc('0x47')](handleError(_0x5f0701,null));};exports['describe']=function(_0x1a8d59,_0x2a39ab){return db[_0xa1cc('0x44')][_0xa1cc('0x50')]()[_0xa1cc('0x26')](respondWithResult(_0x2a39ab,null))['catch'](handleError(_0x2a39ab,null));};exports['getMembers']=function(_0xbd97e7,_0x1da2ea,_0x55ff6f){var _0x52b6ef={'raw':!![],'where':{}},_0x2d4651={},_0x41a7f6;return db[_0xa1cc('0x44')][_0xa1cc('0x51')]({'where':{'id':_0xbd97e7[_0xa1cc('0x48')]['id']}})['then'](handleEntityNotFound(_0x1da2ea,null))[_0xa1cc('0x26')](function(_0x397087){if(_0x397087){_0x41a7f6=_0x397087[_0xa1cc('0x27')]({'plain':!![]});_0x2d4651[_0xa1cc('0x34')]=_[_0xa1cc('0x36')](db['UserSmsQueue']['rawAttributes']);_0x2d4651['query']=_[_0xa1cc('0x36')](_0xbd97e7[_0xa1cc('0x35')]);_0x2d4651[_0xa1cc('0x37')]=_[_0xa1cc('0x38')](_0x2d4651[_0xa1cc('0x34')],_0x2d4651[_0xa1cc('0x35')]);_0x52b6ef['attributes']=_[_0xa1cc('0x38')](_0x2d4651[_0xa1cc('0x34')],qs[_0xa1cc('0x3a')](_0xbd97e7[_0xa1cc('0x35')]['fields']));_0x52b6ef[_0xa1cc('0x39')]=_0x52b6ef[_0xa1cc('0x39')][_0xa1cc('0x3b')]?_0x52b6ef[_0xa1cc('0x39')]:_0x2d4651[_0xa1cc('0x34')];if(!_0xbd97e7[_0xa1cc('0x35')][_0xa1cc('0x3c')](_0xa1cc('0x3d'))){_0x52b6ef[_0xa1cc('0x1f')]=qs['limit'](_0xbd97e7[_0xa1cc('0x35')]['limit']);_0x52b6ef[_0xa1cc('0x1d')]=qs[_0xa1cc('0x1d')](_0xbd97e7['query']['offset']);}_0x52b6ef[_0xa1cc('0x52')]=qs[_0xa1cc('0x3e')](_0xbd97e7[_0xa1cc('0x35')][_0xa1cc('0x3e')]);_0x52b6ef[_0xa1cc('0x40')]=qs[_0xa1cc('0x37')](_[_0xa1cc('0x3f')](_0xbd97e7['query'],_0x2d4651['filters']));_0x52b6ef[_0xa1cc('0x40')]['SmsQueueId']=_0x397087['id'];if(_0xbd97e7[_0xa1cc('0x35')][_0xa1cc('0x41')]){_0x52b6ef['where']=_[_0xa1cc('0x42')](_0x52b6ef[_0xa1cc('0x40')],{'$or':_[_0xa1cc('0x2f')](_0x52b6ef[_0xa1cc('0x39')],function(_0x5a0718){var _0x381d4b={};_0x381d4b[_0x5a0718]={'$like':'%'+_0xbd97e7[_0xa1cc('0x35')][_0xa1cc('0x41')]+'%'};return _0x381d4b;})});}_0x52b6ef=_[_0xa1cc('0x42')]({},_0x52b6ef,_0xbd97e7[_0xa1cc('0x43')]);return db[_0xa1cc('0x53')]['findAll'](_0x52b6ef);}})[_0xa1cc('0x26')](function(_0xd81e0){if(_0xd81e0){return db[_0xa1cc('0x54')][_0xa1cc('0x55')]({'where':{'id':_[_0xa1cc('0x2f')](_0xd81e0,_0xa1cc('0x56')),'role':_0xa1cc('0x57')},'attributes':['id',_0xa1cc('0x2d'),_0xa1cc('0x58'),_0xa1cc('0x59'),'createdAt']});}})['then'](function(_0x5c36d9){if(_0x5c36d9){return{'count':_0x5c36d9[_0xa1cc('0x20')],'rows':_[_0xa1cc('0x2f')](_0x5c36d9['rows'],function(_0x35a171){return{'membername':_0x35a171[_0xa1cc('0x2d')],'UserId':_0x35a171['id'],'queue_name':_0x41a7f6[_0xa1cc('0x2d')],'SmsQueueId':_0x41a7f6['id'],'interface':util[_0xa1cc('0x5a')](_0xa1cc('0x5b'),_0xa1cc('0x5c'),_0x35a171[_0xa1cc('0x2d')]),'penalty':0x0,'paused':_0x35a171[_0xa1cc('0x58')],'createdAt':_0x35a171[_0xa1cc('0x5d')],'updatedAt':_0x35a171['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa1cc('0x26')](respondWithFilteredResult(_0x1da2ea,_0x52b6ef))[_0xa1cc('0x47')](handleError(_0x1da2ea,null));};exports[_0xa1cc('0x5e')]=function(_0x3df404,_0x50ab59,_0x22eb59){var _0x2e1cf8={};var _0x216a89={};var _0x5e9fb2;var _0x38fe98;return db[_0xa1cc('0x44')][_0xa1cc('0x51')]({'where':{'id':_0x3df404[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](handleEntityNotFound(_0x50ab59,null))[_0xa1cc('0x26')](function(_0x131f87){if(_0x131f87){_0x5e9fb2=_0x131f87;_0x216a89[_0xa1cc('0x34')]=_[_0xa1cc('0x36')](db[_0xa1cc('0x5f')][_0xa1cc('0x30')]);_0x216a89[_0xa1cc('0x35')]=_[_0xa1cc('0x36')](_0x3df404[_0xa1cc('0x35')]);_0x216a89['filters']=_[_0xa1cc('0x38')](_0x216a89[_0xa1cc('0x34')],_0x216a89['query']);_0x2e1cf8[_0xa1cc('0x39')]=_[_0xa1cc('0x38')](_0x216a89['model'],qs[_0xa1cc('0x3a')](_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x3a')]));_0x2e1cf8['attributes']=_0x2e1cf8[_0xa1cc('0x39')]['length']?_0x2e1cf8[_0xa1cc('0x39')]:_0x216a89['model'];_0x2e1cf8[_0xa1cc('0x52')]=qs[_0xa1cc('0x3e')](_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x3e')]);_0x2e1cf8['where']=qs[_0xa1cc('0x37')](_[_0xa1cc('0x3f')](_0x3df404[_0xa1cc('0x35')],_0x216a89[_0xa1cc('0x37')]));if(_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x41')]){_0x2e1cf8['where']=_[_0xa1cc('0x42')](_0x2e1cf8[_0xa1cc('0x40')],{'$or':_['map'](_0x2e1cf8['attributes'],function(_0x56718b){var _0x137e80={};_0x137e80[_0x56718b]={'$like':'%'+_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x41')]+'%'};return _0x137e80;})});}_0x2e1cf8=_[_0xa1cc('0x42')]({},_0x2e1cf8,_0x3df404[_0xa1cc('0x43')]);return _0x5e9fb2[_0xa1cc('0x5e')](_0x2e1cf8);}})[_0xa1cc('0x26')](function(_0x1330ef){if(_0x1330ef){_0x38fe98=_0x1330ef['length'];if(!_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x3c')](_0xa1cc('0x3d'))){_0x2e1cf8[_0xa1cc('0x1f')]=qs[_0xa1cc('0x1f')](_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x1f')]);_0x2e1cf8[_0xa1cc('0x1d')]=qs[_0xa1cc('0x1d')](_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x1d')]);}return _0x5e9fb2[_0xa1cc('0x5e')](_0x2e1cf8);}})[_0xa1cc('0x26')](function(_0x5ef57e){if(_0x5ef57e){return _0x5ef57e?{'count':_0x38fe98,'rows':_0x5ef57e}:null;}})['then'](respondWithResult(_0x50ab59,null))[_0xa1cc('0x47')](handleError(_0x50ab59,null));};exports[_0xa1cc('0x60')]=function(_0xd2eefb,_0x3c118a,_0x19ddbb){var _0x33c156=_0xd2eefb['body'][_0xa1cc('0x61')];return db['Team']['findAll']({'where':{'id':_0x33c156},'attributes':['id'],'include':[{'model':db[_0xa1cc('0x54')],'as':'Agents','attributes':['id',_0xa1cc('0x2d'),_0xa1cc('0x62'),_0xa1cc('0x63'),_0xa1cc('0x64')],'raw':!![]}]})[_0xa1cc('0x26')](function(_0x24e2f4){if(_0x24e2f4){var _0x33e109=_[_0xa1cc('0x65')](_0x24e2f4,function(_0x5ad61f){var _0x48705e=_0x5ad61f[_0xa1cc('0x27')]({'plain':!![]});return _0x48705e[_0xa1cc('0x66')];});return db[_0xa1cc('0x44')][_0xa1cc('0x4a')]({'where':{'id':_0xd2eefb[_0xa1cc('0x48')]['id']}})['then'](function(_0x571d50){return db[_0xa1cc('0x67')][_0xa1cc('0x68')](function(_0x3657d2){return _0x571d50[_0xa1cc('0x60')](_0x33c156,{'transaction':_0x3657d2})['then'](function(){return BPromise[_0xa1cc('0x69')](_0x33e109,function(_0x4e69d7){return db[_0xa1cc('0x53')][_0xa1cc('0x6a')]({'where':{'UserId':_0x4e69d7['id'],'SmsQueueId':_0xd2eefb[_0xa1cc('0x48')]['id']},'transaction':_0x3657d2});});})[_0xa1cc('0x26')](function(){_0x33e109[_0xa1cc('0x6b')](function(_0xc88bad){socket[_0xa1cc('0x6c')](_0xa1cc('0x6d'),{'UserId':_0xc88bad['id'],'SmsQueueId':_0x571d50['id']});});});});});}})[_0xa1cc('0x26')](respondWithStatusCode(_0x3c118a,null))[_0xa1cc('0x47')](handleError(_0x3c118a,null));};exports['removeTeams']=function(_0x45a842,_0x19f6ef,_0x35e396){return db['Team']['findAll']({'where':{'id':_0x45a842[_0xa1cc('0x35')][_0xa1cc('0x61')]},'attributes':['id'],'include':[{'model':db[_0xa1cc('0x54')],'as':_0xa1cc('0x66'),'attributes':['id'],'raw':!![]}]})[_0xa1cc('0x26')](handleEntityNotFound(_0x19f6ef,null))['then'](function(_0x55bac9){var _0x3f593d=_['map'](_0x55bac9,'id');var _0x402b60=[];var _0x523961=[];var _0x3353ca=squel[_0xa1cc('0x6e')]();_0x3353ca['field'](_0xa1cc('0x6f'))['from']('team_has_sms_queues','tq')[_0xa1cc('0x70')](_0xa1cc('0x71'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa1cc('0x40')](_0xa1cc('0x72'),_0x45a842[_0xa1cc('0x48')]['id']);for(var _0x2c0f28=0x0;_0x2c0f28<_0x55bac9[_0xa1cc('0x3b')];_0x2c0f28+=0x1){let _0x563589=_0x55bac9[_0x2c0f28];for(var _0x46f39c=0x0;_0x46f39c<_0x563589[_0xa1cc('0x66')]['length'];_0x46f39c+=0x1){let _0x53f2ce=_0x563589['Agents'][_0x46f39c];var _0x179fdc=_0x3353ca[_0xa1cc('0x73')]();_0x179fdc[_0xa1cc('0x40')](_0xa1cc('0x74'),_0x53f2ce['id']);_0x523961[_0xa1cc('0x75')](db['sequelize'][_0xa1cc('0x35')](_0x179fdc[_0xa1cc('0x76')](),{'type':db[_0xa1cc('0x67')]['QueryTypes'][_0xa1cc('0x77')]})[_0xa1cc('0x26')](function(_0x78e00a){if(_0x78e00a[_0xa1cc('0x3b')]===0x1){return _0x53f2ce['id'];}else{var _0x3419cd=_[_0xa1cc('0x78')](_[_0xa1cc('0x2f')](_0x78e00a,_0xa1cc('0x79')),function(_0x4642f5){return _[_0xa1cc('0x7a')](_0x3f593d,_0x4642f5);});if(_0x3419cd){return _0x53f2ce['id'];}}}));}}return BPromise['all'](_0x523961)[_0xa1cc('0x26')](function(_0x4c8b58){_0x402b60=_(_0x402b60)[_0xa1cc('0x7b')](_0x4c8b58)[_0xa1cc('0x7c')]()[_0xa1cc('0x7d')]();return db[_0xa1cc('0x44')][_0xa1cc('0x4a')]({'where':{'id':_0x45a842[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](function(_0x3041f2){return db['sequelize'][_0xa1cc('0x68')](function(_0x583402){return _0x3041f2[_0xa1cc('0x7e')](_0x45a842[_0xa1cc('0x35')]['ids'],{'transaction':_0x583402})[_0xa1cc('0x26')](function(){if(!_[_0xa1cc('0x7f')](_0x402b60)){return _0x3041f2[_0xa1cc('0x80')](_0x402b60,{'transaction':_0x583402});}})['then'](function(){_0x402b60[_0xa1cc('0x6b')](function(_0x3cb801){socket[_0xa1cc('0x6c')]('userSmsQueue:remove',{'UserId':_0x3cb801,'SmsQueueId':_0x3041f2['id']});});});});});});})[_0xa1cc('0x26')](respondWithStatusCode(_0x19f6ef,null))['catch'](handleError(_0x19f6ef,null));};exports['addAgents']=function(_0x12c003,_0x1fe0ae,_0x42adeb){return db[_0xa1cc('0x44')]['find']({'where':{'id':_0x12c003[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](handleEntityNotFound(_0x1fe0ae,null))[_0xa1cc('0x26')](function(_0x455a2b){if(_0x455a2b){return _0x455a2b[_0xa1cc('0x81')](_0x12c003[_0xa1cc('0x4c')][_0xa1cc('0x61')],_[_0xa1cc('0x82')](_0x12c003[_0xa1cc('0x4c')],[_0xa1cc('0x61'),'id'])||{})['spread'](function(_0x225eb7){for(var _0x21094b=0x0;_0x21094b<_0x12c003[_0xa1cc('0x4c')][_0xa1cc('0x61')][_0xa1cc('0x3b')];_0x21094b+=0x1){socket['emit'](_0xa1cc('0x6d'),{'UserId':Number(_0x12c003[_0xa1cc('0x4c')][_0xa1cc('0x61')][_0x21094b]),'SmsQueueId':Number(_0x12c003[_0xa1cc('0x48')]['id'])});}return _0x225eb7;});}})[_0xa1cc('0x26')](respondWithResult(_0x1fe0ae,null))['catch'](handleError(_0x1fe0ae,null));};exports[_0xa1cc('0x80')]=function(_0x2c67d9,_0x3dac6d,_0x5b0402){return db[_0xa1cc('0x44')][_0xa1cc('0x4a')]({'where':{'id':_0x2c67d9['params']['id']}})['then'](handleEntityNotFound(_0x3dac6d,null))[_0xa1cc('0x26')](function(_0x39d7e5){if(_0x39d7e5){return _0x39d7e5[_0xa1cc('0x80')](_0x2c67d9[_0xa1cc('0x35')][_0xa1cc('0x61')])[_0xa1cc('0x26')](function(){if(_[_0xa1cc('0x83')](_0x2c67d9[_0xa1cc('0x35')][_0xa1cc('0x61')])){for(var _0x6e09fb=0x0;_0x6e09fb<_0x2c67d9[_0xa1cc('0x35')][_0xa1cc('0x61')][_0xa1cc('0x3b')];_0x6e09fb+=0x1){socket[_0xa1cc('0x6c')](_0xa1cc('0x84'),{'UserId':Number(_0x2c67d9[_0xa1cc('0x35')]['ids'][_0x6e09fb]),'SmsQueueId':Number(_0x2c67d9[_0xa1cc('0x48')]['id'])});}}else{socket[_0xa1cc('0x6c')](_0xa1cc('0x84'),{'UserId':Number(_0x2c67d9[_0xa1cc('0x35')]['ids']),'SmsQueueId':Number(_0x2c67d9[_0xa1cc('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x3dac6d,null))[_0xa1cc('0x47')](handleError(_0x3dac6d,null));};exports['getAgents']=function(_0x4fea45,_0x4ba067,_0x3213da){var _0x5bc29f={};var _0x135f6d={};var _0x246bf4;var _0x156499;return db['SmsQueue'][_0xa1cc('0x51')]({'where':{'id':_0x4fea45[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](handleEntityNotFound(_0x4ba067,null))[_0xa1cc('0x26')](function(_0x212f7b){if(_0x212f7b){_0x246bf4=_0x212f7b;_0x135f6d[_0xa1cc('0x34')]=_[_0xa1cc('0x36')](db[_0xa1cc('0x54')][_0xa1cc('0x30')]);_0x135f6d['query']=_[_0xa1cc('0x36')](_0x4fea45[_0xa1cc('0x35')]);_0x135f6d['filters']=_['intersection'](_0x135f6d[_0xa1cc('0x34')],_0x135f6d[_0xa1cc('0x35')]);_0x5bc29f[_0xa1cc('0x39')]=_['intersection'](_0x135f6d[_0xa1cc('0x34')],qs[_0xa1cc('0x3a')](_0x4fea45[_0xa1cc('0x35')][_0xa1cc('0x3a')]));_0x5bc29f[_0xa1cc('0x39')]=_0x5bc29f[_0xa1cc('0x39')]['length']?_0x5bc29f[_0xa1cc('0x39')]:_0x135f6d['model'];_0x5bc29f[_0xa1cc('0x52')]=qs['sort'](_0x4fea45[_0xa1cc('0x35')][_0xa1cc('0x3e')]);_0x5bc29f[_0xa1cc('0x40')]=qs[_0xa1cc('0x37')](_[_0xa1cc('0x3f')](_0x4fea45['query'],_0x135f6d[_0xa1cc('0x37')]));if(_0x4fea45[_0xa1cc('0x35')][_0xa1cc('0x41')]){_0x5bc29f[_0xa1cc('0x40')]=_[_0xa1cc('0x42')](_0x5bc29f[_0xa1cc('0x40')],{'$or':_[_0xa1cc('0x2f')](_0x5bc29f[_0xa1cc('0x39')],function(_0x598ec5){var _0x45b263={};_0x45b263[_0x598ec5]={'$like':'%'+_0x4fea45[_0xa1cc('0x35')][_0xa1cc('0x41')]+'%'};return _0x45b263;})});}_0x5bc29f=_[_0xa1cc('0x42')]({},_0x5bc29f,_0x4fea45[_0xa1cc('0x43')]);return _0x246bf4[_0xa1cc('0x85')](_0x5bc29f);}})['then'](function(_0x3a841a){if(_0x3a841a){_0x156499=_0x3a841a[_0xa1cc('0x3b')];if(!_0x4fea45['query'][_0xa1cc('0x3c')]('nolimit')){_0x5bc29f[_0xa1cc('0x1f')]=qs['limit'](_0x4fea45[_0xa1cc('0x35')][_0xa1cc('0x1f')]);_0x5bc29f[_0xa1cc('0x1d')]=qs[_0xa1cc('0x1d')](_0x4fea45['query'][_0xa1cc('0x1d')]);}return _0x246bf4[_0xa1cc('0x85')](_0x5bc29f);}})['then'](function(_0x278d0a){if(_0x278d0a){return _0x278d0a?{'count':_0x156499,'rows':_0x278d0a}:null;}})[_0xa1cc('0x26')](respondWithResult(_0x4ba067,null))['catch'](handleError(_0x4ba067,null));}; \ No newline at end of file +var _0x056d=['findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','join','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','index','SmsQueue','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','describe','findOne','UserSmsQueue','options','User','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','updatedAt','getTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x056d,0xa6));var _0xd056=function(_0xa676a5,_0x419e29){_0xa676a5=_0xa676a5-0x0;var _0x29914b=_0x056d[_0xa676a5];return _0x29914b;};'use strict';var emlformat=require(_0xd056('0x0'));var rimraf=require(_0xd056('0x1'));var zipdir=require(_0xd056('0x2'));var jsonpatch=require(_0xd056('0x3'));var rp=require(_0xd056('0x4'));var moment=require(_0xd056('0x5'));var BPromise=require(_0xd056('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd056('0x7'));var sox=require(_0xd056('0x8'));var csv=require(_0xd056('0x9'));var ejs=require(_0xd056('0xa'));var fs=require('fs');var fs_extra=require(_0xd056('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd056('0xc'));var jsforce=require(_0xd056('0xd'));var deskjs=require(_0xd056('0xe'));var toCsv=require(_0xd056('0x9'));var querystring=require(_0xd056('0xf'));var Papa=require('papaparse');var Redis=require(_0xd056('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd056('0x11'));var hardwareService=require(_0xd056('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd056('0x13'))['db'];config[_0xd056('0x14')]=_[_0xd056('0x15')](config[_0xd056('0x14')],{'host':_0xd056('0x16'),'port':0x18eb});var socket=require(_0xd056('0x17'))(new Redis(config[_0xd056('0x14')]));require(_0xd056('0x18'))[_0xd056('0x19')](socket);function respondWithStatusCode(_0x3e2f09,_0x4546b0){_0x4546b0=_0x4546b0||0xcc;return function(_0x1315a1){if(_0x1315a1){return _0x3e2f09[_0xd056('0x1a')](_0x4546b0);}return _0x3e2f09[_0xd056('0x1b')](_0x4546b0)[_0xd056('0x1c')]();};}function respondWithResult(_0x3f6bdf,_0x3a9f35){_0x3a9f35=_0x3a9f35||0xc8;return function(_0x71472d){if(_0x71472d){return _0x3f6bdf[_0xd056('0x1b')](_0x3a9f35)[_0xd056('0x1d')](_0x71472d);}};}function respondWithFilteredResult(_0x5b7430,_0x5237cc){return function(_0x291ad2){if(_0x291ad2){var _0x19647a=typeof _0x5237cc['offset']===_0xd056('0x1e')&&typeof _0x5237cc[_0xd056('0x1f')]==='undefined';var _0x1ed921=_0x291ad2[_0xd056('0x20')];var _0x164a16=_0x19647a?0x0:_0x5237cc[_0xd056('0x21')];var _0x42e0cd=_0x19647a?_0x291ad2[_0xd056('0x20')]:_0x5237cc[_0xd056('0x21')]+_0x5237cc['limit'];var _0xd3a2f1;if(_0x42e0cd>=_0x1ed921){_0x42e0cd=_0x1ed921;_0xd3a2f1=0xc8;}else{_0xd3a2f1=0xce;}_0x5b7430['status'](_0xd3a2f1);return _0x5b7430[_0xd056('0x22')](_0xd056('0x23'),_0x164a16+'-'+_0x42e0cd+'/'+_0x1ed921)[_0xd056('0x1d')](_0x291ad2);}return null;};}function patchUpdates(_0x4406ea){return function(_0x7fbf85){try{jsonpatch[_0xd056('0x24')](_0x7fbf85,_0x4406ea,!![]);}catch(_0x944c0b){return BPromise[_0xd056('0x25')](_0x944c0b);}return _0x7fbf85[_0xd056('0x26')]();};}function saveUpdates(_0x5b8a3b,_0x2ba39a){return function(_0x19d72f){if(_0x19d72f){return _0x19d72f[_0xd056('0x27')](_0x5b8a3b)[_0xd056('0x28')](function(_0x44da3d){return _0x44da3d;});}return null;};}function removeEntity(_0x3c1f1e,_0x4c4bc3){return function(_0x70144f){if(_0x70144f){return _0x70144f[_0xd056('0x29')]()['then'](function(){var _0x189512=_0x70144f[_0xd056('0x2a')]({'plain':!![]});var _0xeccad5=_0xd056('0x2b');return db[_0xd056('0x2c')]['destroy']({'where':{'type':_0xeccad5,'resourceId':_0x189512['id']}})[_0xd056('0x28')](function(){return _0x70144f;});})[_0xd056('0x28')](function(){_0x3c1f1e[_0xd056('0x1b')](0xcc)[_0xd056('0x1c')]();});}};}function handleEntityNotFound(_0x420cf5,_0x440bae){return function(_0x50bf3c){if(!_0x50bf3c){_0x420cf5[_0xd056('0x1a')](0x194);}return _0x50bf3c;};}function handleError(_0x587b75,_0x387dfc){_0x387dfc=_0x387dfc||0x1f4;return function(_0x355b08){logger[_0xd056('0x2d')](_0x355b08['stack']);if(_0x355b08[_0xd056('0x2e')]){delete _0x355b08[_0xd056('0x2e')];}_0x587b75['status'](_0x387dfc)[_0xd056('0x2f')](_0x355b08);};}exports[_0xd056('0x30')]=function(_0x148977,_0x337af5){var _0x12ad26={},_0xb2eb={},_0x36e7d0={'count':0x0,'rows':[]};var _0x5be8e7=_['map'](db[_0xd056('0x31')][_0xd056('0x32')],function(_0x7713ff){return{'name':_0x7713ff['fieldName'],'type':_0x7713ff['type'][_0xd056('0x33')]};});_0xb2eb[_0xd056('0x34')]=_[_0xd056('0x35')](_0x5be8e7,_0xd056('0x2e'));_0xb2eb[_0xd056('0x36')]=_[_0xd056('0x37')](_0x148977[_0xd056('0x36')]);_0xb2eb[_0xd056('0x38')]=_['intersection'](_0xb2eb[_0xd056('0x34')],_0xb2eb['query']);_0x12ad26[_0xd056('0x39')]=_[_0xd056('0x3a')](_0xb2eb[_0xd056('0x34')],qs[_0xd056('0x3b')](_0x148977['query'][_0xd056('0x3b')]));_0x12ad26[_0xd056('0x39')]=_0x12ad26['attributes'][_0xd056('0x3c')]?_0x12ad26['attributes']:_0xb2eb[_0xd056('0x34')];if(!_0x148977[_0xd056('0x36')][_0xd056('0x3d')](_0xd056('0x3e'))){_0x12ad26['limit']=qs[_0xd056('0x1f')](_0x148977[_0xd056('0x36')][_0xd056('0x1f')]);_0x12ad26[_0xd056('0x21')]=qs[_0xd056('0x21')](_0x148977[_0xd056('0x36')]['offset']);}_0x12ad26[_0xd056('0x3f')]=qs[_0xd056('0x40')](_0x148977[_0xd056('0x36')][_0xd056('0x40')]);_0x12ad26['where']=qs[_0xd056('0x38')](_[_0xd056('0x41')](_0x148977[_0xd056('0x36')],_0xb2eb[_0xd056('0x38')]),_0x5be8e7);if(_0x148977['query'][_0xd056('0x42')]){_0x12ad26[_0xd056('0x43')]=_[_0xd056('0x44')](_0x12ad26['where'],{'$or':_[_0xd056('0x35')](_0x5be8e7,function(_0xee6e17){if(_0xee6e17['type']!==_0xd056('0x45')){var _0x119d8b={};_0x119d8b[_0xee6e17[_0xd056('0x2e')]]={'$like':'%'+_0x148977[_0xd056('0x36')][_0xd056('0x42')]+'%'};return _0x119d8b;}})});}_0x12ad26=_['merge']({},_0x12ad26,_0x148977['options']);var _0x1c0f1d={'where':_0x12ad26['where']};return db[_0xd056('0x31')]['count'](_0x1c0f1d)[_0xd056('0x28')](function(_0x86c248){_0x36e7d0[_0xd056('0x20')]=_0x86c248;if(_0x148977[_0xd056('0x36')][_0xd056('0x46')]){_0x12ad26[_0xd056('0x47')]=[{'all':!![]}];}return db[_0xd056('0x31')][_0xd056('0x48')](_0x12ad26);})[_0xd056('0x28')](function(_0x4b0e11){_0x36e7d0[_0xd056('0x49')]=_0x4b0e11;return _0x36e7d0;})['then'](respondWithFilteredResult(_0x337af5,_0x12ad26))[_0xd056('0x4a')](handleError(_0x337af5,null));};exports['show']=function(_0x13dd6f,_0x359b3a){var _0x34d401={'raw':!![],'where':{'id':_0x13dd6f[_0xd056('0x4b')]['id']}},_0x24652f={};_0x24652f[_0xd056('0x34')]=_['keys'](db['SmsQueue']['rawAttributes']);_0x24652f['query']=_[_0xd056('0x37')](_0x13dd6f[_0xd056('0x36')]);_0x24652f['filters']=_[_0xd056('0x3a')](_0x24652f[_0xd056('0x34')],_0x24652f['query']);_0x34d401['attributes']=_[_0xd056('0x3a')](_0x24652f[_0xd056('0x34')],qs[_0xd056('0x3b')](_0x13dd6f[_0xd056('0x36')][_0xd056('0x3b')]));_0x34d401[_0xd056('0x39')]=_0x34d401[_0xd056('0x39')]['length']?_0x34d401[_0xd056('0x39')]:_0x24652f[_0xd056('0x34')];if(_0x13dd6f[_0xd056('0x36')]['includeAll']){_0x34d401['include']=[{'all':!![]}];}_0x34d401=_[_0xd056('0x44')]({},_0x34d401,_0x13dd6f['options']);return db[_0xd056('0x31')]['find'](_0x34d401)[_0xd056('0x28')](handleEntityNotFound(_0x359b3a,null))[_0xd056('0x28')](respondWithResult(_0x359b3a,null))['catch'](handleError(_0x359b3a,null));};exports[_0xd056('0x4c')]=function(_0x3f2008,_0x1857e8){return db[_0xd056('0x31')]['create'](_0x3f2008[_0xd056('0x4d')],{})[_0xd056('0x28')](function(_0x1bfa32){var _0x41582b=_0x3f2008[_0xd056('0x4e')][_0xd056('0x2a')]({'plain':!![]});if(!_0x41582b)throw new Error(_0xd056('0x4f'));if(_0x41582b[_0xd056('0x50')]==='user'){var _0x25ec97=_0x1bfa32[_0xd056('0x2a')]({'plain':!![]});var _0xbb8b3b=_0xd056('0x2b');return db['UserProfileSection'][_0xd056('0x51')]({'where':{'name':_0xbb8b3b,'userProfileId':_0x41582b['userProfileId']},'raw':!![]})[_0xd056('0x28')](function(_0x313985){if(_0x313985&&_0x313985[_0xd056('0x52')]===0x0){return db[_0xd056('0x2c')][_0xd056('0x4c')]({'name':_0x25ec97[_0xd056('0x2e')],'resourceId':_0x25ec97['id'],'type':_0x313985[_0xd056('0x2e')],'sectionId':_0x313985['id']},{})['then'](function(){return _0x1bfa32;});}else{return _0x1bfa32;}})[_0xd056('0x4a')](function(_0x42d961){logger[_0xd056('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42d961);throw _0x42d961;});}return _0x1bfa32;})[_0xd056('0x28')](respondWithResult(_0x1857e8,0xc9))[_0xd056('0x4a')](handleError(_0x1857e8,null));};exports[_0xd056('0x27')]=function(_0x1fd634,_0x1e82d1){if(_0x1fd634[_0xd056('0x4d')]['id']){delete _0x1fd634[_0xd056('0x4d')]['id'];}return db['SmsQueue'][_0xd056('0x51')]({'where':{'id':_0x1fd634['params']['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x1e82d1,null))[_0xd056('0x28')](saveUpdates(_0x1fd634[_0xd056('0x4d')],null))[_0xd056('0x28')](respondWithResult(_0x1e82d1,null))['catch'](handleError(_0x1e82d1,null));};exports[_0xd056('0x29')]=function(_0x10766b,_0x372090){return db['SmsQueue'][_0xd056('0x51')]({'where':{'id':_0x10766b[_0xd056('0x4b')]['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x372090,null))['then'](removeEntity(_0x372090,null))[_0xd056('0x4a')](handleError(_0x372090,null));};exports[_0xd056('0x53')]=function(_0xabab1b,_0x3d6620){return db[_0xd056('0x31')][_0xd056('0x53')]()[_0xd056('0x28')](respondWithResult(_0x3d6620,null))[_0xd056('0x4a')](handleError(_0x3d6620,null));};exports['getMembers']=function(_0x4b4730,_0x5a0e9f,_0x19cb5a){var _0x447d68={'raw':!![],'where':{}},_0x55da79={},_0x271073;return db[_0xd056('0x31')][_0xd056('0x54')]({'where':{'id':_0x4b4730[_0xd056('0x4b')]['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x5a0e9f,null))[_0xd056('0x28')](function(_0x1224a5){if(_0x1224a5){_0x271073=_0x1224a5['get']({'plain':!![]});_0x55da79[_0xd056('0x34')]=_[_0xd056('0x37')](db[_0xd056('0x55')][_0xd056('0x32')]);_0x55da79[_0xd056('0x36')]=_[_0xd056('0x37')](_0x4b4730[_0xd056('0x36')]);_0x55da79[_0xd056('0x38')]=_[_0xd056('0x3a')](_0x55da79[_0xd056('0x34')],_0x55da79['query']);_0x447d68['attributes']=_[_0xd056('0x3a')](_0x55da79[_0xd056('0x34')],qs[_0xd056('0x3b')](_0x4b4730['query']['fields']));_0x447d68['attributes']=_0x447d68[_0xd056('0x39')][_0xd056('0x3c')]?_0x447d68[_0xd056('0x39')]:_0x55da79[_0xd056('0x34')];if(!_0x4b4730[_0xd056('0x36')][_0xd056('0x3d')]('nolimit')){_0x447d68[_0xd056('0x1f')]=qs['limit'](_0x4b4730[_0xd056('0x36')][_0xd056('0x1f')]);_0x447d68[_0xd056('0x21')]=qs[_0xd056('0x21')](_0x4b4730[_0xd056('0x36')][_0xd056('0x21')]);}_0x447d68[_0xd056('0x3f')]=qs[_0xd056('0x40')](_0x4b4730[_0xd056('0x36')][_0xd056('0x40')]);_0x447d68[_0xd056('0x43')]=qs[_0xd056('0x38')](_[_0xd056('0x41')](_0x4b4730[_0xd056('0x36')],_0x55da79[_0xd056('0x38')]));_0x447d68[_0xd056('0x43')]['SmsQueueId']=_0x1224a5['id'];if(_0x4b4730[_0xd056('0x36')]['filter']){_0x447d68[_0xd056('0x43')]=_[_0xd056('0x44')](_0x447d68[_0xd056('0x43')],{'$or':_[_0xd056('0x35')](_0x447d68[_0xd056('0x39')],function(_0x30b5ce){var _0x697f31={};_0x697f31[_0x30b5ce]={'$like':'%'+_0x4b4730['query'][_0xd056('0x42')]+'%'};return _0x697f31;})});}_0x447d68=_[_0xd056('0x44')]({},_0x447d68,_0x4b4730[_0xd056('0x56')]);return db[_0xd056('0x55')][_0xd056('0x48')](_0x447d68);}})[_0xd056('0x28')](function(_0x2bd926){if(_0x2bd926){return db[_0xd056('0x57')][_0xd056('0x58')]({'where':{'id':_[_0xd056('0x35')](_0x2bd926,_0xd056('0x59')),'role':_0xd056('0x5a')},'attributes':['id',_0xd056('0x2e'),_0xd056('0x5b'),'updatedAt',_0xd056('0x5c')]});}})[_0xd056('0x28')](function(_0x4b6f6d){if(_0x4b6f6d){return{'count':_0x4b6f6d[_0xd056('0x20')],'rows':_[_0xd056('0x35')](_0x4b6f6d[_0xd056('0x49')],function(_0x3a909){return{'membername':_0x3a909[_0xd056('0x2e')],'UserId':_0x3a909['id'],'queue_name':_0x271073['name'],'SmsQueueId':_0x271073['id'],'interface':util[_0xd056('0x5d')](_0xd056('0x5e'),'SIP',_0x3a909[_0xd056('0x2e')]),'penalty':0x0,'paused':_0x3a909[_0xd056('0x5b')],'createdAt':_0x3a909['createdAt'],'updatedAt':_0x3a909[_0xd056('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd056('0x28')](respondWithFilteredResult(_0x5a0e9f,_0x447d68))[_0xd056('0x4a')](handleError(_0x5a0e9f,null));};exports[_0xd056('0x60')]=function(_0x3a71e3,_0x197eb7,_0xee9586){var _0x8f797d={};var _0x2672f1={};var _0x55f618;var _0x3909b5;return db[_0xd056('0x31')]['findOne']({'where':{'id':_0x3a71e3[_0xd056('0x4b')]['id']}})['then'](handleEntityNotFound(_0x197eb7,null))[_0xd056('0x28')](function(_0x2fe3e8){if(_0x2fe3e8){_0x55f618=_0x2fe3e8;_0x2672f1[_0xd056('0x34')]=_[_0xd056('0x37')](db['Team']['rawAttributes']);_0x2672f1['query']=_['keys'](_0x3a71e3[_0xd056('0x36')]);_0x2672f1[_0xd056('0x38')]=_[_0xd056('0x3a')](_0x2672f1[_0xd056('0x34')],_0x2672f1['query']);_0x8f797d['attributes']=_[_0xd056('0x3a')](_0x2672f1['model'],qs[_0xd056('0x3b')](_0x3a71e3['query'][_0xd056('0x3b')]));_0x8f797d[_0xd056('0x39')]=_0x8f797d['attributes'][_0xd056('0x3c')]?_0x8f797d[_0xd056('0x39')]:_0x2672f1['model'];_0x8f797d[_0xd056('0x3f')]=qs[_0xd056('0x40')](_0x3a71e3['query']['sort']);_0x8f797d['where']=qs[_0xd056('0x38')](_[_0xd056('0x41')](_0x3a71e3['query'],_0x2672f1['filters']));if(_0x3a71e3[_0xd056('0x36')][_0xd056('0x42')]){_0x8f797d[_0xd056('0x43')]=_[_0xd056('0x44')](_0x8f797d[_0xd056('0x43')],{'$or':_['map'](_0x8f797d[_0xd056('0x39')],function(_0x1b71fc){var _0x36156d={};_0x36156d[_0x1b71fc]={'$like':'%'+_0x3a71e3['query'][_0xd056('0x42')]+'%'};return _0x36156d;})});}_0x8f797d=_[_0xd056('0x44')]({},_0x8f797d,_0x3a71e3[_0xd056('0x56')]);return _0x55f618['getTeams'](_0x8f797d);}})[_0xd056('0x28')](function(_0xa99812){if(_0xa99812){_0x3909b5=_0xa99812['length'];if(!_0x3a71e3[_0xd056('0x36')]['hasOwnProperty'](_0xd056('0x3e'))){_0x8f797d[_0xd056('0x1f')]=qs[_0xd056('0x1f')](_0x3a71e3[_0xd056('0x36')][_0xd056('0x1f')]);_0x8f797d[_0xd056('0x21')]=qs['offset'](_0x3a71e3[_0xd056('0x36')][_0xd056('0x21')]);}return _0x55f618['getTeams'](_0x8f797d);}})['then'](function(_0x3e6a27){if(_0x3e6a27){return _0x3e6a27?{'count':_0x3909b5,'rows':_0x3e6a27}:null;}})[_0xd056('0x28')](respondWithResult(_0x197eb7,null))[_0xd056('0x4a')](handleError(_0x197eb7,null));};exports['addTeams']=function(_0xa77d00,_0x71f555,_0x174afc){var _0x1cd44d=_0xa77d00[_0xd056('0x4d')][_0xd056('0x61')];return db[_0xd056('0x62')]['findAll']({'where':{'id':_0x1cd44d},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd056('0x63'),'attributes':['id',_0xd056('0x2e'),_0xd056('0x64'),_0xd056('0x65'),_0xd056('0x66')],'raw':!![]}]})[_0xd056('0x28')](function(_0xc3562b){if(_0xc3562b){var _0x23076f=_[_0xd056('0x67')](_0xc3562b,function(_0x1e9888){var _0x11c64d=_0x1e9888['get']({'plain':!![]});return _0x11c64d['Agents'];});return db['SmsQueue'][_0xd056('0x51')]({'where':{'id':_0xa77d00['params']['id']}})[_0xd056('0x28')](function(_0x878bb7){return db[_0xd056('0x68')][_0xd056('0x69')](function(_0x32d91a){return _0x878bb7[_0xd056('0x6a')](_0x1cd44d,{'transaction':_0x32d91a})[_0xd056('0x28')](function(){return BPromise[_0xd056('0x6b')](_0x23076f,function(_0x40f77e){return db['UserSmsQueue'][_0xd056('0x6c')]({'where':{'UserId':_0x40f77e['id'],'SmsQueueId':_0xa77d00[_0xd056('0x4b')]['id']},'transaction':_0x32d91a});});})[_0xd056('0x28')](function(){_0x23076f['forEach'](function(_0x1e94e9){socket[_0xd056('0x6d')](_0xd056('0x6e'),{'UserId':_0x1e94e9['id'],'SmsQueueId':_0x878bb7['id']});});});});});}})[_0xd056('0x28')](respondWithStatusCode(_0x71f555,null))['catch'](handleError(_0x71f555,null));};exports[_0xd056('0x6f')]=function(_0xf35e05,_0x5d7fc2,_0x16dbdc){return db['Team'][_0xd056('0x48')]({'where':{'id':_0xf35e05[_0xd056('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd056('0x57')],'as':_0xd056('0x63'),'attributes':['id'],'raw':!![]}]})[_0xd056('0x28')](handleEntityNotFound(_0x5d7fc2,null))[_0xd056('0x28')](function(_0x593ba6){var _0x4c9a2b=_['map'](_0x593ba6,'id');var _0xb6dd01=[];var _0xd40f0e=[];var _0x585d60=squel[_0xd056('0x70')]();_0x585d60[_0xd056('0x71')](_0xd056('0x72'))[_0xd056('0x73')]('team_has_sms_queues','tq')[_0xd056('0x74')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xd056('0x75'),_0xf35e05[_0xd056('0x4b')]['id']);for(var _0x526827=0x0;_0x526827<_0x593ba6[_0xd056('0x3c')];_0x526827+=0x1){let _0x3d13db=_0x593ba6[_0x526827];for(var _0x31f17f=0x0;_0x31f17f<_0x3d13db[_0xd056('0x63')]['length'];_0x31f17f+=0x1){let _0x42749f=_0x3d13db[_0xd056('0x63')][_0x31f17f];var _0x4460f0=_0x585d60[_0xd056('0x76')]();_0x4460f0[_0xd056('0x43')]('ut.UserId\x20=\x20?',_0x42749f['id']);_0xd40f0e[_0xd056('0x77')](db['sequelize']['query'](_0x4460f0[_0xd056('0x78')](),{'type':db[_0xd056('0x68')][_0xd056('0x79')][_0xd056('0x7a')]})[_0xd056('0x28')](function(_0x4178f4){if(_0x4178f4['length']===0x1){return _0x42749f['id'];}else{var _0xbf0cef=_[_0xd056('0x7b')](_['map'](_0x4178f4,'TeamId'),function(_0x382d9b){return _[_0xd056('0x7c')](_0x4c9a2b,_0x382d9b);});if(_0xbf0cef){return _0x42749f['id'];}}}));}}return BPromise[_0xd056('0x7d')](_0xd40f0e)[_0xd056('0x28')](function(_0x5cea04){_0xb6dd01=_(_0xb6dd01)[_0xd056('0x7e')](_0x5cea04)[_0xd056('0x7f')]()[_0xd056('0x80')]();return db[_0xd056('0x31')]['find']({'where':{'id':_0xf35e05[_0xd056('0x4b')]['id']}})[_0xd056('0x28')](function(_0x3f69ba){return db[_0xd056('0x68')][_0xd056('0x69')](function(_0x398186){return _0x3f69ba[_0xd056('0x6f')](_0xf35e05[_0xd056('0x36')][_0xd056('0x61')],{'transaction':_0x398186})[_0xd056('0x28')](function(){if(!_[_0xd056('0x81')](_0xb6dd01)){return _0x3f69ba[_0xd056('0x82')](_0xb6dd01,{'transaction':_0x398186});}})[_0xd056('0x28')](function(){_0xb6dd01[_0xd056('0x83')](function(_0x55ebf2){socket[_0xd056('0x6d')](_0xd056('0x84'),{'UserId':_0x55ebf2,'SmsQueueId':_0x3f69ba['id']});});});});});});})[_0xd056('0x28')](respondWithStatusCode(_0x5d7fc2,null))[_0xd056('0x4a')](handleError(_0x5d7fc2,null));};exports[_0xd056('0x85')]=function(_0x322b14,_0x324745,_0x20df47){return db[_0xd056('0x31')]['find']({'where':{'id':_0x322b14['params']['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x324745,null))[_0xd056('0x28')](function(_0xffaec8){if(_0xffaec8){return _0xffaec8[_0xd056('0x85')](_0x322b14[_0xd056('0x4d')]['ids'],_[_0xd056('0x86')](_0x322b14[_0xd056('0x4d')],[_0xd056('0x61'),'id'])||{})[_0xd056('0x87')](function(_0x309f29){for(var _0x396d33=0x0;_0x396d33<_0x322b14['body']['ids'][_0xd056('0x3c')];_0x396d33+=0x1){socket[_0xd056('0x6d')](_0xd056('0x6e'),{'UserId':Number(_0x322b14[_0xd056('0x4d')]['ids'][_0x396d33]),'SmsQueueId':Number(_0x322b14[_0xd056('0x4b')]['id'])});}return _0x309f29;});}})[_0xd056('0x28')](respondWithResult(_0x324745,null))[_0xd056('0x4a')](handleError(_0x324745,null));};exports[_0xd056('0x82')]=function(_0x15ced5,_0x5db443,_0x2ba98f){return db['SmsQueue'][_0xd056('0x51')]({'where':{'id':_0x15ced5[_0xd056('0x4b')]['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x5db443,null))[_0xd056('0x28')](function(_0x3ff168){if(_0x3ff168){return _0x3ff168['removeAgents'](_0x15ced5[_0xd056('0x36')][_0xd056('0x61')])[_0xd056('0x28')](function(){if(_['isArray'](_0x15ced5[_0xd056('0x36')]['ids'])){for(var _0x9936e8=0x0;_0x9936e8<_0x15ced5[_0xd056('0x36')][_0xd056('0x61')][_0xd056('0x3c')];_0x9936e8+=0x1){socket['emit'](_0xd056('0x84'),{'UserId':Number(_0x15ced5[_0xd056('0x36')][_0xd056('0x61')][_0x9936e8]),'SmsQueueId':Number(_0x15ced5['params']['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x15ced5[_0xd056('0x36')][_0xd056('0x61')]),'SmsQueueId':Number(_0x15ced5[_0xd056('0x4b')]['id'])});}});}})[_0xd056('0x28')](respondWithStatusCode(_0x5db443,null))[_0xd056('0x4a')](handleError(_0x5db443,null));};exports[_0xd056('0x88')]=function(_0x143789,_0x41a6cb,_0x470495){var _0x16bc67={};var _0x10136f={};var _0x217d7c;var _0x441e1d;return db[_0xd056('0x31')][_0xd056('0x54')]({'where':{'id':_0x143789['params']['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x41a6cb,null))[_0xd056('0x28')](function(_0xe60ce2){if(_0xe60ce2){_0x217d7c=_0xe60ce2;_0x10136f[_0xd056('0x34')]=_[_0xd056('0x37')](db[_0xd056('0x57')][_0xd056('0x32')]);_0x10136f[_0xd056('0x36')]=_['keys'](_0x143789[_0xd056('0x36')]);_0x10136f[_0xd056('0x38')]=_[_0xd056('0x3a')](_0x10136f['model'],_0x10136f[_0xd056('0x36')]);_0x16bc67['attributes']=_[_0xd056('0x3a')](_0x10136f['model'],qs[_0xd056('0x3b')](_0x143789[_0xd056('0x36')][_0xd056('0x3b')]));_0x16bc67[_0xd056('0x39')]=_0x16bc67[_0xd056('0x39')][_0xd056('0x3c')]?_0x16bc67[_0xd056('0x39')]:_0x10136f[_0xd056('0x34')];_0x16bc67[_0xd056('0x3f')]=qs[_0xd056('0x40')](_0x143789['query']['sort']);_0x16bc67[_0xd056('0x43')]=qs['filters'](_[_0xd056('0x41')](_0x143789[_0xd056('0x36')],_0x10136f['filters']));if(_0x143789[_0xd056('0x36')][_0xd056('0x42')]){_0x16bc67[_0xd056('0x43')]=_[_0xd056('0x44')](_0x16bc67[_0xd056('0x43')],{'$or':_[_0xd056('0x35')](_0x16bc67[_0xd056('0x39')],function(_0x58b5c0){var _0xdae2cc={};_0xdae2cc[_0x58b5c0]={'$like':'%'+_0x143789[_0xd056('0x36')][_0xd056('0x42')]+'%'};return _0xdae2cc;})});}_0x16bc67=_[_0xd056('0x44')]({},_0x16bc67,_0x143789[_0xd056('0x56')]);return _0x217d7c['getAgents'](_0x16bc67);}})[_0xd056('0x28')](function(_0xd76495){if(_0xd76495){_0x441e1d=_0xd76495['length'];if(!_0x143789['query'][_0xd056('0x3d')]('nolimit')){_0x16bc67['limit']=qs[_0xd056('0x1f')](_0x143789[_0xd056('0x36')][_0xd056('0x1f')]);_0x16bc67[_0xd056('0x21')]=qs[_0xd056('0x21')](_0x143789['query']['offset']);}return _0x217d7c[_0xd056('0x88')](_0x16bc67);}})['then'](function(_0x4f9e9f){if(_0x4f9e9f){return _0x4f9e9f?{'count':_0x441e1d,'rows':_0x4f9e9f}:null;}})[_0xd056('0x28')](respondWithResult(_0x41a6cb,null))[_0xd056('0x4a')](handleError(_0x41a6cb,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 86757fe..5c76305 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 _0xb53e=['exports','events','../../mysqldb','SmsQueue','save','update','emit','hasOwnProperty','hook'];(function(_0x46ce98,_0x52d764){var _0x172f46=function(_0x10ccee){while(--_0x10ccee){_0x46ce98['push'](_0x46ce98['shift']());}};_0x172f46(++_0x52d764);}(_0xb53e,0x1f0));var _0xeb53=function(_0x33b398,_0x2bb569){_0x33b398=_0x33b398-0x0;var _0x63e07c=_0xb53e[_0x33b398];return _0x63e07c;};'use strict';var EventEmitter=require(_0xeb53('0x0'));var SmsQueue=require(_0xeb53('0x1'))['db'][_0xeb53('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb53('0x3'),'afterUpdate':_0xeb53('0x4'),'afterDestroy':'remove'};function emitEvent(_0xf25546){return function(_0x9f7dfd,_0x8f6a90,_0x107291){SmsQueueEvents[_0xeb53('0x5')](_0xf25546+':'+_0x9f7dfd['id'],_0x9f7dfd);SmsQueueEvents[_0xeb53('0x5')](_0xf25546,_0x9f7dfd);_0x107291(null);};}for(var e in events){if(events[_0xeb53('0x6')](e)){var event=events[e];SmsQueue[_0xeb53('0x7')](e,emitEvent(event));}}module[_0xeb53('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xb5c7=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','hasOwnProperty','hook'];(function(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0xb5c7,0x13c));var _0x7b5c=function(_0x54e345,_0x316e23){_0x54e345=_0x54e345-0x0;var _0x518526=_0xb5c7[_0x54e345];return _0x518526;};'use strict';var EventEmitter=require(_0x7b5c('0x0'));var SmsQueue=require(_0x7b5c('0x1'))['db'][_0x7b5c('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7b5c('0x3')](0x0);var events={'afterCreate':_0x7b5c('0x4'),'afterUpdate':_0x7b5c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f44a7){return function(_0x2a81ca,_0x5d6357,_0x243f57){SmsQueueEvents['emit'](_0x1f44a7+':'+_0x2a81ca['id'],_0x2a81ca);SmsQueueEvents['emit'](_0x1f44a7,_0x2a81ca);_0x243f57(null);};}for(var e in events){if(events[_0x7b5c('0x6')](e)){var event=events[e];SmsQueue[_0x7b5c('0x7')](e,emitEvent(event));}}module[_0x7b5c('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 11223c5..18d7549 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 _0x22dc=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','SmsQueue','sms_queues','util'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x22dc,0x180));var _0xc22d=function(_0x4f7060,_0x6fc55b){_0x4f7060=_0x4f7060-0x0;var _0x4e6337=_0x22dc[_0x4f7060];return _0x4e6337;};'use strict';var _=require('lodash');var util=require(_0xc22d('0x0'));var logger=require(_0xc22d('0x1'))(_0xc22d('0x2'));var moment=require(_0xc22d('0x3'));var BPromise=require('bluebird');var rp=require(_0xc22d('0x4'));var fs=require('fs');var path=require(_0xc22d('0x5'));var rimraf=require(_0xc22d('0x6'));var config=require(_0xc22d('0x7'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x49bf1d,_0x41711f){return _0x49bf1d[_0xc22d('0x8')](_0xc22d('0x9'),attributes,{'tableName':_0xc22d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ede=['sms_queues','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x353a30,_0x50c68a){var _0x213161=function(_0x440b8b){while(--_0x440b8b){_0x353a30['push'](_0x353a30['shift']());}};_0x213161(++_0x50c68a);}(_0x0ede,0x149));var _0xe0ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ede[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe0ed('0x0'));var logger=require(_0xe0ed('0x1'))(_0xe0ed('0x2'));var moment=require(_0xe0ed('0x3'));var BPromise=require('bluebird');var rp=require(_0xe0ed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0ed('0x5'));var config=require(_0xe0ed('0x6'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x2ddc35,_0x5be568){return _0x2ddc35['define']('SmsQueue',attributes,{'tableName':_0xe0ed('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 60fd825..770c2e5 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 _0x6894=['debug','GetSmsQueue','SmsQueue','raw','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','where','limit','model','attributes','include','map','then'];(function(_0x3f8e92,_0x5a20b2){var _0x5b211b=function(_0x580299){while(--_0x580299){_0x3f8e92['push'](_0x3f8e92['shift']());}};_0x5b211b(++_0x5a20b2);}(_0x6894,0x13d));var _0x4689=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x6894[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0x4689('0x0'));var util=require(_0x4689('0x1'));var moment=require(_0x4689('0x2'));var BPromise=require(_0x4689('0x3'));var rs=require(_0x4689('0x4'));var fs=require('fs');var Redis=require(_0x4689('0x5'));var db=require(_0x4689('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4689('0x7'))(_0x4689('0x8'));var config=require(_0x4689('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4689('0xa')]({'port':0x232a});config[_0x4689('0xb')]=_['defaults'](config[_0x4689('0xb')],{'host':_0x4689('0xc'),'port':0x18eb});var socket=require(_0x4689('0xd'))(new Redis(config[_0x4689('0xb')]));require(_0x4689('0xe'))[_0x4689('0xf')](socket);function respondWithRpcPromise(_0x2f0437,_0x2ee96e,_0x324b3d){return new BPromise(function(_0x56d261,_0x5b0065){return client['request'](_0x2f0437,_0x324b3d)['then'](function(_0x1b5d51){logger[_0x4689('0x10')](_0x4689('0x11'),_0x2ee96e,_0x4689('0x12'));logger['debug'](_0x4689('0x13'),_0x2ee96e,_0x4689('0x12'),JSON[_0x4689('0x14')](_0x1b5d51));if(_0x1b5d51[_0x4689('0x15')]){if(_0x1b5d51[_0x4689('0x15')]['code']===0x1f4){logger[_0x4689('0x15')](_0x4689('0x11'),_0x2ee96e,_0x1b5d51['error'][_0x4689('0x16')]);return _0x5b0065(_0x1b5d51[_0x4689('0x15')][_0x4689('0x16')]);}logger[_0x4689('0x15')](_0x4689('0x11'),_0x2ee96e,_0x1b5d51[_0x4689('0x15')][_0x4689('0x16')]);return _0x56d261(_0x1b5d51[_0x4689('0x15')][_0x4689('0x16')]);}else{logger[_0x4689('0x10')](_0x4689('0x11'),_0x2ee96e,_0x4689('0x12'));_0x56d261(_0x1b5d51[_0x4689('0x17')][_0x4689('0x16')]);}})[_0x4689('0x18')](function(_0x1c4128){logger[_0x4689('0x15')](_0x4689('0x11'),_0x2ee96e,_0x1c4128);_0x5b0065(_0x1c4128);});});}exports['GetSmsQueue']=function(_0xec28ad){var _0x5a3713=this;return new Promise(function(_0x229dc6,_0x3f2415){return db['SmsQueue'][_0x4689('0x19')]({'raw':_0xec28ad[_0x4689('0x1a')]?_0xec28ad[_0x4689('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xec28ad[_0x4689('0x1a')]?_0xec28ad[_0x4689('0x1a')][_0x4689('0x1b')]||null:null,'attributes':_0xec28ad[_0x4689('0x1a')]?_0xec28ad['options']['attributes']||null:null,'limit':_0xec28ad['options']?_0xec28ad[_0x4689('0x1a')][_0x4689('0x1c')]||null:null,'include':_0xec28ad[_0x4689('0x1a')]?_0xec28ad[_0x4689('0x1a')]['include']?_['map'](_0xec28ad[_0x4689('0x1a')]['include'],function(_0x466c9b){return{'model':db[_0x466c9b[_0x4689('0x1d')]],'as':_0x466c9b['as'],'attributes':_0x466c9b[_0x4689('0x1e')],'include':_0x466c9b[_0x4689('0x1f')]?_[_0x4689('0x20')](_0x466c9b[_0x4689('0x1f')],function(_0x5a7369){return{'model':db[_0x5a7369[_0x4689('0x1d')]],'as':_0x5a7369['as'],'attributes':_0x5a7369['attributes'],'include':_0x5a7369[_0x4689('0x1f')]?_[_0x4689('0x20')](_0x5a7369[_0x4689('0x1f')],function(_0xbfcdc1){return{'model':db[_0xbfcdc1['model']],'as':_0xbfcdc1['as'],'attributes':_0xbfcdc1[_0x4689('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4689('0x21')](function(_0x8f09ef){logger['info']('GetSmsQueue',_0xec28ad);logger[_0x4689('0x22')]('GetSmsQueue',_0xec28ad,JSON['stringify'](_0x8f09ef));_0x229dc6(_0x8f09ef);})[_0x4689('0x18')](function(_0xac203){logger[_0x4689('0x15')](_0x4689('0x23'),_0xac203['message'],_0xec28ad);_0x3f2415(_0x5a3713[_0x4689('0x15')](0x1f4,_0xac203[_0x4689('0x16')]));});});};exports['ShowSmsQueue']=function(_0x14265b){var _0x4f749a=this;return new Promise(function(_0x5e33d7,_0x43ce37){return db[_0x4689('0x24')]['find']({'raw':_0x14265b[_0x4689('0x1a')]?_0x14265b[_0x4689('0x1a')][_0x4689('0x25')]===undefined?!![]:![]:!![],'where':_0x14265b['options']?_0x14265b[_0x4689('0x1a')][_0x4689('0x1b')]||null:null,'attributes':_0x14265b['options']?_0x14265b['options']['attributes']||null:null,'include':_0x14265b[_0x4689('0x1a')]?_0x14265b['options'][_0x4689('0x1f')]?_['map'](_0x14265b[_0x4689('0x1a')]['include'],function(_0x37562a){return{'model':db[_0x37562a[_0x4689('0x1d')]],'as':_0x37562a['as'],'attributes':_0x37562a[_0x4689('0x1e')],'include':_0x37562a[_0x4689('0x1f')]?_[_0x4689('0x20')](_0x37562a[_0x4689('0x1f')],function(_0x1123ed){return{'model':db[_0x1123ed[_0x4689('0x1d')]],'as':_0x1123ed['as'],'attributes':_0x1123ed[_0x4689('0x1e')],'include':_0x1123ed[_0x4689('0x1f')]?_[_0x4689('0x20')](_0x1123ed[_0x4689('0x1f')],function(_0x3f6414){return{'model':db[_0x3f6414[_0x4689('0x1d')]],'as':_0x3f6414['as'],'attributes':_0x3f6414[_0x4689('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4689('0x21')](function(_0x133395){logger['info'](_0x4689('0x26'),_0x14265b);logger['debug'](_0x4689('0x26'),_0x14265b,JSON[_0x4689('0x14')](_0x133395));_0x5e33d7(_0x133395);})[_0x4689('0x18')](function(_0x5d9885){logger[_0x4689('0x15')]('ShowSmsQueue',_0x5d9885[_0x4689('0x16')],_0x14265b);_0x43ce37(_0x4f749a[_0x4689('0x15')](0x1f4,_0x5d9885[_0x4689('0x16')]));});});}; \ No newline at end of file +var _0x87a3=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','./smsQueue.socket','request','then','info','request\x20sent','stringify','error','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowSmsQueue'];(function(_0x21c331,_0x3f889f){var _0x3f2c43=function(_0x2484f3){while(--_0x2484f3){_0x21c331['push'](_0x21c331['shift']());}};_0x3f2c43(++_0x3f889f);}(_0x87a3,0xa5));var _0x387a=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x87a3[_0x3d4876];return _0x58ca9d;};'use strict';var _=require(_0x387a('0x0'));var util=require(_0x387a('0x1'));var moment=require(_0x387a('0x2'));var BPromise=require('bluebird');var rs=require(_0x387a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x387a('0x4'))['db'];var utils=require(_0x387a('0x5'));var logger=require(_0x387a('0x6'))(_0x387a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x387a('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x387a('0x8')]));require(_0x387a('0x9'))['register'](socket);function respondWithRpcPromise(_0x2ad5fd,_0x58bd2e,_0x454942){return new BPromise(function(_0x6e97dd,_0x51a194){return client[_0x387a('0xa')](_0x2ad5fd,_0x454942)[_0x387a('0xb')](function(_0x46f41b){logger[_0x387a('0xc')]('SmsQueue,\x20%s,\x20%s',_0x58bd2e,_0x387a('0xd'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x58bd2e,_0x387a('0xd'),JSON[_0x387a('0xe')](_0x46f41b));if(_0x46f41b[_0x387a('0xf')]){if(_0x46f41b[_0x387a('0xf')]['code']===0x1f4){logger[_0x387a('0xf')](_0x387a('0x10'),_0x58bd2e,_0x46f41b[_0x387a('0xf')][_0x387a('0x11')]);return _0x51a194(_0x46f41b['error'][_0x387a('0x11')]);}logger[_0x387a('0xf')]('SmsQueue,\x20%s,\x20%s',_0x58bd2e,_0x46f41b[_0x387a('0xf')][_0x387a('0x11')]);return _0x6e97dd(_0x46f41b[_0x387a('0xf')][_0x387a('0x11')]);}else{logger[_0x387a('0xc')](_0x387a('0x10'),_0x58bd2e,_0x387a('0xd'));_0x6e97dd(_0x46f41b[_0x387a('0x12')]['message']);}})[_0x387a('0x13')](function(_0x4a84cb){logger[_0x387a('0xf')](_0x387a('0x10'),_0x58bd2e,_0x4a84cb);_0x51a194(_0x4a84cb);});});}exports[_0x387a('0x14')]=function(_0x29b5fc){var _0x307a6e=this;return new Promise(function(_0xe209f0,_0xa4096e){return db[_0x387a('0x15')][_0x387a('0x16')]({'raw':_0x29b5fc[_0x387a('0x17')]?_0x29b5fc[_0x387a('0x17')][_0x387a('0x18')]===undefined?!![]:![]:!![],'where':_0x29b5fc['options']?_0x29b5fc[_0x387a('0x17')][_0x387a('0x19')]||null:null,'attributes':_0x29b5fc['options']?_0x29b5fc[_0x387a('0x17')][_0x387a('0x1a')]||null:null,'limit':_0x29b5fc[_0x387a('0x17')]?_0x29b5fc[_0x387a('0x17')][_0x387a('0x1b')]||null:null,'include':_0x29b5fc[_0x387a('0x17')]?_0x29b5fc['options'][_0x387a('0x1c')]?_[_0x387a('0x1d')](_0x29b5fc[_0x387a('0x17')][_0x387a('0x1c')],function(_0x47d330){return{'model':db[_0x47d330[_0x387a('0x1e')]],'as':_0x47d330['as'],'attributes':_0x47d330[_0x387a('0x1a')],'include':_0x47d330['include']?_['map'](_0x47d330['include'],function(_0x41dc4d){return{'model':db[_0x41dc4d[_0x387a('0x1e')]],'as':_0x41dc4d['as'],'attributes':_0x41dc4d['attributes'],'include':_0x41dc4d[_0x387a('0x1c')]?_[_0x387a('0x1d')](_0x41dc4d[_0x387a('0x1c')],function(_0x26a0f0){return{'model':db[_0x26a0f0[_0x387a('0x1e')]],'as':_0x26a0f0['as'],'attributes':_0x26a0f0[_0x387a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x387a('0xb')](function(_0x14fe2a){logger[_0x387a('0xc')]('GetSmsQueue',_0x29b5fc);logger[_0x387a('0x1f')](_0x387a('0x14'),_0x29b5fc,JSON[_0x387a('0xe')](_0x14fe2a));_0xe209f0(_0x14fe2a);})[_0x387a('0x13')](function(_0x220c41){logger[_0x387a('0xf')]('GetSmsQueue',_0x220c41[_0x387a('0x11')],_0x29b5fc);_0xa4096e(_0x307a6e[_0x387a('0xf')](0x1f4,_0x220c41['message']));});});};exports['ShowSmsQueue']=function(_0x3f746){var _0x1b3957=this;return new Promise(function(_0x29ccc0,_0x120a4f){return db['SmsQueue']['find']({'raw':_0x3f746[_0x387a('0x17')]?_0x3f746[_0x387a('0x17')][_0x387a('0x18')]===undefined?!![]:![]:!![],'where':_0x3f746[_0x387a('0x17')]?_0x3f746[_0x387a('0x17')][_0x387a('0x19')]||null:null,'attributes':_0x3f746[_0x387a('0x17')]?_0x3f746[_0x387a('0x17')][_0x387a('0x1a')]||null:null,'include':_0x3f746[_0x387a('0x17')]?_0x3f746[_0x387a('0x17')][_0x387a('0x1c')]?_[_0x387a('0x1d')](_0x3f746['options']['include'],function(_0x55a10f){return{'model':db[_0x55a10f[_0x387a('0x1e')]],'as':_0x55a10f['as'],'attributes':_0x55a10f[_0x387a('0x1a')],'include':_0x55a10f['include']?_[_0x387a('0x1d')](_0x55a10f[_0x387a('0x1c')],function(_0x161e3f){return{'model':db[_0x161e3f[_0x387a('0x1e')]],'as':_0x161e3f['as'],'attributes':_0x161e3f[_0x387a('0x1a')],'include':_0x161e3f[_0x387a('0x1c')]?_['map'](_0x161e3f[_0x387a('0x1c')],function(_0x44c293){return{'model':db[_0x44c293[_0x387a('0x1e')]],'as':_0x44c293['as'],'attributes':_0x44c293[_0x387a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x387a('0xb')](function(_0x51ca8f){logger[_0x387a('0xc')](_0x387a('0x20'),_0x3f746);logger[_0x387a('0x1f')](_0x387a('0x20'),_0x3f746,JSON[_0x387a('0xe')](_0x51ca8f));_0x29ccc0(_0x51ca8f);})[_0x387a('0x13')](function(_0x2c8bec){logger[_0x387a('0xf')](_0x387a('0x20'),_0x2c8bec[_0x387a('0x11')],_0x3f746);_0x120a4f(_0x1b3957[_0x387a('0xf')](0x1f4,_0x2c8bec['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 896fa15..1819385 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 _0x6e58=['./smsQueue.events','remove','emit','register','smsQueue:'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0x6e58,0x118));var _0x86e5=function(_0x30ec48,_0xda08c2){_0x30ec48=_0x30ec48-0x0;var _0x5ad2e0=_0x6e58[_0x30ec48];return _0x5ad2e0;};'use strict';var SmsQueueEvents=require(_0x86e5('0x0'));var events=['save',_0x86e5('0x1'),'update'];function createListener(_0x501c1d,_0x27f7a5){return function(_0x55e7ec){_0x27f7a5[_0x86e5('0x2')](_0x501c1d,_0x55e7ec);};}function removeListener(_0x21c7ca,_0x28a398){return function(){SmsQueueEvents['removeListener'](_0x21c7ca,_0x28a398);};}exports[_0x86e5('0x3')]=function(_0xcab069){for(var _0x1d73f2=0x0,_0x356423=events['length'];_0x1d73f2<_0x356423;_0x1d73f2++){var _0x5ee06b=events[_0x1d73f2];var _0xa5a26b=createListener(_0x86e5('0x4')+_0x5ee06b,_0xcab069);SmsQueueEvents['on'](_0x5ee06b,_0xa5a26b);}}; \ No newline at end of file +var _0x1ffa=['./smsQueue.events','save','remove','length','smsQueue:'];(function(_0x2bf2a4,_0x2ea970){var _0x34ab49=function(_0x122214){while(--_0x122214){_0x2bf2a4['push'](_0x2bf2a4['shift']());}};_0x34ab49(++_0x2ea970);}(_0x1ffa,0xb9));var _0xa1ff=function(_0x515610,_0x51d4ca){_0x515610=_0x515610-0x0;var _0x555356=_0x1ffa[_0x515610];return _0x555356;};'use strict';var SmsQueueEvents=require(_0xa1ff('0x0'));var events=[_0xa1ff('0x1'),_0xa1ff('0x2'),'update'];function createListener(_0x41f054,_0x1c74a5){return function(_0x328eea){_0x1c74a5['emit'](_0x41f054,_0x328eea);};}function removeListener(_0x2649d7,_0x4ba1f2){return function(){SmsQueueEvents['removeListener'](_0x2649d7,_0x4ba1f2);};}exports['register']=function(_0xfbbee8){for(var _0x3d64d6=0x0,_0x30e023=events[_0xa1ff('0x3')];_0x3d64d6<_0x30e023;_0x3d64d6++){var _0x5db553=events[_0x3d64d6];var _0x3009a6=createListener(_0xa1ff('0x4')+_0x5db553,_0xfbbee8);SmsQueueEvents['on'](_0x5db553,_0x3009a6);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index e9e47e3..e68112d 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 _0x5395=['index','/describe','/:id','show','update','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x52b536,_0x5e1303){var _0x1e5c30=function(_0x3913f2){while(--_0x3913f2){_0x52b536['push'](_0x52b536['shift']());}};_0x1e5c30(++_0x5e1303);}(_0x5395,0x150));var _0x5539=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5395[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x5539('0x0'));var util=require('util');var path=require(_0x5539('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5539('0x2')]();var fs_extra=require(_0x5539('0x3'));var auth=require(_0x5539('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5539('0x5'));var controller=require(_0x5539('0x6'));router[_0x5539('0x7')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0x9')]);router[_0x5539('0x7')](_0x5539('0xa'),auth[_0x5539('0x8')](),controller['describe']);router[_0x5539('0x7')](_0x5539('0xb'),auth[_0x5539('0x8')](),controller[_0x5539('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5539('0xb'),auth['isAuthenticated'](),controller[_0x5539('0xd')]);router['delete'](_0x5539('0xb'),auth[_0x5539('0x8')](),controller['destroy']);module[_0x5539('0xe')]=router; \ No newline at end of file +var _0xe28c=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','post','put','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x27e689,_0x322669){var _0xa9df48=function(_0x2d6ede){while(--_0x2d6ede){_0x27e689['push'](_0x27e689['shift']());}};_0xa9df48(++_0x322669);}(_0xe28c,0x175));var _0xce28=function(_0x43330e,_0x3ddaae){_0x43330e=_0x43330e-0x0;var _0x9fedf4=_0xe28c[_0x43330e];return _0x9fedf4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xce28('0x0'));var timeout=require(_0xce28('0x1'));var express=require(_0xce28('0x2'));var router=express[_0xce28('0x3')]();var fs_extra=require(_0xce28('0x4'));var auth=require(_0xce28('0x5'));var interaction=require(_0xce28('0x6'));var config=require(_0xce28('0x7'));var controller=require('./smsQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xce28('0x8')]);router[_0xce28('0x9')](_0xce28('0xa'),auth[_0xce28('0xb')](),controller[_0xce28('0xc')]);router[_0xce28('0x9')](_0xce28('0xd'),auth[_0xce28('0xb')](),controller['show']);router[_0xce28('0xe')]('/',auth[_0xce28('0xb')](),controller['create']);router[_0xce28('0xf')]('/:id',auth[_0xce28('0xb')](),controller['update']);router['delete']('/:id',auth[_0xce28('0xb')](),controller[_0xce28('0x10')]);module[_0xce28('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index e963c8d..44f6139 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 _0xf7d5=['DATE','sequelize','exports','STRING'];(function(_0x2d7214,_0x48ed98){var _0x1152dc=function(_0x8c93d1){while(--_0x8c93d1){_0x2d7214['push'](_0x2d7214['shift']());}};_0x1152dc(++_0x48ed98);}(_0xf7d5,0x189));var _0x5f7d=function(_0x3ead55,_0x22bc51){_0x3ead55=_0x3ead55-0x0;var _0x3ea16d=_0xf7d5[_0x3ead55];return _0x3ea16d;};'use strict';var moment=require('moment');var Sequelize=require(_0x5f7d('0x0'));module[_0x5f7d('0x1')]={'uniqueid':{'type':Sequelize[_0x5f7d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5f7d('0x2')]},'joinAt':{'type':Sequelize[_0x5f7d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5f7d('0x3')]},'exitAt':{'type':Sequelize[_0x5f7d('0x3')]},'reason':{'type':Sequelize[_0x5f7d('0x2')]}}; \ No newline at end of file +var _0x80fc=['DATE','moment','sequelize','exports','STRING'];(function(_0x27b506,_0x3f8745){var _0x4cae56=function(_0x2d315d){while(--_0x2d315d){_0x27b506['push'](_0x27b506['shift']());}};_0x4cae56(++_0x3f8745);}(_0x80fc,0x1af));var _0xc80f=function(_0x43dc0d,_0x2b1247){_0x43dc0d=_0x43dc0d-0x0;var _0x58484d=_0x80fc[_0x43dc0d];return _0x58484d;};'use strict';var moment=require(_0xc80f('0x0'));var Sequelize=require(_0xc80f('0x1'));module[_0xc80f('0x2')]={'uniqueid':{'type':Sequelize[_0xc80f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc80f('0x3')]},'joinAt':{'type':Sequelize[_0xc80f('0x4')]},'leaveAt':{'type':Sequelize[_0xc80f('0x4')]},'acceptAt':{'type':Sequelize[_0xc80f('0x4')]},'exitAt':{'type':Sequelize[_0xc80f('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 0ce9cb4..0250b3e 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 _0x733c=['query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','keys','include','find','catch','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','Content-Range','apply','save','update','destroy','then','end','error','stack','name','index','SmsQueueReport','type','model','map'];(function(_0x41229c,_0x32fc89){var _0x1ce6c7=function(_0x9f4b40){while(--_0x9f4b40){_0x41229c['push'](_0x41229c['shift']());}};_0x1ce6c7(++_0x32fc89);}(_0x733c,0x13a));var _0xc733=function(_0x43dcaf,_0x4e0169){_0x43dcaf=_0x43dcaf-0x0;var _0x20dd04=_0x733c[_0x43dcaf];return _0x20dd04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc733('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc733('0x1'));var rp=require(_0xc733('0x2'));var moment=require(_0xc733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc733('0x4'));var util=require(_0xc733('0x5'));var path=require(_0xc733('0x6'));var sox=require(_0xc733('0x7'));var csv=require(_0xc733('0x8'));var ejs=require(_0xc733('0x9'));var fs=require('fs');var fs_extra=require(_0xc733('0xa'));var _=require(_0xc733('0xb'));var squel=require(_0xc733('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc733('0x8'));var querystring=require(_0xc733('0xd'));var Papa=require(_0xc733('0xe'));var Redis=require(_0xc733('0xf'));var authService=require(_0xc733('0x10'));var qs=require(_0xc733('0x11'));var as=require(_0xc733('0x12'));var hardwareService=require(_0xc733('0x13'));var logger=require(_0xc733('0x14'))('api');var utils=require(_0xc733('0x15'));var config=require(_0xc733('0x16'));var licenseUtil=require(_0xc733('0x17'));var db=require(_0xc733('0x18'))['db'];function respondWithStatusCode(_0x2d3ad6,_0x5f59b6){_0x5f59b6=_0x5f59b6||0xcc;return function(_0x5bd4fa){if(_0x5bd4fa){return _0x2d3ad6[_0xc733('0x19')](_0x5f59b6);}return _0x2d3ad6[_0xc733('0x1a')](_0x5f59b6)['end']();};}function respondWithResult(_0x4d238d,_0x1beabd){_0x1beabd=_0x1beabd||0xc8;return function(_0x1ca6d6){if(_0x1ca6d6){return _0x4d238d[_0xc733('0x1a')](_0x1beabd)[_0xc733('0x1b')](_0x1ca6d6);}};}function respondWithFilteredResult(_0x1b03e6,_0x217815){return function(_0x14503e){if(_0x14503e){var _0xc1748d=typeof _0x217815['offset']==='undefined'&&typeof _0x217815[_0xc733('0x1c')]==='undefined';var _0x1675cb=_0x14503e[_0xc733('0x1d')];var _0x873c18=_0xc1748d?0x0:_0x217815[_0xc733('0x1e')];var _0x33b2c2=_0xc1748d?_0x14503e[_0xc733('0x1d')]:_0x217815[_0xc733('0x1e')]+_0x217815['limit'];var _0x178e48;if(_0x33b2c2>=_0x1675cb){_0x33b2c2=_0x1675cb;_0x178e48=0xc8;}else{_0x178e48=0xce;}_0x1b03e6[_0xc733('0x1a')](_0x178e48);return _0x1b03e6['set'](_0xc733('0x1f'),_0x873c18+'-'+_0x33b2c2+'/'+_0x1675cb)[_0xc733('0x1b')](_0x14503e);}return null;};}function patchUpdates(_0x237836){return function(_0x23c698){try{jsonpatch[_0xc733('0x20')](_0x23c698,_0x237836,!![]);}catch(_0x1f4a6c){return BPromise['reject'](_0x1f4a6c);}return _0x23c698[_0xc733('0x21')]();};}function saveUpdates(_0x16b15d,_0x18f88b){return function(_0x4958ef){if(_0x4958ef){return _0x4958ef[_0xc733('0x22')](_0x16b15d)['then'](function(_0x3ae555){return _0x3ae555;});}return null;};}function removeEntity(_0x4b3cda,_0x428493){return function(_0xefea1c){if(_0xefea1c){return _0xefea1c[_0xc733('0x23')]()[_0xc733('0x24')](function(){_0x4b3cda[_0xc733('0x1a')](0xcc)[_0xc733('0x25')]();});}};}function handleEntityNotFound(_0x4e92a1,_0x27d8cf){return function(_0x2e94cd){if(!_0x2e94cd){_0x4e92a1[_0xc733('0x19')](0x194);}return _0x2e94cd;};}function handleError(_0x1edd79,_0x196153){_0x196153=_0x196153||0x1f4;return function(_0x332662){logger[_0xc733('0x26')](_0x332662[_0xc733('0x27')]);if(_0x332662[_0xc733('0x28')]){delete _0x332662[_0xc733('0x28')];}_0x1edd79[_0xc733('0x1a')](_0x196153)['send'](_0x332662);};}exports[_0xc733('0x29')]=function(_0x1537cb,_0x14894c){var _0x2c9718={},_0x5a3146={},_0x5f4e3e={'count':0x0,'rows':[]};var _0x48c523=_['map'](db[_0xc733('0x2a')]['rawAttributes'],function(_0x58cf98){return{'name':_0x58cf98['fieldName'],'type':_0x58cf98[_0xc733('0x2b')]['key']};});_0x5a3146[_0xc733('0x2c')]=_[_0xc733('0x2d')](_0x48c523,_0xc733('0x28'));_0x5a3146['query']=_['keys'](_0x1537cb[_0xc733('0x2e')]);_0x5a3146[_0xc733('0x2f')]=_['intersection'](_0x5a3146[_0xc733('0x2c')],_0x5a3146[_0xc733('0x2e')]);_0x2c9718[_0xc733('0x30')]=_[_0xc733('0x31')](_0x5a3146[_0xc733('0x2c')],qs[_0xc733('0x32')](_0x1537cb[_0xc733('0x2e')][_0xc733('0x32')]));_0x2c9718[_0xc733('0x30')]=_0x2c9718[_0xc733('0x30')][_0xc733('0x33')]?_0x2c9718[_0xc733('0x30')]:_0x5a3146[_0xc733('0x2c')];if(!_0x1537cb[_0xc733('0x2e')][_0xc733('0x34')](_0xc733('0x35'))){_0x2c9718[_0xc733('0x1c')]=qs[_0xc733('0x1c')](_0x1537cb[_0xc733('0x2e')][_0xc733('0x1c')]);_0x2c9718[_0xc733('0x1e')]=qs['offset'](_0x1537cb[_0xc733('0x2e')][_0xc733('0x1e')]);}_0x2c9718['order']=qs['sort'](_0x1537cb[_0xc733('0x2e')][_0xc733('0x36')]);_0x2c9718[_0xc733('0x37')]=qs[_0xc733('0x2f')](_['pick'](_0x1537cb['query'],_0x5a3146[_0xc733('0x2f')]),_0x48c523);if(_0x1537cb[_0xc733('0x2e')][_0xc733('0x38')]){_0x2c9718[_0xc733('0x37')]=_[_0xc733('0x39')](_0x2c9718[_0xc733('0x37')],{'$or':_[_0xc733('0x2d')](_0x48c523,function(_0x38e0e0){if(_0x38e0e0[_0xc733('0x2b')]!==_0xc733('0x3a')){var _0xf52649={};_0xf52649[_0x38e0e0[_0xc733('0x28')]]={'$like':'%'+_0x1537cb[_0xc733('0x2e')][_0xc733('0x38')]+'%'};return _0xf52649;}})});}_0x2c9718=_[_0xc733('0x39')]({},_0x2c9718,_0x1537cb[_0xc733('0x3b')]);var _0x3c8ea8={'where':_0x2c9718['where']};return db[_0xc733('0x2a')][_0xc733('0x1d')](_0x3c8ea8)['then'](function(_0x732a7c){_0x5f4e3e[_0xc733('0x1d')]=_0x732a7c;if(_0x1537cb[_0xc733('0x2e')][_0xc733('0x3c')]){_0x2c9718['include']=[{'all':!![]}];}return db[_0xc733('0x2a')][_0xc733('0x3d')](_0x2c9718);})[_0xc733('0x24')](function(_0xbb06e7){_0x5f4e3e[_0xc733('0x3e')]=_0xbb06e7;return _0x5f4e3e;})[_0xc733('0x24')](respondWithFilteredResult(_0x14894c,_0x2c9718))['catch'](handleError(_0x14894c,null));};exports[_0xc733('0x3f')]=function(_0x206b44,_0xc10e2e){var _0x27c613={'raw':!![],'where':{'id':_0x206b44['params']['id']}},_0x369958={};_0x369958[_0xc733('0x2c')]=_[_0xc733('0x40')](db[_0xc733('0x2a')]['rawAttributes']);_0x369958[_0xc733('0x2e')]=_[_0xc733('0x40')](_0x206b44['query']);_0x369958[_0xc733('0x2f')]=_[_0xc733('0x31')](_0x369958[_0xc733('0x2c')],_0x369958[_0xc733('0x2e')]);_0x27c613[_0xc733('0x30')]=_['intersection'](_0x369958[_0xc733('0x2c')],qs[_0xc733('0x32')](_0x206b44[_0xc733('0x2e')][_0xc733('0x32')]));_0x27c613['attributes']=_0x27c613[_0xc733('0x30')][_0xc733('0x33')]?_0x27c613[_0xc733('0x30')]:_0x369958[_0xc733('0x2c')];if(_0x206b44['query'][_0xc733('0x3c')]){_0x27c613[_0xc733('0x41')]=[{'all':!![]}];}_0x27c613=_[_0xc733('0x39')]({},_0x27c613,_0x206b44[_0xc733('0x3b')]);return db['SmsQueueReport'][_0xc733('0x42')](_0x27c613)[_0xc733('0x24')](handleEntityNotFound(_0xc10e2e,null))[_0xc733('0x24')](respondWithResult(_0xc10e2e,null))[_0xc733('0x43')](handleError(_0xc10e2e,null));};exports[_0xc733('0x44')]=function(_0x39a4e9,_0x1998cb){return db['SmsQueueReport'][_0xc733('0x44')](_0x39a4e9[_0xc733('0x45')],{})[_0xc733('0x24')](respondWithResult(_0x1998cb,0xc9))['catch'](handleError(_0x1998cb,null));};exports['update']=function(_0x4826b5,_0x7a7b30){if(_0x4826b5[_0xc733('0x45')]['id']){delete _0x4826b5[_0xc733('0x45')]['id'];}return db[_0xc733('0x2a')][_0xc733('0x42')]({'where':{'id':_0x4826b5[_0xc733('0x46')]['id']}})[_0xc733('0x24')](handleEntityNotFound(_0x7a7b30,null))[_0xc733('0x24')](saveUpdates(_0x4826b5[_0xc733('0x45')],null))['then'](respondWithResult(_0x7a7b30,null))['catch'](handleError(_0x7a7b30,null));};exports[_0xc733('0x23')]=function(_0x4b45ef,_0x538750){return db['SmsQueueReport'][_0xc733('0x42')]({'where':{'id':_0x4b45ef[_0xc733('0x46')]['id']}})['then'](handleEntityNotFound(_0x538750,null))[_0xc733('0x24')](removeEntity(_0x538750,null))[_0xc733('0x43')](handleError(_0x538750,null));};exports[_0xc733('0x47')]=function(_0x5b734e,_0x5a87e3){return db[_0xc733('0x2a')]['describe']()[_0xc733('0x24')](respondWithResult(_0x5a87e3,null))[_0xc733('0x43')](handleError(_0x5a87e3,null));}; \ No newline at end of file +var _0xf8e3=['undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','find','create','body','destroy','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0xf8e3,0xc2));var _0x3f8e=function(_0x1dcdc1,_0x2fdd77){_0x1dcdc1=_0x1dcdc1-0x0;var _0x24a48c=_0xf8e3[_0x1dcdc1];return _0x24a48c;};'use strict';var emlformat=require(_0x3f8e('0x0'));var rimraf=require(_0x3f8e('0x1'));var zipdir=require(_0x3f8e('0x2'));var jsonpatch=require(_0x3f8e('0x3'));var rp=require(_0x3f8e('0x4'));var moment=require(_0x3f8e('0x5'));var BPromise=require(_0x3f8e('0x6'));var Mustache=require(_0x3f8e('0x7'));var util=require(_0x3f8e('0x8'));var path=require(_0x3f8e('0x9'));var sox=require(_0x3f8e('0xa'));var csv=require(_0x3f8e('0xb'));var ejs=require(_0x3f8e('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f8e('0xd'));var squel=require(_0x3f8e('0xe'));var crypto=require(_0x3f8e('0xf'));var jsforce=require(_0x3f8e('0x10'));var deskjs=require(_0x3f8e('0x11'));var toCsv=require('to-csv');var querystring=require(_0x3f8e('0x12'));var Papa=require(_0x3f8e('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3f8e('0x14'));var as=require(_0x3f8e('0x15'));var hardwareService=require(_0x3f8e('0x16'));var logger=require(_0x3f8e('0x17'))(_0x3f8e('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3f8e('0x19'));var db=require(_0x3f8e('0x1a'))['db'];function respondWithStatusCode(_0x4f82ad,_0x3dc36b){_0x3dc36b=_0x3dc36b||0xcc;return function(_0x3fce6c){if(_0x3fce6c){return _0x4f82ad[_0x3f8e('0x1b')](_0x3dc36b);}return _0x4f82ad[_0x3f8e('0x1c')](_0x3dc36b)[_0x3f8e('0x1d')]();};}function respondWithResult(_0x1d4e7b,_0x1f6281){_0x1f6281=_0x1f6281||0xc8;return function(_0x4ee63b){if(_0x4ee63b){return _0x1d4e7b[_0x3f8e('0x1c')](_0x1f6281)[_0x3f8e('0x1e')](_0x4ee63b);}};}function respondWithFilteredResult(_0x4a81f6,_0x24701d){return function(_0x330125){if(_0x330125){var _0x455315=typeof _0x24701d['offset']===_0x3f8e('0x1f')&&typeof _0x24701d[_0x3f8e('0x20')]===_0x3f8e('0x1f');var _0x2990df=_0x330125['count'];var _0x1a1ec0=_0x455315?0x0:_0x24701d[_0x3f8e('0x21')];var _0x4a50c9=_0x455315?_0x330125[_0x3f8e('0x22')]:_0x24701d['offset']+_0x24701d[_0x3f8e('0x20')];var _0x37f443;if(_0x4a50c9>=_0x2990df){_0x4a50c9=_0x2990df;_0x37f443=0xc8;}else{_0x37f443=0xce;}_0x4a81f6[_0x3f8e('0x1c')](_0x37f443);return _0x4a81f6[_0x3f8e('0x23')](_0x3f8e('0x24'),_0x1a1ec0+'-'+_0x4a50c9+'/'+_0x2990df)['json'](_0x330125);}return null;};}function patchUpdates(_0x3197f1){return function(_0x5606b9){try{jsonpatch[_0x3f8e('0x25')](_0x5606b9,_0x3197f1,!![]);}catch(_0x5ca0ee){return BPromise[_0x3f8e('0x26')](_0x5ca0ee);}return _0x5606b9['save']();};}function saveUpdates(_0x5a224a,_0x30c167){return function(_0x591e92){if(_0x591e92){return _0x591e92[_0x3f8e('0x27')](_0x5a224a)[_0x3f8e('0x28')](function(_0x40eb68){return _0x40eb68;});}return null;};}function removeEntity(_0x5aee07,_0x101847){return function(_0x4a6f58){if(_0x4a6f58){return _0x4a6f58['destroy']()[_0x3f8e('0x28')](function(){_0x5aee07[_0x3f8e('0x1c')](0xcc)[_0x3f8e('0x1d')]();});}};}function handleEntityNotFound(_0x4dae33,_0x1965e1){return function(_0xb09245){if(!_0xb09245){_0x4dae33[_0x3f8e('0x1b')](0x194);}return _0xb09245;};}function handleError(_0x431795,_0x278c09){_0x278c09=_0x278c09||0x1f4;return function(_0x4bf86f){logger[_0x3f8e('0x29')](_0x4bf86f[_0x3f8e('0x2a')]);if(_0x4bf86f['name']){delete _0x4bf86f[_0x3f8e('0x2b')];}_0x431795['status'](_0x278c09)[_0x3f8e('0x2c')](_0x4bf86f);};}exports[_0x3f8e('0x2d')]=function(_0x25ced4,_0x1e5114){var _0x299129={},_0x23a470={},_0x144413={'count':0x0,'rows':[]};var _0x4b6188=_[_0x3f8e('0x2e')](db[_0x3f8e('0x2f')]['rawAttributes'],function(_0x290152){return{'name':_0x290152[_0x3f8e('0x30')],'type':_0x290152[_0x3f8e('0x31')][_0x3f8e('0x32')]};});_0x23a470['model']=_['map'](_0x4b6188,_0x3f8e('0x2b'));_0x23a470['query']=_['keys'](_0x25ced4[_0x3f8e('0x33')]);_0x23a470[_0x3f8e('0x34')]=_[_0x3f8e('0x35')](_0x23a470[_0x3f8e('0x36')],_0x23a470[_0x3f8e('0x33')]);_0x299129['attributes']=_[_0x3f8e('0x35')](_0x23a470[_0x3f8e('0x36')],qs['fields'](_0x25ced4[_0x3f8e('0x33')][_0x3f8e('0x37')]));_0x299129[_0x3f8e('0x38')]=_0x299129[_0x3f8e('0x38')][_0x3f8e('0x39')]?_0x299129[_0x3f8e('0x38')]:_0x23a470[_0x3f8e('0x36')];if(!_0x25ced4[_0x3f8e('0x33')]['hasOwnProperty']('nolimit')){_0x299129[_0x3f8e('0x20')]=qs[_0x3f8e('0x20')](_0x25ced4[_0x3f8e('0x33')]['limit']);_0x299129[_0x3f8e('0x21')]=qs[_0x3f8e('0x21')](_0x25ced4['query'][_0x3f8e('0x21')]);}_0x299129[_0x3f8e('0x3a')]=qs[_0x3f8e('0x3b')](_0x25ced4[_0x3f8e('0x33')][_0x3f8e('0x3b')]);_0x299129[_0x3f8e('0x3c')]=qs[_0x3f8e('0x34')](_['pick'](_0x25ced4[_0x3f8e('0x33')],_0x23a470[_0x3f8e('0x34')]),_0x4b6188);if(_0x25ced4['query'][_0x3f8e('0x3d')]){_0x299129[_0x3f8e('0x3c')]=_[_0x3f8e('0x3e')](_0x299129[_0x3f8e('0x3c')],{'$or':_[_0x3f8e('0x2e')](_0x4b6188,function(_0x2afedd){if(_0x2afedd[_0x3f8e('0x31')]!==_0x3f8e('0x3f')){var _0x132f56={};_0x132f56[_0x2afedd[_0x3f8e('0x2b')]]={'$like':'%'+_0x25ced4[_0x3f8e('0x33')][_0x3f8e('0x3d')]+'%'};return _0x132f56;}})});}_0x299129=_[_0x3f8e('0x3e')]({},_0x299129,_0x25ced4['options']);var _0x47d121={'where':_0x299129['where']};return db[_0x3f8e('0x2f')][_0x3f8e('0x22')](_0x47d121)[_0x3f8e('0x28')](function(_0x13d9ae){_0x144413[_0x3f8e('0x22')]=_0x13d9ae;if(_0x25ced4[_0x3f8e('0x33')][_0x3f8e('0x40')]){_0x299129[_0x3f8e('0x41')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x299129);})[_0x3f8e('0x28')](function(_0x539a85){_0x144413[_0x3f8e('0x42')]=_0x539a85;return _0x144413;})[_0x3f8e('0x28')](respondWithFilteredResult(_0x1e5114,_0x299129))[_0x3f8e('0x43')](handleError(_0x1e5114,null));};exports[_0x3f8e('0x44')]=function(_0xbfbc8d,_0x582366){var _0x29d1d2={'raw':!![],'where':{'id':_0xbfbc8d[_0x3f8e('0x45')]['id']}},_0x43f7f7={};_0x43f7f7[_0x3f8e('0x36')]=_[_0x3f8e('0x46')](db[_0x3f8e('0x2f')]['rawAttributes']);_0x43f7f7['query']=_[_0x3f8e('0x46')](_0xbfbc8d[_0x3f8e('0x33')]);_0x43f7f7['filters']=_[_0x3f8e('0x35')](_0x43f7f7['model'],_0x43f7f7[_0x3f8e('0x33')]);_0x29d1d2[_0x3f8e('0x38')]=_['intersection'](_0x43f7f7['model'],qs[_0x3f8e('0x37')](_0xbfbc8d[_0x3f8e('0x33')][_0x3f8e('0x37')]));_0x29d1d2[_0x3f8e('0x38')]=_0x29d1d2[_0x3f8e('0x38')][_0x3f8e('0x39')]?_0x29d1d2[_0x3f8e('0x38')]:_0x43f7f7['model'];if(_0xbfbc8d[_0x3f8e('0x33')][_0x3f8e('0x40')]){_0x29d1d2['include']=[{'all':!![]}];}_0x29d1d2=_[_0x3f8e('0x3e')]({},_0x29d1d2,_0xbfbc8d['options']);return db[_0x3f8e('0x2f')][_0x3f8e('0x47')](_0x29d1d2)['then'](handleEntityNotFound(_0x582366,null))[_0x3f8e('0x28')](respondWithResult(_0x582366,null))[_0x3f8e('0x43')](handleError(_0x582366,null));};exports[_0x3f8e('0x48')]=function(_0x36e6ec,_0x3c279d){return db[_0x3f8e('0x2f')]['create'](_0x36e6ec[_0x3f8e('0x49')],{})[_0x3f8e('0x28')](respondWithResult(_0x3c279d,0xc9))[_0x3f8e('0x43')](handleError(_0x3c279d,null));};exports[_0x3f8e('0x27')]=function(_0x3761a9,_0x19df6){if(_0x3761a9[_0x3f8e('0x49')]['id']){delete _0x3761a9[_0x3f8e('0x49')]['id'];}return db[_0x3f8e('0x2f')][_0x3f8e('0x47')]({'where':{'id':_0x3761a9[_0x3f8e('0x45')]['id']}})['then'](handleEntityNotFound(_0x19df6,null))[_0x3f8e('0x28')](saveUpdates(_0x3761a9[_0x3f8e('0x49')],null))[_0x3f8e('0x28')](respondWithResult(_0x19df6,null))[_0x3f8e('0x43')](handleError(_0x19df6,null));};exports[_0x3f8e('0x4a')]=function(_0x25ec18,_0x5d591f){return db[_0x3f8e('0x2f')]['find']({'where':{'id':_0x25ec18[_0x3f8e('0x45')]['id']}})[_0x3f8e('0x28')](handleEntityNotFound(_0x5d591f,null))[_0x3f8e('0x28')](removeEntity(_0x5d591f,null))['catch'](handleError(_0x5d591f,null));};exports['describe']=function(_0x20b2f5,_0x11fc8c){return db['SmsQueueReport']['describe']()[_0x3f8e('0x28')](respondWithResult(_0x11fc8c,null))['catch'](handleError(_0x11fc8c,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index d77d966..08a6ecf 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x266c40,_0x284502){var _0x35aa8a=function(_0x30a828){while(--_0x30a828){_0x266c40['push'](_0x266c40['shift']());}};_0x35aa8a(++_0x284502);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0xcb91[_0x29a29f];return _0x443ea3;};'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 +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x2165af,_0xfa73d9){var _0x439f65=function(_0x4bcccd){while(--_0x4bcccd){_0x2165af['push'](_0x2165af['shift']());}};_0x439f65(++_0xfa73d9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'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 diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 7ded487..b9d487b 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 _0x50ac=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','CreateSmsQueueReport','SmsQueueReport','create','body','options','stringify','catch','UpdateSmsQueueReport','raw','where','attributes','limit'];(function(_0x4d568c,_0x3ba6bb){var _0xe904b6=function(_0x2e9f15){while(--_0x2e9f15){_0x4d568c['push'](_0x4d568c['shift']());}};_0xe904b6(++_0x3ba6bb);}(_0x50ac,0x154));var _0xc50a=function(_0x2966b3,_0x164072){_0x2966b3=_0x2966b3-0x0;var _0xe534d6=_0x50ac[_0x2966b3];return _0xe534d6;};'use strict';var _=require(_0xc50a('0x0'));var util=require(_0xc50a('0x1'));var moment=require(_0xc50a('0x2'));var BPromise=require(_0xc50a('0x3'));var rs=require(_0xc50a('0x4'));var fs=require('fs');var Redis=require(_0xc50a('0x5'));var db=require(_0xc50a('0x6'))['db'];var utils=require(_0xc50a('0x7'));var logger=require(_0xc50a('0x8'))(_0xc50a('0x9'));var config=require('../../config/environment');var jayson=require(_0xc50a('0xa'));var client=jayson['client'][_0xc50a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219997,_0x3cd8b0,_0x4d6c6b){return new BPromise(function(_0x3c5072,_0x1a978b){return client[_0xc50a('0xc')](_0x219997,_0x4d6c6b)[_0xc50a('0xd')](function(_0x36ddc0){logger['info'](_0xc50a('0xe'),_0x3cd8b0,_0xc50a('0xf'));logger[_0xc50a('0x10')](_0xc50a('0x11'),_0x3cd8b0,_0xc50a('0xf'),JSON['stringify'](_0x36ddc0));if(_0x36ddc0['error']){if(_0x36ddc0[_0xc50a('0x12')][_0xc50a('0x13')]===0x1f4){logger[_0xc50a('0x12')](_0xc50a('0xe'),_0x3cd8b0,_0x36ddc0[_0xc50a('0x12')][_0xc50a('0x14')]);return _0x1a978b(_0x36ddc0[_0xc50a('0x12')][_0xc50a('0x14')]);}logger['error'](_0xc50a('0xe'),_0x3cd8b0,_0x36ddc0[_0xc50a('0x12')]['message']);return _0x3c5072(_0x36ddc0['error'][_0xc50a('0x14')]);}else{logger[_0xc50a('0x15')](_0xc50a('0xe'),_0x3cd8b0,_0xc50a('0xf'));_0x3c5072(_0x36ddc0['result']['message']);}})['catch'](function(_0x58e1d2){logger[_0xc50a('0x12')](_0xc50a('0xe'),_0x3cd8b0,_0x58e1d2);_0x1a978b(_0x58e1d2);});});}exports[_0xc50a('0x16')]=function(_0x42661c){var _0x46146c=this;return new Promise(function(_0x3d5cca,_0x3ac66f){return db[_0xc50a('0x17')][_0xc50a('0x18')](_0x42661c[_0xc50a('0x19')],{'raw':_0x42661c[_0xc50a('0x1a')]?_0x42661c['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5285d5){logger[_0xc50a('0x15')]('CreateSmsQueueReport',_0x42661c);logger[_0xc50a('0x10')]('CreateSmsQueueReport',_0x42661c,JSON[_0xc50a('0x1b')](_0x5285d5));_0x3d5cca(_0x5285d5);})[_0xc50a('0x1c')](function(_0x5c8054){logger[_0xc50a('0x12')](_0xc50a('0x16'),_0x5c8054[_0xc50a('0x14')],_0x42661c);_0x3ac66f(_0x46146c[_0xc50a('0x12')](0x1f4,_0x5c8054[_0xc50a('0x14')]));});});};exports[_0xc50a('0x1d')]=function(_0x1c884c){var _0x5e1405=this;return new Promise(function(_0xb65908,_0xf8f6d4){return db[_0xc50a('0x17')]['update'](_0x1c884c[_0xc50a('0x19')],{'raw':_0x1c884c[_0xc50a('0x1a')]?_0x1c884c[_0xc50a('0x1a')][_0xc50a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c884c['options']?_0x1c884c['options'][_0xc50a('0x1f')]||null:null,'attributes':_0x1c884c[_0xc50a('0x1a')]?_0x1c884c[_0xc50a('0x1a')][_0xc50a('0x20')]||null:null,'limit':_0x1c884c['options']?_0x1c884c[_0xc50a('0x1a')][_0xc50a('0x21')]||null:null})[_0xc50a('0xd')](function(_0x2f3b75){logger['info'](_0xc50a('0x1d'),_0x1c884c);logger[_0xc50a('0x10')]('UpdateSmsQueueReport',_0x1c884c,JSON['stringify'](_0x2f3b75));_0xb65908(_0x2f3b75);})[_0xc50a('0x1c')](function(_0x2aafe8){logger[_0xc50a('0x12')]('UpdateSmsQueueReport',_0x2aafe8[_0xc50a('0x14')],_0x1c884c);_0xf8f6d4(_0x5e1405[_0xc50a('0x12')](0x1f4,_0x2aafe8[_0xc50a('0x14')]));});});}; \ No newline at end of file +var _0x32be=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','raw','UpdateSmsQueueReport','options','attributes','lodash','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x32be,0xd7));var _0xe32b=function(_0x2410e9,_0x6028ce){_0x2410e9=_0x2410e9-0x0;var _0x560eba=_0x32be[_0x2410e9];return _0x560eba;};'use strict';var _=require(_0xe32b('0x0'));var util=require('util');var moment=require(_0xe32b('0x1'));var BPromise=require(_0xe32b('0x2'));var rs=require(_0xe32b('0x3'));var fs=require('fs');var Redis=require(_0xe32b('0x4'));var db=require(_0xe32b('0x5'))['db'];var utils=require(_0xe32b('0x6'));var logger=require('../../config/logger')(_0xe32b('0x7'));var config=require('../../config/environment');var jayson=require(_0xe32b('0x8'));var client=jayson[_0xe32b('0x9')][_0xe32b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39ee2b,_0x3ec6ec,_0x51928b){return new BPromise(function(_0x37565a,_0x526830){return client['request'](_0x39ee2b,_0x51928b)[_0xe32b('0xb')](function(_0x5c9633){logger['info'](_0xe32b('0xc'),_0x3ec6ec,_0xe32b('0xd'));logger[_0xe32b('0xe')](_0xe32b('0xf'),_0x3ec6ec,_0xe32b('0xd'),JSON[_0xe32b('0x10')](_0x5c9633));if(_0x5c9633[_0xe32b('0x11')]){if(_0x5c9633[_0xe32b('0x11')][_0xe32b('0x12')]===0x1f4){logger[_0xe32b('0x11')](_0xe32b('0xc'),_0x3ec6ec,_0x5c9633[_0xe32b('0x11')][_0xe32b('0x13')]);return _0x526830(_0x5c9633['error'][_0xe32b('0x13')]);}logger[_0xe32b('0x11')](_0xe32b('0xc'),_0x3ec6ec,_0x5c9633[_0xe32b('0x11')][_0xe32b('0x13')]);return _0x37565a(_0x5c9633[_0xe32b('0x11')][_0xe32b('0x13')]);}else{logger[_0xe32b('0x14')](_0xe32b('0xc'),_0x3ec6ec,_0xe32b('0xd'));_0x37565a(_0x5c9633[_0xe32b('0x15')]['message']);}})[_0xe32b('0x16')](function(_0x3404ee){logger[_0xe32b('0x11')](_0xe32b('0xc'),_0x3ec6ec,_0x3404ee);_0x526830(_0x3404ee);});});}exports[_0xe32b('0x17')]=function(_0x115fd8){var _0x514b43=this;return new Promise(function(_0x6f8cdb,_0x36daa3){return db[_0xe32b('0x18')][_0xe32b('0x19')](_0x115fd8[_0xe32b('0x1a')],{'raw':_0x115fd8['options']?_0x115fd8['options'][_0xe32b('0x1b')]===undefined?!![]:![]:!![]})[_0xe32b('0xb')](function(_0x2329a9){logger['info'](_0xe32b('0x17'),_0x115fd8);logger['debug'](_0xe32b('0x17'),_0x115fd8,JSON[_0xe32b('0x10')](_0x2329a9));_0x6f8cdb(_0x2329a9);})['catch'](function(_0x562cb0){logger[_0xe32b('0x11')](_0xe32b('0x17'),_0x562cb0[_0xe32b('0x13')],_0x115fd8);_0x36daa3(_0x514b43[_0xe32b('0x11')](0x1f4,_0x562cb0['message']));});});};exports[_0xe32b('0x1c')]=function(_0x4c8a6a){var _0x8520f3=this;return new Promise(function(_0x43d773,_0x34d78e){return db[_0xe32b('0x18')]['update'](_0x4c8a6a[_0xe32b('0x1a')],{'raw':_0x4c8a6a[_0xe32b('0x1d')]?_0x4c8a6a['options'][_0xe32b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c8a6a['options']?_0x4c8a6a[_0xe32b('0x1d')]['where']||null:null,'attributes':_0x4c8a6a[_0xe32b('0x1d')]?_0x4c8a6a['options'][_0xe32b('0x1e')]||null:null,'limit':_0x4c8a6a[_0xe32b('0x1d')]?_0x4c8a6a[_0xe32b('0x1d')]['limit']||null:null})['then'](function(_0x5e0500){logger[_0xe32b('0x14')](_0xe32b('0x1c'),_0x4c8a6a);logger[_0xe32b('0xe')]('UpdateSmsQueueReport',_0x4c8a6a,JSON[_0xe32b('0x10')](_0x5e0500));_0x43d773(_0x5e0500);})[_0xe32b('0x16')](function(_0x5c00ec){logger[_0xe32b('0x11')]('UpdateSmsQueueReport',_0x5c00ec[_0xe32b('0x13')],_0x4c8a6a);_0x34d78e(_0x8520f3[_0xe32b('0x11')](0x1f4,_0x5c00ec[_0xe32b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 45345f3..26c1c74 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 _0x5fd1=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x5926d1,_0x2a606b){var _0x487a5c=function(_0x11d5cb){while(--_0x11d5cb){_0x5926d1['push'](_0x5926d1['shift']());}};_0x487a5c(++_0x2a606b);}(_0x5fd1,0x155));var _0x15fd=function(_0x260f88,_0x5208e7){_0x260f88=_0x260f88-0x0;var _0x2a4cd9=_0x5fd1[_0x260f88];return _0x2a4cd9;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./smsTransferReport.controller');router[_0x15fd('0x7')]('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0x9')]);router[_0x15fd('0x7')](_0x15fd('0xa'),auth['isAuthenticated'](),controller[_0x15fd('0xb')]);router[_0x15fd('0x7')](_0x15fd('0xc'),auth['isAuthenticated'](),controller[_0x15fd('0xd')]);router['post']('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x15fd('0xf')]);router[_0x15fd('0x10')](_0x15fd('0xc'),auth[_0x15fd('0x8')](),controller[_0x15fd('0x11')]);module[_0x15fd('0x12')]=router; \ No newline at end of file +var _0x85d0=['../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service'];(function(_0x2db69f,_0x410e40){var _0x5c0e64=function(_0x445208){while(--_0x445208){_0x2db69f['push'](_0x2db69f['shift']());}};_0x5c0e64(++_0x410e40);}(_0x85d0,0x164));var _0x085d=function(_0x37085b,_0xce159e){_0x37085b=_0x37085b-0x0;var _0x1398f4=_0x85d0[_0x37085b];return _0x1398f4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x085d('0x0'));var router=express[_0x085d('0x1')]();var fs_extra=require(_0x085d('0x2'));var auth=require(_0x085d('0x3'));var interaction=require(_0x085d('0x4'));var config=require(_0x085d('0x5'));var controller=require('./smsTransferReport.controller');router[_0x085d('0x6')]('/',auth['isAuthenticated'](),controller[_0x085d('0x7')]);router[_0x085d('0x6')](_0x085d('0x8'),auth['isAuthenticated'](),controller[_0x085d('0x9')]);router[_0x085d('0x6')](_0x085d('0xa'),auth[_0x085d('0xb')](),controller[_0x085d('0xc')]);router[_0x085d('0xd')]('/',auth[_0x085d('0xb')](),controller[_0x085d('0xe')]);router[_0x085d('0xf')]('/:id',auth[_0x085d('0xb')](),controller[_0x085d('0x10')]);router[_0x085d('0x11')](_0x085d('0xa'),auth['isAuthenticated'](),controller[_0x085d('0x12')]);module[_0x085d('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a691d97..8b8d9be 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x352662,_0x2b98e2){var _0x31d1ad=function(_0x2ac764){while(--_0x2ac764){_0x352662['push'](_0x352662['shift']());}};_0x31d1ad(++_0x2b98e2);}(_0x00bb,0x1d8));var _0xb00b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x00bb[_0x411add];return _0x238242;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0xe5c04a,_0x42e424){var _0x9135b9=function(_0x4e2dbd){while(--_0x4e2dbd){_0xe5c04a['push'](_0xe5c04a['shift']());}};_0x9135b9(++_0x42e424);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0xcb91[_0x506172];return _0x2723c0;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 68bbe6c..ef79bdd 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 _0x6926=['save','update','then','error','stack','name','send','SmsTransferReport','fieldName','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject'];(function(_0x57c7b8,_0x4622a6){var _0x429fb2=function(_0xeb30fc){while(--_0xeb30fc){_0x57c7b8['push'](_0x57c7b8['shift']());}};_0x429fb2(++_0x4622a6);}(_0x6926,0xbd));var _0x6692=function(_0x7bac67,_0x51ca67){_0x7bac67=_0x7bac67-0x0;var _0x46d6e2=_0x6926[_0x7bac67];return _0x46d6e2;};'use strict';var emlformat=require(_0x6692('0x0'));var rimraf=require(_0x6692('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6692('0x2'));var rp=require('request-promise');var moment=require(_0x6692('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6692('0x4'));var util=require(_0x6692('0x5'));var path=require(_0x6692('0x6'));var sox=require('sox');var csv=require(_0x6692('0x7'));var ejs=require(_0x6692('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6692('0x9'));var squel=require(_0x6692('0xa'));var crypto=require(_0x6692('0xb'));var jsforce=require(_0x6692('0xc'));var deskjs=require(_0x6692('0xd'));var toCsv=require(_0x6692('0x7'));var querystring=require(_0x6692('0xe'));var Papa=require('papaparse');var Redis=require(_0x6692('0xf'));var authService=require(_0x6692('0x10'));var qs=require(_0x6692('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6692('0x12'));var logger=require(_0x6692('0x13'))(_0x6692('0x14'));var utils=require(_0x6692('0x15'));var config=require(_0x6692('0x16'));var licenseUtil=require(_0x6692('0x17'));var db=require(_0x6692('0x18'))['db'];function respondWithStatusCode(_0x5912ff,_0x22f306){_0x22f306=_0x22f306||0xcc;return function(_0x44fe1e){if(_0x44fe1e){return _0x5912ff[_0x6692('0x19')](_0x22f306);}return _0x5912ff[_0x6692('0x1a')](_0x22f306)[_0x6692('0x1b')]();};}function respondWithResult(_0xcb5017,_0x5254cf){_0x5254cf=_0x5254cf||0xc8;return function(_0x276960){if(_0x276960){return _0xcb5017[_0x6692('0x1a')](_0x5254cf)['json'](_0x276960);}};}function respondWithFilteredResult(_0x4412fe,_0x28678e){return function(_0xe20284){if(_0xe20284){var _0x39d1c1=typeof _0x28678e['offset']===_0x6692('0x1c')&&typeof _0x28678e['limit']===_0x6692('0x1c');var _0x3b9b7c=_0xe20284[_0x6692('0x1d')];var _0x21d8f4=_0x39d1c1?0x0:_0x28678e[_0x6692('0x1e')];var _0x295954=_0x39d1c1?_0xe20284[_0x6692('0x1d')]:_0x28678e['offset']+_0x28678e[_0x6692('0x1f')];var _0x44711d;if(_0x295954>=_0x3b9b7c){_0x295954=_0x3b9b7c;_0x44711d=0xc8;}else{_0x44711d=0xce;}_0x4412fe[_0x6692('0x1a')](_0x44711d);return _0x4412fe['set'](_0x6692('0x20'),_0x21d8f4+'-'+_0x295954+'/'+_0x3b9b7c)[_0x6692('0x21')](_0xe20284);}return null;};}function patchUpdates(_0x268254){return function(_0x34d6d4){try{jsonpatch[_0x6692('0x22')](_0x34d6d4,_0x268254,!![]);}catch(_0x2eedd9){return BPromise[_0x6692('0x23')](_0x2eedd9);}return _0x34d6d4[_0x6692('0x24')]();};}function saveUpdates(_0x24e625,_0x28b155){return function(_0x578d84){if(_0x578d84){return _0x578d84[_0x6692('0x25')](_0x24e625)[_0x6692('0x26')](function(_0x50cd47){return _0x50cd47;});}return null;};}function removeEntity(_0x407662,_0x1717e5){return function(_0x3a28cb){if(_0x3a28cb){return _0x3a28cb['destroy']()['then'](function(){_0x407662[_0x6692('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x118a60,_0x266db8){return function(_0x25c9b2){if(!_0x25c9b2){_0x118a60['sendStatus'](0x194);}return _0x25c9b2;};}function handleError(_0x55705a,_0x230a92){_0x230a92=_0x230a92||0x1f4;return function(_0x5afa56){logger[_0x6692('0x27')](_0x5afa56[_0x6692('0x28')]);if(_0x5afa56[_0x6692('0x29')]){delete _0x5afa56['name'];}_0x55705a[_0x6692('0x1a')](_0x230a92)[_0x6692('0x2a')](_0x5afa56);};}exports['index']=function(_0x34a465,_0x310819){var _0x5f27bc={},_0x1b0c14={},_0x3159dc={'count':0x0,'rows':[]};var _0x30e890=_['map'](db[_0x6692('0x2b')]['rawAttributes'],function(_0xf6e8d3){return{'name':_0xf6e8d3[_0x6692('0x2c')],'type':_0xf6e8d3[_0x6692('0x2d')][_0x6692('0x2e')]};});_0x1b0c14[_0x6692('0x2f')]=_[_0x6692('0x30')](_0x30e890,_0x6692('0x29'));_0x1b0c14['query']=_[_0x6692('0x31')](_0x34a465['query']);_0x1b0c14[_0x6692('0x32')]=_[_0x6692('0x33')](_0x1b0c14[_0x6692('0x2f')],_0x1b0c14[_0x6692('0x34')]);_0x5f27bc['attributes']=_[_0x6692('0x33')](_0x1b0c14[_0x6692('0x2f')],qs[_0x6692('0x35')](_0x34a465[_0x6692('0x34')][_0x6692('0x35')]));_0x5f27bc[_0x6692('0x36')]=_0x5f27bc['attributes'][_0x6692('0x37')]?_0x5f27bc[_0x6692('0x36')]:_0x1b0c14[_0x6692('0x2f')];if(!_0x34a465[_0x6692('0x34')]['hasOwnProperty']('nolimit')){_0x5f27bc['limit']=qs[_0x6692('0x1f')](_0x34a465[_0x6692('0x34')][_0x6692('0x1f')]);_0x5f27bc['offset']=qs['offset'](_0x34a465[_0x6692('0x34')][_0x6692('0x1e')]);}_0x5f27bc[_0x6692('0x38')]=qs['sort'](_0x34a465['query'][_0x6692('0x39')]);_0x5f27bc[_0x6692('0x3a')]=qs[_0x6692('0x32')](_[_0x6692('0x3b')](_0x34a465['query'],_0x1b0c14[_0x6692('0x32')]),_0x30e890);if(_0x34a465[_0x6692('0x34')][_0x6692('0x3c')]){_0x5f27bc['where']=_[_0x6692('0x3d')](_0x5f27bc['where'],{'$or':_[_0x6692('0x30')](_0x30e890,function(_0x3bd08c){if(_0x3bd08c['type']!==_0x6692('0x3e')){var _0xc4eb70={};_0xc4eb70[_0x3bd08c[_0x6692('0x29')]]={'$like':'%'+_0x34a465[_0x6692('0x34')][_0x6692('0x3c')]+'%'};return _0xc4eb70;}})});}_0x5f27bc=_['merge']({},_0x5f27bc,_0x34a465[_0x6692('0x3f')]);var _0x205ce9={'where':_0x5f27bc[_0x6692('0x3a')]};return db['SmsTransferReport'][_0x6692('0x1d')](_0x205ce9)[_0x6692('0x26')](function(_0xf98f36){_0x3159dc[_0x6692('0x1d')]=_0xf98f36;if(_0x34a465[_0x6692('0x34')][_0x6692('0x40')]){_0x5f27bc[_0x6692('0x41')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x5f27bc);})[_0x6692('0x26')](function(_0x2f7da2){_0x3159dc[_0x6692('0x42')]=_0x2f7da2;return _0x3159dc;})[_0x6692('0x26')](respondWithFilteredResult(_0x310819,_0x5f27bc))[_0x6692('0x43')](handleError(_0x310819,null));};exports[_0x6692('0x44')]=function(_0x353d8f,_0x4284c7){var _0xfcaf57={'raw':!![],'where':{'id':_0x353d8f[_0x6692('0x45')]['id']}},_0xcb9862={};_0xcb9862[_0x6692('0x2f')]=_[_0x6692('0x31')](db['SmsTransferReport'][_0x6692('0x46')]);_0xcb9862['query']=_[_0x6692('0x31')](_0x353d8f['query']);_0xcb9862[_0x6692('0x32')]=_['intersection'](_0xcb9862[_0x6692('0x2f')],_0xcb9862[_0x6692('0x34')]);_0xfcaf57[_0x6692('0x36')]=_['intersection'](_0xcb9862[_0x6692('0x2f')],qs['fields'](_0x353d8f[_0x6692('0x34')][_0x6692('0x35')]));_0xfcaf57['attributes']=_0xfcaf57[_0x6692('0x36')][_0x6692('0x37')]?_0xfcaf57[_0x6692('0x36')]:_0xcb9862[_0x6692('0x2f')];if(_0x353d8f[_0x6692('0x34')][_0x6692('0x40')]){_0xfcaf57[_0x6692('0x41')]=[{'all':!![]}];}_0xfcaf57=_[_0x6692('0x3d')]({},_0xfcaf57,_0x353d8f['options']);return db['SmsTransferReport']['find'](_0xfcaf57)['then'](handleEntityNotFound(_0x4284c7,null))['then'](respondWithResult(_0x4284c7,null))[_0x6692('0x43')](handleError(_0x4284c7,null));};exports[_0x6692('0x47')]=function(_0x371662,_0x3f4256){return db[_0x6692('0x2b')][_0x6692('0x47')](_0x371662[_0x6692('0x48')],{})['then'](respondWithResult(_0x3f4256,0xc9))['catch'](handleError(_0x3f4256,null));};exports[_0x6692('0x25')]=function(_0x11127a,_0x57ee75){if(_0x11127a[_0x6692('0x48')]['id']){delete _0x11127a[_0x6692('0x48')]['id'];}return db[_0x6692('0x2b')][_0x6692('0x49')]({'where':{'id':_0x11127a['params']['id']}})['then'](handleEntityNotFound(_0x57ee75,null))[_0x6692('0x26')](saveUpdates(_0x11127a[_0x6692('0x48')],null))[_0x6692('0x26')](respondWithResult(_0x57ee75,null))[_0x6692('0x43')](handleError(_0x57ee75,null));};exports['destroy']=function(_0x208684,_0x2b2368){return db['SmsTransferReport'][_0x6692('0x49')]({'where':{'id':_0x208684[_0x6692('0x45')]['id']}})[_0x6692('0x26')](handleEntityNotFound(_0x2b2368,null))['then'](removeEntity(_0x2b2368,null))[_0x6692('0x43')](handleError(_0x2b2368,null));};exports[_0x6692('0x4a')]=function(_0xe44bc6,_0x304c26){return db[_0x6692('0x2b')]['describe']()['then'](respondWithResult(_0x304c26,null))[_0x6692('0x43')](handleError(_0x304c26,null));}; \ No newline at end of file +var _0x68c3=['where','pick','filter','merge','type','VIRTUAL','includeAll','include','catch','show','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','error','name','send','map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort'];(function(_0xcc1ffc,_0x28a312){var _0x3d614b=function(_0x3f9e83){while(--_0x3f9e83){_0xcc1ffc['push'](_0xcc1ffc['shift']());}};_0x3d614b(++_0x28a312);}(_0x68c3,0xd9));var _0x368c=function(_0x40c601,_0x25997e){_0x40c601=_0x40c601-0x0;var _0x214a0=_0x68c3[_0x40c601];return _0x214a0;};'use strict';var emlformat=require(_0x368c('0x0'));var rimraf=require(_0x368c('0x1'));var zipdir=require(_0x368c('0x2'));var jsonpatch=require(_0x368c('0x3'));var rp=require(_0x368c('0x4'));var moment=require(_0x368c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x368c('0x6'));var path=require('path');var sox=require(_0x368c('0x7'));var csv=require(_0x368c('0x8'));var ejs=require(_0x368c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x368c('0xa'));var squel=require(_0x368c('0xb'));var crypto=require(_0x368c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x368c('0x8'));var querystring=require(_0x368c('0xd'));var Papa=require(_0x368c('0xe'));var Redis=require(_0x368c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x368c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x368c('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x368c('0x12'));var db=require(_0x368c('0x13'))['db'];function respondWithStatusCode(_0x3f08b2,_0x5d64d6){_0x5d64d6=_0x5d64d6||0xcc;return function(_0x2ec7de){if(_0x2ec7de){return _0x3f08b2[_0x368c('0x14')](_0x5d64d6);}return _0x3f08b2[_0x368c('0x15')](_0x5d64d6)[_0x368c('0x16')]();};}function respondWithResult(_0xd09931,_0x389d10){_0x389d10=_0x389d10||0xc8;return function(_0x362a1){if(_0x362a1){return _0xd09931['status'](_0x389d10)[_0x368c('0x17')](_0x362a1);}};}function respondWithFilteredResult(_0x13c9b2,_0x369ecd){return function(_0x5bd831){if(_0x5bd831){var _0x355597=typeof _0x369ecd[_0x368c('0x18')]==='undefined'&&typeof _0x369ecd['limit']===_0x368c('0x19');var _0xeb671c=_0x5bd831[_0x368c('0x1a')];var _0x203ed1=_0x355597?0x0:_0x369ecd[_0x368c('0x18')];var _0x44e201=_0x355597?_0x5bd831[_0x368c('0x1a')]:_0x369ecd['offset']+_0x369ecd[_0x368c('0x1b')];var _0x3619c1;if(_0x44e201>=_0xeb671c){_0x44e201=_0xeb671c;_0x3619c1=0xc8;}else{_0x3619c1=0xce;}_0x13c9b2[_0x368c('0x15')](_0x3619c1);return _0x13c9b2[_0x368c('0x1c')]('Content-Range',_0x203ed1+'-'+_0x44e201+'/'+_0xeb671c)[_0x368c('0x17')](_0x5bd831);}return null;};}function patchUpdates(_0x4dff33){return function(_0x178ce8){try{jsonpatch[_0x368c('0x1d')](_0x178ce8,_0x4dff33,!![]);}catch(_0x4799c9){return BPromise[_0x368c('0x1e')](_0x4799c9);}return _0x178ce8['save']();};}function saveUpdates(_0x5df510,_0x608817){return function(_0x49e83a){if(_0x49e83a){return _0x49e83a[_0x368c('0x1f')](_0x5df510)[_0x368c('0x20')](function(_0x5d4f9c){return _0x5d4f9c;});}return null;};}function removeEntity(_0xb96950,_0x3e3da5){return function(_0x1e3ffe){if(_0x1e3ffe){return _0x1e3ffe['destroy']()[_0x368c('0x20')](function(){_0xb96950['status'](0xcc)[_0x368c('0x16')]();});}};}function handleEntityNotFound(_0x24a611,_0x160072){return function(_0x17b74f){if(!_0x17b74f){_0x24a611[_0x368c('0x14')](0x194);}return _0x17b74f;};}function handleError(_0x2eb6b4,_0x53501b){_0x53501b=_0x53501b||0x1f4;return function(_0xd58e73){logger[_0x368c('0x21')](_0xd58e73['stack']);if(_0xd58e73[_0x368c('0x22')]){delete _0xd58e73[_0x368c('0x22')];}_0x2eb6b4[_0x368c('0x15')](_0x53501b)[_0x368c('0x23')](_0xd58e73);};}exports['index']=function(_0x7801e2,_0x55e702){var _0x2e5ef9={},_0x37d141={},_0x36491f={'count':0x0,'rows':[]};var _0x53823b=_[_0x368c('0x24')](db[_0x368c('0x25')][_0x368c('0x26')],function(_0x310ed6){return{'name':_0x310ed6[_0x368c('0x27')],'type':_0x310ed6['type'][_0x368c('0x28')]};});_0x37d141[_0x368c('0x29')]=_['map'](_0x53823b,_0x368c('0x22'));_0x37d141[_0x368c('0x2a')]=_[_0x368c('0x2b')](_0x7801e2[_0x368c('0x2a')]);_0x37d141[_0x368c('0x2c')]=_['intersection'](_0x37d141['model'],_0x37d141[_0x368c('0x2a')]);_0x2e5ef9[_0x368c('0x2d')]=_[_0x368c('0x2e')](_0x37d141[_0x368c('0x29')],qs[_0x368c('0x2f')](_0x7801e2[_0x368c('0x2a')]['fields']));_0x2e5ef9[_0x368c('0x2d')]=_0x2e5ef9[_0x368c('0x2d')]['length']?_0x2e5ef9[_0x368c('0x2d')]:_0x37d141[_0x368c('0x29')];if(!_0x7801e2[_0x368c('0x2a')][_0x368c('0x30')]('nolimit')){_0x2e5ef9[_0x368c('0x1b')]=qs['limit'](_0x7801e2['query'][_0x368c('0x1b')]);_0x2e5ef9[_0x368c('0x18')]=qs[_0x368c('0x18')](_0x7801e2[_0x368c('0x2a')]['offset']);}_0x2e5ef9[_0x368c('0x31')]=qs[_0x368c('0x32')](_0x7801e2[_0x368c('0x2a')]['sort']);_0x2e5ef9[_0x368c('0x33')]=qs[_0x368c('0x2c')](_[_0x368c('0x34')](_0x7801e2['query'],_0x37d141[_0x368c('0x2c')]),_0x53823b);if(_0x7801e2['query'][_0x368c('0x35')]){_0x2e5ef9[_0x368c('0x33')]=_[_0x368c('0x36')](_0x2e5ef9[_0x368c('0x33')],{'$or':_[_0x368c('0x24')](_0x53823b,function(_0x19e4d1){if(_0x19e4d1[_0x368c('0x37')]!==_0x368c('0x38')){var _0x1002b0={};_0x1002b0[_0x19e4d1[_0x368c('0x22')]]={'$like':'%'+_0x7801e2[_0x368c('0x2a')][_0x368c('0x35')]+'%'};return _0x1002b0;}})});}_0x2e5ef9=_['merge']({},_0x2e5ef9,_0x7801e2['options']);var _0x5e3776={'where':_0x2e5ef9['where']};return db[_0x368c('0x25')][_0x368c('0x1a')](_0x5e3776)[_0x368c('0x20')](function(_0x3507fa){_0x36491f['count']=_0x3507fa;if(_0x7801e2[_0x368c('0x2a')][_0x368c('0x39')]){_0x2e5ef9[_0x368c('0x3a')]=[{'all':!![]}];}return db[_0x368c('0x25')]['findAll'](_0x2e5ef9);})[_0x368c('0x20')](function(_0x50a789){_0x36491f['rows']=_0x50a789;return _0x36491f;})[_0x368c('0x20')](respondWithFilteredResult(_0x55e702,_0x2e5ef9))[_0x368c('0x3b')](handleError(_0x55e702,null));};exports[_0x368c('0x3c')]=function(_0x1d1210,_0x3df4a4){var _0x5b368e={'raw':!![],'where':{'id':_0x1d1210['params']['id']}},_0x24bfbd={};_0x24bfbd[_0x368c('0x29')]=_[_0x368c('0x2b')](db['SmsTransferReport'][_0x368c('0x26')]);_0x24bfbd['query']=_[_0x368c('0x2b')](_0x1d1210[_0x368c('0x2a')]);_0x24bfbd['filters']=_[_0x368c('0x2e')](_0x24bfbd[_0x368c('0x29')],_0x24bfbd[_0x368c('0x2a')]);_0x5b368e['attributes']=_[_0x368c('0x2e')](_0x24bfbd[_0x368c('0x29')],qs[_0x368c('0x2f')](_0x1d1210['query'][_0x368c('0x2f')]));_0x5b368e[_0x368c('0x2d')]=_0x5b368e['attributes']['length']?_0x5b368e[_0x368c('0x2d')]:_0x24bfbd[_0x368c('0x29')];if(_0x1d1210['query']['includeAll']){_0x5b368e['include']=[{'all':!![]}];}_0x5b368e=_[_0x368c('0x36')]({},_0x5b368e,_0x1d1210[_0x368c('0x3d')]);return db['SmsTransferReport']['find'](_0x5b368e)[_0x368c('0x20')](handleEntityNotFound(_0x3df4a4,null))[_0x368c('0x20')](respondWithResult(_0x3df4a4,null))[_0x368c('0x3b')](handleError(_0x3df4a4,null));};exports[_0x368c('0x3e')]=function(_0x2775e7,_0x24c37a){return db[_0x368c('0x25')][_0x368c('0x3e')](_0x2775e7[_0x368c('0x3f')],{})['then'](respondWithResult(_0x24c37a,0xc9))[_0x368c('0x3b')](handleError(_0x24c37a,null));};exports[_0x368c('0x1f')]=function(_0x2b9b28,_0x5773ae){if(_0x2b9b28[_0x368c('0x3f')]['id']){delete _0x2b9b28[_0x368c('0x3f')]['id'];}return db[_0x368c('0x25')][_0x368c('0x40')]({'where':{'id':_0x2b9b28[_0x368c('0x41')]['id']}})['then'](handleEntityNotFound(_0x5773ae,null))['then'](saveUpdates(_0x2b9b28[_0x368c('0x3f')],null))[_0x368c('0x20')](respondWithResult(_0x5773ae,null))[_0x368c('0x3b')](handleError(_0x5773ae,null));};exports['destroy']=function(_0x4dd90d,_0x13cabc){return db[_0x368c('0x25')][_0x368c('0x40')]({'where':{'id':_0x4dd90d[_0x368c('0x41')]['id']}})[_0x368c('0x20')](handleEntityNotFound(_0x13cabc,null))[_0x368c('0x20')](removeEntity(_0x13cabc,null))[_0x368c('0x3b')](handleError(_0x13cabc,null));};exports[_0x368c('0x42')]=function(_0x321edb,_0x2bbbb4){return db[_0x368c('0x25')][_0x368c('0x42')]()[_0x368c('0x20')](respondWithResult(_0x2bbbb4,null))[_0x368c('0x3b')](handleError(_0x2bbbb4,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 9075d83..f369f8d 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 _0x8ece=['report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport'];(function(_0x2af655,_0x43eac3){var _0x54380a=function(_0x2a76fd){while(--_0x2a76fd){_0x2af655['push'](_0x2af655['shift']());}};_0x54380a(++_0x43eac3);}(_0x8ece,0x195));var _0xe8ec=function(_0x5df67d,_0x7f71cf){_0x5df67d=_0x5df67d-0x0;var _0x1f0c73=_0x8ece[_0x5df67d];return _0x1f0c73;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var logger=require(_0xe8ec('0x2'))(_0xe8ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe8ec('0x4'));var fs=require('fs');var path=require(_0xe8ec('0x5'));var rimraf=require(_0xe8ec('0x6'));var config=require(_0xe8ec('0x7'));var attributes=require(_0xe8ec('0x8'));module['exports']=function(_0x346577,_0x23fa35){return _0x346577[_0xe8ec('0x9')](_0xe8ec('0xa'),attributes,{'tableName':_0xe8ec('0xb'),'paranoid':![],'indexes':[{'name':_0xe8ec('0xc'),'fields':[_0xe8ec('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x25b4=['api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger'];(function(_0x31774e,_0x2588cd){var _0x5c1e16=function(_0x38ac65){while(--_0x38ac65){_0x31774e['push'](_0x31774e['shift']());}};_0x5c1e16(++_0x2588cd);}(_0x25b4,0x1ab));var _0x425b=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x25b4[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0x425b('0x0'));var util=require('util');var logger=require(_0x425b('0x1'))(_0x425b('0x2'));var moment=require(_0x425b('0x3'));var BPromise=require(_0x425b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x425b('0x5'));var rimraf=require(_0x425b('0x6'));var config=require(_0x425b('0x7'));var attributes=require(_0x425b('0x8'));module['exports']=function(_0x27e02e,_0x1e22e4){return _0x27e02e[_0x425b('0x9')](_0x425b('0xa'),attributes,{'tableName':_0x425b('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x425b('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 c6749f3..7a1b237 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 _0xe548=['then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/environment','client','request'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe548,0x184));var _0x8e54=function(_0x35b195,_0x8893d5){_0x35b195=_0x35b195-0x0;var _0x2433bf=_0xe548[_0x35b195];return _0x2433bf;};'use strict';var _=require(_0x8e54('0x0'));var util=require(_0x8e54('0x1'));var moment=require(_0x8e54('0x2'));var BPromise=require(_0x8e54('0x3'));var rs=require(_0x8e54('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8e54('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8e54('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc6281c,_0x2aa209,_0x148c1f){return new BPromise(function(_0x3d6444,_0x270ef1){return client[_0x8e54('0x7')](_0xc6281c,_0x148c1f)[_0x8e54('0x8')](function(_0x5b4913){logger[_0x8e54('0x9')](_0x8e54('0xa'),_0x2aa209,_0x8e54('0xb'));logger[_0x8e54('0xc')](_0x8e54('0xd'),_0x2aa209,'request\x20sent',JSON[_0x8e54('0xe')](_0x5b4913));if(_0x5b4913[_0x8e54('0xf')]){if(_0x5b4913['error']['code']===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x2aa209,_0x5b4913[_0x8e54('0xf')][_0x8e54('0x10')]);return _0x270ef1(_0x5b4913[_0x8e54('0xf')]['message']);}logger[_0x8e54('0xf')](_0x8e54('0xa'),_0x2aa209,_0x5b4913['error']['message']);return _0x3d6444(_0x5b4913[_0x8e54('0xf')]['message']);}else{logger[_0x8e54('0x9')]('SmsTransferReport,\x20%s,\x20%s',_0x2aa209,'request\x20sent');_0x3d6444(_0x5b4913[_0x8e54('0x11')][_0x8e54('0x10')]);}})['catch'](function(_0x45896b){logger[_0x8e54('0xf')](_0x8e54('0xa'),_0x2aa209,_0x45896b);_0x270ef1(_0x45896b);});});} \ No newline at end of file +var _0xc569=['then','request\x20sent','debug','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xc569,0x159));var _0x9c56=function(_0x1a2d27,_0x5b277b){_0x1a2d27=_0x1a2d27-0x0;var _0x5ef5c6=_0xc569[_0x1a2d27];return _0x5ef5c6;};'use strict';var _=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var moment=require(_0x9c56('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c56('0x3'));var fs=require('fs');var Redis=require(_0x9c56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c56('0x5'));var logger=require(_0x9c56('0x6'))(_0x9c56('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c56('0x8'));var client=jayson[_0x9c56('0x9')][_0x9c56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38a9cf,_0x564e30,_0x15206f){return new BPromise(function(_0xaba9c7,_0x35baa0){return client[_0x9c56('0xb')](_0x38a9cf,_0x15206f)[_0x9c56('0xc')](function(_0x582e29){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x564e30,_0x9c56('0xd'));logger[_0x9c56('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x564e30,_0x9c56('0xd'),JSON['stringify'](_0x582e29));if(_0x582e29[_0x9c56('0xf')]){if(_0x582e29[_0x9c56('0xf')][_0x9c56('0x10')]===0x1f4){logger[_0x9c56('0xf')](_0x9c56('0x11'),_0x564e30,_0x582e29[_0x9c56('0xf')][_0x9c56('0x12')]);return _0x35baa0(_0x582e29['error'][_0x9c56('0x12')]);}logger[_0x9c56('0xf')](_0x9c56('0x11'),_0x564e30,_0x582e29[_0x9c56('0xf')][_0x9c56('0x12')]);return _0xaba9c7(_0x582e29['error'][_0x9c56('0x12')]);}else{logger['info'](_0x9c56('0x11'),_0x564e30,_0x9c56('0xd'));_0xaba9c7(_0x582e29[_0x9c56('0x13')][_0x9c56('0x12')]);}})[_0x9c56('0x14')](function(_0x20467d){logger[_0x9c56('0xf')](_0x9c56('0x11'),_0x564e30,_0x20467d);_0x35baa0(_0x20467d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 6ada5fd..737fc3f 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 _0x3c08=['now','extname','post','single','put','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename'];(function(_0x1f7467,_0x29d5f7){var _0x5c6fed=function(_0x4bb9e5){while(--_0x4bb9e5){_0x1f7467['push'](_0x1f7467['shift']());}};_0x5c6fed(++_0x29d5f7);}(_0x3c08,0xd7));var _0x83c0=function(_0x59ca11,_0x46303a){_0x59ca11=_0x59ca11-0x0;var _0x21bc5f=_0x3c08[_0x59ca11];return _0x21bc5f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x83c0('0x0'));var timeout=require(_0x83c0('0x1'));var express=require(_0x83c0('0x2'));var router=express['Router']();var fs_extra=require(_0x83c0('0x3'));var auth=require(_0x83c0('0x4'));var interaction=require(_0x83c0('0x5'));var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth[_0x83c0('0x6')](),controller[_0x83c0('0x7')]);router[_0x83c0('0x8')](_0x83c0('0x9'),auth['isAuthenticated'](),controller[_0x83c0('0xa')]);router[_0x83c0('0x8')]('/:id/download',auth[_0x83c0('0x6')](),controller['download']);var upload=multer({'storage':multer[_0x83c0('0xb')]({'destination':function(_0x12b3b3,_0x17ed7f,_0x1469de){_0x1469de(null,path[_0x83c0('0xc')](config[_0x83c0('0xd')],_0x83c0('0xe')));},'filename':function(_0x5ee9d8,_0x2a0000,_0x4cccdc){_0x2a0000[_0x83c0('0xf')]=_0x2a0000[_0x83c0('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4cccdc(null,util[_0x83c0('0x10')](_0x83c0('0x11'),path[_0x83c0('0x12')](_0x2a0000['originalname'],path['extname'](_0x2a0000['originalname'])),Date[_0x83c0('0x13')](),path[_0x83c0('0x14')](_0x2a0000[_0x83c0('0xf')])));}})});router[_0x83c0('0x15')]('/',upload[_0x83c0('0x16')]('file'),controller['create']);router[_0x83c0('0x17')]('/:id',auth[_0x83c0('0x6')](),controller['update']);router['delete'](_0x83c0('0x9'),auth[_0x83c0('0x6')](),controller[_0x83c0('0x18')]);module[_0x83c0('0x19')]=router; \ No newline at end of file +var _0x0b0c=['show','/:id/download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','file','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0x0b0c,0xc5));var _0xc0b0=function(_0x4c6f44,_0x413a03){_0x4c6f44=_0x4c6f44-0x0;var _0x5ee4b9=_0x0b0c[_0x4c6f44];return _0x5ee4b9;};'use strict';var multer=require(_0xc0b0('0x0'));var util=require(_0xc0b0('0x1'));var path=require(_0xc0b0('0x2'));var timeout=require(_0xc0b0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc0b0('0x4'));var auth=require(_0xc0b0('0x5'));var interaction=require(_0xc0b0('0x6'));var config=require(_0xc0b0('0x7'));var controller=require(_0xc0b0('0x8'));router[_0xc0b0('0x9')]('/',auth[_0xc0b0('0xa')](),controller[_0xc0b0('0xb')]);router[_0xc0b0('0x9')](_0xc0b0('0xc'),auth[_0xc0b0('0xa')](),controller[_0xc0b0('0xd')]);router[_0xc0b0('0x9')](_0xc0b0('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x132b6b,_0x10dc99,_0x36ae40){_0x36ae40(null,path[_0xc0b0('0xf')](config[_0xc0b0('0x10')],_0xc0b0('0x11')));},'filename':function(_0x256da8,_0xe27430,_0x98e23c){_0xe27430[_0xc0b0('0x12')]=_0xe27430[_0xc0b0('0x12')][_0xc0b0('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x98e23c(null,util[_0xc0b0('0x14')](_0xc0b0('0x15'),path['basename'](_0xe27430['originalname'],path[_0xc0b0('0x16')](_0xe27430[_0xc0b0('0x12')])),Date[_0xc0b0('0x17')](),path['extname'](_0xe27430[_0xc0b0('0x12')])));}})});router['post']('/',upload['single'](_0xc0b0('0x18')),controller[_0xc0b0('0x19')]);router[_0xc0b0('0x1a')](_0xc0b0('0xc'),auth['isAuthenticated'](),controller[_0xc0b0('0x1b')]);router[_0xc0b0('0x1c')](_0xc0b0('0xc'),auth[_0xc0b0('0xa')](),controller[_0xc0b0('0x1c')]);module[_0xc0b0('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 62d23b9..6baef6e 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 _0x913c=['INTEGER','BIGINT','exports','name','STRING','FLOAT'];(function(_0x4732b3,_0xb288de){var _0x567158=function(_0x2e138d){while(--_0x2e138d){_0x4732b3['push'](_0x4732b3['shift']());}};_0x567158(++_0xb288de);}(_0x913c,0x1a0));var _0xc913=function(_0x49bb06,_0x54e1f0){_0x49bb06=_0x49bb06-0x0;var _0x3b330c=_0x913c[_0x49bb06];return _0x3b330c;};'use strict';var Sequelize=require('sequelize');module[_0xc913('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xc913('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xc913('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xc913('0x2')]},'original_format':{'type':Sequelize[_0xc913('0x2')]},'original_duration':{'type':Sequelize[_0xc913('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xc913('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xc913('0x4')]},'converted_format':{'type':Sequelize[_0xc913('0x2')]},'converted_duration':{'type':Sequelize[_0xc913('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xc913('0x5')]},'converted_channelCount':{'type':Sequelize[_0xc913('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xc913('0x4')]}}; \ No newline at end of file +var _0xa0f8=['FLOAT','INTEGER','BIGINT','sequelize','STRING','name'];(function(_0x4483b5,_0x192c27){var _0xce017c=function(_0x7ae1e6){while(--_0x7ae1e6){_0x4483b5['push'](_0x4483b5['shift']());}};_0xce017c(++_0x192c27);}(_0xa0f8,0x1ef));var _0x8a0f=function(_0x27eda0,_0x42a3cf){_0x27eda0=_0x27eda0-0x0;var _0x2b63a5=_0xa0f8[_0x27eda0];return _0x2b63a5;};'use strict';var Sequelize=require(_0x8a0f('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a0f('0x1')],'unique':_0x8a0f('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x8a0f('0x1')]},'display_name':{'type':Sequelize[_0x8a0f('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x8a0f('0x1')]},'original_format':{'type':Sequelize[_0x8a0f('0x1')]},'original_duration':{'type':Sequelize[_0x8a0f('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x8a0f('0x4')]},'original_bitRate':{'type':Sequelize[_0x8a0f('0x5')]},'original_sampleRate':{'type':Sequelize[_0x8a0f('0x4')]},'converted_format':{'type':Sequelize[_0x8a0f('0x1')]},'converted_duration':{'type':Sequelize[_0x8a0f('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x8a0f('0x5')]},'converted_channelCount':{'type':Sequelize[_0x8a0f('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x8a0f('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 7e3e737..a0bd71f 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 _0x55b0=['options','includeAll','include','rows','catch','show','keys','length','find','download','params','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','extname','file','originalname','filename','substring','wav','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','0777','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','original_format','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','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Sounds','then','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x1dec93,_0x25781b){var _0x255250=function(_0x2563b6){while(--_0x2563b6){_0x1dec93['push'](_0x1dec93['shift']());}};_0x255250(++_0x25781b);}(_0x55b0,0x137));var _0x055b=function(_0x3f2d34,_0x57d7a){_0x3f2d34=_0x3f2d34-0x0;var _0x115f68=_0x55b0[_0x3f2d34];return _0x115f68;};'use strict';var emlformat=require(_0x055b('0x0'));var rimraf=require(_0x055b('0x1'));var zipdir=require(_0x055b('0x2'));var jsonpatch=require(_0x055b('0x3'));var rp=require(_0x055b('0x4'));var moment=require(_0x055b('0x5'));var BPromise=require(_0x055b('0x6'));var Mustache=require(_0x055b('0x7'));var util=require(_0x055b('0x8'));var path=require(_0x055b('0x9'));var sox=require(_0x055b('0xa'));var csv=require(_0x055b('0xb'));var ejs=require(_0x055b('0xc'));var fs=require('fs');var fs_extra=require(_0x055b('0xd'));var _=require(_0x055b('0xe'));var squel=require(_0x055b('0xf'));var crypto=require(_0x055b('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x055b('0x11'));var toCsv=require(_0x055b('0xb'));var querystring=require(_0x055b('0x12'));var Papa=require(_0x055b('0x13'));var Redis=require(_0x055b('0x14'));var authService=require(_0x055b('0x15'));var qs=require(_0x055b('0x16'));var as=require(_0x055b('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x055b('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x055b('0x19'));var db=require(_0x055b('0x1a'))['db'];function respondWithStatusCode(_0x2ef940,_0x5c0543){_0x5c0543=_0x5c0543||0xcc;return function(_0x1e20b2){if(_0x1e20b2){return _0x2ef940[_0x055b('0x1b')](_0x5c0543);}return _0x2ef940[_0x055b('0x1c')](_0x5c0543)[_0x055b('0x1d')]();};}function respondWithResult(_0x25c307,_0x2c8293){_0x2c8293=_0x2c8293||0xc8;return function(_0x34ecea){if(_0x34ecea){return _0x25c307[_0x055b('0x1c')](_0x2c8293)[_0x055b('0x1e')](_0x34ecea);}};}function respondWithFilteredResult(_0x2232ce,_0x5745ba){return function(_0x1b2049){if(_0x1b2049){var _0x27cf61=typeof _0x5745ba[_0x055b('0x1f')]===_0x055b('0x20')&&typeof _0x5745ba[_0x055b('0x21')]===_0x055b('0x20');var _0x1b9798=_0x1b2049[_0x055b('0x22')];var _0x42d72c=_0x27cf61?0x0:_0x5745ba['offset'];var _0xed9896=_0x27cf61?_0x1b2049[_0x055b('0x22')]:_0x5745ba[_0x055b('0x1f')]+_0x5745ba['limit'];var _0x126ef5;if(_0xed9896>=_0x1b9798){_0xed9896=_0x1b9798;_0x126ef5=0xc8;}else{_0x126ef5=0xce;}_0x2232ce[_0x055b('0x1c')](_0x126ef5);return _0x2232ce[_0x055b('0x23')](_0x055b('0x24'),_0x42d72c+'-'+_0xed9896+'/'+_0x1b9798)[_0x055b('0x1e')](_0x1b2049);}return null;};}function patchUpdates(_0x35ce30){return function(_0x3c441a){try{jsonpatch[_0x055b('0x25')](_0x3c441a,_0x35ce30,!![]);}catch(_0x5e0316){return BPromise[_0x055b('0x26')](_0x5e0316);}return _0x3c441a[_0x055b('0x27')]();};}function saveUpdates(_0x8576d6,_0x550300){return function(_0x5269d0){if(_0x5269d0){return _0x5269d0[_0x055b('0x28')](_0x8576d6)['then'](function(_0x1a1e0e){return _0x1a1e0e;});}return null;};}function removeEntity(_0x1b3eaa,_0x365ff6){return function(_0xcefffb){if(_0xcefffb){return _0xcefffb[_0x055b('0x29')]()['then'](function(){var _0x1d8d52=_0xcefffb[_0x055b('0x2a')]({'plain':!![]});var _0xe448bf=_0x055b('0x2b');return db['UserProfileResource'][_0x055b('0x29')]({'where':{'type':_0xe448bf,'resourceId':_0x1d8d52['id']}})['then'](function(){return _0xcefffb;});})[_0x055b('0x2c')](function(){_0x1b3eaa[_0x055b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2476c0,_0x3ea377){return function(_0x319818){if(!_0x319818){_0x2476c0[_0x055b('0x1b')](0x194);}return _0x319818;};}function handleError(_0x33a6f6,_0x5777c2){_0x5777c2=_0x5777c2||0x1f4;return function(_0x17a1b7){logger[_0x055b('0x2d')](_0x17a1b7[_0x055b('0x2e')]);if(_0x17a1b7[_0x055b('0x2f')]){delete _0x17a1b7[_0x055b('0x2f')];}_0x33a6f6['status'](_0x5777c2)[_0x055b('0x30')](_0x17a1b7);};}exports[_0x055b('0x31')]=function(_0x4a4d89,_0x505021){var _0x34aca6={},_0x36b9b1={},_0x27897b={'count':0x0,'rows':[]};var _0x3d77b7=_[_0x055b('0x32')](db[_0x055b('0x33')][_0x055b('0x34')],function(_0xf9e317){return{'name':_0xf9e317[_0x055b('0x35')],'type':_0xf9e317[_0x055b('0x36')][_0x055b('0x37')]};});_0x36b9b1[_0x055b('0x38')]=_[_0x055b('0x32')](_0x3d77b7,_0x055b('0x2f'));_0x36b9b1['query']=_['keys'](_0x4a4d89[_0x055b('0x39')]);_0x36b9b1[_0x055b('0x3a')]=_[_0x055b('0x3b')](_0x36b9b1['model'],_0x36b9b1[_0x055b('0x39')]);_0x34aca6['attributes']=_[_0x055b('0x3b')](_0x36b9b1['model'],qs[_0x055b('0x3c')](_0x4a4d89[_0x055b('0x39')]['fields']));_0x34aca6[_0x055b('0x3d')]=_0x34aca6['attributes']['length']?_0x34aca6[_0x055b('0x3d')]:_0x36b9b1[_0x055b('0x38')];if(!_0x4a4d89[_0x055b('0x39')][_0x055b('0x3e')](_0x055b('0x3f'))){_0x34aca6[_0x055b('0x21')]=qs['limit'](_0x4a4d89[_0x055b('0x39')][_0x055b('0x21')]);_0x34aca6['offset']=qs[_0x055b('0x1f')](_0x4a4d89[_0x055b('0x39')][_0x055b('0x1f')]);}_0x34aca6[_0x055b('0x40')]=qs['sort'](_0x4a4d89[_0x055b('0x39')][_0x055b('0x41')]);_0x34aca6[_0x055b('0x42')]=qs[_0x055b('0x3a')](_[_0x055b('0x43')](_0x4a4d89[_0x055b('0x39')],_0x36b9b1['filters']),_0x3d77b7);if(_0x4a4d89[_0x055b('0x39')]['filter']){_0x34aca6['where']=_[_0x055b('0x44')](_0x34aca6[_0x055b('0x42')],{'$or':_[_0x055b('0x32')](_0x3d77b7,function(_0x489498){if(_0x489498[_0x055b('0x36')]!==_0x055b('0x45')){var _0x498eee={};_0x498eee[_0x489498[_0x055b('0x2f')]]={'$like':'%'+_0x4a4d89[_0x055b('0x39')]['filter']+'%'};return _0x498eee;}})});}_0x34aca6=_[_0x055b('0x44')]({},_0x34aca6,_0x4a4d89[_0x055b('0x46')]);var _0x24e2c7={'where':_0x34aca6[_0x055b('0x42')]};return db[_0x055b('0x33')][_0x055b('0x22')](_0x24e2c7)[_0x055b('0x2c')](function(_0x14db88){_0x27897b[_0x055b('0x22')]=_0x14db88;if(_0x4a4d89[_0x055b('0x39')][_0x055b('0x47')]){_0x34aca6[_0x055b('0x48')]=[{'all':!![]}];}return db[_0x055b('0x33')]['findAll'](_0x34aca6);})[_0x055b('0x2c')](function(_0x55897c){_0x27897b[_0x055b('0x49')]=_0x55897c;return _0x27897b;})[_0x055b('0x2c')](respondWithFilteredResult(_0x505021,_0x34aca6))[_0x055b('0x4a')](handleError(_0x505021,null));};exports[_0x055b('0x4b')]=function(_0x15e39c,_0x3b52ee){var _0x18b0d7={'raw':!![],'where':{'id':_0x15e39c['params']['id']}},_0x3a6dec={};_0x3a6dec['model']=_[_0x055b('0x4c')](db[_0x055b('0x33')][_0x055b('0x34')]);_0x3a6dec[_0x055b('0x39')]=_[_0x055b('0x4c')](_0x15e39c['query']);_0x3a6dec[_0x055b('0x3a')]=_['intersection'](_0x3a6dec[_0x055b('0x38')],_0x3a6dec[_0x055b('0x39')]);_0x18b0d7['attributes']=_[_0x055b('0x3b')](_0x3a6dec[_0x055b('0x38')],qs[_0x055b('0x3c')](_0x15e39c[_0x055b('0x39')][_0x055b('0x3c')]));_0x18b0d7[_0x055b('0x3d')]=_0x18b0d7[_0x055b('0x3d')][_0x055b('0x4d')]?_0x18b0d7[_0x055b('0x3d')]:_0x3a6dec[_0x055b('0x38')];if(_0x15e39c[_0x055b('0x39')][_0x055b('0x47')]){_0x18b0d7['include']=[{'all':!![]}];}_0x18b0d7=_[_0x055b('0x44')]({},_0x18b0d7,_0x15e39c['options']);return db['Sound'][_0x055b('0x4e')](_0x18b0d7)[_0x055b('0x2c')](handleEntityNotFound(_0x3b52ee,null))['then'](respondWithResult(_0x3b52ee,null))[_0x055b('0x4a')](handleError(_0x3b52ee,null));};exports[_0x055b('0x4f')]=function(_0x134894,_0x332df1,_0x535e3b){return db[_0x055b('0x33')][_0x055b('0x4e')]({'where':{'id':_0x134894[_0x055b('0x50')]['id']},'attributes':['name','save_name',_0x055b('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x332df1,null))[_0x055b('0x2c')](function(_0x257830){if(_0x257830){if(!fs[_0x055b('0x52')](path[_0x055b('0x53')](config[_0x055b('0x54')],_0x055b('0x55'),_0x257830[_0x055b('0x56')]+'.'+_0x257830[_0x055b('0x51')]))){throw new db[(_0x055b('0x57'))]['ValidationError'](_0x055b('0x58'));}return _0x332df1['download'](path[_0x055b('0x53')](config[_0x055b('0x54')],'server/files/sounds/converted',util[_0x055b('0x59')]('%s.%s',_0x257830['save_name'],_0x257830[_0x055b('0x51')])),util[_0x055b('0x59')](_0x055b('0x5a'),_0x257830[_0x055b('0x2f')],_0x257830[_0x055b('0x51')]));}return null;})['catch'](handleError(_0x332df1,null));};exports[_0x055b('0x5b')]=function(_0x4f7589,_0x7658d3,_0x412717){var _0x42621a={'name':path[_0x055b('0x5c')](_0x4f7589['file']['originalname'],path[_0x055b('0x5d')](_0x4f7589[_0x055b('0x5e')][_0x055b('0x5f')])),'save_name':path[_0x055b('0x5c')](_0x4f7589[_0x055b('0x5e')][_0x055b('0x60')],path[_0x055b('0x5d')](_0x4f7589[_0x055b('0x5e')]['filename'])),'original_format':path[_0x055b('0x5d')](_0x4f7589[_0x055b('0x5e')][_0x055b('0x5f')])[_0x055b('0x61')](0x1),'converted_format':_0x055b('0x62')};var _0x609e5c=path[_0x055b('0x53')](config[_0x055b('0x54')],'server/files/sounds/original',_0x4f7589[_0x055b('0x5e')][_0x055b('0x60')]);var _0xd08fac=path['join'](config[_0x055b('0x54')],_0x055b('0x55'),util[_0x055b('0x59')](_0x055b('0x5a'),path[_0x055b('0x5c')](_0x4f7589['file']['filename'],path['extname'](_0x4f7589[_0x055b('0x5e')]['filename'])),_0x42621a[_0x055b('0x51')]));logger['info'](_0x055b('0x63'),_0x609e5c);logger[_0x055b('0x64')](_0x055b('0x65'),_0xd08fac);try{fs[_0x055b('0x66')](_0x609e5c,parseInt('0777',0x8));var _0x100d27=sox[_0x055b('0x67')](_0x609e5c,_0xd08fac,{'sampleRate':0x1f40,'format':_0x055b('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x100d27['on']('error',function(_0x38b559){fs[_0x055b('0x68')](_0x609e5c);_0x7658d3['status'](0x1f4)[_0x055b('0x30')](_0x38b559);});_0x100d27['on'](_0x055b('0x69'),function(_0x2e4d18){_0x42621a[_0x055b('0x6a')]=isNaN(_0x2e4d18['duration'])?null:_0x2e4d18[_0x055b('0x6b')]*0x3e8;_0x42621a['original_sampleCount']=isNaN(_0x2e4d18[_0x055b('0x6c')])?null:_0x2e4d18[_0x055b('0x6c')];_0x42621a[_0x055b('0x6d')]=isNaN(_0x2e4d18[_0x055b('0x6e')])?null:_0x2e4d18[_0x055b('0x6e')];_0x42621a['original_bitRate']=isNaN(_0x2e4d18[_0x055b('0x6f')])?null:_0x2e4d18['bitRate'];_0x42621a['original_sampleRate']=isNaN(_0x2e4d18[_0x055b('0x70')])?null:_0x2e4d18['sampleRate'];});_0x100d27['on'](_0x055b('0x71'),function(_0x33116a){_0x42621a[_0x055b('0x72')]=isNaN(_0x33116a[_0x055b('0x6b')])?null:_0x33116a[_0x055b('0x6b')]*0x3e8;_0x42621a[_0x055b('0x73')]=isNaN(_0x33116a[_0x055b('0x6c')])?null:_0x33116a[_0x055b('0x6c')];_0x42621a[_0x055b('0x74')]=isNaN(_0x33116a[_0x055b('0x6e')])?null:_0x33116a[_0x055b('0x6e')];_0x42621a['converted_bitRate']=isNaN(_0x33116a[_0x055b('0x6f')])?null:_0x33116a['bitRate'];_0x42621a['converted_sampleRate']=isNaN(_0x33116a['sampleRate'])?null:_0x33116a[_0x055b('0x70')];});_0x100d27['on']('end',function(){fs['chmodSync'](_0xd08fac,parseInt(_0x055b('0x75'),0x8));return db['Sound'][_0x055b('0x5b')](_0x42621a)['then'](function(_0x3d23af){var _0x4ab7f9={'role':_0x4f7589[_0x055b('0x76')]['role'],'userProfileId':_0x4f7589[_0x055b('0x76')]['userProfileId']};if(!_0x4ab7f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ab7f9[_0x055b('0x77')]===_0x055b('0x78')){var _0x57f08c=_0x3d23af[_0x055b('0x2a')]({'plain':!![]});return db[_0x055b('0x79')][_0x055b('0x4e')]({'where':{'name':_0x055b('0x2b'),'userProfileId':_0x4ab7f9[_0x055b('0x7a')]},'raw':!![]})['then'](function(_0x2b11f6){if(_0x2b11f6&&_0x2b11f6[_0x055b('0x7b')]===0x0){return db['UserProfileResource'][_0x055b('0x5b')]({'name':_0x57f08c['name'],'resourceId':_0x57f08c['id'],'type':_0x2b11f6[_0x055b('0x2f')],'sectionId':_0x2b11f6['id']},{})[_0x055b('0x2c')](function(){return _0x3d23af;});}else{return _0x3d23af;}})['catch'](function(_0x5232c8){logger[_0x055b('0x2d')](_0x055b('0x7c'),_0x5232c8);throw _0x5232c8;});}return _0x3d23af;})['then'](respondWithResult(_0x7658d3,null))[_0x055b('0x4a')](handleError(_0x7658d3,null));});_0x100d27[_0x055b('0x7d')]();}catch(_0x225762){_0x7658d3[_0x055b('0x1c')](0x1f4)['send'](_0x225762);}};exports[_0x055b('0x28')]=function(_0x96810b,_0x325e7d,_0x540f4f){return db[_0x055b('0x33')][_0x055b('0x4e')]({'where':{'id':_0x96810b[_0x055b('0x50')]['id']}})[_0x055b('0x2c')](handleEntityNotFound(_0x325e7d,null))[_0x055b('0x2c')](saveUpdates(_[_0x055b('0x43')](_0x96810b[_0x055b('0x76')],[_0x055b('0x2f'),'description']),null))['then'](respondWithResult(_0x325e7d,null))[_0x055b('0x4a')](handleError(_0x325e7d,null));};exports['delete']=function(_0x5c7a86,_0x3b27b1,_0x466fdf){return db[_0x055b('0x33')]['find']({'where':{'id':_0x5c7a86['params']['id']}})[_0x055b('0x2c')](function(_0x48f693){if(_0x48f693){return _0x48f693['destroy']();}})[_0x055b('0x2c')](function(_0x33d9dd){var _0x28505a=path[_0x055b('0x53')](config['root'],'server/files/sounds/original',util[_0x055b('0x59')](_0x055b('0x5a'),_0x33d9dd['save_name'],_0x33d9dd[_0x055b('0x7e')]));var _0x4cfecf=path['join'](config[_0x055b('0x54')],_0x055b('0x55'),util[_0x055b('0x59')](_0x055b('0x5a'),_0x33d9dd['save_name'],_0x33d9dd[_0x055b('0x51')]));fs[_0x055b('0x68')](_0x28505a);fs[_0x055b('0x68')](_0x4cfecf);return _0x33d9dd;})[_0x055b('0x2c')](function(_0x1f7455){if(_0x1f7455){return _0x3b27b1[_0x055b('0x1c')](0xcc)[_0x055b('0x1d')]();}})[_0x055b('0x2c')](handleEntityNotFound(_0x3b27b1,null))[_0x055b('0x4a')](handleError(_0x3b27b1,null));}; \ No newline at end of file +var _0xd892=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','set','Content-Range','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','offset','order','sort','where','pick','filter','merge','options','Sound','includeAll','include','rows','catch','params','rawAttributes','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','download','format','%s.%s','create','file','originalname','extname','filename','substring','server/files/sounds/original','basename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','sampleRate','dest','converted_duration','converted_bitRate','bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','start','description','delete','original_format','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5c3ea5,_0xa9ed0c){var _0x102b61=function(_0xafb4a3){while(--_0xafb4a3){_0x5c3ea5['push'](_0x5c3ea5['shift']());}};_0x102b61(++_0xa9ed0c);}(_0xd892,0x1df));var _0x2d89=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xd892[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require(_0x2d89('0x0'));var rimraf=require(_0x2d89('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2d89('0x2'));var moment=require(_0x2d89('0x3'));var BPromise=require(_0x2d89('0x4'));var Mustache=require(_0x2d89('0x5'));var util=require(_0x2d89('0x6'));var path=require(_0x2d89('0x7'));var sox=require('sox');var csv=require(_0x2d89('0x8'));var ejs=require(_0x2d89('0x9'));var fs=require('fs');var fs_extra=require(_0x2d89('0xa'));var _=require(_0x2d89('0xb'));var squel=require(_0x2d89('0xc'));var crypto=require(_0x2d89('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2d89('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2d89('0xf'));var Papa=require(_0x2d89('0x10'));var Redis=require(_0x2d89('0x11'));var authService=require(_0x2d89('0x12'));var qs=require(_0x2d89('0x13'));var as=require(_0x2d89('0x14'));var hardwareService=require(_0x2d89('0x15'));var logger=require(_0x2d89('0x16'))(_0x2d89('0x17'));var utils=require(_0x2d89('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2d89('0x19'));var db=require(_0x2d89('0x1a'))['db'];function respondWithStatusCode(_0xc19a4b,_0x168dc0){_0x168dc0=_0x168dc0||0xcc;return function(_0x2f3c6b){if(_0x2f3c6b){return _0xc19a4b[_0x2d89('0x1b')](_0x168dc0);}return _0xc19a4b[_0x2d89('0x1c')](_0x168dc0)[_0x2d89('0x1d')]();};}function respondWithResult(_0x7f9d6c,_0xec8f9b){_0xec8f9b=_0xec8f9b||0xc8;return function(_0x42e512){if(_0x42e512){return _0x7f9d6c[_0x2d89('0x1c')](_0xec8f9b)[_0x2d89('0x1e')](_0x42e512);}};}function respondWithFilteredResult(_0x526a01,_0x2a63a7){return function(_0x1c69b4){if(_0x1c69b4){var _0x4eb47d=typeof _0x2a63a7['offset']==='undefined'&&typeof _0x2a63a7['limit']===_0x2d89('0x1f');var _0x19aa03=_0x1c69b4[_0x2d89('0x20')];var _0x3122db=_0x4eb47d?0x0:_0x2a63a7['offset'];var _0x361bf6=_0x4eb47d?_0x1c69b4[_0x2d89('0x20')]:_0x2a63a7['offset']+_0x2a63a7['limit'];var _0x52d19a;if(_0x361bf6>=_0x19aa03){_0x361bf6=_0x19aa03;_0x52d19a=0xc8;}else{_0x52d19a=0xce;}_0x526a01['status'](_0x52d19a);return _0x526a01[_0x2d89('0x21')](_0x2d89('0x22'),_0x3122db+'-'+_0x361bf6+'/'+_0x19aa03)['json'](_0x1c69b4);}return null;};}function patchUpdates(_0x42b773){return function(_0x2f2a51){try{jsonpatch['apply'](_0x2f2a51,_0x42b773,!![]);}catch(_0x23c508){return BPromise['reject'](_0x23c508);}return _0x2f2a51[_0x2d89('0x23')]();};}function saveUpdates(_0x1fd533,_0x19a848){return function(_0x93ae2b){if(_0x93ae2b){return _0x93ae2b[_0x2d89('0x24')](_0x1fd533)[_0x2d89('0x25')](function(_0x18d7bf){return _0x18d7bf;});}return null;};}function removeEntity(_0x392a23,_0x4aaa84){return function(_0x2a2c08){if(_0x2a2c08){return _0x2a2c08[_0x2d89('0x26')]()[_0x2d89('0x25')](function(){var _0x58dcd0=_0x2a2c08['get']({'plain':!![]});var _0x467970=_0x2d89('0x27');return db[_0x2d89('0x28')]['destroy']({'where':{'type':_0x467970,'resourceId':_0x58dcd0['id']}})[_0x2d89('0x25')](function(){return _0x2a2c08;});})[_0x2d89('0x25')](function(){_0x392a23[_0x2d89('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x82616b,_0xa05201){return function(_0x13fa11){if(!_0x13fa11){_0x82616b[_0x2d89('0x1b')](0x194);}return _0x13fa11;};}function handleError(_0x34c97e,_0x4b1fff){_0x4b1fff=_0x4b1fff||0x1f4;return function(_0x5a2680){logger[_0x2d89('0x29')](_0x5a2680[_0x2d89('0x2a')]);if(_0x5a2680[_0x2d89('0x2b')]){delete _0x5a2680[_0x2d89('0x2b')];}_0x34c97e[_0x2d89('0x1c')](_0x4b1fff)[_0x2d89('0x2c')](_0x5a2680);};}exports[_0x2d89('0x2d')]=function(_0x539c18,_0x39a0c8){var _0x232c05={},_0x12fb83={},_0x3b5f21={'count':0x0,'rows':[]};var _0x991585=_['map'](db['Sound']['rawAttributes'],function(_0x4d98af){return{'name':_0x4d98af[_0x2d89('0x2e')],'type':_0x4d98af[_0x2d89('0x2f')][_0x2d89('0x30')]};});_0x12fb83[_0x2d89('0x31')]=_[_0x2d89('0x32')](_0x991585,_0x2d89('0x2b'));_0x12fb83[_0x2d89('0x33')]=_[_0x2d89('0x34')](_0x539c18[_0x2d89('0x33')]);_0x12fb83[_0x2d89('0x35')]=_['intersection'](_0x12fb83[_0x2d89('0x31')],_0x12fb83[_0x2d89('0x33')]);_0x232c05[_0x2d89('0x36')]=_[_0x2d89('0x37')](_0x12fb83['model'],qs[_0x2d89('0x38')](_0x539c18[_0x2d89('0x33')][_0x2d89('0x38')]));_0x232c05[_0x2d89('0x36')]=_0x232c05[_0x2d89('0x36')][_0x2d89('0x39')]?_0x232c05[_0x2d89('0x36')]:_0x12fb83[_0x2d89('0x31')];if(!_0x539c18[_0x2d89('0x33')]['hasOwnProperty'](_0x2d89('0x3a'))){_0x232c05[_0x2d89('0x3b')]=qs['limit'](_0x539c18[_0x2d89('0x33')][_0x2d89('0x3b')]);_0x232c05[_0x2d89('0x3c')]=qs['offset'](_0x539c18[_0x2d89('0x33')][_0x2d89('0x3c')]);}_0x232c05[_0x2d89('0x3d')]=qs[_0x2d89('0x3e')](_0x539c18['query'][_0x2d89('0x3e')]);_0x232c05[_0x2d89('0x3f')]=qs[_0x2d89('0x35')](_[_0x2d89('0x40')](_0x539c18[_0x2d89('0x33')],_0x12fb83[_0x2d89('0x35')]),_0x991585);if(_0x539c18[_0x2d89('0x33')][_0x2d89('0x41')]){_0x232c05[_0x2d89('0x3f')]=_[_0x2d89('0x42')](_0x232c05[_0x2d89('0x3f')],{'$or':_[_0x2d89('0x32')](_0x991585,function(_0x168b41){if(_0x168b41[_0x2d89('0x2f')]!=='VIRTUAL'){var _0x3a8a29={};_0x3a8a29[_0x168b41[_0x2d89('0x2b')]]={'$like':'%'+_0x539c18['query'][_0x2d89('0x41')]+'%'};return _0x3a8a29;}})});}_0x232c05=_[_0x2d89('0x42')]({},_0x232c05,_0x539c18[_0x2d89('0x43')]);var _0x1225b2={'where':_0x232c05['where']};return db[_0x2d89('0x44')]['count'](_0x1225b2)['then'](function(_0x1ebb3b){_0x3b5f21['count']=_0x1ebb3b;if(_0x539c18[_0x2d89('0x33')][_0x2d89('0x45')]){_0x232c05[_0x2d89('0x46')]=[{'all':!![]}];}return db[_0x2d89('0x44')]['findAll'](_0x232c05);})['then'](function(_0xb1ccf8){_0x3b5f21[_0x2d89('0x47')]=_0xb1ccf8;return _0x3b5f21;})[_0x2d89('0x25')](respondWithFilteredResult(_0x39a0c8,_0x232c05))[_0x2d89('0x48')](handleError(_0x39a0c8,null));};exports['show']=function(_0x37dcfe,_0xa915d2){var _0x5872b1={'raw':!![],'where':{'id':_0x37dcfe[_0x2d89('0x49')]['id']}},_0x1338d6={};_0x1338d6['model']=_[_0x2d89('0x34')](db[_0x2d89('0x44')][_0x2d89('0x4a')]);_0x1338d6[_0x2d89('0x33')]=_[_0x2d89('0x34')](_0x37dcfe[_0x2d89('0x33')]);_0x1338d6[_0x2d89('0x35')]=_['intersection'](_0x1338d6[_0x2d89('0x31')],_0x1338d6[_0x2d89('0x33')]);_0x5872b1[_0x2d89('0x36')]=_[_0x2d89('0x37')](_0x1338d6['model'],qs[_0x2d89('0x38')](_0x37dcfe[_0x2d89('0x33')][_0x2d89('0x38')]));_0x5872b1[_0x2d89('0x36')]=_0x5872b1[_0x2d89('0x36')][_0x2d89('0x39')]?_0x5872b1['attributes']:_0x1338d6[_0x2d89('0x31')];if(_0x37dcfe[_0x2d89('0x33')]['includeAll']){_0x5872b1['include']=[{'all':!![]}];}_0x5872b1=_['merge']({},_0x5872b1,_0x37dcfe[_0x2d89('0x43')]);return db[_0x2d89('0x44')][_0x2d89('0x4b')](_0x5872b1)[_0x2d89('0x25')](handleEntityNotFound(_0xa915d2,null))[_0x2d89('0x25')](respondWithResult(_0xa915d2,null))[_0x2d89('0x48')](handleError(_0xa915d2,null));};exports['download']=function(_0x358610,_0x3bb0c0,_0x5d634d){return db[_0x2d89('0x44')]['find']({'where':{'id':_0x358610[_0x2d89('0x49')]['id']},'attributes':[_0x2d89('0x2b'),_0x2d89('0x4c'),_0x2d89('0x4d')],'raw':!![]})[_0x2d89('0x25')](handleEntityNotFound(_0x3bb0c0,null))[_0x2d89('0x25')](function(_0x2507c5){if(_0x2507c5){if(!fs[_0x2d89('0x4e')](path[_0x2d89('0x4f')](config[_0x2d89('0x50')],_0x2d89('0x51'),_0x2507c5[_0x2d89('0x4c')]+'.'+_0x2507c5[_0x2d89('0x4d')]))){throw new db['Sequelize'][(_0x2d89('0x52'))]('Sound\x20not\x20found');}return _0x3bb0c0[_0x2d89('0x53')](path[_0x2d89('0x4f')](config[_0x2d89('0x50')],_0x2d89('0x51'),util[_0x2d89('0x54')](_0x2d89('0x55'),_0x2507c5[_0x2d89('0x4c')],_0x2507c5['converted_format'])),util['format']('%s.%s',_0x2507c5[_0x2d89('0x2b')],_0x2507c5[_0x2d89('0x4d')]));}return null;})[_0x2d89('0x48')](handleError(_0x3bb0c0,null));};exports[_0x2d89('0x56')]=function(_0x4517ea,_0x126d0a,_0x3b8008){var _0x1991b6={'name':path['basename'](_0x4517ea[_0x2d89('0x57')][_0x2d89('0x58')],path[_0x2d89('0x59')](_0x4517ea[_0x2d89('0x57')][_0x2d89('0x58')])),'save_name':path['basename'](_0x4517ea[_0x2d89('0x57')][_0x2d89('0x5a')],path[_0x2d89('0x59')](_0x4517ea[_0x2d89('0x57')][_0x2d89('0x5a')])),'original_format':path[_0x2d89('0x59')](_0x4517ea[_0x2d89('0x57')][_0x2d89('0x58')])[_0x2d89('0x5b')](0x1),'converted_format':'wav'};var _0x7278d1=path[_0x2d89('0x4f')](config['root'],_0x2d89('0x5c'),_0x4517ea['file']['filename']);var _0xadd1eb=path['join'](config[_0x2d89('0x50')],'server/files/sounds/converted',util['format'](_0x2d89('0x55'),path[_0x2d89('0x5d')](_0x4517ea[_0x2d89('0x57')]['filename'],path[_0x2d89('0x59')](_0x4517ea['file'][_0x2d89('0x5a')])),_0x1991b6[_0x2d89('0x4d')]));logger[_0x2d89('0x5e')](_0x2d89('0x5f'),_0x7278d1);logger[_0x2d89('0x5e')](_0x2d89('0x60'),_0xadd1eb);try{fs[_0x2d89('0x61')](_0x7278d1,parseInt(_0x2d89('0x62'),0x8));var _0x5834be=sox[_0x2d89('0x63')](_0x7278d1,_0xadd1eb,{'sampleRate':0x1f40,'format':_0x2d89('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5834be['on']('error',function(_0x42b500){fs[_0x2d89('0x65')](_0x7278d1);_0x126d0a[_0x2d89('0x1c')](0x1f4)[_0x2d89('0x2c')](_0x42b500);});_0x5834be['on'](_0x2d89('0x66'),function(_0x19d798){_0x1991b6[_0x2d89('0x67')]=isNaN(_0x19d798[_0x2d89('0x68')])?null:_0x19d798[_0x2d89('0x68')]*0x3e8;_0x1991b6[_0x2d89('0x69')]=isNaN(_0x19d798[_0x2d89('0x6a')])?null:_0x19d798['sampleCount'];_0x1991b6['original_channelCount']=isNaN(_0x19d798[_0x2d89('0x6b')])?null:_0x19d798[_0x2d89('0x6b')];_0x1991b6[_0x2d89('0x6c')]=isNaN(_0x19d798['bitRate'])?null:_0x19d798['bitRate'];_0x1991b6['original_sampleRate']=isNaN(_0x19d798[_0x2d89('0x6d')])?null:_0x19d798['sampleRate'];});_0x5834be['on'](_0x2d89('0x6e'),function(_0x1e5ba2){_0x1991b6[_0x2d89('0x6f')]=isNaN(_0x1e5ba2[_0x2d89('0x68')])?null:_0x1e5ba2[_0x2d89('0x68')]*0x3e8;_0x1991b6['converted_sampleCount']=isNaN(_0x1e5ba2[_0x2d89('0x6a')])?null:_0x1e5ba2['sampleCount'];_0x1991b6['converted_channelCount']=isNaN(_0x1e5ba2[_0x2d89('0x6b')])?null:_0x1e5ba2[_0x2d89('0x6b')];_0x1991b6[_0x2d89('0x70')]=isNaN(_0x1e5ba2['bitRate'])?null:_0x1e5ba2[_0x2d89('0x71')];_0x1991b6[_0x2d89('0x72')]=isNaN(_0x1e5ba2['sampleRate'])?null:_0x1e5ba2[_0x2d89('0x6d')];});_0x5834be['on'](_0x2d89('0x1d'),function(){fs[_0x2d89('0x61')](_0xadd1eb,parseInt(_0x2d89('0x62'),0x8));return db['Sound'][_0x2d89('0x56')](_0x1991b6)['then'](function(_0x5aed2b){var _0xea1300={'role':_0x4517ea[_0x2d89('0x73')][_0x2d89('0x74')],'userProfileId':_0x4517ea[_0x2d89('0x73')][_0x2d89('0x75')]};if(!_0xea1300)throw new Error(_0x2d89('0x76'));if(_0xea1300[_0x2d89('0x74')]===_0x2d89('0x77')){var _0x40017b=_0x5aed2b['get']({'plain':!![]});return db[_0x2d89('0x78')][_0x2d89('0x4b')]({'where':{'name':_0x2d89('0x27'),'userProfileId':_0xea1300['userProfileId']},'raw':!![]})[_0x2d89('0x25')](function(_0x1e818c){if(_0x1e818c&&_0x1e818c[_0x2d89('0x79')]===0x0){return db[_0x2d89('0x28')]['create']({'name':_0x40017b[_0x2d89('0x2b')],'resourceId':_0x40017b['id'],'type':_0x1e818c[_0x2d89('0x2b')],'sectionId':_0x1e818c['id']},{})['then'](function(){return _0x5aed2b;});}else{return _0x5aed2b;}})[_0x2d89('0x48')](function(_0x29e78a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29e78a);throw _0x29e78a;});}return _0x5aed2b;})[_0x2d89('0x25')](respondWithResult(_0x126d0a,null))[_0x2d89('0x48')](handleError(_0x126d0a,null));});_0x5834be[_0x2d89('0x7a')]();}catch(_0x5e354a){_0x126d0a['status'](0x1f4)['send'](_0x5e354a);}};exports[_0x2d89('0x24')]=function(_0x27a54a,_0x8946ad,_0x1b6c79){return db[_0x2d89('0x44')][_0x2d89('0x4b')]({'where':{'id':_0x27a54a[_0x2d89('0x49')]['id']}})[_0x2d89('0x25')](handleEntityNotFound(_0x8946ad,null))['then'](saveUpdates(_['pick'](_0x27a54a[_0x2d89('0x73')],[_0x2d89('0x2b'),_0x2d89('0x7b')]),null))[_0x2d89('0x25')](respondWithResult(_0x8946ad,null))[_0x2d89('0x48')](handleError(_0x8946ad,null));};exports[_0x2d89('0x7c')]=function(_0x940153,_0x513800,_0x254d7c){return db[_0x2d89('0x44')][_0x2d89('0x4b')]({'where':{'id':_0x940153[_0x2d89('0x49')]['id']}})[_0x2d89('0x25')](function(_0x2771e6){if(_0x2771e6){return _0x2771e6[_0x2d89('0x26')]();}})[_0x2d89('0x25')](function(_0x4ab2de){var _0x440583=path['join'](config['root'],_0x2d89('0x5c'),util[_0x2d89('0x54')](_0x2d89('0x55'),_0x4ab2de[_0x2d89('0x4c')],_0x4ab2de[_0x2d89('0x7d')]));var _0x965660=path[_0x2d89('0x4f')](config[_0x2d89('0x50')],_0x2d89('0x51'),util[_0x2d89('0x54')](_0x2d89('0x55'),_0x4ab2de[_0x2d89('0x4c')],_0x4ab2de[_0x2d89('0x4d')]));fs['unlinkSync'](_0x440583);fs[_0x2d89('0x65')](_0x965660);return _0x4ab2de;})[_0x2d89('0x25')](function(_0x59fab7){if(_0x59fab7){return _0x513800['status'](0xcc)[_0x2d89('0x1d')]();}})[_0x2d89('0x25')](handleEntityNotFound(_0x513800,null))['catch'](handleError(_0x513800,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 12d1490..da83264 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 _0x37c2=['tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','path','exports','Sound'];(function(_0x35d39b,_0x100854){var _0x23e7dd=function(_0x128ba7){while(--_0x128ba7){_0x35d39b['push'](_0x35d39b['shift']());}};_0x23e7dd(++_0x100854);}(_0x37c2,0xbf));var _0x237c=function(_0x5d428d,_0x7fe6eb){_0x5d428d=_0x5d428d-0x0;var _0x5aad90=_0x37c2[_0x5d428d];return _0x5aad90;};'use strict';var _=require(_0x237c('0x0'));var util=require(_0x237c('0x1'));var logger=require(_0x237c('0x2'))(_0x237c('0x3'));var moment=require(_0x237c('0x4'));var BPromise=require(_0x237c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x237c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0x237c('0x7')]=function(_0x5f2df6,_0x695a75){return _0x5f2df6['define'](_0x237c('0x8'),attributes,{'tableName':_0x237c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bca=['moment','bluebird','request-promise','rimraf','../../config/environment','define','util','../../config/logger','api'];(function(_0x5a843d,_0x1c2011){var _0x163d92=function(_0x2f5999){while(--_0x2f5999){_0x5a843d['push'](_0x5a843d['shift']());}};_0x163d92(++_0x1c2011);}(_0x7bca,0x1d1));var _0xa7bc=function(_0x5473da,_0x49396c){_0x5473da=_0x5473da-0x0;var _0x3b0928=_0x7bca[_0x5473da];return _0x3b0928;};'use strict';var _=require('lodash');var util=require(_0xa7bc('0x0'));var logger=require(_0xa7bc('0x1'))(_0xa7bc('0x2'));var moment=require(_0xa7bc('0x3'));var BPromise=require(_0xa7bc('0x4'));var rp=require(_0xa7bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7bc('0x6'));var config=require(_0xa7bc('0x7'));var attributes=require('./sound.attributes');module['exports']=function(_0x39e4e7,_0x45bec4){return _0x39e4e7[_0xa7bc('0x8')]('Sound',attributes,{'tableName':'tools_sounds','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 06946ad..ef0db40 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 _0x5974=['raw','attributes','include','map','model','ShowSound','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','find','options'];(function(_0x151926,_0x1c66fb){var _0x3a2182=function(_0x88cb4c){while(--_0x88cb4c){_0x151926['push'](_0x151926['shift']());}};_0x3a2182(++_0x1c66fb);}(_0x5974,0x16e));var _0x4597=function(_0x2d57a9,_0x5ae060){_0x2d57a9=_0x2d57a9-0x0;var _0x1b9671=_0x5974[_0x2d57a9];return _0x1b9671;};'use strict';var _=require(_0x4597('0x0'));var util=require(_0x4597('0x1'));var moment=require(_0x4597('0x2'));var BPromise=require(_0x4597('0x3'));var rs=require(_0x4597('0x4'));var fs=require('fs');var Redis=require(_0x4597('0x5'));var db=require(_0x4597('0x6'))['db'];var utils=require(_0x4597('0x7'));var logger=require(_0x4597('0x8'))(_0x4597('0x9'));var config=require(_0x4597('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4597('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e05fd,_0x178380,_0xe1b555){return new BPromise(function(_0x442532,_0x2cecbf){return client['request'](_0x2e05fd,_0xe1b555)[_0x4597('0xc')](function(_0x50106a){logger[_0x4597('0xd')](_0x4597('0xe'),_0x178380,'request\x20sent');logger[_0x4597('0xf')](_0x4597('0x10'),_0x178380,'request\x20sent',JSON[_0x4597('0x11')](_0x50106a));if(_0x50106a[_0x4597('0x12')]){if(_0x50106a[_0x4597('0x12')][_0x4597('0x13')]===0x1f4){logger[_0x4597('0x12')]('Sound,\x20%s,\x20%s',_0x178380,_0x50106a['error'][_0x4597('0x14')]);return _0x2cecbf(_0x50106a['error'][_0x4597('0x14')]);}logger[_0x4597('0x12')](_0x4597('0xe'),_0x178380,_0x50106a['error'][_0x4597('0x14')]);return _0x442532(_0x50106a['error'][_0x4597('0x14')]);}else{logger[_0x4597('0xd')]('Sound,\x20%s,\x20%s',_0x178380,'request\x20sent');_0x442532(_0x50106a['result'][_0x4597('0x14')]);}})[_0x4597('0x15')](function(_0x4294e4){logger[_0x4597('0x12')](_0x4597('0xe'),_0x178380,_0x4294e4);_0x2cecbf(_0x4294e4);});});}exports['ShowSound']=function(_0x5c419d){var _0x5e4dcc=this;return new Promise(function(_0x30af17,_0x12a416){return db['Sound'][_0x4597('0x16')]({'raw':_0x5c419d[_0x4597('0x17')]?_0x5c419d[_0x4597('0x17')][_0x4597('0x18')]===undefined?!![]:![]:!![],'where':_0x5c419d[_0x4597('0x17')]?_0x5c419d[_0x4597('0x17')]['where']||null:null,'attributes':_0x5c419d[_0x4597('0x17')]?_0x5c419d['options'][_0x4597('0x19')]||null:null,'include':_0x5c419d[_0x4597('0x17')]?_0x5c419d[_0x4597('0x17')][_0x4597('0x1a')]?_[_0x4597('0x1b')](_0x5c419d[_0x4597('0x17')][_0x4597('0x1a')],function(_0x520382){return{'model':db[_0x520382[_0x4597('0x1c')]],'as':_0x520382['as'],'attributes':_0x520382['attributes'],'include':_0x520382[_0x4597('0x1a')]?_[_0x4597('0x1b')](_0x520382['include'],function(_0x52c3f2){return{'model':db[_0x52c3f2[_0x4597('0x1c')]],'as':_0x52c3f2['as'],'attributes':_0x52c3f2[_0x4597('0x19')],'include':_0x52c3f2[_0x4597('0x1a')]?_[_0x4597('0x1b')](_0x52c3f2[_0x4597('0x1a')],function(_0x325106){return{'model':db[_0x325106[_0x4597('0x1c')]],'as':_0x325106['as'],'attributes':_0x325106[_0x4597('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4597('0xc')](function(_0x390ed5){logger[_0x4597('0xd')](_0x4597('0x1d'),_0x5c419d);logger['debug']('ShowSound',_0x5c419d,JSON['stringify'](_0x390ed5));_0x30af17(_0x390ed5);})[_0x4597('0x15')](function(_0x2f631d){logger[_0x4597('0x12')]('ShowSound',_0x2f631d[_0x4597('0x14')],_0x5c419d);_0x12a416(_0x5e4dcc['error'](0x1f4,_0x2f631d[_0x4597('0x14')]));});});}; \ No newline at end of file +var _0x35fa=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x4cdb94,_0x480fd8){var _0x595b52=function(_0x393256){while(--_0x393256){_0x4cdb94['push'](_0x4cdb94['shift']());}};_0x595b52(++_0x480fd8);}(_0x35fa,0x7f));var _0xa35f=function(_0x1ccf70,_0x1f6416){_0x1ccf70=_0x1ccf70-0x0;var _0x4a0de6=_0x35fa[_0x1ccf70];return _0x4a0de6;};'use strict';var _=require(_0xa35f('0x0'));var util=require(_0xa35f('0x1'));var moment=require(_0xa35f('0x2'));var BPromise=require(_0xa35f('0x3'));var rs=require(_0xa35f('0x4'));var fs=require('fs');var Redis=require(_0xa35f('0x5'));var db=require(_0xa35f('0x6'))['db'];var utils=require(_0xa35f('0x7'));var logger=require('../../config/logger')(_0xa35f('0x8'));var config=require(_0xa35f('0x9'));var jayson=require(_0xa35f('0xa'));var client=jayson[_0xa35f('0xb')][_0xa35f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4721db,_0x5e3fd7,_0x55c3b2){return new BPromise(function(_0x1b100a,_0x6f616){return client[_0xa35f('0xd')](_0x4721db,_0x55c3b2)[_0xa35f('0xe')](function(_0x348abf){logger[_0xa35f('0xf')](_0xa35f('0x10'),_0x5e3fd7,_0xa35f('0x11'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x5e3fd7,_0xa35f('0x11'),JSON[_0xa35f('0x12')](_0x348abf));if(_0x348abf[_0xa35f('0x13')]){if(_0x348abf[_0xa35f('0x13')]['code']===0x1f4){logger['error'](_0xa35f('0x10'),_0x5e3fd7,_0x348abf[_0xa35f('0x13')][_0xa35f('0x14')]);return _0x6f616(_0x348abf[_0xa35f('0x13')][_0xa35f('0x14')]);}logger[_0xa35f('0x13')](_0xa35f('0x10'),_0x5e3fd7,_0x348abf[_0xa35f('0x13')][_0xa35f('0x14')]);return _0x1b100a(_0x348abf[_0xa35f('0x13')][_0xa35f('0x14')]);}else{logger[_0xa35f('0xf')](_0xa35f('0x10'),_0x5e3fd7,_0xa35f('0x11'));_0x1b100a(_0x348abf[_0xa35f('0x15')][_0xa35f('0x14')]);}})[_0xa35f('0x16')](function(_0x592a44){logger[_0xa35f('0x13')](_0xa35f('0x10'),_0x5e3fd7,_0x592a44);_0x6f616(_0x592a44);});});}exports[_0xa35f('0x17')]=function(_0x2b6a31){var _0x548abb=this;return new Promise(function(_0x233cf3,_0x207978){return db[_0xa35f('0x18')]['find']({'raw':_0x2b6a31[_0xa35f('0x19')]?_0x2b6a31[_0xa35f('0x19')][_0xa35f('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b6a31[_0xa35f('0x19')]?_0x2b6a31[_0xa35f('0x19')][_0xa35f('0x1b')]||null:null,'attributes':_0x2b6a31['options']?_0x2b6a31['options'][_0xa35f('0x1c')]||null:null,'include':_0x2b6a31[_0xa35f('0x19')]?_0x2b6a31[_0xa35f('0x19')][_0xa35f('0x1d')]?_[_0xa35f('0x1e')](_0x2b6a31[_0xa35f('0x19')][_0xa35f('0x1d')],function(_0x464d70){return{'model':db[_0x464d70['model']],'as':_0x464d70['as'],'attributes':_0x464d70[_0xa35f('0x1c')],'include':_0x464d70['include']?_[_0xa35f('0x1e')](_0x464d70[_0xa35f('0x1d')],function(_0x240ca5){return{'model':db[_0x240ca5[_0xa35f('0x1f')]],'as':_0x240ca5['as'],'attributes':_0x240ca5[_0xa35f('0x1c')],'include':_0x240ca5['include']?_[_0xa35f('0x1e')](_0x240ca5[_0xa35f('0x1d')],function(_0x58dc0e){return{'model':db[_0x58dc0e[_0xa35f('0x1f')]],'as':_0x58dc0e['as'],'attributes':_0x58dc0e[_0xa35f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa35f('0xe')](function(_0x47356c){logger['info'](_0xa35f('0x17'),_0x2b6a31);logger[_0xa35f('0x20')](_0xa35f('0x17'),_0x2b6a31,JSON[_0xa35f('0x12')](_0x47356c));_0x233cf3(_0x47356c);})['catch'](function(_0x1d85b7){logger[_0xa35f('0x13')]('ShowSound',_0x1d85b7[_0xa35f('0x14')],_0x2b6a31);_0x207978(_0x548abb[_0xa35f('0x13')](0x1f4,_0x1d85b7[_0xa35f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 094d0e1..d2f70c5 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 _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x2ac42c,_0x400eff){var _0x29b7f3=function(_0x2f9606){while(--_0x2f9606){_0x2ac42c['push'](_0x2ac42c['shift']());}};_0x29b7f3(++_0x400eff);}(_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('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x45e60e,_0x529bef){var _0x5717a5=function(_0x38d070){while(--_0x38d070){_0x45e60e['push'](_0x45e60e['shift']());}};_0x5717a5(++_0x529bef);}(_0x2032,0xd9));var _0x2203=function(_0x3ffee5,_0x373510){_0x3ffee5=_0x3ffee5-0x0;var _0x314208=_0x2032[_0x3ffee5];return _0x314208;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 265b71b..972da7f 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 _0xb15d=['out','STRING','TEXT','medium'];(function(_0x4b40a7,_0x437ca5){var _0x4df86a=function(_0x30273c){while(--_0x30273c){_0x4b40a7['push'](_0x4b40a7['shift']());}};_0x4df86a(++_0x437ca5);}(_0xb15d,0x1ee));var _0xdb15=function(_0x322862,_0x4de478){_0x322862=_0x322862-0x0;var _0x28b369=_0xb15d[_0x322862];return _0x28b369;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xdb15('0x0')](_0xdb15('0x1')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xdb15('0x2')),'defaultValue':_0xdb15('0x2'),'allowNull':![]},'providerName':{'type':Sequelize[_0xdb15('0x3')]},'providerResponse':{'type':Sequelize[_0xdb15('0x0')]}}; \ No newline at end of file +var _0xe43e=['ENUM','out','sequelize','exports','STRING','TEXT','medium'];(function(_0x3fd60c,_0x23fb55){var _0x33d2ff=function(_0x39d0f9){while(--_0x39d0f9){_0x3fd60c['push'](_0x3fd60c['shift']());}};_0x33d2ff(++_0x23fb55);}(_0xe43e,0x18a));var _0xee43=function(_0xe79212,_0x37f1b9){_0xe79212=_0xe79212-0x0;var _0x508219=_0xe43e[_0xe79212];return _0x508219;};'use strict';var Sequelize=require(_0xee43('0x0'));module[_0xee43('0x1')]={'uniqueid':{'type':Sequelize[_0xee43('0x2')]},'body':{'type':Sequelize[_0xee43('0x3')](_0xee43('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xee43('0x5')]('in',_0xee43('0x6')),'defaultValue':_0xee43('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xee43('0x2')]},'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 f1b652a..6e26ff4 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 _0x07be=['crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','include','rows','catch','show','params','includeAll','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x54e74b,_0x3faf3c){var _0x30add6=function(_0x5e9a1a){while(--_0x5e9a1a){_0x54e74b['push'](_0x54e74b['shift']());}};_0x30add6(++_0x3faf3c);}(_0x07be,0x8a));var _0xe07b=function(_0x58d954,_0x4f9970){_0x58d954=_0x58d954-0x0;var _0x3f50da=_0x07be[_0x58d954];return _0x3f50da;};'use strict';var emlformat=require(_0xe07b('0x0'));var rimraf=require(_0xe07b('0x1'));var zipdir=require(_0xe07b('0x2'));var jsonpatch=require(_0xe07b('0x3'));var rp=require(_0xe07b('0x4'));var moment=require(_0xe07b('0x5'));var BPromise=require(_0xe07b('0x6'));var Mustache=require(_0xe07b('0x7'));var util=require('util');var path=require(_0xe07b('0x8'));var sox=require(_0xe07b('0x9'));var csv=require(_0xe07b('0xa'));var ejs=require(_0xe07b('0xb'));var fs=require('fs');var fs_extra=require(_0xe07b('0xc'));var _=require('lodash');var squel=require(_0xe07b('0xd'));var crypto=require(_0xe07b('0xe'));var jsforce=require(_0xe07b('0xf'));var deskjs=require(_0xe07b('0x10'));var toCsv=require(_0xe07b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe07b('0x11'));var authService=require(_0xe07b('0x12'));var qs=require(_0xe07b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe07b('0x14'));var logger=require(_0xe07b('0x15'))(_0xe07b('0x16'));var utils=require(_0xe07b('0x17'));var config=require(_0xe07b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe07b('0x19'))['db'];function respondWithStatusCode(_0x52b2aa,_0x2ba0e4){_0x2ba0e4=_0x2ba0e4||0xcc;return function(_0x211820){if(_0x211820){return _0x52b2aa['sendStatus'](_0x2ba0e4);}return _0x52b2aa[_0xe07b('0x1a')](_0x2ba0e4)[_0xe07b('0x1b')]();};}function respondWithResult(_0x24b712,_0x1f3300){_0x1f3300=_0x1f3300||0xc8;return function(_0x487b7d){if(_0x487b7d){return _0x24b712[_0xe07b('0x1a')](_0x1f3300)['json'](_0x487b7d);}};}function respondWithFilteredResult(_0x328d24,_0x247786){return function(_0x238df5){if(_0x238df5){var _0x2c7ef8=typeof _0x247786[_0xe07b('0x1c')]===_0xe07b('0x1d')&&typeof _0x247786[_0xe07b('0x1e')]==='undefined';var _0xd3f897=_0x238df5[_0xe07b('0x1f')];var _0x783d9e=_0x2c7ef8?0x0:_0x247786[_0xe07b('0x1c')];var _0xa7ef7b=_0x2c7ef8?_0x238df5[_0xe07b('0x1f')]:_0x247786[_0xe07b('0x1c')]+_0x247786[_0xe07b('0x1e')];var _0x442a97;if(_0xa7ef7b>=_0xd3f897){_0xa7ef7b=_0xd3f897;_0x442a97=0xc8;}else{_0x442a97=0xce;}_0x328d24[_0xe07b('0x1a')](_0x442a97);return _0x328d24[_0xe07b('0x20')](_0xe07b('0x21'),_0x783d9e+'-'+_0xa7ef7b+'/'+_0xd3f897)[_0xe07b('0x22')](_0x238df5);}return null;};}function patchUpdates(_0x2b14fc){return function(_0x179f14){try{jsonpatch[_0xe07b('0x23')](_0x179f14,_0x2b14fc,!![]);}catch(_0x2fd8f5){return BPromise[_0xe07b('0x24')](_0x2fd8f5);}return _0x179f14[_0xe07b('0x25')]();};}function saveUpdates(_0xa72082,_0x455674){return function(_0xafb2c0){if(_0xafb2c0){return _0xafb2c0[_0xe07b('0x26')](_0xa72082)[_0xe07b('0x27')](function(_0x2be22c){return _0x2be22c;});}return null;};}function removeEntity(_0x1477e7,_0x281268){return function(_0x113bb1){if(_0x113bb1){return _0x113bb1['destroy']()[_0xe07b('0x27')](function(){_0x1477e7[_0xe07b('0x1a')](0xcc)[_0xe07b('0x1b')]();});}};}function handleEntityNotFound(_0x42ff2f,_0x2af3c5){return function(_0x7827b8){if(!_0x7827b8){_0x42ff2f['sendStatus'](0x194);}return _0x7827b8;};}function handleError(_0x4c3279,_0x14da9e){_0x14da9e=_0x14da9e||0x1f4;return function(_0x822822){logger[_0xe07b('0x28')](_0x822822['stack']);if(_0x822822[_0xe07b('0x29')]){delete _0x822822['name'];}_0x4c3279['status'](_0x14da9e)[_0xe07b('0x2a')](_0x822822);};}exports['index']=function(_0x2f4ede,_0x5dff6c){var _0x23df60={},_0x53927b={},_0x26bedb={'count':0x0,'rows':[]};var _0x6abc34=_[_0xe07b('0x2b')](db[_0xe07b('0x2c')][_0xe07b('0x2d')],function(_0x2a24f4){return{'name':_0x2a24f4[_0xe07b('0x2e')],'type':_0x2a24f4[_0xe07b('0x2f')][_0xe07b('0x30')]};});_0x53927b['model']=_[_0xe07b('0x2b')](_0x6abc34,'name');_0x53927b['query']=_[_0xe07b('0x31')](_0x2f4ede[_0xe07b('0x32')]);_0x53927b['filters']=_[_0xe07b('0x33')](_0x53927b[_0xe07b('0x34')],_0x53927b[_0xe07b('0x32')]);_0x23df60[_0xe07b('0x35')]=_[_0xe07b('0x33')](_0x53927b[_0xe07b('0x34')],qs[_0xe07b('0x36')](_0x2f4ede[_0xe07b('0x32')][_0xe07b('0x36')]));_0x23df60[_0xe07b('0x35')]=_0x23df60[_0xe07b('0x35')][_0xe07b('0x37')]?_0x23df60['attributes']:_0x53927b[_0xe07b('0x34')];if(!_0x2f4ede[_0xe07b('0x32')][_0xe07b('0x38')](_0xe07b('0x39'))){_0x23df60[_0xe07b('0x1e')]=qs[_0xe07b('0x1e')](_0x2f4ede[_0xe07b('0x32')]['limit']);_0x23df60['offset']=qs['offset'](_0x2f4ede[_0xe07b('0x32')][_0xe07b('0x1c')]);}_0x23df60['order']=qs[_0xe07b('0x3a')](_0x2f4ede[_0xe07b('0x32')]['sort']);_0x23df60['where']=qs[_0xe07b('0x3b')](_[_0xe07b('0x3c')](_0x2f4ede[_0xe07b('0x32')],_0x53927b[_0xe07b('0x3b')]),_0x6abc34);if(_0x2f4ede[_0xe07b('0x32')][_0xe07b('0x3d')]){_0x23df60[_0xe07b('0x3e')]=_['merge'](_0x23df60[_0xe07b('0x3e')],{'$or':_[_0xe07b('0x2b')](_0x6abc34,function(_0x43bba5){if(_0x43bba5['type']!==_0xe07b('0x3f')){var _0x4c7cbd={};_0x4c7cbd[_0x43bba5[_0xe07b('0x29')]]={'$like':'%'+_0x2f4ede['query'][_0xe07b('0x3d')]+'%'};return _0x4c7cbd;}})});}_0x23df60=_[_0xe07b('0x40')]({},_0x23df60,_0x2f4ede['options']);var _0x52f526={'where':_0x23df60[_0xe07b('0x3e')]};return db['SquareMessage']['count'](_0x52f526)[_0xe07b('0x27')](function(_0x17f8dc){_0x26bedb[_0xe07b('0x1f')]=_0x17f8dc;if(_0x2f4ede[_0xe07b('0x32')]['includeAll']){_0x23df60[_0xe07b('0x41')]=[{'all':!![]}];}return db[_0xe07b('0x2c')]['findAll'](_0x23df60);})[_0xe07b('0x27')](function(_0x203274){_0x26bedb[_0xe07b('0x42')]=_0x203274;return _0x26bedb;})[_0xe07b('0x27')](respondWithFilteredResult(_0x5dff6c,_0x23df60))[_0xe07b('0x43')](handleError(_0x5dff6c,null));};exports[_0xe07b('0x44')]=function(_0x1d28da,_0x42db4f){var _0x401daf={'raw':!![],'where':{'id':_0x1d28da[_0xe07b('0x45')]['id']}},_0x17526f={};_0x17526f[_0xe07b('0x34')]=_[_0xe07b('0x31')](db[_0xe07b('0x2c')][_0xe07b('0x2d')]);_0x17526f[_0xe07b('0x32')]=_[_0xe07b('0x31')](_0x1d28da['query']);_0x17526f[_0xe07b('0x3b')]=_[_0xe07b('0x33')](_0x17526f[_0xe07b('0x34')],_0x17526f[_0xe07b('0x32')]);_0x401daf[_0xe07b('0x35')]=_[_0xe07b('0x33')](_0x17526f[_0xe07b('0x34')],qs['fields'](_0x1d28da[_0xe07b('0x32')][_0xe07b('0x36')]));_0x401daf[_0xe07b('0x35')]=_0x401daf[_0xe07b('0x35')]['length']?_0x401daf[_0xe07b('0x35')]:_0x17526f[_0xe07b('0x34')];if(_0x1d28da['query'][_0xe07b('0x46')]){_0x401daf['include']=[{'all':!![]}];}_0x401daf=_['merge']({},_0x401daf,_0x1d28da[_0xe07b('0x47')]);return db['SquareMessage'][_0xe07b('0x48')](_0x401daf)[_0xe07b('0x27')](handleEntityNotFound(_0x42db4f,null))[_0xe07b('0x27')](respondWithResult(_0x42db4f,null))[_0xe07b('0x43')](handleError(_0x42db4f,null));};exports[_0xe07b('0x49')]=function(_0x5d8830,_0x3688a5){return db[_0xe07b('0x2c')]['create'](_0x5d8830[_0xe07b('0x4a')],{})['then'](respondWithResult(_0x3688a5,0xc9))[_0xe07b('0x43')](handleError(_0x3688a5,null));};exports[_0xe07b('0x26')]=function(_0x11a5c7,_0x30dea8){if(_0x11a5c7['body']['id']){delete _0x11a5c7[_0xe07b('0x4a')]['id'];}return db[_0xe07b('0x2c')][_0xe07b('0x48')]({'where':{'id':_0x11a5c7[_0xe07b('0x45')]['id']}})[_0xe07b('0x27')](handleEntityNotFound(_0x30dea8,null))[_0xe07b('0x27')](saveUpdates(_0x11a5c7[_0xe07b('0x4a')],null))[_0xe07b('0x27')](respondWithResult(_0x30dea8,null))[_0xe07b('0x43')](handleError(_0x30dea8,null));};exports[_0xe07b('0x4b')]=function(_0x1af23d,_0x4db8d2){return db['SquareMessage'][_0xe07b('0x48')]({'where':{'id':_0x1af23d['params']['id']}})[_0xe07b('0x27')](handleEntityNotFound(_0x4db8d2,null))[_0xe07b('0x27')](removeEntity(_0x4db8d2,null))[_0xe07b('0x43')](handleError(_0x4db8d2,null));}; \ No newline at end of file +var _0x18a6=['body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','update','destroy','then','end','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','SquareMessage','includeAll','findAll','rows','catch','show','params','include','find','create'];(function(_0x30c53c,_0x1c93f4){var _0x42500f=function(_0x1ba019){while(--_0x1ba019){_0x30c53c['push'](_0x30c53c['shift']());}};_0x42500f(++_0x1c93f4);}(_0x18a6,0x1c9));var _0x618a=function(_0xbedd5f,_0x10bc19){_0xbedd5f=_0xbedd5f-0x0;var _0x3344b4=_0x18a6[_0xbedd5f];return _0x3344b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x618a('0x0'));var zipdir=require(_0x618a('0x1'));var jsonpatch=require(_0x618a('0x2'));var rp=require(_0x618a('0x3'));var moment=require(_0x618a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x618a('0x5'));var util=require(_0x618a('0x6'));var path=require(_0x618a('0x7'));var sox=require(_0x618a('0x8'));var csv=require(_0x618a('0x9'));var ejs=require(_0x618a('0xa'));var fs=require('fs');var fs_extra=require(_0x618a('0xb'));var _=require(_0x618a('0xc'));var squel=require(_0x618a('0xd'));var crypto=require('crypto');var jsforce=require(_0x618a('0xe'));var deskjs=require(_0x618a('0xf'));var toCsv=require(_0x618a('0x9'));var querystring=require(_0x618a('0x10'));var Papa=require(_0x618a('0x11'));var Redis=require('ioredis');var authService=require(_0x618a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x618a('0x13'));var hardwareService=require(_0x618a('0x14'));var logger=require(_0x618a('0x15'))(_0x618a('0x16'));var utils=require('../../config/utils');var config=require(_0x618a('0x17'));var licenseUtil=require(_0x618a('0x18'));var db=require(_0x618a('0x19'))['db'];function respondWithStatusCode(_0x2861fb,_0x1f5ebe){_0x1f5ebe=_0x1f5ebe||0xcc;return function(_0x28bb2f){if(_0x28bb2f){return _0x2861fb[_0x618a('0x1a')](_0x1f5ebe);}return _0x2861fb[_0x618a('0x1b')](_0x1f5ebe)['end']();};}function respondWithResult(_0x594b8e,_0x4c7923){_0x4c7923=_0x4c7923||0xc8;return function(_0x34f2ac){if(_0x34f2ac){return _0x594b8e['status'](_0x4c7923)[_0x618a('0x1c')](_0x34f2ac);}};}function respondWithFilteredResult(_0x26e379,_0x2a04e9){return function(_0x576e56){if(_0x576e56){var _0x3e17cd=typeof _0x2a04e9[_0x618a('0x1d')]==='undefined'&&typeof _0x2a04e9[_0x618a('0x1e')]===_0x618a('0x1f');var _0x1c056f=_0x576e56[_0x618a('0x20')];var _0x35b13e=_0x3e17cd?0x0:_0x2a04e9[_0x618a('0x1d')];var _0x469ffd=_0x3e17cd?_0x576e56[_0x618a('0x20')]:_0x2a04e9[_0x618a('0x1d')]+_0x2a04e9['limit'];var _0x89aba0;if(_0x469ffd>=_0x1c056f){_0x469ffd=_0x1c056f;_0x89aba0=0xc8;}else{_0x89aba0=0xce;}_0x26e379[_0x618a('0x1b')](_0x89aba0);return _0x26e379['set'](_0x618a('0x21'),_0x35b13e+'-'+_0x469ffd+'/'+_0x1c056f)['json'](_0x576e56);}return null;};}function patchUpdates(_0x246349){return function(_0x4e50b3){try{jsonpatch[_0x618a('0x22')](_0x4e50b3,_0x246349,!![]);}catch(_0xaecf23){return BPromise['reject'](_0xaecf23);}return _0x4e50b3['save']();};}function saveUpdates(_0x3381df,_0x96031){return function(_0x4f3293){if(_0x4f3293){return _0x4f3293[_0x618a('0x23')](_0x3381df)['then'](function(_0x245e6f){return _0x245e6f;});}return null;};}function removeEntity(_0x45e0f9,_0x3175dc){return function(_0x5a462a){if(_0x5a462a){return _0x5a462a[_0x618a('0x24')]()[_0x618a('0x25')](function(){_0x45e0f9['status'](0xcc)[_0x618a('0x26')]();});}};}function handleEntityNotFound(_0x1da2a9,_0x17164c){return function(_0x3986f3){if(!_0x3986f3){_0x1da2a9[_0x618a('0x1a')](0x194);}return _0x3986f3;};}function handleError(_0x2a38b1,_0x1e88f3){_0x1e88f3=_0x1e88f3||0x1f4;return function(_0x12074e){logger['error'](_0x12074e['stack']);if(_0x12074e[_0x618a('0x27')]){delete _0x12074e['name'];}_0x2a38b1[_0x618a('0x1b')](_0x1e88f3)[_0x618a('0x28')](_0x12074e);};}exports[_0x618a('0x29')]=function(_0x1582aa,_0x4e3a17){var _0x2b7066={},_0x4f3aa2={},_0x69a697={'count':0x0,'rows':[]};var _0x4abb30=_[_0x618a('0x2a')](db['SquareMessage'][_0x618a('0x2b')],function(_0xc1fb12){return{'name':_0xc1fb12[_0x618a('0x2c')],'type':_0xc1fb12['type'][_0x618a('0x2d')]};});_0x4f3aa2[_0x618a('0x2e')]=_[_0x618a('0x2a')](_0x4abb30,'name');_0x4f3aa2[_0x618a('0x2f')]=_[_0x618a('0x30')](_0x1582aa[_0x618a('0x2f')]);_0x4f3aa2['filters']=_[_0x618a('0x31')](_0x4f3aa2['model'],_0x4f3aa2[_0x618a('0x2f')]);_0x2b7066[_0x618a('0x32')]=_[_0x618a('0x31')](_0x4f3aa2[_0x618a('0x2e')],qs['fields'](_0x1582aa[_0x618a('0x2f')][_0x618a('0x33')]));_0x2b7066[_0x618a('0x32')]=_0x2b7066[_0x618a('0x32')][_0x618a('0x34')]?_0x2b7066[_0x618a('0x32')]:_0x4f3aa2[_0x618a('0x2e')];if(!_0x1582aa[_0x618a('0x2f')][_0x618a('0x35')](_0x618a('0x36'))){_0x2b7066['limit']=qs[_0x618a('0x1e')](_0x1582aa[_0x618a('0x2f')][_0x618a('0x1e')]);_0x2b7066[_0x618a('0x1d')]=qs[_0x618a('0x1d')](_0x1582aa['query'][_0x618a('0x1d')]);}_0x2b7066[_0x618a('0x37')]=qs[_0x618a('0x38')](_0x1582aa[_0x618a('0x2f')][_0x618a('0x38')]);_0x2b7066[_0x618a('0x39')]=qs[_0x618a('0x3a')](_[_0x618a('0x3b')](_0x1582aa[_0x618a('0x2f')],_0x4f3aa2[_0x618a('0x3a')]),_0x4abb30);if(_0x1582aa[_0x618a('0x2f')][_0x618a('0x3c')]){_0x2b7066[_0x618a('0x39')]=_[_0x618a('0x3d')](_0x2b7066[_0x618a('0x39')],{'$or':_[_0x618a('0x2a')](_0x4abb30,function(_0x2a4bf5){if(_0x2a4bf5[_0x618a('0x3e')]!==_0x618a('0x3f')){var _0x2d26ea={};_0x2d26ea[_0x2a4bf5[_0x618a('0x27')]]={'$like':'%'+_0x1582aa[_0x618a('0x2f')][_0x618a('0x3c')]+'%'};return _0x2d26ea;}})});}_0x2b7066=_['merge']({},_0x2b7066,_0x1582aa[_0x618a('0x40')]);var _0x2ebec0={'where':_0x2b7066[_0x618a('0x39')]};return db[_0x618a('0x41')][_0x618a('0x20')](_0x2ebec0)[_0x618a('0x25')](function(_0x3fb29b){_0x69a697[_0x618a('0x20')]=_0x3fb29b;if(_0x1582aa['query'][_0x618a('0x42')]){_0x2b7066['include']=[{'all':!![]}];}return db[_0x618a('0x41')][_0x618a('0x43')](_0x2b7066);})[_0x618a('0x25')](function(_0x22164a){_0x69a697[_0x618a('0x44')]=_0x22164a;return _0x69a697;})['then'](respondWithFilteredResult(_0x4e3a17,_0x2b7066))[_0x618a('0x45')](handleError(_0x4e3a17,null));};exports[_0x618a('0x46')]=function(_0x45285e,_0x110e25){var _0x5eca01={'raw':!![],'where':{'id':_0x45285e[_0x618a('0x47')]['id']}},_0x40132e={};_0x40132e[_0x618a('0x2e')]=_[_0x618a('0x30')](db[_0x618a('0x41')][_0x618a('0x2b')]);_0x40132e[_0x618a('0x2f')]=_[_0x618a('0x30')](_0x45285e[_0x618a('0x2f')]);_0x40132e[_0x618a('0x3a')]=_[_0x618a('0x31')](_0x40132e[_0x618a('0x2e')],_0x40132e[_0x618a('0x2f')]);_0x5eca01[_0x618a('0x32')]=_[_0x618a('0x31')](_0x40132e[_0x618a('0x2e')],qs['fields'](_0x45285e[_0x618a('0x2f')][_0x618a('0x33')]));_0x5eca01[_0x618a('0x32')]=_0x5eca01['attributes'][_0x618a('0x34')]?_0x5eca01[_0x618a('0x32')]:_0x40132e['model'];if(_0x45285e[_0x618a('0x2f')][_0x618a('0x42')]){_0x5eca01[_0x618a('0x48')]=[{'all':!![]}];}_0x5eca01=_[_0x618a('0x3d')]({},_0x5eca01,_0x45285e[_0x618a('0x40')]);return db[_0x618a('0x41')][_0x618a('0x49')](_0x5eca01)[_0x618a('0x25')](handleEntityNotFound(_0x110e25,null))[_0x618a('0x25')](respondWithResult(_0x110e25,null))['catch'](handleError(_0x110e25,null));};exports[_0x618a('0x4a')]=function(_0x326e43,_0x597288){return db[_0x618a('0x41')][_0x618a('0x4a')](_0x326e43[_0x618a('0x4b')],{})[_0x618a('0x25')](respondWithResult(_0x597288,0xc9))[_0x618a('0x45')](handleError(_0x597288,null));};exports['update']=function(_0x571086,_0x4d8be3){if(_0x571086['body']['id']){delete _0x571086['body']['id'];}return db[_0x618a('0x41')][_0x618a('0x49')]({'where':{'id':_0x571086['params']['id']}})['then'](handleEntityNotFound(_0x4d8be3,null))[_0x618a('0x25')](saveUpdates(_0x571086[_0x618a('0x4b')],null))[_0x618a('0x25')](respondWithResult(_0x4d8be3,null))[_0x618a('0x45')](handleError(_0x4d8be3,null));};exports[_0x618a('0x24')]=function(_0x387022,_0x5ba7ac){return db[_0x618a('0x41')][_0x618a('0x49')]({'where':{'id':_0x387022['params']['id']}})[_0x618a('0x25')](handleEntityNotFound(_0x5ba7ac,null))[_0x618a('0x25')](removeEntity(_0x5ba7ac,null))[_0x618a('0x45')](handleError(_0x5ba7ac,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 4266278..e85383a 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 _0x5dda=['rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5dda,0x94));var _0xa5dd=function(_0x5bd665,_0x3838f2){_0x5bd665=_0x5bd665-0x0;var _0x31fde9=_0x5dda[_0x5bd665];return _0x31fde9;};'use strict';var _=require(_0xa5dd('0x0'));var util=require(_0xa5dd('0x1'));var logger=require(_0xa5dd('0x2'))(_0xa5dd('0x3'));var moment=require(_0xa5dd('0x4'));var BPromise=require(_0xa5dd('0x5'));var rp=require(_0xa5dd('0x6'));var fs=require('fs');var path=require(_0xa5dd('0x7'));var rimraf=require(_0xa5dd('0x8'));var config=require(_0xa5dd('0x9'));var attributes=require(_0xa5dd('0xa'));module[_0xa5dd('0xb')]=function(_0x258b19,_0xf7068e){return _0x258b19['define'](_0xa5dd('0xc'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8bb=['exports','define','SquareMessage','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3ed9ed,_0x5841b0){var _0x4e9106=function(_0x20949b){while(--_0x20949b){_0x3ed9ed['push'](_0x3ed9ed['shift']());}};_0x4e9106(++_0x5841b0);}(_0xa8bb,0xc3));var _0xba8b=function(_0x3728ff,_0x345d4f){_0x3728ff=_0x3728ff-0x0;var _0x11a810=_0xa8bb[_0x3728ff];return _0x11a810;};'use strict';var _=require(_0xba8b('0x0'));var util=require(_0xba8b('0x1'));var logger=require(_0xba8b('0x2'))(_0xba8b('0x3'));var moment=require(_0xba8b('0x4'));var BPromise=require('bluebird');var rp=require(_0xba8b('0x5'));var fs=require('fs');var path=require(_0xba8b('0x6'));var rimraf=require(_0xba8b('0x7'));var config=require(_0xba8b('0x8'));var attributes=require('./squareMessage.attributes');module[_0xba8b('0x9')]=function(_0x187556,_0x3cf61b){return _0x187556[_0xba8b('0xa')](_0xba8b('0xb'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 336c9c4..b2fc27e 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 _0x6b45=['SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','error'];(function(_0x1bc4d7,_0x27fbab){var _0x307cb6=function(_0x43854){while(--_0x43854){_0x1bc4d7['push'](_0x1bc4d7['shift']());}};_0x307cb6(++_0x27fbab);}(_0x6b45,0x169));var _0x56b4=function(_0x3b5226,_0x496a84){_0x3b5226=_0x3b5226-0x0;var _0x3a13d1=_0x6b45[_0x3b5226];return _0x3a13d1;};'use strict';var _=require(_0x56b4('0x0'));var util=require(_0x56b4('0x1'));var moment=require(_0x56b4('0x2'));var BPromise=require(_0x56b4('0x3'));var rs=require(_0x56b4('0x4'));var fs=require('fs');var Redis=require(_0x56b4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x56b4('0x6'))(_0x56b4('0x7'));var config=require(_0x56b4('0x8'));var jayson=require(_0x56b4('0x9'));var client=jayson['client'][_0x56b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe962a,_0x5b65f3,_0x41409b){return new BPromise(function(_0x449c24,_0x3cd49b){return client[_0x56b4('0xb')](_0xe962a,_0x41409b)[_0x56b4('0xc')](function(_0x4c1274){logger[_0x56b4('0xd')]('SquareMessage,\x20%s,\x20%s',_0x5b65f3,_0x56b4('0xe'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x5b65f3,_0x56b4('0xe'),JSON[_0x56b4('0xf')](_0x4c1274));if(_0x4c1274[_0x56b4('0x10')]){if(_0x4c1274['error']['code']===0x1f4){logger[_0x56b4('0x10')](_0x56b4('0x11'),_0x5b65f3,_0x4c1274[_0x56b4('0x10')][_0x56b4('0x12')]);return _0x3cd49b(_0x4c1274[_0x56b4('0x10')][_0x56b4('0x12')]);}logger['error'](_0x56b4('0x11'),_0x5b65f3,_0x4c1274[_0x56b4('0x10')][_0x56b4('0x12')]);return _0x449c24(_0x4c1274['error'][_0x56b4('0x12')]);}else{logger['info'](_0x56b4('0x11'),_0x5b65f3,'request\x20sent');_0x449c24(_0x4c1274[_0x56b4('0x13')][_0x56b4('0x12')]);}})[_0x56b4('0x14')](function(_0x12edb9){logger[_0x56b4('0x10')](_0x56b4('0x11'),_0x5b65f3,_0x12edb9);_0x3cd49b(_0x12edb9);});});}exports[_0x56b4('0x15')]=function(_0x2c3164){var _0x3f4b81=this;return new Promise(function(_0xf6b42e,_0x5d2b13){return db[_0x56b4('0x16')][_0x56b4('0x17')](_0x2c3164[_0x56b4('0x18')],{'raw':_0x2c3164['options']?_0x2c3164[_0x56b4('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x56b4('0xc')](function(_0xa2cc3e){logger[_0x56b4('0xd')](_0x56b4('0x15'),_0x2c3164);logger[_0x56b4('0x1a')](_0x56b4('0x15'),_0x2c3164,JSON[_0x56b4('0xf')](_0xa2cc3e));_0xf6b42e(_0xa2cc3e);})[_0x56b4('0x14')](function(_0x12e0bd){logger[_0x56b4('0x10')](_0x56b4('0x15'),_0x12e0bd[_0x56b4('0x12')],_0x2c3164);_0x5d2b13(_0x3f4b81[_0x56b4('0x10')](0x1f4,_0x12e0bd[_0x56b4('0x12')]));});});}; \ No newline at end of file +var _0x8fe0=['code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x8fe0,0x1dd));var _0x08fe=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8fe0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x08fe('0x0'));var util=require('util');var moment=require(_0x08fe('0x1'));var BPromise=require(_0x08fe('0x2'));var rs=require(_0x08fe('0x3'));var fs=require('fs');var Redis=require(_0x08fe('0x4'));var db=require(_0x08fe('0x5'))['db'];var utils=require(_0x08fe('0x6'));var logger=require(_0x08fe('0x7'))('rpc');var config=require(_0x08fe('0x8'));var jayson=require(_0x08fe('0x9'));var client=jayson[_0x08fe('0xa')][_0x08fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cafc3,_0x4c501c,_0x2900fc){return new BPromise(function(_0xb8bb4e,_0x194f72){return client[_0x08fe('0xc')](_0x2cafc3,_0x2900fc)[_0x08fe('0xd')](function(_0x5990e9){logger[_0x08fe('0xe')]('SquareMessage,\x20%s,\x20%s',_0x4c501c,_0x08fe('0xf'));logger[_0x08fe('0x10')](_0x08fe('0x11'),_0x4c501c,_0x08fe('0xf'),JSON['stringify'](_0x5990e9));if(_0x5990e9[_0x08fe('0x12')]){if(_0x5990e9[_0x08fe('0x12')][_0x08fe('0x13')]===0x1f4){logger[_0x08fe('0x12')](_0x08fe('0x14'),_0x4c501c,_0x5990e9[_0x08fe('0x12')][_0x08fe('0x15')]);return _0x194f72(_0x5990e9[_0x08fe('0x12')][_0x08fe('0x15')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x4c501c,_0x5990e9[_0x08fe('0x12')][_0x08fe('0x15')]);return _0xb8bb4e(_0x5990e9[_0x08fe('0x12')][_0x08fe('0x15')]);}else{logger['info'](_0x08fe('0x14'),_0x4c501c,_0x08fe('0xf'));_0xb8bb4e(_0x5990e9[_0x08fe('0x16')]['message']);}})[_0x08fe('0x17')](function(_0x138437){logger[_0x08fe('0x12')](_0x08fe('0x14'),_0x4c501c,_0x138437);_0x194f72(_0x138437);});});}exports[_0x08fe('0x18')]=function(_0x30d565){var _0x1472dc=this;return new Promise(function(_0x252e90,_0x5ecba9){return db[_0x08fe('0x19')][_0x08fe('0x1a')](_0x30d565[_0x08fe('0x1b')],{'raw':_0x30d565[_0x08fe('0x1c')]?_0x30d565[_0x08fe('0x1c')][_0x08fe('0x1d')]===undefined?!![]:![]:!![]})[_0x08fe('0xd')](function(_0x1828de){logger[_0x08fe('0xe')](_0x08fe('0x18'),_0x30d565);logger[_0x08fe('0x10')](_0x08fe('0x18'),_0x30d565,JSON[_0x08fe('0x1e')](_0x1828de));_0x252e90(_0x1828de);})[_0x08fe('0x17')](function(_0x4c56e6){logger[_0x08fe('0x12')](_0x08fe('0x18'),_0x4c56e6[_0x08fe('0x15')],_0x30d565);_0x5ecba9(_0x1472dc['error'](0x1f4,_0x4c56e6[_0x08fe('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 2df6451..1038edb 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 _0x2621=['delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','/:id','show','get','/:id/test','15s','test','create','put','update'];(function(_0x37aeb4,_0x42ab87){var _0x264a13=function(_0x5233e7){while(--_0x5233e7){_0x37aeb4['push'](_0x37aeb4['shift']());}};_0x264a13(++_0x42ab87);}(_0x2621,0x1ba));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1262('0x0'));var util=require('util');var path=require(_0x1262('0x1'));var timeout=require(_0x1262('0x2'));var express=require(_0x1262('0x3'));var router=express[_0x1262('0x4')]();var fs_extra=require(_0x1262('0x5'));var auth=require(_0x1262('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1262('0x7'));var controller=require(_0x1262('0x8'));router['get']('/',auth[_0x1262('0x9')](),controller[_0x1262('0xa')]);router['get'](_0x1262('0xb'),auth[_0x1262('0x9')](),controller[_0x1262('0xc')]);router[_0x1262('0xd')](_0x1262('0xe'),auth['isAuthenticated'](),timeout(_0x1262('0xf')),controller[_0x1262('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1262('0x11')]);router[_0x1262('0x12')](_0x1262('0xb'),auth['isAuthenticated'](),controller[_0x1262('0x13')]);router[_0x1262('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf166=['isAuthenticated','show','/:id/test','15s','test','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','index','/:id'];(function(_0x3d72c1,_0x3d64f5){var _0x36e748=function(_0x4cf06d){while(--_0x4cf06d){_0x3d72c1['push'](_0x3d72c1['shift']());}};_0x36e748(++_0x3d64f5);}(_0xf166,0xf2));var _0x6f16=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf166[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x6f16('0x0'));var util=require(_0x6f16('0x1'));var path=require(_0x6f16('0x2'));var timeout=require(_0x6f16('0x3'));var express=require(_0x6f16('0x4'));var router=express[_0x6f16('0x5')]();var fs_extra=require(_0x6f16('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f16('0x7'));var controller=require('./squareOdbc.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6f16('0x8')]);router['get'](_0x6f16('0x9'),auth[_0x6f16('0xa')](),controller[_0x6f16('0xb')]);router['get'](_0x6f16('0xc'),auth['isAuthenticated'](),timeout(_0x6f16('0xd')),controller[_0x6f16('0xe')]);router[_0x6f16('0xf')]('/',auth['isAuthenticated'](),controller[_0x6f16('0x10')]);router[_0x6f16('0x11')]('/:id',auth[_0x6f16('0xa')](),controller['update']);router[_0x6f16('0x12')]('/:id',auth[_0x6f16('0xa')](),controller[_0x6f16('0x13')]);module[_0x6f16('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 4cee00f..5bf7939 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 _0x49d2=['STRING','name','exports'];(function(_0x328bf7,_0x3d7985){var _0x14cff7=function(_0x1f0eee){while(--_0x1f0eee){_0x328bf7['push'](_0x328bf7['shift']());}};_0x14cff7(++_0x3d7985);}(_0x49d2,0x1dc));var _0x249d=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x49d2[_0xef4cf0];return _0x497ad2;};'use strict';var Sequelize=require('sequelize');module[_0x249d('0x0')]={'name':{'type':Sequelize[_0x249d('0x1')],'unique':_0x249d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x249d('0x1')]},'description':{'type':Sequelize[_0x249d('0x1')]}}; \ No newline at end of file +var _0x221b=['name','exports','STRING'];(function(_0x5c7cf1,_0x2a3502){var _0x1bed4a=function(_0x2e9324){while(--_0x2e9324){_0x5c7cf1['push'](_0x5c7cf1['shift']());}};_0x1bed4a(++_0x2a3502);}(_0x221b,0x199));var _0xb221=function(_0x1b85fe,_0x1b8b6b){_0x1b85fe=_0x1b85fe-0x0;var _0x50d28a=_0x221b[_0x1b85fe];return _0x50d28a;};'use strict';var Sequelize=require('sequelize');module[_0xb221('0x0')]={'name':{'type':Sequelize[_0xb221('0x1')],'unique':_0xb221('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xb221('0x1')]},'description':{'type':Sequelize[_0xb221('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 9babdc8..17401d1 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 _0xc2e6=['type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','intersection','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','end','json','offset','limit','count','set','Content-Range','apply','save','then','get','ODBC','destroy','error','stack','name','send','index','SquareOdbc','fieldName'];(function(_0x3b6e69,_0x47ecc4){var _0x19c90a=function(_0x1a1a96){while(--_0x1a1a96){_0x3b6e69['push'](_0x3b6e69['shift']());}};_0x19c90a(++_0x47ecc4);}(_0xc2e6,0xdc));var _0x6c2e=function(_0x336719,_0x473ce0){_0x336719=_0x336719-0x0;var _0x53a9b4=_0xc2e6[_0x336719];return _0x53a9b4;};'use strict';var emlformat=require(_0x6c2e('0x0'));var rimraf=require(_0x6c2e('0x1'));var zipdir=require(_0x6c2e('0x2'));var jsonpatch=require(_0x6c2e('0x3'));var rp=require(_0x6c2e('0x4'));var moment=require(_0x6c2e('0x5'));var BPromise=require(_0x6c2e('0x6'));var Mustache=require(_0x6c2e('0x7'));var util=require(_0x6c2e('0x8'));var path=require(_0x6c2e('0x9'));var sox=require(_0x6c2e('0xa'));var csv=require(_0x6c2e('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c2e('0xc'));var _=require(_0x6c2e('0xd'));var squel=require(_0x6c2e('0xe'));var crypto=require(_0x6c2e('0xf'));var jsforce=require(_0x6c2e('0x10'));var deskjs=require(_0x6c2e('0x11'));var toCsv=require(_0x6c2e('0xb'));var querystring=require('querystring');var Papa=require(_0x6c2e('0x12'));var Redis=require('ioredis');var authService=require(_0x6c2e('0x13'));var qs=require(_0x6c2e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c2e('0x15'));var logger=require(_0x6c2e('0x16'))(_0x6c2e('0x17'));var utils=require(_0x6c2e('0x18'));var config=require(_0x6c2e('0x19'));var licenseUtil=require(_0x6c2e('0x1a'));var db=require(_0x6c2e('0x1b'))['db'];function respondWithStatusCode(_0x3f7b3e,_0x10cf44){_0x10cf44=_0x10cf44||0xcc;return function(_0x2bcf81){if(_0x2bcf81){return _0x3f7b3e[_0x6c2e('0x1c')](_0x10cf44);}return _0x3f7b3e[_0x6c2e('0x1d')](_0x10cf44)[_0x6c2e('0x1e')]();};}function respondWithResult(_0x3758e1,_0xf7b82b){_0xf7b82b=_0xf7b82b||0xc8;return function(_0x5c3b94){if(_0x5c3b94){return _0x3758e1[_0x6c2e('0x1d')](_0xf7b82b)[_0x6c2e('0x1f')](_0x5c3b94);}};}function respondWithFilteredResult(_0x4dba7a,_0x369a0c){return function(_0x2907df){if(_0x2907df){var _0x2907a5=typeof _0x369a0c[_0x6c2e('0x20')]==='undefined'&&typeof _0x369a0c[_0x6c2e('0x21')]==='undefined';var _0x2cf8ab=_0x2907df[_0x6c2e('0x22')];var _0x4c4fac=_0x2907a5?0x0:_0x369a0c[_0x6c2e('0x20')];var _0x340ad9=_0x2907a5?_0x2907df[_0x6c2e('0x22')]:_0x369a0c[_0x6c2e('0x20')]+_0x369a0c[_0x6c2e('0x21')];var _0x49eef2;if(_0x340ad9>=_0x2cf8ab){_0x340ad9=_0x2cf8ab;_0x49eef2=0xc8;}else{_0x49eef2=0xce;}_0x4dba7a[_0x6c2e('0x1d')](_0x49eef2);return _0x4dba7a[_0x6c2e('0x23')](_0x6c2e('0x24'),_0x4c4fac+'-'+_0x340ad9+'/'+_0x2cf8ab)[_0x6c2e('0x1f')](_0x2907df);}return null;};}function patchUpdates(_0x398597){return function(_0x254875){try{jsonpatch[_0x6c2e('0x25')](_0x254875,_0x398597,!![]);}catch(_0x3de107){return BPromise['reject'](_0x3de107);}return _0x254875[_0x6c2e('0x26')]();};}function saveUpdates(_0x5915d2,_0x4e45d7){return function(_0x313c7d){if(_0x313c7d){return _0x313c7d['update'](_0x5915d2)[_0x6c2e('0x27')](function(_0x23d2dc){return _0x23d2dc;});}return null;};}function removeEntity(_0x12b680,_0x4f29ef){return function(_0x1d8109){if(_0x1d8109){return _0x1d8109['destroy']()[_0x6c2e('0x27')](function(){var _0x418e66=_0x1d8109[_0x6c2e('0x28')]({'plain':!![]});var _0x535929=_0x6c2e('0x29');return db['UserProfileResource'][_0x6c2e('0x2a')]({'where':{'type':_0x535929,'resourceId':_0x418e66['id']}})['then'](function(){return _0x1d8109;});})[_0x6c2e('0x27')](function(){_0x12b680[_0x6c2e('0x1d')](0xcc)[_0x6c2e('0x1e')]();});}};}function handleEntityNotFound(_0x5e75af,_0x51ba9a){return function(_0x1b9af2){if(!_0x1b9af2){_0x5e75af[_0x6c2e('0x1c')](0x194);}return _0x1b9af2;};}function handleError(_0x2d51e,_0x524631){_0x524631=_0x524631||0x1f4;return function(_0x2be5aa){logger[_0x6c2e('0x2b')](_0x2be5aa[_0x6c2e('0x2c')]);if(_0x2be5aa[_0x6c2e('0x2d')]){delete _0x2be5aa[_0x6c2e('0x2d')];}_0x2d51e[_0x6c2e('0x1d')](_0x524631)[_0x6c2e('0x2e')](_0x2be5aa);};}exports[_0x6c2e('0x2f')]=function(_0x2906e7,_0x485a05){var _0x487911={},_0x308320={},_0x523957={'count':0x0,'rows':[]};var _0x537a3e=_['map'](db[_0x6c2e('0x30')]['rawAttributes'],function(_0x1dd286){return{'name':_0x1dd286[_0x6c2e('0x31')],'type':_0x1dd286[_0x6c2e('0x32')][_0x6c2e('0x33')]};});_0x308320[_0x6c2e('0x34')]=_[_0x6c2e('0x35')](_0x537a3e,_0x6c2e('0x2d'));_0x308320[_0x6c2e('0x36')]=_[_0x6c2e('0x37')](_0x2906e7[_0x6c2e('0x36')]);_0x308320[_0x6c2e('0x38')]=_['intersection'](_0x308320[_0x6c2e('0x34')],_0x308320[_0x6c2e('0x36')]);_0x487911[_0x6c2e('0x39')]=_['intersection'](_0x308320[_0x6c2e('0x34')],qs[_0x6c2e('0x3a')](_0x2906e7[_0x6c2e('0x36')][_0x6c2e('0x3a')]));_0x487911[_0x6c2e('0x39')]=_0x487911[_0x6c2e('0x39')][_0x6c2e('0x3b')]?_0x487911[_0x6c2e('0x39')]:_0x308320['model'];if(!_0x2906e7['query'][_0x6c2e('0x3c')]('nolimit')){_0x487911['limit']=qs[_0x6c2e('0x21')](_0x2906e7['query']['limit']);_0x487911[_0x6c2e('0x20')]=qs[_0x6c2e('0x20')](_0x2906e7[_0x6c2e('0x36')]['offset']);}_0x487911[_0x6c2e('0x3d')]=qs[_0x6c2e('0x3e')](_0x2906e7['query'][_0x6c2e('0x3e')]);_0x487911[_0x6c2e('0x3f')]=qs[_0x6c2e('0x38')](_[_0x6c2e('0x40')](_0x2906e7[_0x6c2e('0x36')],_0x308320['filters']),_0x537a3e);if(_0x2906e7['query'][_0x6c2e('0x41')]){_0x487911[_0x6c2e('0x3f')]=_[_0x6c2e('0x42')](_0x487911[_0x6c2e('0x3f')],{'$or':_[_0x6c2e('0x35')](_0x537a3e,function(_0x23955c){if(_0x23955c['type']!==_0x6c2e('0x43')){var _0x135796={};_0x135796[_0x23955c['name']]={'$like':'%'+_0x2906e7[_0x6c2e('0x36')][_0x6c2e('0x41')]+'%'};return _0x135796;}})});}_0x487911=_[_0x6c2e('0x42')]({},_0x487911,_0x2906e7[_0x6c2e('0x44')]);var _0x34aaec={'where':_0x487911[_0x6c2e('0x3f')]};return db[_0x6c2e('0x30')][_0x6c2e('0x22')](_0x34aaec)['then'](function(_0x2a2d0b){_0x523957[_0x6c2e('0x22')]=_0x2a2d0b;if(_0x2906e7[_0x6c2e('0x36')][_0x6c2e('0x45')]){_0x487911[_0x6c2e('0x46')]=[{'all':!![]}];}return db[_0x6c2e('0x30')]['findAll'](_0x487911);})[_0x6c2e('0x27')](function(_0x478ed3){_0x523957[_0x6c2e('0x47')]=_0x478ed3;return _0x523957;})['then'](respondWithFilteredResult(_0x485a05,_0x487911))[_0x6c2e('0x48')](handleError(_0x485a05,null));};exports[_0x6c2e('0x49')]=function(_0x26f23c,_0x141916){var _0x1a2207={'raw':!![],'where':{'id':_0x26f23c['params']['id']}},_0x2c4d15={};_0x2c4d15[_0x6c2e('0x34')]=_[_0x6c2e('0x37')](db[_0x6c2e('0x30')]['rawAttributes']);_0x2c4d15['query']=_[_0x6c2e('0x37')](_0x26f23c[_0x6c2e('0x36')]);_0x2c4d15[_0x6c2e('0x38')]=_['intersection'](_0x2c4d15[_0x6c2e('0x34')],_0x2c4d15[_0x6c2e('0x36')]);_0x1a2207[_0x6c2e('0x39')]=_[_0x6c2e('0x4a')](_0x2c4d15['model'],qs['fields'](_0x26f23c['query'][_0x6c2e('0x3a')]));_0x1a2207['attributes']=_0x1a2207[_0x6c2e('0x39')]['length']?_0x1a2207[_0x6c2e('0x39')]:_0x2c4d15['model'];if(_0x26f23c[_0x6c2e('0x36')][_0x6c2e('0x45')]){_0x1a2207[_0x6c2e('0x46')]=[{'all':!![]}];}_0x1a2207=_[_0x6c2e('0x42')]({},_0x1a2207,_0x26f23c[_0x6c2e('0x44')]);return db[_0x6c2e('0x30')][_0x6c2e('0x4b')](_0x1a2207)[_0x6c2e('0x27')](handleEntityNotFound(_0x141916,null))[_0x6c2e('0x27')](respondWithResult(_0x141916,null))[_0x6c2e('0x48')](handleError(_0x141916,null));};exports[_0x6c2e('0x4c')]=function(_0x3e5053,_0x3a3849){return db[_0x6c2e('0x30')][_0x6c2e('0x4c')](_0x3e5053['body'],{})[_0x6c2e('0x27')](function(_0x241d4b){var _0xfc671=_0x3e5053['user'][_0x6c2e('0x28')]({'plain':!![]});if(!_0xfc671)throw new Error(_0x6c2e('0x4d'));if(_0xfc671[_0x6c2e('0x4e')]===_0x6c2e('0x4f')){var _0xbbc329=_0x241d4b['get']({'plain':!![]});var _0x261f25=_0x6c2e('0x29');return db[_0x6c2e('0x50')][_0x6c2e('0x4b')]({'where':{'name':_0x261f25,'userProfileId':_0xfc671[_0x6c2e('0x51')]},'raw':!![]})[_0x6c2e('0x27')](function(_0x27a54b){if(_0x27a54b&&_0x27a54b['autoAssociation']===0x0){return db[_0x6c2e('0x52')][_0x6c2e('0x4c')]({'name':_0xbbc329[_0x6c2e('0x2d')],'resourceId':_0xbbc329['id'],'type':_0x27a54b[_0x6c2e('0x2d')],'sectionId':_0x27a54b['id']},{})['then'](function(){return _0x241d4b;});}else{return _0x241d4b;}})[_0x6c2e('0x48')](function(_0x2502c6){logger[_0x6c2e('0x2b')](_0x6c2e('0x53'),_0x2502c6);throw _0x2502c6;});}return _0x241d4b;})[_0x6c2e('0x27')](respondWithResult(_0x3a3849,0xc9))[_0x6c2e('0x48')](handleError(_0x3a3849,null));};exports[_0x6c2e('0x54')]=function(_0x266602,_0x1331a1){if(_0x266602[_0x6c2e('0x55')]['id']){delete _0x266602[_0x6c2e('0x55')]['id'];}return db[_0x6c2e('0x30')][_0x6c2e('0x4b')]({'where':{'id':_0x266602[_0x6c2e('0x56')]['id']}})[_0x6c2e('0x27')](handleEntityNotFound(_0x1331a1,null))[_0x6c2e('0x27')](saveUpdates(_0x266602['body'],null))[_0x6c2e('0x27')](respondWithResult(_0x1331a1,null))[_0x6c2e('0x48')](handleError(_0x1331a1,null));};exports[_0x6c2e('0x2a')]=function(_0x3c6d91,_0x5343c8){return db[_0x6c2e('0x30')]['find']({'where':{'id':_0x3c6d91[_0x6c2e('0x56')]['id']}})[_0x6c2e('0x27')](handleEntityNotFound(_0x5343c8,null))[_0x6c2e('0x27')](removeEntity(_0x5343c8,null))[_0x6c2e('0x48')](handleError(_0x5343c8,null));};exports['test']=function(_0x35c51a,_0x78442d,_0x4e6039){var _0xe5722f;return db[_0x6c2e('0x30')][_0x6c2e('0x4b')]({'where':{'id':_0x35c51a[_0x6c2e('0x56')]['id']},'attributes':['id',_0x6c2e('0x57')]})['then'](handleEntityNotFound(_0x78442d,null))['then'](function(_0x4262f1){if(_0x4262f1){var _0x4c01a3=require('odbc')();_0x4c01a3[_0x6c2e('0x58')](_0x4262f1[_0x6c2e('0x57')]);_0x4c01a3[_0x6c2e('0x59')]();return _0x4262f1;}})[_0x6c2e('0x27')](respondWithResult(_0x78442d,null))[_0x6c2e('0x48')](handleError(_0x78442d,null));}; \ No newline at end of file +var _0x936f=['lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','ODBC','UserProfileResource','destroy','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','fields','attributes','length','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','dsn','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x25f849,_0xaaa293){var _0x457597=function(_0x3e8549){while(--_0x3e8549){_0x25f849['push'](_0x25f849['shift']());}};_0x457597(++_0xaaa293);}(_0x936f,0xfd));var _0xf936=function(_0x2848d5,_0x72bdc7){_0x2848d5=_0x2848d5-0x0;var _0x3378ef=_0x936f[_0x2848d5];return _0x3378ef;};'use strict';var emlformat=require(_0xf936('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf936('0x1'));var jsonpatch=require(_0xf936('0x2'));var rp=require(_0xf936('0x3'));var moment=require(_0xf936('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf936('0x5'));var util=require(_0xf936('0x6'));var path=require(_0xf936('0x7'));var sox=require(_0xf936('0x8'));var csv=require(_0xf936('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf936('0xa'));var _=require(_0xf936('0xb'));var squel=require(_0xf936('0xc'));var crypto=require(_0xf936('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf936('0xe'));var toCsv=require(_0xf936('0x9'));var querystring=require('querystring');var Papa=require(_0xf936('0xf'));var Redis=require(_0xf936('0x10'));var authService=require(_0xf936('0x11'));var qs=require(_0xf936('0x12'));var as=require(_0xf936('0x13'));var hardwareService=require(_0xf936('0x14'));var logger=require(_0xf936('0x15'))(_0xf936('0x16'));var utils=require(_0xf936('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf936('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf4ab57,_0x2df742){_0x2df742=_0x2df742||0xcc;return function(_0x9486f4){if(_0x9486f4){return _0xf4ab57[_0xf936('0x19')](_0x2df742);}return _0xf4ab57['status'](_0x2df742)[_0xf936('0x1a')]();};}function respondWithResult(_0x4fe18f,_0x30f912){_0x30f912=_0x30f912||0xc8;return function(_0xd94f67){if(_0xd94f67){return _0x4fe18f[_0xf936('0x1b')](_0x30f912)[_0xf936('0x1c')](_0xd94f67);}};}function respondWithFilteredResult(_0x14c8d8,_0x24305f){return function(_0xbeff6d){if(_0xbeff6d){var _0x3f997e=typeof _0x24305f[_0xf936('0x1d')]==='undefined'&&typeof _0x24305f[_0xf936('0x1e')]===_0xf936('0x1f');var _0x197502=_0xbeff6d['count'];var _0x571466=_0x3f997e?0x0:_0x24305f[_0xf936('0x1d')];var _0x212824=_0x3f997e?_0xbeff6d[_0xf936('0x20')]:_0x24305f[_0xf936('0x1d')]+_0x24305f[_0xf936('0x1e')];var _0x1ae5b2;if(_0x212824>=_0x197502){_0x212824=_0x197502;_0x1ae5b2=0xc8;}else{_0x1ae5b2=0xce;}_0x14c8d8[_0xf936('0x1b')](_0x1ae5b2);return _0x14c8d8[_0xf936('0x21')](_0xf936('0x22'),_0x571466+'-'+_0x212824+'/'+_0x197502)[_0xf936('0x1c')](_0xbeff6d);}return null;};}function patchUpdates(_0x27d1cc){return function(_0xfc49e0){try{jsonpatch['apply'](_0xfc49e0,_0x27d1cc,!![]);}catch(_0xaba72b){return BPromise[_0xf936('0x23')](_0xaba72b);}return _0xfc49e0[_0xf936('0x24')]();};}function saveUpdates(_0x5283a0,_0x59f253){return function(_0x14e931){if(_0x14e931){return _0x14e931[_0xf936('0x25')](_0x5283a0)[_0xf936('0x26')](function(_0x17928b){return _0x17928b;});}return null;};}function removeEntity(_0x2ccd2d,_0x4c906b){return function(_0x40291f){if(_0x40291f){return _0x40291f['destroy']()[_0xf936('0x26')](function(){var _0x45b8c0=_0x40291f[_0xf936('0x27')]({'plain':!![]});var _0x17d350=_0xf936('0x28');return db[_0xf936('0x29')][_0xf936('0x2a')]({'where':{'type':_0x17d350,'resourceId':_0x45b8c0['id']}})[_0xf936('0x26')](function(){return _0x40291f;});})[_0xf936('0x26')](function(){_0x2ccd2d[_0xf936('0x1b')](0xcc)[_0xf936('0x1a')]();});}};}function handleEntityNotFound(_0x183044,_0x2a2b2d){return function(_0xeffb71){if(!_0xeffb71){_0x183044['sendStatus'](0x194);}return _0xeffb71;};}function handleError(_0xf33ea8,_0x21582f){_0x21582f=_0x21582f||0x1f4;return function(_0x5b9de8){logger[_0xf936('0x2b')](_0x5b9de8[_0xf936('0x2c')]);if(_0x5b9de8['name']){delete _0x5b9de8[_0xf936('0x2d')];}_0xf33ea8[_0xf936('0x1b')](_0x21582f)[_0xf936('0x2e')](_0x5b9de8);};}exports[_0xf936('0x2f')]=function(_0x504b8f,_0x14ac22){var _0x182f4c={},_0x2a6bbe={},_0x4241d9={'count':0x0,'rows':[]};var _0x5dbf3e=_[_0xf936('0x30')](db[_0xf936('0x31')][_0xf936('0x32')],function(_0x211df0){return{'name':_0x211df0[_0xf936('0x33')],'type':_0x211df0[_0xf936('0x34')][_0xf936('0x35')]};});_0x2a6bbe[_0xf936('0x36')]=_['map'](_0x5dbf3e,'name');_0x2a6bbe[_0xf936('0x37')]=_['keys'](_0x504b8f['query']);_0x2a6bbe['filters']=_['intersection'](_0x2a6bbe[_0xf936('0x36')],_0x2a6bbe[_0xf936('0x37')]);_0x182f4c['attributes']=_['intersection'](_0x2a6bbe[_0xf936('0x36')],qs[_0xf936('0x38')](_0x504b8f['query'][_0xf936('0x38')]));_0x182f4c[_0xf936('0x39')]=_0x182f4c[_0xf936('0x39')][_0xf936('0x3a')]?_0x182f4c['attributes']:_0x2a6bbe[_0xf936('0x36')];if(!_0x504b8f['query']['hasOwnProperty'](_0xf936('0x3b'))){_0x182f4c[_0xf936('0x1e')]=qs[_0xf936('0x1e')](_0x504b8f['query']['limit']);_0x182f4c[_0xf936('0x1d')]=qs[_0xf936('0x1d')](_0x504b8f[_0xf936('0x37')][_0xf936('0x1d')]);}_0x182f4c[_0xf936('0x3c')]=qs[_0xf936('0x3d')](_0x504b8f[_0xf936('0x37')][_0xf936('0x3d')]);_0x182f4c['where']=qs[_0xf936('0x3e')](_['pick'](_0x504b8f['query'],_0x2a6bbe[_0xf936('0x3e')]),_0x5dbf3e);if(_0x504b8f['query'][_0xf936('0x3f')]){_0x182f4c[_0xf936('0x40')]=_[_0xf936('0x41')](_0x182f4c[_0xf936('0x40')],{'$or':_[_0xf936('0x30')](_0x5dbf3e,function(_0x109c6c){if(_0x109c6c[_0xf936('0x34')]!=='VIRTUAL'){var _0x4a7932={};_0x4a7932[_0x109c6c[_0xf936('0x2d')]]={'$like':'%'+_0x504b8f[_0xf936('0x37')][_0xf936('0x3f')]+'%'};return _0x4a7932;}})});}_0x182f4c=_['merge']({},_0x182f4c,_0x504b8f[_0xf936('0x42')]);var _0x23f51a={'where':_0x182f4c[_0xf936('0x40')]};return db[_0xf936('0x31')][_0xf936('0x20')](_0x23f51a)[_0xf936('0x26')](function(_0x3c88ee){_0x4241d9[_0xf936('0x20')]=_0x3c88ee;if(_0x504b8f[_0xf936('0x37')][_0xf936('0x43')]){_0x182f4c[_0xf936('0x44')]=[{'all':!![]}];}return db[_0xf936('0x31')][_0xf936('0x45')](_0x182f4c);})[_0xf936('0x26')](function(_0x26da87){_0x4241d9[_0xf936('0x46')]=_0x26da87;return _0x4241d9;})[_0xf936('0x26')](respondWithFilteredResult(_0x14ac22,_0x182f4c))[_0xf936('0x47')](handleError(_0x14ac22,null));};exports[_0xf936('0x48')]=function(_0x35407b,_0x4fb8f4){var _0x2b53b0={'raw':!![],'where':{'id':_0x35407b[_0xf936('0x49')]['id']}},_0x18869c={};_0x18869c[_0xf936('0x36')]=_['keys'](db['SquareOdbc'][_0xf936('0x32')]);_0x18869c[_0xf936('0x37')]=_[_0xf936('0x4a')](_0x35407b['query']);_0x18869c['filters']=_[_0xf936('0x4b')](_0x18869c[_0xf936('0x36')],_0x18869c[_0xf936('0x37')]);_0x2b53b0[_0xf936('0x39')]=_['intersection'](_0x18869c['model'],qs[_0xf936('0x38')](_0x35407b[_0xf936('0x37')][_0xf936('0x38')]));_0x2b53b0[_0xf936('0x39')]=_0x2b53b0[_0xf936('0x39')][_0xf936('0x3a')]?_0x2b53b0[_0xf936('0x39')]:_0x18869c[_0xf936('0x36')];if(_0x35407b['query']['includeAll']){_0x2b53b0['include']=[{'all':!![]}];}_0x2b53b0=_[_0xf936('0x41')]({},_0x2b53b0,_0x35407b[_0xf936('0x42')]);return db['SquareOdbc'][_0xf936('0x4c')](_0x2b53b0)[_0xf936('0x26')](handleEntityNotFound(_0x4fb8f4,null))['then'](respondWithResult(_0x4fb8f4,null))['catch'](handleError(_0x4fb8f4,null));};exports[_0xf936('0x4d')]=function(_0x3badfa,_0x495907){return db[_0xf936('0x31')][_0xf936('0x4d')](_0x3badfa['body'],{})[_0xf936('0x26')](function(_0x3078cc){var _0x36a80b=_0x3badfa[_0xf936('0x4e')][_0xf936('0x27')]({'plain':!![]});if(!_0x36a80b)throw new Error(_0xf936('0x4f'));if(_0x36a80b[_0xf936('0x50')]===_0xf936('0x4e')){var _0x3a0471=_0x3078cc[_0xf936('0x27')]({'plain':!![]});var _0x24980a=_0xf936('0x28');return db[_0xf936('0x51')][_0xf936('0x4c')]({'where':{'name':_0x24980a,'userProfileId':_0x36a80b['userProfileId']},'raw':!![]})['then'](function(_0xf3fee7){if(_0xf3fee7&&_0xf3fee7[_0xf936('0x52')]===0x0){return db[_0xf936('0x29')][_0xf936('0x4d')]({'name':_0x3a0471[_0xf936('0x2d')],'resourceId':_0x3a0471['id'],'type':_0xf3fee7['name'],'sectionId':_0xf3fee7['id']},{})[_0xf936('0x26')](function(){return _0x3078cc;});}else{return _0x3078cc;}})[_0xf936('0x47')](function(_0x22525b){logger[_0xf936('0x2b')](_0xf936('0x53'),_0x22525b);throw _0x22525b;});}return _0x3078cc;})['then'](respondWithResult(_0x495907,0xc9))['catch'](handleError(_0x495907,null));};exports['update']=function(_0x3b6411,_0x5b0a43){if(_0x3b6411[_0xf936('0x54')]['id']){delete _0x3b6411[_0xf936('0x54')]['id'];}return db[_0xf936('0x31')][_0xf936('0x4c')]({'where':{'id':_0x3b6411[_0xf936('0x49')]['id']}})[_0xf936('0x26')](handleEntityNotFound(_0x5b0a43,null))[_0xf936('0x26')](saveUpdates(_0x3b6411[_0xf936('0x54')],null))['then'](respondWithResult(_0x5b0a43,null))[_0xf936('0x47')](handleError(_0x5b0a43,null));};exports['destroy']=function(_0x4377d4,_0x15e143){return db[_0xf936('0x31')][_0xf936('0x4c')]({'where':{'id':_0x4377d4[_0xf936('0x49')]['id']}})[_0xf936('0x26')](handleEntityNotFound(_0x15e143,null))[_0xf936('0x26')](removeEntity(_0x15e143,null))[_0xf936('0x47')](handleError(_0x15e143,null));};exports['test']=function(_0x18c4bc,_0x11ade0,_0x293610){var _0x2691e2;return db[_0xf936('0x31')][_0xf936('0x4c')]({'where':{'id':_0x18c4bc[_0xf936('0x49')]['id']},'attributes':['id',_0xf936('0x55')]})[_0xf936('0x26')](handleEntityNotFound(_0x11ade0,null))[_0xf936('0x26')](function(_0x12de32){if(_0x12de32){var _0x534cfe=require('odbc')();_0x534cfe[_0xf936('0x56')](_0x12de32[_0xf936('0x55')]);_0x534cfe[_0xf936('0x57')]();return _0x12de32;}})[_0xf936('0x26')](respondWithResult(_0x11ade0,null))[_0xf936('0x47')](handleError(_0x11ade0,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index eb5eeec..171e23a 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 _0x5600=['rimraf','./squareOdbc.attributes','define','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4cc1ec,_0x443e76){var _0x3279cc=function(_0x203b77){while(--_0x203b77){_0x4cc1ec['push'](_0x4cc1ec['shift']());}};_0x3279cc(++_0x443e76);}(_0x5600,0x1e8));var _0x0560=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x5600[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x0560('0x0'));var util=require(_0x0560('0x1'));var logger=require(_0x0560('0x2'))(_0x0560('0x3'));var moment=require(_0x0560('0x4'));var BPromise=require(_0x0560('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0560('0x6'));var rimraf=require(_0x0560('0x7'));var config=require('../../config/environment');var attributes=require(_0x0560('0x8'));module['exports']=function(_0x28a56a,_0x58bcff){return _0x28a56a[_0x0560('0x9')]('SquareOdbc',attributes,{'tableName':_0x0560('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x350e=['rimraf','../../config/environment','./squareOdbc.attributes','util','api','moment','request-promise','path'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x350e,0x1f3));var _0xe350=function(_0xbaf9bf,_0x5d96b2){_0xbaf9bf=_0xbaf9bf-0x0;var _0x2987ea=_0x350e[_0xbaf9bf];return _0x2987ea;};'use strict';var _=require('lodash');var util=require(_0xe350('0x0'));var logger=require('../../config/logger')(_0xe350('0x1'));var moment=require(_0xe350('0x2'));var BPromise=require('bluebird');var rp=require(_0xe350('0x3'));var fs=require('fs');var path=require(_0xe350('0x4'));var rimraf=require(_0xe350('0x5'));var config=require(_0xe350('0x6'));var attributes=require(_0xe350('0x7'));module['exports']=function(_0x5ba68b,_0xe15d62){return _0x5ba68b['define']('SquareOdbc',attributes,{'tableName':'square_odbc','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 6a23f6f..1efed26 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 _0xdbe4=['../../config/utils','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','find','options','raw','where','include','model','map','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x17bdab,_0x199650){var _0x4e2989=function(_0x360c15){while(--_0x360c15){_0x17bdab['push'](_0x17bdab['shift']());}};_0x4e2989(++_0x199650);}(_0xdbe4,0x1a6));var _0x4dbe=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xdbe4[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x4dbe('0x0'));var util=require(_0x4dbe('0x1'));var moment=require(_0x4dbe('0x2'));var BPromise=require(_0x4dbe('0x3'));var rs=require(_0x4dbe('0x4'));var fs=require('fs');var Redis=require(_0x4dbe('0x5'));var db=require(_0x4dbe('0x6'))['db'];var utils=require(_0x4dbe('0x7'));var logger=require(_0x4dbe('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4dbe('0x9'));var client=jayson[_0x4dbe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x298acd,_0x29084c,_0x1219a1){return new BPromise(function(_0x3dda38,_0xb5cb73){return client[_0x4dbe('0xb')](_0x298acd,_0x1219a1)[_0x4dbe('0xc')](function(_0x231307){logger[_0x4dbe('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x29084c,_0x4dbe('0xe'));logger['debug'](_0x4dbe('0xf'),_0x29084c,_0x4dbe('0xe'),JSON[_0x4dbe('0x10')](_0x231307));if(_0x231307[_0x4dbe('0x11')]){if(_0x231307[_0x4dbe('0x11')][_0x4dbe('0x12')]===0x1f4){logger[_0x4dbe('0x11')](_0x4dbe('0x13'),_0x29084c,_0x231307['error'][_0x4dbe('0x14')]);return _0xb5cb73(_0x231307[_0x4dbe('0x11')]['message']);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x29084c,_0x231307[_0x4dbe('0x11')][_0x4dbe('0x14')]);return _0x3dda38(_0x231307[_0x4dbe('0x11')][_0x4dbe('0x14')]);}else{logger[_0x4dbe('0xd')](_0x4dbe('0x13'),_0x29084c,_0x4dbe('0xe'));_0x3dda38(_0x231307[_0x4dbe('0x15')]['message']);}})[_0x4dbe('0x16')](function(_0x2eff80){logger[_0x4dbe('0x11')](_0x4dbe('0x13'),_0x29084c,_0x2eff80);_0xb5cb73(_0x2eff80);});});}exports[_0x4dbe('0x17')]=function(_0x178391){var _0xbb0f51=this;return new Promise(function(_0x3fdcb3,_0x1340c4){return db['SquareOdbc'][_0x4dbe('0x18')]({'raw':_0x178391[_0x4dbe('0x19')]?_0x178391['options'][_0x4dbe('0x1a')]===undefined?!![]:![]:!![],'where':_0x178391[_0x4dbe('0x19')]?_0x178391['options'][_0x4dbe('0x1b')]||null:null,'attributes':_0x178391[_0x4dbe('0x19')]?_0x178391[_0x4dbe('0x19')]['attributes']||null:null,'include':_0x178391['options']?_0x178391[_0x4dbe('0x19')][_0x4dbe('0x1c')]?_['map'](_0x178391['options'][_0x4dbe('0x1c')],function(_0x3b38ca){return{'model':db[_0x3b38ca[_0x4dbe('0x1d')]],'as':_0x3b38ca['as'],'attributes':_0x3b38ca['attributes'],'include':_0x3b38ca[_0x4dbe('0x1c')]?_[_0x4dbe('0x1e')](_0x3b38ca[_0x4dbe('0x1c')],function(_0x2a0596){return{'model':db[_0x2a0596[_0x4dbe('0x1d')]],'as':_0x2a0596['as'],'attributes':_0x2a0596[_0x4dbe('0x1f')],'include':_0x2a0596[_0x4dbe('0x1c')]?_[_0x4dbe('0x1e')](_0x2a0596['include'],function(_0x28c60f){return{'model':db[_0x28c60f[_0x4dbe('0x1d')]],'as':_0x28c60f['as'],'attributes':_0x28c60f[_0x4dbe('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4dbe('0xc')](function(_0x161e9b){logger[_0x4dbe('0xd')](_0x4dbe('0x17'),_0x178391);logger[_0x4dbe('0x20')](_0x4dbe('0x17'),_0x178391,JSON[_0x4dbe('0x10')](_0x161e9b));_0x3fdcb3(_0x161e9b);})[_0x4dbe('0x16')](function(_0x536f3d){logger['error']('ShowSquareOdbc',_0x536f3d[_0x4dbe('0x14')],_0x178391);_0x1340c4(_0xbb0f51[_0x4dbe('0x11')](0x1f4,_0x536f3d[_0x4dbe('0x14')]));});});}; \ No newline at end of file +var _0x7899=['include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','options','raw','attributes'];(function(_0x4d72a6,_0x2279a0){var _0x34997b=function(_0x17adbe){while(--_0x17adbe){_0x4d72a6['push'](_0x4d72a6['shift']());}};_0x34997b(++_0x2279a0);}(_0x7899,0xe4));var _0x9789=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0x7899[_0x216d45];return _0xbaac0b;};'use strict';var _=require(_0x9789('0x0'));var util=require(_0x9789('0x1'));var moment=require(_0x9789('0x2'));var BPromise=require('bluebird');var rs=require(_0x9789('0x3'));var fs=require('fs');var Redis=require(_0x9789('0x4'));var db=require(_0x9789('0x5'))['db'];var utils=require(_0x9789('0x6'));var logger=require(_0x9789('0x7'))(_0x9789('0x8'));var config=require(_0x9789('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9789('0xa')][_0x9789('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c8cde,_0x4f572a,_0x23ad2f){return new BPromise(function(_0x536144,_0x8c5c23){return client[_0x9789('0xc')](_0x4c8cde,_0x23ad2f)[_0x9789('0xd')](function(_0x422dd4){logger[_0x9789('0xe')](_0x9789('0xf'),_0x4f572a,_0x9789('0x10'));logger[_0x9789('0x11')](_0x9789('0x12'),_0x4f572a,_0x9789('0x10'),JSON['stringify'](_0x422dd4));if(_0x422dd4[_0x9789('0x13')]){if(_0x422dd4[_0x9789('0x13')][_0x9789('0x14')]===0x1f4){logger['error'](_0x9789('0xf'),_0x4f572a,_0x422dd4[_0x9789('0x13')][_0x9789('0x15')]);return _0x8c5c23(_0x422dd4[_0x9789('0x13')][_0x9789('0x15')]);}logger[_0x9789('0x13')](_0x9789('0xf'),_0x4f572a,_0x422dd4['error'][_0x9789('0x15')]);return _0x536144(_0x422dd4[_0x9789('0x13')][_0x9789('0x15')]);}else{logger['info'](_0x9789('0xf'),_0x4f572a,'request\x20sent');_0x536144(_0x422dd4[_0x9789('0x16')][_0x9789('0x15')]);}})[_0x9789('0x17')](function(_0x2c9f4c){logger[_0x9789('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x4f572a,_0x2c9f4c);_0x8c5c23(_0x2c9f4c);});});}exports[_0x9789('0x18')]=function(_0x217684){var _0x57c099=this;return new Promise(function(_0x501e88,_0x2f9b9c){return db['SquareOdbc']['find']({'raw':_0x217684[_0x9789('0x19')]?_0x217684['options'][_0x9789('0x1a')]===undefined?!![]:![]:!![],'where':_0x217684[_0x9789('0x19')]?_0x217684[_0x9789('0x19')]['where']||null:null,'attributes':_0x217684[_0x9789('0x19')]?_0x217684[_0x9789('0x19')][_0x9789('0x1b')]||null:null,'include':_0x217684[_0x9789('0x19')]?_0x217684['options'][_0x9789('0x1c')]?_[_0x9789('0x1d')](_0x217684['options']['include'],function(_0x4109d8){return{'model':db[_0x4109d8[_0x9789('0x1e')]],'as':_0x4109d8['as'],'attributes':_0x4109d8[_0x9789('0x1b')],'include':_0x4109d8[_0x9789('0x1c')]?_[_0x9789('0x1d')](_0x4109d8[_0x9789('0x1c')],function(_0x383da7){return{'model':db[_0x383da7[_0x9789('0x1e')]],'as':_0x383da7['as'],'attributes':_0x383da7[_0x9789('0x1b')],'include':_0x383da7[_0x9789('0x1c')]?_[_0x9789('0x1d')](_0x383da7[_0x9789('0x1c')],function(_0x220cca){return{'model':db[_0x220cca['model']],'as':_0x220cca['as'],'attributes':_0x220cca['attributes']};}):[]};}):[]};}):[]:[]})[_0x9789('0xd')](function(_0x290df9){logger[_0x9789('0xe')]('ShowSquareOdbc',_0x217684);logger[_0x9789('0x11')](_0x9789('0x18'),_0x217684,JSON[_0x9789('0x1f')](_0x290df9));_0x501e88(_0x290df9);})['catch'](function(_0x1e2947){logger[_0x9789('0x13')](_0x9789('0x18'),_0x1e2947[_0x9789('0x15')],_0x217684);_0x2f9b9c(_0x57c099['error'](0x1f4,_0x1e2947[_0x9789('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 0127042..fe8ac6d 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 _0xa2c6=['/:id/users','addUsers','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','/:id','isAuthenticated','show','post'];(function(_0x483973,_0x136199){var _0x4bd772=function(_0x1f22c5){while(--_0x1f22c5){_0x483973['push'](_0x483973['shift']());}};_0x4bd772(++_0x136199);}(_0xa2c6,0x1bb));var _0x6a2c=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xa2c6[_0xef8146];return _0x5a6cb0;};'use strict';var multer=require(_0x6a2c('0x0'));var util=require('util');var path=require(_0x6a2c('0x1'));var timeout=require(_0x6a2c('0x2'));var express=require(_0x6a2c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6a2c('0x4'));var interaction=require(_0x6a2c('0x5'));var config=require(_0x6a2c('0x6'));var controller=require(_0x6a2c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6a2c('0x8')](_0x6a2c('0x9'),auth[_0x6a2c('0xa')](),controller[_0x6a2c('0xb')]);router[_0x6a2c('0x8')]('/:id/users',auth[_0x6a2c('0xa')](),controller['getUsers']);router[_0x6a2c('0xc')]('/',auth[_0x6a2c('0xa')](),controller['create']);router['post'](_0x6a2c('0xd'),auth[_0x6a2c('0xa')](),controller[_0x6a2c('0xe')]);router[_0x6a2c('0xf')]('/:id',auth[_0x6a2c('0xa')](),controller['update']);router[_0x6a2c('0x10')](_0x6a2c('0x9'),auth[_0x6a2c('0xa')](),controller[_0x6a2c('0x11')]);router[_0x6a2c('0x10')](_0x6a2c('0xd'),auth[_0x6a2c('0xa')](),controller['removeUsers']);module[_0x6a2c('0x12')]=router; \ No newline at end of file +var _0xa67e=['/:id','show','/:id/users','post','create','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareProject.controller','get','isAuthenticated','index'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0xa67e,0xce));var _0xea67=function(_0x5a57a2,_0x25e81d){_0x5a57a2=_0x5a57a2-0x0;var _0x4754bb=_0xa67e[_0x5a57a2];return _0x4754bb;};'use strict';var multer=require('multer');var util=require(_0xea67('0x0'));var path=require('path');var timeout=require(_0xea67('0x1'));var express=require(_0xea67('0x2'));var router=express[_0xea67('0x3')]();var fs_extra=require(_0xea67('0x4'));var auth=require(_0xea67('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xea67('0x6'));router[_0xea67('0x7')]('/',auth[_0xea67('0x8')](),controller[_0xea67('0x9')]);router[_0xea67('0x7')](_0xea67('0xa'),auth[_0xea67('0x8')](),controller[_0xea67('0xb')]);router[_0xea67('0x7')](_0xea67('0xc'),auth[_0xea67('0x8')](),controller['getUsers']);router[_0xea67('0xd')]('/',auth[_0xea67('0x8')](),controller[_0xea67('0xe')]);router[_0xea67('0xd')](_0xea67('0xc'),auth['isAuthenticated'](),controller['addUsers']);router['put']('/:id',auth[_0xea67('0x8')](),controller[_0xea67('0xf')]);router[_0xea67('0x10')]('/:id',auth[_0xea67('0x8')](),controller[_0xea67('0x11')]);router['delete'](_0xea67('0xc'),auth[_0xea67('0x8')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index e12a3ac..4b9f191 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 _0x323d=['DATE','sequelize','exports','STRING','name','TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production'];(function(_0x10a3f2,_0x15060a){var _0x16230d=function(_0x300290){while(--_0x300290){_0x10a3f2['push'](_0x10a3f2['shift']());}};_0x16230d(++_0x15060a);}(_0x323d,0x1e2));var _0xd323=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x323d[_0x2d8fc2];return _0x3a9e53;};'use strict';var Sequelize=require(_0xd323('0x0'));module[_0xd323('0x1')]={'name':{'type':Sequelize[_0xd323('0x2')],'unique':_0xd323('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd323('0x2')]},'notes':{'type':Sequelize[_0xd323('0x4')]},'preproduction':{'type':Sequelize[_0xd323('0x5')]('long'),'get':function(){if(this[_0xd323('0x6')](_0xd323('0x7'))){return this['getDataValue'](_0xd323('0x7'))[_0xd323('0x8')](_0xd323('0x9'));}}},'production':{'type':Sequelize[_0xd323('0x5')](_0xd323('0xa')),'get':function(){if(this['getDataValue'](_0xd323('0xb'))){return this[_0xd323('0x6')](_0xd323('0xb'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0xd323('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x59ee=['long','getDataValue','preproduction','toString','utf8','DATE','exports','name','TEXT','BLOB'];(function(_0x329a4c,_0x4a124f){var _0x4b4197=function(_0x1ba774){while(--_0x1ba774){_0x329a4c['push'](_0x329a4c['shift']());}};_0x4b4197(++_0x4a124f);}(_0x59ee,0x1a0));var _0xe59e=function(_0x4ab32c,_0x44ab5e){_0x4ab32c=_0x4ab32c-0x0;var _0x2b9644=_0x59ee[_0x4ab32c];return _0x2b9644;};'use strict';var Sequelize=require('sequelize');module[_0xe59e('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xe59e('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xe59e('0x2')]},'preproduction':{'type':Sequelize[_0xe59e('0x3')](_0xe59e('0x4')),'get':function(){if(this[_0xe59e('0x5')](_0xe59e('0x6'))){return this[_0xe59e('0x5')](_0xe59e('0x6'))[_0xe59e('0x7')](_0xe59e('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xe59e('0x4')),'get':function(){if(this[_0xe59e('0x5')]('production')){return this[_0xe59e('0x5')]('production')['toString'](_0xe59e('0x8'));}}},'savedAt':{'type':Sequelize[_0xe59e('0x9')]},'publishedAt':{'type':Sequelize[_0xe59e('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ec8d57c..d9120b1 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 _0x63ba=['filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','keys','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','error','body','addUsers','omit','removeUsers','isArray','ids','userSquareProject:remove','getUsers','findOne','User','sort','nolimit','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','then','get','SquareProjects','destroy','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query'];(function(_0x4c1678,_0x2afb36){var _0x1e9469=function(_0xd76668){while(--_0xd76668){_0x4c1678['push'](_0x4c1678['shift']());}};_0x1e9469(++_0x2afb36);}(_0x63ba,0x13c));var _0xa63b=function(_0x2f3038,_0x33d91e){_0x2f3038=_0x2f3038-0x0;var _0xba5b2e=_0x63ba[_0x2f3038];return _0xba5b2e;};'use strict';var emlformat=require(_0xa63b('0x0'));var rimraf=require(_0xa63b('0x1'));var zipdir=require(_0xa63b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa63b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa63b('0x4'));var util=require(_0xa63b('0x5'));var path=require(_0xa63b('0x6'));var sox=require(_0xa63b('0x7'));var csv=require(_0xa63b('0x8'));var ejs=require(_0xa63b('0x9'));var fs=require('fs');var fs_extra=require(_0xa63b('0xa'));var _=require('lodash');var squel=require(_0xa63b('0xb'));var crypto=require(_0xa63b('0xc'));var jsforce=require(_0xa63b('0xd'));var deskjs=require(_0xa63b('0xe'));var toCsv=require(_0xa63b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa63b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa63b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa63b('0x11'));var utils=require(_0xa63b('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa63b('0x13')]=_[_0xa63b('0x14')](config[_0xa63b('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xa63b('0x15'))(new Redis(config['redis']));require(_0xa63b('0x16'))[_0xa63b('0x17')](socket);function respondWithStatusCode(_0xa6c920,_0x3ac263){_0x3ac263=_0x3ac263||0xcc;return function(_0x41c474){if(_0x41c474){return _0xa6c920[_0xa63b('0x18')](_0x3ac263);}return _0xa6c920['status'](_0x3ac263)[_0xa63b('0x19')]();};}function respondWithResult(_0x19edb1,_0x1de421){_0x1de421=_0x1de421||0xc8;return function(_0xdb164d){if(_0xdb164d){return _0x19edb1['status'](_0x1de421)[_0xa63b('0x1a')](_0xdb164d);}};}function respondWithFilteredResult(_0x445514,_0x2a7220){return function(_0x4f08e2){if(_0x4f08e2){var _0x58e1=typeof _0x2a7220[_0xa63b('0x1b')]===_0xa63b('0x1c')&&typeof _0x2a7220[_0xa63b('0x1d')]===_0xa63b('0x1c');var _0xfe0b28=_0x4f08e2[_0xa63b('0x1e')];var _0x17bd39=_0x58e1?0x0:_0x2a7220['offset'];var _0x15b193=_0x58e1?_0x4f08e2[_0xa63b('0x1e')]:_0x2a7220[_0xa63b('0x1b')]+_0x2a7220[_0xa63b('0x1d')];var _0x4de492;if(_0x15b193>=_0xfe0b28){_0x15b193=_0xfe0b28;_0x4de492=0xc8;}else{_0x4de492=0xce;}_0x445514[_0xa63b('0x1f')](_0x4de492);return _0x445514[_0xa63b('0x20')](_0xa63b('0x21'),_0x17bd39+'-'+_0x15b193+'/'+_0xfe0b28)[_0xa63b('0x1a')](_0x4f08e2);}return null;};}function patchUpdates(_0x1c3541){return function(_0x30b346){try{jsonpatch[_0xa63b('0x22')](_0x30b346,_0x1c3541,!![]);}catch(_0x2849c7){return BPromise['reject'](_0x2849c7);}return _0x30b346[_0xa63b('0x23')]();};}function saveUpdates(_0x314842,_0x4350ea){return function(_0x22fed4){if(_0x22fed4){return _0x22fed4['update'](_0x314842)[_0xa63b('0x24')](function(_0x157fe3){return _0x157fe3;});}return null;};}function removeEntity(_0x5634ca,_0x3660d2){return function(_0x967846){if(_0x967846){return _0x967846['destroy']()['then'](function(){var _0x52d46c=_0x967846[_0xa63b('0x25')]({'plain':!![]});var _0x561605=_0xa63b('0x26');return db['UserProfileResource'][_0xa63b('0x27')]({'where':{'type':_0x561605,'resourceId':_0x52d46c['id']}})[_0xa63b('0x24')](function(){return _0x967846;});})['then'](function(){_0x5634ca[_0xa63b('0x1f')](0xcc)[_0xa63b('0x19')]();});}};}function handleEntityNotFound(_0x5606da,_0x52c71d){return function(_0x3e6613){if(!_0x3e6613){_0x5606da[_0xa63b('0x18')](0x194);}return _0x3e6613;};}function handleError(_0x236a4d,_0x5341f1){_0x5341f1=_0x5341f1||0x1f4;return function(_0x9200a3){logger['error'](_0x9200a3[_0xa63b('0x28')]);if(_0x9200a3[_0xa63b('0x29')]){delete _0x9200a3[_0xa63b('0x29')];}_0x236a4d[_0xa63b('0x1f')](_0x5341f1)[_0xa63b('0x2a')](_0x9200a3);};}exports[_0xa63b('0x2b')]=function(_0x1355c8,_0x2ad9c1){var _0x1ba2b2={},_0x44b920={},_0xc179e1={'count':0x0,'rows':[]};var _0x18f516=_[_0xa63b('0x2c')](db[_0xa63b('0x2d')][_0xa63b('0x2e')],function(_0x4af5c8){return{'name':_0x4af5c8[_0xa63b('0x2f')],'type':_0x4af5c8[_0xa63b('0x30')][_0xa63b('0x31')]};});_0x44b920[_0xa63b('0x32')]=_[_0xa63b('0x2c')](_0x18f516,_0xa63b('0x29'));_0x44b920[_0xa63b('0x33')]=_['keys'](_0x1355c8[_0xa63b('0x33')]);_0x44b920[_0xa63b('0x34')]=_[_0xa63b('0x35')](_0x44b920['model'],_0x44b920[_0xa63b('0x33')]);_0x1ba2b2['attributes']=_[_0xa63b('0x35')](_0x44b920[_0xa63b('0x32')],qs[_0xa63b('0x36')](_0x1355c8['query'][_0xa63b('0x36')]));_0x1ba2b2[_0xa63b('0x37')]=_0x1ba2b2[_0xa63b('0x37')][_0xa63b('0x38')]?_0x1ba2b2[_0xa63b('0x37')]:_0x44b920[_0xa63b('0x32')];if(!_0x1355c8[_0xa63b('0x33')][_0xa63b('0x39')]('nolimit')){_0x1ba2b2[_0xa63b('0x1d')]=qs[_0xa63b('0x1d')](_0x1355c8[_0xa63b('0x33')][_0xa63b('0x1d')]);_0x1ba2b2[_0xa63b('0x1b')]=qs[_0xa63b('0x1b')](_0x1355c8['query']['offset']);}_0x1ba2b2[_0xa63b('0x3a')]=qs['sort'](_0x1355c8[_0xa63b('0x33')]['sort']);_0x1ba2b2[_0xa63b('0x3b')]=qs[_0xa63b('0x34')](_[_0xa63b('0x3c')](_0x1355c8['query'],_0x44b920[_0xa63b('0x34')]),_0x18f516);if(_0x1355c8[_0xa63b('0x33')]['filter']){_0x1ba2b2[_0xa63b('0x3b')]=_[_0xa63b('0x3d')](_0x1ba2b2[_0xa63b('0x3b')],{'$or':_[_0xa63b('0x2c')](_0x18f516,function(_0x2b70b6){if(_0x2b70b6[_0xa63b('0x30')]!==_0xa63b('0x3e')){var _0x3cebf1={};_0x3cebf1[_0x2b70b6['name']]={'$like':'%'+_0x1355c8['query'][_0xa63b('0x3f')]+'%'};return _0x3cebf1;}})});}_0x1ba2b2=_['merge']({},_0x1ba2b2,_0x1355c8[_0xa63b('0x40')]);var _0x599f3c={'where':_0x1ba2b2[_0xa63b('0x3b')]};return db['SquareProject'][_0xa63b('0x1e')](_0x599f3c)['then'](function(_0x409c0d){_0xc179e1[_0xa63b('0x1e')]=_0x409c0d;if(_0x1355c8[_0xa63b('0x33')][_0xa63b('0x41')]){_0x1ba2b2['include']=[{'all':!![]}];}return db[_0xa63b('0x2d')][_0xa63b('0x42')](_0x1ba2b2);})[_0xa63b('0x24')](function(_0x2b36a1){_0xc179e1['rows']=_0x2b36a1;return _0xc179e1;})['then'](respondWithFilteredResult(_0x2ad9c1,_0x1ba2b2))['catch'](handleError(_0x2ad9c1,null));};exports[_0xa63b('0x43')]=function(_0x1ea836,_0x564894){var _0x569ac5={'raw':![],'where':{'id':_0x1ea836[_0xa63b('0x44')]['id']}},_0x56b3ff={};_0x56b3ff[_0xa63b('0x32')]=_[_0xa63b('0x45')](db[_0xa63b('0x2d')]['rawAttributes']);_0x56b3ff[_0xa63b('0x33')]=_[_0xa63b('0x45')](_0x1ea836['query']);_0x56b3ff['filters']=_[_0xa63b('0x35')](_0x56b3ff[_0xa63b('0x32')],_0x56b3ff[_0xa63b('0x33')]);_0x569ac5[_0xa63b('0x37')]=_[_0xa63b('0x35')](_0x56b3ff['model'],qs[_0xa63b('0x36')](_0x1ea836[_0xa63b('0x33')]['fields']));_0x569ac5[_0xa63b('0x37')]=_0x569ac5[_0xa63b('0x37')]['length']?_0x569ac5['attributes']:_0x56b3ff[_0xa63b('0x32')];if(_0x1ea836[_0xa63b('0x33')][_0xa63b('0x41')]){_0x569ac5[_0xa63b('0x46')]=[{'all':!![]}];}_0x569ac5=_['merge']({},_0x569ac5,_0x1ea836[_0xa63b('0x40')]);return db['SquareProject'][_0xa63b('0x47')](_0x569ac5)[_0xa63b('0x24')](handleEntityNotFound(_0x564894,null))[_0xa63b('0x24')](respondWithResult(_0x564894,null))[_0xa63b('0x48')](handleError(_0x564894,null));};exports[_0xa63b('0x49')]=function(_0x2bdf61,_0x3ff767){return db[_0xa63b('0x2d')]['create'](_0x2bdf61['body'],{})[_0xa63b('0x24')](function(_0x296615){var _0x58202d=_0x2bdf61[_0xa63b('0x4a')][_0xa63b('0x25')]({'plain':!![]});if(!_0x58202d)throw new Error(_0xa63b('0x4b'));if(_0x58202d['role']===_0xa63b('0x4a')){var _0x4da250=_0x296615[_0xa63b('0x25')]({'plain':!![]});var _0xa8b382=_0xa63b('0x26');return db[_0xa63b('0x4c')][_0xa63b('0x47')]({'where':{'name':_0xa8b382,'userProfileId':_0x58202d[_0xa63b('0x4d')]},'raw':!![]})[_0xa63b('0x24')](function(_0x30a6f1){if(_0x30a6f1&&_0x30a6f1['autoAssociation']===0x0){return db[_0xa63b('0x4e')][_0xa63b('0x49')]({'name':_0x4da250[_0xa63b('0x29')],'resourceId':_0x4da250['id'],'type':_0x30a6f1[_0xa63b('0x29')],'sectionId':_0x30a6f1['id']},{})[_0xa63b('0x24')](function(){return _0x296615;});}else{return _0x296615;}})[_0xa63b('0x48')](function(_0x4a5385){logger[_0xa63b('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a5385);throw _0x4a5385;});}return _0x296615;})[_0xa63b('0x24')](respondWithResult(_0x3ff767,0xc9))[_0xa63b('0x48')](handleError(_0x3ff767,null));};exports['update']=function(_0x2a2803,_0x156c6b){if(_0x2a2803[_0xa63b('0x50')]['id']){delete _0x2a2803[_0xa63b('0x50')]['id'];}return db[_0xa63b('0x2d')][_0xa63b('0x47')]({'where':{'id':_0x2a2803[_0xa63b('0x44')]['id']}})[_0xa63b('0x24')](handleEntityNotFound(_0x156c6b,null))[_0xa63b('0x24')](saveUpdates(_0x2a2803[_0xa63b('0x50')],null))[_0xa63b('0x24')](respondWithResult(_0x156c6b,null))[_0xa63b('0x48')](handleError(_0x156c6b,null));};exports[_0xa63b('0x27')]=function(_0x3973a9,_0x24d7f0){return db[_0xa63b('0x2d')][_0xa63b('0x47')]({'where':{'id':_0x3973a9[_0xa63b('0x44')]['id']}})['then'](handleEntityNotFound(_0x24d7f0,null))['then'](removeEntity(_0x24d7f0,null))[_0xa63b('0x48')](handleError(_0x24d7f0,null));};exports[_0xa63b('0x51')]=function(_0x4356e3,_0x3f0c7a,_0x2df6a5){return db[_0xa63b('0x2d')][_0xa63b('0x47')]({'where':{'id':_0x4356e3[_0xa63b('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f0c7a,null))[_0xa63b('0x24')](function(_0x30f2ae){if(_0x30f2ae){return _0x30f2ae[_0xa63b('0x51')](_0x4356e3[_0xa63b('0x50')]['ids'],_[_0xa63b('0x52')](_0x4356e3[_0xa63b('0x50')],['ids','id'])||{});}})['then'](respondWithResult(_0x3f0c7a,null))['catch'](handleError(_0x3f0c7a,null));};exports['removeUsers']=function(_0x5f3ae5,_0xf0719d,_0x2c7a93){return db[_0xa63b('0x2d')][_0xa63b('0x47')]({'where':{'id':_0x5f3ae5[_0xa63b('0x44')]['id']}})['then'](handleEntityNotFound(_0xf0719d,null))['then'](function(_0xb03707){if(_0xb03707){return _0xb03707[_0xa63b('0x53')](_0x5f3ae5[_0xa63b('0x33')]['ids'])[_0xa63b('0x24')](function(){if(_[_0xa63b('0x54')](_0x5f3ae5[_0xa63b('0x33')][_0xa63b('0x55')])){for(var _0x26b1d9=0x0;_0x26b1d9<_0x5f3ae5[_0xa63b('0x33')]['ids'][_0xa63b('0x38')];_0x26b1d9+=0x1){socket['emit'](_0xa63b('0x56'),{'UserId':Number(_0x5f3ae5['query'][_0xa63b('0x55')][_0x26b1d9]),'SquareProjectId':Number(_0x5f3ae5[_0xa63b('0x44')]['id'])});}}else{socket['emit'](_0xa63b('0x56'),{'UserId':Number(_0x5f3ae5[_0xa63b('0x33')][_0xa63b('0x55')]),'SquareProjectId':Number(_0x5f3ae5['params']['id'])});}});}})[_0xa63b('0x24')](respondWithStatusCode(_0xf0719d,null))[_0xa63b('0x48')](handleError(_0xf0719d,null));};exports[_0xa63b('0x57')]=function(_0x126801,_0x57aaa6,_0x28be23){var _0x1d113d={};var _0x2778bb={};var _0x1773b0;var _0x45b701;return db['SquareProject'][_0xa63b('0x58')]({'where':{'id':_0x126801[_0xa63b('0x44')]['id']}})[_0xa63b('0x24')](handleEntityNotFound(_0x57aaa6,null))['then'](function(_0x29bcc8){if(_0x29bcc8){_0x1773b0=_0x29bcc8;_0x2778bb['model']=_[_0xa63b('0x45')](db[_0xa63b('0x59')]['rawAttributes']);_0x2778bb['query']=_[_0xa63b('0x45')](_0x126801[_0xa63b('0x33')]);_0x2778bb[_0xa63b('0x34')]=_[_0xa63b('0x35')](_0x2778bb[_0xa63b('0x32')],_0x2778bb[_0xa63b('0x33')]);_0x1d113d[_0xa63b('0x37')]=_[_0xa63b('0x35')](_0x2778bb[_0xa63b('0x32')],qs[_0xa63b('0x36')](_0x126801['query']['fields']));_0x1d113d[_0xa63b('0x37')]=_0x1d113d[_0xa63b('0x37')]['length']?_0x1d113d[_0xa63b('0x37')]:_0x2778bb[_0xa63b('0x32')];_0x1d113d[_0xa63b('0x3a')]=qs[_0xa63b('0x5a')](_0x126801['query'][_0xa63b('0x5a')]);_0x1d113d[_0xa63b('0x3b')]=qs['filters'](_[_0xa63b('0x3c')](_0x126801[_0xa63b('0x33')],_0x2778bb[_0xa63b('0x34')]));if(_0x126801[_0xa63b('0x33')][_0xa63b('0x3f')]){_0x1d113d[_0xa63b('0x3b')]=_[_0xa63b('0x3d')](_0x1d113d[_0xa63b('0x3b')],{'$or':_['map'](_0x1d113d[_0xa63b('0x37')],function(_0xa4ba4c){var _0x34625b={};_0x34625b[_0xa4ba4c]={'$like':'%'+_0x126801[_0xa63b('0x33')]['filter']+'%'};return _0x34625b;})});}_0x1d113d=_[_0xa63b('0x3d')]({},_0x1d113d,_0x126801[_0xa63b('0x40')]);return _0x1773b0['getUsers'](_0x1d113d);}})[_0xa63b('0x24')](function(_0x17f5f1){if(_0x17f5f1){_0x45b701=_0x17f5f1['length'];if(!_0x126801['query']['hasOwnProperty'](_0xa63b('0x5b'))){_0x1d113d[_0xa63b('0x1d')]=qs[_0xa63b('0x1d')](_0x126801[_0xa63b('0x33')]['limit']);_0x1d113d[_0xa63b('0x1b')]=qs[_0xa63b('0x1b')](_0x126801['query'][_0xa63b('0x1b')]);}return _0x1773b0[_0xa63b('0x57')](_0x1d113d);}})[_0xa63b('0x24')](function(_0x211b07){if(_0x211b07){return _0x211b07?{'count':_0x45b701,'rows':_0x211b07}:null;}})[_0xa63b('0x24')](respondWithResult(_0x57aaa6,null))[_0xa63b('0x48')](handleError(_0x57aaa6,null));}; \ No newline at end of file +var _0x99f8=['autoAssociation','catch','update','body','find','params','destroy','addUsers','ids','removeUsers','userSquareProject:remove','emit','getUsers','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./squareProject.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','then','get','SquareProjects','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','SquareProject','findAll','rows','show','includeAll','include','create','role','user','UserProfileSection','userProfileId'];(function(_0x4ba9fb,_0x5d82f2){var _0x573085=function(_0x1ae084){while(--_0x1ae084){_0x4ba9fb['push'](_0x4ba9fb['shift']());}};_0x573085(++_0x5d82f2);}(_0x99f8,0xcc));var _0x899f=function(_0x4115cb,_0xd99479){_0x4115cb=_0x4115cb-0x0;var _0x59726e=_0x99f8[_0x4115cb];return _0x59726e;};'use strict';var emlformat=require(_0x899f('0x0'));var rimraf=require(_0x899f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x899f('0x2'));var rp=require(_0x899f('0x3'));var moment=require(_0x899f('0x4'));var BPromise=require(_0x899f('0x5'));var Mustache=require(_0x899f('0x6'));var util=require('util');var path=require(_0x899f('0x7'));var sox=require(_0x899f('0x8'));var csv=require(_0x899f('0x9'));var ejs=require(_0x899f('0xa'));var fs=require('fs');var fs_extra=require(_0x899f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x899f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x899f('0xd'));var toCsv=require(_0x899f('0x9'));var querystring=require(_0x899f('0xe'));var Papa=require(_0x899f('0xf'));var Redis=require(_0x899f('0x10'));var authService=require(_0x899f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x899f('0x12'));var logger=require(_0x899f('0x13'))(_0x899f('0x14'));var utils=require(_0x899f('0x15'));var config=require(_0x899f('0x16'));var licenseUtil=require(_0x899f('0x17'));var db=require('../../mysqldb')['db'];config[_0x899f('0x18')]=_[_0x899f('0x19')](config[_0x899f('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x899f('0x18')]));require(_0x899f('0x1a'))[_0x899f('0x1b')](socket);function respondWithStatusCode(_0x140bab,_0x2721ef){_0x2721ef=_0x2721ef||0xcc;return function(_0x49158a){if(_0x49158a){return _0x140bab[_0x899f('0x1c')](_0x2721ef);}return _0x140bab[_0x899f('0x1d')](_0x2721ef)[_0x899f('0x1e')]();};}function respondWithResult(_0x506969,_0x96f2){_0x96f2=_0x96f2||0xc8;return function(_0x3a3164){if(_0x3a3164){return _0x506969[_0x899f('0x1d')](_0x96f2)['json'](_0x3a3164);}};}function respondWithFilteredResult(_0x4b25f5,_0x38084c){return function(_0x318ba3){if(_0x318ba3){var _0x39ad32=typeof _0x38084c[_0x899f('0x1f')]===_0x899f('0x20')&&typeof _0x38084c[_0x899f('0x21')]==='undefined';var _0x4811c8=_0x318ba3[_0x899f('0x22')];var _0x48ee4e=_0x39ad32?0x0:_0x38084c['offset'];var _0x245a63=_0x39ad32?_0x318ba3[_0x899f('0x22')]:_0x38084c[_0x899f('0x1f')]+_0x38084c[_0x899f('0x21')];var _0x782394;if(_0x245a63>=_0x4811c8){_0x245a63=_0x4811c8;_0x782394=0xc8;}else{_0x782394=0xce;}_0x4b25f5['status'](_0x782394);return _0x4b25f5['set'](_0x899f('0x23'),_0x48ee4e+'-'+_0x245a63+'/'+_0x4811c8)[_0x899f('0x24')](_0x318ba3);}return null;};}function patchUpdates(_0x20d7b6){return function(_0x22347a){try{jsonpatch[_0x899f('0x25')](_0x22347a,_0x20d7b6,!![]);}catch(_0x22df5f){return BPromise[_0x899f('0x26')](_0x22df5f);}return _0x22347a['save']();};}function saveUpdates(_0x130b94,_0x1099dd){return function(_0x4c29e0){if(_0x4c29e0){return _0x4c29e0['update'](_0x130b94)['then'](function(_0x4ac2ea){return _0x4ac2ea;});}return null;};}function removeEntity(_0x10bf67,_0x1fb213){return function(_0x5b5ae5){if(_0x5b5ae5){return _0x5b5ae5['destroy']()[_0x899f('0x27')](function(){var _0x2b2c6e=_0x5b5ae5[_0x899f('0x28')]({'plain':!![]});var _0x1f5a6c=_0x899f('0x29');return db[_0x899f('0x2a')]['destroy']({'where':{'type':_0x1f5a6c,'resourceId':_0x2b2c6e['id']}})[_0x899f('0x27')](function(){return _0x5b5ae5;});})[_0x899f('0x27')](function(){_0x10bf67[_0x899f('0x1d')](0xcc)[_0x899f('0x1e')]();});}};}function handleEntityNotFound(_0x34017c,_0x343214){return function(_0x154b3d){if(!_0x154b3d){_0x34017c['sendStatus'](0x194);}return _0x154b3d;};}function handleError(_0x1efae1,_0x35e86e){_0x35e86e=_0x35e86e||0x1f4;return function(_0x3e4f18){logger[_0x899f('0x2b')](_0x3e4f18[_0x899f('0x2c')]);if(_0x3e4f18['name']){delete _0x3e4f18[_0x899f('0x2d')];}_0x1efae1[_0x899f('0x1d')](_0x35e86e)[_0x899f('0x2e')](_0x3e4f18);};}exports[_0x899f('0x2f')]=function(_0x102ca0,_0x11e7c1){var _0x274811={},_0x396803={},_0x45d925={'count':0x0,'rows':[]};var _0x43576c=_[_0x899f('0x30')](db['SquareProject'][_0x899f('0x31')],function(_0xc81a9e){return{'name':_0xc81a9e[_0x899f('0x32')],'type':_0xc81a9e[_0x899f('0x33')][_0x899f('0x34')]};});_0x396803[_0x899f('0x35')]=_[_0x899f('0x30')](_0x43576c,'name');_0x396803[_0x899f('0x36')]=_[_0x899f('0x37')](_0x102ca0[_0x899f('0x36')]);_0x396803[_0x899f('0x38')]=_[_0x899f('0x39')](_0x396803[_0x899f('0x35')],_0x396803[_0x899f('0x36')]);_0x274811['attributes']=_['intersection'](_0x396803['model'],qs['fields'](_0x102ca0[_0x899f('0x36')][_0x899f('0x3a')]));_0x274811[_0x899f('0x3b')]=_0x274811[_0x899f('0x3b')][_0x899f('0x3c')]?_0x274811[_0x899f('0x3b')]:_0x396803[_0x899f('0x35')];if(!_0x102ca0['query'][_0x899f('0x3d')]('nolimit')){_0x274811[_0x899f('0x21')]=qs[_0x899f('0x21')](_0x102ca0[_0x899f('0x36')][_0x899f('0x21')]);_0x274811[_0x899f('0x1f')]=qs[_0x899f('0x1f')](_0x102ca0[_0x899f('0x36')][_0x899f('0x1f')]);}_0x274811[_0x899f('0x3e')]=qs[_0x899f('0x3f')](_0x102ca0['query'][_0x899f('0x3f')]);_0x274811[_0x899f('0x40')]=qs[_0x899f('0x38')](_[_0x899f('0x41')](_0x102ca0['query'],_0x396803[_0x899f('0x38')]),_0x43576c);if(_0x102ca0[_0x899f('0x36')]['filter']){_0x274811[_0x899f('0x40')]=_[_0x899f('0x42')](_0x274811['where'],{'$or':_[_0x899f('0x30')](_0x43576c,function(_0x584960){if(_0x584960[_0x899f('0x33')]!==_0x899f('0x43')){var _0x5d8a66={};_0x5d8a66[_0x584960[_0x899f('0x2d')]]={'$like':'%'+_0x102ca0[_0x899f('0x36')][_0x899f('0x44')]+'%'};return _0x5d8a66;}})});}_0x274811=_['merge']({},_0x274811,_0x102ca0[_0x899f('0x45')]);var _0x14e49f={'where':_0x274811['where']};return db['SquareProject'][_0x899f('0x22')](_0x14e49f)[_0x899f('0x27')](function(_0x1bf273){_0x45d925[_0x899f('0x22')]=_0x1bf273;if(_0x102ca0[_0x899f('0x36')]['includeAll']){_0x274811['include']=[{'all':!![]}];}return db[_0x899f('0x46')][_0x899f('0x47')](_0x274811);})[_0x899f('0x27')](function(_0x2e3e14){_0x45d925[_0x899f('0x48')]=_0x2e3e14;return _0x45d925;})[_0x899f('0x27')](respondWithFilteredResult(_0x11e7c1,_0x274811))['catch'](handleError(_0x11e7c1,null));};exports[_0x899f('0x49')]=function(_0x463e6d,_0x34e944){var _0x28cb21={'raw':![],'where':{'id':_0x463e6d['params']['id']}},_0x53144c={};_0x53144c['model']=_[_0x899f('0x37')](db[_0x899f('0x46')]['rawAttributes']);_0x53144c[_0x899f('0x36')]=_[_0x899f('0x37')](_0x463e6d[_0x899f('0x36')]);_0x53144c['filters']=_['intersection'](_0x53144c[_0x899f('0x35')],_0x53144c[_0x899f('0x36')]);_0x28cb21[_0x899f('0x3b')]=_[_0x899f('0x39')](_0x53144c[_0x899f('0x35')],qs[_0x899f('0x3a')](_0x463e6d[_0x899f('0x36')][_0x899f('0x3a')]));_0x28cb21[_0x899f('0x3b')]=_0x28cb21[_0x899f('0x3b')][_0x899f('0x3c')]?_0x28cb21[_0x899f('0x3b')]:_0x53144c[_0x899f('0x35')];if(_0x463e6d['query'][_0x899f('0x4a')]){_0x28cb21[_0x899f('0x4b')]=[{'all':!![]}];}_0x28cb21=_[_0x899f('0x42')]({},_0x28cb21,_0x463e6d[_0x899f('0x45')]);return db[_0x899f('0x46')]['find'](_0x28cb21)[_0x899f('0x27')](handleEntityNotFound(_0x34e944,null))[_0x899f('0x27')](respondWithResult(_0x34e944,null))['catch'](handleError(_0x34e944,null));};exports[_0x899f('0x4c')]=function(_0x3e8aad,_0x598401){return db[_0x899f('0x46')][_0x899f('0x4c')](_0x3e8aad['body'],{})[_0x899f('0x27')](function(_0x45e142){var _0x4744b1=_0x3e8aad['user']['get']({'plain':!![]});if(!_0x4744b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4744b1[_0x899f('0x4d')]===_0x899f('0x4e')){var _0x4d5bd1=_0x45e142['get']({'plain':!![]});var _0x1b112d=_0x899f('0x29');return db[_0x899f('0x4f')]['find']({'where':{'name':_0x1b112d,'userProfileId':_0x4744b1[_0x899f('0x50')]},'raw':!![]})['then'](function(_0x3e6ef0){if(_0x3e6ef0&&_0x3e6ef0[_0x899f('0x51')]===0x0){return db[_0x899f('0x2a')][_0x899f('0x4c')]({'name':_0x4d5bd1[_0x899f('0x2d')],'resourceId':_0x4d5bd1['id'],'type':_0x3e6ef0['name'],'sectionId':_0x3e6ef0['id']},{})[_0x899f('0x27')](function(){return _0x45e142;});}else{return _0x45e142;}})[_0x899f('0x52')](function(_0x2c9a7e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c9a7e);throw _0x2c9a7e;});}return _0x45e142;})[_0x899f('0x27')](respondWithResult(_0x598401,0xc9))[_0x899f('0x52')](handleError(_0x598401,null));};exports[_0x899f('0x53')]=function(_0x593199,_0x722415){if(_0x593199['body']['id']){delete _0x593199[_0x899f('0x54')]['id'];}return db['SquareProject'][_0x899f('0x55')]({'where':{'id':_0x593199[_0x899f('0x56')]['id']}})[_0x899f('0x27')](handleEntityNotFound(_0x722415,null))['then'](saveUpdates(_0x593199[_0x899f('0x54')],null))[_0x899f('0x27')](respondWithResult(_0x722415,null))[_0x899f('0x52')](handleError(_0x722415,null));};exports[_0x899f('0x57')]=function(_0x5cfb3d,_0x15e10a){return db[_0x899f('0x46')][_0x899f('0x55')]({'where':{'id':_0x5cfb3d['params']['id']}})[_0x899f('0x27')](handleEntityNotFound(_0x15e10a,null))[_0x899f('0x27')](removeEntity(_0x15e10a,null))['catch'](handleError(_0x15e10a,null));};exports['addUsers']=function(_0x23c23a,_0x8cc441,_0x280843){return db[_0x899f('0x46')][_0x899f('0x55')]({'where':{'id':_0x23c23a['params']['id']}})[_0x899f('0x27')](handleEntityNotFound(_0x8cc441,null))[_0x899f('0x27')](function(_0x11ce9f){if(_0x11ce9f){return _0x11ce9f[_0x899f('0x58')](_0x23c23a['body']['ids'],_['omit'](_0x23c23a['body'],[_0x899f('0x59'),'id'])||{});}})[_0x899f('0x27')](respondWithResult(_0x8cc441,null))[_0x899f('0x52')](handleError(_0x8cc441,null));};exports[_0x899f('0x5a')]=function(_0x26f389,_0x49ae36,_0x57eaf0){return db[_0x899f('0x46')][_0x899f('0x55')]({'where':{'id':_0x26f389[_0x899f('0x56')]['id']}})[_0x899f('0x27')](handleEntityNotFound(_0x49ae36,null))['then'](function(_0x4782ce){if(_0x4782ce){return _0x4782ce[_0x899f('0x5a')](_0x26f389[_0x899f('0x36')]['ids'])[_0x899f('0x27')](function(){if(_['isArray'](_0x26f389['query'][_0x899f('0x59')])){for(var _0x3d4d23=0x0;_0x3d4d23<_0x26f389[_0x899f('0x36')][_0x899f('0x59')][_0x899f('0x3c')];_0x3d4d23+=0x1){socket['emit'](_0x899f('0x5b'),{'UserId':Number(_0x26f389['query'][_0x899f('0x59')][_0x3d4d23]),'SquareProjectId':Number(_0x26f389[_0x899f('0x56')]['id'])});}}else{socket[_0x899f('0x5c')](_0x899f('0x5b'),{'UserId':Number(_0x26f389[_0x899f('0x36')][_0x899f('0x59')]),'SquareProjectId':Number(_0x26f389[_0x899f('0x56')]['id'])});}});}})[_0x899f('0x27')](respondWithStatusCode(_0x49ae36,null))[_0x899f('0x52')](handleError(_0x49ae36,null));};exports[_0x899f('0x5d')]=function(_0x27b18d,_0x472c75,_0x3ff4c2){var _0x3b722f={};var _0x3ae64e={};var _0x5d0c24;var _0x52f3c6;return db[_0x899f('0x46')]['findOne']({'where':{'id':_0x27b18d['params']['id']}})[_0x899f('0x27')](handleEntityNotFound(_0x472c75,null))[_0x899f('0x27')](function(_0x132973){if(_0x132973){_0x5d0c24=_0x132973;_0x3ae64e[_0x899f('0x35')]=_[_0x899f('0x37')](db['User'][_0x899f('0x31')]);_0x3ae64e[_0x899f('0x36')]=_[_0x899f('0x37')](_0x27b18d[_0x899f('0x36')]);_0x3ae64e[_0x899f('0x38')]=_[_0x899f('0x39')](_0x3ae64e[_0x899f('0x35')],_0x3ae64e[_0x899f('0x36')]);_0x3b722f[_0x899f('0x3b')]=_[_0x899f('0x39')](_0x3ae64e['model'],qs[_0x899f('0x3a')](_0x27b18d['query'][_0x899f('0x3a')]));_0x3b722f[_0x899f('0x3b')]=_0x3b722f['attributes'][_0x899f('0x3c')]?_0x3b722f['attributes']:_0x3ae64e[_0x899f('0x35')];_0x3b722f[_0x899f('0x3e')]=qs[_0x899f('0x3f')](_0x27b18d[_0x899f('0x36')][_0x899f('0x3f')]);_0x3b722f[_0x899f('0x40')]=qs[_0x899f('0x38')](_[_0x899f('0x41')](_0x27b18d[_0x899f('0x36')],_0x3ae64e['filters']));if(_0x27b18d['query'][_0x899f('0x44')]){_0x3b722f[_0x899f('0x40')]=_[_0x899f('0x42')](_0x3b722f[_0x899f('0x40')],{'$or':_[_0x899f('0x30')](_0x3b722f[_0x899f('0x3b')],function(_0x3cf8bf){var _0x3b0ce3={};_0x3b0ce3[_0x3cf8bf]={'$like':'%'+_0x27b18d[_0x899f('0x36')]['filter']+'%'};return _0x3b0ce3;})});}_0x3b722f=_[_0x899f('0x42')]({},_0x3b722f,_0x27b18d[_0x899f('0x45')]);return _0x5d0c24['getUsers'](_0x3b722f);}})['then'](function(_0x2749ea){if(_0x2749ea){_0x52f3c6=_0x2749ea['length'];if(!_0x27b18d[_0x899f('0x36')][_0x899f('0x3d')](_0x899f('0x5e'))){_0x3b722f[_0x899f('0x21')]=qs[_0x899f('0x21')](_0x27b18d[_0x899f('0x36')][_0x899f('0x21')]);_0x3b722f[_0x899f('0x1f')]=qs[_0x899f('0x1f')](_0x27b18d[_0x899f('0x36')][_0x899f('0x1f')]);}return _0x5d0c24[_0x899f('0x5d')](_0x3b722f);}})[_0x899f('0x27')](function(_0x5cf7b5){if(_0x5cf7b5){return _0x5cf7b5?{'count':_0x52f3c6,'rows':_0x5cf7b5}:null;}})[_0x899f('0x27')](respondWithResult(_0x472c75,null))['catch'](handleError(_0x472c75,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 74b05f8..e342f26 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 _0xea1b=['SquareProject','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x252afc,_0x302af5){var _0x2c71bb=function(_0x1c8251){while(--_0x1c8251){_0x252afc['push'](_0x252afc['shift']());}};_0x2c71bb(++_0x302af5);}(_0xea1b,0x8f));var _0xbea1=function(_0x4681d1,_0x5823ea){_0x4681d1=_0x4681d1-0x0;var _0x4bf18c=_0xea1b[_0x4681d1];return _0x4bf18c;};'use strict';var EventEmitter=require(_0xbea1('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xbea1('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xbea1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbea1('0x3'),'afterDestroy':_0xbea1('0x4')};function emitEvent(_0x5d6f2f){return function(_0x2e409c,_0x5b87fc,_0x5d96a4){SquareProjectEvents['emit'](_0x5d6f2f+':'+_0x2e409c['id'],_0x2e409c);SquareProjectEvents[_0xbea1('0x5')](_0x5d6f2f,_0x2e409c);_0x5d96a4(null);};}for(var e in events){if(events[_0xbea1('0x6')](e)){var event=events[e];SquareProject[_0xbea1('0x7')](e,emitEvent(event));}}module[_0xbea1('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x4222=['emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners','update','remove'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0x4222,0x1ce));var _0x2422=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x4222[_0x1969a7];return _0x3d665f;};'use strict';var EventEmitter=require(_0x2422('0x0'));var SquareProject=require(_0x2422('0x1'))['db'][_0x2422('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2422('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2422('0x4'),'afterDestroy':_0x2422('0x5')};function emitEvent(_0x150873){return function(_0x55e1a4,_0x10892f,_0x1664b1){SquareProjectEvents[_0x2422('0x6')](_0x150873+':'+_0x55e1a4['id'],_0x55e1a4);SquareProjectEvents[_0x2422('0x6')](_0x150873,_0x55e1a4);_0x1664b1(null);};}for(var e in events){if(events[_0x2422('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x2422('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index ea16130..3e6ce7f 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 _0x9f89=['exports','SquareProject','square_projects','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','format','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d63da,_0x4c6968){var _0x37fe1f=function(_0x2a58dd){while(--_0x2a58dd){_0x3d63da['push'](_0x3d63da['shift']());}};_0x37fe1f(++_0x4c6968);}(_0x9f89,0x1de));var _0x99f8=function(_0x12dc1f,_0x395cec){_0x12dc1f=_0x12dc1f-0x0;var _0x47fdb8=_0x9f89[_0x12dc1f];return _0x47fdb8;};'use strict';var _=require('lodash');var util=require(_0x99f8('0x0'));var logger=require(_0x99f8('0x1'))('api');var moment=require(_0x99f8('0x2'));var BPromise=require(_0x99f8('0x3'));var rp=require(_0x99f8('0x4'));var fs=require('fs');var path=require(_0x99f8('0x5'));var rimraf=require(_0x99f8('0x6'));var config=require(_0x99f8('0x7'));var attributes=require('./squareProject.attributes');module[_0x99f8('0x8')]=function(_0x4ae388,_0x5418fa){return _0x4ae388['define'](_0x99f8('0x9'),attributes,{'tableName':_0x99f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f7420,_0x31f490,_0x2439b4){if(_0x4f7420['changed'](_0x99f8('0xb'))){_0x4f7420[_0x99f8('0xc')]=moment()['format'](_0x99f8('0xd'));}if(_0x4f7420[_0x99f8('0xe')](_0x99f8('0xf'))){_0x4f7420[_0x99f8('0x10')]=moment()[_0x99f8('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2439b4(null,_0x4f7420);}}});}; \ No newline at end of file +var _0xf927=['changed','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','savedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x48f5ba,_0x434092){var _0x1aaabf=function(_0x7a7f3f){while(--_0x7a7f3f){_0x48f5ba['push'](_0x48f5ba['shift']());}};_0x1aaabf(++_0x434092);}(_0xf927,0x120));var _0x7f92=function(_0x3d0085,_0x5ef723){_0x3d0085=_0x3d0085-0x0;var _0x1be930=_0xf927[_0x3d0085];return _0x1be930;};'use strict';var _=require(_0x7f92('0x0'));var util=require(_0x7f92('0x1'));var logger=require(_0x7f92('0x2'))(_0x7f92('0x3'));var moment=require(_0x7f92('0x4'));var BPromise=require(_0x7f92('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f92('0x6'));var rimraf=require('rimraf');var config=require(_0x7f92('0x7'));var attributes=require('./squareProject.attributes');module[_0x7f92('0x8')]=function(_0x1a3c1c,_0x3a3f3f){return _0x1a3c1c['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x297dce,_0x4d1747,_0x1674af){if(_0x297dce['changed']('preproduction')){_0x297dce[_0x7f92('0x9')]=moment()[_0x7f92('0xa')](_0x7f92('0xb'));}if(_0x297dce[_0x7f92('0xc')](_0x7f92('0xd'))){_0x297dce[_0x7f92('0xe')]=moment()[_0x7f92('0xa')](_0x7f92('0xb'));}_0x1674af(null,_0x297dce);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 26cd6e6..b8d6503 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 _0xa295=['SquareProject','find','options','attributes','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject'];(function(_0x5f2116,_0x55c6c4){var _0x93adff=function(_0x491eda){while(--_0x491eda){_0x5f2116['push'](_0x5f2116['shift']());}};_0x93adff(++_0x55c6c4);}(_0xa295,0x194));var _0x5a29=function(_0x4c1562,_0x552b65){_0x4c1562=_0x4c1562-0x0;var _0x19255b=_0xa295[_0x4c1562];return _0x19255b;};'use strict';var _=require('lodash');var util=require(_0x5a29('0x0'));var moment=require(_0x5a29('0x1'));var BPromise=require(_0x5a29('0x2'));var rs=require(_0x5a29('0x3'));var fs=require('fs');var Redis=require(_0x5a29('0x4'));var db=require(_0x5a29('0x5'))['db'];var utils=require(_0x5a29('0x6'));var logger=require('../../config/logger')(_0x5a29('0x7'));var config=require(_0x5a29('0x8'));var jayson=require(_0x5a29('0x9'));var client=jayson[_0x5a29('0xa')]['http']({'port':0x232a});config[_0x5a29('0xb')]=_[_0x5a29('0xc')](config[_0x5a29('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5a29('0xd'))(new Redis(config[_0x5a29('0xb')]));require('./squareProject.socket')[_0x5a29('0xe')](socket);function respondWithRpcPromise(_0x1b0891,_0x4e4b96,_0x44c179){return new BPromise(function(_0x3ec41b,_0x514b84){return client[_0x5a29('0xf')](_0x1b0891,_0x44c179)['then'](function(_0x405a92){logger[_0x5a29('0x10')](_0x5a29('0x11'),_0x4e4b96,_0x5a29('0x12'));logger[_0x5a29('0x13')](_0x5a29('0x14'),_0x4e4b96,'request\x20sent',JSON[_0x5a29('0x15')](_0x405a92));if(_0x405a92['error']){if(_0x405a92[_0x5a29('0x16')][_0x5a29('0x17')]===0x1f4){logger[_0x5a29('0x16')](_0x5a29('0x11'),_0x4e4b96,_0x405a92[_0x5a29('0x16')]['message']);return _0x514b84(_0x405a92[_0x5a29('0x16')][_0x5a29('0x18')]);}logger[_0x5a29('0x16')]('SquareProject,\x20%s,\x20%s',_0x4e4b96,_0x405a92['error']['message']);return _0x3ec41b(_0x405a92[_0x5a29('0x16')]['message']);}else{logger[_0x5a29('0x10')](_0x5a29('0x11'),_0x4e4b96,_0x5a29('0x12'));_0x3ec41b(_0x405a92[_0x5a29('0x19')]['message']);}})[_0x5a29('0x1a')](function(_0x32d3b8){logger[_0x5a29('0x16')](_0x5a29('0x11'),_0x4e4b96,_0x32d3b8);_0x514b84(_0x32d3b8);});});}exports[_0x5a29('0x1b')]=function(_0x285490){var _0x544e93=this;return new Promise(function(_0xb3a719,_0x517bc5){return db[_0x5a29('0x1c')][_0x5a29('0x1d')]({'raw':_0x285490[_0x5a29('0x1e')]?_0x285490[_0x5a29('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x285490['options']?_0x285490[_0x5a29('0x1e')]['where']||null:null,'attributes':_0x285490[_0x5a29('0x1e')]?_0x285490[_0x5a29('0x1e')][_0x5a29('0x1f')]||null:null,'include':_0x285490[_0x5a29('0x1e')]?_0x285490[_0x5a29('0x1e')]['include']?_[_0x5a29('0x20')](_0x285490[_0x5a29('0x1e')][_0x5a29('0x21')],function(_0x4656a4){return{'model':db[_0x4656a4[_0x5a29('0x22')]],'as':_0x4656a4['as'],'attributes':_0x4656a4['attributes'],'include':_0x4656a4[_0x5a29('0x21')]?_[_0x5a29('0x20')](_0x4656a4[_0x5a29('0x21')],function(_0x3d792e){return{'model':db[_0x3d792e['model']],'as':_0x3d792e['as'],'attributes':_0x3d792e[_0x5a29('0x1f')],'include':_0x3d792e[_0x5a29('0x21')]?_['map'](_0x3d792e[_0x5a29('0x21')],function(_0x570d37){return{'model':db[_0x570d37[_0x5a29('0x22')]],'as':_0x570d37['as'],'attributes':_0x570d37[_0x5a29('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5a29('0x23')](function(_0xd929b1){logger[_0x5a29('0x10')]('ShowSquareProject',_0x285490);logger[_0x5a29('0x13')]('ShowSquareProject',_0x285490,JSON[_0x5a29('0x15')](_0xd929b1));_0xb3a719(_0xd929b1);})[_0x5a29('0x1a')](function(_0xb2115a){logger[_0x5a29('0x16')]('ShowSquareProject',_0xb2115a[_0x5a29('0x18')],_0x285490);_0x517bc5(_0x544e93[_0x5a29('0x16')](0x1f4,_0xb2115a[_0x5a29('0x18')]));});});}; \ No newline at end of file +var _0x59ec=['raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','ShowSquareProject','SquareProject','options'];(function(_0x1b1e01,_0x53c575){var _0x3bd00e=function(_0x255e2c){while(--_0x255e2c){_0x1b1e01['push'](_0x1b1e01['shift']());}};_0x3bd00e(++_0x53c575);}(_0x59ec,0x102));var _0xc59e=function(_0x428028,_0x16296e){_0x428028=_0x428028-0x0;var _0x53dccb=_0x59ec[_0x428028];return _0x53dccb;};'use strict';var _=require(_0xc59e('0x0'));var util=require(_0xc59e('0x1'));var moment=require('moment');var BPromise=require(_0xc59e('0x2'));var rs=require(_0xc59e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc59e('0x4'))['db'];var utils=require(_0xc59e('0x5'));var logger=require(_0xc59e('0x6'))(_0xc59e('0x7'));var config=require(_0xc59e('0x8'));var jayson=require(_0xc59e('0x9'));var client=jayson[_0xc59e('0xa')][_0xc59e('0xb')]({'port':0x232a});config[_0xc59e('0xc')]=_[_0xc59e('0xd')](config[_0xc59e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc59e('0xe'))(new Redis(config[_0xc59e('0xc')]));require('./squareProject.socket')[_0xc59e('0xf')](socket);function respondWithRpcPromise(_0x57fa06,_0x3b365a,_0x5e0dff){return new BPromise(function(_0x5690be,_0x19d954){return client[_0xc59e('0x10')](_0x57fa06,_0x5e0dff)[_0xc59e('0x11')](function(_0x78d23a){logger['info'](_0xc59e('0x12'),_0x3b365a,'request\x20sent');logger[_0xc59e('0x13')](_0xc59e('0x14'),_0x3b365a,'request\x20sent',JSON[_0xc59e('0x15')](_0x78d23a));if(_0x78d23a[_0xc59e('0x16')]){if(_0x78d23a[_0xc59e('0x16')]['code']===0x1f4){logger['error'](_0xc59e('0x12'),_0x3b365a,_0x78d23a['error'][_0xc59e('0x17')]);return _0x19d954(_0x78d23a[_0xc59e('0x16')]['message']);}logger['error'](_0xc59e('0x12'),_0x3b365a,_0x78d23a[_0xc59e('0x16')]['message']);return _0x5690be(_0x78d23a[_0xc59e('0x16')][_0xc59e('0x17')]);}else{logger[_0xc59e('0x18')]('SquareProject,\x20%s,\x20%s',_0x3b365a,_0xc59e('0x19'));_0x5690be(_0x78d23a['result'][_0xc59e('0x17')]);}})[_0xc59e('0x1a')](function(_0x5aa256){logger['error'](_0xc59e('0x12'),_0x3b365a,_0x5aa256);_0x19d954(_0x5aa256);});});}exports[_0xc59e('0x1b')]=function(_0x53333d){var _0x73efd2=this;return new Promise(function(_0x43bbf2,_0x15cb06){return db[_0xc59e('0x1c')]['find']({'raw':_0x53333d[_0xc59e('0x1d')]?_0x53333d[_0xc59e('0x1d')][_0xc59e('0x1e')]===undefined?!![]:![]:!![],'where':_0x53333d['options']?_0x53333d[_0xc59e('0x1d')][_0xc59e('0x1f')]||null:null,'attributes':_0x53333d[_0xc59e('0x1d')]?_0x53333d[_0xc59e('0x1d')][_0xc59e('0x20')]||null:null,'include':_0x53333d['options']?_0x53333d[_0xc59e('0x1d')][_0xc59e('0x21')]?_[_0xc59e('0x22')](_0x53333d[_0xc59e('0x1d')][_0xc59e('0x21')],function(_0x5f5a2b){return{'model':db[_0x5f5a2b[_0xc59e('0x23')]],'as':_0x5f5a2b['as'],'attributes':_0x5f5a2b[_0xc59e('0x20')],'include':_0x5f5a2b[_0xc59e('0x21')]?_[_0xc59e('0x22')](_0x5f5a2b[_0xc59e('0x21')],function(_0x4a93fc){return{'model':db[_0x4a93fc[_0xc59e('0x23')]],'as':_0x4a93fc['as'],'attributes':_0x4a93fc[_0xc59e('0x20')],'include':_0x4a93fc[_0xc59e('0x21')]?_[_0xc59e('0x22')](_0x4a93fc[_0xc59e('0x21')],function(_0x579efb){return{'model':db[_0x579efb[_0xc59e('0x23')]],'as':_0x579efb['as'],'attributes':_0x579efb[_0xc59e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc59e('0x11')](function(_0x30f15a){logger[_0xc59e('0x18')](_0xc59e('0x1b'),_0x53333d);logger['debug']('ShowSquareProject',_0x53333d,JSON[_0xc59e('0x15')](_0x30f15a));_0x43bbf2(_0x30f15a);})[_0xc59e('0x1a')](function(_0x10b1d9){logger[_0xc59e('0x16')](_0xc59e('0x1b'),_0x10b1d9[_0xc59e('0x17')],_0x53333d);_0x15cb06(_0x73efd2[_0xc59e('0x16')](0x1f4,_0x10b1d9[_0xc59e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 1107ea2..1c6387d 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 _0xc27f=['./squareProject.events','save','remove','register','length','squareProject:'];(function(_0x1ea99d,_0x2d4fa9){var _0x2e2430=function(_0x33596d){while(--_0x33596d){_0x1ea99d['push'](_0x1ea99d['shift']());}};_0x2e2430(++_0x2d4fa9);}(_0xc27f,0x78));var _0xfc27=function(_0x569c69,_0x4658bd){_0x569c69=_0x569c69-0x0;var _0x33079b=_0xc27f[_0x569c69];return _0x33079b;};'use strict';var SquareProjectEvents=require(_0xfc27('0x0'));var events=[_0xfc27('0x1'),_0xfc27('0x2'),'update'];function createListener(_0x1f6c54,_0x486ba9){return function(_0x4fee80){_0x486ba9['emit'](_0x1f6c54,_0x4fee80);};}function removeListener(_0x1fb44f,_0x456ed7){return function(){SquareProjectEvents['removeListener'](_0x1fb44f,_0x456ed7);};}exports[_0xfc27('0x3')]=function(_0xc1824e){for(var _0x435a4a=0x0,_0x3ce2bd=events[_0xfc27('0x4')];_0x435a4a<_0x3ce2bd;_0x435a4a++){var _0x5a2d75=events[_0x435a4a];var _0x5d1ff7=createListener(_0xfc27('0x5')+_0x5a2d75,_0xc1824e);SquareProjectEvents['on'](_0x5a2d75,_0x5d1ff7);}}; \ No newline at end of file +var _0x5bdf=['remove','emit','register','squareProject:','./squareProject.events','save'];(function(_0x31dff6,_0x3b2578){var _0x3a3998=function(_0x498ee2){while(--_0x498ee2){_0x31dff6['push'](_0x31dff6['shift']());}};_0x3a3998(++_0x3b2578);}(_0x5bdf,0xe8));var _0xf5bd=function(_0x33dd4e,_0x22a7f7){_0x33dd4e=_0x33dd4e-0x0;var _0x345007=_0x5bdf[_0x33dd4e];return _0x345007;};'use strict';var SquareProjectEvents=require(_0xf5bd('0x0'));var events=[_0xf5bd('0x1'),_0xf5bd('0x2'),'update'];function createListener(_0x2ce85a,_0x589239){return function(_0x39e9f8){_0x589239[_0xf5bd('0x3')](_0x2ce85a,_0x39e9f8);};}function removeListener(_0x1313ba,_0x454de7){return function(){SquareProjectEvents['removeListener'](_0x1313ba,_0x454de7);};}exports[_0xf5bd('0x4')]=function(_0x14ec1f){for(var _0x528006=0x0,_0x3751df=events['length'];_0x528006<_0x3751df;_0x528006++){var _0x16450d=events[_0x528006];var _0xa921c9=createListener(_0xf5bd('0x5')+_0x16450d,_0x14ec1f);SquareProjectEvents['on'](_0x16450d,_0xa921c9);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index d5bcdaa..57f6094 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 _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x3792f7,_0x4ec0d3){var _0xc4dd01=function(_0x493fba){while(--_0x493fba){_0x3792f7['push'](_0x3792f7['shift']());}};_0xc4dd01(++_0x4ec0d3);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x16f5d5,_0x184bb0){_0x16f5d5=_0x16f5d5-0x0;var _0x1b9f8c=_0x7fbe[_0x16f5d5];return _0x1b9f8c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x23a3a7,_0x430850){var _0xc9ba61=function(_0x3630d2){while(--_0x3630d2){_0x23a3a7['push'](_0x23a3a7['shift']());}};_0xc9ba61(++_0x430850);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4dfe4d,_0x5366ec){_0x4dfe4d=_0x4dfe4d-0x0;var _0x37b850=_0x1cb9[_0x4dfe4d];return _0x37b850;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index aa065a4..323aec7 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 _0x6aa7=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x6aa7,0x178));var _0x76aa=function(_0x6d76e,_0xc6837){_0x6d76e=_0x6d76e-0x0;var _0x49d5a2=_0x6aa7[_0x6d76e];return _0x49d5a2;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'callerid':{'type':Sequelize[_0x76aa('0x1')]},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'context':{'type':Sequelize[_0x76aa('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x1')]},'accountcode':{'type':Sequelize[_0x76aa('0x1')]},'dnid':{'type':Sequelize[_0x76aa('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x76aa('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x76aa('0x2')],'get':function(){var _0x36d12b='';var _0xa9b695=this['getDataValue'](_0x76aa('0x3'));if(_0xa9b695){_0x36d12b=_0xa9b695[_0x76aa('0x4')](_0xa9b695[_0x76aa('0x5')]('.'));}return _0x36d12b;}}}; \ No newline at end of file +var _0xf494=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xf494,0x1c6));var _0x4f49=function(_0x4a971c,_0x479c11){_0x4a971c=_0x4a971c-0x0;var _0x28037f=_0xf494[_0x4a971c];return _0x28037f;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'uniqueid':{'type':Sequelize[_0x4f49('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4f49('0x2')]},'context':{'type':Sequelize[_0x4f49('0x2')]},'extension':{'type':Sequelize[_0x4f49('0x2')]},'priority':{'type':Sequelize[_0x4f49('0x2')]},'accountcode':{'type':Sequelize[_0x4f49('0x2')]},'dnid':{'type':Sequelize[_0x4f49('0x2')]},'projectName':{'type':Sequelize[_0x4f49('0x2')]},'saveName':{'type':Sequelize[_0x4f49('0x2')]},'filename':{'type':Sequelize[_0x4f49('0x2')]},'savePath':{'type':Sequelize[_0x4f49('0x2')]},'format':{'type':Sequelize[_0x4f49('0x3')],'get':function(){var _0x5eb186='';var _0x58e9a0=this[_0x4f49('0x4')](_0x4f49('0x5'));if(_0x58e9a0){_0x5eb186=_0x58e9a0[_0x4f49('0x6')](_0x58e9a0[_0x4f49('0x7')]('.'));}return _0x5eb186;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 76135db..7f8e60a 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 _0xe67d=['../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','SquareRecording','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','download'];(function(_0x3db7af,_0x2cad9d){var _0xc3be08=function(_0x4ba47d){while(--_0x4ba47d){_0x3db7af['push'](_0x3db7af['shift']());}};_0xc3be08(++_0x2cad9d);}(_0xe67d,0xd4));var _0xde67=function(_0x497948,_0x4ca60c){_0x497948=_0x497948-0x0;var _0x39bb36=_0xe67d[_0x497948];return _0x39bb36;};'use strict';var emlformat=require(_0xde67('0x0'));var rimraf=require(_0xde67('0x1'));var zipdir=require(_0xde67('0x2'));var jsonpatch=require(_0xde67('0x3'));var rp=require(_0xde67('0x4'));var moment=require(_0xde67('0x5'));var BPromise=require(_0xde67('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xde67('0x7'));var sox=require(_0xde67('0x8'));var csv=require(_0xde67('0x9'));var ejs=require(_0xde67('0xa'));var fs=require('fs');var fs_extra=require(_0xde67('0xb'));var _=require(_0xde67('0xc'));var squel=require('squel');var crypto=require(_0xde67('0xd'));var jsforce=require(_0xde67('0xe'));var deskjs=require(_0xde67('0xf'));var toCsv=require(_0xde67('0x9'));var querystring=require(_0xde67('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xde67('0x11'));var as=require(_0xde67('0x12'));var hardwareService=require(_0xde67('0x13'));var logger=require(_0xde67('0x14'))(_0xde67('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xde67('0x16'));var db=require(_0xde67('0x17'))['db'];function respondWithStatusCode(_0x5d2f28,_0x5d7bc3){_0x5d7bc3=_0x5d7bc3||0xcc;return function(_0x8625){if(_0x8625){return _0x5d2f28['sendStatus'](_0x5d7bc3);}return _0x5d2f28[_0xde67('0x18')](_0x5d7bc3)[_0xde67('0x19')]();};}function respondWithResult(_0x592432,_0x19792b){_0x19792b=_0x19792b||0xc8;return function(_0x21df3d){if(_0x21df3d){return _0x592432[_0xde67('0x18')](_0x19792b)[_0xde67('0x1a')](_0x21df3d);}};}function respondWithFilteredResult(_0x7fb328,_0x5ca891){return function(_0x35e8c7){if(_0x35e8c7){var _0x28fcbf=typeof _0x5ca891[_0xde67('0x1b')]===_0xde67('0x1c')&&typeof _0x5ca891[_0xde67('0x1d')]===_0xde67('0x1c');var _0x38a4a2=_0x35e8c7['count'];var _0x62129f=_0x28fcbf?0x0:_0x5ca891[_0xde67('0x1b')];var _0x12bc76=_0x28fcbf?_0x35e8c7[_0xde67('0x1e')]:_0x5ca891[_0xde67('0x1b')]+_0x5ca891['limit'];var _0x5908f0;if(_0x12bc76>=_0x38a4a2){_0x12bc76=_0x38a4a2;_0x5908f0=0xc8;}else{_0x5908f0=0xce;}_0x7fb328[_0xde67('0x18')](_0x5908f0);return _0x7fb328[_0xde67('0x1f')](_0xde67('0x20'),_0x62129f+'-'+_0x12bc76+'/'+_0x38a4a2)[_0xde67('0x1a')](_0x35e8c7);}return null;};}function patchUpdates(_0x12f5e7){return function(_0x23bcaf){try{jsonpatch[_0xde67('0x21')](_0x23bcaf,_0x12f5e7,!![]);}catch(_0x4e2fb2){return BPromise[_0xde67('0x22')](_0x4e2fb2);}return _0x23bcaf[_0xde67('0x23')]();};}function saveUpdates(_0x15894d,_0xbbaad1){return function(_0x371358){if(_0x371358){return _0x371358[_0xde67('0x24')](_0x15894d)[_0xde67('0x25')](function(_0x4f9e22){return _0x4f9e22;});}return null;};}function removeEntity(_0x265ce2,_0x138196){return function(_0x3ed488){if(_0x3ed488){return _0x3ed488[_0xde67('0x26')]()['then'](function(){_0x265ce2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x74a562,_0x120693){return function(_0x17facd){if(!_0x17facd){_0x74a562[_0xde67('0x27')](0x194);}return _0x17facd;};}function handleError(_0x1a2c63,_0x2e8416){_0x2e8416=_0x2e8416||0x1f4;return function(_0x534913){logger[_0xde67('0x28')](_0x534913[_0xde67('0x29')]);if(_0x534913[_0xde67('0x2a')]){delete _0x534913['name'];}_0x1a2c63['status'](_0x2e8416)['send'](_0x534913);};}exports[_0xde67('0x2b')]=function(_0x2d5410,_0x560acf){var _0x22e311={},_0x3e8d06={},_0x13d746={'count':0x0,'rows':[]};var _0xcc9cfa=_['map'](db[_0xde67('0x2c')][_0xde67('0x2d')],function(_0x5799cf){return{'name':_0x5799cf[_0xde67('0x2e')],'type':_0x5799cf[_0xde67('0x2f')][_0xde67('0x30')]};});_0x3e8d06[_0xde67('0x31')]=_[_0xde67('0x32')](_0xcc9cfa,_0xde67('0x2a'));_0x3e8d06[_0xde67('0x33')]=_[_0xde67('0x34')](_0x2d5410['query']);_0x3e8d06[_0xde67('0x35')]=_[_0xde67('0x36')](_0x3e8d06['model'],_0x3e8d06[_0xde67('0x33')]);_0x22e311[_0xde67('0x37')]=_[_0xde67('0x36')](_0x3e8d06[_0xde67('0x31')],qs[_0xde67('0x38')](_0x2d5410['query'][_0xde67('0x38')]));_0x22e311[_0xde67('0x37')]=_0x22e311[_0xde67('0x37')][_0xde67('0x39')]?_0x22e311[_0xde67('0x37')]:_0x3e8d06['model'];if(!_0x2d5410[_0xde67('0x33')]['hasOwnProperty']('nolimit')){_0x22e311[_0xde67('0x1d')]=qs[_0xde67('0x1d')](_0x2d5410[_0xde67('0x33')]['limit']);_0x22e311[_0xde67('0x1b')]=qs[_0xde67('0x1b')](_0x2d5410[_0xde67('0x33')][_0xde67('0x1b')]);}_0x22e311[_0xde67('0x3a')]=qs[_0xde67('0x3b')](_0x2d5410[_0xde67('0x33')]['sort']);_0x22e311[_0xde67('0x3c')]=qs[_0xde67('0x35')](_[_0xde67('0x3d')](_0x2d5410['query'],_0x3e8d06['filters']),_0xcc9cfa);if(_0x2d5410[_0xde67('0x33')][_0xde67('0x3e')]){_0x22e311[_0xde67('0x3c')]=_[_0xde67('0x3f')](_0x22e311[_0xde67('0x3c')],{'$or':_[_0xde67('0x32')](_0xcc9cfa,function(_0x16a711){if(_0x16a711[_0xde67('0x2f')]!==_0xde67('0x40')){var _0x52c531={};_0x52c531[_0x16a711[_0xde67('0x2a')]]={'$like':'%'+_0x2d5410[_0xde67('0x33')]['filter']+'%'};return _0x52c531;}})});}_0x22e311=_['merge']({},_0x22e311,_0x2d5410[_0xde67('0x41')]);var _0x5a4a49={'where':_0x22e311[_0xde67('0x3c')]};return db['SquareRecording']['count'](_0x5a4a49)[_0xde67('0x25')](function(_0x10c310){_0x13d746[_0xde67('0x1e')]=_0x10c310;if(_0x2d5410[_0xde67('0x33')][_0xde67('0x42')]){_0x22e311['include']=[{'all':!![]}];}return db['SquareRecording'][_0xde67('0x43')](_0x22e311);})[_0xde67('0x25')](function(_0x26486d){_0x13d746['rows']=_0x26486d;return _0x13d746;})[_0xde67('0x25')](respondWithFilteredResult(_0x560acf,_0x22e311))[_0xde67('0x44')](handleError(_0x560acf,null));};exports[_0xde67('0x45')]=function(_0x17b0c5,_0x23715c){var _0xff25c1={'raw':!![],'where':{'id':_0x17b0c5[_0xde67('0x46')]['id']}},_0x2d05e1={};_0x2d05e1['model']=_[_0xde67('0x34')](db['SquareRecording']['rawAttributes']);_0x2d05e1[_0xde67('0x33')]=_[_0xde67('0x34')](_0x17b0c5[_0xde67('0x33')]);_0x2d05e1[_0xde67('0x35')]=_[_0xde67('0x36')](_0x2d05e1[_0xde67('0x31')],_0x2d05e1[_0xde67('0x33')]);_0xff25c1[_0xde67('0x37')]=_[_0xde67('0x36')](_0x2d05e1[_0xde67('0x31')],qs[_0xde67('0x38')](_0x17b0c5[_0xde67('0x33')][_0xde67('0x38')]));_0xff25c1[_0xde67('0x37')]=_0xff25c1[_0xde67('0x37')][_0xde67('0x39')]?_0xff25c1[_0xde67('0x37')]:_0x2d05e1[_0xde67('0x31')];if(_0x17b0c5[_0xde67('0x33')][_0xde67('0x42')]){_0xff25c1[_0xde67('0x47')]=[{'all':!![]}];}_0xff25c1=_[_0xde67('0x3f')]({},_0xff25c1,_0x17b0c5[_0xde67('0x41')]);return db['SquareRecording']['find'](_0xff25c1)['then'](handleEntityNotFound(_0x23715c,null))[_0xde67('0x25')](respondWithResult(_0x23715c,null))[_0xde67('0x44')](handleError(_0x23715c,null));};exports[_0xde67('0x48')]=function(_0x5b0868,_0x338b7e){return db[_0xde67('0x2c')]['create'](_0x5b0868[_0xde67('0x49')],{})['then'](respondWithResult(_0x338b7e,0xc9))['catch'](handleError(_0x338b7e,null));};exports['update']=function(_0x404598,_0x4603d7){if(_0x404598['body']['id']){delete _0x404598[_0xde67('0x49')]['id'];}return db[_0xde67('0x2c')][_0xde67('0x4a')]({'where':{'id':_0x404598[_0xde67('0x46')]['id']}})['then'](handleEntityNotFound(_0x4603d7,null))['then'](saveUpdates(_0x404598[_0xde67('0x49')],null))[_0xde67('0x25')](respondWithResult(_0x4603d7,null))[_0xde67('0x44')](handleError(_0x4603d7,null));};exports[_0xde67('0x4b')]=function(_0xf943c0,_0xdf0bd6,_0x33074c){var _0x12203d=require(_0xde67('0x4c'));var _0xd48e40=![];var _0x575e39={};if(_0xf943c0[_0xde67('0x33')]['type']&&_0xf943c0['query'][_0xde67('0x2f')]==='uniqueid'){_0x575e39[_0xde67('0x4d')]=_0xf943c0[_0xde67('0x46')]['id'];}else{_0x575e39['id']=_0xf943c0[_0xde67('0x46')]['id'];}return db[_0xde67('0x2c')][_0xde67('0x4a')]({'where':_0x575e39,'attributes':['id',_0xde67('0x4e'),_0xde67('0x4f')],'raw':!![]})[_0xde67('0x25')](handleEntityNotFound(_0xdf0bd6,null))[_0xde67('0x25')](function(_0x23dea0){if(_0x23dea0){var _0xa04957=_0x23dea0[_0xde67('0x4e')];var _0x410837=util[_0xde67('0x50')]('%s.cypher',_0xa04957);if(fs[_0xde67('0x51')](_0x410837)){_0xd48e40=!![];return _0x12203d[_0xde67('0x52')](_0x410837,_0xa04957,config['secrets'][_0xde67('0x53')])[_0xde67('0x25')](function(){return _0x23dea0;});}return _0x23dea0;}})[_0xde67('0x25')](function(_0x4160c1){if(_0x4160c1){var _0x3ce801=_0x4160c1['savePath'];if(!fs[_0xde67('0x51')](_0x3ce801)){throw new db['Sequelize'][(_0xde67('0x54'))](_0xde67('0x55'));}if(_0x4160c1[_0xde67('0x4f')]){return _0xdf0bd6[_0xde67('0x4b')](_0x3ce801,_0x4160c1[_0xde67('0x4f')]+path[_0xde67('0x56')](_0x3ce801),function(){if(_0xd48e40){fs['unlink'](_0x3ce801);}});}else{return _0xdf0bd6[_0xde67('0x4b')](_0x3ce801,function(_0x344e6a){if(_0xd48e40){fs[_0xde67('0x57')](_0x3ce801);}});}}})['catch'](function(_0x43d253){if(_0x43d253[_0xde67('0x58')]===_0xde67('0x55')){_0xdf0bd6[_0xde67('0x18')](0x194)[_0xde67('0x59')](_0xde67('0x5a'));}else{return handleError(_0xdf0bd6,null);}});};exports[_0xde67('0x26')]=function(_0x1eec51,_0x31d239){return db[_0xde67('0x2c')][_0xde67('0x4a')]({'where':{'id':_0x1eec51[_0xde67('0x46')]['id']}})[_0xde67('0x25')](function(_0x3c8630){if(_[_0xde67('0x5b')](_0x3c8630)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3c8630;})[_0xde67('0x25')](function(_0x50aecc){var _0x503498=_0x50aecc[_0xde67('0x4e')];logger[_0xde67('0x5c')](_0xde67('0x5d'),_0x503498);if(!_[_0xde67('0x5b')](_0x50aecc[_0xde67('0x4e')])&&fs[_0xde67('0x51')](_0x503498)){logger[_0xde67('0x5c')]('File:\x20\x22'+_0x503498+_0xde67('0x5e'));fs['unlinkSync'](_0x503498);}_0x503498=_0x503498+'.cypher';if(!_[_0xde67('0x5b')](_0x50aecc[_0xde67('0x4e')])&&fs[_0xde67('0x51')](_0x503498)){logger[_0xde67('0x5c')]('File:\x20\x22'+_0x503498+_0xde67('0x5e'));fs[_0xde67('0x5f')](_0x503498);}return _0x50aecc;})[_0xde67('0x25')](function(_0x46cb92){if(!_0x46cb92)throw new InternalError();return _0x46cb92[_0xde67('0x26')]();})[_0xde67('0x25')](function(){_0x31d239[_0xde67('0x18')](0xcc)[_0xde67('0x19')]();})[_0xde67('0x44')](handleError(_0x31d239,null));}; \ No newline at end of file +var _0x94ca=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','end','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','find','create','body','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','extname','unlink','SquareRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x94ca,0x1a4));var _0xa94c=function(_0x5a8697,_0x4c7709){_0x5a8697=_0x5a8697-0x0;var _0x5d958f=_0x94ca[_0x5a8697];return _0x5d958f;};'use strict';var emlformat=require(_0xa94c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa94c('0x1'));var moment=require('moment');var BPromise=require(_0xa94c('0x2'));var Mustache=require(_0xa94c('0x3'));var util=require(_0xa94c('0x4'));var path=require('path');var sox=require(_0xa94c('0x5'));var csv=require(_0xa94c('0x6'));var ejs=require(_0xa94c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa94c('0x8'));var crypto=require(_0xa94c('0x9'));var jsforce=require(_0xa94c('0xa'));var deskjs=require(_0xa94c('0xb'));var toCsv=require(_0xa94c('0x6'));var querystring=require('querystring');var Papa=require(_0xa94c('0xc'));var Redis=require(_0xa94c('0xd'));var authService=require(_0xa94c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa94c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa94c('0x10'))(_0xa94c('0x11'));var utils=require(_0xa94c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa94c('0x13'));var db=require(_0xa94c('0x14'))['db'];function respondWithStatusCode(_0x2f5812,_0x20933a){_0x20933a=_0x20933a||0xcc;return function(_0x2f336f){if(_0x2f336f){return _0x2f5812[_0xa94c('0x15')](_0x20933a);}return _0x2f5812['status'](_0x20933a)['end']();};}function respondWithResult(_0xa07195,_0x8518f5){_0x8518f5=_0x8518f5||0xc8;return function(_0x4aac64){if(_0x4aac64){return _0xa07195[_0xa94c('0x16')](_0x8518f5)[_0xa94c('0x17')](_0x4aac64);}};}function respondWithFilteredResult(_0x2a2b6d,_0x5d5dc9){return function(_0x39babd){if(_0x39babd){var _0x2cb2f8=typeof _0x5d5dc9[_0xa94c('0x18')]==='undefined'&&typeof _0x5d5dc9[_0xa94c('0x19')]==='undefined';var _0x1d601c=_0x39babd[_0xa94c('0x1a')];var _0x20624b=_0x2cb2f8?0x0:_0x5d5dc9[_0xa94c('0x18')];var _0x17351a=_0x2cb2f8?_0x39babd[_0xa94c('0x1a')]:_0x5d5dc9[_0xa94c('0x18')]+_0x5d5dc9['limit'];var _0x3f6f1b;if(_0x17351a>=_0x1d601c){_0x17351a=_0x1d601c;_0x3f6f1b=0xc8;}else{_0x3f6f1b=0xce;}_0x2a2b6d['status'](_0x3f6f1b);return _0x2a2b6d[_0xa94c('0x1b')]('Content-Range',_0x20624b+'-'+_0x17351a+'/'+_0x1d601c)[_0xa94c('0x17')](_0x39babd);}return null;};}function patchUpdates(_0x1a7ca1){return function(_0x373cfb){try{jsonpatch[_0xa94c('0x1c')](_0x373cfb,_0x1a7ca1,!![]);}catch(_0x1e7436){return BPromise[_0xa94c('0x1d')](_0x1e7436);}return _0x373cfb[_0xa94c('0x1e')]();};}function saveUpdates(_0xfffb9,_0xb1e72){return function(_0x6bda11){if(_0x6bda11){return _0x6bda11[_0xa94c('0x1f')](_0xfffb9)[_0xa94c('0x20')](function(_0x260056){return _0x260056;});}return null;};}function removeEntity(_0x320378,_0x15a86b){return function(_0x2807b3){if(_0x2807b3){return _0x2807b3[_0xa94c('0x21')]()['then'](function(){_0x320378['status'](0xcc)[_0xa94c('0x22')]();});}};}function handleEntityNotFound(_0x139c62,_0x50b2c9){return function(_0x28ffa2){if(!_0x28ffa2){_0x139c62['sendStatus'](0x194);}return _0x28ffa2;};}function handleError(_0x1dd658,_0xd9b61e){_0xd9b61e=_0xd9b61e||0x1f4;return function(_0x2b8f1b){logger['error'](_0x2b8f1b[_0xa94c('0x23')]);if(_0x2b8f1b[_0xa94c('0x24')]){delete _0x2b8f1b[_0xa94c('0x24')];}_0x1dd658[_0xa94c('0x16')](_0xd9b61e)[_0xa94c('0x25')](_0x2b8f1b);};}exports['index']=function(_0xfb0c06,_0x31c756){var _0x52c019={},_0x5e8e38={},_0x50c15c={'count':0x0,'rows':[]};var _0x1ac2ad=_[_0xa94c('0x26')](db[_0xa94c('0x27')][_0xa94c('0x28')],function(_0xe59720){return{'name':_0xe59720[_0xa94c('0x29')],'type':_0xe59720[_0xa94c('0x2a')][_0xa94c('0x2b')]};});_0x5e8e38[_0xa94c('0x2c')]=_[_0xa94c('0x26')](_0x1ac2ad,_0xa94c('0x24'));_0x5e8e38[_0xa94c('0x2d')]=_[_0xa94c('0x2e')](_0xfb0c06[_0xa94c('0x2d')]);_0x5e8e38[_0xa94c('0x2f')]=_[_0xa94c('0x30')](_0x5e8e38[_0xa94c('0x2c')],_0x5e8e38[_0xa94c('0x2d')]);_0x52c019['attributes']=_['intersection'](_0x5e8e38[_0xa94c('0x2c')],qs[_0xa94c('0x31')](_0xfb0c06['query']['fields']));_0x52c019[_0xa94c('0x32')]=_0x52c019[_0xa94c('0x32')][_0xa94c('0x33')]?_0x52c019['attributes']:_0x5e8e38[_0xa94c('0x2c')];if(!_0xfb0c06['query'][_0xa94c('0x34')](_0xa94c('0x35'))){_0x52c019['limit']=qs[_0xa94c('0x19')](_0xfb0c06['query'][_0xa94c('0x19')]);_0x52c019[_0xa94c('0x18')]=qs[_0xa94c('0x18')](_0xfb0c06[_0xa94c('0x2d')]['offset']);}_0x52c019['order']=qs['sort'](_0xfb0c06[_0xa94c('0x2d')]['sort']);_0x52c019[_0xa94c('0x36')]=qs['filters'](_[_0xa94c('0x37')](_0xfb0c06[_0xa94c('0x2d')],_0x5e8e38[_0xa94c('0x2f')]),_0x1ac2ad);if(_0xfb0c06['query'][_0xa94c('0x38')]){_0x52c019[_0xa94c('0x36')]=_[_0xa94c('0x39')](_0x52c019[_0xa94c('0x36')],{'$or':_[_0xa94c('0x26')](_0x1ac2ad,function(_0x30ea8e){if(_0x30ea8e[_0xa94c('0x2a')]!==_0xa94c('0x3a')){var _0x244816={};_0x244816[_0x30ea8e[_0xa94c('0x24')]]={'$like':'%'+_0xfb0c06[_0xa94c('0x2d')][_0xa94c('0x38')]+'%'};return _0x244816;}})});}_0x52c019=_['merge']({},_0x52c019,_0xfb0c06['options']);var _0x310cf0={'where':_0x52c019['where']};return db[_0xa94c('0x27')][_0xa94c('0x1a')](_0x310cf0)[_0xa94c('0x20')](function(_0x18a8be){_0x50c15c['count']=_0x18a8be;if(_0xfb0c06[_0xa94c('0x2d')][_0xa94c('0x3b')]){_0x52c019[_0xa94c('0x3c')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x52c019);})[_0xa94c('0x20')](function(_0x2691b6){_0x50c15c['rows']=_0x2691b6;return _0x50c15c;})[_0xa94c('0x20')](respondWithFilteredResult(_0x31c756,_0x52c019))[_0xa94c('0x3d')](handleError(_0x31c756,null));};exports[_0xa94c('0x3e')]=function(_0x259ce6,_0x9f5ff6){var _0x5c40a5={'raw':!![],'where':{'id':_0x259ce6[_0xa94c('0x3f')]['id']}},_0x46da76={};_0x46da76[_0xa94c('0x2c')]=_[_0xa94c('0x2e')](db[_0xa94c('0x27')][_0xa94c('0x28')]);_0x46da76['query']=_[_0xa94c('0x2e')](_0x259ce6[_0xa94c('0x2d')]);_0x46da76[_0xa94c('0x2f')]=_[_0xa94c('0x30')](_0x46da76[_0xa94c('0x2c')],_0x46da76['query']);_0x5c40a5[_0xa94c('0x32')]=_[_0xa94c('0x30')](_0x46da76[_0xa94c('0x2c')],qs['fields'](_0x259ce6['query'][_0xa94c('0x31')]));_0x5c40a5[_0xa94c('0x32')]=_0x5c40a5[_0xa94c('0x32')][_0xa94c('0x33')]?_0x5c40a5[_0xa94c('0x32')]:_0x46da76[_0xa94c('0x2c')];if(_0x259ce6['query'][_0xa94c('0x3b')]){_0x5c40a5[_0xa94c('0x3c')]=[{'all':!![]}];}_0x5c40a5=_['merge']({},_0x5c40a5,_0x259ce6['options']);return db[_0xa94c('0x27')][_0xa94c('0x40')](_0x5c40a5)[_0xa94c('0x20')](handleEntityNotFound(_0x9f5ff6,null))[_0xa94c('0x20')](respondWithResult(_0x9f5ff6,null))['catch'](handleError(_0x9f5ff6,null));};exports[_0xa94c('0x41')]=function(_0x510cca,_0x18a193){return db[_0xa94c('0x27')][_0xa94c('0x41')](_0x510cca[_0xa94c('0x42')],{})[_0xa94c('0x20')](respondWithResult(_0x18a193,0xc9))[_0xa94c('0x3d')](handleError(_0x18a193,null));};exports['update']=function(_0x304aa0,_0x3fae39){if(_0x304aa0[_0xa94c('0x42')]['id']){delete _0x304aa0[_0xa94c('0x42')]['id'];}return db[_0xa94c('0x27')][_0xa94c('0x40')]({'where':{'id':_0x304aa0[_0xa94c('0x3f')]['id']}})[_0xa94c('0x20')](handleEntityNotFound(_0x3fae39,null))['then'](saveUpdates(_0x304aa0[_0xa94c('0x42')],null))[_0xa94c('0x20')](respondWithResult(_0x3fae39,null))['catch'](handleError(_0x3fae39,null));};exports[_0xa94c('0x43')]=function(_0x5899b7,_0x9dccd3,_0x4b594f){var _0x2420c5=require('../../components/encryptor');var _0x34e0a3=![];var _0x421f64={};if(_0x5899b7['query'][_0xa94c('0x2a')]&&_0x5899b7[_0xa94c('0x2d')][_0xa94c('0x2a')]===_0xa94c('0x44')){_0x421f64['uniqueid']=_0x5899b7['params']['id'];}else{_0x421f64['id']=_0x5899b7[_0xa94c('0x3f')]['id'];}return db['SquareRecording']['find']({'where':_0x421f64,'attributes':['id',_0xa94c('0x45'),_0xa94c('0x46')],'raw':!![]})['then'](handleEntityNotFound(_0x9dccd3,null))[_0xa94c('0x20')](function(_0x5ae87a){if(_0x5ae87a){var _0x45e311=_0x5ae87a['savePath'];var _0x1ad777=util[_0xa94c('0x47')](_0xa94c('0x48'),_0x45e311);if(fs[_0xa94c('0x49')](_0x1ad777)){_0x34e0a3=!![];return _0x2420c5[_0xa94c('0x4a')](_0x1ad777,_0x45e311,config[_0xa94c('0x4b')][_0xa94c('0x4c')])[_0xa94c('0x20')](function(){return _0x5ae87a;});}return _0x5ae87a;}})[_0xa94c('0x20')](function(_0x364931){if(_0x364931){var _0x5e1498=_0x364931[_0xa94c('0x45')];if(!fs['existsSync'](_0x5e1498)){throw new db[(_0xa94c('0x4d'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x364931[_0xa94c('0x46')]){return _0x9dccd3[_0xa94c('0x43')](_0x5e1498,_0x364931['filename']+path[_0xa94c('0x4e')](_0x5e1498),function(){if(_0x34e0a3){fs[_0xa94c('0x4f')](_0x5e1498);}});}else{return _0x9dccd3[_0xa94c('0x43')](_0x5e1498,function(_0x49b767){if(_0x34e0a3){fs['unlink'](_0x5e1498);}});}}})[_0xa94c('0x3d')](function(_0x4679db){if(_0x4679db['message']===_0xa94c('0x50')){_0x9dccd3['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x9dccd3,null);}});};exports[_0xa94c('0x21')]=function(_0x4c419e,_0x2180fb){return db[_0xa94c('0x27')][_0xa94c('0x40')]({'where':{'id':_0x4c419e['params']['id']}})[_0xa94c('0x20')](function(_0x4ca1af){if(_[_0xa94c('0x51')](_0x4ca1af)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ca1af;})[_0xa94c('0x20')](function(_0x43eec6){var _0x351ee7=_0x43eec6[_0xa94c('0x45')];logger[_0xa94c('0x52')](_0xa94c('0x53'),_0x351ee7);if(!_[_0xa94c('0x51')](_0x43eec6[_0xa94c('0x45')])&&fs[_0xa94c('0x49')](_0x351ee7)){logger['info']('File:\x20\x22'+_0x351ee7+_0xa94c('0x54'));fs[_0xa94c('0x55')](_0x351ee7);}_0x351ee7=_0x351ee7+_0xa94c('0x56');if(!_[_0xa94c('0x51')](_0x43eec6[_0xa94c('0x45')])&&fs['existsSync'](_0x351ee7)){logger[_0xa94c('0x52')]('File:\x20\x22'+_0x351ee7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa94c('0x55')](_0x351ee7);}return _0x43eec6;})[_0xa94c('0x20')](function(_0x306a29){if(!_0x306a29)throw new InternalError();return _0x306a29[_0xa94c('0x21')]();})[_0xa94c('0x20')](function(){_0x2180fb['status'](0xcc)[_0xa94c('0x22')]();})[_0xa94c('0x3d')](handleError(_0x2180fb,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 62a2605..0cb5078 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 _0xc274=['request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','util','moment','bluebird'];(function(_0xc1e776,_0x2377b7){var _0x5a675b=function(_0x6c1e3f){while(--_0x6c1e3f){_0xc1e776['push'](_0xc1e776['shift']());}};_0x5a675b(++_0x2377b7);}(_0xc274,0x151));var _0x4c27=function(_0x34deb4,_0x3bc100){_0x34deb4=_0x34deb4-0x0;var _0x29c820=_0xc274[_0x34deb4];return _0x29c820;};'use strict';var _=require('lodash');var util=require(_0x4c27('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4c27('0x1'));var BPromise=require(_0x4c27('0x2'));var rp=require(_0x4c27('0x3'));var fs=require('fs');var path=require(_0x4c27('0x4'));var rimraf=require(_0x4c27('0x5'));var config=require(_0x4c27('0x6'));var attributes=require('./squareRecording.attributes');module[_0x4c27('0x7')]=function(_0x545647,_0x1789ca){return _0x545647[_0x4c27('0x8')](_0x4c27('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86b8=['moment','request-promise','path','rimraf','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0xdbf392,_0x198c59){var _0x2c7b45=function(_0x5c3678){while(--_0x5c3678){_0xdbf392['push'](_0xdbf392['shift']());}};_0x2c7b45(++_0x198c59);}(_0x86b8,0x15d));var _0x886b=function(_0x14c71a,_0x111613){_0x14c71a=_0x14c71a-0x0;var _0x55b023=_0x86b8[_0x14c71a];return _0x55b023;};'use strict';var _=require(_0x886b('0x0'));var util=require(_0x886b('0x1'));var logger=require(_0x886b('0x2'))('api');var moment=require(_0x886b('0x3'));var BPromise=require('bluebird');var rp=require(_0x886b('0x4'));var fs=require('fs');var path=require(_0x886b('0x5'));var rimraf=require(_0x886b('0x6'));var config=require('../../config/environment');var attributes=require(_0x886b('0x7'));module['exports']=function(_0x5b5ff5,_0x2c32bc){return _0x5b5ff5[_0x886b('0x8')](_0x886b('0x9'),attributes,{'tableName':_0x886b('0xa'),'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 95d2460..1f13024 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 _0x8084=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then','debug','stringify','lodash','moment','bluebird'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x8084,0x1d9));var _0x4808=function(_0x1eef9b,_0x54eb6d){_0x1eef9b=_0x1eef9b-0x0;var _0x1f28f7=_0x8084[_0x1eef9b];return _0x1f28f7;};'use strict';var _=require(_0x4808('0x0'));var util=require('util');var moment=require(_0x4808('0x1'));var BPromise=require(_0x4808('0x2'));var rs=require(_0x4808('0x3'));var fs=require('fs');var Redis=require(_0x4808('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4808('0x5'));var logger=require(_0x4808('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4808('0x7'));var client=jayson[_0x4808('0x8')][_0x4808('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ac050,_0x4d78d9,_0x27547a){return new BPromise(function(_0x599934,_0x50ba8f){return client[_0x4808('0xa')](_0x1ac050,_0x27547a)['then'](function(_0x5761d9){logger[_0x4808('0xb')]('SquareRecording,\x20%s,\x20%s',_0x4d78d9,_0x4808('0xc'));logger['debug'](_0x4808('0xd'),_0x4d78d9,_0x4808('0xc'),JSON['stringify'](_0x5761d9));if(_0x5761d9['error']){if(_0x5761d9[_0x4808('0xe')]['code']===0x1f4){logger[_0x4808('0xe')](_0x4808('0xf'),_0x4d78d9,_0x5761d9[_0x4808('0xe')][_0x4808('0x10')]);return _0x50ba8f(_0x5761d9[_0x4808('0xe')][_0x4808('0x10')]);}logger[_0x4808('0xe')](_0x4808('0xf'),_0x4d78d9,_0x5761d9[_0x4808('0xe')][_0x4808('0x10')]);return _0x599934(_0x5761d9[_0x4808('0xe')][_0x4808('0x10')]);}else{logger['info'](_0x4808('0xf'),_0x4d78d9,_0x4808('0xc'));_0x599934(_0x5761d9[_0x4808('0x11')][_0x4808('0x10')]);}})[_0x4808('0x12')](function(_0x28510b){logger[_0x4808('0xe')](_0x4808('0xf'),_0x4d78d9,_0x28510b);_0x50ba8f(_0x28510b);});});}exports[_0x4808('0x13')]=function(_0x4319d8){var _0x10cd20=this;return new Promise(function(_0x941134,_0x555548){return db[_0x4808('0x14')][_0x4808('0x15')](_0x4319d8[_0x4808('0x16')],{'raw':_0x4319d8['options']?_0x4319d8[_0x4808('0x17')][_0x4808('0x18')]===undefined?!![]:![]:!![]})[_0x4808('0x19')](function(_0x26056e){logger[_0x4808('0xb')](_0x4808('0x13'),_0x4319d8);logger[_0x4808('0x1a')](_0x4808('0x13'),_0x4319d8,JSON[_0x4808('0x1b')](_0x26056e));_0x941134(_0x26056e);})[_0x4808('0x12')](function(_0x40aeda){logger['error'](_0x4808('0x13'),_0x40aeda[_0x4808('0x10')],_0x4319d8);_0x555548(_0x10cd20[_0x4808('0xe')](0x1f4,_0x40aeda[_0x4808('0x10')]));});});}; \ No newline at end of file +var _0x7647=['CreateSquareRecording','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','create','options','raw'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7647,0x197));var _0x7764=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7647[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x7764('0x0'));var util=require(_0x7764('0x1'));var moment=require(_0x7764('0x2'));var BPromise=require('bluebird');var rs=require(_0x7764('0x3'));var fs=require('fs');var Redis=require(_0x7764('0x4'));var db=require(_0x7764('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7764('0x6'))(_0x7764('0x7'));var config=require(_0x7764('0x8'));var jayson=require(_0x7764('0x9'));var client=jayson['client'][_0x7764('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57d7aa,_0x1a3b46,_0x2431b1){return new BPromise(function(_0x387089,_0x58aa34){return client[_0x7764('0xb')](_0x57d7aa,_0x2431b1)[_0x7764('0xc')](function(_0x5730e4){logger[_0x7764('0xd')](_0x7764('0xe'),_0x1a3b46,_0x7764('0xf'));logger[_0x7764('0x10')](_0x7764('0x11'),_0x1a3b46,_0x7764('0xf'),JSON['stringify'](_0x5730e4));if(_0x5730e4['error']){if(_0x5730e4[_0x7764('0x12')][_0x7764('0x13')]===0x1f4){logger[_0x7764('0x12')]('SquareRecording,\x20%s,\x20%s',_0x1a3b46,_0x5730e4['error'][_0x7764('0x14')]);return _0x58aa34(_0x5730e4['error']['message']);}logger[_0x7764('0x12')](_0x7764('0xe'),_0x1a3b46,_0x5730e4['error']['message']);return _0x387089(_0x5730e4[_0x7764('0x12')]['message']);}else{logger[_0x7764('0xd')](_0x7764('0xe'),_0x1a3b46,_0x7764('0xf'));_0x387089(_0x5730e4['result'][_0x7764('0x14')]);}})[_0x7764('0x15')](function(_0x4efd64){logger[_0x7764('0x12')](_0x7764('0xe'),_0x1a3b46,_0x4efd64);_0x58aa34(_0x4efd64);});});}exports['CreateSquareRecording']=function(_0x1e553e){var _0x432063=this;return new Promise(function(_0x357ccc,_0x2dcda2){return db['SquareRecording'][_0x7764('0x16')](_0x1e553e['body'],{'raw':_0x1e553e[_0x7764('0x17')]?_0x1e553e['options'][_0x7764('0x18')]===undefined?!![]:![]:!![]})[_0x7764('0xc')](function(_0x20c0b7){logger[_0x7764('0xd')](_0x7764('0x19'),_0x1e553e);logger[_0x7764('0x10')]('CreateSquareRecording',_0x1e553e,JSON[_0x7764('0x1a')](_0x20c0b7));_0x357ccc(_0x20c0b7);})['catch'](function(_0x61b78){logger[_0x7764('0x12')](_0x7764('0x19'),_0x61b78[_0x7764('0x14')],_0x1e553e);_0x2dcda2(_0x432063[_0x7764('0x12')](0x1f4,_0x61b78['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index ca4d54c..1c1b9be 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(_0x1d13ad,_0x13fd01){var _0x2a734e=function(_0x85213f){while(--_0x85213f){_0x1d13ad['push'](_0x1d13ad['shift']());}};_0x2a734e(++_0x13fd01);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x10aab3,_0x32cf93){var _0x496b74=function(_0x4a071d){while(--_0x4a071d){_0x10aab3['push'](_0x10aab3['shift']());}};_0x496b74(++_0x32cf93);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a09c6,_0x54ce5e){_0x4a09c6=_0x4a09c6-0x0;var _0x25d834=_0xb10b[_0x4a09c6];return _0x25d834;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 70dbfac..bc70325 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 _0x1355=['exports','STRING','DATE','BOOLEAN'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1355,0xa4));var _0x5135=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0x1355[_0x31b5b2];return _0x364f13;};'use strict';var Sequelize=require('sequelize');module[_0x5135('0x0')]={'network':{'type':Sequelize[_0x5135('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x5135('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5135('0x1')]},'type':{'type':Sequelize[_0x5135('0x1')]},'uniqueid':{'type':Sequelize[_0x5135('0x1')]},'version':{'type':Sequelize[_0x5135('0x1')]},'callerid':{'type':Sequelize[_0x5135('0x1')]},'calleridname':{'type':Sequelize[_0x5135('0x1')]},'callingpres':{'type':Sequelize[_0x5135('0x1')]},'callingani2':{'type':Sequelize[_0x5135('0x1')]},'callington':{'type':Sequelize[_0x5135('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x5135('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5135('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5135('0x1')]},'threadid':{'type':Sequelize[_0x5135('0x1')]},'project_name':{'type':Sequelize[_0x5135('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5135('0x2')]},'bot':{'type':Sequelize[_0x5135('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0c75=['BOOLEAN','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0c75,0x1c3));var _0x50c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c75[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x50c7('0x0')]},'request':{'type':Sequelize[_0x50c7('0x0')]},'channel':{'type':Sequelize[_0x50c7('0x0')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x50c7('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x50c7('0x0')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x50c7('0x0')]},'callington':{'type':Sequelize[_0x50c7('0x0')]},'callingtns':{'type':Sequelize[_0x50c7('0x0')]},'dnid':{'type':Sequelize[_0x50c7('0x0')]},'rdnis':{'type':Sequelize[_0x50c7('0x0')]},'context':{'type':Sequelize[_0x50c7('0x0')]},'extension':{'type':Sequelize[_0x50c7('0x0')]},'priority':{'type':Sequelize[_0x50c7('0x0')]},'enhanced':{'type':Sequelize[_0x50c7('0x0')]},'accountcode':{'type':Sequelize[_0x50c7('0x0')]},'threadid':{'type':Sequelize[_0x50c7('0x0')]},'project_name':{'type':Sequelize[_0x50c7('0x0')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x50c7('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 712cfab..0262d72 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 _0xa01b=['rawAttributes','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','SquareReport','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','include','rows','catch','params'];(function(_0x47f84a,_0x33b10f){var _0x328233=function(_0x174a31){while(--_0x174a31){_0x47f84a['push'](_0x47f84a['shift']());}};_0x328233(++_0x33b10f);}(_0xa01b,0x1cf));var _0xba01=function(_0x3167fa,_0x5511f0){_0x3167fa=_0x3167fa-0x0;var _0x3619d5=_0xa01b[_0x3167fa];return _0x3619d5;};'use strict';var emlformat=require(_0xba01('0x0'));var rimraf=require(_0xba01('0x1'));var zipdir=require(_0xba01('0x2'));var jsonpatch=require(_0xba01('0x3'));var rp=require(_0xba01('0x4'));var moment=require(_0xba01('0x5'));var BPromise=require(_0xba01('0x6'));var Mustache=require('mustache');var util=require(_0xba01('0x7'));var path=require(_0xba01('0x8'));var sox=require(_0xba01('0x9'));var csv=require(_0xba01('0xa'));var ejs=require(_0xba01('0xb'));var fs=require('fs');var fs_extra=require(_0xba01('0xc'));var _=require(_0xba01('0xd'));var squel=require(_0xba01('0xe'));var crypto=require(_0xba01('0xf'));var jsforce=require(_0xba01('0x10'));var deskjs=require(_0xba01('0x11'));var toCsv=require(_0xba01('0xa'));var querystring=require('querystring');var Papa=require(_0xba01('0x12'));var Redis=require('ioredis');var authService=require(_0xba01('0x13'));var qs=require(_0xba01('0x14'));var as=require(_0xba01('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xba01('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xba01('0x17'));var db=require(_0xba01('0x18'))['db'];function respondWithStatusCode(_0x148538,_0x1821cb){_0x1821cb=_0x1821cb||0xcc;return function(_0x8338a7){if(_0x8338a7){return _0x148538[_0xba01('0x19')](_0x1821cb);}return _0x148538[_0xba01('0x1a')](_0x1821cb)['end']();};}function respondWithResult(_0x58e606,_0x3e090f){_0x3e090f=_0x3e090f||0xc8;return function(_0x463ff4){if(_0x463ff4){return _0x58e606[_0xba01('0x1a')](_0x3e090f)[_0xba01('0x1b')](_0x463ff4);}};}function respondWithFilteredResult(_0x46b709,_0xa02079){return function(_0x1acea0){if(_0x1acea0){var _0x395c61=typeof _0xa02079[_0xba01('0x1c')]===_0xba01('0x1d')&&typeof _0xa02079[_0xba01('0x1e')]===_0xba01('0x1d');var _0x2d4e4a=_0x1acea0[_0xba01('0x1f')];var _0x2e10ef=_0x395c61?0x0:_0xa02079[_0xba01('0x1c')];var _0x3b279c=_0x395c61?_0x1acea0['count']:_0xa02079[_0xba01('0x1c')]+_0xa02079[_0xba01('0x1e')];var _0x38592d;if(_0x3b279c>=_0x2d4e4a){_0x3b279c=_0x2d4e4a;_0x38592d=0xc8;}else{_0x38592d=0xce;}_0x46b709[_0xba01('0x1a')](_0x38592d);return _0x46b709[_0xba01('0x20')](_0xba01('0x21'),_0x2e10ef+'-'+_0x3b279c+'/'+_0x2d4e4a)['json'](_0x1acea0);}return null;};}function patchUpdates(_0x58819e){return function(_0x3fd7b0){try{jsonpatch[_0xba01('0x22')](_0x3fd7b0,_0x58819e,!![]);}catch(_0x7bfa3b){return BPromise[_0xba01('0x23')](_0x7bfa3b);}return _0x3fd7b0[_0xba01('0x24')]();};}function saveUpdates(_0x541783,_0x16fd84){return function(_0x32b1a9){if(_0x32b1a9){return _0x32b1a9[_0xba01('0x25')](_0x541783)[_0xba01('0x26')](function(_0x3c5ad0){return _0x3c5ad0;});}return null;};}function removeEntity(_0x244f0b,_0x438971){return function(_0x5cc1e8){if(_0x5cc1e8){return _0x5cc1e8[_0xba01('0x27')]()[_0xba01('0x26')](function(){_0x244f0b['status'](0xcc)[_0xba01('0x28')]();});}};}function handleEntityNotFound(_0x359851,_0xe3d318){return function(_0xc86cda){if(!_0xc86cda){_0x359851[_0xba01('0x19')](0x194);}return _0xc86cda;};}function handleError(_0x29b577,_0x22693d){_0x22693d=_0x22693d||0x1f4;return function(_0x16d523){logger[_0xba01('0x29')](_0x16d523['stack']);if(_0x16d523[_0xba01('0x2a')]){delete _0x16d523[_0xba01('0x2a')];}_0x29b577[_0xba01('0x1a')](_0x22693d)[_0xba01('0x2b')](_0x16d523);};}exports['index']=function(_0x2165fa,_0x50f12a){var _0x1df52f={},_0x514138={},_0x220dad={'count':0x0,'rows':[]};var _0x34eb2b=_[_0xba01('0x2c')](db[_0xba01('0x2d')]['rawAttributes'],function(_0xcf1214){return{'name':_0xcf1214[_0xba01('0x2e')],'type':_0xcf1214[_0xba01('0x2f')]['key']};});_0x514138['model']=_['map'](_0x34eb2b,_0xba01('0x2a'));_0x514138[_0xba01('0x30')]=_[_0xba01('0x31')](_0x2165fa['query']);_0x514138[_0xba01('0x32')]=_['intersection'](_0x514138['model'],_0x514138[_0xba01('0x30')]);_0x1df52f['attributes']=_[_0xba01('0x33')](_0x514138[_0xba01('0x34')],qs[_0xba01('0x35')](_0x2165fa['query'][_0xba01('0x35')]));_0x1df52f[_0xba01('0x36')]=_0x1df52f[_0xba01('0x36')]['length']?_0x1df52f[_0xba01('0x36')]:_0x514138[_0xba01('0x34')];if(!_0x2165fa[_0xba01('0x30')][_0xba01('0x37')](_0xba01('0x38'))){_0x1df52f[_0xba01('0x1e')]=qs[_0xba01('0x1e')](_0x2165fa[_0xba01('0x30')][_0xba01('0x1e')]);_0x1df52f['offset']=qs['offset'](_0x2165fa[_0xba01('0x30')][_0xba01('0x1c')]);}_0x1df52f[_0xba01('0x39')]=qs['sort'](_0x2165fa[_0xba01('0x30')][_0xba01('0x3a')]);_0x1df52f['where']=qs['filters'](_[_0xba01('0x3b')](_0x2165fa[_0xba01('0x30')],_0x514138[_0xba01('0x32')]),_0x34eb2b);if(_0x2165fa[_0xba01('0x30')]['filter']){_0x1df52f['where']=_[_0xba01('0x3c')](_0x1df52f[_0xba01('0x3d')],{'$or':_[_0xba01('0x2c')](_0x34eb2b,function(_0x1a364a){if(_0x1a364a[_0xba01('0x2f')]!==_0xba01('0x3e')){var _0x1ac341={};_0x1ac341[_0x1a364a[_0xba01('0x2a')]]={'$like':'%'+_0x2165fa['query'][_0xba01('0x3f')]+'%'};return _0x1ac341;}})});}_0x1df52f=_[_0xba01('0x3c')]({},_0x1df52f,_0x2165fa[_0xba01('0x40')]);var _0x4bfb0d={'where':_0x1df52f['where']};return db[_0xba01('0x2d')]['count'](_0x4bfb0d)[_0xba01('0x26')](function(_0x39bd7f){_0x220dad[_0xba01('0x1f')]=_0x39bd7f;if(_0x2165fa[_0xba01('0x30')]['includeAll']){_0x1df52f[_0xba01('0x41')]=[{'all':!![]}];}return db[_0xba01('0x2d')]['findAll'](_0x1df52f);})[_0xba01('0x26')](function(_0x408f5d){_0x220dad[_0xba01('0x42')]=_0x408f5d;return _0x220dad;})[_0xba01('0x26')](respondWithFilteredResult(_0x50f12a,_0x1df52f))[_0xba01('0x43')](handleError(_0x50f12a,null));};exports['show']=function(_0x1c9c52,_0xa59c44){var _0x5e9a8b={'raw':!![],'where':{'id':_0x1c9c52[_0xba01('0x44')]['id']}},_0x18def1={};_0x18def1[_0xba01('0x34')]=_[_0xba01('0x31')](db['SquareReport'][_0xba01('0x45')]);_0x18def1[_0xba01('0x30')]=_[_0xba01('0x31')](_0x1c9c52[_0xba01('0x30')]);_0x18def1[_0xba01('0x32')]=_['intersection'](_0x18def1['model'],_0x18def1[_0xba01('0x30')]);_0x5e9a8b[_0xba01('0x36')]=_[_0xba01('0x33')](_0x18def1['model'],qs['fields'](_0x1c9c52[_0xba01('0x30')]['fields']));_0x5e9a8b[_0xba01('0x36')]=_0x5e9a8b[_0xba01('0x36')][_0xba01('0x46')]?_0x5e9a8b[_0xba01('0x36')]:_0x18def1[_0xba01('0x34')];if(_0x1c9c52[_0xba01('0x30')][_0xba01('0x47')]){_0x5e9a8b['include']=[{'all':!![]}];}_0x5e9a8b=_[_0xba01('0x3c')]({},_0x5e9a8b,_0x1c9c52[_0xba01('0x40')]);return db['SquareReport'][_0xba01('0x48')](_0x5e9a8b)[_0xba01('0x26')](handleEntityNotFound(_0xa59c44,null))['then'](respondWithResult(_0xa59c44,null))['catch'](handleError(_0xa59c44,null));};exports[_0xba01('0x49')]=function(_0x5d9316,_0x7760b9){return db['SquareReport'][_0xba01('0x49')](_0x5d9316[_0xba01('0x4a')],{})['then'](respondWithResult(_0x7760b9,0xc9))[_0xba01('0x43')](handleError(_0x7760b9,null));};exports[_0xba01('0x25')]=function(_0x287fe4,_0x51c96e){if(_0x287fe4[_0xba01('0x4a')]['id']){delete _0x287fe4['body']['id'];}return db[_0xba01('0x2d')][_0xba01('0x48')]({'where':{'id':_0x287fe4[_0xba01('0x44')]['id']}})['then'](handleEntityNotFound(_0x51c96e,null))[_0xba01('0x26')](saveUpdates(_0x287fe4['body'],null))[_0xba01('0x26')](respondWithResult(_0x51c96e,null))[_0xba01('0x43')](handleError(_0x51c96e,null));};exports[_0xba01('0x27')]=function(_0x450ae6,_0x2c8903){return db[_0xba01('0x2d')][_0xba01('0x48')]({'where':{'id':_0x450ae6[_0xba01('0x44')]['id']}})[_0xba01('0x26')](handleEntityNotFound(_0x2c8903,null))[_0xba01('0x26')](removeEntity(_0x2c8903,null))['catch'](handleError(_0x2c8903,null));};exports['describe']=function(_0x1baf5a,_0xc7d2df){return db[_0xba01('0x2d')][_0xba01('0x4b')]()[_0xba01('0x26')](respondWithResult(_0xc7d2df,null))[_0xba01('0x43')](handleError(_0xc7d2df,null));}; \ No newline at end of file +var _0xe276=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','SquareReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe276,0x88));var _0x6e27=function(_0x3400ca,_0x27c04d){_0x3400ca=_0x3400ca-0x0;var _0x26e8d1=_0xe276[_0x3400ca];return _0x26e8d1;};'use strict';var emlformat=require(_0x6e27('0x0'));var rimraf=require(_0x6e27('0x1'));var zipdir=require(_0x6e27('0x2'));var jsonpatch=require(_0x6e27('0x3'));var rp=require(_0x6e27('0x4'));var moment=require('moment');var BPromise=require(_0x6e27('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6e27('0x6'));var sox=require('sox');var csv=require(_0x6e27('0x7'));var ejs=require(_0x6e27('0x8'));var fs=require('fs');var fs_extra=require(_0x6e27('0x9'));var _=require(_0x6e27('0xa'));var squel=require('squel');var crypto=require(_0x6e27('0xb'));var jsforce=require(_0x6e27('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6e27('0x7'));var querystring=require(_0x6e27('0xd'));var Papa=require(_0x6e27('0xe'));var Redis=require(_0x6e27('0xf'));var authService=require(_0x6e27('0x10'));var qs=require(_0x6e27('0x11'));var as=require(_0x6e27('0x12'));var hardwareService=require(_0x6e27('0x13'));var logger=require(_0x6e27('0x14'))(_0x6e27('0x15'));var utils=require(_0x6e27('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6e27('0x17'));var db=require(_0x6e27('0x18'))['db'];function respondWithStatusCode(_0x841f9b,_0xdeeb51){_0xdeeb51=_0xdeeb51||0xcc;return function(_0x14bb96){if(_0x14bb96){return _0x841f9b['sendStatus'](_0xdeeb51);}return _0x841f9b[_0x6e27('0x19')](_0xdeeb51)[_0x6e27('0x1a')]();};}function respondWithResult(_0x2859bb,_0x202456){_0x202456=_0x202456||0xc8;return function(_0x359d8e){if(_0x359d8e){return _0x2859bb[_0x6e27('0x19')](_0x202456)['json'](_0x359d8e);}};}function respondWithFilteredResult(_0x264263,_0x1b4b69){return function(_0x3304a5){if(_0x3304a5){var _0x49e758=typeof _0x1b4b69[_0x6e27('0x1b')]===_0x6e27('0x1c')&&typeof _0x1b4b69['limit']===_0x6e27('0x1c');var _0x3b3fa5=_0x3304a5[_0x6e27('0x1d')];var _0x1c1bc2=_0x49e758?0x0:_0x1b4b69[_0x6e27('0x1b')];var _0x14c176=_0x49e758?_0x3304a5['count']:_0x1b4b69[_0x6e27('0x1b')]+_0x1b4b69[_0x6e27('0x1e')];var _0x3197f5;if(_0x14c176>=_0x3b3fa5){_0x14c176=_0x3b3fa5;_0x3197f5=0xc8;}else{_0x3197f5=0xce;}_0x264263['status'](_0x3197f5);return _0x264263[_0x6e27('0x1f')](_0x6e27('0x20'),_0x1c1bc2+'-'+_0x14c176+'/'+_0x3b3fa5)['json'](_0x3304a5);}return null;};}function patchUpdates(_0x3b732e){return function(_0x3a1502){try{jsonpatch[_0x6e27('0x21')](_0x3a1502,_0x3b732e,!![]);}catch(_0x427cdb){return BPromise[_0x6e27('0x22')](_0x427cdb);}return _0x3a1502[_0x6e27('0x23')]();};}function saveUpdates(_0x2d97d4,_0x3b894b){return function(_0x470641){if(_0x470641){return _0x470641[_0x6e27('0x24')](_0x2d97d4)[_0x6e27('0x25')](function(_0x54cc72){return _0x54cc72;});}return null;};}function removeEntity(_0x464965,_0x5214aa){return function(_0x5900ad){if(_0x5900ad){return _0x5900ad['destroy']()[_0x6e27('0x25')](function(){_0x464965[_0x6e27('0x19')](0xcc)[_0x6e27('0x1a')]();});}};}function handleEntityNotFound(_0x4d4956,_0x1d5249){return function(_0x1d8e0f){if(!_0x1d8e0f){_0x4d4956[_0x6e27('0x26')](0x194);}return _0x1d8e0f;};}function handleError(_0x1d565c,_0x13fc1f){_0x13fc1f=_0x13fc1f||0x1f4;return function(_0x25a995){logger[_0x6e27('0x27')](_0x25a995[_0x6e27('0x28')]);if(_0x25a995[_0x6e27('0x29')]){delete _0x25a995['name'];}_0x1d565c[_0x6e27('0x19')](_0x13fc1f)[_0x6e27('0x2a')](_0x25a995);};}exports[_0x6e27('0x2b')]=function(_0x139a45,_0x4c073f){var _0x1a1cb2={},_0x3bae26={},_0x170bfd={'count':0x0,'rows':[]};var _0x4c2015=_['map'](db[_0x6e27('0x2c')][_0x6e27('0x2d')],function(_0x2345db){return{'name':_0x2345db['fieldName'],'type':_0x2345db[_0x6e27('0x2e')][_0x6e27('0x2f')]};});_0x3bae26[_0x6e27('0x30')]=_[_0x6e27('0x31')](_0x4c2015,_0x6e27('0x29'));_0x3bae26[_0x6e27('0x32')]=_[_0x6e27('0x33')](_0x139a45[_0x6e27('0x32')]);_0x3bae26[_0x6e27('0x34')]=_[_0x6e27('0x35')](_0x3bae26[_0x6e27('0x30')],_0x3bae26[_0x6e27('0x32')]);_0x1a1cb2[_0x6e27('0x36')]=_[_0x6e27('0x35')](_0x3bae26[_0x6e27('0x30')],qs[_0x6e27('0x37')](_0x139a45[_0x6e27('0x32')][_0x6e27('0x37')]));_0x1a1cb2[_0x6e27('0x36')]=_0x1a1cb2['attributes']['length']?_0x1a1cb2['attributes']:_0x3bae26[_0x6e27('0x30')];if(!_0x139a45[_0x6e27('0x32')][_0x6e27('0x38')](_0x6e27('0x39'))){_0x1a1cb2[_0x6e27('0x1e')]=qs[_0x6e27('0x1e')](_0x139a45[_0x6e27('0x32')]['limit']);_0x1a1cb2[_0x6e27('0x1b')]=qs[_0x6e27('0x1b')](_0x139a45['query'][_0x6e27('0x1b')]);}_0x1a1cb2[_0x6e27('0x3a')]=qs[_0x6e27('0x3b')](_0x139a45[_0x6e27('0x32')][_0x6e27('0x3b')]);_0x1a1cb2['where']=qs[_0x6e27('0x34')](_[_0x6e27('0x3c')](_0x139a45[_0x6e27('0x32')],_0x3bae26['filters']),_0x4c2015);if(_0x139a45[_0x6e27('0x32')][_0x6e27('0x3d')]){_0x1a1cb2[_0x6e27('0x3e')]=_[_0x6e27('0x3f')](_0x1a1cb2[_0x6e27('0x3e')],{'$or':_['map'](_0x4c2015,function(_0x2f6819){if(_0x2f6819['type']!==_0x6e27('0x40')){var _0x4ec5d6={};_0x4ec5d6[_0x2f6819[_0x6e27('0x29')]]={'$like':'%'+_0x139a45[_0x6e27('0x32')][_0x6e27('0x3d')]+'%'};return _0x4ec5d6;}})});}_0x1a1cb2=_['merge']({},_0x1a1cb2,_0x139a45['options']);var _0x1274bd={'where':_0x1a1cb2[_0x6e27('0x3e')]};return db[_0x6e27('0x2c')][_0x6e27('0x1d')](_0x1274bd)['then'](function(_0x1ecd7c){_0x170bfd[_0x6e27('0x1d')]=_0x1ecd7c;if(_0x139a45[_0x6e27('0x32')][_0x6e27('0x41')]){_0x1a1cb2['include']=[{'all':!![]}];}return db[_0x6e27('0x2c')][_0x6e27('0x42')](_0x1a1cb2);})[_0x6e27('0x25')](function(_0x20c4e4){_0x170bfd['rows']=_0x20c4e4;return _0x170bfd;})[_0x6e27('0x25')](respondWithFilteredResult(_0x4c073f,_0x1a1cb2))[_0x6e27('0x43')](handleError(_0x4c073f,null));};exports[_0x6e27('0x44')]=function(_0x2ba62d,_0x2fd4c8){var _0x5afb29={'raw':!![],'where':{'id':_0x2ba62d[_0x6e27('0x45')]['id']}},_0x28efd7={};_0x28efd7[_0x6e27('0x30')]=_['keys'](db[_0x6e27('0x2c')][_0x6e27('0x2d')]);_0x28efd7[_0x6e27('0x32')]=_[_0x6e27('0x33')](_0x2ba62d[_0x6e27('0x32')]);_0x28efd7[_0x6e27('0x34')]=_[_0x6e27('0x35')](_0x28efd7[_0x6e27('0x30')],_0x28efd7[_0x6e27('0x32')]);_0x5afb29[_0x6e27('0x36')]=_[_0x6e27('0x35')](_0x28efd7[_0x6e27('0x30')],qs[_0x6e27('0x37')](_0x2ba62d[_0x6e27('0x32')][_0x6e27('0x37')]));_0x5afb29[_0x6e27('0x36')]=_0x5afb29[_0x6e27('0x36')]['length']?_0x5afb29[_0x6e27('0x36')]:_0x28efd7['model'];if(_0x2ba62d[_0x6e27('0x32')]['includeAll']){_0x5afb29[_0x6e27('0x46')]=[{'all':!![]}];}_0x5afb29=_['merge']({},_0x5afb29,_0x2ba62d[_0x6e27('0x47')]);return db[_0x6e27('0x2c')][_0x6e27('0x48')](_0x5afb29)['then'](handleEntityNotFound(_0x2fd4c8,null))[_0x6e27('0x25')](respondWithResult(_0x2fd4c8,null))[_0x6e27('0x43')](handleError(_0x2fd4c8,null));};exports[_0x6e27('0x49')]=function(_0x289aa2,_0xe8f690){return db[_0x6e27('0x2c')][_0x6e27('0x49')](_0x289aa2['body'],{})[_0x6e27('0x25')](respondWithResult(_0xe8f690,0xc9))['catch'](handleError(_0xe8f690,null));};exports[_0x6e27('0x24')]=function(_0x5461ed,_0x3db56b){if(_0x5461ed[_0x6e27('0x4a')]['id']){delete _0x5461ed[_0x6e27('0x4a')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x5461ed['params']['id']}})[_0x6e27('0x25')](handleEntityNotFound(_0x3db56b,null))['then'](saveUpdates(_0x5461ed[_0x6e27('0x4a')],null))[_0x6e27('0x25')](respondWithResult(_0x3db56b,null))[_0x6e27('0x43')](handleError(_0x3db56b,null));};exports[_0x6e27('0x4b')]=function(_0x36a28a,_0x48f889){return db[_0x6e27('0x2c')]['find']({'where':{'id':_0x36a28a[_0x6e27('0x45')]['id']}})[_0x6e27('0x25')](handleEntityNotFound(_0x48f889,null))[_0x6e27('0x25')](removeEntity(_0x48f889,null))[_0x6e27('0x43')](handleError(_0x48f889,null));};exports[_0x6e27('0x4c')]=function(_0x50514c,_0x5c326a){return db[_0x6e27('0x2c')][_0x6e27('0x4c')]()[_0x6e27('0x25')](respondWithResult(_0x5c326a,null))['catch'](handleError(_0x5c326a,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 543eb6f..192ef7d 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 _0xd675=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define','report_square','uid_pname','uniqueid','leaveAt','lodash','util'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0xd675,0xd0));var _0x5d67=function(_0x1162f9,_0x35f87c){_0x1162f9=_0x1162f9-0x0;var _0x75257c=_0xd675[_0x1162f9];return _0x75257c;};'use strict';var _=require(_0x5d67('0x0'));var util=require(_0x5d67('0x1'));var logger=require(_0x5d67('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5d67('0x3'));var rp=require(_0x5d67('0x4'));var fs=require('fs');var path=require(_0x5d67('0x5'));var rimraf=require(_0x5d67('0x6'));var config=require(_0x5d67('0x7'));var attributes=require(_0x5d67('0x8'));module['exports']=function(_0xc79ea9,_0x2c930e){return _0xc79ea9[_0x5d67('0x9')]('SquareReport',attributes,{'tableName':_0x5d67('0xa'),'paranoid':![],'indexes':[{'name':_0x5d67('0xb'),'fields':[_0x5d67('0xc'),'project_name']},{'name':_0x5d67('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1754=['api','moment','bluebird','request-promise','rimraf','./squareReport.attributes','exports','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x420ede,_0x306edc){var _0x35dfee=function(_0x3caf64){while(--_0x3caf64){_0x420ede['push'](_0x420ede['shift']());}};_0x35dfee(++_0x306edc);}(_0x1754,0x1bf));var _0x4175=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0x1754[_0x3f88bc];return _0x4df1c4;};'use strict';var _=require(_0x4175('0x0'));var util=require(_0x4175('0x1'));var logger=require(_0x4175('0x2'))(_0x4175('0x3'));var moment=require(_0x4175('0x4'));var BPromise=require(_0x4175('0x5'));var rp=require(_0x4175('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4175('0x7'));var config=require('../../config/environment');var attributes=require(_0x4175('0x8'));module[_0x4175('0x9')]=function(_0x8380e6,_0x2b8662){return _0x8380e6['define']('SquareReport',attributes,{'tableName':_0x4175('0xa'),'paranoid':![],'indexes':[{'name':_0x4175('0xb'),'fields':[_0x4175('0xc'),_0x4175('0xd')]},{'name':_0x4175('0xe'),'fields':[_0x4175('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index bbd5829..09cb6c8 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 _0x7e1a=['code','message','result','CreateSquareReport','body','options','debug','catch','UpdateSquareReport','update','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3ed2cd,_0x5c1a87){var _0x583da6=function(_0x3e11ea){while(--_0x3e11ea){_0x3ed2cd['push'](_0x3ed2cd['shift']());}};_0x583da6(++_0x5c1a87);}(_0x7e1a,0x7c));var _0xa7e1=function(_0x23dadb,_0x2f3359){_0x23dadb=_0x23dadb-0x0;var _0xdd295c=_0x7e1a[_0x23dadb];return _0xdd295c;};'use strict';var _=require(_0xa7e1('0x0'));var util=require('util');var moment=require(_0xa7e1('0x1'));var BPromise=require(_0xa7e1('0x2'));var rs=require(_0xa7e1('0x3'));var fs=require('fs');var Redis=require(_0xa7e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa7e1('0x5'));var jayson=require(_0xa7e1('0x6'));var client=jayson['client'][_0xa7e1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfb8f29,_0x12a36b,_0x49bead){return new BPromise(function(_0x213525,_0x243e9e){return client[_0xa7e1('0x8')](_0xfb8f29,_0x49bead)[_0xa7e1('0x9')](function(_0x3cee91){logger[_0xa7e1('0xa')](_0xa7e1('0xb'),_0x12a36b,_0xa7e1('0xc'));logger['debug'](_0xa7e1('0xd'),_0x12a36b,'request\x20sent',JSON[_0xa7e1('0xe')](_0x3cee91));if(_0x3cee91[_0xa7e1('0xf')]){if(_0x3cee91[_0xa7e1('0xf')][_0xa7e1('0x10')]===0x1f4){logger[_0xa7e1('0xf')](_0xa7e1('0xb'),_0x12a36b,_0x3cee91[_0xa7e1('0xf')][_0xa7e1('0x11')]);return _0x243e9e(_0x3cee91['error'][_0xa7e1('0x11')]);}logger[_0xa7e1('0xf')](_0xa7e1('0xb'),_0x12a36b,_0x3cee91[_0xa7e1('0xf')][_0xa7e1('0x11')]);return _0x213525(_0x3cee91[_0xa7e1('0xf')][_0xa7e1('0x11')]);}else{logger[_0xa7e1('0xa')](_0xa7e1('0xb'),_0x12a36b,_0xa7e1('0xc'));_0x213525(_0x3cee91[_0xa7e1('0x12')]['message']);}})['catch'](function(_0x27e178){logger[_0xa7e1('0xf')](_0xa7e1('0xb'),_0x12a36b,_0x27e178);_0x243e9e(_0x27e178);});});}exports[_0xa7e1('0x13')]=function(_0x2ab5b7){var _0x3b8f22=this;return new Promise(function(_0x184563,_0x471e02){return db['SquareReport']['create'](_0x2ab5b7[_0xa7e1('0x14')],{'raw':_0x2ab5b7[_0xa7e1('0x15')]?_0x2ab5b7[_0xa7e1('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xa7e1('0x9')](function(_0x3fbf6c){logger[_0xa7e1('0xa')](_0xa7e1('0x13'),_0x2ab5b7);logger[_0xa7e1('0x16')](_0xa7e1('0x13'),_0x2ab5b7,JSON['stringify'](_0x3fbf6c));_0x184563(_0x3fbf6c);})[_0xa7e1('0x17')](function(_0x217acf){logger['error'](_0xa7e1('0x13'),_0x217acf[_0xa7e1('0x11')],_0x2ab5b7);_0x471e02(_0x3b8f22[_0xa7e1('0xf')](0x1f4,_0x217acf[_0xa7e1('0x11')]));});});};exports[_0xa7e1('0x18')]=function(_0x1ec066){var _0x133a13=this;return new Promise(function(_0x26e290,_0x13e766){return db['SquareReport'][_0xa7e1('0x19')](_0x1ec066[_0xa7e1('0x14')],{'raw':_0x1ec066[_0xa7e1('0x15')]?_0x1ec066[_0xa7e1('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ec066[_0xa7e1('0x15')]?_0x1ec066['options']['where']||null:null,'attributes':_0x1ec066[_0xa7e1('0x15')]?_0x1ec066[_0xa7e1('0x15')][_0xa7e1('0x1a')]||null:null,'limit':_0x1ec066[_0xa7e1('0x15')]?_0x1ec066[_0xa7e1('0x15')][_0xa7e1('0x1b')]||null:null})[_0xa7e1('0x9')](function(_0x576a88){logger[_0xa7e1('0xa')](_0xa7e1('0x18'),_0x1ec066);logger[_0xa7e1('0x16')](_0xa7e1('0x18'),_0x1ec066,JSON[_0xa7e1('0xe')](_0x576a88));_0x26e290(_0x576a88);})[_0xa7e1('0x17')](function(_0x4a7fa7){logger[_0xa7e1('0xf')](_0xa7e1('0x18'),_0x4a7fa7['message'],_0x1ec066);_0x13e766(_0x133a13[_0xa7e1('0xf')](0x1f4,_0x4a7fa7[_0xa7e1('0x11')]));});});}; \ No newline at end of file +var _0x37e5=['message','SquareReport,\x20%s,\x20%s','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','where','attributes','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x15fa1f,_0x298fdf){var _0x1a0278=function(_0x440185){while(--_0x440185){_0x15fa1f['push'](_0x15fa1f['shift']());}};_0x1a0278(++_0x298fdf);}(_0x37e5,0x14e));var _0x537e=function(_0x259a42,_0x2b4483){_0x259a42=_0x259a42-0x0;var _0x548d68=_0x37e5[_0x259a42];return _0x548d68;};'use strict';var _=require(_0x537e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x537e('0x1'));var fs=require('fs');var Redis=require(_0x537e('0x2'));var db=require(_0x537e('0x3'))['db'];var utils=require(_0x537e('0x4'));var logger=require(_0x537e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x537e('0x6'));var client=jayson[_0x537e('0x7')][_0x537e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54afa5,_0x29aa43,_0x51c353){return new BPromise(function(_0x977192,_0x566b7d){return client[_0x537e('0x9')](_0x54afa5,_0x51c353)[_0x537e('0xa')](function(_0x14b722){logger[_0x537e('0xb')]('SquareReport,\x20%s,\x20%s',_0x29aa43,_0x537e('0xc'));logger[_0x537e('0xd')](_0x537e('0xe'),_0x29aa43,_0x537e('0xc'),JSON[_0x537e('0xf')](_0x14b722));if(_0x14b722['error']){if(_0x14b722[_0x537e('0x10')][_0x537e('0x11')]===0x1f4){logger[_0x537e('0x10')]('SquareReport,\x20%s,\x20%s',_0x29aa43,_0x14b722[_0x537e('0x10')][_0x537e('0x12')]);return _0x566b7d(_0x14b722['error'][_0x537e('0x12')]);}logger[_0x537e('0x10')]('SquareReport,\x20%s,\x20%s',_0x29aa43,_0x14b722['error'][_0x537e('0x12')]);return _0x977192(_0x14b722[_0x537e('0x10')][_0x537e('0x12')]);}else{logger[_0x537e('0xb')](_0x537e('0x13'),_0x29aa43,'request\x20sent');_0x977192(_0x14b722[_0x537e('0x14')][_0x537e('0x12')]);}})[_0x537e('0x15')](function(_0x191230){logger['error'](_0x537e('0x13'),_0x29aa43,_0x191230);_0x566b7d(_0x191230);});});}exports[_0x537e('0x16')]=function(_0x2f8af9){var _0x54b73f=this;return new Promise(function(_0x10a5a3,_0x5cb050){return db[_0x537e('0x17')][_0x537e('0x18')](_0x2f8af9[_0x537e('0x19')],{'raw':_0x2f8af9[_0x537e('0x1a')]?_0x2f8af9[_0x537e('0x1a')][_0x537e('0x1b')]===undefined?!![]:![]:!![]})[_0x537e('0xa')](function(_0x47f111){logger['info']('CreateSquareReport',_0x2f8af9);logger[_0x537e('0xd')]('CreateSquareReport',_0x2f8af9,JSON[_0x537e('0xf')](_0x47f111));_0x10a5a3(_0x47f111);})[_0x537e('0x15')](function(_0x32252f){logger[_0x537e('0x10')](_0x537e('0x16'),_0x32252f[_0x537e('0x12')],_0x2f8af9);_0x5cb050(_0x54b73f[_0x537e('0x10')](0x1f4,_0x32252f[_0x537e('0x12')]));});});};exports[_0x537e('0x1c')]=function(_0x4efe47){var _0x279f29=this;return new Promise(function(_0x380a02,_0xb55874){return db[_0x537e('0x17')]['update'](_0x4efe47[_0x537e('0x19')],{'raw':_0x4efe47[_0x537e('0x1a')]?_0x4efe47['options'][_0x537e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4efe47[_0x537e('0x1a')]?_0x4efe47[_0x537e('0x1a')][_0x537e('0x1d')]||null:null,'attributes':_0x4efe47[_0x537e('0x1a')]?_0x4efe47[_0x537e('0x1a')][_0x537e('0x1e')]||null:null,'limit':_0x4efe47[_0x537e('0x1a')]?_0x4efe47[_0x537e('0x1a')][_0x537e('0x1f')]||null:null})[_0x537e('0xa')](function(_0x579074){logger[_0x537e('0xb')]('UpdateSquareReport',_0x4efe47);logger['debug'](_0x537e('0x1c'),_0x4efe47,JSON[_0x537e('0xf')](_0x579074));_0x380a02(_0x579074);})[_0x537e('0x15')](function(_0x2aaa25){logger['error'](_0x537e('0x1c'),_0x2aaa25[_0x537e('0x12')],_0x4efe47);_0xb55874(_0x279f29[_0x537e('0x10')](0x1f4,_0x2aaa25[_0x537e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 6ee1276..69d375e 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 _0xfe68=['../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','describe','/:id','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3623dd,_0x43912b){var _0xa096=function(_0x5880fe){while(--_0x5880fe){_0x3623dd['push'](_0x3623dd['shift']());}};_0xa096(++_0x43912b);}(_0xfe68,0x139));var _0x8fe6=function(_0xca41dc,_0x22936e){_0xca41dc=_0xca41dc-0x0;var _0x3e125c=_0xfe68[_0xca41dc];return _0x3e125c;};'use strict';var multer=require(_0x8fe6('0x0'));var util=require(_0x8fe6('0x1'));var path=require(_0x8fe6('0x2'));var timeout=require('connect-timeout');var express=require(_0x8fe6('0x3'));var router=express[_0x8fe6('0x4')]();var fs_extra=require(_0x8fe6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8fe6('0x6'));var config=require(_0x8fe6('0x7'));var controller=require(_0x8fe6('0x8'));router['get']('/',auth[_0x8fe6('0x9')](),controller[_0x8fe6('0xa')]);router[_0x8fe6('0xb')]('/describe',auth[_0x8fe6('0x9')](),controller[_0x8fe6('0xc')]);router[_0x8fe6('0xb')](_0x8fe6('0xd'),auth[_0x8fe6('0x9')](),controller['show']);router[_0x8fe6('0xe')]('/',auth['isAuthenticated'](),controller[_0x8fe6('0xf')]);router[_0x8fe6('0x10')](_0x8fe6('0xd'),auth[_0x8fe6('0x9')](),controller[_0x8fe6('0x11')]);router[_0x8fe6('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8fe6('0x13')]=router; \ No newline at end of file +var _0xc7e4=['../../config/environment','./squareReportDetail.controller','index','get','/describe','/:id','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xc7e4,0xab));var _0x4c7e=function(_0x4e9c37,_0x610089){_0x4e9c37=_0x4e9c37-0x0;var _0x2b8231=_0xc7e4[_0x4e9c37];return _0x2b8231;};'use strict';var multer=require(_0x4c7e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4c7e('0x1'));var express=require(_0x4c7e('0x2'));var router=express[_0x4c7e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4c7e('0x4'));var config=require(_0x4c7e('0x5'));var controller=require(_0x4c7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4c7e('0x7')]);router[_0x4c7e('0x8')](_0x4c7e('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4c7e('0xa'),auth[_0x4c7e('0xb')](),controller['show']);router['post']('/',auth[_0x4c7e('0xb')](),controller[_0x4c7e('0xc')]);router['put']('/:id',auth[_0x4c7e('0xb')](),controller[_0x4c7e('0xd')]);router[_0x4c7e('0xe')](_0x4c7e('0xa'),auth['isAuthenticated'](),controller[_0x4c7e('0xf')]);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 7ed2841..581bc81 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 _0x8fa6=['STRING','exports'];(function(_0x1d4923,_0x4e222f){var _0x14ea9a=function(_0x54e138){while(--_0x54e138){_0x1d4923['push'](_0x1d4923['shift']());}};_0x14ea9a(++_0x4e222f);}(_0x8fa6,0x139));var _0x68fa=function(_0x4ccc41,_0x34030f){_0x4ccc41=_0x4ccc41-0x0;var _0xa2d26=_0x8fa6[_0x4ccc41];return _0xa2d26;};'use strict';var Sequelize=require('sequelize');module[_0x68fa('0x0')]={'uniqueid':{'type':Sequelize[_0x68fa('0x1')]},'node':{'type':Sequelize[_0x68fa('0x1')]},'application':{'type':Sequelize[_0x68fa('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x68fa('0x1')]},'callerid':{'type':Sequelize[_0x68fa('0x1')]}}; \ No newline at end of file +var _0x9444=['TEXT','sequelize','exports','STRING'];(function(_0x24f107,_0x3c6c88){var _0x5116ab=function(_0x2b4985){while(--_0x2b4985){_0x24f107['push'](_0x24f107['shift']());}};_0x5116ab(++_0x3c6c88);}(_0x9444,0x1a5));var _0x4944=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x9444[_0x2bddf9];return _0x3f3ae9;};'use strict';var Sequelize=require(_0x4944('0x0'));module[_0x4944('0x1')]={'uniqueid':{'type':Sequelize[_0x4944('0x2')]},'node':{'type':Sequelize[_0x4944('0x2')]},'application':{'type':Sequelize[_0x4944('0x2')]},'data':{'type':Sequelize[_0x4944('0x3')]},'project_name':{'type':Sequelize[_0x4944('0x2')]},'callerid':{'type':Sequelize[_0x4944('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 06a73ee..cfcf279 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 _0xb203=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','type','filter','merge','options','includeAll','include','SquareDetailsReport','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xb203,0x1be));var _0x3b20=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb203[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0x3b20('0x0'));var rimraf=require(_0x3b20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b20('0x2'));var rp=require(_0x3b20('0x3'));var moment=require(_0x3b20('0x4'));var BPromise=require(_0x3b20('0x5'));var Mustache=require(_0x3b20('0x6'));var util=require('util');var path=require(_0x3b20('0x7'));var sox=require('sox');var csv=require(_0x3b20('0x8'));var ejs=require(_0x3b20('0x9'));var fs=require('fs');var fs_extra=require(_0x3b20('0xa'));var _=require(_0x3b20('0xb'));var squel=require(_0x3b20('0xc'));var crypto=require(_0x3b20('0xd'));var jsforce=require(_0x3b20('0xe'));var deskjs=require(_0x3b20('0xf'));var toCsv=require(_0x3b20('0x8'));var querystring=require(_0x3b20('0x10'));var Papa=require(_0x3b20('0x11'));var Redis=require(_0x3b20('0x12'));var authService=require(_0x3b20('0x13'));var qs=require(_0x3b20('0x14'));var as=require(_0x3b20('0x15'));var hardwareService=require(_0x3b20('0x16'));var logger=require(_0x3b20('0x17'))(_0x3b20('0x18'));var utils=require(_0x3b20('0x19'));var config=require(_0x3b20('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b20('0x1b'))['db'];function respondWithStatusCode(_0x147f16,_0x1809bb){_0x1809bb=_0x1809bb||0xcc;return function(_0x5cf8af){if(_0x5cf8af){return _0x147f16[_0x3b20('0x1c')](_0x1809bb);}return _0x147f16[_0x3b20('0x1d')](_0x1809bb)[_0x3b20('0x1e')]();};}function respondWithResult(_0x4f76e0,_0x49c158){_0x49c158=_0x49c158||0xc8;return function(_0x219881){if(_0x219881){return _0x4f76e0[_0x3b20('0x1d')](_0x49c158)['json'](_0x219881);}};}function respondWithFilteredResult(_0x1617a3,_0x4014f1){return function(_0x1914e5){if(_0x1914e5){var _0x2f1f04=typeof _0x4014f1[_0x3b20('0x1f')]===_0x3b20('0x20')&&typeof _0x4014f1[_0x3b20('0x21')]==='undefined';var _0x59c34c=_0x1914e5[_0x3b20('0x22')];var _0x4881a7=_0x2f1f04?0x0:_0x4014f1['offset'];var _0x19de04=_0x2f1f04?_0x1914e5[_0x3b20('0x22')]:_0x4014f1[_0x3b20('0x1f')]+_0x4014f1['limit'];var _0x47c78f;if(_0x19de04>=_0x59c34c){_0x19de04=_0x59c34c;_0x47c78f=0xc8;}else{_0x47c78f=0xce;}_0x1617a3[_0x3b20('0x1d')](_0x47c78f);return _0x1617a3[_0x3b20('0x23')](_0x3b20('0x24'),_0x4881a7+'-'+_0x19de04+'/'+_0x59c34c)[_0x3b20('0x25')](_0x1914e5);}return null;};}function patchUpdates(_0x473bd3){return function(_0xb45ce3){try{jsonpatch[_0x3b20('0x26')](_0xb45ce3,_0x473bd3,!![]);}catch(_0x50f04e){return BPromise[_0x3b20('0x27')](_0x50f04e);}return _0xb45ce3[_0x3b20('0x28')]();};}function saveUpdates(_0x19c08d,_0xff830){return function(_0x2050d9){if(_0x2050d9){return _0x2050d9['update'](_0x19c08d)[_0x3b20('0x29')](function(_0x340625){return _0x340625;});}return null;};}function removeEntity(_0x3351fc,_0x4f2884){return function(_0x5c7671){if(_0x5c7671){return _0x5c7671[_0x3b20('0x2a')]()[_0x3b20('0x29')](function(){_0x3351fc[_0x3b20('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49ec3e,_0x26f027){return function(_0xed367d){if(!_0xed367d){_0x49ec3e[_0x3b20('0x1c')](0x194);}return _0xed367d;};}function handleError(_0x33f4ea,_0x2cff46){_0x2cff46=_0x2cff46||0x1f4;return function(_0x5cc5fe){logger[_0x3b20('0x2b')](_0x5cc5fe[_0x3b20('0x2c')]);if(_0x5cc5fe['name']){delete _0x5cc5fe[_0x3b20('0x2d')];}_0x33f4ea[_0x3b20('0x1d')](_0x2cff46)['send'](_0x5cc5fe);};}exports[_0x3b20('0x2e')]=function(_0x5ddbb4,_0x26b44a){var _0x505690={},_0x180349={},_0x42195d={'count':0x0,'rows':[]};var _0x531f60=_['map'](db['SquareDetailsReport'][_0x3b20('0x2f')],function(_0x3b683c){return{'name':_0x3b683c['fieldName'],'type':_0x3b683c['type']['key']};});_0x180349[_0x3b20('0x30')]=_[_0x3b20('0x31')](_0x531f60,_0x3b20('0x2d'));_0x180349[_0x3b20('0x32')]=_[_0x3b20('0x33')](_0x5ddbb4[_0x3b20('0x32')]);_0x180349[_0x3b20('0x34')]=_[_0x3b20('0x35')](_0x180349[_0x3b20('0x30')],_0x180349[_0x3b20('0x32')]);_0x505690[_0x3b20('0x36')]=_[_0x3b20('0x35')](_0x180349[_0x3b20('0x30')],qs[_0x3b20('0x37')](_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x37')]));_0x505690[_0x3b20('0x36')]=_0x505690['attributes'][_0x3b20('0x38')]?_0x505690['attributes']:_0x180349['model'];if(!_0x5ddbb4[_0x3b20('0x32')]['hasOwnProperty'](_0x3b20('0x39'))){_0x505690[_0x3b20('0x21')]=qs[_0x3b20('0x21')](_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x21')]);_0x505690['offset']=qs['offset'](_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x1f')]);}_0x505690[_0x3b20('0x3a')]=qs['sort'](_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x3b')]);_0x505690[_0x3b20('0x3c')]=qs[_0x3b20('0x34')](_[_0x3b20('0x3d')](_0x5ddbb4['query'],_0x180349[_0x3b20('0x34')]),_0x531f60);if(_0x5ddbb4[_0x3b20('0x32')]['filter']){_0x505690[_0x3b20('0x3c')]=_['merge'](_0x505690[_0x3b20('0x3c')],{'$or':_[_0x3b20('0x31')](_0x531f60,function(_0x52b851){if(_0x52b851[_0x3b20('0x3e')]!=='VIRTUAL'){var _0x528a84={};_0x528a84[_0x52b851[_0x3b20('0x2d')]]={'$like':'%'+_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x3f')]+'%'};return _0x528a84;}})});}_0x505690=_[_0x3b20('0x40')]({},_0x505690,_0x5ddbb4[_0x3b20('0x41')]);var _0x342d5a={'where':_0x505690[_0x3b20('0x3c')]};return db['SquareDetailsReport'][_0x3b20('0x22')](_0x342d5a)[_0x3b20('0x29')](function(_0x8955cc){_0x42195d[_0x3b20('0x22')]=_0x8955cc;if(_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x42')]){_0x505690[_0x3b20('0x43')]=[{'all':!![]}];}return db[_0x3b20('0x44')][_0x3b20('0x45')](_0x505690);})[_0x3b20('0x29')](function(_0x2ca876){_0x42195d[_0x3b20('0x46')]=_0x2ca876;return _0x42195d;})[_0x3b20('0x29')](respondWithFilteredResult(_0x26b44a,_0x505690))[_0x3b20('0x47')](handleError(_0x26b44a,null));};exports[_0x3b20('0x48')]=function(_0x4bd63e,_0x215b8d){var _0x2606b3={'raw':!![],'where':{'id':_0x4bd63e[_0x3b20('0x49')]['id']}},_0x1639e0={};_0x1639e0[_0x3b20('0x30')]=_[_0x3b20('0x33')](db['SquareDetailsReport'][_0x3b20('0x2f')]);_0x1639e0[_0x3b20('0x32')]=_[_0x3b20('0x33')](_0x4bd63e['query']);_0x1639e0[_0x3b20('0x34')]=_['intersection'](_0x1639e0['model'],_0x1639e0[_0x3b20('0x32')]);_0x2606b3[_0x3b20('0x36')]=_[_0x3b20('0x35')](_0x1639e0[_0x3b20('0x30')],qs['fields'](_0x4bd63e[_0x3b20('0x32')][_0x3b20('0x37')]));_0x2606b3[_0x3b20('0x36')]=_0x2606b3[_0x3b20('0x36')]['length']?_0x2606b3[_0x3b20('0x36')]:_0x1639e0[_0x3b20('0x30')];if(_0x4bd63e[_0x3b20('0x32')]['includeAll']){_0x2606b3[_0x3b20('0x43')]=[{'all':!![]}];}_0x2606b3=_[_0x3b20('0x40')]({},_0x2606b3,_0x4bd63e[_0x3b20('0x41')]);return db[_0x3b20('0x44')][_0x3b20('0x4a')](_0x2606b3)[_0x3b20('0x29')](handleEntityNotFound(_0x215b8d,null))[_0x3b20('0x29')](respondWithResult(_0x215b8d,null))['catch'](handleError(_0x215b8d,null));};exports[_0x3b20('0x4b')]=function(_0x3c2493,_0x2af4ab){return db[_0x3b20('0x44')][_0x3b20('0x4b')](_0x3c2493[_0x3b20('0x4c')],{})[_0x3b20('0x29')](respondWithResult(_0x2af4ab,0xc9))['catch'](handleError(_0x2af4ab,null));};exports[_0x3b20('0x4d')]=function(_0x339920,_0x117fbf){if(_0x339920[_0x3b20('0x4c')]['id']){delete _0x339920[_0x3b20('0x4c')]['id'];}return db[_0x3b20('0x44')][_0x3b20('0x4a')]({'where':{'id':_0x339920[_0x3b20('0x49')]['id']}})[_0x3b20('0x29')](handleEntityNotFound(_0x117fbf,null))[_0x3b20('0x29')](saveUpdates(_0x339920[_0x3b20('0x4c')],null))[_0x3b20('0x29')](respondWithResult(_0x117fbf,null))['catch'](handleError(_0x117fbf,null));};exports[_0x3b20('0x2a')]=function(_0x19309d,_0x58a68e){return db[_0x3b20('0x44')][_0x3b20('0x4a')]({'where':{'id':_0x19309d['params']['id']}})[_0x3b20('0x29')](handleEntityNotFound(_0x58a68e,null))[_0x3b20('0x29')](removeEntity(_0x58a68e,null))[_0x3b20('0x47')](handleError(_0x58a68e,null));};exports[_0x3b20('0x4e')]=function(_0x3f6191,_0x347dc4){return db[_0x3b20('0x44')][_0x3b20('0x4e')]()['then'](respondWithResult(_0x347dc4,null))['catch'](handleError(_0x347dc4,null));}; \ No newline at end of file +var _0xad6b=['limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SquareDetailsReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','sort','filter','where','VIRTUAL','merge','options','count','show','params','keys','includeAll','include','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0xad6b,0x1cf));var _0xbad6=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xad6b[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0xbad6('0x0'));var rimraf=require(_0xbad6('0x1'));var zipdir=require(_0xbad6('0x2'));var jsonpatch=require(_0xbad6('0x3'));var rp=require('request-promise');var moment=require(_0xbad6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbad6('0x5'));var sox=require(_0xbad6('0x6'));var csv=require(_0xbad6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbad6('0x8'));var _=require(_0xbad6('0x9'));var squel=require(_0xbad6('0xa'));var crypto=require('crypto');var jsforce=require(_0xbad6('0xb'));var deskjs=require(_0xbad6('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbad6('0xd'));var Redis=require('ioredis');var authService=require(_0xbad6('0xe'));var qs=require(_0xbad6('0xf'));var as=require(_0xbad6('0x10'));var hardwareService=require(_0xbad6('0x11'));var logger=require(_0xbad6('0x12'))('api');var utils=require(_0xbad6('0x13'));var config=require(_0xbad6('0x14'));var licenseUtil=require(_0xbad6('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a9c07,_0x3e42a3){_0x3e42a3=_0x3e42a3||0xcc;return function(_0x277901){if(_0x277901){return _0x3a9c07[_0xbad6('0x16')](_0x3e42a3);}return _0x3a9c07[_0xbad6('0x17')](_0x3e42a3)[_0xbad6('0x18')]();};}function respondWithResult(_0x141934,_0x4905de){_0x4905de=_0x4905de||0xc8;return function(_0x5a13b0){if(_0x5a13b0){return _0x141934[_0xbad6('0x17')](_0x4905de)[_0xbad6('0x19')](_0x5a13b0);}};}function respondWithFilteredResult(_0x51a259,_0x24ce3f){return function(_0x5956ae){if(_0x5956ae){var _0x297fbe=typeof _0x24ce3f['offset']===_0xbad6('0x1a')&&typeof _0x24ce3f[_0xbad6('0x1b')]===_0xbad6('0x1a');var _0x4b4f01=_0x5956ae['count'];var _0x274053=_0x297fbe?0x0:_0x24ce3f[_0xbad6('0x1c')];var _0x1815a6=_0x297fbe?_0x5956ae['count']:_0x24ce3f['offset']+_0x24ce3f[_0xbad6('0x1b')];var _0x3063aa;if(_0x1815a6>=_0x4b4f01){_0x1815a6=_0x4b4f01;_0x3063aa=0xc8;}else{_0x3063aa=0xce;}_0x51a259['status'](_0x3063aa);return _0x51a259[_0xbad6('0x1d')](_0xbad6('0x1e'),_0x274053+'-'+_0x1815a6+'/'+_0x4b4f01)['json'](_0x5956ae);}return null;};}function patchUpdates(_0x4d9151){return function(_0x737d8e){try{jsonpatch[_0xbad6('0x1f')](_0x737d8e,_0x4d9151,!![]);}catch(_0x11bdc7){return BPromise[_0xbad6('0x20')](_0x11bdc7);}return _0x737d8e[_0xbad6('0x21')]();};}function saveUpdates(_0x1f367b,_0x41d90a){return function(_0x3cd5af){if(_0x3cd5af){return _0x3cd5af[_0xbad6('0x22')](_0x1f367b)[_0xbad6('0x23')](function(_0x338ac2){return _0x338ac2;});}return null;};}function removeEntity(_0x1a0702,_0x5a086a){return function(_0x2eb593){if(_0x2eb593){return _0x2eb593[_0xbad6('0x24')]()['then'](function(){_0x1a0702[_0xbad6('0x17')](0xcc)[_0xbad6('0x18')]();});}};}function handleEntityNotFound(_0x1af294,_0x16af6c){return function(_0x1a75cd){if(!_0x1a75cd){_0x1af294[_0xbad6('0x16')](0x194);}return _0x1a75cd;};}function handleError(_0x45e964,_0x544c3e){_0x544c3e=_0x544c3e||0x1f4;return function(_0x332993){logger[_0xbad6('0x25')](_0x332993[_0xbad6('0x26')]);if(_0x332993['name']){delete _0x332993[_0xbad6('0x27')];}_0x45e964[_0xbad6('0x17')](_0x544c3e)['send'](_0x332993);};}exports[_0xbad6('0x28')]=function(_0x1c23a2,_0x416cff){var _0x402328={},_0x55cbe3={},_0x3aea27={'count':0x0,'rows':[]};var _0x553660=_[_0xbad6('0x29')](db[_0xbad6('0x2a')][_0xbad6('0x2b')],function(_0x348972){return{'name':_0x348972['fieldName'],'type':_0x348972[_0xbad6('0x2c')][_0xbad6('0x2d')]};});_0x55cbe3[_0xbad6('0x2e')]=_[_0xbad6('0x29')](_0x553660,_0xbad6('0x27'));_0x55cbe3[_0xbad6('0x2f')]=_['keys'](_0x1c23a2[_0xbad6('0x2f')]);_0x55cbe3[_0xbad6('0x30')]=_[_0xbad6('0x31')](_0x55cbe3[_0xbad6('0x2e')],_0x55cbe3[_0xbad6('0x2f')]);_0x402328[_0xbad6('0x32')]=_['intersection'](_0x55cbe3[_0xbad6('0x2e')],qs[_0xbad6('0x33')](_0x1c23a2[_0xbad6('0x2f')][_0xbad6('0x33')]));_0x402328[_0xbad6('0x32')]=_0x402328[_0xbad6('0x32')][_0xbad6('0x34')]?_0x402328[_0xbad6('0x32')]:_0x55cbe3[_0xbad6('0x2e')];if(!_0x1c23a2['query']['hasOwnProperty']('nolimit')){_0x402328[_0xbad6('0x1b')]=qs[_0xbad6('0x1b')](_0x1c23a2['query'][_0xbad6('0x1b')]);_0x402328[_0xbad6('0x1c')]=qs[_0xbad6('0x1c')](_0x1c23a2[_0xbad6('0x2f')]['offset']);}_0x402328['order']=qs[_0xbad6('0x35')](_0x1c23a2[_0xbad6('0x2f')][_0xbad6('0x35')]);_0x402328['where']=qs[_0xbad6('0x30')](_['pick'](_0x1c23a2[_0xbad6('0x2f')],_0x55cbe3[_0xbad6('0x30')]),_0x553660);if(_0x1c23a2[_0xbad6('0x2f')][_0xbad6('0x36')]){_0x402328[_0xbad6('0x37')]=_['merge'](_0x402328[_0xbad6('0x37')],{'$or':_[_0xbad6('0x29')](_0x553660,function(_0x19c072){if(_0x19c072[_0xbad6('0x2c')]!==_0xbad6('0x38')){var _0x3e4379={};_0x3e4379[_0x19c072['name']]={'$like':'%'+_0x1c23a2[_0xbad6('0x2f')][_0xbad6('0x36')]+'%'};return _0x3e4379;}})});}_0x402328=_[_0xbad6('0x39')]({},_0x402328,_0x1c23a2[_0xbad6('0x3a')]);var _0x26ad56={'where':_0x402328[_0xbad6('0x37')]};return db['SquareDetailsReport']['count'](_0x26ad56)[_0xbad6('0x23')](function(_0xdddaf4){_0x3aea27[_0xbad6('0x3b')]=_0xdddaf4;if(_0x1c23a2[_0xbad6('0x2f')]['includeAll']){_0x402328['include']=[{'all':!![]}];}return db[_0xbad6('0x2a')]['findAll'](_0x402328);})['then'](function(_0x383314){_0x3aea27['rows']=_0x383314;return _0x3aea27;})['then'](respondWithFilteredResult(_0x416cff,_0x402328))['catch'](handleError(_0x416cff,null));};exports[_0xbad6('0x3c')]=function(_0x1a29a6,_0x196973){var _0x11ec74={'raw':!![],'where':{'id':_0x1a29a6[_0xbad6('0x3d')]['id']}},_0x3f4aa5={};_0x3f4aa5[_0xbad6('0x2e')]=_[_0xbad6('0x3e')](db[_0xbad6('0x2a')][_0xbad6('0x2b')]);_0x3f4aa5[_0xbad6('0x2f')]=_['keys'](_0x1a29a6['query']);_0x3f4aa5[_0xbad6('0x30')]=_[_0xbad6('0x31')](_0x3f4aa5[_0xbad6('0x2e')],_0x3f4aa5[_0xbad6('0x2f')]);_0x11ec74['attributes']=_[_0xbad6('0x31')](_0x3f4aa5[_0xbad6('0x2e')],qs['fields'](_0x1a29a6[_0xbad6('0x2f')][_0xbad6('0x33')]));_0x11ec74['attributes']=_0x11ec74[_0xbad6('0x32')][_0xbad6('0x34')]?_0x11ec74[_0xbad6('0x32')]:_0x3f4aa5[_0xbad6('0x2e')];if(_0x1a29a6[_0xbad6('0x2f')][_0xbad6('0x3f')]){_0x11ec74[_0xbad6('0x40')]=[{'all':!![]}];}_0x11ec74=_[_0xbad6('0x39')]({},_0x11ec74,_0x1a29a6[_0xbad6('0x3a')]);return db[_0xbad6('0x2a')][_0xbad6('0x41')](_0x11ec74)[_0xbad6('0x23')](handleEntityNotFound(_0x196973,null))[_0xbad6('0x23')](respondWithResult(_0x196973,null))['catch'](handleError(_0x196973,null));};exports['create']=function(_0x49be16,_0x262fce){return db['SquareDetailsReport'][_0xbad6('0x42')](_0x49be16[_0xbad6('0x43')],{})['then'](respondWithResult(_0x262fce,0xc9))[_0xbad6('0x44')](handleError(_0x262fce,null));};exports[_0xbad6('0x22')]=function(_0x4f9aed,_0x13dfe0){if(_0x4f9aed[_0xbad6('0x43')]['id']){delete _0x4f9aed[_0xbad6('0x43')]['id'];}return db[_0xbad6('0x2a')][_0xbad6('0x41')]({'where':{'id':_0x4f9aed[_0xbad6('0x3d')]['id']}})[_0xbad6('0x23')](handleEntityNotFound(_0x13dfe0,null))['then'](saveUpdates(_0x4f9aed[_0xbad6('0x43')],null))['then'](respondWithResult(_0x13dfe0,null))[_0xbad6('0x44')](handleError(_0x13dfe0,null));};exports[_0xbad6('0x24')]=function(_0x53a418,_0x8555d9){return db[_0xbad6('0x2a')][_0xbad6('0x41')]({'where':{'id':_0x53a418[_0xbad6('0x3d')]['id']}})['then'](handleEntityNotFound(_0x8555d9,null))['then'](removeEntity(_0x8555d9,null))['catch'](handleError(_0x8555d9,null));};exports['describe']=function(_0x18e233,_0x1a3706){return db[_0xbad6('0x2a')][_0xbad6('0x45')]()[_0xbad6('0x23')](respondWithResult(_0x1a3706,null))[_0xbad6('0x44')](handleError(_0x1a3706,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 7bc761f..5d6bdf0 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 _0x049c=['exports','define','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x049c,0x129));var _0xc049=function(_0xb889f,_0x5c96c1){_0xb889f=_0xb889f-0x0;var _0x250eec=_0x049c[_0xb889f];return _0x250eec;};'use strict';var _=require(_0xc049('0x0'));var util=require(_0xc049('0x1'));var logger=require(_0xc049('0x2'))(_0xc049('0x3'));var moment=require(_0xc049('0x4'));var BPromise=require(_0xc049('0x5'));var rp=require(_0xc049('0x6'));var fs=require('fs');var path=require(_0xc049('0x7'));var rimraf=require(_0xc049('0x8'));var config=require(_0xc049('0x9'));var attributes=require(_0xc049('0xa'));module[_0xc049('0xb')]=function(_0x2efeef,_0x448b57){return _0x2efeef[_0xc049('0xc')]('SquareDetailsReport',attributes,{'tableName':_0xc049('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a7a=['exports','define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x5c1aea,_0x17331f){var _0x7a7af7=function(_0x188016){while(--_0x188016){_0x5c1aea['push'](_0x5c1aea['shift']());}};_0x7a7af7(++_0x17331f);}(_0x6a7a,0x162));var _0xa6a7=function(_0x86b9b,_0x3bee57){_0x86b9b=_0x86b9b-0x0;var _0x42a820=_0x6a7a[_0x86b9b];return _0x42a820;};'use strict';var _=require(_0xa6a7('0x0'));var util=require(_0xa6a7('0x1'));var logger=require(_0xa6a7('0x2'))(_0xa6a7('0x3'));var moment=require(_0xa6a7('0x4'));var BPromise=require('bluebird');var rp=require(_0xa6a7('0x5'));var fs=require('fs');var path=require(_0xa6a7('0x6'));var rimraf=require(_0xa6a7('0x7'));var config=require(_0xa6a7('0x8'));var attributes=require(_0xa6a7('0x9'));module[_0xa6a7('0xa')]=function(_0x5dccd1,_0xd67787){return _0x5dccd1[_0xa6a7('0xb')](_0xa6a7('0xc'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 3e653b5..54188b9 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 _0x0b7f=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','SquareDetailsReport,\x20%s,\x20%s','message','request\x20sent','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','stringify','catch','lodash','util','bluebird'];(function(_0x6cad76,_0x2f256b){var _0x47efe2=function(_0x52ecfe){while(--_0x52ecfe){_0x6cad76['push'](_0x6cad76['shift']());}};_0x47efe2(++_0x2f256b);}(_0x0b7f,0x115));var _0xf0b7=function(_0x127565,_0x4cf4c7){_0x127565=_0x127565-0x0;var _0x35090e=_0x0b7f[_0x127565];return _0x35090e;};'use strict';var _=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var moment=require('moment');var BPromise=require(_0xf0b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0b7('0x3'));var db=require(_0xf0b7('0x4'))['db'];var utils=require(_0xf0b7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0b7('0x6'));var jayson=require(_0xf0b7('0x7'));var client=jayson[_0xf0b7('0x8')][_0xf0b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b2de8,_0x5e449a,_0x1408ee){return new BPromise(function(_0x276f09,_0x275a13){return client[_0xf0b7('0xa')](_0x2b2de8,_0x1408ee)[_0xf0b7('0xb')](function(_0x588b46){logger[_0xf0b7('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x5e449a,'request\x20sent');logger['debug'](_0xf0b7('0xd'),_0x5e449a,'request\x20sent',JSON['stringify'](_0x588b46));if(_0x588b46[_0xf0b7('0xe')]){if(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0xf')]===0x1f4){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x275a13(_0x588b46[_0xf0b7('0xe')]['message']);}logger['error'](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x276f09(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);}else{logger['info'](_0xf0b7('0x10'),_0x5e449a,_0xf0b7('0x12'));_0x276f09(_0x588b46[_0xf0b7('0x13')][_0xf0b7('0x11')]);}})['catch'](function(_0x303db6){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x303db6);_0x275a13(_0x303db6);});});}exports[_0xf0b7('0x14')]=function(_0x52b27e){var _0x1e5fc9=this;return new Promise(function(_0x153d23,_0x28fd36){return db[_0xf0b7('0x15')][_0xf0b7('0x16')](_0x52b27e['body'],{'raw':_0x52b27e[_0xf0b7('0x17')]?_0x52b27e['options'][_0xf0b7('0x18')]===undefined?!![]:![]:!![]})[_0xf0b7('0xb')](function(_0x374496){logger['info']('CreateSquareDetailsReport',_0x52b27e);logger[_0xf0b7('0x19')](_0xf0b7('0x14'),_0x52b27e,JSON[_0xf0b7('0x1a')](_0x374496));_0x153d23(_0x374496);})[_0xf0b7('0x1b')](function(_0xb90b3c){logger[_0xf0b7('0xe')](_0xf0b7('0x14'),_0xb90b3c[_0xf0b7('0x11')],_0x52b27e);_0x28fd36(_0x1e5fc9[_0xf0b7('0xe')](0x1f4,_0xb90b3c['message']));});});}; \ No newline at end of file +var _0xc7da=['code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x2493f5,_0x4189ab){var _0x16f6d8=function(_0x575c83){while(--_0x575c83){_0x2493f5['push'](_0x2493f5['shift']());}};_0x16f6d8(++_0x4189ab);}(_0xc7da,0xf2));var _0xac7d=function(_0x259882,_0x3b2bfe){_0x259882=_0x259882-0x0;var _0x44b823=_0xc7da[_0x259882];return _0x44b823;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var moment=require(_0xac7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xac7d('0x3'));var fs=require('fs');var Redis=require(_0xac7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac7d('0x5'));var logger=require(_0xac7d('0x6'))('rpc');var config=require(_0xac7d('0x7'));var jayson=require(_0xac7d('0x8'));var client=jayson[_0xac7d('0x9')][_0xac7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x268265,_0x153ce5,_0x48ca59){return new BPromise(function(_0x44eb2b,_0x457e2d){return client[_0xac7d('0xb')](_0x268265,_0x48ca59)[_0xac7d('0xc')](function(_0x217811){logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');logger[_0xac7d('0xf')](_0xac7d('0x10'),_0x153ce5,_0xac7d('0x11'),JSON['stringify'](_0x217811));if(_0x217811[_0xac7d('0x12')]){if(_0x217811[_0xac7d('0x12')][_0xac7d('0x13')]===0x1f4){logger[_0xac7d('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);return _0x457e2d(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}logger[_0xac7d('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')]['message']);return _0x44eb2b(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}else{logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');_0x44eb2b(_0x217811[_0xac7d('0x15')][_0xac7d('0x14')]);}})[_0xac7d('0x16')](function(_0x12813a){logger[_0xac7d('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x153ce5,_0x12813a);_0x457e2d(_0x12813a);});});}exports[_0xac7d('0x17')]=function(_0x3cb12d){var _0x563634=this;return new Promise(function(_0x2e4790,_0x2d2494){return db[_0xac7d('0x18')][_0xac7d('0x19')](_0x3cb12d['body'],{'raw':_0x3cb12d[_0xac7d('0x1a')]?_0x3cb12d[_0xac7d('0x1a')][_0xac7d('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xd42c40){logger['info'](_0xac7d('0x17'),_0x3cb12d);logger[_0xac7d('0xf')](_0xac7d('0x17'),_0x3cb12d,JSON[_0xac7d('0x1c')](_0xd42c40));_0x2e4790(_0xd42c40);})[_0xac7d('0x16')](function(_0x365269){logger['error']('CreateSquareDetailsReport',_0x365269[_0xac7d('0x14')],_0x3cb12d);_0x2d2494(_0x563634[_0xac7d('0x12')](0x1f4,_0x365269['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 870571d..05f3b9d 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 _0x9ad9=['Router','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9ad9,0x133));var _0x99ad=function(_0x1f54d7,_0xafc682){_0x1f54d7=_0x1f54d7-0x0;var _0x355fc0=_0x9ad9[_0x1f54d7];return _0x355fc0;};'use strict';var express=require(_0x99ad('0x0'));var router=express[_0x99ad('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x99ad('0x2')]('/',auth[_0x99ad('0x3')](),controller['index']);router['get'](_0x99ad('0x4'),auth[_0x99ad('0x3')](),controller[_0x99ad('0x5')]);module[_0x99ad('0x6')]=router; \ No newline at end of file +var _0x368d=['killProcess','exports','express','Router','./system.controller','isAuthenticated','index','get','/process/:pid/kill'];(function(_0x5cc924,_0xaaf584){var _0x4794ac=function(_0x3d0eb4){while(--_0x3d0eb4){_0x5cc924['push'](_0x5cc924['shift']());}};_0x4794ac(++_0xaaf584);}(_0x368d,0x185));var _0xd368=function(_0x2317af,_0x1332d3){_0x2317af=_0x2317af-0x0;var _0x3cb58d=_0x368d[_0x2317af];return _0x3cb58d;};'use strict';var express=require(_0xd368('0x0'));var router=express[_0xd368('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd368('0x2'));router['get']('/',auth[_0xd368('0x3')](),controller[_0xd368('0x4')]);router[_0xd368('0x5')](_0xd368('0x6'),auth[_0xd368('0x3')](),controller[_0xd368('0x7')]);module[_0xd368('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 8996a60..0b40c2a 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 _0xd464=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','kill','SIGINT','systeminformation','exec','../../config/logger','bluebird','lodash'];(function(_0x780a96,_0x577915){var _0x3e2028=function(_0xb1e075){while(--_0xb1e075){_0x780a96['push'](_0x780a96['shift']());}};_0x3e2028(++_0x577915);}(_0xd464,0x133));var _0x4d46=function(_0x585999,_0x4a450f){_0x585999=_0x585999-0x0;var _0x5d72aa=_0xd464[_0x585999];return _0x5d72aa;};'use strict';var info=require(_0x4d46('0x0'));var exec=require('child_process')[_0x4d46('0x1')];var logger=require(_0x4d46('0x2'))('api');var util=require('util');var BPromise=require(_0x4d46('0x3'));var _=require(_0x4d46('0x4'));function handleError(_0x3e8681,_0x918a87,_0x5db751){_0x918a87=_0x918a87||0x1f4;return function(_0x3c252f){logger[_0x4d46('0x5')](_0x4d46('0x6'),_0x5db751,_0x918a87,util[_0x4d46('0x7')](_0x3c252f,{'showHidden':![],'depth':null}));delete _0x3c252f['name'];_0x3e8681[_0x4d46('0x8')](_0x918a87)[_0x4d46('0x9')](_0x3c252f);};}exports[_0x4d46('0xa')]=function(_0x21bcae,_0x248b1d){return info[_0x4d46('0xb')]()[_0x4d46('0xc')](function(_0x29d40e){return _0x248b1d[_0x4d46('0x8')](0xc8)['json'](_0x29d40e);})[_0x4d46('0xd')](function(_0x366708){return _0x248b1d[_0x4d46('0x8')](0x1f4)[_0x4d46('0xe')](_0x366708);});};exports[_0x4d46('0xf')]=function(_0x1622e9,_0x276c3c){var _0x3725b7=[_0x4d46('0x10')];return new BPromise(function(_0x5baa26,_0x2fea9b){return exec(util['format'](_0x4d46('0x11'),_0x1622e9[_0x4d46('0x12')][_0x4d46('0x13')]),function(_0x308f9c,_0x49198c,_0x3cd324){if(_0x308f9c){return _0x2fea9b(_0x308f9c);}return _0x5baa26(_0x49198c);});})['then'](function(_0x2eb824){var _0x5299f9=![];var _0x3c6130=_0x2eb824[_0x4d46('0x14')](/\n/);for(var _0x11f85b=0x0,_0x4110ac=_0x3725b7[_0x4d46('0x15')];_0x11f85b<_0x4110ac,_0x5299f9===![];_0x11f85b+=0x1){if(_0x2eb824[_0x4d46('0x16')](_0x3725b7[_0x11f85b])>=0x0){_0x5299f9=!![];}}if(!_0x5299f9){throw new Error(util[_0x4d46('0x17')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1622e9[_0x4d46('0x12')][_0x4d46('0x13')]));}process[_0x4d46('0x18')](_0x1622e9[_0x4d46('0x12')][_0x4d46('0x13')],_0x4d46('0x19'));return _0x276c3c[_0x4d46('0x8')](0xc8)[_0x4d46('0xe')]({'message':util[_0x4d46('0x17')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x1622e9[_0x4d46('0x12')]['pid'])});})[_0x4d46('0xd')](handleError(_0x276c3c,null,_0x4d46('0xf')));}; \ No newline at end of file +var _0x8acb=['name','send','getAllData','status','catch','json','killProcess','components/import/cm','format','params','split','length','indexOf','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect'];(function(_0x2e536c,_0x35984e){var _0x39b637=function(_0xa31d29){while(--_0xa31d29){_0x2e536c['push'](_0x2e536c['shift']());}};_0x39b637(++_0x35984e);}(_0x8acb,0xe9));var _0xb8ac=function(_0x3a3663,_0x281a12){_0x3a3663=_0x3a3663-0x0;var _0x560d5d=_0x8acb[_0x3a3663];return _0x560d5d;};'use strict';var info=require('systeminformation');var exec=require('child_process')['exec'];var logger=require(_0xb8ac('0x0'))(_0xb8ac('0x1'));var util=require(_0xb8ac('0x2'));var BPromise=require(_0xb8ac('0x3'));var _=require('lodash');function handleError(_0x5465b6,_0x1abb04,_0x4cc663){_0x1abb04=_0x1abb04||0x1f4;return function(_0x4aa1e7){logger[_0xb8ac('0x4')](_0xb8ac('0x5'),_0x4cc663,_0x1abb04,util[_0xb8ac('0x6')](_0x4aa1e7,{'showHidden':![],'depth':null}));delete _0x4aa1e7[_0xb8ac('0x7')];_0x5465b6['status'](_0x1abb04)[_0xb8ac('0x8')](_0x4aa1e7);};}exports['index']=function(_0xb543b7,_0x3c00a6){return info[_0xb8ac('0x9')]()['then'](function(_0x2606f7){return _0x3c00a6[_0xb8ac('0xa')](0xc8)['json'](_0x2606f7);})[_0xb8ac('0xb')](function(_0x3f1d2a){return _0x3c00a6[_0xb8ac('0xa')](0x1f4)[_0xb8ac('0xc')](_0x3f1d2a);});};exports[_0xb8ac('0xd')]=function(_0x4b865a,_0x11b2ce){var _0x4caff0=[_0xb8ac('0xe')];return new BPromise(function(_0xb6f378,_0x358804){return exec(util[_0xb8ac('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x4b865a[_0xb8ac('0x10')]['pid']),function(_0x461be2,_0x30c5c0,_0xd81641){if(_0x461be2){return _0x358804(_0x461be2);}return _0xb6f378(_0x30c5c0);});})['then'](function(_0x4abecb){var _0x2388ca=![];var _0x3f61e4=_0x4abecb[_0xb8ac('0x11')](/\n/);for(var _0x30d4c9=0x0,_0x389a84=_0x4caff0[_0xb8ac('0x12')];_0x30d4c9<_0x389a84,_0x2388ca===![];_0x30d4c9+=0x1){if(_0x4abecb[_0xb8ac('0x13')](_0x4caff0[_0x30d4c9])>=0x0){_0x2388ca=!![];}}if(!_0x2388ca){throw new Error(util[_0xb8ac('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x4b865a[_0xb8ac('0x10')][_0xb8ac('0x14')]));}process[_0xb8ac('0x15')](_0x4b865a[_0xb8ac('0x10')][_0xb8ac('0x14')],_0xb8ac('0x16'));return _0x11b2ce[_0xb8ac('0xa')](0xc8)[_0xb8ac('0xc')]({'message':util[_0xb8ac('0xf')](_0xb8ac('0x17'),_0x4b865a[_0xb8ac('0x10')]['pid'])});})[_0xb8ac('0xb')](handleError(_0x11b2ce,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 5b4042f..6164cf3 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 _0x183e=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x3e79a0,_0x44639d){var _0x5aad01=function(_0x1eb32a){while(--_0x1eb32a){_0x3e79a0['push'](_0x3e79a0['shift']());}};_0x5aad01(++_0x44639d);}(_0x183e,0x193));var _0xe183=function(_0x5a5b03,_0x1eb604){_0x5a5b03=_0x5a5b03-0x0;var _0x3030df=_0x183e[_0x5a5b03];return _0x3030df;};'use strict';var multer=require(_0xe183('0x0'));var util=require(_0xe183('0x1'));var path=require(_0xe183('0x2'));var timeout=require('connect-timeout');var express=require(_0xe183('0x3'));var router=express[_0xe183('0x4')]();var fs_extra=require(_0xe183('0x5'));var auth=require(_0xe183('0x6'));var interaction=require(_0xe183('0x7'));var config=require(_0xe183('0x8'));var controller=require('./tag.controller');router[_0xe183('0x9')]('/',auth[_0xe183('0xa')](),controller['index']);router[_0xe183('0x9')](_0xe183('0xb'),auth['isAuthenticated'](),controller[_0xe183('0xc')]);router[_0xe183('0xd')]('/',auth[_0xe183('0xa')](),controller[_0xe183('0xe')]);router[_0xe183('0xf')](_0xe183('0xb'),auth['isAuthenticated'](),controller[_0xe183('0x10')]);router[_0xe183('0x11')](_0xe183('0xb'),auth[_0xe183('0xa')](),controller[_0xe183('0x12')]);module[_0xe183('0x13')]=router; \ No newline at end of file +var _0x096b=['/:id','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0xa5ce17,_0x54274d){var _0x12cfb9=function(_0x2cf309){while(--_0x2cf309){_0xa5ce17['push'](_0xa5ce17['shift']());}};_0x12cfb9(++_0x54274d);}(_0x096b,0x1df));var _0xb096=function(_0xc025da,_0x90c624){_0xc025da=_0xc025da-0x0;var _0x520249=_0x096b[_0xc025da];return _0x520249;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb096('0x0'));var timeout=require(_0xb096('0x1'));var express=require(_0xb096('0x2'));var router=express[_0xb096('0x3')]();var fs_extra=require(_0xb096('0x4'));var auth=require(_0xb096('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb096('0x6'));var controller=require(_0xb096('0x7'));router[_0xb096('0x8')]('/',auth[_0xb096('0x9')](),controller[_0xb096('0xa')]);router[_0xb096('0x8')]('/:id',auth[_0xb096('0x9')](),controller[_0xb096('0xb')]);router[_0xb096('0xc')]('/',auth['isAuthenticated'](),controller[_0xb096('0xd')]);router[_0xb096('0xe')](_0xb096('0xf'),auth[_0xb096('0x9')](),controller[_0xb096('0x10')]);router[_0xb096('0x11')](_0xb096('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xb096('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 56ace02..900b49f 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 _0x536f=['STRING','sequelize','#0091EA'];(function(_0x5c4c71,_0x3445f8){var _0x167d6b=function(_0x52069f){while(--_0x52069f){_0x5c4c71['push'](_0x5c4c71['shift']());}};_0x167d6b(++_0x3445f8);}(_0x536f,0x70));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf536('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xf536('0x1')},'description':{'type':Sequelize[_0xf536('0x2')]}}; \ No newline at end of file +var _0xe486=['#0091EA','sequelize','exports','STRING','name'];(function(_0x4b067a,_0x21e1d9){var _0x43bbe7=function(_0x290da5){while(--_0x290da5){_0x4b067a['push'](_0x4b067a['shift']());}};_0x43bbe7(++_0x21e1d9);}(_0xe486,0x6a));var _0x6e48=function(_0x400912,_0x4762e2){_0x400912=_0x400912-0x0;var _0x120b20=_0xe486[_0x400912];return _0x120b20;};'use strict';var Sequelize=require(_0x6e48('0x0'));module[_0x6e48('0x1')]={'name':{'type':Sequelize[_0x6e48('0x2')],'unique':_0x6e48('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6e48('0x2')],'defaultValue':_0x6e48('0x4')},'description':{'type':Sequelize[_0x6e48('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 003c0e7..055cd08 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 _0x32ef=['lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','Tags','UserProfileResource','sendStatus','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x56e3f2,_0x4c3db1){var _0x1a0106=function(_0x1e3960){while(--_0x1e3960){_0x56e3f2['push'](_0x56e3f2['shift']());}};_0x1a0106(++_0x4c3db1);}(_0x32ef,0xf9));var _0xf32e=function(_0x55a6b2,_0x47471e){_0x55a6b2=_0x55a6b2-0x0;var _0x4ae306=_0x32ef[_0x55a6b2];return _0x4ae306;};'use strict';var emlformat=require(_0xf32e('0x0'));var rimraf=require(_0xf32e('0x1'));var zipdir=require(_0xf32e('0x2'));var jsonpatch=require(_0xf32e('0x3'));var rp=require(_0xf32e('0x4'));var moment=require(_0xf32e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf32e('0x6'));var util=require(_0xf32e('0x7'));var path=require('path');var sox=require(_0xf32e('0x8'));var csv=require(_0xf32e('0x9'));var ejs=require(_0xf32e('0xa'));var fs=require('fs');var fs_extra=require(_0xf32e('0xb'));var _=require(_0xf32e('0xc'));var squel=require(_0xf32e('0xd'));var crypto=require('crypto');var jsforce=require(_0xf32e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf32e('0x9'));var querystring=require(_0xf32e('0xf'));var Papa=require(_0xf32e('0x10'));var Redis=require(_0xf32e('0x11'));var authService=require(_0xf32e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf32e('0x13'));var hardwareService=require(_0xf32e('0x14'));var logger=require(_0xf32e('0x15'))(_0xf32e('0x16'));var utils=require(_0xf32e('0x17'));var config=require(_0xf32e('0x18'));var licenseUtil=require(_0xf32e('0x19'));var db=require(_0xf32e('0x1a'))['db'];function respondWithStatusCode(_0x319616,_0x1c1f52){_0x1c1f52=_0x1c1f52||0xcc;return function(_0xf7dc32){if(_0xf7dc32){return _0x319616['sendStatus'](_0x1c1f52);}return _0x319616[_0xf32e('0x1b')](_0x1c1f52)[_0xf32e('0x1c')]();};}function respondWithResult(_0x543072,_0x336e26){_0x336e26=_0x336e26||0xc8;return function(_0x35988d){if(_0x35988d){return _0x543072[_0xf32e('0x1b')](_0x336e26)['json'](_0x35988d);}};}function respondWithFilteredResult(_0xe324ad,_0x299efa){return function(_0x1dd008){if(_0x1dd008){var _0x400d25=typeof _0x299efa[_0xf32e('0x1d')]===_0xf32e('0x1e')&&typeof _0x299efa[_0xf32e('0x1f')]===_0xf32e('0x1e');var _0x21aa73=_0x1dd008['count'];var _0x3510ec=_0x400d25?0x0:_0x299efa[_0xf32e('0x1d')];var _0xb828b8=_0x400d25?_0x1dd008[_0xf32e('0x20')]:_0x299efa[_0xf32e('0x1d')]+_0x299efa[_0xf32e('0x1f')];var _0x2f909b;if(_0xb828b8>=_0x21aa73){_0xb828b8=_0x21aa73;_0x2f909b=0xc8;}else{_0x2f909b=0xce;}_0xe324ad[_0xf32e('0x1b')](_0x2f909b);return _0xe324ad[_0xf32e('0x21')](_0xf32e('0x22'),_0x3510ec+'-'+_0xb828b8+'/'+_0x21aa73)[_0xf32e('0x23')](_0x1dd008);}return null;};}function patchUpdates(_0x1b169e){return function(_0x3202e1){try{jsonpatch[_0xf32e('0x24')](_0x3202e1,_0x1b169e,!![]);}catch(_0x5f2e99){return BPromise['reject'](_0x5f2e99);}return _0x3202e1[_0xf32e('0x25')]();};}function saveUpdates(_0x57a8cb,_0x27b92c){return function(_0x2aaabf){if(_0x2aaabf){return _0x2aaabf[_0xf32e('0x26')](_0x57a8cb)[_0xf32e('0x27')](function(_0x35e34c){return _0x35e34c;});}return null;};}function removeEntity(_0x5409b4,_0x227405){return function(_0x4407f8){if(_0x4407f8){return _0x4407f8[_0xf32e('0x28')]()[_0xf32e('0x27')](function(){var _0x5e62eb=_0x4407f8[_0xf32e('0x29')]({'plain':!![]});var _0x1eb413=_0xf32e('0x2a');return db[_0xf32e('0x2b')][_0xf32e('0x28')]({'where':{'type':_0x1eb413,'resourceId':_0x5e62eb['id']}})[_0xf32e('0x27')](function(){return _0x4407f8;});})[_0xf32e('0x27')](function(){_0x5409b4[_0xf32e('0x1b')](0xcc)[_0xf32e('0x1c')]();});}};}function handleEntityNotFound(_0x29be62,_0x488489){return function(_0x3e6e6f){if(!_0x3e6e6f){_0x29be62[_0xf32e('0x2c')](0x194);}return _0x3e6e6f;};}function handleError(_0x3b906c,_0x4a873c){_0x4a873c=_0x4a873c||0x1f4;return function(_0x419d13){logger['error'](_0x419d13[_0xf32e('0x2d')]);if(_0x419d13['name']){delete _0x419d13[_0xf32e('0x2e')];}_0x3b906c[_0xf32e('0x1b')](_0x4a873c)[_0xf32e('0x2f')](_0x419d13);};}exports[_0xf32e('0x30')]=function(_0x32a74b,_0x4e64d4){var _0x2e2ea4={},_0x1d3c7a={},_0x175096={'count':0x0,'rows':[]};var _0x498c9c=_[_0xf32e('0x31')](db[_0xf32e('0x32')][_0xf32e('0x33')],function(_0x3b87d3){return{'name':_0x3b87d3[_0xf32e('0x34')],'type':_0x3b87d3[_0xf32e('0x35')][_0xf32e('0x36')]};});_0x1d3c7a[_0xf32e('0x37')]=_[_0xf32e('0x31')](_0x498c9c,_0xf32e('0x2e'));_0x1d3c7a[_0xf32e('0x38')]=_[_0xf32e('0x39')](_0x32a74b[_0xf32e('0x38')]);_0x1d3c7a['filters']=_[_0xf32e('0x3a')](_0x1d3c7a['model'],_0x1d3c7a[_0xf32e('0x38')]);_0x2e2ea4['attributes']=_['intersection'](_0x1d3c7a[_0xf32e('0x37')],qs[_0xf32e('0x3b')](_0x32a74b[_0xf32e('0x38')][_0xf32e('0x3b')]));_0x2e2ea4[_0xf32e('0x3c')]=_0x2e2ea4['attributes'][_0xf32e('0x3d')]?_0x2e2ea4[_0xf32e('0x3c')]:_0x1d3c7a[_0xf32e('0x37')];if(!_0x32a74b[_0xf32e('0x38')]['hasOwnProperty'](_0xf32e('0x3e'))){_0x2e2ea4[_0xf32e('0x1f')]=qs[_0xf32e('0x1f')](_0x32a74b[_0xf32e('0x38')][_0xf32e('0x1f')]);_0x2e2ea4['offset']=qs[_0xf32e('0x1d')](_0x32a74b[_0xf32e('0x38')][_0xf32e('0x1d')]);}_0x2e2ea4['order']=qs[_0xf32e('0x3f')](_0x32a74b['query'][_0xf32e('0x3f')]);_0x2e2ea4[_0xf32e('0x40')]=qs[_0xf32e('0x41')](_['pick'](_0x32a74b[_0xf32e('0x38')],_0x1d3c7a[_0xf32e('0x41')]),_0x498c9c);if(_0x32a74b[_0xf32e('0x38')][_0xf32e('0x42')]){_0x2e2ea4[_0xf32e('0x40')]=_[_0xf32e('0x43')](_0x2e2ea4['where'],{'$or':_[_0xf32e('0x31')](_0x498c9c,function(_0x26ef18){if(_0x26ef18[_0xf32e('0x35')]!==_0xf32e('0x44')){var _0x28fb71={};_0x28fb71[_0x26ef18[_0xf32e('0x2e')]]={'$like':'%'+_0x32a74b[_0xf32e('0x38')]['filter']+'%'};return _0x28fb71;}})});}_0x2e2ea4=_[_0xf32e('0x43')]({},_0x2e2ea4,_0x32a74b[_0xf32e('0x45')]);var _0x41fbb1={'where':_0x2e2ea4[_0xf32e('0x40')]};return db[_0xf32e('0x32')][_0xf32e('0x20')](_0x41fbb1)[_0xf32e('0x27')](function(_0x546b80){_0x175096[_0xf32e('0x20')]=_0x546b80;if(_0x32a74b[_0xf32e('0x38')][_0xf32e('0x46')]){_0x2e2ea4[_0xf32e('0x47')]=[{'all':!![]}];}return db[_0xf32e('0x32')][_0xf32e('0x48')](_0x2e2ea4);})[_0xf32e('0x27')](function(_0x3ce422){_0x175096[_0xf32e('0x49')]=_0x3ce422;return _0x175096;})[_0xf32e('0x27')](respondWithFilteredResult(_0x4e64d4,_0x2e2ea4))['catch'](handleError(_0x4e64d4,null));};exports[_0xf32e('0x4a')]=function(_0x1f07a6,_0xbd0442){var _0x2146e8={'raw':!![],'where':{'id':_0x1f07a6[_0xf32e('0x4b')]['id']}},_0x159dfd={};_0x159dfd['model']=_[_0xf32e('0x39')](db[_0xf32e('0x32')][_0xf32e('0x33')]);_0x159dfd[_0xf32e('0x38')]=_[_0xf32e('0x39')](_0x1f07a6['query']);_0x159dfd[_0xf32e('0x41')]=_['intersection'](_0x159dfd[_0xf32e('0x37')],_0x159dfd[_0xf32e('0x38')]);_0x2146e8['attributes']=_[_0xf32e('0x3a')](_0x159dfd['model'],qs['fields'](_0x1f07a6['query'][_0xf32e('0x3b')]));_0x2146e8[_0xf32e('0x3c')]=_0x2146e8[_0xf32e('0x3c')][_0xf32e('0x3d')]?_0x2146e8[_0xf32e('0x3c')]:_0x159dfd[_0xf32e('0x37')];if(_0x1f07a6[_0xf32e('0x38')][_0xf32e('0x46')]){_0x2146e8[_0xf32e('0x47')]=[{'all':!![]}];}_0x2146e8=_[_0xf32e('0x43')]({},_0x2146e8,_0x1f07a6[_0xf32e('0x45')]);return db[_0xf32e('0x32')][_0xf32e('0x4c')](_0x2146e8)[_0xf32e('0x27')](handleEntityNotFound(_0xbd0442,null))['then'](respondWithResult(_0xbd0442,null))[_0xf32e('0x4d')](handleError(_0xbd0442,null));};exports[_0xf32e('0x4e')]=function(_0xc83c9f,_0x4b15be){return db['Tag']['create'](_0xc83c9f[_0xf32e('0x4f')],{})[_0xf32e('0x27')](function(_0x5194e8){var _0x436b8a=_0xc83c9f[_0xf32e('0x50')]['get']({'plain':!![]});if(!_0x436b8a)throw new Error(_0xf32e('0x51'));if(_0x436b8a[_0xf32e('0x52')]===_0xf32e('0x50')){var _0x36015b=_0x5194e8[_0xf32e('0x29')]({'plain':!![]});var _0x12f8e2='Tags';return db[_0xf32e('0x53')][_0xf32e('0x4c')]({'where':{'name':_0x12f8e2,'userProfileId':_0x436b8a[_0xf32e('0x54')]},'raw':!![]})['then'](function(_0x15017b){if(_0x15017b&&_0x15017b[_0xf32e('0x55')]===0x0){return db[_0xf32e('0x2b')]['create']({'name':_0x36015b['name'],'resourceId':_0x36015b['id'],'type':_0x15017b['name'],'sectionId':_0x15017b['id']},{})[_0xf32e('0x27')](function(){return _0x5194e8;});}else{return _0x5194e8;}})[_0xf32e('0x4d')](function(_0x36b32a){logger[_0xf32e('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36b32a);throw _0x36b32a;});}return _0x5194e8;})[_0xf32e('0x27')](respondWithResult(_0x4b15be,0xc9))[_0xf32e('0x4d')](handleError(_0x4b15be,null));};exports[_0xf32e('0x26')]=function(_0x787572,_0x10f4d3){if(_0x787572['body']['id']){delete _0x787572[_0xf32e('0x4f')]['id'];}return db[_0xf32e('0x32')][_0xf32e('0x4c')]({'where':{'id':_0x787572[_0xf32e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10f4d3,null))[_0xf32e('0x27')](saveUpdates(_0x787572['body'],null))['then'](respondWithResult(_0x10f4d3,null))[_0xf32e('0x4d')](handleError(_0x10f4d3,null));};exports[_0xf32e('0x28')]=function(_0x1a485b,_0x391cbc){return db[_0xf32e('0x32')][_0xf32e('0x4c')]({'where':{'id':_0x1a485b[_0xf32e('0x4b')]['id']}})[_0xf32e('0x27')](handleEntityNotFound(_0x391cbc,null))[_0xf32e('0x27')](removeEntity(_0x391cbc,null))[_0xf32e('0x4d')](handleError(_0x391cbc,null));}; \ No newline at end of file +var _0x8b29=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','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/logger','api','../../config/environment','../../config/license/util','end','limit','undefined','count','offset','status','set','json','reject','then','Tags','UserProfileResource','sendStatus','error','stack','name','index','map','Tag','rawAttributes','type','key','model','query','filters','intersection','attributes'];(function(_0x5a0401,_0xae66ad){var _0x49a0b1=function(_0x10f749){while(--_0x10f749){_0x5a0401['push'](_0x5a0401['shift']());}};_0x49a0b1(++_0xae66ad);}(_0x8b29,0xbe));var _0x98b2=function(_0x2ca4a4,_0x28d7cf){_0x2ca4a4=_0x2ca4a4-0x0;var _0x4a89b6=_0x8b29[_0x2ca4a4];return _0x4a89b6;};'use strict';var emlformat=require(_0x98b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98b2('0x1'));var jsonpatch=require(_0x98b2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x98b2('0x3'));var Mustache=require(_0x98b2('0x4'));var util=require('util');var path=require(_0x98b2('0x5'));var sox=require('sox');var csv=require(_0x98b2('0x6'));var ejs=require(_0x98b2('0x7'));var fs=require('fs');var fs_extra=require(_0x98b2('0x8'));var _=require(_0x98b2('0x9'));var squel=require(_0x98b2('0xa'));var crypto=require(_0x98b2('0xb'));var jsforce=require(_0x98b2('0xc'));var deskjs=require(_0x98b2('0xd'));var toCsv=require(_0x98b2('0x6'));var querystring=require(_0x98b2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x98b2('0xf'));var qs=require(_0x98b2('0x10'));var as=require(_0x98b2('0x11'));var hardwareService=require(_0x98b2('0x12'));var logger=require(_0x98b2('0x13'))(_0x98b2('0x14'));var utils=require('../../config/utils');var config=require(_0x98b2('0x15'));var licenseUtil=require(_0x98b2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27865e,_0x1180fe){_0x1180fe=_0x1180fe||0xcc;return function(_0x2a6337){if(_0x2a6337){return _0x27865e['sendStatus'](_0x1180fe);}return _0x27865e['status'](_0x1180fe)[_0x98b2('0x17')]();};}function respondWithResult(_0x56bcbd,_0x2966e2){_0x2966e2=_0x2966e2||0xc8;return function(_0x49b151){if(_0x49b151){return _0x56bcbd['status'](_0x2966e2)['json'](_0x49b151);}};}function respondWithFilteredResult(_0x831ee8,_0x413464){return function(_0xe49e9a){if(_0xe49e9a){var _0x5ecea1=typeof _0x413464['offset']==='undefined'&&typeof _0x413464[_0x98b2('0x18')]===_0x98b2('0x19');var _0x145d65=_0xe49e9a[_0x98b2('0x1a')];var _0x4b9f2c=_0x5ecea1?0x0:_0x413464[_0x98b2('0x1b')];var _0x588837=_0x5ecea1?_0xe49e9a[_0x98b2('0x1a')]:_0x413464['offset']+_0x413464[_0x98b2('0x18')];var _0x1dfc04;if(_0x588837>=_0x145d65){_0x588837=_0x145d65;_0x1dfc04=0xc8;}else{_0x1dfc04=0xce;}_0x831ee8[_0x98b2('0x1c')](_0x1dfc04);return _0x831ee8[_0x98b2('0x1d')]('Content-Range',_0x4b9f2c+'-'+_0x588837+'/'+_0x145d65)[_0x98b2('0x1e')](_0xe49e9a);}return null;};}function patchUpdates(_0x242cbd){return function(_0x5dfdf7){try{jsonpatch['apply'](_0x5dfdf7,_0x242cbd,!![]);}catch(_0x5d6b38){return BPromise[_0x98b2('0x1f')](_0x5d6b38);}return _0x5dfdf7['save']();};}function saveUpdates(_0x4ddded,_0x3796c0){return function(_0x37fc18){if(_0x37fc18){return _0x37fc18['update'](_0x4ddded)[_0x98b2('0x20')](function(_0x13d149){return _0x13d149;});}return null;};}function removeEntity(_0xfae112,_0x4f33d8){return function(_0x2a5587){if(_0x2a5587){return _0x2a5587['destroy']()[_0x98b2('0x20')](function(){var _0x4c34f1=_0x2a5587['get']({'plain':!![]});var _0x7b6ebc=_0x98b2('0x21');return db[_0x98b2('0x22')]['destroy']({'where':{'type':_0x7b6ebc,'resourceId':_0x4c34f1['id']}})['then'](function(){return _0x2a5587;});})['then'](function(){_0xfae112[_0x98b2('0x1c')](0xcc)[_0x98b2('0x17')]();});}};}function handleEntityNotFound(_0x50aafb,_0xecb32b){return function(_0x28db65){if(!_0x28db65){_0x50aafb[_0x98b2('0x23')](0x194);}return _0x28db65;};}function handleError(_0x56efb6,_0x2e1ea4){_0x2e1ea4=_0x2e1ea4||0x1f4;return function(_0x1dee11){logger[_0x98b2('0x24')](_0x1dee11[_0x98b2('0x25')]);if(_0x1dee11[_0x98b2('0x26')]){delete _0x1dee11['name'];}_0x56efb6[_0x98b2('0x1c')](_0x2e1ea4)['send'](_0x1dee11);};}exports[_0x98b2('0x27')]=function(_0x1aa42a,_0x4d197c){var _0x2f5156={},_0x363174={},_0x526637={'count':0x0,'rows':[]};var _0x1a676e=_[_0x98b2('0x28')](db[_0x98b2('0x29')][_0x98b2('0x2a')],function(_0x4aee2a){return{'name':_0x4aee2a['fieldName'],'type':_0x4aee2a[_0x98b2('0x2b')][_0x98b2('0x2c')]};});_0x363174[_0x98b2('0x2d')]=_[_0x98b2('0x28')](_0x1a676e,_0x98b2('0x26'));_0x363174[_0x98b2('0x2e')]=_['keys'](_0x1aa42a[_0x98b2('0x2e')]);_0x363174[_0x98b2('0x2f')]=_[_0x98b2('0x30')](_0x363174[_0x98b2('0x2d')],_0x363174[_0x98b2('0x2e')]);_0x2f5156[_0x98b2('0x31')]=_[_0x98b2('0x30')](_0x363174[_0x98b2('0x2d')],qs[_0x98b2('0x32')](_0x1aa42a[_0x98b2('0x2e')][_0x98b2('0x32')]));_0x2f5156[_0x98b2('0x31')]=_0x2f5156[_0x98b2('0x31')]['length']?_0x2f5156['attributes']:_0x363174[_0x98b2('0x2d')];if(!_0x1aa42a[_0x98b2('0x2e')][_0x98b2('0x33')](_0x98b2('0x34'))){_0x2f5156[_0x98b2('0x18')]=qs[_0x98b2('0x18')](_0x1aa42a['query'][_0x98b2('0x18')]);_0x2f5156[_0x98b2('0x1b')]=qs[_0x98b2('0x1b')](_0x1aa42a[_0x98b2('0x2e')]['offset']);}_0x2f5156[_0x98b2('0x35')]=qs[_0x98b2('0x36')](_0x1aa42a[_0x98b2('0x2e')][_0x98b2('0x36')]);_0x2f5156[_0x98b2('0x37')]=qs[_0x98b2('0x2f')](_[_0x98b2('0x38')](_0x1aa42a['query'],_0x363174[_0x98b2('0x2f')]),_0x1a676e);if(_0x1aa42a['query'][_0x98b2('0x39')]){_0x2f5156[_0x98b2('0x37')]=_[_0x98b2('0x3a')](_0x2f5156[_0x98b2('0x37')],{'$or':_['map'](_0x1a676e,function(_0x5aa34b){if(_0x5aa34b[_0x98b2('0x2b')]!==_0x98b2('0x3b')){var _0x42c69c={};_0x42c69c[_0x5aa34b['name']]={'$like':'%'+_0x1aa42a[_0x98b2('0x2e')][_0x98b2('0x39')]+'%'};return _0x42c69c;}})});}_0x2f5156=_[_0x98b2('0x3a')]({},_0x2f5156,_0x1aa42a[_0x98b2('0x3c')]);var _0x311fa7={'where':_0x2f5156[_0x98b2('0x37')]};return db['Tag'][_0x98b2('0x1a')](_0x311fa7)[_0x98b2('0x20')](function(_0x197749){_0x526637['count']=_0x197749;if(_0x1aa42a[_0x98b2('0x2e')][_0x98b2('0x3d')]){_0x2f5156[_0x98b2('0x3e')]=[{'all':!![]}];}return db[_0x98b2('0x29')][_0x98b2('0x3f')](_0x2f5156);})[_0x98b2('0x20')](function(_0x4a6c03){_0x526637[_0x98b2('0x40')]=_0x4a6c03;return _0x526637;})['then'](respondWithFilteredResult(_0x4d197c,_0x2f5156))[_0x98b2('0x41')](handleError(_0x4d197c,null));};exports[_0x98b2('0x42')]=function(_0x410094,_0x1d262d){var _0x44d858={'raw':!![],'where':{'id':_0x410094[_0x98b2('0x43')]['id']}},_0x32e14b={};_0x32e14b[_0x98b2('0x2d')]=_[_0x98b2('0x44')](db['Tag'][_0x98b2('0x2a')]);_0x32e14b['query']=_[_0x98b2('0x44')](_0x410094[_0x98b2('0x2e')]);_0x32e14b[_0x98b2('0x2f')]=_[_0x98b2('0x30')](_0x32e14b[_0x98b2('0x2d')],_0x32e14b[_0x98b2('0x2e')]);_0x44d858['attributes']=_[_0x98b2('0x30')](_0x32e14b[_0x98b2('0x2d')],qs[_0x98b2('0x32')](_0x410094[_0x98b2('0x2e')][_0x98b2('0x32')]));_0x44d858['attributes']=_0x44d858['attributes'][_0x98b2('0x45')]?_0x44d858[_0x98b2('0x31')]:_0x32e14b[_0x98b2('0x2d')];if(_0x410094[_0x98b2('0x2e')]['includeAll']){_0x44d858['include']=[{'all':!![]}];}_0x44d858=_['merge']({},_0x44d858,_0x410094[_0x98b2('0x3c')]);return db[_0x98b2('0x29')][_0x98b2('0x46')](_0x44d858)[_0x98b2('0x20')](handleEntityNotFound(_0x1d262d,null))[_0x98b2('0x20')](respondWithResult(_0x1d262d,null))[_0x98b2('0x41')](handleError(_0x1d262d,null));};exports[_0x98b2('0x47')]=function(_0x2b08ed,_0x3c2477){return db['Tag'][_0x98b2('0x47')](_0x2b08ed['body'],{})[_0x98b2('0x20')](function(_0x6369ca){var _0x3c3c64=_0x2b08ed[_0x98b2('0x48')]['get']({'plain':!![]});if(!_0x3c3c64)throw new Error(_0x98b2('0x49'));if(_0x3c3c64[_0x98b2('0x4a')]===_0x98b2('0x48')){var _0x1e13b8=_0x6369ca[_0x98b2('0x4b')]({'plain':!![]});var _0x54f7ba=_0x98b2('0x21');return db[_0x98b2('0x4c')][_0x98b2('0x46')]({'where':{'name':_0x54f7ba,'userProfileId':_0x3c3c64[_0x98b2('0x4d')]},'raw':!![]})[_0x98b2('0x20')](function(_0x3d6a4e){if(_0x3d6a4e&&_0x3d6a4e[_0x98b2('0x4e')]===0x0){return db[_0x98b2('0x22')][_0x98b2('0x47')]({'name':_0x1e13b8[_0x98b2('0x26')],'resourceId':_0x1e13b8['id'],'type':_0x3d6a4e[_0x98b2('0x26')],'sectionId':_0x3d6a4e['id']},{})[_0x98b2('0x20')](function(){return _0x6369ca;});}else{return _0x6369ca;}})['catch'](function(_0x3b083a){logger[_0x98b2('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b083a);throw _0x3b083a;});}return _0x6369ca;})['then'](respondWithResult(_0x3c2477,0xc9))[_0x98b2('0x41')](handleError(_0x3c2477,null));};exports['update']=function(_0x20ddfd,_0x1cad33){if(_0x20ddfd[_0x98b2('0x4f')]['id']){delete _0x20ddfd[_0x98b2('0x4f')]['id'];}return db[_0x98b2('0x29')][_0x98b2('0x46')]({'where':{'id':_0x20ddfd['params']['id']}})[_0x98b2('0x20')](handleEntityNotFound(_0x1cad33,null))['then'](saveUpdates(_0x20ddfd['body'],null))[_0x98b2('0x20')](respondWithResult(_0x1cad33,null))[_0x98b2('0x41')](handleError(_0x1cad33,null));};exports['destroy']=function(_0x12a72e,_0x1253e2){return db['Tag'][_0x98b2('0x46')]({'where':{'id':_0x12a72e[_0x98b2('0x43')]['id']}})[_0x98b2('0x20')](handleEntityNotFound(_0x1253e2,null))[_0x98b2('0x20')](removeEntity(_0x1253e2,null))['catch'](handleError(_0x1253e2,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 5b68fb9..e43d3e0 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 _0x4d3a=['../../config/environment','exports','define','Tag','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4c18df,_0x23b8ba){var _0x16cd93=function(_0x10f86e){while(--_0x10f86e){_0x4c18df['push'](_0x4c18df['shift']());}};_0x16cd93(++_0x23b8ba);}(_0x4d3a,0x157));var _0xa4d3=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x4d3a[_0x3daa8c];return _0x2b1bd7;};'use strict';var _=require('lodash');var util=require(_0xa4d3('0x0'));var logger=require(_0xa4d3('0x1'))(_0xa4d3('0x2'));var moment=require(_0xa4d3('0x3'));var BPromise=require(_0xa4d3('0x4'));var rp=require(_0xa4d3('0x5'));var fs=require('fs');var path=require(_0xa4d3('0x6'));var rimraf=require(_0xa4d3('0x7'));var config=require(_0xa4d3('0x8'));var attributes=require('./tag.attributes');module[_0xa4d3('0x9')]=function(_0xafbcf,_0x3c5717){return _0xafbcf[_0xa4d3('0xa')](_0xa4d3('0xb'),attributes,{'tableName':_0xa4d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0fb=['moment','request-promise','path','rimraf','../../config/environment','define','tools_tags','../../config/logger','api'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xf0fb,0x97));var _0xbf0f=function(_0x221f71,_0x221c04){_0x221f71=_0x221f71-0x0;var _0x2df2e5=_0xf0fb[_0x221f71];return _0x2df2e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf0f('0x0'))(_0xbf0f('0x1'));var moment=require(_0xbf0f('0x2'));var BPromise=require('bluebird');var rp=require(_0xbf0f('0x3'));var fs=require('fs');var path=require(_0xbf0f('0x4'));var rimraf=require(_0xbf0f('0x5'));var config=require(_0xbf0f('0x6'));var attributes=require('./tag.attributes');module['exports']=function(_0x35d3af,_0x5cac16){return _0x35d3af[_0xbf0f('0x7')]('Tag',attributes,{'tableName':_0xbf0f('0x8'),'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 2cc8a81..019e5b5 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 _0x0bde=['request','then','info','Tag,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1e72b3,_0x1360ae){var _0x3a4824=function(_0x463d48){while(--_0x463d48){_0x1e72b3['push'](_0x1e72b3['shift']());}};_0x3a4824(++_0x1360ae);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe0bd('0x0'));var moment=require('moment');var BPromise=require(_0xe0bd('0x1'));var rs=require(_0xe0bd('0x2'));var fs=require('fs');var Redis=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];var utils=require(_0xe0bd('0x5'));var logger=require('../../config/logger')(_0xe0bd('0x6'));var config=require(_0xe0bd('0x7'));var jayson=require(_0xe0bd('0x8'));var client=jayson[_0xe0bd('0x9')][_0xe0bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26393f,_0x217145,_0x491dc7){return new BPromise(function(_0x40b36a,_0x44cb0b){return client[_0xe0bd('0xb')](_0x26393f,_0x491dc7)[_0xe0bd('0xc')](function(_0x393379){logger[_0xe0bd('0xd')](_0xe0bd('0xe'),_0x217145,_0xe0bd('0xf'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x217145,'request\x20sent',JSON[_0xe0bd('0x10')](_0x393379));if(_0x393379['error']){if(_0x393379['error'][_0xe0bd('0x11')]===0x1f4){logger[_0xe0bd('0x12')]('Tag,\x20%s,\x20%s',_0x217145,_0x393379[_0xe0bd('0x12')]['message']);return _0x44cb0b(_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);}logger[_0xe0bd('0x12')](_0xe0bd('0xe'),_0x217145,_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);return _0x40b36a(_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);}else{logger['info']('Tag,\x20%s,\x20%s',_0x217145,'request\x20sent');_0x40b36a(_0x393379[_0xe0bd('0x14')][_0xe0bd('0x13')]);}})[_0xe0bd('0x15')](function(_0x379ea2){logger[_0xe0bd('0x12')]('Tag,\x20%s,\x20%s',_0x217145,_0x379ea2);_0x44cb0b(_0x379ea2);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x34bbec,_0x35d0f9){var _0x532c43=function(_0x31078e){while(--_0x31078e){_0x34bbec['push'](_0x34bbec['shift']());}};_0x532c43(++_0x35d0f9);}(_0x34e8,0x12c));var _0x834e=function(_0x57edaf,_0x27591a){_0x57edaf=_0x57edaf-0x0;var _0x599b8e=_0x34e8[_0x57edaf];return _0x599b8e;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('Tag,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('Tag,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 377052f..c973631 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 68898a2..3fd9541 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 _0x757a=['exports','STRING'];(function(_0x32b53c,_0x25c72c){var _0x4815b6=function(_0x3b62a3){while(--_0x3b62a3){_0x32b53c['push'](_0x32b53c['shift']());}};_0x4815b6(++_0x25c72c);}(_0x757a,0xde));var _0xa757=function(_0x2b9d8b,_0x555662){_0x2b9d8b=_0x2b9d8b-0x0;var _0x2ac05d=_0x757a[_0x2b9d8b];return _0x2ac05d;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index f10a70b..5e09baa 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 _0x54a2=['Unknown\x20channel','add','ids','removeQueues','remove','addAgents','Voice','Sms','Fax','sequelize','transaction','through','QueueId','penalty','User','emit','findAll','voicePause','interface','UserVoiceQueueRt','upsert','SIP/%s','all','spread','removeAgents','Chat','Mail','Whatsapp','parse','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','error','stack','name','send','map','Team','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','rows','show','params','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','keys','capitalize','toLowerCase','Queue','pick','Queues','addQueues'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x54a2,0x9d));var _0x254a=function(_0x28d1ea,_0x426311){_0x28d1ea=_0x28d1ea-0x0;var _0x1667b6=_0x54a2[_0x28d1ea];return _0x1667b6;};'use strict';var emlformat=require(_0x254a('0x0'));var rimraf=require(_0x254a('0x1'));var zipdir=require(_0x254a('0x2'));var jsonpatch=require(_0x254a('0x3'));var rp=require('request-promise');var moment=require(_0x254a('0x4'));var BPromise=require(_0x254a('0x5'));var Mustache=require('mustache');var util=require(_0x254a('0x6'));var path=require(_0x254a('0x7'));var sox=require(_0x254a('0x8'));var csv=require(_0x254a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x254a('0xa'));var jsforce=require(_0x254a('0xb'));var deskjs=require(_0x254a('0xc'));var toCsv=require(_0x254a('0x9'));var querystring=require(_0x254a('0xd'));var Papa=require('papaparse');var Redis=require(_0x254a('0xe'));var authService=require(_0x254a('0xf'));var qs=require(_0x254a('0x10'));var as=require(_0x254a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x254a('0x12'));var utils=require(_0x254a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x254a('0x14')]=_[_0x254a('0x15')](config[_0x254a('0x14')],{'host':_0x254a('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./team.socket')[_0x254a('0x17')](socket);function respondWithStatusCode(_0x471c74,_0x4ffd4d){_0x4ffd4d=_0x4ffd4d||0xcc;return function(_0x31c2a2){if(_0x31c2a2){return _0x471c74[_0x254a('0x18')](_0x4ffd4d);}return _0x471c74[_0x254a('0x19')](_0x4ffd4d)[_0x254a('0x1a')]();};}function respondWithResult(_0x487fd2,_0x5c236f){_0x5c236f=_0x5c236f||0xc8;return function(_0x409b34){if(_0x409b34){return _0x487fd2[_0x254a('0x19')](_0x5c236f)['json'](_0x409b34);}};}function respondWithFilteredResult(_0x41817f,_0x2cbcd4){return function(_0x5d0ddf){if(_0x5d0ddf){var _0x5e55d6=typeof _0x2cbcd4[_0x254a('0x1b')]===_0x254a('0x1c')&&typeof _0x2cbcd4[_0x254a('0x1d')]===_0x254a('0x1c');var _0x48168f=_0x5d0ddf[_0x254a('0x1e')];var _0x2311ea=_0x5e55d6?0x0:_0x2cbcd4[_0x254a('0x1b')];var _0x3489f5=_0x5e55d6?_0x5d0ddf['count']:_0x2cbcd4['offset']+_0x2cbcd4[_0x254a('0x1d')];var _0xcda28;if(_0x3489f5>=_0x48168f){_0x3489f5=_0x48168f;_0xcda28=0xc8;}else{_0xcda28=0xce;}_0x41817f[_0x254a('0x19')](_0xcda28);return _0x41817f[_0x254a('0x1f')](_0x254a('0x20'),_0x2311ea+'-'+_0x3489f5+'/'+_0x48168f)['json'](_0x5d0ddf);}return null;};}function patchUpdates(_0x64b844){return function(_0x4263d8){try{jsonpatch[_0x254a('0x21')](_0x4263d8,_0x64b844,!![]);}catch(_0x7e7b75){return BPromise[_0x254a('0x22')](_0x7e7b75);}return _0x4263d8['save']();};}function saveUpdates(_0x55ef02,_0x250455){return function(_0x326c67){if(_0x326c67){return _0x326c67[_0x254a('0x23')](_0x55ef02)['then'](function(_0x2770dc){return _0x2770dc;});}return null;};}function removeEntity(_0x32c0eb,_0x5d7df3){return function(_0x1f4bf0){if(_0x1f4bf0){return _0x1f4bf0['destroy']()[_0x254a('0x24')](function(){var _0x5d3c2e=_0x1f4bf0[_0x254a('0x25')]({'plain':!![]});var _0x1db515='Teams';return db[_0x254a('0x26')]['destroy']({'where':{'type':_0x1db515,'resourceId':_0x5d3c2e['id']}})['then'](function(){return _0x1f4bf0;});})[_0x254a('0x24')](function(){_0x32c0eb[_0x254a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe778ca,_0x37a06d){return function(_0x1484c7){if(!_0x1484c7){_0xe778ca['sendStatus'](0x194);}return _0x1484c7;};}function handleError(_0x415009,_0x36d502){_0x36d502=_0x36d502||0x1f4;return function(_0x1136b1){logger[_0x254a('0x27')](_0x1136b1[_0x254a('0x28')]);if(_0x1136b1[_0x254a('0x29')]){delete _0x1136b1[_0x254a('0x29')];}_0x415009[_0x254a('0x19')](_0x36d502)[_0x254a('0x2a')](_0x1136b1);};}exports['index']=function(_0x76c7da,_0x41efa1){var _0x1996a2={},_0x5d3606={},_0x55b0cd={'count':0x0,'rows':[]};var _0x13c622=_[_0x254a('0x2b')](db[_0x254a('0x2c')][_0x254a('0x2d')],function(_0x1b3d7e){return{'name':_0x1b3d7e[_0x254a('0x2e')],'type':_0x1b3d7e['type'][_0x254a('0x2f')]};});_0x5d3606['model']=_[_0x254a('0x2b')](_0x13c622,'name');_0x5d3606[_0x254a('0x30')]=_['keys'](_0x76c7da[_0x254a('0x30')]);_0x5d3606[_0x254a('0x31')]=_[_0x254a('0x32')](_0x5d3606['model'],_0x5d3606[_0x254a('0x30')]);_0x1996a2[_0x254a('0x33')]=_['intersection'](_0x5d3606[_0x254a('0x34')],qs['fields'](_0x76c7da['query']['fields']));_0x1996a2[_0x254a('0x33')]=_0x1996a2['attributes'][_0x254a('0x35')]?_0x1996a2[_0x254a('0x33')]:_0x5d3606[_0x254a('0x34')];if(!_0x76c7da['query'][_0x254a('0x36')](_0x254a('0x37'))){_0x1996a2[_0x254a('0x1d')]=qs[_0x254a('0x1d')](_0x76c7da[_0x254a('0x30')][_0x254a('0x1d')]);_0x1996a2[_0x254a('0x1b')]=qs[_0x254a('0x1b')](_0x76c7da[_0x254a('0x30')][_0x254a('0x1b')]);}_0x1996a2[_0x254a('0x38')]=qs[_0x254a('0x39')](_0x76c7da['query']['sort']);_0x1996a2[_0x254a('0x3a')]=qs[_0x254a('0x31')](_['pick'](_0x76c7da[_0x254a('0x30')],_0x5d3606[_0x254a('0x31')]),_0x13c622);if(_0x76c7da['query'][_0x254a('0x3b')]){_0x1996a2['where']=_[_0x254a('0x3c')](_0x1996a2['where'],{'$or':_['map'](_0x13c622,function(_0x3f1f21){if(_0x3f1f21[_0x254a('0x3d')]!==_0x254a('0x3e')){var _0x4e1ab={};_0x4e1ab[_0x3f1f21[_0x254a('0x29')]]={'$like':'%'+_0x76c7da[_0x254a('0x30')][_0x254a('0x3b')]+'%'};return _0x4e1ab;}})});}_0x1996a2=_['merge']({},_0x1996a2,_0x76c7da[_0x254a('0x3f')]);var _0x59e458={'where':_0x1996a2[_0x254a('0x3a')]};return db[_0x254a('0x2c')]['count'](_0x59e458)['then'](function(_0x2257f6){_0x55b0cd[_0x254a('0x1e')]=_0x2257f6;if(_0x76c7da['query']['includeAll']){_0x1996a2[_0x254a('0x40')]=[{'all':!![]}];}return db[_0x254a('0x2c')]['findAll'](_0x1996a2);})[_0x254a('0x24')](function(_0x432f4f){_0x55b0cd[_0x254a('0x41')]=_0x432f4f;return _0x55b0cd;})['then'](respondWithFilteredResult(_0x41efa1,_0x1996a2))['catch'](handleError(_0x41efa1,null));};exports[_0x254a('0x42')]=function(_0xaed733,_0x2ec076){var _0x223c82={'raw':![],'where':{'id':_0xaed733[_0x254a('0x43')]['id']}},_0x430433={};_0x430433[_0x254a('0x34')]=_['keys'](db[_0x254a('0x2c')][_0x254a('0x2d')]);_0x430433[_0x254a('0x30')]=_['keys'](_0xaed733[_0x254a('0x30')]);_0x430433[_0x254a('0x31')]=_['intersection'](_0x430433['model'],_0x430433[_0x254a('0x30')]);_0x223c82['attributes']=_[_0x254a('0x32')](_0x430433[_0x254a('0x34')],qs['fields'](_0xaed733[_0x254a('0x30')][_0x254a('0x44')]));_0x223c82['attributes']=_0x223c82[_0x254a('0x33')][_0x254a('0x35')]?_0x223c82['attributes']:_0x430433[_0x254a('0x34')];if(_0xaed733[_0x254a('0x30')]['includeAll']){_0x223c82['include']=[{'all':!![]}];}_0x223c82=_['merge']({},_0x223c82,_0xaed733[_0x254a('0x3f')]);return db[_0x254a('0x2c')][_0x254a('0x45')](_0x223c82)[_0x254a('0x24')](handleEntityNotFound(_0x2ec076,null))['then'](respondWithResult(_0x2ec076,null))[_0x254a('0x46')](handleError(_0x2ec076,null));};exports[_0x254a('0x47')]=function(_0x4144a8,_0x5a7c71){return db[_0x254a('0x2c')][_0x254a('0x47')](_0x4144a8[_0x254a('0x48')],{})[_0x254a('0x24')](function(_0x828c4b){var _0x255de9=_0x4144a8[_0x254a('0x49')]['get']({'plain':!![]});if(!_0x255de9)throw new Error(_0x254a('0x4a'));if(_0x255de9[_0x254a('0x4b')]===_0x254a('0x49')){var _0x326157=_0x828c4b['get']({'plain':!![]});var _0x5a105a=_0x254a('0x4c');return db[_0x254a('0x4d')][_0x254a('0x45')]({'where':{'name':_0x5a105a,'userProfileId':_0x255de9[_0x254a('0x4e')]},'raw':!![]})['then'](function(_0x1a0ef5){if(_0x1a0ef5&&_0x1a0ef5[_0x254a('0x4f')]===0x0){return db['UserProfileResource'][_0x254a('0x47')]({'name':_0x326157[_0x254a('0x29')],'resourceId':_0x326157['id'],'type':_0x1a0ef5['name'],'sectionId':_0x1a0ef5['id']},{})['then'](function(){return _0x828c4b;});}else{return _0x828c4b;}})[_0x254a('0x46')](function(_0x2fdb2c){logger['error'](_0x254a('0x50'),_0x2fdb2c);throw _0x2fdb2c;});}return _0x828c4b;})['then'](respondWithResult(_0x5a7c71,0xc9))[_0x254a('0x46')](handleError(_0x5a7c71,null));};exports[_0x254a('0x23')]=function(_0x13616f,_0x160fbd){if(_0x13616f['body']['id']){delete _0x13616f[_0x254a('0x48')]['id'];}return db[_0x254a('0x2c')][_0x254a('0x45')]({'where':{'id':_0x13616f[_0x254a('0x43')]['id']}})[_0x254a('0x24')](handleEntityNotFound(_0x160fbd,null))[_0x254a('0x24')](saveUpdates(_0x13616f[_0x254a('0x48')],null))[_0x254a('0x24')](respondWithResult(_0x160fbd,null))[_0x254a('0x46')](handleError(_0x160fbd,null));};exports[_0x254a('0x51')]=function(_0x4d79de,_0x11298b){return db['Team'][_0x254a('0x45')]({'where':{'id':_0x4d79de[_0x254a('0x43')]['id']}})['then'](handleEntityNotFound(_0x11298b,null))['then'](removeEntity(_0x11298b,null))[_0x254a('0x46')](handleError(_0x11298b,null));};exports[_0x254a('0x52')]=function(_0xe0aab7,_0x349e61,_0x20947b){return db[_0x254a('0x2c')][_0x254a('0x53')]({'where':{'id':_0xe0aab7[_0x254a('0x43')]['id']}})['then'](handleEntityNotFound(_0x349e61,null))[_0x254a('0x24')](function(_0x116533){if(!_0xe0aab7[_0x254a('0x30')][_0x254a('0x54')]||!utils[_0x254a('0x55')](_0xe0aab7[_0x254a('0x30')][_0x254a('0x54')])){throw new db[(_0x254a('0x56'))][(_0x254a('0x57'))]('Unknown\x20channel');}var _0x53cb5e={};var _0x3fb7ef={};_0x3fb7ef[_0x254a('0x34')]=_[_0x254a('0x58')](db[_[_0x254a('0x59')](_0xe0aab7['query'][_0x254a('0x54')][_0x254a('0x5a')]())+_0x254a('0x5b')][_0x254a('0x2d')]);_0x3fb7ef[_0x254a('0x30')]=_[_0x254a('0x58')](_0xe0aab7[_0x254a('0x30')]);_0x3fb7ef[_0x254a('0x31')]=_[_0x254a('0x32')](_0x3fb7ef[_0x254a('0x34')],_0x3fb7ef[_0x254a('0x30')]);_0x53cb5e[_0x254a('0x33')]=_[_0x254a('0x32')](_0x3fb7ef[_0x254a('0x34')],qs[_0x254a('0x44')](_0xe0aab7[_0x254a('0x30')][_0x254a('0x44')]));_0x53cb5e['attributes']=_0x53cb5e[_0x254a('0x33')][_0x254a('0x35')]?_0x53cb5e[_0x254a('0x33')]:_0x3fb7ef[_0x254a('0x34')];_0x53cb5e[_0x254a('0x1d')]=qs[_0x254a('0x1d')](_0xe0aab7[_0x254a('0x30')][_0x254a('0x1d')]);_0x53cb5e[_0x254a('0x1b')]=qs[_0x254a('0x1b')](_0xe0aab7[_0x254a('0x30')][_0x254a('0x1b')]);_0x53cb5e['order']=qs[_0x254a('0x39')](_0xe0aab7[_0x254a('0x30')]['sort']);_0x53cb5e['where']=qs[_0x254a('0x31')](_[_0x254a('0x5c')](_0xe0aab7[_0x254a('0x30')],_0x3fb7ef[_0x254a('0x31')]));_0x53cb5e=_[_0x254a('0x3c')]({},_0x53cb5e,_0xe0aab7['options']);return _0x116533[_0x254a('0x25')+_[_0x254a('0x59')](_0xe0aab7[_0x254a('0x30')]['channel'][_0x254a('0x5a')]())+_0x254a('0x5d')](_0x53cb5e);})[_0x254a('0x24')](respondWithResult(_0x349e61,null))['catch'](handleError(_0x349e61,null));};exports[_0x254a('0x5e')]=function(_0x253e48,_0x4471ab,_0x297b16){return db[_0x254a('0x2c')][_0x254a('0x53')]({'where':{'id':_0x253e48[_0x254a('0x43')]['id']}})[_0x254a('0x24')](function(_0x1cfa03){if(_0x1cfa03){if(!_0x253e48[_0x254a('0x48')][_0x254a('0x54')]||!utils[_0x254a('0x55')](_0x253e48[_0x254a('0x48')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x254a('0x5f'));}return _0x1cfa03[_0x254a('0x60')+_[_0x254a('0x59')](_0x253e48[_0x254a('0x48')][_0x254a('0x54')][_0x254a('0x5a')]())+_0x254a('0x5d')](_0x253e48[_0x254a('0x48')][_0x254a('0x61')]);}return null;})['then'](handleEntityNotFound(_0x4471ab,null))[_0x254a('0x24')](respondWithStatusCode(_0x4471ab,null))[_0x254a('0x46')](handleError(_0x4471ab,null));};exports[_0x254a('0x62')]=function(_0xba9be9,_0x2deb38,_0x154444){return db[_0x254a('0x2c')][_0x254a('0x53')]({'where':{'id':_0xba9be9[_0x254a('0x43')]['id']}})[_0x254a('0x24')](function(_0x1077fa){if(_0x1077fa){if(!_0xba9be9[_0x254a('0x30')][_0x254a('0x54')]||!utils['isValidChannel'](_0xba9be9[_0x254a('0x30')]['channel'])){throw new db[(_0x254a('0x56'))][(_0x254a('0x57'))](_0x254a('0x5f'));}return _0x1077fa[_0x254a('0x63')+_[_0x254a('0x59')](_0xba9be9[_0x254a('0x30')][_0x254a('0x54')]['toLowerCase']())+'Queues'](_0xba9be9['query'][_0x254a('0x61')]);}return null;})[_0x254a('0x24')](handleEntityNotFound(_0x2deb38,null))[_0x254a('0x24')](respondWithStatusCode(_0x2deb38,null))[_0x254a('0x46')](handleError(_0x2deb38,null));};exports[_0x254a('0x64')]=function(_0x59ad55,_0x1ccb0f){return db[_0x254a('0x2c')][_0x254a('0x45')]({'where':{'id':_0x59ad55['params']['id']}})[_0x254a('0x24')](handleEntityNotFound(_0x1ccb0f,null))['then'](function(_0x12c3c9){if(_0x12c3c9){var _0x2ee678=[_0x254a('0x65'),'Chat','Mail',_0x254a('0x66'),_0x254a('0x67'),'Openchannel','Whatsapp'];return db[_0x254a('0x68')][_0x254a('0x69')](function(_0x5c65ef){var _0x503e18=_['map'](_0x2ee678,function(_0x1bcd64){var _0x23173e={'attributes':['id',_0x254a('0x29')]};if(_0x1bcd64===_0x254a('0x65')){_0x23173e[_0x254a('0x6a')]={'attributes':['penalty']};}return _0x12c3c9[_0x254a('0x25')+_0x1bcd64+_0x254a('0x5d')](_0x23173e)[_0x254a('0x24')](function(_0x534def){var _0x5a26cb=_[_0x254a('0x2b')](_0x534def,function(_0x2d15ba){var _0x30cf94=_[_0x254a('0x2b')](_0x59ad55[_0x254a('0x48')][_0x254a('0x61')],function(_0x509edc){var _0x199763={'where':{'UserId':_0x509edc,[_0x1bcd64+_0x254a('0x6b')]:_0x2d15ba['id']},'transaction':_0x5c65ef};if(_0x1bcd64===_0x254a('0x65')){_0x199763[_0x254a('0x15')]={'penalty':_0x2d15ba['TeamVoiceQueue'][_0x254a('0x6c')]};}return db[_0x254a('0x6d')+_0x1bcd64+_0x254a('0x5b')]['findOrCreate'](_0x199763)[_0x254a('0x24')](function(){socket[_0x254a('0x6e')](_0x254a('0x49')+_0x1bcd64+'Queue:save',{'UserId':_0x509edc,[_0x1bcd64+'QueueId']:_0x2d15ba['id']});if(_0x1bcd64!==_0x254a('0x65'))return;return db[_0x254a('0x6d')][_0x254a('0x6f')]({'where':{'id':_0x59ad55[_0x254a('0x48')][_0x254a('0x61')],'online':0x1},'attributes':['id',_0x254a('0x29'),'online',_0x254a('0x70'),_0x254a('0x71')],'raw':!![]})[_0x254a('0x24')](function(_0x3927ae){var _0x3987f7=_['map'](_0x3927ae,function(_0x4ef9fa){return db[_0x254a('0x72')][_0x254a('0x73')]({'membername':_0x4ef9fa['name'],'UserId':_0x4ef9fa['id'],'queue_name':_0x2d15ba[_0x254a('0x29')],'VoiceQueueId':_0x2d15ba['id'],'interface':_['isNil'](_0x4ef9fa[_0x254a('0x71')])?util['format'](_0x254a('0x74'),_0x4ef9fa['name']):_0x4ef9fa[_0x254a('0x71')],'paused':_0x4ef9fa['voicePause']||![],'penalty':_0x2d15ba['TeamVoiceQueue'][_0x254a('0x6c')]},{'transaction':_0x5c65ef});});return Promise[_0x254a('0x75')](_0x3987f7);});});});return Promise['all'](_0x30cf94);});return Promise[_0x254a('0x75')](_0x5a26cb);});});return Promise[_0x254a('0x75')](_0x503e18)[_0x254a('0x24')](function(){return _0x12c3c9[_0x254a('0x64')](_0x59ad55[_0x254a('0x48')][_0x254a('0x61')],{'transaction':_0x5c65ef})[_0x254a('0x76')](function(_0xfb0137){return _0xfb0137;});});});}})['then'](respondWithResult(_0x1ccb0f,null))[_0x254a('0x46')](handleError(_0x1ccb0f,null));};exports[_0x254a('0x77')]=function(_0x28e78c,_0x5c56c0){return db[_0x254a('0x2c')]['find']({'where':{'id':_0x28e78c[_0x254a('0x43')]['id']}})[_0x254a('0x24')](handleEntityNotFound(_0x5c56c0,null))[_0x254a('0x24')](function(_0x2516c0){if(_0x2516c0){var _0x50e39f=[_0x254a('0x65'),_0x254a('0x78'),_0x254a('0x79'),_0x254a('0x66'),'Fax','Openchannel',_0x254a('0x7a')];return db[_0x254a('0x68')]['transaction'](function(_0x1fcc4a){var _0x59bca6=_['map'](_0x50e39f,function(_0x496da2){var _0x26a766={'attributes':['id',_0x254a('0x29')]};return _0x2516c0[_0x254a('0x25')+_0x496da2+_0x254a('0x5d')](_0x26a766)[_0x254a('0x24')](function(_0xd0d7ad){var _0x25f1af=_['map'](_0xd0d7ad,function(_0x19b894){return _0x19b894[_0x254a('0x77')](_0x28e78c[_0x254a('0x30')][_0x254a('0x61')],{'transaction':_0x1fcc4a})['then'](function(){var _0xb52d2c=JSON[_0x254a('0x7b')]('['+_0x28e78c[_0x254a('0x30')][_0x254a('0x61')]+']');var _0x8e8245=_['map'](_0xb52d2c,function(_0x55a290){socket[_0x254a('0x6e')](_0x254a('0x49')+_0x496da2+_0x254a('0x7c'),{'UserId':Number(_0x55a290),[_0x496da2+_0x254a('0x6b')]:_0x19b894['id']});if(_0x496da2!==_0x254a('0x65'))return;return db[_0x254a('0x72')][_0x254a('0x51')]({'where':{'VoiceQueueId':_0x19b894['id'],'UserId':_0x55a290},'transaction':_0x1fcc4a});});return Promise['all'](_0x8e8245);});});return Promise[_0x254a('0x75')](_0x25f1af);});});return Promise[_0x254a('0x75')](_0x59bca6)[_0x254a('0x24')](function(){return _0x2516c0[_0x254a('0x77')](_0x28e78c[_0x254a('0x30')][_0x254a('0x61')],{'transaction':_0x1fcc4a});});});}})[_0x254a('0x24')](respondWithStatusCode(_0x5c56c0,null))[_0x254a('0x46')](handleError(_0x5c56c0,null));};exports[_0x254a('0x7d')]=function(_0xba45f3,_0x1e4f16,_0x464b3f){var _0x12be39={};var _0x4dbb4a={};var _0x5bd11a;var _0x21a564;return db['Team'][_0x254a('0x53')]({'where':{'id':_0xba45f3['params']['id']}})[_0x254a('0x24')](handleEntityNotFound(_0x1e4f16,null))[_0x254a('0x24')](function(_0x394c99){if(_0x394c99){_0x5bd11a=_0x394c99;_0x4dbb4a[_0x254a('0x34')]=_[_0x254a('0x58')](db[_0x254a('0x6d')][_0x254a('0x2d')]);_0x4dbb4a[_0x254a('0x30')]=_['keys'](_0xba45f3[_0x254a('0x30')]);_0x4dbb4a[_0x254a('0x31')]=_['intersection'](_0x4dbb4a[_0x254a('0x34')],_0x4dbb4a[_0x254a('0x30')]);_0x12be39[_0x254a('0x33')]=_[_0x254a('0x32')](_0x4dbb4a[_0x254a('0x34')],qs[_0x254a('0x44')](_0xba45f3['query'][_0x254a('0x44')]));_0x12be39['attributes']=_0x12be39[_0x254a('0x33')][_0x254a('0x35')]?_0x12be39[_0x254a('0x33')]:_0x4dbb4a[_0x254a('0x34')];_0x12be39[_0x254a('0x38')]=qs[_0x254a('0x39')](_0xba45f3['query'][_0x254a('0x39')]);_0x12be39['where']=qs[_0x254a('0x31')](_[_0x254a('0x5c')](_0xba45f3[_0x254a('0x30')],_0x4dbb4a[_0x254a('0x31')]));if(_0xba45f3[_0x254a('0x30')][_0x254a('0x3b')]){_0x12be39[_0x254a('0x3a')]=_[_0x254a('0x3c')](_0x12be39[_0x254a('0x3a')],{'$or':_[_0x254a('0x2b')](_0x12be39[_0x254a('0x33')],function(_0x36a8bd){var _0x47702a={};_0x47702a[_0x36a8bd]={'$like':'%'+_0xba45f3[_0x254a('0x30')][_0x254a('0x3b')]+'%'};return _0x47702a;})});}_0x12be39=_[_0x254a('0x3c')]({},_0x12be39,_0xba45f3['options']);return _0x5bd11a[_0x254a('0x7d')](_0x12be39);}})[_0x254a('0x24')](function(_0x50c3eb){if(_0x50c3eb){_0x21a564=_0x50c3eb[_0x254a('0x35')];if(!_0xba45f3['query'][_0x254a('0x36')](_0x254a('0x37'))){_0x12be39[_0x254a('0x1d')]=qs[_0x254a('0x1d')](_0xba45f3[_0x254a('0x30')]['limit']);_0x12be39[_0x254a('0x1b')]=qs[_0x254a('0x1b')](_0xba45f3[_0x254a('0x30')][_0x254a('0x1b')]);}return _0x5bd11a[_0x254a('0x7d')](_0x12be39);}})[_0x254a('0x24')](function(_0x48a6b2){if(_0x48a6b2){return _0x48a6b2?{'count':_0x21a564,'rows':_0x48a6b2}:null;}})[_0x254a('0x24')](respondWithResult(_0x1e4f16,null))['catch'](handleError(_0x1e4f16,null));}; \ No newline at end of file +var _0x5ceb=['Whatsapp','sequelize','removeAgents','parse','Queue:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','include','Team','findAll','rows','catch','show','params','keys','length','includeAll','options','find','create','body','user','get','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','capitalize','toLowerCase','Queue','order','addQueues','Unknown\x20channel','add','Queues','removeQueues','remove','ids','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','transaction','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','all'];(function(_0x2c984d,_0x5a6f2f){var _0x31df62=function(_0x180acd){while(--_0x180acd){_0x2c984d['push'](_0x2c984d['shift']());}};_0x31df62(++_0x5a6f2f);}(_0x5ceb,0x90));var _0xb5ce=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x5ceb[_0xbc4560];return _0x298cfb;};'use strict';var emlformat=require(_0xb5ce('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb5ce('0x1'));var rp=require(_0xb5ce('0x2'));var moment=require(_0xb5ce('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb5ce('0x4'));var path=require(_0xb5ce('0x5'));var sox=require(_0xb5ce('0x6'));var csv=require(_0xb5ce('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5ce('0x8'));var _=require(_0xb5ce('0x9'));var squel=require(_0xb5ce('0xa'));var crypto=require(_0xb5ce('0xb'));var jsforce=require(_0xb5ce('0xc'));var deskjs=require(_0xb5ce('0xd'));var toCsv=require(_0xb5ce('0x7'));var querystring=require(_0xb5ce('0xe'));var Papa=require(_0xb5ce('0xf'));var Redis=require('ioredis');var authService=require(_0xb5ce('0x10'));var qs=require(_0xb5ce('0x11'));var as=require(_0xb5ce('0x12'));var hardwareService=require(_0xb5ce('0x13'));var logger=require(_0xb5ce('0x14'))(_0xb5ce('0x15'));var utils=require(_0xb5ce('0x16'));var config=require(_0xb5ce('0x17'));var licenseUtil=require(_0xb5ce('0x18'));var db=require(_0xb5ce('0x19'))['db'];config[_0xb5ce('0x1a')]=_[_0xb5ce('0x1b')](config['redis'],{'host':_0xb5ce('0x1c'),'port':0x18eb});var socket=require(_0xb5ce('0x1d'))(new Redis(config[_0xb5ce('0x1a')]));require(_0xb5ce('0x1e'))[_0xb5ce('0x1f')](socket);function respondWithStatusCode(_0xa1c140,_0x46d2de){_0x46d2de=_0x46d2de||0xcc;return function(_0x99b9f6){if(_0x99b9f6){return _0xa1c140['sendStatus'](_0x46d2de);}return _0xa1c140[_0xb5ce('0x20')](_0x46d2de)[_0xb5ce('0x21')]();};}function respondWithResult(_0x93fbf2,_0x73ed4b){_0x73ed4b=_0x73ed4b||0xc8;return function(_0x23abce){if(_0x23abce){return _0x93fbf2[_0xb5ce('0x20')](_0x73ed4b)[_0xb5ce('0x22')](_0x23abce);}};}function respondWithFilteredResult(_0x57b30a,_0x270137){return function(_0x122b18){if(_0x122b18){var _0xafa279=typeof _0x270137[_0xb5ce('0x23')]==='undefined'&&typeof _0x270137[_0xb5ce('0x24')]===_0xb5ce('0x25');var _0x1dada4=_0x122b18[_0xb5ce('0x26')];var _0x4b3062=_0xafa279?0x0:_0x270137['offset'];var _0x74b272=_0xafa279?_0x122b18[_0xb5ce('0x26')]:_0x270137[_0xb5ce('0x23')]+_0x270137['limit'];var _0x36a0a9;if(_0x74b272>=_0x1dada4){_0x74b272=_0x1dada4;_0x36a0a9=0xc8;}else{_0x36a0a9=0xce;}_0x57b30a[_0xb5ce('0x20')](_0x36a0a9);return _0x57b30a[_0xb5ce('0x27')](_0xb5ce('0x28'),_0x4b3062+'-'+_0x74b272+'/'+_0x1dada4)[_0xb5ce('0x22')](_0x122b18);}return null;};}function patchUpdates(_0x427b13){return function(_0x29fb8d){try{jsonpatch[_0xb5ce('0x29')](_0x29fb8d,_0x427b13,!![]);}catch(_0x7542b0){return BPromise[_0xb5ce('0x2a')](_0x7542b0);}return _0x29fb8d[_0xb5ce('0x2b')]();};}function saveUpdates(_0x3990b5,_0x45c11b){return function(_0x20c417){if(_0x20c417){return _0x20c417[_0xb5ce('0x2c')](_0x3990b5)[_0xb5ce('0x2d')](function(_0x22d928){return _0x22d928;});}return null;};}function removeEntity(_0x4f44fe,_0x5ceb90){return function(_0x1fb5af){if(_0x1fb5af){return _0x1fb5af[_0xb5ce('0x2e')]()[_0xb5ce('0x2d')](function(){var _0x14835e=_0x1fb5af['get']({'plain':!![]});var _0x2d250e='Teams';return db['UserProfileResource'][_0xb5ce('0x2e')]({'where':{'type':_0x2d250e,'resourceId':_0x14835e['id']}})[_0xb5ce('0x2d')](function(){return _0x1fb5af;});})[_0xb5ce('0x2d')](function(){_0x4f44fe[_0xb5ce('0x20')](0xcc)[_0xb5ce('0x21')]();});}};}function handleEntityNotFound(_0x456d75,_0x164100){return function(_0x4ba0bf){if(!_0x4ba0bf){_0x456d75[_0xb5ce('0x2f')](0x194);}return _0x4ba0bf;};}function handleError(_0x4f0062,_0x486468){_0x486468=_0x486468||0x1f4;return function(_0x35b391){logger[_0xb5ce('0x30')](_0x35b391['stack']);if(_0x35b391[_0xb5ce('0x31')]){delete _0x35b391[_0xb5ce('0x31')];}_0x4f0062[_0xb5ce('0x20')](_0x486468)[_0xb5ce('0x32')](_0x35b391);};}exports[_0xb5ce('0x33')]=function(_0x694547,_0x597165){var _0x3dd28f={},_0x1f2420={},_0x413806={'count':0x0,'rows':[]};var _0x11fd11=_[_0xb5ce('0x34')](db['Team'][_0xb5ce('0x35')],function(_0x1722ab){return{'name':_0x1722ab[_0xb5ce('0x36')],'type':_0x1722ab['type'][_0xb5ce('0x37')]};});_0x1f2420[_0xb5ce('0x38')]=_[_0xb5ce('0x34')](_0x11fd11,_0xb5ce('0x31'));_0x1f2420['query']=_['keys'](_0x694547[_0xb5ce('0x39')]);_0x1f2420['filters']=_[_0xb5ce('0x3a')](_0x1f2420[_0xb5ce('0x38')],_0x1f2420['query']);_0x3dd28f[_0xb5ce('0x3b')]=_[_0xb5ce('0x3a')](_0x1f2420['model'],qs['fields'](_0x694547['query'][_0xb5ce('0x3c')]));_0x3dd28f[_0xb5ce('0x3b')]=_0x3dd28f[_0xb5ce('0x3b')]['length']?_0x3dd28f[_0xb5ce('0x3b')]:_0x1f2420['model'];if(!_0x694547[_0xb5ce('0x39')][_0xb5ce('0x3d')](_0xb5ce('0x3e'))){_0x3dd28f[_0xb5ce('0x24')]=qs[_0xb5ce('0x24')](_0x694547['query'][_0xb5ce('0x24')]);_0x3dd28f[_0xb5ce('0x23')]=qs['offset'](_0x694547[_0xb5ce('0x39')][_0xb5ce('0x23')]);}_0x3dd28f['order']=qs[_0xb5ce('0x3f')](_0x694547[_0xb5ce('0x39')][_0xb5ce('0x3f')]);_0x3dd28f[_0xb5ce('0x40')]=qs[_0xb5ce('0x41')](_[_0xb5ce('0x42')](_0x694547[_0xb5ce('0x39')],_0x1f2420['filters']),_0x11fd11);if(_0x694547['query'][_0xb5ce('0x43')]){_0x3dd28f[_0xb5ce('0x40')]=_[_0xb5ce('0x44')](_0x3dd28f[_0xb5ce('0x40')],{'$or':_[_0xb5ce('0x34')](_0x11fd11,function(_0x5e1b1e){if(_0x5e1b1e[_0xb5ce('0x45')]!=='VIRTUAL'){var _0x549d41={};_0x549d41[_0x5e1b1e[_0xb5ce('0x31')]]={'$like':'%'+_0x694547[_0xb5ce('0x39')][_0xb5ce('0x43')]+'%'};return _0x549d41;}})});}_0x3dd28f=_[_0xb5ce('0x44')]({},_0x3dd28f,_0x694547['options']);var _0x49cce9={'where':_0x3dd28f[_0xb5ce('0x40')]};return db['Team']['count'](_0x49cce9)['then'](function(_0x266472){_0x413806['count']=_0x266472;if(_0x694547[_0xb5ce('0x39')]['includeAll']){_0x3dd28f[_0xb5ce('0x46')]=[{'all':!![]}];}return db[_0xb5ce('0x47')][_0xb5ce('0x48')](_0x3dd28f);})[_0xb5ce('0x2d')](function(_0x3961d7){_0x413806[_0xb5ce('0x49')]=_0x3961d7;return _0x413806;})[_0xb5ce('0x2d')](respondWithFilteredResult(_0x597165,_0x3dd28f))[_0xb5ce('0x4a')](handleError(_0x597165,null));};exports[_0xb5ce('0x4b')]=function(_0x5ef6f1,_0x33742b){var _0x2fe0d9={'raw':![],'where':{'id':_0x5ef6f1[_0xb5ce('0x4c')]['id']}},_0x586580={};_0x586580['model']=_[_0xb5ce('0x4d')](db[_0xb5ce('0x47')][_0xb5ce('0x35')]);_0x586580[_0xb5ce('0x39')]=_[_0xb5ce('0x4d')](_0x5ef6f1[_0xb5ce('0x39')]);_0x586580[_0xb5ce('0x41')]=_[_0xb5ce('0x3a')](_0x586580[_0xb5ce('0x38')],_0x586580[_0xb5ce('0x39')]);_0x2fe0d9[_0xb5ce('0x3b')]=_[_0xb5ce('0x3a')](_0x586580[_0xb5ce('0x38')],qs[_0xb5ce('0x3c')](_0x5ef6f1[_0xb5ce('0x39')][_0xb5ce('0x3c')]));_0x2fe0d9['attributes']=_0x2fe0d9[_0xb5ce('0x3b')][_0xb5ce('0x4e')]?_0x2fe0d9['attributes']:_0x586580[_0xb5ce('0x38')];if(_0x5ef6f1[_0xb5ce('0x39')][_0xb5ce('0x4f')]){_0x2fe0d9[_0xb5ce('0x46')]=[{'all':!![]}];}_0x2fe0d9=_[_0xb5ce('0x44')]({},_0x2fe0d9,_0x5ef6f1[_0xb5ce('0x50')]);return db['Team'][_0xb5ce('0x51')](_0x2fe0d9)[_0xb5ce('0x2d')](handleEntityNotFound(_0x33742b,null))[_0xb5ce('0x2d')](respondWithResult(_0x33742b,null))[_0xb5ce('0x4a')](handleError(_0x33742b,null));};exports['create']=function(_0x3f733f,_0x1ee8a1){return db[_0xb5ce('0x47')][_0xb5ce('0x52')](_0x3f733f[_0xb5ce('0x53')],{})[_0xb5ce('0x2d')](function(_0x448aae){var _0x2317e9=_0x3f733f[_0xb5ce('0x54')][_0xb5ce('0x55')]({'plain':!![]});if(!_0x2317e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2317e9['role']===_0xb5ce('0x54')){var _0x47d07a=_0x448aae[_0xb5ce('0x55')]({'plain':!![]});var _0x5682c7=_0xb5ce('0x56');return db[_0xb5ce('0x57')][_0xb5ce('0x51')]({'where':{'name':_0x5682c7,'userProfileId':_0x2317e9[_0xb5ce('0x58')]},'raw':!![]})[_0xb5ce('0x2d')](function(_0x3b0426){if(_0x3b0426&&_0x3b0426[_0xb5ce('0x59')]===0x0){return db['UserProfileResource'][_0xb5ce('0x52')]({'name':_0x47d07a[_0xb5ce('0x31')],'resourceId':_0x47d07a['id'],'type':_0x3b0426['name'],'sectionId':_0x3b0426['id']},{})[_0xb5ce('0x2d')](function(){return _0x448aae;});}else{return _0x448aae;}})[_0xb5ce('0x4a')](function(_0x39e667){logger[_0xb5ce('0x30')](_0xb5ce('0x5a'),_0x39e667);throw _0x39e667;});}return _0x448aae;})[_0xb5ce('0x2d')](respondWithResult(_0x1ee8a1,0xc9))[_0xb5ce('0x4a')](handleError(_0x1ee8a1,null));};exports[_0xb5ce('0x2c')]=function(_0x5874f1,_0x3323d3){if(_0x5874f1[_0xb5ce('0x53')]['id']){delete _0x5874f1[_0xb5ce('0x53')]['id'];}return db[_0xb5ce('0x47')][_0xb5ce('0x51')]({'where':{'id':_0x5874f1[_0xb5ce('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3323d3,null))[_0xb5ce('0x2d')](saveUpdates(_0x5874f1[_0xb5ce('0x53')],null))[_0xb5ce('0x2d')](respondWithResult(_0x3323d3,null))['catch'](handleError(_0x3323d3,null));};exports['destroy']=function(_0x134e73,_0x2a3868){return db['Team'][_0xb5ce('0x51')]({'where':{'id':_0x134e73[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](handleEntityNotFound(_0x2a3868,null))[_0xb5ce('0x2d')](removeEntity(_0x2a3868,null))[_0xb5ce('0x4a')](handleError(_0x2a3868,null));};exports[_0xb5ce('0x5b')]=function(_0x1e2567,_0x320e02,_0x2ff9f4){return db[_0xb5ce('0x47')][_0xb5ce('0x5c')]({'where':{'id':_0x1e2567[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](handleEntityNotFound(_0x320e02,null))[_0xb5ce('0x2d')](function(_0x4daf3b){if(!_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x5d')]||!utils[_0xb5ce('0x5e')](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x5d')])){throw new db[(_0xb5ce('0x5f'))][(_0xb5ce('0x60'))]('Unknown\x20channel');}var _0xddfff3={};var _0x29d58f={};_0x29d58f[_0xb5ce('0x38')]=_[_0xb5ce('0x4d')](db[_[_0xb5ce('0x61')](_0x1e2567[_0xb5ce('0x39')]['channel'][_0xb5ce('0x62')]())+_0xb5ce('0x63')]['rawAttributes']);_0x29d58f['query']=_[_0xb5ce('0x4d')](_0x1e2567['query']);_0x29d58f[_0xb5ce('0x41')]=_['intersection'](_0x29d58f[_0xb5ce('0x38')],_0x29d58f[_0xb5ce('0x39')]);_0xddfff3[_0xb5ce('0x3b')]=_[_0xb5ce('0x3a')](_0x29d58f['model'],qs[_0xb5ce('0x3c')](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x3c')]));_0xddfff3[_0xb5ce('0x3b')]=_0xddfff3['attributes']['length']?_0xddfff3[_0xb5ce('0x3b')]:_0x29d58f[_0xb5ce('0x38')];_0xddfff3[_0xb5ce('0x24')]=qs[_0xb5ce('0x24')](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x24')]);_0xddfff3['offset']=qs[_0xb5ce('0x23')](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x23')]);_0xddfff3[_0xb5ce('0x64')]=qs[_0xb5ce('0x3f')](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x3f')]);_0xddfff3[_0xb5ce('0x40')]=qs['filters'](_[_0xb5ce('0x42')](_0x1e2567['query'],_0x29d58f[_0xb5ce('0x41')]));_0xddfff3=_['merge']({},_0xddfff3,_0x1e2567['options']);return _0x4daf3b['get'+_['capitalize'](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x5d')][_0xb5ce('0x62')]())+'Queues'](_0xddfff3);})[_0xb5ce('0x2d')](respondWithResult(_0x320e02,null))['catch'](handleError(_0x320e02,null));};exports[_0xb5ce('0x65')]=function(_0x3ea258,_0x22ffdb,_0x1e28a7){return db['Team']['findOne']({'where':{'id':_0x3ea258[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](function(_0x435186){if(_0x435186){if(!_0x3ea258[_0xb5ce('0x53')]['channel']||!utils[_0xb5ce('0x5e')](_0x3ea258[_0xb5ce('0x53')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xb5ce('0x66'));}return _0x435186[_0xb5ce('0x67')+_[_0xb5ce('0x61')](_0x3ea258[_0xb5ce('0x53')][_0xb5ce('0x5d')][_0xb5ce('0x62')]())+_0xb5ce('0x68')](_0x3ea258[_0xb5ce('0x53')]['ids']);}return null;})[_0xb5ce('0x2d')](handleEntityNotFound(_0x22ffdb,null))[_0xb5ce('0x2d')](respondWithStatusCode(_0x22ffdb,null))['catch'](handleError(_0x22ffdb,null));};exports[_0xb5ce('0x69')]=function(_0x43dbe2,_0xe6109a,_0x319a9e){return db[_0xb5ce('0x47')][_0xb5ce('0x5c')]({'where':{'id':_0x43dbe2[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](function(_0x2e7e3d){if(_0x2e7e3d){if(!_0x43dbe2['query'][_0xb5ce('0x5d')]||!utils['isValidChannel'](_0x43dbe2[_0xb5ce('0x39')][_0xb5ce('0x5d')])){throw new db[(_0xb5ce('0x5f'))][(_0xb5ce('0x60'))](_0xb5ce('0x66'));}return _0x2e7e3d[_0xb5ce('0x6a')+_[_0xb5ce('0x61')](_0x43dbe2[_0xb5ce('0x39')]['channel']['toLowerCase']())+_0xb5ce('0x68')](_0x43dbe2['query'][_0xb5ce('0x6b')]);}return null;})[_0xb5ce('0x2d')](handleEntityNotFound(_0xe6109a,null))[_0xb5ce('0x2d')](respondWithStatusCode(_0xe6109a,null))['catch'](handleError(_0xe6109a,null));};exports[_0xb5ce('0x6c')]=function(_0x6d5666,_0x3e4d89){return db['Team'][_0xb5ce('0x51')]({'where':{'id':_0x6d5666[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](handleEntityNotFound(_0x3e4d89,null))[_0xb5ce('0x2d')](function(_0x5ab28a){if(_0x5ab28a){var _0x3525d5=[_0xb5ce('0x6d'),_0xb5ce('0x6e'),_0xb5ce('0x6f'),_0xb5ce('0x70'),_0xb5ce('0x71'),_0xb5ce('0x72'),'Whatsapp'];return db['sequelize'][_0xb5ce('0x73')](function(_0x13872f){var _0x30504d=_[_0xb5ce('0x34')](_0x3525d5,function(_0x4a491c){var _0xe8e931={'attributes':['id',_0xb5ce('0x31')]};if(_0x4a491c==='Voice'){_0xe8e931[_0xb5ce('0x74')]={'attributes':['penalty']};}return _0x5ab28a[_0xb5ce('0x55')+_0x4a491c+_0xb5ce('0x68')](_0xe8e931)['then'](function(_0x46838c){var _0x585393=_['map'](_0x46838c,function(_0x52de7c){var _0x3e2282=_['map'](_0x6d5666[_0xb5ce('0x53')][_0xb5ce('0x6b')],function(_0x6f9cb3){var _0x26725e={'where':{'UserId':_0x6f9cb3,[_0x4a491c+_0xb5ce('0x75')]:_0x52de7c['id']},'transaction':_0x13872f};if(_0x4a491c===_0xb5ce('0x6d')){_0x26725e['defaults']={'penalty':_0x52de7c[_0xb5ce('0x76')][_0xb5ce('0x77')]};}return db[_0xb5ce('0x78')+_0x4a491c+_0xb5ce('0x63')][_0xb5ce('0x79')](_0x26725e)[_0xb5ce('0x2d')](function(){socket[_0xb5ce('0x7a')](_0xb5ce('0x54')+_0x4a491c+_0xb5ce('0x7b'),{'UserId':_0x6f9cb3,[_0x4a491c+_0xb5ce('0x75')]:_0x52de7c['id']});if(_0x4a491c!=='Voice')return;return db[_0xb5ce('0x78')][_0xb5ce('0x48')]({'where':{'id':_0x6d5666[_0xb5ce('0x53')][_0xb5ce('0x6b')],'online':0x1},'attributes':['id',_0xb5ce('0x31'),_0xb5ce('0x7c'),_0xb5ce('0x7d'),_0xb5ce('0x7e')],'raw':!![]})['then'](function(_0x30179a){var _0x250d0b=_['map'](_0x30179a,function(_0x37782a){return db[_0xb5ce('0x7f')][_0xb5ce('0x80')]({'membername':_0x37782a[_0xb5ce('0x31')],'UserId':_0x37782a['id'],'queue_name':_0x52de7c[_0xb5ce('0x31')],'VoiceQueueId':_0x52de7c['id'],'interface':_['isNil'](_0x37782a[_0xb5ce('0x7e')])?util[_0xb5ce('0x81')](_0xb5ce('0x82'),_0x37782a[_0xb5ce('0x31')]):_0x37782a[_0xb5ce('0x7e')],'paused':_0x37782a['voicePause']||![],'penalty':_0x52de7c['TeamVoiceQueue'][_0xb5ce('0x77')]},{'transaction':_0x13872f});});return Promise[_0xb5ce('0x83')](_0x250d0b);});});});return Promise[_0xb5ce('0x83')](_0x3e2282);});return Promise['all'](_0x585393);});});return Promise[_0xb5ce('0x83')](_0x30504d)[_0xb5ce('0x2d')](function(){return _0x5ab28a[_0xb5ce('0x6c')](_0x6d5666[_0xb5ce('0x53')][_0xb5ce('0x6b')],{'transaction':_0x13872f})['spread'](function(_0x378e08){return _0x378e08;});});});}})[_0xb5ce('0x2d')](respondWithResult(_0x3e4d89,null))[_0xb5ce('0x4a')](handleError(_0x3e4d89,null));};exports['removeAgents']=function(_0x26f80f,_0x242e4f){return db['Team'][_0xb5ce('0x51')]({'where':{'id':_0x26f80f['params']['id']}})[_0xb5ce('0x2d')](handleEntityNotFound(_0x242e4f,null))[_0xb5ce('0x2d')](function(_0x1ee0fd){if(_0x1ee0fd){var _0xd9f2d3=[_0xb5ce('0x6d'),'Chat',_0xb5ce('0x6f'),'Sms',_0xb5ce('0x71'),_0xb5ce('0x72'),_0xb5ce('0x84')];return db[_0xb5ce('0x85')][_0xb5ce('0x73')](function(_0x208e59){var _0x3c67e2=_['map'](_0xd9f2d3,function(_0x14594e){var _0xe14d78={'attributes':['id',_0xb5ce('0x31')]};return _0x1ee0fd[_0xb5ce('0x55')+_0x14594e+'Queues'](_0xe14d78)[_0xb5ce('0x2d')](function(_0x2c3207){var _0x443fca=_[_0xb5ce('0x34')](_0x2c3207,function(_0x33b811){return _0x33b811[_0xb5ce('0x86')](_0x26f80f['query'][_0xb5ce('0x6b')],{'transaction':_0x208e59})[_0xb5ce('0x2d')](function(){var _0x1c641a=JSON[_0xb5ce('0x87')]('['+_0x26f80f[_0xb5ce('0x39')][_0xb5ce('0x6b')]+']');var _0x3353e3=_['map'](_0x1c641a,function(_0x1545f4){socket[_0xb5ce('0x7a')]('user'+_0x14594e+_0xb5ce('0x88'),{'UserId':Number(_0x1545f4),[_0x14594e+'QueueId']:_0x33b811['id']});if(_0x14594e!==_0xb5ce('0x6d'))return;return db[_0xb5ce('0x7f')]['destroy']({'where':{'VoiceQueueId':_0x33b811['id'],'UserId':_0x1545f4},'transaction':_0x208e59});});return Promise[_0xb5ce('0x83')](_0x3353e3);});});return Promise[_0xb5ce('0x83')](_0x443fca);});});return Promise['all'](_0x3c67e2)[_0xb5ce('0x2d')](function(){return _0x1ee0fd[_0xb5ce('0x86')](_0x26f80f['query'][_0xb5ce('0x6b')],{'transaction':_0x208e59});});});}})[_0xb5ce('0x2d')](respondWithStatusCode(_0x242e4f,null))['catch'](handleError(_0x242e4f,null));};exports[_0xb5ce('0x89')]=function(_0x35f357,_0x2495a5,_0x3c214b){var _0x12056f={};var _0xf1aa5c={};var _0x4b63a6;var _0x3c6e0b;return db['Team'][_0xb5ce('0x5c')]({'where':{'id':_0x35f357[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](handleEntityNotFound(_0x2495a5,null))[_0xb5ce('0x2d')](function(_0x10c9be){if(_0x10c9be){_0x4b63a6=_0x10c9be;_0xf1aa5c['model']=_['keys'](db[_0xb5ce('0x78')][_0xb5ce('0x35')]);_0xf1aa5c[_0xb5ce('0x39')]=_[_0xb5ce('0x4d')](_0x35f357[_0xb5ce('0x39')]);_0xf1aa5c[_0xb5ce('0x41')]=_[_0xb5ce('0x3a')](_0xf1aa5c[_0xb5ce('0x38')],_0xf1aa5c[_0xb5ce('0x39')]);_0x12056f[_0xb5ce('0x3b')]=_[_0xb5ce('0x3a')](_0xf1aa5c[_0xb5ce('0x38')],qs['fields'](_0x35f357[_0xb5ce('0x39')][_0xb5ce('0x3c')]));_0x12056f['attributes']=_0x12056f[_0xb5ce('0x3b')]['length']?_0x12056f[_0xb5ce('0x3b')]:_0xf1aa5c['model'];_0x12056f['order']=qs[_0xb5ce('0x3f')](_0x35f357[_0xb5ce('0x39')]['sort']);_0x12056f[_0xb5ce('0x40')]=qs[_0xb5ce('0x41')](_[_0xb5ce('0x42')](_0x35f357[_0xb5ce('0x39')],_0xf1aa5c[_0xb5ce('0x41')]));if(_0x35f357[_0xb5ce('0x39')][_0xb5ce('0x43')]){_0x12056f[_0xb5ce('0x40')]=_['merge'](_0x12056f[_0xb5ce('0x40')],{'$or':_[_0xb5ce('0x34')](_0x12056f['attributes'],function(_0x563cc7){var _0x427d90={};_0x427d90[_0x563cc7]={'$like':'%'+_0x35f357['query'][_0xb5ce('0x43')]+'%'};return _0x427d90;})});}_0x12056f=_['merge']({},_0x12056f,_0x35f357[_0xb5ce('0x50')]);return _0x4b63a6['getAgents'](_0x12056f);}})['then'](function(_0x2bf8da){if(_0x2bf8da){_0x3c6e0b=_0x2bf8da[_0xb5ce('0x4e')];if(!_0x35f357['query'][_0xb5ce('0x3d')]('nolimit')){_0x12056f[_0xb5ce('0x24')]=qs[_0xb5ce('0x24')](_0x35f357['query'][_0xb5ce('0x24')]);_0x12056f[_0xb5ce('0x23')]=qs[_0xb5ce('0x23')](_0x35f357[_0xb5ce('0x39')][_0xb5ce('0x23')]);}return _0x4b63a6[_0xb5ce('0x89')](_0x12056f);}})[_0xb5ce('0x2d')](function(_0x5f38da){if(_0x5f38da){return _0x5f38da?{'count':_0x3c6e0b,'rows':_0x5f38da}:null;}})[_0xb5ce('0x2d')](respondWithResult(_0x2495a5,null))[_0xb5ce('0x4a')](handleError(_0x2495a5,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 5e0bb0a..e34d261 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 _0x0a5e=['../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x4344af,_0x37896e){var _0x5cc0e1=function(_0x17dc80){while(--_0x17dc80){_0x4344af['push'](_0x4344af['shift']());}};_0x5cc0e1(++_0x37896e);}(_0x0a5e,0xbd));var _0xe0a5=function(_0xf623ba,_0x9ccc49){_0xf623ba=_0xf623ba-0x0;var _0x43f0ad=_0x0a5e[_0xf623ba];return _0x43f0ad;};'use strict';var EventEmitter=require(_0xe0a5('0x0'));var Team=require(_0xe0a5('0x1'))['db'][_0xe0a5('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xe0a5('0x3')](0x0);var events={'afterCreate':_0xe0a5('0x4'),'afterUpdate':_0xe0a5('0x5'),'afterDestroy':_0xe0a5('0x6')};function emitEvent(_0x576e0a){return function(_0x3898f3,_0x12259b,_0x59e44e){TeamEvents[_0xe0a5('0x7')](_0x576e0a+':'+_0x3898f3['id'],_0x3898f3);TeamEvents[_0xe0a5('0x7')](_0x576e0a,_0x3898f3);_0x59e44e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xe0a5('0x8')](e,emitEvent(event));}}module[_0xe0a5('0x9')]=TeamEvents; \ No newline at end of file +var _0xe0bd=['update','remove','emit','hook','exports','events','../../mysqldb','Team','save'];(function(_0xbf9125,_0x1f3275){var _0x58475c=function(_0xd3004b){while(--_0xd3004b){_0xbf9125['push'](_0xbf9125['shift']());}};_0x58475c(++_0x1f3275);}(_0xe0bd,0x12e));var _0xde0b=function(_0x38de33,_0x4361bb){_0x38de33=_0x38de33-0x0;var _0x40f16d=_0xe0bd[_0x38de33];return _0x40f16d;};'use strict';var EventEmitter=require(_0xde0b('0x0'));var Team=require(_0xde0b('0x1'))['db'][_0xde0b('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xde0b('0x3'),'afterUpdate':_0xde0b('0x4'),'afterDestroy':_0xde0b('0x5')};function emitEvent(_0xc31934){return function(_0x14c924,_0x536fc2,_0x1f60f3){TeamEvents[_0xde0b('0x6')](_0xc31934+':'+_0x14c924['id'],_0x14c924);TeamEvents[_0xde0b('0x6')](_0xc31934,_0x14c924);_0x1f60f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xde0b('0x7')](e,emitEvent(event));}}module[_0xde0b('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 673137f..5778fee 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 _0x09bc=['./team.attributes','exports','define','Team','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x2b5d44,_0x2c2aa5){var _0x381b98=function(_0x4d50b6){while(--_0x4d50b6){_0x2b5d44['push'](_0x2b5d44['shift']());}};_0x381b98(++_0x2c2aa5);}(_0x09bc,0x14e));var _0xc09b=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x09bc[_0x9aada2];return _0x196dff;};'use strict';var _=require('lodash');var util=require(_0xc09b('0x0'));var logger=require(_0xc09b('0x1'))(_0xc09b('0x2'));var moment=require(_0xc09b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc09b('0x4'));var rimraf=require(_0xc09b('0x5'));var config=require(_0xc09b('0x6'));var attributes=require(_0xc09b('0x7'));module[_0xc09b('0x8')]=function(_0x21893c,_0x111062){return _0x21893c[_0xc09b('0x9')](_0xc09b('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x148e=['moment','bluebird','request-promise','../../config/environment','define','teams','util','../../config/logger','api'];(function(_0x32825e,_0x5981c1){var _0x119578=function(_0x40ce3d){while(--_0x40ce3d){_0x32825e['push'](_0x32825e['shift']());}};_0x119578(++_0x5981c1);}(_0x148e,0x12f));var _0xe148=function(_0x1b81ae,_0x1941f7){_0x1b81ae=_0x1b81ae-0x0;var _0x33ba48=_0x148e[_0x1b81ae];return _0x33ba48;};'use strict';var _=require('lodash');var util=require(_0xe148('0x0'));var logger=require(_0xe148('0x1'))(_0xe148('0x2'));var moment=require(_0xe148('0x3'));var BPromise=require(_0xe148('0x4'));var rp=require(_0xe148('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe148('0x6'));var attributes=require('./team.attributes');module['exports']=function(_0x30c6fc,_0x290e5a){return _0x30c6fc[_0xe148('0x7')]('Team',attributes,{'tableName':_0xe148('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 9366ed1..ba25092 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 _0x2228=['request','then','Team,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register'];(function(_0x384dd2,_0x1ffe65){var _0x52933a=function(_0x38afc1){while(--_0x38afc1){_0x384dd2['push'](_0x384dd2['shift']());}};_0x52933a(++_0x1ffe65);}(_0x2228,0x118));var _0x8222=function(_0x1d2c42,_0x1ba4a1){_0x1d2c42=_0x1d2c42-0x0;var _0x229c80=_0x2228[_0x1d2c42];return _0x229c80;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8222('0x0'));var BPromise=require('bluebird');var rs=require(_0x8222('0x1'));var fs=require('fs');var Redis=require(_0x8222('0x2'));var db=require(_0x8222('0x3'))['db'];var utils=require(_0x8222('0x4'));var logger=require(_0x8222('0x5'))(_0x8222('0x6'));var config=require(_0x8222('0x7'));var jayson=require(_0x8222('0x8'));var client=jayson[_0x8222('0x9')][_0x8222('0xa')]({'port':0x232a});config[_0x8222('0xb')]=_[_0x8222('0xc')](config[_0x8222('0xb')],{'host':_0x8222('0xd'),'port':0x18eb});var socket=require(_0x8222('0xe'))(new Redis(config['redis']));require(_0x8222('0xf'))[_0x8222('0x10')](socket);function respondWithRpcPromise(_0x1b185a,_0x4de67a,_0x40b0e2){return new BPromise(function(_0x2b4612,_0x473f0b){return client[_0x8222('0x11')](_0x1b185a,_0x40b0e2)[_0x8222('0x12')](function(_0x48c31a){logger['info'](_0x8222('0x13'),_0x4de67a,_0x8222('0x14'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x4de67a,_0x8222('0x14'),JSON['stringify'](_0x48c31a));if(_0x48c31a[_0x8222('0x15')]){if(_0x48c31a['error'][_0x8222('0x16')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x4de67a,_0x48c31a[_0x8222('0x15')][_0x8222('0x17')]);return _0x473f0b(_0x48c31a[_0x8222('0x15')][_0x8222('0x17')]);}logger[_0x8222('0x15')](_0x8222('0x13'),_0x4de67a,_0x48c31a[_0x8222('0x15')]['message']);return _0x2b4612(_0x48c31a[_0x8222('0x15')]['message']);}else{logger[_0x8222('0x18')](_0x8222('0x13'),_0x4de67a,_0x8222('0x14'));_0x2b4612(_0x48c31a[_0x8222('0x19')]['message']);}})[_0x8222('0x1a')](function(_0x11f981){logger[_0x8222('0x15')](_0x8222('0x13'),_0x4de67a,_0x11f981);_0x473f0b(_0x11f981);});});} \ No newline at end of file +var _0x37ce=['moment','bluebird','../../config/utils','rpc','../../config/environment','http','defaults','redis','socket.io-emitter','./team.socket','register','request','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x219411,_0x8e667f){var _0x5dd956=function(_0x1b2d62){while(--_0x1b2d62){_0x219411['push'](_0x219411['shift']());}};_0x5dd956(++_0x8e667f);}(_0x37ce,0x196));var _0xe37c=function(_0x5bf8f2,_0x468c7e){_0x5bf8f2=_0x5bf8f2-0x0;var _0x41e6ca=_0x37ce[_0x5bf8f2];return _0x41e6ca;};'use strict';var _=require(_0xe37c('0x0'));var util=require(_0xe37c('0x1'));var moment=require(_0xe37c('0x2'));var BPromise=require(_0xe37c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe37c('0x4'));var logger=require('../../config/logger')(_0xe37c('0x5'));var config=require(_0xe37c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe37c('0x7')]({'port':0x232a});config['redis']=_[_0xe37c('0x8')](config[_0xe37c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe37c('0xa'))(new Redis(config[_0xe37c('0x9')]));require(_0xe37c('0xb'))[_0xe37c('0xc')](socket);function respondWithRpcPromise(_0x112be7,_0x2e260b,_0x427731){return new BPromise(function(_0x24f972,_0x3da298){return client[_0xe37c('0xd')](_0x112be7,_0x427731)['then'](function(_0x2b7ceb){logger['info'](_0xe37c('0xe'),_0x2e260b,_0xe37c('0xf'));logger[_0xe37c('0x10')](_0xe37c('0x11'),_0x2e260b,_0xe37c('0xf'),JSON[_0xe37c('0x12')](_0x2b7ceb));if(_0x2b7ceb[_0xe37c('0x13')]){if(_0x2b7ceb[_0xe37c('0x13')][_0xe37c('0x14')]===0x1f4){logger[_0xe37c('0x13')](_0xe37c('0xe'),_0x2e260b,_0x2b7ceb['error'][_0xe37c('0x15')]);return _0x3da298(_0x2b7ceb[_0xe37c('0x13')][_0xe37c('0x15')]);}logger[_0xe37c('0x13')]('Team,\x20%s,\x20%s',_0x2e260b,_0x2b7ceb['error'][_0xe37c('0x15')]);return _0x24f972(_0x2b7ceb[_0xe37c('0x13')][_0xe37c('0x15')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x2e260b,_0xe37c('0xf'));_0x24f972(_0x2b7ceb[_0xe37c('0x16')][_0xe37c('0x15')]);}})[_0xe37c('0x17')](function(_0x149ebf){logger[_0xe37c('0x13')](_0xe37c('0xe'),_0x2e260b,_0x149ebf);_0x3da298(_0x149ebf);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index a2bbb76..dd7ecf3 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 _0xf8fb=['team:','./team.events','save','remove','update','emit','register'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf8fb,0xd3));var _0xbf8f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf8fb[_0x4b369d];return _0x571a98;};'use strict';var TeamEvents=require(_0xbf8f('0x0'));var events=[_0xbf8f('0x1'),_0xbf8f('0x2'),_0xbf8f('0x3')];function createListener(_0x294f0a,_0x1868fa){return function(_0x156512){_0x1868fa[_0xbf8f('0x4')](_0x294f0a,_0x156512);};}function removeListener(_0x2cbfd0,_0x1a9836){return function(){TeamEvents['removeListener'](_0x2cbfd0,_0x1a9836);};}exports[_0xbf8f('0x5')]=function(_0x2b15b9){for(var _0xe08549=0x0,_0x4c78c0=events['length'];_0xe08549<_0x4c78c0;_0xe08549++){var _0xb43b2d=events[_0xe08549];var _0x331b7=createListener(_0xbf8f('0x6')+_0xb43b2d,_0x2b15b9);TeamEvents['on'](_0xb43b2d,_0x331b7);}}; \ No newline at end of file +var _0xb544=['remove','update','emit','team:'];(function(_0x4c5148,_0x45939e){var _0x245f29=function(_0xc425a2){while(--_0xc425a2){_0x4c5148['push'](_0x4c5148['shift']());}};_0x245f29(++_0x45939e);}(_0xb544,0xd0));var _0x4b54=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb544[_0x199572];return _0x13cfa3;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x4b54('0x0'),_0x4b54('0x1')];function createListener(_0x1a52e8,_0x3442ff){return function(_0xc4666b){_0x3442ff[_0x4b54('0x2')](_0x1a52e8,_0xc4666b);};}function removeListener(_0x3e2f2c,_0x192cc1){return function(){TeamEvents['removeListener'](_0x3e2f2c,_0x192cc1);};}exports['register']=function(_0x5c5c8f){for(var _0x5b68a3=0x0,_0xc9f31c=events['length'];_0x5b68a3<_0xc9f31c;_0x5b68a3++){var _0x2bf592=events[_0x5b68a3];var _0x512bff=createListener(_0x4b54('0x3')+_0x2bf592,_0x5c5c8f);TeamEvents['on'](_0x2bf592,_0x512bff);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index a5546f5..0dec769 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x14445d,_0x16d90d){var _0xe2c1fa=function(_0x2e2389){while(--_0x2e2389){_0x14445d['push'](_0x14445d['shift']());}};_0xe2c1fa(++_0x16d90d);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x41210a,_0x3dab6c){var _0x27d176=function(_0x223f30){while(--_0x223f30){_0x41210a['push'](_0x41210a['shift']());}};_0x27d176(++_0x3dab6c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0xcb91[_0x2af053];return _0x4b4001;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 4a9642a..7b0e4fd 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 _0xea1b=['sequelize','exports','INTEGER'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xea1b,0xd8));var _0xbea1=function(_0x149a62,_0x5532c8){_0x149a62=_0x149a62-0x0;var _0xb93b30=_0xea1b[_0x149a62];return _0xb93b30;};'use strict';var Sequelize=require(_0xbea1('0x0'));module[_0xbea1('0x1')]={'penalty':{'type':Sequelize[_0xbea1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdd54=['sequelize','exports','INTEGER'];(function(_0x1f8066,_0x52d4c8){var _0x34a7ac=function(_0x41a804){while(--_0x41a804){_0x1f8066['push'](_0x1f8066['shift']());}};_0x34a7ac(++_0x52d4c8);}(_0xdd54,0x159));var _0x4dd5=function(_0xe7a4b5,_0x200412){_0xe7a4b5=_0xe7a4b5-0x0;var _0xe5bb55=_0xdd54[_0xe7a4b5];return _0xe5bb55;};'use strict';var Sequelize=require(_0x4dd5('0x0'));module[_0x4dd5('0x1')]={'penalty':{'type':Sequelize[_0x4dd5('0x2')],'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 c8f3fac..c91224d 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 _0x8135=['moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8135,0x99));var _0x5813=function(_0x14da00,_0x1a6bd2){_0x14da00=_0x14da00-0x0;var _0x2a6a94=_0x8135[_0x14da00];return _0x2a6a94;};'use strict';var _=require('lodash');var util=require(_0x5813('0x0'));var logger=require(_0x5813('0x1'))(_0x5813('0x2'));var moment=require(_0x5813('0x3'));var BPromise=require('bluebird');var rp=require(_0x5813('0x4'));var fs=require('fs');var path=require(_0x5813('0x5'));var rimraf=require(_0x5813('0x6'));var config=require(_0x5813('0x7'));var attributes=require(_0x5813('0x8'));module['exports']=function(_0x57ac38,_0x27599d){return _0x57ac38[_0x5813('0x9')](_0x5813('0xa'),attributes,{'tableName':_0x5813('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95f4=['TeamVoiceQueue','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0x21d7a7,_0x1500d8){var _0x58c681=function(_0xf5ef27){while(--_0xf5ef27){_0x21d7a7['push'](_0x21d7a7['shift']());}};_0x58c681(++_0x1500d8);}(_0x95f4,0xf1));var _0x495f=function(_0x11b94c,_0x5d24cc){_0x11b94c=_0x11b94c-0x0;var _0x24b402=_0x95f4[_0x11b94c];return _0x24b402;};'use strict';var _=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var logger=require(_0x495f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x495f('0x3'));var rp=require(_0x495f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x495f('0x5'));var attributes=require(_0x495f('0x6'));module[_0x495f('0x7')]=function(_0x4a56a5,_0x704a46){return _0x4a56a5[_0x495f('0x8')](_0x495f('0x9'),attributes,{'tableName':'team_has_voice_queues','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 b60fb8c..80c0a4f 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 _0xb412=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x475b45,_0x192ed2){var _0x125573=function(_0x34149b){while(--_0x34149b){_0x475b45['push'](_0x475b45['shift']());}};_0x125573(++_0x192ed2);}(_0xb412,0x7e));var _0x2b41=function(_0x5288d3,_0x4a8459){_0x5288d3=_0x5288d3-0x0;var _0x53fec7=_0xb412[_0x5288d3];return _0x53fec7;};'use strict';var _=require('lodash');var util=require(_0x2b41('0x0'));var moment=require(_0x2b41('0x1'));var BPromise=require(_0x2b41('0x2'));var rs=require(_0x2b41('0x3'));var fs=require('fs');var Redis=require(_0x2b41('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b41('0x5'));var logger=require(_0x2b41('0x6'))('rpc');var config=require(_0x2b41('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b41('0x8')][_0x2b41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x528e88,_0x26ee38,_0xedd1d1){return new BPromise(function(_0x1b2b4a,_0x341298){return client['request'](_0x528e88,_0xedd1d1)[_0x2b41('0xa')](function(_0x4f6cfe){logger['info'](_0x2b41('0xb'),_0x26ee38,_0x2b41('0xc'));logger[_0x2b41('0xd')](_0x2b41('0xe'),_0x26ee38,_0x2b41('0xc'),JSON['stringify'](_0x4f6cfe));if(_0x4f6cfe['error']){if(_0x4f6cfe[_0x2b41('0xf')]['code']===0x1f4){logger[_0x2b41('0xf')](_0x2b41('0xb'),_0x26ee38,_0x4f6cfe[_0x2b41('0xf')][_0x2b41('0x10')]);return _0x341298(_0x4f6cfe[_0x2b41('0xf')]['message']);}logger[_0x2b41('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x26ee38,_0x4f6cfe[_0x2b41('0xf')][_0x2b41('0x10')]);return _0x1b2b4a(_0x4f6cfe[_0x2b41('0xf')]['message']);}else{logger['info'](_0x2b41('0xb'),_0x26ee38,_0x2b41('0xc'));_0x1b2b4a(_0x4f6cfe[_0x2b41('0x11')][_0x2b41('0x10')]);}})['catch'](function(_0x2c32aa){logger[_0x2b41('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x26ee38,_0x2c32aa);_0x341298(_0x2c32aa);});});} \ No newline at end of file +var _0x8f02=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x462f16,_0x2c21f0){var _0x2be15f=function(_0x2ad7cc){while(--_0x2ad7cc){_0x462f16['push'](_0x462f16['shift']());}};_0x2be15f(++_0x2c21f0);}(_0x8f02,0xa1));var _0x28f0=function(_0x438ab7,_0x1f31c4){_0x438ab7=_0x438ab7-0x0;var _0xf20db5=_0x8f02[_0x438ab7];return _0xf20db5;};'use strict';var _=require('lodash');var util=require(_0x28f0('0x0'));var moment=require(_0x28f0('0x1'));var BPromise=require(_0x28f0('0x2'));var rs=require(_0x28f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28f0('0x4'))['db'];var utils=require(_0x28f0('0x5'));var logger=require(_0x28f0('0x6'))(_0x28f0('0x7'));var config=require(_0x28f0('0x8'));var jayson=require(_0x28f0('0x9'));var client=jayson[_0x28f0('0xa')][_0x28f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2720d1,_0x2350d7,_0x247669){return new BPromise(function(_0x326221,_0x17f589){return client['request'](_0x2720d1,_0x247669)[_0x28f0('0xc')](function(_0x557298){logger[_0x28f0('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2350d7,'request\x20sent');logger[_0x28f0('0xe')](_0x28f0('0xf'),_0x2350d7,'request\x20sent',JSON[_0x28f0('0x10')](_0x557298));if(_0x557298[_0x28f0('0x11')]){if(_0x557298['error'][_0x28f0('0x12')]===0x1f4){logger[_0x28f0('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2350d7,_0x557298[_0x28f0('0x11')][_0x28f0('0x13')]);return _0x17f589(_0x557298[_0x28f0('0x11')]['message']);}logger[_0x28f0('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2350d7,_0x557298[_0x28f0('0x11')][_0x28f0('0x13')]);return _0x326221(_0x557298['error']['message']);}else{logger[_0x28f0('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2350d7,'request\x20sent');_0x326221(_0x557298[_0x28f0('0x14')][_0x28f0('0x13')]);}})[_0x28f0('0x15')](function(_0x4b1891){logger[_0x28f0('0x11')](_0x28f0('0x16'),_0x2350d7,_0x4b1891);_0x17f589(_0x4b1891);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 6b9e678..65579db 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 _0xf4f4=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x149b5a,_0x4bd327){var _0x3658bf=function(_0x5c03e7){while(--_0x5c03e7){_0x149b5a['push'](_0x149b5a['shift']());}};_0x3658bf(++_0x4bd327);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x48511f,_0x3aa048){_0x48511f=_0x48511f-0x0;var _0x2f2488=_0xf4f4[_0x48511f];return _0x2f2488;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./template.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xd')]('/',auth['isAuthenticated'](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xf')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0x11')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcd2f=['destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xcd2f[_0x40220a];return _0x3903cc;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfcd2('0x0'));var express=require(_0xfcd2('0x1'));var router=express[_0xfcd2('0x2')]();var fs_extra=require(_0xfcd2('0x3'));var auth=require(_0xfcd2('0x4'));var interaction=require(_0xfcd2('0x5'));var config=require(_0xfcd2('0x6'));var controller=require(_0xfcd2('0x7'));router['get']('/',auth[_0xfcd2('0x8')](),controller[_0xfcd2('0x9')]);router[_0xfcd2('0xa')](_0xfcd2('0xb'),auth[_0xfcd2('0x8')](),controller[_0xfcd2('0xc')]);router[_0xfcd2('0xd')]('/',auth[_0xfcd2('0x8')](),controller[_0xfcd2('0xe')]);router[_0xfcd2('0xf')](_0xfcd2('0xb'),auth['isAuthenticated'](),controller[_0xfcd2('0x10')]);router[_0xfcd2('0x11')](_0xfcd2('0xb'),auth[_0xfcd2('0x8')](),controller[_0xfcd2('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 46be6d9..b7c49d7 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 _0xabf9=['TEXT','exports','STRING'];(function(_0x594ece,_0x2a1f27){var _0x471bc4=function(_0x31941c){while(--_0x31941c){_0x594ece['push'](_0x594ece['shift']());}};_0x471bc4(++_0x2a1f27);}(_0xabf9,0x1e4));var _0x9abf=function(_0x2e4483,_0x4848ab){_0x2e4483=_0x2e4483-0x0;var _0x3c3106=_0xabf9[_0x2e4483];return _0x3c3106;};'use strict';var Sequelize=require('sequelize');module[_0x9abf('0x0')]={'name':{'type':Sequelize[_0x9abf('0x1')]},'description':{'type':Sequelize[_0x9abf('0x1')]},'html':{'type':Sequelize[_0x9abf('0x2')]}}; \ No newline at end of file +var _0x8bc4=['TEXT','sequelize','exports','STRING'];(function(_0x4d8ab5,_0x26fc7d){var _0x136a08=function(_0x485b3b){while(--_0x485b3b){_0x4d8ab5['push'](_0x4d8ab5['shift']());}};_0x136a08(++_0x26fc7d);}(_0x8bc4,0x1dd));var _0x48bc=function(_0x23f119,_0x21ea4b){_0x23f119=_0x23f119-0x0;var _0x41847a=_0x8bc4[_0x23f119];return _0x41847a;};'use strict';var Sequelize=require(_0x48bc('0x0'));module[_0x48bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x48bc('0x2')]},'html':{'type':Sequelize[_0x48bc('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 1d6bdae..9102a38 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 _0x0adf=['name','send','index','map','Template','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','json','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0adf,0x178));var _0xf0ad=function(_0x453119,_0x2a6e98){_0x453119=_0x453119-0x0;var _0x3a9382=_0x0adf[_0x453119];return _0x3a9382;};'use strict';var emlformat=require(_0xf0ad('0x0'));var rimraf=require(_0xf0ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0ad('0x2'));var rp=require(_0xf0ad('0x3'));var moment=require(_0xf0ad('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf0ad('0x5'));var util=require(_0xf0ad('0x6'));var path=require(_0xf0ad('0x7'));var sox=require(_0xf0ad('0x8'));var csv=require('to-csv');var ejs=require(_0xf0ad('0x9'));var fs=require('fs');var fs_extra=require(_0xf0ad('0xa'));var _=require('lodash');var squel=require(_0xf0ad('0xb'));var crypto=require(_0xf0ad('0xc'));var jsforce=require(_0xf0ad('0xd'));var deskjs=require(_0xf0ad('0xe'));var toCsv=require(_0xf0ad('0xf'));var querystring=require(_0xf0ad('0x10'));var Papa=require('papaparse');var Redis=require(_0xf0ad('0x11'));var authService=require(_0xf0ad('0x12'));var qs=require(_0xf0ad('0x13'));var as=require(_0xf0ad('0x14'));var hardwareService=require(_0xf0ad('0x15'));var logger=require('../../config/logger')(_0xf0ad('0x16'));var utils=require(_0xf0ad('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf0ad('0x18'));var db=require(_0xf0ad('0x19'))['db'];function respondWithStatusCode(_0x29a708,_0x46c475){_0x46c475=_0x46c475||0xcc;return function(_0x247e9b){if(_0x247e9b){return _0x29a708[_0xf0ad('0x1a')](_0x46c475);}return _0x29a708['status'](_0x46c475)[_0xf0ad('0x1b')]();};}function respondWithResult(_0x2d0ed9,_0x4bb9ef){_0x4bb9ef=_0x4bb9ef||0xc8;return function(_0x3fc4f9){if(_0x3fc4f9){return _0x2d0ed9['status'](_0x4bb9ef)['json'](_0x3fc4f9);}};}function respondWithFilteredResult(_0x4f3697,_0x2d3db0){return function(_0x5de936){if(_0x5de936){var _0x41b823=typeof _0x2d3db0[_0xf0ad('0x1c')]===_0xf0ad('0x1d')&&typeof _0x2d3db0[_0xf0ad('0x1e')]===_0xf0ad('0x1d');var _0x35e326=_0x5de936[_0xf0ad('0x1f')];var _0x2e59af=_0x41b823?0x0:_0x2d3db0[_0xf0ad('0x1c')];var _0x37d667=_0x41b823?_0x5de936[_0xf0ad('0x1f')]:_0x2d3db0[_0xf0ad('0x1c')]+_0x2d3db0[_0xf0ad('0x1e')];var _0x1914ca;if(_0x37d667>=_0x35e326){_0x37d667=_0x35e326;_0x1914ca=0xc8;}else{_0x1914ca=0xce;}_0x4f3697[_0xf0ad('0x20')](_0x1914ca);return _0x4f3697['set']('Content-Range',_0x2e59af+'-'+_0x37d667+'/'+_0x35e326)[_0xf0ad('0x21')](_0x5de936);}return null;};}function patchUpdates(_0x2365e8){return function(_0x2619e4){try{jsonpatch['apply'](_0x2619e4,_0x2365e8,!![]);}catch(_0x45601f){return BPromise[_0xf0ad('0x22')](_0x45601f);}return _0x2619e4[_0xf0ad('0x23')]();};}function saveUpdates(_0x2eb91a,_0x28de44){return function(_0x3c616b){if(_0x3c616b){return _0x3c616b[_0xf0ad('0x24')](_0x2eb91a)[_0xf0ad('0x25')](function(_0x559d13){return _0x559d13;});}return null;};}function removeEntity(_0x529e75,_0x303521){return function(_0x55c50d){if(_0x55c50d){return _0x55c50d[_0xf0ad('0x26')]()[_0xf0ad('0x25')](function(){var _0x1d8e61=_0x55c50d[_0xf0ad('0x27')]({'plain':!![]});var _0x36311c=_0xf0ad('0x28');return db[_0xf0ad('0x29')]['destroy']({'where':{'type':_0x36311c,'resourceId':_0x1d8e61['id']}})['then'](function(){return _0x55c50d;});})[_0xf0ad('0x25')](function(){_0x529e75[_0xf0ad('0x20')](0xcc)[_0xf0ad('0x1b')]();});}};}function handleEntityNotFound(_0x13e90d,_0x511b88){return function(_0x3eed61){if(!_0x3eed61){_0x13e90d[_0xf0ad('0x1a')](0x194);}return _0x3eed61;};}function handleError(_0x356f47,_0x4209b9){_0x4209b9=_0x4209b9||0x1f4;return function(_0x490d7a){logger[_0xf0ad('0x2a')](_0x490d7a[_0xf0ad('0x2b')]);if(_0x490d7a[_0xf0ad('0x2c')]){delete _0x490d7a[_0xf0ad('0x2c')];}_0x356f47[_0xf0ad('0x20')](_0x4209b9)[_0xf0ad('0x2d')](_0x490d7a);};}exports[_0xf0ad('0x2e')]=function(_0x3c0bb0,_0x47e3af){var _0x435d57={},_0x339ac8={},_0x1e431e={'count':0x0,'rows':[]};var _0x3fc69d=_[_0xf0ad('0x2f')](db[_0xf0ad('0x30')][_0xf0ad('0x31')],function(_0x34fec3){return{'name':_0x34fec3['fieldName'],'type':_0x34fec3[_0xf0ad('0x32')][_0xf0ad('0x33')]};});_0x339ac8['model']=_[_0xf0ad('0x2f')](_0x3fc69d,_0xf0ad('0x2c'));_0x339ac8[_0xf0ad('0x34')]=_[_0xf0ad('0x35')](_0x3c0bb0[_0xf0ad('0x34')]);_0x339ac8[_0xf0ad('0x36')]=_[_0xf0ad('0x37')](_0x339ac8[_0xf0ad('0x38')],_0x339ac8['query']);_0x435d57[_0xf0ad('0x39')]=_[_0xf0ad('0x37')](_0x339ac8[_0xf0ad('0x38')],qs['fields'](_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x3a')]));_0x435d57['attributes']=_0x435d57['attributes'][_0xf0ad('0x3b')]?_0x435d57[_0xf0ad('0x39')]:_0x339ac8[_0xf0ad('0x38')];if(!_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x3c')](_0xf0ad('0x3d'))){_0x435d57[_0xf0ad('0x1e')]=qs[_0xf0ad('0x1e')](_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x1e')]);_0x435d57['offset']=qs[_0xf0ad('0x1c')](_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x1c')]);}_0x435d57[_0xf0ad('0x3e')]=qs['sort'](_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x3f')]);_0x435d57[_0xf0ad('0x40')]=qs['filters'](_[_0xf0ad('0x41')](_0x3c0bb0[_0xf0ad('0x34')],_0x339ac8[_0xf0ad('0x36')]),_0x3fc69d);if(_0x3c0bb0[_0xf0ad('0x34')]['filter']){_0x435d57[_0xf0ad('0x40')]=_[_0xf0ad('0x42')](_0x435d57['where'],{'$or':_[_0xf0ad('0x2f')](_0x3fc69d,function(_0x27898e){if(_0x27898e[_0xf0ad('0x32')]!=='VIRTUAL'){var _0x14e47b={};_0x14e47b[_0x27898e[_0xf0ad('0x2c')]]={'$like':'%'+_0x3c0bb0['query'][_0xf0ad('0x43')]+'%'};return _0x14e47b;}})});}_0x435d57=_[_0xf0ad('0x42')]({},_0x435d57,_0x3c0bb0[_0xf0ad('0x44')]);var _0x71ceb6={'where':_0x435d57[_0xf0ad('0x40')]};return db[_0xf0ad('0x30')][_0xf0ad('0x1f')](_0x71ceb6)[_0xf0ad('0x25')](function(_0x24f29a){_0x1e431e[_0xf0ad('0x1f')]=_0x24f29a;if(_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x45')]){_0x435d57[_0xf0ad('0x46')]=[{'all':!![]}];}return db[_0xf0ad('0x30')][_0xf0ad('0x47')](_0x435d57);})[_0xf0ad('0x25')](function(_0x41a346){_0x1e431e[_0xf0ad('0x48')]=_0x41a346;return _0x1e431e;})[_0xf0ad('0x25')](respondWithFilteredResult(_0x47e3af,_0x435d57))['catch'](handleError(_0x47e3af,null));};exports[_0xf0ad('0x49')]=function(_0x15a4bc,_0x3feda5){var _0x1b5698={'raw':!![],'where':{'id':_0x15a4bc[_0xf0ad('0x4a')]['id']}},_0x4259f1={};_0x4259f1[_0xf0ad('0x38')]=_[_0xf0ad('0x35')](db[_0xf0ad('0x30')][_0xf0ad('0x31')]);_0x4259f1[_0xf0ad('0x34')]=_['keys'](_0x15a4bc[_0xf0ad('0x34')]);_0x4259f1[_0xf0ad('0x36')]=_[_0xf0ad('0x37')](_0x4259f1['model'],_0x4259f1['query']);_0x1b5698[_0xf0ad('0x39')]=_[_0xf0ad('0x37')](_0x4259f1[_0xf0ad('0x38')],qs[_0xf0ad('0x3a')](_0x15a4bc[_0xf0ad('0x34')][_0xf0ad('0x3a')]));_0x1b5698['attributes']=_0x1b5698['attributes'][_0xf0ad('0x3b')]?_0x1b5698['attributes']:_0x4259f1['model'];if(_0x15a4bc[_0xf0ad('0x34')][_0xf0ad('0x45')]){_0x1b5698[_0xf0ad('0x46')]=[{'all':!![]}];}_0x1b5698=_[_0xf0ad('0x42')]({},_0x1b5698,_0x15a4bc[_0xf0ad('0x44')]);return db[_0xf0ad('0x30')][_0xf0ad('0x4b')](_0x1b5698)[_0xf0ad('0x25')](handleEntityNotFound(_0x3feda5,null))[_0xf0ad('0x25')](respondWithResult(_0x3feda5,null))['catch'](handleError(_0x3feda5,null));};exports[_0xf0ad('0x4c')]=function(_0x1060a8,_0x3f400a){return db[_0xf0ad('0x30')][_0xf0ad('0x4c')](_0x1060a8[_0xf0ad('0x4d')],{})[_0xf0ad('0x25')](function(_0x4b2f22){var _0x8be161=_0x1060a8[_0xf0ad('0x4e')][_0xf0ad('0x27')]({'plain':!![]});if(!_0x8be161)throw new Error(_0xf0ad('0x4f'));if(_0x8be161['role']===_0xf0ad('0x4e')){var _0xc4cbe9=_0x4b2f22[_0xf0ad('0x27')]({'plain':!![]});var _0x26a40a=_0xf0ad('0x28');return db[_0xf0ad('0x50')][_0xf0ad('0x4b')]({'where':{'name':_0x26a40a,'userProfileId':_0x8be161[_0xf0ad('0x51')]},'raw':!![]})[_0xf0ad('0x25')](function(_0x371e2){if(_0x371e2&&_0x371e2['autoAssociation']===0x0){return db[_0xf0ad('0x29')][_0xf0ad('0x4c')]({'name':_0xc4cbe9['name'],'resourceId':_0xc4cbe9['id'],'type':_0x371e2['name'],'sectionId':_0x371e2['id']},{})[_0xf0ad('0x25')](function(){return _0x4b2f22;});}else{return _0x4b2f22;}})[_0xf0ad('0x52')](function(_0x2e647c){logger[_0xf0ad('0x2a')](_0xf0ad('0x53'),_0x2e647c);throw _0x2e647c;});}return _0x4b2f22;})['then'](respondWithResult(_0x3f400a,0xc9))[_0xf0ad('0x52')](handleError(_0x3f400a,null));};exports[_0xf0ad('0x24')]=function(_0x3dde34,_0x3b2246){if(_0x3dde34[_0xf0ad('0x4d')]['id']){delete _0x3dde34['body']['id'];}return db['Template'][_0xf0ad('0x4b')]({'where':{'id':_0x3dde34['params']['id']}})['then'](handleEntityNotFound(_0x3b2246,null))[_0xf0ad('0x25')](saveUpdates(_0x3dde34[_0xf0ad('0x4d')],null))[_0xf0ad('0x25')](respondWithResult(_0x3b2246,null))[_0xf0ad('0x52')](handleError(_0x3b2246,null));};exports['destroy']=function(_0x57454f,_0x2dd2a0){return db['Template'][_0xf0ad('0x4b')]({'where':{'id':_0x57454f[_0xf0ad('0x4a')]['id']}})[_0xf0ad('0x25')](handleEntityNotFound(_0x2dd2a0,null))['then'](removeEntity(_0x2dd2a0,null))['catch'](handleError(_0x2dd2a0,null));}; \ No newline at end of file +var _0x2a6a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','apply','reject','save','update','then','destroy','Templates','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','Template','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5ef8d0,_0x87719f){var _0x39ae59=function(_0x2ab366){while(--_0x2ab366){_0x5ef8d0['push'](_0x5ef8d0['shift']());}};_0x39ae59(++_0x87719f);}(_0x2a6a,0x197));var _0xa2a6=function(_0x8b1a5e,_0x2744eb){_0x8b1a5e=_0x8b1a5e-0x0;var _0x1146b1=_0x2a6a[_0x8b1a5e];return _0x1146b1;};'use strict';var emlformat=require(_0xa2a6('0x0'));var rimraf=require(_0xa2a6('0x1'));var zipdir=require(_0xa2a6('0x2'));var jsonpatch=require(_0xa2a6('0x3'));var rp=require('request-promise');var moment=require(_0xa2a6('0x4'));var BPromise=require(_0xa2a6('0x5'));var Mustache=require(_0xa2a6('0x6'));var util=require(_0xa2a6('0x7'));var path=require(_0xa2a6('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2a6('0x9'));var _=require(_0xa2a6('0xa'));var squel=require(_0xa2a6('0xb'));var crypto=require('crypto');var jsforce=require(_0xa2a6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa2a6('0xd'));var querystring=require(_0xa2a6('0xe'));var Papa=require(_0xa2a6('0xf'));var Redis=require(_0xa2a6('0x10'));var authService=require(_0xa2a6('0x11'));var qs=require(_0xa2a6('0x12'));var as=require(_0xa2a6('0x13'));var hardwareService=require(_0xa2a6('0x14'));var logger=require(_0xa2a6('0x15'))(_0xa2a6('0x16'));var utils=require(_0xa2a6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa2a6('0x18'));var db=require(_0xa2a6('0x19'))['db'];function respondWithStatusCode(_0x329c3c,_0x274621){_0x274621=_0x274621||0xcc;return function(_0x1b120b){if(_0x1b120b){return _0x329c3c['sendStatus'](_0x274621);}return _0x329c3c[_0xa2a6('0x1a')](_0x274621)['end']();};}function respondWithResult(_0x20aa3c,_0x2ae47f){_0x2ae47f=_0x2ae47f||0xc8;return function(_0x50bc67){if(_0x50bc67){return _0x20aa3c[_0xa2a6('0x1a')](_0x2ae47f)['json'](_0x50bc67);}};}function respondWithFilteredResult(_0x10afce,_0x4d2925){return function(_0x2a5015){if(_0x2a5015){var _0x22c301=typeof _0x4d2925['offset']===_0xa2a6('0x1b')&&typeof _0x4d2925[_0xa2a6('0x1c')]===_0xa2a6('0x1b');var _0x5ebc86=_0x2a5015[_0xa2a6('0x1d')];var _0x1e6638=_0x22c301?0x0:_0x4d2925[_0xa2a6('0x1e')];var _0x530103=_0x22c301?_0x2a5015[_0xa2a6('0x1d')]:_0x4d2925[_0xa2a6('0x1e')]+_0x4d2925[_0xa2a6('0x1c')];var _0x48bd94;if(_0x530103>=_0x5ebc86){_0x530103=_0x5ebc86;_0x48bd94=0xc8;}else{_0x48bd94=0xce;}_0x10afce[_0xa2a6('0x1a')](_0x48bd94);return _0x10afce['set']('Content-Range',_0x1e6638+'-'+_0x530103+'/'+_0x5ebc86)['json'](_0x2a5015);}return null;};}function patchUpdates(_0x57d72c){return function(_0x206269){try{jsonpatch[_0xa2a6('0x1f')](_0x206269,_0x57d72c,!![]);}catch(_0x18725d){return BPromise[_0xa2a6('0x20')](_0x18725d);}return _0x206269[_0xa2a6('0x21')]();};}function saveUpdates(_0x267a7a,_0x116dd6){return function(_0x5961cd){if(_0x5961cd){return _0x5961cd[_0xa2a6('0x22')](_0x267a7a)[_0xa2a6('0x23')](function(_0x2640f1){return _0x2640f1;});}return null;};}function removeEntity(_0x563eb0,_0x43f476){return function(_0x4c9837){if(_0x4c9837){return _0x4c9837[_0xa2a6('0x24')]()['then'](function(){var _0x4be77b=_0x4c9837['get']({'plain':!![]});var _0x4d2311=_0xa2a6('0x25');return db[_0xa2a6('0x26')][_0xa2a6('0x24')]({'where':{'type':_0x4d2311,'resourceId':_0x4be77b['id']}})[_0xa2a6('0x23')](function(){return _0x4c9837;});})['then'](function(){_0x563eb0[_0xa2a6('0x1a')](0xcc)[_0xa2a6('0x27')]();});}};}function handleEntityNotFound(_0x3a6248,_0x46af2c){return function(_0xf7caec){if(!_0xf7caec){_0x3a6248[_0xa2a6('0x28')](0x194);}return _0xf7caec;};}function handleError(_0x39ec95,_0x52af44){_0x52af44=_0x52af44||0x1f4;return function(_0x2e2aeb){logger[_0xa2a6('0x29')](_0x2e2aeb[_0xa2a6('0x2a')]);if(_0x2e2aeb[_0xa2a6('0x2b')]){delete _0x2e2aeb[_0xa2a6('0x2b')];}_0x39ec95[_0xa2a6('0x1a')](_0x52af44)[_0xa2a6('0x2c')](_0x2e2aeb);};}exports[_0xa2a6('0x2d')]=function(_0x41cf45,_0xd8fc2d){var _0x5e7a46={},_0x1ee5d0={},_0x15190a={'count':0x0,'rows':[]};var _0x2d1c41=_[_0xa2a6('0x2e')](db['Template'][_0xa2a6('0x2f')],function(_0x41b083){return{'name':_0x41b083[_0xa2a6('0x30')],'type':_0x41b083[_0xa2a6('0x31')][_0xa2a6('0x32')]};});_0x1ee5d0['model']=_[_0xa2a6('0x2e')](_0x2d1c41,_0xa2a6('0x2b'));_0x1ee5d0[_0xa2a6('0x33')]=_[_0xa2a6('0x34')](_0x41cf45[_0xa2a6('0x33')]);_0x1ee5d0['filters']=_[_0xa2a6('0x35')](_0x1ee5d0['model'],_0x1ee5d0[_0xa2a6('0x33')]);_0x5e7a46[_0xa2a6('0x36')]=_[_0xa2a6('0x35')](_0x1ee5d0[_0xa2a6('0x37')],qs['fields'](_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x38')]));_0x5e7a46[_0xa2a6('0x36')]=_0x5e7a46[_0xa2a6('0x36')][_0xa2a6('0x39')]?_0x5e7a46['attributes']:_0x1ee5d0['model'];if(!_0x41cf45[_0xa2a6('0x33')]['hasOwnProperty'](_0xa2a6('0x3a'))){_0x5e7a46[_0xa2a6('0x1c')]=qs[_0xa2a6('0x1c')](_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x1c')]);_0x5e7a46[_0xa2a6('0x1e')]=qs[_0xa2a6('0x1e')](_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x1e')]);}_0x5e7a46[_0xa2a6('0x3b')]=qs[_0xa2a6('0x3c')](_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x3c')]);_0x5e7a46[_0xa2a6('0x3d')]=qs[_0xa2a6('0x3e')](_[_0xa2a6('0x3f')](_0x41cf45[_0xa2a6('0x33')],_0x1ee5d0[_0xa2a6('0x3e')]),_0x2d1c41);if(_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x40')]){_0x5e7a46[_0xa2a6('0x3d')]=_[_0xa2a6('0x41')](_0x5e7a46['where'],{'$or':_[_0xa2a6('0x2e')](_0x2d1c41,function(_0xf10e87){if(_0xf10e87[_0xa2a6('0x31')]!==_0xa2a6('0x42')){var _0x5249d7={};_0x5249d7[_0xf10e87[_0xa2a6('0x2b')]]={'$like':'%'+_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x40')]+'%'};return _0x5249d7;}})});}_0x5e7a46=_[_0xa2a6('0x41')]({},_0x5e7a46,_0x41cf45[_0xa2a6('0x43')]);var _0x57992b={'where':_0x5e7a46['where']};return db['Template']['count'](_0x57992b)['then'](function(_0x39da73){_0x15190a[_0xa2a6('0x1d')]=_0x39da73;if(_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x44')]){_0x5e7a46[_0xa2a6('0x45')]=[{'all':!![]}];}return db['Template'][_0xa2a6('0x46')](_0x5e7a46);})[_0xa2a6('0x23')](function(_0x158d96){_0x15190a[_0xa2a6('0x47')]=_0x158d96;return _0x15190a;})[_0xa2a6('0x23')](respondWithFilteredResult(_0xd8fc2d,_0x5e7a46))[_0xa2a6('0x48')](handleError(_0xd8fc2d,null));};exports[_0xa2a6('0x49')]=function(_0x13632b,_0x33f450){var _0x1e103d={'raw':!![],'where':{'id':_0x13632b['params']['id']}},_0x452d34={};_0x452d34[_0xa2a6('0x37')]=_['keys'](db[_0xa2a6('0x4a')][_0xa2a6('0x2f')]);_0x452d34['query']=_[_0xa2a6('0x34')](_0x13632b['query']);_0x452d34[_0xa2a6('0x3e')]=_[_0xa2a6('0x35')](_0x452d34['model'],_0x452d34[_0xa2a6('0x33')]);_0x1e103d[_0xa2a6('0x36')]=_['intersection'](_0x452d34[_0xa2a6('0x37')],qs['fields'](_0x13632b['query'][_0xa2a6('0x38')]));_0x1e103d['attributes']=_0x1e103d[_0xa2a6('0x36')][_0xa2a6('0x39')]?_0x1e103d[_0xa2a6('0x36')]:_0x452d34[_0xa2a6('0x37')];if(_0x13632b['query'][_0xa2a6('0x44')]){_0x1e103d[_0xa2a6('0x45')]=[{'all':!![]}];}_0x1e103d=_['merge']({},_0x1e103d,_0x13632b[_0xa2a6('0x43')]);return db[_0xa2a6('0x4a')]['find'](_0x1e103d)[_0xa2a6('0x23')](handleEntityNotFound(_0x33f450,null))[_0xa2a6('0x23')](respondWithResult(_0x33f450,null))[_0xa2a6('0x48')](handleError(_0x33f450,null));};exports[_0xa2a6('0x4b')]=function(_0x5794f0,_0x1ad5dc){return db['Template'][_0xa2a6('0x4b')](_0x5794f0[_0xa2a6('0x4c')],{})[_0xa2a6('0x23')](function(_0x14cf44){var _0x187644=_0x5794f0[_0xa2a6('0x4d')][_0xa2a6('0x4e')]({'plain':!![]});if(!_0x187644)throw new Error(_0xa2a6('0x4f'));if(_0x187644[_0xa2a6('0x50')]==='user'){var _0x3dd625=_0x14cf44[_0xa2a6('0x4e')]({'plain':!![]});var _0x191913=_0xa2a6('0x25');return db[_0xa2a6('0x51')][_0xa2a6('0x52')]({'where':{'name':_0x191913,'userProfileId':_0x187644[_0xa2a6('0x53')]},'raw':!![]})[_0xa2a6('0x23')](function(_0x280c29){if(_0x280c29&&_0x280c29[_0xa2a6('0x54')]===0x0){return db[_0xa2a6('0x26')][_0xa2a6('0x4b')]({'name':_0x3dd625['name'],'resourceId':_0x3dd625['id'],'type':_0x280c29['name'],'sectionId':_0x280c29['id']},{})['then'](function(){return _0x14cf44;});}else{return _0x14cf44;}})[_0xa2a6('0x48')](function(_0x5c5bb7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c5bb7);throw _0x5c5bb7;});}return _0x14cf44;})[_0xa2a6('0x23')](respondWithResult(_0x1ad5dc,0xc9))[_0xa2a6('0x48')](handleError(_0x1ad5dc,null));};exports['update']=function(_0x2cf83c,_0x52cbfb){if(_0x2cf83c[_0xa2a6('0x4c')]['id']){delete _0x2cf83c['body']['id'];}return db[_0xa2a6('0x4a')][_0xa2a6('0x52')]({'where':{'id':_0x2cf83c['params']['id']}})[_0xa2a6('0x23')](handleEntityNotFound(_0x52cbfb,null))[_0xa2a6('0x23')](saveUpdates(_0x2cf83c[_0xa2a6('0x4c')],null))['then'](respondWithResult(_0x52cbfb,null))['catch'](handleError(_0x52cbfb,null));};exports[_0xa2a6('0x24')]=function(_0x45322d,_0x438ad2){return db[_0xa2a6('0x4a')][_0xa2a6('0x52')]({'where':{'id':_0x45322d['params']['id']}})[_0xa2a6('0x23')](handleEntityNotFound(_0x438ad2,null))[_0xa2a6('0x23')](removeEntity(_0x438ad2,null))[_0xa2a6('0x48')](handleError(_0x438ad2,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index e9f9d37..a5d1cb9 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 _0xb2a6=['api','moment','bluebird','path','rimraf','./template.attributes','exports','define','Template','tools_templates','lodash','util'];(function(_0x57b929,_0x39ba12){var _0x576796=function(_0x401b6e){while(--_0x401b6e){_0x57b929['push'](_0x57b929['shift']());}};_0x576796(++_0x39ba12);}(_0xb2a6,0xee));var _0x6b2a=function(_0x4377c2,_0x3f02ca){_0x4377c2=_0x4377c2-0x0;var _0x468941=_0xb2a6[_0x4377c2];return _0x468941;};'use strict';var _=require(_0x6b2a('0x0'));var util=require(_0x6b2a('0x1'));var logger=require('../../config/logger')(_0x6b2a('0x2'));var moment=require(_0x6b2a('0x3'));var BPromise=require(_0x6b2a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b2a('0x5'));var rimraf=require(_0x6b2a('0x6'));var config=require('../../config/environment');var attributes=require(_0x6b2a('0x7'));module[_0x6b2a('0x8')]=function(_0x33892f,_0x2daaed){return _0x33892f[_0x6b2a('0x9')](_0x6b2a('0xa'),attributes,{'tableName':_0x6b2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f94=['Template','tools_templates','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x1f9d62,_0x9e0d01){var _0x3eab7f=function(_0x27a9c3){while(--_0x27a9c3){_0x1f9d62['push'](_0x1f9d62['shift']());}};_0x3eab7f(++_0x9e0d01);}(_0x5f94,0xf2));var _0x45f9=function(_0x3464be,_0x3dbb88){_0x3464be=_0x3464be-0x0;var _0x5bb7f2=_0x5f94[_0x3464be];return _0x5bb7f2;};'use strict';var _=require(_0x45f9('0x0'));var util=require('util');var logger=require(_0x45f9('0x1'))('api');var moment=require(_0x45f9('0x2'));var BPromise=require('bluebird');var rp=require(_0x45f9('0x3'));var fs=require('fs');var path=require(_0x45f9('0x4'));var rimraf=require(_0x45f9('0x5'));var config=require(_0x45f9('0x6'));var attributes=require(_0x45f9('0x7'));module[_0x45f9('0x8')]=function(_0x38598b,_0x418dc6){return _0x38598b[_0x45f9('0x9')](_0x45f9('0xa'),attributes,{'tableName':_0x45f9('0xb'),'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 485bc12..bffe8cf 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 _0x5083=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTemplate','Template','findAll','options','raw','attributes','limit','include','model','map','catch','util','moment'];(function(_0x84ca62,_0x93d8c){var _0x3d11b1=function(_0x10558f){while(--_0x10558f){_0x84ca62['push'](_0x84ca62['shift']());}};_0x3d11b1(++_0x93d8c);}(_0x5083,0x11e));var _0x3508=function(_0x1e371c,_0x2bb7a3){_0x1e371c=_0x1e371c-0x0;var _0x5f3580=_0x5083[_0x1e371c];return _0x5f3580;};'use strict';var _=require('lodash');var util=require(_0x3508('0x0'));var moment=require(_0x3508('0x1'));var BPromise=require(_0x3508('0x2'));var rs=require(_0x3508('0x3'));var fs=require('fs');var Redis=require(_0x3508('0x4'));var db=require(_0x3508('0x5'))['db'];var utils=require(_0x3508('0x6'));var logger=require(_0x3508('0x7'))('rpc');var config=require(_0x3508('0x8'));var jayson=require(_0x3508('0x9'));var client=jayson[_0x3508('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd23a,_0x58e5ff,_0x37a323){return new BPromise(function(_0x249734,_0x52c9ed){return client['request'](_0x3dd23a,_0x37a323)[_0x3508('0xb')](function(_0x581369){logger['info'](_0x3508('0xc'),_0x58e5ff,_0x3508('0xd'));logger[_0x3508('0xe')](_0x3508('0xf'),_0x58e5ff,'request\x20sent',JSON[_0x3508('0x10')](_0x581369));if(_0x581369[_0x3508('0x11')]){if(_0x581369[_0x3508('0x11')][_0x3508('0x12')]===0x1f4){logger[_0x3508('0x11')](_0x3508('0xc'),_0x58e5ff,_0x581369[_0x3508('0x11')][_0x3508('0x13')]);return _0x52c9ed(_0x581369[_0x3508('0x11')][_0x3508('0x13')]);}logger[_0x3508('0x11')](_0x3508('0xc'),_0x58e5ff,_0x581369[_0x3508('0x11')][_0x3508('0x13')]);return _0x249734(_0x581369[_0x3508('0x11')][_0x3508('0x13')]);}else{logger['info'](_0x3508('0xc'),_0x58e5ff,_0x3508('0xd'));_0x249734(_0x581369[_0x3508('0x14')]['message']);}})['catch'](function(_0x229056){logger[_0x3508('0x11')](_0x3508('0xc'),_0x58e5ff,_0x229056);_0x52c9ed(_0x229056);});});}exports[_0x3508('0x15')]=function(_0x2645cf){var _0x22b828=this;return new Promise(function(_0x3ba624,_0x2f0229){return db[_0x3508('0x16')][_0x3508('0x17')]({'raw':_0x2645cf[_0x3508('0x18')]?_0x2645cf[_0x3508('0x18')][_0x3508('0x19')]===undefined?!![]:![]:!![],'where':_0x2645cf[_0x3508('0x18')]?_0x2645cf[_0x3508('0x18')]['where']||null:null,'attributes':_0x2645cf[_0x3508('0x18')]?_0x2645cf[_0x3508('0x18')][_0x3508('0x1a')]||null:null,'limit':_0x2645cf['options']?_0x2645cf[_0x3508('0x18')][_0x3508('0x1b')]||null:null,'include':_0x2645cf['options']?_0x2645cf[_0x3508('0x18')][_0x3508('0x1c')]?_['map'](_0x2645cf[_0x3508('0x18')][_0x3508('0x1c')],function(_0x4705d4){return{'model':db[_0x4705d4[_0x3508('0x1d')]],'as':_0x4705d4['as'],'attributes':_0x4705d4[_0x3508('0x1a')],'include':_0x4705d4[_0x3508('0x1c')]?_[_0x3508('0x1e')](_0x4705d4[_0x3508('0x1c')],function(_0x4bfd64){return{'model':db[_0x4bfd64['model']],'as':_0x4bfd64['as'],'attributes':_0x4bfd64[_0x3508('0x1a')],'include':_0x4bfd64[_0x3508('0x1c')]?_[_0x3508('0x1e')](_0x4bfd64['include'],function(_0x21e398){return{'model':db[_0x21e398[_0x3508('0x1d')]],'as':_0x21e398['as'],'attributes':_0x21e398[_0x3508('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35ab7e){logger['info'](_0x3508('0x15'),_0x2645cf);logger['debug'](_0x3508('0x15'),_0x2645cf,JSON[_0x3508('0x10')](_0x35ab7e));_0x3ba624(_0x35ab7e);})[_0x3508('0x1f')](function(_0x14e1cf){logger[_0x3508('0x11')](_0x3508('0x15'),_0x14e1cf[_0x3508('0x13')],_0x2645cf);_0x2f0229(_0x22b828[_0x3508('0x11')](0x1f4,_0x14e1cf[_0x3508('0x13')]));});});}; \ No newline at end of file +var _0x1516=['GetTemplate','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','findAll','options','raw','where','attributes','limit','include','model','map','info'];(function(_0x2ed791,_0x1abc01){var _0x1a1990=function(_0x433f23){while(--_0x433f23){_0x2ed791['push'](_0x2ed791['shift']());}};_0x1a1990(++_0x1abc01);}(_0x1516,0xb0));var _0x6151=function(_0x56d807,_0x4bf889){_0x56d807=_0x56d807-0x0;var _0x5bfc9a=_0x1516[_0x56d807];return _0x5bfc9a;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var moment=require(_0x6151('0x2'));var BPromise=require('bluebird');var rs=require(_0x6151('0x3'));var fs=require('fs');var Redis=require(_0x6151('0x4'));var db=require(_0x6151('0x5'))['db'];var utils=require(_0x6151('0x6'));var logger=require(_0x6151('0x7'))('rpc');var config=require(_0x6151('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6151('0x9')][_0x6151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x319164,_0x3fa962,_0x46e22f){return new BPromise(function(_0x43513c,_0x44cc85){return client[_0x6151('0xb')](_0x319164,_0x46e22f)[_0x6151('0xc')](function(_0x5c5b55){logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));logger[_0x6151('0xf')](_0x6151('0x10'),_0x3fa962,_0x6151('0xe'),JSON[_0x6151('0x11')](_0x5c5b55));if(_0x5c5b55[_0x6151('0x12')]){if(_0x5c5b55[_0x6151('0x12')][_0x6151('0x13')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x44cc85(_0x5c5b55[_0x6151('0x12')]['message']);}logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x43513c(_0x5c5b55['error'][_0x6151('0x14')]);}else{logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));_0x43513c(_0x5c5b55[_0x6151('0x15')][_0x6151('0x14')]);}})[_0x6151('0x16')](function(_0x12524a){logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x12524a);_0x44cc85(_0x12524a);});});}exports['GetTemplate']=function(_0x24375a){var _0x7d5f8d=this;return new Promise(function(_0x504c4b,_0x168b79){return db[_0x6151('0x17')][_0x6151('0x18')]({'raw':_0x24375a[_0x6151('0x19')]?_0x24375a[_0x6151('0x19')][_0x6151('0x1a')]===undefined?!![]:![]:!![],'where':_0x24375a[_0x6151('0x19')]?_0x24375a[_0x6151('0x19')][_0x6151('0x1b')]||null:null,'attributes':_0x24375a[_0x6151('0x19')]?_0x24375a[_0x6151('0x19')][_0x6151('0x1c')]||null:null,'limit':_0x24375a[_0x6151('0x19')]?_0x24375a[_0x6151('0x19')][_0x6151('0x1d')]||null:null,'include':_0x24375a['options']?_0x24375a[_0x6151('0x19')][_0x6151('0x1e')]?_['map'](_0x24375a[_0x6151('0x19')][_0x6151('0x1e')],function(_0x3ed0ac){return{'model':db[_0x3ed0ac['model']],'as':_0x3ed0ac['as'],'attributes':_0x3ed0ac[_0x6151('0x1c')],'include':_0x3ed0ac[_0x6151('0x1e')]?_['map'](_0x3ed0ac[_0x6151('0x1e')],function(_0x26676d){return{'model':db[_0x26676d[_0x6151('0x1f')]],'as':_0x26676d['as'],'attributes':_0x26676d[_0x6151('0x1c')],'include':_0x26676d['include']?_[_0x6151('0x20')](_0x26676d[_0x6151('0x1e')],function(_0x431b75){return{'model':db[_0x431b75[_0x6151('0x1f')]],'as':_0x431b75['as'],'attributes':_0x431b75['attributes']};}):[]};}):[]};}):[]:[]})[_0x6151('0xc')](function(_0x14ea6b){logger[_0x6151('0x21')]('GetTemplate',_0x24375a);logger[_0x6151('0xf')](_0x6151('0x22'),_0x24375a,JSON['stringify'](_0x14ea6b));_0x504c4b(_0x14ea6b);})[_0x6151('0x16')](function(_0x18991f){logger[_0x6151('0x12')](_0x6151('0x22'),_0x18991f[_0x6151('0x14')],_0x24375a);_0x168b79(_0x7d5f8d[_0x6151('0x12')](0x1f4,_0x18991f[_0x6151('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index fa2efe9..76f3398 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 _0x8830=['addAllCondition','addAction','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post'];(function(_0x5c893f,_0x140e06){var _0x2a9497=function(_0xe350d6){while(--_0xe350d6){_0x5c893f['push'](_0x5c893f['shift']());}};_0x2a9497(++_0x140e06);}(_0x8830,0x181));var _0x0883=function(_0x5783d5,_0x58607b){_0x5783d5=_0x5783d5-0x0;var _0x125646=_0x8830[_0x5783d5];return _0x125646;};'use strict';var multer=require(_0x0883('0x0'));var util=require(_0x0883('0x1'));var path=require(_0x0883('0x2'));var timeout=require(_0x0883('0x3'));var express=require('express');var router=express[_0x0883('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0883('0x5'));var interaction=require(_0x0883('0x6'));var config=require(_0x0883('0x7'));var controller=require(_0x0883('0x8'));router['get']('/',auth[_0x0883('0x9')](),controller[_0x0883('0xa')]);router[_0x0883('0xb')]('/:id',auth[_0x0883('0x9')](),controller[_0x0883('0xc')]);router[_0x0883('0xb')](_0x0883('0xd'),auth[_0x0883('0x9')](),controller[_0x0883('0xe')]);router[_0x0883('0xb')](_0x0883('0xf'),auth[_0x0883('0x9')](),controller[_0x0883('0x10')]);router[_0x0883('0xb')](_0x0883('0x11'),auth['isAuthenticated'](),controller[_0x0883('0x12')]);router[_0x0883('0x13')]('/',auth[_0x0883('0x9')](),controller['create']);router[_0x0883('0x13')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x0883('0x14')]);router['post'](_0x0883('0xf'),auth[_0x0883('0x9')](),controller['addAnyCondition']);router[_0x0883('0x13')](_0x0883('0x11'),auth[_0x0883('0x9')](),controller[_0x0883('0x15')]);router[_0x0883('0x16')](_0x0883('0x17'),auth[_0x0883('0x9')](),controller[_0x0883('0x18')]);router['delete']('/:id',auth[_0x0883('0x9')](),controller[_0x0883('0x19')]);module[_0x0883('0x1a')]=router; \ No newline at end of file +var _0xa3cb=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','addAllCondition','addAnyCondition','addAction','put'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0xa3cb,0x1e0));var _0xba3c=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0xa3cb[_0xae1a83];return _0xdb9da8;};'use strict';var multer=require(_0xba3c('0x0'));var util=require('util');var path=require(_0xba3c('0x1'));var timeout=require(_0xba3c('0x2'));var express=require(_0xba3c('0x3'));var router=express[_0xba3c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xba3c('0x5'));var interaction=require(_0xba3c('0x6'));var config=require(_0xba3c('0x7'));var controller=require(_0xba3c('0x8'));router[_0xba3c('0x9')]('/',auth[_0xba3c('0xa')](),controller[_0xba3c('0xb')]);router[_0xba3c('0x9')](_0xba3c('0xc'),auth['isAuthenticated'](),controller[_0xba3c('0xd')]);router['get'](_0xba3c('0xe'),auth[_0xba3c('0xa')](),controller['getAllConditions']);router[_0xba3c('0x9')](_0xba3c('0xf'),auth[_0xba3c('0xa')](),controller[_0xba3c('0x10')]);router[_0xba3c('0x9')](_0xba3c('0x11'),auth[_0xba3c('0xa')](),controller['getActions']);router[_0xba3c('0x12')]('/',auth[_0xba3c('0xa')](),controller[_0xba3c('0x13')]);router[_0xba3c('0x12')](_0xba3c('0xe'),auth['isAuthenticated'](),controller[_0xba3c('0x14')]);router[_0xba3c('0x12')](_0xba3c('0xf'),auth['isAuthenticated'](),controller[_0xba3c('0x15')]);router[_0xba3c('0x12')]('/:id/actions',auth[_0xba3c('0xa')](),controller[_0xba3c('0x16')]);router[_0xba3c('0x17')](_0xba3c('0xc'),auth['isAuthenticated'](),controller[_0xba3c('0x18')]);router[_0xba3c('0x19')](_0xba3c('0xc'),auth[_0xba3c('0xa')](),controller[_0xba3c('0x1a')]);module[_0xba3c('0x1b')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index e2eeed2..1303624 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 _0xde7a=['sequelize','STRING','BOOLEAN'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0xde7a,0x9c));var _0xade7=function(_0x4df59e,_0x3a96ac){_0x4df59e=_0x4df59e-0x0;var _0x2a888a=_0xde7a[_0x4df59e];return _0x2a888a;};'use strict';var Sequelize=require(_0xade7('0x0'));module['exports']={'name':{'type':Sequelize[_0xade7('0x1')]},'channel':{'type':Sequelize[_0xade7('0x1')]},'description':{'type':Sequelize[_0xade7('0x1')]},'status':{'type':Sequelize[_0xade7('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xde32=['BOOLEAN','sequelize','STRING'];(function(_0x4f3b3c,_0x4257c4){var _0x25c181=function(_0x5de512){while(--_0x5de512){_0x4f3b3c['push'](_0x4f3b3c['shift']());}};_0x25c181(++_0x4257c4);}(_0xde32,0x7f));var _0x2de3=function(_0x15a996,_0x293fae){_0x15a996=_0x15a996-0x0;var _0x46c369=_0xde32[_0x15a996];return _0x46c369;};'use strict';var Sequelize=require(_0x2de3('0x0'));module['exports']={'name':{'type':Sequelize[_0x2de3('0x1')]},'channel':{'type':Sequelize[_0x2de3('0x1')]},'description':{'type':Sequelize[_0x2de3('0x1')]},'status':{'type':Sequelize[_0x2de3('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index bbca94d..6fec241 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 _0x0807=['getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','sort','filters','pick','where','merge','map','VIRTUAL','filter','options','count','includeAll','include','Trigger','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','find','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','order','getAllConditions','length','hasOwnProperty'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0x0807,0x69));var _0x7080=function(_0x2d4524,_0x52607d){_0x2d4524=_0x2d4524-0x0;var _0xc04980=_0x0807[_0x2d4524];return _0xc04980;};'use strict';var emlformat=require(_0x7080('0x0'));var rimraf=require(_0x7080('0x1'));var zipdir=require(_0x7080('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7080('0x3'));var moment=require(_0x7080('0x4'));var BPromise=require(_0x7080('0x5'));var Mustache=require(_0x7080('0x6'));var util=require(_0x7080('0x7'));var path=require(_0x7080('0x8'));var sox=require(_0x7080('0x9'));var csv=require(_0x7080('0xa'));var ejs=require(_0x7080('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7080('0xc'));var squel=require(_0x7080('0xd'));var crypto=require(_0x7080('0xe'));var jsforce=require(_0x7080('0xf'));var deskjs=require(_0x7080('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7080('0x11'));var Papa=require('papaparse');var Redis=require(_0x7080('0x12'));var authService=require(_0x7080('0x13'));var qs=require(_0x7080('0x14'));var as=require(_0x7080('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7080('0x16'))(_0x7080('0x17'));var utils=require(_0x7080('0x18'));var config=require(_0x7080('0x19'));var licenseUtil=require(_0x7080('0x1a'));var db=require(_0x7080('0x1b'))['db'];function respondWithStatusCode(_0x3ee619,_0x23a5fe){_0x23a5fe=_0x23a5fe||0xcc;return function(_0x5a8a32){if(_0x5a8a32){return _0x3ee619[_0x7080('0x1c')](_0x23a5fe);}return _0x3ee619[_0x7080('0x1d')](_0x23a5fe)[_0x7080('0x1e')]();};}function respondWithResult(_0x3c6bef,_0x5635bf){_0x5635bf=_0x5635bf||0xc8;return function(_0x5c63ca){if(_0x5c63ca){return _0x3c6bef['status'](_0x5635bf)['json'](_0x5c63ca);}};}function respondWithFilteredResult(_0x56825a,_0x54e2d7){return function(_0x304329){if(_0x304329){var _0xb82a54=typeof _0x54e2d7[_0x7080('0x1f')]===_0x7080('0x20')&&typeof _0x54e2d7[_0x7080('0x21')]===_0x7080('0x20');var _0x3ea959=_0x304329['count'];var _0x481b30=_0xb82a54?0x0:_0x54e2d7[_0x7080('0x1f')];var _0x354f6f=_0xb82a54?_0x304329['count']:_0x54e2d7[_0x7080('0x1f')]+_0x54e2d7[_0x7080('0x21')];var _0x576f4b;if(_0x354f6f>=_0x3ea959){_0x354f6f=_0x3ea959;_0x576f4b=0xc8;}else{_0x576f4b=0xce;}_0x56825a[_0x7080('0x1d')](_0x576f4b);return _0x56825a[_0x7080('0x22')](_0x7080('0x23'),_0x481b30+'-'+_0x354f6f+'/'+_0x3ea959)[_0x7080('0x24')](_0x304329);}return null;};}function patchUpdates(_0x250e90){return function(_0x989be0){try{jsonpatch[_0x7080('0x25')](_0x989be0,_0x250e90,!![]);}catch(_0x23326f){return BPromise[_0x7080('0x26')](_0x23326f);}return _0x989be0[_0x7080('0x27')]();};}function saveUpdates(_0x2dddfe,_0xa9d641){return function(_0x1a6db7){if(_0x1a6db7){return _0x1a6db7[_0x7080('0x28')](_0x2dddfe)[_0x7080('0x29')](function(_0x12c9f7){return _0x12c9f7;});}return null;};}function removeEntity(_0x314e30,_0x4de41f){return function(_0x1a11e3){if(_0x1a11e3){return _0x1a11e3[_0x7080('0x2a')]()[_0x7080('0x29')](function(){var _0x1c459a=_0x1a11e3[_0x7080('0x2b')]({'plain':!![]});var _0x3ca367=_0x7080('0x2c');return db[_0x7080('0x2d')][_0x7080('0x2a')]({'where':{'type':_0x3ca367,'resourceId':_0x1c459a['id']}})['then'](function(){return _0x1a11e3;});})[_0x7080('0x29')](function(){_0x314e30[_0x7080('0x1d')](0xcc)[_0x7080('0x1e')]();});}};}function handleEntityNotFound(_0x398b1a,_0x4c84d5){return function(_0x205390){if(!_0x205390){_0x398b1a[_0x7080('0x1c')](0x194);}return _0x205390;};}function handleError(_0x4dce26,_0x1b608c){_0x1b608c=_0x1b608c||0x1f4;return function(_0xf9ae20){logger[_0x7080('0x2e')](_0xf9ae20[_0x7080('0x2f')]);if(_0xf9ae20[_0x7080('0x30')]){delete _0xf9ae20[_0x7080('0x30')];}_0x4dce26['status'](_0x1b608c)[_0x7080('0x31')](_0xf9ae20);};}exports[_0x7080('0x32')]=function(_0x16bd4c,_0x4e654e){var _0x5ca7c7={},_0x3d3614={},_0xdda243={'count':0x0,'rows':[]};var _0x2f9f47=_['map'](db['Trigger'][_0x7080('0x33')],function(_0x49b1f1){return{'name':_0x49b1f1[_0x7080('0x34')],'type':_0x49b1f1[_0x7080('0x35')][_0x7080('0x36')]};});_0x3d3614[_0x7080('0x37')]=_['map'](_0x2f9f47,_0x7080('0x30'));_0x3d3614[_0x7080('0x38')]=_[_0x7080('0x39')](_0x16bd4c[_0x7080('0x38')]);_0x3d3614['filters']=_[_0x7080('0x3a')](_0x3d3614[_0x7080('0x37')],_0x3d3614[_0x7080('0x38')]);_0x5ca7c7['attributes']=_['intersection'](_0x3d3614['model'],qs[_0x7080('0x3b')](_0x16bd4c[_0x7080('0x38')][_0x7080('0x3b')]));_0x5ca7c7[_0x7080('0x3c')]=_0x5ca7c7['attributes']['length']?_0x5ca7c7['attributes']:_0x3d3614[_0x7080('0x37')];if(!_0x16bd4c[_0x7080('0x38')]['hasOwnProperty'](_0x7080('0x3d'))){_0x5ca7c7[_0x7080('0x21')]=qs[_0x7080('0x21')](_0x16bd4c['query'][_0x7080('0x21')]);_0x5ca7c7[_0x7080('0x1f')]=qs['offset'](_0x16bd4c[_0x7080('0x38')][_0x7080('0x1f')]);}_0x5ca7c7['order']=qs[_0x7080('0x3e')](_0x16bd4c[_0x7080('0x38')][_0x7080('0x3e')]);_0x5ca7c7['where']=qs[_0x7080('0x3f')](_[_0x7080('0x40')](_0x16bd4c[_0x7080('0x38')],_0x3d3614['filters']),_0x2f9f47);if(_0x16bd4c[_0x7080('0x38')]['filter']){_0x5ca7c7[_0x7080('0x41')]=_[_0x7080('0x42')](_0x5ca7c7[_0x7080('0x41')],{'$or':_[_0x7080('0x43')](_0x2f9f47,function(_0x5f4cc8){if(_0x5f4cc8['type']!==_0x7080('0x44')){var _0x3f6844={};_0x3f6844[_0x5f4cc8['name']]={'$like':'%'+_0x16bd4c[_0x7080('0x38')][_0x7080('0x45')]+'%'};return _0x3f6844;}})});}_0x5ca7c7=_[_0x7080('0x42')]({},_0x5ca7c7,_0x16bd4c[_0x7080('0x46')]);var _0x12a69c={'where':_0x5ca7c7['where']};return db['Trigger'][_0x7080('0x47')](_0x12a69c)[_0x7080('0x29')](function(_0x3e359b){_0xdda243[_0x7080('0x47')]=_0x3e359b;if(_0x16bd4c[_0x7080('0x38')][_0x7080('0x48')]){_0x5ca7c7[_0x7080('0x49')]=[{'all':!![]}];}return db[_0x7080('0x4a')]['findAll'](_0x5ca7c7);})[_0x7080('0x29')](function(_0x1f34f6){_0xdda243[_0x7080('0x4b')]=_0x1f34f6;return _0xdda243;})[_0x7080('0x29')](respondWithFilteredResult(_0x4e654e,_0x5ca7c7))['catch'](handleError(_0x4e654e,null));};exports[_0x7080('0x4c')]=function(_0x28ffe5,_0x1b9abc){var _0x512a1c={'raw':![],'where':{'id':_0x28ffe5[_0x7080('0x4d')]['id']}},_0xbd518={};_0xbd518[_0x7080('0x37')]=_[_0x7080('0x39')](db[_0x7080('0x4a')][_0x7080('0x33')]);_0xbd518['query']=_[_0x7080('0x39')](_0x28ffe5[_0x7080('0x38')]);_0xbd518[_0x7080('0x3f')]=_[_0x7080('0x3a')](_0xbd518[_0x7080('0x37')],_0xbd518[_0x7080('0x38')]);_0x512a1c[_0x7080('0x3c')]=_[_0x7080('0x3a')](_0xbd518[_0x7080('0x37')],qs[_0x7080('0x3b')](_0x28ffe5[_0x7080('0x38')][_0x7080('0x3b')]));_0x512a1c['attributes']=_0x512a1c['attributes']['length']?_0x512a1c['attributes']:_0xbd518[_0x7080('0x37')];if(_0x28ffe5[_0x7080('0x38')][_0x7080('0x48')]){_0x512a1c[_0x7080('0x49')]=[{'all':!![]}];}_0x512a1c=_[_0x7080('0x42')]({},_0x512a1c,_0x28ffe5[_0x7080('0x46')]);return db['Trigger']['find'](_0x512a1c)['then'](handleEntityNotFound(_0x1b9abc,null))[_0x7080('0x29')](respondWithResult(_0x1b9abc,null))['catch'](handleError(_0x1b9abc,null));};exports['create']=function(_0x5a1deb,_0x2066f1){return db[_0x7080('0x4a')][_0x7080('0x4e')](_0x5a1deb[_0x7080('0x4f')],{})[_0x7080('0x29')](function(_0x47608b){var _0xaaef10=_0x5a1deb[_0x7080('0x50')][_0x7080('0x2b')]({'plain':!![]});if(!_0xaaef10)throw new Error(_0x7080('0x51'));if(_0xaaef10[_0x7080('0x52')]===_0x7080('0x50')){var _0x44fcc2=_0x47608b[_0x7080('0x2b')]({'plain':!![]});var _0x9b934f='Triggers';return db[_0x7080('0x53')]['find']({'where':{'name':_0x9b934f,'userProfileId':_0xaaef10[_0x7080('0x54')]},'raw':!![]})[_0x7080('0x29')](function(_0x16b1b1){if(_0x16b1b1&&_0x16b1b1[_0x7080('0x55')]===0x0){return db[_0x7080('0x2d')]['create']({'name':_0x44fcc2[_0x7080('0x30')],'resourceId':_0x44fcc2['id'],'type':_0x16b1b1['name'],'sectionId':_0x16b1b1['id']},{})[_0x7080('0x29')](function(){return _0x47608b;});}else{return _0x47608b;}})[_0x7080('0x56')](function(_0x47cb8b){logger[_0x7080('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47cb8b);throw _0x47cb8b;});}return _0x47608b;})[_0x7080('0x29')](respondWithResult(_0x2066f1,0xc9))['catch'](handleError(_0x2066f1,null));};exports['update']=function(_0xf66e7b,_0x474cc8){if(_0xf66e7b[_0x7080('0x4f')]['id']){delete _0xf66e7b[_0x7080('0x4f')]['id'];}return db['Trigger']['find']({'where':{'id':_0xf66e7b[_0x7080('0x4d')]['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x474cc8,null))[_0x7080('0x29')](saveUpdates(_0xf66e7b[_0x7080('0x4f')],null))[_0x7080('0x29')](respondWithResult(_0x474cc8,null))[_0x7080('0x56')](handleError(_0x474cc8,null));};exports['destroy']=function(_0x96de1f,_0x4432b6){return db[_0x7080('0x4a')][_0x7080('0x57')]({'where':{'id':_0x96de1f['params']['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x4432b6,null))[_0x7080('0x29')](removeEntity(_0x4432b6,null))[_0x7080('0x56')](handleError(_0x4432b6,null));};exports['addAllCondition']=function(_0xf69a3c,_0x154169,_0x5d0e60){if(_0xf69a3c[_0x7080('0x4f')]['id']){delete _0xf69a3c[_0x7080('0x4f')]['id'];}return db[_0x7080('0x4a')][_0x7080('0x57')]({'where':{'id':_0xf69a3c[_0x7080('0x4d')]['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x154169,null))[_0x7080('0x29')](function(_0x59fa9b){if(_0x59fa9b){_0xf69a3c[_0x7080('0x4f')][_0x7080('0x58')]=_0x59fa9b['id'];return db[_0x7080('0x59')]['create'](_0xf69a3c['body']);}})[_0x7080('0x29')](respondWithResult(_0x154169,null))[_0x7080('0x56')](handleError(_0x154169,null));};exports[_0x7080('0x5a')]=function(_0x620154,_0x55ad0d,_0x572017){if(_0x620154[_0x7080('0x4f')]['id']){delete _0x620154[_0x7080('0x4f')]['id'];}return db[_0x7080('0x4a')][_0x7080('0x57')]({'where':{'id':_0x620154[_0x7080('0x4d')]['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x55ad0d,null))[_0x7080('0x29')](function(_0x12f9f6){if(_0x12f9f6){_0x620154[_0x7080('0x4f')][_0x7080('0x5b')]=_0x12f9f6['id'];return db['Condition'][_0x7080('0x4e')](_0x620154[_0x7080('0x4f')]);}})[_0x7080('0x29')](respondWithResult(_0x55ad0d,null))[_0x7080('0x56')](handleError(_0x55ad0d,null));};exports['getAllConditions']=function(_0x33d7cc,_0x333e10,_0x38527d){var _0x5de89e={};var _0x36a5ac={};var _0x4237c3;var _0x1466d5;return db[_0x7080('0x4a')][_0x7080('0x5c')]({'where':{'id':_0x33d7cc[_0x7080('0x4d')]['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x333e10,null))[_0x7080('0x29')](function(_0x2bb29e){if(_0x2bb29e){_0x4237c3=_0x2bb29e;_0x36a5ac[_0x7080('0x37')]=_['keys'](db[_0x7080('0x59')][_0x7080('0x33')]);_0x36a5ac[_0x7080('0x38')]=_[_0x7080('0x39')](_0x33d7cc[_0x7080('0x38')]);_0x36a5ac[_0x7080('0x3f')]=_[_0x7080('0x3a')](_0x36a5ac['model'],_0x36a5ac[_0x7080('0x38')]);_0x5de89e[_0x7080('0x3c')]=_['intersection'](_0x36a5ac[_0x7080('0x37')],qs[_0x7080('0x3b')](_0x33d7cc[_0x7080('0x38')][_0x7080('0x3b')]));_0x5de89e[_0x7080('0x3c')]=_0x5de89e[_0x7080('0x3c')]['length']?_0x5de89e[_0x7080('0x3c')]:_0x36a5ac[_0x7080('0x37')];_0x5de89e[_0x7080('0x5d')]=qs[_0x7080('0x3e')](_0x33d7cc['query'][_0x7080('0x3e')]);_0x5de89e['where']=qs[_0x7080('0x3f')](_[_0x7080('0x40')](_0x33d7cc[_0x7080('0x38')],_0x36a5ac[_0x7080('0x3f')]));if(_0x33d7cc[_0x7080('0x38')]['filter']){_0x5de89e[_0x7080('0x41')]=_[_0x7080('0x42')](_0x5de89e['where'],{'$or':_[_0x7080('0x43')](_0x5de89e['attributes'],function(_0x4c6586){var _0x45a32e={};_0x45a32e[_0x4c6586]={'$like':'%'+_0x33d7cc[_0x7080('0x38')][_0x7080('0x45')]+'%'};return _0x45a32e;})});}_0x5de89e=_[_0x7080('0x42')]({},_0x5de89e,_0x33d7cc[_0x7080('0x46')]);return _0x4237c3[_0x7080('0x5e')](_0x5de89e);}})[_0x7080('0x29')](function(_0x5e749e){if(_0x5e749e){_0x1466d5=_0x5e749e[_0x7080('0x5f')];if(!_0x33d7cc['query'][_0x7080('0x60')]('nolimit')){_0x5de89e[_0x7080('0x21')]=qs[_0x7080('0x21')](_0x33d7cc['query'][_0x7080('0x21')]);_0x5de89e['offset']=qs['offset'](_0x33d7cc['query'][_0x7080('0x1f')]);}return _0x4237c3[_0x7080('0x5e')](_0x5de89e);}})[_0x7080('0x29')](function(_0x7610d){if(_0x7610d){return _0x7610d?{'count':_0x1466d5,'rows':_0x7610d}:null;}})[_0x7080('0x29')](respondWithResult(_0x333e10,null))[_0x7080('0x56')](handleError(_0x333e10,null));};exports[_0x7080('0x61')]=function(_0x570366,_0x24817f,_0x12a371){var _0x1aa0c5={};var _0x5576e6={};var _0x1d5742;var _0x477487;return db[_0x7080('0x4a')]['findOne']({'where':{'id':_0x570366['params']['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x24817f,null))['then'](function(_0x12bfdc){if(_0x12bfdc){_0x1d5742=_0x12bfdc;_0x5576e6[_0x7080('0x37')]=_[_0x7080('0x39')](db[_0x7080('0x59')][_0x7080('0x33')]);_0x5576e6[_0x7080('0x38')]=_[_0x7080('0x39')](_0x570366[_0x7080('0x38')]);_0x5576e6['filters']=_['intersection'](_0x5576e6[_0x7080('0x37')],_0x5576e6[_0x7080('0x38')]);_0x1aa0c5[_0x7080('0x3c')]=_[_0x7080('0x3a')](_0x5576e6[_0x7080('0x37')],qs[_0x7080('0x3b')](_0x570366[_0x7080('0x38')][_0x7080('0x3b')]));_0x1aa0c5['attributes']=_0x1aa0c5[_0x7080('0x3c')][_0x7080('0x5f')]?_0x1aa0c5[_0x7080('0x3c')]:_0x5576e6[_0x7080('0x37')];_0x1aa0c5[_0x7080('0x5d')]=qs[_0x7080('0x3e')](_0x570366[_0x7080('0x38')][_0x7080('0x3e')]);_0x1aa0c5['where']=qs[_0x7080('0x3f')](_[_0x7080('0x40')](_0x570366[_0x7080('0x38')],_0x5576e6[_0x7080('0x3f')]));if(_0x570366[_0x7080('0x38')][_0x7080('0x45')]){_0x1aa0c5[_0x7080('0x41')]=_[_0x7080('0x42')](_0x1aa0c5[_0x7080('0x41')],{'$or':_[_0x7080('0x43')](_0x1aa0c5[_0x7080('0x3c')],function(_0x3f6a2b){var _0x2273df={};_0x2273df[_0x3f6a2b]={'$like':'%'+_0x570366['query'][_0x7080('0x45')]+'%'};return _0x2273df;})});}_0x1aa0c5=_[_0x7080('0x42')]({},_0x1aa0c5,_0x570366[_0x7080('0x46')]);return _0x1d5742[_0x7080('0x61')](_0x1aa0c5);}})[_0x7080('0x29')](function(_0x1a4e6b){if(_0x1a4e6b){_0x477487=_0x1a4e6b[_0x7080('0x5f')];if(!_0x570366[_0x7080('0x38')][_0x7080('0x60')](_0x7080('0x3d'))){_0x1aa0c5[_0x7080('0x21')]=qs['limit'](_0x570366[_0x7080('0x38')]['limit']);_0x1aa0c5[_0x7080('0x1f')]=qs[_0x7080('0x1f')](_0x570366[_0x7080('0x38')][_0x7080('0x1f')]);}return _0x1d5742['getAnyConditions'](_0x1aa0c5);}})['then'](function(_0x268123){if(_0x268123){return _0x268123?{'count':_0x477487,'rows':_0x268123}:null;}})[_0x7080('0x29')](respondWithResult(_0x24817f,null))[_0x7080('0x56')](handleError(_0x24817f,null));};exports['addAction']=function(_0x89ec0a,_0x470a05,_0x42f94e){if(_0x89ec0a[_0x7080('0x4f')]['id']){delete _0x89ec0a[_0x7080('0x4f')]['id'];}return db[_0x7080('0x4a')]['find']({'where':{'id':_0x89ec0a['params']['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x470a05,null))[_0x7080('0x29')](function(_0x1a4c54){if(_0x1a4c54){_0x89ec0a[_0x7080('0x4f')][_0x7080('0x62')]=_0x1a4c54['id'];return db[_0x7080('0x63')][_0x7080('0x4e')](_0x89ec0a['body']);}})[_0x7080('0x29')](respondWithResult(_0x470a05,null))[_0x7080('0x56')](handleError(_0x470a05,null));};exports[_0x7080('0x64')]=function(_0x14420e,_0x472c45,_0x232880){var _0x16b0ce={};var _0x146693={};var _0x5a543b;var _0x45db1c;return db['Trigger'][_0x7080('0x5c')]({'where':{'id':_0x14420e[_0x7080('0x4d')]['id']}})['then'](handleEntityNotFound(_0x472c45,null))[_0x7080('0x29')](function(_0x34f075){if(_0x34f075){_0x5a543b=_0x34f075;_0x146693[_0x7080('0x37')]=_[_0x7080('0x39')](db[_0x7080('0x63')]['rawAttributes']);_0x146693[_0x7080('0x38')]=_[_0x7080('0x39')](_0x14420e[_0x7080('0x38')]);_0x146693[_0x7080('0x3f')]=_[_0x7080('0x3a')](_0x146693['model'],_0x146693[_0x7080('0x38')]);_0x16b0ce[_0x7080('0x3c')]=_[_0x7080('0x3a')](_0x146693[_0x7080('0x37')],qs[_0x7080('0x3b')](_0x14420e[_0x7080('0x38')][_0x7080('0x3b')]));_0x16b0ce[_0x7080('0x3c')]=_0x16b0ce['attributes']['length']?_0x16b0ce['attributes']:_0x146693['model'];_0x16b0ce[_0x7080('0x5d')]=qs[_0x7080('0x3e')](_0x14420e[_0x7080('0x38')]['sort']);_0x16b0ce[_0x7080('0x41')]=qs['filters'](_['pick'](_0x14420e['query'],_0x146693['filters']));if(_0x14420e['query'][_0x7080('0x45')]){_0x16b0ce['where']=_[_0x7080('0x42')](_0x16b0ce[_0x7080('0x41')],{'$or':_[_0x7080('0x43')](_0x16b0ce[_0x7080('0x3c')],function(_0x4b306e){var _0x293ac0={};_0x293ac0[_0x4b306e]={'$like':'%'+_0x14420e['query'][_0x7080('0x45')]+'%'};return _0x293ac0;})});}_0x16b0ce=_[_0x7080('0x42')]({},_0x16b0ce,_0x14420e[_0x7080('0x46')]);return _0x5a543b[_0x7080('0x64')](_0x16b0ce);}})[_0x7080('0x29')](function(_0x16a535){if(_0x16a535){_0x45db1c=_0x16a535[_0x7080('0x5f')];if(!_0x14420e['query'][_0x7080('0x60')](_0x7080('0x3d'))){_0x16b0ce[_0x7080('0x21')]=qs[_0x7080('0x21')](_0x14420e[_0x7080('0x38')][_0x7080('0x21')]);_0x16b0ce['offset']=qs['offset'](_0x14420e[_0x7080('0x38')][_0x7080('0x1f')]);}return _0x5a543b['getActions'](_0x16b0ce);}})[_0x7080('0x29')](function(_0x54398e){if(_0x54398e){return _0x54398e?{'count':_0x45db1c,'rows':_0x54398e}:null;}})[_0x7080('0x29')](respondWithResult(_0x472c45,null))[_0x7080('0x56')](handleError(_0x472c45,null));}; \ No newline at end of file +var _0x084b=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trigger','includeAll','include','findAll','rows','catch','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Triggers','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','addAllCondition','TriggerAllId','addAnyCondition','Condition','getAllConditions','findOne','pick','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','path','to-csv','fs-extra','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'];(function(_0x3c1589,_0x4aea51){var _0x566059=function(_0x4b6fec){while(--_0x4b6fec){_0x3c1589['push'](_0x3c1589['shift']());}};_0x566059(++_0x4aea51);}(_0x084b,0xa5));var _0xb084=function(_0x118e2c,_0x49395d){_0x118e2c=_0x118e2c-0x0;var _0x4741e9=_0x084b[_0x118e2c];return _0x4741e9;};'use strict';var emlformat=require(_0xb084('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb084('0x1'));var jsonpatch=require(_0xb084('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb084('0x3'));var sox=require('sox');var csv=require(_0xb084('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb084('0x5'));var _=require('lodash');var squel=require(_0xb084('0x6'));var crypto=require(_0xb084('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xb084('0x8'));var toCsv=require(_0xb084('0x4'));var querystring=require(_0xb084('0x9'));var Papa=require(_0xb084('0xa'));var Redis=require(_0xb084('0xb'));var authService=require(_0xb084('0xc'));var qs=require(_0xb084('0xd'));var as=require(_0xb084('0xe'));var hardwareService=require(_0xb084('0xf'));var logger=require(_0xb084('0x10'))(_0xb084('0x11'));var utils=require('../../config/utils');var config=require(_0xb084('0x12'));var licenseUtil=require(_0xb084('0x13'));var db=require(_0xb084('0x14'))['db'];function respondWithStatusCode(_0x35054b,_0x342c58){_0x342c58=_0x342c58||0xcc;return function(_0x20b57a){if(_0x20b57a){return _0x35054b['sendStatus'](_0x342c58);}return _0x35054b[_0xb084('0x15')](_0x342c58)[_0xb084('0x16')]();};}function respondWithResult(_0xa3421,_0x55e9d6){_0x55e9d6=_0x55e9d6||0xc8;return function(_0x23b36b){if(_0x23b36b){return _0xa3421[_0xb084('0x15')](_0x55e9d6)[_0xb084('0x17')](_0x23b36b);}};}function respondWithFilteredResult(_0xd8ccb7,_0x5da141){return function(_0x52a393){if(_0x52a393){var _0x4b32a2=typeof _0x5da141[_0xb084('0x18')]===_0xb084('0x19')&&typeof _0x5da141[_0xb084('0x1a')]===_0xb084('0x19');var _0xdec903=_0x52a393[_0xb084('0x1b')];var _0x40c535=_0x4b32a2?0x0:_0x5da141['offset'];var _0x1ddbbd=_0x4b32a2?_0x52a393[_0xb084('0x1b')]:_0x5da141[_0xb084('0x18')]+_0x5da141['limit'];var _0x3e501d;if(_0x1ddbbd>=_0xdec903){_0x1ddbbd=_0xdec903;_0x3e501d=0xc8;}else{_0x3e501d=0xce;}_0xd8ccb7['status'](_0x3e501d);return _0xd8ccb7[_0xb084('0x1c')](_0xb084('0x1d'),_0x40c535+'-'+_0x1ddbbd+'/'+_0xdec903)['json'](_0x52a393);}return null;};}function patchUpdates(_0x32fcf8){return function(_0x857818){try{jsonpatch[_0xb084('0x1e')](_0x857818,_0x32fcf8,!![]);}catch(_0x222f6c){return BPromise[_0xb084('0x1f')](_0x222f6c);}return _0x857818[_0xb084('0x20')]();};}function saveUpdates(_0x161e64,_0x4e321b){return function(_0x11e29c){if(_0x11e29c){return _0x11e29c[_0xb084('0x21')](_0x161e64)[_0xb084('0x22')](function(_0x525c33){return _0x525c33;});}return null;};}function removeEntity(_0x2e1729,_0x23975e){return function(_0x532fd3){if(_0x532fd3){return _0x532fd3[_0xb084('0x23')]()['then'](function(){var _0x2449d2=_0x532fd3[_0xb084('0x24')]({'plain':!![]});var _0x786af1='Triggers';return db['UserProfileResource'][_0xb084('0x23')]({'where':{'type':_0x786af1,'resourceId':_0x2449d2['id']}})[_0xb084('0x22')](function(){return _0x532fd3;});})['then'](function(){_0x2e1729[_0xb084('0x15')](0xcc)[_0xb084('0x16')]();});}};}function handleEntityNotFound(_0x50be0e,_0x3e2ba7){return function(_0x1cad03){if(!_0x1cad03){_0x50be0e[_0xb084('0x25')](0x194);}return _0x1cad03;};}function handleError(_0x609ad8,_0x3c4896){_0x3c4896=_0x3c4896||0x1f4;return function(_0x4ce8e3){logger[_0xb084('0x26')](_0x4ce8e3[_0xb084('0x27')]);if(_0x4ce8e3[_0xb084('0x28')]){delete _0x4ce8e3[_0xb084('0x28')];}_0x609ad8[_0xb084('0x15')](_0x3c4896)[_0xb084('0x29')](_0x4ce8e3);};}exports[_0xb084('0x2a')]=function(_0x277925,_0x30ffee){var _0x1e66f1={},_0x6940ea={},_0x470c10={'count':0x0,'rows':[]};var _0x31b72d=_[_0xb084('0x2b')](db['Trigger'][_0xb084('0x2c')],function(_0x3fd149){return{'name':_0x3fd149['fieldName'],'type':_0x3fd149[_0xb084('0x2d')][_0xb084('0x2e')]};});_0x6940ea[_0xb084('0x2f')]=_['map'](_0x31b72d,_0xb084('0x28'));_0x6940ea[_0xb084('0x30')]=_[_0xb084('0x31')](_0x277925[_0xb084('0x30')]);_0x6940ea[_0xb084('0x32')]=_['intersection'](_0x6940ea[_0xb084('0x2f')],_0x6940ea[_0xb084('0x30')]);_0x1e66f1[_0xb084('0x33')]=_[_0xb084('0x34')](_0x6940ea[_0xb084('0x2f')],qs[_0xb084('0x35')](_0x277925[_0xb084('0x30')][_0xb084('0x35')]));_0x1e66f1[_0xb084('0x33')]=_0x1e66f1[_0xb084('0x33')][_0xb084('0x36')]?_0x1e66f1['attributes']:_0x6940ea[_0xb084('0x2f')];if(!_0x277925[_0xb084('0x30')][_0xb084('0x37')](_0xb084('0x38'))){_0x1e66f1[_0xb084('0x1a')]=qs['limit'](_0x277925[_0xb084('0x30')]['limit']);_0x1e66f1[_0xb084('0x18')]=qs[_0xb084('0x18')](_0x277925['query'][_0xb084('0x18')]);}_0x1e66f1[_0xb084('0x39')]=qs[_0xb084('0x3a')](_0x277925[_0xb084('0x30')][_0xb084('0x3a')]);_0x1e66f1[_0xb084('0x3b')]=qs[_0xb084('0x32')](_['pick'](_0x277925[_0xb084('0x30')],_0x6940ea['filters']),_0x31b72d);if(_0x277925['query'][_0xb084('0x3c')]){_0x1e66f1[_0xb084('0x3b')]=_[_0xb084('0x3d')](_0x1e66f1['where'],{'$or':_[_0xb084('0x2b')](_0x31b72d,function(_0xad57d8){if(_0xad57d8[_0xb084('0x2d')]!==_0xb084('0x3e')){var _0x1575b4={};_0x1575b4[_0xad57d8[_0xb084('0x28')]]={'$like':'%'+_0x277925[_0xb084('0x30')][_0xb084('0x3c')]+'%'};return _0x1575b4;}})});}_0x1e66f1=_[_0xb084('0x3d')]({},_0x1e66f1,_0x277925[_0xb084('0x3f')]);var _0x33b8b6={'where':_0x1e66f1[_0xb084('0x3b')]};return db[_0xb084('0x40')][_0xb084('0x1b')](_0x33b8b6)[_0xb084('0x22')](function(_0x42a239){_0x470c10[_0xb084('0x1b')]=_0x42a239;if(_0x277925[_0xb084('0x30')][_0xb084('0x41')]){_0x1e66f1[_0xb084('0x42')]=[{'all':!![]}];}return db[_0xb084('0x40')][_0xb084('0x43')](_0x1e66f1);})[_0xb084('0x22')](function(_0x57ff45){_0x470c10[_0xb084('0x44')]=_0x57ff45;return _0x470c10;})[_0xb084('0x22')](respondWithFilteredResult(_0x30ffee,_0x1e66f1))[_0xb084('0x45')](handleError(_0x30ffee,null));};exports['show']=function(_0x1d933c,_0x5e5102){var _0x1b2804={'raw':![],'where':{'id':_0x1d933c[_0xb084('0x46')]['id']}},_0x878f84={};_0x878f84[_0xb084('0x2f')]=_[_0xb084('0x31')](db[_0xb084('0x40')][_0xb084('0x2c')]);_0x878f84[_0xb084('0x30')]=_[_0xb084('0x31')](_0x1d933c[_0xb084('0x30')]);_0x878f84[_0xb084('0x32')]=_[_0xb084('0x34')](_0x878f84[_0xb084('0x2f')],_0x878f84[_0xb084('0x30')]);_0x1b2804[_0xb084('0x33')]=_[_0xb084('0x34')](_0x878f84[_0xb084('0x2f')],qs[_0xb084('0x35')](_0x1d933c[_0xb084('0x30')][_0xb084('0x35')]));_0x1b2804['attributes']=_0x1b2804[_0xb084('0x33')][_0xb084('0x36')]?_0x1b2804[_0xb084('0x33')]:_0x878f84['model'];if(_0x1d933c['query'][_0xb084('0x41')]){_0x1b2804[_0xb084('0x42')]=[{'all':!![]}];}_0x1b2804=_[_0xb084('0x3d')]({},_0x1b2804,_0x1d933c['options']);return db['Trigger']['find'](_0x1b2804)['then'](handleEntityNotFound(_0x5e5102,null))[_0xb084('0x22')](respondWithResult(_0x5e5102,null))[_0xb084('0x45')](handleError(_0x5e5102,null));};exports[_0xb084('0x47')]=function(_0x793adf,_0x13caa2){return db['Trigger'][_0xb084('0x47')](_0x793adf[_0xb084('0x48')],{})[_0xb084('0x22')](function(_0x48743c){var _0x5d48df=_0x793adf['user'][_0xb084('0x24')]({'plain':!![]});if(!_0x5d48df)throw new Error(_0xb084('0x49'));if(_0x5d48df['role']===_0xb084('0x4a')){var _0x562927=_0x48743c[_0xb084('0x24')]({'plain':!![]});var _0x56095d=_0xb084('0x4b');return db[_0xb084('0x4c')][_0xb084('0x4d')]({'where':{'name':_0x56095d,'userProfileId':_0x5d48df[_0xb084('0x4e')]},'raw':!![]})[_0xb084('0x22')](function(_0x502564){if(_0x502564&&_0x502564[_0xb084('0x4f')]===0x0){return db[_0xb084('0x50')]['create']({'name':_0x562927['name'],'resourceId':_0x562927['id'],'type':_0x502564[_0xb084('0x28')],'sectionId':_0x502564['id']},{})[_0xb084('0x22')](function(){return _0x48743c;});}else{return _0x48743c;}})[_0xb084('0x45')](function(_0x4bf0b4){logger[_0xb084('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bf0b4);throw _0x4bf0b4;});}return _0x48743c;})[_0xb084('0x22')](respondWithResult(_0x13caa2,0xc9))[_0xb084('0x45')](handleError(_0x13caa2,null));};exports[_0xb084('0x21')]=function(_0x33d2d3,_0x26c3da){if(_0x33d2d3[_0xb084('0x48')]['id']){delete _0x33d2d3[_0xb084('0x48')]['id'];}return db[_0xb084('0x40')][_0xb084('0x4d')]({'where':{'id':_0x33d2d3['params']['id']}})[_0xb084('0x22')](handleEntityNotFound(_0x26c3da,null))['then'](saveUpdates(_0x33d2d3[_0xb084('0x48')],null))[_0xb084('0x22')](respondWithResult(_0x26c3da,null))['catch'](handleError(_0x26c3da,null));};exports[_0xb084('0x23')]=function(_0x34e398,_0xaa0b7c){return db[_0xb084('0x40')][_0xb084('0x4d')]({'where':{'id':_0x34e398[_0xb084('0x46')]['id']}})[_0xb084('0x22')](handleEntityNotFound(_0xaa0b7c,null))[_0xb084('0x22')](removeEntity(_0xaa0b7c,null))[_0xb084('0x45')](handleError(_0xaa0b7c,null));};exports[_0xb084('0x51')]=function(_0x1478fa,_0xa0f7a5,_0x2ca9c3){if(_0x1478fa[_0xb084('0x48')]['id']){delete _0x1478fa[_0xb084('0x48')]['id'];}return db[_0xb084('0x40')][_0xb084('0x4d')]({'where':{'id':_0x1478fa['params']['id']}})[_0xb084('0x22')](handleEntityNotFound(_0xa0f7a5,null))[_0xb084('0x22')](function(_0x23782e){if(_0x23782e){_0x1478fa[_0xb084('0x48')][_0xb084('0x52')]=_0x23782e['id'];return db['Condition'][_0xb084('0x47')](_0x1478fa[_0xb084('0x48')]);}})[_0xb084('0x22')](respondWithResult(_0xa0f7a5,null))[_0xb084('0x45')](handleError(_0xa0f7a5,null));};exports[_0xb084('0x53')]=function(_0x27f027,_0x1fe5b4,_0x3a20e4){if(_0x27f027[_0xb084('0x48')]['id']){delete _0x27f027[_0xb084('0x48')]['id'];}return db[_0xb084('0x40')][_0xb084('0x4d')]({'where':{'id':_0x27f027[_0xb084('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fe5b4,null))[_0xb084('0x22')](function(_0x21153d){if(_0x21153d){_0x27f027[_0xb084('0x48')]['TriggerAnyId']=_0x21153d['id'];return db[_0xb084('0x54')][_0xb084('0x47')](_0x27f027[_0xb084('0x48')]);}})[_0xb084('0x22')](respondWithResult(_0x1fe5b4,null))[_0xb084('0x45')](handleError(_0x1fe5b4,null));};exports[_0xb084('0x55')]=function(_0x3a7b13,_0x12f8b3,_0x5ed2aa){var _0x896b1f={};var _0x4226fb={};var _0x469b1e;var _0x29044b;return db['Trigger'][_0xb084('0x56')]({'where':{'id':_0x3a7b13[_0xb084('0x46')]['id']}})[_0xb084('0x22')](handleEntityNotFound(_0x12f8b3,null))[_0xb084('0x22')](function(_0x54b3ba){if(_0x54b3ba){_0x469b1e=_0x54b3ba;_0x4226fb[_0xb084('0x2f')]=_['keys'](db[_0xb084('0x54')][_0xb084('0x2c')]);_0x4226fb[_0xb084('0x30')]=_[_0xb084('0x31')](_0x3a7b13[_0xb084('0x30')]);_0x4226fb['filters']=_['intersection'](_0x4226fb[_0xb084('0x2f')],_0x4226fb['query']);_0x896b1f[_0xb084('0x33')]=_[_0xb084('0x34')](_0x4226fb[_0xb084('0x2f')],qs[_0xb084('0x35')](_0x3a7b13[_0xb084('0x30')]['fields']));_0x896b1f[_0xb084('0x33')]=_0x896b1f[_0xb084('0x33')][_0xb084('0x36')]?_0x896b1f[_0xb084('0x33')]:_0x4226fb[_0xb084('0x2f')];_0x896b1f[_0xb084('0x39')]=qs[_0xb084('0x3a')](_0x3a7b13[_0xb084('0x30')][_0xb084('0x3a')]);_0x896b1f[_0xb084('0x3b')]=qs['filters'](_[_0xb084('0x57')](_0x3a7b13[_0xb084('0x30')],_0x4226fb[_0xb084('0x32')]));if(_0x3a7b13[_0xb084('0x30')]['filter']){_0x896b1f[_0xb084('0x3b')]=_[_0xb084('0x3d')](_0x896b1f[_0xb084('0x3b')],{'$or':_['map'](_0x896b1f[_0xb084('0x33')],function(_0x18bac2){var _0xc77ff6={};_0xc77ff6[_0x18bac2]={'$like':'%'+_0x3a7b13['query'][_0xb084('0x3c')]+'%'};return _0xc77ff6;})});}_0x896b1f=_[_0xb084('0x3d')]({},_0x896b1f,_0x3a7b13['options']);return _0x469b1e[_0xb084('0x55')](_0x896b1f);}})[_0xb084('0x22')](function(_0x348e0e){if(_0x348e0e){_0x29044b=_0x348e0e['length'];if(!_0x3a7b13['query'][_0xb084('0x37')](_0xb084('0x38'))){_0x896b1f['limit']=qs[_0xb084('0x1a')](_0x3a7b13[_0xb084('0x30')]['limit']);_0x896b1f[_0xb084('0x18')]=qs['offset'](_0x3a7b13['query'][_0xb084('0x18')]);}return _0x469b1e['getAllConditions'](_0x896b1f);}})[_0xb084('0x22')](function(_0x14a084){if(_0x14a084){return _0x14a084?{'count':_0x29044b,'rows':_0x14a084}:null;}})[_0xb084('0x22')](respondWithResult(_0x12f8b3,null))[_0xb084('0x45')](handleError(_0x12f8b3,null));};exports[_0xb084('0x58')]=function(_0x9904f0,_0x2d33e6,_0xa292b3){var _0x3759c3={};var _0x1e30e3={};var _0x2347bc;var _0x3492e8;return db[_0xb084('0x40')]['findOne']({'where':{'id':_0x9904f0[_0xb084('0x46')]['id']}})[_0xb084('0x22')](handleEntityNotFound(_0x2d33e6,null))[_0xb084('0x22')](function(_0x4c0476){if(_0x4c0476){_0x2347bc=_0x4c0476;_0x1e30e3['model']=_[_0xb084('0x31')](db['Condition']['rawAttributes']);_0x1e30e3[_0xb084('0x30')]=_[_0xb084('0x31')](_0x9904f0[_0xb084('0x30')]);_0x1e30e3[_0xb084('0x32')]=_[_0xb084('0x34')](_0x1e30e3['model'],_0x1e30e3[_0xb084('0x30')]);_0x3759c3['attributes']=_[_0xb084('0x34')](_0x1e30e3[_0xb084('0x2f')],qs[_0xb084('0x35')](_0x9904f0[_0xb084('0x30')][_0xb084('0x35')]));_0x3759c3[_0xb084('0x33')]=_0x3759c3[_0xb084('0x33')]['length']?_0x3759c3[_0xb084('0x33')]:_0x1e30e3[_0xb084('0x2f')];_0x3759c3[_0xb084('0x39')]=qs[_0xb084('0x3a')](_0x9904f0[_0xb084('0x30')][_0xb084('0x3a')]);_0x3759c3[_0xb084('0x3b')]=qs[_0xb084('0x32')](_[_0xb084('0x57')](_0x9904f0['query'],_0x1e30e3[_0xb084('0x32')]));if(_0x9904f0[_0xb084('0x30')][_0xb084('0x3c')]){_0x3759c3[_0xb084('0x3b')]=_['merge'](_0x3759c3[_0xb084('0x3b')],{'$or':_[_0xb084('0x2b')](_0x3759c3[_0xb084('0x33')],function(_0x31291b){var _0x1ac4c9={};_0x1ac4c9[_0x31291b]={'$like':'%'+_0x9904f0['query']['filter']+'%'};return _0x1ac4c9;})});}_0x3759c3=_['merge']({},_0x3759c3,_0x9904f0[_0xb084('0x3f')]);return _0x2347bc['getAnyConditions'](_0x3759c3);}})[_0xb084('0x22')](function(_0x5f1a22){if(_0x5f1a22){_0x3492e8=_0x5f1a22[_0xb084('0x36')];if(!_0x9904f0['query']['hasOwnProperty'](_0xb084('0x38'))){_0x3759c3[_0xb084('0x1a')]=qs['limit'](_0x9904f0[_0xb084('0x30')][_0xb084('0x1a')]);_0x3759c3[_0xb084('0x18')]=qs[_0xb084('0x18')](_0x9904f0[_0xb084('0x30')][_0xb084('0x18')]);}return _0x2347bc[_0xb084('0x58')](_0x3759c3);}})['then'](function(_0x286b79){if(_0x286b79){return _0x286b79?{'count':_0x3492e8,'rows':_0x286b79}:null;}})['then'](respondWithResult(_0x2d33e6,null))[_0xb084('0x45')](handleError(_0x2d33e6,null));};exports[_0xb084('0x59')]=function(_0x4e36cc,_0x2429c9,_0x59395d){if(_0x4e36cc[_0xb084('0x48')]['id']){delete _0x4e36cc['body']['id'];}return db[_0xb084('0x40')]['find']({'where':{'id':_0x4e36cc[_0xb084('0x46')]['id']}})['then'](handleEntityNotFound(_0x2429c9,null))[_0xb084('0x22')](function(_0x2bdd12){if(_0x2bdd12){_0x4e36cc[_0xb084('0x48')][_0xb084('0x5a')]=_0x2bdd12['id'];return db[_0xb084('0x5b')][_0xb084('0x47')](_0x4e36cc[_0xb084('0x48')]);}})[_0xb084('0x22')](respondWithResult(_0x2429c9,null))['catch'](handleError(_0x2429c9,null));};exports[_0xb084('0x5c')]=function(_0x45e26d,_0x1c5b18,_0x1920d7){var _0x584bf0={};var _0x4eed52={};var _0x27cd51;var _0x27ef32;return db[_0xb084('0x40')][_0xb084('0x56')]({'where':{'id':_0x45e26d['params']['id']}})[_0xb084('0x22')](handleEntityNotFound(_0x1c5b18,null))[_0xb084('0x22')](function(_0x4d7e21){if(_0x4d7e21){_0x27cd51=_0x4d7e21;_0x4eed52[_0xb084('0x2f')]=_[_0xb084('0x31')](db[_0xb084('0x5b')][_0xb084('0x2c')]);_0x4eed52[_0xb084('0x30')]=_[_0xb084('0x31')](_0x45e26d[_0xb084('0x30')]);_0x4eed52[_0xb084('0x32')]=_['intersection'](_0x4eed52['model'],_0x4eed52[_0xb084('0x30')]);_0x584bf0['attributes']=_['intersection'](_0x4eed52[_0xb084('0x2f')],qs[_0xb084('0x35')](_0x45e26d[_0xb084('0x30')][_0xb084('0x35')]));_0x584bf0[_0xb084('0x33')]=_0x584bf0[_0xb084('0x33')][_0xb084('0x36')]?_0x584bf0[_0xb084('0x33')]:_0x4eed52[_0xb084('0x2f')];_0x584bf0['order']=qs[_0xb084('0x3a')](_0x45e26d[_0xb084('0x30')][_0xb084('0x3a')]);_0x584bf0[_0xb084('0x3b')]=qs[_0xb084('0x32')](_[_0xb084('0x57')](_0x45e26d[_0xb084('0x30')],_0x4eed52[_0xb084('0x32')]));if(_0x45e26d[_0xb084('0x30')][_0xb084('0x3c')]){_0x584bf0[_0xb084('0x3b')]=_['merge'](_0x584bf0[_0xb084('0x3b')],{'$or':_['map'](_0x584bf0[_0xb084('0x33')],function(_0x4bae95){var _0x1fb9a={};_0x1fb9a[_0x4bae95]={'$like':'%'+_0x45e26d[_0xb084('0x30')][_0xb084('0x3c')]+'%'};return _0x1fb9a;})});}_0x584bf0=_[_0xb084('0x3d')]({},_0x584bf0,_0x45e26d['options']);return _0x27cd51[_0xb084('0x5c')](_0x584bf0);}})[_0xb084('0x22')](function(_0x292711){if(_0x292711){_0x27ef32=_0x292711[_0xb084('0x36')];if(!_0x45e26d[_0xb084('0x30')][_0xb084('0x37')]('nolimit')){_0x584bf0[_0xb084('0x1a')]=qs[_0xb084('0x1a')](_0x45e26d[_0xb084('0x30')][_0xb084('0x1a')]);_0x584bf0[_0xb084('0x18')]=qs[_0xb084('0x18')](_0x45e26d[_0xb084('0x30')][_0xb084('0x18')]);}return _0x27cd51['getActions'](_0x584bf0);}})['then'](function(_0x1cdc7f){if(_0x1cdc7f){return _0x1cdc7f?{'count':_0x27ef32,'rows':_0x1cdc7f}:null;}})[_0xb084('0x22')](respondWithResult(_0x1c5b18,null))[_0xb084('0x45')](handleError(_0x1c5b18,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 7cd5313..b84b7e9 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 _0x7b83=['request-promise','path','../../config/environment','./trigger.attributes','exports','define','tools_triggers','lodash','util','../../config/logger','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7b83,0xa1));var _0x37b8=function(_0x54a65c,_0x1554d5){_0x54a65c=_0x54a65c-0x0;var _0x53ccb7=_0x7b83[_0x54a65c];return _0x53ccb7;};'use strict';var _=require(_0x37b8('0x0'));var util=require(_0x37b8('0x1'));var logger=require(_0x37b8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x37b8('0x3'));var rp=require(_0x37b8('0x4'));var fs=require('fs');var path=require(_0x37b8('0x5'));var rimraf=require('rimraf');var config=require(_0x37b8('0x6'));var attributes=require(_0x37b8('0x7'));module[_0x37b8('0x8')]=function(_0x2a5439,_0x4102eb){return _0x2a5439[_0x37b8('0x9')]('Trigger',attributes,{'tableName':_0x37b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43fd=['Trigger','tools_triggers','util','moment','bluebird','path','../../config/environment','./trigger.attributes','exports','define'];(function(_0x11c11f,_0x4c447f){var _0x537082=function(_0x5bc3cb){while(--_0x5bc3cb){_0x11c11f['push'](_0x11c11f['shift']());}};_0x537082(++_0x4c447f);}(_0x43fd,0x1ec));var _0xd43f=function(_0x5ebc24,_0xfbae35){_0x5ebc24=_0x5ebc24-0x0;var _0x5a98b2=_0x43fd[_0x5ebc24];return _0x5a98b2;};'use strict';var _=require('lodash');var util=require(_0xd43f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd43f('0x1'));var BPromise=require(_0xd43f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd43f('0x3'));var rimraf=require('rimraf');var config=require(_0xd43f('0x4'));var attributes=require(_0xd43f('0x5'));module[_0xd43f('0x6')]=function(_0x33ddff,_0x52e75f){return _0x33ddff[_0xd43f('0x7')](_0xd43f('0x8'),attributes,{'tableName':_0xd43f('0x9'),'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 05e4402..d28a7bb 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 _0xa9dd=['info','catch','GetTrigger','findAll','options','raw','where','attributes','map','include','model','debug','find','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5c0488,_0xf1cb3b){var _0x30e6e8=function(_0x58132a){while(--_0x58132a){_0x5c0488['push'](_0x5c0488['shift']());}};_0x30e6e8(++_0xf1cb3b);}(_0xa9dd,0xe0));var _0xda9d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa9dd[_0x432682];return _0x463d05;};'use strict';var _=require(_0xda9d('0x0'));var util=require(_0xda9d('0x1'));var moment=require(_0xda9d('0x2'));var BPromise=require(_0xda9d('0x3'));var rs=require(_0xda9d('0x4'));var fs=require('fs');var Redis=require(_0xda9d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xda9d('0x6'));var logger=require(_0xda9d('0x7'))(_0xda9d('0x8'));var config=require(_0xda9d('0x9'));var jayson=require(_0xda9d('0xa'));var client=jayson[_0xda9d('0xb')][_0xda9d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38e3a3,_0x2f5a92,_0x5c60e8){return new BPromise(function(_0x319dab,_0x18a46e){return client['request'](_0x38e3a3,_0x5c60e8)[_0xda9d('0xd')](function(_0x513fd1){logger['info'](_0xda9d('0xe'),_0x2f5a92,_0xda9d('0xf'));logger['debug'](_0xda9d('0x10'),_0x2f5a92,_0xda9d('0xf'),JSON[_0xda9d('0x11')](_0x513fd1));if(_0x513fd1[_0xda9d('0x12')]){if(_0x513fd1[_0xda9d('0x12')][_0xda9d('0x13')]===0x1f4){logger['error'](_0xda9d('0xe'),_0x2f5a92,_0x513fd1['error']['message']);return _0x18a46e(_0x513fd1[_0xda9d('0x12')][_0xda9d('0x14')]);}logger[_0xda9d('0x12')](_0xda9d('0xe'),_0x2f5a92,_0x513fd1[_0xda9d('0x12')][_0xda9d('0x14')]);return _0x319dab(_0x513fd1[_0xda9d('0x12')][_0xda9d('0x14')]);}else{logger[_0xda9d('0x15')](_0xda9d('0xe'),_0x2f5a92,'request\x20sent');_0x319dab(_0x513fd1['result'][_0xda9d('0x14')]);}})[_0xda9d('0x16')](function(_0x9dc262){logger[_0xda9d('0x12')](_0xda9d('0xe'),_0x2f5a92,_0x9dc262);_0x18a46e(_0x9dc262);});});}exports[_0xda9d('0x17')]=function(_0x147b3e){var _0x1996b6=this;return new Promise(function(_0x3e4c61,_0x249a70){return db['Trigger'][_0xda9d('0x18')]({'raw':_0x147b3e[_0xda9d('0x19')]?_0x147b3e['options'][_0xda9d('0x1a')]===undefined?!![]:![]:!![],'where':_0x147b3e[_0xda9d('0x19')]?_0x147b3e[_0xda9d('0x19')][_0xda9d('0x1b')]||null:null,'attributes':_0x147b3e[_0xda9d('0x19')]?_0x147b3e[_0xda9d('0x19')][_0xda9d('0x1c')]||null:null,'limit':_0x147b3e['options']?_0x147b3e[_0xda9d('0x19')]['limit']||null:null,'include':_0x147b3e[_0xda9d('0x19')]?_0x147b3e[_0xda9d('0x19')]['include']?_[_0xda9d('0x1d')](_0x147b3e[_0xda9d('0x19')][_0xda9d('0x1e')],function(_0x49b90b){return{'model':db[_0x49b90b[_0xda9d('0x1f')]],'as':_0x49b90b['as'],'attributes':_0x49b90b[_0xda9d('0x1c')],'include':_0x49b90b[_0xda9d('0x1e')]?_[_0xda9d('0x1d')](_0x49b90b[_0xda9d('0x1e')],function(_0x49333d){return{'model':db[_0x49333d[_0xda9d('0x1f')]],'as':_0x49333d['as'],'attributes':_0x49333d['attributes'],'include':_0x49333d[_0xda9d('0x1e')]?_['map'](_0x49333d[_0xda9d('0x1e')],function(_0x22ea90){return{'model':db[_0x22ea90[_0xda9d('0x1f')]],'as':_0x22ea90['as'],'attributes':_0x22ea90['attributes']};}):[]};}):[]};}):[]:[]})[_0xda9d('0xd')](function(_0x2161a6){logger[_0xda9d('0x15')](_0xda9d('0x17'),_0x147b3e);logger[_0xda9d('0x20')](_0xda9d('0x17'),_0x147b3e,JSON['stringify'](_0x2161a6));_0x3e4c61(_0x2161a6);})[_0xda9d('0x16')](function(_0x1a280a){logger[_0xda9d('0x12')]('GetTrigger',_0x1a280a['message'],_0x147b3e);_0x249a70(_0x1996b6['error'](0x1f4,_0x1a280a['message']));});});};exports['ShowTrigger']=function(_0x2bcd99){var _0x8315a7=this;return new Promise(function(_0x1c0e81,_0x2518cd){return db['Trigger'][_0xda9d('0x21')]({'raw':_0x2bcd99[_0xda9d('0x19')]?_0x2bcd99['options'][_0xda9d('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bcd99[_0xda9d('0x19')]?_0x2bcd99[_0xda9d('0x19')][_0xda9d('0x1b')]||null:null,'attributes':_0x2bcd99['options']?_0x2bcd99['options'][_0xda9d('0x1c')]||null:null,'include':_0x2bcd99[_0xda9d('0x19')]?_0x2bcd99['options'][_0xda9d('0x1e')]?_[_0xda9d('0x1d')](_0x2bcd99[_0xda9d('0x19')][_0xda9d('0x1e')],function(_0x477eee){return{'model':db[_0x477eee[_0xda9d('0x1f')]],'as':_0x477eee['as'],'attributes':_0x477eee['attributes'],'include':_0x477eee['include']?_[_0xda9d('0x1d')](_0x477eee['include'],function(_0x328131){return{'model':db[_0x328131[_0xda9d('0x1f')]],'as':_0x328131['as'],'attributes':_0x328131[_0xda9d('0x1c')],'include':_0x328131[_0xda9d('0x1e')]?_['map'](_0x328131[_0xda9d('0x1e')],function(_0x36c78c){return{'model':db[_0x36c78c[_0xda9d('0x1f')]],'as':_0x36c78c['as'],'attributes':_0x36c78c[_0xda9d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xda9d('0xd')](function(_0x4671e3){logger[_0xda9d('0x15')](_0xda9d('0x22'),_0x2bcd99);logger[_0xda9d('0x20')](_0xda9d('0x22'),_0x2bcd99,JSON[_0xda9d('0x11')](_0x4671e3));_0x1c0e81(_0x4671e3);})[_0xda9d('0x16')](function(_0x54adab){logger[_0xda9d('0x12')]('ShowTrigger',_0x54adab['message'],_0x2bcd99);_0x2518cd(_0x8315a7[_0xda9d('0x12')](0x1f4,_0x54adab[_0xda9d('0x14')]));});});}; \ No newline at end of file +var _0xb37b=['attributes','find','ShowTrigger','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrigger','Trigger','options','raw','where','limit','include','map','model'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xb37b,0xc9));var _0xbb37=function(_0x1bdc6f,_0x296305){_0x1bdc6f=_0x1bdc6f-0x0;var _0x539c54=_0xb37b[_0x1bdc6f];return _0x539c54;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbb37('0x0'));var BPromise=require(_0xbb37('0x1'));var rs=require(_0xbb37('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb37('0x3'))['db'];var utils=require(_0xbb37('0x4'));var logger=require('../../config/logger')(_0xbb37('0x5'));var config=require(_0xbb37('0x6'));var jayson=require(_0xbb37('0x7'));var client=jayson[_0xbb37('0x8')][_0xbb37('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7a24,_0x1287bf,_0x56582d){return new BPromise(function(_0x297c70,_0x3e91bc){return client['request'](_0x4d7a24,_0x56582d)[_0xbb37('0xa')](function(_0x2ac886){logger[_0xbb37('0xb')](_0xbb37('0xc'),_0x1287bf,_0xbb37('0xd'));logger[_0xbb37('0xe')](_0xbb37('0xf'),_0x1287bf,_0xbb37('0xd'),JSON[_0xbb37('0x10')](_0x2ac886));if(_0x2ac886[_0xbb37('0x11')]){if(_0x2ac886[_0xbb37('0x11')]['code']===0x1f4){logger[_0xbb37('0x11')](_0xbb37('0xc'),_0x1287bf,_0x2ac886[_0xbb37('0x11')]['message']);return _0x3e91bc(_0x2ac886[_0xbb37('0x11')][_0xbb37('0x12')]);}logger['error'](_0xbb37('0xc'),_0x1287bf,_0x2ac886[_0xbb37('0x11')][_0xbb37('0x12')]);return _0x297c70(_0x2ac886[_0xbb37('0x11')][_0xbb37('0x12')]);}else{logger[_0xbb37('0xb')](_0xbb37('0xc'),_0x1287bf,_0xbb37('0xd'));_0x297c70(_0x2ac886[_0xbb37('0x13')][_0xbb37('0x12')]);}})[_0xbb37('0x14')](function(_0x35cfe3){logger[_0xbb37('0x11')]('Trigger,\x20%s,\x20%s',_0x1287bf,_0x35cfe3);_0x3e91bc(_0x35cfe3);});});}exports[_0xbb37('0x15')]=function(_0x41dc59){var _0x50a259=this;return new Promise(function(_0x4d1880,_0x302fbf){return db[_0xbb37('0x16')]['findAll']({'raw':_0x41dc59['options']?_0x41dc59[_0xbb37('0x17')][_0xbb37('0x18')]===undefined?!![]:![]:!![],'where':_0x41dc59[_0xbb37('0x17')]?_0x41dc59['options'][_0xbb37('0x19')]||null:null,'attributes':_0x41dc59['options']?_0x41dc59[_0xbb37('0x17')]['attributes']||null:null,'limit':_0x41dc59[_0xbb37('0x17')]?_0x41dc59['options'][_0xbb37('0x1a')]||null:null,'include':_0x41dc59[_0xbb37('0x17')]?_0x41dc59[_0xbb37('0x17')][_0xbb37('0x1b')]?_[_0xbb37('0x1c')](_0x41dc59[_0xbb37('0x17')]['include'],function(_0x314f0d){return{'model':db[_0x314f0d[_0xbb37('0x1d')]],'as':_0x314f0d['as'],'attributes':_0x314f0d['attributes'],'include':_0x314f0d[_0xbb37('0x1b')]?_[_0xbb37('0x1c')](_0x314f0d[_0xbb37('0x1b')],function(_0x3de941){return{'model':db[_0x3de941[_0xbb37('0x1d')]],'as':_0x3de941['as'],'attributes':_0x3de941[_0xbb37('0x1e')],'include':_0x3de941[_0xbb37('0x1b')]?_[_0xbb37('0x1c')](_0x3de941[_0xbb37('0x1b')],function(_0x2eff68){return{'model':db[_0x2eff68[_0xbb37('0x1d')]],'as':_0x2eff68['as'],'attributes':_0x2eff68[_0xbb37('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbb37('0xa')](function(_0x1522a7){logger[_0xbb37('0xb')]('GetTrigger',_0x41dc59);logger['debug'](_0xbb37('0x15'),_0x41dc59,JSON[_0xbb37('0x10')](_0x1522a7));_0x4d1880(_0x1522a7);})['catch'](function(_0x47790f){logger['error'](_0xbb37('0x15'),_0x47790f['message'],_0x41dc59);_0x302fbf(_0x50a259[_0xbb37('0x11')](0x1f4,_0x47790f[_0xbb37('0x12')]));});});};exports['ShowTrigger']=function(_0x17110e){var _0x294b82=this;return new Promise(function(_0x55ab4c,_0x34b38a){return db[_0xbb37('0x16')][_0xbb37('0x1f')]({'raw':_0x17110e[_0xbb37('0x17')]?_0x17110e[_0xbb37('0x17')][_0xbb37('0x18')]===undefined?!![]:![]:!![],'where':_0x17110e['options']?_0x17110e[_0xbb37('0x17')][_0xbb37('0x19')]||null:null,'attributes':_0x17110e[_0xbb37('0x17')]?_0x17110e['options'][_0xbb37('0x1e')]||null:null,'include':_0x17110e['options']?_0x17110e[_0xbb37('0x17')][_0xbb37('0x1b')]?_[_0xbb37('0x1c')](_0x17110e[_0xbb37('0x17')][_0xbb37('0x1b')],function(_0xf35992){return{'model':db[_0xf35992[_0xbb37('0x1d')]],'as':_0xf35992['as'],'attributes':_0xf35992[_0xbb37('0x1e')],'include':_0xf35992[_0xbb37('0x1b')]?_['map'](_0xf35992['include'],function(_0x4acf8e){return{'model':db[_0x4acf8e[_0xbb37('0x1d')]],'as':_0x4acf8e['as'],'attributes':_0x4acf8e[_0xbb37('0x1e')],'include':_0x4acf8e[_0xbb37('0x1b')]?_['map'](_0x4acf8e[_0xbb37('0x1b')],function(_0x12c621){return{'model':db[_0x12c621[_0xbb37('0x1d')]],'as':_0x12c621['as'],'attributes':_0x12c621[_0xbb37('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbb37('0xa')](function(_0x3d63b5){logger['info']('ShowTrigger',_0x17110e);logger[_0xbb37('0xe')](_0xbb37('0x20'),_0x17110e,JSON['stringify'](_0x3d63b5));_0x55ab4c(_0x3d63b5);})[_0xbb37('0x14')](function(_0x187edd){logger[_0xbb37('0x11')](_0xbb37('0x20'),_0x187edd[_0xbb37('0x12')],_0x17110e);_0x34b38a(_0x294b82[_0xbb37('0x11')](0x1f4,_0x187edd[_0xbb37('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index a3f88e0..f6baa26 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 _0x6ea2=['../../components/interaction/service','get','index','isAuthenticated','show','post','/:id/clone','clone','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x55a7c2,_0x365314){var _0xd12715=function(_0x1ba366){while(--_0x1ba366){_0x55a7c2['push'](_0x55a7c2['shift']());}};_0xd12715(++_0x365314);}(_0x6ea2,0x117));var _0x26ea=function(_0x54d09d,_0x1d9305){_0x54d09d=_0x54d09d-0x0;var _0x5b2ba0=_0x6ea2[_0x54d09d];return _0x5b2ba0;};'use strict';var multer=require(_0x26ea('0x0'));var util=require(_0x26ea('0x1'));var path=require(_0x26ea('0x2'));var timeout=require(_0x26ea('0x3'));var express=require(_0x26ea('0x4'));var router=express[_0x26ea('0x5')]();var fs_extra=require(_0x26ea('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x26ea('0x7'));var config=require('../../config/environment');var controller=require('./trunk.controller');router[_0x26ea('0x8')]('/',auth['isAuthenticated'](),controller[_0x26ea('0x9')]);router[_0x26ea('0x8')]('/:id',auth[_0x26ea('0xa')](),controller[_0x26ea('0xb')]);router[_0x26ea('0xc')](_0x26ea('0xd'),auth[_0x26ea('0xa')](),controller[_0x26ea('0xe')]);router[_0x26ea('0xc')]('/',auth[_0x26ea('0xa')](),controller[_0x26ea('0xf')]);router[_0x26ea('0x10')](_0x26ea('0x11'),auth[_0x26ea('0xa')](),controller[_0x26ea('0x12')]);router[_0x26ea('0x13')](_0x26ea('0x11'),auth['isAuthenticated'](),controller[_0x26ea('0x14')]);module[_0x26ea('0x15')]=router; \ No newline at end of file +var _0x454d=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','clone','put','update','delete','destroy','exports'];(function(_0x531834,_0x10b067){var _0x56fa30=function(_0x55cd1f){while(--_0x55cd1f){_0x531834['push'](_0x531834['shift']());}};_0x56fa30(++_0x10b067);}(_0x454d,0x18c));var _0xd454=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0x454d[_0x239dba];return _0x1ceb11;};'use strict';var multer=require(_0xd454('0x0'));var util=require(_0xd454('0x1'));var path=require(_0xd454('0x2'));var timeout=require(_0xd454('0x3'));var express=require('express');var router=express[_0xd454('0x4')]();var fs_extra=require(_0xd454('0x5'));var auth=require(_0xd454('0x6'));var interaction=require(_0xd454('0x7'));var config=require(_0xd454('0x8'));var controller=require(_0xd454('0x9'));router[_0xd454('0xa')]('/',auth[_0xd454('0xb')](),controller[_0xd454('0xc')]);router[_0xd454('0xa')](_0xd454('0xd'),auth[_0xd454('0xb')](),controller[_0xd454('0xe')]);router[_0xd454('0xf')]('/:id/clone',auth[_0xd454('0xb')](),controller[_0xd454('0x10')]);router['post']('/',auth[_0xd454('0xb')](),controller['create']);router[_0xd454('0x11')](_0xd454('0xd'),auth[_0xd454('0xb')](),controller[_0xd454('0x12')]);router[_0xd454('0x13')](_0xd454('0xd'),auth['isAuthenticated'](),controller[_0xd454('0x14')]);module[_0xd454('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index ef25b9b..41985d4 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 _0x1d28=['nat','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','ENUM','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','certificate','active','dynamic','BOOLEAN','sequelize','exports','STRING','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','shortinfo','inband','auto','nonat','update','outgoing','force_rport,comedia'];(function(_0x1c145a,_0x39594e){var _0x3a1d4b=function(_0x25fb1a){while(--_0x25fb1a){_0x1c145a['push'](_0x1c145a['shift']());}};_0x3a1d4b(++_0x39594e);}(_0x1d28,0x13d));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x81d2('0x0'));module[_0x81d2('0x1')]={'name':{'type':Sequelize[_0x81d2('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x81d2('0x3'),'user',_0x81d2('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x81d2('0x2')],'allowNull':![],'defaultValue':_0x81d2('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0x81d2('0x6'),_0x81d2('0x7'),_0x81d2('0x8'),_0x81d2('0x9'),_0x81d2('0xa'),_0x81d2('0xb'),_0x81d2('0xc'),_0x81d2('0xd'))},'deny':{'type':Sequelize[_0x81d2('0x2')]},'permit':{'type':Sequelize[_0x81d2('0x2')]},'secret':{'type':Sequelize[_0x81d2('0x2')]},'md5secret':{'type':Sequelize[_0x81d2('0x2')]},'remotesecret':{'type':Sequelize[_0x81d2('0x2')]},'transport':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':_0x81d2('0xe'),'set':function(_0x28070e){this[_0x81d2('0xf')]('transport',_0x28070e?_0x28070e[_0x81d2('0x10')](','):null);},'get':function(){return this[_0x81d2('0x11')](_0x81d2('0x12'))?this[_0x81d2('0x11')](_0x81d2('0x12'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info',_0x81d2('0x13'),_0x81d2('0x14'),_0x81d2('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x81d2('0x16'),_0x81d2('0x17'),_0x81d2('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x81d2('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x81d2('0x19'),'set':function(_0x14117e){this[_0x81d2('0xf')](_0x81d2('0x1a'),_0x14117e?_0x14117e[_0x81d2('0x10')](','):null);},'get':function(){return this[_0x81d2('0x11')](_0x81d2('0x1a'))?this[_0x81d2('0x11')](_0x81d2('0x1a'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x81d2('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x81d2('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x81d2('0x2')]},'language':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x81d2('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x81d2('0x1b')},'allow':{'type':Sequelize[_0x81d2('0x2')],'allowNull':![],'defaultValue':_0x81d2('0x1c'),'set':function(_0x4a7482){this[_0x81d2('0xf')](_0x81d2('0x1d'),_0x4a7482?_0x4a7482[_0x81d2('0x10')](';'):_0x81d2('0x1c'));},'get':function(){return this[_0x81d2('0x11')](_0x81d2('0x1d'))?this[_0x81d2('0x11')](_0x81d2('0x1d'))[_0x81d2('0x1e')](';'):null;},'comment':_0x81d2('0x1f')},'autoframing':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'insecure':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':'port,invite','set':function(_0x5007e4){this[_0x81d2('0xf')]('insecure',_0x5007e4?_0x5007e4[_0x81d2('0x10')](','):null);},'get':function(){return this[_0x81d2('0x11')](_0x81d2('0x22'))?this[_0x81d2('0x11')](_0x81d2('0x22'))['split'](','):null;},'comment':_0x81d2('0x23')},'trustrpid':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x81d2('0x21'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no',_0x81d2('0x24'))},'promiscredir':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'useclientcode':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'accountcode':{'type':Sequelize[_0x81d2('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':_0x81d2('0x26')},'amaflags':{'type':Sequelize[_0x81d2('0x2')]},'callcounter':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no'),'defaultValue':_0x81d2('0x21')},'busylevel':{'type':Sequelize[_0x81d2('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x81d2('0x20')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'allowtransfer':{'type':Sequelize[_0x81d2('0x20')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'subscribecontext':{'type':Sequelize[_0x81d2('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x81d2('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x81d2('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x81d2('0x20')]('yes','no')},'mailbox':{'type':Sequelize[_0x81d2('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x81d2('0x28'),'refuse',_0x81d2('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x2a'),'uas'),'defaultValue':_0x81d2('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x81d2('0x2')]},'regexten':{'type':Sequelize[_0x81d2('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x81d2('0x2')]},'port':{'type':Sequelize[_0x81d2('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x81d2('0x21'),'no'),'defaultValue':_0x81d2('0x21')},'keepalive':{'type':Sequelize[_0x81d2('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x81d2('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x81d2('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x81d2('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no',_0x81d2('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x81d2('0x2')]},'callbackextension':{'type':Sequelize[_0x81d2('0x2')]},'timert1':{'type':Sequelize[_0x81d2('0x25')](0xb)},'timerb':{'type':Sequelize[_0x81d2('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x81d2('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x81d2('0x2')]},'contactdeny':{'type':Sequelize[_0x81d2('0x2')]},'contactacl':{'type':Sequelize[_0x81d2('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x81d2('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x81d2('0x25')](0xb)},'encryption':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x81d2('0x20')]('yes','no')},'force_avp':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0x81d2('0x20')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x81d2('0x20')]('yes','no','fingerprint',_0x81d2('0x2d'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x81d2('0x2')]},'dtlscipher':{'type':Sequelize[_0x81d2('0x2')]},'dtlscafile':{'type':Sequelize[_0x81d2('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x2e'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x81d2('0x2')]},'usereqphone':{'type':Sequelize[_0x81d2('0x20')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x81d2('0x2')]},'recordofffeature':{'type':Sequelize[_0x81d2('0x2')]},'call_limit':{'type':Sequelize[_0x81d2('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x81d2('0x21'),'no')},'vmexten':{'type':Sequelize[_0x81d2('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x81d2('0x2')]},'parkinglot':{'type':Sequelize[_0x81d2('0x2')]},'description':{'type':Sequelize[_0x81d2('0x2')]},'host':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':_0x81d2('0x2f')},'canreinvite':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no',_0x81d2('0x16'),_0x81d2('0x17'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x81d2('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x81d2('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xc28a=['PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','yes','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','pai','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED'];(function(_0x589957,_0x557a8b){var _0x2dd207=function(_0x17b4e7){while(--_0x17b4e7){_0x589957['push'](_0x589957['shift']());}};_0x2dd207(++_0x557a8b);}(_0xc28a,0x99));var _0xac28=function(_0x2611e8,_0x436048){_0x2611e8=_0x2611e8-0x0;var _0x4335f1=_0xc28a[_0x2611e8];return _0x4335f1;};'use strict';var Sequelize=require(_0xac28('0x0'));module[_0xac28('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xac28('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x4'),_0xac28('0x5'),_0xac28('0x6')),'allowNull':![],'defaultValue':_0xac28('0x4')},'context':{'type':Sequelize[_0xac28('0x7')],'allowNull':![],'defaultValue':_0xac28('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0xac28('0x9'),_0xac28('0xa'),'ALLOWED_FAILED_SCREEN',_0xac28('0xb'),_0xac28('0xc'),_0xac28('0xd'),_0xac28('0xe'),_0xac28('0xf'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xac28('0x7')]},'md5secret':{'type':Sequelize[_0xac28('0x7')]},'remotesecret':{'type':Sequelize[_0xac28('0x7')]},'transport':{'type':Sequelize[_0xac28('0x7')],'defaultValue':_0xac28('0x10'),'set':function(_0xff199e){this[_0xac28('0x11')](_0xac28('0x12'),_0xff199e?_0xff199e[_0xac28('0x13')](','):null);},'get':function(){return this[_0xac28('0x14')](_0xac28('0x12'))?this[_0xac28('0x14')]('transport')[_0xac28('0x15')](','):null;},'comment':_0xac28('0x16')},'dtmfmode':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x17'),_0xac28('0x18'),_0xac28('0x19'),_0xac28('0x1a'),_0xac28('0x1b')),'defaultValue':_0xac28('0x17')},'directmedia':{'type':Sequelize[_0xac28('0x3')]('yes','no',_0xac28('0x1c'),_0xac28('0x1d'),_0xac28('0x1e')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xac28('0x7')]},'directmediadeny':{'type':Sequelize[_0xac28('0x7')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xac28('0x20'),'set':function(_0x330b3c){this[_0xac28('0x11')](_0xac28('0x21'),_0x330b3c?_0x330b3c[_0xac28('0x13')](','):null);},'get':function(){return this[_0xac28('0x14')](_0xac28('0x21'))?this[_0xac28('0x14')]('nat')[_0xac28('0x15')](','):null;},'comment':_0xac28('0x22')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xac28('0x7')]},'pickupgroup':{'type':Sequelize[_0xac28('0x7')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xac28('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xac28('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xac28('0x7')],'defaultValue':_0xac28('0x23')},'allow':{'type':Sequelize[_0xac28('0x7')],'allowNull':![],'defaultValue':_0xac28('0x24'),'set':function(_0x1bbc53){this[_0xac28('0x11')](_0xac28('0x25'),_0x1bbc53?_0x1bbc53[_0xac28('0x13')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xac28('0x14')](_0xac28('0x25'))?this[_0xac28('0x14')]('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'insecure':{'type':Sequelize[_0xac28('0x7')],'defaultValue':'port,invite','set':function(_0x4c6640){this[_0xac28('0x11')]('insecure',_0x4c6640?_0x4c6640[_0xac28('0x13')](','):null);},'get':function(){return this['getDataValue'](_0xac28('0x26'))?this['getDataValue']('insecure')[_0xac28('0x15')](','):null;},'comment':_0xac28('0x27')},'trustrpid':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no',_0xac28('0x28'))},'promiscredir':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'useclientcode':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'accountcode':{'type':Sequelize[_0xac28('0x29')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xac28('0x7')],'defaultValue':_0xac28('0x2a')},'amaflags':{'type':Sequelize[_0xac28('0x7')]},'callcounter':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xac28('0x29')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'subscribecontext':{'type':Sequelize[_0xac28('0x7')]},'template':{'type':Sequelize[_0xac28('0x7')]},'videosupport':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no',_0xac28('0x2b')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xac28('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'mailbox':{'type':Sequelize[_0xac28('0x7')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xac28('0x2c'),_0xac28('0x2d'))},'session_expires':{'type':Sequelize[_0xac28('0x29')](0xb)},'session_minse':{'type':Sequelize[_0xac28('0x29')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xac28('0x2e'),_0xac28('0x2f')),'defaultValue':_0xac28('0x2f')},'t38pt_usertpsource':{'type':Sequelize[_0xac28('0x7')]},'regexten':{'type':Sequelize[_0xac28('0x7')]},'fromdomain':{'type':Sequelize[_0xac28('0x7')]},'fromuser':{'type':Sequelize[_0xac28('0x7')]},'port':{'type':Sequelize[_0xac28('0x29')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no'),'defaultValue':_0xac28('0x1f')},'keepalive':{'type':Sequelize[_0xac28('0x29')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xac28('0x7')]},'rtptimeout':{'type':Sequelize[_0xac28('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xac28('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xac28('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no',_0xac28('0x30')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xac28('0x7')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xac28('0x29')](0xb)},'timerb':{'type':Sequelize[_0xac28('0x29')](0xb)},'qualifyfreq':{'type':Sequelize[_0xac28('0x29')](0xb)},'contactpermit':{'type':Sequelize[_0xac28('0x7')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xac28('0x7')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xac28('0x29')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'force_avp':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'icesupport':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'dtlsenable':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no','fingerprint',_0xac28('0x31'))},'dtlsrekey':{'type':Sequelize[_0xac28('0x29')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xac28('0x7')]},'dtlscipher':{'type':Sequelize[_0xac28('0x7')]},'dtlscafile':{'type':Sequelize[_0xac28('0x7')]},'dtlscapath':{'type':Sequelize[_0xac28('0x7')]},'dtlssetup':{'type':Sequelize[_0xac28('0x3')]('active',_0xac28('0x32'),_0xac28('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xac28('0x7')]},'recordofffeature':{'type':Sequelize[_0xac28('0x7')]},'call_limit':{'type':Sequelize[_0xac28('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'vmexten':{'type':Sequelize[_0xac28('0x7')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xac28('0x7')]},'parkinglot':{'type':Sequelize[_0xac28('0x7')]},'description':{'type':Sequelize[_0xac28('0x7')]},'host':{'type':Sequelize[_0xac28('0x7')],'defaultValue':_0xac28('0x34')},'canreinvite':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no','nonat',_0xac28('0x1d'),_0xac28('0x35')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xac28('0x7')]},'otherFields':{'type':Sequelize[_0xac28('0x7')]},'active':{'type':Sequelize[_0xac28('0x36')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xac28('0x7')],'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 9183f2d..1ddc0e7 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 _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x4839a2,_0x1f67eb){var _0x465147=function(_0x4eae2e){while(--_0x4eae2e){_0x4839a2['push'](_0x4839a2['shift']());}};_0x465147(++_0x1f67eb);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x24f122,_0x4c1ad9){_0x24f122=_0x24f122-0x0;var _0x36042d=_0x8d0e[_0x24f122];return _0x36042d;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));}; \ No newline at end of file +var _0xa41a=['server/files/templates/registry.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','destroy','get','UserProfileResource','end','name','send','map','Trunk','fieldName','type','key','query','intersection','model','attributes','fields','length','order','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','createdAt','updatedAt','body','create','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','Trunks','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload'];(function(_0x56c442,_0x433de4){var _0x2944db=function(_0xa8bae1){while(--_0xa8bae1){_0x56c442['push'](_0x56c442['shift']());}};_0x2944db(++_0x433de4);}(_0xa41a,0x6b));var _0xaa41=function(_0x38356b,_0x1c83fb){_0x38356b=_0x38356b-0x0;var _0x14dad4=_0xa41a[_0x38356b];return _0x14dad4;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xaa41('0x19'));var client=jayson['client'][_0xaa41('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12d9e6,_0x2f64bc,_0x889d44,_0x6f9ade){return new BPromise(function(_0x4eaf81,_0x1e9d7f){var _0x178170=_0x6f9ade||client;return _0x178170[_0xaa41('0x1b')](_0x12d9e6,_0x889d44)[_0xaa41('0x1c')](function(_0x2a6988){logger[_0xaa41('0x1d')](_0xaa41('0x1e'),_0x2f64bc,'request\x20sent');logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2f64bc,_0xaa41('0x21'),JSON[_0xaa41('0x22')](_0x2a6988));if(_0x2a6988[_0xaa41('0x23')]){if(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x24')]===0x1f4){logger[_0xaa41('0x23')](_0xaa41('0x1e'),_0x2f64bc,_0x2a6988['error']['message']);return _0x1e9d7f(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);}logger[_0xaa41('0x23')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);return _0x4eaf81(_0x2a6988['error']['message']);}else{logger[_0xaa41('0x1d')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0xaa41('0x21'));_0x4eaf81(_0x2a6988[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x1d623c){logger['error'](_0xaa41('0x1e'),_0x2f64bc,_0x1d623c);_0x1e9d7f(_0x1d623c);});});}function respondWithStatusCode(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0xcc;return function(_0x21f596){if(_0x21f596){return _0x43a85c[_0xaa41('0x28')](_0x448a21);}return _0x43a85c[_0xaa41('0x29')](_0x448a21)['end']();};}function respondWithResult(_0x5795f4,_0x16aec5){_0x16aec5=_0x16aec5||0xc8;return function(_0x527cac){if(_0x527cac){return _0x5795f4['status'](_0x16aec5)[_0xaa41('0x2a')](_0x527cac);}};}function respondWithFilteredResult(_0x59707f,_0x536bed){return function(_0x2d0ac0){if(_0x2d0ac0){var _0x9c8c21=typeof _0x536bed[_0xaa41('0x2b')]===_0xaa41('0x2c')&&typeof _0x536bed[_0xaa41('0x2d')]===_0xaa41('0x2c');var _0x57ef96=_0x2d0ac0[_0xaa41('0x2e')];var _0x1f0275=_0x9c8c21?0x0:_0x536bed[_0xaa41('0x2b')];var _0x9a16e3=_0x9c8c21?_0x2d0ac0[_0xaa41('0x2e')]:_0x536bed[_0xaa41('0x2b')]+_0x536bed[_0xaa41('0x2d')];var _0x104a95;if(_0x9a16e3>=_0x57ef96){_0x9a16e3=_0x57ef96;_0x104a95=0xc8;}else{_0x104a95=0xce;}_0x59707f['status'](_0x104a95);return _0x59707f[_0xaa41('0x2f')]('Content-Range',_0x1f0275+'-'+_0x9a16e3+'/'+_0x57ef96)['json'](_0x2d0ac0);}return null;};}function patchUpdates(_0x714537){return function(_0x1176bd){try{jsonpatch['apply'](_0x1176bd,_0x714537,!![]);}catch(_0x392b5d){return BPromise[_0xaa41('0x30')](_0x392b5d);}return _0x1176bd['save']();};}function saveUpdates(_0x5022fb,_0x5c25fb){return function(_0x1cf3da){if(_0x1cf3da){return _0x1cf3da[_0xaa41('0x31')](_0x5022fb)[_0xaa41('0x1c')](function(_0x38afc4){return _0x38afc4;});}return null;};}function removeEntity(_0x58f203,_0x289c4a){return function(_0x45c8fe){if(_0x45c8fe){return _0x45c8fe[_0xaa41('0x32')]()['then'](function(){var _0x387c55=_0x45c8fe[_0xaa41('0x33')]({'plain':!![]});var _0x321eb7='Trunks';return db[_0xaa41('0x34')][_0xaa41('0x32')]({'where':{'type':_0x321eb7,'resourceId':_0x387c55['id']}})['then'](function(){return _0x45c8fe;});})[_0xaa41('0x1c')](function(){_0x58f203[_0xaa41('0x29')](0xcc)[_0xaa41('0x35')]();});}};}function handleEntityNotFound(_0x5cec87,_0x22b272){return function(_0x48335f){if(!_0x48335f){_0x5cec87[_0xaa41('0x28')](0x194);}return _0x48335f;};}function handleError(_0x199b24,_0xf13742){_0xf13742=_0xf13742||0x1f4;return function(_0x49b77a){logger['error'](_0x49b77a['stack']);if(_0x49b77a[_0xaa41('0x36')]){delete _0x49b77a[_0xaa41('0x36')];}_0x199b24[_0xaa41('0x29')](_0xf13742)[_0xaa41('0x37')](_0x49b77a);};}exports['index']=function(_0x53a2e4,_0x267999){var _0x5673c={},_0x951e52={},_0x4e8d2e={'count':0x0,'rows':[]};var _0xba115a=_[_0xaa41('0x38')](db[_0xaa41('0x39')]['rawAttributes'],function(_0x3adc28){return{'name':_0x3adc28[_0xaa41('0x3a')],'type':_0x3adc28[_0xaa41('0x3b')][_0xaa41('0x3c')]};});_0x951e52['model']=_['map'](_0xba115a,_0xaa41('0x36'));_0x951e52[_0xaa41('0x3d')]=_['keys'](_0x53a2e4[_0xaa41('0x3d')]);_0x951e52['filters']=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],_0x951e52[_0xaa41('0x3d')]);_0x5673c[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x53a2e4[_0xaa41('0x3d')]['fields']));_0x5673c[_0xaa41('0x40')]=_0x5673c[_0xaa41('0x40')][_0xaa41('0x42')]?_0x5673c[_0xaa41('0x40')]:_0x951e52[_0xaa41('0x3f')];if(!_0x53a2e4[_0xaa41('0x3d')]['hasOwnProperty']('nolimit')){_0x5673c[_0xaa41('0x2d')]=qs['limit'](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2d')]);_0x5673c[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2b')]);}_0x5673c[_0xaa41('0x43')]=qs['sort'](_0x53a2e4[_0xaa41('0x3d')]['sort']);_0x5673c['where']=qs[_0xaa41('0x44')](_['pick'](_0x53a2e4['query'],_0x951e52['filters']),_0xba115a);if(_0x53a2e4[_0xaa41('0x3d')]['filter']){_0x5673c[_0xaa41('0x45')]=_[_0xaa41('0x46')](_0x5673c['where'],{'$or':_['map'](_0xba115a,function(_0xe58f5e){if(_0xe58f5e[_0xaa41('0x3b')]!==_0xaa41('0x47')){var _0x2af8ba={};_0x2af8ba[_0xe58f5e[_0xaa41('0x36')]]={'$like':'%'+_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x48')]+'%'};return _0x2af8ba;}})});}_0x5673c=_[_0xaa41('0x46')]({},_0x5673c,_0x53a2e4[_0xaa41('0x49')]);var _0x4e1ac4={'where':_0x5673c[_0xaa41('0x45')]};return db[_0xaa41('0x39')][_0xaa41('0x2e')](_0x4e1ac4)[_0xaa41('0x1c')](function(_0x206d86){_0x4e8d2e[_0xaa41('0x2e')]=_0x206d86;if(_0x53a2e4['query'][_0xaa41('0x4a')]){_0x5673c[_0xaa41('0x4b')]=[{'all':!![]}];}return db[_0xaa41('0x39')][_0xaa41('0x4c')](_0x5673c);})['then'](function(_0x23bc61){_0x4e8d2e['rows']=_0x23bc61;return _0x4e8d2e;})['then'](respondWithFilteredResult(_0x267999,_0x5673c))[_0xaa41('0x27')](handleError(_0x267999,null));};exports[_0xaa41('0x4d')]=function(_0x3e16ef,_0x4ca114){var _0xb4773b={'raw':![],'where':{'id':_0x3e16ef[_0xaa41('0x4e')]['id']}},_0x3e1a73={};_0x3e1a73['model']=_[_0xaa41('0x4f')](db[_0xaa41('0x39')][_0xaa41('0x50')]);_0x3e1a73[_0xaa41('0x3d')]=_[_0xaa41('0x4f')](_0x3e16ef[_0xaa41('0x3d')]);_0x3e1a73[_0xaa41('0x44')]=_[_0xaa41('0x3e')](_0x3e1a73['model'],_0x3e1a73[_0xaa41('0x3d')]);_0xb4773b['attributes']=_['intersection'](_0x3e1a73[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x41')]));_0xb4773b[_0xaa41('0x40')]=_0xb4773b[_0xaa41('0x40')][_0xaa41('0x42')]?_0xb4773b[_0xaa41('0x40')]:_0x3e1a73['model'];if(_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0xb4773b[_0xaa41('0x4b')]=[{'all':!![]}];}_0xb4773b=_['merge']({},_0xb4773b,_0x3e16ef[_0xaa41('0x49')]);return db[_0xaa41('0x39')]['find'](_0xb4773b)[_0xaa41('0x1c')](handleEntityNotFound(_0x4ca114,null))[_0xaa41('0x1c')](respondWithResult(_0x4ca114,null))[_0xaa41('0x27')](handleError(_0x4ca114,null));};exports['clone']=function(_0x2cf32c,_0xc8e626){var _0x4e3b13={'where':{'id':_0x2cf32c[_0xaa41('0x4e')]['id']}},_0x49789a={};_0x49789a[_0xaa41('0x3f')]=_[_0xaa41('0x4f')](db['Trunk'][_0xaa41('0x50')]);_0x4e3b13[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x49789a[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x2cf32c['query'][_0xaa41('0x41')]));_0x4e3b13['attributes']=_0x4e3b13['attributes'][_0xaa41('0x42')]?_0x4e3b13['attributes']:_0x49789a[_0xaa41('0x3f')];if(_0x2cf32c[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0x4e3b13['include']=[{'all':!![]}];}_0x4e3b13=_[_0xaa41('0x46')]({},_0x4e3b13,_0x2cf32c[_0xaa41('0x49')]);return db[_0xaa41('0x39')][_0xaa41('0x51')](_0x4e3b13)[_0xaa41('0x1c')](handleEntityNotFound(_0xc8e626,null))[_0xaa41('0x1c')](function(_0xc56018){if(_0xc56018){var _0x337059=_0xc56018[_0xaa41('0x33')]({'plain':!![]});_0x337059=qs['omit'](_0x337059,['id',_0xaa41('0x52'),_0xaa41('0x53')]);_0x2cf32c[_0xaa41('0x54')]=_['omit'](_0x2cf32c[_0xaa41('0x54')],['id',_0xaa41('0x52'),_0xaa41('0x53')]);return db[_0xaa41('0x39')][_0xaa41('0x55')](_[_0xaa41('0x46')](_0x337059,_0x2cf32c[_0xaa41('0x54')]),{'include':_0x2cf32c['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x540325){var _0x4ec357=_0x2cf32c['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x4ec357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec357['role']===_0xaa41('0x56')){var _0x40a524=_0x540325[_0xaa41('0x33')]({'plain':!![]});var _0x312eee='Trunks';return db[_0xaa41('0x57')][_0xaa41('0x51')]({'where':{'name':_0x312eee,'userProfileId':_0x4ec357[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0xa71432){if(_0xa71432&&_0xa71432[_0xaa41('0x59')]===0x0){return db[_0xaa41('0x34')][_0xaa41('0x55')]({'name':_0x40a524[_0xaa41('0x36')],'resourceId':_0x40a524['id'],'type':_0xa71432['name'],'sectionId':_0xa71432['id']},{})[_0xaa41('0x1c')](function(){return _0x540325;});}else{return _0x540325;}})[_0xaa41('0x27')](function(_0x50170f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50170f);throw _0x50170f;});}return _0x540325;});}})[_0xaa41('0x1c')](respondWithResult(_0xc8e626,0xc9))['catch'](handleError(_0xc8e626,null));};exports[_0xaa41('0x55')]=function(_0x5c8028,_0x5423b6,_0x18d18b){var _0x4b1ec4;return db[_0xaa41('0x39')][_0xaa41('0x55')](_0x5c8028[_0xaa41('0x54')],{'raw':!![]})[_0xaa41('0x1c')](function(_0x5a2683){_0x4b1ec4=_0x5a2683;return db['Trunk'][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x4d6d0c){var _0x5954ba=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x5a385e=fs[_0xaa41('0x5a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x19ec63=ejs[_0xaa41('0x5f')](_0x5954ba,{'trunks':_0x4d6d0c||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x19ec63);if(_0x4b1ec4[_0xaa41('0x61')]){var _0x19ed68=ejs[_0xaa41('0x5f')](_0x5a385e,{'trunks':_0x4d6d0c||[]});fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x19ed68);}})[_0xaa41('0x1c')](function(){return respondWithRpcPromise('Reload',_0xaa41('0x55'),{'module':_0xaa41('0x64')});})[_0xaa41('0x1c')](function(){var _0x175ca9=_0x5c8028['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x175ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175ca9[_0xaa41('0x65')]===_0xaa41('0x56')){var _0x2b9e68=_0x4b1ec4[_0xaa41('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xaa41('0x51')]({'where':{'name':_0xaa41('0x66'),'userProfileId':_0x175ca9[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0x59052d){if(_0x59052d&&_0x59052d[_0xaa41('0x59')]===0x0){return db['UserProfileResource'][_0xaa41('0x55')]({'name':_0x2b9e68[_0xaa41('0x36')],'resourceId':_0x2b9e68['id'],'type':_0x59052d['name'],'sectionId':_0x59052d['id']},{})[_0xaa41('0x1c')](function(){return _0x4b1ec4;});}else{return _0x4b1ec4;}})[_0xaa41('0x27')](function(_0x2ba160){logger[_0xaa41('0x23')](_0xaa41('0x67'),_0x2ba160);throw _0x2ba160;});}return _0x4b1ec4;})[_0xaa41('0x1c')](respondWithResult(_0x5423b6,0xc9))[_0xaa41('0x27')](handleError(_0x5423b6,null));};exports[_0xaa41('0x31')]=function(_0x33b5f4,_0x3d4f1e,_0x25a064){var _0x59a30b;return db[_0xaa41('0x39')][_0xaa41('0x51')]({'where':{'id':_0x33b5f4[_0xaa41('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d4f1e,null))['then'](saveUpdates(_0x33b5f4[_0xaa41('0x54')],null))[_0xaa41('0x1c')](function(_0x59fd6a){if(_0x59fd6a){_0x59a30b=_0x59fd6a;return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});}})['then'](function(_0x305050){if(_0x305050){var _0x3dd47e=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x1472be=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x44154f=ejs[_0xaa41('0x5f')](_0x3dd47e,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x44154f);var _0x404c38=ejs[_0xaa41('0x5f')](_0x1472be,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x63'),_0x404c38);return respondWithRpcPromise(_0xaa41('0x68'),'update',{'module':_0xaa41('0x64')});}return null;})['then'](function(_0x53faf4){if(_0x53faf4){return _0x59a30b;}})[_0xaa41('0x1c')](respondWithResult(_0x3d4f1e,null))[_0xaa41('0x27')](handleError(_0x3d4f1e,null));};exports['destroy']=function(_0x5a8cb0,_0x241e1a,_0x1726ec){var _0x3c189d;return db[_0xaa41('0x39')]['find']({'where':{'id':_0x5a8cb0[_0xaa41('0x4e')]['id']}})[_0xaa41('0x1c')](handleEntityNotFound(_0x241e1a,null))[_0xaa41('0x1c')](removeEntity(_0x241e1a,null))['then'](function(){return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x5697b6){var _0x183b36=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],_0xaa41('0x5d')),'utf8');var _0x399fbd=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config['root'],_0xaa41('0x69')),_0xaa41('0x5e'));var _0x1a2deb=ejs[_0xaa41('0x5f')](_0x183b36,{'trunks':_0x5697b6});var _0x38f5d0=ejs['render'](_0x399fbd,{'trunks':_0x5697b6});fs[_0xaa41('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1a2deb);fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x38f5d0);return respondWithRpcPromise(_0xaa41('0x68'),_0xaa41('0x32'),{'module':_0xaa41('0x64')});})[_0xaa41('0x27')](handleError(_0x241e1a,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 2a4563d..3e6489a 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 _0xce40=['request-promise','rimraf','../../config/environment','define','Trunk','tools_trunks','lodash','../../config/logger','api','bluebird'];(function(_0x23eb47,_0x4fa46d){var _0x5a706d=function(_0x59fc14){while(--_0x59fc14){_0x23eb47['push'](_0x23eb47['shift']());}};_0x5a706d(++_0x4fa46d);}(_0xce40,0x114));var _0x0ce4=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xce40[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x0ce4('0x0'));var util=require('util');var logger=require(_0x0ce4('0x1'))(_0x0ce4('0x2'));var moment=require('moment');var BPromise=require(_0x0ce4('0x3'));var rp=require(_0x0ce4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ce4('0x5'));var config=require(_0x0ce4('0x6'));var attributes=require('./trunk.attributes');module['exports']=function(_0x1cfbc9,_0x57b389){return _0x1cfbc9[_0x0ce4('0x7')](_0x0ce4('0x8'),attributes,{'tableName':_0x0ce4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50aa=['Trunk','lodash','util','../../config/logger','api','request-promise','path','./trunk.attributes','exports','define'];(function(_0x1a9267,_0x1caba5){var _0x31512b=function(_0x27a158){while(--_0x27a158){_0x1a9267['push'](_0x1a9267['shift']());}};_0x31512b(++_0x1caba5);}(_0x50aa,0x169));var _0xa50a=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0x50aa[_0xef4ef0];return _0x39b60b;};'use strict';var _=require(_0xa50a('0x0'));var util=require(_0xa50a('0x1'));var logger=require(_0xa50a('0x2'))(_0xa50a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa50a('0x4'));var fs=require('fs');var path=require(_0xa50a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa50a('0x6'));module[_0xa50a('0x7')]=function(_0x37b8c8,_0xd14f02){return _0x37b8c8[_0xa50a('0x8')](_0xa50a('0x9'),attributes,{'tableName':'tools_trunks','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 6d20caa..9da8243 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 _0xe65a=['then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','options','where','attributes','include','map','model','stringify','ShowTrunk','Trunk','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0xe65a,0x148));var _0xae65=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0xe65a[_0x3ce2c4];return _0x4047c1;};'use strict';var _=require(_0xae65('0x0'));var util=require(_0xae65('0x1'));var moment=require(_0xae65('0x2'));var BPromise=require(_0xae65('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae65('0x4'));var db=require(_0xae65('0x5'))['db'];var utils=require(_0xae65('0x6'));var logger=require(_0xae65('0x7'))(_0xae65('0x8'));var config=require(_0xae65('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xae65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50557a,_0x734ca3,_0x207bf6){return new BPromise(function(_0x27a311,_0x5295be){return client[_0xae65('0xb')](_0x50557a,_0x207bf6)[_0xae65('0xc')](function(_0x597d0e){logger[_0xae65('0xd')]('Trunk,\x20%s,\x20%s',_0x734ca3,_0xae65('0xe'));logger[_0xae65('0xf')](_0xae65('0x10'),_0x734ca3,_0xae65('0xe'),JSON['stringify'](_0x597d0e));if(_0x597d0e[_0xae65('0x11')]){if(_0x597d0e[_0xae65('0x11')]['code']===0x1f4){logger['error'](_0xae65('0x12'),_0x734ca3,_0x597d0e[_0xae65('0x11')][_0xae65('0x13')]);return _0x5295be(_0x597d0e[_0xae65('0x11')][_0xae65('0x13')]);}logger[_0xae65('0x11')]('Trunk,\x20%s,\x20%s',_0x734ca3,_0x597d0e[_0xae65('0x11')][_0xae65('0x13')]);return _0x27a311(_0x597d0e[_0xae65('0x11')][_0xae65('0x13')]);}else{logger[_0xae65('0xd')]('Trunk,\x20%s,\x20%s',_0x734ca3,_0xae65('0xe'));_0x27a311(_0x597d0e[_0xae65('0x14')][_0xae65('0x13')]);}})[_0xae65('0x15')](function(_0x511a04){logger['error']('Trunk,\x20%s,\x20%s',_0x734ca3,_0x511a04);_0x5295be(_0x511a04);});});}exports[_0xae65('0x16')]=function(_0x249f60){var _0x37e19d=this;return new Promise(function(_0x4a26ec,_0x27928b){return db['Trunk']['findAll']({'raw':_0x249f60['options']?_0x249f60['options']['raw']===undefined?!![]:![]:!![],'where':_0x249f60[_0xae65('0x17')]?_0x249f60[_0xae65('0x17')][_0xae65('0x18')]||null:null,'attributes':_0x249f60[_0xae65('0x17')]?_0x249f60[_0xae65('0x17')][_0xae65('0x19')]||null:null,'limit':_0x249f60[_0xae65('0x17')]?_0x249f60[_0xae65('0x17')]['limit']||null:null,'include':_0x249f60[_0xae65('0x17')]?_0x249f60[_0xae65('0x17')][_0xae65('0x1a')]?_[_0xae65('0x1b')](_0x249f60[_0xae65('0x17')][_0xae65('0x1a')],function(_0x1c1840){return{'model':db[_0x1c1840[_0xae65('0x1c')]],'as':_0x1c1840['as'],'attributes':_0x1c1840[_0xae65('0x19')],'include':_0x1c1840['include']?_[_0xae65('0x1b')](_0x1c1840[_0xae65('0x1a')],function(_0x34c667){return{'model':db[_0x34c667[_0xae65('0x1c')]],'as':_0x34c667['as'],'attributes':_0x34c667['attributes'],'include':_0x34c667[_0xae65('0x1a')]?_[_0xae65('0x1b')](_0x34c667[_0xae65('0x1a')],function(_0x97a75b){return{'model':db[_0x97a75b[_0xae65('0x1c')]],'as':_0x97a75b['as'],'attributes':_0x97a75b[_0xae65('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x597b20){logger[_0xae65('0xd')](_0xae65('0x16'),_0x249f60);logger[_0xae65('0xf')](_0xae65('0x16'),_0x249f60,JSON[_0xae65('0x1d')](_0x597b20));_0x4a26ec(_0x597b20);})[_0xae65('0x15')](function(_0x2af31e){logger[_0xae65('0x11')](_0xae65('0x16'),_0x2af31e['message'],_0x249f60);_0x27928b(_0x37e19d[_0xae65('0x11')](0x1f4,_0x2af31e[_0xae65('0x13')]));});});};exports[_0xae65('0x1e')]=function(_0xa15f92){var _0x7c6f5c=this;return new Promise(function(_0x521e19,_0x141688){return db[_0xae65('0x1f')][_0xae65('0x20')]({'raw':_0xa15f92[_0xae65('0x17')]?_0xa15f92[_0xae65('0x17')][_0xae65('0x21')]===undefined?!![]:![]:!![],'where':_0xa15f92[_0xae65('0x17')]?_0xa15f92[_0xae65('0x17')][_0xae65('0x18')]||null:null,'attributes':_0xa15f92[_0xae65('0x17')]?_0xa15f92['options']['attributes']||null:null,'include':_0xa15f92[_0xae65('0x17')]?_0xa15f92['options']['include']?_['map'](_0xa15f92[_0xae65('0x17')][_0xae65('0x1a')],function(_0x2d2cc8){return{'model':db[_0x2d2cc8[_0xae65('0x1c')]],'as':_0x2d2cc8['as'],'attributes':_0x2d2cc8[_0xae65('0x19')],'include':_0x2d2cc8[_0xae65('0x1a')]?_[_0xae65('0x1b')](_0x2d2cc8['include'],function(_0x50e9d){return{'model':db[_0x50e9d[_0xae65('0x1c')]],'as':_0x50e9d['as'],'attributes':_0x50e9d[_0xae65('0x19')],'include':_0x50e9d[_0xae65('0x1a')]?_[_0xae65('0x1b')](_0x50e9d['include'],function(_0x5c69fe){return{'model':db[_0x5c69fe[_0xae65('0x1c')]],'as':_0x5c69fe['as'],'attributes':_0x5c69fe[_0xae65('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa380a6){logger[_0xae65('0xd')]('ShowTrunk',_0xa15f92);logger[_0xae65('0xf')]('ShowTrunk',_0xa15f92,JSON[_0xae65('0x1d')](_0xa380a6));_0x521e19(_0xa380a6);})[_0xae65('0x15')](function(_0x377456){logger[_0xae65('0x11')](_0xae65('0x1e'),_0x377456[_0xae65('0x13')],_0xa15f92);_0x141688(_0x7c6f5c[_0xae65('0x11')](0x1f4,_0x377456[_0xae65('0x13')]));});});}; \ No newline at end of file +var _0xebad=['attributes','limit','include','map','model','GetTrunk','debug','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','Trunk','options','where'];(function(_0x1c8a88,_0x3ad9d6){var _0x35d468=function(_0x553f3c){while(--_0x553f3c){_0x1c8a88['push'](_0x1c8a88['shift']());}};_0x35d468(++_0x3ad9d6);}(_0xebad,0x189));var _0xdeba=function(_0xa75a9b,_0x30d6ac){_0xa75a9b=_0xa75a9b-0x0;var _0x76c510=_0xebad[_0xa75a9b];return _0x76c510;};'use strict';var _=require(_0xdeba('0x0'));var util=require(_0xdeba('0x1'));var moment=require(_0xdeba('0x2'));var BPromise=require(_0xdeba('0x3'));var rs=require(_0xdeba('0x4'));var fs=require('fs');var Redis=require(_0xdeba('0x5'));var db=require(_0xdeba('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdeba('0x7'))('rpc');var config=require(_0xdeba('0x8'));var jayson=require(_0xdeba('0x9'));var client=jayson[_0xdeba('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101abd,_0x494e6d,_0x3d5778){return new BPromise(function(_0x3cdf60,_0x1cb8ab){return client['request'](_0x101abd,_0x3d5778)[_0xdeba('0xb')](function(_0x4f25f3){logger[_0xdeba('0xc')](_0xdeba('0xd'),_0x494e6d,_0xdeba('0xe'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x494e6d,'request\x20sent',JSON[_0xdeba('0xf')](_0x4f25f3));if(_0x4f25f3[_0xdeba('0x10')]){if(_0x4f25f3[_0xdeba('0x10')]['code']===0x1f4){logger[_0xdeba('0x10')]('Trunk,\x20%s,\x20%s',_0x494e6d,_0x4f25f3['error'][_0xdeba('0x11')]);return _0x1cb8ab(_0x4f25f3[_0xdeba('0x10')][_0xdeba('0x11')]);}logger[_0xdeba('0x10')](_0xdeba('0xd'),_0x494e6d,_0x4f25f3['error']['message']);return _0x3cdf60(_0x4f25f3[_0xdeba('0x10')]['message']);}else{logger[_0xdeba('0xc')](_0xdeba('0xd'),_0x494e6d,_0xdeba('0xe'));_0x3cdf60(_0x4f25f3[_0xdeba('0x12')][_0xdeba('0x11')]);}})[_0xdeba('0x13')](function(_0x1e7fa0){logger[_0xdeba('0x10')](_0xdeba('0xd'),_0x494e6d,_0x1e7fa0);_0x1cb8ab(_0x1e7fa0);});});}exports['GetTrunk']=function(_0x167933){var _0x12e035=this;return new Promise(function(_0x1ad1d7,_0x3871be){return db[_0xdeba('0x14')]['findAll']({'raw':_0x167933[_0xdeba('0x15')]?_0x167933[_0xdeba('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x167933[_0xdeba('0x15')]?_0x167933['options'][_0xdeba('0x16')]||null:null,'attributes':_0x167933[_0xdeba('0x15')]?_0x167933['options'][_0xdeba('0x17')]||null:null,'limit':_0x167933[_0xdeba('0x15')]?_0x167933['options'][_0xdeba('0x18')]||null:null,'include':_0x167933[_0xdeba('0x15')]?_0x167933[_0xdeba('0x15')][_0xdeba('0x19')]?_[_0xdeba('0x1a')](_0x167933[_0xdeba('0x15')][_0xdeba('0x19')],function(_0x3f8aa9){return{'model':db[_0x3f8aa9[_0xdeba('0x1b')]],'as':_0x3f8aa9['as'],'attributes':_0x3f8aa9[_0xdeba('0x17')],'include':_0x3f8aa9[_0xdeba('0x19')]?_[_0xdeba('0x1a')](_0x3f8aa9[_0xdeba('0x19')],function(_0x5509db){return{'model':db[_0x5509db[_0xdeba('0x1b')]],'as':_0x5509db['as'],'attributes':_0x5509db[_0xdeba('0x17')],'include':_0x5509db[_0xdeba('0x19')]?_[_0xdeba('0x1a')](_0x5509db[_0xdeba('0x19')],function(_0x57ea3c){return{'model':db[_0x57ea3c['model']],'as':_0x57ea3c['as'],'attributes':_0x57ea3c[_0xdeba('0x17')]};}):[]};}):[]};}):[]:[]})[_0xdeba('0xb')](function(_0x1a4f0e){logger[_0xdeba('0xc')](_0xdeba('0x1c'),_0x167933);logger[_0xdeba('0x1d')](_0xdeba('0x1c'),_0x167933,JSON['stringify'](_0x1a4f0e));_0x1ad1d7(_0x1a4f0e);})[_0xdeba('0x13')](function(_0x30509f){logger[_0xdeba('0x10')](_0xdeba('0x1c'),_0x30509f['message'],_0x167933);_0x3871be(_0x12e035[_0xdeba('0x10')](0x1f4,_0x30509f[_0xdeba('0x11')]));});});};exports[_0xdeba('0x1e')]=function(_0x3033fa){var _0x212f09=this;return new Promise(function(_0xe84ee6,_0x1f2c98){return db[_0xdeba('0x14')][_0xdeba('0x1f')]({'raw':_0x3033fa[_0xdeba('0x15')]?_0x3033fa[_0xdeba('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3033fa[_0xdeba('0x15')]?_0x3033fa[_0xdeba('0x15')][_0xdeba('0x16')]||null:null,'attributes':_0x3033fa[_0xdeba('0x15')]?_0x3033fa[_0xdeba('0x15')][_0xdeba('0x17')]||null:null,'include':_0x3033fa[_0xdeba('0x15')]?_0x3033fa[_0xdeba('0x15')][_0xdeba('0x19')]?_['map'](_0x3033fa['options'][_0xdeba('0x19')],function(_0x52981f){return{'model':db[_0x52981f[_0xdeba('0x1b')]],'as':_0x52981f['as'],'attributes':_0x52981f[_0xdeba('0x17')],'include':_0x52981f[_0xdeba('0x19')]?_[_0xdeba('0x1a')](_0x52981f[_0xdeba('0x19')],function(_0x1c8458){return{'model':db[_0x1c8458[_0xdeba('0x1b')]],'as':_0x1c8458['as'],'attributes':_0x1c8458[_0xdeba('0x17')],'include':_0x1c8458[_0xdeba('0x19')]?_[_0xdeba('0x1a')](_0x1c8458[_0xdeba('0x19')],function(_0x3568c6){return{'model':db[_0x3568c6[_0xdeba('0x1b')]],'as':_0x3568c6['as'],'attributes':_0x3568c6[_0xdeba('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe8716e){logger[_0xdeba('0xc')](_0xdeba('0x1e'),_0x3033fa);logger['debug'](_0xdeba('0x1e'),_0x3033fa,JSON['stringify'](_0xe8716e));_0xe84ee6(_0xe8716e);})[_0xdeba('0x13')](function(_0x15431f){logger[_0xdeba('0x10')](_0xdeba('0x1e'),_0x15431f[_0xdeba('0x11')],_0x3033fa);_0x1f2c98(_0x212f09[_0xdeba('0x10')](0x1f4,_0x15431f[_0xdeba('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index b0039c0..71fcdb6 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 _0xb922=['/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/sms_accounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getApiKey','addContacts','post','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','/:id/avatar','single','file','/:id/logout','logout','/:id/pause','pause','/:id/unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','put','update','changePassword','/:id/queues','removeQueues','delete','removeTeams','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','/:id/api_key','removeApiKey','util','path','connect-timeout','express','Router','fs-extra','get','index','/describe','isAuthenticated','/whoami','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getQueues','/:id/queues_rt','getVoiceQueuesRt'];(function(_0x384665,_0x3077be){var _0x2e4a5d=function(_0x26785e){while(--_0x26785e){_0x384665['push'](_0x384665['shift']());}};_0x2e4a5d(++_0x3077be);}(_0xb922,0x1a0));var _0x2b92=function(_0x47e50b,_0x1fdec6){_0x47e50b=_0x47e50b-0x0;var _0x2e6fb3=_0xb922[_0x47e50b];return _0x2e6fb3;};'use strict';var multer=require('multer');var util=require(_0x2b92('0x0'));var path=require(_0x2b92('0x1'));var timeout=require(_0x2b92('0x2'));var express=require(_0x2b92('0x3'));var router=express[_0x2b92('0x4')]();var fs_extra=require(_0x2b92('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./user.controller');router[_0x2b92('0x6')]('/',auth['isAuthenticated'](),controller[_0x2b92('0x7')]);router['get'](_0x2b92('0x8'),auth[_0x2b92('0x9')](),controller['describe']);router[_0x2b92('0x6')](_0x2b92('0xa'),auth['isAuthenticated'](),controller['whoami']);router['get']('/presence',auth[_0x2b92('0x9')](),controller['getPresence']);router['get'](_0x2b92('0xb'),auth['isAuthenticated'](),controller[_0x2b92('0xc')]);router[_0x2b92('0x6')]('/:id/avatar',controller[_0x2b92('0xd')]);router['get'](_0x2b92('0xe'),auth[_0x2b92('0x9')](),controller[_0x2b92('0xf')]);router['get'](_0x2b92('0x10'),auth[_0x2b92('0x9')](),controller['getContacts']);router[_0x2b92('0x6')]('/:id/queues',auth[_0x2b92('0x9')](),controller[_0x2b92('0x11')]);router[_0x2b92('0x6')](_0x2b92('0x12'),auth['isAuthenticated'](),controller[_0x2b92('0x13')]);router['get'](_0x2b92('0x14'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x15')]);router[_0x2b92('0x6')](_0x2b92('0x16'),auth[_0x2b92('0x9')](),controller['getRecordings']);router[_0x2b92('0x6')](_0x2b92('0x17'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x18')]);router['get'](_0x2b92('0x19'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x1a')]);router['get'](_0x2b92('0x1b'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x1c')]);router[_0x2b92('0x6')](_0x2b92('0x1d'),auth[_0x2b92('0x9')](),controller['getMailInteractions']);router[_0x2b92('0x6')]('/:id/sms/interactions',auth[_0x2b92('0x9')](),controller['getSmsInteractions']);router[_0x2b92('0x6')]('/:id/fax/interactions',auth[_0x2b92('0x9')](),controller[_0x2b92('0x1e')]);router['get'](_0x2b92('0x1f'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x20')]);router[_0x2b92('0x6')](_0x2b92('0x21'),auth['isAuthenticated'](),controller[_0x2b92('0x22')]);router['get'](_0x2b92('0x23'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x24')]);router['get']('/:id/agents',auth[_0x2b92('0x9')](),controller[_0x2b92('0x25')]);router['get'](_0x2b92('0x26'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x27')]);router[_0x2b92('0x6')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['getFaxAccounts']);router['get'](_0x2b92('0x28'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x29')]);router[_0x2b92('0x6')]('/:id/openchannel_accounts',auth[_0x2b92('0x9')](),controller['getOpenchannelAccounts']);router[_0x2b92('0x6')](_0x2b92('0x2a'),auth[_0x2b92('0x9')](),controller['getSmsAccounts']);router[_0x2b92('0x6')](_0x2b92('0x2b'),auth[_0x2b92('0x9')](),controller['getChatWebsites']);router[_0x2b92('0x6')](_0x2b92('0x2c'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x2d')]);router[_0x2b92('0x6')](_0x2b92('0x2e'),auth['isAuthenticated'](),controller[_0x2b92('0x2f')]);router['get'](_0x2b92('0x30'),auth[_0x2b92('0x9')](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth['isAuthenticated'](),controller[_0x2b92('0x31')]);router['post']('/:id/contacts',auth[_0x2b92('0x9')](),controller[_0x2b92('0x32')]);router[_0x2b92('0x33')]('/',auth[_0x2b92('0x9')](),controller[_0x2b92('0x34')]);router[_0x2b92('0x33')]('/create_many',auth[_0x2b92('0x9')](),controller[_0x2b92('0x35')]);router[_0x2b92('0x33')]('/:id/queues',auth[_0x2b92('0x9')](),controller[_0x2b92('0x36')]);var upload=multer({'storage':multer[_0x2b92('0x37')]({'destination':function(_0x50f106,_0x23f83c,_0x1b8d6d){_0x1b8d6d(null,path[_0x2b92('0x38')](config[_0x2b92('0x39')],_0x2b92('0x3a')));},'filename':function(_0x253595,_0x5ba869,_0xd4e020){_0xd4e020(null,util[_0x2b92('0x3b')](_0x2b92('0x3c'),Date['now'](),_0x5ba869['originalname']));}})});router[_0x2b92('0x33')](_0x2b92('0x3d'),upload[_0x2b92('0x3e')](_0x2b92('0x3f')),controller['addAvatar']);router[_0x2b92('0x33')]('/:id/login',auth[_0x2b92('0x9')](),controller['login']);router['post'](_0x2b92('0x40'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x41')]);router[_0x2b92('0x33')](_0x2b92('0x42'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x43')]);router['post'](_0x2b92('0x44'),auth['isAuthenticated'](),controller['unpause']);router[_0x2b92('0x33')](_0x2b92('0x21'),auth[_0x2b92('0x9')](),controller['addTeams']);router[_0x2b92('0x33')](_0x2b92('0x45'),auth['isAuthenticated'](),controller[_0x2b92('0x46')]);router['post'](_0x2b92('0x47'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x48')]);router[_0x2b92('0x33')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x2b92('0x49')]);router[_0x2b92('0x33')](_0x2b92('0x4a'),auth['isAuthenticated'](),controller[_0x2b92('0x4b')]);router[_0x2b92('0x33')](_0x2b92('0x4c'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x4d')]);router[_0x2b92('0x33')]('/:id/whatsapp_interactions',auth[_0x2b92('0x9')](),controller[_0x2b92('0x4e')]);router['post'](_0x2b92('0x4f'),auth[_0x2b92('0x9')](),controller['addFaxAccounts']);router[_0x2b92('0x33')](_0x2b92('0x28'),auth['isAuthenticated'](),controller['addMailAccounts']);router['post'](_0x2b92('0x50'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x51')]);router[_0x2b92('0x33')]('/:id/sms_accounts',auth[_0x2b92('0x9')](),controller[_0x2b92('0x52')]);router[_0x2b92('0x33')](_0x2b92('0x2b'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x53')]);router['post']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x2b92('0x54')]);router[_0x2b92('0x33')](_0x2b92('0x2e'),auth['isAuthenticated'](),controller[_0x2b92('0x55')]);router['post']('/:id/api_key',auth[_0x2b92('0x9')](),controller['createApiKey']);router[_0x2b92('0x56')]('/:id',auth[_0x2b92('0x9')](),controller[_0x2b92('0x57')]);router[_0x2b92('0x56')]('/:id/password',auth[_0x2b92('0x9')](),controller[_0x2b92('0x58')]);router['delete'](_0x2b92('0x59'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x5a')]);router[_0x2b92('0x5b')]('/:id/teams',auth[_0x2b92('0x9')](),controller[_0x2b92('0x5c')]);router[_0x2b92('0x5b')](_0x2b92('0xb'),auth[_0x2b92('0x9')](),controller['destroy']);router[_0x2b92('0x5b')]('/:id/chat_interactions',auth[_0x2b92('0x9')](),controller[_0x2b92('0x5d')]);router[_0x2b92('0x5b')](_0x2b92('0x47'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x5e')]);router[_0x2b92('0x5b')](_0x2b92('0x5f'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x2b92('0x5b')]('/:id/sms_interactions',auth[_0x2b92('0x9')](),controller[_0x2b92('0x60')]);router['delete'](_0x2b92('0x4c'),auth['isAuthenticated'](),controller[_0x2b92('0x61')]);router[_0x2b92('0x5b')](_0x2b92('0x62'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x63')]);router[_0x2b92('0x5b')]('/:id/fax_accounts',auth[_0x2b92('0x9')](),controller[_0x2b92('0x64')]);router[_0x2b92('0x5b')](_0x2b92('0x28'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x65')]);router['delete'](_0x2b92('0x50'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x66')]);router[_0x2b92('0x5b')](_0x2b92('0x2a'),auth['isAuthenticated'](),controller[_0x2b92('0x67')]);router['delete'](_0x2b92('0x2b'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x68')]);router['delete'](_0x2b92('0x2c'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x69')]);router[_0x2b92('0x5b')](_0x2b92('0x2e'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x6a')]);router[_0x2b92('0x5b')](_0x2b92('0x6b'),auth['isAuthenticated'](),controller[_0x2b92('0x6c')]);module['exports']=router; \ No newline at end of file +var _0xb33a=['Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','bulkCreate','/:id/queues','diskStorage','join','root','server/files/images/','format','%s-%s','now','single','file','login','/:id/logout','logout','/:id/pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','/:id/api_key','createApiKey','put','update','delete','removeQueues','removeTeams','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout'];(function(_0x35595d,_0x121058){var _0x4b30d9=function(_0x1b86eb){while(--_0x1b86eb){_0x35595d['push'](_0x35595d['shift']());}};_0x4b30d9(++_0x121058);}(_0xb33a,0x15e));var _0xab33=function(_0x11a9b5,_0x18e003){_0x11a9b5=_0x11a9b5-0x0;var _0x1d1573=_0xb33a[_0x11a9b5];return _0x1d1573;};'use strict';var multer=require(_0xab33('0x0'));var util=require(_0xab33('0x1'));var path=require(_0xab33('0x2'));var timeout=require(_0xab33('0x3'));var express=require('express');var router=express[_0xab33('0x4')]();var fs_extra=require(_0xab33('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xab33('0x6'));var config=require(_0xab33('0x7'));var controller=require(_0xab33('0x8'));router[_0xab33('0x9')]('/',auth[_0xab33('0xa')](),controller[_0xab33('0xb')]);router[_0xab33('0x9')]('/describe',auth[_0xab33('0xa')](),controller[_0xab33('0xc')]);router[_0xab33('0x9')](_0xab33('0xd'),auth[_0xab33('0xa')](),controller[_0xab33('0xe')]);router[_0xab33('0x9')](_0xab33('0xf'),auth[_0xab33('0xa')](),controller[_0xab33('0x10')]);router[_0xab33('0x9')](_0xab33('0x11'),auth[_0xab33('0xa')](),controller[_0xab33('0x12')]);router[_0xab33('0x9')](_0xab33('0x13'),controller[_0xab33('0x14')]);router[_0xab33('0x9')](_0xab33('0x15'),auth['isAuthenticated'](),controller[_0xab33('0x16')]);router['get'](_0xab33('0x17'),auth[_0xab33('0xa')](),controller[_0xab33('0x18')]);router[_0xab33('0x9')]('/:id/queues',auth[_0xab33('0xa')](),controller[_0xab33('0x19')]);router['get'](_0xab33('0x1a'),auth[_0xab33('0xa')](),controller[_0xab33('0x1b')]);router[_0xab33('0x9')](_0xab33('0x1c'),auth[_0xab33('0xa')](),controller[_0xab33('0x1d')]);router[_0xab33('0x9')](_0xab33('0x1e'),auth[_0xab33('0xa')](),controller[_0xab33('0x1f')]);router[_0xab33('0x9')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0xab33('0x20')]);router[_0xab33('0x9')]('/:id/chat/interactions',auth[_0xab33('0xa')](),controller[_0xab33('0x21')]);router[_0xab33('0x9')](_0xab33('0x22'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0xab33('0x9')](_0xab33('0x23'),auth['isAuthenticated'](),controller[_0xab33('0x24')]);router[_0xab33('0x9')](_0xab33('0x25'),auth['isAuthenticated'](),controller[_0xab33('0x26')]);router['get'](_0xab33('0x27'),auth[_0xab33('0xa')](),controller[_0xab33('0x28')]);router[_0xab33('0x9')](_0xab33('0x29'),auth[_0xab33('0xa')](),controller[_0xab33('0x2a')]);router['get'](_0xab33('0x2b'),auth[_0xab33('0xa')](),controller['getTeams']);router[_0xab33('0x9')](_0xab33('0x2c'),auth[_0xab33('0xa')](),controller[_0xab33('0x2d')]);router['get'](_0xab33('0x2e'),auth[_0xab33('0xa')](),controller['getAgents']);router[_0xab33('0x9')](_0xab33('0x2f'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0xab33('0x9')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xab33('0x30')]);router[_0xab33('0x9')](_0xab33('0x31'),auth[_0xab33('0xa')](),controller[_0xab33('0x32')]);router['get']('/:id/openchannel_accounts',auth[_0xab33('0xa')](),controller[_0xab33('0x33')]);router[_0xab33('0x9')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xab33('0x34')]);router['get'](_0xab33('0x35'),auth[_0xab33('0xa')](),controller['getChatWebsites']);router[_0xab33('0x9')]('/:id/whatsapp_accounts',auth[_0xab33('0xa')](),controller[_0xab33('0x36')]);router[_0xab33('0x9')](_0xab33('0x37'),auth[_0xab33('0xa')](),controller[_0xab33('0x38')]);router['get'](_0xab33('0x39'),auth[_0xab33('0xa')](),controller[_0xab33('0x3a')]);router[_0xab33('0x9')]('/:id/api_key',auth[_0xab33('0xa')](),controller[_0xab33('0x3b')]);router[_0xab33('0x3c')](_0xab33('0x17'),auth['isAuthenticated'](),controller[_0xab33('0x3d')]);router['post']('/',auth[_0xab33('0xa')](),controller[_0xab33('0x3e')]);router[_0xab33('0x3c')]('/create_many',auth['isAuthenticated'](),controller[_0xab33('0x3f')]);router[_0xab33('0x3c')](_0xab33('0x40'),auth[_0xab33('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0xab33('0x41')]({'destination':function(_0x63a6b9,_0x5bd5b5,_0x2cf5b8){_0x2cf5b8(null,path[_0xab33('0x42')](config[_0xab33('0x43')],_0xab33('0x44')));},'filename':function(_0x1d68ac,_0x5ae28d,_0x35d276){_0x35d276(null,util[_0xab33('0x45')](_0xab33('0x46'),Date[_0xab33('0x47')](),_0x5ae28d['originalname']));}})});router['post'](_0xab33('0x13'),upload[_0xab33('0x48')](_0xab33('0x49')),controller['addAvatar']);router['post']('/:id/login',auth[_0xab33('0xa')](),controller[_0xab33('0x4a')]);router[_0xab33('0x3c')](_0xab33('0x4b'),auth[_0xab33('0xa')](),controller[_0xab33('0x4c')]);router[_0xab33('0x3c')](_0xab33('0x4d'),auth[_0xab33('0xa')](),controller['pause']);router[_0xab33('0x3c')]('/:id/unpause',auth[_0xab33('0xa')](),controller[_0xab33('0x4e')]);router[_0xab33('0x3c')](_0xab33('0x2b'),auth[_0xab33('0xa')](),controller[_0xab33('0x4f')]);router[_0xab33('0x3c')](_0xab33('0x50'),auth[_0xab33('0xa')](),controller[_0xab33('0x51')]);router['post'](_0xab33('0x52'),auth['isAuthenticated'](),controller['addMailInteractions']);router[_0xab33('0x3c')](_0xab33('0x53'),auth[_0xab33('0xa')](),controller[_0xab33('0x54')]);router[_0xab33('0x3c')](_0xab33('0x55'),auth['isAuthenticated'](),controller[_0xab33('0x56')]);router['post']('/:id/openchannel_interactions',auth[_0xab33('0xa')](),controller['addOpenchannelInteractions']);router[_0xab33('0x3c')](_0xab33('0x57'),auth[_0xab33('0xa')](),controller[_0xab33('0x58')]);router[_0xab33('0x3c')](_0xab33('0x59'),auth[_0xab33('0xa')](),controller[_0xab33('0x5a')]);router[_0xab33('0x3c')](_0xab33('0x31'),auth[_0xab33('0xa')](),controller[_0xab33('0x5b')]);router[_0xab33('0x3c')](_0xab33('0x5c'),auth[_0xab33('0xa')](),controller['addOpenchannelAccounts']);router[_0xab33('0x3c')](_0xab33('0x5d'),auth['isAuthenticated'](),controller[_0xab33('0x5e')]);router[_0xab33('0x3c')](_0xab33('0x35'),auth[_0xab33('0xa')](),controller[_0xab33('0x5f')]);router['post'](_0xab33('0x60'),auth[_0xab33('0xa')](),controller[_0xab33('0x61')]);router['post'](_0xab33('0x37'),auth[_0xab33('0xa')](),controller['addSquareProjects']);router['post'](_0xab33('0x62'),auth[_0xab33('0xa')](),controller[_0xab33('0x63')]);router[_0xab33('0x64')](_0xab33('0x11'),auth['isAuthenticated'](),controller[_0xab33('0x65')]);router[_0xab33('0x64')]('/:id/password',auth[_0xab33('0xa')](),controller['changePassword']);router[_0xab33('0x66')](_0xab33('0x40'),auth[_0xab33('0xa')](),controller[_0xab33('0x67')]);router[_0xab33('0x66')](_0xab33('0x2b'),auth[_0xab33('0xa')](),controller[_0xab33('0x68')]);router['delete']('/:id',auth[_0xab33('0xa')](),controller[_0xab33('0x69')]);router[_0xab33('0x66')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['removeChatInteractions']);router['delete'](_0xab33('0x52'),auth[_0xab33('0xa')](),controller[_0xab33('0x6a')]);router[_0xab33('0x66')](_0xab33('0x53'),auth[_0xab33('0xa')](),controller[_0xab33('0x6b')]);router['delete']('/:id/sms_interactions',auth[_0xab33('0xa')](),controller[_0xab33('0x6c')]);router[_0xab33('0x66')](_0xab33('0x6d'),auth[_0xab33('0xa')](),controller['removeOpenchannelInteractions']);router['delete'](_0xab33('0x57'),auth[_0xab33('0xa')](),controller[_0xab33('0x6e')]);router[_0xab33('0x66')](_0xab33('0x59'),auth['isAuthenticated'](),controller[_0xab33('0x6f')]);router['delete'](_0xab33('0x31'),auth['isAuthenticated'](),controller[_0xab33('0x70')]);router['delete']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xab33('0x71')]);router[_0xab33('0x66')](_0xab33('0x5d'),auth[_0xab33('0xa')](),controller['removeSmsAccounts']);router[_0xab33('0x66')](_0xab33('0x35'),auth[_0xab33('0xa')](),controller[_0xab33('0x72')]);router[_0xab33('0x66')]('/:id/whatsapp_accounts',auth[_0xab33('0xa')](),controller[_0xab33('0x73')]);router['delete'](_0xab33('0x37'),auth[_0xab33('0xa')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0xab33('0xa')](),controller[_0xab33('0x74')]);module[_0xab33('0x75')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 2323edc..7f07c7d 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 _0x7c09=['internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','format','getDataValue','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','\x22\x22\x20<>','always','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','isArray','wss','avpf','force_avp','icesupport','dtlsverify','dtlsprivatekey','rtcp_mux','encryption','dtlsenable','dtlssetup','dtlscertfile','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED','moment','util','exports','STRING','name','setDataValue','fullname','callerid','\x22%s\x22\x20<%s>'];(function(_0x154689,_0x1da8c5){var _0x3d0fc2=function(_0x47f038){while(--_0x47f038){_0x154689['push'](_0x154689['shift']());}};_0x3d0fc2(++_0x1da8c5);}(_0x7c09,0x102));var _0x97c0=function(_0x4037cb,_0x4252e0){_0x4037cb=_0x4037cb-0x0;var _0x4d591c=_0x7c09[_0x4037cb];return _0x4d591c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x97c0('0x0'));var util=require(_0x97c0('0x1'));var _=require('lodash');module[_0x97c0('0x2')]={'name':{'type':Sequelize[_0x97c0('0x3')],'allowNull':![],'unique':_0x97c0('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x214897){this[_0x97c0('0x5')](_0x97c0('0x4'),_0x214897);this[_0x97c0('0x5')]('defaultuser',_0x214897);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x46fdd9){this[_0x97c0('0x5')](_0x97c0('0x6'),_0x46fdd9);this[_0x97c0('0x5')](_0x97c0('0x7'),util['format'](_0x97c0('0x8'),_0x46fdd9,this['getDataValue'](_0x97c0('0x9'))));}},'alias':{'type':Sequelize[_0x97c0('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3ba42b){if(_0x3ba42b){this[_0x97c0('0x5')](_0x97c0('0xa'),_0x3ba42b[_0x97c0('0xb')]());}}},'role':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0xd'),_0x97c0('0xe'),_0x97c0('0xf'),_0x97c0('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0x97c0('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':_0x97c0('0x11')},'internal':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x3f2fc2){this[_0x97c0('0x5')](_0x97c0('0x9'),_0x3f2fc2);this['setDataValue'](_0x97c0('0x13'),_0x3f2fc2);this[_0x97c0('0x5')](_0x97c0('0x7'),util[_0x97c0('0x14')](_0x97c0('0x8'),this[_0x97c0('0x15')]('fullname'),_0x3f2fc2));}},'salt':{'type':Sequelize[_0x97c0('0x3')]},'phone':{'type':Sequelize[_0x97c0('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x97c0('0x3')]},'zipcode':{'type':Sequelize[_0x97c0('0x3')]},'userpic':{'type':Sequelize[_0x97c0('0x3')]},'city':{'type':Sequelize[_0x97c0('0x3')]},'country':{'type':Sequelize[_0x97c0('0x3')]},'online':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x97c0('0x17')]},'voicePause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x97c0('0x17')]},'chatCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x97c0('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x97c0('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'defaultValue':_0x97c0('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x19'),'user',_0x97c0('0x1a')),'allowNull':!![],'defaultValue':_0x97c0('0x19')},'context':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x1b'),_0x97c0('0x1c'),_0x97c0('0x1d'),_0x97c0('0x1e'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x97c0('0x1f'),_0x97c0('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'defaultValue':_0x97c0('0x21'),'set':function(_0x9d87a){this[_0x97c0('0x5')](_0x97c0('0x22'),_0x9d87a?_0x9d87a[_0x97c0('0x23')](','):null);},'get':function(){return this[_0x97c0('0x15')](_0x97c0('0x22'))?this[_0x97c0('0x15')](_0x97c0('0x22'))[_0x97c0('0x24')](','):null;},'comment':_0x97c0('0x25')},'dtmfmode':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x26'),_0x97c0('0x27'),'shortinfo',_0x97c0('0x28'),_0x97c0('0x29')),'allowNull':!![],'defaultValue':_0x97c0('0x26')},'directmedia':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no',_0x97c0('0x2b'),_0x97c0('0x2c'),_0x97c0('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'defaultValue':_0x97c0('0x2e'),'set':function(_0x3988d3){this[_0x97c0('0x5')](_0x97c0('0x2f'),_0x3988d3?_0x3988d3[_0x97c0('0x23')](','):null);},'get':function(){return this[_0x97c0('0x15')](_0x97c0('0x2f'))?this[_0x97c0('0x15')](_0x97c0('0x2f'))['split'](','):null;},'comment':_0x97c0('0x30')},'callgroup':{'type':Sequelize[_0x97c0('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x97c0('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x97c0('0x3')]},'language':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x97c0('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x97c0('0x31')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x97c0('0x32'),'set':function(_0x64cfcd){this['setDataValue'](_0x97c0('0x33'),_0x64cfcd?_0x64cfcd[_0x97c0('0x23')](';'):_0x97c0('0x32'));},'get':function(){return this[_0x97c0('0x15')](_0x97c0('0x33'))?this[_0x97c0('0x15')](_0x97c0('0x33'))[_0x97c0('0x24')](';'):null;},'comment':_0x97c0('0x34')},'autoframing':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'set':function(_0x1351d2){this['setDataValue'](_0x97c0('0x35'),_0x1351d2?_0x1351d2[_0x97c0('0x23')](','):null);},'get':function(){return this[_0x97c0('0x15')](_0x97c0('0x35'))?this[_0x97c0('0x15')](_0x97c0('0x35'))[_0x97c0('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x97c0('0xc')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'defaultValue':_0x97c0('0x36')},'amaflags':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x97c0('0xc')]('yes','no'),'allowNull':!![],'defaultValue':_0x97c0('0x2a')},'busylevel':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no',_0x97c0('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x97c0('0xc')]('accept',_0x97c0('0x38'),_0x97c0('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x97c0('0xc')]('uac',_0x97c0('0x3a')),'allowNull':!![],'defaultValue':_0x97c0('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x97c0('0x2a')},'keepalive':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x97c0('0xc')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x97c0('0xc')]('yes','no',_0x97c0('0x3b'),_0x97c0('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x3d'),_0x97c0('0x3e'),_0x97c0('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x97c0('0xc')]('yes','no',_0x97c0('0x2b'),'update',_0x97c0('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x97c0('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x97c0('0x17')]},'passwordResetAt':{'type':Sequelize[_0x97c0('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x97c0('0x41')]},'showWebBar':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0,'set':function(_0x3349df){this[_0x97c0('0x5')](_0x97c0('0x42'),_0x3349df);var _0x54970=this['get']({'plain':!![]});switch(_0x3349df){case 0x0:case 0x1:var _0x17488d=_0x54970[_0x97c0('0x22')]?_[_0x97c0('0x43')](_0x54970[_0x97c0('0x22')])?_0x54970['transport'][_0x97c0('0x23')]():_0x54970[_0x97c0('0x22')]:_0x97c0('0x21');if(_0x17488d===_0x97c0('0x44')){_0x17488d='udp';}this[_0x97c0('0x5')](_0x97c0('0x22'),_0x17488d);this[_0x97c0('0x5')]('encryption','no');this[_0x97c0('0x5')](_0x97c0('0x45'),null);this[_0x97c0('0x5')](_0x97c0('0x46'),null);this[_0x97c0('0x5')](_0x97c0('0x47'),null);this[_0x97c0('0x5')]('dtlsenable',null);this['setDataValue'](_0x97c0('0x48'),null);this[_0x97c0('0x5')]('dtlssetup',null);this[_0x97c0('0x5')]('dtlscertfile',null);this['setDataValue'](_0x97c0('0x49'),null);this['setDataValue'](_0x97c0('0x4a'),'no');break;case 0x2:this[_0x97c0('0x5')]('transport','wss');this['setDataValue'](_0x97c0('0x4b'),'yes');this[_0x97c0('0x5')](_0x97c0('0x45'),_0x97c0('0x2a'));this[_0x97c0('0x5')](_0x97c0('0x46'),_0x97c0('0x2a'));this[_0x97c0('0x5')](_0x97c0('0x47'),_0x97c0('0x2a'));this[_0x97c0('0x5')](_0x97c0('0x4c'),'yes');this[_0x97c0('0x5')](_0x97c0('0x48'),'no');this[_0x97c0('0x5')](_0x97c0('0x4d'),_0x97c0('0x3f'));this['setDataValue'](_0x97c0('0x4e'),_0x54970[_0x97c0('0x4e')]||'/etc/pki/tls/certs/motion.crt');this[_0x97c0('0x5')](_0x97c0('0x49'),_0x54970[_0x97c0('0x49')]||'/etc/pki/tls/private/motion.key');this[_0x97c0('0x5')](_0x97c0('0x4a'),_0x97c0('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x97c0('0x41')],'set':function(_0x4d40cd){this['setDataValue']('permissions',_0x4d40cd?_0x4d40cd[_0x97c0('0x23')](','):[]);},'get':function(){return this[_0x97c0('0x15')](_0x97c0('0x4f'))?_[_0x97c0('0x50')](this[_0x97c0('0x15')](_0x97c0('0x4f'))[_0x97c0('0x24')](','),function(_0x1e28fa){return parseInt(_0x1e28fa,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x97c0('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x97c0('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x97c0('0x51')],'get':function(){return this['getDataValue'](_0x97c0('0x52'))?this[_0x97c0('0x15')](_0x97c0('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x65f918){if(typeof _0x65f918==='string'){var _0x5b8ebd=_0x65f918==='1'?!![]:_0x65f918==='0'?![]:_0x65f918===_0x97c0('0x53')?!![]:_0x65f918===_0x97c0('0x54')?![]:![];this['setDataValue'](_0x97c0('0x55'),_0x5b8ebd);}else{this['setDataValue'](_0x97c0('0x55'),_0x65f918);}}},'blocked':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![],'set':function(_0x5c014f){this[_0x97c0('0x5')]('blocked',_0x5c014f);if(_0x5c014f===!![]){this['setDataValue']('blockedAt',moment());this[_0x97c0('0x5')](_0x97c0('0x56'),0x0);}else{this['setDataValue'](_0x97c0('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x97c0('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x97c0('0x12')](0x5)[_0x97c0('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf06c=['phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','getDataValue','internal','STRING','email','ENUM','user','agent','telephone','INTEGER','accountcode','format','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update','update,nonat','DATE','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlscertfile','dtlsprivatekey','dtlsverify','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','VIRTUAL'];(function(_0xabd6ec,_0x35a8ee){var _0x4623bc=function(_0x1302f4){while(--_0x1302f4){_0xabd6ec['push'](_0xabd6ec['shift']());}};_0x4623bc(++_0x35a8ee);}(_0xf06c,0xc7));var _0xcf06=function(_0x8d0bb1,_0x30c13a){_0x8d0bb1=_0x8d0bb1-0x0;var _0x1c78b0=_0xf06c[_0x8d0bb1];return _0x1c78b0;};'use strict';var Sequelize=require(_0xcf06('0x0'));var moment=require(_0xcf06('0x1'));var util=require(_0xcf06('0x2'));var _=require(_0xcf06('0x3'));module[_0xcf06('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcf06('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2b98f4){this[_0xcf06('0x6')]('name',_0x2b98f4);this[_0xcf06('0x6')](_0xcf06('0x7'),_0x2b98f4);},'comment':_0xcf06('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x22ac40){this['setDataValue'](_0xcf06('0x9'),_0x22ac40);this['setDataValue']('callerid',util['format']('\x22%s\x22\x20<%s>',_0x22ac40,this[_0xcf06('0xa')](_0xcf06('0xb'))));}},'alias':{'type':Sequelize[_0xcf06('0xc')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x463309){if(_0x463309){this['setDataValue'](_0xcf06('0xd'),_0x463309['toLowerCase']());}}},'role':{'type':Sequelize[_0xcf06('0xe')]('admin',_0xcf06('0xf'),_0xcf06('0x10'),_0xcf06('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0xcf06('0xc')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':![],'unique':_0xcf06('0xb'),'set':function(_0x2fd686){this[_0xcf06('0x6')]('internal',_0x2fd686);this[_0xcf06('0x6')](_0xcf06('0x13'),_0x2fd686);this['setDataValue']('callerid',util[_0xcf06('0x14')](_0xcf06('0x15'),this[_0xcf06('0xa')]('fullname'),_0x2fd686));}},'salt':{'type':Sequelize[_0xcf06('0xc')]},'phone':{'type':Sequelize[_0xcf06('0xc')]},'mobile':{'type':Sequelize[_0xcf06('0xc')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xcf06('0xc')]},'userpic':{'type':Sequelize[_0xcf06('0xc')]},'city':{'type':Sequelize[_0xcf06('0xc')]},'country':{'type':Sequelize[_0xcf06('0xc')]},'online':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xcf06('0xc')],'defaultValue':_0xcf06('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xcf06('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xcf06('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'host':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![],'defaultValue':_0xcf06('0x18')},'ipaddr':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'port':{'type':Sequelize[_0xcf06('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x19'),_0xcf06('0xf'),_0xcf06('0x1a')),'allowNull':!![],'defaultValue':_0xcf06('0x19')},'context':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![],'defaultValue':_0xcf06('0x1b')},'callingpres':{'type':Sequelize[_0xcf06('0xe')]('ALLOWED_NOT_SCREENED',_0xcf06('0x1c'),'ALLOWED_FAILED_SCREEN',_0xcf06('0x1d'),_0xcf06('0x1e'),_0xcf06('0x1f'),_0xcf06('0x20'),_0xcf06('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'transport':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![],'defaultValue':_0xcf06('0x22'),'set':function(_0x44d65b){this[_0xcf06('0x6')](_0xcf06('0x23'),_0x44d65b?_0x44d65b[_0xcf06('0x24')](','):null);},'get':function(){return this[_0xcf06('0xa')]('transport')?this[_0xcf06('0xa')](_0xcf06('0x23'))[_0xcf06('0x25')](','):null;},'comment':_0xcf06('0x26')},'dtmfmode':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x27'),_0xcf06('0x28'),_0xcf06('0x29'),_0xcf06('0x2a'),_0xcf06('0x2b')),'allowNull':!![],'defaultValue':_0xcf06('0x27')},'directmedia':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no',_0xcf06('0x2d'),'update',_0xcf06('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'nat':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x1b6820){this[_0xcf06('0x6')](_0xcf06('0x2f'),_0x1b6820?_0x1b6820[_0xcf06('0x24')](','):null);},'get':function(){return this[_0xcf06('0xa')]('nat')?this[_0xcf06('0xa')](_0xcf06('0x2f'))[_0xcf06('0x25')](','):null;},'comment':_0xcf06('0x30')},'callgroup':{'type':Sequelize[_0xcf06('0xc')]},'namedcallgroup':{'type':Sequelize[_0xcf06('0xc')]},'pickupgroup':{'type':Sequelize[_0xcf06('0xc')]},'namedpickupgroup':{'type':Sequelize[_0xcf06('0xc')]},'language':{'type':Sequelize[_0xcf06('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xcf06('0xc')]},'disallow':{'type':Sequelize[_0xcf06('0xc')],'allowNull':![],'defaultValue':_0xcf06('0x31')},'allow':{'type':Sequelize[_0xcf06('0xc')],'allowNull':![],'defaultValue':_0xcf06('0x32'),'set':function(_0x446972){this[_0xcf06('0x6')](_0xcf06('0x33'),_0x446972?_0x446972['join'](';'):_0xcf06('0x32'));},'get':function(){return this['getDataValue'](_0xcf06('0x33'))?this[_0xcf06('0xa')](_0xcf06('0x33'))['split'](';'):null;},'comment':_0xcf06('0x34')},'autoframing':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![],'set':function(_0x42b847){this['setDataValue']('insecure',_0x42b847?_0x42b847[_0xcf06('0x24')](','):null);},'get':function(){return this['getDataValue'](_0xcf06('0x35'))?this[_0xcf06('0xa')](_0xcf06('0x35'))[_0xcf06('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcf06('0xe')]('yes','no',_0xcf06('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcf06('0x37')},'amaflags':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'allowNull':!![],'defaultValue':_0xcf06('0x2c')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xcf06('0xe')]('yes','no',_0xcf06('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xcf06('0x39'),_0xcf06('0x3a'),_0xcf06('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xcf06('0x3c'),'uas'),'allowNull':!![],'defaultValue':_0xcf06('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no',_0xcf06('0x3e'),_0xcf06('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x40'),_0xcf06('0x41'),_0xcf06('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no',_0xcf06('0x2d'),_0xcf06('0x43'),_0xcf06('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xcf06('0xc')]},'resetPasswordExpires':{'type':Sequelize[_0xcf06('0x45')]},'passwordResetAt':{'type':Sequelize[_0xcf06('0x45')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xcf06('0x46')]},'showWebBar':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0,'set':function(_0x3a3af4){this[_0xcf06('0x6')](_0xcf06('0x47'),_0x3a3af4);var _0x54fcc9=this[_0xcf06('0x48')]({'plain':!![]});switch(_0x3a3af4){case 0x0:case 0x1:var _0x16faf1=_0x54fcc9[_0xcf06('0x23')]?_[_0xcf06('0x49')](_0x54fcc9[_0xcf06('0x23')])?_0x54fcc9['transport'][_0xcf06('0x24')]():_0x54fcc9[_0xcf06('0x23')]:_0xcf06('0x22');if(_0x16faf1===_0xcf06('0x4a')){_0x16faf1='udp';}this[_0xcf06('0x6')](_0xcf06('0x23'),_0x16faf1);this[_0xcf06('0x6')](_0xcf06('0x4b'),'no');this[_0xcf06('0x6')](_0xcf06('0x4c'),null);this[_0xcf06('0x6')](_0xcf06('0x4d'),null);this['setDataValue'](_0xcf06('0x4e'),null);this['setDataValue'](_0xcf06('0x4f'),null);this[_0xcf06('0x6')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this[_0xcf06('0x6')](_0xcf06('0x50'),null);this[_0xcf06('0x6')](_0xcf06('0x51'),null);this[_0xcf06('0x6')]('rtcp_mux','no');break;case 0x2:this[_0xcf06('0x6')](_0xcf06('0x23'),'wss');this['setDataValue']('encryption',_0xcf06('0x2c'));this[_0xcf06('0x6')]('avpf','yes');this[_0xcf06('0x6')]('force_avp',_0xcf06('0x2c'));this[_0xcf06('0x6')](_0xcf06('0x4e'),_0xcf06('0x2c'));this[_0xcf06('0x6')]('dtlsenable',_0xcf06('0x2c'));this['setDataValue'](_0xcf06('0x52'),'no');this[_0xcf06('0x6')](_0xcf06('0x53'),'actpass');this[_0xcf06('0x6')](_0xcf06('0x50'),_0x54fcc9['dtlscertfile']||_0xcf06('0x54'));this[_0xcf06('0x6')](_0xcf06('0x51'),_0x54fcc9['dtlsprivatekey']||_0xcf06('0x55'));this['setDataValue'](_0xcf06('0x56'),_0xcf06('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0xcf06('0x46')],'set':function(_0x209608){this['setDataValue']('permissions',_0x209608?_0x209608[_0xcf06('0x24')](','):[]);},'get':function(){return this[_0xcf06('0xa')](_0xcf06('0x57'))?_['map'](this[_0xcf06('0xa')]('permissions')[_0xcf06('0x25')](','),function(_0x51fc0b){return parseInt(_0x51fc0b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xcf06('0xc')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xcf06('0xc')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xcf06('0xc')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xcf06('0xc')]},'phoneBarEnableJaws':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xcf06('0x58')],'get':function(){return this[_0xcf06('0xa')](_0xcf06('0x59'))?this['getDataValue'](_0xcf06('0x59')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xcf06('0xc')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![],'set':function(_0x16d72f){if(typeof _0x16d72f==='string'){var _0x2d775b=_0x16d72f==='1'?!![]:_0x16d72f==='0'?![]:_0x16d72f===_0xcf06('0x5a')?!![]:_0x16d72f===_0xcf06('0x5b')?![]:![];this[_0xcf06('0x6')](_0xcf06('0x5c'),_0x2d775b);}else{this[_0xcf06('0x6')](_0xcf06('0x5c'),_0x16d72f);}}},'blocked':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![],'set':function(_0x3e9c84){this[_0xcf06('0x6')]('blocked',_0x3e9c84);if(_0x3e9c84===!![]){this['setDataValue']('blockedAt',moment());this[_0xcf06('0x6')](_0xcf06('0x5d'),0x0);}else{this[_0xcf06('0x6')](_0xcf06('0x5e'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xcf06('0x12')](0x5)[_0xcf06('0x5f')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index bfed882..e1fc155 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 _0x65c9=['then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','set','update','destroy','get','role','admin','Users','user','Agents','Telephones','filter','ignore','map','value','includes','find','UserProfileResource','end','stack','name','send','index','User','fieldName','type','key','password','salt','getOptions','where','query','includeAll','include','attributes','push','findAll','openTabs','true','rows','chat','sms','fax','dataValues','mail','whatsapp','show','model','differenceBy','keys','rawAttributes','filters','intersection','fields','merge','options','all','body','params','describe','addContacts','omit','ids','Setting','securePassword','internal','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','QueryTypes','SELECT','length','isNil','from','voicemail','mailbox','agent','permissions','101','103','110','104','106','107','108','109','100','111','114','115','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','bulkCreate','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','some','telephone','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','QueueId','emit','voice','VoiceQueue','interface','each','upsert','remove','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','getAvatar','root','existsSync','join','download','server/files/images/','openchannel','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','CmContact','order','sort','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','limit','getQueues','Queue','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','format','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','%s%s','Pause','manual','getTeams','Team','setDataValue','Chat','getMailQueues','Mail','Sms','getWhatsappQueues','getFaxQueues','getOpenchannelQueues','flatten','transaction','getDataValue','Voice','removeTeams','getChatQueues','Whatsapp','Fax','Openchannel','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','spread','user_has_mail_interactions:save','removeMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','Contact','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','lower','col','toString','asc','desc','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','moment','bluebird','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','socket.io-emitter','redis','./user.socket','register','defaults','client','http','request'];(function(_0x2b7c18,_0x1e914c){var _0x3ef88e=function(_0x367f71){while(--_0x367f71){_0x2b7c18['push'](_0x2b7c18['shift']());}};_0x3ef88e(++_0x1e914c);}(_0x65c9,0x182));var _0x965c=function(_0x1df42e,_0x317735){_0x1df42e=_0x1df42e-0x0;var _0x5426b7=_0x65c9[_0x1df42e];return _0x5426b7;};'use strict';var moment=require(_0x965c('0x0'));var BPromise=require(_0x965c('0x1'));var util=require('util');var path=require(_0x965c('0x2'));var fs=require('fs');var _=require(_0x965c('0x3'));var squel=require(_0x965c('0x4'));var jayson=require(_0x965c('0x5'));var Redis=require(_0x965c('0x6'));var authService=require(_0x965c('0x7'));var qs=require(_0x965c('0x8'));var logger=require(_0x965c('0x9'))(_0x965c('0xa'));var utils=require(_0x965c('0xb'));var config=require(_0x965c('0xc'));var licenseUtil=require(_0x965c('0xd'));var db=require('../../mysqldb')['db'];var socket=require(_0x965c('0xe'))(new Redis(config[_0x965c('0xf')]));require(_0x965c('0x10'))[_0x965c('0x11')](socket);config[_0x965c('0xf')]=_[_0x965c('0x12')](config[_0x965c('0xf')],{'host':'localhost','port':0x18eb});var client=jayson[_0x965c('0x13')][_0x965c('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x3cf622,_0x363d74,_0x1dfd94,_0x2cc0ae){return new BPromise(function(_0x12151f,_0x26b2f6){var _0x3b5e1d=_0x2cc0ae||client;return _0x3b5e1d[_0x965c('0x15')](_0x3cf622,_0x1dfd94)[_0x965c('0x16')](function(_0x1d5cb4){logger[_0x965c('0x17')](_0x965c('0x18'),_0x363d74,'request\x20sent');logger[_0x965c('0x19')](_0x965c('0x1a'),_0x363d74,_0x965c('0x1b'),JSON['stringify'](_0x1d5cb4));if(_0x1d5cb4[_0x965c('0x1c')]){if(_0x1d5cb4[_0x965c('0x1c')][_0x965c('0x1d')]===0x1f4){logger['error'](_0x965c('0x18'),_0x363d74,_0x1d5cb4['error']['message']);return _0x26b2f6(_0x1d5cb4['error'][_0x965c('0x1e')]);}logger[_0x965c('0x1c')](_0x965c('0x18'),_0x363d74,_0x1d5cb4[_0x965c('0x1c')]['message']);return _0x12151f(_0x1d5cb4['error']['message']);}else{logger[_0x965c('0x17')](_0x965c('0x18'),_0x363d74,_0x965c('0x1b'));_0x12151f(_0x1d5cb4[_0x965c('0x1f')][_0x965c('0x1e')]);}})[_0x965c('0x20')](function(_0x2e41e5){logger[_0x965c('0x1c')](_0x965c('0x18'),_0x363d74,_0x2e41e5);_0x26b2f6(_0x2e41e5);});});}function respondWithStatusCode(_0x3a9260,_0xa2c510){_0xa2c510=_0xa2c510||0xcc;return function(_0x4be8a8){if(_0x4be8a8){return _0x3a9260[_0x965c('0x21')](_0xa2c510);}return _0x3a9260[_0x965c('0x22')](_0xa2c510)['end']();};}function respondWithResult(_0x490626,_0x364dd3){_0x364dd3=_0x364dd3||0xc8;return function(_0x5e25b2){if(_0x5e25b2){return _0x490626[_0x965c('0x22')](_0x364dd3)[_0x965c('0x23')](_0x5e25b2);}};}function respondWithFilteredResult(_0x3dcfa2,_0x4d41e5){return function(_0x11d518){if(_0x11d518){var _0x7b8907=typeof _0x4d41e5[_0x965c('0x24')]===_0x965c('0x25')&&typeof _0x4d41e5['limit']===_0x965c('0x25');var _0x4db10a=_0x11d518['count'];var _0x4d19f6=_0x7b8907?0x0:_0x4d41e5[_0x965c('0x24')];var _0x327aa6=_0x7b8907?_0x11d518[_0x965c('0x26')]:_0x4d41e5['offset']+_0x4d41e5['limit'];var _0x5574e2;if(_0x327aa6>=_0x4db10a){_0x327aa6=_0x4db10a;_0x5574e2=0xc8;}else{_0x5574e2=0xce;}_0x3dcfa2['status'](_0x5574e2);return _0x3dcfa2[_0x965c('0x27')]('Content-Range',_0x4d19f6+'-'+_0x327aa6+'/'+_0x4db10a)[_0x965c('0x23')](_0x11d518);}return null;};}function saveUpdates(_0xa21a2f){return function(_0x9227f8){if(_0x9227f8){return _0x9227f8[_0x965c('0x28')](_0xa21a2f)[_0x965c('0x16')](function(_0x392a54){return _0x392a54;});}return null;};}function removeEntity(_0x2fd2c7){return function(_0x2231d8){if(_0x2231d8){return _0x2231d8[_0x965c('0x29')]()['then'](function(){var _0x2a1b9d=_0x2231d8[_0x965c('0x2a')]({'plain':!![]});if(_0x2a1b9d[_0x965c('0x2b')]===_0x965c('0x2c'))return;var _0x238b4a=[{'name':_0x965c('0x2d'),'value':_0x965c('0x2e'),'ignore':!![]},{'name':_0x965c('0x2f'),'value':'agent','ignore':![]},{'name':_0x965c('0x30'),'value':'telephone','ignore':![]}];var _0x4e0b3c=_(_0x238b4a)[_0x965c('0x31')](_0x965c('0x32'))[_0x965c('0x33')]('value')[_0x965c('0x34')]();if(_[_0x965c('0x35')](_0x4e0b3c,_0x2a1b9d[_0x965c('0x2b')])){return;}var _0x5cacdd=_[_0x965c('0x36')](_0x238b4a,[_0x965c('0x34'),_0x2a1b9d[_0x965c('0x2b')]])['name'];return db[_0x965c('0x37')][_0x965c('0x29')]({'where':{'type':_0x5cacdd,'resourceId':_0x2a1b9d['id']}})[_0x965c('0x16')](function(){return _0x2231d8;});})[_0x965c('0x16')](function(){_0x2fd2c7[_0x965c('0x22')](0xcc)[_0x965c('0x38')]();});}};}function handleEntityNotFound(_0x5c2928){return function(_0x28a06a){if(!_0x28a06a){_0x5c2928[_0x965c('0x21')](0x194);}return _0x28a06a;};}function handleError(_0xd66556,_0x3f2861){_0x3f2861=_0x3f2861||0x1f4;return function(_0x16c8db){logger[_0x965c('0x1c')](_0x16c8db[_0x965c('0x39')]);if(_0x16c8db[_0x965c('0x3a')]){delete _0x16c8db['name'];}_0xd66556[_0x965c('0x22')](_0x3f2861)[_0x965c('0x3b')](_0x16c8db);};}exports[_0x965c('0x3c')]=function(_0x31b818,_0x4845d0){var _0x207286={},_0x452183={'count':0x0,'rows':[]};var _0x2b12a5=_(db[_0x965c('0x3d')]['rawAttributes'])[_0x965c('0x33')](function(_0x5b6b83){return{'name':_0x5b6b83[_0x965c('0x3e')],'type':_0x5b6b83[_0x965c('0x3f')][_0x965c('0x40')]};})[_0x965c('0x31')](function(_0x15924f){return!_['includes']([_0x965c('0x41'),_0x965c('0x42')],_0x15924f[_0x965c('0x3a')]);})[_0x965c('0x34')]();_0x207286=qs[_0x965c('0x43')](_0x2b12a5,_0x31b818);var _0xe498d2={'where':_0x207286[_0x965c('0x44')]};return db[_0x965c('0x3d')]['count'](_0xe498d2)[_0x965c('0x16')](function(_0x34fb66){_0x452183[_0x965c('0x26')]=_0x34fb66;if(_0x31b818[_0x965c('0x45')][_0x965c('0x46')]){_0x207286[_0x965c('0x47')]=[{'all':!![]}];}if(!_[_0x965c('0x35')](_0x207286[_0x965c('0x48')],'id')){_0x207286[_0x965c('0x48')][_0x965c('0x49')]('id');}return db['User'][_0x965c('0x4a')](_0x207286);})['then'](function(_0x2090e4){_0x452183['rows']=_0x2090e4;if(_0x31b818[_0x965c('0x45')][_0x965c('0x4b')]===_0x965c('0x4c')){var _0x48d94=[];for(var _0x19af9d=0x0;_0x19af9d<_0x452183[_0x965c('0x4d')]['length'];_0x19af9d++){_0x48d94['push'](get_open_tabs(_0x965c('0x4e'),_0x452183[_0x965c('0x4d')][_0x19af9d]['dataValues']));_0x48d94[_0x965c('0x49')](get_open_tabs(_0x965c('0x4f'),_0x452183[_0x965c('0x4d')][_0x19af9d]['dataValues']));_0x48d94[_0x965c('0x49')](get_open_tabs(_0x965c('0x50'),_0x452183[_0x965c('0x4d')][_0x19af9d][_0x965c('0x51')]));_0x48d94[_0x965c('0x49')](get_open_tabs(_0x965c('0x52'),_0x452183[_0x965c('0x4d')][_0x19af9d][_0x965c('0x51')]));_0x48d94['push'](get_open_tabs('openchannel',_0x452183['rows'][_0x19af9d][_0x965c('0x51')]));_0x48d94[_0x965c('0x49')](get_open_tabs(_0x965c('0x53'),_0x452183['rows'][_0x19af9d]['dataValues']));}return BPromise['all'](_0x48d94)['then'](function(_0x32a80e){return _0x452183;});}else{return _0x452183;}})['then'](respondWithFilteredResult(_0x4845d0,_0x207286))[_0x965c('0x20')](handleError(_0x4845d0,null));};exports[_0x965c('0x54')]=function(_0x133a86,_0x21ce0d){var _0x1560a9={'raw':![],'where':{'id':_0x133a86['params']['id']}},_0xa345d2={};_0xa345d2[_0x965c('0x55')]=_[_0x965c('0x56')](_[_0x965c('0x57')](db['User'][_0x965c('0x58')]),[_0x965c('0x41'),_0x965c('0x42')]);_0xa345d2['query']=_['keys'](_0x133a86[_0x965c('0x45')]);_0xa345d2[_0x965c('0x59')]=_[_0x965c('0x5a')](_0xa345d2[_0x965c('0x55')],_0xa345d2[_0x965c('0x45')]);_0x1560a9[_0x965c('0x48')]=_[_0x965c('0x5a')](_0xa345d2[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x133a86[_0x965c('0x45')][_0x965c('0x5b')]));_0x1560a9[_0x965c('0x48')]=_0x1560a9[_0x965c('0x48')]['length']?_0x1560a9[_0x965c('0x48')]:_0xa345d2[_0x965c('0x55')];if(_0x133a86[_0x965c('0x45')][_0x965c('0x46')]){_0x1560a9[_0x965c('0x47')]=[{'all':!![]}];}_0x1560a9=_[_0x965c('0x5c')]({},_0x1560a9,_0x133a86[_0x965c('0x5d')]);if(!_[_0x965c('0x35')](_0x1560a9[_0x965c('0x48')],'id')){_0x1560a9['attributes'][_0x965c('0x49')]('id');}return db[_0x965c('0x3d')]['find'](_0x1560a9)['then'](handleEntityNotFound(_0x21ce0d,null))[_0x965c('0x16')](function(_0x21e399){var _0x54fca4=[];values=_0x21e399;if(_0x133a86['query'][_0x965c('0x4b')]===_0x965c('0x4c')){_0x54fca4[_0x965c('0x49')](get_open_tabs(_0x965c('0x4e'),_0x21e399[_0x965c('0x51')]));_0x54fca4[_0x965c('0x49')](get_open_tabs(_0x965c('0x4f'),_0x21e399[_0x965c('0x51')]));_0x54fca4[_0x965c('0x49')](get_open_tabs('openchannel',_0x21e399[_0x965c('0x51')]));_0x54fca4[_0x965c('0x49')](get_open_tabs(_0x965c('0x53'),_0x21e399['dataValues']));_0x54fca4[_0x965c('0x49')](get_open_tabs(_0x965c('0x50'),_0x21e399[_0x965c('0x51')]));_0x54fca4[_0x965c('0x49')](get_open_tabs('mail',_0x21e399[_0x965c('0x51')]));return BPromise[_0x965c('0x5e')](_0x54fca4);}else{return values;}})['then'](function(_0x90c3aa){return values;})['then'](respondWithResult(_0x21ce0d,null))[_0x965c('0x20')](handleError(_0x21ce0d,null));};exports[_0x965c('0x28')]=function(_0x5e6a5d,_0x2334f4){if(_0x5e6a5d[_0x965c('0x5f')]['id']){delete _0x5e6a5d[_0x965c('0x5f')]['id'];}delete _0x5e6a5d[_0x965c('0x5f')]['role'];return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x5e6a5d[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0x2334f4,null))['then'](saveUpdates(_0x5e6a5d[_0x965c('0x5f')],null))[_0x965c('0x16')](respondWithResult(_0x2334f4,null))[_0x965c('0x20')](handleError(_0x2334f4,null));};exports[_0x965c('0x61')]=function(_0x419816,_0x1bb5be){return db[_0x965c('0x3d')][_0x965c('0x61')]()[_0x965c('0x16')](respondWithResult(_0x1bb5be,null))[_0x965c('0x20')](handleError(_0x1bb5be,null));};exports[_0x965c('0x62')]=function(_0x1106a9,_0x512eae){return db[_0x965c('0x3d')]['find']({'where':{'id':_0x1106a9[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x512eae,null))['then'](function(_0x6611b9){if(_0x6611b9){return _0x6611b9[_0x965c('0x62')](_0x1106a9[_0x965c('0x5f')]['ids'],_[_0x965c('0x63')](_0x1106a9['body'],[_0x965c('0x64'),'id'])||{});}})[_0x965c('0x16')](respondWithResult(_0x512eae,null))[_0x965c('0x20')](handleError(_0x512eae,null));};function validateUser(_0x116999){return new BPromise(function(_0x2ad76c,_0x181bce){if(_0x116999['internal'])return _0x2ad76c(_0x116999);return db[_0x965c('0x65')]['findById'](0x1)[_0x965c('0x16')](function(_0x1493b0){if(_0x1493b0[_0x965c('0x66')])authService['validatePasswordPattern'](_0x116999['password']);db[_0x965c('0x3d')]['max']('internal')['then'](function(_0x1fdc19){if(_['isNil'](_0x1fdc19)){_0x116999[_0x965c('0x67')]=_0x1493b0['min_internal']||0x1;return;}if(_['isNil'](_0x1493b0[_0x965c('0x68')])||_0x1493b0[_0x965c('0x68')]===_0x1fdc19){_0x116999[_0x965c('0x67')]=_0x1fdc19+0x1;return;}if(_0x1493b0['min_internal']>_0x1fdc19){_0x116999[_0x965c('0x67')]=_0x1493b0[_0x965c('0x68')];return;}return db['sequelize'][_0x965c('0x45')](_0x965c('0x69'),{'type':db[_0x965c('0x6a')][_0x965c('0x6b')][_0x965c('0x6c')]})[_0x965c('0x16')](function(_0x54da27){if(_0x54da27&&_0x54da27[_0x965c('0x6d')]){for(var _0x46b83c=0x0,_0x457bf2=_0x54da27['length'];_0x46b83c<_0x457bf2&&_[_0x965c('0x6e')](_0x116999[_0x965c('0x67')]);_0x46b83c++){if(_0x1493b0['min_internal']<=_0x54da27[_0x46b83c][_0x965c('0x6f')]){_0x116999[_0x965c('0x67')]=_0x54da27[_0x46b83c][_0x965c('0x6f')];}else if(_0x1493b0[_0x965c('0x68')]>_0x54da27[_0x46b83c]['from']&&_0x1493b0[_0x965c('0x68')]<=_0x54da27[_0x46b83c]['to']){_0x116999[_0x965c('0x67')]=_0x1493b0[_0x965c('0x68')];}}}if(_[_0x965c('0x6e')](_0x116999[_0x965c('0x67')])){_0x116999[_0x965c('0x67')]=_0x1fdc19+0x1;}return _0x2ad76c(_0x116999);});});})['catch'](function(_0x3c5a4c){_0x181bce(_0x3c5a4c);});});}function updateUser(_0x36409e){return new BPromise(function(_0x16f23c,_0x347fc6){try{if(_0x36409e[_0x965c('0x70')]){_0x36409e[_0x965c('0x71')]=_0x36409e[_0x965c('0x67')];_0x36409e['VoiceMail']={'mailbox':_0x36409e[_0x965c('0x67')],'password':_0x36409e[_0x965c('0x41')],'fullname':_0x36409e['fullname'],'email':_0x36409e['email']};}if(_0x36409e[_0x965c('0x2b')]===_0x965c('0x72')){if(!_0x36409e[_0x965c('0x73')])_0x36409e[_0x965c('0x73')]=[_0x965c('0x74'),'102',_0x965c('0x75'),'113',_0x965c('0x76'),_0x965c('0x77'),'105',_0x965c('0x78'),_0x965c('0x79'),_0x965c('0x7a'),_0x965c('0x7b'),_0x965c('0x7c'),_0x965c('0x7d'),_0x965c('0x7e'),_0x965c('0x7f')];}_0x16f23c(_0x36409e);}catch(_0x26a937){_0x347fc6(_0x26a937);}});}exports[_0x965c('0x80')]=function(_0x5395cd,_0x3020dc){if(_0x5395cd[_0x965c('0x2e')][_0x965c('0x2b')]==='agent')throw new Error('Unauthorized');if(_0x5395cd[_0x965c('0x5f')][_0x965c('0x2b')]===_0x965c('0x2e')&&_0x5395cd[_0x965c('0x2e')]['role']!=='admin'){throw new Error(_0x965c('0x81'));}if(_0x5395cd[_0x965c('0x5f')][_0x965c('0x2b')]===_0x965c('0x2c')&&_0x5395cd['user'][_0x965c('0x2b')]!==_0x965c('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x965c('0x82')]([_0x5395cd[_0x965c('0x5f')]])[_0x965c('0x16')](function(){return validateUser(_0x5395cd['body']);})[_0x965c('0x16')](function(_0x2b0f14){return updateUser(_0x2b0f14)[_0x965c('0x16')](function(_0x5e3697){if(_0x5e3697[_0x965c('0x2b')]===_0x965c('0x2c')){_0x5e3697['settingsEnabled']=_0x5395cd[_0x965c('0x2e')][_0x965c('0x83')];delete _0x5e3697[_0x965c('0x84')];}return _0x5e3697;});})['then'](function(_0x156d79){return db['User'][_0x965c('0x80')](_0x156d79,{'include':[{'model':db[_0x965c('0x85')],'as':_0x965c('0x85')}]});})[_0x965c('0x16')](function(_0x578717){if(_0x5395cd[_0x965c('0x5f')][_0x965c('0x2b')]===_0x965c('0x2e'))return _0x578717;if(_0x5395cd[_0x965c('0x2e')]['role']!==_0x965c('0x2e'))return _0x578717;return db[_0x965c('0x86')]['find']({'where':{'name':_0x578717['role']===_0x965c('0x72')?_0x965c('0x2f'):_0x965c('0x30'),'userProfileId':_0x5395cd[_0x965c('0x2e')][_0x965c('0x84')]},'raw':!![]})[_0x965c('0x16')](function(_0x287c0f){if(!_0x287c0f||_0x287c0f[_0x965c('0x87')]!=0x0)return _0x578717;return db['UserProfileResource'][_0x965c('0x80')]({'name':_0x578717[_0x965c('0x3a')],'resourceId':_0x578717['id'],'type':_0x287c0f[_0x965c('0x3a')],'sectionId':_0x287c0f['id']},{})[_0x965c('0x16')](function(){return _0x578717;});})[_0x965c('0x20')](function(_0x3bd8d4){logger[_0x965c('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bd8d4);throw _0x3bd8d4;});})[_0x965c('0x16')](respondWithResult(_0x3020dc,0xc9))[_0x965c('0x20')](handleError(_0x3020dc,null));};exports[_0x965c('0x88')]=function(_0x56acde,_0x3c5b4a){var _0x99d277=_0x56acde['body'];var _0x318ca8=[];if(_0x56acde[_0x965c('0x2e')][_0x965c('0x2b')]===_0x965c('0x72'))throw new Error(_0x965c('0x89'));if(_['some'](_0x99d277,['role',_0x965c('0x2e')])&&_0x56acde['user']['role']!==_0x965c('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x99d277,['role',_0x965c('0x2c')])&&_0x56acde[_0x965c('0x2e')][_0x965c('0x2b')]!==_0x965c('0x2c')){throw new Error(_0x965c('0x8a'));}return licenseUtil[_0x965c('0x82')](_0x99d277)['then'](function(){return validateUser(_0x99d277[0x0]);})['then'](function(){for(var _0x4eeccc=0x1;_0x4eeccc<_0x99d277['length'];_0x4eeccc++){var _0x17bae1=_0x99d277[_0x4eeccc-0x1][_0x965c('0x67')];if(!_0x99d277[_0x4eeccc][_0x965c('0x67')])_0x99d277[_0x4eeccc][_0x965c('0x67')]=_0x17bae1+0x1;_0x318ca8[_0x965c('0x49')](validateUser(_0x99d277[_0x4eeccc]));}return BPromise[_0x965c('0x5e')](_0x318ca8);})[_0x965c('0x16')](function(){_0x318ca8=[];for(var _0xbba18b=0x0;_0xbba18b<_0x99d277[_0x965c('0x6d')];_0xbba18b++){_0x318ca8['push'](updateUser(_0x99d277[_0xbba18b]));}return BPromise['all'](_0x318ca8);})[_0x965c('0x16')](function(){return BPromise['each'](_0x99d277,function(_0x5a2c62){return db[_0x965c('0x3d')][_0x965c('0x80')](_0x5a2c62,{'include':[{'model':db['VoiceMail'],'as':_0x965c('0x85')}]})[_0x965c('0x16')](function(_0xf81bc9){_0x5a2c62['id']=_0xf81bc9['id'];return _0x5a2c62;});});})[_0x965c('0x16')](function(_0x225174){if(_0x56acde['body'][_0x965c('0x2b')]===_0x965c('0x2e'))return _0x225174;if(_0x56acde['user']['role']!==_0x965c('0x2e'))return _0x225174;var _0x26500a=_[_0x965c('0x8b')](_0x225174,function(_0x284666){return _0x284666[_0x965c('0x2b')]===_0x965c('0x72')||_0x284666['role']===_0x965c('0x8c');});if(!_0x26500a)return _0x225174;return db[_0x965c('0x86')][_0x965c('0x4a')]({'where':{'name':{'$or':[_0x965c('0x2f'),'Telephones']},'userProfileId':_0x56acde['user'][_0x965c('0x84')]},'raw':!![]})[_0x965c('0x16')](function(_0x59dc4c){if(_[_0x965c('0x8d')](_0x59dc4c)||!_[_0x965c('0x8b')](_0x59dc4c,['autoAssociation',0x0]))return _0x225174;_0x318ca8=[];var _0xc749d1=_(_0x59dc4c)[_0x965c('0x33')](function(_0x3327f6){if(_0x3327f6[_0x965c('0x87')]===0x1)return;return _0x3327f6['name']===_0x965c('0x2f')?'agent':'telephone';})[_0x965c('0x8e')]()[_0x965c('0x34')]();for(var _0x3bd3ac=0x0;_0x3bd3ac<_0x225174[_0x965c('0x6d')];_0x3bd3ac++){if(!_[_0x965c('0x35')](_0xc749d1,_0x225174[_0x3bd3ac][_0x965c('0x2b')]))return;var _0x12209f=_0x225174[_0x3bd3ac][_0x965c('0x2b')]==='agent'?_0x965c('0x2f'):_0x965c('0x30');_0x318ca8[_0x965c('0x49')](db[_0x965c('0x37')]['create']({'name':_0x225174[_0x3bd3ac]['name'],'resourceId':_0x225174[_0x3bd3ac]['id'],'type':_0x12209f,'sectionId':_['find'](_0x59dc4c,[_0x965c('0x3a'),_0x12209f])['id']},{}));}return BPromise[_0x965c('0x5e')](_0x318ca8);});})[_0x965c('0x16')](respondWithResult(_0x3c5b4a,0xc9))[_0x965c('0x20')](handleError(_0x3c5b4a,null));};exports[_0x965c('0x8f')]=function(_0x168532,_0x1484c1){if(_0x168532[_0x965c('0x5f')]['id']){delete _0x168532['body']['id'];}return db[_0x965c('0x3d')]['find']({'where':{'id':_0x168532['params']['id']}})['then'](function(_0x25f812){if(!_0x25f812)return null;if(_0x25f812['id']===_0x168532[_0x965c('0x2e')]['id']){if(!_0x168532[_0x965c('0x5f')]['oldPassword']||!_0x168532[_0x965c('0x5f')][_0x965c('0x90')]){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x25f812['authenticate'](_0x168532[_0x965c('0x5f')][_0x965c('0x93')])){throw new db['Sequelize'][(_0x965c('0x92'))](_0x965c('0x94'));}if(_0x168532[_0x965c('0x5f')][_0x965c('0x93')]===_0x168532[_0x965c('0x5f')][_0x965c('0x90')]){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0x95'));}}else if(_0x168532[_0x965c('0x2e')][_0x965c('0x2b')]===_0x965c('0x2c')){if(!_0x168532['body'][_0x965c('0x90')]){throw new db['Sequelize'][(_0x965c('0x92'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x168532['user'][_0x965c('0x2b')]===_0x965c('0x2e')){if(!_0x168532[_0x965c('0x5f')][_0x965c('0x90')]){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x25f812[_0x965c('0x2b')]!==_0x965c('0x72')){throw new db['Sequelize']['ValidationError']('Unauthorized');}}else{throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0x89'));}return _0x25f812;})['then'](handleEntityNotFound(_0x1484c1,null))[_0x965c('0x16')](function(_0x4e7dc1){return db['Setting']['findOne']({'attributes':['id','securePassword',_0x965c('0x96'),_0x965c('0x97')]})[_0x965c('0x16')](function(_0x3cbef8){if(_0x3cbef8[_0x965c('0x66')])authService['validatePasswordPattern'](_0x168532['body']['newPassword']);if(!_0x3cbef8[_0x965c('0x96')]||!_0x4e7dc1[_0x965c('0x98')])return _0x4e7dc1;authService['validatePasswordHistory'](_0x168532[_0x965c('0x5f')][_0x965c('0x90')],_0x4e7dc1[_0x965c('0x98')],_0x3cbef8['passwordHistoryLimit']);return _0x4e7dc1;})[_0x965c('0x16')](saveUpdates({'password':_0x168532[_0x965c('0x5f')][_0x965c('0x90')],'passwordResetAt':_0x168532['user']['id']==_0x168532[_0x965c('0x60')]['id']?moment():null,'previousPasswords':authService[_0x965c('0x99')](_0x168532['body']['newPassword'],_0x4e7dc1[_0x965c('0x98')])},null));})[_0x965c('0x16')](respondWithResult(_0x1484c1,null))[_0x965c('0x20')](handleError(_0x1484c1,null));};exports[_0x965c('0x9a')]=function(_0x4e4b4d,_0x181d7b){var _0x4a7fce=_0x4e4b4d['body'][_0x965c('0x9b')];return db['User'][_0x965c('0x36')]({'where':{'id':_0x4e4b4d['params']['id']},'attributes':['id',_0x965c('0x3a'),_0x965c('0x2b'),_0x965c('0x9c'),_0x965c('0x9d'),_0x965c('0x9e'),'interface']})[_0x965c('0x16')](handleEntityNotFound(_0x181d7b,null))[_0x965c('0x16')](function(_0x331788){if(_0x331788){if(!utils[_0x965c('0x9f')](_0x4a7fce)){throw new db[(_0x965c('0x91'))]['ValidationError'](_0x965c('0xa0'));}return _0x331788[_0x965c('0xa1')+_[_0x965c('0xa2')](_0x4a7fce[_0x965c('0xa3')]())+_0x965c('0xa4')](_0x4e4b4d[_0x965c('0x5f')][_0x965c('0x64')],{'penalty':_0x4e4b4d[_0x965c('0x5f')][_0x965c('0xa5')]||0x0})['spread'](function(_0x156ddc){for(var _0x5d5728=0x0;_0x5d5728<_0x4e4b4d[_0x965c('0x5f')][_0x965c('0x64')][_0x965c('0x6d')];_0x5d5728+=0x1){var _0x285d46={'UserId':Number(_0x4e4b4d[_0x965c('0x60')]['id'])};_0x285d46[_['capitalize'](_0x4a7fce[_0x965c('0xa3')]())+_0x965c('0xa6')]=Number(_0x4e4b4d[_0x965c('0x5f')]['ids'][_0x5d5728]);socket[_0x965c('0xa7')](_0x965c('0x2e')+_[_0x965c('0xa2')](_0x4a7fce['toLowerCase']())+'Queue:save',_0x285d46);}return _0x156ddc;})[_0x965c('0x16')](function(){if(_0x4a7fce===_0x965c('0xa8')){return db[_0x965c('0xa9')][_0x965c('0x4a')]({'where':{'id':_0x4e4b4d['body'][_0x965c('0x64')]||[]},'raw':!![],'attributes':['id',_0x965c('0x3a')]});}})['then'](function(_0xc43ffc){var _0x5c0830=_0x331788[_0x965c('0x2a')]({'plain':!![]});var _0x762a94=[];if(_0x4a7fce===_0x965c('0xa8')&&_0x5c0830[_0x965c('0x2b')]===_0x965c('0x72')&&_0x5c0830[_0x965c('0x9c')]){for(var _0x33d486=0x0;_0x33d486<_0xc43ffc['length'];_0x33d486+=0x1){_0x762a94['push']({'membername':_0x5c0830[_0x965c('0x3a')],'UserId':_0x5c0830['id'],'queue_name':_0xc43ffc[_0x33d486][_0x965c('0x3a')],'VoiceQueueId':_0xc43ffc[_0x33d486]['id'],'interface':_[_0x965c('0x6e')](_0x5c0830[_0x965c('0xaa')])?util['format']('SIP/%s',_0x5c0830[_0x965c('0x3a')]):_0x5c0830[_0x965c('0xaa')],'paused':_0x5c0830['voicePause']||![],'penalty':_0x4e4b4d[_0x965c('0x5f')][_0x965c('0xa5')]||0x0});}return BPromise[_0x965c('0xab')](_0x762a94,function(_0x1bbca8){return db['UserVoiceQueueRt'][_0x965c('0xac')](_0x1bbca8);});}return _0x331788;});}})[_0x965c('0x16')](respondWithStatusCode(_0x181d7b,null))[_0x965c('0x20')](handleError(_0x181d7b,null));};exports['removeQueues']=function(_0x3dc1f9,_0x53de58){var _0x4ee155;return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x3dc1f9[_0x965c('0x60')]['id']},'attributes':['id',_0x965c('0x3a'),_0x965c('0x2b')]})[_0x965c('0x16')](handleEntityNotFound(_0x53de58,null))[_0x965c('0x16')](function(_0x445b08){if(_0x445b08){_0x4ee155=_0x445b08;if(!_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')]||!utils['isValidChannel'](_0x3dc1f9[_0x965c('0x45')]['channel'])){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))]('Unknown\x20channel');}return _0x445b08[_0x965c('0xad')+_[_0x965c('0xa2')](_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')][_0x965c('0xa3')]())+_0x965c('0xa4')](_0x3dc1f9[_0x965c('0x45')]['ids']);}})[_0x965c('0x16')](function(_0xb97532){if(_['isArray'](_0x3dc1f9['query'][_0x965c('0x64')])){for(var _0x125bd6=0x0;_0x125bd6<_0x3dc1f9[_0x965c('0x45')][_0x965c('0x64')][_0x965c('0x6d')];_0x125bd6+=0x1){var _0x6ed5ec={'UserId':Number(_0x3dc1f9[_0x965c('0x60')]['id'])};_0x6ed5ec[_['capitalize'](_0x3dc1f9['query'][_0x965c('0x9b')][_0x965c('0xa3')]())+_0x965c('0xa6')]=Number(_0x3dc1f9[_0x965c('0x45')][_0x965c('0x64')][_0x125bd6]);socket[_0x965c('0xa7')](_0x965c('0x2e')+_['capitalize'](_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')]['toLowerCase']())+'Queue:remove',_0x6ed5ec);}}else{var _0x6ed5ec={'UserId':Number(_0x3dc1f9['params']['id'])};_0x6ed5ec[_[_0x965c('0xa2')](_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')]['toLowerCase']())+'QueueId']=Number(_0x3dc1f9[_0x965c('0x45')]['ids']);socket[_0x965c('0xa7')](_0x965c('0x2e')+_[_0x965c('0xa2')](_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')]['toLowerCase']())+_0x965c('0xae'),_0x6ed5ec);}return _0xb97532;})['then'](function(){if(_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')]==='voice'){return db[_0x965c('0xaf')][_0x965c('0x29')]({'where':{'UserId':_0x3dc1f9[_0x965c('0x60')]['id'],'VoiceQueueId':_0x3dc1f9[_0x965c('0x45')]['ids']},'individualHooks':!![]})[_0x965c('0x16')](function(){return _0x4ee155;});}return _0x4ee155;})[_0x965c('0x16')](respondWithStatusCode(_0x53de58,null))[_0x965c('0x20')](handleError(_0x53de58,null));};exports[_0x965c('0xb0')]=function(_0x32a2f4,_0x1247a1){_0x32a2f4[_0x965c('0x5f')][_0x965c('0xb1')]=_0x32a2f4[_0x965c('0xb2')][_0x965c('0xb3')];return db['User'][_0x965c('0x36')]({'where':{'id':_0x32a2f4[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x1247a1,null))['then'](saveUpdates(_0x32a2f4[_0x965c('0x5f')],null))['then'](respondWithResult(_0x1247a1,null))[_0x965c('0x20')](handleError(_0x1247a1,null));};exports[_0x965c('0xb4')]=function(_0x215827,_0x36e01f){var _0x353bfd=path['join'](config[_0x965c('0xb5')],'server/files/images/logos/default_profile.png');return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x215827[_0x965c('0x60')]['id']},'attributes':['id',_0x965c('0xb1')],'raw':!![]})[_0x965c('0x16')](handleEntityNotFound(_0x36e01f,null))[_0x965c('0x16')](function(_0x2084c7){if(_0x2084c7){if(_[_0x965c('0x6e')](_0x2084c7['userpic'])){return _0x36e01f['download'](_0x353bfd);}else{if(!fs[_0x965c('0xb6')](path[_0x965c('0xb7')](config['root'],'server/files/images/',_0x2084c7[_0x965c('0xb1')]))){return _0x36e01f[_0x965c('0xb8')](_0x353bfd);}return _0x36e01f[_0x965c('0xb8')](path[_0x965c('0xb7')](config[_0x965c('0xb5')],_0x965c('0xb9'),_0x2084c7[_0x965c('0xb1')]));}}})[_0x965c('0x20')](handleError(_0x36e01f,null));};exports['getOpenTabs']=function(_0x545443,_0x4834d1){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x545443[_0x965c('0x60')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x4834d1,null))['then'](function(_0x37e505){var _0x4b96c7=[];values=_0x37e505[_0x965c('0x51')];_0x4b96c7[_0x965c('0x49')](get_open_tabs(_0x965c('0x4e'),_0x37e505[_0x965c('0x51')]));_0x4b96c7['push'](get_open_tabs(_0x965c('0x4f'),_0x37e505[_0x965c('0x51')]));_0x4b96c7['push'](get_open_tabs(_0x965c('0xba'),_0x37e505['dataValues']));_0x4b96c7[_0x965c('0x49')](get_open_tabs('whatsapp',_0x37e505[_0x965c('0x51')]));_0x4b96c7[_0x965c('0x49')](get_open_tabs('fax',_0x37e505[_0x965c('0x51')]));_0x4b96c7['push'](get_open_tabs('mail',_0x37e505['dataValues']));return BPromise[_0x965c('0x5e')](_0x4b96c7);})[_0x965c('0x16')](function(_0x5b157d){var _0xae5b53=[];if(_0x5b157d){for(var _0x25bbe3=0x0;_0x25bbe3=_0x417b42){_0x157a2d=_0x417b42;_0x12ebd2=0xc8;}else{_0x12ebd2=0xce;}_0x33d526[_0xf8e3('0x22')](_0x12ebd2);return _0x33d526[_0xf8e3('0x29')](_0xf8e3('0x2a'),_0x3b41a1+'-'+_0x157a2d+'/'+_0x417b42)[_0xf8e3('0x24')](_0x1f4b68);}return null;};}function saveUpdates(_0xfaf15d){return function(_0x4f2ae9){if(_0x4f2ae9){return _0x4f2ae9[_0xf8e3('0x2b')](_0xfaf15d)[_0xf8e3('0x15')](function(_0x492694){return _0x492694;});}return null;};}function removeEntity(_0x28b2f2){return function(_0x567153){if(_0x567153){return _0x567153[_0xf8e3('0x2c')]()[_0xf8e3('0x15')](function(){var _0x40f64d=_0x567153[_0xf8e3('0x2d')]({'plain':!![]});if(_0x40f64d[_0xf8e3('0x2e')]===_0xf8e3('0x2f'))return;var _0xb9c26=[{'name':_0xf8e3('0x30'),'value':'user','ignore':!![]},{'name':_0xf8e3('0x31'),'value':_0xf8e3('0x32'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x5cc1ed=_(_0xb9c26)[_0xf8e3('0x33')]('ignore')[_0xf8e3('0x34')](_0xf8e3('0x35'))[_0xf8e3('0x35')]();if(_[_0xf8e3('0x36')](_0x5cc1ed,_0x40f64d['role'])){return;}var _0x581a97=_[_0xf8e3('0x37')](_0xb9c26,[_0xf8e3('0x35'),_0x40f64d[_0xf8e3('0x2e')]])[_0xf8e3('0x38')];return db[_0xf8e3('0x39')][_0xf8e3('0x2c')]({'where':{'type':_0x581a97,'resourceId':_0x40f64d['id']}})['then'](function(){return _0x567153;});})[_0xf8e3('0x15')](function(){_0x28b2f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eaa03){return function(_0x1e8878){if(!_0x1e8878){_0x1eaa03[_0xf8e3('0x21')](0x194);}return _0x1e8878;};}function handleError(_0x1b7af2,_0x4cb46a){_0x4cb46a=_0x4cb46a||0x1f4;return function(_0x5ece46){logger[_0xf8e3('0x1b')](_0x5ece46[_0xf8e3('0x3a')]);if(_0x5ece46['name']){delete _0x5ece46[_0xf8e3('0x38')];}_0x1b7af2[_0xf8e3('0x22')](_0x4cb46a)[_0xf8e3('0x3b')](_0x5ece46);};}exports[_0xf8e3('0x3c')]=function(_0x547f53,_0x53cfea){var _0x5d307e={},_0x22b65e={'count':0x0,'rows':[]};var _0xcd2ffe=_(db[_0xf8e3('0x3d')][_0xf8e3('0x3e')])['map'](function(_0xee2e34){return{'name':_0xee2e34['fieldName'],'type':_0xee2e34[_0xf8e3('0x3f')][_0xf8e3('0x40')]};})[_0xf8e3('0x33')](function(_0x10e225){return!_[_0xf8e3('0x36')]([_0xf8e3('0x41'),_0xf8e3('0x42')],_0x10e225[_0xf8e3('0x38')]);})[_0xf8e3('0x35')]();_0x5d307e=qs['getOptions'](_0xcd2ffe,_0x547f53);var _0x211620={'where':_0x5d307e['where']};return db[_0xf8e3('0x3d')][_0xf8e3('0x27')](_0x211620)[_0xf8e3('0x15')](function(_0x9a6b37){_0x22b65e[_0xf8e3('0x27')]=_0x9a6b37;if(_0x547f53[_0xf8e3('0x43')][_0xf8e3('0x44')]){_0x5d307e[_0xf8e3('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x5d307e[_0xf8e3('0x46')],'id')){_0x5d307e[_0xf8e3('0x46')][_0xf8e3('0x47')]('id');}return db[_0xf8e3('0x3d')][_0xf8e3('0x48')](_0x5d307e);})[_0xf8e3('0x15')](function(_0x792190){_0x22b65e[_0xf8e3('0x49')]=_0x792190;if(_0x547f53['query']['openTabs']==='true'){var _0x30fecf=[];for(var _0x3d3ea5=0x0;_0x3d3ea5<_0x22b65e['rows'][_0xf8e3('0x4a')];_0x3d3ea5++){_0x30fecf['push'](get_open_tabs(_0xf8e3('0x4b'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('sms',_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));_0x30fecf['push'](get_open_tabs(_0xf8e3('0x4d'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('mail',_0x22b65e['rows'][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4e'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('whatsapp',_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));}return BPromise['all'](_0x30fecf)['then'](function(_0x128234){return _0x22b65e;});}else{return _0x22b65e;}})[_0xf8e3('0x15')](respondWithFilteredResult(_0x53cfea,_0x5d307e))[_0xf8e3('0x20')](handleError(_0x53cfea,null));};exports[_0xf8e3('0x4f')]=function(_0x3b790f,_0x1fc2a6){var _0x3b56ed={'raw':![],'where':{'id':_0x3b790f[_0xf8e3('0x50')]['id']}},_0x2a58e2={};_0x2a58e2[_0xf8e3('0x51')]=_[_0xf8e3('0x52')](_['keys'](db[_0xf8e3('0x3d')][_0xf8e3('0x3e')]),[_0xf8e3('0x41'),_0xf8e3('0x42')]);_0x2a58e2[_0xf8e3('0x43')]=_[_0xf8e3('0x53')](_0x3b790f['query']);_0x2a58e2[_0xf8e3('0x54')]=_[_0xf8e3('0x55')](_0x2a58e2[_0xf8e3('0x51')],_0x2a58e2[_0xf8e3('0x43')]);_0x3b56ed[_0xf8e3('0x46')]=_[_0xf8e3('0x55')](_0x2a58e2['model'],qs[_0xf8e3('0x56')](_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x56')]));_0x3b56ed[_0xf8e3('0x46')]=_0x3b56ed[_0xf8e3('0x46')][_0xf8e3('0x4a')]?_0x3b56ed['attributes']:_0x2a58e2[_0xf8e3('0x51')];if(_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x44')]){_0x3b56ed[_0xf8e3('0x45')]=[{'all':!![]}];}_0x3b56ed=_[_0xf8e3('0x57')]({},_0x3b56ed,_0x3b790f['options']);if(!_[_0xf8e3('0x36')](_0x3b56ed[_0xf8e3('0x46')],'id')){_0x3b56ed[_0xf8e3('0x46')]['push']('id');}return db['User'][_0xf8e3('0x37')](_0x3b56ed)[_0xf8e3('0x15')](handleEntityNotFound(_0x1fc2a6,null))[_0xf8e3('0x15')](function(_0x3ad7f1){var _0x58ad2f=[];values=_0x3ad7f1;if(_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x58')]==='true'){_0x58ad2f['push'](get_open_tabs(_0xf8e3('0x4b'),_0x3ad7f1[_0xf8e3('0x4c')]));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs('sms',_0x3ad7f1['dataValues']));_0x58ad2f['push'](get_open_tabs(_0xf8e3('0x4e'),_0x3ad7f1[_0xf8e3('0x4c')]));_0x58ad2f['push'](get_open_tabs('whatsapp',_0x3ad7f1['dataValues']));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4d'),_0x3ad7f1['dataValues']));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x59'),_0x3ad7f1[_0xf8e3('0x4c')]));return BPromise['all'](_0x58ad2f);}else{return values;}})['then'](function(_0x524fbc){return values;})['then'](respondWithResult(_0x1fc2a6,null))[_0xf8e3('0x20')](handleError(_0x1fc2a6,null));};exports[_0xf8e3('0x2b')]=function(_0x3ef144,_0x447efe){if(_0x3ef144[_0xf8e3('0x5a')]['id']){delete _0x3ef144[_0xf8e3('0x5a')]['id'];}delete _0x3ef144[_0xf8e3('0x5a')][_0xf8e3('0x2e')];return db[_0xf8e3('0x3d')]['find']({'where':{'id':_0x3ef144['params']['id']}})[_0xf8e3('0x15')](handleEntityNotFound(_0x447efe,null))[_0xf8e3('0x15')](saveUpdates(_0x3ef144[_0xf8e3('0x5a')],null))['then'](respondWithResult(_0x447efe,null))[_0xf8e3('0x20')](handleError(_0x447efe,null));};exports[_0xf8e3('0x5b')]=function(_0x4879c7,_0x48bb3f){return db[_0xf8e3('0x3d')][_0xf8e3('0x5b')]()[_0xf8e3('0x15')](respondWithResult(_0x48bb3f,null))[_0xf8e3('0x20')](handleError(_0x48bb3f,null));};exports['addContacts']=function(_0x5bd7bf,_0x37751e){return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x5bd7bf[_0xf8e3('0x50')]['id']}})['then'](handleEntityNotFound(_0x37751e,null))['then'](function(_0x324ad5){if(_0x324ad5){return _0x324ad5[_0xf8e3('0x5c')](_0x5bd7bf['body'][_0xf8e3('0x5d')],_[_0xf8e3('0x5e')](_0x5bd7bf[_0xf8e3('0x5a')],[_0xf8e3('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x37751e,null))[_0xf8e3('0x20')](handleError(_0x37751e,null));};function validateUser(_0x5d2ecf){return new BPromise(function(_0x217979,_0x1cad38){if(_0x5d2ecf['internal'])return _0x217979(_0x5d2ecf);return db[_0xf8e3('0x5f')][_0xf8e3('0x60')](0x1)['then'](function(_0x232d83){if(_0x232d83[_0xf8e3('0x61')])authService[_0xf8e3('0x62')](_0x5d2ecf[_0xf8e3('0x41')]);db['User'][_0xf8e3('0x63')](_0xf8e3('0x64'))[_0xf8e3('0x15')](function(_0x3c214f){if(_[_0xf8e3('0x65')](_0x3c214f)){_0x5d2ecf[_0xf8e3('0x64')]=_0x232d83[_0xf8e3('0x66')]||0x1;return;}if(_[_0xf8e3('0x65')](_0x232d83[_0xf8e3('0x66')])||_0x232d83[_0xf8e3('0x66')]===_0x3c214f){_0x5d2ecf[_0xf8e3('0x64')]=_0x3c214f+0x1;return;}if(_0x232d83[_0xf8e3('0x66')]>_0x3c214f){_0x5d2ecf['internal']=_0x232d83['min_internal'];return;}return db[_0xf8e3('0x67')][_0xf8e3('0x43')]('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[_0xf8e3('0x67')][_0xf8e3('0x68')][_0xf8e3('0x69')]})[_0xf8e3('0x15')](function(_0x18a810){if(_0x18a810&&_0x18a810['length']){for(var _0x3e501c=0x0,_0x1dcd23=_0x18a810['length'];_0x3e501c<_0x1dcd23&&_[_0xf8e3('0x65')](_0x5d2ecf['internal']);_0x3e501c++){if(_0x232d83[_0xf8e3('0x66')]<=_0x18a810[_0x3e501c]['from']){_0x5d2ecf[_0xf8e3('0x64')]=_0x18a810[_0x3e501c][_0xf8e3('0x6a')];}else if(_0x232d83[_0xf8e3('0x66')]>_0x18a810[_0x3e501c][_0xf8e3('0x6a')]&&_0x232d83[_0xf8e3('0x66')]<=_0x18a810[_0x3e501c]['to']){_0x5d2ecf['internal']=_0x232d83[_0xf8e3('0x66')];}}}if(_[_0xf8e3('0x65')](_0x5d2ecf[_0xf8e3('0x64')])){_0x5d2ecf[_0xf8e3('0x64')]=_0x3c214f+0x1;}return _0x217979(_0x5d2ecf);});});})[_0xf8e3('0x20')](function(_0x3852d1){_0x1cad38(_0x3852d1);});});}function updateUser(_0x459562){return new BPromise(function(_0x2ccd34,_0x3ddc19){try{if(_0x459562[_0xf8e3('0x6b')]){_0x459562[_0xf8e3('0x6c')]=_0x459562[_0xf8e3('0x64')];_0x459562['VoiceMail']={'mailbox':_0x459562[_0xf8e3('0x64')],'password':_0x459562[_0xf8e3('0x41')],'fullname':_0x459562[_0xf8e3('0x6d')],'email':_0x459562['email']};}if(_0x459562[_0xf8e3('0x2e')]===_0xf8e3('0x32')){if(!_0x459562[_0xf8e3('0x6e')])_0x459562[_0xf8e3('0x6e')]=[_0xf8e3('0x6f'),_0xf8e3('0x70'),_0xf8e3('0x71'),_0xf8e3('0x72'),_0xf8e3('0x73'),_0xf8e3('0x74'),_0xf8e3('0x75'),_0xf8e3('0x76'),'107',_0xf8e3('0x77'),_0xf8e3('0x78'),_0xf8e3('0x79'),_0xf8e3('0x7a'),'114','115'];}_0x2ccd34(_0x459562);}catch(_0x11aa1d){_0x3ddc19(_0x11aa1d);}});}exports[_0xf8e3('0x7b')]=function(_0x4c8707,_0x5bedc7){if(_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]==='agent')throw new Error(_0xf8e3('0x7d'));if(_0x4c8707[_0xf8e3('0x5a')][_0xf8e3('0x2e')]===_0xf8e3('0x7c')&&_0x4c8707[_0xf8e3('0x7c')]['role']!==_0xf8e3('0x2f')){throw new Error(_0xf8e3('0x7e'));}if(_0x4c8707['body']['role']===_0xf8e3('0x2f')&&_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x2f')){throw new Error(_0xf8e3('0x7f'));}return licenseUtil[_0xf8e3('0x80')]([_0x4c8707[_0xf8e3('0x5a')]])[_0xf8e3('0x15')](function(){return validateUser(_0x4c8707['body']);})[_0xf8e3('0x15')](function(_0x2c9a8e){return updateUser(_0x2c9a8e)[_0xf8e3('0x15')](function(_0x16f087){if(_0x16f087[_0xf8e3('0x2e')]===_0xf8e3('0x2f')){_0x16f087['settingsEnabled']=_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x81')];delete _0x16f087[_0xf8e3('0x82')];}return _0x16f087;});})['then'](function(_0x47a748){return db[_0xf8e3('0x3d')][_0xf8e3('0x7b')](_0x47a748,{'include':[{'model':db[_0xf8e3('0x83')],'as':_0xf8e3('0x83')}]});})[_0xf8e3('0x15')](function(_0x5b8840){if(_0x4c8707[_0xf8e3('0x5a')][_0xf8e3('0x2e')]===_0xf8e3('0x7c'))return _0x5b8840;if(_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x7c'))return _0x5b8840;return db[_0xf8e3('0x84')][_0xf8e3('0x37')]({'where':{'name':_0x5b8840[_0xf8e3('0x2e')]==='agent'?_0xf8e3('0x31'):_0xf8e3('0x85'),'userProfileId':_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x82')]},'raw':!![]})[_0xf8e3('0x15')](function(_0xb2f16e){if(!_0xb2f16e||_0xb2f16e[_0xf8e3('0x86')]!=0x0)return _0x5b8840;return db['UserProfileResource']['create']({'name':_0x5b8840[_0xf8e3('0x38')],'resourceId':_0x5b8840['id'],'type':_0xb2f16e[_0xf8e3('0x38')],'sectionId':_0xb2f16e['id']},{})['then'](function(){return _0x5b8840;});})[_0xf8e3('0x20')](function(_0x2412f9){logger[_0xf8e3('0x1b')](_0xf8e3('0x87'),_0x2412f9);throw _0x2412f9;});})[_0xf8e3('0x15')](respondWithResult(_0x5bedc7,0xc9))[_0xf8e3('0x20')](handleError(_0x5bedc7,null));};exports[_0xf8e3('0x88')]=function(_0x4b5a1f,_0xddfaee){var _0x2121f3=_0x4b5a1f[_0xf8e3('0x5a')];var _0xc8c987=[];if(_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]===_0xf8e3('0x32'))throw new Error(_0xf8e3('0x7d'));if(_[_0xf8e3('0x89')](_0x2121f3,[_0xf8e3('0x2e'),_0xf8e3('0x7c')])&&_0x4b5a1f['user']['role']!==_0xf8e3('0x2f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xf8e3('0x89')](_0x2121f3,['role',_0xf8e3('0x2f')])&&_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!=='admin'){throw new Error(_0xf8e3('0x8a'));}return licenseUtil[_0xf8e3('0x80')](_0x2121f3)[_0xf8e3('0x15')](function(){return validateUser(_0x2121f3[0x0]);})[_0xf8e3('0x15')](function(){for(var _0x3619cd=0x1;_0x3619cd<_0x2121f3['length'];_0x3619cd++){var _0xec1ff5=_0x2121f3[_0x3619cd-0x1]['internal'];if(!_0x2121f3[_0x3619cd][_0xf8e3('0x64')])_0x2121f3[_0x3619cd][_0xf8e3('0x64')]=_0xec1ff5+0x1;_0xc8c987[_0xf8e3('0x47')](validateUser(_0x2121f3[_0x3619cd]));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);})[_0xf8e3('0x15')](function(){_0xc8c987=[];for(var _0x3243b5=0x0;_0x3243b5<_0x2121f3[_0xf8e3('0x4a')];_0x3243b5++){_0xc8c987['push'](updateUser(_0x2121f3[_0x3243b5]));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);})[_0xf8e3('0x15')](function(){return BPromise[_0xf8e3('0x8c')](_0x2121f3,function(_0x1a9ba6){return db['User'][_0xf8e3('0x7b')](_0x1a9ba6,{'include':[{'model':db[_0xf8e3('0x83')],'as':_0xf8e3('0x83')}]})[_0xf8e3('0x15')](function(_0x22fa2f){_0x1a9ba6['id']=_0x22fa2f['id'];return _0x1a9ba6;});});})[_0xf8e3('0x15')](function(_0x477589){if(_0x4b5a1f[_0xf8e3('0x5a')]['role']==='user')return _0x477589;if(_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x7c'))return _0x477589;var _0x161347=_[_0xf8e3('0x89')](_0x477589,function(_0x12bc5b){return _0x12bc5b[_0xf8e3('0x2e')]==='agent'||_0x12bc5b[_0xf8e3('0x2e')]==='telephone';});if(!_0x161347)return _0x477589;return db[_0xf8e3('0x84')][_0xf8e3('0x48')]({'where':{'name':{'$or':[_0xf8e3('0x31'),_0xf8e3('0x85')]},'userProfileId':_0x4b5a1f['user'][_0xf8e3('0x82')]},'raw':!![]})['then'](function(_0x567d66){if(_[_0xf8e3('0x8d')](_0x567d66)||!_[_0xf8e3('0x89')](_0x567d66,[_0xf8e3('0x86'),0x0]))return _0x477589;_0xc8c987=[];var _0x2db4e4=_(_0x567d66)['map'](function(_0x4e7821){if(_0x4e7821[_0xf8e3('0x86')]===0x1)return;return _0x4e7821[_0xf8e3('0x38')]==='Agents'?'agent':_0xf8e3('0x8e');})[_0xf8e3('0x8f')]()['value']();for(var _0x1844da=0x0;_0x1844da<_0x477589[_0xf8e3('0x4a')];_0x1844da++){if(!_[_0xf8e3('0x36')](_0x2db4e4,_0x477589[_0x1844da][_0xf8e3('0x2e')]))return;var _0x1bae38=_0x477589[_0x1844da][_0xf8e3('0x2e')]===_0xf8e3('0x32')?'Agents':_0xf8e3('0x85');_0xc8c987[_0xf8e3('0x47')](db['UserProfileResource'][_0xf8e3('0x7b')]({'name':_0x477589[_0x1844da]['name'],'resourceId':_0x477589[_0x1844da]['id'],'type':_0x1bae38,'sectionId':_[_0xf8e3('0x37')](_0x567d66,[_0xf8e3('0x38'),_0x1bae38])['id']},{}));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);});})['then'](respondWithResult(_0xddfaee,0xc9))[_0xf8e3('0x20')](handleError(_0xddfaee,null));};exports['changePassword']=function(_0x153c80,_0x41ca1b){if(_0x153c80[_0xf8e3('0x5a')]['id']){delete _0x153c80[_0xf8e3('0x5a')]['id'];}return db['User']['find']({'where':{'id':_0x153c80[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x15')](function(_0x268855){if(!_0x268855)return null;if(_0x268855['id']===_0x153c80[_0xf8e3('0x7c')]['id']){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x90')]||!_0x153c80['body'][_0xf8e3('0x91')]){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x94'));}if(!_0x268855['authenticate'](_0x153c80[_0xf8e3('0x5a')]['oldPassword'])){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))]('Wrong\x20credentials');}if(_0x153c80[_0xf8e3('0x5a')]['oldPassword']===_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db['Sequelize'][(_0xf8e3('0x93'))](_0xf8e3('0x95'));}}else if(_0x153c80['user'][_0xf8e3('0x2e')]===_0xf8e3('0x2f')){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x96'));}}else if(_0x153c80[_0xf8e3('0x7c')][_0xf8e3('0x2e')]===_0xf8e3('0x7c')){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db['Sequelize'][(_0xf8e3('0x93'))](_0xf8e3('0x96'));}if(_0x268855[_0xf8e3('0x2e')]!=='agent'){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x7d'));}}else{throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x7d'));}return _0x268855;})[_0xf8e3('0x15')](handleEntityNotFound(_0x41ca1b,null))['then'](function(_0x513b90){return db[_0xf8e3('0x5f')][_0xf8e3('0x97')]({'attributes':['id','securePassword',_0xf8e3('0x98'),_0xf8e3('0x99')]})['then'](function(_0x45919d){if(_0x45919d[_0xf8e3('0x61')])authService[_0xf8e3('0x62')](_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]);if(!_0x45919d['enforcePasswordHistory']||!_0x513b90[_0xf8e3('0x9a')])return _0x513b90;authService[_0xf8e3('0x9b')](_0x153c80['body'][_0xf8e3('0x91')],_0x513b90[_0xf8e3('0x9a')],_0x45919d[_0xf8e3('0x99')]);return _0x513b90;})[_0xf8e3('0x15')](saveUpdates({'password':_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')],'passwordResetAt':_0x153c80[_0xf8e3('0x7c')]['id']==_0x153c80['params']['id']?moment():null,'previousPasswords':authService[_0xf8e3('0x9c')](_0x153c80[_0xf8e3('0x5a')]['newPassword'],_0x513b90['previousPasswords'])},null));})['then'](respondWithResult(_0x41ca1b,null))[_0xf8e3('0x20')](handleError(_0x41ca1b,null));};exports[_0xf8e3('0x9d')]=function(_0x417af2,_0x29f5d0){var _0x4622b1=_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x9e')];return db['User']['find']({'where':{'id':_0x417af2[_0xf8e3('0x50')]['id']},'attributes':['id','name','role',_0xf8e3('0x9f'),_0xf8e3('0xa0'),'voicePause',_0xf8e3('0xa1')]})[_0xf8e3('0x15')](handleEntityNotFound(_0x29f5d0,null))[_0xf8e3('0x15')](function(_0x2c4060){if(_0x2c4060){if(!utils[_0xf8e3('0xa2')](_0x4622b1)){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0xa3'));}return _0x2c4060[_0xf8e3('0xa4')+_[_0xf8e3('0xa5')](_0x4622b1[_0xf8e3('0xa6')]())+_0xf8e3('0xa7')](_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')],{'penalty':_0x417af2[_0xf8e3('0x5a')]['penalty']||0x0})[_0xf8e3('0xa8')](function(_0x3de54e){for(var _0x4cb7c0=0x0;_0x4cb7c0<_0x417af2[_0xf8e3('0x5a')]['ids']['length'];_0x4cb7c0+=0x1){var _0x5a66ee={'UserId':Number(_0x417af2[_0xf8e3('0x50')]['id'])};_0x5a66ee[_[_0xf8e3('0xa5')](_0x4622b1['toLowerCase']())+_0xf8e3('0xa9')]=Number(_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')][_0x4cb7c0]);socket['emit'](_0xf8e3('0x7c')+_[_0xf8e3('0xa5')](_0x4622b1[_0xf8e3('0xa6')]())+'Queue:save',_0x5a66ee);}return _0x3de54e;})[_0xf8e3('0x15')](function(){if(_0x4622b1===_0xf8e3('0xaa')){return db[_0xf8e3('0xab')]['findAll']({'where':{'id':_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')]||[]},'raw':!![],'attributes':['id',_0xf8e3('0x38')]});}})[_0xf8e3('0x15')](function(_0x239890){var _0x446bf8=_0x2c4060['get']({'plain':!![]});var _0x14b346=[];if(_0x4622b1===_0xf8e3('0xaa')&&_0x446bf8['role']===_0xf8e3('0x32')&&_0x446bf8[_0xf8e3('0x9f')]){for(var _0xcf534f=0x0;_0xcf534f<_0x239890[_0xf8e3('0x4a')];_0xcf534f+=0x1){_0x14b346['push']({'membername':_0x446bf8[_0xf8e3('0x38')],'UserId':_0x446bf8['id'],'queue_name':_0x239890[_0xcf534f]['name'],'VoiceQueueId':_0x239890[_0xcf534f]['id'],'interface':_[_0xf8e3('0x65')](_0x446bf8['interface'])?util[_0xf8e3('0xac')](_0xf8e3('0xad'),_0x446bf8['name']):_0x446bf8[_0xf8e3('0xa1')],'paused':_0x446bf8[_0xf8e3('0xae')]||![],'penalty':_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0xaf')]||0x0});}return BPromise[_0xf8e3('0x8c')](_0x14b346,function(_0x1b02c8){return db[_0xf8e3('0xb0')][_0xf8e3('0xb1')](_0x1b02c8);});}return _0x2c4060;});}})[_0xf8e3('0x15')](respondWithStatusCode(_0x29f5d0,null))[_0xf8e3('0x20')](handleError(_0x29f5d0,null));};exports[_0xf8e3('0xb2')]=function(_0xba6c1a,_0x4508d2){var _0x430f5b;return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0xba6c1a['params']['id']},'attributes':['id',_0xf8e3('0x38'),'role']})[_0xf8e3('0x15')](handleEntityNotFound(_0x4508d2,null))[_0xf8e3('0x15')](function(_0x50b249){if(_0x50b249){_0x430f5b=_0x50b249;if(!_0xba6c1a[_0xf8e3('0x43')]['channel']||!utils[_0xf8e3('0xa2')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')])){throw new db[(_0xf8e3('0x92'))]['ValidationError'](_0xf8e3('0xa3'));}return _0x50b249[_0xf8e3('0xb3')+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+'Queues'](_0xba6c1a[_0xf8e3('0x43')]['ids']);}})['then'](function(_0x490b3c){if(_[_0xf8e3('0xb4')](_0xba6c1a['query']['ids'])){for(var _0x537cf0=0x0;_0x537cf0<_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')][_0xf8e3('0x4a')];_0x537cf0+=0x1){var _0x5399b5={'UserId':Number(_0xba6c1a[_0xf8e3('0x50')]['id'])};_0x5399b5[_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xa9')]=Number(_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')][_0x537cf0]);socket[_0xf8e3('0xb5')](_0xf8e3('0x7c')+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xb6'),_0x5399b5);}}else{var _0x5399b5={'UserId':Number(_0xba6c1a[_0xf8e3('0x50')]['id'])};_0x5399b5[_[_0xf8e3('0xa5')](_0xba6c1a['query'][_0xf8e3('0x9e')]['toLowerCase']())+_0xf8e3('0xa9')]=Number(_0xba6c1a[_0xf8e3('0x43')]['ids']);socket[_0xf8e3('0xb5')]('user'+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xb6'),_0x5399b5);}return _0x490b3c;})[_0xf8e3('0x15')](function(){if(_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')]===_0xf8e3('0xaa')){return db[_0xf8e3('0xb0')][_0xf8e3('0x2c')]({'where':{'UserId':_0xba6c1a[_0xf8e3('0x50')]['id'],'VoiceQueueId':_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')]},'individualHooks':!![]})[_0xf8e3('0x15')](function(){return _0x430f5b;});}return _0x430f5b;})[_0xf8e3('0x15')](respondWithStatusCode(_0x4508d2,null))[_0xf8e3('0x20')](handleError(_0x4508d2,null));};exports['addAvatar']=function(_0x463566,_0x37d5c9){_0x463566[_0xf8e3('0x5a')][_0xf8e3('0xb7')]=_0x463566[_0xf8e3('0xb8')][_0xf8e3('0xb9')];return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x463566[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x15')](handleEntityNotFound(_0x37d5c9,null))[_0xf8e3('0x15')](saveUpdates(_0x463566[_0xf8e3('0x5a')],null))[_0xf8e3('0x15')](respondWithResult(_0x37d5c9,null))[_0xf8e3('0x20')](handleError(_0x37d5c9,null));};exports[_0xf8e3('0xba')]=function(_0x3cf809,_0x4d2cdb){var _0x3f4924=path[_0xf8e3('0xbb')](config['root'],_0xf8e3('0xbc'));return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x3cf809['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0xf8e3('0x15')](handleEntityNotFound(_0x4d2cdb,null))['then'](function(_0x445091){if(_0x445091){if(_['isNil'](_0x445091['userpic'])){return _0x4d2cdb[_0xf8e3('0xbd')](_0x3f4924);}else{if(!fs['existsSync'](path[_0xf8e3('0xbb')](config[_0xf8e3('0xbe')],'server/files/images/',_0x445091['userpic']))){return _0x4d2cdb[_0xf8e3('0xbd')](_0x3f4924);}return _0x4d2cdb['download'](path[_0xf8e3('0xbb')](config[_0xf8e3('0xbe')],_0xf8e3('0xbf'),_0x445091['userpic']));}}})[_0xf8e3('0x20')](handleError(_0x4d2cdb,null));};exports[_0xf8e3('0xc0')]=function(_0x33cf45,_0xfd0019){return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x33cf45[_0xf8e3('0x50')]['id']},'attributes':['id']})[_0xf8e3('0x15')](handleEntityNotFound(_0xfd0019,null))[_0xf8e3('0x15')](function(_0xe70da7){var _0x3bffa9=[];values=_0xe70da7[_0xf8e3('0x4c')];_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4b'),_0xe70da7['dataValues']));_0x3bffa9['push'](get_open_tabs(_0xf8e3('0xc1'),_0xe70da7['dataValues']));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4e'),_0xe70da7['dataValues']));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0xc2'),_0xe70da7[_0xf8e3('0x4c')]));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4d'),_0xe70da7[_0xf8e3('0x4c')]));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x59'),_0xe70da7[_0xf8e3('0x4c')]));return BPromise['all'](_0x3bffa9);})[_0xf8e3('0x15')](function(_0x3996fe){var _0x5e026c=[];if(_0x3996fe){for(var _0x15fa6f=0x0;_0x15fa6f=_0x23f269[_0x7405('0x4b')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x7405('0x23')](function(){if(_0x28de0f){return db[_0x7405('0x2a')][_0x7405('0x46')]({'where':{'membername':_0x28de0f['name']},'individualHooks':!![]});}})['then'](function(){if(_0x28de0f){return _0x28de0f[_0x7405('0x4c')]({'raw':!![]});}})['then'](function(_0x5a4b2b){if(_0x28de0f){if(_0x5a4b2b){var _0x4f87ba=[];_0x3300cb=_0x5a4b2b;if(_0x3300cb[_0x7405('0x2e')]){for(var _0x5639b6=0x0;_0x5639b6<_0x3300cb['length'];_0x5639b6++){_0x4f87ba[_0x7405('0x31')](db[_0x7405('0x2a')]['upsert']({'membername':_0x28de0f[_0x7405('0x27')],'UserId':_0x28de0f['id'],'queue_name':_0x3300cb[_0x5639b6][_0x7405('0x27')],'VoiceQueueId':_0x3300cb[_0x5639b6]['id'],'interface':_0x585a90,'paused':_0x28de0f['loginInPause']||![],'penalty':_0x3300cb[_0x5639b6][_0x7405('0x4d')]||0x0}));}return BPromise[_0x7405('0x47')](_0x4f87ba);}}}})[_0x7405('0x23')](function(){if(_0x28de0f){return db['MemberReport'][_0x7405('0x1a')]({'where':{'membername':_0x28de0f[_0x7405('0x27')],'exitAt':null}});}})[_0x7405('0x23')](function(_0x32bf3c){if(_0x28de0f){if(_0x32bf3c&&_0x32bf3c[_0x7405('0x2e')]){var _0x318502=[];_0x32bf3c[_0x7405('0x4e')](function(_0xe207d6){_0x318502['push'](_0xe207d6[_0x7405('0x2b')]({'exitAt':moment()[_0x7405('0x33')](_0x7405('0x2f'))}));});return BPromise[_0x7405('0x47')](_0x318502);}}})[_0x7405('0x23')](function(_0x2d037c){if(_0x28de0f){var _0x7018a1=[];var _0x5209b3=[];var _0x2663e0=utils['getChannels']();var _0x30655a={'membername':_0x28de0f[_0x7405('0x27')],'interface':_0x585a90,'enterAt':moment()[_0x7405('0x33')](_0x7405('0x2f')),'role':_0x28de0f[_0x7405('0x37')],'internal':_0x28de0f[_0x7405('0x28')]};_0x2663e0[_0x7405('0x4e')](function(_0x13aa86){_0x7018a1[_0x7405('0x31')](_[_0x7405('0x4f')]({'channel':_0x13aa86,'type':_0x7405('0x50'),'data1':_0x7405('0x51'),'data2':_0x585a90},_0x30655a));if(_0x28de0f[_0x7405('0x52')]){_0x5209b3[_0x7405('0x31')](_[_0x7405('0x4f')]({'channel':_0x13aa86,'type':_0x7405('0x2d'),'data1':_0x7405('0x53')},_0x30655a));}});return db['MemberReport'][_0x7405('0x39')](_0x7018a1[_0x7405('0x54')](_0x5209b3),{'individualHooks':!![]});}})['then'](function(){if(_0x28de0f){return _0x28de0f[_0x7405('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x7405('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x28de0f['loginInPause']||![],'mailPause':_0x28de0f[_0x7405('0x52')]||![],'chatPause':_0x28de0f['loginInPause']||![],'faxPause':_0x28de0f[_0x7405('0x52')]||![],'smsPause':_0x28de0f[_0x7405('0x52')]||![],'openchannelPause':_0x28de0f[_0x7405('0x52')]||![],'pauseType':_0x28de0f['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x7405('0x33')](_0x7405('0x2f')),'interface':_0x585a90});}})[_0x7405('0x23')](function(_0x3cc817){_0xa2ebd6(_0x3cc817);})[_0x7405('0x17')](function(_0x1f2a1){_0x3e750e(_0x2c9477['error'](0x1f4,_0x1f2a1[_0x7405('0x15')]));});});}; \ No newline at end of file +var _0x7995=['fax','sms','openchannel','whatsapp','%s%s','Pause','forEach','all','LogoutUser','findOne','destroy','LoginUser','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','LOGIN','callysquare','LOGININPAUSE','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','User','findAll','options','raw','where','attributes','limit','include','map','model','GetUser','catch','ShowUser','PauseUser','find','name','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','push','isNil','format','body','type','DEFAULT\x20PAUSE','role','uniqueid','isValidChannel','channel','Unknown\x20channel','voice','system','mail','chat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7995,0xd0));var _0x5799=function(_0x3aaf9a,_0x1499ab){_0x3aaf9a=_0x3aaf9a-0x0;var _0x568448=_0x7995[_0x3aaf9a];return _0x568448;};'use strict';var _=require('lodash');var util=require(_0x5799('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5799('0x1'));var fs=require('fs');var Redis=require(_0x5799('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5799('0x3'))(_0x5799('0x4'));var config=require(_0x5799('0x5'));var jayson=require(_0x5799('0x6'));var client=jayson[_0x5799('0x7')][_0x5799('0x8')]({'port':0x232a});config[_0x5799('0x9')]=_['defaults'](config[_0x5799('0x9')],{'host':_0x5799('0xa'),'port':0x18eb});var socket=require(_0x5799('0xb'))(new Redis(config[_0x5799('0x9')]));require(_0x5799('0xc'))[_0x5799('0xd')](socket);function respondWithRpcPromise(_0x471181,_0x40246c,_0x4030fb){return new BPromise(function(_0x4732c9,_0x4a1d19){return client[_0x5799('0xe')](_0x471181,_0x4030fb)[_0x5799('0xf')](function(_0x6d6527){logger[_0x5799('0x10')](_0x5799('0x11'),_0x40246c,_0x5799('0x12'));logger[_0x5799('0x13')]('User,\x20%s,\x20%s,\x20%s',_0x40246c,_0x5799('0x12'),JSON[_0x5799('0x14')](_0x6d6527));if(_0x6d6527[_0x5799('0x15')]){if(_0x6d6527[_0x5799('0x15')][_0x5799('0x16')]===0x1f4){logger[_0x5799('0x15')](_0x5799('0x11'),_0x40246c,_0x6d6527[_0x5799('0x15')]['message']);return _0x4a1d19(_0x6d6527[_0x5799('0x15')]['message']);}logger[_0x5799('0x15')](_0x5799('0x11'),_0x40246c,_0x6d6527[_0x5799('0x15')][_0x5799('0x17')]);return _0x4732c9(_0x6d6527[_0x5799('0x15')][_0x5799('0x17')]);}else{logger[_0x5799('0x10')](_0x5799('0x11'),_0x40246c,_0x5799('0x12'));_0x4732c9(_0x6d6527[_0x5799('0x18')][_0x5799('0x17')]);}})['catch'](function(_0x87d4e2){logger[_0x5799('0x15')](_0x5799('0x11'),_0x40246c,_0x87d4e2);_0x4a1d19(_0x87d4e2);});});}exports['GetUser']=function(_0x585963){var _0x1cf14d=this;return new Promise(function(_0x537433,_0x23e26d){return db[_0x5799('0x19')][_0x5799('0x1a')]({'raw':_0x585963[_0x5799('0x1b')]?_0x585963[_0x5799('0x1b')][_0x5799('0x1c')]===undefined?!![]:![]:!![],'where':_0x585963[_0x5799('0x1b')]?_0x585963[_0x5799('0x1b')][_0x5799('0x1d')]||null:null,'attributes':_0x585963[_0x5799('0x1b')]?_0x585963[_0x5799('0x1b')][_0x5799('0x1e')]||null:null,'limit':_0x585963[_0x5799('0x1b')]?_0x585963[_0x5799('0x1b')][_0x5799('0x1f')]||null:null,'include':_0x585963['options']?_0x585963[_0x5799('0x1b')][_0x5799('0x20')]?_[_0x5799('0x21')](_0x585963[_0x5799('0x1b')][_0x5799('0x20')],function(_0x1bba03){return{'model':db[_0x1bba03[_0x5799('0x22')]],'as':_0x1bba03['as'],'attributes':_0x1bba03['attributes'],'include':_0x1bba03[_0x5799('0x20')]?_[_0x5799('0x21')](_0x1bba03['include'],function(_0x9cedc6){return{'model':db[_0x9cedc6[_0x5799('0x22')]],'as':_0x9cedc6['as'],'attributes':_0x9cedc6[_0x5799('0x1e')],'include':_0x9cedc6[_0x5799('0x20')]?_[_0x5799('0x21')](_0x9cedc6[_0x5799('0x20')],function(_0x21c973){return{'model':db[_0x21c973[_0x5799('0x22')]],'as':_0x21c973['as'],'attributes':_0x21c973[_0x5799('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5799('0xf')](function(_0x468d76){logger[_0x5799('0x10')](_0x5799('0x23'),_0x585963);logger[_0x5799('0x13')](_0x5799('0x23'),_0x585963,JSON['stringify'](_0x468d76));_0x537433(_0x468d76);})[_0x5799('0x24')](function(_0x5009d5){logger[_0x5799('0x15')]('GetUser',_0x5009d5[_0x5799('0x17')],_0x585963);_0x23e26d(_0x1cf14d['error'](0x1f4,_0x5009d5['message']));});});};exports[_0x5799('0x25')]=function(_0x1ad981){var _0x49b693=this;return new Promise(function(_0xc10976,_0x567d91){return db[_0x5799('0x19')]['find']({'raw':_0x1ad981[_0x5799('0x1b')]?_0x1ad981[_0x5799('0x1b')][_0x5799('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ad981[_0x5799('0x1b')]?_0x1ad981[_0x5799('0x1b')]['where']||null:null,'attributes':_0x1ad981[_0x5799('0x1b')]?_0x1ad981['options'][_0x5799('0x1e')]||null:null,'include':_0x1ad981[_0x5799('0x1b')]?_0x1ad981[_0x5799('0x1b')]['include']?_['map'](_0x1ad981[_0x5799('0x1b')]['include'],function(_0x207b4d){return{'model':db[_0x207b4d[_0x5799('0x22')]],'as':_0x207b4d['as'],'attributes':_0x207b4d[_0x5799('0x1e')],'include':_0x207b4d['include']?_['map'](_0x207b4d[_0x5799('0x20')],function(_0x24ceec){return{'model':db[_0x24ceec['model']],'as':_0x24ceec['as'],'attributes':_0x24ceec[_0x5799('0x1e')],'include':_0x24ceec['include']?_[_0x5799('0x21')](_0x24ceec[_0x5799('0x20')],function(_0x544cc7){return{'model':db[_0x544cc7[_0x5799('0x22')]],'as':_0x544cc7['as'],'attributes':_0x544cc7[_0x5799('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5799('0xf')](function(_0x269487){logger[_0x5799('0x10')](_0x5799('0x25'),_0x1ad981);logger[_0x5799('0x13')]('ShowUser',_0x1ad981,JSON[_0x5799('0x14')](_0x269487));_0xc10976(_0x269487);})['catch'](function(_0x40d98d){logger[_0x5799('0x15')](_0x5799('0x25'),_0x40d98d[_0x5799('0x17')],_0x1ad981);_0x567d91(_0x49b693[_0x5799('0x15')](0x1f4,_0x40d98d[_0x5799('0x17')]));});});};exports[_0x5799('0x26')]=function(_0x39235a){var _0x47946b=this;return new Promise(function(_0x3d4f26,_0x470463){var _0x2e54a0;return db[_0x5799('0x19')][_0x5799('0x27')]({'where':_0x39235a[_0x5799('0x1b')][_0x5799('0x1d')]||{},'attributes':['id',_0x5799('0x28'),'role',_0x5799('0x29'),_0x5799('0x2a')]})[_0x5799('0xf')](function(_0x4220c7){if(_0x4220c7){_0x2e54a0=_0x4220c7;return db[_0x5799('0x2b')][_0x5799('0x2c')]({'paused':0x1},{'where':{'UserId':_0x2e54a0['id']},'individualHooks':!![]});}})[_0x5799('0xf')](function(){if(_0x2e54a0){return db[_0x5799('0x2d')][_0x5799('0x1a')]({'where':{'membername':_0x2e54a0[_0x5799('0x28')],'type':_0x5799('0x2e'),'exitAt':null}});}})['then'](function(_0x361689){if(_0x2e54a0){if(_0x361689&&_0x361689[_0x5799('0x2f')]){var _0x2deceb=moment()['format'](_0x5799('0x30'));for(var _0x42fe2c=0x0,_0xbc8e7e=_0x361689['length'];_0x42fe2c<_0xbc8e7e;_0x42fe2c++){_0x361689[_0x42fe2c][_0x5799('0x31')]({'exitAt':_0x2deceb});}}}})[_0x5799('0xf')](function(){if(_0x2e54a0){var _0x33a49f=[];var _0x2f3ded=utils['getChannels']();_0x2f3ded['forEach'](function(_0x317b2d){_0x33a49f[_0x5799('0x32')]({'channel':_0x317b2d,'membername':_0x2e54a0['name'],'interface':_[_0x5799('0x33')](_0x2e54a0[_0x5799('0x2a')])?util[_0x5799('0x34')]('SIP/%s',_0x2e54a0[_0x5799('0x28')]):_0x2e54a0[_0x5799('0x2a')],'type':_0x5799('0x2e'),'enterAt':moment()['format'](_0x5799('0x30')),'data1':_0x39235a[_0x5799('0x35')][_0x5799('0x36')]||_0x5799('0x37'),'role':_0x2e54a0[_0x5799('0x38')],'internal':_0x2e54a0[_0x5799('0x29')],'uniqueid':_0x39235a[_0x5799('0x35')][_0x5799('0x39')]||null});});return db['MemberReport']['bulkCreate'](_0x33a49f,{'individualHooks':!![]});}})[_0x5799('0xf')](function(){if(_0x2e54a0){return _0x2e54a0[_0x5799('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x39235a[_0x5799('0x35')][_0x5799('0x36')]||_0x5799('0x37'),'lastPauseAt':moment()[_0x5799('0x34')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x5799('0xf')](function(_0x7d5eae){_0x3d4f26(_0x7d5eae);})['catch'](function(_0x18fcc9){_0x470463(_0x47946b['error'](0x1f4,_0x18fcc9[_0x5799('0x17')]));});});};exports['UnpauseUser']=function(_0x41b51f){var _0x45be41=this;return new Promise(function(_0x1d1310,_0x1ce1b2){var _0x2bd96a;return db[_0x5799('0x19')]['findOne']({'where':_0x41b51f[_0x5799('0x1b')]['where']||{},'attributes':['id',_0x5799('0x28')]})[_0x5799('0xf')](function(_0x3404b6){if(_0x3404b6){_0x2bd96a=_0x3404b6;if(_0x41b51f[_0x5799('0x35')]['channel']&&!utils[_0x5799('0x3a')](_0x41b51f[_0x5799('0x35')][_0x5799('0x3b')])){throw new Error(_0x5799('0x3c'));}switch(_0x41b51f[_0x5799('0x35')][_0x5799('0x3b')]){case _0x5799('0x3d'):return db[_0x5799('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x2bd96a['id']}})[_0x5799('0xf')](function(){return db[_0x5799('0x2d')]['find']({'where':{'channel':_0x41b51f['body'][_0x5799('0x3b')],'membername':_0x2bd96a[_0x5799('0x28')],'type':'PAUSE','exitAt':null}});})[_0x5799('0xf')](function(_0x50738d){if(_0x50738d){return _0x50738d[_0x5799('0x2c')]({'exitAt':moment()[_0x5799('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x5799('0x3e')},{'individualHooks':!![]});}return null;})[_0x5799('0xf')](function(){return _0x2bd96a[_0x5799('0x2c')]({'voicePause':![]});});case _0x5799('0x3f'):case _0x5799('0x40'):case _0x5799('0x41'):case _0x5799('0x42'):case _0x5799('0x43'):case _0x5799('0x44'):return db[_0x5799('0x2d')][_0x5799('0x27')]({'where':{'channel':_0x41b51f[_0x5799('0x35')][_0x5799('0x3b')],'membername':_0x2bd96a[_0x5799('0x28')],'type':_0x5799('0x2e'),'exitAt':null}})[_0x5799('0xf')](function(_0x37a7ce){return _0x37a7ce['update']({'exitAt':moment()[_0x5799('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0x5799('0xf')](function(){var _0x272f6c={};_['set'](_0x272f6c,util['format'](_0x5799('0x45'),_0x41b51f[_0x5799('0x35')][_0x5799('0x3b')],_0x5799('0x46')),![]);return _0x2bd96a[_0x5799('0x2c')](_0x272f6c);});default:return db[_0x5799('0x2b')][_0x5799('0x2c')]({'paused':0x0},{'where':{'UserId':_0x2bd96a['id']}})[_0x5799('0xf')](function(){return db[_0x5799('0x2d')][_0x5799('0x1a')]({'where':{'membername':_0x2bd96a[_0x5799('0x28')],'type':_0x5799('0x2e'),'exitAt':null}});})[_0x5799('0xf')](function(_0x1a2da2){var _0x27c01f=[];_0x1a2da2[_0x5799('0x47')](function(_0x24f6af){_0x27c01f[_0x5799('0x32')](_0x24f6af[_0x5799('0x2c')]({'exitAt':moment()[_0x5799('0x34')](_0x5799('0x30')),'data2':'system'}));});return BPromise[_0x5799('0x48')](_0x27c01f);})[_0x5799('0xf')](function(){return _0x2bd96a[_0x5799('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x5799('0xf')](function(_0x4ff2d4){_0x1d1310(_0x4ff2d4);})[_0x5799('0x24')](function(_0x26d9fb){_0x1ce1b2(_0x45be41['error'](0x1f4,_0x26d9fb['message']));});});};exports[_0x5799('0x49')]=function(_0x4276e3){var _0x19b7c1=this;return new Promise(function(_0x124ba3,_0x25c698){var _0x1b4013;return db[_0x5799('0x19')][_0x5799('0x4a')]({'where':_0x4276e3[_0x5799('0x1b')][_0x5799('0x1d')]||{},'attributes':['id',_0x5799('0x28')]})['then'](function(_0x51c078){if(_0x51c078){_0x1b4013=_0x51c078;return db[_0x5799('0x2b')][_0x5799('0x4b')]({'where':{'membername':_0x1b4013[_0x5799('0x28')]},'individualHooks':!![]});}})[_0x5799('0xf')](function(){if(_0x1b4013){return db[_0x5799('0x2d')]['findAll']({'where':{'membername':_0x1b4013[_0x5799('0x28')],'exitAt':null}});}})[_0x5799('0xf')](function(_0x4ef7d5){if(_0x1b4013){if(_0x4ef7d5&&_0x4ef7d5[_0x5799('0x2f')]){var _0x21e453=[];_0x4ef7d5['forEach'](function(_0x29b69a){_0x21e453['push'](_0x29b69a[_0x5799('0x2c')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x21e453);}}})[_0x5799('0xf')](function(){if(_0x1b4013){return _0x1b4013[_0x5799('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x5e388a){_0x124ba3(_0x5e388a);})[_0x5799('0x24')](function(_0x2a164b){_0x25c698(_0x19b7c1[_0x5799('0x15')](0x1f4,_0x2a164b['message']));});});};exports[_0x5799('0x4c')]=function(_0x37e9fa){var _0x30763b=this;return new Promise(function(_0x461b46,_0x3b7f01){var _0x36325b;var _0x150913;var _0x2da2c6;var _0x257d33;return db['User'][_0x5799('0x4a')]({'where':_0x37e9fa[_0x5799('0x1b')][_0x5799('0x1d')]||{},'attributes':['id',_0x5799('0x28'),'role','mobile',_0x5799('0x4d'),_0x5799('0x29'),_0x5799('0x4e'),_0x5799('0x2a')]})[_0x5799('0xf')](function(_0x1f232f){if(_0x1f232f){_0x36325b=_0x1f232f;_0x257d33=_0x37e9fa[_0x5799('0x35')][_0x5799('0x2a')]?_0x37e9fa[_0x5799('0x35')]['interface']:util['format'](_0x5799('0x4f'),_0x36325b[_0x5799('0x28')]);return db[_0x5799('0x19')][_0x5799('0x50')]({'where':{'role':_0x5799('0x51'),'online':!![],'id':{'$ne':_0x36325b['id']}}});}})['then'](function(_0x21b189){if(_0x21b189){_0x2da2c6=_0x21b189;return require(_0x5799('0x52'))[_0x5799('0x53')]();}})['then'](function(_0x59cce5){if(_0x59cce5&&_0x59cce5[_0x5799('0x54')]&&_0x2da2c6>=_0x59cce5['agents']){throw new Error(_0x5799('0x55'));}})[_0x5799('0xf')](function(){if(_0x36325b){return db[_0x5799('0x2b')][_0x5799('0x4b')]({'where':{'membername':_0x36325b[_0x5799('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x36325b){return _0x36325b[_0x5799('0x56')]({'raw':!![]});}})[_0x5799('0xf')](function(_0x513247){if(_0x36325b){if(_0x513247){var _0x2939a7=[];_0x150913=_0x513247;if(_0x150913[_0x5799('0x2f')]){for(var _0x2f31cc=0x0;_0x2f31cc<_0x150913[_0x5799('0x2f')];_0x2f31cc++){_0x2939a7['push'](db[_0x5799('0x2b')]['upsert']({'membername':_0x36325b[_0x5799('0x28')],'UserId':_0x36325b['id'],'queue_name':_0x150913[_0x2f31cc]['name'],'VoiceQueueId':_0x150913[_0x2f31cc]['id'],'interface':_0x257d33,'paused':_0x36325b[_0x5799('0x4e')]||![],'penalty':_0x150913[_0x2f31cc][_0x5799('0x57')]||0x0}));}return BPromise[_0x5799('0x48')](_0x2939a7);}}}})[_0x5799('0xf')](function(){if(_0x36325b){return db[_0x5799('0x2d')][_0x5799('0x1a')]({'where':{'membername':_0x36325b[_0x5799('0x28')],'exitAt':null}});}})[_0x5799('0xf')](function(_0x322142){if(_0x36325b){if(_0x322142&&_0x322142[_0x5799('0x2f')]){var _0x14bd3b=[];_0x322142[_0x5799('0x47')](function(_0x2c9c64){_0x14bd3b[_0x5799('0x32')](_0x2c9c64[_0x5799('0x2c')]({'exitAt':moment()[_0x5799('0x34')](_0x5799('0x30'))}));});return BPromise[_0x5799('0x48')](_0x14bd3b);}}})[_0x5799('0xf')](function(_0x2cc5f0){if(_0x36325b){var _0x3ed9b1=[];var _0x42e3f3=[];var _0x748819=utils['getChannels']();var _0x33b65a={'membername':_0x36325b[_0x5799('0x28')],'interface':_0x257d33,'enterAt':moment()[_0x5799('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x36325b['role'],'internal':_0x36325b[_0x5799('0x29')]};_0x748819['forEach'](function(_0x585ce8){_0x3ed9b1[_0x5799('0x32')](_['merge']({'channel':_0x585ce8,'type':_0x5799('0x58'),'data1':_0x5799('0x59'),'data2':_0x257d33},_0x33b65a));if(_0x36325b[_0x5799('0x4e')]){_0x42e3f3['push'](_['merge']({'channel':_0x585ce8,'type':'PAUSE','data1':_0x5799('0x5a')},_0x33b65a));}});return db[_0x5799('0x2d')]['bulkCreate'](_0x3ed9b1['concat'](_0x42e3f3),{'individualHooks':!![]});}})[_0x5799('0xf')](function(){if(_0x36325b){return _0x36325b[_0x5799('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x5799('0x34')](_0x5799('0x30')),'voicePause':_0x36325b[_0x5799('0x4e')]||![],'mailPause':_0x36325b['loginInPause']||![],'chatPause':_0x36325b['loginInPause']||![],'faxPause':_0x36325b[_0x5799('0x4e')]||![],'smsPause':_0x36325b['loginInPause']||![],'openchannelPause':_0x36325b[_0x5799('0x4e')]||![],'pauseType':_0x36325b[_0x5799('0x4e')]?_0x5799('0x5a'):null,'lastPauseAt':moment()[_0x5799('0x34')](_0x5799('0x30')),'interface':_0x257d33});}})[_0x5799('0xf')](function(_0x2c183e){_0x461b46(_0x2c183e);})[_0x5799('0x24')](function(_0x6bea21){_0x3b7f01(_0x30763b[_0x5799('0x15')](0x1f4,_0x6bea21[_0x5799('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 81fa8d7..f75c386 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 _0x2738=['save','update','emit','register','length','user:','./user.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2738,0x8b));var _0x8273=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x2738[_0x2aea9e];return _0x430b92;};'use strict';var UserEvents=require(_0x8273('0x0'));var events=[_0x8273('0x1'),'remove',_0x8273('0x2')];function createListener(_0x2878c5,_0x11b44b){return function(_0xc5f80f){_0x11b44b[_0x8273('0x3')](_0x2878c5,_0xc5f80f);};}function removeListener(_0x18fb6b,_0x4e3e31){return function(){UserEvents['removeListener'](_0x18fb6b,_0x4e3e31);};}exports[_0x8273('0x4')]=function(_0x6801cf){for(var _0xe09cc6=0x0,_0x3f0486=events[_0x8273('0x5')];_0xe09cc6<_0x3f0486;_0xe09cc6++){var _0x3a2dff=events[_0xe09cc6];var _0x588de7=createListener(_0x8273('0x6')+_0x3a2dff,_0x6801cf);UserEvents['on'](_0x3a2dff,_0x588de7);}}; \ No newline at end of file +var _0x183d=['save','remove','update','emit','removeListener','register','length','./user.events'];(function(_0x3f8187,_0xde28b1){var _0x1e6830=function(_0x322fa2){while(--_0x322fa2){_0x3f8187['push'](_0x3f8187['shift']());}};_0x1e6830(++_0xde28b1);}(_0x183d,0x1bf));var _0xd183=function(_0x4cf8b9,_0x1fc660){_0x4cf8b9=_0x4cf8b9-0x0;var _0x7868d5=_0x183d[_0x4cf8b9];return _0x7868d5;};'use strict';var UserEvents=require(_0xd183('0x0'));var events=[_0xd183('0x1'),_0xd183('0x2'),_0xd183('0x3')];function createListener(_0x16b7f5,_0x3653a0){return function(_0x25317c){_0x3653a0[_0xd183('0x4')](_0x16b7f5,_0x25317c);};}function removeListener(_0x3220da,_0x3c2066){return function(){UserEvents[_0xd183('0x5')](_0x3220da,_0x3c2066);};}exports[_0xd183('0x6')]=function(_0x5ce835){for(var _0x437584=0x0,_0x456207=events[_0xd183('0x7')];_0x437584<_0x456207;_0x437584++){var _0xbddae=events[_0x437584];var _0x257df=createListener('user:'+_0xbddae,_0x5ce835);UserEvents['on'](_0xbddae,_0x257df);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 4be8768..6843d87 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x9bcf8f,_0x589f7d){var _0x10e1ec=function(_0x2cc08d){while(--_0x2cc08d){_0x9bcf8f['push'](_0x9bcf8f['shift']());}};_0x10e1ec(++_0x589f7d);}(_0xedd9,0xfc));var _0x9edd=function(_0x220d1a,_0x31f1e3){_0x220d1a=_0x220d1a-0x0;var _0x4f0fe3=_0xedd9[_0x220d1a];return _0x4f0fe3;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 9a25521..eb6e4db 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 _0x47a6=['INTEGER','sequelize'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x47a6,0x113));var _0x647a=function(_0x50bc8e,_0x2fbf77){_0x50bc8e=_0x50bc8e-0x0;var _0xded66c=_0x47a6[_0x50bc8e];return _0xded66c;};'use strict';var Sequelize=require(_0x647a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x647a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4899=['exports','INTEGER'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x4899,0x10c));var _0x9489=function(_0x34a1e9,_0x59707a){_0x34a1e9=_0x34a1e9-0x0;var _0x52627d=_0x4899[_0x34a1e9];return _0x52627d;};'use strict';var Sequelize=require('sequelize');module[_0x9489('0x0')]={'penalty':{'type':Sequelize[_0x9489('0x1')],'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 9b14136..698d914 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 _0xd36a=['user_has_chat_queues','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xd36a,0xb1));var _0xad36=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd36a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xad36('0x0'));var logger=require(_0xad36('0x1'))('api');var moment=require('moment');var BPromise=require(_0xad36('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad36('0x3'));var rimraf=require(_0xad36('0x4'));var config=require(_0xad36('0x5'));var attributes=require(_0xad36('0x6'));module[_0xad36('0x7')]=function(_0x102ecc,_0x2485d3){return _0x102ecc[_0xad36('0x8')](_0xad36('0x9'),attributes,{'tableName':_0xad36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26db=['path','rimraf','../../config/environment','exports','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5bad83,_0x5c216d){var _0x1bddfd=function(_0x236e94){while(--_0x236e94){_0x5bad83['push'](_0x5bad83['shift']());}};_0x1bddfd(++_0x5c216d);}(_0x26db,0x6e));var _0xb26d=function(_0x19b874,_0xc3f8c0){_0x19b874=_0x19b874-0x0;var _0x400685=_0x26db[_0x19b874];return _0x400685;};'use strict';var _=require(_0xb26d('0x0'));var util=require(_0xb26d('0x1'));var logger=require(_0xb26d('0x2'))(_0xb26d('0x3'));var moment=require(_0xb26d('0x4'));var BPromise=require(_0xb26d('0x5'));var rp=require(_0xb26d('0x6'));var fs=require('fs');var path=require(_0xb26d('0x7'));var rimraf=require(_0xb26d('0x8'));var config=require(_0xb26d('0x9'));var attributes=require('./userChatQueue.attributes');module[_0xb26d('0xa')]=function(_0x2cd413,_0x4d6ae8){return _0x2cd413['define'](_0xb26d('0xb'),attributes,{'tableName':_0xb26d('0xc'),'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 d58197f..6f82ecc 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 _0x6e70=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x488a76,_0x308ab6){var _0x306b9b=function(_0x32fd84){while(--_0x32fd84){_0x488a76['push'](_0x488a76['shift']());}};_0x306b9b(++_0x308ab6);}(_0x6e70,0x131));var _0x06e7=function(_0x38417e,_0x4f9723){_0x38417e=_0x38417e-0x0;var _0x53dd9e=_0x6e70[_0x38417e];return _0x53dd9e;};'use strict';var _=require(_0x06e7('0x0'));var util=require('util');var moment=require(_0x06e7('0x1'));var BPromise=require(_0x06e7('0x2'));var rs=require(_0x06e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x06e7('0x5'))(_0x06e7('0x6'));var config=require(_0x06e7('0x7'));var jayson=require(_0x06e7('0x8'));var client=jayson[_0x06e7('0x9')][_0x06e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x307f5c,_0x413637,_0x31c034){return new BPromise(function(_0x19b42f,_0x49b6e9){return client[_0x06e7('0xb')](_0x307f5c,_0x31c034)[_0x06e7('0xc')](function(_0x4d916f){logger['info'](_0x06e7('0xd'),_0x413637,_0x06e7('0xe'));logger[_0x06e7('0xf')](_0x06e7('0x10'),_0x413637,_0x06e7('0xe'),JSON[_0x06e7('0x11')](_0x4d916f));if(_0x4d916f[_0x06e7('0x12')]){if(_0x4d916f[_0x06e7('0x12')][_0x06e7('0x13')]===0x1f4){logger[_0x06e7('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x413637,_0x4d916f['error'][_0x06e7('0x14')]);return _0x49b6e9(_0x4d916f[_0x06e7('0x12')]['message']);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x413637,_0x4d916f[_0x06e7('0x12')]['message']);return _0x19b42f(_0x4d916f[_0x06e7('0x12')][_0x06e7('0x14')]);}else{logger['info'](_0x06e7('0xd'),_0x413637,_0x06e7('0xe'));_0x19b42f(_0x4d916f[_0x06e7('0x15')][_0x06e7('0x14')]);}})[_0x06e7('0x16')](function(_0x30e793){logger[_0x06e7('0x12')](_0x06e7('0xd'),_0x413637,_0x30e793);_0x49b6e9(_0x30e793);});});} \ No newline at end of file +var _0xae62=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xae62,0x111));var _0x2ae6=function(_0x22710e,_0x366b9b){_0x22710e=_0x22710e-0x0;var _0x63f449=_0xae62[_0x22710e];return _0x63f449;};'use strict';var _=require('lodash');var util=require(_0x2ae6('0x0'));var moment=require(_0x2ae6('0x1'));var BPromise=require(_0x2ae6('0x2'));var rs=require(_0x2ae6('0x3'));var fs=require('fs');var Redis=require(_0x2ae6('0x4'));var db=require(_0x2ae6('0x5'))['db'];var utils=require(_0x2ae6('0x6'));var logger=require(_0x2ae6('0x7'))('rpc');var config=require(_0x2ae6('0x8'));var jayson=require(_0x2ae6('0x9'));var client=jayson['client'][_0x2ae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x360642,_0x707538,_0x2ab82e){return new BPromise(function(_0x29f403,_0x13539d){return client['request'](_0x360642,_0x2ab82e)[_0x2ae6('0xb')](function(_0x572f0b){logger['info'](_0x2ae6('0xc'),_0x707538,_0x2ae6('0xd'));logger[_0x2ae6('0xe')](_0x2ae6('0xf'),_0x707538,'request\x20sent',JSON[_0x2ae6('0x10')](_0x572f0b));if(_0x572f0b[_0x2ae6('0x11')]){if(_0x572f0b[_0x2ae6('0x11')][_0x2ae6('0x12')]===0x1f4){logger[_0x2ae6('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x707538,_0x572f0b['error'][_0x2ae6('0x13')]);return _0x13539d(_0x572f0b[_0x2ae6('0x11')][_0x2ae6('0x13')]);}logger[_0x2ae6('0x11')](_0x2ae6('0xc'),_0x707538,_0x572f0b[_0x2ae6('0x11')][_0x2ae6('0x13')]);return _0x29f403(_0x572f0b[_0x2ae6('0x11')][_0x2ae6('0x13')]);}else{logger[_0x2ae6('0x14')](_0x2ae6('0xc'),_0x707538,'request\x20sent');_0x29f403(_0x572f0b[_0x2ae6('0x15')]['message']);}})[_0x2ae6('0x16')](function(_0xe74089){logger[_0x2ae6('0x11')](_0x2ae6('0xc'),_0x707538,_0xe74089);_0x13539d(_0xe74089);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index c30de49..c778f3a 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(_0xa47cf9,_0x58e072){var _0x523e3a=function(_0x267ded){while(--_0x267ded){_0xa47cf9['push'](_0xa47cf9['shift']());}};_0x523e3a(++_0x58e072);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0xcb91[_0xb301d4];return _0x3b5bde;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x85629,_0x10be69){var _0x51b019=function(_0x2b35fb){while(--_0x2b35fb){_0x85629['push'](_0x85629['shift']());}};_0x51b019(++_0x10be69);}(_0xe706,0xa3));var _0x6e70=function(_0x5e343c,_0x5d5c6a){_0x5e343c=_0x5e343c-0x0;var _0x497243=_0xe706[_0x5e343c];return _0x497243;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 57c9c61..f431ace 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 _0xce1e=['INTEGER','STRING','sequelize'];(function(_0x23265c,_0x31a626){var _0x3ac202=function(_0x20f5e0){while(--_0x20f5e0){_0x23265c['push'](_0x23265c['shift']());}};_0x3ac202(++_0x31a626);}(_0xce1e,0x1d3));var _0xece1=function(_0x43c36a,_0x1295df){_0x43c36a=_0x43c36a-0x0;var _0x5d5275=_0xce1e[_0x43c36a];return _0x5d5275;};'use strict';var Sequelize=require(_0xece1('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xece1('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xece1('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xece1('0x2')]}}; \ No newline at end of file +var _0xe889=['exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe889,0x11a));var _0x9e88=function(_0x298d28,_0x10daee){_0x298d28=_0x298d28-0x0;var _0x20693d=_0xe889[_0x298d28];return _0x20693d;};'use strict';var Sequelize=require('sequelize');module[_0x9e88('0x0')]={'penalty':{'type':Sequelize[_0x9e88('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9e88('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9e88('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 8dac4d1..654bf3f 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 _0xb6d3=['path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','bluebird','request-promise'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xb6d3,0x1b4));var _0x3b6d=function(_0x148947,_0x442f51){_0x148947=_0x148947-0x0;var _0x25e3a2=_0xb6d3[_0x148947];return _0x25e3a2;};'use strict';var _=require(_0x3b6d('0x0'));var util=require('util');var logger=require(_0x3b6d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3b6d('0x2'));var rp=require(_0x3b6d('0x3'));var fs=require('fs');var path=require(_0x3b6d('0x4'));var rimraf=require(_0x3b6d('0x5'));var config=require(_0x3b6d('0x6'));var attributes=require(_0x3b6d('0x7'));module[_0x3b6d('0x8')]=function(_0x49f9ad,_0x5cf8b0){return _0x49f9ad['define'](_0x3b6d('0x9'),attributes,{'tableName':_0x3b6d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52fe=['path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','lodash','api','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x52fe,0x14a));var _0xe52f=function(_0x46a643,_0x16244c){_0x46a643=_0x46a643-0x0;var _0x253204=_0x52fe[_0x46a643];return _0x253204;};'use strict';var _=require(_0xe52f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe52f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe52f('0x2'));var fs=require('fs');var path=require(_0xe52f('0x3'));var rimraf=require(_0xe52f('0x4'));var config=require(_0xe52f('0x5'));var attributes=require(_0xe52f('0x6'));module['exports']=function(_0x473136,_0x493ce8){return _0x473136[_0xe52f('0x7')](_0xe52f('0x8'),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 4173a6b..571b3f9 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 _0x8840=['request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x8840,0x14d));var _0x0884=function(_0x2e5727,_0x1a1910){_0x2e5727=_0x2e5727-0x0;var _0x41faad=_0x8840[_0x2e5727];return _0x41faad;};'use strict';var _=require(_0x0884('0x0'));var util=require(_0x0884('0x1'));var moment=require(_0x0884('0x2'));var BPromise=require('bluebird');var rs=require(_0x0884('0x3'));var fs=require('fs');var Redis=require(_0x0884('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0884('0x5'));var logger=require(_0x0884('0x6'))('rpc');var config=require(_0x0884('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0884('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x78ac75,_0x4c11bd,_0x49035b){return new BPromise(function(_0x393279,_0x5733da){return client[_0x0884('0x9')](_0x78ac75,_0x49035b)['then'](function(_0x34793f){logger[_0x0884('0xa')](_0x0884('0xb'),_0x4c11bd,'request\x20sent');logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4c11bd,_0x0884('0xc'),JSON[_0x0884('0xd')](_0x34793f));if(_0x34793f[_0x0884('0xe')]){if(_0x34793f[_0x0884('0xe')][_0x0884('0xf')]===0x1f4){logger[_0x0884('0xe')](_0x0884('0xb'),_0x4c11bd,_0x34793f['error'][_0x0884('0x10')]);return _0x5733da(_0x34793f['error'][_0x0884('0x10')]);}logger[_0x0884('0xe')](_0x0884('0xb'),_0x4c11bd,_0x34793f[_0x0884('0xe')][_0x0884('0x10')]);return _0x393279(_0x34793f[_0x0884('0xe')][_0x0884('0x10')]);}else{logger[_0x0884('0xa')](_0x0884('0xb'),_0x4c11bd,'request\x20sent');_0x393279(_0x34793f[_0x0884('0x11')][_0x0884('0x10')]);}})[_0x0884('0x12')](function(_0x185260){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4c11bd,_0x185260);_0x5733da(_0x185260);});});} \ No newline at end of file +var _0x3be6=['then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request'];(function(_0x3f8fea,_0x230ac4){var _0x6bf899=function(_0x2ebd87){while(--_0x2ebd87){_0x3f8fea['push'](_0x3f8fea['shift']());}};_0x6bf899(++_0x230ac4);}(_0x3be6,0xb2));var _0x63be=function(_0x5af1ce,_0x318f6e){_0x5af1ce=_0x5af1ce-0x0;var _0x4e7f4f=_0x3be6[_0x5af1ce];return _0x4e7f4f;};'use strict';var _=require(_0x63be('0x0'));var util=require('util');var moment=require(_0x63be('0x1'));var BPromise=require(_0x63be('0x2'));var rs=require(_0x63be('0x3'));var fs=require('fs');var Redis=require(_0x63be('0x4'));var db=require(_0x63be('0x5'))['db'];var utils=require(_0x63be('0x6'));var logger=require('../../config/logger')(_0x63be('0x7'));var config=require('../../config/environment');var jayson=require(_0x63be('0x8'));var client=jayson['client'][_0x63be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319dbe,_0x3305cd,_0x3c05ed){return new BPromise(function(_0x30d8e1,_0x48e089){return client[_0x63be('0xa')](_0x319dbe,_0x3c05ed)[_0x63be('0xb')](function(_0x46acc5){logger[_0x63be('0xc')](_0x63be('0xd'),_0x3305cd,_0x63be('0xe'));logger[_0x63be('0xf')](_0x63be('0x10'),_0x3305cd,_0x63be('0xe'),JSON[_0x63be('0x11')](_0x46acc5));if(_0x46acc5[_0x63be('0x12')]){if(_0x46acc5[_0x63be('0x12')]['code']===0x1f4){logger[_0x63be('0x12')](_0x63be('0xd'),_0x3305cd,_0x46acc5[_0x63be('0x12')]['message']);return _0x48e089(_0x46acc5[_0x63be('0x12')]['message']);}logger[_0x63be('0x12')](_0x63be('0xd'),_0x3305cd,_0x46acc5[_0x63be('0x12')][_0x63be('0x13')]);return _0x30d8e1(_0x46acc5['error']['message']);}else{logger[_0x63be('0xc')](_0x63be('0xd'),_0x3305cd,_0x63be('0xe'));_0x30d8e1(_0x46acc5[_0x63be('0x14')]['message']);}})['catch'](function(_0x7a8bb9){logger[_0x63be('0x12')](_0x63be('0xd'),_0x3305cd,_0x7a8bb9);_0x48e089(_0x7a8bb9);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index d393f50..41ef750 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x443520,_0x2fe333){var _0x20afa5=function(_0x13cf74){while(--_0x13cf74){_0x443520['push'](_0x443520['shift']());}};_0x20afa5(++_0x2fe333);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'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(_0x45cc27,_0x25797e){var _0x2fca50=function(_0x5b1673){while(--_0x5b1673){_0x45cc27['push'](_0x45cc27['shift']());}};_0x2fca50(++_0x25797e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xcb91[_0x23b655];return _0x364b32;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index cbf553c..3234784 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 _0x5315=['sequelize'];(function(_0x9cd897,_0x468e72){var _0x58e11c=function(_0x21b879){while(--_0x21b879){_0x9cd897['push'](_0x9cd897['shift']());}};_0x58e11c(++_0x468e72);}(_0x5315,0xa3));var _0x5531=function(_0x1b19a4,_0x13ba33){_0x1b19a4=_0x1b19a4-0x0;var _0x47fc94=_0x5315[_0x1b19a4];return _0x47fc94;};'use strict';var Sequelize=require(_0x5531('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd61f=['exports','INTEGER','sequelize'];(function(_0x2de49b,_0x5471e5){var _0x1042c7=function(_0x278856){while(--_0x278856){_0x2de49b['push'](_0x2de49b['shift']());}};_0x1042c7(++_0x5471e5);}(_0xd61f,0x113));var _0xfd61=function(_0x42f5cb,_0x3ae198){_0x42f5cb=_0x42f5cb-0x0;var _0x4ec9f6=_0xd61f[_0x42f5cb];return _0x4ec9f6;};'use strict';var Sequelize=require(_0xfd61('0x0'));module[_0xfd61('0x1')]={'penalty':{'type':Sequelize[_0xfd61('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 a573423..4d60524 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 _0x66ea=['UserMailQueue','user_has_mail_queues','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define'];(function(_0x5a1760,_0x197140){var _0x158173=function(_0x3785d4){while(--_0x3785d4){_0x5a1760['push'](_0x5a1760['shift']());}};_0x158173(++_0x197140);}(_0x66ea,0x176));var _0xa66e=function(_0x534fcc,_0x59c0aa){_0x534fcc=_0x534fcc-0x0;var _0x25a3c9=_0x66ea[_0x534fcc];return _0x25a3c9;};'use strict';var _=require('lodash');var util=require(_0xa66e('0x0'));var logger=require(_0xa66e('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa66e('0x2'));var rp=require(_0xa66e('0x3'));var fs=require('fs');var path=require(_0xa66e('0x4'));var rimraf=require(_0xa66e('0x5'));var config=require(_0xa66e('0x6'));var attributes=require(_0xa66e('0x7'));module[_0xa66e('0x8')]=function(_0xf209d5,_0x2d7a97){return _0xf209d5[_0xa66e('0x9')](_0xa66e('0xa'),attributes,{'tableName':_0xa66e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6230=['./userMailQueue.attributes','UserMailQueue','lodash','util','bluebird','request-promise','path','../../config/environment'];(function(_0xf3cbb5,_0x2a040f){var _0x5a9464=function(_0x21471a){while(--_0x21471a){_0xf3cbb5['push'](_0xf3cbb5['shift']());}};_0x5a9464(++_0x2a040f);}(_0x6230,0xea));var _0x0623=function(_0x4f4547,_0x2b7b2f){_0x4f4547=_0x4f4547-0x0;var _0x5541de=_0x6230[_0x4f4547];return _0x5541de;};'use strict';var _=require(_0x0623('0x0'));var util=require(_0x0623('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0623('0x2'));var rp=require(_0x0623('0x3'));var fs=require('fs');var path=require(_0x0623('0x4'));var rimraf=require('rimraf');var config=require(_0x0623('0x5'));var attributes=require(_0x0623('0x6'));module['exports']=function(_0x416c99,_0x3029d2){return _0x416c99['define'](_0x0623('0x7'),attributes,{'tableName':'user_has_mail_queues','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 e7da001..4ca1ecc 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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x583ba8,_0x40bb0d){_0x583ba8=_0x583ba8-0x0;var _0x515683=_0x008c[_0x583ba8];return _0x515683;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x307e61,_0x499952){var _0x1b4ab8=function(_0x10b4bf){while(--_0x10b4bf){_0x307e61['push'](_0x307e61['shift']());}};_0x1b4ab8(++_0x499952);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2e7192,_0x1b354b){_0x2e7192=_0x2e7192-0x0;var _0xbe639f=_0x8ef6[_0x2e7192];return _0xbe639f;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 17dcf5a..8f1c8c6 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 _0x117a=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated'];(function(_0x441691,_0x467e46){var _0x3bbfae=function(_0x56e952){while(--_0x56e952){_0x441691['push'](_0x441691['shift']());}};_0x3bbfae(++_0x467e46);}(_0x117a,0x1a1));var _0xa117=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0x117a[_0xd02def];return _0x2e8374;};'use strict';var multer=require(_0xa117('0x0'));var util=require(_0xa117('0x1'));var path=require(_0xa117('0x2'));var timeout=require(_0xa117('0x3'));var express=require('express');var router=express[_0xa117('0x4')]();var fs_extra=require(_0xa117('0x5'));var auth=require(_0xa117('0x6'));var interaction=require(_0xa117('0x7'));var config=require(_0xa117('0x8'));var controller=require(_0xa117('0x9'));router[_0xa117('0xa')]('/',auth[_0xa117('0xb')](),controller['sendUserNotification']);module[_0xa117('0xc')]=router; \ No newline at end of file +var _0x261a=['isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','post'];(function(_0x2686ff,_0x51cee6){var _0x5a95f5=function(_0xc967a9){while(--_0xc967a9){_0x2686ff['push'](_0x2686ff['shift']());}};_0x5a95f5(++_0x51cee6);}(_0x261a,0x1ba));var _0xa261=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x261a[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xa261('0x0'));var util=require(_0xa261('0x1'));var path=require(_0xa261('0x2'));var timeout=require(_0xa261('0x3'));var express=require(_0xa261('0x4'));var router=express[_0xa261('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa261('0x6'));var interaction=require(_0xa261('0x7'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0xa261('0x8')]('/',auth[_0xa261('0x9')](),controller['sendUserNotification']);module[_0xa261('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 27f19c1..5cc145e 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 _0x7592=['TEXT','STRING','BOOLEAN'];(function(_0x4bfaae,_0x163b72){var _0x305f09=function(_0x34105b){while(--_0x34105b){_0x4bfaae['push'](_0x4bfaae['shift']());}};_0x305f09(++_0x163b72);}(_0x7592,0x9c));var _0x2759=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x7592[_0x2085f3];return _0x384e3c;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x2759('0x0')]},'senderName':{'type':Sequelize[_0x2759('0x1')]},'recipientsId':{'type':Sequelize[_0x2759('0x0')]},'recipientsDescription':{'type':Sequelize[_0x2759('0x1')]},'beep':{'type':Sequelize[_0x2759('0x2')]}}; \ No newline at end of file +var _0x7c55=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4c1f1f,_0x3aa18d){var _0x4f9e3c=function(_0x1a94cb){while(--_0x1a94cb){_0x4c1f1f['push'](_0x4c1f1f['shift']());}};_0x4f9e3c(++_0x3aa18d);}(_0x7c55,0xc7));var _0x57c5=function(_0x2226dd,_0x59d005){_0x2226dd=_0x2226dd-0x0;var _0x55936e=_0x7c55[_0x2226dd];return _0x55936e;};'use strict';var Sequelize=require(_0x57c5('0x0'));module[_0x57c5('0x1')]={'body':{'type':Sequelize[_0x57c5('0x2')]},'senderName':{'type':Sequelize[_0x57c5('0x3')]},'recipientsId':{'type':Sequelize[_0x57c5('0x2')]},'recipientsDescription':{'type':Sequelize[_0x57c5('0x3')]},'beep':{'type':Sequelize[_0x57c5('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index ecb307f..d1f737d 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 _0xbd66=['some','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','findOne','render','html','view','startCase','toLowerCase','User','union','ids','queue','push','all','flatten','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','sendUserNotification','body','hasOwnProperty','text','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','mailqueue','smsqueue','whatsappqueue','team','user'];(function(_0x4d3a37,_0x2b8d14){var _0x3e03be=function(_0x3be52e){while(--_0x3be52e){_0x4d3a37['push'](_0x4d3a37['shift']());}};_0x3e03be(++_0x2b8d14);}(_0xbd66,0x152));var _0x6bd6=function(_0x282402,_0x594a45){_0x282402=_0x282402-0x0;var _0x2a4edc=_0xbd66[_0x282402];return _0x2a4edc;};'use strict';var emlformat=require(_0x6bd6('0x0'));var rimraf=require(_0x6bd6('0x1'));var zipdir=require(_0x6bd6('0x2'));var jsonpatch=require(_0x6bd6('0x3'));var rp=require('request-promise');var moment=require(_0x6bd6('0x4'));var BPromise=require(_0x6bd6('0x5'));var Mustache=require('mustache');var util=require(_0x6bd6('0x6'));var path=require('path');var sox=require(_0x6bd6('0x7'));var csv=require(_0x6bd6('0x8'));var ejs=require(_0x6bd6('0x9'));var fs=require('fs');var fs_extra=require(_0x6bd6('0xa'));var _=require(_0x6bd6('0xb'));var squel=require(_0x6bd6('0xc'));var crypto=require('crypto');var jsforce=require(_0x6bd6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6bd6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6bd6('0xe'));var authService=require(_0x6bd6('0xf'));var qs=require(_0x6bd6('0x10'));var as=require(_0x6bd6('0x11'));var hardwareService=require(_0x6bd6('0x12'));var logger=require(_0x6bd6('0x13'))(_0x6bd6('0x14'));var utils=require(_0x6bd6('0x15'));var config=require(_0x6bd6('0x16'));var licenseUtil=require(_0x6bd6('0x17'));var db=require(_0x6bd6('0x18'))['db'];config[_0x6bd6('0x19')]=_[_0x6bd6('0x1a')](config[_0x6bd6('0x19')],{'host':_0x6bd6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6bd6('0x19')]));require(_0x6bd6('0x1c'))[_0x6bd6('0x1d')](socket);function respondWithStatusCode(_0x348db0,_0x348355){_0x348355=_0x348355||0xcc;return function(_0x43e4a5){if(_0x43e4a5){return _0x348db0[_0x6bd6('0x1e')](_0x348355);}return _0x348db0[_0x6bd6('0x1f')](_0x348355)[_0x6bd6('0x20')]();};}function respondWithResult(_0x21f60f,_0x441feb){_0x441feb=_0x441feb||0xc8;return function(_0x330eef){if(_0x330eef){return _0x21f60f[_0x6bd6('0x1f')](_0x441feb)[_0x6bd6('0x21')](_0x330eef);}};}function respondWithFilteredResult(_0x2cf152,_0x4ffc8f){return function(_0xff5afb){if(_0xff5afb){var _0x3a3031=typeof _0x4ffc8f[_0x6bd6('0x22')]===_0x6bd6('0x23')&&typeof _0x4ffc8f[_0x6bd6('0x24')]===_0x6bd6('0x23');var _0x1014a8=_0xff5afb['count'];var _0x5a8975=_0x3a3031?0x0:_0x4ffc8f[_0x6bd6('0x22')];var _0x28e5de=_0x3a3031?_0xff5afb[_0x6bd6('0x25')]:_0x4ffc8f[_0x6bd6('0x22')]+_0x4ffc8f['limit'];var _0x22cda4;if(_0x28e5de>=_0x1014a8){_0x28e5de=_0x1014a8;_0x22cda4=0xc8;}else{_0x22cda4=0xce;}_0x2cf152[_0x6bd6('0x1f')](_0x22cda4);return _0x2cf152[_0x6bd6('0x26')](_0x6bd6('0x27'),_0x5a8975+'-'+_0x28e5de+'/'+_0x1014a8)[_0x6bd6('0x21')](_0xff5afb);}return null;};}function patchUpdates(_0x2df557){return function(_0x13feb9){try{jsonpatch[_0x6bd6('0x28')](_0x13feb9,_0x2df557,!![]);}catch(_0x21f113){return BPromise['reject'](_0x21f113);}return _0x13feb9[_0x6bd6('0x29')]();};}function saveUpdates(_0x3c82c9,_0x867634){return function(_0x56833c){if(_0x56833c){return _0x56833c[_0x6bd6('0x2a')](_0x3c82c9)['then'](function(_0x19ee85){return _0x19ee85;});}return null;};}function removeEntity(_0x25dd8d,_0x485f39){return function(_0x175427){if(_0x175427){return _0x175427[_0x6bd6('0x2b')]()[_0x6bd6('0x2c')](function(){_0x25dd8d[_0x6bd6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x224549,_0x1d1b73){return function(_0x2178c2){if(!_0x2178c2){_0x224549[_0x6bd6('0x1e')](0x194);}return _0x2178c2;};}function handleError(_0x5870df,_0x37edc7){_0x37edc7=_0x37edc7||0x1f4;return function(_0x146429){logger[_0x6bd6('0x2d')](_0x146429[_0x6bd6('0x2e')]);if(_0x146429[_0x6bd6('0x2f')]){delete _0x146429[_0x6bd6('0x2f')];}_0x5870df[_0x6bd6('0x1f')](_0x37edc7)['send'](_0x146429);};}exports[_0x6bd6('0x30')]=function(_0x581c4f,_0x1c32d7,_0x319fb1){if(!_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x32')](_0x6bd6('0x33'))&&!_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x32')]('TemplateId')){throw new db[(_0x6bd6('0x34'))]['ValidationError'](_0x6bd6('0x35'));}else{if(_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x32')](_0x6bd6('0x36'))&&!_0x581c4f['body'][_0x6bd6('0x32')]('view')){throw new db['Sequelize'][(_0x6bd6('0x37'))](_0x6bd6('0x38'));}if(!_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x32')](_0x6bd6('0x39'))){throw new db['Sequelize'][(_0x6bd6('0x37'))](_0x6bd6('0x3a'));}else{try{var _0x5af3b0=JSON[_0x6bd6('0x3b')](_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x39')]);}catch(_0x4ca8e2){logger[_0x6bd6('0x2d')](_0x4ca8e2);throw new db[(_0x6bd6('0x34'))][(_0x6bd6('0x37'))]('Invalid\x20\x27recipients\x27\x20object');}var _0xc84ee5=[_0x6bd6('0x3c'),'faxqueue',_0x6bd6('0x3d'),'openchannelqueue',_0x6bd6('0x3e'),'voicequeue',_0x6bd6('0x3f'),_0x6bd6('0x40'),_0x6bd6('0x41')];if(_[_0x6bd6('0x42')](_0x5af3b0,function(_0x22905c){return!_[_0x6bd6('0x43')](_0xc84ee5,_0x22905c[_0x6bd6('0x44')]['toLowerCase']());})){throw new db[(_0x6bd6('0x34'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x1e6f3b={};_0x1e6f3b[_0x6bd6('0x45')]=_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x32')](_0x6bd6('0x45'))?_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x45')]:_0x581c4f[_0x6bd6('0x41')][_0x6bd6('0x46')];_0x1e6f3b[_0x6bd6('0x47')]=_[_0x6bd6('0x48')](_0x581c4f['body']['recipientsDescription'])?null:_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x47')];_0x1e6f3b['beep']=_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x49')]||![];_0x1e6f3b[_0x6bd6('0x4a')]=_0x581c4f[_0x6bd6('0x41')]['id'];return getContent(_0x581c4f[_0x6bd6('0x31')])['then'](function(_0x473c8b){_0x1e6f3b[_0x6bd6('0x31')]=_0x473c8b;return getRecipients(_0x5af3b0);})[_0x6bd6('0x2c')](function(_0x965524){_0x1e6f3b[_0x6bd6('0x4b')]=_[_0x6bd6('0x4c')](_0x965524)[_0x6bd6('0x4d')](',');return db[_0x6bd6('0x4e')][_0x6bd6('0x4f')](function(_0x4f0313){return db[_0x6bd6('0x50')][_0x6bd6('0x51')](_0x1e6f3b,{'raw':!![],'transaction':_0x4f0313})[_0x6bd6('0x2c')](function(_0x39a107){var _0x3d695f={'sender':_0x1e6f3b[_0x6bd6('0x45')],'description':_0x1e6f3b[_0x6bd6('0x47')],'content':_0x1e6f3b[_0x6bd6('0x31')],'beep':_0x1e6f3b['beep']};_0x965524[_0x6bd6('0x52')](function(_0x33b432){_0x3d695f[_0x6bd6('0x53')]=_0x33b432;socket['emit'](_0x6bd6('0x54'),_0x3d695f);});return _0x39a107;});});})['then'](respondWithResult(_0x1c32d7,0xc9))[_0x6bd6('0x55')](handleError(_0x1c32d7,null));};function getContent(_0x487ecd){return new BPromise(function(_0x3e7039,_0x182cec){if(_0x487ecd[_0x6bd6('0x33')]){_0x3e7039(_0x487ecd[_0x6bd6('0x33')]);return;}return db[_0x6bd6('0x56')][_0x6bd6('0x57')]({'attributes':['html'],'where':{'id':_0x487ecd[_0x6bd6('0x36')]},'raw':!![]})[_0x6bd6('0x2c')](function(_0x1876f9){if(!_0x1876f9)throw new db[(_0x6bd6('0x34'))][(_0x6bd6('0x37'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x54ace7=Mustache[_0x6bd6('0x58')](_0x1876f9[_0x6bd6('0x59')],_0x487ecd[_0x6bd6('0x5a')]);_0x3e7039(_0x54ace7);})[_0x6bd6('0x55')](function(_0x4ae2bd){_0x182cec(_0x4ae2bd);});});}function getRecipients(_0x2dda93){return new BPromise(function(_0x3087d8,_0x2e9c02){var _0x15fd75=[];var _0x4c2bbd=[];_0x2dda93['forEach'](function(_0x4e9784){var _0xcaf4be=_[_0x6bd6('0x5b')](_0x4e9784[_0x6bd6('0x44')][_0x6bd6('0x5c')]());if(_0xcaf4be===_0x6bd6('0x5d')){_0x15fd75=_[_0x6bd6('0x5e')](_0x15fd75,_0x4e9784[_0x6bd6('0x5f')]);}else{if(_[_0x6bd6('0x43')](_0xcaf4be,_0x6bd6('0x60')))_0xcaf4be=_0xcaf4be['replace'](_0x6bd6('0x60'),'Queue');_0x4e9784['ids']['forEach'](function(_0x2ce37c){_0x4c2bbd[_0x6bd6('0x61')](getAgents(_0xcaf4be,_0x2ce37c));});}});return BPromise[_0x6bd6('0x62')](_0x4c2bbd)[_0x6bd6('0x2c')](function(_0x26c970){_0x15fd75=_[_0x6bd6('0x5e')](_0x15fd75,_[_0x6bd6('0x63')](_0x26c970));_0x3087d8(_0x15fd75);})['catch'](function(_0x3bf196){_0x2e9c02(_0x3bf196);});});}function getAgents(_0x2c305c,_0x1dfadf){return new BPromise(function(_0x6753b,_0x4814ab){return db[_0x2c305c][_0x6bd6('0x57')]({'where':{'id':_0x1dfadf}})[_0x6bd6('0x2c')](function(_0xbef6d0){return _0xbef6d0[_0x6bd6('0x64')]({'attributes':['id'],'raw':!![]})[_0x6bd6('0x2c')](function(_0x46bc0d){var _0xc35c69=_['map'](_0x46bc0d,'id');_0x6753b(_0xc35c69);});})[_0x6bd6('0x55')](function(_0x51fabf){_0x4814ab(_0x51fabf);});});} \ No newline at end of file +var _0xf8f0=['openchannelqueue','smsqueue','whatsappqueue','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','beep','SenderId','recipientsId','join','sequelize','transaction','create','recipientsDescription','forEach','recipient','emit','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','model','User','union','ids','queue','replace','Queue','push','all','flatten','findOne','getAgents','map','eml-format','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','view','Missing\x20\x27view\x27\x20parameter','recipients','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf8f0,0x94));var _0x0f8f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf8f0[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x0f8f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f8f('0x1'));var rp=require(_0x0f8f('0x2'));var moment=require(_0x0f8f('0x3'));var BPromise=require(_0x0f8f('0x4'));var Mustache=require(_0x0f8f('0x5'));var util=require(_0x0f8f('0x6'));var path=require(_0x0f8f('0x7'));var sox=require(_0x0f8f('0x8'));var csv=require(_0x0f8f('0x9'));var ejs=require(_0x0f8f('0xa'));var fs=require('fs');var fs_extra=require(_0x0f8f('0xb'));var _=require(_0x0f8f('0xc'));var squel=require(_0x0f8f('0xd'));var crypto=require(_0x0f8f('0xe'));var jsforce=require(_0x0f8f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0f8f('0x9'));var querystring=require(_0x0f8f('0x10'));var Papa=require(_0x0f8f('0x11'));var Redis=require(_0x0f8f('0x12'));var authService=require(_0x0f8f('0x13'));var qs=require(_0x0f8f('0x14'));var as=require(_0x0f8f('0x15'));var hardwareService=require(_0x0f8f('0x16'));var logger=require(_0x0f8f('0x17'))(_0x0f8f('0x18'));var utils=require(_0x0f8f('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0f8f('0x1a'))['db'];config[_0x0f8f('0x1b')]=_[_0x0f8f('0x1c')](config[_0x0f8f('0x1b')],{'host':_0x0f8f('0x1d'),'port':0x18eb});var socket=require(_0x0f8f('0x1e'))(new Redis(config[_0x0f8f('0x1b')]));require(_0x0f8f('0x1f'))[_0x0f8f('0x20')](socket);function respondWithStatusCode(_0x1c14f8,_0x381228){_0x381228=_0x381228||0xcc;return function(_0x50f575){if(_0x50f575){return _0x1c14f8[_0x0f8f('0x21')](_0x381228);}return _0x1c14f8[_0x0f8f('0x22')](_0x381228)[_0x0f8f('0x23')]();};}function respondWithResult(_0x237fa6,_0x19dda4){_0x19dda4=_0x19dda4||0xc8;return function(_0x218d9c){if(_0x218d9c){return _0x237fa6[_0x0f8f('0x22')](_0x19dda4)['json'](_0x218d9c);}};}function respondWithFilteredResult(_0x3d638c,_0x297811){return function(_0x2ff15c){if(_0x2ff15c){var _0x222666=typeof _0x297811[_0x0f8f('0x24')]==='undefined'&&typeof _0x297811['limit']===_0x0f8f('0x25');var _0x5244f4=_0x2ff15c['count'];var _0x14f0de=_0x222666?0x0:_0x297811['offset'];var _0x385eae=_0x222666?_0x2ff15c[_0x0f8f('0x26')]:_0x297811['offset']+_0x297811[_0x0f8f('0x27')];var _0x1a1020;if(_0x385eae>=_0x5244f4){_0x385eae=_0x5244f4;_0x1a1020=0xc8;}else{_0x1a1020=0xce;}_0x3d638c['status'](_0x1a1020);return _0x3d638c[_0x0f8f('0x28')](_0x0f8f('0x29'),_0x14f0de+'-'+_0x385eae+'/'+_0x5244f4)['json'](_0x2ff15c);}return null;};}function patchUpdates(_0xc374c6){return function(_0x48054f){try{jsonpatch[_0x0f8f('0x2a')](_0x48054f,_0xc374c6,!![]);}catch(_0x344da7){return BPromise[_0x0f8f('0x2b')](_0x344da7);}return _0x48054f[_0x0f8f('0x2c')]();};}function saveUpdates(_0x1fbe36,_0xad5ecd){return function(_0x175497){if(_0x175497){return _0x175497[_0x0f8f('0x2d')](_0x1fbe36)['then'](function(_0x54d625){return _0x54d625;});}return null;};}function removeEntity(_0xc8248b,_0x4d178f){return function(_0x1901f7){if(_0x1901f7){return _0x1901f7['destroy']()[_0x0f8f('0x2e')](function(){_0xc8248b[_0x0f8f('0x22')](0xcc)[_0x0f8f('0x23')]();});}};}function handleEntityNotFound(_0x3d5c16,_0x415dc8){return function(_0x47189d){if(!_0x47189d){_0x3d5c16[_0x0f8f('0x21')](0x194);}return _0x47189d;};}function handleError(_0x55e055,_0x48b387){_0x48b387=_0x48b387||0x1f4;return function(_0x14848b){logger[_0x0f8f('0x2f')](_0x14848b[_0x0f8f('0x30')]);if(_0x14848b[_0x0f8f('0x31')]){delete _0x14848b[_0x0f8f('0x31')];}_0x55e055['status'](_0x48b387)[_0x0f8f('0x32')](_0x14848b);};}exports[_0x0f8f('0x33')]=function(_0x455fef,_0x21bdfd,_0x3eebe7){if(!_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x35')](_0x0f8f('0x36'))&&!_0x455fef['body'][_0x0f8f('0x35')](_0x0f8f('0x37'))){throw new db[(_0x0f8f('0x38'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x455fef[_0x0f8f('0x34')]['hasOwnProperty'](_0x0f8f('0x37'))&&!_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x35')](_0x0f8f('0x39'))){throw new db[(_0x0f8f('0x38'))]['ValidationError'](_0x0f8f('0x3a'));}if(!_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x35')](_0x0f8f('0x3b'))){throw new db[(_0x0f8f('0x38'))][(_0x0f8f('0x3c'))](_0x0f8f('0x3d'));}else{try{var _0x4cbe4c=JSON[_0x0f8f('0x3e')](_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x3b')]);}catch(_0x259a45){logger[_0x0f8f('0x2f')](_0x259a45);throw new db[(_0x0f8f('0x38'))][(_0x0f8f('0x3c'))](_0x0f8f('0x3f'));}var _0x20bb0d=[_0x0f8f('0x40'),_0x0f8f('0x41'),'mailqueue',_0x0f8f('0x42'),_0x0f8f('0x43'),'voicequeue',_0x0f8f('0x44'),'team',_0x0f8f('0x45')];if(_[_0x0f8f('0x46')](_0x4cbe4c,function(_0x3e0cb7){return!_[_0x0f8f('0x47')](_0x20bb0d,_0x3e0cb7['model'][_0x0f8f('0x48')]());})){throw new db[(_0x0f8f('0x38'))]['ValidationError'](_0x0f8f('0x49'));}}}var _0x158819={};_0x158819[_0x0f8f('0x4a')]=_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x35')]('senderName')?_0x455fef['body'][_0x0f8f('0x4a')]:_0x455fef['user'][_0x0f8f('0x4b')];_0x158819['recipientsDescription']=_[_0x0f8f('0x4c')](_0x455fef[_0x0f8f('0x34')]['recipientsDescription'])?null:_0x455fef[_0x0f8f('0x34')]['recipientsDescription'];_0x158819['beep']=_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x4d')]||![];_0x158819[_0x0f8f('0x4e')]=_0x455fef['user']['id'];return getContent(_0x455fef[_0x0f8f('0x34')])[_0x0f8f('0x2e')](function(_0x11bbf7){_0x158819[_0x0f8f('0x34')]=_0x11bbf7;return getRecipients(_0x4cbe4c);})[_0x0f8f('0x2e')](function(_0x26880d){_0x158819[_0x0f8f('0x4f')]=_['sortBy'](_0x26880d)[_0x0f8f('0x50')](',');return db[_0x0f8f('0x51')][_0x0f8f('0x52')](function(_0x30623a){return db['UserNotification'][_0x0f8f('0x53')](_0x158819,{'raw':!![],'transaction':_0x30623a})[_0x0f8f('0x2e')](function(_0x328258){var _0x2d0961={'sender':_0x158819[_0x0f8f('0x4a')],'description':_0x158819[_0x0f8f('0x54')],'content':_0x158819[_0x0f8f('0x34')],'beep':_0x158819[_0x0f8f('0x4d')]};_0x26880d[_0x0f8f('0x55')](function(_0xc15d4c){_0x2d0961[_0x0f8f('0x56')]=_0xc15d4c;socket[_0x0f8f('0x57')](_0x0f8f('0x58'),_0x2d0961);});return _0x328258;});});})['then'](respondWithResult(_0x21bdfd,0xc9))[_0x0f8f('0x59')](handleError(_0x21bdfd,null));};function getContent(_0x139777){return new BPromise(function(_0x84d111,_0x3bf0e1){if(_0x139777['text']){_0x84d111(_0x139777[_0x0f8f('0x36')]);return;}return db[_0x0f8f('0x5a')]['findOne']({'attributes':[_0x0f8f('0x5b')],'where':{'id':_0x139777['TemplateId']},'raw':!![]})[_0x0f8f('0x2e')](function(_0x41b83a){if(!_0x41b83a)throw new db['Sequelize'][(_0x0f8f('0x3c'))](_0x0f8f('0x5c'));var _0x4567f2=Mustache[_0x0f8f('0x5d')](_0x41b83a[_0x0f8f('0x5b')],_0x139777[_0x0f8f('0x39')]);_0x84d111(_0x4567f2);})[_0x0f8f('0x59')](function(_0x4e827c){_0x3bf0e1(_0x4e827c);});});}function getRecipients(_0xd03b79){return new BPromise(function(_0x278a61,_0xa9560e){var _0x37a2cf=[];var _0x213179=[];_0xd03b79[_0x0f8f('0x55')](function(_0x4cb748){var _0x25a621=_['startCase'](_0x4cb748[_0x0f8f('0x5e')]['toLowerCase']());if(_0x25a621===_0x0f8f('0x5f')){_0x37a2cf=_[_0x0f8f('0x60')](_0x37a2cf,_0x4cb748[_0x0f8f('0x61')]);}else{if(_[_0x0f8f('0x47')](_0x25a621,_0x0f8f('0x62')))_0x25a621=_0x25a621[_0x0f8f('0x63')]('queue',_0x0f8f('0x64'));_0x4cb748[_0x0f8f('0x61')]['forEach'](function(_0x12a0aa){_0x213179[_0x0f8f('0x65')](getAgents(_0x25a621,_0x12a0aa));});}});return BPromise[_0x0f8f('0x66')](_0x213179)[_0x0f8f('0x2e')](function(_0x14635e){_0x37a2cf=_[_0x0f8f('0x60')](_0x37a2cf,_[_0x0f8f('0x67')](_0x14635e));_0x278a61(_0x37a2cf);})[_0x0f8f('0x59')](function(_0x51d2eb){_0xa9560e(_0x51d2eb);});});}function getAgents(_0x33fc20,_0x142d27){return new BPromise(function(_0x37c27a,_0x22be01){return db[_0x33fc20][_0x0f8f('0x68')]({'where':{'id':_0x142d27}})[_0x0f8f('0x2e')](function(_0x5618fa){return _0x5618fa[_0x0f8f('0x69')]({'attributes':['id'],'raw':!![]})[_0x0f8f('0x2e')](function(_0x16056f){var _0x403d94=_[_0x0f8f('0x6a')](_0x16056f,'id');_0x37c27a(_0x403d94);});})[_0x0f8f('0x59')](function(_0x2e87db){_0x22be01(_0x2e87db);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 3e63e74..4aece62 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 _0x1c49=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save'];(function(_0xcedb41,_0x48b5d6){var _0x183200=function(_0x34a4ff){while(--_0x34a4ff){_0xcedb41['push'](_0xcedb41['shift']());}};_0x183200(++_0x48b5d6);}(_0x1c49,0x1d4));var _0x91c4=function(_0x1777a6,_0xf00e5c){_0x1777a6=_0x1777a6-0x0;var _0x9a7adf=_0x1c49[_0x1777a6];return _0x9a7adf;};'use strict';var EventEmitter=require(_0x91c4('0x0'));var UserNotification=require(_0x91c4('0x1'))['db'][_0x91c4('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x91c4('0x3')](0x0);var events={'afterCreate':_0x91c4('0x4'),'afterUpdate':_0x91c4('0x5'),'afterDestroy':_0x91c4('0x6')};function emitEvent(_0x4b5f1c){return function(_0x1dbf84,_0x5dbef5,_0x1fa427){UserNotificationEvents[_0x91c4('0x7')](_0x4b5f1c+':'+_0x1dbf84['id'],_0x1dbf84);UserNotificationEvents[_0x91c4('0x7')](_0x4b5f1c,_0x1dbf84);_0x1fa427(null);};}for(var e in events){if(events[_0x91c4('0x8')](e)){var event=events[e];UserNotification[_0x91c4('0x9')](e,emitEvent(event));}}module[_0x91c4('0xa')]=UserNotificationEvents; \ No newline at end of file +var _0xe8e3=['hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xe8e3,0x141));var _0x3e8e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe8e3[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0x3e8e('0x0'));var UserNotification=require(_0x3e8e('0x1'))['db'][_0x3e8e('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x3e8e('0x3')](0x0);var events={'afterCreate':_0x3e8e('0x4'),'afterUpdate':_0x3e8e('0x5'),'afterDestroy':_0x3e8e('0x6')};function emitEvent(_0x1cc26b){return function(_0x1f0e0a,_0xaba088,_0x559305){UserNotificationEvents[_0x3e8e('0x7')](_0x1cc26b+':'+_0x1f0e0a['id'],_0x1f0e0a);UserNotificationEvents['emit'](_0x1cc26b,_0x1f0e0a);_0x559305(null);};}for(var e in events){if(events[_0x3e8e('0x8')](e)){var event=events[e];UserNotification[_0x3e8e('0x9')](e,emitEvent(event));}}module[_0x3e8e('0xa')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index ded5fb5..047f416 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 _0x33d4=['exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0x33d4,0x84));var _0x433d=function(_0x5b1872,_0x481a51){_0x5b1872=_0x5b1872-0x0;var _0x52ed7c=_0x33d4[_0x5b1872];return _0x52ed7c;};'use strict';var _=require('lodash');var util=require(_0x433d('0x0'));var logger=require(_0x433d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x433d('0x2'));var rp=require(_0x433d('0x3'));var fs=require('fs');var path=require(_0x433d('0x4'));var rimraf=require(_0x433d('0x5'));var config=require(_0x433d('0x6'));var attributes=require(_0x433d('0x7'));module[_0x433d('0x8')]=function(_0x149ece,_0x284375){return _0x149ece[_0x433d('0x9')](_0x433d('0xa'),attributes,{'tableName':_0x433d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x433d('0xc'),'collate':_0x433d('0xd')});}; \ No newline at end of file +var _0x5c3e=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','UserNotification','userNotifications'];(function(_0x1679fa,_0x8df10d){var _0x22f72d=function(_0x2ae2c9){while(--_0x2ae2c9){_0x1679fa['push'](_0x1679fa['shift']());}};_0x22f72d(++_0x8df10d);}(_0x5c3e,0x152));var _0xe5c3=function(_0x5930f8,_0x28f13c){_0x5930f8=_0x5930f8-0x0;var _0x3ea2af=_0x5c3e[_0x5930f8];return _0x3ea2af;};'use strict';var _=require(_0xe5c3('0x0'));var util=require(_0xe5c3('0x1'));var logger=require(_0xe5c3('0x2'))(_0xe5c3('0x3'));var moment=require(_0xe5c3('0x4'));var BPromise=require(_0xe5c3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe5c3('0x6'));var config=require(_0xe5c3('0x7'));var attributes=require('./userNotification.attributes');module[_0xe5c3('0x8')]=function(_0x5257dd,_0x49b512){return _0x5257dd[_0xe5c3('0x9')](_0xe5c3('0xa'),attributes,{'tableName':_0xe5c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe5c3('0xc'),'collate':_0xe5c3('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index a59e616..3d1f02a 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 _0xdcd7=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','localhost','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x521a45,_0x5734bd){var _0x25dfa4=function(_0x4bc47f){while(--_0x4bc47f){_0x521a45['push'](_0x521a45['shift']());}};_0x25dfa4(++_0x5734bd);}(_0xdcd7,0x12c));var _0x7dcd=function(_0x7bab5a,_0x55b4f8){_0x7bab5a=_0x7bab5a-0x0;var _0x3ef90a=_0xdcd7[_0x7bab5a];return _0x3ef90a;};'use strict';var _=require(_0x7dcd('0x0'));var util=require(_0x7dcd('0x1'));var moment=require(_0x7dcd('0x2'));var BPromise=require(_0x7dcd('0x3'));var rs=require(_0x7dcd('0x4'));var fs=require('fs');var Redis=require(_0x7dcd('0x5'));var db=require(_0x7dcd('0x6'))['db'];var utils=require(_0x7dcd('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7dcd('0x8'));var client=jayson[_0x7dcd('0x9')][_0x7dcd('0xa')]({'port':0x232a});config[_0x7dcd('0xb')]=_['defaults'](config['redis'],{'host':_0x7dcd('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7dcd('0xb')]));require(_0x7dcd('0xd'))[_0x7dcd('0xe')](socket);function respondWithRpcPromise(_0x2abf05,_0x548e3c,_0x58221a){return new BPromise(function(_0x2c8f87,_0x82e5da){return client[_0x7dcd('0xf')](_0x2abf05,_0x58221a)[_0x7dcd('0x10')](function(_0x304d08){logger['info'](_0x7dcd('0x11'),_0x548e3c,_0x7dcd('0x12'));logger[_0x7dcd('0x13')](_0x7dcd('0x14'),_0x548e3c,_0x7dcd('0x12'),JSON[_0x7dcd('0x15')](_0x304d08));if(_0x304d08['error']){if(_0x304d08[_0x7dcd('0x16')]['code']===0x1f4){logger[_0x7dcd('0x16')](_0x7dcd('0x11'),_0x548e3c,_0x304d08[_0x7dcd('0x16')][_0x7dcd('0x17')]);return _0x82e5da(_0x304d08['error'][_0x7dcd('0x17')]);}logger[_0x7dcd('0x16')](_0x7dcd('0x11'),_0x548e3c,_0x304d08[_0x7dcd('0x16')][_0x7dcd('0x17')]);return _0x2c8f87(_0x304d08[_0x7dcd('0x16')][_0x7dcd('0x17')]);}else{logger['info'](_0x7dcd('0x11'),_0x548e3c,_0x7dcd('0x12'));_0x2c8f87(_0x304d08['result']['message']);}})[_0x7dcd('0x18')](function(_0x436efe){logger[_0x7dcd('0x16')]('UserNotification,\x20%s,\x20%s',_0x548e3c,_0x436efe);_0x82e5da(_0x436efe);});});} \ No newline at end of file +var _0x4110=['error','code','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x4110,0xad));var _0x0411=function(_0x2d6a2a,_0x4d8c74){_0x2d6a2a=_0x2d6a2a-0x0;var _0x451d18=_0x4110[_0x2d6a2a];return _0x451d18;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0411('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0411('0x1'));var db=require(_0x0411('0x2'))['db'];var utils=require(_0x0411('0x3'));var logger=require(_0x0411('0x4'))('rpc');var config=require(_0x0411('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0411('0x6')][_0x0411('0x7')]({'port':0x232a});config[_0x0411('0x8')]=_[_0x0411('0x9')](config[_0x0411('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0411('0xa'))(new Redis(config[_0x0411('0x8')]));require(_0x0411('0xb'))[_0x0411('0xc')](socket);function respondWithRpcPromise(_0x322e12,_0x3c14bf,_0x1e08a4){return new BPromise(function(_0x198358,_0x15717e){return client[_0x0411('0xd')](_0x322e12,_0x1e08a4)[_0x0411('0xe')](function(_0x39f789){logger[_0x0411('0xf')](_0x0411('0x10'),_0x3c14bf,_0x0411('0x11'));logger[_0x0411('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x3c14bf,'request\x20sent',JSON['stringify'](_0x39f789));if(_0x39f789[_0x0411('0x13')]){if(_0x39f789[_0x0411('0x13')][_0x0411('0x14')]===0x1f4){logger[_0x0411('0x13')]('UserNotification,\x20%s,\x20%s',_0x3c14bf,_0x39f789[_0x0411('0x13')][_0x0411('0x15')]);return _0x15717e(_0x39f789['error']['message']);}logger[_0x0411('0x13')](_0x0411('0x10'),_0x3c14bf,_0x39f789['error']['message']);return _0x198358(_0x39f789['error'][_0x0411('0x15')]);}else{logger[_0x0411('0xf')](_0x0411('0x10'),_0x3c14bf,_0x0411('0x11'));_0x198358(_0x39f789[_0x0411('0x16')]['message']);}})[_0x0411('0x17')](function(_0x49103c){logger[_0x0411('0x13')]('UserNotification,\x20%s,\x20%s',_0x3c14bf,_0x49103c);_0x15717e(_0x49103c);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index b4dc9ee..a918c51 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 _0xf00a=['userNotification:','./userNotification.events','save','remove','removeListener','length'];(function(_0x280a84,_0x181a3f){var _0x160e33=function(_0x5c1bd0){while(--_0x5c1bd0){_0x280a84['push'](_0x280a84['shift']());}};_0x160e33(++_0x181a3f);}(_0xf00a,0xa9));var _0xaf00=function(_0x5b7b22,_0x5bc479){_0x5b7b22=_0x5b7b22-0x0;var _0x53dc9d=_0xf00a[_0x5b7b22];return _0x53dc9d;};'use strict';var UserNotificationEvents=require(_0xaf00('0x0'));var events=[_0xaf00('0x1'),_0xaf00('0x2'),'update'];function createListener(_0x33c2ef,_0x1d4da1){return function(_0x40bc49){_0x1d4da1['emit'](_0x33c2ef,_0x40bc49);};}function removeListener(_0x561a8b,_0x5d479c){return function(){UserNotificationEvents[_0xaf00('0x3')](_0x561a8b,_0x5d479c);};}exports['register']=function(_0x31c32c){for(var _0x2041e5=0x0,_0xfc395e=events[_0xaf00('0x4')];_0x2041e5<_0xfc395e;_0x2041e5++){var _0x9a685=events[_0x2041e5];var _0x210467=createListener(_0xaf00('0x5')+_0x9a685,_0x31c32c);UserNotificationEvents['on'](_0x9a685,_0x210467);}}; \ No newline at end of file +var _0xa099=['userNotification:','save','remove','update','removeListener','register','length'];(function(_0x53ef01,_0x3b4bc8){var _0x270706=function(_0x3e800a){while(--_0x3e800a){_0x53ef01['push'](_0x53ef01['shift']());}};_0x270706(++_0x3b4bc8);}(_0xa099,0xc5));var _0x9a09=function(_0x5d1636,_0x5034d7){_0x5d1636=_0x5d1636-0x0;var _0x3dc4ed=_0xa099[_0x5d1636];return _0x3dc4ed;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x9a09('0x0'),_0x9a09('0x1'),_0x9a09('0x2')];function createListener(_0x603c2a,_0x44a3e6){return function(_0x270e7c){_0x44a3e6['emit'](_0x603c2a,_0x270e7c);};}function removeListener(_0x35b8d6,_0xc9d687){return function(){UserNotificationEvents[_0x9a09('0x3')](_0x35b8d6,_0xc9d687);};}exports[_0x9a09('0x4')]=function(_0x2e323f){for(var _0x3a0de2=0x0,_0xc2c742=events[_0x9a09('0x5')];_0x3a0de2<_0xc2c742;_0x3a0de2++){var _0x3531f8=events[_0x3a0de2];var _0xe0adc0=createListener(_0x9a09('0x6')+_0x3531f8,_0x2e323f);UserNotificationEvents['on'](_0x3531f8,_0xe0adc0);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 3f1490f..22d1cfa 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3b20ec,_0x95fe98){var _0x566898=function(_0x7b54b9){while(--_0x7b54b9){_0x3b20ec['push'](_0x3b20ec['shift']());}};_0x566898(++_0x95fe98);}(_0x70e0,0x17b));var _0x070e=function(_0x27bef0,_0x2ec5a3){_0x27bef0=_0x27bef0-0x0;var _0x576086=_0x70e0[_0x27bef0];return _0x576086;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index d08547b..8245b2b 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 _0x0bb1=['exports'];(function(_0x213dc5,_0x12a5f6){var _0x49256d=function(_0x453c07){while(--_0x453c07){_0x213dc5['push'](_0x213dc5['shift']());}};_0x49256d(++_0x12a5f6);}(_0x0bb1,0x1cd));var _0x10bb=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x0bb1[_0x153e7d];return _0x3c22dd;};'use strict';var Sequelize=require('sequelize');module[_0x10bb('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1b3b=['exports','INTEGER'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x1b3b,0x1be));var _0xb1b3=function(_0x15da6d,_0x3f7b83){_0x15da6d=_0x15da6d-0x0;var _0x4535ac=_0x1b3b[_0x15da6d];return _0x4535ac;};'use strict';var Sequelize=require('sequelize');module[_0xb1b3('0x0')]={'penalty':{'type':Sequelize[_0xb1b3('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index e010753..a93f867 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 _0xecee=['rimraf','../../config/environment','exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','api','moment'];(function(_0x19cfd0,_0x35651b){var _0x5f22f8=function(_0x299d5a){while(--_0x299d5a){_0x19cfd0['push'](_0x19cfd0['shift']());}};_0x5f22f8(++_0x35651b);}(_0xecee,0xaf));var _0xeece=function(_0x395b51,_0x9cb7e5){_0x395b51=_0x395b51-0x0;var _0x33b025=_0xecee[_0x395b51];return _0x33b025;};'use strict';var _=require(_0xeece('0x0'));var util=require(_0xeece('0x1'));var logger=require(_0xeece('0x2'))(_0xeece('0x3'));var moment=require(_0xeece('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeece('0x5'));var config=require(_0xeece('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xeece('0x7')]=function(_0x3618c4,_0x45518a){return _0x3618c4[_0xeece('0x8')](_0xeece('0x9'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9746=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x25c9b7,_0x9e3bd){var _0x2e541b=function(_0x5318f0){while(--_0x5318f0){_0x25c9b7['push'](_0x25c9b7['shift']());}};_0x2e541b(++_0x9e3bd);}(_0x9746,0xbb));var _0x6974=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x9746[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require('lodash');var util=require(_0x6974('0x0'));var logger=require(_0x6974('0x1'))('api');var moment=require(_0x6974('0x2'));var BPromise=require(_0x6974('0x3'));var rp=require(_0x6974('0x4'));var fs=require('fs');var path=require(_0x6974('0x5'));var rimraf=require(_0x6974('0x6'));var config=require(_0x6974('0x7'));var attributes=require(_0x6974('0x8'));module[_0x6974('0x9')]=function(_0xa2bfdb,_0x423848){return _0xa2bfdb['define'](_0x6974('0xa'),attributes,{'tableName':_0x6974('0xb'),'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 d667dee..bda930a 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 _0xc7c5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','message','UserOpenchannelQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xc7c5,0xc2));var _0x5c7c=function(_0x2b2c95,_0x2ab873){_0x2b2c95=_0x2b2c95-0x0;var _0x88dd44=_0xc7c5[_0x2b2c95];return _0x88dd44;};'use strict';var _=require(_0x5c7c('0x0'));var util=require(_0x5c7c('0x1'));var moment=require(_0x5c7c('0x2'));var BPromise=require(_0x5c7c('0x3'));var rs=require(_0x5c7c('0x4'));var fs=require('fs');var Redis=require(_0x5c7c('0x5'));var db=require(_0x5c7c('0x6'))['db'];var utils=require(_0x5c7c('0x7'));var logger=require(_0x5c7c('0x8'))(_0x5c7c('0x9'));var config=require(_0x5c7c('0xa'));var jayson=require(_0x5c7c('0xb'));var client=jayson[_0x5c7c('0xc')][_0x5c7c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x19b43d,_0x13fa34,_0x21574f){return new BPromise(function(_0x3f63ce,_0x2926f2){return client[_0x5c7c('0xe')](_0x19b43d,_0x21574f)[_0x5c7c('0xf')](function(_0x3b8bb4){logger[_0x5c7c('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x13fa34,_0x5c7c('0x11'));logger[_0x5c7c('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x13fa34,_0x5c7c('0x11'),JSON[_0x5c7c('0x13')](_0x3b8bb4));if(_0x3b8bb4[_0x5c7c('0x14')]){if(_0x3b8bb4['error']['code']===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x13fa34,_0x3b8bb4[_0x5c7c('0x14')][_0x5c7c('0x15')]);return _0x2926f2(_0x3b8bb4['error'][_0x5c7c('0x15')]);}logger[_0x5c7c('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x13fa34,_0x3b8bb4[_0x5c7c('0x14')][_0x5c7c('0x15')]);return _0x3f63ce(_0x3b8bb4[_0x5c7c('0x14')][_0x5c7c('0x15')]);}else{logger[_0x5c7c('0x10')](_0x5c7c('0x16'),_0x13fa34,_0x5c7c('0x11'));_0x3f63ce(_0x3b8bb4[_0x5c7c('0x17')]['message']);}})[_0x5c7c('0x18')](function(_0x2f5c3a){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x13fa34,_0x2f5c3a);_0x2926f2(_0x2f5c3a);});});} \ No newline at end of file +var _0x6f12=['UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3755a2,_0x5be61e){var _0x2df8e4=function(_0x316bae){while(--_0x316bae){_0x3755a2['push'](_0x3755a2['shift']());}};_0x2df8e4(++_0x5be61e);}(_0x6f12,0x11d));var _0x26f1=function(_0x1c7502,_0xf4952b){_0x1c7502=_0x1c7502-0x0;var _0x2de29d=_0x6f12[_0x1c7502];return _0x2de29d;};'use strict';var _=require(_0x26f1('0x0'));var util=require(_0x26f1('0x1'));var moment=require(_0x26f1('0x2'));var BPromise=require(_0x26f1('0x3'));var rs=require(_0x26f1('0x4'));var fs=require('fs');var Redis=require(_0x26f1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x26f1('0x6'));var logger=require(_0x26f1('0x7'))(_0x26f1('0x8'));var config=require('../../config/environment');var jayson=require(_0x26f1('0x9'));var client=jayson[_0x26f1('0xa')][_0x26f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d6445,_0x2998de,_0x2cd814){return new BPromise(function(_0x18c34c,_0x289381){return client[_0x26f1('0xc')](_0x1d6445,_0x2cd814)[_0x26f1('0xd')](function(_0x116f72){logger[_0x26f1('0xe')](_0x26f1('0xf'),_0x2998de,_0x26f1('0x10'));logger[_0x26f1('0x11')](_0x26f1('0x12'),_0x2998de,_0x26f1('0x10'),JSON[_0x26f1('0x13')](_0x116f72));if(_0x116f72[_0x26f1('0x14')]){if(_0x116f72['error'][_0x26f1('0x15')]===0x1f4){logger[_0x26f1('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2998de,_0x116f72['error'][_0x26f1('0x16')]);return _0x289381(_0x116f72[_0x26f1('0x14')][_0x26f1('0x16')]);}logger['error'](_0x26f1('0xf'),_0x2998de,_0x116f72['error'][_0x26f1('0x16')]);return _0x18c34c(_0x116f72[_0x26f1('0x14')][_0x26f1('0x16')]);}else{logger[_0x26f1('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2998de,_0x26f1('0x10'));_0x18c34c(_0x116f72[_0x26f1('0x17')][_0x26f1('0x16')]);}})[_0x26f1('0x18')](function(_0x5a24c6){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2998de,_0x5a24c6);_0x289381(_0x5a24c6);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 1a92df0..b1a99a9 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 _0xad57=['index','get','/describe','isAuthenticated','describe','/:id','show','/:id/sections','/:id/resources','post','create','/:id/clone','addSections','put','delete','destroy','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0xad57,0xc1));var _0x7ad5=function(_0x323b5c,_0x50d624){_0x323b5c=_0x323b5c-0x0;var _0x3d3634=_0xad57[_0x323b5c];return _0x3d3634;};'use strict';var multer=require(_0x7ad5('0x0'));var util=require(_0x7ad5('0x1'));var path=require('path');var timeout=require(_0x7ad5('0x2'));var express=require(_0x7ad5('0x3'));var router=express[_0x7ad5('0x4')]();var fs_extra=require(_0x7ad5('0x5'));var auth=require(_0x7ad5('0x6'));var interaction=require(_0x7ad5('0x7'));var config=require(_0x7ad5('0x8'));var controller=require(_0x7ad5('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7ad5('0xa')]);router[_0x7ad5('0xb')](_0x7ad5('0xc'),auth[_0x7ad5('0xd')](),controller[_0x7ad5('0xe')]);router[_0x7ad5('0xb')](_0x7ad5('0xf'),auth[_0x7ad5('0xd')](),controller[_0x7ad5('0x10')]);router[_0x7ad5('0xb')](_0x7ad5('0x11'),auth[_0x7ad5('0xd')](),controller['getSections']);router[_0x7ad5('0xb')](_0x7ad5('0x12'),auth[_0x7ad5('0xd')](),controller['getResources']);router[_0x7ad5('0x13')]('/',auth['isAuthenticated'](),controller[_0x7ad5('0x14')]);router[_0x7ad5('0x13')](_0x7ad5('0x15'),auth[_0x7ad5('0xd')](),controller['clone']);router[_0x7ad5('0x13')]('/:id/sections',auth['isAuthenticated'](),controller[_0x7ad5('0x16')]);router[_0x7ad5('0x13')](_0x7ad5('0x12'),auth['isAuthenticated'](),controller['addResources']);router[_0x7ad5('0x17')](_0x7ad5('0xf'),auth[_0x7ad5('0xd')](),controller['update']);router[_0x7ad5('0x18')](_0x7ad5('0xf'),auth[_0x7ad5('0xd')](),controller[_0x7ad5('0x19')]);router[_0x7ad5('0x18')](_0x7ad5('0x11'),auth[_0x7ad5('0xd')](),controller[_0x7ad5('0x1a')]);router[_0x7ad5('0x18')](_0x7ad5('0x12'),auth[_0x7ad5('0xd')](),controller[_0x7ad5('0x1b')]);module[_0x7ad5('0x1c')]=router; \ No newline at end of file +var _0x3077=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','exports','util','path','connect-timeout','express','Router'];(function(_0x22c250,_0x4fbc3c){var _0x249589=function(_0x4ec136){while(--_0x4ec136){_0x22c250['push'](_0x22c250['shift']());}};_0x249589(++_0x4fbc3c);}(_0x3077,0xeb));var _0x7307=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x3077[_0x3054be];return _0x3df150;};'use strict';var multer=require('multer');var util=require(_0x7307('0x0'));var path=require(_0x7307('0x1'));var timeout=require(_0x7307('0x2'));var express=require(_0x7307('0x3'));var router=express[_0x7307('0x4')]();var fs_extra=require(_0x7307('0x5'));var auth=require(_0x7307('0x6'));var interaction=require(_0x7307('0x7'));var config=require(_0x7307('0x8'));var controller=require('./userProfile.controller');router['get']('/',auth[_0x7307('0x9')](),controller[_0x7307('0xa')]);router[_0x7307('0xb')](_0x7307('0xc'),auth[_0x7307('0x9')](),controller['describe']);router[_0x7307('0xb')](_0x7307('0xd'),auth[_0x7307('0x9')](),controller[_0x7307('0xe')]);router[_0x7307('0xb')](_0x7307('0xf'),auth['isAuthenticated'](),controller[_0x7307('0x10')]);router[_0x7307('0xb')](_0x7307('0x11'),auth[_0x7307('0x9')](),controller[_0x7307('0x12')]);router['post']('/',auth[_0x7307('0x9')](),controller[_0x7307('0x13')]);router['post'](_0x7307('0x14'),auth[_0x7307('0x9')](),controller[_0x7307('0x15')]);router['post'](_0x7307('0xf'),auth[_0x7307('0x9')](),controller[_0x7307('0x16')]);router['post'](_0x7307('0x11'),auth[_0x7307('0x9')](),controller[_0x7307('0x17')]);router[_0x7307('0x18')](_0x7307('0xd'),auth['isAuthenticated'](),controller[_0x7307('0x19')]);router[_0x7307('0x1a')](_0x7307('0xd'),auth[_0x7307('0x9')](),controller[_0x7307('0x1b')]);router[_0x7307('0x1a')](_0x7307('0xf'),auth[_0x7307('0x9')](),controller[_0x7307('0x1c')]);router[_0x7307('0x1a')]('/:id/resources',auth[_0x7307('0x9')](),controller['removeResources']);module[_0x7307('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 7d7ccf0..55e649e 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 _0xbe0b=['sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0xd9d6aa,_0x92fe5e){var _0x4ca74d=function(_0x19a8e2){while(--_0x19a8e2){_0xd9d6aa['push'](_0xd9d6aa['shift']());}};_0x4ca74d(++_0x92fe5e);}(_0xbe0b,0x6c));var _0xbbe0=function(_0x1cf62f,_0x31c033){_0x1cf62f=_0x1cf62f-0x0;var _0x2d593e=_0xbe0b[_0x1cf62f];return _0x2d593e;};'use strict';var Sequelize=require(_0xbbe0('0x0'));module[_0xbbe0('0x1')]={'name':{'type':Sequelize[_0xbbe0('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5b32b6){this[_0xbbe0('0x3')](_0xbbe0('0x4'),_0x5b32b6?_0x5b32b6[_0xbbe0('0x5')](''):[]);},'get':function(){return this[_0xbbe0('0x6')](_0xbbe0('0x4'))?this[_0xbbe0('0x6')](_0xbbe0('0x4'))[_0xbbe0('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xbbe0('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xbbe0('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xbbe0('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbbe0('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xbbe0('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xbbe0('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3fef=['getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports','STRING','setDataValue','join'];(function(_0x264f25,_0x13641f){var _0x6e977b=function(_0x5dc8c2){while(--_0x5dc8c2){_0x264f25['push'](_0x264f25['shift']());}};_0x6e977b(++_0x13641f);}(_0x3fef,0xf7));var _0xf3fe=function(_0x4f37a9,_0x5ab8a2){_0x4f37a9=_0x4f37a9-0x0;var _0x5ae200=_0x3fef[_0x4f37a9];return _0x5ae200;};'use strict';var Sequelize=require(_0xf3fe('0x0'));module[_0xf3fe('0x1')]={'name':{'type':Sequelize[_0xf3fe('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5de108){this[_0xf3fe('0x3')]('crudPermissions',_0x5de108?_0x5de108[_0xf3fe('0x4')](''):[]);},'get':function(){return this[_0xf3fe('0x5')](_0xf3fe('0x6'))?this[_0xf3fe('0x5')](_0xf3fe('0x6'))[_0xf3fe('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf3fe('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf3fe('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 1cf7a74..723180a 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 _0xc7da=['enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','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/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','stack','UserProfile','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','push','removeSections','ids','getSections'];(function(_0x465158,_0x43dff2){var _0x43eeb3=function(_0x52f6b7){while(--_0x52f6b7){_0x465158['push'](_0x465158['shift']());}};_0x43eeb3(++_0x43dff2);}(_0xc7da,0xf2));var _0xac7d=function(_0x33932c,_0x271465){_0x33932c=_0x33932c-0x0;var _0xf063b=_0xc7da[_0x33932c];return _0xf063b;};'use strict';var emlformat=require(_0xac7d('0x0'));var rimraf=require(_0xac7d('0x1'));var zipdir=require(_0xac7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac7d('0x3'));var moment=require(_0xac7d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac7d('0x5'));var util=require(_0xac7d('0x6'));var path=require('path');var sox=require(_0xac7d('0x7'));var csv=require(_0xac7d('0x8'));var ejs=require(_0xac7d('0x9'));var fs=require('fs');var fs_extra=require(_0xac7d('0xa'));var _=require(_0xac7d('0xb'));var squel=require(_0xac7d('0xc'));var crypto=require('crypto');var jsforce=require(_0xac7d('0xd'));var deskjs=require(_0xac7d('0xe'));var toCsv=require(_0xac7d('0x8'));var querystring=require(_0xac7d('0xf'));var Papa=require(_0xac7d('0x10'));var Redis=require(_0xac7d('0x11'));var authService=require(_0xac7d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xac7d('0x13'));var hardwareService=require(_0xac7d('0x14'));var logger=require(_0xac7d('0x15'))('api');var utils=require(_0xac7d('0x16'));var config=require(_0xac7d('0x17'));var licenseUtil=require(_0xac7d('0x18'));var db=require(_0xac7d('0x19'))['db'];config['redis']=_[_0xac7d('0x1a')](config[_0xac7d('0x1b')],{'host':_0xac7d('0x1c'),'port':0x18eb});var socket=require(_0xac7d('0x1d'))(new Redis(config[_0xac7d('0x1b')]));require('./userProfile.socket')[_0xac7d('0x1e')](socket);function respondWithStatusCode(_0x5b94e9,_0x3e580d){_0x3e580d=_0x3e580d||0xcc;return function(_0x425235){if(_0x425235){return _0x5b94e9[_0xac7d('0x1f')](_0x3e580d);}return _0x5b94e9[_0xac7d('0x20')](_0x3e580d)['end']();};}function respondWithResult(_0x19e7ba,_0x4283dd){_0x4283dd=_0x4283dd||0xc8;return function(_0x27ed38){if(_0x27ed38){return _0x19e7ba[_0xac7d('0x20')](_0x4283dd)[_0xac7d('0x21')](_0x27ed38);}};}function respondWithFilteredResult(_0x48ac86,_0x7df8e0){return function(_0x3cb12d){if(_0x3cb12d){var _0x563634=typeof _0x7df8e0[_0xac7d('0x22')]===_0xac7d('0x23')&&typeof _0x7df8e0[_0xac7d('0x24')]===_0xac7d('0x23');var _0x4a5325=_0x3cb12d[_0xac7d('0x25')];var _0x3c6090=_0x563634?0x0:_0x7df8e0[_0xac7d('0x22')];var _0x518e77=_0x563634?_0x3cb12d[_0xac7d('0x25')]:_0x7df8e0['offset']+_0x7df8e0[_0xac7d('0x24')];var _0x3eedf8;if(_0x518e77>=_0x4a5325){_0x518e77=_0x4a5325;_0x3eedf8=0xc8;}else{_0x3eedf8=0xce;}_0x48ac86[_0xac7d('0x20')](_0x3eedf8);return _0x48ac86[_0xac7d('0x26')](_0xac7d('0x27'),_0x3c6090+'-'+_0x518e77+'/'+_0x4a5325)[_0xac7d('0x21')](_0x3cb12d);}return null;};}function patchUpdates(_0x5a006e){return function(_0x54c857){try{jsonpatch[_0xac7d('0x28')](_0x54c857,_0x5a006e,!![]);}catch(_0x6d2c50){return BPromise['reject'](_0x6d2c50);}return _0x54c857[_0xac7d('0x29')]();};}function saveUpdates(_0x3966dd,_0x2a5774){return function(_0x1c1f88){if(_0x1c1f88){return _0x1c1f88[_0xac7d('0x2a')](_0x3966dd)[_0xac7d('0x2b')](function(_0x200562){return _0x200562;});}return null;};}function removeEntity(_0x3bb7dd,_0x42e313){return function(_0x26a8c4){if(_0x26a8c4){return _0x26a8c4['destroy']()[_0xac7d('0x2b')](function(){_0x3bb7dd[_0xac7d('0x20')](0xcc)[_0xac7d('0x2c')]();});}};}function handleEntityNotFound(_0x1bcfd5,_0x4cc590){return function(_0x579b99){if(!_0x579b99){_0x1bcfd5['sendStatus'](0x194);}return _0x579b99;};}function handleError(_0xc30df3,_0x32b12c){_0x32b12c=_0x32b12c||0x1f4;return function(_0xac3f87){logger['error'](_0xac3f87[_0xac7d('0x2d')]);if(_0xac3f87['name']){delete _0xac3f87['name'];}_0xc30df3['status'](_0x32b12c)['send'](_0xac3f87);};}exports['index']=function(_0x104186,_0x1109b1){var _0x35be2f={},_0x31a082={},_0x15a950={'count':0x0,'rows':[]};var _0x5c3c15=_['map'](db[_0xac7d('0x2e')][_0xac7d('0x2f')],function(_0x20b54d){return{'name':_0x20b54d[_0xac7d('0x30')],'type':_0x20b54d[_0xac7d('0x31')][_0xac7d('0x32')]};});_0x31a082[_0xac7d('0x33')]=_[_0xac7d('0x34')](_0x5c3c15,_0xac7d('0x35'));_0x31a082[_0xac7d('0x36')]=_[_0xac7d('0x37')](_0x104186[_0xac7d('0x36')]);_0x31a082[_0xac7d('0x38')]=_[_0xac7d('0x39')](_0x31a082[_0xac7d('0x33')],_0x31a082[_0xac7d('0x36')]);_0x35be2f['attributes']=_[_0xac7d('0x39')](_0x31a082[_0xac7d('0x33')],qs[_0xac7d('0x3a')](_0x104186[_0xac7d('0x36')][_0xac7d('0x3a')]));_0x35be2f['attributes']=_0x35be2f[_0xac7d('0x3b')]['length']?_0x35be2f['attributes']:_0x31a082[_0xac7d('0x33')];if(!_0x104186[_0xac7d('0x36')][_0xac7d('0x3c')](_0xac7d('0x3d'))){_0x35be2f[_0xac7d('0x24')]=qs[_0xac7d('0x24')](_0x104186[_0xac7d('0x36')][_0xac7d('0x24')]);_0x35be2f[_0xac7d('0x22')]=qs[_0xac7d('0x22')](_0x104186[_0xac7d('0x36')]['offset']);}_0x35be2f['order']=qs[_0xac7d('0x3e')](_0x104186['query'][_0xac7d('0x3e')]);_0x35be2f[_0xac7d('0x3f')]=qs[_0xac7d('0x38')](_[_0xac7d('0x40')](_0x104186['query'],_0x31a082['filters']),_0x5c3c15);if(_0x104186[_0xac7d('0x36')][_0xac7d('0x41')]){_0x35be2f[_0xac7d('0x3f')]=_[_0xac7d('0x42')](_0x35be2f[_0xac7d('0x3f')],{'$or':_['map'](_0x5c3c15,function(_0x5415f1){if(_0x5415f1[_0xac7d('0x31')]!=='VIRTUAL'){var _0x117dc1={};_0x117dc1[_0x5415f1[_0xac7d('0x35')]]={'$like':'%'+_0x104186[_0xac7d('0x36')]['filter']+'%'};return _0x117dc1;}})});}_0x35be2f=_[_0xac7d('0x42')]({},_0x35be2f,_0x104186[_0xac7d('0x43')]);var _0x1d9bc1={'where':_0x35be2f[_0xac7d('0x3f')]};return db[_0xac7d('0x2e')][_0xac7d('0x25')](_0x1d9bc1)['then'](function(_0x4d4e6e){_0x15a950[_0xac7d('0x25')]=_0x4d4e6e;if(_0x104186[_0xac7d('0x36')]['includeAll']){_0x35be2f[_0xac7d('0x44')]=[{'all':!![]}];}return db[_0xac7d('0x2e')][_0xac7d('0x45')](_0x35be2f);})['then'](function(_0x5f3b48){_0x15a950[_0xac7d('0x46')]=_0x5f3b48;return _0x15a950;})['then'](respondWithFilteredResult(_0x1109b1,_0x35be2f))[_0xac7d('0x47')](handleError(_0x1109b1,null));};exports[_0xac7d('0x48')]=function(_0x411a44,_0x18717f){var _0x3ab9c7={'raw':![],'where':{'id':_0x411a44[_0xac7d('0x49')]['id']}},_0xbe836={};_0xbe836[_0xac7d('0x33')]=_[_0xac7d('0x37')](db[_0xac7d('0x2e')]['rawAttributes']);_0xbe836[_0xac7d('0x36')]=_[_0xac7d('0x37')](_0x411a44[_0xac7d('0x36')]);_0xbe836[_0xac7d('0x38')]=_[_0xac7d('0x39')](_0xbe836[_0xac7d('0x33')],_0xbe836[_0xac7d('0x36')]);_0x3ab9c7['attributes']=_[_0xac7d('0x39')](_0xbe836[_0xac7d('0x33')],qs['fields'](_0x411a44[_0xac7d('0x36')][_0xac7d('0x3a')]));_0x3ab9c7[_0xac7d('0x3b')]=_0x3ab9c7[_0xac7d('0x3b')][_0xac7d('0x4a')]?_0x3ab9c7[_0xac7d('0x3b')]:_0xbe836[_0xac7d('0x33')];if(_0x411a44['query'][_0xac7d('0x4b')]){_0x3ab9c7[_0xac7d('0x44')]=[{'all':!![]}];}_0x3ab9c7=_['merge']({},_0x3ab9c7,_0x411a44[_0xac7d('0x43')]);return db[_0xac7d('0x2e')][_0xac7d('0x4c')](_0x3ab9c7)['then'](handleEntityNotFound(_0x18717f,null))[_0xac7d('0x2b')](respondWithResult(_0x18717f,null))[_0xac7d('0x47')](handleError(_0x18717f,null));};exports[_0xac7d('0x4d')]=function(_0x302794,_0x57e0c2){return db[_0xac7d('0x2e')][_0xac7d('0x4d')](_0x302794[_0xac7d('0x4e')],{})[_0xac7d('0x2b')](respondWithResult(_0x57e0c2,0xc9))[_0xac7d('0x47')](handleError(_0x57e0c2,null));};exports['clone']=function(_0x4d5ebc,_0x100e6b){var _0x1ecf4b={'where':{'id':_0x4d5ebc['params']['id']}},_0x38f71e={};_0x38f71e[_0xac7d('0x33')]=_['keys'](db[_0xac7d('0x2e')][_0xac7d('0x2f')]);_0x1ecf4b[_0xac7d('0x3b')]=_[_0xac7d('0x39')](_0x38f71e[_0xac7d('0x33')],qs[_0xac7d('0x3a')](_0x4d5ebc['query'][_0xac7d('0x3a')]));_0x1ecf4b[_0xac7d('0x3b')]=_0x1ecf4b[_0xac7d('0x3b')][_0xac7d('0x4a')]?_0x1ecf4b[_0xac7d('0x3b')]:_0x38f71e[_0xac7d('0x33')];if(_0x4d5ebc[_0xac7d('0x36')][_0xac7d('0x4b')]){_0x1ecf4b[_0xac7d('0x44')]=[{'all':!![]}];}_0x1ecf4b=_[_0xac7d('0x42')]({},_0x1ecf4b,_0x4d5ebc[_0xac7d('0x43')]);return db[_0xac7d('0x2e')][_0xac7d('0x4c')](_0x1ecf4b)[_0xac7d('0x2b')](handleEntityNotFound(_0x100e6b,null))[_0xac7d('0x2b')](function(_0x3a7347){if(_0x3a7347){var _0xda0b68=_0x3a7347[_0xac7d('0x4f')]({'plain':!![]});_0xda0b68=qs[_0xac7d('0x50')](_0xda0b68,['id',_0xac7d('0x51'),_0xac7d('0x52'),_0xac7d('0x53')]);_0x4d5ebc[_0xac7d('0x4e')]=_[_0xac7d('0x50')](_0x4d5ebc['body'],['id','createdAt',_0xac7d('0x52')]);return db[_0xac7d('0x54')][_0xac7d('0x55')](function(_0x2c1c8a){return db['UserProfile'][_0xac7d('0x4d')](_[_0xac7d('0x42')](_0xda0b68,_0x4d5ebc[_0xac7d('0x4e')]),{'include':_0x4d5ebc[_0xac7d('0x36')][_0xac7d('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0x2c1c8a})['then'](function(_0x28329b){var _0x36d8bd=_0x28329b[_0xac7d('0x4f')]({'plain':!![]});return db[_0xac7d('0x56')]['findAll']({'where':{'userProfileId':_0x4d5ebc['params']['id']},'raw':!![]})[_0xac7d('0x2b')](function(_0x456b84){if(_0x456b84){return BPromise[_0xac7d('0x57')](_0x456b84,function(_0x29fc2c){return new BPromise(function(_0x430260,_0x294a7c){if(_0x29fc2c[_0xac7d('0x58')]===null||_0x29fc2c[_0xac7d('0x58')]===0x1)_0x430260(null);return db[_0xac7d('0x59')]['findAll']({'where':{'sectionId':_0x29fc2c['id']},'raw':!![]})[_0xac7d('0x2b')](function(_0x26617a){var _0x7a9823=_[_0xac7d('0x34')](_0x26617a,function(_0x50a948){return qs[_0xac7d('0x50')](_0x50a948,['id',_0xac7d('0x51'),_0xac7d('0x52'),_0xac7d('0x5a')]);});_0x430260(_0x7a9823);})[_0xac7d('0x47')](function(_0x577bd8){_0x294a7c(_0x577bd8);});})[_0xac7d('0x2b')](function(_0x1d2347){var _0x912ceb=qs[_0xac7d('0x50')](_0x29fc2c,['id',_0xac7d('0x51'),_0xac7d('0x52')]);_0x912ceb[_0xac7d('0x5b')]=_0x36d8bd['id'];if(_0x1d2347)_0x912ceb['Resources']=_0x1d2347;return _0x912ceb;})[_0xac7d('0x2b')](function(_0x459d84){return db[_0xac7d('0x56')][_0xac7d('0x4d')](_0x459d84,{'include':[{'model':db[_0xac7d('0x59')],'as':_0xac7d('0x5c')}],'raw':!![],'transaction':_0x2c1c8a});});})[_0xac7d('0x2b')](function(){return _0x36d8bd;});}});});});}})[_0xac7d('0x2b')](respondWithResult(_0x100e6b,0xc9))[_0xac7d('0x47')](handleError(_0x100e6b,null));};exports[_0xac7d('0x2a')]=function(_0x22d7cd,_0x221b93){if(_0x22d7cd[_0xac7d('0x4e')]['id']){delete _0x22d7cd['body']['id'];}return db[_0xac7d('0x2e')][_0xac7d('0x4c')]({'where':{'id':_0x22d7cd[_0xac7d('0x49')]['id']}})['then'](handleEntityNotFound(_0x221b93,null))[_0xac7d('0x2b')](saveUpdates(_0x22d7cd['body'],null))['then'](respondWithResult(_0x221b93,null))[_0xac7d('0x47')](handleError(_0x221b93,null));};exports[_0xac7d('0x5d')]=function(_0x888d5f,_0x2ed3ab){return db[_0xac7d('0x2e')]['find']({'where':{'id':_0x888d5f[_0xac7d('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ed3ab,null))[_0xac7d('0x2b')](removeEntity(_0x2ed3ab,null))['catch'](handleError(_0x2ed3ab,null));};exports[_0xac7d('0x5e')]=function(_0x46b202,_0x33be18){return db['UserProfile'][_0xac7d('0x5e')]()[_0xac7d('0x2b')](respondWithResult(_0x33be18,null))[_0xac7d('0x47')](handleError(_0x33be18,null));};exports[_0xac7d('0x5f')]=function(_0x5c9038,_0x298e2b){var _0x2779a4=_0x5c9038[_0xac7d('0x4e')];return db['UserProfile']['find']({'where':{'id':_0x5c9038[_0xac7d('0x49')]['id']}})[_0xac7d('0x2b')](handleEntityNotFound(_0x298e2b,null))['then'](function(_0x4b429a){if(_0x4b429a){return db[_0xac7d('0x54')]['transaction'](function(_0x36ff2d){return db[_0xac7d('0x56')][_0xac7d('0x5d')]({'where':{'userProfileId':_0x5c9038[_0xac7d('0x49')]['id'],'sectionId':_[_0xac7d('0x34')](_0x2779a4,function(_0x5bd9e0){return _0x5bd9e0[_0xac7d('0x5a')];})},'transaction':_0x36ff2d})[_0xac7d('0x2b')](function(){var _0x58960c=_[_0xac7d('0x34')](_0x2779a4,function(_0x334bc4){_0x334bc4[_0xac7d('0x5b')]=_0x5c9038['params']['id'];return _0x334bc4;});var _0x28e419=[];return BPromise[_0xac7d('0x57')](_0x58960c,function(_0x30d673){return db[_0xac7d('0x56')][_0xac7d('0x4d')](_0x30d673,{'include':[{'model':db[_0xac7d('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0x36ff2d})['then'](function(_0x45d0fd){_0x28e419[_0xac7d('0x60')](_0x45d0fd[_0xac7d('0x4f')]({'plain':!![]}));});})['then'](function(){return _0x28e419;});});});}})[_0xac7d('0x2b')](function(_0x1f7f37){return _0x1f7f37;})[_0xac7d('0x2b')](respondWithResult(_0x298e2b,null))[_0xac7d('0x47')](handleError(_0x298e2b,null));};exports[_0xac7d('0x61')]=function(_0x1cf36a,_0x3c370d){var _0x1b6f79;return db[_0xac7d('0x2e')]['find']({'where':{'id':_0x1cf36a['params']['id']},'attributes':['id','name']})[_0xac7d('0x2b')](handleEntityNotFound(_0x3c370d,null))['then'](function(_0x1acf1b){if(_0x1acf1b){_0x1b6f79=_0x1acf1b;return db[_0xac7d('0x56')][_0xac7d('0x5d')]({'where':{'userProfileId':_0x1cf36a[_0xac7d('0x49')]['id'],'sectionId':_0x1cf36a[_0xac7d('0x36')][_0xac7d('0x62')]}});}})[_0xac7d('0x2b')](function(){return _0x1b6f79;})[_0xac7d('0x2b')](respondWithStatusCode(_0x3c370d,null))['catch'](handleError(_0x3c370d,null));};exports[_0xac7d('0x63')]=function(_0x43d26c,_0x49453e){var _0x29298b=[];var _0x50625f=[];return db[_0xac7d('0x56')][_0xac7d('0x45')]({'where':{'userProfileId':_0x43d26c[_0xac7d('0x49')]['id']},'raw':!![]})[_0xac7d('0x2b')](function(_0x2d766d){_0x29298b=_[_0xac7d('0x41')](_0x2d766d,function(_0x5085d2){return _0x5085d2[_0xac7d('0x64')]===0x1||_[_0xac7d('0x65')]([0x3eb,0x709],_0x5085d2[_0xac7d('0x5a')]);});if(!_[_0xac7d('0x66')](_0x29298b)){return _['map'](_0x29298b,function(_0x54fa30){return _0x54fa30['sectionId'];});}else{return;}})[_0xac7d('0x2b')](function(_0x59998b){if(_0x59998b)_0x50625f=_0x59998b;if(_[_0xac7d('0x65')](_0x50625f,0x64)){var _0x8cf7f6=_['find'](_0x29298b,{'sectionId':0x64});return hasDefaultDashboard(_0x8cf7f6)[_0xac7d('0x2b')](function(_0xf703a1){return _[_0xac7d('0x34')](_0x29298b,function(_0x22a3ab){if(_0x22a3ab[_0xac7d('0x5a')]===0x64){_0x22a3ab[_0xac7d('0x67')]=_0xf703a1;}return _0x22a3ab;});});}else{return;}})[_0xac7d('0x2b')](function(_0x17dbc1){if(_0x17dbc1)_0x29298b=_0x17dbc1;if(_[_0xac7d('0x65')](_0x50625f,0x3eb)){var _0x260281=_[_0xac7d('0x4c')](_0x29298b,{'sectionId':0x3eb});return getCustomDashboards(_0x260281)[_0xac7d('0x2b')](function(_0x38ee53){return _[_0xac7d('0x34')](_0x29298b,function(_0x2cde10){if(_0x260281[_0xac7d('0x64')]){if(_0x2cde10[_0xac7d('0x5a')]===0x3eb){_0x2cde10[_0xac7d('0x67')]=_0x38ee53;}}else{if(_0x2cde10[_0xac7d('0x5a')]===0x64){_0x2cde10['subsections']=_0x38ee53;}}return _0x2cde10;});});}else{return;}})['then'](function(_0x32e499){if(_0x32e499)_0x29298b=_0x32e499;if(_[_0xac7d('0x65')](_0x50625f,0x709)){var _0x428f20=_[_0xac7d('0x4c')](_0x29298b,{'sectionId':0x709});return getPlugins(_0x428f20)['then'](function(_0x7d535a){if(_0x428f20[_0xac7d('0x64')]){return _[_0xac7d('0x34')](_0x29298b,function(_0x4db037){if(_0x4db037[_0xac7d('0x5a')]===0x709){_0x4db037[_0xac7d('0x67')]=_0x7d535a;}return _0x4db037;});}else{var _0x1eabeb={'sectionId':0x76c,'enabled':0x1,'subsections':_0x7d535a};var _0x2ab84b=_['map'](_0x29298b);_0x2ab84b[_0xac7d('0x60')](_0x1eabeb);return _0x2ab84b;}});}else{return;}})[_0xac7d('0x2b')](function(_0x417415){if(_0x417415)_0x29298b=_0x417415;return _['filter'](_0x29298b,[_0xac7d('0x64'),0x1]);})['then'](respondWithResult(_0x49453e,null))[_0xac7d('0x47')](handleError(_0x49453e,null));};function hasDefaultDashboard(_0x3ec0a9){var _0x3de893=[0x65];return new BPromise(function(_0x574bb6,_0x5345a9){try{if(_0x3ec0a9[_0xac7d('0x58')]){_0x574bb6(_0x3de893);}else{return db[_0xac7d('0x59')]['findOne']({'where':{'sectionId':_0x3ec0a9['id']},'raw':!![]})[_0xac7d('0x2b')](function(_0x7e84a5){_0x7e84a5?_0x574bb6(_0x3de893):_0x574bb6();});}}catch(_0x59b59e){_0x5345a9(_0x59b59e);}});}function getCustomDashboards(_0x20b0d0){var _0x2be9ff=[];return new BPromise(function(_0x4efd06,_0x559643){try{if(_0x20b0d0[_0xac7d('0x58')]){return db[_0xac7d('0x68')]['findAll']({'raw':!![]})[_0xac7d('0x2b')](function(_0x21308c){_0x21308c[_0xac7d('0x69')](function(_0x472f55){_0x2be9ff['push'](_0x472f55['id']+0x1869f);});_0x4efd06(_0x2be9ff);});}else{return db[_0xac7d('0x59')]['findAll']({'where':{'sectionId':_0x20b0d0['id']},'raw':!![]})['then'](function(_0x53e402){_0x53e402[_0xac7d('0x69')](function(_0x5edac0){_0x2be9ff[_0xac7d('0x60')](_0x5edac0[_0xac7d('0x6a')]+0x1869f);});_0x4efd06(_0x2be9ff);});}}catch(_0x64cfbc){_0x559643(_0x64cfbc);}});}function getPlugins(_0x441022){var _0x3424db=[];return new BPromise(function(_0x130b71,_0x1a7341){try{if(_0x441022[_0xac7d('0x58')]){return db[_0xac7d('0x6b')][_0xac7d('0x45')]({'raw':!![]})[_0xac7d('0x2b')](function(_0x457034){_0x457034[_0xac7d('0x69')](function(_0x4420ea){_0x3424db[_0xac7d('0x60')](_0x4420ea['id']+0x15b38);});_0x130b71(_0x3424db);});}else{return db[_0xac7d('0x59')][_0xac7d('0x45')]({'where':{'sectionId':_0x441022['id']},'raw':!![]})[_0xac7d('0x2b')](function(_0x39b19d){_0x39b19d['forEach'](function(_0x44f443){_0x3424db[_0xac7d('0x60')](_0x44f443[_0xac7d('0x6a')]+0x15b38);});_0x130b71(_0x3424db);});}}catch(_0x42711e){_0x1a7341(_0x42711e);}});}exports['addResources']=function(_0x79c9f7,_0x3a548f){return db[_0xac7d('0x2e')][_0xac7d('0x4c')]({'where':{'id':_0x79c9f7[_0xac7d('0x49')]['id']}})[_0xac7d('0x2b')](handleEntityNotFound(_0x3a548f,null))[_0xac7d('0x2b')](function(_0x3aaf35){if(_0x3aaf35){return db[_0xac7d('0x54')][_0xac7d('0x55')](function(_0x34e30b){return db['UserProfileSection'][_0xac7d('0x45')]({'where':{'userProfileId':_0x79c9f7['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x2e5c1d){if(_0x2e5c1d){return db[_0xac7d('0x56')][_0xac7d('0x5d')]({'where':{'userProfileId':_0x79c9f7[_0xac7d('0x49')]['id'],'id':_[_0xac7d('0x34')](_0x2e5c1d,function(_0xbc6455){return _0xbc6455['id'];})},'transaction':_0x34e30b});}})[_0xac7d('0x2b')](function(_0x2e78eb){var _0x29456f=_['map'](_0x79c9f7[_0xac7d('0x4e')],function(_0x2b0df2){_0x2b0df2[_0xac7d('0x5b')]=_0x79c9f7[_0xac7d('0x49')]['id'];return _0x2b0df2;});return db[_0xac7d('0x56')][_0xac7d('0x6c')](_0x29456f,{'raw':!![],'transaction':_0x34e30b});})[_0xac7d('0x2b')](function(_0x27eeae){var _0x28fef1=_['filter'](_['map'](_0x27eeae,function(_0x221a5d){return _0x221a5d[_0xac7d('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x28fef1){return db[_0xac7d('0x56')][_0xac7d('0x45')]({'where':{'userProfileId':_0x79c9f7[_0xac7d('0x49')]['id'],'sectionId':_[_0xac7d('0x34')](_0x28fef1,function(_0x2eff7e){return _0x2eff7e['sectionId'];})},'attributes':['id',_0xac7d('0x5a')],'raw':!![]})[_0xac7d('0x2b')](function(_0x2891e9){var _0x18704b=_[_0xac7d('0x34')](_0x79c9f7['body'],function(_0x25aba1){_0x25aba1[_0xac7d('0x5b')]=_0x79c9f7[_0xac7d('0x49')]['id'];return _0x25aba1;});return db['UserProfileResource'][_0xac7d('0x6c')](_0x18704b,{'raw':!![],'transaction':_0x34e30b});});}})[_0xac7d('0x47')](handleError(_0x3a548f,null));});}})[_0xac7d('0x2b')](function(_0x4cd453){var _0x323e5d=_[_0xac7d('0x34')](_0x4cd453,function(_0x558fcc){return _0x558fcc['get']({'plain':!![]});});})[_0xac7d('0x2b')](respondWithResult(_0x3a548f,null))[_0xac7d('0x47')](handleError(_0x3a548f,null));};exports[_0xac7d('0x6d')]=function(_0x36a271,_0x29102e,_0x570393){return db[_0xac7d('0x2e')]['find']({'where':{'id':_0x36a271['params']['id']}})[_0xac7d('0x2b')](handleEntityNotFound(_0x29102e,null))[_0xac7d('0x2b')](function(_0x982281){if(_0x982281){return _0x982281[_0xac7d('0x6d')](_0x36a271['query'][_0xac7d('0x62')]);}})['then'](respondWithStatusCode(_0x29102e,null))['catch'](handleError(_0x29102e,null));};exports[_0xac7d('0x6e')]=function(_0x2f84c0,_0x44aec1){var _0x480620={};if(!_0x2f84c0['query'][_0xac7d('0x6f')])throw new Error(_0xac7d('0x70'));if(!_0x2f84c0['query']['hasOwnProperty'](_0xac7d('0x3d'))){_0x480620[_0xac7d('0x24')]=qs['limit'](_0x2f84c0[_0xac7d('0x36')]['limit']);_0x480620['offset']=qs[_0xac7d('0x22')](_0x2f84c0[_0xac7d('0x36')][_0xac7d('0x22')]);}return db[_0xac7d('0x2e')][_0xac7d('0x4c')]({'where':{'id':_0x2f84c0[_0xac7d('0x49')]['id']}})[_0xac7d('0x2b')](function(_0x32dac2){if(!_0x32dac2)throw new Error(_0xac7d('0x71')+_0x2f84c0[_0xac7d('0x49')]['id']);return db['UserProfile'][_0xac7d('0x6e')](_0x2f84c0);})[_0xac7d('0x2b')](respondWithFilteredResult(_0x44aec1,_0x480620))[_0xac7d('0x47')](handleError(_0x44aec1,null));}; \ No newline at end of file +var _0xe98f=['eml-format','zip-dir','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','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','register','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','catch','create','clone','options','get','createdAt','body','omit','updatedAt','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','find','describe','addSections','transaction','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20'];(function(_0x3b9ec3,_0x618415){var _0x19a554=function(_0x20bdc4){while(--_0x20bdc4){_0x3b9ec3['push'](_0x3b9ec3['shift']());}};_0x19a554(++_0x618415);}(_0xe98f,0xde));var _0xfe98=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe98f[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xfe98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe98('0x2'));var moment=require(_0xfe98('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe98('0x4'));var path=require('path');var sox=require(_0xfe98('0x5'));var csv=require(_0xfe98('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe98('0x7'));var _=require('lodash');var squel=require(_0xfe98('0x8'));var crypto=require(_0xfe98('0x9'));var jsforce=require(_0xfe98('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfe98('0x6'));var querystring=require(_0xfe98('0xb'));var Papa=require('papaparse');var Redis=require(_0xfe98('0xc'));var authService=require(_0xfe98('0xd'));var qs=require(_0xfe98('0xe'));var as=require(_0xfe98('0xf'));var hardwareService=require(_0xfe98('0x10'));var logger=require(_0xfe98('0x11'))('api');var utils=require(_0xfe98('0x12'));var config=require(_0xfe98('0x13'));var licenseUtil=require(_0xfe98('0x14'));var db=require(_0xfe98('0x15'))['db'];config[_0xfe98('0x16')]=_['defaults'](config[_0xfe98('0x16')],{'host':_0xfe98('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe98('0x16')]));require('./userProfile.socket')[_0xfe98('0x18')](socket);function respondWithStatusCode(_0x3386de,_0x1b2155){_0x1b2155=_0x1b2155||0xcc;return function(_0x15e6b7){if(_0x15e6b7){return _0x3386de['sendStatus'](_0x1b2155);}return _0x3386de[_0xfe98('0x19')](_0x1b2155)['end']();};}function respondWithResult(_0x416c4c,_0x8c527c){_0x8c527c=_0x8c527c||0xc8;return function(_0x20d565){if(_0x20d565){return _0x416c4c[_0xfe98('0x19')](_0x8c527c)['json'](_0x20d565);}};}function respondWithFilteredResult(_0x56c0f4,_0x41dca9){return function(_0x26ad78){if(_0x26ad78){var _0x31bb37=typeof _0x41dca9['offset']===_0xfe98('0x1a')&&typeof _0x41dca9[_0xfe98('0x1b')]===_0xfe98('0x1a');var _0x40f0b1=_0x26ad78[_0xfe98('0x1c')];var _0x6d2220=_0x31bb37?0x0:_0x41dca9[_0xfe98('0x1d')];var _0x5cbdb0=_0x31bb37?_0x26ad78[_0xfe98('0x1c')]:_0x41dca9['offset']+_0x41dca9[_0xfe98('0x1b')];var _0x51d257;if(_0x5cbdb0>=_0x40f0b1){_0x5cbdb0=_0x40f0b1;_0x51d257=0xc8;}else{_0x51d257=0xce;}_0x56c0f4['status'](_0x51d257);return _0x56c0f4[_0xfe98('0x1e')](_0xfe98('0x1f'),_0x6d2220+'-'+_0x5cbdb0+'/'+_0x40f0b1)[_0xfe98('0x20')](_0x26ad78);}return null;};}function patchUpdates(_0xc3c06a){return function(_0x59e3ff){try{jsonpatch[_0xfe98('0x21')](_0x59e3ff,_0xc3c06a,!![]);}catch(_0x4b808c){return BPromise[_0xfe98('0x22')](_0x4b808c);}return _0x59e3ff[_0xfe98('0x23')]();};}function saveUpdates(_0xb628ed,_0x59fbde){return function(_0x52a381){if(_0x52a381){return _0x52a381[_0xfe98('0x24')](_0xb628ed)['then'](function(_0x7b629e){return _0x7b629e;});}return null;};}function removeEntity(_0x2c9323,_0x4d17b7){return function(_0x3dc31d){if(_0x3dc31d){return _0x3dc31d[_0xfe98('0x25')]()[_0xfe98('0x26')](function(){_0x2c9323[_0xfe98('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e40f0,_0x5921f0){return function(_0x51da63){if(!_0x51da63){_0x4e40f0[_0xfe98('0x27')](0x194);}return _0x51da63;};}function handleError(_0x221d7c,_0x3e8723){_0x3e8723=_0x3e8723||0x1f4;return function(_0x21c730){logger[_0xfe98('0x28')](_0x21c730[_0xfe98('0x29')]);if(_0x21c730[_0xfe98('0x2a')]){delete _0x21c730[_0xfe98('0x2a')];}_0x221d7c[_0xfe98('0x19')](_0x3e8723)[_0xfe98('0x2b')](_0x21c730);};}exports['index']=function(_0x1bed97,_0x1c56e5){var _0x9eb9c9={},_0x4507be={},_0x3094df={'count':0x0,'rows':[]};var _0x20ae5d=_[_0xfe98('0x2c')](db[_0xfe98('0x2d')][_0xfe98('0x2e')],function(_0xaf782){return{'name':_0xaf782[_0xfe98('0x2f')],'type':_0xaf782[_0xfe98('0x30')][_0xfe98('0x31')]};});_0x4507be[_0xfe98('0x32')]=_[_0xfe98('0x2c')](_0x20ae5d,'name');_0x4507be['query']=_[_0xfe98('0x33')](_0x1bed97[_0xfe98('0x34')]);_0x4507be['filters']=_[_0xfe98('0x35')](_0x4507be[_0xfe98('0x32')],_0x4507be[_0xfe98('0x34')]);_0x9eb9c9[_0xfe98('0x36')]=_[_0xfe98('0x35')](_0x4507be['model'],qs[_0xfe98('0x37')](_0x1bed97[_0xfe98('0x34')][_0xfe98('0x37')]));_0x9eb9c9[_0xfe98('0x36')]=_0x9eb9c9[_0xfe98('0x36')]['length']?_0x9eb9c9[_0xfe98('0x36')]:_0x4507be['model'];if(!_0x1bed97[_0xfe98('0x34')][_0xfe98('0x38')](_0xfe98('0x39'))){_0x9eb9c9[_0xfe98('0x1b')]=qs[_0xfe98('0x1b')](_0x1bed97[_0xfe98('0x34')][_0xfe98('0x1b')]);_0x9eb9c9[_0xfe98('0x1d')]=qs['offset'](_0x1bed97['query'][_0xfe98('0x1d')]);}_0x9eb9c9[_0xfe98('0x3a')]=qs[_0xfe98('0x3b')](_0x1bed97[_0xfe98('0x34')][_0xfe98('0x3b')]);_0x9eb9c9['where']=qs[_0xfe98('0x3c')](_[_0xfe98('0x3d')](_0x1bed97[_0xfe98('0x34')],_0x4507be['filters']),_0x20ae5d);if(_0x1bed97[_0xfe98('0x34')][_0xfe98('0x3e')]){_0x9eb9c9[_0xfe98('0x3f')]=_[_0xfe98('0x40')](_0x9eb9c9['where'],{'$or':_[_0xfe98('0x2c')](_0x20ae5d,function(_0x3abd5d){if(_0x3abd5d['type']!==_0xfe98('0x41')){var _0x14afbc={};_0x14afbc[_0x3abd5d[_0xfe98('0x2a')]]={'$like':'%'+_0x1bed97['query']['filter']+'%'};return _0x14afbc;}})});}_0x9eb9c9=_['merge']({},_0x9eb9c9,_0x1bed97['options']);var _0x2b796a={'where':_0x9eb9c9['where']};return db[_0xfe98('0x2d')][_0xfe98('0x1c')](_0x2b796a)['then'](function(_0x43b085){_0x3094df[_0xfe98('0x1c')]=_0x43b085;if(_0x1bed97[_0xfe98('0x34')][_0xfe98('0x42')]){_0x9eb9c9[_0xfe98('0x43')]=[{'all':!![]}];}return db[_0xfe98('0x2d')][_0xfe98('0x44')](_0x9eb9c9);})[_0xfe98('0x26')](function(_0x5dae05){_0x3094df[_0xfe98('0x45')]=_0x5dae05;return _0x3094df;})[_0xfe98('0x26')](respondWithFilteredResult(_0x1c56e5,_0x9eb9c9))['catch'](handleError(_0x1c56e5,null));};exports[_0xfe98('0x46')]=function(_0xd2cc2e,_0x575ff3){var _0x36643c={'raw':![],'where':{'id':_0xd2cc2e[_0xfe98('0x47')]['id']}},_0x50ccd7={};_0x50ccd7['model']=_[_0xfe98('0x33')](db[_0xfe98('0x2d')][_0xfe98('0x2e')]);_0x50ccd7[_0xfe98('0x34')]=_['keys'](_0xd2cc2e[_0xfe98('0x34')]);_0x50ccd7[_0xfe98('0x3c')]=_[_0xfe98('0x35')](_0x50ccd7[_0xfe98('0x32')],_0x50ccd7[_0xfe98('0x34')]);_0x36643c[_0xfe98('0x36')]=_['intersection'](_0x50ccd7[_0xfe98('0x32')],qs[_0xfe98('0x37')](_0xd2cc2e[_0xfe98('0x34')][_0xfe98('0x37')]));_0x36643c[_0xfe98('0x36')]=_0x36643c[_0xfe98('0x36')][_0xfe98('0x48')]?_0x36643c['attributes']:_0x50ccd7[_0xfe98('0x32')];if(_0xd2cc2e[_0xfe98('0x34')][_0xfe98('0x42')]){_0x36643c[_0xfe98('0x43')]=[{'all':!![]}];}_0x36643c=_[_0xfe98('0x40')]({},_0x36643c,_0xd2cc2e['options']);return db[_0xfe98('0x2d')]['find'](_0x36643c)[_0xfe98('0x26')](handleEntityNotFound(_0x575ff3,null))[_0xfe98('0x26')](respondWithResult(_0x575ff3,null))[_0xfe98('0x49')](handleError(_0x575ff3,null));};exports[_0xfe98('0x4a')]=function(_0x27b100,_0x475394){return db[_0xfe98('0x2d')][_0xfe98('0x4a')](_0x27b100['body'],{})[_0xfe98('0x26')](respondWithResult(_0x475394,0xc9))[_0xfe98('0x49')](handleError(_0x475394,null));};exports[_0xfe98('0x4b')]=function(_0x1720d3,_0x5ad61e){var _0x26cb3d={'where':{'id':_0x1720d3[_0xfe98('0x47')]['id']}},_0xc0573c={};_0xc0573c[_0xfe98('0x32')]=_[_0xfe98('0x33')](db[_0xfe98('0x2d')]['rawAttributes']);_0x26cb3d[_0xfe98('0x36')]=_[_0xfe98('0x35')](_0xc0573c[_0xfe98('0x32')],qs[_0xfe98('0x37')](_0x1720d3[_0xfe98('0x34')]['fields']));_0x26cb3d['attributes']=_0x26cb3d[_0xfe98('0x36')][_0xfe98('0x48')]?_0x26cb3d[_0xfe98('0x36')]:_0xc0573c[_0xfe98('0x32')];if(_0x1720d3[_0xfe98('0x34')][_0xfe98('0x42')]){_0x26cb3d[_0xfe98('0x43')]=[{'all':!![]}];}_0x26cb3d=_[_0xfe98('0x40')]({},_0x26cb3d,_0x1720d3[_0xfe98('0x4c')]);return db[_0xfe98('0x2d')]['find'](_0x26cb3d)[_0xfe98('0x26')](handleEntityNotFound(_0x5ad61e,null))['then'](function(_0x29eff4){if(_0x29eff4){var _0x278839=_0x29eff4[_0xfe98('0x4d')]({'plain':!![]});_0x278839=qs['omit'](_0x278839,['id',_0xfe98('0x4e'),'updatedAt','crudPermissions']);_0x1720d3[_0xfe98('0x4f')]=_[_0xfe98('0x50')](_0x1720d3[_0xfe98('0x4f')],['id',_0xfe98('0x4e'),_0xfe98('0x51')]);return db[_0xfe98('0x52')]['transaction'](function(_0x23e897){return db['UserProfile'][_0xfe98('0x4a')](_['merge'](_0x278839,_0x1720d3['body']),{'include':_0x1720d3['query'][_0xfe98('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x23e897})[_0xfe98('0x26')](function(_0x2b50c8){var _0x448025=_0x2b50c8['get']({'plain':!![]});return db[_0xfe98('0x53')]['findAll']({'where':{'userProfileId':_0x1720d3[_0xfe98('0x47')]['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x5b2132){if(_0x5b2132){return BPromise[_0xfe98('0x54')](_0x5b2132,function(_0x6299e9){return new BPromise(function(_0xc2cc1b,_0x4753d2){if(_0x6299e9['autoAssociation']===null||_0x6299e9[_0xfe98('0x55')]===0x1)_0xc2cc1b(null);return db[_0xfe98('0x56')][_0xfe98('0x44')]({'where':{'sectionId':_0x6299e9['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x4ab9c4){var _0x4192e0=_['map'](_0x4ab9c4,function(_0x7ca5b9){return qs[_0xfe98('0x50')](_0x7ca5b9,['id',_0xfe98('0x4e'),_0xfe98('0x51'),_0xfe98('0x57')]);});_0xc2cc1b(_0x4192e0);})[_0xfe98('0x49')](function(_0x4435d1){_0x4753d2(_0x4435d1);});})[_0xfe98('0x26')](function(_0x36a92f){var _0x3b8626=qs[_0xfe98('0x50')](_0x6299e9,['id',_0xfe98('0x4e'),_0xfe98('0x51')]);_0x3b8626['userProfileId']=_0x448025['id'];if(_0x36a92f)_0x3b8626[_0xfe98('0x58')]=_0x36a92f;return _0x3b8626;})['then'](function(_0x52befb){return db[_0xfe98('0x53')]['create'](_0x52befb,{'include':[{'model':db[_0xfe98('0x56')],'as':_0xfe98('0x58')}],'raw':!![],'transaction':_0x23e897});});})[_0xfe98('0x26')](function(){return _0x448025;});}});});});}})[_0xfe98('0x26')](respondWithResult(_0x5ad61e,0xc9))[_0xfe98('0x49')](handleError(_0x5ad61e,null));};exports[_0xfe98('0x24')]=function(_0x46a8fb,_0x1b5436){if(_0x46a8fb[_0xfe98('0x4f')]['id']){delete _0x46a8fb[_0xfe98('0x4f')]['id'];}return db[_0xfe98('0x2d')]['find']({'where':{'id':_0x46a8fb[_0xfe98('0x47')]['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x1b5436,null))[_0xfe98('0x26')](saveUpdates(_0x46a8fb[_0xfe98('0x4f')],null))[_0xfe98('0x26')](respondWithResult(_0x1b5436,null))['catch'](handleError(_0x1b5436,null));};exports[_0xfe98('0x25')]=function(_0xaa3d51,_0x2b827d){return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0xaa3d51[_0xfe98('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b827d,null))[_0xfe98('0x26')](removeEntity(_0x2b827d,null))[_0xfe98('0x49')](handleError(_0x2b827d,null));};exports[_0xfe98('0x5a')]=function(_0x363584,_0x2d195e){return db[_0xfe98('0x2d')][_0xfe98('0x5a')]()['then'](respondWithResult(_0x2d195e,null))[_0xfe98('0x49')](handleError(_0x2d195e,null));};exports[_0xfe98('0x5b')]=function(_0x1ecaeb,_0x351129){var _0x3d9113=_0x1ecaeb[_0xfe98('0x4f')];return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x1ecaeb[_0xfe98('0x47')]['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x351129,null))[_0xfe98('0x26')](function(_0x2516e5){if(_0x2516e5){return db[_0xfe98('0x52')][_0xfe98('0x5c')](function(_0x1f0bc3){return db[_0xfe98('0x53')][_0xfe98('0x25')]({'where':{'userProfileId':_0x1ecaeb[_0xfe98('0x47')]['id'],'sectionId':_[_0xfe98('0x2c')](_0x3d9113,function(_0x3c14d9){return _0x3c14d9[_0xfe98('0x57')];})},'transaction':_0x1f0bc3})[_0xfe98('0x26')](function(){var _0x25c207=_[_0xfe98('0x2c')](_0x3d9113,function(_0xa5c1a7){_0xa5c1a7[_0xfe98('0x5d')]=_0x1ecaeb[_0xfe98('0x47')]['id'];return _0xa5c1a7;});var _0x59bcb0=[];return BPromise['each'](_0x25c207,function(_0x2683f2){return db[_0xfe98('0x53')][_0xfe98('0x4a')](_0x2683f2,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x1f0bc3})[_0xfe98('0x26')](function(_0x539e83){_0x59bcb0[_0xfe98('0x5e')](_0x539e83[_0xfe98('0x4d')]({'plain':!![]}));});})['then'](function(){return _0x59bcb0;});});});}})[_0xfe98('0x26')](function(_0x4418e8){return _0x4418e8;})[_0xfe98('0x26')](respondWithResult(_0x351129,null))[_0xfe98('0x49')](handleError(_0x351129,null));};exports[_0xfe98('0x5f')]=function(_0x308b99,_0x271c09){var _0xc89e3a;return db[_0xfe98('0x2d')]['find']({'where':{'id':_0x308b99[_0xfe98('0x47')]['id']},'attributes':['id','name']})[_0xfe98('0x26')](handleEntityNotFound(_0x271c09,null))[_0xfe98('0x26')](function(_0x2bd663){if(_0x2bd663){_0xc89e3a=_0x2bd663;return db[_0xfe98('0x53')][_0xfe98('0x25')]({'where':{'userProfileId':_0x308b99[_0xfe98('0x47')]['id'],'sectionId':_0x308b99[_0xfe98('0x34')][_0xfe98('0x60')]}});}})[_0xfe98('0x26')](function(){return _0xc89e3a;})[_0xfe98('0x26')](respondWithStatusCode(_0x271c09,null))[_0xfe98('0x49')](handleError(_0x271c09,null));};exports[_0xfe98('0x61')]=function(_0x471499,_0x5c8015){var _0x4b5be5=[];var _0x454a42=[];return db[_0xfe98('0x53')][_0xfe98('0x44')]({'where':{'userProfileId':_0x471499[_0xfe98('0x47')]['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x1921b4){_0x4b5be5=_[_0xfe98('0x3e')](_0x1921b4,function(_0x1b97bb){return _0x1b97bb[_0xfe98('0x62')]===0x1||_[_0xfe98('0x63')]([0x3eb,0x709],_0x1b97bb[_0xfe98('0x57')]);});if(!_[_0xfe98('0x64')](_0x4b5be5)){return _[_0xfe98('0x2c')](_0x4b5be5,function(_0x27f70e){return _0x27f70e[_0xfe98('0x57')];});}else{return;}})[_0xfe98('0x26')](function(_0x57756e){if(_0x57756e)_0x454a42=_0x57756e;if(_[_0xfe98('0x63')](_0x454a42,0x64)){var _0x9433b9=_[_0xfe98('0x59')](_0x4b5be5,{'sectionId':0x64});return hasDefaultDashboard(_0x9433b9)['then'](function(_0x180cff){return _[_0xfe98('0x2c')](_0x4b5be5,function(_0x1de511){if(_0x1de511[_0xfe98('0x57')]===0x64){_0x1de511[_0xfe98('0x65')]=_0x180cff;}return _0x1de511;});});}else{return;}})['then'](function(_0x548b82){if(_0x548b82)_0x4b5be5=_0x548b82;if(_[_0xfe98('0x63')](_0x454a42,0x3eb)){var _0x17141c=_['find'](_0x4b5be5,{'sectionId':0x3eb});return getCustomDashboards(_0x17141c)['then'](function(_0x4a686d){return _['map'](_0x4b5be5,function(_0x1382e2){if(_0x17141c[_0xfe98('0x62')]){if(_0x1382e2[_0xfe98('0x57')]===0x3eb){_0x1382e2['subsections']=_0x4a686d;}}else{if(_0x1382e2[_0xfe98('0x57')]===0x64){_0x1382e2[_0xfe98('0x65')]=_0x4a686d;}}return _0x1382e2;});});}else{return;}})[_0xfe98('0x26')](function(_0x2c039e){if(_0x2c039e)_0x4b5be5=_0x2c039e;if(_[_0xfe98('0x63')](_0x454a42,0x709)){var _0x131240=_[_0xfe98('0x59')](_0x4b5be5,{'sectionId':0x709});return getPlugins(_0x131240)['then'](function(_0x47b756){if(_0x131240['enabled']){return _[_0xfe98('0x2c')](_0x4b5be5,function(_0x35290b){if(_0x35290b[_0xfe98('0x57')]===0x709){_0x35290b[_0xfe98('0x65')]=_0x47b756;}return _0x35290b;});}else{var _0x425576={'sectionId':0x76c,'enabled':0x1,'subsections':_0x47b756};var _0xfc79a1=_[_0xfe98('0x2c')](_0x4b5be5);_0xfc79a1[_0xfe98('0x5e')](_0x425576);return _0xfc79a1;}});}else{return;}})['then'](function(_0x5df11e){if(_0x5df11e)_0x4b5be5=_0x5df11e;return _['filter'](_0x4b5be5,['enabled',0x1]);})[_0xfe98('0x26')](respondWithResult(_0x5c8015,null))[_0xfe98('0x49')](handleError(_0x5c8015,null));};function hasDefaultDashboard(_0x14e2e4){var _0x3153f0=[0x65];return new BPromise(function(_0x2de027,_0x19385b){try{if(_0x14e2e4['autoAssociation']){_0x2de027(_0x3153f0);}else{return db[_0xfe98('0x56')][_0xfe98('0x66')]({'where':{'sectionId':_0x14e2e4['id']},'raw':!![]})['then'](function(_0x4a9028){_0x4a9028?_0x2de027(_0x3153f0):_0x2de027();});}}catch(_0xd5b171){_0x19385b(_0xd5b171);}});}function getCustomDashboards(_0x11ba08){var _0x573815=[];return new BPromise(function(_0x8223f1,_0xed4caa){try{if(_0x11ba08['autoAssociation']){return db[_0xfe98('0x67')]['findAll']({'raw':!![]})[_0xfe98('0x26')](function(_0x376c8f){_0x376c8f[_0xfe98('0x68')](function(_0x234b80){_0x573815['push'](_0x234b80['id']+0x1869f);});_0x8223f1(_0x573815);});}else{return db[_0xfe98('0x56')][_0xfe98('0x44')]({'where':{'sectionId':_0x11ba08['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x5919f1){_0x5919f1[_0xfe98('0x68')](function(_0x406758){_0x573815['push'](_0x406758[_0xfe98('0x69')]+0x1869f);});_0x8223f1(_0x573815);});}}catch(_0x4733d3){_0xed4caa(_0x4733d3);}});}function getPlugins(_0x51c65b){var _0xc6421f=[];return new BPromise(function(_0x4d9e98,_0x3e140f){try{if(_0x51c65b[_0xfe98('0x55')]){return db[_0xfe98('0x6a')][_0xfe98('0x44')]({'raw':!![]})['then'](function(_0x4f8099){_0x4f8099['forEach'](function(_0x10454b){_0xc6421f[_0xfe98('0x5e')](_0x10454b['id']+0x15b38);});_0x4d9e98(_0xc6421f);});}else{return db[_0xfe98('0x56')][_0xfe98('0x44')]({'where':{'sectionId':_0x51c65b['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x147b1e){_0x147b1e[_0xfe98('0x68')](function(_0x4fe8cb){_0xc6421f[_0xfe98('0x5e')](_0x4fe8cb[_0xfe98('0x69')]+0x15b38);});_0x4d9e98(_0xc6421f);});}}catch(_0xd367d9){_0x3e140f(_0xd367d9);}});}exports['addResources']=function(_0x2ad8bb,_0x481789){return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x2ad8bb[_0xfe98('0x47')]['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x481789,null))['then'](function(_0x5165bc){if(_0x5165bc){return db[_0xfe98('0x52')]['transaction'](function(_0x361c00){return db[_0xfe98('0x53')][_0xfe98('0x44')]({'where':{'userProfileId':_0x2ad8bb[_0xfe98('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0xfe98('0x26')](function(_0x1a5d43){if(_0x1a5d43){return db[_0xfe98('0x53')][_0xfe98('0x25')]({'where':{'userProfileId':_0x2ad8bb[_0xfe98('0x47')]['id'],'id':_[_0xfe98('0x2c')](_0x1a5d43,function(_0x17470a){return _0x17470a['id'];})},'transaction':_0x361c00});}})['then'](function(_0xd58077){var _0x5b1421=_[_0xfe98('0x2c')](_0x2ad8bb['body'],function(_0x1d2873){_0x1d2873[_0xfe98('0x5d')]=_0x2ad8bb[_0xfe98('0x47')]['id'];return _0x1d2873;});return db[_0xfe98('0x53')][_0xfe98('0x6b')](_0x5b1421,{'raw':!![],'transaction':_0x361c00});})['then'](function(_0x1befdb){var _0x8ecf07=_['filter'](_[_0xfe98('0x2c')](_0x1befdb,function(_0x416705){return _0x416705[_0xfe98('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x8ecf07){return db[_0xfe98('0x53')][_0xfe98('0x44')]({'where':{'userProfileId':_0x2ad8bb[_0xfe98('0x47')]['id'],'sectionId':_[_0xfe98('0x2c')](_0x8ecf07,function(_0x40714b){return _0x40714b['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0xfe98('0x26')](function(_0x4d7a13){var _0x1be023=_[_0xfe98('0x2c')](_0x2ad8bb[_0xfe98('0x4f')],function(_0x11cf80){_0x11cf80['userProfileId']=_0x2ad8bb['params']['id'];return _0x11cf80;});return db[_0xfe98('0x56')]['bulkCreate'](_0x1be023,{'raw':!![],'transaction':_0x361c00});});}})['catch'](handleError(_0x481789,null));});}})[_0xfe98('0x26')](function(_0x5cd22f){var _0x3cf1a2=_[_0xfe98('0x2c')](_0x5cd22f,function(_0x2dc3ae){return _0x2dc3ae[_0xfe98('0x4d')]({'plain':!![]});});})[_0xfe98('0x26')](respondWithResult(_0x481789,null))['catch'](handleError(_0x481789,null));};exports[_0xfe98('0x6c')]=function(_0x3a53c1,_0x3f9b11,_0x1efc1a){return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x3a53c1['params']['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x3f9b11,null))[_0xfe98('0x26')](function(_0x250eb2){if(_0x250eb2){return _0x250eb2[_0xfe98('0x6c')](_0x3a53c1[_0xfe98('0x34')][_0xfe98('0x60')]);}})[_0xfe98('0x26')](respondWithStatusCode(_0x3f9b11,null))['catch'](handleError(_0x3f9b11,null));};exports[_0xfe98('0x6d')]=function(_0x233182,_0x148e11){var _0x37f452={};if(!_0x233182['query']['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x233182['query'][_0xfe98('0x38')](_0xfe98('0x39'))){_0x37f452[_0xfe98('0x1b')]=qs[_0xfe98('0x1b')](_0x233182['query']['limit']);_0x37f452[_0xfe98('0x1d')]=qs[_0xfe98('0x1d')](_0x233182[_0xfe98('0x34')][_0xfe98('0x1d')]);}return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x233182[_0xfe98('0x47')]['id']}})['then'](function(_0x3bc6fb){if(!_0x3bc6fb)throw new Error(_0xfe98('0x6e')+_0x233182[_0xfe98('0x47')]['id']);return db[_0xfe98('0x2d')][_0xfe98('0x6d')](_0x233182);})[_0xfe98('0x26')](respondWithFilteredResult(_0x148e11,_0x37f452))['catch'](handleError(_0x148e11,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index e574d48..4d5fce8 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 _0x7eff=['hasOwnProperty','hook','exports','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x7eff,0x162));var _0xf7ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7eff[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xf7ef('0x0'))['db'][_0xf7ef('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xf7ef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf7ef('0x3'),'afterDestroy':_0xf7ef('0x4')};function emitEvent(_0xc0c7ba){return function(_0x4db614,_0x58a651,_0x4a4573){UserProfileEvents[_0xf7ef('0x5')](_0xc0c7ba+':'+_0x4db614['id'],_0x4db614);UserProfileEvents[_0xf7ef('0x5')](_0xc0c7ba,_0x4db614);_0x4a4573(null);};}for(var e in events){if(events[_0xf7ef('0x6')](e)){var event=events[e];UserProfile[_0xf7ef('0x7')](e,emitEvent(event));}}module[_0xf7ef('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x1893=['UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1893,0xa2));var _0x3189=function(_0x50f382,_0x32473c){_0x50f382=_0x50f382-0x0;var _0x16afda=_0x1893[_0x50f382];return _0x16afda;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db'][_0x3189('0x0')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3189('0x1')](0x0);var events={'afterCreate':_0x3189('0x2'),'afterUpdate':_0x3189('0x3'),'afterDestroy':_0x3189('0x4')};function emitEvent(_0x36a7b0){return function(_0x3953a2,_0x5371db,_0x27445){UserProfileEvents[_0x3189('0x5')](_0x36a7b0+':'+_0x3953a2['id'],_0x3953a2);UserProfileEvents[_0x3189('0x5')](_0x36a7b0,_0x3953a2);_0x27445(null);};}for(var e in events){if(events[_0x3189('0x6')](e)){var event=events[e];UserProfile[_0x3189('0x7')](e,emitEvent(event));}}module[_0x3189('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 65b61a2..40486ad 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 _0x4888=['offset','order','sort','pick','merge','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tag','Tags','tag','ThroughTags','color','openTabs','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','findAll','then','associatedResources','map','catch','field','model','name','resolve','UserProfileResource','resourceId','type','odbc','squarerecordings','childModel','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicerecordings','VoiceRecording','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','Dashboard','intervals','pauses','Pause','Schedule','sounds','tags','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','extractedreports','AnalyticExtractedReport','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','section','mergeResources','isEmpty','length','push','find','params','all','ignore','union','rawAttributes','filters','intersection','attributes','fields','hasOwnProperty','limit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4888,0x198));var _0x8488=function(_0x393db8,_0x3e1157){_0x393db8=_0x393db8-0x0;var _0x4295cc=_0x4888[_0x393db8];return _0x4295cc;};'use strict';var _=require('lodash');var attributes=require(_0x8488('0x0'));var qs=require(_0x8488('0x1'));var squel=require(_0x8488('0x2'));module[_0x8488('0x3')]=function(_0x257275){var _0xacc8f0=_0x257275[_0x8488('0x4')];function _0x571e4b(_0x267093,_0xf45c3f){return new Promise(function(_0x1a97f4,_0x421292){if(!_0xf45c3f)return _0x1a97f4(null);var _0x326887=_0xf45c3f[_0x8488('0x5')]?{[_0xf45c3f['filter']['field']]:_0xf45c3f['filter']['value']}:undefined;return _0xacc8f0[_0x267093][_0x8488('0x6')]({'where':_0x326887,'raw':!![]})[_0x8488('0x7')](function(_0x542bd8){_0xf45c3f[_0x8488('0x8')]=_[_0x8488('0x9')](_0x542bd8,'id');_0x1a97f4(_0xf45c3f);})[_0x8488('0xa')](function(_0x19a2ee){_0x421292(_0x19a2ee);});});}function _0x515ea8(_0x377d3b,_0x1909c9){return new Promise(function(_0x468896,_0x256bab){var _0x47146a=_0x377d3b['filter']?{[_0x377d3b[_0x8488('0x5')][_0x8488('0xb')]]:_0x377d3b['filter']['value']}:undefined;return _0xacc8f0[_0x377d3b[_0x8488('0xc')]]['findAll']({'where':_0x47146a,'raw':!![]})[_0x8488('0x7')](function(_0x4e94fc){_0x1909c9['associatedResources']=_[_0x8488('0x9')](_0x4e94fc,function(_0x3635da){return _0x3635da[_0x8488('0xd')];});_0x468896(_0x1909c9);})[_0x8488('0xa')](function(_0x3b3cfa){_0x256bab(_0x3b3cfa);});});}function _0x8d3b3d(_0x165139,_0x4e44af,_0x3dad45){if(!_0x4e44af)return Promise[_0x8488('0xe')](null);return new Promise(function(_0x3edfe4,_0x37361d){return _0xacc8f0[_0x8488('0xf')][_0x8488('0x6')]({'where':{'sectionId':_0x4e44af['id']},'raw':!![]})[_0x8488('0x7')](function(_0x27c62a){if(_0x165139[_0x8488('0xb')]&&_0x165139[_0x8488('0xb')]!=='id'){_0x4e44af[_0x8488('0x8')]=_[_0x8488('0x9')](_0x27c62a,function(_0x3dd93e){return _0x3dd93e[_0x165139['field']];});}else{if(_0x3dad45==='AnalyticExtractedReport'){_0x4e44af[_0x8488('0x8')]=_[_0x8488('0x9')](_0x27c62a,function(_0xbb10fe){return{'id':_0xbb10fe[_0x8488('0x10')],'type':_0xbb10fe[_0x8488('0x11')]};});}else{_0x4e44af[_0x8488('0x8')]=_[_0x8488('0x9')](_0x27c62a,function(_0x3c078c){return _0x3c078c[_0x8488('0x10')];});}}_0x3edfe4(_0x4e44af);})['catch'](function(_0x476a14){_0x37361d(_0x476a14);});});}function _0x4e07e1(_0x140b0b,_0x1361a6){var _0x290b33={'parentSections':[]};switch(_0x140b0b['toLowerCase']()){case'squareprojects':_0x290b33['childModel']='SquareProject';break;case _0x8488('0x12'):_0x290b33['childModel']='SquareOdbc';break;case _0x8488('0x13'):_0x290b33[_0x8488('0x14')]=_0x8488('0x15');_0x290b33[_0x8488('0x16')]=[{'name':_0x8488('0x17'),'field':'name','foreignKey':_0x8488('0x18')}];break;case _0x8488('0x19'):_0x290b33[_0x8488('0x14')]=_0x8488('0x1a');break;case _0x8488('0x1b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x1c');_0x290b33[_0x8488('0x16')]=[{'name':_0x8488('0x1d'),'field':'id','foreignKey':_0x8488('0x1e')}];break;case _0x8488('0x1f'):_0x290b33['childModel']='CmList';break;case'companies':_0x290b33[_0x8488('0x14')]=_0x8488('0x20');break;case _0x8488('0x21'):_0x290b33[_0x8488('0x14')]=_0x8488('0x22');break;case _0x8488('0x23'):_0x290b33['childModel']=_0x8488('0x24');break;case _0x8488('0x25'):_0x290b33[_0x8488('0x14')]=_0x8488('0x26');break;case _0x8488('0x27'):_0x290b33['childModel']=_0x8488('0x28');break;case _0x8488('0x29'):_0x290b33['childModel']=_0x8488('0x2a');break;case _0x8488('0x2b'):case _0x8488('0x2c'):case _0x8488('0x2d'):_0x290b33[_0x8488('0x14')]='VoiceExtension';break;case _0x8488('0x2e'):_0x290b33[_0x8488('0x14')]=_0x8488('0x2f');break;case'voicemails':_0x290b33[_0x8488('0x14')]='VoiceMail';break;case _0x8488('0x30'):_0x290b33[_0x8488('0x14')]=_0x8488('0x31');_0x290b33[_0x8488('0x16')]=[{'name':'Agents','field':_0x8488('0xd'),'foreignKey':_0x8488('0x32'),'model':_0x8488('0x33'),'filter':{'field':'role','value':[_0x8488('0x34')]}},{'name':_0x8488('0x35'),'field':_0x8488('0xd'),'foreignKey':_0x8488('0x32'),'model':_0x8488('0x33'),'filter':{'field':_0x8488('0x36'),'value':[_0x8488('0x37')]}},{'name':_0x8488('0x38'),'field':_0x8488('0xd'),'foreignKey':_0x8488('0x39'),'model':_0x8488('0x3a'),'filter':{'field':'type','value':['inbound']}},{'name':_0x8488('0x3b'),'field':_0x8488('0xd'),'foreignKey':_0x8488('0x39'),'model':_0x8488('0x3a'),'filter':{'field':_0x8488('0x11'),'value':[_0x8488('0x3c')]}}];break;case _0x8488('0x3d'):_0x290b33[_0x8488('0x14')]=_0x8488('0x3e');break;case'chanspies':_0x290b33[_0x8488('0x14')]=_0x8488('0x3f');break;case _0x8488('0x40'):_0x290b33['childModel']=_0x8488('0x41');break;case _0x8488('0x42'):_0x290b33[_0x8488('0x14')]=_0x8488('0x43');break;case _0x8488('0x44'):_0x290b33[_0x8488('0x14')]=_0x8488('0x45');break;case'mailaccounts':_0x290b33[_0x8488('0x14')]=_0x8488('0x46');break;case _0x8488('0x47'):_0x290b33['childModel']=_0x8488('0x48');break;case'openchannelqueues':_0x290b33[_0x8488('0x14')]=_0x8488('0x49');break;case'openchannelaccounts':_0x290b33[_0x8488('0x14')]=_0x8488('0x4a');break;case _0x8488('0x4b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x4c');break;case'smsaccounts':_0x290b33[_0x8488('0x14')]='SmsAccount';break;case _0x8488('0x4d'):_0x290b33[_0x8488('0x14')]=_0x8488('0x4e');break;case _0x8488('0x4f'):_0x290b33[_0x8488('0x14')]=_0x8488('0x50');break;case _0x8488('0x51'):_0x290b33[_0x8488('0x14')]=_0x8488('0x52');break;case _0x8488('0x53'):case _0x8488('0x54'):_0x290b33[_0x8488('0x14')]=_0x8488('0x3a');if(_0x1361a6){_0x290b33[_0x8488('0x16')]=[{'name':_0x8488('0x38')},{'name':_0x8488('0x3b')}];}break;case _0x8488('0x55'):case'agents':case _0x8488('0x56'):_0x290b33[_0x8488('0x14')]=_0x8488('0x33');if(_0x1361a6){_0x290b33[_0x8488('0x16')]=[{'name':'Users','filter':{'field':_0x8488('0x36'),'value':[_0x8488('0x57'),_0x8488('0x58')]},'ignore':!![]},{'name':_0x8488('0x59')},{'name':'Telephones'}];}break;case _0x8488('0x5a'):_0x290b33[_0x8488('0x14')]=_0x8488('0x5b');break;case _0x8488('0x5c'):_0x290b33[_0x8488('0x14')]=_0x8488('0x5d');break;case _0x8488('0x5e'):_0x290b33[_0x8488('0x14')]=_0x8488('0x5f');break;case _0x8488('0x60'):_0x290b33[_0x8488('0x14')]=_0x8488('0x61');break;case _0x8488('0x62'):_0x290b33['childModel']='DeskAccount';break;case _0x8488('0x63'):_0x290b33[_0x8488('0x14')]=_0x8488('0x64');break;case _0x8488('0x65'):_0x290b33[_0x8488('0x14')]=_0x8488('0x33');break;case _0x8488('0x66'):_0x290b33[_0x8488('0x14')]=_0x8488('0x67');break;case'dispositions':_0x290b33[_0x8488('0x14')]=_0x8488('0x68');break;case'customdashboards':_0x290b33[_0x8488('0x14')]=_0x8488('0x69');break;case _0x8488('0x6a'):_0x290b33[_0x8488('0x14')]='Interval';break;case _0x8488('0x6b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x6c');break;case'scheduler':_0x290b33[_0x8488('0x14')]=_0x8488('0x6d');break;case _0x8488('0x6e'):_0x290b33[_0x8488('0x14')]='Sound';break;case _0x8488('0x6f'):_0x290b33['childModel']='Tag';break;case _0x8488('0x70'):_0x290b33['childModel']=_0x8488('0x71');break;case _0x8488('0x72'):_0x290b33[_0x8488('0x14')]=_0x8488('0x73');break;case _0x8488('0x74'):_0x290b33[_0x8488('0x14')]='Trunk';break;case _0x8488('0x75'):_0x290b33[_0x8488('0x14')]=_0x8488('0x76');break;case _0x8488('0x77'):_0x290b33[_0x8488('0x14')]='Plugin';break;case _0x8488('0x78'):_0x290b33['childModel']=_0x8488('0x79');_0x290b33[_0x8488('0x16')]=[{'name':'Reports','field':'id','foreignKey':_0x8488('0x7a')}];break;case _0x8488('0x7b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x7c');break;}return _0x290b33;}function _0x4041e5(_0x168740,_0x59d0d4){var _0xb3574c=_0x168740['charAt'](0x0)[_0x8488('0x7d')]()+_0x168740[_0x8488('0x7e')](0x1);var _0x3c06a4={'type':_0xacc8f0[_0x8488('0x7f')][_0x8488('0x80')][_0x8488('0x81')],'raw':!![]};return new Promise(function(_0x5a4426,_0x43ec52){var _0x4dba5a=squel[_0x8488('0x82')]()[_0x8488('0xb')](_0x8488('0x83')+_0xb3574c+_0x8488('0x84'),'id')[_0x8488('0xb')](_0x8488('0x85'))['from']('user_has_'+_0x168740+'_interactions','ui')[_0x8488('0x86')](_0x8488('0x87'),_0x59d0d4['id']);return _0xacc8f0[_0x8488('0x88')][_0x8488('0x89')](_0x4dba5a[_0x8488('0x8a')](),_0x3c06a4)[_0x8488('0x7')](function(_0x2377db){_0x59d0d4[_0xb3574c+_0x8488('0x8b')]=_0x2377db;_0x5a4426(_0x2377db);})[_0x8488('0xa')](function(_0xa90a65){_0x43ec52(_0xa90a65);});});}return _0x257275['define'](_0x8488('0x8c'),attributes,{'tableName':_0x8488('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3b6bfe){var _0x4ba14e={'raw':![],'where':{}};var _0x4ae192={};var _0x164d30={'count':0x0,'rows':[]};var _0x379a4d=_0x3b6bfe[_0x8488('0x89')][_0x8488('0x8e')];var _0x52bc90=_0x3b6bfe['query'][_0x8488('0x8f')]||![];var _0x26e0cc=_0x4e07e1(_0x379a4d,_0x52bc90);if(!_0x26e0cc[_0x8488('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x379a4d+'\x27');var _0x3c3e89=[{'name':_0x379a4d}];if(!_[_0x8488('0x90')](_0x26e0cc[_0x8488('0x16')]))_0x3c3e89=_0x26e0cc[_0x8488('0x16')];var _0x332a9c=[];for(var _0x5e41e5=0x0;_0x5e41e5<_0x3c3e89[_0x8488('0x91')];_0x5e41e5++){_0x332a9c[_0x8488('0x92')](_0xacc8f0['UserProfileSection'][_0x8488('0x93')]({'where':{'userProfileId':_0x3b6bfe[_0x8488('0x94')]['id'],'name':_0x3c3e89[_0x5e41e5]['name']},'raw':!![]}));}return Promise[_0x8488('0x95')](_0x332a9c)[_0x8488('0x7')](function(_0x212c3b){var _0x1d8c83=_[_0x8488('0x5')](_0x212c3b,function(_0x105f23){return _0x105f23?_0x105f23:undefined;});var _0x163cd9=_['filter'](_0x3c3e89,[_0x8488('0x96'),!![]]);var _0x3b7aa8=_['isEmpty'](_0x1d8c83)&&_['isEmpty'](_0x163cd9)?null:_[_0x8488('0x97')](_0x163cd9,_0x1d8c83);if(!_0x3b7aa8)return null;var _0x370a9c=[];for(var _0x3ff6c0=0x0;_0x3ff6c0<_0x3b7aa8['length'];_0x3ff6c0++){var _0xb85159=_[_0x8488('0x93')](_0x3c3e89,function(_0x56b35a){return _0x3b7aa8[_0x3ff6c0]?_0x56b35a[_0x8488('0xd')]===_0x3b7aa8[_0x3ff6c0]['name']:null;});if(_0xb85159){if(_0x3b7aa8[_0x3ff6c0][_0x8488('0x96')]){_0x370a9c[_0x8488('0x92')](_0x571e4b(_0x26e0cc[_0x8488('0x14')],_0x3b7aa8[_0x3ff6c0]));}else{if(!_0x3b7aa8[_0x3ff6c0]['autoAssociation']){_0x370a9c[_0x8488('0x92')](_0x8d3b3d(_0xb85159,_0x3b7aa8[_0x3ff6c0],_0x26e0cc[_0x8488('0x14')]));}else{if(_0xb85159['model']){_0x370a9c['push'](_0x515ea8(_0xb85159,_0x3b7aa8[_0x3ff6c0]));}}}}}return Promise[_0x8488('0x95')](_0x370a9c);})[_0x8488('0x7')](function(_0xfedfd2){var _0x3ab1b6=_0xfedfd2;var _0xe1fe21=null;if(_0x3ab1b6){_0xe1fe21=_0x3ab1b6[_0x8488('0x91')]===0x1?_0x3ab1b6[0x0]:null;}if(!_0xe1fe21&&!_0x3ab1b6)return _0x164d30;var _0x20d7c3=_0xacc8f0[_0x26e0cc[_0x8488('0x14')]][_0x8488('0x98')];_0x4ae192[_0x8488('0xc')]=_['keys'](_0x20d7c3);_0x4ae192[_0x8488('0x89')]=_['keys'](_0x3b6bfe[_0x8488('0x89')]);_0x4ae192[_0x8488('0x99')]=_[_0x8488('0x9a')](_0x4ae192[_0x8488('0xc')],_0x4ae192['query']);_0x4ba14e[_0x8488('0x9b')]=_[_0x8488('0x9a')](_0x4ae192['model'],qs[_0x8488('0x9c')](_0x3b6bfe['query'][_0x8488('0x9c')]));_0x4ba14e[_0x8488('0x9b')]=_0x4ba14e[_0x8488('0x9b')][_0x8488('0x91')]?_0x4ba14e[_0x8488('0x9b')]:_0x4ae192[_0x8488('0xc')];if(!_0x3b6bfe[_0x8488('0x89')][_0x8488('0x9d')]('nolimit')){_0x4ba14e[_0x8488('0x9e')]=qs['limit'](_0x3b6bfe['query'][_0x8488('0x9e')]);_0x4ba14e[_0x8488('0x9f')]=qs[_0x8488('0x9f')](_0x3b6bfe['query']['offset']);}_0x4ba14e[_0x8488('0xa0')]=qs[_0x8488('0xa1')](_0x3b6bfe['query'][_0x8488('0xa1')]);_0x4ba14e[_0x8488('0x86')]=qs[_0x8488('0x99')](_[_0x8488('0xa2')](_0x3b6bfe[_0x8488('0x89')],_0x4ae192[_0x8488('0x99')]));if(_0x3b6bfe['query'][_0x8488('0x5')]){_0x4ba14e[_0x8488('0x86')]=_[_0x8488('0xa3')](_0x4ba14e['where'],{'$or':_[_0x8488('0x9')](_0x20d7c3,function(_0x2b5ea4){if(_0x2b5ea4[_0x8488('0x11')]['key']!==_0x8488('0xa4')){var _0xaf7f76={};_0xaf7f76[_0x2b5ea4['field']]={'$like':'%'+_0x3b6bfe['query'][_0x8488('0x5')]+'%'};return _0xaf7f76;}})});}var _0x18c724=[];var _0x511143=null;var _0x353514={};if(_0xe1fe21){_0x511143=_[_0x8488('0x93')](_0x3c3e89,['name',_0xe1fe21['name']]);if(_0x511143[_0x8488('0xb')]){_0x353514={};if(_0x26e0cc['childModel']===_0x8488('0x79')){_0x353514[_0x511143[_0x8488('0xa5')]]=_[_0x8488('0x9')](_0xe1fe21[_0x8488('0x8')],'id');}else{_0x353514[_0x511143['foreignKey']]=_0xe1fe21[_0x8488('0x8')];}_0x18c724['push'](_0x353514);}else{_0x4ba14e[_0x8488('0x86')]['id']=_0xe1fe21['associatedResources'];}}else{for(var _0x2f137a=0x0;_0x2f137a<_0x3ab1b6[_0x8488('0x91')];_0x2f137a++){_0x511143=_[_0x8488('0x93')](_0x3c3e89,[_0x8488('0xd'),_0x3ab1b6[_0x2f137a][_0x8488('0xd')]]);if(_0x511143[_0x8488('0xb')]){_0x353514={};_0x353514[_0x511143[_0x8488('0xa5')]]=_0x3ab1b6[_0x2f137a][_0x8488('0x8')];_0x18c724[_0x8488('0x92')](_0x353514);}else{if(!_0x4ba14e[_0x8488('0x86')]['id'])_0x4ba14e[_0x8488('0x86')]['id']=[];_0x3ab1b6[_0x2f137a][_0x8488('0x8')][_0x8488('0xa6')](function(_0x3b22ad){_0x4ba14e['where']['id'][_0x8488('0x92')](_0x3b22ad);});}}}if(!_[_0x8488('0x90')](_0x18c724)){_0x4ba14e['where']=_[_0x8488('0xa3')](_0x4ba14e[_0x8488('0x86')],{'$and':{'$or':_0x18c724}});}_0x4ba14e=_[_0x8488('0xa3')]({},_0x4ba14e,_0x3b6bfe[_0x8488('0xa7')]);if(_0xe1fe21&&!_0xe1fe21[_0x8488('0xa8')]&&_0x26e0cc[_0x8488('0x14')]===_0x8488('0x79')){if(_0x3b6bfe[_0x8488('0x89')][_0x8488('0xa9')]){_0x4ba14e[_0x8488('0xaa')]=[{'all':!![]}];}return _0xacc8f0[_0x26e0cc[_0x8488('0x14')]]['findAll'](_0x4ba14e)[_0x8488('0x7')](function(_0x1abac4){var _0x51814e=[];_0x1abac4[_0x8488('0xa6')](function(_0x7426b2){var _0x76c3c;switch(_0x7426b2[_0x8488('0xab')]){case _0x8488('0xac'):_0x76c3c=_['find'](_0xe1fe21['associatedResources'],function(_0x31138c){return _0x31138c['id']===_0x7426b2[_0x8488('0x7a')]&&_0x31138c[_0x8488('0x11')]===_0x8488('0xad');});break;case _0x8488('0xae'):_0x76c3c=_[_0x8488('0x93')](_0xe1fe21[_0x8488('0x8')],function(_0x283824){return _0x283824['id']===_0x7426b2[_0x8488('0x7a')]&&_0x283824[_0x8488('0x11')]===_0x8488('0xaf');});break;}if(_0x76c3c)_0x51814e[_0x8488('0x92')](_0x7426b2);});_0x164d30[_0x8488('0xb0')]=_0x51814e[_0x8488('0x91')];_0x164d30[_0x8488('0xb1')]=_0x51814e;return _0x164d30;});}else{return _0xacc8f0[_0x26e0cc['childModel']][_0x8488('0xb0')]({'where':_0x4ba14e['where']})['then'](function(_0x1e25a3){_0x164d30[_0x8488('0xb0')]=_0x1e25a3;if(_0x3b6bfe[_0x8488('0x89')][_0x8488('0xa9')]){if(_0x26e0cc[_0x8488('0x14')]===_0x8488('0x1c')){_0x4ba14e[_0x8488('0xaa')]=[{'model':_0xacc8f0[_0x8488('0xb2')],'as':_0x8488('0xb3'),'attributes':['id',_0x8488('0xd'),'color'],'required':_0x3b6bfe[_0x8488('0x89')][_0x8488('0xb4')]?!![]:![]},{'model':_0xacc8f0[_0x8488('0xb2')],'as':_0x8488('0xb5'),'attributes':['id',_0x8488('0xd'),_0x8488('0xb6')],'through':_0x3b6bfe['query'][_0x8488('0xb4')]?{'attributes':[],'where':{'TagId':_0x3b6bfe['query'][_0x8488('0xb4')]||undefined}}:{},'required':_0x3b6bfe[_0x8488('0x89')]['tag']?!![]:![]}];}else{_0x4ba14e['include']=[{'all':!![]}];}}return _0xacc8f0[_0x26e0cc[_0x8488('0x14')]][_0x8488('0x6')](_0x4ba14e);})[_0x8488('0x7')](function(_0x30b124){_0x164d30[_0x8488('0xb1')]=_0x30b124;if(_0x379a4d==='Agents'&&_0x3b6bfe[_0x8488('0x89')][_0x8488('0xb7')]==='true'){var _0x52c750=[];for(var _0x41491a=0x0;_0x41491a<_0x164d30[_0x8488('0xb1')][_0x8488('0x91')];_0x41491a++){_0x52c750['push'](_0x4041e5('chat',_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5('sms',_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xb9'),_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xba'),_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xbb'),_0x164d30[_0x8488('0xb1')][_0x41491a]['dataValues']));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xbc'),_0x164d30[_0x8488('0xb1')][_0x41491a]['dataValues']));}return Promise[_0x8488('0x95')](_0x52c750)['then'](function(){return _0x164d30;});}return _0x164d30;});}});}}});}; \ No newline at end of file +var _0x7880=['VoiceMail','VoiceRecording','parentSections','Agents','membername','role','Telephones','User','VoiceQueues','queue','QueueCampaigns','VoiceQueue','outbound','musiconholds','voiceprefixes','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Sound','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','where','sequelize','query','toString','define','UserProfile','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','params','all','ignore','union','find','push','autoAssociation','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','include','forEach','reportType','default','DefaultReports','CustomReports','count','rows','includeAll','CmContact','Tags','color','tag','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','field','findAll','map','catch','model','then','name','associatedResources','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','odbc','childModel','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','voicemails'];(function(_0x5926a4,_0x42f65d){var _0xd64f0f=function(_0x252e72){while(--_0x252e72){_0x5926a4['push'](_0x5926a4['shift']());}};_0xd64f0f(++_0x42f65d);}(_0x7880,0x1f4));var _0x0788=function(_0x1a7edf,_0x5c4e04){_0x1a7edf=_0x1a7edf-0x0;var _0x56c1d9=_0x7880[_0x1a7edf];return _0x56c1d9;};'use strict';var _=require('lodash');var attributes=require(_0x0788('0x0'));var qs=require(_0x0788('0x1'));var squel=require(_0x0788('0x2'));module[_0x0788('0x3')]=function(_0x47dc20){var _0x446ded=_0x47dc20['models'];function _0x3925a6(_0x1e0814,_0x317885){return new Promise(function(_0xd53e7d,_0x262f5c){if(!_0x317885)return _0xd53e7d(null);var _0x775629=_0x317885[_0x0788('0x4')]?{[_0x317885[_0x0788('0x4')][_0x0788('0x5')]]:_0x317885[_0x0788('0x4')]['value']}:undefined;return _0x446ded[_0x1e0814][_0x0788('0x6')]({'where':_0x775629,'raw':!![]})['then'](function(_0xabaf81){_0x317885['associatedResources']=_[_0x0788('0x7')](_0xabaf81,'id');_0xd53e7d(_0x317885);})[_0x0788('0x8')](function(_0x1f9ff6){_0x262f5c(_0x1f9ff6);});});}function _0xee8670(_0x469ebe,_0x5d747c){return new Promise(function(_0x1920b3,_0x37560d){var _0x21c303=_0x469ebe[_0x0788('0x4')]?{[_0x469ebe[_0x0788('0x4')][_0x0788('0x5')]]:_0x469ebe[_0x0788('0x4')]['value']}:undefined;return _0x446ded[_0x469ebe[_0x0788('0x9')]][_0x0788('0x6')]({'where':_0x21c303,'raw':!![]})[_0x0788('0xa')](function(_0x13cf07){_0x5d747c['associatedResources']=_[_0x0788('0x7')](_0x13cf07,function(_0x4ed024){return _0x4ed024[_0x0788('0xb')];});_0x1920b3(_0x5d747c);})[_0x0788('0x8')](function(_0x3fd1e4){_0x37560d(_0x3fd1e4);});});}function _0xb406fb(_0x2ddd1a,_0x430e34,_0x5e1a29){if(!_0x430e34)return Promise['resolve'](null);return new Promise(function(_0x17d805,_0x461d9d){return _0x446ded['UserProfileResource'][_0x0788('0x6')]({'where':{'sectionId':_0x430e34['id']},'raw':!![]})[_0x0788('0xa')](function(_0x17ae59){if(_0x2ddd1a['field']&&_0x2ddd1a[_0x0788('0x5')]!=='id'){_0x430e34[_0x0788('0xc')]=_['map'](_0x17ae59,function(_0x11ea01){return _0x11ea01[_0x2ddd1a['field']];});}else{if(_0x5e1a29===_0x0788('0xd')){_0x430e34['associatedResources']=_[_0x0788('0x7')](_0x17ae59,function(_0x3c37ca){return{'id':_0x3c37ca[_0x0788('0xe')],'type':_0x3c37ca[_0x0788('0xf')]};});}else{_0x430e34[_0x0788('0xc')]=_['map'](_0x17ae59,function(_0x48ec43){return _0x48ec43[_0x0788('0xe')];});}}_0x17d805(_0x430e34);})[_0x0788('0x8')](function(_0x645320){_0x461d9d(_0x645320);});});}function _0x7a99a1(_0x5ba1da,_0x4d5c93){var _0x79204e={'parentSections':[]};switch(_0x5ba1da[_0x0788('0x10')]()){case _0x0788('0x11'):_0x79204e['childModel']='SquareProject';break;case _0x0788('0x12'):_0x79204e[_0x0788('0x13')]='SquareOdbc';break;case'squarerecordings':_0x79204e[_0x0788('0x13')]=_0x0788('0x14');_0x79204e['parentSections']=[{'name':_0x0788('0x15'),'field':_0x0788('0xb'),'foreignKey':_0x0788('0x16')}];break;case _0x0788('0x17'):_0x79204e[_0x0788('0x13')]=_0x0788('0x18');break;case _0x0788('0x19'):_0x79204e[_0x0788('0x13')]='CmContact';_0x79204e['parentSections']=[{'name':_0x0788('0x1a'),'field':'id','foreignKey':_0x0788('0x1b')}];break;case'lists':_0x79204e['childModel']=_0x0788('0x1c');break;case _0x0788('0x1d'):_0x79204e[_0x0788('0x13')]=_0x0788('0x1e');break;case _0x0788('0x1f'):_0x79204e[_0x0788('0x13')]=_0x0788('0x20');break;case _0x0788('0x21'):_0x79204e[_0x0788('0x13')]=_0x0788('0x22');break;case'chatwebsites':_0x79204e[_0x0788('0x13')]=_0x0788('0x23');break;case _0x0788('0x24'):_0x79204e[_0x0788('0x13')]=_0x0788('0x25');break;case _0x0788('0x26'):_0x79204e[_0x0788('0x13')]=_0x0788('0x27');break;case _0x0788('0x28'):case _0x0788('0x29'):case'outboundroutes':_0x79204e['childModel']='VoiceExtension';break;case'contexts':_0x79204e['childModel']='VoiceContext';break;case _0x0788('0x2a'):_0x79204e[_0x0788('0x13')]=_0x0788('0x2b');break;case'voicerecordings':_0x79204e[_0x0788('0x13')]=_0x0788('0x2c');_0x79204e[_0x0788('0x2d')]=[{'name':_0x0788('0x2e'),'field':'name','foreignKey':_0x0788('0x2f'),'model':'User','filter':{'field':_0x0788('0x30'),'value':['agent']}},{'name':_0x0788('0x31'),'field':_0x0788('0xb'),'foreignKey':'membername','model':_0x0788('0x32'),'filter':{'field':_0x0788('0x30'),'value':['telephone']}},{'name':_0x0788('0x33'),'field':'name','foreignKey':_0x0788('0x34'),'model':'VoiceQueue','filter':{'field':_0x0788('0xf'),'value':['inbound']}},{'name':_0x0788('0x35'),'field':'name','foreignKey':'queue','model':_0x0788('0x36'),'filter':{'field':_0x0788('0xf'),'value':[_0x0788('0x37')]}}];break;case _0x0788('0x38'):_0x79204e[_0x0788('0x13')]='VoiceMusicOnHold';break;case'chanspies':_0x79204e['childModel']='VoiceChanSpy';break;case _0x0788('0x39'):_0x79204e[_0x0788('0x13')]=_0x0788('0x3a');break;case _0x0788('0x3b'):_0x79204e[_0x0788('0x13')]='Campaign';break;case'mailqueues':_0x79204e[_0x0788('0x13')]=_0x0788('0x3c');break;case _0x0788('0x3d'):_0x79204e[_0x0788('0x13')]=_0x0788('0x3e');break;case _0x0788('0x3f'):_0x79204e[_0x0788('0x13')]=_0x0788('0x40');break;case _0x0788('0x41'):_0x79204e['childModel']='OpenchannelQueue';break;case _0x0788('0x42'):_0x79204e[_0x0788('0x13')]=_0x0788('0x43');break;case'smsqueues':_0x79204e['childModel']='SmsQueue';break;case _0x0788('0x44'):_0x79204e[_0x0788('0x13')]=_0x0788('0x45');break;case _0x0788('0x46'):_0x79204e[_0x0788('0x13')]=_0x0788('0x47');break;case _0x0788('0x48'):_0x79204e[_0x0788('0x13')]='WhatsappAccount';break;case _0x0788('0x49'):_0x79204e[_0x0788('0x13')]=_0x0788('0x4a');break;case _0x0788('0x4b'):case'queuecampaigns':_0x79204e[_0x0788('0x13')]=_0x0788('0x36');if(_0x4d5c93){_0x79204e['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x0788('0x4c'):case'agents':case _0x0788('0x4d'):_0x79204e[_0x0788('0x13')]=_0x0788('0x32');if(_0x4d5c93){_0x79204e[_0x0788('0x2d')]=[{'name':_0x0788('0x4e'),'filter':{'field':_0x0788('0x30'),'value':[_0x0788('0x4f'),_0x0788('0x50')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x0788('0x51'):_0x79204e[_0x0788('0x13')]=_0x0788('0x52');break;case'salesforceaccounts':_0x79204e[_0x0788('0x13')]=_0x0788('0x53');break;case _0x0788('0x54'):_0x79204e[_0x0788('0x13')]=_0x0788('0x55');break;case'sugarcrmaccounts':_0x79204e['childModel']=_0x0788('0x56');break;case _0x0788('0x57'):_0x79204e['childModel']=_0x0788('0x58');break;case'zohoaccounts':_0x79204e[_0x0788('0x13')]=_0x0788('0x59');break;case _0x0788('0x5a'):_0x79204e[_0x0788('0x13')]=_0x0788('0x32');break;case _0x0788('0x5b'):_0x79204e[_0x0788('0x13')]=_0x0788('0x5c');break;case'dispositions':_0x79204e[_0x0788('0x13')]=_0x0788('0x5d');break;case _0x0788('0x5e'):_0x79204e['childModel']=_0x0788('0x5f');break;case _0x0788('0x60'):_0x79204e['childModel']=_0x0788('0x61');break;case _0x0788('0x62'):_0x79204e[_0x0788('0x13')]=_0x0788('0x63');break;case _0x0788('0x64'):_0x79204e[_0x0788('0x13')]='Schedule';break;case'sounds':_0x79204e[_0x0788('0x13')]=_0x0788('0x65');break;case'tags':_0x79204e[_0x0788('0x13')]=_0x0788('0x66');break;case _0x0788('0x67'):_0x79204e[_0x0788('0x13')]=_0x0788('0x68');break;case _0x0788('0x69'):_0x79204e[_0x0788('0x13')]=_0x0788('0x6a');break;case _0x0788('0x6b'):_0x79204e[_0x0788('0x13')]=_0x0788('0x6c');break;case _0x0788('0x6d'):_0x79204e['childModel']=_0x0788('0x6e');break;case _0x0788('0x6f'):_0x79204e[_0x0788('0x13')]='Plugin';break;case _0x0788('0x70'):_0x79204e[_0x0788('0x13')]='AnalyticExtractedReport';_0x79204e['parentSections']=[{'name':_0x0788('0x71'),'field':'id','foreignKey':_0x0788('0x72')}];break;case _0x0788('0x73'):_0x79204e[_0x0788('0x13')]=_0x0788('0x74');break;}return _0x79204e;}function _0x4c08f9(_0x535648,_0x336d30){var _0x3be076=_0x535648[_0x0788('0x75')](0x0)['toUpperCase']()+_0x535648['slice'](0x1);var _0x3a25d3={'type':_0x446ded['Sequelize'][_0x0788('0x76')][_0x0788('0x77')],'raw':!![]};return new Promise(function(_0x223767,_0x13a021){var _0x101e8b=squel[_0x0788('0x78')]()[_0x0788('0x5')](_0x0788('0x79')+_0x3be076+_0x0788('0x7a'),'id')[_0x0788('0x5')]('ui.createdAt')[_0x0788('0x7b')](_0x0788('0x7c')+_0x535648+_0x0788('0x7d'),'ui')[_0x0788('0x7e')]('ui.UserId\x20=\x20?',_0x336d30['id']);return _0x446ded[_0x0788('0x7f')][_0x0788('0x80')](_0x101e8b[_0x0788('0x81')](),_0x3a25d3)[_0x0788('0xa')](function(_0x5a353f){_0x336d30[_0x3be076+'OpenTabs']=_0x5a353f;_0x223767(_0x5a353f);})[_0x0788('0x8')](function(_0x4aa3af){_0x13a021(_0x4aa3af);});});}return _0x47dc20[_0x0788('0x82')](_0x0788('0x83'),attributes,{'tableName':_0x0788('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x47f22c){var _0x3baf23={'raw':![],'where':{}};var _0x348cbf={};var _0xdc7103={'count':0x0,'rows':[]};var _0x150403=_0x47f22c[_0x0788('0x80')]['section'];var _0x25201f=_0x47f22c[_0x0788('0x80')][_0x0788('0x85')]||![];var _0x59a436=_0x7a99a1(_0x150403,_0x25201f);if(!_0x59a436['childModel'])throw new Error(_0x0788('0x86')+_0x150403+'\x27');var _0x1bb234=[{'name':_0x150403}];if(!_[_0x0788('0x87')](_0x59a436['parentSections']))_0x1bb234=_0x59a436[_0x0788('0x2d')];var _0x23f7d1=[];for(var _0x1eb4c9=0x0;_0x1eb4c9<_0x1bb234[_0x0788('0x88')];_0x1eb4c9++){_0x23f7d1['push'](_0x446ded['UserProfileSection']['find']({'where':{'userProfileId':_0x47f22c[_0x0788('0x89')]['id'],'name':_0x1bb234[_0x1eb4c9][_0x0788('0xb')]},'raw':!![]}));}return Promise[_0x0788('0x8a')](_0x23f7d1)['then'](function(_0x59b296){var _0xaa2d4d=_['filter'](_0x59b296,function(_0x955bfa){return _0x955bfa?_0x955bfa:undefined;});var _0x3d1181=_[_0x0788('0x4')](_0x1bb234,[_0x0788('0x8b'),!![]]);var _0x1834fb=_[_0x0788('0x87')](_0xaa2d4d)&&_[_0x0788('0x87')](_0x3d1181)?null:_[_0x0788('0x8c')](_0x3d1181,_0xaa2d4d);if(!_0x1834fb)return null;var _0x433c05=[];for(var _0x137a7a=0x0;_0x137a7a<_0x1834fb['length'];_0x137a7a++){var _0x240210=_[_0x0788('0x8d')](_0x1bb234,function(_0x52926f){return _0x1834fb[_0x137a7a]?_0x52926f['name']===_0x1834fb[_0x137a7a][_0x0788('0xb')]:null;});if(_0x240210){if(_0x1834fb[_0x137a7a][_0x0788('0x8b')]){_0x433c05[_0x0788('0x8e')](_0x3925a6(_0x59a436[_0x0788('0x13')],_0x1834fb[_0x137a7a]));}else{if(!_0x1834fb[_0x137a7a][_0x0788('0x8f')]){_0x433c05[_0x0788('0x8e')](_0xb406fb(_0x240210,_0x1834fb[_0x137a7a],_0x59a436['childModel']));}else{if(_0x240210[_0x0788('0x9')]){_0x433c05[_0x0788('0x8e')](_0xee8670(_0x240210,_0x1834fb[_0x137a7a]));}}}}}return Promise[_0x0788('0x8a')](_0x433c05);})[_0x0788('0xa')](function(_0x4e0282){var _0x35c612=_0x4e0282;var _0x2272e2=null;if(_0x35c612){_0x2272e2=_0x35c612[_0x0788('0x88')]===0x1?_0x35c612[0x0]:null;}if(!_0x2272e2&&!_0x35c612)return _0xdc7103;var _0x360476=_0x446ded[_0x59a436['childModel']]['rawAttributes'];_0x348cbf[_0x0788('0x9')]=_[_0x0788('0x90')](_0x360476);_0x348cbf[_0x0788('0x80')]=_[_0x0788('0x90')](_0x47f22c[_0x0788('0x80')]);_0x348cbf[_0x0788('0x91')]=_[_0x0788('0x92')](_0x348cbf[_0x0788('0x9')],_0x348cbf[_0x0788('0x80')]);_0x3baf23['attributes']=_[_0x0788('0x92')](_0x348cbf[_0x0788('0x9')],qs[_0x0788('0x93')](_0x47f22c['query']['fields']));_0x3baf23[_0x0788('0x94')]=_0x3baf23['attributes'][_0x0788('0x88')]?_0x3baf23[_0x0788('0x94')]:_0x348cbf[_0x0788('0x9')];if(!_0x47f22c[_0x0788('0x80')][_0x0788('0x95')](_0x0788('0x96'))){_0x3baf23[_0x0788('0x97')]=qs[_0x0788('0x97')](_0x47f22c[_0x0788('0x80')]['limit']);_0x3baf23[_0x0788('0x98')]=qs[_0x0788('0x98')](_0x47f22c[_0x0788('0x80')]['offset']);}_0x3baf23[_0x0788('0x99')]=qs[_0x0788('0x9a')](_0x47f22c[_0x0788('0x80')]['sort']);_0x3baf23[_0x0788('0x7e')]=qs[_0x0788('0x91')](_[_0x0788('0x9b')](_0x47f22c[_0x0788('0x80')],_0x348cbf[_0x0788('0x91')]));if(_0x47f22c[_0x0788('0x80')][_0x0788('0x4')]){_0x3baf23[_0x0788('0x7e')]=_[_0x0788('0x9c')](_0x3baf23['where'],{'$or':_[_0x0788('0x7')](_0x360476,function(_0x623d29){if(_0x623d29[_0x0788('0xf')][_0x0788('0x9d')]!==_0x0788('0x9e')){var _0x5749fc={};_0x5749fc[_0x623d29[_0x0788('0x5')]]={'$like':'%'+_0x47f22c[_0x0788('0x80')][_0x0788('0x4')]+'%'};return _0x5749fc;}})});}var _0x4fb7f7=[];var _0x1788d1=null;var _0x17430c={};if(_0x2272e2){_0x1788d1=_[_0x0788('0x8d')](_0x1bb234,[_0x0788('0xb'),_0x2272e2[_0x0788('0xb')]]);if(_0x1788d1['field']){_0x17430c={};if(_0x59a436[_0x0788('0x13')]===_0x0788('0xd')){_0x17430c[_0x1788d1['foreignKey']]=_[_0x0788('0x7')](_0x2272e2[_0x0788('0xc')],'id');}else{_0x17430c[_0x1788d1['foreignKey']]=_0x2272e2[_0x0788('0xc')];}_0x4fb7f7[_0x0788('0x8e')](_0x17430c);}else{_0x3baf23[_0x0788('0x7e')]['id']=_0x2272e2['associatedResources'];}}else{for(var _0x28ad96=0x0;_0x28ad96<_0x35c612[_0x0788('0x88')];_0x28ad96++){_0x1788d1=_[_0x0788('0x8d')](_0x1bb234,['name',_0x35c612[_0x28ad96][_0x0788('0xb')]]);if(_0x1788d1[_0x0788('0x5')]){_0x17430c={};_0x17430c[_0x1788d1[_0x0788('0x9f')]]=_0x35c612[_0x28ad96][_0x0788('0xc')];_0x4fb7f7[_0x0788('0x8e')](_0x17430c);}else{if(!_0x3baf23[_0x0788('0x7e')]['id'])_0x3baf23[_0x0788('0x7e')]['id']=[];_0x35c612[_0x28ad96][_0x0788('0xc')]['forEach'](function(_0x36ebc1){_0x3baf23[_0x0788('0x7e')]['id'][_0x0788('0x8e')](_0x36ebc1);});}}}if(!_[_0x0788('0x87')](_0x4fb7f7)){_0x3baf23['where']=_['merge'](_0x3baf23[_0x0788('0x7e')],{'$and':{'$or':_0x4fb7f7}});}_0x3baf23=_[_0x0788('0x9c')]({},_0x3baf23,_0x47f22c['options']);if(_0x2272e2&&!_0x2272e2[_0x0788('0x8f')]&&_0x59a436[_0x0788('0x13')]===_0x0788('0xd')){if(_0x47f22c['query']['includeAll']){_0x3baf23[_0x0788('0xa0')]=[{'all':!![]}];}return _0x446ded[_0x59a436[_0x0788('0x13')]]['findAll'](_0x3baf23)['then'](function(_0x4ace43){var _0x17ea6a=[];_0x4ace43[_0x0788('0xa1')](function(_0x59260c){var _0x1827e4;switch(_0x59260c[_0x0788('0xa2')]){case _0x0788('0xa3'):_0x1827e4=_[_0x0788('0x8d')](_0x2272e2[_0x0788('0xc')],function(_0x4864f5){return _0x4864f5['id']===_0x59260c[_0x0788('0x72')]&&_0x4864f5['type']===_0x0788('0xa4');});break;case'custom':_0x1827e4=_[_0x0788('0x8d')](_0x2272e2[_0x0788('0xc')],function(_0xbf1276){return _0xbf1276['id']===_0x59260c[_0x0788('0x72')]&&_0xbf1276[_0x0788('0xf')]===_0x0788('0xa5');});break;}if(_0x1827e4)_0x17ea6a[_0x0788('0x8e')](_0x59260c);});_0xdc7103[_0x0788('0xa6')]=_0x17ea6a[_0x0788('0x88')];_0xdc7103[_0x0788('0xa7')]=_0x17ea6a;return _0xdc7103;});}else{return _0x446ded[_0x59a436[_0x0788('0x13')]][_0x0788('0xa6')]({'where':_0x3baf23[_0x0788('0x7e')]})['then'](function(_0x55fe55){_0xdc7103['count']=_0x55fe55;if(_0x47f22c[_0x0788('0x80')][_0x0788('0xa8')]){if(_0x59a436[_0x0788('0x13')]===_0x0788('0xa9')){_0x3baf23[_0x0788('0xa0')]=[{'model':_0x446ded[_0x0788('0x66')],'as':_0x0788('0xaa'),'attributes':['id',_0x0788('0xb'),_0x0788('0xab')],'required':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]?!![]:![]},{'model':_0x446ded['Tag'],'as':'ThroughTags','attributes':['id',_0x0788('0xb'),_0x0788('0xab')],'through':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]?{'attributes':[],'where':{'TagId':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]||undefined}}:{},'required':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]?!![]:![]}];}else{_0x3baf23['include']=[{'all':!![]}];}}return _0x446ded[_0x59a436['childModel']][_0x0788('0x6')](_0x3baf23);})[_0x0788('0xa')](function(_0x285972){_0xdc7103[_0x0788('0xa7')]=_0x285972;if(_0x150403===_0x0788('0x2e')&&_0x47f22c[_0x0788('0x80')]['openTabs']===_0x0788('0xad')){var _0x1311d7=[];for(var _0x3ca412=0x0;_0x3ca412<_0xdc7103[_0x0788('0xa7')][_0x0788('0x88')];_0x3ca412++){_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xae'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7['push'](_0x4c08f9(_0x0788('0xb0'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb1'),_0xdc7103[_0x0788('0xa7')][_0x3ca412]['dataValues']));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb2'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb3'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb4'),_0xdc7103['rows'][_0x3ca412][_0x0788('0xaf')]));}return Promise['all'](_0x1311d7)[_0x0788('0xa')](function(){return _0xdc7103;});}return _0xdc7103;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 887cdf4..8e38e6a 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 _0xdfb1=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x55f95a,_0x28c042){var _0x13e20f=function(_0x25bddc){while(--_0x25bddc){_0x55f95a['push'](_0x55f95a['shift']());}};_0x13e20f(++_0x28c042);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x1805f5,_0x1e01d5){_0x1805f5=_0x1805f5-0x0;var _0xad4653=_0xdfb1[_0x1805f5];return _0xad4653;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var moment=require(_0x1dfb('0x2'));var BPromise=require(_0x1dfb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dfb('0x4'));var db=require(_0x1dfb('0x5'))['db'];var utils=require(_0x1dfb('0x6'));var logger=require(_0x1dfb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1dfb('0x8')][_0x1dfb('0x9')]({'port':0x232a});config[_0x1dfb('0xa')]=_['defaults'](config[_0x1dfb('0xa')],{'host':_0x1dfb('0xb'),'port':0x18eb});var socket=require(_0x1dfb('0xc'))(new Redis(config[_0x1dfb('0xa')]));require('./userProfile.socket')[_0x1dfb('0xd')](socket);function respondWithRpcPromise(_0x3e728f,_0x191d87,_0x4ea385){return new BPromise(function(_0xd747ac,_0x6a43eb){return client[_0x1dfb('0xe')](_0x3e728f,_0x4ea385)[_0x1dfb('0xf')](function(_0x3a0366){logger[_0x1dfb('0x10')](_0x1dfb('0x11'),_0x191d87,_0x1dfb('0x12'));logger[_0x1dfb('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x191d87,_0x1dfb('0x12'),JSON[_0x1dfb('0x14')](_0x3a0366));if(_0x3a0366['error']){if(_0x3a0366[_0x1dfb('0x15')][_0x1dfb('0x16')]===0x1f4){logger[_0x1dfb('0x15')]('UserProfile,\x20%s,\x20%s',_0x191d87,_0x3a0366[_0x1dfb('0x15')][_0x1dfb('0x17')]);return _0x6a43eb(_0x3a0366[_0x1dfb('0x15')]['message']);}logger[_0x1dfb('0x15')](_0x1dfb('0x11'),_0x191d87,_0x3a0366[_0x1dfb('0x15')]['message']);return _0xd747ac(_0x3a0366[_0x1dfb('0x15')][_0x1dfb('0x17')]);}else{logger[_0x1dfb('0x10')]('UserProfile,\x20%s,\x20%s',_0x191d87,'request\x20sent');_0xd747ac(_0x3a0366[_0x1dfb('0x18')][_0x1dfb('0x17')]);}})[_0x1dfb('0x19')](function(_0xce05c5){logger['error'](_0x1dfb('0x11'),_0x191d87,_0xce05c5);_0x6a43eb(_0xce05c5);});});} \ No newline at end of file +var _0x3e0c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','defaults','redis','localhost','request','then','info','request\x20sent','debug','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x5caee2,_0x325a65){var _0x3f8747=function(_0x2d86bc){while(--_0x2d86bc){_0x5caee2['push'](_0x5caee2['shift']());}};_0x3f8747(++_0x325a65);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x2a2b4,_0xcc17b){_0x2a2b4=_0x2a2b4-0x0;var _0x16bec5=_0x3e0c[_0x2a2b4];return _0x16bec5;};'use strict';var _=require(_0xc3e0('0x0'));var util=require(_0xc3e0('0x1'));var moment=require(_0xc3e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3e0('0x3'));var fs=require('fs');var Redis=require(_0xc3e0('0x4'));var db=require(_0xc3e0('0x5'))['db'];var utils=require(_0xc3e0('0x6'));var logger=require(_0xc3e0('0x7'))('rpc');var config=require(_0xc3e0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xc3e0('0x9')](config[_0xc3e0('0xa')],{'host':_0xc3e0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x433fd1,_0x33ed9c,_0xca5897){return new BPromise(function(_0x231293,_0x3f38c5){return client[_0xc3e0('0xc')](_0x433fd1,_0xca5897)[_0xc3e0('0xd')](function(_0x493aaa){logger[_0xc3e0('0xe')]('UserProfile,\x20%s,\x20%s',_0x33ed9c,_0xc3e0('0xf'));logger[_0xc3e0('0x10')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x33ed9c,_0xc3e0('0xf'),JSON['stringify'](_0x493aaa));if(_0x493aaa[_0xc3e0('0x11')]){if(_0x493aaa[_0xc3e0('0x11')][_0xc3e0('0x12')]===0x1f4){logger[_0xc3e0('0x11')](_0xc3e0('0x13'),_0x33ed9c,_0x493aaa[_0xc3e0('0x11')][_0xc3e0('0x14')]);return _0x3f38c5(_0x493aaa['error'][_0xc3e0('0x14')]);}logger[_0xc3e0('0x11')]('UserProfile,\x20%s,\x20%s',_0x33ed9c,_0x493aaa[_0xc3e0('0x11')][_0xc3e0('0x14')]);return _0x231293(_0x493aaa[_0xc3e0('0x11')][_0xc3e0('0x14')]);}else{logger[_0xc3e0('0xe')](_0xc3e0('0x13'),_0x33ed9c,_0xc3e0('0xf'));_0x231293(_0x493aaa[_0xc3e0('0x15')][_0xc3e0('0x14')]);}})[_0xc3e0('0x16')](function(_0x6b3666){logger[_0xc3e0('0x11')](_0xc3e0('0x13'),_0x33ed9c,_0x6b3666);_0x3f38c5(_0x6b3666);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 559670d..0e6f038 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 _0x21b2=['emit','removeListener','length','userProfile:','save','remove','update'];(function(_0xe721a4,_0x393102){var _0x231887=function(_0x47ce26){while(--_0x47ce26){_0xe721a4['push'](_0xe721a4['shift']());}};_0x231887(++_0x393102);}(_0x21b2,0x1bd));var _0x221b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x21b2[_0x4565bf];return _0x5610ba;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x221b('0x0'),_0x221b('0x1'),_0x221b('0x2')];function createListener(_0x3e7e0f,_0x47997d){return function(_0x5e4df9){_0x47997d[_0x221b('0x3')](_0x3e7e0f,_0x5e4df9);};}function removeListener(_0x2d2692,_0x1ccdd3){return function(){UserProfileEvents[_0x221b('0x4')](_0x2d2692,_0x1ccdd3);};}exports['register']=function(_0x479037){for(var _0x23ee9c=0x0,_0x362d51=events[_0x221b('0x5')];_0x23ee9c<_0x362d51;_0x23ee9c++){var _0x60ff58=events[_0x23ee9c];var _0x4222d0=createListener(_0x221b('0x6')+_0x60ff58,_0x479037);UserProfileEvents['on'](_0x60ff58,_0x4222d0);}}; \ No newline at end of file +var _0x4e10=['remove','removeListener','save'];(function(_0x2605a0,_0x229de5){var _0x3c9031=function(_0x319322){while(--_0x319322){_0x2605a0['push'](_0x2605a0['shift']());}};_0x3c9031(++_0x229de5);}(_0x4e10,0xfb));var _0x04e1=function(_0x534157,_0x3aa410){_0x534157=_0x534157-0x0;var _0x21aba6=_0x4e10[_0x534157];return _0x21aba6;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x04e1('0x0'),_0x04e1('0x1'),'update'];function createListener(_0x140ff6,_0x7a7c06){return function(_0x344e3e){_0x7a7c06['emit'](_0x140ff6,_0x344e3e);};}function removeListener(_0x2889f5,_0x30f5ee){return function(){UserProfileEvents[_0x04e1('0x2')](_0x2889f5,_0x30f5ee);};}exports['register']=function(_0x835fa8){for(var _0x5e91a8=0x0,_0x1a7613=events['length'];_0x5e91a8<_0x1a7613;_0x5e91a8++){var _0x4d5653=events[_0x5e91a8];var _0x2d6d1b=createListener('userProfile:'+_0x4d5653,_0x835fa8);UserProfileEvents['on'](_0x4d5653,_0x2d6d1b);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index e9f7f06..b244514 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 _0x45df=['/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get'];(function(_0x390910,_0x736e1e){var _0x5ce1ea=function(_0x1b36a7){while(--_0x1b36a7){_0x390910['push'](_0x390910['shift']());}};_0x5ce1ea(++_0x736e1e);}(_0x45df,0xdd));var _0xf45d=function(_0x38d5f7,_0x440f76){_0x38d5f7=_0x38d5f7-0x0;var _0x565610=_0x45df[_0x38d5f7];return _0x565610;};'use strict';var multer=require(_0xf45d('0x0'));var util=require(_0xf45d('0x1'));var path=require(_0xf45d('0x2'));var timeout=require(_0xf45d('0x3'));var express=require(_0xf45d('0x4'));var router=express[_0xf45d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf45d('0x6'));var interaction=require(_0xf45d('0x7'));var config=require('../../config/environment');var controller=require(_0xf45d('0x8'));router[_0xf45d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf45d('0x9')](_0xf45d('0xa'),auth[_0xf45d('0xb')](),controller['describe']);router[_0xf45d('0x9')](_0xf45d('0xc'),auth[_0xf45d('0xb')](),controller[_0xf45d('0xd')]);router[_0xf45d('0xe')]('/',auth[_0xf45d('0xb')](),controller[_0xf45d('0xf')]);router[_0xf45d('0x10')](_0xf45d('0xc'),auth[_0xf45d('0xb')](),controller[_0xf45d('0x11')]);router[_0xf45d('0x12')](_0xf45d('0xc'),auth['isAuthenticated'](),controller[_0xf45d('0x13')]);module[_0xf45d('0x14')]=router; \ No newline at end of file +var _0x7c9c=['delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/:id','show','put','update'];(function(_0x451a5d,_0x213298){var _0x1e64a7=function(_0x2f344e){while(--_0x2f344e){_0x451a5d['push'](_0x451a5d['shift']());}};_0x1e64a7(++_0x213298);}(_0x7c9c,0x93));var _0xc7c9=function(_0x31880d,_0x4f0ff3){_0x31880d=_0x31880d-0x0;var _0x423823=_0x7c9c[_0x31880d];return _0x423823;};'use strict';var multer=require('multer');var util=require(_0xc7c9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc7c9('0x1'));var router=express[_0xc7c9('0x2')]();var fs_extra=require(_0xc7c9('0x3'));var auth=require(_0xc7c9('0x4'));var interaction=require(_0xc7c9('0x5'));var config=require(_0xc7c9('0x6'));var controller=require(_0xc7c9('0x7'));router[_0xc7c9('0x8')]('/',auth[_0xc7c9('0x9')](),controller[_0xc7c9('0xa')]);router[_0xc7c9('0x8')]('/describe',auth[_0xc7c9('0x9')](),controller['describe']);router[_0xc7c9('0x8')](_0xc7c9('0xb'),auth[_0xc7c9('0x9')](),controller[_0xc7c9('0xc')]);router['post']('/',auth[_0xc7c9('0x9')](),controller['create']);router[_0xc7c9('0xd')](_0xc7c9('0xb'),auth[_0xc7c9('0x9')](),controller[_0xc7c9('0xe')]);router[_0xc7c9('0xf')]('/:id',auth[_0xc7c9('0x9')](),controller[_0xc7c9('0x10')]);module[_0xc7c9('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 a9ea9d1..8840357 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 _0xb9bb=['sequelize','exports','STRING'];(function(_0x4c4ca2,_0x30d812){var _0x17dac3=function(_0x4f07e6){while(--_0x4f07e6){_0x4c4ca2['push'](_0x4c4ca2['shift']());}};_0x17dac3(++_0x30d812);}(_0xb9bb,0x153));var _0xbb9b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb9bb[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xbb9b('0x0'));module[_0xbb9b('0x1')]={'name':{'type':Sequelize[_0xbb9b('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xbb9b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa2c9=['STRING','INTEGER','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa2c9,0x172));var _0x9a2c=function(_0x129126,_0x2098ee){_0x129126=_0x129126-0x0;var _0x1e7685=_0xa2c9[_0x129126];return _0x1e7685;};'use strict';var Sequelize=require(_0x9a2c('0x0'));module[_0x9a2c('0x1')]={'name':{'type':Sequelize[_0x9a2c('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9a2c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9a2c('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 0e2e1c4..dafbb34 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 _0x5c3c=['findAll','rows','params','merge','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','UserProfileResource','includeAll','include'];(function(_0x1fa984,_0xd5100b){var _0x3efa99=function(_0x3b239a){while(--_0x3b239a){_0x1fa984['push'](_0x1fa984['shift']());}};_0x3efa99(++_0xd5100b);}(_0x5c3c,0x132));var _0xc5c3=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x5c3c[_0x3c2a69];return _0x596bc8;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['UserProfileResource'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['UserProfileResource'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['UserProfileResource'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['UserProfileResource'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));};exports[_0xc5c3('0x49')]=function(_0x34a2c3,_0x4add6b){return db[_0xc5c3('0x3d')][_0xc5c3('0x49')]()['then'](respondWithResult(_0x4add6b,null))[_0xc5c3('0x44')](handleError(_0x4add6b,null));}; \ No newline at end of file +var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','UserProfileResource','includeAll','rows','catch','show'];(function(_0x16de43,_0x2bb75f){var _0x2aaa5d=function(_0x5d6eee){while(--_0x5d6eee){_0x16de43['push'](_0x16de43['shift']());}};_0x2aaa5d(++_0x2bb75f);}(_0x0295,0x1f0));var _0x5029=function(_0xcceb4e,_0x16b9cd){_0xcceb4e=_0xcceb4e-0x0;var _0x458bda=_0x0295[_0xcceb4e];return _0x458bda;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['UserProfileResource'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['UserProfileResource'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index eabd702..31f737f 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 _0xf7a9=['request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger'];(function(_0xed8c8,_0x4b7cca){var _0x4010ed=function(_0x21546e){while(--_0x21546e){_0xed8c8['push'](_0xed8c8['shift']());}};_0x4010ed(++_0x4b7cca);}(_0xf7a9,0xa6));var _0x9f7a=function(_0x2994a2,_0x424152){_0x2994a2=_0x2994a2-0x0;var _0x4deeeb=_0xf7a9[_0x2994a2];return _0x4deeeb;};'use strict';var _=require('lodash');var util=require(_0x9f7a('0x0'));var logger=require(_0x9f7a('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f7a('0x2'));var fs=require('fs');var path=require(_0x9f7a('0x3'));var rimraf=require(_0x9f7a('0x4'));var config=require(_0x9f7a('0x5'));var attributes=require(_0x9f7a('0x6'));module['exports']=function(_0x2105ed,_0x2ee274){return _0x2105ed[_0x9f7a('0x7')]('UserProfileResource',attributes,{'tableName':_0x9f7a('0x8'),'paranoid':![],'indexes':[{'name':_0x9f7a('0x9'),'fields':[_0x9f7a('0xa'),_0x9f7a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe1bd=['user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','UserProfileResource'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xe1bd,0xac));var _0xde1b=function(_0x2a4a35,_0x3f5ccb){_0x2a4a35=_0x2a4a35-0x0;var _0x35a706=_0xe1bd[_0x2a4a35];return _0x35a706;};'use strict';var _=require(_0xde1b('0x0'));var util=require(_0xde1b('0x1'));var logger=require(_0xde1b('0x2'))(_0xde1b('0x3'));var moment=require('moment');var BPromise=require(_0xde1b('0x4'));var rp=require(_0xde1b('0x5'));var fs=require('fs');var path=require(_0xde1b('0x6'));var rimraf=require('rimraf');var config=require(_0xde1b('0x7'));var attributes=require(_0xde1b('0x8'));module['exports']=function(_0x3e8601,_0x48b5ac){return _0x3e8601['define'](_0xde1b('0x9'),attributes,{'tableName':_0xde1b('0xa'),'paranoid':![],'indexes':[{'name':_0xde1b('0xb'),'fields':[_0xde1b('0xc'),_0xde1b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 465efc7..1246cd4 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 _0xfcf0=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x970068,_0x3e4142){var _0x51063d=function(_0x32b30e){while(--_0x32b30e){_0x970068['push'](_0x970068['shift']());}};_0x51063d(++_0x3e4142);}(_0xfcf0,0x1ad));var _0x0fcf=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0xfcf0[_0x1073ad];return _0x528474;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require(_0x0fcf('0x2'));var BPromise=require(_0x0fcf('0x3'));var rs=require(_0x0fcf('0x4'));var fs=require('fs');var Redis=require(_0x0fcf('0x5'));var db=require(_0x0fcf('0x6'))['db'];var utils=require(_0x0fcf('0x7'));var logger=require(_0x0fcf('0x8'))(_0x0fcf('0x9'));var config=require(_0x0fcf('0xa'));var jayson=require(_0x0fcf('0xb'));var client=jayson[_0x0fcf('0xc')][_0x0fcf('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x128860,_0x3dfb24,_0x893545){return new BPromise(function(_0x151bb3,_0x35b277){return client[_0x0fcf('0xe')](_0x128860,_0x893545)[_0x0fcf('0xf')](function(_0x9ebd82){logger[_0x0fcf('0x10')](_0x0fcf('0x11'),_0x3dfb24,_0x0fcf('0x12'));logger[_0x0fcf('0x13')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3dfb24,'request\x20sent',JSON[_0x0fcf('0x14')](_0x9ebd82));if(_0x9ebd82[_0x0fcf('0x15')]){if(_0x9ebd82[_0x0fcf('0x15')][_0x0fcf('0x16')]===0x1f4){logger[_0x0fcf('0x15')](_0x0fcf('0x11'),_0x3dfb24,_0x9ebd82[_0x0fcf('0x15')][_0x0fcf('0x17')]);return _0x35b277(_0x9ebd82[_0x0fcf('0x15')][_0x0fcf('0x17')]);}logger[_0x0fcf('0x15')](_0x0fcf('0x11'),_0x3dfb24,_0x9ebd82[_0x0fcf('0x15')][_0x0fcf('0x17')]);return _0x151bb3(_0x9ebd82['error']['message']);}else{logger['info'](_0x0fcf('0x11'),_0x3dfb24,_0x0fcf('0x12'));_0x151bb3(_0x9ebd82[_0x0fcf('0x18')][_0x0fcf('0x17')]);}})['catch'](function(_0x57452c){logger[_0x0fcf('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x3dfb24,_0x57452c);_0x35b277(_0x57452c);});});} \ No newline at end of file +var _0x0649=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info'];(function(_0xa42e5,_0x2228e2){var _0x36951c=function(_0x46bb32){while(--_0x46bb32){_0xa42e5['push'](_0xa42e5['shift']());}};_0x36951c(++_0x2228e2);}(_0x0649,0xc8));var _0x9064=function(_0x2d8c20,_0x3e6f43){_0x2d8c20=_0x2d8c20-0x0;var _0x211bba=_0x0649[_0x2d8c20];return _0x211bba;};'use strict';var _=require(_0x9064('0x0'));var util=require(_0x9064('0x1'));var moment=require('moment');var BPromise=require(_0x9064('0x2'));var rs=require(_0x9064('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9064('0x4'))['db'];var utils=require(_0x9064('0x5'));var logger=require(_0x9064('0x6'))(_0x9064('0x7'));var config=require(_0x9064('0x8'));var jayson=require(_0x9064('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c9067,_0x32ebda,_0x4400a0){return new BPromise(function(_0x3e8694,_0x141292){return client[_0x9064('0xa')](_0x1c9067,_0x4400a0)[_0x9064('0xb')](function(_0x23ca69){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x32ebda,_0x9064('0xc'));logger[_0x9064('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x32ebda,_0x9064('0xc'),JSON[_0x9064('0xe')](_0x23ca69));if(_0x23ca69[_0x9064('0xf')]){if(_0x23ca69[_0x9064('0xf')][_0x9064('0x10')]===0x1f4){logger[_0x9064('0xf')](_0x9064('0x11'),_0x32ebda,_0x23ca69[_0x9064('0xf')][_0x9064('0x12')]);return _0x141292(_0x23ca69[_0x9064('0xf')]['message']);}logger[_0x9064('0xf')](_0x9064('0x11'),_0x32ebda,_0x23ca69[_0x9064('0xf')][_0x9064('0x12')]);return _0x3e8694(_0x23ca69[_0x9064('0xf')]['message']);}else{logger[_0x9064('0x13')](_0x9064('0x11'),_0x32ebda,_0x9064('0xc'));_0x3e8694(_0x23ca69['result'][_0x9064('0x12')]);}})['catch'](function(_0x88277){logger[_0x9064('0xf')](_0x9064('0x11'),_0x32ebda,_0x88277);_0x141292(_0x88277);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 3e98b0d..67976a7 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 _0xea91=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','delete','/:id','util','path','connect-timeout','express','Router'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xea91,0xfb));var _0x1ea9=function(_0x19f8a3,_0x34ba71){_0x19f8a3=_0x19f8a3-0x0;var _0x1b6ee8=_0xea91[_0x19f8a3];return _0x1b6ee8;};'use strict';var multer=require('multer');var util=require(_0x1ea9('0x0'));var path=require(_0x1ea9('0x1'));var timeout=require(_0x1ea9('0x2'));var express=require(_0x1ea9('0x3'));var router=express[_0x1ea9('0x4')]();var fs_extra=require(_0x1ea9('0x5'));var auth=require(_0x1ea9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ea9('0x7'));var controller=require('./userProfileSection.controller');router[_0x1ea9('0x8')]('/',auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xa')]);router[_0x1ea9('0x8')](_0x1ea9('0xb'),auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xc')]);router[_0x1ea9('0x8')]('/:id',auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xd')]);router['post']('/',auth[_0x1ea9('0x9')](),controller['create']);router['put']('/:id',auth[_0x1ea9('0x9')](),controller['update']);router[_0x1ea9('0xe')](_0x1ea9('0xf'),auth[_0x1ea9('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1d1e=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','post','update','delete','destroy'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x1d1e,0xc7));var _0xe1d1=function(_0xac15c3,_0x2451ea){_0xac15c3=_0xac15c3-0x0;var _0x3ef3db=_0x1d1e[_0xac15c3];return _0x3ef3db;};'use strict';var multer=require('multer');var util=require(_0xe1d1('0x0'));var path=require(_0xe1d1('0x1'));var timeout=require(_0xe1d1('0x2'));var express=require(_0xe1d1('0x3'));var router=express['Router']();var fs_extra=require(_0xe1d1('0x4'));var auth=require(_0xe1d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe1d1('0x6'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0xe1d1('0x7')](),controller[_0xe1d1('0x8')]);router[_0xe1d1('0x9')](_0xe1d1('0xa'),auth[_0xe1d1('0x7')](),controller[_0xe1d1('0xb')]);router[_0xe1d1('0x9')](_0xe1d1('0xc'),auth[_0xe1d1('0x7')](),controller['show']);router[_0xe1d1('0xd')]('/',auth[_0xe1d1('0x7')](),controller['create']);router['put'](_0xe1d1('0xc'),auth[_0xe1d1('0x7')](),controller[_0xe1d1('0xe')]);router[_0xe1d1('0xf')](_0xe1d1('0xc'),auth[_0xe1d1('0x7')](),controller[_0xe1d1('0x10')]);module[_0xe1d1('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 d8bb6e6..6342fe7 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 _0xa5fa=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING'];(function(_0x1743a9,_0x4fb330){var _0x1a4feb=function(_0xb80b0){while(--_0xb80b0){_0x1743a9['push'](_0x1743a9['shift']());}};_0x1a4feb(++_0x4fb330);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x22d9d6,_0x2c9216){_0x22d9d6=_0x22d9d6-0x0;var _0x24b608=_0xa5fa[_0x22d9d6];return _0x24b608;};'use strict';var Sequelize=require('sequelize');module[_0xaa5f('0x0')]={'name':{'type':Sequelize[_0xaa5f('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xaa5f('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaa5f('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaa5f('0x1')],'set':function(_0x4d1c8b){this[_0xaa5f('0x4')](_0xaa5f('0x5'),_0x4d1c8b?_0x4d1c8b[_0xaa5f('0x6')](''):[]);},'get':function(){return this[_0xaa5f('0x7')](_0xaa5f('0x5'))?this[_0xaa5f('0x7')](_0xaa5f('0x5'))[_0xaa5f('0x8')](''):[];}}}; \ No newline at end of file +var _0xefda=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER'];(function(_0x3d0766,_0x4ab88a){var _0x42cc11=function(_0x463464){while(--_0x463464){_0x3d0766['push'](_0x3d0766['shift']());}};_0x42cc11(++_0x4ab88a);}(_0xefda,0x96));var _0xaefd=function(_0x5d5853,_0x780f4c){_0x5d5853=_0x5d5853-0x0;var _0x3584c9=_0xefda[_0x5d5853];return _0x3584c9;};'use strict';var Sequelize=require(_0xaefd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xaefd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaefd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaefd('0x1')],'set':function(_0x2ade44){this[_0xaefd('0x4')](_0xaefd('0x5'),_0x2ade44?_0x2ade44[_0xaefd('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xaefd('0x5'))?this[_0xaefd('0x7')](_0xaefd('0x5'))[_0xaefd('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 3abb921..c5a3686 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 _0x322e=['desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','update','body','params','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x322e,0xd4));var _0xe322=function(_0x1785ef,_0x580e18){_0x1785ef=_0x1785ef-0x0;var _0x11aa64=_0x322e[_0x1785ef];return _0x11aa64;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe322('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe322('0x1'));var rp=require(_0xe322('0x2'));var moment=require(_0xe322('0x3'));var BPromise=require(_0xe322('0x4'));var Mustache=require('mustache');var util=require(_0xe322('0x5'));var path=require('path');var sox=require(_0xe322('0x6'));var csv=require(_0xe322('0x7'));var ejs=require(_0xe322('0x8'));var fs=require('fs');var fs_extra=require(_0xe322('0x9'));var _=require('lodash');var squel=require(_0xe322('0xa'));var crypto=require(_0xe322('0xb'));var jsforce=require(_0xe322('0xc'));var deskjs=require(_0xe322('0xd'));var toCsv=require(_0xe322('0x7'));var querystring=require(_0xe322('0xe'));var Papa=require(_0xe322('0xf'));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(_0xe322('0x10'))(_0xe322('0x11'));var utils=require(_0xe322('0x12'));var config=require(_0xe322('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe322('0x14'))['db'];function respondWithStatusCode(_0x4c7ec5,_0x1c6b32){_0x1c6b32=_0x1c6b32||0xcc;return function(_0x34fda3){if(_0x34fda3){return _0x4c7ec5['sendStatus'](_0x1c6b32);}return _0x4c7ec5[_0xe322('0x15')](_0x1c6b32)[_0xe322('0x16')]();};}function respondWithResult(_0x4a5230,_0x4728fb){_0x4728fb=_0x4728fb||0xc8;return function(_0x2f503e){if(_0x2f503e){return _0x4a5230[_0xe322('0x15')](_0x4728fb)[_0xe322('0x17')](_0x2f503e);}};}function respondWithFilteredResult(_0x447583,_0x4ed5de){return function(_0x504a93){if(_0x504a93){var _0x3c25a0=typeof _0x4ed5de[_0xe322('0x18')]===_0xe322('0x19')&&typeof _0x4ed5de['limit']==='undefined';var _0x3fd688=_0x504a93['count'];var _0x3a484a=_0x3c25a0?0x0:_0x4ed5de[_0xe322('0x18')];var _0x1d1247=_0x3c25a0?_0x504a93[_0xe322('0x1a')]:_0x4ed5de['offset']+_0x4ed5de[_0xe322('0x1b')];var _0xf4957a;if(_0x1d1247>=_0x3fd688){_0x1d1247=_0x3fd688;_0xf4957a=0xc8;}else{_0xf4957a=0xce;}_0x447583[_0xe322('0x15')](_0xf4957a);return _0x447583[_0xe322('0x1c')](_0xe322('0x1d'),_0x3a484a+'-'+_0x1d1247+'/'+_0x3fd688)[_0xe322('0x17')](_0x504a93);}return null;};}function patchUpdates(_0x492448){return function(_0x132554){try{jsonpatch[_0xe322('0x1e')](_0x132554,_0x492448,!![]);}catch(_0x32f18d){return BPromise[_0xe322('0x1f')](_0x32f18d);}return _0x132554[_0xe322('0x20')]();};}function saveUpdates(_0x7f5f74,_0x2cb8ac){return function(_0x18eae4){if(_0x18eae4){return _0x18eae4['update'](_0x7f5f74)[_0xe322('0x21')](function(_0x12a701){return _0x12a701;});}return null;};}function removeEntity(_0xc5e196,_0x44a216){return function(_0x4017d8){if(_0x4017d8){return _0x4017d8['destroy']()[_0xe322('0x21')](function(){_0xc5e196['status'](0xcc)[_0xe322('0x16')]();});}};}function handleEntityNotFound(_0x347a99,_0x54cd4a){return function(_0x2e4770){if(!_0x2e4770){_0x347a99[_0xe322('0x22')](0x194);}return _0x2e4770;};}function handleError(_0x4e537d,_0x2bdafd){_0x2bdafd=_0x2bdafd||0x1f4;return function(_0x2076e8){logger[_0xe322('0x23')](_0x2076e8[_0xe322('0x24')]);if(_0x2076e8[_0xe322('0x25')]){delete _0x2076e8['name'];}_0x4e537d[_0xe322('0x15')](_0x2bdafd)[_0xe322('0x26')](_0x2076e8);};}exports[_0xe322('0x27')]=function(_0x1552a3,_0x2075cf){var _0x21799b={},_0x5ca8aa={},_0x5622be={'count':0x0,'rows':[]};var _0x823de8=_['map'](db[_0xe322('0x28')][_0xe322('0x29')],function(_0x4abc97){return{'name':_0x4abc97[_0xe322('0x2a')],'type':_0x4abc97['type'][_0xe322('0x2b')]};});_0x5ca8aa[_0xe322('0x2c')]=_[_0xe322('0x2d')](_0x823de8,'name');_0x5ca8aa[_0xe322('0x2e')]=_['keys'](_0x1552a3[_0xe322('0x2e')]);_0x5ca8aa[_0xe322('0x2f')]=_[_0xe322('0x30')](_0x5ca8aa[_0xe322('0x2c')],_0x5ca8aa['query']);_0x21799b['attributes']=_['intersection'](_0x5ca8aa[_0xe322('0x2c')],qs[_0xe322('0x31')](_0x1552a3[_0xe322('0x2e')]['fields']));_0x21799b[_0xe322('0x32')]=_0x21799b[_0xe322('0x32')][_0xe322('0x33')]?_0x21799b[_0xe322('0x32')]:_0x5ca8aa[_0xe322('0x2c')];if(!_0x1552a3[_0xe322('0x2e')][_0xe322('0x34')]('nolimit')){_0x21799b[_0xe322('0x1b')]=qs[_0xe322('0x1b')](_0x1552a3['query'][_0xe322('0x1b')]);_0x21799b[_0xe322('0x18')]=qs[_0xe322('0x18')](_0x1552a3[_0xe322('0x2e')]['offset']);}_0x21799b[_0xe322('0x35')]=qs[_0xe322('0x36')](_0x1552a3[_0xe322('0x2e')][_0xe322('0x36')]);_0x21799b[_0xe322('0x37')]=qs[_0xe322('0x2f')](_[_0xe322('0x38')](_0x1552a3[_0xe322('0x2e')],_0x5ca8aa['filters']),_0x823de8);if(_0x1552a3[_0xe322('0x2e')][_0xe322('0x39')]){_0x21799b[_0xe322('0x37')]=_['merge'](_0x21799b[_0xe322('0x37')],{'$or':_[_0xe322('0x2d')](_0x823de8,function(_0x1f445b){if(_0x1f445b['type']!==_0xe322('0x3a')){var _0x2b5e1d={};_0x2b5e1d[_0x1f445b[_0xe322('0x25')]]={'$like':'%'+_0x1552a3['query'][_0xe322('0x39')]+'%'};return _0x2b5e1d;}})});}_0x21799b=_[_0xe322('0x3b')]({},_0x21799b,_0x1552a3[_0xe322('0x3c')]);var _0x2ffd9a={'where':_0x21799b[_0xe322('0x37')]};return db[_0xe322('0x28')]['count'](_0x2ffd9a)[_0xe322('0x21')](function(_0x531361){_0x5622be[_0xe322('0x1a')]=_0x531361;if(_0x1552a3[_0xe322('0x2e')][_0xe322('0x3d')]){_0x21799b[_0xe322('0x3e')]=[{'all':!![]}];}return db[_0xe322('0x28')][_0xe322('0x3f')](_0x21799b);})[_0xe322('0x21')](function(_0x2bdfd0){_0x5622be[_0xe322('0x40')]=_0x2bdfd0;return _0x5622be;})['then'](respondWithFilteredResult(_0x2075cf,_0x21799b))[_0xe322('0x41')](handleError(_0x2075cf,null));};exports[_0xe322('0x42')]=function(_0x285459,_0x337830){var _0x4e3972={'raw':![],'where':{'id':_0x285459['params']['id']}},_0x189daf={};_0x189daf[_0xe322('0x2c')]=_[_0xe322('0x43')](db[_0xe322('0x28')][_0xe322('0x29')]);_0x189daf['query']=_[_0xe322('0x43')](_0x285459[_0xe322('0x2e')]);_0x189daf[_0xe322('0x2f')]=_[_0xe322('0x30')](_0x189daf[_0xe322('0x2c')],_0x189daf['query']);_0x4e3972[_0xe322('0x32')]=_[_0xe322('0x30')](_0x189daf[_0xe322('0x2c')],qs[_0xe322('0x31')](_0x285459[_0xe322('0x2e')][_0xe322('0x31')]));_0x4e3972['attributes']=_0x4e3972['attributes'][_0xe322('0x33')]?_0x4e3972['attributes']:_0x189daf[_0xe322('0x2c')];if(_0x285459[_0xe322('0x2e')]['includeAll']){_0x4e3972[_0xe322('0x3e')]=[{'all':!![]}];}_0x4e3972=_[_0xe322('0x3b')]({},_0x4e3972,_0x285459['options']);return db[_0xe322('0x28')][_0xe322('0x44')](_0x4e3972)[_0xe322('0x21')](handleEntityNotFound(_0x337830,null))[_0xe322('0x21')](respondWithResult(_0x337830,null))['catch'](handleError(_0x337830,null));};exports[_0xe322('0x45')]=function(_0x530d77,_0x2cac5b){return db[_0xe322('0x28')][_0xe322('0x45')](_0x530d77['body'],{})[_0xe322('0x21')](respondWithResult(_0x2cac5b,0xc9))['catch'](handleError(_0x2cac5b,null));};exports[_0xe322('0x46')]=function(_0x58b99f,_0x11b24f){if(_0x58b99f[_0xe322('0x47')]['id']){delete _0x58b99f[_0xe322('0x47')]['id'];}return db[_0xe322('0x28')]['find']({'where':{'id':_0x58b99f[_0xe322('0x48')]['id']}})[_0xe322('0x21')](handleEntityNotFound(_0x11b24f,null))[_0xe322('0x21')](saveUpdates(_0x58b99f[_0xe322('0x47')],null))['then'](respondWithResult(_0x11b24f,null))[_0xe322('0x41')](handleError(_0x11b24f,null));};exports[_0xe322('0x49')]=function(_0x20b0ce,_0x317390){return db['UserProfileSection'][_0xe322('0x44')]({'where':{'id':_0x20b0ce[_0xe322('0x48')]['id']}})[_0xe322('0x21')](handleEntityNotFound(_0x317390,null))[_0xe322('0x21')](removeEntity(_0x317390,null))[_0xe322('0x41')](handleError(_0x317390,null));};exports[_0xe322('0x4a')]=function(_0x37d3be,_0x311985){return db['UserProfileSection'][_0xe322('0x4a')]()['then'](respondWithResult(_0x311985,null))['catch'](handleError(_0x311985,null));}; \ No newline at end of file +var _0x0e22=['offset','set','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x344eb8,_0x5b5fd1){var _0x104c0e=function(_0x1e2592){while(--_0x1e2592){_0x344eb8['push'](_0x344eb8['shift']());}};_0x104c0e(++_0x5b5fd1);}(_0x0e22,0x78));var _0x20e2=function(_0x3e779c,_0x546ea2){_0x3e779c=_0x3e779c-0x0;var _0x22ab11=_0x0e22[_0x3e779c];return _0x22ab11;};'use strict';var emlformat=require(_0x20e2('0x0'));var rimraf=require(_0x20e2('0x1'));var zipdir=require(_0x20e2('0x2'));var jsonpatch=require(_0x20e2('0x3'));var rp=require(_0x20e2('0x4'));var moment=require(_0x20e2('0x5'));var BPromise=require(_0x20e2('0x6'));var Mustache=require(_0x20e2('0x7'));var util=require(_0x20e2('0x8'));var path=require('path');var sox=require(_0x20e2('0x9'));var csv=require(_0x20e2('0xa'));var ejs=require(_0x20e2('0xb'));var fs=require('fs');var fs_extra=require(_0x20e2('0xc'));var _=require(_0x20e2('0xd'));var squel=require('squel');var crypto=require(_0x20e2('0xe'));var jsforce=require(_0x20e2('0xf'));var deskjs=require(_0x20e2('0x10'));var toCsv=require(_0x20e2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x20e2('0x11'));var as=require(_0x20e2('0x12'));var hardwareService=require(_0x20e2('0x13'));var logger=require(_0x20e2('0x14'))('api');var utils=require(_0x20e2('0x15'));var config=require(_0x20e2('0x16'));var licenseUtil=require(_0x20e2('0x17'));var db=require(_0x20e2('0x18'))['db'];function respondWithStatusCode(_0x39d8a2,_0x428a2c){_0x428a2c=_0x428a2c||0xcc;return function(_0x3535e6){if(_0x3535e6){return _0x39d8a2[_0x20e2('0x19')](_0x428a2c);}return _0x39d8a2[_0x20e2('0x1a')](_0x428a2c)[_0x20e2('0x1b')]();};}function respondWithResult(_0x56981d,_0x152394){_0x152394=_0x152394||0xc8;return function(_0x455b27){if(_0x455b27){return _0x56981d[_0x20e2('0x1a')](_0x152394)[_0x20e2('0x1c')](_0x455b27);}};}function respondWithFilteredResult(_0xa3b029,_0xb7a80f){return function(_0x5992b6){if(_0x5992b6){var _0x38dc9f=typeof _0xb7a80f['offset']===_0x20e2('0x1d')&&typeof _0xb7a80f[_0x20e2('0x1e')]===_0x20e2('0x1d');var _0x12c52b=_0x5992b6[_0x20e2('0x1f')];var _0x441531=_0x38dc9f?0x0:_0xb7a80f[_0x20e2('0x20')];var _0x191754=_0x38dc9f?_0x5992b6['count']:_0xb7a80f[_0x20e2('0x20')]+_0xb7a80f[_0x20e2('0x1e')];var _0x13e3e1;if(_0x191754>=_0x12c52b){_0x191754=_0x12c52b;_0x13e3e1=0xc8;}else{_0x13e3e1=0xce;}_0xa3b029[_0x20e2('0x1a')](_0x13e3e1);return _0xa3b029[_0x20e2('0x21')]('Content-Range',_0x441531+'-'+_0x191754+'/'+_0x12c52b)[_0x20e2('0x1c')](_0x5992b6);}return null;};}function patchUpdates(_0xaea79d){return function(_0x2fb59a){try{jsonpatch[_0x20e2('0x22')](_0x2fb59a,_0xaea79d,!![]);}catch(_0x26645c){return BPromise['reject'](_0x26645c);}return _0x2fb59a[_0x20e2('0x23')]();};}function saveUpdates(_0x43c703,_0x1a0ef0){return function(_0x474241){if(_0x474241){return _0x474241[_0x20e2('0x24')](_0x43c703)[_0x20e2('0x25')](function(_0x52aace){return _0x52aace;});}return null;};}function removeEntity(_0x1c27f5,_0x30105d){return function(_0x7ac1fc){if(_0x7ac1fc){return _0x7ac1fc[_0x20e2('0x26')]()[_0x20e2('0x25')](function(){_0x1c27f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f981,_0x145e2c){return function(_0x513467){if(!_0x513467){_0x18f981[_0x20e2('0x19')](0x194);}return _0x513467;};}function handleError(_0x3ae16d,_0x47eddb){_0x47eddb=_0x47eddb||0x1f4;return function(_0x19f640){logger[_0x20e2('0x27')](_0x19f640[_0x20e2('0x28')]);if(_0x19f640[_0x20e2('0x29')]){delete _0x19f640[_0x20e2('0x29')];}_0x3ae16d[_0x20e2('0x1a')](_0x47eddb)[_0x20e2('0x2a')](_0x19f640);};}exports['index']=function(_0x4a8ed5,_0x3700d4){var _0x16308e={},_0x55a646={},_0x2b46ee={'count':0x0,'rows':[]};var _0x5db586=_[_0x20e2('0x2b')](db['UserProfileSection'][_0x20e2('0x2c')],function(_0x1f8357){return{'name':_0x1f8357[_0x20e2('0x2d')],'type':_0x1f8357[_0x20e2('0x2e')][_0x20e2('0x2f')]};});_0x55a646[_0x20e2('0x30')]=_['map'](_0x5db586,_0x20e2('0x29'));_0x55a646[_0x20e2('0x31')]=_[_0x20e2('0x32')](_0x4a8ed5[_0x20e2('0x31')]);_0x55a646[_0x20e2('0x33')]=_[_0x20e2('0x34')](_0x55a646[_0x20e2('0x30')],_0x55a646[_0x20e2('0x31')]);_0x16308e[_0x20e2('0x35')]=_[_0x20e2('0x34')](_0x55a646[_0x20e2('0x30')],qs[_0x20e2('0x36')](_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x36')]));_0x16308e[_0x20e2('0x35')]=_0x16308e['attributes']['length']?_0x16308e['attributes']:_0x55a646[_0x20e2('0x30')];if(!_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x37')](_0x20e2('0x38'))){_0x16308e['limit']=qs[_0x20e2('0x1e')](_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x1e')]);_0x16308e[_0x20e2('0x20')]=qs['offset'](_0x4a8ed5['query'][_0x20e2('0x20')]);}_0x16308e[_0x20e2('0x39')]=qs['sort'](_0x4a8ed5[_0x20e2('0x31')]['sort']);_0x16308e[_0x20e2('0x3a')]=qs[_0x20e2('0x33')](_[_0x20e2('0x3b')](_0x4a8ed5[_0x20e2('0x31')],_0x55a646[_0x20e2('0x33')]),_0x5db586);if(_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x3c')]){_0x16308e['where']=_[_0x20e2('0x3d')](_0x16308e[_0x20e2('0x3a')],{'$or':_[_0x20e2('0x2b')](_0x5db586,function(_0xb45ba1){if(_0xb45ba1[_0x20e2('0x2e')]!==_0x20e2('0x3e')){var _0xf4b8be={};_0xf4b8be[_0xb45ba1[_0x20e2('0x29')]]={'$like':'%'+_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x3c')]+'%'};return _0xf4b8be;}})});}_0x16308e=_[_0x20e2('0x3d')]({},_0x16308e,_0x4a8ed5[_0x20e2('0x3f')]);var _0x115d64={'where':_0x16308e[_0x20e2('0x3a')]};return db[_0x20e2('0x40')]['count'](_0x115d64)['then'](function(_0x2a31a6){_0x2b46ee[_0x20e2('0x1f')]=_0x2a31a6;if(_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x41')]){_0x16308e[_0x20e2('0x42')]=[{'all':!![]}];}return db[_0x20e2('0x40')][_0x20e2('0x43')](_0x16308e);})['then'](function(_0x3b5df9){_0x2b46ee['rows']=_0x3b5df9;return _0x2b46ee;})[_0x20e2('0x25')](respondWithFilteredResult(_0x3700d4,_0x16308e))[_0x20e2('0x44')](handleError(_0x3700d4,null));};exports[_0x20e2('0x45')]=function(_0x58ae9b,_0x59cace){var _0x3a5602={'raw':![],'where':{'id':_0x58ae9b[_0x20e2('0x46')]['id']}},_0x2429af={};_0x2429af[_0x20e2('0x30')]=_[_0x20e2('0x32')](db['UserProfileSection'][_0x20e2('0x2c')]);_0x2429af['query']=_[_0x20e2('0x32')](_0x58ae9b[_0x20e2('0x31')]);_0x2429af[_0x20e2('0x33')]=_['intersection'](_0x2429af['model'],_0x2429af[_0x20e2('0x31')]);_0x3a5602['attributes']=_['intersection'](_0x2429af[_0x20e2('0x30')],qs['fields'](_0x58ae9b[_0x20e2('0x31')][_0x20e2('0x36')]));_0x3a5602[_0x20e2('0x35')]=_0x3a5602['attributes'][_0x20e2('0x47')]?_0x3a5602[_0x20e2('0x35')]:_0x2429af['model'];if(_0x58ae9b[_0x20e2('0x31')][_0x20e2('0x41')]){_0x3a5602[_0x20e2('0x42')]=[{'all':!![]}];}_0x3a5602=_[_0x20e2('0x3d')]({},_0x3a5602,_0x58ae9b[_0x20e2('0x3f')]);return db[_0x20e2('0x40')][_0x20e2('0x48')](_0x3a5602)[_0x20e2('0x25')](handleEntityNotFound(_0x59cace,null))['then'](respondWithResult(_0x59cace,null))[_0x20e2('0x44')](handleError(_0x59cace,null));};exports['create']=function(_0x284bee,_0xb25a7){return db[_0x20e2('0x40')][_0x20e2('0x49')](_0x284bee[_0x20e2('0x4a')],{})[_0x20e2('0x25')](respondWithResult(_0xb25a7,0xc9))[_0x20e2('0x44')](handleError(_0xb25a7,null));};exports[_0x20e2('0x24')]=function(_0x4d53a6,_0x4ed95b){if(_0x4d53a6['body']['id']){delete _0x4d53a6[_0x20e2('0x4a')]['id'];}return db['UserProfileSection'][_0x20e2('0x48')]({'where':{'id':_0x4d53a6[_0x20e2('0x46')]['id']}})[_0x20e2('0x25')](handleEntityNotFound(_0x4ed95b,null))[_0x20e2('0x25')](saveUpdates(_0x4d53a6[_0x20e2('0x4a')],null))['then'](respondWithResult(_0x4ed95b,null))[_0x20e2('0x44')](handleError(_0x4ed95b,null));};exports['destroy']=function(_0x5d050c,_0x3baf3e){return db[_0x20e2('0x40')][_0x20e2('0x48')]({'where':{'id':_0x5d050c[_0x20e2('0x46')]['id']}})[_0x20e2('0x25')](handleEntityNotFound(_0x3baf3e,null))[_0x20e2('0x25')](removeEntity(_0x3baf3e,null))[_0x20e2('0x44')](handleError(_0x3baf3e,null));};exports[_0x20e2('0x4b')]=function(_0xba83cd,_0x5b0a73){return db[_0x20e2('0x40')]['describe']()[_0x20e2('0x25')](respondWithResult(_0x5b0a73,null))['catch'](handleError(_0x5b0a73,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 609fa07..c76b211 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 _0xd5df=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x353ae5,_0x43f8a4){var _0xfb392f=function(_0xdbf88){while(--_0xdbf88){_0x353ae5['push'](_0x353ae5['shift']());}};_0xfb392f(++_0x43f8a4);}(_0xd5df,0xe5));var _0xfd5d=function(_0x70f98,_0x279250){_0x70f98=_0x70f98-0x0;var _0x1c8866=_0xd5df[_0x70f98];return _0x1c8866;};'use strict';var _=require(_0xfd5d('0x0'));var util=require('util');var logger=require(_0xfd5d('0x1'))(_0xfd5d('0x2'));var moment=require(_0xfd5d('0x3'));var BPromise=require(_0xfd5d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd5d('0x5'));var rimraf=require(_0xfd5d('0x6'));var config=require(_0xfd5d('0x7'));var attributes=require(_0xfd5d('0x8'));module[_0xfd5d('0x9')]=function(_0x15f3c0,_0x3b95c5){return _0x15f3c0[_0xfd5d('0xa')](_0xfd5d('0xb'),attributes,{'tableName':_0xfd5d('0xc'),'paranoid':![],'indexes':[{'name':_0xfd5d('0xd'),'fields':[_0xfd5d('0xe'),_0xfd5d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2a5=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xf2a5,0x8f));var _0x5f2a=function(_0x193843,_0x477dd3){_0x193843=_0x193843-0x0;var _0x1b98f8=_0xf2a5[_0x193843];return _0x1b98f8;};'use strict';var _=require(_0x5f2a('0x0'));var util=require('util');var logger=require(_0x5f2a('0x1'))(_0x5f2a('0x2'));var moment=require(_0x5f2a('0x3'));var BPromise=require(_0x5f2a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f2a('0x5'));var rimraf=require(_0x5f2a('0x6'));var config=require(_0x5f2a('0x7'));var attributes=require(_0x5f2a('0x8'));module[_0x5f2a('0x9')]=function(_0x317961,_0x553b3c){return _0x317961[_0x5f2a('0xa')](_0x5f2a('0xb'),attributes,{'tableName':_0x5f2a('0xc'),'paranoid':![],'indexes':[{'name':_0x5f2a('0xd'),'fields':[_0x5f2a('0xe'),_0x5f2a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index a77c487..60bfb92 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 _0x22cf=['request','then','info','request\x20sent','debug','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x24399e,_0x106103){var _0x3777ee=function(_0x2a35e7){while(--_0x2a35e7){_0x24399e['push'](_0x24399e['shift']());}};_0x3777ee(++_0x106103);}(_0x22cf,0x8f));var _0xf22c=function(_0x43477f,_0x51a6cb){_0x43477f=_0x43477f-0x0;var _0x56ff27=_0x22cf[_0x43477f];return _0x56ff27;};'use strict';var _=require(_0xf22c('0x0'));var util=require(_0xf22c('0x1'));var moment=require(_0xf22c('0x2'));var BPromise=require(_0xf22c('0x3'));var rs=require(_0xf22c('0x4'));var fs=require('fs');var Redis=require(_0xf22c('0x5'));var db=require(_0xf22c('0x6'))['db'];var utils=require(_0xf22c('0x7'));var logger=require(_0xf22c('0x8'))('rpc');var config=require(_0xf22c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf22c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x133920,_0x3d35f7,_0xadeb7f){return new BPromise(function(_0x3c4a0b,_0x24d5ba){return client[_0xf22c('0xb')](_0x133920,_0xadeb7f)[_0xf22c('0xc')](function(_0x254bfc){logger[_0xf22c('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x3d35f7,_0xf22c('0xe'));logger[_0xf22c('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x3d35f7,'request\x20sent',JSON['stringify'](_0x254bfc));if(_0x254bfc[_0xf22c('0x10')]){if(_0x254bfc[_0xf22c('0x10')][_0xf22c('0x11')]===0x1f4){logger[_0xf22c('0x10')](_0xf22c('0x12'),_0x3d35f7,_0x254bfc[_0xf22c('0x10')][_0xf22c('0x13')]);return _0x24d5ba(_0x254bfc[_0xf22c('0x10')][_0xf22c('0x13')]);}logger['error'](_0xf22c('0x12'),_0x3d35f7,_0x254bfc[_0xf22c('0x10')][_0xf22c('0x13')]);return _0x3c4a0b(_0x254bfc[_0xf22c('0x10')][_0xf22c('0x13')]);}else{logger['info'](_0xf22c('0x12'),_0x3d35f7,'request\x20sent');_0x3c4a0b(_0x254bfc[_0xf22c('0x14')][_0xf22c('0x13')]);}})[_0xf22c('0x15')](function(_0x59de27){logger[_0xf22c('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x3d35f7,_0x59de27);_0x24d5ba(_0x59de27);});});} \ No newline at end of file +var _0x6c23=['UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x3318dd,_0x4df6b9){var _0x132195=function(_0x3e2ebb){while(--_0x3e2ebb){_0x3318dd['push'](_0x3318dd['shift']());}};_0x132195(++_0x4df6b9);}(_0x6c23,0x112));var _0x36c2=function(_0x1dad69,_0x2ae613){_0x1dad69=_0x1dad69-0x0;var _0x2aab17=_0x6c23[_0x1dad69];return _0x2aab17;};'use strict';var _=require(_0x36c2('0x0'));var util=require(_0x36c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x36c2('0x2'));var fs=require('fs');var Redis=require(_0x36c2('0x3'));var db=require(_0x36c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x36c2('0x5'));var config=require(_0x36c2('0x6'));var jayson=require(_0x36c2('0x7'));var client=jayson['client'][_0x36c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b8f1a,_0x31b297,_0x51adb4){return new BPromise(function(_0x4dff2b,_0x2cf5fa){return client['request'](_0x1b8f1a,_0x51adb4)[_0x36c2('0x9')](function(_0x384e14){logger[_0x36c2('0xa')](_0x36c2('0xb'),_0x31b297,'request\x20sent');logger['debug'](_0x36c2('0xc'),_0x31b297,_0x36c2('0xd'),JSON[_0x36c2('0xe')](_0x384e14));if(_0x384e14[_0x36c2('0xf')]){if(_0x384e14[_0x36c2('0xf')][_0x36c2('0x10')]===0x1f4){logger[_0x36c2('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x31b297,_0x384e14[_0x36c2('0xf')][_0x36c2('0x11')]);return _0x2cf5fa(_0x384e14[_0x36c2('0xf')][_0x36c2('0x11')]);}logger[_0x36c2('0xf')](_0x36c2('0xb'),_0x31b297,_0x384e14[_0x36c2('0xf')][_0x36c2('0x11')]);return _0x4dff2b(_0x384e14[_0x36c2('0xf')][_0x36c2('0x11')]);}else{logger[_0x36c2('0xa')](_0x36c2('0xb'),_0x31b297,'request\x20sent');_0x4dff2b(_0x384e14[_0x36c2('0x12')][_0x36c2('0x11')]);}})['catch'](function(_0x36ef80){logger['error'](_0x36c2('0xb'),_0x31b297,_0x36ef80);_0x2cf5fa(_0x36ef80);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 1a46920..1f34640 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x14132b,_0x232a8f){var _0x4696a1=function(_0x4f28d5){while(--_0x4f28d5){_0x14132b['push'](_0x14132b['shift']());}};_0x4696a1(++_0x232a8f);}(_0x70e0,0x17b));var _0x070e=function(_0x9fac00,_0x1f7a3f){_0x9fac00=_0x9fac00-0x0;var _0x1faac9=_0x70e0[_0x9fac00];return _0x1faac9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x25dfe3,_0x8699a8){var _0xa2ea8b=function(_0x7cbe06){while(--_0x7cbe06){_0x25dfe3['push'](_0x25dfe3['shift']());}};_0xa2ea8b(++_0x8699a8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 187aaff..d4990d0 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 _0x20a5=['sequelize','exports'];(function(_0x4b88fe,_0x139643){var _0x40138c=function(_0x77836){while(--_0x77836){_0x4b88fe['push'](_0x4b88fe['shift']());}};_0x40138c(++_0x139643);}(_0x20a5,0x122));var _0x520a=function(_0x31ad48,_0x57ac87){_0x31ad48=_0x31ad48-0x0;var _0x6dff53=_0x20a5[_0x31ad48];return _0x6dff53;};'use strict';var Sequelize=require(_0x520a('0x0'));module[_0x520a('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb695=['INTEGER'];(function(_0x3feb27,_0x349f9f){var _0x2b864e=function(_0x4229c6){while(--_0x4229c6){_0x3feb27['push'](_0x3feb27['shift']());}};_0x2b864e(++_0x349f9f);}(_0xb695,0x9b));var _0x5b69=function(_0x581db5,_0x4bbd6c){_0x581db5=_0x581db5-0x0;var _0x185479=_0xb695[_0x581db5];return _0x185479;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x5b69('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 f303c30..a9012d3 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 _0x126e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues'];(function(_0x345e5d,_0x41363b){var _0x447413=function(_0x17f45f){while(--_0x17f45f){_0x345e5d['push'](_0x345e5d['shift']());}};_0x447413(++_0x41363b);}(_0x126e,0x108));var _0xe126=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x126e[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var logger=require(_0xe126('0x1'))(_0xe126('0x2'));var moment=require(_0xe126('0x3'));var BPromise=require(_0xe126('0x4'));var rp=require(_0xe126('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe126('0x6'));var config=require(_0xe126('0x7'));var attributes=require(_0xe126('0x8'));module[_0xe126('0x9')]=function(_0x2f75a4,_0x2162bd){return _0x2f75a4[_0xe126('0xa')]('UserSmsQueue',attributes,{'tableName':_0xe126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['path','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xafc4,0x69));var _0x4afc=function(_0x3c656d,_0x5e958c){_0x3c656d=_0x3c656d-0x0;var _0x58fc7a=_0xafc4[_0x3c656d];return _0x58fc7a;};'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('./userSmsQueue.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 diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 79c4066..d31cd08 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 _0x5a32=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5a32,0x17e));var _0x25a3=function(_0x32b30e,_0x41c850){_0x32b30e=_0x32b30e-0x0;var _0x319f79=_0x5a32[_0x32b30e];return _0x319f79;};'use strict';var _=require('lodash');var util=require(_0x25a3('0x0'));var moment=require(_0x25a3('0x1'));var BPromise=require(_0x25a3('0x2'));var rs=require(_0x25a3('0x3'));var fs=require('fs');var Redis=require(_0x25a3('0x4'));var db=require(_0x25a3('0x5'))['db'];var utils=require(_0x25a3('0x6'));var logger=require(_0x25a3('0x7'))(_0x25a3('0x8'));var config=require(_0x25a3('0x9'));var jayson=require(_0x25a3('0xa'));var client=jayson[_0x25a3('0xb')][_0x25a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x271ade,_0x10c9ad,_0x54e90){return new BPromise(function(_0x4ce66a,_0x4c5475){return client['request'](_0x271ade,_0x54e90)[_0x25a3('0xd')](function(_0x1e1d6e){logger[_0x25a3('0xe')](_0x25a3('0xf'),_0x10c9ad,_0x25a3('0x10'));logger[_0x25a3('0x11')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x10c9ad,_0x25a3('0x10'),JSON[_0x25a3('0x12')](_0x1e1d6e));if(_0x1e1d6e['error']){if(_0x1e1d6e[_0x25a3('0x13')][_0x25a3('0x14')]===0x1f4){logger['error'](_0x25a3('0xf'),_0x10c9ad,_0x1e1d6e['error'][_0x25a3('0x15')]);return _0x4c5475(_0x1e1d6e[_0x25a3('0x13')][_0x25a3('0x15')]);}logger[_0x25a3('0x13')](_0x25a3('0xf'),_0x10c9ad,_0x1e1d6e['error'][_0x25a3('0x15')]);return _0x4ce66a(_0x1e1d6e[_0x25a3('0x13')][_0x25a3('0x15')]);}else{logger['info'](_0x25a3('0xf'),_0x10c9ad,_0x25a3('0x10'));_0x4ce66a(_0x1e1d6e[_0x25a3('0x16')]['message']);}})[_0x25a3('0x17')](function(_0x30b1be){logger[_0x25a3('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x10c9ad,_0x30b1be);_0x4c5475(_0x30b1be);});});} \ No newline at end of file +var _0x69f7=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x195802,_0x3edb16){var _0x3bb28f=function(_0x369d6e){while(--_0x369d6e){_0x195802['push'](_0x195802['shift']());}};_0x3bb28f(++_0x3edb16);}(_0x69f7,0x1cf));var _0x769f=function(_0x200776,_0x176cd0){_0x200776=_0x200776-0x0;var _0x5b4579=_0x69f7[_0x200776];return _0x5b4579;};'use strict';var _=require('lodash');var util=require(_0x769f('0x0'));var moment=require(_0x769f('0x1'));var BPromise=require('bluebird');var rs=require(_0x769f('0x2'));var fs=require('fs');var Redis=require(_0x769f('0x3'));var db=require(_0x769f('0x4'))['db'];var utils=require(_0x769f('0x5'));var logger=require(_0x769f('0x6'))(_0x769f('0x7'));var config=require(_0x769f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x769f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d621d,_0x335dbe,_0x465451){return new BPromise(function(_0x55526a,_0x54ad8b){return client[_0x769f('0xa')](_0x3d621d,_0x465451)['then'](function(_0x33649d){logger['info'](_0x769f('0xb'),_0x335dbe,_0x769f('0xc'));logger[_0x769f('0xd')](_0x769f('0xe'),_0x335dbe,_0x769f('0xc'),JSON[_0x769f('0xf')](_0x33649d));if(_0x33649d[_0x769f('0x10')]){if(_0x33649d[_0x769f('0x10')]['code']===0x1f4){logger['error'](_0x769f('0xb'),_0x335dbe,_0x33649d['error'][_0x769f('0x11')]);return _0x54ad8b(_0x33649d['error'][_0x769f('0x11')]);}logger[_0x769f('0x10')](_0x769f('0xb'),_0x335dbe,_0x33649d[_0x769f('0x10')][_0x769f('0x11')]);return _0x55526a(_0x33649d['error']['message']);}else{logger['info'](_0x769f('0xb'),_0x335dbe,_0x769f('0xc'));_0x55526a(_0x33649d[_0x769f('0x12')][_0x769f('0x11')]);}})[_0x769f('0x13')](function(_0x3a6cd5){logger[_0x769f('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x335dbe,_0x3a6cd5);_0x54ad8b(_0x3a6cd5);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 7944814..0ece1f8 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2df376,_0x371b9d){var _0x4e8d8f=function(_0x893814){while(--_0x893814){_0x2df376['push'](_0x2df376['shift']());}};_0x4e8d8f(++_0x371b9d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0xcb91[_0x273dc5];return _0x46dae7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x439790,_0x2f4e02){var _0x1275ab=function(_0x23eea7){while(--_0x23eea7){_0x439790['push'](_0x439790['shift']());}};_0x1275ab(++_0x2f4e02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 5e5a87e..a5d0cd3 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 _0x070c=['exports','INTEGER','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x070c,0xfb));var _0xc070=function(_0x23e776,_0x453cf4){_0x23e776=_0x23e776-0x0;var _0x52285a=_0x070c[_0x23e776];return _0x52285a;};'use strict';var Sequelize=require(_0xc070('0x0'));module[_0xc070('0x1')]={'penalty':{'type':Sequelize[_0xc070('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf66d=['exports','INTEGER','sequelize'];(function(_0x506cbe,_0x818678){var _0x4fdaa7=function(_0x28db18){while(--_0x28db18){_0x506cbe['push'](_0x506cbe['shift']());}};_0x4fdaa7(++_0x818678);}(_0xf66d,0x152));var _0xdf66=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xf66d[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0xdf66('0x0'));module[_0xdf66('0x1')]={'penalty':{'type':Sequelize[_0xdf66('0x2')],'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 dccd95e..222e29e 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 _0x8461=['../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1a4c6a,_0xb966e8){var _0x2675b1=function(_0x109be8){while(--_0x109be8){_0x1a4c6a['push'](_0x1a4c6a['shift']());}};_0x2675b1(++_0xb966e8);}(_0x8461,0x101));var _0x1846=function(_0x24b5bc,_0x2f2d50){_0x24b5bc=_0x24b5bc-0x0;var _0x3f3db7=_0x8461[_0x24b5bc];return _0x3f3db7;};'use strict';var _=require(_0x1846('0x0'));var util=require(_0x1846('0x1'));var logger=require(_0x1846('0x2'))(_0x1846('0x3'));var moment=require(_0x1846('0x4'));var BPromise=require(_0x1846('0x5'));var rp=require(_0x1846('0x6'));var fs=require('fs');var path=require(_0x1846('0x7'));var rimraf=require(_0x1846('0x8'));var config=require(_0x1846('0x9'));var attributes=require('./userVoiceQueue.attributes');module[_0x1846('0xa')]=function(_0x5d8122,_0xe1edeb){return _0x5d8122[_0x1846('0xb')](_0x1846('0xc'),attributes,{'tableName':_0x1846('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x852a=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x29a463,_0x4590ac){var _0x37e9d3=function(_0x5dc557){while(--_0x5dc557){_0x29a463['push'](_0x29a463['shift']());}};_0x37e9d3(++_0x4590ac);}(_0x852a,0x1b9));var _0xa852=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x852a[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0xa852('0x0'));var util=require(_0xa852('0x1'));var logger=require(_0xa852('0x2'))(_0xa852('0x3'));var moment=require(_0xa852('0x4'));var BPromise=require(_0xa852('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa852('0x6'));var rimraf=require(_0xa852('0x7'));var config=require(_0xa852('0x8'));var attributes=require(_0xa852('0x9'));module[_0xa852('0xa')]=function(_0x39f8d3,_0x227964){return _0x39f8d3['define'](_0xa852('0xb'),attributes,{'tableName':_0xa852('0xc'),'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 027f210..ab7851d 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 _0xf2ee=['info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2ee,0x183));var _0xef2e=function(_0x525f5e,_0x2b72c6){_0x525f5e=_0x525f5e-0x0;var _0x2f1aee=_0xf2ee[_0x525f5e];return _0x2f1aee;};'use strict';var _=require(_0xef2e('0x0'));var util=require('util');var moment=require(_0xef2e('0x1'));var BPromise=require(_0xef2e('0x2'));var rs=require(_0xef2e('0x3'));var fs=require('fs');var Redis=require(_0xef2e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xef2e('0x5'));var logger=require(_0xef2e('0x6'))(_0xef2e('0x7'));var config=require(_0xef2e('0x8'));var jayson=require(_0xef2e('0x9'));var client=jayson['client'][_0xef2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xac51ce,_0x30d5ba,_0x5d4745){return new BPromise(function(_0x38cd3d,_0x2f3ea4){return client[_0xef2e('0xb')](_0xac51ce,_0x5d4745)[_0xef2e('0xc')](function(_0x278a75){logger[_0xef2e('0xd')](_0xef2e('0xe'),_0x30d5ba,'request\x20sent');logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x30d5ba,_0xef2e('0xf'),JSON[_0xef2e('0x10')](_0x278a75));if(_0x278a75[_0xef2e('0x11')]){if(_0x278a75['error']['code']===0x1f4){logger[_0xef2e('0x11')](_0xef2e('0xe'),_0x30d5ba,_0x278a75[_0xef2e('0x11')][_0xef2e('0x12')]);return _0x2f3ea4(_0x278a75[_0xef2e('0x11')][_0xef2e('0x12')]);}logger[_0xef2e('0x11')](_0xef2e('0xe'),_0x30d5ba,_0x278a75['error'][_0xef2e('0x12')]);return _0x38cd3d(_0x278a75[_0xef2e('0x11')][_0xef2e('0x12')]);}else{logger['info'](_0xef2e('0xe'),_0x30d5ba,'request\x20sent');_0x38cd3d(_0x278a75['result'][_0xef2e('0x12')]);}})[_0xef2e('0x13')](function(_0x4b60a0){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x30d5ba,_0x4b60a0);_0x2f3ea4(_0x4b60a0);});});} \ No newline at end of file +var _0x5bf3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0xc8db78,_0x58b5a7){var _0x3483f3=function(_0x2089ee){while(--_0x2089ee){_0xc8db78['push'](_0xc8db78['shift']());}};_0x3483f3(++_0x58b5a7);}(_0x5bf3,0x1df));var _0x35bf=function(_0x4c3f4a,_0x761393){_0x4c3f4a=_0x4c3f4a-0x0;var _0x1bcec7=_0x5bf3[_0x4c3f4a];return _0x1bcec7;};'use strict';var _=require('lodash');var util=require(_0x35bf('0x0'));var moment=require(_0x35bf('0x1'));var BPromise=require(_0x35bf('0x2'));var rs=require(_0x35bf('0x3'));var fs=require('fs');var Redis=require(_0x35bf('0x4'));var db=require(_0x35bf('0x5'))['db'];var utils=require(_0x35bf('0x6'));var logger=require('../../config/logger')(_0x35bf('0x7'));var config=require(_0x35bf('0x8'));var jayson=require(_0x35bf('0x9'));var client=jayson[_0x35bf('0xa')][_0x35bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17bd55,_0x1cf571,_0x542b4f){return new BPromise(function(_0x24d5e1,_0x55e98a){return client['request'](_0x17bd55,_0x542b4f)[_0x35bf('0xc')](function(_0x4b35a3){logger[_0x35bf('0xd')](_0x35bf('0xe'),_0x1cf571,_0x35bf('0xf'));logger[_0x35bf('0x10')](_0x35bf('0x11'),_0x1cf571,_0x35bf('0xf'),JSON[_0x35bf('0x12')](_0x4b35a3));if(_0x4b35a3[_0x35bf('0x13')]){if(_0x4b35a3['error']['code']===0x1f4){logger['error'](_0x35bf('0xe'),_0x1cf571,_0x4b35a3[_0x35bf('0x13')]['message']);return _0x55e98a(_0x4b35a3['error']['message']);}logger['error'](_0x35bf('0xe'),_0x1cf571,_0x4b35a3[_0x35bf('0x13')]['message']);return _0x24d5e1(_0x4b35a3['error'][_0x35bf('0x14')]);}else{logger['info'](_0x35bf('0xe'),_0x1cf571,_0x35bf('0xf'));_0x24d5e1(_0x4b35a3[_0x35bf('0x15')][_0x35bf('0x14')]);}})[_0x35bf('0x16')](function(_0x5636a6){logger[_0x35bf('0x13')](_0x35bf('0xe'),_0x1cf571,_0x5636a6);_0x55e98a(_0x5636a6);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index d72b62d..d7f39ca 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(_0x535748,_0x539f51){var _0x3eebf3=function(_0x34fce4){while(--_0x34fce4){_0x535748['push'](_0x535748['shift']());}};_0x3eebf3(++_0x539f51);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0xcb91[_0x3a13cf];return _0x4817c;};'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(_0x21a406,_0x15fa93){var _0x4e4ae1=function(_0x364fac){while(--_0x364fac){_0x21a406['push'](_0x21a406['shift']());}};_0x4e4ae1(++_0x15fa93);}(_0xedd9,0xfc));var _0x9edd=function(_0x199451,_0x10b3d1){_0x199451=_0x199451-0x0;var _0x5aee97=_0xedd9[_0x199451];return _0x5aee97;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index d831dda..d1e1339 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 _0xfafb=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x324676,_0xca5800){var _0x366d80=function(_0x3baa7b){while(--_0x3baa7b){_0x324676['push'](_0x324676['shift']());}};_0x366d80(++_0xca5800);}(_0xfafb,0xf2));var _0xbfaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfafb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbfaf('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbfaf('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xbfaf('0x2')},'membername':{'type':Sequelize[_0xbfaf('0x3')],'allowNull':![],'comment':_0xbfaf('0x2')},'UserId':{'type':Sequelize[_0xbfaf('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xbfaf('0x3')],'allowNull':![],'unique':_0xbfaf('0x4'),'comment':_0xbfaf('0x2')},'VoiceQueueId':{'type':Sequelize[_0xbfaf('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xbfaf('0x3')],'allowNull':![],'unique':_0xbfaf('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xbfaf('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xbfaf('0x1')](0xb),'defaultValue':0x0,'comment':_0xbfaf('0x2')}}; \ No newline at end of file +var _0x72c3=['sequelize','exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface'];(function(_0x45ee03,_0x2f5319){var _0x13d535=function(_0x391904){while(--_0x391904){_0x45ee03['push'](_0x45ee03['shift']());}};_0x13d535(++_0x2f5319);}(_0x72c3,0x108));var _0x372c=function(_0xd2605b,_0x1c7cb4){_0xd2605b=_0xd2605b-0x0;var _0x58649d=_0x72c3[_0xd2605b];return _0x58649d;};'use strict';var Sequelize=require(_0x372c('0x0'));module[_0x372c('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x372c('0x2')},'membername':{'type':Sequelize[_0x372c('0x3')],'allowNull':![],'comment':_0x372c('0x2')},'UserId':{'type':Sequelize[_0x372c('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x372c('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x372c('0x2')},'VoiceQueueId':{'type':Sequelize[_0x372c('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x372c('0x3')],'allowNull':![],'unique':_0x372c('0x5'),'comment':_0x372c('0x2')},'penalty':{'type':Sequelize[_0x372c('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x372c('0x4')](0xb),'defaultValue':0x0,'comment':_0x372c('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index a7d405b..3d7e229 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 _0xc2b5=['../../mysqldb','UserVoiceQueueRt','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x22665f,_0x3386f2){var _0x49515a=function(_0x230eda){while(--_0x230eda){_0x22665f['push'](_0x22665f['shift']());}};_0x49515a(++_0x3386f2);}(_0xc2b5,0xa1));var _0x5c2b=function(_0x527ed8,_0x3ef7c1){_0x527ed8=_0x527ed8-0x0;var _0x551f3c=_0xc2b5[_0x527ed8];return _0x551f3c;};'use strict';var EventEmitter=require(_0x5c2b('0x0'));var UserVoiceQueueRt=require(_0x5c2b('0x1'))['db'][_0x5c2b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c2b('0x3'),'afterUpdate':_0x5c2b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x20d91f){return function(_0x5783e6,_0x58eded,_0x397d22){UserVoiceQueueRtEvents['emit'](_0x20d91f+':'+_0x5783e6['id'],_0x5783e6);UserVoiceQueueRtEvents[_0x5c2b('0x5')](_0x20d91f,_0x5783e6);_0x397d22(null);};}for(var e in events){if(events[_0x5c2b('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x5c2b('0x7')](e,emitEvent(event));}}module[_0x5c2b('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x5605=['exports','events','../../mysqldb','UserVoiceQueueRt','save','remove','emit','hasOwnProperty','hook'];(function(_0x286ddd,_0x5af2c6){var _0x24eff6=function(_0x45085f){while(--_0x45085f){_0x286ddd['push'](_0x286ddd['shift']());}};_0x24eff6(++_0x5af2c6);}(_0x5605,0x7f));var _0x5560=function(_0x2babe9,_0xc3e8ba){_0x2babe9=_0x2babe9-0x0;var _0x462541=_0x5605[_0x2babe9];return _0x462541;};'use strict';var EventEmitter=require(_0x5560('0x0'));var UserVoiceQueueRt=require(_0x5560('0x1'))['db'][_0x5560('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5560('0x3'),'afterUpdate':'update','afterDestroy':_0x5560('0x4')};function emitEvent(_0x47db2c){return function(_0x152af7,_0x469ceb,_0x48a9b9){UserVoiceQueueRtEvents[_0x5560('0x5')](_0x47db2c+':'+_0x152af7['id'],_0x152af7);UserVoiceQueueRtEvents[_0x5560('0x5')](_0x47db2c,_0x152af7);_0x48a9b9(null);};}for(var e in events){if(events[_0x5560('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x5560('0x7')](e,emitEvent(event));}}module[_0x5560('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 996d78c..8c6db11 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 _0x30e2=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x30e2,0x1d4));var _0x230e=function(_0x51ae7b,_0xb7a2e){_0x51ae7b=_0x51ae7b-0x0;var _0x3e5125=_0x30e2[_0x51ae7b];return _0x3e5125;};'use strict';var _=require('lodash');var util=require(_0x230e('0x0'));var logger=require(_0x230e('0x1'))(_0x230e('0x2'));var moment=require(_0x230e('0x3'));var BPromise=require(_0x230e('0x4'));var rp=require(_0x230e('0x5'));var fs=require('fs');var path=require(_0x230e('0x6'));var rimraf=require(_0x230e('0x7'));var config=require('../../config/environment');var attributes=require(_0x230e('0x8'));module[_0x230e('0x9')]=function(_0x5eb567,_0x16d847){return _0x5eb567[_0x230e('0xa')](_0x230e('0xb'),attributes,{'tableName':_0x230e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ad5=['user_has_voice_queues_rt','util','moment','bluebird','request-promise','rimraf','define','UserVoiceQueueRt'];(function(_0x20fb22,_0x210b85){var _0xdd510a=function(_0x390c50){while(--_0x390c50){_0x20fb22['push'](_0x20fb22['shift']());}};_0xdd510a(++_0x210b85);}(_0x7ad5,0x151));var _0x57ad=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x7ad5[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0x57ad('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x57ad('0x1'));var BPromise=require(_0x57ad('0x2'));var rp=require(_0x57ad('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57ad('0x4'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x519f9a,_0x2a4b02){return _0x519f9a[_0x57ad('0x5')](_0x57ad('0x6'),attributes,{'tableName':_0x57ad('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 0de241f..200054c 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 _0xd40d=['request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x66bdb7,_0x428348){var _0x1f152d=function(_0x340c52){while(--_0x340c52){_0x66bdb7['push'](_0x66bdb7['shift']());}};_0x1f152d(++_0x428348);}(_0xd40d,0x96));var _0xdd40=function(_0xb759bb,_0x409095){_0xb759bb=_0xb759bb-0x0;var _0x466205=_0xd40d[_0xb759bb];return _0x466205;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdd40('0x0'));var BPromise=require(_0xdd40('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd40('0x2'));var db=require(_0xdd40('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xdd40('0x4'));var jayson=require(_0xdd40('0x5'));var client=jayson[_0xdd40('0x6')]['http']({'port':0x232a});config['redis']=_[_0xdd40('0x7')](config[_0xdd40('0x8')],{'host':_0xdd40('0x9'),'port':0x18eb});var socket=require(_0xdd40('0xa'))(new Redis(config[_0xdd40('0x8')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x21267b,_0x3be67a,_0x2108d9){return new BPromise(function(_0x2f80f0,_0x1aa8e9){return client[_0xdd40('0xb')](_0x21267b,_0x2108d9)[_0xdd40('0xc')](function(_0x5f0e5c){logger[_0xdd40('0xd')](_0xdd40('0xe'),_0x3be67a,_0xdd40('0xf'));logger[_0xdd40('0x10')](_0xdd40('0x11'),_0x3be67a,_0xdd40('0xf'),JSON['stringify'](_0x5f0e5c));if(_0x5f0e5c[_0xdd40('0x12')]){if(_0x5f0e5c[_0xdd40('0x12')][_0xdd40('0x13')]===0x1f4){logger[_0xdd40('0x12')](_0xdd40('0xe'),_0x3be67a,_0x5f0e5c[_0xdd40('0x12')][_0xdd40('0x14')]);return _0x1aa8e9(_0x5f0e5c[_0xdd40('0x12')][_0xdd40('0x14')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3be67a,_0x5f0e5c['error'][_0xdd40('0x14')]);return _0x2f80f0(_0x5f0e5c[_0xdd40('0x12')]['message']);}else{logger[_0xdd40('0xd')](_0xdd40('0xe'),_0x3be67a,_0xdd40('0xf'));_0x2f80f0(_0x5f0e5c['result']['message']);}})[_0xdd40('0x15')](function(_0xbb9bba){logger[_0xdd40('0x12')](_0xdd40('0xe'),_0x3be67a,_0xbb9bba);_0x1aa8e9(_0xbb9bba);});});}exports[_0xdd40('0x16')]=function(_0x5b961b){var _0x4fefaa=this;return new Promise(function(_0x2bbbf3,_0x3899de){return db[_0xdd40('0x17')]['findAll']({'raw':_0x5b961b[_0xdd40('0x18')]?_0x5b961b[_0xdd40('0x18')][_0xdd40('0x19')]===undefined?!![]:![]:!![],'where':_0x5b961b[_0xdd40('0x18')]?_0x5b961b[_0xdd40('0x18')][_0xdd40('0x1a')]||null:null,'attributes':[[db[_0xdd40('0x1b')]['fn'](_0xdd40('0x1c'),db['sequelize']['fn']('IF',db[_0xdd40('0x1b')][_0xdd40('0x1d')](_0xdd40('0x1e')))),_0xdd40('0x1f')]]})[_0xdd40('0xc')](function(_0x2efc01){logger['info'](_0xdd40('0x16'),_0x5b961b);logger[_0xdd40('0x10')](_0xdd40('0x16'),_0x5b961b,JSON[_0xdd40('0x20')](_0x2efc01));_0x2bbbf3(_0x2efc01);})[_0xdd40('0x15')](function(_0x25417d){logger[_0xdd40('0x12')]('GetVoiceQueueRtPauses',_0x25417d[_0xdd40('0x14')],_0x5b961b);_0x3899de(_0x4fefaa['error'](0x1f4,_0x25417d[_0xdd40('0x14')]));});});}; \ No newline at end of file +var _0x770b=['redis','localhost','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceQueueRtPauses','findAll','options','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x427134,_0x4db288){var _0x19af84=function(_0x22e828){while(--_0x22e828){_0x427134['push'](_0x427134['shift']());}};_0x19af84(++_0x4db288);}(_0x770b,0x77));var _0xb770=function(_0x23b2b4,_0x1af875){_0x23b2b4=_0x23b2b4-0x0;var _0x4918ae=_0x770b[_0x23b2b4];return _0x4918ae;};'use strict';var _=require(_0xb770('0x0'));var util=require(_0xb770('0x1'));var moment=require(_0xb770('0x2'));var BPromise=require(_0xb770('0x3'));var rs=require(_0xb770('0x4'));var fs=require('fs');var Redis=require(_0xb770('0x5'));var db=require(_0xb770('0x6'))['db'];var utils=require(_0xb770('0x7'));var logger=require(_0xb770('0x8'))(_0xb770('0x9'));var config=require(_0xb770('0xa'));var jayson=require(_0xb770('0xb'));var client=jayson['client'][_0xb770('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb770('0xd')],{'host':_0xb770('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb770('0xf'))['register'](socket);function respondWithRpcPromise(_0x3264d8,_0x18c383,_0x5dc135){return new BPromise(function(_0x3287b3,_0x3e7bcd){return client['request'](_0x3264d8,_0x5dc135)[_0xb770('0x10')](function(_0xbb4bbf){logger[_0xb770('0x11')](_0xb770('0x12'),_0x18c383,_0xb770('0x13'));logger[_0xb770('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x18c383,_0xb770('0x13'),JSON[_0xb770('0x15')](_0xbb4bbf));if(_0xbb4bbf[_0xb770('0x16')]){if(_0xbb4bbf['error']['code']===0x1f4){logger[_0xb770('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x18c383,_0xbb4bbf[_0xb770('0x16')][_0xb770('0x17')]);return _0x3e7bcd(_0xbb4bbf[_0xb770('0x16')][_0xb770('0x17')]);}logger['error'](_0xb770('0x12'),_0x18c383,_0xbb4bbf[_0xb770('0x16')]['message']);return _0x3287b3(_0xbb4bbf[_0xb770('0x16')][_0xb770('0x17')]);}else{logger[_0xb770('0x11')](_0xb770('0x12'),_0x18c383,_0xb770('0x13'));_0x3287b3(_0xbb4bbf[_0xb770('0x18')][_0xb770('0x17')]);}})[_0xb770('0x19')](function(_0x43d0a4){logger[_0xb770('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x18c383,_0x43d0a4);_0x3e7bcd(_0x43d0a4);});});}exports[_0xb770('0x1a')]=function(_0x453f85){var _0x191a26=this;return new Promise(function(_0x4bb765,_0x4a7023){return db['UserVoiceQueueRt'][_0xb770('0x1b')]({'raw':_0x453f85[_0xb770('0x1c')]?_0x453f85[_0xb770('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x453f85['options']?_0x453f85[_0xb770('0x1c')]['where']||null:null,'attributes':[[db[_0xb770('0x1d')]['fn']('COUNT',db[_0xb770('0x1d')]['fn']('IF',db[_0xb770('0x1d')][_0xb770('0x1e')](_0xb770('0x1f')))),_0xb770('0x20')]]})[_0xb770('0x10')](function(_0x139564){logger[_0xb770('0x11')](_0xb770('0x1a'),_0x453f85);logger[_0xb770('0x14')](_0xb770('0x1a'),_0x453f85,JSON[_0xb770('0x15')](_0x139564));_0x4bb765(_0x139564);})[_0xb770('0x19')](function(_0x1e7e12){logger[_0xb770('0x16')]('GetVoiceQueueRtPauses',_0x1e7e12[_0xb770('0x17')],_0x453f85);_0x4a7023(_0x191a26['error'](0x1f4,_0x1e7e12[_0xb770('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index dd2555e..5f8d3c8 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 _0x556b=['save','remove','update','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x172252,_0x34b6ce){var _0x591ec7=function(_0x52f6b9){while(--_0x52f6b9){_0x172252['push'](_0x172252['shift']());}};_0x591ec7(++_0x34b6ce);}(_0x556b,0x1d7));var _0xb556=function(_0x264068,_0x1d7f28){_0x264068=_0x264068-0x0;var _0x51017d=_0x556b[_0x264068];return _0x51017d;};'use strict';var UserVoiceQueueRtEvents=require(_0xb556('0x0'));var events=[_0xb556('0x1'),_0xb556('0x2'),_0xb556('0x3')];function createListener(_0x3589ec,_0x5676d8){return function(_0xdc5b69){_0x5676d8[_0xb556('0x4')](_0x3589ec,_0xdc5b69);};}function removeListener(_0x4202e0,_0x30214e){return function(){UserVoiceQueueRtEvents[_0xb556('0x5')](_0x4202e0,_0x30214e);};}exports['register']=function(_0x4ee766){for(var _0x52669f=0x0,_0x18728e=events[_0xb556('0x6')];_0x52669f<_0x18728e;_0x52669f++){var _0x1cc8a1=events[_0x52669f];var _0x33508d=createListener(_0xb556('0x7')+_0x1cc8a1,_0x4ee766);UserVoiceQueueRtEvents['on'](_0x1cc8a1,_0x33508d);}}; \ No newline at end of file +var _0xdded=['register','length','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x1540a4,_0x3b1de4){var _0xc7942c=function(_0x2a2b14){while(--_0x2a2b14){_0x1540a4['push'](_0x1540a4['shift']());}};_0xc7942c(++_0x3b1de4);}(_0xdded,0x17a));var _0xddde=function(_0x507ea3,_0xf965c5){_0x507ea3=_0x507ea3-0x0;var _0x364d72=_0xdded[_0x507ea3];return _0x364d72;};'use strict';var UserVoiceQueueRtEvents=require(_0xddde('0x0'));var events=[_0xddde('0x1'),_0xddde('0x2'),_0xddde('0x3')];function createListener(_0x3f2b75,_0x9b8506){return function(_0x5cc90a){_0x9b8506[_0xddde('0x4')](_0x3f2b75,_0x5cc90a);};}function removeListener(_0x276cc6,_0x44468e){return function(){UserVoiceQueueRtEvents[_0xddde('0x5')](_0x276cc6,_0x44468e);};}exports[_0xddde('0x6')]=function(_0x39fd85){for(var _0x3c3021=0x0,_0x3cea18=events[_0xddde('0x7')];_0x3c3021<_0x3cea18;_0x3c3021++){var _0x18d8b8=events[_0x3c3021];var _0x3a5e8a=createListener('userVoiceQueueRt:'+_0x18d8b8,_0x39fd85);UserVoiceQueueRtEvents['on'](_0x18d8b8,_0x3a5e8a);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3701326..f6b1f77 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x54ab62,_0x58e021){var _0x2d71b8=function(_0x464463){while(--_0x464463){_0x54ab62['push'](_0x54ab62['shift']());}};_0x2d71b8(++_0x58e021);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4c1700,_0x2e5f79){var _0xabd509=function(_0x411f8e){while(--_0x411f8e){_0x4c1700['push'](_0x4c1700['shift']());}};_0xabd509(++_0x2e5f79);}(_0xe706,0xa3));var _0x6e70=function(_0x34145e,_0x689e31){_0x34145e=_0x34145e-0x0;var _0x27ed04=_0xe706[_0x34145e];return _0x27ed04;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 9bae65c..4b07477 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 _0xf008=['INTEGER','sequelize','exports'];(function(_0x2973c6,_0x4c6cb2){var _0x2284ff=function(_0xf6b32f){while(--_0xf6b32f){_0x2973c6['push'](_0x2973c6['shift']());}};_0x2284ff(++_0x4c6cb2);}(_0xf008,0x193));var _0x8f00=function(_0x14d0a8,_0x24b627){_0x14d0a8=_0x14d0a8-0x0;var _0x3e8a94=_0xf008[_0x14d0a8];return _0x3e8a94;};'use strict';var Sequelize=require(_0x8f00('0x0'));module[_0x8f00('0x1')]={'penalty':{'type':Sequelize[_0x8f00('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc6e6=['INTEGER','exports'];(function(_0x5038e3,_0x29855b){var _0x593c8d=function(_0x41c341){while(--_0x41c341){_0x5038e3['push'](_0x5038e3['shift']());}};_0x593c8d(++_0x29855b);}(_0xc6e6,0x113));var _0x6c6e=function(_0x3a81c2,_0x7d08dd){_0x3a81c2=_0x3a81c2-0x0;var _0x2d7eea=_0xc6e6[_0x3a81c2];return _0x2d7eea;};'use strict';var Sequelize=require('sequelize');module[_0x6c6e('0x0')]={'penalty':{'type':Sequelize[_0x6c6e('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 0353683..4b752c1 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 _0x9336=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x41ff8d,_0x2d1ce9){var _0x5bc742=function(_0x2fbe47){while(--_0x2fbe47){_0x41ff8d['push'](_0x41ff8d['shift']());}};_0x5bc742(++_0x2d1ce9);}(_0x9336,0x147));var _0x6933=function(_0x14a664,_0x526e16){_0x14a664=_0x14a664-0x0;var _0x13728e=_0x9336[_0x14a664];return _0x13728e;};'use strict';var _=require(_0x6933('0x0'));var util=require('util');var logger=require(_0x6933('0x1'))(_0x6933('0x2'));var moment=require('moment');var BPromise=require(_0x6933('0x3'));var rp=require(_0x6933('0x4'));var fs=require('fs');var path=require(_0x6933('0x5'));var rimraf=require(_0x6933('0x6'));var config=require(_0x6933('0x7'));var attributes=require(_0x6933('0x8'));module[_0x6933('0x9')]=function(_0x31fcc6,_0x1eecd1){return _0x31fcc6[_0x6933('0xa')](_0x6933('0xb'),attributes,{'tableName':_0x6933('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0766=['exports','define','UserWhatsappQueue','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x51d497,_0x25fb90){var _0x1fe078=function(_0x30545a){while(--_0x30545a){_0x51d497['push'](_0x51d497['shift']());}};_0x1fe078(++_0x25fb90);}(_0x0766,0x81));var _0x6076=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0766[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6076('0x0'));var util=require('util');var logger=require(_0x6076('0x1'))(_0x6076('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6076('0x3'));var fs=require('fs');var path=require(_0x6076('0x4'));var rimraf=require(_0x6076('0x5'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x6076('0x6')]=function(_0x5eb4b1,_0x2dfcf4){return _0x5eb4b1[_0x6076('0x7')](_0x6076('0x8'),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 2e63e53..e5632b8 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 _0xe8b7=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xe8b7,0x1a9));var _0x7e8b=function(_0x5b972d,_0x1d40d9){_0x5b972d=_0x5b972d-0x0;var _0x4e0593=_0xe8b7[_0x5b972d];return _0x4e0593;};'use strict';var _=require(_0x7e8b('0x0'));var util=require(_0x7e8b('0x1'));var moment=require(_0x7e8b('0x2'));var BPromise=require(_0x7e8b('0x3'));var rs=require(_0x7e8b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e8b('0x5'))['db'];var utils=require(_0x7e8b('0x6'));var logger=require(_0x7e8b('0x7'))(_0x7e8b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7e8b('0x9')][_0x7e8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38d53a,_0x3efe87,_0x8d9993){return new BPromise(function(_0x119c39,_0x22b7da){return client[_0x7e8b('0xb')](_0x38d53a,_0x8d9993)['then'](function(_0xed369a){logger[_0x7e8b('0xc')](_0x7e8b('0xd'),_0x3efe87,_0x7e8b('0xe'));logger[_0x7e8b('0xf')](_0x7e8b('0x10'),_0x3efe87,_0x7e8b('0xe'),JSON['stringify'](_0xed369a));if(_0xed369a['error']){if(_0xed369a['error'][_0x7e8b('0x11')]===0x1f4){logger[_0x7e8b('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3efe87,_0xed369a['error'][_0x7e8b('0x13')]);return _0x22b7da(_0xed369a[_0x7e8b('0x12')][_0x7e8b('0x13')]);}logger[_0x7e8b('0x12')](_0x7e8b('0xd'),_0x3efe87,_0xed369a[_0x7e8b('0x12')][_0x7e8b('0x13')]);return _0x119c39(_0xed369a['error'][_0x7e8b('0x13')]);}else{logger[_0x7e8b('0xc')](_0x7e8b('0xd'),_0x3efe87,_0x7e8b('0xe'));_0x119c39(_0xed369a[_0x7e8b('0x14')][_0x7e8b('0x13')]);}})[_0x7e8b('0x15')](function(_0x5ec0db){logger[_0x7e8b('0x12')](_0x7e8b('0xd'),_0x3efe87,_0x5ec0db);_0x22b7da(_0x5ec0db);});});} \ No newline at end of file +var _0x0130=['request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','UserWhatsappQueue,\x20%s,\x20%s','result','catch','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x214425,_0x41d257){var _0x268c4b=function(_0x3f52a1){while(--_0x3f52a1){_0x214425['push'](_0x214425['shift']());}};_0x268c4b(++_0x41d257);}(_0x0130,0x138));var _0x0013=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0130[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x0013('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0013('0x1'));var db=require(_0x0013('0x2'))['db'];var utils=require(_0x0013('0x3'));var logger=require('../../config/logger')(_0x0013('0x4'));var config=require(_0x0013('0x5'));var jayson=require(_0x0013('0x6'));var client=jayson[_0x0013('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x368b8f,_0x4498d1,_0x551891){return new BPromise(function(_0x3eca1a,_0x14645b){return client[_0x0013('0x8')](_0x368b8f,_0x551891)[_0x0013('0x9')](function(_0x335f51){logger[_0x0013('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4498d1,_0x0013('0xb'));logger[_0x0013('0xc')](_0x0013('0xd'),_0x4498d1,_0x0013('0xb'),JSON['stringify'](_0x335f51));if(_0x335f51[_0x0013('0xe')]){if(_0x335f51[_0x0013('0xe')]['code']===0x1f4){logger[_0x0013('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4498d1,_0x335f51[_0x0013('0xe')][_0x0013('0xf')]);return _0x14645b(_0x335f51[_0x0013('0xe')]['message']);}logger[_0x0013('0xe')](_0x0013('0x10'),_0x4498d1,_0x335f51[_0x0013('0xe')][_0x0013('0xf')]);return _0x3eca1a(_0x335f51[_0x0013('0xe')][_0x0013('0xf')]);}else{logger[_0x0013('0xa')](_0x0013('0x10'),_0x4498d1,_0x0013('0xb'));_0x3eca1a(_0x335f51[_0x0013('0x11')][_0x0013('0xf')]);}})[_0x0013('0x12')](function(_0x53717b){logger[_0x0013('0xe')](_0x0013('0x10'),_0x4498d1,_0x53717b);_0x14645b(_0x53717b);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 8db3463..2306c44 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 _0xb647=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','exports','multer','util'];(function(_0x141de6,_0x861ced){var _0x25eebd=function(_0x342fdd){while(--_0x342fdd){_0x141de6['push'](_0x141de6['shift']());}};_0x25eebd(++_0x861ced);}(_0xb647,0xdb));var _0x7b64=function(_0x1cfc6b,_0x54e241){_0x1cfc6b=_0x1cfc6b-0x0;var _0x3f5a1b=_0xb647[_0x1cfc6b];return _0x3f5a1b;};'use strict';var multer=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var path=require(_0x7b64('0x2'));var timeout=require(_0x7b64('0x3'));var express=require(_0x7b64('0x4'));var router=express[_0x7b64('0x5')]();var fs_extra=require(_0x7b64('0x6'));var auth=require(_0x7b64('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7b64('0x8'));var controller=require('./variable.controller');router[_0x7b64('0x9')]('/',auth[_0x7b64('0xa')](),controller[_0x7b64('0xb')]);router[_0x7b64('0x9')](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller[_0x7b64('0xd')]);router[_0x7b64('0xe')]('/',auth[_0x7b64('0xa')](),controller['create']);router[_0x7b64('0xf')]('/:id',auth[_0x7b64('0xa')](),controller['update']);router['delete'](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller['destroy']);module[_0x7b64('0x10')]=router; \ No newline at end of file +var _0xbacb=['index','show','post','create','put','update','delete','/:id','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x1d9f1c,_0x3ca956){var _0x496ef2=function(_0xa758d0){while(--_0xa758d0){_0x1d9f1c['push'](_0x1d9f1c['shift']());}};_0x496ef2(++_0x3ca956);}(_0xbacb,0x1a6));var _0xbbac=function(_0x143265,_0x189283){_0x143265=_0x143265-0x0;var _0x2f6259=_0xbacb[_0x143265];return _0x2f6259;};'use strict';var multer=require(_0xbbac('0x0'));var util=require(_0xbbac('0x1'));var path=require('path');var timeout=require(_0xbbac('0x2'));var express=require(_0xbbac('0x3'));var router=express[_0xbbac('0x4')]();var fs_extra=require(_0xbbac('0x5'));var auth=require(_0xbbac('0x6'));var interaction=require(_0xbbac('0x7'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0xbbac('0x8')]('/',auth[_0xbbac('0x9')](),controller[_0xbbac('0xa')]);router[_0xbbac('0x8')]('/:id',auth[_0xbbac('0x9')](),controller[_0xbbac('0xb')]);router[_0xbbac('0xc')]('/',auth[_0xbbac('0x9')](),controller[_0xbbac('0xd')]);router[_0xbbac('0xe')]('/:id',auth[_0xbbac('0x9')](),controller[_0xbbac('0xf')]);router[_0xbbac('0x10')](_0xbbac('0x11'),auth[_0xbbac('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 71736a3..baf1298 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 _0x6a1d=['sequelize','exports','STRING'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x6a1d,0xe1));var _0xd6a1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6a1d[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xd6a1('0x0'));module[_0xd6a1('0x1')]={'name':{'type':Sequelize[_0xd6a1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd6a1('0x2')]}}; \ No newline at end of file +var _0xffde=['exports','STRING','name'];(function(_0x548cca,_0x4121c2){var _0x1b58ee=function(_0x2f101d){while(--_0x2f101d){_0x548cca['push'](_0x548cca['shift']());}};_0x1b58ee(++_0x4121c2);}(_0xffde,0x9f));var _0xeffd=function(_0x49522d,_0x2d52c9){_0x49522d=_0x49522d-0x0;var _0x4ae102=_0xffde[_0x49522d];return _0x4ae102;};'use strict';var Sequelize=require('sequelize');module[_0xeffd('0x0')]={'name':{'type':Sequelize[_0xeffd('0x1')],'unique':_0xeffd('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeffd('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index d9c4085..2611282 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 _0x7935=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','error','stack','name','index','Variable','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','count','includeAll','include','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','request-promise','moment','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/logger','../../config/environment'];(function(_0x808f62,_0x1ca1e4){var _0x77297b=function(_0x2bafe7){while(--_0x2bafe7){_0x808f62['push'](_0x808f62['shift']());}};_0x77297b(++_0x1ca1e4);}(_0x7935,0xdb));var _0x5793=function(_0x59bdce,_0x32766f){_0x59bdce=_0x59bdce-0x0;var _0x17f3b6=_0x7935[_0x59bdce];return _0x17f3b6;};'use strict';var emlformat=require(_0x5793('0x0'));var rimraf=require(_0x5793('0x1'));var zipdir=require(_0x5793('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5793('0x3'));var moment=require(_0x5793('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5793('0x5'));var util=require(_0x5793('0x6'));var path=require(_0x5793('0x7'));var sox=require(_0x5793('0x8'));var csv=require(_0x5793('0x9'));var ejs=require(_0x5793('0xa'));var fs=require('fs');var fs_extra=require(_0x5793('0xb'));var _=require(_0x5793('0xc'));var squel=require(_0x5793('0xd'));var crypto=require(_0x5793('0xe'));var jsforce=require(_0x5793('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5793('0x10'));var Papa=require(_0x5793('0x11'));var Redis=require(_0x5793('0x12'));var authService=require(_0x5793('0x13'));var qs=require(_0x5793('0x14'));var as=require(_0x5793('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5793('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x5793('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5793('0x18'))['db'];function respondWithStatusCode(_0x5a26ed,_0x4230eb){_0x4230eb=_0x4230eb||0xcc;return function(_0x582601){if(_0x582601){return _0x5a26ed[_0x5793('0x19')](_0x4230eb);}return _0x5a26ed['status'](_0x4230eb)[_0x5793('0x1a')]();};}function respondWithResult(_0xb985dd,_0x13f2fe){_0x13f2fe=_0x13f2fe||0xc8;return function(_0x3819b7){if(_0x3819b7){return _0xb985dd[_0x5793('0x1b')](_0x13f2fe)[_0x5793('0x1c')](_0x3819b7);}};}function respondWithFilteredResult(_0x3dfb18,_0x308ef7){return function(_0x27cc80){if(_0x27cc80){var _0x4d90c5=typeof _0x308ef7[_0x5793('0x1d')]===_0x5793('0x1e')&&typeof _0x308ef7[_0x5793('0x1f')]===_0x5793('0x1e');var _0x4f719d=_0x27cc80['count'];var _0x2ca11a=_0x4d90c5?0x0:_0x308ef7[_0x5793('0x1d')];var _0x432a33=_0x4d90c5?_0x27cc80['count']:_0x308ef7[_0x5793('0x1d')]+_0x308ef7[_0x5793('0x1f')];var _0x55376b;if(_0x432a33>=_0x4f719d){_0x432a33=_0x4f719d;_0x55376b=0xc8;}else{_0x55376b=0xce;}_0x3dfb18[_0x5793('0x1b')](_0x55376b);return _0x3dfb18[_0x5793('0x20')](_0x5793('0x21'),_0x2ca11a+'-'+_0x432a33+'/'+_0x4f719d)[_0x5793('0x1c')](_0x27cc80);}return null;};}function patchUpdates(_0x21182d){return function(_0x35802a){try{jsonpatch[_0x5793('0x22')](_0x35802a,_0x21182d,!![]);}catch(_0x306cd4){return BPromise[_0x5793('0x23')](_0x306cd4);}return _0x35802a[_0x5793('0x24')]();};}function saveUpdates(_0x4ec2ad,_0x4e83c1){return function(_0x203985){if(_0x203985){return _0x203985[_0x5793('0x25')](_0x4ec2ad)[_0x5793('0x26')](function(_0xfcc981){return _0xfcc981;});}return null;};}function removeEntity(_0x34079e,_0x4dc9ac){return function(_0xdf38b9){if(_0xdf38b9){return _0xdf38b9[_0x5793('0x27')]()[_0x5793('0x26')](function(){var _0x102481=_0xdf38b9[_0x5793('0x28')]({'plain':!![]});var _0x134dcc=_0x5793('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x134dcc,'resourceId':_0x102481['id']}})[_0x5793('0x26')](function(){return _0xdf38b9;});})[_0x5793('0x26')](function(){_0x34079e['status'](0xcc)[_0x5793('0x1a')]();});}};}function handleEntityNotFound(_0x2801ef,_0x309f73){return function(_0x27e681){if(!_0x27e681){_0x2801ef[_0x5793('0x19')](0x194);}return _0x27e681;};}function handleError(_0x4c385e,_0x4ea2de){_0x4ea2de=_0x4ea2de||0x1f4;return function(_0x1c6e16){logger[_0x5793('0x2a')](_0x1c6e16[_0x5793('0x2b')]);if(_0x1c6e16[_0x5793('0x2c')]){delete _0x1c6e16[_0x5793('0x2c')];}_0x4c385e[_0x5793('0x1b')](_0x4ea2de)['send'](_0x1c6e16);};}exports[_0x5793('0x2d')]=function(_0x54f9ff,_0x174eed){var _0x3d098b={},_0x2bebd3={},_0x255f19={'count':0x0,'rows':[]};var _0x187668=_['map'](db[_0x5793('0x2e')][_0x5793('0x2f')],function(_0x511419){return{'name':_0x511419[_0x5793('0x30')],'type':_0x511419['type'][_0x5793('0x31')]};});_0x2bebd3[_0x5793('0x32')]=_[_0x5793('0x33')](_0x187668,_0x5793('0x2c'));_0x2bebd3[_0x5793('0x34')]=_['keys'](_0x54f9ff[_0x5793('0x34')]);_0x2bebd3[_0x5793('0x35')]=_[_0x5793('0x36')](_0x2bebd3[_0x5793('0x32')],_0x2bebd3[_0x5793('0x34')]);_0x3d098b[_0x5793('0x37')]=_[_0x5793('0x36')](_0x2bebd3[_0x5793('0x32')],qs['fields'](_0x54f9ff[_0x5793('0x34')][_0x5793('0x38')]));_0x3d098b[_0x5793('0x37')]=_0x3d098b['attributes'][_0x5793('0x39')]?_0x3d098b['attributes']:_0x2bebd3[_0x5793('0x32')];if(!_0x54f9ff[_0x5793('0x34')][_0x5793('0x3a')](_0x5793('0x3b'))){_0x3d098b[_0x5793('0x1f')]=qs['limit'](_0x54f9ff[_0x5793('0x34')]['limit']);_0x3d098b[_0x5793('0x1d')]=qs[_0x5793('0x1d')](_0x54f9ff[_0x5793('0x34')][_0x5793('0x1d')]);}_0x3d098b['order']=qs['sort'](_0x54f9ff[_0x5793('0x34')]['sort']);_0x3d098b[_0x5793('0x3c')]=qs[_0x5793('0x35')](_['pick'](_0x54f9ff['query'],_0x2bebd3[_0x5793('0x35')]),_0x187668);if(_0x54f9ff[_0x5793('0x34')][_0x5793('0x3d')]){_0x3d098b[_0x5793('0x3c')]=_[_0x5793('0x3e')](_0x3d098b['where'],{'$or':_[_0x5793('0x33')](_0x187668,function(_0x25bdfb){if(_0x25bdfb['type']!==_0x5793('0x3f')){var _0x517fe2={};_0x517fe2[_0x25bdfb[_0x5793('0x2c')]]={'$like':'%'+_0x54f9ff[_0x5793('0x34')][_0x5793('0x3d')]+'%'};return _0x517fe2;}})});}_0x3d098b=_[_0x5793('0x3e')]({},_0x3d098b,_0x54f9ff[_0x5793('0x40')]);var _0x448de5={'where':_0x3d098b[_0x5793('0x3c')]};return db['Variable']['count'](_0x448de5)['then'](function(_0x4182ce){_0x255f19[_0x5793('0x41')]=_0x4182ce;if(_0x54f9ff[_0x5793('0x34')][_0x5793('0x42')]){_0x3d098b[_0x5793('0x43')]=[{'all':!![]}];}return db[_0x5793('0x2e')]['findAll'](_0x3d098b);})[_0x5793('0x26')](function(_0x100c6b){_0x255f19['rows']=_0x100c6b;return _0x255f19;})[_0x5793('0x26')](respondWithFilteredResult(_0x174eed,_0x3d098b))[_0x5793('0x44')](handleError(_0x174eed,null));};exports[_0x5793('0x45')]=function(_0x524ad0,_0x4c2c87){var _0x381221={'raw':!![],'where':{'id':_0x524ad0[_0x5793('0x46')]['id']}},_0x4bce67={};_0x4bce67[_0x5793('0x32')]=_[_0x5793('0x47')](db[_0x5793('0x2e')][_0x5793('0x2f')]);_0x4bce67['query']=_['keys'](_0x524ad0[_0x5793('0x34')]);_0x4bce67[_0x5793('0x35')]=_['intersection'](_0x4bce67[_0x5793('0x32')],_0x4bce67['query']);_0x381221[_0x5793('0x37')]=_[_0x5793('0x36')](_0x4bce67[_0x5793('0x32')],qs[_0x5793('0x38')](_0x524ad0[_0x5793('0x34')][_0x5793('0x38')]));_0x381221[_0x5793('0x37')]=_0x381221['attributes'][_0x5793('0x39')]?_0x381221[_0x5793('0x37')]:_0x4bce67[_0x5793('0x32')];if(_0x524ad0[_0x5793('0x34')][_0x5793('0x42')]){_0x381221['include']=[{'all':!![]}];}_0x381221=_[_0x5793('0x3e')]({},_0x381221,_0x524ad0['options']);return db['Variable']['find'](_0x381221)[_0x5793('0x26')](handleEntityNotFound(_0x4c2c87,null))[_0x5793('0x26')](respondWithResult(_0x4c2c87,null))['catch'](handleError(_0x4c2c87,null));};exports[_0x5793('0x48')]=function(_0x4911be,_0x22729){return db[_0x5793('0x2e')][_0x5793('0x48')](_0x4911be[_0x5793('0x49')],{})[_0x5793('0x26')](function(_0x450fe6){var _0x2d75f8=_0x4911be[_0x5793('0x4a')][_0x5793('0x28')]({'plain':!![]});if(!_0x2d75f8)throw new Error(_0x5793('0x4b'));if(_0x2d75f8[_0x5793('0x4c')]===_0x5793('0x4a')){var _0x2ec200=_0x450fe6['get']({'plain':!![]});var _0x3f68ac=_0x5793('0x29');return db[_0x5793('0x4d')][_0x5793('0x4e')]({'where':{'name':_0x3f68ac,'userProfileId':_0x2d75f8['userProfileId']},'raw':!![]})[_0x5793('0x26')](function(_0x286780){if(_0x286780&&_0x286780[_0x5793('0x4f')]===0x0){return db[_0x5793('0x50')]['create']({'name':_0x2ec200[_0x5793('0x2c')],'resourceId':_0x2ec200['id'],'type':_0x286780[_0x5793('0x2c')],'sectionId':_0x286780['id']},{})[_0x5793('0x26')](function(){return _0x450fe6;});}else{return _0x450fe6;}})[_0x5793('0x44')](function(_0x5e28c6){logger[_0x5793('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e28c6);throw _0x5e28c6;});}return _0x450fe6;})[_0x5793('0x26')](respondWithResult(_0x22729,0xc9))[_0x5793('0x44')](handleError(_0x22729,null));};exports['update']=function(_0x47bb16,_0x94e45a){if(_0x47bb16[_0x5793('0x49')]['id']){delete _0x47bb16[_0x5793('0x49')]['id'];}return db['Variable'][_0x5793('0x4e')]({'where':{'id':_0x47bb16[_0x5793('0x46')]['id']}})[_0x5793('0x26')](handleEntityNotFound(_0x94e45a,null))[_0x5793('0x26')](saveUpdates(_0x47bb16[_0x5793('0x49')],null))['then'](respondWithResult(_0x94e45a,null))['catch'](handleError(_0x94e45a,null));};exports[_0x5793('0x27')]=function(_0x4a6f8f,_0x41cf1f){return db[_0x5793('0x2e')][_0x5793('0x4e')]({'where':{'id':_0x4a6f8f[_0x5793('0x46')]['id']}})[_0x5793('0x26')](handleEntityNotFound(_0x41cf1f,null))[_0x5793('0x26')](removeEntity(_0x41cf1f,null))[_0x5793('0x44')](handleError(_0x41cf1f,null));}; \ No newline at end of file +var _0xf193=['stack','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Variable','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','get','sendStatus'];(function(_0x4f3cf6,_0x1d8c0b){var _0x26309f=function(_0x5031c5){while(--_0x5031c5){_0x4f3cf6['push'](_0x4f3cf6['shift']());}};_0x26309f(++_0x1d8c0b);}(_0xf193,0xd9));var _0x3f19=function(_0x3ed93c,_0x9495c9){_0x3ed93c=_0x3ed93c-0x0;var _0x909ce9=_0xf193[_0x3ed93c];return _0x909ce9;};'use strict';var emlformat=require(_0x3f19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f19('0x1'));var jsonpatch=require(_0x3f19('0x2'));var rp=require(_0x3f19('0x3'));var moment=require('moment');var BPromise=require(_0x3f19('0x4'));var Mustache=require('mustache');var util=require(_0x3f19('0x5'));var path=require(_0x3f19('0x6'));var sox=require(_0x3f19('0x7'));var csv=require(_0x3f19('0x8'));var ejs=require(_0x3f19('0x9'));var fs=require('fs');var fs_extra=require(_0x3f19('0xa'));var _=require('lodash');var squel=require(_0x3f19('0xb'));var crypto=require(_0x3f19('0xc'));var jsforce=require(_0x3f19('0xd'));var deskjs=require(_0x3f19('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3f19('0xf'));var Redis=require(_0x3f19('0x10'));var authService=require(_0x3f19('0x11'));var qs=require(_0x3f19('0x12'));var as=require(_0x3f19('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f19('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3f19('0x15'));var licenseUtil=require(_0x3f19('0x16'));var db=require(_0x3f19('0x17'))['db'];function respondWithStatusCode(_0x2a54d9,_0x466318){_0x466318=_0x466318||0xcc;return function(_0x17c452){if(_0x17c452){return _0x2a54d9['sendStatus'](_0x466318);}return _0x2a54d9[_0x3f19('0x18')](_0x466318)[_0x3f19('0x19')]();};}function respondWithResult(_0x176a80,_0x5c59f1){_0x5c59f1=_0x5c59f1||0xc8;return function(_0x12d3cc){if(_0x12d3cc){return _0x176a80[_0x3f19('0x18')](_0x5c59f1)[_0x3f19('0x1a')](_0x12d3cc);}};}function respondWithFilteredResult(_0x11707d,_0x4d78c2){return function(_0x2a98e4){if(_0x2a98e4){var _0x53970b=typeof _0x4d78c2[_0x3f19('0x1b')]===_0x3f19('0x1c')&&typeof _0x4d78c2[_0x3f19('0x1d')]===_0x3f19('0x1c');var _0x5cfa28=_0x2a98e4[_0x3f19('0x1e')];var _0x58e0f8=_0x53970b?0x0:_0x4d78c2[_0x3f19('0x1b')];var _0x879ee2=_0x53970b?_0x2a98e4[_0x3f19('0x1e')]:_0x4d78c2['offset']+_0x4d78c2[_0x3f19('0x1d')];var _0x83339;if(_0x879ee2>=_0x5cfa28){_0x879ee2=_0x5cfa28;_0x83339=0xc8;}else{_0x83339=0xce;}_0x11707d[_0x3f19('0x18')](_0x83339);return _0x11707d['set'](_0x3f19('0x1f'),_0x58e0f8+'-'+_0x879ee2+'/'+_0x5cfa28)[_0x3f19('0x1a')](_0x2a98e4);}return null;};}function patchUpdates(_0x182d75){return function(_0x6e4766){try{jsonpatch['apply'](_0x6e4766,_0x182d75,!![]);}catch(_0xfd91d0){return BPromise['reject'](_0xfd91d0);}return _0x6e4766[_0x3f19('0x20')]();};}function saveUpdates(_0x2cdcc9,_0x197483){return function(_0x5145bc){if(_0x5145bc){return _0x5145bc[_0x3f19('0x21')](_0x2cdcc9)[_0x3f19('0x22')](function(_0x1b796c){return _0x1b796c;});}return null;};}function removeEntity(_0x156fd6,_0x881da8){return function(_0xc7c3b5){if(_0xc7c3b5){return _0xc7c3b5[_0x3f19('0x23')]()[_0x3f19('0x22')](function(){var _0x11192b=_0xc7c3b5[_0x3f19('0x24')]({'plain':!![]});var _0x52b95a='Variables';return db['UserProfileResource'][_0x3f19('0x23')]({'where':{'type':_0x52b95a,'resourceId':_0x11192b['id']}})[_0x3f19('0x22')](function(){return _0xc7c3b5;});})[_0x3f19('0x22')](function(){_0x156fd6[_0x3f19('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3809cf,_0x1f2b59){return function(_0x127e9b){if(!_0x127e9b){_0x3809cf[_0x3f19('0x25')](0x194);}return _0x127e9b;};}function handleError(_0x4628fc,_0x3b961e){_0x3b961e=_0x3b961e||0x1f4;return function(_0x528e1c){logger['error'](_0x528e1c[_0x3f19('0x26')]);if(_0x528e1c[_0x3f19('0x27')]){delete _0x528e1c[_0x3f19('0x27')];}_0x4628fc[_0x3f19('0x18')](_0x3b961e)[_0x3f19('0x28')](_0x528e1c);};}exports[_0x3f19('0x29')]=function(_0x264c1f,_0x223ec7){var _0x270b6d={},_0x2afb70={},_0x184320={'count':0x0,'rows':[]};var _0x17d53d=_['map'](db['Variable']['rawAttributes'],function(_0x3e9ccd){return{'name':_0x3e9ccd[_0x3f19('0x2a')],'type':_0x3e9ccd[_0x3f19('0x2b')][_0x3f19('0x2c')]};});_0x2afb70[_0x3f19('0x2d')]=_[_0x3f19('0x2e')](_0x17d53d,_0x3f19('0x27'));_0x2afb70['query']=_[_0x3f19('0x2f')](_0x264c1f[_0x3f19('0x30')]);_0x2afb70[_0x3f19('0x31')]=_[_0x3f19('0x32')](_0x2afb70[_0x3f19('0x2d')],_0x2afb70['query']);_0x270b6d[_0x3f19('0x33')]=_[_0x3f19('0x32')](_0x2afb70[_0x3f19('0x2d')],qs['fields'](_0x264c1f['query'][_0x3f19('0x34')]));_0x270b6d[_0x3f19('0x33')]=_0x270b6d[_0x3f19('0x33')][_0x3f19('0x35')]?_0x270b6d[_0x3f19('0x33')]:_0x2afb70[_0x3f19('0x2d')];if(!_0x264c1f[_0x3f19('0x30')][_0x3f19('0x36')](_0x3f19('0x37'))){_0x270b6d[_0x3f19('0x1d')]=qs[_0x3f19('0x1d')](_0x264c1f[_0x3f19('0x30')][_0x3f19('0x1d')]);_0x270b6d[_0x3f19('0x1b')]=qs[_0x3f19('0x1b')](_0x264c1f['query']['offset']);}_0x270b6d[_0x3f19('0x38')]=qs['sort'](_0x264c1f[_0x3f19('0x30')][_0x3f19('0x39')]);_0x270b6d[_0x3f19('0x3a')]=qs[_0x3f19('0x31')](_[_0x3f19('0x3b')](_0x264c1f['query'],_0x2afb70[_0x3f19('0x31')]),_0x17d53d);if(_0x264c1f[_0x3f19('0x30')][_0x3f19('0x3c')]){_0x270b6d[_0x3f19('0x3a')]=_[_0x3f19('0x3d')](_0x270b6d[_0x3f19('0x3a')],{'$or':_['map'](_0x17d53d,function(_0x526b0d){if(_0x526b0d[_0x3f19('0x2b')]!==_0x3f19('0x3e')){var _0x266be={};_0x266be[_0x526b0d[_0x3f19('0x27')]]={'$like':'%'+_0x264c1f['query']['filter']+'%'};return _0x266be;}})});}_0x270b6d=_['merge']({},_0x270b6d,_0x264c1f[_0x3f19('0x3f')]);var _0x528fb0={'where':_0x270b6d[_0x3f19('0x3a')]};return db[_0x3f19('0x40')][_0x3f19('0x1e')](_0x528fb0)[_0x3f19('0x22')](function(_0x32dd2c){_0x184320[_0x3f19('0x1e')]=_0x32dd2c;if(_0x264c1f['query']['includeAll']){_0x270b6d[_0x3f19('0x41')]=[{'all':!![]}];}return db[_0x3f19('0x40')][_0x3f19('0x42')](_0x270b6d);})[_0x3f19('0x22')](function(_0x4a4cb7){_0x184320[_0x3f19('0x43')]=_0x4a4cb7;return _0x184320;})[_0x3f19('0x22')](respondWithFilteredResult(_0x223ec7,_0x270b6d))[_0x3f19('0x44')](handleError(_0x223ec7,null));};exports[_0x3f19('0x45')]=function(_0x52c6a7,_0x4f3e19){var _0x5ea87f={'raw':!![],'where':{'id':_0x52c6a7[_0x3f19('0x46')]['id']}},_0x47b897={};_0x47b897['model']=_[_0x3f19('0x2f')](db[_0x3f19('0x40')][_0x3f19('0x47')]);_0x47b897[_0x3f19('0x30')]=_[_0x3f19('0x2f')](_0x52c6a7[_0x3f19('0x30')]);_0x47b897['filters']=_[_0x3f19('0x32')](_0x47b897[_0x3f19('0x2d')],_0x47b897['query']);_0x5ea87f[_0x3f19('0x33')]=_['intersection'](_0x47b897[_0x3f19('0x2d')],qs[_0x3f19('0x34')](_0x52c6a7['query'][_0x3f19('0x34')]));_0x5ea87f[_0x3f19('0x33')]=_0x5ea87f['attributes'][_0x3f19('0x35')]?_0x5ea87f[_0x3f19('0x33')]:_0x47b897[_0x3f19('0x2d')];if(_0x52c6a7[_0x3f19('0x30')]['includeAll']){_0x5ea87f[_0x3f19('0x41')]=[{'all':!![]}];}_0x5ea87f=_[_0x3f19('0x3d')]({},_0x5ea87f,_0x52c6a7[_0x3f19('0x3f')]);return db[_0x3f19('0x40')]['find'](_0x5ea87f)['then'](handleEntityNotFound(_0x4f3e19,null))[_0x3f19('0x22')](respondWithResult(_0x4f3e19,null))[_0x3f19('0x44')](handleError(_0x4f3e19,null));};exports[_0x3f19('0x48')]=function(_0x4b294c,_0x1420c4){return db[_0x3f19('0x40')][_0x3f19('0x48')](_0x4b294c[_0x3f19('0x49')],{})[_0x3f19('0x22')](function(_0x95c9f8){var _0x58070f=_0x4b294c[_0x3f19('0x4a')][_0x3f19('0x24')]({'plain':!![]});if(!_0x58070f)throw new Error(_0x3f19('0x4b'));if(_0x58070f[_0x3f19('0x4c')]===_0x3f19('0x4a')){var _0xcd7cea=_0x95c9f8[_0x3f19('0x24')]({'plain':!![]});var _0x5d0a6d=_0x3f19('0x4d');return db[_0x3f19('0x4e')]['find']({'where':{'name':_0x5d0a6d,'userProfileId':_0x58070f[_0x3f19('0x4f')]},'raw':!![]})['then'](function(_0x1410dd){if(_0x1410dd&&_0x1410dd[_0x3f19('0x50')]===0x0){return db[_0x3f19('0x51')][_0x3f19('0x48')]({'name':_0xcd7cea[_0x3f19('0x27')],'resourceId':_0xcd7cea['id'],'type':_0x1410dd[_0x3f19('0x27')],'sectionId':_0x1410dd['id']},{})[_0x3f19('0x22')](function(){return _0x95c9f8;});}else{return _0x95c9f8;}})['catch'](function(_0x2361ae){logger[_0x3f19('0x52')](_0x3f19('0x53'),_0x2361ae);throw _0x2361ae;});}return _0x95c9f8;})[_0x3f19('0x22')](respondWithResult(_0x1420c4,0xc9))[_0x3f19('0x44')](handleError(_0x1420c4,null));};exports[_0x3f19('0x21')]=function(_0x526a53,_0x19db66){if(_0x526a53['body']['id']){delete _0x526a53['body']['id'];}return db['Variable']['find']({'where':{'id':_0x526a53['params']['id']}})[_0x3f19('0x22')](handleEntityNotFound(_0x19db66,null))['then'](saveUpdates(_0x526a53[_0x3f19('0x49')],null))['then'](respondWithResult(_0x19db66,null))[_0x3f19('0x44')](handleError(_0x19db66,null));};exports[_0x3f19('0x23')]=function(_0x5e2e74,_0x59a735){return db['Variable'][_0x3f19('0x54')]({'where':{'id':_0x5e2e74[_0x3f19('0x46')]['id']}})[_0x3f19('0x22')](handleEntityNotFound(_0x59a735,null))['then'](removeEntity(_0x59a735,null))['catch'](handleError(_0x59a735,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index f07227c..15f3f68 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 _0xf4be=['tools_variables','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x4b964f,_0x688bee){var _0x4a8f98=function(_0x911a0d){while(--_0x911a0d){_0x4b964f['push'](_0x4b964f['shift']());}};_0x4a8f98(++_0x688bee);}(_0xf4be,0xe5));var _0xef4b=function(_0x7df7d9,_0x1c435e){_0x7df7d9=_0x7df7d9-0x0;var _0x316304=_0xf4be[_0x7df7d9];return _0x316304;};'use strict';var _=require(_0xef4b('0x0'));var util=require(_0xef4b('0x1'));var logger=require(_0xef4b('0x2'))(_0xef4b('0x3'));var moment=require(_0xef4b('0x4'));var BPromise=require(_0xef4b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef4b('0x6'));var rimraf=require(_0xef4b('0x7'));var config=require(_0xef4b('0x8'));var attributes=require('./variable.attributes');module[_0xef4b('0x9')]=function(_0x1b11bd,_0x2a486a){return _0x1b11bd[_0xef4b('0xa')]('Variable',attributes,{'tableName':_0xef4b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd48c=['./variable.attributes','define','Variable','tools_variables','util','api','bluebird','path','rimraf'];(function(_0x1a5557,_0x20000d){var _0x10e30b=function(_0x48f3cb){while(--_0x48f3cb){_0x1a5557['push'](_0x1a5557['shift']());}};_0x10e30b(++_0x20000d);}(_0xd48c,0xe5));var _0xcd48=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xd48c[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require('lodash');var util=require(_0xcd48('0x0'));var logger=require('../../config/logger')(_0xcd48('0x1'));var moment=require('moment');var BPromise=require(_0xcd48('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd48('0x3'));var rimraf=require(_0xcd48('0x4'));var config=require('../../config/environment');var attributes=require(_0xcd48('0x5'));module['exports']=function(_0x2c0452,_0x470a53){return _0x2c0452[_0xcd48('0x6')](_0xcd48('0x7'),attributes,{'tableName':_0xcd48('0x8'),'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 0401625..e2b4169 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(_0x3b1705,_0x17bf2e){var _0x5157a3=function(_0x30f700){while(--_0x30f700){_0x3b1705['push'](_0x3b1705['shift']());}};_0x5157a3(++_0x17bf2e);}(_0x3e74,0x175));var _0x43e7=function(_0x2e4f4f,_0x1d5bcb){_0x2e4f4f=_0x2e4f4f-0x0;var _0x3cad47=_0x3e74[_0x2e4f4f];return _0x3cad47;};'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 _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x48298d,_0x26cd10){var _0x58aed5=function(_0x398e23){while(--_0x398e23){_0x48298d['push'](_0x48298d['shift']());}};_0x58aed5(++_0x26cd10);}(_0xabce,0x103));var _0xeabc=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xabce[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 0a9ea8b..ef93b6c 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 _0xcf1a=['reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','./version.controller','get','index','isAuthenticated','fetch','/reset','canUpdate'];(function(_0x1c0380,_0x15175d){var _0x35ec3e=function(_0x579193){while(--_0x579193){_0x1c0380['push'](_0x1c0380['shift']());}};_0x35ec3e(++_0x15175d);}(_0xcf1a,0xc8));var _0xacf1=function(_0x5091c0,_0x10cab3){_0x5091c0=_0x5091c0-0x0;var _0x2d065f=_0xcf1a[_0x5091c0];return _0x2d065f;};'use strict';var express=require(_0xacf1('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xacf1('0x1'));router[_0xacf1('0x2')]('/',controller[_0xacf1('0x3')]);router[_0xacf1('0x2')]('/fetch',auth[_0xacf1('0x4')](),auth['canUpdate'](),controller[_0xacf1('0x5')]);router[_0xacf1('0x2')](_0xacf1('0x6'),auth['isAuthenticated'](),auth[_0xacf1('0x7')](),controller[_0xacf1('0x8')]);router[_0xacf1('0x2')](_0xacf1('0x9'),auth[_0xacf1('0x4')](),auth['canUpdate'](),controller[_0xacf1('0xa')]);router[_0xacf1('0x2')](_0xacf1('0xb'),auth[_0xacf1('0x4')](),controller[_0xacf1('0xc')]);router['get'](_0xacf1('0xd'),controller[_0xacf1('0xe')]);module[_0xacf1('0xf')]=router; \ No newline at end of file +var _0x6a67=['express','Router','../../components/auth/service','index','get','isAuthenticated','/reset','reset','/pull','canUpdate','pull','migrations'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x6a67,0x1e0));var _0x76a6=function(_0xe06071,_0x4eeaa1){_0xe06071=_0xe06071-0x0;var _0x8ad8be=_0x6a67[_0xe06071];return _0x8ad8be;};'use strict';var express=require(_0x76a6('0x0'));var router=express[_0x76a6('0x1')]();var auth=require(_0x76a6('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0x76a6('0x3')]);router[_0x76a6('0x4')]('/fetch',auth[_0x76a6('0x5')](),auth['canUpdate'](),controller['fetch']);router[_0x76a6('0x4')](_0x76a6('0x6'),auth[_0x76a6('0x5')](),auth['canUpdate'](),controller[_0x76a6('0x7')]);router[_0x76a6('0x4')](_0x76a6('0x8'),auth['isAuthenticated'](),auth[_0x76a6('0x9')](),controller[_0x76a6('0xa')]);router['get']('/restart',auth[_0x76a6('0x5')](),controller['restart']);router[_0x76a6('0x4')]('/migrations',controller[_0x76a6('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index d3abd20..3af25cb 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 _0xf87a=['compare-versions','exec','../../mysqldb','../../config/pm2','root','index','exports','query','latest','fetch','status','json','origin','error','info','git\x20fetch','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','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.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version'];(function(_0xafd776,_0x4ed97d){var _0x52e1e6=function(_0x364831){while(--_0x364831){_0xafd776['push'](_0xafd776['shift']());}};_0x52e1e6(++_0x4ed97d);}(_0xf87a,0x15a));var _0xaf87=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf87a[_0x502c7d];return _0x30b7ed;};'use strict';var Umzug=require(_0xaf87('0x0'));var path=require(_0xaf87('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xaf87('0x2'))(module,_0xaf87('0x3'));var compareVersions=require(_0xaf87('0x4'));var exec=require('child_process')[_0xaf87('0x5')];var db=require(_0xaf87('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xaf87('0x7'));var logger=require('../../config/logger')('update');var git=require('simple-git')(config[_0xaf87('0x8')]);exports[_0xaf87('0x9')]=function(_0x447608,_0x43ece2){var _0x33431b={'current':module[_0xaf87('0xa')][_0xaf87('0x3')],'phonebar':0x2};if(_0x447608[_0xaf87('0xb')]&&_0x447608[_0xaf87('0xb')][_0xaf87('0xc')]){return git[_0xaf87('0xd')]()['tags'](function(_0x2a803d,_0x346ee7){_0x33431b[_0xaf87('0xc')]=(_0x2a803d?module[_0xaf87('0xa')][_0xaf87('0x3')]:_0x346ee7[_0xaf87('0xc')])||'2.0.0';return _0x43ece2[_0xaf87('0xe')](0xc8)['json'](_0x33431b);});}else{return _0x43ece2[_0xaf87('0xe')](0xc8)[_0xaf87('0xf')](_0x33431b);}};exports[_0xaf87('0xd')]=function(_0x488f1f,_0x5cdd1c){return git['fetch']([_0xaf87('0x10'),'master'],function(_0x58a371){if(_0x58a371){logger[_0xaf87('0x11')](_0x58a371);return _0x5cdd1c[_0xaf87('0xe')](0x1f4)[_0xaf87('0xf')](_0x58a371);}logger[_0xaf87('0x12')](_0xaf87('0x13'));return _0x5cdd1c[_0xaf87('0xe')](0xc8)[_0xaf87('0xf')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xaf87('0x14')]=function(_0xe9f6e3,_0x5e5015){return git[_0xaf87('0x14')]([_0xaf87('0x15'),'FETCH_HEAD'],function(_0x14bd6d){if(_0x14bd6d){logger[_0xaf87('0x11')](_0x14bd6d);return _0x5e5015[_0xaf87('0xe')](0x1f4)[_0xaf87('0xf')](_0x14bd6d);}logger[_0xaf87('0x12')](_0xaf87('0x16'));return _0x5e5015[_0xaf87('0xe')](0xc8)[_0xaf87('0xf')]({'output':'git\x20reset\x20--hard'});});};exports[_0xaf87('0x17')]=function(_0x58eddd,_0x14f497){exec(_0xaf87('0x18'),function(_0x211d15,_0x589af6,_0x541d08){logger['info'](_0x589af6);logger[_0xaf87('0x12')](_0x541d08);if(_0x211d15){logger[_0xaf87('0x11')](_0x211d15);return _0x14f497['status'](0x1f4)[_0xaf87('0xf')](_0x211d15);}return _0x14f497[_0xaf87('0xe')](0xc8)['json']({'output':_0x589af6});});};exports[_0xaf87('0x19')]=function(_0x46c054,_0x437cf8){return pm2[_0xaf87('0x19')](_0xaf87('0x1a'))[_0xaf87('0x1b')](function(_0xa4019c){logger[_0xaf87('0x12')](_0xaf87('0x1c'),_0xa4019c);return _0x437cf8[_0xaf87('0xe')](0xc8)[_0xaf87('0xf')]({'output':_0xaf87('0x1d')});})[_0xaf87('0x1e')](function(_0x405670){logger[_0xaf87('0x11')](_0x405670);return _0x437cf8[_0xaf87('0xe')](0x1f4)[_0xaf87('0xf')](_0x405670);});};exports[_0xaf87('0x1f')]=function(_0x1f3878,_0x481c76){var _0x54cf24=fs[_0xaf87('0x20')](path[_0xaf87('0x21')](config[_0xaf87('0x8')],_0xaf87('0x22'),'migrations'));var _0x25fb54=[];for(var _0x3affd5=0x0;_0x3affd5<_0x54cf24[_0xaf87('0x23')];_0x3affd5++){var _0xbabf6e=_0x54cf24[_0x3affd5][_0xaf87('0x24')](_0xaf87('0x25'),'');if(compareVersions(module[_0xaf87('0xa')]['version'],_0xbabf6e)===-0x1){_0x25fb54['push'](_0xbabf6e);}}if(_0x25fb54[_0xaf87('0x23')]){var _0x7dc2ae=_0x25fb54[_0xaf87('0x26')](compareVersions);var _0x440e09=new Umzug({'storage':_0xaf87('0x27'),'storageOptions':{'model':db[_0xaf87('0x28')],'modelName':_0xaf87('0x28'),'columnName':'version'},'migrations':{'params':[db[_0xaf87('0x27')][_0xaf87('0x29')](),db[_0xaf87('0x27')][_0xaf87('0x2a')],function(){throw new Error(_0xaf87('0x2b'));}],'path':path[_0xaf87('0x21')](config[_0xaf87('0x8')],_0xaf87('0x22'),_0xaf87('0x1f')),'pattern':/\.js$/}});_0x440e09['up']({'migrations':_[_0xaf87('0x2c')](_0x7dc2ae,function(_0x315b29){return _0x315b29+_0xaf87('0x25');})})[_0xaf87('0x1b')](function(){return _0x481c76[_0xaf87('0xe')](0xc8)['json']({'output':_0xaf87('0x2d')+module[_0xaf87('0xa')][_0xaf87('0x3')]+_0xaf87('0x2e')+_[_0xaf87('0x2f')](_0x7dc2ae),'migrations':_[_0xaf87('0x21')](_0x7dc2ae)});})[_0xaf87('0x1e')](function(_0x342bb6){if(_0x342bb6 instanceof db[_0xaf87('0x27')][_0xaf87('0x30')]){return _0x481c76[_0xaf87('0xe')](0xc8)[_0xaf87('0xf')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x481c76['status'](0x1f4)[_0xaf87('0xf')](_0x342bb6);}});}else{return _0x481c76['status'](0xc8)[_0xaf87('0xf')]({'output':_0xaf87('0x31')});}}; \ No newline at end of file +var _0x67e0=['push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','exports','query','tags','latest','2.0.0','status','json','fetch','origin','master','error','info','git\x20fetch','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','server','length','replace'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x67e0,0xea));var _0x067e=function(_0x4dbc5d,_0x2d0a51){_0x4dbc5d=_0x4dbc5d-0x0;var _0x45b461=_0x67e0[_0x4dbc5d];return _0x45b461;};'use strict';var Umzug=require(_0x067e('0x0'));var path=require(_0x067e('0x1'));var fs=require('fs');var _=require(_0x067e('0x2'));var pkginfo=require(_0x067e('0x3'))(module,_0x067e('0x4'));var compareVersions=require(_0x067e('0x5'));var exec=require(_0x067e('0x6'))[_0x067e('0x7')];var db=require(_0x067e('0x8'))['db'];var config=require(_0x067e('0x9'));var pm2=require(_0x067e('0xa'));var logger=require(_0x067e('0xb'))('update');var git=require(_0x067e('0xc'))(config[_0x067e('0xd')]);exports['index']=function(_0x515f13,_0x30f12c){var _0x140881={'current':module[_0x067e('0xe')][_0x067e('0x4')],'phonebar':0x2};if(_0x515f13[_0x067e('0xf')]&&_0x515f13[_0x067e('0xf')]['latest']){return git['fetch']()[_0x067e('0x10')](function(_0x3db81c,_0x1f59dc){_0x140881[_0x067e('0x11')]=(_0x3db81c?module['exports']['version']:_0x1f59dc['latest'])||_0x067e('0x12');return _0x30f12c[_0x067e('0x13')](0xc8)[_0x067e('0x14')](_0x140881);});}else{return _0x30f12c[_0x067e('0x13')](0xc8)['json'](_0x140881);}};exports[_0x067e('0x15')]=function(_0xab70e0,_0x1cf601){return git['fetch']([_0x067e('0x16'),_0x067e('0x17')],function(_0x41580f){if(_0x41580f){logger[_0x067e('0x18')](_0x41580f);return _0x1cf601['status'](0x1f4)['json'](_0x41580f);}logger[_0x067e('0x19')](_0x067e('0x1a'));return _0x1cf601[_0x067e('0x13')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x15b0a8,_0x39713a){return git['reset']([_0x067e('0x1b'),_0x067e('0x1c')],function(_0x2f65ff){if(_0x2f65ff){logger[_0x067e('0x18')](_0x2f65ff);return _0x39713a[_0x067e('0x13')](0x1f4)[_0x067e('0x14')](_0x2f65ff);}logger[_0x067e('0x19')](_0x067e('0x1d'));return _0x39713a[_0x067e('0x13')](0xc8)['json']({'output':_0x067e('0x1e')});});};exports[_0x067e('0x1f')]=function(_0x588228,_0xba1480){exec(_0x067e('0x20'),function(_0x370caa,_0x5b28fe,_0x490170){logger['info'](_0x5b28fe);logger['info'](_0x490170);if(_0x370caa){logger[_0x067e('0x18')](_0x370caa);return _0xba1480[_0x067e('0x13')](0x1f4)['json'](_0x370caa);}return _0xba1480[_0x067e('0x13')](0xc8)[_0x067e('0x14')]({'output':_0x5b28fe});});};exports[_0x067e('0x21')]=function(_0x48b385,_0x559f9f){return pm2[_0x067e('0x21')]('motion2')[_0x067e('0x22')](function(_0x569873){logger[_0x067e('0x19')](_0x067e('0x23'),_0x569873);return _0x559f9f[_0x067e('0x13')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x067e('0x24')](function(_0x51628c){logger['error'](_0x51628c);return _0x559f9f['status'](0x1f4)[_0x067e('0x14')](_0x51628c);});};exports[_0x067e('0x25')]=function(_0x2301ff,_0x2513d1){var _0xc60ef3=fs['readdirSync'](path['join'](config['root'],_0x067e('0x26'),_0x067e('0x25')));var _0x4afc61=[];for(var _0x5ad533=0x0;_0x5ad533<_0xc60ef3[_0x067e('0x27')];_0x5ad533++){var _0x2bee20=_0xc60ef3[_0x5ad533][_0x067e('0x28')]('.js','');if(compareVersions(module['exports'][_0x067e('0x4')],_0x2bee20)===-0x1){_0x4afc61[_0x067e('0x29')](_0x2bee20);}}if(_0x4afc61[_0x067e('0x27')]){var _0xc72bc3=_0x4afc61[_0x067e('0x2a')](compareVersions);var _0x2eb223=new Umzug({'storage':_0x067e('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0x067e('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x067e('0x2b')][_0x067e('0x2d')](),db['sequelize'][_0x067e('0x2e')],function(){throw new Error(_0x067e('0x2f'));}],'path':path[_0x067e('0x30')](config['root'],_0x067e('0x26'),_0x067e('0x25')),'pattern':/\.js$/}});_0x2eb223['up']({'migrations':_[_0x067e('0x31')](_0xc72bc3,function(_0x1a0e69){return _0x1a0e69+_0x067e('0x32');})})['then'](function(){return _0x2513d1['status'](0xc8)[_0x067e('0x14')]({'output':_0x067e('0x33')+module[_0x067e('0xe')][_0x067e('0x4')]+'\x20to\x20'+_[_0x067e('0x34')](_0xc72bc3),'migrations':_[_0x067e('0x30')](_0xc72bc3)});})[_0x067e('0x24')](function(_0x31acc0){if(_0x31acc0 instanceof db[_0x067e('0x2b')][_0x067e('0x35')]){return _0x2513d1['status'](0xc8)['json']({'output':_0x067e('0x36')});}else{return _0x2513d1['status'](0x1f4)[_0x067e('0x14')](_0x31acc0);}});}else{return _0x2513d1[_0x067e('0x13')](0xc8)[_0x067e('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 67370f4..f284942 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 _0xec48=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','util','path','express','Router'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xec48,0x7a));var _0x8ec4=function(_0x1d760b,_0x47f9fe){_0x1d760b=_0x1d760b-0x0;var _0x18fb17=_0xec48[_0x1d760b];return _0x18fb17;};'use strict';var multer=require('multer');var util=require(_0x8ec4('0x0'));var path=require(_0x8ec4('0x1'));var timeout=require('connect-timeout');var express=require(_0x8ec4('0x2'));var router=express[_0x8ec4('0x3')]();var fs_extra=require(_0x8ec4('0x4'));var auth=require(_0x8ec4('0x5'));var interaction=require(_0x8ec4('0x6'));var config=require('../../config/environment');var controller=require(_0x8ec4('0x7'));router['get']('/',auth[_0x8ec4('0x8')](),controller[_0x8ec4('0x9')]);router[_0x8ec4('0xa')](_0x8ec4('0xb'),auth['isAuthenticated'](),controller[_0x8ec4('0xc')]);router[_0x8ec4('0xa')](_0x8ec4('0xd'),auth[_0x8ec4('0x8')](),controller[_0x8ec4('0xe')]);router[_0x8ec4('0xf')]('/',auth[_0x8ec4('0x8')](),controller[_0x8ec4('0x10')]);router[_0x8ec4('0x11')](_0x8ec4('0xd'),auth[_0x8ec4('0x8')](),controller[_0x8ec4('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8ec4('0x13')]);module[_0x8ec4('0x14')]=router; \ No newline at end of file +var _0x7950=['/:id','update','delete','exports','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put'];(function(_0x2da223,_0x4ecf9a){var _0x1fd244=function(_0x3deb7a){while(--_0x3deb7a){_0x2da223['push'](_0x2da223['shift']());}};_0x1fd244(++_0x4ecf9a);}(_0x7950,0x1a2));var _0x0795=function(_0x4d10cb,_0x2b4821){_0x4d10cb=_0x4d10cb-0x0;var _0x2b4830=_0x7950[_0x4d10cb];return _0x2b4830;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0795('0x0'));var timeout=require(_0x0795('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0795('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x0795('0x3'));var config=require(_0x0795('0x4'));var controller=require(_0x0795('0x5'));router[_0x0795('0x6')]('/',auth[_0x0795('0x7')](),controller['index']);router[_0x0795('0x6')](_0x0795('0x8'),auth[_0x0795('0x7')](),controller[_0x0795('0x9')]);router[_0x0795('0x6')]('/:id',auth[_0x0795('0x7')](),controller[_0x0795('0xa')]);router[_0x0795('0xb')]('/',auth[_0x0795('0x7')](),controller[_0x0795('0xc')]);router[_0x0795('0xd')](_0x0795('0xe'),auth['isAuthenticated'](),controller[_0x0795('0xf')]);router[_0x0795('0x10')]('/:id',auth[_0x0795('0x7')](),controller['destroy']);module[_0x0795('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 650f11f..8693776 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 _0x8caf=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x2067e9,_0x5e6a97){var _0x280ce4=function(_0x2eca23){while(--_0x2eca23){_0x2067e9['push'](_0x2067e9['shift']());}};_0x280ce4(++_0x5e6a97);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x5e4d4d,_0x5a5aa6){_0x5e4d4d=_0x5e4d4d-0x0;var _0x40cbd6=_0x8caf[_0x5e4d4d];return _0x40cbd6;};'use strict';var Sequelize=require('sequelize');module[_0xf8ca('0x0')]={'type':{'type':Sequelize[_0xf8ca('0x1')]},'uniqueid':{'type':Sequelize[_0xf8ca('0x1')]},'calleridnum':{'type':Sequelize[_0xf8ca('0x1')]},'calleridname':{'type':Sequelize[_0xf8ca('0x1')]},'queue':{'type':Sequelize[_0xf8ca('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf8ca('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentconnectAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentdumpAt':{'type':Sequelize[_0xf8ca('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xf8ca('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf8ca('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf8ca('0x1')]},'channelstate':{'type':Sequelize[_0xf8ca('0x4')]},'channelstatedesc':{'type':Sequelize[_0xf8ca('0x1')]},'connectedlinenum':{'type':Sequelize[_0xf8ca('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf8ca('0x1')]},'accountcode':{'type':Sequelize[_0xf8ca('0x1')]},'context':{'type':Sequelize[_0xf8ca('0x1')]},'exten':{'type':Sequelize[_0xf8ca('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf8ca('0x1')]},'destchannelstate':{'type':Sequelize[_0xf8ca('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf8ca('0x1')]},'destcalleridname':{'type':Sequelize[_0xf8ca('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf8ca('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf8ca('0x1')]},'destlanguage':{'type':Sequelize[_0xf8ca('0x1')]},'destaccountcode':{'type':Sequelize[_0xf8ca('0x1')]},'destcontext':{'type':Sequelize[_0xf8ca('0x1')]},'destexten':{'type':Sequelize[_0xf8ca('0x1')]},'destpriority':{'type':Sequelize[_0xf8ca('0x1')]},'destuniqueid':{'type':Sequelize[_0xf8ca('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xf8ca('0x1')]},'transfer':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf8ca('0x1')],'comment':_0xf8ca('0x5')},'transferexten':{'type':Sequelize[_0xf8ca('0x1')]},'transferuniqueid':{'type':Sequelize[_0xf8ca('0x1')]},'agententerreason':{'type':Sequelize[_0xf8ca('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbb59=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x3561eb,_0x42fee2){var _0x3262fb=function(_0xe28168){while(--_0xe28168){_0x3561eb['push'](_0x3561eb['shift']());}};_0x3262fb(++_0x42fee2);}(_0xbb59,0xec));var _0x9bb5=function(_0x2cfe62,_0x2e613c){_0x2cfe62=_0x2cfe62-0x0;var _0x5603c7=_0xbb59[_0x2cfe62];return _0x5603c7;};'use strict';var Sequelize=require(_0x9bb5('0x0'));module[_0x9bb5('0x1')]={'type':{'type':Sequelize[_0x9bb5('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9bb5('0x2')]},'queue':{'type':Sequelize[_0x9bb5('0x2')]},'interface':{'type':Sequelize[_0x9bb5('0x2')]},'membername':{'type':Sequelize[_0x9bb5('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9bb5('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x9bb5('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x9bb5('0x3')]},'agentdumpAt':{'type':Sequelize[_0x9bb5('0x3')]},'holdtime':{'type':Sequelize[_0x9bb5('0x4')]},'agentcomplete':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9bb5('0x4')]},'agentacw':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9bb5('0x4')]},'reason':{'type':Sequelize[_0x9bb5('0x2')]},'lastevent':{'type':Sequelize[_0x9bb5('0x2')]},'channel':{'type':Sequelize[_0x9bb5('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9bb5('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9bb5('0x2')]},'connectedlinename':{'type':Sequelize[_0x9bb5('0x2')]},'language':{'type':Sequelize[_0x9bb5('0x2')]},'accountcode':{'type':Sequelize[_0x9bb5('0x2')]},'context':{'type':Sequelize[_0x9bb5('0x2')]},'exten':{'type':Sequelize[_0x9bb5('0x2')]},'priority':{'type':Sequelize[_0x9bb5('0x2')]},'destchannel':{'type':Sequelize[_0x9bb5('0x2')]},'destchannelstate':{'type':Sequelize[_0x9bb5('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x9bb5('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9bb5('0x2')]},'destcalleridname':{'type':Sequelize[_0x9bb5('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9bb5('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9bb5('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9bb5('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9bb5('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x9bb5('0x2')]},'transfer':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9bb5('0x6')},'transferexten':{'type':Sequelize[_0x9bb5('0x2')]},'transferuniqueid':{'type':Sequelize[_0x9bb5('0x2')]},'agententerreason':{'type':Sequelize[_0x9bb5('0x4')],'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 83d208a..71a15b1 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(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_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 a3ec638..966a6fa 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 _0x47c7=['api','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0x47c7,0x1ab));var _0x747c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x47c7[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x747c('0x0'));var util=require('util');var logger=require(_0x747c('0x1'))(_0x747c('0x2'));var moment=require('moment');var BPromise=require(_0x747c('0x3'));var rp=require(_0x747c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x747c('0x5'));var config=require(_0x747c('0x6'));var attributes=require(_0x747c('0x7'));module[_0x747c('0x8')]=function(_0x5e991e,_0xa1148a){return _0x5e991e['define'](_0x747c('0x9'),attributes,{'tableName':_0x747c('0xa'),'paranoid':![],'indexes':[{'fields':[_0x747c('0xb'),_0x747c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd20=['uniqueid','destuniqueid','util','moment','bluebird','path','../../config/environment','./voiceAgentReport.attributes','exports','report_agent'];(function(_0xb600ed,_0x1a9299){var _0x18fdae=function(_0xaa778a){while(--_0xaa778a){_0xb600ed['push'](_0xb600ed['shift']());}};_0x18fdae(++_0x1a9299);}(_0xfd20,0x66));var _0x0fd2=function(_0x494ffe,_0x557e9e){_0x494ffe=_0x494ffe-0x0;var _0x1a3f2b=_0xfd20[_0x494ffe];return _0x1a3f2b;};'use strict';var _=require('lodash');var util=require(_0x0fd2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0fd2('0x1'));var BPromise=require(_0x0fd2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fd2('0x3'));var rimraf=require('rimraf');var config=require(_0x0fd2('0x4'));var attributes=require(_0x0fd2('0x5'));module[_0x0fd2('0x6')]=function(_0xf25991,_0x247d6e){return _0xf25991['define']('VoiceAgentReport',attributes,{'tableName':_0x0fd2('0x7'),'paranoid':![],'indexes':[{'fields':[_0x0fd2('0x8'),_0x0fd2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0885690..8a07feb 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 _0xe1af=['../../config/logger','../../config/environment','http','then','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','info','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x36cc85,_0x912d2f){var _0x15146d=function(_0xc7d56c){while(--_0xc7d56c){_0x36cc85['push'](_0x36cc85['shift']());}};_0x15146d(++_0x912d2f);}(_0xe1af,0x1da));var _0xfe1a=function(_0x11a3ed,_0x143d66){_0x11a3ed=_0x11a3ed-0x0;var _0x3a72c7=_0xe1af[_0x11a3ed];return _0x3a72c7;};'use strict';var _=require(_0xfe1a('0x0'));var util=require(_0xfe1a('0x1'));var moment=require(_0xfe1a('0x2'));var BPromise=require('bluebird');var rs=require(_0xfe1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe1a('0x4'))['db'];var utils=require(_0xfe1a('0x5'));var logger=require(_0xfe1a('0x6'))('rpc');var config=require(_0xfe1a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfe1a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x538abe,_0x458f87,_0x44858f){return new BPromise(function(_0xf56396,_0x3cc220){return client['request'](_0x538abe,_0x44858f)[_0xfe1a('0x9')](function(_0x2a21f8){logger['info'](_0xfe1a('0xa'),_0x458f87,'request\x20sent');logger[_0xfe1a('0xb')](_0xfe1a('0xc'),_0x458f87,_0xfe1a('0xd'),JSON[_0xfe1a('0xe')](_0x2a21f8));if(_0x2a21f8[_0xfe1a('0xf')]){if(_0x2a21f8[_0xfe1a('0xf')][_0xfe1a('0x10')]===0x1f4){logger[_0xfe1a('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x458f87,_0x2a21f8[_0xfe1a('0xf')][_0xfe1a('0x11')]);return _0x3cc220(_0x2a21f8[_0xfe1a('0xf')]['message']);}logger[_0xfe1a('0xf')](_0xfe1a('0xa'),_0x458f87,_0x2a21f8[_0xfe1a('0xf')][_0xfe1a('0x11')]);return _0xf56396(_0x2a21f8[_0xfe1a('0xf')][_0xfe1a('0x11')]);}else{logger['info'](_0xfe1a('0xa'),_0x458f87,_0xfe1a('0xd'));_0xf56396(_0x2a21f8[_0xfe1a('0x12')][_0xfe1a('0x11')]);}})[_0xfe1a('0x13')](function(_0x1028f3){logger[_0xfe1a('0xf')](_0xfe1a('0xa'),_0x458f87,_0x1028f3);_0x3cc220(_0x1028f3);});});}exports[_0xfe1a('0x14')]=function(_0x5975bb){var _0x145efa=this;return new Promise(function(_0x16d29a,_0x24d44f){return db[_0xfe1a('0x15')][_0xfe1a('0x16')](_0x5975bb[_0xfe1a('0x17')],{'raw':_0x5975bb[_0xfe1a('0x18')]?_0x5975bb[_0xfe1a('0x18')][_0xfe1a('0x19')]===undefined?!![]:![]:!![]})[_0xfe1a('0x9')](function(_0x314db0){logger[_0xfe1a('0x1a')](_0xfe1a('0x14'),_0x5975bb);logger[_0xfe1a('0xb')]('CreateVoiceAgentReport',_0x5975bb,JSON[_0xfe1a('0xe')](_0x314db0));_0x16d29a(_0x314db0);})[_0xfe1a('0x13')](function(_0x121560){logger[_0xfe1a('0xf')](_0xfe1a('0x14'),_0x121560['message'],_0x5975bb);_0x24d44f(_0x145efa[_0xfe1a('0xf')](0x1f4,_0x121560[_0xfe1a('0x11')]));});});};exports[_0xfe1a('0x1b')]=function(_0x17c28b){var _0x36df50=this;return new Promise(function(_0x4f6384,_0x1c4c5c){return db[_0xfe1a('0x15')][_0xfe1a('0x1c')](_0x17c28b[_0xfe1a('0x17')],{'raw':_0x17c28b['options']?_0x17c28b['options'][_0xfe1a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17c28b['options']?_0x17c28b[_0xfe1a('0x18')][_0xfe1a('0x1d')]||null:null,'attributes':_0x17c28b[_0xfe1a('0x18')]?_0x17c28b['options'][_0xfe1a('0x1e')]||null:null,'limit':_0x17c28b[_0xfe1a('0x18')]?_0x17c28b[_0xfe1a('0x18')][_0xfe1a('0x1f')]||null:null})[_0xfe1a('0x9')](function(_0x36cd00){logger[_0xfe1a('0x1a')](_0xfe1a('0x1b'),_0x17c28b);logger['debug'](_0xfe1a('0x1b'),_0x17c28b,JSON[_0xfe1a('0xe')](_0x36cd00));_0x4f6384(_0x36cd00);})[_0xfe1a('0x13')](function(_0x3292f4){logger[_0xfe1a('0xf')](_0xfe1a('0x1b'),_0x3292f4[_0xfe1a('0x11')],_0x17c28b);_0x1c4c5c(_0x36df50[_0xfe1a('0xf')](0x1f4,_0x3292f4[_0xfe1a('0x11')]));});});}; \ No newline at end of file +var _0xe4ba=['VoiceAgentReport,\x20%s,\x20%s','result','catch','VoiceAgentReport','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','limit','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x218ebe,_0x59ea3e){var _0x27c59e=function(_0x3389cb){while(--_0x3389cb){_0x218ebe['push'](_0x218ebe['shift']());}};_0x27c59e(++_0x59ea3e);}(_0xe4ba,0xb2));var _0xae4b=function(_0x519367,_0x2185b4){_0x519367=_0x519367-0x0;var _0x57fe64=_0xe4ba[_0x519367];return _0x57fe64;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae4b('0x0'));var BPromise=require(_0xae4b('0x1'));var rs=require(_0xae4b('0x2'));var fs=require('fs');var Redis=require(_0xae4b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xae4b('0x4'));var logger=require(_0xae4b('0x5'))('rpc');var config=require(_0xae4b('0x6'));var jayson=require(_0xae4b('0x7'));var client=jayson[_0xae4b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1da4d2,_0x29f8b5,_0x5766dc){return new BPromise(function(_0x404805,_0x3d396a){return client['request'](_0x1da4d2,_0x5766dc)[_0xae4b('0x9')](function(_0x37814e){logger[_0xae4b('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x29f8b5,_0xae4b('0xb'));logger[_0xae4b('0xc')](_0xae4b('0xd'),_0x29f8b5,_0xae4b('0xb'),JSON[_0xae4b('0xe')](_0x37814e));if(_0x37814e[_0xae4b('0xf')]){if(_0x37814e[_0xae4b('0xf')][_0xae4b('0x10')]===0x1f4){logger[_0xae4b('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x29f8b5,_0x37814e[_0xae4b('0xf')]['message']);return _0x3d396a(_0x37814e[_0xae4b('0xf')][_0xae4b('0x11')]);}logger[_0xae4b('0xf')](_0xae4b('0x12'),_0x29f8b5,_0x37814e[_0xae4b('0xf')][_0xae4b('0x11')]);return _0x404805(_0x37814e[_0xae4b('0xf')]['message']);}else{logger[_0xae4b('0xa')](_0xae4b('0x12'),_0x29f8b5,_0xae4b('0xb'));_0x404805(_0x37814e[_0xae4b('0x13')][_0xae4b('0x11')]);}})[_0xae4b('0x14')](function(_0x5d2f42){logger['error'](_0xae4b('0x12'),_0x29f8b5,_0x5d2f42);_0x3d396a(_0x5d2f42);});});}exports['CreateVoiceAgentReport']=function(_0x5309be){var _0x28017b=this;return new Promise(function(_0x36e01d,_0x834be1){return db[_0xae4b('0x15')]['create'](_0x5309be[_0xae4b('0x16')],{'raw':_0x5309be[_0xae4b('0x17')]?_0x5309be['options'][_0xae4b('0x18')]===undefined?!![]:![]:!![]})[_0xae4b('0x9')](function(_0x57d3c3){logger[_0xae4b('0xa')](_0xae4b('0x19'),_0x5309be);logger['debug']('CreateVoiceAgentReport',_0x5309be,JSON[_0xae4b('0xe')](_0x57d3c3));_0x36e01d(_0x57d3c3);})['catch'](function(_0x58b0e9){logger[_0xae4b('0xf')](_0xae4b('0x19'),_0x58b0e9[_0xae4b('0x11')],_0x5309be);_0x834be1(_0x28017b[_0xae4b('0xf')](0x1f4,_0x58b0e9['message']));});});};exports[_0xae4b('0x1a')]=function(_0x1260d6){var _0x59d811=this;return new Promise(function(_0x5001e4,_0x52fe6c){return db[_0xae4b('0x15')]['update'](_0x1260d6[_0xae4b('0x16')],{'raw':_0x1260d6[_0xae4b('0x17')]?_0x1260d6['options'][_0xae4b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1260d6[_0xae4b('0x17')]?_0x1260d6[_0xae4b('0x17')]['where']||null:null,'attributes':_0x1260d6[_0xae4b('0x17')]?_0x1260d6[_0xae4b('0x17')]['attributes']||null:null,'limit':_0x1260d6[_0xae4b('0x17')]?_0x1260d6['options'][_0xae4b('0x1b')]||null:null})[_0xae4b('0x9')](function(_0x34e35b){logger['info'](_0xae4b('0x1a'),_0x1260d6);logger['debug'](_0xae4b('0x1a'),_0x1260d6,JSON[_0xae4b('0xe')](_0x34e35b));_0x5001e4(_0x34e35b);})[_0xae4b('0x14')](function(_0x8056f0){logger[_0xae4b('0xf')]('UpdateVoiceAgentReport',_0x8056f0[_0xae4b('0x11')],_0x1260d6);_0x52fe6c(_0x59d811[_0xae4b('0xf')](0x1f4,_0x8056f0[_0xae4b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index b48a34a..6217acc 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 _0x24ca=['delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x24ca,0x1bc));var _0xa24c=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0x24ca[_0x386525];return _0x14d015;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xb')]);router[_0xa24c('0x9')](_0xa24c('0xc'),auth[_0xa24c('0xa')](),controller['describe']);router[_0xa24c('0x9')](_0xa24c('0xd'),auth[_0xa24c('0xa')](),controller['show']);router[_0xa24c('0xe')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xd'),auth[_0xa24c('0xa')](),controller[_0xa24c('0x11')]);router[_0xa24c('0x12')](_0xa24c('0xd'),auth['isAuthenticated'](),controller[_0xa24c('0x13')]);module[_0xa24c('0x14')]=router; \ No newline at end of file +var _0xe0ae=['exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','index','get','/describe','isAuthenticated','show','post','put','/:id','update'];(function(_0x136119,_0x3fd843){var _0x4a2e0d=function(_0x5c438a){while(--_0x5c438a){_0x136119['push'](_0x136119['shift']());}};_0x4a2e0d(++_0x3fd843);}(_0xe0ae,0xa1));var _0xee0a=function(_0xf363f0,_0x3b5eeb){_0xf363f0=_0xf363f0-0x0;var _0x55a386=_0xe0ae[_0xf363f0];return _0x55a386;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee0a('0x0'));var timeout=require(_0xee0a('0x1'));var express=require('express');var router=express[_0xee0a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xee0a('0x3'));var interaction=require(_0xee0a('0x4'));var config=require('../../config/environment');var controller=require(_0xee0a('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xee0a('0x6')]);router[_0xee0a('0x7')](_0xee0a('0x8'),auth[_0xee0a('0x9')](),controller['describe']);router[_0xee0a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xee0a('0xa')]);router[_0xee0a('0xb')]('/',auth[_0xee0a('0x9')](),controller['create']);router[_0xee0a('0xc')](_0xee0a('0xd'),auth['isAuthenticated'](),controller[_0xee0a('0xe')]);router['delete'](_0xee0a('0xd'),auth[_0xee0a('0x9')](),controller['destroy']);module[_0xee0a('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 35a911e..2f5eb66 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 _0x062f=['INTEGER','sequelize','exports','STRING','inbound','internal','inbound-fax','outbound-fax','dialer','TEXT','DATE'];(function(_0x13928e,_0xaff227){var _0x184e8b=function(_0x5aa9ef){while(--_0x5aa9ef){_0x13928e['push'](_0x13928e['shift']());}};_0x184e8b(++_0xaff227);}(_0x062f,0xc7));var _0xf062=function(_0x79324e,_0x4af67e){_0x79324e=_0x79324e-0x0;var _0x555666=_0x062f[_0x79324e];return _0x555666;};'use strict';var Sequelize=require(_0xf062('0x0'));module[_0xf062('0x1')]={'uniqueid':{'type':Sequelize[_0xf062('0x2')]},'type':{'type':Sequelize['ENUM'](_0xf062('0x3'),_0xf062('0x4'),'outbound',_0xf062('0x5'),_0xf062('0x6'),_0xf062('0x7'))},'tag':{'type':Sequelize[_0xf062('0x2')]},'accountcode':{'type':Sequelize[_0xf062('0x2')]},'source':{'type':Sequelize[_0xf062('0x2')]},'destination':{'type':Sequelize[_0xf062('0x2')]},'destinationcontext':{'type':Sequelize[_0xf062('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf062('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xf062('0x2')]},'lastdata':{'type':Sequelize[_0xf062('0x8')]},'starttime':{'type':Sequelize[_0xf062('0x9')]},'systemanswertime':{'type':Sequelize[_0xf062('0x9')]},'answertime':{'type':Sequelize[_0xf062('0x9')]},'endtime':{'type':Sequelize[_0xf062('0x9')]},'duration':{'type':Sequelize[_0xf062('0xa')]},'billableseconds':{'type':Sequelize[_0xf062('0xa')]},'mohtime':{'type':Sequelize[_0xf062('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf062('0x2')]},'userfield':{'type':Sequelize[_0xf062('0x2')]},'userDisposition':{'type':Sequelize[_0xf062('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xf062('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xf062('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xf062('0x2')]}}; \ No newline at end of file +var _0xbd9f=['ENUM','internal','inbound-fax','dialer','STRING','TEXT','DATE','INTEGER'];(function(_0x57c8e2,_0x2da87d){var _0x3193b1=function(_0x367344){while(--_0x367344){_0x57c8e2['push'](_0x57c8e2['shift']());}};_0x3193b1(++_0x2da87d);}(_0xbd9f,0x98));var _0xfbd9=function(_0x3dbe83,_0x4e82a1){_0x3dbe83=_0x3dbe83-0x0;var _0x42931f=_0xbd9f[_0x3dbe83];return _0x42931f;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfbd9('0x0')]('inbound',_0xfbd9('0x1'),'outbound',_0xfbd9('0x2'),'outbound-fax',_0xfbd9('0x3'))},'tag':{'type':Sequelize[_0xfbd9('0x4')]},'accountcode':{'type':Sequelize[_0xfbd9('0x4')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xfbd9('0x4')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xfbd9('0x4')]},'channel':{'type':Sequelize[_0xfbd9('0x4')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xfbd9('0x4')]},'lastdata':{'type':Sequelize[_0xfbd9('0x5')]},'starttime':{'type':Sequelize[_0xfbd9('0x6')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xfbd9('0x6')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xfbd9('0x7')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xfbd9('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfbd9('0x4')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xfbd9('0x4')]},'userDisposition':{'type':Sequelize[_0xfbd9('0x4')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xfbd9('0x4')]},'note':{'type':Sequelize[_0xfbd9('0x4')]},'prefix':{'type':Sequelize[_0xfbd9('0x4')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xfbd9('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index ae3bbf6..dfc2c01 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 _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x3f918e,_0x3e9626){var _0x4c8588=function(_0x3f72a0){while(--_0x3f72a0){_0x3f918e['push'](_0x3f918e['shift']());}};_0x4c8588(++_0x3e9626);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1233d2,_0x5416f4){_0x1233d2=_0x1233d2-0x0;var _0x22759e=_0x0b0e[_0x1233d2];return _0x22759e;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index c3697d9..ed6a423 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 _0xb5ce=['exports','define','VoiceCallReport','report_call','uniqueid','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x76087e,_0x9cd048){var _0x373c65=function(_0x1a4aed){while(--_0x1a4aed){_0x76087e['push'](_0x76087e['shift']());}};_0x373c65(++_0x9cd048);}(_0xb5ce,0xa1));var _0xeb5c=function(_0x2f74f8,_0x1c37ce){_0x2f74f8=_0x2f74f8-0x0;var _0x5a2e34=_0xb5ce[_0x2f74f8];return _0x5a2e34;};'use strict';var _=require(_0xeb5c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeb5c('0x1'));var moment=require(_0xeb5c('0x2'));var BPromise=require('bluebird');var rp=require(_0xeb5c('0x3'));var fs=require('fs');var path=require(_0xeb5c('0x4'));var rimraf=require(_0xeb5c('0x5'));var config=require(_0xeb5c('0x6'));var attributes=require(_0xeb5c('0x7'));module[_0xeb5c('0x8')]=function(_0x1b0aee,_0x5560e8){return _0x1b0aee[_0xeb5c('0x9')](_0xeb5c('0xa'),attributes,{'tableName':_0xeb5c('0xb'),'paranoid':![],'indexes':[{'fields':[_0xeb5c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9885=['path','../../config/environment','./voiceCallReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9885,0x191));var _0x5988=function(_0x233cb9,_0x45c126){_0x233cb9=_0x233cb9-0x0;var _0x3d4d18=_0x9885[_0x233cb9];return _0x3d4d18;};'use strict';var _=require(_0x5988('0x0'));var util=require(_0x5988('0x1'));var logger=require(_0x5988('0x2'))(_0x5988('0x3'));var moment=require(_0x5988('0x4'));var BPromise=require(_0x5988('0x5'));var rp=require(_0x5988('0x6'));var fs=require('fs');var path=require(_0x5988('0x7'));var rimraf=require('rimraf');var config=require(_0x5988('0x8'));var attributes=require(_0x5988('0x9'));module[_0x5988('0xa')]=function(_0x559566,_0x2bb661){return _0x559566[_0x5988('0xb')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 03c4618..f3bc857 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 _0x35c1=['model','GetVoiceCallReport','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','limit','include','map','attributes'];(function(_0x2a9e2b,_0x57d947){var _0x35a87f=function(_0x21d480){while(--_0x21d480){_0x2a9e2b['push'](_0x2a9e2b['shift']());}};_0x35a87f(++_0x57d947);}(_0x35c1,0x17a));var _0x135c=function(_0x2bd9db,_0x2f6076){_0x2bd9db=_0x2bd9db-0x0;var _0x28441e=_0x35c1[_0x2bd9db];return _0x28441e;};'use strict';var _=require(_0x135c('0x0'));var util=require(_0x135c('0x1'));var moment=require('moment');var BPromise=require(_0x135c('0x2'));var rs=require(_0x135c('0x3'));var fs=require('fs');var Redis=require(_0x135c('0x4'));var db=require(_0x135c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x135c('0x6'))(_0x135c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x135c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3de8b7,_0x41c849,_0x12dab1){return new BPromise(function(_0x4e613f,_0x4e1443){return client[_0x135c('0x9')](_0x3de8b7,_0x12dab1)[_0x135c('0xa')](function(_0x24631a){logger[_0x135c('0xb')](_0x135c('0xc'),_0x41c849,_0x135c('0xd'));logger[_0x135c('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x41c849,_0x135c('0xd'),JSON[_0x135c('0xf')](_0x24631a));if(_0x24631a[_0x135c('0x10')]){if(_0x24631a['error'][_0x135c('0x11')]===0x1f4){logger[_0x135c('0x10')](_0x135c('0xc'),_0x41c849,_0x24631a[_0x135c('0x10')][_0x135c('0x12')]);return _0x4e1443(_0x24631a[_0x135c('0x10')][_0x135c('0x12')]);}logger[_0x135c('0x10')](_0x135c('0xc'),_0x41c849,_0x24631a[_0x135c('0x10')][_0x135c('0x12')]);return _0x4e613f(_0x24631a[_0x135c('0x10')][_0x135c('0x12')]);}else{logger[_0x135c('0xb')](_0x135c('0xc'),_0x41c849,'request\x20sent');_0x4e613f(_0x24631a[_0x135c('0x13')][_0x135c('0x12')]);}})[_0x135c('0x14')](function(_0x4cccd6){logger[_0x135c('0x10')](_0x135c('0xc'),_0x41c849,_0x4cccd6);_0x4e1443(_0x4cccd6);});});}exports['GetVoiceCallReport']=function(_0x20f43c){var _0x5e5297=this;return new Promise(function(_0x16f271,_0x3beb04){return db[_0x135c('0x15')][_0x135c('0x16')]({'raw':_0x20f43c['options']?_0x20f43c[_0x135c('0x17')][_0x135c('0x18')]===undefined?!![]:![]:!![],'where':_0x20f43c['options']?_0x20f43c[_0x135c('0x17')]['where']||null:null,'attributes':_0x20f43c[_0x135c('0x17')]?_0x20f43c[_0x135c('0x17')]['attributes']||null:null,'limit':_0x20f43c[_0x135c('0x17')]?_0x20f43c[_0x135c('0x17')][_0x135c('0x19')]||null:null,'include':_0x20f43c[_0x135c('0x17')]?_0x20f43c[_0x135c('0x17')][_0x135c('0x1a')]?_[_0x135c('0x1b')](_0x20f43c[_0x135c('0x17')][_0x135c('0x1a')],function(_0xb6b0d){return{'model':db[_0xb6b0d['model']],'as':_0xb6b0d['as'],'attributes':_0xb6b0d[_0x135c('0x1c')],'include':_0xb6b0d[_0x135c('0x1a')]?_['map'](_0xb6b0d[_0x135c('0x1a')],function(_0x48125a){return{'model':db[_0x48125a['model']],'as':_0x48125a['as'],'attributes':_0x48125a[_0x135c('0x1c')],'include':_0x48125a[_0x135c('0x1a')]?_[_0x135c('0x1b')](_0x48125a[_0x135c('0x1a')],function(_0xcba21b){return{'model':db[_0xcba21b[_0x135c('0x1d')]],'as':_0xcba21b['as'],'attributes':_0xcba21b[_0x135c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x135c('0xa')](function(_0x27d63a){logger['info'](_0x135c('0x1e'),_0x20f43c);logger[_0x135c('0xe')](_0x135c('0x1e'),_0x20f43c,JSON[_0x135c('0xf')](_0x27d63a));_0x16f271(_0x27d63a);})[_0x135c('0x14')](function(_0x2493e9){logger['error'](_0x135c('0x1e'),_0x2493e9[_0x135c('0x12')],_0x20f43c);_0x3beb04(_0x5e5297[_0x135c('0x10')](0x1f4,_0x2493e9[_0x135c('0x12')]));});});};exports[_0x135c('0x1f')]=function(_0x3b8933){var _0x1a8488=this;return new Promise(function(_0x27d2de,_0x4d6651){return db[_0x135c('0x15')][_0x135c('0x20')](_0x3b8933['body'],{'raw':_0x3b8933[_0x135c('0x17')]?_0x3b8933['options'][_0x135c('0x18')]===undefined?!![]:![]:!![]})[_0x135c('0xa')](function(_0x4e1035){logger['info'](_0x135c('0x1f'),_0x3b8933);logger[_0x135c('0xe')](_0x135c('0x1f'),_0x3b8933,JSON[_0x135c('0xf')](_0x4e1035));_0x27d2de(_0x4e1035);})[_0x135c('0x14')](function(_0x3a3ca6){logger[_0x135c('0x10')]('CreateVoiceCallReport',_0x3a3ca6[_0x135c('0x12')],_0x3b8933);_0x4d6651(_0x1a8488['error'](0x1f4,_0x3a3ca6[_0x135c('0x12')]));});});};exports[_0x135c('0x21')]=function(_0x3e9877){var _0x140d67=this;return new Promise(function(_0x104111,_0x2f03ad){return db[_0x135c('0x15')][_0x135c('0x22')](_0x3e9877[_0x135c('0x23')],{'raw':_0x3e9877[_0x135c('0x17')]?_0x3e9877[_0x135c('0x17')][_0x135c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e9877['options']?_0x3e9877[_0x135c('0x17')][_0x135c('0x24')]||null:null,'attributes':_0x3e9877[_0x135c('0x17')]?_0x3e9877[_0x135c('0x17')][_0x135c('0x1c')]||null:null,'limit':_0x3e9877[_0x135c('0x17')]?_0x3e9877[_0x135c('0x17')]['limit']||null:null})[_0x135c('0xa')](function(_0x6cb74e){logger['info'](_0x135c('0x21'),_0x3e9877);logger[_0x135c('0xe')]('UpdateVoiceCallReport',_0x3e9877,JSON[_0x135c('0xf')](_0x6cb74e));_0x104111(_0x6cb74e);})[_0x135c('0x14')](function(_0x48101c){logger[_0x135c('0x10')](_0x135c('0x21'),_0x48101c['message'],_0x3e9877);_0x2f03ad(_0x140d67[_0x135c('0x10')](0x1f4,_0x48101c[_0x135c('0x12')]));});});}; \ No newline at end of file +var _0x2870=['CreateVoiceCallReport','create','raw','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','GetVoiceCallReport'];(function(_0x50cf37,_0x6d1a12){var _0x2cb903=function(_0x461773){while(--_0x461773){_0x50cf37['push'](_0x50cf37['shift']());}};_0x2cb903(++_0x6d1a12);}(_0x2870,0xd2));var _0x0287=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x2870[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0x0287('0x0'));var util=require(_0x0287('0x1'));var moment=require(_0x0287('0x2'));var BPromise=require(_0x0287('0x3'));var rs=require(_0x0287('0x4'));var fs=require('fs');var Redis=require(_0x0287('0x5'));var db=require(_0x0287('0x6'))['db'];var utils=require(_0x0287('0x7'));var logger=require(_0x0287('0x8'))('rpc');var config=require(_0x0287('0x9'));var jayson=require(_0x0287('0xa'));var client=jayson[_0x0287('0xb')][_0x0287('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x19e314,_0x50cba0,_0x3d0bb6){return new BPromise(function(_0xdefc51,_0x4eeb75){return client[_0x0287('0xd')](_0x19e314,_0x3d0bb6)[_0x0287('0xe')](function(_0xb14e34){logger[_0x0287('0xf')](_0x0287('0x10'),_0x50cba0,_0x0287('0x11'));logger[_0x0287('0x12')](_0x0287('0x13'),_0x50cba0,_0x0287('0x11'),JSON[_0x0287('0x14')](_0xb14e34));if(_0xb14e34[_0x0287('0x15')]){if(_0xb14e34[_0x0287('0x15')][_0x0287('0x16')]===0x1f4){logger[_0x0287('0x15')](_0x0287('0x10'),_0x50cba0,_0xb14e34[_0x0287('0x15')][_0x0287('0x17')]);return _0x4eeb75(_0xb14e34[_0x0287('0x15')][_0x0287('0x17')]);}logger[_0x0287('0x15')]('VoiceCallReport,\x20%s,\x20%s',_0x50cba0,_0xb14e34['error'][_0x0287('0x17')]);return _0xdefc51(_0xb14e34['error']['message']);}else{logger[_0x0287('0xf')](_0x0287('0x10'),_0x50cba0,_0x0287('0x11'));_0xdefc51(_0xb14e34[_0x0287('0x18')][_0x0287('0x17')]);}})[_0x0287('0x19')](function(_0x2bc1a3){logger[_0x0287('0x15')](_0x0287('0x10'),_0x50cba0,_0x2bc1a3);_0x4eeb75(_0x2bc1a3);});});}exports['GetVoiceCallReport']=function(_0x45902e){var _0x3019f0=this;return new Promise(function(_0x38df8c,_0xb0490c){return db[_0x0287('0x1a')][_0x0287('0x1b')]({'raw':_0x45902e[_0x0287('0x1c')]?_0x45902e[_0x0287('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x45902e[_0x0287('0x1c')]?_0x45902e[_0x0287('0x1c')][_0x0287('0x1d')]||null:null,'attributes':_0x45902e['options']?_0x45902e['options'][_0x0287('0x1e')]||null:null,'limit':_0x45902e[_0x0287('0x1c')]?_0x45902e[_0x0287('0x1c')][_0x0287('0x1f')]||null:null,'include':_0x45902e[_0x0287('0x1c')]?_0x45902e[_0x0287('0x1c')][_0x0287('0x20')]?_[_0x0287('0x21')](_0x45902e[_0x0287('0x1c')][_0x0287('0x20')],function(_0x41cf4a){return{'model':db[_0x41cf4a[_0x0287('0x22')]],'as':_0x41cf4a['as'],'attributes':_0x41cf4a[_0x0287('0x1e')],'include':_0x41cf4a[_0x0287('0x20')]?_['map'](_0x41cf4a[_0x0287('0x20')],function(_0x5ba720){return{'model':db[_0x5ba720['model']],'as':_0x5ba720['as'],'attributes':_0x5ba720[_0x0287('0x1e')],'include':_0x5ba720[_0x0287('0x20')]?_[_0x0287('0x21')](_0x5ba720['include'],function(_0x4c3925){return{'model':db[_0x4c3925[_0x0287('0x22')]],'as':_0x4c3925['as'],'attributes':_0x4c3925[_0x0287('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52f1af){logger['info'](_0x0287('0x23'),_0x45902e);logger[_0x0287('0x12')](_0x0287('0x23'),_0x45902e,JSON[_0x0287('0x14')](_0x52f1af));_0x38df8c(_0x52f1af);})['catch'](function(_0x17ed8b){logger[_0x0287('0x15')](_0x0287('0x23'),_0x17ed8b[_0x0287('0x17')],_0x45902e);_0xb0490c(_0x3019f0[_0x0287('0x15')](0x1f4,_0x17ed8b['message']));});});};exports[_0x0287('0x24')]=function(_0x20e6da){var _0x94d0e0=this;return new Promise(function(_0x1df793,_0x54c4dc){return db[_0x0287('0x1a')][_0x0287('0x25')](_0x20e6da['body'],{'raw':_0x20e6da[_0x0287('0x1c')]?_0x20e6da[_0x0287('0x1c')][_0x0287('0x26')]===undefined?!![]:![]:!![]})['then'](function(_0x26f3d3){logger[_0x0287('0xf')](_0x0287('0x24'),_0x20e6da);logger[_0x0287('0x12')](_0x0287('0x24'),_0x20e6da,JSON[_0x0287('0x14')](_0x26f3d3));_0x1df793(_0x26f3d3);})[_0x0287('0x19')](function(_0x5308b2){logger['error'](_0x0287('0x24'),_0x5308b2[_0x0287('0x17')],_0x20e6da);_0x54c4dc(_0x94d0e0[_0x0287('0x15')](0x1f4,_0x5308b2[_0x0287('0x17')]));});});};exports[_0x0287('0x27')]=function(_0x20180a){var _0xf17989=this;return new Promise(function(_0x535be9,_0x20fcbe){return db[_0x0287('0x1a')][_0x0287('0x28')](_0x20180a['body'],{'raw':_0x20180a[_0x0287('0x1c')]?_0x20180a[_0x0287('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20180a[_0x0287('0x1c')]?_0x20180a[_0x0287('0x1c')][_0x0287('0x1d')]||null:null,'attributes':_0x20180a['options']?_0x20180a[_0x0287('0x1c')]['attributes']||null:null,'limit':_0x20180a[_0x0287('0x1c')]?_0x20180a[_0x0287('0x1c')][_0x0287('0x1f')]||null:null})[_0x0287('0xe')](function(_0x4770ed){logger[_0x0287('0xf')]('UpdateVoiceCallReport',_0x20180a);logger[_0x0287('0x12')](_0x0287('0x27'),_0x20180a,JSON[_0x0287('0x14')](_0x4770ed));_0x535be9(_0x4770ed);})[_0x0287('0x19')](function(_0x5a34f7){logger[_0x0287('0x15')](_0x0287('0x27'),_0x5a34f7['message'],_0x20180a);_0x20fcbe(_0xf17989[_0x0287('0x15')](0x1f4,_0x5a34f7[_0x0287('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 606cb47..50bc1f9 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 _0xabe7=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','post','create','put','/:id','update','delete'];(function(_0x4b4500,_0x428486){var _0x2fa8a6=function(_0x35d33d){while(--_0x35d33d){_0x4b4500['push'](_0x4b4500['shift']());}};_0x2fa8a6(++_0x428486);}(_0xabe7,0x1c2));var _0x7abe=function(_0x595d74,_0x58378d){_0x595d74=_0x595d74-0x0;var _0x41f72e=_0xabe7[_0x595d74];return _0x41f72e;};'use strict';var multer=require(_0x7abe('0x0'));var util=require(_0x7abe('0x1'));var path=require(_0x7abe('0x2'));var timeout=require(_0x7abe('0x3'));var express=require(_0x7abe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7abe('0x5'));var interaction=require(_0x7abe('0x6'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x7abe('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7abe('0x8')]('/',auth[_0x7abe('0x7')](),controller[_0x7abe('0x9')]);router[_0x7abe('0xa')](_0x7abe('0xb'),auth[_0x7abe('0x7')](),controller[_0x7abe('0xc')]);router[_0x7abe('0xd')]('/:id',auth[_0x7abe('0x7')](),controller[_0x7abe('0xe')]);module[_0x7abe('0xf')]=router; \ No newline at end of file +var _0x615c=['../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x615c,0xa8));var _0xc615=function(_0x9d2bdc,_0x4f2b6a){_0x9d2bdc=_0x9d2bdc-0x0;var _0x410615=_0x615c[_0x9d2bdc];return _0x410615;};'use strict';var multer=require(_0xc615('0x0'));var util=require('util');var path=require(_0xc615('0x1'));var timeout=require(_0xc615('0x2'));var express=require(_0xc615('0x3'));var router=express[_0xc615('0x4')]();var fs_extra=require(_0xc615('0x5'));var auth=require(_0xc615('0x6'));var interaction=require(_0xc615('0x7'));var config=require(_0xc615('0x8'));var controller=require(_0xc615('0x9'));router['get']('/',auth[_0xc615('0xa')](),controller[_0xc615('0xb')]);router[_0xc615('0xc')](_0xc615('0xd'),auth[_0xc615('0xa')](),controller[_0xc615('0xe')]);router[_0xc615('0xf')]('/',auth['isAuthenticated'](),controller[_0xc615('0x10')]);router[_0xc615('0x11')](_0xc615('0xd'),auth[_0xc615('0xa')](),controller[_0xc615('0x12')]);router[_0xc615('0x13')]('/:id',auth[_0xc615('0xa')](),controller[_0xc615('0x14')]);module[_0xc615('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 6fee0ca..418b2d2 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 _0xb4e4=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x3d7af5,_0x308d72){var _0x11b446=function(_0x3ff3e4){while(--_0x3ff3e4){_0x3d7af5['push'](_0x3d7af5['shift']());}};_0x11b446(++_0x308d72);}(_0xb4e4,0x170));var _0x4b4e=function(_0x3bb409,_0x36a01f){_0x3bb409=_0x3bb409-0x0;var _0x252d77=_0xb4e4[_0x3bb409];return _0x252d77;};'use strict';var Sequelize=require(_0x4b4e('0x0'));module[_0x4b4e('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x4b4e('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x4b4e('0x2')],'set':function(_0x2805c9){this['setDataValue']('options',_0x2805c9?_0x2805c9[_0x4b4e('0x3')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x4b4e('0x4')]('options')[_0x4b4e('0x5')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x4b4e('0x2')]},'record':{'type':Sequelize[_0x4b4e('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4b4e('0x2')]},'description':{'type':Sequelize[_0x4b4e('0x2')]}}; \ No newline at end of file +var _0x94ab=['sequelize','exports','STRING','name','options','join','split','BOOLEAN'];(function(_0x297f2a,_0x5d1d69){var _0x576dff=function(_0x595813){while(--_0x595813){_0x297f2a['push'](_0x297f2a['shift']());}};_0x576dff(++_0x5d1d69);}(_0x94ab,0x120));var _0xb94a=function(_0x517ee1,_0x1a602a){_0x517ee1=_0x517ee1-0x0;var _0x3e7af2=_0x94ab[_0x517ee1];return _0x3e7af2;};'use strict';var Sequelize=require(_0xb94a('0x0'));module[_0xb94a('0x1')]={'name':{'type':Sequelize[_0xb94a('0x2')]},'prefix':{'type':Sequelize[_0xb94a('0x2')],'unique':_0xb94a('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xb94a('0x2')],'set':function(_0x6cb70e){this['setDataValue'](_0xb94a('0x4'),_0x6cb70e?_0x6cb70e[_0xb94a('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xb94a('0x4'))?this['getDataValue'](_0xb94a('0x4'))[_0xb94a('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xb94a('0x2')]},'record':{'type':Sequelize[_0xb94a('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 482b834..b82378a 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 _0x9e9b=['order','sort','where','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','ChanSpies','UserProfileResource','error','stack','index','VoiceChanSpy','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x524a38,_0x2368e7){var _0x553b80=function(_0x98842c){while(--_0x98842c){_0x524a38['push'](_0x524a38['shift']());}};_0x553b80(++_0x2368e7);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0x9e9b[_0x3ec1da];return _0x472358;};'use strict';var emlformat=require(_0xb9e9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb9e9('0x1'));var rp=require(_0xb9e9('0x2'));var moment=require(_0xb9e9('0x3'));var BPromise=require(_0xb9e9('0x4'));var Mustache=require('mustache');var util=require(_0xb9e9('0x5'));var path=require(_0xb9e9('0x6'));var sox=require('sox');var csv=require(_0xb9e9('0x7'));var ejs=require(_0xb9e9('0x8'));var fs=require('fs');var fs_extra=require(_0xb9e9('0x9'));var _=require(_0xb9e9('0xa'));var squel=require(_0xb9e9('0xb'));var crypto=require(_0xb9e9('0xc'));var jsforce=require(_0xb9e9('0xd'));var deskjs=require(_0xb9e9('0xe'));var toCsv=require(_0xb9e9('0x7'));var querystring=require(_0xb9e9('0xf'));var Papa=require(_0xb9e9('0x10'));var Redis=require(_0xb9e9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb9e9('0x12'));var as=require(_0xb9e9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9e9('0x14'))(_0xb9e9('0x15'));var utils=require(_0xb9e9('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb9e9('0x17'))['db'];function respondWithStatusCode(_0x393cc5,_0x1b15f9){_0x1b15f9=_0x1b15f9||0xcc;return function(_0x1c0b64){if(_0x1c0b64){return _0x393cc5[_0xb9e9('0x18')](_0x1b15f9);}return _0x393cc5['status'](_0x1b15f9)['end']();};}function respondWithResult(_0x3af79d,_0xac8104){_0xac8104=_0xac8104||0xc8;return function(_0x52b6bf){if(_0x52b6bf){return _0x3af79d[_0xb9e9('0x19')](_0xac8104)[_0xb9e9('0x1a')](_0x52b6bf);}};}function respondWithFilteredResult(_0x13b48f,_0x3a3b0e){return function(_0x4a141f){if(_0x4a141f){var _0xf3d58f=typeof _0x3a3b0e[_0xb9e9('0x1b')]===_0xb9e9('0x1c')&&typeof _0x3a3b0e['limit']===_0xb9e9('0x1c');var _0x107be6=_0x4a141f[_0xb9e9('0x1d')];var _0x3f3a27=_0xf3d58f?0x0:_0x3a3b0e[_0xb9e9('0x1b')];var _0x258791=_0xf3d58f?_0x4a141f[_0xb9e9('0x1d')]:_0x3a3b0e[_0xb9e9('0x1b')]+_0x3a3b0e[_0xb9e9('0x1e')];var _0x142694;if(_0x258791>=_0x107be6){_0x258791=_0x107be6;_0x142694=0xc8;}else{_0x142694=0xce;}_0x13b48f[_0xb9e9('0x19')](_0x142694);return _0x13b48f[_0xb9e9('0x1f')](_0xb9e9('0x20'),_0x3f3a27+'-'+_0x258791+'/'+_0x107be6)[_0xb9e9('0x1a')](_0x4a141f);}return null;};}function patchUpdates(_0x1183e2){return function(_0x45b9b0){try{jsonpatch[_0xb9e9('0x21')](_0x45b9b0,_0x1183e2,!![]);}catch(_0x39e10c){return BPromise[_0xb9e9('0x22')](_0x39e10c);}return _0x45b9b0[_0xb9e9('0x23')]();};}function saveUpdates(_0x52a8b9,_0x25b5ed){return function(_0x524afc){if(_0x524afc){return _0x524afc[_0xb9e9('0x24')](_0x52a8b9)[_0xb9e9('0x25')](function(_0x876b4d){return _0x876b4d;});}return null;};}function removeEntity(_0x2cb451,_0x84c9e3){return function(_0x143654){if(_0x143654){return _0x143654[_0xb9e9('0x26')]()[_0xb9e9('0x25')](function(){var _0x5c3dc8=_0x143654['get']({'plain':!![]});var _0x36b8f8=_0xb9e9('0x27');return db[_0xb9e9('0x28')][_0xb9e9('0x26')]({'where':{'type':_0x36b8f8,'resourceId':_0x5c3dc8['id']}})[_0xb9e9('0x25')](function(){return _0x143654;});})[_0xb9e9('0x25')](function(){_0x2cb451['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5543b2,_0x4f44cf){return function(_0x28a35a){if(!_0x28a35a){_0x5543b2['sendStatus'](0x194);}return _0x28a35a;};}function handleError(_0x5ea227,_0x12262b){_0x12262b=_0x12262b||0x1f4;return function(_0x51bd72){logger[_0xb9e9('0x29')](_0x51bd72[_0xb9e9('0x2a')]);if(_0x51bd72['name']){delete _0x51bd72['name'];}_0x5ea227[_0xb9e9('0x19')](_0x12262b)['send'](_0x51bd72);};}exports[_0xb9e9('0x2b')]=function(_0x5d6102,_0x5a1992){var _0xd2587e={},_0x4332a2={},_0x2c0f42={'count':0x0,'rows':[]};var _0x5050a5=_['map'](db[_0xb9e9('0x2c')]['rawAttributes'],function(_0x22f3ad){return{'name':_0x22f3ad['fieldName'],'type':_0x22f3ad['type'][_0xb9e9('0x2d')]};});_0x4332a2[_0xb9e9('0x2e')]=_['map'](_0x5050a5,_0xb9e9('0x2f'));_0x4332a2[_0xb9e9('0x30')]=_[_0xb9e9('0x31')](_0x5d6102['query']);_0x4332a2[_0xb9e9('0x32')]=_[_0xb9e9('0x33')](_0x4332a2['model'],_0x4332a2[_0xb9e9('0x30')]);_0xd2587e[_0xb9e9('0x34')]=_[_0xb9e9('0x33')](_0x4332a2[_0xb9e9('0x2e')],qs[_0xb9e9('0x35')](_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x35')]));_0xd2587e['attributes']=_0xd2587e[_0xb9e9('0x34')][_0xb9e9('0x36')]?_0xd2587e['attributes']:_0x4332a2[_0xb9e9('0x2e')];if(!_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x37')](_0xb9e9('0x38'))){_0xd2587e[_0xb9e9('0x1e')]=qs[_0xb9e9('0x1e')](_0x5d6102[_0xb9e9('0x30')]['limit']);_0xd2587e[_0xb9e9('0x1b')]=qs[_0xb9e9('0x1b')](_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x1b')]);}_0xd2587e[_0xb9e9('0x39')]=qs[_0xb9e9('0x3a')](_0x5d6102[_0xb9e9('0x30')]['sort']);_0xd2587e[_0xb9e9('0x3b')]=qs[_0xb9e9('0x32')](_['pick'](_0x5d6102[_0xb9e9('0x30')],_0x4332a2['filters']),_0x5050a5);if(_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x3c')]){_0xd2587e['where']=_[_0xb9e9('0x3d')](_0xd2587e[_0xb9e9('0x3b')],{'$or':_[_0xb9e9('0x3e')](_0x5050a5,function(_0x58d1bd){if(_0x58d1bd['type']!=='VIRTUAL'){var _0x692047={};_0x692047[_0x58d1bd[_0xb9e9('0x2f')]]={'$like':'%'+_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x3c')]+'%'};return _0x692047;}})});}_0xd2587e=_[_0xb9e9('0x3d')]({},_0xd2587e,_0x5d6102[_0xb9e9('0x3f')]);var _0x235dfd={'where':_0xd2587e[_0xb9e9('0x3b')]};return db[_0xb9e9('0x2c')]['count'](_0x235dfd)['then'](function(_0x42553){_0x2c0f42['count']=_0x42553;if(_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x40')]){_0xd2587e[_0xb9e9('0x41')]=[{'all':!![]}];}return db[_0xb9e9('0x2c')][_0xb9e9('0x42')](_0xd2587e);})[_0xb9e9('0x25')](function(_0x4e6e48){_0x2c0f42[_0xb9e9('0x43')]=_0x4e6e48;return _0x2c0f42;})[_0xb9e9('0x25')](respondWithFilteredResult(_0x5a1992,_0xd2587e))[_0xb9e9('0x44')](handleError(_0x5a1992,null));};exports[_0xb9e9('0x45')]=function(_0x2d5aef,_0x5bada6){var _0x72110a={'raw':![],'where':{'id':_0x2d5aef['params']['id']}},_0x23a421={};_0x23a421[_0xb9e9('0x2e')]=_[_0xb9e9('0x31')](db['VoiceChanSpy']['rawAttributes']);_0x23a421[_0xb9e9('0x30')]=_['keys'](_0x2d5aef[_0xb9e9('0x30')]);_0x23a421[_0xb9e9('0x32')]=_['intersection'](_0x23a421['model'],_0x23a421['query']);_0x72110a[_0xb9e9('0x34')]=_['intersection'](_0x23a421[_0xb9e9('0x2e')],qs[_0xb9e9('0x35')](_0x2d5aef['query'][_0xb9e9('0x35')]));_0x72110a['attributes']=_0x72110a[_0xb9e9('0x34')]['length']?_0x72110a[_0xb9e9('0x34')]:_0x23a421[_0xb9e9('0x2e')];if(_0x2d5aef[_0xb9e9('0x30')][_0xb9e9('0x40')]){_0x72110a[_0xb9e9('0x41')]=[{'all':!![]}];}_0x72110a=_[_0xb9e9('0x3d')]({},_0x72110a,_0x2d5aef[_0xb9e9('0x3f')]);return db[_0xb9e9('0x2c')]['find'](_0x72110a)[_0xb9e9('0x25')](handleEntityNotFound(_0x5bada6,null))['then'](respondWithResult(_0x5bada6,null))[_0xb9e9('0x44')](handleError(_0x5bada6,null));};exports[_0xb9e9('0x46')]=function(_0x4640a0,_0x315620){return db[_0xb9e9('0x2c')]['create'](_0x4640a0[_0xb9e9('0x47')],{})[_0xb9e9('0x25')](function(_0x36541e){var _0x135a14=_0x4640a0[_0xb9e9('0x48')][_0xb9e9('0x49')]({'plain':!![]});if(!_0x135a14)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x135a14[_0xb9e9('0x4a')]===_0xb9e9('0x48')){var _0x5a61bf=_0x36541e['get']({'plain':!![]});var _0x51c531=_0xb9e9('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x51c531,'userProfileId':_0x135a14[_0xb9e9('0x4b')]},'raw':!![]})[_0xb9e9('0x25')](function(_0x26be11){if(_0x26be11&&_0x26be11[_0xb9e9('0x4c')]===0x0){return db[_0xb9e9('0x28')]['create']({'name':_0x5a61bf[_0xb9e9('0x2f')],'resourceId':_0x5a61bf['id'],'type':_0x26be11[_0xb9e9('0x2f')],'sectionId':_0x26be11['id']},{})[_0xb9e9('0x25')](function(){return _0x36541e;});}else{return _0x36541e;}})[_0xb9e9('0x44')](function(_0x5af6df){logger[_0xb9e9('0x29')](_0xb9e9('0x4d'),_0x5af6df);throw _0x5af6df;});}return _0x36541e;})[_0xb9e9('0x25')](respondWithResult(_0x315620,0xc9))[_0xb9e9('0x44')](handleError(_0x315620,null));};exports[_0xb9e9('0x24')]=function(_0x56540a,_0x1199bb){if(_0x56540a['body']['id']){delete _0x56540a[_0xb9e9('0x47')]['id'];}return db[_0xb9e9('0x2c')][_0xb9e9('0x4e')]({'where':{'id':_0x56540a['params']['id']}})['then'](handleEntityNotFound(_0x1199bb,null))['then'](saveUpdates(_0x56540a[_0xb9e9('0x47')],null))[_0xb9e9('0x25')](respondWithResult(_0x1199bb,null))[_0xb9e9('0x44')](handleError(_0x1199bb,null));};exports[_0xb9e9('0x26')]=function(_0x4ecae3,_0x12f6af){return db[_0xb9e9('0x2c')]['find']({'where':{'id':_0x4ecae3[_0xb9e9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x12f6af,null))[_0xb9e9('0x25')](removeEntity(_0x12f6af,null))[_0xb9e9('0x44')](handleError(_0x12f6af,null));}; \ No newline at end of file +var _0x3ef0=['findAll','rows','catch','show','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include'];(function(_0x2918fb,_0x1ac725){var _0xef01f8=function(_0xd97c6){while(--_0xd97c6){_0x2918fb['push'](_0x2918fb['shift']());}};_0xef01f8(++_0x1ac725);}(_0x3ef0,0x19a));var _0x03ef=function(_0x5a75b5,_0x311e68){_0x5a75b5=_0x5a75b5-0x0;var _0x4cf209=_0x3ef0[_0x5a75b5];return _0x4cf209;};'use strict';var emlformat=require(_0x03ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03ef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03ef('0x2'));var moment=require('moment');var BPromise=require(_0x03ef('0x3'));var Mustache=require(_0x03ef('0x4'));var util=require(_0x03ef('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x03ef('0x6'));var ejs=require(_0x03ef('0x7'));var fs=require('fs');var fs_extra=require(_0x03ef('0x8'));var _=require('lodash');var squel=require(_0x03ef('0x9'));var crypto=require(_0x03ef('0xa'));var jsforce=require(_0x03ef('0xb'));var deskjs=require(_0x03ef('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03ef('0xd'));var Redis=require(_0x03ef('0xe'));var authService=require(_0x03ef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x03ef('0x10'));var hardwareService=require(_0x03ef('0x11'));var logger=require('../../config/logger')(_0x03ef('0x12'));var utils=require(_0x03ef('0x13'));var config=require(_0x03ef('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x03ef('0x15'))['db'];function respondWithStatusCode(_0x8f3fb,_0x390cc2){_0x390cc2=_0x390cc2||0xcc;return function(_0x1e138e){if(_0x1e138e){return _0x8f3fb[_0x03ef('0x16')](_0x390cc2);}return _0x8f3fb[_0x03ef('0x17')](_0x390cc2)[_0x03ef('0x18')]();};}function respondWithResult(_0x39ed69,_0x1702a0){_0x1702a0=_0x1702a0||0xc8;return function(_0x3390ae){if(_0x3390ae){return _0x39ed69[_0x03ef('0x17')](_0x1702a0)['json'](_0x3390ae);}};}function respondWithFilteredResult(_0x531025,_0x16282b){return function(_0x17b6ec){if(_0x17b6ec){var _0x1a0113=typeof _0x16282b[_0x03ef('0x19')]===_0x03ef('0x1a')&&typeof _0x16282b['limit']==='undefined';var _0x343bf0=_0x17b6ec[_0x03ef('0x1b')];var _0x501d87=_0x1a0113?0x0:_0x16282b['offset'];var _0x277f0d=_0x1a0113?_0x17b6ec[_0x03ef('0x1b')]:_0x16282b[_0x03ef('0x19')]+_0x16282b[_0x03ef('0x1c')];var _0x1776d8;if(_0x277f0d>=_0x343bf0){_0x277f0d=_0x343bf0;_0x1776d8=0xc8;}else{_0x1776d8=0xce;}_0x531025['status'](_0x1776d8);return _0x531025[_0x03ef('0x1d')](_0x03ef('0x1e'),_0x501d87+'-'+_0x277f0d+'/'+_0x343bf0)['json'](_0x17b6ec);}return null;};}function patchUpdates(_0xb663d){return function(_0x39f693){try{jsonpatch[_0x03ef('0x1f')](_0x39f693,_0xb663d,!![]);}catch(_0xde0e02){return BPromise[_0x03ef('0x20')](_0xde0e02);}return _0x39f693['save']();};}function saveUpdates(_0x5cddb6,_0x41d7d7){return function(_0x5d56e1){if(_0x5d56e1){return _0x5d56e1[_0x03ef('0x21')](_0x5cddb6)['then'](function(_0x5c1a36){return _0x5c1a36;});}return null;};}function removeEntity(_0x13b033,_0x27ac0d){return function(_0x5efaf0){if(_0x5efaf0){return _0x5efaf0['destroy']()[_0x03ef('0x22')](function(){var _0x38a7c5=_0x5efaf0['get']({'plain':!![]});var _0x305829=_0x03ef('0x23');return db[_0x03ef('0x24')]['destroy']({'where':{'type':_0x305829,'resourceId':_0x38a7c5['id']}})[_0x03ef('0x22')](function(){return _0x5efaf0;});})[_0x03ef('0x22')](function(){_0x13b033[_0x03ef('0x17')](0xcc)[_0x03ef('0x18')]();});}};}function handleEntityNotFound(_0x1d1a51,_0x1b766b){return function(_0x538a5d){if(!_0x538a5d){_0x1d1a51['sendStatus'](0x194);}return _0x538a5d;};}function handleError(_0x29c965,_0x5a2bd5){_0x5a2bd5=_0x5a2bd5||0x1f4;return function(_0x39f762){logger[_0x03ef('0x25')](_0x39f762[_0x03ef('0x26')]);if(_0x39f762['name']){delete _0x39f762[_0x03ef('0x27')];}_0x29c965[_0x03ef('0x17')](_0x5a2bd5)[_0x03ef('0x28')](_0x39f762);};}exports[_0x03ef('0x29')]=function(_0x53658c,_0x4711df){var _0x2cd00c={},_0xf38b61={},_0x154c6f={'count':0x0,'rows':[]};var _0x54c07e=_[_0x03ef('0x2a')](db[_0x03ef('0x2b')][_0x03ef('0x2c')],function(_0x4ba338){return{'name':_0x4ba338[_0x03ef('0x2d')],'type':_0x4ba338[_0x03ef('0x2e')][_0x03ef('0x2f')]};});_0xf38b61[_0x03ef('0x30')]=_[_0x03ef('0x2a')](_0x54c07e,'name');_0xf38b61[_0x03ef('0x31')]=_[_0x03ef('0x32')](_0x53658c[_0x03ef('0x31')]);_0xf38b61[_0x03ef('0x33')]=_[_0x03ef('0x34')](_0xf38b61['model'],_0xf38b61[_0x03ef('0x31')]);_0x2cd00c[_0x03ef('0x35')]=_[_0x03ef('0x34')](_0xf38b61[_0x03ef('0x30')],qs[_0x03ef('0x36')](_0x53658c['query']['fields']));_0x2cd00c[_0x03ef('0x35')]=_0x2cd00c[_0x03ef('0x35')]['length']?_0x2cd00c[_0x03ef('0x35')]:_0xf38b61['model'];if(!_0x53658c[_0x03ef('0x31')][_0x03ef('0x37')]('nolimit')){_0x2cd00c[_0x03ef('0x1c')]=qs['limit'](_0x53658c[_0x03ef('0x31')][_0x03ef('0x1c')]);_0x2cd00c['offset']=qs['offset'](_0x53658c[_0x03ef('0x31')][_0x03ef('0x19')]);}_0x2cd00c['order']=qs[_0x03ef('0x38')](_0x53658c[_0x03ef('0x31')][_0x03ef('0x38')]);_0x2cd00c[_0x03ef('0x39')]=qs[_0x03ef('0x33')](_[_0x03ef('0x3a')](_0x53658c[_0x03ef('0x31')],_0xf38b61[_0x03ef('0x33')]),_0x54c07e);if(_0x53658c['query'][_0x03ef('0x3b')]){_0x2cd00c[_0x03ef('0x39')]=_[_0x03ef('0x3c')](_0x2cd00c['where'],{'$or':_[_0x03ef('0x2a')](_0x54c07e,function(_0x473dfe){if(_0x473dfe[_0x03ef('0x2e')]!==_0x03ef('0x3d')){var _0x4b2f62={};_0x4b2f62[_0x473dfe[_0x03ef('0x27')]]={'$like':'%'+_0x53658c[_0x03ef('0x31')][_0x03ef('0x3b')]+'%'};return _0x4b2f62;}})});}_0x2cd00c=_[_0x03ef('0x3c')]({},_0x2cd00c,_0x53658c['options']);var _0x286555={'where':_0x2cd00c[_0x03ef('0x39')]};return db[_0x03ef('0x2b')][_0x03ef('0x1b')](_0x286555)[_0x03ef('0x22')](function(_0x177e8b){_0x154c6f[_0x03ef('0x1b')]=_0x177e8b;if(_0x53658c[_0x03ef('0x31')][_0x03ef('0x3e')]){_0x2cd00c[_0x03ef('0x3f')]=[{'all':!![]}];}return db[_0x03ef('0x2b')][_0x03ef('0x40')](_0x2cd00c);})[_0x03ef('0x22')](function(_0x8f7f42){_0x154c6f[_0x03ef('0x41')]=_0x8f7f42;return _0x154c6f;})[_0x03ef('0x22')](respondWithFilteredResult(_0x4711df,_0x2cd00c))[_0x03ef('0x42')](handleError(_0x4711df,null));};exports[_0x03ef('0x43')]=function(_0x1152d3,_0xd37ba6){var _0x3f5a8b={'raw':![],'where':{'id':_0x1152d3['params']['id']}},_0xeaffb0={};_0xeaffb0[_0x03ef('0x30')]=_[_0x03ef('0x32')](db[_0x03ef('0x2b')][_0x03ef('0x2c')]);_0xeaffb0[_0x03ef('0x31')]=_[_0x03ef('0x32')](_0x1152d3[_0x03ef('0x31')]);_0xeaffb0[_0x03ef('0x33')]=_[_0x03ef('0x34')](_0xeaffb0[_0x03ef('0x30')],_0xeaffb0[_0x03ef('0x31')]);_0x3f5a8b[_0x03ef('0x35')]=_['intersection'](_0xeaffb0[_0x03ef('0x30')],qs[_0x03ef('0x36')](_0x1152d3['query'][_0x03ef('0x36')]));_0x3f5a8b[_0x03ef('0x35')]=_0x3f5a8b['attributes'][_0x03ef('0x44')]?_0x3f5a8b[_0x03ef('0x35')]:_0xeaffb0[_0x03ef('0x30')];if(_0x1152d3['query'][_0x03ef('0x3e')]){_0x3f5a8b[_0x03ef('0x3f')]=[{'all':!![]}];}_0x3f5a8b=_['merge']({},_0x3f5a8b,_0x1152d3['options']);return db[_0x03ef('0x2b')][_0x03ef('0x45')](_0x3f5a8b)[_0x03ef('0x22')](handleEntityNotFound(_0xd37ba6,null))[_0x03ef('0x22')](respondWithResult(_0xd37ba6,null))[_0x03ef('0x42')](handleError(_0xd37ba6,null));};exports[_0x03ef('0x46')]=function(_0x27c6ca,_0x2e3145){return db[_0x03ef('0x2b')]['create'](_0x27c6ca[_0x03ef('0x47')],{})['then'](function(_0x83afeb){var _0x159f2f=_0x27c6ca['user'][_0x03ef('0x48')]({'plain':!![]});if(!_0x159f2f)throw new Error(_0x03ef('0x49'));if(_0x159f2f[_0x03ef('0x4a')]===_0x03ef('0x4b')){var _0x390483=_0x83afeb['get']({'plain':!![]});var _0x1b7e2f=_0x03ef('0x23');return db['UserProfileSection'][_0x03ef('0x45')]({'where':{'name':_0x1b7e2f,'userProfileId':_0x159f2f[_0x03ef('0x4c')]},'raw':!![]})['then'](function(_0x6efa41){if(_0x6efa41&&_0x6efa41['autoAssociation']===0x0){return db['UserProfileResource'][_0x03ef('0x46')]({'name':_0x390483[_0x03ef('0x27')],'resourceId':_0x390483['id'],'type':_0x6efa41['name'],'sectionId':_0x6efa41['id']},{})['then'](function(){return _0x83afeb;});}else{return _0x83afeb;}})[_0x03ef('0x42')](function(_0x5a5533){logger[_0x03ef('0x25')](_0x03ef('0x4d'),_0x5a5533);throw _0x5a5533;});}return _0x83afeb;})[_0x03ef('0x22')](respondWithResult(_0x2e3145,0xc9))[_0x03ef('0x42')](handleError(_0x2e3145,null));};exports[_0x03ef('0x21')]=function(_0x492b1d,_0x45723f){if(_0x492b1d['body']['id']){delete _0x492b1d[_0x03ef('0x47')]['id'];}return db[_0x03ef('0x2b')][_0x03ef('0x45')]({'where':{'id':_0x492b1d[_0x03ef('0x4e')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x45723f,null))[_0x03ef('0x22')](saveUpdates(_0x492b1d[_0x03ef('0x47')],null))[_0x03ef('0x22')](respondWithResult(_0x45723f,null))[_0x03ef('0x42')](handleError(_0x45723f,null));};exports['destroy']=function(_0x5b46a8,_0x152bb5){return db[_0x03ef('0x2b')][_0x03ef('0x45')]({'where':{'id':_0x5b46a8[_0x03ef('0x4e')]['id']}})['then'](handleEntityNotFound(_0x152bb5,null))[_0x03ef('0x22')](removeEntity(_0x152bb5,null))[_0x03ef('0x42')](handleError(_0x152bb5,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 9799d31..7b2ee06 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 _0xb432=['name','options','join','StopMixMonitor','concat','internal','findAll','agent','catch','exports','models','define','VoiceChanSpy','length','VoiceExtension','bulkCreate','then','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth','password','ChanSpy','SIP/%s,%s'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xb432,0x18d));var _0x2b43=function(_0xc5fe,_0x261bbb){_0xc5fe=_0xc5fe-0x0;var _0x3d9e2c=_0xb432[_0xc5fe];return _0x3d9e2c;};'use strict';var _=require(_0x2b43('0x0'));var util=require('util');var BPromise=require(_0x2b43('0x1'));var attributes=require(_0x2b43('0x2'));var getUserApplications=function(_0x36548e,_0x30d191,_0x570159){var _0x3ed16c=0x1;var _0x27055f=[];var _0x326f83={'context':_0x30d191[_0x2b43('0x3')]||_0x2b43('0x4'),'exten':util[_0x2b43('0x5')](_0x2b43('0x6'),_0x36548e[_0x2b43('0x7')],_0x570159),'type':_0x2b43('0x8'),'isApp':![],'ChanSpyId':_0x36548e['id'],'UserId':_0x30d191['id']};_0x27055f[_0x2b43('0x9')](_[_0x2b43('0xa')]({'app':_0x2b43('0xb'),'appdata':util[_0x2b43('0x5')](_0x2b43('0xc'),_0x2b43('0xd')),'priority':_0x3ed16c++},_0x326f83));if(_0x36548e[_0x2b43('0xe')]){_0x27055f[_0x2b43('0x9')](_[_0x2b43('0xa')]({'app':_0x2b43('0xf'),'appdata':util[_0x2b43('0x5')](_0x2b43('0x10'),_0x36548e['recordingFormat']),'priority':_0x3ed16c++},_0x326f83));}if(_0x36548e[_0x2b43('0x11')]){_0x27055f[_0x2b43('0x9')](_['merge']({'app':'Authenticate','appdata':_0x36548e[_0x2b43('0x12')],'priority':_0x3ed16c++},_0x326f83));}_0x27055f[_0x2b43('0x9')](_[_0x2b43('0xa')]({'app':_0x2b43('0x13'),'appdata':util[_0x2b43('0x5')](_0x2b43('0x14'),_0x30d191[_0x2b43('0x15')],_0x36548e[_0x2b43('0x16')]?_0x36548e['options'][_0x2b43('0x17')](''):''),'priority':_0x3ed16c++},_0x326f83));if(_0x36548e[_0x2b43('0xe')]){_0x27055f['push'](_[_0x2b43('0xa')]({'app':_0x2b43('0x18'),'priority':_0x3ed16c++},_0x326f83));}return _0x27055f;};var getChanSpyApplications=function(_0x174edc,_0x58a05d){var _0x170062=[];for(var _0x10d5cd=0x0,_0xb1b9b3=0x1;_0x10d5cd<_0x58a05d['length'];_0x10d5cd++,_0xb1b9b3=0x1){_0x170062=_0x170062[_0x2b43('0x19')](getUserApplications(_0x174edc,_0x58a05d[_0x10d5cd],_0x58a05d[_0x10d5cd]['internal']));if(_0x58a05d[_0x10d5cd][_0x2b43('0x1a')]!=_0x58a05d[_0x10d5cd][_0x2b43('0x15')]){_0x170062=_0x170062[_0x2b43('0x19')](getUserApplications(_0x174edc,_0x58a05d[_0x10d5cd],_0x58a05d[_0x10d5cd][_0x2b43('0x15')]));}}return _0x170062;};var getChanSpyPromise=function(_0x4479b9,_0x1610f9){return new BPromise(function(_0xa22f8c,_0x39cd9d){return _0x4479b9['User'][_0x2b43('0x1b')]({'attributes':['id',_0x2b43('0x15'),_0x2b43('0x1a')],'where':{'role':_0x2b43('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x64959c){if(_0x64959c){return _0xa22f8c(getChanSpyApplications(_0x1610f9,_0x64959c));}return _0xa22f8c([]);})[_0x2b43('0x1d')](function(_0x21d2df){_0x39cd9d(_0x21d2df);});});};module[_0x2b43('0x1e')]=function(_0x3e10b5,_0x4f62ed){var _0x20ab8b=_0x3e10b5[_0x2b43('0x1f')];return _0x3e10b5[_0x2b43('0x20')](_0x2b43('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x29a660,_0x1e4a53,_0x2c55eb){return getChanSpyPromise(_0x20ab8b,_0x29a660)['then'](function(_0x27edb6){if(_0x27edb6&&_0x27edb6[_0x2b43('0x22')]){return _0x20ab8b[_0x2b43('0x23')][_0x2b43('0x24')](_0x27edb6);}})['then'](function(){_0x2c55eb();})[_0x2b43('0x1d')](function(_0x3b6e62){_0x2c55eb(_0x3b6e62);});},'afterUpdate':function(_0x3ed4c7,_0x2032af,_0x5f4851){return _0x20ab8b[_0x2b43('0x23')]['destroy']({'where':{'ChanSpyId':_0x3ed4c7['id']}})['then'](function(){return getChanSpyPromise(_0x20ab8b,_0x3ed4c7);})['then'](function(_0x3b9e11){if(_0x3b9e11&&_0x3b9e11[_0x2b43('0x22')]){return _0x20ab8b[_0x2b43('0x23')][_0x2b43('0x24')](_0x3b9e11);}})[_0x2b43('0x25')](function(){_0x5f4851();})[_0x2b43('0x1d')](function(_0x3cfe2f){_0x5f4851(_0x3cfe2f);});},'afterDestroy':function(_0x3a675e,_0x187fe1,_0x3660e7){return _0x20ab8b[_0x2b43('0x23')]['destroy']({'where':{'ChanSpyId':_0x3a675e['id']}})[_0x2b43('0x25')](function(){_0x3660e7();})[_0x2b43('0x1d')](function(_0x3e354d){_0x3660e7(_0x3e354d);});}}});}; \ No newline at end of file +var _0x63a1=['MixMonitor','recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','findAll','agent','then','catch','define','voice_chanspy','VoiceExtension','bulkCreate','destroy','bluebird','./voiceChanSpy.attributes','context','from-sip','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy','record'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x63a1,0x9d));var _0x163a=function(_0x2d090b,_0xe34d4c){_0x2d090b=_0x2d090b-0x0;var _0x4022a4=_0x63a1[_0x2d090b];return _0x4022a4;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x163a('0x0'));var attributes=require(_0x163a('0x1'));var getUserApplications=function(_0x3361d2,_0x1cc150,_0x582c8a){var _0x5ce70c=0x1;var _0x4d5293=[];var _0x4e4c9f={'context':_0x1cc150[_0x163a('0x2')]||_0x163a('0x3'),'exten':util['format']('%s%s',_0x3361d2[_0x163a('0x4')],_0x582c8a),'type':_0x163a('0x5'),'isApp':![],'ChanSpyId':_0x3361d2['id'],'UserId':_0x1cc150['id']};_0x4d5293[_0x163a('0x6')](_[_0x163a('0x7')]({'app':_0x163a('0x8'),'appdata':util[_0x163a('0x9')](_0x163a('0xa'),_0x163a('0xb')),'priority':_0x5ce70c++},_0x4e4c9f));if(_0x3361d2[_0x163a('0xc')]){_0x4d5293['push'](_[_0x163a('0x7')]({'app':_0x163a('0xd'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x3361d2[_0x163a('0xe')]),'priority':_0x5ce70c++},_0x4e4c9f));}if(_0x3361d2['auth']){_0x4d5293['push'](_[_0x163a('0x7')]({'app':'Authenticate','appdata':_0x3361d2[_0x163a('0xf')],'priority':_0x5ce70c++},_0x4e4c9f));}_0x4d5293['push'](_[_0x163a('0x7')]({'app':_0x163a('0x10'),'appdata':util[_0x163a('0x9')](_0x163a('0x11'),_0x1cc150[_0x163a('0x12')],_0x3361d2[_0x163a('0x13')]?_0x3361d2[_0x163a('0x13')][_0x163a('0x14')](''):''),'priority':_0x5ce70c++},_0x4e4c9f));if(_0x3361d2[_0x163a('0xc')]){_0x4d5293['push'](_[_0x163a('0x7')]({'app':'StopMixMonitor','priority':_0x5ce70c++},_0x4e4c9f));}return _0x4d5293;};var getChanSpyApplications=function(_0x47050b,_0x167ed0){var _0x455884=[];for(var _0x26e820=0x0,_0x3bc1ce=0x1;_0x26e820<_0x167ed0[_0x163a('0x15')];_0x26e820++,_0x3bc1ce=0x1){_0x455884=_0x455884[_0x163a('0x16')](getUserApplications(_0x47050b,_0x167ed0[_0x26e820],_0x167ed0[_0x26e820][_0x163a('0x17')]));if(_0x167ed0[_0x26e820][_0x163a('0x17')]!=_0x167ed0[_0x26e820][_0x163a('0x12')]){_0x455884=_0x455884['concat'](getUserApplications(_0x47050b,_0x167ed0[_0x26e820],_0x167ed0[_0x26e820][_0x163a('0x12')]));}}return _0x455884;};var getChanSpyPromise=function(_0x104458,_0x39cbef){return new BPromise(function(_0x2e4d18,_0xe018d3){return _0x104458[_0x163a('0x18')][_0x163a('0x19')]({'attributes':['id',_0x163a('0x12'),'internal'],'where':{'role':_0x163a('0x1a'),'chanspy':!![]},'raw':!![]})[_0x163a('0x1b')](function(_0x29bad5){if(_0x29bad5){return _0x2e4d18(getChanSpyApplications(_0x39cbef,_0x29bad5));}return _0x2e4d18([]);})[_0x163a('0x1c')](function(_0x11346a){_0xe018d3(_0x11346a);});});};module['exports']=function(_0x28f395,_0x39805a){var _0x3ad59f=_0x28f395['models'];return _0x28f395[_0x163a('0x1d')]('VoiceChanSpy',attributes,{'tableName':_0x163a('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x452823,_0x41e590,_0x190512){return getChanSpyPromise(_0x3ad59f,_0x452823)['then'](function(_0x206700){if(_0x206700&&_0x206700['length']){return _0x3ad59f[_0x163a('0x1f')][_0x163a('0x20')](_0x206700);}})['then'](function(){_0x190512();})[_0x163a('0x1c')](function(_0x2995c8){_0x190512(_0x2995c8);});},'afterUpdate':function(_0x5298d8,_0x28c4ca,_0x5c3366){return _0x3ad59f[_0x163a('0x1f')][_0x163a('0x21')]({'where':{'ChanSpyId':_0x5298d8['id']}})[_0x163a('0x1b')](function(){return getChanSpyPromise(_0x3ad59f,_0x5298d8);})['then'](function(_0x1aaee1){if(_0x1aaee1&&_0x1aaee1['length']){return _0x3ad59f[_0x163a('0x1f')][_0x163a('0x20')](_0x1aaee1);}})[_0x163a('0x1b')](function(){_0x5c3366();})['catch'](function(_0x39058b){_0x5c3366(_0x39058b);});},'afterDestroy':function(_0x3f72fc,_0x5e80f6,_0x1b68d5){return _0x3ad59f[_0x163a('0x1f')][_0x163a('0x21')]({'where':{'ChanSpyId':_0x3f72fc['id']}})[_0x163a('0x1b')](function(){_0x1b68d5();})[_0x163a('0x1c')](function(_0x436ae3){_0x1b68d5(_0x436ae3);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index b693e33..eea7639 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 _0xbc9d=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x59509b,_0x384196){_0x59509b=_0x59509b-0x0;var _0x43a850=_0xbc9d[_0x59509b];return _0x43a850;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var moment=require(_0xdbc9('0x2'));var BPromise=require(_0xdbc9('0x3'));var rs=require(_0xdbc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbc9('0x5'))(_0xdbc9('0x6'));var config=require(_0xdbc9('0x7'));var jayson=require(_0xdbc9('0x8'));var client=jayson[_0xdbc9('0x9')][_0xdbc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381a0e,_0x4a9246,_0x2dbd23){return new BPromise(function(_0x181f8a,_0x3d4918){return client['request'](_0x381a0e,_0x2dbd23)[_0xdbc9('0xb')](function(_0x53cff1){logger['info'](_0xdbc9('0xc'),_0x4a9246,_0xdbc9('0xd'));logger[_0xdbc9('0xe')](_0xdbc9('0xf'),_0x4a9246,'request\x20sent',JSON[_0xdbc9('0x10')](_0x53cff1));if(_0x53cff1[_0xdbc9('0x11')]){if(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x12')]===0x1f4){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1['error']['message']);return _0x3d4918(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1[_0xdbc9('0x11')]['message']);return _0x181f8a(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}else{logger[_0xdbc9('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0x4a9246,_0xdbc9('0xd'));_0x181f8a(_0x53cff1[_0xdbc9('0x15')]['message']);}})[_0xdbc9('0x16')](function(_0x37856d){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x37856d);_0x3d4918(_0x37856d);});});} \ No newline at end of file +var _0x87ae=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0x87ae,0xf5));var _0xe87a=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x87ae[_0x3f0b30];return _0x2748a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe87a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe87a('0x1'));var db=require(_0xe87a('0x2'))['db'];var utils=require(_0xe87a('0x3'));var logger=require('../../config/logger')(_0xe87a('0x4'));var config=require(_0xe87a('0x5'));var jayson=require(_0xe87a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x125dd3,_0x2fbd6b,_0x5dff22){return new BPromise(function(_0x379db4,_0x455b3a){return client['request'](_0x125dd3,_0x5dff22)[_0xe87a('0x7')](function(_0x278d7c){logger['info'](_0xe87a('0x8'),_0x2fbd6b,_0xe87a('0x9'));logger[_0xe87a('0xa')](_0xe87a('0xb'),_0x2fbd6b,_0xe87a('0x9'),JSON[_0xe87a('0xc')](_0x278d7c));if(_0x278d7c['error']){if(_0x278d7c['error'][_0xe87a('0xd')]===0x1f4){logger[_0xe87a('0xe')](_0xe87a('0x8'),_0x2fbd6b,_0x278d7c['error'][_0xe87a('0xf')]);return _0x455b3a(_0x278d7c[_0xe87a('0xe')]['message']);}logger[_0xe87a('0xe')](_0xe87a('0x8'),_0x2fbd6b,_0x278d7c[_0xe87a('0xe')]['message']);return _0x379db4(_0x278d7c['error']['message']);}else{logger['info'](_0xe87a('0x8'),_0x2fbd6b,_0xe87a('0x9'));_0x379db4(_0x278d7c[_0xe87a('0x10')][_0xe87a('0xf')]);}})['catch'](function(_0x415147){logger[_0xe87a('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x2fbd6b,_0x415147);_0x455b3a(_0x415147);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index eaf6e6a..4036d60 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 _0x7176=['delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x18f270,_0x4efe01){var _0x4a80f0=function(_0x483391){while(--_0x483391){_0x18f270['push'](_0x18f270['shift']());}};_0x4a80f0(++_0x4efe01);}(_0x7176,0xa3));var _0x6717=function(_0x4ddc73,_0x523949){_0x4ddc73=_0x4ddc73-0x0;var _0x167cca=_0x7176[_0x4ddc73];return _0x167cca;};'use strict';var multer=require(_0x6717('0x0'));var util=require('util');var path=require(_0x6717('0x1'));var timeout=require(_0x6717('0x2'));var express=require(_0x6717('0x3'));var router=express['Router']();var fs_extra=require(_0x6717('0x4'));var auth=require(_0x6717('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6717('0x6'));var controller=require(_0x6717('0x7'));router[_0x6717('0x8')]('/',auth[_0x6717('0x9')](),controller[_0x6717('0xa')]);router['get'](_0x6717('0xb'),auth[_0x6717('0x9')](),controller[_0x6717('0xc')]);router[_0x6717('0xd')]('/',auth[_0x6717('0x9')](),controller[_0x6717('0xe')]);router[_0x6717('0xf')](_0x6717('0xb'),auth[_0x6717('0x9')](),controller[_0x6717('0x10')]);router[_0x6717('0x11')](_0x6717('0xb'),auth[_0x6717('0x9')](),controller[_0x6717('0x12')]);module[_0x6717('0x13')]=router; \ No newline at end of file +var _0xbade=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','show','post','create','update','delete','exports','util','path'];(function(_0x16f6e4,_0x288b61){var _0x275354=function(_0x43865e){while(--_0x43865e){_0x16f6e4['push'](_0x16f6e4['shift']());}};_0x275354(++_0x288b61);}(_0xbade,0x7c));var _0xebad=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0xbade[_0x12e073];return _0x267748;};'use strict';var multer=require('multer');var util=require(_0xebad('0x0'));var path=require(_0xebad('0x1'));var timeout=require(_0xebad('0x2'));var express=require(_0xebad('0x3'));var router=express[_0xebad('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xebad('0x5'));var interaction=require(_0xebad('0x6'));var config=require(_0xebad('0x7'));var controller=require(_0xebad('0x8'));router[_0xebad('0x9')]('/',auth[_0xebad('0xa')](),controller['index']);router['get'](_0xebad('0xb'),auth[_0xebad('0xa')](),controller[_0xebad('0xc')]);router[_0xebad('0xd')]('/',auth['isAuthenticated'](),controller[_0xebad('0xe')]);router['put'](_0xebad('0xb'),auth['isAuthenticated'](),controller[_0xebad('0xf')]);router[_0xebad('0x10')](_0xebad('0xb'),auth[_0xebad('0xa')](),controller['destroy']);module[_0xebad('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e51e616..feecbab 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 _0x337d=['BOOLEAN','sequelize','exports','name','STRING'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x337d,0x17d));var _0xd337=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x337d[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0xd337('0x0'));module[_0xd337('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd337('0x2')},'description':{'type':Sequelize[_0xd337('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd337('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf470=['name','BOOLEAN','exports','STRING'];(function(_0x5e88a1,_0x3a9f75){var _0x32a879=function(_0x300eec){while(--_0x300eec){_0x5e88a1['push'](_0x5e88a1['shift']());}};_0x32a879(++_0x3a9f75);}(_0xf470,0x11a));var _0x0f47=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xf470[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require('sequelize');module[_0x0f47('0x0')]={'name':{'type':Sequelize[_0x0f47('0x1')],'unique':_0x0f47('0x2')},'description':{'type':Sequelize[_0x0f47('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x0f47('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index f64b239..f689022 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 _0xf62f=['Reload','eml-format','rimraf','zip-dir','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','undefined','offset','count','limit','Content-Range','reject','save','update','then','destroy','get','Contexts','UserProfileResource','stack','name','index','map','VoiceContext','fieldName','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','attributes','merge','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','chan_sip.so','writeFileSync'];(function(_0x285b7c,_0x295a4a){var _0x9c736f=function(_0x3f8b58){while(--_0x3f8b58){_0x285b7c['push'](_0x285b7c['shift']());}};_0x9c736f(++_0x295a4a);}(_0xf62f,0x1a1));var _0xff62=function(_0x5d4f7b,_0x5db02e){_0x5d4f7b=_0x5d4f7b-0x0;var _0x5d1bbd=_0xf62f[_0x5d4f7b];return _0x5d1bbd;};'use strict';var emlformat=require(_0xff62('0x0'));var rimraf=require(_0xff62('0x1'));var zipdir=require(_0xff62('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xff62('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xff62('0x4'));var util=require(_0xff62('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff62('0x6'));var fs=require('fs');var fs_extra=require(_0xff62('0x7'));var _=require(_0xff62('0x8'));var squel=require(_0xff62('0x9'));var crypto=require(_0xff62('0xa'));var jsforce=require(_0xff62('0xb'));var deskjs=require(_0xff62('0xc'));var toCsv=require(_0xff62('0xd'));var querystring=require(_0xff62('0xe'));var Papa=require(_0xff62('0xf'));var Redis=require(_0xff62('0x10'));var authService=require(_0xff62('0x11'));var qs=require(_0xff62('0x12'));var as=require(_0xff62('0x13'));var hardwareService=require(_0xff62('0x14'));var logger=require(_0xff62('0x15'))('api');var utils=require(_0xff62('0x16'));var config=require(_0xff62('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xff62('0x18'))['db'];var jayson=require(_0xff62('0x19'));var client=jayson[_0xff62('0x1a')][_0xff62('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x57e1a2,_0x3a4174,_0x317315,_0x25f70e){return new BPromise(function(_0x5e788c,_0x4615eb){var _0x6a4b32=_0x25f70e||client;return _0x6a4b32[_0xff62('0x1c')](_0x57e1a2,_0x317315)['then'](function(_0x17158b){logger['info'](_0xff62('0x1d'),_0x3a4174,_0xff62('0x1e'));logger[_0xff62('0x1f')](_0xff62('0x20'),_0x3a4174,_0xff62('0x1e'),JSON[_0xff62('0x21')](_0x17158b));if(_0x17158b[_0xff62('0x22')]){if(_0x17158b['error']['code']===0x1f4){logger[_0xff62('0x22')](_0xff62('0x1d'),_0x3a4174,_0x17158b[_0xff62('0x22')][_0xff62('0x23')]);return _0x4615eb(_0x17158b[_0xff62('0x22')]['message']);}logger[_0xff62('0x22')](_0xff62('0x1d'),_0x3a4174,_0x17158b[_0xff62('0x22')][_0xff62('0x23')]);return _0x5e788c(_0x17158b[_0xff62('0x22')][_0xff62('0x23')]);}else{logger[_0xff62('0x24')](_0xff62('0x1d'),_0x3a4174,_0xff62('0x1e'));_0x5e788c(_0x17158b[_0xff62('0x25')][_0xff62('0x23')]);}})[_0xff62('0x26')](function(_0x98dfa5){logger['error'](_0xff62('0x1d'),_0x3a4174,_0x98dfa5);_0x4615eb(_0x98dfa5);});});}function respondWithStatusCode(_0x46e529,_0x468042){_0x468042=_0x468042||0xcc;return function(_0x43de27){if(_0x43de27){return _0x46e529[_0xff62('0x27')](_0x468042);}return _0x46e529[_0xff62('0x28')](_0x468042)['end']();};}function respondWithResult(_0x74fc69,_0x439dd9){_0x439dd9=_0x439dd9||0xc8;return function(_0x2b7cf6){if(_0x2b7cf6){return _0x74fc69[_0xff62('0x28')](_0x439dd9)[_0xff62('0x29')](_0x2b7cf6);}};}function respondWithFilteredResult(_0x38b8e6,_0x5c8913){return function(_0x3fe83d){if(_0x3fe83d){var _0x29b51e=typeof _0x5c8913['offset']===_0xff62('0x2a')&&typeof _0x5c8913['limit']==='undefined';var _0x896b9f=_0x3fe83d['count'];var _0x8aa6b9=_0x29b51e?0x0:_0x5c8913[_0xff62('0x2b')];var _0x163669=_0x29b51e?_0x3fe83d[_0xff62('0x2c')]:_0x5c8913[_0xff62('0x2b')]+_0x5c8913[_0xff62('0x2d')];var _0x4b46fe;if(_0x163669>=_0x896b9f){_0x163669=_0x896b9f;_0x4b46fe=0xc8;}else{_0x4b46fe=0xce;}_0x38b8e6[_0xff62('0x28')](_0x4b46fe);return _0x38b8e6['set'](_0xff62('0x2e'),_0x8aa6b9+'-'+_0x163669+'/'+_0x896b9f)['json'](_0x3fe83d);}return null;};}function patchUpdates(_0x421631){return function(_0x1bec6a){try{jsonpatch['apply'](_0x1bec6a,_0x421631,!![]);}catch(_0x2702e3){return BPromise[_0xff62('0x2f')](_0x2702e3);}return _0x1bec6a[_0xff62('0x30')]();};}function saveUpdates(_0x3c6abf,_0x330f5f){return function(_0x4d2ef2){if(_0x4d2ef2){return _0x4d2ef2[_0xff62('0x31')](_0x3c6abf)[_0xff62('0x32')](function(_0x35b001){return _0x35b001;});}return null;};}function removeEntity(_0x459934,_0x5ab155){return function(_0x497519){if(_0x497519){return _0x497519[_0xff62('0x33')]()['then'](function(){var _0x39dc5a=_0x497519[_0xff62('0x34')]({'plain':!![]});var _0x27379b=_0xff62('0x35');return db[_0xff62('0x36')]['destroy']({'where':{'type':_0x27379b,'resourceId':_0x39dc5a['id']}})[_0xff62('0x32')](function(){return _0x497519;});})[_0xff62('0x32')](function(){_0x459934[_0xff62('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff925,_0x314392){return function(_0x117b0a){if(!_0x117b0a){_0x2ff925['sendStatus'](0x194);}return _0x117b0a;};}function handleError(_0x16ed5a,_0x561f0b){_0x561f0b=_0x561f0b||0x1f4;return function(_0x5a44ca){logger[_0xff62('0x22')](_0x5a44ca[_0xff62('0x37')]);if(_0x5a44ca[_0xff62('0x38')]){delete _0x5a44ca[_0xff62('0x38')];}_0x16ed5a[_0xff62('0x28')](_0x561f0b)['send'](_0x5a44ca);};}exports[_0xff62('0x39')]=function(_0x1b7d56,_0x30ab75){var _0x2d2bd7={},_0x1cb772={},_0x246f44={'count':0x0,'rows':[]};var _0x57b590=_[_0xff62('0x3a')](db[_0xff62('0x3b')]['rawAttributes'],function(_0x28ef7c){return{'name':_0x28ef7c[_0xff62('0x3c')],'type':_0x28ef7c['type'][_0xff62('0x3d')]};});_0x1cb772[_0xff62('0x3e')]=_['map'](_0x57b590,'name');_0x1cb772[_0xff62('0x3f')]=_[_0xff62('0x40')](_0x1b7d56[_0xff62('0x3f')]);_0x1cb772[_0xff62('0x41')]=_['intersection'](_0x1cb772[_0xff62('0x3e')],_0x1cb772[_0xff62('0x3f')]);_0x2d2bd7['attributes']=_[_0xff62('0x42')](_0x1cb772[_0xff62('0x3e')],qs['fields'](_0x1b7d56[_0xff62('0x3f')][_0xff62('0x43')]));_0x2d2bd7['attributes']=_0x2d2bd7['attributes'][_0xff62('0x44')]?_0x2d2bd7['attributes']:_0x1cb772[_0xff62('0x3e')];if(!_0x1b7d56[_0xff62('0x3f')][_0xff62('0x45')]('nolimit')){_0x2d2bd7['limit']=qs[_0xff62('0x2d')](_0x1b7d56[_0xff62('0x3f')][_0xff62('0x2d')]);_0x2d2bd7[_0xff62('0x2b')]=qs['offset'](_0x1b7d56['query'][_0xff62('0x2b')]);}_0x2d2bd7[_0xff62('0x46')]=qs[_0xff62('0x47')](_0x1b7d56[_0xff62('0x3f')][_0xff62('0x47')]);_0x2d2bd7['where']=qs[_0xff62('0x41')](_[_0xff62('0x48')](_0x1b7d56['query'],_0x1cb772[_0xff62('0x41')]),_0x57b590);if(_0x1b7d56[_0xff62('0x3f')][_0xff62('0x49')]){_0x2d2bd7[_0xff62('0x4a')]=_['merge'](_0x2d2bd7['where'],{'$or':_[_0xff62('0x3a')](_0x57b590,function(_0x1a9b5a){if(_0x1a9b5a[_0xff62('0x4b')]!==_0xff62('0x4c')){var _0x325646={};_0x325646[_0x1a9b5a['name']]={'$like':'%'+_0x1b7d56[_0xff62('0x3f')]['filter']+'%'};return _0x325646;}})});}_0x2d2bd7=_['merge']({},_0x2d2bd7,_0x1b7d56[_0xff62('0x4d')]);var _0x1f110f={'where':_0x2d2bd7[_0xff62('0x4a')]};return db['VoiceContext']['count'](_0x1f110f)[_0xff62('0x32')](function(_0x25ceb9){_0x246f44[_0xff62('0x2c')]=_0x25ceb9;if(_0x1b7d56['query'][_0xff62('0x4e')]){_0x2d2bd7[_0xff62('0x4f')]=[{'all':!![]}];}return db[_0xff62('0x3b')][_0xff62('0x50')](_0x2d2bd7);})['then'](function(_0x4888f1){_0x246f44[_0xff62('0x51')]=_0x4888f1;return _0x246f44;})[_0xff62('0x32')](respondWithFilteredResult(_0x30ab75,_0x2d2bd7))[_0xff62('0x26')](handleError(_0x30ab75,null));};exports[_0xff62('0x52')]=function(_0x246813,_0x46edb9){var _0x972906={'raw':![],'where':{'id':_0x246813[_0xff62('0x53')]['id']}},_0x52c5b5={};_0x52c5b5[_0xff62('0x3e')]=_[_0xff62('0x40')](db[_0xff62('0x3b')]['rawAttributes']);_0x52c5b5[_0xff62('0x3f')]=_[_0xff62('0x40')](_0x246813[_0xff62('0x3f')]);_0x52c5b5['filters']=_[_0xff62('0x42')](_0x52c5b5[_0xff62('0x3e')],_0x52c5b5[_0xff62('0x3f')]);_0x972906[_0xff62('0x54')]=_['intersection'](_0x52c5b5['model'],qs[_0xff62('0x43')](_0x246813[_0xff62('0x3f')][_0xff62('0x43')]));_0x972906[_0xff62('0x54')]=_0x972906['attributes'][_0xff62('0x44')]?_0x972906[_0xff62('0x54')]:_0x52c5b5['model'];if(_0x246813[_0xff62('0x3f')]['includeAll']){_0x972906[_0xff62('0x4f')]=[{'all':!![]}];}_0x972906=_[_0xff62('0x55')]({},_0x972906,_0x246813[_0xff62('0x4d')]);return db[_0xff62('0x3b')][_0xff62('0x56')](_0x972906)['then'](handleEntityNotFound(_0x46edb9,null))[_0xff62('0x32')](respondWithResult(_0x46edb9,null))[_0xff62('0x26')](handleError(_0x46edb9,null));};exports['create']=function(_0x2750ad,_0x4e3a12,_0x25d7ad){var _0x50bdb5;return db[_0xff62('0x3b')][_0xff62('0x57')](_0x2750ad[_0xff62('0x58')],{'raw':!![]})[_0xff62('0x32')](function(_0x4955d0){_0x50bdb5=_0x4955d0;return db[_0xff62('0x3b')][_0xff62('0x50')]({'raw':!![]});})[_0xff62('0x32')](function(_0x56765a){var _0x4ac85f=fs[_0xff62('0x59')](path[_0xff62('0x5a')](config[_0xff62('0x5b')],_0xff62('0x5c')),_0xff62('0x5d'));var _0x10dae6=ejs[_0xff62('0x5e')](_0x4ac85f,{'contexts':_0x56765a||[]});fs['writeFileSync'](_0xff62('0x5f'),_0x10dae6);})[_0xff62('0x32')](function(){return respondWithRpcPromise('Reload',_0xff62('0x57'),{'module':'chan_sip.so'});})[_0xff62('0x32')](function(){var _0x2a47ba=_0x2750ad[_0xff62('0x60')]['get']({'plain':!![]});if(!_0x2a47ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a47ba[_0xff62('0x61')]===_0xff62('0x60')){var _0x32de5d=_0x50bdb5['get']({'plain':!![]});return db['UserProfileSection'][_0xff62('0x56')]({'where':{'name':_0xff62('0x35'),'userProfileId':_0x2a47ba[_0xff62('0x62')]},'raw':!![]})[_0xff62('0x32')](function(_0x437cbf){if(_0x437cbf&&_0x437cbf[_0xff62('0x63')]===0x0){return db['UserProfileResource'][_0xff62('0x57')]({'name':_0x32de5d['name'],'resourceId':_0x32de5d['id'],'type':_0x437cbf[_0xff62('0x38')],'sectionId':_0x437cbf['id']},{})[_0xff62('0x32')](function(){return _0x50bdb5;});}else{return _0x50bdb5;}})['catch'](function(_0x456a48){logger[_0xff62('0x22')](_0xff62('0x64'),_0x456a48);throw _0x456a48;});}return _0x50bdb5;})[_0xff62('0x32')](respondWithResult(_0x4e3a12,0xc9))[_0xff62('0x26')](handleError(_0x4e3a12,null));};exports[_0xff62('0x31')]=function(_0x1c9e0e,_0x1683d5,_0x35ea71){var _0x217b34;return db[_0xff62('0x3b')]['find']({'where':{'id':_0x1c9e0e[_0xff62('0x53')]['id']}})[_0xff62('0x32')](handleEntityNotFound(_0x1683d5,null))[_0xff62('0x32')](saveUpdates(_0x1c9e0e['body'],null))[_0xff62('0x32')](function(_0x46c79a){if(_0x46c79a){_0x217b34=_0x46c79a;return db[_0xff62('0x3b')][_0xff62('0x50')]({'raw':!![]});}})[_0xff62('0x32')](function(_0x3f5aad){var _0x37b3c2=fs[_0xff62('0x59')](path['join'](config[_0xff62('0x5b')],_0xff62('0x5c')),'utf8');var _0x5084fd=ejs['render'](_0x37b3c2,{'contexts':_0x3f5aad||[]});fs['writeFileSync'](_0xff62('0x5f'),_0x5084fd);})[_0xff62('0x32')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xff62('0x65')});})['then'](function(){return _0x217b34;})[_0xff62('0x32')](respondWithResult(_0x1683d5,null))[_0xff62('0x26')](handleError(_0x1683d5,null));};exports['destroy']=function(_0x510569,_0x27c057,_0x103663){var _0x38077d;return db[_0xff62('0x3b')][_0xff62('0x56')]({'where':{'id':_0x510569[_0xff62('0x53')]['id']}})[_0xff62('0x32')](handleEntityNotFound(_0x27c057,null))['then'](removeEntity(_0x27c057,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xff62('0x32')](function(_0x48a767){var _0x556e95=fs[_0xff62('0x59')](path[_0xff62('0x5a')](config['root'],_0xff62('0x5c')),'utf8');var _0x55c4ec=ejs[_0xff62('0x5e')](_0x556e95,{'contexts':_0x48a767});fs[_0xff62('0x66')](_0xff62('0x5f'),_0x55c4ec);return respondWithRpcPromise(_0xff62('0x67'),'destroy',{'module':_0xff62('0x65')});})[_0xff62('0x26')](handleError(_0x27c057,null));}; \ No newline at end of file +var _0x04a8=['../../config/environment','../../config/license/util','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','Contexts','UserProfileResource','end','send','index','map','VoiceContext','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','type','VIRTUAL','name','merge','options','where','includeAll','include','findAll','rows','params','length','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','writeFileSync','chan_sip.so','root','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x3efa1c,_0x324128){var _0x1eb949=function(_0x2f03a8){while(--_0x2f03a8){_0x3efa1c['push'](_0x3efa1c['shift']());}};_0x1eb949(++_0x324128);}(_0x04a8,0x1e4));var _0x804a=function(_0x271478,_0x2d420e){_0x271478=_0x271478-0x0;var _0x522946=_0x04a8[_0x271478];return _0x522946;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804a('0x0'));var zipdir=require(_0x804a('0x1'));var jsonpatch=require(_0x804a('0x2'));var rp=require(_0x804a('0x3'));var moment=require(_0x804a('0x4'));var BPromise=require(_0x804a('0x5'));var Mustache=require(_0x804a('0x6'));var util=require(_0x804a('0x7'));var path=require(_0x804a('0x8'));var sox=require('sox');var csv=require(_0x804a('0x9'));var ejs=require(_0x804a('0xa'));var fs=require('fs');var fs_extra=require(_0x804a('0xb'));var _=require('lodash');var squel=require(_0x804a('0xc'));var crypto=require('crypto');var jsforce=require(_0x804a('0xd'));var deskjs=require(_0x804a('0xe'));var toCsv=require(_0x804a('0x9'));var querystring=require(_0x804a('0xf'));var Papa=require(_0x804a('0x10'));var Redis=require(_0x804a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x804a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804a('0x13'));var logger=require('../../config/logger')(_0x804a('0x14'));var utils=require('../../config/utils');var config=require(_0x804a('0x15'));var licenseUtil=require(_0x804a('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x804a('0x17'));var client=jayson[_0x804a('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c122b,_0x13d652,_0x2743fb,_0x4b6203){return new BPromise(function(_0x415cc3,_0x4b8ccf){var _0x38c5f7=_0x4b6203||client;return _0x38c5f7['request'](_0x4c122b,_0x2743fb)[_0x804a('0x19')](function(_0x4670a8){logger[_0x804a('0x1a')](_0x804a('0x1b'),_0x13d652,_0x804a('0x1c'));logger['debug'](_0x804a('0x1d'),_0x13d652,_0x804a('0x1c'),JSON[_0x804a('0x1e')](_0x4670a8));if(_0x4670a8[_0x804a('0x1f')]){if(_0x4670a8['error'][_0x804a('0x20')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x13d652,_0x4670a8[_0x804a('0x1f')][_0x804a('0x21')]);return _0x4b8ccf(_0x4670a8[_0x804a('0x1f')][_0x804a('0x21')]);}logger[_0x804a('0x1f')](_0x804a('0x1b'),_0x13d652,_0x4670a8['error'][_0x804a('0x21')]);return _0x415cc3(_0x4670a8[_0x804a('0x1f')][_0x804a('0x21')]);}else{logger[_0x804a('0x1a')](_0x804a('0x1b'),_0x13d652,'request\x20sent');_0x415cc3(_0x4670a8['result'][_0x804a('0x21')]);}})[_0x804a('0x22')](function(_0x417a5b){logger['error'](_0x804a('0x1b'),_0x13d652,_0x417a5b);_0x4b8ccf(_0x417a5b);});});}function respondWithStatusCode(_0x1deb5e,_0x1b03bd){_0x1b03bd=_0x1b03bd||0xcc;return function(_0xf76a05){if(_0xf76a05){return _0x1deb5e[_0x804a('0x23')](_0x1b03bd);}return _0x1deb5e['status'](_0x1b03bd)['end']();};}function respondWithResult(_0x246a3b,_0x3a40fe){_0x3a40fe=_0x3a40fe||0xc8;return function(_0x45fde6){if(_0x45fde6){return _0x246a3b[_0x804a('0x24')](_0x3a40fe)['json'](_0x45fde6);}};}function respondWithFilteredResult(_0x10ec51,_0x57165c){return function(_0x2b9806){if(_0x2b9806){var _0x4160e3=typeof _0x57165c[_0x804a('0x25')]==='undefined'&&typeof _0x57165c[_0x804a('0x26')]===_0x804a('0x27');var _0x525c39=_0x2b9806[_0x804a('0x28')];var _0x450834=_0x4160e3?0x0:_0x57165c[_0x804a('0x25')];var _0x2ec2dd=_0x4160e3?_0x2b9806[_0x804a('0x28')]:_0x57165c[_0x804a('0x25')]+_0x57165c[_0x804a('0x26')];var _0x3e3989;if(_0x2ec2dd>=_0x525c39){_0x2ec2dd=_0x525c39;_0x3e3989=0xc8;}else{_0x3e3989=0xce;}_0x10ec51[_0x804a('0x24')](_0x3e3989);return _0x10ec51[_0x804a('0x29')](_0x804a('0x2a'),_0x450834+'-'+_0x2ec2dd+'/'+_0x525c39)['json'](_0x2b9806);}return null;};}function patchUpdates(_0x5e1bba){return function(_0x5f3b5d){try{jsonpatch[_0x804a('0x2b')](_0x5f3b5d,_0x5e1bba,!![]);}catch(_0x360692){return BPromise['reject'](_0x360692);}return _0x5f3b5d[_0x804a('0x2c')]();};}function saveUpdates(_0x839937,_0x39963b){return function(_0x52d01f){if(_0x52d01f){return _0x52d01f['update'](_0x839937)['then'](function(_0x1ce401){return _0x1ce401;});}return null;};}function removeEntity(_0x1dbba1,_0x2cedc1){return function(_0x3e62a1){if(_0x3e62a1){return _0x3e62a1[_0x804a('0x2d')]()[_0x804a('0x19')](function(){var _0x45ea6f=_0x3e62a1['get']({'plain':!![]});var _0x5ba2da=_0x804a('0x2e');return db[_0x804a('0x2f')][_0x804a('0x2d')]({'where':{'type':_0x5ba2da,'resourceId':_0x45ea6f['id']}})[_0x804a('0x19')](function(){return _0x3e62a1;});})[_0x804a('0x19')](function(){_0x1dbba1[_0x804a('0x24')](0xcc)[_0x804a('0x30')]();});}};}function handleEntityNotFound(_0x472872,_0x5009db){return function(_0x45b509){if(!_0x45b509){_0x472872['sendStatus'](0x194);}return _0x45b509;};}function handleError(_0x142b2f,_0x447ef9){_0x447ef9=_0x447ef9||0x1f4;return function(_0x42647b){logger[_0x804a('0x1f')](_0x42647b['stack']);if(_0x42647b['name']){delete _0x42647b['name'];}_0x142b2f[_0x804a('0x24')](_0x447ef9)[_0x804a('0x31')](_0x42647b);};}exports[_0x804a('0x32')]=function(_0x1fab9c,_0x2a5798){var _0x40dfbf={},_0x4d02db={},_0x4cec40={'count':0x0,'rows':[]};var _0x12b9ff=_[_0x804a('0x33')](db[_0x804a('0x34')][_0x804a('0x35')],function(_0x32ed5e){return{'name':_0x32ed5e['fieldName'],'type':_0x32ed5e['type'][_0x804a('0x36')]};});_0x4d02db['model']=_[_0x804a('0x33')](_0x12b9ff,'name');_0x4d02db[_0x804a('0x37')]=_[_0x804a('0x38')](_0x1fab9c[_0x804a('0x37')]);_0x4d02db[_0x804a('0x39')]=_[_0x804a('0x3a')](_0x4d02db[_0x804a('0x3b')],_0x4d02db[_0x804a('0x37')]);_0x40dfbf[_0x804a('0x3c')]=_[_0x804a('0x3a')](_0x4d02db['model'],qs[_0x804a('0x3d')](_0x1fab9c[_0x804a('0x37')]['fields']));_0x40dfbf[_0x804a('0x3c')]=_0x40dfbf[_0x804a('0x3c')]['length']?_0x40dfbf[_0x804a('0x3c')]:_0x4d02db[_0x804a('0x3b')];if(!_0x1fab9c['query'][_0x804a('0x3e')](_0x804a('0x3f'))){_0x40dfbf[_0x804a('0x26')]=qs[_0x804a('0x26')](_0x1fab9c[_0x804a('0x37')]['limit']);_0x40dfbf[_0x804a('0x25')]=qs[_0x804a('0x25')](_0x1fab9c[_0x804a('0x37')][_0x804a('0x25')]);}_0x40dfbf[_0x804a('0x40')]=qs[_0x804a('0x41')](_0x1fab9c[_0x804a('0x37')]['sort']);_0x40dfbf['where']=qs[_0x804a('0x39')](_[_0x804a('0x42')](_0x1fab9c[_0x804a('0x37')],_0x4d02db[_0x804a('0x39')]),_0x12b9ff);if(_0x1fab9c[_0x804a('0x37')][_0x804a('0x43')]){_0x40dfbf['where']=_['merge'](_0x40dfbf['where'],{'$or':_[_0x804a('0x33')](_0x12b9ff,function(_0x30a520){if(_0x30a520[_0x804a('0x44')]!==_0x804a('0x45')){var _0x30c467={};_0x30c467[_0x30a520[_0x804a('0x46')]]={'$like':'%'+_0x1fab9c[_0x804a('0x37')]['filter']+'%'};return _0x30c467;}})});}_0x40dfbf=_[_0x804a('0x47')]({},_0x40dfbf,_0x1fab9c[_0x804a('0x48')]);var _0x4f400f={'where':_0x40dfbf[_0x804a('0x49')]};return db[_0x804a('0x34')][_0x804a('0x28')](_0x4f400f)[_0x804a('0x19')](function(_0x597daa){_0x4cec40[_0x804a('0x28')]=_0x597daa;if(_0x1fab9c[_0x804a('0x37')][_0x804a('0x4a')]){_0x40dfbf[_0x804a('0x4b')]=[{'all':!![]}];}return db[_0x804a('0x34')][_0x804a('0x4c')](_0x40dfbf);})[_0x804a('0x19')](function(_0x558eca){_0x4cec40[_0x804a('0x4d')]=_0x558eca;return _0x4cec40;})[_0x804a('0x19')](respondWithFilteredResult(_0x2a5798,_0x40dfbf))[_0x804a('0x22')](handleError(_0x2a5798,null));};exports['show']=function(_0x1e6333,_0x3f2032){var _0x1ddc6a={'raw':![],'where':{'id':_0x1e6333[_0x804a('0x4e')]['id']}},_0x4ace71={};_0x4ace71[_0x804a('0x3b')]=_[_0x804a('0x38')](db['VoiceContext'][_0x804a('0x35')]);_0x4ace71['query']=_[_0x804a('0x38')](_0x1e6333[_0x804a('0x37')]);_0x4ace71['filters']=_[_0x804a('0x3a')](_0x4ace71[_0x804a('0x3b')],_0x4ace71['query']);_0x1ddc6a['attributes']=_[_0x804a('0x3a')](_0x4ace71['model'],qs[_0x804a('0x3d')](_0x1e6333[_0x804a('0x37')][_0x804a('0x3d')]));_0x1ddc6a[_0x804a('0x3c')]=_0x1ddc6a[_0x804a('0x3c')][_0x804a('0x4f')]?_0x1ddc6a['attributes']:_0x4ace71[_0x804a('0x3b')];if(_0x1e6333[_0x804a('0x37')][_0x804a('0x4a')]){_0x1ddc6a['include']=[{'all':!![]}];}_0x1ddc6a=_[_0x804a('0x47')]({},_0x1ddc6a,_0x1e6333['options']);return db[_0x804a('0x34')][_0x804a('0x50')](_0x1ddc6a)[_0x804a('0x19')](handleEntityNotFound(_0x3f2032,null))[_0x804a('0x19')](respondWithResult(_0x3f2032,null))[_0x804a('0x22')](handleError(_0x3f2032,null));};exports[_0x804a('0x51')]=function(_0x161a6e,_0x1362e3,_0x28781e){var _0x426f2c;return db[_0x804a('0x34')]['create'](_0x161a6e[_0x804a('0x52')],{'raw':!![]})['then'](function(_0x5d07c0){_0x426f2c=_0x5d07c0;return db[_0x804a('0x34')]['findAll']({'raw':!![]});})[_0x804a('0x19')](function(_0x10e088){var _0x39f26a=fs[_0x804a('0x53')](path[_0x804a('0x54')](config['root'],_0x804a('0x55')),_0x804a('0x56'));var _0x37e502=ejs[_0x804a('0x57')](_0x39f26a,{'contexts':_0x10e088||[]});fs['writeFileSync'](_0x804a('0x58'),_0x37e502);})[_0x804a('0x19')](function(){return respondWithRpcPromise(_0x804a('0x59'),_0x804a('0x51'),{'module':'chan_sip.so'});})['then'](function(){var _0x34029c=_0x161a6e['user'][_0x804a('0x5a')]({'plain':!![]});if(!_0x34029c)throw new Error(_0x804a('0x5b'));if(_0x34029c[_0x804a('0x5c')]===_0x804a('0x5d')){var _0x523e71=_0x426f2c[_0x804a('0x5a')]({'plain':!![]});return db['UserProfileSection'][_0x804a('0x50')]({'where':{'name':_0x804a('0x2e'),'userProfileId':_0x34029c[_0x804a('0x5e')]},'raw':!![]})['then'](function(_0x38363d){if(_0x38363d&&_0x38363d[_0x804a('0x5f')]===0x0){return db[_0x804a('0x2f')][_0x804a('0x51')]({'name':_0x523e71[_0x804a('0x46')],'resourceId':_0x523e71['id'],'type':_0x38363d['name'],'sectionId':_0x38363d['id']},{})[_0x804a('0x19')](function(){return _0x426f2c;});}else{return _0x426f2c;}})[_0x804a('0x22')](function(_0x1999eb){logger[_0x804a('0x1f')](_0x804a('0x60'),_0x1999eb);throw _0x1999eb;});}return _0x426f2c;})[_0x804a('0x19')](respondWithResult(_0x1362e3,0xc9))[_0x804a('0x22')](handleError(_0x1362e3,null));};exports[_0x804a('0x61')]=function(_0x35e822,_0x192c23,_0x5c6bfd){var _0x29e732;return db[_0x804a('0x34')][_0x804a('0x50')]({'where':{'id':_0x35e822[_0x804a('0x4e')]['id']}})[_0x804a('0x19')](handleEntityNotFound(_0x192c23,null))['then'](saveUpdates(_0x35e822[_0x804a('0x52')],null))[_0x804a('0x19')](function(_0x42a971){if(_0x42a971){_0x29e732=_0x42a971;return db[_0x804a('0x34')]['findAll']({'raw':!![]});}})[_0x804a('0x19')](function(_0x566e85){var _0x50a18e=fs[_0x804a('0x53')](path[_0x804a('0x54')](config['root'],_0x804a('0x55')),_0x804a('0x56'));var _0x5c23da=ejs[_0x804a('0x57')](_0x50a18e,{'contexts':_0x566e85||[]});fs[_0x804a('0x62')](_0x804a('0x58'),_0x5c23da);})[_0x804a('0x19')](function(){return respondWithRpcPromise(_0x804a('0x59'),_0x804a('0x61'),{'module':_0x804a('0x63')});})[_0x804a('0x19')](function(){return _0x29e732;})['then'](respondWithResult(_0x192c23,null))[_0x804a('0x22')](handleError(_0x192c23,null));};exports[_0x804a('0x2d')]=function(_0x5f4a87,_0x3547f5,_0x6f3dbc){var _0x58e57c;return db[_0x804a('0x34')][_0x804a('0x50')]({'where':{'id':_0x5f4a87[_0x804a('0x4e')]['id']}})[_0x804a('0x19')](handleEntityNotFound(_0x3547f5,null))[_0x804a('0x19')](removeEntity(_0x3547f5,null))[_0x804a('0x19')](function(){return db[_0x804a('0x34')]['findAll']({'raw':!![]});})['then'](function(_0x139d8b){var _0x3ed006=fs[_0x804a('0x53')](path[_0x804a('0x54')](config[_0x804a('0x64')],_0x804a('0x55')),_0x804a('0x56'));var _0x429a02=ejs['render'](_0x3ed006,{'contexts':_0x139d8b});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x429a02);return respondWithRpcPromise(_0x804a('0x59'),_0x804a('0x2d'),{'module':'chan_sip.so'});})[_0x804a('0x22')](handleError(_0x3547f5,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index be049c6..39ec8a1 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 _0x102b=['path','rimraf','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','request-promise'];(function(_0x73d01c,_0x28e57){var _0x36478d=function(_0x57d69d){while(--_0x57d69d){_0x73d01c['push'](_0x73d01c['shift']());}};_0x36478d(++_0x28e57);}(_0x102b,0xeb));var _0xb102=function(_0x4a8f59,_0x4c05a4){_0x4a8f59=_0x4a8f59-0x0;var _0x75eb77=_0x102b[_0x4a8f59];return _0x75eb77;};'use strict';var _=require(_0xb102('0x0'));var util=require('util');var logger=require(_0xb102('0x1'))(_0xb102('0x2'));var moment=require(_0xb102('0x3'));var BPromise=require('bluebird');var rp=require(_0xb102('0x4'));var fs=require('fs');var path=require(_0xb102('0x5'));var rimraf=require(_0xb102('0x6'));var config=require(_0xb102('0x7'));var attributes=require('./voiceContext.attributes');module[_0xb102('0x8')]=function(_0x10fa2b,_0x940ace){return _0x10fa2b[_0xb102('0x9')](_0xb102('0xa'),attributes,{'tableName':_0xb102('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ee6=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts','lodash','util'];(function(_0x368b0c,_0x20da2e){var _0x11da70=function(_0x5c1865){while(--_0x5c1865){_0x368b0c['push'](_0x368b0c['shift']());}};_0x11da70(++_0x20da2e);}(_0x0ee6,0x106));var _0x60ee=function(_0x548647,_0x127146){_0x548647=_0x548647-0x0;var _0x5af8be=_0x0ee6[_0x548647];return _0x5af8be;};'use strict';var _=require(_0x60ee('0x0'));var util=require(_0x60ee('0x1'));var logger=require('../../config/logger')(_0x60ee('0x2'));var moment=require(_0x60ee('0x3'));var BPromise=require(_0x60ee('0x4'));var rp=require(_0x60ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60ee('0x6'));var config=require(_0x60ee('0x7'));var attributes=require(_0x60ee('0x8'));module[_0x60ee('0x9')]=function(_0x43b019,_0x49ba32){return _0x43b019['define'](_0x60ee('0xa'),attributes,{'tableName':_0x60ee('0xb'),'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 74f0849..c745ece 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 _0x6888=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x187537,_0x20ca9d){var _0x529c61=function(_0x495083){while(--_0x495083){_0x187537['push'](_0x187537['shift']());}};_0x529c61(++_0x20ca9d);}(_0x6888,0xd2));var _0x8688=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6888[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8688('0x0'));var util=require('util');var moment=require(_0x8688('0x1'));var BPromise=require(_0x8688('0x2'));var rs=require(_0x8688('0x3'));var fs=require('fs');var Redis=require(_0x8688('0x4'));var db=require(_0x8688('0x5'))['db'];var utils=require(_0x8688('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8688('0x7'));var jayson=require(_0x8688('0x8'));var client=jayson[_0x8688('0x9')][_0x8688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfa1a28,_0xcc92be,_0x5860a8){return new BPromise(function(_0x457991,_0x15f2b9){return client[_0x8688('0xb')](_0xfa1a28,_0x5860a8)[_0x8688('0xc')](function(_0x18723c){logger['info']('VoiceContext,\x20%s,\x20%s',_0xcc92be,_0x8688('0xd'));logger[_0x8688('0xe')](_0x8688('0xf'),_0xcc92be,_0x8688('0xd'),JSON[_0x8688('0x10')](_0x18723c));if(_0x18723c[_0x8688('0x11')]){if(_0x18723c[_0x8688('0x11')][_0x8688('0x12')]===0x1f4){logger[_0x8688('0x11')]('VoiceContext,\x20%s,\x20%s',_0xcc92be,_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);return _0x15f2b9(_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);}logger[_0x8688('0x11')](_0x8688('0x14'),_0xcc92be,_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);return _0x457991(_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);}else{logger[_0x8688('0x15')](_0x8688('0x14'),_0xcc92be,'request\x20sent');_0x457991(_0x18723c[_0x8688('0x16')][_0x8688('0x13')]);}})[_0x8688('0x17')](function(_0x5ef2e6){logger[_0x8688('0x11')](_0x8688('0x14'),_0xcc92be,_0x5ef2e6);_0x15f2b9(_0x5ef2e6);});});} \ No newline at end of file +var _0x608a=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info'];(function(_0x13f93d,_0x40f289){var _0x26e77c=function(_0x575de3){while(--_0x575de3){_0x13f93d['push'](_0x13f93d['shift']());}};_0x26e77c(++_0x40f289);}(_0x608a,0xff));var _0xa608=function(_0x39578e,_0x40b029){_0x39578e=_0x39578e-0x0;var _0x145744=_0x608a[_0x39578e];return _0x145744;};'use strict';var _=require('lodash');var util=require(_0xa608('0x0'));var moment=require(_0xa608('0x1'));var BPromise=require('bluebird');var rs=require(_0xa608('0x2'));var fs=require('fs');var Redis=require(_0xa608('0x3'));var db=require(_0xa608('0x4'))['db'];var utils=require(_0xa608('0x5'));var logger=require('../../config/logger')(_0xa608('0x6'));var config=require(_0xa608('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa608('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50395e,_0x2a2408,_0x46d6a7){return new BPromise(function(_0x6d5537,_0x516260){return client[_0xa608('0x9')](_0x50395e,_0x46d6a7)['then'](function(_0x27c4c4){logger[_0xa608('0xa')]('VoiceContext,\x20%s,\x20%s',_0x2a2408,_0xa608('0xb'));logger[_0xa608('0xc')](_0xa608('0xd'),_0x2a2408,_0xa608('0xb'),JSON['stringify'](_0x27c4c4));if(_0x27c4c4[_0xa608('0xe')]){if(_0x27c4c4[_0xa608('0xe')][_0xa608('0xf')]===0x1f4){logger[_0xa608('0xe')](_0xa608('0x10'),_0x2a2408,_0x27c4c4['error'][_0xa608('0x11')]);return _0x516260(_0x27c4c4[_0xa608('0xe')]['message']);}logger['error'](_0xa608('0x10'),_0x2a2408,_0x27c4c4[_0xa608('0xe')][_0xa608('0x11')]);return _0x6d5537(_0x27c4c4[_0xa608('0xe')]['message']);}else{logger[_0xa608('0xa')](_0xa608('0x10'),_0x2a2408,'request\x20sent');_0x6d5537(_0x27c4c4[_0xa608('0x12')][_0xa608('0x11')]);}})['catch'](function(_0x573bc7){logger['error'](_0xa608('0x10'),_0x2a2408,_0x573bc7);_0x516260(_0x573bc7);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 6b83c85..7ff525d 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 _0xb48d=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','update','exports','multer'];(function(_0x349793,_0x534b25){var _0x21f9cd=function(_0x2054e5){while(--_0x2054e5){_0x349793['push'](_0x349793['shift']());}};_0x21f9cd(++_0x534b25);}(_0xb48d,0x194));var _0xdb48=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xb48d[_0x3fba9f];return _0x192cf1;};'use strict';var multer=require(_0xdb48('0x0'));var util=require('util');var path=require(_0xdb48('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb48('0x2'));var router=express[_0xdb48('0x3')]();var fs_extra=require(_0xdb48('0x4'));var auth=require(_0xdb48('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdb48('0x6'));var controller=require('./voiceDialReport.controller');router[_0xdb48('0x7')]('/',auth[_0xdb48('0x8')](),controller[_0xdb48('0x9')]);router['get']('/describe',auth[_0xdb48('0x8')](),controller[_0xdb48('0xa')]);router['get'](_0xdb48('0xb'),auth[_0xdb48('0x8')](),controller['show']);router[_0xdb48('0xc')]('/',auth[_0xdb48('0x8')](),controller['create']);router['put'](_0xdb48('0xb'),auth[_0xdb48('0x8')](),controller[_0xdb48('0xd')]);router['delete'](_0xdb48('0xb'),auth[_0xdb48('0x8')](),controller['destroy']);module[_0xdb48('0xe')]=router; \ No newline at end of file +var _0x50ab=['../../components/auth/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','/describe','describe','/:id','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4fa693,_0x56a655){var _0x58afed=function(_0x4573af){while(--_0x4573af){_0x4fa693['push'](_0x4fa693['shift']());}};_0x58afed(++_0x56a655);}(_0x50ab,0xf1));var _0xb50a=function(_0x45f864,_0x11ce66){_0x45f864=_0x45f864-0x0;var _0x4ed958=_0x50ab[_0x45f864];return _0x4ed958;};'use strict';var multer=require('multer');var util=require(_0xb50a('0x0'));var path=require(_0xb50a('0x1'));var timeout=require(_0xb50a('0x2'));var express=require(_0xb50a('0x3'));var router=express[_0xb50a('0x4')]();var fs_extra=require(_0xb50a('0x5'));var auth=require(_0xb50a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb50a('0x7'));var controller=require(_0xb50a('0x8'));router['get']('/',auth[_0xb50a('0x9')](),controller['index']);router[_0xb50a('0xa')](_0xb50a('0xb'),auth[_0xb50a('0x9')](),controller[_0xb50a('0xc')]);router['get'](_0xb50a('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb50a('0x9')](),controller[_0xb50a('0xe')]);router['put'](_0xb50a('0xd'),auth[_0xb50a('0x9')](),controller[_0xb50a('0xf')]);router[_0xb50a('0x10')]('/:id',auth[_0xb50a('0x9')](),controller[_0xb50a('0x11')]);module[_0xb50a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index c5c542a..f8605cb 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 _0xe14d=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0xe14d,0x1ee));var _0xde14=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xe14d[_0x455c6c];return _0x488242;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'privilege':{'type':Sequelize[_0xde14('0x2')]},'channel':{'type':Sequelize[_0xde14('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'calleridnum':{'type':Sequelize[_0xde14('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'connectedlinename':{'type':Sequelize[_0xde14('0x2')]},'language':{'type':Sequelize[_0xde14('0x2')]},'accountcode':{'type':Sequelize[_0xde14('0x2')]},'context':{'type':Sequelize[_0xde14('0x2')]},'exten':{'type':Sequelize[_0xde14('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xde14('0x2')]},'destchannel':{'type':Sequelize[_0xde14('0x2')]},'destchannelstate':{'type':Sequelize[_0xde14('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'destcalleridnum':{'type':Sequelize[_0xde14('0x2')]},'destcalleridname':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xde14('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xde14('0x2')]},'destcontext':{'type':Sequelize[_0xde14('0x2')]},'destexten':{'type':Sequelize[_0xde14('0x2')]},'destpriority':{'type':Sequelize[_0xde14('0x3')]},'destuniqueid':{'type':Sequelize[_0xde14('0x2')]},'destlinkedid':{'type':Sequelize[_0xde14('0x2')]},'dialstring':{'type':Sequelize[_0xde14('0x2')]},'dialstatus':{'type':Sequelize[_0xde14('0x2')]},'starttime':{'type':Sequelize[_0xde14('0x4')]},'answertime':{'type':Sequelize[_0xde14('0x4')]},'endtime':{'type':Sequelize[_0xde14('0x4')]},'lastevent':{'type':Sequelize[_0xde14('0x2')],'comment':_0xde14('0x5')},'routeId':{'type':Sequelize[_0xde14('0x3')]},'duration':{'type':Sequelize[_0xde14('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index d468fa3..716f394 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 _0xb823=['filter','where','merge','map','VIRTUAL','VoiceDialReport','findAll','rows','show','params','keys','includeAll','include','catch','create','update','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','stack','name','index','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xb823,0xa7));var _0x3b82=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0xb823[_0xf5d71c];return _0x5af672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b82('0x0'));var zipdir=require(_0x3b82('0x1'));var jsonpatch=require(_0x3b82('0x2'));var rp=require(_0x3b82('0x3'));var moment=require('moment');var BPromise=require(_0x3b82('0x4'));var Mustache=require(_0x3b82('0x5'));var util=require('util');var path=require(_0x3b82('0x6'));var sox=require(_0x3b82('0x7'));var csv=require(_0x3b82('0x8'));var ejs=require(_0x3b82('0x9'));var fs=require('fs');var fs_extra=require(_0x3b82('0xa'));var _=require(_0x3b82('0xb'));var squel=require(_0x3b82('0xc'));var crypto=require(_0x3b82('0xd'));var jsforce=require(_0x3b82('0xe'));var deskjs=require(_0x3b82('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3b82('0x10'));var Papa=require(_0x3b82('0x11'));var Redis=require(_0x3b82('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3b82('0x13'));var as=require(_0x3b82('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b82('0x15'))(_0x3b82('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3b82('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501c65,_0x938470){_0x938470=_0x938470||0xcc;return function(_0x1b9a0d){if(_0x1b9a0d){return _0x501c65['sendStatus'](_0x938470);}return _0x501c65['status'](_0x938470)[_0x3b82('0x18')]();};}function respondWithResult(_0x405612,_0x136e4b){_0x136e4b=_0x136e4b||0xc8;return function(_0x387613){if(_0x387613){return _0x405612[_0x3b82('0x19')](_0x136e4b)[_0x3b82('0x1a')](_0x387613);}};}function respondWithFilteredResult(_0x58ee49,_0x3b4a86){return function(_0x26f2f6){if(_0x26f2f6){var _0x3a8bab=typeof _0x3b4a86['offset']===_0x3b82('0x1b')&&typeof _0x3b4a86[_0x3b82('0x1c')]===_0x3b82('0x1b');var _0x22d5f1=_0x26f2f6[_0x3b82('0x1d')];var _0x8eff77=_0x3a8bab?0x0:_0x3b4a86['offset'];var _0x18466f=_0x3a8bab?_0x26f2f6[_0x3b82('0x1d')]:_0x3b4a86[_0x3b82('0x1e')]+_0x3b4a86[_0x3b82('0x1c')];var _0x1f6695;if(_0x18466f>=_0x22d5f1){_0x18466f=_0x22d5f1;_0x1f6695=0xc8;}else{_0x1f6695=0xce;}_0x58ee49['status'](_0x1f6695);return _0x58ee49[_0x3b82('0x1f')](_0x3b82('0x20'),_0x8eff77+'-'+_0x18466f+'/'+_0x22d5f1)['json'](_0x26f2f6);}return null;};}function patchUpdates(_0x2e1130){return function(_0x40e6bb){try{jsonpatch['apply'](_0x40e6bb,_0x2e1130,!![]);}catch(_0x3be1b6){return BPromise[_0x3b82('0x21')](_0x3be1b6);}return _0x40e6bb[_0x3b82('0x22')]();};}function saveUpdates(_0x33b998,_0x1c5c96){return function(_0x3def32){if(_0x3def32){return _0x3def32['update'](_0x33b998)[_0x3b82('0x23')](function(_0x38580c){return _0x38580c;});}return null;};}function removeEntity(_0x55733b,_0x47bf19){return function(_0x50b0d4){if(_0x50b0d4){return _0x50b0d4[_0x3b82('0x24')]()[_0x3b82('0x23')](function(){_0x55733b[_0x3b82('0x19')](0xcc)[_0x3b82('0x18')]();});}};}function handleEntityNotFound(_0x13d66c,_0x295f01){return function(_0x4c7899){if(!_0x4c7899){_0x13d66c[_0x3b82('0x25')](0x194);}return _0x4c7899;};}function handleError(_0x4e29f0,_0x5c1991){_0x5c1991=_0x5c1991||0x1f4;return function(_0x5868cd){logger['error'](_0x5868cd[_0x3b82('0x26')]);if(_0x5868cd[_0x3b82('0x27')]){delete _0x5868cd[_0x3b82('0x27')];}_0x4e29f0[_0x3b82('0x19')](_0x5c1991)['send'](_0x5868cd);};}exports[_0x3b82('0x28')]=function(_0x1cc593,_0x573297){var _0x6bf6c9={},_0x5a22e5={},_0x5f498a={'count':0x0,'rows':[]};var _0x2ffc2e=_['map'](db['VoiceDialReport']['rawAttributes'],function(_0x396f47){return{'name':_0x396f47['fieldName'],'type':_0x396f47[_0x3b82('0x29')][_0x3b82('0x2a')]};});_0x5a22e5['model']=_['map'](_0x2ffc2e,_0x3b82('0x27'));_0x5a22e5['query']=_['keys'](_0x1cc593[_0x3b82('0x2b')]);_0x5a22e5[_0x3b82('0x2c')]=_[_0x3b82('0x2d')](_0x5a22e5[_0x3b82('0x2e')],_0x5a22e5[_0x3b82('0x2b')]);_0x6bf6c9['attributes']=_[_0x3b82('0x2d')](_0x5a22e5[_0x3b82('0x2e')],qs[_0x3b82('0x2f')](_0x1cc593[_0x3b82('0x2b')][_0x3b82('0x2f')]));_0x6bf6c9[_0x3b82('0x30')]=_0x6bf6c9[_0x3b82('0x30')][_0x3b82('0x31')]?_0x6bf6c9[_0x3b82('0x30')]:_0x5a22e5[_0x3b82('0x2e')];if(!_0x1cc593[_0x3b82('0x2b')][_0x3b82('0x32')](_0x3b82('0x33'))){_0x6bf6c9[_0x3b82('0x1c')]=qs['limit'](_0x1cc593[_0x3b82('0x2b')][_0x3b82('0x1c')]);_0x6bf6c9[_0x3b82('0x1e')]=qs[_0x3b82('0x1e')](_0x1cc593[_0x3b82('0x2b')][_0x3b82('0x1e')]);}_0x6bf6c9[_0x3b82('0x34')]=qs[_0x3b82('0x35')](_0x1cc593['query'][_0x3b82('0x35')]);_0x6bf6c9['where']=qs[_0x3b82('0x2c')](_[_0x3b82('0x36')](_0x1cc593[_0x3b82('0x2b')],_0x5a22e5[_0x3b82('0x2c')]),_0x2ffc2e);if(_0x1cc593['query'][_0x3b82('0x37')]){_0x6bf6c9[_0x3b82('0x38')]=_[_0x3b82('0x39')](_0x6bf6c9[_0x3b82('0x38')],{'$or':_[_0x3b82('0x3a')](_0x2ffc2e,function(_0x5be083){if(_0x5be083[_0x3b82('0x29')]!==_0x3b82('0x3b')){var _0xa779c7={};_0xa779c7[_0x5be083['name']]={'$like':'%'+_0x1cc593[_0x3b82('0x2b')][_0x3b82('0x37')]+'%'};return _0xa779c7;}})});}_0x6bf6c9=_[_0x3b82('0x39')]({},_0x6bf6c9,_0x1cc593['options']);var _0x231582={'where':_0x6bf6c9[_0x3b82('0x38')]};return db['VoiceDialReport'][_0x3b82('0x1d')](_0x231582)[_0x3b82('0x23')](function(_0x19388c){_0x5f498a[_0x3b82('0x1d')]=_0x19388c;if(_0x1cc593['query']['includeAll']){_0x6bf6c9['include']=[{'all':!![]}];}return db[_0x3b82('0x3c')][_0x3b82('0x3d')](_0x6bf6c9);})[_0x3b82('0x23')](function(_0x28b4e8){_0x5f498a[_0x3b82('0x3e')]=_0x28b4e8;return _0x5f498a;})['then'](respondWithFilteredResult(_0x573297,_0x6bf6c9))['catch'](handleError(_0x573297,null));};exports[_0x3b82('0x3f')]=function(_0x40b567,_0x1913b9){var _0x4af9d7={'raw':!![],'where':{'id':_0x40b567[_0x3b82('0x40')]['id']}},_0x2754e1={};_0x2754e1[_0x3b82('0x2e')]=_[_0x3b82('0x41')](db['VoiceDialReport']['rawAttributes']);_0x2754e1['query']=_[_0x3b82('0x41')](_0x40b567[_0x3b82('0x2b')]);_0x2754e1[_0x3b82('0x2c')]=_[_0x3b82('0x2d')](_0x2754e1[_0x3b82('0x2e')],_0x2754e1[_0x3b82('0x2b')]);_0x4af9d7[_0x3b82('0x30')]=_[_0x3b82('0x2d')](_0x2754e1[_0x3b82('0x2e')],qs['fields'](_0x40b567[_0x3b82('0x2b')][_0x3b82('0x2f')]));_0x4af9d7['attributes']=_0x4af9d7['attributes'][_0x3b82('0x31')]?_0x4af9d7[_0x3b82('0x30')]:_0x2754e1[_0x3b82('0x2e')];if(_0x40b567[_0x3b82('0x2b')][_0x3b82('0x42')]){_0x4af9d7[_0x3b82('0x43')]=[{'all':!![]}];}_0x4af9d7=_[_0x3b82('0x39')]({},_0x4af9d7,_0x40b567['options']);return db[_0x3b82('0x3c')]['find'](_0x4af9d7)[_0x3b82('0x23')](handleEntityNotFound(_0x1913b9,null))[_0x3b82('0x23')](respondWithResult(_0x1913b9,null))[_0x3b82('0x44')](handleError(_0x1913b9,null));};exports[_0x3b82('0x45')]=function(_0x4705c0,_0x21bd50){return db[_0x3b82('0x3c')]['create'](_0x4705c0['body'],{})['then'](respondWithResult(_0x21bd50,0xc9))['catch'](handleError(_0x21bd50,null));};exports[_0x3b82('0x46')]=function(_0x45f315,_0x328a2f){if(_0x45f315['body']['id']){delete _0x45f315[_0x3b82('0x47')]['id'];}return db[_0x3b82('0x3c')][_0x3b82('0x48')]({'where':{'id':_0x45f315[_0x3b82('0x40')]['id']}})['then'](handleEntityNotFound(_0x328a2f,null))[_0x3b82('0x23')](saveUpdates(_0x45f315[_0x3b82('0x47')],null))[_0x3b82('0x23')](respondWithResult(_0x328a2f,null))[_0x3b82('0x44')](handleError(_0x328a2f,null));};exports[_0x3b82('0x24')]=function(_0x2b9424,_0xa593ac){return db[_0x3b82('0x3c')][_0x3b82('0x48')]({'where':{'id':_0x2b9424[_0x3b82('0x40')]['id']}})[_0x3b82('0x23')](handleEntityNotFound(_0xa593ac,null))[_0x3b82('0x23')](removeEntity(_0xa593ac,null))[_0x3b82('0x44')](handleError(_0xa593ac,null));};exports[_0x3b82('0x49')]=function(_0x2aefb6,_0x1cc401){return db[_0x3b82('0x3c')][_0x3b82('0x49')]()[_0x3b82('0x23')](respondWithResult(_0x1cc401,null))[_0x3b82('0x44')](handleError(_0x1cc401,null));}; \ No newline at end of file +var _0x31d3=['rawAttributes','length','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','stack','name','send','map','VoiceDialReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params'];(function(_0x903eeb,_0x322ebe){var _0x36a1f1=function(_0x5b4924){while(--_0x5b4924){_0x903eeb['push'](_0x903eeb['shift']());}};_0x36a1f1(++_0x322ebe);}(_0x31d3,0x12c));var _0x331d=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x31d3[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require(_0x331d('0x0'));var rimraf=require(_0x331d('0x1'));var zipdir=require(_0x331d('0x2'));var jsonpatch=require(_0x331d('0x3'));var rp=require(_0x331d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x331d('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x331d('0x6'));var fs=require('fs');var fs_extra=require(_0x331d('0x7'));var _=require(_0x331d('0x8'));var squel=require('squel');var crypto=require(_0x331d('0x9'));var jsforce=require(_0x331d('0xa'));var deskjs=require(_0x331d('0xb'));var toCsv=require(_0x331d('0xc'));var querystring=require(_0x331d('0xd'));var Papa=require(_0x331d('0xe'));var Redis=require(_0x331d('0xf'));var authService=require(_0x331d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x331d('0x11'));var hardwareService=require(_0x331d('0x12'));var logger=require(_0x331d('0x13'))(_0x331d('0x14'));var utils=require('../../config/utils');var config=require(_0x331d('0x15'));var licenseUtil=require(_0x331d('0x16'));var db=require(_0x331d('0x17'))['db'];function respondWithStatusCode(_0x35bc72,_0x256bd4){_0x256bd4=_0x256bd4||0xcc;return function(_0x50eebb){if(_0x50eebb){return _0x35bc72['sendStatus'](_0x256bd4);}return _0x35bc72[_0x331d('0x18')](_0x256bd4)[_0x331d('0x19')]();};}function respondWithResult(_0x36938c,_0x3fd705){_0x3fd705=_0x3fd705||0xc8;return function(_0x56ffb5){if(_0x56ffb5){return _0x36938c[_0x331d('0x18')](_0x3fd705)[_0x331d('0x1a')](_0x56ffb5);}};}function respondWithFilteredResult(_0x59b9c4,_0x3e2010){return function(_0x269444){if(_0x269444){var _0x1e133b=typeof _0x3e2010[_0x331d('0x1b')]===_0x331d('0x1c')&&typeof _0x3e2010[_0x331d('0x1d')]===_0x331d('0x1c');var _0x2cec3a=_0x269444[_0x331d('0x1e')];var _0x408a33=_0x1e133b?0x0:_0x3e2010[_0x331d('0x1b')];var _0x10661c=_0x1e133b?_0x269444[_0x331d('0x1e')]:_0x3e2010[_0x331d('0x1b')]+_0x3e2010[_0x331d('0x1d')];var _0x1c57a6;if(_0x10661c>=_0x2cec3a){_0x10661c=_0x2cec3a;_0x1c57a6=0xc8;}else{_0x1c57a6=0xce;}_0x59b9c4['status'](_0x1c57a6);return _0x59b9c4[_0x331d('0x1f')](_0x331d('0x20'),_0x408a33+'-'+_0x10661c+'/'+_0x2cec3a)[_0x331d('0x1a')](_0x269444);}return null;};}function patchUpdates(_0x541623){return function(_0x3c537f){try{jsonpatch['apply'](_0x3c537f,_0x541623,!![]);}catch(_0x5a7b4d){return BPromise[_0x331d('0x21')](_0x5a7b4d);}return _0x3c537f[_0x331d('0x22')]();};}function saveUpdates(_0x2aa7a4,_0x3a6a25){return function(_0x4989bd){if(_0x4989bd){return _0x4989bd['update'](_0x2aa7a4)[_0x331d('0x23')](function(_0x46cef4){return _0x46cef4;});}return null;};}function removeEntity(_0x159427,_0xa634a6){return function(_0x25445d){if(_0x25445d){return _0x25445d['destroy']()[_0x331d('0x23')](function(){_0x159427[_0x331d('0x18')](0xcc)[_0x331d('0x19')]();});}};}function handleEntityNotFound(_0x257aab,_0x38d623){return function(_0x2b1970){if(!_0x2b1970){_0x257aab['sendStatus'](0x194);}return _0x2b1970;};}function handleError(_0x18f5d1,_0x543aa6){_0x543aa6=_0x543aa6||0x1f4;return function(_0x28a0d3){logger[_0x331d('0x24')](_0x28a0d3[_0x331d('0x25')]);if(_0x28a0d3[_0x331d('0x26')]){delete _0x28a0d3[_0x331d('0x26')];}_0x18f5d1['status'](_0x543aa6)[_0x331d('0x27')](_0x28a0d3);};}exports['index']=function(_0x1fa8f2,_0x3cc12d){var _0x165a14={},_0x82caf0={},_0x449ced={'count':0x0,'rows':[]};var _0x278083=_[_0x331d('0x28')](db[_0x331d('0x29')]['rawAttributes'],function(_0x15611d){return{'name':_0x15611d[_0x331d('0x2a')],'type':_0x15611d[_0x331d('0x2b')][_0x331d('0x2c')]};});_0x82caf0[_0x331d('0x2d')]=_[_0x331d('0x28')](_0x278083,_0x331d('0x26'));_0x82caf0[_0x331d('0x2e')]=_[_0x331d('0x2f')](_0x1fa8f2[_0x331d('0x2e')]);_0x82caf0[_0x331d('0x30')]=_[_0x331d('0x31')](_0x82caf0['model'],_0x82caf0[_0x331d('0x2e')]);_0x165a14[_0x331d('0x32')]=_[_0x331d('0x31')](_0x82caf0[_0x331d('0x2d')],qs[_0x331d('0x33')](_0x1fa8f2[_0x331d('0x2e')]['fields']));_0x165a14[_0x331d('0x32')]=_0x165a14[_0x331d('0x32')]['length']?_0x165a14['attributes']:_0x82caf0[_0x331d('0x2d')];if(!_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x34')](_0x331d('0x35'))){_0x165a14[_0x331d('0x1d')]=qs[_0x331d('0x1d')](_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x1d')]);_0x165a14[_0x331d('0x1b')]=qs[_0x331d('0x1b')](_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x1b')]);}_0x165a14['order']=qs[_0x331d('0x36')](_0x1fa8f2['query'][_0x331d('0x36')]);_0x165a14[_0x331d('0x37')]=qs['filters'](_[_0x331d('0x38')](_0x1fa8f2[_0x331d('0x2e')],_0x82caf0[_0x331d('0x30')]),_0x278083);if(_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x39')]){_0x165a14[_0x331d('0x37')]=_[_0x331d('0x3a')](_0x165a14['where'],{'$or':_['map'](_0x278083,function(_0x3fdce3){if(_0x3fdce3[_0x331d('0x2b')]!=='VIRTUAL'){var _0x1d3373={};_0x1d3373[_0x3fdce3['name']]={'$like':'%'+_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x39')]+'%'};return _0x1d3373;}})});}_0x165a14=_[_0x331d('0x3a')]({},_0x165a14,_0x1fa8f2[_0x331d('0x3b')]);var _0xa8ac9c={'where':_0x165a14['where']};return db[_0x331d('0x29')]['count'](_0xa8ac9c)[_0x331d('0x23')](function(_0x274a44){_0x449ced[_0x331d('0x1e')]=_0x274a44;if(_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x3c')]){_0x165a14['include']=[{'all':!![]}];}return db[_0x331d('0x29')][_0x331d('0x3d')](_0x165a14);})[_0x331d('0x23')](function(_0x3b87fb){_0x449ced['rows']=_0x3b87fb;return _0x449ced;})[_0x331d('0x23')](respondWithFilteredResult(_0x3cc12d,_0x165a14))[_0x331d('0x3e')](handleError(_0x3cc12d,null));};exports[_0x331d('0x3f')]=function(_0x5abc12,_0x2d8900){var _0x12bb6f={'raw':!![],'where':{'id':_0x5abc12[_0x331d('0x40')]['id']}},_0xec7dea={};_0xec7dea[_0x331d('0x2d')]=_['keys'](db[_0x331d('0x29')][_0x331d('0x41')]);_0xec7dea[_0x331d('0x2e')]=_[_0x331d('0x2f')](_0x5abc12[_0x331d('0x2e')]);_0xec7dea[_0x331d('0x30')]=_['intersection'](_0xec7dea[_0x331d('0x2d')],_0xec7dea[_0x331d('0x2e')]);_0x12bb6f[_0x331d('0x32')]=_['intersection'](_0xec7dea['model'],qs[_0x331d('0x33')](_0x5abc12[_0x331d('0x2e')][_0x331d('0x33')]));_0x12bb6f[_0x331d('0x32')]=_0x12bb6f['attributes'][_0x331d('0x42')]?_0x12bb6f[_0x331d('0x32')]:_0xec7dea[_0x331d('0x2d')];if(_0x5abc12[_0x331d('0x2e')][_0x331d('0x3c')]){_0x12bb6f[_0x331d('0x43')]=[{'all':!![]}];}_0x12bb6f=_['merge']({},_0x12bb6f,_0x5abc12[_0x331d('0x3b')]);return db[_0x331d('0x29')][_0x331d('0x44')](_0x12bb6f)[_0x331d('0x23')](handleEntityNotFound(_0x2d8900,null))[_0x331d('0x23')](respondWithResult(_0x2d8900,null))[_0x331d('0x3e')](handleError(_0x2d8900,null));};exports[_0x331d('0x45')]=function(_0x17f0f8,_0x461a7e){return db[_0x331d('0x29')]['create'](_0x17f0f8[_0x331d('0x46')],{})[_0x331d('0x23')](respondWithResult(_0x461a7e,0xc9))[_0x331d('0x3e')](handleError(_0x461a7e,null));};exports[_0x331d('0x47')]=function(_0x578135,_0x13cc8b){if(_0x578135['body']['id']){delete _0x578135['body']['id'];}return db[_0x331d('0x29')][_0x331d('0x44')]({'where':{'id':_0x578135[_0x331d('0x40')]['id']}})['then'](handleEntityNotFound(_0x13cc8b,null))['then'](saveUpdates(_0x578135[_0x331d('0x46')],null))['then'](respondWithResult(_0x13cc8b,null))[_0x331d('0x3e')](handleError(_0x13cc8b,null));};exports['destroy']=function(_0x1b464b,_0x456f54){return db[_0x331d('0x29')][_0x331d('0x44')]({'where':{'id':_0x1b464b[_0x331d('0x40')]['id']}})[_0x331d('0x23')](handleEntityNotFound(_0x456f54,null))[_0x331d('0x23')](removeEntity(_0x456f54,null))[_0x331d('0x3e')](handleError(_0x456f54,null));};exports[_0x331d('0x48')]=function(_0x342755,_0x5071ad){return db[_0x331d('0x29')][_0x331d('0x48')]()[_0x331d('0x23')](respondWithResult(_0x5071ad,null))[_0x331d('0x3e')](handleError(_0x5071ad,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index f1aeb27..c479872 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 _0x9349=['define','report_dial','uniqueid','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x2dc73a,_0x566e08){var _0x5d2654=function(_0x4cef2a){while(--_0x4cef2a){_0x2dc73a['push'](_0x2dc73a['shift']());}};_0x5d2654(++_0x566e08);}(_0x9349,0x16b));var _0x9934=function(_0x2525b9,_0x5267b1){_0x2525b9=_0x2525b9-0x0;var _0x40bbe6=_0x9349[_0x2525b9];return _0x40bbe6;};'use strict';var _=require('lodash');var util=require(_0x9934('0x0'));var logger=require(_0x9934('0x1'))(_0x9934('0x2'));var moment=require('moment');var BPromise=require(_0x9934('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9934('0x4'));var rimraf=require(_0x9934('0x5'));var config=require(_0x9934('0x6'));var attributes=require(_0x9934('0x7'));module[_0x9934('0x8')]=function(_0xf4aeca,_0x1d6777){return _0xf4aeca[_0x9934('0x9')]('VoiceDialReport',attributes,{'tableName':_0x9934('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9934('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x132b=['moment','bluebird','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','util','api'];(function(_0x1402d4,_0x33b322){var _0x1d6b5c=function(_0x4e6bd6){while(--_0x4e6bd6){_0x1402d4['push'](_0x1402d4['shift']());}};_0x1d6b5c(++_0x33b322);}(_0x132b,0x8d));var _0xb132=function(_0x72ad09,_0x190845){_0x72ad09=_0x72ad09-0x0;var _0x5c7906=_0x132b[_0x72ad09];return _0x5c7906;};'use strict';var _=require(_0xb132('0x0'));var util=require(_0xb132('0x1'));var logger=require('../../config/logger')(_0xb132('0x2'));var moment=require(_0xb132('0x3'));var BPromise=require(_0xb132('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb132('0x5'));var rimraf=require(_0xb132('0x6'));var config=require('../../config/environment');var attributes=require(_0xb132('0x7'));module[_0xb132('0x8')]=function(_0x59a940,_0x4753eb){return _0x59a940[_0xb132('0x9')](_0xb132('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xb132('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 67a642e..2120bc8 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 _0x1aa8=['raw','then','CreateVoiceDialReport','debug','UpdateVoiceDialReport','update','body','where','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceDialReport','options'];(function(_0x474e89,_0x521d5d){var _0x2cc8c6=function(_0x104299){while(--_0x104299){_0x474e89['push'](_0x474e89['shift']());}};_0x2cc8c6(++_0x521d5d);}(_0x1aa8,0x189));var _0x81aa=function(_0x344598,_0x1f4008){_0x344598=_0x344598-0x0;var _0x31c197=_0x1aa8[_0x344598];return _0x31c197;};'use strict';var _=require(_0x81aa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x81aa('0x1'));var fs=require('fs');var Redis=require(_0x81aa('0x2'));var db=require(_0x81aa('0x3'))['db'];var utils=require(_0x81aa('0x4'));var logger=require(_0x81aa('0x5'))(_0x81aa('0x6'));var config=require(_0x81aa('0x7'));var jayson=require(_0x81aa('0x8'));var client=jayson[_0x81aa('0x9')][_0x81aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x376511,_0xb6ab16,_0x22777d){return new BPromise(function(_0x34d184,_0x278ccd){return client[_0x81aa('0xb')](_0x376511,_0x22777d)['then'](function(_0x17692b){logger[_0x81aa('0xc')](_0x81aa('0xd'),_0xb6ab16,_0x81aa('0xe'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0xb6ab16,_0x81aa('0xe'),JSON[_0x81aa('0xf')](_0x17692b));if(_0x17692b['error']){if(_0x17692b[_0x81aa('0x10')][_0x81aa('0x11')]===0x1f4){logger[_0x81aa('0x10')](_0x81aa('0xd'),_0xb6ab16,_0x17692b[_0x81aa('0x10')][_0x81aa('0x12')]);return _0x278ccd(_0x17692b[_0x81aa('0x10')][_0x81aa('0x12')]);}logger['error'](_0x81aa('0xd'),_0xb6ab16,_0x17692b[_0x81aa('0x10')][_0x81aa('0x12')]);return _0x34d184(_0x17692b[_0x81aa('0x10')][_0x81aa('0x12')]);}else{logger[_0x81aa('0xc')](_0x81aa('0xd'),_0xb6ab16,_0x81aa('0xe'));_0x34d184(_0x17692b[_0x81aa('0x13')][_0x81aa('0x12')]);}})[_0x81aa('0x14')](function(_0x153c0d){logger[_0x81aa('0x10')](_0x81aa('0xd'),_0xb6ab16,_0x153c0d);_0x278ccd(_0x153c0d);});});}exports['CreateVoiceDialReport']=function(_0x1d8b7c){var _0xab08a3=this;return new Promise(function(_0x1e2b59,_0x16a759){return db[_0x81aa('0x15')]['create'](_0x1d8b7c['body'],{'raw':_0x1d8b7c[_0x81aa('0x16')]?_0x1d8b7c[_0x81aa('0x16')][_0x81aa('0x17')]===undefined?!![]:![]:!![]})[_0x81aa('0x18')](function(_0x39fb17){logger[_0x81aa('0xc')](_0x81aa('0x19'),_0x1d8b7c);logger[_0x81aa('0x1a')](_0x81aa('0x19'),_0x1d8b7c,JSON['stringify'](_0x39fb17));_0x1e2b59(_0x39fb17);})[_0x81aa('0x14')](function(_0x47164b){logger[_0x81aa('0x10')](_0x81aa('0x19'),_0x47164b['message'],_0x1d8b7c);_0x16a759(_0xab08a3['error'](0x1f4,_0x47164b[_0x81aa('0x12')]));});});};exports[_0x81aa('0x1b')]=function(_0x650ca){var _0x7f59=this;return new Promise(function(_0x10b06e,_0x5adbe1){return db[_0x81aa('0x15')][_0x81aa('0x1c')](_0x650ca[_0x81aa('0x1d')],{'raw':_0x650ca[_0x81aa('0x16')]?_0x650ca[_0x81aa('0x16')][_0x81aa('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x650ca[_0x81aa('0x16')]?_0x650ca[_0x81aa('0x16')][_0x81aa('0x1e')]||null:null,'attributes':_0x650ca[_0x81aa('0x16')]?_0x650ca[_0x81aa('0x16')]['attributes']||null:null,'limit':_0x650ca[_0x81aa('0x16')]?_0x650ca[_0x81aa('0x16')][_0x81aa('0x1f')]||null:null})[_0x81aa('0x18')](function(_0x56394b){logger[_0x81aa('0xc')]('UpdateVoiceDialReport',_0x650ca);logger['debug']('UpdateVoiceDialReport',_0x650ca,JSON['stringify'](_0x56394b));_0x10b06e(_0x56394b);})[_0x81aa('0x14')](function(_0xe35e1d){logger[_0x81aa('0x10')](_0x81aa('0x1b'),_0xe35e1d[_0x81aa('0x12')],_0x650ca);_0x5adbe1(_0x7f59[_0x81aa('0x10')](0x1f4,_0xe35e1d[_0x81aa('0x12')]));});});}; \ No newline at end of file +var _0xa47d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','body','options','raw','CreateVoiceDialReport','debug','stringify','UpdateVoiceDialReport','VoiceDialReport','update','where','attributes','catch'];(function(_0xf8a6ed,_0x300f1b){var _0x5f41f1=function(_0x369f71){while(--_0x369f71){_0xf8a6ed['push'](_0xf8a6ed['shift']());}};_0x5f41f1(++_0x300f1b);}(_0xa47d,0x7c));var _0xda47=function(_0x2a75fa,_0x316917){_0x2a75fa=_0x2a75fa-0x0;var _0x53a7fd=_0xa47d[_0x2a75fa];return _0x53a7fd;};'use strict';var _=require(_0xda47('0x0'));var util=require(_0xda47('0x1'));var moment=require(_0xda47('0x2'));var BPromise=require(_0xda47('0x3'));var rs=require(_0xda47('0x4'));var fs=require('fs');var Redis=require(_0xda47('0x5'));var db=require(_0xda47('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xda47('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xda47('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55fc1a,_0x43e531,_0x3ca236){return new BPromise(function(_0x576d83,_0x522f46){return client[_0xda47('0x9')](_0x55fc1a,_0x3ca236)[_0xda47('0xa')](function(_0x8b06a2){logger[_0xda47('0xb')](_0xda47('0xc'),_0x43e531,_0xda47('0xd'));logger['debug'](_0xda47('0xe'),_0x43e531,_0xda47('0xd'),JSON['stringify'](_0x8b06a2));if(_0x8b06a2[_0xda47('0xf')]){if(_0x8b06a2[_0xda47('0xf')][_0xda47('0x10')]===0x1f4){logger[_0xda47('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x43e531,_0x8b06a2['error'][_0xda47('0x11')]);return _0x522f46(_0x8b06a2[_0xda47('0xf')][_0xda47('0x11')]);}logger['error'](_0xda47('0xc'),_0x43e531,_0x8b06a2['error'][_0xda47('0x11')]);return _0x576d83(_0x8b06a2[_0xda47('0xf')][_0xda47('0x11')]);}else{logger['info'](_0xda47('0xc'),_0x43e531,_0xda47('0xd'));_0x576d83(_0x8b06a2[_0xda47('0x12')][_0xda47('0x11')]);}})['catch'](function(_0x381749){logger[_0xda47('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x43e531,_0x381749);_0x522f46(_0x381749);});});}exports['CreateVoiceDialReport']=function(_0x4ecb10){var _0x149b51=this;return new Promise(function(_0x576396,_0x295695){return db['VoiceDialReport']['create'](_0x4ecb10[_0xda47('0x13')],{'raw':_0x4ecb10[_0xda47('0x14')]?_0x4ecb10[_0xda47('0x14')][_0xda47('0x15')]===undefined?!![]:![]:!![]})[_0xda47('0xa')](function(_0xe36724){logger['info'](_0xda47('0x16'),_0x4ecb10);logger[_0xda47('0x17')](_0xda47('0x16'),_0x4ecb10,JSON[_0xda47('0x18')](_0xe36724));_0x576396(_0xe36724);})['catch'](function(_0x157296){logger[_0xda47('0xf')](_0xda47('0x16'),_0x157296[_0xda47('0x11')],_0x4ecb10);_0x295695(_0x149b51[_0xda47('0xf')](0x1f4,_0x157296['message']));});});};exports[_0xda47('0x19')]=function(_0x542b1f){var _0x3dbf4f=this;return new Promise(function(_0x537555,_0x4216ea){return db[_0xda47('0x1a')][_0xda47('0x1b')](_0x542b1f['body'],{'raw':_0x542b1f[_0xda47('0x14')]?_0x542b1f[_0xda47('0x14')][_0xda47('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x542b1f[_0xda47('0x14')]?_0x542b1f[_0xda47('0x14')][_0xda47('0x1c')]||null:null,'attributes':_0x542b1f[_0xda47('0x14')]?_0x542b1f['options'][_0xda47('0x1d')]||null:null,'limit':_0x542b1f[_0xda47('0x14')]?_0x542b1f[_0xda47('0x14')]['limit']||null:null})['then'](function(_0x4dc015){logger[_0xda47('0xb')](_0xda47('0x19'),_0x542b1f);logger['debug'](_0xda47('0x19'),_0x542b1f,JSON[_0xda47('0x18')](_0x4dc015));_0x537555(_0x4dc015);})[_0xda47('0x1e')](function(_0x33252c){logger[_0xda47('0xf')](_0xda47('0x19'),_0x33252c['message'],_0x542b1f);_0x4216ea(_0x3dbf4f[_0xda47('0xf')](0x1f4,_0x33252c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 56ed21b..cc40f2b 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 _0x799e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','show','post','create','/:id/applications','put','/:id','update','exports','multer','path','connect-timeout','express'];(function(_0x3ad840,_0x24bae5){var _0x58f228=function(_0x3f58fe){while(--_0x3f58fe){_0x3ad840['push'](_0x3ad840['shift']());}};_0x58f228(++_0x24bae5);}(_0x799e,0xf3));var _0xe799=function(_0x598c13,_0x1b9620){_0x598c13=_0x598c13-0x0;var _0x42326e=_0x799e[_0x598c13];return _0x42326e;};'use strict';var multer=require(_0xe799('0x0'));var util=require('util');var path=require(_0xe799('0x1'));var timeout=require(_0xe799('0x2'));var express=require(_0xe799('0x3'));var router=express[_0xe799('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe799('0x5'));var interaction=require(_0xe799('0x6'));var config=require(_0xe799('0x7'));var controller=require(_0xe799('0x8'));router['get']('/',auth[_0xe799('0x9')](),controller[_0xe799('0xa')]);router['get']('/:id',auth[_0xe799('0x9')](),controller[_0xe799('0xb')]);router[_0xe799('0xc')]('/',auth[_0xe799('0x9')](),controller[_0xe799('0xd')]);router[_0xe799('0xc')](_0xe799('0xe'),auth[_0xe799('0x9')](),controller['addApplications']);router[_0xe799('0xf')](_0xe799('0x10'),auth[_0xe799('0x9')](),controller[_0xe799('0x11')]);router['delete'](_0xe799('0x10'),auth[_0xe799('0x9')](),controller['destroy']);module[_0xe799('0x12')]=router; \ No newline at end of file +var _0x8cd9=['isAuthenticated','create','/:id/applications','addApplications','put','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','/:id','show','post'];(function(_0x44f3c2,_0x73964){var _0x20169c=function(_0x4228b1){while(--_0x4228b1){_0x44f3c2['push'](_0x44f3c2['shift']());}};_0x20169c(++_0x73964);}(_0x8cd9,0x1c1));var _0x98cd=function(_0x1fc18d,_0x4f2bdd){_0x1fc18d=_0x1fc18d-0x0;var _0x1988a2=_0x8cd9[_0x1fc18d];return _0x1988a2;};'use strict';var multer=require(_0x98cd('0x0'));var util=require('util');var path=require(_0x98cd('0x1'));var timeout=require(_0x98cd('0x2'));var express=require('express');var router=express[_0x98cd('0x3')]();var fs_extra=require(_0x98cd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x98cd('0x5'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x98cd('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x98cd('0x6')](_0x98cd('0x7'),auth['isAuthenticated'](),controller[_0x98cd('0x8')]);router[_0x98cd('0x9')]('/',auth[_0x98cd('0xa')](),controller[_0x98cd('0xb')]);router[_0x98cd('0x9')](_0x98cd('0xc'),auth[_0x98cd('0xa')](),controller[_0x98cd('0xd')]);router[_0x98cd('0xe')](_0x98cd('0x7'),auth[_0x98cd('0xa')](),controller['update']);router[_0x98cd('0xf')](_0x98cd('0x7'),auth[_0x98cd('0xa')](),controller[_0x98cd('0x10')]);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 b910326..498424f 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 _0xae06=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exports','STRING','compositeIndex','NoOp','ENUM','outbound-fax','system','any'];(function(_0x41a5e1,_0x5c9ed8){var _0x4e2a2d=function(_0x260f73){while(--_0x260f73){_0x41a5e1['push'](_0x41a5e1['shift']());}};_0x4e2a2d(++_0x5c9ed8);}(_0xae06,0x172));var _0x6ae0=function(_0x16b0c0,_0x17952b){_0x16b0c0=_0x16b0c0-0x0;var _0x33d5f8=_0xae06[_0x16b0c0];return _0x33d5f8;};'use strict';var Sequelize=require('sequelize');module[_0x6ae0('0x0')]={'context':{'type':Sequelize[_0x6ae0('0x1')],'allowNull':![],'unique':_0x6ae0('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6ae0('0x1')],'allowNull':![],'unique':_0x6ae0('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x6ae0('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ae0('0x3')},'appdata':{'type':Sequelize[_0x6ae0('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6ae0('0x4')]('inbound','outbound','internal','inbound-fax',_0x6ae0('0x5'),_0x6ae0('0x6'),_0x6ae0('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0x6ae0('0x1')]},'interval':{'type':Sequelize[_0x6ae0('0x1')],'allowNull':![],'defaultValue':_0x6ae0('0x8')},'IntervalId':{'type':Sequelize[_0x6ae0('0x9')]},'isApp':{'type':Sequelize[_0x6ae0('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x6ae0('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x6ae0('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6ae0('0x9')]},'recordingFormat':{'type':Sequelize[_0x6ae0('0x1')],'defaultValue':_0x6ae0('0xb')},'answer':{'type':Sequelize[_0x6ae0('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x6ae0('0xc')],'get':function(_0x3b4614){return this[_0x6ae0('0xd')]('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x5260=['outbound','internal','inbound-fax','outbound-fax','any','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x29f014,_0x508522){var _0x316be5=function(_0x1753a5){while(--_0x1753a5){_0x29f014['push'](_0x29f014['shift']());}};_0x316be5(++_0x508522);}(_0x5260,0x89));var _0x0526=function(_0x285d1f,_0x4746de){_0x285d1f=_0x285d1f-0x0;var _0x4fb3c4=_0x5260[_0x285d1f];return _0x4fb3c4;};'use strict';var Sequelize=require(_0x0526('0x0'));module[_0x0526('0x1')]={'context':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'unique':_0x0526('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'unique':_0x0526('0x3')},'priority':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'defaultValue':_0x0526('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0526('0x5')](_0x0526('0x6'),_0x0526('0x7'),_0x0526('0x8'),_0x0526('0x9'),_0x0526('0xa'),'system',_0x0526('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x0526('0x2')]},'interval':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0526('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x0526('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x0526('0x2')],'defaultValue':_0x0526('0xd')},'answer':{'type':Sequelize[_0x0526('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0526('0xe')],'get':function(_0x1a7ef1){return this[_0x0526('0xf')]('exten');}},'alias':{'type':Sequelize[_0x0526('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 0dea58d..4bff39b 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 _0xbda0=['sox','to-csv','fs-extra','lodash','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceExtension.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','end','sendStatus','error','stack','send','index','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','VoiceExtension','findAll','rows','show','includeAll','include','catch','params','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','rewriteDial','toLowerCase','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','moment','mustache','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbda0,0xd7));var _0x0bda=function(_0x16d8d7,_0x3775ec){_0x16d8d7=_0x16d8d7-0x0;var _0x420186=_0xbda0[_0x16d8d7];return _0x420186;};'use strict';var emlformat=require(_0x0bda('0x0'));var rimraf=require(_0x0bda('0x1'));var zipdir=require(_0x0bda('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0bda('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0bda('0x4'));var util=require(_0x0bda('0x5'));var path=require(_0x0bda('0x6'));var sox=require(_0x0bda('0x7'));var csv=require(_0x0bda('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bda('0x9'));var _=require(_0x0bda('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0bda('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0bda('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0bda('0xc'));var authService=require(_0x0bda('0xd'));var qs=require(_0x0bda('0xe'));var as=require(_0x0bda('0xf'));var hardwareService=require(_0x0bda('0x10'));var logger=require(_0x0bda('0x11'))(_0x0bda('0x12'));var utils=require(_0x0bda('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0bda('0x14'));var db=require(_0x0bda('0x15'))['db'];config['redis']=_[_0x0bda('0x16')](config[_0x0bda('0x17')],{'host':_0x0bda('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bda('0x17')]));require(_0x0bda('0x19'))[_0x0bda('0x1a')](socket);function respondWithStatusCode(_0x570016,_0xe52f5a){_0xe52f5a=_0xe52f5a||0xcc;return function(_0x4be75c){if(_0x4be75c){return _0x570016['sendStatus'](_0xe52f5a);}return _0x570016[_0x0bda('0x1b')](_0xe52f5a)['end']();};}function respondWithResult(_0x4c201b,_0x293e37){_0x293e37=_0x293e37||0xc8;return function(_0x2dc7b9){if(_0x2dc7b9){return _0x4c201b['status'](_0x293e37)[_0x0bda('0x1c')](_0x2dc7b9);}};}function respondWithFilteredResult(_0x1139e9,_0x5b4de5){return function(_0x7c3875){if(_0x7c3875){var _0x50110e=typeof _0x5b4de5[_0x0bda('0x1d')]===_0x0bda('0x1e')&&typeof _0x5b4de5[_0x0bda('0x1f')]===_0x0bda('0x1e');var _0x159dec=_0x7c3875['count'];var _0x2a1212=_0x50110e?0x0:_0x5b4de5[_0x0bda('0x1d')];var _0x5b4b50=_0x50110e?_0x7c3875[_0x0bda('0x20')]:_0x5b4de5[_0x0bda('0x1d')]+_0x5b4de5['limit'];var _0x500da6;if(_0x5b4b50>=_0x159dec){_0x5b4b50=_0x159dec;_0x500da6=0xc8;}else{_0x500da6=0xce;}_0x1139e9[_0x0bda('0x1b')](_0x500da6);return _0x1139e9[_0x0bda('0x21')](_0x0bda('0x22'),_0x2a1212+'-'+_0x5b4b50+'/'+_0x159dec)[_0x0bda('0x1c')](_0x7c3875);}return null;};}function patchUpdates(_0x42421d){return function(_0x48cfbf){try{jsonpatch[_0x0bda('0x23')](_0x48cfbf,_0x42421d,!![]);}catch(_0x49acc6){return BPromise['reject'](_0x49acc6);}return _0x48cfbf[_0x0bda('0x24')]();};}function saveUpdates(_0x5da5b4,_0x3a01d0){return function(_0xf0e44e){if(_0xf0e44e){return _0xf0e44e[_0x0bda('0x25')](_0x5da5b4)['then'](function(_0x23da00){return _0x23da00;});}return null;};}function removeEntity(_0x4a04a0,_0x5f110f){return function(_0x3f7e43){if(_0x3f7e43){return _0x3f7e43['destroy']()[_0x0bda('0x26')](function(){var _0x3fdf58=_0x3f7e43[_0x0bda('0x27')]({'plain':!![]});var _0x1ff84f=[{'name':_0x0bda('0x28'),'value':_0x0bda('0x29'),'ignore':![]},{'name':_0x0bda('0x2a'),'value':_0x0bda('0x2b'),'ignore':![]},{'name':_0x0bda('0x2c'),'value':'internal','ignore':![]}];var _0x212471=_(_0x1ff84f)['filter'](_0x0bda('0x2d'))[_0x0bda('0x2e')](_0x0bda('0x2f'))['value']();if(_[_0x0bda('0x30')](_0x212471,_0x3fdf58[_0x0bda('0x31')])){return;}var _0x1bd0ed=_[_0x0bda('0x32')](_0x1ff84f,[_0x0bda('0x2f'),_0x3fdf58[_0x0bda('0x31')]])[_0x0bda('0x33')];return db[_0x0bda('0x34')][_0x0bda('0x35')]({'where':{'type':_0x1bd0ed,'resourceId':_0x3fdf58['id']}})['then'](function(){return _0x3f7e43;});})[_0x0bda('0x26')](function(){_0x4a04a0[_0x0bda('0x1b')](0xcc)[_0x0bda('0x36')]();});}};}function handleEntityNotFound(_0x4b0485,_0x1c463c){return function(_0x1247a6){if(!_0x1247a6){_0x4b0485[_0x0bda('0x37')](0x194);}return _0x1247a6;};}function handleError(_0x450efa,_0x1af3a7){_0x1af3a7=_0x1af3a7||0x1f4;return function(_0x8086b0){logger[_0x0bda('0x38')](_0x8086b0[_0x0bda('0x39')]);if(_0x8086b0[_0x0bda('0x33')]){delete _0x8086b0[_0x0bda('0x33')];}_0x450efa[_0x0bda('0x1b')](_0x1af3a7)[_0x0bda('0x3a')](_0x8086b0);};}exports[_0x0bda('0x3b')]=function(_0x44255f,_0xf8a9e7){var _0x232adf={},_0xde7c7e={},_0x17b686={'count':0x0,'rows':[]};var _0x277305=_['map'](db['VoiceExtension'][_0x0bda('0x3c')],function(_0x3d480c){return{'name':_0x3d480c[_0x0bda('0x3d')],'type':_0x3d480c[_0x0bda('0x31')]['key']};});_0xde7c7e[_0x0bda('0x3e')]=_['map'](_0x277305,'name');_0xde7c7e[_0x0bda('0x3f')]=_[_0x0bda('0x40')](_0x44255f['query']);_0xde7c7e[_0x0bda('0x41')]=_[_0x0bda('0x42')](_0xde7c7e['model'],_0xde7c7e[_0x0bda('0x3f')]);_0x232adf[_0x0bda('0x43')]=_[_0x0bda('0x42')](_0xde7c7e[_0x0bda('0x3e')],qs['fields'](_0x44255f['query'][_0x0bda('0x44')]));_0x232adf[_0x0bda('0x43')]=_0x232adf[_0x0bda('0x43')][_0x0bda('0x45')]?_0x232adf[_0x0bda('0x43')]:_0xde7c7e[_0x0bda('0x3e')];if(!_0x44255f[_0x0bda('0x3f')][_0x0bda('0x46')](_0x0bda('0x47'))){_0x232adf[_0x0bda('0x1f')]=qs[_0x0bda('0x1f')](_0x44255f[_0x0bda('0x3f')][_0x0bda('0x1f')]);_0x232adf[_0x0bda('0x1d')]=qs[_0x0bda('0x1d')](_0x44255f['query']['offset']);}_0x232adf[_0x0bda('0x48')]=qs['sort'](_0x44255f[_0x0bda('0x3f')][_0x0bda('0x49')]);_0x232adf['where']=qs[_0x0bda('0x41')](_[_0x0bda('0x4a')](_0x44255f[_0x0bda('0x3f')],_0xde7c7e[_0x0bda('0x41')]),_0x277305);if(_0x44255f[_0x0bda('0x3f')][_0x0bda('0x4b')]){_0x232adf[_0x0bda('0x4c')]=_['merge'](_0x232adf[_0x0bda('0x4c')],{'$or':_['map'](_0x277305,function(_0x247783){if(_0x247783[_0x0bda('0x31')]!==_0x0bda('0x4d')){var _0x3fefc0={};_0x3fefc0[_0x247783[_0x0bda('0x33')]]={'$like':'%'+_0x44255f[_0x0bda('0x3f')][_0x0bda('0x4b')]+'%'};return _0x3fefc0;}})});}_0x232adf=_[_0x0bda('0x4e')]({},_0x232adf,_0x44255f[_0x0bda('0x4f')]);var _0xf50a6e={'where':_0x232adf[_0x0bda('0x4c')]};return db[_0x0bda('0x50')][_0x0bda('0x20')](_0xf50a6e)[_0x0bda('0x26')](function(_0x24220b){_0x17b686[_0x0bda('0x20')]=_0x24220b;if(_0x44255f[_0x0bda('0x3f')]['includeAll']){_0x232adf['include']=[{'all':!![]}];}return db['VoiceExtension'][_0x0bda('0x51')](_0x232adf);})[_0x0bda('0x26')](function(_0xc019dc){_0x17b686[_0x0bda('0x52')]=_0xc019dc;return _0x17b686;})['then'](respondWithFilteredResult(_0xf8a9e7,_0x232adf))['catch'](handleError(_0xf8a9e7,null));};exports[_0x0bda('0x53')]=function(_0x353de2,_0x2980f9){var _0x3a9fb4={'raw':![],'where':{'id':_0x353de2['params']['id']}},_0xf31617={};_0xf31617[_0x0bda('0x3e')]=_[_0x0bda('0x40')](db[_0x0bda('0x50')][_0x0bda('0x3c')]);_0xf31617['query']=_[_0x0bda('0x40')](_0x353de2[_0x0bda('0x3f')]);_0xf31617[_0x0bda('0x41')]=_[_0x0bda('0x42')](_0xf31617[_0x0bda('0x3e')],_0xf31617['query']);_0x3a9fb4[_0x0bda('0x43')]=_[_0x0bda('0x42')](_0xf31617['model'],qs[_0x0bda('0x44')](_0x353de2[_0x0bda('0x3f')][_0x0bda('0x44')]));_0x3a9fb4[_0x0bda('0x43')]=_0x3a9fb4[_0x0bda('0x43')][_0x0bda('0x45')]?_0x3a9fb4['attributes']:_0xf31617[_0x0bda('0x3e')];if(_0x353de2[_0x0bda('0x3f')][_0x0bda('0x54')]){_0x3a9fb4[_0x0bda('0x55')]=[{'all':!![]}];}_0x3a9fb4=_['merge']({},_0x3a9fb4,_0x353de2[_0x0bda('0x4f')]);return db['VoiceExtension'][_0x0bda('0x32')](_0x3a9fb4)[_0x0bda('0x26')](handleEntityNotFound(_0x2980f9,null))[_0x0bda('0x26')](respondWithResult(_0x2980f9,null))[_0x0bda('0x56')](handleError(_0x2980f9,null));};exports[_0x0bda('0x35')]=function(_0x1cee87,_0x2d5d64){return db[_0x0bda('0x50')][_0x0bda('0x32')]({'where':{'id':_0x1cee87[_0x0bda('0x57')]['id']}})[_0x0bda('0x26')](handleEntityNotFound(_0x2d5d64,null))[_0x0bda('0x26')](removeEntity(_0x2d5d64,null))[_0x0bda('0x56')](handleError(_0x2d5d64,null));};exports[_0x0bda('0x58')]=function(_0x4c7890,_0x46ee5b){if(_0x4c7890[_0x0bda('0x59')]['type']===_0x0bda('0x2b')&&!_[_0x0bda('0x5a')](_0x4c7890[_0x0bda('0x59')][_0x0bda('0x5b')],'_')){_0x4c7890['body'][_0x0bda('0x5b')]='_'[_0x0bda('0x5c')](_0x4c7890['body'][_0x0bda('0x5b')]);}return db[_0x0bda('0x50')]['create'](_0x4c7890['body'],{'raw':![]})[_0x0bda('0x26')](function(_0x510a16){var _0x1ea81f=_0x4c7890[_0x0bda('0x5d')]['get']({'plain':!![]});if(!_0x1ea81f)throw new Error(_0x0bda('0x5e'));if(_0x1ea81f['role']===_0x0bda('0x5d')){var _0x12f48a=_0x510a16['get']({'plain':!![]});var _0x2f8361=[{'name':_0x0bda('0x28'),'value':_0x0bda('0x29')},{'name':'OutboundRoutes','value':_0x0bda('0x2b')},{'name':'InternalRoutes','value':'internal'}];var _0x11943a=_['find'](_0x2f8361,[_0x0bda('0x2f'),_0x12f48a[_0x0bda('0x31')]])['name'];return db[_0x0bda('0x5f')][_0x0bda('0x32')]({'where':{'name':_0x11943a,'userProfileId':_0x1ea81f[_0x0bda('0x60')]},'raw':!![]})['then'](function(_0x31825d){if(_0x31825d&&_0x31825d[_0x0bda('0x61')]===0x0){return db[_0x0bda('0x34')][_0x0bda('0x58')]({'name':_0x12f48a[_0x0bda('0x33')],'resourceId':_0x12f48a['id'],'type':_0x31825d[_0x0bda('0x33')],'sectionId':_0x31825d['id']},{})[_0x0bda('0x26')](function(){return _0x510a16;});}else{return _0x510a16;}})[_0x0bda('0x56')](function(_0x16368e){logger['error'](_0x0bda('0x62'),_0x16368e);throw _0x16368e;});}return _0x510a16;})['then'](respondWithResult(_0x46ee5b,0xc9))[_0x0bda('0x56')](handleError(_0x46ee5b,null));};exports[_0x0bda('0x25')]=function(_0x456786,_0x3c30cd){if(_0x456786[_0x0bda('0x59')]['id']){delete _0x456786[_0x0bda('0x59')]['id'];}return db[_0x0bda('0x50')][_0x0bda('0x32')]({'where':{'id':_0x456786[_0x0bda('0x57')]['id']}})[_0x0bda('0x26')](handleEntityNotFound(_0x3c30cd,null))[_0x0bda('0x26')](function(_0xd58f37){if(_0xd58f37){return db['VoiceExtension'][_0x0bda('0x25')](_[_0x0bda('0x4a')](_0x456786[_0x0bda('0x59')],[_0x0bda('0x5b'),_0x0bda('0x63'),_0x0bda('0x64'),_0x0bda('0x65'),_0x0bda('0x66'),_0x0bda('0x67'),_0x0bda('0x68')]),{'where':{'context':_0xd58f37[_0x0bda('0x63')],'exten':_0xd58f37[_0x0bda('0x5b')]},'individualHooks':!![]})[_0x0bda('0x26')](function(_0x6368e5){return _0x6368e5;});}return null;})['then'](respondWithStatusCode(_0x3c30cd,null))[_0x0bda('0x56')](handleError(_0x3c30cd,null));};exports[_0x0bda('0x69')]=function(_0x445af1,_0x555a17){return db['VoiceExtension']['findOne']({'where':{'id':_0x445af1[_0x0bda('0x57')]['id']}})[_0x0bda('0x26')](function(_0x56057a){if(_0x56057a){return db['sequelize']['transaction'](function(_0x10b81b){return db[_0x0bda('0x50')][_0x0bda('0x35')]({'where':{'VoiceExtensionId':_0x445af1[_0x0bda('0x57')]['id']},'transaction':_0x10b81b})[_0x0bda('0x26')](function(){var _0xa44974=_[_0x0bda('0x2e')](_0x445af1[_0x0bda('0x59')],function(_0x1079f5){_0x1079f5['VoiceExtensionId']=_0x445af1[_0x0bda('0x57')]['id'];_0x1079f5['isApp']=!![];return _0x1079f5;});var _0x1ae086=_0x445af1[_0x0bda('0x3f')]['rewriteDial']&&_0x445af1[_0x0bda('0x3f')][_0x0bda('0x6a')][_0x0bda('0x6b')]()==='true'?!![]:![];return _0x56057a[_0x0bda('0x6c')](_0xa44974,_0x1ae086);})['then'](function(_0x107b37){return db[_0x0bda('0x50')]['bulkCreate'](_0x107b37,{'transaction':_0x10b81b});});})[_0x0bda('0x26')](function(){return db[_0x0bda('0x50')][_0x0bda('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x445af1[_0x0bda('0x57')]['id']},'order':_0x0bda('0x6e')});});}})[_0x0bda('0x26')](respondWithResult(_0x555a17,null))[_0x0bda('0x56')](handleError(_0x555a17,null));}; \ No newline at end of file +var _0xe78c=['to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','value','type','find','name','UserProfileResource','destroy','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','query','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','catch','show','params','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','cutdigits','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','rewriteDial','toLowerCase','true','bulkCreate','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x301cb9,_0x1b0f7f){var _0x364932=function(_0x40fc92){while(--_0x40fc92){_0x301cb9['push'](_0x301cb9['shift']());}};_0x364932(++_0x1b0f7f);}(_0xe78c,0xd2));var _0xce78=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe78c[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xce78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce78('0x1'));var jsonpatch=require(_0xce78('0x2'));var rp=require(_0xce78('0x3'));var moment=require(_0xce78('0x4'));var BPromise=require(_0xce78('0x5'));var Mustache=require(_0xce78('0x6'));var util=require(_0xce78('0x7'));var path=require(_0xce78('0x8'));var sox=require(_0xce78('0x9'));var csv=require(_0xce78('0xa'));var ejs=require(_0xce78('0xb'));var fs=require('fs');var fs_extra=require(_0xce78('0xc'));var _=require('lodash');var squel=require(_0xce78('0xd'));var crypto=require(_0xce78('0xe'));var jsforce=require(_0xce78('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xce78('0x10'));var Redis=require('ioredis');var authService=require(_0xce78('0x11'));var qs=require(_0xce78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xce78('0x13'))(_0xce78('0x14'));var utils=require(_0xce78('0x15'));var config=require(_0xce78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xce78('0x17'))['db'];config[_0xce78('0x18')]=_[_0xce78('0x19')](config[_0xce78('0x18')],{'host':_0xce78('0x1a'),'port':0x18eb});var socket=require(_0xce78('0x1b'))(new Redis(config['redis']));require(_0xce78('0x1c'))[_0xce78('0x1d')](socket);function respondWithStatusCode(_0x3b4115,_0x5a1170){_0x5a1170=_0x5a1170||0xcc;return function(_0x295718){if(_0x295718){return _0x3b4115[_0xce78('0x1e')](_0x5a1170);}return _0x3b4115[_0xce78('0x1f')](_0x5a1170)[_0xce78('0x20')]();};}function respondWithResult(_0x4337da,_0x29fd75){_0x29fd75=_0x29fd75||0xc8;return function(_0x5500ba){if(_0x5500ba){return _0x4337da['status'](_0x29fd75)[_0xce78('0x21')](_0x5500ba);}};}function respondWithFilteredResult(_0x499873,_0x2c6ed5){return function(_0x5932dd){if(_0x5932dd){var _0x2c216b=typeof _0x2c6ed5['offset']==='undefined'&&typeof _0x2c6ed5[_0xce78('0x22')]===_0xce78('0x23');var _0x32e738=_0x5932dd[_0xce78('0x24')];var _0xd5e94c=_0x2c216b?0x0:_0x2c6ed5[_0xce78('0x25')];var _0x556aef=_0x2c216b?_0x5932dd['count']:_0x2c6ed5[_0xce78('0x25')]+_0x2c6ed5[_0xce78('0x22')];var _0x4c11c5;if(_0x556aef>=_0x32e738){_0x556aef=_0x32e738;_0x4c11c5=0xc8;}else{_0x4c11c5=0xce;}_0x499873[_0xce78('0x1f')](_0x4c11c5);return _0x499873[_0xce78('0x26')](_0xce78('0x27'),_0xd5e94c+'-'+_0x556aef+'/'+_0x32e738)[_0xce78('0x21')](_0x5932dd);}return null;};}function patchUpdates(_0x2d0e69){return function(_0xa9990a){try{jsonpatch['apply'](_0xa9990a,_0x2d0e69,!![]);}catch(_0x62b7b6){return BPromise[_0xce78('0x28')](_0x62b7b6);}return _0xa9990a[_0xce78('0x29')]();};}function saveUpdates(_0x6bfa09,_0x598410){return function(_0x541882){if(_0x541882){return _0x541882['update'](_0x6bfa09)[_0xce78('0x2a')](function(_0x188068){return _0x188068;});}return null;};}function removeEntity(_0x5adc10,_0x3b216c){return function(_0x159f3e){if(_0x159f3e){return _0x159f3e['destroy']()[_0xce78('0x2a')](function(){var _0x4e1342=_0x159f3e['get']({'plain':!![]});var _0xfe9f48=[{'name':_0xce78('0x2b'),'value':_0xce78('0x2c'),'ignore':![]},{'name':_0xce78('0x2d'),'value':_0xce78('0x2e'),'ignore':![]},{'name':'InternalRoutes','value':_0xce78('0x2f'),'ignore':![]}];var _0x1c82fa=_(_0xfe9f48)[_0xce78('0x30')]('ignore')['map'](_0xce78('0x31'))[_0xce78('0x31')]();if(_['includes'](_0x1c82fa,_0x4e1342[_0xce78('0x32')])){return;}var _0x234a73=_[_0xce78('0x33')](_0xfe9f48,[_0xce78('0x31'),_0x4e1342[_0xce78('0x32')]])[_0xce78('0x34')];return db[_0xce78('0x35')][_0xce78('0x36')]({'where':{'type':_0x234a73,'resourceId':_0x4e1342['id']}})[_0xce78('0x2a')](function(){return _0x159f3e;});})[_0xce78('0x2a')](function(){_0x5adc10[_0xce78('0x1f')](0xcc)[_0xce78('0x20')]();});}};}function handleEntityNotFound(_0x4fcefe,_0x2a985b){return function(_0x5e9f2e){if(!_0x5e9f2e){_0x4fcefe[_0xce78('0x1e')](0x194);}return _0x5e9f2e;};}function handleError(_0x1c3b32,_0x4d3386){_0x4d3386=_0x4d3386||0x1f4;return function(_0x2b82cc){logger['error'](_0x2b82cc['stack']);if(_0x2b82cc[_0xce78('0x34')]){delete _0x2b82cc[_0xce78('0x34')];}_0x1c3b32['status'](_0x4d3386)[_0xce78('0x37')](_0x2b82cc);};}exports[_0xce78('0x38')]=function(_0x568e45,_0x3711a7){var _0x36920c={},_0x2b4137={},_0x2dcf09={'count':0x0,'rows':[]};var _0x57341e=_[_0xce78('0x39')](db['VoiceExtension'][_0xce78('0x3a')],function(_0x38ca08){return{'name':_0x38ca08['fieldName'],'type':_0x38ca08[_0xce78('0x32')][_0xce78('0x3b')]};});_0x2b4137[_0xce78('0x3c')]=_[_0xce78('0x39')](_0x57341e,_0xce78('0x34'));_0x2b4137['query']=_[_0xce78('0x3d')](_0x568e45['query']);_0x2b4137[_0xce78('0x3e')]=_[_0xce78('0x3f')](_0x2b4137[_0xce78('0x3c')],_0x2b4137['query']);_0x36920c[_0xce78('0x40')]=_[_0xce78('0x3f')](_0x2b4137['model'],qs['fields'](_0x568e45[_0xce78('0x41')][_0xce78('0x42')]));_0x36920c[_0xce78('0x40')]=_0x36920c['attributes'][_0xce78('0x43')]?_0x36920c[_0xce78('0x40')]:_0x2b4137[_0xce78('0x3c')];if(!_0x568e45[_0xce78('0x41')]['hasOwnProperty'](_0xce78('0x44'))){_0x36920c[_0xce78('0x22')]=qs['limit'](_0x568e45[_0xce78('0x41')][_0xce78('0x22')]);_0x36920c[_0xce78('0x25')]=qs[_0xce78('0x25')](_0x568e45[_0xce78('0x41')][_0xce78('0x25')]);}_0x36920c[_0xce78('0x45')]=qs[_0xce78('0x46')](_0x568e45[_0xce78('0x41')][_0xce78('0x46')]);_0x36920c[_0xce78('0x47')]=qs[_0xce78('0x3e')](_[_0xce78('0x48')](_0x568e45[_0xce78('0x41')],_0x2b4137[_0xce78('0x3e')]),_0x57341e);if(_0x568e45[_0xce78('0x41')]['filter']){_0x36920c[_0xce78('0x47')]=_[_0xce78('0x49')](_0x36920c['where'],{'$or':_['map'](_0x57341e,function(_0x2f7b37){if(_0x2f7b37['type']!==_0xce78('0x4a')){var _0x3cfc4e={};_0x3cfc4e[_0x2f7b37[_0xce78('0x34')]]={'$like':'%'+_0x568e45[_0xce78('0x41')]['filter']+'%'};return _0x3cfc4e;}})});}_0x36920c=_[_0xce78('0x49')]({},_0x36920c,_0x568e45[_0xce78('0x4b')]);var _0x5634de={'where':_0x36920c[_0xce78('0x47')]};return db[_0xce78('0x4c')][_0xce78('0x24')](_0x5634de)[_0xce78('0x2a')](function(_0x2e18bb){_0x2dcf09[_0xce78('0x24')]=_0x2e18bb;if(_0x568e45[_0xce78('0x41')][_0xce78('0x4d')]){_0x36920c[_0xce78('0x4e')]=[{'all':!![]}];}return db[_0xce78('0x4c')][_0xce78('0x4f')](_0x36920c);})[_0xce78('0x2a')](function(_0x3d86a8){_0x2dcf09['rows']=_0x3d86a8;return _0x2dcf09;})[_0xce78('0x2a')](respondWithFilteredResult(_0x3711a7,_0x36920c))[_0xce78('0x50')](handleError(_0x3711a7,null));};exports[_0xce78('0x51')]=function(_0x4e3533,_0x4cd54b){var _0x3acab6={'raw':![],'where':{'id':_0x4e3533[_0xce78('0x52')]['id']}},_0x10dbff={};_0x10dbff[_0xce78('0x3c')]=_[_0xce78('0x3d')](db[_0xce78('0x4c')][_0xce78('0x3a')]);_0x10dbff[_0xce78('0x41')]=_[_0xce78('0x3d')](_0x4e3533['query']);_0x10dbff[_0xce78('0x3e')]=_[_0xce78('0x3f')](_0x10dbff[_0xce78('0x3c')],_0x10dbff[_0xce78('0x41')]);_0x3acab6[_0xce78('0x40')]=_['intersection'](_0x10dbff[_0xce78('0x3c')],qs['fields'](_0x4e3533[_0xce78('0x41')]['fields']));_0x3acab6['attributes']=_0x3acab6[_0xce78('0x40')][_0xce78('0x43')]?_0x3acab6[_0xce78('0x40')]:_0x10dbff['model'];if(_0x4e3533['query'][_0xce78('0x4d')]){_0x3acab6[_0xce78('0x4e')]=[{'all':!![]}];}_0x3acab6=_[_0xce78('0x49')]({},_0x3acab6,_0x4e3533[_0xce78('0x4b')]);return db[_0xce78('0x4c')]['find'](_0x3acab6)[_0xce78('0x2a')](handleEntityNotFound(_0x4cd54b,null))[_0xce78('0x2a')](respondWithResult(_0x4cd54b,null))[_0xce78('0x50')](handleError(_0x4cd54b,null));};exports[_0xce78('0x36')]=function(_0x2f345a,_0x509685){return db[_0xce78('0x4c')][_0xce78('0x33')]({'where':{'id':_0x2f345a[_0xce78('0x52')]['id']}})[_0xce78('0x2a')](handleEntityNotFound(_0x509685,null))[_0xce78('0x2a')](removeEntity(_0x509685,null))[_0xce78('0x50')](handleError(_0x509685,null));};exports[_0xce78('0x53')]=function(_0x3c8cf4,_0x512a33){if(_0x3c8cf4[_0xce78('0x54')][_0xce78('0x32')]===_0xce78('0x2e')&&!_[_0xce78('0x55')](_0x3c8cf4[_0xce78('0x54')][_0xce78('0x56')],'_')){_0x3c8cf4['body'][_0xce78('0x56')]='_'['concat'](_0x3c8cf4[_0xce78('0x54')]['exten']);}return db[_0xce78('0x4c')]['create'](_0x3c8cf4['body'],{'raw':![]})[_0xce78('0x2a')](function(_0x573eff){var _0x343f1b=_0x3c8cf4[_0xce78('0x57')]['get']({'plain':!![]});if(!_0x343f1b)throw new Error(_0xce78('0x58'));if(_0x343f1b['role']==='user'){var _0x4d4b2a=_0x573eff[_0xce78('0x59')]({'plain':!![]});var _0x5995ad=[{'name':_0xce78('0x2b'),'value':_0xce78('0x2c')},{'name':_0xce78('0x2d'),'value':'outbound'},{'name':_0xce78('0x5a'),'value':_0xce78('0x2f')}];var _0x154495=_[_0xce78('0x33')](_0x5995ad,[_0xce78('0x31'),_0x4d4b2a[_0xce78('0x32')]])[_0xce78('0x34')];return db[_0xce78('0x5b')][_0xce78('0x33')]({'where':{'name':_0x154495,'userProfileId':_0x343f1b[_0xce78('0x5c')]},'raw':!![]})[_0xce78('0x2a')](function(_0x310a35){if(_0x310a35&&_0x310a35[_0xce78('0x5d')]===0x0){return db[_0xce78('0x35')][_0xce78('0x53')]({'name':_0x4d4b2a[_0xce78('0x34')],'resourceId':_0x4d4b2a['id'],'type':_0x310a35['name'],'sectionId':_0x310a35['id']},{})[_0xce78('0x2a')](function(){return _0x573eff;});}else{return _0x573eff;}})['catch'](function(_0xaf635c){logger[_0xce78('0x5e')](_0xce78('0x5f'),_0xaf635c);throw _0xaf635c;});}return _0x573eff;})[_0xce78('0x2a')](respondWithResult(_0x512a33,0xc9))['catch'](handleError(_0x512a33,null));};exports['update']=function(_0x180413,_0x5328e1){if(_0x180413[_0xce78('0x54')]['id']){delete _0x180413[_0xce78('0x54')]['id'];}return db['VoiceExtension'][_0xce78('0x33')]({'where':{'id':_0x180413['params']['id']}})[_0xce78('0x2a')](handleEntityNotFound(_0x5328e1,null))[_0xce78('0x2a')](function(_0x1fae6b){if(_0x1fae6b){return db[_0xce78('0x4c')]['update'](_[_0xce78('0x48')](_0x180413[_0xce78('0x54')],['exten',_0xce78('0x60'),'description','recordingFormat',_0xce78('0x61'),_0xce78('0x62'),_0xce78('0x63')]),{'where':{'context':_0x1fae6b[_0xce78('0x60')],'exten':_0x1fae6b[_0xce78('0x56')]},'individualHooks':!![]})[_0xce78('0x2a')](function(_0x2a4818){return _0x2a4818;});}return null;})[_0xce78('0x2a')](respondWithStatusCode(_0x5328e1,null))[_0xce78('0x50')](handleError(_0x5328e1,null));};exports[_0xce78('0x64')]=function(_0x362d34,_0x22c200){return db['VoiceExtension'][_0xce78('0x65')]({'where':{'id':_0x362d34['params']['id']}})[_0xce78('0x2a')](function(_0x34f4d1){if(_0x34f4d1){return db[_0xce78('0x66')][_0xce78('0x67')](function(_0x56b3ef){return db['VoiceExtension'][_0xce78('0x36')]({'where':{'VoiceExtensionId':_0x362d34[_0xce78('0x52')]['id']},'transaction':_0x56b3ef})['then'](function(){var _0x55c89a=_[_0xce78('0x39')](_0x362d34['body'],function(_0x48a27c){_0x48a27c[_0xce78('0x68')]=_0x362d34[_0xce78('0x52')]['id'];_0x48a27c['isApp']=!![];return _0x48a27c;});var _0x57aa72=_0x362d34[_0xce78('0x41')][_0xce78('0x69')]&&_0x362d34[_0xce78('0x41')][_0xce78('0x69')][_0xce78('0x6a')]()===_0xce78('0x6b')?!![]:![];return _0x34f4d1['createRouting'](_0x55c89a,_0x57aa72);})[_0xce78('0x2a')](function(_0xd5a355){return db[_0xce78('0x4c')][_0xce78('0x6c')](_0xd5a355,{'transaction':_0x56b3ef});});})[_0xce78('0x2a')](function(){return db[_0xce78('0x4c')][_0xce78('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x362d34['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x22c200,null))['catch'](handleError(_0x22c200,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 7f0e87e..d5c4e2a 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 _0x0eab=['events','../../mysqldb','VoiceExtension','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0eab,0x132));var _0xb0ea=function(_0x24ec03,_0x3e2a9c){_0x24ec03=_0x24ec03-0x0;var _0x3a8338=_0x0eab[_0x24ec03];return _0x3a8338;};'use strict';var EventEmitter=require(_0xb0ea('0x0'));var VoiceExtension=require(_0xb0ea('0x1'))['db'][_0xb0ea('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb0ea('0x3'),'afterUpdate':_0xb0ea('0x4'),'afterDestroy':_0xb0ea('0x5')};function emitEvent(_0x38f762){return function(_0x50feef,_0x41734c,_0x5d4502){VoiceExtensionEvents['emit'](_0x38f762+':'+_0x50feef['id'],_0x50feef);VoiceExtensionEvents[_0xb0ea('0x6')](_0x38f762,_0x50feef);_0x5d4502(null);};}for(var e in events){if(events[_0xb0ea('0x7')](e)){var event=events[e];VoiceExtension[_0xb0ea('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xf626=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','setMaxListeners','save'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0xf626,0x159));var _0x6f62=function(_0xa47778,_0x3cd87d){_0xa47778=_0xa47778-0x0;var _0x3a8693=_0xf626[_0xa47778];return _0x3a8693;};'use strict';var EventEmitter=require(_0x6f62('0x0'));var VoiceExtension=require(_0x6f62('0x1'))['db'][_0x6f62('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6f62('0x3')](0x0);var events={'afterCreate':_0x6f62('0x4'),'afterUpdate':_0x6f62('0x5'),'afterDestroy':_0x6f62('0x6')};function emitEvent(_0x323e4c){return function(_0x40171f,_0x39ab5d,_0x37a04f){VoiceExtensionEvents['emit'](_0x323e4c+':'+_0x40171f['id'],_0x40171f);VoiceExtensionEvents[_0x6f62('0x7')](_0x323e4c,_0x40171f);_0x37a04f(null);};}for(var e in events){if(events[_0x6f62('0x8')](e)){var event=events[e];VoiceExtension[_0x6f62('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 86ecaa1..ce338a6 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 _0x84cb=['push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','options','url','name','split','phone','param','prefix','${EXTEN:','SIP','join','indexOf','replace','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','length','intervals','map','filter','tag','CDR(tag)=','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','last','concat','priority','catch','then','Hangup','util','./voiceExtension.attributes','exports','models','type','Set','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound'];(function(_0x197871,_0x205912){var _0x51532f=function(_0x1ce0fb){while(--_0x1ce0fb){_0x197871['push'](_0x197871['shift']());}};_0x51532f(++_0x205912);}(_0x84cb,0x93));var _0xb84c=function(_0x638eb6,_0xd902e0){_0x638eb6=_0x638eb6-0x0;var _0x4249ce=_0x84cb[_0x638eb6];return _0x4249ce;};'use strict';var util=require(_0xb84c('0x0'));var _=require('lodash');var attributes=require(_0xb84c('0x1'));module[_0xb84c('0x2')]=function(_0x3d174b){var _0x52ce14=_0x3d174b[_0xb84c('0x3')];function _0x29a7c6(_0x4208c8){var _0x1307be=0x2;var _0x40f777=[{'type':_0x4208c8[_0xb84c('0x4')],'app':_0xb84c('0x5'),'appdata':'CDR(type)='+_0x4208c8[_0xb84c('0x4')],'context':_0x4208c8[_0xb84c('0x6')],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']},{'type':_0x4208c8[_0xb84c('0x4')],'app':_0x4208c8['alias']?'Set':_0xb84c('0x8'),'appdata':_0x4208c8[_0xb84c('0x9')]?_0xb84c('0xa')+_0x4208c8['alias']:_0xb84c('0xb'),'context':_0x4208c8[_0xb84c('0x6')],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']}];if(_0x4208c8[_0xb84c('0x4')]===_0xb84c('0xc')){_0x40f777[_0xb84c('0xd')]({'type':_0xb84c('0xc'),'app':_0xb84c('0x5'),'appdata':_0xb84c('0xe')+_0x4208c8['id'],'context':_0x4208c8['context'],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']});}_0x40f777[_0xb84c('0xd')]({'type':_0x4208c8[_0xb84c('0x4')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4208c8[_0xb84c('0x6')],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']},{'type':_0x4208c8['type'],'app':_0xb84c('0x5'),'appdata':_0xb84c('0xf'),'context':_0x4208c8[_0xb84c('0x6')],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']},{'type':_0x4208c8[_0xb84c('0x4')],'app':_0xb84c('0x5'),'appdata':_0xb84c('0x10'),'context':_0x4208c8[_0xb84c('0x6')],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']});return _0x40f777;}function _0x29dabd(_0x56c658){var _0x599241=0x2;var _0x44468a=[{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x12'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0x56c658[_0xb84c('0x9')]?_0xb84c('0x5'):'NoOp','appdata':_0x56c658['alias']?'CDR(routeAlias)='+_0x56c658[_0xb84c('0x9')]:_0xb84c('0xb'),'context':_0x56c658['context'],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x13')+(_0x56c658[_0xb84c('0x14')]?'${EXTEN:'+_0x56c658['cutdigits']+'}':'${EXTEN}'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':'CDR(routeid)='+_0x56c658['id'],'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x15'),'appdata':_0xb84c('0x16')+(_0x599241+0x2)+_0xb84c('0x17')+(_0x599241+0x1)+')','context':_0x56c658['context'],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':_0x56c658[_0xb84c('0x14')]?_0xb84c('0x18')+_0x56c658[_0xb84c('0x14')]+'}':_0xb84c('0x19'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658['exten'],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':'outbound','app':_0xb84c('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':'outbound','app':'Set','appdata':_0xb84c('0xf'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658['exten'],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x10'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658['exten'],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x1a')+_0x56c658['id'],'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']}];if(_0x56c658[_0xb84c('0x1b')](_0xb84c('0x1c'))&&_0x56c658[_0xb84c('0x1c')]!==_0xb84c('0x1d')){_0x44468a[_0xb84c('0xd')]({'type':_0xb84c('0x11'),'app':'Set','appdata':_0xb84c('0x1e'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x56c658[_0xb84c('0x1c')]||_0xb84c('0x1f'),'context':_0x56c658['context'],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']});}return _0x44468a;}function _0x13ad61(_0x316e0c){var _0x4d19d8=[{'name':_0xb84c('0x20'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xb84c('0x21'),'param':0x2},{'name':_0xb84c('0x22'),'param':0x3}];var _0x443328={};var _0x2f4c54=_0x316e0c['split'](',');var _0x333137=[];for(var _0x3f4efd=0x0;_0x3f4efd<_0x4d19d8['length'];_0x3f4efd++){switch(_0x4d19d8[_0x3f4efd][_0xb84c('0x23')]){case _0xb84c('0x20'):_0x443328[_0xb84c('0x20')]=_0x2f4c54[_0x4d19d8[_0x3f4efd]['param']][_0xb84c('0x24')]('/')[0x1];_0x443328[_0xb84c('0x25')]=_0x2f4c54[_0x4d19d8[_0x3f4efd][_0xb84c('0x26')]][_0xb84c('0x24')]('/')[0x2];_0x443328['prefix']=_0x443328[_0xb84c('0x25')]?_0x443328[_0xb84c('0x25')][_0xb84c('0x24')]('$')[0x0]:undefined;_0x443328['phone']=route[_0xb84c('0x14')]?(_0x443328[_0xb84c('0x27')]||'')+_0xb84c('0x28')+route[_0xb84c('0x14')]+'}':(_0x443328[_0xb84c('0x27')]||'')+'${EXTEN}';_0x333137[_0x4d19d8[_0x3f4efd]['param']]=[_0xb84c('0x29'),_0x443328[_0xb84c('0x20')],_0x443328[_0xb84c('0x25')]][_0xb84c('0x2a')]('/');break;case _0xb84c('0x21'):_0x443328[_0xb84c('0x21')]=_0x2f4c54[_0x4d19d8[_0x3f4efd]['param']];if(route['recordingFormat']!==_0xb84c('0x1d')){if(_0x443328[_0xb84c('0x21')][_0xb84c('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x443328['options']+='U(xcally-mixmonitor-context)';}}else{_0x443328[_0xb84c('0x21')]=_0x443328[_0xb84c('0x21')][_0xb84c('0x2c')](_0xb84c('0x2d'),'');}_0x333137[_0x4d19d8[_0x3f4efd][_0xb84c('0x26')]]=_0x443328[_0xb84c('0x21')];break;default:_0x333137[_0x4d19d8[_0x3f4efd][_0xb84c('0x26')]]=_0x2f4c54[_0x4d19d8[_0x3f4efd][_0xb84c('0x26')]];}}return _0x333137[_0xb84c('0x2a')](',');}function _0xd4b0d6(_0x3a6575,_0x5dd1ce,_0x8cc5f1,_0x2f184d){return new Promise(function(_0x44e8f6,_0x20ac85){var _0x98afd7=[];if(_[_0xb84c('0x2e')](_0x5dd1ce))return _0x44e8f6(_0x98afd7);_0x52ce14[_0xb84c('0x2f')][_0xb84c('0x30')]({'attributes':['id',_0xb84c('0x31'),_0xb84c('0x32')],'raw':!![]})['then'](function(_0x25491c){for(var _0x9ebd28=0x0,_0x11e31e=0x0;_0x9ebd28<_0x5dd1ce[_0xb84c('0x33')];_0x9ebd28++,_0x11e31e=0x0){var _0x258454=_0x5dd1ce[_0x9ebd28];var _0x41d9e8=[];var _0x175884=[];if(_0x258454[_0xb84c('0x31')]!=='*,*,*,*'){_0x258454[_0xb84c('0x34')]=[_0x258454[_0xb84c('0x31')]];}else{_0x258454[_0xb84c('0x34')]=_0x258454[_0xb84c('0x32')]?_[_0xb84c('0x35')](_[_0xb84c('0x36')](_0x25491c,{'IntervalId':_0x258454[_0xb84c('0x32')]}),'interval'):[];}_0x258454[_0xb84c('0x6')]=_0x3a6575[_0xb84c('0x6')];_0x258454[_0xb84c('0x7')]=_0x3a6575[_0xb84c('0x7')];if(_0x258454[_0xb84c('0x4')])_0x258454[_0xb84c('0x4')]=_0x258454[_0xb84c('0x4')]['toLowerCase']();if(_0x3a6575[_0xb84c('0x4')]===_0xb84c('0x11')){if(_0x258454['hasOwnProperty'](_0xb84c('0x37'))&&_0x258454['tag']&&_0x258454[_0xb84c('0x37')]!=='--'){_0x41d9e8[_0xb84c('0xd')]({'type':_0x258454[_0xb84c('0x4')]['toLowerCase'](),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x38')+_0x258454[_0xb84c('0x37')],'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575[_0xb84c('0x7')],'priority':_0x258454[_0xb84c('0x34')][_0xb84c('0x33')]+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});}_0x41d9e8[_0xb84c('0xd')]({'type':_0x258454[_0xb84c('0x4')][_0xb84c('0x39')](),'app':'ExecIf','appdata':_0xb84c('0x3a')+(_0x258454[_0xb84c('0x3b')]?_0xb84c('0x3c')+_0x258454[_0xb84c('0x3b')]+')':_0xb84c('0x3d')),'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575['exten'],'priority':_0x258454['intervals'][_0xb84c('0x33')]+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});}else{if(_0x258454[_0xb84c('0x1b')]('answer')){if(['queue',_0xb84c('0x3e')][_0xb84c('0x3f')](_0x258454['app'][_0xb84c('0x39')]())&&_0x258454[_0xb84c('0x40')]!==_0xb84c('0x41')){if(_0x258454['answer']){_0x41d9e8[_0xb84c('0xd')]({'type':_0x258454[_0xb84c('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0xb84c('0x42'),'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575[_0xb84c('0x7')],'priority':_0x258454[_0xb84c('0x34')][_0xb84c('0x33')]+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});_0x41d9e8[_0xb84c('0xd')]({'type':_0x258454[_0xb84c('0x4')][_0xb84c('0x39')](),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x43'),'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575[_0xb84c('0x7')],'priority':_0x258454[_0xb84c('0x34')]['length']+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});}else{_0x41d9e8['push']({'type':_0x258454[_0xb84c('0x4')][_0xb84c('0x39')](),'app':_0xb84c('0x15'),'appdata':_0xb84c('0x44'),'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575['exten'],'priority':_0x258454[_0xb84c('0x34')][_0xb84c('0x33')]+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});_0x41d9e8['push']({'type':_0x258454[_0xb84c('0x4')]['toLowerCase'](),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x45'),'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575[_0xb84c('0x7')],'priority':_0x258454['intervals'][_0xb84c('0x33')]+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});}}}}for(var _0x3c81ae=0x0;_0x3c81ae<_0x258454[_0xb84c('0x34')]['length'];_0x3c81ae++){var _0x382dbf=_0x8cc5f1+_0x258454[_0xb84c('0x34')][_0xb84c('0x33')];var _0x3d31bd=_0x3c81ae===_0x258454[_0xb84c('0x34')]['length']-0x1?_0x8cc5f1+_0x41d9e8[_0xb84c('0x33')]+_0x175884[_0xb84c('0x33')]+0x2:_0x8cc5f1+_0x3c81ae+0x1;_0x41d9e8[_0xb84c('0x46')](_0x3c81ae,0x0,{'type':_0x3a6575[_0xb84c('0x4')],'app':_0xb84c('0x47'),'appdata':_0x258454[_0xb84c('0x34')][_0x3c81ae]+'?'+_0x3a6575[_0xb84c('0x6')]+_0xb84c('0x48')+_0x382dbf+':'+_0x3a6575['context']+_0xb84c('0x48')+_0x3d31bd,'exten':_0x3a6575[_0xb84c('0x7')],'context':_0x3a6575['context'],'priority':_0x8cc5f1+_0x3c81ae,'VoiceExtensionId':_0x3a6575['id']});}if(_0x2f184d&&_0x258454[_0xb84c('0x40')]==='outboundDial')_0x258454['appdata']=_0x13ad61(_0x258454[_0xb84c('0x49')]);_0x258454['priority']=_0x41d9e8[_0xb84c('0x33')]?_[_0xb84c('0x4a')](_0x41d9e8)['priority']+0x1:_0x8cc5f1;_0x98afd7=_[_0xb84c('0x4b')](_0x98afd7,_0x41d9e8,[_0x258454],_0x175884);_0x8cc5f1=_[_0xb84c('0x4a')](_0x98afd7)[_0xb84c('0x4c')]+0x1;}return _0x44e8f6(_0x98afd7);})[_0xb84c('0x4d')](function(_0x5eeab9){_0x20ac85(_0x5eeab9);});});}return _0x3d174b['define']('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x209917,_0x4a442f){var _0x5285ce=this;var _0x679651=_0x5285ce['type']===_0xb84c('0x11')?_0x29dabd(_0x5285ce):_0x29a7c6(_0x5285ce);return _0xd4b0d6(_0x5285ce,_0x209917,_['last'](_0x679651)[_0xb84c('0x4c')]+0x1,_0x4a442f)[_0xb84c('0x4e')](function(_0x3ea593){var _0x20d762=_['concat'](_0x679651,_0x3ea593);_0x20d762[_0xb84c('0xd')]({'type':_0x5285ce[_0xb84c('0x4')],'app':_0xb84c('0x4f'),'exten':_0x5285ce[_0xb84c('0x7')],'context':_0x5285ce[_0xb84c('0x6')],'priority':_['last'](_0x20d762)[_0xb84c('0x4c')]+0x1,'VoiceExtensionId':_0x5285ce['id']});return _0x20d762;});}}});}; \ No newline at end of file +var _0x0ab8=['join','Interval','findAll','interval','IntervalId','then','intervals','map','filter','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','priority','last','concat','catch','VoiceExtension','voice_extensions','Hangup','util','lodash','./voiceExtension.attributes','exports','type','alias','Set','CDR(routeAlias)=','No\x20alias\x20set','context','exten','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','url','split','length','trunk','phone','prefix','SIP','options','indexOf','U(xcally-mixmonitor-context)','param'];(function(_0x27f32f,_0x387ccc){var _0x1b12c8=function(_0x12769a){while(--_0x12769a){_0x27f32f['push'](_0x27f32f['shift']());}};_0x1b12c8(++_0x387ccc);}(_0x0ab8,0x10b));var _0x80ab=function(_0x47b084,_0x36275a){_0x47b084=_0x47b084-0x0;var _0x161d41=_0x0ab8[_0x47b084];return _0x161d41;};'use strict';var util=require(_0x80ab('0x0'));var _=require(_0x80ab('0x1'));var attributes=require(_0x80ab('0x2'));module[_0x80ab('0x3')]=function(_0x2fc408){var _0x5a6ec6=_0x2fc408['models'];function _0x2eea23(_0x49de42){var _0x32a721=0x2;var _0x3c619f=[{'type':_0x49de42[_0x80ab('0x4')],'app':'Set','appdata':'CDR(type)='+_0x49de42[_0x80ab('0x4')],'context':_0x49de42['context'],'exten':_0x49de42['exten'],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']},{'type':_0x49de42['type'],'app':_0x49de42[_0x80ab('0x5')]?_0x80ab('0x6'):'NoOp','appdata':_0x49de42[_0x80ab('0x5')]?_0x80ab('0x7')+_0x49de42[_0x80ab('0x5')]:_0x80ab('0x8'),'context':_0x49de42[_0x80ab('0x9')],'exten':_0x49de42[_0x80ab('0xa')],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']}];if(_0x49de42[_0x80ab('0x4')]===_0x80ab('0xb')){_0x3c619f['push']({'type':'inbound','app':_0x80ab('0x6'),'appdata':_0x80ab('0xc')+_0x49de42['id'],'context':_0x49de42[_0x80ab('0x9')],'exten':_0x49de42[_0x80ab('0xa')],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']});}_0x3c619f[_0x80ab('0xd')]({'type':_0x49de42[_0x80ab('0x4')],'app':_0x80ab('0x6'),'appdata':_0x80ab('0xe'),'context':_0x49de42[_0x80ab('0x9')],'exten':_0x49de42[_0x80ab('0xa')],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']},{'type':_0x49de42[_0x80ab('0x4')],'app':_0x80ab('0x6'),'appdata':_0x80ab('0xf'),'context':_0x49de42['context'],'exten':_0x49de42[_0x80ab('0xa')],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']},{'type':_0x49de42[_0x80ab('0x4')],'app':'Set','appdata':_0x80ab('0x10'),'context':_0x49de42[_0x80ab('0x9')],'exten':_0x49de42[_0x80ab('0xa')],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']});return _0x3c619f;}function _0x2077b8(_0xcd12cc){var _0x20028c=0x2;var _0x837b9a=[{'type':_0x80ab('0x11'),'app':_0x80ab('0x6'),'appdata':_0x80ab('0x12'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':'outbound','app':_0xcd12cc['alias']?_0x80ab('0x6'):_0x80ab('0x13'),'appdata':_0xcd12cc[_0x80ab('0x5')]?'CDR(routeAlias)='+_0xcd12cc['alias']:_0x80ab('0x8'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':'outbound','app':_0x80ab('0x6'),'appdata':'CDR(destination)='+(_0xcd12cc[_0x80ab('0x14')]?_0x80ab('0x15')+_0xcd12cc[_0x80ab('0x14')]+'}':'${EXTEN}'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':'Set','appdata':_0x80ab('0xc')+_0xcd12cc['id'],'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':_0x80ab('0x16'),'appdata':_0x80ab('0x17')+(_0x20028c+0x2)+_0x80ab('0x18')+(_0x20028c+0x1)+')','context':_0xcd12cc['context'],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':_0x80ab('0x6'),'appdata':_0xcd12cc['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0xcd12cc[_0x80ab('0x14')]+'}':_0x80ab('0x19'),'context':_0xcd12cc['context'],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':'outbound','app':_0x80ab('0x6'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xcd12cc['context'],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':'outbound','app':_0x80ab('0x6'),'appdata':_0x80ab('0xf'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':_0x80ab('0x6'),'appdata':'MONITOR_OPTIONS=ab','context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':_0x80ab('0x6'),'appdata':_0x80ab('0x1a')+_0xcd12cc['id'],'context':_0xcd12cc['context'],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']}];if(_0xcd12cc[_0x80ab('0x1b')]('recordingFormat')&&_0xcd12cc[_0x80ab('0x1c')]!==_0x80ab('0x1d')){_0x837b9a['push']({'type':_0x80ab('0x11'),'app':'Set','appdata':_0x80ab('0x1e'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':'Set','appdata':_0x80ab('0x1f')+_0xcd12cc[_0x80ab('0x1c')]||_0x80ab('0x20'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc['exten'],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']});}return _0x837b9a;}function _0x375582(_0x1b1278){var _0x39c719=[{'name':'trunk','param':0x0},{'name':_0x80ab('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':_0x80ab('0x22'),'param':0x3}];var _0x5b4c6d={};var _0x7716bb=_0x1b1278[_0x80ab('0x23')](',');var _0x3c3ed6=[];for(var _0x1950ab=0x0;_0x1950ab<_0x39c719[_0x80ab('0x24')];_0x1950ab++){switch(_0x39c719[_0x1950ab]['name']){case _0x80ab('0x25'):_0x5b4c6d[_0x80ab('0x25')]=_0x7716bb[_0x39c719[_0x1950ab]['param']]['split']('/')[0x1];_0x5b4c6d[_0x80ab('0x26')]=_0x7716bb[_0x39c719[_0x1950ab]['param']]['split']('/')[0x2];_0x5b4c6d[_0x80ab('0x27')]=_0x5b4c6d[_0x80ab('0x26')]?_0x5b4c6d[_0x80ab('0x26')]['split']('$')[0x0]:undefined;_0x5b4c6d[_0x80ab('0x26')]=route[_0x80ab('0x14')]?(_0x5b4c6d[_0x80ab('0x27')]||'')+'${EXTEN:'+route[_0x80ab('0x14')]+'}':(_0x5b4c6d[_0x80ab('0x27')]||'')+'${EXTEN}';_0x3c3ed6[_0x39c719[_0x1950ab]['param']]=[_0x80ab('0x28'),_0x5b4c6d[_0x80ab('0x25')],_0x5b4c6d[_0x80ab('0x26')]]['join']('/');break;case _0x80ab('0x29'):_0x5b4c6d[_0x80ab('0x29')]=_0x7716bb[_0x39c719[_0x1950ab]['param']];if(route[_0x80ab('0x1c')]!==_0x80ab('0x1d')){if(_0x5b4c6d[_0x80ab('0x29')][_0x80ab('0x2a')](_0x80ab('0x2b'))<0x0){_0x5b4c6d['options']+=_0x80ab('0x2b');}}else{_0x5b4c6d[_0x80ab('0x29')]=_0x5b4c6d[_0x80ab('0x29')]['replace'](_0x80ab('0x2b'),'');}_0x3c3ed6[_0x39c719[_0x1950ab][_0x80ab('0x2c')]]=_0x5b4c6d['options'];break;default:_0x3c3ed6[_0x39c719[_0x1950ab][_0x80ab('0x2c')]]=_0x7716bb[_0x39c719[_0x1950ab][_0x80ab('0x2c')]];}}return _0x3c3ed6[_0x80ab('0x2d')](',');}function _0x42cd0b(_0x586134,_0x39afb4,_0x36eca8,_0x596850){return new Promise(function(_0x3596fd,_0xa65ec1){var _0x2a0144=[];if(_['isEmpty'](_0x39afb4))return _0x3596fd(_0x2a0144);_0x5a6ec6[_0x80ab('0x2e')][_0x80ab('0x2f')]({'attributes':['id',_0x80ab('0x30'),_0x80ab('0x31')],'raw':!![]})[_0x80ab('0x32')](function(_0x436ccf){for(var _0x3cb9dc=0x0,_0x1e9a4d=0x0;_0x3cb9dc<_0x39afb4[_0x80ab('0x24')];_0x3cb9dc++,_0x1e9a4d=0x0){var _0x490c3a=_0x39afb4[_0x3cb9dc];var _0x3e37d0=[];var _0x4eded5=[];if(_0x490c3a['interval']!=='*,*,*,*'){_0x490c3a[_0x80ab('0x33')]=[_0x490c3a[_0x80ab('0x30')]];}else{_0x490c3a[_0x80ab('0x33')]=_0x490c3a[_0x80ab('0x31')]?_[_0x80ab('0x34')](_[_0x80ab('0x35')](_0x436ccf,{'IntervalId':_0x490c3a[_0x80ab('0x31')]}),'interval'):[];}_0x490c3a[_0x80ab('0x9')]=_0x586134['context'];_0x490c3a[_0x80ab('0xa')]=_0x586134[_0x80ab('0xa')];if(_0x490c3a['type'])_0x490c3a[_0x80ab('0x4')]=_0x490c3a['type']['toLowerCase']();if(_0x586134[_0x80ab('0x4')]===_0x80ab('0x11')){if(_0x490c3a[_0x80ab('0x1b')](_0x80ab('0x36'))&&_0x490c3a[_0x80ab('0x36')]&&_0x490c3a['tag']!=='--'){_0x3e37d0[_0x80ab('0xd')]({'type':_0x490c3a['type']['toLowerCase'](),'app':_0x80ab('0x6'),'appdata':'CDR(tag)='+_0x490c3a[_0x80ab('0x36')],'context':_0x586134[_0x80ab('0x9')],'exten':_0x586134[_0x80ab('0xa')],'priority':_0x490c3a[_0x80ab('0x33')][_0x80ab('0x24')]+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});}_0x3e37d0[_0x80ab('0xd')]({'type':_0x490c3a[_0x80ab('0x4')]['toLowerCase'](),'app':_0x80ab('0x16'),'appdata':_0x80ab('0x37')+(_0x490c3a[_0x80ab('0x38')]?'Set(CALLERID(all)='+_0x490c3a[_0x80ab('0x38')]+')':_0x80ab('0x39')),'context':_0x586134['context'],'exten':_0x586134[_0x80ab('0xa')],'priority':_0x490c3a[_0x80ab('0x33')]['length']+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});}else{if(_0x490c3a['hasOwnProperty'](_0x80ab('0x3a'))){if([_0x80ab('0x3b'),_0x80ab('0x3c')]['includes'](_0x490c3a['app'][_0x80ab('0x3d')]())&&_0x490c3a[_0x80ab('0x3e')]!==_0x80ab('0x3f')){if(_0x490c3a[_0x80ab('0x3a')]){_0x3e37d0[_0x80ab('0xd')]({'type':_0x490c3a[_0x80ab('0x4')][_0x80ab('0x3d')](),'app':_0x80ab('0x16'),'appdata':_0x80ab('0x40'),'context':_0x586134[_0x80ab('0x9')],'exten':_0x586134[_0x80ab('0xa')],'priority':_0x490c3a[_0x80ab('0x33')][_0x80ab('0x24')]+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});_0x3e37d0[_0x80ab('0xd')]({'type':_0x490c3a['type'][_0x80ab('0x3d')](),'app':'Set','appdata':_0x80ab('0x41'),'context':_0x586134[_0x80ab('0x9')],'exten':_0x586134[_0x80ab('0xa')],'priority':_0x490c3a['intervals'][_0x80ab('0x24')]+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});}else{_0x3e37d0['push']({'type':_0x490c3a[_0x80ab('0x4')][_0x80ab('0x3d')](),'app':_0x80ab('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x586134[_0x80ab('0x9')],'exten':_0x586134[_0x80ab('0xa')],'priority':_0x490c3a['intervals'][_0x80ab('0x24')]+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});_0x3e37d0['push']({'type':_0x490c3a['type'][_0x80ab('0x3d')](),'app':'Set','appdata':_0x80ab('0x42'),'context':_0x586134[_0x80ab('0x9')],'exten':_0x586134['exten'],'priority':_0x490c3a[_0x80ab('0x33')][_0x80ab('0x24')]+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});}}}}for(var _0x1a9d0e=0x0;_0x1a9d0e<_0x490c3a[_0x80ab('0x33')][_0x80ab('0x24')];_0x1a9d0e++){var _0x5ec25e=_0x36eca8+_0x490c3a[_0x80ab('0x33')]['length'];var _0x1b1597=_0x1a9d0e===_0x490c3a[_0x80ab('0x33')][_0x80ab('0x24')]-0x1?_0x36eca8+_0x3e37d0[_0x80ab('0x24')]+_0x4eded5[_0x80ab('0x24')]+0x2:_0x36eca8+_0x1a9d0e+0x1;_0x3e37d0[_0x80ab('0x43')](_0x1a9d0e,0x0,{'type':_0x586134[_0x80ab('0x4')],'app':_0x80ab('0x44'),'appdata':_0x490c3a[_0x80ab('0x33')][_0x1a9d0e]+'?'+_0x586134[_0x80ab('0x9')]+',${EXTEN},'+_0x5ec25e+':'+_0x586134[_0x80ab('0x9')]+',${EXTEN},'+_0x1b1597,'exten':_0x586134[_0x80ab('0xa')],'context':_0x586134[_0x80ab('0x9')],'priority':_0x36eca8+_0x1a9d0e,'VoiceExtensionId':_0x586134['id']});}if(_0x596850&&_0x490c3a['appType']===_0x80ab('0x45'))_0x490c3a[_0x80ab('0x46')]=_0x375582(_0x490c3a[_0x80ab('0x46')]);_0x490c3a[_0x80ab('0x47')]=_0x3e37d0[_0x80ab('0x24')]?_[_0x80ab('0x48')](_0x3e37d0)[_0x80ab('0x47')]+0x1:_0x36eca8;_0x2a0144=_[_0x80ab('0x49')](_0x2a0144,_0x3e37d0,[_0x490c3a],_0x4eded5);_0x36eca8=_[_0x80ab('0x48')](_0x2a0144)[_0x80ab('0x47')]+0x1;}return _0x3596fd(_0x2a0144);})[_0x80ab('0x4a')](function(_0x3aa510){_0xa65ec1(_0x3aa510);});});}return _0x2fc408['define'](_0x80ab('0x4b'),attributes,{'tableName':_0x80ab('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xaa2376,_0x3acb06){var _0x1ac513=this;var _0x14a82f=_0x1ac513[_0x80ab('0x4')]===_0x80ab('0x11')?_0x2077b8(_0x1ac513):_0x2eea23(_0x1ac513);return _0x42cd0b(_0x1ac513,_0xaa2376,_[_0x80ab('0x48')](_0x14a82f)[_0x80ab('0x47')]+0x1,_0x3acb06)[_0x80ab('0x32')](function(_0x1819f6){var _0x37bfb4=_[_0x80ab('0x49')](_0x14a82f,_0x1819f6);_0x37bfb4[_0x80ab('0xd')]({'type':_0x1ac513[_0x80ab('0x4')],'app':_0x80ab('0x4d'),'exten':_0x1ac513[_0x80ab('0xa')],'context':_0x1ac513[_0x80ab('0x9')],'priority':_['last'](_0x37bfb4)[_0x80ab('0x47')]+0x1,'VoiceExtensionId':_0x1ac513['id']});return _0x37bfb4;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 814d350..675b2e5 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 _0xc569=['model','map','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include'];(function(_0x33c364,_0xa6c8a0){var _0x87421d=function(_0x584c02){while(--_0x584c02){_0x33c364['push'](_0x33c364['shift']());}};_0x87421d(++_0xa6c8a0);}(_0xc569,0x159));var _0x9c56=function(_0x26e125,_0x55760c){_0x26e125=_0x26e125-0x0;var _0x22c3a6=_0xc569[_0x26e125];return _0x22c3a6;};'use strict';var _=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var moment=require(_0x9c56('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c56('0x3'));var fs=require('fs');var Redis=require(_0x9c56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c56('0x5'));var logger=require(_0x9c56('0x6'))(_0x9c56('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c56('0x8'));var client=jayson[_0x9c56('0x9')][_0x9c56('0xa')]({'port':0x232a});config[_0x9c56('0xb')]=_['defaults'](config[_0x9c56('0xb')],{'host':_0x9c56('0xc'),'port':0x18eb});var socket=require(_0x9c56('0xd'))(new Redis(config[_0x9c56('0xb')]));require(_0x9c56('0xe'))['register'](socket);function respondWithRpcPromise(_0x478bf3,_0x533731,_0x16bc76){return new BPromise(function(_0xee51af,_0x5a6a26){return client[_0x9c56('0xf')](_0x478bf3,_0x16bc76)['then'](function(_0x36cb53){logger[_0x9c56('0x10')](_0x9c56('0x11'),_0x533731,_0x9c56('0x12'));logger[_0x9c56('0x13')](_0x9c56('0x14'),_0x533731,_0x9c56('0x12'),JSON['stringify'](_0x36cb53));if(_0x36cb53[_0x9c56('0x15')]){if(_0x36cb53[_0x9c56('0x15')][_0x9c56('0x16')]===0x1f4){logger[_0x9c56('0x15')](_0x9c56('0x11'),_0x533731,_0x36cb53['error'][_0x9c56('0x17')]);return _0x5a6a26(_0x36cb53['error'][_0x9c56('0x17')]);}logger[_0x9c56('0x15')](_0x9c56('0x11'),_0x533731,_0x36cb53[_0x9c56('0x15')][_0x9c56('0x17')]);return _0xee51af(_0x36cb53[_0x9c56('0x15')][_0x9c56('0x17')]);}else{logger[_0x9c56('0x10')](_0x9c56('0x11'),_0x533731,_0x9c56('0x12'));_0xee51af(_0x36cb53[_0x9c56('0x18')][_0x9c56('0x17')]);}})[_0x9c56('0x19')](function(_0x8ef95e){logger[_0x9c56('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x533731,_0x8ef95e);_0x5a6a26(_0x8ef95e);});});}exports[_0x9c56('0x1a')]=function(_0x3b2124){var _0x6d7bf6=this;return new Promise(function(_0x56bf0a,_0xf074f9){return db[_0x9c56('0x1b')][_0x9c56('0x1c')]({'raw':_0x3b2124[_0x9c56('0x1d')]?_0x3b2124[_0x9c56('0x1d')][_0x9c56('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b2124[_0x9c56('0x1d')]?_0x3b2124[_0x9c56('0x1d')][_0x9c56('0x1f')]||null:null,'attributes':_0x3b2124['options']?_0x3b2124[_0x9c56('0x1d')][_0x9c56('0x20')]||null:null,'limit':_0x3b2124['options']?_0x3b2124[_0x9c56('0x1d')][_0x9c56('0x21')]||null:null,'include':_0x3b2124[_0x9c56('0x1d')]?_0x3b2124[_0x9c56('0x1d')][_0x9c56('0x22')]?_['map'](_0x3b2124['options'][_0x9c56('0x22')],function(_0x1e03ff){return{'model':db[_0x1e03ff['model']],'as':_0x1e03ff['as'],'attributes':_0x1e03ff[_0x9c56('0x20')],'include':_0x1e03ff['include']?_['map'](_0x1e03ff[_0x9c56('0x22')],function(_0x42a685){return{'model':db[_0x42a685[_0x9c56('0x23')]],'as':_0x42a685['as'],'attributes':_0x42a685[_0x9c56('0x20')],'include':_0x42a685[_0x9c56('0x22')]?_[_0x9c56('0x24')](_0x42a685['include'],function(_0x14efdf){return{'model':db[_0x14efdf[_0x9c56('0x23')]],'as':_0x14efdf['as'],'attributes':_0x14efdf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x47c7be){logger[_0x9c56('0x10')]('GetVoiceExtension',_0x3b2124);logger[_0x9c56('0x13')](_0x9c56('0x1a'),_0x3b2124,JSON[_0x9c56('0x25')](_0x47c7be));_0x56bf0a(_0x47c7be);})[_0x9c56('0x19')](function(_0x289696){logger[_0x9c56('0x15')]('GetVoiceExtension',_0x289696[_0x9c56('0x17')],_0x3b2124);_0xf074f9(_0x6d7bf6['error'](0x1f4,_0x289696['message']));});});}; \ No newline at end of file +var _0xb4c7=['then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./voiceExtension.socket','register','request'];(function(_0xd33198,_0x5d4c0e){var _0x2277db=function(_0x541402){while(--_0x541402){_0xd33198['push'](_0xd33198['shift']());}};_0x2277db(++_0x5d4c0e);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x3c188c,_0x25d714){_0x3c188c=_0x3c188c-0x0;var _0x340bf8=_0xb4c7[_0x3c188c];return _0x340bf8;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});config[_0x7b4c('0xc')]=_['defaults'](config[_0x7b4c('0xc')],{'host':_0x7b4c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b4c('0xc')]));require(_0x7b4c('0xe'))[_0x7b4c('0xf')](socket);function respondWithRpcPromise(_0x237e28,_0x365225,_0x93d013){return new BPromise(function(_0x1a996f,_0xc62104){return client[_0x7b4c('0x10')](_0x237e28,_0x93d013)[_0x7b4c('0x11')](function(_0x5d5bc3){logger['info'](_0x7b4c('0x12'),_0x365225,_0x7b4c('0x13'));logger[_0x7b4c('0x14')](_0x7b4c('0x15'),_0x365225,_0x7b4c('0x13'),JSON[_0x7b4c('0x16')](_0x5d5bc3));if(_0x5d5bc3[_0x7b4c('0x17')]){if(_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x18')]===0x1f4){logger[_0x7b4c('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x365225,_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);return _0xc62104(_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);}logger[_0x7b4c('0x17')](_0x7b4c('0x12'),_0x365225,_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);return _0x1a996f(_0x5d5bc3['error'][_0x7b4c('0x19')]);}else{logger[_0x7b4c('0x1a')](_0x7b4c('0x12'),_0x365225,_0x7b4c('0x13'));_0x1a996f(_0x5d5bc3['result'][_0x7b4c('0x19')]);}})[_0x7b4c('0x1b')](function(_0x32110e){logger[_0x7b4c('0x17')](_0x7b4c('0x12'),_0x365225,_0x32110e);_0xc62104(_0x32110e);});});}exports[_0x7b4c('0x1c')]=function(_0x237110){var _0x445281=this;return new Promise(function(_0x3556d8,_0x55e3df){return db[_0x7b4c('0x1d')][_0x7b4c('0x1e')]({'raw':_0x237110[_0x7b4c('0x1f')]?_0x237110[_0x7b4c('0x1f')][_0x7b4c('0x20')]===undefined?!![]:![]:!![],'where':_0x237110[_0x7b4c('0x1f')]?_0x237110[_0x7b4c('0x1f')][_0x7b4c('0x21')]||null:null,'attributes':_0x237110[_0x7b4c('0x1f')]?_0x237110[_0x7b4c('0x1f')]['attributes']||null:null,'limit':_0x237110[_0x7b4c('0x1f')]?_0x237110[_0x7b4c('0x1f')][_0x7b4c('0x22')]||null:null,'include':_0x237110[_0x7b4c('0x1f')]?_0x237110[_0x7b4c('0x1f')][_0x7b4c('0x23')]?_[_0x7b4c('0x24')](_0x237110[_0x7b4c('0x1f')][_0x7b4c('0x23')],function(_0x1a69db){return{'model':db[_0x1a69db[_0x7b4c('0x25')]],'as':_0x1a69db['as'],'attributes':_0x1a69db[_0x7b4c('0x26')],'include':_0x1a69db[_0x7b4c('0x23')]?_['map'](_0x1a69db[_0x7b4c('0x23')],function(_0x3ab614){return{'model':db[_0x3ab614[_0x7b4c('0x25')]],'as':_0x3ab614['as'],'attributes':_0x3ab614[_0x7b4c('0x26')],'include':_0x3ab614[_0x7b4c('0x23')]?_[_0x7b4c('0x24')](_0x3ab614[_0x7b4c('0x23')],function(_0x2552f9){return{'model':db[_0x2552f9[_0x7b4c('0x25')]],'as':_0x2552f9['as'],'attributes':_0x2552f9[_0x7b4c('0x26')]};}):[]};}):[]};}):[]:[]})[_0x7b4c('0x11')](function(_0x130ace){logger[_0x7b4c('0x1a')](_0x7b4c('0x1c'),_0x237110);logger[_0x7b4c('0x14')](_0x7b4c('0x1c'),_0x237110,JSON[_0x7b4c('0x16')](_0x130ace));_0x3556d8(_0x130ace);})[_0x7b4c('0x1b')](function(_0x9d3d31){logger['error']('GetVoiceExtension',_0x9d3d31['message'],_0x237110);_0x55e3df(_0x445281[_0x7b4c('0x17')](0x1f4,_0x9d3d31[_0x7b4c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index cc83c2e..2a9b479 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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x56051f,_0x60433f){var _0x3159c1=function(_0x18862f){while(--_0x18862f){_0x56051f['push'](_0x56051f['shift']());}};_0x3159c1(++_0x60433f);}(_0xabce,0x103));var _0xeabc=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xabce[_0x550d12];return _0x12103d;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x42daa5,_0x345b51){var _0xadfa2b=function(_0x593a02){while(--_0x593a02){_0x42daa5['push'](_0x42daa5['shift']());}};_0xadfa2b(++_0x345b51);}(_0x53ec,0x192));var _0xc53e=function(_0x39b07e,_0x33b057){_0x39b07e=_0x39b07e-0x0;var _0x591dae=_0x53ec[_0x39b07e];return _0x591dae;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 8c87826..b498f6b 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 _0x4fb4=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x4fb4,0x190));var _0x44fb=function(_0x148f98,_0xa894ba){_0x148f98=_0x148f98-0x0;var _0x4f964d=_0x4fb4[_0x148f98];return _0x4f964d;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id/messages',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0x10')]);router[_0x44fb('0x11')](_0x44fb('0xc'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x12')]);router[_0x44fb('0x13')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0x14')]);module[_0x44fb('0x15')]=router; \ No newline at end of file +var _0xd046=['get','show','getMessages','isAuthenticated','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./voiceMail.controller','index'];(function(_0x4fd272,_0x1ff97d){var _0x50948=function(_0x489827){while(--_0x489827){_0x4fd272['push'](_0x4fd272['shift']());}};_0x50948(++_0x1ff97d);}(_0xd046,0x129));var _0x6d04=function(_0x4e4458,_0xf33e8f){_0x4e4458=_0x4e4458-0x0;var _0x56bc7c=_0xd046[_0x4e4458];return _0x56bc7c;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['post']('/',auth[_0x6d04('0xa')](),controller['create']);router['put']('/:id',auth[_0x6d04('0xa')](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')](_0x6d04('0xd'),auth['isAuthenticated'](),controller[_0x6d04('0xe')]);module[_0x6d04('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 0181576..ae6c985 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 _0x0f6e=['INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','exports','STRING','from-voicemail','contest_mailbox','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x0f6e,0xd5));var _0xe0f6=function(_0x5d09d9,_0x181abf){_0x5d09d9=_0x5d09d9-0x0;var _0x7ce182=_0x0f6e[_0x5d09d9];return _0x7ce182;};'use strict';var Sequelize=require('sequelize');module[_0xe0f6('0x0')]={'customer_id':{'type':Sequelize[_0xe0f6('0x1')]},'context':{'type':Sequelize[_0xe0f6('0x1')],'defaultValue':_0xe0f6('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xe0f6('0x3')},'password':{'type':Sequelize[_0xe0f6('0x1')]},'fullname':{'type':Sequelize[_0xe0f6('0x1')]},'email':{'type':Sequelize[_0xe0f6('0x1')],'validate':{'isEmail':!![]},'set':function(_0x15f96b){this['setDataValue']('email',typeof _0x15f96b===_0xe0f6('0x4')&&_0x15f96b[_0xe0f6('0x5')]()?_0x15f96b[_0xe0f6('0x5')]():null);}},'pager':{'type':Sequelize[_0xe0f6('0x1')]},'tz':{'type':Sequelize[_0xe0f6('0x1')],'defaultValue':_0xe0f6('0x6')},'attach':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':_0xe0f6('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xe0f6('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xe0f6('0x1')]},'callback':{'type':Sequelize[_0xe0f6('0x1')]},'review':{'type':Sequelize['ENUM'](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe0f6('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':_0xe0f6('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xe0f6('0x8'),'no'),'defaultValue':_0xe0f6('0x8'),'allowNull':![]},'stamp':{'type':_0xe0f6('0xa')},'emailsubject':{'type':Sequelize[_0xe0f6('0x1')]},'emailbody':{'type':Sequelize[_0xe0f6('0x1')]},'maxsecs':{'type':Sequelize[_0xe0f6('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe0f6('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe0f6('0xc')],'get':function(){return this[_0xe0f6('0xd')](_0xe0f6('0xe'))+_0xe0f6('0xf')+this[_0xe0f6('0xd')]('mailbox');}}}; \ No newline at end of file +var _0x7637=['VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x285ec4,_0x2430d0){var _0x51377=function(_0x5a9539){while(--_0x5a9539){_0x285ec4['push'](_0x285ec4['shift']());}};_0x51377(++_0x2430d0);}(_0x7637,0xaf));var _0x7763=function(_0x4dc8c6,_0x3fba52){_0x4dc8c6=_0x4dc8c6-0x0;var _0x69ce1d=_0x7637[_0x4dc8c6];return _0x69ce1d;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x7763('0x0')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x7763('0x1'),'unique':_0x7763('0x2')},'mailbox':{'type':Sequelize[_0x7763('0x0')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x7763('0x0')]},'fullname':{'type':Sequelize[_0x7763('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x2b6f0c){this[_0x7763('0x3')](_0x7763('0x4'),typeof _0x2b6f0c===_0x7763('0x5')&&_0x2b6f0c[_0x7763('0x6')]()?_0x2b6f0c['trim']():null);}},'pager':{'type':Sequelize[_0x7763('0x0')]},'tz':{'type':Sequelize[_0x7763('0x0')],'defaultValue':_0x7763('0x7')},'attach':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':_0x7763('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':_0x7763('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7763('0x0')]},'callback':{'type':Sequelize[_0x7763('0x0')]},'review':{'type':Sequelize['ENUM'](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7763('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7763('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':_0x7763('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7763('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':_0x7763('0x9'),'allowNull':![]},'stamp':{'type':_0x7763('0xb')},'emailsubject':{'type':Sequelize[_0x7763('0x0')]},'emailbody':{'type':Sequelize[_0x7763('0x0')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7763('0xc')],'get':function(){return this['getDataValue'](_0x7763('0xd'))+_0x7763('0xe')+this[_0x7763('0xf')](_0x7763('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 3b75c67..b1e35ae 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 _0x69d3=['Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','findAll','catch','show','params','include','options','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','VoiceMailMessage','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then'];(function(_0x2813fa,_0x3211d4){var _0x8a2acb=function(_0x4a9602){while(--_0x4a9602){_0x2813fa['push'](_0x2813fa['shift']());}};_0x8a2acb(++_0x3211d4);}(_0x69d3,0xda));var _0x369d=function(_0x51c968,_0x35b964){_0x51c968=_0x51c968-0x0;var _0x9ec045=_0x69d3[_0x51c968];return _0x9ec045;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];function respondWithStatusCode(_0xee549e,_0x52c126){_0x52c126=_0x52c126||0xcc;return function(_0x15b417){if(_0x15b417){return _0xee549e[_0x369d('0x17')](_0x52c126);}return _0xee549e[_0x369d('0x18')](_0x52c126)[_0x369d('0x19')]();};}function respondWithResult(_0x121307,_0x539536){_0x539536=_0x539536||0xc8;return function(_0x5cd4c3){if(_0x5cd4c3){return _0x121307['status'](_0x539536)[_0x369d('0x1a')](_0x5cd4c3);}};}function respondWithFilteredResult(_0xa126c1,_0x389c43){return function(_0x5b4f55){if(_0x5b4f55){var _0x2c1a4a=typeof _0x389c43[_0x369d('0x1b')]===_0x369d('0x1c')&&typeof _0x389c43['limit']===_0x369d('0x1c');var _0x1f37ff=_0x5b4f55['count'];var _0x572513=_0x2c1a4a?0x0:_0x389c43['offset'];var _0x2946be=_0x2c1a4a?_0x5b4f55[_0x369d('0x1d')]:_0x389c43[_0x369d('0x1b')]+_0x389c43['limit'];var _0x410dbe;if(_0x2946be>=_0x1f37ff){_0x2946be=_0x1f37ff;_0x410dbe=0xc8;}else{_0x410dbe=0xce;}_0xa126c1[_0x369d('0x18')](_0x410dbe);return _0xa126c1[_0x369d('0x1e')](_0x369d('0x1f'),_0x572513+'-'+_0x2946be+'/'+_0x1f37ff)[_0x369d('0x1a')](_0x5b4f55);}return null;};}function patchUpdates(_0x538ca4){return function(_0x5c9fdd){try{jsonpatch[_0x369d('0x20')](_0x5c9fdd,_0x538ca4,!![]);}catch(_0x1edcd5){return BPromise[_0x369d('0x21')](_0x1edcd5);}return _0x5c9fdd[_0x369d('0x22')]();};}function saveUpdates(_0x84cc0f,_0x15fbef){return function(_0x1b262a){if(_0x1b262a){return _0x1b262a['update'](_0x84cc0f)['then'](function(_0x32ef9a){return _0x32ef9a;});}return null;};}function removeEntity(_0xed16e,_0xf7bc3a){return function(_0xcae58){if(_0xcae58){return _0xcae58[_0x369d('0x23')]()[_0x369d('0x24')](function(){var _0x36cf04=_0xcae58['get']({'plain':!![]});var _0x4dfe83=_0x369d('0x25');return db[_0x369d('0x26')][_0x369d('0x23')]({'where':{'type':_0x4dfe83,'resourceId':_0x36cf04['id']}})[_0x369d('0x24')](function(){return _0xcae58;});})[_0x369d('0x24')](function(){_0xed16e[_0x369d('0x18')](0xcc)[_0x369d('0x19')]();});}};}function handleEntityNotFound(_0x570db4,_0x23656b){return function(_0xe95742){if(!_0xe95742){_0x570db4[_0x369d('0x17')](0x194);}return _0xe95742;};}function handleError(_0xf952a3,_0x345be5){_0x345be5=_0x345be5||0x1f4;return function(_0x41367a){logger[_0x369d('0x27')](_0x41367a['stack']);if(_0x41367a[_0x369d('0x28')]){delete _0x41367a['name'];}_0xf952a3['status'](_0x345be5)[_0x369d('0x29')](_0x41367a);};}exports[_0x369d('0x2a')]=function(_0x5844c7,_0x104540){var _0x5a14ce={},_0x37274f={},_0x39d656={'count':0x0,'rows':[]};var _0xe45219=_[_0x369d('0x2b')](db[_0x369d('0x2c')][_0x369d('0x2d')],function(_0x119c00){return{'name':_0x119c00['fieldName'],'type':_0x119c00[_0x369d('0x2e')][_0x369d('0x2f')]};});_0x37274f[_0x369d('0x30')]=_[_0x369d('0x2b')](_0xe45219,_0x369d('0x28'));_0x37274f[_0x369d('0x31')]=_[_0x369d('0x32')](_0x5844c7[_0x369d('0x31')]);_0x37274f['filters']=_[_0x369d('0x33')](_0x37274f[_0x369d('0x30')],_0x37274f[_0x369d('0x31')]);_0x5a14ce[_0x369d('0x34')]=_[_0x369d('0x33')](_0x37274f['model'],qs[_0x369d('0x35')](_0x5844c7[_0x369d('0x31')][_0x369d('0x35')]));_0x5a14ce[_0x369d('0x34')]=_0x5a14ce[_0x369d('0x34')][_0x369d('0x36')]?_0x5a14ce['attributes']:_0x37274f[_0x369d('0x30')];if(!_0x5844c7[_0x369d('0x31')][_0x369d('0x37')](_0x369d('0x38'))){_0x5a14ce[_0x369d('0x39')]=qs[_0x369d('0x39')](_0x5844c7[_0x369d('0x31')][_0x369d('0x39')]);_0x5a14ce[_0x369d('0x1b')]=qs[_0x369d('0x1b')](_0x5844c7[_0x369d('0x31')][_0x369d('0x1b')]);}_0x5a14ce[_0x369d('0x3a')]=qs[_0x369d('0x3b')](_0x5844c7[_0x369d('0x31')][_0x369d('0x3b')]);_0x5a14ce[_0x369d('0x3c')]=qs[_0x369d('0x3d')](_[_0x369d('0x3e')](_0x5844c7[_0x369d('0x31')],_0x37274f[_0x369d('0x3d')]),_0xe45219);if(_0x5844c7[_0x369d('0x31')][_0x369d('0x3f')]){_0x5a14ce[_0x369d('0x3c')]=_['merge'](_0x5a14ce['where'],{'$or':_[_0x369d('0x2b')](_0xe45219,function(_0x319e5d){if(_0x319e5d[_0x369d('0x2e')]!==_0x369d('0x40')){var _0x3afa89={};_0x3afa89[_0x319e5d[_0x369d('0x28')]]={'$like':'%'+_0x5844c7[_0x369d('0x31')][_0x369d('0x3f')]+'%'};return _0x3afa89;}})});}_0x5a14ce=_[_0x369d('0x41')]({},_0x5a14ce,_0x5844c7['options']);var _0x322b13={'where':_0x5a14ce[_0x369d('0x3c')]};return db[_0x369d('0x2c')][_0x369d('0x1d')](_0x322b13)[_0x369d('0x24')](function(_0x25cf4e){_0x39d656[_0x369d('0x1d')]=_0x25cf4e;if(_0x5844c7[_0x369d('0x31')]['includeAll']){_0x5a14ce['include']=[{'all':!![]}];}return db[_0x369d('0x2c')][_0x369d('0x42')](_0x5a14ce);})[_0x369d('0x24')](function(_0x4dad71){_0x39d656['rows']=_0x4dad71;return _0x39d656;})['then'](respondWithFilteredResult(_0x104540,_0x5a14ce))[_0x369d('0x43')](handleError(_0x104540,null));};exports[_0x369d('0x44')]=function(_0x55dfde,_0xe7ba64){var _0x430040={'raw':!![],'where':{'id':_0x55dfde[_0x369d('0x45')]['id']}},_0x102a65={};_0x102a65['model']=_[_0x369d('0x32')](db['VoiceMail'][_0x369d('0x2d')]);_0x102a65['query']=_[_0x369d('0x32')](_0x55dfde[_0x369d('0x31')]);_0x102a65[_0x369d('0x3d')]=_['intersection'](_0x102a65['model'],_0x102a65[_0x369d('0x31')]);_0x430040[_0x369d('0x34')]=_[_0x369d('0x33')](_0x102a65['model'],qs[_0x369d('0x35')](_0x55dfde[_0x369d('0x31')][_0x369d('0x35')]));_0x430040[_0x369d('0x34')]=_0x430040[_0x369d('0x34')][_0x369d('0x36')]?_0x430040[_0x369d('0x34')]:_0x102a65[_0x369d('0x30')];if(_0x55dfde[_0x369d('0x31')]['includeAll']){_0x430040[_0x369d('0x46')]=[{'all':!![]}];}_0x430040=_[_0x369d('0x41')]({},_0x430040,_0x55dfde[_0x369d('0x47')]);return db[_0x369d('0x2c')][_0x369d('0x48')](_0x430040)[_0x369d('0x24')](handleEntityNotFound(_0xe7ba64,null))['then'](respondWithResult(_0xe7ba64,null))[_0x369d('0x43')](handleError(_0xe7ba64,null));};exports[_0x369d('0x49')]=function(_0x16dd8f,_0x44a357){return db[_0x369d('0x2c')][_0x369d('0x49')](_0x16dd8f[_0x369d('0x4a')],{})[_0x369d('0x24')](function(_0x3f8a54){var _0x3c15cb=_0x16dd8f[_0x369d('0x4b')][_0x369d('0x4c')]({'plain':!![]});if(!_0x3c15cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c15cb[_0x369d('0x4d')]===_0x369d('0x4b')){var _0x289eb8=_0x3f8a54[_0x369d('0x4c')]({'plain':!![]});var _0x648a0d='Voicemails';return db[_0x369d('0x4e')]['find']({'where':{'name':_0x648a0d,'userProfileId':_0x3c15cb[_0x369d('0x4f')]},'raw':!![]})[_0x369d('0x24')](function(_0x22b594){if(_0x22b594&&_0x22b594[_0x369d('0x50')]===0x0){return db[_0x369d('0x26')][_0x369d('0x49')]({'name':_0x289eb8[_0x369d('0x28')],'resourceId':_0x289eb8['id'],'type':_0x22b594[_0x369d('0x28')],'sectionId':_0x22b594['id']},{})[_0x369d('0x24')](function(){return _0x3f8a54;});}else{return _0x3f8a54;}})[_0x369d('0x43')](function(_0x4d582a){logger['error'](_0x369d('0x51'),_0x4d582a);throw _0x4d582a;});}return _0x3f8a54;})[_0x369d('0x24')](respondWithResult(_0x44a357,0xc9))[_0x369d('0x43')](handleError(_0x44a357,null));};exports[_0x369d('0x52')]=function(_0x347df4,_0x5cd43f){if(_0x347df4['body']['id']){delete _0x347df4[_0x369d('0x4a')]['id'];}return db[_0x369d('0x2c')]['find']({'where':{'id':_0x347df4[_0x369d('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cd43f,null))[_0x369d('0x24')](saveUpdates(_0x347df4[_0x369d('0x4a')],null))[_0x369d('0x24')](respondWithResult(_0x5cd43f,null))['catch'](handleError(_0x5cd43f,null));};exports[_0x369d('0x23')]=function(_0x145ba8,_0x45ac3c){return db[_0x369d('0x2c')]['find']({'where':{'id':_0x145ba8['params']['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x45ac3c,null))[_0x369d('0x24')](removeEntity(_0x45ac3c,null))[_0x369d('0x43')](handleError(_0x45ac3c,null));};exports['getMessages']=function(_0x43afd7,_0x2dbbee,_0x402aae){return db['VoiceMail']['findOne']({'where':{'id':_0x43afd7[_0x369d('0x45')]['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x2dbbee,null))[_0x369d('0x24')](function(_0x158ce7){var _0x5408b3;var _0x33bba6={},_0x1fa6bb={};_0x1fa6bb[_0x369d('0x30')]=_[_0x369d('0x32')](db[_0x369d('0x53')]['rawAttributes']);_0x1fa6bb[_0x369d('0x31')]=_[_0x369d('0x32')](_0x43afd7[_0x369d('0x31')]);_0x1fa6bb['filters']=_[_0x369d('0x33')](_0x1fa6bb['model'],_0x1fa6bb[_0x369d('0x31')]);_0x33bba6['attributes']=_['intersection'](_0x1fa6bb['model'],qs['fields'](_0x43afd7[_0x369d('0x31')]['fields']));_0x33bba6[_0x369d('0x34')]=_0x33bba6['attributes'][_0x369d('0x36')]?_0x33bba6[_0x369d('0x34')]:_0x1fa6bb[_0x369d('0x30')];if(!_0x43afd7['query'][_0x369d('0x37')](_0x369d('0x38'))){_0x33bba6[_0x369d('0x39')]=qs[_0x369d('0x39')](_0x43afd7[_0x369d('0x31')][_0x369d('0x39')]);_0x33bba6['offset']=qs[_0x369d('0x1b')](_0x43afd7['query']['offset']);}_0x33bba6['order']=qs[_0x369d('0x3b')](_0x43afd7[_0x369d('0x31')][_0x369d('0x3b')]);_0x33bba6[_0x369d('0x3c')]=qs[_0x369d('0x3d')](_[_0x369d('0x3e')](_0x43afd7[_0x369d('0x31')],_0x1fa6bb[_0x369d('0x3d')]));if(_0x43afd7[_0x369d('0x31')][_0x369d('0x3f')]){_0x33bba6[_0x369d('0x3c')]=_[_0x369d('0x41')](_0x33bba6[_0x369d('0x3c')],{'$or':_[_0x369d('0x2b')](_0x33bba6[_0x369d('0x34')],function(_0x46f58a){var _0x4fe1b6={};_0x4fe1b6[_0x46f58a]={'$like':'%'+_0x43afd7[_0x369d('0x31')]['filter']+'%'};return _0x4fe1b6;})});}_0x33bba6[_0x369d('0x3c')]=_[_0x369d('0x41')](_0x33bba6[_0x369d('0x3c')],{'mailboxuser':_0x158ce7[_0x369d('0x54')]});_0x33bba6=_[_0x369d('0x41')]({},_0x33bba6,_0x43afd7['options']);return db[_0x369d('0x53')]['findAndCountAll'](_0x33bba6)['then'](respondWithFilteredResult(_0x2dbbee,_0x33bba6));})[_0x369d('0x43')](handleError(_0x2dbbee,null));}; \ No newline at end of file +var _0xe1e3=['set','Content-Range','apply','reject','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','send','VoiceMail','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','body','VoiceMailMessage','nolimit','order','options','findAndCountAll','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','offset','limit','count','status'];(function(_0x1633e9,_0x50a939){var _0x549ace=function(_0x15a157){while(--_0x15a157){_0x1633e9['push'](_0x1633e9['shift']());}};_0x549ace(++_0x50a939);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x24c497,_0x38f74b){_0x24c497=_0x24c497-0x0;var _0x4240d4=_0xe1e3[_0x24c497];return _0x4240d4;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e47b9,_0x536129){_0x536129=_0x536129||0xcc;return function(_0x5c09a2){if(_0x5c09a2){return _0x4e47b9[_0x3e1e('0x14')](_0x536129);}return _0x4e47b9['status'](_0x536129)['end']();};}function respondWithResult(_0x3a9375,_0x8bd4cd){_0x8bd4cd=_0x8bd4cd||0xc8;return function(_0x78ee54){if(_0x78ee54){return _0x3a9375['status'](_0x8bd4cd)['json'](_0x78ee54);}};}function respondWithFilteredResult(_0x4131a1,_0x1b62e6){return function(_0x4dca60){if(_0x4dca60){var _0x26cb35=typeof _0x1b62e6[_0x3e1e('0x15')]==='undefined'&&typeof _0x1b62e6[_0x3e1e('0x16')]==='undefined';var _0x23228c=_0x4dca60[_0x3e1e('0x17')];var _0x1d786c=_0x26cb35?0x0:_0x1b62e6[_0x3e1e('0x15')];var _0x791ed8=_0x26cb35?_0x4dca60[_0x3e1e('0x17')]:_0x1b62e6['offset']+_0x1b62e6['limit'];var _0x4a9497;if(_0x791ed8>=_0x23228c){_0x791ed8=_0x23228c;_0x4a9497=0xc8;}else{_0x4a9497=0xce;}_0x4131a1[_0x3e1e('0x18')](_0x4a9497);return _0x4131a1[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x1d786c+'-'+_0x791ed8+'/'+_0x23228c)['json'](_0x4dca60);}return null;};}function patchUpdates(_0x1c5acd){return function(_0x530815){try{jsonpatch[_0x3e1e('0x1b')](_0x530815,_0x1c5acd,!![]);}catch(_0x33ec1d){return BPromise[_0x3e1e('0x1c')](_0x33ec1d);}return _0x530815['save']();};}function saveUpdates(_0x53e051,_0x96396){return function(_0xefa098){if(_0xefa098){return _0xefa098['update'](_0x53e051)['then'](function(_0x13d7ac){return _0x13d7ac;});}return null;};}function removeEntity(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(_0x60e6bc){return _0x60e6bc[_0x3e1e('0x1d')]()[_0x3e1e('0x1e')](function(){var _0x33bf0f=_0x60e6bc[_0x3e1e('0x1f')]({'plain':!![]});var _0x159212=_0x3e1e('0x20');return db[_0x3e1e('0x21')]['destroy']({'where':{'type':_0x159212,'resourceId':_0x33bf0f['id']}})['then'](function(){return _0x60e6bc;});})[_0x3e1e('0x1e')](function(){_0x1b5097[_0x3e1e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be84e,_0x56b9a8){return function(_0x1a33bb){if(!_0x1a33bb){_0x4be84e[_0x3e1e('0x14')](0x194);}return _0x1a33bb;};}function handleError(_0x5b1bd1,_0x52f966){_0x52f966=_0x52f966||0x1f4;return function(_0x5ac814){logger[_0x3e1e('0x22')](_0x5ac814[_0x3e1e('0x23')]);if(_0x5ac814['name']){delete _0x5ac814[_0x3e1e('0x24')];}_0x5b1bd1[_0x3e1e('0x18')](_0x52f966)[_0x3e1e('0x25')](_0x5ac814);};}exports['index']=function(_0xdef39,_0x4ec149){var _0x591c36={},_0x494c75={},_0x39da8d={'count':0x0,'rows':[]};var _0x5b8f95=_['map'](db[_0x3e1e('0x26')][_0x3e1e('0x27')],function(_0x1c57c2){return{'name':_0x1c57c2[_0x3e1e('0x28')],'type':_0x1c57c2[_0x3e1e('0x29')]['key']};});_0x494c75['model']=_['map'](_0x5b8f95,'name');_0x494c75[_0x3e1e('0x2a')]=_[_0x3e1e('0x2b')](_0xdef39[_0x3e1e('0x2a')]);_0x494c75[_0x3e1e('0x2c')]=_[_0x3e1e('0x2d')](_0x494c75[_0x3e1e('0x2e')],_0x494c75[_0x3e1e('0x2a')]);_0x591c36[_0x3e1e('0x2f')]=_['intersection'](_0x494c75[_0x3e1e('0x2e')],qs[_0x3e1e('0x30')](_0xdef39['query'][_0x3e1e('0x30')]));_0x591c36[_0x3e1e('0x2f')]=_0x591c36[_0x3e1e('0x2f')][_0x3e1e('0x31')]?_0x591c36['attributes']:_0x494c75['model'];if(!_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x32')]('nolimit')){_0x591c36[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0xdef39['query'][_0x3e1e('0x16')]);_0x591c36[_0x3e1e('0x15')]=qs[_0x3e1e('0x15')](_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x15')]);}_0x591c36['order']=qs[_0x3e1e('0x33')](_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x33')]);_0x591c36[_0x3e1e('0x34')]=qs['filters'](_[_0x3e1e('0x35')](_0xdef39[_0x3e1e('0x2a')],_0x494c75[_0x3e1e('0x2c')]),_0x5b8f95);if(_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x36')]){_0x591c36[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x591c36['where'],{'$or':_[_0x3e1e('0x38')](_0x5b8f95,function(_0x4fdd7c){if(_0x4fdd7c['type']!==_0x3e1e('0x39')){var _0x469a42={};_0x469a42[_0x4fdd7c[_0x3e1e('0x24')]]={'$like':'%'+_0xdef39['query'][_0x3e1e('0x36')]+'%'};return _0x469a42;}})});}_0x591c36=_[_0x3e1e('0x37')]({},_0x591c36,_0xdef39['options']);var _0x16d03f={'where':_0x591c36[_0x3e1e('0x34')]};return db['VoiceMail']['count'](_0x16d03f)[_0x3e1e('0x1e')](function(_0x49e4cb){_0x39da8d['count']=_0x49e4cb;if(_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x3a')]){_0x591c36[_0x3e1e('0x3b')]=[{'all':!![]}];}return db[_0x3e1e('0x26')][_0x3e1e('0x3c')](_0x591c36);})['then'](function(_0x5b32ad){_0x39da8d[_0x3e1e('0x3d')]=_0x5b32ad;return _0x39da8d;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0x4ec149,_0x591c36))[_0x3e1e('0x3e')](handleError(_0x4ec149,null));};exports['show']=function(_0x1124d0,_0x2dcce1){var _0xabe865={'raw':!![],'where':{'id':_0x1124d0[_0x3e1e('0x3f')]['id']}},_0x4ad5fd={};_0x4ad5fd['model']=_['keys'](db[_0x3e1e('0x26')][_0x3e1e('0x27')]);_0x4ad5fd[_0x3e1e('0x2a')]=_[_0x3e1e('0x2b')](_0x1124d0['query']);_0x4ad5fd['filters']=_['intersection'](_0x4ad5fd['model'],_0x4ad5fd[_0x3e1e('0x2a')]);_0xabe865[_0x3e1e('0x2f')]=_['intersection'](_0x4ad5fd['model'],qs[_0x3e1e('0x30')](_0x1124d0[_0x3e1e('0x2a')][_0x3e1e('0x30')]));_0xabe865['attributes']=_0xabe865[_0x3e1e('0x2f')]['length']?_0xabe865[_0x3e1e('0x2f')]:_0x4ad5fd[_0x3e1e('0x2e')];if(_0x1124d0[_0x3e1e('0x2a')][_0x3e1e('0x3a')]){_0xabe865[_0x3e1e('0x3b')]=[{'all':!![]}];}_0xabe865=_[_0x3e1e('0x37')]({},_0xabe865,_0x1124d0['options']);return db[_0x3e1e('0x26')][_0x3e1e('0x40')](_0xabe865)['then'](handleEntityNotFound(_0x2dcce1,null))[_0x3e1e('0x1e')](respondWithResult(_0x2dcce1,null))[_0x3e1e('0x3e')](handleError(_0x2dcce1,null));};exports['create']=function(_0x1cc820,_0x347b3f){return db[_0x3e1e('0x26')][_0x3e1e('0x41')](_0x1cc820['body'],{})[_0x3e1e('0x1e')](function(_0x3d7303){var _0x29d23b=_0x1cc820[_0x3e1e('0x42')]['get']({'plain':!![]});if(!_0x29d23b)throw new Error(_0x3e1e('0x43'));if(_0x29d23b[_0x3e1e('0x44')]===_0x3e1e('0x42')){var _0x25ddf7=_0x3d7303[_0x3e1e('0x1f')]({'plain':!![]});var _0x1df5a8=_0x3e1e('0x20');return db[_0x3e1e('0x45')]['find']({'where':{'name':_0x1df5a8,'userProfileId':_0x29d23b[_0x3e1e('0x46')]},'raw':!![]})['then'](function(_0x5b0d0d){if(_0x5b0d0d&&_0x5b0d0d['autoAssociation']===0x0){return db[_0x3e1e('0x21')][_0x3e1e('0x41')]({'name':_0x25ddf7['name'],'resourceId':_0x25ddf7['id'],'type':_0x5b0d0d[_0x3e1e('0x24')],'sectionId':_0x5b0d0d['id']},{})['then'](function(){return _0x3d7303;});}else{return _0x3d7303;}})['catch'](function(_0x3eaf76){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3eaf76);throw _0x3eaf76;});}return _0x3d7303;})['then'](respondWithResult(_0x347b3f,0xc9))[_0x3e1e('0x3e')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x47')]=function(_0x1334c8,_0x162a51){if(_0x1334c8[_0x3e1e('0x48')]['id']){delete _0x1334c8[_0x3e1e('0x48')]['id'];}return db[_0x3e1e('0x26')]['find']({'where':{'id':_0x1334c8[_0x3e1e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x162a51,null))[_0x3e1e('0x1e')](saveUpdates(_0x1334c8[_0x3e1e('0x48')],null))[_0x3e1e('0x1e')](respondWithResult(_0x162a51,null))['catch'](handleError(_0x162a51,null));};exports['destroy']=function(_0xba8d16,_0xb1456e){return db['VoiceMail'][_0x3e1e('0x40')]({'where':{'id':_0xba8d16['params']['id']}})['then'](handleEntityNotFound(_0xb1456e,null))[_0x3e1e('0x1e')](removeEntity(_0xb1456e,null))[_0x3e1e('0x3e')](handleError(_0xb1456e,null));};exports['getMessages']=function(_0x17bc26,_0x551f12,_0x553451){return db[_0x3e1e('0x26')]['findOne']({'where':{'id':_0x17bc26[_0x3e1e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x551f12,null))[_0x3e1e('0x1e')](function(_0x57d845){var _0x7ea199;var _0x8a4987={},_0x48be40={};_0x48be40['model']=_['keys'](db[_0x3e1e('0x49')][_0x3e1e('0x27')]);_0x48be40[_0x3e1e('0x2a')]=_['keys'](_0x17bc26[_0x3e1e('0x2a')]);_0x48be40[_0x3e1e('0x2c')]=_[_0x3e1e('0x2d')](_0x48be40['model'],_0x48be40['query']);_0x8a4987[_0x3e1e('0x2f')]=_['intersection'](_0x48be40[_0x3e1e('0x2e')],qs[_0x3e1e('0x30')](_0x17bc26[_0x3e1e('0x2a')]['fields']));_0x8a4987[_0x3e1e('0x2f')]=_0x8a4987['attributes'][_0x3e1e('0x31')]?_0x8a4987[_0x3e1e('0x2f')]:_0x48be40['model'];if(!_0x17bc26[_0x3e1e('0x2a')]['hasOwnProperty'](_0x3e1e('0x4a'))){_0x8a4987['limit']=qs[_0x3e1e('0x16')](_0x17bc26['query'][_0x3e1e('0x16')]);_0x8a4987[_0x3e1e('0x15')]=qs[_0x3e1e('0x15')](_0x17bc26['query'][_0x3e1e('0x15')]);}_0x8a4987[_0x3e1e('0x4b')]=qs['sort'](_0x17bc26[_0x3e1e('0x2a')]['sort']);_0x8a4987['where']=qs['filters'](_[_0x3e1e('0x35')](_0x17bc26[_0x3e1e('0x2a')],_0x48be40[_0x3e1e('0x2c')]));if(_0x17bc26[_0x3e1e('0x2a')][_0x3e1e('0x36')]){_0x8a4987[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x8a4987['where'],{'$or':_[_0x3e1e('0x38')](_0x8a4987[_0x3e1e('0x2f')],function(_0x4634c0){var _0x2a9c84={};_0x2a9c84[_0x4634c0]={'$like':'%'+_0x17bc26[_0x3e1e('0x2a')][_0x3e1e('0x36')]+'%'};return _0x2a9c84;})});}_0x8a4987[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x8a4987['where'],{'mailboxuser':_0x57d845['mailbox']});_0x8a4987=_[_0x3e1e('0x37')]({},_0x8a4987,_0x17bc26[_0x3e1e('0x4c')]);return db[_0x3e1e('0x49')][_0x3e1e('0x4d')](_0x8a4987)[_0x3e1e('0x1e')](respondWithFilteredResult(_0x551f12,_0x8a4987));})[_0x3e1e('0x3e')](handleError(_0x551f12,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 0242d38..7057abe 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 _0xbe57=['../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0x552fcb,_0x533085){var _0x5d6231=function(_0x2de4fa){while(--_0x2de4fa){_0x552fcb['push'](_0x552fcb['shift']());}};_0x5d6231(++_0x533085);}(_0xbe57,0x166));var _0x7be5=function(_0x4db8be,_0x155ce5){_0x4db8be=_0x4db8be-0x0;var _0x4c90d8=_0xbe57[_0x4db8be];return _0x4c90d8;};'use strict';var _=require(_0x7be5('0x0'));var util=require('util');var logger=require(_0x7be5('0x1'))(_0x7be5('0x2'));var moment=require(_0x7be5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7be5('0x4'));var rimraf=require(_0x7be5('0x5'));var config=require(_0x7be5('0x6'));var attributes=require(_0x7be5('0x7'));module[_0x7be5('0x8')]=function(_0x24ce81,_0x516325){return _0x24ce81['define'](_0x7be5('0x9'),attributes,{'tableName':_0x7be5('0xa'),'paranoid':![],'indexes':[{'name':_0x7be5('0xb'),'fields':[_0x7be5('0xc'),_0x7be5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e5d=['util','api','moment','bluebird','request-promise','path','rimraf','define','VoiceMail','mailbox_context','context'];(function(_0x239dd5,_0x2cb9dc){var _0x2cf354=function(_0x4877cc){while(--_0x4877cc){_0x239dd5['push'](_0x239dd5['shift']());}};_0x2cf354(++_0x2cb9dc);}(_0x4e5d,0xb0));var _0xd4e5=function(_0x1fec86,_0x422ed7){_0x1fec86=_0x1fec86-0x0;var _0x55e897=_0x4e5d[_0x1fec86];return _0x55e897;};'use strict';var _=require('lodash');var util=require(_0xd4e5('0x0'));var logger=require('../../config/logger')(_0xd4e5('0x1'));var moment=require(_0xd4e5('0x2'));var BPromise=require(_0xd4e5('0x3'));var rp=require(_0xd4e5('0x4'));var fs=require('fs');var path=require(_0xd4e5('0x5'));var rimraf=require(_0xd4e5('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module['exports']=function(_0x22caae,_0x4e2967){return _0x22caae[_0xd4e5('0x7')](_0xd4e5('0x8'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xd4e5('0x9'),'fields':['mailbox',_0xd4e5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 21a1d5e..63d144a 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 _0x6ada=['rpc','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x1cd8cc,_0x1a2bfc){var _0x457cf4=function(_0x485410){while(--_0x485410){_0x1cd8cc['push'](_0x1cd8cc['shift']());}};_0x457cf4(++_0x1a2bfc);}(_0x6ada,0xf7));var _0xa6ad=function(_0x7bf9c2,_0xd621e3){_0x7bf9c2=_0x7bf9c2-0x0;var _0x5cf637=_0x6ada[_0x7bf9c2];return _0x5cf637;};'use strict';var _=require(_0xa6ad('0x0'));var util=require('util');var moment=require(_0xa6ad('0x1'));var BPromise=require(_0xa6ad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6ad('0x3'))['db'];var utils=require(_0xa6ad('0x4'));var logger=require('../../config/logger')(_0xa6ad('0x5'));var config=require('../../config/environment');var jayson=require(_0xa6ad('0x6'));var client=jayson[_0xa6ad('0x7')][_0xa6ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ece82,_0x46632e,_0x464bd5){return new BPromise(function(_0x3e9773,_0x2a1843){return client[_0xa6ad('0x9')](_0x4ece82,_0x464bd5)['then'](function(_0x223c8c){logger[_0xa6ad('0xa')]('VoiceMail,\x20%s,\x20%s',_0x46632e,_0xa6ad('0xb'));logger[_0xa6ad('0xc')](_0xa6ad('0xd'),_0x46632e,_0xa6ad('0xb'),JSON[_0xa6ad('0xe')](_0x223c8c));if(_0x223c8c[_0xa6ad('0xf')]){if(_0x223c8c[_0xa6ad('0xf')][_0xa6ad('0x10')]===0x1f4){logger[_0xa6ad('0xf')](_0xa6ad('0x11'),_0x46632e,_0x223c8c[_0xa6ad('0xf')][_0xa6ad('0x12')]);return _0x2a1843(_0x223c8c[_0xa6ad('0xf')][_0xa6ad('0x12')]);}logger['error'](_0xa6ad('0x11'),_0x46632e,_0x223c8c[_0xa6ad('0xf')][_0xa6ad('0x12')]);return _0x3e9773(_0x223c8c['error'][_0xa6ad('0x12')]);}else{logger[_0xa6ad('0xa')]('VoiceMail,\x20%s,\x20%s',_0x46632e,'request\x20sent');_0x3e9773(_0x223c8c[_0xa6ad('0x13')]['message']);}})[_0xa6ad('0x14')](function(_0x1eb7d1){logger[_0xa6ad('0xf')](_0xa6ad('0x11'),_0x46632e,_0x1eb7d1);_0x2a1843(_0x1eb7d1);});});} \ No newline at end of file +var _0xd056=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4911ab,_0x4dcb06){var _0x441554=function(_0x35f205){while(--_0x35f205){_0x4911ab['push'](_0x4911ab['shift']());}};_0x441554(++_0x4dcb06);}(_0xd056,0xf9));var _0x6d05=function(_0x4120bc,_0x3e6c48){_0x4120bc=_0x4120bc-0x0;var _0x5e4091=_0xd056[_0x4120bc];return _0x5e4091;};'use strict';var _=require(_0x6d05('0x0'));var util=require(_0x6d05('0x1'));var moment=require(_0x6d05('0x2'));var BPromise=require(_0x6d05('0x3'));var rs=require(_0x6d05('0x4'));var fs=require('fs');var Redis=require(_0x6d05('0x5'));var db=require(_0x6d05('0x6'))['db'];var utils=require(_0x6d05('0x7'));var logger=require(_0x6d05('0x8'))('rpc');var config=require(_0x6d05('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6d05('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25dbed,_0x132e10,_0x235c2c){return new BPromise(function(_0x3a35c9,_0x2544f8){return client['request'](_0x25dbed,_0x235c2c)['then'](function(_0x91afbe){logger[_0x6d05('0xb')](_0x6d05('0xc'),_0x132e10,_0x6d05('0xd'));logger[_0x6d05('0xe')](_0x6d05('0xf'),_0x132e10,_0x6d05('0xd'),JSON[_0x6d05('0x10')](_0x91afbe));if(_0x91afbe[_0x6d05('0x11')]){if(_0x91afbe[_0x6d05('0x11')][_0x6d05('0x12')]===0x1f4){logger[_0x6d05('0x11')](_0x6d05('0xc'),_0x132e10,_0x91afbe[_0x6d05('0x11')][_0x6d05('0x13')]);return _0x2544f8(_0x91afbe[_0x6d05('0x11')][_0x6d05('0x13')]);}logger[_0x6d05('0x11')](_0x6d05('0xc'),_0x132e10,_0x91afbe[_0x6d05('0x11')][_0x6d05('0x13')]);return _0x3a35c9(_0x91afbe[_0x6d05('0x11')]['message']);}else{logger['info'](_0x6d05('0xc'),_0x132e10,_0x6d05('0xd'));_0x3a35c9(_0x91afbe['result'][_0x6d05('0x13')]);}})[_0x6d05('0x14')](function(_0x55755e){logger['error'](_0x6d05('0xc'),_0x132e10,_0x55755e);_0x2544f8(_0x55755e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 982e37f..4f55a2b 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 _0x7fe6=['put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id/download','download','create'];(function(_0x389bd9,_0x7f1b0d){var _0x1d811e=function(_0x1bea09){while(--_0x1bea09){_0x389bd9['push'](_0x389bd9['shift']());}};_0x1d811e(++_0x7f1b0d);}(_0x7fe6,0x16e));var _0x67fe=function(_0x2632b7,_0x41bffc){_0x2632b7=_0x2632b7-0x0;var _0x553ed9=_0x7fe6[_0x2632b7];return _0x553ed9;};'use strict';var multer=require('multer');var util=require(_0x67fe('0x0'));var path=require(_0x67fe('0x1'));var timeout=require(_0x67fe('0x2'));var express=require(_0x67fe('0x3'));var router=express[_0x67fe('0x4')]();var fs_extra=require(_0x67fe('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x67fe('0x6'));var config=require(_0x67fe('0x7'));var controller=require(_0x67fe('0x8'));router[_0x67fe('0x9')]('/',auth[_0x67fe('0xa')](),controller['index']);router[_0x67fe('0x9')]('/:id',auth[_0x67fe('0xa')](),controller['show']);router['get'](_0x67fe('0xb'),auth[_0x67fe('0xa')](),controller[_0x67fe('0xc')]);router['post']('/',auth[_0x67fe('0xa')](),controller[_0x67fe('0xd')]);router[_0x67fe('0xe')](_0x67fe('0xf'),auth[_0x67fe('0xa')](),controller[_0x67fe('0x10')]);router[_0x67fe('0x11')](_0x67fe('0xf'),auth[_0x67fe('0xa')](),controller[_0x67fe('0x12')]);module[_0x67fe('0x13')]=router; \ No newline at end of file +var _0x3df3=['update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x3df3,0xea));var _0x33df=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x3df3[_0x59eefb];return _0x1a49e8;};'use strict';var multer=require(_0x33df('0x0'));var util=require(_0x33df('0x1'));var path=require(_0x33df('0x2'));var timeout=require(_0x33df('0x3'));var express=require('express');var router=express[_0x33df('0x4')]();var fs_extra=require(_0x33df('0x5'));var auth=require(_0x33df('0x6'));var interaction=require(_0x33df('0x7'));var config=require(_0x33df('0x8'));var controller=require('./voiceMailMessage.controller');router[_0x33df('0x9')]('/',auth[_0x33df('0xa')](),controller['index']);router[_0x33df('0x9')](_0x33df('0xb'),auth[_0x33df('0xa')](),controller[_0x33df('0xc')]);router[_0x33df('0x9')](_0x33df('0xd'),auth[_0x33df('0xa')](),controller[_0x33df('0xe')]);router[_0x33df('0xf')]('/',auth['isAuthenticated'](),controller[_0x33df('0x10')]);router[_0x33df('0x11')](_0x33df('0xb'),auth[_0x33df('0xa')](),controller[_0x33df('0x12')]);router[_0x33df('0x13')](_0x33df('0xb'),auth[_0x33df('0xa')](),controller[_0x33df('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 2e7b2b8..78a6225 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 _0x646e=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','getDataValue','INTEGER','STRING'];(function(_0x5e6796,_0x16cf18){var _0x2e44e1=function(_0x420a91){while(--_0x420a91){_0x5e6796['push'](_0x5e6796['shift']());}};_0x2e44e1(++_0x16cf18);}(_0x646e,0xe3));var _0xe646=function(_0x487b1f,_0x2dac5a){_0x487b1f=_0x487b1f-0x0;var _0x3de30c=_0x646e[_0x487b1f];return _0x3de30c;};'use strict';var Sequelize=require(_0xe646('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x429c51){return this[_0xe646('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xe646('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xe646('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xe646('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xe646('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xe646('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xe646('0x3')],'defaultValue':''},'stamp':{'type':_0xe646('0x4'),'defaultValue':Sequelize[_0xe646('0x5')](_0xe646('0x6'))}}; \ No newline at end of file +var _0xd8b3=['BLOB','long','TIMESTAMP','literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x55ddbb,_0x5ddaed){var _0x24c69b=function(_0xa29ae8){while(--_0xa29ae8){_0x55ddbb['push'](_0x55ddbb['shift']());}};_0x24c69b(++_0x5ddaed);}(_0xd8b3,0x68));var _0x3d8b=function(_0x1e03e4,_0x362f76){_0x1e03e4=_0x1e03e4-0x0;var _0x4a887e=_0xd8b3[_0x1e03e4];return _0x4a887e;};'use strict';var Sequelize=require(_0x3d8b('0x0'));module[_0x3d8b('0x1')]={'name':{'type':Sequelize[_0x3d8b('0x2')],'get':function(_0x59f483){return this[_0x3d8b('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x3d8b('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x3d8b('0x6')](_0x3d8b('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x3d8b('0x8'),'defaultValue':Sequelize[_0x3d8b('0x9')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 910673d..45bb71e 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 _0x530f=['send','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','update','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22'];(function(_0xa918fa,_0x23b0dd){var _0x642ab2=function(_0xd27049){while(--_0xd27049){_0xa918fa['push'](_0xa918fa['shift']());}};_0x642ab2(++_0x23b0dd);}(_0x530f,0x10c));var _0xf530=function(_0x2c21fa,_0x5f0a10){_0x2c21fa=_0x2c21fa-0x0;var _0x5aafc6=_0x530f[_0x2c21fa];return _0x5aafc6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf530('0x0'));var zipdir=require(_0xf530('0x1'));var jsonpatch=require(_0xf530('0x2'));var rp=require(_0xf530('0x3'));var moment=require(_0xf530('0x4'));var BPromise=require(_0xf530('0x5'));var Mustache=require('mustache');var util=require(_0xf530('0x6'));var path=require('path');var sox=require(_0xf530('0x7'));var csv=require(_0xf530('0x8'));var ejs=require(_0xf530('0x9'));var fs=require('fs');var fs_extra=require(_0xf530('0xa'));var _=require(_0xf530('0xb'));var squel=require(_0xf530('0xc'));var crypto=require(_0xf530('0xd'));var jsforce=require(_0xf530('0xe'));var deskjs=require(_0xf530('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf530('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf530('0x11'));var qs=require(_0xf530('0x12'));var as=require(_0xf530('0x13'));var hardwareService=require(_0xf530('0x14'));var logger=require(_0xf530('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf530('0x16'));var licenseUtil=require(_0xf530('0x17'));var db=require(_0xf530('0x18'))['db'];function respondWithStatusCode(_0x386bda,_0x5abb78){_0x5abb78=_0x5abb78||0xcc;return function(_0x126c28){if(_0x126c28){return _0x386bda[_0xf530('0x19')](_0x5abb78);}return _0x386bda['status'](_0x5abb78)[_0xf530('0x1a')]();};}function respondWithResult(_0xd91e6b,_0x3363d2){_0x3363d2=_0x3363d2||0xc8;return function(_0x53dad2){if(_0x53dad2){return _0xd91e6b[_0xf530('0x1b')](_0x3363d2)[_0xf530('0x1c')](_0x53dad2);}};}function respondWithFilteredResult(_0x58ae24,_0xabb1be){return function(_0x52c1a4){if(_0x52c1a4){var _0x439dde=typeof _0xabb1be[_0xf530('0x1d')]===_0xf530('0x1e')&&typeof _0xabb1be['limit']===_0xf530('0x1e');var _0x230242=_0x52c1a4['count'];var _0x2b03aa=_0x439dde?0x0:_0xabb1be[_0xf530('0x1d')];var _0x156f54=_0x439dde?_0x52c1a4[_0xf530('0x1f')]:_0xabb1be[_0xf530('0x1d')]+_0xabb1be[_0xf530('0x20')];var _0xcdb883;if(_0x156f54>=_0x230242){_0x156f54=_0x230242;_0xcdb883=0xc8;}else{_0xcdb883=0xce;}_0x58ae24[_0xf530('0x1b')](_0xcdb883);return _0x58ae24[_0xf530('0x21')](_0xf530('0x22'),_0x2b03aa+'-'+_0x156f54+'/'+_0x230242)['json'](_0x52c1a4);}return null;};}function patchUpdates(_0xec89e6){return function(_0x3da70d){try{jsonpatch[_0xf530('0x23')](_0x3da70d,_0xec89e6,!![]);}catch(_0x452db1){return BPromise[_0xf530('0x24')](_0x452db1);}return _0x3da70d[_0xf530('0x25')]();};}function saveUpdates(_0x5145d8,_0xe10839){return function(_0x14acc6){if(_0x14acc6){return _0x14acc6['update'](_0x5145d8)[_0xf530('0x26')](function(_0x22afbe){return _0x22afbe;});}return null;};}function removeEntity(_0x29b4b0,_0x242de4){return function(_0x2dcc2d){if(_0x2dcc2d){return _0x2dcc2d[_0xf530('0x27')]()[_0xf530('0x26')](function(){_0x29b4b0[_0xf530('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23233c,_0x389d7f){return function(_0x3af938){if(!_0x3af938){_0x23233c['sendStatus'](0x194);}return _0x3af938;};}function handleError(_0x548dbf,_0x1fb658){_0x1fb658=_0x1fb658||0x1f4;return function(_0x4b917a){logger['error'](_0x4b917a[_0xf530('0x28')]);if(_0x4b917a[_0xf530('0x29')]){delete _0x4b917a[_0xf530('0x29')];}_0x548dbf['status'](_0x1fb658)['send'](_0x4b917a);};}exports[_0xf530('0x2a')]=function(_0x3e5af7,_0x592abf){var _0x2aef99={},_0x2d3591={},_0x24d596={'count':0x0,'rows':[]};var _0x2d65cd=_[_0xf530('0x2b')](db[_0xf530('0x2c')][_0xf530('0x2d')],function(_0xc198a3){return{'name':_0xc198a3['fieldName'],'type':_0xc198a3[_0xf530('0x2e')][_0xf530('0x2f')]};});_0x2d3591[_0xf530('0x30')]=_[_0xf530('0x31')](_[_0xf530('0x2b')](_0x2d65cd,_0xf530('0x29')),[_0xf530('0x29')]);_0x2d3591['query']=_[_0xf530('0x32')](_0x3e5af7[_0xf530('0x33')]);_0x2d3591[_0xf530('0x34')]=_[_0xf530('0x35')](_0x2d3591['model'],_0x2d3591[_0xf530('0x33')]);_0x2aef99[_0xf530('0x36')]=_['intersection'](_0x2d3591['model'],qs[_0xf530('0x37')](_0x3e5af7[_0xf530('0x33')][_0xf530('0x37')]));_0x2aef99[_0xf530('0x36')]=_0x2aef99['attributes'][_0xf530('0x38')]?_0x2aef99[_0xf530('0x36')]:_0x2d3591[_0xf530('0x30')];if(!_0x3e5af7[_0xf530('0x33')][_0xf530('0x39')](_0xf530('0x3a'))){_0x2aef99['limit']=qs[_0xf530('0x20')](_0x3e5af7[_0xf530('0x33')]['limit']);_0x2aef99['offset']=qs[_0xf530('0x1d')](_0x3e5af7['query'][_0xf530('0x1d')]);}_0x2aef99[_0xf530('0x3b')]=qs[_0xf530('0x3c')](_0x3e5af7[_0xf530('0x33')][_0xf530('0x3c')]);_0x2aef99[_0xf530('0x3d')]=qs['filters'](_[_0xf530('0x3e')](_0x3e5af7[_0xf530('0x33')],_0x2d3591[_0xf530('0x34')]),_0x2d65cd);if(_0x3e5af7[_0xf530('0x33')]['filter']){_0x2aef99[_0xf530('0x3d')]=_['merge'](_0x2aef99[_0xf530('0x3d')],{'$or':_[_0xf530('0x2b')](_0x2d65cd,function(_0xb5061a){if(_0xb5061a['type']!==_0xf530('0x3f')){var _0x14c264={};_0x14c264[_0xb5061a[_0xf530('0x29')]]={'$like':'%'+_0x3e5af7[_0xf530('0x33')][_0xf530('0x40')]+'%'};return _0x14c264;}})});}_0x2aef99=_[_0xf530('0x41')]({},_0x2aef99,_0x3e5af7[_0xf530('0x42')]);var _0x430410={'where':_0x2aef99[_0xf530('0x3d')]};return db[_0xf530('0x2c')][_0xf530('0x1f')](_0x430410)[_0xf530('0x26')](function(_0x26bc15){_0x24d596[_0xf530('0x1f')]=_0x26bc15;if(_0x3e5af7[_0xf530('0x33')][_0xf530('0x43')]){_0x2aef99['include']=[{'all':!![]}];}return db[_0xf530('0x2c')][_0xf530('0x44')](_0x2aef99);})[_0xf530('0x26')](function(_0x47865b){_0x24d596[_0xf530('0x45')]=_0x47865b;return _0x24d596;})[_0xf530('0x26')](respondWithFilteredResult(_0x592abf,_0x2aef99))['catch'](handleError(_0x592abf,null));};exports[_0xf530('0x46')]=function(_0x149b6f,_0x456b25){var _0x3c6a66={'raw':!![],'where':{'id':_0x149b6f[_0xf530('0x47')]['id']}},_0x57bd9b={};_0x57bd9b['model']=_['keys'](db[_0xf530('0x2c')][_0xf530('0x2d')]);_0x57bd9b[_0xf530('0x33')]=_['keys'](_0x149b6f[_0xf530('0x33')]);_0x57bd9b['filters']=_[_0xf530('0x35')](_0x57bd9b[_0xf530('0x30')],_0x57bd9b[_0xf530('0x33')]);_0x3c6a66[_0xf530('0x36')]=_['intersection'](_0x57bd9b[_0xf530('0x30')],qs[_0xf530('0x37')](_0x149b6f[_0xf530('0x33')][_0xf530('0x37')]));_0x3c6a66['attributes']=_0x3c6a66[_0xf530('0x36')]['length']?_0x3c6a66[_0xf530('0x36')]:_0x57bd9b[_0xf530('0x30')];if(_0x149b6f[_0xf530('0x33')][_0xf530('0x43')]){_0x3c6a66[_0xf530('0x48')]=[{'all':!![]}];}_0x3c6a66=_[_0xf530('0x41')]({},_0x3c6a66,_0x149b6f['options']);return db[_0xf530('0x2c')][_0xf530('0x49')](_0x3c6a66)[_0xf530('0x26')](handleEntityNotFound(_0x456b25,null))[_0xf530('0x26')](respondWithResult(_0x456b25,null))[_0xf530('0x4a')](handleError(_0x456b25,null));};exports['create']=function(_0x1c6ab9,_0x151c53){return db[_0xf530('0x2c')][_0xf530('0x4b')](_0x1c6ab9[_0xf530('0x4c')],{})[_0xf530('0x26')](respondWithResult(_0x151c53,0xc9))['catch'](handleError(_0x151c53,null));};exports[_0xf530('0x4d')]=function(_0x44f53a,_0x4533cc){if(_0x44f53a['body']['id']){delete _0x44f53a[_0xf530('0x4c')]['id'];}return db[_0xf530('0x2c')]['find']({'where':{'id':_0x44f53a[_0xf530('0x47')]['id']}})[_0xf530('0x26')](handleEntityNotFound(_0x4533cc,null))[_0xf530('0x26')](saveUpdates(_0x44f53a[_0xf530('0x4c')],null))[_0xf530('0x26')](respondWithResult(_0x4533cc,null))[_0xf530('0x4a')](handleError(_0x4533cc,null));};exports[_0xf530('0x27')]=function(_0x39e229,_0x1dc7cc){return db['VoiceMailMessage'][_0xf530('0x49')]({'where':{'id':_0x39e229[_0xf530('0x47')]['id']}})[_0xf530('0x26')](handleEntityNotFound(_0x1dc7cc,null))['then'](removeEntity(_0x1dc7cc,null))[_0xf530('0x4a')](handleError(_0x1dc7cc,null));};exports[_0xf530('0x4e')]=function(_0x5e78c8,_0x439624,_0x27f21b){return db[_0xf530('0x2c')][_0xf530('0x49')]({'where':{'id':_0x5e78c8[_0xf530('0x47')]['id']},'attributes':['id',_0xf530('0x4f'),'msg_id']})['then'](handleEntityNotFound(_0x439624,null))[_0xf530('0x26')](function(_0x2234f8){if(_0x2234f8){if(!_0x2234f8[_0xf530('0x4f')]){throw new db[(_0xf530('0x50'))][(_0xf530('0x51'))](_0xf530('0x52'));}var _0x285315={'Content-Type':'audio/wav','Content-Disposition':_0xf530('0x53')};if(_0x2234f8[_0xf530('0x54')]){_0x285315[_0xf530('0x55')]=_0xf530('0x56')+_0x2234f8[_0xf530('0x54')]+_0xf530('0x57');}_0x439624[_0xf530('0x21')](_0x285315);return _0x439624[_0xf530('0x58')](new Buffer(_0x2234f8[_0xf530('0x4f')]));}})[_0xf530('0x4a')](handleError(_0x439624,null));}; \ No newline at end of file +var _0x759b=['create','body','download','recording','VoiceMailMessage\x20not\x20found','msg_id','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','json','save','update','then','destroy','name','send','map','VoiceMailMessage','fieldName','key','differenceBy','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find'];(function(_0x220b08,_0x584bc5){var _0x549f9f=function(_0x5acb00){while(--_0x5acb00){_0x220b08['push'](_0x220b08['shift']());}};_0x549f9f(++_0x584bc5);}(_0x759b,0x130));var _0xb759=function(_0x2a7544,_0x47e6d1){_0x2a7544=_0x2a7544-0x0;var _0xdaac83=_0x759b[_0x2a7544];return _0xdaac83;};'use strict';var emlformat=require(_0xb759('0x0'));var rimraf=require(_0xb759('0x1'));var zipdir=require(_0xb759('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb759('0x3'));var moment=require(_0xb759('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb759('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb759('0x6'));var ejs=require(_0xb759('0x7'));var fs=require('fs');var fs_extra=require(_0xb759('0x8'));var _=require(_0xb759('0x9'));var squel=require(_0xb759('0xa'));var crypto=require(_0xb759('0xb'));var jsforce=require(_0xb759('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb759('0x6'));var querystring=require(_0xb759('0xd'));var Papa=require('papaparse');var Redis=require(_0xb759('0xe'));var authService=require(_0xb759('0xf'));var qs=require(_0xb759('0x10'));var as=require(_0xb759('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb759('0x12'))(_0xb759('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb759('0x14'));var db=require(_0xb759('0x15'))['db'];function respondWithStatusCode(_0x3d6d00,_0x590dc1){_0x590dc1=_0x590dc1||0xcc;return function(_0x479c58){if(_0x479c58){return _0x3d6d00[_0xb759('0x16')](_0x590dc1);}return _0x3d6d00['status'](_0x590dc1)[_0xb759('0x17')]();};}function respondWithResult(_0x11b466,_0x49b3a6){_0x49b3a6=_0x49b3a6||0xc8;return function(_0x25102f){if(_0x25102f){return _0x11b466['status'](_0x49b3a6)['json'](_0x25102f);}};}function respondWithFilteredResult(_0x4bc813,_0x58f557){return function(_0x13476d){if(_0x13476d){var _0x89eca=typeof _0x58f557[_0xb759('0x18')]===_0xb759('0x19')&&typeof _0x58f557[_0xb759('0x1a')]===_0xb759('0x19');var _0x5bc105=_0x13476d[_0xb759('0x1b')];var _0x282726=_0x89eca?0x0:_0x58f557['offset'];var _0x587292=_0x89eca?_0x13476d[_0xb759('0x1b')]:_0x58f557[_0xb759('0x18')]+_0x58f557[_0xb759('0x1a')];var _0xf30d8d;if(_0x587292>=_0x5bc105){_0x587292=_0x5bc105;_0xf30d8d=0xc8;}else{_0xf30d8d=0xce;}_0x4bc813[_0xb759('0x1c')](_0xf30d8d);return _0x4bc813[_0xb759('0x1d')]('Content-Range',_0x282726+'-'+_0x587292+'/'+_0x5bc105)[_0xb759('0x1e')](_0x13476d);}return null;};}function patchUpdates(_0x4625ef){return function(_0x31b970){try{jsonpatch['apply'](_0x31b970,_0x4625ef,!![]);}catch(_0x57439f){return BPromise['reject'](_0x57439f);}return _0x31b970[_0xb759('0x1f')]();};}function saveUpdates(_0x8de3e1,_0x5c9b2c){return function(_0x149770){if(_0x149770){return _0x149770[_0xb759('0x20')](_0x8de3e1)[_0xb759('0x21')](function(_0x2ac53d){return _0x2ac53d;});}return null;};}function removeEntity(_0x316866,_0x34a58f){return function(_0x4d9397){if(_0x4d9397){return _0x4d9397[_0xb759('0x22')]()[_0xb759('0x21')](function(){_0x316866[_0xb759('0x1c')](0xcc)[_0xb759('0x17')]();});}};}function handleEntityNotFound(_0x203f4e,_0x49576b){return function(_0x1e9797){if(!_0x1e9797){_0x203f4e[_0xb759('0x16')](0x194);}return _0x1e9797;};}function handleError(_0xb184bb,_0x5f242d){_0x5f242d=_0x5f242d||0x1f4;return function(_0x10f77d){logger['error'](_0x10f77d['stack']);if(_0x10f77d[_0xb759('0x23')]){delete _0x10f77d['name'];}_0xb184bb['status'](_0x5f242d)[_0xb759('0x24')](_0x10f77d);};}exports['index']=function(_0x31734d,_0x3e6f64){var _0x305bb3={},_0xf40c40={},_0x44ab76={'count':0x0,'rows':[]};var _0x5e3c4f=_[_0xb759('0x25')](db[_0xb759('0x26')]['rawAttributes'],function(_0x54bd84){return{'name':_0x54bd84[_0xb759('0x27')],'type':_0x54bd84['type'][_0xb759('0x28')]};});_0xf40c40['model']=_[_0xb759('0x29')](_[_0xb759('0x25')](_0x5e3c4f,_0xb759('0x23')),[_0xb759('0x23')]);_0xf40c40['query']=_[_0xb759('0x2a')](_0x31734d[_0xb759('0x2b')]);_0xf40c40[_0xb759('0x2c')]=_[_0xb759('0x2d')](_0xf40c40[_0xb759('0x2e')],_0xf40c40[_0xb759('0x2b')]);_0x305bb3['attributes']=_['intersection'](_0xf40c40[_0xb759('0x2e')],qs[_0xb759('0x2f')](_0x31734d[_0xb759('0x2b')][_0xb759('0x2f')]));_0x305bb3['attributes']=_0x305bb3[_0xb759('0x30')][_0xb759('0x31')]?_0x305bb3[_0xb759('0x30')]:_0xf40c40[_0xb759('0x2e')];if(!_0x31734d[_0xb759('0x2b')][_0xb759('0x32')](_0xb759('0x33'))){_0x305bb3[_0xb759('0x1a')]=qs[_0xb759('0x1a')](_0x31734d[_0xb759('0x2b')][_0xb759('0x1a')]);_0x305bb3[_0xb759('0x18')]=qs[_0xb759('0x18')](_0x31734d[_0xb759('0x2b')][_0xb759('0x18')]);}_0x305bb3['order']=qs[_0xb759('0x34')](_0x31734d[_0xb759('0x2b')][_0xb759('0x34')]);_0x305bb3[_0xb759('0x35')]=qs[_0xb759('0x2c')](_['pick'](_0x31734d[_0xb759('0x2b')],_0xf40c40['filters']),_0x5e3c4f);if(_0x31734d['query']['filter']){_0x305bb3[_0xb759('0x35')]=_[_0xb759('0x36')](_0x305bb3[_0xb759('0x35')],{'$or':_[_0xb759('0x25')](_0x5e3c4f,function(_0x531afa){if(_0x531afa[_0xb759('0x37')]!==_0xb759('0x38')){var _0x1229f6={};_0x1229f6[_0x531afa[_0xb759('0x23')]]={'$like':'%'+_0x31734d['query'][_0xb759('0x39')]+'%'};return _0x1229f6;}})});}_0x305bb3=_['merge']({},_0x305bb3,_0x31734d['options']);var _0x42e43f={'where':_0x305bb3[_0xb759('0x35')]};return db[_0xb759('0x26')]['count'](_0x42e43f)['then'](function(_0x5ad989){_0x44ab76['count']=_0x5ad989;if(_0x31734d[_0xb759('0x2b')][_0xb759('0x3a')]){_0x305bb3[_0xb759('0x3b')]=[{'all':!![]}];}return db[_0xb759('0x26')][_0xb759('0x3c')](_0x305bb3);})['then'](function(_0x14d7d9){_0x44ab76['rows']=_0x14d7d9;return _0x44ab76;})[_0xb759('0x21')](respondWithFilteredResult(_0x3e6f64,_0x305bb3))[_0xb759('0x3d')](handleError(_0x3e6f64,null));};exports[_0xb759('0x3e')]=function(_0x5a5eca,_0x7f8f97){var _0xf84d6d={'raw':!![],'where':{'id':_0x5a5eca[_0xb759('0x3f')]['id']}},_0x33efe0={};_0x33efe0[_0xb759('0x2e')]=_['keys'](db[_0xb759('0x26')]['rawAttributes']);_0x33efe0[_0xb759('0x2b')]=_[_0xb759('0x2a')](_0x5a5eca[_0xb759('0x2b')]);_0x33efe0[_0xb759('0x2c')]=_[_0xb759('0x2d')](_0x33efe0[_0xb759('0x2e')],_0x33efe0['query']);_0xf84d6d[_0xb759('0x30')]=_[_0xb759('0x2d')](_0x33efe0[_0xb759('0x2e')],qs['fields'](_0x5a5eca[_0xb759('0x2b')][_0xb759('0x2f')]));_0xf84d6d[_0xb759('0x30')]=_0xf84d6d[_0xb759('0x30')]['length']?_0xf84d6d[_0xb759('0x30')]:_0x33efe0['model'];if(_0x5a5eca[_0xb759('0x2b')][_0xb759('0x3a')]){_0xf84d6d[_0xb759('0x3b')]=[{'all':!![]}];}_0xf84d6d=_[_0xb759('0x36')]({},_0xf84d6d,_0x5a5eca[_0xb759('0x40')]);return db[_0xb759('0x26')][_0xb759('0x41')](_0xf84d6d)['then'](handleEntityNotFound(_0x7f8f97,null))['then'](respondWithResult(_0x7f8f97,null))[_0xb759('0x3d')](handleError(_0x7f8f97,null));};exports[_0xb759('0x42')]=function(_0x990c7e,_0x35f1cd){return db[_0xb759('0x26')][_0xb759('0x42')](_0x990c7e[_0xb759('0x43')],{})[_0xb759('0x21')](respondWithResult(_0x35f1cd,0xc9))[_0xb759('0x3d')](handleError(_0x35f1cd,null));};exports[_0xb759('0x20')]=function(_0x3ae5fc,_0x50065f){if(_0x3ae5fc[_0xb759('0x43')]['id']){delete _0x3ae5fc[_0xb759('0x43')]['id'];}return db[_0xb759('0x26')][_0xb759('0x41')]({'where':{'id':_0x3ae5fc['params']['id']}})[_0xb759('0x21')](handleEntityNotFound(_0x50065f,null))[_0xb759('0x21')](saveUpdates(_0x3ae5fc['body'],null))['then'](respondWithResult(_0x50065f,null))[_0xb759('0x3d')](handleError(_0x50065f,null));};exports[_0xb759('0x22')]=function(_0x437366,_0x375df4){return db[_0xb759('0x26')]['find']({'where':{'id':_0x437366['params']['id']}})[_0xb759('0x21')](handleEntityNotFound(_0x375df4,null))[_0xb759('0x21')](removeEntity(_0x375df4,null))[_0xb759('0x3d')](handleError(_0x375df4,null));};exports[_0xb759('0x44')]=function(_0x202236,_0x443430,_0x10d9fb){return db[_0xb759('0x26')][_0xb759('0x41')]({'where':{'id':_0x202236[_0xb759('0x3f')]['id']},'attributes':['id',_0xb759('0x45'),'msg_id']})['then'](handleEntityNotFound(_0x443430,null))[_0xb759('0x21')](function(_0x213859){if(_0x213859){if(!_0x213859[_0xb759('0x45')]){throw new db['Sequelize']['ValidationError'](_0xb759('0x46'));}var _0x113000={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x213859[_0xb759('0x47')]){_0x113000[_0xb759('0x48')]='attachment;\x20filename=\x22'+_0x213859[_0xb759('0x47')]+_0xb759('0x49');}_0x443430['set'](_0x113000);return _0x443430[_0xb759('0x24')](new Buffer(_0x213859[_0xb759('0x45')]));}})[_0xb759('0x3d')](handleError(_0x443430,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 936c3c1..225d0ef 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 _0xd167=['dir','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0xd167,0xf1));var _0x7d16=function(_0x32e12f,_0x440873){_0x32e12f=_0x32e12f-0x0;var _0x3ee254=_0xd167[_0x32e12f];return _0x3ee254;};'use strict';var _=require(_0x7d16('0x0'));var util=require(_0x7d16('0x1'));var logger=require('../../config/logger')(_0x7d16('0x2'));var moment=require(_0x7d16('0x3'));var BPromise=require(_0x7d16('0x4'));var rp=require(_0x7d16('0x5'));var fs=require('fs');var path=require(_0x7d16('0x6'));var rimraf=require(_0x7d16('0x7'));var config=require(_0x7d16('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x7d16('0x9')]=function(_0x382fb2,_0x24683c){return _0x382fb2[_0x7d16('0xa')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x7d16('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x9644=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0x9644,0x149));var _0x4964=function(_0xe88bda,_0x13d18b){_0xe88bda=_0xe88bda-0x0;var _0x5d3803=_0x9644[_0xe88bda];return _0x5d3803;};'use strict';var _=require(_0x4964('0x0'));var util=require(_0x4964('0x1'));var logger=require(_0x4964('0x2'))(_0x4964('0x3'));var moment=require('moment');var BPromise=require(_0x4964('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4964('0x5'));var rimraf=require(_0x4964('0x6'));var config=require('../../config/environment');var attributes=require(_0x4964('0x7'));module[_0x4964('0x8')]=function(_0x4cdc3e,_0xd20c5){return _0x4cdc3e[_0x4964('0x9')](_0x4964('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x4964('0xb'),'fields':[_0x4964('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 654e62b..0c3eef6 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 _0x640b=['request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x1436e9,_0x23eb4d){var _0x1b5b9a=function(_0x4bc5d6){while(--_0x4bc5d6){_0x1436e9['push'](_0x1436e9['shift']());}};_0x1b5b9a(++_0x23eb4d);}(_0x640b,0x1ab));var _0xb640=function(_0x54e573,_0x129035){_0x54e573=_0x54e573-0x0;var _0x14d781=_0x640b[_0x54e573];return _0x14d781;};'use strict';var _=require(_0xb640('0x0'));var util=require(_0xb640('0x1'));var moment=require(_0xb640('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb640('0x3'));var db=require(_0xb640('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb640('0x5'))(_0xb640('0x6'));var config=require(_0xb640('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb640('0x8')][_0xb640('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c459d,_0x535c8a,_0x588a02){return new BPromise(function(_0x2dedbc,_0x36c93f){return client[_0xb640('0xa')](_0x4c459d,_0x588a02)[_0xb640('0xb')](function(_0x19a408){logger[_0xb640('0xc')](_0xb640('0xd'),_0x535c8a,_0xb640('0xe'));logger['debug'](_0xb640('0xf'),_0x535c8a,_0xb640('0xe'),JSON[_0xb640('0x10')](_0x19a408));if(_0x19a408[_0xb640('0x11')]){if(_0x19a408['error'][_0xb640('0x12')]===0x1f4){logger['error'](_0xb640('0xd'),_0x535c8a,_0x19a408[_0xb640('0x11')][_0xb640('0x13')]);return _0x36c93f(_0x19a408[_0xb640('0x11')][_0xb640('0x13')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x535c8a,_0x19a408[_0xb640('0x11')]['message']);return _0x2dedbc(_0x19a408[_0xb640('0x11')]['message']);}else{logger[_0xb640('0xc')](_0xb640('0xd'),_0x535c8a,_0xb640('0xe'));_0x2dedbc(_0x19a408['result'][_0xb640('0x13')]);}})[_0xb640('0x14')](function(_0x471a9f){logger[_0xb640('0x11')](_0xb640('0xd'),_0x535c8a,_0x471a9f);_0x36c93f(_0x471a9f);});});} \ No newline at end of file +var _0x5904=['error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5e97d3,_0x1a58b2){var _0xb08e2b=function(_0x572b4a){while(--_0x572b4a){_0x5e97d3['push'](_0x5e97d3['shift']());}};_0xb08e2b(++_0x1a58b2);}(_0x5904,0xe0));var _0x4590=function(_0x3b00a4,_0x1229d7){_0x3b00a4=_0x3b00a4-0x0;var _0x57e899=_0x5904[_0x3b00a4];return _0x57e899;};'use strict';var _=require(_0x4590('0x0'));var util=require(_0x4590('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4590('0x2'));var fs=require('fs');var Redis=require(_0x4590('0x3'));var db=require(_0x4590('0x4'))['db'];var utils=require(_0x4590('0x5'));var logger=require(_0x4590('0x6'))(_0x4590('0x7'));var config=require(_0x4590('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4590('0x9')][_0x4590('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6b2b35,_0x392694,_0x7688f4){return new BPromise(function(_0x13d7dd,_0xbf23df){return client[_0x4590('0xb')](_0x6b2b35,_0x7688f4)['then'](function(_0x2188a5){logger[_0x4590('0xc')](_0x4590('0xd'),_0x392694,_0x4590('0xe'));logger[_0x4590('0xf')](_0x4590('0x10'),_0x392694,'request\x20sent',JSON[_0x4590('0x11')](_0x2188a5));if(_0x2188a5[_0x4590('0x12')]){if(_0x2188a5[_0x4590('0x12')][_0x4590('0x13')]===0x1f4){logger[_0x4590('0x12')](_0x4590('0xd'),_0x392694,_0x2188a5[_0x4590('0x12')][_0x4590('0x14')]);return _0xbf23df(_0x2188a5[_0x4590('0x12')][_0x4590('0x14')]);}logger[_0x4590('0x12')](_0x4590('0xd'),_0x392694,_0x2188a5[_0x4590('0x12')][_0x4590('0x14')]);return _0x13d7dd(_0x2188a5['error']['message']);}else{logger[_0x4590('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x392694,_0x4590('0xe'));_0x13d7dd(_0x2188a5['result'][_0x4590('0x14')]);}})[_0x4590('0x15')](function(_0x328e6e){logger['error'](_0x4590('0xd'),_0x392694,_0x328e6e);_0xbf23df(_0x328e6e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index e248fde..0c965e1 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 _0x6440=['post','create','put','delete','/:id/sounds/:id2','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','/:id/sounds','getSounds'];(function(_0x26373a,_0xe554fe){var _0x4c1021=function(_0x2a8ee8){while(--_0x2a8ee8){_0x26373a['push'](_0x26373a['shift']());}};_0x4c1021(++_0xe554fe);}(_0x6440,0x195));var _0x0644=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0x6440[_0x2f227c];return _0x5032bc;};'use strict';var multer=require(_0x0644('0x0'));var util=require('util');var path=require(_0x0644('0x1'));var timeout=require(_0x0644('0x2'));var express=require(_0x0644('0x3'));var router=express['Router']();var fs_extra=require(_0x0644('0x4'));var auth=require(_0x0644('0x5'));var interaction=require(_0x0644('0x6'));var config=require(_0x0644('0x7'));var controller=require(_0x0644('0x8'));router[_0x0644('0x9')]('/',auth['isAuthenticated'](),controller[_0x0644('0xa')]);router[_0x0644('0x9')](_0x0644('0xb'),auth[_0x0644('0xc')](),controller['show']);router[_0x0644('0x9')](_0x0644('0xd'),auth[_0x0644('0xc')](),controller[_0x0644('0xe')]);router[_0x0644('0xf')]('/',auth[_0x0644('0xc')](),controller[_0x0644('0x10')]);router[_0x0644('0xf')](_0x0644('0xd'),auth['isAuthenticated'](),controller['addSound']);router[_0x0644('0x11')](_0x0644('0xb'),auth[_0x0644('0xc')](),controller['update']);router[_0x0644('0x12')](_0x0644('0xb'),auth[_0x0644('0xc')](),controller['destroy']);router['delete'](_0x0644('0x13'),auth[_0x0644('0xc')](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0x2420=['post','create','/:id/sounds','addSound','delete','removeSound','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','getSounds'];(function(_0x312b2b,_0x2174f3){var _0x1d6a18=function(_0x4f95ae){while(--_0x4f95ae){_0x312b2b['push'](_0x312b2b['shift']());}};_0x1d6a18(++_0x2174f3);}(_0x2420,0x136));var _0x0242=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x2420[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0242('0x0'));var express=require(_0x0242('0x1'));var router=express[_0x0242('0x2')]();var fs_extra=require(_0x0242('0x3'));var auth=require(_0x0242('0x4'));var interaction=require(_0x0242('0x5'));var config=require(_0x0242('0x6'));var controller=require(_0x0242('0x7'));router[_0x0242('0x8')]('/',auth[_0x0242('0x9')](),controller['index']);router[_0x0242('0x8')](_0x0242('0xa'),auth[_0x0242('0x9')](),controller[_0x0242('0xb')]);router[_0x0242('0x8')]('/:id/sounds',auth[_0x0242('0x9')](),controller[_0x0242('0xc')]);router[_0x0242('0xd')]('/',auth[_0x0242('0x9')](),controller[_0x0242('0xe')]);router[_0x0242('0xd')](_0x0242('0xf'),auth[_0x0242('0x9')](),controller[_0x0242('0x10')]);router['put'](_0x0242('0xa'),auth[_0x0242('0x9')](),controller['update']);router[_0x0242('0x11')](_0x0242('0xa'),auth[_0x0242('0x9')](),controller['destroy']);router[_0x0242('0x11')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x0242('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 68215be..f320080 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 _0xe7e6=['mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','files','mp3nb'];(function(_0x2af573,_0x2065a5){var _0x59be3b=function(_0x26fc0d){while(--_0x26fc0d){_0x2af573['push'](_0x2af573['shift']());}};_0x59be3b(++_0x2065a5);}(_0xe7e6,0x11d));var _0x6e7e=function(_0x2d3f04,_0x517387){_0x2d3f04=_0x2d3f04-0x0;var _0x5709a4=_0xe7e6[_0x2d3f04];return _0x5709a4;};'use strict';var Sequelize=require(_0x6e7e('0x0'));module[_0x6e7e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6e7e('0x2')},'mode':{'type':Sequelize['ENUM']('custom',_0x6e7e('0x3'),_0x6e7e('0x4'),'quietmp3nb','quietmp3',_0x6e7e('0x5')),'allowNull':!![],'defaultValue':_0x6e7e('0x3')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x6e7e('0x6')],'allowNull':!![]},'digit':{'type':Sequelize[_0x6e7e('0x6')],'allowNull':!![]},'sort':{'type':Sequelize[_0x6e7e('0x6')],'allowNull':!![],'defaultValue':_0x6e7e('0x7')},'format':{'type':Sequelize[_0x6e7e('0x6')],'allowNull':!![]},'stamp':{'type':_0x6e7e('0x8')},'defaultEntry':{'type':Sequelize[_0x6e7e('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb534=['exports','STRING','name','files','quietmp3nb','quietmp3','mp3','alpha','sequelize'];(function(_0x3ba9d6,_0x4e9f98){var _0x172e00=function(_0x425e91){while(--_0x425e91){_0x3ba9d6['push'](_0x3ba9d6['shift']());}};_0x172e00(++_0x4e9f98);}(_0xb534,0x14c));var _0x4b53=function(_0x3f4790,_0x5189ef){_0x3f4790=_0x3f4790-0x0;var _0x4baf4b=_0xb534[_0x3f4790];return _0x4baf4b;};'use strict';var Sequelize=require(_0x4b53('0x0'));module[_0x4b53('0x1')]={'name':{'type':Sequelize[_0x4b53('0x2')],'allowNull':![],'unique':_0x4b53('0x3')},'mode':{'type':Sequelize['ENUM']('custom',_0x4b53('0x4'),'mp3nb',_0x4b53('0x5'),_0x4b53('0x6'),_0x4b53('0x7')),'allowNull':!![],'defaultValue':_0x4b53('0x4')},'directory':{'type':Sequelize[_0x4b53('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x4b53('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4b53('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4b53('0x2')],'allowNull':!![],'defaultValue':_0x4b53('0x8')},'format':{'type':Sequelize[_0x4b53('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 89e6c10..7db0220 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 _0x997b=['map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','create','sequelize','transaction','mode','directory','join','server/files/moh','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','rmdirSync','Sequelize','ValidationError','addSound','Sound','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','message','findOne','removeSound','id2','unlinkSync','getSounds','pick','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','send','VoiceMusicOnHold','rawAttributes','type','key','model'];(function(_0x2a0422,_0x42121c){var _0x562dce=function(_0x69f263){while(--_0x69f263){_0x2a0422['push'](_0x2a0422['shift']());}};_0x562dce(++_0x42121c);}(_0x997b,0x125));var _0xb997=function(_0xa7a587,_0x1103e1){_0xa7a587=_0xa7a587-0x0;var _0x74b664=_0x997b[_0xa7a587];return _0x74b664;};'use strict';var emlformat=require(_0xb997('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb997('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb997('0x2'));var moment=require(_0xb997('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb997('0x4'));var util=require(_0xb997('0x5'));var path=require(_0xb997('0x6'));var sox=require(_0xb997('0x7'));var csv=require('to-csv');var ejs=require(_0xb997('0x8'));var fs=require('fs');var fs_extra=require(_0xb997('0x9'));var _=require('lodash');var squel=require(_0xb997('0xa'));var crypto=require('crypto');var jsforce=require(_0xb997('0xb'));var deskjs=require(_0xb997('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb997('0xd'));var Papa=require(_0xb997('0xe'));var Redis=require(_0xb997('0xf'));var authService=require(_0xb997('0x10'));var qs=require(_0xb997('0x11'));var as=require(_0xb997('0x12'));var hardwareService=require(_0xb997('0x13'));var logger=require('../../config/logger')(_0xb997('0x14'));var utils=require(_0xb997('0x15'));var config=require(_0xb997('0x16'));var licenseUtil=require(_0xb997('0x17'));var db=require(_0xb997('0x18'))['db'];function respondWithStatusCode(_0x49d211,_0x196882){_0x196882=_0x196882||0xcc;return function(_0x4f69bc){if(_0x4f69bc){return _0x49d211[_0xb997('0x19')](_0x196882);}return _0x49d211[_0xb997('0x1a')](_0x196882)['end']();};}function respondWithResult(_0x2baecf,_0xe73cca){_0xe73cca=_0xe73cca||0xc8;return function(_0x177783){if(_0x177783){return _0x2baecf[_0xb997('0x1a')](_0xe73cca)[_0xb997('0x1b')](_0x177783);}};}function respondWithFilteredResult(_0x1a42fa,_0x301acb){return function(_0x4850e1){if(_0x4850e1){var _0x404ce4=typeof _0x301acb[_0xb997('0x1c')]===_0xb997('0x1d')&&typeof _0x301acb[_0xb997('0x1e')]===_0xb997('0x1d');var _0x1df8f8=_0x4850e1[_0xb997('0x1f')];var _0x4122a6=_0x404ce4?0x0:_0x301acb[_0xb997('0x1c')];var _0x1ce424=_0x404ce4?_0x4850e1['count']:_0x301acb[_0xb997('0x1c')]+_0x301acb[_0xb997('0x1e')];var _0x15de41;if(_0x1ce424>=_0x1df8f8){_0x1ce424=_0x1df8f8;_0x15de41=0xc8;}else{_0x15de41=0xce;}_0x1a42fa['status'](_0x15de41);return _0x1a42fa[_0xb997('0x20')](_0xb997('0x21'),_0x4122a6+'-'+_0x1ce424+'/'+_0x1df8f8)['json'](_0x4850e1);}return null;};}function patchUpdates(_0x55b532){return function(_0x160617){try{jsonpatch[_0xb997('0x22')](_0x160617,_0x55b532,!![]);}catch(_0x2c880e){return BPromise[_0xb997('0x23')](_0x2c880e);}return _0x160617['save']();};}function saveUpdates(_0x4a014a,_0x228a48){return function(_0x38a59a){if(_0x38a59a){return _0x38a59a['update'](_0x4a014a)[_0xb997('0x24')](function(_0x5abe36){return _0x5abe36;});}return null;};}function removeEntity(_0x269316,_0x57076a){return function(_0x349924){if(_0x349924){return _0x349924[_0xb997('0x25')]()[_0xb997('0x24')](function(){var _0x29fa55=_0x349924['get']({'plain':!![]});var _0x4e3a6c=_0xb997('0x26');return db[_0xb997('0x27')][_0xb997('0x25')]({'where':{'type':_0x4e3a6c,'resourceId':_0x29fa55['id']}})[_0xb997('0x24')](function(){return _0x349924;});})['then'](function(){_0x269316['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29d02a,_0x5248d5){return function(_0x195407){if(!_0x195407){_0x29d02a[_0xb997('0x19')](0x194);}return _0x195407;};}function handleError(_0x5aaa65,_0x5bffc4){_0x5bffc4=_0x5bffc4||0x1f4;return function(_0x126d56){logger[_0xb997('0x28')](_0x126d56[_0xb997('0x29')]);if(_0x126d56[_0xb997('0x2a')]){delete _0x126d56[_0xb997('0x2a')];}_0x5aaa65[_0xb997('0x1a')](_0x5bffc4)[_0xb997('0x2b')](_0x126d56);};}exports['index']=function(_0x1b7d43,_0x3dd72b){var _0x204556={},_0x402118={},_0x20316f={'count':0x0,'rows':[]};var _0x2a0d72=_['map'](db[_0xb997('0x2c')][_0xb997('0x2d')],function(_0x167791){return{'name':_0x167791['fieldName'],'type':_0x167791[_0xb997('0x2e')][_0xb997('0x2f')]};});_0x402118[_0xb997('0x30')]=_[_0xb997('0x31')](_0x2a0d72,_0xb997('0x2a'));_0x402118[_0xb997('0x32')]=_[_0xb997('0x33')](_0x1b7d43['query']);_0x402118[_0xb997('0x34')]=_[_0xb997('0x35')](_0x402118[_0xb997('0x30')],_0x402118[_0xb997('0x32')]);_0x204556[_0xb997('0x36')]=_[_0xb997('0x35')](_0x402118[_0xb997('0x30')],qs[_0xb997('0x37')](_0x1b7d43[_0xb997('0x32')][_0xb997('0x37')]));_0x204556[_0xb997('0x36')]=_0x204556[_0xb997('0x36')][_0xb997('0x38')]?_0x204556[_0xb997('0x36')]:_0x402118['model'];if(!_0x1b7d43[_0xb997('0x32')][_0xb997('0x39')](_0xb997('0x3a'))){_0x204556[_0xb997('0x1e')]=qs['limit'](_0x1b7d43[_0xb997('0x32')][_0xb997('0x1e')]);_0x204556[_0xb997('0x1c')]=qs['offset'](_0x1b7d43[_0xb997('0x32')][_0xb997('0x1c')]);}_0x204556[_0xb997('0x3b')]=qs['sort'](_0x1b7d43[_0xb997('0x32')][_0xb997('0x3c')]);delete _0x1b7d43[_0xb997('0x32')]['sort'];_0x204556[_0xb997('0x3d')]=qs[_0xb997('0x34')](_['pick'](_0x1b7d43[_0xb997('0x32')],_0x402118[_0xb997('0x34')]),_0x2a0d72);if(_0x1b7d43[_0xb997('0x32')][_0xb997('0x3e')]){_0x204556[_0xb997('0x3d')]=_[_0xb997('0x3f')](_0x204556['where'],{'$or':_[_0xb997('0x31')](_0x2a0d72,function(_0x30428a){if(_0x30428a[_0xb997('0x2e')]!==_0xb997('0x40')){var _0x101e58={};_0x101e58[_0x30428a['name']]={'$like':'%'+_0x1b7d43[_0xb997('0x32')][_0xb997('0x3e')]+'%'};return _0x101e58;}})});}_0x204556=_[_0xb997('0x3f')]({},_0x204556,_0x1b7d43[_0xb997('0x41')]);var _0x1d6e48={'where':_0x204556['where']};return db[_0xb997('0x2c')]['count'](_0x1d6e48)[_0xb997('0x24')](function(_0x35d693){_0x20316f['count']=_0x35d693;if(_0x1b7d43[_0xb997('0x32')][_0xb997('0x42')]){_0x204556[_0xb997('0x43')]=[{'all':!![]}];}return db[_0xb997('0x2c')][_0xb997('0x44')](_0x204556);})['then'](function(_0xe0f878){_0x20316f[_0xb997('0x45')]=_0xe0f878;return _0x20316f;})[_0xb997('0x24')](respondWithFilteredResult(_0x3dd72b,_0x204556))[_0xb997('0x46')](handleError(_0x3dd72b,null));};exports['show']=function(_0x5d95e4,_0x56379d){var _0x357917={'raw':![],'where':{'id':_0x5d95e4[_0xb997('0x47')]['id']}},_0x20ea71={};_0x20ea71[_0xb997('0x30')]=_[_0xb997('0x33')](db[_0xb997('0x2c')][_0xb997('0x2d')]);_0x20ea71['query']=_[_0xb997('0x33')](_0x5d95e4[_0xb997('0x32')]);_0x20ea71['filters']=_[_0xb997('0x35')](_0x20ea71[_0xb997('0x30')],_0x20ea71['query']);_0x357917[_0xb997('0x36')]=_[_0xb997('0x35')](_0x20ea71[_0xb997('0x30')],qs[_0xb997('0x37')](_0x5d95e4[_0xb997('0x32')]['fields']));_0x357917[_0xb997('0x36')]=_0x357917[_0xb997('0x36')][_0xb997('0x38')]?_0x357917[_0xb997('0x36')]:_0x20ea71[_0xb997('0x30')];if(_0x5d95e4[_0xb997('0x32')][_0xb997('0x42')]){_0x357917['include']=[{'all':!![]}];}_0x357917=_[_0xb997('0x3f')]({},_0x357917,_0x5d95e4[_0xb997('0x41')]);return db[_0xb997('0x2c')][_0xb997('0x48')](_0x357917)[_0xb997('0x24')](handleEntityNotFound(_0x56379d,null))[_0xb997('0x24')](respondWithResult(_0x56379d,null))[_0xb997('0x46')](handleError(_0x56379d,null));};exports['update']=function(_0x379af5,_0x101e1b){if(_0x379af5[_0xb997('0x49')]['id']){delete _0x379af5[_0xb997('0x49')]['id'];}return db[_0xb997('0x2c')]['find']({'where':{'id':_0x379af5[_0xb997('0x47')]['id']}})[_0xb997('0x24')](handleEntityNotFound(_0x101e1b,null))['then'](saveUpdates(_0x379af5[_0xb997('0x49')],null))['then'](respondWithResult(_0x101e1b,null))['catch'](handleError(_0x101e1b,null));};exports[_0xb997('0x4a')]=function(_0x155a2a,_0xe5666f,_0xf67c5c){return db[_0xb997('0x4b')][_0xb997('0x4c')](function(_0x30c213){if(_0x155a2a['body'][_0xb997('0x4d')]==='files'){_0x155a2a['body'][_0xb997('0x4e')]=path[_0xb997('0x4f')](config['root'],_0xb997('0x50'),_0x155a2a[_0xb997('0x49')][_0xb997('0x2a')]);}return db['VoiceMusicOnHold'][_0xb997('0x4a')](_0x155a2a[_0xb997('0x49')],{'transaction':_0x30c213})[_0xb997('0x24')](function(_0x4c7751){if(_0x155a2a[_0xb997('0x49')][_0xb997('0x4d')]===_0xb997('0x51')){fs['mkdirSync'](_0x4c7751['directory'],parseInt(_0xb997('0x52'),0x8));}var _0x1048bd=_0x155a2a[_0xb997('0x53')]['get']({'plain':!![]});if(!_0x1048bd)throw new Error(_0xb997('0x54'));if(_0x1048bd[_0xb997('0x55')]===_0xb997('0x53')){var _0x254107=_0x4c7751[_0xb997('0x56')]({'plain':!![]});return db[_0xb997('0x57')][_0xb997('0x48')]({'where':{'name':_0xb997('0x26'),'userProfileId':_0x1048bd[_0xb997('0x58')]},'raw':!![]})[_0xb997('0x24')](function(_0x95c363){if(_0x95c363&&_0x95c363[_0xb997('0x59')]===0x0){return db['UserProfileResource'][_0xb997('0x4a')]({'name':_0x254107[_0xb997('0x2a')],'resourceId':_0x254107['id'],'type':_0x95c363[_0xb997('0x2a')],'sectionId':_0x95c363['id']},{})[_0xb997('0x24')](function(){return _0x4c7751;});}else{return _0x4c7751;}})[_0xb997('0x46')](function(_0x505c8b){logger[_0xb997('0x28')](_0xb997('0x5a'),_0x505c8b);});}return _0x4c7751;});})[_0xb997('0x24')](respondWithResult(_0xe5666f,0xc9))[_0xb997('0x46')](handleError(_0xe5666f,null));};exports[_0xb997('0x25')]=function(_0x3ecbf7,_0x147148,_0x115486){var _0x4ce124;return db[_0xb997('0x2c')][_0xb997('0x48')]({'where':{'id':_0x3ecbf7[_0xb997('0x47')]['id']}})['then'](function(_0x1c11b3){if(_0x1c11b3){return db['sequelize']['transaction'](function(_0x447bd7){return _0x1c11b3[_0xb997('0x25')]({'transaction':_0x447bd7,'raw':!![]})['then'](function(_0x1ab582){if(_0x1ab582['directory']){fs['readdirSync'](_0x1ab582[_0xb997('0x4e')])[_0xb997('0x5b')](function(_0x321fba){fs['unlinkSync'](path['join'](_0x1ab582[_0xb997('0x4e')],_0x321fba));});fs[_0xb997('0x5c')](_0x1ab582['directory']);}return _0x1ab582;});})['catch'](function(_0x25d49b){throw new db[(_0xb997('0x5d'))][(_0xb997('0x5e'))](_0x25d49b['message']);});}})[_0xb997('0x24')](handleEntityNotFound(_0x147148,null))[_0xb997('0x24')](removeEntity(_0x147148,null))[_0xb997('0x46')](handleError(_0x147148,null));};exports[_0xb997('0x5f')]=function(_0x1ee075,_0x516849,_0x250e6c){return db[_0xb997('0x4b')]['transaction'](function(_0x5673f4){var _0x2bdb57;return db[_0xb997('0x2c')][_0xb997('0x48')]({'where':{'id':_0x1ee075['params']['id']}})[_0xb997('0x24')](function(_0x55b6ce){if(_0x55b6ce){_0x2bdb57=_0x55b6ce;return _0x55b6ce['addSound'](_0x1ee075[_0xb997('0x49')]['id'],{'transaction':_0x5673f4});}})[_0xb997('0x24')](function(_0x804f87){if(_0x804f87){return db[_0xb997('0x60')]['findOne']({'where':{'id':_0x1ee075['body']['id']},'attributes':['id',_0xb997('0x2a'),_0xb997('0x61'),_0xb997('0x62'),_0xb997('0x63')],'raw':!![]});}})[_0xb997('0x24')](function(_0x462fdf){if(_0x462fdf){var _0x4a5655=path['join'](config[_0xb997('0x64')],_0xb997('0x65'),util[_0xb997('0x66')](_0xb997('0x67'),path[_0xb997('0x68')](_0x462fdf['save_name'],path[_0xb997('0x69')](_0x462fdf[_0xb997('0x61')])),_0x462fdf['converted_format']));var _0x25b5eb=path[_0xb997('0x4f')](config[_0xb997('0x64')],'server/files/moh',_0x2bdb57[_0xb997('0x2a')],util['format'](_0xb997('0x67'),_0x462fdf['name'],_0x462fdf[_0xb997('0x62')]));fs[_0xb997('0x6a')](_0x4a5655,_0x25b5eb);return _0x462fdf;}})['catch'](function(_0x556696){throw new db[(_0xb997('0x5d'))][(_0xb997('0x5e'))](_0x556696[_0xb997('0x6b')]);});})[_0xb997('0x24')](handleEntityNotFound(_0x516849,null))[_0xb997('0x24')](respondWithResult(_0x516849,0xc9))[_0xb997('0x46')](handleError(_0x516849,null));};exports['removeSound']=function(_0x33a210,_0x5e814f,_0x2b3722){return db[_0xb997('0x4b')][_0xb997('0x4c')](function(_0x299748){var _0x204535;return db[_0xb997('0x2c')][_0xb997('0x6c')]({'where':{'id':_0x33a210[_0xb997('0x47')]['id']}})[_0xb997('0x24')](handleEntityNotFound(_0x5e814f,null))[_0xb997('0x24')](function(_0xe50d84){if(_0xe50d84){_0x204535=_0xe50d84;return _0xe50d84[_0xb997('0x6d')](_0x33a210[_0xb997('0x47')]['id2']);}})[_0xb997('0x24')](function(_0x35653e){if(_0x35653e){return db[_0xb997('0x60')][_0xb997('0x6c')]({'where':{'id':_0x33a210[_0xb997('0x47')][_0xb997('0x6e')]},'attributes':['id','name',_0xb997('0x61'),'converted_format',_0xb997('0x63')],'raw':!![]});}})['then'](function(_0x4433ca){if(_0x4433ca){fs[_0xb997('0x6f')](path[_0xb997('0x4f')](_0x204535['directory'],util['format'](_0xb997('0x67'),_0x4433ca[_0xb997('0x2a')],_0x4433ca[_0xb997('0x62')])));return _0x4433ca;}})[_0xb997('0x46')](function(_0x411689){throw new db[(_0xb997('0x5d'))][(_0xb997('0x5e'))](_0x411689[_0xb997('0x6b')]);});})[_0xb997('0x24')](handleEntityNotFound(_0x5e814f,null))['then'](respondWithStatusCode(_0x5e814f,0xcc))['catch'](handleError(_0x5e814f,null));};exports[_0xb997('0x70')]=function(_0xd2f715,_0x469dec,_0x4afc1b){var _0x244d19={};var _0x4d033d={};var _0x215012;var _0x5e4729;return db[_0xb997('0x2c')][_0xb997('0x6c')]({'where':{'id':_0xd2f715[_0xb997('0x47')]['id']}})['then'](handleEntityNotFound(_0x469dec,null))['then'](function(_0x6aa66c){if(_0x6aa66c){_0x215012=_0x6aa66c;_0x4d033d['model']=_['keys'](db[_0xb997('0x60')][_0xb997('0x2d')]);_0x4d033d[_0xb997('0x32')]=_['keys'](_0xd2f715[_0xb997('0x32')]);_0x4d033d[_0xb997('0x34')]=_[_0xb997('0x35')](_0x4d033d['model'],_0x4d033d[_0xb997('0x32')]);_0x244d19[_0xb997('0x36')]=_['intersection'](_0x4d033d['model'],qs[_0xb997('0x37')](_0xd2f715[_0xb997('0x32')]['fields']));_0x244d19[_0xb997('0x36')]=_0x244d19['attributes']['length']?_0x244d19[_0xb997('0x36')]:_0x4d033d[_0xb997('0x30')];_0x244d19['order']=qs[_0xb997('0x3c')](_0xd2f715[_0xb997('0x32')][_0xb997('0x3c')]);_0x244d19[_0xb997('0x3d')]=qs['filters'](_[_0xb997('0x71')](_0xd2f715[_0xb997('0x32')],_0x4d033d[_0xb997('0x34')]));if(_0xd2f715[_0xb997('0x32')]['filter']){_0x244d19[_0xb997('0x3d')]=_[_0xb997('0x3f')](_0x244d19['where'],{'$or':_[_0xb997('0x31')](_0x244d19[_0xb997('0x36')],function(_0x3ef35d){var _0xbee6f8={};_0xbee6f8[_0x3ef35d]={'$like':'%'+_0xd2f715['query'][_0xb997('0x3e')]+'%'};return _0xbee6f8;})});}_0x244d19=_[_0xb997('0x3f')]({},_0x244d19,_0xd2f715[_0xb997('0x41')]);return _0x215012[_0xb997('0x70')](_0x244d19);}})[_0xb997('0x24')](function(_0x7a32c5){if(_0x7a32c5){_0x5e4729=_0x7a32c5['length'];if(!_0xd2f715[_0xb997('0x32')][_0xb997('0x39')]('nolimit')){_0x244d19['limit']=qs[_0xb997('0x1e')](_0xd2f715[_0xb997('0x32')][_0xb997('0x1e')]);_0x244d19[_0xb997('0x1c')]=qs[_0xb997('0x1c')](_0xd2f715[_0xb997('0x32')][_0xb997('0x1c')]);}return _0x215012[_0xb997('0x70')](_0x244d19);}})[_0xb997('0x24')](function(_0x153450){if(_0x153450){return _0x153450?{'count':_0x5e4729,'rows':_0x153450}:null;}})[_0xb997('0x24')](respondWithResult(_0x469dec,null))[_0xb997('0x46')](handleError(_0x469dec,null));}; \ No newline at end of file +var _0x861e=['sort','where','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','includeAll','body','create','sequelize','transaction','files','directory','join','root','server/files/moh','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','find','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','extname','symlinkSync','Sequelize','removeSound','id2','Sound','format','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x861e,0x10d));var _0xe861=function(_0x259b25,_0x37fe57){_0x259b25=_0x259b25-0x0;var _0x531cad=_0x861e[_0x259b25];return _0x531cad;};'use strict';var emlformat=require(_0xe861('0x0'));var rimraf=require(_0xe861('0x1'));var zipdir=require(_0xe861('0x2'));var jsonpatch=require(_0xe861('0x3'));var rp=require(_0xe861('0x4'));var moment=require(_0xe861('0x5'));var BPromise=require(_0xe861('0x6'));var Mustache=require(_0xe861('0x7'));var util=require(_0xe861('0x8'));var path=require(_0xe861('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe861('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe861('0xb'));var squel=require(_0xe861('0xc'));var crypto=require(_0xe861('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe861('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe861('0xf'));var Papa=require(_0xe861('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe861('0x11'));var as=require(_0xe861('0x12'));var hardwareService=require(_0xe861('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xe861('0x14'));var config=require(_0xe861('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58846b,_0x5cf612){_0x5cf612=_0x5cf612||0xcc;return function(_0x1ecdd1){if(_0x1ecdd1){return _0x58846b[_0xe861('0x16')](_0x5cf612);}return _0x58846b[_0xe861('0x17')](_0x5cf612)['end']();};}function respondWithResult(_0x316d01,_0x123fb5){_0x123fb5=_0x123fb5||0xc8;return function(_0x38d8d4){if(_0x38d8d4){return _0x316d01[_0xe861('0x17')](_0x123fb5)[_0xe861('0x18')](_0x38d8d4);}};}function respondWithFilteredResult(_0x2a3972,_0x440de2){return function(_0x5be076){if(_0x5be076){var _0x202e21=typeof _0x440de2[_0xe861('0x19')]===_0xe861('0x1a')&&typeof _0x440de2['limit']===_0xe861('0x1a');var _0x598bb0=_0x5be076['count'];var _0x2555e2=_0x202e21?0x0:_0x440de2['offset'];var _0x1349a0=_0x202e21?_0x5be076['count']:_0x440de2[_0xe861('0x19')]+_0x440de2[_0xe861('0x1b')];var _0x2eebf4;if(_0x1349a0>=_0x598bb0){_0x1349a0=_0x598bb0;_0x2eebf4=0xc8;}else{_0x2eebf4=0xce;}_0x2a3972[_0xe861('0x17')](_0x2eebf4);return _0x2a3972[_0xe861('0x1c')](_0xe861('0x1d'),_0x2555e2+'-'+_0x1349a0+'/'+_0x598bb0)['json'](_0x5be076);}return null;};}function patchUpdates(_0x310fab){return function(_0x2291bf){try{jsonpatch['apply'](_0x2291bf,_0x310fab,!![]);}catch(_0xa619d5){return BPromise[_0xe861('0x1e')](_0xa619d5);}return _0x2291bf['save']();};}function saveUpdates(_0x23011c,_0x4fa022){return function(_0x2cf158){if(_0x2cf158){return _0x2cf158[_0xe861('0x1f')](_0x23011c)[_0xe861('0x20')](function(_0x305c32){return _0x305c32;});}return null;};}function removeEntity(_0x1ba045,_0x16fd0c){return function(_0x39ac93){if(_0x39ac93){return _0x39ac93[_0xe861('0x21')]()['then'](function(){var _0x48ea66=_0x39ac93[_0xe861('0x22')]({'plain':!![]});var _0x4bcc2f=_0xe861('0x23');return db[_0xe861('0x24')][_0xe861('0x21')]({'where':{'type':_0x4bcc2f,'resourceId':_0x48ea66['id']}})['then'](function(){return _0x39ac93;});})[_0xe861('0x20')](function(){_0x1ba045[_0xe861('0x17')](0xcc)[_0xe861('0x25')]();});}};}function handleEntityNotFound(_0x3421ad,_0x2a53e5){return function(_0x44e417){if(!_0x44e417){_0x3421ad['sendStatus'](0x194);}return _0x44e417;};}function handleError(_0x110538,_0x5c1a28){_0x5c1a28=_0x5c1a28||0x1f4;return function(_0x5658a5){logger['error'](_0x5658a5['stack']);if(_0x5658a5[_0xe861('0x26')]){delete _0x5658a5[_0xe861('0x26')];}_0x110538[_0xe861('0x17')](_0x5c1a28)[_0xe861('0x27')](_0x5658a5);};}exports[_0xe861('0x28')]=function(_0x2c7336,_0xd5432d){var _0x2cbd13={},_0x11d65a={},_0x10505b={'count':0x0,'rows':[]};var _0x1767be=_['map'](db[_0xe861('0x29')][_0xe861('0x2a')],function(_0x11bdf1){return{'name':_0x11bdf1[_0xe861('0x2b')],'type':_0x11bdf1[_0xe861('0x2c')][_0xe861('0x2d')]};});_0x11d65a[_0xe861('0x2e')]=_[_0xe861('0x2f')](_0x1767be,_0xe861('0x26'));_0x11d65a['query']=_[_0xe861('0x30')](_0x2c7336[_0xe861('0x31')]);_0x11d65a[_0xe861('0x32')]=_['intersection'](_0x11d65a['model'],_0x11d65a[_0xe861('0x31')]);_0x2cbd13['attributes']=_[_0xe861('0x33')](_0x11d65a['model'],qs[_0xe861('0x34')](_0x2c7336[_0xe861('0x31')][_0xe861('0x34')]));_0x2cbd13['attributes']=_0x2cbd13['attributes'][_0xe861('0x35')]?_0x2cbd13[_0xe861('0x36')]:_0x11d65a[_0xe861('0x2e')];if(!_0x2c7336['query'][_0xe861('0x37')](_0xe861('0x38'))){_0x2cbd13[_0xe861('0x1b')]=qs[_0xe861('0x1b')](_0x2c7336[_0xe861('0x31')][_0xe861('0x1b')]);_0x2cbd13[_0xe861('0x19')]=qs[_0xe861('0x19')](_0x2c7336['query'][_0xe861('0x19')]);}_0x2cbd13[_0xe861('0x39')]=qs[_0xe861('0x3a')](_0x2c7336[_0xe861('0x31')][_0xe861('0x3a')]);delete _0x2c7336['query']['sort'];_0x2cbd13[_0xe861('0x3b')]=qs[_0xe861('0x32')](_[_0xe861('0x3c')](_0x2c7336[_0xe861('0x31')],_0x11d65a['filters']),_0x1767be);if(_0x2c7336[_0xe861('0x31')]['filter']){_0x2cbd13[_0xe861('0x3b')]=_[_0xe861('0x3d')](_0x2cbd13['where'],{'$or':_[_0xe861('0x2f')](_0x1767be,function(_0x16c706){if(_0x16c706['type']!==_0xe861('0x3e')){var _0x2e933b={};_0x2e933b[_0x16c706[_0xe861('0x26')]]={'$like':'%'+_0x2c7336['query'][_0xe861('0x3f')]+'%'};return _0x2e933b;}})});}_0x2cbd13=_[_0xe861('0x3d')]({},_0x2cbd13,_0x2c7336[_0xe861('0x40')]);var _0x34eff3={'where':_0x2cbd13[_0xe861('0x3b')]};return db[_0xe861('0x29')][_0xe861('0x41')](_0x34eff3)[_0xe861('0x20')](function(_0x3b50a8){_0x10505b[_0xe861('0x41')]=_0x3b50a8;if(_0x2c7336[_0xe861('0x31')]['includeAll']){_0x2cbd13[_0xe861('0x42')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xe861('0x43')](_0x2cbd13);})[_0xe861('0x20')](function(_0x35adfc){_0x10505b[_0xe861('0x44')]=_0x35adfc;return _0x10505b;})[_0xe861('0x20')](respondWithFilteredResult(_0xd5432d,_0x2cbd13))[_0xe861('0x45')](handleError(_0xd5432d,null));};exports[_0xe861('0x46')]=function(_0x3beddb,_0x4095a3){var _0x3664a3={'raw':![],'where':{'id':_0x3beddb[_0xe861('0x47')]['id']}},_0x20084e={};_0x20084e['model']=_[_0xe861('0x30')](db[_0xe861('0x29')][_0xe861('0x2a')]);_0x20084e[_0xe861('0x31')]=_[_0xe861('0x30')](_0x3beddb[_0xe861('0x31')]);_0x20084e[_0xe861('0x32')]=_[_0xe861('0x33')](_0x20084e['model'],_0x20084e[_0xe861('0x31')]);_0x3664a3[_0xe861('0x36')]=_[_0xe861('0x33')](_0x20084e['model'],qs[_0xe861('0x34')](_0x3beddb[_0xe861('0x31')][_0xe861('0x34')]));_0x3664a3[_0xe861('0x36')]=_0x3664a3[_0xe861('0x36')][_0xe861('0x35')]?_0x3664a3[_0xe861('0x36')]:_0x20084e[_0xe861('0x2e')];if(_0x3beddb[_0xe861('0x31')][_0xe861('0x48')]){_0x3664a3[_0xe861('0x42')]=[{'all':!![]}];}_0x3664a3=_[_0xe861('0x3d')]({},_0x3664a3,_0x3beddb[_0xe861('0x40')]);return db['VoiceMusicOnHold']['find'](_0x3664a3)[_0xe861('0x20')](handleEntityNotFound(_0x4095a3,null))[_0xe861('0x20')](respondWithResult(_0x4095a3,null))['catch'](handleError(_0x4095a3,null));};exports['update']=function(_0x3e63a6,_0x235927){if(_0x3e63a6[_0xe861('0x49')]['id']){delete _0x3e63a6[_0xe861('0x49')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x3e63a6[_0xe861('0x47')]['id']}})[_0xe861('0x20')](handleEntityNotFound(_0x235927,null))['then'](saveUpdates(_0x3e63a6[_0xe861('0x49')],null))[_0xe861('0x20')](respondWithResult(_0x235927,null))[_0xe861('0x45')](handleError(_0x235927,null));};exports[_0xe861('0x4a')]=function(_0x572f99,_0x34ae97,_0x2a725e){return db[_0xe861('0x4b')][_0xe861('0x4c')](function(_0x1e035b){if(_0x572f99['body']['mode']===_0xe861('0x4d')){_0x572f99[_0xe861('0x49')][_0xe861('0x4e')]=path[_0xe861('0x4f')](config[_0xe861('0x50')],_0xe861('0x51'),_0x572f99[_0xe861('0x49')][_0xe861('0x26')]);}return db['VoiceMusicOnHold']['create'](_0x572f99[_0xe861('0x49')],{'transaction':_0x1e035b})['then'](function(_0x168bbb){if(_0x572f99['body']['mode']==='files'){fs['mkdirSync'](_0x168bbb[_0xe861('0x4e')],parseInt('0777',0x8));}var _0x1f553f=_0x572f99['user'][_0xe861('0x22')]({'plain':!![]});if(!_0x1f553f)throw new Error(_0xe861('0x52'));if(_0x1f553f[_0xe861('0x53')]===_0xe861('0x54')){var _0x5a514a=_0x168bbb[_0xe861('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe861('0x23'),'userProfileId':_0x1f553f[_0xe861('0x55')]},'raw':!![]})['then'](function(_0xdb0771){if(_0xdb0771&&_0xdb0771[_0xe861('0x56')]===0x0){return db[_0xe861('0x24')][_0xe861('0x4a')]({'name':_0x5a514a['name'],'resourceId':_0x5a514a['id'],'type':_0xdb0771[_0xe861('0x26')],'sectionId':_0xdb0771['id']},{})[_0xe861('0x20')](function(){return _0x168bbb;});}else{return _0x168bbb;}})[_0xe861('0x45')](function(_0x1e8c36){logger['error'](_0xe861('0x57'),_0x1e8c36);});}return _0x168bbb;});})['then'](respondWithResult(_0x34ae97,0xc9))[_0xe861('0x45')](handleError(_0x34ae97,null));};exports[_0xe861('0x21')]=function(_0x29a5dd,_0x378da4,_0x4376c6){var _0x4fbff7;return db[_0xe861('0x29')]['find']({'where':{'id':_0x29a5dd['params']['id']}})['then'](function(_0x4d51c3){if(_0x4d51c3){return db[_0xe861('0x4b')]['transaction'](function(_0x40f2e9){return _0x4d51c3[_0xe861('0x21')]({'transaction':_0x40f2e9,'raw':!![]})[_0xe861('0x20')](function(_0x477818){if(_0x477818[_0xe861('0x4e')]){fs['readdirSync'](_0x477818[_0xe861('0x4e')])[_0xe861('0x58')](function(_0x4525d5){fs[_0xe861('0x59')](path[_0xe861('0x4f')](_0x477818[_0xe861('0x4e')],_0x4525d5));});fs[_0xe861('0x5a')](_0x477818['directory']);}return _0x477818;});})[_0xe861('0x45')](function(_0x3c8f97){throw new db['Sequelize'][(_0xe861('0x5b'))](_0x3c8f97[_0xe861('0x5c')]);});}})[_0xe861('0x20')](handleEntityNotFound(_0x378da4,null))[_0xe861('0x20')](removeEntity(_0x378da4,null))['catch'](handleError(_0x378da4,null));};exports[_0xe861('0x5d')]=function(_0x4bf9f4,_0x461d4d,_0x4e7c80){return db['sequelize']['transaction'](function(_0x54c430){var _0x5af745;return db['VoiceMusicOnHold'][_0xe861('0x5e')]({'where':{'id':_0x4bf9f4[_0xe861('0x47')]['id']}})['then'](function(_0x2912ed){if(_0x2912ed){_0x5af745=_0x2912ed;return _0x2912ed[_0xe861('0x5d')](_0x4bf9f4['body']['id'],{'transaction':_0x54c430});}})[_0xe861('0x20')](function(_0x2694c2){if(_0x2694c2){return db['Sound'][_0xe861('0x5f')]({'where':{'id':_0x4bf9f4['body']['id']},'attributes':['id','name',_0xe861('0x60'),_0xe861('0x61'),_0xe861('0x62')],'raw':!![]});}})[_0xe861('0x20')](function(_0x3195d9){if(_0x3195d9){var _0x48cfb8=path[_0xe861('0x4f')](config['root'],_0xe861('0x63'),util['format'](_0xe861('0x64'),path['basename'](_0x3195d9[_0xe861('0x60')],path[_0xe861('0x65')](_0x3195d9[_0xe861('0x60')])),_0x3195d9['converted_format']));var _0x5a51fa=path[_0xe861('0x4f')](config[_0xe861('0x50')],'server/files/moh',_0x5af745[_0xe861('0x26')],util['format'](_0xe861('0x64'),_0x3195d9['name'],_0x3195d9[_0xe861('0x61')]));fs[_0xe861('0x66')](_0x48cfb8,_0x5a51fa);return _0x3195d9;}})['catch'](function(_0x4bf74b){throw new db[(_0xe861('0x67'))]['ValidationError'](_0x4bf74b[_0xe861('0x5c')]);});})[_0xe861('0x20')](handleEntityNotFound(_0x461d4d,null))['then'](respondWithResult(_0x461d4d,0xc9))[_0xe861('0x45')](handleError(_0x461d4d,null));};exports[_0xe861('0x68')]=function(_0x20c1d2,_0x244d99,_0x213e91){return db[_0xe861('0x4b')][_0xe861('0x4c')](function(_0x2a14f0){var _0x240f82;return db[_0xe861('0x29')][_0xe861('0x5f')]({'where':{'id':_0x20c1d2['params']['id']}})[_0xe861('0x20')](handleEntityNotFound(_0x244d99,null))[_0xe861('0x20')](function(_0x2fb53f){if(_0x2fb53f){_0x240f82=_0x2fb53f;return _0x2fb53f[_0xe861('0x68')](_0x20c1d2[_0xe861('0x47')][_0xe861('0x69')]);}})[_0xe861('0x20')](function(_0x60d67b){if(_0x60d67b){return db[_0xe861('0x6a')][_0xe861('0x5f')]({'where':{'id':_0x20c1d2[_0xe861('0x47')][_0xe861('0x69')]},'attributes':['id',_0xe861('0x26'),_0xe861('0x60'),_0xe861('0x61'),_0xe861('0x62')],'raw':!![]});}})[_0xe861('0x20')](function(_0x2445a8){if(_0x2445a8){fs[_0xe861('0x59')](path[_0xe861('0x4f')](_0x240f82[_0xe861('0x4e')],util[_0xe861('0x6b')](_0xe861('0x64'),_0x2445a8[_0xe861('0x26')],_0x2445a8['converted_format'])));return _0x2445a8;}})['catch'](function(_0x5c7673){throw new db['Sequelize']['ValidationError'](_0x5c7673[_0xe861('0x5c')]);});})['then'](handleEntityNotFound(_0x244d99,null))[_0xe861('0x20')](respondWithStatusCode(_0x244d99,0xcc))[_0xe861('0x45')](handleError(_0x244d99,null));};exports[_0xe861('0x6c')]=function(_0x49bebd,_0x46c556,_0x428a90){var _0x516e25={};var _0xc0a24={};var _0x565b07;var _0x47a178;return db[_0xe861('0x29')][_0xe861('0x5f')]({'where':{'id':_0x49bebd[_0xe861('0x47')]['id']}})[_0xe861('0x20')](handleEntityNotFound(_0x46c556,null))['then'](function(_0xda1a85){if(_0xda1a85){_0x565b07=_0xda1a85;_0xc0a24[_0xe861('0x2e')]=_[_0xe861('0x30')](db[_0xe861('0x6a')][_0xe861('0x2a')]);_0xc0a24[_0xe861('0x31')]=_[_0xe861('0x30')](_0x49bebd[_0xe861('0x31')]);_0xc0a24['filters']=_['intersection'](_0xc0a24[_0xe861('0x2e')],_0xc0a24['query']);_0x516e25['attributes']=_[_0xe861('0x33')](_0xc0a24['model'],qs[_0xe861('0x34')](_0x49bebd[_0xe861('0x31')][_0xe861('0x34')]));_0x516e25[_0xe861('0x36')]=_0x516e25[_0xe861('0x36')][_0xe861('0x35')]?_0x516e25[_0xe861('0x36')]:_0xc0a24['model'];_0x516e25[_0xe861('0x39')]=qs['sort'](_0x49bebd[_0xe861('0x31')][_0xe861('0x3a')]);_0x516e25[_0xe861('0x3b')]=qs['filters'](_[_0xe861('0x3c')](_0x49bebd[_0xe861('0x31')],_0xc0a24[_0xe861('0x32')]));if(_0x49bebd[_0xe861('0x31')][_0xe861('0x3f')]){_0x516e25['where']=_[_0xe861('0x3d')](_0x516e25[_0xe861('0x3b')],{'$or':_[_0xe861('0x2f')](_0x516e25[_0xe861('0x36')],function(_0x1bb3d8){var _0x282f6c={};_0x282f6c[_0x1bb3d8]={'$like':'%'+_0x49bebd['query'][_0xe861('0x3f')]+'%'};return _0x282f6c;})});}_0x516e25=_[_0xe861('0x3d')]({},_0x516e25,_0x49bebd[_0xe861('0x40')]);return _0x565b07['getSounds'](_0x516e25);}})['then'](function(_0x391aa3){if(_0x391aa3){_0x47a178=_0x391aa3[_0xe861('0x35')];if(!_0x49bebd['query'][_0xe861('0x37')](_0xe861('0x38'))){_0x516e25[_0xe861('0x1b')]=qs[_0xe861('0x1b')](_0x49bebd[_0xe861('0x31')]['limit']);_0x516e25['offset']=qs[_0xe861('0x19')](_0x49bebd[_0xe861('0x31')][_0xe861('0x19')]);}return _0x565b07[_0xe861('0x6c')](_0x516e25);}})[_0xe861('0x20')](function(_0x233240){if(_0x233240){return _0x233240?{'count':_0x47a178,'rows':_0x233240}:null;}})[_0xe861('0x20')](respondWithResult(_0x46c556,null))[_0xe861('0x45')](handleError(_0x46c556,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 73b37cb..5362853 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 _0x7565=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold'];(function(_0x2ab914,_0x210788){var _0x35c276=function(_0x2b79d0){while(--_0x2b79d0){_0x2ab914['push'](_0x2ab914['shift']());}};_0x35c276(++_0x210788);}(_0x7565,0x1ce));var _0x5756=function(_0x39166a,_0x18cc82){_0x39166a=_0x39166a-0x0;var _0x4c8d11=_0x7565[_0x39166a];return _0x4c8d11;};'use strict';var _=require(_0x5756('0x0'));var util=require(_0x5756('0x1'));var logger=require('../../config/logger')(_0x5756('0x2'));var moment=require(_0x5756('0x3'));var BPromise=require(_0x5756('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5756('0x5'));var rimraf=require(_0x5756('0x6'));var config=require(_0x5756('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x5756('0x8')]=function(_0x2e151e,_0x484278){return _0x2e151e[_0x5756('0x9')](_0x5756('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5783=['path','rimraf','./voiceMusicOnHold.attributes','exports','define','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4fabfe,_0x53487c){var _0x112eaf=function(_0xea02c3){while(--_0xea02c3){_0x4fabfe['push'](_0x4fabfe['shift']());}};_0x112eaf(++_0x53487c);}(_0x5783,0x177));var _0x3578=function(_0x1aea05,_0x1ac65c){_0x1aea05=_0x1aea05-0x0;var _0x33a8af=_0x5783[_0x1aea05];return _0x33a8af;};'use strict';var _=require('lodash');var util=require(_0x3578('0x0'));var logger=require(_0x3578('0x1'))('api');var moment=require(_0x3578('0x2'));var BPromise=require(_0x3578('0x3'));var rp=require(_0x3578('0x4'));var fs=require('fs');var path=require(_0x3578('0x5'));var rimraf=require(_0x3578('0x6'));var config=require('../../config/environment');var attributes=require(_0x3578('0x7'));module[_0x3578('0x8')]=function(_0x5b56ca,_0x35b43d){return _0x5b56ca[_0x3578('0x9')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','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 03685d1..3557a0c 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 _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(_0x527faa,_0x2ed441){var _0x25eba9=function(_0x13f2b8){while(--_0x13f2b8){_0x527faa['push'](_0x527faa['shift']());}};_0x25eba9(++_0x2ed441);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x138c4c,_0x5693fa){var _0x57af3d=function(_0x1b229d){while(--_0x1b229d){_0x138c4c['push'](_0x138c4c['shift']());}};_0x57af3d(++_0x5693fa);}(_0xedd9,0xfc));var _0x9edd=function(_0x224090,_0x38f7e4){_0x224090=_0x224090-0x0;var _0xd97361=_0xedd9[_0x224090];return _0xd97361;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 21a30d6..6d47c6f 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 _0xa4de=['isAuthenticated','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voicePrefix.controller','get'];(function(_0xd1793a,_0x5563fd){var _0x5b321=function(_0x52b983){while(--_0x52b983){_0xd1793a['push'](_0xd1793a['shift']());}};_0x5b321(++_0x5563fd);}(_0xa4de,0x1d1));var _0xea4d=function(_0x496a45,_0x2de9b2){_0x496a45=_0x496a45-0x0;var _0x5a381f=_0xa4de[_0x496a45];return _0x5a381f;};'use strict';var multer=require(_0xea4d('0x0'));var util=require(_0xea4d('0x1'));var path=require(_0xea4d('0x2'));var timeout=require(_0xea4d('0x3'));var express=require(_0xea4d('0x4'));var router=express[_0xea4d('0x5')]();var fs_extra=require(_0xea4d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xea4d('0x7'));var controller=require(_0xea4d('0x8'));router[_0xea4d('0x9')]('/',auth[_0xea4d('0xa')](),controller['index']);router[_0xea4d('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xea4d('0xb')]);router['get'](_0xea4d('0xc'),auth[_0xea4d('0xa')](),controller[_0xea4d('0xd')]);router['get'](_0xea4d('0xe'),auth[_0xea4d('0xa')](),controller[_0xea4d('0xf')]);router[_0xea4d('0x10')]('/',auth[_0xea4d('0xa')](),controller[_0xea4d('0x11')]);router[_0xea4d('0x10')](_0xea4d('0xe'),auth[_0xea4d('0xa')](),controller[_0xea4d('0x12')]);router[_0xea4d('0x13')](_0xea4d('0xc'),auth['isAuthenticated'](),controller[_0xea4d('0x14')]);router['delete'](_0xea4d('0xc'),auth[_0xea4d('0xa')](),controller[_0xea4d('0x15')]);router[_0xea4d('0x16')](_0xea4d('0xe'),auth[_0xea4d('0xa')](),controller[_0xea4d('0x17')]);module[_0xea4d('0x18')]=router; \ No newline at end of file +var _0xf326=['../../components/interaction/service','./voicePrefix.controller','index','get','/describe','isAuthenticated','describe','show','/:id/users','getAgents','post','create','addAgents','/:id','update','delete','destroy','removeAgents','exports','util','connect-timeout','express','../../components/auth/service'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xf326,0xcb));var _0x6f32=function(_0x3c1304,_0x219ae5){_0x3c1304=_0x3c1304-0x0;var _0x11b071=_0xf326[_0x3c1304];return _0x11b071;};'use strict';var multer=require('multer');var util=require(_0x6f32('0x0'));var path=require('path');var timeout=require(_0x6f32('0x1'));var express=require(_0x6f32('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6f32('0x3'));var interaction=require(_0x6f32('0x4'));var config=require('../../config/environment');var controller=require(_0x6f32('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6f32('0x6')]);router[_0x6f32('0x7')](_0x6f32('0x8'),auth[_0x6f32('0x9')](),controller[_0x6f32('0xa')]);router[_0x6f32('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6f32('0xb')]);router[_0x6f32('0x7')](_0x6f32('0xc'),auth['isAuthenticated'](),controller[_0x6f32('0xd')]);router[_0x6f32('0xe')]('/',auth[_0x6f32('0x9')](),controller[_0x6f32('0xf')]);router[_0x6f32('0xe')](_0x6f32('0xc'),auth[_0x6f32('0x9')](),controller[_0x6f32('0x10')]);router['put'](_0x6f32('0x11'),auth[_0x6f32('0x9')](),controller[_0x6f32('0x12')]);router[_0x6f32('0x13')](_0x6f32('0x11'),auth['isAuthenticated'](),controller[_0x6f32('0x14')]);router[_0x6f32('0x13')](_0x6f32('0xc'),auth[_0x6f32('0x9')](),controller[_0x6f32('0x15')]);module[_0x6f32('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index bf53c1b..1114003 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 _0x2ac9=['VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x21e89e,_0x10fb19){var _0x5b1e25=function(_0x196574){while(--_0x196574){_0x21e89e['push'](_0x21e89e['shift']());}};_0x5b1e25(++_0x10fb19);}(_0x2ac9,0x10c));var _0x92ac=function(_0x30c71b,_0x30da84){_0x30c71b=_0x30c71b-0x0;var _0x21914b=_0x2ac9[_0x30c71b];return _0x21914b;};'use strict';var Sequelize=require(_0x92ac('0x0'));module[_0x92ac('0x1')]={'name':{'type':Sequelize[_0x92ac('0x2')],'allowNull':![],'unique':_0x92ac('0x3')},'prefix':{'type':Sequelize[_0x92ac('0x4')],'get':function(_0x15640f){return _0x92ac('0x5')+this[_0x92ac('0x6')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x92ac('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x92ac('0x7')]}}; \ No newline at end of file +var _0xfd9f=['INTEGER','exports','name','getDataValue','STRING'];(function(_0x5bb60a,_0x23fde5){var _0x72482d=function(_0x4c67f8){while(--_0x4c67f8){_0x5bb60a['push'](_0x5bb60a['shift']());}};_0x72482d(++_0x23fde5);}(_0xfd9f,0x1af));var _0xffd9=function(_0x174160,_0x3df8f4){_0x174160=_0x174160-0x0;var _0x3c85ee=_0xfd9f[_0x174160];return _0x3c85ee;};'use strict';var Sequelize=require('sequelize');module[_0xffd9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xffd9('0x1')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x26744e){return'system-'+this[_0xffd9('0x2')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xffd9('0x3')]},'VoiceExtensionId':{'type':Sequelize[_0xffd9('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index e1289ec..d224671 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 _0x3306=['callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','User','hasOwnProperty','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','VoicePrefixes','UserProfileResource','sendStatus','stack','name','send','VoicePrefix','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','options','includeAll','include','catch','show','params','find','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)='];(function(_0x265dcb,_0x43d7d4){var _0x28fac1=function(_0x15a435){while(--_0x15a435){_0x265dcb['push'](_0x265dcb['shift']());}};_0x28fac1(++_0x43d7d4);}(_0x3306,0x107));var _0x6330=function(_0x4d6c70,_0x395db1){_0x4d6c70=_0x4d6c70-0x0;var _0x3470f3=_0x3306[_0x4d6c70];return _0x3470f3;};'use strict';var emlformat=require(_0x6330('0x0'));var rimraf=require(_0x6330('0x1'));var zipdir=require(_0x6330('0x2'));var jsonpatch=require(_0x6330('0x3'));var rp=require('request-promise');var moment=require(_0x6330('0x4'));var BPromise=require(_0x6330('0x5'));var Mustache=require(_0x6330('0x6'));var util=require(_0x6330('0x7'));var path=require(_0x6330('0x8'));var sox=require('sox');var csv=require(_0x6330('0x9'));var ejs=require(_0x6330('0xa'));var fs=require('fs');var fs_extra=require(_0x6330('0xb'));var _=require(_0x6330('0xc'));var squel=require(_0x6330('0xd'));var crypto=require(_0x6330('0xe'));var jsforce=require(_0x6330('0xf'));var deskjs=require(_0x6330('0x10'));var toCsv=require(_0x6330('0x9'));var querystring=require(_0x6330('0x11'));var Papa=require('papaparse');var Redis=require(_0x6330('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6330('0x13'));var as=require(_0x6330('0x14'));var hardwareService=require(_0x6330('0x15'));var logger=require(_0x6330('0x16'))(_0x6330('0x17'));var utils=require(_0x6330('0x18'));var config=require(_0x6330('0x19'));var licenseUtil=require(_0x6330('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6330('0x1b')](config[_0x6330('0x1c')],{'host':_0x6330('0x1d'),'port':0x18eb});var socket=require(_0x6330('0x1e'))(new Redis(config[_0x6330('0x1c')]));require('./voicePrefix.socket')[_0x6330('0x1f')](socket);function respondWithStatusCode(_0x38367a,_0x11306d){_0x11306d=_0x11306d||0xcc;return function(_0xd5cf27){if(_0xd5cf27){return _0x38367a['sendStatus'](_0x11306d);}return _0x38367a['status'](_0x11306d)[_0x6330('0x20')]();};}function respondWithResult(_0x476774,_0x3c3fac){_0x3c3fac=_0x3c3fac||0xc8;return function(_0x5b155d){if(_0x5b155d){return _0x476774[_0x6330('0x21')](_0x3c3fac)[_0x6330('0x22')](_0x5b155d);}};}function respondWithFilteredResult(_0x5a643e,_0x5c35fa){return function(_0x348b34){if(_0x348b34){var _0x29fd07=typeof _0x5c35fa[_0x6330('0x23')]===_0x6330('0x24')&&typeof _0x5c35fa[_0x6330('0x25')]===_0x6330('0x24');var _0xfbafd6=_0x348b34[_0x6330('0x26')];var _0x1080e9=_0x29fd07?0x0:_0x5c35fa[_0x6330('0x23')];var _0x55790e=_0x29fd07?_0x348b34[_0x6330('0x26')]:_0x5c35fa[_0x6330('0x23')]+_0x5c35fa[_0x6330('0x25')];var _0x3c8ce5;if(_0x55790e>=_0xfbafd6){_0x55790e=_0xfbafd6;_0x3c8ce5=0xc8;}else{_0x3c8ce5=0xce;}_0x5a643e[_0x6330('0x21')](_0x3c8ce5);return _0x5a643e['set'](_0x6330('0x27'),_0x1080e9+'-'+_0x55790e+'/'+_0xfbafd6)[_0x6330('0x22')](_0x348b34);}return null;};}function patchUpdates(_0x282809){return function(_0x1a6169){try{jsonpatch[_0x6330('0x28')](_0x1a6169,_0x282809,!![]);}catch(_0x186b91){return BPromise['reject'](_0x186b91);}return _0x1a6169['save']();};}function saveUpdates(_0x59144c,_0xd535b9){return function(_0x3f5ee7){if(_0x3f5ee7){return _0x3f5ee7[_0x6330('0x29')](_0x59144c)[_0x6330('0x2a')](function(_0x5899f8){return _0x5899f8;});}return null;};}function removeEntity(_0x10ea33,_0x25aa25){return function(_0xba8b22){if(_0xba8b22){return _0xba8b22[_0x6330('0x2b')]()[_0x6330('0x2a')](function(){var _0x4cf9d9=_0xba8b22['get']({'plain':!![]});var _0x255861=_0x6330('0x2c');return db[_0x6330('0x2d')]['destroy']({'where':{'type':_0x255861,'resourceId':_0x4cf9d9['id']}})[_0x6330('0x2a')](function(){return _0xba8b22;});})[_0x6330('0x2a')](function(){_0x10ea33[_0x6330('0x21')](0xcc)[_0x6330('0x20')]();});}};}function handleEntityNotFound(_0x4a55c4,_0x46011b){return function(_0x50ab51){if(!_0x50ab51){_0x4a55c4[_0x6330('0x2e')](0x194);}return _0x50ab51;};}function handleError(_0x43799b,_0x366232){_0x366232=_0x366232||0x1f4;return function(_0x3e8efc){logger['error'](_0x3e8efc[_0x6330('0x2f')]);if(_0x3e8efc[_0x6330('0x30')]){delete _0x3e8efc[_0x6330('0x30')];}_0x43799b[_0x6330('0x21')](_0x366232)[_0x6330('0x31')](_0x3e8efc);};}exports['index']=function(_0x40514b,_0x47ce15){var _0xaaf11d={},_0x5d01b3={},_0x1ccca0={'count':0x0,'rows':[]};var _0x4e9a28=_['map'](db[_0x6330('0x32')][_0x6330('0x33')],function(_0x2cff0f){return{'name':_0x2cff0f[_0x6330('0x34')],'type':_0x2cff0f[_0x6330('0x35')][_0x6330('0x36')]};});_0x5d01b3[_0x6330('0x37')]=_[_0x6330('0x38')](_0x4e9a28,_0x6330('0x30'));_0x5d01b3[_0x6330('0x39')]=_[_0x6330('0x3a')](_0x40514b[_0x6330('0x39')]);_0x5d01b3['filters']=_[_0x6330('0x3b')](_0x5d01b3['model'],_0x5d01b3[_0x6330('0x39')]);_0xaaf11d[_0x6330('0x3c')]=_[_0x6330('0x3b')](_0x5d01b3[_0x6330('0x37')],qs[_0x6330('0x3d')](_0x40514b[_0x6330('0x39')][_0x6330('0x3d')]));_0xaaf11d[_0x6330('0x3c')]=_0xaaf11d[_0x6330('0x3c')][_0x6330('0x3e')]?_0xaaf11d['attributes']:_0x5d01b3[_0x6330('0x37')];if(!_0x40514b[_0x6330('0x39')]['hasOwnProperty']('nolimit')){_0xaaf11d[_0x6330('0x25')]=qs['limit'](_0x40514b[_0x6330('0x39')][_0x6330('0x25')]);_0xaaf11d[_0x6330('0x23')]=qs[_0x6330('0x23')](_0x40514b[_0x6330('0x39')][_0x6330('0x23')]);}_0xaaf11d[_0x6330('0x3f')]=qs[_0x6330('0x40')](_0x40514b['query'][_0x6330('0x40')]);_0xaaf11d[_0x6330('0x41')]=qs[_0x6330('0x42')](_['pick'](_0x40514b['query'],_0x5d01b3[_0x6330('0x42')]),_0x4e9a28);if(_0x40514b[_0x6330('0x39')][_0x6330('0x43')]){_0xaaf11d['where']=_['merge'](_0xaaf11d['where'],{'$or':_['map'](_0x4e9a28,function(_0x57c19b){if(_0x57c19b[_0x6330('0x35')]!=='VIRTUAL'){var _0x4909f2={};_0x4909f2[_0x57c19b[_0x6330('0x30')]]={'$like':'%'+_0x40514b[_0x6330('0x39')][_0x6330('0x43')]+'%'};return _0x4909f2;}})});}_0xaaf11d=_[_0x6330('0x44')]({},_0xaaf11d,_0x40514b[_0x6330('0x45')]);var _0x146459={'where':_0xaaf11d[_0x6330('0x41')]};return db[_0x6330('0x32')][_0x6330('0x26')](_0x146459)[_0x6330('0x2a')](function(_0x531c8a){_0x1ccca0[_0x6330('0x26')]=_0x531c8a;if(_0x40514b[_0x6330('0x39')][_0x6330('0x46')]){_0xaaf11d[_0x6330('0x47')]=[{'all':!![]}];}return db[_0x6330('0x32')]['findAll'](_0xaaf11d);})[_0x6330('0x2a')](function(_0x10811e){_0x1ccca0['rows']=_0x10811e;return _0x1ccca0;})[_0x6330('0x2a')](respondWithFilteredResult(_0x47ce15,_0xaaf11d))[_0x6330('0x48')](handleError(_0x47ce15,null));};exports[_0x6330('0x49')]=function(_0x5aaea3,_0x1fc396){var _0x233ac5={'raw':![],'where':{'id':_0x5aaea3[_0x6330('0x4a')]['id']}},_0x1a24c4={};_0x1a24c4[_0x6330('0x37')]=_['keys'](db[_0x6330('0x32')][_0x6330('0x33')]);_0x1a24c4[_0x6330('0x39')]=_[_0x6330('0x3a')](_0x5aaea3[_0x6330('0x39')]);_0x1a24c4[_0x6330('0x42')]=_[_0x6330('0x3b')](_0x1a24c4['model'],_0x1a24c4[_0x6330('0x39')]);_0x233ac5[_0x6330('0x3c')]=_['intersection'](_0x1a24c4['model'],qs['fields'](_0x5aaea3[_0x6330('0x39')]['fields']));_0x233ac5[_0x6330('0x3c')]=_0x233ac5['attributes']['length']?_0x233ac5[_0x6330('0x3c')]:_0x1a24c4[_0x6330('0x37')];if(_0x5aaea3[_0x6330('0x39')][_0x6330('0x46')]){_0x233ac5['include']=[{'all':!![]}];}_0x233ac5=_[_0x6330('0x44')]({},_0x233ac5,_0x5aaea3[_0x6330('0x45')]);return db['VoicePrefix'][_0x6330('0x4b')](_0x233ac5)['then'](handleEntityNotFound(_0x1fc396,null))[_0x6330('0x2a')](respondWithResult(_0x1fc396,null))[_0x6330('0x48')](handleError(_0x1fc396,null));};exports[_0x6330('0x2b')]=function(_0x203d86,_0x395f11){return db[_0x6330('0x32')][_0x6330('0x4b')]({'where':{'id':_0x203d86['params']['id']}})[_0x6330('0x2a')](handleEntityNotFound(_0x395f11,null))[_0x6330('0x2a')](removeEntity(_0x395f11,null))[_0x6330('0x48')](handleError(_0x395f11,null));};exports['describe']=function(_0x3365a0,_0x4a1af6){return db[_0x6330('0x32')]['describe']()[_0x6330('0x2a')](respondWithResult(_0x4a1af6,null))[_0x6330('0x48')](handleError(_0x4a1af6,null));};exports[_0x6330('0x4c')]=function(_0xcefa3c,_0xb0e9cc){var _0x59c5e4;return db[_0x6330('0x4d')][_0x6330('0x4e')](function(_0x1c6fda){return db[_0x6330('0x32')][_0x6330('0x4c')](_0xcefa3c[_0x6330('0x4f')],{'transaction':_0x1c6fda})['then'](function(_0x471df6){_0x59c5e4=_0x471df6[_0x6330('0x50')]({'plain':!![]});return db[_0x6330('0x51')][_0x6330('0x4b')]({'where':{'id':_0x59c5e4[_0x6330('0x52')]},'raw':!![]})[_0x6330('0x2a')](function(_0x54010d){return createVoicePrefixExtensions(_0x59c5e4,_0x54010d,_0x1c6fda);});});})[_0x6330('0x2a')](function(){var _0x1ff69b=_0xcefa3c[_0x6330('0x53')][_0x6330('0x50')]({'plain':!![]});if(!_0x1ff69b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ff69b[_0x6330('0x54')]==='user'){var _0xa4c663=_0x59c5e4;return db[_0x6330('0x55')][_0x6330('0x4b')]({'where':{'name':'VoicePrefixes','userProfileId':_0x1ff69b[_0x6330('0x56')]},'raw':!![]})[_0x6330('0x2a')](function(_0x451db0){if(_0x451db0&&_0x451db0[_0x6330('0x57')]===0x0){return db[_0x6330('0x2d')][_0x6330('0x4c')]({'name':_0xa4c663['name'],'resourceId':_0xa4c663['id'],'type':_0x451db0[_0x6330('0x30')],'sectionId':_0x451db0['id']},{})['then'](function(){return _0x59c5e4;});}else{return _0x59c5e4;}})['catch'](function(_0xfa70bf){logger[_0x6330('0x58')](_0x6330('0x59'),_0xfa70bf);throw _0xfa70bf;});}return _0x59c5e4;})[_0x6330('0x2a')](respondWithResult(_0xb0e9cc,null))['catch'](handleError(_0xb0e9cc,null));};function Extension(_0x223609,_0x5cad4b,_0x1067f1,_0x6f6cf6){this[_0x6330('0x5a')]=_0x6330('0x5b');this['exten']=_0x223609;this[_0x6330('0x5c')]=_0x1067f1;this['type']=_0x6330('0x5d');this[_0x6330('0x5e')]=_0x6330('0x5f');this[_0x6330('0x60')]=_0x5cad4b;this[_0x6330('0x61')]=_0x6f6cf6;}function createVoicePrefixExtensions(_0x5ed34a,_0x527fdd,_0x84fa67){return new BPromise(function(_0x5c2b87,_0x7feb12){var _0x4850f8=new Extension(formatPrefixName(_0x5ed34a[_0x6330('0x62')]),0x1,_0x6330('0x63'),_0x6330('0x64'));_0x4850f8[_0x6330('0x65')]=_0x5ed34a['id'];return db['VoiceExtension'][_0x6330('0x4c')](_0x4850f8,{'transaction':_0x84fa67})[_0x6330('0x2a')](function(_0x884f74){var _0x2af99b=_0x884f74[_0x6330('0x50')]({'plain':!![]});var _0x5c57e7=_[_0x6330('0x38')](addVoicePrefixExtensions(_0x5ed34a,_0x527fdd),function(_0x139ace){_0x139ace[_0x6330('0x52')]=_0x2af99b['id'];_0x139ace[_0x6330('0x65')]=_0x5ed34a['id'];return _0x139ace;});return db[_0x6330('0x51')][_0x6330('0x66')](_0x5c57e7,{'transaction':_0x84fa67})[_0x6330('0x2a')](function(_0x44a035){if(!_0x44a035){return _0x7feb12('Extensions\x20creation\x20failed');}else{return _0x5c2b87(_0x44a035);}})[_0x6330('0x48')](function(_0x2eece8){return _0x7feb12(_0x2eece8);});});;});};function addVoicePrefixExtensions(_0x57893f,_0x39a46f){var _0x476790=[];var _0x20758e=formatPrefixName(_0x57893f['prefix']);_0x476790[_0x6330('0x67')](new Extension(_0x20758e,0x2,_0x6330('0x68'),_0x6330('0x69')+_0x57893f['name']));if(_0x57893f[_0x6330('0x6a')]){_0x476790['push'](new Extension(_0x20758e,0x3,_0x6330('0x68'),_0x6330('0x6b')+_0x57893f[_0x6330('0x6a')]));}else{_0x476790[_0x6330('0x67')](new Extension(_0x20758e,0x3,_0x6330('0x63'),'No\x20callerid\x20available'));}_0x476790['push'](new Extension(_0x20758e,0x4,_0x6330('0x6c'),_0x39a46f[_0x6330('0x5a')]+','+_0x6330('0x6d')+(0x8+_0x57893f[_0x6330('0x30')][_0x6330('0x3e')])+'}'+','+0x1));return _0x476790;}function formatPrefixName(_0x236d5d){var _0xd154cb='_';for(var _0x5a5c7f=0x0;_0x5a5c7f<_0x236d5d['length'];_0x5a5c7f++){if(_0x236d5d[_0x6330('0x6e')](_0x5a5c7f)=='-'){_0xd154cb+=_0x236d5d[_0x6330('0x6e')](_0x5a5c7f);}else{_0xd154cb+='['+_0x236d5d[_0x6330('0x6e')](_0x5a5c7f)+']';}}_0xd154cb+='.';return _0xd154cb;}exports[_0x6330('0x29')]=function(_0x8daa8,_0xd1992b,_0x1531db){var _0x285a49=_0x8daa8[_0x6330('0x4f')];_0x285a49['prefix']=_0x6330('0x6f')+_0x285a49[_0x6330('0x30')]+'-';return db['sequelize'][_0x6330('0x4e')](function(_0x175935){return db[_0x6330('0x32')][_0x6330('0x29')](_0x285a49,{'where':{'id':_0x285a49['id']},'transaction':_0x175935})[_0x6330('0x2a')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x285a49['id']},'transaction':_0x175935})['then'](function(){return db[_0x6330('0x51')][_0x6330('0x4b')]({'where':{'id':_0x285a49[_0x6330('0x52')]},'raw':!![]})[_0x6330('0x2a')](function(_0x511ef7){return createVoicePrefixExtensions(_0x285a49,_0x511ef7,_0x175935);});});});})[_0x6330('0x2a')](function(){return db[_0x6330('0x32')]['findById'](_0x285a49['id']);})[_0x6330('0x2a')](respondWithResult(_0xd1992b,null))[_0x6330('0x48')](handleError(_0xd1992b,null));};exports[_0x6330('0x70')]=function(_0x18bfd5,_0x5a2e42,_0x2b4c6f){return db[_0x6330('0x32')]['find']({'where':{'id':_0x18bfd5[_0x6330('0x4a')]['id']}})[_0x6330('0x2a')](handleEntityNotFound(_0x5a2e42,null))[_0x6330('0x2a')](function(_0x2a2afe){if(_0x2a2afe){return _0x2a2afe[_0x6330('0x70')](_0x18bfd5['body'][_0x6330('0x71')],_[_0x6330('0x72')](_0x18bfd5[_0x6330('0x4f')],[_0x6330('0x71'),'id'])||{})[_0x6330('0x73')](function(_0x4a7eef){for(var _0x20f89d=0x0;_0x20f89d<_0x18bfd5[_0x6330('0x4f')][_0x6330('0x71')][_0x6330('0x3e')];_0x20f89d+=0x1){socket['emit'](_0x6330('0x74'),{'UserId':Number(_0x18bfd5[_0x6330('0x4f')][_0x6330('0x71')][_0x20f89d]),'VoicePrefixId':Number(_0x18bfd5[_0x6330('0x4a')]['id'])});}return _0x4a7eef;});}})[_0x6330('0x2a')](respondWithResult(_0x5a2e42,null))[_0x6330('0x48')](handleError(_0x5a2e42,null));};exports['removeAgents']=function(_0x53f521,_0x2237d1,_0x2a8ddf){return db[_0x6330('0x32')][_0x6330('0x4b')]({'where':{'id':_0x53f521[_0x6330('0x4a')]['id']}})[_0x6330('0x2a')](handleEntityNotFound(_0x2237d1,null))['then'](function(_0x4ce7ce){if(_0x4ce7ce){return _0x4ce7ce[_0x6330('0x75')](_0x53f521[_0x6330('0x39')][_0x6330('0x71')])[_0x6330('0x2a')](function(){if(_['isArray'](_0x53f521[_0x6330('0x39')][_0x6330('0x71')])){for(var _0x2ea26f=0x0;_0x2ea26f<_0x53f521['query'][_0x6330('0x71')][_0x6330('0x3e')];_0x2ea26f+=0x1){socket[_0x6330('0x76')](_0x6330('0x77'),{'UserId':Number(_0x53f521['query'][_0x6330('0x71')][_0x2ea26f]),'VoicePrefixId':Number(_0x53f521[_0x6330('0x4a')]['id'])});}}else{socket[_0x6330('0x76')](_0x6330('0x77'),{'UserId':Number(_0x53f521[_0x6330('0x39')]['ids']),'VoicePrefixId':Number(_0x53f521[_0x6330('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2237d1,null))[_0x6330('0x48')](handleError(_0x2237d1,null));};exports['getAgents']=function(_0x22cc13,_0x34334c,_0x30018b){var _0x556092={};var _0x165535={};var _0x7b5d8e;var _0x31d996;return db[_0x6330('0x32')]['findOne']({'where':{'id':_0x22cc13[_0x6330('0x4a')]['id']}})[_0x6330('0x2a')](handleEntityNotFound(_0x34334c,null))['then'](function(_0x118d77){if(_0x118d77){_0x7b5d8e=_0x118d77;_0x165535[_0x6330('0x37')]=_['keys'](db[_0x6330('0x78')][_0x6330('0x33')]);_0x165535[_0x6330('0x39')]=_[_0x6330('0x3a')](_0x22cc13[_0x6330('0x39')]);_0x165535[_0x6330('0x42')]=_[_0x6330('0x3b')](_0x165535[_0x6330('0x37')],_0x165535['query']);_0x556092[_0x6330('0x3c')]=_[_0x6330('0x3b')](_0x165535[_0x6330('0x37')],qs[_0x6330('0x3d')](_0x22cc13[_0x6330('0x39')][_0x6330('0x3d')]));_0x556092[_0x6330('0x3c')]=_0x556092[_0x6330('0x3c')][_0x6330('0x3e')]?_0x556092['attributes']:_0x165535[_0x6330('0x37')];_0x556092['order']=qs[_0x6330('0x40')](_0x22cc13[_0x6330('0x39')][_0x6330('0x40')]);_0x556092[_0x6330('0x41')]=qs[_0x6330('0x42')](_['pick'](_0x22cc13['query'],_0x165535[_0x6330('0x42')]));if(_0x22cc13[_0x6330('0x39')][_0x6330('0x43')]){_0x556092['where']=_[_0x6330('0x44')](_0x556092['where'],{'$or':_[_0x6330('0x38')](_0x556092['attributes'],function(_0x304c53){var _0x16332f={};_0x16332f[_0x304c53]={'$like':'%'+_0x22cc13[_0x6330('0x39')][_0x6330('0x43')]+'%'};return _0x16332f;})});}_0x556092=_[_0x6330('0x44')]({},_0x556092,_0x22cc13[_0x6330('0x45')]);return _0x7b5d8e['getAgents'](_0x556092);}})[_0x6330('0x2a')](function(_0x19da3b){if(_0x19da3b){_0x31d996=_0x19da3b[_0x6330('0x3e')];if(!_0x22cc13[_0x6330('0x39')][_0x6330('0x79')]('nolimit')){_0x556092[_0x6330('0x25')]=qs[_0x6330('0x25')](_0x22cc13[_0x6330('0x39')][_0x6330('0x25')]);_0x556092[_0x6330('0x23')]=qs['offset'](_0x22cc13['query'][_0x6330('0x23')]);}return _0x7b5d8e[_0x6330('0x7a')](_0x556092);}})['then'](function(_0x2e4293){if(_0x2e4293){return _0x2e4293?{'count':_0x31d996,'rows':_0x2e4293}:null;}})[_0x6330('0x2a')](respondWithResult(_0x34334c,null))[_0x6330('0x48')](handleError(_0x34334c,null));}; \ No newline at end of file +var _0x88b5=['NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','show','params','include','find','catch','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','UserProfileSection','autoAssociation','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority'];(function(_0x294870,_0x35fcdb){var _0x6805e1=function(_0x58ae69){while(--_0x58ae69){_0x294870['push'](_0x294870['shift']());}};_0x6805e1(++_0x35fcdb);}(_0x88b5,0x10f));var _0x588b=function(_0x16773c,_0xf47f89){_0x16773c=_0x16773c-0x0;var _0x4b3bdb=_0x88b5[_0x16773c];return _0x4b3bdb;};'use strict';var emlformat=require(_0x588b('0x0'));var rimraf=require(_0x588b('0x1'));var zipdir=require(_0x588b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x588b('0x3'));var moment=require(_0x588b('0x4'));var BPromise=require(_0x588b('0x5'));var Mustache=require(_0x588b('0x6'));var util=require(_0x588b('0x7'));var path=require(_0x588b('0x8'));var sox=require('sox');var csv=require(_0x588b('0x9'));var ejs=require(_0x588b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x588b('0xb'));var crypto=require(_0x588b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x588b('0xd'));var toCsv=require(_0x588b('0x9'));var querystring=require(_0x588b('0xe'));var Papa=require(_0x588b('0xf'));var Redis=require(_0x588b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x588b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x588b('0x12'));var utils=require(_0x588b('0x13'));var config=require(_0x588b('0x14'));var licenseUtil=require(_0x588b('0x15'));var db=require(_0x588b('0x16'))['db'];config[_0x588b('0x17')]=_[_0x588b('0x18')](config['redis'],{'host':_0x588b('0x19'),'port':0x18eb});var socket=require(_0x588b('0x1a'))(new Redis(config[_0x588b('0x17')]));require(_0x588b('0x1b'))[_0x588b('0x1c')](socket);function respondWithStatusCode(_0x280fc4,_0x1eebe5){_0x1eebe5=_0x1eebe5||0xcc;return function(_0x25d118){if(_0x25d118){return _0x280fc4[_0x588b('0x1d')](_0x1eebe5);}return _0x280fc4[_0x588b('0x1e')](_0x1eebe5)[_0x588b('0x1f')]();};}function respondWithResult(_0x414692,_0x46d556){_0x46d556=_0x46d556||0xc8;return function(_0x48725a){if(_0x48725a){return _0x414692['status'](_0x46d556)[_0x588b('0x20')](_0x48725a);}};}function respondWithFilteredResult(_0x2b9aae,_0x94b52e){return function(_0x2ef1a2){if(_0x2ef1a2){var _0x221220=typeof _0x94b52e[_0x588b('0x21')]==='undefined'&&typeof _0x94b52e[_0x588b('0x22')]===_0x588b('0x23');var _0x6851fd=_0x2ef1a2['count'];var _0x3832d8=_0x221220?0x0:_0x94b52e[_0x588b('0x21')];var _0x20e817=_0x221220?_0x2ef1a2[_0x588b('0x24')]:_0x94b52e[_0x588b('0x21')]+_0x94b52e[_0x588b('0x22')];var _0x2e17f0;if(_0x20e817>=_0x6851fd){_0x20e817=_0x6851fd;_0x2e17f0=0xc8;}else{_0x2e17f0=0xce;}_0x2b9aae['status'](_0x2e17f0);return _0x2b9aae[_0x588b('0x25')]('Content-Range',_0x3832d8+'-'+_0x20e817+'/'+_0x6851fd)[_0x588b('0x20')](_0x2ef1a2);}return null;};}function patchUpdates(_0x232c85){return function(_0x3e7830){try{jsonpatch[_0x588b('0x26')](_0x3e7830,_0x232c85,!![]);}catch(_0x341802){return BPromise[_0x588b('0x27')](_0x341802);}return _0x3e7830[_0x588b('0x28')]();};}function saveUpdates(_0x445312,_0x185df5){return function(_0xd737ba){if(_0xd737ba){return _0xd737ba[_0x588b('0x29')](_0x445312)['then'](function(_0x13885f){return _0x13885f;});}return null;};}function removeEntity(_0x5d0abe,_0x5daf97){return function(_0x521a12){if(_0x521a12){return _0x521a12[_0x588b('0x2a')]()[_0x588b('0x2b')](function(){var _0x258037=_0x521a12[_0x588b('0x2c')]({'plain':!![]});var _0x524a94=_0x588b('0x2d');return db[_0x588b('0x2e')][_0x588b('0x2a')]({'where':{'type':_0x524a94,'resourceId':_0x258037['id']}})['then'](function(){return _0x521a12;});})[_0x588b('0x2b')](function(){_0x5d0abe[_0x588b('0x1e')](0xcc)[_0x588b('0x1f')]();});}};}function handleEntityNotFound(_0x229611,_0x46cd03){return function(_0x386a97){if(!_0x386a97){_0x229611[_0x588b('0x1d')](0x194);}return _0x386a97;};}function handleError(_0x24fca0,_0x5830b9){_0x5830b9=_0x5830b9||0x1f4;return function(_0xddef60){logger[_0x588b('0x2f')](_0xddef60[_0x588b('0x30')]);if(_0xddef60[_0x588b('0x31')]){delete _0xddef60['name'];}_0x24fca0['status'](_0x5830b9)[_0x588b('0x32')](_0xddef60);};}exports[_0x588b('0x33')]=function(_0x326bc4,_0x45e54c){var _0xeb4586={},_0x350df3={},_0x496017={'count':0x0,'rows':[]};var _0x2e8d43=_['map'](db[_0x588b('0x34')][_0x588b('0x35')],function(_0x3ec105){return{'name':_0x3ec105[_0x588b('0x36')],'type':_0x3ec105[_0x588b('0x37')][_0x588b('0x38')]};});_0x350df3[_0x588b('0x39')]=_[_0x588b('0x3a')](_0x2e8d43,_0x588b('0x31'));_0x350df3['query']=_[_0x588b('0x3b')](_0x326bc4[_0x588b('0x3c')]);_0x350df3[_0x588b('0x3d')]=_[_0x588b('0x3e')](_0x350df3['model'],_0x350df3[_0x588b('0x3c')]);_0xeb4586[_0x588b('0x3f')]=_[_0x588b('0x3e')](_0x350df3['model'],qs['fields'](_0x326bc4['query'][_0x588b('0x40')]));_0xeb4586['attributes']=_0xeb4586['attributes'][_0x588b('0x41')]?_0xeb4586[_0x588b('0x3f')]:_0x350df3[_0x588b('0x39')];if(!_0x326bc4[_0x588b('0x3c')][_0x588b('0x42')](_0x588b('0x43'))){_0xeb4586[_0x588b('0x22')]=qs[_0x588b('0x22')](_0x326bc4['query'][_0x588b('0x22')]);_0xeb4586[_0x588b('0x21')]=qs[_0x588b('0x21')](_0x326bc4['query'][_0x588b('0x21')]);}_0xeb4586[_0x588b('0x44')]=qs['sort'](_0x326bc4[_0x588b('0x3c')][_0x588b('0x45')]);_0xeb4586[_0x588b('0x46')]=qs[_0x588b('0x3d')](_['pick'](_0x326bc4['query'],_0x350df3[_0x588b('0x3d')]),_0x2e8d43);if(_0x326bc4[_0x588b('0x3c')][_0x588b('0x47')]){_0xeb4586[_0x588b('0x46')]=_[_0x588b('0x48')](_0xeb4586['where'],{'$or':_[_0x588b('0x3a')](_0x2e8d43,function(_0x2cf2e7){if(_0x2cf2e7[_0x588b('0x37')]!=='VIRTUAL'){var _0x1ca990={};_0x1ca990[_0x2cf2e7[_0x588b('0x31')]]={'$like':'%'+_0x326bc4['query'][_0x588b('0x47')]+'%'};return _0x1ca990;}})});}_0xeb4586=_['merge']({},_0xeb4586,_0x326bc4[_0x588b('0x49')]);var _0x53c4a3={'where':_0xeb4586[_0x588b('0x46')]};return db[_0x588b('0x34')]['count'](_0x53c4a3)[_0x588b('0x2b')](function(_0x33c77f){_0x496017['count']=_0x33c77f;if(_0x326bc4['query'][_0x588b('0x4a')]){_0xeb4586['include']=[{'all':!![]}];}return db[_0x588b('0x34')][_0x588b('0x4b')](_0xeb4586);})[_0x588b('0x2b')](function(_0x18a9c2){_0x496017['rows']=_0x18a9c2;return _0x496017;})[_0x588b('0x2b')](respondWithFilteredResult(_0x45e54c,_0xeb4586))['catch'](handleError(_0x45e54c,null));};exports[_0x588b('0x4c')]=function(_0x49f636,_0x1926da){var _0x2f7a90={'raw':![],'where':{'id':_0x49f636[_0x588b('0x4d')]['id']}},_0x52f86e={};_0x52f86e['model']=_['keys'](db['VoicePrefix'][_0x588b('0x35')]);_0x52f86e[_0x588b('0x3c')]=_[_0x588b('0x3b')](_0x49f636['query']);_0x52f86e[_0x588b('0x3d')]=_[_0x588b('0x3e')](_0x52f86e[_0x588b('0x39')],_0x52f86e[_0x588b('0x3c')]);_0x2f7a90['attributes']=_[_0x588b('0x3e')](_0x52f86e[_0x588b('0x39')],qs[_0x588b('0x40')](_0x49f636[_0x588b('0x3c')][_0x588b('0x40')]));_0x2f7a90['attributes']=_0x2f7a90[_0x588b('0x3f')][_0x588b('0x41')]?_0x2f7a90[_0x588b('0x3f')]:_0x52f86e[_0x588b('0x39')];if(_0x49f636[_0x588b('0x3c')][_0x588b('0x4a')]){_0x2f7a90[_0x588b('0x4e')]=[{'all':!![]}];}_0x2f7a90=_['merge']({},_0x2f7a90,_0x49f636['options']);return db[_0x588b('0x34')][_0x588b('0x4f')](_0x2f7a90)[_0x588b('0x2b')](handleEntityNotFound(_0x1926da,null))[_0x588b('0x2b')](respondWithResult(_0x1926da,null))[_0x588b('0x50')](handleError(_0x1926da,null));};exports[_0x588b('0x2a')]=function(_0x2e2b4a,_0x4f180d){return db['VoicePrefix'][_0x588b('0x4f')]({'where':{'id':_0x2e2b4a[_0x588b('0x4d')]['id']}})[_0x588b('0x2b')](handleEntityNotFound(_0x4f180d,null))[_0x588b('0x2b')](removeEntity(_0x4f180d,null))[_0x588b('0x50')](handleError(_0x4f180d,null));};exports['describe']=function(_0x3d837e,_0x36aa53){return db[_0x588b('0x34')][_0x588b('0x51')]()[_0x588b('0x2b')](respondWithResult(_0x36aa53,null))[_0x588b('0x50')](handleError(_0x36aa53,null));};exports[_0x588b('0x52')]=function(_0x27392a,_0x12dc33){var _0x4500ef;return db[_0x588b('0x53')][_0x588b('0x54')](function(_0x1c5107){return db[_0x588b('0x34')][_0x588b('0x52')](_0x27392a[_0x588b('0x55')],{'transaction':_0x1c5107})['then'](function(_0x37e5da){_0x4500ef=_0x37e5da['get']({'plain':!![]});return db[_0x588b('0x56')][_0x588b('0x4f')]({'where':{'id':_0x4500ef[_0x588b('0x57')]},'raw':!![]})[_0x588b('0x2b')](function(_0x345917){return createVoicePrefixExtensions(_0x4500ef,_0x345917,_0x1c5107);});});})[_0x588b('0x2b')](function(){var _0x3a1ad3=_0x27392a[_0x588b('0x58')][_0x588b('0x2c')]({'plain':!![]});if(!_0x3a1ad3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a1ad3['role']===_0x588b('0x58')){var _0x299330=_0x4500ef;return db[_0x588b('0x59')]['find']({'where':{'name':_0x588b('0x2d'),'userProfileId':_0x3a1ad3['userProfileId']},'raw':!![]})[_0x588b('0x2b')](function(_0x10e468){if(_0x10e468&&_0x10e468[_0x588b('0x5a')]===0x0){return db[_0x588b('0x2e')][_0x588b('0x52')]({'name':_0x299330['name'],'resourceId':_0x299330['id'],'type':_0x10e468['name'],'sectionId':_0x10e468['id']},{})[_0x588b('0x2b')](function(){return _0x4500ef;});}else{return _0x4500ef;}})[_0x588b('0x50')](function(_0x41c369){logger[_0x588b('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41c369);throw _0x41c369;});}return _0x4500ef;})[_0x588b('0x2b')](respondWithResult(_0x12dc33,null))[_0x588b('0x50')](handleError(_0x12dc33,null));};function Extension(_0xf0e0d5,_0x3b0791,_0x2dccb3,_0xeba798){this[_0x588b('0x5b')]=_0x588b('0x5c');this[_0x588b('0x5d')]=_0xf0e0d5;this['app']=_0x2dccb3;this['type']=_0x588b('0x5e');this[_0x588b('0x5f')]=_0x588b('0x60');this[_0x588b('0x61')]=_0x3b0791;this['appdata']=_0xeba798;}function createVoicePrefixExtensions(_0x3d078c,_0x5efa86,_0x37a0d2){return new BPromise(function(_0x24ce26,_0x15e309){var _0x4f5cd0=new Extension(formatPrefixName(_0x3d078c['prefix']),0x1,_0x588b('0x62'),_0x588b('0x63'));_0x4f5cd0[_0x588b('0x64')]=_0x3d078c['id'];return db[_0x588b('0x56')][_0x588b('0x52')](_0x4f5cd0,{'transaction':_0x37a0d2})['then'](function(_0x4b71ec){var _0x2606a9=_0x4b71ec[_0x588b('0x2c')]({'plain':!![]});var _0x1ccbf2=_[_0x588b('0x3a')](addVoicePrefixExtensions(_0x3d078c,_0x5efa86),function(_0x2e0a8b){_0x2e0a8b['VoiceExtensionId']=_0x2606a9['id'];_0x2e0a8b[_0x588b('0x64')]=_0x3d078c['id'];return _0x2e0a8b;});return db[_0x588b('0x56')][_0x588b('0x65')](_0x1ccbf2,{'transaction':_0x37a0d2})[_0x588b('0x2b')](function(_0x3de71e){if(!_0x3de71e){return _0x15e309('Extensions\x20creation\x20failed');}else{return _0x24ce26(_0x3de71e);}})['catch'](function(_0x58b342){return _0x15e309(_0x58b342);});});;});};function addVoicePrefixExtensions(_0xb173d9,_0x38a120){var _0x33455d=[];var _0x5ee378=formatPrefixName(_0xb173d9[_0x588b('0x66')]);_0x33455d[_0x588b('0x67')](new Extension(_0x5ee378,0x2,_0x588b('0x68'),_0x588b('0x69')+_0xb173d9[_0x588b('0x31')]));if(_0xb173d9[_0x588b('0x6a')]){_0x33455d[_0x588b('0x67')](new Extension(_0x5ee378,0x3,_0x588b('0x68'),_0x588b('0x6b')+_0xb173d9[_0x588b('0x6a')]));}else{_0x33455d[_0x588b('0x67')](new Extension(_0x5ee378,0x3,'NoOp',_0x588b('0x6c')));}_0x33455d['push'](new Extension(_0x5ee378,0x4,_0x588b('0x6d'),_0x38a120['context']+','+_0x588b('0x6e')+(0x8+_0xb173d9[_0x588b('0x31')][_0x588b('0x41')])+'}'+','+0x1));return _0x33455d;}function formatPrefixName(_0x4c12f1){var _0x1b6589='_';for(var _0x1c5c3e=0x0;_0x1c5c3e<_0x4c12f1[_0x588b('0x41')];_0x1c5c3e++){if(_0x4c12f1[_0x588b('0x6f')](_0x1c5c3e)=='-'){_0x1b6589+=_0x4c12f1[_0x588b('0x6f')](_0x1c5c3e);}else{_0x1b6589+='['+_0x4c12f1[_0x588b('0x6f')](_0x1c5c3e)+']';}}_0x1b6589+='.';return _0x1b6589;}exports[_0x588b('0x29')]=function(_0x53ca92,_0x291f58,_0x27248f){var _0x1647e3=_0x53ca92['body'];_0x1647e3['prefix']=_0x588b('0x70')+_0x1647e3['name']+'-';return db[_0x588b('0x53')][_0x588b('0x54')](function(_0x122317){return db[_0x588b('0x34')][_0x588b('0x29')](_0x1647e3,{'where':{'id':_0x1647e3['id']},'transaction':_0x122317})[_0x588b('0x2b')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x1647e3['id']},'transaction':_0x122317})[_0x588b('0x2b')](function(){return db[_0x588b('0x56')][_0x588b('0x4f')]({'where':{'id':_0x1647e3[_0x588b('0x57')]},'raw':!![]})['then'](function(_0x298a3d){return createVoicePrefixExtensions(_0x1647e3,_0x298a3d,_0x122317);});});});})[_0x588b('0x2b')](function(){return db[_0x588b('0x34')][_0x588b('0x71')](_0x1647e3['id']);})[_0x588b('0x2b')](respondWithResult(_0x291f58,null))[_0x588b('0x50')](handleError(_0x291f58,null));};exports['addAgents']=function(_0x45f9cb,_0x1afd77,_0xdf12a6){return db[_0x588b('0x34')][_0x588b('0x4f')]({'where':{'id':_0x45f9cb[_0x588b('0x4d')]['id']}})[_0x588b('0x2b')](handleEntityNotFound(_0x1afd77,null))[_0x588b('0x2b')](function(_0x2431b9){if(_0x2431b9){return _0x2431b9[_0x588b('0x72')](_0x45f9cb[_0x588b('0x55')][_0x588b('0x73')],_['omit'](_0x45f9cb[_0x588b('0x55')],[_0x588b('0x73'),'id'])||{})[_0x588b('0x74')](function(_0xca96ce){for(var _0x39d5ab=0x0;_0x39d5ab<_0x45f9cb[_0x588b('0x55')]['ids'][_0x588b('0x41')];_0x39d5ab+=0x1){socket[_0x588b('0x75')](_0x588b('0x76'),{'UserId':Number(_0x45f9cb[_0x588b('0x55')][_0x588b('0x73')][_0x39d5ab]),'VoicePrefixId':Number(_0x45f9cb[_0x588b('0x4d')]['id'])});}return _0xca96ce;});}})[_0x588b('0x2b')](respondWithResult(_0x1afd77,null))[_0x588b('0x50')](handleError(_0x1afd77,null));};exports[_0x588b('0x77')]=function(_0x3766c2,_0x416c8b,_0x347d55){return db[_0x588b('0x34')][_0x588b('0x4f')]({'where':{'id':_0x3766c2[_0x588b('0x4d')]['id']}})[_0x588b('0x2b')](handleEntityNotFound(_0x416c8b,null))[_0x588b('0x2b')](function(_0x10b40d){if(_0x10b40d){return _0x10b40d['removeAgents'](_0x3766c2['query'][_0x588b('0x73')])[_0x588b('0x2b')](function(){if(_['isArray'](_0x3766c2['query'][_0x588b('0x73')])){for(var _0x142a6b=0x0;_0x142a6b<_0x3766c2[_0x588b('0x3c')]['ids']['length'];_0x142a6b+=0x1){socket[_0x588b('0x75')](_0x588b('0x78'),{'UserId':Number(_0x3766c2[_0x588b('0x3c')][_0x588b('0x73')][_0x142a6b]),'VoicePrefixId':Number(_0x3766c2[_0x588b('0x4d')]['id'])});}}else{socket[_0x588b('0x75')](_0x588b('0x78'),{'UserId':Number(_0x3766c2[_0x588b('0x3c')]['ids']),'VoicePrefixId':Number(_0x3766c2[_0x588b('0x4d')]['id'])});}});}})[_0x588b('0x2b')](respondWithStatusCode(_0x416c8b,null))[_0x588b('0x50')](handleError(_0x416c8b,null));};exports[_0x588b('0x79')]=function(_0x3e0f68,_0x596376,_0x58ebb1){var _0x1e6bb3={};var _0x4858ba={};var _0x5d398f;var _0x54cdce;return db[_0x588b('0x34')][_0x588b('0x7a')]({'where':{'id':_0x3e0f68[_0x588b('0x4d')]['id']}})[_0x588b('0x2b')](handleEntityNotFound(_0x596376,null))[_0x588b('0x2b')](function(_0x1a730e){if(_0x1a730e){_0x5d398f=_0x1a730e;_0x4858ba[_0x588b('0x39')]=_['keys'](db['User']['rawAttributes']);_0x4858ba[_0x588b('0x3c')]=_[_0x588b('0x3b')](_0x3e0f68[_0x588b('0x3c')]);_0x4858ba['filters']=_[_0x588b('0x3e')](_0x4858ba[_0x588b('0x39')],_0x4858ba[_0x588b('0x3c')]);_0x1e6bb3[_0x588b('0x3f')]=_[_0x588b('0x3e')](_0x4858ba[_0x588b('0x39')],qs[_0x588b('0x40')](_0x3e0f68[_0x588b('0x3c')]['fields']));_0x1e6bb3['attributes']=_0x1e6bb3['attributes']['length']?_0x1e6bb3[_0x588b('0x3f')]:_0x4858ba['model'];_0x1e6bb3['order']=qs[_0x588b('0x45')](_0x3e0f68[_0x588b('0x3c')][_0x588b('0x45')]);_0x1e6bb3['where']=qs['filters'](_['pick'](_0x3e0f68[_0x588b('0x3c')],_0x4858ba[_0x588b('0x3d')]));if(_0x3e0f68['query'][_0x588b('0x47')]){_0x1e6bb3[_0x588b('0x46')]=_[_0x588b('0x48')](_0x1e6bb3[_0x588b('0x46')],{'$or':_[_0x588b('0x3a')](_0x1e6bb3[_0x588b('0x3f')],function(_0x2a3594){var _0x297a4f={};_0x297a4f[_0x2a3594]={'$like':'%'+_0x3e0f68[_0x588b('0x3c')][_0x588b('0x47')]+'%'};return _0x297a4f;})});}_0x1e6bb3=_[_0x588b('0x48')]({},_0x1e6bb3,_0x3e0f68['options']);return _0x5d398f[_0x588b('0x79')](_0x1e6bb3);}})[_0x588b('0x2b')](function(_0x261165){if(_0x261165){_0x54cdce=_0x261165[_0x588b('0x41')];if(!_0x3e0f68[_0x588b('0x3c')]['hasOwnProperty'](_0x588b('0x43'))){_0x1e6bb3[_0x588b('0x22')]=qs[_0x588b('0x22')](_0x3e0f68[_0x588b('0x3c')]['limit']);_0x1e6bb3['offset']=qs['offset'](_0x3e0f68[_0x588b('0x3c')][_0x588b('0x21')]);}return _0x5d398f['getAgents'](_0x1e6bb3);}})[_0x588b('0x2b')](function(_0x3228a4){if(_0x3228a4){return _0x3228a4?{'count':_0x54cdce,'rows':_0x3228a4}:null;}})[_0x588b('0x2b')](respondWithResult(_0x596376,null))[_0x588b('0x50')](handleError(_0x596376,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 6998342..e419a54 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 _0xbb34=['update','emit','hasOwnProperty','hook','save'];(function(_0x58c343,_0x3f6bfd){var _0x22a02b=function(_0x393211){while(--_0x393211){_0x58c343['push'](_0x58c343['shift']());}};_0x22a02b(++_0x3f6bfd);}(_0xbb34,0x16c));var _0x4bb3=function(_0x14525d,_0x747b83){_0x14525d=_0x14525d-0x0;var _0x26b05c=_0xbb34[_0x14525d];return _0x26b05c;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4bb3('0x0'),'afterUpdate':_0x4bb3('0x1'),'afterDestroy':'remove'};function emitEvent(_0x348c01){return function(_0x20615a,_0x53b4f7,_0x21cdf3){VoicePrefixEvents[_0x4bb3('0x2')](_0x348c01+':'+_0x20615a['id'],_0x20615a);VoicePrefixEvents[_0x4bb3('0x2')](_0x348c01,_0x20615a);_0x21cdf3(null);};}for(var e in events){if(events[_0x4bb3('0x3')](e)){var event=events[e];VoicePrefix[_0x4bb3('0x4')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x1374=['VoicePrefix','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x16c4b4,_0xf01770){var _0x32de8e=function(_0x50cf04){while(--_0x50cf04){_0x16c4b4['push'](_0x16c4b4['shift']());}};_0x32de8e(++_0xf01770);}(_0x1374,0xce));var _0x4137=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x1374[_0x36eaaa];return _0x461349;};'use strict';var EventEmitter=require(_0x4137('0x0'));var VoicePrefix=require(_0x4137('0x1'))['db'][_0x4137('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4137('0x3'),'afterDestroy':_0x4137('0x4')};function emitEvent(_0xe958){return function(_0x48b4cf,_0x152413,_0x471695){VoicePrefixEvents[_0x4137('0x5')](_0xe958+':'+_0x48b4cf['id'],_0x48b4cf);VoicePrefixEvents[_0x4137('0x5')](_0xe958,_0x48b4cf);_0x471695(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x4137('0x6')](e,emitEvent(event));}}module[_0x4137('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index f84e3c8..8c01bdc 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 _0x75b3=['./voicePrefix.attributes','exports','define','voice_prefixes','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3bce19,_0x317f24){var _0x3d9451=function(_0x43f002){while(--_0x43f002){_0x3bce19['push'](_0x3bce19['shift']());}};_0x3d9451(++_0x317f24);}(_0x75b3,0x1e4));var _0x375b=function(_0x35a7e0,_0x1a7666){_0x35a7e0=_0x35a7e0-0x0;var _0x2ffaba=_0x75b3[_0x35a7e0];return _0x2ffaba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x375b('0x0'))(_0x375b('0x1'));var moment=require(_0x375b('0x2'));var BPromise=require(_0x375b('0x3'));var rp=require(_0x375b('0x4'));var fs=require('fs');var path=require(_0x375b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x375b('0x6'));module[_0x375b('0x7')]=function(_0x2f1ed5,_0x3a69e6){return _0x2f1ed5[_0x375b('0x8')]('VoicePrefix',attributes,{'tableName':_0x375b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30eb=['../../config/environment','exports','define','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x21cb42,_0x4a9d87){var _0x4d847b=function(_0x555ede){while(--_0x555ede){_0x21cb42['push'](_0x21cb42['shift']());}};_0x4d847b(++_0x4a9d87);}(_0x30eb,0xe9));var _0xb30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30eb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb30e('0x0'));var util=require('util');var logger=require(_0xb30e('0x1'))(_0xb30e('0x2'));var moment=require('moment');var BPromise=require(_0xb30e('0x3'));var rp=require(_0xb30e('0x4'));var fs=require('fs');var path=require(_0xb30e('0x5'));var rimraf=require(_0xb30e('0x6'));var config=require(_0xb30e('0x7'));var attributes=require('./voicePrefix.attributes');module[_0xb30e('0x8')]=function(_0x6fb6c7,_0x176b0d){return _0x6fb6c7[_0xb30e('0x9')](_0xb30e('0xa'),attributes,{'tableName':_0xb30e('0xb'),'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 c5bf4d0..4f027e3 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 _0x6337=['http','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x6337,0x18a));var _0x7633=function(_0x3afdca,_0x27dcd5){_0x3afdca=_0x3afdca-0x0;var _0x545ec9=_0x6337[_0x3afdca];return _0x545ec9;};'use strict';var _=require('lodash');var util=require(_0x7633('0x0'));var moment=require(_0x7633('0x1'));var BPromise=require(_0x7633('0x2'));var rs=require(_0x7633('0x3'));var fs=require('fs');var Redis=require(_0x7633('0x4'));var db=require(_0x7633('0x5'))['db'];var utils=require(_0x7633('0x6'));var logger=require(_0x7633('0x7'))(_0x7633('0x8'));var config=require('../../config/environment');var jayson=require(_0x7633('0x9'));var client=jayson[_0x7633('0xa')][_0x7633('0xb')]({'port':0x232a});config['redis']=_[_0x7633('0xc')](config['redis'],{'host':_0x7633('0xd'),'port':0x18eb});var socket=require(_0x7633('0xe'))(new Redis(config['redis']));require(_0x7633('0xf'))['register'](socket);function respondWithRpcPromise(_0x35a196,_0x4c0f0a,_0x174d9f){return new BPromise(function(_0x2404e4,_0x59e518){return client[_0x7633('0x10')](_0x35a196,_0x174d9f)[_0x7633('0x11')](function(_0x332283){logger['info'](_0x7633('0x12'),_0x4c0f0a,_0x7633('0x13'));logger[_0x7633('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x4c0f0a,_0x7633('0x13'),JSON[_0x7633('0x15')](_0x332283));if(_0x332283[_0x7633('0x16')]){if(_0x332283['error']['code']===0x1f4){logger['error'](_0x7633('0x12'),_0x4c0f0a,_0x332283[_0x7633('0x16')][_0x7633('0x17')]);return _0x59e518(_0x332283[_0x7633('0x16')][_0x7633('0x17')]);}logger[_0x7633('0x16')](_0x7633('0x12'),_0x4c0f0a,_0x332283[_0x7633('0x16')][_0x7633('0x17')]);return _0x2404e4(_0x332283['error'][_0x7633('0x17')]);}else{logger[_0x7633('0x18')](_0x7633('0x12'),_0x4c0f0a,_0x7633('0x13'));_0x2404e4(_0x332283[_0x7633('0x19')]['message']);}})[_0x7633('0x1a')](function(_0x30b58b){logger[_0x7633('0x16')](_0x7633('0x12'),_0x4c0f0a,_0x30b58b);_0x59e518(_0x30b58b);});});} \ No newline at end of file +var _0x496e=['info','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x496e,0x1a0));var _0xe496=function(_0x1c3569,_0x30aaac){_0x1c3569=_0x1c3569-0x0;var _0x1af5cc=_0x496e[_0x1c3569];return _0x1af5cc;};'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});config[_0xe496('0x9')]=_[_0xe496('0xa')](config[_0xe496('0x9')],{'host':_0xe496('0xb'),'port':0x18eb});var socket=require(_0xe496('0xc'))(new Redis(config[_0xe496('0x9')]));require(_0xe496('0xd'))['register'](socket);function respondWithRpcPromise(_0x4a4caa,_0x37c55b,_0x5ca4d4){return new BPromise(function(_0x2e679b,_0x44936f){return client[_0xe496('0xe')](_0x4a4caa,_0x5ca4d4)[_0xe496('0xf')](function(_0x19d4fa){logger[_0xe496('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x37c55b,'request\x20sent');logger[_0xe496('0x11')](_0xe496('0x12'),_0x37c55b,'request\x20sent',JSON[_0xe496('0x13')](_0x19d4fa));if(_0x19d4fa[_0xe496('0x14')]){if(_0x19d4fa[_0xe496('0x14')][_0xe496('0x15')]===0x1f4){logger['error'](_0xe496('0x16'),_0x37c55b,_0x19d4fa['error'][_0xe496('0x17')]);return _0x44936f(_0x19d4fa['error'][_0xe496('0x17')]);}logger[_0xe496('0x14')](_0xe496('0x16'),_0x37c55b,_0x19d4fa[_0xe496('0x14')]['message']);return _0x2e679b(_0x19d4fa[_0xe496('0x14')][_0xe496('0x17')]);}else{logger['info'](_0xe496('0x16'),_0x37c55b,_0xe496('0x18'));_0x2e679b(_0x19d4fa[_0xe496('0x19')][_0xe496('0x17')]);}})[_0xe496('0x1a')](function(_0x25e42d){logger[_0xe496('0x14')](_0xe496('0x16'),_0x37c55b,_0x25e42d);_0x44936f(_0x25e42d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 56660bd..9e82196 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 _0xf2a6=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x15de11,_0x3cd20d){var _0x4f1c07=function(_0xf74624){while(--_0xf74624){_0x15de11['push'](_0x15de11['shift']());}};_0x4f1c07(++_0x3cd20d);}(_0xf2a6,0x13d));var _0x6f2a=function(_0xcea15c,_0x2f302b){_0xcea15c=_0xcea15c-0x0;var _0x230f27=_0xf2a6[_0xcea15c];return _0x230f27;};'use strict';var VoicePrefixEvents=require(_0x6f2a('0x0'));var events=['save','remove','update'];function createListener(_0x1b32c0,_0x5b2cbc){return function(_0x3b14e2){_0x5b2cbc[_0x6f2a('0x1')](_0x1b32c0,_0x3b14e2);};}function removeListener(_0x454ff7,_0x32ddb6){return function(){VoicePrefixEvents[_0x6f2a('0x2')](_0x454ff7,_0x32ddb6);};}exports[_0x6f2a('0x3')]=function(_0x4684f4){for(var _0x19ebe9=0x0,_0x1efd8=events[_0x6f2a('0x4')];_0x19ebe9<_0x1efd8;_0x19ebe9++){var _0x4b4fde=events[_0x19ebe9];var _0x379b80=createListener(_0x6f2a('0x5')+_0x4b4fde,_0x4684f4);VoicePrefixEvents['on'](_0x4b4fde,_0x379b80);}}; \ No newline at end of file +var _0xe739=['length','voicePrefix:','./voicePrefix.events','remove','update','removeListener','register'];(function(_0x224737,_0x170939){var _0x1cd976=function(_0x138d26){while(--_0x138d26){_0x224737['push'](_0x224737['shift']());}};_0x1cd976(++_0x170939);}(_0xe739,0x105));var _0x9e73=function(_0x25a49f,_0x44626b){_0x25a49f=_0x25a49f-0x0;var _0x8c5dc6=_0xe739[_0x25a49f];return _0x8c5dc6;};'use strict';var VoicePrefixEvents=require(_0x9e73('0x0'));var events=['save',_0x9e73('0x1'),_0x9e73('0x2')];function createListener(_0x2dc1a9,_0x508042){return function(_0x54a986){_0x508042['emit'](_0x2dc1a9,_0x54a986);};}function removeListener(_0x3bbc00,_0x43c2e8){return function(){VoicePrefixEvents[_0x9e73('0x3')](_0x3bbc00,_0x43c2e8);};}exports[_0x9e73('0x4')]=function(_0x4cb2ed){for(var _0x3db8fa=0x0,_0x26cb5b=events[_0x9e73('0x5')];_0x3db8fa<_0x26cb5b;_0x3db8fa++){var _0x5e46e7=events[_0x3db8fa];var _0xa49f86=createListener(_0x9e73('0x6')+_0x5e46e7,_0x4cb2ed);VoicePrefixEvents['on'](_0x5e46e7,_0xa49f86);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 0647088..bd3a56a 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 _0x3b5b=['clone','/:id/teams','addTeams','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeAgents','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x10bb45,_0x3791ad){var _0x1eb585=function(_0x360ffd){while(--_0x360ffd){_0x10bb45['push'](_0x10bb45['shift']());}};_0x1eb585(++_0x3791ad);}(_0x3b5b,0xc2));var _0xb3b5=function(_0x205457,_0x427066){_0x205457=_0x205457-0x0;var _0x17442d=_0x3b5b[_0x205457];return _0x17442d;};'use strict';var multer=require(_0xb3b5('0x0'));var util=require(_0xb3b5('0x1'));var path=require('path');var timeout=require(_0xb3b5('0x2'));var express=require(_0xb3b5('0x3'));var router=express[_0xb3b5('0x4')]();var fs_extra=require(_0xb3b5('0x5'));var auth=require(_0xb3b5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb3b5('0x7'));var controller=require(_0xb3b5('0x8'));router[_0xb3b5('0x9')]('/',auth[_0xb3b5('0xa')](),controller['index']);router['get'](_0xb3b5('0xb'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0xc')]);router[_0xb3b5('0x9')](_0xb3b5('0xd'),auth['isAuthenticated'](),controller[_0xb3b5('0xe')]);router[_0xb3b5('0x9')]('/:id/hopper_histories',auth[_0xb3b5('0xa')](),controller['getHopperHistories']);router[_0xb3b5('0x9')](_0xb3b5('0xf'),auth['isAuthenticated'](),controller[_0xb3b5('0x10')]);router[_0xb3b5('0x9')](_0xb3b5('0x11'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x12')]);router[_0xb3b5('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb3b5('0x13')]);router[_0xb3b5('0x9')](_0xb3b5('0x14'),auth['isAuthenticated'](),controller[_0xb3b5('0x15')]);router[_0xb3b5('0x9')](_0xb3b5('0x16'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x17')]);router[_0xb3b5('0x9')](_0xb3b5('0x18'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x19')]);router[_0xb3b5('0x9')](_0xb3b5('0x1a'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x1b')]);router[_0xb3b5('0x1c')]('/',auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x1d')]);router[_0xb3b5('0x1c')](_0xb3b5('0x1e'),auth['isAuthenticated'](),controller[_0xb3b5('0x1f')]);router[_0xb3b5('0x1c')](_0xb3b5('0x20'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x21')]);router['post'](_0xb3b5('0x14'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x22')]);router[_0xb3b5('0x1c')](_0xb3b5('0x18'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x23')]);router[_0xb3b5('0x1c')](_0xb3b5('0x1a'),auth['isAuthenticated'](),controller[_0xb3b5('0x24')]);router[_0xb3b5('0x25')]('/:id',auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x26')]);router[_0xb3b5('0x27')](_0xb3b5('0xb'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x28')]);router['delete'](_0xb3b5('0x20'),auth[_0xb3b5('0xa')](),controller['removeTeams']);router[_0xb3b5('0x27')]('/:id/users',auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x29')]);router[_0xb3b5('0x27')](_0xb3b5('0x18'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x2a')]);router[_0xb3b5('0x27')](_0xb3b5('0x1a'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x2b')]);module[_0xb3b5('0x2c')]=router; \ No newline at end of file +var _0x772f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','get','/:id','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','/:id/lists','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','removeBlackLists','exports','util','path','express','Router'];(function(_0x52d3c1,_0x25db7b){var _0x85307f=function(_0x128a92){while(--_0x128a92){_0x52d3c1['push'](_0x52d3c1['shift']());}};_0x85307f(++_0x25db7b);}(_0x772f,0x77));var _0xf772=function(_0xea1570,_0x2f7856){_0xea1570=_0xea1570-0x0;var _0x579e74=_0x772f[_0xea1570];return _0x579e74;};'use strict';var multer=require('multer');var util=require(_0xf772('0x0'));var path=require(_0xf772('0x1'));var timeout=require('connect-timeout');var express=require(_0xf772('0x2'));var router=express[_0xf772('0x3')]();var fs_extra=require(_0xf772('0x4'));var auth=require(_0xf772('0x5'));var interaction=require(_0xf772('0x6'));var config=require(_0xf772('0x7'));var controller=require(_0xf772('0x8'));router['get']('/',auth[_0xf772('0x9')](),controller['index']);router[_0xf772('0xa')](_0xf772('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf772('0xa')](_0xf772('0xc'),auth['isAuthenticated'](),controller[_0xf772('0xd')]);router[_0xf772('0xa')]('/:id/hopper_histories',auth[_0xf772('0x9')](),controller[_0xf772('0xe')]);router[_0xf772('0xa')]('/:id/hopper_finals',auth[_0xf772('0x9')](),controller[_0xf772('0xf')]);router['get'](_0xf772('0x10'),auth['isAuthenticated'](),controller[_0xf772('0x11')]);router['get'](_0xf772('0x12'),auth[_0xf772('0x9')](),controller[_0xf772('0x13')]);router['get'](_0xf772('0x14'),auth[_0xf772('0x9')](),controller[_0xf772('0x15')]);router[_0xf772('0xa')](_0xf772('0x16'),auth[_0xf772('0x9')](),controller[_0xf772('0x17')]);router[_0xf772('0xa')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0xf772('0xa')](_0xf772('0x18'),auth[_0xf772('0x9')](),controller[_0xf772('0x19')]);router[_0xf772('0x1a')]('/',auth[_0xf772('0x9')](),controller[_0xf772('0x1b')]);router[_0xf772('0x1a')](_0xf772('0x1c'),auth[_0xf772('0x9')](),controller[_0xf772('0x1d')]);router[_0xf772('0x1a')]('/:id/teams',auth[_0xf772('0x9')](),controller[_0xf772('0x1e')]);router['post'](_0xf772('0x14'),auth[_0xf772('0x9')](),controller['addAgents']);router[_0xf772('0x1a')](_0xf772('0x1f'),auth[_0xf772('0x9')](),controller['addLists']);router['post'](_0xf772('0x18'),auth[_0xf772('0x9')](),controller[_0xf772('0x20')]);router[_0xf772('0x21')]('/:id',auth['isAuthenticated'](),controller[_0xf772('0x22')]);router[_0xf772('0x23')]('/:id',auth[_0xf772('0x9')](),controller[_0xf772('0x24')]);router[_0xf772('0x23')](_0xf772('0x12'),auth[_0xf772('0x9')](),controller[_0xf772('0x25')]);router[_0xf772('0x23')]('/:id/users',auth[_0xf772('0x9')](),controller[_0xf772('0x26')]);router['delete'](_0xf772('0x1f'),auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0xf772('0x18'),auth['isAuthenticated'](),controller[_0xf772('0x27')]);module[_0xf772('0x28')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 34cd851..6e570fd 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 _0x1c3b=['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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','rrmemory','roundrobin','progressive','power','INTEGER','ENUM','yes','all','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x5c6081,_0x247a8f){var _0x10aadb=function(_0x4a99ba){while(--_0x4a99ba){_0x5c6081['push'](_0x5c6081['shift']());}};_0x10aadb(++_0x247a8f);}(_0x1c3b,0xab));var _0xb1c3=function(_0x27d1b8,_0x2652b7){_0x27d1b8=_0x27d1b8-0x0;var _0x2e03e8=_0x1c3b[_0x27d1b8];return _0x2e03e8;};'use strict';var Sequelize=require(_0xb1c3('0x0'));module[_0xb1c3('0x1')]={'name':{'type':Sequelize[_0xb1c3('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xb1c3('0x3'),_0xb1c3('0x4')),'allowNull':![],'defaultValue':_0xb1c3('0x3')},'musiconhold':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':_0xb1c3('0x5')},'announce':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xb1c3('0x6'),_0xb1c3('0x7'),_0xb1c3('0x8'),'random','rrmemory','linear','wrandom',_0xb1c3('0x9')),'allowNull':![],'defaultValue':'ringall','set':function(_0x2879c2){this[_0xb1c3('0xa')](_0xb1c3('0xb'),_0x2879c2?_0x2879c2:'rrmemory');},'get':function(){var _0x226a88=this[_0xb1c3('0xc')](_0xb1c3('0xd'));var _0x5f1e34=this[_0xb1c3('0xc')](_0xb1c3('0xe'));var _0x19c7f1=this[_0xb1c3('0xc')]('strategy');if(_0x226a88===_0xb1c3('0x3')){return _0x19c7f1;}if(_0x5f1e34===_0xb1c3('0xf')&&_0x19c7f1===_0xb1c3('0x10')||_0x5f1e34==='booked'&&_0x19c7f1===_0xb1c3('0x11')){return _0x19c7f1;}if(_0x5f1e34===_0xb1c3('0x12')||_0x5f1e34==='predictive'||_0x5f1e34===_0xb1c3('0x13')){return _0x19c7f1;}return null;}},'servicelevel':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb1c3('0x14')](0xb)},'timeout':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xb1c3('0x2')]},'weight':{'type':Sequelize[_0xb1c3('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no',_0xb1c3('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb1c3('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb1c3('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb1c3('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xb1c3('0x16'),'no'),'defaultValue':_0xb1c3('0x16')},'announce_holdtime':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xb1c3('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb1c3('0x15')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb1c3('0x2')]},'queue_youarenext':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xb1c3('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb1c3('0x2')]},'queue_quantity1':{'type':Sequelize[_0xb1c3('0x2')]},'queue_quantity2':{'type':Sequelize[_0xb1c3('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xb1c3('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xb1c3('0x18')],'set':function(_0x52b961){this[_0xb1c3('0xa')]('periodic_announce',_0x52b961?_0x52b961[_0xb1c3('0x19')](','):[]);},'get':function(){return this[_0xb1c3('0xc')](_0xb1c3('0x1a'))?this[_0xb1c3('0xc')](_0xb1c3('0x1a'))[_0xb1c3('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x2dc95f){this[_0xb1c3('0xa')](_0xb1c3('0x1c'),_0x2dc95f?_0x2dc95f[_0xb1c3('0x19')](','):undefined);},'get':function(){return this[_0xb1c3('0xc')](_0xb1c3('0x1c'))?this[_0xb1c3('0xc')]('joinempty')[_0xb1c3('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x351069){this[_0xb1c3('0xa')]('leavewhenempty',_0x351069?_0x351069[_0xb1c3('0x19')](','):undefined);},'get':function(){return this[_0xb1c3('0xc')](_0xb1c3('0x1d'))?this[_0xb1c3('0xc')]('leavewhenempty')[_0xb1c3('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb1c3('0x2')]},'description':{'type':Sequelize[_0xb1c3('0x2')]},'acw':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':0x0,'set':function(_0x379c9a){this['setDataValue'](_0xb1c3('0x1f'),_0x379c9a);if(_0x379c9a){if(this[_0xb1c3('0xc')]('wrapuptime')<0x2){this[_0xb1c3('0xa')](_0xb1c3('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':0x0,'comment':_0xb1c3('0x21')},'dialMethod':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x22'),_0xb1c3('0x12'),'power',_0xb1c3('0x23'),_0xb1c3('0xf')),'defaultValue':_0xb1c3('0x12'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xb1c3('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb1c3('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xb1c3('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb1c3('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xb1c3('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xb1c3('0x15')]('agentBusyFactor',_0xb1c3('0x27')),'defaultValue':'dropRate','comment':_0xb1c3('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb1c3('0x29')](0x2)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb1c3('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xb1c3('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb1c3('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb1c3('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1c3('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':_0xb1c3('0x2d'),'comment':_0xb1c3('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1c3('0x2f')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xb1c3('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1c3('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'comment':_0xb1c3('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb1c3('0x35')},'dialTimezone':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':_0xb1c3('0x36')},'dialPrefix':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x37'),_0xb1c3('0x38'),_0xb1c3('0x39')),'defaultValue':_0xb1c3('0x37')},'dialAMDActive':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':0x0,'comment':_0xb1c3('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0xb1c3('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb1c3('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb1c3('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb1c3('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb1c3('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb1c3('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb1c3('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xb1c3('0x14')](0x9)[_0xb1c3('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb1c3('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb1c3('0x14')](0x9)[_0xb1c3('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb1c3('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb1c3('0x14')](0x9)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb1c3('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb1c3('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb1c3('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb1c3('0x14')](0x9)[_0xb1c3('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb1c3('0x42')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb1c3('0x43')},'dialRecallInQueue':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':0x0,'comment':_0xb1c3('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x45'),_0xb1c3('0x46')),'defaultValue':_0xb1c3('0x45')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb1c3('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb1c3('0x47')},'dialCutDigit':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb1c3('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1c3('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x4a')},'dialDropMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1c3('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x4d')},'dialMachineMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb1c3('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':![],'comment':_0xb1c3('0x4f'),'set':function(_0x3b9d2f){if(!_0x3b9d2f)this['setDataValue'](_0xb1c3('0x50'),null);this[_0xb1c3('0xa')](_0xb1c3('0x51'),_0x3b9d2f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xb1c3('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xef72=['exports','STRING','outbound','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','rrordered','type','getDataValue','dialMethod','strategy','inbound','booked','roundrobin','progressive','predictive','INTEGER','ENUM','yes','all','once','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize'];(function(_0x3c68ac,_0x38b406){var _0x35d849=function(_0x1fb2e0){while(--_0x1fb2e0){_0x3c68ac['push'](_0x3c68ac['shift']());}};_0x35d849(++_0x38b406);}(_0xef72,0xf8));var _0x2ef7=function(_0x30b148,_0x10da07){_0x30b148=_0x30b148-0x0;var _0x39b26a=_0xef72[_0x30b148];return _0x39b26a;};'use strict';var Sequelize=require(_0x2ef7('0x0'));module[_0x2ef7('0x1')]={'name':{'type':Sequelize[_0x2ef7('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x2ef7('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':_0x2ef7('0x4')},'announce':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x2ef7('0x5'),'leastrecent',_0x2ef7('0x6'),_0x2ef7('0x7'),_0x2ef7('0x8'),_0x2ef7('0x9'),_0x2ef7('0xa'),_0x2ef7('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x3a1902){this['setDataValue']('strategy',_0x3a1902?_0x3a1902:_0x2ef7('0x8'));},'get':function(){var _0x5f54f2=this['getDataValue'](_0x2ef7('0xc'));var _0x14f20a=this[_0x2ef7('0xd')](_0x2ef7('0xe'));var _0x59d8a2=this['getDataValue'](_0x2ef7('0xf'));if(_0x5f54f2===_0x2ef7('0x10')){return _0x59d8a2;}if(_0x14f20a===_0x2ef7('0x11')&&_0x59d8a2===_0x2ef7('0x8')||_0x14f20a==='booked'&&_0x59d8a2===_0x2ef7('0x12')){return _0x59d8a2;}if(_0x14f20a===_0x2ef7('0x13')||_0x14f20a===_0x2ef7('0x14')||_0x14f20a==='power'){return _0x59d8a2;}return null;}},'servicelevel':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x2ef7('0x15')](0xb)},'timeout':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2ef7('0x2')]},'weight':{'type':Sequelize[_0x2ef7('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x2ef7('0x16')]('yes','no',_0x2ef7('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2ef7('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x2ef7('0x16')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x2ef7('0x16')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2ef7('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2ef7('0x16')]('yes','no'),'defaultValue':_0x2ef7('0x17')},'announce_holdtime':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no',_0x2ef7('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x2ef7('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x2ef7('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2ef7('0x2')]},'queue_quantity1':{'type':Sequelize[_0x2ef7('0x2')]},'queue_quantity2':{'type':Sequelize[_0x2ef7('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x2ef7('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x2ef7('0x1a')],'set':function(_0x1625fc){this[_0x2ef7('0x1b')](_0x2ef7('0x1c'),_0x1625fc?_0x1625fc[_0x2ef7('0x1d')](','):[]);},'get':function(){return this[_0x2ef7('0xd')](_0x2ef7('0x1c'))?this[_0x2ef7('0xd')](_0x2ef7('0x1c'))[_0x2ef7('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':_0x2ef7('0x17'),'set':function(_0x52146d){this[_0x2ef7('0x1b')](_0x2ef7('0x1f'),_0x52146d?_0x52146d['join'](','):undefined);},'get':function(){return this[_0x2ef7('0xd')](_0x2ef7('0x1f'))?this[_0x2ef7('0xd')]('joinempty')[_0x2ef7('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':'no','set':function(_0x55bcb2){this[_0x2ef7('0x1b')](_0x2ef7('0x20'),_0x55bcb2?_0x55bcb2[_0x2ef7('0x1d')](','):undefined);},'get':function(){return this[_0x2ef7('0xd')](_0x2ef7('0x20'))?this[_0x2ef7('0xd')](_0x2ef7('0x20'))[_0x2ef7('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x2ef7('0x16')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2ef7('0x2')]},'acw':{'type':Sequelize[_0x2ef7('0x21')],'defaultValue':0x0,'set':function(_0x4b5561){this[_0x2ef7('0x1b')](_0x2ef7('0x22'),_0x4b5561);if(_0x4b5561){if(this['getDataValue'](_0x2ef7('0x23'))<0x2){this[_0x2ef7('0x1b')](_0x2ef7('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2ef7('0x24')},'dialMethod':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x25'),_0x2ef7('0x13'),'power',_0x2ef7('0x14'),_0x2ef7('0x11')),'defaultValue':_0x2ef7('0x13'),'comment':_0x2ef7('0x26')},'dialLimitChannel':{'type':Sequelize[_0x2ef7('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2ef7('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2ef7('0x28')},'dialPowerLevel':{'type':Sequelize[_0x2ef7('0x29')](0x2)[_0x2ef7('0x2a')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2ef7('0x2b')},'dialPredictiveOptimization':{'type':Sequelize[_0x2ef7('0x16')]('agentBusyFactor',_0x2ef7('0x2c')),'defaultValue':_0x2ef7('0x2c'),'comment':_0x2ef7('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2ef7('0x29')](0x2)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x2ef7('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x2ef7('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2ef7('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2ef7('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2ef7('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':'tTxX','comment':_0x2ef7('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x31')},'dialQueueProject':{'type':Sequelize[_0x2ef7('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x2ef7('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2ef7('0x38')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x39'),_0x2ef7('0x3a'),'onlyIfOpen'),'defaultValue':_0x2ef7('0x39')},'dialAMDActive':{'type':Sequelize[_0x2ef7('0x21')],'defaultValue':0x0,'comment':_0x2ef7('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x2ef7('0x15')](0x9)[_0x2ef7('0x2a')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2ef7('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x2ef7('0x15')](0x9)[_0x2ef7('0x2a')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2ef7('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2ef7('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2ef7('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2ef7('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2ef7('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x2ef7('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2ef7('0x15')](0x9)[_0x2ef7('0x2a')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2ef7('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2ef7('0x15')](0x9)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2ef7('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2ef7('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2ef7('0x15')](0x9)[_0x2ef7('0x2a')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2ef7('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x2ef7('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x2ef7('0x21')],'defaultValue':0x0,'comment':_0x2ef7('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x46'),_0x2ef7('0x47')),'defaultValue':_0x2ef7('0x46')},'dialQueueProject2':{'type':Sequelize[_0x2ef7('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2ef7('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x2ef7('0x2a')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x4d')},'dialMachineMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x4e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x4f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2ef7('0x15')],'allowNull':!![],'comment':_0x2ef7('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x2ef7('0x21')],'defaultValue':![],'comment':_0x2ef7('0x51'),'set':function(_0x2b94a8){if(!_0x2b94a8)this[_0x2ef7('0x1b')]('mandatoryDispositionPauseId',null);this[_0x2ef7('0x1b')](_0x2ef7('0x52'),_0x2b94a8);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x2ef7('0x2a')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index fe02ce0..48b02c2 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 _0x206c=['TeamVoiceQueue','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','ids','select','field','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','destroy','userVoiceQueue:remove','addAgents','userVoiceQueue:save','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ListId\x20=\x20?','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','undefined','limit','offset','set','apply','reject','update','get','VoiceQueues','inbound','filter','ignore','map','value','includes','type','find','UserProfileResource','then','end','sendStatus','error','stack','name','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options','count','includeAll','findAll','show','params','keys','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','role','outbound','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each'];(function(_0x47bce1,_0x4a2a0a){var _0x1a97de=function(_0x4c8de8){while(--_0x4c8de8){_0x47bce1['push'](_0x47bce1['shift']());}};_0x1a97de(++_0x4a2a0a);}(_0x206c,0x1b8));var _0xc206=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0x206c[_0x2c5255];return _0x30d0ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc206('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc206('0x1'));var rp=require(_0xc206('0x2'));var moment=require(_0xc206('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc206('0x4'));var util=require(_0xc206('0x5'));var path=require(_0xc206('0x6'));var sox=require('sox');var csv=require(_0xc206('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc206('0x8'));var squel=require(_0xc206('0x9'));var crypto=require('crypto');var jsforce=require(_0xc206('0xa'));var deskjs=require(_0xc206('0xb'));var toCsv=require(_0xc206('0x7'));var querystring=require(_0xc206('0xc'));var Papa=require('papaparse');var Redis=require(_0xc206('0xd'));var authService=require(_0xc206('0xe'));var qs=require(_0xc206('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc206('0x10'));var logger=require(_0xc206('0x11'))(_0xc206('0x12'));var utils=require('../../config/utils');var config=require(_0xc206('0x13'));var licenseUtil=require(_0xc206('0x14'));var db=require(_0xc206('0x15'))['db'];config[_0xc206('0x16')]=_[_0xc206('0x17')](config[_0xc206('0x16')],{'host':_0xc206('0x18'),'port':0x18eb});var socket=require(_0xc206('0x19'))(new Redis(config[_0xc206('0x16')]));require('./voiceQueue.socket')[_0xc206('0x1a')](socket);function respondWithStatusCode(_0x1a8e7d,_0xaa143c){_0xaa143c=_0xaa143c||0xcc;return function(_0xda3738){if(_0xda3738){return _0x1a8e7d['sendStatus'](_0xaa143c);}return _0x1a8e7d[_0xc206('0x1b')](_0xaa143c)['end']();};}function respondWithResult(_0x20a5c5,_0x387112){_0x387112=_0x387112||0xc8;return function(_0x456984){if(_0x456984){return _0x20a5c5[_0xc206('0x1b')](_0x387112)[_0xc206('0x1c')](_0x456984);}};}function respondWithFilteredResult(_0xc59af5,_0x42e501){return function(_0x3d3cdb){if(_0x3d3cdb){var _0x48467f=typeof _0x42e501['offset']===_0xc206('0x1d')&&typeof _0x42e501[_0xc206('0x1e')]===_0xc206('0x1d');var _0x2706ae=_0x3d3cdb['count'];var _0x450030=_0x48467f?0x0:_0x42e501[_0xc206('0x1f')];var _0x1b5532=_0x48467f?_0x3d3cdb['count']:_0x42e501[_0xc206('0x1f')]+_0x42e501[_0xc206('0x1e')];var _0x547ca4;if(_0x1b5532>=_0x2706ae){_0x1b5532=_0x2706ae;_0x547ca4=0xc8;}else{_0x547ca4=0xce;}_0xc59af5['status'](_0x547ca4);return _0xc59af5[_0xc206('0x20')]('Content-Range',_0x450030+'-'+_0x1b5532+'/'+_0x2706ae)['json'](_0x3d3cdb);}return null;};}function patchUpdates(_0x3d8585){return function(_0x18fec0){try{jsonpatch[_0xc206('0x21')](_0x18fec0,_0x3d8585,!![]);}catch(_0x24a0b8){return BPromise[_0xc206('0x22')](_0x24a0b8);}return _0x18fec0['save']();};}function saveUpdates(_0x100cd8,_0x4eb7fa){return function(_0x187935){if(_0x187935){return _0x187935[_0xc206('0x23')](_0x100cd8)['then'](function(_0x55a2cb){return _0x55a2cb;});}return null;};}function removeEntity(_0x4f86eb,_0x439d96){return function(_0x4faa9c){if(_0x4faa9c){return _0x4faa9c['destroy']()['then'](function(){var _0x5e1c7c=_0x4faa9c[_0xc206('0x24')]({'plain':!![]});var _0xfb7213=[{'name':_0xc206('0x25'),'value':_0xc206('0x26'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x30d5e0=_(_0xfb7213)[_0xc206('0x27')](_0xc206('0x28'))[_0xc206('0x29')](_0xc206('0x2a'))[_0xc206('0x2a')]();if(_[_0xc206('0x2b')](_0x30d5e0,_0x5e1c7c[_0xc206('0x2c')])){return;}var _0x1d0c14=_[_0xc206('0x2d')](_0xfb7213,[_0xc206('0x2a'),_0x5e1c7c[_0xc206('0x2c')]])['name'];return db[_0xc206('0x2e')]['destroy']({'where':{'type':_0x1d0c14,'resourceId':_0x5e1c7c['id']}})[_0xc206('0x2f')](function(){return _0x4faa9c;});})[_0xc206('0x2f')](function(){_0x4f86eb[_0xc206('0x1b')](0xcc)[_0xc206('0x30')]();});}};}function handleEntityNotFound(_0x490743,_0x47733f){return function(_0x414fe8){if(!_0x414fe8){_0x490743[_0xc206('0x31')](0x194);}return _0x414fe8;};}function handleError(_0x50cd83,_0xff1d69){_0xff1d69=_0xff1d69||0x1f4;return function(_0x24e997){logger[_0xc206('0x32')](_0x24e997[_0xc206('0x33')]);if(_0x24e997[_0xc206('0x34')]){delete _0x24e997[_0xc206('0x34')];}_0x50cd83['status'](_0xff1d69)[_0xc206('0x35')](_0x24e997);};}exports[_0xc206('0x36')]=function(_0x5212ab,_0x500c88){var _0x228285={},_0x3fdf30={},_0x448ca0={'count':0x0,'rows':[]};var _0xfb7c42=_[_0xc206('0x29')](db[_0xc206('0x37')][_0xc206('0x38')],function(_0xc6496){return{'name':_0xc6496[_0xc206('0x39')],'type':_0xc6496[_0xc206('0x2c')][_0xc206('0x3a')]};});_0x3fdf30[_0xc206('0x3b')]=_[_0xc206('0x29')](_0xfb7c42,_0xc206('0x34'));_0x3fdf30[_0xc206('0x3c')]=_['keys'](_0x5212ab[_0xc206('0x3c')]);_0x3fdf30[_0xc206('0x3d')]=_[_0xc206('0x3e')](_0x3fdf30[_0xc206('0x3b')],_0x3fdf30[_0xc206('0x3c')]);_0x228285[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x3fdf30['model'],qs[_0xc206('0x40')](_0x5212ab['query'][_0xc206('0x40')]));_0x228285[_0xc206('0x3f')]=_0x228285['attributes'][_0xc206('0x41')]?_0x228285[_0xc206('0x3f')]:_0x3fdf30[_0xc206('0x3b')];if(!_0x5212ab['query'][_0xc206('0x42')]('nolimit')){_0x228285['limit']=qs[_0xc206('0x1e')](_0x5212ab['query'][_0xc206('0x1e')]);_0x228285[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x5212ab[_0xc206('0x3c')]['offset']);}_0x228285[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x5212ab['query'][_0xc206('0x44')]);_0x228285[_0xc206('0x45')]=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x5212ab['query'],_0x3fdf30[_0xc206('0x3d')]),_0xfb7c42);if(_0x5212ab[_0xc206('0x3c')][_0xc206('0x27')]){_0x228285[_0xc206('0x45')]=_['merge'](_0x228285[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0xfb7c42,function(_0x219e61){if(_0x219e61[_0xc206('0x2c')]!==_0xc206('0x47')){var _0x3afe5e={};_0x3afe5e[_0x219e61[_0xc206('0x34')]]={'$like':'%'+_0x5212ab[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x3afe5e;}})});}_0x228285=_[_0xc206('0x48')]({},_0x228285,_0x5212ab[_0xc206('0x49')]);var _0x4516c2={'where':_0x228285[_0xc206('0x45')]};return db[_0xc206('0x37')][_0xc206('0x4a')](_0x4516c2)[_0xc206('0x2f')](function(_0x1378ac){_0x448ca0[_0xc206('0x4a')]=_0x1378ac;if(_0x5212ab[_0xc206('0x3c')][_0xc206('0x4b')]){_0x228285['include']=[{'all':!![]}];}return db['VoiceQueue'][_0xc206('0x4c')](_0x228285);})['then'](function(_0x1ae89b){_0x448ca0['rows']=_0x1ae89b;return _0x448ca0;})[_0xc206('0x2f')](respondWithFilteredResult(_0x500c88,_0x228285))['catch'](handleError(_0x500c88,null));};exports[_0xc206('0x4d')]=function(_0x4adbbc,_0xdde8d7){var _0xcbee19={'raw':![],'where':{'id':_0x4adbbc[_0xc206('0x4e')]['id']}},_0x3c7611={};_0x3c7611[_0xc206('0x3b')]=_[_0xc206('0x4f')](db['VoiceQueue']['rawAttributes']);_0x3c7611['query']=_['keys'](_0x4adbbc[_0xc206('0x3c')]);_0x3c7611[_0xc206('0x3d')]=_[_0xc206('0x3e')](_0x3c7611[_0xc206('0x3b')],_0x3c7611[_0xc206('0x3c')]);_0xcbee19['attributes']=_[_0xc206('0x3e')](_0x3c7611[_0xc206('0x3b')],qs['fields'](_0x4adbbc['query'][_0xc206('0x40')]));_0xcbee19[_0xc206('0x3f')]=_0xcbee19[_0xc206('0x3f')]['length']?_0xcbee19['attributes']:_0x3c7611[_0xc206('0x3b')];if(_0x4adbbc[_0xc206('0x3c')][_0xc206('0x4b')]){_0xcbee19[_0xc206('0x50')]=[{'all':!![]}];}_0xcbee19=_['merge']({},_0xcbee19,_0x4adbbc[_0xc206('0x49')]);return db[_0xc206('0x37')]['find'](_0xcbee19)[_0xc206('0x2f')](handleEntityNotFound(_0xdde8d7,null))[_0xc206('0x2f')](respondWithResult(_0xdde8d7,null))[_0xc206('0x51')](handleError(_0xdde8d7,null));};exports[_0xc206('0x52')]=function(_0x577f7b,_0x2a740c){return db[_0xc206('0x37')][_0xc206('0x52')](_0x577f7b[_0xc206('0x53')],{})[_0xc206('0x2f')](function(_0x4c6250){var _0x5d3215=_0x577f7b[_0xc206('0x54')][_0xc206('0x24')]({'plain':!![]});if(!_0x5d3215)throw new Error(_0xc206('0x55'));if(_0x5d3215['role']==='user'){var _0x572651=_0x4c6250[_0xc206('0x24')]({'plain':!![]});var _0x57a577=[{'name':_0xc206('0x25'),'value':_0xc206('0x26')},{'name':_0xc206('0x56'),'value':'outbound'}];var _0x447624=_[_0xc206('0x2d')](_0x57a577,[_0xc206('0x2a'),_0x572651[_0xc206('0x2c')]])[_0xc206('0x34')];return db[_0xc206('0x57')][_0xc206('0x2d')]({'where':{'name':_0x447624,'userProfileId':_0x5d3215[_0xc206('0x58')]},'raw':!![]})['then'](function(_0x4dc904){if(_0x4dc904&&_0x4dc904[_0xc206('0x59')]===0x0){return db['UserProfileResource'][_0xc206('0x52')]({'name':_0x572651['name'],'resourceId':_0x572651['id'],'type':_0x4dc904[_0xc206('0x34')],'sectionId':_0x4dc904['id']},{})[_0xc206('0x2f')](function(){return _0x4c6250;});}else{return _0x4c6250;}})[_0xc206('0x51')](function(_0x1fecc8){logger['error'](_0xc206('0x5a'),_0x1fecc8);throw _0x1fecc8;});}return _0x4c6250;})['then'](respondWithResult(_0x2a740c,0xc9))[_0xc206('0x51')](handleError(_0x2a740c,null));};exports['clone']=function(_0x1dce31,_0x4bc228){var _0x27949d={'where':{'id':_0x1dce31[_0xc206('0x4e')]['id']}},_0x1f47bf={};_0x1f47bf[_0xc206('0x3b')]=_[_0xc206('0x4f')](db[_0xc206('0x37')]['rawAttributes']);_0x27949d[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x1f47bf[_0xc206('0x3b')],qs['fields'](_0x1dce31[_0xc206('0x3c')][_0xc206('0x40')]));_0x27949d[_0xc206('0x3f')]=_0x27949d['attributes'][_0xc206('0x41')]?_0x27949d['attributes']:_0x1f47bf['model'];if(_0x1dce31['query'][_0xc206('0x4b')]){_0x27949d[_0xc206('0x50')]=[{'all':!![]}];}_0x27949d=_[_0xc206('0x48')]({},_0x27949d,_0x1dce31['options']);return db[_0xc206('0x37')]['find'](_0x27949d)[_0xc206('0x2f')](handleEntityNotFound(_0x4bc228,null))[_0xc206('0x2f')](function(_0x24120b){if(_0x24120b){var _0x3dc6d2=_0x24120b[_0xc206('0x24')]({'plain':!![]});_0x3dc6d2=qs[_0xc206('0x5b')](_0x3dc6d2,['id','createdAt',_0xc206('0x5c')]);_0x1dce31[_0xc206('0x53')]=_['omit'](_0x1dce31[_0xc206('0x53')],['id','createdAt','updatedAt']);return db[_0xc206('0x37')][_0xc206('0x52')](_['merge'](_0x3dc6d2,_0x1dce31[_0xc206('0x53')]),{'include':_0x1dce31['query'][_0xc206('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x36298b){var _0x39d6ae=_0x1dce31[_0xc206('0x54')]['get']({'plain':!![]});if(!_0x39d6ae)throw new Error(_0xc206('0x55'));if(_0x39d6ae[_0xc206('0x5d')]===_0xc206('0x54')){var _0x4ef39b=_0x36298b[_0xc206('0x24')]({'plain':!![]});var _0x208205=[{'name':'VoiceQueues','value':'inbound'},{'name':_0xc206('0x56'),'value':_0xc206('0x5e')}];var _0x3b9b0a=_[_0xc206('0x2d')](_0x208205,[_0xc206('0x2a'),_0x4ef39b[_0xc206('0x2c')]])[_0xc206('0x34')];return db[_0xc206('0x57')][_0xc206('0x2d')]({'where':{'name':_0x3b9b0a,'userProfileId':_0x39d6ae[_0xc206('0x58')]},'raw':!![]})['then'](function(_0x29d555){if(_0x29d555&&_0x29d555[_0xc206('0x59')]===0x0){return db[_0xc206('0x2e')]['create']({'name':_0x4ef39b[_0xc206('0x34')],'resourceId':_0x4ef39b['id'],'type':_0x29d555[_0xc206('0x34')],'sectionId':_0x29d555['id']},{})[_0xc206('0x2f')](function(){return _0x36298b;});}else{return _0x36298b;}})['catch'](function(_0x203896){logger[_0xc206('0x32')](_0xc206('0x5a'),_0x203896);throw _0x203896;});}return _0x36298b;});}})[_0xc206('0x2f')](respondWithResult(_0x4bc228,0xc9))['catch'](handleError(_0x4bc228,null));};exports['update']=function(_0x196918,_0x860256){if(_0x196918[_0xc206('0x53')]['id']){delete _0x196918['body']['id'];}return db[_0xc206('0x37')]['find']({'where':{'id':_0x196918[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x860256,null))[_0xc206('0x2f')](saveUpdates(_0x196918['body'],null))[_0xc206('0x2f')](respondWithResult(_0x860256,null))[_0xc206('0x51')](handleError(_0x860256,null));};exports['destroy']=function(_0x558c8a,_0x2a337a){return db[_0xc206('0x37')][_0xc206('0x2d')]({'where':{'id':_0x558c8a['params']['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x2a337a,null))[_0xc206('0x2f')](removeEntity(_0x2a337a,null))[_0xc206('0x51')](handleError(_0x2a337a,null));};exports[_0xc206('0x5f')]=function(_0x4c4588,_0x18c61b,_0x425d84){var _0x2a71dc={'raw':![],'where':{}};var _0x5df5b1={};var _0x48a1a5={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc206('0x60')]({'where':{'id':_0x4c4588[_0xc206('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18c61b,null))[_0xc206('0x2f')](function(_0x3c31d1){if(_0x3c31d1){_0x5df5b1[_0xc206('0x3b')]=_[_0xc206('0x4f')](db[_0xc206('0x61')][_0xc206('0x38')]);_0x5df5b1[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x4c4588['query']);_0x5df5b1[_0xc206('0x3d')]=_[_0xc206('0x3e')](_0x5df5b1[_0xc206('0x3b')],_0x5df5b1[_0xc206('0x3c')]);_0x2a71dc[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x5df5b1['model'],qs[_0xc206('0x40')](_0x4c4588[_0xc206('0x3c')][_0xc206('0x40')]));_0x2a71dc[_0xc206('0x3f')]=_0x2a71dc[_0xc206('0x3f')][_0xc206('0x41')]?_0x2a71dc[_0xc206('0x3f')]:_0x5df5b1['model'];if(!_0x4c4588['query'][_0xc206('0x42')](_0xc206('0x62'))){_0x2a71dc[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x4c4588[_0xc206('0x3c')][_0xc206('0x1e')]);_0x2a71dc[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x4c4588['query'][_0xc206('0x1f')]);}_0x2a71dc[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x4c4588[_0xc206('0x3c')]['sort']);_0x2a71dc['where']=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x4c4588['query'],_0x5df5b1[_0xc206('0x3d')]));_0x2a71dc[_0xc206('0x45')][_0xc206('0x63')]=_0x3c31d1['id'];if(_0x4c4588[_0xc206('0x3c')][_0xc206('0x27')]){_0x2a71dc[_0xc206('0x45')]=_[_0xc206('0x48')](_0x2a71dc[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x2a71dc[_0xc206('0x3f')],function(_0x32bc59){var _0x38b7af={};_0x38b7af[_0x32bc59]={'$like':'%'+_0x4c4588['query'][_0xc206('0x27')]+'%'};return _0x38b7af;})});}_0x2a71dc=_[_0xc206('0x48')]({},_0x2a71dc,_0x4c4588['options']);return db[_0xc206('0x61')][_0xc206('0x4a')]({'where':_0x2a71dc['where']})[_0xc206('0x2f')](function(_0x4ba34c){_0x48a1a5[_0xc206('0x4a')]=_0x4ba34c;if(_0x4c4588[_0xc206('0x3c')][_0xc206('0x4b')]){_0x2a71dc[_0xc206('0x50')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x2a71dc);})[_0xc206('0x2f')](function(_0x2c4176){_0x48a1a5['rows']=_0x2c4176;return _0x48a1a5;});}})[_0xc206('0x2f')](respondWithFilteredResult(_0x18c61b,_0x2a71dc))[_0xc206('0x51')](handleError(_0x18c61b,null));};exports[_0xc206('0x64')]=function(_0x25878e,_0x41ccbe,_0x35ba26){var _0x2514e1={'raw':!![],'where':{}};var _0x49d2e8={};var _0x57b846={'count':0x0,'rows':[]};return db[_0xc206('0x37')][_0xc206('0x60')]({'where':{'id':_0x25878e[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x41ccbe,null))[_0xc206('0x2f')](function(_0x9b46ee){if(_0x9b46ee){_0x49d2e8['model']=_['keys'](db[_0xc206('0x65')][_0xc206('0x38')]);_0x49d2e8[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x25878e['query']);_0x49d2e8[_0xc206('0x3d')]=_['intersection'](_0x49d2e8[_0xc206('0x3b')],_0x49d2e8[_0xc206('0x3c')]);_0x2514e1[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x49d2e8[_0xc206('0x3b')],qs[_0xc206('0x40')](_0x25878e[_0xc206('0x3c')][_0xc206('0x40')]));_0x2514e1[_0xc206('0x3f')]=_0x2514e1[_0xc206('0x3f')]['length']?_0x2514e1['attributes']:_0x49d2e8['model'];if(!_0x25878e['query'][_0xc206('0x42')](_0xc206('0x62'))){_0x2514e1[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x25878e[_0xc206('0x3c')][_0xc206('0x1e')]);_0x2514e1[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x25878e[_0xc206('0x3c')]['offset']);}_0x2514e1[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x25878e['query']['sort']);_0x2514e1[_0xc206('0x45')]=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x25878e[_0xc206('0x3c')],_0x49d2e8[_0xc206('0x3d')]));_0x2514e1['where']['VoiceQueueId']=_0x9b46ee['id'];if(_0x25878e['query'][_0xc206('0x27')]){_0x2514e1['where']=_[_0xc206('0x48')](_0x2514e1[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x2514e1[_0xc206('0x3f')],function(_0xb25d62){var _0x4ef021={};_0x4ef021[_0xb25d62]={'$like':'%'+_0x25878e[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x4ef021;})});}_0x2514e1=_[_0xc206('0x48')]({},_0x2514e1,_0x25878e[_0xc206('0x49')]);return db[_0xc206('0x65')]['count']({'where':_0x2514e1[_0xc206('0x45')]})['then'](function(_0x3c355e){_0x57b846[_0xc206('0x4a')]=_0x3c355e;if(_0x25878e[_0xc206('0x3c')][_0xc206('0x4b')]){_0x2514e1[_0xc206('0x50')]=[{'all':!![]}];}return db[_0xc206('0x65')][_0xc206('0x4c')](_0x2514e1);})[_0xc206('0x2f')](function(_0x262ca2){_0x57b846[_0xc206('0x66')]=_0x262ca2;return _0x57b846;});}})[_0xc206('0x2f')](respondWithFilteredResult(_0x41ccbe,_0x2514e1))[_0xc206('0x51')](handleError(_0x41ccbe,null));};exports[_0xc206('0x67')]=function(_0x5b387d,_0x72e777,_0x292c4c){var _0x3ac8d5={'raw':!![],'where':{}};var _0x587378={};var _0x5c067c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc206('0x60')]({'where':{'id':_0x5b387d[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x72e777,null))[_0xc206('0x2f')](function(_0x5a9777){if(_0x5a9777){_0x587378['model']=_[_0xc206('0x4f')](db[_0xc206('0x68')][_0xc206('0x38')]);_0x587378[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x5b387d['query']);_0x587378['filters']=_['intersection'](_0x587378[_0xc206('0x3b')],_0x587378[_0xc206('0x3c')]);_0x3ac8d5[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x587378['model'],qs[_0xc206('0x40')](_0x5b387d[_0xc206('0x3c')][_0xc206('0x40')]));_0x3ac8d5[_0xc206('0x3f')]=_0x3ac8d5[_0xc206('0x3f')][_0xc206('0x41')]?_0x3ac8d5[_0xc206('0x3f')]:_0x587378[_0xc206('0x3b')];if(!_0x5b387d[_0xc206('0x3c')]['hasOwnProperty']('nolimit')){_0x3ac8d5[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x5b387d['query'][_0xc206('0x1e')]);_0x3ac8d5[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x5b387d['query']['offset']);}_0x3ac8d5[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x5b387d[_0xc206('0x3c')][_0xc206('0x44')]);_0x3ac8d5[_0xc206('0x45')]=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x5b387d[_0xc206('0x3c')],_0x587378['filters']));_0x3ac8d5[_0xc206('0x45')][_0xc206('0x63')]=_0x5a9777['id'];if(_0x5b387d['query']['filter']){_0x3ac8d5[_0xc206('0x45')]=_[_0xc206('0x48')](_0x3ac8d5[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x3ac8d5[_0xc206('0x3f')],function(_0x35022e){var _0x465f14={};_0x465f14[_0x35022e]={'$like':'%'+_0x5b387d[_0xc206('0x3c')]['filter']+'%'};return _0x465f14;})});}_0x3ac8d5=_[_0xc206('0x48')]({},_0x3ac8d5,_0x5b387d['options']);return db['CmHopperFinal'][_0xc206('0x4a')]({'where':_0x3ac8d5[_0xc206('0x45')]})[_0xc206('0x2f')](function(_0x48594e){_0x5c067c['count']=_0x48594e;if(_0x5b387d[_0xc206('0x3c')]['includeAll']){_0x3ac8d5['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xc206('0x4c')](_0x3ac8d5);})[_0xc206('0x2f')](function(_0x2c5346){_0x5c067c['rows']=_0x2c5346;return _0x5c067c;});}})[_0xc206('0x2f')](respondWithFilteredResult(_0x72e777,_0x3ac8d5))['catch'](handleError(_0x72e777,null));};exports[_0xc206('0x69')]=function(_0x577ebb,_0x16926d,_0x46a742){var _0x5ce35e={'raw':!![],'where':{}};var _0x233a3a={};var _0x198d7a={'count':0x0,'rows':[]};return db[_0xc206('0x37')][_0xc206('0x60')]({'where':{'id':_0x577ebb[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x16926d,null))[_0xc206('0x2f')](function(_0x19f642){if(_0x19f642){_0x233a3a[_0xc206('0x3b')]=_['keys'](db[_0xc206('0x6a')]['rawAttributes']);_0x233a3a[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x577ebb[_0xc206('0x3c')]);_0x233a3a[_0xc206('0x3d')]=_[_0xc206('0x3e')](_0x233a3a[_0xc206('0x3b')],_0x233a3a[_0xc206('0x3c')]);_0x5ce35e[_0xc206('0x3f')]=_['intersection'](_0x233a3a[_0xc206('0x3b')],qs[_0xc206('0x40')](_0x577ebb[_0xc206('0x3c')][_0xc206('0x40')]));_0x5ce35e[_0xc206('0x3f')]=_0x5ce35e[_0xc206('0x3f')][_0xc206('0x41')]?_0x5ce35e[_0xc206('0x3f')]:_0x233a3a['model'];if(!_0x577ebb[_0xc206('0x3c')]['hasOwnProperty']('nolimit')){_0x5ce35e[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x577ebb[_0xc206('0x3c')][_0xc206('0x1e')]);_0x5ce35e[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x577ebb[_0xc206('0x3c')][_0xc206('0x1f')]);}_0x5ce35e[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x577ebb[_0xc206('0x3c')][_0xc206('0x44')]);_0x5ce35e['where']=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x577ebb[_0xc206('0x3c')],_0x233a3a[_0xc206('0x3d')]));_0x5ce35e['where'][_0xc206('0x63')]=_0x19f642['id'];if(_0x577ebb[_0xc206('0x3c')][_0xc206('0x27')]){_0x5ce35e[_0xc206('0x45')]=_[_0xc206('0x48')](_0x5ce35e[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x5ce35e['attributes'],function(_0x47d47c){var _0x44d850={};_0x44d850[_0x47d47c]={'$like':'%'+_0x577ebb[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x44d850;})});}_0x5ce35e=_[_0xc206('0x48')]({},_0x5ce35e,_0x577ebb['options']);return db[_0xc206('0x6a')]['count']({'where':_0x5ce35e[_0xc206('0x45')]})['then'](function(_0x35c1c4){_0x198d7a[_0xc206('0x4a')]=_0x35c1c4;if(_0x577ebb[_0xc206('0x3c')]['includeAll']){_0x5ce35e[_0xc206('0x50')]=[{'all':!![]}];}return db[_0xc206('0x6a')]['findAll'](_0x5ce35e);})[_0xc206('0x2f')](function(_0x3ea4b8){_0x198d7a['rows']=_0x3ea4b8;return _0x198d7a;});}})[_0xc206('0x2f')](respondWithFilteredResult(_0x16926d,_0x5ce35e))[_0xc206('0x51')](handleError(_0x16926d,null));};exports['getTeams']=function(_0x27cdef,_0x1ea42f,_0x45ce9a){var _0x435c59={};var _0x305737={};var _0x1fc9ba;var _0x19bf94;return db['VoiceQueue']['findOne']({'where':{'id':_0x27cdef[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x1ea42f,null))[_0xc206('0x2f')](function(_0xf8612b){if(_0xf8612b){_0x1fc9ba=_0xf8612b;_0x305737[_0xc206('0x3b')]=_[_0xc206('0x4f')](db['Team'][_0xc206('0x38')]);_0x305737['query']=_[_0xc206('0x4f')](_0x27cdef[_0xc206('0x3c')]);_0x305737['filters']=_[_0xc206('0x3e')](_0x305737[_0xc206('0x3b')],_0x305737['query']);_0x435c59[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x305737[_0xc206('0x3b')],qs['fields'](_0x27cdef[_0xc206('0x3c')][_0xc206('0x40')]));_0x435c59[_0xc206('0x3f')]=_0x435c59[_0xc206('0x3f')][_0xc206('0x41')]?_0x435c59['attributes']:_0x305737[_0xc206('0x3b')];_0x435c59[_0xc206('0x43')]=qs['sort'](_0x27cdef[_0xc206('0x3c')][_0xc206('0x44')]);_0x435c59['where']=qs[_0xc206('0x3d')](_['pick'](_0x27cdef['query'],_0x305737[_0xc206('0x3d')]));if(_0x27cdef[_0xc206('0x3c')]['filter']){_0x435c59['where']=_[_0xc206('0x48')](_0x435c59[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x435c59[_0xc206('0x3f')],function(_0x2908c1){var _0x2f6e9e={};_0x2f6e9e[_0x2908c1]={'$like':'%'+_0x27cdef[_0xc206('0x3c')]['filter']+'%'};return _0x2f6e9e;})});}_0x435c59=_[_0xc206('0x48')]({},_0x435c59,_0x27cdef[_0xc206('0x49')]);return _0x1fc9ba[_0xc206('0x6b')](_0x435c59);}})[_0xc206('0x2f')](function(_0xe86d5b){if(_0xe86d5b){_0x19bf94=_0xe86d5b[_0xc206('0x41')];if(!_0x27cdef[_0xc206('0x3c')]['hasOwnProperty'](_0xc206('0x62'))){_0x435c59[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x27cdef[_0xc206('0x3c')][_0xc206('0x1e')]);_0x435c59[_0xc206('0x1f')]=qs['offset'](_0x27cdef[_0xc206('0x3c')][_0xc206('0x1f')]);}return _0x1fc9ba['getTeams'](_0x435c59);}})['then'](function(_0x6a5056){if(_0x6a5056){return _0x6a5056?{'count':_0x19bf94,'rows':_0x6a5056}:null;}})[_0xc206('0x2f')](respondWithResult(_0x1ea42f,null))[_0xc206('0x51')](handleError(_0x1ea42f,null));};exports[_0xc206('0x6c')]=function(_0x3a6aa6,_0x2003f5,_0x2b5e59){var _0x5bbac4=_0x3a6aa6[_0xc206('0x53')][_0xc206('0x6d')];var _0x23fc5e=_[_0xc206('0x29')](_0x5bbac4,'id');return db[_0xc206('0x6e')]['findAll']({'where':{'id':_0x23fc5e},'attributes':['id'],'include':[{'model':db[_0xc206('0x6f')],'as':_0xc206('0x70'),'attributes':['id','name','online',_0xc206('0x71'),_0xc206('0x72')],'raw':!![]}]})[_0xc206('0x2f')](function(_0x3f5b3a){if(_0x3f5b3a){var _0x464441=_[_0xc206('0x73')](_0x3f5b3a,function(_0x8bf1f5){var _0x565792=_0x8bf1f5['get']({'plain':!![]});_0x565792[_0xc206('0x70')][_0xc206('0x74')](function(_0x43c8f9){_0x43c8f9[_0xc206('0x75')]=_['find'](_0x5bbac4,{'id':_0x565792['id']})[_0xc206('0x75')];});return _0x565792[_0xc206('0x70')];});return db['VoiceQueue']['find']({'where':{'id':_0x3a6aa6[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](function(_0x27578a){return db[_0xc206('0x76')][_0xc206('0x77')](function(_0x21f476){return _0x27578a[_0xc206('0x6c')](_0x23fc5e,{'transaction':_0x21f476})[_0xc206('0x2f')](function(){return BPromise[_0xc206('0x78')](_0x5bbac4,function(_0x126b82){return db[_0xc206('0x79')]['upsert']({'TeamId':_0x126b82['id'],'VoiceQueueId':_0x3a6aa6[_0xc206('0x4e')]['id'],'penalty':_0x126b82[_0xc206('0x75')]},{'transaction':_0x21f476});});})[_0xc206('0x2f')](function(){return BPromise['each'](_0x464441,function(_0x42d1a5){return db[_0xc206('0x7a')][_0xc206('0x7b')]({'where':{'UserId':_0x42d1a5['id'],'VoiceQueueId':_0x3a6aa6['params']['id']},'defaults':{'penalty':_0x42d1a5[_0xc206('0x75')]},'transaction':_0x21f476});});})['then'](function(){return BPromise['each'](_[_0xc206('0x27')](_0x464441,{'online':!![]}),function(_0x29cbb7){return db[_0xc206('0x7c')]['upsert']({'membername':_0x29cbb7['name'],'UserId':_0x29cbb7['id'],'queue_name':_0x27578a['name'],'VoiceQueueId':_0x27578a['id'],'interface':_[_0xc206('0x7d')](_0x29cbb7[_0xc206('0x72')])?util[_0xc206('0x7e')](_0xc206('0x7f'),_0x29cbb7[_0xc206('0x34')]):_0x29cbb7['interface'],'paused':_0x29cbb7[_0xc206('0x71')]||![],'penalty':_0x29cbb7['penalty']},{'transaction':_0x21f476});});})[_0xc206('0x2f')](function(){_0x464441[_0xc206('0x74')](function(_0x14a43f){socket[_0xc206('0x80')]('userVoiceQueue:save',{'UserId':_0x14a43f['id'],'VoiceQueueId':_0x27578a['id']});});});});});}})['then'](respondWithStatusCode(_0x2003f5,null))[_0xc206('0x51')](handleError(_0x2003f5,null));};exports['removeTeams']=function(_0xb6328f,_0x2bba4a,_0x4cedcc){return db['Team']['findAll']({'where':{'id':_0xb6328f[_0xc206('0x3c')][_0xc206('0x81')]},'attributes':['id'],'include':[{'model':db[_0xc206('0x6f')],'as':_0xc206('0x70'),'attributes':['id'],'raw':!![]}]})[_0xc206('0x2f')](handleEntityNotFound(_0x2bba4a,null))['then'](function(_0xed9406){var _0x13b21d=_[_0xc206('0x29')](_0xed9406,'id');var _0x401374=[];var _0x22b913=[];var _0x352b2e=squel[_0xc206('0x82')]();_0x352b2e[_0xc206('0x83')]('tq.TeamId')[_0xc206('0x84')](_0xc206('0x85'),'tq')[_0xc206('0x86')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc206('0x45')](_0xc206('0x87'),_0xb6328f[_0xc206('0x4e')]['id']);for(var _0x87a2ea=0x0;_0x87a2ea<_0xed9406[_0xc206('0x41')];_0x87a2ea+=0x1){let _0x259109=_0xed9406[_0x87a2ea];for(var _0x214ce9=0x0;_0x214ce9<_0x259109[_0xc206('0x70')]['length'];_0x214ce9+=0x1){let _0x349874=_0x259109[_0xc206('0x70')][_0x214ce9];var _0x3c3e39=_0x352b2e[_0xc206('0x88')]();_0x3c3e39[_0xc206('0x45')](_0xc206('0x89'),_0x349874['id']);_0x22b913[_0xc206('0x8a')](db[_0xc206('0x76')][_0xc206('0x3c')](_0x3c3e39[_0xc206('0x8b')](),{'type':db[_0xc206('0x76')]['QueryTypes'][_0xc206('0x8c')]})[_0xc206('0x2f')](function(_0xa80c98){if(_0xa80c98['length']===0x1){return _0x349874['id'];}else{var _0x148339=_[_0xc206('0x8d')](_['map'](_0xa80c98,_0xc206('0x8e')),function(_0x468432){return _[_0xc206('0x2b')](_0x13b21d,_0x468432);});if(_0x148339){return _0x349874['id'];}}}));}}return BPromise[_0xc206('0x8f')](_0x22b913)[_0xc206('0x2f')](function(_0x4e49c2){_0x401374=_(_0x401374)[_0xc206('0x90')](_0x4e49c2)[_0xc206('0x91')]()[_0xc206('0x2a')]();return db[_0xc206('0x37')][_0xc206('0x2d')]({'where':{'id':_0xb6328f[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](function(_0x38bbe9){return db[_0xc206('0x76')][_0xc206('0x77')](function(_0x102a1e){return _0x38bbe9[_0xc206('0x92')](_0xb6328f['query'][_0xc206('0x81')],{'transaction':_0x102a1e})[_0xc206('0x2f')](function(){if(!_[_0xc206('0x93')](_0x401374)){return _0x38bbe9[_0xc206('0x94')](_0x401374,{'transaction':_0x102a1e})[_0xc206('0x2f')](function(){return db['UserVoiceQueueRt'][_0xc206('0x95')]({'where':{'VoiceQueueId':_0xb6328f['params']['id'],'UserId':_0x401374},'transaction':_0x102a1e});});}})[_0xc206('0x2f')](function(){_0x401374[_0xc206('0x74')](function(_0x3db8ea){socket[_0xc206('0x80')](_0xc206('0x96'),{'UserId':_0x3db8ea,'VoiceQueueId':_0x38bbe9['id']});});});});});});})[_0xc206('0x2f')](respondWithStatusCode(_0x2bba4a,null))[_0xc206('0x51')](handleError(_0x2bba4a,null));};exports[_0xc206('0x97')]=function(_0x3c4938,_0x3a3e51,_0x148809){var _0x27784f,_0x11fb50;return db[_0xc206('0x37')][_0xc206('0x2d')]({'where':{'id':_0x3c4938[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x3a3e51,null))['then'](function(_0x5ba6e2){if(_0x5ba6e2){_0x11fb50=_0x5ba6e2;return _0x5ba6e2[_0xc206('0x97')](_0x3c4938['body'][_0xc206('0x81')],_['omit'](_0x3c4938['body'],[_0xc206('0x81'),'id'])||{})['spread'](function(_0x1899a2){for(var _0x4eba27=0x0;_0x4eba27<_0x3c4938[_0xc206('0x53')]['ids'][_0xc206('0x41')];_0x4eba27+=0x1){socket[_0xc206('0x80')](_0xc206('0x98'),{'UserId':Number(_0x3c4938['body']['ids'][_0x4eba27]),'VoiceQueueId':Number(_0x3c4938[_0xc206('0x4e')]['id'])});}return _0x1899a2;});}})[_0xc206('0x2f')](function(_0x31326a){_0x27784f=_0x31326a||[];if(_0x11fb50){return db[_0xc206('0x6f')][_0xc206('0x4c')]({'where':{'id':_0x3c4938['body']['ids']},'attributes':['id',_0xc206('0x34'),'online','voicePause',_0xc206('0x72')],'raw':!![]});}})['then'](function(_0x2d9747){if(!_[_0xc206('0x93')](_0x2d9747)){var _0x13b9ce=[];for(var _0x1aae08=0x0;_0x1aae08<_0x2d9747[_0xc206('0x41')];_0x1aae08++){if(_0x2d9747[_0x1aae08]['online']){_0x13b9ce['push'](db[_0xc206('0x7c')]['upsert']({'membername':_0x2d9747[_0x1aae08]['name'],'UserId':_0x2d9747[_0x1aae08]['id'],'queue_name':_0x11fb50[_0xc206('0x34')],'VoiceQueueId':_0x11fb50['id'],'interface':_[_0xc206('0x7d')](_0x2d9747[_0x1aae08][_0xc206('0x72')])?util['format']('SIP/%s',_0x2d9747[_0x1aae08][_0xc206('0x34')]):_0x2d9747[_0x1aae08][_0xc206('0x72')],'paused':_0x2d9747[_0x1aae08]['voicePause']||![],'penalty':_0x3c4938[_0xc206('0x53')][_0xc206('0x75')]||0x0}));}}return BPromise['all'](_0x13b9ce);}})[_0xc206('0x2f')](function(){return _0x27784f;})[_0xc206('0x2f')](respondWithResult(_0x3a3e51,null))['catch'](handleError(_0x3a3e51,null));};exports['removeAgents']=function(_0x2f0d4a,_0x177caf,_0x493937){return db[_0xc206('0x37')]['find']({'where':{'id':_0x2f0d4a['params']['id']}})['then'](handleEntityNotFound(_0x177caf,null))[_0xc206('0x2f')](function(_0x12c484){if(_0x12c484){return _0x12c484[_0xc206('0x94')](_0x2f0d4a['query'][_0xc206('0x81')])[_0xc206('0x2f')](function(){if(_[_0xc206('0x99')](_0x2f0d4a[_0xc206('0x3c')][_0xc206('0x81')])){for(var _0xa1064a=0x0;_0xa1064a<_0x2f0d4a[_0xc206('0x3c')][_0xc206('0x81')][_0xc206('0x41')];_0xa1064a+=0x1){socket['emit'](_0xc206('0x96'),{'UserId':Number(_0x2f0d4a[_0xc206('0x3c')][_0xc206('0x81')][_0xa1064a]),'VoiceQueueId':Number(_0x2f0d4a['params']['id'])});}}else{socket[_0xc206('0x80')](_0xc206('0x96'),{'UserId':Number(_0x2f0d4a[_0xc206('0x3c')][_0xc206('0x81')]),'VoiceQueueId':Number(_0x2f0d4a['params']['id'])});}});}})[_0xc206('0x2f')](function(_0x25ac7d){return db['UserVoiceQueueRt'][_0xc206('0x95')]({'where':{'VoiceQueueId':_0x2f0d4a[_0xc206('0x4e')]['id'],'UserId':_0x2f0d4a['query'][_0xc206('0x81')]}})['then'](function(){return _0x25ac7d;});})[_0xc206('0x2f')](respondWithStatusCode(_0x177caf,null))[_0xc206('0x51')](handleError(_0x177caf,null));};exports[_0xc206('0x9a')]=function(_0x277a11,_0x154c1f,_0x48f3ca){var _0x4b862f={};var _0x197a5e={};var _0x32fe5c;var _0x33db7c;return db[_0xc206('0x37')]['findOne']({'where':{'id':_0x277a11[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x154c1f,null))[_0xc206('0x2f')](function(_0x18f6f4){if(_0x18f6f4){_0x32fe5c=_0x18f6f4;_0x197a5e[_0xc206('0x3b')]=_[_0xc206('0x4f')](db[_0xc206('0x6f')][_0xc206('0x38')]);_0x197a5e[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x277a11[_0xc206('0x3c')]);_0x197a5e[_0xc206('0x3d')]=_[_0xc206('0x3e')](_0x197a5e[_0xc206('0x3b')],_0x197a5e[_0xc206('0x3c')]);_0x4b862f['attributes']=_[_0xc206('0x3e')](_0x197a5e[_0xc206('0x3b')],qs[_0xc206('0x40')](_0x277a11[_0xc206('0x3c')][_0xc206('0x40')]));_0x4b862f['attributes']=_0x4b862f[_0xc206('0x3f')][_0xc206('0x41')]?_0x4b862f[_0xc206('0x3f')]:_0x197a5e[_0xc206('0x3b')];_0x4b862f[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x277a11[_0xc206('0x3c')]['sort']);_0x4b862f[_0xc206('0x45')]=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x277a11['query'],_0x197a5e[_0xc206('0x3d')]));if(_0x277a11[_0xc206('0x3c')][_0xc206('0x27')]){_0x4b862f[_0xc206('0x45')]=_[_0xc206('0x48')](_0x4b862f[_0xc206('0x45')],{'$or':_['map'](_0x4b862f[_0xc206('0x3f')],function(_0x2d6a5d){var _0x49382c={};_0x49382c[_0x2d6a5d]={'$like':'%'+_0x277a11[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x49382c;})});}_0x4b862f=_[_0xc206('0x48')]({},_0x4b862f,_0x277a11[_0xc206('0x49')]);return _0x32fe5c[_0xc206('0x9a')](_0x4b862f);}})[_0xc206('0x2f')](function(_0x15cd58){if(_0x15cd58){_0x33db7c=_0x15cd58[_0xc206('0x41')];if(!_0x277a11[_0xc206('0x3c')]['hasOwnProperty'](_0xc206('0x62'))){_0x4b862f[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x277a11[_0xc206('0x3c')][_0xc206('0x1e')]);_0x4b862f[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x277a11['query'][_0xc206('0x1f')]);}return _0x32fe5c[_0xc206('0x9a')](_0x4b862f);}})[_0xc206('0x2f')](function(_0x56a3ba){if(_0x56a3ba){return _0x56a3ba?{'count':_0x33db7c,'rows':_0x56a3ba}:null;}})['then'](respondWithResult(_0x154c1f,null))['catch'](handleError(_0x154c1f,null));};exports[_0xc206('0x9b')]=function(_0x3bcd2e,_0x19b6ae,_0x581cc8){var _0x40ad80={};var _0x2456e0={};var _0x3cd09e;var _0x221e82;return db[_0xc206('0x37')][_0xc206('0x60')]({'where':{'id':_0x3bcd2e['params']['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x19b6ae,null))[_0xc206('0x2f')](function(_0x50b8b4){if(_0x50b8b4){_0x3cd09e=_0x50b8b4;_0x2456e0['model']=_[_0xc206('0x4f')](db[_0xc206('0x7c')][_0xc206('0x38')]);_0x2456e0['query']=_[_0xc206('0x4f')](_0x3bcd2e[_0xc206('0x3c')]);_0x2456e0['filters']=_['intersection'](_0x2456e0[_0xc206('0x3b')],_0x2456e0[_0xc206('0x3c')]);_0x40ad80[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x2456e0['model'],qs[_0xc206('0x40')](_0x3bcd2e[_0xc206('0x3c')][_0xc206('0x40')]));_0x40ad80['attributes']=_0x40ad80[_0xc206('0x3f')][_0xc206('0x41')]?_0x40ad80[_0xc206('0x3f')]:_0x2456e0[_0xc206('0x3b')];_0x40ad80['order']=qs[_0xc206('0x44')](_0x3bcd2e['query'][_0xc206('0x44')]);_0x40ad80[_0xc206('0x45')]=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x3bcd2e[_0xc206('0x3c')],_0x2456e0[_0xc206('0x3d')]));if(_0x3bcd2e['query'][_0xc206('0x27')]){_0x40ad80['where']=_['merge'](_0x40ad80['where'],{'$or':_['map'](_0x40ad80[_0xc206('0x3f')],function(_0x42fc70){var _0x1aa806={};_0x1aa806[_0x42fc70]={'$like':'%'+_0x3bcd2e[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x1aa806;})});}_0x40ad80=_['merge']({},_0x40ad80,_0x3bcd2e[_0xc206('0x49')]);return _0x3cd09e[_0xc206('0x9b')](_0x40ad80);}})[_0xc206('0x2f')](function(_0x343215){if(_0x343215){_0x221e82=_0x343215['length'];if(!_0x3bcd2e[_0xc206('0x3c')][_0xc206('0x42')]('nolimit')){_0x40ad80[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x3bcd2e[_0xc206('0x3c')][_0xc206('0x1e')]);_0x40ad80['offset']=qs['offset'](_0x3bcd2e['query']['offset']);}return _0x3cd09e[_0xc206('0x9b')](_0x40ad80);}})[_0xc206('0x2f')](function(_0xddb6f1){return _0xddb6f1?{'count':_0x221e82,'rows':_0xddb6f1}:null;})[_0xc206('0x2f')](respondWithResult(_0x19b6ae,null))['catch'](handleError(_0x19b6ae,null));};exports[_0xc206('0x9c')]=function(_0x32efc5,_0x56f244,_0x4a20d2){var _0xa19dea={};var _0x2ef7e3={};var _0x17789b;var _0x2a8006;return db[_0xc206('0x37')]['findOne']({'where':{'id':_0x32efc5['params']['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x56f244,null))['then'](function(_0x46d8ca){if(_0x46d8ca){_0x17789b=_0x46d8ca;_0x2ef7e3['model']=_[_0xc206('0x4f')](db['CmList'][_0xc206('0x38')]);_0x2ef7e3[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x32efc5['query']);_0x2ef7e3['filters']=_['intersection'](_0x2ef7e3[_0xc206('0x3b')],_0x2ef7e3[_0xc206('0x3c')]);_0xa19dea[_0xc206('0x3f')]=_['intersection'](_0x2ef7e3[_0xc206('0x3b')],qs[_0xc206('0x40')](_0x32efc5['query'][_0xc206('0x40')]));_0xa19dea[_0xc206('0x3f')]=_0xa19dea['attributes'][_0xc206('0x41')]?_0xa19dea[_0xc206('0x3f')]:_0x2ef7e3[_0xc206('0x3b')];_0xa19dea[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x32efc5['query'][_0xc206('0x44')]);_0xa19dea['where']=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x32efc5['query'],_0x2ef7e3[_0xc206('0x3d')]));if(_0x32efc5[_0xc206('0x3c')][_0xc206('0x27')]){_0xa19dea[_0xc206('0x45')]=_[_0xc206('0x48')](_0xa19dea[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0xa19dea[_0xc206('0x3f')],function(_0x2b60f1){var _0x48c6a1={};_0x48c6a1[_0x2b60f1]={'$like':'%'+_0x32efc5[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x48c6a1;})});}_0xa19dea=_[_0xc206('0x48')]({},_0xa19dea,_0x32efc5[_0xc206('0x49')]);return _0x17789b[_0xc206('0x9c')](_0xa19dea);}})[_0xc206('0x2f')](function(_0x5361f6){if(_0x5361f6){_0x2a8006=_0x5361f6['length'];if(!_0x32efc5['query']['hasOwnProperty'](_0xc206('0x62'))){_0xa19dea[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x32efc5[_0xc206('0x3c')][_0xc206('0x1e')]);_0xa19dea[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x32efc5[_0xc206('0x3c')][_0xc206('0x1f')]);}return _0x17789b['getLists'](_0xa19dea);}})[_0xc206('0x2f')](function(_0x2a42b3){if(_0x2a42b3){return _0x2a42b3?{'count':_0x2a8006,'rows':_0x2a42b3}:null;}})[_0xc206('0x2f')](respondWithResult(_0x56f244,null))[_0xc206('0x51')](handleError(_0x56f244,null));};exports[_0xc206('0x9d')]=function(_0x2f13b4,_0x4875b4,_0x469c26){var _0x31a5f1,_0x213598;return db[_0xc206('0x37')][_0xc206('0x2d')]({'where':{'id':_0x2f13b4[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x4875b4,null))[_0xc206('0x2f')](function(_0x4a6d38){if(_0x4a6d38){_0x213598=_0x4a6d38;return _0x4a6d38[_0xc206('0x9d')](_0x2f13b4['body'][_0xc206('0x81')],_['omit'](_0x2f13b4['body'],[_0xc206('0x81'),'id'])||{});}return null;})[_0xc206('0x9e')](function(_0x1933e2){var _0x5c6912;_0x31a5f1=_0x1933e2||[];var _0x58c884=[];if(_0x1933e2){for(var _0x436e65=0x0;_0x436e65<_0x1933e2[_0xc206('0x41')];_0x436e65+=0x1){var _0x66b9d1=_0x1933e2[_0x436e65][_0xc206('0x24')]({'plain':!![]});_0x213598['dialCheckDuplicateType']=_0x2f13b4['body'][_0xc206('0x9f')]?_0x2f13b4['body'][_0xc206('0x9f')]:_0x213598['dialCheckDuplicateType'];switch(_0x213598[_0xc206('0x9f')]){case _0xc206('0xa0'):_0x5c6912=squel[_0xc206('0xa1')]()['into'](_0xc206('0xa2'))[_0xc206('0xa3')]([_0xc206('0xa4'),_0xc206('0xa5'),_0xc206('0xa6'),_0xc206('0xa7'),_0xc206('0x63'),_0xc206('0xa8'),_0xc206('0x5c')],squel[_0xc206('0x82')]()[_0xc206('0x83')](_0xc206('0xa4'),_0xc206('0xa4'))['field'](_0xc206('0xa9'),'scheduledAt')[_0xc206('0x83')]('id',_0xc206('0xa6'))[_0xc206('0x83')](_0x66b9d1[_0xc206('0xaa')][_0xc206('0x8b')](),_0xc206('0xa7'))[_0xc206('0x83')](_0x2f13b4['params']['id'][_0xc206('0x8b')](),'VoiceQueueId')['field']('NOW()',_0xc206('0xa8'))['field'](_0xc206('0xa9'),_0xc206('0x5c'))[_0xc206('0x84')](_0xc206('0xab'))[_0xc206('0x45')](_0xc206('0xac'))[_0xc206('0x45')]('ListId\x20=\x20?',_0x66b9d1[_0xc206('0xaa')][_0xc206('0x8b')]())[_0xc206('0x45')](_0xc206('0xad'))[_0xc206('0x45')](_0xc206('0xae'),squel[_0xc206('0x82')]()[_0xc206('0x83')](_0xc206('0xaf'))['from'](_0xc206('0xb0'))[_0xc206('0x45')](_0xc206('0x87'),_0x2f13b4[_0xc206('0x4e')]['id'][_0xc206('0x8b')]()))[_0xc206('0x45')](_0xc206('0xae'),squel[_0xc206('0x82')]()[_0xc206('0x83')](_0xc206('0xb1'))[_0xc206('0x84')](_0xc206('0xa2'))[_0xc206('0x45')](_0xc206('0x87'),_0x2f13b4['params']['id'][_0xc206('0x8b')]())))[_0xc206('0x8b')]();break;case _0xc206('0xb2'):_0x5c6912=squel['insert']()[_0xc206('0xb3')](_0xc206('0xa2'))['fromQuery']([_0xc206('0xa4'),'scheduledAt','ContactId',_0xc206('0xa7'),_0xc206('0x63'),'createdAt',_0xc206('0x5c')],squel[_0xc206('0x82')]()['field'](_0xc206('0xa4'),_0xc206('0xa4'))[_0xc206('0x83')](_0xc206('0xa9'),'scheduledAt')['field']('id',_0xc206('0xa6'))[_0xc206('0x83')](_0x66b9d1[_0xc206('0xaa')][_0xc206('0x8b')](),_0xc206('0xa7'))[_0xc206('0x83')](_0x2f13b4['params']['id'][_0xc206('0x8b')](),_0xc206('0x63'))['field'](_0xc206('0xa9'),_0xc206('0xa8'))['field']('NOW()','updatedAt')[_0xc206('0x84')](_0xc206('0xab'))['where'](_0xc206('0xac'))[_0xc206('0x45')](_0xc206('0xb4'),_0x66b9d1[_0xc206('0xaa')][_0xc206('0x8b')]())[_0xc206('0x45')](_0xc206('0xad'))['where'](_0xc206('0xae'),squel[_0xc206('0x82')]()[_0xc206('0x83')]('COALESCE(phone,\x27\x27)')[_0xc206('0x84')](_0xc206('0xa2'))['where']('VoiceQueueId\x20=\x20?',_0x2f13b4[_0xc206('0x4e')]['id']['toString']())))['toString']();break;default:_0x5c6912=squel[_0xc206('0xa1')]()[_0xc206('0xb3')](_0xc206('0xa2'))[_0xc206('0xa3')]([_0xc206('0xa4'),_0xc206('0xa5'),_0xc206('0xa6'),_0xc206('0xa7'),_0xc206('0x63'),'createdAt',_0xc206('0x5c')],squel[_0xc206('0x82')]()['field']('phone',_0xc206('0xa4'))[_0xc206('0x83')](_0xc206('0xa9'),_0xc206('0xa5'))[_0xc206('0x83')]('id','ContactId')[_0xc206('0x83')](_0x66b9d1[_0xc206('0xaa')]['toString'](),_0xc206('0xa7'))[_0xc206('0x83')](_0x2f13b4[_0xc206('0x4e')]['id'][_0xc206('0x8b')](),_0xc206('0x63'))['field'](_0xc206('0xa9'),_0xc206('0xa8'))['field']('NOW()',_0xc206('0x5c'))['from'](_0xc206('0xab'))[_0xc206('0x45')](_0xc206('0xac'))[_0xc206('0x45')]('ListId\x20=\x20?',_0x66b9d1[_0xc206('0xaa')]['toString']())[_0xc206('0x45')](_0xc206('0xad')))['toString']();}_0x58c884['push'](db[_0xc206('0x76')]['query'](_0x5c6912));}return BPromise[_0xc206('0x8f')](_0x58c884);}})[_0xc206('0x2f')](function(){return _0x31a5f1;})[_0xc206('0x2f')](respondWithResult(_0x4875b4,null))[_0xc206('0x51')](handleError(_0x4875b4,null));};exports[_0xc206('0xb5')]=function(_0x10404d,_0x3a62ff,_0x558f58){return db[_0xc206('0x37')]['find']({'where':{'id':_0x10404d[_0xc206('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3a62ff,null))['then'](function(_0x548f71){if(_0x548f71){return _0x548f71[_0xc206('0xb5')](_0x10404d[_0xc206('0x3c')][_0xc206('0x81')]);}})['then'](function(_0x31a849){if(_0x31a849){return db[_0xc206('0x61')][_0xc206('0x95')]({'where':{'ListId':_0x10404d['query'][_0xc206('0x81')],'VoiceQueueId':_0x10404d[_0xc206('0x4e')]['id']}})['then'](function(){return _0x31a849;});}})[_0xc206('0x2f')](respondWithStatusCode(_0x3a62ff,null))[_0xc206('0x51')](handleError(_0x3a62ff,null));};exports[_0xc206('0xb6')]=function(_0x3d1c23,_0x132fe8,_0x508ddf){var _0x1920b6={};var _0x509a97={};var _0x22bdd3;var _0x3d1c61;return db[_0xc206('0x37')][_0xc206('0x60')]({'where':{'id':_0x3d1c23[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x132fe8,null))[_0xc206('0x2f')](function(_0x37128b){if(_0x37128b){_0x22bdd3=_0x37128b;_0x509a97[_0xc206('0x3b')]=_[_0xc206('0x4f')](db[_0xc206('0xb7')][_0xc206('0x38')]);_0x509a97[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x3d1c23[_0xc206('0x3c')]);_0x509a97['filters']=_[_0xc206('0x3e')](_0x509a97[_0xc206('0x3b')],_0x509a97['query']);_0x1920b6[_0xc206('0x3f')]=_['intersection'](_0x509a97['model'],qs['fields'](_0x3d1c23[_0xc206('0x3c')][_0xc206('0x40')]));_0x1920b6[_0xc206('0x3f')]=_0x1920b6[_0xc206('0x3f')]['length']?_0x1920b6[_0xc206('0x3f')]:_0x509a97[_0xc206('0x3b')];_0x1920b6[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x3d1c23[_0xc206('0x3c')][_0xc206('0x44')]);_0x1920b6['where']=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x3d1c23[_0xc206('0x3c')],_0x509a97['filters']));if(_0x3d1c23[_0xc206('0x3c')][_0xc206('0x27')]){_0x1920b6[_0xc206('0x45')]=_['merge'](_0x1920b6[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x1920b6[_0xc206('0x3f')],function(_0x46ba19){var _0x403543={};_0x403543[_0x46ba19]={'$like':'%'+_0x3d1c23[_0xc206('0x3c')]['filter']+'%'};return _0x403543;})});}_0x1920b6=_[_0xc206('0x48')]({},_0x1920b6,_0x3d1c23[_0xc206('0x49')]);return _0x22bdd3[_0xc206('0xb6')](_0x1920b6);}})[_0xc206('0x2f')](function(_0x4d9bfa){if(_0x4d9bfa){_0x3d1c61=_0x4d9bfa[_0xc206('0x41')];if(!_0x3d1c23[_0xc206('0x3c')]['hasOwnProperty'](_0xc206('0x62'))){_0x1920b6[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x3d1c23[_0xc206('0x3c')]['limit']);_0x1920b6[_0xc206('0x1f')]=qs['offset'](_0x3d1c23[_0xc206('0x3c')][_0xc206('0x1f')]);}return _0x22bdd3[_0xc206('0xb6')](_0x1920b6);}})[_0xc206('0x2f')](function(_0x583e3b){if(_0x583e3b){return _0x583e3b?{'count':_0x3d1c61,'rows':_0x583e3b}:null;}})[_0xc206('0x2f')](respondWithResult(_0x132fe8,null))['catch'](handleError(_0x132fe8,null));};exports[_0xc206('0xb8')]=function(_0x40cb0c,_0x3220d7,_0x125c06){var _0xa27a2d,_0x32907a;return db['VoiceQueue'][_0xc206('0x2d')]({'where':{'id':_0x40cb0c['params']['id']}})['then'](handleEntityNotFound(_0x3220d7,null))[_0xc206('0x2f')](function(_0x42e86d){if(_0x42e86d){_0x32907a=_0x42e86d;return _0x42e86d['addBlackLists'](_0x40cb0c[_0xc206('0x53')][_0xc206('0x81')],_[_0xc206('0x5b')](_0x40cb0c['body'],[_0xc206('0x81'),'id'])||{});}return null;})[_0xc206('0x9e')](function(_0x3d7584){var _0x3335d9;_0xa27a2d=_0x3d7584||[];var _0x40d7f0=[];if(_0x3d7584){for(var _0x33786a=0x0;_0x33786a<_0x3d7584[_0xc206('0x41')];_0x33786a+=0x1){var _0x2586cf=_0x3d7584[_0x33786a]['get']({'plain':!![]});_0x3335d9=squel[_0xc206('0xa1')]()[_0xc206('0xb3')](_0xc206('0xb9'))[_0xc206('0xa3')]([_0xc206('0xa4'),'ContactId',_0xc206('0xa7'),_0xc206('0x63'),'createdAt',_0xc206('0x5c')],squel[_0xc206('0x82')]()[_0xc206('0x83')](_0xc206('0xa4'),'phone')[_0xc206('0x83')]('id','ContactId')[_0xc206('0x83')](_0x2586cf[_0xc206('0xaa')][_0xc206('0x8b')](),_0xc206('0xa7'))[_0xc206('0x83')](_0x40cb0c[_0xc206('0x4e')]['id']['toString'](),'VoiceQueueId')[_0xc206('0x83')](_0xc206('0xa9'),_0xc206('0xa8'))['field'](_0xc206('0xa9'),_0xc206('0x5c'))['from'](_0xc206('0xab'))[_0xc206('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0xc206('0xb4'),_0x2586cf[_0xc206('0xaa')][_0xc206('0x8b')]())['where'](_0xc206('0xad')))[_0xc206('0x8b')]();_0x40d7f0[_0xc206('0x8a')](db[_0xc206('0x76')][_0xc206('0x3c')](_0x3335d9));}return BPromise[_0xc206('0x8f')](_0x40d7f0);}})[_0xc206('0x2f')](function(){return _0xa27a2d;})['then'](respondWithResult(_0x3220d7,null))[_0xc206('0x51')](handleError(_0x3220d7,null));};exports[_0xc206('0xba')]=function(_0x4e0b09,_0x1241a7,_0x3b3515){return db[_0xc206('0x37')]['find']({'where':{'id':_0x4e0b09[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x1241a7,null))[_0xc206('0x2f')](function(_0x12cdea){if(_0x12cdea){return _0x12cdea[_0xc206('0xba')](_0x4e0b09[_0xc206('0x3c')][_0xc206('0x81')]);}})[_0xc206('0x2f')](function(_0x2fd9e0){if(_0x2fd9e0){return db['CmHopperBlack'][_0xc206('0x95')]({'where':{'ListId':_0x4e0b09['query'][_0xc206('0x81')],'VoiceQueueId':_0x4e0b09[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](function(){return _0x2fd9e0;});}})['then'](respondWithStatusCode(_0x1241a7,null))[_0xc206('0x51')](handleError(_0x1241a7,null));}; \ No newline at end of file +var _0x87be=['ContactId','ListId','createdAt','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','insert','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','VoiceQueues','outbound','map','includes','type','value','end','error','stack','send','VoiceQueue','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','updatedAt','update','CmHopper','sort','VoiceQueueId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','penalty','Agents','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','forEach','emit','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','union','transaction','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','isEmpty','all','removeAgents','isArray','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt'];(function(_0x21ae6f,_0x3bc3d2){var _0x37201a=function(_0x40f178){while(--_0x40f178){_0x21ae6f['push'](_0x21ae6f['shift']());}};_0x37201a(++_0x3bc3d2);}(_0x87be,0xc4));var _0xe87b=function(_0x5efe13,_0x2615c6){_0x5efe13=_0x5efe13-0x0;var _0x19d50c=_0x87be[_0x5efe13];return _0x19d50c;};'use strict';var emlformat=require(_0xe87b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe87b('0x1'));var jsonpatch=require(_0xe87b('0x2'));var rp=require(_0xe87b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe87b('0x4'));var util=require('util');var path=require(_0xe87b('0x5'));var sox=require(_0xe87b('0x6'));var csv=require(_0xe87b('0x7'));var ejs=require(_0xe87b('0x8'));var fs=require('fs');var fs_extra=require(_0xe87b('0x9'));var _=require(_0xe87b('0xa'));var squel=require(_0xe87b('0xb'));var crypto=require('crypto');var jsforce=require(_0xe87b('0xc'));var deskjs=require(_0xe87b('0xd'));var toCsv=require(_0xe87b('0x7'));var querystring=require('querystring');var Papa=require(_0xe87b('0xe'));var Redis=require('ioredis');var authService=require(_0xe87b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe87b('0x10'));var hardwareService=require(_0xe87b('0x11'));var logger=require(_0xe87b('0x12'))(_0xe87b('0x13'));var utils=require('../../config/utils');var config=require(_0xe87b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe87b('0x15'))['db'];config[_0xe87b('0x16')]=_[_0xe87b('0x17')](config[_0xe87b('0x16')],{'host':_0xe87b('0x18'),'port':0x18eb});var socket=require(_0xe87b('0x19'))(new Redis(config[_0xe87b('0x16')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x16bf03,_0x3eef56){_0x3eef56=_0x3eef56||0xcc;return function(_0x3eabc4){if(_0x3eabc4){return _0x16bf03[_0xe87b('0x1a')](_0x3eef56);}return _0x16bf03[_0xe87b('0x1b')](_0x3eef56)['end']();};}function respondWithResult(_0x11cbb6,_0x311357){_0x311357=_0x311357||0xc8;return function(_0x30b757){if(_0x30b757){return _0x11cbb6[_0xe87b('0x1b')](_0x311357)[_0xe87b('0x1c')](_0x30b757);}};}function respondWithFilteredResult(_0x2a5d89,_0x179b74){return function(_0x365ddd){if(_0x365ddd){var _0x21241e=typeof _0x179b74['offset']===_0xe87b('0x1d')&&typeof _0x179b74[_0xe87b('0x1e')]===_0xe87b('0x1d');var _0x462947=_0x365ddd[_0xe87b('0x1f')];var _0x8e3586=_0x21241e?0x0:_0x179b74[_0xe87b('0x20')];var _0x4a27cd=_0x21241e?_0x365ddd[_0xe87b('0x1f')]:_0x179b74['offset']+_0x179b74[_0xe87b('0x1e')];var _0x2a0f;if(_0x4a27cd>=_0x462947){_0x4a27cd=_0x462947;_0x2a0f=0xc8;}else{_0x2a0f=0xce;}_0x2a5d89[_0xe87b('0x1b')](_0x2a0f);return _0x2a5d89[_0xe87b('0x21')](_0xe87b('0x22'),_0x8e3586+'-'+_0x4a27cd+'/'+_0x462947)['json'](_0x365ddd);}return null;};}function patchUpdates(_0xec9aa0){return function(_0x724295){try{jsonpatch[_0xe87b('0x23')](_0x724295,_0xec9aa0,!![]);}catch(_0x3c1435){return BPromise[_0xe87b('0x24')](_0x3c1435);}return _0x724295['save']();};}function saveUpdates(_0x4ecc22,_0x1d924c){return function(_0x36a8cd){if(_0x36a8cd){return _0x36a8cd['update'](_0x4ecc22)[_0xe87b('0x25')](function(_0x28c74d){return _0x28c74d;});}return null;};}function removeEntity(_0xad04f,_0x453eae){return function(_0x180cf8){if(_0x180cf8){return _0x180cf8[_0xe87b('0x26')]()[_0xe87b('0x25')](function(){var _0x51c518=_0x180cf8['get']({'plain':!![]});var _0x2ef070=[{'name':_0xe87b('0x27'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0xe87b('0x28'),'ignore':![]}];var _0x5d2896=_(_0x2ef070)['filter']('ignore')[_0xe87b('0x29')]('value')['value']();if(_[_0xe87b('0x2a')](_0x5d2896,_0x51c518[_0xe87b('0x2b')])){return;}var _0xc8ab9a=_['find'](_0x2ef070,[_0xe87b('0x2c'),_0x51c518[_0xe87b('0x2b')]])['name'];return db['UserProfileResource'][_0xe87b('0x26')]({'where':{'type':_0xc8ab9a,'resourceId':_0x51c518['id']}})[_0xe87b('0x25')](function(){return _0x180cf8;});})[_0xe87b('0x25')](function(){_0xad04f[_0xe87b('0x1b')](0xcc)[_0xe87b('0x2d')]();});}};}function handleEntityNotFound(_0x386731,_0xca6e41){return function(_0x3fb2a1){if(!_0x3fb2a1){_0x386731[_0xe87b('0x1a')](0x194);}return _0x3fb2a1;};}function handleError(_0x53e615,_0xb60acb){_0xb60acb=_0xb60acb||0x1f4;return function(_0x142995){logger[_0xe87b('0x2e')](_0x142995[_0xe87b('0x2f')]);if(_0x142995['name']){delete _0x142995['name'];}_0x53e615['status'](_0xb60acb)[_0xe87b('0x30')](_0x142995);};}exports['index']=function(_0x35c85b,_0x25978c){var _0x38dc90={},_0x9e0b58={},_0x36a51e={'count':0x0,'rows':[]};var _0x2dd703=_[_0xe87b('0x29')](db[_0xe87b('0x31')]['rawAttributes'],function(_0x34e9e7){return{'name':_0x34e9e7['fieldName'],'type':_0x34e9e7[_0xe87b('0x2b')][_0xe87b('0x32')]};});_0x9e0b58[_0xe87b('0x33')]=_[_0xe87b('0x29')](_0x2dd703,_0xe87b('0x34'));_0x9e0b58['query']=_['keys'](_0x35c85b[_0xe87b('0x35')]);_0x9e0b58['filters']=_[_0xe87b('0x36')](_0x9e0b58['model'],_0x9e0b58[_0xe87b('0x35')]);_0x38dc90['attributes']=_[_0xe87b('0x36')](_0x9e0b58[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x35c85b[_0xe87b('0x35')][_0xe87b('0x37')]));_0x38dc90[_0xe87b('0x38')]=_0x38dc90[_0xe87b('0x38')][_0xe87b('0x39')]?_0x38dc90[_0xe87b('0x38')]:_0x9e0b58[_0xe87b('0x33')];if(!_0x35c85b['query'][_0xe87b('0x3a')](_0xe87b('0x3b'))){_0x38dc90['limit']=qs[_0xe87b('0x1e')](_0x35c85b[_0xe87b('0x35')]['limit']);_0x38dc90[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x35c85b[_0xe87b('0x35')][_0xe87b('0x20')]);}_0x38dc90[_0xe87b('0x3c')]=qs['sort'](_0x35c85b[_0xe87b('0x35')]['sort']);_0x38dc90[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x35c85b[_0xe87b('0x35')],_0x9e0b58[_0xe87b('0x3e')]),_0x2dd703);if(_0x35c85b[_0xe87b('0x35')]['filter']){_0x38dc90['where']=_[_0xe87b('0x40')](_0x38dc90[_0xe87b('0x3d')],{'$or':_[_0xe87b('0x29')](_0x2dd703,function(_0x55ea7f){if(_0x55ea7f[_0xe87b('0x2b')]!==_0xe87b('0x41')){var _0x525db4={};_0x525db4[_0x55ea7f['name']]={'$like':'%'+_0x35c85b[_0xe87b('0x35')][_0xe87b('0x42')]+'%'};return _0x525db4;}})});}_0x38dc90=_[_0xe87b('0x40')]({},_0x38dc90,_0x35c85b['options']);var _0x596097={'where':_0x38dc90[_0xe87b('0x3d')]};return db['VoiceQueue'][_0xe87b('0x1f')](_0x596097)[_0xe87b('0x25')](function(_0x33eb39){_0x36a51e[_0xe87b('0x1f')]=_0x33eb39;if(_0x35c85b['query'][_0xe87b('0x43')]){_0x38dc90[_0xe87b('0x44')]=[{'all':!![]}];}return db[_0xe87b('0x31')]['findAll'](_0x38dc90);})[_0xe87b('0x25')](function(_0x5d79a2){_0x36a51e[_0xe87b('0x45')]=_0x5d79a2;return _0x36a51e;})[_0xe87b('0x25')](respondWithFilteredResult(_0x25978c,_0x38dc90))[_0xe87b('0x46')](handleError(_0x25978c,null));};exports[_0xe87b('0x47')]=function(_0x1a90b1,_0x2e975a){var _0x2aea37={'raw':![],'where':{'id':_0x1a90b1[_0xe87b('0x48')]['id']}},_0x97161b={};_0x97161b[_0xe87b('0x33')]=_[_0xe87b('0x49')](db[_0xe87b('0x31')]['rawAttributes']);_0x97161b[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x1a90b1[_0xe87b('0x35')]);_0x97161b['filters']=_[_0xe87b('0x36')](_0x97161b['model'],_0x97161b[_0xe87b('0x35')]);_0x2aea37[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x97161b[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x1a90b1[_0xe87b('0x35')][_0xe87b('0x37')]));_0x2aea37[_0xe87b('0x38')]=_0x2aea37[_0xe87b('0x38')][_0xe87b('0x39')]?_0x2aea37['attributes']:_0x97161b[_0xe87b('0x33')];if(_0x1a90b1[_0xe87b('0x35')][_0xe87b('0x43')]){_0x2aea37[_0xe87b('0x44')]=[{'all':!![]}];}_0x2aea37=_[_0xe87b('0x40')]({},_0x2aea37,_0x1a90b1[_0xe87b('0x4a')]);return db[_0xe87b('0x31')][_0xe87b('0x4b')](_0x2aea37)['then'](handleEntityNotFound(_0x2e975a,null))[_0xe87b('0x25')](respondWithResult(_0x2e975a,null))[_0xe87b('0x46')](handleError(_0x2e975a,null));};exports[_0xe87b('0x4c')]=function(_0x104afb,_0x3a1415){return db[_0xe87b('0x31')][_0xe87b('0x4c')](_0x104afb[_0xe87b('0x4d')],{})[_0xe87b('0x25')](function(_0x528e72){var _0xf56ed4=_0x104afb[_0xe87b('0x4e')][_0xe87b('0x4f')]({'plain':!![]});if(!_0xf56ed4)throw new Error(_0xe87b('0x50'));if(_0xf56ed4[_0xe87b('0x51')]===_0xe87b('0x4e')){var _0x117e5b=_0x528e72[_0xe87b('0x4f')]({'plain':!![]});var _0x53078e=[{'name':_0xe87b('0x27'),'value':_0xe87b('0x52')},{'name':'QueueCampaigns','value':_0xe87b('0x28')}];var _0x1ab91f=_[_0xe87b('0x4b')](_0x53078e,[_0xe87b('0x2c'),_0x117e5b[_0xe87b('0x2b')]])['name'];return db[_0xe87b('0x53')][_0xe87b('0x4b')]({'where':{'name':_0x1ab91f,'userProfileId':_0xf56ed4[_0xe87b('0x54')]},'raw':!![]})[_0xe87b('0x25')](function(_0x584ec8){if(_0x584ec8&&_0x584ec8[_0xe87b('0x55')]===0x0){return db[_0xe87b('0x56')][_0xe87b('0x4c')]({'name':_0x117e5b[_0xe87b('0x34')],'resourceId':_0x117e5b['id'],'type':_0x584ec8[_0xe87b('0x34')],'sectionId':_0x584ec8['id']},{})[_0xe87b('0x25')](function(){return _0x528e72;});}else{return _0x528e72;}})['catch'](function(_0x229320){logger['error'](_0xe87b('0x57'),_0x229320);throw _0x229320;});}return _0x528e72;})[_0xe87b('0x25')](respondWithResult(_0x3a1415,0xc9))['catch'](handleError(_0x3a1415,null));};exports[_0xe87b('0x58')]=function(_0x1ff33e,_0x433ce1){var _0x1347f0={'where':{'id':_0x1ff33e['params']['id']}},_0x5f59de={};_0x5f59de[_0xe87b('0x33')]=_[_0xe87b('0x49')](db[_0xe87b('0x31')][_0xe87b('0x59')]);_0x1347f0['attributes']=_[_0xe87b('0x36')](_0x5f59de[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x1ff33e[_0xe87b('0x35')]['fields']));_0x1347f0[_0xe87b('0x38')]=_0x1347f0[_0xe87b('0x38')][_0xe87b('0x39')]?_0x1347f0[_0xe87b('0x38')]:_0x5f59de['model'];if(_0x1ff33e['query']['includeAll']){_0x1347f0[_0xe87b('0x44')]=[{'all':!![]}];}_0x1347f0=_['merge']({},_0x1347f0,_0x1ff33e['options']);return db[_0xe87b('0x31')]['find'](_0x1347f0)[_0xe87b('0x25')](handleEntityNotFound(_0x433ce1,null))[_0xe87b('0x25')](function(_0x15ecfd){if(_0x15ecfd){var _0x15b80f=_0x15ecfd[_0xe87b('0x4f')]({'plain':!![]});_0x15b80f=qs[_0xe87b('0x5a')](_0x15b80f,['id','createdAt',_0xe87b('0x5b')]);_0x1ff33e[_0xe87b('0x4d')]=_['omit'](_0x1ff33e[_0xe87b('0x4d')],['id','createdAt',_0xe87b('0x5b')]);return db[_0xe87b('0x31')]['create'](_[_0xe87b('0x40')](_0x15b80f,_0x1ff33e[_0xe87b('0x4d')]),{'include':_0x1ff33e[_0xe87b('0x35')][_0xe87b('0x43')]?[{'all':!![]}]:undefined})[_0xe87b('0x25')](function(_0x25c90b){var _0x50b52b=_0x1ff33e[_0xe87b('0x4e')][_0xe87b('0x4f')]({'plain':!![]});if(!_0x50b52b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50b52b[_0xe87b('0x51')]===_0xe87b('0x4e')){var _0x27172b=_0x25c90b[_0xe87b('0x4f')]({'plain':!![]});var _0x406590=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x5c3b22=_[_0xe87b('0x4b')](_0x406590,['value',_0x27172b[_0xe87b('0x2b')]])['name'];return db[_0xe87b('0x53')][_0xe87b('0x4b')]({'where':{'name':_0x5c3b22,'userProfileId':_0x50b52b[_0xe87b('0x54')]},'raw':!![]})[_0xe87b('0x25')](function(_0x3d32a7){if(_0x3d32a7&&_0x3d32a7[_0xe87b('0x55')]===0x0){return db[_0xe87b('0x56')][_0xe87b('0x4c')]({'name':_0x27172b['name'],'resourceId':_0x27172b['id'],'type':_0x3d32a7[_0xe87b('0x34')],'sectionId':_0x3d32a7['id']},{})['then'](function(){return _0x25c90b;});}else{return _0x25c90b;}})['catch'](function(_0x565538){logger[_0xe87b('0x2e')](_0xe87b('0x57'),_0x565538);throw _0x565538;});}return _0x25c90b;});}})[_0xe87b('0x25')](respondWithResult(_0x433ce1,0xc9))['catch'](handleError(_0x433ce1,null));};exports[_0xe87b('0x5c')]=function(_0x24e7e8,_0xcb6e33){if(_0x24e7e8['body']['id']){delete _0x24e7e8[_0xe87b('0x4d')]['id'];}return db[_0xe87b('0x31')][_0xe87b('0x4b')]({'where':{'id':_0x24e7e8[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0xcb6e33,null))[_0xe87b('0x25')](saveUpdates(_0x24e7e8[_0xe87b('0x4d')],null))[_0xe87b('0x25')](respondWithResult(_0xcb6e33,null))['catch'](handleError(_0xcb6e33,null));};exports[_0xe87b('0x26')]=function(_0x19b788,_0x10a9b5){return db[_0xe87b('0x31')]['find']({'where':{'id':_0x19b788[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x10a9b5,null))['then'](removeEntity(_0x10a9b5,null))[_0xe87b('0x46')](handleError(_0x10a9b5,null));};exports['getHoppers']=function(_0x133fcf,_0x309b8f,_0xa02f05){var _0x2153e8={'raw':![],'where':{}};var _0x2ba9e8={};var _0x1af07d={'count':0x0,'rows':[]};return db[_0xe87b('0x31')]['findOne']({'where':{'id':_0x133fcf['params']['id']}})['then'](handleEntityNotFound(_0x309b8f,null))[_0xe87b('0x25')](function(_0x1114ab){if(_0x1114ab){_0x2ba9e8['model']=_[_0xe87b('0x49')](db[_0xe87b('0x5d')][_0xe87b('0x59')]);_0x2ba9e8[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x133fcf['query']);_0x2ba9e8[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x2ba9e8[_0xe87b('0x33')],_0x2ba9e8['query']);_0x2153e8[_0xe87b('0x38')]=_['intersection'](_0x2ba9e8[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x133fcf['query'][_0xe87b('0x37')]));_0x2153e8[_0xe87b('0x38')]=_0x2153e8['attributes']['length']?_0x2153e8[_0xe87b('0x38')]:_0x2ba9e8[_0xe87b('0x33')];if(!_0x133fcf[_0xe87b('0x35')][_0xe87b('0x3a')]('nolimit')){_0x2153e8[_0xe87b('0x1e')]=qs['limit'](_0x133fcf[_0xe87b('0x35')][_0xe87b('0x1e')]);_0x2153e8[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x133fcf[_0xe87b('0x35')][_0xe87b('0x20')]);}_0x2153e8[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x133fcf[_0xe87b('0x35')]['sort']);_0x2153e8[_0xe87b('0x3d')]=qs['filters'](_[_0xe87b('0x3f')](_0x133fcf[_0xe87b('0x35')],_0x2ba9e8[_0xe87b('0x3e')]));_0x2153e8['where'][_0xe87b('0x5f')]=_0x1114ab['id'];if(_0x133fcf[_0xe87b('0x35')]['filter']){_0x2153e8[_0xe87b('0x3d')]=_['merge'](_0x2153e8['where'],{'$or':_[_0xe87b('0x29')](_0x2153e8[_0xe87b('0x38')],function(_0x21bbff){var _0x47ff8e={};_0x47ff8e[_0x21bbff]={'$like':'%'+_0x133fcf[_0xe87b('0x35')]['filter']+'%'};return _0x47ff8e;})});}_0x2153e8=_[_0xe87b('0x40')]({},_0x2153e8,_0x133fcf['options']);return db[_0xe87b('0x5d')][_0xe87b('0x1f')]({'where':_0x2153e8[_0xe87b('0x3d')]})[_0xe87b('0x25')](function(_0x254088){_0x1af07d[_0xe87b('0x1f')]=_0x254088;if(_0x133fcf[_0xe87b('0x35')]['includeAll']){_0x2153e8[_0xe87b('0x44')]=[{'all':!![]}];}return db[_0xe87b('0x5d')][_0xe87b('0x60')](_0x2153e8);})[_0xe87b('0x25')](function(_0xb0d15b){_0x1af07d['rows']=_0xb0d15b;return _0x1af07d;});}})[_0xe87b('0x25')](respondWithFilteredResult(_0x309b8f,_0x2153e8))[_0xe87b('0x46')](handleError(_0x309b8f,null));};exports[_0xe87b('0x61')]=function(_0x53d646,_0x578809,_0x1db190){var _0x58adc5={'raw':!![],'where':{}};var _0x59b41c={};var _0x3446a6={'count':0x0,'rows':[]};return db[_0xe87b('0x31')][_0xe87b('0x62')]({'where':{'id':_0x53d646[_0xe87b('0x48')]['id']}})['then'](handleEntityNotFound(_0x578809,null))[_0xe87b('0x25')](function(_0x343376){if(_0x343376){_0x59b41c[_0xe87b('0x33')]=_[_0xe87b('0x49')](db['CmHopperHistory'][_0xe87b('0x59')]);_0x59b41c[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x53d646['query']);_0x59b41c['filters']=_[_0xe87b('0x36')](_0x59b41c[_0xe87b('0x33')],_0x59b41c['query']);_0x58adc5[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x59b41c[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x53d646[_0xe87b('0x35')]['fields']));_0x58adc5['attributes']=_0x58adc5[_0xe87b('0x38')][_0xe87b('0x39')]?_0x58adc5['attributes']:_0x59b41c['model'];if(!_0x53d646[_0xe87b('0x35')]['hasOwnProperty'](_0xe87b('0x3b'))){_0x58adc5['limit']=qs[_0xe87b('0x1e')](_0x53d646[_0xe87b('0x35')][_0xe87b('0x1e')]);_0x58adc5[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x53d646[_0xe87b('0x35')]['offset']);}_0x58adc5[_0xe87b('0x3c')]=qs['sort'](_0x53d646['query'][_0xe87b('0x5e')]);_0x58adc5[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x53d646[_0xe87b('0x35')],_0x59b41c[_0xe87b('0x3e')]));_0x58adc5[_0xe87b('0x3d')][_0xe87b('0x5f')]=_0x343376['id'];if(_0x53d646['query']['filter']){_0x58adc5[_0xe87b('0x3d')]=_['merge'](_0x58adc5[_0xe87b('0x3d')],{'$or':_[_0xe87b('0x29')](_0x58adc5['attributes'],function(_0x3473f2){var _0x395bdc={};_0x395bdc[_0x3473f2]={'$like':'%'+_0x53d646[_0xe87b('0x35')]['filter']+'%'};return _0x395bdc;})});}_0x58adc5=_[_0xe87b('0x40')]({},_0x58adc5,_0x53d646[_0xe87b('0x4a')]);return db[_0xe87b('0x63')][_0xe87b('0x1f')]({'where':_0x58adc5[_0xe87b('0x3d')]})[_0xe87b('0x25')](function(_0x6d5b60){_0x3446a6[_0xe87b('0x1f')]=_0x6d5b60;if(_0x53d646[_0xe87b('0x35')][_0xe87b('0x43')]){_0x58adc5[_0xe87b('0x44')]=[{'all':!![]}];}return db[_0xe87b('0x63')][_0xe87b('0x60')](_0x58adc5);})[_0xe87b('0x25')](function(_0x3d96be){_0x3446a6[_0xe87b('0x45')]=_0x3d96be;return _0x3446a6;});}})[_0xe87b('0x25')](respondWithFilteredResult(_0x578809,_0x58adc5))[_0xe87b('0x46')](handleError(_0x578809,null));};exports[_0xe87b('0x64')]=function(_0x1a0c61,_0x3d011d,_0x3c5642){var _0x36dbcc={'raw':!![],'where':{}};var _0x15c03e={};var _0x172edf={'count':0x0,'rows':[]};return db[_0xe87b('0x31')]['findOne']({'where':{'id':_0x1a0c61[_0xe87b('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d011d,null))['then'](function(_0x5922e5){if(_0x5922e5){_0x15c03e[_0xe87b('0x33')]=_[_0xe87b('0x49')](db['CmHopperFinal']['rawAttributes']);_0x15c03e[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x1a0c61[_0xe87b('0x35')]);_0x15c03e[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x15c03e[_0xe87b('0x33')],_0x15c03e['query']);_0x36dbcc[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x15c03e[_0xe87b('0x33')],qs['fields'](_0x1a0c61[_0xe87b('0x35')][_0xe87b('0x37')]));_0x36dbcc[_0xe87b('0x38')]=_0x36dbcc[_0xe87b('0x38')][_0xe87b('0x39')]?_0x36dbcc[_0xe87b('0x38')]:_0x15c03e[_0xe87b('0x33')];if(!_0x1a0c61[_0xe87b('0x35')][_0xe87b('0x3a')](_0xe87b('0x3b'))){_0x36dbcc[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x1a0c61[_0xe87b('0x35')]['limit']);_0x36dbcc['offset']=qs[_0xe87b('0x20')](_0x1a0c61[_0xe87b('0x35')][_0xe87b('0x20')]);}_0x36dbcc[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x1a0c61[_0xe87b('0x35')][_0xe87b('0x5e')]);_0x36dbcc['where']=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x1a0c61[_0xe87b('0x35')],_0x15c03e[_0xe87b('0x3e')]));_0x36dbcc[_0xe87b('0x3d')][_0xe87b('0x5f')]=_0x5922e5['id'];if(_0x1a0c61['query'][_0xe87b('0x42')]){_0x36dbcc[_0xe87b('0x3d')]=_['merge'](_0x36dbcc[_0xe87b('0x3d')],{'$or':_['map'](_0x36dbcc[_0xe87b('0x38')],function(_0x21e820){var _0x33abcf={};_0x33abcf[_0x21e820]={'$like':'%'+_0x1a0c61[_0xe87b('0x35')][_0xe87b('0x42')]+'%'};return _0x33abcf;})});}_0x36dbcc=_[_0xe87b('0x40')]({},_0x36dbcc,_0x1a0c61['options']);return db['CmHopperFinal'][_0xe87b('0x1f')]({'where':_0x36dbcc[_0xe87b('0x3d')]})[_0xe87b('0x25')](function(_0x367426){_0x172edf[_0xe87b('0x1f')]=_0x367426;if(_0x1a0c61['query'][_0xe87b('0x43')]){_0x36dbcc[_0xe87b('0x44')]=[{'all':!![]}];}return db[_0xe87b('0x65')][_0xe87b('0x60')](_0x36dbcc);})[_0xe87b('0x25')](function(_0xaf7fcd){_0x172edf[_0xe87b('0x45')]=_0xaf7fcd;return _0x172edf;});}})['then'](respondWithFilteredResult(_0x3d011d,_0x36dbcc))[_0xe87b('0x46')](handleError(_0x3d011d,null));};exports[_0xe87b('0x66')]=function(_0x171009,_0x25c6ce,_0x3b423d){var _0x346df3={'raw':!![],'where':{}};var _0x36eec1={};var _0x586a1f={'count':0x0,'rows':[]};return db[_0xe87b('0x31')][_0xe87b('0x62')]({'where':{'id':_0x171009[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x25c6ce,null))[_0xe87b('0x25')](function(_0x3797f8){if(_0x3797f8){_0x36eec1[_0xe87b('0x33')]=_[_0xe87b('0x49')](db[_0xe87b('0x67')]['rawAttributes']);_0x36eec1[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x171009['query']);_0x36eec1[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x36eec1[_0xe87b('0x33')],_0x36eec1[_0xe87b('0x35')]);_0x346df3[_0xe87b('0x38')]=_['intersection'](_0x36eec1[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x171009[_0xe87b('0x35')][_0xe87b('0x37')]));_0x346df3[_0xe87b('0x38')]=_0x346df3[_0xe87b('0x38')][_0xe87b('0x39')]?_0x346df3[_0xe87b('0x38')]:_0x36eec1[_0xe87b('0x33')];if(!_0x171009[_0xe87b('0x35')]['hasOwnProperty'](_0xe87b('0x3b'))){_0x346df3['limit']=qs['limit'](_0x171009['query'][_0xe87b('0x1e')]);_0x346df3['offset']=qs[_0xe87b('0x20')](_0x171009[_0xe87b('0x35')][_0xe87b('0x20')]);}_0x346df3[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x171009[_0xe87b('0x35')]['sort']);_0x346df3['where']=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x171009[_0xe87b('0x35')],_0x36eec1[_0xe87b('0x3e')]));_0x346df3[_0xe87b('0x3d')][_0xe87b('0x5f')]=_0x3797f8['id'];if(_0x171009[_0xe87b('0x35')][_0xe87b('0x42')]){_0x346df3[_0xe87b('0x3d')]=_[_0xe87b('0x40')](_0x346df3[_0xe87b('0x3d')],{'$or':_['map'](_0x346df3[_0xe87b('0x38')],function(_0x2e4c48){var _0x2e9650={};_0x2e9650[_0x2e4c48]={'$like':'%'+_0x171009[_0xe87b('0x35')][_0xe87b('0x42')]+'%'};return _0x2e9650;})});}_0x346df3=_[_0xe87b('0x40')]({},_0x346df3,_0x171009[_0xe87b('0x4a')]);return db['CmHopperBlack']['count']({'where':_0x346df3['where']})[_0xe87b('0x25')](function(_0x35333a){_0x586a1f[_0xe87b('0x1f')]=_0x35333a;if(_0x171009[_0xe87b('0x35')][_0xe87b('0x43')]){_0x346df3[_0xe87b('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xe87b('0x60')](_0x346df3);})[_0xe87b('0x25')](function(_0x1d7bef){_0x586a1f[_0xe87b('0x45')]=_0x1d7bef;return _0x586a1f;});}})[_0xe87b('0x25')](respondWithFilteredResult(_0x25c6ce,_0x346df3))['catch'](handleError(_0x25c6ce,null));};exports[_0xe87b('0x68')]=function(_0x312d84,_0xdf8cf0,_0xc1d2a6){var _0x4e4dcd={};var _0x353e7a={};var _0xee95d3;var _0x7225b0;return db['VoiceQueue']['findOne']({'where':{'id':_0x312d84['params']['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0xdf8cf0,null))['then'](function(_0x40e5bb){if(_0x40e5bb){_0xee95d3=_0x40e5bb;_0x353e7a['model']=_[_0xe87b('0x49')](db[_0xe87b('0x69')][_0xe87b('0x59')]);_0x353e7a[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x312d84[_0xe87b('0x35')]);_0x353e7a['filters']=_['intersection'](_0x353e7a[_0xe87b('0x33')],_0x353e7a[_0xe87b('0x35')]);_0x4e4dcd[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x353e7a[_0xe87b('0x33')],qs['fields'](_0x312d84[_0xe87b('0x35')][_0xe87b('0x37')]));_0x4e4dcd[_0xe87b('0x38')]=_0x4e4dcd[_0xe87b('0x38')][_0xe87b('0x39')]?_0x4e4dcd['attributes']:_0x353e7a['model'];_0x4e4dcd['order']=qs['sort'](_0x312d84[_0xe87b('0x35')][_0xe87b('0x5e')]);_0x4e4dcd[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x312d84[_0xe87b('0x35')],_0x353e7a[_0xe87b('0x3e')]));if(_0x312d84['query'][_0xe87b('0x42')]){_0x4e4dcd[_0xe87b('0x3d')]=_[_0xe87b('0x40')](_0x4e4dcd[_0xe87b('0x3d')],{'$or':_['map'](_0x4e4dcd[_0xe87b('0x38')],function(_0x1bb66d){var _0x372954={};_0x372954[_0x1bb66d]={'$like':'%'+_0x312d84['query'][_0xe87b('0x42')]+'%'};return _0x372954;})});}_0x4e4dcd=_[_0xe87b('0x40')]({},_0x4e4dcd,_0x312d84[_0xe87b('0x4a')]);return _0xee95d3['getTeams'](_0x4e4dcd);}})[_0xe87b('0x25')](function(_0x1c264c){if(_0x1c264c){_0x7225b0=_0x1c264c['length'];if(!_0x312d84[_0xe87b('0x35')][_0xe87b('0x3a')]('nolimit')){_0x4e4dcd[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x312d84[_0xe87b('0x35')][_0xe87b('0x1e')]);_0x4e4dcd[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x312d84['query'][_0xe87b('0x20')]);}return _0xee95d3[_0xe87b('0x68')](_0x4e4dcd);}})['then'](function(_0x5c8796){if(_0x5c8796){return _0x5c8796?{'count':_0x7225b0,'rows':_0x5c8796}:null;}})['then'](respondWithResult(_0xdf8cf0,null))[_0xe87b('0x46')](handleError(_0xdf8cf0,null));};exports[_0xe87b('0x6a')]=function(_0x3dd769,_0x4cbac1,_0x2ddbf4){var _0x22991a=_0x3dd769['body'][_0xe87b('0x6b')];var _0x1baf6a=_['map'](_0x22991a,'id');return db[_0xe87b('0x69')]['findAll']({'where':{'id':_0x1baf6a},'attributes':['id'],'include':[{'model':db[_0xe87b('0x6c')],'as':'Agents','attributes':['id',_0xe87b('0x34'),_0xe87b('0x6d'),_0xe87b('0x6e'),_0xe87b('0x6f')],'raw':!![]}]})[_0xe87b('0x25')](function(_0x3d2e37){if(_0x3d2e37){var _0x12ee77=_[_0xe87b('0x70')](_0x3d2e37,function(_0x1a6551){var _0x5a8233=_0x1a6551['get']({'plain':!![]});_0x5a8233['Agents']['forEach'](function(_0x2b1946){_0x2b1946['penalty']=_[_0xe87b('0x4b')](_0x22991a,{'id':_0x5a8233['id']})[_0xe87b('0x71')];});return _0x5a8233[_0xe87b('0x72')];});return db[_0xe87b('0x31')]['find']({'where':{'id':_0x3dd769[_0xe87b('0x48')]['id']}})['then'](function(_0x34c25f){return db[_0xe87b('0x73')]['transaction'](function(_0x20c04e){return _0x34c25f[_0xe87b('0x6a')](_0x1baf6a,{'transaction':_0x20c04e})['then'](function(){return BPromise[_0xe87b('0x74')](_0x22991a,function(_0x829d1f){return db[_0xe87b('0x75')][_0xe87b('0x76')]({'TeamId':_0x829d1f['id'],'VoiceQueueId':_0x3dd769[_0xe87b('0x48')]['id'],'penalty':_0x829d1f['penalty']},{'transaction':_0x20c04e});});})[_0xe87b('0x25')](function(){return BPromise['each'](_0x12ee77,function(_0x1eee15){return db['UserVoiceQueue'][_0xe87b('0x77')]({'where':{'UserId':_0x1eee15['id'],'VoiceQueueId':_0x3dd769[_0xe87b('0x48')]['id']},'defaults':{'penalty':_0x1eee15[_0xe87b('0x71')]},'transaction':_0x20c04e});});})[_0xe87b('0x25')](function(){return BPromise[_0xe87b('0x74')](_[_0xe87b('0x42')](_0x12ee77,{'online':!![]}),function(_0x585006){return db[_0xe87b('0x78')][_0xe87b('0x76')]({'membername':_0x585006['name'],'UserId':_0x585006['id'],'queue_name':_0x34c25f[_0xe87b('0x34')],'VoiceQueueId':_0x34c25f['id'],'interface':_[_0xe87b('0x79')](_0x585006['interface'])?util[_0xe87b('0x7a')](_0xe87b('0x7b'),_0x585006[_0xe87b('0x34')]):_0x585006[_0xe87b('0x6f')],'paused':_0x585006[_0xe87b('0x6e')]||![],'penalty':_0x585006['penalty']},{'transaction':_0x20c04e});});})[_0xe87b('0x25')](function(){_0x12ee77[_0xe87b('0x7c')](function(_0x64c108){socket[_0xe87b('0x7d')]('userVoiceQueue:save',{'UserId':_0x64c108['id'],'VoiceQueueId':_0x34c25f['id']});});});});});}})[_0xe87b('0x25')](respondWithStatusCode(_0x4cbac1,null))[_0xe87b('0x46')](handleError(_0x4cbac1,null));};exports['removeTeams']=function(_0x59f276,_0x1b938c,_0x5918b0){return db[_0xe87b('0x69')]['findAll']({'where':{'id':_0x59f276['query'][_0xe87b('0x7e')]},'attributes':['id'],'include':[{'model':db[_0xe87b('0x6c')],'as':_0xe87b('0x72'),'attributes':['id'],'raw':!![]}]})[_0xe87b('0x25')](handleEntityNotFound(_0x1b938c,null))[_0xe87b('0x25')](function(_0x15c517){var _0x13590d=_[_0xe87b('0x29')](_0x15c517,'id');var _0x1b9162=[];var _0x2d309b=[];var _0x4ec8d7=squel[_0xe87b('0x7f')]();_0x4ec8d7[_0xe87b('0x80')](_0xe87b('0x81'))[_0xe87b('0x82')](_0xe87b('0x83'),'tq')[_0xe87b('0x84')](_0xe87b('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe87b('0x3d')](_0xe87b('0x86'),_0x59f276[_0xe87b('0x48')]['id']);for(var _0x53d8e3=0x0;_0x53d8e3<_0x15c517[_0xe87b('0x39')];_0x53d8e3+=0x1){let _0x2ec1b4=_0x15c517[_0x53d8e3];for(var _0x59f178=0x0;_0x59f178<_0x2ec1b4[_0xe87b('0x72')][_0xe87b('0x39')];_0x59f178+=0x1){let _0x377b02=_0x2ec1b4['Agents'][_0x59f178];var _0x1c8bfd=_0x4ec8d7[_0xe87b('0x58')]();_0x1c8bfd[_0xe87b('0x3d')](_0xe87b('0x87'),_0x377b02['id']);_0x2d309b[_0xe87b('0x88')](db[_0xe87b('0x73')][_0xe87b('0x35')](_0x1c8bfd[_0xe87b('0x89')](),{'type':db[_0xe87b('0x73')][_0xe87b('0x8a')][_0xe87b('0x8b')]})[_0xe87b('0x25')](function(_0x16a400){if(_0x16a400[_0xe87b('0x39')]===0x1){return _0x377b02['id'];}else{var _0x6e8c70=_[_0xe87b('0x8c')](_['map'](_0x16a400,'TeamId'),function(_0x15c7e9){return _[_0xe87b('0x2a')](_0x13590d,_0x15c7e9);});if(_0x6e8c70){return _0x377b02['id'];}}}));}}return BPromise['all'](_0x2d309b)[_0xe87b('0x25')](function(_0x3c6f9f){_0x1b9162=_(_0x1b9162)[_0xe87b('0x8d')](_0x3c6f9f)['compact']()['value']();return db[_0xe87b('0x31')][_0xe87b('0x4b')]({'where':{'id':_0x59f276[_0xe87b('0x48')]['id']}})['then'](function(_0x401965){return db[_0xe87b('0x73')][_0xe87b('0x8e')](function(_0x5e6abb){return _0x401965['removeTeams'](_0x59f276[_0xe87b('0x35')][_0xe87b('0x7e')],{'transaction':_0x5e6abb})['then'](function(){if(!_['isEmpty'](_0x1b9162)){return _0x401965['removeAgents'](_0x1b9162,{'transaction':_0x5e6abb})[_0xe87b('0x25')](function(){return db[_0xe87b('0x78')][_0xe87b('0x26')]({'where':{'VoiceQueueId':_0x59f276[_0xe87b('0x48')]['id'],'UserId':_0x1b9162},'transaction':_0x5e6abb});});}})[_0xe87b('0x25')](function(){_0x1b9162['forEach'](function(_0x458849){socket[_0xe87b('0x7d')](_0xe87b('0x8f'),{'UserId':_0x458849,'VoiceQueueId':_0x401965['id']});});});});});});})[_0xe87b('0x25')](respondWithStatusCode(_0x1b938c,null))[_0xe87b('0x46')](handleError(_0x1b938c,null));};exports[_0xe87b('0x90')]=function(_0x45d89f,_0xf6a248,_0x4c9c03){var _0x738651,_0x41b8c1;return db[_0xe87b('0x31')]['find']({'where':{'id':_0x45d89f['params']['id']}})['then'](handleEntityNotFound(_0xf6a248,null))[_0xe87b('0x25')](function(_0x5dc19f){if(_0x5dc19f){_0x41b8c1=_0x5dc19f;return _0x5dc19f[_0xe87b('0x90')](_0x45d89f[_0xe87b('0x4d')][_0xe87b('0x7e')],_[_0xe87b('0x5a')](_0x45d89f[_0xe87b('0x4d')],[_0xe87b('0x7e'),'id'])||{})[_0xe87b('0x91')](function(_0x1cd1fd){for(var _0xf9a597=0x0;_0xf9a597<_0x45d89f[_0xe87b('0x4d')][_0xe87b('0x7e')]['length'];_0xf9a597+=0x1){socket[_0xe87b('0x7d')](_0xe87b('0x92'),{'UserId':Number(_0x45d89f['body']['ids'][_0xf9a597]),'VoiceQueueId':Number(_0x45d89f['params']['id'])});}return _0x1cd1fd;});}})[_0xe87b('0x25')](function(_0x2aa6d5){_0x738651=_0x2aa6d5||[];if(_0x41b8c1){return db[_0xe87b('0x6c')][_0xe87b('0x60')]({'where':{'id':_0x45d89f['body'][_0xe87b('0x7e')]},'attributes':['id','name','online',_0xe87b('0x6e'),_0xe87b('0x6f')],'raw':!![]});}})[_0xe87b('0x25')](function(_0x16f97c){if(!_[_0xe87b('0x93')](_0x16f97c)){var _0x54a983=[];for(var _0x1918f4=0x0;_0x1918f4<_0x16f97c[_0xe87b('0x39')];_0x1918f4++){if(_0x16f97c[_0x1918f4]['online']){_0x54a983[_0xe87b('0x88')](db[_0xe87b('0x78')][_0xe87b('0x76')]({'membername':_0x16f97c[_0x1918f4]['name'],'UserId':_0x16f97c[_0x1918f4]['id'],'queue_name':_0x41b8c1[_0xe87b('0x34')],'VoiceQueueId':_0x41b8c1['id'],'interface':_[_0xe87b('0x79')](_0x16f97c[_0x1918f4][_0xe87b('0x6f')])?util[_0xe87b('0x7a')]('SIP/%s',_0x16f97c[_0x1918f4][_0xe87b('0x34')]):_0x16f97c[_0x1918f4][_0xe87b('0x6f')],'paused':_0x16f97c[_0x1918f4][_0xe87b('0x6e')]||![],'penalty':_0x45d89f[_0xe87b('0x4d')][_0xe87b('0x71')]||0x0}));}}return BPromise[_0xe87b('0x94')](_0x54a983);}})[_0xe87b('0x25')](function(){return _0x738651;})['then'](respondWithResult(_0xf6a248,null))[_0xe87b('0x46')](handleError(_0xf6a248,null));};exports['removeAgents']=function(_0x4a58f6,_0x31b94b,_0x421341){return db[_0xe87b('0x31')][_0xe87b('0x4b')]({'where':{'id':_0x4a58f6[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x31b94b,null))[_0xe87b('0x25')](function(_0x3f9162){if(_0x3f9162){return _0x3f9162[_0xe87b('0x95')](_0x4a58f6[_0xe87b('0x35')][_0xe87b('0x7e')])['then'](function(){if(_[_0xe87b('0x96')](_0x4a58f6[_0xe87b('0x35')]['ids'])){for(var _0xb75e76=0x0;_0xb75e76<_0x4a58f6[_0xe87b('0x35')][_0xe87b('0x7e')][_0xe87b('0x39')];_0xb75e76+=0x1){socket[_0xe87b('0x7d')](_0xe87b('0x8f'),{'UserId':Number(_0x4a58f6['query'][_0xe87b('0x7e')][_0xb75e76]),'VoiceQueueId':Number(_0x4a58f6[_0xe87b('0x48')]['id'])});}}else{socket[_0xe87b('0x7d')](_0xe87b('0x8f'),{'UserId':Number(_0x4a58f6['query']['ids']),'VoiceQueueId':Number(_0x4a58f6[_0xe87b('0x48')]['id'])});}});}})[_0xe87b('0x25')](function(_0x57deab){return db[_0xe87b('0x78')][_0xe87b('0x26')]({'where':{'VoiceQueueId':_0x4a58f6['params']['id'],'UserId':_0x4a58f6[_0xe87b('0x35')][_0xe87b('0x7e')]}})['then'](function(){return _0x57deab;});})['then'](respondWithStatusCode(_0x31b94b,null))['catch'](handleError(_0x31b94b,null));};exports[_0xe87b('0x97')]=function(_0x5ab2a0,_0x3d0818,_0x33dbb0){var _0x53d6a2={};var _0x5ce52d={};var _0x59696b;var _0x5b24f0;return db[_0xe87b('0x31')]['findOne']({'where':{'id':_0x5ab2a0[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x3d0818,null))[_0xe87b('0x25')](function(_0x1acadd){if(_0x1acadd){_0x59696b=_0x1acadd;_0x5ce52d['model']=_[_0xe87b('0x49')](db[_0xe87b('0x6c')][_0xe87b('0x59')]);_0x5ce52d['query']=_['keys'](_0x5ab2a0[_0xe87b('0x35')]);_0x5ce52d[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x5ce52d[_0xe87b('0x33')],_0x5ce52d['query']);_0x53d6a2[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x5ce52d[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x5ab2a0[_0xe87b('0x35')][_0xe87b('0x37')]));_0x53d6a2['attributes']=_0x53d6a2['attributes'][_0xe87b('0x39')]?_0x53d6a2['attributes']:_0x5ce52d[_0xe87b('0x33')];_0x53d6a2[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x5ab2a0[_0xe87b('0x35')]['sort']);_0x53d6a2[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x5ab2a0[_0xe87b('0x35')],_0x5ce52d[_0xe87b('0x3e')]));if(_0x5ab2a0[_0xe87b('0x35')][_0xe87b('0x42')]){_0x53d6a2[_0xe87b('0x3d')]=_[_0xe87b('0x40')](_0x53d6a2['where'],{'$or':_[_0xe87b('0x29')](_0x53d6a2[_0xe87b('0x38')],function(_0x3b489d){var _0x3fd552={};_0x3fd552[_0x3b489d]={'$like':'%'+_0x5ab2a0[_0xe87b('0x35')][_0xe87b('0x42')]+'%'};return _0x3fd552;})});}_0x53d6a2=_[_0xe87b('0x40')]({},_0x53d6a2,_0x5ab2a0[_0xe87b('0x4a')]);return _0x59696b[_0xe87b('0x97')](_0x53d6a2);}})[_0xe87b('0x25')](function(_0x52f9a6){if(_0x52f9a6){_0x5b24f0=_0x52f9a6[_0xe87b('0x39')];if(!_0x5ab2a0['query'][_0xe87b('0x3a')](_0xe87b('0x3b'))){_0x53d6a2[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x5ab2a0[_0xe87b('0x35')]['limit']);_0x53d6a2[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x5ab2a0[_0xe87b('0x35')][_0xe87b('0x20')]);}return _0x59696b[_0xe87b('0x97')](_0x53d6a2);}})['then'](function(_0x5e28dd){if(_0x5e28dd){return _0x5e28dd?{'count':_0x5b24f0,'rows':_0x5e28dd}:null;}})[_0xe87b('0x25')](respondWithResult(_0x3d0818,null))[_0xe87b('0x46')](handleError(_0x3d0818,null));};exports['getMembers']=function(_0x32e901,_0x3d6ba4,_0x10a142){var _0x17f78b={};var _0x2d007c={};var _0x4efbf8;var _0x5809a6;return db[_0xe87b('0x31')][_0xe87b('0x62')]({'where':{'id':_0x32e901[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x3d6ba4,null))[_0xe87b('0x25')](function(_0x237696){if(_0x237696){_0x4efbf8=_0x237696;_0x2d007c['model']=_[_0xe87b('0x49')](db[_0xe87b('0x78')][_0xe87b('0x59')]);_0x2d007c[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x32e901[_0xe87b('0x35')]);_0x2d007c[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x2d007c[_0xe87b('0x33')],_0x2d007c['query']);_0x17f78b[_0xe87b('0x38')]=_['intersection'](_0x2d007c[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x32e901[_0xe87b('0x35')][_0xe87b('0x37')]));_0x17f78b[_0xe87b('0x38')]=_0x17f78b['attributes'][_0xe87b('0x39')]?_0x17f78b['attributes']:_0x2d007c[_0xe87b('0x33')];_0x17f78b[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x32e901[_0xe87b('0x35')][_0xe87b('0x5e')]);_0x17f78b[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x32e901[_0xe87b('0x35')],_0x2d007c[_0xe87b('0x3e')]));if(_0x32e901['query'][_0xe87b('0x42')]){_0x17f78b['where']=_['merge'](_0x17f78b[_0xe87b('0x3d')],{'$or':_['map'](_0x17f78b[_0xe87b('0x38')],function(_0x2f0a9b){var _0x1d1e21={};_0x1d1e21[_0x2f0a9b]={'$like':'%'+_0x32e901[_0xe87b('0x35')]['filter']+'%'};return _0x1d1e21;})});}_0x17f78b=_['merge']({},_0x17f78b,_0x32e901[_0xe87b('0x4a')]);return _0x4efbf8[_0xe87b('0x98')](_0x17f78b);}})[_0xe87b('0x25')](function(_0x116eb9){if(_0x116eb9){_0x5809a6=_0x116eb9[_0xe87b('0x39')];if(!_0x32e901[_0xe87b('0x35')][_0xe87b('0x3a')]('nolimit')){_0x17f78b[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x32e901[_0xe87b('0x35')][_0xe87b('0x1e')]);_0x17f78b[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x32e901[_0xe87b('0x35')][_0xe87b('0x20')]);}return _0x4efbf8[_0xe87b('0x98')](_0x17f78b);}})['then'](function(_0x448434){return _0x448434?{'count':_0x5809a6,'rows':_0x448434}:null;})[_0xe87b('0x25')](respondWithResult(_0x3d6ba4,null))[_0xe87b('0x46')](handleError(_0x3d6ba4,null));};exports[_0xe87b('0x99')]=function(_0x4d5f9b,_0x51a568,_0x120394){var _0x502a96={};var _0x162f6d={};var _0xd2e665;var _0x299be3;return db['VoiceQueue'][_0xe87b('0x62')]({'where':{'id':_0x4d5f9b[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x51a568,null))['then'](function(_0x5a246d){if(_0x5a246d){_0xd2e665=_0x5a246d;_0x162f6d['model']=_[_0xe87b('0x49')](db[_0xe87b('0x9a')][_0xe87b('0x59')]);_0x162f6d[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x4d5f9b[_0xe87b('0x35')]);_0x162f6d[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x162f6d[_0xe87b('0x33')],_0x162f6d['query']);_0x502a96[_0xe87b('0x38')]=_['intersection'](_0x162f6d[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x4d5f9b[_0xe87b('0x35')]['fields']));_0x502a96[_0xe87b('0x38')]=_0x502a96[_0xe87b('0x38')]['length']?_0x502a96['attributes']:_0x162f6d[_0xe87b('0x33')];_0x502a96[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x4d5f9b[_0xe87b('0x35')][_0xe87b('0x5e')]);_0x502a96[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_['pick'](_0x4d5f9b[_0xe87b('0x35')],_0x162f6d[_0xe87b('0x3e')]));if(_0x4d5f9b[_0xe87b('0x35')][_0xe87b('0x42')]){_0x502a96[_0xe87b('0x3d')]=_[_0xe87b('0x40')](_0x502a96[_0xe87b('0x3d')],{'$or':_['map'](_0x502a96[_0xe87b('0x38')],function(_0x451241){var _0x4675d4={};_0x4675d4[_0x451241]={'$like':'%'+_0x4d5f9b[_0xe87b('0x35')]['filter']+'%'};return _0x4675d4;})});}_0x502a96=_['merge']({},_0x502a96,_0x4d5f9b[_0xe87b('0x4a')]);return _0xd2e665[_0xe87b('0x99')](_0x502a96);}})[_0xe87b('0x25')](function(_0x3780c0){if(_0x3780c0){_0x299be3=_0x3780c0[_0xe87b('0x39')];if(!_0x4d5f9b[_0xe87b('0x35')][_0xe87b('0x3a')](_0xe87b('0x3b'))){_0x502a96[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x4d5f9b['query']['limit']);_0x502a96[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x4d5f9b[_0xe87b('0x35')][_0xe87b('0x20')]);}return _0xd2e665[_0xe87b('0x99')](_0x502a96);}})['then'](function(_0x4dc97b){if(_0x4dc97b){return _0x4dc97b?{'count':_0x299be3,'rows':_0x4dc97b}:null;}})[_0xe87b('0x25')](respondWithResult(_0x51a568,null))['catch'](handleError(_0x51a568,null));};exports['addLists']=function(_0x31639b,_0x483365,_0x57cfe8){var _0x1848fd,_0x11ec75;return db['VoiceQueue'][_0xe87b('0x4b')]({'where':{'id':_0x31639b[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x483365,null))['then'](function(_0x5e1d98){if(_0x5e1d98){_0x11ec75=_0x5e1d98;return _0x5e1d98['addLists'](_0x31639b[_0xe87b('0x4d')][_0xe87b('0x7e')],_[_0xe87b('0x5a')](_0x31639b[_0xe87b('0x4d')],[_0xe87b('0x7e'),'id'])||{});}return null;})['spread'](function(_0x2b4108){var _0x3223c4;_0x1848fd=_0x2b4108||[];var _0x3bc51a=[];if(_0x2b4108){for(var _0x330dd6=0x0;_0x330dd6<_0x2b4108[_0xe87b('0x39')];_0x330dd6+=0x1){var _0x5e2a2e=_0x2b4108[_0x330dd6][_0xe87b('0x4f')]({'plain':!![]});_0x11ec75[_0xe87b('0x9b')]=_0x31639b['body'][_0xe87b('0x9b')]?_0x31639b[_0xe87b('0x4d')][_0xe87b('0x9b')]:_0x11ec75[_0xe87b('0x9b')];switch(_0x11ec75[_0xe87b('0x9b')]){case _0xe87b('0x9c'):_0x3223c4=squel['insert']()[_0xe87b('0x9d')](_0xe87b('0x9e'))[_0xe87b('0x9f')]([_0xe87b('0xa0'),_0xe87b('0xa1'),_0xe87b('0xa2'),_0xe87b('0xa3'),_0xe87b('0x5f'),_0xe87b('0xa4'),_0xe87b('0x5b')],squel[_0xe87b('0x7f')]()[_0xe87b('0x80')](_0xe87b('0xa0'),_0xe87b('0xa0'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0xa1'))[_0xe87b('0x80')]('id',_0xe87b('0xa2'))[_0xe87b('0x80')](_0x5e2a2e[_0xe87b('0xa6')][_0xe87b('0x89')](),'ListId')['field'](_0x31639b[_0xe87b('0x48')]['id'][_0xe87b('0x89')](),_0xe87b('0x5f'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0xa4'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0x5b'))[_0xe87b('0x82')](_0xe87b('0xa7'))['where'](_0xe87b('0xa8'))[_0xe87b('0x3d')](_0xe87b('0xa9'),_0x5e2a2e[_0xe87b('0xa6')][_0xe87b('0x89')]())[_0xe87b('0x3d')](_0xe87b('0xaa'))[_0xe87b('0x3d')](_0xe87b('0xab'),squel[_0xe87b('0x7f')]()[_0xe87b('0x80')](_0xe87b('0xac'))[_0xe87b('0x82')]('cm_hopper_final')[_0xe87b('0x3d')](_0xe87b('0x86'),_0x31639b['params']['id'][_0xe87b('0x89')]()))[_0xe87b('0x3d')](_0xe87b('0xab'),squel[_0xe87b('0x7f')]()[_0xe87b('0x80')](_0xe87b('0xad'))['from']('cm_hopper')[_0xe87b('0x3d')](_0xe87b('0x86'),_0x31639b[_0xe87b('0x48')]['id']['toString']())))[_0xe87b('0x89')]();break;case'onlyIfOpen':_0x3223c4=squel[_0xe87b('0xae')]()[_0xe87b('0x9d')](_0xe87b('0x9e'))[_0xe87b('0x9f')]([_0xe87b('0xa0'),'scheduledAt','ContactId',_0xe87b('0xa3'),_0xe87b('0x5f'),_0xe87b('0xa4'),'updatedAt'],squel[_0xe87b('0x7f')]()['field'](_0xe87b('0xa0'),_0xe87b('0xa0'))[_0xe87b('0x80')](_0xe87b('0xa5'),'scheduledAt')['field']('id','ContactId')[_0xe87b('0x80')](_0x5e2a2e[_0xe87b('0xa6')][_0xe87b('0x89')](),_0xe87b('0xa3'))[_0xe87b('0x80')](_0x31639b[_0xe87b('0x48')]['id'][_0xe87b('0x89')](),'VoiceQueueId')[_0xe87b('0x80')](_0xe87b('0xa5'),'createdAt')[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0x5b'))[_0xe87b('0x82')](_0xe87b('0xa7'))[_0xe87b('0x3d')](_0xe87b('0xa8'))[_0xe87b('0x3d')](_0xe87b('0xa9'),_0x5e2a2e['CmListId'][_0xe87b('0x89')]())[_0xe87b('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xe87b('0x3d')](_0xe87b('0xab'),squel[_0xe87b('0x7f')]()[_0xe87b('0x80')](_0xe87b('0xad'))[_0xe87b('0x82')](_0xe87b('0x9e'))['where'](_0xe87b('0x86'),_0x31639b['params']['id'][_0xe87b('0x89')]())))[_0xe87b('0x89')]();break;default:_0x3223c4=squel['insert']()[_0xe87b('0x9d')](_0xe87b('0x9e'))[_0xe87b('0x9f')]([_0xe87b('0xa0'),_0xe87b('0xa1'),'ContactId','ListId',_0xe87b('0x5f'),_0xe87b('0xa4'),_0xe87b('0x5b')],squel[_0xe87b('0x7f')]()[_0xe87b('0x80')](_0xe87b('0xa0'),_0xe87b('0xa0'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0xa1'))[_0xe87b('0x80')]('id',_0xe87b('0xa2'))[_0xe87b('0x80')](_0x5e2a2e[_0xe87b('0xa6')]['toString'](),_0xe87b('0xa3'))[_0xe87b('0x80')](_0x31639b[_0xe87b('0x48')]['id'][_0xe87b('0x89')](),_0xe87b('0x5f'))[_0xe87b('0x80')]('NOW()',_0xe87b('0xa4'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0x5b'))['from'](_0xe87b('0xa7'))[_0xe87b('0x3d')](_0xe87b('0xa8'))[_0xe87b('0x3d')](_0xe87b('0xa9'),_0x5e2a2e[_0xe87b('0xa6')][_0xe87b('0x89')]())[_0xe87b('0x3d')](_0xe87b('0xaa')))[_0xe87b('0x89')]();}_0x3bc51a[_0xe87b('0x88')](db['sequelize'][_0xe87b('0x35')](_0x3223c4));}return BPromise[_0xe87b('0x94')](_0x3bc51a);}})[_0xe87b('0x25')](function(){return _0x1848fd;})[_0xe87b('0x25')](respondWithResult(_0x483365,null))[_0xe87b('0x46')](handleError(_0x483365,null));};exports['removeLists']=function(_0x161793,_0x534b35,_0x320bca){return db[_0xe87b('0x31')]['find']({'where':{'id':_0x161793[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x534b35,null))['then'](function(_0x97af20){if(_0x97af20){return _0x97af20[_0xe87b('0xaf')](_0x161793['query'][_0xe87b('0x7e')]);}})[_0xe87b('0x25')](function(_0x335cbf){if(_0x335cbf){return db['CmHopper']['destroy']({'where':{'ListId':_0x161793[_0xe87b('0x35')][_0xe87b('0x7e')],'VoiceQueueId':_0x161793[_0xe87b('0x48')]['id']}})['then'](function(){return _0x335cbf;});}})[_0xe87b('0x25')](respondWithStatusCode(_0x534b35,null))[_0xe87b('0x46')](handleError(_0x534b35,null));};exports[_0xe87b('0xb0')]=function(_0x32350c,_0x382d20,_0x49877f){var _0xd989fb={};var _0x9ef26f={};var _0xd31fb5;var _0x3f4d85;return db[_0xe87b('0x31')]['findOne']({'where':{'id':_0x32350c[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x382d20,null))['then'](function(_0x588838){if(_0x588838){_0xd31fb5=_0x588838;_0x9ef26f[_0xe87b('0x33')]=_[_0xe87b('0x49')](db[_0xe87b('0x9a')][_0xe87b('0x59')]);_0x9ef26f[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x32350c[_0xe87b('0x35')]);_0x9ef26f[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x9ef26f['model'],_0x9ef26f[_0xe87b('0x35')]);_0xd989fb[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x9ef26f[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x32350c['query'][_0xe87b('0x37')]));_0xd989fb['attributes']=_0xd989fb[_0xe87b('0x38')][_0xe87b('0x39')]?_0xd989fb[_0xe87b('0x38')]:_0x9ef26f[_0xe87b('0x33')];_0xd989fb[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x32350c[_0xe87b('0x35')]['sort']);_0xd989fb[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_['pick'](_0x32350c[_0xe87b('0x35')],_0x9ef26f['filters']));if(_0x32350c[_0xe87b('0x35')][_0xe87b('0x42')]){_0xd989fb[_0xe87b('0x3d')]=_[_0xe87b('0x40')](_0xd989fb[_0xe87b('0x3d')],{'$or':_[_0xe87b('0x29')](_0xd989fb[_0xe87b('0x38')],function(_0x3ed05f){var _0x467b9f={};_0x467b9f[_0x3ed05f]={'$like':'%'+_0x32350c[_0xe87b('0x35')][_0xe87b('0x42')]+'%'};return _0x467b9f;})});}_0xd989fb=_[_0xe87b('0x40')]({},_0xd989fb,_0x32350c[_0xe87b('0x4a')]);return _0xd31fb5[_0xe87b('0xb0')](_0xd989fb);}})[_0xe87b('0x25')](function(_0x3a802d){if(_0x3a802d){_0x3f4d85=_0x3a802d[_0xe87b('0x39')];if(!_0x32350c[_0xe87b('0x35')]['hasOwnProperty'](_0xe87b('0x3b'))){_0xd989fb[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x32350c[_0xe87b('0x35')][_0xe87b('0x1e')]);_0xd989fb['offset']=qs[_0xe87b('0x20')](_0x32350c['query']['offset']);}return _0xd31fb5[_0xe87b('0xb0')](_0xd989fb);}})[_0xe87b('0x25')](function(_0x418ac3){if(_0x418ac3){return _0x418ac3?{'count':_0x3f4d85,'rows':_0x418ac3}:null;}})['then'](respondWithResult(_0x382d20,null))['catch'](handleError(_0x382d20,null));};exports[_0xe87b('0xb1')]=function(_0xe1ca51,_0x3efef8,_0x1e0e9a){var _0x177463,_0x3158ae;return db[_0xe87b('0x31')][_0xe87b('0x4b')]({'where':{'id':_0xe1ca51['params']['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x3efef8,null))['then'](function(_0x536e1f){if(_0x536e1f){_0x3158ae=_0x536e1f;return _0x536e1f[_0xe87b('0xb1')](_0xe1ca51[_0xe87b('0x4d')]['ids'],_[_0xe87b('0x5a')](_0xe1ca51['body'],['ids','id'])||{});}return null;})[_0xe87b('0x91')](function(_0x1712cf){var _0x3ae192;_0x177463=_0x1712cf||[];var _0x355232=[];if(_0x1712cf){for(var _0x101e41=0x0;_0x101e41<_0x1712cf[_0xe87b('0x39')];_0x101e41+=0x1){var _0x211c93=_0x1712cf[_0x101e41][_0xe87b('0x4f')]({'plain':!![]});_0x3ae192=squel['insert']()['into']('cm_hopper_black')[_0xe87b('0x9f')]([_0xe87b('0xa0'),'ContactId',_0xe87b('0xa3'),'VoiceQueueId','createdAt',_0xe87b('0x5b')],squel[_0xe87b('0x7f')]()[_0xe87b('0x80')]('phone',_0xe87b('0xa0'))['field']('id',_0xe87b('0xa2'))[_0xe87b('0x80')](_0x211c93[_0xe87b('0xa6')]['toString'](),_0xe87b('0xa3'))[_0xe87b('0x80')](_0xe1ca51[_0xe87b('0x48')]['id']['toString'](),_0xe87b('0x5f'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0xa4'))['field'](_0xe87b('0xa5'),_0xe87b('0x5b'))[_0xe87b('0x82')](_0xe87b('0xa7'))[_0xe87b('0x3d')](_0xe87b('0xa8'))[_0xe87b('0x3d')](_0xe87b('0xa9'),_0x211c93[_0xe87b('0xa6')][_0xe87b('0x89')]())[_0xe87b('0x3d')](_0xe87b('0xaa')))[_0xe87b('0x89')]();_0x355232[_0xe87b('0x88')](db['sequelize'][_0xe87b('0x35')](_0x3ae192));}return BPromise[_0xe87b('0x94')](_0x355232);}})[_0xe87b('0x25')](function(){return _0x177463;})[_0xe87b('0x25')](respondWithResult(_0x3efef8,null))['catch'](handleError(_0x3efef8,null));};exports[_0xe87b('0xb2')]=function(_0x97efb5,_0x24137f,_0x2f7c3a){return db[_0xe87b('0x31')]['find']({'where':{'id':_0x97efb5[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x24137f,null))[_0xe87b('0x25')](function(_0x1f2997){if(_0x1f2997){return _0x1f2997[_0xe87b('0xb2')](_0x97efb5[_0xe87b('0x35')][_0xe87b('0x7e')]);}})[_0xe87b('0x25')](function(_0x293f4d){if(_0x293f4d){return db[_0xe87b('0x67')][_0xe87b('0x26')]({'where':{'ListId':_0x97efb5[_0xe87b('0x35')][_0xe87b('0x7e')],'VoiceQueueId':_0x97efb5['params']['id']}})[_0xe87b('0x25')](function(){return _0x293f4d;});}})[_0xe87b('0x25')](respondWithStatusCode(_0x24137f,null))[_0xe87b('0x46')](handleError(_0x24137f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index a3e4648..8198298 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 _0xc960=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x15b932,_0x39ba3f){var _0x28fa64=function(_0x479c8a){while(--_0x479c8a){_0x15b932['push'](_0x15b932['shift']());}};_0x28fa64(++_0x39ba3f);}(_0xc960,0xd8));var _0x0c96=function(_0x443a3c,_0x3dc955){_0x443a3c=_0x443a3c-0x0;var _0x1f32a7=_0xc960[_0x443a3c];return _0x1f32a7;};'use strict';var EventEmitter=require(_0x0c96('0x0'));var VoiceQueue=require(_0x0c96('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0c96('0x2')](0x0);var events={'afterCreate':_0x0c96('0x3'),'afterUpdate':_0x0c96('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7086d4){return function(_0x9ad18f,_0x287b95,_0x8cae18){VoiceQueueEvents[_0x0c96('0x5')](_0x7086d4+':'+_0x9ad18f['id'],_0x9ad18f);VoiceQueueEvents['emit'](_0x7086d4,_0x9ad18f);_0x8cae18(null);};}for(var e in events){if(events[_0x0c96('0x6')](e)){var event=events[e];VoiceQueue[_0x0c96('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xa793=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0xca8fb1,_0x461bba){var _0xc1ef8=function(_0xf27010){while(--_0xf27010){_0xca8fb1['push'](_0xca8fb1['shift']());}};_0xc1ef8(++_0x461bba);}(_0xa793,0x1a8));var _0x3a79=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0xa793[_0x2e6dbf];return _0x2680e5;};'use strict';var EventEmitter=require(_0x3a79('0x0'));var VoiceQueue=require(_0x3a79('0x1'))['db'][_0x3a79('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3a79('0x3')](0x0);var events={'afterCreate':_0x3a79('0x4'),'afterUpdate':_0x3a79('0x5'),'afterDestroy':_0x3a79('0x6')};function emitEvent(_0x1eea22){return function(_0x17c638,_0x2481fb,_0x3bf38b){VoiceQueueEvents[_0x3a79('0x7')](_0x1eea22+':'+_0x17c638['id'],_0x17c638);VoiceQueueEvents[_0x3a79('0x7')](_0x1eea22,_0x17c638);_0x3bf38b(null);};}for(var e in events){if(events[_0x3a79('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x3a79('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 3e5d308..00ee475 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x255caf,_0x2f893b){var _0x25e862=function(_0xffbed9){while(--_0xffbed9){_0x255caf['push'](_0x255caf['shift']());}};_0x25e862(++_0x2f893b);}(_0x008c,0x188));var _0xc008=function(_0x5bc05a,_0x20fe3a){_0x5bc05a=_0x5bc05a-0x0;var _0x5bbd92=_0x008c[_0x5bc05a];return _0x5bbd92;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2cddee,_0x4abb1f){var _0x437838=function(_0x37ad8a){while(--_0x37ad8a){_0x2cddee['push'](_0x2cddee['shift']());}};_0x437838(++_0x4abb1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 1d041f0..8d18486 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 _0x0ac5=['register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','raw','options','where','attributes','limit','include','map','model','stringify','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','defaults','redis','socket.io-emitter','./voiceQueue.socket'];(function(_0x55bac1,_0x51cf9b){var _0x99e374=function(_0x31554f){while(--_0x31554f){_0x55bac1['push'](_0x55bac1['shift']());}};_0x99e374(++_0x51cf9b);}(_0x0ac5,0x65));var _0x50ac=function(_0x20bf3c,_0x19240b){_0x20bf3c=_0x20bf3c-0x0;var _0x5a6596=_0x0ac5[_0x20bf3c];return _0x5a6596;};'use strict';var _=require(_0x50ac('0x0'));var util=require(_0x50ac('0x1'));var moment=require(_0x50ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x50ac('0x3'));var fs=require('fs');var Redis=require(_0x50ac('0x4'));var db=require(_0x50ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x50ac('0x6'))(_0x50ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x50ac('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x50ac('0x9')](config[_0x50ac('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x50ac('0xb'))(new Redis(config[_0x50ac('0xa')]));require(_0x50ac('0xc'))[_0x50ac('0xd')](socket);function respondWithRpcPromise(_0xa52623,_0xf07520,_0x47522){return new BPromise(function(_0x1b77d1,_0x2b5e4c){return client[_0x50ac('0xe')](_0xa52623,_0x47522)[_0x50ac('0xf')](function(_0x462c0f){logger[_0x50ac('0x10')]('VoiceQueue,\x20%s,\x20%s',_0xf07520,_0x50ac('0x11'));logger[_0x50ac('0x12')](_0x50ac('0x13'),_0xf07520,_0x50ac('0x11'),JSON['stringify'](_0x462c0f));if(_0x462c0f[_0x50ac('0x14')]){if(_0x462c0f['error']['code']===0x1f4){logger[_0x50ac('0x14')](_0x50ac('0x15'),_0xf07520,_0x462c0f[_0x50ac('0x14')][_0x50ac('0x16')]);return _0x2b5e4c(_0x462c0f[_0x50ac('0x14')][_0x50ac('0x16')]);}logger[_0x50ac('0x14')]('VoiceQueue,\x20%s,\x20%s',_0xf07520,_0x462c0f[_0x50ac('0x14')][_0x50ac('0x16')]);return _0x1b77d1(_0x462c0f['error']['message']);}else{logger[_0x50ac('0x10')](_0x50ac('0x15'),_0xf07520,'request\x20sent');_0x1b77d1(_0x462c0f[_0x50ac('0x17')][_0x50ac('0x16')]);}})[_0x50ac('0x18')](function(_0x554527){logger[_0x50ac('0x14')]('VoiceQueue,\x20%s,\x20%s',_0xf07520,_0x554527);_0x2b5e4c(_0x554527);});});}exports[_0x50ac('0x19')]=function(_0x572814){var _0x387d70=this;return new Promise(function(_0x156683,_0x466b4d){return db['VoiceQueue']['findAll']({'raw':_0x572814['options']?_0x572814['options'][_0x50ac('0x1a')]===undefined?!![]:![]:!![],'where':_0x572814[_0x50ac('0x1b')]?_0x572814[_0x50ac('0x1b')][_0x50ac('0x1c')]||null:null,'attributes':_0x572814[_0x50ac('0x1b')]?_0x572814['options'][_0x50ac('0x1d')]||null:null,'limit':_0x572814[_0x50ac('0x1b')]?_0x572814['options'][_0x50ac('0x1e')]||null:null,'include':_0x572814[_0x50ac('0x1b')]?_0x572814[_0x50ac('0x1b')]['include']?_['map'](_0x572814['options'][_0x50ac('0x1f')],function(_0x3bc774){return{'model':db[_0x3bc774['model']],'as':_0x3bc774['as'],'attributes':_0x3bc774[_0x50ac('0x1d')],'include':_0x3bc774[_0x50ac('0x1f')]?_[_0x50ac('0x20')](_0x3bc774[_0x50ac('0x1f')],function(_0x1ab591){return{'model':db[_0x1ab591[_0x50ac('0x21')]],'as':_0x1ab591['as'],'attributes':_0x1ab591[_0x50ac('0x1d')],'include':_0x1ab591[_0x50ac('0x1f')]?_[_0x50ac('0x20')](_0x1ab591[_0x50ac('0x1f')],function(_0x3fb253){return{'model':db[_0x3fb253[_0x50ac('0x21')]],'as':_0x3fb253['as'],'attributes':_0x3fb253[_0x50ac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50ac('0xf')](function(_0x3637d8){logger['info'](_0x50ac('0x19'),_0x572814);logger[_0x50ac('0x12')](_0x50ac('0x19'),_0x572814,JSON[_0x50ac('0x22')](_0x3637d8));_0x156683(_0x3637d8);})[_0x50ac('0x18')](function(_0x5911f2){logger['error'](_0x50ac('0x19'),_0x5911f2['message'],_0x572814);_0x466b4d(_0x387d70[_0x50ac('0x14')](0x1f4,_0x5911f2[_0x50ac('0x16')]));});});};exports[_0x50ac('0x23')]=function(_0x51a497){var _0xe83e83=this;return new Promise(function(_0x533f44,_0x37da7c){return db[_0x50ac('0x24')][_0x50ac('0x25')]({'raw':_0x51a497[_0x50ac('0x1b')]?_0x51a497[_0x50ac('0x1b')][_0x50ac('0x1a')]===undefined?!![]:![]:!![],'where':_0x51a497[_0x50ac('0x1b')]?_0x51a497[_0x50ac('0x1b')][_0x50ac('0x1c')]||null:null,'attributes':_0x51a497['options']?_0x51a497[_0x50ac('0x1b')][_0x50ac('0x1d')]||null:null,'include':_0x51a497['options']?_0x51a497[_0x50ac('0x1b')]['include']?_['map'](_0x51a497['options'][_0x50ac('0x1f')],function(_0x2ede9c){return{'model':db[_0x2ede9c[_0x50ac('0x21')]],'as':_0x2ede9c['as'],'attributes':_0x2ede9c['attributes'],'include':_0x2ede9c[_0x50ac('0x1f')]?_['map'](_0x2ede9c[_0x50ac('0x1f')],function(_0x173402){return{'model':db[_0x173402[_0x50ac('0x21')]],'as':_0x173402['as'],'attributes':_0x173402['attributes'],'include':_0x173402['include']?_[_0x50ac('0x20')](_0x173402[_0x50ac('0x1f')],function(_0x2c098d){return{'model':db[_0x2c098d[_0x50ac('0x21')]],'as':_0x2c098d['as'],'attributes':_0x2c098d[_0x50ac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50ac('0xf')](function(_0x1dbd2f){logger['info'](_0x50ac('0x23'),_0x51a497);logger[_0x50ac('0x12')](_0x50ac('0x23'),_0x51a497,JSON[_0x50ac('0x22')](_0x1dbd2f));_0x533f44(_0x1dbd2f);})[_0x50ac('0x18')](function(_0x3977f6){logger['error'](_0x50ac('0x23'),_0x3977f6[_0x50ac('0x16')],_0x51a497);_0x37da7c(_0xe83e83[_0x50ac('0x14')](0x1f4,_0x3977f6[_0x50ac('0x16')]));});});}; \ No newline at end of file +var _0x6a14=['catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','ShowVoiceQueue','where','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','request','then','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x33a287,_0x529498){var _0x57cf0b=function(_0x30ccf9){while(--_0x30ccf9){_0x33a287['push'](_0x33a287['shift']());}};_0x57cf0b(++_0x529498);}(_0x6a14,0xc8));var _0x46a1=function(_0x58f0df,_0x192cfa){_0x58f0df=_0x58f0df-0x0;var _0x38de0c=_0x6a14[_0x58f0df];return _0x38de0c;};'use strict';var _=require('lodash');var util=require(_0x46a1('0x0'));var moment=require(_0x46a1('0x1'));var BPromise=require(_0x46a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46a1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x46a1('0x4'))(_0x46a1('0x5'));var config=require(_0x46a1('0x6'));var jayson=require(_0x46a1('0x7'));var client=jayson[_0x46a1('0x8')][_0x46a1('0x9')]({'port':0x232a});config[_0x46a1('0xa')]=_[_0x46a1('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5863cf,_0xd64900,_0xde3296){return new BPromise(function(_0x5d8a59,_0x1ae4c3){return client[_0x46a1('0xc')](_0x5863cf,_0xde3296)[_0x46a1('0xd')](function(_0x14945d){logger[_0x46a1('0xe')](_0x46a1('0xf'),_0xd64900,'request\x20sent');logger['debug'](_0x46a1('0x10'),_0xd64900,_0x46a1('0x11'),JSON['stringify'](_0x14945d));if(_0x14945d[_0x46a1('0x12')]){if(_0x14945d['error'][_0x46a1('0x13')]===0x1f4){logger[_0x46a1('0x12')](_0x46a1('0xf'),_0xd64900,_0x14945d[_0x46a1('0x12')][_0x46a1('0x14')]);return _0x1ae4c3(_0x14945d[_0x46a1('0x12')][_0x46a1('0x14')]);}logger['error'](_0x46a1('0xf'),_0xd64900,_0x14945d[_0x46a1('0x12')][_0x46a1('0x14')]);return _0x5d8a59(_0x14945d[_0x46a1('0x12')][_0x46a1('0x14')]);}else{logger[_0x46a1('0xe')](_0x46a1('0xf'),_0xd64900,'request\x20sent');_0x5d8a59(_0x14945d[_0x46a1('0x15')][_0x46a1('0x14')]);}})[_0x46a1('0x16')](function(_0x1024ad){logger[_0x46a1('0x12')]('VoiceQueue,\x20%s,\x20%s',_0xd64900,_0x1024ad);_0x1ae4c3(_0x1024ad);});});}exports[_0x46a1('0x17')]=function(_0x3fd40c){var _0x8c1854=this;return new Promise(function(_0x4f5b59,_0x4205ac){return db[_0x46a1('0x18')][_0x46a1('0x19')]({'raw':_0x3fd40c[_0x46a1('0x1a')]?_0x3fd40c[_0x46a1('0x1a')][_0x46a1('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fd40c[_0x46a1('0x1a')]?_0x3fd40c['options']['where']||null:null,'attributes':_0x3fd40c[_0x46a1('0x1a')]?_0x3fd40c[_0x46a1('0x1a')][_0x46a1('0x1c')]||null:null,'limit':_0x3fd40c[_0x46a1('0x1a')]?_0x3fd40c['options'][_0x46a1('0x1d')]||null:null,'include':_0x3fd40c['options']?_0x3fd40c[_0x46a1('0x1a')][_0x46a1('0x1e')]?_[_0x46a1('0x1f')](_0x3fd40c[_0x46a1('0x1a')]['include'],function(_0xa03b8c){return{'model':db[_0xa03b8c[_0x46a1('0x20')]],'as':_0xa03b8c['as'],'attributes':_0xa03b8c[_0x46a1('0x1c')],'include':_0xa03b8c[_0x46a1('0x1e')]?_[_0x46a1('0x1f')](_0xa03b8c[_0x46a1('0x1e')],function(_0x10fe0c){return{'model':db[_0x10fe0c['model']],'as':_0x10fe0c['as'],'attributes':_0x10fe0c[_0x46a1('0x1c')],'include':_0x10fe0c[_0x46a1('0x1e')]?_[_0x46a1('0x1f')](_0x10fe0c[_0x46a1('0x1e')],function(_0x2e6d0a){return{'model':db[_0x2e6d0a[_0x46a1('0x20')]],'as':_0x2e6d0a['as'],'attributes':_0x2e6d0a['attributes']};}):[]};}):[]};}):[]:[]})[_0x46a1('0xd')](function(_0x4ac54e){logger[_0x46a1('0xe')]('GetVoiceQueue',_0x3fd40c);logger[_0x46a1('0x21')](_0x46a1('0x17'),_0x3fd40c,JSON[_0x46a1('0x22')](_0x4ac54e));_0x4f5b59(_0x4ac54e);})[_0x46a1('0x16')](function(_0x5ee7bb){logger[_0x46a1('0x12')](_0x46a1('0x17'),_0x5ee7bb[_0x46a1('0x14')],_0x3fd40c);_0x4205ac(_0x8c1854[_0x46a1('0x12')](0x1f4,_0x5ee7bb[_0x46a1('0x14')]));});});};exports[_0x46a1('0x23')]=function(_0x252026){var _0xe2e279=this;return new Promise(function(_0x684b14,_0x4158ab){return db[_0x46a1('0x18')]['find']({'raw':_0x252026[_0x46a1('0x1a')]?_0x252026[_0x46a1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x252026[_0x46a1('0x1a')]?_0x252026[_0x46a1('0x1a')][_0x46a1('0x24')]||null:null,'attributes':_0x252026[_0x46a1('0x1a')]?_0x252026[_0x46a1('0x1a')][_0x46a1('0x1c')]||null:null,'include':_0x252026[_0x46a1('0x1a')]?_0x252026['options'][_0x46a1('0x1e')]?_[_0x46a1('0x1f')](_0x252026['options']['include'],function(_0xc14a2c){return{'model':db[_0xc14a2c[_0x46a1('0x20')]],'as':_0xc14a2c['as'],'attributes':_0xc14a2c[_0x46a1('0x1c')],'include':_0xc14a2c[_0x46a1('0x1e')]?_['map'](_0xc14a2c['include'],function(_0x180a9c){return{'model':db[_0x180a9c[_0x46a1('0x20')]],'as':_0x180a9c['as'],'attributes':_0x180a9c[_0x46a1('0x1c')],'include':_0x180a9c[_0x46a1('0x1e')]?_['map'](_0x180a9c['include'],function(_0x16b0ba){return{'model':db[_0x16b0ba[_0x46a1('0x20')]],'as':_0x16b0ba['as'],'attributes':_0x16b0ba[_0x46a1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x46a1('0xd')](function(_0x49235d){logger[_0x46a1('0xe')](_0x46a1('0x23'),_0x252026);logger[_0x46a1('0x21')](_0x46a1('0x23'),_0x252026,JSON[_0x46a1('0x22')](_0x49235d));_0x684b14(_0x49235d);})[_0x46a1('0x16')](function(_0x5a332e){logger[_0x46a1('0x12')](_0x46a1('0x23'),_0x5a332e['message'],_0x252026);_0x4158ab(_0xe2e279[_0x46a1('0x12')](0x1f4,_0x5a332e[_0x46a1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 58c594c..2041a07 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 _0x06e5=['register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x5ec4db,_0x5d931e){var _0x40b983=function(_0x5b6763){while(--_0x5b6763){_0x5ec4db['push'](_0x5ec4db['shift']());}};_0x40b983(++_0x5d931e);}(_0x06e5,0x73));var _0x506e=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x06e5[_0x422905];return _0x33dc6c;};'use strict';var VoiceQueueEvents=require(_0x506e('0x0'));var events=[_0x506e('0x1'),_0x506e('0x2'),_0x506e('0x3')];function createListener(_0x5641ac,_0x35278b){return function(_0x49b28d){_0x35278b[_0x506e('0x4')](_0x5641ac,_0x49b28d);};}function removeListener(_0xee2fba,_0x473063){return function(){VoiceQueueEvents['removeListener'](_0xee2fba,_0x473063);};}exports[_0x506e('0x5')]=function(_0x1fee6c){for(var _0xa473ce=0x0,_0x198b1d=events[_0x506e('0x6')];_0xa473ce<_0x198b1d;_0xa473ce++){var _0x564aa0=events[_0xa473ce];var _0xe72cc3=createListener(_0x506e('0x7')+_0x564aa0,_0x1fee6c);VoiceQueueEvents['on'](_0x564aa0,_0xe72cc3);}}; \ No newline at end of file +var _0x9eb5=['remove','update','emit','register','voiceQueue:','./voiceQueue.events','save'];(function(_0x2f6be5,_0x2281c8){var _0x4e2a41=function(_0x455d0c){while(--_0x455d0c){_0x2f6be5['push'](_0x2f6be5['shift']());}};_0x4e2a41(++_0x2281c8);}(_0x9eb5,0x1cc));var _0x59eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9eb5[_0x321bb2];return _0x9c12ed;};'use strict';var VoiceQueueEvents=require(_0x59eb('0x0'));var events=[_0x59eb('0x1'),_0x59eb('0x2'),_0x59eb('0x3')];function createListener(_0x3901c2,_0x30ca29){return function(_0x58e531){_0x30ca29[_0x59eb('0x4')](_0x3901c2,_0x58e531);};}function removeListener(_0x1c77d4,_0x3f425b){return function(){VoiceQueueEvents['removeListener'](_0x1c77d4,_0x3f425b);};}exports[_0x59eb('0x5')]=function(_0xff591a){for(var _0x165b32=0x0,_0x3f59d7=events['length'];_0x165b32<_0x3f59d7;_0x165b32++){var _0x1f790e=events[_0x165b32];var _0x287573=createListener(_0x59eb('0x6')+_0x1f790e,_0xff591a);VoiceQueueEvents['on'](_0x1f790e,_0x287573);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index ee901e3..8c4eeea 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 _0xc26c=['post','put','update','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','show'];(function(_0x59663d,_0x24a288){var _0x2ec850=function(_0x4f8e1b){while(--_0x4f8e1b){_0x59663d['push'](_0x59663d['shift']());}};_0x2ec850(++_0x24a288);}(_0xc26c,0x1bf));var _0xcc26=function(_0x2131b3,_0x2fa235){_0x2131b3=_0x2131b3-0x0;var _0x2b97f4=_0xc26c[_0x2131b3];return _0x2b97f4;};'use strict';var multer=require('multer');var util=require(_0xcc26('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc26('0x1'));var router=express['Router']();var fs_extra=require(_0xcc26('0x2'));var auth=require(_0xcc26('0x3'));var interaction=require(_0xcc26('0x4'));var config=require(_0xcc26('0x5'));var controller=require(_0xcc26('0x6'));router[_0xcc26('0x7')]('/',auth[_0xcc26('0x8')](),controller[_0xcc26('0x9')]);router[_0xcc26('0x7')](_0xcc26('0xa'),auth[_0xcc26('0x8')](),controller[_0xcc26('0xb')]);router[_0xcc26('0x7')](_0xcc26('0xc'),auth[_0xcc26('0x8')](),controller[_0xcc26('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcc26('0xe')]);router[_0xcc26('0xf')]('/',auth[_0xcc26('0x8')](),controller['create']);router[_0xcc26('0x10')]('/:id',auth[_0xcc26('0x8')](),controller[_0xcc26('0x11')]);router[_0xcc26('0x12')]('/:id',auth[_0xcc26('0x8')](),controller[_0xcc26('0x13')]);module[_0xcc26('0x14')]=router; \ No newline at end of file +var _0xb49b=['/index','getVoiceQueuesReport','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe'];(function(_0x22b6f6,_0x5ef2b4){var _0x11a407=function(_0x1ab284){while(--_0x1ab284){_0x22b6f6['push'](_0x22b6f6['shift']());}};_0x11a407(++_0x5ef2b4);}(_0xb49b,0x81));var _0xbb49=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb49b[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xbb49('0x0'));var util=require(_0xbb49('0x1'));var path=require(_0xbb49('0x2'));var timeout=require(_0xbb49('0x3'));var express=require(_0xbb49('0x4'));var router=express['Router']();var fs_extra=require(_0xbb49('0x5'));var auth=require(_0xbb49('0x6'));var interaction=require(_0xbb49('0x7'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xbb49('0x8')]('/',auth[_0xbb49('0x9')](),controller['index']);router[_0xbb49('0x8')](_0xbb49('0xa'),auth[_0xbb49('0x9')](),controller['describe']);router[_0xbb49('0x8')](_0xbb49('0xb'),auth['isAuthenticated'](),controller[_0xbb49('0xc')]);router[_0xbb49('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbb49('0xd')]('/',auth[_0xbb49('0x9')](),controller[_0xbb49('0xe')]);router[_0xbb49('0xf')](_0xbb49('0x10'),auth['isAuthenticated'](),controller[_0xbb49('0x11')]);router[_0xbb49('0x12')]('/:id',auth[_0xbb49('0x9')](),controller[_0xbb49('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d1f02ee..f6eae24 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 _0xf8f2=['STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','queuecallerleaveAt','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x6f4046,_0x133bc9){var _0x35e23f=function(_0x17140c){while(--_0x17140c){_0x6f4046['push'](_0x6f4046['shift']());}};_0x35e23f(++_0x133bc9);}(_0xf8f2,0xa7));var _0x2f8f=function(_0xc3a516,_0x32c235){_0xc3a516=_0xc3a516-0x0;var _0x1aec8a=_0xf8f2[_0xc3a516];return _0x1aec8a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2f8f('0x0')]={'type':{'type':Sequelize[_0x2f8f('0x1')]},'uniqueid':{'type':Sequelize[_0x2f8f('0x1')]},'calleridnum':{'type':Sequelize[_0x2f8f('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x2f8f('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x2f8f('0x2')],'set':function(_0x471cbb){var _0x1383db=moment(_0x471cbb);var _0x2a8026=moment(this[_0x2f8f('0x3')](_0x2f8f('0x4')))[_0x2f8f('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2a1332=_0x1383db[_0x2f8f('0x6')](_0x2a8026,_0x2f8f('0x7'));this['setDataValue'](_0x2f8f('0x8'),_0x471cbb);this['setDataValue'](_0x2f8f('0x9'),_0x2a1332||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x2f8f('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x2f8f('0x2')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2f8f('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x2f8f('0x1')],'comment':_0x2f8f('0xb')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x2f8f('0x1')]},'connectedlinename':{'type':Sequelize[_0x2f8f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2f8f('0x1')]},'exten':{'type':Sequelize[_0x2f8f('0x1')]},'priority':{'type':Sequelize[_0x2f8f('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x2f8f('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2f8f('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2f8f('0x1')]},'transfer':{'type':Sequelize[_0x2f8f('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2f8f('0x1')],'comment':_0x2f8f('0xd')},'transferexten':{'type':Sequelize[_0x2f8f('0x1')]},'transferuniqueid':{'type':Sequelize[_0x2f8f('0x1')]},'disposition':{'type':Sequelize[_0x2f8f('0x1')]},'secondDisposition':{'type':Sequelize[_0x2f8f('0x1')]},'thirdDisposition':{'type':Sequelize[_0x2f8f('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x2f8f('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x46c9=['DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0x46c9,0xfc));var _0x946c=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x46c9[_0x13cab0];return _0x38804f;};'use strict';var Sequelize=require(_0x946c('0x0'));var moment=require(_0x946c('0x1'));module[_0x946c('0x2')]={'type':{'type':Sequelize[_0x946c('0x3')]},'uniqueid':{'type':Sequelize[_0x946c('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x946c('0x3')]},'queue':{'type':Sequelize[_0x946c('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x946c('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x946c('0x4')],'set':function(_0x8b9068){var _0x492673=moment(_0x8b9068);var _0x42d098=moment(this['getDataValue'](_0x946c('0x5')))[_0x946c('0x6')](_0x946c('0x7'));var _0x6f9f77=_0x492673[_0x946c('0x8')](_0x42d098,'seconds');this[_0x946c('0x9')](_0x946c('0xa'),_0x8b9068);this[_0x946c('0x9')](_0x946c('0xb'),_0x6f9f77||null);}},'position':{'type':Sequelize[_0x946c('0xc')]},'count':{'type':Sequelize[_0x946c('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x946c('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x946c('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x946c('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x946c('0x4')]},'queuecallerexit':{'type':Sequelize[_0x946c('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x946c('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x946c('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x946c('0x3')]},'connectedlinenum':{'type':Sequelize[_0x946c('0x3')]},'connectedlinename':{'type':Sequelize[_0x946c('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x946c('0x3')]},'exten':{'type':Sequelize[_0x946c('0x3')]},'priority':{'type':Sequelize[_0x946c('0x3')]},'holdtime':{'type':Sequelize[_0x946c('0xc')]},'mohtime':{'type':Sequelize[_0x946c('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x946c('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x946c('0x3')]},'transfer':{'type':Sequelize[_0x946c('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x946c('0x3')],'comment':_0x946c('0xf')},'transferexten':{'type':Sequelize[_0x946c('0x3')]},'transferuniqueid':{'type':Sequelize[_0x946c('0x3')]},'disposition':{'type':Sequelize[_0x946c('0x3')]},'secondDisposition':{'type':Sequelize[_0x946c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x946c('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 34e409f..2640e1d 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 _0xa3aa=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','includeAll','find','create','body','params','destroy','describe','getVoiceQueuesReport','rows','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','json'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0xa3aa,0x1cc));var _0xaa3a=function(_0x220de9,_0x35a959){_0x220de9=_0x220de9-0x0;var _0xe38a42=_0xa3aa[_0x220de9];return _0xe38a42;};'use strict';var emlformat=require(_0xaa3a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaa3a('0x1'));var rp=require('request-promise');var moment=require(_0xaa3a('0x2'));var BPromise=require(_0xaa3a('0x3'));var Mustache=require(_0xaa3a('0x4'));var util=require(_0xaa3a('0x5'));var path=require(_0xaa3a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaa3a('0x7'));var fs=require('fs');var fs_extra=require(_0xaa3a('0x8'));var _=require(_0xaa3a('0x9'));var squel=require(_0xaa3a('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa3a('0xb'));var deskjs=require(_0xaa3a('0xc'));var toCsv=require(_0xaa3a('0xd'));var querystring=require(_0xaa3a('0xe'));var Papa=require(_0xaa3a('0xf'));var Redis=require(_0xaa3a('0x10'));var authService=require(_0xaa3a('0x11'));var qs=require(_0xaa3a('0x12'));var as=require(_0xaa3a('0x13'));var hardwareService=require(_0xaa3a('0x14'));var logger=require(_0xaa3a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xaa3a('0x16'));var licenseUtil=require(_0xaa3a('0x17'));var db=require(_0xaa3a('0x18'))['db'];config['redis']=_[_0xaa3a('0x19')](config[_0xaa3a('0x1a')],{'host':_0xaa3a('0x1b'),'port':0x18eb});var socket=require(_0xaa3a('0x1c'))(new Redis(config[_0xaa3a('0x1a')]));require('./voiceQueueReport.socket')[_0xaa3a('0x1d')](socket);function respondWithStatusCode(_0x2fecb1,_0x3f942f){_0x3f942f=_0x3f942f||0xcc;return function(_0x2f0c0a){if(_0x2f0c0a){return _0x2fecb1['sendStatus'](_0x3f942f);}return _0x2fecb1[_0xaa3a('0x1e')](_0x3f942f)['end']();};}function respondWithResult(_0x37aafd,_0x32b95c){_0x32b95c=_0x32b95c||0xc8;return function(_0x3a38de){if(_0x3a38de){return _0x37aafd['status'](_0x32b95c)[_0xaa3a('0x1f')](_0x3a38de);}};}function respondWithFilteredResult(_0x2694cb,_0x37396b){return function(_0x163428){if(_0x163428){var _0x22b9d1=typeof _0x37396b[_0xaa3a('0x20')]===_0xaa3a('0x21')&&typeof _0x37396b[_0xaa3a('0x22')]==='undefined';var _0x368c2a=_0x163428[_0xaa3a('0x23')];var _0x594847=_0x22b9d1?0x0:_0x37396b['offset'];var _0x3ee322=_0x22b9d1?_0x163428[_0xaa3a('0x23')]:_0x37396b[_0xaa3a('0x20')]+_0x37396b['limit'];var _0x1e6c27;if(_0x3ee322>=_0x368c2a){_0x3ee322=_0x368c2a;_0x1e6c27=0xc8;}else{_0x1e6c27=0xce;}_0x2694cb[_0xaa3a('0x1e')](_0x1e6c27);return _0x2694cb[_0xaa3a('0x24')](_0xaa3a('0x25'),_0x594847+'-'+_0x3ee322+'/'+_0x368c2a)[_0xaa3a('0x1f')](_0x163428);}return null;};}function patchUpdates(_0x163075){return function(_0x977f6c){try{jsonpatch[_0xaa3a('0x26')](_0x977f6c,_0x163075,!![]);}catch(_0x37a661){return BPromise[_0xaa3a('0x27')](_0x37a661);}return _0x977f6c[_0xaa3a('0x28')]();};}function saveUpdates(_0x55a60b,_0x20bf45){return function(_0x4ae3a1){if(_0x4ae3a1){return _0x4ae3a1[_0xaa3a('0x29')](_0x55a60b)['then'](function(_0x165e68){return _0x165e68;});}return null;};}function removeEntity(_0x2f99e3,_0x11710f){return function(_0x3a6b2a){if(_0x3a6b2a){return _0x3a6b2a['destroy']()[_0xaa3a('0x2a')](function(){_0x2f99e3[_0xaa3a('0x1e')](0xcc)[_0xaa3a('0x2b')]();});}};}function handleEntityNotFound(_0xaa862c,_0x56e3fb){return function(_0x1c2c31){if(!_0x1c2c31){_0xaa862c[_0xaa3a('0x2c')](0x194);}return _0x1c2c31;};}function handleError(_0x3f59fc,_0x53d5a0){_0x53d5a0=_0x53d5a0||0x1f4;return function(_0x565e22){logger[_0xaa3a('0x2d')](_0x565e22[_0xaa3a('0x2e')]);if(_0x565e22[_0xaa3a('0x2f')]){delete _0x565e22[_0xaa3a('0x2f')];}_0x3f59fc['status'](_0x53d5a0)['send'](_0x565e22);};}exports['index']=function(_0x2192d8,_0x1838ef){var _0x3893a6={},_0x421118={},_0x3a7755={'count':0x0,'rows':[]};var _0xb601f3=_[_0xaa3a('0x30')](db[_0xaa3a('0x31')][_0xaa3a('0x32')],function(_0x566396){return{'name':_0x566396[_0xaa3a('0x33')],'type':_0x566396['type'][_0xaa3a('0x34')]};});_0x421118[_0xaa3a('0x35')]=_[_0xaa3a('0x30')](_0xb601f3,'name');_0x421118[_0xaa3a('0x36')]=_[_0xaa3a('0x37')](_0x2192d8[_0xaa3a('0x36')]);_0x421118[_0xaa3a('0x38')]=_['intersection'](_0x421118[_0xaa3a('0x35')],_0x421118['query']);_0x3893a6[_0xaa3a('0x39')]=_[_0xaa3a('0x3a')](_0x421118['model'],qs[_0xaa3a('0x3b')](_0x2192d8['query'][_0xaa3a('0x3b')]));_0x3893a6[_0xaa3a('0x39')]=_0x3893a6[_0xaa3a('0x39')][_0xaa3a('0x3c')]?_0x3893a6['attributes']:_0x421118[_0xaa3a('0x35')];if(!_0x2192d8[_0xaa3a('0x36')][_0xaa3a('0x3d')]('nolimit')){_0x3893a6[_0xaa3a('0x22')]=qs[_0xaa3a('0x22')](_0x2192d8[_0xaa3a('0x36')][_0xaa3a('0x22')]);_0x3893a6[_0xaa3a('0x20')]=qs['offset'](_0x2192d8['query'][_0xaa3a('0x20')]);}_0x3893a6[_0xaa3a('0x3e')]=qs[_0xaa3a('0x3f')](_0x2192d8[_0xaa3a('0x36')]['sort']);_0x3893a6[_0xaa3a('0x40')]=qs['filters'](_[_0xaa3a('0x41')](_0x2192d8[_0xaa3a('0x36')],_0x421118[_0xaa3a('0x38')]),_0xb601f3);if(_0x2192d8[_0xaa3a('0x36')][_0xaa3a('0x42')]){_0x3893a6[_0xaa3a('0x40')]=_[_0xaa3a('0x43')](_0x3893a6[_0xaa3a('0x40')],{'$or':_[_0xaa3a('0x30')](_0xb601f3,function(_0x320e17){if(_0x320e17['type']!=='VIRTUAL'){var _0x32508f={};_0x32508f[_0x320e17[_0xaa3a('0x2f')]]={'$like':'%'+_0x2192d8[_0xaa3a('0x36')][_0xaa3a('0x42')]+'%'};return _0x32508f;}})});}_0x3893a6=_[_0xaa3a('0x43')]({},_0x3893a6,_0x2192d8[_0xaa3a('0x44')]);var _0x4fd716={'where':_0x3893a6[_0xaa3a('0x40')]};return db[_0xaa3a('0x31')][_0xaa3a('0x23')](_0x4fd716)[_0xaa3a('0x2a')](function(_0x4cdfb2){_0x3a7755['count']=_0x4cdfb2;if(_0x2192d8['query']['includeAll']){_0x3893a6[_0xaa3a('0x45')]=[{'all':!![]}];}return db[_0xaa3a('0x31')][_0xaa3a('0x46')](_0x3893a6);})[_0xaa3a('0x2a')](function(_0x8f6a7d){_0x3a7755['rows']=_0x8f6a7d;return _0x3a7755;})[_0xaa3a('0x2a')](respondWithFilteredResult(_0x1838ef,_0x3893a6))[_0xaa3a('0x47')](handleError(_0x1838ef,null));};exports[_0xaa3a('0x48')]=function(_0x5a530b,_0x5abec8){var _0x192460={'raw':![],'where':{'id':_0x5a530b['params']['id']}},_0x16c860={};_0x16c860[_0xaa3a('0x35')]=_[_0xaa3a('0x37')](db[_0xaa3a('0x31')][_0xaa3a('0x32')]);_0x16c860['query']=_[_0xaa3a('0x37')](_0x5a530b[_0xaa3a('0x36')]);_0x16c860[_0xaa3a('0x38')]=_[_0xaa3a('0x3a')](_0x16c860['model'],_0x16c860[_0xaa3a('0x36')]);_0x192460[_0xaa3a('0x39')]=_['intersection'](_0x16c860[_0xaa3a('0x35')],qs[_0xaa3a('0x3b')](_0x5a530b[_0xaa3a('0x36')][_0xaa3a('0x3b')]));_0x192460[_0xaa3a('0x39')]=_0x192460['attributes']['length']?_0x192460[_0xaa3a('0x39')]:_0x16c860['model'];if(_0x5a530b[_0xaa3a('0x36')][_0xaa3a('0x49')]){_0x192460[_0xaa3a('0x45')]=[{'all':!![]}];}_0x192460=_[_0xaa3a('0x43')]({},_0x192460,_0x5a530b['options']);return db['VoiceQueueReport'][_0xaa3a('0x4a')](_0x192460)['then'](handleEntityNotFound(_0x5abec8,null))['then'](respondWithResult(_0x5abec8,null))[_0xaa3a('0x47')](handleError(_0x5abec8,null));};exports[_0xaa3a('0x4b')]=function(_0x1efcbf,_0x5d0cb6){return db[_0xaa3a('0x31')][_0xaa3a('0x4b')](_0x1efcbf[_0xaa3a('0x4c')],{})[_0xaa3a('0x2a')](respondWithResult(_0x5d0cb6,0xc9))['catch'](handleError(_0x5d0cb6,null));};exports[_0xaa3a('0x29')]=function(_0x3a3f67,_0x575104){if(_0x3a3f67[_0xaa3a('0x4c')]['id']){delete _0x3a3f67['body']['id'];}return db[_0xaa3a('0x31')][_0xaa3a('0x4a')]({'where':{'id':_0x3a3f67[_0xaa3a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x575104,null))[_0xaa3a('0x2a')](saveUpdates(_0x3a3f67[_0xaa3a('0x4c')],null))[_0xaa3a('0x2a')](respondWithResult(_0x575104,null))[_0xaa3a('0x47')](handleError(_0x575104,null));};exports[_0xaa3a('0x4e')]=function(_0x5cc759,_0x23cac6){return db[_0xaa3a('0x31')][_0xaa3a('0x4a')]({'where':{'id':_0x5cc759[_0xaa3a('0x4d')]['id']}})[_0xaa3a('0x2a')](handleEntityNotFound(_0x23cac6,null))[_0xaa3a('0x2a')](removeEntity(_0x23cac6,null))[_0xaa3a('0x47')](handleError(_0x23cac6,null));};exports[_0xaa3a('0x4f')]=function(_0x33c7cf,_0xee3386){return db[_0xaa3a('0x31')]['describe']()['then'](respondWithResult(_0xee3386,null))[_0xaa3a('0x47')](handleError(_0xee3386,null));};exports[_0xaa3a('0x50')]=function(_0x5db568,_0x2cdbf6){var _0x5ce7bd={},_0x32242a={},_0x4ec499={'count':0x0,'rows':[]};_0x32242a[_0xaa3a('0x35')]=_[_0xaa3a('0x37')](db[_0xaa3a('0x31')][_0xaa3a('0x32')]);_0x32242a['query']=_[_0xaa3a('0x37')](_0x5db568[_0xaa3a('0x36')]);_0x32242a['filters']=_['intersection'](_0x32242a[_0xaa3a('0x35')],_0x32242a[_0xaa3a('0x36')]);_0x5ce7bd['attributes']=_[_0xaa3a('0x3a')](_0x32242a[_0xaa3a('0x35')],qs[_0xaa3a('0x3b')](_0x5db568[_0xaa3a('0x36')][_0xaa3a('0x3b')]));_0x5ce7bd[_0xaa3a('0x39')]=_0x5ce7bd[_0xaa3a('0x39')]['length']?_0x5ce7bd['attributes']:_0x32242a[_0xaa3a('0x35')];if(!_0x5db568['query'][_0xaa3a('0x3d')]('nolimit')){_0x5ce7bd[_0xaa3a('0x22')]=qs['limit'](_0x5db568[_0xaa3a('0x36')][_0xaa3a('0x22')]);_0x5ce7bd[_0xaa3a('0x20')]=qs['offset'](_0x5db568['query'][_0xaa3a('0x20')]);}_0x5ce7bd[_0xaa3a('0x3e')]=qs[_0xaa3a('0x3f')](_0x5db568[_0xaa3a('0x36')][_0xaa3a('0x3f')]);_0x5ce7bd[_0xaa3a('0x40')]=qs['filters'](_[_0xaa3a('0x41')](_0x5db568[_0xaa3a('0x36')],_0x32242a[_0xaa3a('0x38')]));if(_0x5db568['query']['filter']){_0x5ce7bd[_0xaa3a('0x40')]=_[_0xaa3a('0x43')](_0x5ce7bd[_0xaa3a('0x40')],{'$or':_[_0xaa3a('0x30')](_0x5ce7bd[_0xaa3a('0x39')],function(_0x427a04){var _0x3b7af0={};_0x3b7af0[_0x427a04]={'$like':'%'+_0x5db568[_0xaa3a('0x36')][_0xaa3a('0x42')]+'%'};return _0x3b7af0;})});}_0x5ce7bd=_[_0xaa3a('0x43')]({},_0x5ce7bd,_0x5db568['options']);var _0x212443={'where':_0x5ce7bd['where']};return db[_0xaa3a('0x31')]['count'](_0x212443)[_0xaa3a('0x2a')](function(_0x216444){_0x4ec499['count']=_0x216444;if(_0x5db568['query'][_0xaa3a('0x49')]){_0x5ce7bd[_0xaa3a('0x45')]=[{'all':!![]}];}return db[_0xaa3a('0x31')][_0xaa3a('0x46')](_0x5ce7bd);})[_0xaa3a('0x2a')](function(_0x23d36c){_0x4ec499[_0xaa3a('0x51')]=_0x23d36c;return _0x4ec499;})['then'](respondWithFilteredResult(_0x2cdbf6,_0x5ce7bd,_0xaa3a('0x50')))['catch'](handleError(_0x2cdbf6,null,_0xaa3a('0x50')));}; \ No newline at end of file +var _0xbb54=['stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','nolimit','options','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','end'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbb54,0x1bb));var _0x4bb5=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0xbb54[_0x36d203];return _0x2f9e62;};'use strict';var emlformat=require(_0x4bb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4bb5('0x1'));var jsonpatch=require(_0x4bb5('0x2'));var rp=require(_0x4bb5('0x3'));var moment=require(_0x4bb5('0x4'));var BPromise=require(_0x4bb5('0x5'));var Mustache=require('mustache');var util=require(_0x4bb5('0x6'));var path=require('path');var sox=require(_0x4bb5('0x7'));var csv=require(_0x4bb5('0x8'));var ejs=require(_0x4bb5('0x9'));var fs=require('fs');var fs_extra=require(_0x4bb5('0xa'));var _=require(_0x4bb5('0xb'));var squel=require('squel');var crypto=require(_0x4bb5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4bb5('0xd'));var toCsv=require(_0x4bb5('0x8'));var querystring=require(_0x4bb5('0xe'));var Papa=require(_0x4bb5('0xf'));var Redis=require('ioredis');var authService=require(_0x4bb5('0x10'));var qs=require(_0x4bb5('0x11'));var as=require(_0x4bb5('0x12'));var hardwareService=require(_0x4bb5('0x13'));var logger=require('../../config/logger')(_0x4bb5('0x14'));var utils=require(_0x4bb5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4bb5('0x16'));var db=require(_0x4bb5('0x17'))['db'];config['redis']=_[_0x4bb5('0x18')](config[_0x4bb5('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4bb5('0x1a'))(new Redis(config[_0x4bb5('0x19')]));require('./voiceQueueReport.socket')[_0x4bb5('0x1b')](socket);function respondWithStatusCode(_0x206670,_0x3cd558){_0x3cd558=_0x3cd558||0xcc;return function(_0x3d5500){if(_0x3d5500){return _0x206670[_0x4bb5('0x1c')](_0x3cd558);}return _0x206670[_0x4bb5('0x1d')](_0x3cd558)['end']();};}function respondWithResult(_0x277d8a,_0xe0e683){_0xe0e683=_0xe0e683||0xc8;return function(_0x9be978){if(_0x9be978){return _0x277d8a['status'](_0xe0e683)[_0x4bb5('0x1e')](_0x9be978);}};}function respondWithFilteredResult(_0x2d0caa,_0x52c5e8){return function(_0x32e888){if(_0x32e888){var _0x5e1846=typeof _0x52c5e8['offset']===_0x4bb5('0x1f')&&typeof _0x52c5e8[_0x4bb5('0x20')]===_0x4bb5('0x1f');var _0x33fb60=_0x32e888[_0x4bb5('0x21')];var _0x277b52=_0x5e1846?0x0:_0x52c5e8[_0x4bb5('0x22')];var _0x385071=_0x5e1846?_0x32e888[_0x4bb5('0x21')]:_0x52c5e8[_0x4bb5('0x22')]+_0x52c5e8[_0x4bb5('0x20')];var _0x77462b;if(_0x385071>=_0x33fb60){_0x385071=_0x33fb60;_0x77462b=0xc8;}else{_0x77462b=0xce;}_0x2d0caa['status'](_0x77462b);return _0x2d0caa[_0x4bb5('0x23')]('Content-Range',_0x277b52+'-'+_0x385071+'/'+_0x33fb60)['json'](_0x32e888);}return null;};}function patchUpdates(_0x469739){return function(_0x1615e4){try{jsonpatch[_0x4bb5('0x24')](_0x1615e4,_0x469739,!![]);}catch(_0x2ea123){return BPromise[_0x4bb5('0x25')](_0x2ea123);}return _0x1615e4[_0x4bb5('0x26')]();};}function saveUpdates(_0x1a172f,_0x187624){return function(_0x40fd06){if(_0x40fd06){return _0x40fd06[_0x4bb5('0x27')](_0x1a172f)['then'](function(_0x1f7543){return _0x1f7543;});}return null;};}function removeEntity(_0x545365,_0x426d87){return function(_0x5682c1){if(_0x5682c1){return _0x5682c1[_0x4bb5('0x28')]()[_0x4bb5('0x29')](function(){_0x545365[_0x4bb5('0x1d')](0xcc)[_0x4bb5('0x2a')]();});}};}function handleEntityNotFound(_0x221d5e,_0x5f4bac){return function(_0x2f40df){if(!_0x2f40df){_0x221d5e['sendStatus'](0x194);}return _0x2f40df;};}function handleError(_0x2e08fd,_0x3c2f78){_0x3c2f78=_0x3c2f78||0x1f4;return function(_0x5d4279){logger['error'](_0x5d4279[_0x4bb5('0x2b')]);if(_0x5d4279[_0x4bb5('0x2c')]){delete _0x5d4279[_0x4bb5('0x2c')];}_0x2e08fd['status'](_0x3c2f78)['send'](_0x5d4279);};}exports[_0x4bb5('0x2d')]=function(_0x3560f3,_0x2d441b){var _0x494c3b={},_0x38ca0e={},_0x48b093={'count':0x0,'rows':[]};var _0x2e2ffb=_[_0x4bb5('0x2e')](db[_0x4bb5('0x2f')][_0x4bb5('0x30')],function(_0x63e55e){return{'name':_0x63e55e[_0x4bb5('0x31')],'type':_0x63e55e[_0x4bb5('0x32')][_0x4bb5('0x33')]};});_0x38ca0e[_0x4bb5('0x34')]=_[_0x4bb5('0x2e')](_0x2e2ffb,_0x4bb5('0x2c'));_0x38ca0e['query']=_[_0x4bb5('0x35')](_0x3560f3[_0x4bb5('0x36')]);_0x38ca0e[_0x4bb5('0x37')]=_[_0x4bb5('0x38')](_0x38ca0e[_0x4bb5('0x34')],_0x38ca0e[_0x4bb5('0x36')]);_0x494c3b[_0x4bb5('0x39')]=_[_0x4bb5('0x38')](_0x38ca0e['model'],qs[_0x4bb5('0x3a')](_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x3a')]));_0x494c3b[_0x4bb5('0x39')]=_0x494c3b['attributes'][_0x4bb5('0x3b')]?_0x494c3b['attributes']:_0x38ca0e['model'];if(!_0x3560f3['query'][_0x4bb5('0x3c')]('nolimit')){_0x494c3b[_0x4bb5('0x20')]=qs['limit'](_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x20')]);_0x494c3b[_0x4bb5('0x22')]=qs[_0x4bb5('0x22')](_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x22')]);}_0x494c3b[_0x4bb5('0x3d')]=qs[_0x4bb5('0x3e')](_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x3e')]);_0x494c3b[_0x4bb5('0x3f')]=qs[_0x4bb5('0x37')](_[_0x4bb5('0x40')](_0x3560f3[_0x4bb5('0x36')],_0x38ca0e[_0x4bb5('0x37')]),_0x2e2ffb);if(_0x3560f3[_0x4bb5('0x36')]['filter']){_0x494c3b[_0x4bb5('0x3f')]=_[_0x4bb5('0x41')](_0x494c3b[_0x4bb5('0x3f')],{'$or':_[_0x4bb5('0x2e')](_0x2e2ffb,function(_0x15e7d1){if(_0x15e7d1[_0x4bb5('0x32')]!=='VIRTUAL'){var _0x3e0855={};_0x3e0855[_0x15e7d1[_0x4bb5('0x2c')]]={'$like':'%'+_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x42')]+'%'};return _0x3e0855;}})});}_0x494c3b=_[_0x4bb5('0x41')]({},_0x494c3b,_0x3560f3['options']);var _0x42c1ef={'where':_0x494c3b['where']};return db[_0x4bb5('0x2f')][_0x4bb5('0x21')](_0x42c1ef)[_0x4bb5('0x29')](function(_0x1b664d){_0x48b093[_0x4bb5('0x21')]=_0x1b664d;if(_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x43')]){_0x494c3b[_0x4bb5('0x44')]=[{'all':!![]}];}return db[_0x4bb5('0x2f')][_0x4bb5('0x45')](_0x494c3b);})['then'](function(_0x55f213){_0x48b093[_0x4bb5('0x46')]=_0x55f213;return _0x48b093;})[_0x4bb5('0x29')](respondWithFilteredResult(_0x2d441b,_0x494c3b))[_0x4bb5('0x47')](handleError(_0x2d441b,null));};exports[_0x4bb5('0x48')]=function(_0x5932b7,_0x2a84fa){var _0x572fc7={'raw':![],'where':{'id':_0x5932b7[_0x4bb5('0x49')]['id']}},_0x39c592={};_0x39c592[_0x4bb5('0x34')]=_[_0x4bb5('0x35')](db[_0x4bb5('0x2f')][_0x4bb5('0x30')]);_0x39c592[_0x4bb5('0x36')]=_[_0x4bb5('0x35')](_0x5932b7[_0x4bb5('0x36')]);_0x39c592[_0x4bb5('0x37')]=_[_0x4bb5('0x38')](_0x39c592[_0x4bb5('0x34')],_0x39c592[_0x4bb5('0x36')]);_0x572fc7[_0x4bb5('0x39')]=_[_0x4bb5('0x38')](_0x39c592[_0x4bb5('0x34')],qs[_0x4bb5('0x3a')](_0x5932b7['query'][_0x4bb5('0x3a')]));_0x572fc7[_0x4bb5('0x39')]=_0x572fc7[_0x4bb5('0x39')][_0x4bb5('0x3b')]?_0x572fc7[_0x4bb5('0x39')]:_0x39c592[_0x4bb5('0x34')];if(_0x5932b7[_0x4bb5('0x36')][_0x4bb5('0x43')]){_0x572fc7[_0x4bb5('0x44')]=[{'all':!![]}];}_0x572fc7=_[_0x4bb5('0x41')]({},_0x572fc7,_0x5932b7['options']);return db[_0x4bb5('0x2f')][_0x4bb5('0x4a')](_0x572fc7)[_0x4bb5('0x29')](handleEntityNotFound(_0x2a84fa,null))['then'](respondWithResult(_0x2a84fa,null))['catch'](handleError(_0x2a84fa,null));};exports[_0x4bb5('0x4b')]=function(_0x1eb3ee,_0x4cf340){return db['VoiceQueueReport'][_0x4bb5('0x4b')](_0x1eb3ee[_0x4bb5('0x4c')],{})[_0x4bb5('0x29')](respondWithResult(_0x4cf340,0xc9))[_0x4bb5('0x47')](handleError(_0x4cf340,null));};exports[_0x4bb5('0x27')]=function(_0x3dcf9c,_0xe190dd){if(_0x3dcf9c[_0x4bb5('0x4c')]['id']){delete _0x3dcf9c[_0x4bb5('0x4c')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x3dcf9c['params']['id']}})[_0x4bb5('0x29')](handleEntityNotFound(_0xe190dd,null))['then'](saveUpdates(_0x3dcf9c['body'],null))[_0x4bb5('0x29')](respondWithResult(_0xe190dd,null))[_0x4bb5('0x47')](handleError(_0xe190dd,null));};exports['destroy']=function(_0x215739,_0x53b191){return db[_0x4bb5('0x2f')]['find']({'where':{'id':_0x215739[_0x4bb5('0x49')]['id']}})['then'](handleEntityNotFound(_0x53b191,null))['then'](removeEntity(_0x53b191,null))['catch'](handleError(_0x53b191,null));};exports[_0x4bb5('0x4d')]=function(_0x5c3f7f,_0x59cdaf){return db[_0x4bb5('0x2f')]['describe']()[_0x4bb5('0x29')](respondWithResult(_0x59cdaf,null))[_0x4bb5('0x47')](handleError(_0x59cdaf,null));};exports[_0x4bb5('0x4e')]=function(_0x4afb7b,_0x4c8b0d){var _0x4abea4={},_0x3770e4={},_0x2ac4b9={'count':0x0,'rows':[]};_0x3770e4[_0x4bb5('0x34')]=_[_0x4bb5('0x35')](db['VoiceQueueReport'][_0x4bb5('0x30')]);_0x3770e4['query']=_[_0x4bb5('0x35')](_0x4afb7b[_0x4bb5('0x36')]);_0x3770e4[_0x4bb5('0x37')]=_['intersection'](_0x3770e4[_0x4bb5('0x34')],_0x3770e4['query']);_0x4abea4['attributes']=_['intersection'](_0x3770e4[_0x4bb5('0x34')],qs['fields'](_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x3a')]));_0x4abea4[_0x4bb5('0x39')]=_0x4abea4['attributes']['length']?_0x4abea4['attributes']:_0x3770e4[_0x4bb5('0x34')];if(!_0x4afb7b[_0x4bb5('0x36')]['hasOwnProperty'](_0x4bb5('0x4f'))){_0x4abea4[_0x4bb5('0x20')]=qs[_0x4bb5('0x20')](_0x4afb7b[_0x4bb5('0x36')]['limit']);_0x4abea4[_0x4bb5('0x22')]=qs[_0x4bb5('0x22')](_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x22')]);}_0x4abea4[_0x4bb5('0x3d')]=qs[_0x4bb5('0x3e')](_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x3e')]);_0x4abea4[_0x4bb5('0x3f')]=qs[_0x4bb5('0x37')](_['pick'](_0x4afb7b['query'],_0x3770e4['filters']));if(_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x42')]){_0x4abea4[_0x4bb5('0x3f')]=_['merge'](_0x4abea4[_0x4bb5('0x3f')],{'$or':_['map'](_0x4abea4[_0x4bb5('0x39')],function(_0x1c962f){var _0x10e62f={};_0x10e62f[_0x1c962f]={'$like':'%'+_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x42')]+'%'};return _0x10e62f;})});}_0x4abea4=_[_0x4bb5('0x41')]({},_0x4abea4,_0x4afb7b[_0x4bb5('0x50')]);var _0x4654b4={'where':_0x4abea4[_0x4bb5('0x3f')]};return db[_0x4bb5('0x2f')][_0x4bb5('0x21')](_0x4654b4)['then'](function(_0x5edeb0){_0x2ac4b9[_0x4bb5('0x21')]=_0x5edeb0;if(_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x43')]){_0x4abea4[_0x4bb5('0x44')]=[{'all':!![]}];}return db[_0x4bb5('0x2f')][_0x4bb5('0x45')](_0x4abea4);})[_0x4bb5('0x29')](function(_0x30b0f2){_0x2ac4b9[_0x4bb5('0x46')]=_0x30b0f2;return _0x2ac4b9;})[_0x4bb5('0x29')](respondWithFilteredResult(_0x4c8b0d,_0x4abea4,_0x4bb5('0x4e')))[_0x4bb5('0x47')](handleError(_0x4c8b0d,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 0221a9a..c1dfc7a 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 _0xf6b5=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x44fef1,_0x132cf4){var _0x3c3a04=function(_0x175a90){while(--_0x175a90){_0x44fef1['push'](_0x44fef1['shift']());}};_0x3c3a04(++_0x132cf4);}(_0xf6b5,0x102));var _0x5f6b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xf6b5[_0x5c351c];return _0x26f3b3;};'use strict';var EventEmitter=require(_0x5f6b('0x0'));var VoiceQueueReport=require(_0x5f6b('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5f6b('0x2')](0x0);var events={'afterCreate':_0x5f6b('0x3'),'afterUpdate':_0x5f6b('0x4'),'afterDestroy':_0x5f6b('0x5')};function emitEvent(_0x180aaf){return function(_0x1a6403,_0xfff139,_0x5ee4ed){VoiceQueueReportEvents['emit'](_0x180aaf+':'+_0x1a6403['id'],_0x1a6403);VoiceQueueReportEvents[_0x5f6b('0x6')](_0x180aaf,_0x1a6403);_0x5ee4ed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x5f6b('0x7')](e,emitEvent(event));}}module[_0x5f6b('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xf847=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','remove','hasOwnProperty'];(function(_0x39a255,_0x43c63b){var _0x427b92=function(_0x5d5805){while(--_0x5d5805){_0x39a255['push'](_0x39a255['shift']());}};_0x427b92(++_0x43c63b);}(_0xf847,0xea));var _0x7f84=function(_0x51da25,_0x426376){_0x51da25=_0x51da25-0x0;var _0x11ff0a=_0xf847[_0x51da25];return _0x11ff0a;};'use strict';var EventEmitter=require(_0x7f84('0x0'));var VoiceQueueReport=require(_0x7f84('0x1'))['db'][_0x7f84('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7f84('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7f84('0x4')};function emitEvent(_0x3d3f30){return function(_0x4e4eef,_0x521d5b,_0x628405){VoiceQueueReportEvents['emit'](_0x3d3f30+':'+_0x4e4eef['id'],_0x4e4eef);VoiceQueueReportEvents['emit'](_0x3d3f30,_0x4e4eef);_0x628405(null);};}for(var e in events){if(events[_0x7f84('0x5')](e)){var event=events[e];VoiceQueueReport[_0x7f84('0x6')](e,emitEvent(event));}}module[_0x7f84('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 92bdce0..dfcb394 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 _0x5238=['uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','path','rimraf','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue'];(function(_0x475d32,_0x45102b){var _0x3adbd3=function(_0x466fa8){while(--_0x466fa8){_0x475d32['push'](_0x475d32['shift']());}};_0x3adbd3(++_0x45102b);}(_0x5238,0x198));var _0x8523=function(_0x46e88e,_0x11c813){_0x46e88e=_0x46e88e-0x0;var _0x5f40fd=_0x5238[_0x46e88e];return _0x5f40fd;};'use strict';var _=require('lodash');var util=require(_0x8523('0x0'));var logger=require(_0x8523('0x1'))(_0x8523('0x2'));var moment=require(_0x8523('0x3'));var BPromise=require(_0x8523('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8523('0x5'));var rimraf=require(_0x8523('0x6'));var config=require('../../config/environment');var attributes=require(_0x8523('0x7'));module[_0x8523('0x8')]=function(_0x5ad6de,_0xa9ecb5){return _0x5ad6de[_0x8523('0x9')](_0x8523('0xa'),attributes,{'tableName':_0x8523('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8523('0xc')]},{'fields':[_0x8523('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc588=['exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3165e9,_0x11b018){var _0x1a727c=function(_0x1cb3e7){while(--_0x1cb3e7){_0x3165e9['push'](_0x3165e9['shift']());}};_0x1a727c(++_0x11b018);}(_0xc588,0x14f));var _0x8c58=function(_0x37bcf9,_0x4d1a77){_0x37bcf9=_0x37bcf9-0x0;var _0x5049d3=_0xc588[_0x37bcf9];return _0x5049d3;};'use strict';var _=require(_0x8c58('0x0'));var util=require(_0x8c58('0x1'));var logger=require(_0x8c58('0x2'))(_0x8c58('0x3'));var moment=require(_0x8c58('0x4'));var BPromise=require(_0x8c58('0x5'));var rp=require(_0x8c58('0x6'));var fs=require('fs');var path=require(_0x8c58('0x7'));var rimraf=require(_0x8c58('0x8'));var config=require(_0x8c58('0x9'));var attributes=require('./voiceQueueReport.attributes');module[_0x8c58('0xa')]=function(_0x58bf09,_0xf809bb){return _0x58bf09['define'](_0x8c58('0xb'),attributes,{'tableName':_0x8c58('0xc'),'paranoid':![],'indexes':[{'fields':[_0x8c58('0xd')]},{'fields':[_0x8c58('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index e418478..7673bcf 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 _0xeb0c=['GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','limit','include','map','model','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0x2f227c,_0x360c3a){var _0x5032bc=function(_0x824bb){while(--_0x824bb){_0x2f227c['push'](_0x2f227c['shift']());}};_0x5032bc(++_0x360c3a);}(_0xeb0c,0x133));var _0xceb0=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0xeb0c[_0x22f85a];return _0xaa717;};'use strict';var _=require(_0xceb0('0x0'));var util=require(_0xceb0('0x1'));var moment=require(_0xceb0('0x2'));var BPromise=require(_0xceb0('0x3'));var rs=require(_0xceb0('0x4'));var fs=require('fs');var Redis=require(_0xceb0('0x5'));var db=require(_0xceb0('0x6'))['db'];var utils=require(_0xceb0('0x7'));var logger=require(_0xceb0('0x8'))(_0xceb0('0x9'));var config=require(_0xceb0('0xa'));var jayson=require(_0xceb0('0xb'));var client=jayson[_0xceb0('0xc')][_0xceb0('0xd')]({'port':0x232a});config[_0xceb0('0xe')]=_[_0xceb0('0xf')](config[_0xceb0('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xceb0('0x10'))(new Redis(config[_0xceb0('0xe')]));require('./voiceQueueReport.socket')[_0xceb0('0x11')](socket);function respondWithRpcPromise(_0x38f7ae,_0x19036d,_0x2d7de4){return new BPromise(function(_0x3c1821,_0x27f7cc){return client[_0xceb0('0x12')](_0x38f7ae,_0x2d7de4)[_0xceb0('0x13')](function(_0x2a4b18){logger[_0xceb0('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x19036d,_0xceb0('0x15'));logger[_0xceb0('0x16')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x19036d,_0xceb0('0x15'),JSON[_0xceb0('0x17')](_0x2a4b18));if(_0x2a4b18[_0xceb0('0x18')]){if(_0x2a4b18[_0xceb0('0x18')]['code']===0x1f4){logger[_0xceb0('0x18')](_0xceb0('0x19'),_0x19036d,_0x2a4b18['error'][_0xceb0('0x1a')]);return _0x27f7cc(_0x2a4b18[_0xceb0('0x18')][_0xceb0('0x1a')]);}logger[_0xceb0('0x18')](_0xceb0('0x19'),_0x19036d,_0x2a4b18['error'][_0xceb0('0x1a')]);return _0x3c1821(_0x2a4b18[_0xceb0('0x18')]['message']);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x19036d,_0xceb0('0x15'));_0x3c1821(_0x2a4b18[_0xceb0('0x1b')][_0xceb0('0x1a')]);}})[_0xceb0('0x1c')](function(_0x4e2d83){logger[_0xceb0('0x18')](_0xceb0('0x19'),_0x19036d,_0x4e2d83);_0x27f7cc(_0x4e2d83);});});}exports[_0xceb0('0x1d')]=function(_0x523693){var _0x1860f8=this;return new Promise(function(_0x2b763f,_0x2d9b7a){return db[_0xceb0('0x1e')][_0xceb0('0x1f')]({'raw':_0x523693[_0xceb0('0x20')]?_0x523693['options']['raw']===undefined?!![]:![]:!![],'where':_0x523693['options']?_0x523693[_0xceb0('0x20')]['where']||null:null,'attributes':_0x523693[_0xceb0('0x20')]?_0x523693[_0xceb0('0x20')][_0xceb0('0x21')]||null:null,'limit':_0x523693[_0xceb0('0x20')]?_0x523693[_0xceb0('0x20')][_0xceb0('0x22')]||null:null,'include':_0x523693[_0xceb0('0x20')]?_0x523693[_0xceb0('0x20')][_0xceb0('0x23')]?_[_0xceb0('0x24')](_0x523693[_0xceb0('0x20')][_0xceb0('0x23')],function(_0x54caa5){return{'model':db[_0x54caa5['model']],'as':_0x54caa5['as'],'attributes':_0x54caa5['attributes'],'include':_0x54caa5[_0xceb0('0x23')]?_[_0xceb0('0x24')](_0x54caa5['include'],function(_0x53f803){return{'model':db[_0x53f803[_0xceb0('0x25')]],'as':_0x53f803['as'],'attributes':_0x53f803['attributes'],'include':_0x53f803['include']?_['map'](_0x53f803[_0xceb0('0x23')],function(_0x5475d0){return{'model':db[_0x5475d0[_0xceb0('0x25')]],'as':_0x5475d0['as'],'attributes':_0x5475d0['attributes']};}):[]};}):[]};}):[]:[]})[_0xceb0('0x13')](function(_0x4d62aa){logger[_0xceb0('0x14')]('GetVoiceQueueReport',_0x523693);logger[_0xceb0('0x16')](_0xceb0('0x1d'),_0x523693,JSON['stringify'](_0x4d62aa));_0x2b763f(_0x4d62aa);})[_0xceb0('0x1c')](function(_0x545b3f){logger[_0xceb0('0x18')](_0xceb0('0x1d'),_0x545b3f['message'],_0x523693);_0x2d9b7a(_0x1860f8['error'](0x1f4,_0x545b3f[_0xceb0('0x1a')]));});});};exports[_0xceb0('0x26')]=function(_0x311538){var _0x4fbdf4=this;return new Promise(function(_0x368c2d,_0x2c86c0){return db[_0xceb0('0x1e')][_0xceb0('0x27')](_0x311538['body'],{'raw':_0x311538[_0xceb0('0x20')]?_0x311538[_0xceb0('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xbe2158){logger['info'](_0xceb0('0x26'),_0x311538);logger['debug']('CreateVoiceQueueReport',_0x311538,JSON[_0xceb0('0x17')](_0xbe2158));_0x368c2d(_0xbe2158);})[_0xceb0('0x1c')](function(_0xe9480f){logger[_0xceb0('0x18')]('CreateVoiceQueueReport',_0xe9480f['message'],_0x311538);_0x2c86c0(_0x4fbdf4[_0xceb0('0x18')](0x1f4,_0xe9480f[_0xceb0('0x1a')]));});});};exports[_0xceb0('0x28')]=function(_0x5d80fd){var _0x266025=this;return new Promise(function(_0x36ccb6,_0x5692cd){return db[_0xceb0('0x1e')]['update'](_0x5d80fd['body'],{'raw':_0x5d80fd[_0xceb0('0x20')]?_0x5d80fd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d80fd[_0xceb0('0x20')]?_0x5d80fd[_0xceb0('0x20')][_0xceb0('0x29')]||null:null,'attributes':_0x5d80fd[_0xceb0('0x20')]?_0x5d80fd['options']['attributes']||null:null,'limit':_0x5d80fd['options']?_0x5d80fd[_0xceb0('0x20')][_0xceb0('0x22')]||null:null})['then'](function(_0x39b6aa){logger[_0xceb0('0x14')](_0xceb0('0x28'),_0x5d80fd);logger[_0xceb0('0x16')]('UpdateVoiceQueueReport',_0x5d80fd,JSON[_0xceb0('0x17')](_0x39b6aa));_0x36ccb6(_0x39b6aa);})[_0xceb0('0x1c')](function(_0x352572){logger[_0xceb0('0x18')](_0xceb0('0x28'),_0x352572[_0xceb0('0x1a')],_0x5d80fd);_0x5692cd(_0x266025[_0xceb0('0x18')](0x1f4,_0x352572['message']));});});}; \ No newline at end of file +var _0xec6d=['message','request\x20sent','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','VoiceQueueReport','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x48be34,_0xd7aeea){var _0x1621d6=function(_0x1924ca){while(--_0x1924ca){_0x48be34['push'](_0x48be34['shift']());}};_0x1621d6(++_0xd7aeea);}(_0xec6d,0x163));var _0xdec6=function(_0x21078d,_0x32216e){_0x21078d=_0x21078d-0x0;var _0x4a3608=_0xec6d[_0x21078d];return _0x4a3608;};'use strict';var _=require(_0xdec6('0x0'));var util=require(_0xdec6('0x1'));var moment=require(_0xdec6('0x2'));var BPromise=require(_0xdec6('0x3'));var rs=require(_0xdec6('0x4'));var fs=require('fs');var Redis=require(_0xdec6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdec6('0x6'));var logger=require('../../config/logger')(_0xdec6('0x7'));var config=require(_0xdec6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdec6('0x9')][_0xdec6('0xa')]({'port':0x232a});config[_0xdec6('0xb')]=_[_0xdec6('0xc')](config[_0xdec6('0xb')],{'host':_0xdec6('0xd'),'port':0x18eb});var socket=require(_0xdec6('0xe'))(new Redis(config[_0xdec6('0xb')]));require(_0xdec6('0xf'))['register'](socket);function respondWithRpcPromise(_0xe6136d,_0x5460a3,_0x4b8409){return new BPromise(function(_0x3c86d2,_0x3cddea){return client['request'](_0xe6136d,_0x4b8409)[_0xdec6('0x10')](function(_0x1d336f){logger[_0xdec6('0x11')](_0xdec6('0x12'),_0x5460a3,'request\x20sent');logger[_0xdec6('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x5460a3,'request\x20sent',JSON[_0xdec6('0x14')](_0x1d336f));if(_0x1d336f['error']){if(_0x1d336f[_0xdec6('0x15')][_0xdec6('0x16')]===0x1f4){logger[_0xdec6('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x5460a3,_0x1d336f[_0xdec6('0x15')]['message']);return _0x3cddea(_0x1d336f[_0xdec6('0x15')][_0xdec6('0x17')]);}logger[_0xdec6('0x15')](_0xdec6('0x12'),_0x5460a3,_0x1d336f[_0xdec6('0x15')][_0xdec6('0x17')]);return _0x3c86d2(_0x1d336f[_0xdec6('0x15')]['message']);}else{logger[_0xdec6('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x5460a3,_0xdec6('0x18'));_0x3c86d2(_0x1d336f[_0xdec6('0x19')][_0xdec6('0x17')]);}})[_0xdec6('0x1a')](function(_0x36cce9){logger['error'](_0xdec6('0x12'),_0x5460a3,_0x36cce9);_0x3cddea(_0x36cce9);});});}exports[_0xdec6('0x1b')]=function(_0x2b247b){var _0x3c001f=this;return new Promise(function(_0x398079,_0x44b552){return db['VoiceQueueReport'][_0xdec6('0x1c')]({'raw':_0x2b247b[_0xdec6('0x1d')]?_0x2b247b[_0xdec6('0x1d')][_0xdec6('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b247b[_0xdec6('0x1d')]?_0x2b247b[_0xdec6('0x1d')][_0xdec6('0x1f')]||null:null,'attributes':_0x2b247b[_0xdec6('0x1d')]?_0x2b247b[_0xdec6('0x1d')][_0xdec6('0x20')]||null:null,'limit':_0x2b247b[_0xdec6('0x1d')]?_0x2b247b[_0xdec6('0x1d')][_0xdec6('0x21')]||null:null,'include':_0x2b247b['options']?_0x2b247b[_0xdec6('0x1d')][_0xdec6('0x22')]?_[_0xdec6('0x23')](_0x2b247b['options'][_0xdec6('0x22')],function(_0xaa6bf1){return{'model':db[_0xaa6bf1[_0xdec6('0x24')]],'as':_0xaa6bf1['as'],'attributes':_0xaa6bf1[_0xdec6('0x20')],'include':_0xaa6bf1[_0xdec6('0x22')]?_[_0xdec6('0x23')](_0xaa6bf1['include'],function(_0x87474){return{'model':db[_0x87474[_0xdec6('0x24')]],'as':_0x87474['as'],'attributes':_0x87474[_0xdec6('0x20')],'include':_0x87474['include']?_[_0xdec6('0x23')](_0x87474[_0xdec6('0x22')],function(_0x173030){return{'model':db[_0x173030['model']],'as':_0x173030['as'],'attributes':_0x173030['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e1b7c){logger[_0xdec6('0x11')](_0xdec6('0x1b'),_0x2b247b);logger[_0xdec6('0x13')](_0xdec6('0x1b'),_0x2b247b,JSON[_0xdec6('0x14')](_0x2e1b7c));_0x398079(_0x2e1b7c);})['catch'](function(_0x339024){logger['error'](_0xdec6('0x1b'),_0x339024[_0xdec6('0x17')],_0x2b247b);_0x44b552(_0x3c001f[_0xdec6('0x15')](0x1f4,_0x339024[_0xdec6('0x17')]));});});};exports[_0xdec6('0x25')]=function(_0x53d4d3){var _0x478b07=this;return new Promise(function(_0x2a08b0,_0x342d66){return db[_0xdec6('0x26')]['create'](_0x53d4d3[_0xdec6('0x27')],{'raw':_0x53d4d3[_0xdec6('0x1d')]?_0x53d4d3[_0xdec6('0x1d')][_0xdec6('0x1e')]===undefined?!![]:![]:!![]})[_0xdec6('0x10')](function(_0xb45ce5){logger[_0xdec6('0x11')]('CreateVoiceQueueReport',_0x53d4d3);logger[_0xdec6('0x13')]('CreateVoiceQueueReport',_0x53d4d3,JSON[_0xdec6('0x14')](_0xb45ce5));_0x2a08b0(_0xb45ce5);})['catch'](function(_0x1a9111){logger[_0xdec6('0x15')]('CreateVoiceQueueReport',_0x1a9111[_0xdec6('0x17')],_0x53d4d3);_0x342d66(_0x478b07[_0xdec6('0x15')](0x1f4,_0x1a9111[_0xdec6('0x17')]));});});};exports[_0xdec6('0x28')]=function(_0x3f2459){var _0x3f85ab=this;return new Promise(function(_0xacc5aa,_0x10adc6){return db['VoiceQueueReport'][_0xdec6('0x29')](_0x3f2459[_0xdec6('0x27')],{'raw':_0x3f2459[_0xdec6('0x1d')]?_0x3f2459['options'][_0xdec6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2459[_0xdec6('0x1d')]?_0x3f2459[_0xdec6('0x1d')]['where']||null:null,'attributes':_0x3f2459[_0xdec6('0x1d')]?_0x3f2459[_0xdec6('0x1d')][_0xdec6('0x20')]||null:null,'limit':_0x3f2459['options']?_0x3f2459[_0xdec6('0x1d')][_0xdec6('0x21')]||null:null})[_0xdec6('0x10')](function(_0x206e41){logger[_0xdec6('0x11')]('UpdateVoiceQueueReport',_0x3f2459);logger[_0xdec6('0x13')](_0xdec6('0x28'),_0x3f2459,JSON[_0xdec6('0x14')](_0x206e41));_0xacc5aa(_0x206e41);})[_0xdec6('0x1a')](function(_0x2d755a){logger['error'](_0xdec6('0x28'),_0x2d755a[_0xdec6('0x17')],_0x3f2459);_0x10adc6(_0x3f85ab['error'](0x1f4,_0x2d755a[_0xdec6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 246be5a..5f5b455 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 _0x2159=['save','remove','update','emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x3e8453,_0xfe4800){var _0x52c7e6=function(_0x7ab67c){while(--_0x7ab67c){_0x3e8453['push'](_0x3e8453['shift']());}};_0x52c7e6(++_0xfe4800);}(_0x2159,0x17f));var _0x9215=function(_0x485f35,_0x45a0fc){_0x485f35=_0x485f35-0x0;var _0x2ad118=_0x2159[_0x485f35];return _0x2ad118;};'use strict';var VoiceQueueReportEvents=require(_0x9215('0x0'));var events=[_0x9215('0x1'),_0x9215('0x2'),_0x9215('0x3')];function createListener(_0x4b113a,_0x1474c7){return function(_0x4ca557){_0x1474c7[_0x9215('0x4')](_0x4b113a,_0x4ca557);};}function removeListener(_0x3128f9,_0x202c8d){return function(){VoiceQueueReportEvents[_0x9215('0x5')](_0x3128f9,_0x202c8d);};}exports[_0x9215('0x6')]=function(_0x1fd854){for(var _0x3be70d=0x0,_0x383bb1=events['length'];_0x3be70d<_0x383bb1;_0x3be70d++){var _0x419fb3=events[_0x3be70d];var _0x245ee1=createListener(_0x9215('0x7')+_0x419fb3,_0x1fd854);VoiceQueueReportEvents['on'](_0x419fb3,_0x245ee1);}}; \ No newline at end of file +var _0xafdd=['emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x477d85,_0x3dd232){var _0x3d0334=function(_0x41c3e0){while(--_0x41c3e0){_0x477d85['push'](_0x477d85['shift']());}};_0x3d0334(++_0x3dd232);}(_0xafdd,0x19a));var _0xdafd=function(_0x4f3b1d,_0x40680e){_0x4f3b1d=_0x4f3b1d-0x0;var _0xcd63a5=_0xafdd[_0x4f3b1d];return _0xcd63a5;};'use strict';var VoiceQueueReportEvents=require(_0xdafd('0x0'));var events=[_0xdafd('0x1'),_0xdafd('0x2'),_0xdafd('0x3')];function createListener(_0xf13a21,_0x3ceef2){return function(_0x268b14){_0x3ceef2[_0xdafd('0x4')](_0xf13a21,_0x268b14);};}function removeListener(_0x5624f6,_0x283ab1){return function(){VoiceQueueReportEvents[_0xdafd('0x5')](_0x5624f6,_0x283ab1);};}exports[_0xdafd('0x6')]=function(_0x37f05a){for(var _0xfa4ad6=0x0,_0x57cfee=events[_0xdafd('0x7')];_0xfa4ad6<_0x57cfee;_0xfa4ad6++){var _0x53e09c=events[_0xfa4ad6];var _0x9b9c6b=createListener(_0xdafd('0x8')+_0x53e09c,_0x37f05a);VoiceQueueReportEvents['on'](_0x53e09c,_0x9b9c6b);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index f562957..21367b1 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 _0x9be9=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x215d9f,_0x43476e){var _0x293ece=function(_0x1e2764){while(--_0x1e2764){_0x215d9f['push'](_0x215d9f['shift']());}};_0x293ece(++_0x43476e);}(_0x9be9,0x98));var _0x99be=function(_0xedff86,_0x3faa57){_0xedff86=_0xedff86-0x0;var _0x1b1efc=_0x9be9[_0xedff86];return _0x1b1efc;};'use strict';var multer=require(_0x99be('0x0'));var util=require(_0x99be('0x1'));var path=require(_0x99be('0x2'));var timeout=require(_0x99be('0x3'));var express=require(_0x99be('0x4'));var router=express[_0x99be('0x5')]();var fs_extra=require(_0x99be('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x99be('0x7'));var config=require('../../config/environment');var controller=require(_0x99be('0x8'));router['get']('/',auth[_0x99be('0x9')](),controller[_0x99be('0xa')]);router[_0x99be('0xb')](_0x99be('0xc'),auth[_0x99be('0x9')](),controller[_0x99be('0xd')]);router[_0x99be('0xe')]('/',auth[_0x99be('0x9')](),controller[_0x99be('0xf')]);router[_0x99be('0x10')](_0x99be('0xc'),auth[_0x99be('0x9')](),controller[_0x99be('0x11')]);router[_0x99be('0x12')](_0x99be('0xc'),auth[_0x99be('0x9')](),controller[_0x99be('0x13')]);module[_0x99be('0x14')]=router; \ No newline at end of file +var _0xc6e6=['post','isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./voiceQueuesLog.controller','get','index'];(function(_0x5c3e7c,_0x39ca9e){var _0x40cdf0=function(_0x251ddc){while(--_0x251ddc){_0x5c3e7c['push'](_0x5c3e7c['shift']());}};_0x40cdf0(++_0x39ca9e);}(_0xc6e6,0xc2));var _0x6c6e=function(_0x10490e,_0x4df0d9){_0x10490e=_0x10490e-0x0;var _0x35023c=_0xc6e6[_0x10490e];return _0x35023c;};'use strict';var multer=require(_0x6c6e('0x0'));var util=require(_0x6c6e('0x1'));var path=require(_0x6c6e('0x2'));var timeout=require(_0x6c6e('0x3'));var express=require('express');var router=express[_0x6c6e('0x4')]();var fs_extra=require(_0x6c6e('0x5'));var auth=require(_0x6c6e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6c6e('0x7'));router[_0x6c6e('0x8')]('/',auth['isAuthenticated'](),controller[_0x6c6e('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6c6e('0xa')]('/',auth[_0x6c6e('0xb')](),controller[_0x6c6e('0xc')]);router[_0x6c6e('0xd')](_0x6c6e('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6c6e('0xf')]);module[_0x6c6e('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index d22a1ad..c07371c 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 _0x4b31=['DATE','format','sequelize','moment','exports','STRING'];(function(_0x4300d4,_0x46689c){var _0x1c06ae=function(_0xcdbf7){while(--_0xcdbf7){_0x4300d4['push'](_0x4300d4['shift']());}};_0x1c06ae(++_0x46689c);}(_0x4b31,0x1c4));var _0x14b3=function(_0x12c34e,_0x39287a){_0x12c34e=_0x12c34e-0x0;var _0x244e88=_0x4b31[_0x12c34e];return _0x244e88;};'use strict';var Sequelize=require(_0x14b3('0x0'));var moment=require(_0x14b3('0x1'));module[_0x14b3('0x2')]={'time':{'type':Sequelize[_0x14b3('0x3')]},'callid':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x14b3('0x4')],'allowNull':![],'defaultValue':moment()[_0x14b3('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x45ba=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x4dbe01,_0x503406){var _0x22d795=function(_0xf0d9f7){while(--_0xf0d9f7){_0x4dbe01['push'](_0x4dbe01['shift']());}};_0x22d795(++_0x503406);}(_0x45ba,0x1d7));var _0xa45b=function(_0x2adcaa,_0x261668){_0x2adcaa=_0x2adcaa-0x0;var _0x11101f=_0x45ba[_0x2adcaa];return _0x11101f;};'use strict';var Sequelize=require(_0xa45b('0x0'));var moment=require(_0xa45b('0x1'));module[_0xa45b('0x2')]={'time':{'type':Sequelize[_0xa45b('0x3')]},'callid':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xa45b('0x4')](_0xa45b('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 203fefb..a2b65aa 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 _0xfbda=['type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','keys','rawAttributes','find','catch','create','body','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/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','send','map','VoiceQueuesLog','fieldName'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfbda,0xae));var _0xafbd=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xfbda[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xafbd('0x0'));var zipdir=require(_0xafbd('0x1'));var jsonpatch=require(_0xafbd('0x2'));var rp=require(_0xafbd('0x3'));var moment=require(_0xafbd('0x4'));var BPromise=require(_0xafbd('0x5'));var Mustache=require(_0xafbd('0x6'));var util=require(_0xafbd('0x7'));var path=require(_0xafbd('0x8'));var sox=require('sox');var csv=require(_0xafbd('0x9'));var ejs=require(_0xafbd('0xa'));var fs=require('fs');var fs_extra=require(_0xafbd('0xb'));var _=require(_0xafbd('0xc'));var squel=require(_0xafbd('0xd'));var crypto=require(_0xafbd('0xe'));var jsforce=require(_0xafbd('0xf'));var deskjs=require(_0xafbd('0x10'));var toCsv=require(_0xafbd('0x9'));var querystring=require(_0xafbd('0x11'));var Papa=require(_0xafbd('0x12'));var Redis=require(_0xafbd('0x13'));var authService=require(_0xafbd('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xafbd('0x15'));var hardwareService=require(_0xafbd('0x16'));var logger=require(_0xafbd('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xafbd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xafbd('0x19'))['db'];function respondWithStatusCode(_0x354744,_0x18e76d){_0x18e76d=_0x18e76d||0xcc;return function(_0x47610b){if(_0x47610b){return _0x354744[_0xafbd('0x1a')](_0x18e76d);}return _0x354744['status'](_0x18e76d)[_0xafbd('0x1b')]();};}function respondWithResult(_0x531035,_0x2b128e){_0x2b128e=_0x2b128e||0xc8;return function(_0x54c853){if(_0x54c853){return _0x531035[_0xafbd('0x1c')](_0x2b128e)[_0xafbd('0x1d')](_0x54c853);}};}function respondWithFilteredResult(_0x12ea09,_0x228beb){return function(_0x451a35){if(_0x451a35){var _0x4da989=typeof _0x228beb[_0xafbd('0x1e')]==='undefined'&&typeof _0x228beb[_0xafbd('0x1f')]==='undefined';var _0x3a9055=_0x451a35[_0xafbd('0x20')];var _0x216692=_0x4da989?0x0:_0x228beb['offset'];var _0x1c1e62=_0x4da989?_0x451a35['count']:_0x228beb[_0xafbd('0x1e')]+_0x228beb[_0xafbd('0x1f')];var _0x58cd83;if(_0x1c1e62>=_0x3a9055){_0x1c1e62=_0x3a9055;_0x58cd83=0xc8;}else{_0x58cd83=0xce;}_0x12ea09[_0xafbd('0x1c')](_0x58cd83);return _0x12ea09[_0xafbd('0x21')](_0xafbd('0x22'),_0x216692+'-'+_0x1c1e62+'/'+_0x3a9055)['json'](_0x451a35);}return null;};}function patchUpdates(_0x157e2a){return function(_0x2afa27){try{jsonpatch[_0xafbd('0x23')](_0x2afa27,_0x157e2a,!![]);}catch(_0x1671ab){return BPromise['reject'](_0x1671ab);}return _0x2afa27['save']();};}function saveUpdates(_0xccec52,_0x1babe1){return function(_0x4600c5){if(_0x4600c5){return _0x4600c5[_0xafbd('0x24')](_0xccec52)[_0xafbd('0x25')](function(_0xdffe91){return _0xdffe91;});}return null;};}function removeEntity(_0x1430cc,_0x878407){return function(_0xb48b4){if(_0xb48b4){return _0xb48b4[_0xafbd('0x26')]()[_0xafbd('0x25')](function(){_0x1430cc[_0xafbd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x259d64,_0xfa8e){return function(_0x27bd59){if(!_0x27bd59){_0x259d64[_0xafbd('0x1a')](0x194);}return _0x27bd59;};}function handleError(_0x2a9845,_0x4c6bcd){_0x4c6bcd=_0x4c6bcd||0x1f4;return function(_0x526d0c){logger['error'](_0x526d0c[_0xafbd('0x27')]);if(_0x526d0c[_0xafbd('0x28')]){delete _0x526d0c[_0xafbd('0x28')];}_0x2a9845[_0xafbd('0x1c')](_0x4c6bcd)[_0xafbd('0x29')](_0x526d0c);};}exports['index']=function(_0x41d238,_0x3a353e){var _0x245172={},_0x3fd42e={},_0x2bd560={'count':0x0,'rows':[]};var _0x57dce7=_[_0xafbd('0x2a')](db[_0xafbd('0x2b')]['rawAttributes'],function(_0x3caaad){return{'name':_0x3caaad[_0xafbd('0x2c')],'type':_0x3caaad[_0xafbd('0x2d')][_0xafbd('0x2e')]};});_0x3fd42e[_0xafbd('0x2f')]=_['map'](_0x57dce7,_0xafbd('0x28'));_0x3fd42e[_0xafbd('0x30')]=_['keys'](_0x41d238['query']);_0x3fd42e['filters']=_[_0xafbd('0x31')](_0x3fd42e[_0xafbd('0x2f')],_0x3fd42e[_0xafbd('0x30')]);_0x245172[_0xafbd('0x32')]=_[_0xafbd('0x31')](_0x3fd42e[_0xafbd('0x2f')],qs[_0xafbd('0x33')](_0x41d238[_0xafbd('0x30')][_0xafbd('0x33')]));_0x245172[_0xafbd('0x32')]=_0x245172[_0xafbd('0x32')][_0xafbd('0x34')]?_0x245172[_0xafbd('0x32')]:_0x3fd42e[_0xafbd('0x2f')];if(!_0x41d238[_0xafbd('0x30')][_0xafbd('0x35')](_0xafbd('0x36'))){_0x245172[_0xafbd('0x1f')]=qs[_0xafbd('0x1f')](_0x41d238[_0xafbd('0x30')]['limit']);_0x245172[_0xafbd('0x1e')]=qs['offset'](_0x41d238[_0xafbd('0x30')][_0xafbd('0x1e')]);}_0x245172[_0xafbd('0x37')]=qs['sort'](_0x41d238[_0xafbd('0x30')][_0xafbd('0x38')]);_0x245172['where']=qs[_0xafbd('0x39')](_['pick'](_0x41d238[_0xafbd('0x30')],_0x3fd42e['filters']),_0x57dce7);if(_0x41d238[_0xafbd('0x30')][_0xafbd('0x3a')]){_0x245172[_0xafbd('0x3b')]=_[_0xafbd('0x3c')](_0x245172[_0xafbd('0x3b')],{'$or':_['map'](_0x57dce7,function(_0x221b00){if(_0x221b00[_0xafbd('0x2d')]!==_0xafbd('0x3d')){var _0x11c9ce={};_0x11c9ce[_0x221b00['name']]={'$like':'%'+_0x41d238['query'][_0xafbd('0x3a')]+'%'};return _0x11c9ce;}})});}_0x245172=_[_0xafbd('0x3c')]({},_0x245172,_0x41d238[_0xafbd('0x3e')]);var _0x5ca798={'where':_0x245172[_0xafbd('0x3b')]};return db[_0xafbd('0x2b')][_0xafbd('0x20')](_0x5ca798)[_0xafbd('0x25')](function(_0x3990b3){_0x2bd560[_0xafbd('0x20')]=_0x3990b3;if(_0x41d238[_0xafbd('0x30')][_0xafbd('0x3f')]){_0x245172[_0xafbd('0x40')]=[{'all':!![]}];}return db[_0xafbd('0x2b')]['findAll'](_0x245172);})['then'](function(_0x4f6c49){_0x2bd560['rows']=_0x4f6c49;return _0x2bd560;})[_0xafbd('0x25')](respondWithFilteredResult(_0x3a353e,_0x245172))['catch'](handleError(_0x3a353e,null));};exports[_0xafbd('0x41')]=function(_0x3a5f0c,_0x419002){var _0x35900a={'raw':!![],'where':{'id':_0x3a5f0c[_0xafbd('0x42')]['id']}},_0x2e2273={};_0x2e2273[_0xafbd('0x2f')]=_[_0xafbd('0x43')](db[_0xafbd('0x2b')][_0xafbd('0x44')]);_0x2e2273['query']=_[_0xafbd('0x43')](_0x3a5f0c[_0xafbd('0x30')]);_0x2e2273[_0xafbd('0x39')]=_[_0xafbd('0x31')](_0x2e2273[_0xafbd('0x2f')],_0x2e2273[_0xafbd('0x30')]);_0x35900a[_0xafbd('0x32')]=_['intersection'](_0x2e2273[_0xafbd('0x2f')],qs[_0xafbd('0x33')](_0x3a5f0c[_0xafbd('0x30')]['fields']));_0x35900a[_0xafbd('0x32')]=_0x35900a['attributes'][_0xafbd('0x34')]?_0x35900a[_0xafbd('0x32')]:_0x2e2273[_0xafbd('0x2f')];if(_0x3a5f0c[_0xafbd('0x30')][_0xafbd('0x3f')]){_0x35900a[_0xafbd('0x40')]=[{'all':!![]}];}_0x35900a=_[_0xafbd('0x3c')]({},_0x35900a,_0x3a5f0c[_0xafbd('0x3e')]);return db[_0xafbd('0x2b')][_0xafbd('0x45')](_0x35900a)[_0xafbd('0x25')](handleEntityNotFound(_0x419002,null))[_0xafbd('0x25')](respondWithResult(_0x419002,null))[_0xafbd('0x46')](handleError(_0x419002,null));};exports[_0xafbd('0x47')]=function(_0x1054b9,_0x269fc5){return db[_0xafbd('0x2b')][_0xafbd('0x47')](_0x1054b9[_0xafbd('0x48')],{})[_0xafbd('0x25')](respondWithResult(_0x269fc5,0xc9))[_0xafbd('0x46')](handleError(_0x269fc5,null));};exports[_0xafbd('0x24')]=function(_0x4d81ff,_0x1d685e){if(_0x4d81ff[_0xafbd('0x48')]['id']){delete _0x4d81ff[_0xafbd('0x48')]['id'];}return db[_0xafbd('0x2b')][_0xafbd('0x45')]({'where':{'id':_0x4d81ff['params']['id']}})['then'](handleEntityNotFound(_0x1d685e,null))[_0xafbd('0x25')](saveUpdates(_0x4d81ff['body'],null))[_0xafbd('0x25')](respondWithResult(_0x1d685e,null))['catch'](handleError(_0x1d685e,null));};exports[_0xafbd('0x26')]=function(_0x4ecf36,_0x9f5b02){return db[_0xafbd('0x2b')]['find']({'where':{'id':_0x4ecf36[_0xafbd('0x42')]['id']}})[_0xafbd('0x25')](handleEntityNotFound(_0x9f5b02,null))[_0xafbd('0x25')](removeEntity(_0x9f5b02,null))[_0xafbd('0x46')](handleError(_0x9f5b02,null));}; \ No newline at end of file +var _0x6e8e=['send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','fields','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','then','destroy','end','stack','name'];(function(_0x41ca3e,_0x404068){var _0x25f8da=function(_0x50ac51){while(--_0x50ac51){_0x41ca3e['push'](_0x41ca3e['shift']());}};_0x25f8da(++_0x404068);}(_0x6e8e,0xe8));var _0xe6e8=function(_0x533494,_0x436dc5){_0x533494=_0x533494-0x0;var _0x59872a=_0x6e8e[_0x533494];return _0x59872a;};'use strict';var emlformat=require(_0xe6e8('0x0'));var rimraf=require(_0xe6e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6e8('0x2'));var rp=require(_0xe6e8('0x3'));var moment=require(_0xe6e8('0x4'));var BPromise=require(_0xe6e8('0x5'));var Mustache=require(_0xe6e8('0x6'));var util=require(_0xe6e8('0x7'));var path=require(_0xe6e8('0x8'));var sox=require('sox');var csv=require(_0xe6e8('0x9'));var ejs=require(_0xe6e8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6e8('0xb'));var squel=require('squel');var crypto=require(_0xe6e8('0xc'));var jsforce=require(_0xe6e8('0xd'));var deskjs=require(_0xe6e8('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe6e8('0xf'));var Redis=require(_0xe6e8('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6e8('0x11'));var logger=require(_0xe6e8('0x12'))('api');var utils=require(_0xe6e8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe6e8('0x14'));var db=require(_0xe6e8('0x15'))['db'];function respondWithStatusCode(_0x51a6b6,_0x17760b){_0x17760b=_0x17760b||0xcc;return function(_0x4ec910){if(_0x4ec910){return _0x51a6b6[_0xe6e8('0x16')](_0x17760b);}return _0x51a6b6['status'](_0x17760b)['end']();};}function respondWithResult(_0x107cd7,_0x2c54fe){_0x2c54fe=_0x2c54fe||0xc8;return function(_0x133cab){if(_0x133cab){return _0x107cd7[_0xe6e8('0x17')](_0x2c54fe)[_0xe6e8('0x18')](_0x133cab);}};}function respondWithFilteredResult(_0x4d36a0,_0x1c9698){return function(_0x1fda73){if(_0x1fda73){var _0x454e5c=typeof _0x1c9698[_0xe6e8('0x19')]===_0xe6e8('0x1a')&&typeof _0x1c9698[_0xe6e8('0x1b')]===_0xe6e8('0x1a');var _0x34132c=_0x1fda73[_0xe6e8('0x1c')];var _0x5feee8=_0x454e5c?0x0:_0x1c9698[_0xe6e8('0x19')];var _0x436e86=_0x454e5c?_0x1fda73['count']:_0x1c9698['offset']+_0x1c9698[_0xe6e8('0x1b')];var _0x2e26e4;if(_0x436e86>=_0x34132c){_0x436e86=_0x34132c;_0x2e26e4=0xc8;}else{_0x2e26e4=0xce;}_0x4d36a0[_0xe6e8('0x17')](_0x2e26e4);return _0x4d36a0['set']('Content-Range',_0x5feee8+'-'+_0x436e86+'/'+_0x34132c)[_0xe6e8('0x18')](_0x1fda73);}return null;};}function patchUpdates(_0x1c51b5){return function(_0x33b289){try{jsonpatch['apply'](_0x33b289,_0x1c51b5,!![]);}catch(_0x562965){return BPromise[_0xe6e8('0x1d')](_0x562965);}return _0x33b289[_0xe6e8('0x1e')]();};}function saveUpdates(_0x43c979,_0x460dc2){return function(_0x21c5f6){if(_0x21c5f6){return _0x21c5f6['update'](_0x43c979)[_0xe6e8('0x1f')](function(_0x3d8916){return _0x3d8916;});}return null;};}function removeEntity(_0x398edf,_0x1edb7b){return function(_0x1a41e5){if(_0x1a41e5){return _0x1a41e5[_0xe6e8('0x20')]()['then'](function(){_0x398edf['status'](0xcc)[_0xe6e8('0x21')]();});}};}function handleEntityNotFound(_0x5e7a72,_0x4f3024){return function(_0x3cc011){if(!_0x3cc011){_0x5e7a72[_0xe6e8('0x16')](0x194);}return _0x3cc011;};}function handleError(_0x4c83cc,_0x32b175){_0x32b175=_0x32b175||0x1f4;return function(_0x4ced6e){logger['error'](_0x4ced6e[_0xe6e8('0x22')]);if(_0x4ced6e['name']){delete _0x4ced6e[_0xe6e8('0x23')];}_0x4c83cc[_0xe6e8('0x17')](_0x32b175)[_0xe6e8('0x24')](_0x4ced6e);};}exports[_0xe6e8('0x25')]=function(_0x24a55c,_0x2673b1){var _0x28c049={},_0x28df98={},_0x58417c={'count':0x0,'rows':[]};var _0x1feb8e=_[_0xe6e8('0x26')](db[_0xe6e8('0x27')][_0xe6e8('0x28')],function(_0x4280f6){return{'name':_0x4280f6['fieldName'],'type':_0x4280f6[_0xe6e8('0x29')][_0xe6e8('0x2a')]};});_0x28df98[_0xe6e8('0x2b')]=_[_0xe6e8('0x26')](_0x1feb8e,_0xe6e8('0x23'));_0x28df98[_0xe6e8('0x2c')]=_['keys'](_0x24a55c['query']);_0x28df98['filters']=_[_0xe6e8('0x2d')](_0x28df98[_0xe6e8('0x2b')],_0x28df98[_0xe6e8('0x2c')]);_0x28c049[_0xe6e8('0x2e')]=_['intersection'](_0x28df98['model'],qs['fields'](_0x24a55c['query']['fields']));_0x28c049[_0xe6e8('0x2e')]=_0x28c049[_0xe6e8('0x2e')][_0xe6e8('0x2f')]?_0x28c049['attributes']:_0x28df98[_0xe6e8('0x2b')];if(!_0x24a55c[_0xe6e8('0x2c')][_0xe6e8('0x30')]('nolimit')){_0x28c049['limit']=qs['limit'](_0x24a55c['query'][_0xe6e8('0x1b')]);_0x28c049[_0xe6e8('0x19')]=qs[_0xe6e8('0x19')](_0x24a55c[_0xe6e8('0x2c')][_0xe6e8('0x19')]);}_0x28c049['order']=qs[_0xe6e8('0x31')](_0x24a55c[_0xe6e8('0x2c')][_0xe6e8('0x31')]);_0x28c049[_0xe6e8('0x32')]=qs[_0xe6e8('0x33')](_['pick'](_0x24a55c[_0xe6e8('0x2c')],_0x28df98[_0xe6e8('0x33')]),_0x1feb8e);if(_0x24a55c['query'][_0xe6e8('0x34')]){_0x28c049[_0xe6e8('0x32')]=_[_0xe6e8('0x35')](_0x28c049[_0xe6e8('0x32')],{'$or':_[_0xe6e8('0x26')](_0x1feb8e,function(_0x462511){if(_0x462511[_0xe6e8('0x29')]!==_0xe6e8('0x36')){var _0x3255f4={};_0x3255f4[_0x462511['name']]={'$like':'%'+_0x24a55c['query'][_0xe6e8('0x34')]+'%'};return _0x3255f4;}})});}_0x28c049=_[_0xe6e8('0x35')]({},_0x28c049,_0x24a55c[_0xe6e8('0x37')]);var _0x4b4e41={'where':_0x28c049[_0xe6e8('0x32')]};return db[_0xe6e8('0x27')][_0xe6e8('0x1c')](_0x4b4e41)[_0xe6e8('0x1f')](function(_0x4f3ff2){_0x58417c[_0xe6e8('0x1c')]=_0x4f3ff2;if(_0x24a55c['query'][_0xe6e8('0x38')]){_0x28c049[_0xe6e8('0x39')]=[{'all':!![]}];}return db[_0xe6e8('0x27')]['findAll'](_0x28c049);})[_0xe6e8('0x1f')](function(_0x7b6e23){_0x58417c['rows']=_0x7b6e23;return _0x58417c;})[_0xe6e8('0x1f')](respondWithFilteredResult(_0x2673b1,_0x28c049))[_0xe6e8('0x3a')](handleError(_0x2673b1,null));};exports[_0xe6e8('0x3b')]=function(_0x9cac05,_0xdbaea1){var _0x7acef8={'raw':!![],'where':{'id':_0x9cac05[_0xe6e8('0x3c')]['id']}},_0x41f2aa={};_0x41f2aa[_0xe6e8('0x2b')]=_[_0xe6e8('0x3d')](db[_0xe6e8('0x27')][_0xe6e8('0x28')]);_0x41f2aa[_0xe6e8('0x2c')]=_[_0xe6e8('0x3d')](_0x9cac05['query']);_0x41f2aa[_0xe6e8('0x33')]=_[_0xe6e8('0x2d')](_0x41f2aa[_0xe6e8('0x2b')],_0x41f2aa[_0xe6e8('0x2c')]);_0x7acef8[_0xe6e8('0x2e')]=_[_0xe6e8('0x2d')](_0x41f2aa[_0xe6e8('0x2b')],qs[_0xe6e8('0x3e')](_0x9cac05[_0xe6e8('0x2c')][_0xe6e8('0x3e')]));_0x7acef8[_0xe6e8('0x2e')]=_0x7acef8['attributes'][_0xe6e8('0x2f')]?_0x7acef8[_0xe6e8('0x2e')]:_0x41f2aa['model'];if(_0x9cac05[_0xe6e8('0x2c')][_0xe6e8('0x38')]){_0x7acef8[_0xe6e8('0x39')]=[{'all':!![]}];}_0x7acef8=_['merge']({},_0x7acef8,_0x9cac05[_0xe6e8('0x37')]);return db[_0xe6e8('0x27')][_0xe6e8('0x3f')](_0x7acef8)[_0xe6e8('0x1f')](handleEntityNotFound(_0xdbaea1,null))[_0xe6e8('0x1f')](respondWithResult(_0xdbaea1,null))[_0xe6e8('0x3a')](handleError(_0xdbaea1,null));};exports[_0xe6e8('0x40')]=function(_0x49ac23,_0x30b2a3){return db['VoiceQueuesLog']['create'](_0x49ac23[_0xe6e8('0x41')],{})[_0xe6e8('0x1f')](respondWithResult(_0x30b2a3,0xc9))[_0xe6e8('0x3a')](handleError(_0x30b2a3,null));};exports[_0xe6e8('0x42')]=function(_0x5f0406,_0x422cbb){if(_0x5f0406['body']['id']){delete _0x5f0406[_0xe6e8('0x41')]['id'];}return db[_0xe6e8('0x27')][_0xe6e8('0x3f')]({'where':{'id':_0x5f0406[_0xe6e8('0x3c')]['id']}})[_0xe6e8('0x1f')](handleEntityNotFound(_0x422cbb,null))[_0xe6e8('0x1f')](saveUpdates(_0x5f0406[_0xe6e8('0x41')],null))[_0xe6e8('0x1f')](respondWithResult(_0x422cbb,null))[_0xe6e8('0x3a')](handleError(_0x422cbb,null));};exports[_0xe6e8('0x20')]=function(_0x478429,_0xa5729){return db['VoiceQueuesLog'][_0xe6e8('0x3f')]({'where':{'id':_0x478429[_0xe6e8('0x3c')]['id']}})[_0xe6e8('0x1f')](handleEntityNotFound(_0xa5729,null))[_0xe6e8('0x1f')](removeEntity(_0xa5729,null))['catch'](handleError(_0xa5729,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 5f086b0..a8b0c07 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 _0x1c73=['event_dtm','event','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','VoiceQueuesLog','voice_queues_log'];(function(_0x16ea6e,_0x13456a){var _0x479de7=function(_0x1e1b7d){while(--_0x1e1b7d){_0x16ea6e['push'](_0x16ea6e['shift']());}};_0x479de7(++_0x13456a);}(_0x1c73,0xc2));var _0x31c7=function(_0x360f55,_0x25658c){_0x360f55=_0x360f55-0x0;var _0x3fa3ec=_0x1c73[_0x360f55];return _0x3fa3ec;};'use strict';var _=require(_0x31c7('0x0'));var util=require('util');var logger=require(_0x31c7('0x1'))(_0x31c7('0x2'));var moment=require(_0x31c7('0x3'));var BPromise=require(_0x31c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31c7('0x5'));var rimraf=require(_0x31c7('0x6'));var config=require(_0x31c7('0x7'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x3da553,_0x597fbf){return _0x3da553['define'](_0x31c7('0x8'),attributes,{'tableName':_0x31c7('0x9'),'paranoid':![],'indexes':[{'name':_0x31c7('0xa'),'fields':[_0x31c7('0xb'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x639d=['VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','define'];(function(_0x5c8d81,_0x4db846){var _0x15c102=function(_0x268773){while(--_0x268773){_0x5c8d81['push'](_0x5c8d81['shift']());}};_0x15c102(++_0x4db846);}(_0x639d,0xbb));var _0xd639=function(_0x55313f,_0x51a9b1){_0x55313f=_0x55313f-0x0;var _0x585681=_0x639d[_0x55313f];return _0x585681;};'use strict';var _=require(_0xd639('0x0'));var util=require(_0xd639('0x1'));var logger=require(_0xd639('0x2'))('api');var moment=require(_0xd639('0x3'));var BPromise=require(_0xd639('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd639('0x5'));var rimraf=require('rimraf');var config=require(_0xd639('0x6'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x2a71b9,_0x1cebd4){return _0x2a71b9[_0xd639('0x7')](_0xd639('0x8'),attributes,{'tableName':_0xd639('0x9'),'paranoid':![],'indexes':[{'name':_0xd639('0xa'),'fields':[_0xd639('0xb'),_0xd639('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 16f8799..a87dab5 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 _0x22d3=['debug','stringify','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x29673a,_0xcd0eef){var _0x2a2c24=function(_0x34ff45){while(--_0x34ff45){_0x29673a['push'](_0x29673a['shift']());}};_0x2a2c24(++_0xcd0eef);}(_0x22d3,0xf8));var _0x322d=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x22d3[_0x1f8053];return _0x174fd8;};'use strict';var _=require(_0x322d('0x0'));var util=require(_0x322d('0x1'));var moment=require(_0x322d('0x2'));var BPromise=require(_0x322d('0x3'));var rs=require(_0x322d('0x4'));var fs=require('fs');var Redis=require(_0x322d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x322d('0x6'));var logger=require(_0x322d('0x7'))(_0x322d('0x8'));var config=require(_0x322d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x322d('0xa')][_0x322d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c2a38,_0x1bb16a,_0xf9b463){return new BPromise(function(_0x434a7f,_0x2b3ac4){return client[_0x322d('0xc')](_0x1c2a38,_0xf9b463)[_0x322d('0xd')](function(_0x2577c9){logger[_0x322d('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1bb16a,_0x322d('0xf'));logger[_0x322d('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x1bb16a,_0x322d('0xf'),JSON[_0x322d('0x11')](_0x2577c9));if(_0x2577c9[_0x322d('0x12')]){if(_0x2577c9[_0x322d('0x12')][_0x322d('0x13')]===0x1f4){logger[_0x322d('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1bb16a,_0x2577c9[_0x322d('0x12')][_0x322d('0x14')]);return _0x2b3ac4(_0x2577c9[_0x322d('0x12')][_0x322d('0x14')]);}logger['error'](_0x322d('0x15'),_0x1bb16a,_0x2577c9['error'][_0x322d('0x14')]);return _0x434a7f(_0x2577c9[_0x322d('0x12')][_0x322d('0x14')]);}else{logger[_0x322d('0xe')](_0x322d('0x15'),_0x1bb16a,_0x322d('0xf'));_0x434a7f(_0x2577c9[_0x322d('0x16')][_0x322d('0x14')]);}})[_0x322d('0x17')](function(_0x2ade50){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x1bb16a,_0x2ade50);_0x2b3ac4(_0x2ade50);});});} \ No newline at end of file +var _0x2f90=['VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3deab6,_0x41da76){var _0x314d9d=function(_0x36d792){while(--_0x36d792){_0x3deab6['push'](_0x3deab6['shift']());}};_0x314d9d(++_0x41da76);}(_0x2f90,0x1e9));var _0x02f9=function(_0x3120e6,_0x324456){_0x3120e6=_0x3120e6-0x0;var _0x5b739f=_0x2f90[_0x3120e6];return _0x5b739f;};'use strict';var _=require('lodash');var util=require(_0x02f9('0x0'));var moment=require(_0x02f9('0x1'));var BPromise=require(_0x02f9('0x2'));var rs=require(_0x02f9('0x3'));var fs=require('fs');var Redis=require(_0x02f9('0x4'));var db=require(_0x02f9('0x5'))['db'];var utils=require(_0x02f9('0x6'));var logger=require(_0x02f9('0x7'))(_0x02f9('0x8'));var config=require('../../config/environment');var jayson=require(_0x02f9('0x9'));var client=jayson[_0x02f9('0xa')][_0x02f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bbcdb,_0x1e7531,_0x5f3841){return new BPromise(function(_0x34135f,_0x3b8788){return client[_0x02f9('0xc')](_0x4bbcdb,_0x5f3841)[_0x02f9('0xd')](function(_0x180237){logger[_0x02f9('0xe')](_0x02f9('0xf'),_0x1e7531,_0x02f9('0x10'));logger[_0x02f9('0x11')](_0x02f9('0x12'),_0x1e7531,_0x02f9('0x10'),JSON[_0x02f9('0x13')](_0x180237));if(_0x180237['error']){if(_0x180237[_0x02f9('0x14')][_0x02f9('0x15')]===0x1f4){logger['error'](_0x02f9('0xf'),_0x1e7531,_0x180237[_0x02f9('0x14')]['message']);return _0x3b8788(_0x180237[_0x02f9('0x14')][_0x02f9('0x16')]);}logger[_0x02f9('0x14')](_0x02f9('0xf'),_0x1e7531,_0x180237['error'][_0x02f9('0x16')]);return _0x34135f(_0x180237[_0x02f9('0x14')]['message']);}else{logger[_0x02f9('0xe')](_0x02f9('0xf'),_0x1e7531,_0x02f9('0x10'));_0x34135f(_0x180237['result'][_0x02f9('0x16')]);}})[_0x02f9('0x17')](function(_0x15705d){logger[_0x02f9('0x14')](_0x02f9('0xf'),_0x1e7531,_0x15705d);_0x3b8788(_0x15705d);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 6cf8351..07129e8 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 _0x8cde=['runTranscribe','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post'];(function(_0x283eb5,_0x580840){var _0x47305b=function(_0xa3a19a){while(--_0xa3a19a){_0x283eb5['push'](_0x283eb5['shift']());}};_0x47305b(++_0x580840);}(_0x8cde,0x16c));var _0xe8cd=function(_0x104112,_0x342eb6){_0x104112=_0x104112-0x0;var _0x394ab4=_0x8cde[_0x104112];return _0x394ab4;};'use strict';var multer=require(_0xe8cd('0x0'));var util=require(_0xe8cd('0x1'));var path=require(_0xe8cd('0x2'));var timeout=require(_0xe8cd('0x3'));var express=require('express');var router=express[_0xe8cd('0x4')]();var fs_extra=require(_0xe8cd('0x5'));var auth=require(_0xe8cd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe8cd('0x7'));var controller=require(_0xe8cd('0x8'));router[_0xe8cd('0x9')]('/',auth[_0xe8cd('0xa')](),controller['index']);router['get'](_0xe8cd('0xb'),auth[_0xe8cd('0xa')](),controller[_0xe8cd('0xc')]);router['get'](_0xe8cd('0xd'),auth[_0xe8cd('0xa')](),controller['show']);router[_0xe8cd('0x9')]('/:id/download',auth[_0xe8cd('0xa')](),controller[_0xe8cd('0xe')]);router[_0xe8cd('0x9')](_0xe8cd('0xf'),controller[_0xe8cd('0x10')]);router['get'](_0xe8cd('0x11'),auth[_0xe8cd('0xa')](),controller[_0xe8cd('0x12')]);router[_0xe8cd('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe8cd('0x13')](_0xe8cd('0x11'),auth[_0xe8cd('0xa')](),controller[_0xe8cd('0x14')]);router['put'](_0xe8cd('0xd'),auth[_0xe8cd('0xa')](),controller[_0xe8cd('0x15')]);router[_0xe8cd('0x16')](_0xe8cd('0xd'),auth[_0xe8cd('0xa')](),controller['destroy']);module[_0xe8cd('0x17')]=router; \ No newline at end of file +var _0x4e72=['../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xee0e8a,_0x20aba0){var _0x1c6e38=function(_0x45ab3b){while(--_0x45ab3b){_0xee0e8a['push'](_0xee0e8a['shift']());}};_0x1c6e38(++_0x20aba0);}(_0x4e72,0xa7));var _0x24e7=function(_0x4b699d,_0x13ca10){_0x4b699d=_0x4b699d-0x0;var _0x194915=_0x4e72[_0x4b699d];return _0x194915;};'use strict';var multer=require(_0x24e7('0x0'));var util=require(_0x24e7('0x1'));var path=require(_0x24e7('0x2'));var timeout=require(_0x24e7('0x3'));var express=require(_0x24e7('0x4'));var router=express[_0x24e7('0x5')]();var fs_extra=require(_0x24e7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x24e7('0x7'));var config=require(_0x24e7('0x8'));var controller=require(_0x24e7('0x9'));router[_0x24e7('0xa')]('/',auth[_0x24e7('0xb')](),controller[_0x24e7('0xc')]);router[_0x24e7('0xa')](_0x24e7('0xd'),auth[_0x24e7('0xb')](),controller[_0x24e7('0xe')]);router[_0x24e7('0xa')]('/:id',auth[_0x24e7('0xb')](),controller[_0x24e7('0xf')]);router[_0x24e7('0xa')](_0x24e7('0x10'),auth[_0x24e7('0xb')](),controller['download']);router[_0x24e7('0xa')](_0x24e7('0x11'),controller[_0x24e7('0x12')]);router[_0x24e7('0xa')](_0x24e7('0x13'),auth[_0x24e7('0xb')](),controller[_0x24e7('0x14')]);router[_0x24e7('0x15')]('/',auth[_0x24e7('0xb')](),controller[_0x24e7('0x16')]);router[_0x24e7('0x15')](_0x24e7('0x13'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0x24e7('0x17')](_0x24e7('0x18'),auth[_0x24e7('0xb')](),controller[_0x24e7('0x19')]);router[_0x24e7('0x1a')](_0x24e7('0x18'),auth[_0x24e7('0xb')](),controller[_0x24e7('0x1b')]);module[_0x24e7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 9cc0d51..fac2fff 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(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 ba3a76e..72d2ac8 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 _0x9292=['fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','VoiceRecording','includeAll','include','rows','find','create','body','catch','params','describe','download','../../components/encryptor','uniqueid','value','secrets','recording','Sequelize','filename','extname','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','downloads','sequelize','MD5','token','push','$and','%s.cypher','existsSync','decryptFile','ValidationError','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','CloudProvider','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','aws-sdk','uuid/v4','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','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','fieldName','type','model','format','query','keys','filters','intersection','attributes'];(function(_0xc69530,_0x57c174){var _0x148a92=function(_0x409d97){while(--_0x409d97){_0xc69530['push'](_0xc69530['shift']());}};_0x148a92(++_0x57c174);}(_0x9292,0xfb));var _0x2929=function(_0x56a662,_0x375295){_0x56a662=_0x56a662-0x0;var _0x40525b=_0x9292[_0x56a662];return _0x40525b;};'use strict';var emlformat=require(_0x2929('0x0'));var rimraf=require(_0x2929('0x1'));var zipdir=require(_0x2929('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2929('0x3'));var moment=require(_0x2929('0x4'));var BPromise=require(_0x2929('0x5'));var Mustache=require('mustache');var util=require(_0x2929('0x6'));var path=require(_0x2929('0x7'));var sox=require(_0x2929('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2929('0x9'));var squel=require(_0x2929('0xa'));var crypto=require(_0x2929('0xb'));var jsforce=require(_0x2929('0xc'));var deskjs=require(_0x2929('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2929('0xe'));var Papa=require('papaparse');var AWS=require(_0x2929('0xf'));var uuidv4=require(_0x2929('0x10'));var Redis=require(_0x2929('0x11'));var authService=require(_0x2929('0x12'));var qs=require(_0x2929('0x13'));var as=require(_0x2929('0x14'));var hardwareService=require(_0x2929('0x15'));var logger=require(_0x2929('0x16'))(_0x2929('0x17'));var utils=require('../../config/utils');var config=require(_0x2929('0x18'));var licenseUtil=require(_0x2929('0x19'));var db=require(_0x2929('0x1a'))['db'];function respondWithStatusCode(_0x2d92c4,_0x445d6c){_0x445d6c=_0x445d6c||0xcc;return function(_0x2868f0){if(_0x2868f0){return _0x2d92c4[_0x2929('0x1b')](_0x445d6c);}return _0x2d92c4[_0x2929('0x1c')](_0x445d6c)['end']();};}function respondWithResult(_0x532cae,_0x5db1b6){_0x5db1b6=_0x5db1b6||0xc8;return function(_0x5c0ec5){if(_0x5c0ec5){return _0x532cae['status'](_0x5db1b6)['json'](_0x5c0ec5);}};}function respondWithFilteredResult(_0x4779df,_0x560d2a){return function(_0x35776f){if(_0x35776f){var _0x50ce9d=typeof _0x560d2a[_0x2929('0x1d')]===_0x2929('0x1e')&&typeof _0x560d2a[_0x2929('0x1f')]==='undefined';var _0x7502b4=_0x35776f[_0x2929('0x20')];var _0x35fb94=_0x50ce9d?0x0:_0x560d2a[_0x2929('0x1d')];var _0x3f3839=_0x50ce9d?_0x35776f[_0x2929('0x20')]:_0x560d2a[_0x2929('0x1d')]+_0x560d2a[_0x2929('0x1f')];var _0x3c4962;if(_0x3f3839>=_0x7502b4){_0x3f3839=_0x7502b4;_0x3c4962=0xc8;}else{_0x3c4962=0xce;}_0x4779df[_0x2929('0x1c')](_0x3c4962);return _0x4779df[_0x2929('0x21')](_0x2929('0x22'),_0x35fb94+'-'+_0x3f3839+'/'+_0x7502b4)[_0x2929('0x23')](_0x35776f);}return null;};}function patchUpdates(_0x50c08d){return function(_0x5216a4){try{jsonpatch[_0x2929('0x24')](_0x5216a4,_0x50c08d,!![]);}catch(_0x212b4c){return BPromise[_0x2929('0x25')](_0x212b4c);}return _0x5216a4[_0x2929('0x26')]();};}function saveUpdates(_0x5ef89b,_0x2bda3d){return function(_0x4c5787){if(_0x4c5787){return _0x4c5787[_0x2929('0x27')](_0x5ef89b)[_0x2929('0x28')](function(_0x47a92b){return _0x47a92b;});}return null;};}function removeEntity(_0x44df64,_0x10e211){return function(_0x3a86ac){if(_0x3a86ac){return _0x3a86ac[_0x2929('0x29')]()['then'](function(){_0x44df64['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46f59e,_0x30e739){return function(_0xb64591){if(!_0xb64591){_0x46f59e['sendStatus'](0x194);}return _0xb64591;};}function handleError(_0x4a6286,_0x3b6cb3){_0x3b6cb3=_0x3b6cb3||0x1f4;return function(_0x166e19){logger[_0x2929('0x2a')](_0x166e19[_0x2929('0x2b')]);if(_0x166e19[_0x2929('0x2c')]){delete _0x166e19[_0x2929('0x2c')];}_0x4a6286[_0x2929('0x1c')](_0x3b6cb3)['send'](_0x166e19);};}exports['index']=function(_0x4ce333,_0x17d325){var _0x3aaf26={},_0x15430f={},_0x12c07c={'count':0x0,'rows':[]};var _0x47a68f=_[_0x2929('0x2d')](db['VoiceRecording']['rawAttributes'],function(_0x3d91bf){return{'name':_0x3d91bf[_0x2929('0x2e')],'type':_0x3d91bf[_0x2929('0x2f')]['key']};});_0x15430f[_0x2929('0x30')]=_['differenceBy'](_[_0x2929('0x2d')](_0x47a68f,_0x2929('0x2c')),[_0x2929('0x31')]);_0x15430f[_0x2929('0x32')]=_[_0x2929('0x33')](_0x4ce333[_0x2929('0x32')]);_0x15430f[_0x2929('0x34')]=_[_0x2929('0x35')](_0x15430f[_0x2929('0x30')],_0x15430f[_0x2929('0x32')]);_0x3aaf26[_0x2929('0x36')]=_[_0x2929('0x35')](_0x15430f['model'],qs[_0x2929('0x37')](_0x4ce333[_0x2929('0x32')]['fields']));_0x3aaf26['attributes']=_0x3aaf26[_0x2929('0x36')][_0x2929('0x38')]?_0x3aaf26[_0x2929('0x36')]:_0x15430f['model'];if(!_0x4ce333[_0x2929('0x32')][_0x2929('0x39')](_0x2929('0x3a'))){_0x3aaf26[_0x2929('0x1f')]=qs['limit'](_0x4ce333[_0x2929('0x32')][_0x2929('0x1f')]);_0x3aaf26[_0x2929('0x1d')]=qs[_0x2929('0x1d')](_0x4ce333[_0x2929('0x32')][_0x2929('0x1d')]);}_0x3aaf26[_0x2929('0x3b')]=qs[_0x2929('0x3c')](_0x4ce333[_0x2929('0x32')][_0x2929('0x3c')]);_0x3aaf26[_0x2929('0x3d')]=qs[_0x2929('0x34')](_['pick'](_0x4ce333[_0x2929('0x32')],_0x15430f[_0x2929('0x34')]),_0x47a68f);if(_0x4ce333['query'][_0x2929('0x3e')]){_0x3aaf26[_0x2929('0x3d')]=_[_0x2929('0x3f')](_0x3aaf26[_0x2929('0x3d')],{'$or':_[_0x2929('0x2d')](_0x47a68f,function(_0x5f0725){if(_0x5f0725['type']!==_0x2929('0x40')){var _0x367956={};_0x367956[_0x5f0725[_0x2929('0x2c')]]={'$like':'%'+_0x4ce333[_0x2929('0x32')][_0x2929('0x3e')]+'%'};return _0x367956;}})});}_0x3aaf26=_[_0x2929('0x3f')]({},_0x3aaf26,_0x4ce333[_0x2929('0x41')]);var _0x5b32b0={'where':_0x3aaf26[_0x2929('0x3d')]};return db[_0x2929('0x42')][_0x2929('0x20')](_0x5b32b0)['then'](function(_0x26e96a){_0x12c07c[_0x2929('0x20')]=_0x26e96a;if(_0x4ce333[_0x2929('0x32')][_0x2929('0x43')]){_0x3aaf26[_0x2929('0x44')]=[{'all':!![]}];}return db[_0x2929('0x42')]['findAll'](_0x3aaf26);})[_0x2929('0x28')](function(_0x56db7a){_0x12c07c[_0x2929('0x45')]=_0x56db7a;return _0x12c07c;})[_0x2929('0x28')](respondWithFilteredResult(_0x17d325,_0x3aaf26))['catch'](handleError(_0x17d325,null));};exports['show']=function(_0x340414,_0x370112){var _0x4022a5={'raw':![],'where':{'id':_0x340414['params']['id']}},_0x33e481={};_0x33e481[_0x2929('0x30')]=_[_0x2929('0x33')](db['VoiceRecording']['rawAttributes']);_0x33e481[_0x2929('0x32')]=_[_0x2929('0x33')](_0x340414['query']);_0x33e481['filters']=_[_0x2929('0x35')](_0x33e481['model'],_0x33e481[_0x2929('0x32')]);_0x4022a5[_0x2929('0x36')]=_[_0x2929('0x35')](_0x33e481['model'],qs['fields'](_0x340414[_0x2929('0x32')]['fields']));_0x4022a5['attributes']=_0x4022a5[_0x2929('0x36')][_0x2929('0x38')]?_0x4022a5[_0x2929('0x36')]:_0x33e481[_0x2929('0x30')];if(_0x340414[_0x2929('0x32')][_0x2929('0x43')]){_0x4022a5[_0x2929('0x44')]=[{'all':!![]}];}_0x4022a5=_[_0x2929('0x3f')]({},_0x4022a5,_0x340414[_0x2929('0x41')]);return db['VoiceRecording'][_0x2929('0x46')](_0x4022a5)[_0x2929('0x28')](handleEntityNotFound(_0x370112,null))[_0x2929('0x28')](respondWithResult(_0x370112,null))['catch'](handleError(_0x370112,null));};exports[_0x2929('0x47')]=function(_0x578149,_0x465347){return db['VoiceRecording'][_0x2929('0x47')](_0x578149[_0x2929('0x48')],{})[_0x2929('0x28')](respondWithResult(_0x465347,0xc9))[_0x2929('0x49')](handleError(_0x465347,null));};exports[_0x2929('0x27')]=function(_0x2c48fc,_0x87c32){if(_0x2c48fc[_0x2929('0x48')]['id']){delete _0x2c48fc[_0x2929('0x48')]['id'];}return db[_0x2929('0x42')][_0x2929('0x46')]({'where':{'id':_0x2c48fc[_0x2929('0x4a')]['id']}})[_0x2929('0x28')](handleEntityNotFound(_0x87c32,null))[_0x2929('0x28')](saveUpdates(_0x2c48fc[_0x2929('0x48')],null))['then'](respondWithResult(_0x87c32,null))[_0x2929('0x49')](handleError(_0x87c32,null));};exports[_0x2929('0x4b')]=function(_0x41af9e,_0x4c6c58){return db[_0x2929('0x42')]['describe']()[_0x2929('0x28')](respondWithResult(_0x4c6c58,null))[_0x2929('0x49')](handleError(_0x4c6c58,null));};exports[_0x2929('0x4c')]=function(_0x2f7e71,_0xb81e7c,_0x361ebb){var _0x34fee6=require(_0x2929('0x4d'));var _0x616bfe=![];var _0x32e22f={};if(_0x2f7e71[_0x2929('0x32')][_0x2929('0x2f')]&&_0x2f7e71[_0x2929('0x32')][_0x2929('0x2f')]===_0x2929('0x4e')){_0x32e22f[_0x2929('0x4e')]=_0x2f7e71[_0x2929('0x4a')]['id'];}else{_0x32e22f['id']=_0x2f7e71[_0x2929('0x4a')]['id'];}return db[_0x2929('0x42')][_0x2929('0x46')]({'where':_0x32e22f,'attributes':['id',_0x2929('0x4f')],'raw':!![]})[_0x2929('0x28')](handleEntityNotFound(_0xb81e7c,null))['then'](function(_0x3a5b2e){if(_0x3a5b2e){var _0x1b3057=_0x3a5b2e[_0x2929('0x4f')];var _0x19f37a=util[_0x2929('0x31')]('%s.cypher',_0x1b3057);if(fs['existsSync'](_0x19f37a)){_0x616bfe=!![];return _0x34fee6['decryptFile'](_0x19f37a,_0x1b3057,config[_0x2929('0x50')][_0x2929('0x51')])['then'](function(){return _0x3a5b2e;});}return _0x3a5b2e;}})[_0x2929('0x28')](function(_0x21bd47){if(_0x21bd47){var _0x5c348f=_0x21bd47[_0x2929('0x4f')];if(!fs['existsSync'](_0x5c348f)){throw new db[(_0x2929('0x52'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x21bd47[_0x2929('0x53')]){return _0xb81e7c[_0x2929('0x4c')](_0x5c348f,_0x21bd47[_0x2929('0x53')]+path[_0x2929('0x54')](_0x5c348f),function(){if(_0x616bfe){fs[_0x2929('0x55')](_0x5c348f);}});}else{return _0xb81e7c['download'](_0x5c348f,function(_0x1d055f){if(_0x616bfe){fs['unlink'](_0x5c348f);}});}}})[_0x2929('0x49')](function(_0x5628f2){if(_0x5628f2[_0x2929('0x56')]===_0x2929('0x57')){_0xb81e7c[_0x2929('0x1c')](0x194)[_0x2929('0x58')](_0x2929('0x59'));}else{return handleError(_0xb81e7c,null);}});};exports[_0x2929('0x5a')]=function(_0x51ee2e,_0x3830cb,_0x24cdaa){var _0x499d8c=require(_0x2929('0x4d'));var _0x313f11=![];var _0x3a2a0d={'$and':[db[_0x2929('0x5b')][_0x2929('0x3d')](db['sequelize']['fn'](_0x2929('0x5c'),db[_0x2929('0x5b')]['col'](_0x2929('0x4e'))),_0x51ee2e[_0x2929('0x32')][_0x2929('0x5d')])]};if(_0x51ee2e[_0x2929('0x32')][_0x2929('0x2f')]&&_0x51ee2e['query'][_0x2929('0x2f')]==='uniqueid'){_0x3a2a0d['$and'][_0x2929('0x5e')]({'uniqueid':_0x51ee2e[_0x2929('0x4a')]['id']});}else{_0x3a2a0d[_0x2929('0x5f')]['push']({'id':_0x51ee2e['params']['id']});}return db[_0x2929('0x42')][_0x2929('0x46')]({'where':_0x3a2a0d,'attributes':['id',_0x2929('0x4f')],'raw':!![]})[_0x2929('0x28')](handleEntityNotFound(_0x3830cb,null))[_0x2929('0x28')](function(_0x373022){if(_0x373022){var _0x2c4a30=util['format'](_0x2929('0x60'),_0x373022[_0x2929('0x4f')]);if(fs[_0x2929('0x61')](_0x2c4a30)){_0x313f11=!![];return _0x499d8c[_0x2929('0x62')](_0x2c4a30,_0x373022[_0x2929('0x4f')],config[_0x2929('0x50')][_0x2929('0x51')])[_0x2929('0x28')](function(){return _0x373022;});}return _0x373022;}})[_0x2929('0x28')](function(_0x4b9a04){if(_0x4b9a04){if(!fs[_0x2929('0x61')](_0x4b9a04[_0x2929('0x4f')])){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))](_0x2929('0x57'));}if(_0x4b9a04[_0x2929('0x53')]){return _0x3830cb[_0x2929('0x4c')](_0x4b9a04['value'],_0x4b9a04[_0x2929('0x53')]+path[_0x2929('0x54')](_0x4b9a04[_0x2929('0x4f')]),function(){if(_0x313f11){fs[_0x2929('0x55')](_0x4b9a04['value']);}});}else{return _0x3830cb['download'](_0x4b9a04[_0x2929('0x4f')],function(_0x5f4177){if(_0x313f11){fs['unlink'](_0x4b9a04[_0x2929('0x4f')]);}});}}})[_0x2929('0x49')](handleError(_0x3830cb,null));};exports[_0x2929('0x29')]=function(_0x28ff64,_0x3e6b84){return db[_0x2929('0x42')][_0x2929('0x46')]({'where':{'id':_0x28ff64[_0x2929('0x4a')]['id']}})[_0x2929('0x28')](function(_0x54c6d9){if(_[_0x2929('0x64')](_0x54c6d9)){throw new ReferenceError('Entity\x20not\x20found');}return _0x54c6d9;})['then'](function(_0x2effa1){var _0x34ebd0=_0x2effa1[_0x2929('0x4f')];logger[_0x2929('0x65')](_0x2929('0x66'),_0x34ebd0);if(!_[_0x2929('0x64')](_0x2effa1['value'])&&fs[_0x2929('0x61')](_0x34ebd0)){logger[_0x2929('0x65')](_0x2929('0x67')+_0x34ebd0+_0x2929('0x68'));fs[_0x2929('0x69')](_0x34ebd0);}_0x34ebd0=_0x34ebd0+_0x2929('0x6a');if(!_[_0x2929('0x64')](_0x2effa1['value'])&&fs[_0x2929('0x61')](_0x34ebd0)){logger['info'](_0x2929('0x67')+_0x34ebd0+_0x2929('0x68'));fs[_0x2929('0x69')](_0x34ebd0);}return _0x2effa1;})['then'](function(_0x4f12e8){if(!_0x4f12e8)throw new InternalError();return _0x4f12e8[_0x2929('0x29')]();})[_0x2929('0x28')](function(){_0x3e6b84[_0x2929('0x1c')](0xcc)[_0x2929('0x6b')]();})[_0x2929('0x49')](handleError(_0x3e6b84,null));};function getBucketslist(_0x4c5d82,_0x44aefa,_0x52e430){return new Promise(function(_0x5f3651,_0x5e89c0){var _0xc6e8c=new AWS['S3']({'accessKeyId':_0x44aefa,'secretAccessKey':_0x4c5d82,'region':_0x52e430});_0xc6e8c[_0x2929('0x6c')]({},function(_0x259d18,_0x2ac4aa){if(_0x259d18){return _0x5e89c0(_0x259d18);}else{return _0x5f3651(_0x2ac4aa);}});});}function createBucket(_0x5e0884,_0x4e7dd0,_0x5d8e20,_0x2d81b4){return new Promise(function(_0x3d0ef1,_0x5947a2){var _0x264a2d=new AWS['S3']({'accessKeyId':_0x4e7dd0,'secretAccessKey':_0x5e0884,'region':_0x5d8e20});_0x264a2d[_0x2929('0x6d')]({'Bucket':_0x2d81b4},function(_0x546f13,_0xbd42c9){if(_0x546f13){return _0x5947a2(_0x546f13);}else{return _0x3d0ef1(_0xbd42c9);}});});}function uploadFile(_0x474cb7,_0x44c688,_0x5a885f,_0x3fe407,_0x440c7e,_0x5d99fb){return new Promise(function(_0x1317d5,_0x4e7fa3){var _0x549c8d=new AWS['S3']({'accessKeyId':_0x44c688,'secretAccessKey':_0x474cb7,'region':_0x5a885f});_0x549c8d[_0x2929('0x6e')]({'Bucket':_0x3fe407,'Key':_0x440c7e,'Body':_0x5d99fb},function(_0x4806fc,_0x3d84a3){if(_0x4806fc){return _0x4e7fa3(_0x4806fc);}else{return _0x1317d5(_0x3d84a3);}});});}function startTranscribe(_0x39dd4e,_0x4f881e,_0x1af928,_0x4ebbbc,_0x32307c,_0x4219be){return new Promise(function(_0x1bca56,_0x76b86b){var _0x3728f2=new AWS[(_0x2929('0x6f'))]({'accessKeyId':_0x4f881e,'secretAccessKey':_0x39dd4e,'region':_0x1af928});_0x3728f2['startTranscriptionJob']({'TranscriptionJobName':_0x4ebbbc,'LanguageCode':_0x32307c,'Media':{'MediaFileUri':_0x4219be}},function(_0x464c23,_0x480df4){if(_0x464c23){return _0x76b86b(_0x464c23);}else{return _0x1bca56(_0x480df4);}});});}function transcribe(_0x49558d,_0x395ad2,_0xbeabe7,_0x19346d,_0x5d737c,_0x146c75,_0xf6f574){return new Promise(function(_0x18ad8b,_0x133b85){var _0x412065={};logger[_0x2929('0x65')](util[_0x2929('0x31')](_0x2929('0x70'),_0x49558d,_0x5d737c));return uploadFile(_0x395ad2,_0xbeabe7,_0x19346d,_0x5d737c,path[_0x2929('0x71')](_0x146c75),fs[_0x2929('0x72')](_0x146c75))[_0x2929('0x28')](function(_0x5802f0){logger[_0x2929('0x65')](util[_0x2929('0x31')](_0x2929('0x73'),_0x49558d,_0x5d737c,_0x5802f0[_0x2929('0x74')]));_0x412065['bucket']=_0x5802f0['Bucket'];_0x412065['location']=_0x5802f0[_0x2929('0x74')];logger[_0x2929('0x65')](util[_0x2929('0x31')](_0x2929('0x75'),_0x49558d));return startTranscribe(_0x395ad2,_0xbeabe7,_0x19346d,uuidv4(),_0xf6f574,_0x5802f0[_0x2929('0x74')]);})[_0x2929('0x28')](function(_0x5a6a10){logger[_0x2929('0x65')](util['format'](_0x2929('0x76'),_0x49558d,_0x5a6a10['TranscriptionJob'][_0x2929('0x77')]));_0x412065['transcribeName']=_0x5a6a10[_0x2929('0x78')][_0x2929('0x77')];_0x412065[_0x2929('0x79')]=_0x5a6a10[_0x2929('0x78')][_0x2929('0x7a')];return _0x18ad8b(_0x412065);})[_0x2929('0x49')](function(_0x2ae696){return _0x133b85(_0x2ae696);});});}exports[_0x2929('0x7b')]=function(_0x13c98a,_0x2b6750,_0x2beb79){var _0xad9958;var _0x3a8732;var _0x476478;var _0x578ffd=require(_0x2929('0x4d'));return db[_0x2929('0x42')][_0x2929('0x7c')]({'where':{'id':_0x13c98a[_0x2929('0x4a')]['id']}})[_0x2929('0x28')](function(_0x2e4545){if(_0x2e4545){var _0xbb9866=util[_0x2929('0x31')]('%s.cypher',_0x2e4545[_0x2929('0x4f')]);if(fs[_0x2929('0x61')](_0xbb9866)){cypher=!![];return _0x578ffd[_0x2929('0x62')](_0xbb9866,_0x2e4545['value'],config[_0x2929('0x50')]['recording'])[_0x2929('0x28')](function(){return _0x2e4545;});}return _0x2e4545;}})[_0x2929('0x28')](function(_0x27b1e4){if(!_0x27b1e4){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))](_0x2929('0x7d'));}_0x3a8732=_0x27b1e4;return db[_0x2929('0x7e')][_0x2929('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2b6750,null))[_0x2929('0x28')](function(_0x4afe25){if(_0x4afe25){_0xad9958=_0x4afe25;if(!_0xad9958[_0x2929('0x7f')]||!_0xad9958['transcribeAccountId']||!_0xad9958['transcribeRegion']||!_0xad9958[_0x2929('0x80')]||!_0xad9958[_0x2929('0x81')]){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))](_0x2929('0x82'));}if(_0x13c98a[_0x2929('0x48')][_0x2929('0x83')]&&(!_0xad9958[_0x2929('0x84')]||!_0xad9958['sentimentAccountId']||!_0xad9958[_0x2929('0x85')]||!_0xad9958[_0x2929('0x80')]||!_0xad9958[_0x2929('0x81')])){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x2929('0x86')][_0x2929('0x7c')]({'where':{'id':_0xad9958['transcribeAccountId']}});}})[_0x2929('0x28')](function(_0x44516b){if(!_0x44516b){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x44516b[_0x2929('0x87')]||!_0x44516b[_0x2929('0x88')]){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))]('Cloud\x20Provider\x20not\x20configured');}_0x476478=_0x44516b;return getBucketslist(_0x476478[_0x2929('0x87')],_0x476478[_0x2929('0x88')],_0xad9958['transcribeRegion']);})[_0x2929('0x28')](function(_0x52ead5){if(_0x52ead5&&_0x52ead5[_0x2929('0x89')]){var _0x409693=_['find'](_0x52ead5[_0x2929('0x89')],function(_0x77ab82){return _0x77ab82[_0x2929('0x8a')]===_0xad9958[_0x2929('0x81')];});if(!_0x409693){logger[_0x2929('0x65')](util['format'](_0x2929('0x8b'),_0x13c98a[_0x2929('0x4a')]['id'],_0xad9958[_0x2929('0x81')]));return createBucket(_0x476478[_0x2929('0x87')],_0x476478[_0x2929('0x88')],_0xad9958[_0x2929('0x8c')],_0xad9958['bucket']);}logger['info'](util['format'](_0x2929('0x8d'),_0x13c98a[_0x2929('0x4a')]['id'],_0xad9958[_0x2929('0x81')]));return;}})[_0x2929('0x28')](function(_0x264499){if(_0x3a8732['transcribeStatus']===_0x2929('0x8e')){return transcribe(_0x13c98a[_0x2929('0x4a')]['id'],_0x476478[_0x2929('0x87')],_0x476478['data2'],_0xad9958[_0x2929('0x8c')],_0xad9958[_0x2929('0x81')],_0x3a8732[_0x2929('0x4f')],_0xad9958[_0x2929('0x80')]);}else{logger[_0x2929('0x65')](util[_0x2929('0x31')](_0x2929('0x8f'),_0x13c98a['params']['id']));return{'transcribeStatus':_0x2929('0x90')};}})['then'](function(_0x578952){if(_0x578952){_0x578952['tempSentiment']=_0x13c98a['body']['runSentiment'];return _0x3a8732[_0x2929('0x91')](_0x578952);}})[_0x2929('0x28')](respondWithResult(_0x2b6750,null))['catch'](handleError(_0x2b6750,null));};function writeFile(_0x29843d,_0x114715){return new Promise(function(_0x38dd16,_0x447908){fs[_0x2929('0x92')](_0x114715,_0x29843d,function(_0x4c06e4,_0x46803b){if(_0x4c06e4){return _0x447908(_0x4c06e4);}else{return _0x38dd16(_0x46803b);}});});}exports[_0x2929('0x93')]=function(_0x3b06d8,_0x5ab243,_0x38ac88){return db[_0x2929('0x42')][_0x2929('0x7c')]({'where':{'id':_0x3b06d8['params']['id']}})[_0x2929('0x28')](handleEntityNotFound(_0x5ab243))[_0x2929('0x28')](function(_0x217548){if(_0x217548&&_0x217548[_0x2929('0x94')]){var _0x571456=_0x217548[_0x2929('0x94')];var _0x215505=config[_0x2929('0x95')]+_0x2929('0x96')+_0x217548['id']+_0x2929('0x97');if(fs['existsSync'](_0x215505)){return _0x215505;}return writeFile(_0x571456,_0x215505)[_0x2929('0x28')](function(){return _0x215505;});}else{throw new db['Sequelize'][(_0x2929('0x63'))](_0x2929('0x98'));}})[_0x2929('0x28')](function(_0x4c10d3){return _0x5ab243['download'](_0x4c10d3);})[_0x2929('0x49')](handleError(_0x5ab243));}; \ No newline at end of file +var _0xe9aa=['transcribeStatus','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','.txt','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','model','format','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','keys','includeAll','find','catch','create','body','describe','download','uniqueid','params','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','downloads','sequelize','col','push','$and','Sequelize','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','listBuckets','createBucket','upload','TranscribeService','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','../../components/encryptor','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets'];(function(_0x1232ec,_0x2df4b1){var _0x4483b4=function(_0x39bfff){while(--_0x39bfff){_0x1232ec['push'](_0x1232ec['shift']());}};_0x4483b4(++_0x2df4b1);}(_0xe9aa,0x1c0));var _0xae9a=function(_0x5c3911,_0x5036d7){_0x5c3911=_0x5c3911-0x0;var _0x553db7=_0xe9aa[_0x5c3911];return _0x553db7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae9a('0x0'));var zipdir=require(_0xae9a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae9a('0x2'));var moment=require(_0xae9a('0x3'));var BPromise=require(_0xae9a('0x4'));var Mustache=require('mustache');var util=require(_0xae9a('0x5'));var path=require('path');var sox=require(_0xae9a('0x6'));var csv=require('to-csv');var ejs=require(_0xae9a('0x7'));var fs=require('fs');var fs_extra=require(_0xae9a('0x8'));var _=require(_0xae9a('0x9'));var squel=require(_0xae9a('0xa'));var crypto=require(_0xae9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xae9a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xae9a('0xd'));var Papa=require(_0xae9a('0xe'));var AWS=require(_0xae9a('0xf'));var uuidv4=require('uuid/v4');var Redis=require(_0xae9a('0x10'));var authService=require(_0xae9a('0x11'));var qs=require(_0xae9a('0x12'));var as=require(_0xae9a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xae9a('0x14'));var utils=require(_0xae9a('0x15'));var config=require(_0xae9a('0x16'));var licenseUtil=require(_0xae9a('0x17'));var db=require(_0xae9a('0x18'))['db'];function respondWithStatusCode(_0x27b9e5,_0x4f041c){_0x4f041c=_0x4f041c||0xcc;return function(_0x4f6c04){if(_0x4f6c04){return _0x27b9e5[_0xae9a('0x19')](_0x4f041c);}return _0x27b9e5['status'](_0x4f041c)[_0xae9a('0x1a')]();};}function respondWithResult(_0x35b03e,_0x58058b){_0x58058b=_0x58058b||0xc8;return function(_0x2946b8){if(_0x2946b8){return _0x35b03e[_0xae9a('0x1b')](_0x58058b)['json'](_0x2946b8);}};}function respondWithFilteredResult(_0xf4c77d,_0x677a53){return function(_0x3ed297){if(_0x3ed297){var _0x2138ca=typeof _0x677a53[_0xae9a('0x1c')]==='undefined'&&typeof _0x677a53['limit']===_0xae9a('0x1d');var _0x117215=_0x3ed297[_0xae9a('0x1e')];var _0x5277ef=_0x2138ca?0x0:_0x677a53[_0xae9a('0x1c')];var _0x595ed8=_0x2138ca?_0x3ed297[_0xae9a('0x1e')]:_0x677a53['offset']+_0x677a53[_0xae9a('0x1f')];var _0x403135;if(_0x595ed8>=_0x117215){_0x595ed8=_0x117215;_0x403135=0xc8;}else{_0x403135=0xce;}_0xf4c77d[_0xae9a('0x1b')](_0x403135);return _0xf4c77d[_0xae9a('0x20')](_0xae9a('0x21'),_0x5277ef+'-'+_0x595ed8+'/'+_0x117215)['json'](_0x3ed297);}return null;};}function patchUpdates(_0x4a4fa7){return function(_0x5eaad9){try{jsonpatch[_0xae9a('0x22')](_0x5eaad9,_0x4a4fa7,!![]);}catch(_0x3cf594){return BPromise[_0xae9a('0x23')](_0x3cf594);}return _0x5eaad9[_0xae9a('0x24')]();};}function saveUpdates(_0x3ff137,_0x149996){return function(_0x1c46b3){if(_0x1c46b3){return _0x1c46b3[_0xae9a('0x25')](_0x3ff137)[_0xae9a('0x26')](function(_0x2bb3ea){return _0x2bb3ea;});}return null;};}function removeEntity(_0x26eec2,_0x30dfdc){return function(_0x116f42){if(_0x116f42){return _0x116f42[_0xae9a('0x27')]()[_0xae9a('0x26')](function(){_0x26eec2[_0xae9a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7c0a,_0x331817){return function(_0x18305d){if(!_0x18305d){_0x1c7c0a[_0xae9a('0x19')](0x194);}return _0x18305d;};}function handleError(_0x40018e,_0x33382d){_0x33382d=_0x33382d||0x1f4;return function(_0x4c533d){logger['error'](_0x4c533d[_0xae9a('0x28')]);if(_0x4c533d[_0xae9a('0x29')]){delete _0x4c533d[_0xae9a('0x29')];}_0x40018e[_0xae9a('0x1b')](_0x33382d)[_0xae9a('0x2a')](_0x4c533d);};}exports[_0xae9a('0x2b')]=function(_0x2c2150,_0x1e46fc){var _0x750351={},_0x346d59={},_0x2a26f9={'count':0x0,'rows':[]};var _0x3a0819=_[_0xae9a('0x2c')](db[_0xae9a('0x2d')][_0xae9a('0x2e')],function(_0x81287e){return{'name':_0x81287e[_0xae9a('0x2f')],'type':_0x81287e[_0xae9a('0x30')]['key']};});_0x346d59[_0xae9a('0x31')]=_['differenceBy'](_[_0xae9a('0x2c')](_0x3a0819,_0xae9a('0x29')),[_0xae9a('0x32')]);_0x346d59[_0xae9a('0x33')]=_['keys'](_0x2c2150['query']);_0x346d59[_0xae9a('0x34')]=_['intersection'](_0x346d59[_0xae9a('0x31')],_0x346d59[_0xae9a('0x33')]);_0x750351[_0xae9a('0x35')]=_[_0xae9a('0x36')](_0x346d59['model'],qs[_0xae9a('0x37')](_0x2c2150[_0xae9a('0x33')][_0xae9a('0x37')]));_0x750351[_0xae9a('0x35')]=_0x750351['attributes'][_0xae9a('0x38')]?_0x750351[_0xae9a('0x35')]:_0x346d59[_0xae9a('0x31')];if(!_0x2c2150[_0xae9a('0x33')][_0xae9a('0x39')](_0xae9a('0x3a'))){_0x750351[_0xae9a('0x1f')]=qs[_0xae9a('0x1f')](_0x2c2150[_0xae9a('0x33')][_0xae9a('0x1f')]);_0x750351[_0xae9a('0x1c')]=qs[_0xae9a('0x1c')](_0x2c2150[_0xae9a('0x33')][_0xae9a('0x1c')]);}_0x750351['order']=qs[_0xae9a('0x3b')](_0x2c2150[_0xae9a('0x33')]['sort']);_0x750351[_0xae9a('0x3c')]=qs[_0xae9a('0x34')](_[_0xae9a('0x3d')](_0x2c2150[_0xae9a('0x33')],_0x346d59[_0xae9a('0x34')]),_0x3a0819);if(_0x2c2150[_0xae9a('0x33')][_0xae9a('0x3e')]){_0x750351['where']=_[_0xae9a('0x3f')](_0x750351[_0xae9a('0x3c')],{'$or':_[_0xae9a('0x2c')](_0x3a0819,function(_0x5c6f3c){if(_0x5c6f3c['type']!==_0xae9a('0x40')){var _0x560f68={};_0x560f68[_0x5c6f3c[_0xae9a('0x29')]]={'$like':'%'+_0x2c2150[_0xae9a('0x33')][_0xae9a('0x3e')]+'%'};return _0x560f68;}})});}_0x750351=_[_0xae9a('0x3f')]({},_0x750351,_0x2c2150[_0xae9a('0x41')]);var _0x16442e={'where':_0x750351[_0xae9a('0x3c')]};return db[_0xae9a('0x2d')][_0xae9a('0x1e')](_0x16442e)[_0xae9a('0x26')](function(_0x2ce2bb){_0x2a26f9[_0xae9a('0x1e')]=_0x2ce2bb;if(_0x2c2150['query']['includeAll']){_0x750351[_0xae9a('0x42')]=[{'all':!![]}];}return db[_0xae9a('0x2d')]['findAll'](_0x750351);})['then'](function(_0x1c52c7){_0x2a26f9[_0xae9a('0x43')]=_0x1c52c7;return _0x2a26f9;})['then'](respondWithFilteredResult(_0x1e46fc,_0x750351))['catch'](handleError(_0x1e46fc,null));};exports[_0xae9a('0x44')]=function(_0x574518,_0x1001f7){var _0x318873={'raw':![],'where':{'id':_0x574518['params']['id']}},_0x3ded4b={};_0x3ded4b[_0xae9a('0x31')]=_[_0xae9a('0x45')](db[_0xae9a('0x2d')]['rawAttributes']);_0x3ded4b[_0xae9a('0x33')]=_[_0xae9a('0x45')](_0x574518[_0xae9a('0x33')]);_0x3ded4b['filters']=_[_0xae9a('0x36')](_0x3ded4b[_0xae9a('0x31')],_0x3ded4b[_0xae9a('0x33')]);_0x318873[_0xae9a('0x35')]=_[_0xae9a('0x36')](_0x3ded4b['model'],qs[_0xae9a('0x37')](_0x574518[_0xae9a('0x33')]['fields']));_0x318873['attributes']=_0x318873[_0xae9a('0x35')]['length']?_0x318873[_0xae9a('0x35')]:_0x3ded4b[_0xae9a('0x31')];if(_0x574518[_0xae9a('0x33')][_0xae9a('0x46')]){_0x318873[_0xae9a('0x42')]=[{'all':!![]}];}_0x318873=_['merge']({},_0x318873,_0x574518[_0xae9a('0x41')]);return db[_0xae9a('0x2d')][_0xae9a('0x47')](_0x318873)[_0xae9a('0x26')](handleEntityNotFound(_0x1001f7,null))[_0xae9a('0x26')](respondWithResult(_0x1001f7,null))[_0xae9a('0x48')](handleError(_0x1001f7,null));};exports[_0xae9a('0x49')]=function(_0x1c5d07,_0x5a596c){return db[_0xae9a('0x2d')][_0xae9a('0x49')](_0x1c5d07[_0xae9a('0x4a')],{})[_0xae9a('0x26')](respondWithResult(_0x5a596c,0xc9))[_0xae9a('0x48')](handleError(_0x5a596c,null));};exports[_0xae9a('0x25')]=function(_0x1a1959,_0x58af58){if(_0x1a1959[_0xae9a('0x4a')]['id']){delete _0x1a1959[_0xae9a('0x4a')]['id'];}return db[_0xae9a('0x2d')][_0xae9a('0x47')]({'where':{'id':_0x1a1959['params']['id']}})[_0xae9a('0x26')](handleEntityNotFound(_0x58af58,null))[_0xae9a('0x26')](saveUpdates(_0x1a1959[_0xae9a('0x4a')],null))[_0xae9a('0x26')](respondWithResult(_0x58af58,null))[_0xae9a('0x48')](handleError(_0x58af58,null));};exports[_0xae9a('0x4b')]=function(_0x30cc59,_0x21bdbe){return db[_0xae9a('0x2d')][_0xae9a('0x4b')]()[_0xae9a('0x26')](respondWithResult(_0x21bdbe,null))[_0xae9a('0x48')](handleError(_0x21bdbe,null));};exports[_0xae9a('0x4c')]=function(_0x6605e0,_0x44d133,_0x124d66){var _0x18a696=require('../../components/encryptor');var _0x3a96a0=![];var _0x284a55={};if(_0x6605e0['query'][_0xae9a('0x30')]&&_0x6605e0[_0xae9a('0x33')][_0xae9a('0x30')]===_0xae9a('0x4d')){_0x284a55[_0xae9a('0x4d')]=_0x6605e0[_0xae9a('0x4e')]['id'];}else{_0x284a55['id']=_0x6605e0['params']['id'];}return db[_0xae9a('0x2d')][_0xae9a('0x47')]({'where':_0x284a55,'attributes':['id',_0xae9a('0x4f')],'raw':!![]})[_0xae9a('0x26')](handleEntityNotFound(_0x44d133,null))['then'](function(_0x1f506f){if(_0x1f506f){var _0x835f6c=_0x1f506f[_0xae9a('0x4f')];var _0x741d62=util[_0xae9a('0x32')](_0xae9a('0x50'),_0x835f6c);if(fs[_0xae9a('0x51')](_0x741d62)){_0x3a96a0=!![];return _0x18a696[_0xae9a('0x52')](_0x741d62,_0x835f6c,config[_0xae9a('0x53')][_0xae9a('0x54')])[_0xae9a('0x26')](function(){return _0x1f506f;});}return _0x1f506f;}})[_0xae9a('0x26')](function(_0x453261){if(_0x453261){var _0x2056f8=_0x453261[_0xae9a('0x4f')];if(!fs[_0xae9a('0x51')](_0x2056f8)){throw new db['Sequelize'][(_0xae9a('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x453261[_0xae9a('0x56')]){return _0x44d133[_0xae9a('0x4c')](_0x2056f8,_0x453261[_0xae9a('0x56')]+path[_0xae9a('0x57')](_0x2056f8),function(){if(_0x3a96a0){fs['unlink'](_0x2056f8);}});}else{return _0x44d133[_0xae9a('0x4c')](_0x2056f8,function(_0x1f9181){if(_0x3a96a0){fs[_0xae9a('0x58')](_0x2056f8);}});}}})[_0xae9a('0x48')](function(_0x196844){if(_0x196844[_0xae9a('0x59')]===_0xae9a('0x5a')){_0x44d133[_0xae9a('0x1b')](0x194)[_0xae9a('0x2a')]('Not\x20found');}else{return handleError(_0x44d133,null);}});};exports[_0xae9a('0x5b')]=function(_0x2f4558,_0x47fec6,_0x8042e5){var _0x3cc64a=require('../../components/encryptor');var _0x32f9ef=![];var _0x66c035={'$and':[db[_0xae9a('0x5c')]['where'](db[_0xae9a('0x5c')]['fn']('MD5',db[_0xae9a('0x5c')][_0xae9a('0x5d')](_0xae9a('0x4d'))),_0x2f4558[_0xae9a('0x33')]['token'])]};if(_0x2f4558[_0xae9a('0x33')][_0xae9a('0x30')]&&_0x2f4558['query'][_0xae9a('0x30')]==='uniqueid'){_0x66c035['$and'][_0xae9a('0x5e')]({'uniqueid':_0x2f4558[_0xae9a('0x4e')]['id']});}else{_0x66c035[_0xae9a('0x5f')][_0xae9a('0x5e')]({'id':_0x2f4558[_0xae9a('0x4e')]['id']});}return db['VoiceRecording'][_0xae9a('0x47')]({'where':_0x66c035,'attributes':['id',_0xae9a('0x4f')],'raw':!![]})[_0xae9a('0x26')](handleEntityNotFound(_0x47fec6,null))[_0xae9a('0x26')](function(_0x34222d){if(_0x34222d){var _0x2bbea9=util[_0xae9a('0x32')]('%s.cypher',_0x34222d[_0xae9a('0x4f')]);if(fs[_0xae9a('0x51')](_0x2bbea9)){_0x32f9ef=!![];return _0x3cc64a['decryptFile'](_0x2bbea9,_0x34222d[_0xae9a('0x4f')],config[_0xae9a('0x53')][_0xae9a('0x54')])['then'](function(){return _0x34222d;});}return _0x34222d;}})[_0xae9a('0x26')](function(_0x2d436d){if(_0x2d436d){if(!fs[_0xae9a('0x51')](_0x2d436d[_0xae9a('0x4f')])){throw new db[(_0xae9a('0x60'))][(_0xae9a('0x55'))](_0xae9a('0x5a'));}if(_0x2d436d['filename']){return _0x47fec6[_0xae9a('0x4c')](_0x2d436d[_0xae9a('0x4f')],_0x2d436d['filename']+path[_0xae9a('0x57')](_0x2d436d[_0xae9a('0x4f')]),function(){if(_0x32f9ef){fs[_0xae9a('0x58')](_0x2d436d['value']);}});}else{return _0x47fec6[_0xae9a('0x4c')](_0x2d436d[_0xae9a('0x4f')],function(_0x180ccf){if(_0x32f9ef){fs['unlink'](_0x2d436d[_0xae9a('0x4f')]);}});}}})[_0xae9a('0x48')](handleError(_0x47fec6,null));};exports[_0xae9a('0x27')]=function(_0x836538,_0x38727e){return db[_0xae9a('0x2d')][_0xae9a('0x47')]({'where':{'id':_0x836538[_0xae9a('0x4e')]['id']}})[_0xae9a('0x26')](function(_0x3cb72f){if(_[_0xae9a('0x61')](_0x3cb72f)){throw new ReferenceError(_0xae9a('0x62'));}return _0x3cb72f;})[_0xae9a('0x26')](function(_0x2adb5f){var _0x594e70=_0x2adb5f[_0xae9a('0x4f')];logger[_0xae9a('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x594e70);if(!_[_0xae9a('0x61')](_0x2adb5f[_0xae9a('0x4f')])&&fs[_0xae9a('0x51')](_0x594e70)){logger[_0xae9a('0x63')]('File:\x20\x22'+_0x594e70+_0xae9a('0x64'));fs['unlinkSync'](_0x594e70);}_0x594e70=_0x594e70+_0xae9a('0x65');if(!_[_0xae9a('0x61')](_0x2adb5f[_0xae9a('0x4f')])&&fs[_0xae9a('0x51')](_0x594e70)){logger[_0xae9a('0x63')](_0xae9a('0x66')+_0x594e70+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xae9a('0x67')](_0x594e70);}return _0x2adb5f;})[_0xae9a('0x26')](function(_0x385598){if(!_0x385598)throw new InternalError();return _0x385598['destroy']();})[_0xae9a('0x26')](function(){_0x38727e[_0xae9a('0x1b')](0xcc)[_0xae9a('0x1a')]();})[_0xae9a('0x48')](handleError(_0x38727e,null));};function getBucketslist(_0x32f318,_0x426e28,_0x5085d4){return new Promise(function(_0x274a9f,_0x2d9cf7){var _0x86c009=new AWS['S3']({'accessKeyId':_0x426e28,'secretAccessKey':_0x32f318,'region':_0x5085d4});_0x86c009[_0xae9a('0x68')]({},function(_0x2aa499,_0x2f3f9f){if(_0x2aa499){return _0x2d9cf7(_0x2aa499);}else{return _0x274a9f(_0x2f3f9f);}});});}function createBucket(_0xb32038,_0x324db1,_0x280d11,_0x32fc83){return new Promise(function(_0x32797f,_0x21b68d){var _0x4e606e=new AWS['S3']({'accessKeyId':_0x324db1,'secretAccessKey':_0xb32038,'region':_0x280d11});_0x4e606e[_0xae9a('0x69')]({'Bucket':_0x32fc83},function(_0x27dce6,_0x168038){if(_0x27dce6){return _0x21b68d(_0x27dce6);}else{return _0x32797f(_0x168038);}});});}function uploadFile(_0x3d974c,_0x5d88ec,_0x2e46c3,_0x332ce9,_0x7babef,_0x2ae4c0){return new Promise(function(_0x42e33c,_0x31b05e){var _0x40db49=new AWS['S3']({'accessKeyId':_0x5d88ec,'secretAccessKey':_0x3d974c,'region':_0x2e46c3});_0x40db49[_0xae9a('0x6a')]({'Bucket':_0x332ce9,'Key':_0x7babef,'Body':_0x2ae4c0},function(_0x596975,_0x5aac1a){if(_0x596975){return _0x31b05e(_0x596975);}else{return _0x42e33c(_0x5aac1a);}});});}function startTranscribe(_0xefa2f0,_0x3c85ec,_0x2e4555,_0x2eb36a,_0xcdd52c,_0x407b4c){return new Promise(function(_0x4a8ae8,_0x40ca42){var _0x41706e=new AWS[(_0xae9a('0x6b'))]({'accessKeyId':_0x3c85ec,'secretAccessKey':_0xefa2f0,'region':_0x2e4555});_0x41706e['startTranscriptionJob']({'TranscriptionJobName':_0x2eb36a,'LanguageCode':_0xcdd52c,'Media':{'MediaFileUri':_0x407b4c}},function(_0x2146c0,_0x20cca4){if(_0x2146c0){return _0x40ca42(_0x2146c0);}else{return _0x4a8ae8(_0x20cca4);}});});}function transcribe(_0x426f56,_0x3e248a,_0x4c46f3,_0x4ad1c3,_0x3550b2,_0x41dd25,_0x12cd7c){return new Promise(function(_0x20e6e6,_0x1fec65){var _0x59cb46={};logger[_0xae9a('0x63')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x426f56,_0x3550b2));return uploadFile(_0x3e248a,_0x4c46f3,_0x4ad1c3,_0x3550b2,path[_0xae9a('0x6c')](_0x41dd25),fs['readFileSync'](_0x41dd25))[_0xae9a('0x26')](function(_0x4b0712){logger['info'](util['format'](_0xae9a('0x6d'),_0x426f56,_0x3550b2,_0x4b0712[_0xae9a('0x6e')]));_0x59cb46['bucket']=_0x4b0712[_0xae9a('0x6f')];_0x59cb46[_0xae9a('0x70')]=_0x4b0712[_0xae9a('0x6e')];logger[_0xae9a('0x63')](util[_0xae9a('0x32')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x426f56));return startTranscribe(_0x3e248a,_0x4c46f3,_0x4ad1c3,uuidv4(),_0x12cd7c,_0x4b0712[_0xae9a('0x6e')]);})[_0xae9a('0x26')](function(_0x4e53dd){logger[_0xae9a('0x63')](util[_0xae9a('0x32')](_0xae9a('0x71'),_0x426f56,_0x4e53dd[_0xae9a('0x72')][_0xae9a('0x73')]));_0x59cb46[_0xae9a('0x74')]=_0x4e53dd[_0xae9a('0x72')]['TranscriptionJobName'];_0x59cb46['transcribeStatus']=_0x4e53dd[_0xae9a('0x72')][_0xae9a('0x75')];return _0x20e6e6(_0x59cb46);})[_0xae9a('0x48')](function(_0x222330){return _0x1fec65(_0x222330);});});}exports['runTranscribe']=function(_0x2c9a3a,_0x556a87,_0x4866c0){var _0x57a065;var _0x18ce8d;var _0x3cacfa;var _0x5be597=require(_0xae9a('0x76'));return db[_0xae9a('0x2d')][_0xae9a('0x77')]({'where':{'id':_0x2c9a3a[_0xae9a('0x4e')]['id']}})[_0xae9a('0x26')](function(_0x504299){if(_0x504299){var _0xd6153c=util[_0xae9a('0x32')]('%s.cypher',_0x504299[_0xae9a('0x4f')]);if(fs[_0xae9a('0x51')](_0xd6153c)){cypher=!![];return _0x5be597[_0xae9a('0x52')](_0xd6153c,_0x504299[_0xae9a('0x4f')],config['secrets'][_0xae9a('0x54')])[_0xae9a('0x26')](function(){return _0x504299;});}return _0x504299;}})['then'](function(_0xda247){if(!_0xda247){throw new db['Sequelize'][(_0xae9a('0x55'))](_0xae9a('0x78'));}_0x18ce8d=_0xda247;return db[_0xae9a('0x79')][_0xae9a('0x77')]({'where':{'id':0x1}});})[_0xae9a('0x26')](handleEntityNotFound(_0x556a87,null))['then'](function(_0x4fe455){if(_0x4fe455){_0x57a065=_0x4fe455;if(!_0x57a065['transcribe']||!_0x57a065['transcribeAccountId']||!_0x57a065[_0xae9a('0x7a')]||!_0x57a065['language']||!_0x57a065['bucket']){throw new db[(_0xae9a('0x60'))][(_0xae9a('0x55'))](_0xae9a('0x7b'));}if(_0x2c9a3a[_0xae9a('0x4a')][_0xae9a('0x7c')]&&(!_0x57a065['sentiment']||!_0x57a065[_0xae9a('0x7d')]||!_0x57a065[_0xae9a('0x7e')]||!_0x57a065['language']||!_0x57a065[_0xae9a('0x7f')])){throw new db[(_0xae9a('0x60'))][(_0xae9a('0x55'))](_0xae9a('0x80'));}return db[_0xae9a('0x81')]['findOne']({'where':{'id':_0x57a065[_0xae9a('0x82')]}});}})['then'](function(_0x389d82){if(!_0x389d82){throw new db[(_0xae9a('0x60'))]['ValidationError'](_0xae9a('0x83'));}if(!_0x389d82[_0xae9a('0x84')]||!_0x389d82[_0xae9a('0x85')]){throw new db[(_0xae9a('0x60'))][(_0xae9a('0x55'))](_0xae9a('0x86'));}_0x3cacfa=_0x389d82;return getBucketslist(_0x3cacfa['data1'],_0x3cacfa[_0xae9a('0x85')],_0x57a065[_0xae9a('0x7a')]);})[_0xae9a('0x26')](function(_0x15c702){if(_0x15c702&&_0x15c702[_0xae9a('0x87')]){var _0x131e5d=_['find'](_0x15c702[_0xae9a('0x87')],function(_0x2654d5){return _0x2654d5['Name']===_0x57a065['bucket'];});if(!_0x131e5d){logger[_0xae9a('0x63')](util[_0xae9a('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x2c9a3a[_0xae9a('0x4e')]['id'],_0x57a065[_0xae9a('0x7f')]));return createBucket(_0x3cacfa[_0xae9a('0x84')],_0x3cacfa[_0xae9a('0x85')],_0x57a065[_0xae9a('0x7a')],_0x57a065[_0xae9a('0x7f')]);}logger[_0xae9a('0x63')](util[_0xae9a('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x2c9a3a[_0xae9a('0x4e')]['id'],_0x57a065[_0xae9a('0x7f')]));return;}})[_0xae9a('0x26')](function(_0x5eeac6){if(_0x18ce8d[_0xae9a('0x88')]==='NEW'){return transcribe(_0x2c9a3a[_0xae9a('0x4e')]['id'],_0x3cacfa['data1'],_0x3cacfa[_0xae9a('0x85')],_0x57a065['transcribeRegion'],_0x57a065[_0xae9a('0x7f')],_0x18ce8d[_0xae9a('0x4f')],_0x57a065[_0xae9a('0x89')]);}else{logger[_0xae9a('0x63')](util[_0xae9a('0x32')](_0xae9a('0x8a'),_0x2c9a3a[_0xae9a('0x4e')]['id']));return{'transcribeStatus':_0xae9a('0x8b')};}})['then'](function(_0x457cf0){if(_0x457cf0){_0x457cf0[_0xae9a('0x8c')]=_0x2c9a3a[_0xae9a('0x4a')][_0xae9a('0x7c')];return _0x18ce8d[_0xae9a('0x8d')](_0x457cf0);}})[_0xae9a('0x26')](respondWithResult(_0x556a87,null))[_0xae9a('0x48')](handleError(_0x556a87,null));};function writeFile(_0x5d17f4,_0xdde929){return new Promise(function(_0x107dcf,_0x388c52){fs['writeFile'](_0xdde929,_0x5d17f4,function(_0x2a7e0b,_0x522ff2){if(_0x2a7e0b){return _0x388c52(_0x2a7e0b);}else{return _0x107dcf(_0x522ff2);}});});}exports[_0xae9a('0x8e')]=function(_0x1ae7bd,_0x3718ba,_0x4e7e45){return db['VoiceRecording']['findOne']({'where':{'id':_0x1ae7bd[_0xae9a('0x4e')]['id']}})[_0xae9a('0x26')](handleEntityNotFound(_0x3718ba))[_0xae9a('0x26')](function(_0x421271){if(_0x421271&&_0x421271[_0xae9a('0x8f')]){var _0xd1fa3a=_0x421271[_0xae9a('0x8f')];var _0x4765b7=config[_0xae9a('0x90')]+'/server/files/transcribes/transcribe_'+_0x421271['id']+_0xae9a('0x91');if(fs['existsSync'](_0x4765b7)){return _0x4765b7;}return writeFile(_0xd1fa3a,_0x4765b7)[_0xae9a('0x26')](function(){return _0x4765b7;});}else{throw new db[(_0xae9a('0x60'))][(_0xae9a('0x55'))]('Transcript\x20not\x20available');}})[_0xae9a('0x26')](function(_0x507791){return _0x3718ba[_0xae9a('0x4c')](_0x507791);})[_0xae9a('0x48')](handleError(_0x3718ba));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 8b207b6..8dc0394 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 _0x9f37=['exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','api','request-promise','path','rimraf','./voiceRecording.attributes'];(function(_0x3d51f3,_0x4cf925){var _0x36a199=function(_0x3ba0ed){while(--_0x3ba0ed){_0x3d51f3['push'](_0x3d51f3['shift']());}};_0x36a199(++_0x4cf925);}(_0x9f37,0xd1));var _0x79f3=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x9f37[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var logger=require('../../config/logger')(_0x79f3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x79f3('0x3'));var fs=require('fs');var path=require(_0x79f3('0x4'));var rimraf=require(_0x79f3('0x5'));var config=require('../../config/environment');var attributes=require(_0x79f3('0x6'));module[_0x79f3('0x7')]=function(_0x594d87,_0x5db84b){return _0x594d87[_0x79f3('0x8')](_0x79f3('0x9'),attributes,{'tableName':_0x79f3('0xa'),'paranoid':![],'indexes':[{'name':_0x79f3('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf116=['VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceRecording.attributes','exports','define'];(function(_0xb13538,_0x4d7f26){var _0xb2dd8c=function(_0x56c08a){while(--_0x56c08a){_0xb13538['push'](_0xb13538['shift']());}};_0xb2dd8c(++_0x4d7f26);}(_0xf116,0x16f));var _0x6f11=function(_0xcdac34,_0x43f665){_0xcdac34=_0xcdac34-0x0;var _0x269d23=_0xf116[_0xcdac34];return _0x269d23;};'use strict';var _=require('lodash');var util=require(_0x6f11('0x0'));var logger=require(_0x6f11('0x1'))(_0x6f11('0x2'));var moment=require(_0x6f11('0x3'));var BPromise=require(_0x6f11('0x4'));var rp=require(_0x6f11('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f11('0x6'));var config=require(_0x6f11('0x7'));var attributes=require(_0x6f11('0x8'));module[_0x6f11('0x9')]=function(_0xe6f39,_0x48c0e8){return _0xe6f39[_0x6f11('0xa')](_0x6f11('0xb'),attributes,{'tableName':_0x6f11('0xc'),'paranoid':![],'indexes':[{'name':_0x6f11('0xd'),'fields':[_0x6f11('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 50ea7f5..871db5d 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 _0xba34=['body','options','attributes','limit','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','value','format','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update'];(function(_0x235cea,_0x4c3504){var _0x15ee93=function(_0x5cb350){while(--_0x5cb350){_0x235cea['push'](_0x235cea['shift']());}};_0x15ee93(++_0x4c3504);}(_0xba34,0x119));var _0x4ba3=function(_0x40e3e0,_0x4f2f53){_0x40e3e0=_0x40e3e0-0x0;var _0x51ca7b=_0xba34[_0x40e3e0];return _0x51ca7b;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});}exports[_0x4ba3('0x18')]=function(_0x5ff7ce){var _0x451c92=this;return new Promise(function(_0x556290,_0x2519bb){return db[_0x4ba3('0x19')][_0x4ba3('0x1a')](_0x5ff7ce[_0x4ba3('0x1b')],{'raw':_0x5ff7ce[_0x4ba3('0x1c')]?_0x5ff7ce[_0x4ba3('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ff7ce['options']?_0x5ff7ce[_0x4ba3('0x1c')]['where']||null:null,'attributes':_0x5ff7ce[_0x4ba3('0x1c')]?_0x5ff7ce[_0x4ba3('0x1c')][_0x4ba3('0x1d')]||null:null,'limit':_0x5ff7ce[_0x4ba3('0x1c')]?_0x5ff7ce[_0x4ba3('0x1c')][_0x4ba3('0x1e')]||null:null})['then'](function(_0x143c78){logger[_0x4ba3('0xd')]('UpdateVoiceRecording',_0x5ff7ce);logger[_0x4ba3('0x10')]('UpdateVoiceRecording',_0x5ff7ce,JSON[_0x4ba3('0x12')](_0x143c78));_0x556290(_0x143c78);})[_0x4ba3('0x17')](function(_0x11a917){logger[_0x4ba3('0x13')](_0x4ba3('0x18'),_0x11a917[_0x4ba3('0x15')],_0x5ff7ce);_0x2519bb(_0x451c92[_0x4ba3('0x13')](0x1f4,_0x11a917[_0x4ba3('0x15')]));});});};exports[_0x4ba3('0x1f')]=function(_0x2e67a0){var _0x50c729=this;return new Promise(function(_0x252f37,_0x13c353){var _0x2311ed=require('../../components/encryptor');var _0x10537e;return db[_0x4ba3('0x20')][_0x4ba3('0x21')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x4ba3('0xc')](function(_0x843276){_0x10537e=_0x843276;return db[_0x4ba3('0x19')][_0x4ba3('0x22')](_0x2e67a0['body']);})['then'](function(_0x38ef88){if(_0x10537e[_0x4ba3('0x23')]&&fs[_0x4ba3('0x24')](_0x38ef88[_0x4ba3('0x25')])){var _0x2cb5d5=util[_0x4ba3('0x26')]('%s.cypher',_0x38ef88[_0x4ba3('0x25')]);return _0x2311ed[_0x4ba3('0x27')](_0x38ef88[_0x4ba3('0x25')],_0x2cb5d5,config[_0x4ba3('0x28')][_0x4ba3('0x29')])[_0x4ba3('0xc')](function(){fs[_0x4ba3('0x2a')](_0x38ef88[_0x4ba3('0x25')]);logger[_0x4ba3('0xd')](_0x4ba3('0x2b'));return _0x38ef88;});}return _0x38ef88;})['then'](function(_0x5a453f){logger['info'](_0x4ba3('0x1f'),_0x2e67a0);logger[_0x4ba3('0x10')](_0x4ba3('0x1f'),_0x2e67a0,JSON[_0x4ba3('0x12')](_0x5a453f));_0x252f37(_0x5a453f);})[_0x4ba3('0x17')](function(_0x137f9b){logger[_0x4ba3('0x13')](_0x4ba3('0x1f'),_0x137f9b[_0x4ba3('0x15')],_0x2e67a0);_0x13c353(_0x50c729[_0x4ba3('0x13')](0x1f4,_0x137f9b[_0x4ba3('0x15')]));});});}; \ No newline at end of file +var _0xcaf2=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','recording','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','stringify','catch'];(function(_0x3059d9,_0x119108){var _0x2928d4=function(_0x250580){while(--_0x250580){_0x3059d9['push'](_0x3059d9['shift']());}};_0x2928d4(++_0x119108);}(_0xcaf2,0x8a));var _0x2caf=function(_0x13ecca,_0xfd4f01){_0x13ecca=_0x13ecca-0x0;var _0x17c3b6=_0xcaf2[_0x13ecca];return _0x17c3b6;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}exports['UpdateVoiceRecording']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['update'](_0x4a33fc[_0x2caf('0x15')],{'raw':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc['options'][_0x2caf('0x18')]||null:null,'attributes':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x19')]||null:null,'limit':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x1a')]||null:null})[_0x2caf('0xa')](function(_0x3332b1){logger[_0x2caf('0xb')](_0x2caf('0x1b'),_0x4a33fc);logger['debug'](_0x2caf('0x1b'),_0x4a33fc,JSON[_0x2caf('0x1c')](_0x3332b1));_0x58047b(_0x3332b1);})[_0x2caf('0x1d')](function(_0x401ea2){logger[_0x2caf('0x10')](_0x2caf('0x1b'),_0x401ea2[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x401ea2[_0x2caf('0x12')]));});});};exports[_0x2caf('0x1e')]=function(_0x5ad211){var _0x6a32ac=this;return new Promise(function(_0x325eda,_0xbefce6){var _0x37b08f=require(_0x2caf('0x1f'));var _0x17d3c6;return db[_0x2caf('0x20')][_0x2caf('0x21')]({'attributes':['id',_0x2caf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x2caf('0xa')](function(_0x30da75){_0x17d3c6=_0x30da75;return db[_0x2caf('0x14')][_0x2caf('0x23')](_0x5ad211['body']);})[_0x2caf('0xa')](function(_0xda0ec5){if(_0x17d3c6[_0x2caf('0x22')]&&fs[_0x2caf('0x24')](_0xda0ec5[_0x2caf('0x25')])){var _0x1f52bf=util[_0x2caf('0x26')]('%s.cypher',_0xda0ec5[_0x2caf('0x25')]);return _0x37b08f[_0x2caf('0x27')](_0xda0ec5['value'],_0x1f52bf,config[_0x2caf('0x28')][_0x2caf('0x29')])[_0x2caf('0xa')](function(){fs['unlink'](_0xda0ec5[_0x2caf('0x25')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0xda0ec5;});}return _0xda0ec5;})[_0x2caf('0xa')](function(_0x28b715){logger[_0x2caf('0xb')](_0x2caf('0x1e'),_0x5ad211);logger[_0x2caf('0xe')](_0x2caf('0x1e'),_0x5ad211,JSON[_0x2caf('0x1c')](_0x28b715));_0x325eda(_0x28b715);})[_0x2caf('0x1d')](function(_0x20818e){logger['error'](_0x2caf('0x1e'),_0x20818e[_0x2caf('0x12')],_0x5ad211);_0xbefce6(_0x6a32ac[_0x2caf('0x10')](0x1f4,_0x20818e[_0x2caf('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index e876341..4b7ddcf 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 _0x8784=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','delete'];(function(_0x462069,_0x11c4f4){var _0x27f2de=function(_0x3cf4d5){while(--_0x3cf4d5){_0x462069['push'](_0x462069['shift']());}};_0x27f2de(++_0x11c4f4);}(_0x8784,0xd3));var _0x4878=function(_0x48a96f,_0x530059){_0x48a96f=_0x48a96f-0x0;var _0x3ff3ef=_0x8784[_0x48a96f];return _0x3ff3ef;};'use strict';var multer=require(_0x4878('0x0'));var util=require(_0x4878('0x1'));var path=require(_0x4878('0x2'));var timeout=require(_0x4878('0x3'));var express=require(_0x4878('0x4'));var router=express[_0x4878('0x5')]();var fs_extra=require(_0x4878('0x6'));var auth=require(_0x4878('0x7'));var interaction=require(_0x4878('0x8'));var config=require('../../config/environment');var controller=require(_0x4878('0x9'));router[_0x4878('0xa')]('/',auth[_0x4878('0xb')](),controller[_0x4878('0xc')]);router[_0x4878('0xa')](_0x4878('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x4878('0xa')]('/:id',auth[_0x4878('0xb')](),controller[_0x4878('0xe')]);router[_0x4878('0xf')]('/',auth[_0x4878('0xb')](),controller[_0x4878('0x10')]);router[_0x4878('0x11')]('/:id',auth[_0x4878('0xb')](),controller[_0x4878('0x12')]);router[_0x4878('0x13')]('/:id',auth[_0x4878('0xb')](),controller['destroy']);module[_0x4878('0x14')]=router; \ No newline at end of file +var _0xe29f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2b173c,_0x27d0b2){var _0x51be42=function(_0x5592da){while(--_0x5592da){_0x2b173c['push'](_0x2b173c['shift']());}};_0x51be42(++_0x27d0b2);}(_0xe29f,0xeb));var _0xfe29=function(_0x4d63db,_0x2a8a0e){_0x4d63db=_0x4d63db-0x0;var _0x4a647e=_0xe29f[_0x4d63db];return _0x4a647e;};'use strict';var multer=require(_0xfe29('0x0'));var util=require('util');var path=require(_0xfe29('0x1'));var timeout=require(_0xfe29('0x2'));var express=require(_0xfe29('0x3'));var router=express[_0xfe29('0x4')]();var fs_extra=require(_0xfe29('0x5'));var auth=require(_0xfe29('0x6'));var interaction=require(_0xfe29('0x7'));var config=require(_0xfe29('0x8'));var controller=require('./voiceTransferReport.controller');router[_0xfe29('0x9')]('/',auth['isAuthenticated'](),controller[_0xfe29('0xa')]);router[_0xfe29('0x9')](_0xfe29('0xb'),auth[_0xfe29('0xc')](),controller[_0xfe29('0xd')]);router['get'](_0xfe29('0xe'),auth[_0xfe29('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xfe29('0xf')]);router['put'](_0xfe29('0xe'),auth[_0xfe29('0xc')](),controller[_0xfe29('0x10')]);router[_0xfe29('0x11')](_0xfe29('0xe'),auth['isAuthenticated'](),controller[_0xfe29('0x12')]);module[_0xfe29('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 10e7e13..24daa3d 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 _0xd801=['ENUM','blind','attended','STRING','moment','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd801,0xe8));var _0x1d80=function(_0x5738d7,_0x424f69){_0x5738d7=_0x5738d7-0x0;var _0x19dd9c=_0xd801[_0x5738d7];return _0x19dd9c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1d80('0x0'));module[_0x1d80('0x1')]={'type':{'type':Sequelize[_0x1d80('0x2')](_0x1d80('0x3'),_0x1d80('0x4'))},'result':{'type':Sequelize[_0x1d80('0x5')]},'transfererchannel':{'type':Sequelize[_0x1d80('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x1d80('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1d80('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x1d80('0x5')]},'transferercontext':{'type':Sequelize[_0x1d80('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x1d80('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x1d80('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1d80('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1d80('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x1d80('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x1d80('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x1d80('0x5')]}}; \ No newline at end of file +var _0xcbfa=['exports','ENUM','blind','attended','STRING','Yes','sequelize'];(function(_0xdb409b,_0x18e328){var _0x5a2bd9=function(_0x18ffa0){while(--_0x18ffa0){_0xdb409b['push'](_0xdb409b['shift']());}};_0x5a2bd9(++_0x18e328);}(_0xcbfa,0x172));var _0xacbf=function(_0x567011,_0x273172){_0x567011=_0x567011-0x0;var _0x50ac02=_0xcbfa[_0x567011];return _0x50ac02;};'use strict';var Sequelize=require(_0xacbf('0x0'));var moment=require('moment');module[_0xacbf('0x1')]={'type':{'type':Sequelize[_0xacbf('0x2')](_0xacbf('0x3'),_0xacbf('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xacbf('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xacbf('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xacbf('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xacbf('0x5')]},'transferercontext':{'type':Sequelize[_0xacbf('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xacbf('0x5')]},'transfereechannel':{'type':Sequelize[_0xacbf('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xacbf('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xacbf('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xacbf('0x5')]},'transfereecontext':{'type':Sequelize[_0xacbf('0x5')]},'transfereeexten':{'type':Sequelize[_0xacbf('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xacbf('0x5')]},'isexternal':{'type':Sequelize[_0xacbf('0x2')](_0xacbf('0x6'),'No')},'context':{'type':Sequelize[_0xacbf('0x5')]},'extension':{'type':Sequelize[_0xacbf('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index d6a4dae..216f817 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 _0x2931=['jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x2931,0x110));var _0x1293=function(_0x50be1c,_0x494b89){_0x50be1c=_0x50be1c-0x0;var _0x4e2133=_0x2931[_0x50be1c];return _0x4e2133;};'use strict';var emlformat=require(_0x1293('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1293('0x1'));var jsonpatch=require(_0x1293('0x2'));var rp=require(_0x1293('0x3'));var moment=require(_0x1293('0x4'));var BPromise=require(_0x1293('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1293('0x6'));var ejs=require(_0x1293('0x7'));var fs=require('fs');var fs_extra=require(_0x1293('0x8'));var _=require(_0x1293('0x9'));var squel=require(_0x1293('0xa'));var crypto=require(_0x1293('0xb'));var jsforce=require(_0x1293('0xc'));var deskjs=require(_0x1293('0xd'));var toCsv=require(_0x1293('0x6'));var querystring=require(_0x1293('0xe'));var Papa=require(_0x1293('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1293('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1293('0x11'))(_0x1293('0x12'));var utils=require('../../config/utils');var config=require(_0x1293('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1293('0x14'))['db'];function respondWithStatusCode(_0x55fd35,_0x2c98e7){_0x2c98e7=_0x2c98e7||0xcc;return function(_0x1a08dd){if(_0x1a08dd){return _0x55fd35[_0x1293('0x15')](_0x2c98e7);}return _0x55fd35[_0x1293('0x16')](_0x2c98e7)[_0x1293('0x17')]();};}function respondWithResult(_0x5b0569,_0x32d163){_0x32d163=_0x32d163||0xc8;return function(_0x38c039){if(_0x38c039){return _0x5b0569['status'](_0x32d163)[_0x1293('0x18')](_0x38c039);}};}function respondWithFilteredResult(_0x376ef0,_0x46cfb4){return function(_0xb168bb){if(_0xb168bb){var _0x11deb8=typeof _0x46cfb4[_0x1293('0x19')]===_0x1293('0x1a')&&typeof _0x46cfb4['limit']==='undefined';var _0x14f9bb=_0xb168bb[_0x1293('0x1b')];var _0x2a4e18=_0x11deb8?0x0:_0x46cfb4['offset'];var _0x26b216=_0x11deb8?_0xb168bb[_0x1293('0x1b')]:_0x46cfb4[_0x1293('0x19')]+_0x46cfb4[_0x1293('0x1c')];var _0x5a2431;if(_0x26b216>=_0x14f9bb){_0x26b216=_0x14f9bb;_0x5a2431=0xc8;}else{_0x5a2431=0xce;}_0x376ef0[_0x1293('0x16')](_0x5a2431);return _0x376ef0[_0x1293('0x1d')]('Content-Range',_0x2a4e18+'-'+_0x26b216+'/'+_0x14f9bb)[_0x1293('0x18')](_0xb168bb);}return null;};}function patchUpdates(_0x58d872){return function(_0x4b6a24){try{jsonpatch['apply'](_0x4b6a24,_0x58d872,!![]);}catch(_0xb0a0cf){return BPromise[_0x1293('0x1e')](_0xb0a0cf);}return _0x4b6a24[_0x1293('0x1f')]();};}function saveUpdates(_0x38d20d,_0x403e07){return function(_0x54c983){if(_0x54c983){return _0x54c983[_0x1293('0x20')](_0x38d20d)['then'](function(_0x58224a){return _0x58224a;});}return null;};}function removeEntity(_0x4479cb,_0x3ea643){return function(_0x93f032){if(_0x93f032){return _0x93f032[_0x1293('0x21')]()[_0x1293('0x22')](function(){_0x4479cb['status'](0xcc)[_0x1293('0x17')]();});}};}function handleEntityNotFound(_0x29383a,_0x19ba71){return function(_0x16a18b){if(!_0x16a18b){_0x29383a[_0x1293('0x15')](0x194);}return _0x16a18b;};}function handleError(_0x281118,_0x4b462f){_0x4b462f=_0x4b462f||0x1f4;return function(_0x21b7d3){logger[_0x1293('0x23')](_0x21b7d3[_0x1293('0x24')]);if(_0x21b7d3[_0x1293('0x25')]){delete _0x21b7d3[_0x1293('0x25')];}_0x281118[_0x1293('0x16')](_0x4b462f)[_0x1293('0x26')](_0x21b7d3);};}exports['index']=function(_0x5c80be,_0x258253){var _0xe6a9a={},_0x30c879={},_0x72c1d1={'count':0x0,'rows':[]};var _0x2f1b34=_[_0x1293('0x27')](db[_0x1293('0x28')][_0x1293('0x29')],function(_0x1f0220){return{'name':_0x1f0220[_0x1293('0x2a')],'type':_0x1f0220['type'][_0x1293('0x2b')]};});_0x30c879[_0x1293('0x2c')]=_[_0x1293('0x27')](_0x2f1b34,_0x1293('0x25'));_0x30c879[_0x1293('0x2d')]=_[_0x1293('0x2e')](_0x5c80be[_0x1293('0x2d')]);_0x30c879['filters']=_[_0x1293('0x2f')](_0x30c879['model'],_0x30c879[_0x1293('0x2d')]);_0xe6a9a[_0x1293('0x30')]=_[_0x1293('0x2f')](_0x30c879['model'],qs[_0x1293('0x31')](_0x5c80be[_0x1293('0x2d')][_0x1293('0x31')]));_0xe6a9a[_0x1293('0x30')]=_0xe6a9a[_0x1293('0x30')][_0x1293('0x32')]?_0xe6a9a[_0x1293('0x30')]:_0x30c879[_0x1293('0x2c')];if(!_0x5c80be['query'][_0x1293('0x33')](_0x1293('0x34'))){_0xe6a9a[_0x1293('0x1c')]=qs[_0x1293('0x1c')](_0x5c80be[_0x1293('0x2d')][_0x1293('0x1c')]);_0xe6a9a['offset']=qs[_0x1293('0x19')](_0x5c80be[_0x1293('0x2d')]['offset']);}_0xe6a9a[_0x1293('0x35')]=qs[_0x1293('0x36')](_0x5c80be[_0x1293('0x2d')][_0x1293('0x36')]);_0xe6a9a[_0x1293('0x37')]=qs['filters'](_['pick'](_0x5c80be['query'],_0x30c879[_0x1293('0x38')]),_0x2f1b34);if(_0x5c80be[_0x1293('0x2d')]['filter']){_0xe6a9a[_0x1293('0x37')]=_[_0x1293('0x39')](_0xe6a9a[_0x1293('0x37')],{'$or':_['map'](_0x2f1b34,function(_0x2e33ed){if(_0x2e33ed['type']!==_0x1293('0x3a')){var _0x3ed4a9={};_0x3ed4a9[_0x2e33ed[_0x1293('0x25')]]={'$like':'%'+_0x5c80be[_0x1293('0x2d')]['filter']+'%'};return _0x3ed4a9;}})});}_0xe6a9a=_['merge']({},_0xe6a9a,_0x5c80be[_0x1293('0x3b')]);var _0x3b88e6={'where':_0xe6a9a[_0x1293('0x37')]};return db[_0x1293('0x28')][_0x1293('0x1b')](_0x3b88e6)['then'](function(_0x218738){_0x72c1d1[_0x1293('0x1b')]=_0x218738;if(_0x5c80be[_0x1293('0x2d')][_0x1293('0x3c')]){_0xe6a9a[_0x1293('0x3d')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x1293('0x3e')](_0xe6a9a);})['then'](function(_0xf6fe80){_0x72c1d1[_0x1293('0x3f')]=_0xf6fe80;return _0x72c1d1;})['then'](respondWithFilteredResult(_0x258253,_0xe6a9a))[_0x1293('0x40')](handleError(_0x258253,null));};exports[_0x1293('0x41')]=function(_0xa1c1df,_0x456ef5){var _0x19dcf2={'raw':!![],'where':{'id':_0xa1c1df[_0x1293('0x42')]['id']}},_0x435b5f={};_0x435b5f['model']=_[_0x1293('0x2e')](db['VoiceTransferReport']['rawAttributes']);_0x435b5f[_0x1293('0x2d')]=_[_0x1293('0x2e')](_0xa1c1df['query']);_0x435b5f['filters']=_[_0x1293('0x2f')](_0x435b5f['model'],_0x435b5f[_0x1293('0x2d')]);_0x19dcf2[_0x1293('0x30')]=_['intersection'](_0x435b5f[_0x1293('0x2c')],qs[_0x1293('0x31')](_0xa1c1df[_0x1293('0x2d')][_0x1293('0x31')]));_0x19dcf2['attributes']=_0x19dcf2[_0x1293('0x30')][_0x1293('0x32')]?_0x19dcf2[_0x1293('0x30')]:_0x435b5f[_0x1293('0x2c')];if(_0xa1c1df['query'][_0x1293('0x3c')]){_0x19dcf2[_0x1293('0x3d')]=[{'all':!![]}];}_0x19dcf2=_[_0x1293('0x39')]({},_0x19dcf2,_0xa1c1df[_0x1293('0x3b')]);return db[_0x1293('0x28')][_0x1293('0x43')](_0x19dcf2)[_0x1293('0x22')](handleEntityNotFound(_0x456ef5,null))[_0x1293('0x22')](respondWithResult(_0x456ef5,null))['catch'](handleError(_0x456ef5,null));};exports[_0x1293('0x44')]=function(_0x3a2454,_0x445d90){return db[_0x1293('0x28')][_0x1293('0x44')](_0x3a2454['body'],{})[_0x1293('0x22')](respondWithResult(_0x445d90,0xc9))[_0x1293('0x40')](handleError(_0x445d90,null));};exports[_0x1293('0x20')]=function(_0x5479c1,_0x22ea67){if(_0x5479c1[_0x1293('0x45')]['id']){delete _0x5479c1['body']['id'];}return db[_0x1293('0x28')][_0x1293('0x43')]({'where':{'id':_0x5479c1[_0x1293('0x42')]['id']}})[_0x1293('0x22')](handleEntityNotFound(_0x22ea67,null))[_0x1293('0x22')](saveUpdates(_0x5479c1[_0x1293('0x45')],null))['then'](respondWithResult(_0x22ea67,null))['catch'](handleError(_0x22ea67,null));};exports[_0x1293('0x21')]=function(_0x2f6f75,_0x6f8d8){return db['VoiceTransferReport'][_0x1293('0x43')]({'where':{'id':_0x2f6f75[_0x1293('0x42')]['id']}})[_0x1293('0x22')](handleEntityNotFound(_0x6f8d8,null))[_0x1293('0x22')](removeEntity(_0x6f8d8,null))[_0x1293('0x40')](handleError(_0x6f8d8,null));};exports[_0x1293('0x46')]=function(_0x35073a,_0x2046f1){return db[_0x1293('0x28')][_0x1293('0x46')]()[_0x1293('0x22')](respondWithResult(_0x2046f1,null))['catch'](handleError(_0x2046f1,null));}; \ No newline at end of file +var _0xc35e=['filter','where','merge','type','options','VoiceTransferReport','include','findAll','then','rows','includeAll','find','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','end','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4685c6,_0x4d9867){var _0x32934f=function(_0x11e7dd){while(--_0x11e7dd){_0x4685c6['push'](_0x4685c6['shift']());}};_0x32934f(++_0x4d9867);}(_0xc35e,0x18e));var _0xec35=function(_0x5a2655,_0x3e36c3){_0x5a2655=_0x5a2655-0x0;var _0x4ddb50=_0xc35e[_0x5a2655];return _0x4ddb50;};'use strict';var emlformat=require(_0xec35('0x0'));var rimraf=require(_0xec35('0x1'));var zipdir=require(_0xec35('0x2'));var jsonpatch=require(_0xec35('0x3'));var rp=require('request-promise');var moment=require(_0xec35('0x4'));var BPromise=require(_0xec35('0x5'));var Mustache=require('mustache');var util=require(_0xec35('0x6'));var path=require(_0xec35('0x7'));var sox=require(_0xec35('0x8'));var csv=require(_0xec35('0x9'));var ejs=require(_0xec35('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec35('0xb'));var squel=require('squel');var crypto=require(_0xec35('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xec35('0xd'));var toCsv=require(_0xec35('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xec35('0xe'));var authService=require(_0xec35('0xf'));var qs=require(_0xec35('0x10'));var as=require(_0xec35('0x11'));var hardwareService=require(_0xec35('0x12'));var logger=require(_0xec35('0x13'))(_0xec35('0x14'));var utils=require(_0xec35('0x15'));var config=require(_0xec35('0x16'));var licenseUtil=require(_0xec35('0x17'));var db=require(_0xec35('0x18'))['db'];function respondWithStatusCode(_0x21873b,_0x51fb90){_0x51fb90=_0x51fb90||0xcc;return function(_0x483b7b){if(_0x483b7b){return _0x21873b[_0xec35('0x19')](_0x51fb90);}return _0x21873b[_0xec35('0x1a')](_0x51fb90)['end']();};}function respondWithResult(_0x50da4d,_0x4f615d){_0x4f615d=_0x4f615d||0xc8;return function(_0x5802c9){if(_0x5802c9){return _0x50da4d['status'](_0x4f615d)[_0xec35('0x1b')](_0x5802c9);}};}function respondWithFilteredResult(_0x21f6b4,_0x153c07){return function(_0xf40aad){if(_0xf40aad){var _0x1c8f7f=typeof _0x153c07[_0xec35('0x1c')]===_0xec35('0x1d')&&typeof _0x153c07[_0xec35('0x1e')]===_0xec35('0x1d');var _0x437017=_0xf40aad[_0xec35('0x1f')];var _0x3fbd3a=_0x1c8f7f?0x0:_0x153c07[_0xec35('0x1c')];var _0x5bee1c=_0x1c8f7f?_0xf40aad[_0xec35('0x1f')]:_0x153c07[_0xec35('0x1c')]+_0x153c07[_0xec35('0x1e')];var _0xd4c7c9;if(_0x5bee1c>=_0x437017){_0x5bee1c=_0x437017;_0xd4c7c9=0xc8;}else{_0xd4c7c9=0xce;}_0x21f6b4[_0xec35('0x1a')](_0xd4c7c9);return _0x21f6b4['set'](_0xec35('0x20'),_0x3fbd3a+'-'+_0x5bee1c+'/'+_0x437017)[_0xec35('0x1b')](_0xf40aad);}return null;};}function patchUpdates(_0x2caa2e){return function(_0x297bdf){try{jsonpatch[_0xec35('0x21')](_0x297bdf,_0x2caa2e,!![]);}catch(_0xbfa0a7){return BPromise[_0xec35('0x22')](_0xbfa0a7);}return _0x297bdf[_0xec35('0x23')]();};}function saveUpdates(_0x543c45,_0x47f378){return function(_0x31274d){if(_0x31274d){return _0x31274d[_0xec35('0x24')](_0x543c45)['then'](function(_0x3caa47){return _0x3caa47;});}return null;};}function removeEntity(_0x121d8f,_0x5ac682){return function(_0x55d6bb){if(_0x55d6bb){return _0x55d6bb['destroy']()['then'](function(){_0x121d8f[_0xec35('0x1a')](0xcc)[_0xec35('0x25')]();});}};}function handleEntityNotFound(_0x19b9aa,_0x3693f2){return function(_0x426e80){if(!_0x426e80){_0x19b9aa[_0xec35('0x19')](0x194);}return _0x426e80;};}function handleError(_0x3c915f,_0x4d48d2){_0x4d48d2=_0x4d48d2||0x1f4;return function(_0x2a4880){logger[_0xec35('0x26')](_0x2a4880[_0xec35('0x27')]);if(_0x2a4880['name']){delete _0x2a4880[_0xec35('0x28')];}_0x3c915f[_0xec35('0x1a')](_0x4d48d2)['send'](_0x2a4880);};}exports[_0xec35('0x29')]=function(_0x4759a0,_0x710668){var _0x5e7957={},_0x4ae4c4={},_0x463a07={'count':0x0,'rows':[]};var _0x100c06=_[_0xec35('0x2a')](db['VoiceTransferReport'][_0xec35('0x2b')],function(_0x38adb7){return{'name':_0x38adb7[_0xec35('0x2c')],'type':_0x38adb7['type'][_0xec35('0x2d')]};});_0x4ae4c4[_0xec35('0x2e')]=_[_0xec35('0x2a')](_0x100c06,'name');_0x4ae4c4[_0xec35('0x2f')]=_[_0xec35('0x30')](_0x4759a0['query']);_0x4ae4c4[_0xec35('0x31')]=_[_0xec35('0x32')](_0x4ae4c4[_0xec35('0x2e')],_0x4ae4c4[_0xec35('0x2f')]);_0x5e7957[_0xec35('0x33')]=_[_0xec35('0x32')](_0x4ae4c4[_0xec35('0x2e')],qs['fields'](_0x4759a0[_0xec35('0x2f')][_0xec35('0x34')]));_0x5e7957[_0xec35('0x33')]=_0x5e7957[_0xec35('0x33')][_0xec35('0x35')]?_0x5e7957[_0xec35('0x33')]:_0x4ae4c4[_0xec35('0x2e')];if(!_0x4759a0[_0xec35('0x2f')][_0xec35('0x36')](_0xec35('0x37'))){_0x5e7957[_0xec35('0x1e')]=qs[_0xec35('0x1e')](_0x4759a0[_0xec35('0x2f')]['limit']);_0x5e7957['offset']=qs[_0xec35('0x1c')](_0x4759a0['query'][_0xec35('0x1c')]);}_0x5e7957[_0xec35('0x38')]=qs[_0xec35('0x39')](_0x4759a0[_0xec35('0x2f')][_0xec35('0x39')]);_0x5e7957['where']=qs[_0xec35('0x31')](_['pick'](_0x4759a0['query'],_0x4ae4c4[_0xec35('0x31')]),_0x100c06);if(_0x4759a0[_0xec35('0x2f')][_0xec35('0x3a')]){_0x5e7957[_0xec35('0x3b')]=_[_0xec35('0x3c')](_0x5e7957[_0xec35('0x3b')],{'$or':_['map'](_0x100c06,function(_0x5e2207){if(_0x5e2207[_0xec35('0x3d')]!=='VIRTUAL'){var _0x36e2dd={};_0x36e2dd[_0x5e2207[_0xec35('0x28')]]={'$like':'%'+_0x4759a0[_0xec35('0x2f')][_0xec35('0x3a')]+'%'};return _0x36e2dd;}})});}_0x5e7957=_['merge']({},_0x5e7957,_0x4759a0[_0xec35('0x3e')]);var _0x40a6eb={'where':_0x5e7957[_0xec35('0x3b')]};return db[_0xec35('0x3f')][_0xec35('0x1f')](_0x40a6eb)['then'](function(_0x58893d){_0x463a07[_0xec35('0x1f')]=_0x58893d;if(_0x4759a0[_0xec35('0x2f')]['includeAll']){_0x5e7957[_0xec35('0x40')]=[{'all':!![]}];}return db[_0xec35('0x3f')][_0xec35('0x41')](_0x5e7957);})[_0xec35('0x42')](function(_0x3fea57){_0x463a07[_0xec35('0x43')]=_0x3fea57;return _0x463a07;})['then'](respondWithFilteredResult(_0x710668,_0x5e7957))['catch'](handleError(_0x710668,null));};exports['show']=function(_0x1f9960,_0xdacf7f){var _0x4184de={'raw':!![],'where':{'id':_0x1f9960['params']['id']}},_0x23a3c4={};_0x23a3c4[_0xec35('0x2e')]=_[_0xec35('0x30')](db[_0xec35('0x3f')][_0xec35('0x2b')]);_0x23a3c4['query']=_[_0xec35('0x30')](_0x1f9960[_0xec35('0x2f')]);_0x23a3c4[_0xec35('0x31')]=_['intersection'](_0x23a3c4[_0xec35('0x2e')],_0x23a3c4['query']);_0x4184de[_0xec35('0x33')]=_[_0xec35('0x32')](_0x23a3c4[_0xec35('0x2e')],qs[_0xec35('0x34')](_0x1f9960[_0xec35('0x2f')][_0xec35('0x34')]));_0x4184de[_0xec35('0x33')]=_0x4184de[_0xec35('0x33')][_0xec35('0x35')]?_0x4184de[_0xec35('0x33')]:_0x23a3c4[_0xec35('0x2e')];if(_0x1f9960[_0xec35('0x2f')][_0xec35('0x44')]){_0x4184de['include']=[{'all':!![]}];}_0x4184de=_[_0xec35('0x3c')]({},_0x4184de,_0x1f9960['options']);return db[_0xec35('0x3f')][_0xec35('0x45')](_0x4184de)[_0xec35('0x42')](handleEntityNotFound(_0xdacf7f,null))[_0xec35('0x42')](respondWithResult(_0xdacf7f,null))[_0xec35('0x46')](handleError(_0xdacf7f,null));};exports['create']=function(_0x4d293f,_0x1635af){return db[_0xec35('0x3f')][_0xec35('0x47')](_0x4d293f[_0xec35('0x48')],{})[_0xec35('0x42')](respondWithResult(_0x1635af,0xc9))[_0xec35('0x46')](handleError(_0x1635af,null));};exports[_0xec35('0x24')]=function(_0x12735b,_0xa16971){if(_0x12735b[_0xec35('0x48')]['id']){delete _0x12735b[_0xec35('0x48')]['id'];}return db[_0xec35('0x3f')][_0xec35('0x45')]({'where':{'id':_0x12735b[_0xec35('0x49')]['id']}})[_0xec35('0x42')](handleEntityNotFound(_0xa16971,null))[_0xec35('0x42')](saveUpdates(_0x12735b[_0xec35('0x48')],null))['then'](respondWithResult(_0xa16971,null))['catch'](handleError(_0xa16971,null));};exports[_0xec35('0x4a')]=function(_0x594fee,_0x13d147){return db['VoiceTransferReport'][_0xec35('0x45')]({'where':{'id':_0x594fee[_0xec35('0x49')]['id']}})['then'](handleEntityNotFound(_0x13d147,null))[_0xec35('0x42')](removeEntity(_0x13d147,null))['catch'](handleError(_0x13d147,null));};exports[_0xec35('0x4b')]=function(_0x2037cc,_0x368f3c){return db[_0xec35('0x3f')][_0xec35('0x4b')]()[_0xec35('0x42')](respondWithResult(_0x368f3c,null))[_0xec35('0x46')](handleError(_0x368f3c,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 72a1b7b..c12dce2 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 _0xe143=['rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','bluebird'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xe143,0x1d2));var _0x3e14=function(_0x33f5b3,_0x4a8e4f){_0x33f5b3=_0x33f5b3-0x0;var _0x40597c=_0xe143[_0x33f5b3];return _0x40597c;};'use strict';var _=require('lodash');var util=require(_0x3e14('0x0'));var logger=require(_0x3e14('0x1'))(_0x3e14('0x2'));var moment=require('moment');var BPromise=require(_0x3e14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3e14('0x4'));var config=require(_0x3e14('0x5'));var attributes=require(_0x3e14('0x6'));module['exports']=function(_0x36969c,_0x239492){return _0x36969c[_0x3e14('0x7')](_0x3e14('0x8'),attributes,{'tableName':_0x3e14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd603=['rimraf','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger','api','request-promise'];(function(_0x36d04b,_0x386d0d){var _0x1a11f4=function(_0xcc0a49){while(--_0xcc0a49){_0x36d04b['push'](_0x36d04b['shift']());}};_0x1a11f4(++_0x386d0d);}(_0xd603,0x19f));var _0x3d60=function(_0x244862,_0x3da79e){_0x244862=_0x244862-0x0;var _0x2bce23=_0xd603[_0x244862];return _0x2bce23;};'use strict';var _=require(_0x3d60('0x0'));var util=require(_0x3d60('0x1'));var logger=require(_0x3d60('0x2'))(_0x3d60('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3d60('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d60('0x5'));var config=require('../../config/environment');var attributes=require(_0x3d60('0x6'));module[_0x3d60('0x7')]=function(_0x3ef253,_0x21252c){return _0x3ef253[_0x3d60('0x8')](_0x3d60('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 50e79d8..eaa6612 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 _0xe766=['info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x53348c,_0x21ede1){var _0x35b11c=function(_0x17bc41){while(--_0x17bc41){_0x53348c['push'](_0x53348c['shift']());}};_0x35b11c(++_0x21ede1);}(_0xe766,0x14f));var _0x6e76=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0xe766[_0x552fce];return _0x3e27a2;};'use strict';var _=require('lodash');var util=require(_0x6e76('0x0'));var moment=require(_0x6e76('0x1'));var BPromise=require('bluebird');var rs=require(_0x6e76('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e76('0x3'))['db'];var utils=require(_0x6e76('0x4'));var logger=require(_0x6e76('0x5'))(_0x6e76('0x6'));var config=require(_0x6e76('0x7'));var jayson=require(_0x6e76('0x8'));var client=jayson[_0x6e76('0x9')][_0x6e76('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53352c,_0x480aca,_0x2ab3a0){return new BPromise(function(_0x3993b4,_0xf58bfe){return client[_0x6e76('0xb')](_0x53352c,_0x2ab3a0)[_0x6e76('0xc')](function(_0x1b94f8){logger[_0x6e76('0xd')](_0x6e76('0xe'),_0x480aca,_0x6e76('0xf'));logger[_0x6e76('0x10')](_0x6e76('0x11'),_0x480aca,'request\x20sent',JSON[_0x6e76('0x12')](_0x1b94f8));if(_0x1b94f8['error']){if(_0x1b94f8['error'][_0x6e76('0x13')]===0x1f4){logger[_0x6e76('0x14')](_0x6e76('0xe'),_0x480aca,_0x1b94f8[_0x6e76('0x14')][_0x6e76('0x15')]);return _0xf58bfe(_0x1b94f8['error']['message']);}logger[_0x6e76('0x14')](_0x6e76('0xe'),_0x480aca,_0x1b94f8[_0x6e76('0x14')]['message']);return _0x3993b4(_0x1b94f8[_0x6e76('0x14')][_0x6e76('0x15')]);}else{logger[_0x6e76('0xd')](_0x6e76('0xe'),_0x480aca,_0x6e76('0xf'));_0x3993b4(_0x1b94f8['result'][_0x6e76('0x15')]);}})['catch'](function(_0x2a9481){logger[_0x6e76('0x14')](_0x6e76('0xe'),_0x480aca,_0x2a9481);_0xf58bfe(_0x2a9481);});});}exports[_0x6e76('0x16')]=function(_0x54977a){var _0xb5a350=this;return new Promise(function(_0xd6a59e,_0x3db4a1){return db[_0x6e76('0x17')][_0x6e76('0x18')](_0x54977a[_0x6e76('0x19')],{'raw':_0x54977a[_0x6e76('0x1a')]?_0x54977a[_0x6e76('0x1a')][_0x6e76('0x1b')]===undefined?!![]:![]:!![]})[_0x6e76('0xc')](function(_0x418552){logger[_0x6e76('0xd')](_0x6e76('0x16'),_0x54977a);logger[_0x6e76('0x10')](_0x6e76('0x16'),_0x54977a,JSON['stringify'](_0x418552));_0xd6a59e(_0x418552);})[_0x6e76('0x1c')](function(_0x561026){logger[_0x6e76('0x14')](_0x6e76('0x16'),_0x561026[_0x6e76('0x15')],_0x54977a);_0x3db4a1(_0xb5a350[_0x6e76('0x14')](0x1f4,_0x561026[_0x6e76('0x15')]));});});}; \ No newline at end of file +var _0xb8ec=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','VoiceTransferReport,\x20%s,\x20%s','result','catch','CreateVoiceTransferReport','body','options','raw','util'];(function(_0x1e7f4d,_0x20acaa){var _0x5f0fd9=function(_0x4dbbf4){while(--_0x4dbbf4){_0x1e7f4d['push'](_0x1e7f4d['shift']());}};_0x5f0fd9(++_0x20acaa);}(_0xb8ec,0x95));var _0xcb8e=function(_0x390966,_0x3e06b7){_0x390966=_0x390966-0x0;var _0x4ae1ec=_0xb8ec[_0x390966];return _0x4ae1ec;};'use strict';var _=require('lodash');var util=require(_0xcb8e('0x0'));var moment=require(_0xcb8e('0x1'));var BPromise=require(_0xcb8e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb8e('0x3'));var db=require(_0xcb8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb8e('0x5'))(_0xcb8e('0x6'));var config=require(_0xcb8e('0x7'));var jayson=require(_0xcb8e('0x8'));var client=jayson[_0xcb8e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x181d73,_0x216b51,_0x2c283a){return new BPromise(function(_0x3ba6ed,_0x5471ff){return client['request'](_0x181d73,_0x2c283a)[_0xcb8e('0xa')](function(_0x501daf){logger[_0xcb8e('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x216b51,_0xcb8e('0xc'));logger[_0xcb8e('0xd')](_0xcb8e('0xe'),_0x216b51,_0xcb8e('0xc'),JSON['stringify'](_0x501daf));if(_0x501daf[_0xcb8e('0xf')]){if(_0x501daf['error'][_0xcb8e('0x10')]===0x1f4){logger[_0xcb8e('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x216b51,_0x501daf[_0xcb8e('0xf')][_0xcb8e('0x11')]);return _0x5471ff(_0x501daf[_0xcb8e('0xf')][_0xcb8e('0x11')]);}logger[_0xcb8e('0xf')](_0xcb8e('0x12'),_0x216b51,_0x501daf['error']['message']);return _0x3ba6ed(_0x501daf[_0xcb8e('0xf')][_0xcb8e('0x11')]);}else{logger[_0xcb8e('0xb')](_0xcb8e('0x12'),_0x216b51,_0xcb8e('0xc'));_0x3ba6ed(_0x501daf[_0xcb8e('0x13')][_0xcb8e('0x11')]);}})[_0xcb8e('0x14')](function(_0x2727e1){logger['error'](_0xcb8e('0x12'),_0x216b51,_0x2727e1);_0x5471ff(_0x2727e1);});});}exports[_0xcb8e('0x15')]=function(_0x3ba064){var _0x44c26c=this;return new Promise(function(_0x5867ee,_0x58d422){return db['VoiceTransferReport']['create'](_0x3ba064[_0xcb8e('0x16')],{'raw':_0x3ba064[_0xcb8e('0x17')]?_0x3ba064['options'][_0xcb8e('0x18')]===undefined?!![]:![]:!![]})[_0xcb8e('0xa')](function(_0xdfdb4f){logger[_0xcb8e('0xb')](_0xcb8e('0x15'),_0x3ba064);logger[_0xcb8e('0xd')]('CreateVoiceTransferReport',_0x3ba064,JSON['stringify'](_0xdfdb4f));_0x5867ee(_0xdfdb4f);})['catch'](function(_0xe883b5){logger[_0xcb8e('0xf')](_0xcb8e('0x15'),_0xe883b5[_0xcb8e('0x11')],_0x3ba064);_0x58d422(_0x44c26c['error'](0x1f4,_0xe883b5[_0xcb8e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 9d83fef..544bf0c 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 _0x1643=['Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x3a5416,_0x59b45f){var _0x5ad0e4=function(_0x59dc17){while(--_0x59dc17){_0x3a5416['push'](_0x3a5416['shift']());}};_0x5ad0e4(++_0x59b45f);}(_0x1643,0xd1));var _0x3164=function(_0x280ba2,_0x25d412){_0x280ba2=_0x280ba2-0x0;var _0x12a78e=_0x1643[_0x280ba2];return _0x12a78e;};'use strict';var express=require(_0x3164('0x0'));var router=express[_0x3164('0x1')]();var auth=require(_0x3164('0x2'));var controller=require(_0x3164('0x3'));router[_0x3164('0x4')](_0x3164('0x5'),auth[_0x3164('0x6')](),auth[_0x3164('0x7')](),controller[_0x3164('0x8')]);router[_0x3164('0x4')](_0x3164('0x9'),auth[_0x3164('0x6')](),auth[_0x3164('0x7')](),controller[_0x3164('0xa')]);router[_0x3164('0x4')]('/answer',auth[_0x3164('0x6')](),auth[_0x3164('0x7')](),controller[_0x3164('0xb')]);router[_0x3164('0x4')](_0x3164('0xc'),auth['isAuthenticated'](),auth[_0x3164('0x7')](),controller[_0x3164('0xd')]);router['post'](_0x3164('0xe'),auth[_0x3164('0x6')](),auth[_0x3164('0x7')](),controller[_0x3164('0xf')]);router[_0x3164('0x4')](_0x3164('0x10'),auth['isAuthenticated'](),auth[_0x3164('0x7')](),controller[_0x3164('0x11')]);router[_0x3164('0x4')](_0x3164('0x12'),auth[_0x3164('0x6')](),auth[_0x3164('0x7')](),controller[_0x3164('0x13')]);module[_0x3164('0x14')]=router; \ No newline at end of file +var _0x762d=['/hangup','hangup','/answer','answer','/unhold','unhold','/calls','calls','transfer','exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','canUpdate'];(function(_0x2f21c6,_0x5b4f43){var _0x141489=function(_0x2c5356){while(--_0x2c5356){_0x2f21c6['push'](_0x2f21c6['shift']());}};_0x141489(++_0x5b4f43);}(_0x762d,0x1d5));var _0xd762=function(_0x30ee31,_0x311c91){_0x30ee31=_0x30ee31-0x0;var _0x47baa6=_0x762d[_0x30ee31];return _0x47baa6;};'use strict';var express=require(_0xd762('0x0'));var router=express[_0xd762('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd762('0x2'));router[_0xd762('0x3')](_0xd762('0x4'),auth[_0xd762('0x5')](),auth[_0xd762('0x6')](),controller['originate']);router[_0xd762('0x3')](_0xd762('0x7'),auth['isAuthenticated'](),auth[_0xd762('0x6')](),controller[_0xd762('0x8')]);router['post'](_0xd762('0x9'),auth['isAuthenticated'](),auth[_0xd762('0x6')](),controller[_0xd762('0xa')]);router['post']('/hold',auth[_0xd762('0x5')](),auth[_0xd762('0x6')](),controller['hold']);router['post'](_0xd762('0xb'),auth[_0xd762('0x5')](),auth[_0xd762('0x6')](),controller[_0xd762('0xc')]);router['post'](_0xd762('0xd'),auth[_0xd762('0x5')](),auth[_0xd762('0x6')](),controller[_0xd762('0xe')]);router['post']('/transfer',auth['isAuthenticated'](),auth[_0xd762('0x6')](),controller[_0xd762('0xf')]);module[_0xd762('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 5ec200c..54bee14 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 _0x5ff3=['defaults','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','info','stringify','emit','log','error','stack','name','send','NotFound','request','then','code','message','result','User','findOne','agent','VoiceChannels','all','filter','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','status','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','rows','UserId','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','lodash','../../config/environment','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis'];(function(_0x2bdd37,_0x463323){var _0x18a4d8=function(_0x436ebd){while(--_0x436ebd){_0x2bdd37['push'](_0x2bdd37['shift']());}};_0x18a4d8(++_0x463323);}(_0x5ff3,0x17d));var _0x35ff=function(_0x56455e,_0x513f4f){_0x56455e=_0x56455e-0x0;var _0x2df6ac=_0x5ff3[_0x56455e];return _0x2df6ac;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x35ff('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x35ff('0x1'));var util=require('util');var BPromise=require(_0x35ff('0x2'));var jayson=require(_0x35ff('0x3'));var amiClient=jayson[_0x35ff('0x4')][_0x35ff('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x35ff('0x6'));var Redis=require(_0x35ff('0x7'));config[_0x35ff('0x8')]=_[_0x35ff('0x9')](config[_0x35ff('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x35ff('0xa'))(new Redis(config['redis']));var Schema=require(_0x35ff('0xb'));var originateValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],_0x35ff('0xd')]},'callNumber':{'type':'string','required':[!![],_0x35ff('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x35ff('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x35ff('0xd')]},'sessionId':{'type':_0x35ff('0xf'),'required':[!![],_0x35ff('0x10')]},'transferNumber':{'type':_0x35ff('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],_0x35ff('0xd')]},'sessionId':{'type':_0x35ff('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x35ff('0xd')]},'sessionId':{'type':_0x35ff('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],_0x35ff('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],_0x35ff('0xd')]}});function emit(_0x2d4a88,_0x28def2,_0x30b5bf){logger[_0x35ff('0x11')](_0x2d4a88,_0x28def2,JSON[_0x35ff('0x12')](_0x30b5bf));io['to'](_0x2d4a88)[_0x35ff('0x13')](_0x28def2,_0x30b5bf);}function handleError(_0x37ea06){return function(_0x16c803){console[_0x35ff('0x14')]('handleError:',_0x16c803,_0x16c803 instanceof RangeError);logger[_0x35ff('0x15')](_0x16c803[_0x35ff('0x16')]);if(_0x16c803 instanceof RangeError){if(_0x16c803[_0x35ff('0x17')]){delete _0x16c803[_0x35ff('0x17')];}_0x37ea06['status'](0x194)['send'](_0x16c803);}else{if(_0x16c803[_0x35ff('0x17')]){delete _0x16c803[_0x35ff('0x17')];}_0x37ea06['status'](0x1f4)[_0x35ff('0x18')](_0x16c803);}};}function checkError(){return function(_0x224f67){if(!_0x224f67){throw new RangeError(_0x35ff('0x19'));}return _0x224f67;};}function respondWithRpcPromise(_0x1e1dd2,_0x48f3bd){return new BPromise(function(_0x3d60b4,_0x55274b){var _0x7cc20a=amiClient;return _0x7cc20a[_0x35ff('0x1a')](_0x1e1dd2,_0x48f3bd)[_0x35ff('0x1b')](function(_0x16a5a0){if(_0x16a5a0[_0x35ff('0x15')]){if(_0x16a5a0[_0x35ff('0x15')][_0x35ff('0x1c')]===0x1f4){return _0x55274b(_0x16a5a0['error'][_0x35ff('0x1d')]);}return _0x3d60b4(_0x16a5a0[_0x35ff('0x15')]['message']);}else{_0x3d60b4(_0x16a5a0[_0x35ff('0x1e')]);}})['catch'](function(_0x4c46b7){_0x55274b(_0x4c46b7);});});}function getAgent(_0x186768){return db[_0x35ff('0x1f')][_0x35ff('0x20')]({'where':{'id':_0x186768,'role':_0x35ff('0x21')}})[_0x35ff('0x1b')](checkError());}function getAgentCheckSession(_0x546ec0,_0x2bdba4){return new BPromise(function(_0x412873,_0x148884){var _0x5e191b=respondWithRpcPromise(_0x35ff('0x22'));var _0x1f51c5=getAgent(_0x546ec0);Promise[_0x35ff('0x23')]([_0x5e191b,_0x1f51c5])[_0x35ff('0x1b')](function(_0x47fcb5){var _0x61b554=_0x47fcb5[0x0];var _0x1afc98=_0x47fcb5[0x1];var _0xdf6ff=_[_0x35ff('0x24')](_0x61b554['rows'],function(_0x3f9440){return _0x3f9440['UserId']==_0x1afc98['id']&&_0x3f9440[_0x35ff('0x25')]==_0x2bdba4;});if(_0xdf6ff[_0x35ff('0x26')]==0x1){_0x412873(_0x1afc98);}else{_0x148884(new RangeError(_0x35ff('0x27')+_0x2bdba4+_0x35ff('0x28')));}});});}exports['originate']=function(_0x182b71,_0x5de349){logger[_0x35ff('0x11')](_0x35ff('0x29'),_0x182b71['body']);var _0x5a48b0=originateValidation[_0x35ff('0xb')](_0x182b71[_0x35ff('0x2a')]);if(_0x5a48b0['length']>0x0){return _0x5de349[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x5a48b0);}var _0x4d194c=_0x182b71[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x131b22=_0x182b71[_0x35ff('0x2a')][_0x35ff('0x2e')];var _0x2720dc=_0x182b71[_0x35ff('0x2a')][_0x35ff('0x2f')];var _0x35a3c7=_0x182b71[_0x35ff('0x2a')][_0x35ff('0x30')];return getAgent(_0x4d194c)[_0x35ff('0x1b')](function(_0x41b48d){logger['info'](_0x35ff('0x31'),_0x41b48d['name']);emit(util[_0x35ff('0x32')](_0x35ff('0x33'),_0x41b48d[_0x35ff('0x17')]),_0x35ff('0x34'),{'callNumber':_0x131b22,'callerId':_0x2720dc,'callbackUrl':_0x35a3c7});return _0x5de349[_0x35ff('0x2b')](0xc8)['json']({'error':![],'message':_0x35ff('0x35')});})[_0x35ff('0x36')](handleError(_0x5de349));};exports[_0x35ff('0x37')]=function(_0x4250cb,_0x324f6c){logger['info'](_0x35ff('0x38'),_0x4250cb[_0x35ff('0x2a')]);var _0x1640b5=hangupValidation['validate'](_0x4250cb['body']);if(_0x1640b5[_0x35ff('0x26')]>0x0){return _0x324f6c[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x1640b5);}var _0x37677f=_0x4250cb[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x27f32d=_0x4250cb[_0x35ff('0x2a')]['sessionId'];return getAgent(_0x37677f)['then'](function(_0x550c09){logger[_0x35ff('0x11')](_0x35ff('0x31'),_0x550c09[_0x35ff('0x17')]);emit(util[_0x35ff('0x32')](_0x35ff('0x33'),_0x550c09['name']),_0x35ff('0x39'),{'sessionId':_0x27f32d});return _0x324f6c[_0x35ff('0x2b')](0xc8)[_0x35ff('0x2c')]({'error':![],'message':_0x35ff('0x3a')});})[_0x35ff('0x36')](handleError(_0x324f6c));};exports[_0x35ff('0x3b')]=function(_0x55efda,_0x5e4360){logger[_0x35ff('0x11')](_0x35ff('0x3c'),_0x55efda[_0x35ff('0x2a')]);var _0x21b123=answerValidation['validate'](_0x55efda['body']);if(_0x21b123[_0x35ff('0x26')]>0x0){return _0x5e4360[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x21b123);}var _0x1cd2c8=_0x55efda[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x346758=_0x55efda['body']['sessionId'];return getAgent(_0x1cd2c8)[_0x35ff('0x1b')](function(_0x318297){logger[_0x35ff('0x11')]('entityFound:',_0x318297[_0x35ff('0x17')]);emit(util[_0x35ff('0x32')]('user:%s',_0x318297['name']),_0x35ff('0x3d'),{'sessionId':_0x346758});return _0x5e4360['status'](0xc8)[_0x35ff('0x2c')]({'error':![],'message':_0x35ff('0x3e')});})['catch'](handleError(_0x5e4360));};exports[_0x35ff('0x3f')]=function(_0x4b1b86,_0x53c3c7){logger[_0x35ff('0x11')](_0x35ff('0x40'),_0x4b1b86[_0x35ff('0x2a')]);var _0x3a70cd=holdValidation[_0x35ff('0xb')](_0x4b1b86[_0x35ff('0x2a')]);if(_0x3a70cd[_0x35ff('0x26')]>0x0){return _0x53c3c7[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x3a70cd);}var _0xee99f9=_0x4b1b86[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x5d2894=_0x4b1b86[_0x35ff('0x2a')][_0x35ff('0x25')];return getAgent(_0xee99f9)[_0x35ff('0x1b')](function(_0x2d26e2){logger['info']('entityFound:',_0x2d26e2[_0x35ff('0x17')]);emit(util['format'](_0x35ff('0x33'),_0x2d26e2[_0x35ff('0x17')]),_0x35ff('0x41'),{'sessionId':_0x5d2894});return _0x53c3c7[_0x35ff('0x2b')](0xc8)[_0x35ff('0x2c')]({'error':![],'message':_0x35ff('0x42')});})[_0x35ff('0x36')](handleError(_0x53c3c7));};exports[_0x35ff('0x43')]=function(_0x3be5fc,_0x535cc8){logger['info'](_0x35ff('0x44'),_0x3be5fc['body']);var _0x309fe1=unholdValidation[_0x35ff('0xb')](_0x3be5fc[_0x35ff('0x2a')]);if(_0x309fe1[_0x35ff('0x26')]>0x0){return _0x535cc8[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x309fe1);}var _0x2db44c=_0x3be5fc[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x5b8f52=_0x3be5fc[_0x35ff('0x2a')][_0x35ff('0x25')];return getAgent(_0x2db44c)[_0x35ff('0x1b')](function(_0x148183){logger['info']('entityFound:',_0x148183['name']);emit(util[_0x35ff('0x32')](_0x35ff('0x33'),_0x148183[_0x35ff('0x17')]),'webbar:unhold',{'sessionId':_0x5b8f52});return _0x535cc8[_0x35ff('0x2b')](0xc8)['json']({'error':![],'message':_0x35ff('0x45')});})['catch'](handleError(_0x535cc8));};exports[_0x35ff('0x46')]=function(_0x3b7e40,_0x681d2b){logger[_0x35ff('0x11')]('calls\x20fired:',_0x681d2b['body']);var _0x2be86b=callsValidation['validate'](_0x3b7e40[_0x35ff('0x2a')]);if(_0x2be86b[_0x35ff('0x26')]>0x0){return _0x681d2b['status'](0x190)[_0x35ff('0x2c')](_0x2be86b);}var _0x567be6=_0x3b7e40[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x424586=respondWithRpcPromise(_0x35ff('0x22'));var _0x316624=getAgent(_0x567be6);return Promise[_0x35ff('0x23')]([_0x424586,_0x316624])['then'](function(_0x54d949){var _0x13b904=_0x54d949[0x0];var _0x340ed8=_0x54d949[0x1];var _0x5ca898=_[_0x35ff('0x24')](_0x13b904[_0x35ff('0x47')],function(_0x52a6f7){return _0x52a6f7[_0x35ff('0x48')]==_0x340ed8['id'];});return _0x681d2b[_0x35ff('0x2b')](0xc8)[_0x35ff('0x2c')]({'count':_0x5ca898[_0x35ff('0x26')],'rows':_0x5ca898});})[_0x35ff('0x36')](handleError(_0x681d2b));};exports['conference']=function(_0x4af4cb,_0x552a66){logger[_0x35ff('0x11')]('conference\x20fired:',_0x4af4cb[_0x35ff('0x2a')]);var _0x55ff13=conferenceValidation[_0x35ff('0xb')](_0x4af4cb[_0x35ff('0x2a')]);if(_0x55ff13[_0x35ff('0x26')]>0x0){return _0x552a66[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x55ff13);}var _0x3b9d9b=_0x4af4cb['body'][_0x35ff('0x2d')];return getAgent(_0x3b9d9b)[_0x35ff('0x1b')](function(_0x543109){logger[_0x35ff('0x11')](_0x35ff('0x31'),_0x543109[_0x35ff('0x17')]);emit(util[_0x35ff('0x32')](_0x35ff('0x33'),_0x543109[_0x35ff('0x17')]),_0x35ff('0x49'));return _0x552a66[_0x35ff('0x2b')](0xc8)[_0x35ff('0x2c')]({'error':![],'message':'conference\x20executed!'});})[_0x35ff('0x36')](handleError(_0x552a66));};exports[_0x35ff('0x4a')]=function(_0x36e8d1,_0x2f9107){logger[_0x35ff('0x11')](_0x35ff('0x4b'),_0x36e8d1['body']);var _0x27433f=transferValidation[_0x35ff('0xb')](_0x36e8d1[_0x35ff('0x2a')]);if(_0x27433f['length']>0x0){return _0x2f9107[_0x35ff('0x2b')](0x190)['json'](_0x27433f);}var _0x56e6cc=_0x36e8d1[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x4a8907=_0x36e8d1[_0x35ff('0x2a')][_0x35ff('0x25')];var _0x36e334=_0x36e8d1[_0x35ff('0x2a')][_0x35ff('0x4c')];return getAgent(_0x56e6cc)[_0x35ff('0x1b')](function(_0x5fd425){logger[_0x35ff('0x11')](_0x35ff('0x31'),_0x5fd425[_0x35ff('0x17')]);emit(util[_0x35ff('0x32')](_0x35ff('0x33'),_0x5fd425[_0x35ff('0x17')]),_0x35ff('0x4d'),{'sessionId':_0x4a8907,'transferNumber':_0x36e334});return _0x2f9107[_0x35ff('0x2b')](0xc8)[_0x35ff('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x35ff('0x36')](handleError(_0x2f9107));}; \ No newline at end of file +var _0x684c=['NotFound','error','code','result','catch','User','agent','then','VoiceChannels','all','filter','rows','UserId','\x20not\x20found!','originate','info','body','json','userId','callNumber','format','user:%s','webbar:originate','originate\x20executed!','hangup\x20fired:','sessionId','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','length','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','emit','log','handleError:','stack','name','status','send'];(function(_0x2db36d,_0x344748){var _0x56fa6b=function(_0x53ea0a){while(--_0x53ea0a){_0x2db36d['push'](_0x2db36d['shift']());}};_0x56fa6b(++_0x344748);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xc684('0x0'));var fs=require('fs');var _=require(_0xc684('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xc684('0x2'));var util=require(_0xc684('0x3'));var BPromise=require(_0xc684('0x4'));var jayson=require(_0xc684('0x5'));var amiClient=jayson[_0xc684('0x6')]['http']({'port':0x232a});var logger=require(_0xc684('0x7'))(_0xc684('0x8'));var Redis=require(_0xc684('0x9'));config[_0xc684('0xa')]=_[_0xc684('0xb')](config[_0xc684('0xa')],{'host':_0xc684('0xc'),'port':0x18eb});var io=require(_0xc684('0xd'))(new Redis(config[_0xc684('0xa')]));var Schema=require(_0xc684('0xe'));var originateValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],_0xc684('0x10')]},'callNumber':{'type':_0xc684('0x11'),'required':[!![],_0xc684('0x12')]},'callerId':{'type':_0xc684('0x11')},'callbackUrl':{'type':_0xc684('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xc684('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],_0xc684('0x10')]},'sessionId':{'type':_0xc684('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],_0xc684('0x10')]},'sessionId':{'type':'string','required':[!![],_0xc684('0x13')]},'transferNumber':{'type':_0xc684('0x11'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc684('0x10')]},'sessionId':{'type':_0xc684('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],_0xc684('0x10')]},'sessionId':{'type':_0xc684('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc684('0x10')]}});function emit(_0x599c93,_0x4f0ef9,_0x51f0a8){logger['info'](_0x599c93,_0x4f0ef9,JSON['stringify'](_0x51f0a8));io['to'](_0x599c93)[_0xc684('0x14')](_0x4f0ef9,_0x51f0a8);}function handleError(_0x33943d){return function(_0x3b6f5e){console[_0xc684('0x15')](_0xc684('0x16'),_0x3b6f5e,_0x3b6f5e instanceof RangeError);logger['error'](_0x3b6f5e[_0xc684('0x17')]);if(_0x3b6f5e instanceof RangeError){if(_0x3b6f5e[_0xc684('0x18')]){delete _0x3b6f5e['name'];}_0x33943d[_0xc684('0x19')](0x194)[_0xc684('0x1a')](_0x3b6f5e);}else{if(_0x3b6f5e[_0xc684('0x18')]){delete _0x3b6f5e['name'];}_0x33943d[_0xc684('0x19')](0x1f4)[_0xc684('0x1a')](_0x3b6f5e);}};}function checkError(){return function(_0x1eddc7){if(!_0x1eddc7){throw new RangeError(_0xc684('0x1b'));}return _0x1eddc7;};}function respondWithRpcPromise(_0x2d1241,_0x4b7769){return new BPromise(function(_0x13d43f,_0x39f39a){var _0x1fb8b0=amiClient;return _0x1fb8b0['request'](_0x2d1241,_0x4b7769)['then'](function(_0x5a7b2e){if(_0x5a7b2e[_0xc684('0x1c')]){if(_0x5a7b2e[_0xc684('0x1c')][_0xc684('0x1d')]===0x1f4){return _0x39f39a(_0x5a7b2e['error']['message']);}return _0x13d43f(_0x5a7b2e['error']['message']);}else{_0x13d43f(_0x5a7b2e[_0xc684('0x1e')]);}})[_0xc684('0x1f')](function(_0x236f02){_0x39f39a(_0x236f02);});});}function getAgent(_0x4edb38){return db[_0xc684('0x20')]['findOne']({'where':{'id':_0x4edb38,'role':_0xc684('0x21')}})[_0xc684('0x22')](checkError());}function getAgentCheckSession(_0x13e09d,_0x49dad1){return new BPromise(function(_0x1f8e85,_0x4d9094){var _0x279998=respondWithRpcPromise(_0xc684('0x23'));var _0x210dcd=getAgent(_0x13e09d);Promise[_0xc684('0x24')]([_0x279998,_0x210dcd])['then'](function(_0xc0f77b){var _0x2710c1=_0xc0f77b[0x0];var _0x28a48a=_0xc0f77b[0x1];var _0x3c8a4d=_[_0xc684('0x25')](_0x2710c1[_0xc684('0x26')],function(_0x10db0d){return _0x10db0d[_0xc684('0x27')]==_0x28a48a['id']&&_0x10db0d['sessionId']==_0x49dad1;});if(_0x3c8a4d['length']==0x1){_0x1f8e85(_0x28a48a);}else{_0x4d9094(new RangeError('sessionId\x20'+_0x49dad1+_0xc684('0x28')));}});});}exports[_0xc684('0x29')]=function(_0x5cd228,_0x4e46c2){logger[_0xc684('0x2a')]('originate\x20fired:',_0x5cd228[_0xc684('0x2b')]);var _0x164da7=originateValidation[_0xc684('0xe')](_0x5cd228['body']);if(_0x164da7['length']>0x0){return _0x4e46c2[_0xc684('0x19')](0x190)[_0xc684('0x2c')](_0x164da7);}var _0x577ebe=_0x5cd228['body'][_0xc684('0x2d')];var _0x413128=_0x5cd228[_0xc684('0x2b')][_0xc684('0x2e')];var _0x35a790=_0x5cd228[_0xc684('0x2b')]['callerId'];var _0x1a0b08=_0x5cd228['body']['callbackUrl'];return getAgent(_0x577ebe)[_0xc684('0x22')](function(_0x46e014){logger['info']('entityFound:',_0x46e014[_0xc684('0x18')]);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x46e014[_0xc684('0x18')]),_0xc684('0x31'),{'callNumber':_0x413128,'callerId':_0x35a790,'callbackUrl':_0x1a0b08});return _0x4e46c2['status'](0xc8)[_0xc684('0x2c')]({'error':![],'message':_0xc684('0x32')});})['catch'](handleError(_0x4e46c2));};exports['hangup']=function(_0x1923d7,_0x139972){logger[_0xc684('0x2a')](_0xc684('0x33'),_0x1923d7[_0xc684('0x2b')]);var _0x2ae788=hangupValidation[_0xc684('0xe')](_0x1923d7['body']);if(_0x2ae788['length']>0x0){return _0x139972[_0xc684('0x19')](0x190)[_0xc684('0x2c')](_0x2ae788);}var _0x56404b=_0x1923d7['body']['userId'];var _0x2c4e7c=_0x1923d7[_0xc684('0x2b')][_0xc684('0x34')];return getAgent(_0x56404b)[_0xc684('0x22')](function(_0x2649ee){logger['info'](_0xc684('0x35'),_0x2649ee['name']);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x2649ee[_0xc684('0x18')]),_0xc684('0x36'),{'sessionId':_0x2c4e7c});return _0x139972['status'](0xc8)[_0xc684('0x2c')]({'error':![],'message':_0xc684('0x37')});})[_0xc684('0x1f')](handleError(_0x139972));};exports[_0xc684('0x38')]=function(_0x1497c2,_0x2f16b3){logger['info'](_0xc684('0x39'),_0x1497c2['body']);var _0x566c61=answerValidation[_0xc684('0xe')](_0x1497c2[_0xc684('0x2b')]);if(_0x566c61[_0xc684('0x3a')]>0x0){return _0x2f16b3['status'](0x190)['json'](_0x566c61);}var _0x4f288b=_0x1497c2['body']['userId'];var _0x189b26=_0x1497c2[_0xc684('0x2b')][_0xc684('0x34')];return getAgent(_0x4f288b)['then'](function(_0x2cd123){logger['info'](_0xc684('0x35'),_0x2cd123['name']);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x2cd123[_0xc684('0x18')]),_0xc684('0x3b'),{'sessionId':_0x189b26});return _0x2f16b3[_0xc684('0x19')](0xc8)['json']({'error':![],'message':_0xc684('0x3c')});})[_0xc684('0x1f')](handleError(_0x2f16b3));};exports[_0xc684('0x3d')]=function(_0x3fd5e9,_0x1fb6ac){logger[_0xc684('0x2a')](_0xc684('0x3e'),_0x3fd5e9[_0xc684('0x2b')]);var _0x1bafa8=holdValidation['validate'](_0x3fd5e9[_0xc684('0x2b')]);if(_0x1bafa8[_0xc684('0x3a')]>0x0){return _0x1fb6ac['status'](0x190)[_0xc684('0x2c')](_0x1bafa8);}var _0x4fb1d5=_0x3fd5e9[_0xc684('0x2b')]['userId'];var _0x182534=_0x3fd5e9[_0xc684('0x2b')][_0xc684('0x34')];return getAgent(_0x4fb1d5)[_0xc684('0x22')](function(_0x1bfd8d){logger[_0xc684('0x2a')](_0xc684('0x35'),_0x1bfd8d[_0xc684('0x18')]);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x1bfd8d['name']),_0xc684('0x3f'),{'sessionId':_0x182534});return _0x1fb6ac[_0xc684('0x19')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x1fb6ac));};exports[_0xc684('0x40')]=function(_0x1304a2,_0x5439ae){logger[_0xc684('0x2a')](_0xc684('0x41'),_0x1304a2[_0xc684('0x2b')]);var _0x5c72c8=unholdValidation[_0xc684('0xe')](_0x1304a2[_0xc684('0x2b')]);if(_0x5c72c8[_0xc684('0x3a')]>0x0){return _0x5439ae[_0xc684('0x19')](0x190)[_0xc684('0x2c')](_0x5c72c8);}var _0x5818b8=_0x1304a2[_0xc684('0x2b')][_0xc684('0x2d')];var _0x4ab2d6=_0x1304a2[_0xc684('0x2b')][_0xc684('0x34')];return getAgent(_0x5818b8)[_0xc684('0x22')](function(_0x28c0fa){logger[_0xc684('0x2a')]('entityFound:',_0x28c0fa[_0xc684('0x18')]);emit(util['format'](_0xc684('0x30'),_0x28c0fa[_0xc684('0x18')]),_0xc684('0x42'),{'sessionId':_0x4ab2d6});return _0x5439ae[_0xc684('0x19')](0xc8)[_0xc684('0x2c')]({'error':![],'message':_0xc684('0x43')});})[_0xc684('0x1f')](handleError(_0x5439ae));};exports[_0xc684('0x44')]=function(_0xcfb03e,_0x554301){logger['info'](_0xc684('0x45'),_0x554301['body']);var _0x2b2d54=callsValidation['validate'](_0xcfb03e['body']);if(_0x2b2d54[_0xc684('0x3a')]>0x0){return _0x554301[_0xc684('0x19')](0x190)[_0xc684('0x2c')](_0x2b2d54);}var _0x147483=_0xcfb03e[_0xc684('0x2b')][_0xc684('0x2d')];var _0x507eff=respondWithRpcPromise(_0xc684('0x23'));var _0x3f1887=getAgent(_0x147483);return Promise[_0xc684('0x24')]([_0x507eff,_0x3f1887])['then'](function(_0xb1ab5b){var _0x50ba27=_0xb1ab5b[0x0];var _0x1e2a08=_0xb1ab5b[0x1];var _0x3eb497=_[_0xc684('0x25')](_0x50ba27['rows'],function(_0x4eddbb){return _0x4eddbb[_0xc684('0x27')]==_0x1e2a08['id'];});return _0x554301['status'](0xc8)[_0xc684('0x2c')]({'count':_0x3eb497['length'],'rows':_0x3eb497});})[_0xc684('0x1f')](handleError(_0x554301));};exports[_0xc684('0x46')]=function(_0x5e0367,_0x1ba002){logger['info'](_0xc684('0x47'),_0x5e0367['body']);var _0x1b5b54=conferenceValidation[_0xc684('0xe')](_0x5e0367[_0xc684('0x2b')]);if(_0x1b5b54[_0xc684('0x3a')]>0x0){return _0x1ba002[_0xc684('0x19')](0x190)['json'](_0x1b5b54);}var _0x2da62d=_0x5e0367[_0xc684('0x2b')][_0xc684('0x2d')];return getAgent(_0x2da62d)[_0xc684('0x22')](function(_0x258693){logger[_0xc684('0x2a')](_0xc684('0x35'),_0x258693[_0xc684('0x18')]);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x258693[_0xc684('0x18')]),_0xc684('0x48'));return _0x1ba002[_0xc684('0x19')](0xc8)[_0xc684('0x2c')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x1ba002));};exports['transfer']=function(_0x2a2c30,_0x519006){logger[_0xc684('0x2a')](_0xc684('0x49'),_0x2a2c30[_0xc684('0x2b')]);var _0x342bbf=transferValidation[_0xc684('0xe')](_0x2a2c30['body']);if(_0x342bbf[_0xc684('0x3a')]>0x0){return _0x519006[_0xc684('0x19')](0x190)[_0xc684('0x2c')](_0x342bbf);}var _0x5f4f6b=_0x2a2c30[_0xc684('0x2b')][_0xc684('0x2d')];var _0x2678cb=_0x2a2c30[_0xc684('0x2b')]['sessionId'];var _0x538b3f=_0x2a2c30[_0xc684('0x2b')][_0xc684('0x4a')];return getAgent(_0x5f4f6b)[_0xc684('0x22')](function(_0x1c967d){logger[_0xc684('0x2a')](_0xc684('0x35'),_0x1c967d[_0xc684('0x18')]);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x1c967d[_0xc684('0x18')]),_0xc684('0x4b'),{'sessionId':_0x2678cb,'transferNumber':_0x538b3f});return _0x519006[_0xc684('0x19')](0xc8)['json']({'error':![],'message':_0xc684('0x4c')});})['catch'](handleError(_0x519006));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index affa772..45734d0 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 _0xd7d1=['delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getAnswers','/:id/users','getAgents','getApplications','create','post','addDisposition','/:id/canned_answers','addAgents','addApplications','notify','/:id/send','send','put','update'];(function(_0x485c35,_0x1ef463){var _0x699c07=function(_0x2d0938){while(--_0x2d0938){_0x485c35['push'](_0x485c35['shift']());}};_0x699c07(++_0x1ef463);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x59238a,_0x4560ae){_0x59238a=_0x59238a-0x0;var _0x478549=_0xd7d1[_0x59238a];return _0x478549;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getDispositions']);router[_0x1d7d('0xb')]('/:id/canned_answers',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0xb')](_0x1d7d('0x13'),auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router['get']('/:id/applications',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1d7d('0x16')]);router[_0x1d7d('0x17')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x18')]);router['post'](_0x1d7d('0x19'),auth[_0x1d7d('0xc')](),controller['addAnswer']);router[_0x1d7d('0x17')](_0x1d7d('0x13'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1a')]);router[_0x1d7d('0x17')]('/:id/applications',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1b')]);router['post']('/:id/notify',controller[_0x1d7d('0x1c')]);router[_0x1d7d('0x17')](_0x1d7d('0x1d'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1e')]);router[_0x1d7d('0x1f')]('/:id',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x20')]);router[_0x1d7d('0x21')]('/:id',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x22')]);router['delete']('/:id/dispositions',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x23')]);router[_0x1d7d('0x21')]('/:id/canned_answers',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x24')]);router[_0x1d7d('0x21')](_0x1d7d('0x13'),auth['isAuthenticated'](),controller[_0x1d7d('0x25')]);module[_0x1d7d('0x26')]=router; \ No newline at end of file +var _0x8e3f=['addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create'];(function(_0x5d41e2,_0x203604){var _0xcb9ca3=function(_0x19458f){while(--_0x19458f){_0x5d41e2['push'](_0x5d41e2['shift']());}};_0xcb9ca3(++_0x203604);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var path=require(_0xf8e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8e3('0x3'));var router=express[_0xf8e3('0x4')]();var fs_extra=require(_0xf8e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var controller=require('./whatsappAccount.controller');router[_0xf8e3('0x8')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xa')]);router[_0xf8e3('0x8')]('/describe',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xb')]);router[_0xf8e3('0x8')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xd')]);router[_0xf8e3('0x8')](_0xf8e3('0xe'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xf')]);router[_0xf8e3('0x8')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller[_0xf8e3('0x11')]);router[_0xf8e3('0x8')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x13')]);router[_0xf8e3('0x8')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller['getApplications']);router[_0xf8e3('0x15')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x16')]);router['post'](_0xf8e3('0xe'),auth['isAuthenticated'](),controller[_0xf8e3('0x17')]);router[_0xf8e3('0x15')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xf8e3('0x15')](_0xf8e3('0x12'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x18')]);router[_0xf8e3('0x15')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x19')]);router[_0xf8e3('0x15')](_0xf8e3('0x1a'),controller['notify']);router[_0xf8e3('0x15')](_0xf8e3('0x1b'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1c')]);router[_0xf8e3('0x1d')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1e')]);router['delete'](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1f')]);router[_0xf8e3('0x20')]('/:id/dispositions',auth[_0xf8e3('0x9')](),controller['removeDispositions']);router[_0xf8e3('0x20')](_0xf8e3('0x10'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x21')]);router[_0xf8e3('0x20')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x22')]);module[_0xf8e3('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 7ef2f29..f2b2546 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 _0xebab=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x1cd1ef,_0x49a3bb){var _0x43b467=function(_0x4660ce){while(--_0x4660ce){_0x1cd1ef['push'](_0x1cd1ef['shift']());}};_0x43b467(++_0x49a3bb);}(_0xebab,0xc4));var _0xbeba=function(_0x3238db,_0x530412){_0x3238db=_0x3238db-0x0;var _0x1f0cc5=_0xebab[_0x3238db];return _0x1f0cc5;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xbeba('0x0'));module[_0xbeba('0x1')]={'name':{'type':Sequelize[_0xbeba('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xbeba('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xbeba('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xbeba('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xbeba('0x3'))},'accountSid':{'type':Sequelize[_0xbeba('0x2')]},'authToken':{'type':Sequelize[_0xbeba('0x2')]},'notificationTemplate':{'type':Sequelize[_0xbeba('0x4')],'defaultValue':function(){return _0xbeba('0x5');}},'notificationSound':{'type':Sequelize[_0xbeba('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbeba('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbeba('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbeba('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbeba('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbeba('0x6')],'defaultValue':![],'comment':_0xbeba('0x8'),'set':function(_0x40ab42){if(!_0x40ab42){this[_0xbeba('0x9')](_0xbeba('0xa'),null);}this[_0xbeba('0x9')](_0xbeba('0xb'),_0x40ab42);}},'description':{'type':Sequelize[_0xbeba('0x2')]}}; \ No newline at end of file +var _0x2f6b=['randomstring','exports','STRING','name','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x25a52f,_0x1dce3c){var _0x93f60=function(_0x380da9){while(--_0x380da9){_0x25a52f['push'](_0x25a52f['shift']());}};_0x93f60(++_0x1dce3c);}(_0x2f6b,0x1af));var _0xb2f6=function(_0x254081,_0x20731a){_0x254081=_0x254081-0x0;var _0x5d1e2a=_0x2f6b[_0x254081];return _0x5d1e2a;};'use strict';var Sequelize=require(_0xb2f6('0x0'));var rs=require(_0xb2f6('0x1'));module[_0xb2f6('0x2')]={'name':{'type':Sequelize[_0xb2f6('0x3')],'unique':_0xb2f6('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xb2f6('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xb2f6('0x3')]},'type':{'type':Sequelize['ENUM'](_0xb2f6('0x5'))},'accountSid':{'type':Sequelize[_0xb2f6('0x3')]},'authToken':{'type':Sequelize[_0xb2f6('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb2f6('0x6');}},'notificationSound':{'type':Sequelize[_0xb2f6('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xb2f6('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb2f6('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb2f6('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb2f6('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb2f6('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb2f6('0x8')],'comment':_0xb2f6('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d006c){if(!_0x2d006c){this['setDataValue'](_0xb2f6('0xa'),null);}this['setDataValue'](_0xb2f6('0xb'),_0x2d006c);}},'description':{'type':Sequelize[_0xb2f6('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 5bbf429..ebb52f2 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 _0x6fe0=['show','params','Pause','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','WhatsappAccountId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','CannedAnswer','removeAnswers','ids','addAgents','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','applications','orderBy','asc','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','replace','whatsapp:','messageId','MessageSid','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','list','omit','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','unmanaged','ContactId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a','List','defaults','dataValues','Messages','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','WhatsappAccounts','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','WhatsappAccount','include'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x6fe0,0x120));var _0x06fe=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x6fe0[_0xe1b5f6];return _0x44636e;};'use strict';var emlformat=require(_0x06fe('0x0'));var rimraf=require(_0x06fe('0x1'));var zipdir=require(_0x06fe('0x2'));var jsonpatch=require(_0x06fe('0x3'));var rp=require(_0x06fe('0x4'));var moment=require(_0x06fe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x06fe('0x6'));var util=require(_0x06fe('0x7'));var path=require(_0x06fe('0x8'));var sox=require(_0x06fe('0x9'));var csv=require(_0x06fe('0xa'));var ejs=require(_0x06fe('0xb'));var fs=require('fs');var fs_extra=require(_0x06fe('0xc'));var _=require(_0x06fe('0xd'));var squel=require(_0x06fe('0xe'));var crypto=require(_0x06fe('0xf'));var jsforce=require(_0x06fe('0x10'));var deskjs=require(_0x06fe('0x11'));var toCsv=require('to-csv');var querystring=require(_0x06fe('0x12'));var Papa=require(_0x06fe('0x13'));var Redis=require(_0x06fe('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x06fe('0x15'));var as=require(_0x06fe('0x16'));var hardwareService=require(_0x06fe('0x17'));var logger=require(_0x06fe('0x18'))(_0x06fe('0x19'));var utils=require(_0x06fe('0x1a'));var config=require(_0x06fe('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x06fe('0x1c'))['db'];config[_0x06fe('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x06fe('0x1e'))(new Redis(config[_0x06fe('0x1d')]));require(_0x06fe('0x1f'))['register'](socket);var jayson=require(_0x06fe('0x20'));var client=jayson[_0x06fe('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1fc0cb,_0x373adb,_0x375bc8,_0x5521a0){return new BPromise(function(_0x31b462,_0x241105){var _0x163d52=_0x5521a0||client;return _0x163d52[_0x06fe('0x22')](_0x1fc0cb,_0x375bc8)[_0x06fe('0x23')](function(_0x42a7d7){logger[_0x06fe('0x24')](_0x06fe('0x25'),_0x373adb,_0x06fe('0x26'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x373adb,_0x06fe('0x26'),JSON['stringify'](_0x42a7d7));if(_0x42a7d7['error']){if(_0x42a7d7[_0x06fe('0x27')][_0x06fe('0x28')]===0x1f4){logger['error'](_0x06fe('0x25'),_0x373adb,_0x42a7d7[_0x06fe('0x27')][_0x06fe('0x29')]);return _0x241105(_0x42a7d7['error'][_0x06fe('0x29')]);}logger['error'](_0x06fe('0x25'),_0x373adb,_0x42a7d7['error']['message']);return _0x31b462(_0x42a7d7['error'][_0x06fe('0x29')]);}else{logger[_0x06fe('0x24')](_0x06fe('0x25'),_0x373adb,_0x06fe('0x26'));_0x31b462(_0x42a7d7[_0x06fe('0x2a')][_0x06fe('0x29')]);}})[_0x06fe('0x2b')](function(_0x2f404d){logger['error'](_0x06fe('0x25'),_0x373adb,_0x2f404d);_0x241105(_0x2f404d);});});}function respondWithStatusCode(_0x7b36,_0x328691){_0x328691=_0x328691||0xcc;return function(_0x5b95dd){if(_0x5b95dd){return _0x7b36[_0x06fe('0x2c')](_0x328691);}return _0x7b36['status'](_0x328691)['end']();};}function respondWithResult(_0x412a58,_0x128029){_0x128029=_0x128029||0xc8;return function(_0x8cb33c){if(_0x8cb33c){return _0x412a58[_0x06fe('0x2d')](_0x128029)[_0x06fe('0x2e')](_0x8cb33c);}};}function respondWithFilteredResult(_0x150783,_0x19c0d7){return function(_0xdf691a){if(_0xdf691a){var _0x2ac45d=typeof _0x19c0d7[_0x06fe('0x2f')]===_0x06fe('0x30')&&typeof _0x19c0d7[_0x06fe('0x31')]===_0x06fe('0x30');var _0x53b18a=_0xdf691a[_0x06fe('0x32')];var _0x3acded=_0x2ac45d?0x0:_0x19c0d7['offset'];var _0xd3665f=_0x2ac45d?_0xdf691a[_0x06fe('0x32')]:_0x19c0d7[_0x06fe('0x2f')]+_0x19c0d7[_0x06fe('0x31')];var _0x4be744;if(_0xd3665f>=_0x53b18a){_0xd3665f=_0x53b18a;_0x4be744=0xc8;}else{_0x4be744=0xce;}_0x150783[_0x06fe('0x2d')](_0x4be744);return _0x150783[_0x06fe('0x33')]('Content-Range',_0x3acded+'-'+_0xd3665f+'/'+_0x53b18a)[_0x06fe('0x2e')](_0xdf691a);}return null;};}function patchUpdates(_0xd2961){return function(_0x22a590){try{jsonpatch[_0x06fe('0x34')](_0x22a590,_0xd2961,!![]);}catch(_0x5bf088){return BPromise['reject'](_0x5bf088);}return _0x22a590[_0x06fe('0x35')]();};}function saveUpdates(_0x379935,_0xff5d44){return function(_0x41a345){if(_0x41a345){return _0x41a345[_0x06fe('0x36')](_0x379935)[_0x06fe('0x23')](function(_0x305714){return _0x305714;});}return null;};}function removeEntity(_0x52a584,_0x420e80){return function(_0x109d91){if(_0x109d91){return _0x109d91[_0x06fe('0x37')]()[_0x06fe('0x23')](function(){var _0xda552d=_0x109d91['get']({'plain':!![]});var _0x3025ab=_0x06fe('0x38');return db['UserProfileResource'][_0x06fe('0x37')]({'where':{'type':_0x3025ab,'resourceId':_0xda552d['id']}})[_0x06fe('0x23')](function(){return _0x109d91;});})[_0x06fe('0x23')](function(){_0x52a584[_0x06fe('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460562,_0x4b95f8){return function(_0x180aad){if(!_0x180aad){_0x460562['sendStatus'](0x194);}return _0x180aad;};}function handleError(_0x51b036,_0x513006){_0x513006=_0x513006||0x1f4;return function(_0x1be9a5){logger[_0x06fe('0x27')](_0x1be9a5[_0x06fe('0x39')]);if(_0x1be9a5['name']){delete _0x1be9a5[_0x06fe('0x3a')];}_0x51b036[_0x06fe('0x2d')](_0x513006)[_0x06fe('0x3b')](_0x1be9a5);};}exports[_0x06fe('0x3c')]=function(_0x169fd8,_0x1f99dc){var _0x341d5f={'include':[{'model':db['Pause'],'as':_0x06fe('0x3d')}]},_0x3d438c={},_0xd4a147={'count':0x0,'rows':[]};var _0x3e5179=_[_0x06fe('0x3e')](db['WhatsappAccount'][_0x06fe('0x3f')],function(_0x7fe658){return{'name':_0x7fe658[_0x06fe('0x40')],'type':_0x7fe658[_0x06fe('0x41')]['key']};});_0x3d438c[_0x06fe('0x42')]=_[_0x06fe('0x3e')](_0x3e5179,_0x06fe('0x3a'));_0x3d438c[_0x06fe('0x43')]=_[_0x06fe('0x44')](_0x169fd8[_0x06fe('0x43')]);_0x3d438c[_0x06fe('0x45')]=_[_0x06fe('0x46')](_0x3d438c[_0x06fe('0x42')],_0x3d438c[_0x06fe('0x43')]);_0x341d5f['attributes']=_[_0x06fe('0x46')](_0x3d438c[_0x06fe('0x42')],qs[_0x06fe('0x47')](_0x169fd8[_0x06fe('0x43')][_0x06fe('0x47')]));_0x341d5f[_0x06fe('0x48')]=_0x341d5f[_0x06fe('0x48')]['length']?_0x341d5f[_0x06fe('0x48')]:_0x3d438c['model'];if(!_0x169fd8[_0x06fe('0x43')][_0x06fe('0x49')](_0x06fe('0x4a'))){_0x341d5f[_0x06fe('0x31')]=qs[_0x06fe('0x31')](_0x169fd8[_0x06fe('0x43')]['limit']);_0x341d5f[_0x06fe('0x2f')]=qs['offset'](_0x169fd8[_0x06fe('0x43')][_0x06fe('0x2f')]);}_0x341d5f[_0x06fe('0x4b')]=qs[_0x06fe('0x4c')](_0x169fd8['query']['sort']);_0x341d5f[_0x06fe('0x4d')]=qs[_0x06fe('0x45')](_[_0x06fe('0x4e')](_0x169fd8['query'],_0x3d438c[_0x06fe('0x45')]),_0x3e5179);if(_0x169fd8[_0x06fe('0x43')][_0x06fe('0x4f')]){_0x341d5f[_0x06fe('0x4d')]=_[_0x06fe('0x50')](_0x341d5f['where'],{'$or':_[_0x06fe('0x3e')](_0x3e5179,function(_0x1b19ea){if(_0x1b19ea[_0x06fe('0x41')]!=='VIRTUAL'){var _0x4f0781={};_0x4f0781[_0x1b19ea[_0x06fe('0x3a')]]={'$like':'%'+_0x169fd8[_0x06fe('0x43')][_0x06fe('0x4f')]+'%'};return _0x4f0781;}})});}_0x341d5f=_[_0x06fe('0x50')]({},_0x341d5f,_0x169fd8[_0x06fe('0x51')]);var _0x1952e9={'where':_0x341d5f[_0x06fe('0x4d')]};return db[_0x06fe('0x52')][_0x06fe('0x32')](_0x1952e9)['then'](function(_0x42f985){_0xd4a147[_0x06fe('0x32')]=_0x42f985;if(_0x169fd8['query']['includeAll']){_0x341d5f[_0x06fe('0x53')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x341d5f);})[_0x06fe('0x23')](function(_0x162a97){_0xd4a147['rows']=_0x162a97;return _0xd4a147;})['then'](respondWithFilteredResult(_0x1f99dc,_0x341d5f))[_0x06fe('0x2b')](handleError(_0x1f99dc,null));};exports[_0x06fe('0x54')]=function(_0x37fc3c,_0x22364c){var _0x272ac5={'raw':![],'where':{'id':_0x37fc3c[_0x06fe('0x55')]['id']},'include':[{'model':db[_0x06fe('0x56')],'as':'mandatoryDispositionPause'}]},_0x142fbc={};_0x142fbc[_0x06fe('0x42')]=_[_0x06fe('0x44')](db['WhatsappAccount']['rawAttributes']);_0x142fbc[_0x06fe('0x43')]=_['keys'](_0x37fc3c[_0x06fe('0x43')]);_0x142fbc[_0x06fe('0x45')]=_[_0x06fe('0x46')](_0x142fbc[_0x06fe('0x42')],_0x142fbc[_0x06fe('0x43')]);_0x272ac5[_0x06fe('0x48')]=_[_0x06fe('0x46')](_0x142fbc[_0x06fe('0x42')],qs[_0x06fe('0x47')](_0x37fc3c['query'][_0x06fe('0x47')]));_0x272ac5[_0x06fe('0x48')]=_0x272ac5[_0x06fe('0x48')][_0x06fe('0x57')]?_0x272ac5['attributes']:_0x142fbc[_0x06fe('0x42')];if(_0x37fc3c[_0x06fe('0x43')][_0x06fe('0x58')]){_0x272ac5[_0x06fe('0x53')]=[{'all':!![]}];}_0x272ac5=_['merge']({},_0x272ac5,_0x37fc3c[_0x06fe('0x51')]);return db['WhatsappAccount'][_0x06fe('0x59')](_0x272ac5)[_0x06fe('0x23')](handleEntityNotFound(_0x22364c,null))['then'](respondWithResult(_0x22364c,null))[_0x06fe('0x2b')](handleError(_0x22364c,null));};exports[_0x06fe('0x5a')]=function(_0x23e206,_0x5081a8){return db[_0x06fe('0x52')][_0x06fe('0x5a')](_0x23e206[_0x06fe('0x5b')],{})[_0x06fe('0x23')](function(_0x4b7291){var _0x3fb3cd=_0x23e206[_0x06fe('0x5c')][_0x06fe('0x5d')]({'plain':!![]});if(!_0x3fb3cd)throw new Error(_0x06fe('0x5e'));if(_0x3fb3cd['role']==='user'){var _0x20f61d=_0x4b7291[_0x06fe('0x5d')]({'plain':!![]});var _0x462071='WhatsappAccounts';return db[_0x06fe('0x5f')][_0x06fe('0x59')]({'where':{'name':_0x462071,'userProfileId':_0x3fb3cd[_0x06fe('0x60')]},'raw':!![]})[_0x06fe('0x23')](function(_0x54f48a){if(_0x54f48a&&_0x54f48a[_0x06fe('0x61')]===0x0){return db[_0x06fe('0x62')][_0x06fe('0x5a')]({'name':_0x20f61d['name'],'resourceId':_0x20f61d['id'],'type':_0x54f48a[_0x06fe('0x3a')],'sectionId':_0x54f48a['id']},{})[_0x06fe('0x23')](function(){return _0x4b7291;});}else{return _0x4b7291;}})['catch'](function(_0x222849){logger['error'](_0x06fe('0x63'),_0x222849);throw _0x222849;});}return _0x4b7291;})['then'](respondWithResult(_0x5081a8,0xc9))['catch'](handleError(_0x5081a8,null));};exports[_0x06fe('0x36')]=function(_0x35ffd9,_0x2cb74e){if(_0x35ffd9[_0x06fe('0x5b')]['id']){delete _0x35ffd9[_0x06fe('0x5b')]['id'];}return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x35ffd9[_0x06fe('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x06fe('0x3d')}]})[_0x06fe('0x23')](handleEntityNotFound(_0x2cb74e,null))[_0x06fe('0x23')](saveUpdates(_0x35ffd9[_0x06fe('0x5b')],null))[_0x06fe('0x23')](respondWithResult(_0x2cb74e,null))[_0x06fe('0x2b')](handleError(_0x2cb74e,null));};exports[_0x06fe('0x37')]=function(_0x18990b,_0x77fd6a){return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x18990b[_0x06fe('0x55')]['id']}})['then'](handleEntityNotFound(_0x77fd6a,null))[_0x06fe('0x23')](removeEntity(_0x77fd6a,null))[_0x06fe('0x2b')](handleError(_0x77fd6a,null));};exports[_0x06fe('0x64')]=function(_0xd10c26,_0x322620){return db['WhatsappAccount']['describe']()[_0x06fe('0x23')](respondWithResult(_0x322620,null))[_0x06fe('0x2b')](handleError(_0x322620,null));};exports['addDisposition']=function(_0x151dd0,_0x4eafb3,_0x345f8a){if(_0x151dd0[_0x06fe('0x5b')]['id']){delete _0x151dd0['body']['id'];}return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x151dd0[_0x06fe('0x55')]['id']}})['then'](handleEntityNotFound(_0x4eafb3,null))['then'](function(_0x4fbdfd){if(_0x4fbdfd){_0x151dd0['body'][_0x06fe('0x65')]=_0x4fbdfd['id'];return db[_0x06fe('0x66')][_0x06fe('0x5a')](_0x151dd0[_0x06fe('0x5b')]);}})[_0x06fe('0x23')](respondWithResult(_0x4eafb3,null))['catch'](handleError(_0x4eafb3,null));};exports[_0x06fe('0x67')]=function(_0x4fbc35,_0x35e55a,_0x253086){var _0x5dd88d={'raw':![],'where':{}};var _0x56d4f1={};var _0x2713af={'count':0x0,'rows':[]};return db[_0x06fe('0x52')][_0x06fe('0x68')]({'where':{'id':_0x4fbc35[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x35e55a,null))[_0x06fe('0x23')](function(_0x21c255){if(_0x21c255){_0x56d4f1[_0x06fe('0x42')]=_[_0x06fe('0x44')](db['Disposition']['rawAttributes']);_0x56d4f1[_0x06fe('0x43')]=_[_0x06fe('0x44')](_0x4fbc35['query']);_0x56d4f1[_0x06fe('0x45')]=_[_0x06fe('0x46')](_0x56d4f1['model'],_0x56d4f1[_0x06fe('0x43')]);_0x5dd88d['attributes']=_[_0x06fe('0x46')](_0x56d4f1[_0x06fe('0x42')],qs[_0x06fe('0x47')](_0x4fbc35[_0x06fe('0x43')][_0x06fe('0x47')]));_0x5dd88d[_0x06fe('0x48')]=_0x5dd88d[_0x06fe('0x48')][_0x06fe('0x57')]?_0x5dd88d[_0x06fe('0x48')]:_0x56d4f1['model'];if(!_0x4fbc35[_0x06fe('0x43')][_0x06fe('0x49')](_0x06fe('0x4a'))){_0x5dd88d[_0x06fe('0x31')]=qs[_0x06fe('0x31')](_0x4fbc35['query'][_0x06fe('0x31')]);_0x5dd88d[_0x06fe('0x2f')]=qs[_0x06fe('0x2f')](_0x4fbc35[_0x06fe('0x43')]['offset']);}_0x5dd88d[_0x06fe('0x4b')]=qs['sort'](_0x4fbc35[_0x06fe('0x43')][_0x06fe('0x4c')]);_0x5dd88d[_0x06fe('0x4d')]=qs[_0x06fe('0x45')](_['pick'](_0x4fbc35['query'],_0x56d4f1['filters']));_0x5dd88d[_0x06fe('0x4d')][_0x06fe('0x65')]=_0x21c255['id'];if(_0x4fbc35[_0x06fe('0x43')][_0x06fe('0x4f')]){_0x5dd88d[_0x06fe('0x4d')]=_[_0x06fe('0x50')](_0x5dd88d['where'],{'$or':_[_0x06fe('0x3e')](_0x5dd88d[_0x06fe('0x48')],function(_0x4fe950){var _0x1e9b5d={};_0x1e9b5d[_0x4fe950]={'$like':'%'+_0x4fbc35[_0x06fe('0x43')]['filter']+'%'};return _0x1e9b5d;})});}_0x5dd88d=_['merge']({},_0x5dd88d,_0x4fbc35['options']);return db[_0x06fe('0x66')]['count']({'where':_0x5dd88d[_0x06fe('0x4d')]})[_0x06fe('0x23')](function(_0xe90e3f){_0x2713af['count']=_0xe90e3f;if(_0x4fbc35[_0x06fe('0x43')]['includeAll']){_0x5dd88d[_0x06fe('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x06fe('0x69')](_0x5dd88d);})[_0x06fe('0x23')](function(_0x198bdf){_0x2713af[_0x06fe('0x6a')]=_0x198bdf;return _0x2713af;});}})[_0x06fe('0x23')](respondWithFilteredResult(_0x35e55a,_0x5dd88d))[_0x06fe('0x2b')](handleError(_0x35e55a,null));};exports[_0x06fe('0x6b')]=function(_0x149075,_0x2ec4e1,_0x54b7ca){return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x149075[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x2ec4e1,null))['then'](function(_0x2d9bf9){if(_0x2d9bf9){return _0x2d9bf9['removeDispositions'](_0x149075['query']['ids']);}})[_0x06fe('0x23')](respondWithStatusCode(_0x2ec4e1,null))['catch'](handleError(_0x2ec4e1,null));};exports['addAnswer']=function(_0x1f8401,_0x8b3553,_0x2fdc88){if(_0x1f8401['body']['id']){delete _0x1f8401[_0x06fe('0x5b')]['id'];}return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x1f8401[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x8b3553,null))['then'](function(_0x297e76){if(_0x297e76){_0x1f8401[_0x06fe('0x5b')][_0x06fe('0x65')]=_0x297e76['id'];return db[_0x06fe('0x6c')][_0x06fe('0x5a')](_0x1f8401['body']);}})[_0x06fe('0x23')](respondWithResult(_0x8b3553,null))['catch'](handleError(_0x8b3553,null));};exports['getAnswers']=function(_0x4aaddb,_0x3e0b3b,_0x2686a3){var _0x144767={'raw':![],'where':{}};var _0x349a5c={};var _0x114a3d={'count':0x0,'rows':[]};return db[_0x06fe('0x52')][_0x06fe('0x68')]({'where':{'id':_0x4aaddb[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x3e0b3b,null))[_0x06fe('0x23')](function(_0xd4b59d){if(_0xd4b59d){_0x349a5c['model']=_[_0x06fe('0x44')](db[_0x06fe('0x6c')]['rawAttributes']);_0x349a5c['query']=_[_0x06fe('0x44')](_0x4aaddb['query']);_0x349a5c[_0x06fe('0x45')]=_['intersection'](_0x349a5c[_0x06fe('0x42')],_0x349a5c[_0x06fe('0x43')]);_0x144767[_0x06fe('0x48')]=_[_0x06fe('0x46')](_0x349a5c[_0x06fe('0x42')],qs[_0x06fe('0x47')](_0x4aaddb[_0x06fe('0x43')][_0x06fe('0x47')]));_0x144767['attributes']=_0x144767[_0x06fe('0x48')][_0x06fe('0x57')]?_0x144767[_0x06fe('0x48')]:_0x349a5c['model'];if(!_0x4aaddb[_0x06fe('0x43')][_0x06fe('0x49')](_0x06fe('0x4a'))){_0x144767['limit']=qs[_0x06fe('0x31')](_0x4aaddb['query'][_0x06fe('0x31')]);_0x144767[_0x06fe('0x2f')]=qs[_0x06fe('0x2f')](_0x4aaddb['query'][_0x06fe('0x2f')]);}_0x144767[_0x06fe('0x4b')]=qs[_0x06fe('0x4c')](_0x4aaddb[_0x06fe('0x43')]['sort']);_0x144767[_0x06fe('0x4d')]=qs[_0x06fe('0x45')](_[_0x06fe('0x4e')](_0x4aaddb[_0x06fe('0x43')],_0x349a5c[_0x06fe('0x45')]));_0x144767['where']['WhatsappAccountId']=_0xd4b59d['id'];if(_0x4aaddb[_0x06fe('0x43')]['filter']){_0x144767['where']=_[_0x06fe('0x50')](_0x144767[_0x06fe('0x4d')],{'$or':_[_0x06fe('0x3e')](_0x144767['attributes'],function(_0x5508a4){var _0x33e93c={};_0x33e93c[_0x5508a4]={'$like':'%'+_0x4aaddb[_0x06fe('0x43')]['filter']+'%'};return _0x33e93c;})});}_0x144767=_['merge']({},_0x144767,_0x4aaddb['options']);return db[_0x06fe('0x6c')][_0x06fe('0x32')]({'where':_0x144767[_0x06fe('0x4d')]})[_0x06fe('0x23')](function(_0x23ee52){_0x114a3d['count']=_0x23ee52;if(_0x4aaddb['query']['includeAll']){_0x144767[_0x06fe('0x53')]=[{'all':!![]}];}return db[_0x06fe('0x6c')][_0x06fe('0x69')](_0x144767);})[_0x06fe('0x23')](function(_0x59d4d0){_0x114a3d[_0x06fe('0x6a')]=_0x59d4d0;return _0x114a3d;});}})['then'](respondWithFilteredResult(_0x3e0b3b,_0x144767))[_0x06fe('0x2b')](handleError(_0x3e0b3b,null));};exports['removeAnswers']=function(_0x194e73,_0x555905,_0x55a964){return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x194e73[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x555905,null))[_0x06fe('0x23')](function(_0x112e7a){if(_0x112e7a){return _0x112e7a[_0x06fe('0x6d')](_0x194e73[_0x06fe('0x43')][_0x06fe('0x6e')]);}})[_0x06fe('0x23')](respondWithStatusCode(_0x555905,null))[_0x06fe('0x2b')](handleError(_0x555905,null));};exports[_0x06fe('0x6f')]=function(_0x46429f,_0x5956e0,_0x1712cc){return db['WhatsappAccount'][_0x06fe('0x59')]({'where':{'id':_0x46429f[_0x06fe('0x55')]['id']}})['then'](handleEntityNotFound(_0x5956e0,null))[_0x06fe('0x23')](function(_0x1e8963){if(_0x1e8963){return _0x1e8963[_0x06fe('0x6f')](_0x46429f[_0x06fe('0x5b')][_0x06fe('0x6e')],_['omit'](_0x46429f['body'],[_0x06fe('0x6e'),'id'])||{})['spread'](function(_0x33c62b){for(var _0x4b0ef4=0x0;_0x4b0ef4<_0x46429f[_0x06fe('0x5b')]['ids'][_0x06fe('0x57')];_0x4b0ef4+=0x1){socket[_0x06fe('0x70')](_0x06fe('0x71'),{'UserId':Number(_0x46429f['body'][_0x06fe('0x6e')][_0x4b0ef4]),'WhatsappAccountId':Number(_0x46429f['params']['id'])});}return _0x33c62b;});}})[_0x06fe('0x23')](respondWithResult(_0x5956e0,null))['catch'](handleError(_0x5956e0,null));};exports[_0x06fe('0x72')]=function(_0x3f94fb,_0x2e5e16,_0x571746){return db['WhatsappAccount']['find']({'where':{'id':_0x3f94fb['params']['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x2e5e16,null))[_0x06fe('0x23')](function(_0x2fe14f){if(_0x2fe14f){return _0x2fe14f['removeAgents'](_0x3f94fb[_0x06fe('0x43')][_0x06fe('0x6e')])[_0x06fe('0x23')](function(){if(_[_0x06fe('0x73')](_0x3f94fb[_0x06fe('0x43')][_0x06fe('0x6e')])){for(var _0x598e43=0x0;_0x598e43<_0x3f94fb['query'][_0x06fe('0x6e')]['length'];_0x598e43+=0x1){socket[_0x06fe('0x70')](_0x06fe('0x74'),{'UserId':Number(_0x3f94fb['query']['ids'][_0x598e43]),'WhatsappAccountId':Number(_0x3f94fb[_0x06fe('0x55')]['id'])});}}else{socket[_0x06fe('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x3f94fb[_0x06fe('0x43')]['ids']),'WhatsappAccountId':Number(_0x3f94fb[_0x06fe('0x55')]['id'])});}});}})[_0x06fe('0x23')](respondWithStatusCode(_0x2e5e16,null))[_0x06fe('0x2b')](handleError(_0x2e5e16,null));};exports['getAgents']=function(_0x3ba4e9,_0x4fdd96,_0x10922d){var _0x55c7b9={};var _0x3eae50={};var _0x1b585c;var _0x510a3a;return db[_0x06fe('0x52')]['findOne']({'where':{'id':_0x3ba4e9[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x4fdd96,null))[_0x06fe('0x23')](function(_0x3ab0ce){if(_0x3ab0ce){_0x1b585c=_0x3ab0ce;_0x3eae50[_0x06fe('0x42')]=_[_0x06fe('0x44')](db[_0x06fe('0x75')][_0x06fe('0x3f')]);_0x3eae50[_0x06fe('0x43')]=_[_0x06fe('0x44')](_0x3ba4e9[_0x06fe('0x43')]);_0x3eae50[_0x06fe('0x45')]=_[_0x06fe('0x46')](_0x3eae50[_0x06fe('0x42')],_0x3eae50[_0x06fe('0x43')]);_0x55c7b9[_0x06fe('0x48')]=_[_0x06fe('0x46')](_0x3eae50[_0x06fe('0x42')],qs[_0x06fe('0x47')](_0x3ba4e9['query']['fields']));_0x55c7b9[_0x06fe('0x48')]=_0x55c7b9[_0x06fe('0x48')][_0x06fe('0x57')]?_0x55c7b9[_0x06fe('0x48')]:_0x3eae50[_0x06fe('0x42')];_0x55c7b9['order']=qs[_0x06fe('0x4c')](_0x3ba4e9[_0x06fe('0x43')][_0x06fe('0x4c')]);_0x55c7b9['where']=qs['filters'](_[_0x06fe('0x4e')](_0x3ba4e9[_0x06fe('0x43')],_0x3eae50[_0x06fe('0x45')]));if(_0x3ba4e9[_0x06fe('0x43')]['filter']){_0x55c7b9['where']=_[_0x06fe('0x50')](_0x55c7b9[_0x06fe('0x4d')],{'$or':_[_0x06fe('0x3e')](_0x55c7b9[_0x06fe('0x48')],function(_0xef43c4){var _0x39cbcd={};_0x39cbcd[_0xef43c4]={'$like':'%'+_0x3ba4e9[_0x06fe('0x43')]['filter']+'%'};return _0x39cbcd;})});}_0x55c7b9=_[_0x06fe('0x50')]({},_0x55c7b9,_0x3ba4e9[_0x06fe('0x51')]);return _0x1b585c[_0x06fe('0x76')](_0x55c7b9);}})['then'](function(_0x293d67){if(_0x293d67){_0x510a3a=_0x293d67[_0x06fe('0x57')];if(!_0x3ba4e9[_0x06fe('0x43')][_0x06fe('0x49')](_0x06fe('0x4a'))){_0x55c7b9[_0x06fe('0x31')]=qs['limit'](_0x3ba4e9[_0x06fe('0x43')][_0x06fe('0x31')]);_0x55c7b9['offset']=qs[_0x06fe('0x2f')](_0x3ba4e9[_0x06fe('0x43')][_0x06fe('0x2f')]);}return _0x1b585c['getAgents'](_0x55c7b9);}})[_0x06fe('0x23')](function(_0x2b361d){if(_0x2b361d){return _0x2b361d?{'count':_0x510a3a,'rows':_0x2b361d}:null;}})['then'](respondWithResult(_0x4fdd96,null))[_0x06fe('0x2b')](handleError(_0x4fdd96,null));};exports[_0x06fe('0x77')]=function(_0x45b688,_0x4bc684,_0x479f74){return db['WhatsappAccount']['findOne']({'where':{'id':_0x45b688[_0x06fe('0x55')]['id']}})['then'](handleEntityNotFound(_0x4bc684,null))['then'](function(_0x8d1993){if(_0x8d1993){return db['sequelize'][_0x06fe('0x78')](function(_0x2b1a0e){return db[_0x06fe('0x79')][_0x06fe('0x37')]({'where':{'WhatsappAccountId':_0x45b688[_0x06fe('0x55')]['id']},'transaction':_0x2b1a0e})['then'](function(_0x537654){var _0x116948=_['map'](_0x45b688[_0x06fe('0x5b')],function(_0x20ed3f){_0x20ed3f[_0x06fe('0x65')]=_0x45b688[_0x06fe('0x55')]['id'];return _0x20ed3f;});return db['WhatsappApplication'][_0x06fe('0x7a')](_0x116948,{'transaction':_0x2b1a0e});});})['then'](function(){return db[_0x06fe('0x79')][_0x06fe('0x7b')]({'where':{'WhatsappAccountId':_0x45b688[_0x06fe('0x55')]['id']},'order':_0x06fe('0x7c')});});}})[_0x06fe('0x23')](respondWithResult(_0x4bc684,null))['catch'](handleError(_0x4bc684,null));};exports[_0x06fe('0x7d')]=function(_0x2a348b,_0x3eb9c3,_0x90e7be){var _0x548d4a={};var _0x4b4824={};var _0x2b71ec;var _0x15db01;return db[_0x06fe('0x52')][_0x06fe('0x68')]({'where':{'id':_0x2a348b[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x3eb9c3,null))[_0x06fe('0x23')](function(_0x475e02){if(_0x475e02){_0x2b71ec=_0x475e02;_0x4b4824[_0x06fe('0x42')]=_['keys'](db['WhatsappApplication'][_0x06fe('0x3f')]);_0x4b4824[_0x06fe('0x43')]=_[_0x06fe('0x44')](_0x2a348b[_0x06fe('0x43')]);_0x4b4824['filters']=_[_0x06fe('0x46')](_0x4b4824[_0x06fe('0x42')],_0x4b4824[_0x06fe('0x43')]);_0x548d4a[_0x06fe('0x48')]=_[_0x06fe('0x46')](_0x4b4824[_0x06fe('0x42')],qs['fields'](_0x2a348b[_0x06fe('0x43')][_0x06fe('0x47')]));_0x548d4a[_0x06fe('0x48')]=_0x548d4a['attributes'][_0x06fe('0x57')]?_0x548d4a[_0x06fe('0x48')]:_0x4b4824['model'];_0x548d4a[_0x06fe('0x4b')]=qs[_0x06fe('0x4c')](_0x2a348b[_0x06fe('0x43')][_0x06fe('0x4c')]);_0x548d4a[_0x06fe('0x4d')]=qs[_0x06fe('0x45')](_[_0x06fe('0x4e')](_0x2a348b[_0x06fe('0x43')],_0x4b4824[_0x06fe('0x45')]));if(_0x2a348b[_0x06fe('0x43')][_0x06fe('0x4f')]){_0x548d4a[_0x06fe('0x4d')]=_[_0x06fe('0x50')](_0x548d4a[_0x06fe('0x4d')],{'$or':_[_0x06fe('0x3e')](_0x548d4a[_0x06fe('0x48')],function(_0x21992f){var _0x21ea31={};_0x21ea31[_0x21992f]={'$like':'%'+_0x2a348b[_0x06fe('0x43')]['filter']+'%'};return _0x21ea31;})});}_0x548d4a=_[_0x06fe('0x50')]({},_0x548d4a,_0x2a348b['options']);return _0x2b71ec['getApplications'](_0x548d4a);}})[_0x06fe('0x23')](function(_0x3b8f28){if(_0x3b8f28){_0x15db01=_0x3b8f28['length'];if(!_0x2a348b[_0x06fe('0x43')]['hasOwnProperty'](_0x06fe('0x4a'))){_0x548d4a[_0x06fe('0x31')]=qs[_0x06fe('0x31')](_0x2a348b[_0x06fe('0x43')]['limit']);_0x548d4a[_0x06fe('0x2f')]=qs[_0x06fe('0x2f')](_0x2a348b[_0x06fe('0x43')][_0x06fe('0x2f')]);}return _0x2b71ec[_0x06fe('0x7d')](_0x548d4a);}})[_0x06fe('0x23')](function(_0x16c236){if(_0x16c236){return _0x16c236?{'count':_0x15db01,'rows':_0x16c236}:null;}})[_0x06fe('0x23')](respondWithResult(_0x3eb9c3,null))[_0x06fe('0x2b')](handleError(_0x3eb9c3,null));};exports[_0x06fe('0x7e')]=function(_0x4bc60a,_0x20e8df,_0x5c4997){var _0x5a2c89={'channel':'whatsapp'};var _0xf7f3de=[];var _0x146767=[];var _0x366c4e={};return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x4bc60a[_0x06fe('0x55')]['id']},'include':[{'model':db[_0x06fe('0x79')],'as':_0x06fe('0x7f')}]})[_0x06fe('0x23')](handleEntityNotFound(_0x20e8df,null))[_0x06fe('0x23')](function(_0x2b95e9){_0x5a2c89['account']=_0x2b95e9;_0x5a2c89[_0x06fe('0x80')]=_[_0x06fe('0x81')](_0x2b95e9['Applications'],[_0x06fe('0x7c')],[_0x06fe('0x82')]);if(_0x5a2c89[_0x06fe('0x83')][_0x06fe('0x7f')]){delete _0x5a2c89[_0x06fe('0x83')][_0x06fe('0x7f')];}return db['CmContact'][_0x06fe('0x64')]();})[_0x06fe('0x23')](function(_0x27ae45){if(!_0x27ae45){throw new db[(_0x06fe('0x84'))][(_0x06fe('0x85'))](_0x06fe('0x86'));}_0xf7f3de=_[_0x06fe('0x87')](_['keys'](_0x27ae45),[_0x06fe('0x88'),_0x06fe('0x89')]);_0x146767=_['difference'](_[_0x06fe('0x44')](_0x27ae45),[_0x06fe('0x88'),_0x06fe('0x89'),_0x06fe('0x8a'),_0x06fe('0x8b')]);_0x5a2c89[_0x06fe('0x5b')]={'mapKey':'mobile'};if(_0x5a2c89[_0x06fe('0x83')]['type']&&_0x5a2c89[_0x06fe('0x83')]['type']===_0x06fe('0x8c')){_0x5a2c89['body']['from']=_0x4bc60a[_0x06fe('0x5b')][_0x06fe('0x8d')][_0x06fe('0x8e')](_0x06fe('0x8f'),'');_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x5b')]=_0x4bc60a[_0x06fe('0x5b')]['Body'];_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x90')]=_0x4bc60a[_0x06fe('0x5b')][_0x06fe('0x91')];}if(_0x5a2c89[_0x06fe('0x5b')]['id']){delete _0x5a2c89[_0x06fe('0x5b')]['id'];}if(_[_0x06fe('0x92')](_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x93')])){throw new db['Sequelize'][(_0x06fe('0x85'))](_0x06fe('0x94'));}if(_[_0x06fe('0x92')](_0x5a2c89[_0x06fe('0x5b')]['body'])||_0x5a2c89['body'][_0x06fe('0x5b')]===''){throw new db['Sequelize'][(_0x06fe('0x85'))](_0x06fe('0x95'));}if(_['isNil'](_0x5a2c89['body'][_0x06fe('0x96')])){throw new db[(_0x06fe('0x84'))][(_0x06fe('0x85'))](_0x06fe('0x97')+_0x146767);}if(!_[_0x06fe('0x98')](_0x146767,_0x5a2c89['body']['mapKey'])){throw new db[(_0x06fe('0x84'))][(_0x06fe('0x85'))](_0x06fe('0x99')+_0x146767);}_0x366c4e[_0x5a2c89[_0x06fe('0x5b')]['mapKey']]=_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x93')];return db[_0x06fe('0x9a')][_0x06fe('0x59')]({'where':{'id':_0x5a2c89[_0x06fe('0x83')][_0x06fe('0x8b')]},'include':[{'model':db[_0x06fe('0x9b')],'as':'Contacts','where':_0x366c4e,'limit':0x1,'order':[[_0x06fe('0x89'),_0x06fe('0x9c')]]}]});})[_0x06fe('0x23')](handleEntityNotFound(_0x20e8df,null))[_0x06fe('0x23')](function(_0x3aac7b){if(_0x3aac7b){_0x5a2c89[_0x06fe('0x9d')]=_[_0x06fe('0x9e')](_0x3aac7b,['Contacts']);if(_0x3aac7b[_0x06fe('0x9f')][_0x06fe('0x57')]){return _0x3aac7b[_0x06fe('0x9f')][0x0];}var _0x6d0e1c=_['defaults'](_0x5a2c89[_0x06fe('0x5b')],{'firstName':_0x5a2c89['body'][_0x06fe('0x93')],'ListId':_0x3aac7b['id']});_0x6d0e1c[_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x96')]]=_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x93')];return db['CmContact'][_0x06fe('0x5a')](_0x6d0e1c,{'fields':_0xf7f3de,'raw':!![]});}})[_0x06fe('0x23')](handleEntityNotFound(_0x20e8df,null))['then'](function(_0x58eff8){if(_0x58eff8){_0x5a2c89[_0x06fe('0xa0')]=_0x58eff8;var _0xdb9ce2={'ContactId':_0x58eff8['id'],'phone':_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x93')],'WhatsappAccountId':_0x4bc60a[_0x06fe('0x55')]['id']};var _0x15cf73={'ContactId':_0x58eff8['id'],'WhatsappAccountId':_0x4bc60a[_0x06fe('0x55')]['id'],'closed':![]};return db[_0x06fe('0xa1')]['find']({'where':_0x15cf73})['then'](function(_0x4dd475){if(_0x4dd475){return[_0x4dd475,![]];}return db[_0x06fe('0xa1')]['create'](_0xdb9ce2)[_0x06fe('0x23')](function(_0x40b3df){return[_0x40b3df,!![]];});});}})[_0x06fe('0xa2')](function(_0x226981,_0x4c8ad7){_0x5a2c89[_0x06fe('0xa3')]=_0x226981[_0x06fe('0x5d')]({'plain':!![]});_0x5a2c89['interaction'][_0x06fe('0xa4')]=![];if(_0x4c8ad7){if(_0x5a2c89[_0x06fe('0x83')][_0x06fe('0xa5')]){_0x5a2c89['applications'][_0x06fe('0xa6')]({'id':0x0,'priority':_0x5a2c89['applications'][_0x06fe('0x57')]+0x1,'app':_0x06fe('0xa7'),'appdata':_0x06fe('0xa8'),'interval':'*,*,*,*'});}_0x5a2c89['interaction'][_0x06fe('0xa4')]=!![];}return db['WhatsappMessage'][_0x06fe('0x5a')]({'phone':_0x5a2c89[_0x06fe('0x5b')]['from'],'messageId':_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x90')],'body':_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x5b')],'WhatsappAccountId':_0x4bc60a['params']['id'],'WhatsappInteractionId':_0x226981['id'],'direction':'in','ContactId':_0x226981[_0x06fe('0xa9')],'AttachmentId':_0x5a2c89[_0x06fe('0x5b')]['AttachmentId']});})[_0x06fe('0x23')](function(_0x1bab0d){_0x5a2c89['message']=_0x1bab0d;if(_0x5a2c89['interaction'][_0x06fe('0xaa')]){return db[_0x06fe('0x75')]['find']({'attributes':['id',_0x06fe('0x3a')],'where':{'id':_0x5a2c89[_0x06fe('0xa3')][_0x06fe('0xaa')]}})[_0x06fe('0x23')](function(_0x1c3e97){if(_0x1c3e97){_0x5a2c89[_0x06fe('0x80')][_0x06fe('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1c3e97[_0x06fe('0x3a')]+','+(_0x5a2c89['account'][_0x06fe('0xac')]||0xa),'interval':_0x06fe('0xad')});}return respondWithRpcPromise(_0x06fe('0xae'),_0x06fe('0xaf'),_0x5a2c89);});}return respondWithRpcPromise(_0x06fe('0xae'),'startRouting',_0x5a2c89);})[_0x06fe('0x23')](function(_0x474cd9){if(_0x474cd9){var _0x50c2cc=0xc8;var _0x4e51ec='receiveMessage';logger[_0x06fe('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4e51ec,_0x50c2cc,_0x06fe('0xb0'));logger['debug'](_0x06fe('0xb1'),_0x4e51ec,_0x50c2cc,'entity\x20found',JSON[_0x06fe('0xb2')](_0x474cd9));if(_0x5a2c89[_0x06fe('0x83')][_0x06fe('0x41')]===_0x06fe('0x8c')){return _0x20e8df[_0x06fe('0x2d')](_0x50c2cc)[_0x06fe('0x33')](_0x06fe('0xb3'),_0x06fe('0xb4'))[_0x06fe('0x3b')](_0x06fe('0xb5'));}else{return _0x20e8df[_0x06fe('0x2d')](_0x50c2cc)[_0x06fe('0x2e')](_0x474cd9);}}})[_0x06fe('0x2b')](handleError(_0x20e8df,null));};exports['send']=function(_0x435794,_0x331899,_0x2bb76f){var _0x7746f7,_0x4b0a4b,_0x3b62d4;if(_[_0x06fe('0x92')](_0x435794[_0x06fe('0x5b')][_0x06fe('0x5b')])||_0x435794[_0x06fe('0x5b')][_0x06fe('0x5b')]===''){throw new db['Sequelize'][(_0x06fe('0x85'))](_0x06fe('0x95'));}if(_[_0x06fe('0x92')](_0x435794[_0x06fe('0x5b')]['to'])){throw new db[(_0x06fe('0x84'))][(_0x06fe('0x85'))]('to\x20is\x20mandatory');}_0x7746f7=_0x435794[_0x06fe('0x5b')]['to'];return db['WhatsappAccount'][_0x06fe('0x59')]({'where':{'id':_0x435794[_0x06fe('0x55')]['id']},'include':[{'model':db[_0x06fe('0x9a')],'as':_0x06fe('0xb6'),'include':[{'model':db[_0x06fe('0x9b')],'as':_0x06fe('0x9f'),'where':{'mobile':_0x7746f7},'limit':0x1,'order':[[_0x06fe('0x89'),_0x06fe('0x9c')]]}]}]})['then'](handleEntityNotFound(_0x331899,null))[_0x06fe('0x23')](function(_0x1fe7e1){if(_0x1fe7e1&&_0x1fe7e1[_0x06fe('0xb6')]){_0x4b0a4b=_0x1fe7e1[_0x06fe('0x5d')]({'plain':!![]});if(_0x4b0a4b['List']&&_0x4b0a4b['List']['Contacts'][_0x06fe('0x57')]){return _0x4b0a4b[_0x06fe('0xb6')][_0x06fe('0x9f')][0x0];}return db[_0x06fe('0x9b')]['create'](_[_0x06fe('0xb7')](_0x435794[_0x06fe('0x5b')],{'firstName':_0x7746f7,'mobile':_0x7746f7,'phone':_0x7746f7,'ListId':_0x4b0a4b[_0x06fe('0x8b')]}));}})[_0x06fe('0x23')](handleEntityNotFound(_0x331899,null))[_0x06fe('0x23')](function(_0x5f4b7e){if(_0x5f4b7e){_0x3b62d4=_0x5f4b7e;return db['WhatsappInteraction'][_0x06fe('0x59')]({'where':{'ContactId':_0x3b62d4['id'],'closed':![],'WhatsappAccountId':_0x4b0a4b['id']}})[_0x06fe('0x23')](function(_0x138e49){if(_0x138e49){return[_0x138e49,![]];}return db[_0x06fe('0xa1')][_0x06fe('0x5a')]({'UserId':_0x435794['user']['id'],'ContactId':_0x3b62d4['id'],'WhatsappAccountId':_0x4b0a4b['id'],'phone':_0x7746f7,'firstMsgDirection':'out','Messages':[_[_0x06fe('0x50')](_0x435794['body'],{'read':![],'body':_0x435794[_0x06fe('0x5b')][_0x06fe('0x5b')],'phone':_0x7746f7,'WhatsappAccountId':_0x4b0a4b['id'],'UserId':_0x435794[_0x06fe('0x5c')]['id'],'ContactId':_0x3b62d4['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})['then'](function(_0x138fcc){return[_0x138fcc,!![]];});});}})[_0x06fe('0xa2')](function(_0x56b9b3,_0x1607f8){if(_0x1607f8){return _0x56b9b3;}return db['WhatsappMessage']['create'](_[_0x06fe('0x50')](_0x435794['body'],{'read':![],'body':_0x435794[_0x06fe('0x5b')][_0x06fe('0x5b')],'phone':_0x7746f7,'WhatsappAccountId':_0x4b0a4b['id'],'WhatsappInteractionId':_0x56b9b3['id'],'UserId':_0x435794[_0x06fe('0x5c')]['id'],'ContactId':_0x3b62d4['id']}))['then'](function(_0x4a8b0f){_0x56b9b3[_0x06fe('0xb8')][_0x06fe('0xb9')]=[];_0x56b9b3[_0x06fe('0xb8')][_0x06fe('0xb9')][_0x06fe('0xa6')](_0x4a8b0f[_0x06fe('0xb8')]);return _0x56b9b3;});})['then'](respondWithResult(_0x331899,null))[_0x06fe('0x2b')](handleError(_0x331899,null));}; \ No newline at end of file +var _0xd31b=['orderBy','asc','account','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','replace','Body','MessageSid','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','list','omit','defaults','contact','WhatsappInteraction','spread','interaction','push','close','unmanaged','*,*,*,*','created','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','twilio','set','\x0a','to\x20is\x20mandatory','List','Messages','dataValues','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','get','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','VIRTUAL','merge','options','where','includeAll','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','nolimit','order','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','emit','userWhatsappAccount:save','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','whatsapp','Applications','applications'];(function(_0x597036,_0x1ca362){var _0x34bdca=function(_0x323b88){while(--_0x323b88){_0x597036['push'](_0x597036['shift']());}};_0x34bdca(++_0x1ca362);}(_0xd31b,0x1a9));var _0xbd31=function(_0x222a4b,_0x3d53d2){_0x222a4b=_0x222a4b-0x0;var _0x2bedb3=_0xd31b[_0x222a4b];return _0x2bedb3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbd31('0x0'));var jsonpatch=require(_0xbd31('0x1'));var rp=require('request-promise');var moment=require(_0xbd31('0x2'));var BPromise=require(_0xbd31('0x3'));var Mustache=require(_0xbd31('0x4'));var util=require(_0xbd31('0x5'));var path=require(_0xbd31('0x6'));var sox=require(_0xbd31('0x7'));var csv=require('to-csv');var ejs=require(_0xbd31('0x8'));var fs=require('fs');var fs_extra=require(_0xbd31('0x9'));var _=require(_0xbd31('0xa'));var squel=require(_0xbd31('0xb'));var crypto=require(_0xbd31('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbd31('0xd'));var toCsv=require(_0xbd31('0xe'));var querystring=require('querystring');var Papa=require(_0xbd31('0xf'));var Redis=require('ioredis');var authService=require(_0xbd31('0x10'));var qs=require(_0xbd31('0x11'));var as=require(_0xbd31('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd31('0x13'))(_0xbd31('0x14'));var utils=require(_0xbd31('0x15'));var config=require(_0xbd31('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xbd31('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xbd31('0x18'))(new Redis(config['redis']));require(_0xbd31('0x19'))[_0xbd31('0x1a')](socket);var jayson=require(_0xbd31('0x1b'));var client=jayson[_0xbd31('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x22ebca,_0x357b3b,_0xbd99ae,_0x29a94c){return new BPromise(function(_0x296596,_0x3e593b){var _0x37a5cc=_0x29a94c||client;return _0x37a5cc[_0xbd31('0x1d')](_0x22ebca,_0xbd99ae)[_0xbd31('0x1e')](function(_0x3de314){logger[_0xbd31('0x1f')](_0xbd31('0x20'),_0x357b3b,_0xbd31('0x21'));logger['debug'](_0xbd31('0x22'),_0x357b3b,_0xbd31('0x21'),JSON[_0xbd31('0x23')](_0x3de314));if(_0x3de314[_0xbd31('0x24')]){if(_0x3de314[_0xbd31('0x24')][_0xbd31('0x25')]===0x1f4){logger[_0xbd31('0x24')](_0xbd31('0x20'),_0x357b3b,_0x3de314['error'][_0xbd31('0x26')]);return _0x3e593b(_0x3de314[_0xbd31('0x24')][_0xbd31('0x26')]);}logger['error'](_0xbd31('0x20'),_0x357b3b,_0x3de314[_0xbd31('0x24')][_0xbd31('0x26')]);return _0x296596(_0x3de314[_0xbd31('0x24')][_0xbd31('0x26')]);}else{logger[_0xbd31('0x1f')](_0xbd31('0x20'),_0x357b3b,_0xbd31('0x21'));_0x296596(_0x3de314[_0xbd31('0x27')][_0xbd31('0x26')]);}})['catch'](function(_0x113411){logger[_0xbd31('0x24')](_0xbd31('0x20'),_0x357b3b,_0x113411);_0x3e593b(_0x113411);});});}function respondWithStatusCode(_0x4ba48b,_0x19a6c4){_0x19a6c4=_0x19a6c4||0xcc;return function(_0x41d60f){if(_0x41d60f){return _0x4ba48b['sendStatus'](_0x19a6c4);}return _0x4ba48b[_0xbd31('0x28')](_0x19a6c4)['end']();};}function respondWithResult(_0x2ffe05,_0x1dbe30){_0x1dbe30=_0x1dbe30||0xc8;return function(_0x4bb702){if(_0x4bb702){return _0x2ffe05['status'](_0x1dbe30)[_0xbd31('0x29')](_0x4bb702);}};}function respondWithFilteredResult(_0x235cfc,_0xbfae25){return function(_0x17c7a9){if(_0x17c7a9){var _0x5e7315=typeof _0xbfae25[_0xbd31('0x2a')]===_0xbd31('0x2b')&&typeof _0xbfae25[_0xbd31('0x2c')]===_0xbd31('0x2b');var _0xa3458c=_0x17c7a9['count'];var _0x5cc3b8=_0x5e7315?0x0:_0xbfae25[_0xbd31('0x2a')];var _0x5e98ae=_0x5e7315?_0x17c7a9[_0xbd31('0x2d')]:_0xbfae25[_0xbd31('0x2a')]+_0xbfae25['limit'];var _0x523577;if(_0x5e98ae>=_0xa3458c){_0x5e98ae=_0xa3458c;_0x523577=0xc8;}else{_0x523577=0xce;}_0x235cfc[_0xbd31('0x28')](_0x523577);return _0x235cfc['set'](_0xbd31('0x2e'),_0x5cc3b8+'-'+_0x5e98ae+'/'+_0xa3458c)[_0xbd31('0x29')](_0x17c7a9);}return null;};}function patchUpdates(_0x4f8195){return function(_0xc6e314){try{jsonpatch[_0xbd31('0x2f')](_0xc6e314,_0x4f8195,!![]);}catch(_0x280146){return BPromise[_0xbd31('0x30')](_0x280146);}return _0xc6e314[_0xbd31('0x31')]();};}function saveUpdates(_0x4d7f6c,_0x505281){return function(_0x1ba7c6){if(_0x1ba7c6){return _0x1ba7c6['update'](_0x4d7f6c)[_0xbd31('0x1e')](function(_0x162672){return _0x162672;});}return null;};}function removeEntity(_0xd75543,_0x292ff4){return function(_0x569d1c){if(_0x569d1c){return _0x569d1c['destroy']()[_0xbd31('0x1e')](function(){var _0x6dd1fb=_0x569d1c[_0xbd31('0x32')]({'plain':!![]});var _0x5ada82=_0xbd31('0x33');return db[_0xbd31('0x34')][_0xbd31('0x35')]({'where':{'type':_0x5ada82,'resourceId':_0x6dd1fb['id']}})[_0xbd31('0x1e')](function(){return _0x569d1c;});})[_0xbd31('0x1e')](function(){_0xd75543[_0xbd31('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x87f9fe,_0x4a5b0a){return function(_0x1d2a9f){if(!_0x1d2a9f){_0x87f9fe['sendStatus'](0x194);}return _0x1d2a9f;};}function handleError(_0x279023,_0x3fb450){_0x3fb450=_0x3fb450||0x1f4;return function(_0x28fa11){logger['error'](_0x28fa11[_0xbd31('0x36')]);if(_0x28fa11[_0xbd31('0x37')]){delete _0x28fa11[_0xbd31('0x37')];}_0x279023[_0xbd31('0x28')](_0x3fb450)[_0xbd31('0x38')](_0x28fa11);};}exports[_0xbd31('0x39')]=function(_0x247493,_0x1940d2){var _0xdf552a={'include':[{'model':db[_0xbd31('0x3a')],'as':'mandatoryDispositionPause'}]},_0x2fbf72={},_0xf721f4={'count':0x0,'rows':[]};var _0x23edd5=_[_0xbd31('0x3b')](db[_0xbd31('0x3c')][_0xbd31('0x3d')],function(_0x2fd4cf){return{'name':_0x2fd4cf[_0xbd31('0x3e')],'type':_0x2fd4cf[_0xbd31('0x3f')]['key']};});_0x2fbf72[_0xbd31('0x40')]=_['map'](_0x23edd5,_0xbd31('0x37'));_0x2fbf72[_0xbd31('0x41')]=_[_0xbd31('0x42')](_0x247493[_0xbd31('0x41')]);_0x2fbf72[_0xbd31('0x43')]=_[_0xbd31('0x44')](_0x2fbf72['model'],_0x2fbf72[_0xbd31('0x41')]);_0xdf552a['attributes']=_['intersection'](_0x2fbf72[_0xbd31('0x40')],qs[_0xbd31('0x45')](_0x247493[_0xbd31('0x41')]['fields']));_0xdf552a[_0xbd31('0x46')]=_0xdf552a[_0xbd31('0x46')][_0xbd31('0x47')]?_0xdf552a['attributes']:_0x2fbf72[_0xbd31('0x40')];if(!_0x247493[_0xbd31('0x41')][_0xbd31('0x48')]('nolimit')){_0xdf552a[_0xbd31('0x2c')]=qs[_0xbd31('0x2c')](_0x247493['query'][_0xbd31('0x2c')]);_0xdf552a[_0xbd31('0x2a')]=qs[_0xbd31('0x2a')](_0x247493[_0xbd31('0x41')][_0xbd31('0x2a')]);}_0xdf552a['order']=qs['sort'](_0x247493[_0xbd31('0x41')][_0xbd31('0x49')]);_0xdf552a['where']=qs['filters'](_[_0xbd31('0x4a')](_0x247493[_0xbd31('0x41')],_0x2fbf72['filters']),_0x23edd5);if(_0x247493['query'][_0xbd31('0x4b')]){_0xdf552a['where']=_['merge'](_0xdf552a['where'],{'$or':_[_0xbd31('0x3b')](_0x23edd5,function(_0x48a9d8){if(_0x48a9d8[_0xbd31('0x3f')]!==_0xbd31('0x4c')){var _0x4ab418={};_0x4ab418[_0x48a9d8['name']]={'$like':'%'+_0x247493[_0xbd31('0x41')][_0xbd31('0x4b')]+'%'};return _0x4ab418;}})});}_0xdf552a=_[_0xbd31('0x4d')]({},_0xdf552a,_0x247493[_0xbd31('0x4e')]);var _0x57f9df={'where':_0xdf552a[_0xbd31('0x4f')]};return db[_0xbd31('0x3c')][_0xbd31('0x2d')](_0x57f9df)['then'](function(_0x40bcc6){_0xf721f4[_0xbd31('0x2d')]=_0x40bcc6;if(_0x247493[_0xbd31('0x41')][_0xbd31('0x50')]){_0xdf552a['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0xbd31('0x51')](_0xdf552a);})[_0xbd31('0x1e')](function(_0x546b05){_0xf721f4[_0xbd31('0x52')]=_0x546b05;return _0xf721f4;})[_0xbd31('0x1e')](respondWithFilteredResult(_0x1940d2,_0xdf552a))[_0xbd31('0x53')](handleError(_0x1940d2,null));};exports['show']=function(_0x11cffe,_0xecc87f){var _0x4d6f72={'raw':![],'where':{'id':_0x11cffe[_0xbd31('0x54')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5d980f={};_0x5d980f[_0xbd31('0x40')]=_[_0xbd31('0x42')](db['WhatsappAccount'][_0xbd31('0x3d')]);_0x5d980f[_0xbd31('0x41')]=_[_0xbd31('0x42')](_0x11cffe[_0xbd31('0x41')]);_0x5d980f[_0xbd31('0x43')]=_[_0xbd31('0x44')](_0x5d980f[_0xbd31('0x40')],_0x5d980f[_0xbd31('0x41')]);_0x4d6f72[_0xbd31('0x46')]=_['intersection'](_0x5d980f[_0xbd31('0x40')],qs[_0xbd31('0x45')](_0x11cffe[_0xbd31('0x41')]['fields']));_0x4d6f72[_0xbd31('0x46')]=_0x4d6f72[_0xbd31('0x46')][_0xbd31('0x47')]?_0x4d6f72[_0xbd31('0x46')]:_0x5d980f[_0xbd31('0x40')];if(_0x11cffe[_0xbd31('0x41')]['includeAll']){_0x4d6f72['include']=[{'all':!![]}];}_0x4d6f72=_[_0xbd31('0x4d')]({},_0x4d6f72,_0x11cffe[_0xbd31('0x4e')]);return db[_0xbd31('0x3c')][_0xbd31('0x55')](_0x4d6f72)[_0xbd31('0x1e')](handleEntityNotFound(_0xecc87f,null))[_0xbd31('0x1e')](respondWithResult(_0xecc87f,null))[_0xbd31('0x53')](handleError(_0xecc87f,null));};exports[_0xbd31('0x56')]=function(_0x10d2ad,_0x6ccf09){return db[_0xbd31('0x3c')][_0xbd31('0x56')](_0x10d2ad[_0xbd31('0x57')],{})[_0xbd31('0x1e')](function(_0xe8436d){var _0x1f2e2f=_0x10d2ad[_0xbd31('0x58')][_0xbd31('0x32')]({'plain':!![]});if(!_0x1f2e2f)throw new Error(_0xbd31('0x59'));if(_0x1f2e2f['role']===_0xbd31('0x58')){var _0xbe9d63=_0xe8436d[_0xbd31('0x32')]({'plain':!![]});var _0x570e50=_0xbd31('0x33');return db[_0xbd31('0x5a')][_0xbd31('0x55')]({'where':{'name':_0x570e50,'userProfileId':_0x1f2e2f[_0xbd31('0x5b')]},'raw':!![]})[_0xbd31('0x1e')](function(_0x434e00){if(_0x434e00&&_0x434e00[_0xbd31('0x5c')]===0x0){return db[_0xbd31('0x34')][_0xbd31('0x56')]({'name':_0xbe9d63[_0xbd31('0x37')],'resourceId':_0xbe9d63['id'],'type':_0x434e00[_0xbd31('0x37')],'sectionId':_0x434e00['id']},{})['then'](function(){return _0xe8436d;});}else{return _0xe8436d;}})[_0xbd31('0x53')](function(_0x4fec59){logger[_0xbd31('0x24')](_0xbd31('0x5d'),_0x4fec59);throw _0x4fec59;});}return _0xe8436d;})['then'](respondWithResult(_0x6ccf09,0xc9))[_0xbd31('0x53')](handleError(_0x6ccf09,null));};exports[_0xbd31('0x5e')]=function(_0x2878b9,_0x516de3){if(_0x2878b9[_0xbd31('0x57')]['id']){delete _0x2878b9[_0xbd31('0x57')]['id'];}return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x2878b9['params']['id']},'include':[{'model':db[_0xbd31('0x3a')],'as':'mandatoryDispositionPause'}]})[_0xbd31('0x1e')](handleEntityNotFound(_0x516de3,null))[_0xbd31('0x1e')](saveUpdates(_0x2878b9[_0xbd31('0x57')],null))[_0xbd31('0x1e')](respondWithResult(_0x516de3,null))[_0xbd31('0x53')](handleError(_0x516de3,null));};exports[_0xbd31('0x35')]=function(_0x24a377,_0x4438bc){return db['WhatsappAccount'][_0xbd31('0x55')]({'where':{'id':_0x24a377[_0xbd31('0x54')]['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x4438bc,null))[_0xbd31('0x1e')](removeEntity(_0x4438bc,null))[_0xbd31('0x53')](handleError(_0x4438bc,null));};exports[_0xbd31('0x5f')]=function(_0x24f44c,_0x6f5ff0){return db[_0xbd31('0x3c')]['describe']()[_0xbd31('0x1e')](respondWithResult(_0x6f5ff0,null))[_0xbd31('0x53')](handleError(_0x6f5ff0,null));};exports[_0xbd31('0x60')]=function(_0x4788e3,_0x5d7332,_0xb9bc3d){if(_0x4788e3[_0xbd31('0x57')]['id']){delete _0x4788e3['body']['id'];}return db[_0xbd31('0x3c')]['find']({'where':{'id':_0x4788e3[_0xbd31('0x54')]['id']}})['then'](handleEntityNotFound(_0x5d7332,null))['then'](function(_0x3efedf){if(_0x3efedf){_0x4788e3[_0xbd31('0x57')][_0xbd31('0x61')]=_0x3efedf['id'];return db[_0xbd31('0x62')][_0xbd31('0x56')](_0x4788e3['body']);}})[_0xbd31('0x1e')](respondWithResult(_0x5d7332,null))[_0xbd31('0x53')](handleError(_0x5d7332,null));};exports[_0xbd31('0x63')]=function(_0x127441,_0x339bf1,_0x443b4a){var _0x398026={'raw':![],'where':{}};var _0x1eb6f4={};var _0x28140={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x127441[_0xbd31('0x54')]['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x339bf1,null))[_0xbd31('0x1e')](function(_0x540443){if(_0x540443){_0x1eb6f4[_0xbd31('0x40')]=_[_0xbd31('0x42')](db[_0xbd31('0x62')][_0xbd31('0x3d')]);_0x1eb6f4['query']=_[_0xbd31('0x42')](_0x127441['query']);_0x1eb6f4[_0xbd31('0x43')]=_[_0xbd31('0x44')](_0x1eb6f4[_0xbd31('0x40')],_0x1eb6f4[_0xbd31('0x41')]);_0x398026['attributes']=_[_0xbd31('0x44')](_0x1eb6f4[_0xbd31('0x40')],qs[_0xbd31('0x45')](_0x127441['query'][_0xbd31('0x45')]));_0x398026[_0xbd31('0x46')]=_0x398026[_0xbd31('0x46')][_0xbd31('0x47')]?_0x398026['attributes']:_0x1eb6f4[_0xbd31('0x40')];if(!_0x127441[_0xbd31('0x41')]['hasOwnProperty'](_0xbd31('0x64'))){_0x398026[_0xbd31('0x2c')]=qs[_0xbd31('0x2c')](_0x127441[_0xbd31('0x41')]['limit']);_0x398026['offset']=qs[_0xbd31('0x2a')](_0x127441[_0xbd31('0x41')][_0xbd31('0x2a')]);}_0x398026[_0xbd31('0x65')]=qs['sort'](_0x127441[_0xbd31('0x41')][_0xbd31('0x49')]);_0x398026[_0xbd31('0x4f')]=qs[_0xbd31('0x43')](_['pick'](_0x127441[_0xbd31('0x41')],_0x1eb6f4[_0xbd31('0x43')]));_0x398026['where'][_0xbd31('0x61')]=_0x540443['id'];if(_0x127441[_0xbd31('0x41')][_0xbd31('0x4b')]){_0x398026[_0xbd31('0x4f')]=_[_0xbd31('0x4d')](_0x398026['where'],{'$or':_[_0xbd31('0x3b')](_0x398026['attributes'],function(_0x1e5305){var _0x17749a={};_0x17749a[_0x1e5305]={'$like':'%'+_0x127441[_0xbd31('0x41')][_0xbd31('0x4b')]+'%'};return _0x17749a;})});}_0x398026=_[_0xbd31('0x4d')]({},_0x398026,_0x127441[_0xbd31('0x4e')]);return db['Disposition'][_0xbd31('0x2d')]({'where':_0x398026['where']})[_0xbd31('0x1e')](function(_0x520b8e){_0x28140['count']=_0x520b8e;if(_0x127441[_0xbd31('0x41')]['includeAll']){_0x398026[_0xbd31('0x66')]=[{'all':!![]}];}return db[_0xbd31('0x62')]['findAll'](_0x398026);})['then'](function(_0x37eace){_0x28140[_0xbd31('0x52')]=_0x37eace;return _0x28140;});}})[_0xbd31('0x1e')](respondWithFilteredResult(_0x339bf1,_0x398026))[_0xbd31('0x53')](handleError(_0x339bf1,null));};exports['removeDispositions']=function(_0x2b8812,_0xff2dcb,_0x32202c){return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x2b8812['params']['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0xff2dcb,null))['then'](function(_0x2c7e80){if(_0x2c7e80){return _0x2c7e80[_0xbd31('0x67')](_0x2b8812['query'][_0xbd31('0x68')]);}})[_0xbd31('0x1e')](respondWithStatusCode(_0xff2dcb,null))[_0xbd31('0x53')](handleError(_0xff2dcb,null));};exports[_0xbd31('0x69')]=function(_0x1dfe22,_0x32312e,_0x24cb17){if(_0x1dfe22[_0xbd31('0x57')]['id']){delete _0x1dfe22[_0xbd31('0x57')]['id'];}return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x1dfe22['params']['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x32312e,null))[_0xbd31('0x1e')](function(_0x3f4dd8){if(_0x3f4dd8){_0x1dfe22[_0xbd31('0x57')][_0xbd31('0x61')]=_0x3f4dd8['id'];return db[_0xbd31('0x6a')][_0xbd31('0x56')](_0x1dfe22['body']);}})[_0xbd31('0x1e')](respondWithResult(_0x32312e,null))[_0xbd31('0x53')](handleError(_0x32312e,null));};exports[_0xbd31('0x6b')]=function(_0x321df3,_0x2832cf,_0x7f1048){var _0x5ac9cc={'raw':![],'where':{}};var _0x254b58={};var _0x1a3701={'count':0x0,'rows':[]};return db[_0xbd31('0x3c')][_0xbd31('0x6c')]({'where':{'id':_0x321df3[_0xbd31('0x54')]['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x2832cf,null))['then'](function(_0x14e5e){if(_0x14e5e){_0x254b58['model']=_[_0xbd31('0x42')](db['CannedAnswer'][_0xbd31('0x3d')]);_0x254b58['query']=_[_0xbd31('0x42')](_0x321df3[_0xbd31('0x41')]);_0x254b58[_0xbd31('0x43')]=_['intersection'](_0x254b58[_0xbd31('0x40')],_0x254b58[_0xbd31('0x41')]);_0x5ac9cc[_0xbd31('0x46')]=_['intersection'](_0x254b58['model'],qs[_0xbd31('0x45')](_0x321df3[_0xbd31('0x41')][_0xbd31('0x45')]));_0x5ac9cc[_0xbd31('0x46')]=_0x5ac9cc[_0xbd31('0x46')]['length']?_0x5ac9cc[_0xbd31('0x46')]:_0x254b58[_0xbd31('0x40')];if(!_0x321df3[_0xbd31('0x41')][_0xbd31('0x48')](_0xbd31('0x64'))){_0x5ac9cc[_0xbd31('0x2c')]=qs[_0xbd31('0x2c')](_0x321df3[_0xbd31('0x41')]['limit']);_0x5ac9cc[_0xbd31('0x2a')]=qs['offset'](_0x321df3[_0xbd31('0x41')][_0xbd31('0x2a')]);}_0x5ac9cc[_0xbd31('0x65')]=qs['sort'](_0x321df3['query']['sort']);_0x5ac9cc['where']=qs['filters'](_[_0xbd31('0x4a')](_0x321df3['query'],_0x254b58[_0xbd31('0x43')]));_0x5ac9cc['where']['WhatsappAccountId']=_0x14e5e['id'];if(_0x321df3[_0xbd31('0x41')][_0xbd31('0x4b')]){_0x5ac9cc[_0xbd31('0x4f')]=_[_0xbd31('0x4d')](_0x5ac9cc[_0xbd31('0x4f')],{'$or':_[_0xbd31('0x3b')](_0x5ac9cc[_0xbd31('0x46')],function(_0x5d795f){var _0x4a57d5={};_0x4a57d5[_0x5d795f]={'$like':'%'+_0x321df3['query'][_0xbd31('0x4b')]+'%'};return _0x4a57d5;})});}_0x5ac9cc=_[_0xbd31('0x4d')]({},_0x5ac9cc,_0x321df3[_0xbd31('0x4e')]);return db[_0xbd31('0x6a')][_0xbd31('0x2d')]({'where':_0x5ac9cc[_0xbd31('0x4f')]})[_0xbd31('0x1e')](function(_0x54d590){_0x1a3701[_0xbd31('0x2d')]=_0x54d590;if(_0x321df3[_0xbd31('0x41')][_0xbd31('0x50')]){_0x5ac9cc[_0xbd31('0x66')]=[{'all':!![]}];}return db['CannedAnswer'][_0xbd31('0x51')](_0x5ac9cc);})[_0xbd31('0x1e')](function(_0x59edf6){_0x1a3701[_0xbd31('0x52')]=_0x59edf6;return _0x1a3701;});}})['then'](respondWithFilteredResult(_0x2832cf,_0x5ac9cc))['catch'](handleError(_0x2832cf,null));};exports[_0xbd31('0x6d')]=function(_0x13aa71,_0x3ef22f,_0x91c5b5){return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x13aa71['params']['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x3ef22f,null))[_0xbd31('0x1e')](function(_0x4aea26){if(_0x4aea26){return _0x4aea26[_0xbd31('0x6d')](_0x13aa71[_0xbd31('0x41')][_0xbd31('0x68')]);}})['then'](respondWithStatusCode(_0x3ef22f,null))[_0xbd31('0x53')](handleError(_0x3ef22f,null));};exports['addAgents']=function(_0x27e951,_0x2e758a,_0x4ddbcd){return db[_0xbd31('0x3c')]['find']({'where':{'id':_0x27e951[_0xbd31('0x54')]['id']}})['then'](handleEntityNotFound(_0x2e758a,null))[_0xbd31('0x1e')](function(_0x5864a9){if(_0x5864a9){return _0x5864a9[_0xbd31('0x6e')](_0x27e951['body'][_0xbd31('0x68')],_['omit'](_0x27e951[_0xbd31('0x57')],[_0xbd31('0x68'),'id'])||{})['spread'](function(_0x48b5d9){for(var _0x283720=0x0;_0x283720<_0x27e951[_0xbd31('0x57')][_0xbd31('0x68')][_0xbd31('0x47')];_0x283720+=0x1){socket[_0xbd31('0x6f')](_0xbd31('0x70'),{'UserId':Number(_0x27e951['body'][_0xbd31('0x68')][_0x283720]),'WhatsappAccountId':Number(_0x27e951[_0xbd31('0x54')]['id'])});}return _0x48b5d9;});}})[_0xbd31('0x1e')](respondWithResult(_0x2e758a,null))[_0xbd31('0x53')](handleError(_0x2e758a,null));};exports['removeAgents']=function(_0x4344a5,_0x504c45,_0xdeddf4){return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x4344a5['params']['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x504c45,null))[_0xbd31('0x1e')](function(_0x316d8c){if(_0x316d8c){return _0x316d8c['removeAgents'](_0x4344a5[_0xbd31('0x41')][_0xbd31('0x68')])[_0xbd31('0x1e')](function(){if(_[_0xbd31('0x71')](_0x4344a5['query'][_0xbd31('0x68')])){for(var _0x44f986=0x0;_0x44f986<_0x4344a5[_0xbd31('0x41')][_0xbd31('0x68')][_0xbd31('0x47')];_0x44f986+=0x1){socket[_0xbd31('0x6f')](_0xbd31('0x72'),{'UserId':Number(_0x4344a5[_0xbd31('0x41')][_0xbd31('0x68')][_0x44f986]),'WhatsappAccountId':Number(_0x4344a5[_0xbd31('0x54')]['id'])});}}else{socket['emit'](_0xbd31('0x72'),{'UserId':Number(_0x4344a5['query']['ids']),'WhatsappAccountId':Number(_0x4344a5[_0xbd31('0x54')]['id'])});}});}})[_0xbd31('0x1e')](respondWithStatusCode(_0x504c45,null))[_0xbd31('0x53')](handleError(_0x504c45,null));};exports[_0xbd31('0x73')]=function(_0x16513,_0x13f812,_0x379422){var _0x4bf66e={};var _0x4412e3={};var _0x296167;var _0x1db2f3;return db[_0xbd31('0x3c')][_0xbd31('0x6c')]({'where':{'id':_0x16513[_0xbd31('0x54')]['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x13f812,null))['then'](function(_0x296e88){if(_0x296e88){_0x296167=_0x296e88;_0x4412e3[_0xbd31('0x40')]=_['keys'](db[_0xbd31('0x74')][_0xbd31('0x3d')]);_0x4412e3[_0xbd31('0x41')]=_['keys'](_0x16513[_0xbd31('0x41')]);_0x4412e3[_0xbd31('0x43')]=_[_0xbd31('0x44')](_0x4412e3[_0xbd31('0x40')],_0x4412e3['query']);_0x4bf66e[_0xbd31('0x46')]=_['intersection'](_0x4412e3[_0xbd31('0x40')],qs[_0xbd31('0x45')](_0x16513[_0xbd31('0x41')]['fields']));_0x4bf66e[_0xbd31('0x46')]=_0x4bf66e[_0xbd31('0x46')]['length']?_0x4bf66e[_0xbd31('0x46')]:_0x4412e3[_0xbd31('0x40')];_0x4bf66e[_0xbd31('0x65')]=qs[_0xbd31('0x49')](_0x16513[_0xbd31('0x41')][_0xbd31('0x49')]);_0x4bf66e[_0xbd31('0x4f')]=qs[_0xbd31('0x43')](_[_0xbd31('0x4a')](_0x16513[_0xbd31('0x41')],_0x4412e3[_0xbd31('0x43')]));if(_0x16513[_0xbd31('0x41')][_0xbd31('0x4b')]){_0x4bf66e[_0xbd31('0x4f')]=_['merge'](_0x4bf66e['where'],{'$or':_[_0xbd31('0x3b')](_0x4bf66e[_0xbd31('0x46')],function(_0x4f767b){var _0x463e99={};_0x463e99[_0x4f767b]={'$like':'%'+_0x16513[_0xbd31('0x41')][_0xbd31('0x4b')]+'%'};return _0x463e99;})});}_0x4bf66e=_[_0xbd31('0x4d')]({},_0x4bf66e,_0x16513[_0xbd31('0x4e')]);return _0x296167['getAgents'](_0x4bf66e);}})[_0xbd31('0x1e')](function(_0x43ae62){if(_0x43ae62){_0x1db2f3=_0x43ae62['length'];if(!_0x16513[_0xbd31('0x41')][_0xbd31('0x48')](_0xbd31('0x64'))){_0x4bf66e[_0xbd31('0x2c')]=qs[_0xbd31('0x2c')](_0x16513[_0xbd31('0x41')][_0xbd31('0x2c')]);_0x4bf66e[_0xbd31('0x2a')]=qs[_0xbd31('0x2a')](_0x16513[_0xbd31('0x41')][_0xbd31('0x2a')]);}return _0x296167[_0xbd31('0x73')](_0x4bf66e);}})[_0xbd31('0x1e')](function(_0x38b861){if(_0x38b861){return _0x38b861?{'count':_0x1db2f3,'rows':_0x38b861}:null;}})[_0xbd31('0x1e')](respondWithResult(_0x13f812,null))['catch'](handleError(_0x13f812,null));};exports[_0xbd31('0x75')]=function(_0x12d168,_0x1b9957,_0x4c2ab7){return db[_0xbd31('0x3c')][_0xbd31('0x6c')]({'where':{'id':_0x12d168[_0xbd31('0x54')]['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x1b9957,null))[_0xbd31('0x1e')](function(_0x2f0b8c){if(_0x2f0b8c){return db[_0xbd31('0x76')][_0xbd31('0x77')](function(_0xef6f5b){return db[_0xbd31('0x78')]['destroy']({'where':{'WhatsappAccountId':_0x12d168[_0xbd31('0x54')]['id']},'transaction':_0xef6f5b})[_0xbd31('0x1e')](function(_0x4cbe10){var _0x1249ee=_[_0xbd31('0x3b')](_0x12d168[_0xbd31('0x57')],function(_0x539cc4){_0x539cc4[_0xbd31('0x61')]=_0x12d168['params']['id'];return _0x539cc4;});return db[_0xbd31('0x78')]['bulkCreate'](_0x1249ee,{'transaction':_0xef6f5b});});})['then'](function(){return db[_0xbd31('0x78')][_0xbd31('0x79')]({'where':{'WhatsappAccountId':_0x12d168[_0xbd31('0x54')]['id']},'order':_0xbd31('0x7a')});});}})[_0xbd31('0x1e')](respondWithResult(_0x1b9957,null))[_0xbd31('0x53')](handleError(_0x1b9957,null));};exports[_0xbd31('0x7b')]=function(_0x2fb2f9,_0x473e56,_0x3caf54){var _0x1adace={};var _0xd6658a={};var _0x135c58;var _0x451a9f;return db[_0xbd31('0x3c')][_0xbd31('0x6c')]({'where':{'id':_0x2fb2f9['params']['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x473e56,null))[_0xbd31('0x1e')](function(_0x4d888d){if(_0x4d888d){_0x135c58=_0x4d888d;_0xd6658a['model']=_[_0xbd31('0x42')](db[_0xbd31('0x78')][_0xbd31('0x3d')]);_0xd6658a[_0xbd31('0x41')]=_[_0xbd31('0x42')](_0x2fb2f9[_0xbd31('0x41')]);_0xd6658a[_0xbd31('0x43')]=_[_0xbd31('0x44')](_0xd6658a[_0xbd31('0x40')],_0xd6658a[_0xbd31('0x41')]);_0x1adace[_0xbd31('0x46')]=_['intersection'](_0xd6658a[_0xbd31('0x40')],qs[_0xbd31('0x45')](_0x2fb2f9[_0xbd31('0x41')][_0xbd31('0x45')]));_0x1adace[_0xbd31('0x46')]=_0x1adace[_0xbd31('0x46')]['length']?_0x1adace[_0xbd31('0x46')]:_0xd6658a[_0xbd31('0x40')];_0x1adace[_0xbd31('0x65')]=qs['sort'](_0x2fb2f9['query'][_0xbd31('0x49')]);_0x1adace[_0xbd31('0x4f')]=qs['filters'](_[_0xbd31('0x4a')](_0x2fb2f9['query'],_0xd6658a[_0xbd31('0x43')]));if(_0x2fb2f9[_0xbd31('0x41')]['filter']){_0x1adace[_0xbd31('0x4f')]=_['merge'](_0x1adace[_0xbd31('0x4f')],{'$or':_[_0xbd31('0x3b')](_0x1adace[_0xbd31('0x46')],function(_0x17579c){var _0x3a8e9e={};_0x3a8e9e[_0x17579c]={'$like':'%'+_0x2fb2f9[_0xbd31('0x41')]['filter']+'%'};return _0x3a8e9e;})});}_0x1adace=_[_0xbd31('0x4d')]({},_0x1adace,_0x2fb2f9[_0xbd31('0x4e')]);return _0x135c58[_0xbd31('0x7b')](_0x1adace);}})[_0xbd31('0x1e')](function(_0x580024){if(_0x580024){_0x451a9f=_0x580024[_0xbd31('0x47')];if(!_0x2fb2f9['query'][_0xbd31('0x48')](_0xbd31('0x64'))){_0x1adace[_0xbd31('0x2c')]=qs[_0xbd31('0x2c')](_0x2fb2f9[_0xbd31('0x41')][_0xbd31('0x2c')]);_0x1adace[_0xbd31('0x2a')]=qs[_0xbd31('0x2a')](_0x2fb2f9[_0xbd31('0x41')][_0xbd31('0x2a')]);}return _0x135c58[_0xbd31('0x7b')](_0x1adace);}})[_0xbd31('0x1e')](function(_0x137375){if(_0x137375){return _0x137375?{'count':_0x451a9f,'rows':_0x137375}:null;}})[_0xbd31('0x1e')](respondWithResult(_0x473e56,null))['catch'](handleError(_0x473e56,null));};exports['notify']=function(_0x30a488,_0x4d7702,_0x5321b3){var _0x1b964e={'channel':_0xbd31('0x7c')};var _0x9000ad=[];var _0x20e763=[];var _0x27ce60={};return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x30a488[_0xbd31('0x54')]['id']},'include':[{'model':db[_0xbd31('0x78')],'as':_0xbd31('0x7d')}]})[_0xbd31('0x1e')](handleEntityNotFound(_0x4d7702,null))['then'](function(_0x8831c2){_0x1b964e['account']=_0x8831c2;_0x1b964e[_0xbd31('0x7e')]=_[_0xbd31('0x7f')](_0x8831c2[_0xbd31('0x7d')],[_0xbd31('0x7a')],[_0xbd31('0x80')]);if(_0x1b964e[_0xbd31('0x81')]['Applications']){delete _0x1b964e[_0xbd31('0x81')]['Applications'];}return db['CmContact'][_0xbd31('0x5f')]();})[_0xbd31('0x1e')](function(_0x2f3976){if(!_0x2f3976){throw new db[(_0xbd31('0x82'))]['ValidationError'](_0xbd31('0x83'));}_0x9000ad=_[_0xbd31('0x84')](_[_0xbd31('0x42')](_0x2f3976),[_0xbd31('0x85'),_0xbd31('0x86')]);_0x20e763=_[_0xbd31('0x84')](_['keys'](_0x2f3976),[_0xbd31('0x85'),_0xbd31('0x86'),'CompanyId',_0xbd31('0x87')]);_0x1b964e['body']={'mapKey':_0xbd31('0x88')};if(_0x1b964e['account'][_0xbd31('0x3f')]&&_0x1b964e['account'][_0xbd31('0x3f')]==='twilio'){_0x1b964e[_0xbd31('0x57')][_0xbd31('0x89')]=_0x30a488[_0xbd31('0x57')]['From'][_0xbd31('0x8a')]('whatsapp:','');_0x1b964e[_0xbd31('0x57')][_0xbd31('0x57')]=_0x30a488[_0xbd31('0x57')][_0xbd31('0x8b')];_0x1b964e[_0xbd31('0x57')]['messageId']=_0x30a488['body'][_0xbd31('0x8c')];}if(_0x1b964e[_0xbd31('0x57')]['id']){delete _0x1b964e['body']['id'];}if(_['isNil'](_0x1b964e['body'][_0xbd31('0x89')])){throw new db[(_0xbd31('0x82'))][(_0xbd31('0x8d'))](_0xbd31('0x8e'));}if(_[_0xbd31('0x8f')](_0x1b964e[_0xbd31('0x57')][_0xbd31('0x57')])||_0x1b964e['body']['body']===''){throw new db['Sequelize'][(_0xbd31('0x8d'))](_0xbd31('0x90'));}if(_['isNil'](_0x1b964e[_0xbd31('0x57')][_0xbd31('0x91')])){throw new db[(_0xbd31('0x82'))][(_0xbd31('0x8d'))](_0xbd31('0x92')+_0x20e763);}if(!_[_0xbd31('0x93')](_0x20e763,_0x1b964e[_0xbd31('0x57')][_0xbd31('0x91')])){throw new db[(_0xbd31('0x82'))][(_0xbd31('0x8d'))](_0xbd31('0x94')+_0x20e763);}_0x27ce60[_0x1b964e[_0xbd31('0x57')][_0xbd31('0x91')]]=_0x1b964e['body'][_0xbd31('0x89')];return db['CmList'][_0xbd31('0x55')]({'where':{'id':_0x1b964e['account'][_0xbd31('0x87')]},'include':[{'model':db[_0xbd31('0x95')],'as':_0xbd31('0x96'),'where':_0x27ce60,'limit':0x1,'order':[['updatedAt',_0xbd31('0x97')]]}]});})[_0xbd31('0x1e')](handleEntityNotFound(_0x4d7702,null))['then'](function(_0x5c3cf3){if(_0x5c3cf3){_0x1b964e[_0xbd31('0x98')]=_[_0xbd31('0x99')](_0x5c3cf3,[_0xbd31('0x96')]);if(_0x5c3cf3['Contacts'][_0xbd31('0x47')]){return _0x5c3cf3['Contacts'][0x0];}var _0x5b3c5e=_[_0xbd31('0x9a')](_0x1b964e['body'],{'firstName':_0x1b964e[_0xbd31('0x57')]['from'],'ListId':_0x5c3cf3['id']});_0x5b3c5e[_0x1b964e['body']['mapKey']]=_0x1b964e[_0xbd31('0x57')][_0xbd31('0x89')];return db[_0xbd31('0x95')][_0xbd31('0x56')](_0x5b3c5e,{'fields':_0x9000ad,'raw':!![]});}})['then'](handleEntityNotFound(_0x4d7702,null))[_0xbd31('0x1e')](function(_0x3a2872){if(_0x3a2872){_0x1b964e[_0xbd31('0x9b')]=_0x3a2872;var _0x15a5de={'ContactId':_0x3a2872['id'],'phone':_0x1b964e[_0xbd31('0x57')][_0xbd31('0x89')],'WhatsappAccountId':_0x30a488[_0xbd31('0x54')]['id']};var _0x2e768e={'ContactId':_0x3a2872['id'],'WhatsappAccountId':_0x30a488[_0xbd31('0x54')]['id'],'closed':![]};return db[_0xbd31('0x9c')]['find']({'where':_0x2e768e})[_0xbd31('0x1e')](function(_0x3fef6e){if(_0x3fef6e){return[_0x3fef6e,![]];}return db[_0xbd31('0x9c')][_0xbd31('0x56')](_0x15a5de)['then'](function(_0x2c4e95){return[_0x2c4e95,!![]];});});}})[_0xbd31('0x9d')](function(_0x34f028,_0x2abd69){_0x1b964e[_0xbd31('0x9e')]=_0x34f028['get']({'plain':!![]});_0x1b964e[_0xbd31('0x9e')]['created']=![];if(_0x2abd69){if(_0x1b964e[_0xbd31('0x81')]['autoclose']){_0x1b964e[_0xbd31('0x7e')][_0xbd31('0x9f')]({'id':0x0,'priority':_0x1b964e['applications']['length']+0x1,'app':_0xbd31('0xa0'),'appdata':_0xbd31('0xa1'),'interval':_0xbd31('0xa2')});}_0x1b964e[_0xbd31('0x9e')][_0xbd31('0xa3')]=!![];}return db[_0xbd31('0xa4')][_0xbd31('0x56')]({'phone':_0x1b964e[_0xbd31('0x57')][_0xbd31('0x89')],'messageId':_0x1b964e[_0xbd31('0x57')][_0xbd31('0xa5')],'body':_0x1b964e[_0xbd31('0x57')]['body'],'WhatsappAccountId':_0x30a488[_0xbd31('0x54')]['id'],'WhatsappInteractionId':_0x34f028['id'],'direction':'in','ContactId':_0x34f028[_0xbd31('0xa6')],'AttachmentId':_0x1b964e[_0xbd31('0x57')][_0xbd31('0xa7')]});})[_0xbd31('0x1e')](function(_0x32950f){_0x1b964e[_0xbd31('0x26')]=_0x32950f;if(_0x1b964e['interaction'][_0xbd31('0xa8')]){return db[_0xbd31('0x74')][_0xbd31('0x55')]({'attributes':['id',_0xbd31('0x37')],'where':{'id':_0x1b964e['interaction']['UserId']}})[_0xbd31('0x1e')](function(_0x49e325){if(_0x49e325){_0x1b964e[_0xbd31('0x7e')][_0xbd31('0xa9')]({'id':0x0,'priority':0x0,'app':_0xbd31('0xaa'),'appdata':_0x49e325['name']+','+(_0x1b964e[_0xbd31('0x81')][_0xbd31('0xab')]||0xa),'interval':_0xbd31('0xa2')});}return respondWithRpcPromise(_0xbd31('0xac'),_0xbd31('0xad'),_0x1b964e);});}return respondWithRpcPromise(_0xbd31('0xac'),_0xbd31('0xad'),_0x1b964e);})['then'](function(_0x595217){if(_0x595217){var _0x584121=0xc8;var _0xcd6e6d=_0xbd31('0xae');logger[_0xbd31('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xcd6e6d,_0x584121,_0xbd31('0xaf'));logger[_0xbd31('0xb0')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xcd6e6d,_0x584121,_0xbd31('0xaf'),JSON[_0xbd31('0x23')](_0x595217));if(_0x1b964e[_0xbd31('0x81')][_0xbd31('0x3f')]===_0xbd31('0xb1')){return _0x4d7702[_0xbd31('0x28')](_0x584121)[_0xbd31('0xb2')]('Content-Type','text/xml')[_0xbd31('0x38')](_0xbd31('0xb3'));}else{return _0x4d7702[_0xbd31('0x28')](_0x584121)['json'](_0x595217);}}})['catch'](handleError(_0x4d7702,null));};exports[_0xbd31('0x38')]=function(_0x45f704,_0x541500,_0xad4e4c){var _0x45e1d0,_0x4bfa8e,_0x152c89;if(_[_0xbd31('0x8f')](_0x45f704[_0xbd31('0x57')][_0xbd31('0x57')])||_0x45f704[_0xbd31('0x57')]['body']===''){throw new db['Sequelize'][(_0xbd31('0x8d'))](_0xbd31('0x90'));}if(_['isNil'](_0x45f704[_0xbd31('0x57')]['to'])){throw new db['Sequelize']['ValidationError'](_0xbd31('0xb4'));}_0x45e1d0=_0x45f704['body']['to'];return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x45f704['params']['id']},'include':[{'model':db['CmList'],'as':_0xbd31('0xb5'),'include':[{'model':db[_0xbd31('0x95')],'as':'Contacts','where':{'mobile':_0x45e1d0},'limit':0x1,'order':[[_0xbd31('0x86'),_0xbd31('0x97')]]}]}]})[_0xbd31('0x1e')](handleEntityNotFound(_0x541500,null))[_0xbd31('0x1e')](function(_0x4eba5c){if(_0x4eba5c&&_0x4eba5c[_0xbd31('0xb5')]){_0x4bfa8e=_0x4eba5c[_0xbd31('0x32')]({'plain':!![]});if(_0x4bfa8e[_0xbd31('0xb5')]&&_0x4bfa8e[_0xbd31('0xb5')][_0xbd31('0x96')]['length']){return _0x4bfa8e[_0xbd31('0xb5')]['Contacts'][0x0];}return db[_0xbd31('0x95')][_0xbd31('0x56')](_[_0xbd31('0x9a')](_0x45f704['body'],{'firstName':_0x45e1d0,'mobile':_0x45e1d0,'phone':_0x45e1d0,'ListId':_0x4bfa8e[_0xbd31('0x87')]}));}})[_0xbd31('0x1e')](handleEntityNotFound(_0x541500,null))['then'](function(_0x5a3b96){if(_0x5a3b96){_0x152c89=_0x5a3b96;return db['WhatsappInteraction'][_0xbd31('0x55')]({'where':{'ContactId':_0x152c89['id'],'closed':![],'WhatsappAccountId':_0x4bfa8e['id']}})[_0xbd31('0x1e')](function(_0x108d85){if(_0x108d85){return[_0x108d85,![]];}return db['WhatsappInteraction'][_0xbd31('0x56')]({'UserId':_0x45f704['user']['id'],'ContactId':_0x152c89['id'],'WhatsappAccountId':_0x4bfa8e['id'],'phone':_0x45e1d0,'firstMsgDirection':'out','Messages':[_[_0xbd31('0x4d')](_0x45f704[_0xbd31('0x57')],{'read':![],'body':_0x45f704[_0xbd31('0x57')][_0xbd31('0x57')],'phone':_0x45e1d0,'WhatsappAccountId':_0x4bfa8e['id'],'UserId':_0x45f704[_0xbd31('0x58')]['id'],'ContactId':_0x152c89['id']})]},{'include':[{'model':db[_0xbd31('0xa4')],'as':_0xbd31('0xb6')}]})[_0xbd31('0x1e')](function(_0x34218d){return[_0x34218d,!![]];});});}})[_0xbd31('0x9d')](function(_0x5c95f5,_0x2e7c04){if(_0x2e7c04){return _0x5c95f5;}return db[_0xbd31('0xa4')][_0xbd31('0x56')](_[_0xbd31('0x4d')](_0x45f704[_0xbd31('0x57')],{'read':![],'body':_0x45f704[_0xbd31('0x57')]['body'],'phone':_0x45e1d0,'WhatsappAccountId':_0x4bfa8e['id'],'WhatsappInteractionId':_0x5c95f5['id'],'UserId':_0x45f704[_0xbd31('0x58')]['id'],'ContactId':_0x152c89['id']}))[_0xbd31('0x1e')](function(_0x3fac79){_0x5c95f5[_0xbd31('0xb7')][_0xbd31('0xb6')]=[];_0x5c95f5[_0xbd31('0xb7')][_0xbd31('0xb6')][_0xbd31('0x9f')](_0x3fac79[_0xbd31('0xb7')]);return _0x5c95f5;});})[_0xbd31('0x1e')](respondWithResult(_0x541500,null))[_0xbd31('0x53')](handleError(_0x541500,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 4961394..4feaa8b 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 _0x3e5c=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','save','update','remove'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x3e5c,0x90));var _0xc3e5=function(_0xc125b3,_0x4c6e3f){_0xc125b3=_0xc125b3-0x0;var _0xe5f0f8=_0x3e5c[_0xc125b3];return _0xe5f0f8;};'use strict';var EventEmitter=require(_0xc3e5('0x0'));var WhatsappAccount=require(_0xc3e5('0x1'))['db'][_0xc3e5('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc3e5('0x3'),'afterUpdate':_0xc3e5('0x4'),'afterDestroy':_0xc3e5('0x5')};function emitEvent(_0x561d52){return function(_0x209c7d,_0x4e4396,_0x81601e){WhatsappAccountEvents[_0xc3e5('0x6')](_0x561d52+':'+_0x209c7d['id'],_0x209c7d);WhatsappAccountEvents[_0xc3e5('0x6')](_0x561d52,_0x209c7d);_0x81601e(null);};}for(var e in events){if(events[_0xc3e5('0x7')](e)){var event=events[e];WhatsappAccount[_0xc3e5('0x8')](e,emitEvent(event));}}module[_0xc3e5('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x6351=['events','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x17ca87,_0x537b70){var _0xf236c5=function(_0x160e17){while(--_0x160e17){_0x17ca87['push'](_0x17ca87['shift']());}};_0xf236c5(++_0x537b70);}(_0x6351,0x6e));var _0x1635=function(_0x39b68b,_0x4ad96d){_0x39b68b=_0x39b68b-0x0;var _0xae091f=_0x6351[_0x39b68b];return _0xae091f;};'use strict';var EventEmitter=require(_0x1635('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x1635('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1635('0x2')](0x0);var events={'afterCreate':_0x1635('0x3'),'afterUpdate':_0x1635('0x4'),'afterDestroy':_0x1635('0x5')};function emitEvent(_0x39be17){return function(_0x466596,_0x255deb,_0x545ab2){WhatsappAccountEvents['emit'](_0x39be17+':'+_0x466596['id'],_0x466596);WhatsappAccountEvents[_0x1635('0x6')](_0x39be17,_0x466596);_0x545ab2(null);};}for(var e in events){if(events[_0x1635('0x7')](e)){var event=events[e];WhatsappAccount[_0x1635('0x8')](e,emitEvent(event));}}module[_0x1635('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index d40cd0a..a250307 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 _0x86f3=['rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','whatsapp_accounts','api','moment','bluebird','request-promise'];(function(_0x2db80d,_0x599677){var _0x526078=function(_0x2c98e5){while(--_0x2c98e5){_0x2db80d['push'](_0x2db80d['shift']());}};_0x526078(++_0x599677);}(_0x86f3,0xc4));var _0x386f=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x86f3[_0x10791d];return _0x1b4f9c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x386f('0x0'));var moment=require(_0x386f('0x1'));var BPromise=require(_0x386f('0x2'));var rp=require(_0x386f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x386f('0x4'));var config=require(_0x386f('0x5'));var attributes=require(_0x386f('0x6'));module[_0x386f('0x7')]=function(_0x1dce16,_0x287b7c){return _0x1dce16[_0x386f('0x8')]('WhatsappAccount',attributes,{'tableName':_0x386f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfd2=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define','whatsapp_accounts'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbfd2,0x136));var _0x2bfd=function(_0x8ea7b1,_0x557ad9){_0x8ea7b1=_0x8ea7b1-0x0;var _0x17e3fc=_0xbfd2[_0x8ea7b1];return _0x17e3fc;};'use strict';var _=require(_0x2bfd('0x0'));var util=require(_0x2bfd('0x1'));var logger=require(_0x2bfd('0x2'))(_0x2bfd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2bfd('0x4'));var rimraf=require(_0x2bfd('0x5'));var config=require(_0x2bfd('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0x2bfd('0x7')]=function(_0x52ed51,_0x15b878){return _0x52ed51[_0x2bfd('0x8')]('WhatsappAccount',attributes,{'tableName':_0x2bfd('0x9'),'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 90e7148..35d0fa7 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 _0x9007=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis'];(function(_0xd5a931,_0x4fb842){var _0x32a849=function(_0x30ff84){while(--_0x30ff84){_0xd5a931['push'](_0xd5a931['shift']());}};_0x32a849(++_0x4fb842);}(_0x9007,0x1db));var _0x7900=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x9007[_0x46f1a6];return _0x38429a;};'use strict';var _=require(_0x7900('0x0'));var util=require(_0x7900('0x1'));var moment=require(_0x7900('0x2'));var BPromise=require('bluebird');var rs=require(_0x7900('0x3'));var fs=require('fs');var Redis=require(_0x7900('0x4'));var db=require(_0x7900('0x5'))['db'];var utils=require(_0x7900('0x6'));var logger=require(_0x7900('0x7'))(_0x7900('0x8'));var config=require(_0x7900('0x9'));var jayson=require(_0x7900('0xa'));var client=jayson[_0x7900('0xb')][_0x7900('0xc')]({'port':0x232a});config['redis']=_[_0x7900('0xd')](config['redis'],{'host':_0x7900('0xe'),'port':0x18eb});var socket=require(_0x7900('0xf'))(new Redis(config[_0x7900('0x10')]));require(_0x7900('0x11'))[_0x7900('0x12')](socket);function respondWithRpcPromise(_0x34fa98,_0x4a470f,_0x2cd5c4){return new BPromise(function(_0x3cb0a7,_0x181726){return client[_0x7900('0x13')](_0x34fa98,_0x2cd5c4)[_0x7900('0x14')](function(_0x400279){logger[_0x7900('0x15')](_0x7900('0x16'),_0x4a470f,_0x7900('0x17'));logger[_0x7900('0x18')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4a470f,_0x7900('0x17'),JSON[_0x7900('0x19')](_0x400279));if(_0x400279[_0x7900('0x1a')]){if(_0x400279['error']['code']===0x1f4){logger[_0x7900('0x1a')](_0x7900('0x16'),_0x4a470f,_0x400279[_0x7900('0x1a')][_0x7900('0x1b')]);return _0x181726(_0x400279[_0x7900('0x1a')][_0x7900('0x1b')]);}logger[_0x7900('0x1a')](_0x7900('0x16'),_0x4a470f,_0x400279['error'][_0x7900('0x1b')]);return _0x3cb0a7(_0x400279[_0x7900('0x1a')][_0x7900('0x1b')]);}else{logger[_0x7900('0x15')](_0x7900('0x16'),_0x4a470f,_0x7900('0x17'));_0x3cb0a7(_0x400279[_0x7900('0x1c')][_0x7900('0x1b')]);}})[_0x7900('0x1d')](function(_0x4e244a){logger[_0x7900('0x1a')]('WhatsappAccount,\x20%s,\x20%s',_0x4a470f,_0x4e244a);_0x181726(_0x4e244a);});});}exports[_0x7900('0x1e')]=function(_0x39b3bf){var _0x2b1fc8=this;return new Promise(function(_0x4d68d2,_0x318e13){return db[_0x7900('0x1f')][_0x7900('0x20')]({'raw':_0x39b3bf['options']?_0x39b3bf[_0x7900('0x21')][_0x7900('0x22')]===undefined?!![]:![]:!![],'where':_0x39b3bf[_0x7900('0x21')]?_0x39b3bf['options'][_0x7900('0x23')]||null:null,'attributes':_0x39b3bf[_0x7900('0x21')]?_0x39b3bf[_0x7900('0x21')][_0x7900('0x24')]||null:null,'include':_0x39b3bf[_0x7900('0x21')]?_0x39b3bf['options'][_0x7900('0x25')]?_[_0x7900('0x26')](_0x39b3bf[_0x7900('0x21')][_0x7900('0x25')],function(_0x293c27){return{'model':db[_0x293c27[_0x7900('0x27')]],'as':_0x293c27['as'],'attributes':_0x293c27['attributes'],'include':_0x293c27[_0x7900('0x25')]?_[_0x7900('0x26')](_0x293c27[_0x7900('0x25')],function(_0x36b211){return{'model':db[_0x36b211['model']],'as':_0x36b211['as'],'attributes':_0x36b211[_0x7900('0x24')],'include':_0x36b211[_0x7900('0x25')]?_[_0x7900('0x26')](_0x36b211['include'],function(_0x227578){return{'model':db[_0x227578[_0x7900('0x27')]],'as':_0x227578['as'],'attributes':_0x227578[_0x7900('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11d0fd){logger[_0x7900('0x15')](_0x7900('0x1e'),_0x39b3bf);logger[_0x7900('0x18')](_0x7900('0x1e'),_0x39b3bf,JSON[_0x7900('0x19')](_0x11d0fd));_0x4d68d2(_0x11d0fd);})['catch'](function(_0x5d4a48){logger[_0x7900('0x1a')]('ShowWhatsappAccount',_0x5d4a48[_0x7900('0x1b')],_0x39b3bf);_0x318e13(_0x2b1fc8[_0x7900('0x1a')](0x1f4,_0x5d4a48[_0x7900('0x1b')]));});});}; \ No newline at end of file +var _0x452d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappAccount.socket','register','then','info','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2920dd,_0x19d049){var _0x5d4e52=function(_0x46c751){while(--_0x46c751){_0x2920dd['push'](_0x2920dd['shift']());}};_0x5d4e52(++_0x19d049);}(_0x452d,0x92));var _0xd452=function(_0x3dc39c,_0x797cb9){_0x3dc39c=_0x3dc39c-0x0;var _0x2de747=_0x452d[_0x3dc39c];return _0x2de747;};'use strict';var _=require(_0xd452('0x0'));var util=require(_0xd452('0x1'));var moment=require(_0xd452('0x2'));var BPromise=require(_0xd452('0x3'));var rs=require(_0xd452('0x4'));var fs=require('fs');var Redis=require(_0xd452('0x5'));var db=require(_0xd452('0x6'))['db'];var utils=require(_0xd452('0x7'));var logger=require(_0xd452('0x8'))(_0xd452('0x9'));var config=require(_0xd452('0xa'));var jayson=require(_0xd452('0xb'));var client=jayson[_0xd452('0xc')][_0xd452('0xd')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd452('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xd452('0xf'))(new Redis(config[_0xd452('0xe')]));require(_0xd452('0x10'))[_0xd452('0x11')](socket);function respondWithRpcPromise(_0x3fffd4,_0x44dde1,_0x544995){return new BPromise(function(_0x147acf,_0x2149e8){return client['request'](_0x3fffd4,_0x544995)[_0xd452('0x12')](function(_0x5cdee6){logger[_0xd452('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x44dde1,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x44dde1,'request\x20sent',JSON[_0xd452('0x14')](_0x5cdee6));if(_0x5cdee6['error']){if(_0x5cdee6[_0xd452('0x15')][_0xd452('0x16')]===0x1f4){logger[_0xd452('0x15')](_0xd452('0x17'),_0x44dde1,_0x5cdee6[_0xd452('0x15')][_0xd452('0x18')]);return _0x2149e8(_0x5cdee6[_0xd452('0x15')][_0xd452('0x18')]);}logger[_0xd452('0x15')](_0xd452('0x17'),_0x44dde1,_0x5cdee6[_0xd452('0x15')][_0xd452('0x18')]);return _0x147acf(_0x5cdee6[_0xd452('0x15')][_0xd452('0x18')]);}else{logger['info'](_0xd452('0x17'),_0x44dde1,_0xd452('0x19'));_0x147acf(_0x5cdee6[_0xd452('0x1a')][_0xd452('0x18')]);}})[_0xd452('0x1b')](function(_0x141647){logger[_0xd452('0x15')](_0xd452('0x17'),_0x44dde1,_0x141647);_0x2149e8(_0x141647);});});}exports[_0xd452('0x1c')]=function(_0x3182e6){var _0x481133=this;return new Promise(function(_0xe4bec5,_0x29705c){return db[_0xd452('0x1d')][_0xd452('0x1e')]({'raw':_0x3182e6[_0xd452('0x1f')]?_0x3182e6['options'][_0xd452('0x20')]===undefined?!![]:![]:!![],'where':_0x3182e6[_0xd452('0x1f')]?_0x3182e6[_0xd452('0x1f')][_0xd452('0x21')]||null:null,'attributes':_0x3182e6[_0xd452('0x1f')]?_0x3182e6['options'][_0xd452('0x22')]||null:null,'include':_0x3182e6['options']?_0x3182e6[_0xd452('0x1f')]['include']?_[_0xd452('0x23')](_0x3182e6[_0xd452('0x1f')][_0xd452('0x24')],function(_0x467f9c){return{'model':db[_0x467f9c['model']],'as':_0x467f9c['as'],'attributes':_0x467f9c['attributes'],'include':_0x467f9c[_0xd452('0x24')]?_[_0xd452('0x23')](_0x467f9c[_0xd452('0x24')],function(_0x5adf14){return{'model':db[_0x5adf14[_0xd452('0x25')]],'as':_0x5adf14['as'],'attributes':_0x5adf14[_0xd452('0x22')],'include':_0x5adf14[_0xd452('0x24')]?_['map'](_0x5adf14[_0xd452('0x24')],function(_0x964691){return{'model':db[_0x964691[_0xd452('0x25')]],'as':_0x964691['as'],'attributes':_0x964691[_0xd452('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d1057){logger[_0xd452('0x13')]('ShowWhatsappAccount',_0x3182e6);logger['debug'](_0xd452('0x1c'),_0x3182e6,JSON['stringify'](_0x2d1057));_0xe4bec5(_0x2d1057);})[_0xd452('0x1b')](function(_0x29d1b2){logger[_0xd452('0x15')](_0xd452('0x1c'),_0x29d1b2[_0xd452('0x18')],_0x3182e6);_0x29705c(_0x481133[_0xd452('0x15')](0x1f4,_0x29d1b2['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index e7bcbac..ccd9655 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 _0x6583=['removeListener','register','whatsappAccount:','./whatsappAccount.events','remove','update'];(function(_0x134261,_0xa29812){var _0x142e8c=function(_0x586618){while(--_0x586618){_0x134261['push'](_0x134261['shift']());}};_0x142e8c(++_0xa29812);}(_0x6583,0x123));var _0x3658=function(_0x3ac312,_0x5d3903){_0x3ac312=_0x3ac312-0x0;var _0x36b673=_0x6583[_0x3ac312];return _0x36b673;};'use strict';var WhatsappAccountEvents=require(_0x3658('0x0'));var events=['save',_0x3658('0x1'),_0x3658('0x2')];function createListener(_0x3f760a,_0x554303){return function(_0x472497){_0x554303['emit'](_0x3f760a,_0x472497);};}function removeListener(_0x52ea17,_0x59cd35){return function(){WhatsappAccountEvents[_0x3658('0x3')](_0x52ea17,_0x59cd35);};}exports[_0x3658('0x4')]=function(_0x306e9d){for(var _0x100d66=0x0,_0xe7679d=events['length'];_0x100d66<_0xe7679d;_0x100d66++){var _0x2c69f9=events[_0x100d66];var _0x1a4146=createListener(_0x3658('0x5')+_0x2c69f9,_0x306e9d);WhatsappAccountEvents['on'](_0x2c69f9,_0x1a4146);}}; \ No newline at end of file +var _0x3ba6=['emit','removeListener','register','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0x506bb3,_0x2bd140){var _0x89999d=function(_0x326ba8){while(--_0x326ba8){_0x506bb3['push'](_0x506bb3['shift']());}};_0x89999d(++_0x2bd140);}(_0x3ba6,0xcc));var _0x63ba=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0x3ba6[_0x323d87];return _0x5e8f74;};'use strict';var WhatsappAccountEvents=require(_0x63ba('0x0'));var events=[_0x63ba('0x1'),_0x63ba('0x2'),_0x63ba('0x3')];function createListener(_0x26b3c5,_0x31e38c){return function(_0x720379){_0x31e38c[_0x63ba('0x4')](_0x26b3c5,_0x720379);};}function removeListener(_0x495f79,_0x1a2e25){return function(){WhatsappAccountEvents[_0x63ba('0x5')](_0x495f79,_0x1a2e25);};}exports[_0x63ba('0x6')]=function(_0xf79761){for(var _0x53fe29=0x0,_0x4cfb56=events['length'];_0x53fe29<_0x4cfb56;_0x53fe29++){var _0x21a731=events[_0x53fe29];var _0x14a60a=createListener(_0x63ba('0x7')+_0x21a731,_0xf79761);WhatsappAccountEvents['on'](_0x21a731,_0x14a60a);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 9087477..53cf4e5 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 _0x18aa=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x5071c1,_0x435e3b){var _0x461654=function(_0x312ed2){while(--_0x312ed2){_0x5071c1['push'](_0x5071c1['shift']());}};_0x461654(++_0x435e3b);}(_0x18aa,0xdc));var _0xa18a=function(_0x3288c0,_0x3100b6){_0x3288c0=_0x3288c0-0x0;var _0x2c06ba=_0x18aa[_0x3288c0];return _0x2c06ba;};'use strict';var multer=require(_0xa18a('0x0'));var util=require(_0xa18a('0x1'));var path=require(_0xa18a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa18a('0x3')]();var fs_extra=require(_0xa18a('0x4'));var auth=require(_0xa18a('0x5'));var interaction=require(_0xa18a('0x6'));var config=require(_0xa18a('0x7'));var controller=require(_0xa18a('0x8'));router[_0xa18a('0x9')]('/',auth[_0xa18a('0xa')](),controller[_0xa18a('0xb')]);router['get'](_0xa18a('0xc'),auth[_0xa18a('0xa')](),controller[_0xa18a('0xd')]);router[_0xa18a('0xe')]('/',auth[_0xa18a('0xa')](),controller[_0xa18a('0xf')]);router['put'](_0xa18a('0xc'),auth[_0xa18a('0xa')](),controller[_0xa18a('0x10')]);router[_0xa18a('0x11')](_0xa18a('0xc'),auth[_0xa18a('0xa')](),controller[_0xa18a('0x12')]);module[_0xa18a('0x13')]=router; \ No newline at end of file +var _0xa1f4=['../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x45d36d,_0x4b4dfe){var _0xa007f7=function(_0x170c4d){while(--_0x170c4d){_0x45d36d['push'](_0x45d36d['shift']());}};_0xa007f7(++_0x4b4dfe);}(_0xa1f4,0xf8));var _0x4a1f=function(_0x155999,_0xbb8070){_0x155999=_0x155999-0x0;var _0x476c58=_0xa1f4[_0x155999];return _0x476c58;};'use strict';var multer=require(_0x4a1f('0x0'));var util=require(_0x4a1f('0x1'));var path=require('path');var timeout=require(_0x4a1f('0x2'));var express=require(_0x4a1f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4a1f('0x4'));var interaction=require(_0x4a1f('0x5'));var config=require('../../config/environment');var controller=require(_0x4a1f('0x6'));router[_0x4a1f('0x7')]('/',auth[_0x4a1f('0x8')](),controller[_0x4a1f('0x9')]);router[_0x4a1f('0x7')](_0x4a1f('0xa'),auth[_0x4a1f('0x8')](),controller[_0x4a1f('0xb')]);router[_0x4a1f('0xc')]('/',auth[_0x4a1f('0x8')](),controller[_0x4a1f('0xd')]);router['put'](_0x4a1f('0xa'),auth[_0x4a1f('0x8')](),controller[_0x4a1f('0xe')]);router[_0x4a1f('0xf')](_0x4a1f('0xa'),auth[_0x4a1f('0x8')](),controller[_0x4a1f('0x10')]);module[_0x4a1f('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 e531179..dd663dd 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 _0xad89=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x3dd627,_0x581f7f){var _0x523732=function(_0x2d9080){while(--_0x2d9080){_0x3dd627['push'](_0x3dd627['shift']());}};_0x523732(++_0x581f7f);}(_0xad89,0xbd));var _0x9ad8=function(_0x123d3d,_0x114ea5){_0x123d3d=_0x123d3d-0x0;var _0x5707bf=_0xad89[_0x123d3d];return _0x5707bf;};'use strict';var Sequelize=require('sequelize');module[_0x9ad8('0x0')]={'priority':{'type':Sequelize[_0x9ad8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9ad8('0x2')],'allowNull':![],'defaultValue':_0x9ad8('0x3')},'appdata':{'type':Sequelize[_0x9ad8('0x4')]()},'description':{'type':Sequelize[_0x9ad8('0x2')]},'interval':{'type':Sequelize[_0x9ad8('0x2')],'defaultValue':_0x9ad8('0x5')}}; \ No newline at end of file +var _0x669c=['sequelize','exports','STRING','noop','TEXT'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x669c,0x154));var _0xc669=function(_0x265592,_0x5eeeb9){_0x265592=_0x265592-0x0;var _0x151a40=_0x669c[_0x265592];return _0x151a40;};'use strict';var Sequelize=require(_0xc669('0x0'));module[_0xc669('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc669('0x2')],'allowNull':![],'defaultValue':_0xc669('0x3')},'appdata':{'type':Sequelize[_0xc669('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc669('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index d151262..f052bd4 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 _0x4ccb=['destroy','error','stack','name','send','index','map','WhatsappApplication','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x2b3e10,_0x2e8409){var _0x2c532f=function(_0x215d71){while(--_0x215d71){_0x2b3e10['push'](_0x2b3e10['shift']());}};_0x2c532f(++_0x2e8409);}(_0x4ccb,0x196));var _0xb4cc=function(_0x1cd93b,_0x523800){_0x1cd93b=_0x1cd93b-0x0;var _0x15ac86=_0x4ccb[_0x1cd93b];return _0x15ac86;};'use strict';var emlformat=require(_0xb4cc('0x0'));var rimraf=require(_0xb4cc('0x1'));var zipdir=require(_0xb4cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb4cc('0x3'));var moment=require(_0xb4cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb4cc('0x5'));var util=require(_0xb4cc('0x6'));var path=require(_0xb4cc('0x7'));var sox=require('sox');var csv=require(_0xb4cc('0x8'));var ejs=require(_0xb4cc('0x9'));var fs=require('fs');var fs_extra=require(_0xb4cc('0xa'));var _=require('lodash');var squel=require(_0xb4cc('0xb'));var crypto=require(_0xb4cc('0xc'));var jsforce=require(_0xb4cc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb4cc('0x8'));var querystring=require(_0xb4cc('0xe'));var Papa=require(_0xb4cc('0xf'));var Redis=require(_0xb4cc('0x10'));var authService=require(_0xb4cc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb4cc('0x12'));var hardwareService=require(_0xb4cc('0x13'));var logger=require('../../config/logger')(_0xb4cc('0x14'));var utils=require('../../config/utils');var config=require(_0xb4cc('0x15'));var licenseUtil=require(_0xb4cc('0x16'));var db=require(_0xb4cc('0x17'))['db'];function respondWithStatusCode(_0x58ed7d,_0x5a4449){_0x5a4449=_0x5a4449||0xcc;return function(_0x205a03){if(_0x205a03){return _0x58ed7d['sendStatus'](_0x5a4449);}return _0x58ed7d['status'](_0x5a4449)[_0xb4cc('0x18')]();};}function respondWithResult(_0x58b1c2,_0x52b57d){_0x52b57d=_0x52b57d||0xc8;return function(_0xcfdeb9){if(_0xcfdeb9){return _0x58b1c2[_0xb4cc('0x19')](_0x52b57d)[_0xb4cc('0x1a')](_0xcfdeb9);}};}function respondWithFilteredResult(_0x5d33a5,_0x4096db){return function(_0x1a5edc){if(_0x1a5edc){var _0x3aca2b=typeof _0x4096db[_0xb4cc('0x1b')]===_0xb4cc('0x1c')&&typeof _0x4096db['limit']===_0xb4cc('0x1c');var _0x2ba050=_0x1a5edc[_0xb4cc('0x1d')];var _0x5b56b2=_0x3aca2b?0x0:_0x4096db[_0xb4cc('0x1b')];var _0x14d8b6=_0x3aca2b?_0x1a5edc[_0xb4cc('0x1d')]:_0x4096db[_0xb4cc('0x1b')]+_0x4096db[_0xb4cc('0x1e')];var _0x5cfc7d;if(_0x14d8b6>=_0x2ba050){_0x14d8b6=_0x2ba050;_0x5cfc7d=0xc8;}else{_0x5cfc7d=0xce;}_0x5d33a5[_0xb4cc('0x19')](_0x5cfc7d);return _0x5d33a5[_0xb4cc('0x1f')](_0xb4cc('0x20'),_0x5b56b2+'-'+_0x14d8b6+'/'+_0x2ba050)[_0xb4cc('0x1a')](_0x1a5edc);}return null;};}function patchUpdates(_0x3a957b){return function(_0x554418){try{jsonpatch[_0xb4cc('0x21')](_0x554418,_0x3a957b,!![]);}catch(_0x1bed69){return BPromise[_0xb4cc('0x22')](_0x1bed69);}return _0x554418[_0xb4cc('0x23')]();};}function saveUpdates(_0x56f634,_0x571793){return function(_0xc9d835){if(_0xc9d835){return _0xc9d835[_0xb4cc('0x24')](_0x56f634)[_0xb4cc('0x25')](function(_0xaf11df){return _0xaf11df;});}return null;};}function removeEntity(_0x5e1c46,_0x4dddc8){return function(_0x3dd7ef){if(_0x3dd7ef){return _0x3dd7ef[_0xb4cc('0x26')]()['then'](function(){_0x5e1c46['status'](0xcc)[_0xb4cc('0x18')]();});}};}function handleEntityNotFound(_0xeb25e1,_0x2ee2d3){return function(_0x154002){if(!_0x154002){_0xeb25e1['sendStatus'](0x194);}return _0x154002;};}function handleError(_0x4efac8,_0x3a1236){_0x3a1236=_0x3a1236||0x1f4;return function(_0x4f47ed){logger[_0xb4cc('0x27')](_0x4f47ed[_0xb4cc('0x28')]);if(_0x4f47ed[_0xb4cc('0x29')]){delete _0x4f47ed[_0xb4cc('0x29')];}_0x4efac8[_0xb4cc('0x19')](_0x3a1236)[_0xb4cc('0x2a')](_0x4f47ed);};}exports[_0xb4cc('0x2b')]=function(_0x1de4b6,_0x27b804){var _0x5baab6={},_0x755b4a={},_0x210e23={'count':0x0,'rows':[]};var _0x4707b1=_[_0xb4cc('0x2c')](db[_0xb4cc('0x2d')]['rawAttributes'],function(_0x61dc50){return{'name':_0x61dc50[_0xb4cc('0x2e')],'type':_0x61dc50[_0xb4cc('0x2f')][_0xb4cc('0x30')]};});_0x755b4a['model']=_[_0xb4cc('0x2c')](_0x4707b1,_0xb4cc('0x29'));_0x755b4a['query']=_[_0xb4cc('0x31')](_0x1de4b6[_0xb4cc('0x32')]);_0x755b4a['filters']=_[_0xb4cc('0x33')](_0x755b4a[_0xb4cc('0x34')],_0x755b4a[_0xb4cc('0x32')]);_0x5baab6[_0xb4cc('0x35')]=_[_0xb4cc('0x33')](_0x755b4a[_0xb4cc('0x34')],qs[_0xb4cc('0x36')](_0x1de4b6[_0xb4cc('0x32')][_0xb4cc('0x36')]));_0x5baab6['attributes']=_0x5baab6['attributes'][_0xb4cc('0x37')]?_0x5baab6[_0xb4cc('0x35')]:_0x755b4a[_0xb4cc('0x34')];if(!_0x1de4b6[_0xb4cc('0x32')][_0xb4cc('0x38')]('nolimit')){_0x5baab6[_0xb4cc('0x1e')]=qs[_0xb4cc('0x1e')](_0x1de4b6[_0xb4cc('0x32')]['limit']);_0x5baab6[_0xb4cc('0x1b')]=qs[_0xb4cc('0x1b')](_0x1de4b6[_0xb4cc('0x32')]['offset']);}_0x5baab6[_0xb4cc('0x39')]=qs['sort'](_0x1de4b6[_0xb4cc('0x32')][_0xb4cc('0x3a')]);_0x5baab6[_0xb4cc('0x3b')]=qs[_0xb4cc('0x3c')](_['pick'](_0x1de4b6[_0xb4cc('0x32')],_0x755b4a['filters']),_0x4707b1);if(_0x1de4b6[_0xb4cc('0x32')][_0xb4cc('0x3d')]){_0x5baab6[_0xb4cc('0x3b')]=_[_0xb4cc('0x3e')](_0x5baab6[_0xb4cc('0x3b')],{'$or':_[_0xb4cc('0x2c')](_0x4707b1,function(_0x4214e5){if(_0x4214e5['type']!==_0xb4cc('0x3f')){var _0x379ab3={};_0x379ab3[_0x4214e5[_0xb4cc('0x29')]]={'$like':'%'+_0x1de4b6['query']['filter']+'%'};return _0x379ab3;}})});}_0x5baab6=_[_0xb4cc('0x3e')]({},_0x5baab6,_0x1de4b6[_0xb4cc('0x40')]);var _0x2d3653={'where':_0x5baab6[_0xb4cc('0x3b')]};return db[_0xb4cc('0x2d')]['count'](_0x2d3653)[_0xb4cc('0x25')](function(_0x5d55fe){_0x210e23['count']=_0x5d55fe;if(_0x1de4b6[_0xb4cc('0x32')][_0xb4cc('0x41')]){_0x5baab6[_0xb4cc('0x42')]=[{'all':!![]}];}return db[_0xb4cc('0x2d')][_0xb4cc('0x43')](_0x5baab6);})['then'](function(_0xda87d5){_0x210e23['rows']=_0xda87d5;return _0x210e23;})[_0xb4cc('0x25')](respondWithFilteredResult(_0x27b804,_0x5baab6))[_0xb4cc('0x44')](handleError(_0x27b804,null));};exports[_0xb4cc('0x45')]=function(_0x2bf6b2,_0x428ef1){var _0x35a6c8={'raw':!![],'where':{'id':_0x2bf6b2[_0xb4cc('0x46')]['id']}},_0x31521b={};_0x31521b[_0xb4cc('0x34')]=_[_0xb4cc('0x31')](db[_0xb4cc('0x2d')]['rawAttributes']);_0x31521b[_0xb4cc('0x32')]=_[_0xb4cc('0x31')](_0x2bf6b2[_0xb4cc('0x32')]);_0x31521b[_0xb4cc('0x3c')]=_['intersection'](_0x31521b['model'],_0x31521b[_0xb4cc('0x32')]);_0x35a6c8[_0xb4cc('0x35')]=_['intersection'](_0x31521b[_0xb4cc('0x34')],qs[_0xb4cc('0x36')](_0x2bf6b2[_0xb4cc('0x32')][_0xb4cc('0x36')]));_0x35a6c8['attributes']=_0x35a6c8[_0xb4cc('0x35')][_0xb4cc('0x37')]?_0x35a6c8[_0xb4cc('0x35')]:_0x31521b['model'];if(_0x2bf6b2[_0xb4cc('0x32')][_0xb4cc('0x41')]){_0x35a6c8[_0xb4cc('0x42')]=[{'all':!![]}];}_0x35a6c8=_[_0xb4cc('0x3e')]({},_0x35a6c8,_0x2bf6b2[_0xb4cc('0x40')]);return db[_0xb4cc('0x2d')][_0xb4cc('0x47')](_0x35a6c8)[_0xb4cc('0x25')](handleEntityNotFound(_0x428ef1,null))[_0xb4cc('0x25')](respondWithResult(_0x428ef1,null))['catch'](handleError(_0x428ef1,null));};exports[_0xb4cc('0x48')]=function(_0x5dffc3,_0x2b159b){return db[_0xb4cc('0x2d')][_0xb4cc('0x48')](_0x5dffc3['body'],{})[_0xb4cc('0x25')](respondWithResult(_0x2b159b,0xc9))[_0xb4cc('0x44')](handleError(_0x2b159b,null));};exports[_0xb4cc('0x24')]=function(_0x422db1,_0x28d91f){if(_0x422db1[_0xb4cc('0x49')]['id']){delete _0x422db1[_0xb4cc('0x49')]['id'];}return db[_0xb4cc('0x2d')]['find']({'where':{'id':_0x422db1[_0xb4cc('0x46')]['id']}})[_0xb4cc('0x25')](handleEntityNotFound(_0x28d91f,null))[_0xb4cc('0x25')](saveUpdates(_0x422db1[_0xb4cc('0x49')],null))[_0xb4cc('0x25')](respondWithResult(_0x28d91f,null))[_0xb4cc('0x44')](handleError(_0x28d91f,null));};exports[_0xb4cc('0x26')]=function(_0x5558d8,_0x21e047){return db[_0xb4cc('0x2d')]['find']({'where':{'id':_0x5558d8[_0xb4cc('0x46')]['id']}})[_0xb4cc('0x25')](handleEntityNotFound(_0x21e047,null))[_0xb4cc('0x25')](removeEntity(_0x21e047,null))[_0xb4cc('0x44')](handleError(_0x21e047,null));}; \ No newline at end of file +var _0x2aa3=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x1e00d4,_0x3b6de3){var _0x405890=function(_0x2ee1f3){while(--_0x2ee1f3){_0x1e00d4['push'](_0x1e00d4['shift']());}};_0x405890(++_0x3b6de3);}(_0x2aa3,0x83));var _0x32aa=function(_0x2432a2,_0x7842e1){_0x2432a2=_0x2432a2-0x0;var _0x476eb7=_0x2aa3[_0x2432a2];return _0x476eb7;};'use strict';var emlformat=require(_0x32aa('0x0'));var rimraf=require(_0x32aa('0x1'));var zipdir=require(_0x32aa('0x2'));var jsonpatch=require(_0x32aa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x32aa('0x4'));var Mustache=require(_0x32aa('0x5'));var util=require(_0x32aa('0x6'));var path=require(_0x32aa('0x7'));var sox=require(_0x32aa('0x8'));var csv=require(_0x32aa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32aa('0xa'));var _=require(_0x32aa('0xb'));var squel=require(_0x32aa('0xc'));var crypto=require(_0x32aa('0xd'));var jsforce=require(_0x32aa('0xe'));var deskjs=require(_0x32aa('0xf'));var toCsv=require(_0x32aa('0x9'));var querystring=require(_0x32aa('0x10'));var Papa=require('papaparse');var Redis=require(_0x32aa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x32aa('0x12'));var as=require(_0x32aa('0x13'));var hardwareService=require(_0x32aa('0x14'));var logger=require(_0x32aa('0x15'))('api');var utils=require(_0x32aa('0x16'));var config=require(_0x32aa('0x17'));var licenseUtil=require(_0x32aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d341f,_0x32aca0){_0x32aca0=_0x32aca0||0xcc;return function(_0x3640f9){if(_0x3640f9){return _0x3d341f[_0x32aa('0x19')](_0x32aca0);}return _0x3d341f[_0x32aa('0x1a')](_0x32aca0)[_0x32aa('0x1b')]();};}function respondWithResult(_0x5e96e3,_0x46758f){_0x46758f=_0x46758f||0xc8;return function(_0x58d625){if(_0x58d625){return _0x5e96e3[_0x32aa('0x1a')](_0x46758f)[_0x32aa('0x1c')](_0x58d625);}};}function respondWithFilteredResult(_0x1140a6,_0x2cc92d){return function(_0x211278){if(_0x211278){var _0x47eadd=typeof _0x2cc92d[_0x32aa('0x1d')]===_0x32aa('0x1e')&&typeof _0x2cc92d[_0x32aa('0x1f')]===_0x32aa('0x1e');var _0x29c1c4=_0x211278['count'];var _0x5196c0=_0x47eadd?0x0:_0x2cc92d[_0x32aa('0x1d')];var _0x34dcaf=_0x47eadd?_0x211278[_0x32aa('0x20')]:_0x2cc92d['offset']+_0x2cc92d['limit'];var _0x1a0262;if(_0x34dcaf>=_0x29c1c4){_0x34dcaf=_0x29c1c4;_0x1a0262=0xc8;}else{_0x1a0262=0xce;}_0x1140a6[_0x32aa('0x1a')](_0x1a0262);return _0x1140a6[_0x32aa('0x21')](_0x32aa('0x22'),_0x5196c0+'-'+_0x34dcaf+'/'+_0x29c1c4)[_0x32aa('0x1c')](_0x211278);}return null;};}function patchUpdates(_0x1cb0eb){return function(_0x5729af){try{jsonpatch[_0x32aa('0x23')](_0x5729af,_0x1cb0eb,!![]);}catch(_0x327831){return BPromise[_0x32aa('0x24')](_0x327831);}return _0x5729af[_0x32aa('0x25')]();};}function saveUpdates(_0x2aa421,_0x90d165){return function(_0x1ce405){if(_0x1ce405){return _0x1ce405[_0x32aa('0x26')](_0x2aa421)[_0x32aa('0x27')](function(_0x53c65a){return _0x53c65a;});}return null;};}function removeEntity(_0x4e66e6,_0x5c82d2){return function(_0x6766da){if(_0x6766da){return _0x6766da[_0x32aa('0x28')]()['then'](function(){_0x4e66e6['status'](0xcc)[_0x32aa('0x1b')]();});}};}function handleEntityNotFound(_0x313930,_0x3ba6b2){return function(_0x13d610){if(!_0x13d610){_0x313930[_0x32aa('0x19')](0x194);}return _0x13d610;};}function handleError(_0x3606ae,_0x27df0e){_0x27df0e=_0x27df0e||0x1f4;return function(_0x405b03){logger[_0x32aa('0x29')](_0x405b03['stack']);if(_0x405b03[_0x32aa('0x2a')]){delete _0x405b03[_0x32aa('0x2a')];}_0x3606ae['status'](_0x27df0e)[_0x32aa('0x2b')](_0x405b03);};}exports['index']=function(_0x4f73d1,_0x21d730){var _0x212ee4={},_0x1d1c80={},_0x11c818={'count':0x0,'rows':[]};var _0x5903b8=_[_0x32aa('0x2c')](db[_0x32aa('0x2d')][_0x32aa('0x2e')],function(_0x29706e){return{'name':_0x29706e[_0x32aa('0x2f')],'type':_0x29706e[_0x32aa('0x30')]['key']};});_0x1d1c80['model']=_[_0x32aa('0x2c')](_0x5903b8,_0x32aa('0x2a'));_0x1d1c80[_0x32aa('0x31')]=_[_0x32aa('0x32')](_0x4f73d1['query']);_0x1d1c80['filters']=_[_0x32aa('0x33')](_0x1d1c80['model'],_0x1d1c80[_0x32aa('0x31')]);_0x212ee4[_0x32aa('0x34')]=_['intersection'](_0x1d1c80[_0x32aa('0x35')],qs[_0x32aa('0x36')](_0x4f73d1['query'][_0x32aa('0x36')]));_0x212ee4[_0x32aa('0x34')]=_0x212ee4[_0x32aa('0x34')][_0x32aa('0x37')]?_0x212ee4[_0x32aa('0x34')]:_0x1d1c80[_0x32aa('0x35')];if(!_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x38')](_0x32aa('0x39'))){_0x212ee4[_0x32aa('0x1f')]=qs[_0x32aa('0x1f')](_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x1f')]);_0x212ee4[_0x32aa('0x1d')]=qs['offset'](_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x1d')]);}_0x212ee4[_0x32aa('0x3a')]=qs[_0x32aa('0x3b')](_0x4f73d1[_0x32aa('0x31')]['sort']);_0x212ee4[_0x32aa('0x3c')]=qs[_0x32aa('0x3d')](_[_0x32aa('0x3e')](_0x4f73d1[_0x32aa('0x31')],_0x1d1c80[_0x32aa('0x3d')]),_0x5903b8);if(_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x3f')]){_0x212ee4[_0x32aa('0x3c')]=_[_0x32aa('0x40')](_0x212ee4[_0x32aa('0x3c')],{'$or':_[_0x32aa('0x2c')](_0x5903b8,function(_0x563a74){if(_0x563a74['type']!==_0x32aa('0x41')){var _0x3c4fb6={};_0x3c4fb6[_0x563a74[_0x32aa('0x2a')]]={'$like':'%'+_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x3f')]+'%'};return _0x3c4fb6;}})});}_0x212ee4=_[_0x32aa('0x40')]({},_0x212ee4,_0x4f73d1[_0x32aa('0x42')]);var _0x555a83={'where':_0x212ee4[_0x32aa('0x3c')]};return db[_0x32aa('0x2d')][_0x32aa('0x20')](_0x555a83)[_0x32aa('0x27')](function(_0x517614){_0x11c818[_0x32aa('0x20')]=_0x517614;if(_0x4f73d1['query'][_0x32aa('0x43')]){_0x212ee4[_0x32aa('0x44')]=[{'all':!![]}];}return db[_0x32aa('0x2d')][_0x32aa('0x45')](_0x212ee4);})[_0x32aa('0x27')](function(_0x5c4052){_0x11c818[_0x32aa('0x46')]=_0x5c4052;return _0x11c818;})[_0x32aa('0x27')](respondWithFilteredResult(_0x21d730,_0x212ee4))[_0x32aa('0x47')](handleError(_0x21d730,null));};exports[_0x32aa('0x48')]=function(_0x4fb0f4,_0x142572){var _0x483a04={'raw':!![],'where':{'id':_0x4fb0f4[_0x32aa('0x49')]['id']}},_0x1640f3={};_0x1640f3['model']=_[_0x32aa('0x32')](db[_0x32aa('0x2d')][_0x32aa('0x2e')]);_0x1640f3[_0x32aa('0x31')]=_[_0x32aa('0x32')](_0x4fb0f4[_0x32aa('0x31')]);_0x1640f3[_0x32aa('0x3d')]=_[_0x32aa('0x33')](_0x1640f3['model'],_0x1640f3['query']);_0x483a04[_0x32aa('0x34')]=_[_0x32aa('0x33')](_0x1640f3[_0x32aa('0x35')],qs[_0x32aa('0x36')](_0x4fb0f4[_0x32aa('0x31')]['fields']));_0x483a04[_0x32aa('0x34')]=_0x483a04[_0x32aa('0x34')][_0x32aa('0x37')]?_0x483a04['attributes']:_0x1640f3[_0x32aa('0x35')];if(_0x4fb0f4['query']['includeAll']){_0x483a04[_0x32aa('0x44')]=[{'all':!![]}];}_0x483a04=_[_0x32aa('0x40')]({},_0x483a04,_0x4fb0f4[_0x32aa('0x42')]);return db['WhatsappApplication']['find'](_0x483a04)[_0x32aa('0x27')](handleEntityNotFound(_0x142572,null))[_0x32aa('0x27')](respondWithResult(_0x142572,null))[_0x32aa('0x47')](handleError(_0x142572,null));};exports[_0x32aa('0x4a')]=function(_0x10078d,_0x1bb782){return db[_0x32aa('0x2d')][_0x32aa('0x4a')](_0x10078d[_0x32aa('0x4b')],{})[_0x32aa('0x27')](respondWithResult(_0x1bb782,0xc9))[_0x32aa('0x47')](handleError(_0x1bb782,null));};exports[_0x32aa('0x26')]=function(_0x75bd4,_0x1955dc){if(_0x75bd4['body']['id']){delete _0x75bd4['body']['id'];}return db[_0x32aa('0x2d')][_0x32aa('0x4c')]({'where':{'id':_0x75bd4[_0x32aa('0x49')]['id']}})[_0x32aa('0x27')](handleEntityNotFound(_0x1955dc,null))[_0x32aa('0x27')](saveUpdates(_0x75bd4[_0x32aa('0x4b')],null))[_0x32aa('0x27')](respondWithResult(_0x1955dc,null))[_0x32aa('0x47')](handleError(_0x1955dc,null));};exports['destroy']=function(_0x5573f7,_0x7115ef){return db['WhatsappApplication']['find']({'where':{'id':_0x5573f7[_0x32aa('0x49')]['id']}})[_0x32aa('0x27')](handleEntityNotFound(_0x7115ef,null))[_0x32aa('0x27')](removeEntity(_0x7115ef,null))[_0x32aa('0x47')](handleError(_0x7115ef,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 64fc7b9..c2608fe 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 _0x8b7c=['path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8b7c,0x119));var _0xc8b7=function(_0x4e9861,_0x25fe5f){_0x4e9861=_0x4e9861-0x0;var _0x49802f=_0x8b7c[_0x4e9861];return _0x49802f;};'use strict';var _=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var logger=require(_0xc8b7('0x2'))(_0xc8b7('0x3'));var moment=require(_0xc8b7('0x4'));var BPromise=require(_0xc8b7('0x5'));var rp=require(_0xc8b7('0x6'));var fs=require('fs');var path=require(_0xc8b7('0x7'));var rimraf=require('rimraf');var config=require(_0xc8b7('0x8'));var attributes=require(_0xc8b7('0x9'));module[_0xc8b7('0xa')]=function(_0x4a8b93,_0x256c78){return _0x4a8b93[_0xc8b7('0xb')](_0xc8b7('0xc'),attributes,{'tableName':_0xc8b7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8b7('0xe'),'collate':_0xc8b7('0xf')});}; \ No newline at end of file +var _0x4d9e=['lodash','api','bluebird','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x439ac5,_0x2f9dd1){var _0x5a71df=function(_0x393fd){while(--_0x393fd){_0x439ac5['push'](_0x439ac5['shift']());}};_0x5a71df(++_0x2f9dd1);}(_0x4d9e,0x18c));var _0xe4d9=function(_0xd5616,_0x2d8fd9){_0xd5616=_0xd5616-0x0;var _0x557700=_0x4d9e[_0xd5616];return _0x557700;};'use strict';var _=require(_0xe4d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe4d9('0x1'));var moment=require('moment');var BPromise=require(_0xe4d9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4d9('0x3'));var rimraf=require(_0xe4d9('0x4'));var config=require('../../config/environment');var attributes=require(_0xe4d9('0x5'));module[_0xe4d9('0x6')]=function(_0x278035,_0x34c2a2){return _0x278035[_0xe4d9('0x7')](_0xe4d9('0x8'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe4d9('0x9'),'collate':_0xe4d9('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 2ed5d6b..710c346 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 _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3738be,_0x53ac03){var _0xd6b4e7=function(_0x2ac1a3){while(--_0x2ac1a3){_0x3738be['push'](_0x3738be['shift']());}};_0xd6b4e7(++_0x53ac03);}(_0xac9d,0x14d));var _0xdac9=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xac9d[_0x1147ab];return _0x55cb5a;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file +var _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x36f5b7,_0x1514ca){var _0x495dfb=function(_0xace77){while(--_0xace77){_0x36f5b7['push'](_0x36f5b7['shift']());}};_0x495dfb(++_0x1514ca);}(_0xe14d,0x1ee));var _0xde14=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xe14d[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 9b0ea81..d027504 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 _0xcb66=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','create','post','addMessage','tracked','whatsappinteraction:addtags','addTags','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','util','path','connect-timeout','express','Router'];(function(_0x57bfb8,_0x262223){var _0x369bc3=function(_0x3b5363){while(--_0x3b5363){_0x57bfb8['push'](_0x57bfb8['shift']());}};_0x369bc3(++_0x262223);}(_0xcb66,0x19f));var _0x6cb6=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0xcb66[_0x31b9cf];return _0x357b8a;};'use strict';var multer=require('multer');var util=require(_0x6cb6('0x0'));var path=require(_0x6cb6('0x1'));var timeout=require(_0x6cb6('0x2'));var express=require(_0x6cb6('0x3'));var router=express[_0x6cb6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6cb6('0x5'));var interaction=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var controller=require(_0x6cb6('0x8'));router[_0x6cb6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6cb6('0x9')](_0x6cb6('0xa'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0xc')]);router[_0x6cb6('0x9')](_0x6cb6('0xd'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0xe')]);router[_0x6cb6('0x9')](_0x6cb6('0xf'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0x10')]);router[_0x6cb6('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x6cb6('0xb')](),controller[_0x6cb6('0x11')]);router[_0x6cb6('0x12')](_0x6cb6('0xf'),auth['isAuthenticated'](),controller[_0x6cb6('0x13')]);router[_0x6cb6('0x12')]('/:id/tags',auth[_0x6cb6('0xb')](),interaction[_0x6cb6('0x14')]('whatsapp',_0x6cb6('0x15')),controller[_0x6cb6('0x16')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x6cb6('0x17'),_0x6cb6('0x18')),controller[_0x6cb6('0x19')]);router[_0x6cb6('0x1a')](_0x6cb6('0xd'),auth[_0x6cb6('0xb')](),interaction['tracked'](_0x6cb6('0x17'),_0x6cb6('0x1b')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x0e4b=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','express','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x25a319,_0x58c414){var _0x153b10=function(_0x4cdc02){while(--_0x4cdc02){_0x25a319['push'](_0x25a319['shift']());}};_0x153b10(++_0x58c414);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x59d8dc,_0x4aa442){_0x59d8dc=_0x59d8dc-0x0;var _0x5375e6=_0x0e4b[_0x59d8dc];return _0x5375e6;};'use strict';var multer=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var path=require(_0xb0e4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0e4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb0e4('0x4'));var controller=require(_0xb0e4('0x5'));router['get']('/',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x7')]);router[_0xb0e4('0x8')](_0xb0e4('0x9'),auth[_0xb0e4('0x6')](),controller['describe']);router['get'](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xb')]);router[_0xb0e4('0x8')](_0xb0e4('0xc'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xd')]);router[_0xb0e4('0x8')](_0xb0e4('0xe'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xf')]);router[_0xb0e4('0x10')]('/',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x11')]);router[_0xb0e4('0x10')]('/:id/messages',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x12')]);router['post'](_0xb0e4('0x13'),auth[_0xb0e4('0x6')](),interaction[_0xb0e4('0x14')](_0xb0e4('0x15'),_0xb0e4('0x16')),controller['addTags']);router['put'](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),interaction['tracked'](_0xb0e4('0x15'),_0xb0e4('0x17')),controller[_0xb0e4('0x18')]);router[_0xb0e4('0x19')](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller[_0xb0e4('0x1a')]);router[_0xb0e4('0x19')](_0xb0e4('0x13'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x1b')]);module[_0xb0e4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index b913b9e..586956d 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 _0xc21c=['out','sequelize','moment','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3d73a0,_0x59b4bd){var _0x11ca40=function(_0x340daf){while(--_0x340daf){_0x3d73a0['push'](_0x3d73a0['shift']());}};_0x11ca40(++_0x59b4bd);}(_0xc21c,0x166));var _0xcc21=function(_0x5003df,_0x266193){_0x5003df=_0x5003df-0x0;var _0x5a28b9=_0xc21c[_0x5003df];return _0x5a28b9;};'use strict';var Sequelize=require(_0xcc21('0x0'));var moment=require(_0xcc21('0x1'));module['exports']={'closed':{'type':Sequelize[_0xcc21('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcc21('0x3')]},'disposition':{'type':Sequelize[_0xcc21('0x4')]},'secondDisposition':{'type':Sequelize[_0xcc21('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xcc21('0x4')]},'phone':{'type':Sequelize[_0xcc21('0x4')]},'read1stAt':{'type':Sequelize[_0xcc21('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcc21('0x5')]('in',_0xcc21('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcc21('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcc21('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcc21('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6a88=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x845505,_0x19e5f3){var _0x2513b9=function(_0x10e7af){while(--_0x10e7af){_0x845505['push'](_0x845505['shift']());}};_0x2513b9(++_0x19e5f3);}(_0x6a88,0xa9));var _0x86a8=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0x6a88[_0x414297];return _0x51ea47;};'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 diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 830e6be..711b73e 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 _0x7a43=['Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','groupBy','WhatsappInteractionId','all','rows','catch','show','include','options','create','params','describe','WhatsappMessage','addMessage','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','ids','spread','emit','whatsappInteractionTags:save','removeTags','download','join','root','server','files','tmp','format','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','closedAt','disposition','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','Users','map','fullname','split','forEach','Tags','push','TagIds','index','WhatsappInteraction','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','WhatsappAccountId','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.phone'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7a43,0x13e));var _0x37a4=function(_0x28c077,_0x237a73){_0x28c077=_0x28c077-0x0;var _0x646e8d=_0x7a43[_0x28c077];return _0x646e8d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37a4('0x0'));var zipdir=require(_0x37a4('0x1'));var jsonpatch=require(_0x37a4('0x2'));var rp=require(_0x37a4('0x3'));var moment=require(_0x37a4('0x4'));var BPromise=require(_0x37a4('0x5'));var Mustache=require('mustache');var util=require(_0x37a4('0x6'));var path=require(_0x37a4('0x7'));var sox=require(_0x37a4('0x8'));var csv=require(_0x37a4('0x9'));var ejs=require(_0x37a4('0xa'));var fs=require('fs');var fs_extra=require(_0x37a4('0xb'));var _=require(_0x37a4('0xc'));var squel=require(_0x37a4('0xd'));var crypto=require(_0x37a4('0xe'));var jsforce=require(_0x37a4('0xf'));var deskjs=require(_0x37a4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x37a4('0x11'));var Papa=require(_0x37a4('0x12'));var Redis=require(_0x37a4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x37a4('0x14'));var as=require(_0x37a4('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x37a4('0x16'));var logger=require(_0x37a4('0x17'))('api');var utils=require(_0x37a4('0x18'));var config=require(_0x37a4('0x19'));var licenseUtil=require(_0x37a4('0x1a'));var db=require('../../mysqldb')['db'];config[_0x37a4('0x1b')]=_['defaults'](config[_0x37a4('0x1b')],{'host':_0x37a4('0x1c'),'port':0x18eb});var socket=require(_0x37a4('0x1d'))(new Redis(config['redis']));require(_0x37a4('0x1e'))[_0x37a4('0x1f')](socket);function respondWithStatusCode(_0x39166b,_0x126bff){_0x126bff=_0x126bff||0xcc;return function(_0x16aae3){if(_0x16aae3){return _0x39166b['sendStatus'](_0x126bff);}return _0x39166b[_0x37a4('0x20')](_0x126bff)[_0x37a4('0x21')]();};}function respondWithResult(_0x570430,_0x5bcf73){_0x5bcf73=_0x5bcf73||0xc8;return function(_0x10a156){if(_0x10a156){return _0x570430['status'](_0x5bcf73)[_0x37a4('0x22')](_0x10a156);}};}function respondWithFilteredResult(_0xb58e85,_0x3e4236){return function(_0x5568d2){if(_0x5568d2){var _0x195df5=typeof _0x3e4236[_0x37a4('0x23')]===_0x37a4('0x24')&&typeof _0x3e4236[_0x37a4('0x25')]===_0x37a4('0x24');var _0x4b5a34=_0x5568d2[_0x37a4('0x26')];var _0x423487=_0x195df5?0x0:_0x3e4236[_0x37a4('0x23')];var _0x2be137=_0x195df5?_0x5568d2[_0x37a4('0x26')]:_0x3e4236[_0x37a4('0x23')]+_0x3e4236['limit'];var _0x401003;if(_0x2be137>=_0x4b5a34){_0x2be137=_0x4b5a34;_0x401003=0xc8;}else{_0x401003=0xce;}_0xb58e85['status'](_0x401003);return _0xb58e85['set'](_0x37a4('0x27'),_0x423487+'-'+_0x2be137+'/'+_0x4b5a34)[_0x37a4('0x22')](_0x5568d2);}return null;};}function patchUpdates(_0x457c9f){return function(_0x1321ef){try{jsonpatch[_0x37a4('0x28')](_0x1321ef,_0x457c9f,!![]);}catch(_0x728539){return BPromise[_0x37a4('0x29')](_0x728539);}return _0x1321ef[_0x37a4('0x2a')]();};}function saveUpdates(_0xe4180,_0x30226d){return function(_0xec2564){if(_0xec2564){return _0xec2564[_0x37a4('0x2b')](_0xe4180)['then'](function(_0x4df1bb){return _0x4df1bb;});}return null;};}function removeEntity(_0x554122,_0x3f3ba3){return function(_0x592895){if(_0x592895){return _0x592895[_0x37a4('0x2c')]()[_0x37a4('0x2d')](function(){_0x554122['status'](0xcc)[_0x37a4('0x21')]();});}};}function handleEntityNotFound(_0xc9cc7d,_0x4b448b){return function(_0x47eff0){if(!_0x47eff0){_0xc9cc7d[_0x37a4('0x2e')](0x194);}return _0x47eff0;};}function handleError(_0x1ad212,_0x42f9c1){_0x42f9c1=_0x42f9c1||0x1f4;return function(_0xf19dc4){logger['error'](_0xf19dc4[_0x37a4('0x2f')]);if(_0xf19dc4[_0x37a4('0x30')]){delete _0xf19dc4[_0x37a4('0x30')];}_0x1ad212[_0x37a4('0x20')](_0x42f9c1)[_0x37a4('0x31')](_0xf19dc4);};}function getInteractionUsers(_0x28291b,_0x26ec28){return new BPromise(function(_0x1eec41,_0x3c6d1a){try{if(_0x26ec28[_0x28291b['id']]){_0x28291b[_0x37a4('0x32')]=_[_0x37a4('0x33')](_0x26ec28[_0x28291b['id']],function(_0x133765){return{'id':_0x133765['id'],'fullname':_0x133765[_0x37a4('0x34')]};});}}catch(_0x27c84b){_0x3c6d1a(_0x27c84b);}_0x1eec41(_0x28291b);});}function getInteractionTags(_0x558ae7,_0x5f4e73){return new BPromise(function(_0x4a9539,_0x11da7d){try{if(_0x558ae7['TagIds']){_0x558ae7['Tags']=[];_0x558ae7['TagIds'][_0x37a4('0x35')](',')[_0x37a4('0x36')](function(_0x3551b5){_0x558ae7[_0x37a4('0x37')][_0x37a4('0x38')](_0x5f4e73[_0x3551b5]);});}delete _0x558ae7[_0x37a4('0x39')];}catch(_0x8eba35){_0x11da7d(_0x8eba35);}_0x4a9539(_0x558ae7);});}function updateWhatsappInteraction(_0x333143,_0x16afa2,_0x2c8166){return new BPromise(function(_0x5c2a1c,_0x17deb0){return getInteractionUsers(_0x333143,_0x2c8166)['then'](function(_0x4fa987){return getInteractionTags(_0x4fa987,_0x16afa2);})['then'](function(_0x5574ca){_0x5c2a1c(_0x5574ca);})['catch'](function(_0xa81e00){_0x17deb0(_0xa81e00);});});}exports[_0x37a4('0x3a')]=function(_0x47f7f8,_0x3877fc){var _0x4bbc24={},_0x5bf7ac={},_0x3d1920={'count':0x0,'rows':[]};var _0x583c7f=_[_0x37a4('0x33')](db[_0x37a4('0x3b')][_0x37a4('0x3c')],function(_0x37db65){return{'name':_0x37db65['fieldName'],'type':_0x37db65[_0x37a4('0x3d')][_0x37a4('0x3e')]};});_0x5bf7ac[_0x37a4('0x3f')]=_['map'](_0x583c7f,'name');_0x5bf7ac[_0x37a4('0x40')]=_['keys'](_0x47f7f8[_0x37a4('0x40')]);_0x5bf7ac[_0x37a4('0x41')]=_[_0x37a4('0x42')](_0x5bf7ac[_0x37a4('0x3f')],_0x5bf7ac[_0x37a4('0x40')]);_0x4bbc24[_0x37a4('0x43')]=_[_0x37a4('0x42')](_0x5bf7ac['model'],qs[_0x37a4('0x44')](_0x47f7f8['query'][_0x37a4('0x44')]));_0x4bbc24[_0x37a4('0x43')]=_0x4bbc24['attributes'][_0x37a4('0x45')]?_0x4bbc24[_0x37a4('0x43')]:_0x5bf7ac[_0x37a4('0x3f')];if(!_0x47f7f8['query'][_0x37a4('0x46')](_0x37a4('0x47'))){_0x4bbc24[_0x37a4('0x25')]=qs['limit'](_0x47f7f8['query'][_0x37a4('0x25')]);_0x4bbc24['offset']=qs[_0x37a4('0x23')](_0x47f7f8['query'][_0x37a4('0x23')]);}_0x4bbc24[_0x37a4('0x48')]=qs[_0x37a4('0x49')](_0x47f7f8[_0x37a4('0x40')]['sort']);_0x4bbc24[_0x37a4('0x4a')]=qs[_0x37a4('0x41')](_[_0x37a4('0x4b')](_0x47f7f8['query'],_0x5bf7ac[_0x37a4('0x41')]),_0x583c7f);var _0x37f7fa=[];var _0x2009e8=squel[_0x37a4('0x4c')]()['field']('id')[_0x37a4('0x4d')]('name')[_0x37a4('0x4d')](_0x37a4('0x4e'))[_0x37a4('0x4f')](_0x37a4('0x50'));var _0x275ab6=squel[_0x37a4('0x4c')]()[_0x37a4('0x4d')](_0x37a4('0x51'))['field'](_0x37a4('0x52'))[_0x37a4('0x4d')](_0x37a4('0x53'))['from'](_0x37a4('0x54'),'ui')[_0x37a4('0x55')](_0x37a4('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x51043a=squel[_0x37a4('0x4c')]()[_0x37a4('0x4f')](_0x37a4('0x57'),'i')['left_join'](_0x37a4('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x37a4('0x55')](_0x37a4('0x56'),'o',_0x37a4('0x59'))[_0x37a4('0x55')](_0x37a4('0x5a'),'a',_0x37a4('0x5b'))[_0x37a4('0x55')](_0x37a4('0x5c'),'me',_0x37a4('0x5d'))['left_join'](_0x37a4('0x5e'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x37a4('0x55')]('tools_tags','t',_0x37a4('0x5f'));var _0x64be00=squel[_0x37a4('0x60')]();var _0x495009=[];var _0xa2fab9=squel[_0x37a4('0x60')]();var _0x550746;if(_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x61')]){_0x550746=as['parseSearch'](_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x61')]);var _0x10957b=_0x550746['sqlOperator'];for(var _0x41f415=0x0;_0x41f415<_0x550746[_0x37a4('0x62')][_0x37a4('0x45')];_0x41f415++){var _0x1356da=_0x550746[_0x37a4('0x62')][_0x41f415];var _0x4d4c02='i';var _0x1ac76f=_['find'](_0x583c7f,[_0x37a4('0x30'),_0x1356da[_0x37a4('0x4d')]]);if(!_0x1ac76f){switch(_0x1356da['field']){case _0x37a4('0x63'):if(_0x1356da[_0x37a4('0x64')]==0x1){_0x51043a[_0x37a4('0x65')]('`'+_0x1356da[_0x37a4('0x4d')]+_0x37a4('0x66'));}else{_0x51043a[_0x37a4('0x65')]('`'+_0x1356da[_0x37a4('0x4d')]+_0x37a4('0x67'));}break;case _0x37a4('0x68'):if(_0x1356da['operator']===_0x37a4('0x69')){if(_0x1356da[_0x37a4('0x64')]['split']('\x20')[_0x37a4('0x45')]>0x1){_0x64be00[_0x10957b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x37a4('0x6a')](_0x1356da['value']),null);}else{var _0x32375b='%'+_0x1356da[_0x37a4('0x64')]+'%';_0x64be00[_0x10957b](_0x37a4('0x6b'),_0x32375b,_0x32375b,_0x32375b);}}else{_0x1ac76f=_[_0x37a4('0x6c')](_0x583c7f,[_0x37a4('0x30'),_0x37a4('0x6d')]);_0x1356da[_0x37a4('0x4d')]=_0x37a4('0x6d');_0x17613b=as[_0x37a4('0x6e')](_0x4d4c02,_0x1ac76f[_0x37a4('0x3d')],_0x1356da);_0x64be00[_0x10957b](_0x17613b[_0x37a4('0x6f')],_0x17613b['value'][_0x37a4('0x70')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x21')]);}break;case _0x37a4('0x71'):var _0x502c1e=_0x1356da[_0x37a4('0x64')][_0x37a4('0x35')](',')[_0x37a4('0x33')](function(_0x457ac8){return Number(_0x457ac8);});_0x502c1e[_0x37a4('0x36')](function(_0x384f6c){_0xa2fab9['or'](_0x37a4('0x72'),'%,'+_0x384f6c+',%');});_0x495009=_[_0x37a4('0x73')](_0x495009,_0x502c1e);break;case _0x37a4('0x74'):if(_0x1356da[_0x37a4('0x75')]===_0x37a4('0x69')){_0x64be00[_0x10957b](_0x37a4('0x76'),'%'+_0x1356da[_0x37a4('0x64')]+'%',null);}else{_0x1ac76f=_['find'](_0x583c7f,['name',_0x37a4('0x77')]);_0x1356da['field']='UserId';_0x17613b=as[_0x37a4('0x6e')](_0x4d4c02,_0x1ac76f[_0x37a4('0x3d')],_0x1356da);_0x64be00[_0x10957b](_0x17613b[_0x37a4('0x6f')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x70')],_0x17613b[_0x37a4('0x64')]['end']);}break;case _0x37a4('0x78'):_0x17613b=as['buildExpression']('me',null,_0x1356da);_0x64be00[_0x10957b](_0x17613b[_0x37a4('0x6f')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x70')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x21')]);break;}}else{var _0x17613b=as[_0x37a4('0x6e')](_0x4d4c02,_0x1ac76f['type'],_0x1356da);_0x64be00[_0x10957b](_0x17613b[_0x37a4('0x6f')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x70')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x21')]);}}}else{var _0x84284f=_(_0x47f7f8[_0x37a4('0x40')])[_0x37a4('0x79')]()[_0x37a4('0x33')](function(_0x8f45cb){return _[_0x37a4('0x7a')](_0x583c7f,['name',_0x8f45cb])?_0x8f45cb:undefined;})[_0x37a4('0x7b')]()[_0x37a4('0x64')]();if(!_['isEmpty'](_0x84284f)){_0x84284f['forEach'](function(_0x519887){if(_0x519887==='WhatsappAccountId'){_0x51043a[_0x37a4('0x4a')](_0x37a4('0x7c'),[][_0x37a4('0x7d')](_0x47f7f8[_0x37a4('0x40')][_0x519887]));}else if(_0x519887===_0x37a4('0x7e')){var _0xd06d0f=JSON[_0x37a4('0x7f')](_0x47f7f8[_0x37a4('0x40')][_0x519887])['$gte'];var _0x40ebcd=JSON['parse'](_0x47f7f8[_0x37a4('0x40')][_0x519887])[_0x37a4('0x80')];_0x51043a['where'](_0x37a4('0x81'),_0xd06d0f,_0x40ebcd);}else{if(_0x47f7f8[_0x37a4('0x40')][_0x519887]===_0x37a4('0x82')){_0x51043a[_0x37a4('0x4a')]('i.'+_0x519887+_0x37a4('0x83'));}else{_0x51043a[_0x37a4('0x4a')]('i.'+_0x519887+_0x37a4('0x84'),_0x47f7f8[_0x37a4('0x40')][_0x519887]);}}});}if(_0x47f7f8[_0x37a4('0x40')]['read']){if(_0x47f7f8[_0x37a4('0x40')]['read']==0x1){_0x51043a['having']('`unreadMessages`\x20=\x200');}else{_0x51043a[_0x37a4('0x65')](_0x37a4('0x85'));}}if(_0x47f7f8['query'][_0x37a4('0x86')]){_0x495009=_[_0x37a4('0x87')](_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x86')])?_0x47f7f8['query'][_0x37a4('0x86')]:new Array(_0x47f7f8['query'][_0x37a4('0x86')]);_0x495009[_0x37a4('0x36')](function(_0x58a80f){_0xa2fab9['or'](_0x37a4('0x72'),'%,'+_0x58a80f+',%');});}if(_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x88')]){var _0x73f5df=_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x88')][_0x37a4('0x89')]('\x5c','\x5c\x5c')[_0x37a4('0x89')](/'/g,'\x27\x27');if(qs[_0x37a4('0x8a')](_0x73f5df)){_0x64be00['or']('i.id\x20LIKE\x20?',_0x73f5df+'%')['or'](_0x37a4('0x8b'),_0x73f5df+'%');}else{_0x64be00['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x37a4('0x6a')](_0x73f5df))['or'](_0x37a4('0x8c'),_0x73f5df+'%');}}}_0x51043a[_0x37a4('0x4a')](_0x64be00);_0x51043a[_0x37a4('0x8d')](_0x37a4('0x8e'));var _0x17e285={'type':db['Sequelize'][_0x37a4('0x8f')][_0x37a4('0x90')],'raw':!![]};var _0x16dc6c=_0x51043a[_0x37a4('0x91')]();_0x16dc6c['field'](_0x37a4('0x8e'));_0x16dc6c[_0x37a4('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x4bbc24[_0x37a4('0x48')]){_0x4bbc24[_0x37a4('0x48')][_0x37a4('0x36')](function(_0x5938d6){var _0x45ef19=_0x5938d6[0x0]===_0x37a4('0x92')?_0x5938d6[0x0]:'i.'+_0x5938d6[0x0];_0x51043a[_0x37a4('0x48')](_0x45ef19,_0x5938d6[0x1]===_0x37a4('0x93')?![]:!![]);});}if(!_[_0x37a4('0x94')](_0x495009)){_0x51043a[_0x37a4('0x65')](_0xa2fab9);_0x16dc6c['where'](_0x37a4('0x95'),_0x495009);}BPromise['resolve']()[_0x37a4('0x2d')](function(){if(!_0x550746){if(_0x47f7f8[_0x37a4('0x40')]['WhatsappAccountId'])return;_0x16dc6c[_0x37a4('0x4a')](_0x37a4('0x96'));_0x51043a[_0x37a4('0x4a')](_0x37a4('0x96'));return;}if(_0x47f7f8['user'][_0x37a4('0x97')]!==_0x37a4('0x98'))return;return _0x47f7f8[_0x37a4('0x99')][_0x37a4('0x9a')]({'attributes':['id'],'raw':!![]})[_0x37a4('0x2d')](function(_0x219cc0){if(_[_0x37a4('0x94')](_0x219cc0)){_0x16dc6c['where'](_0x37a4('0x9b'));_0x51043a[_0x37a4('0x4a')](_0x37a4('0x9b'));}else{_0x16dc6c[_0x37a4('0x4a')](_0x37a4('0x7c'),_[_0x37a4('0x33')](_0x219cc0,'id'));_0x51043a['where'](_0x37a4('0x7c'),_[_0x37a4('0x33')](_0x219cc0,'id'));}});})['then'](function(){if(_0x47f7f8[_0x37a4('0x99')][_0x37a4('0x97')]===_0x37a4('0x98')&&!_0x550746&&!_0x47f7f8['query'][_0x37a4('0x9c')])return[];return db['sequelize'][_0x37a4('0x40')](_0x16dc6c[_0x37a4('0x9d')](),_0x17e285);})[_0x37a4('0x2d')](function(_0x1848e6){_0x3d1920[_0x37a4('0x26')]=_0x1848e6['length'];if(_0x3d1920[_0x37a4('0x26')]===0x0)return[];return db['sequelize'][_0x37a4('0x40')](_0x2009e8[_0x37a4('0x9d')](),_0x17e285)[_0x37a4('0x2d')](function(_0x4f0e72){_0x37f7fa=_[_0x37a4('0x9e')](_0x4f0e72,'id');_0x17e285=_[_0x37a4('0x9f')](_0x17e285,{'model':db[_0x37a4('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x44')]){_0x4bbc24[_0x37a4('0x43')][_0x37a4('0x36')](function(_0x40b2df){_0x51043a[_0x37a4('0x4d')]('i.'+_0x40b2df);});}else{_0x51043a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x37a4('0x63'));_0x51043a['field'](_0x37a4('0xa0'),_0x37a4('0xa1'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xa2'),_0x37a4('0xa3'));_0x51043a[_0x37a4('0x4d')]('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',_0x37a4('0x92'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xa4'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xa5'),_0x37a4('0xa6'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xa7'),_0x37a4('0xa8'));_0x51043a[_0x37a4('0x4d')]('c.email','Contact.email');_0x51043a['field']('c.phone',_0x37a4('0xa9'));_0x51043a[_0x37a4('0x4d')]('c.mobile',_0x37a4('0xaa'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xab'),'Contact.fax');_0x51043a[_0x37a4('0x4d')](_0x37a4('0xac'),_0x37a4('0xad'));_0x51043a[_0x37a4('0x4d')]('o.internal',_0x37a4('0xae'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xaf'),_0x37a4('0x39'));}if(_0x4bbc24[_0x37a4('0x25')])_0x51043a[_0x37a4('0x25')](_0x4bbc24[_0x37a4('0x25')]);if(_0x4bbc24[_0x37a4('0x23')])_0x51043a[_0x37a4('0x23')](_0x4bbc24['offset']);return db[_0x37a4('0xb0')]['query'](_0x51043a[_0x37a4('0x9d')](),_0x17e285);})[_0x37a4('0x2d')](function(_0x72a6d4){if(_0x72a6d4[_0x37a4('0x45')]>0x0)_0x275ab6[_0x37a4('0x4a')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x72a6d4,'id'));return db[_0x37a4('0xb0')][_0x37a4('0x40')](_0x275ab6[_0x37a4('0x9d')](),_0x17e285)['then'](function(_0xfca958){var _0x3b6e56=_[_0x37a4('0xb1')](_0xfca958,_0x37a4('0xb2'));var _0x806b50=[];_0x72a6d4[_0x37a4('0x36')](function(_0x459033){_0x806b50['push'](updateWhatsappInteraction(_0x459033,_0x37f7fa,_0x3b6e56));});return BPromise[_0x37a4('0xb3')](_0x806b50);});});})['then'](function(_0x17c5e4){_0x3d1920[_0x37a4('0xb4')]=_0x17c5e4;return _0x3d1920;})['then'](respondWithFilteredResult(_0x3877fc,_0x4bbc24))[_0x37a4('0xb5')](handleError(_0x3877fc,null));};exports[_0x37a4('0xb6')]=function(_0x23bfd9,_0x36193a){var _0x215bad={'raw':![],'where':{'id':_0x23bfd9['params']['id']}},_0x3d6058={};_0x3d6058[_0x37a4('0x3f')]=_[_0x37a4('0x79')](db[_0x37a4('0x3b')][_0x37a4('0x3c')]);_0x3d6058[_0x37a4('0x40')]=_[_0x37a4('0x79')](_0x23bfd9['query']);_0x3d6058[_0x37a4('0x41')]=_[_0x37a4('0x42')](_0x3d6058[_0x37a4('0x3f')],_0x3d6058['query']);_0x215bad[_0x37a4('0x43')]=_['intersection'](_0x3d6058[_0x37a4('0x3f')],qs[_0x37a4('0x44')](_0x23bfd9[_0x37a4('0x40')]['fields']));_0x215bad[_0x37a4('0x43')]=_0x215bad[_0x37a4('0x43')][_0x37a4('0x45')]?_0x215bad['attributes']:_0x3d6058[_0x37a4('0x3f')];if(_0x23bfd9[_0x37a4('0x40')]['includeAll']){_0x215bad[_0x37a4('0xb7')]=[{'all':!![]}];}_0x215bad=_[_0x37a4('0x9f')]({},_0x215bad,_0x23bfd9[_0x37a4('0xb8')]);return db[_0x37a4('0x3b')][_0x37a4('0x6c')](_0x215bad)[_0x37a4('0x2d')](handleEntityNotFound(_0x36193a,null))[_0x37a4('0x2d')](respondWithResult(_0x36193a,null))[_0x37a4('0xb5')](handleError(_0x36193a,null));};exports[_0x37a4('0xb9')]=function(_0x5e8b96,_0xfb50e2){return db[_0x37a4('0x3b')][_0x37a4('0xb9')](_0x5e8b96[_0x37a4('0x78')],{})['then'](respondWithResult(_0xfb50e2,0xc9))[_0x37a4('0xb5')](handleError(_0xfb50e2,null));};exports[_0x37a4('0x2b')]=function(_0x5736e6,_0x452e56){if(_0x5736e6[_0x37a4('0x78')]['id']){delete _0x5736e6[_0x37a4('0x78')]['id'];}return db[_0x37a4('0x3b')][_0x37a4('0x6c')]({'where':{'id':_0x5736e6['params']['id']}})[_0x37a4('0x2d')](handleEntityNotFound(_0x452e56,null))[_0x37a4('0x2d')](saveUpdates(_0x5736e6[_0x37a4('0x78')],null))['then'](respondWithResult(_0x452e56,null))[_0x37a4('0xb5')](handleError(_0x452e56,null));};exports[_0x37a4('0x2c')]=function(_0x3ace59,_0x26c4fa){return db[_0x37a4('0x3b')][_0x37a4('0x6c')]({'where':{'id':_0x3ace59[_0x37a4('0xba')]['id']}})[_0x37a4('0x2d')](handleEntityNotFound(_0x26c4fa,null))[_0x37a4('0x2d')](removeEntity(_0x26c4fa,null))[_0x37a4('0xb5')](handleError(_0x26c4fa,null));};exports[_0x37a4('0xbb')]=function(_0x49f1af,_0x15b8dc){return db[_0x37a4('0x3b')]['describe']()['then'](respondWithResult(_0x15b8dc,null))[_0x37a4('0xb5')](handleError(_0x15b8dc,null));};exports['addMessage']=function(_0xbea30a,_0xd20ae,_0x2a149f){return db[_0x37a4('0xbc')][_0x37a4('0x6c')]({'where':{'id':_0xbea30a['params']['id']}})[_0x37a4('0x2d')](handleEntityNotFound(_0xd20ae,null))[_0x37a4('0x2d')](function(_0x437c42){if(_0x437c42){return _0x437c42[_0x37a4('0xbd')](_0xbea30a['body']['ids'],_[_0x37a4('0xbe')](_0xbea30a[_0x37a4('0x78')],['ids','id'])||{});}})[_0x37a4('0x2d')](respondWithResult(_0xd20ae,null))[_0x37a4('0xb5')](handleError(_0xd20ae,null));};exports[_0x37a4('0xbf')]=function(_0xc6a8bd,_0x250c6a,_0x47d046){var _0x3e936f={'raw':![],'where':{}};var _0x2f7f62={};var _0x3b6491={'count':0x0,'rows':[]};return db[_0x37a4('0x3b')]['findOne']({'where':{'id':_0xc6a8bd[_0x37a4('0xba')]['id']}})[_0x37a4('0x2d')](handleEntityNotFound(_0x250c6a,null))[_0x37a4('0x2d')](function(_0x56a0ec){if(_0x56a0ec){_0x2f7f62[_0x37a4('0x3f')]=_[_0x37a4('0x79')](db[_0x37a4('0xbc')][_0x37a4('0x3c')]);_0x2f7f62[_0x37a4('0x40')]=_[_0x37a4('0x79')](_0xc6a8bd[_0x37a4('0x40')]);_0x2f7f62['filters']=_[_0x37a4('0x42')](_0x2f7f62[_0x37a4('0x3f')],_0x2f7f62[_0x37a4('0x40')]);_0x3e936f['attributes']=_[_0x37a4('0x42')](_0x2f7f62[_0x37a4('0x3f')],qs['fields'](_0xc6a8bd[_0x37a4('0x40')]['fields']));_0x3e936f[_0x37a4('0x43')]=_0x3e936f[_0x37a4('0x43')][_0x37a4('0x45')]?_0x3e936f['attributes']:_0x2f7f62['model'];if(!_0xc6a8bd[_0x37a4('0x40')]['hasOwnProperty'](_0x37a4('0x47'))){_0x3e936f[_0x37a4('0x25')]=qs[_0x37a4('0x25')](_0xc6a8bd['query']['limit']);_0x3e936f[_0x37a4('0x23')]=qs['offset'](_0xc6a8bd[_0x37a4('0x40')][_0x37a4('0x23')]);}_0x3e936f[_0x37a4('0x48')]=qs[_0x37a4('0x49')](_0xc6a8bd['query'][_0x37a4('0x49')]);_0x3e936f[_0x37a4('0x4a')]=qs[_0x37a4('0x41')](_[_0x37a4('0x4b')](_0xc6a8bd[_0x37a4('0x40')],_0x2f7f62[_0x37a4('0x41')]));_0x3e936f['where']['WhatsappInteractionId']=_0x56a0ec['id'];if(_0xc6a8bd[_0x37a4('0x40')][_0x37a4('0x88')]){_0x3e936f[_0x37a4('0x4a')]=_[_0x37a4('0x9f')](_0x3e936f[_0x37a4('0x4a')],{'$or':_['map'](_0x3e936f[_0x37a4('0x43')],function(_0x96055d){var _0x205320={};_0x205320[_0x96055d]={'$like':'%'+_0xc6a8bd[_0x37a4('0x40')][_0x37a4('0x88')]+'%'};return _0x205320;})});}if(_0xc6a8bd[_0x37a4('0x40')]['$gte']){var _0x1d5d65=_0xc6a8bd[_0x37a4('0x40')][_0x37a4('0xc0')][_0x37a4('0x35')](',');var _0xf90a63={};_0xf90a63[_0x1d5d65[0x0]]={'$gte':moment(_0x1d5d65[0x1])['format'](_0x37a4('0xc1'))};_0x3e936f[_0x37a4('0x4a')]=_['merge'](_0x3e936f['where'],_0xf90a63);}_0x3e936f=_['merge']({},_0x3e936f,_0xc6a8bd[_0x37a4('0xb8')]);return db[_0x37a4('0xbc')][_0x37a4('0x26')]({'where':_0x3e936f[_0x37a4('0x4a')]})[_0x37a4('0x2d')](function(_0x288ac3){_0x3b6491[_0x37a4('0x26')]=_0x288ac3;if(_0xc6a8bd[_0x37a4('0x40')][_0x37a4('0xc2')]){_0x3e936f[_0x37a4('0xb7')]=[{'all':!![]}];}return db[_0x37a4('0xbc')][_0x37a4('0xc3')](_0x3e936f);})[_0x37a4('0x2d')](function(_0x1194d5){_0x3b6491[_0x37a4('0xb4')]=_0x1194d5;return _0x3b6491;});}})['then'](respondWithFilteredResult(_0x250c6a,_0x3e936f))[_0x37a4('0xb5')](handleError(_0x250c6a,null));};exports[_0x37a4('0xc4')]=function(_0x1ef139,_0x433ac5,_0x5d0a32){return db['WhatsappInteraction'][_0x37a4('0x6c')]({'where':{'id':_0x1ef139[_0x37a4('0xba')]['id']}})['then'](handleEntityNotFound(_0x433ac5,null))[_0x37a4('0x2d')](function(_0x26cda2){if(_0x26cda2){return _0x26cda2[_0x37a4('0xc5')](_0x1ef139[_0x37a4('0x78')][_0x37a4('0xc6')],_[_0x37a4('0xbe')](_0x1ef139[_0x37a4('0x78')],[_0x37a4('0xc6'),'id'])||{})[_0x37a4('0xc7')](function(){return db['Tag'][_0x37a4('0xc3')]({'attributes':['id',_0x37a4('0x30'),_0x37a4('0x4e')],'where':{'id':_0x1ef139[_0x37a4('0x78')][_0x37a4('0xc6')]}});})[_0x37a4('0x2d')](function(_0x281bf5){socket[_0x37a4('0xc8')](_0x37a4('0xc9'),{'id':Number(_0x1ef139[_0x37a4('0xba')]['id']),'tags':_0x281bf5||[]});return{'id':Number(_0x1ef139[_0x37a4('0xba')]['id']),'tags':_0x281bf5||[]};});}})[_0x37a4('0x2d')](respondWithResult(_0x433ac5,null))[_0x37a4('0xb5')](handleError(_0x433ac5,null));};exports[_0x37a4('0xca')]=function(_0x3259ae,_0x26d196,_0x181b96){return db['WhatsappInteraction'][_0x37a4('0x6c')]({'where':{'id':_0x3259ae[_0x37a4('0xba')]['id']}})[_0x37a4('0x2d')](handleEntityNotFound(_0x26d196,null))[_0x37a4('0x2d')](function(_0x4cf7a4){if(_0x4cf7a4){return _0x4cf7a4['removeTags'](_0x3259ae[_0x37a4('0x40')]['ids']);}})[_0x37a4('0x2d')](respondWithStatusCode(_0x26d196,null))[_0x37a4('0xb5')](handleError(_0x26d196,null));};exports[_0x37a4('0xcb')]=function(_0x33723f,_0x402981){var _0x4ceb87=moment()['unix']()[_0x37a4('0x9d')]();var _0x545e1b=path[_0x37a4('0xcc')](config[_0x37a4('0xcd')],_0x37a4('0xce'),_0x37a4('0xcf'),_0x37a4('0xd0'));var _0x478dbd=path[_0x37a4('0xcc')](config[_0x37a4('0xcd')],_0x37a4('0xce'),_0x37a4('0xcf'),'attachments');var _0x4d276f=path[_0x37a4('0xcc')](_0x545e1b,_0x4ceb87);var _0x1b357e=util[_0x37a4('0xd1')](_0x37a4('0xd2'),_0x33723f[_0x37a4('0xba')]['id'],_0x4ceb87);var _0x3da3d3=path[_0x37a4('0xcc')](_0x545e1b,_0x1b357e);var _0x3a6ff9=[];_0x3a6ff9[_0x37a4('0x38')]({'model':db['User'],'as':_0x37a4('0x74'),'attributes':['id',_0x37a4('0x34')],'raw':!![]});_0x3a6ff9[_0x37a4('0x38')]({'model':db[_0x37a4('0xd3')],'as':_0x37a4('0x68'),'attributes':['id',_0x37a4('0xd4'),_0x37a4('0xd5')],'raw':!![]});if(_0x33723f[_0x37a4('0x40')][_0x37a4('0xd6')]){_0x3a6ff9[_0x37a4('0x38')]({'model':db[_0x37a4('0xd7')],'as':_0x37a4('0xd7'),'raw':!![]});}var _0x49f948=[{'model':db[_0x37a4('0xbc')],'as':_0x37a4('0xd8'),'attributes':['id',_0x37a4('0x78'),'createdAt',_0x37a4('0xd9'),_0x37a4('0xda'),_0x37a4('0xdb')],'include':_0x3a6ff9}];_0x49f948['push']({'model':db[_0x37a4('0xdc')],'as':_0x37a4('0xdd'),'attributes':['id','name']});_0x49f948['push']({'model':db[_0x37a4('0x74')],'as':_0x37a4('0xde'),'attributes':['id',_0x37a4('0x34')]});return db[_0x37a4('0x3b')][_0x37a4('0x6c')]({'where':{'id':_0x33723f['params']['id']},'include':_0x49f948})[_0x37a4('0x2d')](handleEntityNotFound(_0x402981,null))[_0x37a4('0x2d')](function(_0xbda3c1){if(_0xbda3c1){var _0x37cf2e=_0xbda3c1[_0x37a4('0xdf')]({'plain':!![]});fs[_0x37a4('0xe0')](_0x4d276f);var _0x4d89df={'channel':'Whatsapp','account':_0x37cf2e[_0x37a4('0xdd')][_0x37a4('0x30')],'agent':_0x37cf2e[_0x37a4('0xde')]?_0x37cf2e[_0x37a4('0xde')][_0x37a4('0x34')]:'N.A.','createdAt':moment(_0x37cf2e[_0x37a4('0x7e')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x37a4('0x9d')](),'closedAt':_0x37cf2e['closed']?moment(_0x37cf2e[_0x37a4('0xe1')])[_0x37a4('0xd1')](_0x37a4('0xc1'))[_0x37a4('0x9d')]():'','disposition':_0x37cf2e[_0x37a4('0xe2')],'messages':_(_0x37cf2e['Messages'])[_0x37a4('0x88')]({'secret':![]})[_0x37a4('0x33')](function(_0x3d62f8){if(_0x3d62f8[_0x37a4('0xd7')]){var _0x1e9e55=path['join'](_0x478dbd,_0x3d62f8['Attachment']['basename']);if(fs[_0x37a4('0xe3')](_0x1e9e55)){fs[_0x37a4('0xe4')](_0x1e9e55)[_0x37a4('0xe5')](fs[_0x37a4('0xe6')](path['join'](_0x4d276f,_0x3d62f8[_0x37a4('0xd7')][_0x37a4('0xe7')])));}}return{'date':moment(_0x3d62f8[_0x37a4('0x7e')])[_0x37a4('0xd1')](_0x37a4('0xc1'))[_0x37a4('0x9d')](),'sender':_0x3d62f8[_0x37a4('0xd9')]===_0x37a4('0xe8')?_0x3d62f8[_0x37a4('0x74')]?_0x3d62f8[_0x37a4('0x74')][_0x37a4('0x34')]:_0x37a4('0xe9'):_0x3d62f8[_0x37a4('0x68')][_0x37a4('0xd4')]+(_0x3d62f8['Contact'][_0x37a4('0xd5')]?'\x20'+_0x3d62f8['Contact'][_0x37a4('0xd5')]:''),'body':_0x3d62f8[_0x37a4('0xd7')]?_0x3d62f8[_0x37a4('0xd7')][_0x37a4('0xe7')]:_0x3d62f8[_0x37a4('0x78')],'direction':_0x3d62f8[_0x37a4('0xd9')]===_0x37a4('0xe8')?'A':'C','secret':_0x3d62f8[_0x37a4('0xda')],'read':_0x3d62f8[_0x37a4('0xdb')],'attachment':_0x3d62f8['Attachment']};})['value']()};return ejs[_0x37a4('0xea')](path[_0x37a4('0xcc')](config[_0x37a4('0xcd')],'server',_0x37a4('0xeb'),_0x37a4('0xec')),{'interaction':_0x4d89df})[_0x37a4('0x2d')](function(_0x5590e3){var _0x450d4e=path['join'](_0x4d276f,_0x37a4('0xed')+_0x37cf2e['id']+'-'+_0x4ceb87+_0x37a4('0xee'));var _0x1b33d1={'path':_0x450d4e,'channel':_0x37a4('0xef'),'interactionId':_0x37cf2e['id']};return pdf[_0x37a4('0xf0')](_0x5590e3,_0x1b33d1);})[_0x37a4('0x2d')](function(){return new BPromise(function(_0x35b8d4,_0x1cdf3c){zipdir(_0x4d276f,{'saveTo':_0x3da3d3},function(_0x2bb2b7,_0x1a890d){if(_0x2bb2b7)return _0x1cdf3c(_0x2bb2b7);return _0x35b8d4(_0x1a890d);});})[_0x37a4('0x2d')](function(){return new BPromise(function(_0x30465c,_0x55718f){rimraf(_0x4d276f,function(_0x5271fc){if(_0x5271fc)_0x55718f(_0x5271fc);return _0x30465c();});});})[_0x37a4('0x2d')](function(){return _0x402981['download'](_0x3da3d3,_0x1b357e,function(_0x4fe262){if(_0x4fe262){console[_0x37a4('0xf1')](_0x37a4('0xf2'),_0x4fe262);}else{fs[_0x37a4('0xf3')](_0x3da3d3);}});});});}else{return _0x402981['sendStatus'](0xc8);}})['catch'](handleError(_0x402981,null));}; \ No newline at end of file +var _0x0a25=['i.id','Sequelize','QueryTypes','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','WhatsappInteractionId','all','rows','catch','rawAttributes','includeAll','include','options','create','body','update','params','describe','addMessage','WhatsappMessage','omit','ids','getMessages','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','whatsappInteractionTags:save','download','unix','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Attachment','Messages','direction','WhatsappAccount','Account','mkdirSync','Whatsapp','Owner','N.A.','closed','closedAt','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','index','WhatsappInteraction','type','model','keys','query','filters','intersection','fields','attributes','length','order','sort','pick','field','color','from','tools_tags','select','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?'];(function(_0x4c1ecb,_0x1b5c2b){var _0x5759e4=function(_0x52c2e0){while(--_0x52c2e0){_0x4c1ecb['push'](_0x4c1ecb['shift']());}};_0x5759e4(++_0x1b5c2b);}(_0x0a25,0x68));var _0x50a2=function(_0xfad1a7,_0x2e3b8d){_0xfad1a7=_0xfad1a7-0x0;var _0x571012=_0x0a25[_0xfad1a7];return _0x571012;};'use strict';var emlformat=require(_0x50a2('0x0'));var rimraf=require(_0x50a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50a2('0x2'));var rp=require(_0x50a2('0x3'));var moment=require('moment');var BPromise=require(_0x50a2('0x4'));var Mustache=require(_0x50a2('0x5'));var util=require(_0x50a2('0x6'));var path=require(_0x50a2('0x7'));var sox=require(_0x50a2('0x8'));var csv=require(_0x50a2('0x9'));var ejs=require(_0x50a2('0xa'));var fs=require('fs');var fs_extra=require(_0x50a2('0xb'));var _=require(_0x50a2('0xc'));var squel=require(_0x50a2('0xd'));var crypto=require(_0x50a2('0xe'));var jsforce=require(_0x50a2('0xf'));var deskjs=require(_0x50a2('0x10'));var toCsv=require(_0x50a2('0x9'));var querystring=require(_0x50a2('0x11'));var Papa=require(_0x50a2('0x12'));var Redis=require(_0x50a2('0x13'));var authService=require(_0x50a2('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x50a2('0x15'));var pdf=require(_0x50a2('0x16'));var hardwareService=require(_0x50a2('0x17'));var logger=require(_0x50a2('0x18'))(_0x50a2('0x19'));var utils=require(_0x50a2('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x50a2('0x1b'));var db=require(_0x50a2('0x1c'))['db'];config[_0x50a2('0x1d')]=_[_0x50a2('0x1e')](config[_0x50a2('0x1d')],{'host':_0x50a2('0x1f'),'port':0x18eb});var socket=require(_0x50a2('0x20'))(new Redis(config[_0x50a2('0x1d')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x535230,_0x2dede9){_0x2dede9=_0x2dede9||0xcc;return function(_0x1aaf13){if(_0x1aaf13){return _0x535230[_0x50a2('0x21')](_0x2dede9);}return _0x535230['status'](_0x2dede9)[_0x50a2('0x22')]();};}function respondWithResult(_0x1e3b00,_0x20f00d){_0x20f00d=_0x20f00d||0xc8;return function(_0x922ce8){if(_0x922ce8){return _0x1e3b00[_0x50a2('0x23')](_0x20f00d)[_0x50a2('0x24')](_0x922ce8);}};}function respondWithFilteredResult(_0x399523,_0x5934d3){return function(_0x37301f){if(_0x37301f){var _0x3987d5=typeof _0x5934d3[_0x50a2('0x25')]===_0x50a2('0x26')&&typeof _0x5934d3[_0x50a2('0x27')]===_0x50a2('0x26');var _0x57c97b=_0x37301f[_0x50a2('0x28')];var _0x4f0d53=_0x3987d5?0x0:_0x5934d3[_0x50a2('0x25')];var _0x43daf1=_0x3987d5?_0x37301f[_0x50a2('0x28')]:_0x5934d3[_0x50a2('0x25')]+_0x5934d3['limit'];var _0x5afc6d;if(_0x43daf1>=_0x57c97b){_0x43daf1=_0x57c97b;_0x5afc6d=0xc8;}else{_0x5afc6d=0xce;}_0x399523[_0x50a2('0x23')](_0x5afc6d);return _0x399523[_0x50a2('0x29')](_0x50a2('0x2a'),_0x4f0d53+'-'+_0x43daf1+'/'+_0x57c97b)[_0x50a2('0x24')](_0x37301f);}return null;};}function patchUpdates(_0x5e5e1e){return function(_0xf093f8){try{jsonpatch[_0x50a2('0x2b')](_0xf093f8,_0x5e5e1e,!![]);}catch(_0x2c0f50){return BPromise[_0x50a2('0x2c')](_0x2c0f50);}return _0xf093f8[_0x50a2('0x2d')]();};}function saveUpdates(_0x33ed8b,_0x4a65d3){return function(_0x1827dc){if(_0x1827dc){return _0x1827dc['update'](_0x33ed8b)[_0x50a2('0x2e')](function(_0xc0c44f){return _0xc0c44f;});}return null;};}function removeEntity(_0x2e9769,_0x3b034f){return function(_0xf54ae){if(_0xf54ae){return _0xf54ae[_0x50a2('0x2f')]()[_0x50a2('0x2e')](function(){_0x2e9769[_0x50a2('0x23')](0xcc)[_0x50a2('0x22')]();});}};}function handleEntityNotFound(_0x1295d4,_0x534c10){return function(_0x193132){if(!_0x193132){_0x1295d4[_0x50a2('0x21')](0x194);}return _0x193132;};}function handleError(_0x40d633,_0x492fa1){_0x492fa1=_0x492fa1||0x1f4;return function(_0x2bec60){logger[_0x50a2('0x30')](_0x2bec60[_0x50a2('0x31')]);if(_0x2bec60[_0x50a2('0x32')]){delete _0x2bec60[_0x50a2('0x32')];}_0x40d633[_0x50a2('0x23')](_0x492fa1)[_0x50a2('0x33')](_0x2bec60);};}function getInteractionUsers(_0x17d167,_0x342e01){return new BPromise(function(_0x2a60ad,_0x5c9642){try{if(_0x342e01[_0x17d167['id']]){_0x17d167['Users']=_[_0x50a2('0x34')](_0x342e01[_0x17d167['id']],function(_0x30e3ef){return{'id':_0x30e3ef['id'],'fullname':_0x30e3ef[_0x50a2('0x35')]};});}}catch(_0x49dc45){_0x5c9642(_0x49dc45);}_0x2a60ad(_0x17d167);});}function getInteractionTags(_0x2a1917,_0x4e0e3d){return new BPromise(function(_0x2fef3d,_0x4f6e11){try{if(_0x2a1917[_0x50a2('0x36')]){_0x2a1917[_0x50a2('0x37')]=[];_0x2a1917['TagIds'][_0x50a2('0x38')](',')[_0x50a2('0x39')](function(_0x328266){_0x2a1917[_0x50a2('0x37')][_0x50a2('0x3a')](_0x4e0e3d[_0x328266]);});}delete _0x2a1917['TagIds'];}catch(_0x517879){_0x4f6e11(_0x517879);}_0x2fef3d(_0x2a1917);});}function updateWhatsappInteraction(_0x58a4d4,_0x1cfd3a,_0x1af6c5){return new BPromise(function(_0x2295d1,_0x106f16){return getInteractionUsers(_0x58a4d4,_0x1af6c5)['then'](function(_0x3df980){return getInteractionTags(_0x3df980,_0x1cfd3a);})[_0x50a2('0x2e')](function(_0x5b56f0){_0x2295d1(_0x5b56f0);})['catch'](function(_0x64df2e){_0x106f16(_0x64df2e);});});}exports[_0x50a2('0x3b')]=function(_0x6aa24d,_0x5db6cf){var _0x28b310={},_0x46fff6={},_0x50ab1a={'count':0x0,'rows':[]};var _0x4e5d14=_['map'](db[_0x50a2('0x3c')]['rawAttributes'],function(_0x13521b){return{'name':_0x13521b['fieldName'],'type':_0x13521b[_0x50a2('0x3d')]['key']};});_0x46fff6[_0x50a2('0x3e')]=_[_0x50a2('0x34')](_0x4e5d14,_0x50a2('0x32'));_0x46fff6['query']=_[_0x50a2('0x3f')](_0x6aa24d[_0x50a2('0x40')]);_0x46fff6[_0x50a2('0x41')]=_[_0x50a2('0x42')](_0x46fff6[_0x50a2('0x3e')],_0x46fff6[_0x50a2('0x40')]);_0x28b310['attributes']=_[_0x50a2('0x42')](_0x46fff6[_0x50a2('0x3e')],qs['fields'](_0x6aa24d['query'][_0x50a2('0x43')]));_0x28b310[_0x50a2('0x44')]=_0x28b310[_0x50a2('0x44')][_0x50a2('0x45')]?_0x28b310['attributes']:_0x46fff6[_0x50a2('0x3e')];if(!_0x6aa24d[_0x50a2('0x40')]['hasOwnProperty']('nolimit')){_0x28b310['limit']=qs['limit'](_0x6aa24d[_0x50a2('0x40')]['limit']);_0x28b310['offset']=qs[_0x50a2('0x25')](_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x25')]);}_0x28b310[_0x50a2('0x46')]=qs[_0x50a2('0x47')](_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x47')]);_0x28b310['where']=qs[_0x50a2('0x41')](_[_0x50a2('0x48')](_0x6aa24d[_0x50a2('0x40')],_0x46fff6[_0x50a2('0x41')]),_0x4e5d14);var _0x5a54fa=[];var _0xf7e280=squel['select']()[_0x50a2('0x49')]('id')[_0x50a2('0x49')](_0x50a2('0x32'))['field'](_0x50a2('0x4a'))[_0x50a2('0x4b')](_0x50a2('0x4c'));var _0x4b8890=squel[_0x50a2('0x4d')]()[_0x50a2('0x49')]('u.id')[_0x50a2('0x49')](_0x50a2('0x4e'))[_0x50a2('0x49')](_0x50a2('0x4f'))[_0x50a2('0x4b')](_0x50a2('0x50'),'ui')[_0x50a2('0x51')]('users','u','u.id\x20=\x20ui.UserId');var _0x453463=squel[_0x50a2('0x4d')]()[_0x50a2('0x4b')](_0x50a2('0x52'),'i')['left_join'](_0x50a2('0x53'),'c',_0x50a2('0x54'))[_0x50a2('0x51')](_0x50a2('0x55'),'o','o.id\x20=\x20i.UserId')[_0x50a2('0x51')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x50a2('0x51')]('whatsapp_messages','me',_0x50a2('0x56'))[_0x50a2('0x51')](_0x50a2('0x57'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x50a2('0x51')](_0x50a2('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x1aa8d6=squel[_0x50a2('0x58')]();var _0x4a0016=[];var _0x3b8167=squel[_0x50a2('0x58')]();var _0x1905bc;if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x59')]){_0x1905bc=as[_0x50a2('0x5a')](_0x6aa24d[_0x50a2('0x40')]['search']);var _0x34139f=_0x1905bc[_0x50a2('0x5b')];for(var _0x38fc18=0x0;_0x38fc18<_0x1905bc[_0x50a2('0x5c')]['length'];_0x38fc18++){var _0x40d14d=_0x1905bc[_0x50a2('0x5c')][_0x38fc18];var _0x1d844d='i';var _0x42bf48=_[_0x50a2('0x5d')](_0x4e5d14,[_0x50a2('0x32'),_0x40d14d[_0x50a2('0x49')]]);if(!_0x42bf48){switch(_0x40d14d[_0x50a2('0x49')]){case _0x50a2('0x5e'):if(_0x40d14d[_0x50a2('0x5f')]==0x1){_0x453463['having']('`'+_0x40d14d[_0x50a2('0x49')]+_0x50a2('0x60'));}else{_0x453463[_0x50a2('0x61')]('`'+_0x40d14d[_0x50a2('0x49')]+_0x50a2('0x62'));}break;case _0x50a2('0x63'):if(_0x40d14d[_0x50a2('0x64')]===_0x50a2('0x65')){if(_0x40d14d[_0x50a2('0x5f')]['split']('\x20')['length']>0x1){_0x1aa8d6[_0x34139f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x50a2('0x66')](_0x40d14d['value']),null);}else{var _0x2995ad='%'+_0x40d14d['value']+'%';_0x1aa8d6[_0x34139f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2995ad,_0x2995ad,_0x2995ad);}}else{_0x42bf48=_['find'](_0x4e5d14,[_0x50a2('0x32'),_0x50a2('0x67')]);_0x40d14d[_0x50a2('0x49')]=_0x50a2('0x67');_0x556482=as[_0x50a2('0x68')](_0x1d844d,_0x42bf48[_0x50a2('0x3d')],_0x40d14d);_0x1aa8d6[_0x34139f](_0x556482[_0x50a2('0x69')],_0x556482['value']['start'],_0x556482[_0x50a2('0x5f')][_0x50a2('0x22')]);}break;case _0x50a2('0x6a'):var _0x1dcbb2=_0x40d14d[_0x50a2('0x5f')][_0x50a2('0x38')](',')[_0x50a2('0x34')](function(_0xd52efb){return Number(_0xd52efb);});_0x1dcbb2[_0x50a2('0x39')](function(_0x4c7d9c){_0x3b8167['or'](_0x50a2('0x6b'),'%,'+_0x4c7d9c+',%');});_0x4a0016=_['union'](_0x4a0016,_0x1dcbb2);break;case'User':if(_0x40d14d[_0x50a2('0x64')]===_0x50a2('0x65')){_0x1aa8d6[_0x34139f](_0x50a2('0x6c'),'%'+_0x40d14d[_0x50a2('0x5f')]+'%',null);}else{_0x42bf48=_['find'](_0x4e5d14,[_0x50a2('0x32'),_0x50a2('0x6d')]);_0x40d14d[_0x50a2('0x49')]='UserId';_0x556482=as[_0x50a2('0x68')](_0x1d844d,_0x42bf48[_0x50a2('0x3d')],_0x40d14d);_0x1aa8d6[_0x34139f](_0x556482[_0x50a2('0x69')],_0x556482[_0x50a2('0x5f')][_0x50a2('0x6e')],_0x556482['value'][_0x50a2('0x22')]);}break;case'body':_0x556482=as['buildExpression']('me',null,_0x40d14d);_0x1aa8d6[_0x34139f](_0x556482[_0x50a2('0x69')],_0x556482[_0x50a2('0x5f')]['start'],_0x556482['value'][_0x50a2('0x22')]);break;}}else{var _0x556482=as[_0x50a2('0x68')](_0x1d844d,_0x42bf48[_0x50a2('0x3d')],_0x40d14d);_0x1aa8d6[_0x34139f](_0x556482[_0x50a2('0x69')],_0x556482[_0x50a2('0x5f')][_0x50a2('0x6e')],_0x556482['value'][_0x50a2('0x22')]);}}}else{var _0x3d9ed2=_(_0x6aa24d[_0x50a2('0x40')])['keys']()[_0x50a2('0x34')](function(_0xfe5820){return _[_0x50a2('0x6f')](_0x4e5d14,[_0x50a2('0x32'),_0xfe5820])?_0xfe5820:undefined;})[_0x50a2('0x70')]()['value']();if(!_[_0x50a2('0x71')](_0x3d9ed2)){_0x3d9ed2['forEach'](function(_0x16ddfb){if(_0x16ddfb===_0x50a2('0x72')){_0x453463[_0x50a2('0x73')](_0x50a2('0x74'),[][_0x50a2('0x75')](_0x6aa24d['query'][_0x16ddfb]));}else if(_0x16ddfb===_0x50a2('0x76')){var _0x35255c=JSON[_0x50a2('0x77')](_0x6aa24d[_0x50a2('0x40')][_0x16ddfb])['$gte'];var _0x1e1be0=JSON['parse'](_0x6aa24d[_0x50a2('0x40')][_0x16ddfb])[_0x50a2('0x78')];_0x453463[_0x50a2('0x73')](_0x50a2('0x79'),_0x35255c,_0x1e1be0);}else{if(_0x6aa24d[_0x50a2('0x40')][_0x16ddfb]===_0x50a2('0x7a')){_0x453463[_0x50a2('0x73')]('i.'+_0x16ddfb+'\x20IS\x20NULL');}else{_0x453463[_0x50a2('0x73')]('i.'+_0x16ddfb+_0x50a2('0x7b'),_0x6aa24d[_0x50a2('0x40')][_0x16ddfb]);}}});}if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x7c')]){if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x7c')]==0x1){_0x453463['having'](_0x50a2('0x7d'));}else{_0x453463[_0x50a2('0x61')](_0x50a2('0x7e'));}}if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x7f')]){_0x4a0016=_[_0x50a2('0x80')](_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x7f')])?_0x6aa24d['query'][_0x50a2('0x7f')]:new Array(_0x6aa24d['query'][_0x50a2('0x7f')]);_0x4a0016[_0x50a2('0x39')](function(_0x3915ba){_0x3b8167['or'](_0x50a2('0x6b'),'%,'+_0x3915ba+',%');});}if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x81')]){var _0x5a13e8=_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x81')][_0x50a2('0x82')]('\x5c','\x5c\x5c')[_0x50a2('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5a13e8)){_0x1aa8d6['or'](_0x50a2('0x83'),_0x5a13e8+'%')['or']('i.phone\x20LIKE\x20?',_0x5a13e8+'%');}else{_0x1aa8d6['or'](_0x50a2('0x84'),qs[_0x50a2('0x66')](_0x5a13e8))['or'](_0x50a2('0x85'),_0x5a13e8+'%');}}}_0x453463[_0x50a2('0x73')](_0x1aa8d6);_0x453463['group'](_0x50a2('0x86'));var _0x3509a1={'type':db[_0x50a2('0x87')][_0x50a2('0x88')]['SELECT'],'raw':!![]};var _0x24fadb=_0x453463['clone']();_0x24fadb[_0x50a2('0x49')]('i.id');_0x24fadb[_0x50a2('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x50a2('0x5e'));if(_0x28b310[_0x50a2('0x46')]){_0x28b310[_0x50a2('0x46')][_0x50a2('0x39')](function(_0x6c4dd3){var _0x407229=_0x6c4dd3[0x0]==='contactName'?_0x6c4dd3[0x0]:'i.'+_0x6c4dd3[0x0];_0x453463[_0x50a2('0x46')](_0x407229,_0x6c4dd3[0x1]===_0x50a2('0x89')?![]:!![]);});}if(!_['isEmpty'](_0x4a0016)){_0x453463[_0x50a2('0x61')](_0x3b8167);_0x24fadb[_0x50a2('0x73')]('t.id\x20IN\x20?',_0x4a0016);}BPromise[_0x50a2('0x8a')]()[_0x50a2('0x2e')](function(){if(!_0x1905bc){if(_0x6aa24d['query'][_0x50a2('0x72')])return;_0x24fadb[_0x50a2('0x73')](_0x50a2('0x8b'));_0x453463[_0x50a2('0x73')](_0x50a2('0x8b'));return;}if(_0x6aa24d['user'][_0x50a2('0x8c')]!==_0x50a2('0x8d'))return;return _0x6aa24d[_0x50a2('0x8e')][_0x50a2('0x8f')]({'attributes':['id'],'raw':!![]})[_0x50a2('0x2e')](function(_0x428a55){if(_[_0x50a2('0x71')](_0x428a55)){_0x24fadb[_0x50a2('0x73')](_0x50a2('0x90'));_0x453463[_0x50a2('0x73')](_0x50a2('0x90'));}else{_0x24fadb[_0x50a2('0x73')]('i.WhatsappAccountId\x20IN\x20?',_[_0x50a2('0x34')](_0x428a55,'id'));_0x453463[_0x50a2('0x73')](_0x50a2('0x74'),_['map'](_0x428a55,'id'));}});})['then'](function(){if(_0x6aa24d[_0x50a2('0x8e')][_0x50a2('0x8c')]===_0x50a2('0x8d')&&!_0x1905bc&&!_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x72')])return[];return db[_0x50a2('0x91')][_0x50a2('0x40')](_0x24fadb[_0x50a2('0x92')](),_0x3509a1);})[_0x50a2('0x2e')](function(_0x249dd3){_0x50ab1a[_0x50a2('0x28')]=_0x249dd3['length'];if(_0x50ab1a[_0x50a2('0x28')]===0x0)return[];return db[_0x50a2('0x91')]['query'](_0xf7e280[_0x50a2('0x92')](),_0x3509a1)[_0x50a2('0x2e')](function(_0x1979a2){_0x5a54fa=_[_0x50a2('0x93')](_0x1979a2,'id');_0x3509a1=_[_0x50a2('0x94')](_0x3509a1,{'model':db[_0x50a2('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x43')]){_0x28b310['attributes'][_0x50a2('0x39')](function(_0x5a4f93){_0x453463[_0x50a2('0x49')]('i.'+_0x5a4f93);});}else{_0x453463[_0x50a2('0x49')](_0x50a2('0x95'),'unreadMessages');_0x453463[_0x50a2('0x49')](_0x50a2('0x96'),_0x50a2('0x97'));_0x453463[_0x50a2('0x49')](_0x50a2('0x98'),_0x50a2('0x99'));_0x453463[_0x50a2('0x49')](_0x50a2('0x9a'),_0x50a2('0x9b'));_0x453463[_0x50a2('0x49')](_0x50a2('0x9c'));_0x453463[_0x50a2('0x49')](_0x50a2('0x9d'),_0x50a2('0x9e'));_0x453463['field'](_0x50a2('0x9f'),_0x50a2('0xa0'));_0x453463['field'](_0x50a2('0xa1'),_0x50a2('0xa2'));_0x453463[_0x50a2('0x49')](_0x50a2('0xa3'),_0x50a2('0xa4'));_0x453463[_0x50a2('0x49')]('c.mobile',_0x50a2('0xa5'));_0x453463['field']('c.fax','Contact.fax');_0x453463['field'](_0x50a2('0xa6'),_0x50a2('0xa7'));_0x453463[_0x50a2('0x49')](_0x50a2('0xa8'),_0x50a2('0xa9'));_0x453463[_0x50a2('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x50a2('0x36'));}if(_0x28b310[_0x50a2('0x27')])_0x453463[_0x50a2('0x27')](_0x28b310[_0x50a2('0x27')]);if(_0x28b310[_0x50a2('0x25')])_0x453463[_0x50a2('0x25')](_0x28b310['offset']);return db['sequelize'][_0x50a2('0x40')](_0x453463[_0x50a2('0x92')](),_0x3509a1);})['then'](function(_0x2822d8){if(_0x2822d8[_0x50a2('0x45')]>0x0)_0x4b8890[_0x50a2('0x73')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x2822d8,'id'));return db[_0x50a2('0x91')][_0x50a2('0x40')](_0x4b8890[_0x50a2('0x92')](),_0x3509a1)[_0x50a2('0x2e')](function(_0x56c609){var _0x4acc68=_[_0x50a2('0xaa')](_0x56c609,_0x50a2('0xab'));var _0x1be4f3=[];_0x2822d8[_0x50a2('0x39')](function(_0x269fd4){_0x1be4f3[_0x50a2('0x3a')](updateWhatsappInteraction(_0x269fd4,_0x5a54fa,_0x4acc68));});return BPromise[_0x50a2('0xac')](_0x1be4f3);});});})[_0x50a2('0x2e')](function(_0x59564d){_0x50ab1a[_0x50a2('0xad')]=_0x59564d;return _0x50ab1a;})['then'](respondWithFilteredResult(_0x5db6cf,_0x28b310))[_0x50a2('0xae')](handleError(_0x5db6cf,null));};exports['show']=function(_0x3168fd,_0x3c16e0){var _0x5c01b9={'raw':![],'where':{'id':_0x3168fd['params']['id']}},_0x21e1c1={};_0x21e1c1[_0x50a2('0x3e')]=_[_0x50a2('0x3f')](db[_0x50a2('0x3c')][_0x50a2('0xaf')]);_0x21e1c1['query']=_[_0x50a2('0x3f')](_0x3168fd[_0x50a2('0x40')]);_0x21e1c1['filters']=_[_0x50a2('0x42')](_0x21e1c1[_0x50a2('0x3e')],_0x21e1c1[_0x50a2('0x40')]);_0x5c01b9['attributes']=_[_0x50a2('0x42')](_0x21e1c1['model'],qs[_0x50a2('0x43')](_0x3168fd[_0x50a2('0x40')][_0x50a2('0x43')]));_0x5c01b9['attributes']=_0x5c01b9[_0x50a2('0x44')][_0x50a2('0x45')]?_0x5c01b9[_0x50a2('0x44')]:_0x21e1c1['model'];if(_0x3168fd[_0x50a2('0x40')][_0x50a2('0xb0')]){_0x5c01b9[_0x50a2('0xb1')]=[{'all':!![]}];}_0x5c01b9=_[_0x50a2('0x94')]({},_0x5c01b9,_0x3168fd[_0x50a2('0xb2')]);return db['WhatsappInteraction'][_0x50a2('0x5d')](_0x5c01b9)['then'](handleEntityNotFound(_0x3c16e0,null))[_0x50a2('0x2e')](respondWithResult(_0x3c16e0,null))['catch'](handleError(_0x3c16e0,null));};exports[_0x50a2('0xb3')]=function(_0x4f4949,_0x526f92){return db['WhatsappInteraction'][_0x50a2('0xb3')](_0x4f4949[_0x50a2('0xb4')],{})['then'](respondWithResult(_0x526f92,0xc9))['catch'](handleError(_0x526f92,null));};exports[_0x50a2('0xb5')]=function(_0x45d7c6,_0x346488){if(_0x45d7c6['body']['id']){delete _0x45d7c6[_0x50a2('0xb4')]['id'];}return db[_0x50a2('0x3c')][_0x50a2('0x5d')]({'where':{'id':_0x45d7c6[_0x50a2('0xb6')]['id']}})[_0x50a2('0x2e')](handleEntityNotFound(_0x346488,null))[_0x50a2('0x2e')](saveUpdates(_0x45d7c6['body'],null))['then'](respondWithResult(_0x346488,null))[_0x50a2('0xae')](handleError(_0x346488,null));};exports[_0x50a2('0x2f')]=function(_0x53ac4a,_0x5c9971){return db[_0x50a2('0x3c')][_0x50a2('0x5d')]({'where':{'id':_0x53ac4a[_0x50a2('0xb6')]['id']}})[_0x50a2('0x2e')](handleEntityNotFound(_0x5c9971,null))[_0x50a2('0x2e')](removeEntity(_0x5c9971,null))[_0x50a2('0xae')](handleError(_0x5c9971,null));};exports[_0x50a2('0xb7')]=function(_0x16e490,_0x5396e4){return db[_0x50a2('0x3c')][_0x50a2('0xb7')]()[_0x50a2('0x2e')](respondWithResult(_0x5396e4,null))[_0x50a2('0xae')](handleError(_0x5396e4,null));};exports[_0x50a2('0xb8')]=function(_0x209655,_0x17bdd2,_0x37ec57){return db[_0x50a2('0xb9')][_0x50a2('0x5d')]({'where':{'id':_0x209655[_0x50a2('0xb6')]['id']}})[_0x50a2('0x2e')](handleEntityNotFound(_0x17bdd2,null))[_0x50a2('0x2e')](function(_0xdc394){if(_0xdc394){return _0xdc394[_0x50a2('0xb8')](_0x209655[_0x50a2('0xb4')]['ids'],_[_0x50a2('0xba')](_0x209655[_0x50a2('0xb4')],[_0x50a2('0xbb'),'id'])||{});}})[_0x50a2('0x2e')](respondWithResult(_0x17bdd2,null))[_0x50a2('0xae')](handleError(_0x17bdd2,null));};exports[_0x50a2('0xbc')]=function(_0x1a8bd0,_0x4e120d,_0x1484e6){var _0x2a65f2={'raw':![],'where':{}};var _0x502de0={};var _0x5189b9={'count':0x0,'rows':[]};return db[_0x50a2('0x3c')]['findOne']({'where':{'id':_0x1a8bd0[_0x50a2('0xb6')]['id']}})['then'](handleEntityNotFound(_0x4e120d,null))[_0x50a2('0x2e')](function(_0x1707e8){if(_0x1707e8){_0x502de0['model']=_[_0x50a2('0x3f')](db[_0x50a2('0xb9')][_0x50a2('0xaf')]);_0x502de0['query']=_[_0x50a2('0x3f')](_0x1a8bd0['query']);_0x502de0['filters']=_[_0x50a2('0x42')](_0x502de0[_0x50a2('0x3e')],_0x502de0[_0x50a2('0x40')]);_0x2a65f2[_0x50a2('0x44')]=_[_0x50a2('0x42')](_0x502de0[_0x50a2('0x3e')],qs['fields'](_0x1a8bd0[_0x50a2('0x40')][_0x50a2('0x43')]));_0x2a65f2[_0x50a2('0x44')]=_0x2a65f2[_0x50a2('0x44')][_0x50a2('0x45')]?_0x2a65f2[_0x50a2('0x44')]:_0x502de0[_0x50a2('0x3e')];if(!_0x1a8bd0[_0x50a2('0x40')]['hasOwnProperty'](_0x50a2('0xbd'))){_0x2a65f2[_0x50a2('0x27')]=qs['limit'](_0x1a8bd0[_0x50a2('0x40')]['limit']);_0x2a65f2['offset']=qs[_0x50a2('0x25')](_0x1a8bd0[_0x50a2('0x40')][_0x50a2('0x25')]);}_0x2a65f2[_0x50a2('0x46')]=qs[_0x50a2('0x47')](_0x1a8bd0['query']['sort']);_0x2a65f2[_0x50a2('0x73')]=qs['filters'](_[_0x50a2('0x48')](_0x1a8bd0[_0x50a2('0x40')],_0x502de0['filters']));_0x2a65f2[_0x50a2('0x73')]['WhatsappInteractionId']=_0x1707e8['id'];if(_0x1a8bd0[_0x50a2('0x40')]['filter']){_0x2a65f2[_0x50a2('0x73')]=_[_0x50a2('0x94')](_0x2a65f2[_0x50a2('0x73')],{'$or':_[_0x50a2('0x34')](_0x2a65f2[_0x50a2('0x44')],function(_0x23769f){var _0x330b85={};_0x330b85[_0x23769f]={'$like':'%'+_0x1a8bd0[_0x50a2('0x40')][_0x50a2('0x81')]+'%'};return _0x330b85;})});}if(_0x1a8bd0[_0x50a2('0x40')][_0x50a2('0xbe')]){var _0x2ca4b2=_0x1a8bd0[_0x50a2('0x40')]['$gte']['split'](',');var _0x467ace={};_0x467ace[_0x2ca4b2[0x0]]={'$gte':moment(_0x2ca4b2[0x1])[_0x50a2('0xbf')](_0x50a2('0xc0'))};_0x2a65f2[_0x50a2('0x73')]=_[_0x50a2('0x94')](_0x2a65f2[_0x50a2('0x73')],_0x467ace);}_0x2a65f2=_['merge']({},_0x2a65f2,_0x1a8bd0[_0x50a2('0xb2')]);return db[_0x50a2('0xb9')]['count']({'where':_0x2a65f2['where']})['then'](function(_0x4a625c){_0x5189b9[_0x50a2('0x28')]=_0x4a625c;if(_0x1a8bd0['query']['includeAll']){_0x2a65f2[_0x50a2('0xb1')]=[{'all':!![]}];}return db[_0x50a2('0xb9')]['findAll'](_0x2a65f2);})[_0x50a2('0x2e')](function(_0x56536c){_0x5189b9['rows']=_0x56536c;return _0x5189b9;});}})['then'](respondWithFilteredResult(_0x4e120d,_0x2a65f2))[_0x50a2('0xae')](handleError(_0x4e120d,null));};exports[_0x50a2('0xc1')]=function(_0x2bea57,_0x119ee2,_0x54d25b){return db['WhatsappInteraction'][_0x50a2('0x5d')]({'where':{'id':_0x2bea57[_0x50a2('0xb6')]['id']}})['then'](handleEntityNotFound(_0x119ee2,null))[_0x50a2('0x2e')](function(_0x5bd788){if(_0x5bd788){return _0x5bd788[_0x50a2('0xc2')](_0x2bea57[_0x50a2('0xb4')][_0x50a2('0xbb')],_['omit'](_0x2bea57[_0x50a2('0xb4')],[_0x50a2('0xbb'),'id'])||{})[_0x50a2('0xc3')](function(){return db[_0x50a2('0x6a')][_0x50a2('0xc4')]({'attributes':['id','name',_0x50a2('0x4a')],'where':{'id':_0x2bea57['body'][_0x50a2('0xbb')]}});})[_0x50a2('0x2e')](function(_0x517c96){socket[_0x50a2('0xc5')](_0x50a2('0xc6'),{'id':Number(_0x2bea57[_0x50a2('0xb6')]['id']),'tags':_0x517c96||[]});return{'id':Number(_0x2bea57[_0x50a2('0xb6')]['id']),'tags':_0x517c96||[]};});}})[_0x50a2('0x2e')](respondWithResult(_0x119ee2,null))['catch'](handleError(_0x119ee2,null));};exports['removeTags']=function(_0x2bab1d,_0x167fc5,_0x47c30c){return db[_0x50a2('0x3c')][_0x50a2('0x5d')]({'where':{'id':_0x2bab1d[_0x50a2('0xb6')]['id']}})['then'](handleEntityNotFound(_0x167fc5,null))[_0x50a2('0x2e')](function(_0x3abc5b){if(_0x3abc5b){return _0x3abc5b['removeTags'](_0x2bab1d['query'][_0x50a2('0xbb')]);}})[_0x50a2('0x2e')](respondWithStatusCode(_0x167fc5,null))[_0x50a2('0xae')](handleError(_0x167fc5,null));};exports[_0x50a2('0xc7')]=function(_0xd1e303,_0x25f89c){var _0x3e69d1=moment()[_0x50a2('0xc8')]()[_0x50a2('0x92')]();var _0x637b00=path['join'](config[_0x50a2('0xc9')],_0x50a2('0xca'),_0x50a2('0xcb'),_0x50a2('0xcc'));var _0x6b89c5=path['join'](config['root'],_0x50a2('0xca'),_0x50a2('0xcb'),_0x50a2('0xcd'));var _0x335f74=path[_0x50a2('0xce')](_0x637b00,_0x3e69d1);var _0x3eedcd=util['format'](_0x50a2('0xcf'),_0xd1e303['params']['id'],_0x3e69d1);var _0x37c3ff=path[_0x50a2('0xce')](_0x637b00,_0x3eedcd);var _0x31c5ac=[];_0x31c5ac['push']({'model':db[_0x50a2('0xd0')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x31c5ac[_0x50a2('0x3a')]({'model':db[_0x50a2('0xd1')],'as':_0x50a2('0x63'),'attributes':['id',_0x50a2('0xd2'),_0x50a2('0xd3')],'raw':!![]});if(_0xd1e303[_0x50a2('0x40')][_0x50a2('0xcd')]){_0x31c5ac['push']({'model':db['Attachment'],'as':_0x50a2('0xd4'),'raw':!![]});}var _0x56310a=[{'model':db[_0x50a2('0xb9')],'as':_0x50a2('0xd5'),'attributes':['id',_0x50a2('0xb4'),'createdAt',_0x50a2('0xd6'),'secret','read'],'include':_0x31c5ac}];_0x56310a[_0x50a2('0x3a')]({'model':db[_0x50a2('0xd7')],'as':_0x50a2('0xd8'),'attributes':['id',_0x50a2('0x32')]});_0x56310a[_0x50a2('0x3a')]({'model':db[_0x50a2('0xd0')],'as':'Owner','attributes':['id',_0x50a2('0x35')]});return db['WhatsappInteraction'][_0x50a2('0x5d')]({'where':{'id':_0xd1e303['params']['id']},'include':_0x56310a})['then'](handleEntityNotFound(_0x25f89c,null))[_0x50a2('0x2e')](function(_0x1b0dac){if(_0x1b0dac){var _0x1e44ba=_0x1b0dac['get']({'plain':!![]});fs[_0x50a2('0xd9')](_0x335f74);var _0x136053={'channel':_0x50a2('0xda'),'account':_0x1e44ba[_0x50a2('0xd8')][_0x50a2('0x32')],'agent':_0x1e44ba['Owner']?_0x1e44ba[_0x50a2('0xdb')][_0x50a2('0x35')]:_0x50a2('0xdc'),'createdAt':moment(_0x1e44ba[_0x50a2('0x76')])[_0x50a2('0xbf')](_0x50a2('0xc0'))[_0x50a2('0x92')](),'closedAt':_0x1e44ba[_0x50a2('0xdd')]?moment(_0x1e44ba[_0x50a2('0xde')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x50a2('0x92')]():'','disposition':_0x1e44ba['disposition'],'messages':_(_0x1e44ba[_0x50a2('0xd5')])[_0x50a2('0x81')]({'secret':![]})[_0x50a2('0x34')](function(_0x342b54){if(_0x342b54['Attachment']){var _0x35c5b2=path[_0x50a2('0xce')](_0x6b89c5,_0x342b54[_0x50a2('0xd4')][_0x50a2('0xdf')]);if(fs[_0x50a2('0xe0')](_0x35c5b2)){fs[_0x50a2('0xe1')](_0x35c5b2)[_0x50a2('0xe2')](fs[_0x50a2('0xe3')](path['join'](_0x335f74,_0x342b54['Attachment'][_0x50a2('0xdf')])));}}return{'date':moment(_0x342b54[_0x50a2('0x76')])[_0x50a2('0xbf')](_0x50a2('0xc0'))[_0x50a2('0x92')](),'sender':_0x342b54[_0x50a2('0xd6')]===_0x50a2('0xe4')?_0x342b54[_0x50a2('0xd0')]?_0x342b54[_0x50a2('0xd0')][_0x50a2('0x35')]:_0x50a2('0xe5'):_0x342b54[_0x50a2('0x63')]['firstName']+(_0x342b54[_0x50a2('0x63')][_0x50a2('0xd3')]?'\x20'+_0x342b54[_0x50a2('0x63')][_0x50a2('0xd3')]:''),'body':_0x342b54['Attachment']?_0x342b54[_0x50a2('0xd4')][_0x50a2('0xdf')]:_0x342b54[_0x50a2('0xb4')],'direction':_0x342b54[_0x50a2('0xd6')]==='out'?'A':'C','secret':_0x342b54[_0x50a2('0xe6')],'read':_0x342b54['read'],'attachment':_0x342b54[_0x50a2('0xd4')]};})[_0x50a2('0x5f')]()};return ejs[_0x50a2('0xe7')](path['join'](config[_0x50a2('0xc9')],_0x50a2('0xca'),_0x50a2('0xe8'),_0x50a2('0xe9')),{'interaction':_0x136053})[_0x50a2('0x2e')](function(_0x509e99){var _0x318a2b=path[_0x50a2('0xce')](_0x335f74,_0x50a2('0xea')+_0x1e44ba['id']+'-'+_0x3e69d1+_0x50a2('0xeb'));var _0xfa01ce={'path':_0x318a2b,'channel':'Whatsapp','interactionId':_0x1e44ba['id']};return pdf['createPdfFromHTML'](_0x509e99,_0xfa01ce);})[_0x50a2('0x2e')](function(){return new BPromise(function(_0x359fd6,_0x45ebc0){zipdir(_0x335f74,{'saveTo':_0x37c3ff},function(_0xaafbf9,_0x1cbf86){if(_0xaafbf9)return _0x45ebc0(_0xaafbf9);return _0x359fd6(_0x1cbf86);});})[_0x50a2('0x2e')](function(){return new BPromise(function(_0x42621f,_0x3b2ece){rimraf(_0x335f74,function(_0x1fcbab){if(_0x1fcbab)_0x3b2ece(_0x1fcbab);return _0x42621f();});});})[_0x50a2('0x2e')](function(){return _0x25f89c[_0x50a2('0xc7')](_0x37c3ff,_0x3eedcd,function(_0x5e38d3){if(_0x5e38d3){console[_0x50a2('0xec')](_0x50a2('0xed'),_0x5e38d3);}else{fs['unlinkSync'](_0x37c3ff);}});});});}else{return _0x25f89c[_0x50a2('0x21')](0xc8);}})[_0x50a2('0xae')](handleError(_0x25f89c,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 1e28d51..72f180d 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 _0x98e5=['setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty','exports','../../mysqldb','WhatsappMessage','save','update','then'];(function(_0x1cc598,_0x53bae5){var _0x491d7b=function(_0x95fa84){while(--_0x95fa84){_0x1cc598['push'](_0x1cc598['shift']());}};_0x491d7b(++_0x53bae5);}(_0x98e5,0x8a));var _0x598e=function(_0x3be18d,_0x59246a){_0x3be18d=_0x3be18d-0x0;var _0x516272=_0x98e5[_0x3be18d];return _0x516272;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x598e('0x0'))['db'][_0x598e('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x598e('0x2'),'afterUpdate':_0x598e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3af01f){return function(_0x5a876c,_0x55025c,_0x154755){_0x5a876c['getUsers']({'attributes':['id'],'raw':!![]})[_0x598e('0x4')](function(_0x1fc8b5){_0x5a876c[_0x598e('0x5')](_0x598e('0x6'),_0x1fc8b5[_0x598e('0x7')](function(_0x3e6e86){return{'id':_0x3e6e86['id']};}));return WhatsappMessage[_0x598e('0x8')]({'where':{'WhatsappInteractionId':_0x5a876c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x598e('0x4')](function(_0x2e8f07){_0x5a876c[_0x598e('0x5')](_0x598e('0x9'),_0x2e8f07['length']);WhatsappInteractionEvents[_0x598e('0xa')](_0x3af01f+':'+_0x5a876c['id'],_0x5a876c);WhatsappInteractionEvents[_0x598e('0xa')](_0x3af01f,_0x5a876c);_0x154755(null);})['catch'](_0x154755(null));};}for(var e in events){if(events[_0x598e('0xb')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x598e('0xc')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xbefe=['hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x34da1e,_0x38364b){var _0x4f291c=function(_0x2cdfa1){while(--_0x2cdfa1){_0x34da1e['push'](_0x34da1e['shift']());}};_0x4f291c(++_0x38364b);}(_0xbefe,0x168));var _0xebef=function(_0x34520d,_0x31419e){_0x34520d=_0x34520d-0x0;var _0x8b8eb=_0xbefe[_0x34520d];return _0x8b8eb;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xebef('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xebef('0x0'))['db'][_0xebef('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xebef('0x2')](0x0);var events={'afterCreate':_0xebef('0x3'),'afterUpdate':_0xebef('0x4'),'afterDestroy':_0xebef('0x5')};function emitEvent(_0x33b5a7){return function(_0x2e79b7,_0x563623,_0x3fe404){_0x2e79b7[_0xebef('0x6')]({'attributes':['id'],'raw':!![]})[_0xebef('0x7')](function(_0x4fb4fa){_0x2e79b7[_0xebef('0x8')](_0xebef('0x9'),_0x4fb4fa['map'](function(_0x4d28bb){return{'id':_0x4d28bb['id']};}));return WhatsappMessage[_0xebef('0xa')]({'where':{'WhatsappInteractionId':_0x2e79b7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xebef('0x7')](function(_0x187f3b){_0x2e79b7[_0xebef('0x8')](_0xebef('0xb'),_0x187f3b[_0xebef('0xc')]);WhatsappInteractionEvents[_0xebef('0xd')](_0x33b5a7+':'+_0x2e79b7['id'],_0x2e79b7);WhatsappInteractionEvents[_0xebef('0xd')](_0x33b5a7,_0x2e79b7);_0x3fe404(null);})['catch'](_0x3fe404(null));};}for(var e in events){if(events[_0xebef('0xe')](e)){var event=events[e];WhatsappInteraction[_0xebef('0xf')](e,emitEvent(event));}}module[_0xebef('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 4b42803..37058c0 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 _0x4bcf=['api','bluebird','request-promise','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x1cb690,_0x5592e3){var _0x3bebd4=function(_0x266301){while(--_0x266301){_0x1cb690['push'](_0x1cb690['shift']());}};_0x3bebd4(++_0x5592e3);}(_0x4bcf,0x177));var _0xf4bc=function(_0x310990,_0x245984){_0x310990=_0x310990-0x0;var _0x648534=_0x4bcf[_0x310990];return _0x648534;};'use strict';var _=require(_0xf4bc('0x0'));var util=require(_0xf4bc('0x1'));var logger=require('../../config/logger')(_0xf4bc('0x2'));var moment=require('moment');var BPromise=require(_0xf4bc('0x3'));var rp=require(_0xf4bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf4bc('0x5'));module[_0xf4bc('0x6')]=function(_0x2c0e88,_0x220411){return _0x2c0e88[_0xf4bc('0x7')](_0xf4bc('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e2159,_0xd1c2f0,_0x241792){if(_0x3e2159[_0xf4bc('0x9')](_0xf4bc('0xa'))){_0x3e2159['closedAt']=moment()[_0xf4bc('0xb')](_0xf4bc('0xc'));}_0x241792(null,_0x3e2159);}}});}; \ No newline at end of file +var _0xf234=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x2a7d55,_0x36bd70){var _0x137989=function(_0x51246a){while(--_0x51246a){_0x2a7d55['push'](_0x2a7d55['shift']());}};_0x137989(++_0x36bd70);}(_0xf234,0xeb));var _0x4f23=function(_0x1d4190,_0x1ade45){_0x1d4190=_0x1d4190-0x0;var _0x1af321=_0xf234[_0x1d4190];return _0x1af321;};'use strict';var _=require(_0x4f23('0x0'));var util=require(_0x4f23('0x1'));var logger=require(_0x4f23('0x2'))(_0x4f23('0x3'));var moment=require(_0x4f23('0x4'));var BPromise=require(_0x4f23('0x5'));var rp=require(_0x4f23('0x6'));var fs=require('fs');var path=require(_0x4f23('0x7'));var rimraf=require(_0x4f23('0x8'));var config=require(_0x4f23('0x9'));var attributes=require(_0x4f23('0xa'));module[_0x4f23('0xb')]=function(_0x1e01f7,_0x2315b2){return _0x1e01f7['define'](_0x4f23('0xc'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14ad4b,_0x5ee830,_0x172629){if(_0x14ad4b[_0x4f23('0xd')]('closed')){_0x14ad4b['closedAt']=moment()[_0x4f23('0xe')](_0x4f23('0xf'));}_0x172629(null,_0x14ad4b);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 4d32739..01ce96e 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 _0xadb4=['code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','attributes','debug','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','defaults','redis','register','request','then','info','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x825ea9,_0x56c3ea){var _0x4282a8=function(_0x9dd4e2){while(--_0x9dd4e2){_0x825ea9['push'](_0x825ea9['shift']());}};_0x4282a8(++_0x56c3ea);}(_0xadb4,0xdb));var _0x4adb=function(_0x1d3d54,_0x284f48){_0x1d3d54=_0x1d3d54-0x0;var _0x12be4a=_0xadb4[_0x1d3d54];return _0x12be4a;};'use strict';var _=require(_0x4adb('0x0'));var util=require(_0x4adb('0x1'));var moment=require(_0x4adb('0x2'));var BPromise=require(_0x4adb('0x3'));var rs=require(_0x4adb('0x4'));var fs=require('fs');var Redis=require(_0x4adb('0x5'));var db=require(_0x4adb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4adb('0x7'))(_0x4adb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4adb('0x9')][_0x4adb('0xa')]({'port':0x232a});config['redis']=_[_0x4adb('0xb')](config[_0x4adb('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4adb('0xc')]));require('./whatsappInteraction.socket')[_0x4adb('0xd')](socket);function respondWithRpcPromise(_0x5df0e4,_0x40a6ce,_0x463b58){return new BPromise(function(_0x2b6e70,_0x46af87){return client[_0x4adb('0xe')](_0x5df0e4,_0x463b58)[_0x4adb('0xf')](function(_0x493d25){logger[_0x4adb('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x40a6ce,_0x4adb('0x11'));logger['debug'](_0x4adb('0x12'),_0x40a6ce,'request\x20sent',JSON[_0x4adb('0x13')](_0x493d25));if(_0x493d25['error']){if(_0x493d25[_0x4adb('0x14')][_0x4adb('0x15')]===0x1f4){logger['error'](_0x4adb('0x16'),_0x40a6ce,_0x493d25[_0x4adb('0x14')]['message']);return _0x46af87(_0x493d25['error'][_0x4adb('0x17')]);}logger[_0x4adb('0x14')](_0x4adb('0x16'),_0x40a6ce,_0x493d25[_0x4adb('0x14')][_0x4adb('0x17')]);return _0x2b6e70(_0x493d25[_0x4adb('0x14')][_0x4adb('0x17')]);}else{logger[_0x4adb('0x10')](_0x4adb('0x16'),_0x40a6ce,'request\x20sent');_0x2b6e70(_0x493d25[_0x4adb('0x18')]['message']);}})[_0x4adb('0x19')](function(_0x1d992a){logger[_0x4adb('0x14')](_0x4adb('0x16'),_0x40a6ce,_0x1d992a);_0x46af87(_0x1d992a);});});}exports[_0x4adb('0x1a')]=function(_0x6dcbe6){var _0x2fd204=this;return new Promise(function(_0xfba5fc,_0x1b1c03){return db[_0x4adb('0x1b')]['update'](_0x6dcbe6[_0x4adb('0x1c')],{'raw':_0x6dcbe6[_0x4adb('0x1d')]?_0x6dcbe6[_0x4adb('0x1d')][_0x4adb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6dcbe6[_0x4adb('0x1d')]?_0x6dcbe6[_0x4adb('0x1d')]['where']||null:null,'attributes':_0x6dcbe6[_0x4adb('0x1d')]?_0x6dcbe6[_0x4adb('0x1d')][_0x4adb('0x1f')]||null:null,'limit':_0x6dcbe6[_0x4adb('0x1d')]?_0x6dcbe6[_0x4adb('0x1d')]['limit']||null:null})['then'](function(_0x1c58d5){logger['info']('UpdateWhatsappInteraction',_0x6dcbe6);logger[_0x4adb('0x20')](_0x4adb('0x1a'),_0x6dcbe6,JSON[_0x4adb('0x13')](_0x1c58d5));_0xfba5fc(_0x1c58d5);})[_0x4adb('0x19')](function(_0x3adfd1){logger['error']('UpdateWhatsappInteraction',_0x3adfd1['message'],_0x6dcbe6);_0x1b1c03(_0x2fd204[_0x4adb('0x14')](0x1f4,_0x3adfd1['message']));});});};exports[_0x4adb('0x21')]=function(_0x14c8cd){return new Promise(function(_0x4f7c65,_0x4ccad7){return db[_0x4adb('0x1b')][_0x4adb('0x22')]({'where':_0x14c8cd[_0x4adb('0x1d')]?_0x14c8cd['options']['where']||null:null})[_0x4adb('0xf')](function(_0x568a27){if(_0x568a27){return _0x568a27[_0x4adb('0x23')](_0x14c8cd[_0x4adb('0x1c')][_0x4adb('0x24')],_[_0x4adb('0x25')](_0x14c8cd[_0x4adb('0x1c')],[_0x4adb('0x24'),'id'])||{});}})[_0x4adb('0x26')](function(_0x450b6f){logger[_0x4adb('0x10')](_0x4adb('0x27'),_0x14c8cd);logger[_0x4adb('0x20')](_0x4adb('0x27'),_0x14c8cd,JSON[_0x4adb('0x13')](_0x450b6f));_0x4f7c65(_0x450b6f);})['catch'](function(_0x4aace7){logger['error']('AddTags',_0x4aace7[_0x4adb('0x17')],_0x14c8cd);_0x4ccad7(_this[_0x4adb('0x14')](0x1f4,_0x4aace7[_0x4adb('0x17')]));});});}; \ No newline at end of file +var _0x9cb3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','register','request','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','UpdateWhatsappInteraction','WhatsappInteraction','update','options','where','limit','then','catch','find','addTags','ids','body','spread','AddTags'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x9cb3,0x171));var _0x39cb=function(_0x4dbcd6,_0x34326c){_0x4dbcd6=_0x4dbcd6-0x0;var _0x541e55=_0x9cb3[_0x4dbcd6];return _0x541e55;};'use strict';var _=require(_0x39cb('0x0'));var util=require(_0x39cb('0x1'));var moment=require(_0x39cb('0x2'));var BPromise=require(_0x39cb('0x3'));var rs=require(_0x39cb('0x4'));var fs=require('fs');var Redis=require(_0x39cb('0x5'));var db=require(_0x39cb('0x6'))['db'];var utils=require(_0x39cb('0x7'));var logger=require(_0x39cb('0x8'))('rpc');var config=require(_0x39cb('0x9'));var jayson=require(_0x39cb('0xa'));var client=jayson['client'][_0x39cb('0xb')]({'port':0x232a});config['redis']=_[_0x39cb('0xc')](config['redis'],{'host':_0x39cb('0xd'),'port':0x18eb});var socket=require(_0x39cb('0xe'))(new Redis(config[_0x39cb('0xf')]));require(_0x39cb('0x10'))[_0x39cb('0x11')](socket);function respondWithRpcPromise(_0x444da2,_0x50eae9,_0x43462a){return new BPromise(function(_0xa4784e,_0x11011c){return client[_0x39cb('0x12')](_0x444da2,_0x43462a)['then'](function(_0x23b322){logger['info'](_0x39cb('0x13'),_0x50eae9,'request\x20sent');logger[_0x39cb('0x14')](_0x39cb('0x15'),_0x50eae9,_0x39cb('0x16'),JSON[_0x39cb('0x17')](_0x23b322));if(_0x23b322[_0x39cb('0x18')]){if(_0x23b322[_0x39cb('0x18')]['code']===0x1f4){logger[_0x39cb('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x50eae9,_0x23b322[_0x39cb('0x18')][_0x39cb('0x19')]);return _0x11011c(_0x23b322[_0x39cb('0x18')][_0x39cb('0x19')]);}logger['error'](_0x39cb('0x13'),_0x50eae9,_0x23b322[_0x39cb('0x18')][_0x39cb('0x19')]);return _0xa4784e(_0x23b322['error'][_0x39cb('0x19')]);}else{logger[_0x39cb('0x1a')](_0x39cb('0x13'),_0x50eae9,_0x39cb('0x16'));_0xa4784e(_0x23b322['result'][_0x39cb('0x19')]);}})['catch'](function(_0x3e7eaf){logger[_0x39cb('0x18')](_0x39cb('0x13'),_0x50eae9,_0x3e7eaf);_0x11011c(_0x3e7eaf);});});}exports[_0x39cb('0x1b')]=function(_0x3a733d){var _0x9b0d4c=this;return new Promise(function(_0x2a88b0,_0x26afa1){return db[_0x39cb('0x1c')][_0x39cb('0x1d')](_0x3a733d['body'],{'raw':_0x3a733d[_0x39cb('0x1e')]?_0x3a733d[_0x39cb('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a733d['options']?_0x3a733d[_0x39cb('0x1e')][_0x39cb('0x1f')]||null:null,'attributes':_0x3a733d[_0x39cb('0x1e')]?_0x3a733d[_0x39cb('0x1e')]['attributes']||null:null,'limit':_0x3a733d[_0x39cb('0x1e')]?_0x3a733d[_0x39cb('0x1e')][_0x39cb('0x20')]||null:null})[_0x39cb('0x21')](function(_0x10667b){logger[_0x39cb('0x1a')](_0x39cb('0x1b'),_0x3a733d);logger[_0x39cb('0x14')]('UpdateWhatsappInteraction',_0x3a733d,JSON[_0x39cb('0x17')](_0x10667b));_0x2a88b0(_0x10667b);})[_0x39cb('0x22')](function(_0x4518ee){logger[_0x39cb('0x18')](_0x39cb('0x1b'),_0x4518ee[_0x39cb('0x19')],_0x3a733d);_0x26afa1(_0x9b0d4c[_0x39cb('0x18')](0x1f4,_0x4518ee[_0x39cb('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x59b75a){return new Promise(function(_0x2021fc,_0x32878e){return db[_0x39cb('0x1c')][_0x39cb('0x23')]({'where':_0x59b75a[_0x39cb('0x1e')]?_0x59b75a[_0x39cb('0x1e')][_0x39cb('0x1f')]||null:null})[_0x39cb('0x21')](function(_0x246581){if(_0x246581){return _0x246581[_0x39cb('0x24')](_0x59b75a['body'][_0x39cb('0x25')],_['omit'](_0x59b75a[_0x39cb('0x26')],[_0x39cb('0x25'),'id'])||{});}})[_0x39cb('0x27')](function(_0xc46233){logger[_0x39cb('0x1a')](_0x39cb('0x28'),_0x59b75a);logger[_0x39cb('0x14')]('AddTags',_0x59b75a,JSON[_0x39cb('0x17')](_0xc46233));_0x2021fc(_0xc46233);})[_0x39cb('0x22')](function(_0x299285){logger[_0x39cb('0x18')](_0x39cb('0x28'),_0x299285[_0x39cb('0x19')],_0x59b75a);_0x32878e(_this[_0x39cb('0x18')](0x1f4,_0x299285[_0x39cb('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index f457f2c..bffae56 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 _0x96e4=['save','remove','update','emit','register','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x4640dd,_0x26f32a){var _0x5569aa=function(_0x133545){while(--_0x133545){_0x4640dd['push'](_0x4640dd['shift']());}};_0x5569aa(++_0x26f32a);}(_0x96e4,0x6f));var _0x496e=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x96e4[_0x470e67];return _0x28bbde;};'use strict';var WhatsappInteractionEvents=require(_0x496e('0x0'));var events=[_0x496e('0x1'),_0x496e('0x2'),_0x496e('0x3')];function createListener(_0x2b5225,_0x51786b){return function(_0x4351db){_0x51786b[_0x496e('0x4')](_0x2b5225,_0x4351db);};}function removeListener(_0x3b50ef,_0x5821fa){return function(){WhatsappInteractionEvents['removeListener'](_0x3b50ef,_0x5821fa);};}exports[_0x496e('0x5')]=function(_0x358a57){for(var _0x5934f9=0x0,_0xf5dac6=events['length'];_0x5934f9<_0xf5dac6;_0x5934f9++){var _0x48a7c0=events[_0x5934f9];var _0x46afb5=createListener(_0x496e('0x6')+_0x48a7c0,_0x358a57);WhatsappInteractionEvents['on'](_0x48a7c0,_0x46afb5);}}; \ No newline at end of file +var _0x1579=['save','remove','update','removeListener','register','./whatsappInteraction.events'];(function(_0x3e0191,_0x1d4b20){var _0xf2ae83=function(_0x277210){while(--_0x277210){_0x3e0191['push'](_0x3e0191['shift']());}};_0xf2ae83(++_0x1d4b20);}(_0x1579,0x14f));var _0x9157=function(_0x52e966,_0x3eb061){_0x52e966=_0x52e966-0x0;var _0x241eee=_0x1579[_0x52e966];return _0x241eee;};'use strict';var WhatsappInteractionEvents=require(_0x9157('0x0'));var events=[_0x9157('0x1'),_0x9157('0x2'),_0x9157('0x3')];function createListener(_0x73b89f,_0x541360){return function(_0x4d009f){_0x541360['emit'](_0x73b89f,_0x4d009f);};}function removeListener(_0xa30169,_0x5975a0){return function(){WhatsappInteractionEvents[_0x9157('0x4')](_0xa30169,_0x5975a0);};}exports[_0x9157('0x5')]=function(_0x5b5445){for(var _0x2b3601=0x0,_0x1543bb=events['length'];_0x2b3601<_0x1543bb;_0x2b3601++){var _0x147b46=events[_0x2b3601];var _0x3443ab=createListener('whatsappInteraction:'+_0x147b46,_0x5b5445);WhatsappInteractionEvents['on'](_0x147b46,_0x3443ab);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 0299d07..4c90a6e 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 _0x057e=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','get','describe','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','update','put','/:id/accept','accept','reject','delete'];(function(_0xfc27dd,_0x4f0e7e){var _0x110ef3=function(_0x4a7ca1){while(--_0x4a7ca1){_0xfc27dd['push'](_0xfc27dd['shift']());}};_0x110ef3(++_0x4f0e7e);}(_0x057e,0x1aa));var _0xe057=function(_0x767333,_0x4ceb6b){_0x767333=_0x767333-0x0;var _0x2263ac=_0x057e[_0x767333];return _0x2263ac;};'use strict';var multer=require(_0xe057('0x0'));var util=require(_0xe057('0x1'));var path=require('path');var timeout=require(_0xe057('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe057('0x3'));var auth=require(_0xe057('0x4'));var interaction=require(_0xe057('0x5'));var config=require('../../config/environment');var controller=require(_0xe057('0x6'));router['get']('/',auth[_0xe057('0x7')](),controller[_0xe057('0x8')]);router[_0xe057('0x9')]('/describe',auth[_0xe057('0x7')](),controller[_0xe057('0xa')]);router[_0xe057('0x9')]('/:id',auth[_0xe057('0x7')](),controller['show']);router[_0xe057('0xb')]('/',auth['isAuthenticated'](),interaction[_0xe057('0xc')](_0xe057('0xd'),_0xe057('0xe')),controller[_0xe057('0xf')]);router['post'](_0xe057('0x10'),controller[_0xe057('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe057('0x12')]);router[_0xe057('0x13')](_0xe057('0x14'),auth[_0xe057('0x7')](),controller[_0xe057('0x15')]);router[_0xe057('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0xe057('0x16')]);router[_0xe057('0x17')]('/:id',auth[_0xe057('0x7')](),controller['destroy']);module[_0xe057('0x18')]=router; \ No newline at end of file +var _0xca09=['isAuthenticated','describe','show','post','tracked','whatsappmessage:create','/:id/status','put','/:id','update','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller'];(function(_0x3c69bc,_0x424700){var _0x3a0c87=function(_0x2d3c31){while(--_0x2d3c31){_0x3c69bc['push'](_0x3c69bc['shift']());}};_0x3a0c87(++_0x424700);}(_0xca09,0xdd));var _0x9ca0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xca09[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x9ca0('0x0'));var util=require(_0x9ca0('0x1'));var path=require(_0x9ca0('0x2'));var timeout=require(_0x9ca0('0x3'));var express=require(_0x9ca0('0x4'));var router=express[_0x9ca0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9ca0('0x6'));var interaction=require(_0x9ca0('0x7'));var config=require('../../config/environment');var controller=require(_0x9ca0('0x8'));router['get']('/',auth[_0x9ca0('0x9')](),controller['index']);router['get']('/describe',auth[_0x9ca0('0x9')](),controller[_0x9ca0('0xa')]);router['get']('/:id',auth[_0x9ca0('0x9')](),controller[_0x9ca0('0xb')]);router[_0x9ca0('0xc')]('/',auth[_0x9ca0('0x9')](),interaction[_0x9ca0('0xd')]('whatsapp',_0x9ca0('0xe')),controller['create']);router[_0x9ca0('0xc')](_0x9ca0('0xf'),controller['status']);router[_0x9ca0('0x10')](_0x9ca0('0x11'),auth[_0x9ca0('0x9')](),controller[_0x9ca0('0x12')]);router['put']('/:id/accept',auth[_0x9ca0('0x9')](),controller['accept']);router['put'](_0x9ca0('0x13'),auth['isAuthenticated'](),controller[_0x9ca0('0x14')]);router[_0x9ca0('0x15')](_0x9ca0('0x11'),auth[_0x9ca0('0x9')](),controller[_0x9ca0('0x16')]);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 164905f..b251985 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 _0x4913=['STRING','DATE','exports','TEXT','BOOLEAN','ENUM'];(function(_0x4b9111,_0x2f1ba1){var _0x1cde79=function(_0x43f96e){while(--_0x43f96e){_0x4b9111['push'](_0x4b9111['shift']());}};_0x1cde79(++_0x2f1ba1);}(_0x4913,0x170));var _0x3491=function(_0x2088ac,_0x2886ba){_0x2088ac=_0x2088ac-0x0;var _0x50b6a4=_0x4913[_0x2088ac];return _0x50b6a4;};'use strict';var Sequelize=require('sequelize');module[_0x3491('0x0')]={'body':{'type':Sequelize[_0x3491('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3491('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3491('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x3491('0x4')](0xbe)},'phone':{'type':Sequelize[_0x3491('0x4')]},'readAt':{'type':Sequelize[_0x3491('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xde0f=['DATE','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xde0f,0xa2));var _0xfde0=function(_0x7d6ce3,_0xb94a0b){_0x7d6ce3=_0x7d6ce3-0x0;var _0x23b20d=_0xde0f[_0x7d6ce3];return _0x23b20d;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xfde0('0x0')](_0xfde0('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xfde0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfde0('0x3')]('in',_0xfde0('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xfde0('0x5')](0xbe)},'phone':{'type':Sequelize[_0xfde0('0x5')]},'readAt':{'type':Sequelize[_0xfde0('0x6')]},'secret':{'type':Sequelize[_0xfde0('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfde0('0x5')]},'providerResponse':{'type':Sequelize[_0xfde0('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 0f2bc7e..291145b 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 _0xd1ad=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','isNil','format','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','manual','channel','event','EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','fullname','internal','interface','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','limit','undefined','count','apply','reject','update','destroy','end','stack','name','send','index','map','WhatsappMessage','fieldName','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','create','body','find','describe','whatsapp-interactions','accept','whatsapp','read'];(function(_0x587cce,_0x39073f){var _0x4dc67a=function(_0x22ad0c){while(--_0x22ad0c){_0x587cce['push'](_0x587cce['shift']());}};_0x4dc67a(++_0x39073f);}(_0xd1ad,0x1d7));var _0xdd1a=function(_0x2118ad,_0xe8e3fd){_0x2118ad=_0x2118ad-0x0;var _0x4b5715=_0xd1ad[_0x2118ad];return _0x4b5715;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd1a('0x0'));var zipdir=require(_0xdd1a('0x1'));var jsonpatch=require(_0xdd1a('0x2'));var rp=require(_0xdd1a('0x3'));var moment=require(_0xdd1a('0x4'));var BPromise=require(_0xdd1a('0x5'));var Mustache=require(_0xdd1a('0x6'));var util=require(_0xdd1a('0x7'));var path=require(_0xdd1a('0x8'));var sox=require(_0xdd1a('0x9'));var csv=require(_0xdd1a('0xa'));var ejs=require(_0xdd1a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd1a('0xc'));var squel=require(_0xdd1a('0xd'));var crypto=require('crypto');var jsforce=require(_0xdd1a('0xe'));var deskjs=require(_0xdd1a('0xf'));var toCsv=require(_0xdd1a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdd1a('0x10'));var qs=require(_0xdd1a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd1a('0x12'));var logger=require(_0xdd1a('0x13'))(_0xdd1a('0x14'));var utils=require(_0xdd1a('0x15'));var config=require(_0xdd1a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd1a('0x17'))['db'];config[_0xdd1a('0x18')]=_[_0xdd1a('0x19')](config['redis'],{'host':_0xdd1a('0x1a'),'port':0x18eb});var socket=require(_0xdd1a('0x1b'))(new Redis(config[_0xdd1a('0x18')]));require(_0xdd1a('0x1c'))[_0xdd1a('0x1d')](socket);var jayson=require(_0xdd1a('0x1e'));var client=jayson['client'][_0xdd1a('0x1f')]({'port':0x232c});var client9002=jayson[_0xdd1a('0x20')][_0xdd1a('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x278c0a,_0x3e27d2,_0x5da72d,_0x2d641c){return new BPromise(function(_0x1ed817,_0x4dc0d3){var _0x2f0a88=_0x2d641c||client;return _0x2f0a88[_0xdd1a('0x21')](_0x278c0a,_0x5da72d)[_0xdd1a('0x22')](function(_0x29d42f){logger['info'](_0xdd1a('0x23'),_0x3e27d2,'request\x20sent');logger[_0xdd1a('0x24')](_0xdd1a('0x25'),_0x3e27d2,_0xdd1a('0x26'),JSON[_0xdd1a('0x27')](_0x29d42f));if(_0x29d42f['error']){if(_0x29d42f[_0xdd1a('0x28')][_0xdd1a('0x29')]===0x1f4){logger[_0xdd1a('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x3e27d2,_0x29d42f[_0xdd1a('0x28')][_0xdd1a('0x2a')]);return _0x4dc0d3(_0x29d42f[_0xdd1a('0x28')][_0xdd1a('0x2a')]);}logger[_0xdd1a('0x28')](_0xdd1a('0x23'),_0x3e27d2,_0x29d42f[_0xdd1a('0x28')]['message']);return _0x1ed817(_0x29d42f[_0xdd1a('0x28')][_0xdd1a('0x2a')]);}else{logger[_0xdd1a('0x2b')]('WhatsappMessage,\x20%s,\x20%s',_0x3e27d2,_0xdd1a('0x26'));_0x1ed817(_0x29d42f[_0xdd1a('0x2c')][_0xdd1a('0x2a')]);}})[_0xdd1a('0x2d')](function(_0x24527e){logger[_0xdd1a('0x28')](_0xdd1a('0x23'),_0x3e27d2,_0x24527e);_0x4dc0d3(_0x24527e);});});}function respondWithStatusCode(_0x3a9522,_0x296206){_0x296206=_0x296206||0xcc;return function(_0x5af205){if(_0x5af205){return _0x3a9522[_0xdd1a('0x2e')](_0x296206);}return _0x3a9522[_0xdd1a('0x2f')](_0x296206)['end']();};}function respondWithResult(_0x5f172f,_0x5db56b){_0x5db56b=_0x5db56b||0xc8;return function(_0x15b632){if(_0x15b632){return _0x5f172f[_0xdd1a('0x2f')](_0x5db56b)[_0xdd1a('0x30')](_0x15b632);}};}function respondWithFilteredResult(_0x1e970c,_0x18df8f){return function(_0x3f338e){if(_0x3f338e){var _0x5a2fab=typeof _0x18df8f[_0xdd1a('0x31')]==='undefined'&&typeof _0x18df8f[_0xdd1a('0x32')]===_0xdd1a('0x33');var _0xab3b95=_0x3f338e[_0xdd1a('0x34')];var _0x18fd78=_0x5a2fab?0x0:_0x18df8f[_0xdd1a('0x31')];var _0x45f452=_0x5a2fab?_0x3f338e[_0xdd1a('0x34')]:_0x18df8f[_0xdd1a('0x31')]+_0x18df8f[_0xdd1a('0x32')];var _0x3c5cde;if(_0x45f452>=_0xab3b95){_0x45f452=_0xab3b95;_0x3c5cde=0xc8;}else{_0x3c5cde=0xce;}_0x1e970c[_0xdd1a('0x2f')](_0x3c5cde);return _0x1e970c['set']('Content-Range',_0x18fd78+'-'+_0x45f452+'/'+_0xab3b95)['json'](_0x3f338e);}return null;};}function patchUpdates(_0x50e0e7){return function(_0xce2a58){try{jsonpatch[_0xdd1a('0x35')](_0xce2a58,_0x50e0e7,!![]);}catch(_0x3cbc99){return BPromise[_0xdd1a('0x36')](_0x3cbc99);}return _0xce2a58['save']();};}function saveUpdates(_0x456d6d,_0x4679c6){return function(_0x14e029){if(_0x14e029){return _0x14e029[_0xdd1a('0x37')](_0x456d6d)[_0xdd1a('0x22')](function(_0x4bc58b){return _0x4bc58b;});}return null;};}function removeEntity(_0x30bb02,_0x4908b2){return function(_0x5edbe1){if(_0x5edbe1){return _0x5edbe1[_0xdd1a('0x38')]()[_0xdd1a('0x22')](function(){_0x30bb02['status'](0xcc)[_0xdd1a('0x39')]();});}};}function handleEntityNotFound(_0x4d6661,_0x535518){return function(_0x5c2f38){if(!_0x5c2f38){_0x4d6661['sendStatus'](0x194);}return _0x5c2f38;};}function handleError(_0x3cb575,_0xc91e4a){_0xc91e4a=_0xc91e4a||0x1f4;return function(_0x5de46a){logger[_0xdd1a('0x28')](_0x5de46a[_0xdd1a('0x3a')]);if(_0x5de46a[_0xdd1a('0x3b')]){delete _0x5de46a['name'];}_0x3cb575[_0xdd1a('0x2f')](_0xc91e4a)[_0xdd1a('0x3c')](_0x5de46a);};}exports[_0xdd1a('0x3d')]=function(_0x5e32b4,_0x35a6db){var _0x10e608={},_0x3c93f3={},_0x3bc0c9={'count':0x0,'rows':[]};var _0x5a9ba7=_[_0xdd1a('0x3e')](db[_0xdd1a('0x3f')]['rawAttributes'],function(_0x187619){return{'name':_0x187619[_0xdd1a('0x40')],'type':_0x187619['type'][_0xdd1a('0x41')]};});_0x3c93f3['model']=_[_0xdd1a('0x3e')](_0x5a9ba7,_0xdd1a('0x3b'));_0x3c93f3[_0xdd1a('0x42')]=_[_0xdd1a('0x43')](_0x5e32b4['query']);_0x3c93f3['filters']=_['intersection'](_0x3c93f3['model'],_0x3c93f3[_0xdd1a('0x42')]);_0x10e608[_0xdd1a('0x44')]=_[_0xdd1a('0x45')](_0x3c93f3[_0xdd1a('0x46')],qs[_0xdd1a('0x47')](_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x47')]));_0x10e608[_0xdd1a('0x44')]=_0x10e608[_0xdd1a('0x44')][_0xdd1a('0x48')]?_0x10e608[_0xdd1a('0x44')]:_0x3c93f3['model'];if(!_0x5e32b4['query'][_0xdd1a('0x49')](_0xdd1a('0x4a'))){_0x10e608['limit']=qs[_0xdd1a('0x32')](_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x32')]);_0x10e608['offset']=qs['offset'](_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x31')]);}_0x10e608[_0xdd1a('0x4b')]=qs[_0xdd1a('0x4c')](_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x4c')]);_0x10e608['where']=qs[_0xdd1a('0x4d')](_['pick'](_0x5e32b4[_0xdd1a('0x42')],_0x3c93f3[_0xdd1a('0x4d')]),_0x5a9ba7);if(_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x4e')]){_0x10e608[_0xdd1a('0x4f')]=_[_0xdd1a('0x50')](_0x10e608[_0xdd1a('0x4f')],{'$or':_[_0xdd1a('0x3e')](_0x5a9ba7,function(_0x4c45fe){if(_0x4c45fe[_0xdd1a('0x51')]!==_0xdd1a('0x52')){var _0x1abedc={};_0x1abedc[_0x4c45fe[_0xdd1a('0x3b')]]={'$like':'%'+_0x5e32b4['query']['filter']+'%'};return _0x1abedc;}})});}_0x10e608=_[_0xdd1a('0x50')]({},_0x10e608,_0x5e32b4['options']);var _0x1cad8d={'where':_0x10e608[_0xdd1a('0x4f')]};return db[_0xdd1a('0x3f')]['count'](_0x1cad8d)['then'](function(_0x8e050b){_0x3bc0c9[_0xdd1a('0x34')]=_0x8e050b;if(_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x53')]){_0x10e608[_0xdd1a('0x54')]=[{'all':!![]}];}return db[_0xdd1a('0x3f')][_0xdd1a('0x55')](_0x10e608);})[_0xdd1a('0x22')](function(_0x1bbead){_0x3bc0c9[_0xdd1a('0x56')]=_0x1bbead;return _0x3bc0c9;})[_0xdd1a('0x22')](respondWithFilteredResult(_0x35a6db,_0x10e608))[_0xdd1a('0x2d')](handleError(_0x35a6db,null));};exports[_0xdd1a('0x57')]=function(_0x23a949,_0x4ee5eb){var _0x37fd5c={'raw':!![],'where':{'id':_0x23a949[_0xdd1a('0x58')]['id']}},_0x57b520={};_0x57b520[_0xdd1a('0x46')]=_['keys'](db[_0xdd1a('0x3f')]['rawAttributes']);_0x57b520['query']=_[_0xdd1a('0x43')](_0x23a949[_0xdd1a('0x42')]);_0x57b520['filters']=_['intersection'](_0x57b520['model'],_0x57b520[_0xdd1a('0x42')]);_0x37fd5c[_0xdd1a('0x44')]=_['intersection'](_0x57b520[_0xdd1a('0x46')],qs[_0xdd1a('0x47')](_0x23a949[_0xdd1a('0x42')]['fields']));_0x37fd5c[_0xdd1a('0x44')]=_0x37fd5c[_0xdd1a('0x44')][_0xdd1a('0x48')]?_0x37fd5c['attributes']:_0x57b520[_0xdd1a('0x46')];if(_0x23a949[_0xdd1a('0x42')][_0xdd1a('0x53')]){_0x37fd5c[_0xdd1a('0x54')]=[{'all':!![]}];}_0x37fd5c=_[_0xdd1a('0x50')]({},_0x37fd5c,_0x23a949['options']);return db[_0xdd1a('0x3f')]['find'](_0x37fd5c)[_0xdd1a('0x22')](handleEntityNotFound(_0x4ee5eb,null))['then'](respondWithResult(_0x4ee5eb,null))['catch'](handleError(_0x4ee5eb,null));};exports[_0xdd1a('0x59')]=function(_0x593298,_0x376555){return db[_0xdd1a('0x3f')][_0xdd1a('0x59')](_0x593298[_0xdd1a('0x5a')],{})[_0xdd1a('0x22')](respondWithResult(_0x376555,0xc9))[_0xdd1a('0x2d')](handleError(_0x376555,null));};exports[_0xdd1a('0x37')]=function(_0x446122,_0x1e1e98){if(_0x446122[_0xdd1a('0x5a')]['id']){delete _0x446122[_0xdd1a('0x5a')]['id'];}return db[_0xdd1a('0x3f')][_0xdd1a('0x5b')]({'where':{'id':_0x446122[_0xdd1a('0x58')]['id']}})['then'](handleEntityNotFound(_0x1e1e98,null))[_0xdd1a('0x22')](saveUpdates(_0x446122[_0xdd1a('0x5a')],null))['then'](respondWithResult(_0x1e1e98,null))[_0xdd1a('0x2d')](handleError(_0x1e1e98,null));};exports[_0xdd1a('0x38')]=function(_0x27f68c,_0x4b8d32){return db[_0xdd1a('0x3f')][_0xdd1a('0x5b')]({'where':{'id':_0x27f68c['params']['id']}})['then'](handleEntityNotFound(_0x4b8d32,null))[_0xdd1a('0x22')](removeEntity(_0x4b8d32,null))['catch'](handleError(_0x4b8d32,null));};exports[_0xdd1a('0x5c')]=function(_0x5ea593,_0x2f8e2c){return db[_0xdd1a('0x3f')][_0xdd1a('0x5c')]()['then'](respondWithResult(_0x2f8e2c,null))[_0xdd1a('0x2d')](handleError(_0x2f8e2c,null));};var interaction_log=require('../../config/logger')(_0xdd1a('0x5d'));exports[_0xdd1a('0x5e')]=function(_0x238ba3,_0x28cd06,_0x490a0f){var _0x491106={'agent':{},'channel':_0xdd1a('0x5f')};if(_0x238ba3[_0xdd1a('0x5a')]['id']){delete _0x238ba3[_0xdd1a('0x5a')]['id'];}_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x60')]=!![];_0x238ba3[_0xdd1a('0x5a')]['readAt']=moment()['format'](_0xdd1a('0x61'));_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x62')]=_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x62')]||_0x238ba3[_0xdd1a('0x63')]['id'];_0x491106[_0xdd1a('0x64')]['id']=_0x238ba3['body']['UserId'];return db[_0xdd1a('0x3f')]['find']({'where':{'id':_0x238ba3['params']['id'],'UserId':null}})[_0xdd1a('0x22')](handleEntityNotFound(_0x28cd06,null))['then'](saveUpdates(_0x238ba3['body'],null))['then'](function(_0x15717c){if(_0x15717c){_0x491106[_0xdd1a('0x2a')]=_0x15717c['get']({'plain':!![]});return db['WhatsappInteraction'][_0xdd1a('0x5b')]({'where':{'id':_0x15717c[_0xdd1a('0x65')]}});}return null;})[_0xdd1a('0x22')](handleEntityNotFound(_0x28cd06,null))[_0xdd1a('0x22')](function(_0x105616){if(_0x105616){return _0x105616[_0xdd1a('0x37')]({'UserId':_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x62')],'read1stAt':_[_0xdd1a('0x66')](_0x105616['read1stAt'])?moment()[_0xdd1a('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdd1a('0x22')](function(_0x484c4e){if(_0x484c4e){_0x491106[_0xdd1a('0x68')]=_0x484c4e[_0xdd1a('0x69')]({'plain':!![]});interaction_log[_0xdd1a('0x2b')](_0xdd1a('0x6a'),_0x238ba3[_0xdd1a('0x63')]['id'],_0x238ba3[_0xdd1a('0x63')][_0xdd1a('0x3b')],_0x238ba3[_0xdd1a('0x63')]['role'],_0x491106['interaction']['id'],_0x238ba3[_0xdd1a('0x5a')]?JSON['stringify'](_0x238ba3[_0xdd1a('0x5a')]):_0xdd1a('0x6b'));return respondWithRpcPromise(_0xdd1a('0x6c'),_0xdd1a('0x6d'),_0x491106);}return null;})[_0xdd1a('0x22')](function(_0x328bfb){var _0x5a3f3a=_0xdd1a('0x6e')+_0x328bfb[_0xdd1a('0x2a')][_0xdd1a('0x6f')];return db[_0xdd1a('0x70')][_0xdd1a('0x42')](_0x5a3f3a,{'type':db[_0xdd1a('0x71')][_0xdd1a('0x72')][_0xdd1a('0x73')],'raw':!![]})['then'](function(_0x4ef8a9){return _0x4ef8a9;});})['then'](function(_0x330a48){if(_0x330a48){_0x491106[_0xdd1a('0x2a')][_0xdd1a('0x74')]=_0x330a48[0x0];if(!_0x238ba3['body'][_0xdd1a('0x62')])return;return db[_0xdd1a('0x75')]['find']({'where':{'id':_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x62')],'role':'agent'},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0xdd1a('0x22')](function(_0x1d50a7){if(!_0x1d50a7)return null;_0x491106[_0xdd1a('0x2a')][_0xdd1a('0x64')]=_0x1d50a7;return _0x491106;})[_0xdd1a('0x22')](function(_0x17a6b4){if(_0x17a6b4){if(_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x76')]){_0x491106['message']['interface']=util[_0xdd1a('0x67')]('SIP/%s',_0x238ba3['user']['name']);_0x491106[_0xdd1a('0x2a')]['channel']=_0x491106[_0xdd1a('0x77')];_0x491106[_0xdd1a('0x2a')][_0xdd1a('0x78')]='accept';return respondWithRpcPromise('EventManager',_0xdd1a('0x79'),{'event':_0xdd1a('0x7a'),'message':_0x491106['message']},client9002)[_0xdd1a('0x22')](function(){return _0x491106;});}return _0x491106;}return null;})[_0xdd1a('0x22')](respondWithResult(_0x28cd06,null))[_0xdd1a('0x2d')](handleError(_0x28cd06,null));};var interaction_log=require('../../config/logger')(_0xdd1a('0x5d'));exports[_0xdd1a('0x36')]=function(_0x32b4d8,_0x46dfce,_0x3d95e3){var _0x376ce1={'agent':{},'channel':_0xdd1a('0x5f')};if(_0x32b4d8[_0xdd1a('0x5a')]['id']){delete _0x32b4d8['body']['id'];}_0x32b4d8[_0xdd1a('0x5a')][_0xdd1a('0x62')]=_0x32b4d8['body']['UserId']||_0x32b4d8['user']['id'];_0x376ce1['agent']['id']=_0x32b4d8[_0xdd1a('0x5a')][_0xdd1a('0x62')];return db[_0xdd1a('0x3f')][_0xdd1a('0x5b')]({'where':{'id':_0x32b4d8[_0xdd1a('0x58')]['id'],'UserId':null}})[_0xdd1a('0x22')](handleEntityNotFound(_0x46dfce,null))[_0xdd1a('0x22')](function(_0x481e53){if(_0x481e53){_0x376ce1[_0xdd1a('0x2a')]=_0x481e53[_0xdd1a('0x69')]({'plain':!![]});return db[_0xdd1a('0x7b')][_0xdd1a('0x5b')]({'where':{'id':_0x481e53['WhatsappInteractionId']}});}return null;})[_0xdd1a('0x22')](handleEntityNotFound(_0x46dfce,null))['then'](function(_0x238555){if(_0x238555){_0x376ce1[_0xdd1a('0x68')]=_0x238555[_0xdd1a('0x69')]({'plain':!![]});interaction_log['info'](_0xdd1a('0x7c'),_0x32b4d8[_0xdd1a('0x63')]['id'],_0x32b4d8['user'][_0xdd1a('0x3b')],_0x32b4d8[_0xdd1a('0x63')][_0xdd1a('0x7d')],_0x376ce1['interaction']['id'],_0x32b4d8[_0xdd1a('0x5a')]?JSON[_0xdd1a('0x27')](_0x32b4d8['body']):_0xdd1a('0x6b'));return respondWithRpcPromise('RejectMessage',_0xdd1a('0x7e'),_0x376ce1);}return null;})[_0xdd1a('0x22')](function(_0x95ac3){var _0x4d4852='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x95ac3[_0xdd1a('0x2a')][_0xdd1a('0x6f')];return db[_0xdd1a('0x70')][_0xdd1a('0x42')](_0x4d4852,{'type':db[_0xdd1a('0x71')][_0xdd1a('0x72')][_0xdd1a('0x73')],'raw':!![]})[_0xdd1a('0x22')](function(_0x4d1e24){return _0x4d1e24;});})[_0xdd1a('0x22')](function(_0x576162){if(_0x576162){_0x376ce1[_0xdd1a('0x2a')][_0xdd1a('0x74')]=_0x576162[0x0];if(!_0x32b4d8[_0xdd1a('0x5a')][_0xdd1a('0x62')])return;return db[_0xdd1a('0x75')][_0xdd1a('0x5b')]({'where':{'id':_0x32b4d8[_0xdd1a('0x5a')]['UserId'],'role':_0xdd1a('0x64')},'attributes':['id','name',_0xdd1a('0x7f'),'email',_0xdd1a('0x80')],'raw':!![]});}return null;})[_0xdd1a('0x22')](function(_0x418b43){if(!_0x418b43)return null;_0x376ce1[_0xdd1a('0x2a')][_0xdd1a('0x64')]=_0x418b43;return _0x376ce1;})[_0xdd1a('0x22')](function(_0x2a224a){if(_0x2a224a){_0x2a224a[_0xdd1a('0x2a')][_0xdd1a('0x81')]=util[_0xdd1a('0x67')](_0xdd1a('0x82'),_0x32b4d8[_0xdd1a('0x63')][_0xdd1a('0x3b')]);_0x2a224a[_0xdd1a('0x2a')][_0xdd1a('0x77')]=_0x376ce1['channel'];_0x2a224a['message'][_0xdd1a('0x78')]=_0xdd1a('0x36');respondWithRpcPromise('EventManager',_0xdd1a('0x79'),{'event':_0xdd1a('0x83'),'message':_0x2a224a[_0xdd1a('0x2a')]},client9002);return _0x376ce1;}return null;})[_0xdd1a('0x22')](respondWithResult(_0x46dfce,null))['catch'](handleError(_0x46dfce,null));};exports[_0xdd1a('0x2f')]=function(_0x4e865a,_0x54a3d8,_0xcf4000){if(_0x4e865a['body']['id']){delete _0x4e865a[_0xdd1a('0x5a')]['id'];}var _0x485088;return db['WhatsappMessage'][_0xdd1a('0x5b')]({'where':{'id':_0x4e865a[_0xdd1a('0x58')]['id']}})[_0xdd1a('0x22')](handleEntityNotFound(_0x54a3d8,null))[_0xdd1a('0x22')](function(_0x447d10){if(_0x447d10){_0x485088=_0x447d10;return db[_0xdd1a('0x84')][_0xdd1a('0x5b')]({'where':{'id':_0x447d10[_0xdd1a('0x85')]}});}})[_0xdd1a('0x22')](handleEntityNotFound(_0x54a3d8,null))[_0xdd1a('0x22')](function(_0x15f3a0){if(_0x15f3a0){logger[_0xdd1a('0x24')](_0xdd1a('0x86'),_0xdd1a('0x2f'),_0xdd1a('0x87'),_0x15f3a0[_0xdd1a('0x51')],util[_0xdd1a('0x88')](_0x4e865a[_0xdd1a('0x5a')],{'showHidden':![],'depth':null}));switch(_0x15f3a0[_0xdd1a('0x51')]){case'twilio':if(_0x4e865a['body'][_0xdd1a('0x89')]&&_0x4e865a['body'][_0xdd1a('0x89')]===_0x485088[_0xdd1a('0x8a')]&&_0x4e865a[_0xdd1a('0x5a')][_0xdd1a('0x8b')]&&_0x4e865a[_0xdd1a('0x5a')][_0xdd1a('0x8b')]===_0xdd1a('0x60')){return _0x485088[_0xdd1a('0x37')]({'read':!![]});}else{logger['error'](_0xdd1a('0x8c'),'status',_0xdd1a('0x8d'),util[_0xdd1a('0x88')](_0x4e865a[_0xdd1a('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x485088;}})[_0xdd1a('0x22')](respondWithResult(_0x54a3d8,null))[_0xdd1a('0x2d')](handleError(_0x54a3d8,null));}; \ No newline at end of file +var _0x64a5=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappMessage.socket','register','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','../../config/logger','whatsapp-interactions','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','SIP/%s','channel','motionChannel','accept','EventManager','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0xa3f3f4,_0x17569d){var _0x45f916=function(_0x1ed339){while(--_0x1ed339){_0xa3f3f4['push'](_0xa3f3f4['shift']());}};_0x45f916(++_0x17569d);}(_0x64a5,0x80));var _0x564a=function(_0x47503c,_0x3aee9b){_0x47503c=_0x47503c-0x0;var _0x2c3de5=_0x64a5[_0x47503c];return _0x2c3de5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x564a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x564a('0x1'));var rp=require(_0x564a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x564a('0x3'));var util=require(_0x564a('0x4'));var path=require(_0x564a('0x5'));var sox=require(_0x564a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x564a('0x7'));var _=require('lodash');var squel=require(_0x564a('0x8'));var crypto=require(_0x564a('0x9'));var jsforce=require(_0x564a('0xa'));var deskjs=require(_0x564a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x564a('0xc'));var Papa=require('papaparse');var Redis=require(_0x564a('0xd'));var authService=require(_0x564a('0xe'));var qs=require(_0x564a('0xf'));var as=require(_0x564a('0x10'));var hardwareService=require(_0x564a('0x11'));var logger=require('../../config/logger')(_0x564a('0x12'));var utils=require('../../config/utils');var config=require(_0x564a('0x13'));var licenseUtil=require(_0x564a('0x14'));var db=require('../../mysqldb')['db'];config[_0x564a('0x15')]=_[_0x564a('0x16')](config[_0x564a('0x15')],{'host':_0x564a('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x564a('0x15')]));require(_0x564a('0x18'))[_0x564a('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x564a('0x1a')]({'port':0x232c});var client9002=jayson[_0x564a('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x967068,_0x66763,_0xa84a3c,_0x5328b4){return new BPromise(function(_0x35286c,_0x430d57){var _0x4e41ec=_0x5328b4||client;return _0x4e41ec[_0x564a('0x1c')](_0x967068,_0xa84a3c)[_0x564a('0x1d')](function(_0x181b2d){logger[_0x564a('0x1e')](_0x564a('0x1f'),_0x66763,'request\x20sent');logger[_0x564a('0x20')](_0x564a('0x21'),_0x66763,_0x564a('0x22'),JSON[_0x564a('0x23')](_0x181b2d));if(_0x181b2d['error']){if(_0x181b2d[_0x564a('0x24')]['code']===0x1f4){logger[_0x564a('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x66763,_0x181b2d[_0x564a('0x24')][_0x564a('0x25')]);return _0x430d57(_0x181b2d[_0x564a('0x24')][_0x564a('0x25')]);}logger[_0x564a('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x66763,_0x181b2d[_0x564a('0x24')][_0x564a('0x25')]);return _0x35286c(_0x181b2d['error'][_0x564a('0x25')]);}else{logger[_0x564a('0x1e')](_0x564a('0x1f'),_0x66763,_0x564a('0x22'));_0x35286c(_0x181b2d[_0x564a('0x26')][_0x564a('0x25')]);}})['catch'](function(_0x4f206c){logger[_0x564a('0x24')](_0x564a('0x1f'),_0x66763,_0x4f206c);_0x430d57(_0x4f206c);});});}function respondWithStatusCode(_0x4974bf,_0x5a5434){_0x5a5434=_0x5a5434||0xcc;return function(_0x17ac66){if(_0x17ac66){return _0x4974bf[_0x564a('0x27')](_0x5a5434);}return _0x4974bf[_0x564a('0x28')](_0x5a5434)[_0x564a('0x29')]();};}function respondWithResult(_0x20d782,_0x3a13c4){_0x3a13c4=_0x3a13c4||0xc8;return function(_0x114d54){if(_0x114d54){return _0x20d782['status'](_0x3a13c4)[_0x564a('0x2a')](_0x114d54);}};}function respondWithFilteredResult(_0x34f923,_0x18ce45){return function(_0x5b7399){if(_0x5b7399){var _0x591392=typeof _0x18ce45[_0x564a('0x2b')]===_0x564a('0x2c')&&typeof _0x18ce45[_0x564a('0x2d')]===_0x564a('0x2c');var _0x2f29a4=_0x5b7399[_0x564a('0x2e')];var _0x12624b=_0x591392?0x0:_0x18ce45[_0x564a('0x2b')];var _0x31bd66=_0x591392?_0x5b7399[_0x564a('0x2e')]:_0x18ce45[_0x564a('0x2b')]+_0x18ce45[_0x564a('0x2d')];var _0x47fa58;if(_0x31bd66>=_0x2f29a4){_0x31bd66=_0x2f29a4;_0x47fa58=0xc8;}else{_0x47fa58=0xce;}_0x34f923['status'](_0x47fa58);return _0x34f923[_0x564a('0x2f')](_0x564a('0x30'),_0x12624b+'-'+_0x31bd66+'/'+_0x2f29a4)[_0x564a('0x2a')](_0x5b7399);}return null;};}function patchUpdates(_0xbe7d53){return function(_0x1e16a4){try{jsonpatch[_0x564a('0x31')](_0x1e16a4,_0xbe7d53,!![]);}catch(_0x3d767c){return BPromise[_0x564a('0x32')](_0x3d767c);}return _0x1e16a4[_0x564a('0x33')]();};}function saveUpdates(_0x962c1e,_0x172104){return function(_0x8a6df6){if(_0x8a6df6){return _0x8a6df6[_0x564a('0x34')](_0x962c1e)[_0x564a('0x1d')](function(_0x1893bb){return _0x1893bb;});}return null;};}function removeEntity(_0x459a1b,_0x24fe4d){return function(_0x3dba1e){if(_0x3dba1e){return _0x3dba1e[_0x564a('0x35')]()[_0x564a('0x1d')](function(){_0x459a1b[_0x564a('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c8b7e,_0x2e0f36){return function(_0x2ab763){if(!_0x2ab763){_0x5c8b7e[_0x564a('0x27')](0x194);}return _0x2ab763;};}function handleError(_0x4ccc7b,_0x507ab9){_0x507ab9=_0x507ab9||0x1f4;return function(_0x46ace5){logger['error'](_0x46ace5[_0x564a('0x36')]);if(_0x46ace5[_0x564a('0x37')]){delete _0x46ace5[_0x564a('0x37')];}_0x4ccc7b[_0x564a('0x28')](_0x507ab9)[_0x564a('0x38')](_0x46ace5);};}exports[_0x564a('0x39')]=function(_0x1b1c8b,_0x316fd1){var _0x5d996f={},_0x667ce4={},_0x180129={'count':0x0,'rows':[]};var _0x37b22d=_[_0x564a('0x3a')](db[_0x564a('0x3b')][_0x564a('0x3c')],function(_0x13dcf4){return{'name':_0x13dcf4['fieldName'],'type':_0x13dcf4[_0x564a('0x3d')][_0x564a('0x3e')]};});_0x667ce4[_0x564a('0x3f')]=_[_0x564a('0x3a')](_0x37b22d,_0x564a('0x37'));_0x667ce4[_0x564a('0x40')]=_[_0x564a('0x41')](_0x1b1c8b[_0x564a('0x40')]);_0x667ce4[_0x564a('0x42')]=_[_0x564a('0x43')](_0x667ce4[_0x564a('0x3f')],_0x667ce4[_0x564a('0x40')]);_0x5d996f['attributes']=_[_0x564a('0x43')](_0x667ce4[_0x564a('0x3f')],qs['fields'](_0x1b1c8b['query'][_0x564a('0x44')]));_0x5d996f[_0x564a('0x45')]=_0x5d996f[_0x564a('0x45')][_0x564a('0x46')]?_0x5d996f[_0x564a('0x45')]:_0x667ce4['model'];if(!_0x1b1c8b[_0x564a('0x40')][_0x564a('0x47')](_0x564a('0x48'))){_0x5d996f[_0x564a('0x2d')]=qs['limit'](_0x1b1c8b[_0x564a('0x40')][_0x564a('0x2d')]);_0x5d996f[_0x564a('0x2b')]=qs[_0x564a('0x2b')](_0x1b1c8b[_0x564a('0x40')][_0x564a('0x2b')]);}_0x5d996f[_0x564a('0x49')]=qs[_0x564a('0x4a')](_0x1b1c8b['query'][_0x564a('0x4a')]);_0x5d996f['where']=qs[_0x564a('0x42')](_['pick'](_0x1b1c8b[_0x564a('0x40')],_0x667ce4[_0x564a('0x42')]),_0x37b22d);if(_0x1b1c8b[_0x564a('0x40')][_0x564a('0x4b')]){_0x5d996f[_0x564a('0x4c')]=_[_0x564a('0x4d')](_0x5d996f['where'],{'$or':_[_0x564a('0x3a')](_0x37b22d,function(_0x249079){if(_0x249079[_0x564a('0x3d')]!==_0x564a('0x4e')){var _0x42c13b={};_0x42c13b[_0x249079[_0x564a('0x37')]]={'$like':'%'+_0x1b1c8b[_0x564a('0x40')][_0x564a('0x4b')]+'%'};return _0x42c13b;}})});}_0x5d996f=_['merge']({},_0x5d996f,_0x1b1c8b[_0x564a('0x4f')]);var _0xa6d59f={'where':_0x5d996f[_0x564a('0x4c')]};return db[_0x564a('0x3b')][_0x564a('0x2e')](_0xa6d59f)['then'](function(_0x373e99){_0x180129[_0x564a('0x2e')]=_0x373e99;if(_0x1b1c8b[_0x564a('0x40')][_0x564a('0x50')]){_0x5d996f[_0x564a('0x51')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x564a('0x52')](_0x5d996f);})['then'](function(_0x30d6e2){_0x180129[_0x564a('0x53')]=_0x30d6e2;return _0x180129;})['then'](respondWithFilteredResult(_0x316fd1,_0x5d996f))[_0x564a('0x54')](handleError(_0x316fd1,null));};exports[_0x564a('0x55')]=function(_0x24203c,_0x5696b7){var _0x2f6052={'raw':!![],'where':{'id':_0x24203c[_0x564a('0x56')]['id']}},_0x4f01a2={};_0x4f01a2[_0x564a('0x3f')]=_[_0x564a('0x41')](db[_0x564a('0x3b')][_0x564a('0x3c')]);_0x4f01a2['query']=_[_0x564a('0x41')](_0x24203c[_0x564a('0x40')]);_0x4f01a2[_0x564a('0x42')]=_['intersection'](_0x4f01a2[_0x564a('0x3f')],_0x4f01a2[_0x564a('0x40')]);_0x2f6052['attributes']=_[_0x564a('0x43')](_0x4f01a2[_0x564a('0x3f')],qs['fields'](_0x24203c['query'][_0x564a('0x44')]));_0x2f6052[_0x564a('0x45')]=_0x2f6052[_0x564a('0x45')][_0x564a('0x46')]?_0x2f6052[_0x564a('0x45')]:_0x4f01a2[_0x564a('0x3f')];if(_0x24203c[_0x564a('0x40')][_0x564a('0x50')]){_0x2f6052['include']=[{'all':!![]}];}_0x2f6052=_[_0x564a('0x4d')]({},_0x2f6052,_0x24203c['options']);return db[_0x564a('0x3b')][_0x564a('0x57')](_0x2f6052)[_0x564a('0x1d')](handleEntityNotFound(_0x5696b7,null))['then'](respondWithResult(_0x5696b7,null))[_0x564a('0x54')](handleError(_0x5696b7,null));};exports[_0x564a('0x58')]=function(_0x423b06,_0x36e0c6){return db[_0x564a('0x3b')][_0x564a('0x58')](_0x423b06['body'],{})[_0x564a('0x1d')](respondWithResult(_0x36e0c6,0xc9))['catch'](handleError(_0x36e0c6,null));};exports[_0x564a('0x34')]=function(_0x12ced7,_0x32002b){if(_0x12ced7[_0x564a('0x59')]['id']){delete _0x12ced7[_0x564a('0x59')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x12ced7[_0x564a('0x56')]['id']}})[_0x564a('0x1d')](handleEntityNotFound(_0x32002b,null))[_0x564a('0x1d')](saveUpdates(_0x12ced7[_0x564a('0x59')],null))[_0x564a('0x1d')](respondWithResult(_0x32002b,null))['catch'](handleError(_0x32002b,null));};exports[_0x564a('0x35')]=function(_0x5ea8d4,_0x5591a8){return db[_0x564a('0x3b')][_0x564a('0x57')]({'where':{'id':_0x5ea8d4['params']['id']}})[_0x564a('0x1d')](handleEntityNotFound(_0x5591a8,null))[_0x564a('0x1d')](removeEntity(_0x5591a8,null))[_0x564a('0x54')](handleError(_0x5591a8,null));};exports[_0x564a('0x5a')]=function(_0x4531a0,_0x2db3b4){return db[_0x564a('0x3b')][_0x564a('0x5a')]()[_0x564a('0x1d')](respondWithResult(_0x2db3b4,null))[_0x564a('0x54')](handleError(_0x2db3b4,null));};var interaction_log=require(_0x564a('0x5b'))(_0x564a('0x5c'));exports['accept']=function(_0x2d8022,_0x54be82,_0x528d1b){var _0x3c3c7d={'agent':{},'channel':_0x564a('0x5d')};if(_0x2d8022['body']['id']){delete _0x2d8022[_0x564a('0x59')]['id'];}_0x2d8022['body'][_0x564a('0x5e')]=!![];_0x2d8022[_0x564a('0x59')][_0x564a('0x5f')]=moment()['format'](_0x564a('0x60'));_0x2d8022[_0x564a('0x59')]['UserId']=_0x2d8022[_0x564a('0x59')]['UserId']||_0x2d8022['user']['id'];_0x3c3c7d['agent']['id']=_0x2d8022[_0x564a('0x59')][_0x564a('0x61')];return db[_0x564a('0x3b')][_0x564a('0x57')]({'where':{'id':_0x2d8022[_0x564a('0x56')]['id'],'UserId':null}})[_0x564a('0x1d')](handleEntityNotFound(_0x54be82,null))[_0x564a('0x1d')](saveUpdates(_0x2d8022[_0x564a('0x59')],null))['then'](function(_0x16f2da){if(_0x16f2da){_0x3c3c7d['message']=_0x16f2da['get']({'plain':!![]});return db[_0x564a('0x62')][_0x564a('0x57')]({'where':{'id':_0x16f2da[_0x564a('0x63')]}});}return null;})[_0x564a('0x1d')](handleEntityNotFound(_0x54be82,null))['then'](function(_0x72f5d5){if(_0x72f5d5){return _0x72f5d5[_0x564a('0x34')]({'UserId':_0x2d8022[_0x564a('0x59')][_0x564a('0x61')],'read1stAt':_[_0x564a('0x64')](_0x72f5d5[_0x564a('0x65')])?moment()[_0x564a('0x66')](_0x564a('0x60')):undefined});}return null;})[_0x564a('0x1d')](function(_0x5d0735){if(_0x5d0735){_0x3c3c7d['interaction']=_0x5d0735[_0x564a('0x67')]({'plain':!![]});interaction_log[_0x564a('0x1e')](_0x564a('0x68'),_0x2d8022[_0x564a('0x69')]['id'],_0x2d8022['user'][_0x564a('0x37')],_0x2d8022['user'][_0x564a('0x6a')],_0x3c3c7d['interaction']['id'],_0x2d8022[_0x564a('0x59')]?JSON[_0x564a('0x23')](_0x2d8022[_0x564a('0x59')]):'null');return respondWithRpcPromise(_0x564a('0x6b'),_0x564a('0x6c'),_0x3c3c7d);}return null;})[_0x564a('0x1d')](function(_0x1fdfd6){var _0x51b3f7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1fdfd6[_0x564a('0x25')][_0x564a('0x6d')];return db[_0x564a('0x6e')][_0x564a('0x40')](_0x51b3f7,{'type':db[_0x564a('0x6f')][_0x564a('0x70')][_0x564a('0x71')],'raw':!![]})[_0x564a('0x1d')](function(_0x12b1b4){return _0x12b1b4;});})[_0x564a('0x1d')](function(_0x506b91){if(_0x506b91){_0x3c3c7d[_0x564a('0x25')][_0x564a('0x72')]=_0x506b91[0x0];if(!_0x2d8022['body'][_0x564a('0x61')])return;return db[_0x564a('0x73')][_0x564a('0x57')]({'where':{'id':_0x2d8022[_0x564a('0x59')][_0x564a('0x61')],'role':'agent'},'attributes':['id','name',_0x564a('0x74'),_0x564a('0x75'),_0x564a('0x76')],'raw':!![]});}return null;})[_0x564a('0x1d')](function(_0x345fa4){if(!_0x345fa4)return null;_0x3c3c7d[_0x564a('0x25')][_0x564a('0x77')]=_0x345fa4;return _0x3c3c7d;})[_0x564a('0x1d')](function(_0x579479){if(_0x579479){if(_0x2d8022[_0x564a('0x59')]['manual']){_0x3c3c7d['message']['interface']=util[_0x564a('0x66')](_0x564a('0x78'),_0x2d8022[_0x564a('0x69')]['name']);_0x3c3c7d[_0x564a('0x25')][_0x564a('0x79')]=_0x3c3c7d[_0x564a('0x79')];_0x3c3c7d[_0x564a('0x25')][_0x564a('0x7a')]=_0x3c3c7d[_0x564a('0x79')];_0x3c3c7d[_0x564a('0x25')]['event']=_0x564a('0x7b');return respondWithRpcPromise(_0x564a('0x7c'),_0x564a('0x7c'),{'event':'acceptmessage','message':_0x3c3c7d['message']},client9002)[_0x564a('0x1d')](function(){return _0x3c3c7d;});}return _0x3c3c7d;}return null;})['then'](respondWithResult(_0x54be82,null))[_0x564a('0x54')](handleError(_0x54be82,null));};var interaction_log=require(_0x564a('0x5b'))(_0x564a('0x5c'));exports[_0x564a('0x32')]=function(_0x208874,_0x2afce0,_0x312aab){var _0x31bdad={'agent':{},'channel':_0x564a('0x5d')};if(_0x208874[_0x564a('0x59')]['id']){delete _0x208874[_0x564a('0x59')]['id'];}_0x208874[_0x564a('0x59')][_0x564a('0x61')]=_0x208874[_0x564a('0x59')][_0x564a('0x61')]||_0x208874[_0x564a('0x69')]['id'];_0x31bdad[_0x564a('0x77')]['id']=_0x208874[_0x564a('0x59')][_0x564a('0x61')];return db[_0x564a('0x3b')][_0x564a('0x57')]({'where':{'id':_0x208874['params']['id'],'UserId':null}})[_0x564a('0x1d')](handleEntityNotFound(_0x2afce0,null))['then'](function(_0x1ce6e8){if(_0x1ce6e8){_0x31bdad[_0x564a('0x25')]=_0x1ce6e8[_0x564a('0x67')]({'plain':!![]});return db['WhatsappInteraction'][_0x564a('0x57')]({'where':{'id':_0x1ce6e8[_0x564a('0x63')]}});}return null;})[_0x564a('0x1d')](handleEntityNotFound(_0x2afce0,null))[_0x564a('0x1d')](function(_0x2c3cdb){if(_0x2c3cdb){_0x31bdad[_0x564a('0x7d')]=_0x2c3cdb['get']({'plain':!![]});interaction_log[_0x564a('0x1e')](_0x564a('0x7e'),_0x208874[_0x564a('0x69')]['id'],_0x208874[_0x564a('0x69')]['name'],_0x208874[_0x564a('0x69')]['role'],_0x31bdad[_0x564a('0x7d')]['id'],_0x208874['body']?JSON[_0x564a('0x23')](_0x208874[_0x564a('0x59')]):_0x564a('0x7f'));return respondWithRpcPromise(_0x564a('0x80'),_0x564a('0x81'),_0x31bdad);}return null;})[_0x564a('0x1d')](function(_0x26a9be){var _0x413b31='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26a9be[_0x564a('0x25')]['ContactId'];return db[_0x564a('0x6e')][_0x564a('0x40')](_0x413b31,{'type':db[_0x564a('0x6f')][_0x564a('0x70')][_0x564a('0x71')],'raw':!![]})['then'](function(_0x21da29){return _0x21da29;});})[_0x564a('0x1d')](function(_0x26342e){if(_0x26342e){_0x31bdad[_0x564a('0x25')][_0x564a('0x72')]=_0x26342e[0x0];if(!_0x208874[_0x564a('0x59')][_0x564a('0x61')])return;return db[_0x564a('0x73')][_0x564a('0x57')]({'where':{'id':_0x208874[_0x564a('0x59')][_0x564a('0x61')],'role':_0x564a('0x77')},'attributes':['id',_0x564a('0x37'),_0x564a('0x74'),'email',_0x564a('0x76')],'raw':!![]});}return null;})[_0x564a('0x1d')](function(_0x570227){if(!_0x570227)return null;_0x31bdad[_0x564a('0x25')][_0x564a('0x77')]=_0x570227;return _0x31bdad;})[_0x564a('0x1d')](function(_0x511e03){if(_0x511e03){_0x511e03[_0x564a('0x25')][_0x564a('0x82')]=util[_0x564a('0x66')](_0x564a('0x78'),_0x208874[_0x564a('0x69')][_0x564a('0x37')]);_0x511e03[_0x564a('0x25')]['channel']=_0x31bdad['channel'];_0x511e03[_0x564a('0x25')]['motionChannel']=_0x31bdad[_0x564a('0x79')];_0x511e03['message']['event']=_0x564a('0x32');respondWithRpcPromise(_0x564a('0x7c'),_0x564a('0x7c'),{'event':'rejectmessage','message':_0x511e03[_0x564a('0x25')]},client9002);return _0x31bdad;}return null;})['then'](respondWithResult(_0x2afce0,null))[_0x564a('0x54')](handleError(_0x2afce0,null));};exports[_0x564a('0x28')]=function(_0x1d8359,_0x5bbb21,_0x4bf11f){if(_0x1d8359[_0x564a('0x59')]['id']){delete _0x1d8359[_0x564a('0x59')]['id'];}var _0xd85ab5;return db['WhatsappMessage']['find']({'where':{'id':_0x1d8359['params']['id']}})['then'](handleEntityNotFound(_0x5bbb21,null))[_0x564a('0x1d')](function(_0x5051d8){if(_0x5051d8){_0xd85ab5=_0x5051d8;return db[_0x564a('0x83')][_0x564a('0x57')]({'where':{'id':_0x5051d8[_0x564a('0x84')]}});}})['then'](handleEntityNotFound(_0x5bbb21,null))[_0x564a('0x1d')](function(_0x47524a){if(_0x47524a){logger[_0x564a('0x20')](_0x564a('0x85'),_0x564a('0x28'),_0x564a('0x86'),_0x47524a['type'],util[_0x564a('0x87')](_0x1d8359[_0x564a('0x59')],{'showHidden':![],'depth':null}));switch(_0x47524a[_0x564a('0x3d')]){case _0x564a('0x88'):if(_0x1d8359['body'][_0x564a('0x89')]&&_0x1d8359[_0x564a('0x59')][_0x564a('0x89')]===_0xd85ab5[_0x564a('0x8a')]&&_0x1d8359[_0x564a('0x59')][_0x564a('0x8b')]&&_0x1d8359[_0x564a('0x59')][_0x564a('0x8b')]===_0x564a('0x5e')){return _0xd85ab5[_0x564a('0x34')]({'read':!![]});}else{logger[_0x564a('0x24')](_0x564a('0x8c'),_0x564a('0x28'),_0x564a('0x88'),util[_0x564a('0x87')](_0x1d8359['body'],{'showHidden':![],'depth':null}));}break;}return _0xd85ab5;}})['then'](respondWithResult(_0x5bbb21,null))['catch'](handleError(_0x5bbb21,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index baa201f..272975e 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 _0x4bde=['hook','events','../../mysqldb','WhatsappMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x5c80ad,_0x4d009a){var _0x531595=function(_0x4fda55){while(--_0x4fda55){_0x5c80ad['push'](_0x5c80ad['shift']());}};_0x531595(++_0x4d009a);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x5501b9,_0x5e9477){_0x5501b9=_0x5501b9-0x0;var _0x10e83f=_0x4bde[_0x5501b9];return _0x10e83f;};'use strict';var EventEmitter=require(_0xe4bd('0x0'));var WhatsappMessage=require(_0xe4bd('0x1'))['db'][_0xe4bd('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe4bd('0x3'),'afterUpdate':_0xe4bd('0x4'),'afterDestroy':_0xe4bd('0x5')};function emitEvent(_0x3108bd){return function(_0x5741e5,_0x210d47,_0x1b8621){WhatsappMessageEvents[_0xe4bd('0x6')](_0x3108bd+':'+_0x5741e5['id'],_0x5741e5);WhatsappMessageEvents[_0xe4bd('0x6')](_0x3108bd,_0x5741e5);_0x1b8621(null);};}for(var e in events){if(events[_0xe4bd('0x7')](e)){var event=events[e];WhatsappMessage[_0xe4bd('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x55f1=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappMessage','setMaxListeners','save','update'];(function(_0x3e0225,_0x1ddbb9){var _0x57259f=function(_0x548597){while(--_0x548597){_0x3e0225['push'](_0x3e0225['shift']());}};_0x57259f(++_0x1ddbb9);}(_0x55f1,0x9b));var _0x155f=function(_0x319c39,_0x48b266){_0x319c39=_0x319c39-0x0;var _0x4e85df=_0x55f1[_0x319c39];return _0x4e85df;};'use strict';var EventEmitter=require(_0x155f('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x155f('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x155f('0x2')](0x0);var events={'afterCreate':_0x155f('0x3'),'afterUpdate':_0x155f('0x4'),'afterDestroy':_0x155f('0x5')};function emitEvent(_0x13e2af){return function(_0x2089cc,_0x5c3d6c,_0x5cd807){WhatsappMessageEvents[_0x155f('0x6')](_0x13e2af+':'+_0x2089cc['id'],_0x2089cc);WhatsappMessageEvents['emit'](_0x13e2af,_0x2089cc);_0x5cd807(null);};}for(var e in events){if(events[_0x155f('0x7')](e)){var event=events[e];WhatsappMessage[_0x155f('0x8')](e,emitEvent(event));}}module[_0x155f('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 0450c35..32b39d9 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 _0x6a24=['whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappMessage.attributes','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0x6a24,0xd1));var _0x46a2=function(_0x3dfe02,_0x17c046){_0x3dfe02=_0x3dfe02-0x0;var _0x48ab66=_0x6a24[_0x3dfe02];return _0x48ab66;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var logger=require('../../config/logger')(_0x46a2('0x2'));var moment=require(_0x46a2('0x3'));var BPromise=require(_0x46a2('0x4'));var rp=require(_0x46a2('0x5'));var fs=require('fs');var path=require(_0x46a2('0x6'));var rimraf=require('rimraf');var config=require(_0x46a2('0x7'));var attributes=require(_0x46a2('0x8'));module['exports']=function(_0x22de0d,_0x8b6541){return _0x22de0d['define']('WhatsappMessage',attributes,{'tableName':_0x46a2('0x9'),'paranoid':![],'indexes':[{'name':_0x46a2('0xa'),'fields':['messageId']},{'name':_0x46a2('0xb'),'fields':['body'],'type':_0x46a2('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5086ae,_0x34c0cf,_0x6e22ae){var _0x21d1f3=_0x22de0d[_0x46a2('0xd')];var _0x35e6d9=_0x5086ae[_0x46a2('0xe')]({'plain':!![]});if(_0x35e6d9[_0x46a2('0xf')][_0x46a2('0x10')]()==='in'||_0x35e6d9['direction']['toLowerCase']()===_0x46a2('0x11')&&!_0x35e6d9[_0x46a2('0x12')]&&!_['isNil'](_0x35e6d9[_0x46a2('0x13')])){_0x21d1f3[_0x46a2('0x14')][_0x46a2('0x15')]({'where':{'id':_0x35e6d9[_0x46a2('0x16')]}})[_0x46a2('0x17')](function(_0x2fd383){if(_0x2fd383){_0x2fd383[_0x46a2('0x18')]({'lastMsgAt':_0x35e6d9[_0x46a2('0x19')],'lastMsgDirection':_0x35e6d9['direction']['toLowerCase']()});}})[_0x46a2('0x1a')](function(_0x2deb20){console['error'](_0x2deb20);});}if(_0x35e6d9[_0x46a2('0xf')]===_0x46a2('0x11')&&!_0x35e6d9['secret']){var _0xa2eb96;_0x21d1f3[_0x46a2('0x1b')]['find']({'where':{'id':_0x35e6d9[_0x46a2('0x1c')]},'raw':!![]})[_0x46a2('0x17')](function(_0x529bb5){_0xa2eb96=_0x529bb5;if(_0xa2eb96&&_0xa2eb96[_0x46a2('0x1d')]){switch(_0xa2eb96[_0x46a2('0x1d')]){case _0x46a2('0x1e'):var _0xc28d15=require(_0x46a2('0x1e'));if(_0xa2eb96[_0x46a2('0x1f')]&&_0xa2eb96[_0x46a2('0x20')]&&_0xa2eb96[_0x46a2('0x21')]){var _0x2d65c2=new _0xc28d15(_0xa2eb96[_0x46a2('0x1f')],_0xa2eb96[_0x46a2('0x20')]);_0x2d65c2[_0x46a2('0x22')][_0x46a2('0x23')]({'body':_0x35e6d9['body'],'to':_0x46a2('0x24')+_0x35e6d9['phone'],'from':_0x46a2('0x24')+_0xa2eb96[_0x46a2('0x21')],'statusCallback':_0xa2eb96['remote']+_0x46a2('0x25')+_0x35e6d9['id']+_0x46a2('0x26')+_0xa2eb96[_0x46a2('0x27')]})[_0x46a2('0x17')](function(_0x4d50f5){if(_0x4d50f5[_0x46a2('0x28')]){return _0x5086ae[_0x46a2('0x18')]({'messageId':_0x4d50f5[_0x46a2('0x28')]});}})[_0x46a2('0x1a')](function(_0x74bb6a){logger[_0x46a2('0x29')](_0x46a2('0x2a'),_0x46a2('0x2b'),_0x46a2('0x1e'),util[_0x46a2('0x2c')](_0x74bb6a,{'showHidden':![],'depth':null}));});}else{logger[_0x46a2('0x29')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x46a2('0x2b'),_0x46a2('0x1e'),_0x46a2('0x2d'));}break;}}})[_0x46a2('0x2e')](function(){_0x6e22ae();});}else{_0x6e22ae();}}},'charset':_0x46a2('0x2f'),'collate':_0x46a2('0x30')});}; \ No newline at end of file +var _0x5668=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','FULLTEXT','get','out','secret','isNil','UserId','WhatsappInteraction','createdAt','direction','toLowerCase','catch','WhatsappAccount','find','WhatsappAccountId','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x7000b3,_0x1b4543){var _0x43485c=function(_0x30830d){while(--_0x30830d){_0x7000b3['push'](_0x7000b3['shift']());}};_0x43485c(++_0x1b4543);}(_0x5668,0x8b));var _0x8566=function(_0x43b4de,_0x573680){_0x43b4de=_0x43b4de-0x0;var _0x3a19d4=_0x5668[_0x43b4de];return _0x3a19d4;};'use strict';var _=require(_0x8566('0x0'));var util=require(_0x8566('0x1'));var logger=require(_0x8566('0x2'))(_0x8566('0x3'));var moment=require(_0x8566('0x4'));var BPromise=require(_0x8566('0x5'));var rp=require(_0x8566('0x6'));var fs=require('fs');var path=require(_0x8566('0x7'));var rimraf=require(_0x8566('0x8'));var config=require(_0x8566('0x9'));var attributes=require(_0x8566('0xa'));module[_0x8566('0xb')]=function(_0x2f958c,_0x4885d6){return _0x2f958c[_0x8566('0xc')](_0x8566('0xd'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x8566('0xe')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x8566('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47c21f,_0x3eb676,_0x4736e5){var _0x19cd09=_0x2f958c['models'];var _0x199b75=_0x47c21f[_0x8566('0x10')]({'plain':!![]});if(_0x199b75['direction']['toLowerCase']()==='in'||_0x199b75['direction']['toLowerCase']()===_0x8566('0x11')&&!_0x199b75[_0x8566('0x12')]&&!_[_0x8566('0x13')](_0x199b75[_0x8566('0x14')])){_0x19cd09[_0x8566('0x15')]['findOne']({'where':{'id':_0x199b75['WhatsappInteractionId']}})['then'](function(_0x489470){if(_0x489470){_0x489470['update']({'lastMsgAt':_0x199b75[_0x8566('0x16')],'lastMsgDirection':_0x199b75[_0x8566('0x17')][_0x8566('0x18')]()});}})[_0x8566('0x19')](function(_0x39faee){console['error'](_0x39faee);});}if(_0x199b75[_0x8566('0x17')]===_0x8566('0x11')&&!_0x199b75[_0x8566('0x12')]){var _0x4e20a2;_0x19cd09[_0x8566('0x1a')][_0x8566('0x1b')]({'where':{'id':_0x199b75[_0x8566('0x1c')]},'raw':!![]})['then'](function(_0x41cb27){_0x4e20a2=_0x41cb27;if(_0x4e20a2&&_0x4e20a2['type']){switch(_0x4e20a2['type']){case _0x8566('0x1d'):var _0x5e9ca7=require(_0x8566('0x1d'));if(_0x4e20a2['accountSid']&&_0x4e20a2[_0x8566('0x1e')]&&_0x4e20a2[_0x8566('0x1f')]){var _0x43fc7c=new _0x5e9ca7(_0x4e20a2[_0x8566('0x20')],_0x4e20a2[_0x8566('0x1e')]);_0x43fc7c[_0x8566('0x21')][_0x8566('0x22')]({'body':_0x199b75['body'],'to':'whatsapp:'+_0x199b75[_0x8566('0x1f')],'from':_0x8566('0x23')+_0x4e20a2[_0x8566('0x1f')],'statusCallback':_0x4e20a2[_0x8566('0x24')]+'/api/whatsapp/messages/'+_0x199b75['id']+_0x8566('0x25')+_0x4e20a2[_0x8566('0x26')]})['then'](function(_0x3f6fce){if(_0x3f6fce[_0x8566('0x27')]){return _0x47c21f['update']({'messageId':_0x3f6fce[_0x8566('0x27')]});}})[_0x8566('0x19')](function(_0x18ee17){logger['error'](_0x8566('0x28'),_0x8566('0x29'),_0x8566('0x1d'),util[_0x8566('0x2a')](_0x18ee17,{'showHidden':![],'depth':null}));});}else{logger[_0x8566('0x2b')](_0x8566('0x28'),_0x8566('0x29'),'twilio',_0x8566('0x2c'));}break;}}})[_0x8566('0x2d')](function(){_0x4736e5();});}else{_0x4736e5();}}},'charset':_0x8566('0x2e'),'collate':_0x8566('0x2f')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f01232c..f9fd0e9 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 _0x3452=['localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappMessage','create','body','options','CreateWhatsappMessage','debug','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','http','redis','defaults'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3452,0x6f));var _0x2345=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x3452[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x2345('0x0'));var moment=require('moment');var BPromise=require(_0x2345('0x1'));var rs=require(_0x2345('0x2'));var fs=require('fs');var Redis=require(_0x2345('0x3'));var db=require(_0x2345('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2345('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2345('0x6')]({'port':0x232a});config[_0x2345('0x7')]=_[_0x2345('0x8')](config[_0x2345('0x7')],{'host':_0x2345('0x9'),'port':0x18eb});var socket=require(_0x2345('0xa'))(new Redis(config[_0x2345('0x7')]));require(_0x2345('0xb'))[_0x2345('0xc')](socket);function respondWithRpcPromise(_0x6115fc,_0x5b2107,_0x57ef57){return new BPromise(function(_0x22b86f,_0x5b09b3){return client['request'](_0x6115fc,_0x57ef57)[_0x2345('0xd')](function(_0x3cb373){logger[_0x2345('0xe')](_0x2345('0xf'),_0x5b2107,_0x2345('0x10'));logger['debug'](_0x2345('0x11'),_0x5b2107,_0x2345('0x10'),JSON[_0x2345('0x12')](_0x3cb373));if(_0x3cb373[_0x2345('0x13')]){if(_0x3cb373[_0x2345('0x13')][_0x2345('0x14')]===0x1f4){logger[_0x2345('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x5b2107,_0x3cb373[_0x2345('0x13')][_0x2345('0x15')]);return _0x5b09b3(_0x3cb373[_0x2345('0x13')][_0x2345('0x15')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5b2107,_0x3cb373['error']['message']);return _0x22b86f(_0x3cb373[_0x2345('0x13')]['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x5b2107,_0x2345('0x10'));_0x22b86f(_0x3cb373[_0x2345('0x16')][_0x2345('0x15')]);}})[_0x2345('0x17')](function(_0x116cc2){logger[_0x2345('0x13')](_0x2345('0xf'),_0x5b2107,_0x116cc2);_0x5b09b3(_0x116cc2);});});}exports['CreateWhatsappMessage']=function(_0x47b94d){var _0x176c0a=this;return new Promise(function(_0x46db8a,_0x32ad3f){return db[_0x2345('0x18')][_0x2345('0x19')](_0x47b94d[_0x2345('0x1a')],{'raw':_0x47b94d[_0x2345('0x1b')]?_0x47b94d['options']['raw']===undefined?!![]:![]:!![]})[_0x2345('0xd')](function(_0x1ef635){logger[_0x2345('0xe')](_0x2345('0x1c'),_0x47b94d);logger[_0x2345('0x1d')](_0x2345('0x1c'),_0x47b94d,JSON['stringify'](_0x1ef635));_0x46db8a(_0x1ef635);})['catch'](function(_0x4c4617){logger[_0x2345('0x13')](_0x2345('0x1c'),_0x4c4617[_0x2345('0x15')],_0x47b94d);_0x32ad3f(_0x176c0a['error'](0x1f4,_0x4c4617['message']));});});}; \ No newline at end of file +var _0xeb30=['defaults','localhost','socket.io-emitter','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2f2d68,_0x3b4808){var _0x442f01=function(_0xdb46e7){while(--_0xdb46e7){_0x2f2d68['push'](_0x2f2d68['shift']());}};_0x442f01(++_0x3b4808);}(_0xeb30,0x13d));var _0x0eb3=function(_0x5293ce,_0x2fc552){_0x5293ce=_0x5293ce-0x0;var _0x2ac6ac=_0xeb30[_0x5293ce];return _0x2ac6ac;};'use strict';var _=require(_0x0eb3('0x0'));var util=require('util');var moment=require(_0x0eb3('0x1'));var BPromise=require(_0x0eb3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0eb3('0x3'));var db=require(_0x0eb3('0x4'))['db'];var utils=require(_0x0eb3('0x5'));var logger=require(_0x0eb3('0x6'))(_0x0eb3('0x7'));var config=require(_0x0eb3('0x8'));var jayson=require(_0x0eb3('0x9'));var client=jayson[_0x0eb3('0xa')][_0x0eb3('0xb')]({'port':0x232a});config[_0x0eb3('0xc')]=_[_0x0eb3('0xd')](config[_0x0eb3('0xc')],{'host':_0x0eb3('0xe'),'port':0x18eb});var socket=require(_0x0eb3('0xf'))(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4e2ab8,_0x3ba048,_0x1e9d9d){return new BPromise(function(_0x4ace3c,_0x40d072){return client[_0x0eb3('0x10')](_0x4e2ab8,_0x1e9d9d)[_0x0eb3('0x11')](function(_0x4d38fc){logger[_0x0eb3('0x12')](_0x0eb3('0x13'),_0x3ba048,'request\x20sent');logger[_0x0eb3('0x14')](_0x0eb3('0x15'),_0x3ba048,_0x0eb3('0x16'),JSON[_0x0eb3('0x17')](_0x4d38fc));if(_0x4d38fc[_0x0eb3('0x18')]){if(_0x4d38fc[_0x0eb3('0x18')][_0x0eb3('0x19')]===0x1f4){logger['error'](_0x0eb3('0x13'),_0x3ba048,_0x4d38fc[_0x0eb3('0x18')][_0x0eb3('0x1a')]);return _0x40d072(_0x4d38fc[_0x0eb3('0x18')][_0x0eb3('0x1a')]);}logger[_0x0eb3('0x18')](_0x0eb3('0x13'),_0x3ba048,_0x4d38fc[_0x0eb3('0x18')][_0x0eb3('0x1a')]);return _0x4ace3c(_0x4d38fc['error'][_0x0eb3('0x1a')]);}else{logger[_0x0eb3('0x12')](_0x0eb3('0x13'),_0x3ba048,_0x0eb3('0x16'));_0x4ace3c(_0x4d38fc[_0x0eb3('0x1b')][_0x0eb3('0x1a')]);}})[_0x0eb3('0x1c')](function(_0x21bafa){logger[_0x0eb3('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x3ba048,_0x21bafa);_0x40d072(_0x21bafa);});});}exports[_0x0eb3('0x1d')]=function(_0x5d4cec){var _0x5d19e0=this;return new Promise(function(_0xea996c,_0x40c905){return db[_0x0eb3('0x1e')][_0x0eb3('0x1f')](_0x5d4cec['body'],{'raw':_0x5d4cec['options']?_0x5d4cec[_0x0eb3('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x0eb3('0x11')](function(_0x4c1270){logger[_0x0eb3('0x12')]('CreateWhatsappMessage',_0x5d4cec);logger[_0x0eb3('0x14')](_0x0eb3('0x1d'),_0x5d4cec,JSON[_0x0eb3('0x17')](_0x4c1270));_0xea996c(_0x4c1270);})['catch'](function(_0x3ec9dd){logger[_0x0eb3('0x18')](_0x0eb3('0x1d'),_0x3ec9dd[_0x0eb3('0x1a')],_0x5d4cec);_0x40c905(_0x5d19e0[_0x0eb3('0x18')](0x1f4,_0x3ec9dd[_0x0eb3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index d590f10..f179286 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 _0xa5d1=['remove','update','emit','register','length','./whatsappMessage.events'];(function(_0x3128da,_0x4498ac){var _0x41f15d=function(_0x192e87){while(--_0x192e87){_0x3128da['push'](_0x3128da['shift']());}};_0x41f15d(++_0x4498ac);}(_0xa5d1,0x161));var _0x1a5d=function(_0x13aa65,_0x5282e9){_0x13aa65=_0x13aa65-0x0;var _0x641fbb=_0xa5d1[_0x13aa65];return _0x641fbb;};'use strict';var WhatsappMessageEvents=require(_0x1a5d('0x0'));var events=['save',_0x1a5d('0x1'),_0x1a5d('0x2')];function createListener(_0x4c887d,_0x56c30d){return function(_0x4b6fd0){_0x56c30d[_0x1a5d('0x3')](_0x4c887d,_0x4b6fd0);};}function removeListener(_0x442442,_0x4a6d1b){return function(){WhatsappMessageEvents['removeListener'](_0x442442,_0x4a6d1b);};}exports[_0x1a5d('0x4')]=function(_0x5bc5ca){for(var _0x174262=0x0,_0x11b379=events[_0x1a5d('0x5')];_0x174262<_0x11b379;_0x174262++){var _0x50a5bc=events[_0x174262];var _0x3fe3f8=createListener('whatsappMessage:'+_0x50a5bc,_0x5bc5ca);WhatsappMessageEvents['on'](_0x50a5bc,_0x3fe3f8);}}; \ No newline at end of file +var _0x4b8a=['whatsappMessage:','./whatsappMessage.events','save','emit','removeListener','length'];(function(_0x3a5065,_0x1dfb9f){var _0x4e1cef=function(_0x224918){while(--_0x224918){_0x3a5065['push'](_0x3a5065['shift']());}};_0x4e1cef(++_0x1dfb9f);}(_0x4b8a,0x187));var _0xa4b8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4b8a[_0x5b644e];return _0x49c6bf;};'use strict';var WhatsappMessageEvents=require(_0xa4b8('0x0'));var events=[_0xa4b8('0x1'),'remove','update'];function createListener(_0x5b2bfb,_0x50b208){return function(_0x441d7d){_0x50b208[_0xa4b8('0x2')](_0x5b2bfb,_0x441d7d);};}function removeListener(_0x3eed21,_0x1f9dbd){return function(){WhatsappMessageEvents[_0xa4b8('0x3')](_0x3eed21,_0x1f9dbd);};}exports['register']=function(_0xaa380c){for(var _0x2a6d9b=0x0,_0x4741b5=events[_0xa4b8('0x4')];_0x2a6d9b<_0x4741b5;_0x2a6d9b++){var _0x19abc4=events[_0x2a6d9b];var _0x3b1825=createListener(_0xa4b8('0x5')+_0x19abc4,_0xaa380c);WhatsappMessageEvents['on'](_0x19abc4,_0x3b1825);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 62db844..542990d 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 _0xe91b=['/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers'];(function(_0x4570c6,_0x4e1a32){var _0x27d7a4=function(_0x1adb8e){while(--_0x1adb8e){_0x4570c6['push'](_0x4570c6['shift']());}};_0x27d7a4(++_0x4e1a32);}(_0xe91b,0xce));var _0xbe91=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0xe91b[_0x31b5b2];return _0x364f13;};'use strict';var multer=require(_0xbe91('0x0'));var util=require(_0xbe91('0x1'));var path=require(_0xbe91('0x2'));var timeout=require(_0xbe91('0x3'));var express=require(_0xbe91('0x4'));var router=express[_0xbe91('0x5')]();var fs_extra=require(_0xbe91('0x6'));var auth=require(_0xbe91('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbe91('0x8'));var controller=require('./whatsappQueue.controller');router[_0xbe91('0x9')]('/',auth['isAuthenticated'](),controller[_0xbe91('0xa')]);router[_0xbe91('0x9')](_0xbe91('0xb'),auth[_0xbe91('0xc')](),controller[_0xbe91('0xd')]);router[_0xbe91('0x9')](_0xbe91('0xe'),auth[_0xbe91('0xc')](),controller[_0xbe91('0xf')]);router[_0xbe91('0x9')](_0xbe91('0x10'),auth['isAuthenticated'](),controller[_0xbe91('0x11')]);router['get'](_0xbe91('0x12'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x13')]);router[_0xbe91('0x9')](_0xbe91('0x14'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x15')]);router[_0xbe91('0x16')]('/',auth[_0xbe91('0xc')](),controller[_0xbe91('0x17')]);router[_0xbe91('0x16')](_0xbe91('0x12'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x18')]);router[_0xbe91('0x16')](_0xbe91('0x14'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x19')]);router[_0xbe91('0x1a')](_0xbe91('0xe'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x1b')]);router['delete'](_0xbe91('0xe'),auth['isAuthenticated'](),controller[_0xbe91('0x1c')]);router[_0xbe91('0x1d')](_0xbe91('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0xbe91('0x14'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x1e')]);module[_0xbe91('0x1f')]=router; \ No newline at end of file +var _0x039f=['get','describe','/:id','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index'];(function(_0x54a1d8,_0x464a72){var _0x34b435=function(_0x6d3798){while(--_0x6d3798){_0x54a1d8['push'](_0x54a1d8['shift']());}};_0x34b435(++_0x464a72);}(_0x039f,0x90));var _0xf039=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x039f[_0x3e32a8];return _0x2997b0;};'use strict';var multer=require(_0xf039('0x0'));var util=require('util');var path=require(_0xf039('0x1'));var timeout=require(_0xf039('0x2'));var express=require(_0xf039('0x3'));var router=express[_0xf039('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf039('0x5'));var config=require(_0xf039('0x6'));var controller=require(_0xf039('0x7'));router['get']('/',auth[_0xf039('0x8')](),controller[_0xf039('0x9')]);router[_0xf039('0xa')]('/describe',auth[_0xf039('0x8')](),controller[_0xf039('0xb')]);router['get'](_0xf039('0xc'),auth[_0xf039('0x8')](),controller['show']);router[_0xf039('0xa')]('/:id/members',auth[_0xf039('0x8')](),controller['getMembers']);router['get'](_0xf039('0xd'),auth['isAuthenticated'](),controller[_0xf039('0xe')]);router['get'](_0xf039('0xf'),auth[_0xf039('0x8')](),controller['getAgents']);router[_0xf039('0x10')]('/',auth[_0xf039('0x8')](),controller[_0xf039('0x11')]);router['post'](_0xf039('0xd'),auth[_0xf039('0x8')](),controller[_0xf039('0x12')]);router[_0xf039('0x10')](_0xf039('0xf'),auth[_0xf039('0x8')](),controller['addAgents']);router[_0xf039('0x13')](_0xf039('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf039('0x14')](_0xf039('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xf039('0x14')](_0xf039('0xd'),auth[_0xf039('0x8')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xf039('0x8')](),controller['removeAgents']);module[_0xf039('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 3ec8871..e21d31a 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 _0x1f38=['exports','STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f38,0xd7));var _0x81f3=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0x1f38[_0xf04c6d];return _0x4a804e;};'use strict';var Sequelize=require(_0x81f3('0x0'));module[_0x81f3('0x1')]={'name':{'type':Sequelize[_0x81f3('0x2')],'unique':_0x81f3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x81f3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x81f3('0x5')]('rrmemory',_0x81f3('0x6'),_0x81f3('0x7'))},'description':{'type':Sequelize[_0x81f3('0x2')]}}; \ No newline at end of file +var _0x38a5=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0xcc06cd,_0x3d2cff){var _0x25f721=function(_0x53f537){while(--_0x53f537){_0xcc06cd['push'](_0xcc06cd['shift']());}};_0x25f721(++_0x3d2cff);}(_0x38a5,0x69));var _0x538a=function(_0xd1c582,_0x16adb5){_0xd1c582=_0xd1c582-0x0;var _0x385ba0=_0x38a5[_0xd1c582];return _0x385ba0;};'use strict';var Sequelize=require(_0x538a('0x0'));module[_0x538a('0x1')]={'name':{'type':Sequelize[_0x538a('0x2')],'unique':_0x538a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x538a('0x4')](_0x538a('0x5'),_0x538a('0x6'),_0x538a('0x7'))},'description':{'type':Sequelize[_0x538a('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 7eeba16..d66bc0f 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 _0xaa40=['model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','WhatsappQueue','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','filter','User','findAndCountAll','agent','whatsappPause','format','SIP','createdAt','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','union','compact','value','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key'];(function(_0xe32bc8,_0x44287e){var _0x1ff259=function(_0x4706d6){while(--_0x4706d6){_0xe32bc8['push'](_0xe32bc8['shift']());}};_0x1ff259(++_0x44287e);}(_0xaa40,0x173));var _0x0aa4=function(_0x5e75e4,_0x469fb9){_0x5e75e4=_0x5e75e4-0x0;var _0x289bd9=_0xaa40[_0x5e75e4];return _0x289bd9;};'use strict';var emlformat=require(_0x0aa4('0x0'));var rimraf=require(_0x0aa4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0aa4('0x2'));var rp=require(_0x0aa4('0x3'));var moment=require(_0x0aa4('0x4'));var BPromise=require(_0x0aa4('0x5'));var Mustache=require(_0x0aa4('0x6'));var util=require(_0x0aa4('0x7'));var path=require(_0x0aa4('0x8'));var sox=require(_0x0aa4('0x9'));var csv=require(_0x0aa4('0xa'));var ejs=require(_0x0aa4('0xb'));var fs=require('fs');var fs_extra=require(_0x0aa4('0xc'));var _=require(_0x0aa4('0xd'));var squel=require(_0x0aa4('0xe'));var crypto=require(_0x0aa4('0xf'));var jsforce=require(_0x0aa4('0x10'));var deskjs=require(_0x0aa4('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0aa4('0x12'));var Papa=require('papaparse');var Redis=require(_0x0aa4('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0aa4('0x14'));var logger=require(_0x0aa4('0x15'))(_0x0aa4('0x16'));var utils=require(_0x0aa4('0x17'));var config=require(_0x0aa4('0x18'));var licenseUtil=require(_0x0aa4('0x19'));var db=require(_0x0aa4('0x1a'))['db'];config['redis']=_[_0x0aa4('0x1b')](config[_0x0aa4('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0aa4('0x1d'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x559df4,_0x295a93){_0x295a93=_0x295a93||0xcc;return function(_0x4e335d){if(_0x4e335d){return _0x559df4[_0x0aa4('0x1e')](_0x295a93);}return _0x559df4[_0x0aa4('0x1f')](_0x295a93)[_0x0aa4('0x20')]();};}function respondWithResult(_0x5bef82,_0x11432b){_0x11432b=_0x11432b||0xc8;return function(_0x5bc4b9){if(_0x5bc4b9){return _0x5bef82[_0x0aa4('0x1f')](_0x11432b)[_0x0aa4('0x21')](_0x5bc4b9);}};}function respondWithFilteredResult(_0x59a56b,_0x48e77e){return function(_0x2d8e44){if(_0x2d8e44){var _0x1757b5=typeof _0x48e77e['offset']===_0x0aa4('0x22')&&typeof _0x48e77e['limit']===_0x0aa4('0x22');var _0xeb3516=_0x2d8e44[_0x0aa4('0x23')];var _0x27a231=_0x1757b5?0x0:_0x48e77e['offset'];var _0x50aca8=_0x1757b5?_0x2d8e44[_0x0aa4('0x23')]:_0x48e77e[_0x0aa4('0x24')]+_0x48e77e[_0x0aa4('0x25')];var _0x9c0d73;if(_0x50aca8>=_0xeb3516){_0x50aca8=_0xeb3516;_0x9c0d73=0xc8;}else{_0x9c0d73=0xce;}_0x59a56b[_0x0aa4('0x1f')](_0x9c0d73);return _0x59a56b[_0x0aa4('0x26')](_0x0aa4('0x27'),_0x27a231+'-'+_0x50aca8+'/'+_0xeb3516)[_0x0aa4('0x21')](_0x2d8e44);}return null;};}function patchUpdates(_0x3197b1){return function(_0x3344fd){try{jsonpatch[_0x0aa4('0x28')](_0x3344fd,_0x3197b1,!![]);}catch(_0xd4cad6){return BPromise[_0x0aa4('0x29')](_0xd4cad6);}return _0x3344fd[_0x0aa4('0x2a')]();};}function saveUpdates(_0x3e2560,_0x49276b){return function(_0xa4ccaa){if(_0xa4ccaa){return _0xa4ccaa[_0x0aa4('0x2b')](_0x3e2560)['then'](function(_0x210473){return _0x210473;});}return null;};}function removeEntity(_0x3169a2,_0x22296b){return function(_0x3e0525){if(_0x3e0525){return _0x3e0525['destroy']()[_0x0aa4('0x2c')](function(){var _0x2789e5=_0x3e0525[_0x0aa4('0x2d')]({'plain':!![]});var _0x94f52b=_0x0aa4('0x2e');return db[_0x0aa4('0x2f')][_0x0aa4('0x30')]({'where':{'type':_0x94f52b,'resourceId':_0x2789e5['id']}})[_0x0aa4('0x2c')](function(){return _0x3e0525;});})['then'](function(){_0x3169a2[_0x0aa4('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40ecc0,_0x49b619){return function(_0x2eb6e0){if(!_0x2eb6e0){_0x40ecc0[_0x0aa4('0x1e')](0x194);}return _0x2eb6e0;};}function handleError(_0x1ccf62,_0xeda27b){_0xeda27b=_0xeda27b||0x1f4;return function(_0x395acf){logger[_0x0aa4('0x31')](_0x395acf[_0x0aa4('0x32')]);if(_0x395acf['name']){delete _0x395acf[_0x0aa4('0x33')];}_0x1ccf62['status'](_0xeda27b)['send'](_0x395acf);};}exports[_0x0aa4('0x34')]=function(_0x3d554a,_0x49782f){var _0x4e13a8={},_0x16ee39={},_0x27b078={'count':0x0,'rows':[]};var _0x58d964=_[_0x0aa4('0x35')](db['WhatsappQueue'][_0x0aa4('0x36')],function(_0xef9ea1){return{'name':_0xef9ea1[_0x0aa4('0x37')],'type':_0xef9ea1[_0x0aa4('0x38')][_0x0aa4('0x39')]};});_0x16ee39[_0x0aa4('0x3a')]=_[_0x0aa4('0x35')](_0x58d964,_0x0aa4('0x33'));_0x16ee39['query']=_[_0x0aa4('0x3b')](_0x3d554a['query']);_0x16ee39[_0x0aa4('0x3c')]=_[_0x0aa4('0x3d')](_0x16ee39[_0x0aa4('0x3a')],_0x16ee39[_0x0aa4('0x3e')]);_0x4e13a8['attributes']=_[_0x0aa4('0x3d')](_0x16ee39[_0x0aa4('0x3a')],qs[_0x0aa4('0x3f')](_0x3d554a[_0x0aa4('0x3e')][_0x0aa4('0x3f')]));_0x4e13a8[_0x0aa4('0x40')]=_0x4e13a8['attributes'][_0x0aa4('0x41')]?_0x4e13a8[_0x0aa4('0x40')]:_0x16ee39[_0x0aa4('0x3a')];if(!_0x3d554a['query'][_0x0aa4('0x42')](_0x0aa4('0x43'))){_0x4e13a8[_0x0aa4('0x25')]=qs[_0x0aa4('0x25')](_0x3d554a[_0x0aa4('0x3e')]['limit']);_0x4e13a8[_0x0aa4('0x24')]=qs[_0x0aa4('0x24')](_0x3d554a[_0x0aa4('0x3e')]['offset']);}_0x4e13a8[_0x0aa4('0x44')]=qs['sort'](_0x3d554a[_0x0aa4('0x3e')][_0x0aa4('0x45')]);_0x4e13a8[_0x0aa4('0x46')]=qs[_0x0aa4('0x3c')](_[_0x0aa4('0x47')](_0x3d554a['query'],_0x16ee39[_0x0aa4('0x3c')]),_0x58d964);if(_0x3d554a[_0x0aa4('0x3e')]['filter']){_0x4e13a8['where']=_[_0x0aa4('0x48')](_0x4e13a8[_0x0aa4('0x46')],{'$or':_[_0x0aa4('0x35')](_0x58d964,function(_0x1c4ada){if(_0x1c4ada[_0x0aa4('0x38')]!==_0x0aa4('0x49')){var _0x5b0140={};_0x5b0140[_0x1c4ada[_0x0aa4('0x33')]]={'$like':'%'+_0x3d554a['query']['filter']+'%'};return _0x5b0140;}})});}_0x4e13a8=_[_0x0aa4('0x48')]({},_0x4e13a8,_0x3d554a[_0x0aa4('0x4a')]);var _0x48902c={'where':_0x4e13a8[_0x0aa4('0x46')]};return db[_0x0aa4('0x4b')][_0x0aa4('0x23')](_0x48902c)[_0x0aa4('0x2c')](function(_0x49f709){_0x27b078[_0x0aa4('0x23')]=_0x49f709;if(_0x3d554a[_0x0aa4('0x3e')][_0x0aa4('0x4c')]){_0x4e13a8[_0x0aa4('0x4d')]=[{'all':!![]}];}return db[_0x0aa4('0x4b')][_0x0aa4('0x4e')](_0x4e13a8);})[_0x0aa4('0x2c')](function(_0x236c55){_0x27b078[_0x0aa4('0x4f')]=_0x236c55;return _0x27b078;})[_0x0aa4('0x2c')](respondWithFilteredResult(_0x49782f,_0x4e13a8))[_0x0aa4('0x50')](handleError(_0x49782f,null));};exports[_0x0aa4('0x51')]=function(_0x473a19,_0x3c6808){var _0x5307c7={'raw':!![],'where':{'id':_0x473a19[_0x0aa4('0x52')]['id']}},_0x2cbe81={};_0x2cbe81['model']=_[_0x0aa4('0x3b')](db[_0x0aa4('0x4b')]['rawAttributes']);_0x2cbe81[_0x0aa4('0x3e')]=_['keys'](_0x473a19['query']);_0x2cbe81[_0x0aa4('0x3c')]=_[_0x0aa4('0x3d')](_0x2cbe81['model'],_0x2cbe81[_0x0aa4('0x3e')]);_0x5307c7['attributes']=_[_0x0aa4('0x3d')](_0x2cbe81[_0x0aa4('0x3a')],qs[_0x0aa4('0x3f')](_0x473a19[_0x0aa4('0x3e')][_0x0aa4('0x3f')]));_0x5307c7[_0x0aa4('0x40')]=_0x5307c7['attributes']['length']?_0x5307c7['attributes']:_0x2cbe81[_0x0aa4('0x3a')];if(_0x473a19[_0x0aa4('0x3e')][_0x0aa4('0x4c')]){_0x5307c7[_0x0aa4('0x4d')]=[{'all':!![]}];}_0x5307c7=_['merge']({},_0x5307c7,_0x473a19[_0x0aa4('0x4a')]);return db['WhatsappQueue']['find'](_0x5307c7)[_0x0aa4('0x2c')](handleEntityNotFound(_0x3c6808,null))[_0x0aa4('0x2c')](respondWithResult(_0x3c6808,null))[_0x0aa4('0x50')](handleError(_0x3c6808,null));};exports[_0x0aa4('0x53')]=function(_0x2e64d7,_0x34b960){return db[_0x0aa4('0x4b')][_0x0aa4('0x53')](_0x2e64d7[_0x0aa4('0x54')],{})[_0x0aa4('0x2c')](function(_0x468717){var _0x52afa2=_0x2e64d7['user'][_0x0aa4('0x2d')]({'plain':!![]});if(!_0x52afa2)throw new Error(_0x0aa4('0x55'));if(_0x52afa2['role']===_0x0aa4('0x56')){var _0x2f5ff0=_0x468717[_0x0aa4('0x2d')]({'plain':!![]});var _0x1208c1=_0x0aa4('0x2e');return db['UserProfileSection'][_0x0aa4('0x57')]({'where':{'name':_0x1208c1,'userProfileId':_0x52afa2[_0x0aa4('0x58')]},'raw':!![]})[_0x0aa4('0x2c')](function(_0x31adc5){if(_0x31adc5&&_0x31adc5[_0x0aa4('0x59')]===0x0){return db['UserProfileResource'][_0x0aa4('0x53')]({'name':_0x2f5ff0[_0x0aa4('0x33')],'resourceId':_0x2f5ff0['id'],'type':_0x31adc5[_0x0aa4('0x33')],'sectionId':_0x31adc5['id']},{})['then'](function(){return _0x468717;});}else{return _0x468717;}})['catch'](function(_0x45c9cb){logger[_0x0aa4('0x31')](_0x0aa4('0x5a'),_0x45c9cb);throw _0x45c9cb;});}return _0x468717;})['then'](respondWithResult(_0x34b960,0xc9))['catch'](handleError(_0x34b960,null));};exports[_0x0aa4('0x2b')]=function(_0x47157d,_0x38bf20){if(_0x47157d[_0x0aa4('0x54')]['id']){delete _0x47157d[_0x0aa4('0x54')]['id'];}return db[_0x0aa4('0x4b')][_0x0aa4('0x57')]({'where':{'id':_0x47157d[_0x0aa4('0x52')]['id']}})['then'](handleEntityNotFound(_0x38bf20,null))['then'](saveUpdates(_0x47157d[_0x0aa4('0x54')],null))[_0x0aa4('0x2c')](respondWithResult(_0x38bf20,null))[_0x0aa4('0x50')](handleError(_0x38bf20,null));};exports[_0x0aa4('0x30')]=function(_0x7c01f,_0x5b4c07){return db[_0x0aa4('0x4b')][_0x0aa4('0x57')]({'where':{'id':_0x7c01f[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0x5b4c07,null))[_0x0aa4('0x2c')](removeEntity(_0x5b4c07,null))['catch'](handleError(_0x5b4c07,null));};exports[_0x0aa4('0x5b')]=function(_0x2a3511,_0x1ab965){return db[_0x0aa4('0x4b')][_0x0aa4('0x5b')]()[_0x0aa4('0x2c')](respondWithResult(_0x1ab965,null))[_0x0aa4('0x50')](handleError(_0x1ab965,null));};exports[_0x0aa4('0x5c')]=function(_0x3297fe,_0x3c7c94,_0x1b4049){var _0x181d0d={'raw':!![],'where':{}},_0x1895ac={},_0x4cf7ec;return db[_0x0aa4('0x4b')]['findOne']({'where':{'id':_0x3297fe[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0x3c7c94,null))[_0x0aa4('0x2c')](function(_0x1ffee3){if(_0x1ffee3){_0x4cf7ec=_0x1ffee3['get']({'plain':!![]});_0x1895ac['model']=_[_0x0aa4('0x3b')](db[_0x0aa4('0x5d')][_0x0aa4('0x36')]);_0x1895ac['query']=_['keys'](_0x3297fe[_0x0aa4('0x3e')]);_0x1895ac[_0x0aa4('0x3c')]=_[_0x0aa4('0x3d')](_0x1895ac['model'],_0x1895ac['query']);_0x181d0d[_0x0aa4('0x40')]=_[_0x0aa4('0x3d')](_0x1895ac[_0x0aa4('0x3a')],qs[_0x0aa4('0x3f')](_0x3297fe[_0x0aa4('0x3e')][_0x0aa4('0x3f')]));_0x181d0d[_0x0aa4('0x40')]=_0x181d0d[_0x0aa4('0x40')][_0x0aa4('0x41')]?_0x181d0d[_0x0aa4('0x40')]:_0x1895ac[_0x0aa4('0x3a')];if(!_0x3297fe[_0x0aa4('0x3e')][_0x0aa4('0x42')](_0x0aa4('0x43'))){_0x181d0d[_0x0aa4('0x25')]=qs['limit'](_0x3297fe[_0x0aa4('0x3e')][_0x0aa4('0x25')]);_0x181d0d['offset']=qs[_0x0aa4('0x24')](_0x3297fe[_0x0aa4('0x3e')]['offset']);}_0x181d0d['order']=qs['sort'](_0x3297fe['query'][_0x0aa4('0x45')]);_0x181d0d['where']=qs[_0x0aa4('0x3c')](_[_0x0aa4('0x47')](_0x3297fe[_0x0aa4('0x3e')],_0x1895ac['filters']));_0x181d0d[_0x0aa4('0x46')][_0x0aa4('0x5e')]=_0x1ffee3['id'];if(_0x3297fe['query']['filter']){_0x181d0d[_0x0aa4('0x46')]=_[_0x0aa4('0x48')](_0x181d0d[_0x0aa4('0x46')],{'$or':_[_0x0aa4('0x35')](_0x181d0d[_0x0aa4('0x40')],function(_0x2c6221){var _0x537706={};_0x537706[_0x2c6221]={'$like':'%'+_0x3297fe['query'][_0x0aa4('0x5f')]+'%'};return _0x537706;})});}_0x181d0d=_[_0x0aa4('0x48')]({},_0x181d0d,_0x3297fe['options']);return db[_0x0aa4('0x5d')]['findAll'](_0x181d0d);}})[_0x0aa4('0x2c')](function(_0x276d94){if(_0x276d94){return db[_0x0aa4('0x60')][_0x0aa4('0x61')]({'where':{'id':_[_0x0aa4('0x35')](_0x276d94,'UserId'),'role':_0x0aa4('0x62')},'attributes':['id',_0x0aa4('0x33'),_0x0aa4('0x63'),'updatedAt','createdAt']});}})[_0x0aa4('0x2c')](function(_0x55f8a9){if(_0x55f8a9){return{'count':_0x55f8a9[_0x0aa4('0x23')],'rows':_['map'](_0x55f8a9[_0x0aa4('0x4f')],function(_0x385f4b){return{'membername':_0x385f4b[_0x0aa4('0x33')],'UserId':_0x385f4b['id'],'queue_name':_0x4cf7ec[_0x0aa4('0x33')],'WhatsappQueueId':_0x4cf7ec['id'],'interface':util[_0x0aa4('0x64')]('%s/%s',_0x0aa4('0x65'),_0x385f4b[_0x0aa4('0x33')]),'penalty':0x0,'paused':_0x385f4b[_0x0aa4('0x63')],'createdAt':_0x385f4b[_0x0aa4('0x66')],'updatedAt':_0x385f4b[_0x0aa4('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0aa4('0x2c')](respondWithFilteredResult(_0x3c7c94,_0x181d0d))[_0x0aa4('0x50')](handleError(_0x3c7c94,null));};exports[_0x0aa4('0x68')]=function(_0x57c1d9,_0x831fd0,_0x4280c1){var _0xf28b9e={};var _0x2e5ee9={};var _0x3ba313;var _0x11d02e;return db[_0x0aa4('0x4b')][_0x0aa4('0x69')]({'where':{'id':_0x57c1d9['params']['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0x831fd0,null))[_0x0aa4('0x2c')](function(_0x1cdb95){if(_0x1cdb95){_0x3ba313=_0x1cdb95;_0x2e5ee9['model']=_[_0x0aa4('0x3b')](db[_0x0aa4('0x6a')][_0x0aa4('0x36')]);_0x2e5ee9['query']=_[_0x0aa4('0x3b')](_0x57c1d9['query']);_0x2e5ee9[_0x0aa4('0x3c')]=_[_0x0aa4('0x3d')](_0x2e5ee9[_0x0aa4('0x3a')],_0x2e5ee9[_0x0aa4('0x3e')]);_0xf28b9e['attributes']=_[_0x0aa4('0x3d')](_0x2e5ee9[_0x0aa4('0x3a')],qs[_0x0aa4('0x3f')](_0x57c1d9[_0x0aa4('0x3e')][_0x0aa4('0x3f')]));_0xf28b9e[_0x0aa4('0x40')]=_0xf28b9e['attributes'][_0x0aa4('0x41')]?_0xf28b9e[_0x0aa4('0x40')]:_0x2e5ee9[_0x0aa4('0x3a')];_0xf28b9e[_0x0aa4('0x44')]=qs[_0x0aa4('0x45')](_0x57c1d9[_0x0aa4('0x3e')][_0x0aa4('0x45')]);_0xf28b9e['where']=qs[_0x0aa4('0x3c')](_['pick'](_0x57c1d9['query'],_0x2e5ee9['filters']));if(_0x57c1d9[_0x0aa4('0x3e')][_0x0aa4('0x5f')]){_0xf28b9e[_0x0aa4('0x46')]=_[_0x0aa4('0x48')](_0xf28b9e[_0x0aa4('0x46')],{'$or':_[_0x0aa4('0x35')](_0xf28b9e['attributes'],function(_0x212b9b){var _0x519052={};_0x519052[_0x212b9b]={'$like':'%'+_0x57c1d9[_0x0aa4('0x3e')]['filter']+'%'};return _0x519052;})});}_0xf28b9e=_[_0x0aa4('0x48')]({},_0xf28b9e,_0x57c1d9[_0x0aa4('0x4a')]);return _0x3ba313['getTeams'](_0xf28b9e);}})[_0x0aa4('0x2c')](function(_0x92e033){if(_0x92e033){_0x11d02e=_0x92e033[_0x0aa4('0x41')];if(!_0x57c1d9[_0x0aa4('0x3e')][_0x0aa4('0x42')](_0x0aa4('0x43'))){_0xf28b9e[_0x0aa4('0x25')]=qs[_0x0aa4('0x25')](_0x57c1d9[_0x0aa4('0x3e')]['limit']);_0xf28b9e[_0x0aa4('0x24')]=qs[_0x0aa4('0x24')](_0x57c1d9[_0x0aa4('0x3e')][_0x0aa4('0x24')]);}return _0x3ba313[_0x0aa4('0x68')](_0xf28b9e);}})[_0x0aa4('0x2c')](function(_0x36fced){if(_0x36fced){return _0x36fced?{'count':_0x11d02e,'rows':_0x36fced}:null;}})[_0x0aa4('0x2c')](respondWithResult(_0x831fd0,null))[_0x0aa4('0x50')](handleError(_0x831fd0,null));};exports[_0x0aa4('0x6b')]=function(_0x264b24,_0x40d4d3,_0xe32158){var _0x3f6f28=_0x264b24['body'][_0x0aa4('0x6c')];return db[_0x0aa4('0x6a')][_0x0aa4('0x4e')]({'where':{'id':_0x3f6f28},'attributes':['id'],'include':[{'model':db[_0x0aa4('0x60')],'as':_0x0aa4('0x6d'),'attributes':['id',_0x0aa4('0x33'),_0x0aa4('0x6e'),_0x0aa4('0x6f'),_0x0aa4('0x70')],'raw':!![]}]})[_0x0aa4('0x2c')](function(_0x3efdca){if(_0x3efdca){var _0x4e61bd=_[_0x0aa4('0x71')](_0x3efdca,function(_0x5c292c){var _0x868fa0=_0x5c292c[_0x0aa4('0x2d')]({'plain':!![]});return _0x868fa0[_0x0aa4('0x6d')];});return db[_0x0aa4('0x4b')][_0x0aa4('0x57')]({'where':{'id':_0x264b24[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](function(_0x3c714f){return db[_0x0aa4('0x72')]['transaction'](function(_0x46bdbc){return _0x3c714f[_0x0aa4('0x6b')](_0x3f6f28,{'transaction':_0x46bdbc})[_0x0aa4('0x2c')](function(){return BPromise[_0x0aa4('0x73')](_0x4e61bd,function(_0x46a366){return db[_0x0aa4('0x5d')][_0x0aa4('0x74')]({'where':{'UserId':_0x46a366['id'],'WhatsappQueueId':_0x264b24['params']['id']},'transaction':_0x46bdbc});});})['then'](function(){_0x4e61bd['forEach'](function(_0x7c3816){socket[_0x0aa4('0x75')](_0x0aa4('0x76'),{'UserId':_0x7c3816['id'],'WhatsappQueueId':_0x3c714f['id']});});});});});}})[_0x0aa4('0x2c')](respondWithStatusCode(_0x40d4d3,null))[_0x0aa4('0x50')](handleError(_0x40d4d3,null));};exports[_0x0aa4('0x77')]=function(_0x7c7688,_0xfc3b00,_0x240299){return db[_0x0aa4('0x6a')][_0x0aa4('0x4e')]({'where':{'id':_0x7c7688[_0x0aa4('0x3e')][_0x0aa4('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x0aa4('0x60')],'as':_0x0aa4('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x0aa4('0x2c')](handleEntityNotFound(_0xfc3b00,null))[_0x0aa4('0x2c')](function(_0x126ddb){var _0x51df87=_['map'](_0x126ddb,'id');var _0x1eb3f9=[];var _0x58af83=[];var _0x40b2df=squel['select']();_0x40b2df[_0x0aa4('0x78')](_0x0aa4('0x79'))['from']('team_has_whatsapp_queues','tq')['join']('user_has_teams','ut',_0x0aa4('0x7a'))[_0x0aa4('0x46')](_0x0aa4('0x7b'),_0x7c7688[_0x0aa4('0x52')]['id']);for(var _0x38ca8f=0x0;_0x38ca8f<_0x126ddb[_0x0aa4('0x41')];_0x38ca8f+=0x1){let _0x372f8b=_0x126ddb[_0x38ca8f];for(var _0x26d109=0x0;_0x26d109<_0x372f8b[_0x0aa4('0x6d')][_0x0aa4('0x41')];_0x26d109+=0x1){let _0x28e2a4=_0x372f8b[_0x0aa4('0x6d')][_0x26d109];var _0x1ecfba=_0x40b2df[_0x0aa4('0x7c')]();_0x1ecfba['where'](_0x0aa4('0x7d'),_0x28e2a4['id']);_0x58af83[_0x0aa4('0x7e')](db[_0x0aa4('0x72')][_0x0aa4('0x3e')](_0x1ecfba[_0x0aa4('0x7f')](),{'type':db[_0x0aa4('0x72')][_0x0aa4('0x80')][_0x0aa4('0x81')]})[_0x0aa4('0x2c')](function(_0x26d995){if(_0x26d995[_0x0aa4('0x41')]===0x1){return _0x28e2a4['id'];}else{var _0x1331f9=_['every'](_[_0x0aa4('0x35')](_0x26d995,'TeamId'),function(_0x42fdd9){return _[_0x0aa4('0x82')](_0x51df87,_0x42fdd9);});if(_0x1331f9){return _0x28e2a4['id'];}}}));}}return BPromise['all'](_0x58af83)['then'](function(_0x459f05){_0x1eb3f9=_(_0x1eb3f9)[_0x0aa4('0x83')](_0x459f05)[_0x0aa4('0x84')]()[_0x0aa4('0x85')]();return db[_0x0aa4('0x4b')][_0x0aa4('0x57')]({'where':{'id':_0x7c7688[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](function(_0x2226f7){return db[_0x0aa4('0x72')]['transaction'](function(_0x37e823){return _0x2226f7['removeTeams'](_0x7c7688[_0x0aa4('0x3e')][_0x0aa4('0x6c')],{'transaction':_0x37e823})[_0x0aa4('0x2c')](function(){if(!_[_0x0aa4('0x86')](_0x1eb3f9)){return _0x2226f7[_0x0aa4('0x87')](_0x1eb3f9,{'transaction':_0x37e823});}})[_0x0aa4('0x2c')](function(){_0x1eb3f9[_0x0aa4('0x88')](function(_0x5bc64c){socket['emit'](_0x0aa4('0x89'),{'UserId':_0x5bc64c,'WhatsappQueueId':_0x2226f7['id']});});});});});});})[_0x0aa4('0x2c')](respondWithStatusCode(_0xfc3b00,null))[_0x0aa4('0x50')](handleError(_0xfc3b00,null));};exports[_0x0aa4('0x8a')]=function(_0x534b0a,_0x4733f5,_0x36cc0d){return db[_0x0aa4('0x4b')]['find']({'where':{'id':_0x534b0a[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0x4733f5,null))[_0x0aa4('0x2c')](function(_0x159f79){if(_0x159f79){return _0x159f79[_0x0aa4('0x8a')](_0x534b0a['body'][_0x0aa4('0x6c')],_[_0x0aa4('0x8b')](_0x534b0a['body'],[_0x0aa4('0x6c'),'id'])||{})[_0x0aa4('0x8c')](function(_0x505839){for(var _0x899fa0=0x0;_0x899fa0<_0x534b0a[_0x0aa4('0x54')][_0x0aa4('0x6c')][_0x0aa4('0x41')];_0x899fa0+=0x1){socket[_0x0aa4('0x75')](_0x0aa4('0x76'),{'UserId':Number(_0x534b0a[_0x0aa4('0x54')][_0x0aa4('0x6c')][_0x899fa0]),'WhatsappQueueId':Number(_0x534b0a['params']['id'])});}return _0x505839;});}})[_0x0aa4('0x2c')](respondWithResult(_0x4733f5,null))[_0x0aa4('0x50')](handleError(_0x4733f5,null));};exports[_0x0aa4('0x87')]=function(_0x2d49d7,_0xe1238a,_0x3aa84e){return db[_0x0aa4('0x4b')][_0x0aa4('0x57')]({'where':{'id':_0x2d49d7['params']['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0xe1238a,null))['then'](function(_0x587208){if(_0x587208){return _0x587208[_0x0aa4('0x87')](_0x2d49d7[_0x0aa4('0x3e')][_0x0aa4('0x6c')])[_0x0aa4('0x2c')](function(){if(_[_0x0aa4('0x8d')](_0x2d49d7[_0x0aa4('0x3e')][_0x0aa4('0x6c')])){for(var _0x3140da=0x0;_0x3140da<_0x2d49d7[_0x0aa4('0x3e')][_0x0aa4('0x6c')][_0x0aa4('0x41')];_0x3140da+=0x1){socket[_0x0aa4('0x75')](_0x0aa4('0x89'),{'UserId':Number(_0x2d49d7['query'][_0x0aa4('0x6c')][_0x3140da]),'WhatsappQueueId':Number(_0x2d49d7[_0x0aa4('0x52')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x2d49d7[_0x0aa4('0x3e')][_0x0aa4('0x6c')]),'WhatsappQueueId':Number(_0x2d49d7[_0x0aa4('0x52')]['id'])});}});}})[_0x0aa4('0x2c')](respondWithStatusCode(_0xe1238a,null))['catch'](handleError(_0xe1238a,null));};exports[_0x0aa4('0x8e')]=function(_0x4fad39,_0xa25820,_0x31d58c){var _0x1b37ed={};var _0x5c0dde={};var _0x1e672a;var _0x1ba2ca;return db[_0x0aa4('0x4b')][_0x0aa4('0x69')]({'where':{'id':_0x4fad39[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0xa25820,null))[_0x0aa4('0x2c')](function(_0x12d366){if(_0x12d366){_0x1e672a=_0x12d366;_0x5c0dde[_0x0aa4('0x3a')]=_[_0x0aa4('0x3b')](db[_0x0aa4('0x60')][_0x0aa4('0x36')]);_0x5c0dde['query']=_['keys'](_0x4fad39[_0x0aa4('0x3e')]);_0x5c0dde['filters']=_[_0x0aa4('0x3d')](_0x5c0dde[_0x0aa4('0x3a')],_0x5c0dde['query']);_0x1b37ed['attributes']=_['intersection'](_0x5c0dde[_0x0aa4('0x3a')],qs['fields'](_0x4fad39['query'][_0x0aa4('0x3f')]));_0x1b37ed['attributes']=_0x1b37ed[_0x0aa4('0x40')]['length']?_0x1b37ed[_0x0aa4('0x40')]:_0x5c0dde['model'];_0x1b37ed[_0x0aa4('0x44')]=qs[_0x0aa4('0x45')](_0x4fad39[_0x0aa4('0x3e')][_0x0aa4('0x45')]);_0x1b37ed[_0x0aa4('0x46')]=qs[_0x0aa4('0x3c')](_[_0x0aa4('0x47')](_0x4fad39[_0x0aa4('0x3e')],_0x5c0dde[_0x0aa4('0x3c')]));if(_0x4fad39[_0x0aa4('0x3e')][_0x0aa4('0x5f')]){_0x1b37ed[_0x0aa4('0x46')]=_[_0x0aa4('0x48')](_0x1b37ed['where'],{'$or':_[_0x0aa4('0x35')](_0x1b37ed[_0x0aa4('0x40')],function(_0x254c83){var _0x4cbabb={};_0x4cbabb[_0x254c83]={'$like':'%'+_0x4fad39[_0x0aa4('0x3e')]['filter']+'%'};return _0x4cbabb;})});}_0x1b37ed=_[_0x0aa4('0x48')]({},_0x1b37ed,_0x4fad39[_0x0aa4('0x4a')]);return _0x1e672a[_0x0aa4('0x8e')](_0x1b37ed);}})[_0x0aa4('0x2c')](function(_0x11feab){if(_0x11feab){_0x1ba2ca=_0x11feab['length'];if(!_0x4fad39[_0x0aa4('0x3e')][_0x0aa4('0x42')](_0x0aa4('0x43'))){_0x1b37ed['limit']=qs['limit'](_0x4fad39[_0x0aa4('0x3e')][_0x0aa4('0x25')]);_0x1b37ed['offset']=qs[_0x0aa4('0x24')](_0x4fad39['query'][_0x0aa4('0x24')]);}return _0x1e672a[_0x0aa4('0x8e')](_0x1b37ed);}})['then'](function(_0x3fb80f){if(_0x3fb80f){return _0x3fb80f?{'count':_0x1ba2ca,'rows':_0x3fb80f}:null;}})['then'](respondWithResult(_0xa25820,null))['catch'](handleError(_0xa25820,null));}; \ No newline at end of file +var _0x0d1a=['join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','every','all','union','compact','value','transaction','removeTeams','forEach','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','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','localhost','socket.io-emitter','register','sendStatus','json','offset','undefined','limit','count','apply','reject','update','then','destroy','WhatsappQueues','UserProfileResource','status','error','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','WhatsappQueue','includeAll','include','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','nolimit','merge','User','UserId','agent','createdAt','format','%s/%s','whatsappPause','getTeams','addTeams','ids','Team','findAll','Agents','online','voicePause','interface','flatMap','sequelize','findOrCreate','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues'];(function(_0x3d2054,_0x4cb833){var _0xb6f287=function(_0x1de76d){while(--_0x1de76d){_0x3d2054['push'](_0x3d2054['shift']());}};_0xb6f287(++_0x4cb833);}(_0x0d1a,0x9b));var _0xa0d1=function(_0x3411ce,_0x95ffb1){_0x3411ce=_0x3411ce-0x0;var _0x2cbc60=_0x0d1a[_0x3411ce];return _0x2cbc60;};'use strict';var emlformat=require(_0xa0d1('0x0'));var rimraf=require(_0xa0d1('0x1'));var zipdir=require(_0xa0d1('0x2'));var jsonpatch=require(_0xa0d1('0x3'));var rp=require(_0xa0d1('0x4'));var moment=require(_0xa0d1('0x5'));var BPromise=require(_0xa0d1('0x6'));var Mustache=require(_0xa0d1('0x7'));var util=require(_0xa0d1('0x8'));var path=require('path');var sox=require(_0xa0d1('0x9'));var csv=require(_0xa0d1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0d1('0xb'));var squel=require(_0xa0d1('0xc'));var crypto=require('crypto');var jsforce=require(_0xa0d1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa0d1('0xa'));var querystring=require(_0xa0d1('0xe'));var Papa=require(_0xa0d1('0xf'));var Redis=require(_0xa0d1('0x10'));var authService=require(_0xa0d1('0x11'));var qs=require(_0xa0d1('0x12'));var as=require(_0xa0d1('0x13'));var hardwareService=require(_0xa0d1('0x14'));var logger=require(_0xa0d1('0x15'))('api');var utils=require(_0xa0d1('0x16'));var config=require(_0xa0d1('0x17'));var licenseUtil=require(_0xa0d1('0x18'));var db=require(_0xa0d1('0x19'))['db'];config[_0xa0d1('0x1a')]=_[_0xa0d1('0x1b')](config['redis'],{'host':_0xa0d1('0x1c'),'port':0x18eb});var socket=require(_0xa0d1('0x1d'))(new Redis(config[_0xa0d1('0x1a')]));require('./whatsappQueue.socket')[_0xa0d1('0x1e')](socket);function respondWithStatusCode(_0x2a1191,_0x12fcea){_0x12fcea=_0x12fcea||0xcc;return function(_0x5dfcae){if(_0x5dfcae){return _0x2a1191[_0xa0d1('0x1f')](_0x12fcea);}return _0x2a1191['status'](_0x12fcea)['end']();};}function respondWithResult(_0x5e128e,_0x23b156){_0x23b156=_0x23b156||0xc8;return function(_0x5919c7){if(_0x5919c7){return _0x5e128e['status'](_0x23b156)[_0xa0d1('0x20')](_0x5919c7);}};}function respondWithFilteredResult(_0x2b0726,_0x217ab7){return function(_0x4e267b){if(_0x4e267b){var _0x4131ab=typeof _0x217ab7[_0xa0d1('0x21')]===_0xa0d1('0x22')&&typeof _0x217ab7[_0xa0d1('0x23')]===_0xa0d1('0x22');var _0xffc541=_0x4e267b[_0xa0d1('0x24')];var _0x21ea31=_0x4131ab?0x0:_0x217ab7[_0xa0d1('0x21')];var _0x1d170b=_0x4131ab?_0x4e267b[_0xa0d1('0x24')]:_0x217ab7[_0xa0d1('0x21')]+_0x217ab7[_0xa0d1('0x23')];var _0x490d46;if(_0x1d170b>=_0xffc541){_0x1d170b=_0xffc541;_0x490d46=0xc8;}else{_0x490d46=0xce;}_0x2b0726['status'](_0x490d46);return _0x2b0726['set']('Content-Range',_0x21ea31+'-'+_0x1d170b+'/'+_0xffc541)[_0xa0d1('0x20')](_0x4e267b);}return null;};}function patchUpdates(_0x1ce879){return function(_0x4dcc54){try{jsonpatch[_0xa0d1('0x25')](_0x4dcc54,_0x1ce879,!![]);}catch(_0x469912){return BPromise[_0xa0d1('0x26')](_0x469912);}return _0x4dcc54['save']();};}function saveUpdates(_0x42cc39,_0x37909e){return function(_0x23542a){if(_0x23542a){return _0x23542a[_0xa0d1('0x27')](_0x42cc39)[_0xa0d1('0x28')](function(_0x4fdae4){return _0x4fdae4;});}return null;};}function removeEntity(_0x4b16cc,_0x242ba5){return function(_0x4194a3){if(_0x4194a3){return _0x4194a3[_0xa0d1('0x29')]()[_0xa0d1('0x28')](function(){var _0xda92f6=_0x4194a3['get']({'plain':!![]});var _0x4edc19=_0xa0d1('0x2a');return db[_0xa0d1('0x2b')]['destroy']({'where':{'type':_0x4edc19,'resourceId':_0xda92f6['id']}})[_0xa0d1('0x28')](function(){return _0x4194a3;});})[_0xa0d1('0x28')](function(){_0x4b16cc[_0xa0d1('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x552f44,_0x13c319){return function(_0x5f167a){if(!_0x5f167a){_0x552f44[_0xa0d1('0x1f')](0x194);}return _0x5f167a;};}function handleError(_0x149d50,_0xfd7a1a){_0xfd7a1a=_0xfd7a1a||0x1f4;return function(_0xb76655){logger[_0xa0d1('0x2d')](_0xb76655['stack']);if(_0xb76655[_0xa0d1('0x2e')]){delete _0xb76655['name'];}_0x149d50['status'](_0xfd7a1a)[_0xa0d1('0x2f')](_0xb76655);};}exports['index']=function(_0x1b8c54,_0x4409d3){var _0x7c9482={},_0x574630={},_0x4f62fb={'count':0x0,'rows':[]};var _0x3c5990=_['map'](db['WhatsappQueue'][_0xa0d1('0x30')],function(_0x278dc9){return{'name':_0x278dc9[_0xa0d1('0x31')],'type':_0x278dc9[_0xa0d1('0x32')][_0xa0d1('0x33')]};});_0x574630[_0xa0d1('0x34')]=_[_0xa0d1('0x35')](_0x3c5990,_0xa0d1('0x2e'));_0x574630['query']=_[_0xa0d1('0x36')](_0x1b8c54[_0xa0d1('0x37')]);_0x574630[_0xa0d1('0x38')]=_[_0xa0d1('0x39')](_0x574630[_0xa0d1('0x34')],_0x574630[_0xa0d1('0x37')]);_0x7c9482['attributes']=_[_0xa0d1('0x39')](_0x574630[_0xa0d1('0x34')],qs['fields'](_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x3a')]));_0x7c9482['attributes']=_0x7c9482[_0xa0d1('0x3b')][_0xa0d1('0x3c')]?_0x7c9482['attributes']:_0x574630[_0xa0d1('0x34')];if(!_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x3d')]('nolimit')){_0x7c9482[_0xa0d1('0x23')]=qs[_0xa0d1('0x23')](_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x23')]);_0x7c9482[_0xa0d1('0x21')]=qs['offset'](_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x21')]);}_0x7c9482[_0xa0d1('0x3e')]=qs[_0xa0d1('0x3f')](_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x3f')]);_0x7c9482[_0xa0d1('0x40')]=qs[_0xa0d1('0x38')](_[_0xa0d1('0x41')](_0x1b8c54['query'],_0x574630[_0xa0d1('0x38')]),_0x3c5990);if(_0x1b8c54[_0xa0d1('0x37')]['filter']){_0x7c9482['where']=_['merge'](_0x7c9482[_0xa0d1('0x40')],{'$or':_[_0xa0d1('0x35')](_0x3c5990,function(_0x3d2428){if(_0x3d2428[_0xa0d1('0x32')]!==_0xa0d1('0x42')){var _0x28dde3={};_0x28dde3[_0x3d2428['name']]={'$like':'%'+_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x43')]+'%'};return _0x28dde3;}})});}_0x7c9482=_['merge']({},_0x7c9482,_0x1b8c54['options']);var _0x4511ae={'where':_0x7c9482[_0xa0d1('0x40')]};return db[_0xa0d1('0x44')][_0xa0d1('0x24')](_0x4511ae)[_0xa0d1('0x28')](function(_0x1526f3){_0x4f62fb['count']=_0x1526f3;if(_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x45')]){_0x7c9482[_0xa0d1('0x46')]=[{'all':!![]}];}return db[_0xa0d1('0x44')]['findAll'](_0x7c9482);})[_0xa0d1('0x28')](function(_0x1a00fc){_0x4f62fb[_0xa0d1('0x47')]=_0x1a00fc;return _0x4f62fb;})[_0xa0d1('0x28')](respondWithFilteredResult(_0x4409d3,_0x7c9482))[_0xa0d1('0x48')](handleError(_0x4409d3,null));};exports[_0xa0d1('0x49')]=function(_0xe161b7,_0x4c018f){var _0x1a6a9d={'raw':!![],'where':{'id':_0xe161b7[_0xa0d1('0x4a')]['id']}},_0x34ef32={};_0x34ef32[_0xa0d1('0x34')]=_[_0xa0d1('0x36')](db[_0xa0d1('0x44')]['rawAttributes']);_0x34ef32[_0xa0d1('0x37')]=_['keys'](_0xe161b7['query']);_0x34ef32[_0xa0d1('0x38')]=_[_0xa0d1('0x39')](_0x34ef32[_0xa0d1('0x34')],_0x34ef32[_0xa0d1('0x37')]);_0x1a6a9d[_0xa0d1('0x3b')]=_[_0xa0d1('0x39')](_0x34ef32[_0xa0d1('0x34')],qs[_0xa0d1('0x3a')](_0xe161b7[_0xa0d1('0x37')]['fields']));_0x1a6a9d['attributes']=_0x1a6a9d[_0xa0d1('0x3b')][_0xa0d1('0x3c')]?_0x1a6a9d[_0xa0d1('0x3b')]:_0x34ef32[_0xa0d1('0x34')];if(_0xe161b7[_0xa0d1('0x37')][_0xa0d1('0x45')]){_0x1a6a9d[_0xa0d1('0x46')]=[{'all':!![]}];}_0x1a6a9d=_['merge']({},_0x1a6a9d,_0xe161b7[_0xa0d1('0x4b')]);return db[_0xa0d1('0x44')][_0xa0d1('0x4c')](_0x1a6a9d)[_0xa0d1('0x28')](handleEntityNotFound(_0x4c018f,null))['then'](respondWithResult(_0x4c018f,null))['catch'](handleError(_0x4c018f,null));};exports[_0xa0d1('0x4d')]=function(_0x56f51b,_0x1ad8c5){return db[_0xa0d1('0x44')][_0xa0d1('0x4d')](_0x56f51b[_0xa0d1('0x4e')],{})[_0xa0d1('0x28')](function(_0x566afa){var _0x11e461=_0x56f51b[_0xa0d1('0x4f')][_0xa0d1('0x50')]({'plain':!![]});if(!_0x11e461)throw new Error(_0xa0d1('0x51'));if(_0x11e461['role']==='user'){var _0x4a2039=_0x566afa['get']({'plain':!![]});var _0x464e85=_0xa0d1('0x2a');return db[_0xa0d1('0x52')]['find']({'where':{'name':_0x464e85,'userProfileId':_0x11e461['userProfileId']},'raw':!![]})[_0xa0d1('0x28')](function(_0xdfca4e){if(_0xdfca4e&&_0xdfca4e[_0xa0d1('0x53')]===0x0){return db[_0xa0d1('0x2b')]['create']({'name':_0x4a2039[_0xa0d1('0x2e')],'resourceId':_0x4a2039['id'],'type':_0xdfca4e['name'],'sectionId':_0xdfca4e['id']},{})[_0xa0d1('0x28')](function(){return _0x566afa;});}else{return _0x566afa;}})[_0xa0d1('0x48')](function(_0x354a34){logger[_0xa0d1('0x2d')](_0xa0d1('0x54'),_0x354a34);throw _0x354a34;});}return _0x566afa;})[_0xa0d1('0x28')](respondWithResult(_0x1ad8c5,0xc9))['catch'](handleError(_0x1ad8c5,null));};exports[_0xa0d1('0x27')]=function(_0x34e2e2,_0xc86a34){if(_0x34e2e2['body']['id']){delete _0x34e2e2[_0xa0d1('0x4e')]['id'];}return db[_0xa0d1('0x44')][_0xa0d1('0x4c')]({'where':{'id':_0x34e2e2['params']['id']}})[_0xa0d1('0x28')](handleEntityNotFound(_0xc86a34,null))[_0xa0d1('0x28')](saveUpdates(_0x34e2e2[_0xa0d1('0x4e')],null))['then'](respondWithResult(_0xc86a34,null))[_0xa0d1('0x48')](handleError(_0xc86a34,null));};exports['destroy']=function(_0x21f1e0,_0x3512c2){return db[_0xa0d1('0x44')][_0xa0d1('0x4c')]({'where':{'id':_0x21f1e0[_0xa0d1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3512c2,null))[_0xa0d1('0x28')](removeEntity(_0x3512c2,null))[_0xa0d1('0x48')](handleError(_0x3512c2,null));};exports[_0xa0d1('0x55')]=function(_0x576bdc,_0x35db3e){return db[_0xa0d1('0x44')][_0xa0d1('0x55')]()[_0xa0d1('0x28')](respondWithResult(_0x35db3e,null))['catch'](handleError(_0x35db3e,null));};exports[_0xa0d1('0x56')]=function(_0x4cffa9,_0x362827,_0x1a4140){var _0x2d0ade={'raw':!![],'where':{}},_0x1de7d8={},_0x151fe9;return db[_0xa0d1('0x44')][_0xa0d1('0x57')]({'where':{'id':_0x4cffa9[_0xa0d1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x362827,null))[_0xa0d1('0x28')](function(_0x56730c){if(_0x56730c){_0x151fe9=_0x56730c['get']({'plain':!![]});_0x1de7d8['model']=_[_0xa0d1('0x36')](db[_0xa0d1('0x58')][_0xa0d1('0x30')]);_0x1de7d8['query']=_[_0xa0d1('0x36')](_0x4cffa9['query']);_0x1de7d8[_0xa0d1('0x38')]=_[_0xa0d1('0x39')](_0x1de7d8['model'],_0x1de7d8['query']);_0x2d0ade[_0xa0d1('0x3b')]=_[_0xa0d1('0x39')](_0x1de7d8[_0xa0d1('0x34')],qs[_0xa0d1('0x3a')](_0x4cffa9[_0xa0d1('0x37')][_0xa0d1('0x3a')]));_0x2d0ade[_0xa0d1('0x3b')]=_0x2d0ade[_0xa0d1('0x3b')][_0xa0d1('0x3c')]?_0x2d0ade[_0xa0d1('0x3b')]:_0x1de7d8[_0xa0d1('0x34')];if(!_0x4cffa9[_0xa0d1('0x37')][_0xa0d1('0x3d')](_0xa0d1('0x59'))){_0x2d0ade[_0xa0d1('0x23')]=qs[_0xa0d1('0x23')](_0x4cffa9['query'][_0xa0d1('0x23')]);_0x2d0ade[_0xa0d1('0x21')]=qs[_0xa0d1('0x21')](_0x4cffa9[_0xa0d1('0x37')]['offset']);}_0x2d0ade['order']=qs[_0xa0d1('0x3f')](_0x4cffa9[_0xa0d1('0x37')]['sort']);_0x2d0ade[_0xa0d1('0x40')]=qs[_0xa0d1('0x38')](_[_0xa0d1('0x41')](_0x4cffa9[_0xa0d1('0x37')],_0x1de7d8['filters']));_0x2d0ade['where']['WhatsappQueueId']=_0x56730c['id'];if(_0x4cffa9[_0xa0d1('0x37')][_0xa0d1('0x43')]){_0x2d0ade[_0xa0d1('0x40')]=_[_0xa0d1('0x5a')](_0x2d0ade[_0xa0d1('0x40')],{'$or':_['map'](_0x2d0ade[_0xa0d1('0x3b')],function(_0x1942e0){var _0x5eb781={};_0x5eb781[_0x1942e0]={'$like':'%'+_0x4cffa9[_0xa0d1('0x37')]['filter']+'%'};return _0x5eb781;})});}_0x2d0ade=_[_0xa0d1('0x5a')]({},_0x2d0ade,_0x4cffa9[_0xa0d1('0x4b')]);return db[_0xa0d1('0x58')]['findAll'](_0x2d0ade);}})[_0xa0d1('0x28')](function(_0x199b8d){if(_0x199b8d){return db[_0xa0d1('0x5b')]['findAndCountAll']({'where':{'id':_[_0xa0d1('0x35')](_0x199b8d,_0xa0d1('0x5c')),'role':_0xa0d1('0x5d')},'attributes':['id',_0xa0d1('0x2e'),'whatsappPause','updatedAt',_0xa0d1('0x5e')]});}})[_0xa0d1('0x28')](function(_0x3cef52){if(_0x3cef52){return{'count':_0x3cef52['count'],'rows':_[_0xa0d1('0x35')](_0x3cef52['rows'],function(_0x50dff0){return{'membername':_0x50dff0[_0xa0d1('0x2e')],'UserId':_0x50dff0['id'],'queue_name':_0x151fe9[_0xa0d1('0x2e')],'WhatsappQueueId':_0x151fe9['id'],'interface':util[_0xa0d1('0x5f')](_0xa0d1('0x60'),'SIP',_0x50dff0[_0xa0d1('0x2e')]),'penalty':0x0,'paused':_0x50dff0[_0xa0d1('0x61')],'createdAt':_0x50dff0[_0xa0d1('0x5e')],'updatedAt':_0x50dff0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa0d1('0x28')](respondWithFilteredResult(_0x362827,_0x2d0ade))['catch'](handleError(_0x362827,null));};exports[_0xa0d1('0x62')]=function(_0x10d707,_0x39318a,_0x5ac6e5){var _0x10736d={};var _0x2d1061={};var _0x4760f5;var _0x3ad2ce;return db[_0xa0d1('0x44')][_0xa0d1('0x57')]({'where':{'id':_0x10d707['params']['id']}})[_0xa0d1('0x28')](handleEntityNotFound(_0x39318a,null))[_0xa0d1('0x28')](function(_0x316067){if(_0x316067){_0x4760f5=_0x316067;_0x2d1061['model']=_['keys'](db['Team']['rawAttributes']);_0x2d1061['query']=_[_0xa0d1('0x36')](_0x10d707['query']);_0x2d1061['filters']=_[_0xa0d1('0x39')](_0x2d1061['model'],_0x2d1061[_0xa0d1('0x37')]);_0x10736d[_0xa0d1('0x3b')]=_['intersection'](_0x2d1061[_0xa0d1('0x34')],qs[_0xa0d1('0x3a')](_0x10d707['query'][_0xa0d1('0x3a')]));_0x10736d['attributes']=_0x10736d[_0xa0d1('0x3b')][_0xa0d1('0x3c')]?_0x10736d[_0xa0d1('0x3b')]:_0x2d1061['model'];_0x10736d[_0xa0d1('0x3e')]=qs[_0xa0d1('0x3f')](_0x10d707[_0xa0d1('0x37')][_0xa0d1('0x3f')]);_0x10736d['where']=qs[_0xa0d1('0x38')](_['pick'](_0x10d707[_0xa0d1('0x37')],_0x2d1061[_0xa0d1('0x38')]));if(_0x10d707[_0xa0d1('0x37')][_0xa0d1('0x43')]){_0x10736d[_0xa0d1('0x40')]=_[_0xa0d1('0x5a')](_0x10736d['where'],{'$or':_[_0xa0d1('0x35')](_0x10736d['attributes'],function(_0x4ef9cc){var _0x1844f3={};_0x1844f3[_0x4ef9cc]={'$like':'%'+_0x10d707[_0xa0d1('0x37')]['filter']+'%'};return _0x1844f3;})});}_0x10736d=_[_0xa0d1('0x5a')]({},_0x10736d,_0x10d707[_0xa0d1('0x4b')]);return _0x4760f5[_0xa0d1('0x62')](_0x10736d);}})['then'](function(_0x1ff875){if(_0x1ff875){_0x3ad2ce=_0x1ff875[_0xa0d1('0x3c')];if(!_0x10d707['query'][_0xa0d1('0x3d')](_0xa0d1('0x59'))){_0x10736d[_0xa0d1('0x23')]=qs['limit'](_0x10d707[_0xa0d1('0x37')]['limit']);_0x10736d[_0xa0d1('0x21')]=qs['offset'](_0x10d707[_0xa0d1('0x37')]['offset']);}return _0x4760f5[_0xa0d1('0x62')](_0x10736d);}})[_0xa0d1('0x28')](function(_0x40e1a0){if(_0x40e1a0){return _0x40e1a0?{'count':_0x3ad2ce,'rows':_0x40e1a0}:null;}})[_0xa0d1('0x28')](respondWithResult(_0x39318a,null))[_0xa0d1('0x48')](handleError(_0x39318a,null));};exports[_0xa0d1('0x63')]=function(_0xf82a2e,_0x3e2616,_0x2747e0){var _0x18b7cf=_0xf82a2e['body'][_0xa0d1('0x64')];return db[_0xa0d1('0x65')][_0xa0d1('0x66')]({'where':{'id':_0x18b7cf},'attributes':['id'],'include':[{'model':db[_0xa0d1('0x5b')],'as':_0xa0d1('0x67'),'attributes':['id',_0xa0d1('0x2e'),_0xa0d1('0x68'),_0xa0d1('0x69'),_0xa0d1('0x6a')],'raw':!![]}]})[_0xa0d1('0x28')](function(_0x3027c6){if(_0x3027c6){var _0x278d84=_[_0xa0d1('0x6b')](_0x3027c6,function(_0x5be9b2){var _0x5e200c=_0x5be9b2[_0xa0d1('0x50')]({'plain':!![]});return _0x5e200c[_0xa0d1('0x67')];});return db[_0xa0d1('0x44')]['find']({'where':{'id':_0xf82a2e[_0xa0d1('0x4a')]['id']}})[_0xa0d1('0x28')](function(_0x43f9eb){return db[_0xa0d1('0x6c')]['transaction'](function(_0x302cbf){return _0x43f9eb[_0xa0d1('0x63')](_0x18b7cf,{'transaction':_0x302cbf})[_0xa0d1('0x28')](function(){return BPromise['each'](_0x278d84,function(_0x246bd8){return db['UserWhatsappQueue'][_0xa0d1('0x6d')]({'where':{'UserId':_0x246bd8['id'],'WhatsappQueueId':_0xf82a2e['params']['id']},'transaction':_0x302cbf});});})[_0xa0d1('0x28')](function(){_0x278d84['forEach'](function(_0x39084a){socket[_0xa0d1('0x6e')](_0xa0d1('0x6f'),{'UserId':_0x39084a['id'],'WhatsappQueueId':_0x43f9eb['id']});});});});});}})['then'](respondWithStatusCode(_0x3e2616,null))[_0xa0d1('0x48')](handleError(_0x3e2616,null));};exports['removeTeams']=function(_0x30172d,_0x25c7ae,_0x93118c){return db[_0xa0d1('0x65')][_0xa0d1('0x66')]({'where':{'id':_0x30172d[_0xa0d1('0x37')][_0xa0d1('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa0d1('0x67'),'attributes':['id'],'raw':!![]}]})[_0xa0d1('0x28')](handleEntityNotFound(_0x25c7ae,null))[_0xa0d1('0x28')](function(_0x3971df){var _0x358d43=_[_0xa0d1('0x35')](_0x3971df,'id');var _0x1a7be5=[];var _0x1b3b12=[];var _0x28513c=squel[_0xa0d1('0x70')]();_0x28513c[_0xa0d1('0x71')](_0xa0d1('0x72'))[_0xa0d1('0x73')](_0xa0d1('0x74'),'tq')[_0xa0d1('0x75')](_0xa0d1('0x76'),'ut',_0xa0d1('0x77'))[_0xa0d1('0x40')](_0xa0d1('0x78'),_0x30172d['params']['id']);for(var _0x547da0=0x0;_0x547da0<_0x3971df[_0xa0d1('0x3c')];_0x547da0+=0x1){let _0xe8aff2=_0x3971df[_0x547da0];for(var _0x118973=0x0;_0x118973<_0xe8aff2[_0xa0d1('0x67')][_0xa0d1('0x3c')];_0x118973+=0x1){let _0x44c477=_0xe8aff2[_0xa0d1('0x67')][_0x118973];var _0x20d633=_0x28513c['clone']();_0x20d633[_0xa0d1('0x40')](_0xa0d1('0x79'),_0x44c477['id']);_0x1b3b12[_0xa0d1('0x7a')](db['sequelize'][_0xa0d1('0x37')](_0x20d633['toString'](),{'type':db[_0xa0d1('0x6c')][_0xa0d1('0x7b')]['SELECT']})[_0xa0d1('0x28')](function(_0x131779){if(_0x131779[_0xa0d1('0x3c')]===0x1){return _0x44c477['id'];}else{var _0x52c903=_[_0xa0d1('0x7c')](_[_0xa0d1('0x35')](_0x131779,'TeamId'),function(_0xd14e9b){return _['includes'](_0x358d43,_0xd14e9b);});if(_0x52c903){return _0x44c477['id'];}}}));}}return BPromise[_0xa0d1('0x7d')](_0x1b3b12)[_0xa0d1('0x28')](function(_0x4319da){_0x1a7be5=_(_0x1a7be5)[_0xa0d1('0x7e')](_0x4319da)[_0xa0d1('0x7f')]()[_0xa0d1('0x80')]();return db[_0xa0d1('0x44')]['find']({'where':{'id':_0x30172d[_0xa0d1('0x4a')]['id']}})[_0xa0d1('0x28')](function(_0x2aaba7){return db['sequelize'][_0xa0d1('0x81')](function(_0x25c2fc){return _0x2aaba7[_0xa0d1('0x82')](_0x30172d[_0xa0d1('0x37')]['ids'],{'transaction':_0x25c2fc})[_0xa0d1('0x28')](function(){if(!_['isEmpty'](_0x1a7be5)){return _0x2aaba7['removeAgents'](_0x1a7be5,{'transaction':_0x25c2fc});}})['then'](function(){_0x1a7be5[_0xa0d1('0x83')](function(_0x3946d0){socket[_0xa0d1('0x6e')]('userWhatsappQueue:remove',{'UserId':_0x3946d0,'WhatsappQueueId':_0x2aaba7['id']});});});});});});})[_0xa0d1('0x28')](respondWithStatusCode(_0x25c7ae,null))[_0xa0d1('0x48')](handleError(_0x25c7ae,null));};exports['addAgents']=function(_0x121013,_0x3e3a8c,_0xce836){return db[_0xa0d1('0x44')][_0xa0d1('0x4c')]({'where':{'id':_0x121013[_0xa0d1('0x4a')]['id']}})[_0xa0d1('0x28')](handleEntityNotFound(_0x3e3a8c,null))['then'](function(_0x1faa49){if(_0x1faa49){return _0x1faa49[_0xa0d1('0x84')](_0x121013[_0xa0d1('0x4e')][_0xa0d1('0x64')],_['omit'](_0x121013[_0xa0d1('0x4e')],[_0xa0d1('0x64'),'id'])||{})['spread'](function(_0x452ca5){for(var _0x5431cc=0x0;_0x5431cc<_0x121013[_0xa0d1('0x4e')][_0xa0d1('0x64')][_0xa0d1('0x3c')];_0x5431cc+=0x1){socket['emit'](_0xa0d1('0x6f'),{'UserId':Number(_0x121013[_0xa0d1('0x4e')][_0xa0d1('0x64')][_0x5431cc]),'WhatsappQueueId':Number(_0x121013[_0xa0d1('0x4a')]['id'])});}return _0x452ca5;});}})['then'](respondWithResult(_0x3e3a8c,null))[_0xa0d1('0x48')](handleError(_0x3e3a8c,null));};exports['removeAgents']=function(_0x3163b2,_0x405f02,_0x12e5d0){return db['WhatsappQueue'][_0xa0d1('0x4c')]({'where':{'id':_0x3163b2[_0xa0d1('0x4a')]['id']}})[_0xa0d1('0x28')](handleEntityNotFound(_0x405f02,null))['then'](function(_0x31f897){if(_0x31f897){return _0x31f897[_0xa0d1('0x85')](_0x3163b2[_0xa0d1('0x37')]['ids'])[_0xa0d1('0x28')](function(){if(_[_0xa0d1('0x86')](_0x3163b2[_0xa0d1('0x37')][_0xa0d1('0x64')])){for(var _0x3c61b0=0x0;_0x3c61b0<_0x3163b2['query'][_0xa0d1('0x64')]['length'];_0x3c61b0+=0x1){socket[_0xa0d1('0x6e')]('userWhatsappQueue:remove',{'UserId':Number(_0x3163b2[_0xa0d1('0x37')][_0xa0d1('0x64')][_0x3c61b0]),'WhatsappQueueId':Number(_0x3163b2[_0xa0d1('0x4a')]['id'])});}}else{socket[_0xa0d1('0x6e')]('userWhatsappQueue:remove',{'UserId':Number(_0x3163b2[_0xa0d1('0x37')][_0xa0d1('0x64')]),'WhatsappQueueId':Number(_0x3163b2['params']['id'])});}});}})[_0xa0d1('0x28')](respondWithStatusCode(_0x405f02,null))[_0xa0d1('0x48')](handleError(_0x405f02,null));};exports[_0xa0d1('0x87')]=function(_0x1c80e2,_0x37ee6e,_0x131678){var _0x215ca8={};var _0x3b8c07={};var _0x2b45b0;var _0x9182a9;return db[_0xa0d1('0x44')][_0xa0d1('0x57')]({'where':{'id':_0x1c80e2[_0xa0d1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x37ee6e,null))[_0xa0d1('0x28')](function(_0x2dd8d0){if(_0x2dd8d0){_0x2b45b0=_0x2dd8d0;_0x3b8c07[_0xa0d1('0x34')]=_[_0xa0d1('0x36')](db[_0xa0d1('0x5b')]['rawAttributes']);_0x3b8c07['query']=_[_0xa0d1('0x36')](_0x1c80e2[_0xa0d1('0x37')]);_0x3b8c07[_0xa0d1('0x38')]=_[_0xa0d1('0x39')](_0x3b8c07['model'],_0x3b8c07[_0xa0d1('0x37')]);_0x215ca8[_0xa0d1('0x3b')]=_['intersection'](_0x3b8c07[_0xa0d1('0x34')],qs[_0xa0d1('0x3a')](_0x1c80e2[_0xa0d1('0x37')][_0xa0d1('0x3a')]));_0x215ca8[_0xa0d1('0x3b')]=_0x215ca8[_0xa0d1('0x3b')][_0xa0d1('0x3c')]?_0x215ca8[_0xa0d1('0x3b')]:_0x3b8c07[_0xa0d1('0x34')];_0x215ca8[_0xa0d1('0x3e')]=qs['sort'](_0x1c80e2[_0xa0d1('0x37')][_0xa0d1('0x3f')]);_0x215ca8[_0xa0d1('0x40')]=qs['filters'](_['pick'](_0x1c80e2[_0xa0d1('0x37')],_0x3b8c07['filters']));if(_0x1c80e2[_0xa0d1('0x37')][_0xa0d1('0x43')]){_0x215ca8[_0xa0d1('0x40')]=_[_0xa0d1('0x5a')](_0x215ca8[_0xa0d1('0x40')],{'$or':_[_0xa0d1('0x35')](_0x215ca8['attributes'],function(_0x14bb00){var _0x55ccf2={};_0x55ccf2[_0x14bb00]={'$like':'%'+_0x1c80e2[_0xa0d1('0x37')]['filter']+'%'};return _0x55ccf2;})});}_0x215ca8=_[_0xa0d1('0x5a')]({},_0x215ca8,_0x1c80e2[_0xa0d1('0x4b')]);return _0x2b45b0['getAgents'](_0x215ca8);}})[_0xa0d1('0x28')](function(_0x4b3a9b){if(_0x4b3a9b){_0x9182a9=_0x4b3a9b['length'];if(!_0x1c80e2[_0xa0d1('0x37')]['hasOwnProperty']('nolimit')){_0x215ca8['limit']=qs[_0xa0d1('0x23')](_0x1c80e2[_0xa0d1('0x37')][_0xa0d1('0x23')]);_0x215ca8[_0xa0d1('0x21')]=qs[_0xa0d1('0x21')](_0x1c80e2[_0xa0d1('0x37')][_0xa0d1('0x21')]);}return _0x2b45b0[_0xa0d1('0x87')](_0x215ca8);}})[_0xa0d1('0x28')](function(_0x11a556){if(_0x11a556){return _0x11a556?{'count':_0x9182a9,'rows':_0x11a556}:null;}})[_0xa0d1('0x28')](respondWithResult(_0x37ee6e,null))[_0xa0d1('0x48')](handleError(_0x37ee6e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index c0117fb..b623dfb 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 _0xf155=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x2f57b2,_0xa8e91a){var _0x5ace77=function(_0x59c00a){while(--_0x59c00a){_0x2f57b2['push'](_0x2f57b2['shift']());}};_0x5ace77(++_0xa8e91a);}(_0xf155,0x174));var _0x5f15=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0xf155[_0x55e1d1];return _0x1165db;};'use strict';var EventEmitter=require(_0x5f15('0x0'));var WhatsappQueue=require(_0x5f15('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5f15('0x2')](0x0);var events={'afterCreate':_0x5f15('0x3'),'afterUpdate':'update','afterDestroy':_0x5f15('0x4')};function emitEvent(_0x58f3de){return function(_0x52ac7d,_0x2163ce,_0x3ffaf6){WhatsappQueueEvents[_0x5f15('0x5')](_0x58f3de+':'+_0x52ac7d['id'],_0x52ac7d);WhatsappQueueEvents[_0x5f15('0x5')](_0x58f3de,_0x52ac7d);_0x3ffaf6(null);};}for(var e in events){if(events[_0x5f15('0x6')](e)){var event=events[e];WhatsappQueue[_0x5f15('0x7')](e,emitEvent(event));}}module[_0x5f15('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x722c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x722c,0xb7));var _0xc722=function(_0x282240,_0x47ad21){_0x282240=_0x282240-0x0;var _0x1f5d1c=_0x722c[_0x282240];return _0x1f5d1c;};'use strict';var EventEmitter=require(_0xc722('0x0'));var WhatsappQueue=require(_0xc722('0x1'))['db'][_0xc722('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc722('0x3')](0x0);var events={'afterCreate':_0xc722('0x4'),'afterUpdate':_0xc722('0x5'),'afterDestroy':_0xc722('0x6')};function emitEvent(_0x4dbadc){return function(_0x261224,_0x229a1b,_0x30ed79){WhatsappQueueEvents[_0xc722('0x7')](_0x4dbadc+':'+_0x261224['id'],_0x261224);WhatsappQueueEvents[_0xc722('0x7')](_0x4dbadc,_0x261224);_0x30ed79(null);};}for(var e in events){if(events[_0xc722('0x8')](e)){var event=events[e];WhatsappQueue[_0xc722('0x9')](e,emitEvent(event));}}module[_0xc722('0xa')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 5d4ed97..c9a1dca 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 _0x622f=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','lodash','api','moment'];(function(_0x2cfc8c,_0x5472df){var _0x1de813=function(_0x580f50){while(--_0x580f50){_0x2cfc8c['push'](_0x2cfc8c['shift']());}};_0x1de813(++_0x5472df);}(_0x622f,0x15d));var _0xf622=function(_0x2c58bc,_0x49b37d){_0x2c58bc=_0x2c58bc-0x0;var _0xddb541=_0x622f[_0x2c58bc];return _0xddb541;};'use strict';var _=require(_0xf622('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf622('0x1'));var moment=require(_0xf622('0x2'));var BPromise=require(_0xf622('0x3'));var rp=require(_0xf622('0x4'));var fs=require('fs');var path=require(_0xf622('0x5'));var rimraf=require(_0xf622('0x6'));var config=require(_0xf622('0x7'));var attributes=require(_0xf622('0x8'));module['exports']=function(_0x1f8280,_0x51a48c){return _0x1f8280['define'](_0xf622('0x9'),attributes,{'tableName':_0xf622('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57a6=['../../config/environment','exports','define','WhatsappQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x57a6,0xc4));var _0x657a=function(_0x5825df,_0x4b733f){_0x5825df=_0x5825df-0x0;var _0x124d9b=_0x57a6[_0x5825df];return _0x124d9b;};'use strict';var _=require(_0x657a('0x0'));var util=require(_0x657a('0x1'));var logger=require(_0x657a('0x2'))(_0x657a('0x3'));var moment=require('moment');var BPromise=require(_0x657a('0x4'));var rp=require(_0x657a('0x5'));var fs=require('fs');var path=require(_0x657a('0x6'));var rimraf=require(_0x657a('0x7'));var config=require(_0x657a('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0x657a('0x9')]=function(_0x1ce0db,_0x29e1c6){return _0x1ce0db[_0x657a('0xa')](_0x657a('0xb'),attributes,{'tableName':'whatsapp_queues','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 830ecb5..d35cbfe 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 _0x849e=['register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetWhatsappQueue','catch','ShowWhatsappQueue','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','localhost','redis','./whatsappQueue.socket'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x849e,0x1c6));var _0xe849=function(_0x684ef1,_0x5887f7){_0x684ef1=_0x684ef1-0x0;var _0xa80b7a=_0x849e[_0x684ef1];return _0xa80b7a;};'use strict';var _=require(_0xe849('0x0'));var util=require(_0xe849('0x1'));var moment=require(_0xe849('0x2'));var BPromise=require(_0xe849('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe849('0x4'));var db=require(_0xe849('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe849('0x6'))(_0xe849('0x7'));var config=require(_0xe849('0x8'));var jayson=require(_0xe849('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xe849('0xa')](config['redis'],{'host':_0xe849('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe849('0xc')]));require(_0xe849('0xd'))[_0xe849('0xe')](socket);function respondWithRpcPromise(_0x37319a,_0x18fe96,_0xf5bfe9){return new BPromise(function(_0x3be34b,_0x45af8b){return client[_0xe849('0xf')](_0x37319a,_0xf5bfe9)['then'](function(_0x421228){logger[_0xe849('0x10')](_0xe849('0x11'),_0x18fe96,_0xe849('0x12'));logger[_0xe849('0x13')](_0xe849('0x14'),_0x18fe96,'request\x20sent',JSON[_0xe849('0x15')](_0x421228));if(_0x421228[_0xe849('0x16')]){if(_0x421228[_0xe849('0x16')][_0xe849('0x17')]===0x1f4){logger[_0xe849('0x16')](_0xe849('0x11'),_0x18fe96,_0x421228['error'][_0xe849('0x18')]);return _0x45af8b(_0x421228[_0xe849('0x16')][_0xe849('0x18')]);}logger[_0xe849('0x16')](_0xe849('0x11'),_0x18fe96,_0x421228[_0xe849('0x16')][_0xe849('0x18')]);return _0x3be34b(_0x421228[_0xe849('0x16')]['message']);}else{logger[_0xe849('0x10')](_0xe849('0x11'),_0x18fe96,_0xe849('0x12'));_0x3be34b(_0x421228['result'][_0xe849('0x18')]);}})['catch'](function(_0x2d2e9c){logger[_0xe849('0x16')](_0xe849('0x11'),_0x18fe96,_0x2d2e9c);_0x45af8b(_0x2d2e9c);});});}exports['GetWhatsappQueue']=function(_0x1e607f){var _0x214ef0=this;return new Promise(function(_0x41f6d3,_0x3c8038){return db[_0xe849('0x19')][_0xe849('0x1a')]({'raw':_0x1e607f[_0xe849('0x1b')]?_0x1e607f[_0xe849('0x1b')][_0xe849('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e607f[_0xe849('0x1b')]?_0x1e607f[_0xe849('0x1b')][_0xe849('0x1d')]||null:null,'attributes':_0x1e607f[_0xe849('0x1b')]?_0x1e607f[_0xe849('0x1b')][_0xe849('0x1e')]||null:null,'limit':_0x1e607f[_0xe849('0x1b')]?_0x1e607f[_0xe849('0x1b')][_0xe849('0x1f')]||null:null,'include':_0x1e607f[_0xe849('0x1b')]?_0x1e607f['options'][_0xe849('0x20')]?_['map'](_0x1e607f['options']['include'],function(_0x56fe7e){return{'model':db[_0x56fe7e[_0xe849('0x21')]],'as':_0x56fe7e['as'],'attributes':_0x56fe7e[_0xe849('0x1e')],'include':_0x56fe7e[_0xe849('0x20')]?_[_0xe849('0x22')](_0x56fe7e[_0xe849('0x20')],function(_0x4151b8){return{'model':db[_0x4151b8[_0xe849('0x21')]],'as':_0x4151b8['as'],'attributes':_0x4151b8[_0xe849('0x1e')],'include':_0x4151b8['include']?_[_0xe849('0x22')](_0x4151b8['include'],function(_0x15ad1b){return{'model':db[_0x15ad1b['model']],'as':_0x15ad1b['as'],'attributes':_0x15ad1b[_0xe849('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c9734){logger[_0xe849('0x10')](_0xe849('0x23'),_0x1e607f);logger[_0xe849('0x13')]('GetWhatsappQueue',_0x1e607f,JSON[_0xe849('0x15')](_0x3c9734));_0x41f6d3(_0x3c9734);})[_0xe849('0x24')](function(_0x2b53b3){logger['error'](_0xe849('0x23'),_0x2b53b3[_0xe849('0x18')],_0x1e607f);_0x3c8038(_0x214ef0[_0xe849('0x16')](0x1f4,_0x2b53b3['message']));});});};exports[_0xe849('0x25')]=function(_0xf0e284){var _0x45afc8=this;return new Promise(function(_0x53eece,_0x566e0d){return db[_0xe849('0x19')]['find']({'raw':_0xf0e284[_0xe849('0x1b')]?_0xf0e284[_0xe849('0x1b')][_0xe849('0x1c')]===undefined?!![]:![]:!![],'where':_0xf0e284[_0xe849('0x1b')]?_0xf0e284[_0xe849('0x1b')][_0xe849('0x1d')]||null:null,'attributes':_0xf0e284[_0xe849('0x1b')]?_0xf0e284[_0xe849('0x1b')][_0xe849('0x1e')]||null:null,'include':_0xf0e284[_0xe849('0x1b')]?_0xf0e284['options'][_0xe849('0x20')]?_[_0xe849('0x22')](_0xf0e284[_0xe849('0x1b')][_0xe849('0x20')],function(_0x1e3c0d){return{'model':db[_0x1e3c0d['model']],'as':_0x1e3c0d['as'],'attributes':_0x1e3c0d[_0xe849('0x1e')],'include':_0x1e3c0d[_0xe849('0x20')]?_[_0xe849('0x22')](_0x1e3c0d[_0xe849('0x20')],function(_0x40a1fe){return{'model':db[_0x40a1fe[_0xe849('0x21')]],'as':_0x40a1fe['as'],'attributes':_0x40a1fe[_0xe849('0x1e')],'include':_0x40a1fe['include']?_[_0xe849('0x22')](_0x40a1fe[_0xe849('0x20')],function(_0x7dcff9){return{'model':db[_0x7dcff9[_0xe849('0x21')]],'as':_0x7dcff9['as'],'attributes':_0x7dcff9[_0xe849('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe849('0x26')](function(_0x581c45){logger['info'](_0xe849('0x25'),_0xf0e284);logger['debug']('ShowWhatsappQueue',_0xf0e284,JSON[_0xe849('0x15')](_0x581c45));_0x53eece(_0x581c45);})[_0xe849('0x24')](function(_0x404c63){logger[_0xe849('0x16')](_0xe849('0x25'),_0x404c63['message'],_0xf0e284);_0x566e0d(_0x45afc8[_0xe849('0x16')](0x1f4,_0x404c63[_0xe849('0x18')]));});});}; \ No newline at end of file +var _0x3298=['WhatsappQueue,\x20%s,\x20%s','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','catch','ShowWhatsappQueue','find','where','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3298,0x182));var _0x8329=function(_0x28fab8,_0x5e9d0a){_0x28fab8=_0x28fab8-0x0;var _0x2a326c=_0x3298[_0x28fab8];return _0x2a326c;};'use strict';var _=require('lodash');var util=require(_0x8329('0x0'));var moment=require(_0x8329('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8329('0x2'));var db=require(_0x8329('0x3'))['db'];var utils=require(_0x8329('0x4'));var logger=require(_0x8329('0x5'))(_0x8329('0x6'));var config=require(_0x8329('0x7'));var jayson=require(_0x8329('0x8'));var client=jayson[_0x8329('0x9')]['http']({'port':0x232a});config[_0x8329('0xa')]=_[_0x8329('0xb')](config[_0x8329('0xa')],{'host':_0x8329('0xc'),'port':0x18eb});var socket=require(_0x8329('0xd'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x8329('0xe')](socket);function respondWithRpcPromise(_0x5d0508,_0x1eb034,_0x599f71){return new BPromise(function(_0x5085b8,_0x104fdd){return client[_0x8329('0xf')](_0x5d0508,_0x599f71)[_0x8329('0x10')](function(_0x3dd6b4){logger[_0x8329('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x1eb034,_0x8329('0x12'));logger[_0x8329('0x13')](_0x8329('0x14'),_0x1eb034,_0x8329('0x12'),JSON[_0x8329('0x15')](_0x3dd6b4));if(_0x3dd6b4['error']){if(_0x3dd6b4['error'][_0x8329('0x16')]===0x1f4){logger[_0x8329('0x17')](_0x8329('0x18'),_0x1eb034,_0x3dd6b4[_0x8329('0x17')][_0x8329('0x19')]);return _0x104fdd(_0x3dd6b4[_0x8329('0x17')][_0x8329('0x19')]);}logger[_0x8329('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x1eb034,_0x3dd6b4[_0x8329('0x17')][_0x8329('0x19')]);return _0x5085b8(_0x3dd6b4[_0x8329('0x17')][_0x8329('0x19')]);}else{logger[_0x8329('0x11')](_0x8329('0x18'),_0x1eb034,'request\x20sent');_0x5085b8(_0x3dd6b4[_0x8329('0x1a')]['message']);}})['catch'](function(_0x375e46){logger[_0x8329('0x17')](_0x8329('0x18'),_0x1eb034,_0x375e46);_0x104fdd(_0x375e46);});});}exports[_0x8329('0x1b')]=function(_0x224922){var _0x118969=this;return new Promise(function(_0x284a6e,_0x4cc5a0){return db[_0x8329('0x1c')][_0x8329('0x1d')]({'raw':_0x224922[_0x8329('0x1e')]?_0x224922[_0x8329('0x1e')][_0x8329('0x1f')]===undefined?!![]:![]:!![],'where':_0x224922[_0x8329('0x1e')]?_0x224922[_0x8329('0x1e')]['where']||null:null,'attributes':_0x224922[_0x8329('0x1e')]?_0x224922['options'][_0x8329('0x20')]||null:null,'limit':_0x224922[_0x8329('0x1e')]?_0x224922[_0x8329('0x1e')][_0x8329('0x21')]||null:null,'include':_0x224922[_0x8329('0x1e')]?_0x224922[_0x8329('0x1e')][_0x8329('0x22')]?_[_0x8329('0x23')](_0x224922['options']['include'],function(_0x1d0bbe){return{'model':db[_0x1d0bbe[_0x8329('0x24')]],'as':_0x1d0bbe['as'],'attributes':_0x1d0bbe[_0x8329('0x20')],'include':_0x1d0bbe[_0x8329('0x22')]?_[_0x8329('0x23')](_0x1d0bbe['include'],function(_0x9a2c0b){return{'model':db[_0x9a2c0b[_0x8329('0x24')]],'as':_0x9a2c0b['as'],'attributes':_0x9a2c0b[_0x8329('0x20')],'include':_0x9a2c0b[_0x8329('0x22')]?_['map'](_0x9a2c0b['include'],function(_0x2b1c50){return{'model':db[_0x2b1c50[_0x8329('0x24')]],'as':_0x2b1c50['as'],'attributes':_0x2b1c50[_0x8329('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8329('0x10')](function(_0xbd526a){logger[_0x8329('0x11')](_0x8329('0x1b'),_0x224922);logger[_0x8329('0x13')](_0x8329('0x1b'),_0x224922,JSON[_0x8329('0x15')](_0xbd526a));_0x284a6e(_0xbd526a);})[_0x8329('0x25')](function(_0x419cbc){logger[_0x8329('0x17')](_0x8329('0x1b'),_0x419cbc['message'],_0x224922);_0x4cc5a0(_0x118969[_0x8329('0x17')](0x1f4,_0x419cbc[_0x8329('0x19')]));});});};exports[_0x8329('0x26')]=function(_0x3bf142){var _0x1e85f7=this;return new Promise(function(_0x1dc626,_0x187300){return db['WhatsappQueue'][_0x8329('0x27')]({'raw':_0x3bf142['options']?_0x3bf142[_0x8329('0x1e')][_0x8329('0x1f')]===undefined?!![]:![]:!![],'where':_0x3bf142[_0x8329('0x1e')]?_0x3bf142[_0x8329('0x1e')][_0x8329('0x28')]||null:null,'attributes':_0x3bf142['options']?_0x3bf142[_0x8329('0x1e')][_0x8329('0x20')]||null:null,'include':_0x3bf142[_0x8329('0x1e')]?_0x3bf142['options'][_0x8329('0x22')]?_[_0x8329('0x23')](_0x3bf142[_0x8329('0x1e')][_0x8329('0x22')],function(_0x4297a1){return{'model':db[_0x4297a1[_0x8329('0x24')]],'as':_0x4297a1['as'],'attributes':_0x4297a1[_0x8329('0x20')],'include':_0x4297a1[_0x8329('0x22')]?_[_0x8329('0x23')](_0x4297a1[_0x8329('0x22')],function(_0x12fc7d){return{'model':db[_0x12fc7d['model']],'as':_0x12fc7d['as'],'attributes':_0x12fc7d['attributes'],'include':_0x12fc7d[_0x8329('0x22')]?_[_0x8329('0x23')](_0x12fc7d['include'],function(_0x34caab){return{'model':db[_0x34caab[_0x8329('0x24')]],'as':_0x34caab['as'],'attributes':_0x34caab[_0x8329('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8329('0x10')](function(_0x1e0d37){logger[_0x8329('0x11')](_0x8329('0x26'),_0x3bf142);logger[_0x8329('0x13')](_0x8329('0x26'),_0x3bf142,JSON[_0x8329('0x15')](_0x1e0d37));_0x1dc626(_0x1e0d37);})[_0x8329('0x25')](function(_0x3bf92c){logger[_0x8329('0x17')]('ShowWhatsappQueue',_0x3bf92c[_0x8329('0x19')],_0x3bf142);_0x187300(_0x1e85f7[_0x8329('0x17')](0x1f4,_0x3bf92c[_0x8329('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 600a2ca..4cc8c59 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 _0xcb8d=['save','remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0xf81e99,_0x282a09){var _0x4bdf2a=function(_0x5f2602){while(--_0x5f2602){_0xf81e99['push'](_0xf81e99['shift']());}};_0x4bdf2a(++_0x282a09);}(_0xcb8d,0xd7));var _0xdcb8=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xcb8d[_0x220f3f];return _0x1f170e;};'use strict';var WhatsappQueueEvents=require(_0xdcb8('0x0'));var events=[_0xdcb8('0x1'),_0xdcb8('0x2'),_0xdcb8('0x3')];function createListener(_0x4566c0,_0x1926a5){return function(_0x1c081b){_0x1926a5[_0xdcb8('0x4')](_0x4566c0,_0x1c081b);};}function removeListener(_0x13afde,_0x2f12bf){return function(){WhatsappQueueEvents[_0xdcb8('0x5')](_0x13afde,_0x2f12bf);};}exports[_0xdcb8('0x6')]=function(_0x4188e7){for(var _0x45b68e=0x0,_0x199005=events[_0xdcb8('0x7')];_0x45b68e<_0x199005;_0x45b68e++){var _0x156b35=events[_0x45b68e];var _0x5552ce=createListener(_0xdcb8('0x8')+_0x156b35,_0x4188e7);WhatsappQueueEvents['on'](_0x156b35,_0x5552ce);}}; \ No newline at end of file +var _0xd566=['remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0xc19dfb,_0x29ba0c){var _0x1061b1=function(_0x22ae12){while(--_0x22ae12){_0xc19dfb['push'](_0xc19dfb['shift']());}};_0x1061b1(++_0x29ba0c);}(_0xd566,0x1cf));var _0x6d56=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd566[_0x4b369d];return _0x571a98;};'use strict';var WhatsappQueueEvents=require(_0x6d56('0x0'));var events=['save',_0x6d56('0x1'),_0x6d56('0x2')];function createListener(_0x21c45b,_0x36a641){return function(_0x35e0f){_0x36a641[_0x6d56('0x3')](_0x21c45b,_0x35e0f);};}function removeListener(_0x4533d7,_0x14a3c0){return function(){WhatsappQueueEvents[_0x6d56('0x4')](_0x4533d7,_0x14a3c0);};}exports[_0x6d56('0x5')]=function(_0x5ea150){for(var _0x1baf8e=0x0,_0x400ee2=events[_0x6d56('0x6')];_0x1baf8e<_0x400ee2;_0x1baf8e++){var _0x32c3c1=events[_0x1baf8e];var _0x46ca58=createListener(_0x6d56('0x7')+_0x32c3c1,_0x5ea150);WhatsappQueueEvents['on'](_0x32c3c1,_0x46ca58);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 7b8ad24..407bc64 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 _0xb1ae=['/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x3cf3e4,_0x508c06){var _0x1018a8=function(_0x1791d9){while(--_0x1791d9){_0x3cf3e4['push'](_0x3cf3e4['shift']());}};_0x1018a8(++_0x508c06);}(_0xb1ae,0x185));var _0xeb1a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xeb1a('0x0'));var util=require(_0xeb1a('0x1'));var path=require(_0xeb1a('0x2'));var timeout=require(_0xeb1a('0x3'));var express=require(_0xeb1a('0x4'));var router=express[_0xeb1a('0x5')]();var fs_extra=require(_0xeb1a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xeb1a('0x7'));var config=require(_0xeb1a('0x8'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0xeb1a('0x9')](),controller['index']);router[_0xeb1a('0xa')](_0xeb1a('0xb'),auth[_0xeb1a('0x9')](),controller[_0xeb1a('0xc')]);router['get'](_0xeb1a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xeb1a('0xe')]('/',auth['isAuthenticated'](),controller[_0xeb1a('0xf')]);router[_0xeb1a('0x10')](_0xeb1a('0xd'),auth[_0xeb1a('0x9')](),controller['update']);router[_0xeb1a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xeb1a('0x12')]);module[_0xeb1a('0x13')]=router; \ No newline at end of file +var _0xe2c7=['./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1af8bb,_0x5acd34){var _0x1704b8=function(_0x395922){while(--_0x395922){_0x1af8bb['push'](_0x1af8bb['shift']());}};_0x1704b8(++_0x5acd34);}(_0xe2c7,0x1ac));var _0x7e2c=function(_0x7d5a8b,_0x2aedef){_0x7d5a8b=_0x7d5a8b-0x0;var _0x56ac46=_0xe2c7[_0x7d5a8b];return _0x56ac46;};'use strict';var multer=require(_0x7e2c('0x0'));var util=require(_0x7e2c('0x1'));var path=require(_0x7e2c('0x2'));var timeout=require(_0x7e2c('0x3'));var express=require(_0x7e2c('0x4'));var router=express[_0x7e2c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7e2c('0x6'));var interaction=require(_0x7e2c('0x7'));var config=require(_0x7e2c('0x8'));var controller=require(_0x7e2c('0x9'));router['get']('/',auth[_0x7e2c('0xa')](),controller[_0x7e2c('0xb')]);router[_0x7e2c('0xc')](_0x7e2c('0xd'),auth[_0x7e2c('0xa')](),controller[_0x7e2c('0xe')]);router[_0x7e2c('0xc')](_0x7e2c('0xf'),auth[_0x7e2c('0xa')](),controller[_0x7e2c('0x10')]);router[_0x7e2c('0x11')]('/',auth['isAuthenticated'](),controller[_0x7e2c('0x12')]);router[_0x7e2c('0x13')](_0x7e2c('0xf'),auth[_0x7e2c('0xa')](),controller['update']);router[_0x7e2c('0x14')](_0x7e2c('0xf'),auth['isAuthenticated'](),controller[_0x7e2c('0x15')]);module[_0x7e2c('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 0c6e049..08cfdef 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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x252e1b,_0x53c017){var _0x4d5f86=function(_0x41f39f){while(--_0x41f39f){_0x252e1b['push'](_0x252e1b['shift']());}};_0x4d5f86(++_0x53c017);}(_0x7a54,0x106));var _0x47a5=function(_0x27430e,_0x4219b6){_0x27430e=_0x27430e-0x0;var _0x551e1c=_0x7a54[_0x27430e];return _0x551e1c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1bee04,_0x515ba3){var _0x157bfc=function(_0x19eff0){while(--_0x19eff0){_0x1bee04['push'](_0x1bee04['shift']());}};_0x157bfc(++_0x515ba3);}(_0x7a54,0x106));var _0x47a5=function(_0x2bf752,_0x2ca962){_0x2bf752=_0x2bf752-0x0;var _0x153116=_0x7a54[_0x2bf752];return _0x153116;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index ca2a013..4ac6b67 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 _0xdb94=['length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields'];(function(_0x50802a,_0x3094b1){var _0x2ca906=function(_0x2ec080){while(--_0x2ec080){_0x50802a['push'](_0x50802a['shift']());}};_0x2ca906(++_0x3094b1);}(_0xdb94,0xab));var _0x4db9=function(_0x43585d,_0x30f5f8){_0x43585d=_0x43585d-0x0;var _0x45be42=_0xdb94[_0x43585d];return _0x45be42;};'use strict';var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require(_0x4db9('0x2'));var jsonpatch=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var moment=require('moment');var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db9('0x8'));var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31222b,_0x5e644c){_0x5e644c=_0x5e644c||0xcc;return function(_0x571685){if(_0x571685){return _0x31222b[_0x4db9('0x17')](_0x5e644c);}return _0x31222b[_0x4db9('0x18')](_0x5e644c)['end']();};}function respondWithResult(_0xd37d63,_0x1f9638){_0x1f9638=_0x1f9638||0xc8;return function(_0x452896){if(_0x452896){return _0xd37d63[_0x4db9('0x18')](_0x1f9638)['json'](_0x452896);}};}function respondWithFilteredResult(_0x5e04ab,_0x102274){return function(_0x34de1a){if(_0x34de1a){var _0x4a037f=typeof _0x102274[_0x4db9('0x19')]===_0x4db9('0x1a')&&typeof _0x102274['limit']==='undefined';var _0x250a80=_0x34de1a[_0x4db9('0x1b')];var _0x462af3=_0x4a037f?0x0:_0x102274[_0x4db9('0x19')];var _0x1d3c33=_0x4a037f?_0x34de1a['count']:_0x102274[_0x4db9('0x19')]+_0x102274[_0x4db9('0x1c')];var _0x11012e;if(_0x1d3c33>=_0x250a80){_0x1d3c33=_0x250a80;_0x11012e=0xc8;}else{_0x11012e=0xce;}_0x5e04ab['status'](_0x11012e);return _0x5e04ab[_0x4db9('0x1d')](_0x4db9('0x1e'),_0x462af3+'-'+_0x1d3c33+'/'+_0x250a80)[_0x4db9('0x1f')](_0x34de1a);}return null;};}function patchUpdates(_0x4c92e8){return function(_0x46b522){try{jsonpatch[_0x4db9('0x20')](_0x46b522,_0x4c92e8,!![]);}catch(_0x4553c2){return BPromise[_0x4db9('0x21')](_0x4553c2);}return _0x46b522[_0x4db9('0x22')]();};}function saveUpdates(_0x159d9b,_0x3585d5){return function(_0x5aef3b){if(_0x5aef3b){return _0x5aef3b[_0x4db9('0x23')](_0x159d9b)[_0x4db9('0x24')](function(_0xcde40c){return _0xcde40c;});}return null;};}function removeEntity(_0x319475,_0x4aaa84){return function(_0x213daa){if(_0x213daa){return _0x213daa[_0x4db9('0x25')]()['then'](function(){_0x319475[_0x4db9('0x18')](0xcc)[_0x4db9('0x26')]();});}};}function handleEntityNotFound(_0x2987c6,_0x4dbb1b){return function(_0x3c8237){if(!_0x3c8237){_0x2987c6[_0x4db9('0x17')](0x194);}return _0x3c8237;};}function handleError(_0x43b95e,_0x2d330e){_0x2d330e=_0x2d330e||0x1f4;return function(_0x3f9f7e){logger[_0x4db9('0x27')](_0x3f9f7e[_0x4db9('0x28')]);if(_0x3f9f7e[_0x4db9('0x29')]){delete _0x3f9f7e[_0x4db9('0x29')];}_0x43b95e[_0x4db9('0x18')](_0x2d330e)[_0x4db9('0x2a')](_0x3f9f7e);};}exports[_0x4db9('0x2b')]=function(_0x2d646d,_0x20f133){var _0x583861={},_0x5031fe={},_0x3951b2={'count':0x0,'rows':[]};var _0x331279=_[_0x4db9('0x2c')](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x459131){return{'name':_0x459131['fieldName'],'type':_0x459131[_0x4db9('0x2f')]['key']};});_0x5031fe[_0x4db9('0x30')]=_[_0x4db9('0x2c')](_0x331279,_0x4db9('0x29'));_0x5031fe[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x2d646d['query']);_0x5031fe['filters']=_[_0x4db9('0x33')](_0x5031fe['model'],_0x5031fe[_0x4db9('0x31')]);_0x583861[_0x4db9('0x34')]=_['intersection'](_0x5031fe[_0x4db9('0x30')],qs[_0x4db9('0x35')](_0x2d646d[_0x4db9('0x31')]['fields']));_0x583861[_0x4db9('0x34')]=_0x583861['attributes'][_0x4db9('0x36')]?_0x583861[_0x4db9('0x34')]:_0x5031fe[_0x4db9('0x30')];if(!_0x2d646d['query']['hasOwnProperty'](_0x4db9('0x37'))){_0x583861[_0x4db9('0x1c')]=qs[_0x4db9('0x1c')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x1c')]);_0x583861[_0x4db9('0x19')]=qs[_0x4db9('0x19')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x19')]);}_0x583861['order']=qs[_0x4db9('0x38')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x38')]);_0x583861[_0x4db9('0x39')]=qs['filters'](_[_0x4db9('0x3a')](_0x2d646d[_0x4db9('0x31')],_0x5031fe[_0x4db9('0x3b')]),_0x331279);if(_0x2d646d['query'][_0x4db9('0x3c')]){_0x583861[_0x4db9('0x39')]=_[_0x4db9('0x3d')](_0x583861[_0x4db9('0x39')],{'$or':_['map'](_0x331279,function(_0x5a78b4){if(_0x5a78b4[_0x4db9('0x2f')]!==_0x4db9('0x3e')){var _0x32e62b={};_0x32e62b[_0x5a78b4[_0x4db9('0x29')]]={'$like':'%'+_0x2d646d[_0x4db9('0x31')]['filter']+'%'};return _0x32e62b;}})});}_0x583861=_[_0x4db9('0x3d')]({},_0x583861,_0x2d646d[_0x4db9('0x3f')]);var _0x23affc={'where':_0x583861[_0x4db9('0x39')]};return db[_0x4db9('0x2d')]['count'](_0x23affc)[_0x4db9('0x24')](function(_0x324765){_0x3951b2[_0x4db9('0x1b')]=_0x324765;if(_0x2d646d['query'][_0x4db9('0x40')]){_0x583861[_0x4db9('0x41')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x42')](_0x583861);})[_0x4db9('0x24')](function(_0x24aa2a){_0x3951b2[_0x4db9('0x43')]=_0x24aa2a;return _0x3951b2;})[_0x4db9('0x24')](respondWithFilteredResult(_0x20f133,_0x583861))[_0x4db9('0x44')](handleError(_0x20f133,null));};exports[_0x4db9('0x45')]=function(_0x4bb740,_0x56bd68){var _0x48aaf5={'raw':!![],'where':{'id':_0x4bb740[_0x4db9('0x46')]['id']}},_0x22a021={};_0x22a021['model']=_[_0x4db9('0x32')](db[_0x4db9('0x2d')]['rawAttributes']);_0x22a021['query']=_[_0x4db9('0x32')](_0x4bb740['query']);_0x22a021[_0x4db9('0x3b')]=_[_0x4db9('0x33')](_0x22a021['model'],_0x22a021[_0x4db9('0x31')]);_0x48aaf5[_0x4db9('0x34')]=_['intersection'](_0x22a021[_0x4db9('0x30')],qs[_0x4db9('0x35')](_0x4bb740[_0x4db9('0x31')]['fields']));_0x48aaf5['attributes']=_0x48aaf5[_0x4db9('0x34')][_0x4db9('0x36')]?_0x48aaf5[_0x4db9('0x34')]:_0x22a021[_0x4db9('0x30')];if(_0x4bb740[_0x4db9('0x31')][_0x4db9('0x40')]){_0x48aaf5[_0x4db9('0x41')]=[{'all':!![]}];}_0x48aaf5=_[_0x4db9('0x3d')]({},_0x48aaf5,_0x4bb740[_0x4db9('0x3f')]);return db[_0x4db9('0x2d')][_0x4db9('0x47')](_0x48aaf5)[_0x4db9('0x24')](handleEntityNotFound(_0x56bd68,null))[_0x4db9('0x24')](respondWithResult(_0x56bd68,null))['catch'](handleError(_0x56bd68,null));};exports[_0x4db9('0x48')]=function(_0x2faacf,_0x3852f0){return db[_0x4db9('0x2d')][_0x4db9('0x48')](_0x2faacf[_0x4db9('0x49')],{})[_0x4db9('0x24')](respondWithResult(_0x3852f0,0xc9))[_0x4db9('0x44')](handleError(_0x3852f0,null));};exports[_0x4db9('0x23')]=function(_0x2d6094,_0x10dccb){if(_0x2d6094['body']['id']){delete _0x2d6094['body']['id'];}return db[_0x4db9('0x2d')][_0x4db9('0x47')]({'where':{'id':_0x2d6094[_0x4db9('0x46')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0x10dccb,null))[_0x4db9('0x24')](saveUpdates(_0x2d6094[_0x4db9('0x49')],null))[_0x4db9('0x24')](respondWithResult(_0x10dccb,null))[_0x4db9('0x44')](handleError(_0x10dccb,null));};exports['destroy']=function(_0xd8eae3,_0xcb832e){return db[_0x4db9('0x2d')][_0x4db9('0x47')]({'where':{'id':_0xd8eae3[_0x4db9('0x46')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0xcb832e,null))[_0x4db9('0x24')](removeEntity(_0xcb832e,null))[_0x4db9('0x44')](handleError(_0xcb832e,null));};exports['describe']=function(_0x45bc79,_0xd6701a){return db[_0x4db9('0x2d')][_0x4db9('0x4a')]()[_0x4db9('0x24')](respondWithResult(_0xd6701a,null))[_0x4db9('0x44')](handleError(_0xd6701a,null));}; \ No newline at end of file +var _0xbc9d=['index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','map','type','merge','options','WhatsappQueueReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','stack','name','send'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x41ef55,_0xb33f15){_0x41ef55=_0x41ef55-0x0;var _0x3574d3=_0xbc9d[_0x41ef55];return _0x3574d3;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];function respondWithStatusCode(_0x103d54,_0x48bc83){_0x48bc83=_0x48bc83||0xcc;return function(_0x567e71){if(_0x567e71){return _0x103d54[_0xdbc9('0x19')](_0x48bc83);}return _0x103d54[_0xdbc9('0x1a')](_0x48bc83)[_0xdbc9('0x1b')]();};}function respondWithResult(_0x436e50,_0x53495d){_0x53495d=_0x53495d||0xc8;return function(_0x4a9dcb){if(_0x4a9dcb){return _0x436e50[_0xdbc9('0x1a')](_0x53495d)[_0xdbc9('0x1c')](_0x4a9dcb);}};}function respondWithFilteredResult(_0x3a8a7b,_0x4c7b4f){return function(_0x1b4616){if(_0x1b4616){var _0x1abee8=typeof _0x4c7b4f['offset']===_0xdbc9('0x1d')&&typeof _0x4c7b4f[_0xdbc9('0x1e')]===_0xdbc9('0x1d');var _0x14e655=_0x1b4616[_0xdbc9('0x1f')];var _0x33f1bd=_0x1abee8?0x0:_0x4c7b4f[_0xdbc9('0x20')];var _0xc2ddd2=_0x1abee8?_0x1b4616[_0xdbc9('0x1f')]:_0x4c7b4f[_0xdbc9('0x20')]+_0x4c7b4f['limit'];var _0x1ca5fd;if(_0xc2ddd2>=_0x14e655){_0xc2ddd2=_0x14e655;_0x1ca5fd=0xc8;}else{_0x1ca5fd=0xce;}_0x3a8a7b['status'](_0x1ca5fd);return _0x3a8a7b[_0xdbc9('0x21')](_0xdbc9('0x22'),_0x33f1bd+'-'+_0xc2ddd2+'/'+_0x14e655)['json'](_0x1b4616);}return null;};}function patchUpdates(_0x4408e9){return function(_0x5367dc){try{jsonpatch['apply'](_0x5367dc,_0x4408e9,!![]);}catch(_0x4ab00d){return BPromise['reject'](_0x4ab00d);}return _0x5367dc[_0xdbc9('0x23')]();};}function saveUpdates(_0x2011a2,_0x570ad9){return function(_0x16dcf7){if(_0x16dcf7){return _0x16dcf7[_0xdbc9('0x24')](_0x2011a2)['then'](function(_0x1bc073){return _0x1bc073;});}return null;};}function removeEntity(_0x6b788,_0x1b1c0d){return function(_0x119230){if(_0x119230){return _0x119230[_0xdbc9('0x25')]()[_0xdbc9('0x26')](function(){_0x6b788[_0xdbc9('0x1a')](0xcc)[_0xdbc9('0x1b')]();});}};}function handleEntityNotFound(_0x3c8c1d,_0x4a868b){return function(_0x550bef){if(!_0x550bef){_0x3c8c1d[_0xdbc9('0x19')](0x194);}return _0x550bef;};}function handleError(_0x446ab9,_0x1053ca){_0x1053ca=_0x1053ca||0x1f4;return function(_0x24fdec){logger['error'](_0x24fdec[_0xdbc9('0x27')]);if(_0x24fdec[_0xdbc9('0x28')]){delete _0x24fdec['name'];}_0x446ab9['status'](_0x1053ca)[_0xdbc9('0x29')](_0x24fdec);};}exports[_0xdbc9('0x2a')]=function(_0x473430,_0x59bfd2){var _0x13a432={},_0x539e57={},_0x561f8e={'count':0x0,'rows':[]};var _0x210a40=_['map'](db['WhatsappQueueReport'][_0xdbc9('0x2b')],function(_0x20eb4f){return{'name':_0x20eb4f[_0xdbc9('0x2c')],'type':_0x20eb4f['type'][_0xdbc9('0x2d')]};});_0x539e57[_0xdbc9('0x2e')]=_['map'](_0x210a40,'name');_0x539e57[_0xdbc9('0x2f')]=_[_0xdbc9('0x30')](_0x473430[_0xdbc9('0x2f')]);_0x539e57[_0xdbc9('0x31')]=_[_0xdbc9('0x32')](_0x539e57[_0xdbc9('0x2e')],_0x539e57[_0xdbc9('0x2f')]);_0x13a432['attributes']=_[_0xdbc9('0x32')](_0x539e57[_0xdbc9('0x2e')],qs[_0xdbc9('0x33')](_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x33')]));_0x13a432[_0xdbc9('0x34')]=_0x13a432['attributes'][_0xdbc9('0x35')]?_0x13a432['attributes']:_0x539e57['model'];if(!_0x473430['query']['hasOwnProperty']('nolimit')){_0x13a432[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x473430[_0xdbc9('0x2f')]['limit']);_0x13a432[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x20')]);}_0x13a432[_0xdbc9('0x36')]=qs[_0xdbc9('0x37')](_0x473430['query'][_0xdbc9('0x37')]);_0x13a432[_0xdbc9('0x38')]=qs[_0xdbc9('0x31')](_['pick'](_0x473430[_0xdbc9('0x2f')],_0x539e57[_0xdbc9('0x31')]),_0x210a40);if(_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x39')]){_0x13a432['where']=_['merge'](_0x13a432[_0xdbc9('0x38')],{'$or':_[_0xdbc9('0x3a')](_0x210a40,function(_0x136392){if(_0x136392[_0xdbc9('0x3b')]!=='VIRTUAL'){var _0x1b651f={};_0x1b651f[_0x136392[_0xdbc9('0x28')]]={'$like':'%'+_0x473430[_0xdbc9('0x2f')]['filter']+'%'};return _0x1b651f;}})});}_0x13a432=_[_0xdbc9('0x3c')]({},_0x13a432,_0x473430[_0xdbc9('0x3d')]);var _0x444219={'where':_0x13a432['where']};return db[_0xdbc9('0x3e')][_0xdbc9('0x1f')](_0x444219)['then'](function(_0x5173c2){_0x561f8e[_0xdbc9('0x1f')]=_0x5173c2;if(_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x3f')]){_0x13a432[_0xdbc9('0x40')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0xdbc9('0x41')](_0x13a432);})[_0xdbc9('0x26')](function(_0x577725){_0x561f8e[_0xdbc9('0x42')]=_0x577725;return _0x561f8e;})[_0xdbc9('0x26')](respondWithFilteredResult(_0x59bfd2,_0x13a432))['catch'](handleError(_0x59bfd2,null));};exports[_0xdbc9('0x43')]=function(_0x72dee3,_0x2adb23){var _0x3415c3={'raw':!![],'where':{'id':_0x72dee3[_0xdbc9('0x44')]['id']}},_0x3ed4de={};_0x3ed4de[_0xdbc9('0x2e')]=_['keys'](db['WhatsappQueueReport'][_0xdbc9('0x2b')]);_0x3ed4de[_0xdbc9('0x2f')]=_[_0xdbc9('0x30')](_0x72dee3[_0xdbc9('0x2f')]);_0x3ed4de[_0xdbc9('0x31')]=_[_0xdbc9('0x32')](_0x3ed4de[_0xdbc9('0x2e')],_0x3ed4de[_0xdbc9('0x2f')]);_0x3415c3[_0xdbc9('0x34')]=_[_0xdbc9('0x32')](_0x3ed4de[_0xdbc9('0x2e')],qs['fields'](_0x72dee3['query'][_0xdbc9('0x33')]));_0x3415c3[_0xdbc9('0x34')]=_0x3415c3[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0x3415c3[_0xdbc9('0x34')]:_0x3ed4de[_0xdbc9('0x2e')];if(_0x72dee3[_0xdbc9('0x2f')][_0xdbc9('0x3f')]){_0x3415c3['include']=[{'all':!![]}];}_0x3415c3=_['merge']({},_0x3415c3,_0x72dee3[_0xdbc9('0x3d')]);return db[_0xdbc9('0x3e')][_0xdbc9('0x45')](_0x3415c3)[_0xdbc9('0x26')](handleEntityNotFound(_0x2adb23,null))[_0xdbc9('0x26')](respondWithResult(_0x2adb23,null))[_0xdbc9('0x46')](handleError(_0x2adb23,null));};exports[_0xdbc9('0x47')]=function(_0x2ea096,_0x43e3ec){return db['WhatsappQueueReport'][_0xdbc9('0x47')](_0x2ea096[_0xdbc9('0x48')],{})['then'](respondWithResult(_0x43e3ec,0xc9))['catch'](handleError(_0x43e3ec,null));};exports[_0xdbc9('0x24')]=function(_0xc3db3c,_0x133a13){if(_0xc3db3c['body']['id']){delete _0xc3db3c[_0xdbc9('0x48')]['id'];}return db[_0xdbc9('0x3e')][_0xdbc9('0x45')]({'where':{'id':_0xc3db3c[_0xdbc9('0x44')]['id']}})['then'](handleEntityNotFound(_0x133a13,null))[_0xdbc9('0x26')](saveUpdates(_0xc3db3c[_0xdbc9('0x48')],null))[_0xdbc9('0x26')](respondWithResult(_0x133a13,null))[_0xdbc9('0x46')](handleError(_0x133a13,null));};exports['destroy']=function(_0x3e89f5,_0x36c70e){return db[_0xdbc9('0x3e')][_0xdbc9('0x45')]({'where':{'id':_0x3e89f5[_0xdbc9('0x44')]['id']}})[_0xdbc9('0x26')](handleEntityNotFound(_0x36c70e,null))[_0xdbc9('0x26')](removeEntity(_0x36c70e,null))[_0xdbc9('0x46')](handleError(_0x36c70e,null));};exports['describe']=function(_0x1c6e6e,_0x4d09e1){return db[_0xdbc9('0x3e')][_0xdbc9('0x49')]()['then'](respondWithResult(_0x4d09e1,null))['catch'](handleError(_0x4d09e1,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 2f19984..9c900d3 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 _0xf158=['request-promise','path','rimraf','./whatsappQueueReport.attributes','WhatsappQueueReport','uniqueid','lodash','util','moment','bluebird'];(function(_0x308e3b,_0x5c67e9){var _0x326fe6=function(_0x174a9e){while(--_0x174a9e){_0x308e3b['push'](_0x308e3b['shift']());}};_0x326fe6(++_0x5c67e9);}(_0xf158,0x1d2));var _0x8f15=function(_0xcbe624,_0x42d09d){_0xcbe624=_0xcbe624-0x0;var _0x40a5b2=_0xf158[_0xcbe624];return _0x40a5b2;};'use strict';var _=require(_0x8f15('0x0'));var util=require(_0x8f15('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8f15('0x2'));var BPromise=require(_0x8f15('0x3'));var rp=require(_0x8f15('0x4'));var fs=require('fs');var path=require(_0x8f15('0x5'));var rimraf=require(_0x8f15('0x6'));var config=require('../../config/environment');var attributes=require(_0x8f15('0x7'));module['exports']=function(_0x45cdaa,_0x348159){return _0x45cdaa['define'](_0x8f15('0x8'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x8f15('0x9'),'fields':[_0x8f15('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3556=['bluebird','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x2c02e4,_0x5ca6a5){var _0x523976=function(_0x5e6fc1){while(--_0x5e6fc1){_0x2c02e4['push'](_0x2c02e4['shift']());}};_0x523976(++_0x5ca6a5);}(_0x3556,0x1b8));var _0x6355=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x3556[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x6355('0x0'));var util=require('util');var logger=require(_0x6355('0x1'))(_0x6355('0x2'));var moment=require(_0x6355('0x3'));var BPromise=require(_0x6355('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6355('0x5'));var rimraf=require('rimraf');var config=require(_0x6355('0x6'));var attributes=require(_0x6355('0x7'));module[_0x6355('0x8')]=function(_0x20709f,_0x44fd57){return _0x20709f[_0x6355('0x9')](_0x6355('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x6355('0xb'),'fields':[_0x6355('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index da6977a..c392e00 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 _0xe590=['jayson/promise','client','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','WhatsappQueueReport','create','body','options','raw','then','CreateWhatsappQueueReport','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x8d98c6,_0x520c06){var _0xef6863=function(_0x1afd0b){while(--_0x1afd0b){_0x8d98c6['push'](_0x8d98c6['shift']());}};_0xef6863(++_0x520c06);}(_0xe590,0x7f));var _0x0e59=function(_0xb66008,_0x4eb6b6){_0xb66008=_0xb66008-0x0;var _0x478ea9=_0xe590[_0xb66008];return _0x478ea9;};'use strict';var _=require(_0x0e59('0x0'));var util=require('util');var moment=require(_0x0e59('0x1'));var BPromise=require(_0x0e59('0x2'));var rs=require(_0x0e59('0x3'));var fs=require('fs');var Redis=require(_0x0e59('0x4'));var db=require(_0x0e59('0x5'))['db'];var utils=require(_0x0e59('0x6'));var logger=require(_0x0e59('0x7'))('rpc');var config=require(_0x0e59('0x8'));var jayson=require(_0x0e59('0x9'));var client=jayson[_0x0e59('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8ff6f5,_0x257f67,_0x1bc99e){return new BPromise(function(_0x294da2,_0x5cb622){return client[_0x0e59('0xb')](_0x8ff6f5,_0x1bc99e)['then'](function(_0x28771c){logger[_0x0e59('0xc')](_0x0e59('0xd'),_0x257f67,_0x0e59('0xe'));logger[_0x0e59('0xf')](_0x0e59('0x10'),_0x257f67,_0x0e59('0xe'),JSON[_0x0e59('0x11')](_0x28771c));if(_0x28771c[_0x0e59('0x12')]){if(_0x28771c['error']['code']===0x1f4){logger[_0x0e59('0x12')](_0x0e59('0xd'),_0x257f67,_0x28771c[_0x0e59('0x12')][_0x0e59('0x13')]);return _0x5cb622(_0x28771c[_0x0e59('0x12')]['message']);}logger[_0x0e59('0x12')](_0x0e59('0xd'),_0x257f67,_0x28771c['error'][_0x0e59('0x13')]);return _0x294da2(_0x28771c[_0x0e59('0x12')][_0x0e59('0x13')]);}else{logger[_0x0e59('0xc')](_0x0e59('0xd'),_0x257f67,'request\x20sent');_0x294da2(_0x28771c[_0x0e59('0x14')][_0x0e59('0x13')]);}})[_0x0e59('0x15')](function(_0x1f12ee){logger[_0x0e59('0x12')](_0x0e59('0xd'),_0x257f67,_0x1f12ee);_0x5cb622(_0x1f12ee);});});}exports['CreateWhatsappQueueReport']=function(_0x244d0f){var _0x349acd=this;return new Promise(function(_0x351e80,_0x24917a){return db[_0x0e59('0x16')][_0x0e59('0x17')](_0x244d0f[_0x0e59('0x18')],{'raw':_0x244d0f[_0x0e59('0x19')]?_0x244d0f[_0x0e59('0x19')][_0x0e59('0x1a')]===undefined?!![]:![]:!![]})[_0x0e59('0x1b')](function(_0x1bb8f8){logger['info'](_0x0e59('0x1c'),_0x244d0f);logger[_0x0e59('0xf')](_0x0e59('0x1c'),_0x244d0f,JSON['stringify'](_0x1bb8f8));_0x351e80(_0x1bb8f8);})[_0x0e59('0x15')](function(_0x24d00d){logger['error'](_0x0e59('0x1c'),_0x24d00d[_0x0e59('0x13')],_0x244d0f);_0x24917a(_0x349acd[_0x0e59('0x12')](0x1f4,_0x24d00d[_0x0e59('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x2ec221){var _0x28c898=this;return new Promise(function(_0x3c58cc,_0x331cda){return db['WhatsappQueueReport'][_0x0e59('0x1d')](_0x2ec221[_0x0e59('0x18')],{'raw':_0x2ec221[_0x0e59('0x19')]?_0x2ec221[_0x0e59('0x19')][_0x0e59('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ec221[_0x0e59('0x19')]?_0x2ec221[_0x0e59('0x19')][_0x0e59('0x1e')]||null:null,'attributes':_0x2ec221['options']?_0x2ec221['options'][_0x0e59('0x1f')]||null:null,'limit':_0x2ec221['options']?_0x2ec221[_0x0e59('0x19')][_0x0e59('0x20')]||null:null})[_0x0e59('0x1b')](function(_0x327ea5){logger['info'](_0x0e59('0x21'),_0x2ec221);logger[_0x0e59('0xf')](_0x0e59('0x21'),_0x2ec221,JSON[_0x0e59('0x11')](_0x327ea5));_0x3c58cc(_0x327ea5);})['catch'](function(_0x17820a){logger['error'](_0x0e59('0x21'),_0x17820a[_0x0e59('0x13')],_0x2ec221);_0x331cda(_0x28c898[_0x0e59('0x12')](0x1f4,_0x17820a[_0x0e59('0x13')]));});});}; \ No newline at end of file +var _0xf123=['WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','where','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2e19ac,_0x5ee48a){var _0x29d578=function(_0x436f90){while(--_0x436f90){_0x2e19ac['push'](_0x2e19ac['shift']());}};_0x29d578(++_0x5ee48a);}(_0xf123,0x134));var _0x3f12=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0xf123[_0x273f77];return _0x71e147;};'use strict';var _=require('lodash');var util=require(_0x3f12('0x0'));var moment=require('moment');var BPromise=require(_0x3f12('0x1'));var rs=require(_0x3f12('0x2'));var fs=require('fs');var Redis=require(_0x3f12('0x3'));var db=require(_0x3f12('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f12('0x5'))(_0x3f12('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f12('0x7'));var client=jayson[_0x3f12('0x8')][_0x3f12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x589443,_0x102c59,_0x4952b3){return new BPromise(function(_0x405186,_0x456ea3){return client[_0x3f12('0xa')](_0x589443,_0x4952b3)[_0x3f12('0xb')](function(_0xacff21){logger[_0x3f12('0xc')](_0x3f12('0xd'),_0x102c59,_0x3f12('0xe'));logger[_0x3f12('0xf')](_0x3f12('0x10'),_0x102c59,'request\x20sent',JSON[_0x3f12('0x11')](_0xacff21));if(_0xacff21[_0x3f12('0x12')]){if(_0xacff21['error'][_0x3f12('0x13')]===0x1f4){logger[_0x3f12('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x102c59,_0xacff21[_0x3f12('0x12')][_0x3f12('0x14')]);return _0x456ea3(_0xacff21['error']['message']);}logger[_0x3f12('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x102c59,_0xacff21['error'][_0x3f12('0x14')]);return _0x405186(_0xacff21[_0x3f12('0x12')]['message']);}else{logger[_0x3f12('0xc')](_0x3f12('0xd'),_0x102c59,'request\x20sent');_0x405186(_0xacff21['result'][_0x3f12('0x14')]);}})[_0x3f12('0x15')](function(_0x185f4b){logger[_0x3f12('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x102c59,_0x185f4b);_0x456ea3(_0x185f4b);});});}exports['CreateWhatsappQueueReport']=function(_0x313188){var _0x50d455=this;return new Promise(function(_0x361c57,_0x5eff18){return db[_0x3f12('0x16')]['create'](_0x313188[_0x3f12('0x17')],{'raw':_0x313188['options']?_0x313188[_0x3f12('0x18')][_0x3f12('0x19')]===undefined?!![]:![]:!![]})[_0x3f12('0xb')](function(_0xd9f2c3){logger[_0x3f12('0xc')](_0x3f12('0x1a'),_0x313188);logger[_0x3f12('0xf')](_0x3f12('0x1a'),_0x313188,JSON[_0x3f12('0x11')](_0xd9f2c3));_0x361c57(_0xd9f2c3);})[_0x3f12('0x15')](function(_0x1e53ae){logger[_0x3f12('0x12')](_0x3f12('0x1a'),_0x1e53ae[_0x3f12('0x14')],_0x313188);_0x5eff18(_0x50d455[_0x3f12('0x12')](0x1f4,_0x1e53ae[_0x3f12('0x14')]));});});};exports[_0x3f12('0x1b')]=function(_0xe22349){var _0x93cf07=this;return new Promise(function(_0x521935,_0x48df32){return db[_0x3f12('0x16')]['update'](_0xe22349['body'],{'raw':_0xe22349[_0x3f12('0x18')]?_0xe22349[_0x3f12('0x18')][_0x3f12('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe22349['options']?_0xe22349[_0x3f12('0x18')][_0x3f12('0x1c')]||null:null,'attributes':_0xe22349['options']?_0xe22349['options'][_0x3f12('0x1d')]||null:null,'limit':_0xe22349[_0x3f12('0x18')]?_0xe22349[_0x3f12('0x18')]['limit']||null:null})['then'](function(_0x1fee42){logger[_0x3f12('0xc')]('UpdateWhatsappQueueReport',_0xe22349);logger['debug'](_0x3f12('0x1b'),_0xe22349,JSON[_0x3f12('0x11')](_0x1fee42));_0x521935(_0x1fee42);})['catch'](function(_0x51cf33){logger[_0x3f12('0x12')](_0x3f12('0x1b'),_0x51cf33[_0x3f12('0x14')],_0xe22349);_0x48df32(_0x93cf07['error'](0x1f4,_0x51cf33[_0x3f12('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 1906a6f..3b48927 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 _0xe8e3=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','update','exports','multer','util'];(function(_0x40a740,_0x5e1944){var _0x2b5bbb=function(_0x2b3bed){while(--_0x2b3bed){_0x40a740['push'](_0x40a740['shift']());}};_0x2b5bbb(++_0x5e1944);}(_0xe8e3,0x166));var _0x3e8e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe8e3[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x3e8e('0x0'));var util=require(_0x3e8e('0x1'));var path=require(_0x3e8e('0x2'));var timeout=require(_0x3e8e('0x3'));var express=require(_0x3e8e('0x4'));var router=express[_0x3e8e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3e8e('0x6'));var interaction=require(_0x3e8e('0x7'));var config=require(_0x3e8e('0x8'));var controller=require(_0x3e8e('0x9'));router[_0x3e8e('0xa')]('/',auth[_0x3e8e('0xb')](),controller[_0x3e8e('0xc')]);router[_0x3e8e('0xa')](_0x3e8e('0xd'),auth[_0x3e8e('0xb')](),controller[_0x3e8e('0xe')]);router[_0x3e8e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3e8e('0xf')]);router['post']('/',auth[_0x3e8e('0xb')](),controller[_0x3e8e('0x10')]);router[_0x3e8e('0x11')]('/:id',auth[_0x3e8e('0xb')](),controller[_0x3e8e('0x12')]);router['delete']('/:id',auth[_0x3e8e('0xb')](),controller['destroy']);module[_0x3e8e('0x13')]=router; \ No newline at end of file +var _0xd766=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','update','delete','destroy','util'];(function(_0x3427cf,_0x5da0a1){var _0x51733c=function(_0x4495ed){while(--_0x4495ed){_0x3427cf['push'](_0x3427cf['shift']());}};_0x51733c(++_0x5da0a1);}(_0xd766,0x84));var _0x6d76=function(_0x44caf2,_0x8ffb16){_0x44caf2=_0x44caf2-0x0;var _0x25978d=_0xd766[_0x44caf2];return _0x25978d;};'use strict';var multer=require('multer');var util=require(_0x6d76('0x0'));var path=require(_0x6d76('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d76('0x2'));var router=express[_0x6d76('0x3')]();var fs_extra=require(_0x6d76('0x4'));var auth=require(_0x6d76('0x5'));var interaction=require(_0x6d76('0x6'));var config=require('../../config/environment');var controller=require(_0x6d76('0x7'));router[_0x6d76('0x8')]('/',auth['isAuthenticated'](),controller[_0x6d76('0x9')]);router[_0x6d76('0x8')](_0x6d76('0xa'),auth[_0x6d76('0xb')](),controller[_0x6d76('0xc')]);router[_0x6d76('0x8')](_0x6d76('0xd'),auth[_0x6d76('0xb')](),controller[_0x6d76('0xe')]);router['post']('/',auth[_0x6d76('0xb')](),controller[_0x6d76('0xf')]);router['put']('/:id',auth[_0x6d76('0xb')](),controller[_0x6d76('0x10')]);router[_0x6d76('0x11')](_0x6d76('0xd'),auth[_0x6d76('0xb')](),controller[_0x6d76('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 1697d8b..90f25bc 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 _0x8c50=['DATE','exports','STRING','account','agent','queue'];(function(_0x279a81,_0x3d7cd5){var _0xe2f86e=function(_0x4b9568){while(--_0x4b9568){_0x279a81['push'](_0x279a81['shift']());}};_0xe2f86e(++_0x3d7cd5);}(_0x8c50,0xcd));var _0x08c5=function(_0x1b266a,_0x39577c){_0x1b266a=_0x1b266a-0x0;var _0x1da7eb=_0x8c50[_0x1b266a];return _0x1da7eb;};'use strict';var Sequelize=require('sequelize');module[_0x08c5('0x0')]={'uniqueid':{'type':Sequelize[_0x08c5('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x08c5('0x2'),_0x08c5('0x3'),_0x08c5('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x08c5('0x5')]}}; \ No newline at end of file +var _0x5a1c=['queue','DATE','sequelize','exports','account'];(function(_0x1d6f59,_0x31cd87){var _0x11884b=function(_0x4a74d6){while(--_0x4a74d6){_0x1d6f59['push'](_0x1d6f59['shift']());}};_0x11884b(++_0x31cd87);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x15d0ed,_0x5698d1){_0x15d0ed=_0x15d0ed-0x0;var _0x548e26=_0x5a1c[_0x15d0ed];return _0x548e26;};'use strict';var Sequelize=require(_0xc5a1('0x0'));module[_0xc5a1('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc5a1('0x2'),'agent',_0xc5a1('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc5a1('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 108d587..86a075e 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 _0x6380=['apply','update','then','destroy','error','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','rawAttributes','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','Content-Range'];(function(_0x48025a,_0x19dbcf){var _0x42ae6a=function(_0x9ea881){while(--_0x9ea881){_0x48025a['push'](_0x48025a['shift']());}};_0x42ae6a(++_0x19dbcf);}(_0x6380,0x159));var _0x0638=function(_0x54de37,_0x1a8a09){_0x54de37=_0x54de37-0x0;var _0x50f433=_0x6380[_0x54de37];return _0x50f433;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0638('0x0'));var zipdir=require(_0x0638('0x1'));var jsonpatch=require(_0x0638('0x2'));var rp=require(_0x0638('0x3'));var moment=require(_0x0638('0x4'));var BPromise=require(_0x0638('0x5'));var Mustache=require(_0x0638('0x6'));var util=require('util');var path=require(_0x0638('0x7'));var sox=require(_0x0638('0x8'));var csv=require(_0x0638('0x9'));var ejs=require(_0x0638('0xa'));var fs=require('fs');var fs_extra=require(_0x0638('0xb'));var _=require(_0x0638('0xc'));var squel=require(_0x0638('0xd'));var crypto=require(_0x0638('0xe'));var jsforce=require(_0x0638('0xf'));var deskjs=require(_0x0638('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0638('0x11'));var Papa=require('papaparse');var Redis=require(_0x0638('0x12'));var authService=require(_0x0638('0x13'));var qs=require(_0x0638('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0638('0x15'))(_0x0638('0x16'));var utils=require(_0x0638('0x17'));var config=require(_0x0638('0x18'));var licenseUtil=require(_0x0638('0x19'));var db=require(_0x0638('0x1a'))['db'];function respondWithStatusCode(_0x53de4a,_0xd426ab){_0xd426ab=_0xd426ab||0xcc;return function(_0xc2c081){if(_0xc2c081){return _0x53de4a[_0x0638('0x1b')](_0xd426ab);}return _0x53de4a['status'](_0xd426ab)[_0x0638('0x1c')]();};}function respondWithResult(_0xc21892,_0x5b4251){_0x5b4251=_0x5b4251||0xc8;return function(_0x109f57){if(_0x109f57){return _0xc21892['status'](_0x5b4251)[_0x0638('0x1d')](_0x109f57);}};}function respondWithFilteredResult(_0x1cda33,_0x4c943c){return function(_0x12515a){if(_0x12515a){var _0x55ae4e=typeof _0x4c943c[_0x0638('0x1e')]===_0x0638('0x1f')&&typeof _0x4c943c[_0x0638('0x20')]===_0x0638('0x1f');var _0x2722b7=_0x12515a['count'];var _0x49ee55=_0x55ae4e?0x0:_0x4c943c[_0x0638('0x1e')];var _0x4d1d03=_0x55ae4e?_0x12515a['count']:_0x4c943c[_0x0638('0x1e')]+_0x4c943c['limit'];var _0x3bac8a;if(_0x4d1d03>=_0x2722b7){_0x4d1d03=_0x2722b7;_0x3bac8a=0xc8;}else{_0x3bac8a=0xce;}_0x1cda33[_0x0638('0x21')](_0x3bac8a);return _0x1cda33['set'](_0x0638('0x22'),_0x49ee55+'-'+_0x4d1d03+'/'+_0x2722b7)[_0x0638('0x1d')](_0x12515a);}return null;};}function patchUpdates(_0x588cea){return function(_0x26ba61){try{jsonpatch[_0x0638('0x23')](_0x26ba61,_0x588cea,!![]);}catch(_0x4bc376){return BPromise['reject'](_0x4bc376);}return _0x26ba61['save']();};}function saveUpdates(_0x2697d0,_0x4a916e){return function(_0x49dfdd){if(_0x49dfdd){return _0x49dfdd[_0x0638('0x24')](_0x2697d0)[_0x0638('0x25')](function(_0xb5d62){return _0xb5d62;});}return null;};}function removeEntity(_0x2dfb89,_0x36dcb4){return function(_0x38a4f0){if(_0x38a4f0){return _0x38a4f0[_0x0638('0x26')]()[_0x0638('0x25')](function(){_0x2dfb89[_0x0638('0x21')](0xcc)[_0x0638('0x1c')]();});}};}function handleEntityNotFound(_0x15d2cf,_0x5442c1){return function(_0x1d35e3){if(!_0x1d35e3){_0x15d2cf['sendStatus'](0x194);}return _0x1d35e3;};}function handleError(_0xa14abc,_0x210fc7){_0x210fc7=_0x210fc7||0x1f4;return function(_0x536996){logger[_0x0638('0x27')](_0x536996['stack']);if(_0x536996[_0x0638('0x28')]){delete _0x536996['name'];}_0xa14abc['status'](_0x210fc7)[_0x0638('0x29')](_0x536996);};}exports[_0x0638('0x2a')]=function(_0x21114f,_0x1c36d3){var _0x55f3d0={},_0x730b66={},_0x2548cd={'count':0x0,'rows':[]};var _0x2f209a=_[_0x0638('0x2b')](db[_0x0638('0x2c')]['rawAttributes'],function(_0x5473fc){return{'name':_0x5473fc[_0x0638('0x2d')],'type':_0x5473fc[_0x0638('0x2e')][_0x0638('0x2f')]};});_0x730b66[_0x0638('0x30')]=_[_0x0638('0x2b')](_0x2f209a,_0x0638('0x28'));_0x730b66[_0x0638('0x31')]=_[_0x0638('0x32')](_0x21114f[_0x0638('0x31')]);_0x730b66['filters']=_[_0x0638('0x33')](_0x730b66[_0x0638('0x30')],_0x730b66['query']);_0x55f3d0[_0x0638('0x34')]=_[_0x0638('0x33')](_0x730b66['model'],qs[_0x0638('0x35')](_0x21114f[_0x0638('0x31')][_0x0638('0x35')]));_0x55f3d0[_0x0638('0x34')]=_0x55f3d0[_0x0638('0x34')]['length']?_0x55f3d0[_0x0638('0x34')]:_0x730b66[_0x0638('0x30')];if(!_0x21114f[_0x0638('0x31')][_0x0638('0x36')](_0x0638('0x37'))){_0x55f3d0[_0x0638('0x20')]=qs[_0x0638('0x20')](_0x21114f['query'][_0x0638('0x20')]);_0x55f3d0[_0x0638('0x1e')]=qs[_0x0638('0x1e')](_0x21114f['query']['offset']);}_0x55f3d0[_0x0638('0x38')]=qs[_0x0638('0x39')](_0x21114f[_0x0638('0x31')]['sort']);_0x55f3d0['where']=qs[_0x0638('0x3a')](_[_0x0638('0x3b')](_0x21114f[_0x0638('0x31')],_0x730b66[_0x0638('0x3a')]),_0x2f209a);if(_0x21114f[_0x0638('0x31')][_0x0638('0x3c')]){_0x55f3d0[_0x0638('0x3d')]=_[_0x0638('0x3e')](_0x55f3d0[_0x0638('0x3d')],{'$or':_[_0x0638('0x2b')](_0x2f209a,function(_0x37590b){if(_0x37590b[_0x0638('0x2e')]!==_0x0638('0x3f')){var _0x365517={};_0x365517[_0x37590b['name']]={'$like':'%'+_0x21114f[_0x0638('0x31')][_0x0638('0x3c')]+'%'};return _0x365517;}})});}_0x55f3d0=_['merge']({},_0x55f3d0,_0x21114f[_0x0638('0x40')]);var _0x272ab6={'where':_0x55f3d0[_0x0638('0x3d')]};return db[_0x0638('0x2c')][_0x0638('0x41')](_0x272ab6)['then'](function(_0x375a43){_0x2548cd[_0x0638('0x41')]=_0x375a43;if(_0x21114f['query'][_0x0638('0x42')]){_0x55f3d0[_0x0638('0x43')]=[{'all':!![]}];}return db[_0x0638('0x2c')]['findAll'](_0x55f3d0);})[_0x0638('0x25')](function(_0x32ef24){_0x2548cd[_0x0638('0x44')]=_0x32ef24;return _0x2548cd;})[_0x0638('0x25')](respondWithFilteredResult(_0x1c36d3,_0x55f3d0))[_0x0638('0x45')](handleError(_0x1c36d3,null));};exports[_0x0638('0x46')]=function(_0x235746,_0x4337b2){var _0x4b8eb8={'raw':!![],'where':{'id':_0x235746[_0x0638('0x47')]['id']}},_0x58d11e={};_0x58d11e[_0x0638('0x30')]=_[_0x0638('0x32')](db[_0x0638('0x2c')][_0x0638('0x48')]);_0x58d11e[_0x0638('0x31')]=_[_0x0638('0x32')](_0x235746[_0x0638('0x31')]);_0x58d11e[_0x0638('0x3a')]=_[_0x0638('0x33')](_0x58d11e[_0x0638('0x30')],_0x58d11e[_0x0638('0x31')]);_0x4b8eb8['attributes']=_[_0x0638('0x33')](_0x58d11e[_0x0638('0x30')],qs[_0x0638('0x35')](_0x235746['query'][_0x0638('0x35')]));_0x4b8eb8[_0x0638('0x34')]=_0x4b8eb8[_0x0638('0x34')]['length']?_0x4b8eb8[_0x0638('0x34')]:_0x58d11e['model'];if(_0x235746[_0x0638('0x31')][_0x0638('0x42')]){_0x4b8eb8['include']=[{'all':!![]}];}_0x4b8eb8=_[_0x0638('0x3e')]({},_0x4b8eb8,_0x235746['options']);return db[_0x0638('0x2c')][_0x0638('0x49')](_0x4b8eb8)[_0x0638('0x25')](handleEntityNotFound(_0x4337b2,null))[_0x0638('0x25')](respondWithResult(_0x4337b2,null))[_0x0638('0x45')](handleError(_0x4337b2,null));};exports['create']=function(_0x322b8c,_0x476ebc){return db[_0x0638('0x2c')]['create'](_0x322b8c[_0x0638('0x4a')],{})['then'](respondWithResult(_0x476ebc,0xc9))['catch'](handleError(_0x476ebc,null));};exports[_0x0638('0x24')]=function(_0xa31093,_0x1d0d57){if(_0xa31093[_0x0638('0x4a')]['id']){delete _0xa31093[_0x0638('0x4a')]['id'];}return db[_0x0638('0x2c')]['find']({'where':{'id':_0xa31093[_0x0638('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d0d57,null))[_0x0638('0x25')](saveUpdates(_0xa31093[_0x0638('0x4a')],null))[_0x0638('0x25')](respondWithResult(_0x1d0d57,null))[_0x0638('0x45')](handleError(_0x1d0d57,null));};exports[_0x0638('0x26')]=function(_0x3cd94c,_0x5863fb){return db[_0x0638('0x2c')][_0x0638('0x49')]({'where':{'id':_0x3cd94c[_0x0638('0x47')]['id']}})[_0x0638('0x25')](handleEntityNotFound(_0x5863fb,null))['then'](removeEntity(_0x5863fb,null))[_0x0638('0x45')](handleError(_0x5863fb,null));};exports[_0x0638('0x4b')]=function(_0x4251b5,_0x9e582e){return db[_0x0638('0x2c')][_0x0638('0x4b')]()['then'](respondWithResult(_0x9e582e,null))[_0x0638('0x45')](handleError(_0x9e582e,null));}; \ No newline at end of file +var _0x9b50=['to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','WhatsappTransferReport','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','create','catch','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x1f6711,_0x325100){var _0x34640f=function(_0x342b02){while(--_0x342b02){_0x1f6711['push'](_0x1f6711['shift']());}};_0x34640f(++_0x325100);}(_0x9b50,0x11b));var _0x09b5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9b50[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x09b5('0x0'));var rimraf=require(_0x09b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x09b5('0x2'));var rp=require('request-promise');var moment=require(_0x09b5('0x3'));var BPromise=require(_0x09b5('0x4'));var Mustache=require(_0x09b5('0x5'));var util=require(_0x09b5('0x6'));var path=require(_0x09b5('0x7'));var sox=require(_0x09b5('0x8'));var csv=require(_0x09b5('0x9'));var ejs=require(_0x09b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x09b5('0xb'));var crypto=require('crypto');var jsforce=require(_0x09b5('0xc'));var deskjs=require(_0x09b5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09b5('0xe'));var Papa=require('papaparse');var Redis=require(_0x09b5('0xf'));var authService=require(_0x09b5('0x10'));var qs=require(_0x09b5('0x11'));var as=require(_0x09b5('0x12'));var hardwareService=require(_0x09b5('0x13'));var logger=require(_0x09b5('0x14'))(_0x09b5('0x15'));var utils=require(_0x09b5('0x16'));var config=require(_0x09b5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x09b5('0x18'))['db'];function respondWithStatusCode(_0x7543ac,_0x1401fd){_0x1401fd=_0x1401fd||0xcc;return function(_0x32a06e){if(_0x32a06e){return _0x7543ac[_0x09b5('0x19')](_0x1401fd);}return _0x7543ac[_0x09b5('0x1a')](_0x1401fd)[_0x09b5('0x1b')]();};}function respondWithResult(_0x30ea86,_0x586f00){_0x586f00=_0x586f00||0xc8;return function(_0x25d878){if(_0x25d878){return _0x30ea86[_0x09b5('0x1a')](_0x586f00)[_0x09b5('0x1c')](_0x25d878);}};}function respondWithFilteredResult(_0x31e1b7,_0x1ea09c){return function(_0x4c916c){if(_0x4c916c){var _0xb00b9b=typeof _0x1ea09c[_0x09b5('0x1d')]===_0x09b5('0x1e')&&typeof _0x1ea09c['limit']===_0x09b5('0x1e');var _0x2eab46=_0x4c916c[_0x09b5('0x1f')];var _0x42ef3d=_0xb00b9b?0x0:_0x1ea09c[_0x09b5('0x1d')];var _0xc03190=_0xb00b9b?_0x4c916c[_0x09b5('0x1f')]:_0x1ea09c[_0x09b5('0x1d')]+_0x1ea09c[_0x09b5('0x20')];var _0x29b1d8;if(_0xc03190>=_0x2eab46){_0xc03190=_0x2eab46;_0x29b1d8=0xc8;}else{_0x29b1d8=0xce;}_0x31e1b7['status'](_0x29b1d8);return _0x31e1b7[_0x09b5('0x21')](_0x09b5('0x22'),_0x42ef3d+'-'+_0xc03190+'/'+_0x2eab46)['json'](_0x4c916c);}return null;};}function patchUpdates(_0x4ab5a3){return function(_0xfa67b3){try{jsonpatch['apply'](_0xfa67b3,_0x4ab5a3,!![]);}catch(_0x5515af){return BPromise[_0x09b5('0x23')](_0x5515af);}return _0xfa67b3['save']();};}function saveUpdates(_0x1e1c9e,_0x2bf0cb){return function(_0x3b6b53){if(_0x3b6b53){return _0x3b6b53[_0x09b5('0x24')](_0x1e1c9e)[_0x09b5('0x25')](function(_0xcb388e){return _0xcb388e;});}return null;};}function removeEntity(_0x49db1d,_0x5945dc){return function(_0x373352){if(_0x373352){return _0x373352[_0x09b5('0x26')]()['then'](function(){_0x49db1d[_0x09b5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30475d,_0x4be1c9){return function(_0x3cf02b){if(!_0x3cf02b){_0x30475d['sendStatus'](0x194);}return _0x3cf02b;};}function handleError(_0x4265b3,_0x23ddcc){_0x23ddcc=_0x23ddcc||0x1f4;return function(_0x2e7d7f){logger[_0x09b5('0x27')](_0x2e7d7f[_0x09b5('0x28')]);if(_0x2e7d7f[_0x09b5('0x29')]){delete _0x2e7d7f[_0x09b5('0x29')];}_0x4265b3[_0x09b5('0x1a')](_0x23ddcc)[_0x09b5('0x2a')](_0x2e7d7f);};}exports['index']=function(_0x19deae,_0x2bedd9){var _0x5976bc={},_0x2b62a0={},_0x49b2f0={'count':0x0,'rows':[]};var _0x435102=_[_0x09b5('0x2b')](db[_0x09b5('0x2c')][_0x09b5('0x2d')],function(_0x14d4ef){return{'name':_0x14d4ef['fieldName'],'type':_0x14d4ef[_0x09b5('0x2e')]['key']};});_0x2b62a0[_0x09b5('0x2f')]=_[_0x09b5('0x2b')](_0x435102,_0x09b5('0x29'));_0x2b62a0['query']=_[_0x09b5('0x30')](_0x19deae[_0x09b5('0x31')]);_0x2b62a0[_0x09b5('0x32')]=_[_0x09b5('0x33')](_0x2b62a0[_0x09b5('0x2f')],_0x2b62a0['query']);_0x5976bc[_0x09b5('0x34')]=_[_0x09b5('0x33')](_0x2b62a0['model'],qs[_0x09b5('0x35')](_0x19deae['query'][_0x09b5('0x35')]));_0x5976bc[_0x09b5('0x34')]=_0x5976bc[_0x09b5('0x34')][_0x09b5('0x36')]?_0x5976bc[_0x09b5('0x34')]:_0x2b62a0[_0x09b5('0x2f')];if(!_0x19deae[_0x09b5('0x31')]['hasOwnProperty'](_0x09b5('0x37'))){_0x5976bc[_0x09b5('0x20')]=qs[_0x09b5('0x20')](_0x19deae[_0x09b5('0x31')]['limit']);_0x5976bc[_0x09b5('0x1d')]=qs[_0x09b5('0x1d')](_0x19deae[_0x09b5('0x31')][_0x09b5('0x1d')]);}_0x5976bc[_0x09b5('0x38')]=qs['sort'](_0x19deae[_0x09b5('0x31')][_0x09b5('0x39')]);_0x5976bc[_0x09b5('0x3a')]=qs[_0x09b5('0x32')](_[_0x09b5('0x3b')](_0x19deae[_0x09b5('0x31')],_0x2b62a0[_0x09b5('0x32')]),_0x435102);if(_0x19deae[_0x09b5('0x31')][_0x09b5('0x3c')]){_0x5976bc['where']=_['merge'](_0x5976bc[_0x09b5('0x3a')],{'$or':_[_0x09b5('0x2b')](_0x435102,function(_0x1ce799){if(_0x1ce799[_0x09b5('0x2e')]!=='VIRTUAL'){var _0x164831={};_0x164831[_0x1ce799[_0x09b5('0x29')]]={'$like':'%'+_0x19deae[_0x09b5('0x31')][_0x09b5('0x3c')]+'%'};return _0x164831;}})});}_0x5976bc=_[_0x09b5('0x3d')]({},_0x5976bc,_0x19deae[_0x09b5('0x3e')]);var _0x14a507={'where':_0x5976bc['where']};return db[_0x09b5('0x2c')]['count'](_0x14a507)[_0x09b5('0x25')](function(_0x895ace){_0x49b2f0[_0x09b5('0x1f')]=_0x895ace;if(_0x19deae[_0x09b5('0x31')][_0x09b5('0x3f')]){_0x5976bc[_0x09b5('0x40')]=[{'all':!![]}];}return db[_0x09b5('0x2c')][_0x09b5('0x41')](_0x5976bc);})['then'](function(_0x41a4b4){_0x49b2f0[_0x09b5('0x42')]=_0x41a4b4;return _0x49b2f0;})[_0x09b5('0x25')](respondWithFilteredResult(_0x2bedd9,_0x5976bc))['catch'](handleError(_0x2bedd9,null));};exports['show']=function(_0x3f957e,_0x39e246){var _0x27f4eb={'raw':!![],'where':{'id':_0x3f957e[_0x09b5('0x43')]['id']}},_0x44e1f8={};_0x44e1f8['model']=_[_0x09b5('0x30')](db[_0x09b5('0x2c')][_0x09b5('0x2d')]);_0x44e1f8[_0x09b5('0x31')]=_['keys'](_0x3f957e['query']);_0x44e1f8[_0x09b5('0x32')]=_['intersection'](_0x44e1f8[_0x09b5('0x2f')],_0x44e1f8[_0x09b5('0x31')]);_0x27f4eb[_0x09b5('0x34')]=_[_0x09b5('0x33')](_0x44e1f8[_0x09b5('0x2f')],qs[_0x09b5('0x35')](_0x3f957e[_0x09b5('0x31')]['fields']));_0x27f4eb[_0x09b5('0x34')]=_0x27f4eb[_0x09b5('0x34')]['length']?_0x27f4eb[_0x09b5('0x34')]:_0x44e1f8[_0x09b5('0x2f')];if(_0x3f957e[_0x09b5('0x31')][_0x09b5('0x3f')]){_0x27f4eb[_0x09b5('0x40')]=[{'all':!![]}];}_0x27f4eb=_['merge']({},_0x27f4eb,_0x3f957e[_0x09b5('0x3e')]);return db[_0x09b5('0x2c')]['find'](_0x27f4eb)[_0x09b5('0x25')](handleEntityNotFound(_0x39e246,null))[_0x09b5('0x25')](respondWithResult(_0x39e246,null))['catch'](handleError(_0x39e246,null));};exports['create']=function(_0x9eb338,_0x2bde24){return db[_0x09b5('0x2c')][_0x09b5('0x44')](_0x9eb338['body'],{})[_0x09b5('0x25')](respondWithResult(_0x2bde24,0xc9))[_0x09b5('0x45')](handleError(_0x2bde24,null));};exports['update']=function(_0x341192,_0xb89f24){if(_0x341192[_0x09b5('0x46')]['id']){delete _0x341192[_0x09b5('0x46')]['id'];}return db[_0x09b5('0x2c')]['find']({'where':{'id':_0x341192[_0x09b5('0x43')]['id']}})[_0x09b5('0x25')](handleEntityNotFound(_0xb89f24,null))[_0x09b5('0x25')](saveUpdates(_0x341192['body'],null))[_0x09b5('0x25')](respondWithResult(_0xb89f24,null))[_0x09b5('0x45')](handleError(_0xb89f24,null));};exports[_0x09b5('0x26')]=function(_0x5832a6,_0x2ad693){return db[_0x09b5('0x2c')][_0x09b5('0x47')]({'where':{'id':_0x5832a6[_0x09b5('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ad693,null))[_0x09b5('0x25')](removeEntity(_0x2ad693,null))[_0x09b5('0x45')](handleError(_0x2ad693,null));};exports[_0x09b5('0x48')]=function(_0xb73dda,_0x2b428a){return db[_0x09b5('0x2c')]['describe']()[_0x09b5('0x25')](respondWithResult(_0x2b428a,null))[_0x09b5('0x45')](handleError(_0x2b428a,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index a415fad..c1ebe3a 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 _0x2648=['bluebird','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','../../config/logger'];(function(_0x4b12e0,_0x4c0dc6){var _0x5a4fbf=function(_0xd4a812){while(--_0xd4a812){_0x4b12e0['push'](_0x4b12e0['shift']());}};_0x5a4fbf(++_0x4c0dc6);}(_0x2648,0x13f));var _0x8264=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2648[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8264('0x0'))('api');var moment=require('moment');var BPromise=require(_0x8264('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8264('0x2'));var rimraf=require(_0x8264('0x3'));var config=require(_0x8264('0x4'));var attributes=require('./whatsappTransferReport.attributes');module[_0x8264('0x5')]=function(_0x35797e,_0xffadcc){return _0x35797e[_0x8264('0x6')](_0x8264('0x7'),attributes,{'tableName':_0x8264('0x8'),'paranoid':![],'indexes':[{'name':_0x8264('0x9'),'fields':[_0x8264('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c1a=['moment','bluebird','request-promise','path','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','util','api'];(function(_0x276289,_0x5acc1e){var _0xa71fc8=function(_0x44accd){while(--_0x44accd){_0x276289['push'](_0x276289['shift']());}};_0xa71fc8(++_0x5acc1e);}(_0x5c1a,0x101));var _0xa5c1=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x5c1a[_0x215dc8];return _0x583ea3;};'use strict';var _=require(_0xa5c1('0x0'));var util=require(_0xa5c1('0x1'));var logger=require('../../config/logger')(_0xa5c1('0x2'));var moment=require(_0xa5c1('0x3'));var BPromise=require(_0xa5c1('0x4'));var rp=require(_0xa5c1('0x5'));var fs=require('fs');var path=require(_0xa5c1('0x6'));var rimraf=require('rimraf');var config=require(_0xa5c1('0x7'));var attributes=require(_0xa5c1('0x8'));module[_0xa5c1('0x9')]=function(_0x492185,_0x5f1b8b){return _0x492185[_0xa5c1('0xa')]('WhatsappTransferReport',attributes,{'tableName':_0xa5c1('0xb'),'paranoid':![],'indexes':[{'name':_0xa5c1('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index e155111..5dc0a04 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 _0xf18c=['debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x4c60d6,_0x3c3e5a){var _0x15c9c6=function(_0x2f0c07){while(--_0x2f0c07){_0x4c60d6['push'](_0x4c60d6['shift']());}};_0x15c9c6(++_0x3c3e5a);}(_0xf18c,0x1a7));var _0xcf18=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xf18c[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0xcf18('0x0'));var util=require(_0xcf18('0x1'));var moment=require('moment');var BPromise=require(_0xcf18('0x2'));var rs=require(_0xcf18('0x3'));var fs=require('fs');var Redis=require(_0xcf18('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf18('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf18('0x6'));var jayson=require(_0xcf18('0x7'));var client=jayson[_0xcf18('0x8')][_0xcf18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3940a1,_0x2ec0b0,_0x216ddd){return new BPromise(function(_0x5aef5d,_0x10ec45){return client[_0xcf18('0xa')](_0x3940a1,_0x216ddd)[_0xcf18('0xb')](function(_0x157b3d){logger[_0xcf18('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2ec0b0,_0xcf18('0xd'));logger[_0xcf18('0xe')](_0xcf18('0xf'),_0x2ec0b0,_0xcf18('0xd'),JSON[_0xcf18('0x10')](_0x157b3d));if(_0x157b3d[_0xcf18('0x11')]){if(_0x157b3d['error'][_0xcf18('0x12')]===0x1f4){logger[_0xcf18('0x11')](_0xcf18('0x13'),_0x2ec0b0,_0x157b3d[_0xcf18('0x11')][_0xcf18('0x14')]);return _0x10ec45(_0x157b3d[_0xcf18('0x11')][_0xcf18('0x14')]);}logger['error'](_0xcf18('0x13'),_0x2ec0b0,_0x157b3d[_0xcf18('0x11')][_0xcf18('0x14')]);return _0x5aef5d(_0x157b3d[_0xcf18('0x11')][_0xcf18('0x14')]);}else{logger[_0xcf18('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2ec0b0,_0xcf18('0xd'));_0x5aef5d(_0x157b3d[_0xcf18('0x15')][_0xcf18('0x14')]);}})[_0xcf18('0x16')](function(_0x45f302){logger[_0xcf18('0x11')](_0xcf18('0x13'),_0x2ec0b0,_0x45f302);_0x10ec45(_0x45f302);});});} \ No newline at end of file +var _0xf753=['../../config/logger','rpc','client','http','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','util','moment','bluebird','../../mysqldb'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0xf753,0xd9));var _0x3f75=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xf753[_0xe15270];return _0x1e813b;};'use strict';var _=require('lodash');var util=require(_0x3f75('0x0'));var moment=require(_0x3f75('0x1'));var BPromise=require(_0x3f75('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f75('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f75('0x4'))(_0x3f75('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f75('0x6')][_0x3f75('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43f396,_0x2ad6e2,_0x135696){return new BPromise(function(_0x475a88,_0xcb6cac){return client['request'](_0x43f396,_0x135696)[_0x3f75('0x8')](function(_0x24f9ad){logger['info'](_0x3f75('0x9'),_0x2ad6e2,_0x3f75('0xa'));logger[_0x3f75('0xb')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2ad6e2,_0x3f75('0xa'),JSON['stringify'](_0x24f9ad));if(_0x24f9ad[_0x3f75('0xc')]){if(_0x24f9ad['error']['code']===0x1f4){logger[_0x3f75('0xc')](_0x3f75('0x9'),_0x2ad6e2,_0x24f9ad['error'][_0x3f75('0xd')]);return _0xcb6cac(_0x24f9ad[_0x3f75('0xc')]['message']);}logger['error'](_0x3f75('0x9'),_0x2ad6e2,_0x24f9ad[_0x3f75('0xc')][_0x3f75('0xd')]);return _0x475a88(_0x24f9ad[_0x3f75('0xc')][_0x3f75('0xd')]);}else{logger[_0x3f75('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2ad6e2,_0x3f75('0xa'));_0x475a88(_0x24f9ad[_0x3f75('0xf')][_0x3f75('0xd')]);}})[_0x3f75('0x10')](function(_0x119b1f){logger[_0x3f75('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2ad6e2,_0x119b1f);_0xcb6cac(_0x119b1f);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 264c76f..51e4f91 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac83=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','map','filter','online','name','join','Offline\x20apps:','None','./config/seedDB','./config/license','catch','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac83,0x119));var _0x3ac8=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xac83[_0x5b27da];return _0x3254f4;};'use strict';var _=require(_0x3ac8('0x0'));var mysqldb=require(_0x3ac8('0x1'));var rpc=require(_0x3ac8('0x2'));var config=require(_0x3ac8('0x3'));var logger=require(_0x3ac8('0x4'))(_0x3ac8('0x5'));var pm2=require(_0x3ac8('0x6'));var pm2Config=require(_0x3ac8('0x7'));var schedule=require(_0x3ac8('0x8'));var chat=require(_0x3ac8('0x9'));var whatsapp=require(_0x3ac8('0xa'));var transcribe=require(_0x3ac8('0xb'));function main(){return mysqldb['db'][_0x3ac8('0xc')][_0x3ac8('0xd')]()[_0x3ac8('0xe')](function(){return rpc[_0x3ac8('0xf')]();})[_0x3ac8('0xe')](function(_0x2fa342){logger[_0x3ac8('0x10')](_0x2fa342);return chat[_0x3ac8('0x11')]();})[_0x3ac8('0xe')](function(){return whatsapp[_0x3ac8('0x11')]();})[_0x3ac8('0xe')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x3ac8('0x11')]();})['then'](function(_0x16d6f5){logger[_0x3ac8('0x10')](_0x16d6f5);return pm2[_0x3ac8('0x11')](pm2Config);})[_0x3ac8('0xe')](function(_0x213e2f){logger[_0x3ac8('0x10')]('Online\x20apps:',_[_0x3ac8('0x12')](_[_0x3ac8('0x13')](_0x213e2f,{'status':_0x3ac8('0x14')}),_0x3ac8('0x15'))[_0x3ac8('0x16')]());logger[_0x3ac8('0x10')](_0x3ac8('0x17'),_['map'](_[_0x3ac8('0x13')](_0x213e2f,function(_0x5535fc){return _0x5535fc['status']!==_0x3ac8('0x14');}),_0x3ac8('0x15'))[_0x3ac8('0x16')]()||_0x3ac8('0x18'));config['seedDB']&&require(_0x3ac8('0x19'))['default']();require(_0x3ac8('0x1a'))['default']();})[_0x3ac8('0x1b')](function(_0x1c570c){logger[_0x3ac8('0x1c')](_0x3ac8('0x1d'),_0x1c570c);process[_0x3ac8('0x1e')](0x1);});}main(); \ No newline at end of file +var _0x45b9=['online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','info','start','Online\x20apps:','map','filter'];(function(_0x6ebb21,_0x269198){var _0x4a9204=function(_0x3301a3){while(--_0x3301a3){_0x6ebb21['push'](_0x6ebb21['shift']());}};_0x4a9204(++_0x269198);}(_0x45b9,0xbb));var _0x945b=function(_0x30a78e,_0x2f4fa9){_0x30a78e=_0x30a78e-0x0;var _0x1079bb=_0x45b9[_0x30a78e];return _0x1079bb;};'use strict';var _=require(_0x945b('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x945b('0x1'));var config=require(_0x945b('0x2'));var logger=require(_0x945b('0x3'))('app');var pm2=require(_0x945b('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x945b('0x5'));var chat=require(_0x945b('0x6'));var whatsapp=require(_0x945b('0x7'));var transcribe=require(_0x945b('0x8'));function main(){return mysqldb['db'][_0x945b('0x9')]['sync']()[_0x945b('0xa')](function(){return rpc['listen']();})[_0x945b('0xa')](function(_0xa7ed01){logger[_0x945b('0xb')](_0xa7ed01);return chat['start']();})[_0x945b('0xa')](function(){return whatsapp[_0x945b('0xc')]();})[_0x945b('0xa')](function(){return schedule[_0x945b('0xc')]();})['then'](function(){return transcribe['start']();})[_0x945b('0xa')](function(_0x1a8081){logger['info'](_0x1a8081);return pm2[_0x945b('0xc')](pm2Config);})[_0x945b('0xa')](function(_0x50e87a){logger['info'](_0x945b('0xd'),_[_0x945b('0xe')](_[_0x945b('0xf')](_0x50e87a,{'status':_0x945b('0x10')}),_0x945b('0x11'))[_0x945b('0x12')]());logger[_0x945b('0xb')](_0x945b('0x13'),_[_0x945b('0xe')](_[_0x945b('0xf')](_0x50e87a,function(_0x15be7b){return _0x15be7b[_0x945b('0x14')]!==_0x945b('0x10');}),_0x945b('0x11'))[_0x945b('0x12')]()||_0x945b('0x15'));config[_0x945b('0x16')]&&require(_0x945b('0x17'))[_0x945b('0x18')]();require(_0x945b('0x19'))[_0x945b('0x18')]();})[_0x945b('0x1a')](function(_0x2fcd1d){logger['error'](_0x945b('0x1b'),_0x2fcd1d);process[_0x945b('0x1c')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index f360b6f..a6cefe2 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 _0x5c0f=['generateApiKey','apiKeyNonce','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','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','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','Sequelize','length','splice','unshift','encryptString','join','sign','payload','options','promisify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','json','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','authenticate','pass','Wrong\x20credentials.','query','apikey','getUuid','find','sub','Setting','blockDuration','isEqual','nonce','Invalid\x20API\x20access\x20key','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','retrieveApiKey','isNil'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5c0f,0x9b));var _0xf5c0=function(_0x50f469,_0x1439fc){_0x50f469=_0x50f469-0x0;var _0x4af9d4=_0x5c0f[_0x50f469];return _0x4af9d4;};'use strict';var db=require(_0xf5c0('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xf5c0('0x1'));var licenseUtil=require(_0xf5c0('0x2'));var encryptor=require(_0xf5c0('0x3'));var _=require('lodash');var jwt=require(_0xf5c0('0x4'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0xf5c0('0x5'));var crypto=require(_0xf5c0('0x6'));var BPromise=require(_0xf5c0('0x7'));var util=require(_0xf5c0('0x8'));var moment=require(_0xf5c0('0x9'));var validateJwt=expressJwt({'secret':config[_0xf5c0('0xa')][_0xf5c0('0xb')]});var userAttributes=['id',_0xf5c0('0xc'),_0xf5c0('0xd'),_0xf5c0('0xe'),_0xf5c0('0xf'),_0xf5c0('0x10'),_0xf5c0('0x11'),_0xf5c0('0x12'),_0xf5c0('0x13'),_0xf5c0('0x14'),_0xf5c0('0x15'),_0xf5c0('0x16'),'faxPause',_0xf5c0('0x17'),_0xf5c0('0x18'),_0xf5c0('0x19'),_0xf5c0('0x1a'),_0xf5c0('0x1b'),_0xf5c0('0x1c'),'crudPermissions','allowmessenger',_0xf5c0('0x1d'),_0xf5c0('0x1e'),_0xf5c0('0x1f'),_0xf5c0('0x20'),_0xf5c0('0x21'),_0xf5c0('0x22'),_0xf5c0('0x23'),'phoneBarEnableSettings',_0xf5c0('0x24'),_0xf5c0('0x25'),_0xf5c0('0x26'),'phoneBarRemoteControlPort',_0xf5c0('0x27'),_0xf5c0('0x28'),_0xf5c0('0x29'),_0xf5c0('0x2a'),_0xf5c0('0x2b'),_0xf5c0('0x2c'),_0xf5c0('0x2d'),'downloadOmnichannelInteractions',_0xf5c0('0x2e')];exports[_0xf5c0('0x2f')]=function(){return this[_0xf5c0('0x30')](!![])[_0xf5c0('0x31')](function(_0x1f4f75,_0x4f895a,_0x591ec9){if(_0x1f4f75[_0xf5c0('0x32')]){_0x591ec9();}else{return db[_0xf5c0('0x33')][_0xf5c0('0x34')]({'where':{'id':_0x1f4f75[_0xf5c0('0x35')]['id']},'attributes':['id',_0xf5c0('0x36'),_0xf5c0('0x37')],'raw':!![]})[_0xf5c0('0x38')](function(_0x3fb93a){if(_0x3fb93a&&_0x3fb93a[_0xf5c0('0x36')]){return _0x4f895a[_0xf5c0('0x39')](_0x3fb93a[_0xf5c0('0x37')]==='unmanaged'?0x195:0x193)[_0xf5c0('0x3a')]({'message':_0x3fb93a[_0xf5c0('0x37')]===_0xf5c0('0x3b')?_0xf5c0('0x3c'):_0xf5c0('0x3d')});}else{_0x591ec9();}})[_0xf5c0('0x3e')](function(_0x559f82){_0x591ec9(_0x559f82);});}});};exports[_0xf5c0('0x30')]=function isAuthenticated(_0xdcb92a){return compose()['use'](function(_0xa393d9,_0x2a2282,_0x3f0c0d){var _0x282f01;if(_0xa393d9[_0xf5c0('0x3f')][_0xf5c0('0x40')]){if(_[_0xf5c0('0x41')](_0xa393d9[_0xf5c0('0x3f')]['authorization'],_0xf5c0('0x42'))){var _0x29e95b=basicAuth(_0xa393d9);db[_0xf5c0('0x43')]['find']({'where':{'name':_0x29e95b[_0xf5c0('0xe')]}})[_0xf5c0('0x38')](function(_0x3912a4){if(!_0x3912a4||!_0x3912a4[_0xf5c0('0x44')](_0x29e95b[_0xf5c0('0x45')])){return _0x2a2282[_0xf5c0('0x39')](0x191)['json']({'message':_0xf5c0('0x46')});}_0xa393d9['user']={'id':_0x3912a4['id']};_0x3f0c0d();})[_0xf5c0('0x3e')](function(_0x2587d1){_0x3f0c0d(_0x2587d1);});}else if(_[_0xf5c0('0x41')](_0xa393d9[_0xf5c0('0x3f')][_0xf5c0('0x40')],'Bearer')){validateJwt(_0xa393d9,_0x2a2282,_0x3f0c0d);}else{if(_0xdcb92a){_0x3f0c0d();}else{return _0x2a2282['status'](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xa393d9[_0xf5c0('0x47')][_0xf5c0('0x48')]){try{var _0x3b2e1f={'audience':hardwareConf[_0xf5c0('0x49')](),'issuer':hardwareConf[_0xf5c0('0x49')]()};verifyJwt(_0xa393d9['query'][_0xf5c0('0x48')],_0x3b2e1f)[_0xf5c0('0x38')](function(_0x5bfbd3){return db[_0xf5c0('0x43')][_0xf5c0('0x4a')]({'where':{'id':_0x5bfbd3[_0xf5c0('0x4b')]}})[_0xf5c0('0x38')](function(_0x3a5b80){_0x282f01=_0x3a5b80;return db[_0xf5c0('0x4c')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf5c0('0x4d')],'raw':!![]});})[_0xf5c0('0x38')](function(_0x570bfa){if(!_0x282f01||!_[_0xf5c0('0x4e')](_0x282f01['apiKeyNonce'],_0x5bfbd3[_0xf5c0('0x4f')])){return _0x2a2282['status'](0x191)[_0xf5c0('0x3a')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x282f01['disabled']){return _0x2a2282['status'](0x191)[_0xf5c0('0x3a')]({'message':_0xf5c0('0x50')});}if(_0x282f01['blocked']){if(_0x570bfa[_0xf5c0('0x4d')]>0x0){if(moment(_0x282f01[_0xf5c0('0x51')])['add'](_0x570bfa[_0xf5c0('0x4d')],_0xf5c0('0x52'))>moment()){return _0x2a2282['status'](0x191)[_0xf5c0('0x3a')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2a2282[_0xf5c0('0x39')](0x191)[_0xf5c0('0x3a')]({'message':_0xf5c0('0x50')});}}_0xa393d9[_0xf5c0('0x32')]={'id':_0x282f01['id']};_0x3f0c0d();});})[_0xf5c0('0x3e')](function(){return _0x2a2282[_0xf5c0('0x39')](0x191)[_0xf5c0('0x3a')]({'message':_0xf5c0('0x50')});});}catch(_0x4690e8){_0x3f0c0d(_0x4690e8);}}else if(_0xdcb92a){_0x3f0c0d();}else{return _0x2a2282[_0xf5c0('0x39')](0x193)['json']({'message':_0xf5c0('0x53')});}})[_0xf5c0('0x31')](function(_0x1d9d7b,_0x3b43d5,_0x2ef1ef){if(_0x1d9d7b[_0xf5c0('0x32')]){db[_0xf5c0('0x43')][_0xf5c0('0x4a')]({'where':{'id':_0x1d9d7b['user']['id']},'attributes':userAttributes})[_0xf5c0('0x38')](function(_0xc5ec63){if(!_0xc5ec63){return _0x3b43d5[_0xf5c0('0x39')](0x194)['json']({'message':_0xf5c0('0x54')});}_0x1d9d7b[_0xf5c0('0x32')]=_0xc5ec63;_0x2ef1ef();})[_0xf5c0('0x3e')](function(_0x1b9269){_0x2ef1ef(_0x1b9269);});}else if(_0xdcb92a){_0x2ef1ef();}else{return _0x3b43d5['status'](0x194)['json']({'message':_0xf5c0('0x55')});}});};exports[_0xf5c0('0x56')]=function canUpdate(){return compose()[_0xf5c0('0x31')](function(_0x2218ef,_0x338c82,_0xdd046){return licenseUtil[_0xf5c0('0x57')]()['then'](function(_0x531702){if(_0x531702[_0xf5c0('0x58')]){_0xdd046();}else{return _0x338c82[_0xf5c0('0x39')](0x193)[_0xf5c0('0x3a')]({'message':'Forbidden'});}})[_0xf5c0('0x3e')](function(_0x1d37e4){_0xdd046(_0x1d37e4);});});};exports[_0xf5c0('0x59')]=function(_0x49c4e5,_0x480785,_0x4758f7){_0x49c4e5[_0xf5c0('0x59')]=!![];return _0x4758f7();};exports[_0xf5c0('0x5a')]=function signToken(_0x278292){return signJwt(_0x278292);};exports[_0xf5c0('0x5b')]=function(_0x445e8a,_0x5fcc1a){if(!_0x445e8a[_0xf5c0('0x32')]){return _0x5fcc1a[_0xf5c0('0x39')](0x194)['json']({'message':_0xf5c0('0x5c')});}var _0x3d4404={'payload':{'id':_0x445e8a[_0xf5c0('0x32')]['id'],'role':_0x445e8a[_0xf5c0('0x32')][_0xf5c0('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3d4404)[_0xf5c0('0x38')](function(_0x572785){_0x5fcc1a['cookie']('motion.token',_0x572785);_0x5fcc1a[_0xf5c0('0x5d')](_0xf5c0('0x5e'));})[_0xf5c0('0x3e')](function(_0x27feff){return _0x5fcc1a[_0xf5c0('0x39')](0x1f4)['send'](_0x27feff);});};exports[_0xf5c0('0x5f')]=function(_0xfe5bb0){if(_[_0xf5c0('0x60')](_0xfe5bb0['apiKeyNonce'])||_[_0xf5c0('0x60')](_0xfe5bb0['apiKeyIat'])){return null;}else{return createJwt(_0xfe5bb0);}};exports[_0xf5c0('0x61')]=function(_0xc4a35d){_0xc4a35d[_0xf5c0('0x62')]=generateNonce();_0xc4a35d[_0xf5c0('0x63')]=generateIssuedAt();return createJwt(_0xc4a35d);};exports[_0xf5c0('0x64')]=function(_0x2fc669,_0x34c77e){var _0x362ecb=_0x2fc669[_0xf5c0('0x47')][_0xf5c0('0x48')];if(_0x362ecb){var _0x615f41={'nonce':_0x34c77e[_0xf5c0('0x62')],'iat':_0x34c77e[_0xf5c0('0x63')],'audience':hardwareConf[_0xf5c0('0x49')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x362ecb,_0x615f41)['then'](function(){return generateApiKey(_0x34c77e);});}else{throw{'message':_0xf5c0('0x65')};}};exports['validatePasswordPattern']=function(_0x1d55f6){var _0x124d91=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x124d91['test'](_0x1d55f6))throw new db['Sequelize'][(_0xf5c0('0x66'))](_0xf5c0('0x67'));return;};exports[_0xf5c0('0x68')]=function(_0xcf0683,_0x5cac7a,_0x4f7e5c){var _0x59467f=encryptor[_0xf5c0('0x69')](_0x5cac7a)[_0xf5c0('0x6a')](',');for(var _0x230722=0x0;_0x230722<_0x4f7e5c;_0x230722++){if(!_0x59467f[_0x230722])break;if(_0xcf0683[_0xf5c0('0x6b')]()===_0x59467f[_0x230722][_0xf5c0('0x6b')]()){var _0x34f681=util[_0xf5c0('0x6c')](_0xf5c0('0x6d'),_0x4f7e5c);if(_0x4f7e5c===0x1){_0x34f681='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xf5c0('0x6e'))][(_0xf5c0('0x66'))](_0x34f681);}}return;};exports['updatePasswordsHistory']=function(_0x4611e4,_0x7b7470){var _0x2d4a09=_0x7b7470?encryptor[_0xf5c0('0x69')](_0x7b7470)[_0xf5c0('0x6a')](','):[];if(_0x2d4a09[_0xf5c0('0x6f')]===0x5){_0x2d4a09[_0xf5c0('0x70')](-0x1,0x1);}_0x2d4a09[_0xf5c0('0x71')](_0x4611e4);return encryptor[_0xf5c0('0x72')](_0x2d4a09[_0xf5c0('0x73')](','));};function signJwt(_0x4f43b8){var _0x145bfb=BPromise['promisify'](jwt[_0xf5c0('0x74')],{'context':jwt});var _0xd17960=_0x4f43b8['secret']||config[_0xf5c0('0xa')][_0xf5c0('0xb')];return new BPromise(function(_0x19e6f9,_0x1ae269){_0x145bfb(_0x4f43b8[_0xf5c0('0x75')],_0xd17960,_0x4f43b8[_0xf5c0('0x76')])[_0xf5c0('0x38')](function(_0x528b03){_0x19e6f9(_0x528b03);})[_0xf5c0('0x3e')](function(_0x262294){_0x1ae269(_0x262294);});});}function verifyJwt(_0x30630b,_0x3dc327,_0x10a615){var _0x55c2e3=BPromise[_0xf5c0('0x77')](jwt['verify'],{'context':jwt});var _0x5807e4=_0x10a615||config[_0xf5c0('0xa')][_0xf5c0('0xb')];return new BPromise(function(_0x81b87e,_0x47257c){_0x55c2e3(_0x30630b,_0x5807e4,_0x3dc327)['then'](function(_0x4e2636){_0x81b87e(_0x4e2636);})['catch'](function(_0x575111){_0x47257c(_0x575111);});});}function generateNonce(){return crypto[_0xf5c0('0x78')](0x10)[_0xf5c0('0x79')](_0xf5c0('0x7a'));}function generateIssuedAt(){return Math[_0xf5c0('0x7b')](Date[_0xf5c0('0x7c')]()/0x3e8)[_0xf5c0('0x79')]();}function createJwt(_0xcd70ed){var _0x1fe2f5={'payload':{'iat':_0xcd70ed[_0xf5c0('0x63')],'nonce':_0xcd70ed['apiKeyNonce']},'options':{'algorithm':_0xf5c0('0x7d'),'subject':_0xcd70ed['id'][_0xf5c0('0x79')](),'issuer':hardwareConf[_0xf5c0('0x49')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x1fe2f5)[_0xf5c0('0x38')](function(_0x1c86d6){return{'iat':_0xcd70ed[_0xf5c0('0x63')],'nonce':_0xcd70ed[_0xf5c0('0x62')],'token':_0x1c86d6};});} \ No newline at end of file +var _0xaa12=['toString','../../config/environment','../../config/license/util','../encryptor','lodash','composable-middleware','basic-auth','crypto','bluebird','util','moment','session','fullname','name','internal','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','disposition','then','closed','status','Unmanaged.','catch','headers','startsWith','authorization','User','find','pass','json','Wrong\x20credentials.','Bearer','query','apikey','getUuid','sub','Setting','isEqual','apiKeyNonce','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','blockDuration','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','redirect','/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~!@#$%^&-_=+[{]}.','decryptString','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','split','length','splice','encryptString','join','promisify','sign','secret','secrets','payload','options','randomBytes','hex','floor','now'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xaa12,0x163));var _0x2aa1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xaa12[_0x59ee6f];return _0x4c0979;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x2aa1('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x2aa1('0x1'));var encryptor=require(_0x2aa1('0x2'));var _=require(_0x2aa1('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require(_0x2aa1('0x4'));var basicAuth=require(_0x2aa1('0x5'));var crypto=require(_0x2aa1('0x6'));var BPromise=require(_0x2aa1('0x7'));var util=require(_0x2aa1('0x8'));var moment=require(_0x2aa1('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x2aa1('0xa')]});var userAttributes=['id','role',_0x2aa1('0xb'),_0x2aa1('0xc'),_0x2aa1('0xd'),'email',_0x2aa1('0xe'),_0x2aa1('0xf'),'md5secret',_0x2aa1('0x10'),_0x2aa1('0x11'),_0x2aa1('0x12'),_0x2aa1('0x13'),_0x2aa1('0x14'),'openchannelPause','pauseType','showWebBar',_0x2aa1('0x15'),_0x2aa1('0x16'),'crudPermissions',_0x2aa1('0x17'),_0x2aa1('0x18'),_0x2aa1('0x19'),_0x2aa1('0x1a'),'phoneBarAutoAnswerDelay',_0x2aa1('0x1b'),_0x2aa1('0x1c'),_0x2aa1('0x1d'),_0x2aa1('0x1e'),_0x2aa1('0x1f'),_0x2aa1('0x20'),'phoneBarRemoteControl',_0x2aa1('0x21'),_0x2aa1('0x22'),_0x2aa1('0x23'),_0x2aa1('0x24'),_0x2aa1('0x25'),_0x2aa1('0x26'),_0x2aa1('0x27'),'downloadVoiceRecordings',_0x2aa1('0x28'),_0x2aa1('0x29')];exports[_0x2aa1('0x2a')]=function(){return this[_0x2aa1('0x2b')](!![])[_0x2aa1('0x2c')](function(_0x44b39d,_0x23452e,_0x27de83){if(_0x44b39d[_0x2aa1('0x2d')]){_0x27de83();}else{return db['ChatInteraction'][_0x2aa1('0x2e')]({'where':{'id':_0x44b39d[_0x2aa1('0x2f')]['id']},'attributes':['id','closed',_0x2aa1('0x30')],'raw':!![]})[_0x2aa1('0x31')](function(_0x15f40c){if(_0x15f40c&&_0x15f40c[_0x2aa1('0x32')]){return _0x23452e[_0x2aa1('0x33')](_0x15f40c[_0x2aa1('0x30')]==='unmanaged'?0x195:0x193)['json']({'message':_0x15f40c[_0x2aa1('0x30')]==='unmanaged'?_0x2aa1('0x34'):'Forbidden.'});}else{_0x27de83();}})[_0x2aa1('0x35')](function(_0x46e50f){_0x27de83(_0x46e50f);});}});};exports[_0x2aa1('0x2b')]=function isAuthenticated(_0x13badf){return compose()[_0x2aa1('0x2c')](function(_0x498bac,_0x3a1d73,_0x3c8661){var _0x884c52;if(_0x498bac[_0x2aa1('0x36')]['authorization']){if(_[_0x2aa1('0x37')](_0x498bac['headers'][_0x2aa1('0x38')],'Basic')){var _0x5f2a13=basicAuth(_0x498bac);db[_0x2aa1('0x39')][_0x2aa1('0x3a')]({'where':{'name':_0x5f2a13[_0x2aa1('0xc')]}})[_0x2aa1('0x31')](function(_0x67b085){if(!_0x67b085||!_0x67b085['authenticate'](_0x5f2a13[_0x2aa1('0x3b')])){return _0x3a1d73['status'](0x191)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x3d')});}_0x498bac[_0x2aa1('0x2d')]={'id':_0x67b085['id']};_0x3c8661();})[_0x2aa1('0x35')](function(_0x31ffb4){_0x3c8661(_0x31ffb4);});}else if(_[_0x2aa1('0x37')](_0x498bac['headers'][_0x2aa1('0x38')],_0x2aa1('0x3e'))){validateJwt(_0x498bac,_0x3a1d73,_0x3c8661);}else{if(_0x13badf){_0x3c8661();}else{return _0x3a1d73[_0x2aa1('0x33')](0x193)[_0x2aa1('0x3c')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x498bac[_0x2aa1('0x3f')][_0x2aa1('0x40')]){try{var _0xb08337={'audience':hardwareConf[_0x2aa1('0x41')](),'issuer':hardwareConf[_0x2aa1('0x41')]()};verifyJwt(_0x498bac[_0x2aa1('0x3f')]['apikey'],_0xb08337)[_0x2aa1('0x31')](function(_0x16565c){return db[_0x2aa1('0x39')]['find']({'where':{'id':_0x16565c[_0x2aa1('0x42')]}})[_0x2aa1('0x31')](function(_0xf18735){_0x884c52=_0xf18735;return db[_0x2aa1('0x43')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0x2aa1('0x31')](function(_0x8a5950){if(!_0x884c52||!_[_0x2aa1('0x44')](_0x884c52[_0x2aa1('0x45')],_0x16565c['nonce'])){return _0x3a1d73[_0x2aa1('0x33')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x884c52[_0x2aa1('0x46')]){return _0x3a1d73[_0x2aa1('0x33')](0x191)['json']({'message':_0x2aa1('0x47')});}if(_0x884c52['blocked']){if(_0x8a5950['blockDuration']>0x0){if(moment(_0x884c52[_0x2aa1('0x48')])[_0x2aa1('0x49')](_0x8a5950[_0x2aa1('0x4a')],_0x2aa1('0x4b'))>moment()){return _0x3a1d73[_0x2aa1('0x33')](0x191)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x47')});}}else{return _0x3a1d73['status'](0x191)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x47')});}}_0x498bac['user']={'id':_0x884c52['id']};_0x3c8661();});})[_0x2aa1('0x35')](function(){return _0x3a1d73[_0x2aa1('0x33')](0x191)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x47')});});}catch(_0x4414c7){_0x3c8661(_0x4414c7);}}else if(_0x13badf){_0x3c8661();}else{return _0x3a1d73['status'](0x193)[_0x2aa1('0x3c')]({'message':'Unknown\x20authorization\x20format'});}})[_0x2aa1('0x2c')](function(_0x23a5ef,_0xff167d,_0x5b1952){if(_0x23a5ef[_0x2aa1('0x2d')]){db['User']['find']({'where':{'id':_0x23a5ef[_0x2aa1('0x2d')]['id']},'attributes':userAttributes})[_0x2aa1('0x31')](function(_0x594b9c){if(!_0x594b9c){return _0xff167d[_0x2aa1('0x33')](0x194)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x4c')});}_0x23a5ef[_0x2aa1('0x2d')]=_0x594b9c;_0x5b1952();})[_0x2aa1('0x35')](function(_0x57ab4c){_0x5b1952(_0x57ab4c);});}else if(_0x13badf){_0x5b1952();}else{return _0xff167d[_0x2aa1('0x33')](0x194)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x4d')});}});};exports[_0x2aa1('0x4e')]=function canUpdate(){return compose()[_0x2aa1('0x2c')](function(_0x3475d3,_0x474ec6,_0x35d449){return licenseUtil['getLicense']()['then'](function(_0x539ee7){if(_0x539ee7[_0x2aa1('0x4f')]){_0x35d449();}else{return _0x474ec6[_0x2aa1('0x33')](0x193)[_0x2aa1('0x3c')]({'message':'Forbidden'});}})['catch'](function(_0x18626a){_0x35d449(_0x18626a);});});};exports[_0x2aa1('0x50')]=function(_0x3bc6d9,_0x3848cb,_0x50be9f){_0x3bc6d9[_0x2aa1('0x50')]=!![];return _0x50be9f();};exports[_0x2aa1('0x51')]=function signToken(_0x199297){return signJwt(_0x199297);};exports[_0x2aa1('0x52')]=function(_0x8ea5df,_0x2c9ff8){if(!_0x8ea5df[_0x2aa1('0x2d')]){return _0x2c9ff8[_0x2aa1('0x33')](0x194)['json']({'message':_0x2aa1('0x53')});}var _0x15a34e={'payload':{'id':_0x8ea5df['user']['id'],'role':_0x8ea5df[_0x2aa1('0x2d')][_0x2aa1('0x54')]},'options':{'expiresIn':0x15180}};return signJwt(_0x15a34e)[_0x2aa1('0x31')](function(_0x3aaabb){_0x2c9ff8[_0x2aa1('0x55')]('motion.token',_0x3aaabb);_0x2c9ff8[_0x2aa1('0x56')](_0x2aa1('0x57'));})['catch'](function(_0x59763c){return _0x2c9ff8[_0x2aa1('0x33')](0x1f4)[_0x2aa1('0x58')](_0x59763c);});};exports[_0x2aa1('0x59')]=function(_0x5e2303){if(_['isNil'](_0x5e2303[_0x2aa1('0x45')])||_[_0x2aa1('0x5a')](_0x5e2303[_0x2aa1('0x5b')])){return null;}else{return createJwt(_0x5e2303);}};exports['generateApiKey']=function(_0x1f8b45){_0x1f8b45[_0x2aa1('0x45')]=generateNonce();_0x1f8b45[_0x2aa1('0x5b')]=generateIssuedAt();return createJwt(_0x1f8b45);};exports[_0x2aa1('0x5c')]=function(_0x85cc6e,_0x728ec3){var _0x17b2e3=_0x85cc6e[_0x2aa1('0x3f')][_0x2aa1('0x40')];if(_0x17b2e3){var _0x24a116={'nonce':_0x728ec3[_0x2aa1('0x45')],'iat':_0x728ec3['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x2aa1('0x41')]()};return verifyJwt(_0x17b2e3,_0x24a116)[_0x2aa1('0x31')](function(){return generateApiKey(_0x728ec3);});}else{throw{'message':_0x2aa1('0x5d')};}};exports[_0x2aa1('0x5e')]=function(_0x26866d){var _0xd54889=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xd54889[_0x2aa1('0x5f')](_0x26866d))throw new db[(_0x2aa1('0x60'))][(_0x2aa1('0x61'))](_0x2aa1('0x62'));return;};exports['validatePasswordHistory']=function(_0x1dd789,_0x547ebd,_0x4d3ac3){var _0x1268d5=encryptor[_0x2aa1('0x63')](_0x547ebd)['split'](',');for(var _0x46a532=0x0;_0x46a532<_0x4d3ac3;_0x46a532++){if(!_0x1268d5[_0x46a532])break;if(_0x1dd789[_0x2aa1('0x64')]()===_0x1268d5[_0x46a532][_0x2aa1('0x64')]()){var _0x5eb8b5=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x4d3ac3);if(_0x4d3ac3===0x1){_0x5eb8b5=_0x2aa1('0x65');}throw new db[(_0x2aa1('0x60'))][(_0x2aa1('0x61'))](_0x5eb8b5);}}return;};exports['updatePasswordsHistory']=function(_0x4535db,_0x3cc389){var _0x465896=_0x3cc389?encryptor[_0x2aa1('0x63')](_0x3cc389)[_0x2aa1('0x66')](','):[];if(_0x465896[_0x2aa1('0x67')]===0x5){_0x465896[_0x2aa1('0x68')](-0x1,0x1);}_0x465896['unshift'](_0x4535db);return encryptor[_0x2aa1('0x69')](_0x465896[_0x2aa1('0x6a')](','));};function signJwt(_0x1d8b86){var _0x3288b4=BPromise[_0x2aa1('0x6b')](jwt[_0x2aa1('0x6c')],{'context':jwt});var _0x4c4e3e=_0x1d8b86[_0x2aa1('0x6d')]||config[_0x2aa1('0x6e')][_0x2aa1('0xa')];return new BPromise(function(_0x44cd2a,_0x16f57a){_0x3288b4(_0x1d8b86[_0x2aa1('0x6f')],_0x4c4e3e,_0x1d8b86[_0x2aa1('0x70')])[_0x2aa1('0x31')](function(_0x2369a9){_0x44cd2a(_0x2369a9);})[_0x2aa1('0x35')](function(_0x36e7f7){_0x16f57a(_0x36e7f7);});});}function verifyJwt(_0x587c23,_0x152ad6,_0x382d23){var _0x492a64=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x53d41e=_0x382d23||config[_0x2aa1('0x6e')][_0x2aa1('0xa')];return new BPromise(function(_0x14f372,_0x5aa348){_0x492a64(_0x587c23,_0x53d41e,_0x152ad6)['then'](function(_0x2d0d01){_0x14f372(_0x2d0d01);})['catch'](function(_0x579436){_0x5aa348(_0x579436);});});}function generateNonce(){return crypto[_0x2aa1('0x71')](0x10)['toString'](_0x2aa1('0x72'));}function generateIssuedAt(){return Math[_0x2aa1('0x73')](Date[_0x2aa1('0x74')]()/0x3e8)[_0x2aa1('0x75')]();}function createJwt(_0x2d0945){var _0x206a2e={'payload':{'iat':_0x2d0945[_0x2aa1('0x5b')],'nonce':_0x2d0945['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x2d0945['id']['toString'](),'issuer':hardwareConf[_0x2aa1('0x41')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x206a2e)['then'](function(_0x461812){return{'iat':_0x2d0945[_0x2aa1('0x5b')],'nonce':_0x2d0945['apiKeyNonce'],'token':_0x461812};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index dd4249c..67ced9c 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 _0xde24=['decryptFile','createWriteStream','createDecipher','data','encryptString','secret','utf8','base64','decryptString','bluebird','lodash','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','update','binary','end','final','write','close','unlink'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xde24,0xc9));var _0x4de2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde24[_0xa464c9];return _0x3d73c4;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x4de2('0x0'));var _=require(_0x4de2('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x4de2('0x2')],'algorithm':_0x4de2('0x3')};const fileOptions={'algorithm':_0x4de2('0x4')};if(config[_0x4de2('0x5')]&&config[_0x4de2('0x5')][_0x4de2('0x6')]){var isSupported=isAlgorithmSupported(config[_0x4de2('0x5')][_0x4de2('0x6')]);if(isSupported){fileOptions[_0x4de2('0x6')]=config['encrypt'][_0x4de2('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x4de2('0x7')](config[_0x4de2('0x5')][_0x4de2('0x6')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x3677de){return AES_SUPPORTED_RX[_0x4de2('0x8')](_0x3677de);}function getSupportedCiphers(){return crypto[_0x4de2('0x9')]()[_0x4de2('0xa')](isASupportedCipher);}function isAlgorithmSupported(_0x234f53){return getSupportedCiphers()[_0x4de2('0xb')](_0x234f53)>-0x1;}function combineOptions(_0x69cd35){var _0x544924={};for(var _0x2d1459 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2d1459)){_0x544924[_0x2d1459]=fileOptions[_0x2d1459];}}if(_0x69cd35){for(var _0x2ad627 in _0x69cd35){if(_0x69cd35[_0x4de2('0xc')](_0x2ad627)){_0x544924[_0x2ad627]=_0x69cd35[_0x2ad627];}}}return _0x544924;}exports[_0x4de2('0xd')]=function(_0x39080d,_0x10bcac,_0x59466a,_0x22658f){return new BPromise(function(_0x2e3508,_0xa9f10b){_0x22658f=combineOptions(_0x22658f);var _0x9cb23d=new Buffer(_0x59466a);var _0x5b46f0=fs[_0x4de2('0xe')](_0x39080d);var _0xa73067=fs['createWriteStream'](_0x10bcac);var _0x28b76d=crypto[_0x4de2('0xf')](_0x22658f['algorithm'],_0x9cb23d);_0x5b46f0['on']('data',function(_0x2602c0){var _0x2a8344=new Buffer(_0x28b76d[_0x4de2('0x10')](_0x2602c0),_0x4de2('0x11'));_0xa73067['write'](_0x2a8344);});_0x5b46f0['on'](_0x4de2('0x12'),function(){try{var _0x27ea80=new Buffer(_0x28b76d[_0x4de2('0x13')]('binary'),'binary');_0xa73067[_0x4de2('0x14')](_0x27ea80);_0xa73067[_0x4de2('0x12')]();_0xa73067['on'](_0x4de2('0x15'),function(){return _0x2e3508(_0x10bcac);});}catch(_0x2c08cb){fs[_0x4de2('0x16')](_0x10bcac);return _0xa9f10b(_0x2c08cb);}});});};exports[_0x4de2('0x17')]=function(_0x712600,_0x318211,_0x1212c8,_0x3e2c9f){return new BPromise(function(_0x1c51a8,_0x38541a){_0x3e2c9f=combineOptions(_0x3e2c9f);var _0x582e06=new Buffer(_0x1212c8);var _0x4c40e0=fs[_0x4de2('0xe')](_0x712600);var _0x25bb3c=fs[_0x4de2('0x18')](_0x318211);var _0x26df77=crypto[_0x4de2('0x19')](_0x3e2c9f['algorithm'],_0x582e06);_0x4c40e0['on'](_0x4de2('0x1a'),function(_0x40c68b){var _0x3a2565=new Buffer(_0x26df77[_0x4de2('0x10')](_0x40c68b),_0x4de2('0x11'));_0x25bb3c['write'](_0x3a2565);});_0x4c40e0['on'](_0x4de2('0x12'),function(){try{var _0x4219d8=new Buffer(_0x26df77[_0x4de2('0x13')](_0x4de2('0x11')),'binary');_0x25bb3c['write'](_0x4219d8);_0x25bb3c[_0x4de2('0x12')]();_0x25bb3c['on']('close',function(){return _0x1c51a8(_0x318211);});}catch(_0x41f195){fs['unlink'](_0x318211);return _0x38541a(_0x41f195);}});});};exports[_0x4de2('0x1b')]=function(_0x28cf84,_0x55fcab,_0x5b1199){var _0x4a5808=_0x5b1199||stringOptions[_0x4de2('0x6')];var _0x457698=_0x55fcab||stringOptions[_0x4de2('0x1c')];var _0x12b3f7=crypto[_0x4de2('0xf')](_0x4a5808,_0x457698);var _0x1b66e7=_0x12b3f7[_0x4de2('0x10')](_0x28cf84,_0x4de2('0x1d'),_0x4de2('0x1e'));_0x1b66e7+=_0x12b3f7[_0x4de2('0x13')](_0x4de2('0x1e'));return _0x1b66e7;};exports[_0x4de2('0x1f')]=function(_0x34e4c5,_0x5bf391,_0x54c994){var _0x497384=_0x54c994||stringOptions['algorithm'];var _0x4b7644=_0x5bf391||stringOptions['secret'];var _0xf12f56=crypto['createDecipher'](_0x497384,_0x4b7644);var _0x5aa993=_0xf12f56['update'](_0x34e4c5,_0x4de2('0x1e'),_0x4de2('0x1d'));_0x5aa993+=_0xf12f56['final']('utf8');return _0x5aa993;}; \ No newline at end of file +var _0xecbc=['aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','end','final','write','close','unlink','decryptFile','encryptString','secret','utf8','base64','decryptString','createDecipher','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xecbc,0x1a8));var _0xcecb=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xecbc[_0x11005e];return _0x29338f;};'use strict';var crypto=require(_0xcecb('0x0'));var fs=require('fs');var BPromise=require(_0xcecb('0x1'));var _=require(_0xcecb('0x2'));var config=require(_0xcecb('0x3'));var logger=require(_0xcecb('0x4'))(_0xcecb('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xcecb('0x6')][_0xcecb('0x7')],'algorithm':_0xcecb('0x8')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0xcecb('0x9')][_0xcecb('0xa')]){var isSupported=isAlgorithmSupported(config[_0xcecb('0x9')][_0xcecb('0xa')]);if(isSupported){fileOptions[_0xcecb('0xa')]=config[_0xcecb('0x9')][_0xcecb('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xcecb('0xb')](',\x20');logger[_0xcecb('0xc')](config[_0xcecb('0x9')][_0xcecb('0xa')],_0xcecb('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x327cb7){return AES_SUPPORTED_RX[_0xcecb('0xe')](_0x327cb7);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xcecb('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x484f96){return getSupportedCiphers()[_0xcecb('0x10')](_0x484f96)>-0x1;}function combineOptions(_0x3f230d){var _0x5243b2={};for(var _0xaef143 in fileOptions){if(fileOptions[_0xcecb('0x11')](_0xaef143)){_0x5243b2[_0xaef143]=fileOptions[_0xaef143];}}if(_0x3f230d){for(var _0x40fd2e in _0x3f230d){if(_0x3f230d[_0xcecb('0x11')](_0x40fd2e)){_0x5243b2[_0x40fd2e]=_0x3f230d[_0x40fd2e];}}}return _0x5243b2;}exports[_0xcecb('0x12')]=function(_0x4a1aa2,_0x3a3c51,_0x4e174e,_0x2f5789){return new BPromise(function(_0x5c0beb,_0x13aa19){_0x2f5789=combineOptions(_0x2f5789);var _0x1ac480=new Buffer(_0x4e174e);var _0xee0f7a=fs[_0xcecb('0x13')](_0x4a1aa2);var _0x4851f=fs[_0xcecb('0x14')](_0x3a3c51);var _0x1e4ecb=crypto['createCipher'](_0x2f5789[_0xcecb('0xa')],_0x1ac480);_0xee0f7a['on'](_0xcecb('0x15'),function(_0x5c83f5){var _0x2a43c2=new Buffer(_0x1e4ecb[_0xcecb('0x16')](_0x5c83f5),_0xcecb('0x17'));_0x4851f['write'](_0x2a43c2);});_0xee0f7a['on'](_0xcecb('0x18'),function(){try{var _0x315f93=new Buffer(_0x1e4ecb[_0xcecb('0x19')]('binary'),_0xcecb('0x17'));_0x4851f[_0xcecb('0x1a')](_0x315f93);_0x4851f[_0xcecb('0x18')]();_0x4851f['on'](_0xcecb('0x1b'),function(){return _0x5c0beb(_0x3a3c51);});}catch(_0x3312bf){fs[_0xcecb('0x1c')](_0x3a3c51);return _0x13aa19(_0x3312bf);}});});};exports[_0xcecb('0x1d')]=function(_0x152818,_0x3bd468,_0x566cdb,_0x225bb5){return new BPromise(function(_0x1d5b43,_0xe52504){_0x225bb5=combineOptions(_0x225bb5);var _0x53db7e=new Buffer(_0x566cdb);var _0x40e63f=fs[_0xcecb('0x13')](_0x152818);var _0x427146=fs[_0xcecb('0x14')](_0x3bd468);var _0x59407e=crypto['createDecipher'](_0x225bb5[_0xcecb('0xa')],_0x53db7e);_0x40e63f['on'](_0xcecb('0x15'),function(_0x1a050e){var _0x2e6d31=new Buffer(_0x59407e[_0xcecb('0x16')](_0x1a050e),'binary');_0x427146[_0xcecb('0x1a')](_0x2e6d31);});_0x40e63f['on'](_0xcecb('0x18'),function(){try{var _0x29f58d=new Buffer(_0x59407e[_0xcecb('0x19')](_0xcecb('0x17')),'binary');_0x427146[_0xcecb('0x1a')](_0x29f58d);_0x427146[_0xcecb('0x18')]();_0x427146['on']('close',function(){return _0x1d5b43(_0x3bd468);});}catch(_0x1f5045){fs[_0xcecb('0x1c')](_0x3bd468);return _0xe52504(_0x1f5045);}});});};exports[_0xcecb('0x1e')]=function(_0x3094a0,_0x49e307,_0xe46d88){var _0x2062c0=_0xe46d88||stringOptions[_0xcecb('0xa')];var _0x31cd19=_0x49e307||stringOptions[_0xcecb('0x1f')];var _0x4aa880=crypto['createCipher'](_0x2062c0,_0x31cd19);var _0x3f5ecb=_0x4aa880['update'](_0x3094a0,_0xcecb('0x20'),'base64');_0x3f5ecb+=_0x4aa880[_0xcecb('0x19')](_0xcecb('0x21'));return _0x3f5ecb;};exports[_0xcecb('0x22')]=function(_0x300bc5,_0x2be573,_0x557c62){var _0x2a3109=_0x557c62||stringOptions[_0xcecb('0xa')];var _0x25dd76=_0x2be573||stringOptions[_0xcecb('0x1f')];var _0x8320de=crypto[_0xcecb('0x23')](_0x2a3109,_0x25dd76);var _0x1511f9=_0x8320de[_0xcecb('0x16')](_0x300bc5,_0xcecb('0x21'),'utf8');_0x1511f9+=_0x8320de[_0xcecb('0x19')]('utf8');return _0x1511f9;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 6042afb..cb73f14 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 _0x3c81=['format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.csv','existsSync','join','each','csv','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','path','to-csv','bluebird','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info'];(function(_0x4f28fa,_0x150e41){var _0x371ae1=function(_0x182c33){while(--_0x182c33){_0x4f28fa['push'](_0x4f28fa['shift']());}};_0x371ae1(++_0x150e41);}(_0x3c81,0x102));var _0x13c8=function(_0x3ad7e5,_0x5b5a5d){_0x3ad7e5=_0x3ad7e5-0x0;var _0x5bfcdc=_0x3c81[_0x3ad7e5];return _0x5bfcdc;};'use strict';var util=require(_0x13c8('0x0'));var path=require(_0x13c8('0x1'));var _=require('lodash');var csv=require(_0x13c8('0x2'));var fs=require('fs');var BPromise=require(_0x13c8('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x13c8('0x4')];var logger=require(_0x13c8('0x5'))(_0x13c8('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x13c8('0x7')][0x2]);var QUERY=process[_0x13c8('0x7')][0x3];var PATH=process[_0x13c8('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x445b69,_0x4f7bcc){var _0x17c228={'status':_0x445b69};var _0x4905c3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4f7bcc){_0x17c228[_0x13c8('0x8')]=_0x4f7bcc;}return db[_0x13c8('0x9')][_0x13c8('0xa')](_0x17c228,_0x4905c3);}function main(){var _0x30b4d6=0x1388;var _0xaa58b6;logger[_0x13c8('0xb')](util[_0x13c8('0xc')](_0x13c8('0xd'),EXTRACTED_REPORT_ID,_0x13c8('0xe')));return db[_0x13c8('0xf')][_0x13c8('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x13c8('0x11'),_0x13c8('0x12')]})[_0x13c8('0x13')](function(_0x5ab91d){if(_0x5ab91d){_0xaa58b6=_0x5ab91d;_0x30b4d6=_0xaa58b6[_0x13c8('0x12')]||0x1388;}})[_0x13c8('0x13')](function(){return dbH[_0x13c8('0x14')][_0x13c8('0x15')](util['format'](_0x13c8('0x16'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x13c8('0x13')](function(_0x5e0e06){if(!_0x5e0e06[0x0][_0x13c8('0x17')]){return analyticExtractedReport(_0x13c8('0x18'));}var _0x23f64e=[];var _0x7cbfb=0x0;var _0x5d7906=!![];if(_0x5e0e06&&_0x5e0e06[_0x13c8('0x19')]){var _0x408abc=_0x5e0e06[0x0][_0x13c8('0x17')]%(_0x7cbfb+_0x30b4d6);if(_0xaa58b6[_0x13c8('0x11')]){for(;_0x5d7906;_0x7cbfb+=_0x30b4d6,_0x408abc=_0x5e0e06[0x0][_0x13c8('0x17')]%(_0x7cbfb+_0x30b4d6)){if(_0x408abc==0x0||_0x408abc==_0x5e0e06[0x0][_0x13c8('0x17')]){_0x5d7906=![];}_0x23f64e[_0x13c8('0x1a')](dbH[_0x13c8('0x14')][_0x13c8('0x15')](util[_0x13c8('0xc')](_0x13c8('0x1b'),QUERY,_0x30b4d6,_0x7cbfb),{'type':dbH['sequelize'][_0x13c8('0x1c')][_0x13c8('0x1d')]}));}}else{_0x23f64e[_0x13c8('0x1a')](dbH[_0x13c8('0x14')]['query'](QUERY,{'type':dbH[_0x13c8('0x14')][_0x13c8('0x1c')][_0x13c8('0x1d')]}));}}var _0x1f60ed=path[_0x13c8('0x1e')](PATH);var _0x2fc123=path['basename'](PATH,_0x13c8('0x1f'));var _0x1d8e9f=_0xaa58b6[_0x13c8('0x11')]&&_0x23f64e[_0x13c8('0x19')]>0x1;var _0x577df6=[];if(!fs[_0x13c8('0x20')](path[_0x13c8('0x21')](_0x1f60ed,_0x2fc123))&&_0x1d8e9f){fs['mkdirSync'](path['join'](_0x1f60ed,_0x2fc123));}return BPromise[_0x13c8('0x22')](_0x23f64e,function(_0x4aff35){_0x577df6['push'](_0x4aff35);})['then'](function(){for(var _0x288c3c=0x0;_0x288c3c<_0x577df6[_0x13c8('0x19')];_0x288c3c+=0x1){var _0x53ada9;var _0x4df077=_0x577df6[_0x288c3c];if(_0x1d8e9f){_0x53ada9=path[_0x13c8('0x21')](_0x1f60ed,_0x2fc123,util['format']('%s%d.%s',_0x2fc123,_0x288c3c,_0x13c8('0x23')));}else{_0x53ada9=path[_0x13c8('0x21')](_0x1f60ed,util[_0x13c8('0xc')]('%s.%s',_0x2fc123,'csv'));}fs[_0x13c8('0x24')](_0x53ada9,csv(_0x4df077));}})[_0x13c8('0x13')](function(){if(_0x1d8e9f){zipdir(path[_0x13c8('0x21')](_0x1f60ed,_0x2fc123),{'saveTo':path[_0x13c8('0x21')](_0x1f60ed,util[_0x13c8('0xc')](_0x13c8('0x25'),_0x2fc123,_0x13c8('0x26')))},function(_0x4a1b9c,_0x109cb8){});rimraf(path[_0x13c8('0x21')](_0x1f60ed,_0x2fc123),function(){});}})['then'](function(){logger['info'](util[_0x13c8('0xc')](_0x13c8('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x13c8('0x28'),_0x1d8e9f?util[_0x13c8('0xc')]('%s.%s',_0x2fc123,_0x1d8e9f?_0x13c8('0x26'):_0x13c8('0x23')):null);});})[_0x13c8('0x29')](function(_0x26a93b){logger[_0x13c8('0xb')](util[_0x13c8('0xc')](_0x13c8('0x2a'),EXTRACTED_REPORT_ID,_0x13c8('0xe')),util['inspect'](_0x26a93b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x13c8('0x2b')](function(){process[_0x13c8('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xe28e=['dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','CSV','Setting','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','length','existsSync','join','mkdirSync','each','%s.%s','csv','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0xe28e,0x1ba));var _0xee28=function(_0x3432d4,_0x20a858){_0x3432d4=_0x3432d4-0x0;var _0x2fd76c=_0xe28e[_0x3432d4];return _0x2fd76c;};'use strict';var util=require(_0xee28('0x0'));var path=require(_0xee28('0x1'));var _=require(_0xee28('0x2'));var csv=require(_0xee28('0x3'));var fs=require('fs');var BPromise=require(_0xee28('0x4'));var zipdir=require(_0xee28('0x5'));var rimraf=require(_0xee28('0x6'));var db=require(_0xee28('0x7'))['db'];var dbH=require(_0xee28('0x7'))[_0xee28('0x8')];var logger=require(_0xee28('0x9'))(_0xee28('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xee28('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xee28('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x30224a,_0x3f9bd9){var _0x66d0b6={'status':_0x30224a};var _0x156aad={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f9bd9){_0x66d0b6[_0xee28('0xc')]=_0x3f9bd9;}return db[_0xee28('0xd')]['update'](_0x66d0b6,_0x156aad);}function main(){var _0x5afe44=0x1388;var _0x561fe4;logger[_0xee28('0xe')](util[_0xee28('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xee28('0x10')));return db[_0xee28('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xee28('0x12'),_0xee28('0x13')]})[_0xee28('0x14')](function(_0x2488cf){if(_0x2488cf){_0x561fe4=_0x2488cf;_0x5afe44=_0x561fe4[_0xee28('0x13')]||0x1388;}})[_0xee28('0x14')](function(){return dbH[_0xee28('0x15')]['query'](util[_0xee28('0xf')](_0xee28('0x16'),QUERY),{'type':dbH[_0xee28('0x15')][_0xee28('0x17')][_0xee28('0x18')]});})['then'](function(_0x11ac93){if(!_0x11ac93[0x0][_0xee28('0x19')]){return analyticExtractedReport(_0xee28('0x1a'));}var _0x343358=[];var _0x1ff99e=0x0;var _0x11c95d=!![];if(_0x11ac93&&_0x11ac93['length']){var _0x1e9317=_0x11ac93[0x0]['num']%(_0x1ff99e+_0x5afe44);if(_0x561fe4[_0xee28('0x12')]){for(;_0x11c95d;_0x1ff99e+=_0x5afe44,_0x1e9317=_0x11ac93[0x0][_0xee28('0x19')]%(_0x1ff99e+_0x5afe44)){if(_0x1e9317==0x0||_0x1e9317==_0x11ac93[0x0]['num']){_0x11c95d=![];}_0x343358[_0xee28('0x1b')](dbH['sequelize'][_0xee28('0x1c')](util['format'](_0xee28('0x1d'),QUERY,_0x5afe44,_0x1ff99e),{'type':dbH['sequelize'][_0xee28('0x17')]['SELECT']}));}}else{_0x343358[_0xee28('0x1b')](dbH[_0xee28('0x15')][_0xee28('0x1c')](QUERY,{'type':dbH[_0xee28('0x15')][_0xee28('0x17')][_0xee28('0x18')]}));}}var _0x2dbd49=path['dirname'](PATH);var _0x342798=path[_0xee28('0x1e')](PATH,_0xee28('0x1f'));var _0x5a46cd=_0x561fe4['split']&&_0x343358[_0xee28('0x20')]>0x1;var _0x4a524d=[];if(!fs[_0xee28('0x21')](path[_0xee28('0x22')](_0x2dbd49,_0x342798))&&_0x5a46cd){fs[_0xee28('0x23')](path[_0xee28('0x22')](_0x2dbd49,_0x342798));}return BPromise[_0xee28('0x24')](_0x343358,function(_0x95d917){_0x4a524d[_0xee28('0x1b')](_0x95d917);})[_0xee28('0x14')](function(){for(var _0x281c8a=0x0;_0x281c8a<_0x4a524d['length'];_0x281c8a+=0x1){var _0x2c847b;var _0x5b1b1e=_0x4a524d[_0x281c8a];if(_0x5a46cd){_0x2c847b=path['join'](_0x2dbd49,_0x342798,util['format']('%s%d.%s',_0x342798,_0x281c8a,'csv'));}else{_0x2c847b=path[_0xee28('0x22')](_0x2dbd49,util[_0xee28('0xf')](_0xee28('0x25'),_0x342798,_0xee28('0x26')));}fs[_0xee28('0x27')](_0x2c847b,csv(_0x5b1b1e));}})[_0xee28('0x14')](function(){if(_0x5a46cd){zipdir(path[_0xee28('0x22')](_0x2dbd49,_0x342798),{'saveTo':path['join'](_0x2dbd49,util[_0xee28('0xf')](_0xee28('0x25'),_0x342798,_0xee28('0x28')))},function(_0x49644a,_0x14f7c4){});rimraf(path[_0xee28('0x22')](_0x2dbd49,_0x342798),function(){});}})[_0xee28('0x14')](function(){logger[_0xee28('0xe')](util[_0xee28('0xf')](_0xee28('0x29'),EXTRACTED_REPORT_ID,_0xee28('0x10')));return analyticExtractedReport('Completed',_0x5a46cd?util[_0xee28('0xf')](_0xee28('0x25'),_0x342798,_0x5a46cd?'zip':_0xee28('0x26')):null);});})[_0xee28('0x2a')](function(_0x3e84cc){logger[_0xee28('0xe')](util[_0xee28('0xf')](_0xee28('0x2b'),EXTRACTED_REPORT_ID,_0xee28('0x10')),util['inspect'](_0x3e84cc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xee28('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 5365f70..35e5bd6 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 _0x1ee4=['map','toString','value','fill','auto','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','Empty','.pdf','join','%s.%s','split','splitSizePdf','then','num','query','sequelize','QueryTypes','SELECT','length','existsSync','mkdirSync','all','flatten','createPdfKitDocument','%s%d.%s','pdf','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','createPdfFromHTML','util','path','moment','html-to-pdfmake','zip-dir','rimraf','window','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','tableHeader'];(function(_0x2cca6e,_0x5c4d19){var _0x3ddfb5=function(_0x2ae4b8){while(--_0x2ae4b8){_0x2cca6e['push'](_0x2cca6e['shift']());}};_0x3ddfb5(++_0x5c4d19);}(_0x1ee4,0x9d));var _0x41ee=function(_0x4f0afc,_0x3d938e){_0x4f0afc=_0x4f0afc-0x0;var _0x4c4ca8=_0x1ee4[_0x4f0afc];return _0x4c4ca8;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x41ee('0x0'));var path=require(_0x41ee('0x1'));var moment=require(_0x41ee('0x2'));var htmlToPdfmake=require(_0x41ee('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x41ee('0x4'));var rimraf=require(_0x41ee('0x5'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0x41ee('0x6')];var db=require(_0x41ee('0x7'))['db'];var dbH=require(_0x41ee('0x7'))[_0x41ee('0x8')];var logger=require(_0x41ee('0x9'))(_0x41ee('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x41ee('0xb')][0x2]);var QUERY=process[_0x41ee('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x41ee('0xb')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x272b7f,_0x34b57b){var _0x2b67d9={'status':_0x272b7f};var _0x3ef0c6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x34b57b){_0x2b67d9['savename']=_0x34b57b;}return db[_0x41ee('0xc')][_0x41ee('0xd')](_0x2b67d9,_0x3ef0c6);}function getHeaders(_0x4ca605){return _['map'](_0x4ca605,function(_0x11b5e9){return{'text':_0x11b5e9,'style':_0x41ee('0xe')};});}function getRows(_0x55240c,_0x336879){return _[_0x41ee('0xf')](_0x336879,function(_0x4f1ea7){return _(_0x4f1ea7)['pick'](_0x55240c)[_0x41ee('0xf')](function(_0x4f3f36){return _0x4f3f36?_[_0x41ee('0x10')](_0x4f3f36):'';})[_0x41ee('0x11')]();});}function createTable(_0x1c1121,_0x283cd2){var _0x27821f={'widths':_[_0x41ee('0x12')](Array(_0x1c1121['length']),0x91),'heights':function(_0x3072ff){return _0x3072ff===0x0?_0x41ee('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3ce2ab=getHeaders(_0x1c1121);_0x27821f[_0x41ee('0x14')][_0x41ee('0x15')](_0x3ce2ab);var _0x373a24=getRows(_0x1c1121,_0x283cd2);_0x27821f[_0x41ee('0x14')]=_0x27821f['body']['concat'](_0x373a24);return _0x27821f;}function createTables(_0x2ce7e9){var _0x55b1da=[];var _0x5d7d51=_[_0x41ee('0x16')](Object[_0x41ee('0x17')](_0x2ce7e9[0x0]),0x5);_0x5d7d51[_0x41ee('0x18')](function(_0x2b42c7){_0x55b1da[_0x41ee('0x15')](createTable(_0x2b42c7,_0x2ce7e9));});return _0x55b1da;}function getPDFDocDefinition(_0x45f5c6){var _0x47efa8=util[_0x41ee('0x19')](_0x41ee('0x1a'),NAME,EXTRACTED_REPORT[_0x41ee('0x1b')],moment(EXTRACTED_REPORT[_0x41ee('0x1c')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x41ee('0x1d')])[_0x41ee('0x19')](FORMAT));var _0x577ea5=[];for(var _0x19806d=0x0;_0x19806d<_0x45f5c6['length'];_0x19806d++){var _0x435629=[];if(_0x19806d===0x0){_0x435629[_0x41ee('0x15')]({'text':_0x47efa8,'style':_0x41ee('0x1e')});}var _0x3a5782={'table':_0x45f5c6[_0x19806d]};if(_0x19806d>0x0){_0x3a5782[_0x41ee('0x1f')]=_0x41ee('0x20');_0x3a5782[_0x41ee('0x21')]=[0x0,0x46,0x0,0x0];}_0x435629['push'](_0x3a5782);_0x577ea5['push'](_0x435629);}return{'pageSize':'A4','pageOrientation':_0x41ee('0x22'),'content':_0x577ea5,'footer':function(_0x447207,_0x284c46){return{'text':_0x447207[_0x41ee('0x10')]()+_0x41ee('0x23')+_0x284c46,'style':_0x41ee('0x24')};},'defaultStyle':{'font':_0x41ee('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x41308d){var _0x6d02=0x1388;var _0x2e29e9;if(!_0x41308d[0x0]['num']){return analyticExtractedReport(_0x41ee('0x26'));}var _0x27734d=[];var _0x22103d=0x0;var _0x18040c=!![];var _0x1ff189=path['dirname'](PATH);var _0x395ae4=path['basename'](PATH,_0x41ee('0x27'));var _0x159656=path[_0x41ee('0x28')](_0x1ff189,util[_0x41ee('0x19')](_0x41ee('0x29'),_0x395ae4,'pdf'));var _0x186572=![];return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x41ee('0x2a'),_0x41ee('0x2b')]})['then'](function(_0x421ad9){if(_0x421ad9){_0x2e29e9=_0x421ad9;_0x6d02=_0x2e29e9[_0x41ee('0x2b')]||0x3e8;}})[_0x41ee('0x2c')](function(){if(_0x41308d&&_0x41308d['length']){var _0x2702c6=_0x41308d[0x0]['num']%(_0x22103d+_0x6d02);if(_0x2e29e9[_0x41ee('0x2a')]){for(;_0x18040c;_0x22103d+=_0x6d02,_0x2702c6=_0x41308d[0x0][_0x41ee('0x2d')]%(_0x22103d+_0x6d02)){if(_0x2702c6==0x0||_0x2702c6==_0x41308d[0x0][_0x41ee('0x2d')]){_0x18040c=![];}_0x27734d['push'](dbH['sequelize'][_0x41ee('0x2e')](util[_0x41ee('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x6d02,_0x22103d),{'type':dbH[_0x41ee('0x2f')][_0x41ee('0x30')][_0x41ee('0x31')]}));}}else{_0x27734d[_0x41ee('0x15')](dbH[_0x41ee('0x2f')][_0x41ee('0x2e')](QUERY,{'type':dbH[_0x41ee('0x2f')][_0x41ee('0x30')][_0x41ee('0x31')]}));}}_0x186572=_0x2e29e9[_0x41ee('0x2a')]&&_0x27734d[_0x41ee('0x32')]>0x1;if(!fs[_0x41ee('0x33')](path[_0x41ee('0x28')](_0x1ff189,_0x395ae4))&&_0x186572){fs[_0x41ee('0x34')](path[_0x41ee('0x28')](_0x1ff189,_0x395ae4));}return Promise[_0x41ee('0x35')](_0x27734d);})['then'](function(_0x58e5f5){return createTables(_[_0x41ee('0x36')](_0x58e5f5));})['then'](function(_0x27c6c6){var _0x4780e6=getPDFDocDefinition(_0x27c6c6);var _0x33093f=getPDFPrinter();var _0xf4735a=_0x33093f[_0x41ee('0x37')](_0x4780e6);if(_0x186572)_0x159656=path['join'](_0x1ff189,_0x395ae4,util[_0x41ee('0x19')](_0x41ee('0x38'),_0x395ae4,index,_0x41ee('0x39')));return writePDFDocument(_0xf4735a,_0x159656);})[_0x41ee('0x2c')](function(){if(!_0x186572)return;zipdir(path[_0x41ee('0x28')](_0x1ff189,_0x395ae4),{'saveTo':path[_0x41ee('0x28')](_0x1ff189,util[_0x41ee('0x19')](_0x41ee('0x29'),_0x395ae4,_0x41ee('0x3a')))},function(_0x215e42){if(_0x215e42)throw _0x215e42;return;});})[_0x41ee('0x2c')](function(){if(!_0x186572)return;rimraf(path[_0x41ee('0x28')](_0x1ff189,_0x395ae4),function(){});})[_0x41ee('0x2c')](function(){logger[_0x41ee('0x3b')](util[_0x41ee('0x19')](_0x41ee('0x3c'),EXTRACTED_REPORT_ID,_0x41ee('0x3d')));return analyticExtractedReport(_0x41ee('0x3e'),_0x186572?util[_0x41ee('0x19')](_0x41ee('0x29'),_0x395ae4,_0x186572?_0x41ee('0x3a'):'pdf'):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0x41ee('0x3f'),EXTRACTED_REPORT_ID,_0x41ee('0x40')));return db[_0x41ee('0xc')][_0x41ee('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x30b610){EXTRACTED_REPORT=_0x30b610;return dbH[_0x41ee('0x2f')][_0x41ee('0x2e')](util['format'](_0x41ee('0x42'),QUERY),{'type':dbH[_0x41ee('0x2f')]['QueryTypes'][_0x41ee('0x31')]});})[_0x41ee('0x2c')](extractReport)[_0x41ee('0x43')](function(_0xd81008){logger['info'](util[_0x41ee('0x19')](_0x41ee('0x44'),EXTRACTED_REPORT_ID,_0x41ee('0x40')),util[_0x41ee('0x45')](_0xd81008,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x41ee('0x46')](function(){process[_0x41ee('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x518803=new PdfPrinter({'Arial':{'normal':__dirname+_0x41ee('0x48'),'bold':__dirname+_0x41ee('0x49'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x41ee('0x4a')}});return _0x518803;}function getPDFDocDefinitionFromHTML(_0x3f653a,_0x503725){var _0x113a53=util[_0x41ee('0x19')](_0x41ee('0x4b'),_0x503725[_0x41ee('0x4c')],_0x503725[_0x41ee('0x4d')]);var _0x22326a=moment()['format'](_0x41ee('0x4e'))[_0x41ee('0x10')]();var _0x1870e5=htmlToPdfmake(_0x3f653a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1870e5],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x41ee('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x41ee('0x4f')}},'header':function(){return[{'text':_0x41ee('0x50'),'style':'header'}];},'footer':function(_0x2d86d2,_0x172f48){return[{'text':util[_0x41ee('0x19')](_0x41ee('0x51'),_0x113a53,_0x2d86d2,_0x172f48,_0x22326a),'style':_0x41ee('0x24')}];}};}function writePDFDocument(_0x4e4e6c,_0x1ca27b){return new Promise(function(_0xe804fa,_0x2c208a){var _0x5dee64=_0x4e4e6c[_0x41ee('0x52')](fs['createWriteStream'](_0x1ca27b));_0x5dee64['on'](_0x41ee('0x53'),function(){_0xe804fa(_0x41ee('0x53'));});_0x5dee64['on'](_0x41ee('0x54'),function(_0x30d105){_0x2c208a(_0x30d105);});_0x4e4e6c['end']();});}exports[_0x41ee('0x55')]=function(_0x2757ac,_0x59ab3f){var _0x24a111=getPDFPrinter();var _0x3fa3be=getPDFDocDefinitionFromHTML(_0x2757ac,_0x59ab3f);var _0x52e3a4=_0x24a111['createPdfKitDocument'](_0x3fa3be);return writePDFDocument(_0x52e3a4,_0x59ab3f[_0x41ee('0x1')])[_0x41ee('0x43')](function(_0x13783c){throw _0x13783c;});}; \ No newline at end of file +var _0x04fc=['../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','auto','body','push','concat','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','before','toString','\x20/\x20','footer','Arial','basename','.pdf','join','format','%s.%s','Setting','split','then','num','sequelize','query','QueryTypes','SELECT','mkdirSync','all','flatten','createPdfKitDocument','%s%d.%s','pdf','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','channel','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','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window'];(function(_0xd745e9,_0x208bf6){var _0x2958f4=function(_0x5e3da4){while(--_0x5e3da4){_0xd745e9['push'](_0xd745e9['shift']());}};_0x2958f4(++_0x208bf6);}(_0x04fc,0xe9));var _0xc04f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x04fc[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xc04f('0x0'));var path=require(_0xc04f('0x1'));var moment=require(_0xc04f('0x2'));var htmlToPdfmake=require(_0xc04f('0x3'));var PdfPrinter=require(_0xc04f('0x4'));var zipdir=require(_0xc04f('0x5'));var rimraf=require(_0xc04f('0x6'));var JSDOM=require(_0xc04f('0x7'))[_0xc04f('0x8')];var window=new JSDOM('')[_0xc04f('0x9')];var db=require('../../mysqldb')['db'];var dbH=require(_0xc04f('0xa'))[_0xc04f('0xb')];var logger=require(_0xc04f('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xc04f('0xd')][0x2]);var QUERY=process[_0xc04f('0xd')][0x3];var PATH=process[_0xc04f('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xc04f('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x130864,_0x1f27d9){var _0x1aede8={'status':_0x130864};var _0x4ddd1e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1f27d9){_0x1aede8[_0xc04f('0xf')]=_0x1f27d9;}return db[_0xc04f('0x10')][_0xc04f('0x11')](_0x1aede8,_0x4ddd1e);}function getHeaders(_0x4a7635){return _[_0xc04f('0x12')](_0x4a7635,function(_0x4d8ef9){return{'text':_0x4d8ef9,'style':_0xc04f('0x13')};});}function getRows(_0x94c5ba,_0x384f2a){return _[_0xc04f('0x12')](_0x384f2a,function(_0x51f9ae){return _(_0x51f9ae)[_0xc04f('0x14')](_0x94c5ba)['map'](function(_0xcc2416){return _0xcc2416?_['toString'](_0xcc2416):'';})[_0xc04f('0x15')]();});}function createTable(_0x3e63bd,_0x2dae3d){var _0x167cfc={'widths':_[_0xc04f('0x16')](Array(_0x3e63bd[_0xc04f('0x17')]),0x91),'heights':function(_0x1bf8a3){return _0x1bf8a3===0x0?_0xc04f('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2df89d=getHeaders(_0x3e63bd);_0x167cfc[_0xc04f('0x19')][_0xc04f('0x1a')](_0x2df89d);var _0x4aa940=getRows(_0x3e63bd,_0x2dae3d);_0x167cfc[_0xc04f('0x19')]=_0x167cfc[_0xc04f('0x19')][_0xc04f('0x1b')](_0x4aa940);return _0x167cfc;}function createTables(_0x8b6a2b){var _0x12acd3=[];var _0x1ee69d=_['chunk'](Object[_0xc04f('0x1c')](_0x8b6a2b[0x0]),0x5);_0x1ee69d[_0xc04f('0x1d')](function(_0x1e72c1){_0x12acd3[_0xc04f('0x1a')](createTable(_0x1e72c1,_0x8b6a2b));});return _0x12acd3;}function getPDFDocDefinition(_0x39fb60){var _0x5ee67d=util['format'](_0xc04f('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xc04f('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xc04f('0x20')])['format'](FORMAT));var _0x4daccf=[];for(var _0xcb6aa4=0x0;_0xcb6aa4<_0x39fb60['length'];_0xcb6aa4++){var _0x1cd2e9=[];if(_0xcb6aa4===0x0){_0x1cd2e9[_0xc04f('0x1a')]({'text':_0x5ee67d,'style':'header'});}var _0x5be55e={'table':_0x39fb60[_0xcb6aa4]};if(_0xcb6aa4>0x0){_0x5be55e['pageBreak']=_0xc04f('0x21');_0x5be55e['margin']=[0x0,0x46,0x0,0x0];}_0x1cd2e9[_0xc04f('0x1a')](_0x5be55e);_0x4daccf[_0xc04f('0x1a')](_0x1cd2e9);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x4daccf,'footer':function(_0x27baac,_0x423085){return{'text':_0x27baac[_0xc04f('0x22')]()+_0xc04f('0x23')+_0x423085,'style':_0xc04f('0x24')};},'defaultStyle':{'font':_0xc04f('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x370ed4){var _0x4f3536=0x1388;var _0x27ce21;if(!_0x370ed4[0x0]['num']){return analyticExtractedReport('Empty');}var _0x4743cf=[];var _0x1e18a1=0x0;var _0x3bffcd=!![];var _0x416829=path['dirname'](PATH);var _0x27e431=path[_0xc04f('0x26')](PATH,_0xc04f('0x27'));var _0xcd786a=path[_0xc04f('0x28')](_0x416829,util[_0xc04f('0x29')](_0xc04f('0x2a'),_0x27e431,'pdf'));var _0x31bc28=![];return db[_0xc04f('0x2b')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc04f('0x2c'),'splitSizePdf']})[_0xc04f('0x2d')](function(_0x3b2f24){if(_0x3b2f24){_0x27ce21=_0x3b2f24;_0x4f3536=_0x27ce21['splitSizePdf']||0x3e8;}})[_0xc04f('0x2d')](function(){if(_0x370ed4&&_0x370ed4[_0xc04f('0x17')]){var _0x2c5efa=_0x370ed4[0x0][_0xc04f('0x2e')]%(_0x1e18a1+_0x4f3536);if(_0x27ce21[_0xc04f('0x2c')]){for(;_0x3bffcd;_0x1e18a1+=_0x4f3536,_0x2c5efa=_0x370ed4[0x0][_0xc04f('0x2e')]%(_0x1e18a1+_0x4f3536)){if(_0x2c5efa==0x0||_0x2c5efa==_0x370ed4[0x0][_0xc04f('0x2e')]){_0x3bffcd=![];}_0x4743cf['push'](dbH[_0xc04f('0x2f')][_0xc04f('0x30')](util[_0xc04f('0x29')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4f3536,_0x1e18a1),{'type':dbH[_0xc04f('0x2f')][_0xc04f('0x31')][_0xc04f('0x32')]}));}}else{_0x4743cf[_0xc04f('0x1a')](dbH['sequelize'][_0xc04f('0x30')](QUERY,{'type':dbH['sequelize'][_0xc04f('0x31')][_0xc04f('0x32')]}));}}_0x31bc28=_0x27ce21[_0xc04f('0x2c')]&&_0x4743cf[_0xc04f('0x17')]>0x1;if(!fs['existsSync'](path[_0xc04f('0x28')](_0x416829,_0x27e431))&&_0x31bc28){fs[_0xc04f('0x33')](path['join'](_0x416829,_0x27e431));}return Promise[_0xc04f('0x34')](_0x4743cf);})[_0xc04f('0x2d')](function(_0x292b9f){return createTables(_[_0xc04f('0x35')](_0x292b9f));})[_0xc04f('0x2d')](function(_0x27667e){var _0x56bb70=getPDFDocDefinition(_0x27667e);var _0x3eb915=getPDFPrinter();var _0x275865=_0x3eb915[_0xc04f('0x36')](_0x56bb70);if(_0x31bc28)_0xcd786a=path[_0xc04f('0x28')](_0x416829,_0x27e431,util[_0xc04f('0x29')](_0xc04f('0x37'),_0x27e431,index,_0xc04f('0x38')));return writePDFDocument(_0x275865,_0xcd786a);})[_0xc04f('0x2d')](function(){if(!_0x31bc28)return;zipdir(path[_0xc04f('0x28')](_0x416829,_0x27e431),{'saveTo':path['join'](_0x416829,util[_0xc04f('0x29')](_0xc04f('0x2a'),_0x27e431,_0xc04f('0x39')))},function(_0x42b7ff){if(_0x42b7ff)throw _0x42b7ff;return;});})['then'](function(){if(!_0x31bc28)return;rimraf(path[_0xc04f('0x28')](_0x416829,_0x27e431),function(){});})[_0xc04f('0x2d')](function(){logger[_0xc04f('0x3a')](util[_0xc04f('0x29')](_0xc04f('0x3b'),EXTRACTED_REPORT_ID,_0xc04f('0x3c')));return analyticExtractedReport('Completed',_0x31bc28?util[_0xc04f('0x29')](_0xc04f('0x2a'),_0x27e431,_0x31bc28?_0xc04f('0x39'):_0xc04f('0x38')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc04f('0x3a')](util[_0xc04f('0x29')](_0xc04f('0x3d'),EXTRACTED_REPORT_ID,_0xc04f('0x3e')));return db['AnalyticExtractedReport'][_0xc04f('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x66734e){EXTRACTED_REPORT=_0x66734e;return dbH[_0xc04f('0x2f')]['query'](util[_0xc04f('0x29')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xc04f('0x2f')][_0xc04f('0x31')][_0xc04f('0x32')]});})[_0xc04f('0x2d')](extractReport)['catch'](function(_0x58d015){logger['info'](util[_0xc04f('0x29')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc04f('0x3e')),util[_0xc04f('0x40')](_0x58d015,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc04f('0x41'));})[_0xc04f('0x42')](function(){process[_0xc04f('0x43')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3f86e1=new PdfPrinter({'Arial':{'normal':__dirname+_0xc04f('0x44'),'bold':__dirname+_0xc04f('0x45'),'italics':__dirname+_0xc04f('0x46'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x3f86e1;}function getPDFDocDefinitionFromHTML(_0x2ab885,_0x293755){var _0x158dfa=util[_0xc04f('0x29')]('%s\x20#%d',_0x293755[_0xc04f('0x47')],_0x293755['interactionId']);var _0x3daccb=moment()['format']('YYYY-MM-DD')['toString']();var _0x43caa6=htmlToPdfmake(_0x2ab885,{'window':window,'tableAutoSize':!![]});return{'content':[_0x43caa6],'defaultStyle':{'font':_0xc04f('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xc04f('0x48')}},'header':function(){return[{'text':_0xc04f('0x49'),'style':'header'}];},'footer':function(_0x425169,_0x8c5352){return[{'text':util[_0xc04f('0x29')](_0xc04f('0x4a'),_0x158dfa,_0x425169,_0x8c5352,_0x3daccb),'style':_0xc04f('0x24')}];}};}function writePDFDocument(_0x235a3a,_0x252150){return new Promise(function(_0x7ab04c,_0x5d8fa4){var _0x4a4b30=_0x235a3a[_0xc04f('0x4b')](fs[_0xc04f('0x4c')](_0x252150));_0x4a4b30['on']('finish',function(){_0x7ab04c(_0xc04f('0x4d'));});_0x4a4b30['on'](_0xc04f('0x4e'),function(_0x5261d9){_0x5d8fa4(_0x5261d9);});_0x235a3a[_0xc04f('0x4f')]();});}exports[_0xc04f('0x50')]=function(_0x46e349,_0x490e68){var _0x40adbf=getPDFPrinter();var _0x53fe52=getPDFDocDefinitionFromHTML(_0x46e349,_0x490e68);var _0x5733f7=_0x40adbf[_0xc04f('0x36')](_0x53fe52);return writePDFDocument(_0x5733f7,_0x490e68[_0xc04f('0x1')])['catch'](function(_0x18c29d){throw _0x18c29d;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 9bcdbcf..4e7455a 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 _0x662c=['existsSync','mkdirSync','%s%d.%s','join','%s.%s','xlsx','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','inspect','finally','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0x662c,0x140));var _0xc662=function(_0x43e834,_0x364d29){_0x43e834=_0x43e834-0x0;var _0x56b530=_0x662c[_0x43e834];return _0x56b530;};'use strict';var util=require(_0xc662('0x0'));var path=require(_0xc662('0x1'));var _=require(_0xc662('0x2'));var fs=require('fs');var json2xls=require(_0xc662('0x3'));var BPromise=require(_0xc662('0x4'));var zipdir=require(_0xc662('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xc662('0x6'))[_0xc662('0x7')];var logger=require(_0xc662('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xc662('0x9')][0x2]);var QUERY=process[_0xc662('0x9')][0x3];var PATH=process[_0xc662('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x532ebb,_0x106710){var _0x2b9824={'status':_0x532ebb};var _0x4950c8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x106710){_0x2b9824[_0xc662('0xa')]=_0x106710;}return db[_0xc662('0xb')]['update'](_0x2b9824,_0x4950c8);}function main(){var _0x39bc1a=0x1388;var _0x49d0f6;logger[_0xc662('0xc')](util[_0xc662('0xd')](_0xc662('0xe'),EXTRACTED_REPORT_ID,_0xc662('0xf')));return db[_0xc662('0x10')][_0xc662('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc662('0x12'),'splitSizeXlsx']})['then'](function(_0x4b421f){if(_0x4b421f){_0x49d0f6=_0x4b421f;_0x39bc1a=_0x49d0f6['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xc662('0x13')][_0xc662('0x14')](util[_0xc662('0xd')](_0xc662('0x15'),QUERY),{'type':dbH['sequelize'][_0xc662('0x16')][_0xc662('0x17')]});})[_0xc662('0x18')](function(_0x4b1776){if(!_0x4b1776[0x0][_0xc662('0x19')]){return analyticExtractedReport(_0xc662('0x1a'));}var _0x3194fc=[];var _0x1be650=0x0;var _0x447a71=!![];if(_0x49d0f6['split']){if(_0x4b1776&&_0x4b1776[_0xc662('0x1b')]){var _0x2e2c0b=_0x4b1776[0x0][_0xc662('0x19')]%(_0x1be650+_0x39bc1a);for(;_0x447a71;_0x1be650+=_0x39bc1a,_0x2e2c0b=_0x4b1776[0x0][_0xc662('0x19')]%(_0x1be650+_0x39bc1a)){if(_0x2e2c0b==0x0||_0x2e2c0b==_0x4b1776[0x0]['num']){_0x447a71=![];}_0x3194fc[_0xc662('0x1c')](dbH['sequelize']['query'](util[_0xc662('0xd')](_0xc662('0x1d'),QUERY,_0x39bc1a,_0x1be650),{'type':dbH[_0xc662('0x13')][_0xc662('0x16')][_0xc662('0x17')]}));}}}else{_0x3194fc[_0xc662('0x1c')](dbH[_0xc662('0x13')][_0xc662('0x14')](QUERY,{'type':dbH['sequelize'][_0xc662('0x16')][_0xc662('0x17')]}));}var _0x7f911=path[_0xc662('0x1e')](PATH);var _0x299911=path['basename'](PATH,_0xc662('0x1f'));var _0x3d40dc=_0x49d0f6[_0xc662('0x12')]&&_0x3194fc[_0xc662('0x1b')]>0x1;var _0x4e113d=[];if(!fs[_0xc662('0x20')](path['join'](_0x7f911,_0x299911))&&_0x3d40dc){fs[_0xc662('0x21')](path['join'](_0x7f911,_0x299911));}return BPromise['each'](_0x3194fc,function(_0x52549a){_0x4e113d[_0xc662('0x1c')](_0x52549a);})[_0xc662('0x18')](function(){for(var _0x4f8234=0x0;_0x4f8234<_0x4e113d[_0xc662('0x1b')];_0x4f8234+=0x1){var _0x63b62;var _0x7c4f5e=_0x4e113d[_0x4f8234];if(_0x3d40dc){_0x63b62=path['join'](_0x7f911,_0x299911,util[_0xc662('0xd')](_0xc662('0x22'),_0x299911,_0x4f8234,'xlsx'));}else{_0x63b62=path[_0xc662('0x23')](_0x7f911,util[_0xc662('0xd')](_0xc662('0x24'),_0x299911,_0xc662('0x25')));}fs['writeFileSync'](_0x63b62,json2xls(_0x7c4f5e),_0xc662('0x26'));}})[_0xc662('0x18')](function(){if(_0x3d40dc){zipdir(path[_0xc662('0x23')](_0x7f911,_0x299911),{'saveTo':path[_0xc662('0x23')](_0x7f911,util['format'](_0xc662('0x24'),_0x299911,'zip'))},function(_0x55f7bf,_0x56ef13){});rimraf(path[_0xc662('0x23')](_0x7f911,_0x299911),function(){});}})[_0xc662('0x18')](function(){logger[_0xc662('0xc')](util[_0xc662('0xd')](_0xc662('0x27'),EXTRACTED_REPORT_ID,_0xc662('0xf')));return analyticExtractedReport('Completed',_0x3d40dc?util[_0xc662('0xd')]('%s.%s',_0x299911,_0x3d40dc?_0xc662('0x28'):_0xc662('0x25')):null);});})[_0xc662('0x29')](function(_0x453584){logger[_0xc662('0xc')](util[_0xc662('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc662('0xf')),util[_0xc662('0x2a')](_0x453584,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xc662('0x2b')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd3fc=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','push','dirname','basename','.xlsx','mkdirSync','each','join','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','rimraf','../../mysqldb','../../config/logger','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','then','sequelize','query'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xd3fc,0xf7));var _0xcd3f=function(_0x175a50,_0x55b532){_0x175a50=_0x175a50-0x0;var _0x1cba0a=_0xd3fc[_0x175a50];return _0x1cba0a;};'use strict';var util=require(_0xcd3f('0x0'));var path=require(_0xcd3f('0x1'));var _=require(_0xcd3f('0x2'));var fs=require('fs');var json2xls=require(_0xcd3f('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xcd3f('0x4'));var db=require(_0xcd3f('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xcd3f('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xcd3f('0x7')][0x2]);var QUERY=process[_0xcd3f('0x7')][0x3];var PATH=process[_0xcd3f('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x58888d,_0x5c00f1){var _0x3994ac={'status':_0x58888d};var _0x525dd4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5c00f1){_0x3994ac[_0xcd3f('0x8')]=_0x5c00f1;}return db['AnalyticExtractedReport'][_0xcd3f('0x9')](_0x3994ac,_0x525dd4);}function main(){var _0x5b44b7=0x1388;var _0x333f24;logger[_0xcd3f('0xa')](util[_0xcd3f('0xb')](_0xcd3f('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0xcd3f('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0xcd3f('0xe')](function(_0x202940){if(_0x202940){_0x333f24=_0x202940;_0x5b44b7=_0x333f24['splitSizeXlsx']||0x1388;}})[_0xcd3f('0xe')](function(){return dbH[_0xcd3f('0xf')][_0xcd3f('0x10')](util['format'](_0xcd3f('0x11'),QUERY),{'type':dbH[_0xcd3f('0xf')][_0xcd3f('0x12')][_0xcd3f('0x13')]});})['then'](function(_0x382d25){if(!_0x382d25[0x0][_0xcd3f('0x14')]){return analyticExtractedReport(_0xcd3f('0x15'));}var _0x3599e1=[];var _0x223043=0x0;var _0x5515bd=!![];if(_0x333f24[_0xcd3f('0x16')]){if(_0x382d25&&_0x382d25[_0xcd3f('0x17')]){var _0x593bec=_0x382d25[0x0][_0xcd3f('0x14')]%(_0x223043+_0x5b44b7);for(;_0x5515bd;_0x223043+=_0x5b44b7,_0x593bec=_0x382d25[0x0]['num']%(_0x223043+_0x5b44b7)){if(_0x593bec==0x0||_0x593bec==_0x382d25[0x0][_0xcd3f('0x14')]){_0x5515bd=![];}_0x3599e1[_0xcd3f('0x18')](dbH[_0xcd3f('0xf')][_0xcd3f('0x10')](util[_0xcd3f('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5b44b7,_0x223043),{'type':dbH[_0xcd3f('0xf')]['QueryTypes'][_0xcd3f('0x13')]}));}}}else{_0x3599e1[_0xcd3f('0x18')](dbH[_0xcd3f('0xf')][_0xcd3f('0x10')](QUERY,{'type':dbH[_0xcd3f('0xf')][_0xcd3f('0x12')][_0xcd3f('0x13')]}));}var _0x384cab=path[_0xcd3f('0x19')](PATH);var _0x181775=path[_0xcd3f('0x1a')](PATH,_0xcd3f('0x1b'));var _0x1a7fed=_0x333f24['split']&&_0x3599e1[_0xcd3f('0x17')]>0x1;var _0xcc96ca=[];if(!fs['existsSync'](path['join'](_0x384cab,_0x181775))&&_0x1a7fed){fs[_0xcd3f('0x1c')](path['join'](_0x384cab,_0x181775));}return BPromise[_0xcd3f('0x1d')](_0x3599e1,function(_0x3a03e4){_0xcc96ca[_0xcd3f('0x18')](_0x3a03e4);})[_0xcd3f('0xe')](function(){for(var _0x151e39=0x0;_0x151e39<_0xcc96ca['length'];_0x151e39+=0x1){var _0x4261c2;var _0x11cc19=_0xcc96ca[_0x151e39];if(_0x1a7fed){_0x4261c2=path[_0xcd3f('0x1e')](_0x384cab,_0x181775,util[_0xcd3f('0xb')](_0xcd3f('0x1f'),_0x181775,_0x151e39,_0xcd3f('0x20')));}else{_0x4261c2=path[_0xcd3f('0x1e')](_0x384cab,util[_0xcd3f('0xb')]('%s.%s',_0x181775,'xlsx'));}fs[_0xcd3f('0x21')](_0x4261c2,json2xls(_0x11cc19),_0xcd3f('0x22'));}})[_0xcd3f('0xe')](function(){if(_0x1a7fed){zipdir(path['join'](_0x384cab,_0x181775),{'saveTo':path[_0xcd3f('0x1e')](_0x384cab,util[_0xcd3f('0xb')](_0xcd3f('0x23'),_0x181775,_0xcd3f('0x24')))},function(_0x14e624,_0x28267e){});rimraf(path[_0xcd3f('0x1e')](_0x384cab,_0x181775),function(){});}})['then'](function(){logger[_0xcd3f('0xa')](util[_0xcd3f('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xcd3f('0x25')));return analyticExtractedReport(_0xcd3f('0x26'),_0x1a7fed?util[_0xcd3f('0xb')](_0xcd3f('0x23'),_0x181775,_0x1a7fed?'zip':_0xcd3f('0x20')):null);});})[_0xcd3f('0x27')](function(_0x3cbb2c){logger[_0xcd3f('0xa')](util[_0xcd3f('0xb')](_0xcd3f('0x28'),EXTRACTED_REPORT_ID,_0xcd3f('0x25')),util[_0xcd3f('0x29')](_0x3cbb2c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcd3f('0x2a'));})[_0xcd3f('0x2b')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index f74c6ff..93101e5 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 _0xaeed=['answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','rewrite','lodash','util','Interval','findAll','models','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','then','filter','queue','playback','hasOwnProperty','priority','extension','push','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','Set','outbound','extensions','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','length','toLowerCase','createdAt','updatedAt','interval','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)'];(function(_0x21fdbb,_0x157d2b){var _0x2793da=function(_0x34dfce){while(--_0x34dfce){_0x21fdbb['push'](_0x21fdbb['shift']());}};_0x2793da(++_0x157d2b);}(_0xaeed,0xd8));var _0xdaee=function(_0x1ad758,_0x404e4b){_0x1ad758=_0x1ad758-0x0;var _0x5cd6c5=_0xaeed[_0x1ad758];return _0x5cd6c5;};'use strict';var _=require(_0xdaee('0x0'));var util=require(_0xdaee('0x1'));function rewrite(_0x7e19e4,_0x5a08f0){var _0x1298a9=this;return _0x7e19e4['models'][_0xdaee('0x2')][_0xdaee('0x3')]({'raw':!![]})['then'](function(_0x492b5f){_0x1298a9['intervals']=_0x492b5f;return _0x7e19e4[_0xdaee('0x4')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x5a08f0[_0xdaee('0x5')]},'raw':!![]});})['then'](function(_0x4f925e){return _0x7e19e4[_0xdaee('0x4')][_0xdaee('0x6')][_0xdaee('0x3')]({'where':{'exten':{'$in':_[_0xdaee('0x7')](_[_0xdaee('0x8')](_0x4f925e,_0xdaee('0x9')))}},'order':[{'raw':_0xdaee('0xa')}],'raw':!![]});})[_0xdaee('0xb')](function(_0x352157){var _0x1f0a07=_[_0xdaee('0xc')](_0x352157,{'priority':'1'});var _0x52b141=_['filter'](_0x352157,{'isApp':0x1});var _0x556052=_['groupBy'](_0x52b141,_0xdaee('0x9'));var _0x13ff73=[_0xdaee('0xd'),_0xdaee('0xe')];var _0x23138b=[];var _0x354ccc=[];for(var _0x5b9baa in _0x556052){if(_0x556052[_0xdaee('0xf')](_0x5b9baa)){_0x1298a9[_0xdaee('0x10')]=0x2;_0x1298a9['extensions']=[];_0x1298a9[_0xdaee('0x11')]=_['find'](_0x1f0a07,{'exten':_0x556052[_0x5b9baa][0x0]['exten']});_0x1298a9['extensions'][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0]['type'],'app':'Set','appdata':util[_0xdaee('0x13')](_0xdaee('0x14'),_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')]),'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});if(_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')]===_0xdaee('0x18')){_0x1298a9['extensions'][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':'CDR(routeid)='+_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')],'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0]['exten'],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});}else if(_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')]===_0xdaee('0x1a')){if(_0x1298a9[_0xdaee('0x11')]){_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x1c')+(_0x1298a9[_0xdaee('0x11')][_0xdaee('0x1d')]?_0xdaee('0x1e')+_0x1298a9[_0xdaee('0x11')]['cutdigits']+'}':_0xdaee('0x1f')),'context':_0x556052[_0x5b9baa][0x0]['context'],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});}_0x1298a9['extensions'][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x20')+_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')],'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9['priority']++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});var _0x591723=_0x1298a9[_0xdaee('0x10')]++;_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x591723+0x2)+'):Goto('+(_0x591723+0x1)+')','context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x591723,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});if(_0x1298a9['extension']){_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0x1298a9[_0xdaee('0x11')]['cutdigits']?_0xdaee('0x22')+_0x1298a9[_0xdaee('0x11')][_0xdaee('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x556052[_0x5b9baa][0x0]['context'],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});}_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0]['type'],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x23')+_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')],'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});if(_0x1298a9[_0xdaee('0x11')]&&_0x1298a9[_0xdaee('0x11')][_0xdaee('0xf')]('recordingFormat')&&_0x1298a9['extension'][_0xdaee('0x24')]!==_0xdaee('0x25')){_0x1298a9[_0xdaee('0x1b')]['push']({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x26'),'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0]['exten'],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x27')+_0x1298a9[_0xdaee('0x11')][_0xdaee('0x24')]||_0xdaee('0x28'),'context':_0x556052[_0x5b9baa][0x0]['context'],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9['priority']++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});}}_0x1298a9['extensions'][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0]['type'],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x29'),'context':_0x556052[_0x5b9baa][0x0]['context'],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});_0x1298a9[_0xdaee('0x1b')]['push']({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':'MONITOR_OPTIONS=ab','context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});for(var _0x2d7a19=0x0,_0x34f641=0x0;_0x2d7a19<_0x556052[_0x5b9baa][_0xdaee('0x2a')];_0x2d7a19+=0x1,_0x34f641=0x0){var _0x18c473=_0x556052[_0x5b9baa][_0x2d7a19];if(_0x18c473[_0xdaee('0x15')]){_0x18c473[_0xdaee('0x15')]=_0x18c473['type'][_0xdaee('0x2b')]();}var _0xfdb893=[];var _0x50da27=[];delete _0x18c473['id'];delete _0x18c473[_0xdaee('0x2c')];delete _0x18c473[_0xdaee('0x2d')];var _0x1c6389=_0x18c473['interval']!=='*,*,*,*'?[_0x18c473[_0xdaee('0x2e')]]:_0x18c473['IntervalId']?_['map'](_[_0xdaee('0xc')](_0x1298a9[_0xdaee('0x2f')],{'IntervalId':_0x18c473[_0xdaee('0x5')]}),_0xdaee('0x2e')):[];if(_0x18c473[_0xdaee('0xf')](_0xdaee('0x30'))){if(_0x18c473[_0xdaee('0x30')]&&_0x18c473[_0xdaee('0x30')]!=='--'){_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':'Set','appdata':_0xdaee('0x31')+_0x18c473[_0xdaee('0x30')],'context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389['length']+_0x1298a9['priority']+_0x34f641++,'VoiceExtensionId':_0x18c473[_0xdaee('0x17')]});}}if(_0x18c473[_0xdaee('0x15')]==='outbound'&&_0x18c473['hasOwnProperty'](_0xdaee('0x32'))){if(_0x18c473[_0xdaee('0x32')]){_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x18c473[_0xdaee('0x32')]+')','context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389[_0xdaee('0x2a')]+_0x1298a9[_0xdaee('0x10')]+_0x34f641++,'VoiceExtensionId':_0x18c473[_0xdaee('0x17')]});}else{_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':_0xdaee('0x21'),'appdata':_0xdaee('0x33'),'context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389[_0xdaee('0x2a')]+_0x1298a9[_0xdaee('0x10')]+_0x34f641++,'VoiceExtensionId':_0x18c473['VoiceExtensionId']});}}if(_0x18c473[_0xdaee('0xf')](_0xdaee('0x34'))){if(_0x13ff73['indexOf'](_0x18c473['app']['toLowerCase']())>=0x0&&_0x18c473['appType']!=='custom'){if(_0x18c473[_0xdaee('0x34')]){_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':_0xdaee('0x21'),'appdata':_0xdaee('0x35'),'context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389[_0xdaee('0x2a')]+_0x1298a9[_0xdaee('0x10')]+_0x34f641++,'VoiceExtensionId':_0x18c473[_0xdaee('0x17')]});_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x36'),'context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389[_0xdaee('0x2a')]+_0x1298a9['priority']+_0x34f641++,'VoiceExtensionId':_0x18c473[_0xdaee('0x17')]});}else{_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':_0xdaee('0x21'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473['exten'],'priority':_0x1c6389['length']+_0x1298a9[_0xdaee('0x10')]+_0x34f641++,'VoiceExtensionId':_0x18c473['VoiceExtensionId']});_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473['type'],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x37'),'context':_0x18c473['context'],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389[_0xdaee('0x2a')]+_0x1298a9[_0xdaee('0x10')]+_0x34f641++,'VoiceExtensionId':_0x18c473[_0xdaee('0x17')]});}}}for(var _0x2a0f1e=0x0;_0x2a0f1e<_0x1c6389[_0xdaee('0x2a')];_0x2a0f1e+=0x1){var _0x144c58=_0x1298a9[_0xdaee('0x10')]+_0x1c6389[_0xdaee('0x2a')];var _0x5e958e=_0x2a0f1e===_0x1c6389[_0xdaee('0x2a')]-0x1?_0x1298a9[_0xdaee('0x10')]+_0xfdb893[_0xdaee('0x2a')]+_0x50da27['length']+0x2:_0x1298a9[_0xdaee('0x10')]+_0x2a0f1e+0x1;_0xfdb893[_0xdaee('0x38')](_0x2a0f1e,0x0,{'type':_0x18c473[_0xdaee('0x15')],'app':_0xdaee('0x39'),'appdata':_0x1c6389[_0x2a0f1e]+'?'+_0x18c473['context']+_0xdaee('0x3a')+_0x144c58+':'+_0x18c473[_0xdaee('0x16')]+_0xdaee('0x3a')+_0x5e958e,'exten':_0x18c473[_0xdaee('0x9')],'context':_0x18c473['context'],'priority':_0x1298a9[_0xdaee('0x10')]+_0x2a0f1e,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});}_0x18c473['priority']=_0xfdb893[_0xdaee('0x2a')]?_['last'](_0xfdb893)[_0xdaee('0x10')]+0x1:_0x1298a9[_0xdaee('0x10')];_0x1298a9[_0xdaee('0x10')]=(_0x50da27[_0xdaee('0x2a')]?_[_0xdaee('0x3b')](_0x50da27)['priority']:_0x18c473['priority'])+0x1;_0x1298a9['extensions']=_[_0xdaee('0x3c')](_0x1298a9['extensions'],_0xfdb893,[_0x18c473],_0x50da27);}_0x1298a9[_0xdaee('0x1b')]['push']({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x3d'),'exten':_0x556052[_0x5b9baa][0x0]['exten'],'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'priority':_0x1298a9[_0xdaee('0x10')],'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});_0x23138b['push'](_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]);_0x354ccc=_['concat'](_0x354ccc,_0x1298a9[_0xdaee('0x1b')]);}}return _0x7e19e4[_0xdaee('0x3e')](function(_0x1ca795){return _0x7e19e4[_0xdaee('0x4')][_0xdaee('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x23138b}},'transaction':_0x1ca795})[_0xdaee('0xb')](function(_0x3dfb23){return _0x7e19e4['models'][_0xdaee('0x6')][_0xdaee('0x3f')](_[_0xdaee('0x40')](_0x354ccc,'priority'),{'transaction':_0x1ca795});});});})[_0xdaee('0x41')](function(_0x5ac1de){console['error'](_0x5ac1de);});}exports[_0xdaee('0x42')]=rewrite; \ No newline at end of file +var _0x22d3=['extensions','CDR(routeid)=','outbound','cutdigits','${EXTEN}','context','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','intervals','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','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','transaction','destroy','then','bulkCreate','sortBy','error','lodash','models','Interval','findAll','VoiceExtension','uniq','filter','exten','queue','hasOwnProperty','priority','extension','push','type','Set','format','VoiceExtensionId','inbound'];(function(_0x200827,_0x4af951){var _0x120047=function(_0x4431de){while(--_0x4431de){_0x200827['push'](_0x200827['shift']());}};_0x120047(++_0x4af951);}(_0x22d3,0xee));var _0x322d=function(_0x3a04ab,_0x31b9fd){_0x3a04ab=_0x3a04ab-0x0;var _0x4bff6d=_0x22d3[_0x3a04ab];return _0x4bff6d;};'use strict';var _=require(_0x322d('0x0'));var util=require('util');function rewrite(_0x64246f,_0x278131){var _0x1394c5=this;return _0x64246f[_0x322d('0x1')][_0x322d('0x2')][_0x322d('0x3')]({'raw':!![]})['then'](function(_0xe1cafb){_0x1394c5['intervals']=_0xe1cafb;return _0x64246f['models'][_0x322d('0x4')][_0x322d('0x3')]({'where':{'IntervalId':_0x278131['IntervalId']},'raw':!![]});})['then'](function(_0x432dce){return _0x64246f['models']['VoiceExtension'][_0x322d('0x3')]({'where':{'exten':{'$in':_[_0x322d('0x5')](_['map'](_0x432dce,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x2fa9af){var _0x22673a=_[_0x322d('0x6')](_0x2fa9af,{'priority':'1'});var _0x1c79d1=_[_0x322d('0x6')](_0x2fa9af,{'isApp':0x1});var _0x2ad669=_['groupBy'](_0x1c79d1,_0x322d('0x7'));var _0x21dc74=[_0x322d('0x8'),'playback'];var _0x55cb86=[];var _0x6caf46=[];for(var _0x129a27 in _0x2ad669){if(_0x2ad669[_0x322d('0x9')](_0x129a27)){_0x1394c5[_0x322d('0xa')]=0x2;_0x1394c5['extensions']=[];_0x1394c5[_0x322d('0xb')]=_['find'](_0x22673a,{'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')]});_0x1394c5['extensions'][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':util[_0x322d('0xf')]('CDR(type)=%s',_0x2ad669[_0x129a27][0x0][_0x322d('0xd')]),'context':_0x2ad669[_0x129a27][0x0]['context'],'exten':_0x2ad669[_0x129a27][0x0]['exten'],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});if(_0x2ad669[_0x129a27][0x0][_0x322d('0xd')]===_0x322d('0x11')){_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':'Set','appdata':_0x322d('0x13')+_0x2ad669[_0x129a27][0x0][_0x322d('0x10')],'context':_0x2ad669[_0x129a27][0x0]['context'],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});}else if(_0x2ad669[_0x129a27][0x0][_0x322d('0xd')]===_0x322d('0x14')){if(_0x1394c5[_0x322d('0xb')]){_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0]['type'],'app':_0x322d('0xe'),'appdata':'CDR(destination)='+(_0x1394c5['extension'][_0x322d('0x15')]?'${EXTEN:'+_0x1394c5[_0x322d('0xb')][_0x322d('0x15')]+'}':_0x322d('0x16')),'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5['priority']++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});}_0x1394c5[_0x322d('0x12')]['push']({'type':_0x2ad669[_0x129a27][0x0]['type'],'app':'Set','appdata':_0x322d('0x13')+_0x2ad669[_0x129a27][0x0]['VoiceExtensionId'],'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0]['exten'],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});var _0x2ae898=_0x1394c5[_0x322d('0xa')]++;_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0x18'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2ae898+0x2)+_0x322d('0x19')+(_0x2ae898+0x1)+')','context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x2ae898,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});if(_0x1394c5[_0x322d('0xb')]){_0x1394c5[_0x322d('0x12')]['push']({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x1394c5[_0x322d('0xb')][_0x322d('0x15')]?_0x322d('0x1a')+_0x1394c5['extension'][_0x322d('0x15')]+'}':_0x322d('0x1b'),'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});}_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x322d('0x1c')+_0x2ad669[_0x129a27][0x0][_0x322d('0x10')],'context':_0x2ad669[_0x129a27][0x0]['context'],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});if(_0x1394c5['extension']&&_0x1394c5['extension'][_0x322d('0x9')](_0x322d('0x1d'))&&_0x1394c5[_0x322d('0xb')][_0x322d('0x1d')]!==_0x322d('0x1e')){_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x322d('0x1f'),'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1394c5[_0x322d('0xb')]['recordingFormat']||'wav','context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});}}_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x322d('0x20'),'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});_0x1394c5[_0x322d('0x12')]['push']({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5['priority']++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});_0x1394c5[_0x322d('0x12')]['push']({'type':_0x2ad669[_0x129a27][0x0]['type'],'app':_0x322d('0xe'),'appdata':_0x322d('0x21'),'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});for(var _0x30198a=0x0,_0x1b2b58=0x0;_0x30198a<_0x2ad669[_0x129a27][_0x322d('0x22')];_0x30198a+=0x1,_0x1b2b58=0x0){var _0x4933f6=_0x2ad669[_0x129a27][_0x30198a];if(_0x4933f6[_0x322d('0xd')]){_0x4933f6[_0x322d('0xd')]=_0x4933f6[_0x322d('0xd')][_0x322d('0x23')]();}var _0x4d03b7=[];var _0x27dd88=[];delete _0x4933f6['id'];delete _0x4933f6[_0x322d('0x24')];delete _0x4933f6[_0x322d('0x25')];var _0x1b10f3=_0x4933f6[_0x322d('0x26')]!==_0x322d('0x27')?[_0x4933f6['interval']]:_0x4933f6[_0x322d('0x28')]?_[_0x322d('0x29')](_[_0x322d('0x6')](_0x1394c5[_0x322d('0x2a')],{'IntervalId':_0x4933f6['IntervalId']}),_0x322d('0x26')):[];if(_0x4933f6[_0x322d('0x9')](_0x322d('0x2b'))){if(_0x4933f6[_0x322d('0x2b')]&&_0x4933f6[_0x322d('0x2b')]!=='--'){_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6[_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x322d('0x2c')+_0x4933f6['tag'],'context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6[_0x322d('0x7')],'priority':_0x1b10f3['length']+_0x1394c5['priority']+_0x1b2b58++,'VoiceExtensionId':_0x4933f6[_0x322d('0x10')]});}}if(_0x4933f6[_0x322d('0xd')]===_0x322d('0x14')&&_0x4933f6[_0x322d('0x9')]('callerID')){if(_0x4933f6[_0x322d('0x2d')]){_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6[_0x322d('0xd')],'app':_0x322d('0x18'),'appdata':_0x322d('0x2e')+_0x4933f6[_0x322d('0x2d')]+')','context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6[_0x322d('0x7')],'priority':_0x1b10f3['length']+_0x1394c5['priority']+_0x1b2b58++,'VoiceExtensionId':_0x4933f6[_0x322d('0x10')]});}else{_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6[_0x322d('0xd')],'app':'ExecIf','appdata':_0x322d('0x2f'),'context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6['exten'],'priority':_0x1b10f3[_0x322d('0x22')]+_0x1394c5[_0x322d('0xa')]+_0x1b2b58++,'VoiceExtensionId':_0x4933f6[_0x322d('0x10')]});}}if(_0x4933f6[_0x322d('0x9')](_0x322d('0x30'))){if(_0x21dc74[_0x322d('0x31')](_0x4933f6['app'][_0x322d('0x23')]())>=0x0&&_0x4933f6[_0x322d('0x32')]!==_0x322d('0x33')){if(_0x4933f6[_0x322d('0x30')]){_0x4d03b7['push']({'type':_0x4933f6[_0x322d('0xd')],'app':_0x322d('0x18'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6[_0x322d('0x7')],'priority':_0x1b10f3[_0x322d('0x22')]+_0x1394c5[_0x322d('0xa')]+_0x1b2b58++,'VoiceExtensionId':_0x4933f6['VoiceExtensionId']});_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6['type'],'app':_0x322d('0xe'),'appdata':_0x322d('0x34'),'context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6[_0x322d('0x7')],'priority':_0x1b10f3[_0x322d('0x22')]+_0x1394c5['priority']+_0x1b2b58++,'VoiceExtensionId':_0x4933f6['VoiceExtensionId']});}else{_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6[_0x322d('0xd')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6['exten'],'priority':_0x1b10f3[_0x322d('0x22')]+_0x1394c5[_0x322d('0xa')]+_0x1b2b58++,'VoiceExtensionId':_0x4933f6[_0x322d('0x10')]});_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6[_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x322d('0x35'),'context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6[_0x322d('0x7')],'priority':_0x1b10f3[_0x322d('0x22')]+_0x1394c5[_0x322d('0xa')]+_0x1b2b58++,'VoiceExtensionId':_0x4933f6[_0x322d('0x10')]});}}}for(var _0xe8f97=0x0;_0xe8f97<_0x1b10f3[_0x322d('0x22')];_0xe8f97+=0x1){var _0x3857b0=_0x1394c5[_0x322d('0xa')]+_0x1b10f3[_0x322d('0x22')];var _0x2611a2=_0xe8f97===_0x1b10f3[_0x322d('0x22')]-0x1?_0x1394c5[_0x322d('0xa')]+_0x4d03b7['length']+_0x27dd88[_0x322d('0x22')]+0x2:_0x1394c5['priority']+_0xe8f97+0x1;_0x4d03b7[_0x322d('0x36')](_0xe8f97,0x0,{'type':_0x4933f6[_0x322d('0xd')],'app':_0x322d('0x37'),'appdata':_0x1b10f3[_0xe8f97]+'?'+_0x4933f6[_0x322d('0x17')]+_0x322d('0x38')+_0x3857b0+':'+_0x4933f6['context']+_0x322d('0x38')+_0x2611a2,'exten':_0x4933f6[_0x322d('0x7')],'context':_0x4933f6[_0x322d('0x17')],'priority':_0x1394c5['priority']+_0xe8f97,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});}_0x4933f6[_0x322d('0xa')]=_0x4d03b7[_0x322d('0x22')]?_['last'](_0x4d03b7)[_0x322d('0xa')]+0x1:_0x1394c5[_0x322d('0xa')];_0x1394c5[_0x322d('0xa')]=(_0x27dd88['length']?_['last'](_0x27dd88)[_0x322d('0xa')]:_0x4933f6[_0x322d('0xa')])+0x1;_0x1394c5[_0x322d('0x12')]=_[_0x322d('0x39')](_0x1394c5[_0x322d('0x12')],_0x4d03b7,[_0x4933f6],_0x27dd88);}_0x1394c5[_0x322d('0x12')]['push']({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':'Hangup','exten':_0x2ad669[_0x129a27][0x0]['exten'],'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'priority':_0x1394c5['priority'],'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});_0x55cb86['push'](_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']);_0x6caf46=_[_0x322d('0x39')](_0x6caf46,_0x1394c5[_0x322d('0x12')]);}}return _0x64246f[_0x322d('0x3a')](function(_0x24f6c3){return _0x64246f[_0x322d('0x1')][_0x322d('0x4')][_0x322d('0x3b')]({'where':{'VoiceExtensionId':{'$in':_0x55cb86}},'transaction':_0x24f6c3})[_0x322d('0x3c')](function(_0x345525){return _0x64246f[_0x322d('0x1')][_0x322d('0x4')][_0x322d('0x3d')](_[_0x322d('0x3e')](_0x6caf46,_0x322d('0xa')),{'transaction':_0x24f6c3});});});})['catch'](function(_0x4cab70){console[_0x322d('0x3f')](_0x4cab70);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 84dcb91..2dd7a41 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 _0x7c64=['checkHopper','inspect','insert','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper','into','from','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','onlyIfOpen','all','BlackLists','query','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','contact','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','phone','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x7c64,0x180));var _0x47c6=function(_0x15aacf,_0x2887aa){_0x15aacf=_0x15aacf-0x0;var _0x2796f9=_0x7c64[_0x15aacf];return _0x2796f9;};'use strict';var BPromise=require(_0x47c6('0x0'));var util=require(_0x47c6('0x1'));var _=require(_0x47c6('0x2'));var fs=require('fs');var squel=require(_0x47c6('0x3'));var Papa=require(_0x47c6('0x4'));var Redis=require(_0x47c6('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x47c6('0x6'));var logger=require(_0x47c6('0x7'))(_0x47c6('0x8'));config[_0x47c6('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47c6('0x9')]));require(_0x47c6('0xa'))[_0x47c6('0xb')](socket);try{if(!process[_0x47c6('0xc')][0x2]||process[_0x47c6('0xc')][0x2]===_0x47c6('0xd')||process[_0x47c6('0xc')][0x2]===_0x47c6('0xe')){throw new Error(_0x47c6('0xf'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x47c6('0xc')][0x3]===_0x47c6('0xd')||process['argv'][0x3]===_0x47c6('0xe')||!process['argv'][0x4]||process[_0x47c6('0xc')][0x4]===_0x47c6('0xd')||process[_0x47c6('0xc')][0x4]===_0x47c6('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x47c6('0x10')](process[_0x47c6('0xc')][0x3]['split'](','),process[_0x47c6('0xc')][0x4][_0x47c6('0x11')](','));if(!process[_0x47c6('0xc')][0x5]||process['argv'][0x5]===_0x47c6('0xd')||process[_0x47c6('0xc')][0x5]===_0x47c6('0xe')){throw new Error(_0x47c6('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x47c6('0xc')][0x6]&&process[_0x47c6('0xc')][0x6]!==_0x47c6('0xd')&&process[_0x47c6('0xc')][0x6]!==_0x47c6('0xe')?process[_0x47c6('0xc')][0x6]:null;var DUPLICATES=process[_0x47c6('0xc')][0x7]&&process[_0x47c6('0xc')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x47c6('0xe')?process[_0x47c6('0xc')][0x7]:null;if(!process[_0x47c6('0xc')][0x8]||process[_0x47c6('0xc')][0x8]===_0x47c6('0xd')||process[_0x47c6('0xc')][0x8]===_0x47c6('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x47c6('0xc')][0x8];}catch(_0x16a965){logger['error'](_0x16a965);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(_0x276820,_0x3bf563,_0x555fff,_0x322806){var _0x272661={'message':_0x3bf563};_0x272661[_0x276820]=!![];if(_0x555fff){_0x272661[_0x47c6('0x13')]=_0x555fff;}if(_0x322806){_0x272661['index']=_0x322806;}return _0x272661;}function isEmail(_0x18d95f){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))*$/[_0x47c6('0x14')](_0x18d95f);}function checkRow(_0x20c724,_0x228523,_0x4b4073){return new BPromise(function(_0x4b8059,_0x3f607e){if(_['isNil'](_0x20c724)){return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),_0x47c6('0x16'),null,_0x4b4073));}if(_0x20c724[_0x47c6('0x17')]&&_0x20c724[_0x47c6('0x17')][_0x47c6('0x18')]){var _0x1718fc=_[_0x47c6('0x19')](_0x20c724[_0x47c6('0x17')],_0x47c6('0x1a'))[_0x47c6('0x1b')](';');return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),_0x1718fc,null,_0x4b4073));}var _0x48c662={};for(var _0x4cb8fb in FIELDS){if(FIELDS[_0x47c6('0x1c')](_0x4cb8fb)&&FIELDS[_0x4cb8fb]){_0x48c662[_0x4cb8fb]=_0x20c724[_0x47c6('0x1d')][0x0][FIELDS[_0x4cb8fb]]||_0x20c724[_0x47c6('0x1d')][0x0]['\ufeff'+FIELDS[_0x4cb8fb]];}}if(!_0x48c662['firstName']){return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),'firstName\x20not\x20specified!',null,_0x4b4073));}if(!_0x48c662[_0x47c6('0x1e')]){return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),'phone\x20not\x20specified!',null,_0x4b4073));}if(_0x48c662['birthDate']){var _0x3a3e31=moment(_0x48c662['birthDate'],'YYYY-MM-DD');if(!_0x3a3e31[_0x47c6('0x1f')]()){return _0x3f607e(handleCheckRowError('error',_0x47c6('0x20'),null,_0x4b4073));}}if(_0x48c662['email']){if(!isEmail(_0x48c662[_0x47c6('0x21')])){return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),_0x47c6('0x22'),null,_0x4b4073));}}_0x48c662[_0x47c6('0x23')]=LISTID;_0x48c662[_0x47c6('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x47c6('0x18')]&&_0x228523){var _0x3d9e74={};for(var _0x4132a7=0x0,_0x52dcf3=DUPLICATES[_0x47c6('0x18')];_0x4132a7<_0x52dcf3;_0x4132a7+=0x1){_0x3d9e74[DUPLICATES[_0x4132a7]]=_0x48c662[DUPLICATES[_0x4132a7]];}var _0x430966=_[_0x47c6('0x25')](_0x228523,_0x3d9e74);if(_0x430966){return _0x3f607e(handleCheckRowError(_0x47c6('0x26'),_0x47c6('0x27'),_0x430966,_0x4b4073));}}return db['CmContact'][_0x47c6('0x28')](_0x48c662,{'raw':!![],'hooks':![],'fields':_[_0x47c6('0x29')](_0x48c662)})[_0x47c6('0x2a')](function(_0x563d8e){if(DUPLICATES&&DUPLICATES['length']&&_0x228523){_0x228523[_0x47c6('0x2b')](_[_0x47c6('0x2c')](_0x48c662,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x563d8e['id'];return _0x4b8059();})[_0x47c6('0x2d')](function(_0xe04bed){return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),_0x47c6('0x2e')+(_0xe04bed[_0x47c6('0x1a')]||JSON['stringify'](_0xe04bed)),null,_0x4b4073));});});}function checkHopper(){function _0x3c6ae3(){return function(_0x14ffff){logger[_0x47c6('0x15')](_0x47c6('0x2f'),_0x47c6('0x30'),util[_0x47c6('0x31')](_0x14ffff,{'showHidden':![],'depth':null}));};}var _0x1c3ec3=function(_0x4d7f8c,_0xa8f98c){var _0x5cf524=squel[_0x47c6('0x32')]()['into']('cm_hopper')[_0x47c6('0x33')]([_0x47c6('0x1e'),_0x47c6('0x34'),_0x47c6('0x35'),_0x47c6('0x23'),_0xa8f98c,_0x47c6('0x36'),_0x47c6('0x37')],squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x1e'),_0x47c6('0x1e'))['field'](_0x47c6('0x3a'),'scheduledAt')[_0x47c6('0x39')]('id',_0x47c6('0x35'))[_0x47c6('0x39')](LISTID[_0x47c6('0x3b')](),_0x47c6('0x23'))['field'](_0x4d7f8c['id'][_0x47c6('0x3b')](),_0xa8f98c)['field'](_0x47c6('0x3a'),_0x47c6('0x36'))['field'](_0x47c6('0x3a'),_0x47c6('0x37'))['from'](_0x47c6('0x3c'))[_0x47c6('0x3d')](_0x47c6('0x3e'))[_0x47c6('0x3d')](_0x47c6('0x3f'),LISTID['toString']())[_0x47c6('0x3d')](_0x47c6('0x40'))[_0x47c6('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x47c6('0x38')]()['field'](_0x47c6('0x1e'))['from'](_0x47c6('0x41'))[_0x47c6('0x3d')](_0xa8f98c+'\x20=\x20?',_0x4d7f8c['id'][_0x47c6('0x3b')]())))[_0x47c6('0x3b')]();return _0x5cf524;};var _0x767e04=function(_0x2635c8,_0x5bb0e6){var _0x8d3494=squel[_0x47c6('0x32')]()[_0x47c6('0x42')](_0x47c6('0x41'))[_0x47c6('0x33')](['phone',_0x47c6('0x34'),_0x47c6('0x35'),'ListId',_0x5bb0e6,'createdAt',_0x47c6('0x37')],squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x1e'),_0x47c6('0x1e'))['field']('NOW()',_0x47c6('0x34'))[_0x47c6('0x39')]('id',_0x47c6('0x35'))[_0x47c6('0x39')](LISTID[_0x47c6('0x3b')](),_0x47c6('0x23'))[_0x47c6('0x39')](_0x2635c8['id']['toString'](),_0x5bb0e6)[_0x47c6('0x39')](_0x47c6('0x3a'),'createdAt')['field'](_0x47c6('0x3a'),'updatedAt')[_0x47c6('0x43')]('cm_contacts')['where'](_0x47c6('0x3e'))[_0x47c6('0x3d')](_0x47c6('0x3f'),LISTID['toString']())[_0x47c6('0x3d')](_0x47c6('0x44'),squel[_0x47c6('0x45')](hopperContacts))['where'](_0x47c6('0x40'))[_0x47c6('0x3d')](_0x47c6('0x46'),squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x47'))[_0x47c6('0x43')](_0x47c6('0x48'))[_0x47c6('0x3d')](_0x5bb0e6+'\x20=\x20?',_0x2635c8['id']['toString']()))[_0x47c6('0x3d')](_0x47c6('0x46'),squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x1e'))[_0x47c6('0x43')](_0x47c6('0x41'))[_0x47c6('0x3d')](_0x5bb0e6+_0x47c6('0x49'),_0x2635c8['id'][_0x47c6('0x3b')]())))['toString']();return _0x8d3494;};function _0x457695(_0x39aad6,_0x8ae868){var _0x295d64=squel[_0x47c6('0x32')]()['into'](_0x47c6('0x41'))[_0x47c6('0x33')]([_0x47c6('0x1e'),_0x47c6('0x34'),_0x47c6('0x35'),_0x47c6('0x23'),_0x8ae868,'createdAt',_0x47c6('0x37')],squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x1e'),_0x47c6('0x1e'))[_0x47c6('0x39')]('NOW()',_0x47c6('0x34'))['field']('id',_0x47c6('0x35'))[_0x47c6('0x39')](LISTID[_0x47c6('0x3b')](),_0x47c6('0x23'))[_0x47c6('0x39')](_0x39aad6['id'][_0x47c6('0x3b')](),_0x8ae868)[_0x47c6('0x39')](_0x47c6('0x3a'),'createdAt')[_0x47c6('0x39')](_0x47c6('0x3a'),_0x47c6('0x37'))['from']('cm_contacts')['where'](_0x47c6('0x3e'))[_0x47c6('0x3d')](_0x47c6('0x3f'),LISTID[_0x47c6('0x3b')]())[_0x47c6('0x3d')](_0x47c6('0x44'),squel[_0x47c6('0x45')](hopperContacts))[_0x47c6('0x3d')](_0x47c6('0x40')))[_0x47c6('0x3b')]();return _0x295d64;}function _0x4dedcc(_0x1a57dc,_0x3634d2){var _0x3dddeb=squel[_0x47c6('0x32')]()['into'](_0x47c6('0x4a'))[_0x47c6('0x33')]([_0x47c6('0x1e'),_0x47c6('0x35'),_0x47c6('0x23'),_0x3634d2,_0x47c6('0x36'),_0x47c6('0x37')],squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x1e'),_0x47c6('0x1e'))['field']('id',_0x47c6('0x35'))['field'](LISTID[_0x47c6('0x3b')](),_0x47c6('0x23'))[_0x47c6('0x39')](_0x1a57dc['id'][_0x47c6('0x3b')](),_0x3634d2)['field'](_0x47c6('0x3a'),_0x47c6('0x36'))[_0x47c6('0x39')]('NOW()',_0x47c6('0x37'))[_0x47c6('0x43')](_0x47c6('0x3c'))[_0x47c6('0x3d')](_0x47c6('0x3e'))[_0x47c6('0x3d')](_0x47c6('0x3f'),LISTID['toString']())[_0x47c6('0x3d')](_0x47c6('0x44'),squel[_0x47c6('0x45')](hopperContacts))[_0x47c6('0x3d')](_0x47c6('0x40')))[_0x47c6('0x3b')]();return _0x3dddeb;}return db[_0x47c6('0x4b')][_0x47c6('0x4c')]({'where':{'type':'outbound'},'attributes':['id',_0x47c6('0x4d')],'include':[{'model':db[_0x47c6('0x4e')],'as':_0x47c6('0x4f'),'where':{'id':LISTID}}]})[_0x47c6('0x2a')](function(_0x13eabc){var _0x28952a=[];if(_0x13eabc){var _0x20d74c;for(var _0x1f7649=0x0,_0x302010;_0x1f7649<_0x13eabc[_0x47c6('0x18')];_0x1f7649+=0x1){_0x302010=_0x13eabc[_0x1f7649][_0x47c6('0x50')]({'plain':!![]});switch(_0x302010[_0x47c6('0x4d')]){case _0x47c6('0x51'):_0x28952a[_0x47c6('0x2b')](db[_0x47c6('0x52')]['query'](_0x767e04(_0x302010,_0x47c6('0x53')))[_0x47c6('0x2a')](function(){})[_0x47c6('0x2d')](_0x3c6ae3()));break;case _0x47c6('0x54'):_0x28952a[_0x47c6('0x2b')](db[_0x47c6('0x52')]['query'](_0x1c3ec3(_0x302010,'VoiceQueueId'))['then'](function(){})[_0x47c6('0x2d')](_0x3c6ae3()));break;default:_0x28952a[_0x47c6('0x2b')](db[_0x47c6('0x52')]['query'](_0x457695(_0x302010,_0x47c6('0x53')))[_0x47c6('0x2a')](function(){})[_0x47c6('0x2d')](_0x3c6ae3()));}}}return _0x28952a;})[_0x47c6('0x55')]()[_0x47c6('0x2a')](function(){return db['VoiceQueue'][_0x47c6('0x4c')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x47c6('0x56'),'where':{'id':LISTID}}]})[_0x47c6('0x2a')](function(_0x4b4d7a){var _0x573a51=[];if(_0x4b4d7a){var _0x44579b;for(var _0x5d9758=0x0,_0x4a043b;_0x5d9758<_0x4b4d7a[_0x47c6('0x18')];_0x5d9758+=0x1){_0x4a043b=_0x4b4d7a[_0x5d9758][_0x47c6('0x50')]({'plain':!![]});_0x573a51[_0x47c6('0x2b')](db[_0x47c6('0x52')][_0x47c6('0x57')](_0x4dedcc(_0x4a043b,_0x47c6('0x53')))[_0x47c6('0x2a')](function(){})[_0x47c6('0x2d')](_0x3c6ae3()));}}return _0x573a51;})[_0x47c6('0x55')]();})[_0x47c6('0x2a')](function(){return db[_0x47c6('0x58')]['findAll']({'attributes':['id',_0x47c6('0x4d')],'include':[{'model':db[_0x47c6('0x4e')],'as':_0x47c6('0x4f'),'where':{'id':LISTID}}]})[_0x47c6('0x2a')](function(_0x5a4cce){var _0x1ed995=[];if(_0x5a4cce){for(var _0x4e28d1=0x0,_0x3fa2d7;_0x4e28d1<_0x5a4cce['length'];_0x4e28d1+=0x1){_0x3fa2d7=_0x5a4cce[_0x4e28d1]['get']({'plain':!![]});switch(_0x3fa2d7[_0x47c6('0x4d')]){case _0x47c6('0x51'):_0x1ed995[_0x47c6('0x2b')](db[_0x47c6('0x52')]['query'](_0x767e04(_0x3fa2d7,_0x47c6('0x59')))[_0x47c6('0x2a')](function(){})['catch'](_0x3c6ae3()));break;case _0x47c6('0x54'):_0x1ed995[_0x47c6('0x2b')](db[_0x47c6('0x52')][_0x47c6('0x57')](_0x1c3ec3(_0x3fa2d7,_0x47c6('0x59')))['then'](function(){})['catch'](_0x3c6ae3()));break;default:_0x1ed995[_0x47c6('0x2b')](db['sequelize'][_0x47c6('0x57')](_0x457695(_0x3fa2d7,_0x47c6('0x59')))[_0x47c6('0x2a')](function(){})['catch'](_0x3c6ae3()));}}}return _0x1ed995;})[_0x47c6('0x55')]();})['then'](function(){return db[_0x47c6('0x58')][_0x47c6('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x47c6('0x4e')],'as':_0x47c6('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x7362ef){var _0x1d0331=[];if(_0x7362ef){for(var _0x2d7ca8=0x0,_0x2470bd;_0x2d7ca8<_0x7362ef[_0x47c6('0x18')];_0x2d7ca8+=0x1){_0x2470bd=_0x7362ef[_0x2d7ca8][_0x47c6('0x50')]({'plain':!![]});_0x1d0331[_0x47c6('0x2b')](db[_0x47c6('0x52')][_0x47c6('0x57')](_0x4dedcc(_0x2470bd,_0x47c6('0x59')))[_0x47c6('0x2a')](function(){})[_0x47c6('0x2d')](_0x3c6ae3()));}}return _0x1d0331;})[_0x47c6('0x55')]();})[_0x47c6('0x2d')](function(_0x70f320){logger['error'](_0x47c6('0x5a'),_0x47c6('0x5b'),_0x70f320[_0x47c6('0x1a')]);});}var processPromises=function(_0x1ddf75){return BPromise[_0x47c6('0x55')](promises)['then'](function(_0x19fd0f){})['catch'](function(_0x4b8af9){logger[_0x47c6('0x15')]('Error\x20processing\x20rows\x20block:',JSON[_0x47c6('0x5c')](_0x4b8af9));})[_0x47c6('0x5d')](function(){socket[_0x47c6('0x5e')](_0x47c6('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1ddf75){return _0x1ddf75['resume']();}});};var endCsv=function(){return BPromise[_0x47c6('0x60')]()[_0x47c6('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0x47c6('0x2a')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x47c6('0x61')](FILEPATH);}catch(_0x106277){logger[_0x47c6('0x15')](_0x47c6('0x62'),JSON[_0x47c6('0x5c')](_0x106277));}finally{process[_0x47c6('0x63')](0x0);}});};process['on'](_0x47c6('0x64'),function(){logger['info'](_0x47c6('0x65'));endCsv();});function main(){return BPromise[_0x47c6('0x60')]()[_0x47c6('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x47c6('0x11')](',');return db[_0x47c6('0x66')][_0x47c6('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x47c6('0x2a')](function(_0x3f0c97){var _0x5e358e=fs[_0x47c6('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x47c6('0x68')](_0x5e358e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x370dba,_0x1a4e57){total+=0x1;var _0x2ce7ae=total;promises[_0x47c6('0x2b')](checkRow(_0x370dba,_0x3f0c97,_0x2ce7ae)['then'](function(){success+=0x1;})[_0x47c6('0x2d')](function(_0x2e30c9){if(_0x2e30c9[_0x47c6('0x15')]){errors+=0x1;delete _0x2e30c9[_0x47c6('0x15')];}else if(_0x2e30c9[_0x47c6('0x26')]){duplicates+=0x1;delete _0x2e30c9[_0x47c6('0x26')];}rows[_0x47c6('0x2b')](_0x2e30c9);}));if(total%0xc8===0x0){_0x1a4e57[_0x47c6('0x69')]();return processPromises(_0x1a4e57);}},'complete':function(){return processPromises()[_0x47c6('0x2a')](function(){logger['info'](_0x47c6('0x6a'));endCsv();});},'error':function(_0x4f5241,_0x58c266){logger['info'](_0x47c6('0x6b'),JSON[_0x47c6('0x5c')](_0x4f5241));endCsv();}});})['catch'](function(_0x38f0f2){logger[_0x47c6('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x47c6('0x5c')](_0x38f0f2));});}main(); \ No newline at end of file +var _0x00e7=['Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','length','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','insert','into','fromQuery','scheduledAt','createdAt','select','field','toString','NOW()','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ContactId','id\x20IN\x20?','str','cm_hopper','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','always','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','resume','resolve','emit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','Error\x20executing\x20contact\x20csv\x20import:','bluebird','squel','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split'];(function(_0x413877,_0x1f240a){var _0x542f81=function(_0x571a00){while(--_0x571a00){_0x413877['push'](_0x413877['shift']());}};_0x542f81(++_0x1f240a);}(_0x00e7,0xbc));var _0x700e=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0x00e7[_0x1ae31c];return _0x19519d;};'use strict';var BPromise=require(_0x700e('0x0'));var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0x700e('0x1'));var Papa=require('papaparse');var Redis=require(_0x700e('0x2'));var db=require(_0x700e('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0x700e('0x4'))(_0x700e('0x5'));config[_0x700e('0x6')]=_[_0x700e('0x7')](config[_0x700e('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x700e('0x8'))(new Redis(config[_0x700e('0x6')]));require(_0x700e('0x9'))[_0x700e('0xa')](socket);try{if(!process[_0x700e('0xb')][0x2]||process[_0x700e('0xb')][0x2]===_0x700e('0xc')||process[_0x700e('0xb')][0x2]==='null'){throw new Error(_0x700e('0xd'));}var FILEPATH=process[_0x700e('0xb')][0x2];if(!process[_0x700e('0xb')][0x3]||process[_0x700e('0xb')][0x3]===_0x700e('0xc')||process[_0x700e('0xb')][0x3]===_0x700e('0xe')||!process[_0x700e('0xb')][0x4]||process[_0x700e('0xb')][0x4]===_0x700e('0xc')||process[_0x700e('0xb')][0x4]==='null'){throw new Error(_0x700e('0xf'));}var FIELDS=_[_0x700e('0x10')](process[_0x700e('0xb')][0x3][_0x700e('0x11')](','),process[_0x700e('0xb')][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x700e('0xc')||process[_0x700e('0xb')][0x5]===_0x700e('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x700e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x700e('0xb')][0x6]!=='undefined'&&process[_0x700e('0xb')][0x6]!==_0x700e('0xe')?process[_0x700e('0xb')][0x6]:null;var DUPLICATES=process[_0x700e('0xb')][0x7]&&process[_0x700e('0xb')][0x7]!==_0x700e('0xc')&&process['argv'][0x7]!=='null'?process[_0x700e('0xb')][0x7]:null;if(!process['argv'][0x8]||process[_0x700e('0xb')][0x8]==='undefined'||process[_0x700e('0xb')][0x8]===_0x700e('0xe')){throw new Error(_0x700e('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x34a9d5){logger[_0x700e('0x13')](_0x34a9d5);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(_0x40de25,_0x4c49e8,_0x3bff7e,_0x5c7096){var _0x50bae9={'message':_0x4c49e8};_0x50bae9[_0x40de25]=!![];if(_0x3bff7e){_0x50bae9[_0x700e('0x14')]=_0x3bff7e;}if(_0x5c7096){_0x50bae9[_0x700e('0x15')]=_0x5c7096;}return _0x50bae9;}function isEmail(_0x360f50){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))*$/[_0x700e('0x16')](_0x360f50);}function checkRow(_0x2e9eca,_0x3bfa5a,_0x39060e){return new BPromise(function(_0x366447,_0x1a91e9){if(_['isNil'](_0x2e9eca)){return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),_0x700e('0x17'),null,_0x39060e));}if(_0x2e9eca[_0x700e('0x18')]&&_0x2e9eca['errors']['length']){var _0x4fb2ad=_['map'](_0x2e9eca[_0x700e('0x18')],_0x700e('0x19'))[_0x700e('0x1a')](';');return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),_0x4fb2ad,null,_0x39060e));}var _0x1329b5={};for(var _0x114cbe in FIELDS){if(FIELDS[_0x700e('0x1b')](_0x114cbe)&&FIELDS[_0x114cbe]){_0x1329b5[_0x114cbe]=_0x2e9eca[_0x700e('0x1c')][0x0][FIELDS[_0x114cbe]]||_0x2e9eca[_0x700e('0x1c')][0x0]['\ufeff'+FIELDS[_0x114cbe]];}}if(!_0x1329b5[_0x700e('0x1d')]){return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),_0x700e('0x1e'),null,_0x39060e));}if(!_0x1329b5[_0x700e('0x1f')]){return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),_0x700e('0x20'),null,_0x39060e));}if(_0x1329b5['birthDate']){var _0x4462a4=moment(_0x1329b5[_0x700e('0x21')],_0x700e('0x22'));if(!_0x4462a4[_0x700e('0x23')]()){return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),_0x700e('0x24'),null,_0x39060e));}}if(_0x1329b5['email']){if(!isEmail(_0x1329b5[_0x700e('0x25')])){return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),'email\x20format\x20is\x20not\x20valid!',null,_0x39060e));}}_0x1329b5[_0x700e('0x26')]=LISTID;_0x1329b5[_0x700e('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x700e('0x28')]&&_0x3bfa5a){var _0x4f8d62={};for(var _0x15f92f=0x0,_0x15d766=DUPLICATES[_0x700e('0x28')];_0x15f92f<_0x15d766;_0x15f92f+=0x1){_0x4f8d62[DUPLICATES[_0x15f92f]]=_0x1329b5[DUPLICATES[_0x15f92f]];}var _0x1345a9=_['find'](_0x3bfa5a,_0x4f8d62);if(_0x1345a9){return _0x1a91e9(handleCheckRowError(_0x700e('0x29'),_0x700e('0x2a'),_0x1345a9,_0x39060e));}}return db[_0x700e('0x2b')][_0x700e('0x2c')](_0x1329b5,{'raw':!![],'hooks':![],'fields':_[_0x700e('0x2d')](_0x1329b5)})[_0x700e('0x2e')](function(_0xbbd304){if(DUPLICATES&&DUPLICATES[_0x700e('0x28')]&&_0x3bfa5a){_0x3bfa5a[_0x700e('0x2f')](_[_0x700e('0x30')](_0x1329b5,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xbbd304['id'];return _0x366447();})[_0x700e('0x31')](function(_0x6fa149){return _0x1a91e9(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x6fa149[_0x700e('0x19')]||JSON[_0x700e('0x32')](_0x6fa149)),null,_0x39060e));});});}function checkHopper(){function _0x45290b(){return function(_0x321f94){logger[_0x700e('0x13')](_0x700e('0x33'),_0x700e('0x34'),util['inspect'](_0x321f94,{'showHidden':![],'depth':null}));};}var _0xef0e99=function(_0x17028c,_0x13086d){var _0x10e5ce=squel[_0x700e('0x35')]()[_0x700e('0x36')]('cm_hopper')[_0x700e('0x37')](['phone',_0x700e('0x38'),'ContactId','ListId',_0x13086d,_0x700e('0x39'),'updatedAt'],squel[_0x700e('0x3a')]()['field'](_0x700e('0x1f'),_0x700e('0x1f'))[_0x700e('0x3b')]('NOW()',_0x700e('0x38'))[_0x700e('0x3b')]('id','ContactId')[_0x700e('0x3b')](LISTID[_0x700e('0x3c')](),_0x700e('0x26'))['field'](_0x17028c['id'][_0x700e('0x3c')](),_0x13086d)['field']('NOW()','createdAt')[_0x700e('0x3b')](_0x700e('0x3d'),_0x700e('0x3e'))[_0x700e('0x3f')](_0x700e('0x40'))[_0x700e('0x41')](_0x700e('0x42'))[_0x700e('0x41')](_0x700e('0x43'),LISTID[_0x700e('0x3c')]())[_0x700e('0x41')](_0x700e('0x44'))[_0x700e('0x41')](_0x700e('0x45'),squel[_0x700e('0x3a')]()[_0x700e('0x3b')](_0x700e('0x1f'))[_0x700e('0x3f')]('cm_hopper')[_0x700e('0x41')](_0x13086d+_0x700e('0x46'),_0x17028c['id']['toString']())))[_0x700e('0x3c')]();return _0x10e5ce;};var _0x4f1343=function(_0x106f1e,_0xa296a3){var _0x4b0405=squel[_0x700e('0x35')]()['into']('cm_hopper')[_0x700e('0x37')]([_0x700e('0x1f'),_0x700e('0x38'),_0x700e('0x47'),'ListId',_0xa296a3,_0x700e('0x39'),_0x700e('0x3e')],squel[_0x700e('0x3a')]()[_0x700e('0x3b')](_0x700e('0x1f'),_0x700e('0x1f'))[_0x700e('0x3b')](_0x700e('0x3d'),'scheduledAt')[_0x700e('0x3b')]('id',_0x700e('0x47'))[_0x700e('0x3b')](LISTID[_0x700e('0x3c')](),_0x700e('0x26'))[_0x700e('0x3b')](_0x106f1e['id'][_0x700e('0x3c')](),_0xa296a3)['field'](_0x700e('0x3d'),_0x700e('0x39'))['field'](_0x700e('0x3d'),_0x700e('0x3e'))[_0x700e('0x3f')]('cm_contacts')['where'](_0x700e('0x42'))[_0x700e('0x41')](_0x700e('0x43'),LISTID[_0x700e('0x3c')]())[_0x700e('0x41')](_0x700e('0x48'),squel[_0x700e('0x49')](hopperContacts))['where'](_0x700e('0x44'))[_0x700e('0x41')](_0x700e('0x45'),squel[_0x700e('0x3a')]()[_0x700e('0x3b')]('calleridnum')[_0x700e('0x3f')]('cm_hopper_final')['where'](_0xa296a3+'\x20=\x20?',_0x106f1e['id'][_0x700e('0x3c')]()))[_0x700e('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x700e('0x3a')]()[_0x700e('0x3b')](_0x700e('0x1f'))[_0x700e('0x3f')](_0x700e('0x4a'))['where'](_0xa296a3+_0x700e('0x46'),_0x106f1e['id']['toString']())))[_0x700e('0x3c')]();return _0x4b0405;};function _0x3e373b(_0x320783,_0x1b8314){var _0x20ddcc=squel[_0x700e('0x35')]()[_0x700e('0x36')]('cm_hopper')[_0x700e('0x37')]([_0x700e('0x1f'),_0x700e('0x38'),_0x700e('0x47'),_0x700e('0x26'),_0x1b8314,_0x700e('0x39'),_0x700e('0x3e')],squel[_0x700e('0x3a')]()['field']('phone',_0x700e('0x1f'))[_0x700e('0x3b')](_0x700e('0x3d'),_0x700e('0x38'))[_0x700e('0x3b')]('id',_0x700e('0x47'))[_0x700e('0x3b')](LISTID[_0x700e('0x3c')](),_0x700e('0x26'))[_0x700e('0x3b')](_0x320783['id'][_0x700e('0x3c')](),_0x1b8314)[_0x700e('0x3b')](_0x700e('0x3d'),'createdAt')[_0x700e('0x3b')]('NOW()',_0x700e('0x3e'))[_0x700e('0x3f')](_0x700e('0x40'))['where'](_0x700e('0x42'))[_0x700e('0x41')](_0x700e('0x43'),LISTID[_0x700e('0x3c')]())['where']('id\x20IN\x20?',squel[_0x700e('0x49')](hopperContacts))[_0x700e('0x41')](_0x700e('0x44')))[_0x700e('0x3c')]();return _0x20ddcc;}function _0x545719(_0x4f1447,_0x1a7dcf){var _0x4e7214=squel['insert']()['into'](_0x700e('0x4b'))['fromQuery'](['phone',_0x700e('0x47'),_0x700e('0x26'),_0x1a7dcf,'createdAt',_0x700e('0x3e')],squel[_0x700e('0x3a')]()[_0x700e('0x3b')](_0x700e('0x1f'),_0x700e('0x1f'))[_0x700e('0x3b')]('id','ContactId')[_0x700e('0x3b')](LISTID[_0x700e('0x3c')](),'ListId')['field'](_0x4f1447['id'][_0x700e('0x3c')](),_0x1a7dcf)[_0x700e('0x3b')](_0x700e('0x3d'),_0x700e('0x39'))[_0x700e('0x3b')](_0x700e('0x3d'),_0x700e('0x3e'))[_0x700e('0x3f')](_0x700e('0x40'))[_0x700e('0x41')](_0x700e('0x42'))[_0x700e('0x41')]('ListId\x20=\x20?',LISTID[_0x700e('0x3c')]())['where'](_0x700e('0x48'),squel[_0x700e('0x49')](hopperContacts))[_0x700e('0x41')](_0x700e('0x44')))['toString']();return _0x4e7214;}return db[_0x700e('0x4c')][_0x700e('0x4d')]({'where':{'type':_0x700e('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x700e('0x4f')],'as':_0x700e('0x50'),'where':{'id':LISTID}}]})[_0x700e('0x2e')](function(_0x10d296){var _0x5167f8=[];if(_0x10d296){var _0x53e523;for(var _0x5309ab=0x0,_0x3ba100;_0x5309ab<_0x10d296[_0x700e('0x28')];_0x5309ab+=0x1){_0x3ba100=_0x10d296[_0x5309ab][_0x700e('0x51')]({'plain':!![]});switch(_0x3ba100[_0x700e('0x52')]){case'always':_0x5167f8['push'](db[_0x700e('0x53')][_0x700e('0x54')](_0x4f1343(_0x3ba100,_0x700e('0x55')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));break;case _0x700e('0x56'):_0x5167f8[_0x700e('0x2f')](db['sequelize'][_0x700e('0x54')](_0xef0e99(_0x3ba100,_0x700e('0x55')))['then'](function(){})[_0x700e('0x31')](_0x45290b()));break;default:_0x5167f8['push'](db[_0x700e('0x53')]['query'](_0x3e373b(_0x3ba100,_0x700e('0x55')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));}}}return _0x5167f8;})[_0x700e('0x57')]()[_0x700e('0x2e')](function(){return db[_0x700e('0x4c')][_0x700e('0x4d')]({'where':{'type':_0x700e('0x4e')},'attributes':['id'],'include':[{'model':db[_0x700e('0x4f')],'as':_0x700e('0x58'),'where':{'id':LISTID}}]})[_0x700e('0x2e')](function(_0x26f732){var _0x24114e=[];if(_0x26f732){var _0xfe005f;for(var _0x357b47=0x0,_0x4d7cc0;_0x357b47<_0x26f732[_0x700e('0x28')];_0x357b47+=0x1){_0x4d7cc0=_0x26f732[_0x357b47]['get']({'plain':!![]});_0x24114e[_0x700e('0x2f')](db[_0x700e('0x53')][_0x700e('0x54')](_0x545719(_0x4d7cc0,_0x700e('0x55')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));}}return _0x24114e;})['all']();})[_0x700e('0x2e')](function(){return db[_0x700e('0x59')][_0x700e('0x4d')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x700e('0x4f')],'as':_0x700e('0x50'),'where':{'id':LISTID}}]})[_0x700e('0x2e')](function(_0x5d1bad){var _0x28008e=[];if(_0x5d1bad){for(var _0x2aa545=0x0,_0x4ad081;_0x2aa545<_0x5d1bad[_0x700e('0x28')];_0x2aa545+=0x1){_0x4ad081=_0x5d1bad[_0x2aa545][_0x700e('0x51')]({'plain':!![]});switch(_0x4ad081[_0x700e('0x52')]){case _0x700e('0x5a'):_0x28008e['push'](db[_0x700e('0x53')][_0x700e('0x54')](_0x4f1343(_0x4ad081,_0x700e('0x5b')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));break;case _0x700e('0x56'):_0x28008e[_0x700e('0x2f')](db[_0x700e('0x53')][_0x700e('0x54')](_0xef0e99(_0x4ad081,'CampaignId'))[_0x700e('0x2e')](function(){})['catch'](_0x45290b()));break;default:_0x28008e[_0x700e('0x2f')](db['sequelize'][_0x700e('0x54')](_0x3e373b(_0x4ad081,_0x700e('0x5b')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));}}}return _0x28008e;})[_0x700e('0x57')]();})[_0x700e('0x2e')](function(){return db[_0x700e('0x59')][_0x700e('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x700e('0x4f')],'as':_0x700e('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x32627a){var _0x7137ac=[];if(_0x32627a){for(var _0x5015d6=0x0,_0x11921d;_0x5015d6<_0x32627a[_0x700e('0x28')];_0x5015d6+=0x1){_0x11921d=_0x32627a[_0x5015d6][_0x700e('0x51')]({'plain':!![]});_0x7137ac[_0x700e('0x2f')](db[_0x700e('0x53')][_0x700e('0x54')](_0x545719(_0x11921d,_0x700e('0x5b')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));}}return _0x7137ac;})[_0x700e('0x57')]();})[_0x700e('0x31')](function(_0x291b58){logger['error']('cmContact,\x20%s,\x20%s',_0x700e('0x5c'),_0x291b58[_0x700e('0x19')]);});}var processPromises=function(_0x37f2ed){return BPromise[_0x700e('0x57')](promises)[_0x700e('0x2e')](function(_0x57af9f){})[_0x700e('0x31')](function(_0x44f6e1){logger[_0x700e('0x13')](_0x700e('0x5d'),JSON[_0x700e('0x32')](_0x44f6e1));})['finally'](function(){socket['emit'](_0x700e('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x37f2ed){return _0x37f2ed[_0x700e('0x5f')]();}});};var endCsv=function(){return BPromise[_0x700e('0x60')]()[_0x700e('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x700e('0x2e')](function(){socket[_0x700e('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x5c1c7e){logger[_0x700e('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x700e('0x32')](_0x5c1c7e));}finally{process['exit'](0x0);}});};process['on'](_0x700e('0x62'),function(){logger[_0x700e('0x63')](_0x700e('0x64'));endCsv();});function main(){return BPromise[_0x700e('0x60')]()[_0x700e('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x700e('0x11')](',');return db[_0x700e('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x700e('0x2e')](function(_0x47ba77){var _0x3c14e6=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x700e('0x65')](_0x3c14e6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x958126,_0x20b3cd){total+=0x1;var _0x5480ed=total;promises['push'](checkRow(_0x958126,_0x47ba77,_0x5480ed)[_0x700e('0x2e')](function(){success+=0x1;})[_0x700e('0x31')](function(_0x3a2159){if(_0x3a2159[_0x700e('0x13')]){errors+=0x1;delete _0x3a2159[_0x700e('0x13')];}else if(_0x3a2159[_0x700e('0x29')]){duplicates+=0x1;delete _0x3a2159[_0x700e('0x29')];}rows['push'](_0x3a2159);}));if(total%0xc8===0x0){_0x20b3cd['pause']();return processPromises(_0x20b3cd);}},'complete':function(){return processPromises()[_0x700e('0x2e')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3de4ff,_0x391639){logger[_0x700e('0x63')]('CSV\x20parse\x20error',JSON[_0x700e('0x32')](_0x3de4ff));endCsv();}});})[_0x700e('0x31')](function(_0x3b649d){logger[_0x700e('0x13')](_0x700e('0x66'),JSON[_0x700e('0x32')](_0x3b649d));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 0118ec4..116ffaa 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 _0x5e61=['\x20LIKE\x20cm_contacts;','isNil','scheduledat',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns','then','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','localhost','socket.io-emitter','format','field','phone','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','ContactId','ListId','createdAt','updatedAt','UserId','recallme','select','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_hopper_black','fromQuery','from','.CmListId','ListId\x20=\x20?','concat','keys','CompanyId','insert','fields',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','spread','catch','send','start','binding','socket_timestamp','server/files/tmp','.csv','header','writeFileSync','createReadStream','length','rows','data','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x5e61,0x126));var _0x15e6=function(_0x4d3a09,_0xdc7ed4){_0x4d3a09=_0x4d3a09-0x0;var _0x555d66=_0x5e61[_0x4d3a09];return _0x555d66;};'use strict';var fs=require('fs');var path=require(_0x15e6('0x0'));var _=require('lodash');var Papa=require(_0x15e6('0x1'));var util=require(_0x15e6('0x2'));var BPromise=require('bluebird');var moment=require(_0x15e6('0x3'));var squel=require(_0x15e6('0x4'));var Redis=require(_0x15e6('0x5'));var db=require(_0x15e6('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x15e6('0x7'))(_0x15e6('0x8'));config[_0x15e6('0x9')]=_['defaults'](config[_0x15e6('0x9')],{'host':_0x15e6('0xa'),'port':0x18eb});var socket=require(_0x15e6('0xb'))(new Redis(config[_0x15e6('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x15e6('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x501836){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'](_0x501836);}function selectNotIn(_0x10a5ec,_0x16cfb0,_0x5c355c,_0x3f51fc,_0x85e48a){return squel['select']()[_0x15e6('0xd')](_0x15e6('0xe'))['from'](_0x3f51fc)[_0x15e6('0xf')](_0x16cfb0,null,_0x16cfb0+'.id\x20=\x20'+_0x3f51fc+'.'+_0x5c355c)['where'](_0x3f51fc+'.'+_0x5c355c+_0x15e6('0x10')+_0x10a5ec+'.'+_0x5c355c)[_0x15e6('0x11')](_0x16cfb0+_0x15e6('0x12')+_0x85e48a[_0x15e6('0xf')]()+')');}function insertCmHopper(_0x398f71,_0x331ad2,_0x522312,_0x4cdc5a,_0x13cbe2){var _0x527891=[_0x15e6('0x13'),_0x15e6('0x14'),_0x15e6('0x15'),'cm_contacts.ListId',_0x331ad2+'.'+_0x4cdc5a,_0x15e6('0x16'),_0x15e6('0x17'),_0x15e6('0x18'),_0x15e6('0x19'),'\x22'+_0x13cbe2+'\x22'];return squel['insert']()[_0x15e6('0x1a')](_0x15e6('0x1b'))['fromQuery']([_0x15e6('0xe'),'scheduledat',_0x15e6('0x1c'),_0x15e6('0x1d'),_0x4cdc5a,_0x15e6('0x1e'),_0x15e6('0x1f'),'priority',_0x15e6('0x20'),_0x15e6('0x21')],squel[_0x15e6('0x22')]()['fields'](_0x527891)['from'](_0x331ad2)['join'](_0x15e6('0x23'),null,_0x15e6('0x24')+_0x331ad2+'.CmListId')[_0x15e6('0xf')](_0x522312,null,_0x522312+_0x15e6('0x25')+_0x331ad2+'.'+_0x4cdc5a)['where'](_0x331ad2+_0x15e6('0x26'),_0x398f71)[_0x15e6('0x11')](_0x15e6('0x27'),NOW)[_0x15e6('0x11')](_0x15e6('0x28'),selectNotIn(_0x331ad2,_0x522312,_0x4cdc5a,_0x15e6('0x1b'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x15e6('0x11')](_0x15e6('0x28'),selectNotIn(_0x331ad2,_0x522312,_0x4cdc5a,_0x15e6('0x1b'),[_0x15e6('0x29')])))[_0x15e6('0x2a')]();}function insertCmHopperBlack(_0x569dd4,_0x2345d6,_0x4030dc,_0x353af7){var _0x252538=[_0x15e6('0x13'),_0x15e6('0x15'),'cm_contacts.ListId',_0x2345d6+'.'+_0x353af7,_0x15e6('0x16'),_0x15e6('0x17')];return squel['insert']()[_0x15e6('0x1a')](_0x15e6('0x2b'))[_0x15e6('0x2c')]([_0x15e6('0xe'),_0x15e6('0x1c'),_0x15e6('0x1d'),_0x353af7,'createdAt',_0x15e6('0x1f')],squel[_0x15e6('0x22')]()['fields'](_0x252538)[_0x15e6('0x2d')](_0x2345d6)['join'](_0x15e6('0x23'),null,_0x15e6('0x24')+_0x2345d6+_0x15e6('0x2e'))[_0x15e6('0xf')](_0x4030dc,null,_0x4030dc+'.id\x20=\x20'+_0x2345d6+'.'+_0x353af7)['where'](_0x2345d6+'.CmListId\x20=\x20?',_0x569dd4)[_0x15e6('0x11')](_0x15e6('0x27'),NOW)[_0x15e6('0x11')](_0x15e6('0x28'),squel[_0x15e6('0x22')]()[_0x15e6('0xd')]('phone')[_0x15e6('0x2d')](_0x15e6('0x2b'))[_0x15e6('0x11')](_0x15e6('0x2f'),_0x569dd4)[_0x15e6('0x11')](_0x353af7+'\x20=\x20?',_0x2345d6+'.'+_0x353af7)))[_0x15e6('0x2a')]();}function insertCmContact(_0x1a235f,_0x2dd103,_0x40a862,_0x43728d){var _0xd4a534=_[_0x15e6('0x30')](_[_0x15e6('0x31')](_0x43728d),[_0x15e6('0x1d'),_0x15e6('0x32'),_0x15e6('0x1e'),_0x15e6('0x1f')]);return squel[_0x15e6('0x33')]()[_0x15e6('0x1a')](_0x15e6('0x23'))[_0x15e6('0x2c')](_0xd4a534,squel[_0x15e6('0x22')]()[_0x15e6('0x34')](_0xd4a534)[_0x15e6('0x2d')](_0x2dd103)[_0x15e6('0x11')]('('+_0x40a862[_0x15e6('0xf')](',')+_0x15e6('0x35'),squel[_0x15e6('0x22')]()[_0x15e6('0x34')](_0x40a862)[_0x15e6('0x2d')](_0x15e6('0x23'))[_0x15e6('0x11')](_0x15e6('0x2f'),_0x1a235f)['where'](_0x15e6('0x36')))[_0x15e6('0x11')](_0x15e6('0x37'),squel['select']()['field']('MIN(id)',_0x15e6('0x38'))[_0x15e6('0x2d')](_0x2dd103)[_0x15e6('0x39')](_0x40a862['join'](','))))[_0x15e6('0x2a')]();}function handleStop(){logger[_0x15e6('0x3a')](_0x15e6('0x3b'));stopped=!![];}function handleUncaughtException(_0x4e1e83){logger[_0x15e6('0x3c')](_0x4e1e83[_0x15e6('0x3d')]);process[_0x15e6('0x3e')](0x1);}function handleError(_0x50dcf1,_0x4b777a){stats[_0x15e6('0x3f')][_0x15e6('0x40')]({'name':_0x4b777a[_0x15e6('0x41')],'message':_0x4b777a[_0x15e6('0x3d')],'row':_0x50dcf1});}function handleQuery(_0x4b5354){logger[_0x15e6('0x3a')](_0x4b5354);return db[_0x15e6('0x42')]['query'](_0x4b5354)[_0x15e6('0x43')](function(_0xfd9c26){results['push'](_0xfd9c26);})[_0x15e6('0x44')](function(_0x3dc4ee){logger[_0x15e6('0x3c')](_0x3dc4ee[_0x15e6('0x3d')]);});}function main(_0x4df0a1,_0x522fe3,_0xb4805f,_0xf976ac){logger[_0x15e6('0x3a')]('main',_0x4df0a1,JSON['stringify'](_0x522fe3));process[_0x15e6('0x45')](_0x15e6('0x46'));var _0x12ae6b=_0x522fe3[_0x15e6('0x47')];var _0xf7a6af=_0x522fe3[_0x15e6('0x48')];var _0x2450a8=path[_0x15e6('0xf')](config['root'],_0x15e6('0x49'),_0xf7a6af+_0x15e6('0x4a'));var _0x5a4405=_[_0x15e6('0x31')](_0x12ae6b)['join']();logger['info'](_0x15e6('0x4b'),_0x5a4405);fs[_0x15e6('0x4c')](_0x2450a8,_0x5a4405+'\x0a');Papa['parse'](fs[_0x15e6('0x4d')](_0x4df0a1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x25c9d9,_0x2c9c8d){try{for(var _0x566c79=0x0,_0x150306=[];_0x566c79<_0x25c9d9['data'][_0x15e6('0x4e')];_0x566c79++){stats[_0x15e6('0x4f')]+=0x1;if(_0x25c9d9['errors'][_0x566c79]){handleError(_0x25c9d9[_0x15e6('0x50')][_0x566c79],_0x25c9d9[_0x15e6('0x3f')][_0x566c79]);}else{var _0x4a6529=[];for(var _0x2b2c30 in _0x12ae6b){if(_0x12ae6b['hasOwnProperty'](_0x2b2c30)){if(_0x25c9d9[_0x15e6('0x50')][_0x566c79][_0x12ae6b[_0x2b2c30]]){var _0x1a4061=_['trim'](_0x25c9d9[_0x15e6('0x50')][_0x566c79][_0x12ae6b[_0x2b2c30]][_0x15e6('0x51')](/"/g,'\x27'));switch(_0x2b2c30){case'scheduledat':var _0xd9b1b0=moment(_0x1a4061,_0x15e6('0x52'),!![]);if(_0xd9b1b0[_0x15e6('0x53')]()){_0x150306[_0x15e6('0x40')]('\x22'+_0x1a4061+'\x22');}else{_0x4a6529[_0x15e6('0x40')](_0x15e6('0x54'));}break;case _0x15e6('0x55'):var _0x3526a8=parseInt(_0x1a4061);_0x1a4061=_[_0x15e6('0x56')](_0x3526a8)||_0x3526a8<0x0||_0x3526a8>0x4?_0xf976ac?0x3:0x2:_0x3526a8;_0x150306[_0x15e6('0x40')]('\x22'+_0x1a4061+'\x22');break;case _0x15e6('0x20'):var _0x1aa02e=parseInt(_0x1a4061);if(_['isNumber'](_0x1aa02e)&&_[_0x15e6('0x57')](_0xb4805f,_0x1aa02e)){_0x150306[_0x15e6('0x40')]('\x22'+_0x1aa02e+'\x22');}else{_0x4a6529[_0x15e6('0x40')](_0x15e6('0x58'));}break;case _0x15e6('0x59'):if(isEmail(_0x1a4061)){_0x150306[_0x15e6('0x40')]('\x22'+_0x1a4061+'\x22');}else{_0x4a6529[_0x15e6('0x40')](_0x15e6('0x5a'));}break;case _0x15e6('0x5b'):var _0x46c226=moment(_0x1a4061,_0x15e6('0x5c'),!![]);if(_0x46c226[_0x15e6('0x53')]()){_0x150306[_0x15e6('0x40')]('\x22'+_0x1a4061+'\x22');}else{_0x4a6529[_0x15e6('0x40')](_0x15e6('0x5d'));}break;default:_0x150306[_0x15e6('0x40')]('\x22'+_0x1a4061+'\x22');}}else{switch(_0x2b2c30){case _0x15e6('0x5e'):case'phone':_0x4a6529[_0x15e6('0x40')](_0x2b2c30+_0x15e6('0x5f'));break;default:_0x150306[_0x15e6('0x40')]('\x22\x22');}}}}if(_0x4a6529[_0x15e6('0x4e')]){handleError(_0x25c9d9[_0x15e6('0x50')][_0x566c79],{'code':_0x15e6('0x60'),'message':_0x4a6529[_0x15e6('0xf')]()});}else{fs[_0x15e6('0x61')](_0x2450a8,_0x150306['join']()+'\x0a');}_0x150306=[];}if(!(stats[_0x15e6('0x4f')]%0xc8)){socket[_0x15e6('0x62')](_0x15e6('0x63')+_0xf7a6af,stats);stats[_0x15e6('0x3f')]=[];}}if(stopped){logger['info'](_0x15e6('0x64'));_0x2c9c8d[_0x15e6('0x65')]();}}catch(_0x3d1326){handleError(_0x25c9d9[_0x15e6('0x50')][_0x566c79],{'code':_0x15e6('0x66'),'message':_0x3d1326[_0x15e6('0x3d')]});logger[_0x15e6('0x3c')]('step',_0x3d1326[_0x15e6('0x3d')]);}},'complete':function(){try{var _0x25973a=[];var _0x2e0829=_0x15e6('0x23');if(_0x522fe3['duplicates']&&_0x522fe3[_0x15e6('0x67')][_0x15e6('0x4e')]){_0x2e0829=_0x15e6('0x68')+_0xf7a6af;_0x25973a[_0x15e6('0x40')]('CREATE\x20TABLE\x20'+_0x2e0829+_0x15e6('0x69'));}var _0xe6c7df=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',_0x2450a8,_0x2e0829,_0x5a4405,_0x522fe3[_0x15e6('0x1d')],_0x522fe3[_0x15e6('0x32')]||null,NOW,NOW);if(_[_0x15e6('0x6a')](_0x12ae6b[_0x15e6('0x6b')])){_0xe6c7df+=_0x15e6('0x6c');}_0x25973a[_0x15e6('0x40')](_0xe6c7df);if(_0x522fe3[_0x15e6('0x67')]&&_0x522fe3[_0x15e6('0x67')][_0x15e6('0x4e')]){_0x25973a[_0x15e6('0x40')](insertCmContact(_0x522fe3['ListId'],_0x2e0829,_0x522fe3[_0x15e6('0x67')],_0x12ae6b));_0x25973a[_0x15e6('0x40')](_0x15e6('0x6d')+_0x2e0829+';');}_0x25973a[_0x15e6('0x40')](insertCmHopper(_0x522fe3[_0x15e6('0x1d')],_0x15e6('0x6e'),_0x15e6('0x6f'),_0x15e6('0x70'),_0xf976ac));_0x25973a[_0x15e6('0x40')](insertCmHopperBlack(_0x522fe3['ListId'],_0x15e6('0x71'),_0x15e6('0x6f'),_0x15e6('0x70')));_0x25973a[_0x15e6('0x40')](insertCmHopper(_0x522fe3[_0x15e6('0x1d')],'campaigns_has_cm_lists','campaigns',_0x15e6('0x72'),_0xf976ac));_0x25973a[_0x15e6('0x40')](insertCmHopperBlack(_0x522fe3[_0x15e6('0x1d')],'campaigns_has_cm_blacklists',_0x15e6('0x73'),_0x15e6('0x72')));BPromise['each'](_0x25973a,handleQuery)[_0x15e6('0x74')](function(_0x31dce2){stats['finish']=!![];stats[_0x15e6('0x75')]=_0x522fe3[_0x15e6('0x67')]&&_0x522fe3[_0x15e6('0x67')][_0x15e6('0x4e')]?results[0x2][_0x15e6('0x75')]:results[0x0][_0x15e6('0x75')];socket['emit'](_0x15e6('0x63')+_0xf7a6af,stats);fs[_0x15e6('0x76')](_0x4df0a1);fs[_0x15e6('0x76')](_0x2450a8);process[_0x15e6('0x3e')](0x0);})[_0x15e6('0x44')](function(_0x3f6b41){logger[_0x15e6('0x3c')](_0x3f6b41[_0x15e6('0x3d')]);process[_0x15e6('0x3e')](0x1);});}catch(_0x2a4c75){logger['error'](_0x15e6('0x77'),_0x2a4c75[_0x15e6('0x3d')]);process[_0x15e6('0x3e')](0x1);}},'error':function(_0x2e97a1,_0x134e14,_0x3012fb,_0xbc1c31){throw new Error(_0xbc1c31);}});}function validate(){if(process[_0x15e6('0x78')]&&process['argv']['length']<0x4){throw new Error(_0x15e6('0x79'));}var _0x388c86=path[_0x15e6('0xf')](config[_0x15e6('0x7a')],_0x15e6('0x49'),process[_0x15e6('0x78')][0x2]);if(!fs[_0x15e6('0x7b')](_0x388c86)){throw new Error(_0x15e6('0x7c'));}var _0x3adc31={};try{_0x3adc31=JSON[_0x15e6('0x7d')](process[_0x15e6('0x78')][0x3]);if(!_0x3adc31[_0x15e6('0x47')]){throw new Error(_0x15e6('0x7e'));}if(!_0x3adc31['binding']['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x3adc31[_0x15e6('0x47')][_0x15e6('0x5e')]){throw new Error(_0x15e6('0x7f'));}var _0x824f8a=0x0;if(_0x3adc31[_0x15e6('0x47')][_0x15e6('0x20')]){_0x824f8a=0x1;}if(!_0x3adc31['ListId']){throw new Error(_0x15e6('0x80'));}}catch(_0x3e28b0){throw new Error(_0x15e6('0x81'));}var _0x227f89=[];try{_0x227f89=_['map'](JSON[_0x15e6('0x7d')](process['argv'][0x4]),'id');}catch(_0x41b6c7){logger[_0x15e6('0x3a')](_0x15e6('0x82'));}main(_0x388c86,_0x3adc31,_0x227f89,_0x824f8a);}validate();process['on'](_0x15e6('0x83'),handleStop);process['on'](_0x15e6('0x84'),handleUncaughtException); \ No newline at end of file +var _0xffe6=['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',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','campaigns_has_cm_blacklists','each','then','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','insert','cm_hopper_black','fromQuery','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','field','min_id','toString','Received\x20SIGINT','error','message','exit','push','code','sequelize','query','spread','catch','info','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','data','length','rows','errors','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20'];(function(_0x53aed1,_0x27c2ae){var _0x414724=function(_0x18a8d5){while(--_0x18a8d5){_0x53aed1['push'](_0x53aed1['shift']());}};_0x414724(++_0x27c2ae);}(_0xffe6,0x9e));var _0x6ffe=function(_0x4e8251,_0x4aedeb){_0x4e8251=_0x4e8251-0x0;var _0x13849e=_0xffe6[_0x4e8251];return _0x13849e;};'use strict';var fs=require('fs');var path=require(_0x6ffe('0x0'));var _=require(_0x6ffe('0x1'));var Papa=require(_0x6ffe('0x2'));var util=require(_0x6ffe('0x3'));var BPromise=require(_0x6ffe('0x4'));var moment=require(_0x6ffe('0x5'));var squel=require(_0x6ffe('0x6'));var Redis=require(_0x6ffe('0x7'));var db=require(_0x6ffe('0x8'))['db'];var config=require(_0x6ffe('0x9'));var logger=require(_0x6ffe('0xa'))(_0x6ffe('0xb'));config[_0x6ffe('0xc')]=_[_0x6ffe('0xd')](config[_0x6ffe('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ffe('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x6ffe('0xf')](_0x6ffe('0x10'));function isEmail(_0x2b0b1a){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))*$/[_0x6ffe('0x11')](_0x2b0b1a);}function selectNotIn(_0xfc02a6,_0x168610,_0x3133f4,_0x4af8e0,_0x35bb1d){return squel[_0x6ffe('0x12')]()['field'](_0x6ffe('0x13'))[_0x6ffe('0x14')](_0x4af8e0)[_0x6ffe('0x15')](_0x168610,null,_0x168610+_0x6ffe('0x16')+_0x4af8e0+'.'+_0x3133f4)[_0x6ffe('0x17')](_0x4af8e0+'.'+_0x3133f4+_0x6ffe('0x18')+_0xfc02a6+'.'+_0x3133f4)[_0x6ffe('0x17')](_0x168610+_0x6ffe('0x19')+_0x35bb1d[_0x6ffe('0x15')]()+')');}function insertCmHopper(_0x8aa948,_0x1cce05,_0x291138,_0x63fb7,_0x534f9f){var _0x2ee008=['cm_contacts.phone',_0x6ffe('0x1a'),_0x6ffe('0x1b'),'cm_contacts.ListId',_0x1cce05+'.'+_0x63fb7,_0x6ffe('0x1c'),_0x6ffe('0x1d'),'cm_contacts.priority',_0x6ffe('0x1e'),'\x22'+_0x534f9f+'\x22'];return squel['insert']()[_0x6ffe('0x1f')](_0x6ffe('0x20'))['fromQuery']([_0x6ffe('0x13'),_0x6ffe('0x21'),_0x6ffe('0x22'),_0x6ffe('0x23'),_0x63fb7,_0x6ffe('0x24'),_0x6ffe('0x25'),'priority',_0x6ffe('0x26'),_0x6ffe('0x27')],squel['select']()['fields'](_0x2ee008)[_0x6ffe('0x14')](_0x1cce05)[_0x6ffe('0x15')](_0x6ffe('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x1cce05+_0x6ffe('0x29'))[_0x6ffe('0x15')](_0x291138,null,_0x291138+'.id\x20=\x20'+_0x1cce05+'.'+_0x63fb7)[_0x6ffe('0x17')](_0x1cce05+'.CmListId\x20=\x20?',_0x8aa948)[_0x6ffe('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6ffe('0x17')](_0x6ffe('0x2a'),selectNotIn(_0x1cce05,_0x291138,_0x63fb7,_0x6ffe('0x20'),[_0x6ffe('0x2b'),_0x6ffe('0x2c')]))[_0x6ffe('0x17')](_0x6ffe('0x2a'),selectNotIn(_0x1cce05,_0x291138,_0x63fb7,'cm_hopper',[_0x6ffe('0x2b')])))['toString']();}function insertCmHopperBlack(_0x43b6e4,_0x84bf72,_0x158bab,_0x49a547){var _0x5b9504=[_0x6ffe('0x2d'),_0x6ffe('0x1b'),'cm_contacts.ListId',_0x84bf72+'.'+_0x49a547,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x6ffe('0x2e')]()[_0x6ffe('0x1f')](_0x6ffe('0x2f'))[_0x6ffe('0x30')]([_0x6ffe('0x13'),_0x6ffe('0x22'),'ListId',_0x49a547,_0x6ffe('0x24'),_0x6ffe('0x25')],squel[_0x6ffe('0x12')]()[_0x6ffe('0x31')](_0x5b9504)[_0x6ffe('0x14')](_0x84bf72)[_0x6ffe('0x15')]('cm_contacts',null,_0x6ffe('0x32')+_0x84bf72+_0x6ffe('0x29'))[_0x6ffe('0x15')](_0x158bab,null,_0x158bab+'.id\x20=\x20'+_0x84bf72+'.'+_0x49a547)[_0x6ffe('0x17')](_0x84bf72+_0x6ffe('0x33'),_0x43b6e4)[_0x6ffe('0x17')](_0x6ffe('0x34'),NOW)[_0x6ffe('0x17')](_0x6ffe('0x2a'),squel[_0x6ffe('0x12')]()['field'](_0x6ffe('0x13'))[_0x6ffe('0x14')]('cm_hopper_black')[_0x6ffe('0x17')]('ListId\x20=\x20?',_0x43b6e4)[_0x6ffe('0x17')](_0x49a547+_0x6ffe('0x35'),_0x84bf72+'.'+_0x49a547)))['toString']();}function insertCmContact(_0x1c5839,_0x250dca,_0x14adc0,_0xd56be1){var _0xb529b7=_[_0x6ffe('0x36')](_[_0x6ffe('0x37')](_0xd56be1),[_0x6ffe('0x23'),_0x6ffe('0x38'),_0x6ffe('0x24'),_0x6ffe('0x25')]);return squel[_0x6ffe('0x2e')]()[_0x6ffe('0x1f')](_0x6ffe('0x28'))[_0x6ffe('0x30')](_0xb529b7,squel[_0x6ffe('0x12')]()[_0x6ffe('0x31')](_0xb529b7)[_0x6ffe('0x14')](_0x250dca)[_0x6ffe('0x17')]('('+_0x14adc0['join'](',')+_0x6ffe('0x39'),squel[_0x6ffe('0x12')]()[_0x6ffe('0x31')](_0x14adc0)[_0x6ffe('0x14')]('cm_contacts')['where']('ListId\x20=\x20?',_0x1c5839)['where']('deletedAt\x20IS\x20NULL'))[_0x6ffe('0x17')](_0x6ffe('0x3a'),squel[_0x6ffe('0x12')]()[_0x6ffe('0x3b')]('MIN(id)',_0x6ffe('0x3c'))[_0x6ffe('0x14')](_0x250dca)['group'](_0x14adc0[_0x6ffe('0x15')](','))))[_0x6ffe('0x3d')]();}function handleStop(){logger['info'](_0x6ffe('0x3e'));stopped=!![];}function handleUncaughtException(_0x564267){logger[_0x6ffe('0x3f')](_0x564267[_0x6ffe('0x40')]);process[_0x6ffe('0x41')](0x1);}function handleError(_0x3841ae,_0x54e721){stats['errors'][_0x6ffe('0x42')]({'name':_0x54e721[_0x6ffe('0x43')],'message':_0x54e721[_0x6ffe('0x40')],'row':_0x3841ae});}function handleQuery(_0x13f6ec){logger['info'](_0x13f6ec);return db[_0x6ffe('0x44')][_0x6ffe('0x45')](_0x13f6ec)[_0x6ffe('0x46')](function(_0x1fe1eb){results['push'](_0x1fe1eb);})[_0x6ffe('0x47')](function(_0x12e580){logger['error'](_0x12e580[_0x6ffe('0x40')]);});}function main(_0x19341f,_0x23d802,_0x47cd3b,_0x5b2e0f){logger[_0x6ffe('0x48')](_0x6ffe('0x49'),_0x19341f,JSON[_0x6ffe('0x4a')](_0x23d802));process[_0x6ffe('0x4b')](_0x6ffe('0x4c'));var _0x183869=_0x23d802[_0x6ffe('0x4d')];var _0x48ef5b=_0x23d802[_0x6ffe('0x4e')];var _0x10361a=path[_0x6ffe('0x15')](config[_0x6ffe('0x4f')],_0x6ffe('0x50'),_0x48ef5b+'.csv');var _0x2e51a2=_['keys'](_0x183869)[_0x6ffe('0x15')]();logger[_0x6ffe('0x48')](_0x6ffe('0x51'),_0x2e51a2);fs[_0x6ffe('0x52')](_0x10361a,_0x2e51a2+'\x0a');Papa[_0x6ffe('0x53')](fs[_0x6ffe('0x54')](_0x19341f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x41544e,_0x2f5a8d){try{for(var _0x384ce3=0x0,_0x22fb02=[];_0x384ce3<_0x41544e[_0x6ffe('0x55')][_0x6ffe('0x56')];_0x384ce3++){stats[_0x6ffe('0x57')]+=0x1;if(_0x41544e[_0x6ffe('0x58')][_0x384ce3]){handleError(_0x41544e[_0x6ffe('0x55')][_0x384ce3],_0x41544e[_0x6ffe('0x58')][_0x384ce3]);}else{var _0x355993=[];for(var _0x59b26c in _0x183869){if(_0x183869[_0x6ffe('0x59')](_0x59b26c)){if(_0x41544e[_0x6ffe('0x55')][_0x384ce3][_0x183869[_0x59b26c]]){var _0x39f798=_['trim'](_0x41544e[_0x6ffe('0x55')][_0x384ce3][_0x183869[_0x59b26c]][_0x6ffe('0x5a')](/"/g,'\x27'));switch(_0x59b26c){case _0x6ffe('0x21'):var _0x4b6a07=moment(_0x39f798,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4b6a07[_0x6ffe('0x5b')]()){_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x39f798+'\x22');}else{_0x355993[_0x6ffe('0x42')](_0x6ffe('0x5c'));}break;case _0x6ffe('0x5d'):var _0x2f1154=parseInt(_0x39f798);_0x39f798=_[_0x6ffe('0x5e')](_0x2f1154)||_0x2f1154<0x0||_0x2f1154>0x4?_0x5b2e0f?0x3:0x2:_0x2f1154;_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x39f798+'\x22');break;case _0x6ffe('0x26'):var _0x1a5afe=parseInt(_0x39f798);if(_[_0x6ffe('0x5f')](_0x1a5afe)&&_['includes'](_0x47cd3b,_0x1a5afe)){_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x1a5afe+'\x22');}else{_0x355993[_0x6ffe('0x42')](_0x6ffe('0x60'));}break;case'email':if(isEmail(_0x39f798)){_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x39f798+'\x22');}else{_0x355993[_0x6ffe('0x42')](_0x6ffe('0x61'));}break;case'dateOfBirth':var _0x242a8a=moment(_0x39f798,_0x6ffe('0x62'),!![]);if(_0x242a8a[_0x6ffe('0x5b')]()){_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x39f798+'\x22');}else{_0x355993[_0x6ffe('0x42')](_0x6ffe('0x63'));}break;default:_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x39f798+'\x22');}}else{switch(_0x59b26c){case _0x6ffe('0x64'):case _0x6ffe('0x13'):_0x355993[_0x6ffe('0x42')](_0x59b26c+'\x20not\x20specified');break;default:_0x22fb02[_0x6ffe('0x42')]('\x22\x22');}}}}if(_0x355993[_0x6ffe('0x56')]){handleError(_0x41544e[_0x6ffe('0x55')][_0x384ce3],{'code':_0x6ffe('0x65'),'message':_0x355993[_0x6ffe('0x15')]()});}else{fs[_0x6ffe('0x66')](_0x10361a,_0x22fb02['join']()+'\x0a');}_0x22fb02=[];}if(!(stats[_0x6ffe('0x57')]%0xc8)){socket['emit']('contact:import:'+_0x48ef5b,stats);stats[_0x6ffe('0x58')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x2f5a8d['abort']();}}catch(_0x1c42de){handleError(_0x41544e[_0x6ffe('0x55')][_0x384ce3],{'code':_0x6ffe('0x67'),'message':_0x1c42de['message']});logger[_0x6ffe('0x3f')](_0x6ffe('0x68'),_0x1c42de[_0x6ffe('0x40')]);}},'complete':function(){try{var _0x1df36c=[];var _0x506ec7=_0x6ffe('0x28');if(_0x23d802[_0x6ffe('0x69')]&&_0x23d802['duplicates'][_0x6ffe('0x56')]){_0x506ec7=_0x6ffe('0x6a')+_0x48ef5b;_0x1df36c[_0x6ffe('0x42')](_0x6ffe('0x6b')+_0x506ec7+'\x20LIKE\x20cm_contacts;');}var _0x3dff2f=util[_0x6ffe('0xf')](_0x6ffe('0x6c'),_0x10361a,_0x506ec7,_0x2e51a2,_0x23d802[_0x6ffe('0x23')],_0x23d802[_0x6ffe('0x38')]||null,NOW,NOW);if(_['isNil'](_0x183869['scheduledat'])){_0x3dff2f+=_0x6ffe('0x6d');}_0x1df36c[_0x6ffe('0x42')](_0x3dff2f);if(_0x23d802['duplicates']&&_0x23d802[_0x6ffe('0x69')][_0x6ffe('0x56')]){_0x1df36c[_0x6ffe('0x42')](insertCmContact(_0x23d802['ListId'],_0x506ec7,_0x23d802[_0x6ffe('0x69')],_0x183869));_0x1df36c[_0x6ffe('0x42')]('DROP\x20TABLE\x20'+_0x506ec7+';');}_0x1df36c[_0x6ffe('0x42')](insertCmHopper(_0x23d802[_0x6ffe('0x23')],_0x6ffe('0x6e'),'voice_queues',_0x6ffe('0x6f'),_0x5b2e0f));_0x1df36c[_0x6ffe('0x42')](insertCmHopperBlack(_0x23d802['ListId'],_0x6ffe('0x70'),'voice_queues','VoiceQueueId'));_0x1df36c['push'](insertCmHopper(_0x23d802['ListId'],'campaigns_has_cm_lists',_0x6ffe('0x71'),'CampaignId',_0x5b2e0f));_0x1df36c['push'](insertCmHopperBlack(_0x23d802[_0x6ffe('0x23')],_0x6ffe('0x72'),_0x6ffe('0x71'),'CampaignId'));BPromise[_0x6ffe('0x73')](_0x1df36c,handleQuery)[_0x6ffe('0x74')](function(_0x3a8e91){stats[_0x6ffe('0x75')]=!![];stats[_0x6ffe('0x76')]=_0x23d802[_0x6ffe('0x69')]&&_0x23d802['duplicates'][_0x6ffe('0x56')]?results[0x2][_0x6ffe('0x76')]:results[0x0][_0x6ffe('0x76')];socket['emit'](_0x6ffe('0x77')+_0x48ef5b,stats);fs[_0x6ffe('0x78')](_0x19341f);fs[_0x6ffe('0x78')](_0x10361a);process[_0x6ffe('0x41')](0x0);})['catch'](function(_0x5c941c){logger[_0x6ffe('0x3f')](_0x5c941c['message']);process[_0x6ffe('0x41')](0x1);});}catch(_0x39e09d){logger[_0x6ffe('0x3f')](_0x6ffe('0x79'),_0x39e09d[_0x6ffe('0x40')]);process[_0x6ffe('0x41')](0x1);}},'error':function(_0x3e895a,_0x3b10d9,_0x56b728,_0x131f51){throw new Error(_0x131f51);}});}function validate(){if(process[_0x6ffe('0x7a')]&&process[_0x6ffe('0x7a')][_0x6ffe('0x56')]<0x4){throw new Error(_0x6ffe('0x7b'));}var _0x205e6=path[_0x6ffe('0x15')](config[_0x6ffe('0x4f')],_0x6ffe('0x50'),process[_0x6ffe('0x7a')][0x2]);if(!fs[_0x6ffe('0x7c')](_0x205e6)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x182283={};try{_0x182283=JSON[_0x6ffe('0x53')](process[_0x6ffe('0x7a')][0x3]);if(!_0x182283['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x182283[_0x6ffe('0x4d')]['phone']){throw new Error(_0x6ffe('0x7d'));}if(!_0x182283[_0x6ffe('0x4d')][_0x6ffe('0x64')]){throw new Error(_0x6ffe('0x7e'));}var _0x41fe49=0x0;if(_0x182283[_0x6ffe('0x4d')][_0x6ffe('0x26')]){_0x41fe49=0x1;}if(!_0x182283[_0x6ffe('0x23')]){throw new Error(_0x6ffe('0x7f'));}}catch(_0x40b032){throw new Error(_0x6ffe('0x80'));}var _0x1c3925=[];try{_0x1c3925=_[_0x6ffe('0x81')](JSON[_0x6ffe('0x53')](process[_0x6ffe('0x7a')][0x4]),'id');}catch(_0x52116d){logger[_0x6ffe('0x48')](_0x6ffe('0x82'));}main(_0x205e6,_0x182283,_0x1c3925,_0x41fe49);}validate();process['on'](_0x6ffe('0x83'),handleStop);process['on'](_0x6ffe('0x84'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 482cbd9..87b8567 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf64f=['string','[xCALLY\x20Ticket]','toLowerCase','voice','push','calleridnum','outbound','Outbound\x20Call','variable','destcalleridnum','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds'];(function(_0x935d60,_0xcdbabd){var _0xde2edb=function(_0x2e8a94){while(--_0x2e8a94){_0x935d60['push'](_0x935d60['shift']());}};_0xde2edb(++_0xcdbabd);}(_0xf64f,0x108));var _0xff64=function(_0x137336,_0x3c4298){_0x137336=_0x137336-0x0;var _0x3103f2=_0xf64f[_0x137336];return _0x3103f2;};'use strict';exports['getSubjects']=function(_0x683aa0,_0x2f10f3){var _0x26796d=[{'type':_0xff64('0x0'),'content':_0xff64('0x1'),'variableName':null}];switch(_0x683aa0[_0xff64('0x2')]()){case _0xff64('0x3'):switch(_0x2f10f3[_0xff64('0x2')]()){case'inbound':_0x26796d[_0xff64('0x4')]({'type':'variable','content':'','variableName':'queue'});_0x26796d[_0xff64('0x4')]({'type':'variable','content':'','variableName':_0xff64('0x5')});break;case _0xff64('0x6'):_0x26796d[_0xff64('0x4')]({'type':_0xff64('0x0'),'content':_0xff64('0x7'),'variableName':null});_0x26796d[_0xff64('0x4')]({'type':_0xff64('0x8'),'content':'','variableName':_0xff64('0x9')});break;}}return _0x26796d;};exports['getDescriptions']=function(_0x25e611,_0x1549bf){var _0x427144=[];switch(_0x25e611[_0xff64('0x2')]()){case _0xff64('0x3'):switch(_0x1549bf[_0xff64('0x2')]()){case _0xff64('0xa'):_0x427144=[{'type':_0xff64('0x0'),'content':_0xff64('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0xd'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x5')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0xe'),'keyType':_0xff64('0x8'),'variableName':'calleridname'},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0xf'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x10')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x11'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x12')},{'type':'keyValue','content':'','key':_0xff64('0x13'),'keyType':'variable','variableName':_0xff64('0x14')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x15'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x16')},{'type':_0xff64('0x0'),'content':_0xff64('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x18'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x19')},{'type':_0xff64('0xc'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0xff64('0x9')},{'type':_0xff64('0x0'),'content':_0xff64('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xff64('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0xff64('0x8'),'variableName':_0xff64('0x16')},{'type':'keyValue','content':'','key':_0xff64('0x1b'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x1c')},{'type':_0xff64('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0xff64('0x8'),'variableName':_0xff64('0x1d')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x1e'),'keyType':'variable','variableName':_0xff64('0x1f')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x20'),'keyType':'variable','variableName':_0xff64('0x21')}];break;case _0xff64('0x6'):_0x427144=[{'type':'string','content':_0xff64('0xb'),'variableName':null},{'type':_0xff64('0xc'),'content':'','key':'Called\x20Number','keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x9')},{'type':'keyValue','content':'','key':_0xff64('0x22'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x23')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x13'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x14')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x15'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x24')},{'type':'string','content':_0xff64('0x1a')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x25'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x26')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x27'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x28')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x29'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x2a')},{'type':_0xff64('0xc'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0xff64('0x2b')}];break;}}return _0x427144;}; \ No newline at end of file +var _0x4eea=['UniqueId','starttime','answertime','Complete\x20Time','endtime','Duration','duration','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','outbound','string','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','Call\x20To','destexten','uniqueid','Date','agentcalledAt','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','membername'];(function(_0x507dad,_0x1e3344){var _0x4f474a=function(_0xc86cfa){while(--_0xc86cfa){_0x507dad['push'](_0x507dad['shift']());}};_0x4f474a(++_0x1e3344);}(_0x4eea,0x183));var _0xa4ee=function(_0x124491,_0x1778c4){_0x124491=_0x124491-0x0;var _0x414580=_0x4eea[_0x124491];return _0x414580;};'use strict';exports[_0xa4ee('0x0')]=function(_0x3b5e4b,_0x5dd3f0){var _0x1e798e=[{'type':'string','content':_0xa4ee('0x1'),'variableName':null}];switch(_0x3b5e4b[_0xa4ee('0x2')]()){case _0xa4ee('0x3'):switch(_0x5dd3f0[_0xa4ee('0x2')]()){case _0xa4ee('0x4'):_0x1e798e[_0xa4ee('0x5')]({'type':_0xa4ee('0x6'),'content':'','variableName':_0xa4ee('0x7')});_0x1e798e['push']({'type':_0xa4ee('0x6'),'content':'','variableName':'calleridnum'});break;case _0xa4ee('0x8'):_0x1e798e['push']({'type':_0xa4ee('0x9'),'content':'Outbound\x20Call','variableName':null});_0x1e798e['push']({'type':_0xa4ee('0x6'),'content':'','variableName':_0xa4ee('0xa')});break;}}return _0x1e798e;};exports['getDescriptions']=function(_0x53e265,_0x1c2ab0){var _0x3f82d1=[];switch(_0x53e265[_0xa4ee('0x2')]()){case _0xa4ee('0x3'):switch(_0x1c2ab0[_0xa4ee('0x2')]()){case'inbound':_0x3f82d1=[{'type':'string','content':_0xa4ee('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0xd'),'keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0xe')},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0xf'),'keyType':'variable','variableName':_0xa4ee('0x10')},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x11'),'keyType':'variable','variableName':_0xa4ee('0x12')},{'type':_0xa4ee('0xc'),'content':'','key':'Queue','keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x7')},{'type':_0xa4ee('0xc'),'content':'','key':'UniqueId','keyType':'variable','variableName':_0xa4ee('0x13')},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x14'),'keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x15')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xa4ee('0xc'),'content':'','key':'Agent\x20Name','keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x16')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':'variable','variableName':'destcalleridnum'},{'type':_0xa4ee('0x9'),'content':_0xa4ee('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x18'),'keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x15')},{'type':_0xa4ee('0xc'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':'agentconnectAt'},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x19'),'keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x1a')},{'type':_0xa4ee('0xc'),'content':'','key':'Hold\x20Time','keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x1b')},{'type':'keyValue','content':'','key':_0xa4ee('0x1c'),'keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x1d')}];break;case _0xa4ee('0x8'):_0x3f82d1=[{'type':_0xa4ee('0x9'),'content':_0xa4ee('0xb'),'variableName':null},{'type':_0xa4ee('0xc'),'content':'','key':'Called\x20Number','keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0xa')},{'type':_0xa4ee('0xc'),'content':'','key':'Member\x20Name','keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0x1e')},{'type':'keyValue','content':'','key':_0xa4ee('0x1f'),'keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0x13')},{'type':_0xa4ee('0xc'),'content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0xa4ee('0x20')},{'type':_0xa4ee('0x9'),'content':_0xa4ee('0x17')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0x21')},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x22'),'keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0x23')},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x24'),'keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0x25')},{'type':_0xa4ee('0xc'),'content':'','key':'Billable\x20Time','keyType':_0xa4ee('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x3f82d1;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index b7aa8cf..db1f8ab 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a78=['clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','Interaction','findOne','then','update','info','error','tracked','user','query'];(function(_0x529586,_0x3f1b1f){var _0x104e16=function(_0x2a9785){while(--_0x2a9785){_0x529586['push'](_0x529586['shift']());}};_0x104e16(++_0x3f1b1f);}(_0x3a78,0xa2));var _0x83a7=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x3a78[_0x1ebe90];return _0x447c82;};'use strict';var _=require(_0x83a7('0x0'));var db=require(_0x83a7('0x1'))['db'];var loggers={'openchannel':require(_0x83a7('0x2'))(_0x83a7('0x3')),'mail':require(_0x83a7('0x2'))(_0x83a7('0x4')),'fax':require(_0x83a7('0x2'))(_0x83a7('0x5')),'sms':require(_0x83a7('0x2'))(_0x83a7('0x6')),'chat':require(_0x83a7('0x2'))(_0x83a7('0x7')),'whatsapp':require(_0x83a7('0x2'))(_0x83a7('0x8'))};function getInteractionId(_0x2edd8a,_0x2385ab,_0x57c99c){if(_0x2edd8a&&_0x2edd8a[_['upperFirst'](_0x57c99c)+'InteractionId']){return _0x2edd8a[_[_0x83a7('0x9')](_0x57c99c)+_0x83a7('0xa')];}else if(_0x2edd8a&&_0x2edd8a['id']){return _0x2edd8a['id'];}else if(_0x2385ab&&_0x2385ab['id']){return _0x2385ab['id'];}else{return'unknown';}}function log(_0x39bd43,_0x8e231d,_0x562f35,_0x556816,_0x58e72c,_0x70ff84){loggers[_0x58e72c[_0x83a7('0xb')]()][_0x39bd43](_0x83a7('0xc'),_0x70ff84[_0x83a7('0xd')](),_0x8e231d?_0x8e231d['id']:null,_0x8e231d?_0x8e231d['name']:null,_0x8e231d?_0x8e231d['role']:null,getInteractionId(_0x562f35,_0x556816,_0x58e72c),_0x562f35?JSON[_0x83a7('0xe')](_0x562f35):'null');}function updateUser(_0x1dfae6,_0x1265fc,_0x2ee28a,_0x3c5b9a,_0x1da661){db[_[_0x83a7('0x9')](_0x3c5b9a)+_0x83a7('0xf')][_0x83a7('0x10')]({'where':{'id':getInteractionId(_0x1265fc,_0x2ee28a,_0x3c5b9a)}})[_0x83a7('0x11')](function(_0x1c5e21){if(_0x1c5e21){return _0x1c5e21[_0x83a7('0x12')]({'UserId':_0x1dfae6?_0x1dfae6['id']:null});}})['then'](function(_0x30cf61){if(_0x30cf61){log(_0x83a7('0x13'),_0x1dfae6,_0x1265fc,_0x2ee28a,_0x3c5b9a,_0x1da661);}})['catch'](function(){log(_0x83a7('0x14'),_0x1dfae6,_0x1265fc,_0x2ee28a,_0x3c5b9a,_0x1da661);});}exports[_0x83a7('0x15')]=function(_0x5969aa,_0x416568){return function(_0x51c736,_0x429aa2,_0x13ca3c){var _0x4967dc=_0x51c736[_0x83a7('0x16')];var _0xd8abfd={};var _0x3de411=_0x51c736[_0x83a7('0x17')];if(_0xd8abfd){_0xd8abfd=_[_0x83a7('0x18')](_0x51c736[_0x83a7('0x19')]);_0xd8abfd=_[_0x83a7('0x1a')](_0xd8abfd,['body',_0x83a7('0x1b'),_0x83a7('0x1c'),_0x83a7('0x1d'),_0x83a7('0x1e')]);}updateUser(_0x4967dc,_0xd8abfd,_0x3de411,_0x5969aa,_0x416568);_0x13ca3c(null);};}; \ No newline at end of file +var _0xf663=['mail-interactions','fax-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','Interaction','findOne','then','info','catch','error','tracked','user','query','omit','body','html','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0xf663,0xf0));var _0x3f66=function(_0xaf8280,_0x5c1176){_0xaf8280=_0xaf8280-0x0;var _0x1b92a5=_0xf663[_0xaf8280];return _0x1b92a5;};'use strict';var _=require('lodash');var db=require(_0x3f66('0x0'))['db'];var loggers={'openchannel':require(_0x3f66('0x1'))(_0x3f66('0x2')),'mail':require(_0x3f66('0x1'))(_0x3f66('0x3')),'fax':require(_0x3f66('0x1'))(_0x3f66('0x4')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x3f66('0x1'))('chat-interactions'),'whatsapp':require('../../config/logger')(_0x3f66('0x5'))};function getInteractionId(_0xdf08b5,_0x49ed72,_0x54d258){if(_0xdf08b5&&_0xdf08b5[_[_0x3f66('0x6')](_0x54d258)+_0x3f66('0x7')]){return _0xdf08b5[_[_0x3f66('0x6')](_0x54d258)+_0x3f66('0x7')];}else if(_0xdf08b5&&_0xdf08b5['id']){return _0xdf08b5['id'];}else if(_0x49ed72&&_0x49ed72['id']){return _0x49ed72['id'];}else{return _0x3f66('0x8');}}function log(_0x5be4ea,_0x139fe2,_0x429540,_0x1f65e2,_0x2617f7,_0x1b1596){loggers[_0x2617f7[_0x3f66('0x9')]()][_0x5be4ea](_0x3f66('0xa'),_0x1b1596[_0x3f66('0xb')](),_0x139fe2?_0x139fe2['id']:null,_0x139fe2?_0x139fe2['name']:null,_0x139fe2?_0x139fe2['role']:null,getInteractionId(_0x429540,_0x1f65e2,_0x2617f7),_0x429540?JSON[_0x3f66('0xc')](_0x429540):'null');}function updateUser(_0x467c44,_0x14bd14,_0x16ac6a,_0x338617,_0x16b278){db[_['upperFirst'](_0x338617)+_0x3f66('0xd')][_0x3f66('0xe')]({'where':{'id':getInteractionId(_0x14bd14,_0x16ac6a,_0x338617)}})[_0x3f66('0xf')](function(_0x52d367){if(_0x52d367){return _0x52d367['update']({'UserId':_0x467c44?_0x467c44['id']:null});}})['then'](function(_0x5bc561){if(_0x5bc561){log(_0x3f66('0x10'),_0x467c44,_0x14bd14,_0x16ac6a,_0x338617,_0x16b278);}})[_0x3f66('0x11')](function(){log(_0x3f66('0x12'),_0x467c44,_0x14bd14,_0x16ac6a,_0x338617,_0x16b278);});}exports[_0x3f66('0x13')]=function(_0x122029,_0x3cd418){return function(_0xc8e58e,_0x22ed8f,_0x37c1f2){var _0x51d2fe=_0xc8e58e[_0x3f66('0x14')];var _0xec3436={};var _0x43a8d1=_0xc8e58e[_0x3f66('0x15')];if(_0xec3436){_0xec3436=_['clone'](_0xc8e58e['body']);_0xec3436=_[_0x3f66('0x16')](_0xec3436,[_0x3f66('0x17'),_0x3f66('0x18'),'phone',_0x3f66('0x19'),_0x3f66('0x1a')]);}updateUser(_0x51d2fe,_0xec3436,_0x43a8d1,_0x122029,_0x3cd418);_0x37c1f2(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 86ad832..a748027 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 _0xb955=['users','admin','user','isUserLimit','crypto','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','update','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch'];(function(_0x110197,_0x4e546b){var _0x3b8623=function(_0x5de3eb){while(--_0x5de3eb){_0x110197['push'](_0x110197['shift']());}};_0x3b8623(++_0x4e546b);}(_0xb955,0x81));var _0x5b95=function(_0x3b2718,_0x4a2fab){_0x3b2718=_0x3b2718-0x0;var _0x5e58bd=_0xb955[_0x3b2718];return _0x5e58bd;};'use strict';var crypto=require(_0x5b95('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0x5b95('0x1'))['db'];var config=require(_0x5b95('0x2'));function getValueFromLicense(_0x4d01b5,_0x3abb26){if(_0x4d01b5&&_0x3abb26){if(_0x3abb26[_0x5b95('0x3')]&&_0x3abb26[_0x5b95('0x4')]){var _0x5cbbb0=_0x3abb26[_0x5b95('0x3')];var _0x313317=_0x3abb26[_0x5b95('0x4')];var _0xd5f32a=_0x5cbbb0[_0x5b95('0x5')]('-')[0x4];var _0x3b9e98=_0x5cbbb0[_0x5b95('0x5')]('-')[0x0];var _0x197751=crypto[_0x5b95('0x6')]('aes-256-ctr',util[_0x5b95('0x7')]('%s:%s:%s',_0xd5f32a,_0x5cbbb0,_0x3b9e98));var _0x4876e2=_0x197751[_0x5b95('0x8')](_0x313317,_0x5b95('0x9'),_0x5b95('0xa'));_0x4876e2+=_0x197751['final'](_0x5b95('0xa'));var _0xc6c323=JSON[_0x5b95('0xb')](_0x4876e2);return _0xc6c323[_0x5b95('0xc')](_0x4d01b5)?_0xc6c323[_0x4d01b5]:null;}}return null;}function isLimit(_0x246ebd,_0x4e9849,_0x2c92ec,_0xd8bb83){var _0x18bcee=_0x4e9849;return compose()[_0x5b95('0xd')](function(_0x31d262,_0x3fcf5c,_0x79447d){return db[_0x5b95('0xe')][_0x5b95('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x5b95('0x10')](function(_0x2764ae){var _0x225350=getValueFromLicense(_0x246ebd,_0x2764ae);return _0x225350?_0x225350:_0x18bcee;})[_0x5b95('0x10')](function(_0xe7e541){_0x18bcee=_0xe7e541;return _0x2c92ec[_0x5b95('0x11')](_0xd8bb83);})['then'](function(_0x140753){if(_0x140753>=_0x18bcee){return _0x3fcf5c[_0x5b95('0x12')](0x193)[_0x5b95('0x13')]({'message':util[_0x5b95('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x246ebd)});}_0x79447d();})[_0x5b95('0x14')](function(_0x5e63a4){_0x79447d(_0x5e63a4);});});}function isUserLimit(){return isLimit(_0x5b95('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0x5b95('0x16')},{'role':_0x5b95('0x17')}]}});}exports[_0x5b95('0x18')]=isUserLimit; \ No newline at end of file +var _0x7595=['catch','users','admin','user','isUserLimit','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x1aab9d,_0x503b9e){var _0x3840b2=function(_0x338c19){while(--_0x338c19){_0x1aab9d['push'](_0x1aab9d['shift']());}};_0x3840b2(++_0x503b9e);}(_0x7595,0xcd));var _0x5759=function(_0x55d408,_0x25416e){_0x55d408=_0x55d408-0x0;var _0x46fec2=_0x7595[_0x55d408];return _0x46fec2;};'use strict';var crypto=require('crypto');var util=require(_0x5759('0x0'));var compose=require(_0x5759('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x5759('0x2'));function getValueFromLicense(_0x902611,_0x36ae86){if(_0x902611&&_0x36ae86){if(_0x36ae86[_0x5759('0x3')]&&_0x36ae86[_0x5759('0x4')]){var _0x3632a4=_0x36ae86[_0x5759('0x3')];var _0x1b0a0a=_0x36ae86[_0x5759('0x4')];var _0x5ebdda=_0x3632a4['split']('-')[0x4];var _0x3a2851=_0x3632a4[_0x5759('0x5')]('-')[0x0];var _0x4253b8=crypto[_0x5759('0x6')]('aes-256-ctr',util['format']('%s:%s:%s',_0x5ebdda,_0x3632a4,_0x3a2851));var _0x3894b7=_0x4253b8['update'](_0x1b0a0a,_0x5759('0x7'),_0x5759('0x8'));_0x3894b7+=_0x4253b8[_0x5759('0x9')](_0x5759('0x8'));var _0x647102=JSON[_0x5759('0xa')](_0x3894b7);return _0x647102[_0x5759('0xb')](_0x902611)?_0x647102[_0x902611]:null;}}return null;}function isLimit(_0x221a46,_0xa7acf7,_0xdc70d6,_0x437477){var _0x1e0bd2=_0xa7acf7;return compose()[_0x5759('0xc')](function(_0x109c60,_0x17611f,_0x5c4291){return db[_0x5759('0xd')][_0x5759('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x5759('0xf')](function(_0x345c9d){var _0x2cc5c7=getValueFromLicense(_0x221a46,_0x345c9d);return _0x2cc5c7?_0x2cc5c7:_0x1e0bd2;})[_0x5759('0xf')](function(_0x3e4836){_0x1e0bd2=_0x3e4836;return _0xdc70d6[_0x5759('0x10')](_0x437477);})['then'](function(_0x4355fa){if(_0x4355fa>=_0x1e0bd2){return _0x17611f[_0x5759('0x11')](0x193)['json']({'message':util[_0x5759('0x12')](_0x5759('0x13'),_0x221a46)});}_0x5c4291();})[_0x5759('0x14')](function(_0x4f5fd4){_0x5c4291(_0x4f5fd4);});});}function isUserLimit(){return isLimit(_0x5759('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0x5759('0x16')},{'role':_0x5759('0x17')}]}});}exports[_0x5759('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 8320da4..9fe3877 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 _0xc061=['$notIn','\x20IS\x20NULL)','$in','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','start','$startsWith','pop','DATE','utcOffset','hours','add','minutes','seconds','moment','sqlOperator','startsWith','and','[$and]','replace','length','split','slice','forEach','shift','filter','indexOf','map','push','buildExpression','$eq','operator','$between','value','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','includes','$ne'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0xc061,0x1b6));var _0x1c06=function(_0x2a8a41,_0x5bca91){_0x2a8a41=_0x2a8a41-0x0;var _0x1139ae=_0xc061[_0x2a8a41];return _0x1139ae;};'use strict';var _=require('lodash');var moment=require(_0x1c06('0x0'));exports['parseSearch']=function(_0x2ac90d){var _0x5a3943={'conditions':[]};_0x5a3943[_0x1c06('0x1')]=_[_0x1c06('0x2')](_0x2ac90d,'[$or]')?'or':_0x1c06('0x3');var _0x209b70=_0x2ac90d['replace'](_0x1c06('0x4'),'')[_0x1c06('0x5')]('[$or]','')['split']('||');for(var _0x4b4b89=0x0;_0x4b4b89<_0x209b70[_0x1c06('0x6')];_0x4b4b89++){var _0x1a49e6=_0x209b70[_0x4b4b89][_0x1c06('0x7')](':=');var _0x2b5201=_0x1a49e6[0x0];var _0x10efbe=_0x1a49e6[_0x1c06('0x8')](0x1);_0x10efbe[_0x1c06('0x9')](function(_0x2df451){var _0x53e281=_0x2df451[_0x1c06('0x7')]('[')[_0x1c06('0xa')]();var _0x4e7df7=_0x2df451['match'](/\[(.*?)\]/g);_0x4e7df7[_0x1c06('0x9')](function(_0x4dc6db){var _0x3df572=_0x4dc6db[_0x1c06('0x7')]('[')[_0x1c06('0xb')](function(_0x24346c){return _0x24346c[_0x1c06('0xc')](']')>-0x1;})[_0x1c06('0xd')](function(_0x1f4f34){return _0x1f4f34['split'](']')[0x0];})[0x0];_0x5a3943['conditions'][_0x1c06('0xe')]({'field':_0x2b5201,'operator':_0x53e281,'value':_0x3df572});});});}return _0x5a3943;};exports[_0x1c06('0xf')]=function(_0xa50f53,_0x3fdf42,_0x56271f){var _0x2306bd={};if(_0x3fdf42==='DATE'){if(_0x56271f['operator']===_0x1c06('0x10')){_0x56271f[_0x1c06('0x11')]=_0x1c06('0x12');_0x56271f[_0x1c06('0x13')]+=','+_0x56271f[_0x1c06('0x13')];}else if(_['includes'](['$gt','$lte'],_0x56271f[_0x1c06('0x11')])){_0x56271f[_0x1c06('0x13')]=moment(_0x56271f[_0x1c06('0x13')])['add'](0x1,_0x1c06('0x14'))[_0x1c06('0x15')](_0x1c06('0x16'));}}if(_0x56271f[_0x1c06('0x17')]){_0x3fdf42=_0x56271f['castTo'];_0x2306bd[_0x1c06('0x18')]=_0x1c06('0x19')+_0xa50f53+'.'+_0x56271f['field']+_0x1c06('0x1a')+_0x56271f['castTo']+')\x20'+parseOperator(_0x56271f['operator']);}else{_0x2306bd[_0x1c06('0x18')]=_0xa50f53+'.'+_0x56271f[_0x1c06('0x1b')]+'\x20'+parseOperator(_0x56271f['operator']);}if(_[_0x1c06('0x1c')]([_0x1c06('0x1d'),_0x1c06('0x1e')],_0x56271f[_0x1c06('0x11')]))_0x2306bd[_0x1c06('0x18')]='('+_0x2306bd['text']+'\x20OR\x20'+_0xa50f53+'.'+_0x56271f[_0x1c06('0x1b')]+_0x1c06('0x1f');_0x2306bd[_0x1c06('0x13')]=parseValue(_0x3fdf42,_0x56271f[_0x1c06('0x11')],_0x56271f[_0x1c06('0x13')]);return _0x2306bd;};function parseOperator(_0x15e538){var _0x40876d;switch(_0x15e538){case _0x1c06('0x20'):_0x40876d='IN\x20?';break;case'$notIn':_0x40876d='NOT\x20IN\x20?';break;case'$eq':_0x40876d='=\x20?';break;case _0x1c06('0x1d'):_0x40876d=_0x1c06('0x21');break;case _0x1c06('0x22'):case'$startsWith':case _0x1c06('0x23'):_0x40876d=_0x1c06('0x24');break;case'$lt':_0x40876d=_0x1c06('0x25');break;case'$gt':_0x40876d=_0x1c06('0x26');break;case _0x1c06('0x27'):_0x40876d=_0x1c06('0x28');break;case _0x1c06('0x29'):_0x40876d=_0x1c06('0x2a');break;case'$between':_0x40876d='BETWEEN\x20?\x20AND\x20?';break;}return _0x40876d;}function parseValue(_0x52ce6a,_0x2d8648,_0x2868f4){var _0xf06549={'start':undefined,'end':undefined};switch(_0x2d8648){case _0x1c06('0x20'):case _0x1c06('0x1e'):_0xf06549[_0x1c06('0x2b')]=_0x2868f4[_0x1c06('0x7')](',');break;case _0x1c06('0x22'):_0xf06549[_0x1c06('0x2b')]='%'+_0x2868f4+'%';break;case _0x1c06('0x2c'):_0xf06549['start']=_0x2868f4+'%';break;case _0x1c06('0x23'):_0xf06549['start']='%'+_0x2868f4;break;case _0x1c06('0x12'):var _0x49b4ed=_0x2868f4['split'](',');var _0x2868f4=_0x49b4ed[_0x1c06('0xa')]();var _0x112b71=_0x49b4ed[_0x1c06('0x2d')]();if(_0x52ce6a===_0x1c06('0x2e')){_0x2868f4=moment(_0x2868f4)[_0x1c06('0x2f')](0x0,!![])[_0x1c06('0x15')]();_0x112b71=moment(_0x112b71)[_0x1c06('0x2f')](0x0,!![])['add'](0x17,_0x1c06('0x30'))[_0x1c06('0x31')](0x3b,_0x1c06('0x32'))[_0x1c06('0x31')](0x3b,_0x1c06('0x33'))[_0x1c06('0x15')]();}_0xf06549={'start':_0x2868f4,'end':_0x112b71};break;default:_0xf06549[_0x1c06('0x2b')]=_0x2868f4;break;}return _0xf06549;} \ No newline at end of file +var _0xbeaf=['parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','includes','$lte','value','days','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','start','utcOffset','add','hours','minutes','seconds','format','lodash','moment'];(function(_0x494108,_0x106ac5){var _0x310cfa=function(_0x4a9560){while(--_0x4a9560){_0x494108['push'](_0x494108['shift']());}};_0x310cfa(++_0x106ac5);}(_0xbeaf,0x12a));var _0xfbea=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbeaf[_0x432682];return _0x463d05;};'use strict';var _=require(_0xfbea('0x0'));var moment=require(_0xfbea('0x1'));exports[_0xfbea('0x2')]=function(_0x54ee13){var _0xb7768a={'conditions':[]};_0xb7768a[_0xfbea('0x3')]=_[_0xfbea('0x4')](_0x54ee13,_0xfbea('0x5'))?'or':_0xfbea('0x6');var _0x57fb78=_0x54ee13[_0xfbea('0x7')](_0xfbea('0x8'),'')['replace'](_0xfbea('0x5'),'')[_0xfbea('0x9')]('||');for(var _0x4b76c0=0x0;_0x4b76c0<_0x57fb78[_0xfbea('0xa')];_0x4b76c0++){var _0xb43e41=_0x57fb78[_0x4b76c0][_0xfbea('0x9')](':=');var _0x291705=_0xb43e41[0x0];var _0x4110d3=_0xb43e41['slice'](0x1);_0x4110d3[_0xfbea('0xb')](function(_0xf670f3){var _0x377494=_0xf670f3[_0xfbea('0x9')]('[')[_0xfbea('0xc')]();var _0x39068e=_0xf670f3[_0xfbea('0xd')](/\[(.*?)\]/g);_0x39068e[_0xfbea('0xb')](function(_0x382ba6){var _0x109a14=_0x382ba6[_0xfbea('0x9')]('[')[_0xfbea('0xe')](function(_0x961de0){return _0x961de0[_0xfbea('0xf')](']')>-0x1;})[_0xfbea('0x10')](function(_0x182cf5){return _0x182cf5[_0xfbea('0x9')](']')[0x0];})[0x0];_0xb7768a[_0xfbea('0x11')][_0xfbea('0x12')]({'field':_0x291705,'operator':_0x377494,'value':_0x109a14});});});}return _0xb7768a;};exports[_0xfbea('0x13')]=function(_0x234d0f,_0xcb1bdf,_0x5a97db){var _0x4b96d1={};if(_0xcb1bdf===_0xfbea('0x14')){if(_0x5a97db['operator']==='$eq'){_0x5a97db[_0xfbea('0x15')]=_0xfbea('0x16');_0x5a97db['value']+=','+_0x5a97db['value'];}else if(_[_0xfbea('0x17')](['$gt',_0xfbea('0x18')],_0x5a97db['operator'])){_0x5a97db[_0xfbea('0x19')]=moment(_0x5a97db[_0xfbea('0x19')])['add'](0x1,_0xfbea('0x1a'))['format']('YYYY-MM-DD');}}if(_0x5a97db[_0xfbea('0x1b')]){_0xcb1bdf=_0x5a97db[_0xfbea('0x1b')];_0x4b96d1[_0xfbea('0x1c')]=_0xfbea('0x1d')+_0x234d0f+'.'+_0x5a97db[_0xfbea('0x1e')]+_0xfbea('0x1f')+_0x5a97db['castTo']+')\x20'+parseOperator(_0x5a97db[_0xfbea('0x15')]);}else{_0x4b96d1['text']=_0x234d0f+'.'+_0x5a97db[_0xfbea('0x1e')]+'\x20'+parseOperator(_0x5a97db[_0xfbea('0x15')]);}if(_[_0xfbea('0x17')]([_0xfbea('0x20'),_0xfbea('0x21')],_0x5a97db[_0xfbea('0x15')]))_0x4b96d1[_0xfbea('0x1c')]='('+_0x4b96d1[_0xfbea('0x1c')]+_0xfbea('0x22')+_0x234d0f+'.'+_0x5a97db[_0xfbea('0x1e')]+_0xfbea('0x23');_0x4b96d1[_0xfbea('0x19')]=parseValue(_0xcb1bdf,_0x5a97db[_0xfbea('0x15')],_0x5a97db[_0xfbea('0x19')]);return _0x4b96d1;};function parseOperator(_0x2fb158){var _0x5a2237;switch(_0x2fb158){case _0xfbea('0x24'):_0x5a2237=_0xfbea('0x25');break;case'$notIn':_0x5a2237=_0xfbea('0x26');break;case _0xfbea('0x27'):_0x5a2237=_0xfbea('0x28');break;case _0xfbea('0x20'):_0x5a2237=_0xfbea('0x29');break;case _0xfbea('0x2a'):case _0xfbea('0x2b'):case _0xfbea('0x2c'):_0x5a2237=_0xfbea('0x2d');break;case _0xfbea('0x2e'):_0x5a2237=_0xfbea('0x2f');break;case _0xfbea('0x30'):_0x5a2237=_0xfbea('0x31');break;case _0xfbea('0x18'):_0x5a2237=_0xfbea('0x32');break;case _0xfbea('0x33'):_0x5a2237=_0xfbea('0x34');break;case'$between':_0x5a2237='BETWEEN\x20?\x20AND\x20?';break;}return _0x5a2237;}function parseValue(_0x179ec5,_0x290eb9,_0x2cbd52){var _0x407a51={'start':undefined,'end':undefined};switch(_0x290eb9){case _0xfbea('0x24'):case _0xfbea('0x21'):_0x407a51[_0xfbea('0x35')]=_0x2cbd52[_0xfbea('0x9')](',');break;case _0xfbea('0x2a'):_0x407a51[_0xfbea('0x35')]='%'+_0x2cbd52+'%';break;case _0xfbea('0x2b'):_0x407a51['start']=_0x2cbd52+'%';break;case _0xfbea('0x2c'):_0x407a51[_0xfbea('0x35')]='%'+_0x2cbd52;break;case _0xfbea('0x16'):var _0x139d8f=_0x2cbd52['split'](',');var _0x2cbd52=_0x139d8f[_0xfbea('0xc')]();var _0x5e399c=_0x139d8f['pop']();if(_0x179ec5===_0xfbea('0x14')){_0x2cbd52=moment(_0x2cbd52)[_0xfbea('0x36')](0x0,!![])['format']();_0x5e399c=moment(_0x5e399c)['utcOffset'](0x0,!![])[_0xfbea('0x37')](0x17,_0xfbea('0x38'))[_0xfbea('0x37')](0x3b,_0xfbea('0x39'))[_0xfbea('0x37')](0x3b,_0xfbea('0x3a'))[_0xfbea('0x3b')]();}_0x407a51={'start':_0x2cbd52,'end':_0x5e399c};break;default:_0x407a51[_0xfbea('0x35')]=_0x2cbd52;break;}return _0x407a51;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d624314..7949b2c 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 _0x8727=['omit','isArray','length','isObject','isString','isNumeric','match','^[+]?[0-9]*$','forEach','replace','join','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','lower','merge','options','lodash','sequelize','moment','parse','keys','fields','split','filters','isEmpty','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','limit','offset','sort','map','indexOf','cast','col','priority','unsigned','DESC','ASC'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x8727,0x1aa));var _0x7872=function(_0x506f64,_0x395f5a){_0x506f64=_0x506f64-0x0;var _0x389fdb=_0x8727[_0x506f64];return _0x389fdb;};'use strict';var _=require(_0x7872('0x0'));var sequelize=require(_0x7872('0x1'));var moment=require(_0x7872('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x16e094){var _0x35e604=['ne'];try{var _0x4c3818=JSON[_0x7872('0x3')](_0x16e094);var _0x4a04e6=Object['keys'](_0x4c3818)[0x0];return _0x35e604['includes'](_0x4a04e6);}catch(_0x2de8d9){return![];}}function getOperatorValue(_0x4aaf1c){var _0x5b7ae9=JSON[_0x7872('0x3')](_0x4aaf1c);var _0x4c2d3b=Object[_0x7872('0x4')](_0x5b7ae9)[0x0];var _0x4d487c=_0x5b7ae9[_0x4c2d3b];return{['$'+_0x4c2d3b]:_0x4d487c};}exports[_0x7872('0x5')]=function(_0x4a8470){var _0x183802=null;if(_0x4a8470){_0x183802=_0x4a8470[_0x7872('0x6')](',');}return _0x183802;};exports[_0x7872('0x7')]=function(_0x3b06d5,_0x5da66d){var _0x5ee7ac={};if(!_[_0x7872('0x8')](_0x3b06d5)){_['forOwn'](_0x3b06d5,function(_0x1b988c,_0x4235a5){try{if(_0x5da66d){var _0xf13bd3=_[_0x7872('0x9')](_0x5da66d,{'name':_0x4235a5})||{};if(hasSequelizeOperator(_0x1b988c)){_0x5ee7ac[_0x4235a5]=getOperatorValue(_0x1b988c);}else if(_0xf13bd3['type']===_0x7872('0xa')&&_[_0x7872('0xb')](_0x1b988c)){var _0x4ff602=JSON[_0x7872('0x3')](_0x1b988c);var _0x3ec23b={'$gte':moment(moment(_0x4ff602[_0x7872('0xc')])[_0x7872('0xd')](_0x7872('0xe')))['utc']()[_0x7872('0xd')](),'$lte':moment(moment(_0x4ff602[_0x7872('0xf')])[_0x7872('0xd')](_0x7872('0xe')))['utc']()[_0x7872('0x10')](0x1,'s')[_0x7872('0xd')]()};_0x5ee7ac[_0x4235a5]=_0x3ec23b;}else if(_0xf13bd3[_0x7872('0x11')]===_0x7872('0x12')){_0x5ee7ac[_0x4235a5]=_0x1b988c;}else{_0x5ee7ac[_0x4235a5]=_['isArray'](_0x1b988c)?_0x1b988c:JSON[_0x7872('0x3')](_0x1b988c);}}else{_0x5ee7ac[_0x4235a5]=_['isArray'](_0x1b988c)?_0x1b988c:JSON[_0x7872('0x3')](_0x1b988c);}}catch(_0x347c70){_0x5ee7ac[_0x4235a5]=_0x1b988c['split'](',');}});}return _0x5ee7ac;};exports[_0x7872('0x13')]=function(_0x40e806){_0x40e806=parseInt(_0x40e806,0xa);if(!_0x40e806||_0x40e806<0x0){_0x40e806=LIMIT_VALUE;}return _0x40e806;};exports[_0x7872('0x14')]=function(_0x2ede58){_0x2ede58=parseInt(_0x2ede58,0xa);if(!_0x2ede58||_0x2ede58<0x0){_0x2ede58=0x0;}return _0x2ede58;};exports[_0x7872('0x15')]=function(_0x304293){var _0x2ddae1,_0x235f31=null;if(_0x304293){_0x2ddae1=_0x304293[_0x7872('0x6')](',');_0x235f31=_[_0x7872('0x16')](_0x2ddae1,function(_0x3d0004){if(_0x3d0004[_0x7872('0x17')]('-')===0x0){return[_0x3d0004==='priority'?sequelize[_0x7872('0x18')](sequelize[_0x7872('0x19')](_0x7872('0x1a')),_0x7872('0x1b')):_0x3d0004['substr'](0x1),_0x7872('0x1c')];}else{return[_0x3d0004===_0x7872('0x1a')?sequelize[_0x7872('0x18')](sequelize['col'](_0x7872('0x1a')),_0x7872('0x1b')):_0x3d0004,_0x7872('0x1d')];}});}return _0x235f31;};exports[_0x7872('0x1e')]=function(_0x356541,_0x66b74a){if(_[_0x7872('0x8')](_0x356541)){return _0x356541;}if(_[_0x7872('0x1f')](_0x356541)){for(var _0x1bcd8e=0x0;_0x1bcd8e<_0x356541[_0x7872('0x20')];_0x1bcd8e+=0x1){_0x356541[_0x1bcd8e]=this[_0x7872('0x1e')](_0x356541[_0x1bcd8e],_0x66b74a);}return _0x356541;}if(!_[_0x7872('0x21')](_0x356541)){return _0x356541;}if(_[_0x7872('0x22')](_0x66b74a)){_0x66b74a=[_0x66b74a];}if(!_[_0x7872('0x1f')](_0x66b74a)){return _0x356541;}for(var _0x44ee25=0x0;_0x44ee25<_0x66b74a['length'];_0x44ee25+=0x1){_['unset'](_0x356541,_0x66b74a[_0x44ee25]);}for(var _0x3f2480 in _0x356541){if(_0x356541['hasOwnProperty'](_0x3f2480)){_0x356541[_0x3f2480]=this[_0x7872('0x1e')](_0x356541[_0x3f2480],_0x66b74a);}}return _0x356541;};exports[_0x7872('0x23')]=function(_0x51441f){return _0x51441f[_0x7872('0x24')](RegExp(_0x7872('0x25')))?!![]:![];};exports['isEmail']=function(_0x5e0f60){return _0x5e0f60[_0x7872('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x4d966b){var _0x5aacb4=[];_0x4d966b[_0x7872('0x6')](/[ ,]+/)[_0x7872('0x26')](function(_0x2643fb){_0x2643fb=_0x2643fb[_0x7872('0x27')](/([^:]")"+/g,'$1');_0x2643fb='+'+_0x2643fb+'*';if(_0x2643fb['includes']('@'))_0x2643fb='\x22'+_0x2643fb+'\x22';_0x5aacb4['push'](_0x2643fb);});return _0x5aacb4[_0x7872('0x28')]('\x20');};exports[_0x7872('0x29')]=function(_0x142e2f,_0x17c691,_0x66a814){var _0xd3c7c={},_0x1ff60b={};if(_0x17c691[_0x7872('0x2a')][_0x7872('0x2b')]){_0x17c691[_0x7872('0x2a')]['id']=_0x17c691[_0x7872('0x2a')][_0x7872('0x2b')];delete _0x17c691['query'][_0x7872('0x2b')];}_0xd3c7c[_0x7872('0x2c')]=_['map'](_0x142e2f,'name');_0xd3c7c[_0x7872('0x2a')]=_[_0x7872('0x4')](_0x17c691[_0x7872('0x2a')]);_0xd3c7c[_0x7872('0x7')]=_[_0x7872('0x2d')](_0xd3c7c[_0x7872('0x2c')],_0xd3c7c[_0x7872('0x2a')]);_0x1ff60b[_0x7872('0x2e')]=_[_0x7872('0x2d')](_0xd3c7c[_0x7872('0x2c')],this[_0x7872('0x5')](_0x17c691[_0x7872('0x2a')][_0x7872('0x5')]));_0x1ff60b['attributes']=_0x1ff60b[_0x7872('0x2e')][_0x7872('0x20')]?_0x1ff60b[_0x7872('0x2e')]:_0xd3c7c[_0x7872('0x2c')];if(!_0x17c691[_0x7872('0x2a')][_0x7872('0x2f')](_0x7872('0x30'))){_0x1ff60b['limit']=this['limit'](_0x17c691[_0x7872('0x2a')][_0x7872('0x13')]);_0x1ff60b[_0x7872('0x14')]=this['offset'](_0x17c691[_0x7872('0x2a')][_0x7872('0x14')]);}_0x1ff60b[_0x7872('0x31')]=this[_0x7872('0x15')](_0x17c691[_0x7872('0x2a')]['sort']);_0x1ff60b[_0x7872('0x32')]=this['filters'](_['pick'](_0x17c691[_0x7872('0x2a')],_0xd3c7c['filters']),_0x142e2f);if(_0x17c691[_0x7872('0x2a')][_0x7872('0x33')]){_0x1ff60b[_0x7872('0x32')]=_['merge'](_0x1ff60b[_0x7872('0x32')],{'$or':_[_0x7872('0x16')](_0x142e2f,function(_0x2329f5){if(_0x2329f5[_0x7872('0x34')]!==_0x7872('0x35')){if(_0x66a814){return sequelize[_0x7872('0x32')](sequelize['fn'](_0x7872('0x36'),sequelize[_0x7872('0x19')](_0x2329f5['name'])),{'$like':sequelize['fn']('lower','%'+_0x17c691[_0x7872('0x2a')][_0x7872('0x33')]+'%')});}else{var _0x149762={};_0x149762[_0x2329f5[_0x7872('0x11')]]={'$like':'%'+_0x17c691['query'][_0x7872('0x33')]+'%'};return _0x149762;}}})});}_0x1ff60b=_[_0x7872('0x37')]({},_0x1ff60b,_0x17c691[_0x7872('0x38')]);return _0x1ff60b;}; \ No newline at end of file +var _0x3e6b=['map','indexOf','priority','col','unsigned','DESC','cast','ASC','omit','length','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','getFullTextValue','replace','join','getOptions','query','$id','model','attributes','intersection','nolimit','order','where','pick','filter','merge','VIRTUAL','lower','options','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','limit','offset','sort'];(function(_0x2351c4,_0x1dca54){var _0x1dd3f8=function(_0x4c3fa2){while(--_0x4c3fa2){_0x2351c4['push'](_0x2351c4['shift']());}};_0x1dd3f8(++_0x1dca54);}(_0x3e6b,0x1af));var _0xb3e6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3e6b[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var sequelize=require(_0xb3e6('0x0'));var moment=require(_0xb3e6('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3022ed){var _0x5df16b=['ne'];try{var _0x1a1f9a=JSON[_0xb3e6('0x2')](_0x3022ed);var _0x58ce3a=Object[_0xb3e6('0x3')](_0x1a1f9a)[0x0];return _0x5df16b[_0xb3e6('0x4')](_0x58ce3a);}catch(_0xa45fec){return![];}}function getOperatorValue(_0x166299){var _0x1429c0=JSON[_0xb3e6('0x2')](_0x166299);var _0x5540f9=Object['keys'](_0x1429c0)[0x0];var _0x5e137b=_0x1429c0[_0x5540f9];return{['$'+_0x5540f9]:_0x5e137b};}exports[_0xb3e6('0x5')]=function(_0x1d4860){var _0xbe7168=null;if(_0x1d4860){_0xbe7168=_0x1d4860[_0xb3e6('0x6')](',');}return _0xbe7168;};exports[_0xb3e6('0x7')]=function(_0x4c231f,_0x407af8){var _0x2fc85c={};if(!_[_0xb3e6('0x8')](_0x4c231f)){_[_0xb3e6('0x9')](_0x4c231f,function(_0x39473c,_0x19fe49){try{if(_0x407af8){var _0x4dc8be=_[_0xb3e6('0xa')](_0x407af8,{'name':_0x19fe49})||{};if(hasSequelizeOperator(_0x39473c)){_0x2fc85c[_0x19fe49]=getOperatorValue(_0x39473c);}else if(_0x4dc8be[_0xb3e6('0xb')]===_0xb3e6('0xc')&&_[_0xb3e6('0xd')](_0x39473c)){var _0x43145f=JSON[_0xb3e6('0x2')](_0x39473c);var _0x2eb6bf={'$gte':moment(moment(_0x43145f[_0xb3e6('0xe')])[_0xb3e6('0xf')](_0xb3e6('0x10')))[_0xb3e6('0x11')]()['format'](),'$lte':moment(moment(_0x43145f[_0xb3e6('0x12')])[_0xb3e6('0xf')]('YYYY-MM-DD'))[_0xb3e6('0x11')]()['subtract'](0x1,'s')[_0xb3e6('0xf')]()};_0x2fc85c[_0x19fe49]=_0x2eb6bf;}else if(_0x4dc8be[_0xb3e6('0x13')]===_0xb3e6('0x14')){_0x2fc85c[_0x19fe49]=_0x39473c;}else{_0x2fc85c[_0x19fe49]=_[_0xb3e6('0x15')](_0x39473c)?_0x39473c:JSON['parse'](_0x39473c);}}else{_0x2fc85c[_0x19fe49]=_[_0xb3e6('0x15')](_0x39473c)?_0x39473c:JSON['parse'](_0x39473c);}}catch(_0x49d85b){_0x2fc85c[_0x19fe49]=_0x39473c[_0xb3e6('0x6')](',');}});}return _0x2fc85c;};exports[_0xb3e6('0x16')]=function(_0x54b58b){_0x54b58b=parseInt(_0x54b58b,0xa);if(!_0x54b58b||_0x54b58b<0x0){_0x54b58b=LIMIT_VALUE;}return _0x54b58b;};exports[_0xb3e6('0x17')]=function(_0x12eb6c){_0x12eb6c=parseInt(_0x12eb6c,0xa);if(!_0x12eb6c||_0x12eb6c<0x0){_0x12eb6c=0x0;}return _0x12eb6c;};exports[_0xb3e6('0x18')]=function(_0x279c56){var _0x2b36d9,_0x2cfe0e=null;if(_0x279c56){_0x2b36d9=_0x279c56[_0xb3e6('0x6')](',');_0x2cfe0e=_[_0xb3e6('0x19')](_0x2b36d9,function(_0x376874){if(_0x376874[_0xb3e6('0x1a')]('-')===0x0){return[_0x376874===_0xb3e6('0x1b')?sequelize['cast'](sequelize[_0xb3e6('0x1c')](_0xb3e6('0x1b')),_0xb3e6('0x1d')):_0x376874['substr'](0x1),_0xb3e6('0x1e')];}else{return[_0x376874==='priority'?sequelize[_0xb3e6('0x1f')](sequelize[_0xb3e6('0x1c')](_0xb3e6('0x1b')),_0xb3e6('0x1d')):_0x376874,_0xb3e6('0x20')];}});}return _0x2cfe0e;};exports[_0xb3e6('0x21')]=function(_0xda2b9c,_0x4288a1){if(_[_0xb3e6('0x8')](_0xda2b9c)){return _0xda2b9c;}if(_[_0xb3e6('0x15')](_0xda2b9c)){for(var _0x4d0840=0x0;_0x4d0840<_0xda2b9c[_0xb3e6('0x22')];_0x4d0840+=0x1){_0xda2b9c[_0x4d0840]=this[_0xb3e6('0x21')](_0xda2b9c[_0x4d0840],_0x4288a1);}return _0xda2b9c;}if(!_['isObject'](_0xda2b9c)){return _0xda2b9c;}if(_['isString'](_0x4288a1)){_0x4288a1=[_0x4288a1];}if(!_[_0xb3e6('0x15')](_0x4288a1)){return _0xda2b9c;}for(var _0x482cce=0x0;_0x482cce<_0x4288a1[_0xb3e6('0x22')];_0x482cce+=0x1){_[_0xb3e6('0x23')](_0xda2b9c,_0x4288a1[_0x482cce]);}for(var _0x1b9769 in _0xda2b9c){if(_0xda2b9c[_0xb3e6('0x24')](_0x1b9769)){_0xda2b9c[_0x1b9769]=this[_0xb3e6('0x21')](_0xda2b9c[_0x1b9769],_0x4288a1);}}return _0xda2b9c;};exports[_0xb3e6('0x25')]=function(_0x296316){return _0x296316['match'](RegExp(_0xb3e6('0x26')))?!![]:![];};exports['isEmail']=function(_0x5bf0d2){return _0x5bf0d2['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xb3e6('0x27')]=function(_0x2ebd40){var _0x4dce35=[];_0x2ebd40[_0xb3e6('0x6')](/[ ,]+/)['forEach'](function(_0x42fa1e){_0x42fa1e=_0x42fa1e[_0xb3e6('0x28')](/([^:]")"+/g,'$1');_0x42fa1e='+'+_0x42fa1e+'*';if(_0x42fa1e[_0xb3e6('0x4')]('@'))_0x42fa1e='\x22'+_0x42fa1e+'\x22';_0x4dce35['push'](_0x42fa1e);});return _0x4dce35[_0xb3e6('0x29')]('\x20');};exports[_0xb3e6('0x2a')]=function(_0x3a528d,_0x5d2758,_0x2b65a9){var _0x36f9ca={},_0x50d02c={};if(_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x2c')]){_0x5d2758[_0xb3e6('0x2b')]['id']=_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x2c')];delete _0x5d2758[_0xb3e6('0x2b')]['$id'];}_0x36f9ca[_0xb3e6('0x2d')]=_[_0xb3e6('0x19')](_0x3a528d,_0xb3e6('0x13'));_0x36f9ca[_0xb3e6('0x2b')]=_[_0xb3e6('0x3')](_0x5d2758[_0xb3e6('0x2b')]);_0x36f9ca['filters']=_['intersection'](_0x36f9ca[_0xb3e6('0x2d')],_0x36f9ca[_0xb3e6('0x2b')]);_0x50d02c[_0xb3e6('0x2e')]=_[_0xb3e6('0x2f')](_0x36f9ca[_0xb3e6('0x2d')],this[_0xb3e6('0x5')](_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x5')]));_0x50d02c[_0xb3e6('0x2e')]=_0x50d02c[_0xb3e6('0x2e')][_0xb3e6('0x22')]?_0x50d02c[_0xb3e6('0x2e')]:_0x36f9ca[_0xb3e6('0x2d')];if(!_0x5d2758[_0xb3e6('0x2b')]['hasOwnProperty'](_0xb3e6('0x30'))){_0x50d02c[_0xb3e6('0x16')]=this['limit'](_0x5d2758['query'][_0xb3e6('0x16')]);_0x50d02c[_0xb3e6('0x17')]=this[_0xb3e6('0x17')](_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x17')]);}_0x50d02c[_0xb3e6('0x31')]=this[_0xb3e6('0x18')](_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x18')]);_0x50d02c[_0xb3e6('0x32')]=this[_0xb3e6('0x7')](_[_0xb3e6('0x33')](_0x5d2758[_0xb3e6('0x2b')],_0x36f9ca[_0xb3e6('0x7')]),_0x3a528d);if(_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x34')]){_0x50d02c[_0xb3e6('0x32')]=_[_0xb3e6('0x35')](_0x50d02c[_0xb3e6('0x32')],{'$or':_[_0xb3e6('0x19')](_0x3a528d,function(_0x4ebe51){if(_0x4ebe51[_0xb3e6('0xb')]!==_0xb3e6('0x36')){if(_0x2b65a9){return sequelize[_0xb3e6('0x32')](sequelize['fn'](_0xb3e6('0x37'),sequelize[_0xb3e6('0x1c')](_0x4ebe51[_0xb3e6('0x13')])),{'$like':sequelize['fn']('lower','%'+_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x34')]+'%')});}else{var _0x4f8c16={};_0x4f8c16[_0x4ebe51[_0xb3e6('0x13')]]={'$like':'%'+_0x5d2758['query']['filter']+'%'};return _0x4f8c16;}}})});}_0x50d02c=_[_0xb3e6('0x35')]({},_0x50d02c,_0x5d2758[_0xb3e6('0x38')]);return _0x50d02c;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 6741894..81c8971 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fc7=['/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','./environment','get','production','set','appPath','join','root','public','development','test','client','toISOString','split','use','views'];(function(_0xbeaae9,_0x17b5a6){var _0x21e17d=function(_0x2770bb){while(--_0x2770bb){_0xbeaae9['push'](_0xbeaae9['shift']());}};_0x21e17d(++_0x17b5a6);}(_0x2fc7,0xe9));var _0x72fc=function(_0x2483c1,_0x3f3293){_0x2483c1=_0x2483c1-0x0;var _0x3fdce4=_0x2fc7[_0x2483c1];return _0x3fdce4;};'use strict';var express=require(_0x72fc('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x72fc('0x1'));var methodOverride=require(_0x72fc('0x2'));var cookieParser=require(_0x72fc('0x3'));var errorHandler=require(_0x72fc('0x4'));var path=require(_0x72fc('0x5'));var passport=require(_0x72fc('0x6'));var cors=require(_0x72fc('0x7'));var moment=require('moment');var config=require(_0x72fc('0x8'));var db=require('../mysqldb')['db'];exports['default']=function(_0x25ed28){var _0x1c47d3=_0x25ed28[_0x72fc('0x9')]('env');if(_0x1c47d3===_0x72fc('0xa')){_0x25ed28[_0x72fc('0xb')](_0x72fc('0xc'),path[_0x72fc('0xd')](config[_0x72fc('0xe')],_0x72fc('0xf')));}if(_0x1c47d3===_0x72fc('0x10')||_0x1c47d3===_0x72fc('0x11')){_0x25ed28[_0x72fc('0xb')]('appPath',path['join'](config['root'],_0x72fc('0x12')));_0x25ed28['use'](errorHandler());}_0x25ed28['set']('json\x20replacer',function(_0x4de8dd,_0x3913a6){if(this[_0x4de8dd]instanceof Date){_0x3913a6=this[_0x4de8dd][_0x72fc('0x13')]()[_0x72fc('0x14')]('.')[0x0]+'Z';}return _0x3913a6;});_0x25ed28[_0x72fc('0x15')](express['static'](_0x25ed28[_0x72fc('0x9')](_0x72fc('0xc'))));_0x25ed28[_0x72fc('0xb')](_0x72fc('0x16'),config[_0x72fc('0xe')]+_0x72fc('0x17'));_0x25ed28[_0x72fc('0x18')](_0x72fc('0x19'),require(_0x72fc('0x1a'))[_0x72fc('0x1b')]);_0x25ed28[_0x72fc('0xb')](_0x72fc('0x1c'),_0x72fc('0x19'));_0x25ed28['use'](bodyParser[_0x72fc('0x1d')]({'limit':'50mb','extended':!![]}));_0x25ed28[_0x72fc('0x15')](bodyParser[_0x72fc('0x1e')]({'limit':_0x72fc('0x1f')}));_0x25ed28[_0x72fc('0x15')](cors());_0x25ed28['use'](methodOverride());_0x25ed28[_0x72fc('0x15')](cookieParser());_0x25ed28['use'](passport['initialize']());}; \ No newline at end of file +var _0xcbfe=['appPath','join','public','development','test','root','client','use','json\x20replacer','split','static','views','/server/views','engine','html','renderFile','view\x20engine','urlencoded','50mb','json','initialize','serve-favicon','body-parser','method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','set'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xcbfe,0x1c5));var _0xecbf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcbfe[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var favicon=require(_0xecbf('0x0'));var bodyParser=require(_0xecbf('0x1'));var methodOverride=require(_0xecbf('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xecbf('0x3'));var path=require(_0xecbf('0x4'));var passport=require(_0xecbf('0x5'));var cors=require(_0xecbf('0x6'));var moment=require(_0xecbf('0x7'));var config=require(_0xecbf('0x8'));var db=require(_0xecbf('0x9'))['db'];exports[_0xecbf('0xa')]=function(_0x23baf9){var _0x1e0cc6=_0x23baf9[_0xecbf('0xb')](_0xecbf('0xc'));if(_0x1e0cc6===_0xecbf('0xd')){_0x23baf9[_0xecbf('0xe')](_0xecbf('0xf'),path[_0xecbf('0x10')](config['root'],_0xecbf('0x11')));}if(_0x1e0cc6===_0xecbf('0x12')||_0x1e0cc6===_0xecbf('0x13')){_0x23baf9[_0xecbf('0xe')](_0xecbf('0xf'),path[_0xecbf('0x10')](config[_0xecbf('0x14')],_0xecbf('0x15')));_0x23baf9[_0xecbf('0x16')](errorHandler());}_0x23baf9[_0xecbf('0xe')](_0xecbf('0x17'),function(_0x105bb9,_0xffd03c){if(this[_0x105bb9]instanceof Date){_0xffd03c=this[_0x105bb9]['toISOString']()[_0xecbf('0x18')]('.')[0x0]+'Z';}return _0xffd03c;});_0x23baf9[_0xecbf('0x16')](express[_0xecbf('0x19')](_0x23baf9[_0xecbf('0xb')](_0xecbf('0xf'))));_0x23baf9[_0xecbf('0xe')](_0xecbf('0x1a'),config[_0xecbf('0x14')]+_0xecbf('0x1b'));_0x23baf9[_0xecbf('0x1c')](_0xecbf('0x1d'),require('ejs')[_0xecbf('0x1e')]);_0x23baf9[_0xecbf('0xe')](_0xecbf('0x1f'),_0xecbf('0x1d'));_0x23baf9[_0xecbf('0x16')](bodyParser[_0xecbf('0x20')]({'limit':_0xecbf('0x21'),'extended':!![]}));_0x23baf9['use'](bodyParser[_0xecbf('0x22')]({'limit':_0xecbf('0x21')}));_0x23baf9[_0xecbf('0x16')](cors());_0x23baf9[_0xecbf('0x16')](methodOverride());_0x23baf9[_0xecbf('0x16')](cookieParser());_0x23baf9[_0xecbf('0x16')](passport[_0xecbf('0x23')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index be5ade9..9d262b5 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 _0x6682=['digest','getUuid','licenseToken','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','createHash','substring','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','md5','update'];(function(_0x32e8c9,_0x247f25){var _0x4e1148=function(_0x23de4d){while(--_0x23de4d){_0x32e8c9['push'](_0x32e8c9['shift']());}};_0x4e1148(++_0x247f25);}(_0x6682,0x85));var _0x2668=function(_0x1411d8,_0x5d8a99){_0x1411d8=_0x1411d8-0x0;var _0x2572c7=_0x6682[_0x1411d8];return _0x2572c7;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x2668('0x0'));var machine=require(_0x2668('0x1'));var exec=require(_0x2668('0x2'))['execSync'];var config=require(_0x2668('0x3'));function getInterfaces(){var _0x5647d6=[];var _0x474b69=os[_0x2668('0x4')]();var _0x71613e=_[_0x2668('0x5')](_[_0x2668('0x6')](_0x474b69));for(var _0x3bbb22=0x0;_0x3bbb22<_0x71613e['length'];_0x3bbb22++){var _0x5a6365=_0x474b69[_0x71613e[_0x3bbb22]][_0x2668('0x7')](function(_0x905701){return _0x905701['family']===_0x2668('0x8')&&_0x905701[_0x2668('0x9')]===![];});_0x5647d6=_0x5647d6[_0x2668('0xa')](_0x5a6365);}return _0x5647d6;}function getFirstInterface(){var _0x30109f=_[_0x2668('0xb')](getInterfaces());return{'macAddress':_0x30109f&&_0x30109f['mac']?_0x30109f[_0x2668('0xc')]:_0x2668('0xd'),'ipAddress':_0x30109f&&_0x30109f[_0x2668('0xe')]?_0x30109f['address']:_0x2668('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x8cfddf=_[_0x2668('0x5')](os[_0x2668('0x10')]()[_0x2668('0x11')](function(_0x5d1b92){return _0x5d1b92[_0x2668('0x12')];}))[_0x2668('0x13')](':');return crypto['createHash'](_0x2668('0x14'))[_0x2668('0x15')](_0x8cfddf)[_0x2668('0x16')]('hex');}exports[_0x2668('0x17')]=function(){var _0x2e6e5b=os['platform']();var _0x1b4091=/[0-9a-f-]{36}/;if(config[_0x2668('0x18')]&&_0x1b4091['test'](config[_0x2668('0x18')])){return config['licenseToken'];}else if(_0x2e6e5b==='win32'){return exec(_0x2668('0x19'),{'encoding':'utf8'})[_0x2668('0x1a')]('\x0d\x0a','');}else{var _0x2cd300=getFirstInterface();var _0x3f1dfc=getCPUhash();var _0x378ce1=_0x3f1dfc+'|'+os['hostname']()+'|'+_0x2cd300[_0x2668('0x1b')]+'|'+_0x2cd300[_0x2668('0x1c')];var _0xca9cd7=crypto[_0x2668('0x1d')](_0x2668('0x14'))['update'](_0x378ce1)['digest']('hex');return _0xca9cd7[_0x2668('0x1e')](0x0,0x8)+'-'+_0xca9cd7[_0x2668('0x1e')](0x8,0xc)+'-'+_0xca9cd7[_0x2668('0x1e')](0xc,0x10)+'-'+_0xca9cd7[_0x2668('0x1e')](0x10,0x14)+'-'+_0xca9cd7[_0x2668('0x1e')](0x14);}}; \ No newline at end of file +var _0xdf37=['digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','length','filter','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','join','createHash','md5','update','hex','getUuid','test','licenseToken','replace','hostname','ipAddress'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdf37,0x9d));var _0x7df3=function(_0x2f3ee0,_0x2d1874){_0x2f3ee0=_0x2f3ee0-0x0;var _0x31f227=_0xdf37[_0x2f3ee0];return _0x31f227;};'use strict';var _=require(_0x7df3('0x0'));var os=require('os');var crypto=require(_0x7df3('0x1'));var machine=require(_0x7df3('0x2'));var exec=require(_0x7df3('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x92dc8=[];var _0x24c1ef=os[_0x7df3('0x4')]();var _0x248b7f=_[_0x7df3('0x5')](_[_0x7df3('0x6')](_0x24c1ef));for(var _0x1b14ea=0x0;_0x1b14ea<_0x248b7f[_0x7df3('0x7')];_0x1b14ea++){var _0x4edcc7=_0x24c1ef[_0x248b7f[_0x1b14ea]][_0x7df3('0x8')](function(_0x4eb5b6){return _0x4eb5b6['family']==='IPv4'&&_0x4eb5b6[_0x7df3('0x9')]===![];});_0x92dc8=_0x92dc8[_0x7df3('0xa')](_0x4edcc7);}return _0x92dc8;}function getFirstInterface(){var _0x4e91c0=_[_0x7df3('0xb')](getInterfaces());return{'macAddress':_0x4e91c0&&_0x4e91c0[_0x7df3('0xc')]?_0x4e91c0[_0x7df3('0xc')]:_0x7df3('0xd'),'ipAddress':_0x4e91c0&&_0x4e91c0[_0x7df3('0xe')]?_0x4e91c0[_0x7df3('0xe')]:_0x7df3('0xf')};}exports[_0x7df3('0x10')]=getFirstInterface;function getCPUhash(){var _0x46cece=_['orderBy'](os['cpus']()['map'](function(_0x50e8b5){return _0x50e8b5[_0x7df3('0x11')];}))[_0x7df3('0x12')](':');return crypto[_0x7df3('0x13')](_0x7df3('0x14'))[_0x7df3('0x15')](_0x46cece)['digest'](_0x7df3('0x16'));}exports[_0x7df3('0x17')]=function(){var _0x1f148b=os['platform']();var _0x4de61b=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4de61b[_0x7df3('0x18')](config[_0x7df3('0x19')])){return config[_0x7df3('0x19')];}else if(_0x1f148b==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x7df3('0x1a')]('\x0d\x0a','');}else{var _0x1771df=getFirstInterface();var _0x3b234c=getCPUhash();var _0xee0269=_0x3b234c+'|'+os[_0x7df3('0x1b')]()+'|'+_0x1771df['macAddress']+'|'+_0x1771df[_0x7df3('0x1c')];var _0x175a04=crypto['createHash'](_0x7df3('0x14'))[_0x7df3('0x15')](_0xee0269)[_0x7df3('0x1d')](_0x7df3('0x16'));return _0x175a04['substring'](0x0,0x8)+'-'+_0x175a04[_0x7df3('0x1e')](0x8,0xc)+'-'+_0x175a04['substring'](0xc,0x10)+'-'+_0x175a04[_0x7df3('0x1e')](0x10,0x14)+'-'+_0x175a04[_0x7df3('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 6b4d00c..3758bda 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 _0x2b1c=['../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data2','data1','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','update','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo'];(function(_0x1198ad,_0x38262b){var _0x564aff=function(_0x188898){while(--_0x188898){_0x1198ad['push'](_0x1198ad['shift']());}};_0x564aff(++_0x38262b);}(_0x2b1c,0x122));var _0xc2b1=function(_0x4bbf39,_0xf6c81d){_0x4bbf39=_0x4bbf39-0x0;var _0xa36b8=_0x2b1c[_0x4bbf39];return _0xa36b8;};'use strict';var util=require(_0xc2b1('0x0'));var moment=require('moment');var rp=require(_0xc2b1('0x1'));var BPromise=require(_0xc2b1('0x2'));var pkginfo=require(_0xc2b1('0x3'))(module,'version');var db=require(_0xc2b1('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xc2b1('0x5'));var logger=require(_0xc2b1('0x6'))(_0xc2b1('0x7'));var HOST=_0xc2b1('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2f6803){return new BPromise(function(_0x1cc072,_0x470550){var _0x6ae294=util[_0xc2b1('0x9')](_0xc2b1('0xa'),HOST,_0x2f6803,module[_0xc2b1('0xb')]['version']);if(oldToken){_0x6ae294=util[_0xc2b1('0x9')](_0xc2b1('0xc'),HOST,_0x2f6803,module['exports']['version'],oldToken);}var _0x22cd6d={'uri':_0x6ae294,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x22cd6d)[_0xc2b1('0xd')](function(_0x18e0b1){_0x1cc072(_0x18e0b1);})['catch'](function(_0x4a2f90){_0x470550(_0x4a2f90);});});}function manageLicense(_0x3ecf68,_0x4b8e63){var _0x2cea51=_0x4b8e63[_0xc2b1('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x2cea51['data1']!==_0x3ecf68&&!_0x2cea51[_0xc2b1('0xf')]){oldToken=_0x2cea51[_0xc2b1('0x10')];}httpRequest(_0x3ecf68)[_0xc2b1('0xd')](function(_0x25f495){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x25f495[_0xc2b1('0x11')]){isOldTokenSent=![];if(!_0x2cea51[_0xc2b1('0x7')]&&_0x2cea51[_0xc2b1('0x7')]!=_0x25f495[_0xc2b1('0x7')]||_0x2cea51[_0xc2b1('0x7')]&&_0x2cea51['data2']){logger['info'](_0xc2b1('0x12'));}if(_0x2cea51[_0xc2b1('0x7')]&&!_0x2cea51['data2']&&_0x2cea51['license']!=_0x25f495[_0xc2b1('0x7')]){logger[_0xc2b1('0x13')](_0xc2b1('0x14'));}if(_0x2cea51[_0xc2b1('0x7')]&&!_0x2cea51[_0xc2b1('0xf')]&&_0x2cea51[_0xc2b1('0x7')]==_0x25f495['license']){return _0x4b8e63;}return _0x4b8e63['update']({'data1':_0x3ecf68,'data2':null,'license':_0x25f495[_0xc2b1('0x7')]});}else{if(_0x25f495[_0xc2b1('0x7')]||_0x2cea51[_0xc2b1('0x7')]){if(!_0x2cea51[_0xc2b1('0xf')]){if(_0x2cea51[_0xc2b1('0x10')]==_0x3ecf68){GRAY_PERIOD_REASON=_0xc2b1('0x15');logger[_0xc2b1('0x13')](_0xc2b1('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xc2b1('0x13')](_0xc2b1('0x17'),_0x2cea51[_0xc2b1('0x10')],_0x3ecf68);}logger[_0xc2b1('0x13')](_0xc2b1('0x18'),GRAY_PERIOD_REASON[_0xc2b1('0x19')](),moment()['format'](_0xc2b1('0x1a')));return _0x4b8e63['update']({'data2':encryptor[_0xc2b1('0x1b')](moment()[_0xc2b1('0x9')](_0xc2b1('0x1a')))});}else{if(moment()['diff'](encryptor[_0xc2b1('0x1c')](_0x2cea51['data2']),_0xc2b1('0x1d'))>DAYS){logger[_0xc2b1('0x13')](_0xc2b1('0x1e'),moment()[_0xc2b1('0x9')](_0xc2b1('0x1a')));isOldTokenSent=![];return _0x4b8e63['update']({'data1':_0x3ecf68,'data2':null,'license':null});}}}else{if(_0x2cea51[_0xc2b1('0x10')]!=_0x3ecf68){logger[_0xc2b1('0x13')](_0xc2b1('0x17'),_0x2cea51[_0xc2b1('0x10')],_0x3ecf68);return _0x4b8e63[_0xc2b1('0x1f')]({'data1':_0x3ecf68,'data2':null,'license':null});}}}return _0x4b8e63;})[_0xc2b1('0xd')](function(_0x5e95e1){_0x4b8e63=_0x5e95e1;})[_0xc2b1('0x20')](function(_0x14d4a8){logger[_0xc2b1('0x21')](_0x14d4a8[_0xc2b1('0x22')]);})[_0xc2b1('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xc2b1('0x24')](),_0x4b8e63);},TIME);});}function defaultLicense(){var _0xe612cb=hardware[_0xc2b1('0x24')]();if(_0xe612cb){return db[_0xc2b1('0x25')][_0xc2b1('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0xe612cb}})[_0xc2b1('0x27')](function(_0x3961cf,_0x85fdc4){logger[_0xc2b1('0x13')](_0xc2b1('0x28'),_0xe612cb);manageLicense(_0xe612cb,_0x3961cf);})['catch'](function(_0x22d530){logger[_0xc2b1('0x21')](_0x22d530[_0xc2b1('0x22')]);});}}exports[_0xc2b1('0x29')]=defaultLicense; \ No newline at end of file +var _0x373d=['DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','then','catch','get','data1','data2','active','info','update','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days'];(function(_0x15fce8,_0x7612b7){var _0x3f54aa=function(_0x4c1752){while(--_0x4c1752){_0x15fce8['push'](_0x15fce8['shift']());}};_0x3f54aa(++_0x7612b7);}(_0x373d,0xa2));var _0xd373=function(_0x51e026,_0x509ce9){_0x51e026=_0x51e026-0x0;var _0x2fb4bf=_0x373d[_0x51e026];return _0x2fb4bf;};'use strict';var util=require(_0xd373('0x0'));var moment=require(_0xd373('0x1'));var rp=require(_0xd373('0x2'));var BPromise=require(_0xd373('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0xd373('0x4'))['db'];var encryptor=require(_0xd373('0x5'));var hardware=require(_0xd373('0x6'));var logger=require(_0xd373('0x7'))(_0xd373('0x8'));var HOST=_0xd373('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x426502){return new BPromise(function(_0x65be35,_0x33dbdf){var _0x42a314=util[_0xd373('0xa')](_0xd373('0xb'),HOST,_0x426502,module[_0xd373('0xc')][_0xd373('0xd')]);if(oldToken){_0x42a314=util[_0xd373('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x426502,module['exports'][_0xd373('0xd')],oldToken);}var _0x1d6728={'uri':_0x42a314,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x1d6728)[_0xd373('0xe')](function(_0x5382a7){_0x65be35(_0x5382a7);})[_0xd373('0xf')](function(_0x24fc35){_0x33dbdf(_0x24fc35);});});}function manageLicense(_0x28f938,_0x5da1cd){var _0x11ee6b=_0x5da1cd[_0xd373('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x11ee6b[_0xd373('0x11')]!==_0x28f938&&!_0x11ee6b[_0xd373('0x12')]){oldToken=_0x11ee6b['data1'];}httpRequest(_0x28f938)[_0xd373('0xe')](function(_0x1a70d8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1a70d8[_0xd373('0x13')]){isOldTokenSent=![];if(!_0x11ee6b[_0xd373('0x8')]&&_0x11ee6b[_0xd373('0x8')]!=_0x1a70d8[_0xd373('0x8')]||_0x11ee6b[_0xd373('0x8')]&&_0x11ee6b['data2']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x11ee6b[_0xd373('0x8')]&&!_0x11ee6b[_0xd373('0x12')]&&_0x11ee6b[_0xd373('0x8')]!=_0x1a70d8[_0xd373('0x8')]){logger[_0xd373('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x11ee6b[_0xd373('0x8')]&&!_0x11ee6b[_0xd373('0x12')]&&_0x11ee6b[_0xd373('0x8')]==_0x1a70d8[_0xd373('0x8')]){return _0x5da1cd;}return _0x5da1cd[_0xd373('0x15')]({'data1':_0x28f938,'data2':null,'license':_0x1a70d8[_0xd373('0x8')]});}else{if(_0x1a70d8[_0xd373('0x8')]||_0x11ee6b[_0xd373('0x8')]){if(!_0x11ee6b[_0xd373('0x12')]){if(_0x11ee6b[_0xd373('0x11')]==_0x28f938){GRAY_PERIOD_REASON='Disabled';logger[_0xd373('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xd373('0x16');logger[_0xd373('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x11ee6b['data1'],_0x28f938);}logger[_0xd373('0x14')](_0xd373('0x17'),GRAY_PERIOD_REASON[_0xd373('0x18')](),moment()[_0xd373('0xa')](_0xd373('0x19')));return _0x5da1cd[_0xd373('0x15')]({'data2':encryptor['encryptString'](moment()['format'](_0xd373('0x19')))});}else{if(moment()[_0xd373('0x1a')](encryptor['decryptString'](_0x11ee6b['data2']),_0xd373('0x1b'))>DAYS){logger['info'](_0xd373('0x1c'),moment()[_0xd373('0xa')](_0xd373('0x19')));isOldTokenSent=![];return _0x5da1cd[_0xd373('0x15')]({'data1':_0x28f938,'data2':null,'license':null});}}}else{if(_0x11ee6b[_0xd373('0x11')]!=_0x28f938){logger[_0xd373('0x14')](_0xd373('0x1d'),_0x11ee6b[_0xd373('0x11')],_0x28f938);return _0x5da1cd[_0xd373('0x15')]({'data1':_0x28f938,'data2':null,'license':null});}}}return _0x5da1cd;})['then'](function(_0xcd6ed2){_0x5da1cd=_0xcd6ed2;})[_0xd373('0xf')](function(_0x28595f){logger[_0xd373('0x1e')](_0x28595f[_0xd373('0x1f')]);})[_0xd373('0x20')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x5da1cd);},TIME);});}function defaultLicense(){var _0x52414d=hardware[_0xd373('0x21')]();if(_0x52414d){return db[_0xd373('0x22')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x52414d}})[_0xd373('0x23')](function(_0x18bba7,_0x4a5b60){logger['info'](_0xd373('0x24'),_0x52414d);manageLicense(_0x52414d,_0x18bba7);})[_0xd373('0xf')](function(_0x5c96ea){logger['error'](_0x5c96ea['message']);});}}exports[_0xd373('0x25')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 3a0f8cd..efab404 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 _0x7ca7=['License\x20limit\x20reached\x20for\x20telephones','util','lodash','bluebird','./hardware','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','message','User','findAll','role','COUNT','col','count','admin','user','telephone','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users'];(function(_0x592ecf,_0xaafad){var _0x4404ac=function(_0x3d34b4){while(--_0x3d34b4){_0x592ecf['push'](_0x592ecf['shift']());}};_0x4404ac(++_0xaafad);}(_0x7ca7,0x8e));var _0x77ca=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x7ca7[_0x11ca63];return _0x41f1f6;};'use strict';var util=require(_0x77ca('0x0'));var _=require(_0x77ca('0x1'));var moment=require('moment');var BPromise=require(_0x77ca('0x2'));var hardware=require(_0x77ca('0x3'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x77ca('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x77ca('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x77ca('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xdc1ecb){return new BPromise(function(_0x6674e3,_0x461901){return db[_0x77ca('0x7')][_0x77ca('0x8')](_[_0x77ca('0x9')](_0xdc1ecb,{'raw':!![],'where':{'id':0x1}}))[_0x77ca('0xa')](function(_0x4874f0){return checkLicense(_0x4874f0,null);})[_0x77ca('0xa')](function(_0xcf4eda){_0x6674e3(_0xcf4eda);return;})[_0x77ca('0xb')](function(_0x3d39c7){_0x461901(_0x3d39c7);});});}function checkLicense(_0x3c8e92,_0x1625d9){if(!_0x3c8e92){demoLicense[_0x77ca('0xc')]=_0x3c8e92[_0x77ca('0xd')];return demoLicense;}try{var _0x5a0940=_0x1625d9||_0x3c8e92[_0x77ca('0xe')];if(_['isEmpty'](_0x5a0940)){throw new Error(_0x77ca('0xf'));}var _0x4dcfd6=_0x3c8e92[_0x77ca('0xd')];var _0xcd56b7=_0x3c8e92[_0x77ca('0x10')];var _0x5b770e=_0x4dcfd6['split']('-')[0x4];var _0x43e9e0=_0x4dcfd6[_0x77ca('0x11')]('-')[0x0];var _0x3af16e=encryptor[_0x77ca('0x12')](_0x5a0940,util[_0x77ca('0x13')](_0x77ca('0x14'),_0x5b770e,_0x4dcfd6,_0x43e9e0));var _0x5316f3=JSON[_0x77ca('0x15')](_0x3af16e);_0x5316f3[_0x77ca('0x16')]=![];_0x5316f3[_0x77ca('0xc')]=_0x4dcfd6;_0x5316f3['machineUuid']=hardware[_0x77ca('0x4')]();if(_0xcd56b7){var _0x4be4a2=encryptor[_0x77ca('0x12')](_0xcd56b7);_0x5316f3[_0x77ca('0x17')]=_0x4be4a2;_0x5316f3[_0x77ca('0x18')]=moment(_0x4be4a2)[_0x77ca('0x19')](0x7,_0x77ca('0x1a'))[_0x77ca('0x13')]();_0x5316f3[_0x77ca('0x1b')]=_0x5316f3['uuid']!=_0x5316f3[_0x77ca('0x1c')]?_0x77ca('0x1d'):_0x77ca('0x1e');}return _0x5316f3;}catch(_0x20f3cc){breakingLicense[_0x77ca('0xc')]=_0x3c8e92['data1'];breakingLicense[_0x77ca('0x1f')]=_0x20f3cc[_0x77ca('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x27bc33,_0x5acdcd){getLicense()[_0x77ca('0xa')](function(_0x78d428){return db[_0x77ca('0x20')][_0x77ca('0x21')]({'attributes':[_0x77ca('0x22'),[db['sequelize']['fn'](_0x77ca('0x23'),db['sequelize'][_0x77ca('0x24')](_0x77ca('0x22'))),_0x77ca('0x25')]],'group':_0x77ca('0x22'),'where':{'role':{'$or':[_0x77ca('0x26'),_0x77ca('0x27'),_0x77ca('0x28')]}},'raw':!![]})['then'](function(_0x2d4a01){var _0x141428={'user':_0x78d428['users']||0x0,'telephone':_0x78d428[_0x77ca('0x29')]||0x0};_0x2d4a01[_0x77ca('0x2a')](function(_0x2401bf){var _0x4e909b=_0x2401bf[_0x77ca('0x22')]==='admin'?_0x77ca('0x27'):_0x2401bf[_0x77ca('0x22')];_0x141428[_0x4e909b]-=_0x2401bf['count'];if(_0x141428[_0x4e909b]<0x0)_0x141428[_0x4e909b]=0x0;});_0x27bc33(_0x141428);return;});})[_0x77ca('0xb')](function(_0x11b9d6){_0x5acdcd(_0x11b9d6);});});}function checkUserLimits(_0x23ecdd){return new BPromise(function(_0x2bbcee,_0x17f760){getLimits()[_0x77ca('0xa')](function(_0x4acc99){var _0x3d8f98=_[_0x77ca('0x2b')](_[_0x77ca('0x2c')](_0x23ecdd,_0x77ca('0x22')),[_0x77ca('0x26'),'user',_0x77ca('0x28')]);var _0x5efd44=(_0x3d8f98[_0x77ca('0x26')]||0x0)+(_0x3d8f98[_0x77ca('0x27')]||0x0);var _0x3a54d4=_0x3d8f98['telephone']||0x0;if(_0x5efd44>_0x4acc99['user'])return _0x17f760(_0x77ca('0x2d'));if(_0x3a54d4>_0x4acc99[_0x77ca('0x28')])return _0x17f760(_0x77ca('0x2e'));return _0x2bbcee();})[_0x77ca('0xb')](function(_0x4f5563){_0x17f760(_0x4f5563);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xf858=['deadline','days','grayReason','changed','disabled','message','User','findAll','role','sequelize','count','admin','users','telephones','forEach','user','catch','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','then','uuid','data1','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray'];(function(_0x4c2f30,_0xa91340){var _0xb8854d=function(_0x5ddf3d){while(--_0x5ddf3d){_0x4c2f30['push'](_0x4c2f30['shift']());}};_0xb8854d(++_0xa91340);}(_0xf858,0x186));var _0x8f85=function(_0x53e8be,_0x1f76d9){_0x53e8be=_0x53e8be-0x0;var _0x5ed9d0=_0xf858[_0x53e8be];return _0x5ed9d0;};'use strict';var util=require(_0x8f85('0x0'));var _=require(_0x8f85('0x1'));var moment=require(_0x8f85('0x2'));var BPromise=require(_0x8f85('0x3'));var hardware=require(_0x8f85('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0x8f85('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8f85('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x8f85('0x7'),'machineUuid':hardware[_0x8f85('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8f85('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8f85('0x9'),'machineUuid':hardware[_0x8f85('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5695f2){return new BPromise(function(_0x10907f,_0x31700c){return db[_0x8f85('0xa')]['find'](_['defaults'](_0x5695f2,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x194213){return checkLicense(_0x194213,null);})[_0x8f85('0xb')](function(_0x304478){_0x10907f(_0x304478);return;})['catch'](function(_0x4a72f0){_0x31700c(_0x4a72f0);});});}function checkLicense(_0x3d885c,_0x41ca76){if(!_0x3d885c){demoLicense[_0x8f85('0xc')]=_0x3d885c[_0x8f85('0xd')];return demoLicense;}try{var _0x14fe1f=_0x41ca76||_0x3d885c['license'];if(_[_0x8f85('0xe')](_0x14fe1f)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x205751=_0x3d885c[_0x8f85('0xd')];var _0x5a9e70=_0x3d885c[_0x8f85('0xf')];var _0x3b51e1=_0x205751['split']('-')[0x4];var _0x3989ef=_0x205751[_0x8f85('0x10')]('-')[0x0];var _0x446499=encryptor[_0x8f85('0x11')](_0x14fe1f,util[_0x8f85('0x12')](_0x8f85('0x13'),_0x3b51e1,_0x205751,_0x3989ef));var _0x5a61b7=JSON[_0x8f85('0x14')](_0x446499);_0x5a61b7[_0x8f85('0x15')]=![];_0x5a61b7[_0x8f85('0xc')]=_0x205751;_0x5a61b7[_0x8f85('0x16')]=hardware['getUuid']();if(_0x5a9e70){var _0x265ae8=encryptor[_0x8f85('0x11')](_0x5a9e70);_0x5a61b7[_0x8f85('0x17')]=_0x265ae8;_0x5a61b7[_0x8f85('0x18')]=moment(_0x265ae8)['add'](0x7,_0x8f85('0x19'))[_0x8f85('0x12')]();_0x5a61b7[_0x8f85('0x1a')]=_0x5a61b7[_0x8f85('0xc')]!=_0x5a61b7['machineUuid']?_0x8f85('0x1b'):_0x8f85('0x1c');}return _0x5a61b7;}catch(_0x78c307){breakingLicense[_0x8f85('0xc')]=_0x3d885c[_0x8f85('0xd')];breakingLicense[_0x8f85('0x1d')]=_0x78c307[_0x8f85('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x29d136,_0x34d47d){getLicense()[_0x8f85('0xb')](function(_0xd685e5){return db[_0x8f85('0x1e')][_0x8f85('0x1f')]({'attributes':[_0x8f85('0x20'),[db[_0x8f85('0x21')]['fn']('COUNT',db[_0x8f85('0x21')]['col'](_0x8f85('0x20'))),_0x8f85('0x22')]],'group':'role','where':{'role':{'$or':[_0x8f85('0x23'),'user','telephone']}},'raw':!![]})['then'](function(_0x3416f7){var _0x361007={'user':_0xd685e5[_0x8f85('0x24')]||0x0,'telephone':_0xd685e5[_0x8f85('0x25')]||0x0};_0x3416f7[_0x8f85('0x26')](function(_0x207ca9){var _0x540610=_0x207ca9[_0x8f85('0x20')]===_0x8f85('0x23')?_0x8f85('0x27'):_0x207ca9[_0x8f85('0x20')];_0x361007[_0x540610]-=_0x207ca9['count'];if(_0x361007[_0x540610]<0x0)_0x361007[_0x540610]=0x0;});_0x29d136(_0x361007);return;});})[_0x8f85('0x28')](function(_0x1aec0e){_0x34d47d(_0x1aec0e);});});}function checkUserLimits(_0x3bdfd9){return new BPromise(function(_0x14b2d6,_0x2bb5b9){getLimits()[_0x8f85('0xb')](function(_0x3ab1a0){var _0x2556c5=_[_0x8f85('0x29')](_[_0x8f85('0x2a')](_0x3bdfd9,_0x8f85('0x20')),[_0x8f85('0x23'),_0x8f85('0x27'),_0x8f85('0x2b')]);var _0x4d1fcf=(_0x2556c5['admin']||0x0)+(_0x2556c5[_0x8f85('0x27')]||0x0);var _0x252af8=_0x2556c5['telephone']||0x0;if(_0x4d1fcf>_0x3ab1a0[_0x8f85('0x27')])return _0x2bb5b9('License\x20limit\x20reached\x20for\x20users');if(_0x252af8>_0x3ab1a0[_0x8f85('0x2b')])return _0x2bb5b9(_0x8f85('0x2c'));return _0x14b2d6();})[_0x8f85('0x28')](function(_0xd1d9ae){_0x2bb5b9(_0xd1d9ae);});});}module[_0x8f85('0x2d')]={'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 553ddd1..3f5254a 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 _0x5b12=['http://localhost:9000','myappanuglar-secret','secret','exports'];(function(_0xcf807,_0x4c736b){var _0x2ef9e9=function(_0x33ed42){while(--_0x33ed42){_0xcf807['push'](_0xcf807['shift']());}};_0x2ef9e9(++_0x4c736b);}(_0x5b12,0xa3));var _0x25b1=function(_0x5e651b,_0x1c223f){_0x5e651b=_0x5e651b-0x0;var _0xd0b6c5=_0x5b12[_0x5e651b];return _0xd0b6c5;};'use strict';module[_0x25b1('0x0')]={'DOMAIN':_0x25b1('0x1'),'SESSION_SECRET':_0x25b1('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x25b1('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xbbbc=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x2f67cf,_0x28f7bb){var _0x599e53=function(_0x12b9d8){while(--_0x12b9d8){_0x2f67cf['push'](_0x2f67cf['shift']());}};_0x599e53(++_0x28f7bb);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x24681b,_0x31424e){_0x24681b=_0x24681b-0x0;var _0x10d992=_0xbbbc[_0x24681b];return _0x10d992;};'use strict';module[_0xcbbb('0x0')]={'DOMAIN':_0xcbbb('0x1'),'SESSION_SECRET':_0xcbbb('0x2'),'GOOGLE_ID':_0xcbbb('0x3'),'GOOGLE_SECRET':_0xcbbb('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index b7c6bee..bd12484 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bef=['exports','Logger','transports','File','error','%s-%s','info','Console','debugLevel','moment','winston','util','path','INFO','join','/var','log','format','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase'];(function(_0x54c715,_0xd765a5){var _0x48b500=function(_0x28539c){while(--_0x28539c){_0x54c715['push'](_0x54c715['shift']());}};_0x48b500(++_0xd765a5);}(_0x4bef,0x129));var _0xf4be=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x4bef[_0x2be8c2];return _0x97f531;};'use strict';var moment=require(_0xf4be('0x0'));var winston=require(_0xf4be('0x1'));var util=require(_0xf4be('0x2'));var path=require(_0xf4be('0x3'));var debugLevel=_0xf4be('0x4');function filename(_0x5be799,_0x1bed79){return path[_0xf4be('0x5')](_0xf4be('0x6'),_0xf4be('0x7'),'xcally',util[_0xf4be('0x8')]('%s-%s.log',_0x5be799,_0x1bed79));}function formatter(_0x1f1dde,_0x16286f){_0x16286f[_0xf4be('0x9')]=_0x16286f[_0xf4be('0x9')][_0xf4be('0xa')](/@@{/g,_0xf4be('0xb'))[_0xf4be('0xa')](/}@@/g,'}}}')[_0xf4be('0xa')](/@{/g,'{{')[_0xf4be('0xa')](/}@/g,'}}');return util[_0xf4be('0x8')](_0xf4be('0xc'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x16286f[_0xf4be('0xd')][_0xf4be('0xe')](),_0x1f1dde,_0x16286f[_0xf4be('0x9')]);}module[_0xf4be('0xf')]=function(_0x56b707){return new winston[(_0xf4be('0x10'))]({'transports':[new winston[(_0xf4be('0x11'))][(_0xf4be('0x12'))]({'name':util[_0xf4be('0x8')]('%s-%s',_0x56b707,_0xf4be('0x13')),'filename':filename(_0x56b707,'error'),'level':_0xf4be('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5afa62){return formatter(_0x56b707,_0x5afa62);}}),new winston[(_0xf4be('0x11'))]['File']({'name':util['format'](_0xf4be('0x14'),_0x56b707,_0xf4be('0x15')),'filename':filename(_0x56b707,_0xf4be('0x15')),'level':_0xf4be('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xff8c3b){return formatter(_0x56b707,_0xff8c3b);}}),new winston[(_0xf4be('0x11'))][(_0xf4be('0x16'))]({'level':process['env'][_0xf4be('0x17')]||debugLevel,'json':![],'formatter':function(_0x409ee8){return formatter(_0x56b707,_0x409ee8);}})]});}; \ No newline at end of file +var _0x761c=['transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','join','/var','xcally','%s-%s.log','message','replace','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x761c,0x1e8));var _0xc761=function(_0x333f3c,_0x26fd61){_0x333f3c=_0x333f3c-0x0;var _0x572190=_0x761c[_0x333f3c];return _0x572190;};'use strict';var moment=require(_0xc761('0x0'));var winston=require(_0xc761('0x1'));var util=require(_0xc761('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x21c076,_0x9bcb78){return path[_0xc761('0x3')](_0xc761('0x4'),'log',_0xc761('0x5'),util['format'](_0xc761('0x6'),_0x21c076,_0x9bcb78));}function formatter(_0x51c3ce,_0x24bfe2){_0x24bfe2[_0xc761('0x7')]=_0x24bfe2[_0xc761('0x7')][_0xc761('0x8')](/@@{/g,'{{{')['replace'](/}@@/g,_0xc761('0x9'))[_0xc761('0x8')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xc761('0xa')](_0xc761('0xb'),moment()[_0xc761('0xa')](_0xc761('0xc')),_0x24bfe2['level'][_0xc761('0xd')](),_0x51c3ce,_0x24bfe2[_0xc761('0x7')]);}module[_0xc761('0xe')]=function(_0x525bfc){return new winston[(_0xc761('0xf'))]({'transports':[new winston[(_0xc761('0x10'))][(_0xc761('0x11'))]({'name':util[_0xc761('0xa')](_0xc761('0x12'),_0x525bfc,_0xc761('0x13')),'filename':filename(_0x525bfc,_0xc761('0x13')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xfcd29d){return formatter(_0x525bfc,_0xfcd29d);}}),new winston[(_0xc761('0x10'))][(_0xc761('0x11'))]({'name':util[_0xc761('0xa')](_0xc761('0x12'),_0x525bfc,_0xc761('0x14')),'filename':filename(_0x525bfc,_0xc761('0x14')),'level':_0xc761('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x18e5b1){return formatter(_0x525bfc,_0x18e5b1);}}),new winston[(_0xc761('0x10'))][(_0xc761('0x15'))]({'level':process[_0xc761('0x16')][_0xc761('0x17')]||debugLevel,'json':![],'formatter':function(_0x3fe4a0){return formatter(_0x525bfc,_0x3fe4a0);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index cd43589..4e01cd5 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 _0x1ac4=['path','express','join','ami','email','../../services/email/index.js','../../services/xdr/index.js','exports'];(function(_0x1f3890,_0x2f9aad){var _0x4af351=function(_0xd4cdfa){while(--_0xd4cdfa){_0x1f3890['push'](_0x1f3890['shift']());}};_0x4af351(++_0x2f9aad);}(_0x1ac4,0x118));var _0x41ac=function(_0x2a0fd3,_0x3fcf1e){_0x2a0fd3=_0x2a0fd3-0x0;var _0x1ad887=_0x1ac4[_0x2a0fd3];return _0x1ad887;};'use strict';var path=require(_0x41ac('0x0'));var os=require('os');var config={'apps':[{'name':_0x41ac('0x1'),'script':path[_0x41ac('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x41ac('0x3'),'script':path[_0x41ac('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x41ac('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x41ac('0x4'),'script':path['join'](__dirname,_0x41ac('0x5'))},{'name':'routing','script':path['join'](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0x41ac('0x2')](__dirname,_0x41ac('0x6'))}]};module[_0x41ac('0x7')]=config; \ No newline at end of file +var _0xaf3a=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','join','../../services/express/index.js','ami'];(function(_0x2604c0,_0x48b77d){var _0x2f3b4a=function(_0x3d0030){while(--_0x3d0030){_0x2604c0['push'](_0x2604c0['shift']());}};_0x2f3b4a(++_0x48b77d);}(_0xaf3a,0x75));var _0xaaf3=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0xaf3a[_0x31a576];return _0x30b1d3;};'use strict';var path=require(_0xaaf3('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xaaf3('0x1')](__dirname,_0xaaf3('0x2'))},{'name':_0xaaf3('0x3'),'script':path['join'](__dirname,_0xaaf3('0x4'))},{'name':_0xaaf3('0x5'),'script':path[_0xaaf3('0x1')](__dirname,_0xaaf3('0x6'))},{'name':_0xaaf3('0x7'),'script':path[_0xaaf3('0x1')](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0xaaf3('0x1')](__dirname,_0xaaf3('0x8'))},{'name':_0xaaf3('0x9'),'script':path[_0xaaf3('0x1')](__dirname,_0xaaf3('0xa'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 9fb2e7a..097d507 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 _0xaed7=['stop','restart','list','describe','delete','dump','saved','bluebird','connect','connected','start','then','disconnect'];(function(_0x354fa9,_0x58734f){var _0x1ef483=function(_0x5a6623){while(--_0x5a6623){_0x354fa9['push'](_0x354fa9['shift']());}};_0x1ef483(++_0x58734f);}(_0xaed7,0x13f));var _0x7aed=function(_0x3310fb,_0x19568c){_0x3310fb=_0x3310fb-0x0;var _0x511750=_0xaed7[_0x3310fb];return _0x511750;};'use strict';var pm2=require('pm2');var BPromise=require(_0x7aed('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x40c40d,_0x579460){return pm2[_0x7aed('0x1')](function(_0x32e933){if(_0x32e933){return _0x579460(_0x32e933);}return _0x40c40d(_0x7aed('0x2'));});});};exports[_0x7aed('0x3')]=function(_0x1c2ecd){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x5029ce,_0x142823){return pm2[_0x7aed('0x3')](_0x1c2ecd,function(_0x4f5ac1,_0x4a7f4a){if(_0x4f5ac1){return _0x142823(_0x4f5ac1);}pm2[_0x7aed('0x5')]();return _0x5029ce(_0x4a7f4a);});});});};exports['stop']=function(_0x57f435){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x4b558a,_0x17cbf0){return pm2[_0x7aed('0x6')](_0x57f435,function(_0x3335b7,_0x401ba4){if(_0x3335b7){return _0x17cbf0(_0x3335b7);}pm2[_0x7aed('0x5')]();return _0x4b558a(_0x401ba4);});});});};exports[_0x7aed('0x7')]=function(_0x160f00){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x3f7082,_0xc35505){return pm2[_0x7aed('0x7')](_0x160f00,function(_0x5503d0,_0x4ad529){if(_0x5503d0){return _0xc35505(_0x5503d0);}pm2[_0x7aed('0x5')]();return _0x3f7082(_0x4ad529);});});});};exports[_0x7aed('0x8')]=function(){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x2b579e,_0x4da35c){return pm2[_0x7aed('0x8')](function(_0x2b09bd,_0x5a5f4d){if(_0x2b09bd){return _0x4da35c(_0x2b09bd);}pm2[_0x7aed('0x5')]();return _0x2b579e(_0x5a5f4d);});});});};exports['describe']=function(_0x458f1b){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x482843,_0x2169eb){return pm2[_0x7aed('0x9')](_0x458f1b,function(_0x303f4b,_0x3ef080){if(_0x303f4b){return _0x2169eb(_0x303f4b);}pm2[_0x7aed('0x5')]();return _0x482843(_0x3ef080);});});});};exports['delete']=function(_0x5c81f1){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x43e47b,_0x4e8434){return pm2[_0x7aed('0xa')](_0x5c81f1,function(_0x5b1398,_0x3efb40){if(_0x5b1398){return _0x4e8434(_0x5b1398);}pm2[_0x7aed('0x5')]();return _0x43e47b(_0x3efb40);});});});};exports[_0x7aed('0xb')]=function(){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x450a98,_0x349f9e){return pm2[_0x7aed('0xb')](function(_0x495d59){if(_0x495d59){return _0x349f9e(_0x495d59);}return _0x450a98(_0x7aed('0xc'));});});});}; \ No newline at end of file +var _0x4a15=['describe','delete','dump','saved','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a15,0xc8));var _0x54a1=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0x4a15[_0x13594e];return _0x1a4f42;};'use strict';var pm2=require('pm2');var BPromise=require(_0x54a1('0x0'));var config=require(_0x54a1('0x1'));function connect(){return new BPromise(function(_0x5b4dc4,_0x22b732){return pm2[_0x54a1('0x2')](function(_0x5758a0){if(_0x5758a0){return _0x22b732(_0x5758a0);}return _0x5b4dc4(_0x54a1('0x3'));});});};exports[_0x54a1('0x4')]=function(_0x13c502){return connect()[_0x54a1('0x5')](function(){return new BPromise(function(_0x11dcc3,_0x2bc2c4){return pm2[_0x54a1('0x4')](_0x13c502,function(_0x141f13,_0x40179a){if(_0x141f13){return _0x2bc2c4(_0x141f13);}pm2[_0x54a1('0x6')]();return _0x11dcc3(_0x40179a);});});});};exports[_0x54a1('0x7')]=function(_0x5f055b){return connect()[_0x54a1('0x5')](function(){return new BPromise(function(_0x5f3e41,_0x11053a){return pm2[_0x54a1('0x7')](_0x5f055b,function(_0x57ab43,_0x1a4bcb){if(_0x57ab43){return _0x11053a(_0x57ab43);}pm2[_0x54a1('0x6')]();return _0x5f3e41(_0x1a4bcb);});});});};exports['restart']=function(_0x30dc69){return connect()['then'](function(){return new BPromise(function(_0x97eb65,_0x320ed6){return pm2[_0x54a1('0x8')](_0x30dc69,function(_0x5cd40d,_0x41e733){if(_0x5cd40d){return _0x320ed6(_0x5cd40d);}pm2[_0x54a1('0x6')]();return _0x97eb65(_0x41e733);});});});};exports['list']=function(){return connect()[_0x54a1('0x5')](function(){return new BPromise(function(_0x4dcf80,_0x11bfdc){return pm2[_0x54a1('0x9')](function(_0x58889a,_0x24b088){if(_0x58889a){return _0x11bfdc(_0x58889a);}pm2['disconnect']();return _0x4dcf80(_0x24b088);});});});};exports['describe']=function(_0x1a01c0){return connect()[_0x54a1('0x5')](function(){return new BPromise(function(_0x39bec1,_0x2fe903){return pm2[_0x54a1('0xa')](_0x1a01c0,function(_0x9611a3,_0x2ef2b8){if(_0x9611a3){return _0x2fe903(_0x9611a3);}pm2[_0x54a1('0x6')]();return _0x39bec1(_0x2ef2b8);});});});};exports[_0x54a1('0xb')]=function(_0x657b8b){return connect()['then'](function(){return new BPromise(function(_0x104b10,_0x49905a){return pm2[_0x54a1('0xb')](_0x657b8b,function(_0x149e1a,_0x3559d4){if(_0x149e1a){return _0x49905a(_0x149e1a);}pm2['disconnect']();return _0x104b10(_0x3559d4);});});});};exports[_0x54a1('0xc')]=function(){return connect()[_0x54a1('0x5')](function(){return new BPromise(function(_0x4602aa,_0x50d173){return pm2[_0x54a1('0xc')](function(_0x230a05){if(_0x230a05){return _0x50d173(_0x230a05);}return _0x4602aa(_0x54a1('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index a54ae09..491c78b 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 _0x15d6=['findAll','lastMsgAt','subtract','chatTimeout','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','YYYY-MM-DD\x20HH:mm:ss','length','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment','ioredis','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','Setting','find','then','ChatInteraction'];(function(_0x108b9e,_0x5e73e8){var _0x33bef6=function(_0x46bb4b){while(--_0x46bb4b){_0x108b9e['push'](_0x108b9e['shift']());}};_0x33bef6(++_0x5e73e8);}(_0x15d6,0xec));var _0x615d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x15d6[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0x615d('0x0'));var Redis=require(_0x615d('0x1'));var util=require('util');var config=require(_0x615d('0x2'));var db=require(_0x615d('0x3'))['db'];var logger=require('../logger')(_0x615d('0x4'));config[_0x615d('0x5')]=_[_0x615d('0x6')](config[_0x615d('0x5')],{'host':_0x615d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x615d('0x5')]));function closeInteractions(){var _0x29978b=0x0;var _0x1e0d03=[];return db[_0x615d('0x8')][_0x615d('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x615d('0xa')](function(_0x1547e6){_0x29978b=_0x1547e6['chatTimeout'];if(_0x29978b){return db[_0x615d('0xb')][_0x615d('0xc')]({'raw':!![],'attributes':['id',_0x615d('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x615d('0xe')](_0x1547e6[_0x615d('0xf')],_0x615d('0x10'))}}});}else{return[];}})[_0x615d('0xa')](function(_0x1ae036){if(_0x1ae036&&_0x1ae036['length']){_0x1e0d03=_[_0x615d('0x11')](_0x1ae036||[],'id');logger[_0x615d('0x12')](_0x615d('0x13'),_0x1e0d03['join']());return db[_0x615d('0xb')][_0x615d('0x14')]({'closeReason':_0x615d('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x615d('0x16'))},{'where':{'id':_0x1e0d03}});}})['then'](function(){if(_0x1e0d03&&_0x1e0d03[_0x615d('0x17')]){logger[_0x615d('0x12')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x1e0d03[_0x615d('0x18')]());for(var _0x3f6886=0x0;_0x3f6886<_0x1e0d03[_0x615d('0x17')];_0x3f6886++){io[_0x615d('0x19')](_0x615d('0x1a'),{'id':_0x1e0d03[_0x3f6886],'closed':!![]});}}})[_0x615d('0x1b')](function(_0x205dc6){logger[_0x615d('0x1c')](_0x615d('0x1d'),_0x205dc6?util['inspect'](_0x205dc6,{'showHidden':![],'depth':null}):'');});}exports[_0x615d('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4e64=['start','moment','ioredis','util','../../config/environment','../logger','schedule','defaults','redis','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','join','length','emit','chatInteraction:update','catch','error','inspect'];(function(_0x48c147,_0x492051){var _0x3de81c=function(_0x1bc2aa){while(--_0x1bc2aa){_0x48c147['push'](_0x48c147['shift']());}};_0x3de81c(++_0x492051);}(_0x4e64,0x79));var _0x44e6=function(_0xe04ebf,_0x5b44cd){_0xe04ebf=_0xe04ebf-0x0;var _0x36256f=_0x4e64[_0xe04ebf];return _0x36256f;};'use strict';var _=require('lodash');var moment=require(_0x44e6('0x0'));var Redis=require(_0x44e6('0x1'));var util=require(_0x44e6('0x2'));var config=require(_0x44e6('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x44e6('0x4'))(_0x44e6('0x5'));config['redis']=_[_0x44e6('0x6')](config[_0x44e6('0x7')],{'host':_0x44e6('0x8'),'port':0x18eb});var io=require(_0x44e6('0x9'))(new Redis(config[_0x44e6('0x7')]));function closeInteractions(){var _0x5b891c=0x0;var _0x76cb05=[];return db[_0x44e6('0xa')]['find']({'raw':!![],'attributes':['id',_0x44e6('0xb')],'where':{'id':0x1}})[_0x44e6('0xc')](function(_0x510c77){_0x5b891c=_0x510c77[_0x44e6('0xb')];if(_0x5b891c){return db[_0x44e6('0xd')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x510c77[_0x44e6('0xb')],_0x44e6('0xe'))}}});}else{return[];}})[_0x44e6('0xc')](function(_0x284d1b){if(_0x284d1b&&_0x284d1b['length']){_0x76cb05=_['map'](_0x284d1b||[],'id');logger[_0x44e6('0xf')](_0x44e6('0x10'),_0x76cb05['join']());return db[_0x44e6('0xd')][_0x44e6('0x11')]({'closeReason':_0x44e6('0x12'),'disposition':_0x44e6('0x13'),'closed':!![],'closedAt':moment()[_0x44e6('0x14')](_0x44e6('0x15'))},{'where':{'id':_0x76cb05}});}})['then'](function(){if(_0x76cb05&&_0x76cb05['length']){logger[_0x44e6('0xf')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x76cb05[_0x44e6('0x16')]());for(var _0x9d82a8=0x0;_0x9d82a8<_0x76cb05[_0x44e6('0x17')];_0x9d82a8++){io[_0x44e6('0x18')](_0x44e6('0x19'),{'id':_0x76cb05[_0x9d82a8],'closed':!![]});}}})[_0x44e6('0x1a')](function(_0x870960){logger[_0x44e6('0x1b')]('[CHAT]\x20Error\x20closing\x20interactions',_0x870960?util[_0x44e6('0x1c')](_0x870960,{'showHidden':![],'depth':null}):'');});}exports[_0x44e6('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index f1ef66c..6f82ba3 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 _0x6d94=['\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','endAt','add\x20cron','stop\x20cron','active','isBetween','startAt','update','update\x20cron','util','path','lodash','moment','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','host','MailAccount','port','secure','authentication','auth','user','format'];(function(_0x2511c6,_0x5859ca){var _0x10a803=function(_0x3fb3a2){while(--_0x3fb3a2){_0x2511c6['push'](_0x2511c6['shift']());}};_0x10a803(++_0x5859ca);}(_0x6d94,0x1a5));var _0x46d9=function(_0x3b2a08,_0xffae5d){_0x3b2a08=_0x3b2a08-0x0;var _0x1339a6=_0x6d94[_0x3b2a08];return _0x1339a6;};'use strict';var fs=require('fs');var util=require(_0x46d9('0x0'));var path=require(_0x46d9('0x1'));var _=require(_0x46d9('0x2'));var moment=require(_0x46d9('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x46d9('0x4'));var logger=require('../logger')(_0x46d9('0x5'));var db=require(_0x46d9('0x6'))['db'];var analyticCustomReportController=require(_0x46d9('0x7'));var analyticDefaultReportController=require(_0x46d9('0x8'));var client=jayson[_0x46d9('0x9')][_0x46d9('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xff7926,_0x36d74e){return function(){logger[_0x46d9('0xb')](_0x46d9('0xc'),_0xff7926[_0x46d9('0xd')]);var _0x20018a=!![];var _0x36fb45={'tls':{'rejectUnauthorized':![]}};if(_0xff7926['MailAccount'][_0x46d9('0xe')][_0x46d9('0xf')]){_0x36fb45[_0x46d9('0xf')]=_0xff7926['MailAccount'][_0x46d9('0xe')]['service'];}else{_0x36fb45[_0x46d9('0x10')]=_0xff7926[_0x46d9('0x11')][_0x46d9('0xe')][_0x46d9('0x10')];_0x36fb45['port']=_0xff7926['MailAccount'][_0x46d9('0xe')][_0x46d9('0x12')];_0x36fb45[_0x46d9('0x13')]=_0xff7926[_0x46d9('0x11')][_0x46d9('0xe')][_0x46d9('0x13')];}if(_0xff7926['MailAccount'][_0x46d9('0xe')][_0x46d9('0x14')]){_0x36fb45[_0x46d9('0x15')]={'user':_0xff7926[_0x46d9('0x11')][_0x46d9('0xe')][_0x46d9('0x16')],'pass':_0xff7926[_0x46d9('0x11')][_0x46d9('0xe')]['pass']};}var _0x24497d={'account':_0x36fb45,'message':{'from':util[_0x46d9('0x17')](_0x46d9('0x18'),_0xff7926[_0x46d9('0x11')][_0x46d9('0x19')],_0xff7926[_0x46d9('0x11')]['email']||_0xff7926['MailAccount'][_0x46d9('0xe')][_0x46d9('0x16')]),'to':_0xff7926['email'],'cc':_0xff7926['cc'],'bcc':_0xff7926['bcc'],'subject':util[_0x46d9('0x17')](_0x46d9('0x1a'),_0x36d74e['name'],_0xff7926[_0x46d9('0x1b')],_0xff7926[_0x46d9('0x1c')])}};var _0x38cac6=path[_0x46d9('0x1d')](__dirname,'../../files/reports');var _0x48d787=_0x36d74e[_0x46d9('0x1e')];var _0x40e6d1=util['format'](_0x46d9('0x1f'),path[_0x46d9('0x20')](_0x36d74e[_0x46d9('0x1e')],path[_0x46d9('0x21')](_0x36d74e[_0x46d9('0x1e')])),_0x46d9('0x22'));var _0x3d6f61=path[_0x46d9('0x1d')](_0x38cac6,_0x48d787);var _0x159d1c=path[_0x46d9('0x1d')](_0x38cac6,_0x40e6d1);if(fs[_0x46d9('0x23')](_0x3d6f61)){_0x36d74e[_0x46d9('0x24')]='Sent';_0x24497d[_0x46d9('0x25')][_0x46d9('0x26')]=[{'filename':_0x48d787,'path':_0x3d6f61}];_0x24497d['message'][_0x46d9('0x27')]=util[_0x46d9('0x17')](_0x46d9('0x28'),JSON['stringify'](_0x36d74e,null,0x2));}else if(fs[_0x46d9('0x23')](_0x159d1c)){_0x36d74e['status']=_0x46d9('0x29');_0x24497d['message'][_0x46d9('0x26')]=[{'filename':_0x40e6d1,'path':_0x159d1c}];}else{_0x24497d['message'][_0x46d9('0x27')]=_0x46d9('0x2a');if(!_0xff7926[_0x46d9('0x2b')]){_0x20018a=![];logger[_0x46d9('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x20018a){return client[_0x46d9('0x2c')](_0x46d9('0x2d'),_0x24497d)[_0x46d9('0x2e')](function(_0xbd6349){if(_0xbd6349[_0x46d9('0x2f')]){return logger[_0x46d9('0x2f')]('error\x20mail',JSON[_0x46d9('0x30')](_0xbd6349));}return logger[_0x46d9('0xb')](_0x46d9('0x31'));})[_0x46d9('0x32')](function(_0x559a82){return logger[_0x46d9('0x2f')]('error\x20mail',JSON[_0x46d9('0x30')](_0x559a82));});}};}function handleError(){return function(_0x2bd975){return logger[_0x46d9('0x2f')](JSON[_0x46d9('0x30')](_0x2bd975));};}function handleResult(_0x1b36c9){return function(_0x19dd67){logger[_0x46d9('0xb')](_0x46d9('0x33'),JSON[_0x46d9('0x30')](_0x19dd67));if(_0x1b36c9['MailAccount']&&_0x1b36c9[_0x46d9('0x11')]['Smtp']&&!_[_0x46d9('0x34')](_0x1b36c9[_0x46d9('0xd')])){setTimeout(handleSendEmail(_0x1b36c9,_0x19dd67),0x3c*0x3e8);}};}function handleJob(_0x420135){return function(){try{if(_['isNil'](_0x420135[_0x46d9('0x1b')])){return logger[_0x46d9('0xb')](_0x46d9('0x35'));}if(_[_0x46d9('0x34')](_0x420135[_0x46d9('0x1c')])){return logger[_0x46d9('0xb')](_0x46d9('0x36'));}var _0x3f8182={'startDate':moment()['subtract'](_0x420135[_0x46d9('0x1b')],_0x420135['subtractUnit'])[_0x46d9('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x46d9('0x17')](_0x46d9('0x37')),'type':'scheduled','output':_0x420135[_0x46d9('0x38')],'name':_0x420135['name']};if(!_['isNil'](_0x420135[_0x46d9('0x39')])){logger[_0x46d9('0xb')](_0x46d9('0x3a'),_0x420135[_0x46d9('0x39')]);return analyticDefaultReportController['runReport']({'id':_0x420135[_0x46d9('0x39')]},_0x3f8182)['then'](handleResult(_0x420135))[_0x46d9('0x32')](handleError());}if(!_[_0x46d9('0x34')](_0x420135[_0x46d9('0x3b')])){logger[_0x46d9('0xb')]('exec\x20custom\x20report\x20id:%s',_0x420135[_0x46d9('0x3b')]);return analyticCustomReportController[_0x46d9('0x3c')]({'id':_0x420135['CustomReportId']},_0x3f8182)['then'](handleResult(_0x420135))[_0x46d9('0x32')](handleError());}}catch(_0x3dcb02){logger[_0x46d9('0x2f')](JSON[_0x46d9('0x30')](_0x3dcb02));}return logger[_0x46d9('0xb')](_0x46d9('0x3d'));};}function getJobs(_0xaf5fd3){var _0x3141cb={};if(_0xaf5fd3){_0x3141cb['id']=_0xaf5fd3;}return db[_0x46d9('0x3e')]['findAll']({'where':_0x3141cb,'include':[{'model':db[_0x46d9('0x11')],'attributes':['id',_0x46d9('0x19'),'email'],'include':[{'model':db[_0x46d9('0x3f')],'as':_0x46d9('0xe')}]}]})[_0x46d9('0x2e')](function(_0x498b5e){var _0x27215d=_[_0x46d9('0x40')](manager[_0x46d9('0x41')]);var _0x1d8fe5=_[_0x46d9('0x42')](_0x498b5e,function(_0x39d1dc){return _0x39d1dc['id'][_0x46d9('0x43')]();});var _0x1b8242=_[_0x46d9('0x44')](_0x498b5e,function(_0x32770f){return _0x32770f['id'][_0x46d9('0x43')]();});var _0x1b161a=_0xaf5fd3?_0x1d8fe5:_[_0x46d9('0x45')](_0x1d8fe5,_0x27215d);var _0x58d722=_[_0x46d9('0x46')](_0x1d8fe5,_0x27215d);var _0x15b593=_[_0x46d9('0x45')](_0x27215d,_0x1d8fe5);var _0x3c496f;var _0x46da43;for(_0x3c496f=0x0;_0x3c496f<_0x15b593[_0x46d9('0x47')]&&!_0xaf5fd3;_0x3c496f+=0x1){_0x46da43=_0x15b593[_0x3c496f]['toString']();if(manager[_0x46d9('0x48')](_0x46da43)){manager[_0x46d9('0x49')](_0x46da43);manager[_0x46d9('0x4a')](_0x46da43);logger[_0x46d9('0xb')](_0x46d9('0x4b'),_0x46da43);}}logger[_0x46d9('0xb')](_0x46d9('0x4c'),JSON[_0x46d9('0x30')](_0x1b161a));for(_0x3c496f=0x0;_0x3c496f<_0x1b161a[_0x46d9('0x47')];_0x3c496f+=0x1){_0x46da43=_0x1b161a[_0x3c496f]['toString']();logger[_0x46d9('0xb')](_0x46d9('0x4d'),_0x46da43);if(_0xaf5fd3){logger[_0x46d9('0xb')](_0x46d9('0x4e'),_0xaf5fd3);logger[_0x46d9('0xb')](JSON['stringify'](_0x1b8242[_0x46da43]));BPromise['resolve']()[_0x46d9('0x2e')](handleJob(_0x1b8242[_0x46da43]));logger[_0x46d9('0xb')](_0x46d9('0x4f'),_0x1b8242[_0x46da43]['name'],_0x1b8242[_0x46da43][_0x46d9('0x50')]);}else if(_0x1b8242[_0x46da43][_0x46d9('0x50')]&&_0x1b8242[_0x46da43]['active']&&moment()['isBetween'](_0x1b8242[_0x46da43]['startAt'],_0x1b8242[_0x46da43][_0x46d9('0x51')])){manager['add'](_0x46da43,_0x1b8242[_0x46da43][_0x46d9('0x50')],handleJob(_0x1b8242[_0x46da43]));manager['start'](_0x46da43);logger[_0x46d9('0xb')](_0x46d9('0x52'),_0x1b8242[_0x46da43][_0x46d9('0x19')],_0x1b8242[_0x46da43][_0x46d9('0x50')]);}else if(manager[_0x46d9('0x48')](_0x46da43)){manager[_0x46d9('0x49')](_0x46da43);manager['deleteJob'](_0x46da43);logger[_0x46d9('0xb')](_0x46d9('0x53'),_0x1b8242[_0x46da43][_0x46d9('0x19')],_0x1b8242[_0x46da43][_0x46d9('0x50')]);}}for(_0x3c496f=0x0,_0x46da43;_0x3c496f<_0x58d722[_0x46d9('0x47')]&&!_0xaf5fd3;_0x3c496f+=0x1){_0x46da43=_0x58d722[_0x3c496f][_0x46d9('0x43')]();if(manager[_0x46d9('0x48')](_0x46da43)){if(_0x1b8242[_0x46da43][_0x46d9('0x50')]&&_0x1b8242[_0x46da43][_0x46d9('0x54')]&&moment()[_0x46d9('0x55')](_0x1b8242[_0x46da43][_0x46d9('0x56')],_0x1b8242[_0x46da43][_0x46d9('0x51')])){manager[_0x46d9('0x57')](_0x46da43,_0x1b8242[_0x46da43][_0x46d9('0x50')],handleJob(_0x1b8242[_0x46da43]));logger['info'](_0x46d9('0x58'),_0x1b8242[_0x46da43]['name'],_0x1b8242[_0x46da43][_0x46d9('0x50')]);}else{manager[_0x46d9('0x49')](_0x46da43);manager[_0x46d9('0x4a')](_0x46da43);logger['info'](_0x46d9('0x53'),_0x1b8242[_0x46da43][_0x46d9('0x19')],_0x1b8242[_0x46da43][_0x46d9('0x50')]);}}}})[_0x46d9('0x32')](function(_0x16efee){logger[_0x46d9('0x2f')](JSON[_0x46d9('0x30')](_0x16efee));});}exports['run']=function(_0x37d87c){return getJobs(_0x37d87c);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x0967=['join','../../files/reports','savename','format','basename','extname','zip','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','keys','jobs','keyBy','toString','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','active','update','run','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','service','MailAccount','Smtp','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','email','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit'];(function(_0x228412,_0x2bd9b9){var _0x424798=function(_0x3dd047){while(--_0x3dd047){_0x228412['push'](_0x228412['shift']());}};_0x424798(++_0x2bd9b9);}(_0x0967,0x155));var _0x7096=function(_0x595edc,_0x20ca61){_0x595edc=_0x595edc-0x0;var _0x1177e6=_0x0967[_0x595edc];return _0x1177e6;};'use strict';var fs=require('fs');var util=require(_0x7096('0x0'));var path=require(_0x7096('0x1'));var _=require(_0x7096('0x2'));var moment=require(_0x7096('0x3'));var CronJobManager=require(_0x7096('0x4'));var jayson=require(_0x7096('0x5'));var BPromise=require('bluebird');var logger=require(_0x7096('0x6'))(_0x7096('0x7'));var db=require(_0x7096('0x8'))['db'];var analyticCustomReportController=require(_0x7096('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x7096('0xa')][_0x7096('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2b9f19,_0x52ae0d){return function(){logger[_0x7096('0xc')](_0x7096('0xd'),_0x2b9f19['email']);var _0x7eae7c=!![];var _0x5bbf92={'tls':{'rejectUnauthorized':![]}};if(_0x2b9f19['MailAccount']['Smtp'][_0x7096('0xe')]){_0x5bbf92['service']=_0x2b9f19[_0x7096('0xf')][_0x7096('0x10')]['service'];}else{_0x5bbf92[_0x7096('0x11')]=_0x2b9f19[_0x7096('0xf')][_0x7096('0x10')]['host'];_0x5bbf92[_0x7096('0x12')]=_0x2b9f19['MailAccount'][_0x7096('0x10')][_0x7096('0x12')];_0x5bbf92[_0x7096('0x13')]=_0x2b9f19['MailAccount']['Smtp'][_0x7096('0x13')];}if(_0x2b9f19['MailAccount']['Smtp'][_0x7096('0x14')]){_0x5bbf92[_0x7096('0x15')]={'user':_0x2b9f19[_0x7096('0xf')]['Smtp']['user'],'pass':_0x2b9f19[_0x7096('0xf')][_0x7096('0x10')][_0x7096('0x16')]};}var _0x1bf3ac={'account':_0x5bbf92,'message':{'from':util['format'](_0x7096('0x17'),_0x2b9f19[_0x7096('0xf')]['name'],_0x2b9f19[_0x7096('0xf')][_0x7096('0x18')]||_0x2b9f19[_0x7096('0xf')]['Smtp'][_0x7096('0x19')]),'to':_0x2b9f19[_0x7096('0x18')],'cc':_0x2b9f19['cc'],'bcc':_0x2b9f19[_0x7096('0x1a')],'subject':util['format'](_0x7096('0x1b'),_0x52ae0d[_0x7096('0x1c')],_0x2b9f19[_0x7096('0x1d')],_0x2b9f19[_0x7096('0x1e')])}};var _0x5a2d0f=path[_0x7096('0x1f')](__dirname,_0x7096('0x20'));var _0x3854dd=_0x52ae0d[_0x7096('0x21')];var _0x56799c=util[_0x7096('0x22')]('%s.%s',path[_0x7096('0x23')](_0x52ae0d[_0x7096('0x21')],path[_0x7096('0x24')](_0x52ae0d[_0x7096('0x21')])),_0x7096('0x25'));var _0x2b0c69=path['join'](_0x5a2d0f,_0x3854dd);var _0x2d86be=path[_0x7096('0x1f')](_0x5a2d0f,_0x56799c);if(fs['existsSync'](_0x2b0c69)){_0x52ae0d[_0x7096('0x26')]=_0x7096('0x27');_0x1bf3ac['message'][_0x7096('0x28')]=[{'filename':_0x3854dd,'path':_0x2b0c69}];_0x1bf3ac[_0x7096('0x29')][_0x7096('0x2a')]=util[_0x7096('0x22')](_0x7096('0x2b'),JSON['stringify'](_0x52ae0d,null,0x2));}else if(fs[_0x7096('0x2c')](_0x2d86be)){_0x52ae0d[_0x7096('0x26')]=_0x7096('0x27');_0x1bf3ac[_0x7096('0x29')][_0x7096('0x28')]=[{'filename':_0x56799c,'path':_0x2d86be}];}else{_0x1bf3ac[_0x7096('0x29')][_0x7096('0x2a')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2b9f19[_0x7096('0x2d')]){_0x7eae7c=![];logger[_0x7096('0xc')](_0x7096('0x2e'));}}if(_0x7eae7c){return client[_0x7096('0x2f')](_0x7096('0x30'),_0x1bf3ac)[_0x7096('0x31')](function(_0x28f566){if(_0x28f566[_0x7096('0x32')]){return logger[_0x7096('0x32')](_0x7096('0x33'),JSON[_0x7096('0x34')](_0x28f566));}return logger['info'](_0x7096('0x35'));})[_0x7096('0x36')](function(_0x54b464){return logger[_0x7096('0x32')](_0x7096('0x33'),JSON[_0x7096('0x34')](_0x54b464));});}};}function handleError(){return function(_0x2cea5a){return logger['error'](JSON[_0x7096('0x34')](_0x2cea5a));};}function handleResult(_0x1ed63b){return function(_0x2d3bba){logger[_0x7096('0xc')](_0x7096('0x37'),JSON[_0x7096('0x34')](_0x2d3bba));if(_0x1ed63b[_0x7096('0xf')]&&_0x1ed63b[_0x7096('0xf')][_0x7096('0x10')]&&!_[_0x7096('0x38')](_0x1ed63b[_0x7096('0x18')])){setTimeout(handleSendEmail(_0x1ed63b,_0x2d3bba),0x3c*0x3e8);}};}function handleJob(_0x5800e6){return function(){try{if(_[_0x7096('0x38')](_0x5800e6[_0x7096('0x1d')])){return logger['info'](_0x7096('0x39'));}if(_[_0x7096('0x38')](_0x5800e6[_0x7096('0x1e')])){return logger[_0x7096('0xc')](_0x7096('0x3a'));}var _0x3e6de1={'startDate':moment()[_0x7096('0x3b')](_0x5800e6[_0x7096('0x1d')],_0x5800e6['subtractUnit'])['format'](_0x7096('0x3c')),'endDate':moment()[_0x7096('0x22')](_0x7096('0x3c')),'type':_0x7096('0x3d'),'output':_0x5800e6['output'],'name':_0x5800e6[_0x7096('0x1c')]};if(!_['isNil'](_0x5800e6[_0x7096('0x3e')])){logger[_0x7096('0xc')](_0x7096('0x3f'),_0x5800e6['DefaultReportId']);return analyticDefaultReportController[_0x7096('0x40')]({'id':_0x5800e6[_0x7096('0x3e')]},_0x3e6de1)[_0x7096('0x31')](handleResult(_0x5800e6))[_0x7096('0x36')](handleError());}if(!_[_0x7096('0x38')](_0x5800e6[_0x7096('0x41')])){logger[_0x7096('0xc')](_0x7096('0x42'),_0x5800e6[_0x7096('0x41')]);return analyticCustomReportController[_0x7096('0x40')]({'id':_0x5800e6[_0x7096('0x41')]},_0x3e6de1)[_0x7096('0x31')](handleResult(_0x5800e6))['catch'](handleError());}}catch(_0x99ace4){logger[_0x7096('0x32')](JSON[_0x7096('0x34')](_0x99ace4));}return logger[_0x7096('0xc')]('no\x20report\x20id');};}function getJobs(_0x166c1b){var _0x30cdb6={};if(_0x166c1b){_0x30cdb6['id']=_0x166c1b;}return db[_0x7096('0x43')][_0x7096('0x44')]({'where':_0x30cdb6,'include':[{'model':db[_0x7096('0xf')],'attributes':['id',_0x7096('0x1c'),_0x7096('0x18')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x7096('0x31')](function(_0x54eeba){var _0x110e89=_[_0x7096('0x45')](manager[_0x7096('0x46')]);var _0x1b00df=_['map'](_0x54eeba,function(_0x2b3c47){return _0x2b3c47['id']['toString']();});var _0x24f6f7=_[_0x7096('0x47')](_0x54eeba,function(_0xf35b0c){return _0xf35b0c['id'][_0x7096('0x48')]();});var _0x17045a=_0x166c1b?_0x1b00df:_['difference'](_0x1b00df,_0x110e89);var _0x2a12ec=_[_0x7096('0x49')](_0x1b00df,_0x110e89);var _0x176fbf=_[_0x7096('0x4a')](_0x110e89,_0x1b00df);var _0x51f4fd;var _0x3c2e12;for(_0x51f4fd=0x0;_0x51f4fd<_0x176fbf[_0x7096('0x4b')]&&!_0x166c1b;_0x51f4fd+=0x1){_0x3c2e12=_0x176fbf[_0x51f4fd]['toString']();if(manager[_0x7096('0x4c')](_0x3c2e12)){manager[_0x7096('0x4d')](_0x3c2e12);manager[_0x7096('0x4e')](_0x3c2e12);logger[_0x7096('0xc')](_0x7096('0x4f'),_0x3c2e12);}}logger[_0x7096('0xc')](_0x7096('0x50'),JSON[_0x7096('0x34')](_0x17045a));for(_0x51f4fd=0x0;_0x51f4fd<_0x17045a[_0x7096('0x4b')];_0x51f4fd+=0x1){_0x3c2e12=_0x17045a[_0x51f4fd][_0x7096('0x48')]();logger[_0x7096('0xc')](_0x7096('0x51'),_0x3c2e12);if(_0x166c1b){logger['info']('my\x20id',_0x166c1b);logger[_0x7096('0xc')](JSON['stringify'](_0x24f6f7[_0x3c2e12]));BPromise['resolve']()[_0x7096('0x31')](handleJob(_0x24f6f7[_0x3c2e12]));logger['info']('run\x20job',_0x24f6f7[_0x3c2e12]['name'],_0x24f6f7[_0x3c2e12][_0x7096('0x52')]);}else if(_0x24f6f7[_0x3c2e12][_0x7096('0x52')]&&_0x24f6f7[_0x3c2e12]['active']&&moment()[_0x7096('0x53')](_0x24f6f7[_0x3c2e12][_0x7096('0x54')],_0x24f6f7[_0x3c2e12][_0x7096('0x55')])){manager[_0x7096('0x56')](_0x3c2e12,_0x24f6f7[_0x3c2e12][_0x7096('0x52')],handleJob(_0x24f6f7[_0x3c2e12]));manager[_0x7096('0x57')](_0x3c2e12);logger[_0x7096('0xc')](_0x7096('0x58'),_0x24f6f7[_0x3c2e12][_0x7096('0x1c')],_0x24f6f7[_0x3c2e12][_0x7096('0x52')]);}else if(manager['exists'](_0x3c2e12)){manager[_0x7096('0x4d')](_0x3c2e12);manager['deleteJob'](_0x3c2e12);logger['info'](_0x7096('0x59'),_0x24f6f7[_0x3c2e12]['name'],_0x24f6f7[_0x3c2e12][_0x7096('0x52')]);}}for(_0x51f4fd=0x0,_0x3c2e12;_0x51f4fd<_0x2a12ec[_0x7096('0x4b')]&&!_0x166c1b;_0x51f4fd+=0x1){_0x3c2e12=_0x2a12ec[_0x51f4fd][_0x7096('0x48')]();if(manager[_0x7096('0x4c')](_0x3c2e12)){if(_0x24f6f7[_0x3c2e12][_0x7096('0x52')]&&_0x24f6f7[_0x3c2e12][_0x7096('0x5a')]&&moment()[_0x7096('0x53')](_0x24f6f7[_0x3c2e12][_0x7096('0x54')],_0x24f6f7[_0x3c2e12][_0x7096('0x55')])){manager[_0x7096('0x5b')](_0x3c2e12,_0x24f6f7[_0x3c2e12][_0x7096('0x52')],handleJob(_0x24f6f7[_0x3c2e12]));logger[_0x7096('0xc')]('update\x20cron',_0x24f6f7[_0x3c2e12][_0x7096('0x1c')],_0x24f6f7[_0x3c2e12][_0x7096('0x52')]);}else{manager[_0x7096('0x4d')](_0x3c2e12);manager[_0x7096('0x4e')](_0x3c2e12);logger[_0x7096('0xc')]('stop\x20cron',_0x24f6f7[_0x3c2e12][_0x7096('0x1c')],_0x24f6f7[_0x3c2e12][_0x7096('0x52')]);}}}})[_0x7096('0x36')](function(_0x5c256f){logger[_0x7096('0x32')](JSON['stringify'](_0x5c256f));});}exports[_0x7096('0x5c')]=function(_0x4585f4){return getJobs(_0x4585f4);};exports[_0x7096('0x57')]=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 739289c..9783ac9 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 _0x3c1a=['getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','Positive','SentimentScore','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','COMPLETED','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','push','all','catch','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger'];(function(_0x31ae8c,_0x43e96a){var _0x38d150=function(_0x3c7ba9){while(--_0x3c7ba9){_0x31ae8c['push'](_0x31ae8c['shift']());}};_0x38d150(++_0x43e96a);}(_0x3c1a,0xda));var _0xa3c1=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0x3c1a[_0x4f4d19];return _0x27a258;};var _=require(_0xa3c1('0x0'));var AWS=require(_0xa3c1('0x1'));var rp=require(_0xa3c1('0x2'));var util=require(_0xa3c1('0x3'));var BPromise=require(_0xa3c1('0x4'));var db=require(_0xa3c1('0x5'))['db'];var logger=require(_0xa3c1('0x6'))('transcribe');function getTranscriptionJob(_0x3db9f5,_0x49c688,_0x28713f,_0x8e2873){return new Promise(function(_0x3f6cab,_0x2da4d2){var _0x546253=new AWS['TranscribeService']({'accessKeyId':_0x49c688,'secretAccessKey':_0x3db9f5,'region':_0x28713f});_0x546253[_0xa3c1('0x7')]({'TranscriptionJobName':_0x8e2873},function(_0x1aa471,_0x3a4718){if(_0x1aa471){return _0x2da4d2(_0x1aa471);}else{return _0x3f6cab(_0x3a4718);}});});}function sentiment(_0x1e45c6,_0x37d41f,_0x4fac66,_0x131819,_0x562038){return new Promise(function(_0x58c6f5,_0x5155ee){var _0x57590c=new AWS[(_0xa3c1('0x8'))]({'accessKeyId':_0x37d41f,'secretAccessKey':_0x1e45c6,'region':_0x4fac66});_0x57590c[_0xa3c1('0x9')]({'Text':_0x131819,'LanguageCode':_0x562038[_0xa3c1('0xa')](0x0,0x2)},function(_0x183039,_0x8d232d){if(_0x183039){return _0x5155ee(_0x183039);}else{return _0x58c6f5(_0x8d232d);}});});}function checkTranscribeJob(_0x1ce473,_0x1ece52,_0x52adac){var _0x2d2499;return new BPromise(function(_0x3b86be,_0x26cab0){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0xd'),_0x1ce473['id'],_0x1ce473[_0xa3c1('0xe')]));return getTranscriptionJob(_0x52adac['data1'],_0x52adac[_0xa3c1('0xf')],_0x1ece52[_0xa3c1('0x10')],_0x1ce473['transcribeName'])[_0xa3c1('0x11')](function(_0x19d4d1){logger['info'](util['format'](_0xa3c1('0x12'),_0x1ce473['id'],_0x1ce473['transcribeName'],_0x19d4d1[_0xa3c1('0x13')]['TranscriptionJobStatus']));if(!_0x1ce473['fileText']){switch(_0x19d4d1[_0xa3c1('0x13')]['TranscriptionJobStatus']){case'COMPLETED':var _0x3655c7={'transcribeStatus':_0x19d4d1[_0xa3c1('0x13')]['TranscriptionJobStatus'],'fileUri':_0x19d4d1['TranscriptionJob']['Transcript'][_0xa3c1('0x14')]};logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x15'),_0x1ce473['id']));return rp({'uri':_0x19d4d1[_0xa3c1('0x13')]['Transcript'][_0xa3c1('0x14')],'json':!![]})['then'](function(_0x5b8a54){logger['info'](util['format'](_0xa3c1('0x16'),_0x1ce473['id']));if(_0x5b8a54&&_0x5b8a54[_0xa3c1('0x17')]&&_0x5b8a54[_0xa3c1('0x17')][_0xa3c1('0x18')]&&_0x5b8a54['results'][_0xa3c1('0x18')][_0xa3c1('0x19')]){_0x3655c7[_0xa3c1('0x1a')]='';for(var _0xe77418=0x0;_0xe77418<_0x5b8a54['results']['transcripts'][_0xa3c1('0x19')];_0xe77418++){_0x3655c7['fileText']+=_0x5b8a54[_0xa3c1('0x17')][_0xa3c1('0x18')][_0xe77418][_0xa3c1('0x1b')]+'';}}return _0x1ce473[_0xa3c1('0x1c')](_0x3655c7);})[_0xa3c1('0x11')](function(){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x1d'),_0x1ce473['id']));if(!_0x1ce473['tempSentiment']){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x20'));}if(!_0x1ece52[_0xa3c1('0x21')]||!_0x1ece52[_0xa3c1('0x22')]||!_0x1ece52[_0xa3c1('0x23')]||!_0x1ece52[_0xa3c1('0x24')]||!_0x1ece52[_0xa3c1('0x25')]){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x26'));}if(!_0x3655c7[_0xa3c1('0x1a')]){throw new Error(_0xa3c1('0x27'));}if(_0x1ece52[_0xa3c1('0x22')]===_0x52adac['id']){return _0x52adac;}else{return db[_0xa3c1('0x28')]['findOne']({'where':{'id':_settings[_0xa3c1('0x22')]}});}})[_0xa3c1('0x11')](function(_0x15a8f3){if(!_0x15a8f3){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x29'));}if(!_0x15a8f3[_0xa3c1('0x2a')]||!_0x15a8f3[_0xa3c1('0xf')]){throw new db[(_0xa3c1('0x1e'))]['ValidationError'](_0xa3c1('0x2b'));}_0x2d2499=_0x15a8f3;logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x2c'),_0x1ce473['id']));return sentiment(_0x2d2499[_0xa3c1('0x2a')],_0x2d2499[_0xa3c1('0xf')],_0x1ece52[_0xa3c1('0x23')],_0x3655c7[_0xa3c1('0x1a')],_0x1ece52[_0xa3c1('0x24')]);})[_0xa3c1('0x11')](function(_0x14e798){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1ce473['id']));return _0x1ce473[_0xa3c1('0x1c')]({'sentiment':_0x14e798[_0xa3c1('0x2d')],'sPositive':_0x14e798['SentimentScore'][_0xa3c1('0x2e')],'sNegative':_0x14e798['SentimentScore']['Negative'],'sMixed':_0x14e798[_0xa3c1('0x2f')][_0xa3c1('0x30')],'sNeutral':_0x14e798['SentimentScore'][_0xa3c1('0x31')]});})['then'](function(){logger['info'](util['format'](_0xa3c1('0x1d'),_0x1ce473['id']));_0x3b86be();});case'FAILED':return _0x1ce473[_0xa3c1('0x1c')]({'transcribeStatus':_0xa3c1('0x32'),'failureReason':_0x19d4d1['TranscriptionJob']['FailureReason']})[_0xa3c1('0x11')](function(){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1ce473['id']));_0x3b86be();});default:logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x33'),_0x1ce473['id']));break;}}else{return BPromise[_0xa3c1('0x34')]()['then'](function(){if(!_0x1ce473[_0xa3c1('0x35')]){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x20'));}if(!_0x1ece52[_0xa3c1('0x21')]||!_0x1ece52[_0xa3c1('0x22')]||!_0x1ece52['sentimentRegion']||!_0x1ece52[_0xa3c1('0x24')]||!_0x1ece52['bucket']){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x26'));}if(!_0x1ce473[_0xa3c1('0x1a')]){throw new Error(_0xa3c1('0x27'));}if(_0x1ece52[_0xa3c1('0x22')]===_0x52adac['id']){return _0x52adac;}else{return db[_0xa3c1('0x28')]['findOne']({'where':{'id':_settings[_0xa3c1('0x22')]}});}})[_0xa3c1('0x11')](function(_0x29178d){if(!_0x29178d){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x29'));}if(!_0x29178d[_0xa3c1('0x2a')]||!_0x29178d[_0xa3c1('0xf')]){throw new db['Sequelize']['ValidationError'](_0xa3c1('0x2b'));}_0x2d2499=_0x29178d;logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x2c'),_0x1ce473['id']));return sentiment(_0x2d2499[_0xa3c1('0x2a')],_0x2d2499[_0xa3c1('0xf')],_0x1ece52['sentimentRegion'],_0x1ce473[_0xa3c1('0x1a')],_0x1ece52[_0xa3c1('0x24')]);})[_0xa3c1('0x11')](function(_0x2f99a1){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x36'),_0x1ce473['id']));return _0x1ce473[_0xa3c1('0x1c')]({'sentiment':_0x2f99a1[_0xa3c1('0x2d')],'sPositive':_0x2f99a1[_0xa3c1('0x2f')][_0xa3c1('0x2e')],'sNegative':_0x2f99a1[_0xa3c1('0x2f')][_0xa3c1('0x37')],'sMixed':_0x2f99a1[_0xa3c1('0x2f')]['Mixed'],'sNeutral':_0x2f99a1[_0xa3c1('0x2f')][_0xa3c1('0x31')],'transcribeStatus':_0xa3c1('0x38')});})[_0xa3c1('0x11')](function(){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1ce473['id']));_0x3b86be();});}})['catch'](function(_0x521364){if(_0x521364){if(!_0x521364['name']||_0x521364[_0xa3c1('0x39')]!==_0xa3c1('0x3a')){logger[_0xa3c1('0x3b')](util[_0xa3c1('0xc')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x1ce473['id']),util[_0xa3c1('0x3c')](_0x521364,{'showHidden':![],'depth':null}));}}_0x3b86be();});});}function checkTranscribe(){var _0x37c682;var _0x406268;var _0x3c068e;return db[_0xa3c1('0x3d')][_0xa3c1('0x3e')]({'where':{'transcribeStatus':_0xa3c1('0x3f')}})[_0xa3c1('0x11')](function(_0x39129f){if(!_0x39129f||!_0x39129f[_0xa3c1('0x19')]){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x40'));}_0x37c682=_0x39129f;return db[_0xa3c1('0x41')][_0xa3c1('0x42')]({'where':{'id':0x1}});})[_0xa3c1('0x11')](function(_0x5d78ef){if(!_0x5d78ef){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x43'));}_0x406268=_0x5d78ef;if(!_0x406268[_0xa3c1('0x44')]||!_0x406268[_0xa3c1('0x45')]||!_0x406268[_0xa3c1('0x10')]||!_0x406268[_0xa3c1('0x24')]||!_0x406268['bucket']){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x46'));}return db[_0xa3c1('0x28')][_0xa3c1('0x42')]({'where':{'id':_0x406268[_0xa3c1('0x45')]}});})['then'](function(_0x1e8a29){if(!_0x1e8a29){throw new db['Sequelize']['ValidationError'](_0xa3c1('0x29'));}if(!_0x1e8a29[_0xa3c1('0x2a')]||!_0x1e8a29[_0xa3c1('0xf')]){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x2b'));}_0x3c068e=_0x1e8a29;var _0x1a062f=[];_0x37c682['forEach'](function(_0x2a7153){_0x1a062f[_0xa3c1('0x47')](checkTranscribeJob(_0x2a7153,_0x406268,_0x3c068e));});return BPromise[_0xa3c1('0x48')](_0x1a062f);})[_0xa3c1('0x49')](function(_0x3ebc72){if(_0x3ebc72){if(!_0x3ebc72[_0xa3c1('0x39')]||_0x3ebc72[_0xa3c1('0x39')]!==_0xa3c1('0x3a')){logger['error'](util[_0xa3c1('0x3c')](_0x3ebc72,{'showHidden':![],'depth':null}));}}});}exports[_0xa3c1('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x63ef=['getTranscriptionJob','Comprehend','detectSentiment','info','format','transcribeName','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','resolve','bucket','CloudProvider','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','catch','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','TranscribeService'];(function(_0x1dd164,_0x41cde1){var _0x429553=function(_0x4bc985){while(--_0x4bc985){_0x1dd164['push'](_0x1dd164['shift']());}};_0x429553(++_0x41cde1);}(_0x63ef,0x11a));var _0xf63e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x63ef[_0x387777];return _0x3f84c0;};var _=require(_0xf63e('0x0'));var AWS=require(_0xf63e('0x1'));var rp=require(_0xf63e('0x2'));var util=require('util');var BPromise=require(_0xf63e('0x3'));var db=require(_0xf63e('0x4'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x46fba1,_0x25a189,_0x5a53a8,_0x2ee15e){return new Promise(function(_0x367f73,_0x519a33){var _0x45ad8d=new AWS[(_0xf63e('0x5'))]({'accessKeyId':_0x25a189,'secretAccessKey':_0x46fba1,'region':_0x5a53a8});_0x45ad8d[_0xf63e('0x6')]({'TranscriptionJobName':_0x2ee15e},function(_0x15d430,_0x31d785){if(_0x15d430){return _0x519a33(_0x15d430);}else{return _0x367f73(_0x31d785);}});});}function sentiment(_0x239b0e,_0x3a2185,_0x2cc2de,_0x29f321,_0xe8f9f9){return new Promise(function(_0x237479,_0x450c6c){var _0x2dac2d=new AWS[(_0xf63e('0x7'))]({'accessKeyId':_0x3a2185,'secretAccessKey':_0x239b0e,'region':_0x2cc2de});_0x2dac2d[_0xf63e('0x8')]({'Text':_0x29f321,'LanguageCode':_0xe8f9f9['substring'](0x0,0x2)},function(_0x448d1b,_0x3be454){if(_0x448d1b){return _0x450c6c(_0x448d1b);}else{return _0x237479(_0x3be454);}});});}function checkTranscribeJob(_0x1295c2,_0x296e43,_0x415c50){var _0x1c2fe9;return new BPromise(function(_0x536a8c,_0x32a98b){logger[_0xf63e('0x9')](util[_0xf63e('0xa')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x1295c2['id'],_0x1295c2[_0xf63e('0xb')]));return getTranscriptionJob(_0x415c50['data1'],_0x415c50[_0xf63e('0xc')],_0x296e43['transcribeRegion'],_0x1295c2[_0xf63e('0xb')])[_0xf63e('0xd')](function(_0x13f9db){logger['info'](util[_0xf63e('0xa')](_0xf63e('0xe'),_0x1295c2['id'],_0x1295c2['transcribeName'],_0x13f9db[_0xf63e('0xf')][_0xf63e('0x10')]));if(!_0x1295c2[_0xf63e('0x11')]){switch(_0x13f9db['TranscriptionJob'][_0xf63e('0x10')]){case _0xf63e('0x12'):var _0x2a1726={'transcribeStatus':_0x13f9db[_0xf63e('0xf')][_0xf63e('0x10')],'fileUri':_0x13f9db[_0xf63e('0xf')][_0xf63e('0x13')][_0xf63e('0x14')]};logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x15'),_0x1295c2['id']));return rp({'uri':_0x13f9db['TranscriptionJob'][_0xf63e('0x13')][_0xf63e('0x14')],'json':!![]})[_0xf63e('0xd')](function(_0x2cfb37){logger['info'](util[_0xf63e('0xa')](_0xf63e('0x16'),_0x1295c2['id']));if(_0x2cfb37&&_0x2cfb37[_0xf63e('0x17')]&&_0x2cfb37[_0xf63e('0x17')][_0xf63e('0x18')]&&_0x2cfb37['results'][_0xf63e('0x18')]['length']){_0x2a1726['fileText']='';for(var _0x40952c=0x0;_0x40952c<_0x2cfb37['results']['transcripts'][_0xf63e('0x19')];_0x40952c++){_0x2a1726['fileText']+=_0x2cfb37[_0xf63e('0x17')][_0xf63e('0x18')][_0x40952c]['transcript']+'';}}return _0x1295c2[_0xf63e('0x1a')](_0x2a1726);})[_0xf63e('0xd')](function(){logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x1b'),_0x1295c2['id']));if(!_0x1295c2[_0xf63e('0x1c')]){throw new db[(_0xf63e('0x1d'))]['ValidationError'](_0xf63e('0x1e'));}if(!_0x296e43[_0xf63e('0x1f')]||!_0x296e43[_0xf63e('0x20')]||!_0x296e43[_0xf63e('0x21')]||!_0x296e43[_0xf63e('0x22')]||!_0x296e43['bucket']){throw new db['Sequelize'][(_0xf63e('0x23'))](_0xf63e('0x24'));}if(!_0x2a1726[_0xf63e('0x11')]){throw new Error(_0xf63e('0x25'));}if(_0x296e43[_0xf63e('0x20')]===_0x415c50['id']){return _0x415c50;}else{return db['CloudProvider'][_0xf63e('0x26')]({'where':{'id':_settings[_0xf63e('0x20')]}});}})['then'](function(_0x3c666a){if(!_0x3c666a){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))](_0xf63e('0x27'));}if(!_0x3c666a[_0xf63e('0x28')]||!_0x3c666a[_0xf63e('0xc')]){throw new db['Sequelize']['ValidationError'](_0xf63e('0x29'));}_0x1c2fe9=_0x3c666a;logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x2a'),_0x1295c2['id']));return sentiment(_0x1c2fe9[_0xf63e('0x28')],_0x1c2fe9['data2'],_0x296e43['sentimentRegion'],_0x2a1726[_0xf63e('0x11')],_0x296e43[_0xf63e('0x22')]);})[_0xf63e('0xd')](function(_0x582272){logger['info'](util[_0xf63e('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1295c2['id']));return _0x1295c2[_0xf63e('0x1a')]({'sentiment':_0x582272[_0xf63e('0x2b')],'sPositive':_0x582272[_0xf63e('0x2c')][_0xf63e('0x2d')],'sNegative':_0x582272['SentimentScore'][_0xf63e('0x2e')],'sMixed':_0x582272['SentimentScore'][_0xf63e('0x2f')],'sNeutral':_0x582272[_0xf63e('0x2c')][_0xf63e('0x30')]});})['then'](function(){logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x1b'),_0x1295c2['id']));_0x536a8c();});case _0xf63e('0x31'):return _0x1295c2['update']({'transcribeStatus':_0xf63e('0x31'),'failureReason':_0x13f9db['TranscriptionJob']['FailureReason']})[_0xf63e('0xd')](function(){logger['info'](util[_0xf63e('0xa')](_0xf63e('0x1b'),_0x1295c2['id']));_0x536a8c();});default:logger['info'](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1295c2['id']));break;}}else{return BPromise[_0xf63e('0x32')]()[_0xf63e('0xd')](function(){if(!_0x1295c2[_0xf63e('0x1c')]){throw new db[(_0xf63e('0x1d'))]['ValidationError'](_0xf63e('0x1e'));}if(!_0x296e43[_0xf63e('0x1f')]||!_0x296e43[_0xf63e('0x20')]||!_0x296e43[_0xf63e('0x21')]||!_0x296e43[_0xf63e('0x22')]||!_0x296e43[_0xf63e('0x33')]){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1295c2[_0xf63e('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x296e43[_0xf63e('0x20')]===_0x415c50['id']){return _0x415c50;}else{return db[_0xf63e('0x34')]['findOne']({'where':{'id':_settings[_0xf63e('0x20')]}});}})['then'](function(_0x3baa79){if(!_0x3baa79){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))](_0xf63e('0x27'));}if(!_0x3baa79[_0xf63e('0x28')]||!_0x3baa79[_0xf63e('0xc')]){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))](_0xf63e('0x29'));}_0x1c2fe9=_0x3baa79;logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x2a'),_0x1295c2['id']));return sentiment(_0x1c2fe9[_0xf63e('0x28')],_0x1c2fe9[_0xf63e('0xc')],_0x296e43[_0xf63e('0x21')],_0x1295c2[_0xf63e('0x11')],_0x296e43[_0xf63e('0x22')]);})['then'](function(_0x59283b){logger[_0xf63e('0x9')](util['format'](_0xf63e('0x35'),_0x1295c2['id']));return _0x1295c2[_0xf63e('0x1a')]({'sentiment':_0x59283b[_0xf63e('0x2b')],'sPositive':_0x59283b[_0xf63e('0x2c')][_0xf63e('0x2d')],'sNegative':_0x59283b[_0xf63e('0x2c')][_0xf63e('0x2e')],'sMixed':_0x59283b[_0xf63e('0x2c')]['Mixed'],'sNeutral':_0x59283b[_0xf63e('0x2c')][_0xf63e('0x30')],'transcribeStatus':_0xf63e('0x12')});})[_0xf63e('0xd')](function(){logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x1b'),_0x1295c2['id']));_0x536a8c();});}})['catch'](function(_0x31c400){if(_0x31c400){if(!_0x31c400[_0xf63e('0x36')]||_0x31c400[_0xf63e('0x36')]!==_0xf63e('0x37')){logger[_0xf63e('0x38')](util[_0xf63e('0xa')](_0xf63e('0x39'),_0x1295c2['id']),util[_0xf63e('0x3a')](_0x31c400,{'showHidden':![],'depth':null}));}}_0x536a8c();});});}function checkTranscribe(){var _0x14ce18;var _0x3bbd5e;var _0x28c916;return db['VoiceRecording'][_0xf63e('0x3b')]({'where':{'transcribeStatus':_0xf63e('0x3c')}})[_0xf63e('0xd')](function(_0x37d868){if(!_0x37d868||!_0x37d868[_0xf63e('0x19')]){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))](_0xf63e('0x3d'));}_0x14ce18=_0x37d868;return db[_0xf63e('0x3e')][_0xf63e('0x26')]({'where':{'id':0x1}});})[_0xf63e('0xd')](function(_0x8c6d5){if(!_0x8c6d5){throw new db[(_0xf63e('0x1d'))]['ValidationError']('Settings\x20not\x20available');}_0x3bbd5e=_0x8c6d5;if(!_0x3bbd5e[_0xf63e('0x3f')]||!_0x3bbd5e[_0xf63e('0x40')]||!_0x3bbd5e[_0xf63e('0x41')]||!_0x3bbd5e[_0xf63e('0x22')]||!_0x3bbd5e[_0xf63e('0x33')]){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))](_0xf63e('0x42'));}return db[_0xf63e('0x34')][_0xf63e('0x26')]({'where':{'id':_0x3bbd5e[_0xf63e('0x40')]}});})[_0xf63e('0xd')](function(_0x56dcea){if(!_0x56dcea){throw new db['Sequelize']['ValidationError'](_0xf63e('0x27'));}if(!_0x56dcea[_0xf63e('0x28')]||!_0x56dcea[_0xf63e('0xc')]){throw new db['Sequelize']['ValidationError'](_0xf63e('0x29'));}_0x28c916=_0x56dcea;var _0x141630=[];_0x14ce18[_0xf63e('0x43')](function(_0x4e496b){_0x141630[_0xf63e('0x44')](checkTranscribeJob(_0x4e496b,_0x3bbd5e,_0x28c916));});return BPromise[_0xf63e('0x45')](_0x141630);})[_0xf63e('0x46')](function(_0xce3fb6){if(_0xce3fb6){if(!_0xce3fb6[_0xf63e('0x36')]||_0xce3fb6[_0xf63e('0x36')]!=='SequelizeValidationError'){logger[_0xf63e('0x38')](util['inspect'](_0xce3fb6,{'showHidden':![],'depth':null}));}}});}exports[_0xf63e('0x47')]=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 1364743..81ae126 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 _0xf9b2=['info','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','error','inspect','start','lodash','ioredis','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map'];(function(_0x3fbcb6,_0x1c44fe){var _0x1a9d88=function(_0x373800){while(--_0x373800){_0x3fbcb6['push'](_0x3fbcb6['shift']());}};_0x1a9d88(++_0x1c44fe);}(_0xf9b2,0x99));var _0x2f9b=function(_0x2703ab,_0x759063){_0x2703ab=_0x2703ab-0x0;var _0x5e21dd=_0xf9b2[_0x2703ab];return _0x5e21dd;};'use strict';var _=require(_0x2f9b('0x0'));var moment=require('moment');var Redis=require(_0x2f9b('0x1'));var util=require('util');var config=require(_0x2f9b('0x2'));var db=require(_0x2f9b('0x3'))['db'];var logger=require('../logger')(_0x2f9b('0x4'));config[_0x2f9b('0x5')]=_[_0x2f9b('0x6')](config[_0x2f9b('0x5')],{'host':_0x2f9b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2f9b('0x5')]));function closeInteractions(){var _0x6262e=[];return db[_0x2f9b('0x8')][_0x2f9b('0x9')]({'raw':!![],'attributes':['id',_0x2f9b('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x2f9b('0xb')](0x18,'hours')}}})[_0x2f9b('0xc')](function(_0x192828){if(_0x192828&&_0x192828[_0x2f9b('0xd')]){_0x6262e=_[_0x2f9b('0xe')](_0x192828||[],'id');logger[_0x2f9b('0xf')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x6262e['join']());return db[_0x2f9b('0x8')][_0x2f9b('0x10')]({'closeReason':_0x2f9b('0x11'),'disposition':_0x2f9b('0x12'),'closed':!![],'closedAt':moment()[_0x2f9b('0x13')](_0x2f9b('0x14'))},{'where':{'id':_0x6262e}});}})[_0x2f9b('0xc')](function(){if(_0x6262e&&_0x6262e[_0x2f9b('0xd')]){logger[_0x2f9b('0xf')](_0x2f9b('0x15'),_0x6262e[_0x2f9b('0x16')]());for(var _0x577207=0x0;_0x577207<_0x6262e[_0x2f9b('0xd')];_0x577207++){io[_0x2f9b('0x17')](_0x2f9b('0x18'),{'id':_0x6262e[_0x577207],'closed':!![]});}}})['catch'](function(_0xe7bdd){logger[_0x2f9b('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xe7bdd?util[_0x2f9b('0x1a')](_0xe7bdd,{'showHidden':![],'depth':null}):'');});}exports[_0x2f9b('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe666=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','inspect','lodash','util','../../mysqldb','schedule','defaults','redis','localhost','socket.io-emitter','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update'];(function(_0x58b762,_0xf590ba){var _0x2dd236=function(_0x3b6d37){while(--_0x3b6d37){_0x58b762['push'](_0x58b762['shift']());}};_0x2dd236(++_0xf590ba);}(_0xe666,0x189));var _0x6e66=function(_0x1a30c7,_0x5d5441){_0x1a30c7=_0x1a30c7-0x0;var _0x3be1e6=_0xe666[_0x1a30c7];return _0x3be1e6;};'use strict';var _=require(_0x6e66('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x6e66('0x1'));var config=require('../../config/environment');var db=require(_0x6e66('0x2'))['db'];var logger=require('../logger')(_0x6e66('0x3'));config['redis']=_[_0x6e66('0x4')](config[_0x6e66('0x5')],{'host':_0x6e66('0x6'),'port':0x18eb});var io=require(_0x6e66('0x7'))(new Redis(config[_0x6e66('0x5')]));function closeInteractions(){var _0x4db3ea=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x6e66('0x8'))}}})[_0x6e66('0x9')](function(_0x3e409e){if(_0x3e409e&&_0x3e409e[_0x6e66('0xa')]){_0x4db3ea=_[_0x6e66('0xb')](_0x3e409e||[],'id');logger['info'](_0x6e66('0xc'),_0x4db3ea[_0x6e66('0xd')]());return db['WhatsappInteraction'][_0x6e66('0xe')]({'closeReason':'system','disposition':_0x6e66('0xf'),'closed':!![],'closedAt':moment()[_0x6e66('0x10')](_0x6e66('0x11'))},{'where':{'id':_0x4db3ea}});}})[_0x6e66('0x9')](function(){if(_0x4db3ea&&_0x4db3ea['length']){logger[_0x6e66('0x12')](_0x6e66('0x13'),_0x4db3ea[_0x6e66('0xd')]());for(var _0x344a11=0x0;_0x344a11<_0x4db3ea['length'];_0x344a11++){io['emit'](_0x6e66('0x14'),{'id':_0x4db3ea[_0x344a11],'closed':!![]});}}})[_0x6e66('0x15')](function(_0x146115){logger[_0x6e66('0x16')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x146115?util[_0x6e66('0x17')](_0x146115,{'showHidden':![],'depth':null}):'');});}exports['start']=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 b0b5344..e56a559 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d36=['../mysqldb','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','push','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','contacts2','finished\x20populating','hopper2','catch','util'];(function(_0x2b7d41,_0x2844d7){var _0x356360=function(_0x10adc5){while(--_0x10adc5){_0x2b7d41['push'](_0x2b7d41['shift']());}};_0x356360(++_0x2844d7);}(_0x6d36,0x1ed));var _0x66d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6d36[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x66d3('0x0'));var db=require(_0x66d3('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x66d3('0x2')+i,'phone':0xf879fb460+i,'email':_0x66d3('0x3')+i+_0x66d3('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x66d3('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x66d3('0x5')](),'updatedAt':Date[_0x66d3('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x66d3('0x6')+i,'lastName':_0x66d3('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x66d3('0x7')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x66d3('0x5')](),'updatedAt':Date[_0x66d3('0x5')]()});}db[_0x66d3('0x8')][_0x66d3('0x9')]({'where':{}})[_0x66d3('0xa')](function(){return db[_0x66d3('0x8')][_0x66d3('0xb')](contacts);})['then'](function(){console[_0x66d3('0xc')]('finished\x20populating',_0x66d3('0xd'));return db['CmHopper'][_0x66d3('0x9')]({'where':{}});})['then'](function(){return db[_0x66d3('0xe')][_0x66d3('0xb')](hopper);})[_0x66d3('0xa')](function(){console[_0x66d3('0xc')]('finished\x20populating','hopper1');return db['CmContact']['bulkCreate'](contacts2);})[_0x66d3('0xa')](function(){console['log']('finished\x20populating',_0x66d3('0xf'));return db['CmHopper']['bulkCreate'](hopper2);})['then'](function(){console[_0x66d3('0xc')](_0x66d3('0x10'),_0x66d3('0x11'));})[_0x66d3('0x12')](function(_0x304a7a){console[_0x66d3('0xc')](_0x304a7a);}); \ No newline at end of file +var _0x9c3a=['destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact'];(function(_0x161dc8,_0x6ffc9){var _0x39df8e=function(_0x46dd63){while(--_0x46dd63){_0x161dc8['push'](_0x161dc8['shift']());}};_0x39df8e(++_0x6ffc9);}(_0x9c3a,0x1c3));var _0xa9c3=function(_0x336209,_0x3058bf){_0x336209=_0x336209-0x0;var _0x51246e=_0x9c3a[_0x336209];return _0x51246e;};'use strict';var util=require(_0xa9c3('0x0'));var db=require(_0xa9c3('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa9c3('0x2')]({'id':i,'firstName':_0xa9c3('0x3')+i,'lastName':_0xa9c3('0x4')+i,'phone':0xf879fb460+i,'email':_0xa9c3('0x5')+i+_0xa9c3('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa9c3('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa9c3('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xa9c3('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa9c3('0x2')]({'id':i,'firstName':_0xa9c3('0x3')+i,'lastName':_0xa9c3('0x4')+i,'phone':0xf879fb460+i,'email':_0xa9c3('0x5')+i+_0xa9c3('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xa9c3('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa9c3('0x7')](),'updatedAt':Date['now']()});}db[_0xa9c3('0x8')][_0xa9c3('0x9')]({'where':{}})[_0xa9c3('0xa')](function(){return db['CmContact'][_0xa9c3('0xb')](contacts);})[_0xa9c3('0xa')](function(){console[_0xa9c3('0xc')](_0xa9c3('0xd'),_0xa9c3('0xe'));return db[_0xa9c3('0xf')][_0xa9c3('0x9')]({'where':{}});})[_0xa9c3('0xa')](function(){return db[_0xa9c3('0xf')]['bulkCreate'](hopper);})[_0xa9c3('0xa')](function(){console[_0xa9c3('0xc')](_0xa9c3('0xd'),_0xa9c3('0x10'));return db[_0xa9c3('0x8')]['bulkCreate'](contacts2);})[_0xa9c3('0xa')](function(){console[_0xa9c3('0xc')](_0xa9c3('0xd'),_0xa9c3('0x11'));return db[_0xa9c3('0xf')][_0xa9c3('0xb')](hopper2);})['then'](function(){console['log'](_0xa9c3('0xd'),_0xa9c3('0x12'));})[_0xa9c3('0x13')](function(_0x4b9801){console['log'](_0x4b9801);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 7d3e704..444eddb 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fca=['then','log','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x0fca,0x1cd));var _0xa0fc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0fca[_0x2641f9];return _0x585741;};'use strict';var util=require('util');var db=require(_0xa0fc('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa0fc('0x1')]({'name':util[_0xa0fc('0x2')](_0xa0fc('0x3'),_0xa0fc('0x4'),i),'fullname':util[_0xa0fc('0x2')](_0xa0fc('0x3'),_0xa0fc('0x4'),i),'email':util['format'](_0xa0fc('0x5'),_0xa0fc('0x4'),i),'role':_0xa0fc('0x4'),'password':_0xa0fc('0x6'),'internal':0xfa0+i,'type':_0xa0fc('0x7'),'transport':[_0xa0fc('0x8'),'ws',_0xa0fc('0x9')],'disallow':[_0xa0fc('0xa')],'allow':['ulaw'],'defaultuser':util[_0xa0fc('0x2')]('%s%s',_0xa0fc('0x4'),i),'encryption':_0xa0fc('0xb'),'avpf':'yes','force_avp':_0xa0fc('0xb'),'icesupport':_0xa0fc('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xa0fc('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0xa0fc('0x2')](_0xa0fc('0xd'),util[_0xa0fc('0x2')](_0xa0fc('0x3'),_0xa0fc('0x4'),i),0xfa0+i)});}db[_0xa0fc('0xe')]['bulkCreate'](users)[_0xa0fc('0xf')](function(){console['log']('add\x20user');})['catch'](function(_0x188d47){console[_0xa0fc('0x10')](_0x188d47);}); \ No newline at end of file +var _0xc2f7=['udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password'];(function(_0x25f797,_0x449916){var _0x157fdd=function(_0x329fe1){while(--_0x329fe1){_0x25f797['push'](_0x25f797['shift']());}};_0x157fdd(++_0x449916);}(_0xc2f7,0x128));var _0x7c2f=function(_0x188d52,_0x14d606){_0x188d52=_0x188d52-0x0;var _0x36c90b=_0xc2f7[_0x188d52];return _0x36c90b;};'use strict';var util=require(_0x7c2f('0x0'));var db=require(_0x7c2f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7c2f('0x2')]({'name':util[_0x7c2f('0x3')](_0x7c2f('0x4'),_0x7c2f('0x5'),i),'fullname':util['format'](_0x7c2f('0x4'),_0x7c2f('0x5'),i),'email':util['format'](_0x7c2f('0x6'),_0x7c2f('0x5'),i),'role':_0x7c2f('0x5'),'password':_0x7c2f('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0x7c2f('0x8'),'ws','wss'],'disallow':[_0x7c2f('0x9')],'allow':[_0x7c2f('0xa')],'defaultuser':util[_0x7c2f('0x3')](_0x7c2f('0x4'),_0x7c2f('0x5'),i),'encryption':_0x7c2f('0xb'),'avpf':_0x7c2f('0xb'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0x7c2f('0xb'),'dtlsverify':'no','dtlscertfile':_0x7c2f('0xc'),'dtlsprivatekey':_0x7c2f('0xd'),'dtlssetup':'actpass','callerid':util[_0x7c2f('0x3')](_0x7c2f('0xe'),util['format'](_0x7c2f('0x4'),_0x7c2f('0x5'),i),0xfa0+i)});}db[_0x7c2f('0xf')]['bulkCreate'](users)[_0x7c2f('0x10')](function(){console['log'](_0x7c2f('0x11'));})[_0x7c2f('0x12')](function(_0xc76394){console['log'](_0xc76394);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 1cb96cd..4a8eeb2 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbb1=['MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','util','./environment','name','Agents','User','role','agent','type','ivr','UserProfileSection','findOne','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','then','map','resourceId','Campaign','format','length','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions'];(function(_0x4b9a1c,_0x76006b){var _0x4f0c6c=function(_0x4c6dfc){while(--_0x4c6dfc){_0x4b9a1c['push'](_0x4b9a1c['shift']());}};_0x4f0c6c(++_0x76006b);}(_0xcbb1,0x1d2));var _0x1cbb=function(_0x1b7dc1,_0x2547eb){_0x1b7dc1=_0x1b7dc1-0x0;var _0xe64dd9=_0xcbb1[_0x1b7dc1];return _0xe64dd9;};'use strict';var _=require('lodash');var util=require(_0x1cbb('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require(_0x1cbb('0x1'));var queryQueues={'attributes':['id',_0x1cbb('0x2')],'include':[{'as':_0x1cbb('0x3'),'model':db[_0x1cbb('0x4')],'attributes':['id','name',_0x1cbb('0x5')],'raw':!![],'where':{'role':_0x1cbb('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x1cbb('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0x1cbb('0x2')],'where':{'role':_0x1cbb('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x1cbb('0x7')],'where':{'type':_0x1cbb('0x8')}};function getAssociatedResources(_0x22c25b,_0x428eb3,_0x571bcc){return db[_0x1cbb('0x9')][_0x1cbb('0xa')]({'where':{'name':_0x22c25b,'userProfileId':_0x428eb3},'raw':!![]})['then'](function(_0x5709c0){if(_0x5709c0){if(_0x5709c0['autoAssociation']){switch(_0x22c25b){case _0x1cbb('0xb'):case _0x1cbb('0xc'):case _0x1cbb('0xd'):case _0x1cbb('0xe'):case _0x1cbb('0xf'):case _0x1cbb('0x10'):case'WhatsappQueues':return db[_0x571bcc][_0x1cbb('0x11')](queryQueues);case _0x1cbb('0x12'):return db[_0x571bcc][_0x1cbb('0x11')](queryTelephones);case _0x1cbb('0x13'):return db[_0x571bcc][_0x1cbb('0x11')](queryTrunks);case _0x1cbb('0x14'):return db[_0x571bcc]['findAll'](queryCampaigns);}}else{return db[_0x1cbb('0x15')][_0x1cbb('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x5709c0['id']},'raw':!![]})[_0x1cbb('0x16')](function(_0x4a9173){if(_0x4a9173){var _0x300cda={'where':{'id':_[_0x1cbb('0x17')](_0x4a9173,_0x1cbb('0x18'))},'raw':!![]};switch(_0x571bcc){case _0x1cbb('0x4'):_0x300cda['where'][_0x1cbb('0x5')]='telephone';break;case _0x1cbb('0x19'):_0x300cda['where'][_0x1cbb('0x7')]=_0x1cbb('0x8');break;}return db[_0x571bcc][_0x1cbb('0x11')](_0x300cda);}else{return[];}});}}else{return[];}})['then'](function(_0x591ca9){return _0x591ca9;});}function joinOrLeaveQueues(_0x1d7ca0,_0x2ac983,_0x246774,_0x4a8815){_0x1d7ca0[_0x2ac983](util[_0x1cbb('0x1a')]('%s:queue:%s',_0x246774,_0x4a8815[_0x1cbb('0x2')]));if(_0x4a8815[_0x1cbb('0x3')]){for(var _0x335d1e=0x0;_0x335d1e<_0x4a8815[_0x1cbb('0x3')][_0x1cbb('0x1b')];_0x335d1e+=0x1){_0x1d7ca0[_0x2ac983](util[_0x1cbb('0x1a')]('user:%s',_0x4a8815[_0x1cbb('0x3')][_0x335d1e][_0x1cbb('0x2')]));}}}function joinOrLeave(_0x16f8fc,_0x2aa724,_0x306bda){var _0x2048ce;if(_0x16f8fc[_0x1cbb('0x1c')][_0x1cbb('0x1d')]['id']){db['User'][_0x1cbb('0x1e')]({'attributes':['id',_0x1cbb('0x2'),_0x1cbb('0x5'),_0x1cbb('0x1f')],'where':{'id':_0x16f8fc['handshake'][_0x1cbb('0x1d')]['id']},'include':[{'model':db[_0x1cbb('0x20')],'as':_0x1cbb('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x1cbb('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x1cbb('0x23')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1cbb('0x24')],'as':_0x1cbb('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x1cbb('0x26')],'as':_0x1cbb('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x1cbb('0x28')],'as':_0x1cbb('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x450145){if(_0x450145){_0x2048ce=_0x450145;_0x16f8fc[_0x2aa724](util[_0x1cbb('0x1a')](_0x1cbb('0x2a'),_0x450145[_0x1cbb('0x2')]));var _0x18e858=[];switch(_0x450145[_0x1cbb('0x5')]){case _0x1cbb('0x2b'):_0x16f8fc[_0x2aa724]('voice:inbound');_0x16f8fc[_0x2aa724](_0x1cbb('0x2c'));if(queryQueues[_0x1cbb('0x2d')](_0x1cbb('0x2e'))){delete queryQueues[_0x1cbb('0x2e')];}_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x30')][_0x1cbb('0x11')](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x31')]['findAll'](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x32')][_0x1cbb('0x11')](queryQueues));_0x18e858['push'](db[_0x1cbb('0x33')]['findAll'](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x34')][_0x1cbb('0x11')](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x35')][_0x1cbb('0x11')](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x36')][_0x1cbb('0x11')](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x4')][_0x1cbb('0x11')](queryTelephones));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x37')]['findAll'](queryTrunks));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x19')]['findAll'](queryCampaigns));_0x18e858[_0x1cbb('0x2f')](db['User'][_0x1cbb('0x11')](queryAgents));break;case'user':_0x16f8fc[_0x2aa724](_0x1cbb('0x38'));_0x16f8fc[_0x2aa724](_0x1cbb('0x2c'));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0xb'),_0x450145[_0x1cbb('0x1f')],_0x1cbb('0x30')));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0xc'),_0x450145[_0x1cbb('0x1f')],_0x1cbb('0x31')));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0xd'),_0x450145[_0x1cbb('0x1f')],_0x1cbb('0x32')));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0xe'),_0x450145[_0x1cbb('0x1f')],'SmsQueue'));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0xf'),_0x450145['userProfileId'],'MailQueue'));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources('OpenchannelQueues',_0x450145[_0x1cbb('0x1f')],_0x1cbb('0x35')));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources('WhatsappQueues',_0x450145[_0x1cbb('0x1f')],_0x1cbb('0x36')));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0x12'),_0x450145[_0x1cbb('0x1f')],'User'));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0x13'),_0x450145[_0x1cbb('0x1f')],'Trunk'));_0x18e858['push'](getAssociatedResources(_0x1cbb('0x14'),_0x450145[_0x1cbb('0x1f')],'Campaign'));_0x18e858[_0x1cbb('0x2f')](db['User'][_0x1cbb('0x11')](queryAgents));break;case _0x1cbb('0x6'):_0x16f8fc[_0x2aa724](_0x1cbb('0x38'));_0x16f8fc[_0x2aa724](_0x1cbb('0x2c'));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x39')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x3a')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x3b')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x3c')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858['push'](_0x450145[_0x1cbb('0x3d')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x3e')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x3f')]({'attributes':['id',_0x1cbb('0x2')]}));break;}return BPromise[_0x1cbb('0x40')](_0x18e858);}})[_0x1cbb('0x16')](function(_0xcf9ae4){if(_0xcf9ae4&&_0xcf9ae4[_0x1cbb('0x1b')]){for(var _0x2bf8fb=0x0;_0x2bf8fb<_0xcf9ae4['length'];_0x2bf8fb+=0x1){for(var _0x4a32af=0x0;_0x4a32af<_0xcf9ae4[_0x2bf8fb][_0x1cbb('0x1b')];_0x4a32af+=0x1){switch(_0x2bf8fb){case 0x0:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x41'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x1:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,'chat',_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x2:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x42'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x3:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x43'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x4:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x44'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x5:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x45'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x6:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x46'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x7:if(_0x2048ce[_0x1cbb('0x5')]!=='agent')_0x16f8fc[_0x2aa724](util[_0x1cbb('0x1a')](_0x1cbb('0x47'),_0xcf9ae4[_0x2bf8fb][_0x4a32af][_0x1cbb('0x2')]));break;case 0x8:if(_0x2048ce[_0x1cbb('0x5')]!==_0x1cbb('0x6'))_0x16f8fc[_0x2aa724](util['format'](_0x1cbb('0x48'),_0xcf9ae4[_0x2bf8fb][_0x4a32af][_0x1cbb('0x2')]));break;case 0x9:if(_0x2048ce[_0x1cbb('0x5')]!=='agent')_0x16f8fc[_0x2aa724](util[_0x1cbb('0x1a')]('campaign:%s:%s',_0xcf9ae4[_0x2bf8fb][_0x4a32af][_0x1cbb('0x7')],_0xcf9ae4[_0x2bf8fb][_0x4a32af]['name']));break;case 0xa:_0x16f8fc[_0x2aa724](util[_0x1cbb('0x1a')](_0x1cbb('0x2a'),_0xcf9ae4[_0x2bf8fb][_0x4a32af][_0x1cbb('0x2')]));break;}}}}})[_0x1cbb('0x16')](function(){if(_0x2aa724===_0x1cbb('0x49')){var _0x526a2c=_[_0x1cbb('0x17')](_0x2048ce['ChatInteractions'],'id');return _0x2048ce[_0x1cbb('0x4a')](_0x526a2c)[_0x1cbb('0x16')](function(){for(var _0x229a2f=0x0;_0x229a2f<_0x526a2c[_0x1cbb('0x1b')];_0x229a2f+=0x1){_0x306bda['emit'](_0x1cbb('0x4b'),{'ChatInteractionId':Number(_0x526a2c[_0x229a2f]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x16')](function(){if(_0x2aa724===_0x1cbb('0x49')){var _0x40ea94=_[_0x1cbb('0x17')](_0x2048ce[_0x1cbb('0x22')],'id');return _0x2048ce[_0x1cbb('0x4c')](_0x40ea94)[_0x1cbb('0x16')](function(){for(var _0x5406e8=0x0;_0x5406e8<_0x40ea94['length'];_0x5406e8+=0x1){_0x306bda[_0x1cbb('0x4d')](_0x1cbb('0x4e'),{'MailInteractionId':Number(_0x40ea94[_0x5406e8]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x16')](function(){if(_0x2aa724===_0x1cbb('0x49')){var _0x10de3a=_['map'](_0x2048ce['FaxInteractions'],'id');return _0x2048ce[_0x1cbb('0x4f')](_0x10de3a)[_0x1cbb('0x16')](function(){for(var _0x2653b5=0x0;_0x2653b5<_0x10de3a[_0x1cbb('0x1b')];_0x2653b5+=0x1){_0x306bda[_0x1cbb('0x4d')](_0x1cbb('0x50'),{'FaxInteractionId':Number(_0x10de3a[_0x2653b5]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x16')](function(){if(_0x2aa724===_0x1cbb('0x49')){var _0x4004b0=_[_0x1cbb('0x17')](_0x2048ce[_0x1cbb('0x25')],'id');return _0x2048ce[_0x1cbb('0x51')](_0x4004b0)['then'](function(){for(var _0x390092=0x0;_0x390092<_0x4004b0[_0x1cbb('0x1b')];_0x390092+=0x1){_0x306bda[_0x1cbb('0x4d')](_0x1cbb('0x52'),{'SmsInteractionId':Number(_0x4004b0[_0x390092]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x16')](function(){if(_0x2aa724==='leave'){var _0x6f250b=_[_0x1cbb('0x17')](_0x2048ce[_0x1cbb('0x27')],'id');return _0x2048ce[_0x1cbb('0x53')](_0x6f250b)[_0x1cbb('0x16')](function(){for(var _0x3a33c3=0x0;_0x3a33c3<_0x6f250b[_0x1cbb('0x1b')];_0x3a33c3+=0x1){_0x306bda['emit'](_0x1cbb('0x54'),{'OpenchannelInteractionId':Number(_0x6f250b[_0x3a33c3]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x16')](function(){if(_0x2aa724===_0x1cbb('0x49')){var _0x1f4176=_[_0x1cbb('0x17')](_0x2048ce[_0x1cbb('0x29')],'id');return _0x2048ce[_0x1cbb('0x55')](_0x1f4176)[_0x1cbb('0x16')](function(){for(var _0x29278f=0x0;_0x29278f<_0x1f4176['length'];_0x29278f+=0x1){_0x306bda['emit'](_0x1cbb('0x56'),{'WhatsappInteractionId':Number(_0x1f4176[_0x29278f]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x57')](function(_0x3b8bab){_0x16f8fc[_0x1cbb('0x58')](_0x3b8bab);});}}function onDisconnect(_0x3577bb,_0x3006fb){joinOrLeave(_0x3577bb,_0x1cbb('0x49'),_0x3006fb);}function onConnect(_0x549b08){joinOrLeave(_0x549b08,_0x1cbb('0x59'));}exports['default']=function(_0x2ee199){_0x2ee199['on']('connection',function(_0x44d7ff){_0x44d7ff['setMaxListeners'](0x0);_0x44d7ff['address']=_0x44d7ff['request'][_0x1cbb('0x5a')][_0x1cbb('0x5b')]+':'+_0x44d7ff['request'][_0x1cbb('0x5a')][_0x1cbb('0x5c')];_0x44d7ff[_0x1cbb('0x5d')]=new Date();_0x44d7ff['log']=function(_0x1210fd){console['log'](_0x1cbb('0x5e')+_0x44d7ff[_0x1cbb('0x5f')][_0x1cbb('0x2')]+'['+_0x44d7ff[_0x1cbb('0x60')]+']',_0x1210fd);};_0x44d7ff['on'](_0x1cbb('0x61'),function(){onDisconnect(_0x44d7ff,_0x2ee199);_0x44d7ff[_0x1cbb('0x58')](_0x1cbb('0x62'));});onConnect(_0x44d7ff);_0x44d7ff[_0x1cbb('0x58')](_0x1cbb('0x63'));});}; \ No newline at end of file +var _0x6cf5=['ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','userProfileId','VoiceQueue','ChatQueues','FaxQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','trunk:%s','campaign:%s:%s','removeChatInteractions','leave','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','SmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','role','Campaign','ivr','format','%s:queue:%s','length','user:%s','handshake','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push'];(function(_0x306c5b,_0x12989a){var _0x4dab8f=function(_0x1ab685){while(--_0x1ab685){_0x306c5b['push'](_0x306c5b['shift']());}};_0x4dab8f(++_0x12989a);}(_0x6cf5,0x1cf));var _0x56cf=function(_0x1f2c93,_0x5bfe8a){_0x1f2c93=_0x1f2c93-0x0;var _0x46542c=_0x6cf5[_0x1f2c93];return _0x46542c;};'use strict';var _=require(_0x56cf('0x0'));var util=require(_0x56cf('0x1'));var BPromise=require(_0x56cf('0x2'));var db=require(_0x56cf('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x56cf('0x4')],'include':[{'as':_0x56cf('0x5'),'model':db[_0x56cf('0x6')],'attributes':['id',_0x56cf('0x4'),'role'],'raw':!![],'where':{'role':_0x56cf('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x56cf('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x56cf('0x4')],'where':{'role':_0x56cf('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x56cf('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x51b676,_0x4b65ac,_0x4b78ce){return db[_0x56cf('0xa')][_0x56cf('0xb')]({'where':{'name':_0x51b676,'userProfileId':_0x4b65ac},'raw':!![]})[_0x56cf('0xc')](function(_0x61d258){if(_0x61d258){if(_0x61d258[_0x56cf('0xd')]){switch(_0x51b676){case _0x56cf('0xe'):case'ChatQueues':case _0x56cf('0xf'):case _0x56cf('0x10'):case _0x56cf('0x11'):case _0x56cf('0x12'):case _0x56cf('0x13'):return db[_0x4b78ce][_0x56cf('0x14')](queryQueues);case _0x56cf('0x15'):return db[_0x4b78ce]['findAll'](queryTelephones);case _0x56cf('0x16'):return db[_0x4b78ce][_0x56cf('0x14')](queryTrunks);case _0x56cf('0x17'):return db[_0x4b78ce][_0x56cf('0x14')](queryCampaigns);}}else{return db[_0x56cf('0x18')][_0x56cf('0x14')]({'attributes':['resourceId'],'where':{'sectionId':_0x61d258['id']},'raw':!![]})[_0x56cf('0xc')](function(_0x164e8d){if(_0x164e8d){var _0x1b4cb4={'where':{'id':_[_0x56cf('0x19')](_0x164e8d,_0x56cf('0x1a'))},'raw':!![]};switch(_0x4b78ce){case'User':_0x1b4cb4[_0x56cf('0x1b')][_0x56cf('0x1c')]=_0x56cf('0x8');break;case _0x56cf('0x1d'):_0x1b4cb4[_0x56cf('0x1b')][_0x56cf('0x9')]=_0x56cf('0x1e');break;}return db[_0x4b78ce][_0x56cf('0x14')](_0x1b4cb4);}else{return[];}});}}else{return[];}})[_0x56cf('0xc')](function(_0x55047d){return _0x55047d;});}function joinOrLeaveQueues(_0x45487f,_0x2736d1,_0x44b16a,_0x17b782){_0x45487f[_0x2736d1](util[_0x56cf('0x1f')](_0x56cf('0x20'),_0x44b16a,_0x17b782[_0x56cf('0x4')]));if(_0x17b782[_0x56cf('0x5')]){for(var _0x41a9e1=0x0;_0x41a9e1<_0x17b782[_0x56cf('0x5')][_0x56cf('0x21')];_0x41a9e1+=0x1){_0x45487f[_0x2736d1](util[_0x56cf('0x1f')](_0x56cf('0x22'),_0x17b782[_0x56cf('0x5')][_0x41a9e1][_0x56cf('0x4')]));}}}function joinOrLeave(_0x303926,_0x250e9f,_0x6bface){var _0xb54ba9;if(_0x303926[_0x56cf('0x23')][_0x56cf('0x24')]['id']){db[_0x56cf('0x6')]['find']({'attributes':['id',_0x56cf('0x4'),_0x56cf('0x1c'),'userProfileId'],'where':{'id':_0x303926['handshake'][_0x56cf('0x24')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x56cf('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x56cf('0x26')],'as':_0x56cf('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x56cf('0x28')],'as':_0x56cf('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x56cf('0x2a')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x56cf('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x56cf('0x2c')],'as':_0x56cf('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x56cf('0xc')](function(_0x321f1e){if(_0x321f1e){_0xb54ba9=_0x321f1e;_0x303926[_0x250e9f](util[_0x56cf('0x1f')](_0x56cf('0x22'),_0x321f1e[_0x56cf('0x4')]));var _0x1fd3c8=[];switch(_0x321f1e[_0x56cf('0x1c')]){case _0x56cf('0x2e'):_0x303926[_0x250e9f](_0x56cf('0x2f'));_0x303926[_0x250e9f](_0x56cf('0x30'));if(queryQueues[_0x56cf('0x31')](_0x56cf('0x32'))){delete queryQueues[_0x56cf('0x32')];}_0x1fd3c8[_0x56cf('0x33')](db['VoiceQueue'][_0x56cf('0x14')](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x34')][_0x56cf('0x14')](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db['FaxQueue'][_0x56cf('0x14')](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x35')][_0x56cf('0x14')](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x36')][_0x56cf('0x14')](queryQueues));_0x1fd3c8['push'](db[_0x56cf('0x37')][_0x56cf('0x14')](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x38')]['findAll'](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x6')][_0x56cf('0x14')](queryTelephones));_0x1fd3c8[_0x56cf('0x33')](db['Trunk'][_0x56cf('0x14')](queryTrunks));_0x1fd3c8[_0x56cf('0x33')](db['Campaign'][_0x56cf('0x14')](queryCampaigns));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x6')][_0x56cf('0x14')](queryAgents));break;case _0x56cf('0x39'):_0x303926[_0x250e9f](_0x56cf('0x2f'));_0x303926[_0x250e9f](_0x56cf('0x30'));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0xe'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x3b')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x3c'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x34')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0xf'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x3d')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x10'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x35')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources('MailQueues',_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x36')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x12'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x37')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x13'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x38')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x15'),_0x321f1e['userProfileId'],_0x56cf('0x6')));_0x1fd3c8['push'](getAssociatedResources(_0x56cf('0x16'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x3e')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x17'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x1d')));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x6')]['findAll'](queryAgents));break;case'agent':_0x303926[_0x250e9f](_0x56cf('0x2f'));_0x303926[_0x250e9f]('voice:outbound');_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x3f')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x40')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8['push'](_0x321f1e[_0x56cf('0x41')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x42')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x43')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x44')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x45')]({'attributes':['id',_0x56cf('0x4')]}));break;}return BPromise[_0x56cf('0x46')](_0x1fd3c8);}})[_0x56cf('0xc')](function(_0x480e4a){if(_0x480e4a&&_0x480e4a[_0x56cf('0x21')]){for(var _0x1b4b1e=0x0;_0x1b4b1e<_0x480e4a[_0x56cf('0x21')];_0x1b4b1e+=0x1){for(var _0x2e4da2=0x0;_0x2e4da2<_0x480e4a[_0x1b4b1e]['length'];_0x2e4da2+=0x1){switch(_0x1b4b1e){case 0x0:joinOrLeaveQueues(_0x303926,_0x250e9f,_0x56cf('0x47'),_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x1:joinOrLeaveQueues(_0x303926,_0x250e9f,_0x56cf('0x48'),_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x2:joinOrLeaveQueues(_0x303926,_0x250e9f,_0x56cf('0x49'),_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x3:joinOrLeaveQueues(_0x303926,_0x250e9f,_0x56cf('0x4a'),_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x4:joinOrLeaveQueues(_0x303926,_0x250e9f,'mail',_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x5:joinOrLeaveQueues(_0x303926,_0x250e9f,_0x56cf('0x4b'),_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x6:joinOrLeaveQueues(_0x303926,_0x250e9f,'whatsapp',_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x7:if(_0xb54ba9[_0x56cf('0x1c')]!==_0x56cf('0x7'))_0x303926[_0x250e9f](util[_0x56cf('0x1f')]('telephone:%s',_0x480e4a[_0x1b4b1e][_0x2e4da2][_0x56cf('0x4')]));break;case 0x8:if(_0xb54ba9[_0x56cf('0x1c')]!==_0x56cf('0x7'))_0x303926[_0x250e9f](util[_0x56cf('0x1f')](_0x56cf('0x4c'),_0x480e4a[_0x1b4b1e][_0x2e4da2][_0x56cf('0x4')]));break;case 0x9:if(_0xb54ba9[_0x56cf('0x1c')]!=='agent')_0x303926[_0x250e9f](util['format'](_0x56cf('0x4d'),_0x480e4a[_0x1b4b1e][_0x2e4da2][_0x56cf('0x9')],_0x480e4a[_0x1b4b1e][_0x2e4da2][_0x56cf('0x4')]));break;case 0xa:_0x303926[_0x250e9f](util[_0x56cf('0x1f')](_0x56cf('0x22'),_0x480e4a[_0x1b4b1e][_0x2e4da2][_0x56cf('0x4')]));break;}}}}})['then'](function(){if(_0x250e9f==='leave'){var _0x577b8d=_['map'](_0xb54ba9[_0x56cf('0x25')],'id');return _0xb54ba9[_0x56cf('0x4e')](_0x577b8d)['then'](function(){for(var _0xa95589=0x0;_0xa95589<_0x577b8d[_0x56cf('0x21')];_0xa95589+=0x1){_0x6bface['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x577b8d[_0xa95589]),'UserId':Number(_0xb54ba9['id'])});}});}})[_0x56cf('0xc')](function(){if(_0x250e9f===_0x56cf('0x4f')){var _0x55d3e0=_[_0x56cf('0x19')](_0xb54ba9[_0x56cf('0x27')],'id');return _0xb54ba9[_0x56cf('0x50')](_0x55d3e0)['then'](function(){for(var _0x56fad3=0x0;_0x56fad3<_0x55d3e0[_0x56cf('0x21')];_0x56fad3+=0x1){_0x6bface[_0x56cf('0x51')](_0x56cf('0x52'),{'MailInteractionId':Number(_0x55d3e0[_0x56fad3]),'UserId':Number(_0xb54ba9['id'])});}});}})['then'](function(){if(_0x250e9f==='leave'){var _0x2072ef=_[_0x56cf('0x19')](_0xb54ba9[_0x56cf('0x29')],'id');return _0xb54ba9[_0x56cf('0x53')](_0x2072ef)[_0x56cf('0xc')](function(){for(var _0x389cb1=0x0;_0x389cb1<_0x2072ef[_0x56cf('0x21')];_0x389cb1+=0x1){_0x6bface['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2072ef[_0x389cb1]),'UserId':Number(_0xb54ba9['id'])});}});}})['then'](function(){if(_0x250e9f===_0x56cf('0x4f')){var _0x5d0048=_[_0x56cf('0x19')](_0xb54ba9[_0x56cf('0x54')],'id');return _0xb54ba9['removeSmsInteractions'](_0x5d0048)[_0x56cf('0xc')](function(){for(var _0x3e9a41=0x0;_0x3e9a41<_0x5d0048[_0x56cf('0x21')];_0x3e9a41+=0x1){_0x6bface[_0x56cf('0x51')](_0x56cf('0x55'),{'SmsInteractionId':Number(_0x5d0048[_0x3e9a41]),'UserId':Number(_0xb54ba9['id'])});}});}})[_0x56cf('0xc')](function(){if(_0x250e9f===_0x56cf('0x4f')){var _0x2d4553=_[_0x56cf('0x19')](_0xb54ba9[_0x56cf('0x2b')],'id');return _0xb54ba9[_0x56cf('0x56')](_0x2d4553)[_0x56cf('0xc')](function(){for(var _0x1da0d2=0x0;_0x1da0d2<_0x2d4553[_0x56cf('0x21')];_0x1da0d2+=0x1){_0x6bface['emit'](_0x56cf('0x57'),{'OpenchannelInteractionId':Number(_0x2d4553[_0x1da0d2]),'UserId':Number(_0xb54ba9['id'])});}});}})[_0x56cf('0xc')](function(){if(_0x250e9f==='leave'){var _0x34c5d3=_[_0x56cf('0x19')](_0xb54ba9[_0x56cf('0x2d')],'id');return _0xb54ba9[_0x56cf('0x58')](_0x34c5d3)[_0x56cf('0xc')](function(){for(var _0x2d6157=0x0;_0x2d6157<_0x34c5d3[_0x56cf('0x21')];_0x2d6157+=0x1){_0x6bface[_0x56cf('0x51')](_0x56cf('0x59'),{'WhatsappInteractionId':Number(_0x34c5d3[_0x2d6157]),'UserId':Number(_0xb54ba9['id'])});}});}})[_0x56cf('0x5a')](function(_0x3d9836){_0x303926[_0x56cf('0x5b')](_0x3d9836);});}}function onDisconnect(_0x5c328d,_0xce3144){joinOrLeave(_0x5c328d,_0x56cf('0x4f'),_0xce3144);}function onConnect(_0x2d5b12){joinOrLeave(_0x2d5b12,_0x56cf('0x5c'));}exports[_0x56cf('0x5d')]=function(_0x53e048){_0x53e048['on'](_0x56cf('0x5e'),function(_0x43ecaa){_0x43ecaa[_0x56cf('0x5f')](0x0);_0x43ecaa[_0x56cf('0x60')]=_0x43ecaa['request'][_0x56cf('0x5e')]['remoteAddress']+':'+_0x43ecaa[_0x56cf('0x61')][_0x56cf('0x5e')]['remotePort'];_0x43ecaa['connectedAt']=new Date();_0x43ecaa[_0x56cf('0x5b')]=function(_0x3993b5){console[_0x56cf('0x5b')](_0x56cf('0x62')+_0x43ecaa[_0x56cf('0x63')][_0x56cf('0x4')]+'['+_0x43ecaa[_0x56cf('0x60')]+']',_0x3993b5);};_0x43ecaa['on'](_0x56cf('0x64'),function(){onDisconnect(_0x43ecaa,_0x53e048);_0x43ecaa['log'](_0x56cf('0x65'));});onConnect(_0x43ecaa);_0x43ecaa[_0x56cf('0x5b')](_0x56cf('0x66'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 086fb31..398c9f3 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 _0xa2e0=['name','agent','outgoingmessage','opened','query','changed','closed','fullname','email','length','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','lodash','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','UserId','User','internal','interface','format','SIP/%s'];(function(_0x4c8522,_0x5655da){var _0x25c4ff=function(_0x48e58b){while(--_0x48e58b){_0x4c8522['push'](_0x4c8522['shift']());}};_0x25c4ff(++_0x5655da);}(_0xa2e0,0x9b));var _0x0a2e=function(_0x61e409,_0x587fef){_0x61e409=_0x61e409-0x0;var _0x3af983=_0xa2e0[_0x61e409];return _0x3af983;};'use strict';var util=require(_0x0a2e('0x0'));var db=require(_0x0a2e('0x1'))['db'];var jayson=require(_0x0a2e('0x2'));var logger=require(_0x0a2e('0x3'))(_0x0a2e('0x4'));var _=require(_0x0a2e('0x5'));var client=jayson[_0x0a2e('0x6')][_0x0a2e('0x7')]({'port':0x232a});var triggers=[{'channel':_0x0a2e('0x8'),'model':_0x0a2e('0x9'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xb'),'callback':afterCreate},{'channel':_0x0a2e('0x8'),'model':'ChatInteraction','event':_0x0a2e('0xc'),'condition':_0x0a2e('0xd'),'callback':afterUpdate},{'channel':_0x0a2e('0x8'),'model':_0x0a2e('0xe'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xf'),'callback':afterCreateMessage},{'channel':_0x0a2e('0x10'),'model':_0x0a2e('0x11'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xb'),'callback':afterCreate},{'channel':_0x0a2e('0x10'),'model':_0x0a2e('0x11'),'event':'afterUpdate','condition':_0x0a2e('0xd'),'callback':afterUpdate},{'channel':_0x0a2e('0x10'),'model':_0x0a2e('0x12'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xf'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x0a2e('0x13'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xb'),'callback':afterCreate},{'channel':_0x0a2e('0x14'),'model':_0x0a2e('0x13'),'event':_0x0a2e('0xc'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0a2e('0x14'),'model':_0x0a2e('0x15'),'event':'afterCreate','condition':_0x0a2e('0xf'),'callback':afterCreateMessage},{'channel':_0x0a2e('0x16'),'model':_0x0a2e('0x17'),'event':_0x0a2e('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0a2e('0x16'),'model':_0x0a2e('0x17'),'event':_0x0a2e('0xc'),'condition':_0x0a2e('0xd'),'callback':afterUpdate},{'channel':'Fax','model':_0x0a2e('0x18'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xf'),'callback':afterCreateMessage},{'channel':_0x0a2e('0x19'),'model':_0x0a2e('0x1a'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xb'),'callback':afterCreate},{'channel':_0x0a2e('0x19'),'model':_0x0a2e('0x1a'),'event':_0x0a2e('0xc'),'condition':_0x0a2e('0xd'),'callback':afterUpdate},{'channel':_0x0a2e('0x19'),'model':_0x0a2e('0x1b'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xf'),'callback':afterCreateMessage},{'channel':_0x0a2e('0x1c'),'model':_0x0a2e('0x1d'),'event':'afterCreate','condition':_0x0a2e('0xb'),'callback':afterCreate},{'channel':_0x0a2e('0x1c'),'model':_0x0a2e('0x1d'),'event':_0x0a2e('0xc'),'condition':_0x0a2e('0xd'),'callback':afterUpdate},{'channel':_0x0a2e('0x1c'),'model':_0x0a2e('0x1e'),'event':_0x0a2e('0xa'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x55ba99){return client[_0x0a2e('0x1f')](_0x0a2e('0x20'),_0x55ba99)[_0x0a2e('0x21')](function(_0x56c10c){logger['info'](_0x0a2e('0x22'),_0x0a2e('0x20'),_0x56c10c);if(_0x56c10c[_0x0a2e('0x23')]){if(_0x56c10c['error'][_0x0a2e('0x24')]===0x1f4){logger[_0x0a2e('0x23')]('Trigger,\x20%s',_0x0a2e('0x20'),_0x56c10c[_0x0a2e('0x23')]);}}})[_0x0a2e('0x25')](function(_0x5d20f2){logger[_0x0a2e('0x23')](_0x0a2e('0x22'),_0x0a2e('0x20'),_0x5d20f2);});}function afterCreateMessage(_0x228490,_0x2e6761){return function(_0x1aea69,_0x35de75){_0x1aea69=_0x1aea69[_0x0a2e('0x26')]({'plain':!![]});_0x1aea69[_0x0a2e('0x27')]=_0x228490;_0x1aea69[_0x0a2e('0x28')]=_0x1aea69[_0x0a2e('0x29')];var _0x10e145=_0x0a2e('0x2a')+_0x1aea69[_0x0a2e('0x2b')];return db[_0x0a2e('0x2c')]['query'](_0x10e145,{'type':db[_0x0a2e('0x2d')][_0x0a2e('0x2e')][_0x0a2e('0x2f')],'raw':!![]})['then'](function(_0x2a3077){return _0x2a3077;})['then'](function(_0x419fc4){if(_0x419fc4){_0x1aea69[_0x0a2e('0x30')]=_0x419fc4[0x0];}if(_0x1aea69[_0x0a2e('0x31')]){return db[_0x0a2e('0x32')]['find']({'where':{'id':_0x1aea69[_0x0a2e('0x31')]},'attributes':['id','name','fullname','email',_0x0a2e('0x33')],'raw':!![]})[_0x0a2e('0x21')](function(_0x2084dc){_0x1aea69[_0x0a2e('0x34')]=util[_0x0a2e('0x35')](_0x0a2e('0x36'),_0x2084dc[_0x0a2e('0x37')]);_0x1aea69[_0x0a2e('0x27')]=_0x228490;_0x1aea69[_0x0a2e('0x38')]=_0x2084dc;return request({'event':'incomingmessage','message':_0x1aea69});})[_0x0a2e('0x25')](function(_0x34f76a){console[_0x0a2e('0x23')](_0x34f76a);});}else{return request({'event':_0x0a2e('0x39'),'message':_0x1aea69});}});};}function afterCreate(_0x28cbec,_0x3767d9){return function(_0x1c8863,_0x1aea94){_0x1c8863=_0x1c8863[_0x0a2e('0x26')]({'plain':!![]});_0x1c8863['channel']=_0x28cbec;_0x1c8863['event']=_0x0a2e('0x3a');var _0x533504=_0x0a2e('0x2a')+_0x1c8863[_0x0a2e('0x2b')];return db[_0x0a2e('0x2c')][_0x0a2e('0x3b')](_0x533504,{'type':db['Sequelize'][_0x0a2e('0x2e')]['SELECT'],'raw':!![]})['then'](function(_0x5721f2){return _0x5721f2;})['then'](function(_0x23de34){if(_0x23de34){_0x1c8863[_0x0a2e('0x30')]=_0x23de34[0x0];}return request({'event':_0x3767d9,'message':_0x1c8863});});};}function afterUpdate(_0x39d2ec,_0x250615){return function(_0x12948d,_0x5c2a11){if(_0x12948d[_0x0a2e('0x3c')](_0x0a2e('0x3d'))&&_0x12948d[_0x0a2e('0x3d')]){_0x12948d=_0x12948d[_0x0a2e('0x26')]({'plain':!![]});_0x12948d['channel']=_0x39d2ec;_0x12948d[_0x0a2e('0x28')]=_0x0a2e('0x3d');var _0x40adb9=_0x0a2e('0x2a')+_0x12948d[_0x0a2e('0x2b')];return db[_0x0a2e('0x2c')][_0x0a2e('0x3b')](_0x40adb9,{'type':db[_0x0a2e('0x2d')]['QueryTypes']['SELECT'],'raw':!![]})[_0x0a2e('0x21')](function(_0x239c57){return _0x239c57;})[_0x0a2e('0x21')](function(_0xc684c6){if(_0xc684c6){_0x12948d[_0x0a2e('0x30')]=_0xc684c6[0x0];}if(_0x12948d[_0x0a2e('0x31')]){return db[_0x0a2e('0x32')]['find']({'where':{'id':_0x12948d['UserId']},'attributes':['id','name',_0x0a2e('0x3e'),_0x0a2e('0x3f'),_0x0a2e('0x33')],'raw':!![]})[_0x0a2e('0x21')](function(_0x3259af){_0x12948d[_0x0a2e('0x34')]=util[_0x0a2e('0x35')](_0x0a2e('0x36'),_0x3259af[_0x0a2e('0x37')]);_0x12948d[_0x0a2e('0x38')]=_0x3259af;return request({'event':_0x250615,'message':_0x12948d});})[_0x0a2e('0x25')](function(_0x414ce9){console['error'](_0x414ce9);});}else{return request({'event':_0x250615,'message':_0x12948d});}});}};}exports['default']=function(){for(var _0x53d09e=0x0;_0x53d09e=_0x47df01[_0x6692('0x14')]){throw Error(_0x6692('0x15'));}_0x5ec141(_0x1c8e8e);})[_0x6692('0x16')](function(_0x3f85a8){_0x38260f(_0x3f85a8);});});}; \ No newline at end of file +var _0xb096=['mail','chat','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','../mysqldb','voice'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb096,0xed));var _0x6b09=function(_0x551bf0,_0x467031){_0x551bf0=_0x551bf0-0x0;var _0x3cbd2c=_0xb096[_0x551bf0];return _0x3cbd2c;};'use strict';var _=require('lodash');var BPromise=require(_0x6b09('0x0'));var db=require(_0x6b09('0x1'))['db'];var util=require('./license/util');var channels=[_0x6b09('0x2'),_0x6b09('0x3'),_0x6b09('0x4'),'fax',_0x6b09('0x5'),_0x6b09('0x6'),_0x6b09('0x7')];exports[_0x6b09('0x8')]=function(){return channels;};exports[_0x6b09('0x9')]=function(_0x2a518d){_0x2a518d=_0x2a518d[_0x6b09('0xa')]();return _[_0x6b09('0xb')](channels,_0x2a518d);};exports[_0x6b09('0xc')]=function(_0x21f6ba,_0x5a051e,_0x5f44cc,_0x5c0297){var _0x3cfbf7={'loginAttempts':_0x5a051e,'blocked':_0x5f44cc};if(!_[_0x6b09('0xd')](_0x5c0297)){_0x3cfbf7[_0x6b09('0xe')]=_0x5c0297;}return _0x21f6ba[_0x6b09('0xf')](_0x3cfbf7);};exports[_0x6b09('0x10')]=function(_0x2f7ecb){return new BPromise(function(_0x402f1f,_0x10dadf){var _0x2efc45=0x0;if(_0x2f7ecb[_0x6b09('0x11')]!==_0x6b09('0x12')){_0x402f1f(_0x2f7ecb);}db[_0x6b09('0x13')]['count']({'where':{'role':_0x6b09('0x12'),'online':!![],'id':{'$ne':_0x2f7ecb['id']}}})[_0x6b09('0x14')](function(_0x28f63c){_0x2efc45=_0x28f63c;return util[_0x6b09('0x10')]();})[_0x6b09('0x14')](function(_0x331656){if(_0x331656&&_0x331656[_0x6b09('0x15')]&&_0x2efc45>=_0x331656[_0x6b09('0x15')]){throw Error(_0x6b09('0x16'));}_0x402f1f(_0x2f7ecb);})[_0x6b09('0x17')](function(_0x28f15d){_0x10dadf(_0x28f15d);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index aa57792..d47ce77 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8aa=['exports','status','render','json','send'];(function(_0x29f9af,_0x4f3d10){var _0x56e4a8=function(_0x2e2554){while(--_0x2e2554){_0x29f9af['push'](_0x29f9af['shift']());}};_0x56e4a8(++_0x4f3d10);}(_0xf8aa,0x13b));var _0xaf8a=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xf8aa[_0x5f3f88];return _0xd08119;};'use strict';module[_0xaf8a('0x0')][0x194]=function pageNotFound(_0x4c2810,_0x525e2e){var _0x3b77fb='404';var _0x2534bb=0x194;var _0x3abeb3={'status':_0x2534bb};_0x525e2e[_0xaf8a('0x1')](_0x3abeb3[_0xaf8a('0x1')]);_0x525e2e[_0xaf8a('0x2')](_0x3b77fb,{},function(_0x4309d2,_0x33862d){if(_0x4309d2){return _0x525e2e[_0xaf8a('0x1')](_0x3abeb3[_0xaf8a('0x1')])[_0xaf8a('0x3')](_0x3abeb3);}_0x525e2e[_0xaf8a('0x4')](_0x33862d);});}; \ No newline at end of file +var _0x2b79=['404','status','render','send'];(function(_0x512891,_0x46005a){var _0x1c190c=function(_0x42b95b){while(--_0x42b95b){_0x512891['push'](_0x512891['shift']());}};_0x1c190c(++_0x46005a);}(_0x2b79,0x138));var _0x92b7=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x2b79[_0x271537];return _0x19dc22;};'use strict';module['exports'][0x194]=function pageNotFound(_0x1d3de3,_0x452277){var _0x45ef03=_0x92b7('0x0');var _0x31072b=0x194;var _0x45bfae={'status':_0x31072b};_0x452277[_0x92b7('0x1')](_0x45bfae[_0x92b7('0x1')]);_0x452277[_0x92b7('0x2')](_0x45ef03,{},function(_0x2c359f,_0x8baab){if(_0x2c359f){return _0x452277['status'](_0x45bfae[_0x92b7('0x1')])['json'](_0x45bfae);}_0x452277[_0x92b7('0x3')](_0x8baab);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 928fcc8..531f666 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcdc=['SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','CmList','Lists','cm_user_has_lists','user_has_teams','FaxInteraction','user_has_sms_interactions','user_has_openchannel_interactions','MailQueues','UserMailQueue','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperBlacks','JscriptySessions','TrunkId','belongsTo','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Team','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceQueueReport','uniqueid','AgentReports','ContactId','MailAccountId','MailServerOut','MailServerIn','Imap','Dispositions','CannedAnswer','Interactions','MailApplication','ListId','Template','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','ChatOfflineMessage','ChatOfflineMessageId','restrict','IntervalId','TagId','List','Contact','Dashboard','FaxAccountId','fax_interaction_has_tags','ThroughTags','user_has_fax_interactions','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','Answers','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','chat_group_has_users','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','Any','OneAny','Actions','AutomationId','ParentId','Intervals','ChatApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','AnalyticCustomReport','CustomReportId','whatsapp_interaction_has_tags','AllCondition','Trigger','TriggerAnyId','TriggerId','Fields','MetricId','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Variable','VariableId','SugarcrmField','Descriptions','Field','int_desk_configuration_has_tags','Configurations','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Configuration','FreshsalesConfiguration','FreshsalesField','ChatQueueReport','ToId','SessionId','ProjectId','VoiceQueues','team_has_openchannel_queues','HopperHistories','TrunkBackup','TrunkBackupId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToQueue','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','FromUserId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToAccount','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CmCustomField','CustomFields','Contacts','Queues','UserProfileSection','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','user_has_whatsapp_interactions','WhatsappMessage','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','xcall','xC@LL1234','utf8mb4','name','utf8_general_ci','sequelizeHistory','defaultsDeep','127.0.0.1','database','username','password','options','../api/user/user.model','VoiceChanSpy','import','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../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/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.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','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../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','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','User','hasOne','cascade','UserId','Recordings','hasMany','UserVoiceQueueRt','Extensions','CmHopperFinal','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions'];(function(_0x3fe139,_0x34ddcd){var _0x9b11ca=function(_0x3a328c){while(--_0x3a328c){_0x3fe139['push'](_0x3fe139['shift']());}};_0x9b11ca(++_0x34ddcd);}(_0xbcdc,0xde));var _0xcbcd=function(_0x4e29a6,_0x552027){_0x4e29a6=_0x4e29a6-0x0;var _0x142411=_0xbcdc[_0x4e29a6];return _0x142411;};'use strict';var config=require(_0xcbcd('0x0'));var Sequelize=require(_0xcbcd('0x1'));var _=require(_0xcbcd('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0xcbcd('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':'motion2','username':_0xcbcd('0x3'),'password':_0xcbcd('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xcbcd('0x5')},'logging':![],'timezone':timezone[_0xcbcd('0x6')](),'define':{'charset':'utf8','collate':_0xcbcd('0x7')}}});config[_0xcbcd('0x8')]=_[_0xcbcd('0x9')](config[_0xcbcd('0x8')],{'database':'motion2','username':_0xcbcd('0x3'),'password':_0xcbcd('0x4'),'options':{'host':_0xcbcd('0xa'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xcbcd('0x5')},'logging':![],'timezone':timezone[_0xcbcd('0x6')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcbcd('0x1')][_0xcbcd('0xb')],config[_0xcbcd('0x1')][_0xcbcd('0xc')],config[_0xcbcd('0x1')][_0xcbcd('0xd')],config[_0xcbcd('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcbcd('0x8')][_0xcbcd('0xb')],config[_0xcbcd('0x8')][_0xcbcd('0xc')],config[_0xcbcd('0x8')][_0xcbcd('0xd')],config[_0xcbcd('0x8')][_0xcbcd('0xe')])};db['User']=db['sequelize']['import'](_0xcbcd('0xf'));db[_0xcbcd('0x10')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xcbcd('0x12')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x13'));db[_0xcbcd('0x14')]=db[_0xcbcd('0x1')]['import']('../api/voiceExtension/voiceExtension.model');db[_0xcbcd('0x15')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x16'));db[_0xcbcd('0x17')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x18'));db[_0xcbcd('0x19')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x1a'));db['ScreenRecording']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x1b'));db[_0xcbcd('0x1c')]=db['sequelize']['import'](_0xcbcd('0x1d'));db[_0xcbcd('0x1e')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x1f'));db[_0xcbcd('0x20')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x21'));db[_0xcbcd('0x22')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x23'));db['VoiceAgentReport']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x24'));db['VoiceQueueReport']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x25'));db[_0xcbcd('0x26')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x27'));db[_0xcbcd('0x28')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x29'));db['VoiceTransferReport']=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x2a'));db[_0xcbcd('0x2b')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xcbcd('0x2c')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x2d'));db['UserMailQueue']=db['sequelize']['import'](_0xcbcd('0x2e'));db[_0xcbcd('0x2f')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x30'));db[_0xcbcd('0x31')]=db['sequelize'][_0xcbcd('0x11')]('../api/userSmsQueue/userSmsQueue.model');db[_0xcbcd('0x32')]=db['sequelize']['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xcbcd('0x33')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x34'));db['MailServerIn']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x35'));db['MailServerOut']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x36'));db['MailAccount']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x37'));db[_0xcbcd('0x38')]=db[_0xcbcd('0x1')]['import']('../api/mailQueue/mailQueue.model');db[_0xcbcd('0x39')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x3a'));db[_0xcbcd('0x3b')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x3c'));db[_0xcbcd('0x3d')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x3e'));db['MailApplication']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x3f'));db[_0xcbcd('0x40')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x41'));db['Dashboard']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x42'));db[_0xcbcd('0x43')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x44'));db['FaxAccount']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x45'));db[_0xcbcd('0x46')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x47'));db[_0xcbcd('0x48')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x49'));db[_0xcbcd('0x4a')]=db['sequelize'][_0xcbcd('0x11')]('../api/faxQueue/faxQueue.model');db[_0xcbcd('0x4b')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x4c'));db[_0xcbcd('0x4d')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x4e'));db[_0xcbcd('0x4f')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x50'));db['SmsInteraction']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x51'));db['SmsMessage']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x52'));db[_0xcbcd('0x53')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/smsQueue/smsQueue.model');db[_0xcbcd('0x54')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/openchannelAccount/openchannelAccount.model');db[_0xcbcd('0x55')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/openchannelApplication/openchannelApplication.model');db[_0xcbcd('0x56')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x57'));db[_0xcbcd('0x58')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x59'));db[_0xcbcd('0x5a')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x5b'));db['ChatWebsite']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x5c'));db['OpenchannelQueueReport']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x5d'));db[_0xcbcd('0x5e')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x5f'));db[_0xcbcd('0x60')]=db['sequelize']['import'](_0xcbcd('0x61'));db[_0xcbcd('0x62')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x63'));db['ChatQueue']=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/chatQueue/chatQueue.model');db[_0xcbcd('0x64')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x65'));db[_0xcbcd('0x66')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x67'));db[_0xcbcd('0x68')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x69'));db[_0xcbcd('0x6a')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x6b'));db[_0xcbcd('0x6c')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/cmHopper/cmHopper.model');db[_0xcbcd('0x6d')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x6e'));db['CmHopperFinal']=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xcbcd('0x6f')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x70'));db['ReportAgentPreview']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x71'));db['CmCustomField']=db['sequelize']['import']('../api/cmCustomField/cmCustomField.model');db[_0xcbcd('0x72')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x73'));db[_0xcbcd('0x74')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/automation/automation.model');db['CannedAnswer']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x75'));db[_0xcbcd('0x76')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x77'));db[_0xcbcd('0x78')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x79'));db[_0xcbcd('0x7a')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x7b'));db[_0xcbcd('0x7c')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x7d'));db[_0xcbcd('0x7e')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x7f'));db['VoiceQueuesLog']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x80'));db['Schedule']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x81'));db[_0xcbcd('0x82')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x83'));db[_0xcbcd('0x84')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x85'));db['Template']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x86'));db['Trigger']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x87'));db['Variable']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x88'));db[_0xcbcd('0x89')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x8a'));db[_0xcbcd('0x8b')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x8c'));db['AnalyticDefaultReport']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x8d'));db[_0xcbcd('0x8e')]=db['sequelize'][_0xcbcd('0x11')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xcbcd('0x8f')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x90'));db[_0xcbcd('0x91')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x92'));db[_0xcbcd('0x93')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x94'));db[_0xcbcd('0x95')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x96'));db[_0xcbcd('0x97')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x98'));db[_0xcbcd('0x99')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x9a'));db[_0xcbcd('0x9b')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x9c'));db[_0xcbcd('0x9d')]=db[_0xcbcd('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x9e'));db[_0xcbcd('0x9f')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xa0'));db[_0xcbcd('0xa1')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xa2'));db[_0xcbcd('0xa3')]=db[_0xcbcd('0x1')]['import']('../api/intDeskField/intDeskField.model');db[_0xcbcd('0xa4')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xa5'));db[_0xcbcd('0xa6')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xa7'));db[_0xcbcd('0xa8')]=db['sequelize'][_0xcbcd('0x11')]('../api/intZohoField/intZohoField.model');db[_0xcbcd('0xa9')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xaa'));db[_0xcbcd('0xab')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xac'));db[_0xcbcd('0xad')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xae'));db[_0xcbcd('0xaf')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xb0'));db[_0xcbcd('0xb1')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xb2'));db[_0xcbcd('0xb3')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xb4'));db[_0xcbcd('0xb5')]=db[_0xcbcd('0x1')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0xcbcd('0xb6')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xcbcd('0xb7')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xb8'));db[_0xcbcd('0xb9')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xba'));db[_0xcbcd('0xbb')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xbc'));db[_0xcbcd('0xbd')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xbe'));db[_0xcbcd('0xbf')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xc0'));db['Dynamics365Configuration']=db['sequelize']['import'](_0xcbcd('0xc1'));db[_0xcbcd('0xc2')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xcbcd('0xc3')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xc4'));db['FreshsalesConfiguration']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xc5'));db['FreshsalesField']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xc6'));db[_0xcbcd('0x89')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/integration/integration.model');db[_0xcbcd('0xc7')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xc8'));db['ChatQueueReport']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xc9'));db[_0xcbcd('0xca')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xcb'));db[_0xcbcd('0xcc')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xcd'));db[_0xcbcd('0xce')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xcf'));db[_0xcbcd('0xd0')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xd1'));db[_0xcbcd('0xd2')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xd3'));db[_0xcbcd('0xd4')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/squareReport/squareReport.model');db[_0xcbcd('0xd5')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xd6'));db[_0xcbcd('0xd7')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xd8'));db[_0xcbcd('0xd9')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xda'));db[_0xcbcd('0xdb')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xdc'));db[_0xcbcd('0xdd')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xde'));db[_0xcbcd('0xdf')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xe0'));db[_0xcbcd('0xe1')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xe2'));db['Team']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xe3'));db['License']=db[_0xcbcd('0x1')]['import']('../api/license/license.model');db[_0xcbcd('0xe4')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xe5'));db[_0xcbcd('0xe6')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xe7'));db[_0xcbcd('0xe8')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xe9'));db[_0xcbcd('0xea')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xeb'));db[_0xcbcd('0xec')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xed'));db['ChatTransferReport']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xee'));db[_0xcbcd('0xef')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf0'));db[_0xcbcd('0xf1')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf2'));db['SmsTransferReport']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf3'));db['CmList']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xf4'));db[_0xcbcd('0xf5')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf6'));db[_0xcbcd('0xf7')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf8'));db['UserProfileSection']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf9'));db[_0xcbcd('0xfa')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xfb'));db[_0xcbcd('0xfc')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xfd'));db['WhatsappAccount']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xfe'));db[_0xcbcd('0xff')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x100'));db[_0xcbcd('0x101')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x102'));db['WhatsappMessage']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x103'));db[_0xcbcd('0x104')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x105'));db[_0xcbcd('0x106')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x107'));db[_0xcbcd('0x108')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x109'));db[_0xcbcd('0x10a')]=db['sequelize'][_0xcbcd('0x11')]('../api/cloudProvider/cloudProvider.model');db[_0xcbcd('0x10b')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x10c'));db[_0xcbcd('0x10d')][_0xcbcd('0x10e')](db[_0xcbcd('0x1c')],{'as':'VoiceMail','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')]['hasMany'](db[_0xcbcd('0x19')],{'as':_0xcbcd('0x111'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')][_0xcbcd('0x112')](db[_0xcbcd('0x113')],{'as':'VoiceQueuesRt','foreignKey':_0xcbcd('0x110')});db['User'][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'as':_0xcbcd('0x114'),'onDelete':_0xcbcd('0x10f'),'hooks':!![]});db['User'][_0xcbcd('0x112')](db[_0xcbcd('0x115')],{'as':'HopperFinals','foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')]['hasMany'](db[_0xcbcd('0x6f')],{'as':_0xcbcd('0x116'),'foreignKey':_0xcbcd('0x110')});db['User'][_0xcbcd('0x112')](db[_0xcbcd('0x117')],{'as':_0xcbcd('0x117'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')][_0xcbcd('0x112')](db[_0xcbcd('0x56')],{'as':_0xcbcd('0x118'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')][_0xcbcd('0x112')](db[_0xcbcd('0x60')],{'as':_0xcbcd('0x119'),'foreignKey':_0xcbcd('0x110')});db['User'][_0xcbcd('0x112')](db[_0xcbcd('0x11a')],{'as':_0xcbcd('0x11b'),'foreignKey':_0xcbcd('0x110')});db['User'][_0xcbcd('0x112')](db['FaxInteraction'],{'as':_0xcbcd('0x11c'),'foreignKey':_0xcbcd('0x110')});db['User']['hasMany'](db['MailInteraction'],{'as':_0xcbcd('0x11d'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')][_0xcbcd('0x112')](db[_0xcbcd('0x101')],{'as':_0xcbcd('0x11e'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')][_0xcbcd('0x112')](db['UserNotification'],{'as':_0xcbcd('0x11f'),'foreignKey':_0xcbcd('0x120')});db[_0xcbcd('0x10d')]['belongsTo'](db['UserProfile'],{'as':'UserProfile','foreignKey':_0xcbcd('0x121')});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x64')],{'as':'Groups','through':'chat_group_has_users'});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x6a')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x124'),'through':_0xcbcd('0x125')});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db['Team'],{'through':_0xcbcd('0x126')});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x3b')],{'as':_0xcbcd('0x11d'),'through':'user_has_mail_interactions'});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db['ChatInteraction'],{'as':_0xcbcd('0x119'),'through':'user_has_chat_interactions'});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x127')],{'as':_0xcbcd('0x11c'),'through':'user_has_fax_interactions'});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x11a')],{'as':_0xcbcd('0x11b'),'through':_0xcbcd('0x128')});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x56')],{'as':_0xcbcd('0x118'),'through':_0xcbcd('0x129')});db[_0xcbcd('0x10d')]['belongsToMany'](db[_0xcbcd('0x101')],{'as':_0xcbcd('0x11e'),'through':'user_has_whatsapp_interactions'});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x17')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0xcbcd('0x10d')]['belongsToMany'](db[_0xcbcd('0x38')],{'as':_0xcbcd('0x12a'),'through':_0xcbcd('0x12b'),'required':![]});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x12c')],{'as':_0xcbcd('0x12d'),'through':_0xcbcd('0x2c'),'required':![],'hooks':!![]});db[_0xcbcd('0x10d')]['belongsToMany'](db[_0xcbcd('0x4a')],{'as':_0xcbcd('0x12e'),'through':_0xcbcd('0x2f'),'required':![]});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x53')],{'as':_0xcbcd('0x12f'),'through':_0xcbcd('0x31'),'required':![]});db['User'][_0xcbcd('0x122')](db['OpenchannelQueue'],{'as':_0xcbcd('0x130'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xcbcd('0x122')](db['WhatsappQueue'],{'as':_0xcbcd('0x131'),'through':_0xcbcd('0x33'),'required':![]});db[_0xcbcd('0x10d')]['belongsToMany'](db[_0xcbcd('0x123')],{'through':_0xcbcd('0x125')});db['User'][_0xcbcd('0x122')](db['VoicePrefix'],{'as':_0xcbcd('0x132'),'through':_0xcbcd('0x133'),'required':![]});db[_0xcbcd('0x10d')]['belongsToMany'](db[_0xcbcd('0x134')],{'as':_0xcbcd('0x135'),'through':'user_has_chat_websites'});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x136')],{'as':_0xcbcd('0x137'),'through':_0xcbcd('0x138')});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x139')],{'as':_0xcbcd('0x13a'),'through':_0xcbcd('0x13b')});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x54')],{'as':_0xcbcd('0x13c'),'through':_0xcbcd('0x13d')});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x4d')],{'as':_0xcbcd('0x13e'),'through':_0xcbcd('0x13f')});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x140')],{'as':_0xcbcd('0x141'),'through':'user_has_whatsapp_accounts'});db['User']['belongsToMany'](db[_0xcbcd('0xdd')],{'as':'SquareProjects','through':_0xcbcd('0x142')});db[_0xcbcd('0x10')][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'as':_0xcbcd('0x143'),'onDelete':'cascade','foreignKey':_0xcbcd('0x144')});db[_0xcbcd('0x12')][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'onDelete':_0xcbcd('0x10f')});db['VoiceExtension'][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'as':_0xcbcd('0x145'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x15')]['belongsToMany'](db[_0xcbcd('0x82')],{'as':_0xcbcd('0x146'),'through':_0xcbcd('0x147')});db['VoiceQueue'][_0xcbcd('0x112')](db[_0xcbcd('0x113')],{'as':_0xcbcd('0x148'),'foreignKey':_0xcbcd('0x149')});db[_0xcbcd('0x17')][_0xcbcd('0x112')](db['CmHopper'],{'as':_0xcbcd('0x14a'),'foreignKey':_0xcbcd('0x149')});db[_0xcbcd('0x17')][_0xcbcd('0x112')](db[_0xcbcd('0x115')],{'as':_0xcbcd('0x14b'),'foreignKey':'VoiceQueueId'});db[_0xcbcd('0x17')][_0xcbcd('0x112')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xcbcd('0x149')});db['VoiceQueue']['hasMany'](db[_0xcbcd('0x117')],{'as':'ReportAgentPreview','foreignKey':_0xcbcd('0x149')});db['VoiceQueue']['hasMany'](db[_0xcbcd('0x6d')],{'as':_0xcbcd('0x14c'),'foreignKey':_0xcbcd('0x149')});db['VoiceQueue']['hasMany'](db[_0xcbcd('0xd0')],{'as':_0xcbcd('0x14d'),'foreignKey':_0xcbcd('0x149')});db[_0xcbcd('0x17')]['belongsTo'](db[_0xcbcd('0x28')],{'as':_0xcbcd('0x28'),'foreignKey':_0xcbcd('0x14e')});db[_0xcbcd('0x17')][_0xcbcd('0x14f')](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xcbcd('0x17')][_0xcbcd('0x14f')](db['Interval'],{'as':_0xcbcd('0x7a'),'foreignKey':'IntervalId'});db[_0xcbcd('0x17')][_0xcbcd('0x14f')](db[_0xcbcd('0x7c')],{'as':'mandatoryDispositionPause','foreignKey':_0xcbcd('0x150')});db['VoiceQueue'][_0xcbcd('0x122')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x124'),'through':_0xcbcd('0x151')});db[_0xcbcd('0x17')][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x152'),'through':'UserVoiceQueue'});db[_0xcbcd('0x17')][_0xcbcd('0x122')](db[_0xcbcd('0x153')],{'as':_0xcbcd('0x154'),'through':_0xcbcd('0x10b')});db['VoiceQueue'][_0xcbcd('0x122')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x155'),'through':_0xcbcd('0x156')});db[_0xcbcd('0x19')][_0xcbcd('0x14f')](db['User'],{'as':_0xcbcd('0x10d'),'foreignKey':_0xcbcd('0x110')});db['ScreenRecording'][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x10d'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x1c')]['hasMany'](db[_0xcbcd('0x1e')],{'as':_0xcbcd('0x157'),'onDelete':_0xcbcd('0x10f'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0xcbcd('0x1e')][_0xcbcd('0x14f')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xcbcd('0x158')});db[_0xcbcd('0x20')][_0xcbcd('0x112')](db[_0xcbcd('0x159')],{'as':'QueueCalls','foreignKey':_0xcbcd('0x15a'),'constraints':![]});db[_0xcbcd('0x20')][_0xcbcd('0x112')](db['VoiceAgentReport'],{'as':_0xcbcd('0x15b'),'foreignKey':_0xcbcd('0x15a'),'constraints':![]});db[_0xcbcd('0x20')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x10d'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x20')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xcbcd('0x15c')});db['MailServerIn'][_0xcbcd('0x14f')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xcbcd('0x15d')});db[_0xcbcd('0x15e')][_0xcbcd('0x14f')](db[_0xcbcd('0x139')],{'as':'MailAccount','foreignKey':_0xcbcd('0x15d')});db[_0xcbcd('0x139')][_0xcbcd('0x10e')](db[_0xcbcd('0x15f')],{'as':_0xcbcd('0x160'),'onDelete':'cascade'});db[_0xcbcd('0x139')][_0xcbcd('0x10e')](db[_0xcbcd('0x15e')],{'as':'Smtp','onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x139')][_0xcbcd('0x112')](db['Disposition'],{'as':_0xcbcd('0x161'),'foreignKey':_0xcbcd('0x15d'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x139')][_0xcbcd('0x112')](db[_0xcbcd('0x162')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0xcbcd('0x139')]['hasMany'](db['MailMessage'],{'as':_0xcbcd('0x157'),'foreignKey':_0xcbcd('0x15d')});db[_0xcbcd('0x139')][_0xcbcd('0x112')](db[_0xcbcd('0x3b')],{'as':_0xcbcd('0x163')});db[_0xcbcd('0x139')][_0xcbcd('0x112')](db[_0xcbcd('0x164')],{'as':'Applications'});db[_0xcbcd('0x139')]['belongsTo'](db[_0xcbcd('0x123')],{'as':'List','foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x139')][_0xcbcd('0x14f')](db[_0xcbcd('0x166')],{'as':'Template','foreignKey':'TemplateId'});db['MailAccount'][_0xcbcd('0x14f')](db['Pause'],{'as':_0xcbcd('0x167'),'foreignKey':_0xcbcd('0x150')});db['MailAccount']['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x13b')});db[_0xcbcd('0x38')][_0xcbcd('0x122')](db['User'],{'as':'Agents','through':'UserMailQueue'});db[_0xcbcd('0x38')]['belongsToMany'](db['Team'],{'through':_0xcbcd('0x168'),'as':'Teams'});db['MailInteraction'][_0xcbcd('0x112')](db[_0xcbcd('0x3d')],{'as':'Messages','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x169')});db[_0xcbcd('0x3b')]['belongsTo'](db[_0xcbcd('0x139')],{'as':_0xcbcd('0x16a'),'foreignKey':'MailAccountId'});db[_0xcbcd('0x3b')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':'Contact','foreignKey':'ContactId'});db[_0xcbcd('0x3b')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db['MailInteraction']['belongsToMany'](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x16c'),'as':_0xcbcd('0x16d')});db[_0xcbcd('0x3b')]['belongsToMany'](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x16c'),'as':'ThroughTags'});db[_0xcbcd('0x3b')]['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':'user_has_mail_interactions','foreignKey':_0xcbcd('0x169')});db[_0xcbcd('0x3d')][_0xcbcd('0x112')](db[_0xcbcd('0xe8')],{'as':_0xcbcd('0x16f'),'onDelete':'cascade'});db[_0xcbcd('0x3d')]['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x10d')});db['MailMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':'cascade','as':'Contact'});db[_0xcbcd('0x3d')]['belongsTo'](db[_0xcbcd('0x3b')],{'as':_0xcbcd('0x170'),'foreignKey':'MailInteractionId'});db[_0xcbcd('0x3d')]['belongsTo'](db[_0xcbcd('0x139')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x15d')});db['MailMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db['MailMessage']['belongsTo'](db[_0xcbcd('0x171')],{'as':_0xcbcd('0x171'),'foreignKey':_0xcbcd('0x172')});db[_0xcbcd('0x164')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x164')][_0xcbcd('0x14f')](db['MailQueue'],{'onDelete':'restrict'});db[_0xcbcd('0x164')][_0xcbcd('0x14f')](db['MailAccount'],{'onDelete':_0xcbcd('0x173')});db['MailApplication'][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'onDelete':_0xcbcd('0x173'),'foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0x164')][_0xcbcd('0x14f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xcbcd('0x175')});db[_0xcbcd('0x40')][_0xcbcd('0x14f')](db[_0xcbcd('0x139')],{});db[_0xcbcd('0x40')][_0xcbcd('0x14f')](db['CmList'],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db['MailQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x40')][_0xcbcd('0x14f')](db[_0xcbcd('0x3b')],{});db[_0xcbcd('0x40')][_0xcbcd('0x14f')](db[_0xcbcd('0x3d')],{});db[_0xcbcd('0x40')][_0xcbcd('0x14f')](db['User'],{});db['MailQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x38')],{});db[_0xcbcd('0x178')][_0xcbcd('0x112')](db['DashboardItem'],{'as':'Items','onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x136')]['hasMany'](db[_0xcbcd('0x76')],{'as':'Dispositions','foreignKey':_0xcbcd('0x179'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x136')]['hasMany'](db[_0xcbcd('0x162')],{'as':'Answers','foreignKey':_0xcbcd('0x179')});db[_0xcbcd('0x136')][_0xcbcd('0x112')](db['FaxInteraction'],{'as':_0xcbcd('0x163')});db['FaxAccount'][_0xcbcd('0x112')](db[_0xcbcd('0x46')],{'as':_0xcbcd('0x145')});db[_0xcbcd('0x136')][_0xcbcd('0x112')](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db['FaxAccount']['hasMany'](db['FaxMessage'],{'as':_0xcbcd('0x157')});db['FaxAccount'][_0xcbcd('0x14f')](db[_0xcbcd('0x28')],{'as':'Trunk'});db[_0xcbcd('0x136')]['belongsTo'](db[_0xcbcd('0x123')],{'as':'List','foreignKey':_0xcbcd('0x165')});db['FaxAccount'][_0xcbcd('0x14f')](db['Pause'],{'as':_0xcbcd('0x167'),'foreignKey':_0xcbcd('0x150')});db[_0xcbcd('0x136')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':'Agents','through':_0xcbcd('0x138')});db[_0xcbcd('0x46')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':'restrict'});db[_0xcbcd('0x46')]['belongsTo'](db[_0xcbcd('0x4a')],{'onDelete':_0xcbcd('0x173')});db['FaxApplication'][_0xcbcd('0x14f')](db[_0xcbcd('0x136')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x46')][_0xcbcd('0x14f')](db['Tag'],{'onDelete':_0xcbcd('0x173'),'foreignKey':'TagId'});db[_0xcbcd('0x127')]['hasMany'](db[_0xcbcd('0x48')],{'as':_0xcbcd('0x157'),'onDelete':_0xcbcd('0x10f'),'foreignKey':'FaxInteractionId'});db[_0xcbcd('0x127')]['belongsTo'](db[_0xcbcd('0x136')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x179')});db[_0xcbcd('0x127')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x127')]['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x127')][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x17a'),'as':_0xcbcd('0x16d')});db[_0xcbcd('0x127')][_0xcbcd('0x122')](db['Tag'],{'through':_0xcbcd('0x17a'),'as':_0xcbcd('0x17b')});db[_0xcbcd('0x127')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x17c'),'foreignKey':_0xcbcd('0x17d')});db[_0xcbcd('0x48')]['belongsTo'](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x10f'),'as':'User'});db[_0xcbcd('0x48')]['belongsTo'](db[_0xcbcd('0x127')],{'as':_0xcbcd('0x170'),'foreignKey':_0xcbcd('0x17d')});db['FaxMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':'cascade','as':_0xcbcd('0x177')});db[_0xcbcd('0x48')][_0xcbcd('0x14f')](db[_0xcbcd('0xe8')],{'as':_0xcbcd('0xe8'),'foreignKey':_0xcbcd('0x17e')});db['FaxMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x136')],{'as':_0xcbcd('0x16a'),'foreignKey':'FaxAccountId'});db[_0xcbcd('0x4a')]['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':'UserFaxQueue'});db[_0xcbcd('0x4a')][_0xcbcd('0x122')](db[_0xcbcd('0x153')],{'through':_0xcbcd('0x17f'),'as':'Teams'});db['FaxQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x136')],{});db['FaxQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x4b')]['belongsTo'](db['CmContact'],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db['FaxQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x127')],{});db[_0xcbcd('0x4b')][_0xcbcd('0x14f')](db['FaxMessage'],{});db[_0xcbcd('0x4b')]['belongsTo'](db[_0xcbcd('0x10d')],{});db[_0xcbcd('0x4b')][_0xcbcd('0x14f')](db[_0xcbcd('0x4a')],{});db[_0xcbcd('0x4d')][_0xcbcd('0x112')](db[_0xcbcd('0x76')],{'as':_0xcbcd('0x161'),'foreignKey':_0xcbcd('0x180'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x4d')][_0xcbcd('0x112')](db[_0xcbcd('0x162')],{'as':_0xcbcd('0x181'),'foreignKey':_0xcbcd('0x180')});db['SmsAccount']['hasMany'](db[_0xcbcd('0x182')],{'as':_0xcbcd('0x157'),'foreignKey':_0xcbcd('0x180')});db['SmsAccount']['hasMany'](db[_0xcbcd('0x11a')],{'as':_0xcbcd('0x163')});db[_0xcbcd('0x4d')][_0xcbcd('0x112')](db[_0xcbcd('0x4f')],{'as':_0xcbcd('0x145')});db['SmsAccount'][_0xcbcd('0x14f')](db['CmList'],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db['SmsAccount'][_0xcbcd('0x14f')](db[_0xcbcd('0x7c')],{'as':_0xcbcd('0x167'),'foreignKey':_0xcbcd('0x150')});db[_0xcbcd('0x4d')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xcbcd('0x13f')});db[_0xcbcd('0x4f')][_0xcbcd('0x14f')](db['User'],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x4f')]['belongsTo'](db[_0xcbcd('0x53')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x4f')][_0xcbcd('0x14f')](db[_0xcbcd('0x4d')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x4f')][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['SmsApplication'][_0xcbcd('0x14f')](db[_0xcbcd('0x84')],{'onDelete':_0xcbcd('0x173'),'foreignKey':_0xcbcd('0x175')});db[_0xcbcd('0x11a')][_0xcbcd('0x112')](db[_0xcbcd('0x182')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xcbcd('0x183')});db[_0xcbcd('0x11a')][_0xcbcd('0x14f')](db[_0xcbcd('0x4d')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x180')});db[_0xcbcd('0x11a')][_0xcbcd('0x14f')](db['CmContact'],{'as':'Contact','foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x11a')]['belongsTo'](db['User'],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x11a')][_0xcbcd('0x122')](db['Tag'],{'through':_0xcbcd('0x184'),'as':_0xcbcd('0x16d')});db[_0xcbcd('0x11a')][_0xcbcd('0x122')](db['Tag'],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0xcbcd('0x11a')]['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x128'),'foreignKey':_0xcbcd('0x183')});db[_0xcbcd('0x182')]['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x10d')});db[_0xcbcd('0x182')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x177')});db[_0xcbcd('0x182')][_0xcbcd('0x14f')](db[_0xcbcd('0x11a')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x170'),'foreignKey':'SmsInteractionId'});db[_0xcbcd('0x182')][_0xcbcd('0x14f')](db[_0xcbcd('0x4d')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x180')});db[_0xcbcd('0x53')][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x152'),'through':'UserSmsQueue','foreignKey':_0xcbcd('0x185')});db['SmsQueue'][_0xcbcd('0x122')](db[_0xcbcd('0x153')],{'through':_0xcbcd('0x186'),'as':_0xcbcd('0x154')});db['OpenchannelAccount'][_0xcbcd('0x112')](db[_0xcbcd('0x76')],{'as':'Dispositions','foreignKey':_0xcbcd('0x187'),'onDelete':'cascade'});db['OpenchannelAccount']['hasMany'](db[_0xcbcd('0x162')],{'as':'Answers','foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x54')][_0xcbcd('0x112')](db[_0xcbcd('0x56')],{'as':'Interactions','foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x54')]['hasMany'](db[_0xcbcd('0x58')],{'as':_0xcbcd('0x157'),'foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x54')][_0xcbcd('0x112')](db[_0xcbcd('0x55')],{'as':_0xcbcd('0x145'),'foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x54')]['belongsTo'](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x54')][_0xcbcd('0x14f')](db['Pause'],{'as':_0xcbcd('0x167'),'foreignKey':_0xcbcd('0x150')});db['OpenchannelAccount'][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':'Agents','through':_0xcbcd('0x13d')});db['OpenchannelApplication'][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x55')][_0xcbcd('0x14f')](db[_0xcbcd('0x5a')],{'onDelete':'restrict','foreignKey':_0xcbcd('0x188')});db['OpenchannelApplication']['belongsTo'](db[_0xcbcd('0x54')],{'onDelete':_0xcbcd('0x173'),'foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x55')][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'onDelete':_0xcbcd('0x173'),'foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0x55')]['belongsTo'](db[_0xcbcd('0x84')],{'onDelete':_0xcbcd('0x173'),'foreignKey':_0xcbcd('0x175')});db[_0xcbcd('0x56')][_0xcbcd('0x112')](db[_0xcbcd('0x58')],{'as':'Messages','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x189')});db[_0xcbcd('0x56')][_0xcbcd('0x14f')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x56')]['belongsTo'](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x56')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x56')][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x18a'),'as':'Tags'});db[_0xcbcd('0x56')][_0xcbcd('0x122')](db['Tag'],{'through':_0xcbcd('0x18a'),'as':_0xcbcd('0x17b')});db[_0xcbcd('0x56')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x129'),'foreignKey':_0xcbcd('0x189')});db[_0xcbcd('0x58')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x10f'),'as':'User'});db[_0xcbcd('0x58')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x177')});db[_0xcbcd('0x58')][_0xcbcd('0x14f')](db['OpenchannelInteraction'],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x170'),'foreignKey':'OpenchannelInteractionId'});db[_0xcbcd('0x58')][_0xcbcd('0x14f')](db[_0xcbcd('0xe8')],{'as':_0xcbcd('0xe8'),'foreignKey':_0xcbcd('0x17e')});db[_0xcbcd('0x58')][_0xcbcd('0x14f')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xcbcd('0x187')});db['OpenchannelQueue'][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x32'),'foreignKey':'OpenchannelQueueId'});db[_0xcbcd('0x5a')][_0xcbcd('0x122')](db[_0xcbcd('0x153')],{'through':'team_has_openchannel_queues','as':_0xcbcd('0x154')});db['ChatWebsite'][_0xcbcd('0x112')](db[_0xcbcd('0x76')],{'as':_0xcbcd('0x161'),'foreignKey':_0xcbcd('0x18b'),'onDelete':_0xcbcd('0x10f')});db['ChatWebsite'][_0xcbcd('0x112')](db[_0xcbcd('0x162')],{'as':'Answers','foreignKey':_0xcbcd('0x18b')});db[_0xcbcd('0x134')]['hasMany'](db['ChatProactiveAction'],{'as':_0xcbcd('0x18c')});db[_0xcbcd('0x134')][_0xcbcd('0x112')](db[_0xcbcd('0x60')],{'as':_0xcbcd('0x163')});db[_0xcbcd('0x134')]['hasMany'](db[_0xcbcd('0x5e')],{'as':_0xcbcd('0x145')});db['ChatWebsite'][_0xcbcd('0x112')](db['ChatMessage'],{'as':_0xcbcd('0x157')});db[_0xcbcd('0x134')][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x134')][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'as':_0xcbcd('0x7a'),'foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0x134')][_0xcbcd('0x14f')](db[_0xcbcd('0x139')],{'as':'MailAccount','foreignKey':'MailAccountId'});db['ChatWebsite'][_0xcbcd('0x14f')](db['Pause'],{'as':_0xcbcd('0x167'),'foreignKey':_0xcbcd('0x150')});db['ChatWebsite']['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x18d')});db[_0xcbcd('0x18e')][_0xcbcd('0x14f')](db[_0xcbcd('0x54')],{});db['OpenchannelQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x18e')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':'Contact','foreignKey':'ContactId'});db[_0xcbcd('0x18e')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x58')],{});db[_0xcbcd('0x18e')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{});db[_0xcbcd('0x18e')][_0xcbcd('0x14f')](db['OpenchannelQueue'],{});db['ChatApplication']['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x18f'),'foreignKey':_0xcbcd('0x110'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x5e')][_0xcbcd('0x14f')](db['ChatQueue'],{'as':_0xcbcd('0x190'),'foreignKey':_0xcbcd('0x191'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x5e')][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':_0xcbcd('0x192'),'foreignKey':_0xcbcd('0x18b'),'onDelete':_0xcbcd('0x173')});db['ChatApplication'][_0xcbcd('0x14f')](db[_0xcbcd('0x84')],{'onDelete':_0xcbcd('0x173'),'foreignKey':'TagId'});db[_0xcbcd('0x60')][_0xcbcd('0x112')](db[_0xcbcd('0x62')],{'as':'Messages','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x193')});db[_0xcbcd('0x60')][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':'Account','foreignKey':_0xcbcd('0x18b')});db[_0xcbcd('0x60')]['belongsTo'](db[_0xcbcd('0x6a')],{'as':'Contact','foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x60')][_0xcbcd('0x14f')](db['User'],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db['ChatInteraction'][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x194'),'as':_0xcbcd('0x16d')});db[_0xcbcd('0x60')][_0xcbcd('0x122')](db['Tag'],{'through':_0xcbcd('0x194'),'as':_0xcbcd('0x17b')});db[_0xcbcd('0x60')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x195'),'foreignKey':_0xcbcd('0x193')});db[_0xcbcd('0x62')]['belongsTo'](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x10d')});db['ChatMessage'][_0xcbcd('0x14f')](db['CmContact'],{'onDelete':'cascade','as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db['ChatMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x60')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x170'),'foreignKey':_0xcbcd('0x193')});db[_0xcbcd('0x62')]['belongsTo'](db[_0xcbcd('0xe8')],{'as':_0xcbcd('0xe8'),'foreignKey':'AttachmentId'});db[_0xcbcd('0x62')][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':_0xcbcd('0x16a'),'foreignKey':'ChatWebsiteId'});db[_0xcbcd('0x171')]['hasMany'](db[_0xcbcd('0xe8')],{'as':'Attachments','foreignKey':_0xcbcd('0x172'),'onDelete':_0xcbcd('0x10f'),'hooks':!![]});db['ChatOfflineMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':_0xcbcd('0x10f'),'as':'Contact','foreignKey':_0xcbcd('0x15c')});db['ChatOfflineMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x18b')});db[_0xcbcd('0x12c')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x2c'),'hooks':!![]});db[_0xcbcd('0x12c')][_0xcbcd('0x122')](db[_0xcbcd('0x153')],{'through':_0xcbcd('0x196'),'as':'Teams'});db[_0xcbcd('0x64')]['hasMany'](db[_0xcbcd('0xca')],{'as':_0xcbcd('0x157'),'foreignKey':_0xcbcd('0x197'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x64')][_0xcbcd('0x122')](db['User'],{'as':'Members','through':_0xcbcd('0x198')});db['ChatProactiveAction'][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':_0xcbcd('0x192'),'foreignKey':'ChatWebsiteId'});db['CmCompany']['hasMany'](db[_0xcbcd('0x6a')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact'][_0xcbcd('0x112')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db['CmHopperFinal'],{'as':_0xcbcd('0x14b'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x6f')],{'as':'HopperHistories','foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x117')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db['CmContact'][_0xcbcd('0x112')](db[_0xcbcd('0xd0')],{'as':_0xcbcd('0x14d'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x6a')]['hasMany'](db[_0xcbcd('0x56')],{'as':_0xcbcd('0x118'),'foreignKey':_0xcbcd('0x15c'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x60')],{'as':_0xcbcd('0x119'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x11a')],{'as':_0xcbcd('0x11b'),'foreignKey':_0xcbcd('0x15c'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x127')],{'as':_0xcbcd('0x11c'),'foreignKey':_0xcbcd('0x15c'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x3b')],{'as':_0xcbcd('0x11d'),'foreignKey':_0xcbcd('0x15c'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x6a')]['belongsTo'](db[_0xcbcd('0x68')],{'as':_0xcbcd('0x199'),'foreignKey':'CompanyId'});db[_0xcbcd('0x6a')][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x6a')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x19a')});db['CmContact'][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'as':_0xcbcd('0x16d'),'through':_0xcbcd('0x19b')});db['CmContact']['belongsToMany'](db[_0xcbcd('0x84')],{'through':'cm_contact_has_tags','as':_0xcbcd('0x17b')});db['CmHopper'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':'ContactId','onDelete':_0xcbcd('0x10f')});db['CmHopper']['belongsTo'](db[_0xcbcd('0x123')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0xcbcd('0x6c')]['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x18f'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x6c')][_0xcbcd('0x14f')](db['VoiceQueue'],{'as':_0xcbcd('0x190'),'foreignKey':_0xcbcd('0x149'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x6c')]['belongsTo'](db[_0xcbcd('0xe4')],{'as':'Campaign','foreignKey':_0xcbcd('0x19c'),'onDelete':_0xcbcd('0x10f')});db['CmHopper'][_0xcbcd('0x14f')](db['User'],{'as':'Owner','foreignKey':_0xcbcd('0x19d')});db[_0xcbcd('0x6d')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':'ContactId','onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x6d')][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x6d')][_0xcbcd('0x14f')](db['VoiceQueue'],{'as':_0xcbcd('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x6d')][_0xcbcd('0x14f')](db[_0xcbcd('0xe4')],{'as':_0xcbcd('0xe4'),'foreignKey':_0xcbcd('0x19c'),'onDelete':_0xcbcd('0x10f')});db['Automation']['hasMany'](db[_0xcbcd('0x78')],{'as':{'plural':_0xcbcd('0x19e'),'singular':_0xcbcd('0x19f')},'foreignKey':'AutomationAllId','onDelete':_0xcbcd('0x10f'),'hooks':!![]});db[_0xcbcd('0x74')][_0xcbcd('0x112')](db[_0xcbcd('0x78')],{'as':{'plural':_0xcbcd('0x1a0'),'singular':_0xcbcd('0x1a1')},'foreignKey':'AutomationAnyId','onDelete':_0xcbcd('0x10f'),'hooks':!![]});db['Automation'][_0xcbcd('0x112')](db[_0xcbcd('0x72')],{'as':_0xcbcd('0x1a2'),'foreignKey':_0xcbcd('0x1a3'),'onDelete':_0xcbcd('0x10f'),'hooks':!![]});db[_0xcbcd('0x76')][_0xcbcd('0x112')](db[_0xcbcd('0x76')],{'as':_0xcbcd('0x161'),'foreignKey':_0xcbcd('0x1a4'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x7a')][_0xcbcd('0x112')](db[_0xcbcd('0x7a')],{'as':_0xcbcd('0x1a5'),'foreignKey':_0xcbcd('0x174'),'onDelete':_0xcbcd('0x10f'),'hooks':!![],'required':![]});db[_0xcbcd('0x7a')][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'as':_0xcbcd('0x114'),'foreignKey':'IntervalId','onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x7a')]['hasMany'](db[_0xcbcd('0x164')],{'as':'MailApplications','foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0x7a')]['hasMany'](db[_0xcbcd('0x5e')],{'as':_0xcbcd('0x1a6'),'foreignKey':_0xcbcd('0x174')});db['Interval'][_0xcbcd('0x112')](db[_0xcbcd('0x46')],{'as':'FaxApplications','foreignKey':'IntervalId'});db['Interval'][_0xcbcd('0x112')](db[_0xcbcd('0x4f')],{'as':_0xcbcd('0x1a7'),'foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0x1a8')][_0xcbcd('0x14f')](db['MailAccount'],{});db[_0xcbcd('0x1a8')][_0xcbcd('0x14f')](db[_0xcbcd('0x1a9')],{'foreignKey':_0xcbcd('0x1aa')});db['Schedule'][_0xcbcd('0x14f')](db[_0xcbcd('0x1ab')],{'foreignKey':_0xcbcd('0x1ac')});db[_0xcbcd('0x82')][_0xcbcd('0x122')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0xcbcd('0x147'),'onDelete':'restrict'});db[_0xcbcd('0x84')][_0xcbcd('0x122')](db[_0xcbcd('0x6a')],{'through':_0xcbcd('0x19b')});db['Tag'][_0xcbcd('0x122')](db['ChatInteraction'],{'through':_0xcbcd('0x194')});db['Tag'][_0xcbcd('0x122')](db[_0xcbcd('0x3b')],{'through':_0xcbcd('0x16c')});db['Tag'][_0xcbcd('0x122')](db[_0xcbcd('0x11a')],{'through':'sms_interaction_has_tags'});db[_0xcbcd('0x84')][_0xcbcd('0x122')](db[_0xcbcd('0x127')],{'through':_0xcbcd('0x17a')});db[_0xcbcd('0x84')][_0xcbcd('0x122')](db[_0xcbcd('0x56')],{'through':_0xcbcd('0x18a')});db[_0xcbcd('0x84')][_0xcbcd('0x122')](db['WhatsappInteraction'],{'through':_0xcbcd('0x1ad')});db['Trigger'][_0xcbcd('0x112')](db[_0xcbcd('0x78')],{'as':{'plural':'AllConditions','singular':_0xcbcd('0x1ae')},'foreignKey':'TriggerAllId','onDelete':_0xcbcd('0x10f'),'hooks':!![]});db[_0xcbcd('0x1af')][_0xcbcd('0x112')](db[_0xcbcd('0x78')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0xcbcd('0x1b0'),'onDelete':_0xcbcd('0x10f'),'hooks':!![]});db['Trigger'][_0xcbcd('0x112')](db['Action'],{'as':_0xcbcd('0x1a2'),'foreignKey':_0xcbcd('0x1b1'),'onDelete':_0xcbcd('0x10f'),'hooks':!![]});db[_0xcbcd('0x1ab')]['hasMany'](db[_0xcbcd('0x91')],{'as':_0xcbcd('0x1b2'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1ac'),'hooks':!![]});db[_0xcbcd('0x1a9')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1aa')});db[_0xcbcd('0x8f')][_0xcbcd('0x112')](db[_0xcbcd('0x91')],{'as':'Fields','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b3')});db['AnalyticFieldReport']['belongsTo'](db[_0xcbcd('0x8f')],{'foreignKey':_0xcbcd('0x1b3')});db[_0xcbcd('0x95')][_0xcbcd('0x112')](db[_0xcbcd('0x97')],{'as':'Configurations','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0x97')]['hasMany'](db[_0xcbcd('0x99')],{'as':_0xcbcd('0x1b5'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0x97')][_0xcbcd('0x112')](db[_0xcbcd('0x99')],{'as':'Descriptions','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b7')});db['SalesforceConfiguration']['hasMany'](db[_0xcbcd('0x99')],{'as':_0xcbcd('0x1b2'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0x97')][_0xcbcd('0x14f')](db['SalesforceAccount'],{'as':_0xcbcd('0x16a'),'foreignKey':'AccountId'});db[_0xcbcd('0x99')][_0xcbcd('0x112')](db[_0xcbcd('0x99')],{'as':_0xcbcd('0x1b9'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0x99')][_0xcbcd('0x112')](db['SalesforceField'],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0x99')][_0xcbcd('0x112')](db[_0xcbcd('0x99')],{'as':'Field','foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0x99')][_0xcbcd('0x14f')](db[_0xcbcd('0x1bb')],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0x9b')][_0xcbcd('0x112')](db[_0xcbcd('0x9d')],{'as':'Configurations','onDelete':_0xcbcd('0x10f'),'foreignKey':'AccountId'});db[_0xcbcd('0x9d')][_0xcbcd('0x112')](db[_0xcbcd('0x1bd')],{'as':_0xcbcd('0x1b5'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0x9d')]['hasMany'](db[_0xcbcd('0x1bd')],{'as':_0xcbcd('0x1be'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0x9d')][_0xcbcd('0x112')](db[_0xcbcd('0x1bd')],{'as':_0xcbcd('0x1b2'),'onDelete':'cascade','foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0x9d')]['belongsTo'](db[_0xcbcd('0x9b')],{'as':_0xcbcd('0x16a'),'foreignKey':'AccountId'});db[_0xcbcd('0x1bd')][_0xcbcd('0x112')](db[_0xcbcd('0x1bd')],{'as':_0xcbcd('0x1b9'),'foreignKey':'SubjectId'});db[_0xcbcd('0x1bd')][_0xcbcd('0x112')](db['SugarcrmField'],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0x1bd')][_0xcbcd('0x112')](db[_0xcbcd('0x1bd')],{'as':_0xcbcd('0x1bf'),'foreignKey':'FieldId'});db['SugarcrmField'][_0xcbcd('0x14f')](db[_0xcbcd('0x1bb')],{'as':'Variable','foreignKey':'VariableId'});db['DeskAccount'][_0xcbcd('0x112')](db[_0xcbcd('0xa1')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xa1')]['hasMany'](db[_0xcbcd('0xa3')],{'as':_0xcbcd('0x1b5'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xa1')][_0xcbcd('0x112')](db[_0xcbcd('0xa3')],{'as':_0xcbcd('0x1be'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xcbcd('0xa1')][_0xcbcd('0x112')](db[_0xcbcd('0xa3')],{'as':_0xcbcd('0x1b2'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xa1')][_0xcbcd('0x14f')](db[_0xcbcd('0x9f')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xa1')]['belongsToMany'](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x1c0')});db['DeskField'][_0xcbcd('0x112')](db[_0xcbcd('0xa3')],{'as':'Subject','foreignKey':_0xcbcd('0x1b6')});db['DeskField'][_0xcbcd('0x112')](db[_0xcbcd('0xa3')],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xa3')]['hasMany'](db['DeskField'],{'as':'Field','foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xa3')][_0xcbcd('0x14f')](db['Variable'],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0xa4')][_0xcbcd('0x112')](db[_0xcbcd('0xa6')],{'as':_0xcbcd('0x1c1'),'onDelete':'cascade','foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xa6')]['hasMany'](db['ZohoField'],{'as':_0xcbcd('0x1b5'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xa6')][_0xcbcd('0x112')](db[_0xcbcd('0xa8')],{'as':_0xcbcd('0x1be'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xa6')][_0xcbcd('0x112')](db['ZohoField'],{'as':_0xcbcd('0x1b2'),'onDelete':_0xcbcd('0x10f'),'foreignKey':'FieldId'});db[_0xcbcd('0xa6')]['belongsTo'](db[_0xcbcd('0xa4')],{'as':_0xcbcd('0x16a'),'foreignKey':'AccountId'});db[_0xcbcd('0xa8')][_0xcbcd('0x112')](db['ZohoField'],{'as':_0xcbcd('0x1b9'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xa8')][_0xcbcd('0x112')](db[_0xcbcd('0xa8')],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xa8')][_0xcbcd('0x112')](db[_0xcbcd('0xa8')],{'as':_0xcbcd('0x1bf'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xa8')][_0xcbcd('0x14f')](db['Variable'],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0xa9')]['hasMany'](db['ZendeskConfiguration'],{'as':_0xcbcd('0x1c1'),'onDelete':'cascade','foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xab')][_0xcbcd('0x112')](db[_0xcbcd('0xad')],{'as':_0xcbcd('0x1b5'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xab')]['hasMany'](db['ZendeskField'],{'as':_0xcbcd('0x1be'),'foreignKey':_0xcbcd('0x1b7')});db['ZendeskConfiguration'][_0xcbcd('0x112')](db['ZendeskField'],{'as':_0xcbcd('0x1b2'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xab')]['belongsTo'](db[_0xcbcd('0xa9')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xab')][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x1c2')});db[_0xcbcd('0xad')]['hasMany'](db[_0xcbcd('0xad')],{'as':_0xcbcd('0x1b9'),'foreignKey':_0xcbcd('0x1b6')});db['ZendeskField'][_0xcbcd('0x112')](db[_0xcbcd('0xad')],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xad')][_0xcbcd('0x112')](db[_0xcbcd('0xad')],{'as':'Field','foreignKey':'FieldId'});db[_0xcbcd('0xad')][_0xcbcd('0x14f')](db[_0xcbcd('0x1bb')],{'as':'Variable','foreignKey':_0xcbcd('0x1bc')});db['FreshdeskAccount'][_0xcbcd('0x112')](db[_0xcbcd('0xb1')],{'as':_0xcbcd('0x1c1'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xb1')]['hasMany'](db[_0xcbcd('0xb3')],{'as':_0xcbcd('0x1b5'),'onDelete':_0xcbcd('0x10f'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0xcbcd('0x112')](db[_0xcbcd('0xb3')],{'as':_0xcbcd('0x1be'),'onDelete':_0xcbcd('0x10f'),'foreignKey':'DescriptionId'});db[_0xcbcd('0xb1')]['hasMany'](db[_0xcbcd('0xb3')],{'as':_0xcbcd('0x1b2'),'onDelete':'cascade','foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xb1')][_0xcbcd('0x14f')](db[_0xcbcd('0xaf')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x1b4')});db['FreshdeskConfiguration'][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x1c3')});db[_0xcbcd('0xb3')][_0xcbcd('0x112')](db[_0xcbcd('0xb3')],{'as':'Subject','foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xb3')][_0xcbcd('0x112')](db[_0xcbcd('0xb3')],{'as':_0xcbcd('0x1ba'),'foreignKey':'DescriptionId'});db[_0xcbcd('0xb3')]['hasMany'](db[_0xcbcd('0xb3')],{'as':_0xcbcd('0x1bf'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xb3')]['belongsTo'](db['Variable'],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db['VtigerAccount'][_0xcbcd('0x112')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xb6')][_0xcbcd('0x112')](db['VtigerField'],{'as':'Subjects','foreignKey':_0xcbcd('0x1b6')});db['VtigerConfiguration'][_0xcbcd('0x112')](db[_0xcbcd('0xb7')],{'as':_0xcbcd('0x1be'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xb6')][_0xcbcd('0x112')](db[_0xcbcd('0xb7')],{'as':_0xcbcd('0x1b2'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xb6')][_0xcbcd('0x14f')](db[_0xcbcd('0xb5')],{'as':'Account','foreignKey':'AccountId'});db[_0xcbcd('0xb7')][_0xcbcd('0x112')](db['VtigerField'],{'as':_0xcbcd('0x1b9'),'foreignKey':'SubjectId'});db[_0xcbcd('0xb7')][_0xcbcd('0x112')](db[_0xcbcd('0xb7')],{'as':_0xcbcd('0x1ba'),'foreignKey':'DescriptionId'});db[_0xcbcd('0xb7')]['hasMany'](db[_0xcbcd('0xb7')],{'as':'Field','foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xb7')][_0xcbcd('0x14f')](db[_0xcbcd('0x1bb')],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0xb9')]['hasMany'](db[_0xcbcd('0xbb')],{'as':'Configurations','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b4')});db['ServicenowConfiguration'][_0xcbcd('0x112')](db[_0xcbcd('0xbd')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xcbcd('0xbb')]['hasMany'](db[_0xcbcd('0xbd')],{'as':_0xcbcd('0x1be'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0xcbcd('0xbd')],{'as':'Fields','foreignKey':'FieldId'});db[_0xcbcd('0xbb')][_0xcbcd('0x14f')](db['ServicenowAccount'],{'as':_0xcbcd('0x16a'),'foreignKey':'AccountId'});db[_0xcbcd('0xbd')][_0xcbcd('0x112')](db[_0xcbcd('0xbd')],{'as':_0xcbcd('0x1b9'),'foreignKey':'SubjectId'});db[_0xcbcd('0xbd')][_0xcbcd('0x112')](db[_0xcbcd('0xbd')],{'as':_0xcbcd('0x1ba'),'foreignKey':'DescriptionId'});db[_0xcbcd('0xbd')][_0xcbcd('0x112')](db[_0xcbcd('0xbd')],{'as':_0xcbcd('0x1bf'),'foreignKey':'FieldId'});db['ServicenowField'][_0xcbcd('0x14f')](db['Variable'],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0xbf')][_0xcbcd('0x112')](db['Dynamics365Configuration'],{'as':_0xcbcd('0x1c1'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xcbcd('0x1c4')][_0xcbcd('0x112')](db[_0xcbcd('0xc2')],{'as':_0xcbcd('0x1b5'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xcbcd('0x1c4')]['hasMany'](db[_0xcbcd('0xc2')],{'as':_0xcbcd('0x1be'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b7')});db['Dynamics365Configuration'][_0xcbcd('0x112')](db[_0xcbcd('0xc2')],{'as':_0xcbcd('0x1b2'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0x1c4')][_0xcbcd('0x14f')](db[_0xcbcd('0xbf')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xc2')][_0xcbcd('0x112')](db[_0xcbcd('0xc2')],{'as':_0xcbcd('0x1b9'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xc2')][_0xcbcd('0x112')](db[_0xcbcd('0xc2')],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xc2')][_0xcbcd('0x112')](db[_0xcbcd('0xc2')],{'as':'Field','foreignKey':_0xcbcd('0x1b8')});db['Dynamics365Field'][_0xcbcd('0x14f')](db[_0xcbcd('0x1bb')],{'as':_0xcbcd('0x1bb'),'foreignKey':'VariableId'});db[_0xcbcd('0xc3')][_0xcbcd('0x112')](db[_0xcbcd('0x1c5')],{'as':_0xcbcd('0x1c1'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0x1c5')]['hasMany'](db[_0xcbcd('0x1c6')],{'as':_0xcbcd('0x1b5'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0x1c5')][_0xcbcd('0x112')](db[_0xcbcd('0x1c6')],{'as':'Descriptions','foreignKey':_0xcbcd('0x1b7')});db['FreshsalesConfiguration']['hasMany'](db[_0xcbcd('0x1c6')],{'as':_0xcbcd('0x1b2'),'foreignKey':'FieldId'});db['FreshsalesConfiguration']['belongsTo'](db[_0xcbcd('0xc3')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0x1c6')]['hasMany'](db[_0xcbcd('0x1c6')],{'as':'Subject','foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0x1c6')]['hasMany'](db['FreshsalesField'],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0x1c6')][_0xcbcd('0x112')](db['FreshsalesField'],{'as':_0xcbcd('0x1bf'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0x1c6')]['belongsTo'](db[_0xcbcd('0x1bb')],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0x1c7')][_0xcbcd('0x14f')](db['ChatWebsite'],{});db[_0xcbcd('0x1c7')]['belongsTo'](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':'ListId'});db[_0xcbcd('0x1c7')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x1c7')][_0xcbcd('0x14f')](db[_0xcbcd('0x60')],{});db[_0xcbcd('0x1c7')][_0xcbcd('0x14f')](db[_0xcbcd('0x62')],{});db[_0xcbcd('0x1c7')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{});db['ChatQueueReport']['belongsTo'](db[_0xcbcd('0x12c')],{});db[_0xcbcd('0xca')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0xcbcd('0xca')]['belongsTo'](db['User'],{'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1c8')});db[_0xcbcd('0xd0')][_0xcbcd('0x112')](db[_0xcbcd('0xce')],{'foreignKey':_0xcbcd('0x1c9'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0xd0')]['hasMany'](db[_0xcbcd('0xcc')],{'foreignKey':_0xcbcd('0x1c9'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0xd2')][_0xcbcd('0x14f')](db[_0xcbcd('0x4d')],{});db[_0xcbcd('0xd2')]['belongsTo'](db['CmList'],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0xd2')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0xd2')][_0xcbcd('0x14f')](db['SmsInteraction'],{});db[_0xcbcd('0xd2')]['belongsTo'](db[_0xcbcd('0x182')],{});db[_0xcbcd('0xd2')]['belongsTo'](db[_0xcbcd('0x10d')],{});db['SmsQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x53')],{});db[_0xcbcd('0xd7')]['hasMany'](db[_0xcbcd('0xd0')],{'foreignKey':'ProjectId'});db[_0xcbcd('0xd7')]['hasMany'](db[_0xcbcd('0xce')],{'foreignKey':_0xcbcd('0x1ca')});db[_0xcbcd('0xd7')][_0xcbcd('0x112')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0xcbcd('0xdd')]['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x142')});db[_0xcbcd('0x153')][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x126')});db[_0xcbcd('0x153')]['belongsToMany'](db[_0xcbcd('0x17')],{'through':_0xcbcd('0x10b'),'as':_0xcbcd('0x1cb')});db[_0xcbcd('0x153')][_0xcbcd('0x122')](db[_0xcbcd('0x38')],{'through':_0xcbcd('0x168'),'as':'MailQueues'});db[_0xcbcd('0x153')][_0xcbcd('0x122')](db['ChatQueue'],{'through':_0xcbcd('0x196'),'as':'ChatQueues'});db[_0xcbcd('0x153')]['belongsToMany'](db['FaxQueue'],{'through':_0xcbcd('0x17f'),'as':'FaxQueues'});db[_0xcbcd('0x153')][_0xcbcd('0x122')](db[_0xcbcd('0x53')],{'through':_0xcbcd('0x186'),'as':_0xcbcd('0x12f')});db['Team'][_0xcbcd('0x122')](db[_0xcbcd('0x5a')],{'through':_0xcbcd('0x1cc'),'as':'OpenchannelQueues'});db[_0xcbcd('0x153')][_0xcbcd('0x122')](db[_0xcbcd('0x108')],{'through':'team_has_whatsapp_queues','as':_0xcbcd('0x131')});db[_0xcbcd('0xe4')]['hasMany'](db[_0xcbcd('0x6c')],{'as':_0xcbcd('0x14a'),'foreignKey':'CampaignId'});db['Campaign'][_0xcbcd('0x112')](db[_0xcbcd('0x115')],{'as':_0xcbcd('0x14b'),'foreignKey':_0xcbcd('0x19c')});db[_0xcbcd('0xe4')][_0xcbcd('0x112')](db[_0xcbcd('0x6f')],{'as':_0xcbcd('0x1cd'),'foreignKey':_0xcbcd('0x19c')});db[_0xcbcd('0xe4')][_0xcbcd('0x112')](db[_0xcbcd('0x6d')],{'as':_0xcbcd('0x14c'),'foreignKey':_0xcbcd('0x19c')});db[_0xcbcd('0xe4')]['belongsTo'](db['Trunk'],{'as':_0xcbcd('0x28'),'foreignKey':_0xcbcd('0x14e')});db[_0xcbcd('0xe4')][_0xcbcd('0x14f')](db['Trunk'],{'as':_0xcbcd('0x1ce'),'foreignKey':_0xcbcd('0x1cf')});db[_0xcbcd('0xe4')][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'as':_0xcbcd('0x7a'),'foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0xe4')][_0xcbcd('0x14f')](db[_0xcbcd('0xdd')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xcbcd('0xe4')][_0xcbcd('0x122')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x124'),'through':'campaigns_has_cm_lists'});db[_0xcbcd('0xe4')][_0xcbcd('0x122')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x155'),'through':_0xcbcd('0x1d0')});db['Attachment'][_0xcbcd('0x14f')](db[_0xcbcd('0x171')],{'as':_0xcbcd('0x171'),'foreignKey':_0xcbcd('0x172')});db[_0xcbcd('0xec')]['belongsTo'](db[_0xcbcd('0x3d')],{});db[_0xcbcd('0xec')][_0xcbcd('0x14f')](db[_0xcbcd('0x3b')],{});db['MailTransferReport']['belongsTo'](db[_0xcbcd('0x139')],{'foreignKey':_0xcbcd('0x1d1'),'as':_0xcbcd('0x1d2')});db[_0xcbcd('0xec')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xcbcd('0x1d3')});db[_0xcbcd('0xec')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d4'),'as':'ToAgent'});db[_0xcbcd('0xec')]['belongsTo'](db[_0xcbcd('0x38')],{'foreignKey':'ToMailQueueId','as':_0xcbcd('0x1d5')});db['MailTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x139')],{'foreignKey':_0xcbcd('0x1d6'),'as':'ToAccount'});db[_0xcbcd('0x1d7')][_0xcbcd('0x14f')](db[_0xcbcd('0x62')],{});db['ChatTransferReport']['belongsTo'](db[_0xcbcd('0x60')],{});db['ChatTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'foreignKey':_0xcbcd('0x1d8'),'as':'FromAccount'});db[_0xcbcd('0x1d7')]['belongsTo'](db['User'],{'foreignKey':_0xcbcd('0x1d9'),'as':_0xcbcd('0x1d3')});db['ChatTransferReport']['belongsTo'](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d4'),'as':_0xcbcd('0x1da')});db['ChatTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x12c')],{'foreignKey':_0xcbcd('0x1db'),'as':_0xcbcd('0x1d5')});db['ChatTransferReport'][_0xcbcd('0x14f')](db['ChatWebsite'],{'foreignKey':_0xcbcd('0x1dc'),'as':'ToAccount'});db[_0xcbcd('0xef')][_0xcbcd('0x14f')](db[_0xcbcd('0x48')],{});db['FaxTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x127')],{});db[_0xcbcd('0xef')][_0xcbcd('0x14f')](db['FaxAccount'],{'foreignKey':_0xcbcd('0x1dd'),'as':_0xcbcd('0x1d2')});db[_0xcbcd('0xef')]['belongsTo'](db['User'],{'foreignKey':_0xcbcd('0x1d9'),'as':_0xcbcd('0x1d3')});db[_0xcbcd('0xef')]['belongsTo'](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d4'),'as':_0xcbcd('0x1da')});db[_0xcbcd('0xef')]['belongsTo'](db[_0xcbcd('0x4a')],{'foreignKey':_0xcbcd('0x1de'),'as':_0xcbcd('0x1d5')});db['FaxTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x136')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0xcbcd('0xf1')]['belongsTo'](db[_0xcbcd('0x58')],{});db['OpenchannelTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x56')],{});db[_0xcbcd('0xf1')][_0xcbcd('0x14f')](db[_0xcbcd('0x54')],{'foreignKey':_0xcbcd('0x1df'),'as':_0xcbcd('0x1d2')});db['OpenchannelTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d9'),'as':'FromAgent'});db[_0xcbcd('0xf1')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d4'),'as':_0xcbcd('0x1da')});db['OpenchannelTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x5a')],{'foreignKey':_0xcbcd('0x1e0'),'as':'ToQueue'});db[_0xcbcd('0xf1')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0xcbcd('0x1e1'),'as':_0xcbcd('0x1e2')});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db['SmsMessage'],{});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db[_0xcbcd('0x11a')],{});db['SmsTransferReport']['belongsTo'](db[_0xcbcd('0x4d')],{'foreignKey':_0xcbcd('0x1e4'),'as':_0xcbcd('0x1d2')});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d9'),'as':_0xcbcd('0x1d3')});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':'ToUserId','as':_0xcbcd('0x1da')});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db[_0xcbcd('0x53')],{'foreignKey':_0xcbcd('0x1e5'),'as':_0xcbcd('0x1d5')});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0xcbcd('0x123')]['hasMany'](db[_0xcbcd('0x76')],{'as':'Dispositions','foreignKey':_0xcbcd('0x165'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x123')][_0xcbcd('0x112')](db[_0xcbcd('0x1e6')],{'as':_0xcbcd('0x1e7'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x123')]['hasMany'](db['CmContact'],{'as':_0xcbcd('0x1e8'),'onDelete':'cascade','foreignKey':'ListId'});db[_0xcbcd('0x123')][_0xcbcd('0x112')](db[_0xcbcd('0x115')],{'as':_0xcbcd('0x14b'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x123')]['hasMany'](db[_0xcbcd('0x6f')],{'as':'HopperHistory','foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x123')][_0xcbcd('0x112')](db[_0xcbcd('0x117')],{'as':'ReportAgentPreview','foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x123')][_0xcbcd('0x122')](db[_0xcbcd('0x17')],{'as':_0xcbcd('0x1e9'),'through':_0xcbcd('0x151')});db[_0xcbcd('0x123')][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x125')});db['VoicePrefix'][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'as':_0xcbcd('0x114'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0xf5')]['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x133')});db[_0xcbcd('0xf7')][_0xcbcd('0x112')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'foreignKey':'userProfileId'});db[_0xcbcd('0xf7')][_0xcbcd('0x112')](db[_0xcbcd('0x1ea')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x1ea')][_0xcbcd('0x112')](db['UserProfileResource'],{'as':_0xcbcd('0x1eb'),'foreignKey':_0xcbcd('0x1ec'),'onDelete':_0xcbcd('0x10f')});db['WhatsappAccount'][_0xcbcd('0x112')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xcbcd('0x1ed'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x140')]['hasMany'](db['CannedAnswer'],{'as':_0xcbcd('0x181'),'foreignKey':_0xcbcd('0x1ed')});db['WhatsappAccount']['hasMany'](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0xcbcd('0x1ed')});db[_0xcbcd('0x140')][_0xcbcd('0x112')](db[_0xcbcd('0x101')],{'as':_0xcbcd('0x163')});db[_0xcbcd('0x140')][_0xcbcd('0x112')](db[_0xcbcd('0xff')],{'as':_0xcbcd('0x145')});db[_0xcbcd('0x140')][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':'List','foreignKey':'ListId'});db[_0xcbcd('0x140')][_0xcbcd('0x14f')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xcbcd('0x150')});db[_0xcbcd('0x140')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x1ee')});db[_0xcbcd('0xff')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0xff')][_0xcbcd('0x14f')](db[_0xcbcd('0x108')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0xff')][_0xcbcd('0x14f')](db[_0xcbcd('0x140')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0xff')][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xcbcd('0xff')][_0xcbcd('0x14f')](db[_0xcbcd('0x84')],{'onDelete':'restrict','foreignKey':_0xcbcd('0x175')});db[_0xcbcd('0x101')]['hasMany'](db['WhatsappMessage'],{'as':_0xcbcd('0x157'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1ef')});db[_0xcbcd('0x101')][_0xcbcd('0x14f')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xcbcd('0x101')][_0xcbcd('0x14f')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xcbcd('0x101')]['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x101')]['belongsToMany'](db['Tag'],{'through':_0xcbcd('0x1ad'),'as':_0xcbcd('0x16d')});db[_0xcbcd('0x101')][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':'whatsapp_interaction_has_tags','as':_0xcbcd('0x17b')});db[_0xcbcd('0x101')][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x1f0'),'foreignKey':_0xcbcd('0x1ef')});db[_0xcbcd('0x1f1')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x10d')});db[_0xcbcd('0x1f1')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':'cascade','as':'Contact'});db[_0xcbcd('0x1f1')][_0xcbcd('0x14f')](db[_0xcbcd('0x101')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x170'),'foreignKey':_0xcbcd('0x1ef')});db[_0xcbcd('0x1f1')][_0xcbcd('0x14f')](db[_0xcbcd('0x140')],{'as':_0xcbcd('0x16a'),'foreignKey':'WhatsappAccountId'});db[_0xcbcd('0x104')][_0xcbcd('0x14f')](db[_0xcbcd('0x140')],{});db[_0xcbcd('0x104')][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':'List','foreignKey':_0xcbcd('0x165')});db['WhatsappQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x104')][_0xcbcd('0x14f')](db['WhatsappInteraction'],{});db[_0xcbcd('0x104')][_0xcbcd('0x14f')](db['WhatsappQueue'],{});db[_0xcbcd('0x104')][_0xcbcd('0x14f')](db[_0xcbcd('0x1f1')],{});db['WhatsappQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x1f1')],{});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x101')],{});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x140')],{'foreignKey':_0xcbcd('0x1f2'),'as':'FromAccount'});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x140')],{'foreignKey':_0xcbcd('0x1f3'),'as':'ToAccount'});db[_0xcbcd('0x106')]['belongsTo'](db[_0xcbcd('0x108')],{'foreignKey':_0xcbcd('0x1f4'),'as':_0xcbcd('0x1d5')});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d9'),'as':_0xcbcd('0x1d3')});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':'ToUserId','as':_0xcbcd('0x1da')});db[_0xcbcd('0x108')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x33'),'foreignKey':_0xcbcd('0x1f5')});db['WhatsappQueue'][_0xcbcd('0x122')](db['Team'],{'through':_0xcbcd('0x1f6'),'as':_0xcbcd('0x154')});module[_0xcbcd('0x1f7')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xfb51=['VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.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/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','userProfileId','ChatGroup','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_lists','user_has_teams','ChatInteraction','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceMusicOnHold','VoiceQueueId','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPauseId','Lists','Agents','mailboxuser','mailbox','uniqueid','AgentReports','Contact','ContactId','MailServerOut','MailAccountId','Imap','Smtp','Disposition','Messages','Interactions','Applications','List','ListId','Template','TemplateId','mandatoryDispositionPause','team_has_mail_queues','Teams','Account','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','MailInteractionId','Attachments','Interaction','restrict','TagId','Dashboard','Items','Dispositions','FaxAccountId','Answers','FaxInteractionId','fax_interaction_has_tags','Tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','Owner','sms_interaction_has_tags','OpenchannelAccountId','OpenchannelAccount','OpenchannelInteractionId','OpenchannelInteraction','openchannel_interaction_has_tags','OpenchannelQueueId','ChatWebsiteId','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','ChatGroupId','Members','Website','CompanyId','HopperHistories','MailInteractions','CmCompany','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','OneAll','AutomationAllId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','moh_has_sounds','whatsapp_interaction_has_tags','Trigger','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','CustomReportId','MetricId','AnalyticMetric','AccountId','Subjects','Descriptions','FieldId','Subject','SubjectId','Description','DescriptionId','Field','Variable','SugarcrmConfiguration','Configurations','VariableId','int_desk_configuration_has_tags','ZohoAccount','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowField','Dynamics365Account','FreshsalesField','ChatQueueReport','FromId','ToId','JscriptyQuestionReport','SessionId','ProjectId','team_has_chat_queues','team_has_sms_queues','team_has_openchannel_queues','team_has_whatsapp_queues','Hoppers','SquareProjectId','FromMailAccountId','FromAgent','ToAgent','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToUserId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','FromOpenchannelAccountId','FromAccount','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','voice_queues_has_cm_lists','Resources','sectionId','WhatsappAccountId','WhatsappApplication','user_has_whatsapp_interactions','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','xcall','database','username','password','User','import','VoiceChanSpy','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model'];(function(_0x441dd8,_0x240597){var _0x5cb253=function(_0x3dfa30){while(--_0x3dfa30){_0x441dd8['push'](_0x441dd8['shift']());}};_0x5cb253(++_0x240597);}(_0xfb51,0x1ca));var _0x1fb5=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xfb51[_0x2a5099];return _0x2802f1;};'use strict';var config=require(_0x1fb5('0x0'));var Sequelize=require(_0x1fb5('0x1'));var _=require(_0x1fb5('0x2'));var jstz=require('jstz');var timezone=jstz[_0x1fb5('0x3')]();config[_0x1fb5('0x1')]=_[_0x1fb5('0x4')](config[_0x1fb5('0x1')],{'database':'motion2','username':'xcall','password':_0x1fb5('0x5'),'options':{'host':_0x1fb5('0x6'),'port':0xcea,'dialect':_0x1fb5('0x7'),'dialectOptions':{'charset':_0x1fb5('0x8')},'logging':![],'timezone':timezone[_0x1fb5('0x9')](),'define':{'charset':_0x1fb5('0xa'),'collate':_0x1fb5('0xb')}}});config[_0x1fb5('0xc')]=_[_0x1fb5('0x4')](config[_0x1fb5('0xc')],{'database':_0x1fb5('0xd'),'username':_0x1fb5('0xe'),'password':_0x1fb5('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x1fb5('0x7'),'dialectOptions':{'charset':_0x1fb5('0x8')},'logging':![],'timezone':timezone[_0x1fb5('0x9')](),'define':{'charset':_0x1fb5('0xa'),'collate':_0x1fb5('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1fb5('0x1')][_0x1fb5('0xf')],config[_0x1fb5('0x1')][_0x1fb5('0x10')],config[_0x1fb5('0x1')][_0x1fb5('0x11')],config[_0x1fb5('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x1fb5('0xf')],config[_0x1fb5('0xc')][_0x1fb5('0x10')],config[_0x1fb5('0xc')][_0x1fb5('0x11')],config[_0x1fb5('0xc')]['options'])};db[_0x1fb5('0x12')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/user/user.model');db[_0x1fb5('0x14')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x15'));db[_0x1fb5('0x16')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x17'));db['VoiceMusicOnHold']=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x18'));db[_0x1fb5('0x19')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x1a'));db[_0x1fb5('0x1b')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x1c'));db['ScreenRecording']=db['sequelize']['import'](_0x1fb5('0x1d'));db[_0x1fb5('0x1e')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x1f'));db[_0x1fb5('0x20')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x21'));db[_0x1fb5('0x22')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x23'));db[_0x1fb5('0x24')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x25'));db[_0x1fb5('0x26')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x27'));db[_0x1fb5('0x28')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x29'));db[_0x1fb5('0x2a')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/memberReport/memberReport.model');db[_0x1fb5('0x2b')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x2c'));db['VoiceTransferReport']=db['sequelize'][_0x1fb5('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x1fb5('0x2d')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x2e'));db[_0x1fb5('0x2f')]=db[_0x1fb5('0x1')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x1fb5('0x30')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x31'));db[_0x1fb5('0x32')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x33'));db['UserFaxQueue']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x34'));db[_0x1fb5('0x35')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x36'));db[_0x1fb5('0x37')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x38'));db[_0x1fb5('0x39')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x3a'));db[_0x1fb5('0x3b')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x3c'));db['MailServerOut']=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x3d'));db['MailAccount']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x3e'));db[_0x1fb5('0x3f')]=db['sequelize'][_0x1fb5('0x13')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x1fb5('0x40')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x41'));db[_0x1fb5('0x42')]=db['sequelize'][_0x1fb5('0x13')]('../api/mailMessage/mailMessage.model');db[_0x1fb5('0x43')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x44'));db[_0x1fb5('0x45')]=db['sequelize']['import'](_0x1fb5('0x46'));db['Dashboard']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x47'));db[_0x1fb5('0x48')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x49'));db[_0x1fb5('0x4a')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x4b'));db[_0x1fb5('0x4c')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x4d'));db[_0x1fb5('0x4e')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x4f'));db[_0x1fb5('0x50')]=db['sequelize'][_0x1fb5('0x13')]('../api/faxMessage/faxMessage.model');db[_0x1fb5('0x51')]=db[_0x1fb5('0x1')]['import']('../api/faxQueue/faxQueue.model');db[_0x1fb5('0x52')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/faxQueueReport/faxQueueReport.model');db[_0x1fb5('0x53')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x54'));db[_0x1fb5('0x55')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/smsApplication/smsApplication.model');db[_0x1fb5('0x56')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x57'));db[_0x1fb5('0x58')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x59'));db[_0x1fb5('0x5a')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x5b'));db['OpenchannelAccount']=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0x1fb5('0x5c')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x5d'));db['OpenchannelInteraction']=db['sequelize']['import'](_0x1fb5('0x5e'));db[_0x1fb5('0x5f')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x60'));db[_0x1fb5('0x61')]=db[_0x1fb5('0x1')]['import']('../api/openchannelQueue/openchannelQueue.model');db[_0x1fb5('0x62')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x1fb5('0x63')]=db[_0x1fb5('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x1fb5('0x64')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x65'));db['ChatInteraction']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x66'));db[_0x1fb5('0x67')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/chatMessage/chatMessage.model');db[_0x1fb5('0x68')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x1fb5('0x69')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x6a'));db['ChatGroup']=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x6b'));db['CmCompany']=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x6c'));db[_0x1fb5('0x6d')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x6e'));db[_0x1fb5('0x6f')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/cmHopper/cmHopper.model');db[_0x1fb5('0x70')]=db[_0x1fb5('0x1')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x1fb5('0x71')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x72'));db[_0x1fb5('0x73')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x74'));db['ReportAgentPreview']=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x1fb5('0x75')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x76'));db[_0x1fb5('0x77')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x78'));db[_0x1fb5('0x79')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x7a'));db[_0x1fb5('0x7b')]=db['sequelize'][_0x1fb5('0x13')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x7c'));db[_0x1fb5('0x7d')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/condition/condition.model');db[_0x1fb5('0x7e')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x7f'));db['Pause']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x80'));db[_0x1fb5('0x81')]=db['sequelize']['import']('../api/cdr/cdr.model');db[_0x1fb5('0x82')]=db['sequelize']['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x1fb5('0x83')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x84'));db[_0x1fb5('0x85')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x86'));db[_0x1fb5('0x87')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x88'));db['Template']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x89'));db['Trigger']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x8a'));db['Variable']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x8b'));db[_0x1fb5('0x8c')]=db['sequelize']['import'](_0x1fb5('0x8d'));db[_0x1fb5('0x8e')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x8f'));db[_0x1fb5('0x90')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x91'));db[_0x1fb5('0x92')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x93'));db['AnalyticExtractedReport']=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x94'));db[_0x1fb5('0x95')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x96'));db[_0x1fb5('0x97')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x98'));db[_0x1fb5('0x99')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x9a'));db[_0x1fb5('0x9b')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x9c'));db[_0x1fb5('0x9d')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x9e'));db[_0x1fb5('0x9f')]=db['sequelize'][_0x1fb5('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xa0'));db[_0x1fb5('0xa1')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x1fb5('0xa2')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xa3'));db[_0x1fb5('0xa4')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xa5'));db[_0x1fb5('0xa6')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xa7'));db['ZohoAccount']=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xa8'));db[_0x1fb5('0xa9')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x1fb5('0xaa')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xab'));db['ZendeskAccount']=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xac'));db[_0x1fb5('0xad')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xae'));db['ZendeskField']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xaf'));db[_0x1fb5('0xb0')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xb1'));db[_0x1fb5('0xb2')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xb3'));db[_0x1fb5('0xb4')]=db[_0x1fb5('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x1fb5('0xb5')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xb6'));db[_0x1fb5('0xb7')]=db['sequelize'][_0x1fb5('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x1fb5('0xb8')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xb9'));db[_0x1fb5('0xba')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xbb'));db[_0x1fb5('0xbc')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xbd'));db['ServicenowField']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xbe'));db['Dynamics365Account']=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xbf'));db[_0x1fb5('0xc0')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xc1'));db[_0x1fb5('0xc2')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xc3'));db[_0x1fb5('0xc4')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xc5'));db[_0x1fb5('0xc6')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xc7'));db['FreshsalesField']=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xc8'));db[_0x1fb5('0x8c')]=db[_0x1fb5('0x1')]['import']('../api/integration/integration.model');db[_0x1fb5('0xc9')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/network/network.model');db['ChatQueueReport']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xca'));db[_0x1fb5('0xcb')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xcc'));db[_0x1fb5('0xcd')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xce'));db['JscriptyQuestionReport']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xcf'));db[_0x1fb5('0xd0')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xd1'));db[_0x1fb5('0xd2')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0x1fb5('0xd3')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xd4'));db[_0x1fb5('0xd5')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xd6'));db[_0x1fb5('0xd7')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xd8'));db[_0x1fb5('0xd9')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xda'));db['SquareOdbc']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xdb'));db[_0x1fb5('0xdc')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xdd'));db[_0x1fb5('0xde')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/squareRecording/squareRecording.model');db[_0x1fb5('0xdf')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xe0'));db[_0x1fb5('0xe1')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xe2'));db['License']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xe3'));db[_0x1fb5('0xe4')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/campaign/campaign.model');db[_0x1fb5('0xe5')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xe6'));db[_0x1fb5('0xe7')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xe8'));db[_0x1fb5('0xe9')]=db[_0x1fb5('0x1')]['import']('../api/plugin/plugin.model');db[_0x1fb5('0xea')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xeb'));db['ChatTransferReport']=db['sequelize'][_0x1fb5('0x13')]('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0x1fb5('0x1')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0x1fb5('0xec')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xed'));db[_0x1fb5('0xee')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xef'));db[_0x1fb5('0xf0')]=db['sequelize'][_0x1fb5('0x13')]('../api/cmList/cmList.model');db[_0x1fb5('0xf1')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0x1fb5('0xf2')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/userProfile/userProfile.model');db[_0x1fb5('0xf3')]=db['sequelize']['import'](_0x1fb5('0xf4'));db[_0x1fb5('0xf5')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xf6'));db[_0x1fb5('0xf7')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xf8'));db[_0x1fb5('0xf9')]=db['sequelize']['import']('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xfa'));db[_0x1fb5('0xfb')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xfc'));db[_0x1fb5('0xfd')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xfe'));db[_0x1fb5('0xff')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x100'));db['WhatsappTransferReport']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x101'));db['WhatsappQueue']=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0x1fb5('0x102')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x103'));db[_0x1fb5('0x104')]=db['sequelize'][_0x1fb5('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['User'][_0x1fb5('0x105')](db[_0x1fb5('0x1e')],{'as':'VoiceMail','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')][_0x1fb5('0x108')](db[_0x1fb5('0x1b')],{'as':_0x1fb5('0x109'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')]['hasMany'](db[_0x1fb5('0x2d')],{'as':_0x1fb5('0x10a'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')][_0x1fb5('0x108')](db['VoiceExtension'],{'as':_0x1fb5('0x10b'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db['User'][_0x1fb5('0x108')](db['CmHopperFinal'],{'as':_0x1fb5('0x10c'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')][_0x1fb5('0x108')](db['CmHopperHistory'],{'as':_0x1fb5('0x10d'),'foreignKey':_0x1fb5('0x107')});db['User'][_0x1fb5('0x108')](db[_0x1fb5('0x10e')],{'as':_0x1fb5('0x10e'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x1fb5('0x10f'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')][_0x1fb5('0x108')](db['ChatInteraction'],{'as':_0x1fb5('0x110'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')]['hasMany'](db[_0x1fb5('0x56')],{'as':_0x1fb5('0x111'),'foreignKey':_0x1fb5('0x107')});db['User'][_0x1fb5('0x108')](db[_0x1fb5('0x4e')],{'as':_0x1fb5('0x112'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')][_0x1fb5('0x108')](db[_0x1fb5('0x40')],{'as':'MailInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0x1fb5('0xfb')],{'as':_0x1fb5('0x113'),'foreignKey':_0x1fb5('0x107')});db['User'][_0x1fb5('0x108')](db[_0x1fb5('0xf7')],{'as':_0x1fb5('0x114'),'foreignKey':'SenderId'});db[_0x1fb5('0x12')]['belongsTo'](db[_0x1fb5('0xf2')],{'as':_0x1fb5('0xf2'),'foreignKey':_0x1fb5('0x115')});db[_0x1fb5('0x12')]['belongsToMany'](db[_0x1fb5('0x116')],{'as':_0x1fb5('0x117'),'through':_0x1fb5('0x118')});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x11a'),'through':'cm_user_has_contacts'});db[_0x1fb5('0x12')]['belongsToMany'](db[_0x1fb5('0xf0')],{'as':'Lists','through':_0x1fb5('0x11b')});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'through':_0x1fb5('0x11c')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x40')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x11d')],{'as':_0x1fb5('0x110'),'through':_0x1fb5('0x11e')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x4e')],{'as':_0x1fb5('0x112'),'through':_0x1fb5('0x11f')});db[_0x1fb5('0x12')]['belongsToMany'](db[_0x1fb5('0x56')],{'as':'SmsInteractions','through':_0x1fb5('0x120')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db['OpenchannelInteraction'],{'as':_0x1fb5('0x10f'),'through':_0x1fb5('0x121')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0xfb')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x19')],{'as':_0x1fb5('0x122'),'through':_0x1fb5('0x2f'),'required':![]});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x3f')],{'as':_0x1fb5('0x123'),'through':_0x1fb5('0x32'),'required':![]});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x69')],{'as':'ChatQueues','through':_0x1fb5('0x30'),'required':![],'hooks':!![]});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x51')],{'as':_0x1fb5('0x124'),'through':_0x1fb5('0x125'),'required':![]});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db['SmsQueue'],{'as':_0x1fb5('0x126'),'through':_0x1fb5('0x35'),'required':![]});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0x61')],{'as':_0x1fb5('0x127'),'through':_0x1fb5('0x37'),'required':![]});db[_0x1fb5('0x12')]['belongsToMany'](db[_0x1fb5('0x128')],{'as':_0x1fb5('0x129'),'through':_0x1fb5('0x39'),'required':![]});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0xf0')],{'through':_0x1fb5('0x11b')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db['VoicePrefix'],{'as':_0x1fb5('0x12a'),'through':_0x1fb5('0x12b'),'required':![]});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0x62')],{'as':_0x1fb5('0x12c'),'through':_0x1fb5('0x12d')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db['FaxAccount'],{'as':_0x1fb5('0x12e'),'through':_0x1fb5('0x12f')});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0x130')],{'as':'MailAccounts','through':_0x1fb5('0x131')});db['User'][_0x1fb5('0x119')](db['OpenchannelAccount'],{'as':_0x1fb5('0x132'),'through':_0x1fb5('0x133')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x53')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0xf9')],{'as':_0x1fb5('0x134'),'through':_0x1fb5('0x135')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db['SquareProject'],{'as':_0x1fb5('0x136'),'through':_0x1fb5('0x137')});db['VoiceChanSpy'][_0x1fb5('0x108')](db[_0x1fb5('0x16')],{'as':_0x1fb5('0x138'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x139')});db['VoiceContext']['hasMany'](db[_0x1fb5('0x16')],{'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x16')][_0x1fb5('0x108')](db['VoiceExtension'],{'as':'Applications','onDelete':'cascade'});db[_0x1fb5('0x13a')]['belongsToMany'](db[_0x1fb5('0x85')],{'as':'Sounds','through':'moh_has_sounds'});db[_0x1fb5('0x19')][_0x1fb5('0x108')](db[_0x1fb5('0x2d')],{'as':'Members','foreignKey':_0x1fb5('0x13b')});db['VoiceQueue'][_0x1fb5('0x108')](db[_0x1fb5('0x6f')],{'as':'Hoppers','foreignKey':_0x1fb5('0x13b')});db['VoiceQueue'][_0x1fb5('0x108')](db[_0x1fb5('0x71')],{'as':_0x1fb5('0x10c'),'foreignKey':_0x1fb5('0x13b')});db[_0x1fb5('0x19')][_0x1fb5('0x108')](db[_0x1fb5('0x73')],{'as':'HopperHistories','foreignKey':_0x1fb5('0x13b')});db['VoiceQueue'][_0x1fb5('0x108')](db[_0x1fb5('0x10e')],{'as':_0x1fb5('0x10e'),'foreignKey':_0x1fb5('0x13b')});db[_0x1fb5('0x19')][_0x1fb5('0x108')](db['CmHopperBlack'],{'as':_0x1fb5('0x13c'),'foreignKey':'VoiceQueueId'});db[_0x1fb5('0x19')][_0x1fb5('0x108')](db[_0x1fb5('0xd0')],{'as':_0x1fb5('0x13d'),'foreignKey':_0x1fb5('0x13b')});db[_0x1fb5('0x19')][_0x1fb5('0x13e')](db[_0x1fb5('0x2b')],{'as':_0x1fb5('0x2b'),'foreignKey':_0x1fb5('0x13f')});db[_0x1fb5('0x19')][_0x1fb5('0x13e')](db[_0x1fb5('0x2b')],{'as':_0x1fb5('0x140'),'foreignKey':_0x1fb5('0x141')});db[_0x1fb5('0x19')]['belongsTo'](db[_0x1fb5('0x7e')],{'as':_0x1fb5('0x7e'),'foreignKey':_0x1fb5('0x142')});db[_0x1fb5('0x19')][_0x1fb5('0x13e')](db[_0x1fb5('0x143')],{'as':'mandatoryDispositionPause','foreignKey':_0x1fb5('0x144')});db[_0x1fb5('0x19')][_0x1fb5('0x119')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x145'),'through':'voice_queues_has_cm_lists'});db[_0x1fb5('0x19')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x2f')});db['VoiceQueue'][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'as':'Teams','through':_0x1fb5('0x104')});db['VoiceQueue'][_0x1fb5('0x119')](db[_0x1fb5('0xf0')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db['VoiceRecording']['belongsTo'](db[_0x1fb5('0x12')],{'as':'User','foreignKey':_0x1fb5('0x107')});db['ScreenRecording']['belongsTo'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x12'),'foreignKey':'UserId'});db[_0x1fb5('0x1e')][_0x1fb5('0x108')](db[_0x1fb5('0x20')],{'as':'Messages','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x147'),'sourceKey':_0x1fb5('0x148')});db[_0x1fb5('0x20')]['belongsTo'](db[_0x1fb5('0x1e')],{'foreignKey':_0x1fb5('0x147'),'targetKey':_0x1fb5('0x148')});db['VoiceCallReport'][_0x1fb5('0x108')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x1fb5('0x149'),'constraints':![]});db[_0x1fb5('0x22')][_0x1fb5('0x108')](db[_0x1fb5('0x26')],{'as':_0x1fb5('0x14a'),'foreignKey':'uniqueid','constraints':![]});db[_0x1fb5('0x22')]['belongsTo'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x12'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x22')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x3b')]['belongsTo'](db[_0x1fb5('0x130')],{'as':_0x1fb5('0x130'),'foreignKey':'MailAccountId'});db[_0x1fb5('0x14d')][_0x1fb5('0x13e')](db[_0x1fb5('0x130')],{'as':_0x1fb5('0x130'),'foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x130')]['hasOne'](db[_0x1fb5('0x3b')],{'as':_0x1fb5('0x14f'),'onDelete':'cascade'});db['MailAccount'][_0x1fb5('0x105')](db[_0x1fb5('0x14d')],{'as':_0x1fb5('0x150'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x130')]['hasMany'](db[_0x1fb5('0x151')],{'as':'Dispositions','foreignKey':_0x1fb5('0x14e'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x130')][_0x1fb5('0x108')](db[_0x1fb5('0x7b')],{'as':'Answers','foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x130')][_0x1fb5('0x108')](db[_0x1fb5('0x42')],{'as':_0x1fb5('0x152'),'foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x130')]['hasMany'](db[_0x1fb5('0x40')],{'as':_0x1fb5('0x153')});db[_0x1fb5('0x130')][_0x1fb5('0x108')](db[_0x1fb5('0x43')],{'as':_0x1fb5('0x154')});db[_0x1fb5('0x130')]['belongsTo'](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x130')]['belongsTo'](db[_0x1fb5('0x157')],{'as':_0x1fb5('0x157'),'foreignKey':_0x1fb5('0x158')});db[_0x1fb5('0x130')][_0x1fb5('0x13e')](db['Pause'],{'as':_0x1fb5('0x159'),'foreignKey':_0x1fb5('0x144')});db[_0x1fb5('0x130')][_0x1fb5('0x119')](db['User'],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x131')});db[_0x1fb5('0x3f')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x32')});db['MailQueue'][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'through':_0x1fb5('0x15a'),'as':_0x1fb5('0x15b')});db[_0x1fb5('0x40')][_0x1fb5('0x108')](db['MailMessage'],{'as':_0x1fb5('0x152'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x1fb5('0x40')][_0x1fb5('0x13e')](db[_0x1fb5('0x130')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x40')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x40')][_0x1fb5('0x13e')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0x1fb5('0x40')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x15d'),'as':'Tags'});db[_0x1fb5('0x40')][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x15d'),'as':_0x1fb5('0x15e')});db[_0x1fb5('0x40')]['belongsToMany'](db['User'],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x160'),'foreignKey':_0x1fb5('0x161')});db[_0x1fb5('0x42')]['hasMany'](db[_0x1fb5('0xe7')],{'as':_0x1fb5('0x162'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x42')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'as':'User'});db[_0x1fb5('0x42')]['belongsTo'](db[_0x1fb5('0x6d')],{'onDelete':_0x1fb5('0x106'),'as':'Contact'});db['MailMessage'][_0x1fb5('0x13e')](db[_0x1fb5('0x40')],{'as':_0x1fb5('0x163'),'foreignKey':_0x1fb5('0x161')});db['MailMessage'][_0x1fb5('0x13e')](db[_0x1fb5('0x130')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x42')][_0x1fb5('0x13e')](db[_0x1fb5('0x62')],{'as':_0x1fb5('0x62'),'foreignKey':'ChatWebsiteId'});db[_0x1fb5('0x42')][_0x1fb5('0x13e')](db[_0x1fb5('0x68')],{'as':_0x1fb5('0x68'),'foreignKey':'ChatOfflineMessageId'});db[_0x1fb5('0x43')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'onDelete':'restrict'});db[_0x1fb5('0x43')][_0x1fb5('0x13e')](db[_0x1fb5('0x3f')],{'onDelete':'restrict'});db[_0x1fb5('0x43')][_0x1fb5('0x13e')](db[_0x1fb5('0x130')],{'onDelete':'restrict'});db[_0x1fb5('0x43')][_0x1fb5('0x13e')](db[_0x1fb5('0x7e')],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x142')});db['MailApplication']['belongsTo'](db[_0x1fb5('0x87')],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x165')});db[_0x1fb5('0x45')][_0x1fb5('0x13e')](db['MailAccount'],{});db['MailQueueReport']['belongsTo'](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db['MailQueueReport'][_0x1fb5('0x13e')](db['CmContact'],{'as':'Contact','foreignKey':_0x1fb5('0x14c')});db['MailQueueReport']['belongsTo'](db[_0x1fb5('0x40')],{});db['MailQueueReport']['belongsTo'](db[_0x1fb5('0x42')],{});db['MailQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{});db['MailQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x3f')],{});db[_0x1fb5('0x166')]['hasMany'](db[_0x1fb5('0x48')],{'as':_0x1fb5('0x167'),'onDelete':'cascade'});db['FaxAccount'][_0x1fb5('0x108')](db['Disposition'],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x169'),'onDelete':'cascade'});db[_0x1fb5('0x4a')][_0x1fb5('0x108')](db['CannedAnswer'],{'as':_0x1fb5('0x16a'),'foreignKey':_0x1fb5('0x169')});db['FaxAccount'][_0x1fb5('0x108')](db[_0x1fb5('0x4e')],{'as':_0x1fb5('0x153')});db[_0x1fb5('0x4a')][_0x1fb5('0x108')](db['FaxApplication'],{'as':_0x1fb5('0x154')});db[_0x1fb5('0x4a')][_0x1fb5('0x108')](db[_0x1fb5('0x16')],{'as':'Exntensions','onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x4a')][_0x1fb5('0x108')](db['FaxMessage'],{'as':'Messages'});db['FaxAccount'][_0x1fb5('0x13e')](db[_0x1fb5('0x2b')],{'as':_0x1fb5('0x2b')});db[_0x1fb5('0x4a')]['belongsTo'](db[_0x1fb5('0xf0')],{'as':'List','foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x4a')]['belongsTo'](db[_0x1fb5('0x143')],{'as':_0x1fb5('0x159'),'foreignKey':_0x1fb5('0x144')});db[_0x1fb5('0x4a')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':'Agents','through':_0x1fb5('0x12f')});db[_0x1fb5('0x4c')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x4c')][_0x1fb5('0x13e')](db[_0x1fb5('0x51')],{'onDelete':_0x1fb5('0x164')});db['FaxApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0x4a')],{'onDelete':_0x1fb5('0x164')});db['FaxApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0x87')],{'onDelete':_0x1fb5('0x164'),'foreignKey':'TagId'});db[_0x1fb5('0x4e')]['hasMany'](db[_0x1fb5('0x50')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x1fb5('0x16b')});db[_0x1fb5('0x4e')][_0x1fb5('0x13e')](db[_0x1fb5('0x4a')],{'as':_0x1fb5('0x15c'),'foreignKey':'FaxAccountId'});db[_0x1fb5('0x4e')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':'ContactId'});db[_0x1fb5('0x4e')][_0x1fb5('0x13e')](db['User'],{'as':'Owner','foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x4e')]['belongsToMany'](db['Tag'],{'through':_0x1fb5('0x16c'),'as':_0x1fb5('0x16d')});db[_0x1fb5('0x4e')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x16c'),'as':_0x1fb5('0x15e')});db[_0x1fb5('0x4e')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x11f'),'foreignKey':_0x1fb5('0x16b')});db[_0x1fb5('0x50')]['belongsTo'](db[_0x1fb5('0x12')],{'onDelete':'cascade','as':_0x1fb5('0x12')});db['FaxMessage']['belongsTo'](db[_0x1fb5('0x4e')],{'as':'Interaction','foreignKey':_0x1fb5('0x16b')});db[_0x1fb5('0x50')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x14b')});db['FaxMessage']['belongsTo'](db[_0x1fb5('0xe7')],{'as':'Attachment','foreignKey':_0x1fb5('0x16e')});db['FaxMessage'][_0x1fb5('0x13e')](db['FaxAccount'],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x169')});db['FaxQueue']['belongsToMany'](db[_0x1fb5('0x12')],{'as':'Agents','through':_0x1fb5('0x125')});db[_0x1fb5('0x51')][_0x1fb5('0x119')](db['Team'],{'through':_0x1fb5('0x16f'),'as':_0x1fb5('0x15b')});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db['FaxAccount'],{});db['FaxQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':'ListId'});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db['CmContact'],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db[_0x1fb5('0x4e')],{});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db[_0x1fb5('0x50')],{});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db['FaxQueue'],{});db[_0x1fb5('0x53')][_0x1fb5('0x108')](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x170'),'onDelete':_0x1fb5('0x106')});db['SmsAccount'][_0x1fb5('0x108')](db[_0x1fb5('0x7b')],{'as':_0x1fb5('0x16a'),'foreignKey':_0x1fb5('0x170')});db[_0x1fb5('0x53')][_0x1fb5('0x108')](db[_0x1fb5('0x58')],{'as':_0x1fb5('0x152'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x1fb5('0x108')](db[_0x1fb5('0x56')],{'as':'Interactions'});db[_0x1fb5('0x53')]['hasMany'](db[_0x1fb5('0x55')],{'as':_0x1fb5('0x154')});db['SmsAccount'][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x53')]['belongsTo'](db[_0x1fb5('0x143')],{'as':_0x1fb5('0x159'),'foreignKey':_0x1fb5('0x144')});db['SmsAccount']['belongsToMany'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':'user_has_sms_accounts'});db[_0x1fb5('0x55')][_0x1fb5('0x13e')](db['User'],{'onDelete':_0x1fb5('0x164')});db['SmsApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0x5a')],{'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x55')][_0x1fb5('0x13e')](db['SmsAccount'],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0x1fb5('0x7e')],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x142')});db[_0x1fb5('0x55')][_0x1fb5('0x13e')](db[_0x1fb5('0x87')],{'onDelete':_0x1fb5('0x164'),'foreignKey':'TagId'});db[_0x1fb5('0x56')]['hasMany'](db[_0x1fb5('0x58')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x1fb5('0x171')});db[_0x1fb5('0x56')]['belongsTo'](db[_0x1fb5('0x53')],{'as':_0x1fb5('0x15c'),'foreignKey':'SmsAccountId'});db[_0x1fb5('0x56')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':'ContactId'});db[_0x1fb5('0x56')][_0x1fb5('0x13e')](db['User'],{'as':_0x1fb5('0x172'),'foreignKey':_0x1fb5('0x107')});db['SmsInteraction'][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x173'),'as':_0x1fb5('0x16d')});db[_0x1fb5('0x56')][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x173'),'as':'ThroughTags'});db['SmsInteraction'][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x120'),'foreignKey':_0x1fb5('0x171')});db[_0x1fb5('0x58')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x12')});db['SmsMessage'][_0x1fb5('0x13e')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x1fb5('0x58')][_0x1fb5('0x13e')](db['SmsInteraction'],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x163'),'foreignKey':_0x1fb5('0x171')});db[_0x1fb5('0x58')]['belongsTo'](db[_0x1fb5('0x53')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x170')});db[_0x1fb5('0x5a')]['belongsToMany'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x1fb5('0x5a')][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'through':'team_has_sms_queues','as':_0x1fb5('0x15b')});db['OpenchannelAccount']['hasMany'](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x174'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x175')]['hasMany'](db[_0x1fb5('0x7b')],{'as':_0x1fb5('0x16a'),'foreignKey':_0x1fb5('0x174')});db[_0x1fb5('0x175')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x1fb5('0x153'),'foreignKey':_0x1fb5('0x174')});db[_0x1fb5('0x175')][_0x1fb5('0x108')](db[_0x1fb5('0x5f')],{'as':_0x1fb5('0x152'),'foreignKey':_0x1fb5('0x174')});db['OpenchannelAccount'][_0x1fb5('0x108')](db[_0x1fb5('0x5c')],{'as':'Applications','foreignKey':_0x1fb5('0x174')});db[_0x1fb5('0x175')]['belongsTo'](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x175')][_0x1fb5('0x13e')](db[_0x1fb5('0x143')],{'as':'mandatoryDispositionPause','foreignKey':_0x1fb5('0x144')});db[_0x1fb5('0x175')][_0x1fb5('0x119')](db['User'],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x133')});db[_0x1fb5('0x5c')][_0x1fb5('0x13e')](db['User'],{'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x5c')][_0x1fb5('0x13e')](db[_0x1fb5('0x61')],{'onDelete':_0x1fb5('0x164'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0x175')],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x174')});db[_0x1fb5('0x5c')][_0x1fb5('0x13e')](db[_0x1fb5('0x7e')],{'onDelete':_0x1fb5('0x164'),'foreignKey':'IntervalId'});db[_0x1fb5('0x5c')]['belongsTo'](db[_0x1fb5('0x87')],{'onDelete':_0x1fb5('0x164'),'foreignKey':'TagId'});db['OpenchannelInteraction']['hasMany'](db[_0x1fb5('0x5f')],{'as':_0x1fb5('0x152'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x176')});db['OpenchannelInteraction'][_0x1fb5('0x13e')](db[_0x1fb5('0x175')],{'as':'Account','foreignKey':_0x1fb5('0x174')});db[_0x1fb5('0x177')]['belongsTo'](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db['OpenchannelInteraction']['belongsTo'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x172'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x177')][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x178'),'as':_0x1fb5('0x16d')});db[_0x1fb5('0x177')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x178'),'as':_0x1fb5('0x15e')});db[_0x1fb5('0x177')]['belongsToMany'](db['User'],{'as':_0x1fb5('0x15f'),'through':'user_has_openchannel_interactions','foreignKey':_0x1fb5('0x176')});db[_0x1fb5('0x5f')]['belongsTo'](db['User'],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x12')});db[_0x1fb5('0x5f')][_0x1fb5('0x13e')](db['CmContact'],{'onDelete':_0x1fb5('0x106'),'as':'Contact'});db[_0x1fb5('0x5f')][_0x1fb5('0x13e')](db[_0x1fb5('0x177')],{'onDelete':_0x1fb5('0x106'),'as':'Interaction','foreignKey':_0x1fb5('0x176')});db[_0x1fb5('0x5f')][_0x1fb5('0x13e')](db['Attachment'],{'as':_0x1fb5('0xe7'),'foreignKey':_0x1fb5('0x16e')});db[_0x1fb5('0x5f')][_0x1fb5('0x13e')](db['OpenchannelAccount'],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x174')});db['OpenchannelQueue'][_0x1fb5('0x119')](db['User'],{'as':_0x1fb5('0x146'),'through':'UserOpenchannelQueue','foreignKey':_0x1fb5('0x179')});db['OpenchannelQueue'][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'through':'team_has_openchannel_queues','as':_0x1fb5('0x15b')});db[_0x1fb5('0x62')][_0x1fb5('0x108')](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x17a'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x62')][_0x1fb5('0x108')](db[_0x1fb5('0x7b')],{'as':'Answers','foreignKey':_0x1fb5('0x17a')});db[_0x1fb5('0x62')][_0x1fb5('0x108')](db[_0x1fb5('0x17b')],{'as':_0x1fb5('0x17c')});db['ChatWebsite'][_0x1fb5('0x108')](db['ChatInteraction'],{'as':_0x1fb5('0x153')});db[_0x1fb5('0x62')][_0x1fb5('0x108')](db['ChatApplication'],{'as':_0x1fb5('0x154')});db[_0x1fb5('0x62')][_0x1fb5('0x108')](db[_0x1fb5('0x67')],{'as':'Messages'});db[_0x1fb5('0x62')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x62')][_0x1fb5('0x13e')](db[_0x1fb5('0x7e')],{'as':_0x1fb5('0x7e'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0x1fb5('0x13e')](db[_0x1fb5('0x130')],{'as':_0x1fb5('0x130'),'foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x62')][_0x1fb5('0x13e')](db[_0x1fb5('0x143')],{'as':_0x1fb5('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1fb5('0x62')][_0x1fb5('0x119')](db['User'],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x12d')});db['OpenchannelQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x175')],{});db[_0x1fb5('0x63')][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x63')]['belongsTo'](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x63')]['belongsTo'](db[_0x1fb5('0x177')],{});db[_0x1fb5('0x63')][_0x1fb5('0x13e')](db['OpenchannelMessage'],{});db[_0x1fb5('0x63')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{});db[_0x1fb5('0x63')][_0x1fb5('0x13e')](db[_0x1fb5('0x61')],{});db[_0x1fb5('0x64')][_0x1fb5('0x13e')](db['User'],{'as':_0x1fb5('0x17d'),'foreignKey':'UserId','onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x64')][_0x1fb5('0x13e')](db[_0x1fb5('0x69')],{'as':_0x1fb5('0x17e'),'foreignKey':_0x1fb5('0x17f'),'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x64')][_0x1fb5('0x13e')](db[_0x1fb5('0x62')],{'as':'Website','foreignKey':_0x1fb5('0x17a'),'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x64')][_0x1fb5('0x13e')](db['Tag'],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x165')});db[_0x1fb5('0x11d')]['hasMany'](db[_0x1fb5('0x67')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x1fb5('0x180')});db[_0x1fb5('0x11d')]['belongsTo'](db[_0x1fb5('0x62')],{'as':'Account','foreignKey':_0x1fb5('0x17a')});db[_0x1fb5('0x11d')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x11d')]['belongsTo'](db[_0x1fb5('0x12')],{'as':'Owner','foreignKey':_0x1fb5('0x107')});db['ChatInteraction']['belongsToMany'](db[_0x1fb5('0x87')],{'through':'chat_interaction_has_tags','as':_0x1fb5('0x16d')});db[_0x1fb5('0x11d')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x181'),'as':_0x1fb5('0x15e')});db[_0x1fb5('0x11d')]['belongsToMany'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':'user_has_chat_interactions','foreignKey':_0x1fb5('0x180')});db[_0x1fb5('0x67')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x12')});db[_0x1fb5('0x67')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x67')][_0x1fb5('0x13e')](db[_0x1fb5('0x11d')],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x163'),'foreignKey':_0x1fb5('0x180')});db[_0x1fb5('0x67')][_0x1fb5('0x13e')](db[_0x1fb5('0xe7')],{'as':'Attachment','foreignKey':_0x1fb5('0x16e')});db['ChatMessage'][_0x1fb5('0x13e')](db[_0x1fb5('0x62')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x17a')});db[_0x1fb5('0x68')][_0x1fb5('0x108')](db[_0x1fb5('0xe7')],{'as':_0x1fb5('0x162'),'foreignKey':_0x1fb5('0x182'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db[_0x1fb5('0x68')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'onDelete':_0x1fb5('0x106'),'as':'Contact','foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x68')][_0x1fb5('0x13e')](db['ChatWebsite'],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x17a')});db[_0x1fb5('0x69')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x30'),'hooks':!![]});db[_0x1fb5('0x69')][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'through':'team_has_chat_queues','as':_0x1fb5('0x15b')});db[_0x1fb5('0x116')][_0x1fb5('0x108')](db[_0x1fb5('0xcb')],{'as':_0x1fb5('0x152'),'foreignKey':_0x1fb5('0x183'),'onDelete':_0x1fb5('0x106')});db['ChatGroup']['belongsToMany'](db['User'],{'as':_0x1fb5('0x184'),'through':_0x1fb5('0x118')});db[_0x1fb5('0x17b')]['belongsTo'](db[_0x1fb5('0x62')],{'as':_0x1fb5('0x185'),'foreignKey':_0x1fb5('0x17a')});db['CmCompany'][_0x1fb5('0x108')](db[_0x1fb5('0x6d')],{'as':'Contacts','foreignKey':_0x1fb5('0x186')});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db[_0x1fb5('0x6f')],{'as':'Hoppers','foreignKey':'ContactId'});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db['CmHopperFinal'],{'as':_0x1fb5('0x10c'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db[_0x1fb5('0x73')],{'as':_0x1fb5('0x187'),'foreignKey':_0x1fb5('0x14c')});db['CmContact']['hasMany'](db[_0x1fb5('0x10e')],{'as':_0x1fb5('0x10e'),'foreignKey':'ContactId'});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db[_0x1fb5('0xd0')],{'as':_0x1fb5('0x13d'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db[_0x1fb5('0x177')],{'as':_0x1fb5('0x10f'),'foreignKey':'ContactId','onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db[_0x1fb5('0x11d')],{'as':_0x1fb5('0x110'),'foreignKey':_0x1fb5('0x14c'),'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x1fb5('0x14c'),'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x6d')]['hasMany'](db[_0x1fb5('0x4e')],{'as':'FaxInteractions','foreignKey':_0x1fb5('0x14c'),'onDelete':'restrict'});db[_0x1fb5('0x6d')]['hasMany'](db['MailInteraction'],{'as':_0x1fb5('0x188'),'foreignKey':_0x1fb5('0x14c'),'onDelete':'restrict'});db[_0x1fb5('0x6d')][_0x1fb5('0x13e')](db[_0x1fb5('0x189')],{'as':_0x1fb5('0x18a'),'foreignKey':'CompanyId'});db['CmContact'][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':'List','foreignKey':_0x1fb5('0x156'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x6d')]['belongsToMany'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x18b')});db['CmContact']['belongsToMany'](db[_0x1fb5('0x87')],{'as':'Tags','through':_0x1fb5('0x18c')});db[_0x1fb5('0x6d')][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x18c'),'as':_0x1fb5('0x15e')});db['CmHopper']['belongsTo'](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c'),'onDelete':'cascade'});db[_0x1fb5('0x6f')][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x6f')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x17d'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x6f')]['belongsTo'](db[_0x1fb5('0x19')],{'as':'Queue','foreignKey':_0x1fb5('0x13b'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x6f')][_0x1fb5('0x13e')](db[_0x1fb5('0xe4')],{'as':_0x1fb5('0xe4'),'foreignKey':_0x1fb5('0x18d'),'onDelete':'cascade'});db[_0x1fb5('0x6f')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'as':'Owner','foreignKey':_0x1fb5('0x18e')});db[_0x1fb5('0x70')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x70')][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':'ListId','onDelete':_0x1fb5('0x106')});db['CmHopperBlack'][_0x1fb5('0x13e')](db[_0x1fb5('0x19')],{'as':_0x1fb5('0x17e'),'foreignKey':_0x1fb5('0x13b'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x70')][_0x1fb5('0x13e')](db[_0x1fb5('0xe4')],{'as':_0x1fb5('0xe4'),'foreignKey':_0x1fb5('0x18d'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x79')][_0x1fb5('0x108')](db['Condition'],{'as':{'plural':'All','singular':_0x1fb5('0x18f')},'foreignKey':_0x1fb5('0x190'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db[_0x1fb5('0x79')]['hasMany'](db[_0x1fb5('0x7d')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0x1fb5('0x191'),'foreignKey':_0x1fb5('0x192'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db['Disposition'][_0x1fb5('0x108')](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x193'),'onDelete':_0x1fb5('0x106')});db['Interval'][_0x1fb5('0x108')](db['Interval'],{'as':_0x1fb5('0x194'),'foreignKey':'IntervalId','onDelete':_0x1fb5('0x106'),'hooks':!![],'required':![]});db['Interval'][_0x1fb5('0x108')](db[_0x1fb5('0x16')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x1fb5('0x164')});db['Interval'][_0x1fb5('0x108')](db[_0x1fb5('0x43')],{'as':_0x1fb5('0x195'),'foreignKey':'IntervalId'});db[_0x1fb5('0x7e')]['hasMany'](db[_0x1fb5('0x64')],{'as':_0x1fb5('0x196'),'foreignKey':_0x1fb5('0x142')});db[_0x1fb5('0x7e')][_0x1fb5('0x108')](db[_0x1fb5('0x4c')],{'as':_0x1fb5('0x197'),'foreignKey':_0x1fb5('0x142')});db['Interval'][_0x1fb5('0x108')](db['SmsApplication'],{'as':_0x1fb5('0x198'),'foreignKey':_0x1fb5('0x142')});db[_0x1fb5('0x83')]['belongsTo'](db[_0x1fb5('0x130')],{});db[_0x1fb5('0x83')][_0x1fb5('0x13e')](db[_0x1fb5('0x92')],{'foreignKey':_0x1fb5('0x199')});db['Schedule'][_0x1fb5('0x13e')](db[_0x1fb5('0x90')],{'foreignKey':'CustomReportId'});db[_0x1fb5('0x85')][_0x1fb5('0x119')](db[_0x1fb5('0x13a')],{'as':'Mohs','through':_0x1fb5('0x19a'),'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x87')][_0x1fb5('0x119')](db[_0x1fb5('0x6d')],{'through':_0x1fb5('0x18c')});db[_0x1fb5('0x87')][_0x1fb5('0x119')](db[_0x1fb5('0x11d')],{'through':_0x1fb5('0x181')});db['Tag'][_0x1fb5('0x119')](db[_0x1fb5('0x40')],{'through':_0x1fb5('0x15d')});db['Tag']['belongsToMany'](db[_0x1fb5('0x56')],{'through':'sms_interaction_has_tags'});db[_0x1fb5('0x87')][_0x1fb5('0x119')](db[_0x1fb5('0x4e')],{'through':_0x1fb5('0x16c')});db['Tag']['belongsToMany'](db[_0x1fb5('0x177')],{'through':_0x1fb5('0x178')});db[_0x1fb5('0x87')][_0x1fb5('0x119')](db[_0x1fb5('0xfb')],{'through':_0x1fb5('0x19b')});db[_0x1fb5('0x19c')][_0x1fb5('0x108')](db['Condition'],{'as':{'plural':_0x1fb5('0x19d'),'singular':'AllCondition'},'foreignKey':_0x1fb5('0x19e'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db[_0x1fb5('0x19c')]['hasMany'](db[_0x1fb5('0x7d')],{'as':{'plural':_0x1fb5('0x19f'),'singular':_0x1fb5('0x1a0')},'foreignKey':'TriggerAnyId','onDelete':_0x1fb5('0x106'),'hooks':!![]});db['Trigger'][_0x1fb5('0x108')](db[_0x1fb5('0x77')],{'as':_0x1fb5('0x191'),'foreignKey':_0x1fb5('0x1a1'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db[_0x1fb5('0x90')][_0x1fb5('0x108')](db[_0x1fb5('0x95')],{'as':_0x1fb5('0x1a2'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a3'),'hooks':!![]});db[_0x1fb5('0x92')][_0x1fb5('0x108')](db[_0x1fb5('0x95')],{'as':_0x1fb5('0x1a2'),'onDelete':'cascade','foreignKey':_0x1fb5('0x199')});db['AnalyticMetric'][_0x1fb5('0x108')](db[_0x1fb5('0x95')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x1fb5('0x1a4')});db[_0x1fb5('0x95')][_0x1fb5('0x13e')](db[_0x1fb5('0x1a5')],{'foreignKey':_0x1fb5('0x1a4')});db[_0x1fb5('0x99')][_0x1fb5('0x108')](db[_0x1fb5('0x9b')],{'as':'Configurations','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0x9b')][_0x1fb5('0x108')](db[_0x1fb5('0x9d')],{'as':_0x1fb5('0x1a7'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x1fb5('0x9b')][_0x1fb5('0x108')](db['SalesforceField'],{'as':_0x1fb5('0x1a8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0x1fb5('0x108')](db[_0x1fb5('0x9d')],{'as':_0x1fb5('0x1a2'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0x9b')][_0x1fb5('0x13e')](db[_0x1fb5('0x99')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0x1fb5('0x108')](db[_0x1fb5('0x9d')],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0x9d')]['hasMany'](db[_0x1fb5('0x9d')],{'as':_0x1fb5('0x1ac'),'foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0x9d')][_0x1fb5('0x108')](db[_0x1fb5('0x9d')],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db['SalesforceField']['belongsTo'](db['Variable'],{'as':_0x1fb5('0x1af'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0x1fb5('0x108')](db[_0x1fb5('0x1b0')],{'as':_0x1fb5('0x1b1'),'onDelete':'cascade','foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0x1b0')][_0x1fb5('0x108')](db[_0x1fb5('0xa1')],{'as':_0x1fb5('0x1a7'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ab')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0x1fb5('0x1a8'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ad')});db['SugarcrmConfiguration'][_0x1fb5('0x108')](db[_0x1fb5('0xa1')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x1fb5('0x1b0')][_0x1fb5('0x13e')](db[_0x1fb5('0x9f')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xa1')]['hasMany'](db['SugarcrmField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x1fb5('0xa1')][_0x1fb5('0x108')](db[_0x1fb5('0xa1')],{'as':'Description','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xa1')]['hasMany'](db[_0x1fb5('0xa1')],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db['SugarcrmField'][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':'Variable','foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0xa2')]['hasMany'](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0x1fb5('0x106'),'foreignKey':'AccountId'});db[_0x1fb5('0xa4')][_0x1fb5('0x108')](db[_0x1fb5('0xa6')],{'as':_0x1fb5('0x1a7'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xa4')]['hasMany'](db[_0x1fb5('0xa6')],{'as':_0x1fb5('0x1a8'),'onDelete':'cascade','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xa4')][_0x1fb5('0x108')](db[_0x1fb5('0xa6')],{'as':_0x1fb5('0x1a2'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xa4')][_0x1fb5('0x13e')](db[_0x1fb5('0xa2')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xa4')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x1b3')});db[_0x1fb5('0xa6')][_0x1fb5('0x108')](db[_0x1fb5('0xa6')],{'as':'Subject','foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xa6')][_0x1fb5('0x108')](db[_0x1fb5('0xa6')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x1fb5('0xa6')]['hasMany'](db['DeskField'],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db['DeskField'][_0x1fb5('0x13e')](db['Variable'],{'as':_0x1fb5('0x1af'),'foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0x1b4')][_0x1fb5('0x108')](db[_0x1fb5('0xa9')],{'as':_0x1fb5('0x1b1'),'onDelete':_0x1fb5('0x106'),'foreignKey':'AccountId'});db[_0x1fb5('0xa9')][_0x1fb5('0x108')](db[_0x1fb5('0xaa')],{'as':_0x1fb5('0x1a7'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xa9')][_0x1fb5('0x108')](db[_0x1fb5('0xaa')],{'as':_0x1fb5('0x1a8'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xa9')]['hasMany'](db['ZohoField'],{'as':_0x1fb5('0x1a2'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xa9')][_0x1fb5('0x13e')](db[_0x1fb5('0x1b4')],{'as':_0x1fb5('0x15c'),'foreignKey':'AccountId'});db[_0x1fb5('0xaa')][_0x1fb5('0x108')](db[_0x1fb5('0xaa')],{'as':'Subject','foreignKey':_0x1fb5('0x1ab')});db['ZohoField'][_0x1fb5('0x108')](db[_0x1fb5('0xaa')],{'as':_0x1fb5('0x1ac'),'foreignKey':_0x1fb5('0x1ad')});db['ZohoField'][_0x1fb5('0x108')](db[_0x1fb5('0xaa')],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xaa')][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':'Variable','foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0x1b5')][_0x1fb5('0x108')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xad')][_0x1fb5('0x108')](db[_0x1fb5('0x1b6')],{'as':_0x1fb5('0x1a7'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xad')]['hasMany'](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xad')][_0x1fb5('0x108')](db['ZendeskField'],{'as':_0x1fb5('0x1a2'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xad')][_0x1fb5('0x13e')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xad')]['belongsToMany'](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x1b7')});db[_0x1fb5('0x1b6')][_0x1fb5('0x108')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0x1b6')][_0x1fb5('0x108')](db[_0x1fb5('0x1b6')],{'as':_0x1fb5('0x1ac'),'foreignKey':'DescriptionId'});db[_0x1fb5('0x1b6')][_0x1fb5('0x108')](db['ZendeskField'],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0x1b6')][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':_0x1fb5('0x1af'),'foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0xb0')][_0x1fb5('0x108')](db[_0x1fb5('0xb2')],{'as':_0x1fb5('0x1b1'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xb2')][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':_0x1fb5('0x1a7'),'onDelete':'cascade','foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xb2')][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':_0x1fb5('0x1a8'),'onDelete':_0x1fb5('0x106'),'foreignKey':'DescriptionId'});db[_0x1fb5('0xb2')][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':'Fields','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xb2')][_0x1fb5('0x13e')](db[_0x1fb5('0xb0')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db['FreshdeskConfiguration'][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x1b8')});db['FreshdeskField'][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xb4')][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':_0x1fb5('0x1ac'),'foreignKey':'DescriptionId'});db[_0x1fb5('0xb4')][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xb4')]['belongsTo'](db[_0x1fb5('0x1af')],{'as':_0x1fb5('0x1af'),'foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0xb5')][_0x1fb5('0x108')](db[_0x1fb5('0xb7')],{'as':_0x1fb5('0x1b1'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x1fb5('0xb7')][_0x1fb5('0x108')](db[_0x1fb5('0xb8')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x1fb5('0xb7')][_0x1fb5('0x108')](db[_0x1fb5('0xb8')],{'as':_0x1fb5('0x1a8'),'foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xb7')][_0x1fb5('0x108')](db['VtigerField'],{'as':_0x1fb5('0x1a2'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0x1fb5('0x13e')](db['VtigerAccount'],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db['VtigerField'][_0x1fb5('0x108')](db[_0x1fb5('0xb8')],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db['VtigerField']['hasMany'](db[_0x1fb5('0xb8')],{'as':'Description','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xb8')][_0x1fb5('0x108')](db[_0x1fb5('0xb8')],{'as':_0x1fb5('0x1ae'),'foreignKey':'FieldId'});db['VtigerField'][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':_0x1fb5('0x1af'),'foreignKey':'VariableId'});db[_0x1fb5('0xba')][_0x1fb5('0x108')](db[_0x1fb5('0xbc')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x1fb5('0x1a6')});db['ServicenowConfiguration'][_0x1fb5('0x108')](db[_0x1fb5('0x1b9')],{'as':_0x1fb5('0x1a7'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xbc')][_0x1fb5('0x108')](db[_0x1fb5('0x1b9')],{'as':_0x1fb5('0x1a8'),'foreignKey':_0x1fb5('0x1ad')});db['ServicenowConfiguration'][_0x1fb5('0x108')](db['ServicenowField'],{'as':_0x1fb5('0x1a2'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xbc')][_0x1fb5('0x13e')](db[_0x1fb5('0xba')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0x1b9')][_0x1fb5('0x108')](db[_0x1fb5('0x1b9')],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db['ServicenowField'][_0x1fb5('0x108')](db['ServicenowField'],{'as':_0x1fb5('0x1ac'),'foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0x1b9')]['hasMany'](db['ServicenowField'],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0x1b9')][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':'Variable','foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0x1ba')][_0x1fb5('0x108')](db[_0x1fb5('0xc0')],{'as':'Configurations','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xc0')]['hasMany'](db[_0x1fb5('0xc2')],{'as':_0x1fb5('0x1a7'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xc0')]['hasMany'](db[_0x1fb5('0xc2')],{'as':_0x1fb5('0x1a8'),'onDelete':'cascade','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xc0')][_0x1fb5('0x108')](db[_0x1fb5('0xc2')],{'as':_0x1fb5('0x1a2'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xc0')][_0x1fb5('0x13e')](db[_0x1fb5('0x1ba')],{'as':_0x1fb5('0x15c'),'foreignKey':'AccountId'});db[_0x1fb5('0xc2')][_0x1fb5('0x108')](db[_0x1fb5('0xc2')],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xc2')][_0x1fb5('0x108')](db[_0x1fb5('0xc2')],{'as':'Description','foreignKey':_0x1fb5('0x1ad')});db['Dynamics365Field'][_0x1fb5('0x108')](db[_0x1fb5('0xc2')],{'as':'Field','foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xc2')][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':_0x1fb5('0x1af'),'foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0xc4')][_0x1fb5('0x108')](db[_0x1fb5('0xc6')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x1fb5('0xc6')][_0x1fb5('0x108')](db[_0x1fb5('0x1bb')],{'as':_0x1fb5('0x1a7'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xc6')][_0x1fb5('0x108')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xc6')][_0x1fb5('0x108')](db[_0x1fb5('0x1bb')],{'as':_0x1fb5('0x1a2'),'foreignKey':_0x1fb5('0x1a9')});db['FreshsalesConfiguration']['belongsTo'](db[_0x1fb5('0xc4')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0x1bb')][_0x1fb5('0x108')](db['FreshsalesField'],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0x1bb')][_0x1fb5('0x108')](db['FreshsalesField'],{'as':_0x1fb5('0x1ac'),'foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0x1bb')]['hasMany'](db[_0x1fb5('0x1bb')],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0x1bb')][_0x1fb5('0x13e')](db['Variable'],{'as':'Variable','foreignKey':_0x1fb5('0x1b2')});db['ChatQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x62')],{});db[_0x1fb5('0x1bc')]['belongsTo'](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x1bc')][_0x1fb5('0x13e')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['ChatQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x11d')],{});db['ChatQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x67')],{});db[_0x1fb5('0x1bc')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{});db[_0x1fb5('0x1bc')]['belongsTo'](db[_0x1fb5('0x69')],{});db[_0x1fb5('0xcb')][_0x1fb5('0x13e')](db['User'],{'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1bd')});db[_0x1fb5('0xcb')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1be')});db['JscriptySessionReport'][_0x1fb5('0x108')](db[_0x1fb5('0x1bf')],{'foreignKey':_0x1fb5('0x1c0'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0xd0')][_0x1fb5('0x108')](db[_0x1fb5('0xcd')],{'foreignKey':_0x1fb5('0x1c0'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0xd2')][_0x1fb5('0x13e')](db['SmsAccount'],{});db[_0x1fb5('0xd2')][_0x1fb5('0x13e')](db['CmList'],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db['SmsQueueReport'][_0x1fb5('0x13e')](db['CmContact'],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0xd2')][_0x1fb5('0x13e')](db['SmsInteraction'],{});db[_0x1fb5('0xd2')][_0x1fb5('0x13e')](db['SmsMessage'],{});db['SmsQueueReport']['belongsTo'](db[_0x1fb5('0x12')],{});db[_0x1fb5('0xd2')][_0x1fb5('0x13e')](db[_0x1fb5('0x5a')],{});db[_0x1fb5('0xd7')][_0x1fb5('0x108')](db[_0x1fb5('0xd0')],{'foreignKey':_0x1fb5('0x1c1')});db[_0x1fb5('0xd7')][_0x1fb5('0x108')](db[_0x1fb5('0x1bf')],{'foreignKey':_0x1fb5('0x1c1')});db[_0x1fb5('0xd7')][_0x1fb5('0x108')](db['JscriptyAnswerReport'],{'foreignKey':_0x1fb5('0x1c1')});db['SquareProject'][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x137')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db['User'],{'as':'Agents','through':_0x1fb5('0x11c')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db[_0x1fb5('0x19')],{'through':_0x1fb5('0x104'),'as':_0x1fb5('0x122')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db['MailQueue'],{'through':_0x1fb5('0x15a'),'as':_0x1fb5('0x123')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db['ChatQueue'],{'through':_0x1fb5('0x1c2'),'as':'ChatQueues'});db['Team'][_0x1fb5('0x119')](db[_0x1fb5('0x51')],{'through':'team_has_fax_queues','as':_0x1fb5('0x124')});db['Team'][_0x1fb5('0x119')](db[_0x1fb5('0x5a')],{'through':_0x1fb5('0x1c3'),'as':_0x1fb5('0x126')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db['OpenchannelQueue'],{'through':_0x1fb5('0x1c4'),'as':_0x1fb5('0x127')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db[_0x1fb5('0x128')],{'through':_0x1fb5('0x1c5'),'as':_0x1fb5('0x129')});db[_0x1fb5('0xe4')][_0x1fb5('0x108')](db[_0x1fb5('0x6f')],{'as':_0x1fb5('0x1c6'),'foreignKey':_0x1fb5('0x18d')});db['Campaign'][_0x1fb5('0x108')](db[_0x1fb5('0x71')],{'as':_0x1fb5('0x10c'),'foreignKey':_0x1fb5('0x18d')});db[_0x1fb5('0xe4')][_0x1fb5('0x108')](db[_0x1fb5('0x73')],{'as':_0x1fb5('0x187'),'foreignKey':_0x1fb5('0x18d')});db[_0x1fb5('0xe4')]['hasMany'](db['CmHopperBlack'],{'as':_0x1fb5('0x13c'),'foreignKey':'CampaignId'});db['Campaign'][_0x1fb5('0x13e')](db[_0x1fb5('0x2b')],{'as':_0x1fb5('0x2b'),'foreignKey':_0x1fb5('0x13f')});db['Campaign']['belongsTo'](db[_0x1fb5('0x2b')],{'as':_0x1fb5('0x140'),'foreignKey':_0x1fb5('0x141')});db[_0x1fb5('0xe4')][_0x1fb5('0x13e')](db[_0x1fb5('0x7e')],{'as':_0x1fb5('0x7e'),'foreignKey':_0x1fb5('0x142')});db[_0x1fb5('0xe4')][_0x1fb5('0x13e')](db[_0x1fb5('0xdc')],{'as':'SquareProject','foreignKey':_0x1fb5('0x1c7')});db[_0x1fb5('0xe4')][_0x1fb5('0x119')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x145'),'through':'campaigns_has_cm_lists'});db[_0x1fb5('0xe4')][_0x1fb5('0x119')](db[_0x1fb5('0xf0')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0x1fb5('0xe7')]['belongsTo'](db[_0x1fb5('0x68')],{'as':_0x1fb5('0x68'),'foreignKey':_0x1fb5('0x182')});db[_0x1fb5('0xea')][_0x1fb5('0x13e')](db[_0x1fb5('0x42')],{});db[_0x1fb5('0xea')][_0x1fb5('0x13e')](db[_0x1fb5('0x40')],{});db['MailTransferReport'][_0x1fb5('0x13e')](db['MailAccount'],{'foreignKey':_0x1fb5('0x1c8'),'as':'FromAccount'});db['MailTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'foreignKey':'FromUserId','as':_0x1fb5('0x1c9')});db[_0x1fb5('0xea')][_0x1fb5('0x13e')](db['User'],{'foreignKey':'ToUserId','as':_0x1fb5('0x1ca')});db[_0x1fb5('0xea')][_0x1fb5('0x13e')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x1fb5('0x1cb')});db[_0x1fb5('0xea')]['belongsTo'](db[_0x1fb5('0x130')],{'foreignKey':_0x1fb5('0x1cc'),'as':_0x1fb5('0x1cd')});db['ChatTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x67')],{});db[_0x1fb5('0x1ce')]['belongsTo'](db[_0x1fb5('0x11d')],{});db['ChatTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x62')],{'foreignKey':_0x1fb5('0x1cf'),'as':'FromAccount'});db[_0x1fb5('0x1ce')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'foreignKey':_0x1fb5('0x1d0'),'as':_0x1fb5('0x1c9')});db[_0x1fb5('0x1ce')][_0x1fb5('0x13e')](db['User'],{'foreignKey':_0x1fb5('0x1d1'),'as':_0x1fb5('0x1ca')});db[_0x1fb5('0x1ce')][_0x1fb5('0x13e')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x1fb5('0x1cb')});db[_0x1fb5('0x1ce')]['belongsTo'](db[_0x1fb5('0x62')],{'foreignKey':_0x1fb5('0x1d2'),'as':_0x1fb5('0x1cd')});db[_0x1fb5('0x1d3')]['belongsTo'](db[_0x1fb5('0x50')],{});db['FaxTransferReport']['belongsTo'](db[_0x1fb5('0x4e')],{});db[_0x1fb5('0x1d3')][_0x1fb5('0x13e')](db[_0x1fb5('0x4a')],{'foreignKey':_0x1fb5('0x1d4'),'as':'FromAccount'});db['FaxTransferReport'][_0x1fb5('0x13e')](db['User'],{'foreignKey':_0x1fb5('0x1d0'),'as':_0x1fb5('0x1c9')});db[_0x1fb5('0x1d3')]['belongsTo'](db['User'],{'foreignKey':_0x1fb5('0x1d1'),'as':_0x1fb5('0x1ca')});db[_0x1fb5('0x1d3')][_0x1fb5('0x13e')](db[_0x1fb5('0x51')],{'foreignKey':'ToFaxQueueId','as':_0x1fb5('0x1cb')});db[_0x1fb5('0x1d3')]['belongsTo'](db[_0x1fb5('0x4a')],{'foreignKey':'ToFaxAccountId','as':_0x1fb5('0x1cd')});db[_0x1fb5('0xec')][_0x1fb5('0x13e')](db[_0x1fb5('0x5f')],{});db['OpenchannelTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x177')],{});db[_0x1fb5('0xec')]['belongsTo'](db[_0x1fb5('0x175')],{'foreignKey':_0x1fb5('0x1d5'),'as':_0x1fb5('0x1d6')});db[_0x1fb5('0xec')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'foreignKey':_0x1fb5('0x1d0'),'as':_0x1fb5('0x1c9')});db[_0x1fb5('0xec')][_0x1fb5('0x13e')](db['User'],{'foreignKey':_0x1fb5('0x1d1'),'as':_0x1fb5('0x1ca')});db['OpenchannelTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x61')],{'foreignKey':_0x1fb5('0x1d7'),'as':_0x1fb5('0x1cb')});db['OpenchannelTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x175')],{'foreignKey':_0x1fb5('0x1d8'),'as':_0x1fb5('0x1cd')});db[_0x1fb5('0xee')][_0x1fb5('0x13e')](db[_0x1fb5('0x58')],{});db[_0x1fb5('0xee')][_0x1fb5('0x13e')](db[_0x1fb5('0x56')],{});db['SmsTransferReport'][_0x1fb5('0x13e')](db['SmsAccount'],{'foreignKey':_0x1fb5('0x1d9'),'as':_0x1fb5('0x1d6')});db[_0x1fb5('0xee')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'foreignKey':_0x1fb5('0x1d0'),'as':_0x1fb5('0x1c9')});db[_0x1fb5('0xee')]['belongsTo'](db[_0x1fb5('0x12')],{'foreignKey':_0x1fb5('0x1d1'),'as':_0x1fb5('0x1ca')});db[_0x1fb5('0xee')][_0x1fb5('0x13e')](db[_0x1fb5('0x5a')],{'foreignKey':_0x1fb5('0x1da'),'as':_0x1fb5('0x1cb')});db['SmsTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x53')],{'foreignKey':_0x1fb5('0x1db'),'as':_0x1fb5('0x1cd')});db[_0x1fb5('0xf0')]['hasMany'](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x156'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0xf0')][_0x1fb5('0x108')](db[_0x1fb5('0x75')],{'as':'CustomFields','foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xf0')][_0x1fb5('0x108')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x11a'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xf0')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x1fb5('0xf0')][_0x1fb5('0x108')](db[_0x1fb5('0x73')],{'as':_0x1fb5('0x10d'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xf0')][_0x1fb5('0x108')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xf0')][_0x1fb5('0x119')](db[_0x1fb5('0x19')],{'as':'Queues','through':_0x1fb5('0x1dc')});db[_0x1fb5('0xf0')][_0x1fb5('0x119')](db['User'],{'as':_0x1fb5('0x146'),'through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0x1fb5('0x16')],{'as':_0x1fb5('0x10b'),'onDelete':_0x1fb5('0x106')});db['VoicePrefix'][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x12b')});db[_0x1fb5('0xf2')][_0x1fb5('0x108')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'foreignKey':'userProfileId'});db[_0x1fb5('0xf2')][_0x1fb5('0x108')](db[_0x1fb5('0xf3')],{'as':'UserProfileSections','foreignKey':_0x1fb5('0x115'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0xf3')]['hasMany'](db[_0x1fb5('0xf5')],{'as':_0x1fb5('0x1dd'),'foreignKey':_0x1fb5('0x1de'),'onDelete':'cascade'});db[_0x1fb5('0xf9')][_0x1fb5('0x108')](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':'WhatsappAccountId','onDelete':_0x1fb5('0x106')});db[_0x1fb5('0xf9')][_0x1fb5('0x108')](db[_0x1fb5('0x7b')],{'as':_0x1fb5('0x16a'),'foreignKey':_0x1fb5('0x1df')});db['WhatsappAccount']['hasMany'](db[_0x1fb5('0xfd')],{'as':_0x1fb5('0x152'),'foreignKey':_0x1fb5('0x1df')});db[_0x1fb5('0xf9')]['hasMany'](db[_0x1fb5('0xfb')],{'as':_0x1fb5('0x153')});db['WhatsappAccount']['hasMany'](db[_0x1fb5('0x1e0')],{'as':'Applications'});db[_0x1fb5('0xf9')]['belongsTo'](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xf9')][_0x1fb5('0x13e')](db[_0x1fb5('0x143')],{'as':_0x1fb5('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1fb5('0xf9')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x135')});db['WhatsappApplication'][_0x1fb5('0x13e')](db['User'],{'onDelete':_0x1fb5('0x164')});db['WhatsappApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0x128')],{'onDelete':_0x1fb5('0x164')});db['WhatsappApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0xf9')],{'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x1e0')][_0x1fb5('0x13e')](db['Interval'],{'onDelete':_0x1fb5('0x164'),'foreignKey':'IntervalId'});db[_0x1fb5('0x1e0')][_0x1fb5('0x13e')](db[_0x1fb5('0x87')],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x165')});db[_0x1fb5('0xfb')][_0x1fb5('0x108')](db[_0x1fb5('0xfd')],{'as':'Messages','onDelete':_0x1fb5('0x106'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x1fb5('0x13e')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x1fb5('0x1df')});db['WhatsappInteraction'][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0xfb')][_0x1fb5('0x13e')](db['User'],{'as':'Owner','foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0xfb')][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x19b'),'as':_0x1fb5('0x16d')});db[_0x1fb5('0xfb')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x19b'),'as':_0x1fb5('0x15e')});db['WhatsappInteraction'][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x1e1'),'foreignKey':_0x1fb5('0x1e2')});db[_0x1fb5('0xfd')]['belongsTo'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x12')});db['WhatsappMessage'][_0x1fb5('0x13e')](db['CmContact'],{'onDelete':'cascade','as':_0x1fb5('0x14b')});db['WhatsappMessage'][_0x1fb5('0x13e')](db[_0x1fb5('0xfb')],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x163'),'foreignKey':_0x1fb5('0x1e2')});db[_0x1fb5('0xfd')]['belongsTo'](db[_0x1fb5('0xf9')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1df')});db[_0x1fb5('0xff')][_0x1fb5('0x13e')](db['WhatsappAccount'],{});db[_0x1fb5('0xff')][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xff')]['belongsTo'](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0xff')][_0x1fb5('0x13e')](db[_0x1fb5('0xfb')],{});db[_0x1fb5('0xff')]['belongsTo'](db[_0x1fb5('0x128')],{});db['WhatsappQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0xfd')],{});db[_0x1fb5('0xff')]['belongsTo'](db['User'],{});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db['WhatsappMessage'],{});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db[_0x1fb5('0xfb')],{});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db[_0x1fb5('0xf9')],{'foreignKey':_0x1fb5('0x1e4'),'as':_0x1fb5('0x1d6')});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db[_0x1fb5('0xf9')],{'foreignKey':_0x1fb5('0x1e5'),'as':'ToAccount'});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db['WhatsappQueue'],{'foreignKey':_0x1fb5('0x1e6'),'as':_0x1fb5('0x1cb')});db['WhatsappTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'foreignKey':_0x1fb5('0x1d0'),'as':_0x1fb5('0x1c9')});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db['User'],{'foreignKey':'ToUserId','as':_0x1fb5('0x1ca')});db['WhatsappQueue'][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x39'),'foreignKey':'WhatsappQueueId'});db[_0x1fb5('0x128')][_0x1fb5('0x119')](db['Team'],{'through':_0x1fb5('0x1c5'),'as':_0x1fb5('0x15b')});module[_0x1fb5('0x1e7')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 2a7d366..67a1ed6 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ceb=['/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/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/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/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','/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/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','/api/auth/local','/api/auth/google','/api/jira','./api/rpc','./api/version','/api/pm2','./api/pm2','/api/webbar','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','username','password','newPassword','firstName','street','mobile','fax','email','clientId','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridnum','exten','vidaooApiKey','privateKey','accesskeyid','key','pass','accountSid','localstationid','secret','oldPassword','isPlainObject','isArray','length','isString','replace','}@@','includes','lodash','path','express','express-winston','util','./config/environment','./config/logger','api','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','x-forwarded-for','connection','url','statusCode','user','name','inspect','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','agent_name','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration'];(function(_0xcc6ce4,_0x2979cf){var _0x29566e=function(_0x4811bd){while(--_0x4811bd){_0xcc6ce4['push'](_0xcc6ce4['shift']());}};_0x29566e(++_0x2979cf);}(_0x6ceb,0x96));var _0xb6ce=function(_0x143979,_0x448c8c){_0x143979=_0x143979-0x0;var _0x39b818=_0x6ceb[_0x143979];return _0x39b818;};'use strict';var _=require(_0xb6ce('0x0'));var path=require(_0xb6ce('0x1'));var express=require(_0xb6ce('0x2'));var ewinston=require(_0xb6ce('0x3'));var util=require(_0xb6ce('0x4'));var errors=require('./errors');var config=require(_0xb6ce('0x5'));var logger=require(_0xb6ce('0x6'))(_0xb6ce('0x7'));var authLogger=require(_0xb6ce('0x6'))('auth');exports[_0xb6ce('0x8')]=function(_0x4e0726){_0x4e0726['use'](ewinston[_0xb6ce('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x421cae,_0x387f1a){var _0x146b52=_0xb6ce('0xa');if(!_[_0xb6ce('0xb')](_0x421cae[_0xb6ce('0xc')])){_0x146b52+='\x20body=%s';var _0x8978bc=_0x421cae[_0xb6ce('0xc')];maskSensitiveData(_0x8978bc);}return util[_0xb6ce('0xd')](_0x146b52,_0x421cae['method'],_0x421cae[_0xb6ce('0xe')][_0xb6ce('0xf')]?_0x421cae[_0xb6ce('0xe')][_0xb6ce('0xf')]:_0x421cae[_0xb6ce('0x10')]['remoteAddress']||_0x421cae['ip'],_0x421cae[_0xb6ce('0x11')],_0x387f1a[_0xb6ce('0x12')],_0x387f1a['responseTime'],_0x421cae[_0xb6ce('0x13')]?_0x421cae[_0xb6ce('0x13')]['id']:null,_0x421cae[_0xb6ce('0x13')]?_0x421cae['user'][_0xb6ce('0x14')]:null,_0x421cae['user']?_0x421cae[_0xb6ce('0x13')]['role']:null,_0x8978bc?util[_0xb6ce('0x15')](_0x8978bc,![],null):'');}}));_0x4e0726[_0xb6ce('0x16')](ewinston[_0xb6ce('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3dc91f,_0x2ab504){var _0x52adb9=_0xb6ce('0x17');if(_0x3dc91f['body']&&_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x18')]&&_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x19')]){_0x52adb9=_0xb6ce('0x1a');}return util[_0xb6ce('0xd')](_0x52adb9,_0x3dc91f['method'],_0x3dc91f[_0xb6ce('0xe')][_0xb6ce('0xf')]?_0x3dc91f['headers'][_0xb6ce('0xf')]:_0x3dc91f[_0xb6ce('0x10')]['remoteAddress']||_0x3dc91f['ip'],_0x3dc91f[_0xb6ce('0x11')],_0x2ab504[_0xb6ce('0x12')],_0x2ab504[_0xb6ce('0x1b')],_0x3dc91f[_0xb6ce('0x13')]?_0x3dc91f['user']['id']:null,_0x3dc91f[_0xb6ce('0x13')]?_0x3dc91f[_0xb6ce('0x13')][_0xb6ce('0x14')]:null,_0x3dc91f[_0xb6ce('0x13')]?_0x3dc91f['user']['role']:null,_0x3dc91f['body']&&_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x18')]?_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x18')]:'other',_0x3dc91f[_0xb6ce('0xc')]&&_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x19')]?_0x3dc91f[_0xb6ce('0xc')]['agent_id']:'',_0x3dc91f[_0xb6ce('0xc')]&&_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x1c')]?_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x1c')]:'');},'ignoreRoute':function(_0x1630cc){var _0x4dd1cc=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4dd1cc['test'](_0x1630cc['url']);}}));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x1d'),require(_0xb6ce('0x1e')));_0x4e0726[_0xb6ce('0x16')]('/api/voice/chanspy',require(_0xb6ce('0x1f')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x20'),require('./api/voiceContext'));_0x4e0726[_0xb6ce('0x16')]('/api/voice/extensions',require(_0xb6ce('0x21')));_0x4e0726['use'](_0xb6ce('0x22'),require(_0xb6ce('0x23')));_0x4e0726[_0xb6ce('0x16')]('/api/voice/queues',require('./api/voiceQueue'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x24'),require(_0xb6ce('0x25')));_0x4e0726[_0xb6ce('0x16')]('/api/screen/recordings',require(_0xb6ce('0x26')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x27'),require('./api/voiceMail'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x28'),require(_0xb6ce('0x29')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x2a'),require(_0xb6ce('0x2b')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x2c'),require(_0xb6ce('0x2d')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x2e'),require(_0xb6ce('0x2f')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x30'),require(_0xb6ce('0x31')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x32'),require('./api/memberReport'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x33'),require('./api/trunk'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x34'),require(_0xb6ce('0x35')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x36'),require('./api/mailServerOut'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x37'),require(_0xb6ce('0x38')));_0x4e0726['use'](_0xb6ce('0x39'),require(_0xb6ce('0x3a')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x3b'),require(_0xb6ce('0x3c')));_0x4e0726['use'](_0xb6ce('0x3d'),require(_0xb6ce('0x3e')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x3f'),require(_0xb6ce('0x40')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x41'),require(_0xb6ce('0x42')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x43'),require('./api/mailQueueReport'));_0x4e0726[_0xb6ce('0x16')]('/api/dashboards',require('./api/dashboard'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x44'),require('./api/dashboardItem'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x45'),require(_0xb6ce('0x46')));_0x4e0726['use'](_0xb6ce('0x47'),require(_0xb6ce('0x48')));_0x4e0726['use']('/api/fax/interactions',require(_0xb6ce('0x49')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x4a'),require('./api/faxMessage'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x4b'),require('./api/faxQueue'));_0x4e0726['use']('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x4e0726[_0xb6ce('0x16')]('/api/sms/accounts',require(_0xb6ce('0x4c')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x4d'),require(_0xb6ce('0x4e')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x4f'),require(_0xb6ce('0x50')));_0x4e0726['use'](_0xb6ce('0x51'),require('./api/smsMessage'));_0x4e0726['use'](_0xb6ce('0x52'),require(_0xb6ce('0x53')));_0x4e0726[_0xb6ce('0x16')]('/api/openchannel/accounts',require(_0xb6ce('0x54')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x55'),require(_0xb6ce('0x56')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x57'),require(_0xb6ce('0x58')));_0x4e0726[_0xb6ce('0x16')]('/api/openchannel/messages',require(_0xb6ce('0x59')));_0x4e0726['use']('/api/openchannel/queues',require(_0xb6ce('0x5a')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x5b'),require(_0xb6ce('0x5c')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x5d'),require(_0xb6ce('0x5e')));_0x4e0726[_0xb6ce('0x16')]('/api/chat/applications',require(_0xb6ce('0x5f')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x60'),require(_0xb6ce('0x61')));_0x4e0726[_0xb6ce('0x16')]('/api/chat/messages',require('./api/chatMessage'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x62'),require('./api/chatOfflineMessage'));_0x4e0726['use']('/api/chat/queues',require(_0xb6ce('0x63')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x64'),require(_0xb6ce('0x65')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x66'),require(_0xb6ce('0x67')));_0x4e0726[_0xb6ce('0x16')]('/api/cm/companies',require(_0xb6ce('0x68')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x69'),require(_0xb6ce('0x6a')));_0x4e0726['use'](_0xb6ce('0x6b'),require(_0xb6ce('0x6c')));_0x4e0726[_0xb6ce('0x16')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x4e0726[_0xb6ce('0x16')]('/api/cm/hopper_final',require(_0xb6ce('0x6d')));_0x4e0726['use'](_0xb6ce('0x6e'),require('./api/cmHopperHistory'));_0x4e0726[_0xb6ce('0x16')]('/api/cm/custom_fields',require(_0xb6ce('0x6f')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x70'),require('./api/action'));_0x4e0726[_0xb6ce('0x16')]('/api/automations',require(_0xb6ce('0x71')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x72'),require(_0xb6ce('0x73')));_0x4e0726['use'](_0xb6ce('0x74'),require(_0xb6ce('0x75')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x76'),require(_0xb6ce('0x77')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x78'),require(_0xb6ce('0x79')));_0x4e0726[_0xb6ce('0x16')]('/api/pauses',require(_0xb6ce('0x7a')));_0x4e0726['use'](_0xb6ce('0x7b'),require('./api/cdr'));_0x4e0726['use'](_0xb6ce('0x7c'),require(_0xb6ce('0x7d')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x7e'),require('./api/schedule'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x7f'),require(_0xb6ce('0x80')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x81'),require(_0xb6ce('0x82')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x83'),require('./api/template'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x84'),require('./api/trigger'));_0x4e0726['use']('/api/variables',require(_0xb6ce('0x85')));_0x4e0726[_0xb6ce('0x16')]('/api/integrations',require(_0xb6ce('0x86')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x87'),require('./api/integrationReport'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x88'),require(_0xb6ce('0x89')));_0x4e0726[_0xb6ce('0x16')]('/api/analytics/default_reports',require(_0xb6ce('0x8a')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x8b'),require(_0xb6ce('0x8c')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x8d'),require('./api/analyticMetric'));_0x4e0726[_0xb6ce('0x16')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x8e'),require(_0xb6ce('0x8f')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x90'),require(_0xb6ce('0x91')));_0x4e0726[_0xb6ce('0x16')]('/api/integrations/salesforce/configurations',require(_0xb6ce('0x92')));_0x4e0726['use']('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x4e0726[_0xb6ce('0x16')]('/api/integrations/sugarcrm/accounts',require(_0xb6ce('0x93')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x94'),require(_0xb6ce('0x95')));_0x4e0726[_0xb6ce('0x16')]('/api/integrations/sugarcrm/fields',require(_0xb6ce('0x96')));_0x4e0726[_0xb6ce('0x16')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x4e0726['use'](_0xb6ce('0x97'),require(_0xb6ce('0x98')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x99'),require(_0xb6ce('0x9a')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x9b'),require(_0xb6ce('0x9c')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x9d'),require(_0xb6ce('0x9e')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x9f'),require(_0xb6ce('0xa0')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xa1'),require(_0xb6ce('0xa2')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xa3'),require(_0xb6ce('0xa4')));_0x4e0726['use']('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xa5'),require('./api/intFreshdeskAccount'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xa6'),require(_0xb6ce('0xa7')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xa8'),require(_0xb6ce('0xa9')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xaa'),require(_0xb6ce('0xab')));_0x4e0726['use'](_0xb6ce('0xac'),require(_0xb6ce('0xad')));_0x4e0726[_0xb6ce('0x16')]('/api/integrations/vtiger/fields',require(_0xb6ce('0xae')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xaf'),require(_0xb6ce('0xb0')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xb1'),require(_0xb6ce('0xb2')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xb3'),require('./api/intServicenowField'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xb4'),require('./api/intDynamics365Account'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xb5'),require(_0xb6ce('0xb6')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xb7'),require(_0xb6ce('0xb8')));_0x4e0726['use'](_0xb6ce('0xb9'),require(_0xb6ce('0xba')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xbb'),require('./api/intFreshsalesConfiguration'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xbc'),require(_0xb6ce('0xbd')));_0x4e0726['use'](_0xb6ce('0xbe'),require('./api/network'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xbf'),require(_0xb6ce('0xc0')));_0x4e0726['use']('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xc1'),require(_0xb6ce('0xc2')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xc3'),require(_0xb6ce('0xc4')));_0x4e0726['use'](_0xb6ce('0xc5'),require(_0xb6ce('0xc6')));_0x4e0726['use'](_0xb6ce('0xc7'),require('./api/smsQueueReport'));_0x4e0726['use'](_0xb6ce('0xc8'),require(_0xb6ce('0xc9')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xca'),require(_0xb6ce('0xcb')));_0x4e0726['use'](_0xb6ce('0xcc'),require(_0xb6ce('0xcd')));_0x4e0726['use'](_0xb6ce('0xce'),require(_0xb6ce('0xcf')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xd0'),require('./api/squareOdbc'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xd1'),require(_0xb6ce('0xd2')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xd3'),require(_0xb6ce('0xd4')));_0x4e0726['use'](_0xb6ce('0xd5'),require(_0xb6ce('0xd6')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xd7'),require(_0xb6ce('0xd8')));_0x4e0726['use']('/api/license',require(_0xb6ce('0xd9')));_0x4e0726[_0xb6ce('0x16')]('/api/campaigns',require(_0xb6ce('0xda')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xdb'),require('./api/migration'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xdc'),require(_0xb6ce('0xdd')));_0x4e0726['use'](_0xb6ce('0xde'),require('./api/plugin'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xdf'),require(_0xb6ce('0xe0')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xe1'),require(_0xb6ce('0xe2')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xe3'),require(_0xb6ce('0xe4')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xe5'),require(_0xb6ce('0xe6')));_0x4e0726[_0xb6ce('0x16')]('/api/sms/reports/transfer',require(_0xb6ce('0xe7')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xe8'),require(_0xb6ce('0xe9')));_0x4e0726[_0xb6ce('0x16')]('/api/voice/prefixes',require(_0xb6ce('0xea')));_0x4e0726['use'](_0xb6ce('0xeb'),require('./api/userProfile'));_0x4e0726[_0xb6ce('0x16')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x4e0726['use'](_0xb6ce('0xec'),require('./api/userProfileResource'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xed'),require(_0xb6ce('0xee')));_0x4e0726['use'](_0xb6ce('0xef'),require(_0xb6ce('0xf0')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xf1'),require('./api/whatsappApplication'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xf2'),require(_0xb6ce('0xf3')));_0x4e0726[_0xb6ce('0x16')]('/api/whatsapp/messages',require(_0xb6ce('0xf4')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xf5'),require(_0xb6ce('0xf6')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xf7'),require(_0xb6ce('0xf8')));_0x4e0726['use'](_0xb6ce('0xf9'),require(_0xb6ce('0xfa')));_0x4e0726[_0xb6ce('0x16')]('/api/cloudProviders',require(_0xb6ce('0xfb')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xfc'),require('./api/realtime'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xfd'),require('./api/authLocal'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xfe'),require('./api/authGoogle'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xff'),require('./api/jira'));_0x4e0726[_0xb6ce('0x16')]('/api/rpc',require(_0xb6ce('0x100')));_0x4e0726['use']('/api/version',require(_0xb6ce('0x101')));_0x4e0726[_0xb6ce('0x16')]('/api/system',require('./api/system'));_0x4e0726['use'](_0xb6ce('0x102'),require(_0xb6ce('0x103')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x104'),require(_0xb6ce('0x105')));_0x4e0726[_0xb6ce('0x16')]('/apidoc',express[_0xb6ce('0x106')](path[_0xb6ce('0x107')](config[_0xb6ce('0x108')],_0xb6ce('0x109'))));_0x4e0726['use'](_0xb6ce('0x10a'),express[_0xb6ce('0x106')](path[_0xb6ce('0x107')](config[_0xb6ce('0x108')],_0xb6ce('0x10a'))));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x10b'),express[_0xb6ce('0x106')](path[_0xb6ce('0x107')](config['root'],_0xb6ce('0x10b'))));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x10c'),express[_0xb6ce('0x106')](path[_0xb6ce('0x107')](config[_0xb6ce('0x108')],_0xb6ce('0x10d'),'3.0.0')));_0x4e0726[_0xb6ce('0x16')]('/plugins',express[_0xb6ce('0x106')](path[_0xb6ce('0x107')](config[_0xb6ce('0x108')],_0xb6ce('0x10e'))));_0x4e0726[_0xb6ce('0x10f')](_0xb6ce('0x110'))[_0xb6ce('0x111')](errors[0x194]);_0x4e0726['route']('/*')[_0xb6ce('0x111')](function(_0x3a1cbb,_0x554c3b){_0x554c3b['sendFile'](path[_0xb6ce('0x112')](_0x4e0726[_0xb6ce('0x111')](_0xb6ce('0x113'))+'/index.html'));});};var sensitiveFields=[_0xb6ce('0x114'),_0xb6ce('0x115'),_0xb6ce('0x116'),'apiKey',_0xb6ce('0x117'),'lastName',_0xb6ce('0x118'),'phone',_0xb6ce('0x119'),_0xb6ce('0x11a'),_0xb6ce('0x11b'),_0xb6ce('0x11c'),'clientSecret',_0xb6ce('0x11d'),_0xb6ce('0x11e'),_0xb6ce('0x11f'),_0xb6ce('0x120'),_0xb6ce('0x121'),_0xb6ce('0x122'),_0xb6ce('0x123'),_0xb6ce('0x124'),_0xb6ce('0x125'),_0xb6ce('0x126'),_0xb6ce('0x127'),_0xb6ce('0x128'),'calleridname',_0xb6ce('0x129'),_0xb6ce('0x12a'),_0xb6ce('0x12b'),'clientEmail',_0xb6ce('0x12c'),_0xb6ce('0x12d'),'secretaccesskey',_0xb6ce('0x12e'),'user',_0xb6ce('0x12f'),_0xb6ce('0x130'),_0xb6ce('0x131'),'dsn',_0xb6ce('0x132'),'registry',_0xb6ce('0x133')];function maskSensitiveData(_0x516100){var _0x471bb0=/(?!^)[\s\S](?!$)/g;if(!_[_0xb6ce('0x134')](_0x516100))return;for(var _0x564703 in _0x516100){if(_[_0xb6ce('0x135')](_0x516100[_0x564703])){for(var _0x288093=0x0;_0x288093<_0x516100[_0x564703][_0xb6ce('0x136')];_0x288093++){maskSensitiveData(_0x516100[_0x564703][_0x288093]);}}else if(_[_0xb6ce('0x134')](_0x516100[_0x564703])){maskSensitiveData(_0x516100[_0x564703]);}else if(_[_0xb6ce('0x137')](_0x516100[_0x564703])){_0x516100[_0x564703]=_0x516100[_0x564703][_0xb6ce('0x138')](/{{{/g,'@@{')[_0xb6ce('0x138')](/}}}/g,_0xb6ce('0x139'))['replace'](/{{/g,'@{')[_0xb6ce('0x138')](/}}/g,'}@');if(_[_0xb6ce('0x13a')](sensitiveFields,_0x564703)){_0x516100[_0x564703]=_0x516100[_0x564703][_0xb6ce('0x138')](_0x471bb0,'*');}}}} \ No newline at end of file +var _0x3efa=['./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','/apidoc','join','/www','static','root','/demo','/snippet','snippet','3.0.0','/plugins','route','get','sendFile','resolve','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','securityToken','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','isString','replace','@@{','}@@','includes','lodash','path','express','util','./errors','api','./config/logger','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','remoteAddress','other','agent_name','test','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailQueue','./api/mailSubstatus','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./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/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','/api/license','./api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment'];(function(_0x4c733b,_0x3294e4){var _0xdc957d=function(_0x23d0c9){while(--_0x23d0c9){_0x4c733b['push'](_0x4c733b['shift']());}};_0xdc957d(++_0x3294e4);}(_0x3efa,0x1a6));var _0xa3ef=function(_0x27a039,_0x3d7ce4){_0x27a039=_0x27a039-0x0;var _0x7a87e6=_0x3efa[_0x27a039];return _0x7a87e6;};'use strict';var _=require(_0xa3ef('0x0'));var path=require(_0xa3ef('0x1'));var express=require(_0xa3ef('0x2'));var ewinston=require('express-winston');var util=require(_0xa3ef('0x3'));var errors=require(_0xa3ef('0x4'));var config=require('./config/environment');var logger=require('./config/logger')(_0xa3ef('0x5'));var authLogger=require(_0xa3ef('0x6'))(_0xa3ef('0x7'));exports[_0xa3ef('0x8')]=function(_0x1c6df4){_0x1c6df4[_0xa3ef('0x9')](ewinston[_0xa3ef('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x408245,_0x285fc0){var _0x50540a=_0xa3ef('0xb');if(!_[_0xa3ef('0xc')](_0x408245[_0xa3ef('0xd')])){_0x50540a+=_0xa3ef('0xe');var _0x487449=_0x408245[_0xa3ef('0xd')];maskSensitiveData(_0x487449);}return util[_0xa3ef('0xf')](_0x50540a,_0x408245[_0xa3ef('0x10')],_0x408245[_0xa3ef('0x11')][_0xa3ef('0x12')]?_0x408245[_0xa3ef('0x11')][_0xa3ef('0x12')]:_0x408245[_0xa3ef('0x13')]['remoteAddress']||_0x408245['ip'],_0x408245[_0xa3ef('0x14')],_0x285fc0[_0xa3ef('0x15')],_0x285fc0[_0xa3ef('0x16')],_0x408245[_0xa3ef('0x17')]?_0x408245[_0xa3ef('0x17')]['id']:null,_0x408245[_0xa3ef('0x17')]?_0x408245[_0xa3ef('0x17')][_0xa3ef('0x18')]:null,_0x408245[_0xa3ef('0x17')]?_0x408245[_0xa3ef('0x17')][_0xa3ef('0x19')]:null,_0x487449?util[_0xa3ef('0x1a')](_0x487449,![],null):'');}}));_0x1c6df4[_0xa3ef('0x9')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1f8042,_0x405396){var _0x4a8914=_0xa3ef('0x1b');if(_0x1f8042['body']&&_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x1c')]&&_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x1d')]){_0x4a8914='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xa3ef('0xf')](_0x4a8914,_0x1f8042[_0xa3ef('0x10')],_0x1f8042[_0xa3ef('0x11')]['x-forwarded-for']?_0x1f8042['headers'][_0xa3ef('0x12')]:_0x1f8042[_0xa3ef('0x13')][_0xa3ef('0x1e')]||_0x1f8042['ip'],_0x1f8042[_0xa3ef('0x14')],_0x405396['statusCode'],_0x405396[_0xa3ef('0x16')],_0x1f8042[_0xa3ef('0x17')]?_0x1f8042[_0xa3ef('0x17')]['id']:null,_0x1f8042['user']?_0x1f8042[_0xa3ef('0x17')]['name']:null,_0x1f8042[_0xa3ef('0x17')]?_0x1f8042['user'][_0xa3ef('0x19')]:null,_0x1f8042[_0xa3ef('0xd')]&&_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x1c')]?_0x1f8042[_0xa3ef('0xd')]['device']:_0xa3ef('0x1f'),_0x1f8042['body']&&_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x1d')]?_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x1d')]:'',_0x1f8042[_0xa3ef('0xd')]&&_0x1f8042['body']['agent_name']?_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x20')]:'');},'ignoreRoute':function(_0x19f024){var _0x7d5b7=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x7d5b7[_0xa3ef('0x21')](_0x19f024['url']);}}));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x22'),require(_0xa3ef('0x23')));_0x1c6df4[_0xa3ef('0x9')]('/api/voice/chanspy',require(_0xa3ef('0x24')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x25'),require(_0xa3ef('0x26')));_0x1c6df4['use']('/api/voice/extensions',require(_0xa3ef('0x27')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x28'),require('./api/voiceMusicOnHold'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x29'),require(_0xa3ef('0x2a')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x2b'),require(_0xa3ef('0x2c')));_0x1c6df4[_0xa3ef('0x9')]('/api/screen/recordings',require('./api/screenRecording'));_0x1c6df4['use'](_0xa3ef('0x2d'),require(_0xa3ef('0x2e')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x2f'),require('./api/voiceMailMessage'));_0x1c6df4['use'](_0xa3ef('0x30'),require(_0xa3ef('0x31')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x32'),require(_0xa3ef('0x33')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x34'),require(_0xa3ef('0x35')));_0x1c6df4[_0xa3ef('0x9')]('/api/voice/queues/reports',require(_0xa3ef('0x36')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x37'),require(_0xa3ef('0x38')));_0x1c6df4[_0xa3ef('0x9')]('/api/trunks',require(_0xa3ef('0x39')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x3a'),require(_0xa3ef('0x3b')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x3c'),require(_0xa3ef('0x3d')));_0x1c6df4[_0xa3ef('0x9')]('/api/mail/accounts',require('./api/mailAccount'));_0x1c6df4[_0xa3ef('0x9')]('/api/mail/queues',require(_0xa3ef('0x3e')));_0x1c6df4[_0xa3ef('0x9')]('/api/mail/substatuses',require(_0xa3ef('0x3f')));_0x1c6df4['use']('/api/mail/interactions',require('./api/mailInteraction'));_0x1c6df4['use']('/api/mail/messages',require(_0xa3ef('0x40')));_0x1c6df4['use'](_0xa3ef('0x41'),require(_0xa3ef('0x42')));_0x1c6df4['use'](_0xa3ef('0x43'),require(_0xa3ef('0x44')));_0x1c6df4[_0xa3ef('0x9')]('/api/dashboards',require(_0xa3ef('0x45')));_0x1c6df4[_0xa3ef('0x9')]('/api/dashboards/items',require(_0xa3ef('0x46')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x47'),require(_0xa3ef('0x48')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x49'),require(_0xa3ef('0x4a')));_0x1c6df4['use'](_0xa3ef('0x4b'),require(_0xa3ef('0x4c')));_0x1c6df4[_0xa3ef('0x9')]('/api/fax/messages',require('./api/faxMessage'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x4d'),require(_0xa3ef('0x4e')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x4f'),require(_0xa3ef('0x50')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x51'),require('./api/smsAccount'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x52'),require(_0xa3ef('0x53')));_0x1c6df4[_0xa3ef('0x9')]('/api/sms/interactions',require('./api/smsInteraction'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x54'),require(_0xa3ef('0x55')));_0x1c6df4[_0xa3ef('0x9')]('/api/sms/queues',require(_0xa3ef('0x56')));_0x1c6df4[_0xa3ef('0x9')]('/api/openchannel/accounts',require(_0xa3ef('0x57')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x58'),require(_0xa3ef('0x59')));_0x1c6df4['use']('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x1c6df4['use'](_0xa3ef('0x5a'),require(_0xa3ef('0x5b')));_0x1c6df4[_0xa3ef('0x9')]('/api/openchannel/queues',require(_0xa3ef('0x5c')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x5d'),require('./api/chatWebsite'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x5e'),require(_0xa3ef('0x5f')));_0x1c6df4[_0xa3ef('0x9')]('/api/chat/applications',require(_0xa3ef('0x60')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x61'),require(_0xa3ef('0x62')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x63'),require(_0xa3ef('0x64')));_0x1c6df4['use'](_0xa3ef('0x65'),require('./api/chatOfflineMessage'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x66'),require(_0xa3ef('0x67')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x68'),require(_0xa3ef('0x69')));_0x1c6df4[_0xa3ef('0x9')]('/api/chat/proactive_actions',require(_0xa3ef('0x6a')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x6b'),require(_0xa3ef('0x6c')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x6d'),require(_0xa3ef('0x6e')));_0x1c6df4['use'](_0xa3ef('0x6f'),require(_0xa3ef('0x70')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x71'),require(_0xa3ef('0x72')));_0x1c6df4[_0xa3ef('0x9')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x73'),require(_0xa3ef('0x74')));_0x1c6df4[_0xa3ef('0x9')]('/api/cm/custom_fields',require(_0xa3ef('0x75')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x76'),require(_0xa3ef('0x77')));_0x1c6df4[_0xa3ef('0x9')]('/api/automations',require(_0xa3ef('0x78')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x79'),require(_0xa3ef('0x7a')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x7b'),require(_0xa3ef('0x7c')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x7d'),require(_0xa3ef('0x7e')));_0x1c6df4[_0xa3ef('0x9')]('/api/intervals',require(_0xa3ef('0x7f')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x80'),require(_0xa3ef('0x81')));_0x1c6df4[_0xa3ef('0x9')]('/api/cdr',require(_0xa3ef('0x82')));_0x1c6df4['use']('/api/voiceQueuesLog',require(_0xa3ef('0x83')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x84'),require(_0xa3ef('0x85')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x86'),require(_0xa3ef('0x87')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x88'),require('./api/tag'));_0x1c6df4['use'](_0xa3ef('0x89'),require('./api/template'));_0x1c6df4[_0xa3ef('0x9')]('/api/triggers',require(_0xa3ef('0x8a')));_0x1c6df4['use'](_0xa3ef('0x8b'),require(_0xa3ef('0x8c')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x8d'),require(_0xa3ef('0x8e')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x8f'),require(_0xa3ef('0x90')));_0x1c6df4['use'](_0xa3ef('0x91'),require(_0xa3ef('0x92')));_0x1c6df4[_0xa3ef('0x9')]('/api/analytics/default_reports',require(_0xa3ef('0x93')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x94'),require(_0xa3ef('0x95')));_0x1c6df4['use']('/api/analytics/metrics',require(_0xa3ef('0x96')));_0x1c6df4['use'](_0xa3ef('0x97'),require(_0xa3ef('0x98')));_0x1c6df4['use'](_0xa3ef('0x99'),require(_0xa3ef('0x9a')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x9b'),require('./api/intSalesforceAccount'));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/salesforce/configurations',require(_0xa3ef('0x9c')));_0x1c6df4['use'](_0xa3ef('0x9d'),require(_0xa3ef('0x9e')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x9f'),require(_0xa3ef('0xa0')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xa1'),require(_0xa3ef('0xa2')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xa3'),require(_0xa3ef('0xa4')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xa5'),require('./api/intDeskAccount'));_0x1c6df4['use'](_0xa3ef('0xa6'),require(_0xa3ef('0xa7')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xa8'),require(_0xa3ef('0xa9')));_0x1c6df4['use'](_0xa3ef('0xaa'),require(_0xa3ef('0xab')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/zoho/configurations',require(_0xa3ef('0xac')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xad'),require('./api/intZohoField'));_0x1c6df4['use'](_0xa3ef('0xae'),require(_0xa3ef('0xaf')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/zendesk/configurations',require(_0xa3ef('0xb0')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/zendesk/fields',require(_0xa3ef('0xb1')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/freshdesk/accounts',require(_0xa3ef('0xb2')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xb3'),require(_0xa3ef('0xb4')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xb5'),require(_0xa3ef('0xb6')));_0x1c6df4['use']('/api/integrations/vtiger/accounts',require(_0xa3ef('0xb7')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xb8'),require(_0xa3ef('0xb9')));_0x1c6df4['use'](_0xa3ef('0xba'),require(_0xa3ef('0xbb')));_0x1c6df4['use'](_0xa3ef('0xbc'),require(_0xa3ef('0xbd')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xbe'),require(_0xa3ef('0xbf')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/servicenow/fields',require(_0xa3ef('0xc0')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xc1'),require(_0xa3ef('0xc2')));_0x1c6df4['use'](_0xa3ef('0xc3'),require(_0xa3ef('0xc4')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xc5'),require(_0xa3ef('0xc6')));_0x1c6df4['use'](_0xa3ef('0xc7'),require(_0xa3ef('0xc8')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xc9'),require(_0xa3ef('0xca')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/freshsales/fields',require(_0xa3ef('0xcb')));_0x1c6df4[_0xa3ef('0x9')]('/api/networks',require('./api/network'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xcc'),require(_0xa3ef('0xcd')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xce'),require(_0xa3ef('0xcf')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd0'),require(_0xa3ef('0xd1')));_0x1c6df4['use']('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd2'),require('./api/jscriptySessionReport'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd3'),require(_0xa3ef('0xd4')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd5'),require(_0xa3ef('0xd6')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd7'),require(_0xa3ef('0xd8')));_0x1c6df4['use']('/api/jscripty/projects',require('./api/jscriptyProject'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd9'),require(_0xa3ef('0xda')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xdb'),require(_0xa3ef('0xdc')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xdd'),require('./api/squareProject'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xde'),require(_0xa3ef('0xdf')));_0x1c6df4['use']('/api/square/messages',require(_0xa3ef('0xe0')));_0x1c6df4['use'](_0xa3ef('0xe1'),require('./api/team'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xe2'),require(_0xa3ef('0xe3')));_0x1c6df4[_0xa3ef('0x9')]('/api/campaigns',require(_0xa3ef('0xe4')));_0x1c6df4[_0xa3ef('0x9')]('/api/migrations',require(_0xa3ef('0xe5')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xe6'),require(_0xa3ef('0xe7')));_0x1c6df4[_0xa3ef('0x9')]('/api/plugins',require(_0xa3ef('0xe8')));_0x1c6df4['use'](_0xa3ef('0xe9'),require('./api/mailTransferReport'));_0x1c6df4['use'](_0xa3ef('0xea'),require('./api/chatTransferReport'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xeb'),require('./api/faxTransferReport'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xec'),require(_0xa3ef('0xed')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xee'),require(_0xa3ef('0xef')));_0x1c6df4['use'](_0xa3ef('0xf0'),require(_0xa3ef('0xf1')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xf2'),require('./api/voicePrefix'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xf3'),require(_0xa3ef('0xf4')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xf5'),require('./api/userProfileSection'));_0x1c6df4[_0xa3ef('0x9')]('/api/userProfile/resources',require(_0xa3ef('0xf6')));_0x1c6df4['use'](_0xa3ef('0xf7'),require(_0xa3ef('0xf8')));_0x1c6df4[_0xa3ef('0x9')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xf9'),require(_0xa3ef('0xfa')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xfb'),require('./api/whatsappInteraction'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xfc'),require('./api/whatsappMessage'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xfd'),require(_0xa3ef('0xfe')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xff'),require(_0xa3ef('0x100')));_0x1c6df4['use'](_0xa3ef('0x101'),require(_0xa3ef('0x102')));_0x1c6df4['use'](_0xa3ef('0x103'),require(_0xa3ef('0x104')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x105'),require('./api/realtime'));_0x1c6df4['use'](_0xa3ef('0x106'),require(_0xa3ef('0x107')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x108'),require(_0xa3ef('0x109')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x10a'),require('./api/jira'));_0x1c6df4[_0xa3ef('0x9')]('/api/rpc',require(_0xa3ef('0x10b')));_0x1c6df4['use']('/api/version',require(_0xa3ef('0x10c')));_0x1c6df4['use'](_0xa3ef('0x10d'),require(_0xa3ef('0x10e')));_0x1c6df4['use'](_0xa3ef('0x10f'),require('./api/pm2'));_0x1c6df4[_0xa3ef('0x9')]('/api/webbar',require('./api/webbar'));_0x1c6df4['use'](_0xa3ef('0x110'),express['static'](path[_0xa3ef('0x111')](config['root'],'/apidoc')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x112'),express[_0xa3ef('0x113')](path[_0xa3ef('0x111')](config[_0xa3ef('0x114')],_0xa3ef('0x112'))));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x115'),express[_0xa3ef('0x113')](path['join'](config[_0xa3ef('0x114')],_0xa3ef('0x115'))));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x116'),express[_0xa3ef('0x113')](path[_0xa3ef('0x111')](config[_0xa3ef('0x114')],_0xa3ef('0x117'),_0xa3ef('0x118'))));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x119'),express['static'](path[_0xa3ef('0x111')](config['root'],'/server/files/plugins')));_0x1c6df4[_0xa3ef('0x11a')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xa3ef('0x11b')](errors[0x194]);_0x1c6df4[_0xa3ef('0x11a')]('/*')[_0xa3ef('0x11b')](function(_0x25c259,_0x3a517f){_0x3a517f[_0xa3ef('0x11c')](path[_0xa3ef('0x11d')](_0x1c6df4[_0xa3ef('0x11b')]('appPath')+_0xa3ef('0x11e')));});};var sensitiveFields=[_0xa3ef('0x11f'),_0xa3ef('0x120'),_0xa3ef('0x121'),_0xa3ef('0x122'),_0xa3ef('0x123'),_0xa3ef('0x124'),_0xa3ef('0x125'),_0xa3ef('0x126'),_0xa3ef('0x127'),_0xa3ef('0x128'),_0xa3ef('0x129'),'clientId',_0xa3ef('0x12a'),_0xa3ef('0x12b'),'code',_0xa3ef('0x12c'),_0xa3ef('0x12d'),'token',_0xa3ef('0x12e'),'accessToken',_0xa3ef('0x12f'),_0xa3ef('0x130'),_0xa3ef('0x131'),_0xa3ef('0x132'),'membername',_0xa3ef('0x133'),'calleridnum',_0xa3ef('0x134'),_0xa3ef('0x135'),_0xa3ef('0x136'),'privateKey',_0xa3ef('0x137'),_0xa3ef('0x138'),_0xa3ef('0x139'),_0xa3ef('0x17'),_0xa3ef('0x13a'),_0xa3ef('0x13b'),_0xa3ef('0x13c'),_0xa3ef('0x13d'),_0xa3ef('0x13e'),_0xa3ef('0x13f'),'oldPassword'];function maskSensitiveData(_0x279a48){var _0x454f79=/(?!^)[\s\S](?!$)/g;if(!_[_0xa3ef('0x140')](_0x279a48))return;for(var _0x3f8aca in _0x279a48){if(_[_0xa3ef('0x141')](_0x279a48[_0x3f8aca])){for(var _0x57cc2e=0x0;_0x57cc2e<_0x279a48[_0x3f8aca]['length'];_0x57cc2e++){maskSensitiveData(_0x279a48[_0x3f8aca][_0x57cc2e]);}}else if(_['isPlainObject'](_0x279a48[_0x3f8aca])){maskSensitiveData(_0x279a48[_0x3f8aca]);}else if(_[_0xa3ef('0x142')](_0x279a48[_0x3f8aca])){_0x279a48[_0x3f8aca]=_0x279a48[_0x3f8aca][_0xa3ef('0x143')](/{{{/g,_0xa3ef('0x144'))[_0xa3ef('0x143')](/}}}/g,_0xa3ef('0x145'))[_0xa3ef('0x143')](/{{/g,'@{')[_0xa3ef('0x143')](/}}/g,'}@');if(_[_0xa3ef('0x146')](sensitiveFields,_0x3f8aca)){_0x279a48[_0x3f8aca]=_0x279a48[_0x3f8aca]['replace'](_0x454f79,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 8d342aa..cd90999 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef1b=['../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0xef1b,0xae));var _0xbef1=function(_0x1f909d,_0x15f987){_0x1f909d=_0x1f909d-0x0;var _0x163242=_0xef1b[_0x1f909d];return _0x163242;};'use strict';var jayson=require(_0xbef1('0x0'));var BPromise=require(_0xbef1('0x1'));var _=require(_0xbef1('0x2'));var config=require('../config/environment');exports[_0xbef1('0x3')]=function(){return new BPromise(function(_0x358218,_0x3583ee){var _0x131017={};_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x5')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x6')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x7')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x8')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x9')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/memberReport/memberReport.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xa')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xb')));_0x131017=_['merge'](_0x131017,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xc')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xd')));_0x131017=_['merge'](_0x131017,require('../api/mailQueue/mailQueue.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xe')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xf')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x10')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x11')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x12')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x13')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x14')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x15')));_0x131017=_['merge'](_0x131017,require('../api/faxQueue/faxQueue.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x16')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x17')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x18')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x19')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x1a')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x1b')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x1c')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x1d')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x1e')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/chatQueue/chatQueue.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x1f')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x20')));_0x131017=_['merge'](_0x131017,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x21')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x22')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x23')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/interval/interval.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/pause/pause.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x24')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x25')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x26')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x27')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x28')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x29')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x2a')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x2b')));_0x131017=_['merge'](_0x131017,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x2c')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x2d')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x2e')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x2f')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x30')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x31')));_0x131017=_['merge'](_0x131017,require('../api/squareReport/squareReport.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x32')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x33')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x34')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x35')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/squareRecording/squareRecording.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x36')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x37')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x38')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x39')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x3a')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x3b')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x3c')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x3d')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x3e')));var _0x2536d2=jayson[_0xbef1('0x3f')](_0x131017)['http']();var _0x2f9791=config[_0xbef1('0x40')][_0xbef1('0x41')]||config[_0xbef1('0x41')]+0x1;var _0x34194e=config['rpc']['ip']||_0xbef1('0x42');_0x2536d2['on']('error',function(_0xf194be){return _0x3583ee(_0xf194be);});_0x2536d2[_0xbef1('0x3')](_0x2f9791,_0x34194e,function(){console[_0xbef1('0x43')](_0xbef1('0x44'),_0x34194e,_0x2f9791);require(_0xbef1('0x45'))['default']();return _0x358218(_0xbef1('0x46')+_0x34194e+':'+_0x2f9791);});});}; \ No newline at end of file +var _0x6e81=['../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.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/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc'];(function(_0x5d6fcd,_0x2c17c3){var _0x537687=function(_0x1cd585){while(--_0x1cd585){_0x5d6fcd['push'](_0x5d6fcd['shift']());}};_0x537687(++_0x2c17c3);}(_0x6e81,0x18d));var _0x16e8=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6e81[_0x4b369d];return _0x571a98;};'use strict';var jayson=require(_0x16e8('0x0'));var BPromise=require(_0x16e8('0x1'));var _=require('lodash');var config=require(_0x16e8('0x2'));exports[_0x16e8('0x3')]=function(){return new BPromise(function(_0x588e5e,_0x3257fd){var _0x190bc8={};_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x5')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x6')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x7')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x8')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x9')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0xa')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0xb')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0xc')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0xd')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0xe')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0xf')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x10')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x11')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x12')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x13')));_0x190bc8=_['merge'](_0x190bc8,require('../api/mailMessage/mailMessage.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/mailApplication/mailApplication.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x14')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x15')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x16')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/faxInteraction/faxInteraction.rpc'));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x17')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x18')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x19')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x1a')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/smsInteraction/smsInteraction.rpc'));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x1b')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x1c')));_0x190bc8=_['merge'](_0x190bc8,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x1d')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x1e')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x1f')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/chatMessage/chatMessage.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/chatQueue/chatQueue.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x20')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x21')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x22')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x23')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x24')));_0x190bc8=_['merge'](_0x190bc8,require('../api/interval/interval.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x25')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x26')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/template/template.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x27')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x28')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x29')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x2a')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x2b')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x2c')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x2d')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x2e')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x2f')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x30')));_0x190bc8=_['merge'](_0x190bc8,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x31')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x32')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x33')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x34')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x35')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/squareProject/squareProject.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x36')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x37')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x38')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/attachment/attachment.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x39')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x3a')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x3b')));_0x190bc8=_['merge'](_0x190bc8,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x209143=jayson[_0x16e8('0x3c')](_0x190bc8)[_0x16e8('0x3d')]();var _0x26b9c7=config[_0x16e8('0x3e')][_0x16e8('0x3f')]||config[_0x16e8('0x3f')]+0x1;var _0x2cb6f6=config[_0x16e8('0x3e')]['ip']||'localhost';_0x209143['on'](_0x16e8('0x40'),function(_0x8bc877){return _0x3257fd(_0x8bc877);});_0x209143['listen'](_0x26b9c7,_0x2cb6f6,function(){console[_0x16e8('0x41')](_0x16e8('0x42'),_0x2cb6f6,_0x26b9c7);require(_0x16e8('0x43'))['default']();return _0x588e5e(_0x16e8('0x44')+_0x2cb6f6+':'+_0x26b9c7);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 7532e85..047f57f 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 _0x917f=['beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','match','error','code','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','close','prototype','sendRequest','sync','answer','ANSWER','getData'];(function(_0x234e1a,_0x500d79){var _0x55aad2=function(_0x272396){while(--_0x272396){_0x234e1a['push'](_0x234e1a['shift']());}};_0x55aad2(++_0x500d79);}(_0x917f,0x110));var _0xf917=function(_0x1c7f45,_0x3a7036){_0x1c7f45=_0x1c7f45-0x0;var _0x4f1931=_0x917f[_0x1c7f45];return _0x4f1931;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0xf917('0x0'))[_0xf917('0x1')];var AGIReply=require(_0xf917('0x2'));var AGIError=require('./error');function AGIChannel(_0x2c7c46){var _0x25df66=this,_0x5070ff=new AGIReply(),_0x1ef89d=![],_0x29300b={};EventEmitter[_0xf917('0x3')](_0x25df66);_0x2c7c46[_0xf917('0x4')](_0xf917('0x5'));_0x2c7c46[_0xf917('0x6')](0x8*0x3c*0x3c*0x3e8);_0x5070ff[_0xf917('0x4')](_0xf917('0x5'));_0x5070ff['on'](_0xf917('0x7'),function(_0x39cd61){for(var _0x4f307d in _0x39cd61){_0x25df66[_0x4f307d]=_0x39cd61[_0x4f307d];}_0x25df66[_0xf917('0x8')](_0xf917('0x9'));});_0x5070ff['on'](_0xf917('0xa'),function(_0x191e3d){if(_0x191e3d[_0xf917('0xb')]()==_0xf917('0xc')){_0x25df66['emit'](_0xf917('0xc'));return;}if(_0x191e3d[_0xf917('0xd')](0x0,0xb)=='520-Invalid'){_0x1ef89d=!![];}if(_0x1ef89d){_0x29300b['rx']+=_0x191e3d+'\x0a';if(_0x191e3d[_0xf917('0xe')](_0xf917('0xf'))!=-0x1){_0x1ef89d=![];}}else{_0x29300b['rx']=_0x191e3d;}if(_0x1ef89d){return;}if(typeof _0x29300b['cb']==_0xf917('0x10')){var _0x13b74b=_0x29300b['rx'][_0xf917('0xd')](0x0,0x3),_0x3b7d5c=null,_0x6f1ca1=null;_0x13b74b=parseInt(_0x13b74b);if(isNaN(_0x13b74b)){_0x29300b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf917('0x11')});return;}if(_0x13b74b!=0xc8){_0x29300b['cb'](null,{'code':_0x13b74b,'result':-0x1,'extra':'KO'});return;}_0x3b7d5c=_0x29300b['rx'][_0xf917('0xd')](0x4)[_0xf917('0x12')](_0xf917('0x13'),'');if(_0x3b7d5c[_0xf917('0x14')]('\x20')!=-0x1){_0x3b7d5c=_0x3b7d5c[_0xf917('0x15')](0x0,_0x3b7d5c[_0xf917('0x14')]('\x20'));}if(_[_0xf917('0x16')](_0x3b7d5c,'-1')){_0x3b7d5c=parseInt(_0x3b7d5c);}_0x6f1ca1=_0x29300b['rx'][_0xf917('0x17')]('\x20');if(_0x6f1ca1['length']==0x3){_0x6f1ca1=_0x6f1ca1[0x2][_0xf917('0xd')](0x1,_0x6f1ca1[0x2]['length']-0x1);}else if(_0x6f1ca1['length']>0x3){var _0x2fd619=/\((.+)\)/;var _0x158aae=_0x29300b['rx'][_0xf917('0x18')](_0x2fd619);if(_0x158aae){_0x6f1ca1=_0x158aae[0x1];}else{_0x6f1ca1=null;}}else{_0x6f1ca1=null;}_0x29300b['cb'](null,{'code':_0x13b74b,'result':_0x3b7d5c,'extra':_0x6f1ca1});}});_0x2c7c46['on'](_0xf917('0x19'),function(_0x543f7f){_0x25df66[_0xf917('0x8')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x543f7f[_0xf917('0x1a')]));});_0x2c7c46['on']('close',function(){_0x25df66[_0xf917('0x8')]('close',new AGIError(_0xf917('0x1b')));});_0x2c7c46['on'](_0xf917('0x1c'),function(){_0x25df66[_0xf917('0x8')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2c7c46[_0xf917('0x1d')]();});_0x2c7c46[_0xf917('0x1e')](_0x5070ff);this[_0xf917('0x1f')]=function(_0xa48f6c,_0x3b44f0){var _0xa48f6c=_0xa48f6c||'',_0x3b44f0=typeof _0x3b44f0==_0xf917('0x10')?_0x3b44f0:new Function();_0x29300b={'tx':_0xa48f6c,'rx':'','cb':_0x3b44f0};_0x2c7c46[_0xf917('0x20')](_0xa48f6c+'\x0a');},this[_0xf917('0x21')]=function(){_0x2c7c46[_0xf917('0x1d')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xf917('0x22')][_0xf917('0x23')]=function(_0x19d572){return this[_0xf917('0x1f')][_0xf917('0x24')](this,_0x19d572);};AGIChannel['prototype'][_0xf917('0x25')]=function(){return this[_0xf917('0x23')](_0xf917('0x26'));};AGIChannel[_0xf917('0x22')][_0xf917('0x27')]=function(_0x3bf471,_0x4cc68b,_0xf78314){_0x3bf471=_0x3bf471===undefined?_0xf917('0x28'):_0x3bf471;_0x4cc68b=_0x4cc68b===undefined?'5':_0x4cc68b;_0xf78314=_0xf78314===undefined?'1':_0xf78314;return this['sendRequest'](util[_0xf917('0x29')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x3bf471,_0x4cc68b*0x3e8,_0xf78314));};AGIChannel['prototype']['noop']=function(_0x3353c4){_0x3353c4=_0x3353c4||_0xf917('0x2a');return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x2b'),_0x3353c4));};AGIChannel['prototype'][_0xf917('0x2c')]=function(_0x28b4fa,_0x38e4e5){if(_[_0xf917('0x2d')](_0x38e4e5)){return this[_0xf917('0x23')](util[_0xf917('0x29')]('EXEC\x20%s\x20%s',_0x28b4fa,_0x38e4e5[_0xf917('0x2e')](',')));}return this['sendRequest'](util[_0xf917('0x29')](_0xf917('0x2f'),_0x28b4fa,_0x38e4e5));};AGIChannel['prototype'][_0xf917('0x30')]=function(_0x4fe92f){return this[_0xf917('0x23')](util['format']('SET\x20CONTEXT\x20%s',_0x4fe92f));};AGIChannel['prototype'][_0xf917('0x31')]=function(_0x522f1c){return this['sendRequest'](util['format'](_0xf917('0x32'),_0x522f1c));};AGIChannel[_0xf917('0x22')][_0xf917('0x33')]=function(_0x317232){return this[_0xf917('0x23')](util[_0xf917('0x29')]('SET\x20PRIORITY\x20%s',_0x317232));};AGIChannel['prototype'][_0xf917('0xc')]=function(){return this[_0xf917('0x23')]('HANGUP');};AGIChannel[_0xf917('0x22')][_0xf917('0x34')]=function(_0xbd36e1,_0x22b90e){var _0x208b8e=_[_0xf917('0x35')](_0x22b90e)||_[_0xf917('0x36')](_0x22b90e)?_0x22b90e['toString']():_0x22b90e;return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x37'),_0xbd36e1,_0x208b8e?_0x208b8e['toString']()[_0xf917('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xf917('0x22')][_0xf917('0x38')]=function(_0xb0f39f,_0x1a90f2){return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x39'),_0xb0f39f,_0x1a90f2));};AGIChannel[_0xf917('0x22')][_0xf917('0x3a')]=function(_0xe81a2a,_0x233f6c){return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x3b'),_0xe81a2a,_0x233f6c));};AGIChannel[_0xf917('0x22')][_0xf917('0x3c')]=function(_0x3ac58e,_0x1575f2){return this[_0xf917('0x23')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x3ac58e,_0x1575f2));};AGIChannel[_0xf917('0x22')][_0xf917('0x3d')]=function(_0x2936fa,_0x1ba0a8,_0x1cc1e8){_0x1ba0a8=_0x1ba0a8||this[_0xf917('0x3e')];_0x1cc1e8=_0x1cc1e8||0x1;this[_0xf917('0x30')](_0x2936fa);this[_0xf917('0x31')](_0x1ba0a8);this[_0xf917('0x33')](_0x1cc1e8);return this['noop'](util[_0xf917('0x29')](_0xf917('0x3f'),_0x2936fa,_0x1ba0a8,_0x1cc1e8));};AGIChannel[_0xf917('0x22')][_0xf917('0x40')]=function(_0x2c162){return this['sendRequest'](util[_0xf917('0x29')](_0xf917('0x41'),_0x2c162));};AGIChannel[_0xf917('0x22')][_0xf917('0x42')]=function(_0x496098,_0x3f7733,_0x3f33ab,_0x3e570a,_0x31f6ee,_0x4640ec){_0x3f7733=_0x3f7733||_0xf917('0x43');_0x3f33ab=_0x3f33ab||'';_0x3e570a=_0x3e570a===undefined?-0x1:_0x3e570a==='-1'?-0x1:_0x3e570a*0x3e8;_0x31f6ee=_0x31f6ee===undefined?'':'s='+_0x31f6ee;_0x4640ec=_0x4640ec?_0xf917('0x44'):'';return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x45'),_0x496098,_0x3f7733,_0x3f33ab,_0x3e570a,_0x4640ec,_0x31f6ee));};AGIChannel[_0xf917('0x22')][_0xf917('0x46')]=function(_0x15c131,_0x6dfbb2){_0x6dfbb2=_0x6dfbb2||'';return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x47'),_0x15c131,_0x6dfbb2));};AGIChannel[_0xf917('0x22')][_0xf917('0x48')]=function(_0xcb4ccc){return this[_0xf917('0x2c')]('AGI',_0xcb4ccc);};AGIChannel[_0xf917('0x22')][_0xf917('0x49')]=function(_0x12b60c){return this['exec']('WAIT',_0x12b60c);};AGIChannel[_0xf917('0x22')][_0xf917('0x19')]=function(_0x5f2551,_0xca5b8d){this[_0xf917('0x4a')](util[_0xf917('0x29')](_0xf917('0x4b'),_0x5f2551['id'],_0x5f2551[_0xf917('0x4c')],_0xca5b8d));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf917('0x4d')]=AGIChannel; \ No newline at end of file +var _0x5302=['BEEP','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','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','sendRequest','command','sync','prototype','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','HANGUP','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','setPriority','GET\x20VARIABLE\x20\x22%s\x22','wav'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x5302,0x1b5));var _0x2530=function(_0x3ac42c,_0x128452){_0x3ac42c=_0x3ac42c-0x0;var _0x53170b=_0x5302[_0x3ac42c];return _0x53170b;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x2530('0x0'))[_0x2530('0x1')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x1b3a90){var _0x5d56c2=this,_0x1561a1=new AGIReply(),_0x4ae9db=![],_0x371cf1={};EventEmitter[_0x2530('0x2')](_0x5d56c2);_0x1b3a90[_0x2530('0x3')](_0x2530('0x4'));_0x1b3a90[_0x2530('0x5')](0x8*0x3c*0x3c*0x3e8);_0x1561a1['setEncoding'](_0x2530('0x4'));_0x1561a1['on'](_0x2530('0x6'),function(_0x22fb53){for(var _0x1070de in _0x22fb53){_0x5d56c2[_0x1070de]=_0x22fb53[_0x1070de];}_0x5d56c2[_0x2530('0x7')](_0x2530('0x8'));});_0x1561a1['on'](_0x2530('0x9'),function(_0x29ad3a){if(_0x29ad3a[_0x2530('0xa')]()==_0x2530('0xb')){_0x5d56c2[_0x2530('0x7')](_0x2530('0xb'));return;}if(_0x29ad3a[_0x2530('0xc')](0x0,0xb)==_0x2530('0xd')){_0x4ae9db=!![];}if(_0x4ae9db){_0x371cf1['rx']+=_0x29ad3a+'\x0a';if(_0x29ad3a[_0x2530('0xe')](_0x2530('0xf'))!=-0x1){_0x4ae9db=![];}}else{_0x371cf1['rx']=_0x29ad3a;}if(_0x4ae9db){return;}if(typeof _0x371cf1['cb']==_0x2530('0x10')){var _0x4d69e3=_0x371cf1['rx'][_0x2530('0xc')](0x0,0x3),_0x22821d=null,_0x296401=null;_0x4d69e3=parseInt(_0x4d69e3);if(isNaN(_0x4d69e3)){_0x371cf1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2530('0x11')});return;}if(_0x4d69e3!=0xc8){_0x371cf1['cb'](null,{'code':_0x4d69e3,'result':-0x1,'extra':'KO'});return;}_0x22821d=_0x371cf1['rx'][_0x2530('0xc')](0x4)[_0x2530('0x12')](_0x2530('0x13'),'');if(_0x22821d['indexOf']('\x20')!=-0x1){_0x22821d=_0x22821d['substr'](0x0,_0x22821d['indexOf']('\x20'));}if(_['startsWith'](_0x22821d,'-1')){_0x22821d=parseInt(_0x22821d);}_0x296401=_0x371cf1['rx'][_0x2530('0x14')]('\x20');if(_0x296401[_0x2530('0x15')]==0x3){_0x296401=_0x296401[0x2]['substring'](0x1,_0x296401[0x2][_0x2530('0x15')]-0x1);}else if(_0x296401[_0x2530('0x15')]>0x3){var _0x157d70=/\((.+)\)/;var _0x21676b=_0x371cf1['rx'][_0x2530('0x16')](_0x157d70);if(_0x21676b){_0x296401=_0x21676b[0x1];}else{_0x296401=null;}}else{_0x296401=null;}_0x371cf1['cb'](null,{'code':_0x4d69e3,'result':_0x22821d,'extra':_0x296401});}});_0x1b3a90['on'](_0x2530('0x17'),function(_0x3aac94){_0x5d56c2[_0x2530('0x7')](_0x2530('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x3aac94[_0x2530('0x18')]));});_0x1b3a90['on'](_0x2530('0x19'),function(){_0x5d56c2[_0x2530('0x7')](_0x2530('0x19'),new AGIError(_0x2530('0x1a')));});_0x1b3a90['on'](_0x2530('0x1b'),function(){_0x5d56c2[_0x2530('0x7')](_0x2530('0x1b'),new AGIError(_0x2530('0x1c')));_0x1b3a90[_0x2530('0x1d')]();});_0x1b3a90[_0x2530('0x1e')](_0x1561a1);this['command']=function(_0x1c2c2c,_0x301018){var _0x1c2c2c=_0x1c2c2c||'',_0x301018=typeof _0x301018==_0x2530('0x10')?_0x301018:new Function();_0x371cf1={'tx':_0x1c2c2c,'rx':'','cb':_0x301018};_0x1b3a90[_0x2530('0x1f')](_0x1c2c2c+'\x0a');},this[_0x2530('0x19')]=function(){_0x1b3a90[_0x2530('0x1d')]();};}util[_0x2530('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x2530('0x21')]=function(_0x302d4d){return this[_0x2530('0x22')][_0x2530('0x23')](this,_0x302d4d);};AGIChannel[_0x2530('0x24')]['answer']=function(){return this[_0x2530('0x21')]('ANSWER');};AGIChannel[_0x2530('0x24')][_0x2530('0x25')]=function(_0x3c0a0c,_0x5261a3,_0x146e97){_0x3c0a0c=_0x3c0a0c===undefined?'beep':_0x3c0a0c;_0x5261a3=_0x5261a3===undefined?'5':_0x5261a3;_0x146e97=_0x146e97===undefined?'1':_0x146e97;return this['sendRequest'](util[_0x2530('0x26')](_0x2530('0x27'),_0x3c0a0c,_0x5261a3*0x3e8,_0x146e97));};AGIChannel[_0x2530('0x24')]['noop']=function(_0x27e7e2){_0x27e7e2=_0x27e7e2||'NO\x20MESSAGE';return this['sendRequest'](util[_0x2530('0x26')](_0x2530('0x28'),_0x27e7e2));};AGIChannel[_0x2530('0x24')]['exec']=function(_0x4ed6c2,_0x16248d){if(_[_0x2530('0x29')](_0x16248d)){return this[_0x2530('0x21')](util['format']('EXEC\x20%s\x20%s',_0x4ed6c2,_0x16248d[_0x2530('0x2a')](',')));}return this[_0x2530('0x21')](util[_0x2530('0x26')](_0x2530('0x2b'),_0x4ed6c2,_0x16248d));};AGIChannel['prototype'][_0x2530('0x2c')]=function(_0x4f84e4){return this[_0x2530('0x21')](util[_0x2530('0x26')](_0x2530('0x2d'),_0x4f84e4));};AGIChannel[_0x2530('0x24')][_0x2530('0x2e')]=function(_0x3471de){return this[_0x2530('0x21')](util[_0x2530('0x26')](_0x2530('0x2f'),_0x3471de));};AGIChannel['prototype']['setPriority']=function(_0x5d375a){return this['sendRequest'](util[_0x2530('0x26')]('SET\x20PRIORITY\x20%s',_0x5d375a));};AGIChannel['prototype'][_0x2530('0xb')]=function(){return this[_0x2530('0x21')](_0x2530('0x30'));};AGIChannel[_0x2530('0x24')]['setVariable']=function(_0x2219dd,_0x45c183){var _0x57d493=_[_0x2530('0x31')](_0x45c183)||_['isNumber'](_0x45c183)?_0x45c183[_0x2530('0x32')]():_0x45c183;return this[_0x2530('0x21')](util['format'](_0x2530('0x33'),_0x2219dd,_0x57d493?_0x57d493[_0x2530('0x32')]()[_0x2530('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x2530('0x24')][_0x2530('0x34')]=function(_0x5a3291,_0x4e2e51){return this['sendRequest'](util[_0x2530('0x26')](_0x2530('0x35'),_0x5a3291,_0x4e2e51));};AGIChannel[_0x2530('0x24')][_0x2530('0x36')]=function(_0x2be799,_0x5058c8){return this['sendRequest'](util[_0x2530('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x2be799,_0x5058c8));};AGIChannel[_0x2530('0x24')][_0x2530('0x37')]=function(_0x13b82c,_0x2bb18e){return this[_0x2530('0x21')](util[_0x2530('0x26')](_0x2530('0x38'),_0x13b82c,_0x2bb18e));};AGIChannel[_0x2530('0x24')]['continueAt']=function(_0x5387d0,_0x39fdc5,_0x2b1c9b){_0x39fdc5=_0x39fdc5||this['extension'];_0x2b1c9b=_0x2b1c9b||0x1;this[_0x2530('0x2c')](_0x5387d0);this[_0x2530('0x2e')](_0x39fdc5);this[_0x2530('0x39')](_0x2b1c9b);return this['noop'](util['format']('GOTO\x20%s\x20%s\x20%s',_0x5387d0,_0x39fdc5,_0x2b1c9b));};AGIChannel[_0x2530('0x24')]['getVariable']=function(_0x15ae7e){return this['sendRequest'](util[_0x2530('0x26')](_0x2530('0x3a'),_0x15ae7e));};AGIChannel['prototype']['recordFile']=function(_0x544b89,_0x57f2cd,_0x544b8b,_0x5f08af,_0x317dee,_0x47aed3){_0x57f2cd=_0x57f2cd||_0x2530('0x3b');_0x544b8b=_0x544b8b||'';_0x5f08af=_0x5f08af===undefined?-0x1:_0x5f08af==='-1'?-0x1:_0x5f08af*0x3e8;_0x317dee=_0x317dee===undefined?'':'s='+_0x317dee;_0x47aed3=_0x47aed3?_0x2530('0x3c'):'';return this['sendRequest'](util[_0x2530('0x26')](_0x2530('0x3d'),_0x544b89,_0x57f2cd,_0x544b8b,_0x5f08af,_0x47aed3,_0x317dee));};AGIChannel[_0x2530('0x24')]['streamFile']=function(_0x3f7e30,_0x72e471){_0x72e471=_0x72e471||'';return this['sendRequest'](util['format'](_0x2530('0x3e'),_0x3f7e30,_0x72e471));};AGIChannel[_0x2530('0x24')][_0x2530('0x3f')]=function(_0x16ef9b){return this[_0x2530('0x40')](_0x2530('0x41'),_0x16ef9b);};AGIChannel['prototype'][_0x2530('0x42')]=function(_0x456d6c){return this[_0x2530('0x40')](_0x2530('0x43'),_0x456d6c);};AGIChannel['prototype']['error']=function(_0xd28d0d,_0x263aa6){this['noop'](util[_0x2530('0x26')](_0x2530('0x44'),_0xd28d0d['id'],_0xd28d0d[_0x2530('0x45')],_0x263aa6));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2530('0x46')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index f4510b3..7157ef2 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 _0x9d78=['message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply'];(function(_0x186335,_0x389e69){var _0x335d80=function(_0xd9e18f){while(--_0xd9e18f){_0x186335['push'](_0x186335['shift']());}};_0x335d80(++_0x389e69);}(_0x9d78,0x135));var _0x89d7=function(_0x3396cd,_0x4047f0){_0x3396cd=_0x3396cd-0x0;var _0x2d6b4a=_0x9d78[_0x3396cd];return _0x2d6b4a;};'use strict';var util=require(_0x89d7('0x0'));var error={'E_AGI_UNDEFINED':_0x89d7('0x1'),'E_AGI_ARGUMENT_PORT':_0x89d7('0x2'),'E_AGI_SERVER_ERROR':_0x89d7('0x3'),'E_AGI_SERVER_CLOSE':_0x89d7('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x89d7('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x89d7('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x89d7('0x7'),'E_AGI_COMMAND_EMPTY':_0x89d7('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x89d7('0x9'),'E_AGI_IVR_ENTRY':_0x89d7('0xa')};function AGIError(_0x23ce12){var _0x23ce12=_0x23ce12||null,_0x43fa22=_0x43fa22||[],_0x51998d=0x1,_0x253484='';if(!error[_0x23ce12]){_0x23ce12=_0x89d7('0xb');}_0x43fa22[_0x89d7('0xc')](error[_0x23ce12]);while(arguments[_0x51998d]){_0x43fa22['push'](arguments[_0x51998d]);_0x51998d++;}_0x253484=util['format'][_0x89d7('0xd')](util,_0x43fa22);this[_0x89d7('0xe')]=_0x253484;this[_0x89d7('0xf')]=_0x23ce12;}module[_0x89d7('0x10')]=AGIError; \ No newline at end of file +var _0x1c63=['format','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x15fefe,_0x2d6859){var _0x50e35c=function(_0x4327fa){while(--_0x4327fa){_0x15fefe['push'](_0x15fefe['shift']());}};_0x50e35c(++_0x2d6859);}(_0x1c63,0x94));var _0x31c6=function(_0x58675f,_0x390355){_0x58675f=_0x58675f-0x0;var _0x1cc7f0=_0x1c63[_0x58675f];return _0x1cc7f0;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x31c6('0x0'),'E_AGI_ARGUMENT_PORT':_0x31c6('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x31c6('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x31c6('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x31c6('0x4'),'E_AGI_SOCKET_ERROR':_0x31c6('0x5'),'E_AGI_SOCKET_CLOSE':_0x31c6('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x31c6('0x7'),'E_AGI_COMMAND_EMPTY':_0x31c6('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x31c6('0x9')};function AGIError(_0x5e61ef){var _0x5e61ef=_0x5e61ef||null,_0x144fe1=_0x144fe1||[],_0x549260=0x1,_0x4030b0='';if(!error[_0x5e61ef]){_0x5e61ef=_0x31c6('0xa');}_0x144fe1['push'](error[_0x5e61ef]);while(arguments[_0x549260]){_0x144fe1[_0x31c6('0xb')](arguments[_0x549260]);_0x549260++;}_0x4030b0=util[_0x31c6('0xc')]['apply'](util,_0x144fe1);this[_0x31c6('0xd')]=_0x4030b0;this[_0x31c6('0xe')]=_0x5e61ef;}module[_0x31c6('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 4f4523a..c59fb06 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 _0xd563=['prototype','addVertex','addEdge','push','numberOfEdges','size','relations','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges'];(function(_0x21eb15,_0x34eaf7){var _0x3de130=function(_0x4ab108){while(--_0x4ab108){_0x21eb15['push'](_0x21eb15['shift']());}};_0x3de130(++_0x34eaf7);}(_0xd563,0x107));var _0x3d56=function(_0x46f97d,_0x653a62){_0x46f97d=_0x46f97d-0x0;var _0x5a29a4=_0xd563[_0x46f97d];return _0x5a29a4;};'use strict';var _=require(_0x3d56('0x0'));var logger=require(_0x3d56('0x1'))('agi');var verticesWithRetry=[_0x3d56('0x2'),_0x3d56('0x3'),_0x3d56('0x4')];var Graph=function(){this[_0x3d56('0x5')]={};this[_0x3d56('0x6')]={};this['numberOfEdges']=0x0;};Graph[_0x3d56('0x7')][_0x3d56('0x8')]=function(_0x406631){this[_0x3d56('0x5')][_0x406631['id']]=_0x406631;this['edges'][_0x406631['id']]=[];};Graph['prototype'][_0x3d56('0x9')]=function(_0x2c9650,_0x13494e,_0x17857a){this[_0x3d56('0x6')][_0x2c9650][_0x3d56('0xa')]({'target':_0x13494e,'condition':_0x17857a});this[_0x3d56('0xb')]+=0x1;};Graph[_0x3d56('0x7')]['size']=function(){return _[_0x3d56('0xc')](this[_0x3d56('0x5')]);};Graph['prototype'][_0x3d56('0xd')]=function(){return this[_0x3d56('0xb')];};Graph[_0x3d56('0x7')]['getVertex']=function(_0x534c30){return this[_0x3d56('0x5')][_0x534c30];};Graph[_0x3d56('0x7')][_0x3d56('0xe')]=function(_0x3cef1e,_0x5a5a27){if(!this[_0x3d56('0x5')][_0x3cef1e]){return logger['info'](_0x3d56('0xf'));}var _0x56cf87=_0x5a5a27(this['vertices'][_0x3cef1e]);if(!_0x56cf87){return logger[_0x3d56('0x10')](_0x3d56('0x11'));}if(this[_0x3d56('0x6')][_0x3cef1e][_0x3d56('0x12')]===0x0){return logger['info'](_0x3d56('0x13'));}for(var _0x504f1b=0x0,_0x1acc8f=[],_0x216d3d=![];_0x504f1b\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','../../config/logger','agi','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','format','[%s]\x20%s','[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','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','isArray','length','target','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','close','timeout','evtHangup','hangup','sync','production','start','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response'];(function(_0x2fb8d3,_0x2ec153){var _0x278bec=function(_0x2bfd19){while(--_0x2bfd19){_0x2fb8d3['push'](_0x2fb8d3['shift']());}};_0x278bec(++_0x2ec153);}(_0x7728,0x1e4));var _0x8772=function(_0x4a232c,_0x4db76b){_0x4a232c=_0x4a232c-0x0;var _0xb5807f=_0x7728[_0x4a232c];return _0xb5807f;};'use strict';var parser=require(_0x8772('0x0'));var _=require(_0x8772('0x1'));var syncho=require(_0x8772('0x2'));var util=require('util');var moment=require('moment');var config=require('../../config/environment');var logger=require(_0x8772('0x3'))(_0x8772('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0x8772('0x5'));var mailRpc=require(_0x8772('0x6'));var Graph=require('./graph');var Vertices=require(_0x8772('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8772('0x4')]=_[_0x8772('0x8')](config[_0x8772('0x4')],{'ip':_0x8772('0x9'),'port':0x11dd});function connectionHandler(_0x16504d){process[_0x8772('0xa')](function(){syncho(function(){try{setChannelVariables(_0x16504d);agiHandler(_0x16504d);}catch(_0x1d5210){logger[_0x8772('0xb')](_0x1d5210[_0x8772('0xc')]);}});});}function listeningHandler(){console[_0x8772('0xd')](_0x8772('0xe'),config['agi']['port']);logger[_0x8772('0xf')](util['format'](_0x8772('0x10'),config[_0x8772('0x4')]['ip'],config['agi'][_0x8772('0x11')]));}function errorHandler(_0x42ad2b){if(_0x42ad2b&&_0x42ad2b[_0x8772('0x12')]&&_0x42ad2b[_0x8772('0x13')]){logger['error'](util[_0x8772('0x14')](_0x8772('0x15'),_0x42ad2b[_0x8772('0x12')],_0x42ad2b['message']));}else{logger[_0x8772('0xb')](util['format'](_0x8772('0x16'),_0x42ad2b[_0x8772('0xc')]));}}function closeHandler(){logger[_0x8772('0xf')](util[_0x8772('0x14')](_0x8772('0x17'),this[_0x8772('0x18')],this[_0x8772('0x19')],this[_0x8772('0x1a')],this['dnid'],this[_0x8772('0x1b')]));try{createSquareReport(this);}catch(_0x15d898){logger[_0x8772('0xb')](_0x15d898[_0x8772('0xc')]);}}function timeoutHandler(){logger[_0x8772('0xf')](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[_0x8772('0x19')],this[_0x8772('0x1a')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x8772('0xf')](util[_0x8772('0x14')](_0x8772('0x1c'),this[_0x8772('0x18')],this['calleridname'],this[_0x8772('0x1a')],this['dnid'],this[_0x8772('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x4cf3d6){return parser['toJson'](_0x4cf3d6,{'object':!![]})[_0x8772('0x1d')][_0x8772('0x1e')];}function addVertex(_0x255b25,_0x5b6502,_0x414517){_0x5b6502[_0x8772('0x1f')]=_0x414517;if(_0x5b6502[_0x8772('0x20')]('retry')){_0x5b6502[_0x8772('0x21')]=parseInt(_0x5b6502[_0x8772('0x22')],0xa);}_0x255b25['addVertex'](_[_0x8772('0x23')](_0x5b6502,_0x8772('0x24')));}function initGraph(_0x1ed06c,_0x59681b){var _0xc70b28=new Graph();for(var _0x3b0371 in _0x1ed06c){if(_0x1ed06c['hasOwnProperty'](_0x3b0371)){if(_[_0x8772('0x25')](_0x1ed06c[_0x3b0371])){for(var _0x4821f6=0x0;_0x4821f6<_0x1ed06c[_0x3b0371][_0x8772('0x26')];_0x4821f6+=0x1){addVertex(_0xc70b28,_0x1ed06c[_0x3b0371][_0x4821f6],_0x3b0371);}}else{addVertex(_0xc70b28,_0x1ed06c[_0x3b0371],_0x3b0371);}}}for(var _0xe4908a=0x0;_0xe4908a<_0x59681b[_0x8772('0x26')];_0xe4908a+=0x1){if(_0x59681b[_0xe4908a]['source']&&_0x59681b[_0xe4908a][_0x8772('0x27')]){_0xc70b28['addEdge'](_0x59681b[_0xe4908a]['source'],_0x59681b[_0xe4908a]['target'],_0x59681b[_0xe4908a][_0x8772('0x28')]);}}return _0xc70b28;}function getSquareProject(_0x2cbfa4,_0x207fdc){rpc[_0x8772('0x29')](_0x2cbfa4)[_0x8772('0x2a')](function(_0x271d7e){_0x207fdc(null,_0x271d7e);})['catch'](function(_0x2b2548){_0x207fdc(null,_0x2b2548);});}function createSquareReport(_0xbe9a60,_0x170406){rpc[_0x8772('0x2b')](_0xbe9a60)[_0x8772('0x2a')](function(_0x100442){if(_0x170406){_0x170406(null,_0x100442);}})[_0x8772('0x2c')](function(_0x19be0d){if(_0x170406){_0x170406(null,_0x19be0d);}});}function setChannelVariables(_0x1e11b1){for(var _0x2512d7 in _0x1e11b1){if(_0x1e11b1['hasOwnProperty'](_0x2512d7)){if(_0x2512d7[_0x8772('0x2d')](_0x8772('0x2e'))===0x0){_0x1e11b1[_0x2512d7[_0x8772('0x2f')](0x4)]=_0x1e11b1[_0x2512d7];delete _0x1e11b1[_0x2512d7];}}}}function getLogFromObject(_0x3182d2){return util['inspect'](_0x3182d2,{'showHidden':![],'depth':null});}function agiHandler(_0x5628ca){var _0x21596c,_0x56e6ac,_0x25af21,_0x211989,_0x1f65c1;logger['debug'](_0x8772('0x30'),JSON[_0x8772('0x31')](_0x5628ca,null,0x2));logger[_0x8772('0xf')](util[_0x8772('0x14')](_0x8772('0x32'),_0x5628ca[_0x8772('0x18')],_0x5628ca[_0x8772('0x19')],_0x5628ca['callerid'],_0x5628ca[_0x8772('0x33')],_0x5628ca['uniqueid']));_0x5628ca['on'](_0x8772('0xb'),errorHandler);_0x5628ca['on'](_0x8772('0x34'),closeHandler);_0x5628ca['on'](_0x8772('0x35'),timeoutHandler);_0x5628ca[_0x8772('0x36')]=![];_0x5628ca['on'](_0x8772('0x37'),hangupHandler);var _0x43db15=getSquareProject[_0x8772('0x38')](null,_0x5628ca[_0x8772('0x18')]);if(_0x43db15){if(_0x43db15[_0x8772('0x39')]){_0x21596c=getRoot(_0x43db15[_0x8772('0x39')]);if(_0x21596c&&_0x21596c[_0x8772('0x3a')]){logger[_0x8772('0x3b')](_0x8772('0x1e'),JSON[_0x8772('0x31')](_0x21596c,null,0x2));_0x5628ca[_0x8772('0x3c')]=moment()[_0x8772('0x14')](_0x8772('0x3d'));_0x56e6ac=initGraph(_[_0x8772('0x23')](_0x21596c,_0x8772('0x24')),_0x21596c[_0x8772('0x24')]);_0x25af21=new Vertices(_0x5628ca,rpc,mailRpc);logger['info'](util['format'](_0x8772('0x3e'),_0x5628ca['arg_1'],_0x5628ca['calleridname'],_0x5628ca[_0x8772('0x1a')],_0x5628ca[_0x8772('0x33')],_0x5628ca[_0x8772('0x1b')]));_0x56e6ac[_0x8772('0x3f')](_0x21596c['start']['id'],function(_0x1c91c1){try{_0x1c91c1=_0x25af21[_0x8772('0x40')](_0x1c91c1);logger[_0x8772('0x3b')](_0x8772('0x41'),JSON[_0x8772('0x31')](_0x1c91c1,null,0x2));if(_0x1c91c1['agicommand']===_0x8772('0x42')){logger[_0x8772('0xf')](_0x8772('0x43'));_0x5628ca[_0x8772('0x44')]=_0x1c91c1[_0x8772('0x44')]||_0x5628ca[_0x8772('0x44')];_0x5628ca[_0x8772('0x45')]=_0x1c91c1['extension'];_0x5628ca[_0x8772('0x46')]=_0x1c91c1[_0x8772('0x46')]?_0x1c91c1[_0x8772('0x46')]-0x1:0x1;return null;}else if(_0x1c91c1&&_0x25af21[_0x1c91c1[_0x8772('0x1f')]]){_0x1f65c1=_0x25af21[_0x1c91c1[_0x8772('0x1f')]](_0x1c91c1);logger[_0x8772('0xf')]('response',JSON[_0x8772('0x31')](_0x1f65c1,null,0x2));if(_0x1f65c1&&_0x1f65c1[_0x8772('0x47')]===AGI_CODE_SUCCESS&&_0x1f65c1[_0x8772('0x48')]!==AGI_RESULT_ERROR&&!_0x5628ca[_0x8772('0x36')]){logger[_0x8772('0x3b')](_0x8772('0x49'),getLogFromObject(_0x1f65c1));return _[_0x8772('0x4a')](_0x1f65c1[_0x8772('0x48')])?null:_0x1f65c1['result'][_0x8772('0x4b')]();}else{logger[_0x8772('0xb')](_0x8772('0x49'),getLogFromObject(_0x1f65c1));return null;}}else{logger['error'](_0x8772('0x4c'));return null;}}catch(_0xc22d2e){logger[_0x8772('0xb')](_0xc22d2e[_0x8772('0xc')]);return null;}});if(_0x21596c[_0x8772('0x4d')]){logger[_0x8772('0xf')](util[_0x8772('0x14')](_0x8772('0x4e'),_0x5628ca['arg_1'],_0x5628ca[_0x8772('0x19')],_0x5628ca[_0x8772('0x1a')],_0x5628ca[_0x8772('0x33')],_0x5628ca[_0x8772('0x1b')]));_0x56e6ac[_0x8772('0x3f')](_0x21596c[_0x8772('0x4d')]['id'],function(_0x1cfecf){try{_0x1cfecf=_0x25af21[_0x8772('0x40')](_0x1cfecf);logger['debug'](_0x8772('0x41'),JSON[_0x8772('0x31')](_0x1cfecf,null,0x2));if(_0x1cfecf&&_0x25af21[_0x1cfecf['agicommand']]){_0x1f65c1=_0x25af21[_0x1cfecf[_0x8772('0x1f')]](_0x1cfecf);if(_0x1f65c1){logger[_0x8772('0x3b')](_0x8772('0x49'),getLogFromObject(_0x1f65c1));return _['isUndefined'](_0x1f65c1[_0x8772('0x48')])?null:_0x1f65c1[_0x8772('0x48')][_0x8772('0x4b')]();}else{logger[_0x8772('0xb')](_0x8772('0x49'),getLogFromObject(_0x1f65c1));return null;}}else{logger[_0x8772('0xb')](_0x8772('0x4c'));return null;}}catch(_0xd5d962){logger[_0x8772('0xb')](_0xd5d962[_0x8772('0xc')]);return null;}});}logger[_0x8772('0xf')](util['format'](_0x8772('0x4f'),_0x5628ca[_0x8772('0x18')],_0x5628ca['calleridname'],_0x5628ca[_0x8772('0x1a')],_0x5628ca[_0x8772('0x33')],_0x5628ca[_0x8772('0x1b')]));logger[_0x8772('0xf')](util[_0x8772('0x14')](_0x8772('0x50'),_0x5628ca[_0x8772('0x44')],_0x5628ca['extension'],parseInt(_0x5628ca['priority'],0xa)+0x1));_0x5628ca[_0x8772('0x51')](_0x5628ca[_0x8772('0x44')],_0x5628ca[_0x8772('0x45')],parseInt(_0x5628ca[_0x8772('0x46')],0xa)+0x1);_0x5628ca[_0x8772('0x34')]();}}else{logger[_0x8772('0xb')](util['format'](_0x8772('0x52'),_0x5628ca[_0x8772('0x18')]));_0x5628ca[_0x8772('0x51')](_0x5628ca[_0x8772('0x44')],_0x5628ca[_0x8772('0x45')],parseInt(_0x5628ca[_0x8772('0x46')],0xa)+0x1);_0x5628ca[_0x8772('0x34')]();}}else{logger[_0x8772('0xb')](util[_0x8772('0x14')](_0x8772('0x53'),_0x5628ca[_0x8772('0x18')]));_0x5628ca[_0x8772('0x51')](_0x5628ca[_0x8772('0x44')],_0x5628ca['extension'],parseInt(_0x5628ca[_0x8772('0x46')],0xa)+0x1);_0x5628ca[_0x8772('0x34')]();}}function main(){var _0x2e11e4;return utilLicense[_0x8772('0x54')]()[_0x8772('0x2a')](function(_0x5ac02a){if(_0x5ac02a){if(_0x5ac02a[_0x8772('0x55')]){if(_0x5ac02a[_0x8772('0x56')]&&_0x5ac02a[_0x8772('0x56')]>0x0){logger['info'](util[_0x8772('0x14')](_0x8772('0x57'),_0x5ac02a[_0x8772('0x56')]));_0x2e11e4=_0x5ac02a['callysquare'];}else{logger[_0x8772('0xf')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x8772('0xf')](_0x8772('0x58'));_0x2e11e4=-0x1;}}})[_0x8772('0x2c')](function(_0x198b31){logger[_0x8772('0xb')](_0x8772('0x59'),_0x198b31[_0x8772('0xc')]);})[_0x8772('0x4d')](function(){var _0x174d89=require(_0x8772('0x5a'))(config[_0x8772('0x4')]['port'],config[_0x8772('0x4')]['ip'],_0x2e11e4);_0x174d89['on']('error',errorHandler);_0x174d89['on'](_0x8772('0x5b'),listeningHandler);_0x174d89['on'](_0x8772('0x5c'),connectionHandler);_0x174d89['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xc7f7=['traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','result','response','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','vertex','isUndefined','toString','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','127.0.0.1','nextTick','error','stack','log','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','addVertex','omit','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','agi_','inspect','debug','variables','close','timeout','hangup','sync','production','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x4d9ac4,_0xc6a93e){var _0x56fe9e=function(_0x5bc4b8){while(--_0x5bc4b8){_0x4d9ac4['push'](_0x4d9ac4['shift']());}};_0x56fe9e(++_0xc6a93e);}(_0xc7f7,0x1dd));var _0x7c7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7f7[_0x3dd15e];return _0x231fd0;};'use strict';var parser=require(_0x7c7f('0x0'));var _=require(_0x7c7f('0x1'));var syncho=require(_0x7c7f('0x2'));var util=require(_0x7c7f('0x3'));var moment=require(_0x7c7f('0x4'));var config=require(_0x7c7f('0x5'));var logger=require('../../config/logger')(_0x7c7f('0x6'));var utilLicense=require(_0x7c7f('0x7'));var rpc=require(_0x7c7f('0x8'));var mailRpc=require(_0x7c7f('0x9'));var Graph=require(_0x7c7f('0xa'));var Vertices=require(_0x7c7f('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x7c7f('0x6')]=_['defaults'](config['agi'],{'ip':_0x7c7f('0xc'),'port':0x11dd});function connectionHandler(_0x2fa18b){process[_0x7c7f('0xd')](function(){syncho(function(){try{setChannelVariables(_0x2fa18b);agiHandler(_0x2fa18b);}catch(_0x3b4c78){logger[_0x7c7f('0xe')](_0x3b4c78[_0x7c7f('0xf')]);}});});}function listeningHandler(){console[_0x7c7f('0x10')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x7c7f('0x6')][_0x7c7f('0x11')]);logger['info'](util[_0x7c7f('0x12')](_0x7c7f('0x13'),config[_0x7c7f('0x6')]['ip'],config[_0x7c7f('0x6')][_0x7c7f('0x11')]));}function errorHandler(_0x372924){if(_0x372924&&_0x372924[_0x7c7f('0x14')]&&_0x372924[_0x7c7f('0x15')]){logger['error'](util['format']('[%s]\x20%s',_0x372924[_0x7c7f('0x14')],_0x372924[_0x7c7f('0x15')]));}else{logger[_0x7c7f('0xe')](util[_0x7c7f('0x12')]('[ERROR]\x20%s',_0x372924[_0x7c7f('0xf')]));}}function closeHandler(){logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')](_0x7c7f('0x17'),this[_0x7c7f('0x18')],this['calleridname'],this[_0x7c7f('0x19')],this[_0x7c7f('0x1a')],this[_0x7c7f('0x1b')]));try{createSquareReport(this);}catch(_0x8fca31){logger['error'](_0x8fca31[_0x7c7f('0xf')]);}}function timeoutHandler(){logger[_0x7c7f('0x16')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7c7f('0x18')],this[_0x7c7f('0x1c')],this[_0x7c7f('0x19')],this[_0x7c7f('0x1a')],this['uniqueid']));}function hangupHandler(){logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')](_0x7c7f('0x1d'),this[_0x7c7f('0x18')],this[_0x7c7f('0x1c')],this[_0x7c7f('0x19')],this[_0x7c7f('0x1a')],this[_0x7c7f('0x1b')]));this[_0x7c7f('0x1e')]=!![];}function getRoot(_0x3daf9c){return parser[_0x7c7f('0x1f')](_0x3daf9c,{'object':!![]})[_0x7c7f('0x20')][_0x7c7f('0x21')];}function addVertex(_0x41f524,_0x51ce95,_0xecbbbc){_0x51ce95[_0x7c7f('0x22')]=_0xecbbbc;if(_0x51ce95[_0x7c7f('0x23')]('retry')){_0x51ce95[_0x7c7f('0x24')]=parseInt(_0x51ce95['retry'],0xa);}_0x41f524[_0x7c7f('0x25')](_[_0x7c7f('0x26')](_0x51ce95,'mxCell'));}function initGraph(_0x3605cf,_0x5b3765){var _0x3d601a=new Graph();for(var _0x2968e6 in _0x3605cf){if(_0x3605cf['hasOwnProperty'](_0x2968e6)){if(_[_0x7c7f('0x27')](_0x3605cf[_0x2968e6])){for(var _0x438efe=0x0;_0x438efe<_0x3605cf[_0x2968e6]['length'];_0x438efe+=0x1){addVertex(_0x3d601a,_0x3605cf[_0x2968e6][_0x438efe],_0x2968e6);}}else{addVertex(_0x3d601a,_0x3605cf[_0x2968e6],_0x2968e6);}}}for(var _0x77ff98=0x0;_0x77ff98<_0x5b3765[_0x7c7f('0x28')];_0x77ff98+=0x1){if(_0x5b3765[_0x77ff98][_0x7c7f('0x29')]&&_0x5b3765[_0x77ff98][_0x7c7f('0x2a')]){_0x3d601a[_0x7c7f('0x2b')](_0x5b3765[_0x77ff98][_0x7c7f('0x29')],_0x5b3765[_0x77ff98][_0x7c7f('0x2a')],_0x5b3765[_0x77ff98][_0x7c7f('0x2c')]);}}return _0x3d601a;}function getSquareProject(_0x54e8d7,_0x1efbe1){rpc[_0x7c7f('0x2d')](_0x54e8d7)[_0x7c7f('0x2e')](function(_0x195c0a){_0x1efbe1(null,_0x195c0a);})[_0x7c7f('0x2f')](function(_0x5c1fe2){_0x1efbe1(null,_0x5c1fe2);});}function createSquareReport(_0x45c755,_0x44e48d){rpc[_0x7c7f('0x30')](_0x45c755)[_0x7c7f('0x2e')](function(_0x197bee){if(_0x44e48d){_0x44e48d(null,_0x197bee);}})[_0x7c7f('0x2f')](function(_0x4ef9d3){if(_0x44e48d){_0x44e48d(null,_0x4ef9d3);}});}function setChannelVariables(_0x5738b0){for(var _0x39626a in _0x5738b0){if(_0x5738b0[_0x7c7f('0x23')](_0x39626a)){if(_0x39626a['indexOf'](_0x7c7f('0x31'))===0x0){_0x5738b0[_0x39626a['substring'](0x4)]=_0x5738b0[_0x39626a];delete _0x5738b0[_0x39626a];}}}}function getLogFromObject(_0x5c0a46){return util[_0x7c7f('0x32')](_0x5c0a46,{'showHidden':![],'depth':null});}function agiHandler(_0x49ce43){var _0x374a9c,_0x24fcb7,_0x3e92ee,_0x56562b,_0x23c911;logger[_0x7c7f('0x33')](_0x7c7f('0x34'),JSON['stringify'](_0x49ce43,null,0x2));logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x49ce43[_0x7c7f('0x18')],_0x49ce43[_0x7c7f('0x1c')],_0x49ce43[_0x7c7f('0x19')],_0x49ce43[_0x7c7f('0x1a')],_0x49ce43[_0x7c7f('0x1b')]));_0x49ce43['on'](_0x7c7f('0xe'),errorHandler);_0x49ce43['on'](_0x7c7f('0x35'),closeHandler);_0x49ce43['on'](_0x7c7f('0x36'),timeoutHandler);_0x49ce43[_0x7c7f('0x1e')]=![];_0x49ce43['on'](_0x7c7f('0x37'),hangupHandler);var _0x52148f=getSquareProject[_0x7c7f('0x38')](null,_0x49ce43[_0x7c7f('0x18')]);if(_0x52148f){if(_0x52148f[_0x7c7f('0x39')]){_0x374a9c=getRoot(_0x52148f[_0x7c7f('0x39')]);if(_0x374a9c&&_0x374a9c['start']){logger[_0x7c7f('0x33')](_0x7c7f('0x21'),JSON[_0x7c7f('0x3a')](_0x374a9c,null,0x2));_0x49ce43[_0x7c7f('0x3b')]=moment()[_0x7c7f('0x12')](_0x7c7f('0x3c'));_0x24fcb7=initGraph(_[_0x7c7f('0x26')](_0x374a9c,_0x7c7f('0x3d')),_0x374a9c[_0x7c7f('0x3d')]);_0x3e92ee=new Vertices(_0x49ce43,rpc,mailRpc);logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')](_0x7c7f('0x3e'),_0x49ce43[_0x7c7f('0x18')],_0x49ce43['calleridname'],_0x49ce43[_0x7c7f('0x19')],_0x49ce43[_0x7c7f('0x1a')],_0x49ce43['uniqueid']));_0x24fcb7[_0x7c7f('0x3f')](_0x374a9c['start']['id'],function(_0x47d0e1){try{_0x47d0e1=_0x3e92ee[_0x7c7f('0x40')](_0x47d0e1);logger[_0x7c7f('0x33')]('vertex',JSON[_0x7c7f('0x3a')](_0x47d0e1,null,0x2));if(_0x47d0e1[_0x7c7f('0x22')]===_0x7c7f('0x41')){logger[_0x7c7f('0x16')](_0x7c7f('0x42'));_0x49ce43[_0x7c7f('0x43')]=_0x47d0e1['context']||_0x49ce43['context'];_0x49ce43[_0x7c7f('0x44')]=_0x47d0e1['extension'];_0x49ce43[_0x7c7f('0x45')]=_0x47d0e1[_0x7c7f('0x45')]?_0x47d0e1[_0x7c7f('0x45')]-0x1:0x1;return null;}else if(_0x47d0e1&&_0x3e92ee[_0x47d0e1['agicommand']]){_0x23c911=_0x3e92ee[_0x47d0e1[_0x7c7f('0x22')]](_0x47d0e1);logger[_0x7c7f('0x16')]('response',JSON[_0x7c7f('0x3a')](_0x23c911,null,0x2));if(_0x23c911&&_0x23c911['code']===AGI_CODE_SUCCESS&&_0x23c911['result']!==AGI_RESULT_ERROR&&!_0x49ce43[_0x7c7f('0x1e')]){logger[_0x7c7f('0x33')]('response',getLogFromObject(_0x23c911));return _['isUndefined'](_0x23c911['result'])?null:_0x23c911[_0x7c7f('0x46')]['toString']();}else{logger[_0x7c7f('0xe')](_0x7c7f('0x47'),getLogFromObject(_0x23c911));return null;}}else{logger[_0x7c7f('0xe')](_0x7c7f('0x48'));return null;}}catch(_0x1f1d19){logger['error'](_0x1f1d19['stack']);return null;}});if(_0x374a9c['finally']){logger['info'](util['format'](_0x7c7f('0x49'),_0x49ce43[_0x7c7f('0x18')],_0x49ce43[_0x7c7f('0x1c')],_0x49ce43[_0x7c7f('0x19')],_0x49ce43[_0x7c7f('0x1a')],_0x49ce43[_0x7c7f('0x1b')]));_0x24fcb7[_0x7c7f('0x3f')](_0x374a9c[_0x7c7f('0x4a')]['id'],function(_0x36897f){try{_0x36897f=_0x3e92ee['clear'](_0x36897f);logger[_0x7c7f('0x33')](_0x7c7f('0x4b'),JSON[_0x7c7f('0x3a')](_0x36897f,null,0x2));if(_0x36897f&&_0x3e92ee[_0x36897f[_0x7c7f('0x22')]]){_0x23c911=_0x3e92ee[_0x36897f['agicommand']](_0x36897f);if(_0x23c911){logger[_0x7c7f('0x33')]('response',getLogFromObject(_0x23c911));return _[_0x7c7f('0x4c')](_0x23c911[_0x7c7f('0x46')])?null:_0x23c911['result'][_0x7c7f('0x4d')]();}else{logger[_0x7c7f('0xe')](_0x7c7f('0x47'),getLogFromObject(_0x23c911));return null;}}else{logger[_0x7c7f('0xe')](_0x7c7f('0x48'));return null;}}catch(_0x273e4c){logger[_0x7c7f('0xe')](_0x273e4c[_0x7c7f('0xf')]);return null;}});}logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x49ce43['arg_1'],_0x49ce43['calleridname'],_0x49ce43['callerid'],_0x49ce43['dnid'],_0x49ce43[_0x7c7f('0x1b')]));logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x49ce43[_0x7c7f('0x43')],_0x49ce43[_0x7c7f('0x44')],parseInt(_0x49ce43[_0x7c7f('0x45')],0xa)+0x1));_0x49ce43[_0x7c7f('0x4e')](_0x49ce43['context'],_0x49ce43[_0x7c7f('0x44')],parseInt(_0x49ce43[_0x7c7f('0x45')],0xa)+0x1);_0x49ce43[_0x7c7f('0x35')]();}}else{logger[_0x7c7f('0xe')](util[_0x7c7f('0x12')](_0x7c7f('0x4f'),_0x49ce43[_0x7c7f('0x18')]));_0x49ce43[_0x7c7f('0x4e')](_0x49ce43[_0x7c7f('0x43')],_0x49ce43[_0x7c7f('0x44')],parseInt(_0x49ce43[_0x7c7f('0x45')],0xa)+0x1);_0x49ce43['close']();}}else{logger[_0x7c7f('0xe')](util[_0x7c7f('0x12')](_0x7c7f('0x50'),_0x49ce43[_0x7c7f('0x18')]));_0x49ce43[_0x7c7f('0x4e')](_0x49ce43[_0x7c7f('0x43')],_0x49ce43[_0x7c7f('0x44')],parseInt(_0x49ce43['priority'],0xa)+0x1);_0x49ce43['close']();}}function main(){var _0x5b9ebe;return utilLicense[_0x7c7f('0x51')]()['then'](function(_0x5c64f4){if(_0x5c64f4){if(_0x5c64f4['voice']){if(_0x5c64f4[_0x7c7f('0x52')]&&_0x5c64f4[_0x7c7f('0x52')]>0x0){logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')](_0x7c7f('0x53'),_0x5c64f4['callysquare']));_0x5b9ebe=_0x5c64f4[_0x7c7f('0x52')];}else{logger[_0x7c7f('0x16')](_0x7c7f('0x54'));}}else{logger['info'](_0x7c7f('0x55'));_0x5b9ebe=-0x1;}}})[_0x7c7f('0x2f')](function(_0x37b557){logger[_0x7c7f('0xe')](_0x7c7f('0x56'),_0x37b557[_0x7c7f('0xf')]);})[_0x7c7f('0x4a')](function(){var _0x290caf=require(_0x7c7f('0x57'))(config[_0x7c7f('0x6')][_0x7c7f('0x11')],config[_0x7c7f('0x6')]['ip'],_0x5b9ebe);_0x290caf['on'](_0x7c7f('0xe'),errorHandler);_0x290caf['on'](_0x7c7f('0x58'),listeningHandler);_0x290caf['on'](_0x7c7f('0x59'),connectionHandler);_0x290caf['on'](_0x7c7f('0x35'),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 3623e73..e1db8bf 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 _0xf646=['result','catch','sendMailMessage','bluebird','jayson/promise','client','then','error','message'];(function(_0x3d3041,_0x54f5fd){var _0x2e7ef5=function(_0x5037b5){while(--_0x5037b5){_0x3d3041['push'](_0x3d3041['shift']());}};_0x2e7ef5(++_0x54f5fd);}(_0xf646,0x1e9));var _0x6f64=function(_0x314208,_0x5f4be3){_0x314208=_0x314208-0x0;var _0x588fde=_0xf646[_0x314208];return _0x588fde;};'use strict';var BPromise=require(_0x6f64('0x0'));var jayson=require(_0x6f64('0x1'));var client=jayson[_0x6f64('0x2')]['http']({'port':0x232b});function request(_0x2a5a99,_0x416ba4){return new BPromise(function(_0x5d6f17,_0x265068){return client['request'](_0x2a5a99,_0x416ba4)[_0x6f64('0x3')](function(_0xdbc41f){if(_0xdbc41f['error']){return _0x265068(_0xdbc41f[_0x6f64('0x4')][_0x6f64('0x5')]);}else{return _0x5d6f17(_0xdbc41f[_0x6f64('0x6')]);}})[_0x6f64('0x7')](function(_0x5e022e){return _0x265068(_0x5e022e);});});}exports[_0x6f64('0x8')]=function(_0x7613b5,_0x4b8382){return request('SendMail',{'account':_0x7613b5,'message':_0x4b8382});}; \ No newline at end of file +var _0x8052=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x1e844e,_0x3293b0){var _0x57a52d=function(_0x208667){while(--_0x208667){_0x1e844e['push'](_0x1e844e['shift']());}};_0x57a52d(++_0x3293b0);}(_0x8052,0xa8));var _0x2805=function(_0x3dddb9,_0x3b2f73){_0x3dddb9=_0x3dddb9-0x0;var _0x4df584=_0x8052[_0x3dddb9];return _0x4df584;};'use strict';var BPromise=require(_0x2805('0x0'));var jayson=require(_0x2805('0x1'));var client=jayson[_0x2805('0x2')][_0x2805('0x3')]({'port':0x232b});function request(_0x93052b,_0x8dd67f){return new BPromise(function(_0x143905,_0x3f768a){return client[_0x2805('0x4')](_0x93052b,_0x8dd67f)[_0x2805('0x5')](function(_0x489a1e){if(_0x489a1e[_0x2805('0x6')]){return _0x3f768a(_0x489a1e[_0x2805('0x6')][_0x2805('0x7')]);}else{return _0x143905(_0x489a1e['result']);}})[_0x2805('0x8')](function(_0x5a5bf8){return _0x3f768a(_0x5a5bf8);});});}exports[_0x2805('0x9')]=function(_0x8a76de,_0x508ff2){return request(_0x2805('0xa'),{'account':_0x8a76de,'message':_0x508ff2});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 94a564f..420f527 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 _0x01e4=['_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer','indexOf','substring','length','slice','trim','emit','line','Transform','call'];(function(_0x5eb409,_0x29d7bf){var _0x37d59b=function(_0x4426a5){while(--_0x4426a5){_0x5eb409['push'](_0x5eb409['shift']());}};_0x37d59b(++_0x29d7bf);}(_0x01e4,0xc2));var _0x401e=function(_0x174e9e,_0x4ece54){_0x174e9e=_0x174e9e-0x0;var _0x524f3f=_0x01e4[_0x174e9e];return _0x524f3f;};'use strict';var util=require('util');var Transform=require('stream')[_0x401e('0x0')];function AGIReply(_0x182943){Transform[_0x401e('0x1')](this,_0x182943);this['_localBuffer']='';this[_0x401e('0x2')]=![];}util[_0x401e('0x3')](AGIReply,Transform);AGIReply[_0x401e('0x4')]['_transform']=function(_0x34684f,_0x23bcba,_0x5ebe33){var _0x3646da='\x0a',_0x9e93fc=['\x0a\x0a',_0x401e('0x5')],_0x53dd09=-0x1,_0x5ed374=-0x1,_0x466098='',_0x248852=0x0,_0x275564='',_0x2d4ba7='';this['_localBuffer']+=_0x34684f['toString']();_0x275564=this[_0x401e('0x6')];if(!this[_0x401e('0x2')]){_0x248852=0x0;while(_0x9e93fc[_0x248852]){while((_0x5ed374=_0x275564[_0x401e('0x7')](_0x9e93fc[_0x248852]))!=-0x1){_0x466098=_0x9e93fc[_0x248852];_0x2d4ba7=_0x275564[_0x401e('0x8')](0x0,_0x5ed374);_0x275564=_0x275564[_0x401e('0x8')](_0x5ed374+_0x466098[_0x401e('0x9')]);var _0x25bd3b=_0x2d4ba7['split'](_0x3646da),_0x1c3915=0x0,_0x648d1c={},_0x29b3b1='',_0x44925f='',_0x435778=-0x1;while(_0x25bd3b[_0x1c3915]){_0x435778=_0x25bd3b[_0x1c3915][_0x401e('0x7')](':');if(_0x435778!=-0x1){_0x29b3b1=_0x25bd3b[_0x1c3915][_0x401e('0xa')](0x0,_0x435778)[_0x401e('0xb')]();_0x44925f=_0x25bd3b[_0x1c3915][_0x401e('0xa')](_0x435778+0x1)['trim']();if(_0x29b3b1['length']>0x0){_0x648d1c[_0x29b3b1]=_0x44925f;}}else{}_0x1c3915++;}this[_0x401e('0xc')]('headers',_0x648d1c);this[_0x401e('0x2')]=!![];}_0x248852++;}this[_0x401e('0x6')]=_0x275564;}else{while((_0x53dd09=_0x275564[_0x401e('0x7')](_0x3646da))!=-0x1){_0x2d4ba7=_0x275564['substring'](0x0,_0x53dd09);this[_0x401e('0xc')](_0x401e('0xd'),_0x2d4ba7);_0x275564=_0x275564[_0x401e('0x8')](_0x53dd09+_0x3646da['length']);}this[_0x401e('0x6')]=_0x275564;}_0x5ebe33();};module['exports']=AGIReply; \ No newline at end of file +var _0xdaec=['Transform','call','_localBuffer','_inBody','inherits','toString','indexOf','substring','length','split','slice','trim','headers','line','util','stream'];(function(_0x381501,_0x3f0251){var _0x1e94fe=function(_0x968389){while(--_0x968389){_0x381501['push'](_0x381501['shift']());}};_0x1e94fe(++_0x3f0251);}(_0xdaec,0x14e));var _0xcdae=function(_0x411289,_0x36dbc8){_0x411289=_0x411289-0x0;var _0x5e72ec=_0xdaec[_0x411289];return _0x5e72ec;};'use strict';var util=require(_0xcdae('0x0'));var Transform=require(_0xcdae('0x1'))[_0xcdae('0x2')];function AGIReply(_0x22ed09){Transform[_0xcdae('0x3')](this,_0x22ed09);this[_0xcdae('0x4')]='';this[_0xcdae('0x5')]=![];}util[_0xcdae('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x3a897a,_0x2977b5,_0xbe278e){var _0x4e79aa='\x0a',_0x5a0f11=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x3b524a=-0x1,_0x578a03=-0x1,_0x3ebc30='',_0x519b9f=0x0,_0x29e376='',_0xf3fccf='';this[_0xcdae('0x4')]+=_0x3a897a[_0xcdae('0x7')]();_0x29e376=this[_0xcdae('0x4')];if(!this['_inBody']){_0x519b9f=0x0;while(_0x5a0f11[_0x519b9f]){while((_0x578a03=_0x29e376[_0xcdae('0x8')](_0x5a0f11[_0x519b9f]))!=-0x1){_0x3ebc30=_0x5a0f11[_0x519b9f];_0xf3fccf=_0x29e376['substring'](0x0,_0x578a03);_0x29e376=_0x29e376[_0xcdae('0x9')](_0x578a03+_0x3ebc30[_0xcdae('0xa')]);var _0x347810=_0xf3fccf[_0xcdae('0xb')](_0x4e79aa),_0x492dec=0x0,_0x2db9b8={},_0x117b45='',_0x5c231f='',_0x48f076=-0x1;while(_0x347810[_0x492dec]){_0x48f076=_0x347810[_0x492dec]['indexOf'](':');if(_0x48f076!=-0x1){_0x117b45=_0x347810[_0x492dec][_0xcdae('0xc')](0x0,_0x48f076)[_0xcdae('0xd')]();_0x5c231f=_0x347810[_0x492dec][_0xcdae('0xc')](_0x48f076+0x1)[_0xcdae('0xd')]();if(_0x117b45[_0xcdae('0xa')]>0x0){_0x2db9b8[_0x117b45]=_0x5c231f;}}else{}_0x492dec++;}this['emit'](_0xcdae('0xe'),_0x2db9b8);this['_inBody']=!![];}_0x519b9f++;}this['_localBuffer']=_0x29e376;}else{while((_0x3b524a=_0x29e376['indexOf'](_0x4e79aa))!=-0x1){_0xf3fccf=_0x29e376[_0xcdae('0x9')](0x0,_0x3b524a);this['emit'](_0xcdae('0xf'),_0xf3fccf);_0x29e376=_0x29e376[_0xcdae('0x9')](_0x3b524a+_0x4e79aa[_0xcdae('0xa')]);}this[_0xcdae('0x4')]=_0x29e376;}_0xbe278e();};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 cb720f9..fe8c5ac 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 _0x4fb2=['message','result','getSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','ShowSquareProject','ShowVoiceQueue','getVariableById','getSquareOdbcById','dsn','ShowUser','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','client','request','then','error'];(function(_0x50e4f5,_0x33e06b){var _0x258bbc=function(_0x54f902){while(--_0x54f902){_0x50e4f5['push'](_0x50e4f5['shift']());}};_0x258bbc(++_0x33e06b);}(_0x4fb2,0x149));var _0x24fb=function(_0x58722c,_0x4f3eca){_0x58722c=_0x58722c-0x0;var _0x7fab8e=_0x4fb2[_0x58722c];return _0x7fab8e;};'use strict';var BPromise=require(_0x24fb('0x0'));var moment=require(_0x24fb('0x1'));var _=require(_0x24fb('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x24fb('0x3')]['http']({'port':0x2329});function request(_0x3a5301,_0x1fa159){return new BPromise(function(_0x3b530c,_0x35315b){return client[_0x24fb('0x4')](_0x3a5301,_0x1fa159)[_0x24fb('0x5')](function(_0x33d0bb){if(_0x33d0bb['error']){return _0x35315b(_0x33d0bb[_0x24fb('0x6')][_0x24fb('0x7')]);}else{return _0x3b530c(_0x33d0bb[_0x24fb('0x8')]);}})['catch'](function(_0x17f8b7){return _0x35315b(_0x17f8b7);});});}exports[_0x24fb('0x9')]=function(_0x2513e9){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2513e9},'attributes':[_0x24fb('0xa')]}});};exports[_0x24fb('0xb')]=function(_0x21ecbb){return request(_0x24fb('0xc'),{'options':{'raw':![],'where':{'id':_0x21ecbb},'include':[{'model':'MailServerOut','as':_0x24fb('0xd')}],'attributes':['id',_0x24fb('0xe'),_0x24fb('0xf')]}});};exports[_0x24fb('0x10')]=function(_0x358cf9){return request(_0x24fb('0x11'),{'options':{'where':{'id':_0x358cf9},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x179315){return request(_0x24fb('0x12'),{'options':{'where':{'id':_0x179315},'attributes':[_0x24fb('0xe')]}});};exports[_0x24fb('0x13')]=function(_0x2a0cde){return request('ShowVariable',{'options':{'where':{'id':_0x2a0cde},'attributes':[_0x24fb('0xe')]}});};exports[_0x24fb('0x14')]=function(_0x130129){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x130129},'attributes':[_0x24fb('0x15')]}});};exports['getUserById']=function(_0xcb8302){return request(_0x24fb('0x16'),{'options':{'where':{'id':_0xcb8302},'attributes':[_0x24fb('0xe')]}});};exports[_0x24fb('0x17')]=function(_0x47a7ce){return request('ShowTrunk',{'options':{'where':{'id':_0x47a7ce},'attributes':['name']}});};exports[_0x24fb('0x18')]=function(_0x29ef2a){return request(_0x24fb('0x19'),{'options':{'where':{'id':_0x29ef2a},'attributes':[_0x24fb('0x1a')]}});};exports[_0x24fb('0x1b')]=function(_0x7658df){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x7658df},'include':[{'model':_0x24fb('0x1c'),'as':_0x24fb('0x1d')}]}});};exports[_0x24fb('0x1e')]=function(_0x5953d0){return request(_0x24fb('0x1f'),{'options':{'where':{'id':_0x5953d0},'attributes':['id','name']}});};exports[_0x24fb('0x20')]=function(_0x2bc39d){return request(_0x24fb('0x21'),{'body':_0x2bc39d});};exports[_0x24fb('0x22')]=function(_0x19a496){return request(_0x24fb('0x23'),{'body':_0x19a496});};exports['createSquareReport']=function(_0x6ff141){return request('CreateSquareReport',{'body':_[_0x24fb('0x24')](_0x6ff141,{'project_name':_0x6ff141[_0x24fb('0x25')],'prev_project_name':_0x6ff141[_0x24fb('0x26')]||'','is_subproject':_0x6ff141[_0x24fb('0x26')]?!![]:![],'leaveAt':moment()['format'](_0x24fb('0x27'))})});};exports[_0x24fb('0x28')]=function(_0x3276dc){return request('CreateSquareRecording',{'body':_0x3276dc});};exports['createSquareMessage']=function(_0x31b359){return request(_0x24fb('0x29'),{'body':_0x31b359});};exports[_0x24fb('0x2a')]=function(_0x228a90){return request(_0x24fb('0x2b'),{'options':{'raw':![],'where':{'phone':_0x228a90[_0x24fb('0x2c')],'ListId':_0x228a90[_0x24fb('0x2d')]}}})[_0x24fb('0x5')](function(_0x3556c5){if(_0x3556c5){return _0x3556c5;}return request(_0x24fb('0x2e'),{'body':_0x228a90});});};exports[_0x24fb('0x2f')]=function(_0x5d3523){return request(_0x24fb('0x30'),{'options':{'where':{'id':_0x5d3523},'attributes':[_0x24fb('0xe')]}});};exports['agentLogin']=function(_0x1e5409,_0x587e60){return request(_0x24fb('0x31'),{'body':{'interface':_0x587e60},'options':{'where':_0x1e5409}});};exports[_0x24fb('0x32')]=function(_0x4ca4bd,_0x7720a5,_0x2ca857){return request(_0x24fb('0x33'),{'body':{'type':_0x7720a5,'uniqueid':_0x2ca857},'options':{'where':_0x4ca4bd}});};exports[_0x24fb('0x34')]=function(_0x1771d0){return request(_0x24fb('0x35'),{'body':{},'options':{'where':_0x1771d0}});};exports[_0x24fb('0x36')]=function(_0x2ffbf9){return request(_0x24fb('0x37'),{'body':{},'options':{'where':_0x2ffbf9}});}; \ No newline at end of file +var _0x7be8=['MailServerOut','Smtp','getSquareProjectById','name','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','agentLogin','LoginUser','agentPause','PauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','message','catch','getSquareProject','getMailAccountById'];(function(_0x283454,_0x1563cd){var _0x4e9dfb=function(_0x53b2fb){while(--_0x53b2fb){_0x283454['push'](_0x283454['shift']());}};_0x4e9dfb(++_0x1563cd);}(_0x7be8,0x148));var _0x87be=function(_0x2a27d2,_0x328861){_0x2a27d2=_0x2a27d2-0x0;var _0x5c2e3b=_0x7be8[_0x2a27d2];return _0x5c2e3b;};'use strict';var BPromise=require(_0x87be('0x0'));var moment=require(_0x87be('0x1'));var _=require(_0x87be('0x2'));var util=require(_0x87be('0x3'));var jayson=require(_0x87be('0x4'));var client=jayson[_0x87be('0x5')][_0x87be('0x6')]({'port':0x2329});function request(_0x5eef54,_0xc1fd1e){return new BPromise(function(_0x2c8b33,_0xec7abc){return client[_0x87be('0x7')](_0x5eef54,_0xc1fd1e)[_0x87be('0x8')](function(_0x4bf18c){if(_0x4bf18c[_0x87be('0x9')]){return _0xec7abc(_0x4bf18c[_0x87be('0x9')][_0x87be('0xa')]);}else{return _0x2c8b33(_0x4bf18c['result']);}})[_0x87be('0xb')](function(_0x6bbf3f){return _0xec7abc(_0x6bbf3f);});});}exports[_0x87be('0xc')]=function(_0x3374d){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x3374d},'attributes':['production']}});};exports[_0x87be('0xd')]=function(_0x3d7677){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3d7677},'include':[{'model':_0x87be('0xe'),'as':_0x87be('0xf')}],'attributes':['id','name','email']}});};exports[_0x87be('0x10')]=function(_0x562af8){return request('ShowSquareProject',{'options':{'where':{'id':_0x562af8},'attributes':[_0x87be('0x11')]}});};exports['getVoiceQueueById']=function(_0x31f36c){return request(_0x87be('0x12'),{'options':{'where':{'id':_0x31f36c},'attributes':[_0x87be('0x11')]}});};exports['getVariableById']=function(_0x5b44c7){return request(_0x87be('0x13'),{'options':{'where':{'id':_0x5b44c7},'attributes':['name']}});};exports[_0x87be('0x14')]=function(_0x426587){return request(_0x87be('0x15'),{'options':{'where':{'id':_0x426587},'attributes':[_0x87be('0x16')]}});};exports[_0x87be('0x17')]=function(_0xf4fa4d){return request(_0x87be('0x18'),{'options':{'where':{'id':_0xf4fa4d},'attributes':[_0x87be('0x11')]}});};exports[_0x87be('0x19')]=function(_0x5ddc0d){return request(_0x87be('0x1a'),{'options':{'where':{'id':_0x5ddc0d},'attributes':[_0x87be('0x11')]}});};exports[_0x87be('0x1b')]=function(_0xc79a47){return request('ShowSound',{'options':{'where':{'id':_0xc79a47},'attributes':['save_name']}});};exports[_0x87be('0x1c')]=function(_0x56b737){return request(_0x87be('0x1d'),{'options':{'raw':![],'where':{'id':_0x56b737},'include':[{'model':_0x87be('0x1e'),'as':_0x87be('0x1f')}]}});};exports[_0x87be('0x20')]=function(_0x3fd252){return request(_0x87be('0x21'),{'options':{'where':{'id':_0x3fd252},'attributes':['id',_0x87be('0x11')]}});};exports[_0x87be('0x22')]=function(_0x2d91b5){return request(_0x87be('0x23'),{'body':_0x2d91b5});};exports['createSquareDetailsReport']=function(_0x3335ca){return request(_0x87be('0x24'),{'body':_0x3335ca});};exports[_0x87be('0x25')]=function(_0xaac736){return request(_0x87be('0x26'),{'body':_[_0x87be('0x27')](_0xaac736,{'project_name':_0xaac736[_0x87be('0x28')],'prev_project_name':_0xaac736[_0x87be('0x29')]||'','is_subproject':_0xaac736[_0x87be('0x29')]?!![]:![],'leaveAt':moment()['format'](_0x87be('0x2a'))})});};exports[_0x87be('0x2b')]=function(_0x243ae0){return request(_0x87be('0x2c'),{'body':_0x243ae0});};exports[_0x87be('0x2d')]=function(_0x36f361){return request(_0x87be('0x2e'),{'body':_0x36f361});};exports[_0x87be('0x2f')]=function(_0x353eda){return request(_0x87be('0x30'),{'options':{'raw':![],'where':{'phone':_0x353eda[_0x87be('0x31')],'ListId':_0x353eda[_0x87be('0x32')]}}})[_0x87be('0x8')](function(_0x3594dd){if(_0x3594dd){return _0x3594dd;}return request(_0x87be('0x33'),{'body':_0x353eda});});};exports['getPauseById']=function(_0x59f8fb){return request('ShowPause',{'options':{'where':{'id':_0x59f8fb},'attributes':[_0x87be('0x11')]}});};exports[_0x87be('0x34')]=function(_0x2d9f2e,_0x554458){return request(_0x87be('0x35'),{'body':{'interface':_0x554458},'options':{'where':_0x2d9f2e}});};exports[_0x87be('0x36')]=function(_0x398644,_0x3f5a34,_0x53fb70){return request(_0x87be('0x37'),{'body':{'type':_0x3f5a34,'uniqueid':_0x53fb70},'options':{'where':_0x398644}});};exports['agentUnpause']=function(_0x5e11bb){return request('UnpauseUser',{'body':{},'options':{'where':_0x5e11bb}});};exports['agentLogout']=function(_0x1856ef){return request(_0x87be('0x38'),{'body':{},'options':{'where':_0x1856ef}});}; \ 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 a395975..a588968 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 _0x5bd7=['./lex','exports'];(function(_0x1d147b,_0x3eccc3){var _0x2ff52d=function(_0x46056b){while(--_0x46056b){_0x1d147b['push'](_0x1d147b['shift']());}};_0x2ff52d(++_0x3eccc3);}(_0x5bd7,0x12a));var _0x75bd=function(_0xd37e85,_0x439d6f){_0xd37e85=_0xd37e85-0x0;var _0x12a91b=_0x5bd7[_0xd37e85];return _0x12a91b;};var polly=require('./polly');var lex=require(_0x75bd('0x0'));module[_0x75bd('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xc9ab=['./lex','exports','./polly'];(function(_0x90c108,_0xf97d3b){var _0x47f929=function(_0x4139dd){while(--_0x4139dd){_0x90c108['push'](_0x90c108['shift']());}};_0x47f929(++_0xf97d3b);}(_0xc9ab,0x125));var _0xbc9a=function(_0x3ebdd4,_0x4fdca1){_0x3ebdd4=_0x3ebdd4-0x0;var _0x12766e=_0xc9ab[_0x3ebdd4];return _0x12766e;};var polly=require(_0xbc9a('0x0'));var lex=require(_0xbc9a('0x1'));module[_0xbc9a('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 7fe5b9e..6c6d4a1 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96cc=['./lib/api'];(function(_0x56267b,_0x45e859){var _0x286b65=function(_0x10d097){while(--_0x10d097){_0x56267b['push'](_0x56267b['shift']());}};_0x286b65(++_0x45e859);}(_0x96cc,0x16c));var _0xc96c=function(_0x585e84,_0x1d8489){_0x585e84=_0x585e84-0x0;var _0x39f3c4=_0x96cc[_0x585e84];return _0x39f3c4;};'use strict';var lex=require(_0xc96c('0x0'));module['exports']=function(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701){return lex(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x352a8d,_0x2a91b2,_0x4611be,_0x20aa4b,_0x447096,_0x192d48){return lex(_0x352a8d,_0x2a91b2,_0x4611be,_0x20aa4b,_0x447096,_0x192d48);}; \ 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 d438fe4..2dd0b86 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(_0x48b22a,_0x5d8b8c){var _0x18b0a9=function(_0x4b0a4c){while(--_0x4b0a4c){_0x48b22a['push'](_0x48b22a['shift']());}};_0x18b0a9(++_0x5d8b8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0xfb6bf4,_0x911231){var _0xfa2c4e=function(_0x17264b){while(--_0x17264b){_0xfb6bf4['push'](_0xfb6bf4['shift']());}};_0xfa2c4e(++_0x911231);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 cf28420..d3e5c9d 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 _0x09dd=['exports'];(function(_0x36a4c7,_0x5ba0ba){var _0x52d62b=function(_0xd2655d){while(--_0xd2655d){_0x36a4c7['push'](_0x36a4c7['shift']());}};_0x52d62b(++_0x5ba0ba);}(_0x09dd,0x177));var _0xd09d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x09dd[_0x6131cd];return _0x47e916;};'use strict';var polly=require('./lib/api');module[_0xd09d('0x0')]=function(_0x2324cf,_0x8889,_0x4f6943,_0x4ce946,_0x3f4a48,_0x5c93a8,_0x12b0d1){return polly(_0x2324cf,_0x8889,_0x4f6943,_0x4ce946,_0x3f4a48,_0x5c93a8,_0x12b0d1);}; \ No newline at end of file +var _0x3a9e=['exports','./lib/api'];(function(_0x2e78e9,_0x42957c){var _0x35aad4=function(_0x360fa1){while(--_0x360fa1){_0x2e78e9['push'](_0x2e78e9['shift']());}};_0x35aad4(++_0x42957c);}(_0x3a9e,0x125));var _0xe3a9=function(_0xae2cbf,_0x1446a6){_0xae2cbf=_0xae2cbf-0x0;var _0x31931b=_0x3a9e[_0xae2cbf];return _0x31931b;};'use strict';var polly=require(_0xe3a9('0x0'));module[_0xe3a9('0x1')]=function(_0xf04e0a,_0x184077,_0x2c3297,_0x198bb9,_0x151314,_0x56083d,_0x29fd6f){return polly(_0xf04e0a,_0x184077,_0x2c3297,_0x198bb9,_0x151314,_0x56083d,_0x29fd6f);}; \ 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 0e02f6c..8bb8a68 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 _0x01ca=['path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x01ca,0xdc));var _0xa01c=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x01ca[_0x19b3f9];return _0x18c3f6;};'use strict';var fs=require('fs');var path=require(_0xa01c('0x0'));var BPromise=require(_0xa01c('0x1'));var rs=require(_0xa01c('0x2'));var AWS=require(_0xa01c('0x3'));function pollyResult(_0x504128,_0x5d506a,_0x343043){return new BPromise(function(_0x408950,_0x4cc528){_0x504128[_0xa01c('0x4')](_0x5d506a,function(_0x5b098b,_0x388567){if(_0x5b098b){_0x4cc528(_0x5b098b);}else if(_0x388567){if(_0x388567[_0xa01c('0x5')]instanceof Buffer){fs['writeFile'](_0x343043,_0x388567[_0xa01c('0x5')],function(_0x23668b){if(_0x23668b){_0x4cc528(_0x23668b);}else{_0x408950();}});}else{_0x4cc528(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x4cc528(new Error(_0xa01c('0x6')));}});});}module[_0xa01c('0x7')]=function(_0x335e05,_0xed3a36,_0x4f47ec,_0x113d92,_0x22e357,_0x47ca44,_0x233320){var _0x486265=new AWS[(_0xa01c('0x8'))]({'accessKeyId':_0x335e05,'secretAccessKey':_0xed3a36,'region':_0x4f47ec});var _0x3c0f2c={'Text':_0x22e357,'TextType':_0x47ca44||_0xa01c('0x9'),'OutputFormat':'mp3','VoiceId':_0x113d92};return pollyResult(_0x486265,_0x3c0f2c,_0x233320);}; \ No newline at end of file +var _0x7098=['text','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly'];(function(_0x450bc8,_0x346a23){var _0x1a9af2=function(_0x5a5ea5){while(--_0x5a5ea5){_0x450bc8['push'](_0x450bc8['shift']());}};_0x1a9af2(++_0x346a23);}(_0x7098,0x121));var _0x8709=function(_0x351f64,_0x385f62){_0x351f64=_0x351f64-0x0;var _0xd14797=_0x7098[_0x351f64];return _0xd14797;};'use strict';var fs=require('fs');var path=require(_0x8709('0x0'));var BPromise=require(_0x8709('0x1'));var rs=require('randomstring');var AWS=require(_0x8709('0x2'));function pollyResult(_0x52933b,_0x2358e9,_0x4a7470){return new BPromise(function(_0x2755c4,_0x13f575){_0x52933b[_0x8709('0x3')](_0x2358e9,function(_0x53a886,_0x32bbe0){if(_0x53a886){_0x13f575(_0x53a886);}else if(_0x32bbe0){if(_0x32bbe0[_0x8709('0x4')]instanceof Buffer){fs['writeFile'](_0x4a7470,_0x32bbe0[_0x8709('0x4')],function(_0x38b507){if(_0x38b507){_0x13f575(_0x38b507);}else{_0x2755c4();}});}else{_0x13f575(new Error(_0x8709('0x5')));}}else{_0x13f575(new Error(_0x8709('0x6')));}});});}module['exports']=function(_0x107654,_0x481ca4,_0x1db33c,_0x400735,_0x4ff32e,_0xea1a7b,_0x25ce21){var _0x1873f7=new AWS[(_0x8709('0x7'))]({'accessKeyId':_0x107654,'secretAccessKey':_0x481ca4,'region':_0x1db33c});var _0x3174ca={'Text':_0x4ff32e,'TextType':_0xea1a7b||_0x8709('0x8'),'OutputFormat':'mp3','VoiceId':_0x400735};return pollyResult(_0x1873f7,_0x3174ca,_0x25ce21);}; \ 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 b5a7faf..4c9f4cf 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ab3=['exports','./lib/api'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x7ab3,0x12f));var _0x37ab=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0x7ab3[_0x10dbf6];return _0x452147;};'use strict';var asr=require(_0x37ab('0x0'));module[_0x37ab('0x1')]=function(_0x57e687,_0x814a10,_0x1aef5,_0xb6c13a){return asr(_0x57e687,_0x814a10,_0x1aef5);}; \ No newline at end of file +var _0x1b41=['exports','./lib/api'];(function(_0x8ee32b,_0x434714){var _0x891c84=function(_0x2a0214){while(--_0x2a0214){_0x8ee32b['push'](_0x8ee32b['shift']());}};_0x891c84(++_0x434714);}(_0x1b41,0xcf));var _0x11b4=function(_0x55a89d,_0x584ea7){_0x55a89d=_0x55a89d-0x0;var _0x1b0e5a=_0x1b41[_0x55a89d];return _0x1b0e5a;};'use strict';var asr=require(_0x11b4('0x0'));module[_0x11b4('0x1')]=function(_0x104f89,_0x11bc2a,_0x1d72b6,_0x3e0623){return asr(_0x104f89,_0x11bc2a,_0x1d72b6);}; \ 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 78ecc2d..4be9bca 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 _0x765e=['toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x58b900,_0x4067f4){var _0x142565=function(_0x475ac2){while(--_0x475ac2){_0x58b900['push'](_0x58b900['shift']());}};_0x142565(++_0x4067f4);}(_0x765e,0x131));var _0xe765=function(_0x3c53b5,_0x33b46c){_0x3c53b5=_0x3c53b5-0x0;var _0xdc615a=_0x765e[_0x3c53b5];return _0xdc615a;};'use strict';var url=require(_0xe765('0x0'));var BPromise=require(_0xe765('0x1'));var fs=require('fs');var host=_0xe765('0x2');module[_0xe765('0x3')]=function(_0x375719,_0x5edaf8,_0x25f437){return new BPromise(function(_0x38d6d2,_0x30703f){var _0xd2e232;if(typeof _0x375719!==_0xe765('0x4')||_0x375719[_0xe765('0x5')]===0x0){return _0x30703f(_0xe765('0x6'));}if(typeof _0x5edaf8!==_0xe765('0x4')||_0x5edaf8[_0xe765('0x5')]===0x0){return _0x30703f('key\x20should\x20be\x20a\x20string');}if(typeof _0x25f437!==_0xe765('0x7')&&(typeof _0x25f437!==_0xe765('0x4')||_0x25f437[_0xe765('0x5')]===0x0)){return _0x30703f(_0xe765('0x8'));}try{_0xd2e232=fs[_0xe765('0x9')](_0x375719)[_0xe765('0xa')](_0xe765('0xb'));}catch(_0x53b110){return _0x30703f(_0x53b110);}return _0x38d6d2({'method':_0xe765('0xc'),'uri':host+_0xe765('0xd')+_0x5edaf8,'body':{'config':{'encoding':_0xe765('0xe'),'sampleRateHertz':'8000','languageCode':_0x25f437},'audio':{'content':_0xd2e232}},'json':!![]});});}; \ No newline at end of file +var _0x6fad=['length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string'];(function(_0x1a4c4a,_0x32312a){var _0x1118aa=function(_0x1ac78d){while(--_0x1ac78d){_0x1a4c4a['push'](_0x1a4c4a['shift']());}};_0x1118aa(++_0x32312a);}(_0x6fad,0x174));var _0xd6fa=function(_0x3f848a,_0x57e33f){_0x3f848a=_0x3f848a-0x0;var _0x504c7b=_0x6fad[_0x3f848a];return _0x504c7b;};'use strict';var url=require(_0xd6fa('0x0'));var BPromise=require(_0xd6fa('0x1'));var fs=require('fs');var host=_0xd6fa('0x2');module[_0xd6fa('0x3')]=function(_0x4f8a1c,_0x2f5f9b,_0x4ae415){return new BPromise(function(_0x3e08a3,_0x48f433){var _0x3e76d0;if(typeof _0x4f8a1c!==_0xd6fa('0x4')||_0x4f8a1c['length']===0x0){return _0x48f433(_0xd6fa('0x5'));}if(typeof _0x2f5f9b!==_0xd6fa('0x4')||_0x2f5f9b[_0xd6fa('0x6')]===0x0){return _0x48f433(_0xd6fa('0x7'));}if(typeof _0x4ae415!=='undefined'&&(typeof _0x4ae415!==_0xd6fa('0x4')||_0x4ae415['length']===0x0)){return _0x48f433(_0xd6fa('0x8'));}try{_0x3e76d0=fs[_0xd6fa('0x9')](_0x4f8a1c)[_0xd6fa('0xa')](_0xd6fa('0xb'));}catch(_0x331241){return _0x48f433(_0x331241);}return _0x3e08a3({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x2f5f9b,'body':{'config':{'encoding':_0xd6fa('0xc'),'sampleRateHertz':_0xd6fa('0xd'),'languageCode':_0x4ae415},'audio':{'content':_0x3e76d0}},'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 76dbde7..1998d04 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 _0x8a97=['./asr','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a97,0x1a8));var _0x78a9=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x8a97[_0x49ca18];return _0x145d54;};var asr=require(_0x78a9('0x0'));module[_0x78a9('0x1')]={'asr':asr}; \ No newline at end of file +var _0xbf19=['./asr','exports'];(function(_0x319a03,_0x4456d4){var _0x3b6704=function(_0x1f3476){while(--_0x1f3476){_0x319a03['push'](_0x319a03['shift']());}};_0x3b6704(++_0x4456d4);}(_0xbf19,0x1e4));var _0x9bf1=function(_0x14df51,_0x705140){_0x14df51=_0x14df51-0x0;var _0x4937f0=_0xbf19[_0x14df51];return _0x4937f0;};var asr=require(_0x9bf1('0x0'));module[_0x9bf1('0x1')]={'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 9604a90..f177938 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 _0x381f=['dialogflow','https','path','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','pipe','end','WHAT_EVER','get','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','writeFileSync','base64','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','generate','.mp3','from','audioContent','writeFile','chmodSync','.wav','then','googleCloudTTS\x20path','POST','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','info','uri','results','map','alternatives','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','status','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','transcript','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile'];(function(_0x146516,_0x469a16){var _0x20fe8a=function(_0x7b5b3f){while(--_0x7b5b3f){_0x146516['push'](_0x146516['shift']());}};_0x20fe8a(++_0x469a16);}(_0x381f,0x83));var _0xf381=function(_0x5ff6ad,_0x499e67){_0x5ff6ad=_0x5ff6ad-0x0;var _0x41afeb=_0x381f[_0x5ff6ad];return _0x41afeb;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0xf381('0x0'));var fs=require('fs');var http=require('http');var https=require(_0xf381('0x1'));var md5=require('md5');var path=require(_0xf381('0x2'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0xf381('0x3'));var sox=require(_0xf381('0x4'));var tts=require(_0xf381('0x5'));var urlParse=require('url')[_0xf381('0x6')];var util=require(_0xf381('0x7'));var aws=require(_0xf381('0x8'));var google=require(_0xf381('0x9'));var sestek=require(_0xf381('0xa'));var tilde=require(_0xf381('0xb'));var logger=require(_0xf381('0xc'))('agi');var ISPEECH_API=_0xf381('0xd');function downloadFile(_0x95317b,_0x195e79){return new BPromise(function(_0x4d23da,_0x4a1513){var _0xcfebd5=urlParse(_0x95317b);var _0x292b79=_0xcfebd5[_0xf381('0xe')]===_0xf381('0xf')?https:http;var _0x4f6a61={'host':_0xcfebd5[_0xf381('0x10')],'path':_0xcfebd5[_0xf381('0x2')],'headers':{'user-agent':'WHAT_EVER'}};_0x292b79['get'](_0x4f6a61,function(_0x465d27){if(_0x465d27[_0xf381('0x11')]!==0xc8){logger[_0xf381('0x12')]('request\x20to\x20'+_0x95317b+_0xf381('0x13')+_0x465d27[_0xf381('0x11')]+'\x20('+_0x465d27['statusMessage']+')');_0x4a1513(new Error(_0xf381('0x14')+_0x95317b+_0xf381('0x13')+_0x465d27[_0xf381('0x11')]+'\x20('+_0x465d27[_0xf381('0x15')]+')'));return;}var _0xa8aadc=fs[_0xf381('0x16')](_0x195e79);_0xa8aadc['on'](_0xf381('0x17'),function(){logger['info'](_0xf381('0x18'));_0xa8aadc[_0xf381('0x19')](_0x4d23da);});_0xa8aadc['on'](_0xf381('0x12'),function(_0x2564b3){fs[_0xf381('0x1a')](_0x195e79);logger[_0xf381('0x12')]('download\x20error',_0x2564b3);_0x4a1513(_0x2564b3);});_0x465d27[_0xf381('0x1b')](_0xa8aadc);})['on'](_0xf381('0x12'),function(_0x34f198){logger['error'](_0x34f198);_0x4a1513(_0x34f198);})[_0xf381('0x1c')]();});}function uploadFile(_0x37efcf){return new BPromise(function(_0x4da020,_0x4617fb){var _0x18d477=urlParse(_0x37efcf);var _0x4d4f82=_0x18d477[_0xf381('0xe')]===_0xf381('0xf')?https:http;var _0x5bbdbf={'host':_0x18d477[_0xf381('0x10')],'path':_0x18d477[_0xf381('0x2')],'headers':{'user-agent':_0xf381('0x1d')}};_0x4d4f82[_0xf381('0x1e')](_0x5bbdbf,function(_0x1a420){if(_0x1a420['statusCode']!==0xc8){_0x4617fb(new Error(_0xf381('0x14')+_0x37efcf+'\x20failed,\x20status\x20code\x20=\x20'+_0x1a420['statusCode']+'\x20('+_0x1a420[_0xf381('0x15')]+')'));return;}var _0xd8e311='';_0x1a420['on'](_0xf381('0x1f'),function(_0xd5a99){_0xd8e311+=_0xd5a99;});_0x1a420['on'](_0xf381('0x1c'),function(){_0x4da020(_0xd8e311);});})['on'](_0xf381('0x12'),function(_0x3584c6){_0x4617fb(_0x3584c6);})[_0xf381('0x1c')]();});}function convertFile(_0x417588,_0x24a904){return new BPromise(function(_0x4202dd,_0x522139){var _0x2e294f=sox[_0xf381('0x20')](_0x417588,_0x24a904,{'sampleRate':0x1f40,'format':_0xf381('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2e294f['on'](_0xf381('0x12'),function(_0x4b430e){logger[_0xf381('0x12')](_0xf381('0x22'),_0x4b430e);_0x522139(_0x4b430e);});_0x2e294f['on'](_0xf381('0x1c'),function(){logger['info'](_0xf381('0x23'));_0x4202dd();});_0x2e294f[_0xf381('0x24')]();});}function base64Decode(_0x55cf82,_0xa647b9){var _0x407e92=path[_0xf381('0x25')](__dirname,_0xf381('0x26'),rs['generate'](0x4)+'.wav');fs[_0xf381('0x27')](_0x407e92,_0x55cf82,_0xf381('0x28'));return convertFile(_0x407e92,_0xa647b9)['then'](function(){try{fs[_0xf381('0x1a')](_0x407e92);fs['chmodSync'](_0xa647b9,_0xf381('0x29'));}catch(_0x20bf04){logger[_0xf381('0x12')](_0x20bf04);}return _0xa647b9[_0xf381('0x2a')]('.')[0x0];});}function base64Encode(_0x50e8c7){var _0x2e5b3a=fs[_0xf381('0x2b')](_0x50e8c7);return new Buffer(_0x2e5b3a)[_0xf381('0x2c')](_0xf381('0x28'));}exports[_0xf381('0x2d')]=function(_0x7e6ead,_0x599564,_0x3190b5,_0x25d51a,_0x160820,_0x48bdf1){var _0x62d71,_0x11b2b0;var _0x4021c0=_0xf381('0x2e');var _0x55049f=_0xf381('0x2f')+_0x7e6ead;var _0x8fd772={};if(_0x599564===_0xf381('0x30')){_0x8fd772[_0xf381('0x31')]={'ssml':_0x3190b5};}else{_0x8fd772[_0xf381('0x31')]={'text':_0x3190b5};};_0x8fd772['voice']={'languageCode':_0x25d51a,'ssmlGender':_0x160820};_0x8fd772['audioConfig']={'audioEncoding':_0xf381('0x32'),'sampleRateHertz':0x1f40};var _0x17d4f8={'url':_0x4021c0+'text:synthesize'+_0x55049f,'method':'POST','json':!![],'body':_0x8fd772};return rp(_0x17d4f8)['then'](function(_0x388e95){return new BPromise(function(_0x34656d,_0xb42d43){_0x62d71=path[_0xf381('0x25')](__dirname,'tmp',rs[_0xf381('0x33')](0x4)+_0xf381('0x34'));var _0x25feeb=Buffer[_0xf381('0x35')](_0x388e95[_0xf381('0x36')],_0xf381('0x28'));return fs[_0xf381('0x37')](_0x62d71,_0x25feeb,function(_0x2210c0){_0xb42d43(_0x2210c0);},function(_0x2a8195){fs[_0xf381('0x38')](_0x62d71,_0xf381('0x29'));_0x34656d(_0x2a8195);});});})['then'](function(_0x3887eb){_0x11b2b0=path[_0xf381('0x25')](__dirname,_0xf381('0x26'),rs[_0xf381('0x33')](0x4)+_0xf381('0x39'));return convertFile(_0x62d71,_0x11b2b0);})[_0xf381('0x3a')](function(){try{fs[_0xf381('0x1a')](_0x62d71);fs[_0xf381('0x38')](_0x11b2b0,'777');}catch(_0x1cf17b){logger[_0xf381('0x12')](_0x1cf17b);}logger['info'](_0xf381('0x3b'),_0x11b2b0['split']('.')[0x0]);return _0x11b2b0['split']('.')[0x0];});};exports['googleTTS']=function(_0x14d398,_0x5d20a9){var _0x36f145='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x39f7a7,_0x3f7974;var _0x40d617;var _0x34db0e={'encoding':'utf8','method':_0xf381('0x3c'),'timeout':0x2710,'url':_0x36f145,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xf381('0x3d')+encodeURIComponent(JSON[_0xf381('0x3e')]([[[_0xf381('0x3f'),JSON[_0xf381('0x3e')]([_0x14d398,_0x5d20a9||'en',![],_0xf381('0x40')]),null,_0xf381('0x41')]]]))};return rp(_0x34db0e)['then'](function(_0x4723cc){try{_0x40d617=eval(_0x4723cc['slice'](0x5))[0x0][0x2];}catch(_0xd646ce){throw new Error(_0xf381('0x42')+_0x4723cc['data']);}if(!_0x40d617){if(_0x14d398[_0xf381('0x43')]>0xc8){throw new Error(_0xf381('0x44'));}else{throw new Error(_0xf381('0x45')+_0x5d20a9+_0xf381('0x46'));}}try{_0x40d617=eval(_0x40d617)[0x0];}catch(_0x4f3d81){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xf381('0x1f')]);}const _0x1ba658=_0x40d617;_0x39f7a7=path[_0xf381('0x25')](__dirname,'tmp',rs[_0xf381('0x33')](0x4)+'.mp3');fs[_0xf381('0x27')](_0x39f7a7,_0x40d617,{'encoding':_0xf381('0x28')});_0x3f7974=path['resolve'](__dirname,_0xf381('0x26'),rs[_0xf381('0x33')](0x4)+'.wav');return convertFile(_0x39f7a7,_0x3f7974);})[_0xf381('0x3a')](function(){try{fs[_0xf381('0x1a')](_0x39f7a7);fs[_0xf381('0x38')](_0x3f7974,_0xf381('0x29'));}catch(_0x403199){logger[_0xf381('0x12')](_0x403199);}logger['info'](_0xf381('0x47'),_0x3f7974[_0xf381('0x2a')]('.')[0x0]);return _0x3f7974[_0xf381('0x2a')]('.')[0x0];});};exports[_0xf381('0x48')]=function(_0x4550e2,_0x14f7b1,_0x7b377c){return google['asr'](_0x4550e2,_0x14f7b1,_0x7b377c)[_0xf381('0x3a')](function(_0x4d8276){logger[_0xf381('0x49')](_0x4d8276[_0xf381('0x4a')]);return rp(_0x4d8276);})[_0xf381('0x3a')](function(_0x313d55){var _0x56be36='';var _0x1cff5b=0x0;try{fs['unlink'](_0x4550e2);}catch(_0x924aee){logger[_0xf381('0x12')](_0x924aee);}if(_0x313d55&&_0x313d55[_0xf381('0x4b')]){_0x56be36=_0x313d55['results'][_0xf381('0x4c')](function(_0x3d19f1){return _0x3d19f1&&_0x3d19f1['alternatives'][0x0]&&_0x3d19f1[_0xf381('0x4d')][0x0]['transcript']?_0x3d19f1[_0xf381('0x4d')][0x0]['transcript']:'';})['join']('\x0a');_0x1cff5b=_0x313d55[_0xf381('0x4b')]['map'](function(_0x396695){return _0x396695&&_0x396695[_0xf381('0x4d')][0x0]&&_0x396695[_0xf381('0x4d')][0x0][_0xf381('0x4e')]?_0x396695[_0xf381('0x4d')][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0xf381('0x49')](_0xf381('0x4f'),_0x56be36);logger[_0xf381('0x49')](_0xf381('0x50'),_0x1cff5b);return{'transcript':_0x56be36,'confidence':_0x1cff5b};})[_0xf381('0x51')](function(_0x58c9bd){logger['error']('[%s]\x20%s:%s',_0x58c9bd[_0xf381('0x11')],_0x58c9bd['name'],_0x58c9bd[_0xf381('0x52')]);});};exports[_0xf381('0x53')]=function(_0x40d664,_0x18891a,_0x374263,_0x15426a){var _0x2fa8a7=apiai(_0x18891a,{'language':_0x15426a||'en'});return _0x2fa8a7[_0xf381('0x54')](_0x374263,{'sessionId':md5(_0x40d664)})[_0xf381('0x3a')](function(_0x3d28fb){logger[_0xf381('0x49')](JSON[_0xf381('0x3e')](_0x3d28fb));return{'source':_0x3d28fb[_0xf381('0x55')]['source'],'resolvedQuery':_0x3d28fb[_0xf381('0x55')][_0xf381('0x56')],'action':_0x3d28fb[_0xf381('0x55')][_0xf381('0x57')],'actionIncomplete':_0x3d28fb['result'][_0xf381('0x58')],'speech':_0x3d28fb[_0xf381('0x55')][_0xf381('0x59')]['speech'],'score':_0x3d28fb['result']['score'],'statusCode':_0x3d28fb[_0xf381('0x5a')]['code'],'endConversation':_0x3d28fb[_0xf381('0x55')][_0xf381('0x5b')]['endConversation']||![],'isFallbackIntent':_0x3d28fb['result'][_0xf381('0x5b')]['isFallbackIntent']};});};exports[_0xf381('0x5c')]=function(_0x12f7ec,_0x4d22dc,_0x3a65f7,_0x409f61,_0x2f1aff,_0xbf4b8a){var _0x53a475=_0x409f61[_0xf381('0x5d')](/\\n/g,'\x0a');var _0xa41390={'credentials':{'private_key':_0x53a475,'client_email':_0x3a65f7}};var _0x15a2b8=new dialogflow[(_0xf381('0x5e'))](_0xa41390);var _0x1fe3bb=_0x15a2b8[_0xf381('0x5f')](_0x4d22dc,md5(_0x12f7ec));var _0x2d8f0b={'session':_0x1fe3bb,'queryInput':{'text':{'text':_0x2f1aff,'languageCode':_0xbf4b8a}}};return _0x15a2b8['detectIntent'](_0x2d8f0b)['then'](function(_0x2a03df){if(_0x2a03df&&_0x2a03df[_0xf381('0x43')]){logger[_0xf381('0x49')](_0xf381('0x60'),JSON[_0xf381('0x3e')](_0x2a03df));var _0x3431a5=_0x2a03df[0x0];if(_0x3431a5){var _0x45e3c2={'action':_0x3431a5['queryResult']['action'],'allRequiredParamsPresent':_0x3431a5[_0xf381('0x61')][_0xf381('0x62')],'endConversation':_0x3431a5[_0xf381('0x61')]['diagnosticInfo']&&_0x3431a5['queryResult'][_0xf381('0x63')][_0xf381('0x64')]?_0x3431a5[_0xf381('0x61')]['diagnosticInfo'][_0xf381('0x64')][_0xf381('0x65')][_0xf381('0x66')]:![],'fulfillmentText':_0x3431a5[_0xf381('0x61')][_0xf381('0x67')],'intentName':_0x3431a5[_0xf381('0x61')][_0xf381('0x68')][_0xf381('0x69')],'intentDisplayName':_0x3431a5[_0xf381('0x61')]['intent'][_0xf381('0x6a')],'isFallbackIntent':_0x3431a5[_0xf381('0x61')][_0xf381('0x68')][_0xf381('0x6b')],'languageCode':_0x3431a5[_0xf381('0x61')][_0xf381('0x6c')],'queryText':_0x3431a5['queryResult'][_0xf381('0x6d')],'responseId':_0x3431a5[_0xf381('0x6e')],'score':_0x3431a5[_0xf381('0x61')][_0xf381('0x6f')],'speech':_0x3431a5['queryResult'][_0xf381('0x67')],'providerResponse':JSON[_0xf381('0x3e')](_0x2a03df)};return _0x45e3c2;}}});};exports['tildeASR']=function(_0xf44688,_0x23d0d4,_0xbd1f90,_0x4c253f){return tilde['asr'](_0xf44688,_0x23d0d4,_0xbd1f90,_0x4c253f)[_0xf381('0x3a')](function(_0x32b346){try{fs[_0xf381('0x1a')](_0xf44688);}catch(_0x5e5bce){logger[_0xf381('0x12')](_0x5e5bce);}logger[_0xf381('0x49')]('Tilde\x20ASR\x20transcription',_0x32b346[_0xf381('0x70')]);logger[_0xf381('0x49')]('Tilde\x20ASR\x20confidence',_0x32b346['confidence']);return _0x32b346;});};exports[_0xf381('0x71')]=function(_0x2cd9de,_0x5ce31c,_0x4347e,_0x555c9c,_0x5a49e2,_0xcd2078){var _0x5287a7=path[_0xf381('0x25')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x5537f2;return aws[_0xf381('0x72')](_0x2cd9de,_0x5ce31c,_0x4347e,_0x555c9c,_0x5a49e2,_0xcd2078,_0x5287a7)['then'](function(){_0x5537f2=path['resolve'](__dirname,'tmp',rs[_0xf381('0x33')](0x4)+'.wav');return convertFile(_0x5287a7,_0x5537f2);})[_0xf381('0x3a')](function(){try{fs[_0xf381('0x1a')](_0x5287a7);fs[_0xf381('0x38')](_0x5537f2,_0xf381('0x29'));}catch(_0x24facf){logger[_0xf381('0x12')](_0x24facf);}return _0x5537f2[_0xf381('0x2a')]('.')[0x0];});};exports[_0xf381('0x73')]=function(_0x1bc89d,_0x1356e1,_0x5a0b54,_0x4fceb8,_0x2cf08f,_0xeb103e){return aws[_0xf381('0x74')](_0x1bc89d,_0x1356e1,_0x5a0b54,_0x4fceb8,_0x2cf08f,_0xeb103e)['then'](function(_0x51f198){logger[_0xf381('0x49')](JSON[_0xf381('0x3e')](_0x51f198));return _0x51f198;});};exports[_0xf381('0x75')]=function(_0x63e9bf,_0x545682,_0x11c474,_0x14baf6){var _0x586fd5=util[_0xf381('0x76')](_0xf381('0x77'),ISPEECH_API,_0x63e9bf,encodeURIComponent(_0x545682),_0x11c474,_0x14baf6);var _0x38bef3=path['resolve'](__dirname,_0xf381('0x26'),rs[_0xf381('0x33')](0x4)+_0xf381('0x34'));var _0xb3d64f;return downloadFile(_0x586fd5,_0x38bef3)[_0xf381('0x3a')](function(){_0xb3d64f=path['resolve'](__dirname,_0xf381('0x26'),rs[_0xf381('0x33')](0x4)+_0xf381('0x39'));return convertFile(_0x38bef3,_0xb3d64f);})[_0xf381('0x3a')](function(){try{fs[_0xf381('0x1a')](_0x38bef3);fs[_0xf381('0x38')](_0xb3d64f,_0xf381('0x29'));}catch(_0x3b0804){logger[_0xf381('0x12')](_0x3b0804);}return _0xb3d64f[_0xf381('0x2a')]('.')[0x0];});};exports[_0xf381('0x78')]=function(_0x380c39,_0x115ccf,_0x1a0158,_0x6ef598){var _0x29cbd8=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x115ccf,_0x1a0158,base64Encode(_0x380c39),_0x6ef598?util['format'](_0xf381('0x79'),encodeURIComponent(_0x6ef598)):_0xf381('0x7a'));return uploadFile(_0x29cbd8)[_0xf381('0x3a')](function(_0x400c3c){return querystring[_0xf381('0x6')](_0x400c3c);});};exports[_0xf381('0x7b')]=function(_0x4db252,_0x122343){return sestek[_0xf381('0x7c')](_0x4db252,_0x122343)[_0xf381('0x3a')](function(_0x9e6e3a){logger[_0xf381('0x49')](JSON['stringify'](_0x9e6e3a));var _0x8ea6ae={'speech':_0x9e6e3a[_0xf381('0x7d')],'action':_0x9e6e3a[_0xf381('0x7e')]?_0x9e6e3a['channelData'][_0xf381('0x7f')]:undefined,'actiondata':_0x9e6e3a[_0xf381('0x7e')]?_0x9e6e3a['channelData'][_0xf381('0x80')]:undefined};if(_0x9e6e3a['channelData']&&_0x9e6e3a[_0xf381('0x7e')][_0xf381('0x81')]){return base64Decode(_0x9e6e3a[_0xf381('0x7e')]['AudioFromTts']['Data'],path[_0xf381('0x25')](__dirname,_0xf381('0x26'),rs[_0xf381('0x33')](0x4)+_0xf381('0x39')))['then'](function(_0x4f5eb6){_0x8ea6ae[_0xf381('0x82')]=_0x4f5eb6;return _0x8ea6ae;});}return _0x8ea6ae;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xd925=['https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','statusCode','data','transcode','wav','error\x20convert','finish\x20to\x20convert','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','resolve','tmp','audioContent','googleTTS','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','.mp3','goggleTTS\x20path','googleASR','results','alternatives','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','queryText','tildeASR','asr','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','nda','channelData','CustomActionData','AudioFromTts','.wav','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','agi'];(function(_0x466507,_0x62475b){var _0xf766db=function(_0x531243){while(--_0x531243){_0x466507['push'](_0x466507['shift']());}};_0xf766db(++_0x62475b);}(_0xd925,0x16a));var _0x5d92=function(_0x155f35,_0x9d54f7){_0x155f35=_0x155f35-0x0;var _0x38e884=_0xd925[_0x155f35];return _0x38e884;};'use strict';var apiai=require(_0x5d92('0x0'));var BPromise=require(_0x5d92('0x1'));var dialogflow=require(_0x5d92('0x2'));var fs=require('fs');var http=require(_0x5d92('0x3'));var https=require('https');var md5=require(_0x5d92('0x4'));var path=require(_0x5d92('0x5'));var querystring=require('querystring');var rp=require(_0x5d92('0x6'));var rs=require(_0x5d92('0x7'));var sox=require(_0x5d92('0x8'));var tts=require(_0x5d92('0x9'));var urlParse=require(_0x5d92('0xa'))[_0x5d92('0xb')];var util=require(_0x5d92('0xc'));var aws=require(_0x5d92('0xd'));var google=require('./google');var sestek=require(_0x5d92('0xe'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x5d92('0xf'));var ISPEECH_API=_0x5d92('0x10');function downloadFile(_0x5e3dee,_0x4c6585){return new BPromise(function(_0x4e995b,_0x2f441a){var _0x5edfed=urlParse(_0x5e3dee);var _0x5d25be=_0x5edfed[_0x5d92('0x11')]===_0x5d92('0x12')?https:http;var _0x58a41d={'host':_0x5edfed['host'],'path':_0x5edfed[_0x5d92('0x5')],'headers':{'user-agent':_0x5d92('0x13')}};_0x5d25be[_0x5d92('0x14')](_0x58a41d,function(_0x4a8fb0){if(_0x4a8fb0['statusCode']!==0xc8){logger[_0x5d92('0x15')](_0x5d92('0x16')+_0x5e3dee+_0x5d92('0x17')+_0x4a8fb0['statusCode']+'\x20('+_0x4a8fb0[_0x5d92('0x18')]+')');_0x2f441a(new Error(_0x5d92('0x16')+_0x5e3dee+'\x20failed,\x20status\x20code\x20=\x20'+_0x4a8fb0['statusCode']+'\x20('+_0x4a8fb0[_0x5d92('0x18')]+')'));return;}var _0x2ea333=fs[_0x5d92('0x19')](_0x4c6585);_0x2ea333['on'](_0x5d92('0x1a'),function(){logger[_0x5d92('0x1b')](_0x5d92('0x1c'));_0x2ea333[_0x5d92('0x1d')](_0x4e995b);});_0x2ea333['on'](_0x5d92('0x15'),function(_0x6e4fb0){fs[_0x5d92('0x1e')](_0x4c6585);logger[_0x5d92('0x15')](_0x5d92('0x1f'),_0x6e4fb0);_0x2f441a(_0x6e4fb0);});_0x4a8fb0[_0x5d92('0x20')](_0x2ea333);})['on'](_0x5d92('0x15'),function(_0x513d60){logger['error'](_0x513d60);_0x2f441a(_0x513d60);})[_0x5d92('0x21')]();});}function uploadFile(_0x4d5678){return new BPromise(function(_0x2e4f20,_0x4d2f3d){var _0x180be1=urlParse(_0x4d5678);var _0x442bea=_0x180be1[_0x5d92('0x11')]===_0x5d92('0x12')?https:http;var _0x5d8ac4={'host':_0x180be1['host'],'path':_0x180be1[_0x5d92('0x5')],'headers':{'user-agent':_0x5d92('0x13')}};_0x442bea[_0x5d92('0x14')](_0x5d8ac4,function(_0x5d05eb){if(_0x5d05eb[_0x5d92('0x22')]!==0xc8){_0x4d2f3d(new Error(_0x5d92('0x16')+_0x4d5678+_0x5d92('0x17')+_0x5d05eb[_0x5d92('0x22')]+'\x20('+_0x5d05eb[_0x5d92('0x18')]+')'));return;}var _0x44d8eb='';_0x5d05eb['on'](_0x5d92('0x23'),function(_0x2dc1ec){_0x44d8eb+=_0x2dc1ec;});_0x5d05eb['on']('end',function(){_0x2e4f20(_0x44d8eb);});})['on'](_0x5d92('0x15'),function(_0x43eebd){_0x4d2f3d(_0x43eebd);})[_0x5d92('0x21')]();});}function convertFile(_0x1ceca7,_0x436187){return new BPromise(function(_0x16066f,_0x302495){var _0x3f1648=sox[_0x5d92('0x24')](_0x1ceca7,_0x436187,{'sampleRate':0x1f40,'format':_0x5d92('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3f1648['on']('error',function(_0x3b32ad){logger['error'](_0x5d92('0x26'),_0x3b32ad);_0x302495(_0x3b32ad);});_0x3f1648['on'](_0x5d92('0x21'),function(){logger[_0x5d92('0x1b')](_0x5d92('0x27'));_0x16066f();});_0x3f1648['start']();});}function base64Decode(_0x42a6f2,_0x3cb7f2){var _0x2a5e72=path['resolve'](__dirname,'tmp',rs[_0x5d92('0x28')](0x4)+'.wav');fs[_0x5d92('0x29')](_0x2a5e72,_0x42a6f2,_0x5d92('0x2a'));return convertFile(_0x2a5e72,_0x3cb7f2)[_0x5d92('0x2b')](function(){try{fs['unlink'](_0x2a5e72);fs[_0x5d92('0x2c')](_0x3cb7f2,_0x5d92('0x2d'));}catch(_0x2dc287){logger[_0x5d92('0x15')](_0x2dc287);}return _0x3cb7f2[_0x5d92('0x2e')]('.')[0x0];});}function base64Encode(_0x21d0d4){var _0x178013=fs[_0x5d92('0x2f')](_0x21d0d4);return new Buffer(_0x178013)['toString']('base64');}exports['googleCloudTTS']=function(_0x109c77,_0x59dfea,_0x4bd739,_0x4f7668,_0x547593,_0x31bdec){var _0x5480b6,_0x3e422d;var _0x28eec7=_0x5d92('0x30');var _0x46f75a=_0x5d92('0x31')+_0x109c77;var _0x28ac8f={};if(_0x59dfea===_0x5d92('0x32')){_0x28ac8f['input']={'ssml':_0x4bd739};}else{_0x28ac8f[_0x5d92('0x33')]={'text':_0x4bd739};};_0x28ac8f['voice']={'languageCode':_0x4f7668,'ssmlGender':_0x547593};_0x28ac8f[_0x5d92('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x493e18={'url':_0x28eec7+_0x5d92('0x35')+_0x46f75a,'method':'POST','json':!![],'body':_0x28ac8f};return rp(_0x493e18)[_0x5d92('0x2b')](function(_0x2195cb){return new BPromise(function(_0x3cf199,_0x46e8fe){_0x5480b6=path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs[_0x5d92('0x28')](0x4)+'.mp3');var _0x52f6e7=Buffer['from'](_0x2195cb[_0x5d92('0x38')],_0x5d92('0x2a'));return fs['writeFile'](_0x5480b6,_0x52f6e7,function(_0x28b163){_0x46e8fe(_0x28b163);},function(_0x1d2474){fs[_0x5d92('0x2c')](_0x5480b6,'777');_0x3cf199(_0x1d2474);});});})[_0x5d92('0x2b')](function(_0x4502f7){_0x3e422d=path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs['generate'](0x4)+'.wav');return convertFile(_0x5480b6,_0x3e422d);})[_0x5d92('0x2b')](function(){try{fs['unlink'](_0x5480b6);fs[_0x5d92('0x2c')](_0x3e422d,_0x5d92('0x2d'));}catch(_0x37280d){logger[_0x5d92('0x15')](_0x37280d);}logger[_0x5d92('0x1b')]('googleCloudTTS\x20path',_0x3e422d[_0x5d92('0x2e')]('.')[0x0]);return _0x3e422d['split']('.')[0x0];});};exports[_0x5d92('0x39')]=function(_0x3b41cf,_0x5b2fc9){var _0x14a4ce='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x54e824,_0x3e439e;var _0x449d9e;var _0x4fcab7={'encoding':'utf8','method':_0x5d92('0x3a'),'timeout':0x2710,'url':_0x14a4ce,'headers':{'Content-Type':_0x5d92('0x3b')},'body':_0x5d92('0x3c')+encodeURIComponent(JSON[_0x5d92('0x3d')]([[[_0x5d92('0x3e'),JSON[_0x5d92('0x3d')]([_0x3b41cf,_0x5b2fc9||'en',![],_0x5d92('0x3f')]),null,_0x5d92('0x40')]]]))};return rp(_0x4fcab7)[_0x5d92('0x2b')](function(_0x57c77b){try{_0x449d9e=eval(_0x57c77b[_0x5d92('0x41')](0x5))[0x0][0x2];}catch(_0x3cb21){throw new Error(_0x5d92('0x42')+_0x57c77b[_0x5d92('0x23')]);}if(!_0x449d9e){if(_0x3b41cf[_0x5d92('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x5d92('0x44')+_0x5b2fc9+'\x22\x20might\x20not\x20exist');}}try{_0x449d9e=eval(_0x449d9e)[0x0];}catch(_0x1782ae){throw new Error(_0x5d92('0x42')+res[_0x5d92('0x23')]);}const _0x2184f0=_0x449d9e;_0x54e824=path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs['generate'](0x4)+_0x5d92('0x45'));fs[_0x5d92('0x29')](_0x54e824,_0x449d9e,{'encoding':_0x5d92('0x2a')});_0x3e439e=path['resolve'](__dirname,_0x5d92('0x37'),rs[_0x5d92('0x28')](0x4)+'.wav');return convertFile(_0x54e824,_0x3e439e);})[_0x5d92('0x2b')](function(){try{fs[_0x5d92('0x1e')](_0x54e824);fs[_0x5d92('0x2c')](_0x3e439e,_0x5d92('0x2d'));}catch(_0x51a198){logger['error'](_0x51a198);}logger['info'](_0x5d92('0x46'),_0x3e439e[_0x5d92('0x2e')]('.')[0x0]);return _0x3e439e[_0x5d92('0x2e')]('.')[0x0];});};exports[_0x5d92('0x47')]=function(_0x3bcc06,_0x4fdd0b,_0x429812){return google['asr'](_0x3bcc06,_0x4fdd0b,_0x429812)[_0x5d92('0x2b')](function(_0x5d36bc){logger[_0x5d92('0x1b')](_0x5d36bc['uri']);return rp(_0x5d36bc);})[_0x5d92('0x2b')](function(_0x5cfc8c){var _0x390cc1='';var _0x4c7690=0x0;try{fs[_0x5d92('0x1e')](_0x3bcc06);}catch(_0x30ff5b){logger[_0x5d92('0x15')](_0x30ff5b);}if(_0x5cfc8c&&_0x5cfc8c[_0x5d92('0x48')]){_0x390cc1=_0x5cfc8c[_0x5d92('0x48')]['map'](function(_0xc0912a){return _0xc0912a&&_0xc0912a[_0x5d92('0x49')][0x0]&&_0xc0912a[_0x5d92('0x49')][0x0]['transcript']?_0xc0912a[_0x5d92('0x49')][0x0]['transcript']:'';})[_0x5d92('0x4a')]('\x0a');_0x4c7690=_0x5cfc8c[_0x5d92('0x48')]['map'](function(_0x5961fd){return _0x5961fd&&_0x5961fd[_0x5d92('0x49')][0x0]&&_0x5961fd[_0x5d92('0x49')][0x0][_0x5d92('0x4b')]?_0x5961fd[_0x5d92('0x49')][0x0][_0x5d92('0x4b')]:0x0;})[_0x5d92('0x4a')]('\x0a');}logger[_0x5d92('0x1b')](_0x5d92('0x4c'),_0x390cc1);logger[_0x5d92('0x1b')](_0x5d92('0x4d'),_0x4c7690);return{'transcript':_0x390cc1,'confidence':_0x4c7690};})[_0x5d92('0x4e')](function(_0xd10f8b){logger[_0x5d92('0x15')](_0x5d92('0x4f'),_0xd10f8b[_0x5d92('0x22')],_0xd10f8b[_0x5d92('0x50')],_0xd10f8b['message']);});};exports['googleDialogflow']=function(_0x39a2b8,_0x473fa6,_0x175ff5,_0x1d4659){var _0x362d22=apiai(_0x473fa6,{'language':_0x1d4659||'en'});return _0x362d22[_0x5d92('0x51')](_0x175ff5,{'sessionId':md5(_0x39a2b8)})[_0x5d92('0x2b')](function(_0x5a6709){logger[_0x5d92('0x1b')](JSON[_0x5d92('0x3d')](_0x5a6709));return{'source':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x53')],'resolvedQuery':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x54')],'action':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x55')],'actionIncomplete':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x56')],'speech':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x57')]['speech'],'score':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x58')],'statusCode':_0x5a6709[_0x5d92('0x59')][_0x5d92('0x5a')],'endConversation':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x5b')][_0x5d92('0x5c')]||![],'isFallbackIntent':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x5b')][_0x5d92('0x5d')]};});};exports['googleDialogflowV2']=function(_0xc81b20,_0x3f9a9a,_0x3c0202,_0x5db1a4,_0x365dbb,_0x2f6462){var _0x517100=_0x5db1a4['replace'](/\\n/g,'\x0a');var _0x53fc23={'credentials':{'private_key':_0x517100,'client_email':_0x3c0202}};var _0x1dd951=new dialogflow['SessionsClient'](_0x53fc23);var _0x432bf4=_0x1dd951[_0x5d92('0x5e')](_0x3f9a9a,md5(_0xc81b20));var _0x4f583d={'session':_0x432bf4,'queryInput':{'text':{'text':_0x365dbb,'languageCode':_0x2f6462}}};return _0x1dd951[_0x5d92('0x5f')](_0x4f583d)[_0x5d92('0x2b')](function(_0x265c23){if(_0x265c23&&_0x265c23[_0x5d92('0x43')]){logger[_0x5d92('0x1b')](_0x5d92('0x60'),JSON['stringify'](_0x265c23));var _0x773a52=_0x265c23[0x0];if(_0x773a52){var _0x54e128={'action':_0x773a52[_0x5d92('0x61')]['action'],'allRequiredParamsPresent':_0x773a52[_0x5d92('0x61')]['allRequiredParamsPresent'],'endConversation':_0x773a52[_0x5d92('0x61')][_0x5d92('0x62')]&&_0x773a52['queryResult'][_0x5d92('0x62')][_0x5d92('0x63')]?_0x773a52[_0x5d92('0x61')][_0x5d92('0x62')][_0x5d92('0x63')][_0x5d92('0x64')]['boolValue']:![],'fulfillmentText':_0x773a52[_0x5d92('0x61')][_0x5d92('0x65')],'intentName':_0x773a52['queryResult'][_0x5d92('0x66')]['name'],'intentDisplayName':_0x773a52[_0x5d92('0x61')][_0x5d92('0x66')][_0x5d92('0x67')],'isFallbackIntent':_0x773a52[_0x5d92('0x61')][_0x5d92('0x66')][_0x5d92('0x68')],'languageCode':_0x773a52[_0x5d92('0x61')]['languageCode'],'queryText':_0x773a52[_0x5d92('0x61')][_0x5d92('0x69')],'responseId':_0x773a52['responseId'],'score':_0x773a52[_0x5d92('0x61')]['intentDetectionConfidence'],'speech':_0x773a52['queryResult'][_0x5d92('0x65')],'providerResponse':JSON[_0x5d92('0x3d')](_0x265c23)};return _0x54e128;}}});};exports[_0x5d92('0x6a')]=function(_0x312419,_0x1e8f52,_0x5e253b,_0x415b95){return tilde[_0x5d92('0x6b')](_0x312419,_0x1e8f52,_0x5e253b,_0x415b95)['then'](function(_0x56b964){try{fs['unlink'](_0x312419);}catch(_0x48095d){logger[_0x5d92('0x15')](_0x48095d);}logger[_0x5d92('0x1b')]('Tilde\x20ASR\x20transcription',_0x56b964[_0x5d92('0x6c')]);logger[_0x5d92('0x1b')](_0x5d92('0x6d'),_0x56b964[_0x5d92('0x4b')]);return _0x56b964;});};exports[_0x5d92('0x6e')]=function(_0x57dbd2,_0x5edbee,_0x50e92b,_0x3a7f40,_0x2d1d74,_0x377358){var _0x201de2=path[_0x5d92('0x36')](__dirname,'tmp',rs[_0x5d92('0x28')](0x4)+_0x5d92('0x45'));var _0xe0b9a7;return aws[_0x5d92('0x6f')](_0x57dbd2,_0x5edbee,_0x50e92b,_0x3a7f40,_0x2d1d74,_0x377358,_0x201de2)['then'](function(){_0xe0b9a7=path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs['generate'](0x4)+'.wav');return convertFile(_0x201de2,_0xe0b9a7);})[_0x5d92('0x2b')](function(){try{fs['unlink'](_0x201de2);fs[_0x5d92('0x2c')](_0xe0b9a7,'777');}catch(_0x55eaa5){logger[_0x5d92('0x15')](_0x55eaa5);}return _0xe0b9a7[_0x5d92('0x2e')]('.')[0x0];});};exports[_0x5d92('0x70')]=function(_0xc2025a,_0x41752f,_0x4a9331,_0x5d7757,_0x3cdae7,_0x41f2c6){return aws[_0x5d92('0x71')](_0xc2025a,_0x41752f,_0x4a9331,_0x5d7757,_0x3cdae7,_0x41f2c6)[_0x5d92('0x2b')](function(_0x5337fe){logger[_0x5d92('0x1b')](JSON[_0x5d92('0x3d')](_0x5337fe));return _0x5337fe;});};exports[_0x5d92('0x72')]=function(_0x241cda,_0x32a7b3,_0x3d9395,_0x5a062e){var _0x3ddccc=util[_0x5d92('0x73')](_0x5d92('0x74'),ISPEECH_API,_0x241cda,encodeURIComponent(_0x32a7b3),_0x3d9395,_0x5a062e);var _0xef2826=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x5d92('0x45'));var _0x48eb36;return downloadFile(_0x3ddccc,_0xef2826)[_0x5d92('0x2b')](function(){_0x48eb36=path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs['generate'](0x4)+'.wav');return convertFile(_0xef2826,_0x48eb36);})[_0x5d92('0x2b')](function(){try{fs[_0x5d92('0x1e')](_0xef2826);fs['chmodSync'](_0x48eb36,'777');}catch(_0x5c31ee){logger['error'](_0x5c31ee);}return _0x48eb36[_0x5d92('0x2e')]('.')[0x0];});};exports['ispeechASR']=function(_0x5c4821,_0x4dbc38,_0x177b29,_0x4721c1){var _0xc18d7d=util[_0x5d92('0x73')](_0x5d92('0x75'),ISPEECH_API,_0x4dbc38,_0x177b29,base64Encode(_0x5c4821),_0x4721c1?util[_0x5d92('0x73')]('model=%s',encodeURIComponent(_0x4721c1)):_0x5d92('0x76'));return uploadFile(_0xc18d7d)['then'](function(_0x33f057){return querystring[_0x5d92('0xb')](_0x33f057);});};exports['sestekNDA']=function(_0x607465,_0x321e96){return sestek[_0x5d92('0x77')](_0x607465,_0x321e96)[_0x5d92('0x2b')](function(_0x5bfc36){logger['info'](JSON[_0x5d92('0x3d')](_0x5bfc36));var _0x1d591b={'speech':_0x5bfc36['text'],'action':_0x5bfc36[_0x5d92('0x78')]?_0x5bfc36[_0x5d92('0x78')]['CustomAction']:undefined,'actiondata':_0x5bfc36[_0x5d92('0x78')]?_0x5bfc36[_0x5d92('0x78')][_0x5d92('0x79')]:undefined};if(_0x5bfc36[_0x5d92('0x78')]&&_0x5bfc36['channelData'][_0x5d92('0x7a')]){return base64Decode(_0x5bfc36[_0x5d92('0x78')][_0x5d92('0x7a')]['Data'],path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs[_0x5d92('0x28')](0x4)+_0x5d92('0x7b')))['then'](function(_0x2bbdb8){_0x1d591b[_0x5d92('0x7c')]=_0x2bbdb8;return _0x1d591b;});}return _0x1d591b;});};exports[_0x5d92('0x7d')]=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 f34544b..8f34e03 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 _0x2bef=['./nda','exports'];(function(_0x2e5385,_0x174b1a){var _0x5c5f30=function(_0x51a3c8){while(--_0x51a3c8){_0x2e5385['push'](_0x2e5385['shift']());}};_0x5c5f30(++_0x174b1a);}(_0x2bef,0x194));var _0xf2be=function(_0x54f060,_0x1de751){_0x54f060=_0x54f060-0x0;var _0xb2b587=_0x2bef[_0x54f060];return _0xb2b587;};var nda=require(_0xf2be('0x0'));module[_0xf2be('0x1')]={'nda':nda}; \ No newline at end of file +var nda=require('./nda');module['exports']={'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 1364383..9546233 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 _0x1a9e=['ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','exports','POST','ndauth_url','/token','password','username','then','resolve'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0x1a9e,0x122));var _0xe1a9=function(_0x13ac41,_0x110fa5){_0x13ac41=_0x13ac41-0x0;var _0x3c2fbd=_0x1a9e[_0x13ac41];return _0x3c2fbd;};'use strict';var rp=require(_0xe1a9('0x0'));var url=require('url');var logger=require(_0xe1a9('0x1'))('agi');module[_0xe1a9('0x2')]=function(_0x33969,_0x1f9a25){var _0x1a374c={'method':_0xe1a9('0x3'),'uri':url['resolve'](_0x1f9a25[_0xe1a9('0x4')],_0xe1a9('0x5')),'form':{'grant_type':_0xe1a9('0x6'),'username':_0x1f9a25[_0xe1a9('0x7')],'password':_0x1f9a25[_0xe1a9('0x6')]},'json':!![]};return rp(_0x1a374c)[_0xe1a9('0x8')](function(_0x56f64c){var _0x1337f8={'method':_0xe1a9('0x3'),'uri':url[_0xe1a9('0x9')](_0x1f9a25[_0xe1a9('0xa')],_0xe1a9('0xb')),'body':{'type':_0x1f9a25[_0xe1a9('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x33969['uniqueid']},'from':{'id':_0x33969['callerid'],'name':_0x33969[_0xe1a9('0xd')]},'recipient':{'id':_0x33969[_0xe1a9('0xe')],'name':_0x33969[_0xe1a9('0xf')]},'text':_0x1f9a25[_0xe1a9('0x10')],'channelData':{}},'headers':{'Authorization':_0xe1a9('0x11')+_0x56f64c[_0xe1a9('0x12')]},'json':!![]};if(_0x1f9a25[_0xe1a9('0x13')]){_0x1337f8[_0xe1a9('0x14')][_0xe1a9('0x15')]['ProjectName']=_0x1f9a25[_0xe1a9('0x13')];}if(_0x1f9a25[_0xe1a9('0x16')]=='1'){_0x1337f8[_0xe1a9('0x14')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe1a9('0x17')};}if(_0x1f9a25['custom_action']){_0x1337f8['body']['channelData'][_0xe1a9('0x18')]=_0x1f9a25[_0xe1a9('0x19')];if(_0x1f9a25[_0xe1a9('0x1a')]){_0x1337f8[_0xe1a9('0x14')][_0xe1a9('0x15')][_0xe1a9('0x1b')]=_0x1f9a25['custom_action_data'];}}logger[_0xe1a9('0x1c')](JSON[_0xe1a9('0x1d')](_0x1337f8));return rp(_0x1337f8);});}; \ No newline at end of file +var _0xfe57=['url','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','calleridname','text','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','body','info','stringify','request-promise'];(function(_0x5eb726,_0x3d28db){var _0x58f872=function(_0x53850d){while(--_0x53850d){_0x5eb726['push'](_0x5eb726['shift']());}};_0x58f872(++_0x3d28db);}(_0xfe57,0x195));var _0x7fe5=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xfe57[_0x377a6e];return _0x37f751;};'use strict';var rp=require(_0x7fe5('0x0'));var url=require(_0x7fe5('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x7fe5('0x2')]=function(_0x4744a9,_0xc27f79){var _0x421809={'method':_0x7fe5('0x3'),'uri':url[_0x7fe5('0x4')](_0xc27f79[_0x7fe5('0x5')],_0x7fe5('0x6')),'form':{'grant_type':_0x7fe5('0x7'),'username':_0xc27f79[_0x7fe5('0x8')],'password':_0xc27f79[_0x7fe5('0x7')]},'json':!![]};return rp(_0x421809)[_0x7fe5('0x9')](function(_0x36ff81){var _0x4ab081={'method':_0x7fe5('0x3'),'uri':url['resolve'](_0xc27f79[_0x7fe5('0xa')],_0x7fe5('0xb')),'body':{'type':_0xc27f79['ndaactivity_type']||'message','channelId':_0x7fe5('0xc'),'conversation':{'id':_0x4744a9[_0x7fe5('0xd')]},'from':{'id':_0x4744a9['callerid'],'name':_0x4744a9[_0x7fe5('0xe')]},'recipient':{'id':_0x4744a9['dnid'],'name':_0x4744a9['extension']},'text':_0xc27f79[_0x7fe5('0xf')],'channelData':{}},'headers':{'Authorization':_0x7fe5('0x10')+_0x36ff81[_0x7fe5('0x11')]},'json':!![]};if(_0xc27f79[_0x7fe5('0x12')]){_0x4ab081['body'][_0x7fe5('0x13')][_0x7fe5('0x14')]=_0xc27f79['project'];}if(_0xc27f79[_0x7fe5('0x15')]=='1'){_0x4ab081['body'][_0x7fe5('0x13')][_0x7fe5('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0xc27f79[_0x7fe5('0x17')]){_0x4ab081['body'][_0x7fe5('0x13')][_0x7fe5('0x18')]=_0xc27f79[_0x7fe5('0x17')];if(_0xc27f79[_0x7fe5('0x19')]){_0x4ab081[_0x7fe5('0x1a')][_0x7fe5('0x13')]['CustomActionData']=_0xc27f79[_0x7fe5('0x19')];}}logger[_0x7fe5('0x1b')](JSON[_0x7fe5('0x1c')](_0x4ab081));return rp(_0x4ab081);});}; \ 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 8cebd5b..34cc8a5 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 _0x459f=['exports','./lib/api'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x459f,0x1af));var _0xf459=function(_0x592787,_0x42a78a){_0x592787=_0x592787-0x0;var _0x16a846=_0x459f[_0x592787];return _0x16a846;};'use strict';var asr=require(_0xf459('0x0'));module[_0xf459('0x1')]=function(_0x19d451,_0x1f130a,_0x5e9da9,_0x25fb20){return asr(_0x19d451,_0x1f130a,_0x5e9da9,_0x25fb20);}; \ No newline at end of file +var _0xa0b2=['exports'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xa0b2,0x1ac));var _0x2a0b=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xa0b2[_0x5e6ea3];return _0x4048b5;};'use strict';var asr=require('./lib/api');module[_0x2a0b('0x0')]=function(_0x397350,_0x521c52,_0xd5aeb6,_0x2b13f0){return asr(_0x397350,_0x521c52,_0xd5aeb6,_0x2b13f0);}; \ 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 5daa9c6..94fc6d4 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 _0xa6fd=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','result','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x293a77,_0x3186da){var _0x3b4df=function(_0x1c2628){while(--_0x1c2628){_0x293a77['push'](_0x293a77['shift']());}};_0x3b4df(++_0x3186da);}(_0xa6fd,0x183));var _0xda6f=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0xa6fd[_0x3ee55a];return _0x581800;};'use strict';var BPromise=require(_0xda6f('0x0'));var _=require(_0xda6f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xda6f('0x2'));var crypto=require(_0xda6f('0x3'));var logger=require(_0xda6f('0x4'))('agi');module[_0xda6f('0x5')]=function(_0x5ac479,_0x4e86ec,_0x4ad349,_0x15e103){return new BPromise(function(_0x3169d4,_0x1c28e8){logger[_0xda6f('0x6')](_0xda6f('0x7'),_0x15e103||_0xda6f('0x8'));var _0x3c1a70=new WebSocket(_0x15e103||_0xda6f('0x8'),{'perMessageDeflate':![]});var _0xd9a6a7='';var _0x239869='0';var _0x531c7e='1';var _0x11c374=_0xda6f('0x9');function _0x53fc44(_0x2130bb){var _0x1b1586=crypto[_0xda6f('0xa')](_0xda6f('0xb'));_0x1b1586[_0xda6f('0xc')](_0x2130bb);return _0x1b1586[_0xda6f('0xd')]('hex');}function _0xfb4d3c(){try{logger['info'](_0xda6f('0xe'));var _0xcaac01=moment()[_0xda6f('0xf')]();var _0x46929d=_0x53fc44(_0xcaac01+_0x4e86ec+_0x4ad349);_0x3c1a70[_0xda6f('0x10')](JSON[_0xda6f('0x11')]({'appID':_0x4e86ec,'timestamp':_0xcaac01,'appKey':_0x46929d}));var _0x5d020e=fs['createReadStream'](_0x5ac479);_0x5d020e['on']('data',function(_0x20f8fb){_0x3c1a70['send'](_0x20f8fb);});_0x5d020e['on'](_0xda6f('0x12'),function(){_0x3c1a70['send'](_0xda6f('0x13'));});}catch(_0x4d1721){logger[_0xda6f('0x14')](_0xda6f('0x15'),JSON['stringify'](_0x4d1721));_0x3c1a70['terminate']();}}function _0x1787aa(_0x589613){try{if(_0x589613){var _0x28a504=JSON[_0xda6f('0x16')](_0x589613);switch(_0x28a504['status']){case 0x0:if(_0x28a504[_0xda6f('0x17')]){if(_0x28a504[_0xda6f('0x17')]['final']){logger[_0xda6f('0x6')](_0xda6f('0x18'),JSON[_0xda6f('0x11')](_0x28a504[_0xda6f('0x17')][_0xda6f('0x19')]));_0xd9a6a7=_0x28a504['result']['hypotheses'][0x0]['transcript'];_0x239869=_0x28a504[_0xda6f('0x17')][_0xda6f('0x19')][0x0]['likelihood'];_0x531c7e='0';_0x11c374=_0xda6f('0x1a');_0x3c1a70[_0xda6f('0x1b')]();}}break;case 0x1:logger['info'](_0xda6f('0x9'));_0x531c7e='1';_0x11c374='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xda6f('0x6')](_0xda6f('0x1c'));_0x531c7e='2';_0x11c374=_0xda6f('0x1c');break;case 0x9:logger[_0xda6f('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x531c7e='9';_0x11c374=_0xda6f('0x1d');break;case 0xa:logger['info'](_0xda6f('0x1e'));_0x531c7e='10';_0x11c374=_0xda6f('0x1e');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x531c7e='11';_0x11c374='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0xe00d67){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xda6f('0x11')](_0xe00d67));_0x3c1a70['terminate']();}}function _0x297351(){logger[_0xda6f('0x6')](_0xda6f('0x1f'));_0x3169d4({'transcript':_0xd9a6a7,'confidence':_0x239869,'status':_0x531c7e,'status_message':_0x11c374});}function _0x2b917b(_0x3818fb){logger[_0xda6f('0x14')](_0xda6f('0x20'));if(!_['isNil'](_0x3818fb)){logger[_0xda6f('0x14')](_[_0xda6f('0x21')](_0x3818fb)?JSON['stringify'](_0x3818fb):_0x3818fb);}}_0x3c1a70['on'](_0xda6f('0x22'),_0xfb4d3c);_0x3c1a70['on'](_0xda6f('0x23'),_0x1787aa);_0x3c1a70['on'](_0xda6f('0x12'),_0x297351);_0x3c1a70['on'](_0xda6f('0x14'),_0x2b917b);});}; \ No newline at end of file +var _0x995f=['../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','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.','error','Tilde\x20ASR\x20parse\x20error','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash','moment','crypto'];(function(_0x436079,_0xb058b1){var _0x54477a=function(_0x3e8d68){while(--_0x3e8d68){_0x436079['push'](_0x436079['shift']());}};_0x54477a(++_0xb058b1);}(_0x995f,0xca));var _0xf995=function(_0xa3400,_0x3a980a){_0xa3400=_0xa3400-0x0;var _0x33dba2=_0x995f[_0xa3400];return _0x33dba2;};'use strict';var BPromise=require('bluebird');var _=require(_0xf995('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf995('0x1'));var crypto=require(_0xf995('0x2'));var logger=require(_0xf995('0x3'))(_0xf995('0x4'));module['exports']=function(_0x76800d,_0x2943d1,_0x5e8d1e,_0x2dcbfc){return new BPromise(function(_0x4c522c,_0x14b987){logger[_0xf995('0x5')](_0xf995('0x6'),_0x2dcbfc||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x5d0285=new WebSocket(_0x2dcbfc||_0xf995('0x7'),{'perMessageDeflate':![]});var _0x49c021='';var _0x4fe6da='0';var _0x576fd0='1';var _0x86332e='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x43eeaf(_0x482544){var _0x3e3442=crypto[_0xf995('0x8')](_0xf995('0x9'));_0x3e3442[_0xf995('0xa')](_0x482544);return _0x3e3442[_0xf995('0xb')](_0xf995('0xc'));}function _0x3099f2(){try{logger[_0xf995('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x2b053d=moment()['unix']();var _0x4c002e=_0x43eeaf(_0x2b053d+_0x2943d1+_0x5e8d1e);_0x5d0285[_0xf995('0xd')](JSON[_0xf995('0xe')]({'appID':_0x2943d1,'timestamp':_0x2b053d,'appKey':_0x4c002e}));var _0x3be320=fs[_0xf995('0xf')](_0x76800d);_0x3be320['on'](_0xf995('0x10'),function(_0x280e4d){_0x5d0285['send'](_0x280e4d);});_0x3be320['on'](_0xf995('0x11'),function(){_0x5d0285['send'](_0xf995('0x12'));});}catch(_0x1b30a0){logger['error'](_0xf995('0x13'),JSON[_0xf995('0xe')](_0x1b30a0));_0x5d0285['terminate']();}}function _0x3a024e(_0x151d94){try{if(_0x151d94){var _0x2532ef=JSON[_0xf995('0x14')](_0x151d94);switch(_0x2532ef['status']){case 0x0:if(_0x2532ef['result']){if(_0x2532ef[_0xf995('0x15')][_0xf995('0x16')]){logger[_0xf995('0x5')](_0xf995('0x17'),JSON['stringify'](_0x2532ef[_0xf995('0x15')][_0xf995('0x18')]));_0x49c021=_0x2532ef['result'][_0xf995('0x18')][0x0]['transcript'];_0x4fe6da=_0x2532ef[_0xf995('0x15')][_0xf995('0x18')][0x0][_0xf995('0x19')];_0x576fd0='0';_0x86332e=_0xf995('0x1a');_0x5d0285['terminate']();}}break;case 0x1:logger[_0xf995('0x5')](_0xf995('0x1b'));_0x576fd0='1';_0x86332e='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xf995('0x5')](_0xf995('0x1c'));_0x576fd0='2';_0x86332e=_0xf995('0x1c');break;case 0x9:logger[_0xf995('0x5')](_0xf995('0x1d'));_0x576fd0='9';_0x86332e=_0xf995('0x1d');break;case 0xa:logger[_0xf995('0x5')](_0xf995('0x1e'));_0x576fd0='10';_0x86332e=_0xf995('0x1e');break;case 0xb:logger[_0xf995('0x5')](_0xf995('0x1f'));_0x576fd0='11';_0x86332e=_0xf995('0x1f');}}}catch(_0x1de2e2){logger[_0xf995('0x20')](_0xf995('0x21'),JSON['stringify'](_0x1de2e2));_0x5d0285[_0xf995('0x22')]();}}function _0x5632e4(){logger['info'](_0xf995('0x23'));_0x4c522c({'transcript':_0x49c021,'confidence':_0x4fe6da,'status':_0x576fd0,'status_message':_0x86332e});}function _0x4cbfad(_0x54e6a6){logger[_0xf995('0x20')](_0xf995('0x24'));if(!_[_0xf995('0x25')](_0x54e6a6)){logger[_0xf995('0x20')](_[_0xf995('0x26')](_0x54e6a6)?JSON[_0xf995('0xe')](_0x54e6a6):_0x54e6a6);}}_0x5d0285['on'](_0xf995('0x27'),_0x3099f2);_0x5d0285['on'](_0xf995('0x28'),_0x3a024e);_0x5d0285['on'](_0xf995('0x11'),_0x5632e4);_0x5d0285['on'](_0xf995('0x20'),_0x4cbfad);});}; \ 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 7011f02..a0c931f 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 _0x6cb9=['./asr'];(function(_0x2c60ca,_0x34b828){var _0x5ade9c=function(_0x3a71e9){while(--_0x3a71e9){_0x2c60ca['push'](_0x2c60ca['shift']());}};_0x5ade9c(++_0x34b828);}(_0x6cb9,0x74));var _0x96cb=function(_0x17655c,_0x418ca6){_0x17655c=_0x17655c-0x0;var _0x5aa4d0=_0x6cb9[_0x17655c];return _0x5aa4d0;};var asr=require(_0x96cb('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x747c=['exports','./asr'];(function(_0xdebee8,_0x4b0db1){var _0xc21146=function(_0x171d49){while(--_0x171d49){_0xdebee8['push'](_0xdebee8['shift']());}};_0xc21146(++_0x4b0db1);}(_0x747c,0x8d));var _0xc747=function(_0x3f8a59,_0x1cb3cd){_0x3f8a59=_0x3f8a59-0x0;var _0xc46d64=_0x747c[_0x3f8a59];return _0xc46d64;};var asr=require(_0xc747('0x0'));module[_0xc747('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 44e3aad..427a4d6 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 _0xc794=['127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./channel'];(function(_0x523315,_0x11b8f5){var _0x2715ac=function(_0x38dc0e){while(--_0x38dc0e){_0x523315['push'](_0x523315['shift']());}};_0x2715ac(++_0x11b8f5);}(_0xc794,0x91));var _0x4c79=function(_0x1f8d0c,_0x2ecdf6){_0x1f8d0c=_0x1f8d0c-0x0;var _0x4af449=_0xc794[_0x1f8d0c];return _0x4af449;};'use strict';var util=require(_0x4c79('0x0'));var net=require(_0x4c79('0x1'));var EventEmitter=require(_0x4c79('0x2'))[_0x4c79('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x4c79('0x4'));var AGIServer=function(_0x554c13,_0x25c90a,_0x254bff){var _0x23afb5=this,_0x554c13=_0x554c13||0x11dd,_0x25c90a=_0x25c90a||_0x4c79('0x5'),_0x355d64=null,_0x693f6e=0x0;EventEmitter[_0x4c79('0x6')](_0x23afb5);function _0x4bede9(){if(!_0x554c13){_0x23afb5[_0x4c79('0x7')](_0x4c79('0x8'),new AGIError(_0x4c79('0x9')));return![];}_0x355d64=net[_0x4c79('0xa')]();_0x355d64[_0x4c79('0xb')](_0x554c13,_0x25c90a);_0x355d64['on'](_0x4c79('0xc'),function(){_0x23afb5[_0x4c79('0x7')](_0x4c79('0xc'));});_0x355d64['on'](_0x4c79('0xd'),function(_0x4a3eeb){_0x355d64[_0x4c79('0xe')](function(_0x253b56,_0x4eaf7e){if(_0x253b56){_0x23afb5['emit'](_0x4c79('0x8'),new AGIError(_0x4c79('0xf'),_0x253b56));}else if(_0x254bff&&_0x254bff<0x0){_0x23afb5[_0x4c79('0x7')]('error',new AGIError(_0x4c79('0x10')));_0x4a3eeb['destroy']();}else if(_0x254bff&&_0x254bff>0x0&&_0x254bff<_0x4eaf7e){_0x693f6e+=0x1;_0x23afb5[_0x4c79('0x7')](_0x4c79('0x8'),new AGIError(_0x4c79('0x11'),_0x693f6e));_0x4a3eeb[_0x4c79('0x12')]();}else{var _0x255ede=new AGIChannel(_0x4a3eeb);_0x255ede['on'](_0x4c79('0x13'),function(){_0x23afb5[_0x4c79('0x7')](_0x4c79('0xd'),_0x255ede);});}});});_0x355d64['on'](_0x4c79('0x8'),function(_0x4a9690){_0x23afb5[_0x4c79('0x7')](_0x4c79('0x8'),new AGIError(_0x4c79('0xf'),_0x4a9690['code']));});_0x355d64['on'](_0x4c79('0x14'),function(){_0x23afb5[_0x4c79('0x7')](_0x4c79('0x14'),new AGIError(_0x4c79('0x15')));});}process[_0x4c79('0x16')](function(){_0x4bede9();});};util[_0x4c79('0x17')](AGIServer,EventEmitter);module[_0x4c79('0x18')]=function(_0x321c57,_0x265da6,_0x415c29){return new AGIServer(_0x321c57,_0x265da6,_0x415c29);}; \ No newline at end of file +var _0xe88e=['listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','nextTick','inherits','util','net','events','./error','./channel','call','error','createServer'];(function(_0x322803,_0xa0022){var _0x2452eb=function(_0x53ff0d){while(--_0x53ff0d){_0x322803['push'](_0x322803['shift']());}};_0x2452eb(++_0xa0022);}(_0xe88e,0x98));var _0xee88=function(_0x81e6e2,_0x3565ca){_0x81e6e2=_0x81e6e2-0x0;var _0x56bb71=_0xe88e[_0x81e6e2];return _0x56bb71;};'use strict';var util=require(_0xee88('0x0'));var net=require(_0xee88('0x1'));var EventEmitter=require(_0xee88('0x2'))['EventEmitter'];var AGIError=require(_0xee88('0x3'));var AGIChannel=require(_0xee88('0x4'));var AGIServer=function(_0x234359,_0x548e3e,_0x1df4de){var _0x34486e=this,_0x234359=_0x234359||0x11dd,_0x548e3e=_0x548e3e||'127.0.0.1',_0x18c0de=null,_0x4232a3=0x0;EventEmitter[_0xee88('0x5')](_0x34486e);function _0x318957(){if(!_0x234359){_0x34486e['emit'](_0xee88('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x18c0de=net[_0xee88('0x7')]();_0x18c0de['listen'](_0x234359,_0x548e3e);_0x18c0de['on'](_0xee88('0x8'),function(){_0x34486e[_0xee88('0x9')](_0xee88('0x8'));});_0x18c0de['on'](_0xee88('0xa'),function(_0x1bcaa1){_0x18c0de[_0xee88('0xb')](function(_0x316c98,_0x1978eb){if(_0x316c98){_0x34486e[_0xee88('0x9')]('error',new AGIError(_0xee88('0xc'),_0x316c98));}else if(_0x1df4de&&_0x1df4de<0x0){_0x34486e[_0xee88('0x9')](_0xee88('0x6'),new AGIError(_0xee88('0xd')));_0x1bcaa1[_0xee88('0xe')]();}else if(_0x1df4de&&_0x1df4de>0x0&&_0x1df4de<_0x1978eb){_0x4232a3+=0x1;_0x34486e[_0xee88('0x9')](_0xee88('0x6'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4232a3));_0x1bcaa1[_0xee88('0xe')]();}else{var _0x239bfa=new AGIChannel(_0x1bcaa1);_0x239bfa['on'](_0xee88('0xf'),function(){_0x34486e[_0xee88('0x9')](_0xee88('0xa'),_0x239bfa);});}});});_0x18c0de['on'](_0xee88('0x6'),function(_0x94ad4a){_0x34486e['emit'](_0xee88('0x6'),new AGIError(_0xee88('0xc'),_0x94ad4a[_0xee88('0x10')]));});_0x18c0de['on']('close',function(){_0x34486e[_0xee88('0x9')](_0xee88('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xee88('0x12')](function(){_0x318957();});};util[_0xee88('0x13')](AGIServer,EventEmitter);module['exports']=function(_0x4e0051,_0x3f769e,_0x17fc0f){return new AGIServer(_0x4e0051,_0x3f769e,_0x17fc0f);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 57f8e55..97f5423 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 _0x088d=['delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','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','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','%s/recordings/%s','beep','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','menu','no\x20file\x20audio\x20selected','getData','response','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','macro','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','service','host','secure','authentication','auth','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','then','name','getVoiceQueue','catch','getSquareProject','getSquareProjectById','prototype','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','map','Intervals','format','%s/sounds/converted/%s','open','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','url','timeout','number','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_bot_name','googleASR','google_asr_language','tildeASR','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','saveRestApiResult','%s.%s','isArray','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','setVariable','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','list_id','no\x20list\x20selected','add'];(function(_0x42d7a4,_0x196443){var _0x310ee7=function(_0x2430f9){while(--_0x2430f9){_0x42d7a4['push'](_0x42d7a4['shift']());}};_0x310ee7(++_0x196443);}(_0x088d,0x10a));var _0xd088=function(_0x443224,_0x3fc45a){_0x443224=_0x443224-0x0;var _0x1accd6=_0x088d[_0x443224];return _0x1accd6;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xd088('0x0'));var _=require(_0xd088('0x1'));var sh=require(_0xd088('0x2'));var odbc=require(_0xd088('0x3'))();var rs=require(_0xd088('0x4'));var moment=require(_0xd088('0x5'));var Mustache=require(_0xd088('0x6'));var rp=require('request-promise');var logger=require('../../config/logger')('agi');var config=require(_0xd088('0x7'));var scripts=require(_0xd088('0x8'));var FILES_PATH=_0xd088('0x9');var recursiveMapAttributes=[_0xd088('0xa'),_0xd088('0xb')];var verticesWithRetry=['menu',_0xd088('0xc'),_0xd088('0xd')];var AGIVertices=function(_0x121823,_0x27a18f,_0x45c05f){this[_0xd088('0xe')]=_0x121823;this[_0xd088('0xf')]=_0x27a18f;this[_0xd088('0x10')]=_0x45c05f;};AGIVertices['prototype'][_0xd088('0x11')]=function(_0x29af66,_0x432dc5){this['rpc']['getVariableById'](_0x29af66)[_0xd088('0x12')](function(_0x3c9df1){_0x432dc5(null,_0x3c9df1?_0x3c9df1[_0xd088('0x13')]:![]);})['catch'](function(_0xf63b13){_0x432dc5(_0xf63b13);});};AGIVertices['prototype'][_0xd088('0x14')]=function(_0x555df4,_0x2beb76){this[_0xd088('0xf')]['getVoiceQueueById'](_0x555df4)[_0xd088('0x12')](function(_0x158282){_0x2beb76(null,_0x158282?_0x158282[_0xd088('0x13')]:![]);})[_0xd088('0x15')](function(_0x4d0929){_0x2beb76(_0x4d0929);});};AGIVertices['prototype'][_0xd088('0x16')]=function(_0x334467,_0x1732e2){this[_0xd088('0xf')][_0xd088('0x17')](_0x334467)[_0xd088('0x12')](function(_0x18100f){_0x1732e2(null,_0x18100f?_0x18100f['name']:![]);})[_0xd088('0x15')](function(_0x22a3f5){_0x1732e2(_0x22a3f5);});};AGIVertices[_0xd088('0x18')][_0xd088('0x19')]=function(_0x5a49e2,_0x4efc1e){this[_0xd088('0xf')][_0xd088('0x1a')](_0x5a49e2)[_0xd088('0x12')](function(_0x1f887d){_0x4efc1e(null,_0x1f887d?_0x1f887d[_0xd088('0x1b')]:![]);})[_0xd088('0x15')](function(_0x3e754b){_0x4efc1e(_0x3e754b);});};AGIVertices[_0xd088('0x18')][_0xd088('0x1c')]=function(_0x254cad,_0x33d144){this[_0xd088('0xf')][_0xd088('0x1d')](_0x254cad)[_0xd088('0x12')](function(_0x293964){_0x33d144(null,_0x293964?_0x293964[_0xd088('0x13')]:![]);})['catch'](function(_0x4f6819){_0x33d144(_0x4f6819);});};AGIVertices[_0xd088('0x18')][_0xd088('0x1e')]=function(_0x5b9ee7,_0x724e73){this[_0xd088('0xf')][_0xd088('0x1f')](_0x5b9ee7)[_0xd088('0x12')](function(_0x569cd){_0x724e73(null,_0x569cd?_0x569cd[_0xd088('0x13')]:![]);})[_0xd088('0x15')](function(_0x287259){_0x724e73(_0x287259);});};AGIVertices[_0xd088('0x18')][_0xd088('0x20')]=function(_0x13ac32,_0x19d49f){var _0x10d432=this;this['rpc']['getSoundById'](_0x13ac32)[_0xd088('0x12')](function(_0x5212f4){_0x19d49f(null,_0x5212f4?_0x10d432[_0xd088('0x21')](_0x5212f4[_0xd088('0x22')]):![]);})['catch'](function(_0x320e93){_0x19d49f(_0x320e93);});};AGIVertices[_0xd088('0x18')][_0xd088('0x23')]=function(_0x1c7b31,_0x509d9e){this[_0xd088('0xf')][_0xd088('0x24')](_0x1c7b31)[_0xd088('0x12')](function(_0xec7e75){_0x509d9e(null,_0xec7e75?_0xec7e75:![]);})[_0xd088('0x15')](function(_0x5c74ac){_0x509d9e(_0x5c74ac);});};AGIVertices['prototype'][_0xd088('0x25')]=function(_0x38d387,_0x32e240,_0xc986){this['mailRpc'][_0xd088('0x25')](_0x38d387,_0x32e240)[_0xd088('0x12')](function(){_0xc986(null);})[_0xd088('0x15')](function(_0x254df7){_0xc986(_0x254df7);});};AGIVertices[_0xd088('0x18')][_0xd088('0x26')]=function(_0xb2d55c,_0x39df57){this[_0xd088('0xf')][_0xd088('0x27')](_0xb2d55c)[_0xd088('0x12')](function(_0x2d8be2){if(_0x2d8be2){if(_0x2d8be2['IntervalId']){_0x39df57(null,[_0x2d8be2['interval']]);}else{_0x39df57(null,_[_0xd088('0x28')](_0x2d8be2[_0xd088('0x29')],'interval'));}}else{_0x39df57(null,![]);}})['catch'](function(_0x3c1c8f){_0x39df57(_0x3c1c8f);});};AGIVertices[_0xd088('0x18')][_0xd088('0x21')]=function(_0x55a12a){return util[_0xd088('0x2a')](_0xd088('0x2b'),FILES_PATH,_0x55a12a);};AGIVertices['prototype']['getQueryOdbc']=function(_0x29339b,_0x3b8420,_0x3e6753){odbc[_0xd088('0x2c')](_0x29339b,function(_0x2f0aff){if(_0x2f0aff){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x2f0aff);_0x3e6753(_0x2f0aff);}else{logger['info']('ODBC\x20connection\x20successfully');odbc['query'](_0x3b8420,function(_0x3d7ebb,_0x43daea){if(_0x3d7ebb){logger['info'](_0xd088('0x2d'),_0x3b8420);_0x3e6753(_0x3d7ebb);}else{logger[_0xd088('0x2e')](_0xd088('0x2f'),_0x3b8420);odbc[_0xd088('0x30')](function(_0x575e85){if(_0x575e85){logger[_0xd088('0x31')](_0xd088('0x32'),_0x575e85);}_0x3e6753(null,_0x43daea);});}});}});};AGIVertices[_0xd088('0x18')][_0xd088('0x33')]=function(_0x1c0e4f,_0x1ef100){this[_0xd088('0xf')][_0xd088('0x34')](_0x1c0e4f)['then'](function(_0x156e41){_0x1ef100(null,_0x156e41?_0x156e41:![]);})['catch'](function(_0x1f5d6e){_0x1ef100(_0x1f5d6e);});};AGIVertices[_0xd088('0x18')][_0xd088('0x35')]=function(_0x3320bf,_0xccc785){this[_0xd088('0xf')][_0xd088('0x35')](_0x3320bf)[_0xd088('0x12')](function(_0x2b3587){_0xccc785(null,_0x2b3587);})['catch'](function(_0x16e8d9){_0xccc785(_0x16e8d9);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x2f1ae4,_0x4649a7,_0x336f7c){this[_0xd088('0xf')][_0xd088('0x36')]({'uniqueid':this[_0xd088('0xe')]['uniqueid'],'node':_0x2f1ae4[_0xd088('0x37')],'application':_0x2f1ae4[_0xd088('0x38')],'data':_0x4649a7||null,'project_name':this[_0xd088('0xe')][_0xd088('0x39')],'callerid':this[_0xd088('0xe')][_0xd088('0x3a')]})[_0xd088('0x12')](function(_0x176267){if(_0x336f7c){_0x336f7c(null,_0x176267);}})[_0xd088('0x15')](function(_0x3e53f7){if(_0x336f7c){_0x336f7c(_0x3e53f7);}});};AGIVertices[_0xd088('0x18')]['createSquareRecording']=function(_0x546af7,_0x2e600b,_0x7eca17,_0x83dae6){this['rpc'][_0xd088('0x3b')]({'uniqueid':this[_0xd088('0xe')][_0xd088('0x3c')],'callerid':this[_0xd088('0xe')][_0xd088('0x3a')],'calleridname':this[_0xd088('0xe')][_0xd088('0x3d')],'context':this[_0xd088('0xe')]['context'],'extension':this[_0xd088('0xe')][_0xd088('0x3e')],'priority':this[_0xd088('0xe')][_0xd088('0x3f')],'accountcode':this[_0xd088('0xe')][_0xd088('0x40')],'dnid':this[_0xd088('0xe')][_0xd088('0x41')],'projectName':this['channel'][_0xd088('0x39')],'saveName':_0x2e600b,'filename':_0x546af7[_0xd088('0x42')]||_0x2e600b,'savePath':_0x7eca17})[_0xd088('0x12')](function(_0xd1cca2){_0x83dae6(null,_0xd1cca2);})[_0xd088('0x15')](function(_0xccf33c){_0x83dae6(_0xccf33c);});};AGIVertices[_0xd088('0x18')][_0xd088('0x43')]=function(_0x35a09f,_0x381bea,_0x17d165,_0x2a8f99,_0x45fb3e){this['rpc'][_0xd088('0x43')]({'uniqueid':this['channel']['uniqueid'],'body':_0x35a09f,'direction':_0x381bea,'providerName':_0x17d165,'providerResponse':_0x2a8f99})[_0xd088('0x12')](function(_0x4b1267){if(_0x45fb3e){_0x45fb3e(null,_0x4b1267);}})[_0xd088('0x15')](function(_0x8f5b06){if(_0x45fb3e){_0x45fb3e(_0x8f5b06);}});};AGIVertices['prototype'][_0xd088('0x44')]=function(_0x43681a,_0x37cb43){this[_0xd088('0xf')][_0xd088('0x44')]({'firstName':_[_0xd088('0x45')](_0x43681a[_0xd088('0x13')])||_[_0xd088('0x46')](_0x43681a['name'])?'callback_'+Math[_0xd088('0x47')]():_0x43681a[_0xd088('0x13')],'lastName':_['isEmpty'](_0x43681a['lastName'])||_['isNil'](_0x43681a[_0xd088('0x48')])?null:_0x43681a['lastName'],'phone':_0x43681a[_0xd088('0x49')],'ListId':_0x43681a['list_id'],'scheduledat':_0x43681a[_0xd088('0x4a')],'callbackUniqueid':this['channel'][_0xd088('0x3c')],'tags':_0xd088('0x4b'),'description':_0xd088('0x4c')+_0x43681a['scheduledAt'][_0xd088('0x4d')](),'priority':_0x43681a[_0xd088('0x4e')]})[_0xd088('0x12')](function(_0x2922e6){_0x37cb43(null,_0x2922e6);})[_0xd088('0x15')](function(_0x237526){_0x37cb43(_0x237526);});};AGIVertices[_0xd088('0x18')][_0xd088('0x4f')]=function(_0x81c6,_0x19f1f4){this['rpc'][_0xd088('0x50')](_0x81c6)[_0xd088('0x12')](function(_0x1bd22b){_0x19f1f4(null,_0x1bd22b?_0x1bd22b[_0xd088('0x13')]:![]);})[_0xd088('0x15')](function(_0xc82a73){_0x19f1f4(_0xc82a73);});};AGIVertices[_0xd088('0x18')][_0xd088('0x51')]=function(_0xb00c0c,_0x1fcf86,_0x1f82f0){var _0x2bc191={'role':_0xd088('0x52')};_0x2bc191[_0xb00c0c]=this[_0xd088('0xe')][_0xd088('0x3a')];this[_0xd088('0xf')][_0xd088('0x51')](_0x2bc191,_0x1fcf86,this['channel'][_0xd088('0x3c')])[_0xd088('0x12')](function(_0x374faf){_0x1f82f0(null,_['isNil'](_0x374faf)?![]:!![]);})[_0xd088('0x15')](function(_0x3a1965){logger[_0xd088('0x31')](_0x3a1965);_0x1f82f0(null,![]);});};AGIVertices[_0xd088('0x18')]['agentUnpause']=function(_0x328d3d,_0x523f2b){var _0x195b1c={'role':_0xd088('0x52')};_0x195b1c[_0x328d3d]=this[_0xd088('0xe')]['callerid'];this[_0xd088('0xf')][_0xd088('0x53')](_0x195b1c)[_0xd088('0x12')](function(_0x104867){_0x523f2b(null,_[_0xd088('0x46')](_0x104867)?![]:!![]);})[_0xd088('0x15')](function(_0x307ed9){logger[_0xd088('0x31')](_0x307ed9);_0x523f2b(null,![]);});};AGIVertices['prototype'][_0xd088('0x54')]=function(_0x16d3d8,_0x1a5ba1){var _0x142e30={'role':_0xd088('0x52')};_0x142e30[_0x16d3d8]=this[_0xd088('0xe')]['callerid'];this[_0xd088('0xf')]['agentLogout'](_0x142e30)['then'](function(_0x534b5){_0x1a5ba1(null,_[_0xd088('0x46')](_0x534b5)?![]:!![]);})[_0xd088('0x15')](function(_0x2b0cfd){logger[_0xd088('0x31')](_0x2b0cfd);_0x1a5ba1(null,![]);});};AGIVertices['prototype'][_0xd088('0x55')]=function(_0x3c0373,_0x146a78){var _0x5a7c80={'role':_0xd088('0x52')};_0x5a7c80[_0x3c0373]=this[_0xd088('0xe')][_0xd088('0x3a')];var _0x3ff9cb=_0x3c0373!=_0xd088('0x56')?util['format'](_0xd088('0x57'),_0xd088('0x58'),this[_0xd088('0xe')][_0xd088('0x3a')]):undefined;this['rpc'][_0xd088('0x55')](_0x5a7c80,_0x3ff9cb)[_0xd088('0x12')](function(_0x478011){_0x146a78(null,_[_0xd088('0x46')](_0x478011)?![]:!![]);})[_0xd088('0x15')](function(_0xf645d6){logger[_0xd088('0x31')](_0xf645d6);_0x146a78(null,![]);});};AGIVertices[_0xd088('0x18')]['shellCommand']=function(_0x36a228,_0x453eed){sh[_0xd088('0x59')](_[_0xd088('0x5a')](_0x36a228),function(_0x28e3f5,_0x14d3ef){var _0x3e03a8=_0x14d3ef[_0xd088('0x5b')](/(\r\n|\n|\r)/gm,'');_0x453eed(null,_0x3e03a8);});};AGIVertices['prototype'][_0xd088('0x5c')]=function(_0x4694f5,_0x18be7d){scripts['googleCloudTTS'](_0x4694f5[_0xd088('0x5d')],_0x4694f5[_0xd088('0x5e')]||_0xd088('0x5f'),_0x4694f5[_0xd088('0x5f')],_0x4694f5[_0xd088('0x60')]||_0xd088('0x61'),_0x4694f5[_0xd088('0x62')]||_0xd088('0x63'),_0x4694f5['audioEncoding']||_0xd088('0x64'))[_0xd088('0x12')](function(_0x27c945){_0x18be7d(null,_0x27c945);})[_0xd088('0x15')](function(_0x180c45){_0x18be7d(_0x180c45);});};AGIVertices[_0xd088('0x18')][_0xd088('0x65')]=function(_0x4b593c,_0x4013ce){scripts[_0xd088('0x65')](_0x4b593c[_0xd088('0x5f')],_0x4b593c[_0xd088('0x66')]||'en',0x1)[_0xd088('0x12')](function(_0x46097f){_0x4013ce(null,_0x46097f);})[_0xd088('0x15')](function(_0x2a9ab8){_0x4013ce(_0x2a9ab8);});};AGIVertices[_0xd088('0x18')]['restAPI']=function(_0x19c5d1,_0x3fcc68){var _0x2b4865={'uri':_0x19c5d1[_0xd088('0x67')],'method':_0x19c5d1['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x19c5d1[_0xd088('0x68')])===_0xd088('0x69')&&parseInt(_0x19c5d1[_0xd088('0x68')])>=0x1?parseInt(_0x19c5d1[_0xd088('0x68')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST','PUT'],_0x2b4865[_0xd088('0x6a')][_0xd088('0x6b')]())){try{_0x2b4865[_0xd088('0x6c')]=_0x19c5d1[_0xd088('0xb')]?JSON[_0xd088('0x6d')](_0x19c5d1[_0xd088('0xb')]):{};}catch(_0x5f320e){logger[_0xd088('0x31')](_0xd088('0x6e'),_0x5f320e);}}try{_0x2b4865['headers']=_0x19c5d1[_0xd088('0xa')]?JSON[_0xd088('0x6d')](_0x19c5d1['rawHeaders']):{};}catch(_0x2fbdf6){logger[_0xd088('0x31')](_0xd088('0x6f'),_0x2fbdf6);}if(_0x19c5d1[_0xd088('0x70')]){try{var _0x3a98fb=require(_0x19c5d1[_0xd088('0x70')])[_0xd088('0x71')](this,_0x2b4865);_0x2b4865['uri']=Mustache[_0xd088('0x72')](_0x19c5d1[_0xd088('0x67')],_0x3a98fb,{},['$$','$$']);if(_0x2b4865[_0xd088('0x73')]){_0x2b4865[_0xd088('0x73')]=JSON[_0xd088('0x6d')](Mustache[_0xd088('0x72')](JSON[_0xd088('0x74')](_0x2b4865[_0xd088('0x73')]),_0x3a98fb,{},['$$','$$']));}if(_0x2b4865['body']){_0x2b4865[_0xd088('0x6c')]=JSON[_0xd088('0x6d')](Mustache[_0xd088('0x72')](JSON['stringify'](_0x2b4865[_0xd088('0x6c')]),_0x3a98fb,{},['$$','$$']));}}catch(_0x2e6898){logger['error'](_0xd088('0x75'),_0x2e6898);}}rp(_0x2b4865)[_0xd088('0x12')](function(_0xe7da0c){var _0xf7d20a={'statusCode':_0xe7da0c['statusCode']||0xc8,'statusMessage':_0xe7da0c[_0xd088('0x76')]||'OK','headers':_0xe7da0c[_0xd088('0x73')]||{},'body':_0xe7da0c[_0xd088('0x6c')]||{}};_0x3fcc68(null,_0xf7d20a);})[_0xd088('0x15')](function(_0x276fa8){var _0x5b317f={'statusCode':_0x276fa8[_0xd088('0x77')]||0x1f4,'statusMessage':_0x276fa8[_0xd088('0x78')]||_0xd088('0x79'),'headers':_0x276fa8[_0xd088('0x7a')][_0xd088('0x73')]||{},'body':_0x276fa8['options'][_0xd088('0x6c')]||{}};_0x3fcc68(null,_0x5b317f);});};AGIVertices[_0xd088('0x18')][_0xd088('0x7b')]=function(_0x2a61bf,_0x1a24e0){scripts['googleDialogflow'](this['channel'][_0xd088('0x3c')],_0x2a61bf['key'],_0x2a61bf[_0xd088('0x5f')],_0x2a61bf['dialogflow_language']||'en')['then'](function(_0x5c75a6){_0x1a24e0(null,_0x5c75a6);})[_0xd088('0x15')](function(_0x581e52){_0x1a24e0(_0x581e52);});};AGIVertices[_0xd088('0x18')][_0xd088('0x7c')]=function(_0xa13df8,_0x1022ad){scripts[_0xd088('0x7c')](this['channel']['uniqueid'],_0xa13df8[_0xd088('0x7d')],_0xa13df8[_0xd088('0x7e')],_0xa13df8[_0xd088('0x7f')],_0xa13df8[_0xd088('0x5f')],_0xa13df8['dialogflowV2_language']||'en')[_0xd088('0x12')](function(_0x56a468){_0x1022ad(null,_0x56a468);})[_0xd088('0x15')](function(_0x5a94d6){_0x1022ad(_0x5a94d6);});};AGIVertices[_0xd088('0x18')][_0xd088('0x80')]=function(_0xac8de2,_0x21a476){scripts[_0xd088('0x80')](this[_0xd088('0xe')],_0xac8de2)[_0xd088('0x12')](function(_0x5f19e5){_0x21a476(null,_0x5f19e5);})[_0xd088('0x15')](function(_0x1152c9){_0x21a476(_0x1152c9);});};AGIVertices['prototype']['ispeechTTS']=function(_0xf494e8,_0xb4ab1c){scripts['ispeechTTS'](_0xf494e8[_0xd088('0x81')],_0xf494e8[_0xd088('0x5f')],_0xf494e8[_0xd088('0x82')]||_0xd088('0x61'),_0xf494e8[_0xd088('0x83')])[_0xd088('0x12')](function(_0x1a01bb){_0xb4ab1c(null,_0x1a01bb);})[_0xd088('0x15')](function(_0x190089){_0xb4ab1c(_0x190089);});};AGIVertices[_0xd088('0x18')][_0xd088('0x84')]=function(_0x1fb319,_0x11899a,_0x18c7af){scripts[_0xd088('0x84')](_0x11899a,_0x1fb319[_0xd088('0x81')],_0x1fb319[_0xd088('0x85')]||_0xd088('0x61'),this[_0xd088('0x86')](_0x1fb319[_0xd088('0x87')])?_0x1fb319[_0xd088('0x87')]:undefined)['then'](function(_0xdb8a1b){_0x18c7af(null,_0xdb8a1b);})[_0xd088('0x15')](function(_0x22ae45){_0x18c7af(_0x22ae45);});};AGIVertices['prototype']['awsPolly']=function(_0xb92fdd,_0x99265f){scripts[_0xd088('0x88')](_0xb92fdd['aws_access_key_id'],_0xb92fdd[_0xd088('0x89')],_0xb92fdd[_0xd088('0x8a')],_0xb92fdd[_0xd088('0x8b')]||'Amy',_0xb92fdd[_0xd088('0x5f')],_0xb92fdd[_0xd088('0x8c')]||_0xd088('0x5f'))['then'](function(_0xa295eb){_0x99265f(null,_0xa295eb);})[_0xd088('0x15')](function(_0x3c0f98){_0x99265f(_0x3c0f98);});};AGIVertices['prototype'][_0xd088('0x8d')]=function(_0x20c91f,_0x570bcd){scripts['awsLex'](this[_0xd088('0xe')][_0xd088('0x3c')],_0x20c91f[_0xd088('0x8e')],_0x20c91f[_0xd088('0x89')],_0x20c91f['aws_lex_region'],_0x20c91f[_0xd088('0x5f')],_0x20c91f[_0xd088('0x8f')])[_0xd088('0x12')](function(_0x11158a){_0x570bcd(null,_0x11158a);})[_0xd088('0x15')](function(_0x27f834){_0x570bcd(_0x27f834);});};AGIVertices[_0xd088('0x18')][_0xd088('0x90')]=function(_0x1d4b8d,_0x2e5b87,_0xe6c68a){scripts[_0xd088('0x90')](_0x2e5b87,_0x1d4b8d['key'],_0x1d4b8d[_0xd088('0x91')]||_0xd088('0x61'))['then'](function(_0x1b34d7){_0xe6c68a(null,_0x1b34d7);})[_0xd088('0x15')](function(_0x33a78f){_0xe6c68a(_0x33a78f);});};AGIVertices[_0xd088('0x18')][_0xd088('0x92')]=function(_0x437dd0,_0x5bbe26,_0x457bff){scripts[_0xd088('0x92')](_0x5bbe26,_0x437dd0['appid'],_0x437dd0['appsecret'],_0x437dd0['uri'])[_0xd088('0x12')](function(_0x14cd2d){_0x457bff(null,_0x14cd2d);})['catch'](function(_0x413288){_0x457bff(_0x413288);});};AGIVertices[_0xd088('0x18')][_0xd088('0x93')]=function(_0x470a34){var _0x46aed8=_[_0xd088('0x94')](verticesWithRetry,_0x470a34[_0xd088('0x38')])?_0x470a34:_[_0xd088('0x95')](_0x470a34);for(var _0x2ab927 in _0x46aed8){if(_0x46aed8[_0xd088('0x96')](_0x2ab927)){if(_0x46aed8[_0x2ab927]&&_[_0xd088('0x97')](_0x46aed8[_0x2ab927])){if(_[_0xd088('0x94')](recursiveMapAttributes,_0x2ab927)){_0x46aed8[_0x2ab927]=this[_0xd088('0x98')](_0x46aed8[_0x2ab927]);}else{_0x46aed8[_0x2ab927]=this[_0xd088('0x99')](_0x46aed8[_0x2ab927]);}}}}return _0x46aed8;};AGIVertices[_0xd088('0x18')]['recursiveNodeIndex']=function(_0x523b25){for(var _0x3ade79 in _0x523b25){if(_0x523b25[_0xd088('0x96')](_0x3ade79)){if(_[_0xd088('0x9a')](_0x523b25[_0x3ade79])){this[_0xd088('0x9b')](_0x523b25[_0x3ade79]);}else if(_['isArray'](_0x523b25[_0x3ade79])){for(var _0x334a43=0x0;_0x334a43<_0x523b25[_0x3ade79][_0xd088('0x9c')];_0x334a43++){this[_0xd088('0x9b')](_0x523b25[_0x3ade79][_0x334a43]);}}else if(_[_0xd088('0x97')](_0x523b25[_0x3ade79])){_0x523b25[_0x3ade79]=this['replaceAllVariables'](_0x523b25[_0x3ade79]);}}}};AGIVertices['prototype'][_0xd088('0x9d')]=function(_0x45ada6,_0x5738b8){for(var _0x428ddc in _0x45ada6){if(_0x45ada6[_0xd088('0x96')](_0x428ddc)){if(_[_0xd088('0x9a')](_0x45ada6[_0x428ddc])){if(!_[_0xd088('0x45')](_0x45ada6[_0x428ddc])){this['saveRestApiResult'](_0x45ada6[_0x428ddc],util['format'](_0xd088('0x9e'),_0x5738b8,_0x428ddc));}}else if(_[_0xd088('0x9f')](_0x45ada6[_0x428ddc])){for(var _0x1184ce=0x0;_0x1184ce<_0x45ada6[_0x428ddc]['length'];_0x1184ce++){this[_0xd088('0x9d')](_0x45ada6[_0x428ddc][_0x1184ce],util[_0xd088('0x2a')](_0xd088('0x9e'),_0x5738b8,_0x428ddc+'['+_0x1184ce+']'));}}else{if(!_[_0xd088('0x46')](_0x45ada6[_0x428ddc])){this['channel']['setVariable'](util[_0xd088('0x2a')](_0xd088('0x9e'),_0x5738b8,_0x428ddc),_0x45ada6[_0x428ddc]);}}}}};AGIVertices[_0xd088('0x18')][_0xd088('0x98')]=function(_0x5dd05b){try{var _0x4b43b0=JSON[_0xd088('0x6d')](_0x5dd05b);this['recursiveNodeIndex'](_0x4b43b0);return JSON[_0xd088('0x74')](_0x4b43b0);}catch(_0x45789b){return this['replaceAllVariables'](_0x5dd05b);}};AGIVertices['prototype'][_0xd088('0x99')]=function(_0x174ac9){var _0x9e6733=_0x174ac9[_0xd088('0xa0')]('{');for(var _0x4a2c28=0x1;_0x4a2c28<_0x9e6733[_0xd088('0x9c')];_0x4a2c28+=0x1){var _0x1a6273=_0x9e6733[_0x4a2c28][_0xd088('0xa0')]('}');if(_0x1a6273[_0xd088('0x9c')]>0x1){_0x174ac9=_0x174ac9[_0xd088('0xa1')]('{'+_0x1a6273[0x0]+'}',this[_0xd088('0xe')]['getVariable'](_0x1a6273[0x0])['extra']||_0x1a6273[0x0]);}}if(_0x9e6733[_0xd088('0x9c')]===0x1){return _0x174ac9['toString']();}return this[_0xd088('0x99')](_0x174ac9);};AGIVertices[_0xd088('0x18')][_0xd088('0xa2')]=function(_0x539dd3,_0x371143){var _0xbee2dd=this[_0xd088('0xe')][_0xd088('0x11')](_0x539dd3);if(_0xbee2dd[_0xd088('0xa3')]===-0x1){return _0xbee2dd;}logger['info'](util[_0xd088('0x2a')](_0xd088('0xa4'),_0x371143,_0xbee2dd[_0xd088('0xa5')]));return this[_0xd088('0xe')][_0xd088('0xa6')](_0x371143,_0xbee2dd[_0xd088('0xa5')]);};AGIVertices[_0xd088('0x18')][_0xd088('0x86')]=function(_0x5c6a0b){return _0x5c6a0b&&_0x5c6a0b!=='0'&&_0x5c6a0b!=='-1'&&_0x5c6a0b!=='';};AGIVertices['prototype']['maxRetry']=function(_0x92e69c){this[_0xd088('0x36')]['sync'](this,_0x92e69c,'-');_0x92e69c[_0xd088('0xa7')]=_0x92e69c[_0xd088('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd088('0x18')][_0xd088('0xa9')]=function(_0x35d02d){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xaa'),_0x35d02d[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x35d02d[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}var _0x27e5bf='\x22'+_0x35d02d[_0xd088('0x5f')]+'\x22';if(this[_0xd088('0x86')](_0x35d02d[_0xd088('0x7a')])){_0x27e5bf+=','+_0x35d02d[_0xd088('0x7a')];}var _0x22e3db=this['channel'][_0xd088('0x59')](_0xd088('0xad'),_0x27e5bf);if(_0x22e3db[_0xd088('0xa3')]===-0x1){return _0x22e3db;}return this['channel']['noop'](util['format'](_0xd088('0xae'),_0x27e5bf));};AGIVertices['prototype'][_0xd088('0xaf')]=function(_0x42ad34){logger[_0xd088('0x2e')](util['format'](_0xd088('0xb0'),_0x42ad34['label']));if(!this['isConfigured'](_0x42ad34[_0xd088('0xb1')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xb2'));}var _0x2eda42=_0x42ad34[_0xd088('0xb1')];if(this[_0xd088('0x86')](_0x42ad34[_0xd088('0x7a')])){_0x2eda42+=','+_0x42ad34[_0xd088('0x7a')];}var _0x21d481=this[_0xd088('0xe')][_0xd088('0x59')](_0xd088('0xb3'),_0x2eda42);if(_0x21d481['result']===-0x1){return _0x21d481;}var _0x1fedf4=this[_0xd088('0xa2')](_0xd088('0xb4'),'MRCP_RECOG_CONFIDENCE');if(_0x1fedf4[_0xd088('0xa3')]===-0x1){return _0x1fedf4;}var _0x17517c=this[_0xd088('0xa2')](_0xd088('0xb5'),'MRCP_RECOG_TRANSCRIPT');if(_0x17517c['result']===-0x1){return _0x17517c;}var _0xa7327=this[_0xd088('0xa2')](_0xd088('0xb6'),_0xd088('0xb7'));if(_0xa7327[_0xd088('0xa3')]===-0x1){return _0xa7327;}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2eda42));};AGIVertices[_0xd088('0x18')][_0xd088('0xb8')]=function(_0x19a292){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xb9'),_0x19a292[_0xd088('0x37')]));return this[_0xd088('0xe')]['agi']([_0x19a292[_0xd088('0xba')],_0x19a292[_0xd088('0xbb')]]);};AGIVertices[_0xd088('0x18')][_0xd088('0xbc')]=function(_0x2d83b6){logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2d83b6[_0xd088('0x37')]));if(this['isConfigured'](_0x2d83b6[_0xd088('0x68')])){logger[_0xd088('0x2e')](util['format'](_0xd088('0xbd'),_0x2d83b6['timeout']));var _0x281f73=this[_0xd088('0xe')][_0xd088('0xbe')](_0x2d83b6['timeout']);if(_0x281f73['result']===-0x1){return _0x281f73;}}return this[_0xd088('0xe')][_0xd088('0xbc')]();};AGIVertices['prototype'][_0xd088('0x4b')]=function(_0x5a8791){logger[_0xd088('0x2e')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5a8791[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x5a8791[_0xd088('0xbf')])){return this['channel']['error'](_0x5a8791,_0xd088('0xc0'));}_0x5a8791[_0xd088('0x4a')]=moment();if(this['isConfigured'](_0x5a8791['delay'])){_0x5a8791[_0xd088('0x4a')]=moment()[_0xd088('0xc1')](_0x5a8791[_0xd088('0xc2')],_0xd088('0xc3'));}if(!this['isConfigured'](_0x5a8791[_0xd088('0x4e')])){_0x5a8791[_0xd088('0x4e')]=0x2;}this[_0xd088('0x44')]['sync'](this,_0x5a8791);return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5a8791[_0xd088('0x49')],_0x5a8791[_0xd088('0xbf')],_0x5a8791['scheduledAt']));};AGIVertices[_0xd088('0x18')][_0xd088('0xc4')]=function(_0x308aca){logger['info'](util[_0xd088('0x2a')](_0xd088('0xc5'),_0x308aca[_0xd088('0x37')]));var _0x4ce2b4=this[_0xd088('0xe')][_0xd088('0x59')](_0x308aca[_0xd088('0xc6')],_0x308aca['options']);if(_0x4ce2b4[_0xd088('0xa3')]===-0x1){return _0x4ce2b4;}return this['channel']['noop'](util['format'](_0xd088('0xc7'),_0x308aca[_0xd088('0xc6')],_0x308aca['options']));};AGIVertices['prototype'][_0xd088('0xc8')]=function(_0x248f0b){logger['info'](util['format'](_0xd088('0xc9'),_0x248f0b[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x248f0b[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}var _0x970aaa='\x22'+_0x248f0b[_0xd088('0x5f')]+'\x22';if(this['isConfigured'](_0x248f0b[_0xd088('0x7a')])){_0x970aaa+=','+_0x248f0b['options'];}var _0x13b85c=this[_0xd088('0xe')][_0xd088('0x59')](_0xd088('0xad'),_0x970aaa);if(_0x13b85c[_0xd088('0xa3')]===-0x1){return _0x13b85c;}return this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x970aaa));};AGIVertices[_0xd088('0x18')][_0xd088('0xca')]=function(_0x8d9a74){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xcb'),_0x8d9a74[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x8d9a74[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}var _0x83aba6='\x22'+_0x8d9a74[_0xd088('0x5f')]+'\x22';if(this[_0xd088('0x86')](_0x8d9a74[_0xd088('0x7a')])){_0x83aba6+=','+_0x8d9a74[_0xd088('0x7a')];}var _0x58e313=this['channel']['exec'](_0xd088('0xad'),_0x83aba6);if(_0x58e313[_0xd088('0xa3')]===-0x1){return _0x58e313;}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xae'),_0x83aba6));};AGIVertices[_0xd088('0x18')][_0xd088('0xcc')]=function(_0x3c1b69){logger[_0xd088('0x2e')](util['format'](_0xd088('0xcd'),_0x3c1b69[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x3c1b69['grammar'])){return this[_0xd088('0xe')][_0xd088('0xab')]('no\x20grammar\x20configured');}var _0x52672e=_0x3c1b69[_0xd088('0xb1')];if(this[_0xd088('0x86')](_0x3c1b69[_0xd088('0x7a')])){_0x52672e+=','+_0x3c1b69[_0xd088('0x7a')];}var _0x433221=this[_0xd088('0xe')][_0xd088('0x59')](_0xd088('0xb3'),_0x52672e);if(_0x433221[_0xd088('0xa3')]===-0x1){return _0x433221;}var _0xea6b66=this[_0xd088('0xa2')](_0xd088('0xb4'),_0xd088('0xce'));if(_0xea6b66[_0xd088('0xa3')]===-0x1){return _0xea6b66;}var _0x179e2f=this[_0xd088('0xa2')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x179e2f[_0xd088('0xa3')]===-0x1){return _0x179e2f;}var _0x1f49e6=this[_0xd088('0xa2')](_0xd088('0xb6'),_0xd088('0xcf'));if(_0x1f49e6['result']===-0x1){return _0x1f49e6;}return this['channel']['noop'](util[_0xd088('0x2a')](_0xd088('0xd0'),_0x52672e));};AGIVertices[_0xd088('0x18')][_0xd088('0xd1')]=function(_0x2c46a0){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xd2'),_0x2c46a0[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x2c46a0['grammar'])){return this[_0xd088('0xe')]['noop'](_0xd088('0xb2'));}var _0x16f7d4=_0x2c46a0[_0xd088('0xb1')];if(this[_0xd088('0x86')](_0x2c46a0[_0xd088('0x7a')])){_0x16f7d4+=','+_0x2c46a0['options'];}var _0x1b44af=this[_0xd088('0xe')][_0xd088('0x59')](_0xd088('0xb3'),_0x16f7d4);if(_0x1b44af[_0xd088('0xa3')]===-0x1){return _0x1b44af;}var _0xdfede=this[_0xd088('0xa2')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0xdfede[_0xd088('0xa3')]===-0x1){return _0xdfede;}var _0x123464=this[_0xd088('0xa2')](_0xd088('0xb5'),_0xd088('0xd3'));if(_0x123464[_0xd088('0xa3')]===-0x1){return _0x123464;}var _0x224c64=this[_0xd088('0xa2')](_0xd088('0xb6'),_0xd088('0xd4'));if(_0x224c64[_0xd088('0xa3')]===-0x1){return _0x224c64;}return this[_0xd088('0xe')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x16f7d4));};AGIVertices['prototype']['database']=function(_0x4b3f8f){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xd5'),_0x4b3f8f[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x4b3f8f[_0xd088('0xd6')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x4b3f8f,_0xd088('0xd7'));}var _0x276d41=this[_0xd088('0x19')]['sync'](this,_0x4b3f8f[_0xd088('0xd6')]);if(!_0x276d41){return this[_0xd088('0xe')]['error'](_0x4b3f8f,_0xd088('0xd8'));}if(!this['isConfigured'](_0x4b3f8f[_0xd088('0xd9')])){return this[_0xd088('0xe')]['error'](_0x4b3f8f,'no\x20query\x20configured');}var _0x337ab4=_0x4b3f8f[_0xd088('0xd9')][_0xd088('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xda'),_0x337ab4));var _0xb20c62=this[_0xd088('0xdb')][_0xd088('0x71')](this,_0x276d41,_0x337ab4);this['createSquareDetailsReport']['sync'](this,_0x4b3f8f,_0x337ab4);if(!this['isConfigured'](_0x4b3f8f[_0xd088('0xdc')])){return this['channel'][_0xd088('0xab')](_0xd088('0xdd'));}var _0x4a098a=this[_0xd088('0x11')][_0xd088('0x71')](this,_0x4b3f8f[_0xd088('0xdc')]);if(!_0x4a098a){return this[_0xd088('0xe')][_0xd088('0x31')](_0x4b3f8f,_0xd088('0xde'));}var _0x3bb4b0=this;_0xb20c62[_0xd088('0xdf')](function(_0x1ec3df,_0x3f2140){Object[_0xd088('0xe0')](_0x1ec3df)['forEach'](function(_0x502020){_0x3bb4b0[_0xd088('0xe')][_0xd088('0xa6')](util['format'](_0xd088('0xe1'),_0x4a098a,_0x3f2140,_0x502020),_0x1ec3df[_0x502020]);});});this[_0xd088('0xe')][_0xd088('0xa6')](util['format'](_0xd088('0xe2'),_0x4a098a),_0xb20c62[_0xd088('0x9c')]);return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xe3'),_0x4a098a));};AGIVertices[_0xd088('0x18')][_0xd088('0xe4')]=function(_0x647925){logger['debug'](util[_0xd088('0x2a')](_0xd088('0xe5'),_0x647925[_0xd088('0x37')]));if(!this['isConfigured'](_0x647925['sip_id'])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x647925,_0xd088('0xe6'));}var _0x533cf9=this[_0xd088('0x1c')][_0xd088('0x71')](this,_0x647925[_0xd088('0xe7')]);if(!_0x533cf9){return this[_0xd088('0xe')][_0xd088('0x31')](_0x647925,_0xd088('0xe8'));}var _0x1893f3=this['channel'][_0xd088('0x59')](_0xd088('0xe9'),[util[_0xd088('0x2a')](_0xd088('0xea'),_0x533cf9),_0x647925[_0xd088('0x68')],_0x647925[_0xd088('0xeb')],_0x647925[_0xd088('0x67')]]);if(_0x1893f3['result']===-0x1){return _0x1893f3;}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xec'),_0xd088('0xe9')));};AGIVertices[_0xd088('0x18')][_0xd088('0xed')]=function(_0x517412){logger[_0xd088('0x2e')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x517412[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x517412[_0xd088('0x81')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xee'));}if(!this['isConfigured'](_0x517412['text'])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}this[_0xd088('0xe')][_0xd088('0xef')]=!![];this[_0xd088('0x36')](_0x517412);this[_0xd088('0x43')](_0x517412[_0xd088('0x5f')],'in','','');this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x517412[_0xd088('0x5f')]));var _0x54197f=this[_0xd088('0x7b')][_0xd088('0x71')](this,_0x517412);if(_0x54197f){for(var _0x107910 in _0x54197f){if(_0x54197f[_0xd088('0x96')](_0x107910)){this[_0xd088('0xe')][_0xd088('0xa6')](util[_0xd088('0x2a')](_0xd088('0xf0'),_0x107910[_0xd088('0x6b')]()),_0x54197f[_0x107910]);}}this['createSquareMessage'](_0x54197f[_0xd088('0xf1')],'out','dialogflow','');return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xf2'),_0x54197f[_0xd088('0xf1')]));}return this['channel'][_0xd088('0x31')](_0x517412,_0xd088('0xf3'));};AGIVertices[_0xd088('0x18')][_0xd088('0xf4')]=function(_0x947153){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xf5'),_0x947153[_0xd088('0x37')]));if(!this['isConfigured'](_0x947153[_0xd088('0x7d')])){return this[_0xd088('0xe')]['noop']('no\x20project_id\x20configured');}if(!this[_0xd088('0x86')](_0x947153[_0xd088('0x7e')])){return this['channel']['noop'](_0xd088('0xf6'));}if(!this[_0xd088('0x86')](_0x947153[_0xd088('0x7f')])){return this[_0xd088('0xe')]['noop'](_0xd088('0xf7'));}if(!this[_0xd088('0x86')](_0x947153['dialogflowV2_language'])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xf8'));}if(!this[_0xd088('0x86')](_0x947153[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')]('no\x20text\x20configured');}this[_0xd088('0xe')][_0xd088('0xef')]=!![];this[_0xd088('0x36')](_0x947153);this[_0xd088('0x43')](_0x947153[_0xd088('0x5f')],'in','','');this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')]('Trying\x20DialogflowV2:\x20%s',_0x947153[_0xd088('0x5f')]));var _0x1568b5=this[_0xd088('0x7c')][_0xd088('0x71')](this,_0x947153);if(_0x1568b5){for(var _0x35326d in _0x1568b5){if(_0x1568b5[_0xd088('0x96')](_0x35326d)){if(_0x35326d!==_0xd088('0xf9')){this['channel'][_0xd088('0xa6')](util[_0xd088('0x2a')](_0xd088('0xf0'),_0x35326d[_0xd088('0x6b')]()),_0x1568b5[_0x35326d]);}}}this['createSquareMessage'](_0x1568b5[_0xd088('0xf1')],'out','dialogflowV2',_0x1568b5['providerResponse']);return this[_0xd088('0xe')][_0xd088('0xab')](util['format']('DialogflowV2\x20Result\x20%s',_0x1568b5[_0xd088('0xf1')]));}return this[_0xd088('0xe')][_0xd088('0x31')](_0x947153,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xd088('0x18')][_0xd088('0xfa')]=function(_0x41a9c){logger['info'](util['format'](_0xd088('0xfb'),_0x41a9c[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x41a9c[_0xd088('0xfc')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xfd'));}if(!this[_0xd088('0x86')](_0x41a9c[_0xd088('0xfe')])){return this['channel']['noop'](_0xd088('0xff'));}if(!this['isConfigured'](_0x41a9c[_0xd088('0x100')])){return this['channel']['noop'](_0xd088('0x101'));}if(!this[_0xd088('0x86')](_0x41a9c['ndassistant_url'])){return this[_0xd088('0xe')]['noop']('no\x20text\x20configured');}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x41a9c);this['createSquareMessage'](_0x41a9c[_0xd088('0x5f')],'in','','');this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x102'),_0x41a9c['text']));var _0xca11a0=this[_0xd088('0x80')][_0xd088('0x71')](this,_0x41a9c);if(_0xca11a0){for(var _0x30ce74 in _0xca11a0){if(_0xca11a0[_0xd088('0x96')](_0x30ce74)){this[_0xd088('0xe')][_0xd088('0xa6')](util[_0xd088('0x2a')]('SESTEK_NDA_%s',_0x30ce74[_0xd088('0x6b')]()),_0xca11a0[_0x30ce74]);}}this[_0xd088('0x43')](_0xca11a0[_0xd088('0xf1')],_0xd088('0x103'),_0xd088('0xfa'),'');if(_0xca11a0[_0xd088('0x104')]){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x105'),_0xca11a0[_0xd088('0x104')]));var _0x19c267=this[_0xd088('0xe')][_0xd088('0x106')](_0xca11a0[_0xd088('0x104')]);try{fs[_0xd088('0x107')](_0xca11a0['audiofile']+_0xd088('0x108'));}catch(_0xf165a5){logger[_0xd088('0x31')](_0xf165a5);}return _0x19c267;}else{return this[_0xd088('0xe')][_0xd088('0xab')](util['format'](_0xd088('0x109'),_0xca11a0[_0xd088('0xf1')]));}}return this[_0xd088('0xe')][_0xd088('0x31')](_0x41a9c,_0xd088('0x10a'));};AGIVertices[_0xd088('0x18')][_0xd088('0x10b')]=function(_0x49a56a){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x10c'),_0x49a56a[_0xd088('0x37')]));return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x10b'));};AGIVertices['prototype'][_0xd088('0x10d')]=function(_0x1afecb){logger['info'](util[_0xd088('0x2a')](_0xd088('0x10e'),_0x1afecb[_0xd088('0x37')]));var _0x216932='';if(_0x1afecb[_0xd088('0x10f')]){if(!this['isConfigured'](_0x1afecb[_0xd088('0x10f')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1afecb,_0xd088('0x110'));}else{var _0x4aaa47=parseInt(_0x1afecb[_0xd088('0x10f')],0xa);if(isNaN(_0x4aaa47)){_0x216932=_0x1afecb[_0xd088('0x10f')];}else{_0x216932=this['getTrunk']['sync'](this,_0x1afecb[_0xd088('0x10f')]);if(!_0x216932){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1afecb,'no\x20trunk\x20found');}}}}else if(_0x1afecb['trunk_name']){_0x216932=_0x1afecb[_0xd088('0x111')];}else{return this['channel'][_0xd088('0x31')](_0x1afecb,'no\x20trunk\x20selected');}var _0x445bd6=this[_0xd088('0xe')]['exec'](_0xd088('0xe9'),[util[_0xd088('0x2a')](_0xd088('0x112'),_0x216932,_0x1afecb[_0xd088('0x49')]),_0x1afecb[_0xd088('0x68')],_0x1afecb[_0xd088('0xeb')],_0x1afecb[_0xd088('0x67')]]);if(_0x445bd6[_0xd088('0xa3')]===-0x1){return _0x445bd6;}return this[_0xd088('0xe')]['noop'](util['format'](_0xd088('0xec'),_0xd088('0xe9')));};AGIVertices['prototype'][_0xd088('0x113')]=function(_0x313072){logger['info'](util['format'](_0xd088('0x114'),_0x313072['label']));return this[_0xd088('0xe')][_0xd088('0xab')]('finally');};AGIVertices[_0xd088('0x18')][_0xd088('0xc')]=function(_0x254a20){logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x254a20[_0xd088('0x37')]));if(_0x254a20[_0xd088('0xa7')]===0x0){return this[_0xd088('0xa8')](_0x254a20);}_0x254a20['retry']-=0x1;if(!this['isConfigured'](_0x254a20['file_id'])){return this[_0xd088('0xe')]['error'](_0x254a20,'no\x20file\x20audio\x20selected');}var _0x58a24e=this[_0xd088('0x20')]['sync'](this,_0x254a20[_0xd088('0x115')]);if(!_0x58a24e){return this[_0xd088('0xe')]['error'](_0x254a20,_0xd088('0x116'));}if(!this[_0xd088('0x86')](_0x254a20[_0xd088('0xdc')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0xd088('0xdd'));}var _0x29d64e=this[_0xd088('0xe')]['getData'](_0x58a24e,_0x254a20['response'],_0x254a20[_0xd088('0x117')]);var _0x135341=_0x29d64e[_0xd088('0xa3')]?_0x29d64e[_0xd088('0xa3')][_0xd088('0x4d')]():'';logger[_0xd088('0x2e')]('test',JSON[_0xd088('0x74')](_0x29d64e));if(_0x29d64e['result']===-0x1){this['createSquareDetailsReport'][_0xd088('0x71')](this,_0x254a20,_0x135341);return _0x29d64e;}else if(_0x29d64e[_0xd088('0xa5')]===_0xd088('0x68')){_0x29d64e['result']=_0x135341[_0xd088('0x9c')]>=parseInt(_0x254a20['mindigit'])?'x':'i';}else{_0x29d64e[_0xd088('0xa3')]=_0x135341['length']>=parseInt(_0x254a20[_0xd088('0x118')])&&_0x135341[_0xd088('0x9c')]<=parseInt(_0x254a20[_0xd088('0x117')])?'x':'i';}var _0x33388d=this[_0xd088('0x11')][_0xd088('0x71')](this,_0x254a20[_0xd088('0xdc')]);if(!_0x33388d){return this['channel'][_0xd088('0x31')](_0x254a20,_0xd088('0xde'));}this[_0xd088('0xe')][_0xd088('0xa6')](_0x33388d,_0x135341);if(this[_0xd088('0x86')](_0x254a20[_0xd088('0x119')])){var _0x4e0d3c=parseInt(_0x254a20[_0xd088('0x119')],0xa);var _0x2b3a76=rs[_0xd088('0x11a')]({'charset':'*','length':_0x4e0d3c});var _0x6f1b6b=_0x135341['length'];if(_0x6f1b6b>0x0){if(_0x6f1b6b>_0x4e0d3c){this[_0xd088('0x36')][_0xd088('0x71')](this,_0x254a20,_0x254a20[_0xd088('0x11b')]==='first'?_0x2b3a76+_0x135341['substr'](_0x4e0d3c):_0x135341[_0xd088('0x11c')](0x0,_0x6f1b6b-_0x4e0d3c)+_0x2b3a76);}else{this[_0xd088('0x36')][_0xd088('0x71')](this,_0x254a20,rs[_0xd088('0x11a')]({'charset':'*','length':_0x6f1b6b}));}}else{this[_0xd088('0x36')][_0xd088('0x71')](this,_0x254a20,'');}}else{this[_0xd088('0x36')][_0xd088('0x71')](this,_0x254a20,_0x135341);}return _0x29d64e;};AGIVertices[_0xd088('0x18')]['getsecretdigits']=function(_0x4dab55){logger['info'](util[_0xd088('0x2a')](_0xd088('0x11d'),_0x4dab55[_0xd088('0x37')]));return this[_0xd088('0xc')](_0x4dab55);};AGIVertices[_0xd088('0x18')][_0xd088('0x11e')]=function(_0x44f2cd){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x11f'),_0x44f2cd[_0xd088('0x37')]));this[_0xd088('0x36')][_0xd088('0x71')](this,_0x44f2cd,_0x44f2cd[_0xd088('0x120')]);return this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')](_0xd088('0x121'),_0x44f2cd[_0xd088('0x120')]));};AGIVertices[_0xd088('0x18')]['awspolly']=function(_0x5bb1ff){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x122'),_0x5bb1ff[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x5bb1ff['aws_access_key_id'])||!this['isConfigured'](_0x5bb1ff[_0xd088('0x89')])){return this['channel']['noop'](_0xd088('0x123'));}if(!this[_0xd088('0x86')](_0x5bb1ff['text'])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')](_0xd088('0x124'),_0x5bb1ff[_0xd088('0x5f')]));var _0x1181eb=this[_0xd088('0x88')][_0xd088('0x71')](this,_0x5bb1ff);if(_0x1181eb){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x125'),_0x1181eb));var _0x46b684=this[_0xd088('0xe')][_0xd088('0x106')](_0x1181eb);try{fs[_0xd088('0x107')](_0x1181eb+_0xd088('0x108'));}catch(_0x539ed6){logger[_0xd088('0x31')](_0x539ed6);}return _0x46b684;}return this['channel']['error'](_0x5bb1ff,_0xd088('0x126'));};AGIVertices[_0xd088('0x18')][_0xd088('0x127')]=function(_0x3a1771){logger['info'](util['format'](_0xd088('0x128'),_0x3a1771[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x3a1771[_0xd088('0x8e')])||!this[_0xd088('0x86')](_0x3a1771[_0xd088('0x89')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x123'));}if(!this[_0xd088('0x86')](_0x3a1771[_0xd088('0x8f')])){return this[_0xd088('0xe')]['noop'](_0xd088('0x129'));}if(!this[_0xd088('0x86')](_0x3a1771[_0xd088('0x5f')])){return this['channel']['noop'](_0xd088('0xac'));}this[_0xd088('0xe')][_0xd088('0xef')]=!![];this[_0xd088('0x36')](_0x3a1771);this[_0xd088('0x43')](_0x3a1771['text'],'in','','');this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')]('Trying\x20Amazon\x20Lex:\x20%s',_0x3a1771[_0xd088('0x5f')]));var _0x455a9d=this[_0xd088('0x8d')][_0xd088('0x71')](this,_0x3a1771);if(_0x455a9d){for(var _0x1d4e1a in _0x455a9d){if(_0x455a9d[_0xd088('0x96')](_0x1d4e1a)&&_['isString'](_0x455a9d[_0x1d4e1a])){this[_0xd088('0xe')][_0xd088('0xa6')](util[_0xd088('0x2a')]('AWS_LEX_%s',_0x1d4e1a[_0xd088('0x6b')]()),_0x455a9d[_0x1d4e1a]);}}if(_[_0xd088('0x46')](_0x455a9d[_0xd088('0x78')])){return this[_0xd088('0xe')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xd088('0x43')](_0x455a9d[_0xd088('0x78')],_0xd088('0x103'),_0xd088('0x12a'),'');return this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')](_0xd088('0x12b'),_0x455a9d[_0xd088('0x78')]));}}return this['channel']['error'](_0x3a1771,_0xd088('0x12c'));};AGIVertices[_0xd088('0x18')][_0xd088('0x12d')]=function(_0x1d9401){logger['info'](util['format'](_0xd088('0x12e'),_0x1d9401[_0xd088('0x37')],_0x1d9401[_0xd088('0x68')]));if(!this[_0xd088('0x86')](_0x1d9401[_0xd088('0x81')])){return this[_0xd088('0xe')][_0xd088('0xab')]('no\x20key\x20configured');}var _0x120440=_0xd088('0x12f');var _0x5d0970=util[_0xd088('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xd088('0x11a')](0x4));var _0x96dc97=util[_0xd088('0x2a')](_0xd088('0x9e'),_0x5d0970,_0x120440);var _0x24b592=!![];if(_0x1d9401['beep']===_0xd088('0x130')){_0x24b592=![];}var _0x1d7157=this[_0xd088('0xe')][_0xd088('0x131')](_0x5d0970,_0x120440,_0x1d9401[_0xd088('0x132')],_0x1d9401['timeout'],undefined,_0x24b592);if(_0x1d7157[_0xd088('0xa3')]!==-0x1){this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x133'),_0x96dc97));var _0x3ecb69=this[_0xd088('0x90')][_0xd088('0x71')](this,_0x1d9401,_0x96dc97);if(_0x3ecb69){for(var _0x4cd4e8 in _0x3ecb69){if(_0x3ecb69[_0xd088('0x96')](_0x4cd4e8)){this[_0xd088('0xe')]['setVariable'](util['format'](_0xd088('0x134'),_0x4cd4e8['toUpperCase']()),_0x3ecb69[_0x4cd4e8]);}}return this[_0xd088('0xe')][_0xd088('0xab')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0xd088('0x74')](_0x3ecb69)));}}return _0x1d7157;};AGIVertices['prototype'][_0xd088('0x135')]=function(_0x1bb588){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x136'),_0x1bb588['label']));if(!this[_0xd088('0x86')](_0x1bb588[_0xd088('0x137')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x138'));}if(!this['isConfigured'](_0x1bb588[_0xd088('0x139')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x13a'));}var _0xe3bd98=_0xd088('0x12f');var _0x57fd84=util[_0xd088('0x2a')](_0xd088('0x13b'),FILES_PATH,rs[_0xd088('0x11a')](0x4));var _0x4f77e4=util[_0xd088('0x2a')](_0xd088('0x9e'),_0x57fd84,_0xe3bd98);var _0x208049=!![];if(_0x1bb588[_0xd088('0x13c')]==='NOBEEP'){_0x208049=![];}var _0x2cd7bc=this[_0xd088('0xe')][_0xd088('0x131')](_0x57fd84,_0xe3bd98,_0x1bb588[_0xd088('0x132')],_0x1bb588[_0xd088('0x68')],undefined,_0x208049);if(_0x2cd7bc['result']!==-0x1){this[_0xd088('0xe')][_0xd088('0xab')](util['format']('tilde\x20%s\x20file\x20created',_0x4f77e4));var _0xebd5e6=this[_0xd088('0x92')][_0xd088('0x71')](this,_0x1bb588,_0x4f77e4);if(_0xebd5e6){for(var _0x5d3932 in _0xebd5e6){if(_0xebd5e6[_0xd088('0x96')](_0x5d3932)){this[_0xd088('0xe')]['setVariable'](util[_0xd088('0x2a')]('TILDE_ASR_%s',_0x5d3932[_0xd088('0x6b')]()),_0xebd5e6[_0x5d3932]);}}return this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x13d'),JSON[_0xd088('0x74')](_0xebd5e6)));}}return _0x2cd7bc;};AGIVertices[_0xd088('0x18')]['gotoc']=function(_0x1fe147){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x13e'),_0x1fe147['label']));return this[_0xd088('0xe')][_0xd088('0x13f')](_0x1fe147[_0xd088('0x140')],_0x1fe147[_0xd088('0x3e')],_0x1fe147[_0xd088('0x3f')]);};AGIVertices[_0xd088('0x18')][_0xd088('0x141')]=function(_0x43c851){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x142'),_0x43c851['label']));if(!this['isConfigured'](_0x43c851[_0xd088('0x143')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x43c851,'no\x20condition\x20configured');}try{var _0x3dd7b1=eval(_0x43c851['condition'])?_0xd088('0x144'):'false';this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x145'),_0x43c851[_0xd088('0x143')],_0x3dd7b1));return{'code':0xc8,'result':_0x3dd7b1};}catch(_0x5bdf9b){return{'code':0xc8,'result':_0xd088('0x146')};}};AGIVertices['prototype'][_0xd088('0x147')]=function(_0x21af47){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x148'),_0x21af47[_0xd088('0x37')]));if(!this['isConfigured'](_0x21af47['interval_id'])){return this['channel'][_0xd088('0x31')](_0x21af47,'no\x20interval\x20configured');}var _0x20c47e=this['getIntervals']['sync'](this,_0x21af47['interval_id']);if(!_0x20c47e){return this['channel'][_0xd088('0x31')](_0x21af47,_0xd088('0x149'));}for(var _0x4f4629=0x0;_0x4f4629<_0x20c47e[_0xd088('0x9c')];_0x4f4629+=0x1){var _0xb53501=this['channel'][_0xd088('0x11')](util[_0xd088('0x2a')](_0xd088('0x14a'),_0x20c47e[_0x4f4629]));if(_0xb53501[_0xd088('0xa3')]===-0x1){return _0xb53501;}logger[_0xd088('0x2e')](util['format'](_0xd088('0x14b'),_0x20c47e[_0x4f4629],_0xb53501[_0xd088('0xa5')]));if(_0xb53501[_0xd088('0xa5')]==='true'){logger[_0xd088('0x2e')](util['format']('IFTIME\x20%s\x20%s',_0x20c47e[_0x4f4629],'true'));this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')](_0xd088('0x14b'),_0x20c47e[_0x4f4629],'true'));return{'code':0xc8,'result':_0xd088('0x144')};}else{logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('IFTIME\x20%s\x20%s',_0x20c47e[_0x4f4629],_0xd088('0x146')));this[_0xd088('0xe')]['noop'](util['format'](_0xd088('0x14b'),_0x20c47e[_0x4f4629],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xd088('0x18')][_0xd088('0x14c')]=function(_0x2ca92c){logger['info'](util[_0xd088('0x2a')](_0xd088('0x14d'),_0x2ca92c[_0xd088('0x37')]));return this['channel'][_0xd088('0x14c')]();};AGIVertices[_0xd088('0x18')][_0xd088('0x14e')]=function(_0x59ff50){logger['info'](util[_0xd088('0x2a')](_0xd088('0x14f'),_0x59ff50['label']));if(!this[_0xd088('0x86')](_0x59ff50[_0xd088('0x81')])){return this['channel'][_0xd088('0xab')](_0xd088('0xee'));}var _0x7d602e='wav';var _0x414506=util[_0xd088('0x2a')](_0xd088('0x13b'),FILES_PATH,rs[_0xd088('0x11a')](0x4));var _0x50ed9e=util['format'](_0xd088('0x9e'),_0x414506,_0x7d602e);var _0x4be8ae=!![];if(_0x59ff50[_0xd088('0x13c')]===_0xd088('0x130')){_0x4be8ae=![];}var _0x3b798b=this['channel'][_0xd088('0x131')](_0x414506,_0x7d602e,_0x59ff50[_0xd088('0x132')],_0x59ff50[_0xd088('0x68')],undefined,_0x4be8ae);if(_0x3b798b[_0xd088('0xa3')]!==-0x1){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x150'),_0x50ed9e));var _0x30c0fe=this[_0xd088('0x84')][_0xd088('0x71')](this,_0x59ff50,_0x50ed9e);if(_0x30c0fe){for(var _0x527c87 in _0x30c0fe){if(_0x30c0fe['hasOwnProperty'](_0x527c87)){this['channel']['setVariable'](util['format'](_0xd088('0x151'),_0x527c87[_0xd088('0x6b')]()),_0x30c0fe[_0x527c87]);}}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x152'),JSON[_0xd088('0x74')](_0x30c0fe)));}}return _0x3b798b;};AGIVertices['prototype'][_0xd088('0x153')]=function(_0x1e2f9e){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x154'),_0x1e2f9e[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x1e2f9e['key'])){return this['channel'][_0xd088('0xab')](_0xd088('0xee'));}if(!this[_0xd088('0x86')](_0x1e2f9e[_0xd088('0x5f')])){return this['channel'][_0xd088('0xab')](_0xd088('0xac'));}this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x155'),_0x1e2f9e[_0xd088('0x5f')]));var _0x1dc845=this['ispeechTTS'][_0xd088('0x71')](this,_0x1e2f9e);if(_0x1dc845){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('ispeech\x20%s\x20file\x20created',_0x1dc845));var _0x5d04c4=this[_0xd088('0xe')][_0xd088('0x106')](_0x1dc845,_0x1e2f9e['intKey']);try{fs[_0xd088('0x107')](_0x1dc845+'.wav');}catch(_0x22be15){logger[_0xd088('0x31')](_0x22be15);}return _0x5d04c4;}return this[_0xd088('0xe')][_0xd088('0x31')](_0x1e2f9e,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd088('0x18')][_0xd088('0x156')]=function(_0x1b375f){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x157'),_0x1b375f['label']));if(!this['isConfigured'](_0x1b375f[_0xd088('0x158')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1b375f,_0xd088('0x159'));}logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x15a'),this['channel'][_0xd088('0x3a')],_0x1b375f[_0xd088('0x158')]));var _0x2b31ff=this[_0xd088('0x55')][_0xd088('0x71')](this,_0x1b375f[_0xd088('0x158')]);if(_0x2b31ff){logger[_0xd088('0x2e')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xd088('0xe')][_0xd088('0x3a')],_0x1b375f[_0xd088('0x158')]));this['channel'][_0xd088('0xab')](util['format'](_0xd088('0x15b'),this[_0xd088('0xe')][_0xd088('0x3a')],_0x1b375f[_0xd088('0x158')]));return{'code':0xc8,'result':_0xd088('0x15c')};}else{logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd088('0x3a')],_0x1b375f['findBy']));this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd088('0xe')][_0xd088('0x3a')],_0x1b375f['findBy']));return{'code':0xc8,'result':_0xd088('0x15d')};}};AGIVertices[_0xd088('0x18')][_0xd088('0x15e')]=function(_0x4fb800){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x15f'),_0x4fb800['label']));if(!this['isConfigured'](_0x4fb800[_0xd088('0x158')])){return this[_0xd088('0xe')]['error'](_0x4fb800,_0xd088('0x159'));}logger[_0xd088('0x2e')](util['format'](_0xd088('0x15a'),this[_0xd088('0xe')][_0xd088('0x3a')],_0x4fb800[_0xd088('0x158')]));var _0x28534e=this['agentLogout'][_0xd088('0x71')](this,_0x4fb800[_0xd088('0x158')]);if(_0x28534e){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x15b'),this['channel'][_0xd088('0x3a')],_0x4fb800[_0xd088('0x158')]));this['channel'][_0xd088('0xab')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd088('0x3a')],_0x4fb800[_0xd088('0x158')]));return{'code':0xc8,'result':_0xd088('0x15c')};}else{logger['info'](util[_0xd088('0x2a')](_0xd088('0x160'),this['channel'][_0xd088('0x3a')],_0x4fb800[_0xd088('0x158')]));this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x160'),this[_0xd088('0xe')]['callerid'],_0x4fb800[_0xd088('0x158')]));return{'code':0xc8,'result':_0xd088('0x15d')};}};AGIVertices[_0xd088('0x18')]['math']=function(_0x5244f5){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x161'),_0x5244f5[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x5244f5['operation'])){return this['channel'][_0xd088('0x31')](_0x5244f5,_0xd088('0x162'));}this[_0xd088('0xe')][_0xd088('0xab')](util['format'](_0xd088('0x163'),_0x5244f5['operation']));var _0x3ef93c=eval(_0x5244f5[_0xd088('0x164')]);if(!this[_0xd088('0x86')](_0x5244f5['variable_id'])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xdd'));}var _0x4b83b1=this[_0xd088('0x11')][_0xd088('0x71')](this,_0x5244f5[_0xd088('0xdc')]);if(!_0x4b83b1){return this['channel'][_0xd088('0x31')](_0x5244f5,_0xd088('0xde'));}if(_[_0xd088('0x9f')](_0x3ef93c)){var _0x1ed4d5=this;_0x3ef93c[_0xd088('0xdf')](function(_0x27d683,_0x14c6bd){_0x1ed4d5[_0xd088('0xe')][_0xd088('0xa6')](util['format'](_0xd088('0x165'),_0x4b83b1,_0x14c6bd),_0x27d683);});return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('variable\x20%s[key]\x20set',_0x4b83b1));}else{return this['channel'][_0xd088('0xa6')](_0x4b83b1,_0x3ef93c);}};AGIVertices[_0xd088('0x18')][_0xd088('0x166')]=function(_0x414dbe){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x414dbe[_0xd088('0x37')]));if(_0x414dbe[_0xd088('0xa7')]===0x0){return this[_0xd088('0xa8')](_0x414dbe);}_0x414dbe[_0xd088('0xa7')]-=0x1;if(!this[_0xd088('0x86')](_0x414dbe[_0xd088('0x115')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x414dbe,_0xd088('0x167'));}var _0x1823e3=this[_0xd088('0x20')][_0xd088('0x71')](this,_0x414dbe[_0xd088('0x115')]);if(!_0x1823e3){return this[_0xd088('0xe')][_0xd088('0x31')](_0x414dbe,_0xd088('0x116'));}var _0x3527d6=this[_0xd088('0xe')][_0xd088('0x168')](_0x1823e3,_0x414dbe[_0xd088('0x169')],_0x414dbe[_0xd088('0x16a')]);var _0x3658a1=_0x3527d6[_0xd088('0xa3')];if(_0x3527d6[_0xd088('0xa3')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x414dbe,'-1');return _0x3527d6;}else if(_0x3527d6[_0xd088('0xa5')]==='timeout'){_0x3527d6[_0xd088('0xa3')]=_0x3527d6[_0xd088('0xa3')]['length']>0x0?_0x3527d6[_0xd088('0xa3')]:'t';}else if(_[_0xd088('0x45')](_0x3527d6[_0xd088('0xa3')])){_0x3527d6[_0xd088('0xa3')]='#';_0x3658a1='#';}if(!this[_0xd088('0x86')](_0x414dbe[_0xd088('0xdc')])){this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xdd'));}else{var _0x4f7fba=this['getVariable']['sync'](this,_0x414dbe['variable_id']);if(!_0x4f7fba){return this['channel']['error'](_0x414dbe,_0xd088('0xde'));}this[_0xd088('0xe')][_0xd088('0xa6')](_0x4f7fba,_0x3658a1);}this[_0xd088('0x36')]['sync'](this,_0x414dbe,_0x3658a1);return _0x3527d6;};AGIVertices[_0xd088('0x18')][_0xd088('0xab')]=function(_0x54b731){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x54b731[_0xd088('0x37')]));return this[_0xd088('0xe')][_0xd088('0xab')](_0x54b731[_0xd088('0x16b')]||_0x54b731['label']);};AGIVertices[_0xd088('0x18')][_0xd088('0x16c')]=function(_0x23ff0e){logger['info'](util[_0xd088('0x2a')](_0xd088('0x16d'),_0x23ff0e[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x23ff0e[_0xd088('0x158')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x23ff0e,'no\x20find\x20by\x20configured');}logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x15a'),this['channel'][_0xd088('0x3a')],_0x23ff0e[_0xd088('0x158')]));var _0xc6a40a=this[_0xd088('0x4f')][_0xd088('0x71')](this,_0x23ff0e[_0xd088('0x16e')]);var _0x2ab364=this[_0xd088('0x51')]['sync'](this,_0x23ff0e[_0xd088('0x158')],_0xc6a40a);if(_0x2ab364){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x15b'),this[_0xd088('0xe')]['callerid'],_0x23ff0e[_0xd088('0x158')]));this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x15b'),this[_0xd088('0xe')][_0xd088('0x3a')],_0x23ff0e[_0xd088('0x158')]));return{'code':0xc8,'result':_0xd088('0x15c')};}else{logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x160'),this['channel'][_0xd088('0x3a')],_0x23ff0e[_0xd088('0x158')]));this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x15b'),this['channel'][_0xd088('0x3a')],_0x23ff0e[_0xd088('0x158')]));return{'code':0xc8,'result':_0xd088('0x15d')};}};AGIVertices['prototype'][_0xd088('0x16f')]=function(_0xba89c8){logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0xba89c8[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0xba89c8[_0xd088('0x115')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0xba89c8,'no\x20file\x20audio\x20selected');}var _0x5dc6b6=this['getSound']['sync'](this,_0xba89c8[_0xd088('0x115')]);if(!_0x5dc6b6){return this[_0xd088('0xe')][_0xd088('0x31')](_0xba89c8,_0xd088('0x116'));}var _0xc1d3c1=this[_0xd088('0xe')][_0xd088('0x59')]('PLAYBACK',[_0x5dc6b6,_0xba89c8[_0xd088('0xeb')]]);if(_0xc1d3c1[_0xd088('0xa3')]===-0x1){return _0xc1d3c1;}return this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xc7'),_0xd088('0x170'),_0x5dc6b6));};AGIVertices['prototype'][_0xd088('0x171')]=function(_0x2edfbb){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x2edfbb[_0xd088('0x37')]));if(!this['isConfigured'](_0x2edfbb[_0xd088('0x172')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x2edfbb,_0xd088('0x173'));}var _0x382548='';var _0x203f8d=parseInt(_0x2edfbb[_0xd088('0x172')],0xa);if(isNaN(_0x203f8d)){_0x382548=_0x2edfbb[_0xd088('0x172')];}else{_0x382548=this[_0xd088('0x14')][_0xd088('0x71')](this,_0x2edfbb[_0xd088('0x172')]);if(!_0x382548){return this['channel'][_0xd088('0x31')](_0x2edfbb,_0xd088('0x174'));}}var _0x344bb1='';if(this[_0xd088('0x86')](_0x2edfbb['file_id'])){var _0x263dde=this[_0xd088('0x20')]['sync'](this,_0x2edfbb[_0xd088('0x115')]);if(_0x263dde){_0x344bb1=_0x263dde;}}this[_0xd088('0x36')]['sync'](this,_0x2edfbb,_0x382548);if(_0x2edfbb[_0xd088('0xeb')][_0xd088('0x175')]('x')<0x0){_0x2edfbb[_0xd088('0xeb')]+='x';}if(_0x2edfbb[_0xd088('0xeb')][_0xd088('0x175')]('X')<0x0){_0x2edfbb[_0xd088('0xeb')]+='X';}this[_0xd088('0xe')][_0xd088('0xa6')]('XMCS-QUEUE',_0x382548?_0x382548['toLowerCase']():'');var _0x367cd6=this[_0xd088('0xe')]['exec']('QUEUE',[_0x382548,_0x2edfbb['opts'],_0x2edfbb['url'],_0x344bb1,_0x2edfbb[_0xd088('0x68')],_0x2edfbb[_0xd088('0xb8')],_0x2edfbb[_0xd088('0x176')],_0x2edfbb['gosub'],'',_0x2edfbb[_0xd088('0x177')]]);if(_0x367cd6[_0xd088('0xa3')]===-0x1){return _0x367cd6;}return this[_0xd088('0xe')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0xd088('0x178'),_0x382548));};AGIVertices[_0xd088('0x18')][_0xd088('0x179')]=function(_0x6dfb30){logger[_0xd088('0x2e')](util['format'](_0xd088('0x17a'),_0x6dfb30['label']));var _0x459d1a=_0x6dfb30['recordingFormat']||_0xd088('0x12f');var _0x228216=util[_0xd088('0x2a')](_0xd088('0x17b'),this['channel'][_0xd088('0x3c')],rs[_0xd088('0x11a')](0x5));var _0x3a519e=util[_0xd088('0x2a')]('%s/recordings/%s.%s',FILES_PATH,_0x228216,_0x459d1a);var _0x50c195=util[_0xd088('0x2a')]('%s/recordings/%s',FILES_PATH,_0x228216);this[_0xd088('0x3b')][_0xd088('0x71')](this,_0x6dfb30,_0x228216,_0x3a519e);this[_0xd088('0xe')][_0xd088('0xa6')](_0xd088('0x17c'),_0x228216);logger['info'](_0xd088('0x17d'),_0x50c195,_0x459d1a,_0x6dfb30['escape_digits'],_0x6dfb30[_0xd088('0x68')]);return this['channel'][_0xd088('0x131')](_0x50c195,_0x459d1a,_0x6dfb30[_0xd088('0x17e')],_0x6dfb30[_0xd088('0x68')],undefined,!![]);};AGIVertices[_0xd088('0x18')]['restapi']=function(_0x1529e0){logger[_0xd088('0x2e')](util['format'](_0xd088('0x17f'),_0x1529e0[_0xd088('0x37')]));if(!this['isConfigured'](_0x1529e0['url'])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x180'));}var _0x485e96=this[_0xd088('0x181')][_0xd088('0x71')](this,_0x1529e0);logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('Response:',util[_0xd088('0x182')](_0x485e96,{'showHidden':![],'depth':null})));if(!this[_0xd088('0x86')](_0x1529e0[_0xd088('0xdc')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x183'));}var _0x4d33ba=this['getVariable']['sync'](this,_0x1529e0['variable_id']);if(!_0x4d33ba){return this[_0xd088('0xe')]['error'](_0x1529e0,'no\x20variable\x20found');}this[_0xd088('0xe')][_0xd088('0xa6')](util[_0xd088('0x2a')]('%s_STATUS_CODE',_0x4d33ba),_0x485e96[_0xd088('0x77')]?_0x485e96[_0xd088('0x77')]:'200');this[_0xd088('0xe')][_0xd088('0xa6')](util['format'](_0xd088('0x184'),_0x4d33ba),_0x485e96[_0xd088('0x76')]?_0x485e96[_0xd088('0x76')]:'OK');if(_0x485e96[_0xd088('0x6c')]){try{this[_0xd088('0x9d')](_0x485e96[_0xd088('0x6c')],_0x4d33ba);}catch(_0x25db8e){logger[_0xd088('0x31')](util[_0xd088('0x2a')](_0xd088('0x185'),_0x4d33ba));}}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('variable\x20%s\x20set',_0x4d33ba));};AGIVertices[_0xd088('0x18')][_0xd088('0x186')]=function(_0x976592){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x976592[_0xd088('0x37')]));return this['channel'][_0xd088('0x187')](_0x976592[_0xd088('0x188')][_0xd088('0x5b')](/\s+/g,''),_0x976592[_0xd088('0x17e')]);};AGIVertices[_0xd088('0x18')][_0xd088('0x189')]=function(_0x3a7bba){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x3a7bba['label']));return this[_0xd088('0xe')]['sayNumber'](_0x3a7bba[_0xd088('0x69')][_0xd088('0x5b')](/\s+/g,''),_0x3a7bba[_0xd088('0x17e')]);};AGIVertices[_0xd088('0x18')][_0xd088('0x18a')]=function(_0x5eab1f){logger[_0xd088('0x2e')](util['format'](_0xd088('0x18b'),_0x5eab1f[_0xd088('0x37')]));return this['channel'][_0xd088('0x18c')](_0x5eab1f[_0xd088('0x5f')],_0x5eab1f[_0xd088('0x17e')]);};AGIVertices[_0xd088('0x18')]['sendMail']=function(_0x2e4672){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x18d'),_0x2e4672[_0xd088('0x37')]));if(!this['isConfigured'](_0x2e4672[_0xd088('0x18e')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x18f'));}var _0x43c66a=this[_0xd088('0x23')]['sync'](this,_0x2e4672[_0xd088('0x18e')]);if(!_0x43c66a||!_0x43c66a['Smtp']){return this['channel'][_0xd088('0x31')](_0x2e4672,_0xd088('0x190'));}var _0x4be14f={'from':util[_0xd088('0x2a')](_0xd088('0x191'),_0x43c66a[_0xd088('0x13')],_0x43c66a[_0xd088('0x192')]||_0x43c66a[_0xd088('0x193')][_0xd088('0x194')]),'to':_0x2e4672['to']||'','cc':_0x2e4672['cc']||'','bcc':_0x2e4672[_0xd088('0x195')]||'','subject':_0x2e4672['subject'],'html':_0x2e4672[_0xd088('0x5f')],'text':_0x2e4672['text']};var _0x15faa9={'tls':{'rejectUnauthorized':![]}};if(_0x43c66a[_0xd088('0x193')][_0xd088('0x196')]){_0x15faa9[_0xd088('0x196')]=_0x43c66a[_0xd088('0x193')][_0xd088('0x196')];}else{_0x15faa9[_0xd088('0x197')]=_0x43c66a['Smtp']['host'];_0x15faa9['port']=_0x43c66a[_0xd088('0x193')]['port'];_0x15faa9['secure']=_0x43c66a[_0xd088('0x193')][_0xd088('0x198')];}if(_0x43c66a[_0xd088('0x193')][_0xd088('0x199')]){_0x15faa9[_0xd088('0x19a')]={'user':_0x43c66a[_0xd088('0x193')][_0xd088('0x194')],'pass':_0x43c66a[_0xd088('0x193')]['pass']};}if(this[_0xd088('0x86')](_0x2e4672[_0xd088('0x19b')])){}logger[_0xd088('0x19c')](_0xd088('0x19d'),JSON[_0xd088('0x74')](_0x4be14f));this[_0xd088('0x36')]['sync'](this,_0x2e4672,_0x2e4672[_0xd088('0x18e')]);this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x19e'),_0x43c66a[_0xd088('0x13')]));this[_0xd088('0x25')][_0xd088('0x71')](this,_0x15faa9,_0x4be14f);return this[_0xd088('0xe')]['noop'](_0xd088('0x19f'));};AGIVertices[_0xd088('0x18')]['sendFax']=function(_0x252d0c){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x252d0c[_0xd088('0x37')]));return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x1a0'));};AGIVertices['prototype'][_0xd088('0x1a1')]=function(_0x14f663){logger['info'](util[_0xd088('0x2a')](_0xd088('0x1a2'),_0x14f663[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x14f663['sms_account_id'])){return this[_0xd088('0xe')]['noop']('no\x20sms\x20account\x20configured');}var _0x278f5c=this[_0xd088('0x33')]['sync'](this,_0x14f663[_0xd088('0x1a3')]);if(!_0x278f5c){return this[_0xd088('0xe')]['error'](_0x14f663,_0xd088('0x1a4'));}var _0x87451f={'body':_0x14f663[_0xd088('0x1a5')],'phone':_0x14f663['to']||'','SmsAccountId':_0x278f5c['id']};logger[_0xd088('0x19c')](_0xd088('0x1a6'),JSON[_0xd088('0x74')](_0x87451f));this['createSquareDetailsReport'][_0xd088('0x71')](this,_0x14f663,_0x14f663[_0xd088('0x1a3')]);this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')](_0xd088('0x1a7'),_0x278f5c[_0xd088('0x13')]));this[_0xd088('0x35')][_0xd088('0x71')](this,_0x87451f);return this[_0xd088('0xe')]['noop'](_0xd088('0x1a8'));};AGIVertices[_0xd088('0x18')][_0xd088('0x1a9')]=function(_0x3ae21){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1aa'),_0x3ae21[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x3ae21[_0xd088('0xdc')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x3ae21,_0xd088('0x1ab'));}var _0xddf4ab=this[_0xd088('0x11')][_0xd088('0x71')](this,_0x3ae21['variable_id']);if(!_0xddf4ab){return this[_0xd088('0xe')][_0xd088('0x31')](_0x3ae21,'no\x20variable\x20found');}return this[_0xd088('0xe')][_0xd088('0xa6')](_0xddf4ab,_0x3ae21[_0xd088('0x1ac')]);};AGIVertices[_0xd088('0x18')][_0xd088('0x1ad')]=function(_0x1e5adf){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1ae'),_0x1e5adf['label']));this[_0xd088('0xe')]['noop'](_0xd088('0x1af'));if(_0x1e5adf[_0xd088('0xbc')]==='yes'){this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x1b0'));return this[_0xd088('0xe')][_0xd088('0xbc')]();}return this[_0xd088('0xe')]['noop'](_0xd088('0x1b1'));};AGIVertices['prototype'][_0xd088('0x1b2')]=function(_0x1944e1){logger[_0xd088('0x2e')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1944e1['label']));if(!this[_0xd088('0x86')](_0x1944e1[_0xd088('0x1b3')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1944e1,_0xd088('0x1b4'));}var _0x4457a3=this[_0xd088('0x16')][_0xd088('0x71')](this,_0x1944e1[_0xd088('0x1b3')]);if(!this[_0xd088('0x86')](_0x4457a3)){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1944e1,util[_0xd088('0x2a')](_0xd088('0x1b5'),_0x1944e1[_0xd088('0x1b3')]));}if(_0x4457a3===this[_0xd088('0xe')][_0xd088('0x39')]){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1944e1,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xd088('0x36')][_0xd088('0x71')](this,_0x1944e1,_0x4457a3);var _0x464311=this['channel'][_0xd088('0x59')]('AGI',util[_0xd088('0x2a')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xd088('0xb8')][_0xd088('0x197')]||'127.0.0.1',_0x4457a3,this[_0xd088('0xe')][_0xd088('0x39')]));if(_0x464311[_0xd088('0xa3')]===-0x1){return _0x464311;}return this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xc7'),_0xd088('0x1b6'),_0x4457a3));};AGIVertices[_0xd088('0x18')][_0xd088('0x1b7')]=function(_0x23a5c1){logger[_0xd088('0x2e')](util['format'](_0xd088('0x1b8'),_0x23a5c1[_0xd088('0x37')]));var _0x55124a=this['shellCommand'][_0xd088('0x71')](this,_0x23a5c1['command']);this[_0xd088('0x36')][_0xd088('0x71')](this,_0x23a5c1,_0x23a5c1[_0xd088('0xba')]);if(this['isConfigured'](_0x23a5c1[_0xd088('0xdc')])){var _0x41c946=this[_0xd088('0x11')]['sync'](this,_0x23a5c1[_0xd088('0xdc')]);if(_0x41c946){this[_0xd088('0xe')][_0xd088('0xa6')](_0x41c946,_0x55124a);return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x1b9'),_0x23a5c1['command'],_0x41c946));}}return this['channel']['noop'](util[_0xd088('0x2a')](_0xd088('0x1ba'),_0x23a5c1['command']));};AGIVertices[_0xd088('0x18')][_0xd088('0x1bb')]=function(_0x49f75d){logger[_0xd088('0x2e')](util['format'](_0xd088('0x1bc'),_0x49f75d[_0xd088('0x37')]));_0x49f75d[_0xd088('0x5f')]=_0x49f75d[_0xd088('0x5f')][_0xd088('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd088('0x86')](_0x49f75d['apiKey'])){return this[_0xd088('0xe')]['noop'](_0xd088('0x1bd'));}if(!this['isConfigured'](_0x49f75d[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')]('no\x20text\x20configured');}this[_0xd088('0xe')][_0xd088('0xab')](util['format'](_0xd088('0x1be'),_0x49f75d[_0xd088('0x5f')]));var _0x14a2c5=this[_0xd088('0x5c')][_0xd088('0x71')](this,_0x49f75d);if(_0x14a2c5){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x14a2c5));var _0x2a9b59=this[_0xd088('0xe')][_0xd088('0x106')](_0x14a2c5);try{fs['unlink'](_0x14a2c5+_0xd088('0x108'));}catch(_0x1d65dd){logger['error'](_0x1d65dd);}return _0x2a9b59;}return this[_0xd088('0xe')]['error'](_0x49f75d,_0xd088('0x1bf'));};AGIVertices['prototype']['tts']=function(_0x519070){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1c0'),_0x519070['label']));_0x519070[_0xd088('0x5f')]=_0x519070[_0xd088('0x5f')][_0xd088('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd088('0x86')](_0x519070[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x1c1'),_0x519070[_0xd088('0x5f')]));var _0x5d87ee=this[_0xd088('0x65')][_0xd088('0x71')](this,_0x519070);if(_0x5d87ee){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x1c2'),_0x5d87ee));var _0x1ac2a2=this[_0xd088('0xe')][_0xd088('0x106')](_0x5d87ee);try{fs[_0xd088('0x107')](_0x5d87ee+'.wav');}catch(_0x24d3dd){logger[_0xd088('0x31')](_0x24d3dd);}return _0x1ac2a2;}return this[_0xd088('0xe')]['error'](_0x519070,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd088('0x18')][_0xd088('0x1c3')]=function(_0x486f37){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1c4'),_0x486f37[_0xd088('0x37')]));if(!this['isConfigured'](_0x486f37[_0xd088('0x158')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x486f37,_0xd088('0x159'));}logger['info'](util[_0xd088('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd088('0xe')]['callerid'],_0x486f37['findBy']));var _0xbe273=this[_0xd088('0x53')]['sync'](this,_0x486f37[_0xd088('0x158')]);if(_0xbe273){logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd088('0x3a')],_0x486f37[_0xd088('0x158')]));this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd088('0x3a')],_0x486f37[_0xd088('0x158')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xd088('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd088('0xe')]['callerid'],_0x486f37[_0xd088('0x158')]));this['channel']['noop'](util['format'](_0xd088('0x160'),this[_0xd088('0xe')]['callerid'],_0x486f37['findBy']));return{'code':0xc8,'result':_0xd088('0x15d')};}};AGIVertices[_0xd088('0x18')][_0xd088('0x1c5')]=function(_0x29567d){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1c6'),_0x29567d[_0xd088('0x37')]));var _0x194be1=this['channel'][_0xd088('0x59')](_0xd088('0x1c7'),[_0x29567d[_0xd088('0x1c8')],_0x29567d['options']]);if(_0x194be1[_0xd088('0xa3')]===-0x1){return _0x194be1;}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xc7'),'VOICEMAIL',_0x29567d['mailbox']));};AGIVertices['prototype'][_0xd088('0x1c9')]=function(_0x1217e6){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1ca'),_0x1217e6[_0xd088('0x37')]));if(!this['isConfigured'](_0x1217e6['variable_id'])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1217e6,'no\x20variable\x20selected');}var _0x188306=this['getVariable'][_0xd088('0x71')](this,_0x1217e6['variable_id']);if(!_0x188306){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1217e6,_0xd088('0xde'));}var _0x4bc1a3=this['channel']['getVariable'](_0x188306);return{'code':0xc8,'result':_0x4bc1a3['extra']?_0x4bc1a3[_0xd088('0xa5')]:'-'};};String[_0xd088('0x18')]['replaceAll']=function(_0x5583c6,_0x4daf1c){return this['split'](_0x5583c6)['join'](_0x4daf1c);};module[_0xd088('0x1cb')]=AGIVertices; \ No newline at end of file +var _0xbdcf=['error','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','timeout','includes','POST','PUT','method','toUpperCase','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','agicommand','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','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\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','opts','url','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','recordFile','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','%s_STATUS_CODE','200','statusMessage','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','service','host','port','secure','authentication','auth','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','lodash','shelljs','odbc','randomstring','mustache','../../config/logger','../../config/environment','./scripts','rawHeaders','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0xbdcf,0x173));var _0xfbdc=function(_0x1cd68e,_0x572278){_0x1cd68e=_0x1cd68e-0x0;var _0x1db69a=_0xbdcf[_0x1cd68e];return _0x1db69a;};'use strict';var fs=require('fs');var path=require(_0xfbdc('0x0'));var util=require('util');var _=require(_0xfbdc('0x1'));var sh=require(_0xfbdc('0x2'));var odbc=require(_0xfbdc('0x3'))();var rs=require(_0xfbdc('0x4'));var moment=require('moment');var Mustache=require(_0xfbdc('0x5'));var rp=require('request-promise');var logger=require(_0xfbdc('0x6'))('agi');var config=require(_0xfbdc('0x7'));var scripts=require(_0xfbdc('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xfbdc('0x9'),'rawBody'];var verticesWithRetry=['menu',_0xfbdc('0xa'),_0xfbdc('0xb')];var AGIVertices=function(_0x40a59f,_0x1eaf1a,_0x130684){this[_0xfbdc('0xc')]=_0x40a59f;this[_0xfbdc('0xd')]=_0x1eaf1a;this['mailRpc']=_0x130684;};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xf')]=function(_0x44d535,_0x2a560a){this[_0xfbdc('0xd')][_0xfbdc('0x10')](_0x44d535)[_0xfbdc('0x11')](function(_0x2f7358){_0x2a560a(null,_0x2f7358?_0x2f7358['name']:![]);})[_0xfbdc('0x12')](function(_0x26612c){_0x2a560a(_0x26612c);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x13')]=function(_0x2704cb,_0x875139){this[_0xfbdc('0xd')][_0xfbdc('0x14')](_0x2704cb)['then'](function(_0x54be47){_0x875139(null,_0x54be47?_0x54be47[_0xfbdc('0x15')]:![]);})[_0xfbdc('0x12')](function(_0x34da8d){_0x875139(_0x34da8d);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x16')]=function(_0x18279b,_0x9e356d){this[_0xfbdc('0xd')][_0xfbdc('0x17')](_0x18279b)[_0xfbdc('0x11')](function(_0x399870){_0x9e356d(null,_0x399870?_0x399870[_0xfbdc('0x15')]:![]);})['catch'](function(_0x4ec435){_0x9e356d(_0x4ec435);});};AGIVertices['prototype'][_0xfbdc('0x18')]=function(_0x4f7301,_0x5376e0){this[_0xfbdc('0xd')][_0xfbdc('0x19')](_0x4f7301)['then'](function(_0xc26c0a){_0x5376e0(null,_0xc26c0a?_0xc26c0a[_0xfbdc('0x1a')]:![]);})[_0xfbdc('0x12')](function(_0xa6a096){_0x5376e0(_0xa6a096);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1b')]=function(_0x200d5f,_0x3a259e){this[_0xfbdc('0xd')][_0xfbdc('0x1c')](_0x200d5f)[_0xfbdc('0x11')](function(_0x5a12ad){_0x3a259e(null,_0x5a12ad?_0x5a12ad[_0xfbdc('0x15')]:![]);})[_0xfbdc('0x12')](function(_0x1edaa4){_0x3a259e(_0x1edaa4);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1d')]=function(_0x3bfe91,_0x3c5a4f){this[_0xfbdc('0xd')][_0xfbdc('0x1e')](_0x3bfe91)['then'](function(_0x307ea1){_0x3c5a4f(null,_0x307ea1?_0x307ea1[_0xfbdc('0x15')]:![]);})[_0xfbdc('0x12')](function(_0x2bdeeb){_0x3c5a4f(_0x2bdeeb);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1f')]=function(_0x2df0ea,_0x54c960){var _0x4e39fe=this;this[_0xfbdc('0xd')][_0xfbdc('0x20')](_0x2df0ea)['then'](function(_0x3c30c2){_0x54c960(null,_0x3c30c2?_0x4e39fe[_0xfbdc('0x21')](_0x3c30c2[_0xfbdc('0x22')]):![]);})[_0xfbdc('0x12')](function(_0x1929e1){_0x54c960(_0x1929e1);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x23')]=function(_0x4dca7c,_0xdee931){this[_0xfbdc('0xd')][_0xfbdc('0x24')](_0x4dca7c)[_0xfbdc('0x11')](function(_0x293241){_0xdee931(null,_0x293241?_0x293241:![]);})[_0xfbdc('0x12')](function(_0x27e0d0){_0xdee931(_0x27e0d0);});};AGIVertices[_0xfbdc('0xe')]['sendMailMessage']=function(_0x33105d,_0x200132,_0x3e06fc){this['mailRpc'][_0xfbdc('0x25')](_0x33105d,_0x200132)[_0xfbdc('0x11')](function(){_0x3e06fc(null);})[_0xfbdc('0x12')](function(_0xe9814c){_0x3e06fc(_0xe9814c);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x26')]=function(_0x4eb85c,_0x310f28){this['rpc'][_0xfbdc('0x27')](_0x4eb85c)[_0xfbdc('0x11')](function(_0x5a81e7){if(_0x5a81e7){if(_0x5a81e7['IntervalId']){_0x310f28(null,[_0x5a81e7[_0xfbdc('0x28')]]);}else{_0x310f28(null,_[_0xfbdc('0x29')](_0x5a81e7[_0xfbdc('0x2a')],_0xfbdc('0x28')));}}else{_0x310f28(null,![]);}})[_0xfbdc('0x12')](function(_0x2ad8ec){_0x310f28(_0x2ad8ec);});};AGIVertices['prototype'][_0xfbdc('0x21')]=function(_0x42a7be){return util[_0xfbdc('0x2b')](_0xfbdc('0x2c'),FILES_PATH,_0x42a7be);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x2d')]=function(_0x539571,_0x4ebdfc,_0x3f995b){odbc[_0xfbdc('0x2e')](_0x539571,function(_0x3ad751){if(_0x3ad751){logger['error'](_0xfbdc('0x2f'),_0x3ad751);_0x3f995b(_0x3ad751);}else{logger[_0xfbdc('0x30')](_0xfbdc('0x31'));odbc[_0xfbdc('0x32')](_0x4ebdfc,function(_0x2a3fd1,_0xf66878){if(_0x2a3fd1){logger[_0xfbdc('0x30')](_0xfbdc('0x33'),_0x4ebdfc);_0x3f995b(_0x2a3fd1);}else{logger[_0xfbdc('0x30')](_0xfbdc('0x34'),_0x4ebdfc);odbc[_0xfbdc('0x35')](function(_0x6368c4){if(_0x6368c4){logger['error'](_0xfbdc('0x36'),_0x6368c4);}_0x3f995b(null,_0xf66878);});}});}});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x37')]=function(_0x1b0c14,_0x5d4334){this['rpc'][_0xfbdc('0x38')](_0x1b0c14)[_0xfbdc('0x11')](function(_0x4bd608){_0x5d4334(null,_0x4bd608?_0x4bd608:![]);})['catch'](function(_0x36bf1f){_0x5d4334(_0x36bf1f);});};AGIVertices['prototype'][_0xfbdc('0x39')]=function(_0x1c8d66,_0x7f388e){this[_0xfbdc('0xd')][_0xfbdc('0x39')](_0x1c8d66)['then'](function(_0x58bc71){_0x7f388e(null,_0x58bc71);})[_0xfbdc('0x12')](function(_0x1ecc61){_0x7f388e(_0x1ecc61);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x3a')]=function(_0x43b6ae,_0x2a7ea4,_0x263dad){this[_0xfbdc('0xd')][_0xfbdc('0x3a')]({'uniqueid':this['channel']['uniqueid'],'node':_0x43b6ae['label'],'application':_0x43b6ae['agicommand'],'data':_0x2a7ea4||null,'project_name':this[_0xfbdc('0xc')][_0xfbdc('0x3b')],'callerid':this[_0xfbdc('0xc')][_0xfbdc('0x3c')]})[_0xfbdc('0x11')](function(_0xfcddf7){if(_0x263dad){_0x263dad(null,_0xfcddf7);}})['catch'](function(_0x52bacb){if(_0x263dad){_0x263dad(_0x52bacb);}});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x3d')]=function(_0x3e5941,_0x2f25dd,_0x33f9ce,_0x55e67e){this[_0xfbdc('0xd')][_0xfbdc('0x3d')]({'uniqueid':this['channel'][_0xfbdc('0x3e')],'callerid':this['channel'][_0xfbdc('0x3c')],'calleridname':this[_0xfbdc('0xc')][_0xfbdc('0x3f')],'context':this[_0xfbdc('0xc')][_0xfbdc('0x40')],'extension':this['channel'][_0xfbdc('0x41')],'priority':this[_0xfbdc('0xc')][_0xfbdc('0x42')],'accountcode':this['channel']['accountcode'],'dnid':this[_0xfbdc('0xc')][_0xfbdc('0x43')],'projectName':this['channel'][_0xfbdc('0x3b')],'saveName':_0x2f25dd,'filename':_0x3e5941[_0xfbdc('0x44')]||_0x2f25dd,'savePath':_0x33f9ce})[_0xfbdc('0x11')](function(_0x5e05f6){_0x55e67e(null,_0x5e05f6);})[_0xfbdc('0x12')](function(_0x8c0eab){_0x55e67e(_0x8c0eab);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x45')]=function(_0x2086b3,_0x5b8967,_0x351c81,_0x5613f1,_0x56e9bc){this[_0xfbdc('0xd')][_0xfbdc('0x45')]({'uniqueid':this[_0xfbdc('0xc')][_0xfbdc('0x3e')],'body':_0x2086b3,'direction':_0x5b8967,'providerName':_0x351c81,'providerResponse':_0x5613f1})[_0xfbdc('0x11')](function(_0x408062){if(_0x56e9bc){_0x56e9bc(null,_0x408062);}})['catch'](function(_0x41deb0){if(_0x56e9bc){_0x56e9bc(_0x41deb0);}});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x46')]=function(_0x386dba,_0x35f424){this[_0xfbdc('0xd')]['createCmContact']({'firstName':_[_0xfbdc('0x47')](_0x386dba[_0xfbdc('0x15')])||_[_0xfbdc('0x48')](_0x386dba[_0xfbdc('0x15')])?_0xfbdc('0x49')+Math[_0xfbdc('0x4a')]():_0x386dba['name'],'lastName':_[_0xfbdc('0x47')](_0x386dba[_0xfbdc('0x4b')])||_['isNil'](_0x386dba[_0xfbdc('0x4b')])?null:_0x386dba[_0xfbdc('0x4b')],'phone':_0x386dba[_0xfbdc('0x4c')],'ListId':_0x386dba[_0xfbdc('0x4d')],'scheduledat':_0x386dba[_0xfbdc('0x4e')],'callbackUniqueid':this['channel'][_0xfbdc('0x3e')],'tags':_0xfbdc('0x4f'),'description':_0xfbdc('0x50')+_0x386dba['scheduledAt'][_0xfbdc('0x51')](),'priority':_0x386dba[_0xfbdc('0x52')]})[_0xfbdc('0x11')](function(_0x10a5de){_0x35f424(null,_0x10a5de);})[_0xfbdc('0x12')](function(_0x20a3b7){_0x35f424(_0x20a3b7);});};AGIVertices['prototype']['getPause']=function(_0x5a773a,_0x532bbc){this[_0xfbdc('0xd')][_0xfbdc('0x53')](_0x5a773a)['then'](function(_0x2b14d5){_0x532bbc(null,_0x2b14d5?_0x2b14d5[_0xfbdc('0x15')]:![]);})[_0xfbdc('0x12')](function(_0x178343){_0x532bbc(_0x178343);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x54')]=function(_0x7f1ebc,_0x51c8ff,_0x451db9){var _0x45d197={'role':_0xfbdc('0x55')};_0x45d197[_0x7f1ebc]=this[_0xfbdc('0xc')][_0xfbdc('0x3c')];this['rpc'][_0xfbdc('0x54')](_0x45d197,_0x51c8ff,this[_0xfbdc('0xc')][_0xfbdc('0x3e')])[_0xfbdc('0x11')](function(_0x1013d7){_0x451db9(null,_[_0xfbdc('0x48')](_0x1013d7)?![]:!![]);})[_0xfbdc('0x12')](function(_0x396dac){logger[_0xfbdc('0x56')](_0x396dac);_0x451db9(null,![]);});};AGIVertices['prototype'][_0xfbdc('0x57')]=function(_0x58a3fc,_0x2e2147){var _0xd16be6={'role':_0xfbdc('0x55')};_0xd16be6[_0x58a3fc]=this[_0xfbdc('0xc')][_0xfbdc('0x3c')];this[_0xfbdc('0xd')][_0xfbdc('0x57')](_0xd16be6)[_0xfbdc('0x11')](function(_0x2dc056){_0x2e2147(null,_[_0xfbdc('0x48')](_0x2dc056)?![]:!![]);})['catch'](function(_0x1beaa8){logger[_0xfbdc('0x56')](_0x1beaa8);_0x2e2147(null,![]);});};AGIVertices[_0xfbdc('0xe')]['agentLogout']=function(_0x44223d,_0x34e329){var _0x466b08={'role':_0xfbdc('0x55')};_0x466b08[_0x44223d]=this[_0xfbdc('0xc')][_0xfbdc('0x3c')];this[_0xfbdc('0xd')][_0xfbdc('0x58')](_0x466b08)['then'](function(_0x402dd0){_0x34e329(null,_[_0xfbdc('0x48')](_0x402dd0)?![]:!![]);})[_0xfbdc('0x12')](function(_0x47e4b4){logger[_0xfbdc('0x56')](_0x47e4b4);_0x34e329(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x23df96,_0x19a3d9){var _0x55e298={'role':_0xfbdc('0x55')};_0x55e298[_0x23df96]=this['channel']['callerid'];var _0x2a703e=_0x23df96!=_0xfbdc('0x59')?util['format'](_0xfbdc('0x5a'),'LOCAL',this[_0xfbdc('0xc')][_0xfbdc('0x3c')]):undefined;this[_0xfbdc('0xd')][_0xfbdc('0x5b')](_0x55e298,_0x2a703e)[_0xfbdc('0x11')](function(_0x3fa024){_0x19a3d9(null,_['isNil'](_0x3fa024)?![]:!![]);})[_0xfbdc('0x12')](function(_0x390af4){logger[_0xfbdc('0x56')](_0x390af4);_0x19a3d9(null,![]);});};AGIVertices['prototype'][_0xfbdc('0x5c')]=function(_0x597461,_0x2c7420){sh[_0xfbdc('0x5d')](_['trim'](_0x597461),function(_0xf5d8c6,_0x2dec93){var _0xf9cc42=_0x2dec93[_0xfbdc('0x5e')](/(\r\n|\n|\r)/gm,'');_0x2c7420(null,_0xf9cc42);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x5f')]=function(_0x5bbe92,_0x355c83){scripts[_0xfbdc('0x5f')](_0x5bbe92[_0xfbdc('0x60')],_0x5bbe92[_0xfbdc('0x61')]||_0xfbdc('0x62'),_0x5bbe92[_0xfbdc('0x62')],_0x5bbe92[_0xfbdc('0x63')]||_0xfbdc('0x64'),_0x5bbe92['ssmlGender']||_0xfbdc('0x65'),_0x5bbe92[_0xfbdc('0x66')]||_0xfbdc('0x67'))[_0xfbdc('0x11')](function(_0x25f403){_0x355c83(null,_0x25f403);})[_0xfbdc('0x12')](function(_0x4137cb){_0x355c83(_0x4137cb);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x68')]=function(_0x263be0,_0x1921a4){scripts[_0xfbdc('0x68')](_0x263be0[_0xfbdc('0x62')],_0x263be0[_0xfbdc('0x69')]||'en',0x1)[_0xfbdc('0x11')](function(_0x24a73b){_0x1921a4(null,_0x24a73b);})[_0xfbdc('0x12')](function(_0x444bc4){_0x1921a4(_0x444bc4);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x6a')]=function(_0x580623,_0x55532a){var _0xa718a={'uri':_0x580623['url'],'method':_0x580623['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x580623['timeout'])==='number'&&parseInt(_0x580623[_0xfbdc('0x6b')])>=0x1?parseInt(_0x580623[_0xfbdc('0x6b')])*0x3e8:0x5*0x3e8};if(_[_0xfbdc('0x6c')]([_0xfbdc('0x6d'),_0xfbdc('0x6e')],_0xa718a[_0xfbdc('0x6f')][_0xfbdc('0x70')]())){try{_0xa718a['body']=_0x580623[_0xfbdc('0x71')]?JSON['parse'](_0x580623['rawBody']):{};}catch(_0xceb40a){logger[_0xfbdc('0x56')](_0xfbdc('0x72'),_0xceb40a);}}try{_0xa718a['headers']=_0x580623[_0xfbdc('0x9')]?JSON[_0xfbdc('0x73')](_0x580623[_0xfbdc('0x9')]):{};}catch(_0x29e646){logger['error'](_0xfbdc('0x74'),_0x29e646);}if(_0x580623[_0xfbdc('0x75')]){try{var _0x232c1a=require(_0x580623[_0xfbdc('0x75')])[_0xfbdc('0x76')](this,_0xa718a);_0xa718a[_0xfbdc('0x77')]=Mustache[_0xfbdc('0x78')](_0x580623['url'],_0x232c1a,{},['$$','$$']);if(_0xa718a[_0xfbdc('0x79')]){_0xa718a[_0xfbdc('0x79')]=JSON[_0xfbdc('0x73')](Mustache['render'](JSON[_0xfbdc('0x7a')](_0xa718a[_0xfbdc('0x79')]),_0x232c1a,{},['$$','$$']));}if(_0xa718a[_0xfbdc('0x7b')]){_0xa718a[_0xfbdc('0x7b')]=JSON[_0xfbdc('0x73')](Mustache['render'](JSON[_0xfbdc('0x7a')](_0xa718a[_0xfbdc('0x7b')]),_0x232c1a,{},['$$','$$']));}}catch(_0x4fd63c){logger[_0xfbdc('0x56')](_0xfbdc('0x7c'),_0x4fd63c);}}rp(_0xa718a)[_0xfbdc('0x11')](function(_0x2cfdf6){var _0x514562={'statusCode':_0x2cfdf6[_0xfbdc('0x7d')]||0xc8,'statusMessage':_0x2cfdf6['statusMessage']||'OK','headers':_0x2cfdf6[_0xfbdc('0x79')]||{},'body':_0x2cfdf6['body']||{}};_0x55532a(null,_0x514562);})[_0xfbdc('0x12')](function(_0x21f25e){var _0x385130={'statusCode':_0x21f25e['statusCode']||0x1f4,'statusMessage':_0x21f25e['message']||_0xfbdc('0x7e'),'headers':_0x21f25e[_0xfbdc('0x7f')][_0xfbdc('0x79')]||{},'body':_0x21f25e['options'][_0xfbdc('0x7b')]||{}};_0x55532a(null,_0x385130);});};AGIVertices['prototype'][_0xfbdc('0x80')]=function(_0x1f15d2,_0x49eff1){scripts[_0xfbdc('0x80')](this[_0xfbdc('0xc')]['uniqueid'],_0x1f15d2['key'],_0x1f15d2[_0xfbdc('0x62')],_0x1f15d2['dialogflow_language']||'en')['then'](function(_0x1cf3c3){_0x49eff1(null,_0x1cf3c3);})[_0xfbdc('0x12')](function(_0x1de8d4){_0x49eff1(_0x1de8d4);});};AGIVertices['prototype'][_0xfbdc('0x81')]=function(_0x4dca0f,_0x2f08b1){scripts[_0xfbdc('0x81')](this['channel'][_0xfbdc('0x3e')],_0x4dca0f[_0xfbdc('0x82')],_0x4dca0f['client_email'],_0x4dca0f[_0xfbdc('0x83')],_0x4dca0f[_0xfbdc('0x62')],_0x4dca0f[_0xfbdc('0x84')]||'en')[_0xfbdc('0x11')](function(_0x28cda1){_0x2f08b1(null,_0x28cda1);})[_0xfbdc('0x12')](function(_0x1c6c05){_0x2f08b1(_0x1c6c05);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x85')]=function(_0x2cc45d,_0x29b200){scripts[_0xfbdc('0x85')](this['channel'],_0x2cc45d)[_0xfbdc('0x11')](function(_0x1a2481){_0x29b200(null,_0x1a2481);})[_0xfbdc('0x12')](function(_0x24ae6a){_0x29b200(_0x24ae6a);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x86')]=function(_0x1e7f51,_0x5169e5){scripts[_0xfbdc('0x86')](_0x1e7f51[_0xfbdc('0x87')],_0x1e7f51[_0xfbdc('0x62')],_0x1e7f51['ispeech_tts_language']||_0xfbdc('0x64'),_0x1e7f51[_0xfbdc('0x88')])['then'](function(_0x2eda14){_0x5169e5(null,_0x2eda14);})[_0xfbdc('0x12')](function(_0x2f195d){_0x5169e5(_0x2f195d);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x89')]=function(_0x5f10f8,_0x38bf3e,_0x2d44b5){scripts['ispeechASR'](_0x38bf3e,_0x5f10f8[_0xfbdc('0x87')],_0x5f10f8[_0xfbdc('0x8a')]||_0xfbdc('0x64'),this[_0xfbdc('0x8b')](_0x5f10f8['model'])?_0x5f10f8[_0xfbdc('0x8c')]:undefined)[_0xfbdc('0x11')](function(_0xa0bcfb){_0x2d44b5(null,_0xa0bcfb);})['catch'](function(_0x3ab970){_0x2d44b5(_0x3ab970);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x8d')]=function(_0x494d39,_0x31b072){scripts['awsPolly'](_0x494d39[_0xfbdc('0x8e')],_0x494d39['aws_secret_access_key'],_0x494d39[_0xfbdc('0x8f')],_0x494d39[_0xfbdc('0x90')]||_0xfbdc('0x91'),_0x494d39[_0xfbdc('0x62')],_0x494d39['aws_text_type']||_0xfbdc('0x62'))[_0xfbdc('0x11')](function(_0x5d5639){_0x31b072(null,_0x5d5639);})[_0xfbdc('0x12')](function(_0x430638){_0x31b072(_0x430638);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x92')]=function(_0x48d975,_0x2ba12b){scripts[_0xfbdc('0x92')](this[_0xfbdc('0xc')]['uniqueid'],_0x48d975[_0xfbdc('0x8e')],_0x48d975[_0xfbdc('0x93')],_0x48d975[_0xfbdc('0x94')],_0x48d975[_0xfbdc('0x62')],_0x48d975[_0xfbdc('0x95')])[_0xfbdc('0x11')](function(_0x52c5dd){_0x2ba12b(null,_0x52c5dd);})[_0xfbdc('0x12')](function(_0x2543cb){_0x2ba12b(_0x2543cb);});};AGIVertices['prototype']['googleASR']=function(_0x52bf91,_0x5c105b,_0x5bd001){scripts[_0xfbdc('0x96')](_0x5c105b,_0x52bf91[_0xfbdc('0x87')],_0x52bf91[_0xfbdc('0x97')]||_0xfbdc('0x64'))[_0xfbdc('0x11')](function(_0x2cd611){_0x5bd001(null,_0x2cd611);})[_0xfbdc('0x12')](function(_0x5219ff){_0x5bd001(_0x5219ff);});};AGIVertices[_0xfbdc('0xe')]['tildeASR']=function(_0x43d3db,_0x5f17c4,_0x41a3ab){scripts[_0xfbdc('0x98')](_0x5f17c4,_0x43d3db[_0xfbdc('0x99')],_0x43d3db[_0xfbdc('0x9a')],_0x43d3db[_0xfbdc('0x77')])[_0xfbdc('0x11')](function(_0x3237c5){_0x41a3ab(null,_0x3237c5);})[_0xfbdc('0x12')](function(_0x3dc166){_0x41a3ab(_0x3dc166);});};AGIVertices[_0xfbdc('0xe')]['clear']=function(_0xda07a){var _0x50d7a9=_[_0xfbdc('0x6c')](verticesWithRetry,_0xda07a[_0xfbdc('0x9b')])?_0xda07a:_[_0xfbdc('0x9c')](_0xda07a);for(var _0x558854 in _0x50d7a9){if(_0x50d7a9[_0xfbdc('0x9d')](_0x558854)){if(_0x50d7a9[_0x558854]&&_['isString'](_0x50d7a9[_0x558854])){if(_[_0xfbdc('0x6c')](recursiveMapAttributes,_0x558854)){_0x50d7a9[_0x558854]=this[_0xfbdc('0x9e')](_0x50d7a9[_0x558854]);}else{_0x50d7a9[_0x558854]=this[_0xfbdc('0x9f')](_0x50d7a9[_0x558854]);}}}}return _0x50d7a9;};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xa0')]=function(_0x2fd0ab){for(var _0x324853 in _0x2fd0ab){if(_0x2fd0ab[_0xfbdc('0x9d')](_0x324853)){if(_[_0xfbdc('0xa1')](_0x2fd0ab[_0x324853])){this['recursiveNodeIndex'](_0x2fd0ab[_0x324853]);}else if(_[_0xfbdc('0xa2')](_0x2fd0ab[_0x324853])){for(var _0x346bb5=0x0;_0x346bb5<_0x2fd0ab[_0x324853][_0xfbdc('0xa3')];_0x346bb5++){this[_0xfbdc('0xa0')](_0x2fd0ab[_0x324853][_0x346bb5]);}}else if(_[_0xfbdc('0xa4')](_0x2fd0ab[_0x324853])){_0x2fd0ab[_0x324853]=this[_0xfbdc('0x9f')](_0x2fd0ab[_0x324853]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x46c6c8,_0x1dbbba){for(var _0x3bbf5d in _0x46c6c8){if(_0x46c6c8[_0xfbdc('0x9d')](_0x3bbf5d)){if(_['isPlainObject'](_0x46c6c8[_0x3bbf5d])){if(!_[_0xfbdc('0x47')](_0x46c6c8[_0x3bbf5d])){this[_0xfbdc('0xa5')](_0x46c6c8[_0x3bbf5d],util['format'](_0xfbdc('0xa6'),_0x1dbbba,_0x3bbf5d));}}else if(_[_0xfbdc('0xa2')](_0x46c6c8[_0x3bbf5d])){for(var _0x28bf35=0x0;_0x28bf35<_0x46c6c8[_0x3bbf5d][_0xfbdc('0xa3')];_0x28bf35++){this['saveRestApiResult'](_0x46c6c8[_0x3bbf5d][_0x28bf35],util[_0xfbdc('0x2b')](_0xfbdc('0xa6'),_0x1dbbba,_0x3bbf5d+'['+_0x28bf35+']'));}}else{if(!_[_0xfbdc('0x48')](_0x46c6c8[_0x3bbf5d])){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util['format'](_0xfbdc('0xa6'),_0x1dbbba,_0x3bbf5d),_0x46c6c8[_0x3bbf5d]);}}}}};AGIVertices['prototype'][_0xfbdc('0x9e')]=function(_0x49e7d1){try{var _0x26bebe=JSON[_0xfbdc('0x73')](_0x49e7d1);this[_0xfbdc('0xa0')](_0x26bebe);return JSON[_0xfbdc('0x7a')](_0x26bebe);}catch(_0xd75725){return this[_0xfbdc('0x9f')](_0x49e7d1);}};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x9f')]=function(_0x21357f){var _0x26fc3b=_0x21357f[_0xfbdc('0xa8')]('{');for(var _0x2acc8a=0x1;_0x2acc8a<_0x26fc3b[_0xfbdc('0xa3')];_0x2acc8a+=0x1){var _0x2fd9e0=_0x26fc3b[_0x2acc8a][_0xfbdc('0xa8')]('}');if(_0x2fd9e0[_0xfbdc('0xa3')]>0x1){_0x21357f=_0x21357f[_0xfbdc('0xa9')]('{'+_0x2fd9e0[0x0]+'}',this[_0xfbdc('0xc')][_0xfbdc('0xf')](_0x2fd9e0[0x0])[_0xfbdc('0xaa')]||_0x2fd9e0[0x0]);}}if(_0x26fc3b[_0xfbdc('0xa3')]===0x1){return _0x21357f[_0xfbdc('0x51')]();}return this[_0xfbdc('0x9f')](_0x21357f);};AGIVertices[_0xfbdc('0xe')]['getAndSetVariable']=function(_0x12094c,_0x46cf55){var _0x1ac87e=this[_0xfbdc('0xc')][_0xfbdc('0xf')](_0x12094c);if(_0x1ac87e[_0xfbdc('0xab')]===-0x1){return _0x1ac87e;}logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0xac'),_0x46cf55,_0x1ac87e[_0xfbdc('0xaa')]));return this[_0xfbdc('0xc')][_0xfbdc('0xa7')](_0x46cf55,_0x1ac87e['extra']);};AGIVertices['prototype'][_0xfbdc('0x8b')]=function(_0x4d12e3){return _0x4d12e3&&_0x4d12e3!=='0'&&_0x4d12e3!=='-1'&&_0x4d12e3!=='';};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xad')]=function(_0x2ded71){this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x2ded71,'-');_0x2ded71[_0xfbdc('0xae')]=_0x2ded71[_0xfbdc('0xad')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xfbdc('0xe')]['mrcpsynth']=function(_0x13c58b){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x13c58b['label']));if(!this['isConfigured'](_0x13c58b[_0xfbdc('0x62')])){return this['channel'][_0xfbdc('0xaf')](_0xfbdc('0xb0'));}var _0xf14362='\x22'+_0x13c58b[_0xfbdc('0x62')]+'\x22';if(this[_0xfbdc('0x8b')](_0x13c58b[_0xfbdc('0x7f')])){_0xf14362+=','+_0x13c58b[_0xfbdc('0x7f')];}var _0x14ab79=this['channel']['exec'](_0xfbdc('0xb1'),_0xf14362);if(_0x14ab79[_0xfbdc('0xab')]===-0x1){return _0x14ab79;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xb2'),_0xf14362));};AGIVertices['prototype'][_0xfbdc('0xb3')]=function(_0x30f681){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0xb4'),_0x30f681[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x30f681[_0xfbdc('0xb6')])){return this['channel']['noop'](_0xfbdc('0xb7'));}var _0x50ff60=_0x30f681[_0xfbdc('0xb6')];if(this['isConfigured'](_0x30f681[_0xfbdc('0x7f')])){_0x50ff60+=','+_0x30f681[_0xfbdc('0x7f')];}var _0x530eb7=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0xfbdc('0xb8'),_0x50ff60);if(_0x530eb7[_0xfbdc('0xab')]===-0x1){return _0x530eb7;}var _0x534ead=this['getAndSetVariable'](_0xfbdc('0xb9'),_0xfbdc('0xba'));if(_0x534ead['result']===-0x1){return _0x534ead;}var _0x16cf5f=this[_0xfbdc('0xbb')](_0xfbdc('0xbc'),_0xfbdc('0xbd'));if(_0x16cf5f['result']===-0x1){return _0x16cf5f;}var _0x12e626=this[_0xfbdc('0xbb')](_0xfbdc('0xbe'),_0xfbdc('0xbf'));if(_0x12e626[_0xfbdc('0xab')]===-0x1){return _0x12e626;}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xc0'),_0x50ff60));};AGIVertices[_0xfbdc('0xe')]['agi']=function(_0x5a8f94){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xc1'),_0x5a8f94['label']));return this[_0xfbdc('0xc')][_0xfbdc('0xc2')]([_0x5a8f94[_0xfbdc('0xc3')],_0x5a8f94[_0xfbdc('0xc4')]]);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xc5')]=function(_0x351527){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0xc6'),_0x351527['label']));if(this[_0xfbdc('0x8b')](_0x351527[_0xfbdc('0x6b')])){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xc7'),_0x351527[_0xfbdc('0x6b')]));var _0xe17221=this['channel'][_0xfbdc('0xc8')](_0x351527[_0xfbdc('0x6b')]);if(_0xe17221['result']===-0x1){return _0xe17221;}}return this['channel']['answer']();};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x4f')]=function(_0x756114){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xc9'),_0x756114[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x756114[_0xfbdc('0x4d')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x756114,_0xfbdc('0xca'));}_0x756114[_0xfbdc('0x4e')]=moment();if(this[_0xfbdc('0x8b')](_0x756114['delay'])){_0x756114[_0xfbdc('0x4e')]=moment()['add'](_0x756114[_0xfbdc('0xcb')],'minutes');}if(!this[_0xfbdc('0x8b')](_0x756114[_0xfbdc('0x52')])){_0x756114[_0xfbdc('0x52')]=0x2;}this[_0xfbdc('0x46')][_0xfbdc('0x76')](this,_0x756114);return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x756114[_0xfbdc('0x4c')],_0x756114[_0xfbdc('0x4d')],_0x756114[_0xfbdc('0x4e')]));};AGIVertices['prototype']['custom_app']=function(_0x51277f){logger['info'](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x51277f[_0xfbdc('0xb5')]));var _0x1f31dc=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0x51277f['application'],_0x51277f[_0xfbdc('0x7f')]);if(_0x1f31dc[_0xfbdc('0xab')]===-0x1){return _0x1f31dc;}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xcc'),_0x51277f[_0xfbdc('0xcd')],_0x51277f[_0xfbdc('0x7f')]));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xce')]=function(_0x57705d){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xcf'),_0x57705d[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x57705d[_0xfbdc('0x62')])){return this['channel'][_0xfbdc('0xaf')]('no\x20text\x20configured');}var _0x1bf4b9='\x22'+_0x57705d[_0xfbdc('0x62')]+'\x22';if(this[_0xfbdc('0x8b')](_0x57705d[_0xfbdc('0x7f')])){_0x1bf4b9+=','+_0x57705d['options'];}var _0x2ad45f=this[_0xfbdc('0xc')]['exec'](_0xfbdc('0xb1'),_0x1bf4b9);if(_0x2ad45f[_0xfbdc('0xab')]===-0x1){return _0x2ad45f;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1bf4b9));};AGIVertices['prototype']['sestektts']=function(_0x5a2cbb){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xd0'),_0x5a2cbb[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x5a2cbb[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xb0'));}var _0x4a36cf='\x22'+_0x5a2cbb['text']+'\x22';if(this[_0xfbdc('0x8b')](_0x5a2cbb[_0xfbdc('0x7f')])){_0x4a36cf+=','+_0x5a2cbb['options'];}var _0x5edbf3=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0xfbdc('0xb1'),_0x4a36cf);if(_0x5edbf3[_0xfbdc('0xab')]===-0x1){return _0x5edbf3;}return this['channel']['noop'](util[_0xfbdc('0x2b')](_0xfbdc('0xb2'),_0x4a36cf));};AGIVertices['prototype'][_0xfbdc('0xd1')]=function(_0x200ce3){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xd2'),_0x200ce3[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x200ce3['grammar'])){return this['channel']['noop'](_0xfbdc('0xb7'));}var _0x17e77=_0x200ce3[_0xfbdc('0xb6')];if(this[_0xfbdc('0x8b')](_0x200ce3[_0xfbdc('0x7f')])){_0x17e77+=','+_0x200ce3[_0xfbdc('0x7f')];}var _0x2525a6=this['channel'][_0xfbdc('0x5d')](_0xfbdc('0xb8'),_0x17e77);if(_0x2525a6[_0xfbdc('0xab')]===-0x1){return _0x2525a6;}var _0x8cfd=this['getAndSetVariable'](_0xfbdc('0xb9'),_0xfbdc('0xd3'));if(_0x8cfd[_0xfbdc('0xab')]===-0x1){return _0x8cfd;}var _0x2c7e2c=this[_0xfbdc('0xbb')](_0xfbdc('0xbc'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2c7e2c[_0xfbdc('0xab')]===-0x1){return _0x2c7e2c;}var _0x15a6a0=this['getAndSetVariable']('RECOG_INSTANCE()',_0xfbdc('0xd4'));if(_0x15a6a0[_0xfbdc('0xab')]===-0x1){return _0x15a6a0;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xc0'),_0x17e77));};AGIVertices['prototype']['sestekasr']=function(_0x3ce909){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0xd5'),_0x3ce909[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x3ce909[_0xfbdc('0xb6')])){return this['channel']['noop'](_0xfbdc('0xb7'));}var _0x2a2e39=_0x3ce909[_0xfbdc('0xb6')];if(this[_0xfbdc('0x8b')](_0x3ce909[_0xfbdc('0x7f')])){_0x2a2e39+=','+_0x3ce909[_0xfbdc('0x7f')];}var _0x4eb810=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0xfbdc('0xb8'),_0x2a2e39);if(_0x4eb810[_0xfbdc('0xab')]===-0x1){return _0x4eb810;}var _0x202960=this[_0xfbdc('0xbb')](_0xfbdc('0xb9'),_0xfbdc('0xd6'));if(_0x202960[_0xfbdc('0xab')]===-0x1){return _0x202960;}var _0x4cfb1a=this[_0xfbdc('0xbb')](_0xfbdc('0xbc'),'SESTEK_ASR_TRANSCRIPT');if(_0x4cfb1a[_0xfbdc('0xab')]===-0x1){return _0x4cfb1a;}var _0x1e92b1=this['getAndSetVariable']('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x1e92b1[_0xfbdc('0xab')]===-0x1){return _0x1e92b1;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xc0'),_0x2a2e39));};AGIVertices[_0xfbdc('0xe')]['database']=function(_0x2b1d27){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0xd7'),_0x2b1d27['label']));if(!this[_0xfbdc('0x8b')](_0x2b1d27['odbc_id'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x2b1d27,'no\x20database\x20selected');}var _0x2e85f3=this[_0xfbdc('0x18')][_0xfbdc('0x76')](this,_0x2b1d27['odbc_id']);if(!_0x2e85f3){return this['channel']['error'](_0x2b1d27,_0xfbdc('0xd8'));}if(!this[_0xfbdc('0x8b')](_0x2b1d27['query'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x2b1d27,'no\x20query\x20configured');}var _0x16892b=_0x2b1d27[_0xfbdc('0x32')][_0xfbdc('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util['format'](_0xfbdc('0xd9'),_0x16892b));var _0x16118f=this[_0xfbdc('0x2d')][_0xfbdc('0x76')](this,_0x2e85f3,_0x16892b);this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x2b1d27,_0x16892b);if(!this[_0xfbdc('0x8b')](_0x2b1d27[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xdb'));}var _0x1fad86=this[_0xfbdc('0xf')]['sync'](this,_0x2b1d27[_0xfbdc('0xda')]);if(!_0x1fad86){return this['channel'][_0xfbdc('0x56')](_0x2b1d27,_0xfbdc('0xdc'));}var _0x2e4e04=this;_0x16118f[_0xfbdc('0xdd')](function(_0x56e7b5,_0x2270b6){Object[_0xfbdc('0xde')](_0x56e7b5)['forEach'](function(_0x49aad7){_0x2e4e04[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')]('%s[%s][%s]',_0x1fad86,_0x2270b6,_0x49aad7),_0x56e7b5[_0x49aad7]);});});this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util['format'](_0xfbdc('0xdf'),_0x1fad86),_0x16118f[_0xfbdc('0xa3')]);return this['channel']['noop'](util[_0xfbdc('0x2b')](_0xfbdc('0xe0'),_0x1fad86));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xe1')]=function(_0x692d2b){logger[_0xfbdc('0xe2')](util[_0xfbdc('0x2b')](_0xfbdc('0xe3'),_0x692d2b[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x692d2b[_0xfbdc('0xe4')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x692d2b,_0xfbdc('0xe5'));}var _0x2f050d=this[_0xfbdc('0x1b')][_0xfbdc('0x76')](this,_0x692d2b[_0xfbdc('0xe4')]);if(!_0x2f050d){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x692d2b,_0xfbdc('0xe6'));}var _0xf10f46=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0xfbdc('0xe7'),[util[_0xfbdc('0x2b')](_0xfbdc('0xe8'),_0x2f050d),_0x692d2b[_0xfbdc('0x6b')],_0x692d2b['opts'],_0x692d2b['url']]);if(_0xf10f46['result']===-0x1){return _0xf10f46;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xe9'),_0xfbdc('0xe7')));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xea')]=function(_0x53614b){logger['info'](util['format'](_0xfbdc('0xeb'),_0x53614b['label']));if(!this[_0xfbdc('0x8b')](_0x53614b[_0xfbdc('0x87')])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0xec'));}if(!this[_0xfbdc('0x8b')](_0x53614b[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xb0'));}this[_0xfbdc('0xc')][_0xfbdc('0xed')]=!![];this['createSquareDetailsReport'](_0x53614b);this[_0xfbdc('0x45')](_0x53614b[_0xfbdc('0x62')],'in','','');this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Trying\x20Dialogflow:\x20%s',_0x53614b[_0xfbdc('0x62')]));var _0x456288=this['googleDialogflow'][_0xfbdc('0x76')](this,_0x53614b);if(_0x456288){for(var _0x56ce84 in _0x456288){if(_0x456288[_0xfbdc('0x9d')](_0x56ce84)){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')]('DIALOGFLOW_%s',_0x56ce84[_0xfbdc('0x70')]()),_0x456288[_0x56ce84]);}}this[_0xfbdc('0x45')](_0x456288[_0xfbdc('0xee')],_0xfbdc('0xef'),_0xfbdc('0xea'),'');return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xf0'),_0x456288['speech']));}return this[_0xfbdc('0xc')]['error'](_0x53614b,_0xfbdc('0xf1'));};AGIVertices[_0xfbdc('0xe')]['dialogflowV2']=function(_0x22d0fd){logger['info'](util['format'](_0xfbdc('0xf2'),_0x22d0fd[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x22d0fd[_0xfbdc('0x82')])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0xf3'));}if(!this[_0xfbdc('0x8b')](_0x22d0fd['client_email'])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xf4'));}if(!this['isConfigured'](_0x22d0fd[_0xfbdc('0x83')])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0xf5'));}if(!this['isConfigured'](_0x22d0fd[_0xfbdc('0x84')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20anguage\x20configured');}if(!this[_0xfbdc('0x8b')](_0x22d0fd[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xb0'));}this[_0xfbdc('0xc')][_0xfbdc('0xed')]=!![];this[_0xfbdc('0x3a')](_0x22d0fd);this[_0xfbdc('0x45')](_0x22d0fd['text'],'in','','');this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0xf6'),_0x22d0fd[_0xfbdc('0x62')]));var _0x3956da=this['googleDialogflowV2'][_0xfbdc('0x76')](this,_0x22d0fd);if(_0x3956da){for(var _0x3e8cee in _0x3956da){if(_0x3956da[_0xfbdc('0x9d')](_0x3e8cee)){if(_0x3e8cee!==_0xfbdc('0xf7')){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util['format'](_0xfbdc('0xf8'),_0x3e8cee[_0xfbdc('0x70')]()),_0x3956da[_0x3e8cee]);}}}this[_0xfbdc('0x45')](_0x3956da[_0xfbdc('0xee')],_0xfbdc('0xef'),_0xfbdc('0xf9'),_0x3956da[_0xfbdc('0xf7')]);return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xfa'),_0x3956da['speech']));}return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x22d0fd,_0xfbdc('0xfb'));};AGIVertices['prototype'][_0xfbdc('0xfc')]=function(_0x178550){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xfd'),_0x178550[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x178550['ndauth_url'])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xfe'));}if(!this[_0xfbdc('0x8b')](_0x178550[_0xfbdc('0xff')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x100'));}if(!this[_0xfbdc('0x8b')](_0x178550[_0xfbdc('0x101')])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0x102'));}if(!this[_0xfbdc('0x8b')](_0x178550[_0xfbdc('0x103')])){return this['channel'][_0xfbdc('0xaf')]('no\x20text\x20configured');}this[_0xfbdc('0xc')][_0xfbdc('0xed')]=!![];this[_0xfbdc('0x3a')](_0x178550);this[_0xfbdc('0x45')](_0x178550['text'],'in','','');this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format']('Trying\x20SestekNDA:\x20%s',_0x178550[_0xfbdc('0x62')]));var _0x24ce34=this[_0xfbdc('0x85')]['sync'](this,_0x178550);if(_0x24ce34){for(var _0x369a74 in _0x24ce34){if(_0x24ce34[_0xfbdc('0x9d')](_0x369a74)){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')](_0xfbdc('0x104'),_0x369a74[_0xfbdc('0x70')]()),_0x24ce34[_0x369a74]);}}this[_0xfbdc('0x45')](_0x24ce34['speech'],_0xfbdc('0xef'),'sesteknda','');if(_0x24ce34['audiofile']){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x105'),_0x24ce34[_0xfbdc('0x106')]));var _0x1806bf=this['channel'][_0xfbdc('0x107')](_0x24ce34['audiofile']);try{fs[_0xfbdc('0x108')](_0x24ce34['audiofile']+_0xfbdc('0x109'));}catch(_0x22fdb4){logger['error'](_0x22fdb4);}return _0x1806bf;}else{return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x10a'),_0x24ce34[_0xfbdc('0xee')]));}}return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x178550,_0xfbdc('0x10b'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x10c')]=function(_0x14caad){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x10d'),_0x14caad[_0xfbdc('0xb5')]));return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x10c'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x10e')]=function(_0x1d43f1){logger[_0xfbdc('0x30')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x1d43f1[_0xfbdc('0xb5')]));var _0x549915='';if(_0x1d43f1['trunk_id']){if(!this[_0xfbdc('0x8b')](_0x1d43f1['trunk_id'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x1d43f1,_0xfbdc('0x10f'));}else{var _0x3aa076=parseInt(_0x1d43f1[_0xfbdc('0x110')],0xa);if(isNaN(_0x3aa076)){_0x549915=_0x1d43f1[_0xfbdc('0x110')];}else{_0x549915=this[_0xfbdc('0x1d')][_0xfbdc('0x76')](this,_0x1d43f1[_0xfbdc('0x110')]);if(!_0x549915){return this[_0xfbdc('0xc')]['error'](_0x1d43f1,_0xfbdc('0x111'));}}}}else if(_0x1d43f1[_0xfbdc('0x112')]){_0x549915=_0x1d43f1['trunk_name'];}else{return this['channel'][_0xfbdc('0x56')](_0x1d43f1,_0xfbdc('0x10f'));}var _0x5067fc=this['channel']['exec'](_0xfbdc('0xe7'),[util[_0xfbdc('0x2b')]('SIP/%s/%s',_0x549915,_0x1d43f1[_0xfbdc('0x4c')]),_0x1d43f1[_0xfbdc('0x6b')],_0x1d43f1[_0xfbdc('0x113')],_0x1d43f1[_0xfbdc('0x114')]]);if(_0x5067fc[_0xfbdc('0xab')]===-0x1){return _0x5067fc;}return this['channel'][_0xfbdc('0xaf')](util['format'](_0xfbdc('0xe9'),_0xfbdc('0xe7')));};AGIVertices[_0xfbdc('0xe')]['finally']=function(_0x597e98){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x115'),_0x597e98['label']));return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('finally');};AGIVertices['prototype'][_0xfbdc('0xa')]=function(_0x5c323c){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x116'),_0x5c323c[_0xfbdc('0xb5')]));if(_0x5c323c[_0xfbdc('0xae')]===0x0){return this['maxRetry'](_0x5c323c);}_0x5c323c['retry']-=0x1;if(!this[_0xfbdc('0x8b')](_0x5c323c[_0xfbdc('0x117')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x5c323c,_0xfbdc('0x118'));}var _0x39bbfb=this[_0xfbdc('0x1f')][_0xfbdc('0x76')](this,_0x5c323c[_0xfbdc('0x117')]);if(!_0x39bbfb){return this['channel'][_0xfbdc('0x56')](_0x5c323c,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x5c323c[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0xfbdc('0xdb'));}var _0xc08d4f=this['channel'][_0xfbdc('0x119')](_0x39bbfb,_0x5c323c[_0xfbdc('0x11a')],_0x5c323c[_0xfbdc('0x11b')]);var _0xc0b6c4=_0xc08d4f[_0xfbdc('0xab')]?_0xc08d4f[_0xfbdc('0xab')][_0xfbdc('0x51')]():'';logger['info'](_0xfbdc('0x11c'),JSON[_0xfbdc('0x7a')](_0xc08d4f));if(_0xc08d4f[_0xfbdc('0xab')]===-0x1){this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x5c323c,_0xc0b6c4);return _0xc08d4f;}else if(_0xc08d4f[_0xfbdc('0xaa')]==='timeout'){_0xc08d4f[_0xfbdc('0xab')]=_0xc0b6c4['length']>=parseInt(_0x5c323c['mindigit'])?'x':'i';}else{_0xc08d4f['result']=_0xc0b6c4[_0xfbdc('0xa3')]>=parseInt(_0x5c323c['mindigit'])&&_0xc0b6c4['length']<=parseInt(_0x5c323c[_0xfbdc('0x11b')])?'x':'i';}var _0x23cd3b=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x5c323c[_0xfbdc('0xda')]);if(!_0x23cd3b){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x5c323c,_0xfbdc('0xdc'));}this[_0xfbdc('0xc')][_0xfbdc('0xa7')](_0x23cd3b,_0xc0b6c4);if(this[_0xfbdc('0x8b')](_0x5c323c[_0xfbdc('0x11d')])){var _0x248406=parseInt(_0x5c323c[_0xfbdc('0x11d')],0xa);var _0x49f9c3=rs[_0xfbdc('0x11e')]({'charset':'*','length':_0x248406});var _0x38cbd5=_0xc0b6c4[_0xfbdc('0xa3')];if(_0x38cbd5>0x0){if(_0x38cbd5>_0x248406){this[_0xfbdc('0x3a')]['sync'](this,_0x5c323c,_0x5c323c[_0xfbdc('0x11f')]==='first'?_0x49f9c3+_0xc0b6c4[_0xfbdc('0x120')](_0x248406):_0xc0b6c4[_0xfbdc('0x120')](0x0,_0x38cbd5-_0x248406)+_0x49f9c3);}else{this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x5c323c,rs[_0xfbdc('0x11e')]({'charset':'*','length':_0x38cbd5}));}}else{this['createSquareDetailsReport'][_0xfbdc('0x76')](this,_0x5c323c,'');}}else{this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x5c323c,_0xc0b6c4);}return _0xc08d4f;};AGIVertices['prototype'][_0xfbdc('0xb')]=function(_0x97313){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x121'),_0x97313[_0xfbdc('0xb5')]));return this[_0xfbdc('0xa')](_0x97313);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x122')]=function(_0x4dcf69){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x123'),_0x4dcf69[_0xfbdc('0xb5')]));this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x4dcf69,_0x4dcf69[_0xfbdc('0x124')]);return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x125'),_0x4dcf69[_0xfbdc('0x124')]));};AGIVertices['prototype'][_0xfbdc('0x126')]=function(_0x28e7a6){logger['info'](util['format'](_0xfbdc('0x127'),_0x28e7a6[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x28e7a6[_0xfbdc('0x8e')])||!this[_0xfbdc('0x8b')](_0x28e7a6[_0xfbdc('0x93')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x128'));}if(!this[_0xfbdc('0x8b')](_0x28e7a6[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20text\x20configured');}this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Trying\x20aws\x20Polly\x20%s',_0x28e7a6[_0xfbdc('0x62')]));var _0x358d93=this[_0xfbdc('0x8d')][_0xfbdc('0x76')](this,_0x28e7a6);if(_0x358d93){this['channel'][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x129'),_0x358d93));var _0x2bd999=this[_0xfbdc('0xc')][_0xfbdc('0x107')](_0x358d93);try{fs['unlink'](_0x358d93+_0xfbdc('0x109'));}catch(_0x1050aa){logger[_0xfbdc('0x56')](_0x1050aa);}return _0x2bd999;}return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x28e7a6,_0xfbdc('0x12a'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x12b')]=function(_0x2ae4c1){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x12c'),_0x2ae4c1[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x2ae4c1[_0xfbdc('0x8e')])||!this[_0xfbdc('0x8b')](_0x2ae4c1['aws_secret_access_key'])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0x128'));}if(!this[_0xfbdc('0x8b')](_0x2ae4c1['aws_bot_name'])){return this[_0xfbdc('0xc')]['noop']('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x2ae4c1[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20text\x20configured');}this[_0xfbdc('0xc')][_0xfbdc('0xed')]=!![];this[_0xfbdc('0x3a')](_0x2ae4c1);this[_0xfbdc('0x45')](_0x2ae4c1[_0xfbdc('0x62')],'in','','');this['channel'][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x12d'),_0x2ae4c1[_0xfbdc('0x62')]));var _0x3d8dbb=this[_0xfbdc('0x92')]['sync'](this,_0x2ae4c1);if(_0x3d8dbb){for(var _0x2154ee in _0x3d8dbb){if(_0x3d8dbb[_0xfbdc('0x9d')](_0x2154ee)&&_['isString'](_0x3d8dbb[_0x2154ee])){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')](_0xfbdc('0x12e'),_0x2154ee[_0xfbdc('0x70')]()),_0x3d8dbb[_0x2154ee]);}}if(_[_0xfbdc('0x48')](_0x3d8dbb[_0xfbdc('0x12f')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x130'));}else{this[_0xfbdc('0x45')](_0x3d8dbb[_0xfbdc('0x12f')],'out',_0xfbdc('0x131'),'');return this['channel'][_0xfbdc('0xaf')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x3d8dbb[_0xfbdc('0x12f')]));}}return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x2ae4c1,_0xfbdc('0x132'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x133')]=function(_0x535aa7){logger['info'](util['format'](_0xfbdc('0x134'),_0x535aa7[_0xfbdc('0xb5')],_0x535aa7[_0xfbdc('0x6b')]));if(!this[_0xfbdc('0x8b')](_0x535aa7['key'])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xec'));}var _0x30727f=_0xfbdc('0x135');var _0x5051fa=util[_0xfbdc('0x2b')](_0xfbdc('0x136'),FILES_PATH,rs[_0xfbdc('0x11e')](0x4));var _0x56bdd6=util[_0xfbdc('0x2b')]('%s.%s',_0x5051fa,_0x30727f);var _0xe87fbf=!![];if(_0x535aa7[_0xfbdc('0x137')]===_0xfbdc('0x138')){_0xe87fbf=![];}var _0x4fc43b=this[_0xfbdc('0xc')]['recordFile'](_0x5051fa,_0x30727f,_0x535aa7[_0xfbdc('0x139')],_0x535aa7[_0xfbdc('0x6b')],undefined,_0xe87fbf);if(_0x4fc43b['result']!==-0x1){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x13a'),_0x56bdd6));var _0x1b2dfd=this['googleASR'][_0xfbdc('0x76')](this,_0x535aa7,_0x56bdd6);if(_0x1b2dfd){for(var _0x1912a6 in _0x1b2dfd){if(_0x1b2dfd[_0xfbdc('0x9d')](_0x1912a6)){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')](_0xfbdc('0x13b'),_0x1912a6[_0xfbdc('0x70')]()),_0x1b2dfd[_0x1912a6]);}}return this[_0xfbdc('0xc')]['noop'](util[_0xfbdc('0x2b')]('GoogleASR\x20Result\x20%s',JSON[_0xfbdc('0x7a')](_0x1b2dfd)));}}return _0x4fc43b;};AGIVertices[_0xfbdc('0xe')]['tildeasr']=function(_0x48f2fb){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x13c'),_0x48f2fb[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x48f2fb[_0xfbdc('0x99')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x13d'));}if(!this[_0xfbdc('0x8b')](_0x48f2fb[_0xfbdc('0x9a')])){return this['channel'][_0xfbdc('0xaf')](_0xfbdc('0x13e'));}var _0x3bc4d0=_0xfbdc('0x135');var _0x4e5abe=util['format'](_0xfbdc('0x136'),FILES_PATH,rs['generate'](0x4));var _0x4f60b6=util[_0xfbdc('0x2b')](_0xfbdc('0xa6'),_0x4e5abe,_0x3bc4d0);var _0xe05ba5=!![];if(_0x48f2fb[_0xfbdc('0x137')]===_0xfbdc('0x138')){_0xe05ba5=![];}var _0x5df3b8=this[_0xfbdc('0xc')]['recordFile'](_0x4e5abe,_0x3bc4d0,_0x48f2fb[_0xfbdc('0x139')],_0x48f2fb[_0xfbdc('0x6b')],undefined,_0xe05ba5);if(_0x5df3b8[_0xfbdc('0xab')]!==-0x1){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x13f'),_0x4f60b6));var _0x48faf1=this['tildeASR'][_0xfbdc('0x76')](this,_0x48f2fb,_0x4f60b6);if(_0x48faf1){for(var _0x3c8a1c in _0x48faf1){if(_0x48faf1['hasOwnProperty'](_0x3c8a1c)){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')](_0xfbdc('0x140'),_0x3c8a1c[_0xfbdc('0x70')]()),_0x48faf1[_0x3c8a1c]);}}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x141'),JSON['stringify'](_0x48faf1)));}}return _0x5df3b8;};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x142')]=function(_0xcf493b){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x143'),_0xcf493b[_0xfbdc('0xb5')]));return this[_0xfbdc('0xc')][_0xfbdc('0x144')](_0xcf493b[_0xfbdc('0x40')],_0xcf493b[_0xfbdc('0x41')],_0xcf493b[_0xfbdc('0x42')]);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x145')]=function(_0x22a94d){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x146'),_0x22a94d[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x22a94d[_0xfbdc('0x147')])){return this['channel'][_0xfbdc('0x56')](_0x22a94d,_0xfbdc('0x148'));}try{var _0x50c522=eval(_0x22a94d[_0xfbdc('0x147')])?_0xfbdc('0x149'):_0xfbdc('0x14a');this[_0xfbdc('0xc')]['noop'](util[_0xfbdc('0x2b')]('EVAL\x20CONDITION\x20%s\x20%s',_0x22a94d[_0xfbdc('0x147')],_0x50c522));return{'code':0xc8,'result':_0x50c522};}catch(_0x30b96e){return{'code':0xc8,'result':_0xfbdc('0x14a')};}};AGIVertices['prototype']['gotoiftime']=function(_0x2814d2){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x14b'),_0x2814d2['label']));if(!this[_0xfbdc('0x8b')](_0x2814d2['interval_id'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x2814d2,_0xfbdc('0x14c'));}var _0x49dda9=this[_0xfbdc('0x26')][_0xfbdc('0x76')](this,_0x2814d2[_0xfbdc('0x14d')]);if(!_0x49dda9){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x2814d2,_0xfbdc('0x14e'));}for(var _0x1e428d=0x0;_0x1e428d<_0x49dda9['length'];_0x1e428d+=0x1){var _0x3dfa85=this[_0xfbdc('0xc')][_0xfbdc('0xf')](util['format'](_0xfbdc('0x14f'),_0x49dda9[_0x1e428d]));if(_0x3dfa85['result']===-0x1){return _0x3dfa85;}logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x150'),_0x49dda9[_0x1e428d],_0x3dfa85[_0xfbdc('0xaa')]));if(_0x3dfa85[_0xfbdc('0xaa')]===_0xfbdc('0x149')){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x150'),_0x49dda9[_0x1e428d],_0xfbdc('0x149')));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x150'),_0x49dda9[_0x1e428d],_0xfbdc('0x149')));return{'code':0xc8,'result':_0xfbdc('0x149')};}else{logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x150'),_0x49dda9[_0x1e428d],_0xfbdc('0x14a')));this[_0xfbdc('0xc')]['noop'](util['format'](_0xfbdc('0x150'),_0x49dda9[_0x1e428d],_0xfbdc('0x14a')));}}return{'code':0xc8,'result':_0xfbdc('0x14a')};};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x151')]=function(_0x4455a9){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x152'),_0x4455a9[_0xfbdc('0xb5')]));return this['channel']['hangup']();};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x153')]=function(_0x4216e7){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x154'),_0x4216e7[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x4216e7[_0xfbdc('0x87')])){return this['channel'][_0xfbdc('0xaf')](_0xfbdc('0xec'));}var _0x58a23c='wav';var _0x5a5af1=util[_0xfbdc('0x2b')](_0xfbdc('0x136'),FILES_PATH,rs['generate'](0x4));var _0x37281a=util[_0xfbdc('0x2b')](_0xfbdc('0xa6'),_0x5a5af1,_0x58a23c);var _0x2afe5a=!![];if(_0x4216e7[_0xfbdc('0x137')]==='NOBEEP'){_0x2afe5a=![];}var _0x46ee0b=this[_0xfbdc('0xc')][_0xfbdc('0x155')](_0x5a5af1,_0x58a23c,_0x4216e7[_0xfbdc('0x139')],_0x4216e7[_0xfbdc('0x6b')],undefined,_0x2afe5a);if(_0x46ee0b[_0xfbdc('0xab')]!==-0x1){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('ispeech\x20%s\x20file\x20created',_0x37281a));var _0x5def3a=this['ispeechASR'][_0xfbdc('0x76')](this,_0x4216e7,_0x37281a);if(_0x5def3a){for(var _0x1faf22 in _0x5def3a){if(_0x5def3a[_0xfbdc('0x9d')](_0x1faf22)){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')]('ISPEECH_ASR_%s',_0x1faf22[_0xfbdc('0x70')]()),_0x5def3a[_0x1faf22]);}}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x156'),JSON[_0xfbdc('0x7a')](_0x5def3a)));}}return _0x46ee0b;};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x157')]=function(_0x463ff1){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x158'),_0x463ff1[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x463ff1[_0xfbdc('0x87')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xec'));}if(!this['isConfigured'](_0x463ff1[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')]['noop']('no\x20text\x20configured');}this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x159'),_0x463ff1['text']));var _0x455d2c=this[_0xfbdc('0x86')][_0xfbdc('0x76')](this,_0x463ff1);if(_0x455d2c){this[_0xfbdc('0xc')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x455d2c));var _0x59cedf=this[_0xfbdc('0xc')][_0xfbdc('0x107')](_0x455d2c,_0x463ff1['intKey']);try{fs[_0xfbdc('0x108')](_0x455d2c+'.wav');}catch(_0x4bfd6d){logger[_0xfbdc('0x56')](_0x4bfd6d);}return _0x59cedf;}return this['channel'][_0xfbdc('0x56')](_0x463ff1,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x15a')]=function(_0x1c0dd6){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x1c0dd6[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x1c0dd6['findBy'])){return this[_0xfbdc('0xc')]['error'](_0x1c0dd6,_0xfbdc('0x15b'));}logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x15c'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1c0dd6[_0xfbdc('0x15d')]));var _0x38a973=this[_0xfbdc('0x5b')][_0xfbdc('0x76')](this,_0x1c0dd6['findBy']);if(_0x38a973){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x15e'),this['channel']['callerid'],_0x1c0dd6[_0xfbdc('0x15d')]));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x15e'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1c0dd6[_0xfbdc('0x15d')]));return{'code':0xc8,'result':_0xfbdc('0x15f')};}else{logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x160'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1c0dd6[_0xfbdc('0x15d')]));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x160'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1c0dd6['findBy']));return{'code':0xc8,'result':_0xfbdc('0x161')};}};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x162')]=function(_0x1dbd46){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x163'),_0x1dbd46[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x1dbd46[_0xfbdc('0x15d')])){return this['channel'][_0xfbdc('0x56')](_0x1dbd46,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0xfbdc('0x15c'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1dbd46[_0xfbdc('0x15d')]));var _0x4d8609=this[_0xfbdc('0x58')]['sync'](this,_0x1dbd46[_0xfbdc('0x15d')]);if(_0x4d8609){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x15e'),this['channel'][_0xfbdc('0x3c')],_0x1dbd46[_0xfbdc('0x15d')]));this['channel'][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x15e'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1dbd46[_0xfbdc('0x15d')]));return{'code':0xc8,'result':_0xfbdc('0x15f')};}else{logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x160'),this[_0xfbdc('0xc')]['callerid'],_0x1dbd46['findBy']));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1dbd46[_0xfbdc('0x15d')]));return{'code':0xc8,'result':_0xfbdc('0x161')};}};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x164')]=function(_0x1772b2){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x165'),_0x1772b2[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x1772b2['operation'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x1772b2,_0xfbdc('0x166'));}this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('math\x20%s',_0x1772b2[_0xfbdc('0x167')]));var _0x3a9438=eval(_0x1772b2['operation']);if(!this[_0xfbdc('0x8b')](_0x1772b2[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xdb'));}var _0x2a8539=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x1772b2[_0xfbdc('0xda')]);if(!_0x2a8539){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x1772b2,_0xfbdc('0xdc'));}if(_[_0xfbdc('0xa2')](_0x3a9438)){var _0x33ff38=this;_0x3a9438[_0xfbdc('0xdd')](function(_0x3e1e90,_0x414d5d){_0x33ff38[_0xfbdc('0xc')]['setVariable'](util[_0xfbdc('0x2b')](_0xfbdc('0x168'),_0x2a8539,_0x414d5d),_0x3e1e90);});return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x169'),_0x2a8539));}else{return this['channel'][_0xfbdc('0xa7')](_0x2a8539,_0x3a9438);}};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x16a')]=function(_0x442372){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x16b'),_0x442372['label']));if(_0x442372['retry']===0x0){return this[_0xfbdc('0xad')](_0x442372);}_0x442372[_0xfbdc('0xae')]-=0x1;if(!this[_0xfbdc('0x8b')](_0x442372[_0xfbdc('0x117')])){return this[_0xfbdc('0xc')]['error'](_0x442372,_0xfbdc('0x118'));}var _0x1d9b16=this[_0xfbdc('0x1f')][_0xfbdc('0x76')](this,_0x442372[_0xfbdc('0x117')]);if(!_0x1d9b16){return this['channel'][_0xfbdc('0x56')](_0x442372,_0xfbdc('0x16c'));}var _0x1ecbb8=this[_0xfbdc('0xc')][_0xfbdc('0x119')](_0x1d9b16,_0x442372[_0xfbdc('0x11a')],_0x442372[_0xfbdc('0x16d')]);var _0x285159=_0x1ecbb8[_0xfbdc('0xab')];if(_0x1ecbb8[_0xfbdc('0xab')]===-0x1){this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x442372,'-1');return _0x1ecbb8;}else if(_0x1ecbb8['extra']===_0xfbdc('0x6b')){_0x1ecbb8['result']=_0x1ecbb8[_0xfbdc('0xab')][_0xfbdc('0xa3')]>0x0?_0x1ecbb8[_0xfbdc('0xab')]:'t';}else if(_[_0xfbdc('0x47')](_0x1ecbb8[_0xfbdc('0xab')])){_0x1ecbb8[_0xfbdc('0xab')]='#';_0x285159='#';}if(!this[_0xfbdc('0x8b')](_0x442372[_0xfbdc('0xda')])){this[_0xfbdc('0xc')]['noop'](_0xfbdc('0xdb'));}else{var _0x4c1c77=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x442372['variable_id']);if(!_0x4c1c77){return this[_0xfbdc('0xc')]['error'](_0x442372,_0xfbdc('0xdc'));}this[_0xfbdc('0xc')][_0xfbdc('0xa7')](_0x4c1c77,_0x285159);}this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x442372,_0x285159);return _0x1ecbb8;};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xaf')]=function(_0x2d97ab){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x16e'),_0x2d97ab[_0xfbdc('0xb5')]));return this['channel'][_0xfbdc('0xaf')](_0x2d97ab['output']||_0x2d97ab[_0xfbdc('0xb5')]);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x16f')]=function(_0x515329){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x170'),_0x515329[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x515329['findBy'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x515329,_0xfbdc('0x15b'));}logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x15c'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x515329[_0xfbdc('0x15d')]));var _0x4c5ab5=this[_0xfbdc('0x171')][_0xfbdc('0x76')](this,_0x515329[_0xfbdc('0x172')]);var _0x376f37=this[_0xfbdc('0x54')][_0xfbdc('0x76')](this,_0x515329[_0xfbdc('0x15d')],_0x4c5ab5);if(_0x376f37){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x515329[_0xfbdc('0x15d')]));this[_0xfbdc('0xc')]['noop'](util[_0xfbdc('0x2b')](_0xfbdc('0x15e'),this[_0xfbdc('0xc')]['callerid'],_0x515329['findBy']));return{'code':0xc8,'result':_0xfbdc('0x15f')};}else{logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x515329['findBy']));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x15e'),this['channel'][_0xfbdc('0x3c')],_0x515329['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xfbdc('0x173')]=function(_0x5bdec8){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x174'),_0x5bdec8[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x5bdec8[_0xfbdc('0x117')])){return this['channel'][_0xfbdc('0x56')](_0x5bdec8,'no\x20file\x20audio\x20selected');}var _0x33e800=this[_0xfbdc('0x1f')][_0xfbdc('0x76')](this,_0x5bdec8[_0xfbdc('0x117')]);if(!_0x33e800){return this['channel'][_0xfbdc('0x56')](_0x5bdec8,_0xfbdc('0x16c'));}var _0x11b78c=this['channel'][_0xfbdc('0x5d')]('PLAYBACK',[_0x33e800,_0x5bdec8[_0xfbdc('0x113')]]);if(_0x11b78c[_0xfbdc('0xab')]===-0x1){return _0x11b78c;}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0xcc'),_0xfbdc('0x175'),_0x33e800));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x176')]=function(_0x8cdbee){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x177'),_0x8cdbee[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x8cdbee[_0xfbdc('0x178')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x8cdbee,_0xfbdc('0x179'));}var _0x1210c6='';var _0x180e39=parseInt(_0x8cdbee[_0xfbdc('0x178')],0xa);if(isNaN(_0x180e39)){_0x1210c6=_0x8cdbee[_0xfbdc('0x178')];}else{_0x1210c6=this[_0xfbdc('0x13')][_0xfbdc('0x76')](this,_0x8cdbee[_0xfbdc('0x178')]);if(!_0x1210c6){return this[_0xfbdc('0xc')]['error'](_0x8cdbee,_0xfbdc('0x17a'));}}var _0x4e65ad='';if(this[_0xfbdc('0x8b')](_0x8cdbee['file_id'])){var _0x322df3=this[_0xfbdc('0x1f')][_0xfbdc('0x76')](this,_0x8cdbee[_0xfbdc('0x117')]);if(_0x322df3){_0x4e65ad=_0x322df3;}}this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x8cdbee,_0x1210c6);if(_0x8cdbee[_0xfbdc('0x113')]['indexOf']('x')<0x0){_0x8cdbee['opts']+='x';}if(_0x8cdbee['opts']['indexOf']('X')<0x0){_0x8cdbee[_0xfbdc('0x113')]+='X';}this[_0xfbdc('0xc')][_0xfbdc('0xa7')](_0xfbdc('0x17b'),_0x1210c6?_0x1210c6[_0xfbdc('0x17c')]():'');var _0x33ba16=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0xfbdc('0x17d'),[_0x1210c6,_0x8cdbee[_0xfbdc('0x113')],_0x8cdbee[_0xfbdc('0x114')],_0x4e65ad,_0x8cdbee[_0xfbdc('0x6b')],_0x8cdbee[_0xfbdc('0xc2')],_0x8cdbee[_0xfbdc('0x17e')],_0x8cdbee[_0xfbdc('0x17f')],'',_0x8cdbee['position']]);if(_0x33ba16[_0xfbdc('0xab')]===-0x1){return _0x33ba16;}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format']('Executed\x20command\x20%s\x20%s','QUEUE',_0x1210c6));};AGIVertices['prototype'][_0xfbdc('0x180')]=function(_0x4809f6){logger['info'](util['format'](_0xfbdc('0x181'),_0x4809f6['label']));var _0x184f50=_0x4809f6['recordingFormat']||'wav';var _0x5cb19c=util[_0xfbdc('0x2b')](_0xfbdc('0x182'),this[_0xfbdc('0xc')][_0xfbdc('0x3e')],rs[_0xfbdc('0x11e')](0x5));var _0x113826=util[_0xfbdc('0x2b')]('%s/recordings/%s.%s',FILES_PATH,_0x5cb19c,_0x184f50);var _0x4bd132=util['format'](_0xfbdc('0x136'),FILES_PATH,_0x5cb19c);this['createSquareRecording'][_0xfbdc('0x76')](this,_0x4809f6,_0x5cb19c,_0x113826);this[_0xfbdc('0xc')]['setVariable']('RECORDING_SAVENAME',_0x5cb19c);logger[_0xfbdc('0x30')](_0xfbdc('0x183'),_0x4bd132,_0x184f50,_0x4809f6[_0xfbdc('0x184')],_0x4809f6['timeout']);return this[_0xfbdc('0xc')][_0xfbdc('0x155')](_0x4bd132,_0x184f50,_0x4809f6[_0xfbdc('0x184')],_0x4809f6[_0xfbdc('0x6b')],undefined,!![]);};AGIVertices['prototype'][_0xfbdc('0x185')]=function(_0x5cc7a2){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x186'),_0x5cc7a2[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x5cc7a2[_0xfbdc('0x114')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x187'));}var _0x6a810b=this[_0xfbdc('0x6a')][_0xfbdc('0x76')](this,_0x5cc7a2);logger['info'](util[_0xfbdc('0x2b')]('Response:',util[_0xfbdc('0x188')](_0x6a810b,{'showHidden':![],'depth':null})));if(!this[_0xfbdc('0x8b')](_0x5cc7a2[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1304d6=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x5cc7a2['variable_id']);if(!_0x1304d6){return this['channel']['error'](_0x5cc7a2,_0xfbdc('0xdc'));}this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')](_0xfbdc('0x189'),_0x1304d6),_0x6a810b[_0xfbdc('0x7d')]?_0x6a810b['statusCode']:_0xfbdc('0x18a'));this['channel'][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')]('%s_STATUS_MESSAGE',_0x1304d6),_0x6a810b[_0xfbdc('0x18b')]?_0x6a810b[_0xfbdc('0x18b')]:'OK');if(_0x6a810b[_0xfbdc('0x7b')]){try{this[_0xfbdc('0xa5')](_0x6a810b['body'],_0x1304d6);}catch(_0x5cf050){logger[_0xfbdc('0x56')](util[_0xfbdc('0x2b')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x1304d6));}}return this[_0xfbdc('0xc')]['noop'](util[_0xfbdc('0x2b')](_0xfbdc('0xe0'),_0x1304d6));};AGIVertices[_0xfbdc('0xe')]['saydigits']=function(_0x11ed16){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x18c'),_0x11ed16[_0xfbdc('0xb5')]));return this[_0xfbdc('0xc')][_0xfbdc('0x18d')](_0x11ed16[_0xfbdc('0x18e')][_0xfbdc('0x5e')](/\s+/g,''),_0x11ed16[_0xfbdc('0x184')]);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x18f')]=function(_0x28021f){logger[_0xfbdc('0x30')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x28021f[_0xfbdc('0xb5')]));return this[_0xfbdc('0xc')][_0xfbdc('0x190')](_0x28021f[_0xfbdc('0x191')][_0xfbdc('0x5e')](/\s+/g,''),_0x28021f[_0xfbdc('0x184')]);};AGIVertices[_0xfbdc('0xe')]['sayphonetic']=function(_0x388481){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x192'),_0x388481['label']));return this[_0xfbdc('0xc')][_0xfbdc('0x193')](_0x388481[_0xfbdc('0x62')],_0x388481['escape_digits']);};AGIVertices['prototype'][_0xfbdc('0x194')]=function(_0x515f4f){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x195'),_0x515f4f[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x515f4f[_0xfbdc('0x196')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x197'));}var _0xee99e4=this[_0xfbdc('0x23')][_0xfbdc('0x76')](this,_0x515f4f[_0xfbdc('0x196')]);if(!_0xee99e4||!_0xee99e4[_0xfbdc('0x198')]){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x515f4f,'no\x20mail\x20account\x20found');}var _0x44cd8c={'from':util[_0xfbdc('0x2b')](_0xfbdc('0x199'),_0xee99e4[_0xfbdc('0x15')],_0xee99e4['email']||_0xee99e4[_0xfbdc('0x198')]['user']),'to':_0x515f4f['to']||'','cc':_0x515f4f['cc']||'','bcc':_0x515f4f['bcc']||'','subject':_0x515f4f['subject'],'html':_0x515f4f[_0xfbdc('0x62')],'text':_0x515f4f['text']};var _0x1ba29a={'tls':{'rejectUnauthorized':![]}};if(_0xee99e4[_0xfbdc('0x198')]['service']){_0x1ba29a[_0xfbdc('0x19a')]=_0xee99e4[_0xfbdc('0x198')][_0xfbdc('0x19a')];}else{_0x1ba29a[_0xfbdc('0x19b')]=_0xee99e4[_0xfbdc('0x198')][_0xfbdc('0x19b')];_0x1ba29a['port']=_0xee99e4[_0xfbdc('0x198')][_0xfbdc('0x19c')];_0x1ba29a[_0xfbdc('0x19d')]=_0xee99e4[_0xfbdc('0x198')][_0xfbdc('0x19d')];}if(_0xee99e4[_0xfbdc('0x198')][_0xfbdc('0x19e')]){_0x1ba29a[_0xfbdc('0x19f')]={'user':_0xee99e4[_0xfbdc('0x198')]['user'],'pass':_0xee99e4[_0xfbdc('0x198')]['pass']};}if(this[_0xfbdc('0x8b')](_0x515f4f[_0xfbdc('0x1a0')])){}logger[_0xfbdc('0xe2')]('sendMail\x20message',JSON[_0xfbdc('0x7a')](_0x44cd8c));this[_0xfbdc('0x3a')]['sync'](this,_0x515f4f,_0x515f4f[_0xfbdc('0x196')]);this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x1a1'),_0xee99e4[_0xfbdc('0x15')]));this[_0xfbdc('0x25')]['sync'](this,_0x1ba29a,_0x44cd8c);return this['channel'][_0xfbdc('0xaf')](_0xfbdc('0x1a2'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1a3')]=function(_0x519895){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x1a4'),_0x519895[_0xfbdc('0xb5')]));return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x1a5'));};AGIVertices['prototype'][_0xfbdc('0x1a6')]=function(_0x5fdcbe){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x1a7'),_0x5fdcbe[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x5fdcbe[_0xfbdc('0x1a8')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20sms\x20account\x20configured');}var _0x3aa252=this[_0xfbdc('0x37')][_0xfbdc('0x76')](this,_0x5fdcbe[_0xfbdc('0x1a8')]);if(!_0x3aa252){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x5fdcbe,_0xfbdc('0x1a9'));}var _0xf271e6={'body':_0x5fdcbe['sms_text'],'phone':_0x5fdcbe['to']||'','SmsAccountId':_0x3aa252['id']};logger['debug'](_0xfbdc('0x1aa'),JSON[_0xfbdc('0x7a')](_0xf271e6));this[_0xfbdc('0x3a')]['sync'](this,_0x5fdcbe,_0x5fdcbe[_0xfbdc('0x1a8')]);this['channel'][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x1ab'),_0x3aa252[_0xfbdc('0x15')]));this[_0xfbdc('0x39')]['sync'](this,_0xf271e6);return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0x1ac'));};AGIVertices[_0xfbdc('0xe')]['set']=function(_0x138ae9){logger[_0xfbdc('0x30')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x138ae9[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x138ae9[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x138ae9,_0xfbdc('0x1ad'));}var _0x4b2c73=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x138ae9[_0xfbdc('0xda')]);if(!_0x4b2c73){return this['channel'][_0xfbdc('0x56')](_0x138ae9,_0xfbdc('0xdc'));}return this['channel'][_0xfbdc('0xa7')](_0x4b2c73,_0x138ae9[_0xfbdc('0x1ae')]);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1af')]=function(_0xf696ab){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('Enter\x20in\x20START\x20(%s)\x20block',_0xf696ab['label']));this[_0xfbdc('0xc')]['noop'](_0xfbdc('0x1b0'));if(_0xf696ab[_0xfbdc('0xc5')]==='yes'){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x1b1'));return this[_0xfbdc('0xc')][_0xfbdc('0xc5')]();}return this['channel'][_0xfbdc('0xaf')](_0xfbdc('0x1b2'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1b3')]=function(_0x13747a){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x1b4'),_0x13747a['label']));if(!this[_0xfbdc('0x8b')](_0x13747a[_0xfbdc('0x1b5')])){return this['channel'][_0xfbdc('0x56')](_0x13747a,_0xfbdc('0x1b6'));}var _0x1180b8=this[_0xfbdc('0x16')][_0xfbdc('0x76')](this,_0x13747a[_0xfbdc('0x1b5')]);if(!this[_0xfbdc('0x8b')](_0x1180b8)){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x13747a,util['format'](_0xfbdc('0x1b7'),_0x13747a[_0xfbdc('0x1b5')]));}if(_0x1180b8===this[_0xfbdc('0xc')][_0xfbdc('0x3b')]){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x13747a,_0xfbdc('0x1b8'));}this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x13747a,_0x1180b8);var _0x120658=this['channel'][_0xfbdc('0x5d')](_0xfbdc('0x1b9'),util[_0xfbdc('0x2b')](_0xfbdc('0x1ba'),config[_0xfbdc('0xc2')][_0xfbdc('0x19b')]||'127.0.0.1',_0x1180b8,this[_0xfbdc('0xc')][_0xfbdc('0x3b')]));if(_0x120658[_0xfbdc('0xab')]===-0x1){return _0x120658;}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Executed\x20command\x20%s\x20%s',_0xfbdc('0x1b9'),_0x1180b8));};AGIVertices['prototype']['system']=function(_0x21599b){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x21599b[_0xfbdc('0xb5')]));var _0x5dd1f0=this['shellCommand'][_0xfbdc('0x76')](this,_0x21599b[_0xfbdc('0xc3')]);this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x21599b,_0x21599b[_0xfbdc('0xc3')]);if(this[_0xfbdc('0x8b')](_0x21599b['variable_id'])){var _0x2e3501=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x21599b[_0xfbdc('0xda')]);if(_0x2e3501){this['channel'][_0xfbdc('0xa7')](_0x2e3501,_0x5dd1f0);return this[_0xfbdc('0xc')]['noop'](util[_0xfbdc('0x2b')](_0xfbdc('0x1bb'),_0x21599b[_0xfbdc('0xc3')],_0x2e3501));}}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x21599b[_0xfbdc('0xc3')]));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1bc')]=function(_0x343150){logger['info'](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x343150[_0xfbdc('0xb5')]));_0x343150[_0xfbdc('0x62')]=_0x343150[_0xfbdc('0x62')][_0xfbdc('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x343150[_0xfbdc('0x60')])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0x1bd'));}if(!this['isConfigured'](_0x343150[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xb0'));}this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x343150['text']));var _0x53abd7=this['googleCloudTTS'][_0xfbdc('0x76')](this,_0x343150);if(_0x53abd7){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x1be'),_0x53abd7));var _0x1e725b=this[_0xfbdc('0xc')]['streamFile'](_0x53abd7);try{fs['unlink'](_0x53abd7+'.wav');}catch(_0x42b042){logger[_0xfbdc('0x56')](_0x42b042);}return _0x1e725b;}return this['channel'][_0xfbdc('0x56')](_0x343150,_0xfbdc('0x1bf'));};AGIVertices['prototype']['tts']=function(_0x17ccd4){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x1c0'),_0x17ccd4[_0xfbdc('0xb5')]));_0x17ccd4[_0xfbdc('0x62')]=_0x17ccd4[_0xfbdc('0x62')][_0xfbdc('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x17ccd4[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20text\x20configured');}this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Trying\x20Google\x20TTS\x20%s',_0x17ccd4[_0xfbdc('0x62')]));var _0xbc6d61=this[_0xfbdc('0x68')]['sync'](this,_0x17ccd4);if(_0xbc6d61){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x1c1'),_0xbc6d61));var _0x1888d3=this[_0xfbdc('0xc')][_0xfbdc('0x107')](_0xbc6d61);try{fs[_0xfbdc('0x108')](_0xbc6d61+'.wav');}catch(_0x3889b3){logger[_0xfbdc('0x56')](_0x3889b3);}return _0x1888d3;}return this['channel']['error'](_0x17ccd4,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1c2')]=function(_0x4b95fa){logger['info'](util[_0xfbdc('0x2b')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x4b95fa[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x4b95fa[_0xfbdc('0x15d')])){return this['channel'][_0xfbdc('0x56')](_0x4b95fa,_0xfbdc('0x15b'));}logger['info'](util['format'](_0xfbdc('0x15c'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x4b95fa['findBy']));var _0x2e9e00=this[_0xfbdc('0x57')][_0xfbdc('0x76')](this,_0x4b95fa[_0xfbdc('0x15d')]);if(_0x2e9e00){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x15e'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x4b95fa[_0xfbdc('0x15d')]));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x15e'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x4b95fa[_0xfbdc('0x15d')]));return{'code':0xc8,'result':_0xfbdc('0x15f')};}else{logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x160'),this[_0xfbdc('0xc')]['callerid'],_0x4b95fa[_0xfbdc('0x15d')]));this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x160'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x4b95fa[_0xfbdc('0x15d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1c3')]=function(_0x43de3f){logger[_0xfbdc('0x30')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x43de3f['label']));var _0x2bc383=this['channel']['exec'](_0xfbdc('0x1c4'),[_0x43de3f[_0xfbdc('0x1c5')],_0x43de3f['options']]);if(_0x2bc383[_0xfbdc('0xab')]===-0x1){return _0x2bc383;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xcc'),_0xfbdc('0x1c4'),_0x43de3f[_0xfbdc('0x1c5')]));};AGIVertices['prototype'][_0xfbdc('0x1c6')]=function(_0x49a7e0){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x1c7'),_0x49a7e0[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x49a7e0[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x49a7e0,_0xfbdc('0x1ad'));}var _0x1b277a=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x49a7e0[_0xfbdc('0xda')]);if(!_0x1b277a){return this[_0xfbdc('0xc')]['error'](_0x49a7e0,_0xfbdc('0xdc'));}var _0x2ca9fb=this['channel'][_0xfbdc('0xf')](_0x1b277a);return{'code':0xc8,'result':_0x2ca9fb['extra']?_0x2ca9fb['extra']:'-'};};String[_0xfbdc('0xe')]['replaceAll']=function(_0x593686,_0x328185){return this[_0xfbdc('0xa8')](_0x593686)['join'](_0x328185);};module[_0xfbdc('0x1c8')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 86e832e..989e5f5 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 _0xccc9=['milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','stringify','transfererlinkedid','syncAgentRingNoAnswer','autopause','all','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','syncHangup','agentringnoanswer','syncAttendedTransfer','syncAgentConnectPreview'];(function(_0x568ae7,_0x2b5fa3){var _0x257050=function(_0x43e8df){while(--_0x43e8df){_0x568ae7['push'](_0x568ae7['shift']());}};_0x257050(++_0x2b5fa3);}(_0xccc9,0x12c));var _0x9ccc=function(_0x44bb2f,_0x1f184c){_0x44bb2f=_0x44bb2f-0x0;var _0x4df9ad=_0xccc9[_0x44bb2f];return _0x4df9ad;};'use strict';var util=require(_0x9ccc('0x0'));var _=require(_0x9ccc('0x1'));var moment=require(_0x9ccc('0x2'));var ami=require(_0x9ccc('0x3'));var logger=require(_0x9ccc('0x4'))(_0x9ccc('0x5'));var RpcUser=require(_0x9ccc('0x6'));var RpcVoiceAgentReport=require(_0x9ccc('0x7'));function Acw(_0x41fd35){this['voiceQueues']=_0x41fd35[_0x9ccc('0x8')];this[_0x9ccc('0x9')]=_0x41fd35[_0x9ccc('0x9')];this[_0x9ccc('0xa')]=_0x41fd35[_0x9ccc('0xa')];this[_0x9ccc('0xb')]={};ami['on'](_0x9ccc('0xc'),this[_0x9ccc('0xd')][_0x9ccc('0xe')](this));ami['on']('hanguprequest',this[_0x9ccc('0xf')][_0x9ccc('0xe')](this));ami['on']('hangup',this[_0x9ccc('0x10')][_0x9ccc('0xe')](this));ami['on'](_0x9ccc('0x11'),this['syncAgentRingNoAnswer'][_0x9ccc('0xe')](this));ami['on']('attendedtransfer',this[_0x9ccc('0x12')][_0x9ccc('0xe')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x9ccc('0xe')](this));ami['on']('custom:agentConnectPreview',this[_0x9ccc('0x13')][_0x9ccc('0xe')](this));}function getDiff(_0x2a9eb3){var _0x5a75e3=moment()['milliseconds'](0x0);var _0x547a76=moment(_0x2a9eb3)[_0x9ccc('0x14')](0x0);return _0x5a75e3[_0x9ccc('0x15')](_0x547a76,_0x9ccc('0x16'));}Acw['prototype'][_0x9ccc('0x17')]=function(_0x34b81f){try{var _0x30e11c=this;var _0x3f96b6=this[_0x9ccc('0xb')][_0x34b81f][_0x9ccc('0x18')];var _0x3eaf6e=this[_0x9ccc('0xb')][_0x34b81f][_0x9ccc('0x19')];var _0x290d57=this[_0x9ccc('0x8')][_0x3eaf6e];var _0x88a51=![];var _0x12e54f=_0x9ccc('0x1a');if(_0x290d57[_0x9ccc('0x1b')]){if(_0x290d57['mandatoryDispositionPause'][_0x9ccc('0x1c')]){_0x88a51=!![];_0x12e54f=_0x290d57['mandatoryDispositionPause'][_0x9ccc('0x1c')];}}ami['Action']({'action':_0x9ccc('0x1d'),'interface':_0x3f96b6,'paused':!![],'reason':_0x12e54f})[_0x9ccc('0x1e')](function(_0x109741){if(_0x30e11c['agents'][_0x3f96b6]){return RpcUser[_0x9ccc('0x1f')](_0x30e11c['agents'][_0x3f96b6]['id'])[_0x9ccc('0x1e')](function(_0x290f4c){if(_0x290f4c&&!_0x290f4c[_0x9ccc('0x20')]){logger[_0x9ccc('0x21')](_0x9ccc('0x22'),_0x34b81f,_0x3f96b6,_0x3eaf6e);var _0x3e2400=_0x30e11c['channels'][_0x34b81f][_0x9ccc('0x23')]&&_0x30e11c[_0x9ccc('0xb')][_0x34b81f][_0x9ccc('0x24')]?_0x30e11c[_0x9ccc('0xb')][_0x34b81f][_0x9ccc('0x24')]:_0x34b81f;return RpcUser['savePause'](_0x30e11c[_0x9ccc('0x9')][_0x3f96b6],_0x12e54f,_0x3e2400)[_0x9ccc('0x1e')](function(_0xb4aa94){if(!_0x88a51){_0x30e11c['timers'][_0x3f96b6]={};logger['info'](_0x9ccc('0x25'),_0x34b81f,_0x30e11c[_0x9ccc('0x8')][_0x3eaf6e][_0x9ccc('0x26')],_0x3f96b6,_0x3eaf6e);_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x27')]=setTimeout(_0x30e11c[_0x9ccc('0x28')]['bind'](_0x30e11c,_0x3f96b6),_0x30e11c[_0x9ccc('0x8')][_0x3eaf6e][_0x9ccc('0x26')]*0x3e8);_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x29')]=moment()[_0x9ccc('0x2a')](_0x9ccc('0x2b'));_0x30e11c['timers'][_0x3f96b6]['uniqueid']=_0x34b81f;_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x19')]=_0x3eaf6e;_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x2c')]=function(){var _0x31e671=getDiff(_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x29')]);clearTimeout(_0x30e11c[_0x9ccc('0xa')][_0x3f96b6]['timer']);_0x30e11c['timers'][_0x3f96b6]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x31e671},_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x2d')],_0x3f96b6)['then'](function(_0xec75d3){logger[_0x9ccc('0x21')](_0x9ccc('0x2e'),_0x34b81f,_0x31e671,_0xec75d3);})[_0x9ccc('0x2f')](function(_0x152555){logger['error'](_0x9ccc('0x30'),_0x34b81f,_0x152555);});delete _0x30e11c[_0x9ccc('0xa')][_0x3f96b6];};}});}else{logger['info'](_0x9ccc('0x31'),_0x34b81f,_0x3f96b6,_0x3eaf6e);}});}})[_0x9ccc('0x2f')](function(_0x40827d){logger['error'](_0x9ccc('0x25'),_0x34b81f,_0x30e11c[_0x9ccc('0x8')][_0x3eaf6e][_0x9ccc('0x26')],_0x3f96b6,_0x3eaf6e);})[_0x9ccc('0x32')](function(){delete _0x30e11c[_0x9ccc('0xb')][_0x34b81f];});}catch(_0x167377){logger[_0x9ccc('0x33')](_0x9ccc('0x34'),_0x167377[_0x9ccc('0x35')]);}};Acw[_0x9ccc('0x36')][_0x9ccc('0x28')]=function(_0x78aa2e){try{var _0x1a6824=this;if(_0x1a6824[_0x9ccc('0xa')][_0x78aa2e]){_0x1a6824[_0x9ccc('0xa')][_0x78aa2e][_0x9ccc('0x27')]=![];var _0x17490c=_0x1a6824['timers'][_0x78aa2e]['uniqueid'];var _0x195b2e=_0x1a6824['timers'][_0x78aa2e][_0x9ccc('0x19')];var _0x40e4e2=_0x1a6824[_0x9ccc('0x8')][_0x195b2e]['acwTimeout'];logger[_0x9ccc('0x21')](_0x9ccc('0x37'),_0x17490c,_0x78aa2e);RpcUser[_0x9ccc('0x38')](this[_0x9ccc('0x9')][_0x78aa2e]);RpcVoiceAgentReport[_0x9ccc('0x39')]({'acwtime':_0x40e4e2,'agentacw':!![]},_0x17490c,_0x78aa2e)[_0x9ccc('0x1e')](function(_0x322c68){logger['info'](_0x9ccc('0x2e'),_0x17490c,_0x40e4e2,_0x322c68);})[_0x9ccc('0x2f')](function(_0x2e9fba){logger[_0x9ccc('0x33')](_0x9ccc('0x30'),_0x17490c,_0x2e9fba);});}else{logger[_0x9ccc('0x33')](_0x9ccc('0x3a'),_0x78aa2e);if(_0x1a6824[_0x9ccc('0xa')]){logger[_0x9ccc('0x21')]('[ACW][TIMERS]',JSON['stringify'](_0x1a6824[_0x9ccc('0xa')]));}}}catch(_0x58e194){logger[_0x9ccc('0x33')]('[ACW][STOP]\x20%s',_0x58e194[_0x9ccc('0x35')]);}};Acw['prototype'][_0x9ccc('0xd')]=function(_0x52857b){try{if(this[_0x9ccc('0x8')][_0x52857b[_0x9ccc('0x19')]]&&(this[_0x9ccc('0x8')][_0x52857b[_0x9ccc('0x19')]][_0x9ccc('0x5')]||this[_0x9ccc('0x8')][_0x52857b['queue']][_0x9ccc('0x1b')])){if(this[_0x9ccc('0x9')][_0x52857b['interface']]){this[_0x9ccc('0xb')][_0x52857b['uniqueid']]={'queue':_0x52857b['queue'],'interface':_0x52857b[_0x9ccc('0x18')],'destlinkedid':_0x52857b[_0x9ccc('0x24')]};}}}catch(_0x2f2f6e){logger[_0x9ccc('0x33')]('[ACW][syncAgentConnect]\x20%s',_0x2f2f6e['message']);}};Acw[_0x9ccc('0x36')]['syncAgentConnectPreview']=function(_0x39432c){try{if(this[_0x9ccc('0x8')][_0x39432c[_0x9ccc('0x19')]]&&(this['voiceQueues'][_0x39432c['queue']][_0x9ccc('0x5')]||this['voiceQueues'][_0x39432c[_0x9ccc('0x19')]]['mandatoryDisposition'])){if(this['agents'][_0x39432c[_0x9ccc('0x18')]]){this[_0x9ccc('0xb')][_0x39432c['uniqueid']]={'queue':_0x39432c[_0x9ccc('0x19')],'interface':_0x39432c[_0x9ccc('0x18')]};}}}catch(_0x246403){logger[_0x9ccc('0x33')](_0x9ccc('0x3b'),_0x246403['message']);}};Acw[_0x9ccc('0x36')][_0x9ccc('0xf')]=function(_0x45f233){try{if(this[_0x9ccc('0xb')][_0x45f233['uniqueid']]&&_['isUndefined'](this[_0x9ccc('0xb')][_0x45f233[_0x9ccc('0x2d')]][_0x9ccc('0x23')])){logger[_0x9ccc('0x21')](_0x9ccc('0x3c'),_0x45f233[_0x9ccc('0x2d')]);this['startAcw'](_0x45f233[_0x9ccc('0x2d')]);}else if(this[_0x9ccc('0xb')][_0x45f233[_0x9ccc('0x3d')]]&&_[_0x9ccc('0x3e')](this[_0x9ccc('0xb')][_0x45f233[_0x9ccc('0x3d')]][_0x9ccc('0x23')])){logger[_0x9ccc('0x21')]('[%s][HANGUP:LINKEDID]',_0x45f233[_0x9ccc('0x3d')]);this[_0x9ccc('0x17')](_0x45f233['linkedid']);}}catch(_0x12a9ac){logger[_0x9ccc('0x33')]('[ACW][syncHangupRequest]\x20%s',_0x12a9ac[_0x9ccc('0x35')]);}};Acw['prototype'][_0x9ccc('0x10')]=function(_0x108762){try{if(this[_0x9ccc('0xb')][_0x108762[_0x9ccc('0x2d')]]&&this[_0x9ccc('0xb')][_0x108762[_0x9ccc('0x2d')]][_0x9ccc('0x23')]){logger['info'](_0x9ccc('0x3f'),_0x108762['uniqueid']);this[_0x9ccc('0x17')](_0x108762[_0x9ccc('0x2d')]);}else if(this[_0x9ccc('0xb')][_0x108762['linkedid']]&&this[_0x9ccc('0xb')][_0x108762[_0x9ccc('0x3d')]][_0x9ccc('0x23')]){logger['info'](_0x9ccc('0x40'),_0x108762['linkedid']);this[_0x9ccc('0x17')](_0x108762[_0x9ccc('0x3d')]);}}catch(_0x44b355){logger[_0x9ccc('0x33')]('[ACW][syncHangup]\x20%s',_0x44b355['message']);}};Acw['prototype'][_0x9ccc('0x12')]=function(_0xf18f29){try{if(!_['isNil'](this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x41')]])){this[_0x9ccc('0x17')](_0xf18f29[_0x9ccc('0x41')]);if(this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x42')]]){this[_0x9ccc('0xb')][_0xf18f29['secondtransfereruniqueid']][_0x9ccc('0x23')]=!![];this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x43')]]=this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x42')]];delete this['channels'][_0xf18f29[_0x9ccc('0x42')]];}}else if(!_['isNil'](this[_0x9ccc('0xb')][_0xf18f29['transfertargetuniqueid']])){this[_0x9ccc('0x17')](_0xf18f29[_0x9ccc('0x43')]);if(this[_0x9ccc('0xb')][_0xf18f29['origtransfereruniqueid']]){this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x44')]][_0x9ccc('0x23')]=!![];this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x41')]]=this[_0x9ccc('0xb')][_0xf18f29['origtransfereruniqueid']];delete this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x44')]];}}}catch(_0x442882){logger['error'](_0x9ccc('0x45'),_0x442882[_0x9ccc('0x35')]);}};Acw[_0x9ccc('0x36')][_0x9ccc('0x46')]=function(_0x55aa84){try{if(this[_0x9ccc('0xb')][_0x55aa84['transfereruniqueid']]){logger[_0x9ccc('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x55aa84[_0x9ccc('0x47')]));this['startAcw'](_0x55aa84['transfereruniqueid']);}else if(this['channels'][_0x55aa84['transfererlinkedid']]){logger[_0x9ccc('0x21')](_0x9ccc('0x48'),JSON[_0x9ccc('0x49')](_0x55aa84[_0x9ccc('0x4a')]));this['startAcw'](_0x55aa84[_0x9ccc('0x4a')]);}}catch(_0x31a946){logger[_0x9ccc('0x33')]('[ACW][syncBlindTransfer]\x20%s',_0x31a946[_0x9ccc('0x35')]);}};Acw[_0x9ccc('0x36')][_0x9ccc('0x4b')]=function(_0x166468){try{if(this[_0x9ccc('0x8')][_0x166468[_0x9ccc('0x19')]]&&this[_0x9ccc('0x8')][_0x166468[_0x9ccc('0x19')]][_0x9ccc('0x4c')]===_0x9ccc('0x4d')){if(this[_0x9ccc('0x9')][_0x166468['interface']]){logger[_0x9ccc('0x21')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x166468[_0x9ccc('0x2d')],_0x166468[_0x9ccc('0x18')],_0x166468[_0x9ccc('0x19')]);return RpcUser[_0x9ccc('0x4e')](this[_0x9ccc('0x9')][_0x166468['interface']],'Auto-Pause',_0x166468[_0x9ccc('0x2d')]);}}}catch(_0xcc8673){logger[_0x9ccc('0x33')](_0x9ccc('0x4f'),_0xcc8673[_0x9ccc('0x35')]);}};module['exports']=Acw; \ No newline at end of file +var _0xa85d=['agents','timers','channels','syncAgentConnect','hanguprequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','voiceQueues','ACW','mandatoryDisposition','name','mandatoryDispositionPause','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','message','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport'];(function(_0x2bb0ff,_0x22c9e2){var _0x497825=function(_0x168536){while(--_0x168536){_0x2bb0ff['push'](_0x2bb0ff['shift']());}};_0x497825(++_0x22c9e2);}(_0xa85d,0x152));var _0xda85=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0xa85d[_0x191154];return _0x3dcd73;};'use strict';var util=require(_0xda85('0x0'));var _=require('lodash');var moment=require(_0xda85('0x1'));var ami=require(_0xda85('0x2'));var logger=require('../../../config/logger')(_0xda85('0x3'));var RpcUser=require(_0xda85('0x4'));var RpcVoiceAgentReport=require(_0xda85('0x5'));function Acw(_0x3d0a4e){this['voiceQueues']=_0x3d0a4e['voiceQueues'];this[_0xda85('0x6')]=_0x3d0a4e[_0xda85('0x6')];this[_0xda85('0x7')]=_0x3d0a4e[_0xda85('0x7')];this[_0xda85('0x8')]={};ami['on']('agentconnect',this[_0xda85('0x9')]['bind'](this));ami['on'](_0xda85('0xa'),this['syncHangupRequest'][_0xda85('0xb')](this));ami['on'](_0xda85('0xc'),this[_0xda85('0xd')][_0xda85('0xb')](this));ami['on'](_0xda85('0xe'),this[_0xda85('0xf')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xda85('0xb')](this));ami['on']('blindtransfer',this[_0xda85('0x10')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0xda85('0x11')][_0xda85('0xb')](this));}function getDiff(_0x1cad19){var _0x1379d5=moment()[_0xda85('0x12')](0x0);var _0x28ec2c=moment(_0x1cad19)['milliseconds'](0x0);return _0x1379d5[_0xda85('0x13')](_0x28ec2c,_0xda85('0x14'));}Acw[_0xda85('0x15')][_0xda85('0x16')]=function(_0x383dd5){try{var _0x35d956=this;var _0xf23d57=this[_0xda85('0x8')][_0x383dd5][_0xda85('0x17')];var _0x1303a1=this[_0xda85('0x8')][_0x383dd5][_0xda85('0x18')];var _0x1713e2=this[_0xda85('0x19')][_0x1303a1];var _0x325090=![];var _0xfcbfe2=_0xda85('0x1a');if(_0x1713e2[_0xda85('0x1b')]){if(_0x1713e2['mandatoryDispositionPause'][_0xda85('0x1c')]){_0x325090=!![];_0xfcbfe2=_0x1713e2[_0xda85('0x1d')][_0xda85('0x1c')];}}ami['Action']({'action':_0xda85('0x1e'),'interface':_0xf23d57,'paused':!![],'reason':_0xfcbfe2})[_0xda85('0x1f')](function(_0x4d4a7f){if(_0x35d956[_0xda85('0x6')][_0xf23d57]){return RpcUser[_0xda85('0x20')](_0x35d956[_0xda85('0x6')][_0xf23d57]['id'])[_0xda85('0x1f')](function(_0x268c72){if(_0x268c72&&!_0x268c72[_0xda85('0x21')]){logger[_0xda85('0x22')](_0xda85('0x23'),_0x383dd5,_0xf23d57,_0x1303a1);var _0xb6161e=_0x35d956[_0xda85('0x8')][_0x383dd5][_0xda85('0x24')]&&_0x35d956[_0xda85('0x8')][_0x383dd5][_0xda85('0x25')]?_0x35d956[_0xda85('0x8')][_0x383dd5][_0xda85('0x25')]:_0x383dd5;return RpcUser[_0xda85('0x26')](_0x35d956['agents'][_0xf23d57],_0xfcbfe2,_0xb6161e)[_0xda85('0x1f')](function(_0x18a323){if(!_0x325090){_0x35d956[_0xda85('0x7')][_0xf23d57]={};logger[_0xda85('0x22')](_0xda85('0x27'),_0x383dd5,_0x35d956[_0xda85('0x19')][_0x1303a1]['acwTimeout'],_0xf23d57,_0x1303a1);_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x28')]=setTimeout(_0x35d956['stopAcw'][_0xda85('0xb')](_0x35d956,_0xf23d57),_0x35d956['voiceQueues'][_0x1303a1][_0xda85('0x29')]*0x3e8);_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x2a')]=moment()[_0xda85('0x2b')](_0xda85('0x2c'));_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x2d')]=_0x383dd5;_0x35d956['timers'][_0xf23d57][_0xda85('0x18')]=_0x1303a1;_0x35d956['timers'][_0xf23d57][_0xda85('0x2e')]=function(){var _0x5198f2=getDiff(_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x2a')]);clearTimeout(_0x35d956[_0xda85('0x7')][_0xf23d57]['timer']);_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x28')]=![];RpcVoiceAgentReport[_0xda85('0x2f')]({'acwtime':_0x5198f2},_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x2d')],_0xf23d57)[_0xda85('0x1f')](function(_0x169f24){logger[_0xda85('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x383dd5,_0x5198f2,_0x169f24);})['catch'](function(_0x1ec327){logger[_0xda85('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x383dd5,_0x1ec327);});delete _0x35d956['timers'][_0xf23d57];};}});}else{logger[_0xda85('0x22')](_0xda85('0x31'),_0x383dd5,_0xf23d57,_0x1303a1);}});}})[_0xda85('0x32')](function(_0x24adcd){logger[_0xda85('0x30')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x383dd5,_0x35d956['voiceQueues'][_0x1303a1][_0xda85('0x29')],_0xf23d57,_0x1303a1);})[_0xda85('0x33')](function(){delete _0x35d956[_0xda85('0x8')][_0x383dd5];});}catch(_0x3b1c2d){logger[_0xda85('0x30')]('[ACW][START]\x20%s',_0x3b1c2d[_0xda85('0x34')]);}};Acw['prototype']['stopAcw']=function(_0x4e6f91){try{var _0x3e046f=this;if(_0x3e046f['timers'][_0x4e6f91]){_0x3e046f['timers'][_0x4e6f91]['timer']=![];var _0x579635=_0x3e046f['timers'][_0x4e6f91][_0xda85('0x2d')];var _0x5a1d0e=_0x3e046f[_0xda85('0x7')][_0x4e6f91]['queue'];var _0x2332e9=_0x3e046f[_0xda85('0x19')][_0x5a1d0e][_0xda85('0x29')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x579635,_0x4e6f91);RpcUser[_0xda85('0x35')](this[_0xda85('0x6')][_0x4e6f91]);RpcVoiceAgentReport[_0xda85('0x2f')]({'acwtime':_0x2332e9,'agentacw':!![]},_0x579635,_0x4e6f91)[_0xda85('0x1f')](function(_0x4a36b2){logger[_0xda85('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x579635,_0x2332e9,_0x4a36b2);})[_0xda85('0x32')](function(_0x356b27){logger[_0xda85('0x30')](_0xda85('0x36'),_0x579635,_0x356b27);});}else{logger[_0xda85('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x4e6f91);if(_0x3e046f[_0xda85('0x7')]){logger[_0xda85('0x22')](_0xda85('0x37'),JSON[_0xda85('0x38')](_0x3e046f[_0xda85('0x7')]));}}}catch(_0x5936c3){logger[_0xda85('0x30')](_0xda85('0x39'),_0x5936c3['message']);}};Acw[_0xda85('0x15')][_0xda85('0x9')]=function(_0x457c06){try{if(this[_0xda85('0x19')][_0x457c06[_0xda85('0x18')]]&&(this[_0xda85('0x19')][_0x457c06[_0xda85('0x18')]][_0xda85('0x3')]||this[_0xda85('0x19')][_0x457c06['queue']][_0xda85('0x1b')])){if(this[_0xda85('0x6')][_0x457c06['interface']]){this[_0xda85('0x8')][_0x457c06[_0xda85('0x2d')]]={'queue':_0x457c06[_0xda85('0x18')],'interface':_0x457c06[_0xda85('0x17')],'destlinkedid':_0x457c06['destlinkedid']};}}}catch(_0x2fa4e8){logger[_0xda85('0x30')](_0xda85('0x3a'),_0x2fa4e8[_0xda85('0x34')]);}};Acw[_0xda85('0x15')][_0xda85('0x11')]=function(_0x58b35f){try{if(this[_0xda85('0x19')][_0x58b35f['queue']]&&(this[_0xda85('0x19')][_0x58b35f[_0xda85('0x18')]][_0xda85('0x3')]||this['voiceQueues'][_0x58b35f['queue']][_0xda85('0x1b')])){if(this[_0xda85('0x6')][_0x58b35f[_0xda85('0x17')]]){this['channels'][_0x58b35f[_0xda85('0x2d')]]={'queue':_0x58b35f['queue'],'interface':_0x58b35f[_0xda85('0x17')]};}}}catch(_0x1263d2){logger[_0xda85('0x30')](_0xda85('0x3b'),_0x1263d2[_0xda85('0x34')]);}};Acw['prototype'][_0xda85('0x3c')]=function(_0x12766a){try{if(this[_0xda85('0x8')][_0x12766a[_0xda85('0x2d')]]&&_[_0xda85('0x3d')](this[_0xda85('0x8')][_0x12766a[_0xda85('0x2d')]][_0xda85('0x24')])){logger[_0xda85('0x22')](_0xda85('0x3e'),_0x12766a[_0xda85('0x2d')]);this['startAcw'](_0x12766a[_0xda85('0x2d')]);}else if(this[_0xda85('0x8')][_0x12766a['linkedid']]&&_['isUndefined'](this[_0xda85('0x8')][_0x12766a['linkedid']][_0xda85('0x24')])){logger[_0xda85('0x22')](_0xda85('0x3f'),_0x12766a[_0xda85('0x40')]);this[_0xda85('0x16')](_0x12766a['linkedid']);}}catch(_0x4d59bc){logger['error'](_0xda85('0x41'),_0x4d59bc[_0xda85('0x34')]);}};Acw[_0xda85('0x15')][_0xda85('0xd')]=function(_0x32e289){try{if(this['channels'][_0x32e289[_0xda85('0x2d')]]&&this['channels'][_0x32e289[_0xda85('0x2d')]][_0xda85('0x24')]){logger[_0xda85('0x22')](_0xda85('0x42'),_0x32e289['uniqueid']);this[_0xda85('0x16')](_0x32e289[_0xda85('0x2d')]);}else if(this[_0xda85('0x8')][_0x32e289[_0xda85('0x40')]]&&this[_0xda85('0x8')][_0x32e289['linkedid']][_0xda85('0x24')]){logger[_0xda85('0x22')](_0xda85('0x43'),_0x32e289[_0xda85('0x40')]);this['startAcw'](_0x32e289[_0xda85('0x40')]);}}catch(_0x2f297b){logger['error'](_0xda85('0x44'),_0x2f297b[_0xda85('0x34')]);}};Acw[_0xda85('0x15')][_0xda85('0x45')]=function(_0x2e2cc8){try{if(!_[_0xda85('0x46')](this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x47')]])){this[_0xda85('0x16')](_0x2e2cc8[_0xda85('0x47')]);if(this[_0xda85('0x8')][_0x2e2cc8['secondtransfereruniqueid']]){this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x48')]][_0xda85('0x24')]=!![];this[_0xda85('0x8')][_0x2e2cc8['transfertargetuniqueid']]=this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x48')]];delete this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x48')]];}}else if(!_[_0xda85('0x46')](this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x49')]])){this[_0xda85('0x16')](_0x2e2cc8[_0xda85('0x49')]);if(this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x4a')]]){this['channels'][_0x2e2cc8[_0xda85('0x4a')]][_0xda85('0x24')]=!![];this['channels'][_0x2e2cc8[_0xda85('0x47')]]=this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x4a')]];delete this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x4a')]];}}}catch(_0x520597){logger[_0xda85('0x30')]('[ACW][syncAttendedTransfer]\x20%s',_0x520597['message']);}};Acw[_0xda85('0x15')][_0xda85('0x10')]=function(_0x43afa5){try{if(this[_0xda85('0x8')][_0x43afa5[_0xda85('0x4b')]]){logger[_0xda85('0x22')](_0xda85('0x4c'),JSON[_0xda85('0x38')](_0x43afa5[_0xda85('0x4b')]));this[_0xda85('0x16')](_0x43afa5['transfereruniqueid']);}else if(this['channels'][_0x43afa5[_0xda85('0x4d')]]){logger[_0xda85('0x22')](_0xda85('0x4e'),JSON[_0xda85('0x38')](_0x43afa5[_0xda85('0x4d')]));this[_0xda85('0x16')](_0x43afa5[_0xda85('0x4d')]);}}catch(_0x269d75){logger[_0xda85('0x30')](_0xda85('0x4f'),_0x269d75[_0xda85('0x34')]);}};Acw[_0xda85('0x15')]['syncAgentRingNoAnswer']=function(_0x49cb75){try{if(this['voiceQueues'][_0x49cb75[_0xda85('0x18')]]&&this['voiceQueues'][_0x49cb75['queue']][_0xda85('0x50')]===_0xda85('0x51')){if(this['agents'][_0x49cb75['interface']]){logger[_0xda85('0x22')](_0xda85('0x52'),_0x49cb75[_0xda85('0x2d')],_0x49cb75[_0xda85('0x17')],_0x49cb75[_0xda85('0x18')]);return RpcUser[_0xda85('0x26')](this[_0xda85('0x6')][_0x49cb75[_0xda85('0x17')]],_0xda85('0x53'),_0x49cb75[_0xda85('0x2d')]);}}}catch(_0x1962cc){logger['error'](_0xda85('0x54'),_0x1962cc[_0xda85('0x34')]);}};module[_0xda85('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index ffcc183..e8f7ea2 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 _0x815e=['coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionSipShowRegistry','actionSipPeerStatus','catch','log','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','queuesummary','actionCoreShowChannels'];(function(_0x45ee52,_0x28c470){var _0xd4fdd2=function(_0x4f99d){while(--_0x4f99d){_0x45ee52['push'](_0x45ee52['shift']());}};_0xd4fdd2(++_0x28c470);}(_0x815e,0x7e));var _0xe815=function(_0x5611e5,_0x45495e){_0x5611e5=_0x5611e5-0x0;var _0x202aa6=_0x815e[_0x5611e5];return _0x202aa6;};'use strict';var Manager=require(_0xe815('0x0'));var BPromise=require(_0xe815('0x1'));var moment=require(_0xe815('0x2'));var util=require(_0xe815('0x3'));var _=require(_0xe815('0x4'));var logger=require(_0xe815('0x5'))('ami');var config=require(_0xe815('0x6'));var ami=new Manager(config[_0xe815('0x7')][_0xe815('0x8')],config[_0xe815('0x7')]['ip'],config[_0xe815('0x7')][_0xe815('0x9')],config[_0xe815('0x7')]['password'],!![]);ami[_0xe815('0xa')]();ami[_0xe815('0xb')]=BPromise[_0xe815('0xc')](ami['action']);function error(_0x27a572){logger['error'](util[_0xe815('0xd')](_0xe815('0xe'),config[_0xe815('0x7')][_0xe815('0x9')],config[_0xe815('0x7')]['ip'],config[_0xe815('0x7')][_0xe815('0x8')],util['inspect'](_0x27a572,![],null)));}function close(){logger[_0xe815('0xf')](util[_0xe815('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe815('0x7')][_0xe815('0x9')],config['asterisk']['ip'],config['asterisk'][_0xe815('0x8')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe815('0xb')]({'action':_0xe815('0x10')});};};ami[_0xe815('0x11')]=function(){return function(){return ami[_0xe815('0xb')]({'action':_0xe815('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0xe815('0x13')]=function(){return function(){return ami[_0xe815('0xb')]({'action':_0xe815('0x14')});};};ami[_0xe815('0x15')]=function(){return function(){return ami['Action']({'action':_0xe815('0x16')});};};function connect(_0x5aa687){logger[_0xe815('0x17')](util[_0xe815('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xe815('0x7')][_0xe815('0x9')],config['asterisk']['ip'],config[_0xe815('0x7')][_0xe815('0x8')]));ami['once'](_0xe815('0xf'),error);ami[_0xe815('0x18')](_0xe815('0x19'),close);}ami['on'](_0xe815('0x1a'),connect);ami['on'](_0xe815('0x1b'),function(_0x132aa7){logger[_0xe815('0x17')](util[_0xe815('0xd')](_0xe815('0x1c'),config[_0xe815('0x7')][_0xe815('0x9')],config['asterisk']['ip'],config[_0xe815('0x7')][_0xe815('0x8')],util[_0xe815('0x1d')](_0x132aa7,![],null)));});ami['on'](_0xe815('0x1e'),function(_0x3a7121){logger['info'](util[_0xe815('0xd')](_0xe815('0x1f'),config[_0xe815('0x7')][_0xe815('0x9')],config[_0xe815('0x7')]['ip'],config[_0xe815('0x7')]['port']));return BPromise['resolve']()[_0xe815('0x20')](ami[_0xe815('0x21')]())[_0xe815('0x20')](ami[_0xe815('0x11')]())['then'](ami[_0xe815('0x22')]())[_0xe815('0x20')](ami[_0xe815('0x13')]())[_0xe815('0x20')](ami['actionCoreShowChannels']())[_0xe815('0x23')](function(_0x2f5e31){console[_0xe815('0x24')](_0x2f5e31);});});ami[_0xe815('0x18')](_0xe815('0xf'),error);ami[_0xe815('0x18')](_0xe815('0x19'),close);module['exports']=ami; \ No newline at end of file +var _0x75a8=['password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','username','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','log','exports','asterisk-manager','util','lodash','../../config/logger','ami','asterisk','port'];(function(_0x4e3f12,_0x60aded){var _0x2f7b03=function(_0xc625d0){while(--_0xc625d0){_0x4e3f12['push'](_0x4e3f12['shift']());}};_0x2f7b03(++_0x60aded);}(_0x75a8,0xfc));var _0x875a=function(_0x4a1456,_0x401436){_0x4a1456=_0x4a1456-0x0;var _0x33f119=_0x75a8[_0x4a1456];return _0x33f119;};'use strict';var Manager=require(_0x875a('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require(_0x875a('0x1'));var _=require(_0x875a('0x2'));var logger=require(_0x875a('0x3'))(_0x875a('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x875a('0x5')][_0x875a('0x6')],config[_0x875a('0x5')]['ip'],config['asterisk']['username'],config[_0x875a('0x5')][_0x875a('0x7')],!![]);ami['keepConnected']();ami[_0x875a('0x8')]=BPromise[_0x875a('0x9')](ami[_0x875a('0xa')]);function error(_0x27d123){logger[_0x875a('0xb')](util[_0x875a('0xc')](_0x875a('0xd'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x875a('0x5')][_0x875a('0x6')],util['inspect'](_0x27d123,![],null)));}function close(){logger[_0x875a('0xb')](util['format'](_0x875a('0xe'),config[_0x875a('0x5')]['username'],config[_0x875a('0x5')]['ip'],config[_0x875a('0x5')][_0x875a('0x6')]));}ami[_0x875a('0xf')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0x875a('0x10')]=function(){return function(){return ami['Action']({'action':_0x875a('0x11')});};};ami[_0x875a('0x12')]=function(){return function(){return ami[_0x875a('0x8')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x875a('0x8')]({'action':_0x875a('0x13')});};};ami[_0x875a('0x14')]=function(){return function(){return ami['Action']({'action':_0x875a('0x15')});};};function connect(_0x363f42){logger[_0x875a('0x16')](util[_0x875a('0xc')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x875a('0x5')]['username'],config['asterisk']['ip'],config[_0x875a('0x5')][_0x875a('0x6')]));ami['once'](_0x875a('0xb'),error);ami[_0x875a('0x17')](_0x875a('0x18'),close);}ami['on'](_0x875a('0x19'),connect);ami['on'](_0x875a('0x1a'),function(_0x1d2333){logger['info'](util['format'](_0x875a('0x1b'),config['asterisk'][_0x875a('0x1c')],config['asterisk']['ip'],config['asterisk'][_0x875a('0x6')],util['inspect'](_0x1d2333,![],null)));});ami['on'](_0x875a('0x1d'),function(_0x544729){logger[_0x875a('0x16')](util[_0x875a('0xc')](_0x875a('0x1e'),config[_0x875a('0x5')]['username'],config[_0x875a('0x5')]['ip'],config[_0x875a('0x5')][_0x875a('0x6')]));return BPromise[_0x875a('0x1f')]()['then'](ami['actionSipShowRegistry']())[_0x875a('0x20')](ami[_0x875a('0x10')]())['then'](ami[_0x875a('0x12')]())['then'](ami[_0x875a('0x21')]())['then'](ami['actionCoreShowChannels']())[_0x875a('0x22')](function(_0x28a307){console[_0x875a('0x23')](_0x28a307);});});ami[_0x875a('0x17')](_0x875a('0xb'),error);ami[_0x875a('0x17')](_0x875a('0x18'),close);module[_0x875a('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index fd65169..a4d51a2 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 _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x4d3a9b,_0x20b47d){var _0x1b5471=function(_0x51bf57){while(--_0x51bf57){_0x4d3a9b['push'](_0x4d3a9b['shift']());}};_0x1b5471(++_0x20b47d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5b2f84,_0x55ff7f){_0x5b2f84=_0x5b2f84-0x0;var _0x51e12c=_0x9bde[_0x5b2f84];return _0x51e12c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x28a1e4,_0x36b53c){var _0x1c1cca=function(_0x576f1e){while(--_0x576f1e){_0x28a1e4['push'](_0x28a1e4['shift']());}};_0x1c1cca(++_0x36b53c);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1a5ad1,_0x357407){_0x1a5ad1=_0x1a5ad1-0x0;var _0x7b8b22=_0xbdb7[_0x1a5ad1];return _0x7b8b22;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 5b3f554..66f1b14 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9420=['number','dialCutDigit','exports','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>'];(function(_0x251887,_0x291ef6){var _0x5cf278=function(_0x2cd082){while(--_0x2cd082){_0x251887['push'](_0x251887['shift']());}};_0x5cf278(++_0x291ef6);}(_0x9420,0x1dc));var _0x0942=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x9420[_0x257642];return _0x3d813b;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0942('0x0'));function checkNameSurname(_0x42a2cf,_0x526911,_0x16c51a){var _0xc5767c='';if(!_[_0x0942('0x1')](_0x526911)&&_0x0942('0x2')===typeof _0x526911){_0xc5767c+=_0x526911;}if(!_['isNil'](_0x16c51a)&&_0x0942('0x2')===typeof _0x16c51a){_0xc5767c+='\x20'+_0x16c51a;}if(_0xc5767c!==''){return _0xc5767c;}return _0x42a2cf;}function Action(_0x1698f2,_0x3a22b2,_0x106ca5){this[_0x0942('0x3')]=_0x1698f2;this[_0x0942('0x4')]=_0x106ca5||undefined;this[_0x0942('0x5')]=checkNameSurname(_0x3a22b2[_0x0942('0x6')][_0x0942('0x7')],_0x3a22b2[_0x0942('0x6')][_0x0942('0x8')],_0x3a22b2['Contact']['lastName']);this['number']=_0x3a22b2['Contact'][_0x0942('0x7')];this[_0x0942('0x9')]=_0x1698f2['name'];this['active']=_0x3a22b2[_0x0942('0xa')]||![];this[_0x0942('0xb')]=_0x1698f2[_0x0942('0xb')];this[_0x0942('0xc')]=_0x1698f2[_0x0942('0xc')]||0x3;this[_0x0942('0xd')]=_0x3a22b2['scheduledat'];this[_0x0942('0xe')]=_0x3a22b2[_0x0942('0xe')];this[_0x0942('0xf')]=_0x3a22b2[_0x0942('0xf')];this['countnoanswerretry']=_0x3a22b2[_0x0942('0x10')];this[_0x0942('0x11')]=_0x3a22b2[_0x0942('0x11')];this[_0x0942('0x12')]=_0x3a22b2[_0x0942('0x12')];this[_0x0942('0x13')]=_0x3a22b2[_0x0942('0x13')];this['countmachineretry']=_0x3a22b2[_0x0942('0x14')];this[_0x0942('0x15')]=_0x3a22b2[_0x0942('0x15')];this[_0x0942('0x16')]=_0x3a22b2['ContactId'];this[_0x0942('0x17')]=_0x3a22b2[_0x0942('0x17')];this[_0x0942('0x18')]=_0x3a22b2[_0x0942('0x18')];this[_0x0942('0x19')]=_0x3a22b2[_0x0942('0x19')];this[_0x0942('0x1a')]=_0x3a22b2[_0x0942('0x1a')];this['idHopper']=_0x3a22b2['id'];this[_0x0942('0x1b')]=_0x3a22b2[_0x0942('0x6')][_0x0942('0x8')]||'';this[_0x0942('0x1c')]=moment()[_0x0942('0x1d')](_0x0942('0x1e'));this[_0x0942('0x1f')]=_0x3a22b2[_0x0942('0x1f')];this['callbackuniqueid']=_0x3a22b2[_0x0942('0x20')];this[_0x0942('0x21')]=_0x3a22b2[_0x0942('0x21')];this[_0x0942('0x22')]=_0x3a22b2[_0x0942('0x22')];this[_0x0942('0x23')]='';this[_0x0942('0x24')]='';}Action[_0x0942('0x25')][_0x0942('0x26')]=function(){return util[_0x0942('0x1d')](_0x0942('0x27'),this[_0x0942('0x5')],this[_0x0942('0x3')]['dialCutDigit']>0x0?this[_0x0942('0x28')]['substring'](this['voiceQueue'][_0x0942('0x29')]):this[_0x0942('0x28')]);};Action[_0x0942('0x25')]['getQueue']=function(){return this['queue'];};module[_0x0942('0x2a')]=Action; \ No newline at end of file +var _0xbade=['voiceQueue','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype'];(function(_0x5c43e1,_0x4c1705){var _0x397fa7=function(_0x4485e8){while(--_0x4485e8){_0x5c43e1['push'](_0x5c43e1['shift']());}};_0x397fa7(++_0x4c1705);}(_0xbade,0x88));var _0xebad=function(_0x2bb66c,_0x36c6c6){_0x2bb66c=_0x2bb66c-0x0;var _0x1e0f98=_0xbade[_0x2bb66c];return _0x1e0f98;};'use strict';var util=require(_0xebad('0x0'));var _=require(_0xebad('0x1'));var moment=require(_0xebad('0x2'));function checkNameSurname(_0x3f6a16,_0x2bbe2a,_0x40ac13){var _0x354158='';if(!_[_0xebad('0x3')](_0x2bbe2a)&&_0xebad('0x4')===typeof _0x2bbe2a){_0x354158+=_0x2bbe2a;}if(!_[_0xebad('0x3')](_0x40ac13)&&_0xebad('0x4')===typeof _0x40ac13){_0x354158+='\x20'+_0x40ac13;}if(_0x354158!==''){return _0x354158;}return _0x3f6a16;}function Action(_0xb6c903,_0x5c9d9d,_0x27bc88){this['voiceQueue']=_0xb6c903;this[_0xebad('0x5')]=_0x27bc88||undefined;this[_0xebad('0x6')]=checkNameSurname(_0x5c9d9d[_0xebad('0x7')][_0xebad('0x8')],_0x5c9d9d[_0xebad('0x7')]['firstName'],_0x5c9d9d[_0xebad('0x7')][_0xebad('0x9')]);this[_0xebad('0xa')]=_0x5c9d9d[_0xebad('0x7')][_0xebad('0x8')];this[_0xebad('0xb')]=_0xb6c903[_0xebad('0x6')];this[_0xebad('0xc')]=_0x5c9d9d[_0xebad('0xc')]||![];this[_0xebad('0xd')]=_0xb6c903['type'];this[_0xebad('0xe')]=_0xb6c903[_0xebad('0xe')]||0x3;this[_0xebad('0xf')]=_0x5c9d9d[_0xebad('0xf')];this['countbusyretry']=_0x5c9d9d[_0xebad('0x10')];this[_0xebad('0x11')]=_0x5c9d9d['countcongestionretry'];this[_0xebad('0x12')]=_0x5c9d9d[_0xebad('0x12')];this[_0xebad('0x13')]=_0x5c9d9d[_0xebad('0x13')];this[_0xebad('0x14')]=_0x5c9d9d[_0xebad('0x14')];this[_0xebad('0x15')]=_0x5c9d9d[_0xebad('0x15')];this[_0xebad('0x16')]=_0x5c9d9d['countmachineretry'];this[_0xebad('0x17')]=_0x5c9d9d[_0xebad('0x17')];this['ContactId']=_0x5c9d9d[_0xebad('0x18')];this[_0xebad('0x19')]=_0x5c9d9d[_0xebad('0x19')];this['UserId']=_0x5c9d9d[_0xebad('0x1a')];this[_0xebad('0x1b')]=_0x5c9d9d['VoiceQueueId'];this[_0xebad('0x1c')]=_0x5c9d9d[_0xebad('0x1c')];this[_0xebad('0x1d')]=_0x5c9d9d['id'];this[_0xebad('0x1e')]=_0x5c9d9d[_0xebad('0x7')][_0xebad('0x1f')]||'';this[_0xebad('0x20')]=moment()[_0xebad('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x5c9d9d[_0xebad('0x22')];this[_0xebad('0x23')]=_0x5c9d9d[_0xebad('0x23')];this['callbackat']=_0x5c9d9d[_0xebad('0x24')];this['recallme']=_0x5c9d9d[_0xebad('0x25')];this[_0xebad('0x26')]='';this['originatecalleridname']='';}Action[_0xebad('0x27')]['getCaller']=function(){return util[_0xebad('0x21')]('\x22%s\x22\x20<%s>',this[_0xebad('0x6')],this[_0xebad('0x28')][_0xebad('0x29')]>0x0?this[_0xebad('0xa')]['substring'](this[_0xebad('0x28')][_0xebad('0x29')]):this[_0xebad('0xa')]);};Action[_0xebad('0x27')][_0xebad('0x2a')]=function(){return this[_0xebad('0xb')];};module[_0xebad('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index eb65e89..791c1cb 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bbf=['diff','seconds','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment'];(function(_0x1c6d4f,_0x37e880){var _0x2598af=function(_0x4e9104){while(--_0x4e9104){_0x1c6d4f['push'](_0x1c6d4f['shift']());}};_0x2598af(++_0x37e880);}(_0x9bbf,0x15d));var _0xf9bb=function(_0x4f14ac,_0x44126a){_0x4f14ac=_0x4f14ac-0x0;var _0x544cec=_0x9bbf[_0x4f14ac];return _0x544cec;};'use strict';var util=require(_0xf9bb('0x0'));var _=require(_0xf9bb('0x1'));var moment=require(_0xf9bb('0x2'));function getSeconds(_0x24a686,_0x4b0927){var _0x216620=moment(_0x24a686)['milliseconds'](0x0);var _0x870b88=moment(_0x4b0927)['milliseconds'](0x0);return _0x216620[_0xf9bb('0x3')](_0x870b88,_0xf9bb('0x4'));}function AgentComplete(_0x7ca62d,_0x1a30ee){this['state']=0x4;this[_0xf9bb('0x5')]='Answer';this[_0xf9bb('0x6')]=_0x7ca62d[_0xf9bb('0x6')];this[_0xf9bb('0x7')]=_0x7ca62d[_0xf9bb('0x7')];this[_0xf9bb('0x8')]=_0x7ca62d[_0xf9bb('0x7')]===_0xf9bb('0x9')?_0xf9bb('0xa'):_0x7ca62d['type'];this[_0xf9bb('0xb')]=_0x7ca62d[_0xf9bb('0xb')];this[_0xf9bb('0xc')]=_0x7ca62d['countcongestionretry'];this[_0xf9bb('0xd')]=_0x7ca62d[_0xf9bb('0xd')];this['countglobal']=_0x7ca62d[_0xf9bb('0xb')]+_0x7ca62d['countcongestionretry']+_0x7ca62d['countnoanswerretry']+_0x7ca62d[_0xf9bb('0xe')]+_0x7ca62d['countdropretry']+_0x7ca62d[_0xf9bb('0xf')]+_0x7ca62d[_0xf9bb('0x10')]+_0x7ca62d[_0xf9bb('0x11')];this[_0xf9bb('0xe')]=_0x7ca62d[_0xf9bb('0xe')];this[_0xf9bb('0x12')]=_0x7ca62d[_0xf9bb('0x12')];this[_0xf9bb('0xf')]=_0x7ca62d[_0xf9bb('0xf')];this[_0xf9bb('0x10')]=_0x7ca62d[_0xf9bb('0x10')];this['countagentrejectretry']=_0x7ca62d[_0xf9bb('0x11')];this[_0xf9bb('0x13')]=_0x1a30ee[_0xf9bb('0x13')];this[_0xf9bb('0x14')]=_0x7ca62d[_0xf9bb('0x15')];this[_0xf9bb('0x16')]=_0x7ca62d['number'];this[_0xf9bb('0x17')]=_0x7ca62d[_0xf9bb('0x17')];this[_0xf9bb('0x18')]=_0x7ca62d[_0xf9bb('0x18')];this[_0xf9bb('0x19')]=_0x7ca62d[_0xf9bb('0x19')];this['endtime']=moment()['format'](_0xf9bb('0x1a'));this[_0xf9bb('0x1b')]=getSeconds(_0x7ca62d[_0xf9bb('0x18')],_0x7ca62d[_0xf9bb('0x17')]);this[_0xf9bb('0x1c')]=getSeconds(_0x7ca62d['answertime'],_0x7ca62d[_0xf9bb('0x18')]);this[_0xf9bb('0x1d')]=getSeconds(this[_0xf9bb('0x1e')],_0x7ca62d[_0xf9bb('0x19')]);this[_0xf9bb('0xa')]=_0x1a30ee[_0xf9bb('0xa')];this[_0xf9bb('0x1f')]=_0x1a30ee[_0xf9bb('0x1f')];this[_0xf9bb('0x20')]=_0x1a30ee[_0xf9bb('0x20')];this[_0xf9bb('0x21')]=_0x7ca62d['callback'];this[_0xf9bb('0x22')]=_0x7ca62d[_0xf9bb('0x22')];this[_0xf9bb('0x23')]=_0x7ca62d[_0xf9bb('0x23')];this[_0xf9bb('0x24')]=_0x7ca62d['recallme'];this[_0xf9bb('0x25')]=_0x7ca62d[_0xf9bb('0x25')];this[_0xf9bb('0x26')]=_0x7ca62d[_0xf9bb('0x26')];this[_0xf9bb('0x27')]=_0x7ca62d[_0xf9bb('0x27')];this[_0xf9bb('0x28')]=_0x7ca62d[_0xf9bb('0x28')];this['CampaignId']=_0x7ca62d[_0xf9bb('0x29')];this[_0xf9bb('0x2a')]=_0x7ca62d[_0xf9bb('0x2a')]||'';this['originatecalleridname']=_0x7ca62d['originatecalleridname']||'';}module[_0xf9bb('0x2b')]=AgentComplete; \ No newline at end of file +var _0x654f=['calleridnum','starttime','responsetime','answertime','endtime','format','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name'];(function(_0x1be6fe,_0x108331){var _0x146a5b=function(_0x3f433a){while(--_0x3f433a){_0x1be6fe['push'](_0x1be6fe['shift']());}};_0x146a5b(++_0x108331);}(_0x654f,0x16d));var _0xf654=function(_0x436ee7,_0xb176c1){_0x436ee7=_0x436ee7-0x0;var _0x38f88e=_0x654f[_0x436ee7];return _0x38f88e;};'use strict';var util=require('util');var _=require(_0xf654('0x0'));var moment=require(_0xf654('0x1'));function getSeconds(_0x2021dd,_0x178009){var _0xed491f=moment(_0x2021dd)[_0xf654('0x2')](0x0);var _0x4bb3b6=moment(_0x178009)[_0xf654('0x2')](0x0);return _0xed491f[_0xf654('0x3')](_0x4bb3b6,'seconds');}function AgentComplete(_0x16fa31,_0x3fb143){this[_0xf654('0x4')]=0x4;this[_0xf654('0x5')]=_0xf654('0x6');this[_0xf654('0x7')]=_0x16fa31[_0xf654('0x7')];this['type']=_0x16fa31[_0xf654('0x8')];this[_0xf654('0x9')]=_0x16fa31[_0xf654('0x8')]===_0xf654('0xa')?_0xf654('0xb'):_0x16fa31[_0xf654('0x8')];this[_0xf654('0xc')]=_0x16fa31[_0xf654('0xc')];this[_0xf654('0xd')]=_0x16fa31[_0xf654('0xd')];this['countnoanswerretry']=_0x16fa31[_0xf654('0xe')];this['countglobal']=_0x16fa31[_0xf654('0xc')]+_0x16fa31[_0xf654('0xd')]+_0x16fa31['countnoanswerretry']+_0x16fa31[_0xf654('0xf')]+_0x16fa31[_0xf654('0x10')]+_0x16fa31[_0xf654('0x11')]+_0x16fa31[_0xf654('0x12')]+_0x16fa31['countagentrejectretry'];this[_0xf654('0xf')]=_0x16fa31['countnosuchnumberretry'];this[_0xf654('0x10')]=_0x16fa31[_0xf654('0x10')];this[_0xf654('0x11')]=_0x16fa31[_0xf654('0x11')];this[_0xf654('0x12')]=_0x16fa31['countmachineretry'];this[_0xf654('0x13')]=_0x16fa31['countagentrejectretry'];this[_0xf654('0x14')]=_0x3fb143[_0xf654('0x14')];this['calleridname']=_0x16fa31[_0xf654('0x15')];this[_0xf654('0x16')]=_0x16fa31['number'];this[_0xf654('0x17')]=_0x16fa31[_0xf654('0x17')];this['responsetime']=_0x16fa31[_0xf654('0x18')];this['answertime']=_0x16fa31[_0xf654('0x19')];this[_0xf654('0x1a')]=moment()[_0xf654('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x16fa31['responsetime'],_0x16fa31[_0xf654('0x17')]);this[_0xf654('0x1c')]=getSeconds(_0x16fa31[_0xf654('0x19')],_0x16fa31[_0xf654('0x18')]);this[_0xf654('0x1d')]=getSeconds(this[_0xf654('0x1a')],_0x16fa31[_0xf654('0x19')]);this[_0xf654('0xb')]=_0x3fb143[_0xf654('0xb')];this[_0xf654('0x1e')]=_0x3fb143[_0xf654('0x1e')];this['reason']=_0x3fb143['reason'];this['callback']=_0x16fa31[_0xf654('0x1f')];this['callbackuniqueid']=_0x16fa31[_0xf654('0x20')];this[_0xf654('0x21')]=_0x16fa31['callbackat'];this[_0xf654('0x22')]=_0x16fa31[_0xf654('0x22')];this[_0xf654('0x23')]=_0x16fa31['ContactId'];this[_0xf654('0x24')]=_0x16fa31[_0xf654('0x24')];this[_0xf654('0x25')]=_0x16fa31[_0xf654('0x25')];this[_0xf654('0x26')]=_0x16fa31[_0xf654('0x26')];this[_0xf654('0x27')]=_0x16fa31[_0xf654('0x27')];this[_0xf654('0x28')]=_0x16fa31[_0xf654('0x28')]||'';this[_0xf654('0x29')]=_0x16fa31['originatecalleridname']||'';}module[_0xf654('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index f4ade1d..2bcc893 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84e7=['scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid'];(function(_0x52064a,_0x13d634){var _0x2ceef4=function(_0x5c37c0){while(--_0x5c37c0){_0x52064a['push'](_0x52064a['shift']());}};_0x2ceef4(++_0x13d634);}(_0x84e7,0x122));var _0x784e=function(_0xf07fce,_0x10757c){_0xf07fce=_0xf07fce-0x0;var _0x31f124=_0x84e7[_0xf07fce];return _0x31f124;};'use strict';var util=require('util');var _=require(_0x784e('0x0'));var moment=require(_0x784e('0x1'));function getSeconds(_0x5861e2,_0x3548d2){var _0x2c1d96=moment(_0x5861e2)['milliseconds'](0x0);var _0x45e3ad=moment(_0x3548d2)[_0x784e('0x2')](0x0);return _0x2c1d96[_0x784e('0x3')](_0x45e3ad,_0x784e('0x4'));}function Final(_0x42993b){this[_0x784e('0x5')]=_0x42993b['uniqueid'];this[_0x784e('0x6')]=_0x42993b['scheduledat'];this[_0x784e('0x7')]=_0x42993b[_0x784e('0x7')];this['campaigntype']=_0x42993b[_0x784e('0x7')]===_0x784e('0x8')?_0x784e('0x9'):_0x42993b[_0x784e('0x7')];this['countbusyretry']=_0x42993b['countbusyretry'];this[_0x784e('0xa')]=_0x42993b[_0x784e('0xa')];this[_0x784e('0xb')]=_0x42993b[_0x784e('0xb')];this['countglobal']=_0x42993b[_0x784e('0xc')]+_0x42993b[_0x784e('0xa')]+_0x42993b[_0x784e('0xb')]+_0x42993b[_0x784e('0xd')]+_0x42993b[_0x784e('0xe')]+_0x42993b[_0x784e('0xf')]+_0x42993b['countmachineretry']+_0x42993b[_0x784e('0x10')];this['countnosuchnumberretry']=_0x42993b[_0x784e('0xd')];this[_0x784e('0xe')]=_0x42993b[_0x784e('0xe')];this[_0x784e('0xf')]=_0x42993b[_0x784e('0xf')];this[_0x784e('0x11')]=_0x42993b[_0x784e('0x11')];this[_0x784e('0x10')]=_0x42993b[_0x784e('0x10')];this['queue']=_0x42993b['queue'];this[_0x784e('0x12')]=_0x42993b[_0x784e('0x12')];this[_0x784e('0x13')]=_0x42993b[_0x784e('0x13')];this[_0x784e('0x14')]=_0x42993b[_0x784e('0x14')];this[_0x784e('0x15')]=_0x42993b['responsetime'];this[_0x784e('0x16')]=_0x42993b[_0x784e('0x15')];this[_0x784e('0x17')]=_0x42993b[_0x784e('0x17')]||0x0;this[_0x784e('0x18')]=_0x42993b[_0x784e('0x18')]||0x0;this[_0x784e('0x19')]=_0x42993b['talktime']||0x0;this['callback']=_0x42993b[_0x784e('0x1a')];this['callbackuniqueid']=_0x42993b[_0x784e('0x1b')];this[_0x784e('0x1c')]=_0x42993b['callbackat'];this['recallme']=_0x42993b[_0x784e('0x1d')];this[_0x784e('0x1e')]=_0x42993b[_0x784e('0x1e')];this[_0x784e('0x1f')]=_0x42993b['ListId'];this['UserId']=_0x42993b['UserId'];this[_0x784e('0x20')]=_0x42993b[_0x784e('0x20')];this['CampaignId']=_0x42993b[_0x784e('0x21')];this['originatecalleridnum']=_0x42993b[_0x784e('0x22')]||'';this['originatecalleridname']=_0x42993b[_0x784e('0x23')]||'';}module[_0x784e('0x24')]=Final; \ No newline at end of file +var _0x3c17=['countglobal','countnoanswerretry','countdropretry','countmachineretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry'];(function(_0xe002df,_0x3ec72c){var _0x238399=function(_0x382fa7){while(--_0x382fa7){_0xe002df['push'](_0xe002df['shift']());}};_0x238399(++_0x3ec72c);}(_0x3c17,0x1a1));var _0x73c1=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x3c17[_0x40bffc];return _0x3007e9;};'use strict';var util=require(_0x73c1('0x0'));var _=require('lodash');var moment=require(_0x73c1('0x1'));function getSeconds(_0x58a810,_0x1a088c){var _0x19c8cc=moment(_0x58a810)[_0x73c1('0x2')](0x0);var _0x4cd427=moment(_0x1a088c)[_0x73c1('0x2')](0x0);return _0x19c8cc[_0x73c1('0x3')](_0x4cd427,_0x73c1('0x4'));}function Final(_0x64f862){this['uniqueid']=_0x64f862[_0x73c1('0x5')];this['scheduledat']=_0x64f862[_0x73c1('0x6')];this[_0x73c1('0x7')]=_0x64f862[_0x73c1('0x7')];this['campaigntype']=_0x64f862['type']===_0x73c1('0x8')?_0x73c1('0x9'):_0x64f862[_0x73c1('0x7')];this[_0x73c1('0xa')]=_0x64f862[_0x73c1('0xa')];this[_0x73c1('0xb')]=_0x64f862[_0x73c1('0xb')];this['countnoanswerretry']=_0x64f862['countnoanswerretry'];this[_0x73c1('0xc')]=_0x64f862[_0x73c1('0xa')]+_0x64f862[_0x73c1('0xb')]+_0x64f862[_0x73c1('0xd')]+_0x64f862['countnosuchnumberretry']+_0x64f862[_0x73c1('0xe')]+_0x64f862['countabandonedretry']+_0x64f862[_0x73c1('0xf')]+_0x64f862['countagentrejectretry'];this[_0x73c1('0x10')]=_0x64f862[_0x73c1('0x10')];this['countdropretry']=_0x64f862['countdropretry'];this[_0x73c1('0x11')]=_0x64f862['countabandonedretry'];this[_0x73c1('0xf')]=_0x64f862['countmachineretry'];this[_0x73c1('0x12')]=_0x64f862['countagentrejectretry'];this[_0x73c1('0x9')]=_0x64f862[_0x73c1('0x9')];this[_0x73c1('0x13')]=_0x64f862[_0x73c1('0x13')];this[_0x73c1('0x14')]=_0x64f862[_0x73c1('0x14')];this[_0x73c1('0x15')]=_0x64f862[_0x73c1('0x15')];this[_0x73c1('0x16')]=_0x64f862['responsetime'];this[_0x73c1('0x17')]=_0x64f862[_0x73c1('0x16')];this[_0x73c1('0x18')]=_0x64f862[_0x73c1('0x18')]||0x0;this['holdtime']=_0x64f862[_0x73c1('0x19')]||0x0;this[_0x73c1('0x1a')]=_0x64f862[_0x73c1('0x1a')]||0x0;this[_0x73c1('0x1b')]=_0x64f862[_0x73c1('0x1b')];this[_0x73c1('0x1c')]=_0x64f862[_0x73c1('0x1c')];this[_0x73c1('0x1d')]=_0x64f862['callbackat'];this[_0x73c1('0x1e')]=_0x64f862[_0x73c1('0x1e')];this[_0x73c1('0x1f')]=_0x64f862['ContactId'];this[_0x73c1('0x20')]=_0x64f862[_0x73c1('0x20')];this[_0x73c1('0x21')]=_0x64f862[_0x73c1('0x21')];this[_0x73c1('0x22')]=_0x64f862['VoiceQueueId'];this[_0x73c1('0x23')]=_0x64f862['CampaignId'];this['originatecalleridnum']=_0x64f862[_0x73c1('0x24')]||'';this[_0x73c1('0x25')]=_0x64f862[_0x73c1('0x25')]||'';}module[_0x73c1('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 6c9a291..54cca13 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e1d=['callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','IVR','cause-txt','callback','callbackuniqueid'];(function(_0xd0f42d,_0x5beaab){var _0x26534c=function(_0x281ccb){while(--_0x281ccb){_0xd0f42d['push'](_0xd0f42d['shift']());}};_0x26534c(++_0x5beaab);}(_0x0e1d,0xb7));var _0xd0e1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0e1d[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xd0e1('0x0'));var _=require(_0xd0e1('0x1'));var moment=require(_0xd0e1('0x2'));function getSeconds(_0x4895e5,_0x35e02a){var _0x5c5f31=moment(_0x4895e5)['milliseconds'](0x0);var _0x1ae4ed=moment(_0x35e02a)[_0xd0e1('0x3')](0x0);return _0x5c5f31[_0xd0e1('0x4')](_0x1ae4ed,_0xd0e1('0x5'));}function Hangup(_0x3a090d,_0x423634){this['state']=0x4;this[_0xd0e1('0x6')]=_0xd0e1('0x7');this[_0xd0e1('0x8')]=_0x3a090d['scheduledat'];this['type']=_0x3a090d[_0xd0e1('0x9')];this['campaigntype']=_0x3a090d['type']==='outbound'?'queue':_0x3a090d['type'];this[_0xd0e1('0xa')]=_0x3a090d[_0xd0e1('0xa')];this['countcongestionretry']=_0x3a090d['countcongestionretry'];this[_0xd0e1('0xb')]=_0x3a090d['countnoanswerretry'];this[_0xd0e1('0xc')]=_0x3a090d[_0xd0e1('0xa')]+_0x3a090d[_0xd0e1('0xd')]+_0x3a090d['countnoanswerretry']+_0x3a090d[_0xd0e1('0xe')]+_0x3a090d['countdropretry']+_0x3a090d[_0xd0e1('0xf')]+_0x3a090d[_0xd0e1('0x10')]+_0x3a090d['countagentrejectretry'];this[_0xd0e1('0xe')]=_0x3a090d[_0xd0e1('0xe')];this[_0xd0e1('0x11')]=_0x3a090d[_0xd0e1('0x11')];this[_0xd0e1('0xf')]=_0x3a090d[_0xd0e1('0xf')];this[_0xd0e1('0x10')]=_0x3a090d[_0xd0e1('0x10')];this[_0xd0e1('0x12')]=_0x3a090d[_0xd0e1('0x12')];this[_0xd0e1('0x13')]=_0x423634[_0xd0e1('0x13')];this[_0xd0e1('0x14')]=_0x3a090d['name'];this[_0xd0e1('0x15')]=_0x3a090d[_0xd0e1('0x16')];this['starttime']=_0x3a090d[_0xd0e1('0x17')];this[_0xd0e1('0x18')]=_0x3a090d[_0xd0e1('0x18')];this[_0xd0e1('0x19')]=moment()[_0xd0e1('0x1a')](_0xd0e1('0x1b'));this[_0xd0e1('0x1c')]=getSeconds(_0x3a090d['responsetime'],_0x3a090d['starttime']);this[_0xd0e1('0x1d')]=0x0;this[_0xd0e1('0x1e')]=getSeconds(this[_0xd0e1('0x19')],_0x3a090d['responsetime']);this[_0xd0e1('0x1f')]=_0x3a090d['queue'];this[_0xd0e1('0x20')]=_0xd0e1('0x21');this['reason']=_0x423634[_0xd0e1('0x22')];this[_0xd0e1('0x23')]=_0x3a090d[_0xd0e1('0x23')];this['callbackuniqueid']=_0x3a090d[_0xd0e1('0x24')];this[_0xd0e1('0x25')]=_0x3a090d[_0xd0e1('0x25')];this['recallme']=_0x3a090d[_0xd0e1('0x26')];this['ContactId']=_0x3a090d['ContactId'];this[_0xd0e1('0x27')]=_0x3a090d[_0xd0e1('0x27')];this['UserId']=_0x3a090d[_0xd0e1('0x28')];this[_0xd0e1('0x29')]=_0x3a090d[_0xd0e1('0x29')];this[_0xd0e1('0x2a')]=_0x3a090d[_0xd0e1('0x2a')];}module[_0xd0e1('0x2b')]=Hangup; \ No newline at end of file +var _0xf85e=['ringtime','holdtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xade57c,_0x557dda){var _0x3c133a=function(_0x361dfc){while(--_0x361dfc){_0xade57c['push'](_0xade57c['shift']());}};_0x3c133a(++_0x557dda);}(_0xf85e,0x8d));var _0xef85=function(_0x5cc68b,_0x446421){_0x5cc68b=_0x5cc68b-0x0;var _0x5c3fbe=_0xf85e[_0x5cc68b];return _0x5c3fbe;};'use strict';var util=require(_0xef85('0x0'));var _=require('lodash');var moment=require(_0xef85('0x1'));function getSeconds(_0x4618c6,_0x532a58){var _0x249640=moment(_0x4618c6)['milliseconds'](0x0);var _0x33c51d=moment(_0x532a58)[_0xef85('0x2')](0x0);return _0x249640[_0xef85('0x3')](_0x33c51d,_0xef85('0x4'));}function Hangup(_0x59e432,_0x4c9053){this['state']=0x4;this['statedesc']=_0xef85('0x5');this[_0xef85('0x6')]=_0x59e432[_0xef85('0x6')];this[_0xef85('0x7')]=_0x59e432[_0xef85('0x7')];this['campaigntype']=_0x59e432[_0xef85('0x7')]===_0xef85('0x8')?_0xef85('0x9'):_0x59e432[_0xef85('0x7')];this['countbusyretry']=_0x59e432[_0xef85('0xa')];this[_0xef85('0xb')]=_0x59e432[_0xef85('0xb')];this[_0xef85('0xc')]=_0x59e432[_0xef85('0xc')];this['countglobal']=_0x59e432['countbusyretry']+_0x59e432[_0xef85('0xb')]+_0x59e432[_0xef85('0xc')]+_0x59e432[_0xef85('0xd')]+_0x59e432[_0xef85('0xe')]+_0x59e432[_0xef85('0xf')]+_0x59e432[_0xef85('0x10')]+_0x59e432[_0xef85('0x11')];this['countnosuchnumberretry']=_0x59e432[_0xef85('0xd')];this[_0xef85('0xe')]=_0x59e432['countdropretry'];this['countabandonedretry']=_0x59e432[_0xef85('0xf')];this[_0xef85('0x10')]=_0x59e432[_0xef85('0x10')];this[_0xef85('0x11')]=_0x59e432['countagentrejectretry'];this['uniqueid']=_0x4c9053[_0xef85('0x12')];this[_0xef85('0x13')]=_0x59e432[_0xef85('0x14')];this[_0xef85('0x15')]=_0x59e432['number'];this[_0xef85('0x16')]=_0x59e432['starttime'];this[_0xef85('0x17')]=_0x59e432[_0xef85('0x17')];this[_0xef85('0x18')]=moment()[_0xef85('0x19')](_0xef85('0x1a'));this[_0xef85('0x1b')]=getSeconds(_0x59e432[_0xef85('0x17')],_0x59e432[_0xef85('0x16')]);this[_0xef85('0x1c')]=0x0;this[_0xef85('0x1d')]=getSeconds(this[_0xef85('0x18')],_0x59e432[_0xef85('0x17')]);this[_0xef85('0x9')]=_0x59e432[_0xef85('0x9')];this[_0xef85('0x1e')]='IVR';this[_0xef85('0x1f')]=_0x4c9053[_0xef85('0x20')];this[_0xef85('0x21')]=_0x59e432[_0xef85('0x21')];this[_0xef85('0x22')]=_0x59e432[_0xef85('0x22')];this[_0xef85('0x23')]=_0x59e432[_0xef85('0x23')];this[_0xef85('0x24')]=_0x59e432[_0xef85('0x24')];this[_0xef85('0x25')]=_0x59e432['ContactId'];this['ListId']=_0x59e432['ListId'];this[_0xef85('0x26')]=_0x59e432[_0xef85('0x26')];this['VoiceQueueId']=_0x59e432[_0xef85('0x27')];this['CampaignId']=_0x59e432[_0xef85('0x28')];}module[_0xef85('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 775606c..c34b76f 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0035=['VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0xe57964,_0x36993a){var _0x3dde68=function(_0x1d6422){while(--_0x1d6422){_0xe57964['push'](_0xe57964['shift']());}};_0x3dde68(++_0x36993a);}(_0x0035,0x18a));var _0x5003=function(_0x2e5a8c,_0x35f4bf){_0x2e5a8c=_0x2e5a8c-0x0;var _0x5816ec=_0x0035[_0x2e5a8c];return _0x5816ec;};'use strict';var util=require(_0x5003('0x0'));var _=require(_0x5003('0x1'));var moment=require(_0x5003('0x2'));function getSeconds(_0x207905,_0x1232e0){var _0x58075c=moment(_0x207905)[_0x5003('0x3')](0x0);var _0x4680c7=moment(_0x1232e0)[_0x5003('0x3')](0x0);return _0x58075c[_0x5003('0x4')](_0x4680c7,_0x5003('0x5'));}function History(_0x5c27d4){this[_0x5003('0x6')]=_0x5c27d4[_0x5003('0x6')];this[_0x5003('0x7')]=_0x5c27d4['scheduledat']||undefined;this[_0x5003('0x8')]=_0x5c27d4[_0x5003('0x8')];this[_0x5003('0x9')]=_0x5c27d4[_0x5003('0x8')]===_0x5003('0xa')?_0x5003('0xb'):_0x5c27d4[_0x5003('0x8')];this['countbusyretry']=_0x5c27d4[_0x5003('0xc')];this[_0x5003('0xd')]=_0x5c27d4[_0x5003('0xd')];this[_0x5003('0xe')]=_0x5c27d4['countnoanswerretry'];this[_0x5003('0xf')]=_0x5c27d4[_0x5003('0xc')]+_0x5c27d4[_0x5003('0xd')]+_0x5c27d4[_0x5003('0xe')]+_0x5c27d4[_0x5003('0x10')]+_0x5c27d4[_0x5003('0x11')]+_0x5c27d4[_0x5003('0x12')]+_0x5c27d4[_0x5003('0x13')]+_0x5c27d4[_0x5003('0x14')];this[_0x5003('0x10')]=_0x5c27d4[_0x5003('0x10')];this[_0x5003('0x11')]=_0x5c27d4['countdropretry'];this['countabandonedretry']=_0x5c27d4['countabandonedretry'];this[_0x5003('0x13')]=_0x5c27d4[_0x5003('0x13')];this[_0x5003('0x14')]=_0x5c27d4[_0x5003('0x14')];this[_0x5003('0xb')]=_0x5c27d4['queue'];this[_0x5003('0x15')]=_0x5c27d4[_0x5003('0x16')];this[_0x5003('0x17')]=_0x5c27d4[_0x5003('0x18')];this[_0x5003('0x19')]=_0x5c27d4[_0x5003('0x19')];this[_0x5003('0x1a')]=_0x5c27d4[_0x5003('0x1a')];this['endtime']=_0x5c27d4[_0x5003('0x1a')];this['ringtime']=getSeconds(_0x5c27d4[_0x5003('0x1a')],_0x5c27d4[_0x5003('0x19')]);this[_0x5003('0x1b')]=0x0;this['talktime']=0x0;this[_0x5003('0x1c')]=_0x5c27d4[_0x5003('0x1c')];this[_0x5003('0x1d')]=_0x5c27d4[_0x5003('0x1d')];this[_0x5003('0x1e')]=_0x5c27d4[_0x5003('0x1e')];this[_0x5003('0x1f')]=_0x5c27d4[_0x5003('0x1f')];this[_0x5003('0x20')]=_0x5c27d4[_0x5003('0x20')];this[_0x5003('0x21')]=_0x5c27d4[_0x5003('0x21')];this['UserId']=_0x5c27d4[_0x5003('0x22')];this['VoiceQueueId']=_0x5c27d4[_0x5003('0x23')];this[_0x5003('0x24')]=_0x5c27d4[_0x5003('0x24')];this['originatecalleridnum']=_0x5c27d4['originatecalleridnum']||'';this[_0x5003('0x25')]=_0x5c27d4[_0x5003('0x25')]||'';}module[_0x5003('0x26')]=History; \ No newline at end of file +var _0x66a4=['talktime','callback','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','starttime','responsetime','ringtime','holdtime'];(function(_0x1e5588,_0x147cc3){var _0x453c1a=function(_0x8ba9b2){while(--_0x8ba9b2){_0x1e5588['push'](_0x1e5588['shift']());}};_0x453c1a(++_0x147cc3);}(_0x66a4,0x122));var _0x466a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x66a4[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x466a('0x0'));var _=require(_0x466a('0x1'));var moment=require('moment');function getSeconds(_0xe9780,_0x28c7e8){var _0x15b2ef=moment(_0xe9780)[_0x466a('0x2')](0x0);var _0x182211=moment(_0x28c7e8)[_0x466a('0x2')](0x0);return _0x15b2ef[_0x466a('0x3')](_0x182211,_0x466a('0x4'));}function History(_0x574b6d){this[_0x466a('0x5')]=_0x574b6d['uniqueid'];this[_0x466a('0x6')]=_0x574b6d[_0x466a('0x6')]||undefined;this[_0x466a('0x7')]=_0x574b6d[_0x466a('0x7')];this[_0x466a('0x8')]=_0x574b6d[_0x466a('0x7')]==='outbound'?'queue':_0x574b6d['type'];this['countbusyretry']=_0x574b6d[_0x466a('0x9')];this['countcongestionretry']=_0x574b6d[_0x466a('0xa')];this[_0x466a('0xb')]=_0x574b6d['countnoanswerretry'];this[_0x466a('0xc')]=_0x574b6d[_0x466a('0x9')]+_0x574b6d[_0x466a('0xa')]+_0x574b6d[_0x466a('0xb')]+_0x574b6d[_0x466a('0xd')]+_0x574b6d[_0x466a('0xe')]+_0x574b6d[_0x466a('0xf')]+_0x574b6d['countmachineretry']+_0x574b6d['countagentrejectretry'];this['countnosuchnumberretry']=_0x574b6d[_0x466a('0xd')];this[_0x466a('0xe')]=_0x574b6d[_0x466a('0xe')];this['countabandonedretry']=_0x574b6d[_0x466a('0xf')];this[_0x466a('0x10')]=_0x574b6d['countmachineretry'];this[_0x466a('0x11')]=_0x574b6d[_0x466a('0x11')];this[_0x466a('0x12')]=_0x574b6d['queue'];this[_0x466a('0x13')]=_0x574b6d[_0x466a('0x14')];this['calleridnum']=_0x574b6d['number'];this[_0x466a('0x15')]=_0x574b6d[_0x466a('0x15')];this[_0x466a('0x16')]=_0x574b6d[_0x466a('0x16')];this['endtime']=_0x574b6d[_0x466a('0x16')];this[_0x466a('0x17')]=getSeconds(_0x574b6d[_0x466a('0x16')],_0x574b6d[_0x466a('0x15')]);this[_0x466a('0x18')]=0x0;this[_0x466a('0x19')]=0x0;this[_0x466a('0x1a')]=_0x574b6d[_0x466a('0x1a')];this['callbackuniqueid']=_0x574b6d['callbackuniqueid'];this['callbackat']=_0x574b6d[_0x466a('0x1b')];this['recallme']=_0x574b6d[_0x466a('0x1c')];this[_0x466a('0x1d')]=_0x574b6d[_0x466a('0x1d')];this[_0x466a('0x1e')]=_0x574b6d[_0x466a('0x1e')];this['UserId']=_0x574b6d['UserId'];this[_0x466a('0x1f')]=_0x574b6d['VoiceQueueId'];this[_0x466a('0x20')]=_0x574b6d[_0x466a('0x20')];this['originatecalleridnum']=_0x574b6d[_0x466a('0x21')]||'';this['originatecalleridname']=_0x574b6d[_0x466a('0x22')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 5ec9d98..f97e8ea 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 _0xb903=['\x22%s\x22\x20<%s>','inspect','error','stack','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','[uniqueid]','clearZombieChannels','actions','[actions]','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','ivr','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','xcally-motion-dialer','dialAMDActive','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','value','HANGUP','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','dialGlobalMaxRetry','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','syncAgentComplete','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridname','actionid','locked','stateinterface','rrmemory','push','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','true','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','predictive','booked','method\x20not\x20recognized','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','syncCampaigns','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','tags','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','stateGlobal','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','reason\x2020\x20agentreject','Global','[callProgressDetecting]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','getContactDialer','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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]','m\x20=\x20','Ts\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','util','lodash','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictiveCalls','syncQueueSummary','../ami','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./final','./agentComplete','./queueCallerAbandon','XCALLY_IP_AGI','roundrobin','prototype','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','custom:queuesummary','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','\x20AGENTS\x20NOT\x20LOGGED','name','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Interval','INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','isEmpty'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xb903,0x185));var _0x3b90=function(_0x5295cd,_0x1e144d){_0x5295cd=_0x5295cd-0x0;var _0x449640=_0xb903[_0x5295cd];return _0x449640;};'use strict';var util=require(_0x3b90('0x0'));var _=require(_0x3b90('0x1'));var BPromise=require(_0x3b90('0x2'));var uuid=require(_0x3b90('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x3b90('0x4'));var Redis=require(_0x3b90('0x5'));var ut=require(_0x3b90('0x6'));var config=require(_0x3b90('0x7'));var logger=require(_0x3b90('0x8'))(_0x3b90('0x9'));var loggerBooked=require(_0x3b90('0x8'))('booked');var loggerPredictive=require(_0x3b90('0x8'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x3b90('0xa'));var loggerSyncQueueSummary=require(_0x3b90('0x8'))(_0x3b90('0xb'));var ami=require(_0x3b90('0xc'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x3b90('0xd'));var cmHopperHistory=require(_0x3b90('0xe'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x3b90('0xf'));var Action=require(_0x3b90('0x10'));var History=require('./history');var Final=require(_0x3b90('0x11'));var AgentComplete=require(_0x3b90('0x12'));var QueueCallerAbandon=require(_0x3b90('0x13'));var Hangup=require('./hangup');var ipAgi=process['env'][_0x3b90('0x14')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0x3b90('0x15')};var Sequence=function(){};Sequence[_0x3b90('0x16')]['enqueue']=function(_0x51fb66){this[_0x3b90('0x17')]=this[_0x3b90('0x17')]?this[_0x3b90('0x17')][_0x3b90('0x18')](_0x51fb66):_0x51fb66();};function Dialer(_0x1efe01,_0x529421){this['sequence']=new Sequence();this[_0x3b90('0x19')]=_0x529421;this[_0x3b90('0x1a')]=_0x1efe01['voiceQueues'];this[_0x3b90('0x1b')]=_0x1efe01[_0x3b90('0x1b')];this[_0x3b90('0x1c')]=_0x1efe01[_0x3b90('0x1c')];this['trunks']=_0x1efe01[_0x3b90('0x1d')];this['maxNumberOriginate']=config[_0x3b90('0x1e')]||0x2;this[_0x3b90('0x1f')]={};this['actions']={};this[_0x3b90('0x20')]={};this[_0x3b90('0x21')]={};this[_0x3b90('0x22')]={};this[_0x3b90('0x23')]={};this[_0x3b90('0x24')]={};this[_0x3b90('0x25')]={};this[_0x3b90('0x26')]={};this[_0x3b90('0x27')]={};ami['on'](_0x3b90('0x28'),this[_0x3b90('0x29')]['bind'](this));ami['on'](_0x3b90('0x2a'),this[_0x3b90('0x2b')][_0x3b90('0x2c')](this));ami['on'](_0x3b90('0x2d'),this[_0x3b90('0x2e')][_0x3b90('0x2c')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x3b90('0x2c')](this));ami['on'](_0x3b90('0x2f'),this[_0x3b90('0xb')][_0x3b90('0x2c')](this));ami['on']('hangup',this[_0x3b90('0x30')][_0x3b90('0x2c')](this));ami['on'](_0x3b90('0x31'),this['syncNewExten'][_0x3b90('0x2c')](this));ami['on'](_0x3b90('0x32'),this[_0x3b90('0x33')][_0x3b90('0x2c')](this));ami['on'](_0x3b90('0x34'),this[_0x3b90('0x35')]['bind'](this));ami['on'](_0x3b90('0x36'),this['syncQueueStatusComplete'][_0x3b90('0x2c')](this));this[_0x3b90('0x37')]();this[_0x3b90('0x38')]();}function isNotNull(_0x38eed0){return _0x38eed0!==null&&!_[_0x3b90('0x39')](_0x38eed0);}function checkIsLoggedIn(_0x6704f,_0x290283){return function(){if(_0x290283<=0x0){_0x6704f[_0x3b90('0x3a')]='AGENTS_NOT_LOGGED';throw _0x6704f['name']+_0x3b90('0x3b');}};}function isActive(_0x199f73){return _0x199f73;}function checkIsActive(_0x23484a,_0x1c2e84){return function(){if(!isActive(_0x1c2e84)){_0x23484a['message']='NOT_ACTIVE';throw _0x23484a[_0x3b90('0x3c')]+_0x3b90('0x3d');}};}function checkInterval(_0x24d5c9){return function(){if(!isNotNull(_0x24d5c9['Interval'])){_0x24d5c9[_0x3b90('0x3a')]='INTERVAL_IS_NULL';throw _0x24d5c9['name']+_0x3b90('0x3e');}if(!isNotNull(_0x24d5c9[_0x3b90('0x3f')]['Intervals'])){_0x24d5c9[_0x3b90('0x3a')]=_0x3b90('0x40');throw _0x24d5c9[_0x3b90('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x24d5c9[_0x3b90('0x3f')][_0x3b90('0x41')]))){_0x24d5c9[_0x3b90('0x3a')]=_0x3b90('0x40');throw _0x24d5c9['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x25ff34,_0x6fd698,_0x524691){return{'action':_0x25ff34,'response':_0x6fd698,'message':_0x524691,'stack':_0x524691};}function myreject(_0x57946d){return function(_0x201712){return _0x57946d(msgResponse(_0x3b90('0x42'),_0x3b90('0x43'),JSON[_0x3b90('0x44')](_0x201712)));};}function getSeconds(_0x5a3266,_0x2154e2){var _0x583842=moment(_0x5a3266)[_0x3b90('0x45')](0x0);var _0x43bae5=moment(_0x2154e2)[_0x3b90('0x45')](0x0);return _0x583842[_0x3b90('0x46')](_0x43bae5,_0x3b90('0x47'));}function emit(_0x3bf148,_0x96f7f3,_0x534bea){io['to'](_0x3bf148)[_0x3b90('0x48')](_0x96f7f3,_0x534bea);}function emitVoiceQueueSummary(_0x2b0a5b){if(_0x2b0a5b[_0x3b90('0x49')]===_0x3b90('0x4a')){var _0x3d6040={'id':_0x2b0a5b['id'],'name':_0x2b0a5b[_0x3b90('0x3c')],'strategy':_0x2b0a5b[_0x3b90('0x4b')],'answered':_0x2b0a5b[_0x3b90('0x4c')],'available':_0x2b0a5b[_0x3b90('0x4d')],'loggedIn':_0x2b0a5b['loggedIn'],'pTalking':_0x2b0a5b[_0x3b90('0x4e')],'sumBillable':_0x2b0a5b[_0x3b90('0x4f')],'sumDuration':_0x2b0a5b[_0x3b90('0x50')],'sumHoldTime':_0x2b0a5b[_0x3b90('0x51')]||0x0,'talking':_0x2b0a5b[_0x3b90('0x52')],'total':_0x2b0a5b[_0x3b90('0x53')],'type':_0x2b0a5b[_0x3b90('0x49')],'unmanaged':_0x2b0a5b[_0x3b90('0x54')],'abandoned':_0x2b0a5b[_0x3b90('0x55')],'waiting':_0x2b0a5b[_0x3b90('0x56')],'loggedInDb':_0x2b0a5b[_0x3b90('0x57')],'dialActive':_0x2b0a5b[_0x3b90('0x58')],'dialMethod':_0x2b0a5b[_0x3b90('0x59')],'dialOriginateCallerIdName':_0x2b0a5b[_0x3b90('0x5a')],'dialOriginateCallerIdNumber':_0x2b0a5b[_0x3b90('0x5b')],'dialOriginateTimeout':_0x2b0a5b[_0x3b90('0x5c')],'dialPrefix':_0x2b0a5b[_0x3b90('0x5d')],'outboundAnswerAgiCallsDay':_0x2b0a5b[_0x3b90('0x5e')],'outboundAnswerCallsDay':_0x2b0a5b[_0x3b90('0x5f')],'outboundBlacklistCallsDay':_0x2b0a5b[_0x3b90('0x60')],'outboundBusyCallsDay':_0x2b0a5b[_0x3b90('0x61')],'outboundCongestionCallsDay':_0x2b0a5b['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2b0a5b[_0x3b90('0x62')],'outboundDropCallsDayCallersExit':_0x2b0a5b[_0x3b90('0x63')],'outboundDropCallsDayTimeout':_0x2b0a5b[_0x3b90('0x64')],'outboundNoAnswerCallsDay':_0x2b0a5b[_0x3b90('0x65')],'outboundNoSuchCallsDay':_0x2b0a5b['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x2b0a5b[_0x3b90('0x66')],'outboundReCallsDay':_0x2b0a5b['outboundReCallsDay'],'outboundRejectCallsDay':_0x2b0a5b['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2b0a5b[_0x3b90('0x67')],'predictiveIntervalAnsweredCalls':_0x2b0a5b[_0x3b90('0x68')],'predictiveIntervalAvgHoldtime':_0x2b0a5b['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x2b0a5b[_0x3b90('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x2b0a5b[_0x3b90('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x2b0a5b[_0x3b90('0x6b')],'predictiveIntervalErlangCalls':_0x2b0a5b[_0x3b90('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x2b0a5b[_0x3b90('0x6d')],'predictiveIntervalHitRate':_0x2b0a5b[_0x3b90('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x2b0a5b[_0x3b90('0x6f')],'predictiveIntervalPauses':_0x2b0a5b[_0x3b90('0x70')],'predictiveIntervalAvailable':_0x2b0a5b[_0x3b90('0x71')],'predictiveIntervalTotalCalls':_0x2b0a5b['predictiveIntervalTotalCalls'],'message':_0x2b0a5b[_0x3b90('0x3a')],'originated':_0x2b0a5b[_0x3b90('0x72')],'erlangCalls':_0x2b0a5b['erlangCalls'],'erlangCallToSecond':_0x2b0a5b[_0x3b90('0x73')],'erlangAbandonmentRate':_0x2b0a5b[_0x3b90('0x74')],'erlangBusyFactor':_0x2b0a5b[_0x3b90('0x75')],'startPredictive':_0x2b0a5b[_0x3b90('0x23')],'startProgressive':_0x2b0a5b[_0x3b90('0x24')]};if(_0x2b0a5b['Trunk']){_0x3d6040['Trunk']={'id':_0x2b0a5b[_0x3b90('0x76')]['id'],'name':_0x2b0a5b['Trunk'][_0x3b90('0x3c')],'active':_0x2b0a5b[_0x3b90('0x76')][_0x3b90('0x77')],'callerid':_0x2b0a5b[_0x3b90('0x76')][_0x3b90('0x78')]};}if(_0x2b0a5b['Interval']){_0x3d6040['Interval']={'id':_0x2b0a5b[_0x3b90('0x3f')]['id'],'name':_0x2b0a5b[_0x3b90('0x3f')][_0x3b90('0x3c')]};}var _0x5d7333=md5(JSON[_0x3b90('0x44')](_0x3d6040));if(_0x2b0a5b[_0x3b90('0x4')]!==_0x5d7333){_0x2b0a5b[_0x3b90('0x4')]=_0x5d7333;emit(util[_0x3b90('0x79')](_0x3b90('0x7a'),_0x3d6040[_0x3b90('0x3c')]),_0x3b90('0x7b'),_0x3d6040);}}}function emitCampaignSummary(_0x13b364){if(_0x13b364[_0x3b90('0x49')]==='ivr'){emit(util[_0x3b90('0x79')](_0x3b90('0x7c'),_0x13b364[_0x3b90('0x3c')]),'campaign:save',_0x13b364);}}function checkGetDataPredictive(_0x1e803e){if(isNotNull(_0x1e803e)&&!_['isEmpty'](_0x1e803e)){loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x7e'));loggerPredictive[_0x3b90('0x7d')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e803e[_0x3b90('0x7f')]);loggerPredictive[_0x3b90('0x7d')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e803e['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x80'),_0x1e803e[_0x3b90('0x6b')]);loggerPredictive[_0x3b90('0x7d')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e803e['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x81'),_0x1e803e[_0x3b90('0x82')]);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x83'),_0x1e803e[_0x3b90('0x69')]);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x84'));if(_0x1e803e[_0x3b90('0x7f')]>0x0){if(!_['isUndefined'](_0x1e803e[_0x3b90('0x69')])&&_0x1e803e[_0x3b90('0x69')]>0x0){return!![];}loggerPredictive['info'](_0x3b90('0x85'));if(!_[_0x3b90('0x39')](_0x1e803e['predictiveIntervalAvgHoldtime'])&&_0x1e803e[_0x3b90('0x82')]>0x0){return!![];}loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x86'));}else{loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x87'));}}else{loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x88'));}return![];}function mergeDataErlangB(_0x47c9d1){return function(_0x1c6e45){loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x89'));loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x8a'),_0x1c6e45[_0x3b90('0x8b')]);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x8c'),_0x1c6e45[_0x3b90('0x73')]);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x8d'),_0x1c6e45[_0x3b90('0x74')]);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x8e'),_0x1c6e45[_0x3b90('0x75')]);loggerPredictive['info'](_0x3b90('0x8d'),_0x1c6e45['erlangAbandonmentRate']);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x84'));_[_0x3b90('0x8f')](_0x47c9d1,_0x1c6e45);};}function getDiff(_0x1bce2a){var _0x3e2245=moment()[_0x3b90('0x45')](0x0);var _0x55c14c=moment(_0x1bce2a)[_0x3b90('0x45')](0x0);return _0x3e2245[_0x3b90('0x46')](_0x55c14c,_0x3b90('0x47'));}function ifInterval(_0x8e1229,_0x3d41c8){if(_[_0x3b90('0x39')](_0x3d41c8)){return![];}return getDiff(_0x3d41c8)<_0x8e1229*0x3c;}function freeVariablesPredictive(_0x5c7605){if(isNotNull(_0x5c7605)){if(!_[_0x3b90('0x39')](_0x5c7605[_0x3b90('0x24')])){_0x5c7605[_0x3b90('0x24')]=undefined;loggerPredictive['info'](_0x5c7605[_0x3b90('0x3c')],_0x3b90('0x90'));}if(!_[_0x3b90('0x39')](_0x5c7605[_0x3b90('0x23')])){_0x5c7605[_0x3b90('0x23')]=undefined;loggerPredictive[_0x3b90('0x7d')](_0x5c7605[_0x3b90('0x3c')],_0x3b90('0x91'));}if(!_[_0x3b90('0x39')](_0x5c7605['handlePredictive'])){clearInterval(_0x5c7605[_0x3b90('0x92')]);_0x5c7605['handlePredictive']=undefined;loggerPredictive['info'](_0x5c7605[_0x3b90('0x3c')],_0x3b90('0x93'));}}}function erlangb(_0x52c099,_0x13dd30){if(_0x13dd30===0x0){return 0x0;}var _0x1a2592=0x1;for(var _0x287be4=0x1;_0x287be4<=_0x13dd30;_0x287be4+=0x1){_0x1a2592=0x1+_0x1a2592*_0x287be4/_0x52c099;}return 0x1/_0x1a2592;}function isVoiceQueueOutbound(_0x1842f9){return _0x1842f9===_0x3b90('0x4a');}function isNotPreview(_0x260de4){return _0x260de4!==_0x3b90('0x19');}function isCampaignIvr(_0x5441c4){return _0x5441c4==='ivr';}function getCallerId(_0x3e5532,_0x5e5efa,_0x2bdd3d){if(!_['isUndefined'](_0x2bdd3d)&&typeof _0x2bdd3d===_0x3b90('0x94')&&!_['isEmpty'](_0x2bdd3d)){if(!_['isUndefined'](_0x5e5efa)&&typeof _0x5e5efa==='string'&&!_[_0x3b90('0x95')](_0x5e5efa)){return util[_0x3b90('0x79')](_0x3b90('0x96'),_0x5e5efa,_0x2bdd3d);}return util[_0x3b90('0x79')](_0x3b90('0x96'),_0x2bdd3d,_0x2bdd3d);}if(!_[_0x3b90('0x39')](_0x3e5532)&&typeof _0x3e5532===_0x3b90('0x94')&&!_['isEmpty'](_0x3e5532)){return _0x3e5532;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x5aead0,_0x3c1632){return function(_0x2827eb){freeVariablesPredictive(_0x3c1632);emitVoiceQueueSummary(_0x3c1632);emitCampaignSummary(_0x3c1632);loggerSyncQueueSummary['error'](_0x5aead0,util[_0x3b90('0x97')](_0x2827eb,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x398301,_0x3eba02){return function(_0x3b109f){loggerPredictive[_0x3b90('0x98')](_0x3eba02[_0x3b90('0x3c')],_0x398301);loggerPredictive[_0x3b90('0x98')](_0x3b109f[_0x3b90('0x99')]);freeVariablesPredictive(_0x3eba02);};}function loggerCatch(_0x29548f){return function(_0x5ec095){logger[_0x3b90('0x98')](_0x29548f,util['inspect'](_0x5ec095,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2bbbac){return _0x2bbbac&&!_[_0x3b90('0x39')](_0x2bbbac)&&_0x2bbbac['length']>0x0;}function decremetOriginate(_0x5b34f5){if(!_[_0x3b90('0x39')](_0x5b34f5)&&_0x5b34f5!==null){if(typeof _0x5b34f5[_0x3b90('0x72')]!==_0x3b90('0x9a')){if(_0x5b34f5[_0x3b90('0x72')]>0x0){_0x5b34f5[_0x3b90('0x72')]-=0x1;}else{logger[_0x3b90('0x98')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x3b90('0x98')](_0x3b90('0x9b'));}}function checkContactLowerLimitOriginate(_0x261840,_0x5b7b79,_0x38c985){if(_0x5b7b79>_0x38c985){for(var _0x5e7c59=0x0;_0x5e7c59<_0x5b7b79-_0x38c985;_0x5e7c59+=0x1){decremetOriginate(_0x261840);}}}function loggerGetContactDialer(_0xaec524,_0x34c02f,_0x391568){return function(_0x333a1b){checkContactLowerLimitOriginate(_0x34c02f,_0x391568,0x0);logger[_0x3b90('0x98')](_0xaec524,util[_0x3b90('0x97')](_0x333a1b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x507d53){return function(_0x21e95d){if(isNotNull(_0x21e95d)&&isNotNull(_0x21e95d[0x0])){if(_0x21e95d[0x0][_0x3b90('0x9c')]>0x0){_0x507d53[_0x3b90('0x3a')]=_0x3b90('0x9d');logger[_0x3b90('0x7d')](_0x3b90('0x9e')+_0x507d53[_0x3b90('0x3c')],_0x21e95d[0x0][_0x3b90('0x9c')],'contacts');}else{_0x507d53[_0x3b90('0x3a')]=_0x3b90('0x9f');logger[_0x3b90('0x7d')](_0x3b90('0xa0')+_0x507d53[_0x3b90('0x3c')]);}}};}function notSendMessagesQueue(_0x2ba788){if(_0x2ba788[_0x3b90('0xa1')]){freeVariablesPredictive(_0x2ba788);if(_0x2ba788[_0x3b90('0x72')]===0x0&&_0x2ba788['talking']===0x0&&_0x2ba788['waiting']===0x0&&(_0x2ba788[_0x3b90('0x4e')]||0x0)===0x0){_0x2ba788[_0x3b90('0xa1')]=![];_0x2ba788[_0x3b90('0x4d')]=0x0;_0x2ba788['message']=_0x3b90('0xa2');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2ba788[_0x3b90('0x3c')],_0x3b90('0xa3'));}else{_0x2ba788[_0x3b90('0x3a')]=_0x3b90('0xa4');loggerSyncQueueSummary[_0x3b90('0x98')](_0x3b90('0xa5'),_0x2ba788[_0x3b90('0x3c')],_0x3b90('0xa6'));}emitVoiceQueueSummary(_0x2ba788);}}function notSendMessagesCampaign(_0x3a8f80){if(_0x3a8f80[_0x3b90('0xa1')]){if(_0x3a8f80[_0x3b90('0x72')]===0x0){_0x3a8f80[_0x3b90('0xa1')]=![];_0x3a8f80[_0x3b90('0x3a')]=_0x3b90('0xa2');loggerSyncQueueSummary[_0x3b90('0x98')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3a8f80[_0x3b90('0x3c')],_0x3b90('0xa3'));}else{_0x3a8f80['message']=_0x3b90('0xa4');loggerSyncQueueSummary['error'](_0x3b90('0xa7'),_0x3a8f80[_0x3b90('0x3c')],_0x3b90('0xa6'));}emitCampaignSummary(_0x3a8f80);}}function createObjHistory(_0x4c3156,_0xdcf95a,_0x1d7f2e,_0x10dfdf,_0x137a08){_0x4c3156[_0x3b90('0x3a')]=_0x1d7f2e;var _0x15befb=new Action(_0x4c3156,_0xdcf95a);var _0x4a167d=new History(_0x15befb);_0x4a167d[_0x3b90('0xa8')]=_0x10dfdf;_0x4a167d[_0x3b90('0xa9')]=_0x137a08;_0x4a167d[_0x3b90('0xaa')]=_0x15befb[_0x3b90('0xab')];return _0x4a167d;}Dialer[_0x3b90('0x16')]['loopClearZombieChannels']=function(){var _0x5546af=this;setInterval(function(){_0x5546af['clearZombieChannels'](_0x5546af[_0x3b90('0x21')],_0x3b90('0xac'));_0x5546af[_0x3b90('0xad')](_0x5546af[_0x3b90('0xae')],_0x3b90('0xaf'));},0x32c8);};Dialer[_0x3b90('0x16')][_0x3b90('0xad')]=function(_0x3472c8,_0x2dd72e){var _0x157f24=this;for(var _0x235048 in _0x3472c8){if(typeof _0x3472c8[_0x235048]!=='undefined'){this['sequence'][_0x3b90('0xb0')](function(){if(!_[_0x3b90('0xb1')](_0x3472c8[_0x235048])){return ami[_0x3b90('0xb2')]({'action':_0x3b90('0xb3'),'channel':_0x3472c8[_0x235048][_0x3b90('0xb4')]})[_0x3b90('0xb5')](function(_0x150510){if(_0x150510[_0x3b90('0x3a')]===_0x3b90('0xb6')){setTimeout(function(){if(_0x3472c8[_0x235048]&&_0x3472c8[_0x235048][_0x3b90('0x49')]!==_0x3b90('0xb7')){_0x157f24[_0x3b90('0xb8')](_0x157f24[_0x3b90('0x1a')][_0x3472c8[_0x235048][_0x3b90('0xb9')]]);logger[_0x3b90('0x98')](_0x3b90('0xba'),_0x2dd72e,_0x235048,_0x3472c8[_0x235048][_0x3b90('0xb9')]);delete _0x3472c8[_0x235048];}if(_0x3472c8[_0x235048]&&_0x3472c8[_0x235048][_0x3b90('0x49')]==='ivr'){_0x157f24[_0x3b90('0xb8')](_0x157f24[_0x3b90('0x1b')][_0x3472c8[_0x235048][_0x3b90('0xb9')]]);logger[_0x3b90('0x98')](_0x3b90('0xbb'),_0x2dd72e,_0x235048,_0x3472c8[_0x235048]['queue']);delete _0x3472c8[_0x235048];}},0x2328);}});}});}}};Dialer[_0x3b90('0x16')][_0x3b90('0xbc')]=function(_0x320fc2){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopper[_0x3b90('0xbc')](_0x320fc2))['catch'](loggerCatch(_0x3b90('0xbf')));};Dialer['prototype']['checkIsBlackList']=function(_0x25b369){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopperBlack[_0x3b90('0xc0')](_0x25b369))[_0x3b90('0xb5')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x3b90('0x16')][_0x3b90('0xc1')]=function(_0x429cd0){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopperBlack[_0x3b90('0xc1')](_0x429cd0))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xc2')));};Dialer[_0x3b90('0x16')][_0x3b90('0xc3')]=function(_0x4fbbe9){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopperHistory[_0x3b90('0xc4')](_0x4fbbe9))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xc5')));};Dialer['prototype'][_0x3b90('0xc6')]=function(_0x9fcc2){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopper[_0x3b90('0xc6')](_0x9fcc2))[_0x3b90('0xb5')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x3b90('0x16')][_0x3b90('0xc7')]=function(_0x36cb77,_0x306259,_0x1ae34b){return BPromise['resolve']()[_0x3b90('0xbe')](cmHopper[_0x3b90('0xc7')](_0x36cb77,_0x306259,_0x1ae34b))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xc8')));};Dialer['prototype']['getContactDialer']=function(_0x2b949c,_0x5c2e1f,_0x1325e2,_0x65a749,_0x13b9e4){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopper['getContactDialer'](_0x2b949c,_0x5c2e1f,_0x1325e2,_0x65a749))[_0x3b90('0xb5')](function(_0x4ed025){_0x13b9e4[_0x3b90('0xc9')]-=_0x1325e2;_0x13b9e4[_0x3b90('0xc9')]=_0x13b9e4[_0x3b90('0xc9')]>0x0?_0x13b9e4['temp']:0x0;loggerCatch(_0x3b90('0xca'))(_0x4ed025);});};Dialer[_0x3b90('0x16')][_0x3b90('0xcb')]=function(_0x5e0bad,_0x1aa2f1,_0x1dbc3d,_0x290a14){return BPromise['resolve']()[_0x3b90('0xbe')](cmHopper[_0x3b90('0xcb')](_0x5e0bad,_0x1aa2f1,_0x1dbc3d))[_0x3b90('0xb5')](function(_0x3c1c3f){_0x290a14[_0x3b90('0xc9')]-=_0x1aa2f1;_0x290a14[_0x3b90('0xc9')]=_0x290a14['temp']>0x0?_0x290a14['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x3c1c3f);});};Dialer[_0x3b90('0x16')]['getVoiceQueueRtPauses']=function(_0x88a9f3){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](voiceQueueRt[_0x3b90('0xcc')](_0x88a9f3))[_0x3b90('0xb5')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x3b90('0x16')]['moveContactManagedDialer']=function(_0x74241a){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopper['moveContactManagedDialer'](_0x74241a))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xcd')));};Dialer[_0x3b90('0x16')][_0x3b90('0xce')]=function(_0x1be56f){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopperHistory[_0x3b90('0xce')](_0x1be56f))['catch'](loggerCatch(_0x3b90('0xcf')));};Dialer['prototype'][_0x3b90('0xb8')]=function(_0x171ac6){if(!_[_0x3b90('0x39')](_0x171ac6)&&_0x171ac6!==null){if(typeof _0x171ac6[_0x3b90('0x72')]!==_0x3b90('0x9a')){if(_0x171ac6[_0x3b90('0x72')]>0x0){_0x171ac6[_0x3b90('0x72')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x3b90('0x98')](_0x3b90('0xd0'));}};Dialer[_0x3b90('0x16')][_0x3b90('0xd1')]=function(_0x4c70bb,_0x5d62ce){var _0x216e68=this;return function(_0x41c061){_0x216e68['updateOriginated'](_0x5d62ce);logger[_0x3b90('0x98')](_0x4c70bb,util[_0x3b90('0x97')](_0x41c061,{'showHidden':![],'depth':null}));};};Dialer[_0x3b90('0x16')][_0x3b90('0xd2')]=function(_0x2cef2f,_0x4490da,_0x57cca1){var _0x2b6599={'state':0x19,'statedesc':_0x3b90('0xd3')};this[_0x3b90('0xb8')](_0x4490da);this[_0x3b90('0xd4')](_[_0x3b90('0x8f')](_0x2b6599,_[_0x3b90('0xd5')](_0x57cca1,[_0x3b90('0xd6'),_0x3b90('0xd7'),_0x3b90('0xd8'),_0x3b90('0xd9'),_0x3b90('0xda')])),'[emptyContact][createHistory]','[emptyContact]');logger['error'](_0x2cef2f);};Dialer['prototype'][_0x3b90('0xdb')]=function(_0x184743){return _0x184743===_0x3b90('0xdc');};Dialer[_0x3b90('0x16')][_0x3b90('0xdd')]=function(_0x398407){return!_[_0x3b90('0x39')](_0x398407)&&_0x398407&&!_[_0x3b90('0x39')](_0x398407[_0x3b90('0x3c')])&&!_['isUndefined'](_0x398407[_0x3b90('0x77')])&&_0x398407['active']&&(this['trunks'][util[_0x3b90('0x79')](_0x3b90('0xde'),_0x398407[_0x3b90('0x3c')])][_0x3b90('0xb3')]===_0x3b90('0xdf')||this['trunks'][util[_0x3b90('0x79')]('SIP/%s',_0x398407[_0x3b90('0x3c')])][_0x3b90('0xb3')]===_0x3b90('0xe0'));};Dialer[_0x3b90('0x16')][_0x3b90('0xd4')]=function(_0x123cde,_0x144f06,_0x455c81){this[_0x3b90('0xce')](_0x123cde)[_0x3b90('0xb5')](loggerCatch(_0x144f06));this['moveContactManagedDialer'](_0x123cde)[_0x3b90('0xb5')](loggerCatch(_0x455c81));};Dialer[_0x3b90('0x16')][_0x3b90('0x33')]=function(_0x24ca95){var _0x5cfd5f=this[_0x3b90('0x21')][_0x24ca95[_0x3b90('0xe1')]];var _0x22ecb9;if(!_[_0x3b90('0xb1')](_0x24ca95)&&!_[_0x3b90('0xb1')](_0x24ca95[_0x3b90('0xe2')])&&!_['isNil'](_0x24ca95[_0x3b90('0xe2')][_0x3b90('0xe3')])&&_0x24ca95['exten']===_0x3b90('0xe4')&&_0x5cfd5f){if(_0x5cfd5f[_0x3b90('0x49')]!==_0x3b90('0xb7')&&this[_0x3b90('0x1a')][_0x5cfd5f['queue']][_0x3b90('0xe5')]&&_0x24ca95['value']==='HANGUP'){delete this['uniqueId'][_0x24ca95['uniqueid']];this[_0x3b90('0xb8')](this[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]]);this[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]][_0x3b90('0x5f')]+=0x1;this[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;_0x22ecb9=new Hangup(_0x5cfd5f,_0x24ca95);_0x22ecb9[_0x3b90('0xa8')]=0x12;_0x22ecb9[_0x3b90('0xa9')]='HangupInAMD';_0x22ecb9[_0x3b90('0xe6')]=_0x3b90('0xe7');ami['emit'](_0x3b90('0xe8'),ut['buildObj'](_0x22ecb9,_0x3b90('0xe9')));this['saveInDb'](_0x22ecb9,_0x3b90('0xea'),_0x3b90('0xeb'));}if(_0x5cfd5f['type']!=='ivr'&&this[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]][_0x3b90('0xe5')]&&_0x24ca95['value']===_0x3b90('0xec')){var _0x20154c=this;return new BPromise(function(_0x2aded6,_0x5c2902){delete _0x20154c[_0x3b90('0x21')][_0x24ca95[_0x3b90('0xe1')]];_0x20154c[_0x3b90('0xb8')](_0x20154c[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]]);_0x20154c[_0x3b90('0x1a')][_0x5cfd5f['queue']][_0x3b90('0x5f')]+=0x1;_0x20154c[_0x3b90('0x1a')][_0x5cfd5f['queue']][_0x3b90('0x5e')]+=0x1;var _0x379031=_0x20154c[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]];var _0x5573de=new Hangup(_0x5cfd5f,_0x24ca95);_0x5573de['state']=0x13;_0x5573de[_0x3b90('0xa9')]=_0x3b90('0xed');_0x5573de['membername']='AMD';_0x5573de[_0x3b90('0xee')]+=0x1;_0x5573de[_0x3b90('0xef')]+=0x1;_0x5573de[_0x3b90('0xe9')]=!![];ami['emit'](_0x3b90('0xe8'),ut[_0x3b90('0xf0')](_0x5573de,_0x3b90('0xe9')));_0x20154c[_0x3b90('0xce')](_0x5573de)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xf1')));if(_0x5573de[_0x3b90('0xf2')]+_0x5573de['countcongestionretry']+_0x5573de[_0x3b90('0xf3')]+_0x5573de[_0x3b90('0xf4')]+_0x5573de[_0x3b90('0xf5')]+_0x5573de[_0x3b90('0xf6')]+_0x5573de[_0x3b90('0xee')]+_0x5573de[_0x3b90('0xf7')]>=_0x379031['dialGlobalMaxRetry']){_0x20154c['stateGlobal'](_0x5573de,_0x2aded6,_0x5c2902,_0x3b90('0xf8'));}else{if(_0x5573de[_0x3b90('0xee')]>=_0x379031[_0x3b90('0xf9')]){_0x20154c[_0x3b90('0xfa')](_0x5573de,_0x2aded6,_0x5c2902,_0x3b90('0xfb'));}else{_0x20154c['rescheduleContact']({'active':![],'countmachineretry':_0x5573de[_0x3b90('0xee')],'scheduledat':moment()[_0x3b90('0xfc')](_0x379031['dialMachineRetryFrequency'],_0x3b90('0xfd'))[_0x3b90('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5573de[_0x3b90('0xd6')],'ListId':_0x5573de[_0x3b90('0xd7')],'VoiceQueueId':_0x5573de['VoiceQueueId']||undefined,'CampaignId':_0x5573de['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x2aded6({'reschedule':0x1});}}});}if(_0x5cfd5f[_0x3b90('0x49')]===_0x3b90('0xb7')&&this[_0x3b90('0x1b')][_0x5cfd5f['queue']][_0x3b90('0xe5')]&&_0x24ca95[_0x3b90('0xfe')]===_0x3b90('0xff')){delete this[_0x3b90('0x21')][_0x24ca95[_0x3b90('0xe1')]];this[_0x3b90('0xb8')](this['campaigns'][_0x5cfd5f[_0x3b90('0xb9')]]);_0x22ecb9=new Hangup(_0x5cfd5f,_0x24ca95);_0x22ecb9['state']=0x12;_0x22ecb9[_0x3b90('0xa9')]=_0x3b90('0x100');_0x22ecb9['membername']='AMD';ami[_0x3b90('0x48')](_0x3b90('0xe8'),ut[_0x3b90('0xf0')](_0x22ecb9,_0x3b90('0xe9')));this[_0x3b90('0xd4')](_0x22ecb9,_0x3b90('0x101'),_0x3b90('0x102'));}if(_0x5cfd5f[_0x3b90('0x49')]===_0x3b90('0xb7')&&this[_0x3b90('0x1b')][_0x5cfd5f[_0x3b90('0xb9')]][_0x3b90('0xe5')]&&_0x24ca95['value']===_0x3b90('0xec')){var _0x20154c=this;return new BPromise(function(_0x318679,_0x462a16){delete _0x20154c[_0x3b90('0x21')][_0x24ca95[_0x3b90('0xe1')]];_0x20154c['updateOriginated'](_0x20154c[_0x3b90('0x1b')][_0x5cfd5f[_0x3b90('0xb9')]]);_0x20154c[_0x3b90('0x1b')][_0x5cfd5f['queue']][_0x3b90('0x5f')]+=0x1;_0x20154c[_0x3b90('0x1b')][_0x5cfd5f['queue']][_0x3b90('0x5e')]+=0x1;var _0x120d0b=_0x20154c[_0x3b90('0x1b')][_0x5cfd5f[_0x3b90('0xb9')]];var _0x51ca31=new Hangup(_0x5cfd5f,_0x24ca95);_0x51ca31[_0x3b90('0xa8')]=0x13;_0x51ca31[_0x3b90('0xa9')]=_0x3b90('0xed');_0x51ca31[_0x3b90('0xe6')]='AMD';_0x51ca31[_0x3b90('0xee')]+=0x1;_0x51ca31[_0x3b90('0xef')]+=0x1;_0x51ca31[_0x3b90('0xe9')]=!![];ami[_0x3b90('0x48')](_0x3b90('0xe8'),ut[_0x3b90('0xf0')](_0x51ca31,_0x3b90('0xe9')));_0x20154c[_0x3b90('0xce')](_0x51ca31)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xf1')));if(_0x51ca31[_0x3b90('0xf2')]+_0x51ca31[_0x3b90('0x103')]+_0x51ca31[_0x3b90('0xf3')]+_0x51ca31[_0x3b90('0xf4')]+_0x51ca31[_0x3b90('0xf5')]+_0x51ca31[_0x3b90('0xf6')]+_0x51ca31[_0x3b90('0xee')]+_0x51ca31['countagentrejectretry']>=_0x120d0b[_0x3b90('0x104')]){_0x20154c['stateGlobal'](_0x51ca31,_0x318679,_0x462a16,_0x3b90('0xf8'));}else{if(_0x51ca31[_0x3b90('0xee')]>=_0x120d0b[_0x3b90('0xf9')]){_0x20154c[_0x3b90('0xfa')](_0x51ca31,_0x318679,_0x462a16,_0x3b90('0xfb'));}else{_0x20154c[_0x3b90('0xc6')]({'active':![],'countmachineretry':_0x51ca31[_0x3b90('0xee')],'scheduledat':moment()[_0x3b90('0xfc')](_0x120d0b[_0x3b90('0x105')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x51ca31['ContactId'],'ListId':_0x51ca31['ListId'],'VoiceQueueId':_0x51ca31[_0x3b90('0xd9')]||undefined,'CampaignId':_0x51ca31['CampaignId']||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x107')));_0x318679({'reschedule':0x1});}}});}}};Dialer[_0x3b90('0x16')][_0x3b90('0x30')]=function(_0x43ddbc){var _0x28b84b=this['uniqueId'][_0x43ddbc[_0x3b90('0xe1')]];var _0xa9ddfb=this;var _0x33b794;if(_0x28b84b&&_0x28b84b[_0x3b90('0x49')]===_0x3b90('0xb7')){delete this[_0x3b90('0x21')][_0x43ddbc[_0x3b90('0xe1')]];this['updateOriginated'](this['campaigns'][_0x28b84b[_0x3b90('0xb9')]]);this[_0x3b90('0x1b')][_0x28b84b[_0x3b90('0xb9')]]['ivrAnswerCallsDay']+=0x1;_0x33b794=new Hangup(_0x28b84b,_0x43ddbc);this[_0x3b90('0xce')](_0x33b794)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x108')));this[_0x3b90('0x109')](_0x33b794)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x10a')));}if(_0x28b84b&&_0x28b84b[_0x3b90('0x49')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x28b84b[_0x3b90('0xb9')]][_0x3b90('0x10b')])){delete this[_0x3b90('0x21')][_0x43ddbc[_0x3b90('0xe1')]];this[_0x3b90('0xb8')](this[_0x3b90('0x1a')][_0x28b84b[_0x3b90('0xb9')]]);this['voiceQueues'][_0x28b84b[_0x3b90('0xb9')]]['outboundAnswerCallsDay']+=0x1;this[_0x3b90('0x1a')][_0x28b84b[_0x3b90('0xb9')]][_0x3b90('0x5e')]+=0x1;_0x33b794=new Hangup(_0x28b84b,_0x43ddbc);_0x33b794['state']=0x10;_0x33b794[_0x3b90('0xa9')]='AnswerAGI';_0x33b794[_0x3b90('0xe6')]=_0x3b90('0x10c');this[_0x3b90('0xce')](_0x33b794)[_0x3b90('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x3b90('0x109')](_0x33b794)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x10a')));}if(_0x28b84b&&_0x28b84b['type']!==_0x3b90('0xb7')&&!isNotNull(this[_0x3b90('0x1a')][_0x28b84b[_0x3b90('0xb9')]][_0x3b90('0x10b')])){delete this[_0x3b90('0x21')][_0x43ddbc[_0x3b90('0xe1')]];this[_0x3b90('0xb8')](this['voiceQueues'][_0x28b84b['queue']]);this[_0x3b90('0x1a')][_0x28b84b[_0x3b90('0xb9')]][_0x3b90('0x67')]+=0x1;_0x33b794=new Hangup(_0x28b84b,_0x43ddbc);_0x33b794['state']=0xc;_0x33b794[_0x3b90('0xa9')]=_0x43ddbc[_0x3b90('0x10d')];_0x33b794[_0x3b90('0xe6')]='Unknow';this[_0x3b90('0xce')](_0x33b794)[_0x3b90('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x3b90('0x109')](_0x33b794)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x10a')));}};Dialer[_0x3b90('0x16')][_0x3b90('0x10e')]=function(_0x13dff3){var _0x4ecc08=this[_0x3b90('0x21')][_0x13dff3['uniqueid']];var _0x226293=this;if(this[_0x3b90('0x1a')][_0x13dff3['queue']]){if(_0x4ecc08&&_0x4ecc08[_0x3b90('0x49')]!=='ivr'){delete this[_0x3b90('0x21')][_0x13dff3[_0x3b90('0xe1')]];this[_0x3b90('0x1a')][_0x13dff3[_0x3b90('0xb9')]][_0x3b90('0x5f')]+=0x1;var _0x4f8201=new AgentComplete(_0x4ecc08,_0x13dff3);if(_0x13dff3[_0x3b90('0x10f')]==='agent'){_0x4f8201[_0x3b90('0x110')]=this['voiceQueues'][_0x13dff3[_0x3b90('0xb9')]][_0x3b90('0x111')]&&this[_0x3b90('0x1a')][_0x13dff3[_0x3b90('0xb9')]][_0x3b90('0x112')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x3b90('0xce')](_0x4f8201)['catch'](loggerCatch(_0x3b90('0x113')));this[_0x3b90('0x109')](_0x4f8201)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x114')));}}};Dialer[_0x3b90('0x16')][_0x3b90('0x29')]=function(_0x128990){if(this[_0x3b90('0x1a')][_0x128990[_0x3b90('0xb9')]]){if(this[_0x3b90('0x21')][_0x128990[_0x3b90('0xe1')]]&&this[_0x3b90('0x21')][_0x128990[_0x3b90('0xe1')]][_0x3b90('0x49')]!=='ivr'){this[_0x3b90('0xb8')](this[_0x3b90('0x1a')][_0x128990[_0x3b90('0xb9')]]);this[_0x3b90('0x21')][_0x128990[_0x3b90('0xe1')]]['answertime']=moment()[_0x3b90('0x79')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x3b90('0x16')]['queueCallerAbandonCreateState']=function(_0x830544){this[_0x3b90('0xce')](_0x830544)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x113')));this[_0x3b90('0x109')](_0x830544)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x115')));};Dialer[_0x3b90('0x16')][_0x3b90('0x2b')]=function(_0xeb49f3){var _0x22af83=this[_0x3b90('0x21')][_0xeb49f3['uniqueid']];var _0x16172c=this;if(this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]]){if(_0x22af83&&_0x22af83[_0x3b90('0x49')]!==_0x3b90('0xb7')){delete this[_0x3b90('0x21')][_0xeb49f3['uniqueid']];this[_0x3b90('0xb8')](this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]]);_0x22af83[_0x3b90('0x116')]=moment()[_0x3b90('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x34f649=new QueueCallerAbandon(_0x22af83,_0xeb49f3);if(getSeconds(_0x22af83[_0x3b90('0x116')],_0x22af83[_0x3b90('0x117')])>=_0x22af83['dialQueueTimeout']){this['voiceQueues'][_0xeb49f3['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x64')]+=0x1;this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x6d')]+=0x1;_0x34f649['state']=0xa;_0x34f649[_0x3b90('0xa9')]=_0x3b90('0x118');_0x34f649[_0x3b90('0x119')]=_0x3b90('0x11a');_0x34f649[_0x3b90('0x110')]=this['voiceQueues'][_0xeb49f3['queue']][_0x3b90('0x111')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x34f649[_0x3b90('0xf5')]+=0x1;_0x34f649[_0x3b90('0xef')]+=0x1;if(_0x34f649['countdropretry']>=this['voiceQueues'][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x11b')]){this[_0x3b90('0x11c')](_0x34f649);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x34f649[_0x3b90('0xf5')],'scheduledat':moment()['add'](this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x11d')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x22af83[_0x3b90('0xd6')],'ListId':_0x22af83['ListId'],'VoiceQueueId':_0x22af83[_0x3b90('0xd9')]||undefined,'CampaignId':_0x22af83[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x11e')));var _0x4deff2=new History(_0x34f649);_0x4deff2[_0x3b90('0xa8')]=0xa;_0x4deff2['statedesc']=_0x3b90('0x118');_0x4deff2[_0x3b90('0xab')]=moment()[_0x3b90('0x79')](_0x3b90('0x106'));_0x4deff2[_0x3b90('0xaa')]=_0x4deff2[_0x3b90('0xab')];_0x4deff2['calleridname']=_0x34f649['calleridname'];_0x4deff2[_0x3b90('0x11f')]=_0x34f649[_0x3b90('0x11f')];this[_0x3b90('0xce')](_0x4deff2)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x120')));}}else{this['voiceQueues'][_0xeb49f3['queue']][_0x3b90('0x6a')]+=0x1;this[_0x3b90('0x1a')][_0xeb49f3['queue']][_0x3b90('0x63')]+=0x1;_0x34f649[_0x3b90('0xa8')]=0xb;_0x34f649[_0x3b90('0xa9')]=_0x3b90('0x121');_0x34f649['dropreason']='CALLEREXIT';_0x34f649['countabandonedretry']+=0x1;_0x34f649[_0x3b90('0xef')]+=0x1;if(_0x34f649[_0x3b90('0xf6')]>=this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x122')]){this[_0x3b90('0x11c')](_0x34f649);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x34f649[_0x3b90('0xf6')],'scheduledat':moment()[_0x3b90('0xfc')](this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x123')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x22af83[_0x3b90('0xd6')],'ListId':_0x22af83[_0x3b90('0xd7')],'VoiceQueueId':_0x22af83['VoiceQueueId']||undefined,'CampaignId':_0x22af83[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x124')));var _0x4deff2=new History(_0x34f649);_0x4deff2['state']=0xb;_0x4deff2[_0x3b90('0xa9')]=_0x3b90('0x121');_0x4deff2[_0x3b90('0xab')]=moment()[_0x3b90('0x79')](_0x3b90('0x106'));_0x4deff2['endtime']=_0x4deff2[_0x3b90('0xab')];_0x4deff2[_0x3b90('0x125')]=_0x34f649[_0x3b90('0x125')];_0x4deff2[_0x3b90('0x11f')]=_0x34f649[_0x3b90('0x11f')];this[_0x3b90('0xce')](_0x4deff2)[_0x3b90('0xb5')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x3b90('0x16')]['syncNewExten']=function(_0x18e6b3){if(this['actions'][_0x18e6b3[_0x3b90('0xe1')]]){this[_0x3b90('0xae')][_0x18e6b3[_0x3b90('0xe1')]][_0x3b90('0xb4')]=_0x18e6b3[_0x3b90('0xb4')];}if(this['uniqueId'][_0x18e6b3[_0x3b90('0xe1')]]){this[_0x3b90('0x21')][_0x18e6b3['uniqueid']][_0x3b90('0xb4')]=_0x18e6b3[_0x3b90('0xb4')];}};Dialer['prototype'][_0x3b90('0x35')]=function(_0x75317){if(strategy[this[_0x3b90('0x1a')][this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]][_0x3b90('0xb9')]]['strategy']]===_0x3b90('0x15')){if(this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]]&&_[_0x3b90('0xb1')](this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]][_0x3b90('0x127')])&&_0x75317[_0x3b90('0xb3')]==='1'&&_0x75317['paused']==='0'){if(this[_0x3b90('0x1c')][_0x75317[_0x3b90('0x128')]]){if(!this['agents'][_0x75317['stateinterface']][_0x3b90('0x127')]){this[_0x3b90('0x1c')][_0x75317[_0x3b90('0x128')]][_0x3b90('0x127')]=!![];this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]]['locked']=!![];this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]][_0x3b90('0x128')]=_0x75317[_0x3b90('0x128')];}}}}else if((strategy[this[_0x3b90('0x1a')][this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]][_0x3b90('0xb9')]]['strategy']]||'rrmemory')===_0x3b90('0x129')){if(this['actions'][_0x75317['actionid']]){if(this[_0x3b90('0x1c')][_0x75317[_0x3b90('0x128')]]){this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]]['stateinterface']=_0x75317[_0x3b90('0x128')];if(_[_0x3b90('0xb1')](this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]]['queue']])){this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x75317['actionid']][_0x3b90('0xb9')]]=[];}this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]]['queue']][_0x3b90('0x12a')](_[_0x3b90('0x8f')](_['pick'](this['actions'][_0x75317[_0x3b90('0x126')]],['idHopper',_0x3b90('0x128')]),{'status':_0x75317[_0x3b90('0xb3')],'paused':_0x75317[_0x3b90('0x12b')]}));}}}};function unlockQueueStatus(_0x32f360,_0x36c28d){setTimeout(function(){if(_[_0x3b90('0x39')](_0x32f360[_0x3b90('0x12c')])){loggerBooked['error'](_0x3b90('0x12d'),_0x36c28d);}_0x32f360[_0x3b90('0x12c')]=!![];loggerBooked[_0x3b90('0x7d')](_0x3b90('0x12e'),_0x36c28d,JSON['stringify'](_['pick'](_0x32f360,['name','queueStatusComplete'])));},0x1f3);}Dialer[_0x3b90('0x16')][_0x3b90('0x12f')]=function(_0x398543){var _0x4f9f83=this;var _0x1cc644=_0x4f9f83[_0x3b90('0x1a')][_0x4f9f83[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]]['queue']];if(strategy[this[_0x3b90('0x1a')][this[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0xb9')]][_0x3b90('0x4b')]]===_0x3b90('0x15')){if(this[_0x3b90('0xae')][_0x398543['actionid']]&&this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0x128')]){this[_0x3b90('0x19')][_0x3b90('0x130')](this[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0x131')],this['actions'][_0x398543[_0x3b90('0x126')]][_0x3b90('0x128')])[_0x3b90('0xb5')](function(_0x446f73){logger['error'](_0x3b90('0x132'),util['inspect'](_0x446f73,{'showHidden':![],'depth':null}));})[_0x3b90('0x18')](function(){_0x4f9f83[_0x3b90('0xb8')](_0x4f9f83[_0x3b90('0x1a')][_0x4f9f83['actions'][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]);_0x4f9f83[_0x3b90('0x1c')][_0x4f9f83['actions'][_0x398543['actionid']][_0x3b90('0x128')]][_0x3b90('0x127')]=![];delete _0x4f9f83[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]];unlockQueueStatus(_0x1cc644);});}else{this[_0x3b90('0xb8')](this['voiceQueues'][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]);this[_0x3b90('0xc6')]({'active':![],'ContactId':this[_0x3b90('0xae')][_0x398543['actionid']]['ContactId'],'ListId':this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xd7')],'VoiceQueueId':this[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0xd9')]||undefined,'CampaignId':this[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x133')));delete this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]];unlockQueueStatus(_0x1cc644);}}else if((strategy[this[_0x3b90('0x1a')][this['actions'][_0x398543[_0x3b90('0x126')]]['queue']]['strategy']]||'rrmemory')===_0x3b90('0x129')){var _0x3be8c3;if(this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]]&&!_['isEmpty'](this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]])){if(this['queueBookedRR'][_0x4f9f83[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]){this[_0x3b90('0x27')][_0x4f9f83[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]=this['queueBookedRR'][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]?this[_0x3b90('0x27')][this['actions'][_0x398543[_0x3b90('0x126')]]['queue']]:this[_0x3b90('0x26')][this['actions'][_0x398543['actionid']][_0x3b90('0xb9')]]?this['queueBooked'][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]][_0x3b90('0x134')]||0x0:0x0;}this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]]['queue']][_0x3b90('0x134')]=this[_0x3b90('0x27')][this['actions'][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]];for(var _0x512237=0x0;_0x512237=0x0;})[_0x3b90('0xb5')](myreject(_0x19b08c)));}}else{_0x2fc745['push'](ami[_0x3b90('0xb2')]({'action':_0x3b90('0x148'),'command':util[_0x3b90('0x79')](_0x3b90('0x149'),_0x4f4e1a,!_[_0x3b90('0x39')](config['timezones'][_0x2379b0])?_0x2379b0:'')})[_0x3b90('0xbe')](function(_0x3b1ba8){return _0x3b1ba8[_0x3b90('0x14d')][_0x3b90('0x14b')](_0x3b90('0x14c'))>=0x0;})[_0x3b90('0xb5')](myreject(_0x19b08c)));}BPromise[_0x3b90('0x14e')](_0x2fc745)['then'](function(_0x138961){var _0x586ed1=_[_0x3b90('0x14f')](_0x138961);if(_0x586ed1){return _0x1c9e3d(_0x586ed1);}else{_0x5e69e9['message']=_0xc31b3a?_0x3b90('0x150'):_0x3b90('0x151');return _0x19b08c(msgResponse(_0x3b90('0x152'),_0x3b90('0x142'),_0x3b90('0x153')+_0xc31b3a+'\x20'+_0x19c2b9+'\x20Interval\x20is\x20overtime:\x20'+util[_0x3b90('0x97')](_0x4f4e1a,{'showHidden':![],'depth':null})+_0x3b90('0x154')+_0x2379b0));}})['catch'](function(_0x4b6f7d){return _0x19b08c(msgResponse('ifTime','Failure',JSON[_0x3b90('0x44')](_0x4b6f7d)));});});};Dialer[_0x3b90('0x16')][_0x3b90('0x155')]=function(_0x59b261){var _0x5deb87=this;return function(){switch(_0x59b261[_0x3b90('0x59')]){case _0x3b90('0x156'):freeVariablesPredictive(_0x59b261);_0x5deb87[_0x3b90('0x157')](_0x59b261,0x1);break;case'power':freeVariablesPredictive(_0x59b261);_0x5deb87[_0x3b90('0x157')](_0x59b261,_0x59b261['dialPowerLevel']);break;case _0x3b90('0x158'):_0x5deb87[_0x3b90('0x158')](_0x59b261);break;case _0x3b90('0x159'):freeVariablesPredictive(_0x59b261);_0x5deb87[_0x3b90('0x157')](_0x59b261,0x1);break;default:freeVariablesPredictive(_0x59b261);logger[_0x3b90('0x98')]('Queue',_0x59b261[_0x3b90('0x3c')],_0x3b90('0x15a'));}};};Dialer[_0x3b90('0x16')][_0x3b90('0x15b')]=function(_0x114dd0){var _0x31f047=this;return function(){_0x31f047[_0x3b90('0x15c')](_0x114dd0);};};Dialer[_0x3b90('0x16')]['syncQueueSummary']=function(_0x2704ff){var _0x41327b=this;if(isNotPreview(_0x2704ff[_0x3b90('0x59')])){if(isVoiceQueueOutbound(_0x2704ff[_0x3b90('0x49')])&&isActive(_0x2704ff[_0x3b90('0x58')])){_0x2704ff[_0x3b90('0xa1')]=!![];BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](checkIsLoggedIn(_0x2704ff,_0x2704ff[_0x3b90('0x15d')]))[_0x3b90('0xbe')](checkIsActive(_0x2704ff,_0x2704ff[_0x3b90('0x58')]))['then'](checkInterval(_0x2704ff))[_0x3b90('0xbe')](_0x41327b['checkIsTrunkReachable'](_0x2704ff))[_0x3b90('0xbe')](_0x41327b[_0x3b90('0x140')](_0x2704ff[_0x3b90('0x15e')],_0x2704ff[_0x3b90('0x15f')],_0x2704ff[_0x3b90('0x3c')],_0x2704ff))['then'](_0x41327b[_0x3b90('0x160')](_0x2704ff[_0x3b90('0x3f')],_0x2704ff[_0x3b90('0x15f')],_0x2704ff[_0x3b90('0x3c')],_0x2704ff))[_0x3b90('0xbe')](_0x41327b[_0x3b90('0x155')](_0x2704ff))[_0x3b90('0xb5')](loggerCatchQueueSummary(_0x3b90('0x161'),_0x2704ff));}else{notSendMessagesQueue(_0x2704ff);}}else{freeVariablesPredictive(_0x2704ff);}};Dialer['prototype'][_0x3b90('0x162')]=function(){var _0x239b4d=this;var _0x2dd479;for(var _0x404eab in this['campaigns']){if(typeof this['campaigns'][_0x404eab]!==_0x3b90('0x9a')){_0x2dd479=this[_0x3b90('0x1b')][_0x404eab];if(isCampaignIvr(_0x2dd479[_0x3b90('0x49')])&&isActive(_0x2dd479['active'])){_0x2dd479[_0x3b90('0xa1')]=!![];BPromise['resolve']()[_0x3b90('0xbe')](checkIsActive(_0x2dd479,_0x2dd479[_0x3b90('0x77')]))[_0x3b90('0xbe')](checkInterval(_0x2dd479))[_0x3b90('0xbe')](_0x239b4d[_0x3b90('0x13d')](_0x2dd479))[_0x3b90('0xbe')](_0x239b4d['checkIfTime'](_0x2dd479[_0x3b90('0x15e')],_0x2dd479[_0x3b90('0x15f')],_0x2dd479[_0x3b90('0x3c')],_0x2dd479))[_0x3b90('0xbe')](_0x239b4d[_0x3b90('0x160')](_0x2dd479['Interval'],_0x2dd479[_0x3b90('0x15f')],_0x2dd479[_0x3b90('0x3c')],_0x2dd479))[_0x3b90('0xbe')](_0x239b4d[_0x3b90('0x15b')](_0x2dd479))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x2dd479));}else{notSendMessagesCampaign(_0x2dd479);}}}};function getCallerIdRandom(_0x58831d,_0xfc122b){var _0x414c1a;var _0x47ee55;var _0x5b7ecd;if(_0xfc122b<=0x0){_0xfc122b=0x1;}_0x414c1a=new RegExp(_0x3b90('0x163')+_0xfc122b+'}$');_0x47ee55=Math[_0x3b90('0x164')](0xa,_0xfc122b-0x1);_0x5b7ecd=Math[_0x3b90('0x164')](0xa,_0xfc122b)-0x1;return util[_0x3b90('0x79')]('%s',_[_0x3b90('0x165')](_0x58831d,_0x414c1a,_[_0x3b90('0x166')](_0x47ee55,_0x5b7ecd)));}function extractCalleridName(_0x554674){var _0x34f95c=_0x554674[_0x3b90('0x167')](/"(.*?)"/);return _0x34f95c?_0x34f95c[0x1]:_0x554674;}function extractCalleridNumber(_0x1f8d1c){var _0x421108=_0x1f8d1c[_0x3b90('0x167')](/<(.*?)>/);return _0x421108?_0x421108[0x1]:_0x1f8d1c;}Dialer[_0x3b90('0x16')]['actionOriginate']=function(_0x4abe4c,_0x1b61df){var _0x32d2e8=this;var _0x240aeb=uuid['v4']();this[_0x3b90('0xae')][_0x240aeb]=new Action(_0x4abe4c,_0x1b61df,_0x240aeb);return new BPromise(function(_0x5eb94d,_0x354bdb){if(_['isUndefined'](_0x4abe4c)&&typeof _0x4abe4c!==_0x3b90('0x168')){return _0x354bdb(msgResponse(_0x3b90('0x169'),_0x3b90('0x142'),_0x3b90('0x16a')));}if(_[_0x3b90('0x39')](_0x1b61df[_0x3b90('0x16b')][_0x3b90('0x16c')])||_0x1b61df['Contact']['phone']===null){return _0x354bdb(msgResponse(_0x3b90('0x169'),_0x3b90('0x142'),'contact\x20is\x20undefine'));}var _0x1621b2={'XMD-CALLERID':_0x32d2e8['actions'][_0x240aeb][_0x3b90('0x16d')](),'XMD-AGI':_0x4abe4c[_0x3b90('0x10b')]?util[_0x3b90('0x79')](_0x3b90('0x16e'),ipAgi,_0x4abe4c['dialQueueProject']):_0x3b90('0x16f'),'XMD-AGIAFTER':_0x4abe4c[_0x3b90('0x111')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x4abe4c[_0x3b90('0x111')]):'NONE','XMD-QUEUE':_0x4abe4c['type']==='outbound'?util['format'](_0x3b90('0x170'),_0x4abe4c[_0x3b90('0x3c')],_0x4abe4c[_0x3b90('0x171')]||'',_0x4abe4c[_0x3b90('0x112')]?'c':'',_0x4abe4c[_0x3b90('0x172')]||0x3):'NONE','XMD-CONTACTID':_0x1b61df[_0x3b90('0xd6')],'XMD-CDRTYPE':_0x3b90('0x9'),'CALLERID(all)':_0x32d2e8[_0x3b90('0xae')][_0x240aeb][_0x3b90('0x16d')](),'XMD-AMD':_0x4abe4c[_0x3b90('0xe5')]?_0x3b90('0x173'):_0x3b90('0x16f'),'XMD-DESTINATION':_0x3b90('0xe4')};if(_0x4abe4c['dialAMDActive']){_0x1621b2['XMD-AMDINITIALSILENCE']=_0x4abe4c['dialAMDInitialSilence']||0x9c4;_0x1621b2[_0x3b90('0x174')]=_0x4abe4c[_0x3b90('0x175')]||0x5dc;_0x1621b2[_0x3b90('0x176')]=_0x4abe4c[_0x3b90('0x177')]||0x320;_0x1621b2[_0x3b90('0x178')]=_0x4abe4c[_0x3b90('0x179')]||0x1388;_0x1621b2[_0x3b90('0x17a')]=_0x4abe4c[_0x3b90('0x17b')]||0x64;_0x1621b2[_0x3b90('0x17c')]=_0x4abe4c[_0x3b90('0x17d')]||0x32;_0x1621b2[_0x3b90('0x17e')]=_0x4abe4c[_0x3b90('0x17f')]||0x3;_0x1621b2[_0x3b90('0x180')]=_0x4abe4c[_0x3b90('0x181')]||0x100;_0x1621b2[_0x3b90('0x182')]=_0x4abe4c['dialAMDMaximumWordLength']||0x1388;}if(_0x4abe4c[_0x3b90('0x49')]===_0x3b90('0x4a')){_0x1621b2['XMD-VOICEQUEUEID']=_0x1b61df[_0x3b90('0xd9')];}else{_0x1621b2[_0x3b90('0x183')]=_0x1b61df[_0x3b90('0xda')];}for(var _0x1ebbde in _0x1b61df[_0x3b90('0x16b')]){if(typeof _0x1b61df[_0x3b90('0x16b')][_0x1ebbde]!=='undefined'){if(isNotNull(_0x1b61df[_0x3b90('0x16b')][_0x1ebbde])&&_0x1ebbde!=='id'&&_0x1ebbde!==_0x3b90('0x184')&&_0x1ebbde!=='createdAt'&&_0x1ebbde!==_0x3b90('0x185')){_0x1621b2[util[_0x3b90('0x79')]('%s%s',_0x3b90('0x186'),_[_0x3b90('0x187')](_0x1ebbde))]=_0x1b61df['Contact'][_0x1ebbde];}}}var _0x52a2d1=_0x32d2e8[_0x3b90('0xdd')](_0x4abe4c[_0x3b90('0x76')])?getCallerId(_0x4abe4c['Trunk']['callerid'],_0x4abe4c[_0x3b90('0x5a')],_0x4abe4c['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4abe4c[_0x3b90('0x5b')],_0x4abe4c['dialRandomLastDigitCallerIdNumber']):_0x4abe4c['dialOriginateCallerIdNumber']):getCallerId(_[_0x3b90('0xb1')](_0x4abe4c['TrunkBackup'])?_0x4abe4c[_0x3b90('0x76')]['callerid']:_0x4abe4c[_0x3b90('0x13e')][_0x3b90('0x78')],_0x4abe4c[_0x3b90('0x5a')],_0x4abe4c[_0x3b90('0x188')]>0x0?getCallerIdRandom(_0x4abe4c[_0x3b90('0x5b')],_0x4abe4c['dialRandomLastDigitCallerIdNumber']):_0x4abe4c[_0x3b90('0x5b')]);if(_0x52a2d1){_0x1621b2[_0x3b90('0x189')]=_0x32d2e8[_0x3b90('0xae')][_0x240aeb][_0x3b90('0x18a')]=extractCalleridName(_0x52a2d1);_0x1621b2[_0x3b90('0x18b')]=_0x32d2e8['actions'][_0x240aeb][_0x3b90('0x18c')]=extractCalleridNumber(_0x52a2d1);}return ami[_0x3b90('0xb2')]({'actionid':_0x240aeb,'action':_0x3b90('0x169'),'channel':_0x32d2e8[_0x3b90('0xdd')](_0x4abe4c[_0x3b90('0x76')])?util['format'](_0x3b90('0x18d'),_0x4abe4c[_0x3b90('0x76')][_0x3b90('0x3c')],isNotNull(_0x4abe4c[_0x3b90('0x5d')])?_0x4abe4c[_0x3b90('0x5d')][_0x3b90('0x18e')]()||'':'',_0x4abe4c[_0x3b90('0x18f')]>0x0?_0x1b61df[_0x3b90('0x16b')][_0x3b90('0x16c')][_0x3b90('0x190')](_0x4abe4c[_0x3b90('0x18f')]):_0x1b61df[_0x3b90('0x16b')]['phone']):util['format'](_0x3b90('0x18d'),_[_0x3b90('0xb1')](_0x4abe4c[_0x3b90('0x13e')])?_0x4abe4c['Trunk'][_0x3b90('0x3c')]:_0x4abe4c[_0x3b90('0x13e')][_0x3b90('0x3c')],isNotNull(_0x4abe4c[_0x3b90('0x5d')])?_0x4abe4c[_0x3b90('0x5d')][_0x3b90('0x18e')]()||'':'',_0x4abe4c[_0x3b90('0x18f')]>0x0?_0x1b61df[_0x3b90('0x16b')]['phone']['substring'](_0x4abe4c[_0x3b90('0x18f')]):_0x1b61df['Contact'][_0x3b90('0x16c')]),'callerid':_0x52a2d1,'Exten':_0x3b90('0xe4'),'Context':_0x3b90('0x191'),'Priority':'1','variable':_0x1621b2,'timeout':(_0x4abe4c[_0x3b90('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x240aeb})[_0x3b90('0xbe')](function(_0x1b35a0){return _0x5eb94d(_0x1b35a0);})[_0x3b90('0xb5')](function(_0x76b7ae){_0x4abe4c[_0x3b90('0x66')]+=0x1;var _0xadce26=new History(_0x32d2e8[_0x3b90('0xae')][_0x240aeb]);logger[_0x3b90('0x98')](util[_0x3b90('0x79')](_0x3b90('0x192'),JSON[_0x3b90('0x44')](_0x76b7ae)));_0xadce26[_0x3b90('0xa8')]=0xe;_0xadce26['statedesc']=_0x3b90('0x193');_0xadce26[_0x3b90('0xab')]=moment()[_0x3b90('0x79')](_0x3b90('0x106'));_0xadce26[_0x3b90('0xaa')]=_0xadce26[_0x3b90('0xab')];_0x32d2e8[_0x3b90('0xce')](_0xadce26)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x194')));_0x32d2e8[_0x3b90('0x109')](_0xadce26)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x194')))[_0x3b90('0x18')](function(){delete _0x32d2e8[_0x3b90('0xae')][_0x240aeb];return _0x354bdb(msgResponse(_0x3b90('0x169'),_0x3b90('0x43'),_0x3b90('0x195')));});});});};Dialer[_0x3b90('0x16')][_0x3b90('0x2e')]=function(_0x1e0d53){var _0x47d7db=this[_0x3b90('0xae')][_0x1e0d53['actionid']];if(_0x47d7db){delete this[_0x3b90('0xae')][_0x1e0d53['actionid']];_0x47d7db[_0x3b90('0x117')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x596c4e=_0x47d7db[_0x3b90('0x49')]===_0x3b90('0xb7')?this['campaigns'][_0x47d7db[_0x3b90('0xb9')]]:this[_0x3b90('0x1a')][_0x47d7db[_0x3b90('0x196')]()];if(!this['isSuccess'](_0x1e0d53[_0x3b90('0x197')])){this['updateOriginated'](_0x596c4e);return this[_0x3b90('0x198')](_0x47d7db,_0x596c4e,_0x1e0d53)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x199')));}this[_0x3b90('0x21')][_0x1e0d53[_0x3b90('0xe1')]]=_0x47d7db;}};Dialer[_0x3b90('0x16')][_0x3b90('0x19a')]=function(_0x2219e3,_0x57ac38,_0x14f171){var _0x169ff9=new History(_0x57ac38);if(_0x169ff9['countbusyretry']+_0x169ff9['countcongestionretry']+_0x169ff9[_0x3b90('0xf3')]+_0x169ff9[_0x3b90('0xf4')]+_0x169ff9[_0x3b90('0xf5')]+_0x169ff9[_0x3b90('0xf6')]+_0x169ff9[_0x3b90('0xee')]+_0x169ff9[_0x3b90('0xf7')]>=_0x14f171[_0x3b90('0x104')]-0x1){return!![];}switch(_0x2219e3){case 0x3:if(_0x169ff9[_0x3b90('0xf3')]>=_0x14f171['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x3b90('0xc6')]({'active':![],'countnoanswerretry':_0x169ff9[_0x3b90('0xf3')]+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171['dialNoAnswerRetryFrequency'],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9['ContactId'],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9['VoiceQueueId']||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x19b')));break;case 0x5:if(_0x169ff9[_0x3b90('0xf2')]>=_0x14f171[_0x3b90('0x19c')]-0x1){return!![];}this[_0x3b90('0xc6')]({'active':![],'countbusyretry':_0x169ff9[_0x3b90('0xf2')]+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171[_0x3b90('0x19d')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x19e')));break;case 0x8:if(_0x169ff9[_0x3b90('0x103')]>=_0x14f171[_0x3b90('0x19f')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x169ff9['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x14f171[_0x3b90('0x1a0')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x1a1')));break;case 0x0:if(_0x169ff9[_0x3b90('0xf4')]>=_0x14f171['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x3b90('0xc6')]({'active':![],'countnosuchnumberretry':_0x169ff9[_0x3b90('0xf4')]+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171[_0x3b90('0x1a2')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9['ListId'],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})['catch'](loggerCatch(_0x3b90('0x1a3')));}break;case 0xa:if(_0x169ff9[_0x3b90('0xf5')]>=_0x14f171['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x169ff9[_0x3b90('0xf5')]+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171[_0x3b90('0x11d')],'minutes')[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x11e')));break;case 0xb:if(_0x169ff9[_0x3b90('0xf6')]>=_0x14f171[_0x3b90('0x122')]-0x1){return!![];}this[_0x3b90('0xc6')]({'active':![],'countabandonedretry':_0x169ff9[_0x3b90('0xf6')]+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171[_0x3b90('0x123')],_0x3b90('0xfd'))['format'](_0x3b90('0x106')),'ContactId':_0x169ff9['ContactId'],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x124')));break;case 0x13:if(_0x169ff9['countmachineretry']>=_0x14f171[_0x3b90('0xf9')]-0x1){return!![];}this[_0x3b90('0xc6')]({'active':![],'countmachineretry':_0x169ff9[_0x3b90('0xee')]+=0x1,'scheduledat':moment()['add'](_0x14f171[_0x3b90('0x105')],'minutes')['format'](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x107')));break;case 0x14:if(_0x169ff9[_0x3b90('0xf7')]>=_0x14f171[_0x3b90('0x1a4')]-0x1){return!![];}this[_0x3b90('0xc6')]({'active':![],'countagentrejectretry':_0x169ff9['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171[_0x3b90('0x1a5')],'minutes')[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9['ListId'],'VoiceQueueId':_0x169ff9['VoiceQueueId']||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x3b90('0x198')]=function(_0x3dfaba,_0x335d59,_0x17331b){var _0x300e01=this;var _0x539a06=new History(_0x3dfaba);return new BPromise(function(_0xe330a1,_0x5aa167){if(_['isUndefined'](_0x335d59)&&typeof _0x335d59!==_0x3b90('0x168')){return _0x5aa167(msgResponse('[callProgressDetecting]',_0x3b90('0x142'),'entity\x20is\x20undefine'));}if(_[_0x3b90('0x39')](_0x17331b)&&typeof _0x17331b!==_0x3b90('0x168')){return _0x5aa167(msgResponse('[callProgressDetecting]',_0x3b90('0x142'),_0x3b90('0x1a6')));}switch(_0x17331b['reason']){case'0':_0x335d59[_0x3b90('0x1a7')]+=0x1;_0x539a06[_0x3b90('0xa8')]=0x0;_0x539a06['statedesc']=_0x3b90('0x1a8');_0x539a06['countnosuchnumberretry']+=0x1;_0x539a06[_0x3b90('0xef')]+=0x1;ami[_0x3b90('0x48')](_0x3b90('0x1a9'),ut[_0x3b90('0xf0')](_0x3dfaba,_0x3b90('0x1aa')));_0x300e01[_0x3b90('0xce')](_0x539a06)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xf1')));if(_0x300e01[_0x3b90('0x19a')](0x0,_0x3dfaba,_0x335d59)){if(_0x539a06[_0x3b90('0xf4')]>=_0x335d59[_0x3b90('0x1ab')]){_0x300e01['createStateFinal'](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1ac'));}else{_0x300e01['stateGlobal'](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1ac'));}}break;case'3':_0x335d59['outboundNoAnswerCallsDay']+=0x1;_0x539a06[_0x3b90('0xa8')]=0x3;_0x539a06[_0x3b90('0xa9')]=_0x3b90('0x1ad');_0x539a06['countnoanswerretry']+=0x1;_0x539a06[_0x3b90('0xef')]+=0x1;ami[_0x3b90('0x48')](_0x3b90('0x1ae'),ut['buildObj'](_0x3dfaba,_0x3b90('0x1af')));_0x300e01[_0x3b90('0xce')](_0x539a06)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x1b0')));if(_0x300e01[_0x3b90('0x19a')](0x3,_0x3dfaba,_0x335d59)){if(_0x539a06['countnoanswerretry']>=_0x335d59[_0x3b90('0x1b1')]){_0x300e01[_0x3b90('0xfa')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1b2'));}else{_0x300e01['stateGlobal'](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1b2'));}}break;case'5':_0x335d59[_0x3b90('0x61')]+=0x1;_0x539a06[_0x3b90('0xa8')]=0x5;_0x539a06['statedesc']=_0x3b90('0x1b3');_0x539a06[_0x3b90('0xf2')]+=0x1;_0x539a06[_0x3b90('0xef')]+=0x1;ami[_0x3b90('0x48')](_0x3b90('0x1b4'),ut[_0x3b90('0xf0')](_0x3dfaba,_0x3b90('0x1b5')));_0x300e01[_0x3b90('0xce')](_0x539a06)['catch'](loggerCatch(_0x3b90('0x1b6')));if(_0x300e01[_0x3b90('0x19a')](0x5,_0x3dfaba,_0x335d59)){if(_0x539a06[_0x3b90('0xf2')]>=_0x335d59[_0x3b90('0x19c')]){_0x300e01['createStateFinal'](_0x539a06,_0xe330a1,_0x5aa167,'reason\x205\x20busy');}else{_0x300e01[_0x3b90('0x1b7')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1b8'));}}break;case'8':_0x335d59[_0x3b90('0x1b9')]+=0x1;_0x539a06[_0x3b90('0xa8')]=0x8;_0x539a06[_0x3b90('0xa9')]=_0x3b90('0x1ba');_0x539a06[_0x3b90('0x103')]+=0x1;_0x539a06[_0x3b90('0xef')]+=0x1;ami['emit'](_0x3b90('0x1bb'),ut['buildObj'](_0x3dfaba,'congestion'));_0x300e01[_0x3b90('0xce')](_0x539a06)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x1bc')));if(_0x300e01[_0x3b90('0x19a')](0x8,_0x3dfaba,_0x335d59)){if(_0x539a06[_0x3b90('0x103')]>=_0x335d59[_0x3b90('0x19f')]){_0x300e01[_0x3b90('0xfa')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1bd'));}else{_0x300e01[_0x3b90('0x1b7')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1bd'));}}break;case'11':_0x335d59[_0x3b90('0x1be')]+=0x1;_0x539a06[_0x3b90('0xa8')]=0xb;_0x539a06[_0x3b90('0xa9')]='Abandoned';_0x539a06[_0x3b90('0xf6')]+=0x1;_0x539a06[_0x3b90('0xef')]+=0x1;_0x300e01[_0x3b90('0xce')](_0x539a06)['catch'](loggerCatch(_0x3b90('0x1bf')));if(_0x300e01[_0x3b90('0x19a')](0xb,_0x3dfaba,_0x335d59)){if(_0x539a06['countabandonedretry']>=_0x335d59[_0x3b90('0x122')]){_0x300e01['createStateFinal'](_0x539a06,_0xe330a1,_0x5aa167,'reason\x2011\x20abandoned');}else{_0x300e01[_0x3b90('0x1b7')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1c0'));}}break;case'20':_0x335d59[_0x3b90('0x1c1')]+=0x1;_0x539a06['state']=0x14;_0x539a06['statedesc']=_0x3b90('0x1c2');_0x539a06[_0x3b90('0xf7')]+=0x1;_0x539a06['countglobal']+=0x1;ami[_0x3b90('0x48')](_0x3b90('0x1c3'),ut[_0x3b90('0xf0')](_0x3dfaba,'agentreject'));_0x300e01[_0x3b90('0xce')](_0x539a06)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x300e01[_0x3b90('0x19a')](0x14,_0x3dfaba,_0x335d59)){if(_0x539a06[_0x3b90('0xf7')]>=_0x335d59[_0x3b90('0x1a4')]){_0x300e01['createStateFinal'](_0x539a06,_0xe330a1,_0x5aa167,'reason\x2020\x20agentreject');}else{_0x300e01[_0x3b90('0x1b7')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1c4'));}}break;default:_0x335d59[_0x3b90('0x67')]+=0x1;_0x539a06[_0x3b90('0xa8')]=0xc;_0x539a06[_0x3b90('0xa9')]=_0x17331b[_0x3b90('0x10f')];_0x300e01[_0x3b90('0xce')](_0x539a06)[_0x3b90('0xb5')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x300e01[_0x3b90('0x19a')](_0x17331b[_0x3b90('0x10f')],_0x3dfaba,_0x335d59)){if(_0x539a06['countbusyretry']+_0x539a06[_0x3b90('0x103')]+_0x539a06[_0x3b90('0xf3')]+_0x539a06[_0x3b90('0xf4')]+_0x539a06[_0x3b90('0xf5')]+_0x539a06[_0x3b90('0xf6')]+_0x539a06['countmachineretry']+_0x539a06[_0x3b90('0xf7')]>=_0x335d59[_0x3b90('0x104')]){_0x300e01[_0x3b90('0x1b7')](_0x539a06,_0xe330a1,_0x5aa167,_0x17331b['reason']);}else{_0x300e01['createStateFinal'](_0x539a06,_0xe330a1,_0x5aa167,_0x17331b[_0x3b90('0x10f')]);}}}});};Dialer[_0x3b90('0x16')][_0x3b90('0x1b7')]=function(_0x1d86b7,_0x815983,_0xae6a4d,_0x565f64){var _0x5647b2=new Final(_0x1d86b7);_0x5647b2[_0x3b90('0xa8')]=0xf;_0x5647b2[_0x3b90('0xa9')]=_0x3b90('0x1c5');this['createStateFinal'](_0x5647b2,_0x815983,_0xae6a4d,_0x565f64);};Dialer[_0x3b90('0x16')][_0x3b90('0xfa')]=function(_0x520b6c,_0x3b40bf,_0x35fafd,_0x507c37){this['moveContactManagedDialer'](_0x520b6c)[_0x3b90('0xbe')](function(){return _0x3b40bf(msgResponse(_0x3b90('0x1c6'),_0x3b90('0xdc'),_0x507c37));})['catch'](function(){return _0x35fafd(msgResponse('[moveContactManagedDialer][0]',_0x3b90('0x142'),_0x3b90('0x1c7')));});};Dialer[_0x3b90('0x16')]['predictive']=function(_0x40c91a){var _0x53621b=_0x40c91a[_0x3b90('0x1c8')]/0x64;var _0x1fe49a=_0x40c91a['outboundDropCallsDayTimeout']/(_0x40c91a[_0x3b90('0x64')]+_0x40c91a[_0x3b90('0x5f')]);var _0x1f95b9=Math['round'](_0x40c91a[_0x3b90('0x71')]*(_0x40c91a['predictiveIntervalMaxThreshold']/0x64));var _0x30c32d=Math['round'](_0x40c91a[_0x3b90('0x71')]*(_0x40c91a[_0x3b90('0x1c9')]/0x64));var _0xab49a8=_0x40c91a['available']+_0x40c91a['talking'];var _0x274673=Math['floor'](_0x40c91a[_0x3b90('0x8b')]*_0x40c91a[_0x3b90('0x74')]*_0x40c91a[_0x3b90('0x6e')]*_0x40c91a[_0x3b90('0x6f')]);if(_['isUndefined'](_0x40c91a[_0x3b90('0x24')])){if(!_['isUndefined'](_0x40c91a[_0x3b90('0x23')])){_0x40c91a[_0x3b90('0x23')]=undefined;loggerPredictive[_0x3b90('0x98')](_0x3b90('0x1ca'),_0x3b90('0x1cb'));}if(!_[_0x3b90('0x39')](_0x40c91a[_0x3b90('0x92')])){loggerPredictive[_0x3b90('0x98')](_0x3b90('0x1ca'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x40c91a[_0x3b90('0x92')]);_0x40c91a[_0x3b90('0x92')]=undefined;}_0x40c91a[_0x3b90('0x24')]=moment()[_0x3b90('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3b90('0x7d')](_0x40c91a['name'],'collection\x20data\x20in\x20progressive\x20at',_0x40c91a[_0x3b90('0x24')]);this[_0x3b90('0x157')](_0x40c91a,0x1);}else if(ifInterval(_0x40c91a['dialPredictiveInterval'],_0x40c91a[_0x3b90('0x24')])){this[_0x3b90('0x157')](_0x40c91a,0x1);loggerPredictiveCalls['info'](_0x3b90('0x1cc'),_0x40c91a[_0x3b90('0x24')],_0x40c91a['name']);_0x40c91a['erlangCalls']=0x0;_0x40c91a[_0x3b90('0x6d')]=0x0;}else if(_0x53621b<_0x1fe49a&&_0x40c91a[_0x3b90('0x1cd')]===_0x3b90('0x1ce')){freeVariablesPredictive(_0x40c91a);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x1cf'),_0x3b90('0x1d0'),_0x1fe49a,_0x3b90('0x24'),_0x40c91a[_0x3b90('0x3c')]);}else if(_0x274673<_0x40c91a[_0x3b90('0x6d')]&&_0x40c91a[_0x3b90('0x1cd')]===_0x3b90('0x1ce')){freeVariablesPredictive(_0x40c91a);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x1d1'),_0x3b90('0x1d2'),_0x274673,'Drop\x20in\x20this\x20interval',_0x40c91a['predictiveIntervalErlangCallsDroppedCalls'],_0x3b90('0x24'),_0x40c91a[_0x3b90('0x3c')]);}else if(!ifInterval(_0x40c91a[_0x3b90('0x1d3')],_0x40c91a[_0x3b90('0x24')])&&_['isUndefined'](_0x40c91a[_0x3b90('0x23')])&&!_['isUndefined'](_0x40c91a[_0x3b90('0x24')])){_0x40c91a[_0x3b90('0x23')]=moment()['format'](_0x3b90('0x106'));loggerPredictive[_0x3b90('0x7d')](_0x40c91a[_0x3b90('0x3c')],_0x3b90('0x1d4'),_0x40c91a['startPredictive']);this['averageHandleTime'](_0x40c91a[_0x3b90('0x1d3')])['then'](this[_0x3b90('0x1d5')](_0x40c91a))[_0x3b90('0xbe')](mergeDataErlangB(_0x40c91a))[_0x3b90('0xbe')](this[_0x3b90('0x1d6')](_0x40c91a))[_0x3b90('0xb5')](loggerCatchPredictive(_0x3b90('0x1d7'),_0x40c91a));}else if(!ifInterval(_0x40c91a[_0x3b90('0x1d3')],_0x40c91a[_0x3b90('0x23')])){_0x40c91a[_0x3b90('0x6d')]=0x0;_0x40c91a[_0x3b90('0x23')]=moment()[_0x3b90('0x79')](_0x3b90('0x106'));loggerPredictive[_0x3b90('0x7d')](_0x40c91a['name'],_0x3b90('0x1d8'),_0x40c91a['startPredictive']);clearInterval(_0x40c91a[_0x3b90('0x92')]);_0x40c91a[_0x3b90('0x92')]=undefined;this[_0x3b90('0xc3')](_0x40c91a[_0x3b90('0x1d3')])[_0x3b90('0xbe')](this[_0x3b90('0x1d5')](_0x40c91a))['then'](mergeDataErlangB(_0x40c91a))[_0x3b90('0xbe')](this['startMethodPredictive'](_0x40c91a))['catch'](loggerCatchPredictive(_0x3b90('0x1d9'),_0x40c91a));}else if(_0x40c91a['predictiveIntervalAvailable']&&_0xab49a8<_0x40c91a['predictiveIntervalAvailable']-_0x30c32d){freeVariablesPredictive(_0x40c91a);loggerPredictive[_0x3b90('0x7d')](_0x40c91a[_0x3b90('0x3c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xab49a8,_0x3b90('0x1da'),_0x40c91a[_0x3b90('0x71')],'-',_0x30c32d,'=',_0x40c91a[_0x3b90('0x71')]-_0x30c32d,')');}else if(_0x40c91a[_0x3b90('0x71')]&&_0xab49a8>_0x40c91a[_0x3b90('0x71')]+_0x1f95b9){freeVariablesPredictive(_0x40c91a);loggerPredictive[_0x3b90('0x7d')](_0x40c91a[_0x3b90('0x3c')],_0x3b90('0x1db'),_0xab49a8,_0x3b90('0x1dc'),_0x40c91a[_0x3b90('0x71')],'+',_0x1f95b9,'=',_0x40c91a[_0x3b90('0x71')]+_0x1f95b9,')');}};Dialer['prototype'][_0x3b90('0x1d5')]=function(_0x5bc62c){var _0x27b904=this;return function(_0x3c5b33){return new BPromise(function(_0x34b1a6,_0x5496a7){_['merge'](_0x5bc62c,_0x3c5b33[0x0]);if(checkGetDataPredictive(_0x3c5b33[0x0])){var _0x2a7b4b=_0x5bc62c['predictiveIntervalAvailable']=_0x5bc62c['talking']+_0x5bc62c[_0x3b90('0x4d')];var _0x1f16f9=_0x5bc62c[_0x3b90('0x1d3')]*0x3c;var _0x25c230=_0x3c5b33[0x0][_0x3b90('0x69')]+_0x3c5b33[0x0]['predictiveIntervalAvgHoldtime'];var _0x3d7c4d=(_0x3c5b33[0x0][_0x3b90('0x68')]+_0x3c5b33[0x0][_0x3b90('0x6b')]+_0x3c5b33[0x0][_0x3b90('0x6a')])/_0x3c5b33[0x0]['predictiveIntervalTotalCalls'];_0x5bc62c[_0x3b90('0x6e')]=_0x3d7c4d>0x0?_0x3d7c4d:0x1;switch(_0x5bc62c[_0x3b90('0x1cd')]){case _0x3b90('0x1ce'):var _0x10d1da=_0x5bc62c[_0x3b90('0x1c8')]/0x64;return _0x27b904[_0x3b90('0x1dd')](_0x2a7b4b,_0x1f16f9,_0x25c230,_0x3d7c4d,_0x10d1da)[_0x3b90('0xbe')](function(_0x466c81){return _0x34b1a6(_0x466c81);});case _0x3b90('0x1de'):var _0x443c75=_0x5bc62c[_0x3b90('0x1c8')]/0x64;return _0x27b904[_0x3b90('0x1df')](_0x2a7b4b,_0x1f16f9,_0x25c230,_0x3d7c4d,_0x443c75)[_0x3b90('0xbe')](function(_0x382f6b){return _0x34b1a6(_0x382f6b);});default:return _0x5496a7(msgResponse('[getDataPredictive]',_0x3b90('0x142'),'Unknown\x20Predictive'));}}else{return _0x5496a7(msgResponse(_0x3b90('0x1e0'),_0x3b90('0x142'),_0x3b90('0x1e1')));}});};};Dialer['prototype'][_0x3b90('0x1e2')]=function(_0x5213fa){var _0xe5e454=this;return function(_0x2c92f4){return new BPromise(function(_0x536c87,_0x399013){_['merge'](_0x5213fa,_0x2c92f4[0x0]);if(checkGetDataPredictive(_0x2c92f4[0x0])){loggerPredictive[_0x3b90('0x7d')](JSON[_0x3b90('0x44')](_0x2c92f4[0x0]));if(_0x5213fa[_0x3b90('0x1cd')]===_0x3b90('0x1ce')){return _0xe5e454['getVoiceQueueRtPauses'](_0x5213fa['id'])[_0x3b90('0xbe')](function(_0x2a6eaa){var _0x2c287d=_0x5213fa[_0x3b90('0x15d')]-_0x2a6eaa[0x0]['outboundQueuePauses'];var _0x13065f=_0x5213fa['dialPredictiveInterval']*0x3c;var _0x51b20c=_0x2c92f4[0x0]['predictiveIntervalAvgTalktime']+_0x2c92f4[0x0][_0x3b90('0x82')];var _0x35ee29=(_0x2c92f4[0x0][_0x3b90('0x68')]+_0x2c92f4[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2c92f4[0x0][_0x3b90('0x6a')])/_0x2c92f4[0x0][_0x3b90('0x7f')];var _0x1e7498=_0x5213fa[_0x3b90('0x1c8')]/0x64;_0x5213fa[_0x3b90('0x70')]=_0x2a6eaa[0x0][_0x3b90('0x1e3')]||0x0;_0x5213fa[_0x3b90('0x6e')]=_0x35ee29>0x0?_0x35ee29:0x1;return _0xe5e454['abandonmentRate'](_0x2c287d,_0x13065f,_0x51b20c,_0x35ee29,_0x1e7498);})[_0x3b90('0xbe')](function(_0x52f0ea){return _0x536c87(_0x52f0ea);})['catch'](function(_0x2708b4){return _0x399013(msgResponse(_0x3b90('0x1e4'),_0x3b90('0x142'),JSON[_0x3b90('0x44')](_0x2708b4)));});}if(_0x5213fa[_0x3b90('0x1cd')]===_0x3b90('0x1de')){return _0xe5e454[_0x3b90('0xcc')](_0x5213fa['id'])[_0x3b90('0xbe')](function(_0x411e8d){var _0x231660=_0x5213fa['loggedIn']-_0x411e8d[0x0][_0x3b90('0x1e3')];var _0x241cb0=_0x5213fa['dialPredictiveInterval']*0x3c;var _0x18cbad=_0x2c92f4[0x0][_0x3b90('0x69')]+_0x2c92f4[0x0][_0x3b90('0x82')];var _0x2914f1=(_0x2c92f4[0x0][_0x3b90('0x68')]+_0x2c92f4[0x0][_0x3b90('0x6b')]+_0x2c92f4[0x0][_0x3b90('0x6a')])/_0x2c92f4[0x0][_0x3b90('0x7f')];var _0x2c3ebc=_0x5213fa['dialPredictiveOptimizationPercentage']/0x64;_0x5213fa[_0x3b90('0x70')]=_0x411e8d[0x0][_0x3b90('0x1e3')]||0x0;_0x5213fa[_0x3b90('0x6e')]=_0x2914f1>0x0?_0x2914f1:0x1;return _0xe5e454[_0x3b90('0x1df')](_0x231660,_0x241cb0,_0x18cbad,_0x2914f1,_0x2c3ebc);})['then'](function(_0x5601c0){return _0x536c87(_0x5601c0);})[_0x3b90('0xb5')](function(_0x16f494){return _0x399013(msgResponse(_0x3b90('0x1e4'),'Failure',JSON[_0x3b90('0x44')](_0x16f494)));});}}else{return _0x399013(msgResponse(_0x3b90('0x1e0'),_0x3b90('0x142'),_0x3b90('0x1e1')));}});};};Dialer['prototype'][_0x3b90('0x1d6')]=function(_0x1b8c6c){var _0x472ec8=this;return function(){var _0x3d703f=0x0;var _0x22a1a8=Math['floor'](_0x1b8c6c[_0x3b90('0x73')]*0x3e8);if(_0x22a1a8>0x0){_0x22a1a8=_0x22a1a8<0x64?0x64:_0x22a1a8;loggerPredictive[_0x3b90('0x7d')](_0x1b8c6c[_0x3b90('0x3c')],_0x3b90('0x1e5'),_0x22a1a8,_0x3b90('0x45'));_0x1b8c6c[_0x3b90('0x92')]=setInterval(function(){_0x472ec8[_0x3b90('0x92')](_0x1b8c6c);loggerPredictiveCalls['info'](_0x3b90('0x1e6'),_0x3d703f+=0x1);},_0x22a1a8);}else{loggerPredictive['info'](_0x1b8c6c[_0x3b90('0x3c')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x3b90('0x16')]['checkContactBlack']=function(_0x469e2d,_0x44bd1e){var _0x222160=this;return function(_0x1ec8a5){if(_[_0x3b90('0x95')](_0x1ec8a5)){if(_[_0x3b90('0xb1')](_0x44bd1e['UserId'])||!_0x44bd1e['recallme']){if(_0x469e2d[_0x3b90('0x59')]===_0x3b90('0x159')){_0x469e2d['queueStatusComplete']=_['isUndefined'](_0x469e2d[_0x3b90('0x12c')])?!![]:_0x469e2d[_0x3b90('0x12c')];var _0x4c44a5=uuid['v4']();_0x222160['actions'][_0x4c44a5]=new Action(_0x469e2d,_0x44bd1e,_0x4c44a5);loggerBooked[_0x3b90('0x7d')](_0x3b90('0x1e7'),_0x4c44a5,'queueStatusComplete:\x20',JSON[_0x3b90('0x44')](_0x469e2d['queueStatusComplete']),_0x3b90('0x1e8'),_0x469e2d[_0x3b90('0x3c')]);if(_0x469e2d[_0x3b90('0x12c')]){_0x469e2d[_0x3b90('0x12c')]=![];_0x222160[_0x3b90('0x26')][_0x222160[_0x3b90('0xae')][_0x4c44a5]['queue']]=[];ami[_0x3b90('0xb2')]({'actionid':_0x4c44a5,'action':_0x3b90('0x1e9'),'queue':_0x469e2d[_0x3b90('0x3c')]})[_0x3b90('0xb5')](function(){_0x222160[_0x3b90('0xb8')](_0x469e2d);_0x222160[_0x3b90('0xc6')]({'active':![],'ContactId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xd6')],'ListId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xd7')],'VoiceQueueId':_0x222160['actions'][_0x4c44a5][_0x3b90('0xd9')]||undefined,'CampaignId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x1ea')));delete _0x222160[_0x3b90('0xae')][_0x4c44a5];});}else{loggerBooked[_0x3b90('0x7d')]('[booked][checkContactBlack][else]',JSON[_0x3b90('0x44')](_0x469e2d[_0x3b90('0x12c')]),_0x3b90('0x1e8'),_0x469e2d[_0x3b90('0x3c')]);_0x222160['updateOriginated'](_0x469e2d);_0x222160[_0x3b90('0xc6')]({'active':![],'ContactId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xd6')],'ListId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xd7')],'VoiceQueueId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xd9')]||undefined,'CampaignId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x1ea')));delete _0x222160[_0x3b90('0xae')][_0x4c44a5];}}else{return _0x222160[_0x3b90('0x1eb')](_0x469e2d,_0x44bd1e);}}else{if(getDiff(_0x44bd1e[_0x3b90('0x1ec')])<_0x469e2d['dialRecallMeTimeout']*0x3c){if(_0x44bd1e[_0x3b90('0x1ed')]&&!_0x44bd1e['Agent'][_0x3b90('0x1ee')]){_0x222160[_0x3b90('0x19')][_0x3b90('0x130')](_0x44bd1e['id'])[_0x3b90('0x18')](function(){_0x222160[_0x3b90('0xb8')](_0x469e2d);});}else{_0x222160[_0x3b90('0xc7')]({'active':![]},_0x44bd1e['id'],0x1)['finally'](function(){_0x222160['updateOriginated'](_0x469e2d);});}}else{_0x469e2d['outboundReCallsDay']+=0x1;_0x222160[_0x3b90('0xb8')](_0x469e2d);if(_0x469e2d[_0x3b90('0x1ef')]){_0x222160[_0x3b90('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x44bd1e[_0x3b90('0xd6')],'ListId':_0x44bd1e[_0x3b90('0xd7')],'VoiceQueueId':_0x44bd1e[_0x3b90('0xd9')]||undefined,'CampaignId':_0x44bd1e[_0x3b90('0xda')]||undefined})['catch'](loggerCatch(_0x3b90('0x1f0')));_0x222160[_0x3b90('0xce')](createObjHistory(_0x469e2d,_0x44bd1e,_0x3b90('0x1f1'),0x17,_0x3b90('0x1f2')))[_0x3b90('0xb5')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x222160['saveInDb'](createObjHistory(_0x469e2d,_0x44bd1e,_0x3b90('0x1f3'),0x16,_0x3b90('0x1f4')),_0x3b90('0x1f5'),_0x3b90('0x1f6'));}}}}else{_0x469e2d[_0x3b90('0x60')]+=0x1;_0x222160[_0x3b90('0xd4')](createObjHistory(_0x469e2d,_0x44bd1e,_0x3b90('0x1f7'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0x3b90('0x1f8'));throw _0x3b90('0x1f9');}};};Dialer[_0x3b90('0x16')]['handleIvr']=function(_0x1948e6){var _0x3bd369=this;var _0x569844=_0x1948e6[_0x3b90('0x1fa')]-_0x1948e6[_0x3b90('0x72')]-_0x1948e6[_0x3b90('0xc9')];emitCampaignSummary(_0x1948e6);if(_0x569844>0x0){if(_0x569844>this[_0x3b90('0x1e')]){_0x569844=this['maxNumberOriginate'];}_0x1948e6['temp']+=_0x569844;this[_0x3b90('0xcb')](_0x1948e6['id'],_0x569844,_0x1948e6[_0x3b90('0x1fb')],_0x1948e6)['then'](function(_0x5b8387){_0x1948e6['temp']-=_0x569844;_0x1948e6[_0x3b90('0xc9')]=_0x1948e6[_0x3b90('0xc9')]>0x0?_0x1948e6[_0x3b90('0xc9')]:0x0;if(!checkContactEmpty(_0x5b8387)){_0x1948e6['message']=_0x3b90('0x9f');logger['info'](_0x3b90('0x1fc')+_0x1948e6[_0x3b90('0x3c')]);}else{_0x1948e6['originated']+=_0x5b8387[_0x3b90('0x135')];_0x1948e6[_0x3b90('0x3a')]=_0x3b90('0x1fd');for(var _0x273472=0x0;_0x273472<_0x5b8387[_0x3b90('0x135')];_0x273472+=0x1){_0x1948e6[_0x3b90('0x1fe')]+=0x1;if(_[_0x3b90('0xb1')](_0x5b8387[_0x273472])||_['isNil'](_0x5b8387[_0x273472][_0x3b90('0x16b')])||_[_0x3b90('0xb1')](_0x5b8387[_0x273472]['Contact']['phone'])){_0x3bd369[_0x3b90('0xd2')](_0x3b90('0x1ff'),_0x1948e6,_0x5b8387[_0x273472]);}else{_0x3bd369[_0x3b90('0xc1')](_[_0x3b90('0xd5')](_0x5b8387[_0x273472],[_0x3b90('0xda'),_0x3b90('0x200')]))[_0x3b90('0xbe')](_0x3bd369[_0x3b90('0x201')](_0x1948e6,_0x5b8387[_0x273472]))[_0x3b90('0xb5')](_0x3bd369['loggerHandler'](_0x3b90('0x202'),_0x1948e6));}}}})[_0x3b90('0xb5')](loggerGetContactDialer(_0x3b90('0x203'),_0x1948e6,_0x569844));}};Dialer[_0x3b90('0x16')]['handlePower']=function(_0x3a494d,_0x18db1f){var _0x529d0f=this;var _0x25214e=[];var _0x43da81=_0x18db1f>=0x1?_0x18db1f:0x1;if(_0x3a494d[_0x3b90('0x59')]===_0x3b90('0x159')){_0x43da81=0x1;}var _0x9daf74=Math[_0x3b90('0x204')](_0x3a494d['available']*_0x43da81)-_0x3a494d['originated']-_0x3a494d[_0x3b90('0xc9')];emitVoiceQueueSummary(_0x3a494d);if(_0x3a494d[_0x3b90('0x205')]>0x0){var _0xcb79a5=_0x3a494d[_0x3b90('0x205')]-_0x3a494d[_0x3b90('0x72')]-_0x3a494d[_0x3b90('0x52')]-_0x3a494d[_0x3b90('0xc9')]-_0x3a494d[_0x3b90('0x4e')];if(_0x9daf74>_0xcb79a5){_0x9daf74=_0xcb79a5;}}if(_0x9daf74>0x0){if(_0x3a494d[_0x3b90('0x59')]===_0x3b90('0x159')){_0x9daf74=0x1;}if(_0x9daf74>this['maxNumberOriginate']){_0x9daf74=this[_0x3b90('0x1e')];}_0x3a494d[_0x3b90('0xc9')]+=_0x9daf74;for(var _0x4668f3 in this[_0x3b90('0x1c')]){if(typeof this['agents'][_0x4668f3]!==_0x3b90('0x9a')){if(this['agents'][_0x4668f3][_0x3b90('0xa8')]===_0x3b90('0x206')&&this['agents'][_0x4668f3][_0x3b90('0xb3')]===_0x3b90('0xdf')){_0x25214e[_0x3b90('0x12a')](this['agents'][_0x4668f3]['id']);}}}this[_0x3b90('0x207')](_0x3a494d['id'],_0x25214e,_0x9daf74,_0x3a494d[_0x3b90('0x1fb')],_0x3a494d)[_0x3b90('0xbe')](function(_0x5d6644){_0x3a494d[_0x3b90('0xc9')]-=_0x9daf74;_0x3a494d[_0x3b90('0xc9')]=_0x3a494d['temp']>0x0?_0x3a494d['temp']:0x0;if(!checkContactEmpty(_0x5d6644)){_0x529d0f[_0x3b90('0xbc')](_0x3a494d)['then'](sendMessageReschedule(_0x3a494d))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xbf')));}else{_0x3a494d[_0x3b90('0x72')]+=_0x5d6644[_0x3b90('0x135')];_0x3a494d['message']=_0x3a494d[_0x3b90('0x59')]==='booked'?_0x3b90('0x173'):'RUNNING';for(var _0x16ca53=0x0;_0x16ca53<_0x5d6644[_0x3b90('0x135')];_0x16ca53+=0x1){if(_[_0x3b90('0xb1')](_0x5d6644[_0x16ca53])||_[_0x3b90('0xb1')](_0x5d6644[_0x16ca53][_0x3b90('0x16b')])||_[_0x3b90('0xb1')](_0x5d6644[_0x16ca53][_0x3b90('0x16b')][_0x3b90('0x16c')])){_0x529d0f['emptyContact'](_0x3b90('0x1ff'),_0x3a494d,_0x5d6644[_0x16ca53]);}else{_0x529d0f['checkIsBlackList'](_[_0x3b90('0xd5')](_0x5d6644[_0x16ca53],[_0x3b90('0xd9'),_0x3b90('0x200')]))[_0x3b90('0xbe')](_0x529d0f['checkContactBlack'](_0x3a494d,_0x5d6644[_0x16ca53]))['catch'](_0x529d0f[_0x3b90('0xd1')](_0x3b90('0x1ff'),_0x3a494d));}}}})[_0x3b90('0xb5')](loggerGetContactDialer(_0x3b90('0x208'),_0x3a494d,_0x9daf74));}};Dialer[_0x3b90('0x16')]['handlePredictive']=function(_0x586087){if(_0x586087[_0x3b90('0x205')]>0x0){var _0x221f4d=_0x586087[_0x3b90('0x205')]-_0x586087[_0x3b90('0x72')]-_0x586087[_0x3b90('0x52')];if(_0x221f4d>0x0){this['tryOriginatePredictive'](_0x586087);}else{loggerPredictiveCalls[_0x3b90('0x7d')](_0x3b90('0x209'));}}else{this[_0x3b90('0x20a')](_0x586087);}};Dialer['prototype'][_0x3b90('0x20a')]=function(_0x4a2c97){var _0x491e0c=this;var _0x36c03e=[];_0x4a2c97[_0x3b90('0x72')]+=0x1;for(var _0x288a16 in this[_0x3b90('0x1c')]){if(typeof this['agents'][_0x288a16]!=='undefined'){if(this[_0x3b90('0x1c')][_0x288a16][_0x3b90('0xa8')]===_0x3b90('0x206')&&this[_0x3b90('0x1c')][_0x288a16][_0x3b90('0xb3')]===_0x3b90('0xdf')){_0x36c03e[_0x3b90('0x12a')](this[_0x3b90('0x1c')][_0x288a16]['id']);}}}this['getContactDialer'](_0x4a2c97['id'],_0x36c03e,0x1,_0x4a2c97[_0x3b90('0x1fb')],_0x4a2c97)[_0x3b90('0xbe')](function(_0x2524e3){if(!checkContactEmpty(_0x2524e3)){checkContactLowerLimitOriginate(_0x4a2c97,0x1,0x0);_0x491e0c[_0x3b90('0xbc')](_0x4a2c97)['then'](sendMessageReschedule(_0x4a2c97))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xbf')));}else{_0x4a2c97[_0x3b90('0x3a')]='RUNNING';if(_[_0x3b90('0xb1')](_0x2524e3[0x0])||_[_0x3b90('0xb1')](_0x2524e3[0x0][_0x3b90('0x16b')])||_[_0x3b90('0xb1')](_0x2524e3[0x0][_0x3b90('0x16b')][_0x3b90('0x16c')])){_0x491e0c[_0x3b90('0xd2')]('[actionOriginate]\x20',_0x4a2c97,_0x2524e3[0x0]);}else{_0x491e0c['checkIsBlackList'](_['pick'](_0x2524e3[0x0],['VoiceQueueId',_0x3b90('0x200')]))[_0x3b90('0xbe')](_0x491e0c[_0x3b90('0x201')](_0x4a2c97,_0x2524e3[0x0]))[_0x3b90('0xb5')](_0x491e0c[_0x3b90('0xd1')](_0x3b90('0x20b'),_0x4a2c97));}}})[_0x3b90('0xb5')](loggerGetContactDialer(_0x3b90('0x20c'),_0x4a2c97,0x1));emitVoiceQueueSummary(_0x4a2c97);};Dialer[_0x3b90('0x16')]['abandonmentRate']=function(_0x31792f,_0x5118b0,_0x5e69a6,_0x31fcf0,_0x3eb54f,_0x332109){loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x20d'));loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x20e'),_0x31792f);loggerPredictive[_0x3b90('0x7d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5118b0);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x20f'),_0x5e69a6);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x210'),_0x31fcf0);loggerPredictive[_0x3b90('0x7d')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3eb54f);loggerPredictive['info'](_0x3b90('0x84'));return new BPromise(function(_0x5f49bf,_0x5ad8de){if(_0x31792f<=0x0||isNaN(_0x31792f)){return _0x5ad8de(msgResponse(_0x3b90('0x211'),_0x3b90('0x43'),_0x3b90('0x212')+_0x31792f));}if(_0x5e69a6<=0x0||isNaN(_0x5e69a6)){return _0x5ad8de(msgResponse('[abandonmentRate]',_0x3b90('0x43'),_0x3b90('0x213')+_0x5e69a6));}if(_0x31fcf0<=0x0||isNaN(_0x31fcf0)){return _0x5ad8de(msgResponse('[abandonmentRate]',_0x3b90('0x43'),'p\x20=\x20'+_0x31fcf0));}if(_0x5118b0<=0x0||isNaN(_0x5118b0)){return _0x5ad8de(msgResponse('[abandonmentRate]',_0x3b90('0x43'),'interval\x20=\x20'+_0x5118b0));}if(_0x3eb54f<=0x0||isNaN(_0x3eb54f)){return _0x5ad8de(msgResponse(_0x3b90('0x211'),'Error',_0x3b90('0x214')+_0x3eb54f));}_0x332109=_0x332109||0x0;var _0x54e483=0x1/_0x5e69a6;var _0x4f5aed=0x0;var _0x5aad49=0x0;var _0x17f4ab=0x0;var _0x340db5=0x0;for(var _0x1c1ca6=0x0;_0x17f4ab<_0x3eb54f;_0x1c1ca6+=0x1){_0x5aad49=_0x1c1ca6/_0x5118b0;_0x4f5aed=(_0x31fcf0*_0x5aad49+_0x332109)/_0x54e483;_0x17f4ab=erlangb(_0x4f5aed,_0x31792f);_0x340db5=_0x4f5aed/_0x31792f*(0x1-erlangb(_0x4f5aed,_0x31792f));}return _0x5f49bf({'erlangCalls':_0x1c1ca6,'erlangCallToSecond':_0x5118b0/_0x1c1ca6,'erlangAbandonmentRate':_0x17f4ab,'erlangBusyFactor':_0x340db5});});};Dialer[_0x3b90('0x16')][_0x3b90('0x1df')]=function(_0x57d399,_0x2ca8d3,_0x30f87d,_0x1e7c02,_0x5ea4d4,_0x20eb3f){loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x215'));loggerPredictive[_0x3b90('0x7d')]('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',_0x57d399);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x216'),_0x2ca8d3);loggerPredictive['info'](_0x3b90('0x20f'),_0x30f87d);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x210'),_0x1e7c02);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x217'),_0x5ea4d4);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x84'));return new BPromise(function(_0x11ba7e,_0x559b62){if(_0x57d399<=0x0||isNaN(_0x57d399)){return _0x559b62(msgResponse(_0x3b90('0x218'),_0x3b90('0x43'),_0x3b90('0x212')+_0x57d399));}if(_0x30f87d<=0x0||isNaN(_0x30f87d)){return _0x559b62(msgResponse(_0x3b90('0x218'),'Error','Ts\x20=\x20'+_0x30f87d));}if(_0x1e7c02<=0x0||isNaN(_0x1e7c02)){return _0x559b62(msgResponse(_0x3b90('0x218'),_0x3b90('0x43'),_0x3b90('0x219')+_0x1e7c02));}if(_0x2ca8d3<=0x0||isNaN(_0x2ca8d3)){return _0x559b62(msgResponse(_0x3b90('0x218'),_0x3b90('0x43'),'interval\x20=\x20'+_0x2ca8d3));}if(_0x5ea4d4<=0x0||isNaN(_0x5ea4d4)){return _0x559b62(msgResponse(_0x3b90('0x218'),_0x3b90('0x43'),_0x3b90('0x21a')+_0x5ea4d4));}_0x20eb3f=_0x20eb3f||0x0;var _0x18ab90=0x1/_0x30f87d;var _0x1d288d=0x0;var _0x2da409=0x0;var _0x2922ca=0x0;var _0x3ac020=0x0;for(var _0x438c37=0x0;_0x3ac020<_0x5ea4d4;_0x438c37+=0x1){_0x2da409=_0x438c37/_0x2ca8d3;_0x1d288d=(_0x1e7c02*_0x2da409+_0x20eb3f)/_0x18ab90;_0x2922ca=erlangb(_0x1d288d,_0x57d399);_0x3ac020=_0x1d288d/_0x57d399*(0x1-erlangb(_0x1d288d,_0x57d399));}return _0x11ba7e({'erlangCalls':_0x438c37,'erlangCallToSecond':_0x2ca8d3/_0x438c37,'erlangAbandonmentRate':_0x2922ca,'erlangBusyFactor':_0x3ac020});});};module['exports']=Dialer; \ No newline at end of file +var _0xe6d7=['predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','Trunk','callerid','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','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','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','\x22%s\x22\x20<%s>','string','error','inspect','stack','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','outboundAnswerAgiCallsDay','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD]','MACHINE','Machine','membername','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ContactId','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countabandonedretry','countagentrejectretry','createStateFinal','minutes','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','locked','paused','stateinterface','push','queueStatusComplete','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','interval','content','indexOf','true','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','dialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIfTime','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','[syncCampaigns]','pow','replace','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','dialer','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','evt\x20is\x20undefine','reason','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','limitCalls','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','lodash','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','emit','type','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xe6d7,0x1ae));var _0x7e6d=function(_0x2aa83a,_0x4b5c0b){_0x2aa83a=_0x2aa83a-0x0;var _0x36a653=_0xe6d7[_0x2aa83a];return _0x36a653;};'use strict';var util=require('util');var _=require(_0x7e6d('0x0'));var BPromise=require('bluebird');var uuid=require(_0x7e6d('0x1'));var moment=require(_0x7e6d('0x2'));var rr=require('rr');var md5=require(_0x7e6d('0x3'));var Redis=require(_0x7e6d('0x4'));var ut=require('../preview/util/util');var config=require(_0x7e6d('0x5'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x7e6d('0x6'))(_0x7e6d('0x7'));var loggerPredictive=require('../../../config/logger')(_0x7e6d('0x8'));var loggerPredictiveCalls=require(_0x7e6d('0x6'))(_0x7e6d('0x9'));var loggerSyncQueueSummary=require(_0x7e6d('0x6'))(_0x7e6d('0xa'));var ami=require(_0x7e6d('0xb'));config[_0x7e6d('0xc')]=_[_0x7e6d('0xd')](config[_0x7e6d('0xc')],{'host':_0x7e6d('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7e6d('0xc')]));var cmHopper=require(_0x7e6d('0xf'));var cmHopperHistory=require(_0x7e6d('0x10'));var cmHopperBlack=require(_0x7e6d('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x7e6d('0x12'));var History=require(_0x7e6d('0x13'));var Final=require('./final');var AgentComplete=require(_0x7e6d('0x14'));var QueueCallerAbandon=require(_0x7e6d('0x15'));var Hangup=require(_0x7e6d('0x16'));var ipAgi=process[_0x7e6d('0x17')][_0x7e6d('0x18')]||_0x7e6d('0x19');var strategy={'rrmemory':_0x7e6d('0x1a'),'roundrobin':_0x7e6d('0x1b')};var Sequence=function(){};Sequence[_0x7e6d('0x1c')][_0x7e6d('0x1d')]=function(_0x5cad83){this['tail']=this[_0x7e6d('0x1e')]?this[_0x7e6d('0x1e')]['finally'](_0x5cad83):_0x5cad83();};function Dialer(_0x3cfc3a,_0x52596b){this[_0x7e6d('0x1f')]=new Sequence();this[_0x7e6d('0x20')]=_0x52596b;this[_0x7e6d('0x21')]=_0x3cfc3a[_0x7e6d('0x21')];this['campaigns']=_0x3cfc3a[_0x7e6d('0x22')];this[_0x7e6d('0x23')]=_0x3cfc3a['agents'];this[_0x7e6d('0x24')]=_0x3cfc3a[_0x7e6d('0x24')];this[_0x7e6d('0x25')]=config[_0x7e6d('0x25')]||0x2;this['channels']={};this[_0x7e6d('0x26')]={};this[_0x7e6d('0x27')]={};this[_0x7e6d('0x28')]={};this['optionPredictive']={};this[_0x7e6d('0x29')]={};this[_0x7e6d('0x2a')]={};this[_0x7e6d('0x2b')]={};this[_0x7e6d('0x2c')]={};this['queueBookedRR']={};ami['on'](_0x7e6d('0x2d'),this[_0x7e6d('0x2e')][_0x7e6d('0x2f')](this));ami['on']('queuecallerabandon',this[_0x7e6d('0x30')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x31'),this[_0x7e6d('0x32')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x33'),this[_0x7e6d('0x34')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x35'),this[_0x7e6d('0xa')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x36'),this[_0x7e6d('0x37')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x38'),this[_0x7e6d('0x39')]['bind'](this));ami['on']('varset',this[_0x7e6d('0x3a')][_0x7e6d('0x2f')](this));ami['on']('queuemember',this[_0x7e6d('0x3b')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x3c'),this[_0x7e6d('0x3d')]['bind'](this));this[_0x7e6d('0x3e')]();this[_0x7e6d('0x3f')]();}function isNotNull(_0x3f1a6b){return _0x3f1a6b!==null&&!_[_0x7e6d('0x40')](_0x3f1a6b);}function checkIsLoggedIn(_0x113d27,_0x31f642){return function(){if(_0x31f642<=0x0){_0x113d27[_0x7e6d('0x41')]=_0x7e6d('0x42');throw _0x113d27[_0x7e6d('0x43')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x5f05f8){return _0x5f05f8;}function checkIsActive(_0x2f8fb6,_0x159e7d){return function(){if(!isActive(_0x159e7d)){_0x2f8fb6['message']='NOT_ACTIVE';throw _0x2f8fb6[_0x7e6d('0x43')]+_0x7e6d('0x44');}};}function checkInterval(_0x5773e2){return function(){if(!isNotNull(_0x5773e2['Interval'])){_0x5773e2['message']=_0x7e6d('0x45');throw _0x5773e2[_0x7e6d('0x43')]+_0x7e6d('0x46');}if(!isNotNull(_0x5773e2[_0x7e6d('0x47')][_0x7e6d('0x48')])){_0x5773e2[_0x7e6d('0x41')]='INTERVAL_IS_NULL';throw _0x5773e2['name']+_0x7e6d('0x46');}if(!isNotNull(_[_0x7e6d('0x49')](_0x5773e2[_0x7e6d('0x47')]['Intervals']))){_0x5773e2[_0x7e6d('0x41')]='INTERVAL_IS_NULL';throw _0x5773e2[_0x7e6d('0x43')]+_0x7e6d('0x46');}};}function msgResponse(_0x3c3e59,_0x10c545,_0x34133e){return{'action':_0x3c3e59,'response':_0x10c545,'message':_0x34133e,'stack':_0x34133e};}function myreject(_0x338f68){return function(_0x18781f){return _0x338f68(msgResponse(_0x7e6d('0x4a'),'Error',JSON[_0x7e6d('0x4b')](_0x18781f)));};}function getSeconds(_0x386e01,_0x145f53){var _0x2597a7=moment(_0x386e01)[_0x7e6d('0x4c')](0x0);var _0x15abd3=moment(_0x145f53)['milliseconds'](0x0);return _0x2597a7[_0x7e6d('0x4d')](_0x15abd3,'seconds');}function emit(_0x4ca8fe,_0x4a31ff,_0x539143){io['to'](_0x4ca8fe)[_0x7e6d('0x4e')](_0x4a31ff,_0x539143);}function emitVoiceQueueSummary(_0x2de2bc){if(_0x2de2bc[_0x7e6d('0x4f')]==='outbound'){var _0x3ab0d1={'id':_0x2de2bc['id'],'name':_0x2de2bc[_0x7e6d('0x43')],'strategy':_0x2de2bc['strategy'],'answered':_0x2de2bc['answered'],'available':_0x2de2bc[_0x7e6d('0x50')],'loggedIn':_0x2de2bc[_0x7e6d('0x51')],'pTalking':_0x2de2bc[_0x7e6d('0x52')],'sumBillable':_0x2de2bc[_0x7e6d('0x53')],'sumDuration':_0x2de2bc[_0x7e6d('0x54')],'sumHoldTime':_0x2de2bc[_0x7e6d('0x55')]||0x0,'talking':_0x2de2bc['talking'],'total':_0x2de2bc['total'],'type':_0x2de2bc[_0x7e6d('0x4f')],'unmanaged':_0x2de2bc[_0x7e6d('0x56')],'abandoned':_0x2de2bc[_0x7e6d('0x57')],'waiting':_0x2de2bc[_0x7e6d('0x58')],'loggedInDb':_0x2de2bc[_0x7e6d('0x59')],'dialActive':_0x2de2bc[_0x7e6d('0x5a')],'dialMethod':_0x2de2bc['dialMethod'],'dialOriginateCallerIdName':_0x2de2bc['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2de2bc[_0x7e6d('0x5b')],'dialOriginateTimeout':_0x2de2bc[_0x7e6d('0x5c')],'dialPrefix':_0x2de2bc['dialPrefix'],'outboundAnswerAgiCallsDay':_0x2de2bc['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2de2bc[_0x7e6d('0x5d')],'outboundBlacklistCallsDay':_0x2de2bc[_0x7e6d('0x5e')],'outboundBusyCallsDay':_0x2de2bc[_0x7e6d('0x5f')],'outboundCongestionCallsDay':_0x2de2bc[_0x7e6d('0x60')],'outboundDropCallsDayACS':_0x2de2bc[_0x7e6d('0x61')],'outboundDropCallsDayCallersExit':_0x2de2bc[_0x7e6d('0x62')],'outboundDropCallsDayTimeout':_0x2de2bc[_0x7e6d('0x63')],'outboundNoAnswerCallsDay':_0x2de2bc['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x2de2bc[_0x7e6d('0x64')],'outboundOriginateFailureCallsDay':_0x2de2bc['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2de2bc[_0x7e6d('0x65')],'outboundRejectCallsDay':_0x2de2bc[_0x7e6d('0x66')],'outboundUnknownCallsDay':_0x2de2bc[_0x7e6d('0x67')],'predictiveIntervalAnsweredCalls':_0x2de2bc['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x2de2bc[_0x7e6d('0x68')],'predictiveIntervalAvgTalktime':_0x2de2bc[_0x7e6d('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x2de2bc[_0x7e6d('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x2de2bc[_0x7e6d('0x6b')],'predictiveIntervalErlangCalls':_0x2de2bc[_0x7e6d('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x2de2bc['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2de2bc[_0x7e6d('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x2de2bc['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2de2bc['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x2de2bc[_0x7e6d('0x6e')],'predictiveIntervalTotalCalls':_0x2de2bc['predictiveIntervalTotalCalls'],'message':_0x2de2bc[_0x7e6d('0x41')],'originated':_0x2de2bc['originated'],'erlangCalls':_0x2de2bc[_0x7e6d('0x6f')],'erlangCallToSecond':_0x2de2bc[_0x7e6d('0x70')],'erlangAbandonmentRate':_0x2de2bc['erlangAbandonmentRate'],'erlangBusyFactor':_0x2de2bc['erlangBusyFactor'],'startPredictive':_0x2de2bc[_0x7e6d('0x29')],'startProgressive':_0x2de2bc['startProgressive']};if(_0x2de2bc[_0x7e6d('0x71')]){_0x3ab0d1[_0x7e6d('0x71')]={'id':_0x2de2bc[_0x7e6d('0x71')]['id'],'name':_0x2de2bc['Trunk'][_0x7e6d('0x43')],'active':_0x2de2bc[_0x7e6d('0x71')]['active'],'callerid':_0x2de2bc[_0x7e6d('0x71')][_0x7e6d('0x72')]};}if(_0x2de2bc[_0x7e6d('0x47')]){_0x3ab0d1[_0x7e6d('0x47')]={'id':_0x2de2bc[_0x7e6d('0x47')]['id'],'name':_0x2de2bc[_0x7e6d('0x47')]['name']};}var _0x430ba8=md5(JSON[_0x7e6d('0x4b')](_0x3ab0d1));if(_0x2de2bc[_0x7e6d('0x3')]!==_0x430ba8){_0x2de2bc[_0x7e6d('0x3')]=_0x430ba8;emit(util['format']('voice:queue:%s',_0x3ab0d1[_0x7e6d('0x43')]),_0x7e6d('0x73'),_0x3ab0d1);}}}function emitCampaignSummary(_0x2f60cb){if(_0x2f60cb['type']===_0x7e6d('0x74')){emit(util[_0x7e6d('0x75')](_0x7e6d('0x76'),_0x2f60cb['name']),_0x7e6d('0x77'),_0x2f60cb);}}function checkGetDataPredictive(_0x5eefe2){if(isNotNull(_0x5eefe2)&&!_['isEmpty'](_0x5eefe2)){loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x79'));loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x7a'),_0x5eefe2[_0x7e6d('0x7b')]);loggerPredictive[_0x7e6d('0x78')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5eefe2[_0x7e6d('0x7c')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x7d'),_0x5eefe2[_0x7e6d('0x6b')]);loggerPredictive['info'](_0x7e6d('0x7e'),_0x5eefe2[_0x7e6d('0x6a')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x7f'),_0x5eefe2[_0x7e6d('0x68')]);loggerPredictive[_0x7e6d('0x78')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5eefe2[_0x7e6d('0x69')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x80'));if(_0x5eefe2['predictiveIntervalTotalCalls']>0x0){if(!_[_0x7e6d('0x40')](_0x5eefe2[_0x7e6d('0x69')])&&_0x5eefe2[_0x7e6d('0x69')]>0x0){return!![];}loggerPredictive[_0x7e6d('0x78')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x7e6d('0x40')](_0x5eefe2[_0x7e6d('0x68')])&&_0x5eefe2['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x81'));}else{loggerPredictive[_0x7e6d('0x78')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x82'));}return![];}function mergeDataErlangB(_0x2db212){return function(_0x50944f){loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x83'));loggerPredictive['info'](_0x7e6d('0x84'),_0x50944f[_0x7e6d('0x6f')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x85'),_0x50944f[_0x7e6d('0x70')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x86'),_0x50944f[_0x7e6d('0x87')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x88'),_0x50944f['erlangBusyFactor']);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x86'),_0x50944f[_0x7e6d('0x87')]);loggerPredictive['info'](_0x7e6d('0x80'));_[_0x7e6d('0x89')](_0x2db212,_0x50944f);};}function getDiff(_0x5cad18){var _0x340846=moment()[_0x7e6d('0x4c')](0x0);var _0x3c0f3a=moment(_0x5cad18)[_0x7e6d('0x4c')](0x0);return _0x340846[_0x7e6d('0x4d')](_0x3c0f3a,_0x7e6d('0x8a'));}function ifInterval(_0x49103f,_0xdae377){if(_['isUndefined'](_0xdae377)){return![];}return getDiff(_0xdae377)<_0x49103f*0x3c;}function freeVariablesPredictive(_0x16dab6){if(isNotNull(_0x16dab6)){if(!_[_0x7e6d('0x40')](_0x16dab6[_0x7e6d('0x2a')])){_0x16dab6[_0x7e6d('0x2a')]=undefined;loggerPredictive['info'](_0x16dab6[_0x7e6d('0x43')],_0x7e6d('0x8b'));}if(!_[_0x7e6d('0x40')](_0x16dab6['startPredictive'])){_0x16dab6[_0x7e6d('0x29')]=undefined;loggerPredictive['info'](_0x16dab6['name'],_0x7e6d('0x8c'));}if(!_[_0x7e6d('0x40')](_0x16dab6['handlePredictive'])){clearInterval(_0x16dab6[_0x7e6d('0x8d')]);_0x16dab6[_0x7e6d('0x8d')]=undefined;loggerPredictive[_0x7e6d('0x78')](_0x16dab6[_0x7e6d('0x43')],_0x7e6d('0x8e'));}}}function erlangb(_0x1a3054,_0x2a9f40){if(_0x2a9f40===0x0){return 0x0;}var _0x3843c9=0x1;for(var _0x2dc829=0x1;_0x2dc829<=_0x2a9f40;_0x2dc829+=0x1){_0x3843c9=0x1+_0x3843c9*_0x2dc829/_0x1a3054;}return 0x1/_0x3843c9;}function isVoiceQueueOutbound(_0x1a42df){return _0x1a42df===_0x7e6d('0x8f');}function isNotPreview(_0x1fcec1){return _0x1fcec1!==_0x7e6d('0x20');}function isCampaignIvr(_0x536533){return _0x536533===_0x7e6d('0x74');}function getCallerId(_0x12891f,_0x5c81bf,_0x22ba71){if(!_[_0x7e6d('0x40')](_0x22ba71)&&typeof _0x22ba71==='string'&&!_[_0x7e6d('0x49')](_0x22ba71)){if(!_[_0x7e6d('0x40')](_0x5c81bf)&&typeof _0x5c81bf==='string'&&!_[_0x7e6d('0x49')](_0x5c81bf)){return util[_0x7e6d('0x75')]('\x22%s\x22\x20<%s>',_0x5c81bf,_0x22ba71);}return util['format'](_0x7e6d('0x90'),_0x22ba71,_0x22ba71);}if(!_[_0x7e6d('0x40')](_0x12891f)&&typeof _0x12891f===_0x7e6d('0x91')&&!_['isEmpty'](_0x12891f)){return _0x12891f;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x22a2e9,_0x27ac69){return function(_0x209679){freeVariablesPredictive(_0x27ac69);emitVoiceQueueSummary(_0x27ac69);emitCampaignSummary(_0x27ac69);loggerSyncQueueSummary[_0x7e6d('0x92')](_0x22a2e9,util[_0x7e6d('0x93')](_0x209679,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4c36b8,_0x1a3640){return function(_0x2659ed){loggerPredictive[_0x7e6d('0x92')](_0x1a3640[_0x7e6d('0x43')],_0x4c36b8);loggerPredictive[_0x7e6d('0x92')](_0x2659ed[_0x7e6d('0x94')]);freeVariablesPredictive(_0x1a3640);};}function loggerCatch(_0x3dccc7){return function(_0x119605){logger['error'](_0x3dccc7,util[_0x7e6d('0x93')](_0x119605,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3e33ff){return _0x3e33ff&&!_[_0x7e6d('0x40')](_0x3e33ff)&&_0x3e33ff['length']>0x0;}function decremetOriginate(_0x5afb4c){if(!_[_0x7e6d('0x40')](_0x5afb4c)&&_0x5afb4c!==null){if(typeof _0x5afb4c[_0x7e6d('0x95')]!==_0x7e6d('0x96')){if(_0x5afb4c[_0x7e6d('0x95')]>0x0){_0x5afb4c[_0x7e6d('0x95')]-=0x1;}else{logger['error'](_0x7e6d('0x97'));}}}else{logger[_0x7e6d('0x92')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x26d979,_0x3b8772,_0x3e4443){if(_0x3b8772>_0x3e4443){for(var _0x2866cc=0x0;_0x2866cc<_0x3b8772-_0x3e4443;_0x2866cc+=0x1){decremetOriginate(_0x26d979);}}}function loggerGetContactDialer(_0x2b1135,_0x360203,_0x19d44a){return function(_0x4b3ddf){checkContactLowerLimitOriginate(_0x360203,_0x19d44a,0x0);logger[_0x7e6d('0x92')](_0x2b1135,util['inspect'](_0x4b3ddf,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1d1a29){return function(_0xfbfd2e){if(isNotNull(_0xfbfd2e)&&isNotNull(_0xfbfd2e[0x0])){if(_0xfbfd2e[0x0]['contactsRescheduled']>0x0){_0x1d1a29['message']=_0x7e6d('0x98');logger['info'](_0x7e6d('0x99')+_0x1d1a29['name'],_0xfbfd2e[0x0][_0x7e6d('0x9a')],_0x7e6d('0x9b'));}else{_0x1d1a29[_0x7e6d('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x7e6d('0x9c')+_0x1d1a29[_0x7e6d('0x43')]);}}};}function notSendMessagesQueue(_0x48682f){if(_0x48682f[_0x7e6d('0x9d')]){freeVariablesPredictive(_0x48682f);if(_0x48682f[_0x7e6d('0x95')]===0x0&&_0x48682f[_0x7e6d('0x9e')]===0x0&&_0x48682f['waiting']===0x0&&(_0x48682f[_0x7e6d('0x52')]||0x0)===0x0){_0x48682f[_0x7e6d('0x9d')]=![];_0x48682f['available']=0x0;_0x48682f[_0x7e6d('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x7e6d('0x92')](_0x7e6d('0x9f'),_0x48682f[_0x7e6d('0x43')],_0x7e6d('0xa0'));}else{_0x48682f['message']=_0x7e6d('0xa1');loggerSyncQueueSummary[_0x7e6d('0x92')](_0x7e6d('0x9f'),_0x48682f[_0x7e6d('0x43')],'is\x20disactive');}emitVoiceQueueSummary(_0x48682f);}}function notSendMessagesCampaign(_0x127149){if(_0x127149[_0x7e6d('0x9d')]){if(_0x127149[_0x7e6d('0x95')]===0x0){_0x127149[_0x7e6d('0x9d')]=![];_0x127149['message']=_0x7e6d('0xa2');loggerSyncQueueSummary[_0x7e6d('0x92')](_0x7e6d('0xa3'),_0x127149[_0x7e6d('0x43')],_0x7e6d('0xa0'));}else{_0x127149['message']=_0x7e6d('0xa1');loggerSyncQueueSummary[_0x7e6d('0x92')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x127149[_0x7e6d('0x43')],'is\x20disactive');}emitCampaignSummary(_0x127149);}}function createObjHistory(_0x298f4b,_0x597f5c,_0x3d22e1,_0x1f83fa,_0x2238a1){_0x298f4b[_0x7e6d('0x41')]=_0x3d22e1;var _0x33f2ed=new Action(_0x298f4b,_0x597f5c);var _0x4843be=new History(_0x33f2ed);_0x4843be[_0x7e6d('0xa4')]=_0x1f83fa;_0x4843be[_0x7e6d('0xa5')]=_0x2238a1;_0x4843be[_0x7e6d('0xa6')]=_0x33f2ed[_0x7e6d('0xa7')];return _0x4843be;}Dialer[_0x7e6d('0x1c')][_0x7e6d('0x3f')]=function(){var _0x3613c7=this;setInterval(function(){_0x3613c7[_0x7e6d('0xa8')](_0x3613c7['uniqueId'],_0x7e6d('0xa9'));_0x3613c7[_0x7e6d('0xa8')](_0x3613c7[_0x7e6d('0x26')],'[actions]');},0x32c8);};Dialer['prototype'][_0x7e6d('0xa8')]=function(_0x26b8c6,_0x2b5c64){var _0x691a59=this;for(var _0x181edd in _0x26b8c6){if(typeof _0x26b8c6[_0x181edd]!=='undefined'){this[_0x7e6d('0x1f')][_0x7e6d('0x1d')](function(){if(!_['isNil'](_0x26b8c6[_0x181edd])){return ami[_0x7e6d('0xaa')]({'action':_0x7e6d('0xab'),'channel':_0x26b8c6[_0x181edd]['channel']})[_0x7e6d('0xac')](function(_0x29e7b2){if(_0x29e7b2[_0x7e6d('0x41')]===_0x7e6d('0xad')){setTimeout(function(){if(_0x26b8c6[_0x181edd]&&_0x26b8c6[_0x181edd][_0x7e6d('0x4f')]!==_0x7e6d('0x74')){_0x691a59[_0x7e6d('0xae')](_0x691a59[_0x7e6d('0x21')][_0x26b8c6[_0x181edd][_0x7e6d('0xaf')]]);logger['error']('[Dialer][checkChannel]',_0x2b5c64,_0x181edd,_0x26b8c6[_0x181edd][_0x7e6d('0xaf')]);delete _0x26b8c6[_0x181edd];}if(_0x26b8c6[_0x181edd]&&_0x26b8c6[_0x181edd][_0x7e6d('0x4f')]===_0x7e6d('0x74')){_0x691a59['updateOriginated'](_0x691a59[_0x7e6d('0x22')][_0x26b8c6[_0x181edd][_0x7e6d('0xaf')]]);logger[_0x7e6d('0x92')]('[Dialer][checkChannel][ivr]',_0x2b5c64,_0x181edd,_0x26b8c6[_0x181edd]['queue']);delete _0x26b8c6[_0x181edd];}},0x2328);}});}});}}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xb0')]=function(_0x57091f){return BPromise['resolve']()[_0x7e6d('0xb1')](cmHopper[_0x7e6d('0xb0')](_0x57091f))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xb2')));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xb3')]=function(_0x1a5461){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopperBlack[_0x7e6d('0xb3')](_0x1a5461))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xb5')));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xb6')]=function(_0x1df110){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopperBlack[_0x7e6d('0xb6')](_0x1df110))['catch'](loggerCatch(_0x7e6d('0xb7')));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xb8')]=function(_0x35e3d0){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopperHistory[_0x7e6d('0xb9')](_0x35e3d0))['catch'](loggerCatch(_0x7e6d('0xba')));};Dialer['prototype'][_0x7e6d('0xbb')]=function(_0x4e4776){return BPromise['resolve']()[_0x7e6d('0xb1')](cmHopper['rescheduleContact'](_0x4e4776))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xbc')));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xbd')]=function(_0x565145,_0x32199a,_0x41334b){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopper[_0x7e6d('0xbd')](_0x565145,_0x32199a,_0x41334b))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xbe')]=function(_0x2867af,_0x32f192,_0x5311b1,_0x3b3b08,_0x37392c){return BPromise[_0x7e6d('0xb4')]()['then'](cmHopper[_0x7e6d('0xbe')](_0x2867af,_0x32f192,_0x5311b1,_0x3b3b08))[_0x7e6d('0xac')](function(_0x2c5f3d){_0x37392c[_0x7e6d('0xbf')]-=_0x5311b1;_0x37392c[_0x7e6d('0xbf')]=_0x37392c['temp']>0x0?_0x37392c[_0x7e6d('0xbf')]:0x0;loggerCatch(_0x7e6d('0xc0'))(_0x2c5f3d);});};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xc1')]=function(_0x29b0fd,_0x5813ee,_0x24f266,_0x15fa9e){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopper[_0x7e6d('0xc1')](_0x29b0fd,_0x5813ee,_0x24f266))['catch'](function(_0x262415){_0x15fa9e['temp']-=_0x5813ee;_0x15fa9e[_0x7e6d('0xbf')]=_0x15fa9e[_0x7e6d('0xbf')]>0x0?_0x15fa9e[_0x7e6d('0xbf')]:0x0;loggerCatch(_0x7e6d('0xc2'))(_0x262415);});};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x522ba2){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](voiceQueueRt[_0x7e6d('0xc3')](_0x522ba2))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xc4')));};Dialer['prototype'][_0x7e6d('0xc5')]=function(_0x58ea0b){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopper[_0x7e6d('0xc5')](_0x58ea0b))['catch'](loggerCatch(_0x7e6d('0xc6')));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xc7')]=function(_0x222271){return BPromise['resolve']()[_0x7e6d('0xb1')](cmHopperHistory[_0x7e6d('0xc7')](_0x222271))[_0x7e6d('0xac')](loggerCatch('[createHistory]\x20'));};Dialer['prototype'][_0x7e6d('0xae')]=function(_0x271d08){if(!_[_0x7e6d('0x40')](_0x271d08)&&_0x271d08!==null){if(typeof _0x271d08[_0x7e6d('0x95')]!==_0x7e6d('0x96')){if(_0x271d08[_0x7e6d('0x95')]>0x0){_0x271d08[_0x7e6d('0x95')]-=0x1;}else{logger[_0x7e6d('0x92')](_0x7e6d('0xc8'));}}}else{logger[_0x7e6d('0x92')](_0x7e6d('0xc9'));}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xca')]=function(_0x1fe656,_0x106038){var _0x2b5b5c=this;return function(_0x2aa908){_0x2b5b5c['updateOriginated'](_0x106038);logger[_0x7e6d('0x92')](_0x1fe656,util[_0x7e6d('0x93')](_0x2aa908,{'showHidden':![],'depth':null}));};};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xcb')]=function(_0x274777,_0x498146,_0x42a665){var _0x179912={'state':0x19,'statedesc':_0x7e6d('0xcc')};this['updateOriginated'](_0x498146);this[_0x7e6d('0xcd')](_[_0x7e6d('0x89')](_0x179912,_[_0x7e6d('0xce')](_0x42a665,['ContactId',_0x7e6d('0xcf'),_0x7e6d('0xd0'),_0x7e6d('0xd1'),_0x7e6d('0xd2')])),_0x7e6d('0xd3'),_0x7e6d('0xd4'));logger[_0x7e6d('0x92')](_0x274777);};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xd5')]=function(_0x1ce11b){return _0x1ce11b===_0x7e6d('0xd6');};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xd7')]=function(_0x177317){return!_['isUndefined'](_0x177317)&&_0x177317&&!_[_0x7e6d('0x40')](_0x177317['name'])&&!_[_0x7e6d('0x40')](_0x177317['active'])&&_0x177317[_0x7e6d('0xd8')]&&(this['trunks'][util[_0x7e6d('0x75')](_0x7e6d('0xd9'),_0x177317[_0x7e6d('0x43')])]['status']===_0x7e6d('0xda')||this[_0x7e6d('0x24')][util['format'](_0x7e6d('0xd9'),_0x177317[_0x7e6d('0x43')])][_0x7e6d('0xab')]===_0x7e6d('0xdb'));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xcd')]=function(_0x468e2c,_0x178502,_0x13e3b1){this[_0x7e6d('0xc7')](_0x468e2c)[_0x7e6d('0xac')](loggerCatch(_0x178502));this['moveContactManagedDialer'](_0x468e2c)[_0x7e6d('0xac')](loggerCatch(_0x13e3b1));};Dialer['prototype'][_0x7e6d('0x3a')]=function(_0xfb1a87){var _0x5b93da=this[_0x7e6d('0x28')][_0xfb1a87[_0x7e6d('0xdc')]];var _0x18f2df;if(!_['isNil'](_0xfb1a87)&&!_[_0x7e6d('0xdd')](_0xfb1a87[_0x7e6d('0xde')])&&!_[_0x7e6d('0xdd')](_0xfb1a87[_0x7e6d('0xde')][_0x7e6d('0xdf')])&&_0xfb1a87[_0x7e6d('0xe0')]==='xcally-motion-dialer'&&_0x5b93da){if(_0x5b93da['type']!=='ivr'&&this[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe1')]&&_0xfb1a87[_0x7e6d('0xe2')]==='HANGUP'){delete this[_0x7e6d('0x28')][_0xfb1a87[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]]);this[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0x5d')]+=0x1;this[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe3')]+=0x1;_0x18f2df=new Hangup(_0x5b93da,_0xfb1a87);_0x18f2df[_0x7e6d('0xa4')]=0x12;_0x18f2df['statedesc']=_0x7e6d('0xe4');_0x18f2df['membername']=_0x7e6d('0xe5');ami[_0x7e6d('0x4e')](_0x7e6d('0xe6'),ut[_0x7e6d('0xe7')](_0x18f2df,_0x7e6d('0xe8')));this[_0x7e6d('0xcd')](_0x18f2df,'[syncHangupInAMD][createHistory]',_0x7e6d('0xe9'));}if(_0x5b93da[_0x7e6d('0x4f')]!==_0x7e6d('0x74')&&this['voiceQueues'][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe1')]&&_0xfb1a87[_0x7e6d('0xe2')]===_0x7e6d('0xea')){var _0x431bca=this;return new BPromise(function(_0x48ba6d,_0x491b00){delete _0x431bca[_0x7e6d('0x28')][_0xfb1a87[_0x7e6d('0xdc')]];_0x431bca['updateOriginated'](_0x431bca[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]]);_0x431bca[_0x7e6d('0x21')][_0x5b93da['queue']]['outboundAnswerCallsDay']+=0x1;_0x431bca[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe3')]+=0x1;var _0x90f5b2=_0x431bca[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]];var _0x399adf=new Hangup(_0x5b93da,_0xfb1a87);_0x399adf[_0x7e6d('0xa4')]=0x13;_0x399adf[_0x7e6d('0xa5')]=_0x7e6d('0xeb');_0x399adf[_0x7e6d('0xec')]=_0x7e6d('0xe5');_0x399adf[_0x7e6d('0xed')]+=0x1;_0x399adf[_0x7e6d('0xee')]+=0x1;_0x399adf[_0x7e6d('0xe8')]=!![];ami[_0x7e6d('0x4e')]('custom:amd',ut[_0x7e6d('0xe7')](_0x399adf,_0x7e6d('0xe8')));_0x431bca[_0x7e6d('0xc7')](_0x399adf)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xef')));if(_0x399adf[_0x7e6d('0xf0')]+_0x399adf[_0x7e6d('0xf1')]+_0x399adf[_0x7e6d('0xf2')]+_0x399adf[_0x7e6d('0xf3')]+_0x399adf[_0x7e6d('0xf4')]+_0x399adf['countabandonedretry']+_0x399adf[_0x7e6d('0xed')]+_0x399adf['countagentrejectretry']>=_0x90f5b2[_0x7e6d('0xf5')]){_0x431bca[_0x7e6d('0xf6')](_0x399adf,_0x48ba6d,_0x491b00,_0x7e6d('0xf7'));}else{if(_0x399adf[_0x7e6d('0xed')]>=_0x90f5b2['dialMachineMaxRetry']){_0x431bca['createStateFinal'](_0x399adf,_0x48ba6d,_0x491b00,_0x7e6d('0xf8'));}else{_0x431bca['rescheduleContact']({'active':![],'countmachineretry':_0x399adf[_0x7e6d('0xed')],'scheduledat':moment()[_0x7e6d('0xf9')](_0x90f5b2[_0x7e6d('0xfa')],'minutes')[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x399adf[_0x7e6d('0xfc')],'ListId':_0x399adf[_0x7e6d('0xcf')],'VoiceQueueId':_0x399adf[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x399adf[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch('[rescheduleContact][Machine]'));_0x48ba6d({'reschedule':0x1});}}});}if(_0x5b93da[_0x7e6d('0x4f')]===_0x7e6d('0x74')&&this[_0x7e6d('0x22')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe1')]&&_0xfb1a87[_0x7e6d('0xe2')]===_0x7e6d('0xfd')){delete this['uniqueId'][_0xfb1a87[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this['campaigns'][_0x5b93da[_0x7e6d('0xaf')]]);_0x18f2df=new Hangup(_0x5b93da,_0xfb1a87);_0x18f2df['state']=0x12;_0x18f2df[_0x7e6d('0xa5')]=_0x7e6d('0xe4');_0x18f2df[_0x7e6d('0xec')]=_0x7e6d('0xe5');ami[_0x7e6d('0x4e')]('custom:amd',ut['buildObj'](_0x18f2df,_0x7e6d('0xe8')));this['saveInDb'](_0x18f2df,_0x7e6d('0xfe'),_0x7e6d('0xff'));}if(_0x5b93da['type']===_0x7e6d('0x74')&&this[_0x7e6d('0x22')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe1')]&&_0xfb1a87[_0x7e6d('0xe2')]===_0x7e6d('0xea')){var _0x431bca=this;return new BPromise(function(_0x21fecc,_0x2b1faa){delete _0x431bca[_0x7e6d('0x28')][_0xfb1a87['uniqueid']];_0x431bca[_0x7e6d('0xae')](_0x431bca[_0x7e6d('0x22')][_0x5b93da['queue']]);_0x431bca[_0x7e6d('0x22')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0x5d')]+=0x1;_0x431bca[_0x7e6d('0x22')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe3')]+=0x1;var _0x831146=_0x431bca[_0x7e6d('0x22')][_0x5b93da[_0x7e6d('0xaf')]];var _0x39ccf3=new Hangup(_0x5b93da,_0xfb1a87);_0x39ccf3[_0x7e6d('0xa4')]=0x13;_0x39ccf3['statedesc']=_0x7e6d('0xeb');_0x39ccf3[_0x7e6d('0xec')]=_0x7e6d('0xe5');_0x39ccf3['countmachineretry']+=0x1;_0x39ccf3[_0x7e6d('0xee')]+=0x1;_0x39ccf3['amd']=!![];ami[_0x7e6d('0x4e')]('custom:amd',ut[_0x7e6d('0xe7')](_0x39ccf3,_0x7e6d('0xe8')));_0x431bca[_0x7e6d('0xc7')](_0x39ccf3)[_0x7e6d('0xac')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x39ccf3[_0x7e6d('0xf0')]+_0x39ccf3['countcongestionretry']+_0x39ccf3[_0x7e6d('0xf2')]+_0x39ccf3['countnosuchnumberretry']+_0x39ccf3[_0x7e6d('0xf4')]+_0x39ccf3[_0x7e6d('0x100')]+_0x39ccf3['countmachineretry']+_0x39ccf3[_0x7e6d('0x101')]>=_0x831146[_0x7e6d('0xf5')]){_0x431bca[_0x7e6d('0xf6')](_0x39ccf3,_0x21fecc,_0x2b1faa,_0x7e6d('0xf7'));}else{if(_0x39ccf3[_0x7e6d('0xed')]>=_0x831146['dialMachineMaxRetry']){_0x431bca[_0x7e6d('0x102')](_0x39ccf3,_0x21fecc,_0x2b1faa,_0x7e6d('0xf8'));}else{_0x431bca[_0x7e6d('0xbb')]({'active':![],'countmachineretry':_0x39ccf3['countmachineretry'],'scheduledat':moment()[_0x7e6d('0xf9')](_0x831146['dialMachineRetryFrequency'],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x39ccf3[_0x7e6d('0xfc')],'ListId':_0x39ccf3[_0x7e6d('0xcf')],'VoiceQueueId':_0x39ccf3[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x39ccf3[_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch(_0x7e6d('0x104')));_0x21fecc({'reschedule':0x1});}}});}}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x37')]=function(_0x489a67){var _0x1298b7=this[_0x7e6d('0x28')][_0x489a67[_0x7e6d('0xdc')]];var _0x4efd72=this;var _0x2e5647;if(_0x1298b7&&_0x1298b7[_0x7e6d('0x4f')]===_0x7e6d('0x74')){delete this[_0x7e6d('0x28')][_0x489a67[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this[_0x7e6d('0x22')][_0x1298b7['queue']]);this[_0x7e6d('0x22')][_0x1298b7['queue']][_0x7e6d('0x105')]+=0x1;_0x2e5647=new Hangup(_0x1298b7,_0x489a67);this[_0x7e6d('0xc7')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x106')));this[_0x7e6d('0xc5')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x107')));}if(_0x1298b7&&_0x1298b7[_0x7e6d('0x4f')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x1298b7[_0x7e6d('0xaf')]][_0x7e6d('0x108')])){delete this[_0x7e6d('0x28')][_0x489a67[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this['voiceQueues'][_0x1298b7[_0x7e6d('0xaf')]]);this[_0x7e6d('0x21')][_0x1298b7[_0x7e6d('0xaf')]][_0x7e6d('0x5d')]+=0x1;this[_0x7e6d('0x21')][_0x1298b7[_0x7e6d('0xaf')]][_0x7e6d('0xe3')]+=0x1;_0x2e5647=new Hangup(_0x1298b7,_0x489a67);_0x2e5647[_0x7e6d('0xa4')]=0x10;_0x2e5647[_0x7e6d('0xa5')]=_0x7e6d('0x109');_0x2e5647[_0x7e6d('0xec')]=_0x7e6d('0x10a');this[_0x7e6d('0xc7')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x106')));this[_0x7e6d('0xc5')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x107')));}if(_0x1298b7&&_0x1298b7[_0x7e6d('0x4f')]!==_0x7e6d('0x74')&&!isNotNull(this['voiceQueues'][_0x1298b7[_0x7e6d('0xaf')]]['dialQueueProject'])){delete this['uniqueId'][_0x489a67[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this[_0x7e6d('0x21')][_0x1298b7[_0x7e6d('0xaf')]]);this[_0x7e6d('0x21')][_0x1298b7[_0x7e6d('0xaf')]][_0x7e6d('0x67')]+=0x1;_0x2e5647=new Hangup(_0x1298b7,_0x489a67);_0x2e5647[_0x7e6d('0xa4')]=0xc;_0x2e5647[_0x7e6d('0xa5')]=_0x489a67[_0x7e6d('0x10b')];_0x2e5647[_0x7e6d('0xec')]=_0x7e6d('0x10c');this[_0x7e6d('0xc7')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x7e6d('0xc5')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype']['syncAgentComplete']=function(_0x2a25c8){var _0xf10c14=this[_0x7e6d('0x28')][_0x2a25c8[_0x7e6d('0xdc')]];var _0x331761=this;if(this[_0x7e6d('0x21')][_0x2a25c8['queue']]){if(_0xf10c14&&_0xf10c14[_0x7e6d('0x4f')]!==_0x7e6d('0x74')){delete this['uniqueId'][_0x2a25c8[_0x7e6d('0xdc')]];this[_0x7e6d('0x21')][_0x2a25c8['queue']][_0x7e6d('0x5d')]+=0x1;var _0x527180=new AgentComplete(_0xf10c14,_0x2a25c8);if(_0x2a25c8['reason']===_0x7e6d('0x10d')){_0x527180[_0x7e6d('0x10e')]=this[_0x7e6d('0x21')][_0x2a25c8[_0x7e6d('0xaf')]][_0x7e6d('0x10f')]&&this['voiceQueues'][_0x2a25c8[_0x7e6d('0xaf')]][_0x7e6d('0x110')]?moment()[_0x7e6d('0x75')](_0x7e6d('0xfb')):undefined;}this[_0x7e6d('0xc7')](_0x527180)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x111')));this[_0x7e6d('0xc5')](_0x527180)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x7e6d('0x1c')]['syncAgentConnect']=function(_0x556a9e){if(this[_0x7e6d('0x21')][_0x556a9e[_0x7e6d('0xaf')]]){if(this[_0x7e6d('0x28')][_0x556a9e['uniqueid']]&&this[_0x7e6d('0x28')][_0x556a9e[_0x7e6d('0xdc')]][_0x7e6d('0x4f')]!==_0x7e6d('0x74')){this[_0x7e6d('0xae')](this[_0x7e6d('0x21')][_0x556a9e[_0x7e6d('0xaf')]]);this[_0x7e6d('0x28')][_0x556a9e['uniqueid']][_0x7e6d('0x112')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));}}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x113')]=function(_0x4381e5){this[_0x7e6d('0xc7')](_0x4381e5)['catch'](loggerCatch(_0x7e6d('0x111')));this[_0x7e6d('0xc5')](_0x4381e5)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x114')));};Dialer['prototype'][_0x7e6d('0x30')]=function(_0x53e270){var _0x4c89a3=this[_0x7e6d('0x28')][_0x53e270[_0x7e6d('0xdc')]];var _0x10ae78=this;if(this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]]){if(_0x4c89a3&&_0x4c89a3[_0x7e6d('0x4f')]!=='ivr'){delete this[_0x7e6d('0x28')][_0x53e270[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this[_0x7e6d('0x21')][_0x53e270['queue']]);_0x4c89a3[_0x7e6d('0x115')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));var _0x475dba=new QueueCallerAbandon(_0x4c89a3,_0x53e270);if(getSeconds(_0x4c89a3[_0x7e6d('0x115')],_0x4c89a3['responsetime'])>=_0x4c89a3[_0x7e6d('0x116')]){this['voiceQueues'][_0x53e270[_0x7e6d('0xaf')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]][_0x7e6d('0x63')]+=0x1;this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]][_0x7e6d('0x117')]+=0x1;_0x475dba['state']=0xa;_0x475dba['statedesc']=_0x7e6d('0x118');_0x475dba[_0x7e6d('0x119')]='TIMEOUT';_0x475dba[_0x7e6d('0x10e')]=this[_0x7e6d('0x21')][_0x53e270['queue']][_0x7e6d('0x10f')]?moment()[_0x7e6d('0x75')](_0x7e6d('0xfb')):undefined;_0x475dba[_0x7e6d('0xf4')]+=0x1;_0x475dba[_0x7e6d('0xee')]+=0x1;if(_0x475dba[_0x7e6d('0xf4')]>=this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]]['dialDropMaxRetry']){this[_0x7e6d('0x113')](_0x475dba);}else{this[_0x7e6d('0xbb')]({'active':![],'countdropretry':_0x475dba[_0x7e6d('0xf4')],'scheduledat':moment()['add'](this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]]['dialDropRetryFrequency'],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x4c89a3[_0x7e6d('0xfc')],'ListId':_0x4c89a3[_0x7e6d('0xcf')],'VoiceQueueId':_0x4c89a3['VoiceQueueId']||undefined,'CampaignId':_0x4c89a3[_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch(_0x7e6d('0x11a')));var _0x1179fb=new History(_0x475dba);_0x1179fb[_0x7e6d('0xa4')]=0xa;_0x1179fb[_0x7e6d('0xa5')]='Drop';_0x1179fb[_0x7e6d('0xa7')]=moment()[_0x7e6d('0x75')]('YYYY-MM-DD\x20HH:mm:ss');_0x1179fb[_0x7e6d('0xa6')]=_0x1179fb[_0x7e6d('0xa7')];_0x1179fb['calleridname']=_0x475dba[_0x7e6d('0x11b')];_0x1179fb[_0x7e6d('0x11c')]=_0x475dba[_0x7e6d('0x11c')];this[_0x7e6d('0xc7')](_0x1179fb)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x11d')));}}else{this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]][_0x7e6d('0x6a')]+=0x1;this['voiceQueues'][_0x53e270[_0x7e6d('0xaf')]]['outboundDropCallsDayCallersExit']+=0x1;_0x475dba[_0x7e6d('0xa4')]=0xb;_0x475dba['statedesc']=_0x7e6d('0x11e');_0x475dba[_0x7e6d('0x119')]=_0x7e6d('0x11f');_0x475dba[_0x7e6d('0x100')]+=0x1;_0x475dba[_0x7e6d('0xee')]+=0x1;if(_0x475dba[_0x7e6d('0x100')]>=this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]][_0x7e6d('0x120')]){this[_0x7e6d('0x113')](_0x475dba);}else{this[_0x7e6d('0xbb')]({'active':![],'countabandonedretry':_0x475dba[_0x7e6d('0x100')],'scheduledat':moment()[_0x7e6d('0xf9')](this['voiceQueues'][_0x53e270['queue']][_0x7e6d('0x121')],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x4c89a3[_0x7e6d('0xfc')],'ListId':_0x4c89a3[_0x7e6d('0xcf')],'VoiceQueueId':_0x4c89a3[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x4c89a3[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x122')));var _0x1179fb=new History(_0x475dba);_0x1179fb[_0x7e6d('0xa4')]=0xb;_0x1179fb[_0x7e6d('0xa5')]=_0x7e6d('0x11e');_0x1179fb[_0x7e6d('0xa7')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));_0x1179fb[_0x7e6d('0xa6')]=_0x1179fb[_0x7e6d('0xa7')];_0x1179fb[_0x7e6d('0x11b')]=_0x475dba['calleridname'];_0x1179fb['calleridnum']=_0x475dba[_0x7e6d('0x11c')];this[_0x7e6d('0xc7')](_0x1179fb)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x123')));}}}}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x39')]=function(_0x317e08){if(this[_0x7e6d('0x26')][_0x317e08[_0x7e6d('0xdc')]]){this['actions'][_0x317e08[_0x7e6d('0xdc')]][_0x7e6d('0x124')]=_0x317e08[_0x7e6d('0x124')];}if(this[_0x7e6d('0x28')][_0x317e08[_0x7e6d('0xdc')]]){this[_0x7e6d('0x28')][_0x317e08[_0x7e6d('0xdc')]]['channel']=_0x317e08[_0x7e6d('0x124')];}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x3b')]=function(_0x12487a){if(strategy[this['voiceQueues'][this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]][_0x7e6d('0xaf')]][_0x7e6d('0x126')]]==='roundrobin'){if(this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]]&&_[_0x7e6d('0xdd')](this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]][_0x7e6d('0x127')])&&_0x12487a[_0x7e6d('0xab')]==='1'&&_0x12487a[_0x7e6d('0x128')]==='0'){if(this['agents'][_0x12487a['stateinterface']]){if(!this['agents'][_0x12487a[_0x7e6d('0x129')]][_0x7e6d('0x127')]){this[_0x7e6d('0x23')][_0x12487a[_0x7e6d('0x129')]][_0x7e6d('0x127')]=!![];this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]][_0x7e6d('0x127')]=!![];this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]]['stateinterface']=_0x12487a[_0x7e6d('0x129')];}}}}else if((strategy[this[_0x7e6d('0x21')][this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]]['queue']][_0x7e6d('0x126')]]||_0x7e6d('0x1a'))===_0x7e6d('0x1a')){if(this['actions'][_0x12487a[_0x7e6d('0x125')]]){if(this['agents'][_0x12487a[_0x7e6d('0x129')]]){this[_0x7e6d('0x26')][_0x12487a['actionid']]['stateinterface']=_0x12487a[_0x7e6d('0x129')];if(_[_0x7e6d('0xdd')](this[_0x7e6d('0x2c')][this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]][_0x7e6d('0xaf')]])){this[_0x7e6d('0x2c')][this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]]['queue']]=[];}this[_0x7e6d('0x2c')][this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]][_0x7e6d('0xaf')]][_0x7e6d('0x12a')](_[_0x7e6d('0x89')](_[_0x7e6d('0xce')](this['actions'][_0x12487a[_0x7e6d('0x125')]],['idHopper',_0x7e6d('0x129')]),{'status':_0x12487a[_0x7e6d('0xab')],'paused':_0x12487a['paused']}));}}}};function unlockQueueStatus(_0x1f47b6,_0x54d68f){setTimeout(function(){if(_[_0x7e6d('0x40')](_0x1f47b6[_0x7e6d('0x12b')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x54d68f);}_0x1f47b6['queueStatusComplete']=!![];loggerBooked['info'](_0x7e6d('0x12c'),_0x54d68f,JSON[_0x7e6d('0x4b')](_[_0x7e6d('0xce')](_0x1f47b6,[_0x7e6d('0x43'),_0x7e6d('0x12b')])));},0x1f3);}Dialer[_0x7e6d('0x1c')][_0x7e6d('0x3d')]=function(_0x4b0fc1){var _0x3cd207=this;var _0x48d4b3=_0x3cd207[_0x7e6d('0x21')][_0x3cd207[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xaf')]];if(strategy[this[_0x7e6d('0x21')][this[_0x7e6d('0x26')][_0x4b0fc1['actionid']][_0x7e6d('0xaf')]][_0x7e6d('0x126')]]===_0x7e6d('0x1b')){if(this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]&&this[_0x7e6d('0x26')][_0x4b0fc1['actionid']][_0x7e6d('0x129')]){this[_0x7e6d('0x20')][_0x7e6d('0x12d')](this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0x12e')],this[_0x7e6d('0x26')][_0x4b0fc1['actionid']][_0x7e6d('0x129')])[_0x7e6d('0xac')](function(_0x2e8a01){logger[_0x7e6d('0x92')](_0x7e6d('0x12f'),util[_0x7e6d('0x93')](_0x2e8a01,{'showHidden':![],'depth':null}));})[_0x7e6d('0x130')](function(){_0x3cd207[_0x7e6d('0xae')](_0x3cd207[_0x7e6d('0x21')][_0x3cd207[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xaf')]]);_0x3cd207[_0x7e6d('0x23')][_0x3cd207[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0x129')]][_0x7e6d('0x127')]=![];delete _0x3cd207[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]];unlockQueueStatus(_0x48d4b3);});}else{this[_0x7e6d('0xae')](this[_0x7e6d('0x21')][this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]['queue']]);this[_0x7e6d('0xbb')]({'active':![],'ContactId':this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xfc')],'ListId':this['actions'][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xcf')],'VoiceQueueId':this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xd1')]||undefined,'CampaignId':this[_0x7e6d('0x26')][_0x4b0fc1['actionid']][_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch(_0x7e6d('0x131')));delete this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]];unlockQueueStatus(_0x48d4b3);}}else if((strategy[this[_0x7e6d('0x21')][this['actions'][_0x4b0fc1['actionid']][_0x7e6d('0xaf')]]['strategy']]||_0x7e6d('0x1a'))===_0x7e6d('0x1a')){var _0x357f6b;if(this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]&&!_[_0x7e6d('0x49')](this[_0x7e6d('0x2c')][this['actions'][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xaf')]])){if(this[_0x7e6d('0x132')][_0x3cd207[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]['queue']]){this[_0x7e6d('0x132')][_0x3cd207[_0x7e6d('0x26')][_0x4b0fc1['actionid']]['queue']]=this['queueBookedRR'][this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xaf')]]?this['queueBookedRR'][this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]['queue']]:this[_0x7e6d('0x2c')][this[_0x7e6d('0x26')][_0x4b0fc1['actionid']][_0x7e6d('0xaf')]]?this[_0x7e6d('0x2c')][this['actions'][_0x4b0fc1['actionid']][_0x7e6d('0xaf')]][_0x7e6d('0x133')]||0x0:0x0;}this[_0x7e6d('0x2c')][this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]['queue']][_0x7e6d('0x133')]=this[_0x7e6d('0x132')][this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xaf')]];for(var _0x241dd=0x0;_0x241dd=0x0;})[_0x7e6d('0xac')](myreject(_0x4a6b57)));}}else{_0x3bbcc4[_0x7e6d('0x12a')](ami['Action']({'action':_0x7e6d('0x148'),'command':util[_0x7e6d('0x75')](_0x7e6d('0x14d'),_0x4fa5bd,!_[_0x7e6d('0x40')](config[_0x7e6d('0x145')][_0x168a59])?_0x168a59:'')})['then'](function(_0x597464){return _0x597464[_0x7e6d('0x14a')][_0x7e6d('0x14b')](_0x7e6d('0x14c'))>=0x0;})['catch'](myreject(_0x4a6b57)));}BPromise[_0x7e6d('0x14e')](_0x3bbcc4)[_0x7e6d('0xb1')](function(_0x3def00){var _0xba3c86=_[_0x7e6d('0x14f')](_0x3def00);if(_0xba3c86){return _0x343521(_0xba3c86);}else{_0x576eca[_0x7e6d('0x41')]=_0x47b0c9?_0x7e6d('0x150'):_0x7e6d('0x151');return _0x4a6b57(msgResponse(_0x7e6d('0x152'),_0x7e6d('0x142'),_0x7e6d('0x153')+_0x47b0c9+'\x20'+_0x1ce596+_0x7e6d('0x154')+util[_0x7e6d('0x93')](_0x4fa5bd,{'showHidden':![],'depth':null})+_0x7e6d('0x155')+_0x168a59));}})['catch'](function(_0x52e193){return _0x4a6b57(msgResponse(_0x7e6d('0x140'),_0x7e6d('0x142'),JSON[_0x7e6d('0x4b')](_0x52e193)));});});};Dialer[_0x7e6d('0x1c')]['checkDialMethod']=function(_0x191690){var _0x1b671d=this;return function(){switch(_0x191690[_0x7e6d('0x156')]){case'progressive':freeVariablesPredictive(_0x191690);_0x1b671d[_0x7e6d('0x157')](_0x191690,0x1);break;case _0x7e6d('0x158'):freeVariablesPredictive(_0x191690);_0x1b671d[_0x7e6d('0x157')](_0x191690,_0x191690[_0x7e6d('0x159')]);break;case'predictive':_0x1b671d[_0x7e6d('0x8')](_0x191690);break;case'booked':freeVariablesPredictive(_0x191690);_0x1b671d[_0x7e6d('0x157')](_0x191690,0x1);break;default:freeVariablesPredictive(_0x191690);logger[_0x7e6d('0x92')](_0x7e6d('0x15a'),_0x191690['name'],_0x7e6d('0x15b'));}};};Dialer['prototype'][_0x7e6d('0x15c')]=function(_0x408128){var _0x2f8d96=this;return function(){_0x2f8d96[_0x7e6d('0x15d')](_0x408128);};};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xa')]=function(_0x199338){var _0x5c396f=this;if(isNotPreview(_0x199338['dialMethod'])){if(isVoiceQueueOutbound(_0x199338[_0x7e6d('0x4f')])&&isActive(_0x199338[_0x7e6d('0x5a')])){_0x199338['sendMessageOneNotActive']=!![];BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](checkIsLoggedIn(_0x199338,_0x199338[_0x7e6d('0x51')]))[_0x7e6d('0xb1')](checkIsActive(_0x199338,_0x199338[_0x7e6d('0x5a')]))[_0x7e6d('0xb1')](checkInterval(_0x199338))['then'](_0x5c396f[_0x7e6d('0x13d')](_0x199338))[_0x7e6d('0xb1')](_0x5c396f[_0x7e6d('0x15e')](_0x199338[_0x7e6d('0x15f')],_0x199338[_0x7e6d('0x160')],_0x199338['name'],_0x199338))[_0x7e6d('0xb1')](_0x5c396f[_0x7e6d('0x141')](_0x199338[_0x7e6d('0x47')],_0x199338['dialTimezone'],_0x199338[_0x7e6d('0x43')],_0x199338))[_0x7e6d('0xb1')](_0x5c396f[_0x7e6d('0x161')](_0x199338))['catch'](loggerCatchQueueSummary(_0x7e6d('0x162'),_0x199338));}else{notSendMessagesQueue(_0x199338);}}else{freeVariablesPredictive(_0x199338);}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x13c')]=function(){var _0x34a65b=this;var _0x1916ed;for(var _0x277afe in this[_0x7e6d('0x22')]){if(typeof this[_0x7e6d('0x22')][_0x277afe]!==_0x7e6d('0x96')){_0x1916ed=this[_0x7e6d('0x22')][_0x277afe];if(isCampaignIvr(_0x1916ed['type'])&&isActive(_0x1916ed[_0x7e6d('0xd8')])){_0x1916ed[_0x7e6d('0x9d')]=!![];BPromise[_0x7e6d('0xb4')]()['then'](checkIsActive(_0x1916ed,_0x1916ed[_0x7e6d('0xd8')]))[_0x7e6d('0xb1')](checkInterval(_0x1916ed))[_0x7e6d('0xb1')](_0x34a65b[_0x7e6d('0x13d')](_0x1916ed))['then'](_0x34a65b[_0x7e6d('0x15e')](_0x1916ed['dialGlobalInterval'],_0x1916ed[_0x7e6d('0x160')],_0x1916ed[_0x7e6d('0x43')],_0x1916ed))[_0x7e6d('0xb1')](_0x34a65b['checkIfTimeIntervals'](_0x1916ed['Interval'],_0x1916ed[_0x7e6d('0x160')],_0x1916ed[_0x7e6d('0x43')],_0x1916ed))['then'](_0x34a65b[_0x7e6d('0x15c')](_0x1916ed))['catch'](loggerCatchQueueSummary(_0x7e6d('0x163'),_0x1916ed));}else{notSendMessagesCampaign(_0x1916ed);}}}};function getCallerIdRandom(_0x34fc52,_0x3af23b){var _0x1feafd;var _0x56871d;var _0x79424c;if(_0x3af23b<=0x0){_0x3af23b=0x1;}_0x1feafd=new RegExp('\x5cw{0,'+_0x3af23b+'}$');_0x56871d=Math['pow'](0xa,_0x3af23b-0x1);_0x79424c=Math[_0x7e6d('0x164')](0xa,_0x3af23b)-0x1;return util[_0x7e6d('0x75')]('%s',_[_0x7e6d('0x165')](_0x34fc52,_0x1feafd,_['random'](_0x56871d,_0x79424c)));}function extractCalleridName(_0xe59409){var _0xeab0=_0xe59409[_0x7e6d('0x166')](/"(.*?)"/);return _0xeab0?_0xeab0[0x1]:_0xe59409;}function extractCalleridNumber(_0x57b90a){var _0x1b712a=_0x57b90a[_0x7e6d('0x166')](/<(.*?)>/);return _0x1b712a?_0x1b712a[0x1]:_0x57b90a;}Dialer['prototype'][_0x7e6d('0x167')]=function(_0x5258d5,_0x8c6ffd){var _0x4f5402=this;var _0xd1fc5e=uuid['v4']();this[_0x7e6d('0x26')][_0xd1fc5e]=new Action(_0x5258d5,_0x8c6ffd,_0xd1fc5e);return new BPromise(function(_0x5958a1,_0x31e363){if(_[_0x7e6d('0x40')](_0x5258d5)&&typeof _0x5258d5!=='object'){return _0x31e363(msgResponse(_0x7e6d('0x168'),_0x7e6d('0x142'),_0x7e6d('0x169')));}if(_[_0x7e6d('0x40')](_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')])||_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')]===null){return _0x31e363(msgResponse(_0x7e6d('0x168'),'Failure',_0x7e6d('0x16c')));}var _0x190467={'XMD-CALLERID':_0x4f5402[_0x7e6d('0x26')][_0xd1fc5e][_0x7e6d('0x16d')](),'XMD-AGI':_0x5258d5[_0x7e6d('0x108')]?util[_0x7e6d('0x75')](_0x7e6d('0x16e'),ipAgi,_0x5258d5[_0x7e6d('0x108')]):'NONE','XMD-AGIAFTER':_0x5258d5['dialQueueProject2']?util[_0x7e6d('0x75')](_0x7e6d('0x16e'),ipAgi,_0x5258d5[_0x7e6d('0x10f')]):'NONE','XMD-QUEUE':_0x5258d5['type']===_0x7e6d('0x8f')?util[_0x7e6d('0x75')](_0x7e6d('0x16f'),_0x5258d5['name'],_0x5258d5[_0x7e6d('0x170')]||'',_0x5258d5[_0x7e6d('0x110')]?'c':'',_0x5258d5[_0x7e6d('0x116')]||0x3):_0x7e6d('0x171'),'XMD-CONTACTID':_0x8c6ffd[_0x7e6d('0xfc')],'XMD-CDRTYPE':_0x7e6d('0x172'),'CALLERID(all)':_0x4f5402[_0x7e6d('0x26')][_0xd1fc5e][_0x7e6d('0x16d')](),'XMD-AMD':_0x5258d5[_0x7e6d('0xe1')]?_0x7e6d('0x173'):_0x7e6d('0x171'),'XMD-DESTINATION':_0x7e6d('0x174')};if(_0x5258d5['dialAMDActive']){_0x190467[_0x7e6d('0x175')]=_0x5258d5[_0x7e6d('0x176')]||0x9c4;_0x190467[_0x7e6d('0x177')]=_0x5258d5[_0x7e6d('0x178')]||0x5dc;_0x190467[_0x7e6d('0x179')]=_0x5258d5[_0x7e6d('0x17a')]||0x320;_0x190467['XMD-AMDTOTALANALYSISTIME']=_0x5258d5[_0x7e6d('0x17b')]||0x1388;_0x190467['XMD-AMDMINWORDLENGTH']=_0x5258d5[_0x7e6d('0x17c')]||0x64;_0x190467[_0x7e6d('0x17d')]=_0x5258d5[_0x7e6d('0x17e')]||0x32;_0x190467[_0x7e6d('0x17f')]=_0x5258d5[_0x7e6d('0x180')]||0x3;_0x190467[_0x7e6d('0x181')]=_0x5258d5[_0x7e6d('0x182')]||0x100;_0x190467[_0x7e6d('0x183')]=_0x5258d5[_0x7e6d('0x184')]||0x1388;}if(_0x5258d5[_0x7e6d('0x4f')]===_0x7e6d('0x8f')){_0x190467[_0x7e6d('0x185')]=_0x8c6ffd['VoiceQueueId'];}else{_0x190467[_0x7e6d('0x186')]=_0x8c6ffd[_0x7e6d('0xd2')];}for(var _0x59352d in _0x8c6ffd['Contact']){if(typeof _0x8c6ffd[_0x7e6d('0x16a')][_0x59352d]!=='undefined'){if(isNotNull(_0x8c6ffd[_0x7e6d('0x16a')][_0x59352d])&&_0x59352d!=='id'&&_0x59352d!==_0x7e6d('0x187')&&_0x59352d!==_0x7e6d('0x188')&&_0x59352d!==_0x7e6d('0x189')){_0x190467[util[_0x7e6d('0x75')]('%s%s',_0x7e6d('0x18a'),_['toUpper'](_0x59352d))]=_0x8c6ffd['Contact'][_0x59352d];}}}var _0x52244=_0x4f5402['isTrunkReachable'](_0x5258d5['Trunk'])?getCallerId(_0x5258d5['Trunk']['callerid'],_0x5258d5[_0x7e6d('0x18b')],_0x5258d5[_0x7e6d('0x18c')]>0x0?getCallerIdRandom(_0x5258d5[_0x7e6d('0x5b')],_0x5258d5[_0x7e6d('0x18c')]):_0x5258d5['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x5258d5[_0x7e6d('0x13e')])?_0x5258d5['Trunk']['callerid']:_0x5258d5[_0x7e6d('0x13e')][_0x7e6d('0x72')],_0x5258d5[_0x7e6d('0x18b')],_0x5258d5[_0x7e6d('0x18c')]>0x0?getCallerIdRandom(_0x5258d5[_0x7e6d('0x5b')],_0x5258d5['dialRandomLastDigitCallerIdNumber']):_0x5258d5[_0x7e6d('0x5b')]);if(_0x52244){_0x190467[_0x7e6d('0x18d')]=_0x4f5402[_0x7e6d('0x26')][_0xd1fc5e]['originatecalleridname']=extractCalleridName(_0x52244);_0x190467[_0x7e6d('0x18e')]=_0x4f5402['actions'][_0xd1fc5e][_0x7e6d('0x18f')]=extractCalleridNumber(_0x52244);}return ami[_0x7e6d('0xaa')]({'actionid':_0xd1fc5e,'action':'originate','channel':_0x4f5402[_0x7e6d('0xd7')](_0x5258d5[_0x7e6d('0x71')])?util[_0x7e6d('0x75')]('SIP/%s/%s%s',_0x5258d5[_0x7e6d('0x71')]['name'],isNotNull(_0x5258d5[_0x7e6d('0x190')])?_0x5258d5[_0x7e6d('0x190')][_0x7e6d('0x191')]()||'':'',_0x5258d5[_0x7e6d('0x192')]>0x0?_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')][_0x7e6d('0x193')](_0x5258d5['dialCutDigit']):_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')]):util[_0x7e6d('0x75')]('SIP/%s/%s%s',_[_0x7e6d('0xdd')](_0x5258d5['TrunkBackup'])?_0x5258d5[_0x7e6d('0x71')][_0x7e6d('0x43')]:_0x5258d5[_0x7e6d('0x13e')][_0x7e6d('0x43')],isNotNull(_0x5258d5[_0x7e6d('0x190')])?_0x5258d5[_0x7e6d('0x190')][_0x7e6d('0x191')]()||'':'',_0x5258d5[_0x7e6d('0x192')]>0x0?_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')][_0x7e6d('0x193')](_0x5258d5[_0x7e6d('0x192')]):_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')]),'callerid':_0x52244,'Exten':_0x7e6d('0x174'),'Context':_0x7e6d('0x194'),'Priority':'1','variable':_0x190467,'timeout':(_0x5258d5[_0x7e6d('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0xd1fc5e})[_0x7e6d('0xb1')](function(_0x2818f3){return _0x5958a1(_0x2818f3);})[_0x7e6d('0xac')](function(_0x5b828b){_0x5258d5['outboundOriginateFailureCallsDay']+=0x1;var _0xfa6d93=new History(_0x4f5402['actions'][_0xd1fc5e]);logger[_0x7e6d('0x92')](util[_0x7e6d('0x75')](_0x7e6d('0x195'),JSON[_0x7e6d('0x4b')](_0x5b828b)));_0xfa6d93['state']=0xe;_0xfa6d93[_0x7e6d('0xa5')]=_0x7e6d('0x196');_0xfa6d93[_0x7e6d('0xa7')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));_0xfa6d93[_0x7e6d('0xa6')]=_0xfa6d93[_0x7e6d('0xa7')];_0x4f5402[_0x7e6d('0xc7')](_0xfa6d93)[_0x7e6d('0xac')](loggerCatch('[originate][error]'));_0x4f5402['moveContactManagedDialer'](_0xfa6d93)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x197')))[_0x7e6d('0x130')](function(){delete _0x4f5402['actions'][_0xd1fc5e];return _0x31e363(msgResponse('originate',_0x7e6d('0x198'),_0x7e6d('0x199')));});});});};Dialer['prototype'][_0x7e6d('0x32')]=function(_0x5fbca2){var _0x153473=this[_0x7e6d('0x26')][_0x5fbca2['actionid']];if(_0x153473){delete this[_0x7e6d('0x26')][_0x5fbca2['actionid']];_0x153473['responsetime']=moment()[_0x7e6d('0x75')]('YYYY-MM-DD\x20HH:mm:ss');var _0x498d7f=_0x153473[_0x7e6d('0x4f')]==='ivr'?this[_0x7e6d('0x22')][_0x153473[_0x7e6d('0xaf')]]:this[_0x7e6d('0x21')][_0x153473[_0x7e6d('0x19a')]()];if(!this['isSuccess'](_0x5fbca2['response'])){this[_0x7e6d('0xae')](_0x498d7f);return this[_0x7e6d('0x19b')](_0x153473,_0x498d7f,_0x5fbca2)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x19c')));}this['uniqueId'][_0x5fbca2[_0x7e6d('0xdc')]]=_0x153473;}};Dialer[_0x7e6d('0x1c')]['checkRetriveMax']=function(_0x57f2d0,_0xb074a,_0x1d4d06){var _0x22c380=new History(_0xb074a);if(_0x22c380[_0x7e6d('0xf0')]+_0x22c380['countcongestionretry']+_0x22c380['countnoanswerretry']+_0x22c380['countnosuchnumberretry']+_0x22c380['countdropretry']+_0x22c380[_0x7e6d('0x100')]+_0x22c380[_0x7e6d('0xed')]+_0x22c380['countagentrejectretry']>=_0x1d4d06[_0x7e6d('0xf5')]-0x1){return!![];}switch(_0x57f2d0){case 0x3:if(_0x22c380[_0x7e6d('0xf2')]>=_0x1d4d06[_0x7e6d('0x19d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x22c380[_0x7e6d('0xf2')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0x19e')],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380['VoiceQueueId']||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x19f')));break;case 0x5:if(_0x22c380['countbusyretry']>=_0x1d4d06[_0x7e6d('0x1a0')]-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countbusyretry':_0x22c380[_0x7e6d('0xf0')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0x1a1')],_0x7e6d('0x103'))['format'](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380['VoiceQueueId']||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1a2')));break;case 0x8:if(_0x22c380[_0x7e6d('0xf1')]>=_0x1d4d06[_0x7e6d('0x1a3')]-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countcongestionretry':_0x22c380[_0x7e6d('0xf1')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0x1a4')],'minutes')[_0x7e6d('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x22c380['ContactId'],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380['VoiceQueueId']||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch(_0x7e6d('0x1a5')));break;case 0x0:if(_0x22c380[_0x7e6d('0xf3')]>=_0x1d4d06[_0x7e6d('0x1a6')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x22c380[_0x7e6d('0xf3')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0x1a7')],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x22c380[_0x7e6d('0xf4')]>=_0x1d4d06[_0x7e6d('0x1a8')]-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countdropretry':_0x22c380['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x1d4d06[_0x7e6d('0x1a9')],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380['ListId'],'VoiceQueueId':_0x22c380[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x22c380[_0x7e6d('0x100')]>=_0x1d4d06[_0x7e6d('0x120')]-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countabandonedretry':_0x22c380[_0x7e6d('0x100')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0x121')],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380['VoiceQueueId']||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x22c380[_0x7e6d('0xed')]>=_0x1d4d06[_0x7e6d('0x1aa')]-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countmachineretry':_0x22c380[_0x7e6d('0xed')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0xfa')],_0x7e6d('0x103'))['format'](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x22c380['CampaignId']||undefined})[_0x7e6d('0xac')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x22c380[_0x7e6d('0x101')]>=_0x1d4d06['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countagentrejectretry':_0x22c380[_0x7e6d('0x101')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06['dialAgentRejectRetryFrequency'],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1ab')));break;default:return!![];}};Dialer[_0x7e6d('0x1c')]['callProgressDetecting']=function(_0x19ab25,_0x589562,_0x26d6d8){var _0x3ab61a=this;var _0x2e5871=new History(_0x19ab25);return new BPromise(function(_0x427185,_0x26895e){if(_['isUndefined'](_0x589562)&&typeof _0x589562!==_0x7e6d('0x1ac')){return _0x26895e(msgResponse(_0x7e6d('0x1ad'),'Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x26d6d8)&&typeof _0x26d6d8!==_0x7e6d('0x1ac')){return _0x26895e(msgResponse('[callProgressDetecting]',_0x7e6d('0x142'),_0x7e6d('0x1ae')));}switch(_0x26d6d8[_0x7e6d('0x1af')]){case'0':_0x589562['outboundNoSuchCallsDay']+=0x1;_0x2e5871[_0x7e6d('0xa4')]=0x0;_0x2e5871[_0x7e6d('0xa5')]='NoSuchNumber';_0x2e5871[_0x7e6d('0xf3')]+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;ami[_0x7e6d('0x4e')](_0x7e6d('0x1b0'),ut['buildObj'](_0x19ab25,_0x7e6d('0x1b1')));_0x3ab61a[_0x7e6d('0xc7')](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xef')));if(_0x3ab61a[_0x7e6d('0x1b2')](0x0,_0x19ab25,_0x589562)){if(_0x2e5871[_0x7e6d('0xf3')]>=_0x589562[_0x7e6d('0x1a6')]){_0x3ab61a['createStateFinal'](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1b3'));}else{_0x3ab61a['stateGlobal'](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1b3'));}}break;case'3':_0x589562[_0x7e6d('0x1b4')]+=0x1;_0x2e5871[_0x7e6d('0xa4')]=0x3;_0x2e5871[_0x7e6d('0xa5')]=_0x7e6d('0x1b5');_0x2e5871[_0x7e6d('0xf2')]+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;ami[_0x7e6d('0x4e')](_0x7e6d('0x1b6'),ut['buildObj'](_0x19ab25,_0x7e6d('0x1b7')));_0x3ab61a['createHistory'](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1b8')));if(_0x3ab61a[_0x7e6d('0x1b2')](0x3,_0x19ab25,_0x589562)){if(_0x2e5871['countnoanswerretry']>=_0x589562[_0x7e6d('0x19d')]){_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1b9'));}else{_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1b9'));}}break;case'5':_0x589562[_0x7e6d('0x5f')]+=0x1;_0x2e5871['state']=0x5;_0x2e5871['statedesc']='Busy';_0x2e5871[_0x7e6d('0xf0')]+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;ami['emit'](_0x7e6d('0x1ba'),ut['buildObj'](_0x19ab25,_0x7e6d('0x1bb')));_0x3ab61a[_0x7e6d('0xc7')](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1bc')));if(_0x3ab61a[_0x7e6d('0x1b2')](0x5,_0x19ab25,_0x589562)){if(_0x2e5871['countbusyretry']>=_0x589562[_0x7e6d('0x1a0')]){_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1bd'));}else{_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,'reason\x205\x20busy');}}break;case'8':_0x589562['outboundCongestionCallsDay']+=0x1;_0x2e5871[_0x7e6d('0xa4')]=0x8;_0x2e5871['statedesc']=_0x7e6d('0x1be');_0x2e5871['countcongestionretry']+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;ami[_0x7e6d('0x4e')]('custom:agentcongestion',ut[_0x7e6d('0xe7')](_0x19ab25,_0x7e6d('0x1bf')));_0x3ab61a[_0x7e6d('0xc7')](_0x2e5871)['catch'](loggerCatch(_0x7e6d('0x1c0')));if(_0x3ab61a[_0x7e6d('0x1b2')](0x8,_0x19ab25,_0x589562)){if(_0x2e5871['countcongestionretry']>=_0x589562[_0x7e6d('0x1a3')]){_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,'reason\x208\x20congestion');}else{_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1c1'));}}break;case'11':_0x589562['outboundAbandonedCallsDay']+=0x1;_0x2e5871[_0x7e6d('0xa4')]=0xb;_0x2e5871[_0x7e6d('0xa5')]=_0x7e6d('0x11e');_0x2e5871['countabandonedretry']+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;_0x3ab61a['createHistory'](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x123')));if(_0x3ab61a['checkRetriveMax'](0xb,_0x19ab25,_0x589562)){if(_0x2e5871[_0x7e6d('0x100')]>=_0x589562['dialAbandonedMaxRetry']){_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,'reason\x2011\x20abandoned');}else{_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1c2'));}}break;case'20':_0x589562['outboundRejectCallsDay']+=0x1;_0x2e5871[_0x7e6d('0xa4')]=0x14;_0x2e5871[_0x7e6d('0xa5')]=_0x7e6d('0x1c3');_0x2e5871[_0x7e6d('0x101')]+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;ami['emit'](_0x7e6d('0x1c4'),ut[_0x7e6d('0xe7')](_0x19ab25,_0x7e6d('0x1c5')));_0x3ab61a[_0x7e6d('0xc7')](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1c6')));if(_0x3ab61a[_0x7e6d('0x1b2')](0x14,_0x19ab25,_0x589562)){if(_0x2e5871['countagentrejectretry']>=_0x589562[_0x7e6d('0x1c7')]){_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,'reason\x2020\x20agentreject');}else{_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1c8'));}}break;default:_0x589562[_0x7e6d('0x67')]+=0x1;_0x2e5871['state']=0xc;_0x2e5871[_0x7e6d('0xa5')]=_0x26d6d8['reason'];_0x3ab61a[_0x7e6d('0xc7')](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1c9')));if(_0x3ab61a[_0x7e6d('0x1b2')](_0x26d6d8[_0x7e6d('0x1af')],_0x19ab25,_0x589562)){if(_0x2e5871['countbusyretry']+_0x2e5871['countcongestionretry']+_0x2e5871[_0x7e6d('0xf2')]+_0x2e5871['countnosuchnumberretry']+_0x2e5871[_0x7e6d('0xf4')]+_0x2e5871[_0x7e6d('0x100')]+_0x2e5871[_0x7e6d('0xed')]+_0x2e5871['countagentrejectretry']>=_0x589562[_0x7e6d('0xf5')]){_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,_0x26d6d8[_0x7e6d('0x1af')]);}else{_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,_0x26d6d8[_0x7e6d('0x1af')]);}}}});};Dialer[_0x7e6d('0x1c')]['stateGlobal']=function(_0x3d0dee,_0x24465a,_0x2b31ec,_0x1aad63){var _0x2a8d2d=new Final(_0x3d0dee);_0x2a8d2d[_0x7e6d('0xa4')]=0xf;_0x2a8d2d[_0x7e6d('0xa5')]=_0x7e6d('0x1ca');this[_0x7e6d('0x102')](_0x2a8d2d,_0x24465a,_0x2b31ec,_0x1aad63);};Dialer[_0x7e6d('0x1c')]['createStateFinal']=function(_0x480f08,_0x3bafcc,_0x282cf8,_0x4b7ff2){this[_0x7e6d('0xc5')](_0x480f08)[_0x7e6d('0xb1')](function(){return _0x3bafcc(msgResponse(_0x7e6d('0x1ad'),_0x7e6d('0xd6'),_0x4b7ff2));})[_0x7e6d('0xac')](function(){return _0x282cf8(msgResponse(_0x7e6d('0x1cb'),_0x7e6d('0x142'),'contact\x20not\x20moved'));});};Dialer[_0x7e6d('0x1c')]['predictive']=function(_0x2c80e9){var _0x6f01d6=_0x2c80e9[_0x7e6d('0x1cc')]/0x64;var _0x11e778=_0x2c80e9['outboundDropCallsDayTimeout']/(_0x2c80e9[_0x7e6d('0x63')]+_0x2c80e9[_0x7e6d('0x5d')]);var _0x308c91=Math['round'](_0x2c80e9[_0x7e6d('0x6e')]*(_0x2c80e9[_0x7e6d('0x1cd')]/0x64));var _0x188b96=Math[_0x7e6d('0x1ce')](_0x2c80e9[_0x7e6d('0x6e')]*(_0x2c80e9['predictiveIntervalMinThreshold']/0x64));var _0x16647b=_0x2c80e9[_0x7e6d('0x50')]+_0x2c80e9[_0x7e6d('0x9e')];var _0x446460=Math[_0x7e6d('0x1cf')](_0x2c80e9[_0x7e6d('0x6f')]*_0x2c80e9[_0x7e6d('0x87')]*_0x2c80e9[_0x7e6d('0x6d')]*_0x2c80e9[_0x7e6d('0x1d0')]);if(_[_0x7e6d('0x40')](_0x2c80e9[_0x7e6d('0x2a')])){if(!_['isUndefined'](_0x2c80e9['startPredictive'])){_0x2c80e9[_0x7e6d('0x29')]=undefined;loggerPredictive['error'](_0x7e6d('0x1d1'),_0x7e6d('0x1d2'));}if(!_[_0x7e6d('0x40')](_0x2c80e9[_0x7e6d('0x8d')])){loggerPredictive[_0x7e6d('0x92')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2c80e9['handlePredictive']);_0x2c80e9[_0x7e6d('0x8d')]=undefined;}_0x2c80e9[_0x7e6d('0x2a')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));loggerPredictive[_0x7e6d('0x78')](_0x2c80e9[_0x7e6d('0x43')],'collection\x20data\x20in\x20progressive\x20at',_0x2c80e9[_0x7e6d('0x2a')]);this[_0x7e6d('0x157')](_0x2c80e9,0x1);}else if(ifInterval(_0x2c80e9[_0x7e6d('0x1d3')],_0x2c80e9['startProgressive'])){this[_0x7e6d('0x157')](_0x2c80e9,0x1);loggerPredictiveCalls[_0x7e6d('0x78')](_0x7e6d('0x1d4'),_0x2c80e9['startProgressive'],_0x2c80e9[_0x7e6d('0x43')]);_0x2c80e9[_0x7e6d('0x6f')]=0x0;_0x2c80e9[_0x7e6d('0x117')]=0x0;}else if(_0x6f01d6<_0x11e778&&_0x2c80e9[_0x7e6d('0x1d5')]==='dropRate'){freeVariablesPredictive(_0x2c80e9);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x1d6'),_0x7e6d('0x1d7'),_0x11e778,_0x7e6d('0x2a'),_0x2c80e9['name']);}else if(_0x446460<_0x2c80e9[_0x7e6d('0x117')]&&_0x2c80e9[_0x7e6d('0x1d5')]==='dropRate'){freeVariablesPredictive(_0x2c80e9);loggerPredictive['info'](_0x7e6d('0x1d8'),'Max\x20Drop\x20',_0x446460,_0x7e6d('0x1d9'),_0x2c80e9[_0x7e6d('0x117')],_0x7e6d('0x2a'),_0x2c80e9[_0x7e6d('0x43')]);}else if(!ifInterval(_0x2c80e9[_0x7e6d('0x1d3')],_0x2c80e9[_0x7e6d('0x2a')])&&_[_0x7e6d('0x40')](_0x2c80e9[_0x7e6d('0x29')])&&!_[_0x7e6d('0x40')](_0x2c80e9[_0x7e6d('0x2a')])){_0x2c80e9[_0x7e6d('0x29')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));loggerPredictive['info'](_0x2c80e9['name'],'started\x20in\x20predictive\x20at',_0x2c80e9[_0x7e6d('0x29')]);this[_0x7e6d('0xb8')](_0x2c80e9[_0x7e6d('0x1d3')])[_0x7e6d('0xb1')](this[_0x7e6d('0x1da')](_0x2c80e9))[_0x7e6d('0xb1')](mergeDataErlangB(_0x2c80e9))[_0x7e6d('0xb1')](this['startMethodPredictive'](_0x2c80e9))[_0x7e6d('0xac')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2c80e9));}else if(!ifInterval(_0x2c80e9[_0x7e6d('0x1d3')],_0x2c80e9[_0x7e6d('0x29')])){_0x2c80e9[_0x7e6d('0x117')]=0x0;_0x2c80e9[_0x7e6d('0x29')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));loggerPredictive[_0x7e6d('0x78')](_0x2c80e9[_0x7e6d('0x43')],'recalculate\x20predictive\x20at',_0x2c80e9['startPredictive']);clearInterval(_0x2c80e9[_0x7e6d('0x8d')]);_0x2c80e9[_0x7e6d('0x8d')]=undefined;this[_0x7e6d('0xb8')](_0x2c80e9[_0x7e6d('0x1d3')])[_0x7e6d('0xb1')](this[_0x7e6d('0x1da')](_0x2c80e9))[_0x7e6d('0xb1')](mergeDataErlangB(_0x2c80e9))[_0x7e6d('0xb1')](this[_0x7e6d('0x1db')](_0x2c80e9))[_0x7e6d('0xac')](loggerCatchPredictive(_0x7e6d('0x1dc'),_0x2c80e9));}else if(_0x2c80e9['predictiveIntervalAvailable']&&_0x16647b<_0x2c80e9['predictiveIntervalAvailable']-_0x188b96){freeVariablesPredictive(_0x2c80e9);loggerPredictive['info'](_0x2c80e9[_0x7e6d('0x43')],_0x7e6d('0x1dd'),_0x16647b,_0x7e6d('0x1de'),_0x2c80e9['predictiveIntervalAvailable'],'-',_0x188b96,'=',_0x2c80e9[_0x7e6d('0x6e')]-_0x188b96,')');}else if(_0x2c80e9[_0x7e6d('0x6e')]&&_0x16647b>_0x2c80e9[_0x7e6d('0x6e')]+_0x308c91){freeVariablesPredictive(_0x2c80e9);loggerPredictive[_0x7e6d('0x78')](_0x2c80e9[_0x7e6d('0x43')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x16647b,_0x7e6d('0x1df'),_0x2c80e9[_0x7e6d('0x6e')],'+',_0x308c91,'=',_0x2c80e9['predictiveIntervalAvailable']+_0x308c91,')');}};Dialer[_0x7e6d('0x1c')]['getDataPredictive']=function(_0x437375){var _0x3f6ccb=this;return function(_0x20b457){return new BPromise(function(_0x25ba52,_0x1ceab7){_['merge'](_0x437375,_0x20b457[0x0]);if(checkGetDataPredictive(_0x20b457[0x0])){var _0x3b7880=_0x437375['predictiveIntervalAvailable']=_0x437375['talking']+_0x437375['available'];var _0x526c2e=_0x437375[_0x7e6d('0x1d3')]*0x3c;var _0x1a43de=_0x20b457[0x0][_0x7e6d('0x69')]+_0x20b457[0x0]['predictiveIntervalAvgHoldtime'];var _0x38ed71=(_0x20b457[0x0][_0x7e6d('0x7c')]+_0x20b457[0x0][_0x7e6d('0x6b')]+_0x20b457[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x20b457[0x0][_0x7e6d('0x7b')];_0x437375[_0x7e6d('0x6d')]=_0x38ed71>0x0?_0x38ed71:0x1;switch(_0x437375[_0x7e6d('0x1d5')]){case _0x7e6d('0x1e0'):var _0x3c09df=_0x437375[_0x7e6d('0x1cc')]/0x64;return _0x3f6ccb[_0x7e6d('0x1e1')](_0x3b7880,_0x526c2e,_0x1a43de,_0x38ed71,_0x3c09df)[_0x7e6d('0xb1')](function(_0x12b641){return _0x25ba52(_0x12b641);});case _0x7e6d('0x1e2'):var _0x1e4885=_0x437375[_0x7e6d('0x1cc')]/0x64;return _0x3f6ccb[_0x7e6d('0x1e3')](_0x3b7880,_0x526c2e,_0x1a43de,_0x38ed71,_0x1e4885)[_0x7e6d('0xb1')](function(_0x355293){return _0x25ba52(_0x355293);});default:return _0x1ceab7(msgResponse(_0x7e6d('0x1e4'),_0x7e6d('0x142'),_0x7e6d('0x1e5')));}}else{return _0x1ceab7(msgResponse(_0x7e6d('0x1e4'),_0x7e6d('0x142'),_0x7e6d('0x1e6')));}});};};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x1e7')]=function(_0x2cda56){var _0x2b8e3b=this;return function(_0x33b483){return new BPromise(function(_0x2697b3,_0x1d555f){_[_0x7e6d('0x89')](_0x2cda56,_0x33b483[0x0]);if(checkGetDataPredictive(_0x33b483[0x0])){loggerPredictive[_0x7e6d('0x78')](JSON['stringify'](_0x33b483[0x0]));if(_0x2cda56[_0x7e6d('0x1d5')]===_0x7e6d('0x1e0')){return _0x2b8e3b[_0x7e6d('0xc3')](_0x2cda56['id'])[_0x7e6d('0xb1')](function(_0x39006f){var _0x5ba5c4=_0x2cda56['loggedIn']-_0x39006f[0x0][_0x7e6d('0x1e8')];var _0x42fd96=_0x2cda56[_0x7e6d('0x1d3')]*0x3c;var _0x3137b7=_0x33b483[0x0][_0x7e6d('0x69')]+_0x33b483[0x0]['predictiveIntervalAvgHoldtime'];var _0x229421=(_0x33b483[0x0][_0x7e6d('0x7c')]+_0x33b483[0x0][_0x7e6d('0x6b')]+_0x33b483[0x0][_0x7e6d('0x6a')])/_0x33b483[0x0]['predictiveIntervalTotalCalls'];var _0x5a12b1=_0x2cda56[_0x7e6d('0x1cc')]/0x64;_0x2cda56['predictiveIntervalPauses']=_0x39006f[0x0]['outboundQueuePauses']||0x0;_0x2cda56[_0x7e6d('0x6d')]=_0x229421>0x0?_0x229421:0x1;return _0x2b8e3b[_0x7e6d('0x1e1')](_0x5ba5c4,_0x42fd96,_0x3137b7,_0x229421,_0x5a12b1);})[_0x7e6d('0xb1')](function(_0x3a5c03){return _0x2697b3(_0x3a5c03);})['catch'](function(_0x3fc41f){return _0x1d555f(msgResponse('[CatchErlangB]',_0x7e6d('0x142'),JSON['stringify'](_0x3fc41f)));});}if(_0x2cda56[_0x7e6d('0x1d5')]==='agentBusyFactor'){return _0x2b8e3b[_0x7e6d('0xc3')](_0x2cda56['id'])[_0x7e6d('0xb1')](function(_0x5264e3){var _0x3d219b=_0x2cda56['loggedIn']-_0x5264e3[0x0][_0x7e6d('0x1e8')];var _0x5621b8=_0x2cda56['dialPredictiveInterval']*0x3c;var _0x1c7ffe=_0x33b483[0x0][_0x7e6d('0x69')]+_0x33b483[0x0][_0x7e6d('0x68')];var _0x2a7c71=(_0x33b483[0x0][_0x7e6d('0x7c')]+_0x33b483[0x0][_0x7e6d('0x6b')]+_0x33b483[0x0][_0x7e6d('0x6a')])/_0x33b483[0x0][_0x7e6d('0x7b')];var _0x8d6822=_0x2cda56[_0x7e6d('0x1cc')]/0x64;_0x2cda56[_0x7e6d('0x1e9')]=_0x5264e3[0x0][_0x7e6d('0x1e8')]||0x0;_0x2cda56[_0x7e6d('0x6d')]=_0x2a7c71>0x0?_0x2a7c71:0x1;return _0x2b8e3b[_0x7e6d('0x1e3')](_0x3d219b,_0x5621b8,_0x1c7ffe,_0x2a7c71,_0x8d6822);})[_0x7e6d('0xb1')](function(_0x29fdff){return _0x2697b3(_0x29fdff);})[_0x7e6d('0xac')](function(_0x27e8cf){return _0x1d555f(msgResponse(_0x7e6d('0x1ea'),'Failure',JSON[_0x7e6d('0x4b')](_0x27e8cf)));});}}else{return _0x1d555f(msgResponse(_0x7e6d('0x1e4'),_0x7e6d('0x142'),'check\x20failure'));}});};};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x1db')]=function(_0x37af1e){var _0x3311d3=this;return function(){var _0x4646b4=0x0;var _0x284fb3=Math[_0x7e6d('0x1cf')](_0x37af1e['erlangCallToSecond']*0x3e8);if(_0x284fb3>0x0){_0x284fb3=_0x284fb3<0x64?0x64:_0x284fb3;loggerPredictive[_0x7e6d('0x78')](_0x37af1e[_0x7e6d('0x43')],_0x7e6d('0x1eb'),_0x284fb3,_0x7e6d('0x4c'));_0x37af1e[_0x7e6d('0x8d')]=setInterval(function(){_0x3311d3[_0x7e6d('0x8d')](_0x37af1e);loggerPredictiveCalls['info'](_0x7e6d('0x1ec'),_0x4646b4+=0x1);},_0x284fb3);}else{loggerPredictive[_0x7e6d('0x78')](_0x37af1e['name'],_0x7e6d('0x1ed'));}};};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x1ee')]=function(_0x5acdf5,_0x1f7802){var _0xbe9b09=this;return function(_0x9f227b){if(_[_0x7e6d('0x49')](_0x9f227b)){if(_[_0x7e6d('0xdd')](_0x1f7802[_0x7e6d('0xd0')])||!_0x1f7802['recallme']){if(_0x5acdf5[_0x7e6d('0x156')]===_0x7e6d('0x7')){_0x5acdf5[_0x7e6d('0x12b')]=_[_0x7e6d('0x40')](_0x5acdf5[_0x7e6d('0x12b')])?!![]:_0x5acdf5[_0x7e6d('0x12b')];var _0x335fc3=uuid['v4']();_0xbe9b09[_0x7e6d('0x26')][_0x335fc3]=new Action(_0x5acdf5,_0x1f7802,_0x335fc3);loggerBooked[_0x7e6d('0x78')]('[booked][checkContactBlack]',_0x335fc3,'queueStatusComplete:\x20',JSON[_0x7e6d('0x4b')](_0x5acdf5[_0x7e6d('0x12b')]),_0x7e6d('0x1ef'),_0x5acdf5['name']);if(_0x5acdf5['queueStatusComplete']){_0x5acdf5[_0x7e6d('0x12b')]=![];_0xbe9b09[_0x7e6d('0x2c')][_0xbe9b09['actions'][_0x335fc3][_0x7e6d('0xaf')]]=[];ami[_0x7e6d('0xaa')]({'actionid':_0x335fc3,'action':_0x7e6d('0x1f0'),'queue':_0x5acdf5[_0x7e6d('0x43')]})[_0x7e6d('0xac')](function(){_0xbe9b09[_0x7e6d('0xae')](_0x5acdf5);_0xbe9b09['rescheduleContact']({'active':![],'ContactId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xfc')],'ListId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3]['ListId'],'VoiceQueueId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xd1')]||undefined,'CampaignId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1f1')));delete _0xbe9b09[_0x7e6d('0x26')][_0x335fc3];});}else{loggerBooked[_0x7e6d('0x78')](_0x7e6d('0x1f2'),JSON[_0x7e6d('0x4b')](_0x5acdf5['queueStatusComplete']),_0x7e6d('0x1ef'),_0x5acdf5['name']);_0xbe9b09[_0x7e6d('0xae')](_0x5acdf5);_0xbe9b09[_0x7e6d('0xbb')]({'active':![],'ContactId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xfc')],'ListId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xcf')],'VoiceQueueId':_0xbe9b09['actions'][_0x335fc3][_0x7e6d('0xd1')]||undefined,'CampaignId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1f1')));delete _0xbe9b09[_0x7e6d('0x26')][_0x335fc3];}}else{return _0xbe9b09[_0x7e6d('0x167')](_0x5acdf5,_0x1f7802);}}else{if(getDiff(_0x1f7802[_0x7e6d('0x1f3')])<_0x5acdf5[_0x7e6d('0x1f4')]*0x3c){if(_0x1f7802[_0x7e6d('0x1f5')]&&!_0x1f7802['Agent']['voicePause']){_0xbe9b09['preview'][_0x7e6d('0x12d')](_0x1f7802['id'])[_0x7e6d('0x130')](function(){_0xbe9b09['updateOriginated'](_0x5acdf5);});}else{_0xbe9b09['unlockContact']({'active':![]},_0x1f7802['id'],0x1)[_0x7e6d('0x130')](function(){_0xbe9b09[_0x7e6d('0xae')](_0x5acdf5);});}}else{_0x5acdf5[_0x7e6d('0x65')]+=0x1;_0xbe9b09['updateOriginated'](_0x5acdf5);if(_0x5acdf5['dialRecallInQueue']){_0xbe9b09['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1f7802[_0x7e6d('0xfc')],'ListId':_0x1f7802[_0x7e6d('0xcf')],'VoiceQueueId':_0x1f7802[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x1f7802[_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0xbe9b09[_0x7e6d('0xc7')](createObjHistory(_0x5acdf5,_0x1f7802,_0x7e6d('0x1f6'),0x17,'RecallInQueue'))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1f7')));}else{_0xbe9b09[_0x7e6d('0xcd')](createObjHistory(_0x5acdf5,_0x1f7802,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x7e6d('0x1f8'),_0x7e6d('0x1f9'));}}}}else{_0x5acdf5[_0x7e6d('0x5e')]+=0x1;_0xbe9b09[_0x7e6d('0xcd')](createObjHistory(_0x5acdf5,_0x1f7802,'BLACKLIST',0xd,_0x7e6d('0x1fa')),_0x7e6d('0x1fb'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer['prototype'][_0x7e6d('0x15d')]=function(_0x387690){var _0xb2c2d=this;var _0x13061f=_0x387690[_0x7e6d('0x1fc')]-_0x387690[_0x7e6d('0x95')]-_0x387690[_0x7e6d('0xbf')];emitCampaignSummary(_0x387690);if(_0x13061f>0x0){if(_0x13061f>this[_0x7e6d('0x25')]){_0x13061f=this[_0x7e6d('0x25')];}_0x387690['temp']+=_0x13061f;this['getContactDialerIvr'](_0x387690['id'],_0x13061f,_0x387690[_0x7e6d('0x1fd')],_0x387690)['then'](function(_0x35beec){_0x387690[_0x7e6d('0xbf')]-=_0x13061f;_0x387690[_0x7e6d('0xbf')]=_0x387690[_0x7e6d('0xbf')]>0x0?_0x387690[_0x7e6d('0xbf')]:0x0;if(!checkContactEmpty(_0x35beec)){_0x387690[_0x7e6d('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x7e6d('0x78')]('[getContactCampaign2][Empty]'+_0x387690[_0x7e6d('0x43')]);}else{_0x387690[_0x7e6d('0x95')]+=_0x35beec[_0x7e6d('0x134')];_0x387690[_0x7e6d('0x41')]=_0x7e6d('0x1fe');for(var _0x5ed01f=0x0;_0x5ed01f<_0x35beec['length'];_0x5ed01f+=0x1){_0x387690[_0x7e6d('0x1ff')]+=0x1;if(_[_0x7e6d('0xdd')](_0x35beec[_0x5ed01f])||_[_0x7e6d('0xdd')](_0x35beec[_0x5ed01f]['Contact'])||_[_0x7e6d('0xdd')](_0x35beec[_0x5ed01f][_0x7e6d('0x16a')][_0x7e6d('0x16b')])){_0xb2c2d[_0x7e6d('0xcb')]('[actionOriginate]\x20',_0x387690,_0x35beec[_0x5ed01f]);}else{_0xb2c2d[_0x7e6d('0xb6')](_[_0x7e6d('0xce')](_0x35beec[_0x5ed01f],[_0x7e6d('0xd2'),_0x7e6d('0x200')]))['then'](_0xb2c2d[_0x7e6d('0x1ee')](_0x387690,_0x35beec[_0x5ed01f]))[_0x7e6d('0xac')](_0xb2c2d[_0x7e6d('0xca')](_0x7e6d('0x201'),_0x387690));}}}})['catch'](loggerGetContactDialer(_0x7e6d('0x202'),_0x387690,_0x13061f));}};Dialer['prototype'][_0x7e6d('0x157')]=function(_0x214c02,_0x207b92){var _0x35786d=this;var _0x246e24=[];var _0x4956b6=_0x207b92>=0x1?_0x207b92:0x1;if(_0x214c02[_0x7e6d('0x156')]===_0x7e6d('0x7')){_0x4956b6=0x1;}var _0x340c45=Math[_0x7e6d('0x1cf')](_0x214c02[_0x7e6d('0x50')]*_0x4956b6)-_0x214c02[_0x7e6d('0x95')]-_0x214c02['temp'];emitVoiceQueueSummary(_0x214c02);if(_0x214c02[_0x7e6d('0x203')]>0x0){var _0x5a6607=_0x214c02[_0x7e6d('0x203')]-_0x214c02[_0x7e6d('0x95')]-_0x214c02[_0x7e6d('0x9e')]-_0x214c02[_0x7e6d('0xbf')]-_0x214c02[_0x7e6d('0x52')];if(_0x340c45>_0x5a6607){_0x340c45=_0x5a6607;}}if(_0x340c45>0x0){if(_0x214c02[_0x7e6d('0x156')]===_0x7e6d('0x7')){_0x340c45=0x1;}if(_0x340c45>this[_0x7e6d('0x25')]){_0x340c45=this[_0x7e6d('0x25')];}_0x214c02['temp']+=_0x340c45;for(var _0x40be72 in this['agents']){if(typeof this[_0x7e6d('0x23')][_0x40be72]!==_0x7e6d('0x96')){if(this[_0x7e6d('0x23')][_0x40be72][_0x7e6d('0xa4')]==='not_inuse'&&this['agents'][_0x40be72]['status']===_0x7e6d('0xda')){_0x246e24[_0x7e6d('0x12a')](this['agents'][_0x40be72]['id']);}}}this[_0x7e6d('0xbe')](_0x214c02['id'],_0x246e24,_0x340c45,_0x214c02[_0x7e6d('0x1fd')],_0x214c02)[_0x7e6d('0xb1')](function(_0x35a7f5){_0x214c02[_0x7e6d('0xbf')]-=_0x340c45;_0x214c02['temp']=_0x214c02[_0x7e6d('0xbf')]>0x0?_0x214c02[_0x7e6d('0xbf')]:0x0;if(!checkContactEmpty(_0x35a7f5)){_0x35786d[_0x7e6d('0xb0')](_0x214c02)[_0x7e6d('0xb1')](sendMessageReschedule(_0x214c02))[_0x7e6d('0xac')](loggerCatch('[countReScheduled]\x20'));}else{_0x214c02[_0x7e6d('0x95')]+=_0x35a7f5[_0x7e6d('0x134')];_0x214c02[_0x7e6d('0x41')]=_0x214c02[_0x7e6d('0x156')]===_0x7e6d('0x7')?_0x7e6d('0x173'):'RUNNING';for(var _0xe14eed=0x0;_0xe14eed<_0x35a7f5[_0x7e6d('0x134')];_0xe14eed+=0x1){if(_[_0x7e6d('0xdd')](_0x35a7f5[_0xe14eed])||_['isNil'](_0x35a7f5[_0xe14eed]['Contact'])||_[_0x7e6d('0xdd')](_0x35a7f5[_0xe14eed][_0x7e6d('0x16a')][_0x7e6d('0x16b')])){_0x35786d[_0x7e6d('0xcb')](_0x7e6d('0x204'),_0x214c02,_0x35a7f5[_0xe14eed]);}else{_0x35786d[_0x7e6d('0xb3')](_[_0x7e6d('0xce')](_0x35a7f5[_0xe14eed],[_0x7e6d('0xd1'),'Contact.phone']))[_0x7e6d('0xb1')](_0x35786d[_0x7e6d('0x1ee')](_0x214c02,_0x35a7f5[_0xe14eed]))[_0x7e6d('0xac')](_0x35786d['loggerHandler'](_0x7e6d('0x204'),_0x214c02));}}}})[_0x7e6d('0xac')](loggerGetContactDialer(_0x7e6d('0x205'),_0x214c02,_0x340c45));}};Dialer['prototype'][_0x7e6d('0x8d')]=function(_0x4cfbb2){if(_0x4cfbb2[_0x7e6d('0x203')]>0x0){var _0x1d5f47=_0x4cfbb2['dialLimitQueue']-_0x4cfbb2[_0x7e6d('0x95')]-_0x4cfbb2[_0x7e6d('0x9e')];if(_0x1d5f47>0x0){this[_0x7e6d('0x206')](_0x4cfbb2);}else{loggerPredictiveCalls[_0x7e6d('0x78')](_0x7e6d('0x207'));}}else{this[_0x7e6d('0x206')](_0x4cfbb2);}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x206')]=function(_0x5109e2){var _0x1f55f5=this;var _0x3346b6=[];_0x5109e2[_0x7e6d('0x95')]+=0x1;for(var _0x3cea3f in this[_0x7e6d('0x23')]){if(typeof this[_0x7e6d('0x23')][_0x3cea3f]!=='undefined'){if(this[_0x7e6d('0x23')][_0x3cea3f][_0x7e6d('0xa4')]===_0x7e6d('0x208')&&this['agents'][_0x3cea3f]['status']==='reachable'){_0x3346b6[_0x7e6d('0x12a')](this[_0x7e6d('0x23')][_0x3cea3f]['id']);}}}this[_0x7e6d('0xbe')](_0x5109e2['id'],_0x3346b6,0x1,_0x5109e2['dialOrderByScheduledAt'],_0x5109e2)['then'](function(_0x3781aa){if(!checkContactEmpty(_0x3781aa)){checkContactLowerLimitOriginate(_0x5109e2,0x1,0x0);_0x1f55f5[_0x7e6d('0xb0')](_0x5109e2)[_0x7e6d('0xb1')](sendMessageReschedule(_0x5109e2))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xb2')));}else{_0x5109e2[_0x7e6d('0x41')]=_0x7e6d('0x1fe');if(_['isNil'](_0x3781aa[0x0])||_[_0x7e6d('0xdd')](_0x3781aa[0x0]['Contact'])||_['isNil'](_0x3781aa[0x0][_0x7e6d('0x16a')][_0x7e6d('0x16b')])){_0x1f55f5[_0x7e6d('0xcb')](_0x7e6d('0x204'),_0x5109e2,_0x3781aa[0x0]);}else{_0x1f55f5['checkIsBlackList'](_[_0x7e6d('0xce')](_0x3781aa[0x0],[_0x7e6d('0xd1'),_0x7e6d('0x200')]))[_0x7e6d('0xb1')](_0x1f55f5[_0x7e6d('0x1ee')](_0x5109e2,_0x3781aa[0x0]))[_0x7e6d('0xac')](_0x1f55f5[_0x7e6d('0xca')](_0x7e6d('0x209'),_0x5109e2));}}})[_0x7e6d('0xac')](loggerGetContactDialer(_0x7e6d('0x20a'),_0x5109e2,0x1));emitVoiceQueueSummary(_0x5109e2);};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x1e1')]=function(_0x5f33b6,_0x32908a,_0x4a483e,_0x3c4a49,_0x2aca10,_0x1e06e7){loggerPredictive['info'](_0x7e6d('0x20b'));loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20c'),_0x5f33b6);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20d'),_0x32908a);loggerPredictive[_0x7e6d('0x78')]('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',_0x4a483e);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20e'),_0x3c4a49);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20f'),_0x2aca10);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x80'));return new BPromise(function(_0x39b2b6,_0x5a071d){if(_0x5f33b6<=0x0||isNaN(_0x5f33b6)){return _0x5a071d(msgResponse(_0x7e6d('0x210'),_0x7e6d('0x198'),_0x7e6d('0x211')+_0x5f33b6));}if(_0x4a483e<=0x0||isNaN(_0x4a483e)){return _0x5a071d(msgResponse(_0x7e6d('0x210'),'Error',_0x7e6d('0x212')+_0x4a483e));}if(_0x3c4a49<=0x0||isNaN(_0x3c4a49)){return _0x5a071d(msgResponse(_0x7e6d('0x210'),'Error',_0x7e6d('0x213')+_0x3c4a49));}if(_0x32908a<=0x0||isNaN(_0x32908a)){return _0x5a071d(msgResponse(_0x7e6d('0x210'),'Error',_0x7e6d('0x214')+_0x32908a));}if(_0x2aca10<=0x0||isNaN(_0x2aca10)){return _0x5a071d(msgResponse(_0x7e6d('0x210'),_0x7e6d('0x198'),'Amax\x20=\x20'+_0x2aca10));}_0x1e06e7=_0x1e06e7||0x0;var _0x3417b4=0x1/_0x4a483e;var _0xb87819=0x0;var _0x2ef1e8=0x0;var _0x199995=0x0;var _0x3e340a=0x0;for(var _0xd48a49=0x0;_0x199995<_0x2aca10;_0xd48a49+=0x1){_0x2ef1e8=_0xd48a49/_0x32908a;_0xb87819=(_0x3c4a49*_0x2ef1e8+_0x1e06e7)/_0x3417b4;_0x199995=erlangb(_0xb87819,_0x5f33b6);_0x3e340a=_0xb87819/_0x5f33b6*(0x1-erlangb(_0xb87819,_0x5f33b6));}return _0x39b2b6({'erlangCalls':_0xd48a49,'erlangCallToSecond':_0x32908a/_0xd48a49,'erlangAbandonmentRate':_0x199995,'erlangBusyFactor':_0x3e340a});});};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x1e3')]=function(_0x1e2a56,_0xb72cf7,_0x26fb0d,_0x4a9fc3,_0x3adbee,_0x4fd092){loggerPredictive['info'](_0x7e6d('0x215'));loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20c'),_0x1e2a56);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20d'),_0xb72cf7);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x216'),_0x26fb0d);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20e'),_0x4a9fc3);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x217'),_0x3adbee);loggerPredictive[_0x7e6d('0x78')]('---------------------------');return new BPromise(function(_0x5ccb06,_0x49afce){if(_0x1e2a56<=0x0||isNaN(_0x1e2a56)){return _0x49afce(msgResponse(_0x7e6d('0x218'),_0x7e6d('0x198'),_0x7e6d('0x211')+_0x1e2a56));}if(_0x26fb0d<=0x0||isNaN(_0x26fb0d)){return _0x49afce(msgResponse(_0x7e6d('0x218'),'Error',_0x7e6d('0x212')+_0x26fb0d));}if(_0x4a9fc3<=0x0||isNaN(_0x4a9fc3)){return _0x49afce(msgResponse('[busyFactor]',_0x7e6d('0x198'),_0x7e6d('0x213')+_0x4a9fc3));}if(_0xb72cf7<=0x0||isNaN(_0xb72cf7)){return _0x49afce(msgResponse(_0x7e6d('0x218'),_0x7e6d('0x198'),_0x7e6d('0x214')+_0xb72cf7));}if(_0x3adbee<=0x0||isNaN(_0x3adbee)){return _0x49afce(msgResponse(_0x7e6d('0x218'),_0x7e6d('0x198'),'Umin\x20=\x20'+_0x3adbee));}_0x4fd092=_0x4fd092||0x0;var _0x1ccdb7=0x1/_0x26fb0d;var _0x5d284e=0x0;var _0x5620ab=0x0;var _0x1f1260=0x0;var _0x4ac37b=0x0;for(var _0x3c113c=0x0;_0x4ac37b<_0x3adbee;_0x3c113c+=0x1){_0x5620ab=_0x3c113c/_0xb72cf7;_0x5d284e=(_0x4a9fc3*_0x5620ab+_0x4fd092)/_0x1ccdb7;_0x1f1260=erlangb(_0x5d284e,_0x1e2a56);_0x4ac37b=_0x5d284e/_0x1e2a56*(0x1-erlangb(_0x5d284e,_0x1e2a56));}return _0x5ccb06({'erlangCalls':_0x3c113c,'erlangCallToSecond':_0xb72cf7/_0x3c113c,'erlangAbandonmentRate':_0x1f1260,'erlangBusyFactor':_0x4ac37b});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 91a18c8..5956756 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa00=['recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','name','calleridnum','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat'];(function(_0x51cabf,_0x2828db){var _0x517538=function(_0x24a966){while(--_0x24a966){_0x51cabf['push'](_0x51cabf['shift']());}};_0x517538(++_0x2828db);}(_0xaa00,0x1f4));var _0x0aa0=function(_0x2d7f7b,_0x15f9a9){_0x2d7f7b=_0x2d7f7b-0x0;var _0x5eec22=_0xaa00[_0x2d7f7b];return _0x5eec22;};'use strict';var util=require(_0x0aa0('0x0'));var _=require(_0x0aa0('0x1'));var moment=require(_0x0aa0('0x2'));function getSeconds(_0xa1c3ad,_0x265751){var _0x29252f=moment(_0xa1c3ad)[_0x0aa0('0x3')](0x0);var _0x59cb5c=moment(_0x265751)[_0x0aa0('0x3')](0x0);return _0x29252f[_0x0aa0('0x4')](_0x59cb5c,_0x0aa0('0x5'));}function QueueCallerAbandon(_0x58d326,_0x484708){this[_0x0aa0('0x6')]=_0x58d326[_0x0aa0('0x6')];this['type']=_0x58d326[_0x0aa0('0x7')];this[_0x0aa0('0x8')]=_0x58d326['type']===_0x0aa0('0x9')?_0x0aa0('0xa'):_0x58d326[_0x0aa0('0x7')];this['countbusyretry']=_0x58d326[_0x0aa0('0xb')];this[_0x0aa0('0xc')]=_0x58d326['countcongestionretry'];this['countnoanswerretry']=_0x58d326['countnoanswerretry'];this[_0x0aa0('0xd')]=_0x58d326['countbusyretry']+_0x58d326['countcongestionretry']+_0x58d326['countnoanswerretry']+_0x58d326['countnosuchnumberretry']+_0x58d326[_0x0aa0('0xe')]+_0x58d326[_0x0aa0('0xf')]+_0x58d326[_0x0aa0('0x10')]+_0x58d326[_0x0aa0('0x11')];this[_0x0aa0('0x12')]=_0x58d326[_0x0aa0('0x12')];this[_0x0aa0('0xe')]=_0x58d326[_0x0aa0('0xe')];this[_0x0aa0('0xf')]=_0x58d326['countabandonedretry'];this[_0x0aa0('0x10')]=_0x58d326[_0x0aa0('0x10')];this['countagentrejectretry']=_0x58d326['countagentrejectretry'];this['uniqueid']=_0x484708['uniqueid'];this['calleridname']=_0x58d326[_0x0aa0('0x13')];this[_0x0aa0('0x14')]=_0x58d326['number'];this[_0x0aa0('0x15')]=_0x58d326['starttime'];this[_0x0aa0('0x16')]=_0x58d326['responsetime'];this[_0x0aa0('0x17')]=_0x58d326['droptime'];this['endtime']=this['droptime'];this[_0x0aa0('0x18')]=getSeconds(_0x58d326['responsetime'],_0x58d326[_0x0aa0('0x15')]);this[_0x0aa0('0x19')]=getSeconds(this[_0x0aa0('0x17')],_0x58d326[_0x0aa0('0x16')]);this[_0x0aa0('0x1a')]=0x0;this[_0x0aa0('0xa')]=_0x484708[_0x0aa0('0xa')];this[_0x0aa0('0x1b')]=_0x484708[_0x0aa0('0x1c')];this['reason']=_0x484708[_0x0aa0('0x1d')];this['callback']=_0x58d326[_0x0aa0('0x1e')];this[_0x0aa0('0x1f')]=_0x58d326['callbackuniqueid'];this[_0x0aa0('0x20')]=_0x58d326[_0x0aa0('0x20')];this[_0x0aa0('0x21')]=_0x58d326[_0x0aa0('0x21')];this[_0x0aa0('0x22')]=_0x58d326[_0x0aa0('0x22')];this['ListId']=_0x58d326[_0x0aa0('0x23')];this[_0x0aa0('0x24')]=_0x58d326[_0x0aa0('0x24')];this['VoiceQueueId']=_0x58d326['VoiceQueueId'];this[_0x0aa0('0x25')]=_0x58d326['CampaignId'];this['originatecalleridnum']=_0x58d326[_0x0aa0('0x26')]||'';this[_0x0aa0('0x27')]=_0x58d326[_0x0aa0('0x27')]||'';}module[_0x0aa0('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0x383c=['responsetime','droptime','endtime','ringtime','holdtime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','number','starttime'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x383c,0xe6));var _0xc383=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x383c[_0x178e48];return _0x440d7e;};'use strict';var util=require(_0xc383('0x0'));var _=require(_0xc383('0x1'));var moment=require(_0xc383('0x2'));function getSeconds(_0x32e911,_0x131957){var _0x1d62e7=moment(_0x32e911)['milliseconds'](0x0);var _0x548122=moment(_0x131957)[_0xc383('0x3')](0x0);return _0x1d62e7[_0xc383('0x4')](_0x548122,_0xc383('0x5'));}function QueueCallerAbandon(_0xaa904c,_0x5b5485){this[_0xc383('0x6')]=_0xaa904c[_0xc383('0x6')];this['type']=_0xaa904c[_0xc383('0x7')];this['campaigntype']=_0xaa904c[_0xc383('0x7')]===_0xc383('0x8')?'queue':_0xaa904c[_0xc383('0x7')];this[_0xc383('0x9')]=_0xaa904c[_0xc383('0x9')];this['countcongestionretry']=_0xaa904c[_0xc383('0xa')];this[_0xc383('0xb')]=_0xaa904c['countnoanswerretry'];this[_0xc383('0xc')]=_0xaa904c[_0xc383('0x9')]+_0xaa904c['countcongestionretry']+_0xaa904c[_0xc383('0xb')]+_0xaa904c[_0xc383('0xd')]+_0xaa904c[_0xc383('0xe')]+_0xaa904c['countabandonedretry']+_0xaa904c[_0xc383('0xf')]+_0xaa904c[_0xc383('0x10')];this['countnosuchnumberretry']=_0xaa904c[_0xc383('0xd')];this[_0xc383('0xe')]=_0xaa904c[_0xc383('0xe')];this['countabandonedretry']=_0xaa904c[_0xc383('0x11')];this['countmachineretry']=_0xaa904c[_0xc383('0xf')];this['countagentrejectretry']=_0xaa904c['countagentrejectretry'];this[_0xc383('0x12')]=_0x5b5485['uniqueid'];this['calleridname']=_0xaa904c[_0xc383('0x13')];this['calleridnum']=_0xaa904c[_0xc383('0x14')];this['starttime']=_0xaa904c[_0xc383('0x15')];this[_0xc383('0x16')]=_0xaa904c['responsetime'];this[_0xc383('0x17')]=_0xaa904c[_0xc383('0x17')];this[_0xc383('0x18')]=this[_0xc383('0x17')];this[_0xc383('0x19')]=getSeconds(_0xaa904c[_0xc383('0x16')],_0xaa904c[_0xc383('0x15')]);this[_0xc383('0x1a')]=getSeconds(this[_0xc383('0x17')],_0xaa904c[_0xc383('0x16')]);this['talktime']=0x0;this[_0xc383('0x1b')]=_0x5b5485[_0xc383('0x1b')];this[_0xc383('0x1c')]=_0x5b5485[_0xc383('0x1d')];this[_0xc383('0x1e')]=_0x5b5485['reason'];this[_0xc383('0x1f')]=_0xaa904c[_0xc383('0x1f')];this[_0xc383('0x20')]=_0xaa904c[_0xc383('0x20')];this[_0xc383('0x21')]=_0xaa904c['callbackat'];this[_0xc383('0x22')]=_0xaa904c[_0xc383('0x22')];this[_0xc383('0x23')]=_0xaa904c[_0xc383('0x23')];this['ListId']=_0xaa904c[_0xc383('0x24')];this[_0xc383('0x25')]=_0xaa904c[_0xc383('0x25')];this[_0xc383('0x26')]=_0xaa904c[_0xc383('0x26')];this[_0xc383('0x27')]=_0xaa904c[_0xc383('0x27')];this[_0xc383('0x28')]=_0xaa904c[_0xc383('0x28')]||'';this['originatecalleridname']=_0xaa904c['originatecalleridname']||'';}module[_0xc383('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 50ad1d8..cfe4554 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(_0x29e557,_0xea567e){var _0x52c524=function(_0x3e5126){while(--_0x3e5126){_0x29e557['push'](_0x29e557['shift']());}};_0x52c524(++_0xea567e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x3caa18,_0x2b538c){var _0x3abfc7=function(_0x397641){while(--_0x397641){_0x3caa18['push'](_0x3caa18['shift']());}};_0x3abfc7(++_0x2b538c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 2477084..8c556bc 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 _0xda56=['uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewExten','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','logger','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','FaxAccountId','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0xda56,0x74));var _0x6da5=function(_0x1e354d,_0x4cdd11){_0x1e354d=_0x1e354d-0x0;var _0x25445d=_0xda56[_0x1e354d];return _0x25445d;};'use strict';var util=require(_0x6da5('0x0'));var _=require(_0x6da5('0x1'));var BPromise=require(_0x6da5('0x2'));var uuid=require(_0x6da5('0x3'));var moment=require(_0x6da5('0x4'));var path=require(_0x6da5('0x5'));var tiff2pdf=require(_0x6da5('0x6'));var gs=require(_0x6da5('0x7'));var logger=require(_0x6da5('0x8'))('fax');var ami=require(_0x6da5('0x9'));var rpcDb=require(_0x6da5('0xa'));var Channel=require(_0x6da5('0xb'));var ut=require(_0x6da5('0xc'));var Action=require(_0x6da5('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x6da5('0xe'));var faxMessage=require(_0x6da5('0xf'));function Fax(_0x1cff5d){this[_0x6da5('0x10')]={};this[_0x6da5('0x11')]=_0x1cff5d[_0x6da5('0x11')];this[_0x6da5('0x12')]=_0x1cff5d['trunks'];this[_0x6da5('0x13')]={};ami['on'](_0x6da5('0x14'),this[_0x6da5('0x15')][_0x6da5('0x16')](this));ami['on'](_0x6da5('0x17'),this['syncVarSet'][_0x6da5('0x16')](this));ami['on'](_0x6da5('0x18'),this['syncNewState'][_0x6da5('0x16')](this));ami['on']('newexten',this[_0x6da5('0x19')][_0x6da5('0x16')](this));ami['on']('faxstatus',this[_0x6da5('0x1a')]['bind'](this));ami['on'](_0x6da5('0x1b'),this['syncReceiveFax']['bind'](this));ami['on'](_0x6da5('0x1c'),this[_0x6da5('0x1d')][_0x6da5('0x16')](this));ami['on'](_0x6da5('0x1e'),this[_0x6da5('0x1f')][_0x6da5('0x16')](this));}Fax[_0x6da5('0x20')][_0x6da5('0x15')]=function(_0x3e59e1){if(_0x3e59e1['context']==='from-voip-provider'){for(var _0x349ca4 in this[_0x6da5('0x11')]){if(this[_0x6da5('0x11')][_0x6da5('0x21')](_0x349ca4)){if(_0x3e59e1[_0x6da5('0x22')]===this[_0x6da5('0x11')][_0x349ca4][_0x6da5('0x23')]){this[_0x6da5('0x10')][_0x3e59e1[_0x6da5('0x24')]]={};this[_0x6da5('0x10')][_0x3e59e1[_0x6da5('0x24')]][_0x6da5('0x25')]=_0x3e59e1[_0x6da5('0x25')];this[_0x6da5('0x10')][_0x3e59e1[_0x6da5('0x24')]]['id']=this[_0x6da5('0x11')][_0x349ca4]['id'];this[_0x6da5('0x10')][_0x3e59e1[_0x6da5('0x24')]][_0x6da5('0x26')]=this[_0x6da5('0x11')][_0x349ca4]['name'];logger['info'](_0x3e59e1['uniqueid'],_0x6da5('0x27'));}}}}if(this[_0x6da5('0x13')][_0x3e59e1[_0x6da5('0x24')]]){this[_0x6da5('0x10')][_0x3e59e1[_0x6da5('0x24')]]={};this[_0x6da5('0x10')][_0x3e59e1['uniqueid']][_0x6da5('0x25')]=_0x3e59e1[_0x6da5('0x25')];logger[_0x6da5('0x28')](_0x3e59e1[_0x6da5('0x24')],'\x20syncNewchannel\x20');}};Fax['prototype']['syncVarSet']=function(_0x34d332){if(this[_0x6da5('0x10')][_0x34d332[_0x6da5('0x24')]]){for(var _0x40371e in _0x34d332[_0x6da5('0x29')]){if(_0x34d332[_0x6da5('0x29')]['hasOwnProperty'](_0x40371e)){this[_0x6da5('0x10')][_0x34d332[_0x6da5('0x24')]][_0x40371e]=_0x34d332[_0x6da5('0x2a')];}}}};Fax[_0x6da5('0x20')]['syncNewState']=function(_0x18bf05){if(this[_0x6da5('0x10')][_0x18bf05['uniqueid']]){this['channels'][_0x18bf05['uniqueid']][_0x6da5('0x2b')]=_0x18bf05['channelstate'];this['channels'][_0x18bf05[_0x6da5('0x24')]][_0x6da5('0x2c')]=_0x18bf05['channelstatedesc'];}};Fax[_0x6da5('0x20')]['syncNewExten']=function(_0x57c47c){if(this['channels'][_0x57c47c[_0x6da5('0x24')]]){for(var _0x1100ec in _0x57c47c[_0x6da5('0x29')]){if(_0x57c47c[_0x6da5('0x29')]['hasOwnProperty'](_0x1100ec)){this[_0x6da5('0x10')][_0x57c47c['uniqueid']][_0x1100ec]=_0x57c47c[_0x6da5('0x2a')];}}}};Fax['prototype'][_0x6da5('0x1a')]=function(_0x118019){if(this[_0x6da5('0x10')][_0x118019[_0x6da5('0x24')]]){this['channels'][_0x118019[_0x6da5('0x24')]][_0x6da5('0x2d')]=_0x118019[_0x6da5('0x2d')];this['channels'][_0x118019[_0x6da5('0x24')]]['status']=_0x118019[_0x6da5('0x2e')];this[_0x6da5('0x10')][_0x118019[_0x6da5('0x24')]][_0x6da5('0x23')]=_0x118019[_0x6da5('0x23')];this[_0x6da5('0x10')][_0x118019[_0x6da5('0x24')]][_0x6da5('0x2f')]=_0x118019[_0x6da5('0x2f')];logger['info'](_0x118019[_0x6da5('0x24')],_0x6da5('0x30'));}};Fax[_0x6da5('0x20')][_0x6da5('0x31')]=function(_0x3e7c4f){var _0x17a9fb=this;if(this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]]){var _0x4d724e=this['channels'][_0x3e7c4f[_0x6da5('0x24')]]['id'];this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]]['remotestationid']=_0x3e7c4f[_0x6da5('0x32')];this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]]['pagestransferred']=_0x3e7c4f[_0x6da5('0x33')];this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]][_0x6da5('0x23')]=_0x3e7c4f[_0x6da5('0x23')];this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]][_0x6da5('0x34')]=_0x3e7c4f['resolution'];this['channels'][_0x3e7c4f[_0x6da5('0x24')]][_0x6da5('0x35')]=_0x3e7c4f['transferrate'];this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]][_0x6da5('0x2f')]=_0x3e7c4f['filename'];this[_0x6da5('0x10')][_0x3e7c4f['uniqueid']][_0x6da5('0x36')]=_0x3e7c4f['calleridnum'];if(this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]]['pagestransferred']>0x0){tiff2pdf(_0x3e7c4f['filename'],_0x6da5('0x37'),function(_0x582f55){logger[_0x6da5('0x28')](_0x3e7c4f[_0x6da5('0x24')],_0x6da5('0x38'),_0x582f55[_0x6da5('0x39')]);attachment[_0x6da5('0x3a')]({'name':path['parse'](_0x3e7c4f[_0x6da5('0x2f')])['name'],'basename':path[_0x6da5('0x3b')](_0x3e7c4f['filename'])[_0x6da5('0x26')]+_0x6da5('0x3c'),'type':_0x6da5('0x3d')})[_0x6da5('0x3e')](function(_0x58e1b7){faxAccount[_0x6da5('0x3f')](_0x4d724e,{'from':_0x3e7c4f[_0x6da5('0x36')],'mapKey':_0x6da5('0x40'),'body':path[_0x6da5('0x3b')](_0x3e7c4f[_0x6da5('0x2f')])[_0x6da5('0x26')]+_0x6da5('0x3c'),'AttachmentId':_0x58e1b7['id']})[_0x6da5('0x41')](function(_0x1d8713){logger[_0x6da5('0x42')](_0x3e7c4f[_0x6da5('0x24')],_0x6da5('0x43'),JSON[_0x6da5('0x44')](_0x1d8713));});})[_0x6da5('0x41')](function(_0x1857d7){logger[_0x6da5('0x42')](_0x3e7c4f[_0x6da5('0x24')],_0x6da5('0x45'),JSON['stringify'](_0x1857d7));});});}logger[_0x6da5('0x28')](_0x3e7c4f['uniqueid'],'\x20receiveFax\x20');}};Fax[_0x6da5('0x20')][_0x6da5('0x1f')]=function(_0x46a2d9){if(this[_0x6da5('0x13')][_0x46a2d9[_0x6da5('0x24')]]){_[_0x6da5('0x46')](this['channels'][_0x46a2d9[_0x6da5('0x24')]],_['pick'](_0x46a2d9,[_0x6da5('0x47'),_0x6da5('0x48')]));}};function updateStatus(_0x33d5c3){if(_0x33d5c3[_0x6da5('0x49')]){faxMessage[_0x6da5('0x4a')](_0x33d5c3['AttachmentId'],{'failMessage':_0x6da5('0x4b')})[_0x6da5('0x3e')](function(_0x717e3d){ut['logger'](_0x6da5('0x4c'),_0x717e3d);})[_0x6da5('0x41')](function(_0x1aacb4){ut['logger'](_0x6da5('0x4d'),_0x1aacb4);});}else{ut[_0x6da5('0x4e')](_0x6da5('0x4f'));}}Fax[_0x6da5('0x20')]['updateStatus']=function(_0x5a58ba,_0x3b7b58,_0x909000){var _0x3b6374=this;var _0x512094={};if(_0x3b7b58){_0x512094={'read':_0x3b7b58};}else{_0x512094={'failMessage':_0x909000};}if(this[_0x6da5('0x13')][_0x5a58ba][_0x6da5('0x49')]){faxMessage[_0x6da5('0x4a')](this['actions'][_0x5a58ba]['AttachmentId'],_0x512094)[_0x6da5('0x3e')](function(_0x528742){ut['logger']('[Fax][Message][Updated]',_0x528742);})['catch'](function(_0x51ce3d){ut[_0x6da5('0x4e')](_0x6da5('0x50'),_0x51ce3d);})['finally'](function(){delete _0x3b6374[_0x6da5('0x10')][_0x5a58ba];delete _0x3b6374[_0x6da5('0x13')][_0x5a58ba];});}else{ut[_0x6da5('0x4e')](_0x6da5('0x51'));delete this[_0x6da5('0x10')][_0x5a58ba];delete this[_0x6da5('0x13')][_0x5a58ba];}};Fax[_0x6da5('0x20')]['syncHangup']=function(_0x59b389){var _0x2eb2d9=this;if(this['channels'][_0x59b389[_0x6da5('0x24')]]){if(this[_0x6da5('0x13')][_0x59b389[_0x6da5('0x24')]]){this['channels'][_0x59b389[_0x6da5('0x24')]]['id']=this[_0x6da5('0x13')][_0x59b389[_0x6da5('0x24')]]['id'];this[_0x6da5('0x10')][_0x59b389[_0x6da5('0x24')]][_0x6da5('0x26')]=this['actions'][_0x59b389[_0x6da5('0x24')]]['name'];}logger[_0x6da5('0x28')](_0x59b389[_0x6da5('0x24')],this[_0x6da5('0x13')][_0x59b389[_0x6da5('0x24')]]?_0x6da5('0x52'):_0x6da5('0x53'),JSON[_0x6da5('0x44')](this[_0x6da5('0x10')][_0x59b389[_0x6da5('0x24')]]));if(this[_0x6da5('0x13')][_0x59b389[_0x6da5('0x24')]]){if(this[_0x6da5('0x10')][_0x59b389[_0x6da5('0x24')]]['faxpages']>0x0&&this[_0x6da5('0x10')][_0x59b389[_0x6da5('0x24')]][_0x6da5('0x54')]===_0x6da5('0x55')){this[_0x6da5('0x56')](_0x59b389['uniqueid'],!![]);}else{this[_0x6da5('0x56')](_0x59b389[_0x6da5('0x24')],![],this[_0x6da5('0x10')][_0x59b389[_0x6da5('0x24')]][_0x6da5('0x57')]?_0x6da5('0x58')+this[_0x6da5('0x10')][_0x59b389['uniqueid']][_0x6da5('0x57')]:_0x6da5('0x59'));}}}};Fax[_0x6da5('0x20')]['send']=function(_0xb98ae2){var _0x2aa528=this;return new BPromise(function(_0x48c582,_0x3e74ce){_0x2aa528[_0x6da5('0x5a')](_0xb98ae2,_0x2aa528[_0x6da5('0x11')][_0xb98ae2['FaxAccountId']])['then'](function(_0x58ee7d){ut[_0x6da5('0x4e')]('[Fax][execOriginate][success]',_0x58ee7d);_0x48c582(ut[_0x6da5('0x39')]('Fax\x20received'));})[_0x6da5('0x41')](function(_0x503f0f){ut[_0x6da5('0x4e')](_0x6da5('0x5b'),_0x503f0f);updateStatus(_0xb98ae2);_0x3e74ce(ut[_0x6da5('0x39')](_0x6da5('0x5c')));});});};Fax['prototype']['checkAfterSend']=function(_0x7c4d69){var _0x59b471=this;return new BPromise(function(_0x382873,_0x3316e3){var _0x115545=_0x59b471[_0x6da5('0x5d')](_0x59b471[_0x6da5('0x11')][_0x7c4d69[_0x6da5('0x5e')]]['Trunk'],_0x7c4d69);if(_0x115545[_0x6da5('0x5f')]){_0x382873(ut[_0x6da5('0x39')](_0x6da5('0x60')));}else{_0x3316e3(ut[_0x6da5('0x39')](_0x115545[_0x6da5('0x39')]));}});};function originate(_0x4cad1b,_0x252523,_0x466bf8){return new BPromise(function(_0x3fd69b,_0x19daf5){if(_0x466bf8){var _0x3bbbd3=util[_0x6da5('0x61')](_0x6da5('0x62'),path[_0x6da5('0x3b')](_0x4cad1b[_0x6da5('0x5')])['name'],_0x4cad1b['path']);gs['execute'](_0x3bbbd3)[_0x6da5('0x3e')](function(){_0x4cad1b[_0x6da5('0x5')]=util['format'](_0x6da5('0x63'),path[_0x6da5('0x3b')](_0x4cad1b['path'])[_0x6da5('0x64')],path[_0x6da5('0x3b')](_0x4cad1b[_0x6da5('0x5')])[_0x6da5('0x26')]);_0x252523[_0x6da5('0x65')]=_0x4cad1b[_0x6da5('0x5')];ut[_0x6da5('0x4e')](_0x6da5('0x66'),'');ami[_0x6da5('0x67')](ut['variablesAction'](_0x4cad1b,_0x252523))[_0x6da5('0x3e')](function(_0x2c9d37){_0x3fd69b(_0x2c9d37);})[_0x6da5('0x41')](function(_0x5a6b04){_0x19daf5(_0x5a6b04);});})[_0x6da5('0x41')](function(_0x1dfe1f){_0x19daf5(_0x1dfe1f);});}else{ami[_0x6da5('0x67')](ut[_0x6da5('0x68')](_0x4cad1b,_0x252523))['then'](function(_0x1bce99){_0x3fd69b(_0x1bce99);})[_0x6da5('0x41')](function(_0x570b6e){_0x19daf5(_0x570b6e);});}});}Fax['prototype']['execOriginate']=function(_0x2cc49f,_0x124adc){var _0x42fce9=this;return new BPromise(function(_0x134705,_0x4532b9){var _0x534e1a=uuid['v4']();var _0x405e70=ut[_0x6da5('0x69')](_0x2cc49f,_0x124adc);_0x42fce9[_0x6da5('0x13')][_0x534e1a]=new Action(_0x534e1a,_0x124adc,_0x2cc49f);var _0x3f8bcc=_0x42fce9[_0x6da5('0x13')][_0x534e1a];if(path['parse'](_0x2cc49f[_0x6da5('0x5')])[_0x6da5('0x6a')]==='.pdf'){originate(_0x3f8bcc,_0x405e70,!![])[_0x6da5('0x3e')](function(_0x14af39){_0x134705(_0x14af39);})[_0x6da5('0x41')](function(_0x15715e){_0x4532b9(_0x15715e);});}else{originate(_0x3f8bcc,_0x405e70,![])['then'](function(_0x2e593f){_0x134705(_0x2e593f);})[_0x6da5('0x41')](function(_0x67a5f1){_0x4532b9(_0x67a5f1);});}});};Fax[_0x6da5('0x20')][_0x6da5('0x6b')]=function(_0xae2807){return!_[_0x6da5('0x6c')](_0xae2807)&&!_[_0x6da5('0x6c')](_0xae2807[_0x6da5('0x26')])&&!_[_0x6da5('0x6c')](_0xae2807[_0x6da5('0x6d')])&&_0xae2807['active']&&!_['isNil'](this[_0x6da5('0x12')][util['format'](_0x6da5('0x6e'),_0xae2807['name'])])&&!_[_0x6da5('0x6c')](this[_0x6da5('0x12')][util[_0x6da5('0x61')](_0x6da5('0x6e'),_0xae2807['name'])][_0x6da5('0x2e')])&&(this['trunks'][util[_0x6da5('0x61')](_0x6da5('0x6e'),_0xae2807[_0x6da5('0x26')])][_0x6da5('0x2e')]===_0x6da5('0x6f')||this[_0x6da5('0x12')][util['format'](_0x6da5('0x6e'),_0xae2807[_0x6da5('0x26')])][_0x6da5('0x2e')]===_0x6da5('0x70'));};Fax['prototype']['checkTrunk']=function(_0x4ff6b5,_0x24ed9d){if(!this['isTrunkReachable'](_0x4ff6b5)){ut[_0x6da5('0x4e')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_['isNil'](_0x4ff6b5)?'':_0x4ff6b5[_0x6da5('0x26')]+_0x6da5('0x71'));return{'isValid':![],'message':_0x6da5('0x72')};}if(_[_0x6da5('0x6c')](_0x24ed9d[_0x6da5('0x40')])){ut[_0x6da5('0x4e')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x24ed9d));return{'isValid':![],'message':_0x6da5('0x73')};}if(_[_0x6da5('0x6c')](_0x24ed9d[_0x6da5('0x5')])){ut[_0x6da5('0x4e')](_0x6da5('0x74'),JSON[_0x6da5('0x44')](_0x24ed9d));return{'isValid':![],'message':_0x6da5('0x75')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x6da5('0x76')]=Fax; \ No newline at end of file +var _0xd5f0=['%s/%s.tif','dir','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./util/util','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','notify','.pdf','catch','\x20receiveFax\x20','stringify','merge','pick','response','reason','AttachmentId','update','[Fax][Message][Error][NoUpdate1]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format'];(function(_0x1ff8ab,_0x347825){var _0x3c93b4=function(_0x468afb){while(--_0x468afb){_0x1ff8ab['push'](_0x1ff8ab['shift']());}};_0x3c93b4(++_0x347825);}(_0xd5f0,0x1e3));var _0x0d5f=function(_0x45317b,_0xc0002c){_0x45317b=_0x45317b-0x0;var _0x26443d=_0xd5f0[_0x45317b];return _0x26443d;};'use strict';var util=require(_0x0d5f('0x0'));var _=require(_0x0d5f('0x1'));var BPromise=require('bluebird');var uuid=require(_0x0d5f('0x2'));var moment=require(_0x0d5f('0x3'));var path=require(_0x0d5f('0x4'));var tiff2pdf=require(_0x0d5f('0x5'));var gs=require(_0x0d5f('0x6'));var logger=require(_0x0d5f('0x7'))(_0x0d5f('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x0d5f('0x9'));var Action=require(_0x0d5f('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x0d5f('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x43b1f1){this[_0x0d5f('0xc')]={};this['faxAccounts']=_0x43b1f1[_0x0d5f('0xd')];this[_0x0d5f('0xe')]=_0x43b1f1[_0x0d5f('0xe')];this[_0x0d5f('0xf')]={};ami['on'](_0x0d5f('0x10'),this[_0x0d5f('0x11')][_0x0d5f('0x12')](this));ami['on'](_0x0d5f('0x13'),this[_0x0d5f('0x14')][_0x0d5f('0x12')](this));ami['on'](_0x0d5f('0x15'),this['syncNewState'][_0x0d5f('0x12')](this));ami['on'](_0x0d5f('0x16'),this['syncNewExten'][_0x0d5f('0x12')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0x0d5f('0x12')](this));ami['on']('receivefax',this[_0x0d5f('0x17')][_0x0d5f('0x12')](this));ami['on'](_0x0d5f('0x18'),this[_0x0d5f('0x19')]['bind'](this));ami['on'](_0x0d5f('0x1a'),this[_0x0d5f('0x1b')][_0x0d5f('0x12')](this));}Fax[_0x0d5f('0x1c')]['syncNewchannel']=function(_0x120ecb){if(_0x120ecb['context']===_0x0d5f('0x1d')){for(var _0x226c3e in this[_0x0d5f('0xd')]){if(this[_0x0d5f('0xd')][_0x0d5f('0x1e')](_0x226c3e)){if(_0x120ecb[_0x0d5f('0x1f')]===this[_0x0d5f('0xd')][_0x226c3e]['localstationid']){this['channels'][_0x120ecb[_0x0d5f('0x20')]]={};this[_0x0d5f('0xc')][_0x120ecb[_0x0d5f('0x20')]][_0x0d5f('0x21')]=_0x120ecb[_0x0d5f('0x21')];this['channels'][_0x120ecb['uniqueid']]['id']=this['faxAccounts'][_0x226c3e]['id'];this['channels'][_0x120ecb['uniqueid']][_0x0d5f('0x22')]=this['faxAccounts'][_0x226c3e][_0x0d5f('0x22')];logger[_0x0d5f('0x23')](_0x120ecb[_0x0d5f('0x20')],'\x20syncNewchannel\x20');}}}}if(this[_0x0d5f('0xf')][_0x120ecb[_0x0d5f('0x20')]]){this[_0x0d5f('0xc')][_0x120ecb[_0x0d5f('0x20')]]={};this['channels'][_0x120ecb[_0x0d5f('0x20')]][_0x0d5f('0x21')]=_0x120ecb[_0x0d5f('0x21')];logger[_0x0d5f('0x23')](_0x120ecb[_0x0d5f('0x20')],_0x0d5f('0x24'));}};Fax['prototype']['syncVarSet']=function(_0x128f6b){if(this[_0x0d5f('0xc')][_0x128f6b[_0x0d5f('0x20')]]){for(var _0x3eead9 in _0x128f6b[_0x0d5f('0x25')]){if(_0x128f6b[_0x0d5f('0x25')][_0x0d5f('0x1e')](_0x3eead9)){this[_0x0d5f('0xc')][_0x128f6b['uniqueid']][_0x3eead9]=_0x128f6b[_0x0d5f('0x26')];}}}};Fax[_0x0d5f('0x1c')][_0x0d5f('0x27')]=function(_0x22df44){if(this[_0x0d5f('0xc')][_0x22df44[_0x0d5f('0x20')]]){this['channels'][_0x22df44['uniqueid']]['channelstate']=_0x22df44[_0x0d5f('0x28')];this[_0x0d5f('0xc')][_0x22df44[_0x0d5f('0x20')]][_0x0d5f('0x29')]=_0x22df44[_0x0d5f('0x29')];}};Fax[_0x0d5f('0x1c')][_0x0d5f('0x2a')]=function(_0x24dd96){if(this[_0x0d5f('0xc')][_0x24dd96[_0x0d5f('0x20')]]){for(var _0x332cfc in _0x24dd96[_0x0d5f('0x25')]){if(_0x24dd96['variable']['hasOwnProperty'](_0x332cfc)){this[_0x0d5f('0xc')][_0x24dd96['uniqueid']][_0x332cfc]=_0x24dd96['value'];}}}};Fax[_0x0d5f('0x1c')][_0x0d5f('0x2b')]=function(_0x49e056){if(this[_0x0d5f('0xc')][_0x49e056['uniqueid']]){this['channels'][_0x49e056[_0x0d5f('0x20')]][_0x0d5f('0x2c')]=_0x49e056[_0x0d5f('0x2c')];this[_0x0d5f('0xc')][_0x49e056['uniqueid']]['status']=_0x49e056[_0x0d5f('0x2d')];this['channels'][_0x49e056[_0x0d5f('0x20')]]['localstationid']=_0x49e056[_0x0d5f('0x2e')];this[_0x0d5f('0xc')][_0x49e056[_0x0d5f('0x20')]][_0x0d5f('0x2f')]=_0x49e056[_0x0d5f('0x2f')];logger[_0x0d5f('0x23')](_0x49e056['uniqueid'],_0x0d5f('0x30'));}};Fax[_0x0d5f('0x1c')][_0x0d5f('0x17')]=function(_0x37d208){var _0x180469=this;if(this[_0x0d5f('0xc')][_0x37d208['uniqueid']]){var _0x46f6cb=this[_0x0d5f('0xc')][_0x37d208['uniqueid']]['id'];this[_0x0d5f('0xc')][_0x37d208[_0x0d5f('0x20')]][_0x0d5f('0x31')]=_0x37d208[_0x0d5f('0x31')];this[_0x0d5f('0xc')][_0x37d208['uniqueid']][_0x0d5f('0x32')]=_0x37d208[_0x0d5f('0x32')];this['channels'][_0x37d208[_0x0d5f('0x20')]][_0x0d5f('0x2e')]=_0x37d208['localstationid'];this[_0x0d5f('0xc')][_0x37d208[_0x0d5f('0x20')]][_0x0d5f('0x33')]=_0x37d208[_0x0d5f('0x33')];this[_0x0d5f('0xc')][_0x37d208[_0x0d5f('0x20')]][_0x0d5f('0x34')]=_0x37d208[_0x0d5f('0x34')];this[_0x0d5f('0xc')][_0x37d208[_0x0d5f('0x20')]][_0x0d5f('0x2f')]=_0x37d208[_0x0d5f('0x2f')];this[_0x0d5f('0xc')][_0x37d208[_0x0d5f('0x20')]]['calleridnum']=_0x37d208[_0x0d5f('0x35')];if(this['channels'][_0x37d208['uniqueid']][_0x0d5f('0x32')]>0x0){tiff2pdf(_0x37d208[_0x0d5f('0x2f')],_0x0d5f('0x36'),function(_0x40433b){logger['info'](_0x37d208[_0x0d5f('0x20')],_0x0d5f('0x37'),_0x40433b['message']);attachment[_0x0d5f('0x38')]({'name':path['parse'](_0x37d208['filename'])[_0x0d5f('0x22')],'basename':path[_0x0d5f('0x39')](_0x37d208['filename'])['name']+'.pdf','type':_0x0d5f('0x3a')})[_0x0d5f('0x3b')](function(_0x3e541e){faxAccount[_0x0d5f('0x3c')](_0x46f6cb,{'from':_0x37d208['calleridnum'],'mapKey':_0x0d5f('0x8'),'body':path[_0x0d5f('0x39')](_0x37d208['filename'])[_0x0d5f('0x22')]+_0x0d5f('0x3d'),'AttachmentId':_0x3e541e['id']})[_0x0d5f('0x3e')](function(_0x38525b){logger['error'](_0x37d208[_0x0d5f('0x20')],'\x20notify\x20',JSON['stringify'](_0x38525b));});})[_0x0d5f('0x3e')](function(_0x32d8c5){logger['error'](_0x37d208['uniqueid'],_0x0d5f('0x3f'),JSON[_0x0d5f('0x40')](_0x32d8c5));});});}logger[_0x0d5f('0x23')](_0x37d208[_0x0d5f('0x20')],_0x0d5f('0x3f'));}};Fax[_0x0d5f('0x1c')]['syncOriginateResponse']=function(_0x309383){if(this['actions'][_0x309383['uniqueid']]){_[_0x0d5f('0x41')](this[_0x0d5f('0xc')][_0x309383[_0x0d5f('0x20')]],_[_0x0d5f('0x42')](_0x309383,[_0x0d5f('0x43'),_0x0d5f('0x44')]));}};function updateStatus(_0x2ba04b){if(_0x2ba04b[_0x0d5f('0x45')]){faxMessage[_0x0d5f('0x46')](_0x2ba04b['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x0d5f('0x3b')](function(_0x125fbc){ut['logger']('[Fax][Message][Error][Updated]',_0x125fbc);})[_0x0d5f('0x3e')](function(_0x229ea0){ut['logger'](_0x0d5f('0x47'),_0x229ea0);});}else{ut[_0x0d5f('0x48')](_0x0d5f('0x49'));}}Fax[_0x0d5f('0x1c')][_0x0d5f('0x4a')]=function(_0x4e01c9,_0x564a5a,_0x26fad9){var _0x30d79b=this;var _0x56e898={};if(_0x564a5a){_0x56e898={'read':_0x564a5a};}else{_0x56e898={'failMessage':_0x26fad9};}if(this['actions'][_0x4e01c9][_0x0d5f('0x45')]){faxMessage['update'](this['actions'][_0x4e01c9]['AttachmentId'],_0x56e898)[_0x0d5f('0x3b')](function(_0x4ef4f9){ut[_0x0d5f('0x48')](_0x0d5f('0x4b'),_0x4ef4f9);})['catch'](function(_0x4443e6){ut['logger'](_0x0d5f('0x4c'),_0x4443e6);})[_0x0d5f('0x4d')](function(){delete _0x30d79b[_0x0d5f('0xc')][_0x4e01c9];delete _0x30d79b[_0x0d5f('0xf')][_0x4e01c9];});}else{ut[_0x0d5f('0x48')](_0x0d5f('0x4e'));delete this['channels'][_0x4e01c9];delete this[_0x0d5f('0xf')][_0x4e01c9];}};Fax[_0x0d5f('0x1c')]['syncHangup']=function(_0x2f1f58){var _0x3df332=this;if(this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]]){if(this[_0x0d5f('0xf')][_0x2f1f58[_0x0d5f('0x20')]]){this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]]['id']=this[_0x0d5f('0xf')][_0x2f1f58[_0x0d5f('0x20')]]['id'];this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]][_0x0d5f('0x22')]=this[_0x0d5f('0xf')][_0x2f1f58[_0x0d5f('0x20')]][_0x0d5f('0x22')];}logger[_0x0d5f('0x23')](_0x2f1f58[_0x0d5f('0x20')],this[_0x0d5f('0xf')][_0x2f1f58['uniqueid']]?_0x0d5f('0x4f'):_0x0d5f('0x50'),JSON[_0x0d5f('0x40')](this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]]));if(this[_0x0d5f('0xf')][_0x2f1f58['uniqueid']]){if(this['channels'][_0x2f1f58[_0x0d5f('0x20')]]['faxpages']>0x0&&this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]]['faxstatus']===_0x0d5f('0x51')){this[_0x0d5f('0x4a')](_0x2f1f58[_0x0d5f('0x20')],!![]);}else{this[_0x0d5f('0x4a')](_0x2f1f58[_0x0d5f('0x20')],![],this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]]['faxstatusstring']?_0x0d5f('0x52')+this['channels'][_0x2f1f58[_0x0d5f('0x20')]]['faxstatusstring']:_0x0d5f('0x53'));}}}};Fax[_0x0d5f('0x1c')][_0x0d5f('0x54')]=function(_0x55f06c){var _0x36dc8d=this;return new BPromise(function(_0x8f5426,_0xf861d9){_0x36dc8d[_0x0d5f('0x55')](_0x55f06c,_0x36dc8d[_0x0d5f('0xd')][_0x55f06c[_0x0d5f('0x56')]])[_0x0d5f('0x3b')](function(_0x17161b){ut[_0x0d5f('0x48')](_0x0d5f('0x57'),_0x17161b);_0x8f5426(ut[_0x0d5f('0x58')]('Fax\x20received'));})[_0x0d5f('0x3e')](function(_0x55815f){ut['logger'](_0x0d5f('0x59'),_0x55815f);updateStatus(_0x55f06c);_0xf861d9(ut[_0x0d5f('0x58')](_0x0d5f('0x5a')));});});};Fax['prototype'][_0x0d5f('0x5b')]=function(_0x1db2eb){var _0x5b7e3b=this;return new BPromise(function(_0x11678e,_0x1fbb09){var _0x3cc54c=_0x5b7e3b[_0x0d5f('0x5c')](_0x5b7e3b['faxAccounts'][_0x1db2eb['FaxAccountId']][_0x0d5f('0x5d')],_0x1db2eb);if(_0x3cc54c[_0x0d5f('0x5e')]){_0x11678e(ut['message'](_0x0d5f('0x5f')));}else{_0x1fbb09(ut['message'](_0x3cc54c[_0x0d5f('0x58')]));}});};function originate(_0x488d55,_0x1555e1,_0x3cdfe0){return new BPromise(function(_0x16c747,_0x18b318){if(_0x3cdfe0){var _0x5947f5=util[_0x0d5f('0x60')]('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[_0x0d5f('0x39')](_0x488d55[_0x0d5f('0x4')])[_0x0d5f('0x22')],_0x488d55[_0x0d5f('0x4')]);gs['execute'](_0x5947f5)[_0x0d5f('0x3b')](function(){_0x488d55[_0x0d5f('0x4')]=util['format'](_0x0d5f('0x61'),path[_0x0d5f('0x39')](_0x488d55[_0x0d5f('0x4')])[_0x0d5f('0x62')],path['parse'](_0x488d55[_0x0d5f('0x4')])['name']);_0x1555e1['XMF-PATH']=_0x488d55[_0x0d5f('0x4')];ut[_0x0d5f('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x0d5f('0x63')](ut['variablesAction'](_0x488d55,_0x1555e1))[_0x0d5f('0x3b')](function(_0x360b04){_0x16c747(_0x360b04);})['catch'](function(_0x5719e9){_0x18b318(_0x5719e9);});})['catch'](function(_0x25012a){_0x18b318(_0x25012a);});}else{ami['Action'](ut[_0x0d5f('0x64')](_0x488d55,_0x1555e1))['then'](function(_0x3f9e2d){_0x16c747(_0x3f9e2d);})[_0x0d5f('0x3e')](function(_0xd3704c){_0x18b318(_0xd3704c);});}});}Fax[_0x0d5f('0x1c')][_0x0d5f('0x55')]=function(_0x3a6463,_0x4bb1a2){var _0x3a57be=this;return new BPromise(function(_0x4fbfa1,_0x2e589e){var _0x255228=uuid['v4']();var _0x205f11=ut[_0x0d5f('0x65')](_0x3a6463,_0x4bb1a2);_0x3a57be[_0x0d5f('0xf')][_0x255228]=new Action(_0x255228,_0x4bb1a2,_0x3a6463);var _0x41d17f=_0x3a57be[_0x0d5f('0xf')][_0x255228];if(path[_0x0d5f('0x39')](_0x3a6463[_0x0d5f('0x4')])[_0x0d5f('0x66')]===_0x0d5f('0x3d')){originate(_0x41d17f,_0x205f11,!![])[_0x0d5f('0x3b')](function(_0x1bd858){_0x4fbfa1(_0x1bd858);})[_0x0d5f('0x3e')](function(_0x12ca47){_0x2e589e(_0x12ca47);});}else{originate(_0x41d17f,_0x205f11,![])[_0x0d5f('0x3b')](function(_0x19ec23){_0x4fbfa1(_0x19ec23);})['catch'](function(_0x3af69e){_0x2e589e(_0x3af69e);});}});};Fax[_0x0d5f('0x1c')][_0x0d5f('0x67')]=function(_0x3a716e){return!_['isNil'](_0x3a716e)&&!_[_0x0d5f('0x68')](_0x3a716e['name'])&&!_[_0x0d5f('0x68')](_0x3a716e[_0x0d5f('0x69')])&&_0x3a716e['active']&&!_['isNil'](this[_0x0d5f('0xe')][util[_0x0d5f('0x60')](_0x0d5f('0x6a'),_0x3a716e[_0x0d5f('0x22')])])&&!_[_0x0d5f('0x68')](this[_0x0d5f('0xe')][util[_0x0d5f('0x60')]('SIP/%s',_0x3a716e[_0x0d5f('0x22')])][_0x0d5f('0x2d')])&&(this[_0x0d5f('0xe')][util[_0x0d5f('0x60')]('SIP/%s',_0x3a716e[_0x0d5f('0x22')])][_0x0d5f('0x2d')]===_0x0d5f('0x6b')||this[_0x0d5f('0xe')][util['format']('SIP/%s',_0x3a716e[_0x0d5f('0x22')])][_0x0d5f('0x2d')]===_0x0d5f('0x6c'));};Fax[_0x0d5f('0x1c')][_0x0d5f('0x5c')]=function(_0x268322,_0x3b886d){if(!this[_0x0d5f('0x67')](_0x268322)){ut['logger'](_0x0d5f('0x6d'),_['isNil'](_0x268322)?'':_0x268322[_0x0d5f('0x22')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x0d5f('0x6e')};}if(_[_0x0d5f('0x68')](_0x3b886d[_0x0d5f('0x8')])){ut[_0x0d5f('0x48')](_0x0d5f('0x6f'),JSON[_0x0d5f('0x40')](_0x3b886d));return{'isValid':![],'message':_0x0d5f('0x70')};}if(_[_0x0d5f('0x68')](_0x3b886d[_0x0d5f('0x4')])){ut[_0x0d5f('0x48')](_0x0d5f('0x71'),JSON['stringify'](_0x3b886d));return{'isValid':![],'message':_0x0d5f('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x0d5f('0x73')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 3cda24c..12498cd 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 _0xe3d0=['[Notify]\x20','bluebird','preview','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x29bdfe,_0x251370){var _0x32309a=function(_0x387e29){while(--_0x387e29){_0x29bdfe['push'](_0x29bdfe['shift']());}};_0x32309a(++_0x251370);}(_0xe3d0,0x187));var _0x0e3d=function(_0x423535,_0x1c65ab){_0x423535=_0x423535-0x0;var _0x4ea58a=_0xe3d0[_0x423535];return _0x4ea58a;};'use strict';var util=require('util');var BPromise=require(_0x0e3d('0x0'));var logger=require('../../../config/logger')(_0x0e3d('0x1'));var _=require('lodash');var faxAccount=require(_0x0e3d('0x2'));function loggerCatch(_0x14c759){return function(_0xb7a9d5){logger[_0x0e3d('0x3')](_0x14c759,util[_0x0e3d('0x4')](_0xb7a9d5,{'showHidden':![],'depth':null}));};}exports[_0x0e3d('0x5')]=function(_0x3f51ae,_0x3419dd){return BPromise[_0x0e3d('0x6')]()[_0x0e3d('0x7')](faxAccount[_0x0e3d('0x5')](_0x3f51ae,_0x3419dd))[_0x0e3d('0x8')](loggerCatch(_0x0e3d('0x9')));}; \ No newline at end of file +var _0x4d04=['[Notify]\x20','lodash','../rpc/faxAccount','inspect','resolve','then','catch'];(function(_0x18af5d,_0x22cbbf){var _0x7540dc=function(_0x225b41){while(--_0x225b41){_0x18af5d['push'](_0x18af5d['shift']());}};_0x7540dc(++_0x22cbbf);}(_0x4d04,0x10b));var _0x44d0=function(_0x25536a,_0x1c8b6c){_0x25536a=_0x25536a-0x0;var _0x4658e4=_0x4d04[_0x25536a];return _0x4658e4;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require(_0x44d0('0x0'));var faxAccount=require(_0x44d0('0x1'));function loggerCatch(_0xaecf59){return function(_0x3fabd1){logger['error'](_0xaecf59,util[_0x44d0('0x2')](_0x3fabd1,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x47b0e5,_0x413949){return BPromise[_0x44d0('0x3')]()[_0x44d0('0x4')](faxAccount['notify'](_0x47b0e5,_0x413949))[_0x44d0('0x5')](loggerCatch(_0x44d0('0x6')));}; \ 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 c5da46c..ec14b7c 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 _0x2bca=['bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax'];(function(_0x16c33f,_0xd2ad80){var _0x104036=function(_0x2b86b7){while(--_0x2b86b7){_0x16c33f['push'](_0x16c33f['shift']());}};_0x104036(++_0xd2ad80);}(_0x2bca,0xb1));var _0xa2bc=function(_0x23ddca,_0x483401){_0x23ddca=_0x23ddca-0x0;var _0x2dc135=_0x2bca[_0x23ddca];return _0x2dc135;};'use strict';var util=require(_0xa2bc('0x0'));var logger=require(_0xa2bc('0x1'))(_0xa2bc('0x2'));var BPromise=require(_0xa2bc('0x3'));var exec=require('child_process')[_0xa2bc('0x4')];exports[_0xa2bc('0x5')]=function(_0x2a3c4d){return new BPromise(function(_0xc3e493,_0x1c64c6){exec(_0x2a3c4d,function(_0x22ed8b,_0x56c9a9,_0x1c76d0){logger[_0xa2bc('0x6')](_0xa2bc('0x7'),_0x56c9a9);if(_0x22ed8b){logger[_0xa2bc('0x6')](_0xa2bc('0x7'),_0xa2bc('0x8'),util['inspect'](_0x22ed8b,{'showHidden':![],'depth':null}),_0x56c9a9,_0x1c76d0);_0x1c64c6(_0x22ed8b);}_0xc3e493(_0x56c9a9);});});}; \ No newline at end of file +var _0xd8e4=['../../../../config/logger','fax','bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x4da75a,_0x3ffca8){var _0x516a79=function(_0x5c9d8a){while(--_0x5c9d8a){_0x4da75a['push'](_0x4da75a['shift']());}};_0x516a79(++_0x3ffca8);}(_0xd8e4,0x117));var _0x4d8e=function(_0x500b95,_0x1c12c5){_0x500b95=_0x500b95-0x0;var _0x6befc4=_0xd8e4[_0x500b95];return _0x6befc4;};'use strict';var util=require('util');var logger=require(_0x4d8e('0x0'))(_0x4d8e('0x1'));var BPromise=require(_0x4d8e('0x2'));var exec=require('child_process')[_0x4d8e('0x3')];exports[_0x4d8e('0x4')]=function(_0x49eeb8){return new BPromise(function(_0x39aff8,_0x44e392){exec(_0x49eeb8,function(_0x5e1d66,_0x1da4e8,_0x5f1b49){logger[_0x4d8e('0x5')](_0x4d8e('0x6'),_0x1da4e8);if(_0x5e1d66){logger[_0x4d8e('0x5')](_0x4d8e('0x6'),_0x4d8e('0x7'),util[_0x4d8e('0x8')](_0x5e1d66,{'showHidden':![],'depth':null}),_0x1da4e8,_0x5f1b49);_0x44e392(_0x5e1d66);}_0x39aff8(_0x1da4e8);});});}; \ 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 4876658..4c79f6f 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 _0x716b=['format','headerinfo','uniqueid','util','lodash','moment','message','inspect','ecm','minrate','maxrate','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','originate','xcally-motion-fax','from-sip'];(function(_0x49e643,_0x36f759){var _0x3774cd=function(_0x1c515b){while(--_0x1c515b){_0x49e643['push'](_0x49e643['shift']());}};_0x3774cd(++_0x36f759);}(_0x716b,0x1a5));var _0xb716=function(_0x3ce937,_0x568d7d){_0x3ce937=_0x3ce937-0x0;var _0x41d2fa=_0x716b[_0x3ce937];return _0x41d2fa;};'use strict';var util=require(_0xb716('0x0'));var _=require(_0xb716('0x1'));var moment=require(_0xb716('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0xb716('0x3')]=function(_0x249bd7){return{'message':_0x249bd7};};exports['logger']=function(_0x23a677,_0x6f181a){logger['info'](_0x23a677,util[_0xb716('0x4')](_0x6f181a,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x533d07,_0x10c704){var _0x5da4ed={'XMF-ECM':_0x10c704[_0xb716('0x5')],'XMF-HEADERINFO':_0x10c704['headerinfo'],'XMF-MINRATE':_0x10c704[_0xb716('0x6')],'XMF-MAXRATE':_0x10c704[_0xb716('0x7')],'XMF-MODEM':util['format'](_0xb716('0x8'),_0x10c704['modem']),'XMF-GATEWAY':_0x10c704[_0xb716('0x9')],'XMF-FAXDETECT':_0x10c704[_0xb716('0xa')],'XMF-T38TIMEOUT':_0x10c704[_0xb716('0xb')],'XMF-LOCALSTATIONID':_0x10c704[_0xb716('0xc')],'XMF-PATH':_0x533d07['path']};return _0x5da4ed;};exports['variablesAction']=function(_0xf25bdc,_0x116f4a){return{'actionid':_0xf25bdc['uniqueid'],'action':_0xb716('0xd'),'channel':_0xf25bdc['channel'],'Exten':_0xb716('0xe'),'Context':_0xb716('0xf'),'Priority':'1','callerid':util[_0xb716('0x10')]('\x22%s\x22\x20<%s>',_0xf25bdc[_0xb716('0x11')]?_0xf25bdc[_0xb716('0x11')]:'',_0xf25bdc['localstationid']),'variable':_0x116f4a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xf25bdc[_0xb716('0x12')]};}; \ No newline at end of file +var _0xdcdc=['channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','gateway','t38timeout','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdcdc,0x8f));var _0xcdcd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xdcdc[_0x502c7d];return _0x30b7ed;};'use strict';var util=require('util');var _=require(_0xcdcd('0x0'));var moment=require(_0xcdcd('0x1'));var logger=require(_0xcdcd('0x2'))(_0xcdcd('0x3'));exports[_0xcdcd('0x4')]=function(_0x171191){return{'message':_0x171191};};exports[_0xcdcd('0x5')]=function(_0x37f157,_0x1e92ad){logger[_0xcdcd('0x6')](_0x37f157,util[_0xcdcd('0x7')](_0x1e92ad,{'showHidden':![],'depth':null}));};exports[_0xcdcd('0x8')]=function(_0x8b0f0d,_0x4c7f91){var _0x4871a8={'XMF-ECM':_0x4c7f91[_0xcdcd('0x9')],'XMF-HEADERINFO':_0x4c7f91[_0xcdcd('0xa')],'XMF-MINRATE':_0x4c7f91[_0xcdcd('0xb')],'XMF-MAXRATE':_0x4c7f91[_0xcdcd('0xc')],'XMF-MODEM':util[_0xcdcd('0xd')](_0xcdcd('0xe'),_0x4c7f91['modem']),'XMF-GATEWAY':_0x4c7f91[_0xcdcd('0xf')],'XMF-FAXDETECT':_0x4c7f91['faxdetect'],'XMF-T38TIMEOUT':_0x4c7f91[_0xcdcd('0x10')],'XMF-LOCALSTATIONID':_0x4c7f91['localstationid'],'XMF-PATH':_0x8b0f0d['path']};return _0x4871a8;};exports['variablesAction']=function(_0x3f8827,_0x1d1abc){return{'actionid':_0x3f8827[_0xcdcd('0x11')],'action':'originate','channel':_0x3f8827[_0xcdcd('0x12')],'Exten':_0xcdcd('0x13'),'Context':_0xcdcd('0x14'),'Priority':'1','callerid':util[_0xcdcd('0xd')](_0xcdcd('0x15'),_0x3f8827[_0xcdcd('0xa')]?_0x3f8827['headerinfo']:'',_0x3f8827[_0xcdcd('0x16')]),'variable':_0x1d1abc,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3f8827['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index f5c81d0..b926a0c 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 _0xbf81=['getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','sync','util','moment','./server','./realtime','./report','./acw','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbf81,0x194));var _0x1bf8=function(_0x333b8c,_0x8c792d){_0x333b8c=_0x333b8c-0x0;var _0x3af725=_0xbf81[_0x333b8c];return _0x3af725;};'use strict';var BPromise=require('bluebird');var util=require(_0x1bf8('0x0'));var moment=require(_0x1bf8('0x1'));var server=require(_0x1bf8('0x2'));var Realtime=require(_0x1bf8('0x3'));var Report=require(_0x1bf8('0x4'));var Acw=require(_0x1bf8('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x1bf8('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x1bf8('0x7'));var voiceQueue=require(_0x1bf8('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x1bf8('0x9'));var trunk=require(_0x1bf8('0xa'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x1bf8('0xb'));var faxAccount=require(_0x1bf8('0xc'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x1bf8('0xd'));var sugarcrm=require(_0x1bf8('0xe'));var freshdesk=require(_0x1bf8('0xf'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x1bf8('0x10'));var vtiger=require(_0x1bf8('0x11'));var freshsales=require(_0x1bf8('0x12'));var servicenow=require(_0x1bf8('0x13'));var dynamics365=require(_0x1bf8('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1bf8('0x15')](_0x1bf8('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1bf8('0x15')](_0x1bf8('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1bf8('0x17')]()['then'](user['getAgents']())[_0x1bf8('0x18')](realtime['initAgents']())[_0x1bf8('0x18')](user[_0x1bf8('0x19')]())['then'](realtime[_0x1bf8('0x1a')]())[_0x1bf8('0x18')](trunk[_0x1bf8('0x1b')]())['then'](realtime[_0x1bf8('0x1c')]())[_0x1bf8('0x18')](voiceQueue['getVoiceQueues']())[_0x1bf8('0x18')](realtime[_0x1bf8('0x1d')]())['then'](trigger[_0x1bf8('0x1e')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x1f')]())[_0x1bf8('0x18')](template[_0x1bf8('0x20')]())[_0x1bf8('0x18')](realtime['initTemplates']())[_0x1bf8('0x18')](zendesk[_0x1bf8('0x21')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x22')]())[_0x1bf8('0x18')](salesforce[_0x1bf8('0x23')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x24')]())['then'](sugarcrm[_0x1bf8('0x25')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x26')]())[_0x1bf8('0x18')](freshdesk[_0x1bf8('0x27')]())['then'](realtime[_0x1bf8('0x28')]())['then'](desk[_0x1bf8('0x29')]())['then'](realtime[_0x1bf8('0x2a')]())['then'](zoho['getZohoAccounts']())[_0x1bf8('0x18')](realtime['initZohoAccounts']())[_0x1bf8('0x18')](vtiger[_0x1bf8('0x2b')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x2c')]())['then'](freshsales[_0x1bf8('0x2d')]())['then'](realtime[_0x1bf8('0x2e')]())[_0x1bf8('0x18')](servicenow[_0x1bf8('0x2f')]())['then'](realtime[_0x1bf8('0x30')]())[_0x1bf8('0x18')](dynamics365[_0x1bf8('0x31')]())[_0x1bf8('0x18')](realtime['initDynamics365Accounts']())[_0x1bf8('0x18')](campaign[_0x1bf8('0x32')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x33')]())['then'](voiceExtension[_0x1bf8('0x34')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x35')]())[_0x1bf8('0x18')](faxAccount[_0x1bf8('0x36')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x37')]())[_0x1bf8('0x18')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0x1bf8('0x38')]())[_0x1bf8('0x18')](realtime['initVoiceQueueReports']())[_0x1bf8('0x18')](cmHopperHistory[_0x1bf8('0x39')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x3a')]())[_0x1bf8('0x18')](cmHopperHistory['getCampaignHopperHistory']())[_0x1bf8('0x18')](realtime['initCampaignHopperHistory']())[_0x1bf8('0x18')](voiceCallReport[_0x1bf8('0x3b')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x3c')]())['then'](function(_0x237fb7){})[_0x1bf8('0x3d')](function(_0x2f250b){console['log'](_0x2f250b);});}function main(){return server['listen'](realtime,preview,fax)[_0x1bf8('0x18')](function(_0x57f856){return initRealtime();})['then'](function(){return initParams();})[_0x1bf8('0x18')](function(){report[_0x1bf8('0x3e')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x2d9249){console['log'](_0x2d9249);});}main(); \ No newline at end of file +var _0x71f5=['./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','then','initAgents','getTelephones','getTrunks','initTrunks','initVoiceQueues','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','listen','catch','bluebird','util','moment','./server','./report','./acw','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger'];(function(_0xea22ad,_0x42ce50){var _0x3505e4=function(_0x107985){while(--_0x107985){_0xea22ad['push'](_0xea22ad['shift']());}};_0x3505e4(++_0x42ce50);}(_0x71f5,0x1bc));var _0x571f=function(_0x573c9e,_0xd4ab71){_0x573c9e=_0x573c9e-0x0;var _0x5d0714=_0x71f5[_0x573c9e];return _0x5d0714;};'use strict';var BPromise=require(_0x571f('0x0'));var util=require(_0x571f('0x1'));var moment=require(_0x571f('0x2'));var server=require(_0x571f('0x3'));var Realtime=require('./realtime');var Report=require(_0x571f('0x4'));var Acw=require(_0x571f('0x5'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x571f('0x6'));var Fax=require(_0x571f('0x7'));var user=require(_0x571f('0x8'));var voiceQueue=require(_0x571f('0x9'));var voiceQueueReport=require(_0x571f('0xa'));var voiceCallReport=require(_0x571f('0xb'));var trunk=require(_0x571f('0xc'));var trigger=require(_0x571f('0xd'));var template=require(_0x571f('0xe'));var cmHopperHistory=require(_0x571f('0xf'));var campaign=require(_0x571f('0x10'));var voiceExtension=require(_0x571f('0x11'));var faxAccount=require(_0x571f('0x12'));var zendesk=require(_0x571f('0x13'));var salesforce=require(_0x571f('0x14'));var sugarcrm=require(_0x571f('0x15'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x571f('0x16'));var zoho=require(_0x571f('0x17'));var vtiger=require(_0x571f('0x18'));var freshsales=require(_0x571f('0x19'));var servicenow=require(_0x571f('0x1a'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x571f('0x1b')](_0x571f('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x571f('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x571f('0x1d')]()['then'](user['getAgents']())[_0x571f('0x1e')](realtime[_0x571f('0x1f')]())[_0x571f('0x1e')](user[_0x571f('0x20')]())['then'](realtime['initTelephones']())[_0x571f('0x1e')](trunk[_0x571f('0x21')]())[_0x571f('0x1e')](realtime[_0x571f('0x22')]())[_0x571f('0x1e')](voiceQueue['getVoiceQueues']())[_0x571f('0x1e')](realtime[_0x571f('0x23')]())['then'](trigger['getTriggers']())['then'](realtime['initTriggers']())[_0x571f('0x1e')](template['getTemplates']())['then'](realtime[_0x571f('0x24')]())[_0x571f('0x1e')](zendesk[_0x571f('0x25')]())['then'](realtime[_0x571f('0x26')]())[_0x571f('0x1e')](salesforce[_0x571f('0x27')]())[_0x571f('0x1e')](realtime[_0x571f('0x28')]())[_0x571f('0x1e')](sugarcrm[_0x571f('0x29')]())[_0x571f('0x1e')](realtime['initSugarcrmAccounts']())[_0x571f('0x1e')](freshdesk[_0x571f('0x2a')]())[_0x571f('0x1e')](realtime['initFreshdeskAccounts']())[_0x571f('0x1e')](desk[_0x571f('0x2b')]())[_0x571f('0x1e')](realtime[_0x571f('0x2c')]())[_0x571f('0x1e')](zoho['getZohoAccounts']())[_0x571f('0x1e')](realtime[_0x571f('0x2d')]())[_0x571f('0x1e')](vtiger[_0x571f('0x2e')]())[_0x571f('0x1e')](realtime[_0x571f('0x2f')]())['then'](freshsales[_0x571f('0x30')]())[_0x571f('0x1e')](realtime[_0x571f('0x31')]())[_0x571f('0x1e')](servicenow[_0x571f('0x32')]())[_0x571f('0x1e')](realtime[_0x571f('0x33')]())[_0x571f('0x1e')](dynamics365[_0x571f('0x34')]())['then'](realtime[_0x571f('0x35')]())['then'](campaign[_0x571f('0x36')]())[_0x571f('0x1e')](realtime[_0x571f('0x37')]())['then'](voiceExtension[_0x571f('0x38')]())[_0x571f('0x1e')](realtime[_0x571f('0x39')]())[_0x571f('0x1e')](faxAccount[_0x571f('0x3a')]())[_0x571f('0x1e')](realtime['initFaxAccounts']())[_0x571f('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x571f('0x1d')]()[_0x571f('0x1e')](voiceQueueReport[_0x571f('0x3b')]())[_0x571f('0x1e')](realtime[_0x571f('0x3c')]())[_0x571f('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x571f('0x1e')](realtime[_0x571f('0x3d')]())[_0x571f('0x1e')](cmHopperHistory[_0x571f('0x3e')]())[_0x571f('0x1e')](realtime[_0x571f('0x3f')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x571f('0x1e')](realtime[_0x571f('0x40')]())[_0x571f('0x1e')](function(_0x3b8fd6){})['catch'](function(_0x28138f){console['log'](_0x28138f);});}function main(){return server[_0x571f('0x41')](realtime,preview,fax)[_0x571f('0x1e')](function(_0x153143){return initRealtime();})[_0x571f('0x1e')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x571f('0x42')](function(_0x211072){console['log'](_0x211072);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 8cc0225..260a47e 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 _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xedd9,0xfc));var _0x9edd=function(_0x45b9f4,_0x31ebdc){_0x45b9f4=_0x45b9f4-0x0;var _0x55d30e=_0xedd9[_0x45b9f4];return _0x55d30e;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x1de7e8,_0x355ee5){var _0x41b9ea=function(_0x4742eb){while(--_0x4742eb){_0x1de7e8['push'](_0x1de7e8['shift']());}};_0x41b9ea(++_0x355ee5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index db94b08..3b27b1f 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 _0x1fe7=['dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x1fe7,0x11f));var _0x71fe=function(_0x4bffdd,_0x2da849){_0x4bffdd=_0x4bffdd-0x0;var _0x2d17a6=_0x1fe7[_0x4bffdd];return _0x2d17a6;};'use strict';function Campaign(_0x212edd){this['id']=_0x212edd['id']||0x0;this[_0x71fe('0x0')]=_0x212edd[_0x71fe('0x0')]||'';this[_0x71fe('0x1')]=_0x212edd[_0x71fe('0x1')]||'campaign';this[_0x71fe('0x2')]=0x0;this[_0x71fe('0x3')]=0x0;this[_0x71fe('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x71fe('0x5')]=!![];this[_0x71fe('0x6')]=_0x212edd['active'];this['limitCalls']=_0x212edd[_0x71fe('0x7')];this['dialTimezone']=_0x212edd['dialTimezone']||null;this['dialGlobalInterval']=_0x212edd[_0x71fe('0x8')]?_0x212edd[_0x71fe('0x8')]:null;this[_0x71fe('0x9')]=_0x212edd[_0x71fe('0x9')];this[_0x71fe('0xa')]=_0x212edd[_0x71fe('0xa')];this[_0x71fe('0xb')]=_0x212edd[_0x71fe('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x212edd[_0x71fe('0xc')];this[_0x71fe('0xd')]=_0x212edd[_0x71fe('0xd')];this[_0x71fe('0xe')]=_0x212edd['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x212edd[_0x71fe('0xf')];this[_0x71fe('0x10')]=_0x212edd[_0x71fe('0x10')];this[_0x71fe('0x11')]=_0x212edd[_0x71fe('0x11')];this['dialGlobalMaxRetry']=_0x212edd[_0x71fe('0x12')];this[_0x71fe('0x13')]=_0x212edd[_0x71fe('0x13')]||0x3;this[_0x71fe('0x14')]=_0x212edd[_0x71fe('0x14')]||0x96;this[_0x71fe('0x15')]=_0x212edd['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x212edd[_0x71fe('0x16')]||0x96;this[_0x71fe('0x17')]=_0x212edd[_0x71fe('0x17')]||0x3;this[_0x71fe('0x18')]=_0x212edd[_0x71fe('0x18')]||0x96;this[_0x71fe('0x19')]=_0x212edd[_0x71fe('0x19')]||0x3;this[_0x71fe('0x1a')]=_0x212edd[_0x71fe('0x1a')]||0x96;this[_0x71fe('0x1b')]=_0x212edd['dialAgentRejectMaxRetry']||0x3;this[_0x71fe('0x1c')]=_0x212edd[_0x71fe('0x1c')]||0x96;this[_0x71fe('0x1d')]=_0x212edd[_0x71fe('0x1d')]||'DESC';this['dialPrefix']=_0x212edd[_0x71fe('0x1e')]||undefined;this[_0x71fe('0x1f')]=_0x212edd[_0x71fe('0x1f')]||undefined;this[_0x71fe('0x20')]=_0x212edd[_0x71fe('0x20')]||undefined;this[_0x71fe('0x21')]=_0x212edd[_0x71fe('0x21')]?_0x212edd[_0x71fe('0x21')]:undefined;this[_0x71fe('0x22')]=_0x212edd[_0x71fe('0x22')]?_0x212edd[_0x71fe('0x22')]:undefined;this[_0x71fe('0x23')]=_0x212edd[_0x71fe('0x23')]?_0x212edd['Interval']:undefined;this['SquareProject']=_0x212edd[_0x71fe('0x24')]?_0x212edd[_0x71fe('0x24')]:undefined;this[_0x71fe('0x25')]=_0x212edd[_0x71fe('0x24')]?_0x212edd[_0x71fe('0x24')][_0x71fe('0x0')]:undefined;this[_0x71fe('0x26')]=_0x212edd['dialAMDActive']||![];this[_0x71fe('0x27')]=_0x212edd['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x212edd[_0x71fe('0x28')];this[_0x71fe('0x29')]=_0x212edd['dialAMDAfterGreetingSilence'];this[_0x71fe('0x2a')]=_0x212edd[_0x71fe('0x2a')];this['dialAMDMinWordLength']=_0x212edd['dialAMDMinWordLength'];this[_0x71fe('0x2b')]=_0x212edd[_0x71fe('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x212edd[_0x71fe('0x2c')];this[_0x71fe('0x2d')]=_0x212edd[_0x71fe('0x2d')];this[_0x71fe('0x2e')]=_0x212edd['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0xbcaf=['dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','SquareProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency'];(function(_0x518e15,_0x568735){var _0x3bd658=function(_0x6a579f){while(--_0x6a579f){_0x518e15['push'](_0x518e15['shift']());}};_0x3bd658(++_0x568735);}(_0xbcaf,0xcf));var _0xfbca=function(_0x55ddee,_0x1c80ad){_0x55ddee=_0x55ddee-0x0;var _0x3fc0c9=_0xbcaf[_0x55ddee];return _0x3fc0c9;};'use strict';function Campaign(_0x1b298d){this['id']=_0x1b298d['id']||0x0;this['name']=_0x1b298d['name']||'';this[_0xfbca('0x0')]=_0x1b298d[_0xfbca('0x0')]||'campaign';this[_0xfbca('0x1')]=0x0;this[_0xfbca('0x2')]=0x0;this[_0xfbca('0x3')]=0x0;this[_0xfbca('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x1b298d[_0xfbca('0x5')];this['limitCalls']=_0x1b298d[_0xfbca('0x6')];this[_0xfbca('0x7')]=_0x1b298d[_0xfbca('0x7')]||null;this[_0xfbca('0x8')]=_0x1b298d[_0xfbca('0x8')]?_0x1b298d[_0xfbca('0x8')]:null;this['dialOriginateCallerIdName']=_0x1b298d[_0xfbca('0x9')];this[_0xfbca('0xa')]=_0x1b298d['dialOriginateCallerIdNumber'];this[_0xfbca('0xb')]=_0x1b298d[_0xfbca('0xb')]||0x1e;this[_0xfbca('0xc')]=_0x1b298d['dialCongestionMaxRetry'];this[_0xfbca('0xd')]=_0x1b298d[_0xfbca('0xd')];this[_0xfbca('0xe')]=_0x1b298d[_0xfbca('0xe')];this['dialBusyRetryFrequency']=_0x1b298d[_0xfbca('0xf')];this[_0xfbca('0x10')]=_0x1b298d[_0xfbca('0x10')];this[_0xfbca('0x11')]=_0x1b298d[_0xfbca('0x11')];this[_0xfbca('0x12')]=_0x1b298d['dialGlobalMaxRetry'];this[_0xfbca('0x13')]=_0x1b298d['dialNoSuchNumberMaxRetry']||0x3;this[_0xfbca('0x14')]=_0x1b298d['dialNoSuchNumberRetryFrequency']||0x96;this[_0xfbca('0x15')]=_0x1b298d['dialDropMaxRetry']||0x3;this[_0xfbca('0x16')]=_0x1b298d['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x1b298d['dialAbandonedMaxRetry']||0x3;this[_0xfbca('0x17')]=_0x1b298d['dialAbandonedRetryFrequency']||0x96;this[_0xfbca('0x18')]=_0x1b298d['dialMachineMaxRetry']||0x3;this[_0xfbca('0x19')]=_0x1b298d[_0xfbca('0x19')]||0x96;this[_0xfbca('0x1a')]=_0x1b298d[_0xfbca('0x1a')]||0x3;this[_0xfbca('0x1b')]=_0x1b298d[_0xfbca('0x1b')]||0x96;this[_0xfbca('0x1c')]=_0x1b298d[_0xfbca('0x1c')]||'DESC';this[_0xfbca('0x1d')]=_0x1b298d[_0xfbca('0x1d')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x1b298d[_0xfbca('0x1e')]||undefined;this[_0xfbca('0x1f')]=_0x1b298d[_0xfbca('0x1f')]||undefined;this['TrunkBackup']=_0x1b298d['TrunkBackup']?_0x1b298d[_0xfbca('0x20')]:undefined;this['Trunk']=_0x1b298d[_0xfbca('0x21')]?_0x1b298d[_0xfbca('0x21')]:undefined;this['Interval']=_0x1b298d['Interval']?_0x1b298d['Interval']:undefined;this[_0xfbca('0x22')]=_0x1b298d['SquareProject']?_0x1b298d['SquareProject']:undefined;this['dialQueueProject']=_0x1b298d['SquareProject']?_0x1b298d[_0xfbca('0x22')][_0xfbca('0x23')]:undefined;this[_0xfbca('0x24')]=_0x1b298d[_0xfbca('0x24')]||![];this['dialAMDInitialSilence']=_0x1b298d[_0xfbca('0x25')];this[_0xfbca('0x26')]=_0x1b298d[_0xfbca('0x26')];this['dialAMDAfterGreetingSilence']=_0x1b298d[_0xfbca('0x27')];this[_0xfbca('0x28')]=_0x1b298d['dialAMDTotalAnalysisTime'];this[_0xfbca('0x29')]=_0x1b298d[_0xfbca('0x29')];this[_0xfbca('0x2a')]=_0x1b298d['dialAMDBetweenWordsSilence'];this[_0xfbca('0x2b')]=_0x1b298d[_0xfbca('0x2b')];this[_0xfbca('0x2c')]=_0x1b298d[_0xfbca('0x2c')];this[_0xfbca('0x2d')]=_0x1b298d[_0xfbca('0x2d')];}module[_0xfbca('0x2e')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 67d4616..160df5a 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 _0xbaf7=['channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','holdtime','tag','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime'];(function(_0x36ad21,_0x3644e6){var _0x478b85=function(_0x53a705){while(--_0x53a705){_0x36ad21['push'](_0x36ad21['shift']());}};_0x478b85(++_0x3644e6);}(_0xbaf7,0x137));var _0x7baf=function(_0x3e6484,_0x2d172c){_0x3e6484=_0x3e6484-0x0;var _0x513624=_0xbaf7[_0x3e6484];return _0x513624;};'use strict';function Channel(){this[_0x7baf('0x0')]=null;this[_0x7baf('0x1')]='';this[_0x7baf('0x2')]='';this[_0x7baf('0x3')]=0x0;this[_0x7baf('0x4')]='';this['connectedlinenum']=undefined;this[_0x7baf('0x5')]=undefined;this[_0x7baf('0x6')]=0x0;this[_0x7baf('0x7')]='';this[_0x7baf('0x8')]=0x0;this[_0x7baf('0x9')]=0x0;this[_0x7baf('0xa')]=0x0;this[_0x7baf('0xb')]=![];this['answertime']=null;this[_0x7baf('0xc')]=null;this[_0x7baf('0xd')]=![];this[_0x7baf('0xe')]=![];this[_0x7baf('0xf')]='';this[_0x7baf('0x10')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x7baf('0x11')]=0x0;this['type']=null;this[_0x7baf('0x12')]=null;this['disposition']=null;this['monitor']=![];this[_0x7baf('0x13')]=null;this[_0x7baf('0x14')]=null;this[_0x7baf('0x15')]=[];this['transfercalleridnum']=undefined;this[_0x7baf('0x16')]=undefined;this[_0x7baf('0x17')]=undefined;this[_0x7baf('0x18')]=0x0;}module[_0x7baf('0x19')]=Channel; \ No newline at end of file +var _0x5288=['unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','disposition','monitorFilename','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','linkedid','exten','answered','endtime'];(function(_0x4658d9,_0x4b695e){var _0x3a5386=function(_0x5976f7){while(--_0x5976f7){_0x4658d9['push'](_0x4658d9['shift']());}};_0x3a5386(++_0x4b695e);}(_0x5288,0x1ed));var _0x8528=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x5288[_0x4a3898];return _0x25ceb0;};'use strict';function Channel(){this[_0x8528('0x0')]=null;this['channel']='';this[_0x8528('0x1')]='';this[_0x8528('0x2')]=0x0;this[_0x8528('0x3')]='';this[_0x8528('0x4')]=undefined;this[_0x8528('0x5')]=undefined;this[_0x8528('0x6')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x8528('0x7')]=0x0;this[_0x8528('0x8')]=0x0;this[_0x8528('0x9')]=![];this['answertime']=null;this[_0x8528('0xa')]=null;this[_0x8528('0xb')]=![];this[_0x8528('0xc')]=![];this[_0x8528('0xd')]='';this[_0x8528('0xe')]='';this[_0x8528('0xf')]=0x0;this[_0x8528('0x10')]=0x0;this[_0x8528('0x11')]=0x0;this['type']=null;this['tag']=null;this[_0x8528('0x12')]=null;this['monitor']=![];this[_0x8528('0x13')]=null;this['queue']=null;this['monitors']=[];this[_0x8528('0x14')]=undefined;this[_0x8528('0x15')]=undefined;this[_0x8528('0x16')]=undefined;this['mohtime']=0x0;}module[_0x8528('0x17')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 6f2d06f..9779c3e 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 _0x0b85=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x72c71e,_0x3ef857){var _0x92512e=function(_0xdc0310){while(--_0xdc0310){_0x72c71e['push'](_0x72c71e['shift']());}};_0x92512e(++_0x3ef857);}(_0x0b85,0x169));var _0x50b8=function(_0x153671,_0x41a0d4){_0x153671=_0x153671-0x0;var _0x4e98ca=_0x0b85[_0x153671];return _0x4e98ca;};'use strict';function DeskAccount(_0x26ace7){this['id']=_0x26ace7['id']||0x0;this[_0x50b8('0x0')]=_0x26ace7['name']||'';this[_0x50b8('0x1')]=_0x26ace7['username']||'';this[_0x50b8('0x2')]=_0x26ace7[_0x50b8('0x2')]||'';this['authType']=_0x26ace7[_0x50b8('0x3')]||'';this[_0x50b8('0x4')]=_0x26ace7['password']||'';this['consumerKey']=_0x26ace7[_0x50b8('0x5')]||'';this[_0x50b8('0x6')]=_0x26ace7[_0x50b8('0x6')]||'';this[_0x50b8('0x7')]=_0x26ace7[_0x50b8('0x7')]||'';this[_0x50b8('0x8')]=_0x26ace7['tokenSecret']||'';this['type']=_0x26ace7[_0x50b8('0x9')]||'';this['serverUrl']=_0x26ace7[_0x50b8('0xa')]||'';this[_0x50b8('0xb')]=_0x26ace7[_0x50b8('0xb')]||{};}module[_0x50b8('0xc')]=DeskAccount; \ No newline at end of file +var _0xc1ab=['tokenSecret','type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xc1ab,0x131));var _0xbc1a=function(_0x46833b,_0x3c0859){_0x46833b=_0x46833b-0x0;var _0x2ba218=_0xc1ab[_0x46833b];return _0x2ba218;};'use strict';function DeskAccount(_0x43af56){this['id']=_0x43af56['id']||0x0;this['name']=_0x43af56['name']||'';this[_0xbc1a('0x0')]=_0x43af56[_0xbc1a('0x0')]||'';this['remoteUri']=_0x43af56[_0xbc1a('0x1')]||'';this[_0xbc1a('0x2')]=_0x43af56[_0xbc1a('0x2')]||'';this[_0xbc1a('0x3')]=_0x43af56[_0xbc1a('0x3')]||'';this[_0xbc1a('0x4')]=_0x43af56[_0xbc1a('0x4')]||'';this[_0xbc1a('0x5')]=_0x43af56[_0xbc1a('0x5')]||'';this[_0xbc1a('0x6')]=_0x43af56[_0xbc1a('0x6')]||'';this[_0xbc1a('0x7')]=_0x43af56[_0xbc1a('0x7')]||'';this['type']=_0x43af56[_0xbc1a('0x8')]||'';this[_0xbc1a('0x9')]=_0x43af56[_0xbc1a('0x9')]||'';this[_0xbc1a('0xa')]=_0x43af56[_0xbc1a('0xa')]||{};}module[_0xbc1a('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 72a9842..c15ca53 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 _0x0bb5=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x32e663,_0x1ca66c){var _0x54fa0e=function(_0x4cf486){while(--_0x4cf486){_0x32e663['push'](_0x32e663['shift']());}};_0x54fa0e(++_0x1ca66c);}(_0x0bb5,0x148));var _0x50bb=function(_0x1b93a9,_0x3cdf00){_0x1b93a9=_0x1b93a9-0x0;var _0x38bee2=_0x0bb5[_0x1b93a9];return _0x38bee2;};'use strict';function Dynamics365Account(_0x4878e5){this['id']=_0x4878e5['id']||0x0;this[_0x50bb('0x0')]=_0x4878e5['name']||'';this['username']=_0x4878e5[_0x50bb('0x1')]||'';this[_0x50bb('0x2')]=_0x4878e5[_0x50bb('0x2')]||'';this[_0x50bb('0x3')]=_0x4878e5[_0x50bb('0x3')]||'';this[_0x50bb('0x4')]=_0x4878e5[_0x50bb('0x4')]||'';this[_0x50bb('0x5')]=_0x4878e5['clientId']||'';this['clientSecret']=_0x4878e5[_0x50bb('0x6')]||{};this[_0x50bb('0x7')]=_0x4878e5[_0x50bb('0x7')]||'';this[_0x50bb('0x8')]=_0x4878e5['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x2750=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x95ea83,_0x4a103d){var _0x1ea2f0=function(_0x2bca37){while(--_0x2bca37){_0x95ea83['push'](_0x95ea83['shift']());}};_0x1ea2f0(++_0x4a103d);}(_0x2750,0x13b));var _0x0275=function(_0x4b61ff,_0x111cfd){_0x4b61ff=_0x4b61ff-0x0;var _0x55c0b0=_0x2750[_0x4b61ff];return _0x55c0b0;};'use strict';function Dynamics365Account(_0x1c9f4d){this['id']=_0x1c9f4d['id']||0x0;this['name']=_0x1c9f4d[_0x0275('0x0')]||'';this[_0x0275('0x1')]=_0x1c9f4d[_0x0275('0x1')]||'';this[_0x0275('0x2')]=_0x1c9f4d[_0x0275('0x2')]||'';this[_0x0275('0x3')]=_0x1c9f4d[_0x0275('0x3')]||'';this[_0x0275('0x4')]=_0x1c9f4d[_0x0275('0x4')]||'';this[_0x0275('0x5')]=_0x1c9f4d['clientId']||'';this[_0x0275('0x6')]=_0x1c9f4d[_0x0275('0x6')]||{};this[_0x0275('0x7')]=_0x1c9f4d[_0x0275('0x7')]||'';this['Configurations']=_0x1c9f4d[_0x0275('0x8')]||{};}module[_0x0275('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 3684fd2..037e751 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 _0x1415=['ecm','localstationid','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x2c1b91,_0xe2cd22){var _0x46aa23=function(_0x145e70){while(--_0x145e70){_0x2c1b91['push'](_0x2c1b91['shift']());}};_0x46aa23(++_0xe2cd22);}(_0x1415,0x11e));var _0x5141=function(_0x480148,_0x1c3026){_0x480148=_0x480148-0x0;var _0x3b875f=_0x1415[_0x480148];return _0x3b875f;};'use strict';function FaxAccount(_0x217f93){this['id']=_0x217f93['id']||0x0;this[_0x5141('0x0')]=_0x217f93[_0x5141('0x0')]||'';this[_0x5141('0x1')]=_0x217f93[_0x5141('0x1')];this[_0x5141('0x2')]=_0x217f93[_0x5141('0x2')];this['headerinfo']=_0x217f93['headerinfo'];this[_0x5141('0x3')]=_0x217f93[_0x5141('0x3')];this['minrate']=_0x217f93['minrate']||0x960;this[_0x5141('0x4')]=_0x217f93[_0x5141('0x4')]||0x3840;this[_0x5141('0x5')]=_0x217f93[_0x5141('0x5')]||_0x5141('0x6');this[_0x5141('0x7')]=_0x217f93['gateway']||'no';this['faxdetect']=_0x217f93[_0x5141('0x8')]||'no';this[_0x5141('0x9')]=_0x217f93['t38timeout']||0x1388;this[_0x5141('0xa')]=_0x217f93[_0x5141('0xa')]||_0x5141('0xb');this['Trunk']=_0x217f93[_0x5141('0xc')]?_0x217f93[_0x5141('0xc')]:undefined;this[_0x5141('0xd')]=_0x217f93[_0x5141('0xd')];this[_0x5141('0xe')]=_0x217f93[_0x5141('0xe')];}module[_0x5141('0xf')]=FaxAccount; \ No newline at end of file +var _0xd4e3=['minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','ecm','headerinfo'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xd4e3,0x1a1));var _0x3d4e=function(_0x324915,_0x5ec142){_0x324915=_0x324915-0x0;var _0x569bad=_0xd4e3[_0x324915];return _0x569bad;};'use strict';function FaxAccount(_0xe3d1d0){this['id']=_0xe3d1d0['id']||0x0;this[_0x3d4e('0x0')]=_0xe3d1d0[_0x3d4e('0x0')]||'';this['description']=_0xe3d1d0['description'];this[_0x3d4e('0x1')]=_0xe3d1d0[_0x3d4e('0x1')];this[_0x3d4e('0x2')]=_0xe3d1d0[_0x3d4e('0x2')];this['localstationid']=_0xe3d1d0['localstationid'];this[_0x3d4e('0x3')]=_0xe3d1d0[_0x3d4e('0x3')]||0x960;this['maxrate']=_0xe3d1d0['maxrate']||0x3840;this[_0x3d4e('0x4')]=_0xe3d1d0[_0x3d4e('0x4')]||_0x3d4e('0x5');this['gateway']=_0xe3d1d0[_0x3d4e('0x6')]||'no';this[_0x3d4e('0x7')]=_0xe3d1d0[_0x3d4e('0x7')]||'no';this[_0x3d4e('0x8')]=_0xe3d1d0[_0x3d4e('0x8')]||0x1388;this[_0x3d4e('0x9')]=_0xe3d1d0[_0x3d4e('0x9')]||'SIP';this[_0x3d4e('0xa')]=_0xe3d1d0[_0x3d4e('0xa')]?_0xe3d1d0[_0x3d4e('0xa')]:undefined;this[_0x3d4e('0xb')]=_0xe3d1d0[_0x3d4e('0xb')];this[_0x3d4e('0xc')]=_0xe3d1d0[_0x3d4e('0xc')];}module[_0x3d4e('0xd')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 641c4e4..00eac6d 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 _0x947e=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x34b7b2,_0xd63986){var _0x10ee09=function(_0x5b677a){while(--_0x5b677a){_0x34b7b2['push'](_0x34b7b2['shift']());}};_0x10ee09(++_0xd63986);}(_0x947e,0xb1));var _0xe947=function(_0x2f0385,_0x30c3a3){_0x2f0385=_0x2f0385-0x0;var _0x181ea4=_0x947e[_0x2f0385];return _0x181ea4;};'use strict';function FreshdeskAccount(_0x206b5c){this['id']=_0x206b5c['id']||0x0;this[_0xe947('0x0')]=_0x206b5c[_0xe947('0x0')]||'';this['username']=_0x206b5c[_0xe947('0x1')]||'';this[_0xe947('0x2')]=_0x206b5c[_0xe947('0x3')]||'';this[_0xe947('0x4')]=_0x206b5c[_0xe947('0x4')]||'';this['serverUrl']=_0x206b5c[_0xe947('0x5')]||'';this[_0xe947('0x6')]=_0x206b5c[_0xe947('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xdaeb=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x1a966d,_0x440322){var _0x475c4=function(_0x4d034c){while(--_0x4d034c){_0x1a966d['push'](_0x1a966d['shift']());}};_0x475c4(++_0x440322);}(_0xdaeb,0x6d));var _0xbdae=function(_0x11cd9c,_0x40db3f){_0x11cd9c=_0x11cd9c-0x0;var _0x47bd1e=_0xdaeb[_0x11cd9c];return _0x47bd1e;};'use strict';function FreshdeskAccount(_0x4785b2){this['id']=_0x4785b2['id']||0x0;this['name']=_0x4785b2[_0xbdae('0x0')]||'';this['username']=_0x4785b2[_0xbdae('0x1')]||'';this[_0xbdae('0x2')]=_0x4785b2[_0xbdae('0x3')]||'';this[_0xbdae('0x4')]=_0x4785b2['remoteUri']||'';this[_0xbdae('0x5')]=_0x4785b2[_0xbdae('0x5')]||'';this[_0xbdae('0x6')]=_0x4785b2[_0xbdae('0x6')]||{};}module[_0xbdae('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index ca7dbfe..c461191 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 _0x600f=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5277af,_0x16a6d2){var _0x205762=function(_0x2e4e19){while(--_0x2e4e19){_0x5277af['push'](_0x5277af['shift']());}};_0x205762(++_0x16a6d2);}(_0x600f,0xb4));var _0xf600=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0x600f[_0xf44d98];return _0x5ebb04;};'use strict';function FreshsalesAccount(_0x3cfdf7){this['id']=_0x3cfdf7['id']||0x0;this[_0xf600('0x0')]=_0x3cfdf7[_0xf600('0x0')]||'';this['username']=_0x3cfdf7[_0xf600('0x1')]||'';this['apiKey']=_0x3cfdf7[_0xf600('0x2')]||'';this[_0xf600('0x3')]=_0x3cfdf7[_0xf600('0x3')]||'';this[_0xf600('0x4')]=_0x3cfdf7[_0xf600('0x4')]||'';this[_0xf600('0x5')]=_0x3cfdf7[_0xf600('0x5')]||{};}module[_0xf600('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x038b=['name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x1124e6,_0x5db98a){var _0x2c7735=function(_0x1ffefd){while(--_0x1ffefd){_0x1124e6['push'](_0x1124e6['shift']());}};_0x2c7735(++_0x5db98a);}(_0x038b,0x114));var _0xb038=function(_0x424369,_0x2abbef){_0x424369=_0x424369-0x0;var _0x2d511d=_0x038b[_0x424369];return _0x2d511d;};'use strict';function FreshsalesAccount(_0x493b50){this['id']=_0x493b50['id']||0x0;this[_0xb038('0x0')]=_0x493b50[_0xb038('0x0')]||'';this[_0xb038('0x1')]=_0x493b50['username']||'';this[_0xb038('0x2')]=_0x493b50['token']||'';this[_0xb038('0x3')]=_0x493b50[_0xb038('0x3')]||'';this['serverUrl']=_0x493b50[_0xb038('0x4')]||'';this[_0xb038('0x5')]=_0x493b50['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 204c4d5..e195e82 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 _0xb46e=['queuecallerexitAt','channel','accountcode','context','priority','holdtime','assigned','lastAssignedTo','variables','exports','type','inbound','calleridnum','queue','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit'];(function(_0x941156,_0x49036d){var _0x29a815=function(_0x541af4){while(--_0x541af4){_0x941156['push'](_0x941156['shift']());}};_0x29a815(++_0x49036d);}(_0xb46e,0xdc));var _0xeb46=function(_0x34b0d3,_0x55b139){_0x34b0d3=_0x34b0d3-0x0;var _0x37c298=_0xb46e[_0x34b0d3];return _0x37c298;};'use strict';function QueueReport(){this[_0xeb46('0x0')]=_0xeb46('0x1');this['uniqueid']='';this[_0xeb46('0x2')]='';this['calleridname']='';this[_0xeb46('0x3')]='';this['queuecallerjoinAt']=null;this[_0xeb46('0x4')]=null;this[_0xeb46('0x5')]=0x1;this[_0xeb46('0x6')]=0x1;this['queuecallerabandon']=![];this[_0xeb46('0x7')]=null;this[_0xeb46('0x8')]=![];this[_0xeb46('0x9')]=null;this[_0xeb46('0xa')]=![];this[_0xeb46('0xb')]=null;this['originalposition']=0x1;this[_0xeb46('0xc')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0xeb46('0xd')]='';this[_0xeb46('0xe')]='';this['exten']='';this[_0xeb46('0xf')]='';this[_0xeb46('0x10')]=0x0;this[_0xeb46('0x11')]=![];this[_0xeb46('0x12')]='';this['mohtime']=0x0;this[_0xeb46('0x13')]={};}module[_0xeb46('0x14')]=QueueReport; \ No newline at end of file +var _0x5279=['accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','exports','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum'];(function(_0xcc0417,_0x4ec944){var _0x41efa3=function(_0x558c08){while(--_0x558c08){_0xcc0417['push'](_0xcc0417['shift']());}};_0x41efa3(++_0x4ec944);}(_0x5279,0x176));var _0x9527=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x5279[_0xc6be3a];return _0x56a310;};'use strict';function QueueReport(){this['type']=_0x9527('0x0');this[_0x9527('0x1')]='';this[_0x9527('0x2')]='';this[_0x9527('0x3')]='';this['queue']='';this[_0x9527('0x4')]=null;this[_0x9527('0x5')]=null;this[_0x9527('0x6')]=0x1;this[_0x9527('0x7')]=0x1;this[_0x9527('0x8')]=![];this[_0x9527('0x9')]=null;this[_0x9527('0xa')]=![];this[_0x9527('0xb')]=null;this[_0x9527('0xc')]=![];this['queuecallerexitAt']=null;this[_0x9527('0xd')]=0x1;this[_0x9527('0xe')]='';this[_0x9527('0xf')]='';this['connectedlinename']='';this[_0x9527('0x10')]='';this['context']='';this[_0x9527('0x11')]='';this[_0x9527('0x12')]='';this[_0x9527('0x13')]=0x0;this[_0x9527('0x14')]=![];this[_0x9527('0x15')]='';this[_0x9527('0x16')]=_0x9527('0x17');this[_0x9527('0x18')]=0x0;this['variables']={};}module[_0x9527('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 9d9f5e2..0b452ee 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 _0x9c06=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x4b1bb0,_0x7dc32b){var _0x549407=function(_0xa08deb){while(--_0xa08deb){_0x4b1bb0['push'](_0x4b1bb0['shift']());}};_0x549407(++_0x7dc32b);}(_0x9c06,0x68));var _0x69c0=function(_0x31413c,_0x32c65b){_0x31413c=_0x31413c-0x0;var _0x2bd974=_0x9c06[_0x31413c];return _0x2bd974;};'use strict';function SalesforceAccount(_0x11375a){this['id']=_0x11375a['id']||0x0;this[_0x69c0('0x0')]=_0x11375a['name']||'';this[_0x69c0('0x1')]=_0x11375a['username']||'';this[_0x69c0('0x2')]=_0x11375a[_0x69c0('0x2')]||'';this['password']=_0x11375a[_0x69c0('0x3')]||'';this[_0x69c0('0x4')]=_0x11375a['clientId']||'';this['clientSecret']=_0x11375a[_0x69c0('0x5')]||'';this[_0x69c0('0x6')]=_0x11375a[_0x69c0('0x6')]||'';this[_0x69c0('0x7')]=_0x11375a[_0x69c0('0x7')]||_0x69c0('0x8');this['serverUrl']=_0x11375a[_0x69c0('0x9')]||'';this[_0x69c0('0xa')]=_0x11375a[_0x69c0('0xa')]||{};}module[_0x69c0('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xc06a=['clientId','clientSecret','type','integrationTab','Configurations','exports','name','username','remoteUri','password'];(function(_0x2061ac,_0x3ec169){var _0x2b565c=function(_0x3c3fb2){while(--_0x3c3fb2){_0x2061ac['push'](_0x2061ac['shift']());}};_0x2b565c(++_0x3ec169);}(_0xc06a,0x1be));var _0xac06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc06a[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x48a029){this['id']=_0x48a029['id']||0x0;this[_0xac06('0x0')]=_0x48a029['name']||'';this[_0xac06('0x1')]=_0x48a029['username']||'';this[_0xac06('0x2')]=_0x48a029[_0xac06('0x2')]||'';this[_0xac06('0x3')]=_0x48a029['password']||'';this['clientId']=_0x48a029[_0xac06('0x4')]||'';this[_0xac06('0x5')]=_0x48a029[_0xac06('0x5')]||'';this['securityToken']=_0x48a029['securityToken']||'';this[_0xac06('0x6')]=_0x48a029['type']||_0xac06('0x7');this['serverUrl']=_0x48a029['serverUrl']||'';this[_0xac06('0x8')]=_0x48a029[_0xac06('0x8')]||{};}module[_0xac06('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index e3ca879..eacd46a 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 _0xed8a=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3043c7,_0x284e50){var _0x7c4fd7=function(_0x4a5782){while(--_0x4a5782){_0x3043c7['push'](_0x3043c7['shift']());}};_0x7c4fd7(++_0x284e50);}(_0xed8a,0xfb));var _0xaed8=function(_0x495588,_0x2ee5af){_0x495588=_0x495588-0x0;var _0x27cd6e=_0xed8a[_0x495588];return _0x27cd6e;};'use strict';function ServicenowAccount(_0x335608){this['id']=_0x335608['id']||0x0;this[_0xaed8('0x0')]=_0x335608['name']||'';this[_0xaed8('0x1')]=_0x335608[_0xaed8('0x1')]||'';this[_0xaed8('0x2')]=_0x335608[_0xaed8('0x2')]||'';this[_0xaed8('0x3')]=_0x335608[_0xaed8('0x3')]||'';this[_0xaed8('0x4')]=_0x335608[_0xaed8('0x4')]||'';this[_0xaed8('0x5')]=_0x335608[_0xaed8('0x5')]||{};}module[_0xaed8('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xe230=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x143ca0,_0x586bd3){var _0x11f1c5=function(_0xe32f94){while(--_0xe32f94){_0x143ca0['push'](_0x143ca0['shift']());}};_0x11f1c5(++_0x586bd3);}(_0xe230,0x1d5));var _0x0e23=function(_0x56ae67,_0xe051db){_0x56ae67=_0x56ae67-0x0;var _0x2b480d=_0xe230[_0x56ae67];return _0x2b480d;};'use strict';function ServicenowAccount(_0x372d05){this['id']=_0x372d05['id']||0x0;this['name']=_0x372d05[_0x0e23('0x0')]||'';this[_0x0e23('0x1')]=_0x372d05[_0x0e23('0x1')]||'';this['password']=_0x372d05[_0x0e23('0x2')]||'';this[_0x0e23('0x3')]=_0x372d05[_0x0e23('0x3')]||'';this['serverUrl']=_0x372d05[_0x0e23('0x4')]||'';this[_0x0e23('0x5')]=_0x372d05['Configurations']||{};}module[_0x0e23('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 88aea54..b2aa8a4 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 _0xf902=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xf902,0x162));var _0x2f90=function(_0x46b822,_0x5eb37f){_0x46b822=_0x46b822-0x0;var _0x3350e2=_0xf902[_0x46b822];return _0x3350e2;};'use strict';function SugarcrmAccount(_0x5b12cf){this['id']=_0x5b12cf['id']||0x0;this[_0x2f90('0x0')]=_0x5b12cf['name']||'';this[_0x2f90('0x1')]=_0x5b12cf[_0x2f90('0x1')]||'';this[_0x2f90('0x2')]=_0x5b12cf[_0x2f90('0x2')]||'';this[_0x2f90('0x3')]=_0x5b12cf[_0x2f90('0x3')]||'';this[_0x2f90('0x4')]=_0x5b12cf[_0x2f90('0x4')]||'';this[_0x2f90('0x5')]=_0x5b12cf[_0x2f90('0x5')]||{};}module[_0x2f90('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x04eb=['serverUrl','Configurations','name','username','remoteUri'];(function(_0x505684,_0x2c1dc9){var _0x4389b0=function(_0x86b26e){while(--_0x86b26e){_0x505684['push'](_0x505684['shift']());}};_0x4389b0(++_0x2c1dc9);}(_0x04eb,0x129));var _0xb04e=function(_0x4863d2,_0x84d14f){_0x4863d2=_0x4863d2-0x0;var _0x21e91f=_0x04eb[_0x4863d2];return _0x21e91f;};'use strict';function SugarcrmAccount(_0x1f3a6a){this['id']=_0x1f3a6a['id']||0x0;this[_0xb04e('0x0')]=_0x1f3a6a[_0xb04e('0x0')]||'';this[_0xb04e('0x1')]=_0x1f3a6a[_0xb04e('0x1')]||'';this['password']=_0x1f3a6a['password']||'';this[_0xb04e('0x2')]=_0x1f3a6a[_0xb04e('0x2')]||'';this[_0xb04e('0x3')]=_0x1f3a6a[_0xb04e('0x3')]||'';this[_0xb04e('0x4')]=_0x1f3a6a[_0xb04e('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 6ab5360..2de2200 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 _0xcf2d=['state','unknown','address','exports','name','accountcode'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0xcf2d,0x1ea));var _0xdcf2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf2d[_0x3dd15e];return _0x231fd0;};'use strict';function Telephone(_0x2a7018){this['id']=_0x2a7018['id']||0x0;this[_0xdcf2('0x0')]=_0x2a7018[_0xdcf2('0x0')]||'';this[_0xdcf2('0x1')]=_0x2a7018[_0xdcf2('0x1')]||'';this[_0xdcf2('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0xdcf2('0x3');this[_0xdcf2('0x4')]='';}module[_0xdcf2('0x5')]=Telephone; \ No newline at end of file +var _0x6554=['exports','name','accountcode','state','unknown','stateTime','status','address'];(function(_0x2b4e5d,_0x49bf74){var _0x1aabe2=function(_0x54c90c){while(--_0x54c90c){_0x2b4e5d['push'](_0x2b4e5d['shift']());}};_0x1aabe2(++_0x49bf74);}(_0x6554,0x181));var _0x4655=function(_0x3d6df7,_0x1a766b){_0x3d6df7=_0x3d6df7-0x0;var _0x54049f=_0x6554[_0x3d6df7];return _0x54049f;};'use strict';function Telephone(_0x305798){this['id']=_0x305798['id']||0x0;this[_0x4655('0x0')]=_0x305798[_0x4655('0x0')]||'';this[_0x4655('0x1')]=_0x305798[_0x4655('0x1')]||'';this[_0x4655('0x2')]=_0x4655('0x3');this[_0x4655('0x4')]=0x0;this[_0x4655('0x5')]=_0x4655('0x3');this[_0x4655('0x6')]='';}module[_0x4655('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 150acce..8a50f6b 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 _0xa9e0=['exports','name'];(function(_0x3f623c,_0x2b3139){var _0x31fc82=function(_0x49389b){while(--_0x49389b){_0x3f623c['push'](_0x3f623c['shift']());}};_0x31fc82(++_0x2b3139);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x4beac0,_0x38e112){var _0x5c4260=function(_0xdcdb67){while(--_0xdcdb67){_0x4beac0['push'](_0x4beac0['shift']());}};_0x5c4260(++_0x38e112);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index dd31c62..aa5f4a0 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 _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x5a595c,_0x341579){var _0x4f9722=function(_0x35b9e8){while(--_0x35b9e8){_0x5a595c['push'](_0x5a595c['shift']());}};_0x4f9722(++_0x341579);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1bc111,_0x2d0daa){_0x1bc111=_0x1bc111-0x0;var _0xe6eea5=_0x9ffd[_0x1bc111];return _0xe6eea5;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file +var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0x5eb8,0xb0));var _0x85eb=function(_0x25f797,_0x449916){_0x25f797=_0x25f797-0x0;var _0x157fdd=_0x5eb8[_0x25f797];return _0x157fdd;};'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 diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index ef38e20..ca575f0 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 _0xf6e9=['unknown','stateTime','registry','indexOf','split','host','refresh','registrationtime','address','defaultuser','active','name','state'];(function(_0x10cb7a,_0x771352){var _0x1dd469=function(_0x39ea1d){while(--_0x39ea1d){_0x10cb7a['push'](_0x10cb7a['shift']());}};_0x1dd469(++_0x771352);}(_0xf6e9,0x1d1));var _0x9f6e=function(_0x500032,_0xb364ed){_0x500032=_0x500032-0x0;var _0x387187=_0xf6e9[_0x500032];return _0x387187;};'use strict';function Trunk(_0x3c9c0a){this['id']=_0x3c9c0a['id']||0x0;this[_0x9f6e('0x0')]=_0x3c9c0a['active']||![];this[_0x9f6e('0x1')]=_0x3c9c0a[_0x9f6e('0x1')]||'';this[_0x9f6e('0x2')]=_0x9f6e('0x3');this[_0x9f6e('0x4')]=0x0;this['status']=_0x9f6e('0x3');this[_0x9f6e('0x5')]=_0x3c9c0a[_0x9f6e('0x5')]&&_0x3c9c0a[_0x9f6e('0x5')][_0x9f6e('0x6')](':')?_0x3c9c0a[_0x9f6e('0x5')][_0x9f6e('0x7')](':')[0x0]:'';this[_0x9f6e('0x8')]='';this['port']='';this['domain']='';this['domainport']='';this[_0x9f6e('0x9')]='';this['stateRegistry']=_0x9f6e('0x3');this[_0x9f6e('0xa')]='';this[_0x9f6e('0xb')]='';this[_0x9f6e('0xc')]=_0x3c9c0a[_0x9f6e('0xc')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x66b0=['status','registry','indexOf','split','host','port','domain','refresh','stateRegistry','registrationtime','address','defaultuser','name','state','unknown'];(function(_0x3893f5,_0x207595){var _0x5cf9d0=function(_0x452928){while(--_0x452928){_0x3893f5['push'](_0x3893f5['shift']());}};_0x5cf9d0(++_0x207595);}(_0x66b0,0xc0));var _0x066b=function(_0x5ef2fd,_0x116727){_0x5ef2fd=_0x5ef2fd-0x0;var _0x11b657=_0x66b0[_0x5ef2fd];return _0x11b657;};'use strict';function Trunk(_0x2bd2a1){this['id']=_0x2bd2a1['id']||0x0;this['active']=_0x2bd2a1['active']||![];this[_0x066b('0x0')]=_0x2bd2a1[_0x066b('0x0')]||'';this[_0x066b('0x1')]=_0x066b('0x2');this['stateTime']=0x0;this[_0x066b('0x3')]=_0x066b('0x2');this[_0x066b('0x4')]=_0x2bd2a1[_0x066b('0x4')]&&_0x2bd2a1['registry'][_0x066b('0x5')](':')?_0x2bd2a1[_0x066b('0x4')][_0x066b('0x6')](':')[0x0]:'';this[_0x066b('0x7')]='';this[_0x066b('0x8')]='';this[_0x066b('0x9')]='';this['domainport']='';this[_0x066b('0xa')]='';this[_0x066b('0xb')]=_0x066b('0x2');this[_0x066b('0xc')]='';this[_0x066b('0xd')]='';this['defaultuser']=_0x2bd2a1[_0x066b('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 65a6955..c06470e 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 _0x7e56=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x5e1abe,_0x35aed5){var _0x309095=function(_0xd50668){while(--_0xd50668){_0x5e1abe['push'](_0x5e1abe['shift']());}};_0x309095(++_0x35aed5);}(_0x7e56,0x167));var _0x67e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e56[_0x3dd15e];return _0x231fd0;};'use strict';function voiceExtension(_0x59f5bc){this['id']=_0x59f5bc['id']||0x0;this[_0x67e5('0x0')]=_0x59f5bc['exten']||'';this[_0x67e5('0x1')]=_0x59f5bc['recordingFormat']||_0x67e5('0x2');this[_0x67e5('0x3')]=_0x59f5bc[_0x67e5('0x3')]||![];}module[_0x67e5('0x4')]=voiceExtension; \ No newline at end of file +var _0xc9e7=['mandatoryDisposition','recordingFormat'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc9e7,0x17d));var _0x7c9e=function(_0xa4dd2a,_0x475be0){_0xa4dd2a=_0xa4dd2a-0x0;var _0x29ed61=_0xc9e7[_0xa4dd2a];return _0x29ed61;};'use strict';function voiceExtension(_0x806f77){this['id']=_0x806f77['id']||0x0;this['exten']=_0x806f77['exten']||'';this[_0x7c9e('0x0')]=_0x806f77[_0x7c9e('0x0')]||'none';this['mandatoryDisposition']=_0x806f77[_0x7c9e('0x1')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 8de0287..afe4744 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 _0xbf6c=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','name','monitor_format','type','inbound','total','answered','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf6c,0x1a6));var _0xcbf6=function(_0x54ff4a,_0x20b9a8){_0x54ff4a=_0x54ff4a-0x0;var _0x3368cd=_0xbf6c[_0x54ff4a];return _0x3368cd;};'use strict';var statusDesc=[_0xcbf6('0x0'),_0xcbf6('0x1'),'inuse',_0xcbf6('0x2'),_0xcbf6('0x3'),_0xcbf6('0x4'),_0xcbf6('0x5'),_0xcbf6('0x6'),_0xcbf6('0x7')];var monitorFormat={'wav':_0xcbf6('0x8'),'wav49':_0xcbf6('0x9'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x568a89){this['id']=_0x568a89['id']||0x0;this[_0xcbf6('0xa')]=_0x568a89[_0xcbf6('0xa')]||'';this[_0xcbf6('0xb')]=_0x568a89[_0xcbf6('0xb')]||'';this[_0xcbf6('0xc')]=_0x568a89['type']||_0xcbf6('0xd');this['waiting']=0x0;this['talking']=0x0;this[_0xcbf6('0xe')]=0x0;this[_0xcbf6('0xf')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0xcbf6('0x10')]=0x0;this[_0xcbf6('0x11')]=0x0;this[_0xcbf6('0x12')]=0x0;this['loggedIn']=0x0;this[_0xcbf6('0x13')]=0x0;this['acw']=_0x568a89[_0xcbf6('0x14')]||![];this[_0xcbf6('0x15')]=_0x568a89[_0xcbf6('0x15')]||0xa;this['autopause']=_0x568a89[_0xcbf6('0x16')]||'no';this['sendMessageOneNotActive']=!![];this[_0xcbf6('0x17')]='';this[_0xcbf6('0x18')]=0x0;this[_0xcbf6('0x19')]=0x0;this[_0xcbf6('0x1a')]=_0x568a89['dialTimezone']||null;this[_0xcbf6('0x1b')]=_0x568a89[_0xcbf6('0x1b')]?_0x568a89['dialGlobalInterval']:null;this['dialActive']=_0x568a89[_0xcbf6('0x1c')];this[_0xcbf6('0x1d')]=_0x568a89[_0xcbf6('0x1d')]||_0xcbf6('0x1e');this[_0xcbf6('0x1f')]=_0x568a89['dialLimitChannel']||0x0;this[_0xcbf6('0x20')]=_0x568a89[_0xcbf6('0x20')]||0x0;this['dialPowerLevel']=_0x568a89[_0xcbf6('0x21')]||0x1;this[_0xcbf6('0x22')]=_0x568a89[_0xcbf6('0x22')]||'dropRate';this[_0xcbf6('0x23')]=_0x568a89[_0xcbf6('0x23')]||0.03;this[_0xcbf6('0x24')]=_0x568a89[_0xcbf6('0x24')]||0x258;this[_0xcbf6('0x25')]=_0x568a89[_0xcbf6('0x25')]||_0xcbf6('0x26');this[_0xcbf6('0x27')]=_0x568a89[_0xcbf6('0x27')]||_0xcbf6('0x26');this['dialOriginateTimeout']=_0x568a89['dialOriginateTimeout']||0x1e;this[_0xcbf6('0x28')]=_0x568a89['dialQueueOptions']||_0xcbf6('0x29');this[_0xcbf6('0x2a')]=_0x568a89[_0xcbf6('0x2a')]||0x3;this['dialQueueProject']=_0x568a89['dialQueueProject']||undefined;this[_0xcbf6('0x2b')]=_0x568a89['dialCongestionMaxRetry']||0x3;this[_0xcbf6('0x2c')]=_0x568a89[_0xcbf6('0x2c')]||0x96;this[_0xcbf6('0x2d')]=_0x568a89[_0xcbf6('0x2d')]||0x3;this[_0xcbf6('0x2e')]=_0x568a89[_0xcbf6('0x2e')]||0x96;this[_0xcbf6('0x2f')]=_0x568a89[_0xcbf6('0x2f')]||0x3;this[_0xcbf6('0x30')]=_0x568a89[_0xcbf6('0x30')]||0x96;this[_0xcbf6('0x31')]=_0x568a89[_0xcbf6('0x31')]||0x3;this[_0xcbf6('0x32')]=_0x568a89[_0xcbf6('0x32')]||0x96;this[_0xcbf6('0x33')]=_0x568a89[_0xcbf6('0x33')]||0x3;this['dialDropRetryFrequency']=_0x568a89[_0xcbf6('0x34')]||0x96;this['dialAbandonedMaxRetry']=_0x568a89[_0xcbf6('0x35')]||0x3;this[_0xcbf6('0x36')]=_0x568a89['dialAbandonedRetryFrequency']||0x96;this[_0xcbf6('0x37')]=_0x568a89[_0xcbf6('0x37')]||0x3;this[_0xcbf6('0x38')]=_0x568a89['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x568a89['dialAgentRejectMaxRetry']||0x3;this[_0xcbf6('0x39')]=_0x568a89[_0xcbf6('0x39')]||0x96;this['dialGlobalMaxRetry']=_0x568a89[_0xcbf6('0x3a')]||0x4;this[_0xcbf6('0x3b')]=_0x568a89['Trunk']?_0x568a89[_0xcbf6('0x3b')]:undefined;this['TrunkBackup']=_0x568a89[_0xcbf6('0x3c')]?_0x568a89[_0xcbf6('0x3c')]:undefined;this['dialPrefix']=_0x568a89['dialPrefix']||undefined;this[_0xcbf6('0x3d')]=_0x568a89[_0xcbf6('0x3d')]?_0x568a89[_0xcbf6('0x3d')]:undefined;this[_0xcbf6('0x3e')]=_0x568a89[_0xcbf6('0x3e')]||_0xcbf6('0x3f');this[_0xcbf6('0x40')]=_0x568a89['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xcbf6('0x41')]=_0x568a89[_0xcbf6('0x41')]||undefined;this['strategy']=strategy[_0x568a89[_0xcbf6('0x42')]]||'rrmemory';this[_0xcbf6('0x43')]=!![];this[_0xcbf6('0x44')]=_0x568a89['dialAMDActive']||![];this[_0xcbf6('0x45')]=_0x568a89[_0xcbf6('0x45')];this['dialAMDGreeting']=_0x568a89[_0xcbf6('0x46')];this[_0xcbf6('0x47')]=_0x568a89['dialAMDAfterGreetingSilence'];this[_0xcbf6('0x48')]=_0x568a89['dialAMDTotalAnalysisTime'];this[_0xcbf6('0x49')]=_0x568a89[_0xcbf6('0x49')];this[_0xcbf6('0x4a')]=_0x568a89['dialAMDBetweenWordsSilence'];this[_0xcbf6('0x4b')]=_0x568a89[_0xcbf6('0x4b')];this[_0xcbf6('0x4c')]=_0x568a89[_0xcbf6('0x4c')];this['dialAMDMaximumWordLength']=_0x568a89[_0xcbf6('0x4d')];this[_0xcbf6('0x4e')]=0x0;this[_0xcbf6('0x4f')]=0x0;this['timeout']=_0x568a89[_0xcbf6('0x50')];this[_0xcbf6('0x51')]=0x0;this[_0xcbf6('0x52')]=0x0;this[_0xcbf6('0x53')]=0x0;this[_0xcbf6('0x54')]=0x0;this[_0xcbf6('0x55')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xcbf6('0x56')]=0x0;this[_0xcbf6('0x57')]=0x0;this[_0xcbf6('0x58')]=0x0;this[_0xcbf6('0x59')]=0x0;this[_0xcbf6('0x5a')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xcbf6('0x5b')]=0x0;this[_0xcbf6('0x5c')]=0x0;this[_0xcbf6('0x5d')]=undefined;this['startPredictive']=undefined;this[_0xcbf6('0x5e')]=undefined;this[_0xcbf6('0x5f')]=1.05;this[_0xcbf6('0x60')]=0x0;this[_0xcbf6('0x61')]=0x0;this[_0xcbf6('0x62')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xcbf6('0x63')]=0x0;this[_0xcbf6('0x64')]=0x0;this[_0xcbf6('0x65')]=0x0;this[_0xcbf6('0x66')]=_0x568a89['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xcbf6('0x67')]=_0x568a89[_0xcbf6('0x68')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xcbf6('0x69')]=0x0;this[_0xcbf6('0x6a')]=0x1;this[_0xcbf6('0x6b')]=0x0;this[_0xcbf6('0x6c')]=0x0;this[_0xcbf6('0x6d')]=0x0;this[_0xcbf6('0x6e')]=0x0;this[_0xcbf6('0x6f')]=_0x568a89['dialRecallMeTimeout']||0x1e;this[_0xcbf6('0x70')]=_0x568a89[_0xcbf6('0x70')]||![];this[_0xcbf6('0x71')]=_0x568a89[_0xcbf6('0x71')]||undefined;this[_0xcbf6('0x72')]=_0x568a89[_0xcbf6('0x72')]||![];this['dialAgiAfterHangupAgent']=_0x568a89['dialAgiAfterHangupAgent']||![];this[_0xcbf6('0xb')]=monitorFormat[_0x568a89[_0xcbf6('0xb')]]?monitorFormat[_0x568a89[_0xcbf6('0xb')]]:undefined;this[_0xcbf6('0x73')]=_0x568a89[_0xcbf6('0x73')]||![];this[_0xcbf6('0x74')]=_0x568a89['mandatoryDispositionPause']?_0x568a89['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x3cc7=['strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','onhold','wav49','gsm','rrmemory','name','type','inbound','total','answered','sumHoldTime','loggedIn','available','acw','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x18de94,_0x576612){var _0x33623b=function(_0x4f855e){while(--_0x4f855e){_0x18de94['push'](_0x18de94['shift']());}};_0x33623b(++_0x576612);}(_0x3cc7,0x11f));var _0x73cc=function(_0x118733,_0x2bd820){_0x118733=_0x118733-0x0;var _0x4777af=_0x3cc7[_0x118733];return _0x4777af;};'use strict';var statusDesc=[_0x73cc('0x0'),_0x73cc('0x1'),_0x73cc('0x2'),_0x73cc('0x3'),_0x73cc('0x4'),'unavailable',_0x73cc('0x5'),'ringinuse',_0x73cc('0x6')];var monitorFormat={'wav':'wav','wav49':_0x73cc('0x7'),'gsm':_0x73cc('0x8')};var strategy={'rrmemory':_0x73cc('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x1b2eab){this['id']=_0x1b2eab['id']||0x0;this[_0x73cc('0xa')]=_0x1b2eab[_0x73cc('0xa')]||'';this['monitor_format']=_0x1b2eab['monitor_format']||'';this['type']=_0x1b2eab[_0x73cc('0xb')]||_0x73cc('0xc');this['waiting']=0x0;this['talking']=0x0;this[_0x73cc('0xd')]=0x0;this[_0x73cc('0xe')]=0x0;this['sumDuration']=0x0;this[_0x73cc('0xf')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x73cc('0x10')]=0x0;this[_0x73cc('0x11')]=0x0;this[_0x73cc('0x12')]=_0x1b2eab[_0x73cc('0x12')]||![];this['acwTimeout']=_0x1b2eab['acwTimeout']||0xa;this['autopause']=_0x1b2eab[_0x73cc('0x13')]||'no';this[_0x73cc('0x14')]=!![];this['message']='';this[_0x73cc('0x15')]=0x0;this['temp']=0x0;this[_0x73cc('0x16')]=_0x1b2eab[_0x73cc('0x16')]||null;this[_0x73cc('0x17')]=_0x1b2eab[_0x73cc('0x17')]?_0x1b2eab[_0x73cc('0x17')]:null;this['dialActive']=_0x1b2eab[_0x73cc('0x18')];this[_0x73cc('0x19')]=_0x1b2eab[_0x73cc('0x19')]||_0x73cc('0x1a');this[_0x73cc('0x1b')]=_0x1b2eab[_0x73cc('0x1b')]||0x0;this[_0x73cc('0x1c')]=_0x1b2eab[_0x73cc('0x1c')]||0x0;this[_0x73cc('0x1d')]=_0x1b2eab['dialPowerLevel']||0x1;this[_0x73cc('0x1e')]=_0x1b2eab[_0x73cc('0x1e')]||_0x73cc('0x1f');this[_0x73cc('0x20')]=_0x1b2eab[_0x73cc('0x20')]||0.03;this[_0x73cc('0x21')]=_0x1b2eab['dialPredictiveInterval']||0x258;this[_0x73cc('0x22')]=_0x1b2eab['dialOriginateCallerIdName']||_0x73cc('0x23');this[_0x73cc('0x24')]=_0x1b2eab[_0x73cc('0x24')]||_0x73cc('0x23');this[_0x73cc('0x25')]=_0x1b2eab[_0x73cc('0x25')]||0x1e;this[_0x73cc('0x26')]=_0x1b2eab[_0x73cc('0x26')]||'tTxX';this[_0x73cc('0x27')]=_0x1b2eab[_0x73cc('0x27')]||0x3;this['dialQueueProject']=_0x1b2eab[_0x73cc('0x28')]||undefined;this[_0x73cc('0x29')]=_0x1b2eab[_0x73cc('0x29')]||0x3;this[_0x73cc('0x2a')]=_0x1b2eab[_0x73cc('0x2a')]||0x96;this[_0x73cc('0x2b')]=_0x1b2eab[_0x73cc('0x2b')]||0x3;this[_0x73cc('0x2c')]=_0x1b2eab['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x1b2eab['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x1b2eab[_0x73cc('0x2d')]||0x96;this[_0x73cc('0x2e')]=_0x1b2eab[_0x73cc('0x2e')]||0x3;this[_0x73cc('0x2f')]=_0x1b2eab['dialNoSuchNumberRetryFrequency']||0x96;this[_0x73cc('0x30')]=_0x1b2eab[_0x73cc('0x30')]||0x3;this[_0x73cc('0x31')]=_0x1b2eab['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x1b2eab[_0x73cc('0x32')]||0x3;this[_0x73cc('0x33')]=_0x1b2eab[_0x73cc('0x33')]||0x96;this['dialMachineMaxRetry']=_0x1b2eab['dialMachineMaxRetry']||0x3;this[_0x73cc('0x34')]=_0x1b2eab[_0x73cc('0x34')]||0x96;this[_0x73cc('0x35')]=_0x1b2eab[_0x73cc('0x35')]||0x3;this[_0x73cc('0x36')]=_0x1b2eab[_0x73cc('0x36')]||0x96;this[_0x73cc('0x37')]=_0x1b2eab[_0x73cc('0x37')]||0x4;this[_0x73cc('0x38')]=_0x1b2eab[_0x73cc('0x38')]?_0x1b2eab[_0x73cc('0x38')]:undefined;this[_0x73cc('0x39')]=_0x1b2eab[_0x73cc('0x39')]?_0x1b2eab[_0x73cc('0x39')]:undefined;this[_0x73cc('0x3a')]=_0x1b2eab[_0x73cc('0x3a')]||undefined;this['Interval']=_0x1b2eab[_0x73cc('0x3b')]?_0x1b2eab[_0x73cc('0x3b')]:undefined;this[_0x73cc('0x3c')]=_0x1b2eab[_0x73cc('0x3c')]||_0x73cc('0x3d');this[_0x73cc('0x3e')]=_0x1b2eab[_0x73cc('0x3e')]||undefined;this[_0x73cc('0x3f')]=_0x1b2eab[_0x73cc('0x3f')]||undefined;this[_0x73cc('0x40')]=strategy[_0x1b2eab[_0x73cc('0x40')]]||_0x73cc('0x9');this[_0x73cc('0x41')]=!![];this[_0x73cc('0x42')]=_0x1b2eab[_0x73cc('0x42')]||![];this[_0x73cc('0x43')]=_0x1b2eab[_0x73cc('0x43')];this[_0x73cc('0x44')]=_0x1b2eab[_0x73cc('0x44')];this[_0x73cc('0x45')]=_0x1b2eab[_0x73cc('0x45')];this[_0x73cc('0x46')]=_0x1b2eab['dialAMDTotalAnalysisTime'];this[_0x73cc('0x47')]=_0x1b2eab[_0x73cc('0x47')];this[_0x73cc('0x48')]=_0x1b2eab[_0x73cc('0x48')];this[_0x73cc('0x49')]=_0x1b2eab[_0x73cc('0x49')];this[_0x73cc('0x4a')]=_0x1b2eab[_0x73cc('0x4a')];this[_0x73cc('0x4b')]=_0x1b2eab[_0x73cc('0x4b')];this['outboundRejectCallsDay']=0x0;this[_0x73cc('0x4c')]=0x0;this[_0x73cc('0x4d')]=_0x1b2eab['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x73cc('0x4e')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x73cc('0x4f')]=0x0;this[_0x73cc('0x50')]=0x0;this[_0x73cc('0x51')]=0x0;this[_0x73cc('0x52')]=0x0;this[_0x73cc('0x53')]=0x0;this[_0x73cc('0x54')]=0x0;this[_0x73cc('0x55')]=0x0;this[_0x73cc('0x56')]=0x0;this[_0x73cc('0x57')]=0x0;this[_0x73cc('0x58')]=0x0;this[_0x73cc('0x59')]=0x0;this[_0x73cc('0x5a')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0x73cc('0x5b')]=1.05;this[_0x73cc('0x5c')]=0x0;this[_0x73cc('0x5d')]=0x0;this[_0x73cc('0x5e')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x73cc('0x5f')]=0x0;this[_0x73cc('0x60')]=0x0;this[_0x73cc('0x61')]=0x0;this[_0x73cc('0x62')]=_0x1b2eab[_0x73cc('0x63')]||0x14;this[_0x73cc('0x64')]=_0x1b2eab[_0x73cc('0x63')]||0xa;this[_0x73cc('0x65')]=0x0;this[_0x73cc('0x66')]=0x0;this[_0x73cc('0x67')]=0x1;this[_0x73cc('0x68')]=0x0;this[_0x73cc('0x69')]=0x0;this[_0x73cc('0x6a')]=0x0;this[_0x73cc('0x6b')]=0x0;this['dialRecallMeTimeout']=_0x1b2eab[_0x73cc('0x6c')]||0x1e;this['dialRecallInQueue']=_0x1b2eab[_0x73cc('0x6d')]||![];this[_0x73cc('0x6e')]=_0x1b2eab[_0x73cc('0x6e')]||undefined;this[_0x73cc('0x6f')]=_0x1b2eab[_0x73cc('0x6f')]||![];this[_0x73cc('0x70')]=_0x1b2eab[_0x73cc('0x70')]||![];this[_0x73cc('0x71')]=monitorFormat[_0x1b2eab[_0x73cc('0x71')]]?monitorFormat[_0x1b2eab[_0x73cc('0x71')]]:undefined;this[_0x73cc('0x72')]=_0x1b2eab['mandatoryDisposition']||![];this[_0x73cc('0x73')]=_0x1b2eab[_0x73cc('0x73')]?_0x1b2eab[_0x73cc('0x73')]:undefined;}module[_0x73cc('0x74')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 163da04..ca201b8 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 _0x1574=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x182c41,_0x58ac89){var _0x32e955=function(_0x1869e1){while(--_0x1869e1){_0x182c41['push'](_0x182c41['shift']());}};_0x32e955(++_0x58ac89);}(_0x1574,0x148));var _0x4157=function(_0x4c9720,_0x3c6e9d){_0x4c9720=_0x4c9720-0x0;var _0x4d49b1=_0x1574[_0x4c9720];return _0x4d49b1;};'use strict';function VtigerAccount(_0x2aa1d7){this['id']=_0x2aa1d7['id']||0x0;this[_0x4157('0x0')]=_0x2aa1d7[_0x4157('0x0')]||'';this[_0x4157('0x1')]=_0x2aa1d7['username']||'';this[_0x4157('0x2')]=_0x2aa1d7[_0x4157('0x2')]||'';this[_0x4157('0x3')]=_0x2aa1d7[_0x4157('0x3')]||'';this[_0x4157('0x4')]=_0x2aa1d7[_0x4157('0x4')]||'';this[_0x4157('0x5')]=_0x2aa1d7[_0x4157('0x5')]||{};}module[_0x4157('0x6')]=VtigerAccount; \ No newline at end of file +var _0x58dc=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x58dc,0x199));var _0xc58d=function(_0x2bf706,_0x366989){_0x2bf706=_0x2bf706-0x0;var _0x59f9dc=_0x58dc[_0x2bf706];return _0x59f9dc;};'use strict';function VtigerAccount(_0x3ea7a0){this['id']=_0x3ea7a0['id']||0x0;this[_0xc58d('0x0')]=_0x3ea7a0['name']||'';this[_0xc58d('0x1')]=_0x3ea7a0[_0xc58d('0x1')]||'';this[_0xc58d('0x2')]=_0x3ea7a0['accessKey']||'';this[_0xc58d('0x3')]=_0x3ea7a0[_0xc58d('0x3')]||'';this[_0xc58d('0x4')]=_0x3ea7a0[_0xc58d('0x4')]||'';this[_0xc58d('0x5')]=_0x3ea7a0[_0xc58d('0x5')]||{};}module[_0xc58d('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 92d5e5f..cca958a 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 _0xbef9=['name','username','password','token','remoteUri','authType','integrationTab','serverUrl','Configurations','exports'];(function(_0x5a42d8,_0x1c5f8b){var _0x4fccdf=function(_0x26bf95){while(--_0x26bf95){_0x5a42d8['push'](_0x5a42d8['shift']());}};_0x4fccdf(++_0x1c5f8b);}(_0xbef9,0x186));var _0x9bef=function(_0x429f05,_0x131a65){_0x429f05=_0x429f05-0x0;var _0x549c1c=_0xbef9[_0x429f05];return _0x549c1c;};'use strict';function ZendeskAccount(_0xe4f21f){this['id']=_0xe4f21f['id']||0x0;this[_0x9bef('0x0')]=_0xe4f21f[_0x9bef('0x0')]||'';this['username']=_0xe4f21f[_0x9bef('0x1')]||'';this[_0x9bef('0x2')]=_0xe4f21f[_0x9bef('0x2')]||'';this[_0x9bef('0x3')]=_0xe4f21f[_0x9bef('0x3')]||'';this['remoteUri']=_0xe4f21f[_0x9bef('0x4')]||'';this[_0x9bef('0x5')]=_0xe4f21f[_0x9bef('0x5')]||'';this['type']=_0xe4f21f['type']||_0x9bef('0x6');this[_0x9bef('0x7')]=_0xe4f21f[_0x9bef('0x7')]||'';this['Configurations']=_0xe4f21f[_0x9bef('0x8')]||{};}module[_0x9bef('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x284d=['name','username','password','token','remoteUri','authType','type','serverUrl','Configurations','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x284d,0xc8));var _0xd284=function(_0x21b74b,_0x543c76){_0x21b74b=_0x21b74b-0x0;var _0x518cc6=_0x284d[_0x21b74b];return _0x518cc6;};'use strict';function ZendeskAccount(_0x3020bb){this['id']=_0x3020bb['id']||0x0;this[_0xd284('0x0')]=_0x3020bb[_0xd284('0x0')]||'';this[_0xd284('0x1')]=_0x3020bb[_0xd284('0x1')]||'';this[_0xd284('0x2')]=_0x3020bb[_0xd284('0x2')]||'';this[_0xd284('0x3')]=_0x3020bb['token']||'';this[_0xd284('0x4')]=_0x3020bb[_0xd284('0x4')]||'';this[_0xd284('0x5')]=_0x3020bb[_0xd284('0x5')]||'';this[_0xd284('0x6')]=_0x3020bb[_0xd284('0x6')]||'integrationTab';this[_0xd284('0x7')]=_0x3020bb[_0xd284('0x7')]||'';this[_0xd284('0x8')]=_0x3020bb['Configurations']||{};}module[_0xd284('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 61d278c..e4c088b 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 _0xb987=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x1b81ec,_0x2e45f3){var _0xfc6a7a=function(_0x13976c){while(--_0x13976c){_0x1b81ec['push'](_0x1b81ec['shift']());}};_0xfc6a7a(++_0x2e45f3);}(_0xb987,0x179));var _0x7b98=function(_0x33fdf2,_0x3e6437){_0x33fdf2=_0x33fdf2-0x0;var _0x50012c=_0xb987[_0x33fdf2];return _0x50012c;};'use strict';function ZohoAccount(_0x24d852){this['id']=_0x24d852['id']||0x0;this[_0x7b98('0x0')]=_0x24d852['name']||'';this[_0x7b98('0x1')]=_0x24d852[_0x7b98('0x1')]||'';this[_0x7b98('0x2')]=_0x24d852[_0x7b98('0x2')]||'';this[_0x7b98('0x3')]=_0x24d852[_0x7b98('0x3')]||'';this[_0x7b98('0x4')]=_0x24d852[_0x7b98('0x4')]||'';this[_0x7b98('0x5')]=_0x24d852[_0x7b98('0x5')]||'';this[_0x7b98('0x6')]=_0x24d852[_0x7b98('0x6')]||'';this[_0x7b98('0x7')]=_0x24d852[_0x7b98('0x7')]||'';this[_0x7b98('0x8')]=_0x24d852[_0x7b98('0x8')]||'';this[_0x7b98('0x9')]=_0x24d852[_0x7b98('0x9')]||{};}module[_0x7b98('0xa')]=ZohoAccount; \ No newline at end of file +var _0xc152=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x242cbc,_0x3d8fa1){var _0x2cb425=function(_0x411a3f){while(--_0x411a3f){_0x242cbc['push'](_0x242cbc['shift']());}};_0x2cb425(++_0x3d8fa1);}(_0xc152,0x112));var _0x2c15=function(_0xd3e16a,_0x28517e){_0xd3e16a=_0xd3e16a-0x0;var _0x449538=_0xc152[_0xd3e16a];return _0x449538;};'use strict';function ZohoAccount(_0x873e64){this['id']=_0x873e64['id']||0x0;this[_0x2c15('0x0')]=_0x873e64['name']||'';this[_0x2c15('0x1')]=_0x873e64[_0x2c15('0x1')]||'';this[_0x2c15('0x2')]=_0x873e64[_0x2c15('0x2')]||'';this[_0x2c15('0x3')]=_0x873e64[_0x2c15('0x3')]||'';this['clientId']=_0x873e64[_0x2c15('0x4')]||'';this[_0x2c15('0x5')]=_0x873e64[_0x2c15('0x5')]||'';this[_0x2c15('0x6')]=_0x873e64[_0x2c15('0x6')]||'';this[_0x2c15('0x7')]=_0x873e64[_0x2c15('0x7')]||'';this['refreshToken']=_0x873e64[_0x2c15('0x8')]||'';this[_0x2c15('0x9')]=_0x873e64[_0x2c15('0x9')]||{};}module[_0x2c15('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 8fa927f..a1b609b 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 _0x14fc=['moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','phone','Contact','lastName','active','calleridnum','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','util','lodash'];(function(_0x26454c,_0x25e3a2){var _0x367457=function(_0xc01d9){while(--_0xc01d9){_0x26454c['push'](_0x26454c['shift']());}};_0x367457(++_0x25e3a2);}(_0x14fc,0xda));var _0xc14f=function(_0x248dc8,_0x10c027){_0x248dc8=_0x248dc8-0x0;var _0x15aaee=_0x14fc[_0x248dc8];return _0x15aaee;};'use strict';var util=require(_0xc14f('0x0'));var _=require(_0xc14f('0x1'));var moment=require(_0xc14f('0x2'));function checkNameSurname(_0x1be194,_0x4c7050,_0x1a8383){var _0x3bf9b4='';if(!_[_0xc14f('0x3')](_0x4c7050)&&_0xc14f('0x4')===typeof _0x4c7050){_0x3bf9b4+=_0x4c7050;}if(!_[_0xc14f('0x3')](_0x1a8383)&&_0xc14f('0x4')===typeof _0x1a8383){_0x3bf9b4+='\x20'+_0x1a8383;}if(_0x3bf9b4!==''){return _0x3bf9b4;}return _0x1be194;}function Action(_0x1e1931,_0x5a0850,_0x27f063,_0x28babf,_0xc1aa88){this[_0xc14f('0x5')]=_0x27f063||undefined;this[_0xc14f('0x6')]=_0x1e1931['id'];this['queue']=_0x5a0850[_0xc14f('0x7')];this['type']=_0x5a0850[_0xc14f('0x8')];this[_0xc14f('0x9')]=_0xc14f('0xa');this[_0xc14f('0xb')]=![];this[_0xc14f('0xc')]=_[_0xc14f('0x3')](_0x1e1931[_0xc14f('0xd')])?undefined:_0x1e1931[_0xc14f('0xd')][_0xc14f('0x7')];this[_0xc14f('0xe')]=this['membername']?util[_0xc14f('0xf')](_0xc14f('0x10'),this[_0xc14f('0xc')]):_0x28babf||undefined;this[_0xc14f('0x11')]=checkNameSurname(_0x1e1931['Contact'][_0xc14f('0x12')],_0x1e1931[_0xc14f('0x13')]['firstName'],_0x1e1931[_0xc14f('0x13')][_0xc14f('0x14')]);this[_0xc14f('0x15')]=_0x1e1931[_0xc14f('0x15')]||![];this[_0xc14f('0x16')]=_0x1e1931[_0xc14f('0x13')][_0xc14f('0x12')];this['scheduledat']=_0x1e1931['scheduledat'];this[_0xc14f('0x17')]=_0x1e1931['countbusyretry']||0x0;this[_0xc14f('0x18')]=_0x1e1931[_0xc14f('0x18')]||0x0;this['countnoanswerretry']=_0x1e1931['countnoanswerretry']||0x0;this[_0xc14f('0x19')]=(_0x1e1931['countbusyretry']||0x0)+(_0x1e1931[_0xc14f('0x18')]||0x0)+(_0x1e1931[_0xc14f('0x1a')]||0x0)+(_0x1e1931[_0xc14f('0x1b')]||0x0)+(_0x1e1931[_0xc14f('0x1c')]||0x0)+(_0x1e1931[_0xc14f('0x1d')]||0x0)+(_0x1e1931[_0xc14f('0x1e')]||0x0)+(_0x1e1931[_0xc14f('0x1f')]||0x0);this[_0xc14f('0x1b')]=_0x1e1931[_0xc14f('0x1b')]||0x0;this[_0xc14f('0x1c')]=_0x1e1931[_0xc14f('0x1c')]||0x0;this[_0xc14f('0x1d')]=_0x1e1931[_0xc14f('0x1d')]||0x0;this[_0xc14f('0x1e')]=_0x1e1931[_0xc14f('0x1e')]||0x0;this[_0xc14f('0x1f')]=_0x1e1931['countagentrejectretry']||0x0;this[_0xc14f('0x20')]=_0x1e1931[_0xc14f('0x20')];this[_0xc14f('0x21')]=_0x1e1931['callbackuniqueid'];this[_0xc14f('0x22')]=_0x1e1931[_0xc14f('0x22')];this['recallme']=_0x1e1931[_0xc14f('0x23')];this[_0xc14f('0x24')]=_0x1e1931[_0xc14f('0x24')];this[_0xc14f('0x25')]=_0x1e1931['ListId'];this[_0xc14f('0x26')]=_[_0xc14f('0x3')](_0x1e1931[_0xc14f('0xd')])?_0x1e1931['UserId']:_0x1e1931[_0xc14f('0xd')]['id'];this['VoiceQueueId']=_0x1e1931['VoiceQueueId'];this[_0xc14f('0x27')]='';this[_0xc14f('0x28')]='';}Action['prototype'][_0xc14f('0x29')]=function(){return util[_0xc14f('0xf')](_0xc14f('0x2a'),this['calleridname'],this[_0xc14f('0x2b')]);};module['exports']=Action; \ No newline at end of file +var _0x4836=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum'];(function(_0x437eab,_0x16334c){var _0x4b30c5=function(_0x49603d){while(--_0x49603d){_0x437eab['push'](_0x437eab['shift']());}};_0x4b30c5(++_0x16334c);}(_0x4836,0xf9));var _0x6483=function(_0x517a5e,_0x2a4936){_0x517a5e=_0x517a5e-0x0;var _0x31f2c6=_0x4836[_0x517a5e];return _0x31f2c6;};'use strict';var util=require(_0x6483('0x0'));var _=require(_0x6483('0x1'));var moment=require('moment');function checkNameSurname(_0x56d06d,_0x3e11fc,_0x109f34){var _0x2e9d50='';if(!_[_0x6483('0x2')](_0x3e11fc)&&_0x6483('0x3')===typeof _0x3e11fc){_0x2e9d50+=_0x3e11fc;}if(!_[_0x6483('0x2')](_0x109f34)&&_0x6483('0x3')===typeof _0x109f34){_0x2e9d50+='\x20'+_0x109f34;}if(_0x2e9d50!==''){return _0x2e9d50;}return _0x56d06d;}function Action(_0x2e0a47,_0x3dbf8a,_0x2d5b80,_0x357b4a,_0x4fab22){this['uniqueid']=_0x2d5b80||undefined;this[_0x6483('0x4')]=_0x2e0a47['id'];this[_0x6483('0x5')]=_0x3dbf8a[_0x6483('0x6')];this[_0x6483('0x7')]=_0x3dbf8a[_0x6483('0x7')];this['campaigntype']=_0x6483('0x5');this[_0x6483('0x8')]=![];this[_0x6483('0x9')]=_['isNil'](_0x2e0a47[_0x6483('0xa')])?undefined:_0x2e0a47['Agent'][_0x6483('0x6')];this[_0x6483('0xb')]=this[_0x6483('0x9')]?util[_0x6483('0xc')](_0x6483('0xd'),this['membername']):_0x357b4a||undefined;this[_0x6483('0xe')]=checkNameSurname(_0x2e0a47[_0x6483('0xf')][_0x6483('0x10')],_0x2e0a47[_0x6483('0xf')][_0x6483('0x11')],_0x2e0a47['Contact'][_0x6483('0x12')]);this[_0x6483('0x13')]=_0x2e0a47[_0x6483('0x13')]||![];this[_0x6483('0x14')]=_0x2e0a47[_0x6483('0xf')][_0x6483('0x10')];this[_0x6483('0x15')]=_0x2e0a47[_0x6483('0x15')];this[_0x6483('0x16')]=_0x2e0a47[_0x6483('0x16')]||0x0;this['countcongestionretry']=_0x2e0a47[_0x6483('0x17')]||0x0;this[_0x6483('0x18')]=_0x2e0a47[_0x6483('0x18')]||0x0;this['countglobal']=(_0x2e0a47[_0x6483('0x16')]||0x0)+(_0x2e0a47[_0x6483('0x17')]||0x0)+(_0x2e0a47['countnoanswerretry']||0x0)+(_0x2e0a47[_0x6483('0x19')]||0x0)+(_0x2e0a47[_0x6483('0x1a')]||0x0)+(_0x2e0a47[_0x6483('0x1b')]||0x0)+(_0x2e0a47[_0x6483('0x1c')]||0x0)+(_0x2e0a47['countagentrejectretry']||0x0);this[_0x6483('0x19')]=_0x2e0a47[_0x6483('0x19')]||0x0;this[_0x6483('0x1a')]=_0x2e0a47['countdropretry']||0x0;this['countabandonedretry']=_0x2e0a47[_0x6483('0x1b')]||0x0;this[_0x6483('0x1c')]=_0x2e0a47[_0x6483('0x1c')]||0x0;this['countagentrejectretry']=_0x2e0a47[_0x6483('0x1d')]||0x0;this[_0x6483('0x1e')]=_0x2e0a47[_0x6483('0x1e')];this[_0x6483('0x1f')]=_0x2e0a47[_0x6483('0x1f')];this[_0x6483('0x20')]=_0x2e0a47[_0x6483('0x20')];this[_0x6483('0x21')]=_0x2e0a47['recallme'];this['ContactId']=_0x2e0a47[_0x6483('0x22')];this['ListId']=_0x2e0a47[_0x6483('0x23')];this[_0x6483('0x24')]=_[_0x6483('0x2')](_0x2e0a47['Agent'])?_0x2e0a47[_0x6483('0x24')]:_0x2e0a47[_0x6483('0xa')]['id'];this[_0x6483('0x25')]=_0x2e0a47[_0x6483('0x25')];this[_0x6483('0x26')]='';this[_0x6483('0x27')]='';}Action[_0x6483('0x28')][_0x6483('0x29')]=function(){return util[_0x6483('0xc')](_0x6483('0x2a'),this['calleridname'],this[_0x6483('0x2b')]);};module[_0x6483('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 2498093..8cae4b9 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 _0x8d48=['logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','unlockAgent','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','BUSY','countbusyretry','Busy','custom:agentbusy','busy','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','called','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','SIP/%s','reachable','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','channelAgent','destconnectedlinenum','user:agentconnect','calleridnum','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','md5','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','then','length','getDiff','dialRecallMeTimeout','Agent','run'];(function(_0xa020bb,_0x204738){var _0x7829c1=function(_0x150fc3){while(--_0x150fc3){_0xa020bb['push'](_0xa020bb['shift']());}};_0x7829c1(++_0x204738);}(_0x8d48,0xc6));var _0x88d4=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x8d48[_0x311909];return _0x8d3163;};'use strict';var util=require(_0x88d4('0x0'));var _=require('lodash');var BPromise=require(_0x88d4('0x1'));var uuid=require('uuid');var moment=require(_0x88d4('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x88d4('0x3'));var logger=require(_0x88d4('0x4'))(_0x88d4('0x5'));var loggerAction=require(_0x88d4('0x4'))(_0x88d4('0x6'));var ami=require(_0x88d4('0x7'));var rpcDb=require(_0x88d4('0x8'));var Action=require(_0x88d4('0x9'));var ut=require(_0x88d4('0xa'));config[_0x88d4('0xb')]=_[_0x88d4('0xc')](config[_0x88d4('0xb')],{'host':_0x88d4('0xd'),'port':0x18eb});var io=require(_0x88d4('0xe'))(new Redis(config[_0x88d4('0xb')]));var Sequence=function(){};Sequence['prototype'][_0x88d4('0xf')]=function(_0x390193){this[_0x88d4('0x10')]=this[_0x88d4('0x10')]?this[_0x88d4('0x10')][_0x88d4('0x11')](_0x390193):_0x390193();};function Preview(_0xff6cf3){this[_0x88d4('0x12')]=new Sequence();this[_0x88d4('0x13')]=_0xff6cf3[_0x88d4('0x14')];this[_0x88d4('0x15')]=_0xff6cf3[_0x88d4('0x15')];this['actions']={};this[_0x88d4('0x16')]=_0xff6cf3[_0x88d4('0x16')];this[_0x88d4('0x17')]=0x0;ami['on'](_0x88d4('0x18'),this[_0x88d4('0x19')][_0x88d4('0x1a')](this));ami['on']('hangup',this[_0x88d4('0x1b')][_0x88d4('0x1a')](this));ami['on'](_0x88d4('0x1c'),this[_0x88d4('0x1d')][_0x88d4('0x1a')](this));ami['on'](_0x88d4('0x1e'),this[_0x88d4('0x1f')]['bind'](this));ami['on'](_0x88d4('0x20'),this['syncNewExten']['bind'](this));ami['on'](_0x88d4('0x21'),this[_0x88d4('0x22')]['bind'](this));ami['on'](_0x88d4('0x23'),this[_0x88d4('0x24')][_0x88d4('0x1a')](this));ami['on'](_0x88d4('0x25'),this[_0x88d4('0x26')][_0x88d4('0x1a')](this));this[_0x88d4('0x27')](this[_0x88d4('0x13')]);}function emit(_0x4526b7,_0x1d679a,_0x223e9a){io['to'](_0x4526b7)[_0x88d4('0x28')](_0x1d679a,_0x223e9a);}function emitCampaignPreview(_0xa6f36){if(_0xa6f36[_0x88d4('0x29')]===_0x88d4('0x2a')){var _0x57096a={'id':_0xa6f36['id'],'name':_0xa6f36[_0x88d4('0x2b')],'strategy':_0xa6f36[_0x88d4('0x2c')],'answered':_0xa6f36[_0x88d4('0x2d')],'available':_0xa6f36[_0x88d4('0x2e')],'loggedIn':_0xa6f36[_0x88d4('0x2f')],'pTalking':_0xa6f36[_0x88d4('0x30')],'sumBillable':_0xa6f36[_0x88d4('0x31')],'sumDuration':_0xa6f36[_0x88d4('0x32')],'sumHoldTime':_0xa6f36[_0x88d4('0x33')]||0x0,'talking':_0xa6f36[_0x88d4('0x34')],'total':_0xa6f36[_0x88d4('0x35')],'type':_0xa6f36['type'],'unmanaged':_0xa6f36['unmanaged'],'abandoned':_0xa6f36['abandoned'],'waiting':_0xa6f36['waiting'],'loggedInDb':_0xa6f36[_0x88d4('0x36')],'dialActive':_0xa6f36[_0x88d4('0x37')],'dialMethod':_0xa6f36[_0x88d4('0x38')],'dialOriginateCallerIdName':_0xa6f36['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xa6f36[_0x88d4('0x39')],'dialOriginateTimeout':_0xa6f36['dialOriginateTimeout'],'dialPrefix':_0xa6f36['dialPrefix'],'outboundAnswerAgiCallsDay':_0xa6f36[_0x88d4('0x3a')],'outboundAnswerCallsDay':_0xa6f36[_0x88d4('0x3b')],'outboundBlacklistCallsDay':_0xa6f36['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0xa6f36[_0x88d4('0x3c')],'outboundCongestionCallsDay':_0xa6f36[_0x88d4('0x3d')],'outboundDropCallsDayACS':_0xa6f36[_0x88d4('0x3e')],'outboundDropCallsDayCallersExit':_0xa6f36['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0xa6f36['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0xa6f36[_0x88d4('0x3f')],'outboundNoSuchCallsDay':_0xa6f36[_0x88d4('0x40')],'outboundOriginateFailureCallsDay':_0xa6f36[_0x88d4('0x41')],'outboundReCallsDay':_0xa6f36[_0x88d4('0x42')],'outboundRejectCallsDay':_0xa6f36[_0x88d4('0x43')],'outboundUnknownCallsDay':_0xa6f36[_0x88d4('0x44')],'outboundAbandonedCallsDay':_0xa6f36['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0xa6f36[_0x88d4('0x45')],'predictiveIntervalAvgHoldtime':_0xa6f36['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xa6f36[_0x88d4('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0xa6f36[_0x88d4('0x47')],'predictiveIntervalDroppedCallsTimeout':_0xa6f36[_0x88d4('0x48')],'predictiveIntervalErlangCalls':_0xa6f36[_0x88d4('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0xa6f36[_0x88d4('0x4a')],'predictiveIntervalHitRate':_0xa6f36['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0xa6f36[_0x88d4('0x4b')],'predictiveIntervalPauses':_0xa6f36[_0x88d4('0x4c')],'predictiveIntervalAvailable':_0xa6f36[_0x88d4('0x4d')],'predictiveIntervalTotalCalls':_0xa6f36['predictiveIntervalTotalCalls'],'message':_0xa6f36[_0x88d4('0x4e')],'originated':_0xa6f36['originated'],'erlangCalls':_0xa6f36[_0x88d4('0x4f')],'erlangCallToSecond':_0xa6f36[_0x88d4('0x50')],'erlangAbandonmentRate':_0xa6f36[_0x88d4('0x51')],'erlangBusyFactor':_0xa6f36[_0x88d4('0x52')],'startPredictive':_0xa6f36[_0x88d4('0x53')],'startProgressive':_0xa6f36[_0x88d4('0x54')]};if(_0xa6f36[_0x88d4('0x55')]){_0x57096a['Trunk']={'id':_0xa6f36['Trunk']['id'],'name':_0xa6f36['Trunk'][_0x88d4('0x2b')],'active':_0xa6f36['Trunk'][_0x88d4('0x56')],'callerid':_0xa6f36[_0x88d4('0x55')][_0x88d4('0x57')]};}if(_0xa6f36[_0x88d4('0x58')]){_0x57096a[_0x88d4('0x58')]={'id':_0xa6f36['Interval']['id'],'name':_0xa6f36[_0x88d4('0x58')][_0x88d4('0x2b')]};}var _0x2e370f=md5(JSON[_0x88d4('0x59')](_0x57096a));if(_0xa6f36[_0x88d4('0x5a')]!==_0x2e370f){_0xa6f36[_0x88d4('0x5a')]=_0x2e370f;emit(util[_0x88d4('0x5b')]('voice:queue:%s',_0x57096a['name']),_0x88d4('0x5c'),_0x57096a);}}}function emitVoiceQueueChannelRemove(_0x4e8948){logger[_0x88d4('0x5d')](_0x88d4('0x5e'),JSON[_0x88d4('0x59')](_0x4e8948));emit(util[_0x88d4('0x5b')](_0x88d4('0x5f'),_0x4e8948['name']),_0x88d4('0x60'),_0x4e8948);io['emit'](_0x88d4('0x61'),_0x4e8948);}function notSendMessagesQueue(_0x7f0082){if(_0x7f0082[_0x88d4('0x62')]){if(_0x7f0082[_0x88d4('0x63')]===0x0&&_0x7f0082[_0x88d4('0x30')]===0x0){_0x7f0082[_0x88d4('0x62')]=![];_0x7f0082['available']=0x0;_0x7f0082[_0x88d4('0x64')]=0x0;_0x7f0082[_0x88d4('0x4e')]=_0x88d4('0x65');ut[_0x88d4('0x66')](_0x88d4('0x67'),_0x7f0082[_0x88d4('0x2b')]+_0x88d4('0x68'));}else{_0x7f0082['message']=_0x88d4('0x69');ut[_0x88d4('0x66')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x7f0082[_0x88d4('0x2b')]+_0x88d4('0x6a'));}emitCampaignPreview(_0x7f0082);}}Preview[_0x88d4('0x6b')][_0x88d4('0x27')]=function(){var _0x14fd27=this;setInterval(function(){_0x14fd27['syncCampaigns']();},0x7cf);};Preview[_0x88d4('0x6b')][_0x88d4('0x6c')]=function(){var _0x5dca88=this[_0x88d4('0x13')];this[_0x88d4('0x17')]+=0x1;for(var _0x547c13 in _0x5dca88){if(_0x5dca88[_0x88d4('0x6d')](_0x547c13)&&(_0x5dca88[_0x547c13][_0x88d4('0x38')]===_0x88d4('0x5')||_0x5dca88[_0x547c13][_0x88d4('0x38')]==='booked')&&_0x5dca88[_0x547c13][_0x88d4('0x29')]===_0x88d4('0x2a')){if(this['clockClearZombieChannels']>0x7){this[_0x88d4('0x17')]=0x0;this[_0x88d4('0x6e')]();}}if(_0x5dca88[_0x88d4('0x6d')](_0x547c13)&&_0x5dca88[_0x547c13][_0x88d4('0x38')]===_0x88d4('0x5')&&_0x5dca88[_0x547c13][_0x88d4('0x29')]===_0x88d4('0x2a')){if(_0x5dca88[_0x547c13][_0x88d4('0x37')]){this[_0x88d4('0x6f')](_0x5dca88[_0x547c13]);this[_0x88d4('0x70')](_0x5dca88[_0x547c13]);}else{notSendMessagesQueue(_0x5dca88[_0x547c13]);}}}};Preview['prototype'][_0x88d4('0x71')]=function(_0x2e7e4d){var _0x3d6d72=this;this[_0x88d4('0x12')][_0x88d4('0xf')](function(){if(!_[_0x88d4('0x72')](_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d])){loggerAction[_0x88d4('0x5d')](_0x88d4('0x74'),_0x2e7e4d,_0x88d4('0x75'),_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x76')],_0x88d4('0x77'),JSON[_0x88d4('0x59')](_0x3d6d72[_0x88d4('0x13')][_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d]['queue']][_0x88d4('0x63')]),_0x88d4('0x78'),JSON[_0x88d4('0x59')](_0x3d6d72[_0x88d4('0x13')][_0x3d6d72['actions'][_0x2e7e4d][_0x88d4('0x76')]][_0x88d4('0x30')]),JSON[_0x88d4('0x59')](_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x79')]),JSON['stringify'](_[_0x88d4('0x7a')](_0x3d6d72['actions'][_0x2e7e4d],[_0x88d4('0x7b'),_0x88d4('0x7c'),_0x88d4('0x7d'),_0x88d4('0x7e')])));return ami[_0x88d4('0x7f')]({'action':_0x88d4('0x80'),'channel':_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x81')]})[_0x88d4('0x82')](function(_0x2c87d1){if(_0x2c87d1[_0x88d4('0x4e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d]){ut['updateOriginated'](_0x3d6d72[_0x88d4('0x13')][_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x76')]],'[clearZombieChannel]');if(_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d]['dialAnswer']===!![]){ut[_0x88d4('0x83')](_0x3d6d72['campaignsPreview'][_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d]['queue']],_0x88d4('0x84'));ut[_0x88d4('0x85')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2e7e4d,_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x76')]);}ut[_0x88d4('0x85')](_0x88d4('0x86')+_0x2e7e4d,_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x76')]);delete _0x3d6d72['actions'][_0x2e7e4d];}},0x2328);}});}});};Preview['prototype'][_0x88d4('0x6e')]=function(){var _0x24c44f=this;loggerAction['info'](_0x88d4('0x87'),_[_0x88d4('0x88')](this[_0x88d4('0x73')]));for(var _0x9032d in this[_0x88d4('0x73')]){if(_0x24c44f['actions'][_0x88d4('0x6d')](_0x9032d)){_0x24c44f[_0x88d4('0x71')](_0x9032d);}}};Preview[_0x88d4('0x6b')][_0x88d4('0x70')]=function(_0x4b7596){var _0x57e4fc=this;rpcDb['getContactRecallMe'](_0x4b7596['id'],ut['agentReadyId'](this[_0x88d4('0x16')]))[_0x88d4('0x89')](function(_0x3f812f){if(!_[_0x88d4('0x72')](_0x3f812f)){for(var _0xa45dae=0x0;_0xa45dae<_0x3f812f[_0x88d4('0x8a')];_0xa45dae+=0x1){if(ut[_0x88d4('0x8b')](_0x3f812f[_0xa45dae]['scheduledat'])<_0x4b7596[_0x88d4('0x8c')]*0x3c){if(_0x3f812f[_0xa45dae][_0x88d4('0x8d')]&&!_0x3f812f[_0xa45dae][_0x88d4('0x8d')]['voicePause']){_0x57e4fc[_0x88d4('0x8e')](_0x3f812f[_0xa45dae]['id'])['then'](ut[_0x88d4('0x8f')](_0x88d4('0x90')))[_0x88d4('0x82')](ut[_0x88d4('0x8f')]('[RecallMe]'));}else{rpcDb[_0x88d4('0x91')](_0x3f812f[_0xa45dae]['id']);}}else{var _0x36e780=new Action(_0x3f812f[_0xa45dae],_0x4b7596);_0x36e780[_0x88d4('0x92')]=moment()[_0x88d4('0x5b')](_0x88d4('0x93'));_0x4b7596[_0x88d4('0x42')]+=0x1;ut[_0x88d4('0x94')](_0x36e780,0x17,_0x88d4('0x95'));if(_0x4b7596['dialRecallInQueue']){rpcDb[_0x88d4('0x96')](ut[_0x88d4('0x97')](_0x3f812f[_0xa45dae]));rpcDb[_0x88d4('0x98')](_0x36e780,_0x88d4('0x99'));}else{ut[_0x88d4('0x94')](_0x36e780,0x16,'RecallFailedTimeout');rpcDb[_0x88d4('0x98')](_0x36e780,_0x88d4('0x9a'));rpcDb[_0x88d4('0x9b')](_0x36e780,_0x88d4('0x9a'));}}}}})[_0x88d4('0x82')](ut[_0x88d4('0x8f')](_0x88d4('0x9c')));};Preview[_0x88d4('0x6b')][_0x88d4('0x6f')]=function(_0x3c6729){_0x3c6729[_0x88d4('0x62')]=!![];if(ut[_0x88d4('0x9d')](_0x3c6729['loggedIn'])){_0x3c6729['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x88d4('0x9e')](_0x3c6729[_0x88d4('0x37')])){_0x3c6729[_0x88d4('0x4e')]=_0x88d4('0x65');}else if(!this[_0x88d4('0x9f')](_0x3c6729['Trunk'])){if(!this[_0x88d4('0x9f')](_0x3c6729[_0x88d4('0xa0')])){_0x3c6729[_0x88d4('0x4e')]=_0x88d4('0xa1');}else{_0x3c6729['message']='ACTIVE';}}else{_0x3c6729[_0x88d4('0x4e')]=_0x88d4('0xa2');}emitCampaignPreview(_0x3c6729);};Preview[_0x88d4('0x6b')][_0x88d4('0xa3')]=function(_0x42018b,_0x58553e,_0xaeb081){var _0x11f613=this;var _0x2a0e00=this[_0x88d4('0x73')][_0x58553e];var _0x2b3607=this[_0x88d4('0x13')][_0x2a0e00[_0x88d4('0x76')]];var _0x4f0354;if(_0x2b3607){switch(_0xaeb081){case'1':_0x2b3607[_0x88d4('0x40')]+=0x1;_0x2a0e00[_0x88d4('0xa4')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x0,_0x88d4('0xa7'));ami[_0x88d4('0x28')](_0x88d4('0xa8'),ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xaa')));rpcDb[_0x88d4('0x98')](_0x2a0e00,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0xf,'Global');rpcDb['createCustomerFinal'](_0x4f0354,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x2a0e00[_0x88d4('0xa4')]>=_0x2b3607[_0x88d4('0xad')]){rpcDb[_0x88d4('0x9b')](_0x2a0e00,_0x88d4('0xae'));}else{rpcDb['rescheduleContact'](ut[_0x88d4('0xaf')](_0x2a0e00,'countnosuchnumberretry',_0x2b3607['dialNoSuchNumberRetryFrequency']),_0x2a0e00[_0x88d4('0xb0')],_0x2a0e00['activeContact']);}}delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xb1')]];break;case _0x88d4('0xb2'):var _0x6bb40e=moment()[_0x88d4('0x5b')](_0x88d4('0x93'));_0x2a0e00[_0x88d4('0xb3')]=_0x6bb40e;_0x2a0e00[_0x88d4('0xb4')]=_0x6bb40e;_0x2a0e00[_0x88d4('0x79')]=!![];_0x2b3607[_0x88d4('0x30')]+=0x1;logger[_0x88d4('0x5d')]('[syncHangup][talking][increment]',_0x2a0e00[_0x88d4('0xb5')],_0x88d4('0xb6'),_0x2b3607[_0x88d4('0x2b')],'pTalking:\x20',_0x2b3607[_0x88d4('0x30')]);ami[_0x88d4('0x28')](_0x88d4('0xb7'),ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xb8'),this['campaignsPreview'][_0x2a0e00[_0x88d4('0x76')]]));if(_0x2b3607[_0x88d4('0xb9')]){ami[_0x88d4('0x28')](_0x88d4('0xba'),ut[_0x88d4('0xbb')](_0x2a0e00));}break;case'16':ami[_0x88d4('0x28')](_0x88d4('0xbc'),ut['buildObj'](_0x2a0e00,_0x88d4('0xbd'),this[_0x88d4('0x13')][_0x2a0e00['queue']]));emitVoiceQueueChannelRemove(ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xbd')));_0x2b3607[_0x88d4('0x3b')]+=0x1;_0x2b3607[_0x88d4('0x35')]+=0x1;_0x2b3607[_0x88d4('0x2d')]+=0x1;ut[_0x88d4('0x83')](_0x2b3607,'[16]');_0x2a0e00['countglobal']=ut['totalGlobal'](_0x2a0e00);ut['logCustomer'](_0x2a0e00,0x4,'Answer');rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xbe'));rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x88d4('0xbf')](_0x2a0e00);_0x2b3607['sumDuration']+=_0x2a0e00['talktime'];_0x2b3607[_0x88d4('0x31')]+=_0x2a0e00[_0x88d4('0xc0')];logger[_0x88d4('0x5d')]('[syncHangup][talking][decrement]',_0x2a0e00[_0x88d4('0xb5')],_0x88d4('0xb6'),_0x2b3607[_0x88d4('0x2b')],_0x88d4('0x78'),_0x2b3607[_0x88d4('0x30')]);delete this['actions'][_0x42018b[_0x88d4('0xb1')]];break;case _0x88d4('0xc1'):_0x2b3607[_0x88d4('0x3c')]+=0x1;_0x2a0e00[_0x88d4('0xc2')]+=0x1;_0x2a0e00['countglobal']=ut['totalGlobal'](_0x2a0e00);ut['logCustomer'](_0x2a0e00,0x5,_0x88d4('0xc3'));ami[_0x88d4('0x28')](_0x88d4('0xc4'),ut['buildObj'](_0x2a0e00,_0x88d4('0xc5')));rpcDb[_0x88d4('0x98')](_0x2a0e00,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xc7'));}else{if(_0x2a0e00[_0x88d4('0xc2')]>=_0x2b3607[_0x88d4('0xc8')]){rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x88d4('0xc9')](ut[_0x88d4('0xaf')](_0x2a0e00,_0x88d4('0xc2'),_0x2b3607[_0x88d4('0xca')]),_0x2a0e00['unlockAgent'],_0x2a0e00[_0x88d4('0xcb')]);}}break;case _0x88d4('0xcc'):_0x2b3607[_0x88d4('0x3f')]+=0x1;_0x2a0e00[_0x88d4('0xcd')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut['totalGlobal'](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x3,_0x88d4('0xce'));ami[_0x88d4('0x28')](_0x88d4('0xcf'),ut[_0x88d4('0xa9')](_0x2a0e00,'noanswer'));rpcDb[_0x88d4('0x98')](_0x2a0e00,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut['cloneAction'](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xd0'));}else{if(_0x2a0e00['countnoanswerretry']>=_0x2b3607['dialNoAnswerMaxRetry']){rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x88d4('0xc9')](ut['scheduledAt'](_0x2a0e00,_0x88d4('0xcd'),_0x2b3607[_0x88d4('0xd1')]),_0x2a0e00['unlockAgent'],_0x2a0e00['activeContact']);}}break;case _0x88d4('0xd2'):_0x2b3607[_0x88d4('0x3d')]+=0x1;_0x2a0e00[_0x88d4('0xd3')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x8,_0x88d4('0xd4'));ami[_0x88d4('0x28')]('custom:agentcongestion',ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xd5')));rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xd6'));if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xd7'));}else{if(_0x2a0e00['countcongestionretry']>=_0x2b3607[_0x88d4('0xd8')]){rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0x88d4('0xaf')](_0x2a0e00,_0x88d4('0xd3'),_0x2b3607[_0x88d4('0xca')]),_0x2a0e00[_0x88d4('0xb0')],_0x2a0e00[_0x88d4('0xcb')]);}}break;case _0x88d4('0xd9'):_0x2b3607[_0x88d4('0x43')]+=0x1;_0x2a0e00[_0x88d4('0xda')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x14,'AgentReject');ami[_0x88d4('0x28')]('custom:agentreject',ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xdb')));rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xdc'));if(ut['totalGlobal'](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0x14,_0x88d4('0xdd'));rpcDb['createCustomerFinal'](_0x4f0354,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x2a0e00[_0x88d4('0xda')]>=_0x2b3607[_0x88d4('0xde')]){rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x88d4('0xc9')](ut[_0x88d4('0xaf')](_0x2a0e00,_0x88d4('0xda'),_0x2b3607[_0x88d4('0xdf')]),_0x2a0e00[_0x88d4('0xb0')],_0x2a0e00['activeContact']);}}break;case _0x88d4('0xe0'):_0x2b3607[_0x88d4('0xe1')]+=0x1;_0x2a0e00[_0x88d4('0xe2')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut['logCustomer'](_0x2a0e00,0xb,_0x88d4('0xe3'));rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xe4'));if(ut['totalGlobal'](_0x2a0e00)>=_0x2b3607['dialGlobalMaxRetry']){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xe4'));}else{if(_0x2a0e00[_0x88d4('0xe5')]>=_0x2b3607[_0x88d4('0xe6')]){rpcDb[_0x88d4('0x9b')](_0x2a0e00,_0x88d4('0xe4'));}else{rpcDb[_0x88d4('0xc9')](ut[_0x88d4('0xaf')](_0x2a0e00,_0x88d4('0xe2'),_0x2b3607[_0x88d4('0xe7')]),_0x2a0e00[_0x88d4('0xb0')],_0x2a0e00[_0x88d4('0xcb')]);}}break;case'18':_0x2b3607[_0x88d4('0x44')]+=0x1;_0x2a0e00[_0x88d4('0xe8')]+=0x1;_0x2a0e00['countglobal']=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x12,_0x42018b[_0x88d4('0xe9')]||_0x42018b[_0x88d4('0xea')]);ami['emit'](_0x88d4('0xeb'),ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xec')));rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xed'));if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607['dialGlobalMaxRetry']){_0x4f0354=ut['cloneAction'](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xed'));}else{rpcDb[_0x88d4('0x9b')](_0x2a0e00,_0x88d4('0xed'));}delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xb1')]];break;case'19':_0x2b3607[_0x88d4('0x44')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x13,_0x42018b[_0x88d4('0xe9')]||_0x42018b['dialstatus']);ami[_0x88d4('0x28')](_0x88d4('0xeb'),ut['buildObj'](_0x2a0e00,'amd'));rpcDb['createCustomerHistory'](_0x2a0e00,_0x88d4('0xee'));if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut['cloneAction'](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xee'));}else{rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][machine]');}delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xb1')]];break;default:if(_0x2a0e00[_0x88d4('0x79')]){ut['decrementTalkink'](_0x2b3607,_0x88d4('0xef'));ut[_0x88d4('0x85')](_0x88d4('0xf0')+_0x2b3607[_0x88d4('0x2b')],_0x42018b);}_0x2b3607[_0x88d4('0x44')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0xc,_0x42018b[_0x88d4('0xe9')]||_0x42018b[_0x88d4('0xea')]);rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xf1'));if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0xf,'Global');rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xf2'));}else{rpcDb['createCustomerFinal'](_0x2a0e00,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xb1')]];}if(!(_0x2a0e00[_0x88d4('0x79')]&&_0xaeb081==='16')){ut[_0x88d4('0xf3')](_0x2b3607,_0x88d4('0xf4'));logger[_0x88d4('0x5d')](_0x88d4('0xf5'),_0x2a0e00[_0x88d4('0xb5')],_0x88d4('0xb6'),_0x2b3607['name'],_0x88d4('0x77'),_0x2b3607[_0x88d4('0x63')]);}if(_0xaeb081!==_0x88d4('0xb2')){delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xb1')]];delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xf6')]];}}};Preview[_0x88d4('0x6b')][_0x88d4('0xf7')]=function(_0x35d408,_0xc00d78,_0x521a3c){if(_[_0x88d4('0xf8')](_0xc00d78)&&_0x88d4('0xf9')!==typeof _0xc00d78){return;}if(_[_0x88d4('0xf8')](_0x521a3c)&&_0x88d4('0xf9')!==typeof _0x521a3c){return;}switch(_0x521a3c[_0x88d4('0xfa')]){case'0':ut['logAgent'](_0x35d408,0x0,_0x88d4('0xa7'));rpcDb[_0x88d4('0xfb')](_0x35d408,_0x88d4('0xfc'));break;case'3':ut['logAgent'](_0x35d408,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x35d408,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x88d4('0xfd')](_0x35d408,0x5,'Busy');rpcDb['createAgentHistory'](_0x35d408,_0x88d4('0xfe'));break;case'8':ut['logAgent'](_0x35d408,0x8,_0x88d4('0xd4'));rpcDb['createAgentHistory'](_0x35d408,_0x88d4('0xff'));break;case'22':ut['logAgent'](_0x35d408,0x16,'AnswerAGI');rpcDb[_0x88d4('0xfb')](_0x35d408,_0x88d4('0x100'));break;default:ut[_0x88d4('0xfd')](_0x35d408,0xc,_0x521a3c[_0x88d4('0xfa')]);rpcDb[_0x88d4('0xfb')](_0x35d408,'[callProgressDetectingAgent][logCongestion]');}ut[_0x88d4('0xf3')](_0xc00d78,_0x88d4('0x101'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x35d408[_0x88d4('0xb5')],'\x20Queue',_0xc00d78['name'],_0x88d4('0x77'),_0xc00d78[_0x88d4('0x63')]);delete this[_0x88d4('0x73')][_0x35d408[_0x88d4('0xb5')]];};Preview['prototype'][_0x88d4('0x102')]=function(_0x35edd3,_0x4335da,_0x40363b,_0x15d101,_0x526735){var _0x274eba=this;return new BPromise(function(_0x45368c,_0x47c45e){if(_[_0x88d4('0x72')](_0x4335da)||_['isNil'](_0x4335da['Contact'])||_[_0x88d4('0x72')](_0x4335da[_0x88d4('0x103')][_0x88d4('0x104')])||_[_0x88d4('0x72')](_0x4335da[_0x88d4('0x7d')])){_0x47c45e(ut['message']('Contact\x20is\x20undefined',_0x15d101,_0x526735));return;}var _0x21991d=uuid['v4']();var _0x393bfc=_0x274eba[_0x88d4('0x13')][_0x4335da[_0x88d4('0x75')][_0x88d4('0x2b')]];var _0x202a68=_0x40363b?_0x274eba[_0x88d4('0x16')][_0x40363b]['id']:undefined;_0x274eba[_0x88d4('0x73')][_0x21991d]=new Action(_0x4335da,_0x393bfc,_0x21991d,_0x40363b,_0x202a68);var _0x295d4e=_0x274eba['actions'][_0x21991d];_0x295d4e['unlockAgent']=_0x15d101;_0x295d4e[_0x88d4('0xcb')]=_0x526735;_0x295d4e[_0x88d4('0x105')]=_0x40363b;if(_[_0x88d4('0x106')](_0x35edd3)){_0x274eba[_0x88d4('0x107')](_0x295d4e,_0x393bfc,_0x4335da,_0x40363b)[_0x88d4('0x89')](function(_0xf3feef){logger[_0x88d4('0x5d')]('[Preview][execCall][success]',_0x88d4('0x108')+_0x295d4e[_0x88d4('0x76')]+_0x88d4('0x109')+_0x295d4e[_0x88d4('0x10a')],JSON['stringify'](_0xf3feef));ami['emit']('custom:agentcalled',ut[_0x88d4('0xa9')](_0x295d4e,_0x88d4('0x10b'),_0x274eba['campaignsPreview'][_0x295d4e[_0x88d4('0x76')]]));_0x45368c(ut[_0x88d4('0x4e')](_0x88d4('0x10c')));})['catch'](function(_0x4beb9b){ut[_0x88d4('0x66')](_0x88d4('0x10d'),_0x4beb9b);_0x47c45e(ut[_0x88d4('0x4e')]('Call\x20failed',_0x15d101,_0x526735));});}else{_0x393bfc[_0x88d4('0x10e')]+=0x1;ut['logBlacklist'](_0x295d4e);rpcDb[_0x88d4('0x10f')](_0x295d4e,_0x88d4('0x110'));delete _0x274eba[_0x88d4('0x73')][_0x21991d];_0x47c45e(ut[_0x88d4('0x4e')]('Contact\x20in\x20black\x20List',_0x15d101,_0x526735));}});};Preview[_0x88d4('0x6b')][_0x88d4('0x9f')]=function(_0x371710){return!_[_0x88d4('0x72')](_0x371710)&&!_[_0x88d4('0x72')](_0x371710[_0x88d4('0x2b')])&&!_[_0x88d4('0x72')](_0x371710[_0x88d4('0x56')])&&_0x371710['active']&&!_[_0x88d4('0x72')](this[_0x88d4('0x15')][util[_0x88d4('0x5b')](_0x88d4('0x111'),_0x371710[_0x88d4('0x2b')])])&&!_[_0x88d4('0x72')](this['trunks'][util[_0x88d4('0x5b')]('SIP/%s',_0x371710[_0x88d4('0x2b')])][_0x88d4('0x80')])&&(this[_0x88d4('0x15')][util[_0x88d4('0x5b')](_0x88d4('0x111'),_0x371710[_0x88d4('0x2b')])]['status']===_0x88d4('0x112')||this[_0x88d4('0x15')][util['format'](_0x88d4('0x111'),_0x371710['name'])]['status']==='unmonitored');};Preview[_0x88d4('0x6b')]['run']=function(_0x2bbfbe,_0x20ffda){var _0x5b1798=this;return new BPromise(function(_0x2b2a8c,_0x17f3b2){_0x5b1798['execRun'](_0x2bbfbe,_0x20ffda)[_0x88d4('0x89')](function(_0x22f1ab){_0x2b2a8c(_[_0x88d4('0x7a')](_0x22f1ab,[_0x88d4('0x4e')]));})[_0x88d4('0x82')](function(_0x59cef7){if(_0x59cef7[_0x88d4('0x113')]){rpcDb[_0x88d4('0x114')](_0x2bbfbe);}if(_0x59cef7[_0x88d4('0x56')]){rpcDb[_0x88d4('0x91')](_0x2bbfbe);}_0x17f3b2(_[_0x88d4('0x7a')](_0x59cef7,[_0x88d4('0x4e')]));});});};Preview[_0x88d4('0x6b')][_0x88d4('0x115')]=function(_0x5edbbb,_0x3ab0ed){var _0x18ce0b=this;return new BPromise(function(_0xb7d754,_0x2023a4){var _0x15c1a4,_0x5efb73;rpcDb[_0x88d4('0x116')](_0x5edbbb)[_0x88d4('0x89')](function(_0x4d8bdc){if(!_['isNil'](_0x4d8bdc[0x0])){_0x5efb73=_0x4d8bdc[0x0][_0x88d4('0x117')]?![]:!![];_0x15c1a4=_0x4d8bdc[0x0][_0x88d4('0x117')]?!![]:![];_0x15c1a4=_0x3ab0ed?!![]:_0x15c1a4;}var _0x501e53=_0x18ce0b[_0x88d4('0x118')](_0x4d8bdc);if(_0x501e53[_0x88d4('0x119')]){rpcDb['checkIsBlackList'](_[_0x88d4('0x7a')](_0x4d8bdc[0x0],[_0x88d4('0x7d'),_0x88d4('0x11a')]))['then'](function(_0x29b706){_0x18ce0b[_0x88d4('0x102')](_0x29b706,_0x4d8bdc[0x0],_0x3ab0ed,_0x5efb73,_0x15c1a4)['then'](function(_0x48ac4a){_0xb7d754(_0x48ac4a);})['catch'](function(_0x190ce0){_0x2023a4(_0x190ce0);});})[_0x88d4('0x82')](function(_0x232071){ut[_0x88d4('0x66')](_0x88d4('0x11b'),_0x232071);_0x2023a4(ut[_0x88d4('0x4e')](_0x88d4('0x11c'),_0x5efb73,_0x15c1a4));});}else{_0x2023a4(ut[_0x88d4('0x4e')](_0x501e53['message'],_0x5efb73,_0x15c1a4));}})[_0x88d4('0x82')](function(_0x2fe9ce){ut[_0x88d4('0x66')]('[Preview][getContactPreview]',_0x2fe9ce);_0x2023a4(ut['message'](_0x88d4('0x11c'),![],!![]));});});};Preview['prototype'][_0x88d4('0x118')]=function(_0x2a78bc){if(_[_0x88d4('0x72')](_0x2a78bc)||_[_0x88d4('0x106')](_0x2a78bc)||!_[_0x88d4('0x72')](_0x2a78bc[0x0][_0x88d4('0x8d')])&&_[_0x88d4('0x72')](_0x2a78bc[0x0]['Agent']['name'])){ut[_0x88d4('0x66')](_0x88d4('0x11d'),_0x2a78bc);return{'isValid':![],'message':_0x88d4('0x11e')};}var _0x18ad46=this[_0x88d4('0x13')][_0x2a78bc[0x0]['Queue']['name']];_0x18ad46['message']=_0x88d4('0xa2');if(_[_0x88d4('0x72')](_0x18ad46)){ut[_0x88d4('0x66')](_0x88d4('0x11f'),_0x18ad46);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x88d4('0x9f')](_0x18ad46[_0x88d4('0x55')])){ut[_0x88d4('0x66')](_0x88d4('0x120'),_0x88d4('0x121')+_0x18ad46['name']+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x88d4('0x9f')](_0x18ad46['TrunkBackup'])){ut[_0x88d4('0x66')](_0x88d4('0x120'),_0x18ad46[_0x88d4('0x2b')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x88d4('0x122')};}}if(!ut[_0x88d4('0x9e')](_0x18ad46[_0x88d4('0x37')])){ut[_0x88d4('0x66')](_0x88d4('0x123'),_0x18ad46[_0x88d4('0x2b')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x88d4('0x121')+_0x18ad46['name']+_0x88d4('0x124')};}return{'isValid':!![],'message':_0x88d4('0x125')};};Preview[_0x88d4('0x6b')][_0x88d4('0x107')]=function(_0x2082a7,_0x1ecc98,_0x113136,_0x21c89c){var _0x3f7042=this;return new BPromise(function(_0x524d79,_0x24dcf2){var _0x429e23=_0x2082a7[_0x88d4('0xb5')];var _0x5f1c5d=_0x3f7042['isTrunkReachable'](_0x1ecc98[_0x88d4('0x55')])?util[_0x88d4('0x5b')](_0x88d4('0x126'),_0x1ecc98[_0x88d4('0x55')][_0x88d4('0x2b')],_['isNil'](_0x1ecc98[_0x88d4('0x127')])?'':_0x1ecc98['dialPrefix']['trim']()||'',_0x1ecc98[_0x88d4('0x128')]>0x0?_0x113136['Contact']['phone'][_0x88d4('0x129')](_0x1ecc98[_0x88d4('0x128')]):_0x113136[_0x88d4('0x103')][_0x88d4('0x104')]):util['format'](_0x88d4('0x126'),_[_0x88d4('0x72')](_0x1ecc98[_0x88d4('0xa0')])?_0x1ecc98[_0x88d4('0x55')][_0x88d4('0x2b')]:_0x1ecc98[_0x88d4('0xa0')][_0x88d4('0x2b')],_[_0x88d4('0x72')](_0x1ecc98[_0x88d4('0x127')])?'':_0x1ecc98['dialPrefix'][_0x88d4('0x12a')]()||'',_0x1ecc98['dialCutDigit']>0x0?_0x113136[_0x88d4('0x103')][_0x88d4('0x104')][_0x88d4('0x129')](_0x1ecc98[_0x88d4('0x128')]):_0x113136[_0x88d4('0x103')][_0x88d4('0x104')]);var _0x2a7002=_0x3f7042[_0x88d4('0x9f')](_0x1ecc98[_0x88d4('0x55')])?ut['getCallerId'](_0x1ecc98[_0x88d4('0x55')][_0x88d4('0x57')],_0x1ecc98['dialOriginateCallerIdName'],_0x1ecc98[_0x88d4('0x12b')]>0x0?ut[_0x88d4('0x12c')](_0x1ecc98['dialOriginateCallerIdNumber'],_0x1ecc98['dialRandomLastDigitCallerIdNumber']):_0x1ecc98[_0x88d4('0x39')]):ut[_0x88d4('0x12d')](_[_0x88d4('0x72')](_0x1ecc98[_0x88d4('0xa0')])?_0x1ecc98[_0x88d4('0x55')][_0x88d4('0x57')]:_0x1ecc98[_0x88d4('0xa0')][_0x88d4('0x57')],_0x1ecc98[_0x88d4('0x12e')],_0x1ecc98['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x1ecc98[_0x88d4('0x39')],_0x1ecc98[_0x88d4('0x12b')]):_0x1ecc98[_0x88d4('0x39')]);if(_0x2a7002){_0x2082a7[_0x88d4('0x12f')]=ut[_0x88d4('0x130')](_0x2a7002);_0x2082a7[_0x88d4('0x131')]=ut[_0x88d4('0x132')](_0x2a7002);}var _0x3d7561=ut['addVariables'](_0x1ecc98,_0x113136,_0x5f1c5d,_0x2a7002,_0x429e23,_0x2082a7);_[_0x88d4('0x133')](_0x2082a7,ut[_0x88d4('0x134')](_0x3d7561));_0x2082a7[_0x88d4('0x92')]=moment()[_0x88d4('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x88d4('0x7f')](ut['variablesAction'](_0x2082a7,_0x1ecc98,_0x3d7561,_0x2082a7[_0x88d4('0xcb')],_0x21c89c))[_0x88d4('0x89')](function(_0x469633){var _0x5157f0=_0x2082a7[_0x88d4('0x135')];if(!_[_0x88d4('0x72')](_0x5157f0)){if(!_['isNil'](_0x3f7042[_0x88d4('0x16')][_0x5157f0])){_0x3f7042[_0x88d4('0x16')][_0x5157f0][_0x88d4('0x136')]=_0x2082a7['calleridnum'];emit(util[_0x88d4('0x5b')]('user:%s',_0x3f7042[_0x88d4('0x16')][_0x5157f0][_0x88d4('0x2b')]),_0x88d4('0x137'),{'destaccountcode':_0x3f7042[_0x88d4('0x16')][_0x5157f0]['accountcode'],'destconnectedlinenum':_0x2082a7[_0x88d4('0x138')]});}}_0x1ecc98[_0x88d4('0x63')]+=0x1;logger['info'](_0x88d4('0x139'),_0x429e23,'\x20Queue',_0x1ecc98[_0x88d4('0x2b')],_0x88d4('0x77'),_0x1ecc98['originated']);_0x524d79(_0x469633);})[_0x88d4('0x82')](function(_0x2d0f76){ut[_0x88d4('0xfd')](_0x2082a7,0xe,_0x88d4('0x13a'));rpcDb['createAgentHistory'](_0x2082a7,_0x88d4('0x13b'));_0x24dcf2(_0x2d0f76);});});};Preview[_0x88d4('0x6b')]['syncNewExten']=function(_0x179afe){if(this['actions'][_0x179afe[_0x88d4('0xb1')]]){this[_0x88d4('0x73')][_0x179afe[_0x88d4('0xb1')]][_0x88d4('0x81')]=_0x179afe['channel'];}};Preview[_0x88d4('0x6b')]['syncOriginateResponse']=function(_0x48cbc4){var _0x160ace=this;var _0x30abb3=this[_0x88d4('0x73')][_0x48cbc4[_0x88d4('0x13c')]];if(_0x30abb3){if(_0x30abb3[_0x88d4('0x105')]&&this[_0x88d4('0x16')][_0x30abb3[_0x88d4('0x105')]]){ut[_0x88d4('0x13d')](_0x30abb3,this['agents'][_0x30abb3[_0x88d4('0x105')]][_0x88d4('0x2b')],this[_0x88d4('0x16')][_0x30abb3[_0x88d4('0x105')]]['id']);}var _0x56b3c5=_['clone'](_0x30abb3);_0x56b3c5['responsetime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x5d2fdb=_0x160ace[_0x88d4('0x13')][_0x30abb3[_0x88d4('0x76')]];if(ut[_0x88d4('0x13e')](_0x48cbc4[_0x88d4('0x13f')])){if(_0x30abb3[_0x88d4('0xb0')]){rpcDb[_0x88d4('0x114')](_0x30abb3[_0x88d4('0x10a')]);}if(_0x30abb3[_0x88d4('0xcb')]){rpcDb['disableContact'](_0x30abb3['idContact']);}ami['emit']('custom:agentringnoanswer',ut[_0x88d4('0xa9')](_0x30abb3,'rejected',this['campaignsPreview'][_0x30abb3[_0x88d4('0x76')]]));this[_0x88d4('0xf7')](_0x56b3c5,_0x5d2fdb,_0x48cbc4);}else{_0x30abb3[_0x88d4('0x92')]=moment()[_0x88d4('0x5b')](_0x88d4('0x93'));ut[_0x88d4('0xfd')](_0x56b3c5,0x4,_0x88d4('0x140'));rpcDb[_0x88d4('0xfb')](_0x56b3c5,_0x88d4('0x141'));}}};Preview['prototype']['syncHangup']=function(_0xbea116){var _0x3d2402=this;var _0x3fa752=this[_0x88d4('0x73')][_0xbea116[_0x88d4('0xb1')]];var _0x5e7a37;if(_0x3fa752){_0x5e7a37=this['campaignsPreview'][_0x3fa752[_0x88d4('0x76')]];logger[_0x88d4('0x5d')](_0x88d4('0x142'),_0xbea116[_0x88d4('0xb1')],_0x88d4('0xb6'),_0x5e7a37[_0x88d4('0x2b')],_0x88d4('0x78'),_0x5e7a37[_0x88d4('0x30')]);}if(this[_0x88d4('0x73')][_0xbea116['linkedid']]&&_0xbea116['linkedid']!==_0xbea116['uniqueid']){if(_0xbea116[_0x88d4('0x143')]==='16'&&this['actions'][_0xbea116['linkedid']]['dialAnswer']){this['callProgressDetectingCustomer'](_0xbea116,_0xbea116[_0x88d4('0xb1')],_0xbea116['cause']);}else if(this[_0x88d4('0x73')][_0xbea116[_0x88d4('0xb1')]]['dialAnswer']){logger[_0x88d4('0x5d')](_0x88d4('0x144'),_0xbea116[_0x88d4('0xb1')],_0xbea116['cause'],_0x88d4('0xb6'),_0x5e7a37['name'],'pTalking:\x20',_0x5e7a37['pTalking']);this[_0x88d4('0xa3')](_0xbea116,_0xbea116[_0x88d4('0xb1')],_0xbea116[_0x88d4('0x143')]);}}else if(_0x3fa752&&_[_0x88d4('0x72')](_0x3fa752['statedesc'])&&_0x5e7a37[_0x88d4('0x145')]&&_0xbea116[_0x88d4('0xb1')]===_0xbea116[_0x88d4('0xb5')]&&_['isNil'](_0xbea116[_0x88d4('0xfa')])&&_0xbea116['cause']==='16'&&_0xbea116[_0x88d4('0x146')]==='6'&&_[_0x88d4('0xf8')](_0x3fa752[_0x88d4('0x147')])){if(_0x3fa752[_0x88d4('0xb0')]){rpcDb['unlockContact'](_0x3fa752[_0x88d4('0x10a')]);}if(_0x3fa752['activeContact']){rpcDb['disableContact'](_0x3fa752['idContact']);}_0xbea116[_0x88d4('0xfa')]='22';this[_0x88d4('0xf7')](_0x3fa752,_0x5e7a37,_0xbea116);}else if(_0x3fa752&&_0x3fa752[_0x88d4('0x147')]){if(_0xbea116['cause']==='16'&&this['actions'][_0xbea116[_0x88d4('0xb1')]]['dialAnswer']){logger[_0x88d4('0x5d')](_0x88d4('0x148'),_0xbea116[_0x88d4('0xb1')],_0xbea116[_0x88d4('0x143')],_0x88d4('0xb6'),_0x5e7a37['name'],_0x88d4('0x78'),_0x5e7a37[_0x88d4('0x30')]);this[_0x88d4('0xa3')](_0xbea116,_0xbea116[_0x88d4('0xb1')],_0xbea116[_0x88d4('0x143')]);}else if(this[_0x88d4('0x73')][_0xbea116[_0x88d4('0xb1')]][_0x88d4('0x79')]){logger[_0x88d4('0x5d')](_0x88d4('0x144'),_0xbea116[_0x88d4('0xb1')],_0xbea116[_0x88d4('0x143')],'\x20Queue',_0x5e7a37[_0x88d4('0x2b')],_0x88d4('0x78'),_0x5e7a37[_0x88d4('0x30')]);this[_0x88d4('0xa3')](_0xbea116,_0xbea116['linkedid'],_0xbea116[_0x88d4('0x143')]);}}};Preview[_0x88d4('0x6b')][_0x88d4('0x1f')]=function(_0xbeab44){if(this[_0x88d4('0x73')][_0xbeab44[_0x88d4('0xf6')]]&&_0xbeab44[_0x88d4('0xf6')]!==_0xbeab44[_0x88d4('0x149')]){this['callProgressDetectingCustomer'](_0xbeab44,_0xbeab44['destlinkedid'],_0xbeab44[_0x88d4('0xea')]);}};Preview[_0x88d4('0x6b')][_0x88d4('0x1d')]=function(_0x4247a6){if(this[_0x88d4('0x73')][_0x4247a6[_0x88d4('0xb1')]]&&_0x4247a6[_0x88d4('0xb1')]!==_0x4247a6[_0x88d4('0xb5')]&&!this[_0x88d4('0x73')][_0x4247a6[_0x88d4('0xb1')]]['dialAnswer']){if(_0x4247a6[_0x88d4('0x143')]==='1'){this[_0x88d4('0xa3')](_0x4247a6,_0x4247a6['linkedid'],_0x4247a6[_0x88d4('0x143')]);}}};Preview[_0x88d4('0x6b')]['addVariable']=function(_0x356fee,_0x1b4f2e,_0x4f6225){if(this[_0x88d4('0x73')][_0x356fee]){if(_[_0x88d4('0x72')](this[_0x88d4('0x73')][_0x356fee][_0x88d4('0x14a')])){this[_0x88d4('0x73')][_0x356fee][_0x88d4('0x14a')]={};}this[_0x88d4('0x73')][_0x356fee][_0x88d4('0x14a')][_0x1b4f2e]=_0x4f6225;}};Preview['prototype'][_0x88d4('0x22')]=function(_0x59064a){try{if(!_[_0x88d4('0x72')](_0x59064a)){if(ut[_0x88d4('0x14b')](_[_0x88d4('0x14c')](_0x59064a[_0x88d4('0x14d')])[0x0])){this[_0x88d4('0x14e')](_0x59064a[_0x88d4('0xb5')],_['keys'](_0x59064a[_0x88d4('0x14d')])[0x0],_0x59064a[_0x88d4('0x14f')]);}}}catch(_0x3928de){logger[_0x88d4('0x150')](_0x88d4('0x151'),util['inspect'](_0x3928de,{'showHidden':![],'depth':null}));}};Preview[_0x88d4('0x6b')][_0x88d4('0x24')]=function(_0x402e86){if(_0x402e86){if(this[_0x88d4('0x73')][_0x402e86['transfertargetlinkedid']]){this[_0x88d4('0x73')][_0x402e86[_0x88d4('0x152')]][_0x88d4('0x147')]=!![];}}};Preview['prototype'][_0x88d4('0x26')]=function(_0x17a672){if(_0x17a672){if(this[_0x88d4('0x73')][_0x17a672[_0x88d4('0x153')]]){this[_0x88d4('0x73')][_0x17a672[_0x88d4('0x153')]][_0x88d4('0x147')]=!![];}}};module[_0x88d4('0x154')]=Preview; \ No newline at end of file +var _0xb09d=['outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','clearZombieChannels','dialActive','setMessage','recallMe','clearZombieChannel','enqueue','isNil','info','Queue','queue','stringify','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[action]','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','Agent','voicePause','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','createCustomerFinal','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','countbusyretry','totalGlobal','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','scheduledAt','dialBusyRetryFrequency','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','unmonitored','run','execRun','unlock','disableContact','getContactPreview','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','validateContact','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','campaign\x20Name:\x20','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','Contact','dialCutDigit','phone','substring','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','Action','variablesAction','destconnectedlinenum','calleridnum','user:agentconnect','accountcode','[originated][increment]','OriginateError','logLookAgent','clone','isFailure','response','unlockContact','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','isUndefined','transfer','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','sumBillable','sumDuration','talking','total','unmanaged','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix'];(function(_0x38f355,_0x2dbe8f){var _0xc9fd27=function(_0x3659f6){while(--_0x3659f6){_0x38f355['push'](_0x38f355['shift']());}};_0xc9fd27(++_0x2dbe8f);}(_0xb09d,0x119));var _0xdb09=function(_0x4fbbb7,_0x162a08){_0x4fbbb7=_0x4fbbb7-0x0;var _0x265ce5=_0xb09d[_0x4fbbb7];return _0x265ce5;};'use strict';var util=require('util');var _=require(_0xdb09('0x0'));var BPromise=require(_0xdb09('0x1'));var uuid=require('uuid');var moment=require(_0xdb09('0x2'));var md5=require(_0xdb09('0x3'));var Redis=require(_0xdb09('0x4'));var config=require(_0xdb09('0x5'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xdb09('0x6'))(_0xdb09('0x7'));var ami=require(_0xdb09('0x8'));var rpcDb=require(_0xdb09('0x9'));var Action=require(_0xdb09('0xa'));var ut=require(_0xdb09('0xb'));config[_0xdb09('0xc')]=_[_0xdb09('0xd')](config['redis'],{'host':_0xdb09('0xe'),'port':0x18eb});var io=require(_0xdb09('0xf'))(new Redis(config[_0xdb09('0xc')]));var Sequence=function(){};Sequence[_0xdb09('0x10')]['enqueue']=function(_0x2bc8e0){this[_0xdb09('0x11')]=this[_0xdb09('0x11')]?this['tail']['finally'](_0x2bc8e0):_0x2bc8e0();};function Preview(_0x3a08b7){this[_0xdb09('0x12')]=new Sequence();this[_0xdb09('0x13')]=_0x3a08b7[_0xdb09('0x14')];this[_0xdb09('0x15')]=_0x3a08b7[_0xdb09('0x15')];this[_0xdb09('0x16')]={};this[_0xdb09('0x17')]=_0x3a08b7[_0xdb09('0x17')];this[_0xdb09('0x18')]=0x0;ami['on'](_0xdb09('0x19'),this[_0xdb09('0x1a')][_0xdb09('0x1b')](this));ami['on'](_0xdb09('0x1c'),this[_0xdb09('0x1d')][_0xdb09('0x1b')](this));ami['on'](_0xdb09('0x1e'),this[_0xdb09('0x1f')]['bind'](this));ami['on']('dialend',this['syncDialEnd'][_0xdb09('0x1b')](this));ami['on']('newexten',this[_0xdb09('0x20')]['bind'](this));ami['on'](_0xdb09('0x21'),this[_0xdb09('0x22')][_0xdb09('0x1b')](this));ami['on'](_0xdb09('0x23'),this[_0xdb09('0x24')]['bind'](this));ami['on']('blindtransfer',this[_0xdb09('0x25')][_0xdb09('0x1b')](this));this[_0xdb09('0x26')](this[_0xdb09('0x13')]);}function emit(_0x144550,_0x16c6a2,_0x4803e6){io['to'](_0x144550)[_0xdb09('0x27')](_0x16c6a2,_0x4803e6);}function emitCampaignPreview(_0x27f8c2){if(_0x27f8c2[_0xdb09('0x28')]===_0xdb09('0x29')){var _0xf744a9={'id':_0x27f8c2['id'],'name':_0x27f8c2[_0xdb09('0x2a')],'strategy':_0x27f8c2[_0xdb09('0x2b')],'answered':_0x27f8c2[_0xdb09('0x2c')],'available':_0x27f8c2[_0xdb09('0x2d')],'loggedIn':_0x27f8c2['loggedIn'],'pTalking':_0x27f8c2['pTalking'],'sumBillable':_0x27f8c2[_0xdb09('0x2e')],'sumDuration':_0x27f8c2[_0xdb09('0x2f')],'sumHoldTime':_0x27f8c2['sumHoldTime']||0x0,'talking':_0x27f8c2[_0xdb09('0x30')],'total':_0x27f8c2[_0xdb09('0x31')],'type':_0x27f8c2['type'],'unmanaged':_0x27f8c2[_0xdb09('0x32')],'abandoned':_0x27f8c2['abandoned'],'waiting':_0x27f8c2[_0xdb09('0x33')],'loggedInDb':_0x27f8c2['loggedInDb'],'dialActive':_0x27f8c2['dialActive'],'dialMethod':_0x27f8c2[_0xdb09('0x34')],'dialOriginateCallerIdName':_0x27f8c2[_0xdb09('0x35')],'dialOriginateCallerIdNumber':_0x27f8c2[_0xdb09('0x36')],'dialOriginateTimeout':_0x27f8c2[_0xdb09('0x37')],'dialPrefix':_0x27f8c2[_0xdb09('0x38')],'outboundAnswerAgiCallsDay':_0x27f8c2[_0xdb09('0x39')],'outboundAnswerCallsDay':_0x27f8c2[_0xdb09('0x3a')],'outboundBlacklistCallsDay':_0x27f8c2[_0xdb09('0x3b')],'outboundBusyCallsDay':_0x27f8c2[_0xdb09('0x3c')],'outboundCongestionCallsDay':_0x27f8c2['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x27f8c2[_0xdb09('0x3d')],'outboundDropCallsDayCallersExit':_0x27f8c2[_0xdb09('0x3e')],'outboundDropCallsDayTimeout':_0x27f8c2[_0xdb09('0x3f')],'outboundNoAnswerCallsDay':_0x27f8c2[_0xdb09('0x40')],'outboundNoSuchCallsDay':_0x27f8c2[_0xdb09('0x41')],'outboundOriginateFailureCallsDay':_0x27f8c2['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x27f8c2['outboundReCallsDay'],'outboundRejectCallsDay':_0x27f8c2[_0xdb09('0x42')],'outboundUnknownCallsDay':_0x27f8c2[_0xdb09('0x43')],'outboundAbandonedCallsDay':_0x27f8c2[_0xdb09('0x44')],'predictiveIntervalAnsweredCalls':_0x27f8c2[_0xdb09('0x45')],'predictiveIntervalAvgHoldtime':_0x27f8c2['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x27f8c2[_0xdb09('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x27f8c2[_0xdb09('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x27f8c2[_0xdb09('0x48')],'predictiveIntervalErlangCalls':_0x27f8c2[_0xdb09('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x27f8c2[_0xdb09('0x4a')],'predictiveIntervalHitRate':_0x27f8c2[_0xdb09('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x27f8c2[_0xdb09('0x4c')],'predictiveIntervalPauses':_0x27f8c2[_0xdb09('0x4d')],'predictiveIntervalAvailable':_0x27f8c2[_0xdb09('0x4e')],'predictiveIntervalTotalCalls':_0x27f8c2['predictiveIntervalTotalCalls'],'message':_0x27f8c2[_0xdb09('0x4f')],'originated':_0x27f8c2[_0xdb09('0x50')],'erlangCalls':_0x27f8c2[_0xdb09('0x51')],'erlangCallToSecond':_0x27f8c2['erlangCallToSecond'],'erlangAbandonmentRate':_0x27f8c2[_0xdb09('0x52')],'erlangBusyFactor':_0x27f8c2[_0xdb09('0x53')],'startPredictive':_0x27f8c2[_0xdb09('0x54')],'startProgressive':_0x27f8c2[_0xdb09('0x55')]};if(_0x27f8c2[_0xdb09('0x56')]){_0xf744a9['Trunk']={'id':_0x27f8c2[_0xdb09('0x56')]['id'],'name':_0x27f8c2['Trunk'][_0xdb09('0x2a')],'active':_0x27f8c2[_0xdb09('0x56')][_0xdb09('0x57')],'callerid':_0x27f8c2[_0xdb09('0x56')][_0xdb09('0x58')]};}if(_0x27f8c2[_0xdb09('0x59')]){_0xf744a9[_0xdb09('0x59')]={'id':_0x27f8c2['Interval']['id'],'name':_0x27f8c2[_0xdb09('0x59')]['name']};}var _0xb9dc26=md5(JSON['stringify'](_0xf744a9));if(_0x27f8c2[_0xdb09('0x3')]!==_0xb9dc26){_0x27f8c2[_0xdb09('0x3')]=_0xb9dc26;emit(util[_0xdb09('0x5a')](_0xdb09('0x5b'),_0xf744a9['name']),_0xdb09('0x5c'),_0xf744a9);}}}function emitVoiceQueueChannelRemove(_0x223de6){logger['info'](_0xdb09('0x5d'),JSON['stringify'](_0x223de6));emit(util[_0xdb09('0x5a')](_0xdb09('0x5b'),_0x223de6[_0xdb09('0x2a')]),_0xdb09('0x5e'),_0x223de6);io[_0xdb09('0x27')]('voice_queue_presence:remove',_0x223de6);}function notSendMessagesQueue(_0xe694df){if(_0xe694df[_0xdb09('0x5f')]){if(_0xe694df[_0xdb09('0x50')]===0x0&&_0xe694df[_0xdb09('0x60')]===0x0){_0xe694df[_0xdb09('0x5f')]=![];_0xe694df[_0xdb09('0x2d')]=0x0;_0xe694df['paused']=0x0;_0xe694df[_0xdb09('0x4f')]=_0xdb09('0x61');ut[_0xdb09('0x62')](_0xdb09('0x63'),_0xe694df[_0xdb09('0x2a')]+_0xdb09('0x64'));}else{_0xe694df[_0xdb09('0x4f')]=_0xdb09('0x65');ut[_0xdb09('0x62')](_0xdb09('0x63'),_0xe694df[_0xdb09('0x2a')]+_0xdb09('0x66'));}emitCampaignPreview(_0xe694df);}}Preview[_0xdb09('0x10')][_0xdb09('0x26')]=function(){var _0x52f149=this;setInterval(function(){_0x52f149[_0xdb09('0x67')]();},0x7cf);};Preview[_0xdb09('0x10')][_0xdb09('0x67')]=function(){var _0x5ee721=this[_0xdb09('0x13')];this['clockClearZombieChannels']+=0x1;for(var _0x18bc38 in _0x5ee721){if(_0x5ee721[_0xdb09('0x68')](_0x18bc38)&&(_0x5ee721[_0x18bc38][_0xdb09('0x34')]===_0xdb09('0x69')||_0x5ee721[_0x18bc38][_0xdb09('0x34')]==='booked')&&_0x5ee721[_0x18bc38][_0xdb09('0x28')]==='outbound'){if(this[_0xdb09('0x18')]>0x7){this[_0xdb09('0x18')]=0x0;this[_0xdb09('0x6a')]();}}if(_0x5ee721[_0xdb09('0x68')](_0x18bc38)&&_0x5ee721[_0x18bc38][_0xdb09('0x34')]==='preview'&&_0x5ee721[_0x18bc38][_0xdb09('0x28')]==='outbound'){if(_0x5ee721[_0x18bc38][_0xdb09('0x6b')]){this[_0xdb09('0x6c')](_0x5ee721[_0x18bc38]);this[_0xdb09('0x6d')](_0x5ee721[_0x18bc38]);}else{notSendMessagesQueue(_0x5ee721[_0x18bc38]);}}}};Preview[_0xdb09('0x10')][_0xdb09('0x6e')]=function(_0x5995b8){var _0xeb8931=this;this[_0xdb09('0x12')][_0xdb09('0x6f')](function(){if(!_[_0xdb09('0x70')](_0xeb8931['actions'][_0x5995b8])){loggerAction[_0xdb09('0x71')]('[clearZombieChannels][talking]',_0x5995b8,_0xdb09('0x72'),_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x73')],'originated:\x20',JSON[_0xdb09('0x74')](_0xeb8931['campaignsPreview'][_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x73')]][_0xdb09('0x50')]),_0xdb09('0x75'),JSON['stringify'](_0xeb8931[_0xdb09('0x13')][_0xeb8931['actions'][_0x5995b8][_0xdb09('0x73')]][_0xdb09('0x60')]),JSON['stringify'](_0xeb8931['actions'][_0x5995b8][_0xdb09('0x76')]),JSON['stringify'](_[_0xdb09('0x77')](_0xeb8931[_0xdb09('0x16')][_0x5995b8],[_0xdb09('0x78'),_0xdb09('0x79'),_0xdb09('0x7a'),_0xdb09('0x7b')])));return ami['Action']({'action':_0xdb09('0x7c'),'channel':_0xeb8931['actions'][_0x5995b8][_0xdb09('0x7d')]})[_0xdb09('0x7e')](function(_0x4f1dc7){if(_0x4f1dc7[_0xdb09('0x4f')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xeb8931['actions'][_0x5995b8]){ut[_0xdb09('0x7f')](_0xeb8931['campaignsPreview'][_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x73')]],'[clearZombieChannel]');if(_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x76')]===!![]){ut[_0xdb09('0x80')](_0xeb8931[_0xdb09('0x13')][_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x73')]],_0xdb09('0x81'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x5995b8,_0xeb8931[_0xdb09('0x16')][_0x5995b8]['queue']);}ut[_0xdb09('0x82')]('[Dialer][checkChannel][Preview]'+_0x5995b8,_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x73')]);delete _0xeb8931[_0xdb09('0x16')][_0x5995b8];}},0x2328);}});}});};Preview['prototype'][_0xdb09('0x6a')]=function(){var _0x5b6789=this;loggerAction[_0xdb09('0x71')](_0xdb09('0x83'),_['size'](this['actions']));for(var _0x472579 in this[_0xdb09('0x16')]){if(_0x5b6789[_0xdb09('0x16')]['hasOwnProperty'](_0x472579)){_0x5b6789[_0xdb09('0x6e')](_0x472579);}}};Preview[_0xdb09('0x10')]['recallMe']=function(_0x57a7c3){var _0x1887b7=this;rpcDb[_0xdb09('0x84')](_0x57a7c3['id'],ut[_0xdb09('0x85')](this[_0xdb09('0x17')]))[_0xdb09('0x86')](function(_0x424e50){if(!_[_0xdb09('0x70')](_0x424e50)){for(var _0x48fd2f=0x0;_0x48fd2f<_0x424e50[_0xdb09('0x87')];_0x48fd2f+=0x1){if(ut[_0xdb09('0x88')](_0x424e50[_0x48fd2f][_0xdb09('0x89')])<_0x57a7c3['dialRecallMeTimeout']*0x3c){if(_0x424e50[_0x48fd2f][_0xdb09('0x8a')]&&!_0x424e50[_0x48fd2f][_0xdb09('0x8a')][_0xdb09('0x8b')]){_0x1887b7['run'](_0x424e50[_0x48fd2f]['id'])[_0xdb09('0x86')](ut[_0xdb09('0x8c')](_0xdb09('0x8d')))[_0xdb09('0x7e')](ut[_0xdb09('0x8c')](_0xdb09('0x8d')));}else{rpcDb['disableContact'](_0x424e50[_0x48fd2f]['id']);}}else{var _0x57fe76=new Action(_0x424e50[_0x48fd2f],_0x57a7c3);_0x57fe76['starttime']=moment()['format'](_0xdb09('0x8e'));_0x57a7c3[_0xdb09('0x8f')]+=0x1;ut['logCustomer'](_0x57fe76,0x17,_0xdb09('0x90'));if(_0x57a7c3[_0xdb09('0x91')]){rpcDb[_0xdb09('0x92')](ut[_0xdb09('0x93')](_0x424e50[_0x48fd2f]));rpcDb[_0xdb09('0x94')](_0x57fe76,_0xdb09('0x95'));}else{ut[_0xdb09('0x96')](_0x57fe76,0x16,'RecallFailedTimeout');rpcDb[_0xdb09('0x94')](_0x57fe76,'[HistoryRecallClose]');rpcDb[_0xdb09('0x97')](_0x57fe76,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xdb09('0x8c')]('[getContactRecallMe]'));};Preview[_0xdb09('0x10')][_0xdb09('0x6c')]=function(_0xa7cb05){_0xa7cb05[_0xdb09('0x5f')]=!![];if(ut['IsNotLoggedIn'](_0xa7cb05[_0xdb09('0x98')])){_0xa7cb05[_0xdb09('0x4f')]=_0xdb09('0x99');}else if(!ut[_0xdb09('0x9a')](_0xa7cb05[_0xdb09('0x6b')])){_0xa7cb05['message']=_0xdb09('0x61');}else if(!this[_0xdb09('0x9b')](_0xa7cb05['Trunk'])){if(!this[_0xdb09('0x9b')](_0xa7cb05[_0xdb09('0x9c')])){_0xa7cb05[_0xdb09('0x4f')]='TRUNK_IS_NOT_REACHABLE';}else{_0xa7cb05[_0xdb09('0x4f')]=_0xdb09('0x9d');}}else{_0xa7cb05[_0xdb09('0x4f')]=_0xdb09('0x9d');}emitCampaignPreview(_0xa7cb05);};Preview[_0xdb09('0x10')][_0xdb09('0x9e')]=function(_0xfbbfc4,_0xfc4c48,_0x2a8c76){var _0x1ee32c=this;var _0x26302f=this[_0xdb09('0x16')][_0xfc4c48];var _0x21634e=this[_0xdb09('0x13')][_0x26302f['queue']];var _0x172c44;if(_0x21634e){switch(_0x2a8c76){case'1':_0x21634e[_0xdb09('0x41')]+=0x1;_0x26302f[_0xdb09('0x9f')]+=0x1;_0x26302f['countglobal']=ut['totalGlobal'](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x0,_0xdb09('0xa0'));ami[_0xdb09('0x27')](_0xdb09('0xa1'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xa3')));rpcDb[_0xdb09('0x94')](_0x26302f,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb[_0xdb09('0x97')](_0x172c44,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x26302f[_0xdb09('0x9f')]>=_0x21634e[_0xdb09('0xa7')]){rpcDb[_0xdb09('0x97')](_0x26302f,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xdb09('0xa8')](ut['scheduledAt'](_0x26302f,_0xdb09('0x9f'),_0x21634e[_0xdb09('0xa9')]),_0x26302f[_0xdb09('0xaa')],_0x26302f[_0xdb09('0xab')]);}}delete this[_0xdb09('0x16')][_0xfbbfc4[_0xdb09('0xac')]];break;case _0xdb09('0xad'):var _0x1b46ee=moment()[_0xdb09('0x5a')](_0xdb09('0x8e'));_0x26302f[_0xdb09('0xae')]=_0x1b46ee;_0x26302f['answertime']=_0x1b46ee;_0x26302f[_0xdb09('0x76')]=!![];_0x21634e[_0xdb09('0x60')]+=0x1;logger[_0xdb09('0x71')](_0xdb09('0xaf'),_0x26302f[_0xdb09('0xb0')],_0xdb09('0xb1'),_0x21634e[_0xdb09('0x2a')],_0xdb09('0x75'),_0x21634e[_0xdb09('0x60')]);ami[_0xdb09('0x27')]('custom:agentconnect',ut['buildObj'](_0x26302f,_0xdb09('0xb2'),this['campaignsPreview'][_0x26302f['queue']]));if(_0x21634e[_0xdb09('0xb3')]){ami[_0xdb09('0x27')](_0xdb09('0xb4'),ut[_0xdb09('0xb5')](_0x26302f));}break;case'16':ami[_0xdb09('0x27')](_0xdb09('0xb6'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xb7'),this[_0xdb09('0x13')][_0x26302f['queue']]));emitVoiceQueueChannelRemove(ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xb7')));_0x21634e[_0xdb09('0x3a')]+=0x1;_0x21634e['total']+=0x1;_0x21634e[_0xdb09('0x2c')]+=0x1;ut[_0xdb09('0x80')](_0x21634e,_0xdb09('0xb8'));_0x26302f[_0xdb09('0xb9')]=ut['totalGlobal'](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x4,_0xdb09('0xba'));rpcDb['createCustomerHistory'](_0x26302f,_0xdb09('0xbb'));rpcDb[_0xdb09('0x97')](_0x26302f,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x26302f);_0x21634e[_0xdb09('0x2f')]+=_0x26302f[_0xdb09('0xbc')];_0x21634e['sumBillable']+=_0x26302f[_0xdb09('0xbc')];logger[_0xdb09('0x71')](_0xdb09('0xbd'),_0x26302f[_0xdb09('0xb0')],_0xdb09('0xb1'),_0x21634e['name'],'pTalking:\x20',_0x21634e[_0xdb09('0x60')]);delete this[_0xdb09('0x16')][_0xfbbfc4['linkedid']];break;case'BUSY':_0x21634e[_0xdb09('0x3c')]+=0x1;_0x26302f[_0xdb09('0xbe')]+=0x1;_0x26302f[_0xdb09('0xb9')]=ut[_0xdb09('0xbf')](_0x26302f);ut['logCustomer'](_0x26302f,0x5,_0xdb09('0xc0'));ami[_0xdb09('0x27')](_0xdb09('0xc1'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xc2')));rpcDb[_0xdb09('0x94')](_0x26302f,_0xdb09('0xc3'));if(ut[_0xdb09('0xbf')](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb['createCustomerFinal'](_0x172c44,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x26302f['countbusyretry']>=_0x21634e[_0xdb09('0xc4')]){rpcDb['createCustomerFinal'](_0x26302f,_0xdb09('0xc3'));}else{rpcDb[_0xdb09('0xa8')](ut[_0xdb09('0xc5')](_0x26302f,_0xdb09('0xbe'),_0x21634e[_0xdb09('0xc6')]),_0x26302f[_0xdb09('0xaa')],_0x26302f[_0xdb09('0xab')]);}}break;case'NOANSWER':_0x21634e['outboundNoAnswerCallsDay']+=0x1;_0x26302f[_0xdb09('0xc7')]+=0x1;_0x26302f[_0xdb09('0xb9')]=ut[_0xdb09('0xbf')](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x3,'NoAnswer');ami[_0xdb09('0x27')](_0xdb09('0xc8'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xc9')));rpcDb['createCustomerHistory'](_0x26302f,_0xdb09('0xca'));if(ut['totalGlobal'](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb[_0xdb09('0x97')](_0x172c44,_0xdb09('0xcb'));}else{if(_0x26302f[_0xdb09('0xc7')]>=_0x21634e[_0xdb09('0xcc')]){rpcDb['createCustomerFinal'](_0x26302f,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xdb09('0xa8')](ut[_0xdb09('0xc5')](_0x26302f,'countnoanswerretry',_0x21634e['dialNoAnswerRetryFrequency']),_0x26302f[_0xdb09('0xaa')],_0x26302f[_0xdb09('0xab')]);}}break;case _0xdb09('0xcd'):_0x21634e[_0xdb09('0xce')]+=0x1;_0x26302f['countcongestionretry']+=0x1;_0x26302f[_0xdb09('0xb9')]=ut[_0xdb09('0xbf')](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x8,_0xdb09('0xcf'));ami[_0xdb09('0x27')](_0xdb09('0xd0'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xd1')));rpcDb[_0xdb09('0x94')](_0x26302f,_0xdb09('0xd2'));if(ut['totalGlobal'](_0x26302f)>=_0x21634e['dialGlobalMaxRetry']){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb[_0xdb09('0x97')](_0x172c44,_0xdb09('0xd3'));}else{if(_0x26302f[_0xdb09('0xd4')]>=_0x21634e['dialCongestionMaxRetry']){rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xd2'));}else{rpcDb[_0xdb09('0xa8')](ut['scheduledAt'](_0x26302f,_0xdb09('0xd4'),_0x21634e['dialBusyRetryFrequency']),_0x26302f[_0xdb09('0xaa')],_0x26302f[_0xdb09('0xab')]);}}break;case _0xdb09('0xd5'):_0x21634e[_0xdb09('0x42')]+=0x1;_0x26302f[_0xdb09('0xd6')]+=0x1;_0x26302f[_0xdb09('0xb9')]=ut[_0xdb09('0xbf')](_0x26302f);ut['logCustomer'](_0x26302f,0x14,_0xdb09('0xd7'));ami[_0xdb09('0x27')](_0xdb09('0xd8'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xd9')));rpcDb['createCustomerHistory'](_0x26302f,_0xdb09('0xda'));if(ut['totalGlobal'](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0x14,_0xdb09('0xd7'));rpcDb[_0xdb09('0x97')](_0x172c44,_0xdb09('0xdb'));}else{if(_0x26302f['countagentrejectretry']>=_0x21634e['dialAgentRejectMaxRetry']){rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xdb'));}else{rpcDb[_0xdb09('0xa8')](ut['scheduledAt'](_0x26302f,_0xdb09('0xd6'),_0x21634e['dialAgentRejectRetryFrequency']),_0x26302f[_0xdb09('0xaa')],_0x26302f[_0xdb09('0xab')]);}}break;case _0xdb09('0xdc'):_0x21634e[_0xdb09('0x44')]+=0x1;_0x26302f[_0xdb09('0xdd')]+=0x1;_0x26302f[_0xdb09('0xb9')]=ut[_0xdb09('0xbf')](_0x26302f);ut['logCustomer'](_0x26302f,0xb,'Abandoned');rpcDb[_0xdb09('0x94')](_0x26302f,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xdb09('0xbf')](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb['createCustomerFinal'](_0x172c44,_0xdb09('0xde'));}else{if(_0x26302f['countabandonedetry']>=_0x21634e[_0xdb09('0xdf')]){rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xde'));}else{rpcDb['rescheduleContact'](ut[_0xdb09('0xc5')](_0x26302f,'countabandonedretry',_0x21634e[_0xdb09('0xe0')]),_0x26302f['unlockAgent'],_0x26302f[_0xdb09('0xab')]);}}break;case'18':_0x21634e[_0xdb09('0x43')]+=0x1;_0x26302f[_0xdb09('0xe1')]+=0x1;_0x26302f['countglobal']=ut[_0xdb09('0xbf')](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x12,_0xfbbfc4[_0xdb09('0xe2')]||_0xfbbfc4[_0xdb09('0xe3')]);ami['emit'](_0xdb09('0xe4'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xe5')));rpcDb['createCustomerHistory'](_0x26302f,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xdb09('0xbf')](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb[_0xdb09('0x97')](_0x172c44,_0xdb09('0xe6'));}else{rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xe6'));}delete this['actions'][_0xfbbfc4[_0xdb09('0xac')]];break;case'19':_0x21634e[_0xdb09('0x43')]+=0x1;_0x26302f['countglobal']=ut['totalGlobal'](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x13,_0xfbbfc4['cause-txt']||_0xfbbfc4['dialstatus']);ami[_0xdb09('0x27')](_0xdb09('0xe4'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xe5')));rpcDb[_0xdb09('0x94')](_0x26302f,_0xdb09('0xe7'));if(ut['totalGlobal'](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,'Global');rpcDb[_0xdb09('0x97')](_0x172c44,_0xdb09('0xe7'));}else{rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xe7'));}delete this[_0xdb09('0x16')][_0xfbbfc4[_0xdb09('0xac')]];break;default:if(_0x26302f['dialAnswer']){ut['decrementTalkink'](_0x21634e,_0xdb09('0xe8'));ut['loggerError'](_0xdb09('0xe9')+_0x21634e[_0xdb09('0x2a')],_0xfbbfc4);}_0x21634e[_0xdb09('0x43')]+=0x1;_0x26302f['countglobal']=ut[_0xdb09('0xbf')](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0xc,_0xfbbfc4[_0xdb09('0xe2')]||_0xfbbfc4[_0xdb09('0xe3')]);rpcDb[_0xdb09('0x94')](_0x26302f,_0xdb09('0xea'));if(ut[_0xdb09('0xbf')](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut['cloneAction'](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb[_0xdb09('0x97')](_0x172c44,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xeb'));}delete this[_0xdb09('0x16')][_0xfbbfc4[_0xdb09('0xac')]];}if(!(_0x26302f[_0xdb09('0x76')]&&_0x2a8c76==='16')){ut['updateOriginated'](_0x21634e,_0xdb09('0xec'));logger[_0xdb09('0x71')](_0xdb09('0xed'),_0x26302f[_0xdb09('0xb0')],_0xdb09('0xb1'),_0x21634e[_0xdb09('0x2a')],_0xdb09('0xee'),_0x21634e[_0xdb09('0x50')]);}if(_0x2a8c76!=='ANSWER'){delete this[_0xdb09('0x16')][_0xfbbfc4[_0xdb09('0xac')]];delete this[_0xdb09('0x16')][_0xfbbfc4['destlinkedid']];}}};Preview['prototype'][_0xdb09('0xef')]=function(_0x16aaed,_0x30cdb3,_0x59ee88){if(_['isUndefined'](_0x30cdb3)&&_0xdb09('0xf0')!==typeof _0x30cdb3){return;}if(_['isUndefined'](_0x59ee88)&&_0xdb09('0xf0')!==typeof _0x59ee88){return;}switch(_0x59ee88[_0xdb09('0xf1')]){case'0':ut[_0xdb09('0xf2')](_0x16aaed,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x16aaed,_0xdb09('0xf3'));break;case'3':ut[_0xdb09('0xf2')](_0x16aaed,0x3,_0xdb09('0xf4'));rpcDb['createAgentHistory'](_0x16aaed,_0xdb09('0xf5'));break;case'5':ut[_0xdb09('0xf2')](_0x16aaed,0x5,_0xdb09('0xc0'));rpcDb[_0xdb09('0xf6')](_0x16aaed,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x16aaed,0x8,_0xdb09('0xcf'));rpcDb[_0xdb09('0xf6')](_0x16aaed,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x16aaed,0x16,_0xdb09('0xf7'));rpcDb[_0xdb09('0xf6')](_0x16aaed,_0xdb09('0xf8'));break;default:ut[_0xdb09('0xf2')](_0x16aaed,0xc,_0x59ee88['reason']);rpcDb[_0xdb09('0xf6')](_0x16aaed,_0xdb09('0xf9'));}ut['updateOriginated'](_0x30cdb3,'[callProgressDetectingAgent]');logger['info'](_0xdb09('0xfa'),_0x16aaed['uniqueid'],_0xdb09('0xb1'),_0x30cdb3[_0xdb09('0x2a')],'originated:\x20',_0x30cdb3[_0xdb09('0x50')]);delete this[_0xdb09('0x16')][_0x16aaed[_0xdb09('0xb0')]];};Preview['prototype'][_0xdb09('0xfb')]=function(_0x25bb73,_0xd20095,_0x4e4725,_0x195f65,_0x102936){var _0x4a7c0a=this;return new BPromise(function(_0x49065b,_0x46308f){if(_['isNil'](_0xd20095)||_[_0xdb09('0x70')](_0xd20095['Contact'])||_['isNil'](_0xd20095['Contact']['phone'])||_[_0xdb09('0x70')](_0xd20095['VoiceQueueId'])){_0x46308f(ut['message']('Contact\x20is\x20undefined',_0x195f65,_0x102936));return;}var _0x37281c=uuid['v4']();var _0x119187=_0x4a7c0a[_0xdb09('0x13')][_0xd20095[_0xdb09('0x72')]['name']];var _0x51c0ca=_0x4e4725?_0x4a7c0a[_0xdb09('0x17')][_0x4e4725]['id']:undefined;_0x4a7c0a[_0xdb09('0x16')][_0x37281c]=new Action(_0xd20095,_0x119187,_0x37281c,_0x4e4725,_0x51c0ca);var _0x1b41ad=_0x4a7c0a['actions'][_0x37281c];_0x1b41ad[_0xdb09('0xaa')]=_0x195f65;_0x1b41ad[_0xdb09('0xab')]=_0x102936;_0x1b41ad[_0xdb09('0xfc')]=_0x4e4725;if(_['isEmpty'](_0x25bb73)){_0x4a7c0a[_0xdb09('0xfd')](_0x1b41ad,_0x119187,_0xd20095,_0x4e4725)[_0xdb09('0x86')](function(_0x20f5b9){logger[_0xdb09('0x71')]('[Preview][execCall][success]',_0xdb09('0xfe')+_0x1b41ad[_0xdb09('0x73')]+_0xdb09('0xff')+_0x1b41ad[_0xdb09('0x100')],JSON[_0xdb09('0x74')](_0x20f5b9));ami[_0xdb09('0x27')](_0xdb09('0x101'),ut[_0xdb09('0xa2')](_0x1b41ad,_0xdb09('0x102'),_0x4a7c0a[_0xdb09('0x13')][_0x1b41ad[_0xdb09('0x73')]]));_0x49065b(ut[_0xdb09('0x4f')](_0xdb09('0x103')));})['catch'](function(_0x3d164e){ut[_0xdb09('0x62')](_0xdb09('0x104'),_0x3d164e);_0x46308f(ut[_0xdb09('0x4f')]('Call\x20failed',_0x195f65,_0x102936));});}else{_0x119187[_0xdb09('0x3b')]+=0x1;ut[_0xdb09('0x105')](_0x1b41ad);rpcDb[_0xdb09('0x106')](_0x1b41ad,_0xdb09('0x107'));delete _0x4a7c0a[_0xdb09('0x16')][_0x37281c];_0x46308f(ut['message']('Contact\x20in\x20black\x20List',_0x195f65,_0x102936));}});};Preview[_0xdb09('0x10')]['isTrunkReachable']=function(_0x584d36){return!_[_0xdb09('0x70')](_0x584d36)&&!_[_0xdb09('0x70')](_0x584d36[_0xdb09('0x2a')])&&!_[_0xdb09('0x70')](_0x584d36['active'])&&_0x584d36['active']&&!_[_0xdb09('0x70')](this[_0xdb09('0x15')][util[_0xdb09('0x5a')](_0xdb09('0x108'),_0x584d36[_0xdb09('0x2a')])])&&!_['isNil'](this[_0xdb09('0x15')][util[_0xdb09('0x5a')]('SIP/%s',_0x584d36['name'])][_0xdb09('0x7c')])&&(this[_0xdb09('0x15')][util[_0xdb09('0x5a')]('SIP/%s',_0x584d36[_0xdb09('0x2a')])][_0xdb09('0x7c')]==='reachable'||this[_0xdb09('0x15')][util[_0xdb09('0x5a')]('SIP/%s',_0x584d36[_0xdb09('0x2a')])][_0xdb09('0x7c')]===_0xdb09('0x109'));};Preview[_0xdb09('0x10')][_0xdb09('0x10a')]=function(_0x5bf0e3,_0x3a0f40){var _0x559f8b=this;return new BPromise(function(_0x249b9a,_0x4ef4a6){_0x559f8b[_0xdb09('0x10b')](_0x5bf0e3,_0x3a0f40)[_0xdb09('0x86')](function(_0x3011f9){_0x249b9a(_[_0xdb09('0x77')](_0x3011f9,[_0xdb09('0x4f')]));})[_0xdb09('0x7e')](function(_0x58de85){if(_0x58de85[_0xdb09('0x10c')]){rpcDb['unlockContact'](_0x5bf0e3);}if(_0x58de85[_0xdb09('0x57')]){rpcDb[_0xdb09('0x10d')](_0x5bf0e3);}_0x4ef4a6(_[_0xdb09('0x77')](_0x58de85,[_0xdb09('0x4f')]));});});};Preview[_0xdb09('0x10')][_0xdb09('0x10b')]=function(_0x438693,_0x15be9e){var _0x13a2d1=this;return new BPromise(function(_0x5d78eb,_0x3f5a27){var _0x43e705,_0x2a9df0;rpcDb[_0xdb09('0x10e')](_0x438693)[_0xdb09('0x86')](function(_0x189660){if(!_[_0xdb09('0x70')](_0x189660[0x0])){_0x2a9df0=_0x189660[0x0]['recallme']?![]:!![];_0x43e705=_0x189660[0x0]['recallme']?!![]:![];_0x43e705=_0x15be9e?!![]:_0x43e705;}var _0x4ee645=_0x13a2d1['validateContact'](_0x189660);if(_0x4ee645[_0xdb09('0x10f')]){rpcDb[_0xdb09('0x110')](_['pick'](_0x189660[0x0],[_0xdb09('0x7a'),'Contact.phone']))['then'](function(_0x358865){_0x13a2d1[_0xdb09('0xfb')](_0x358865,_0x189660[0x0],_0x15be9e,_0x2a9df0,_0x43e705)[_0xdb09('0x86')](function(_0xe1b2e7){_0x5d78eb(_0xe1b2e7);})[_0xdb09('0x7e')](function(_0x53e2e3){_0x3f5a27(_0x53e2e3);});})['catch'](function(_0x4bef31){ut[_0xdb09('0x62')](_0xdb09('0x111'),_0x4bef31);_0x3f5a27(ut['message'](_0xdb09('0x112'),_0x2a9df0,_0x43e705));});}else{_0x3f5a27(ut[_0xdb09('0x4f')](_0x4ee645[_0xdb09('0x4f')],_0x2a9df0,_0x43e705));}})[_0xdb09('0x7e')](function(_0x5f1b8e){ut[_0xdb09('0x62')]('[Preview][getContactPreview]',_0x5f1b8e);_0x3f5a27(ut[_0xdb09('0x4f')](_0xdb09('0x112'),![],!![]));});});};Preview[_0xdb09('0x10')][_0xdb09('0x113')]=function(_0x4f038d){if(_[_0xdb09('0x70')](_0x4f038d)||_[_0xdb09('0x114')](_0x4f038d)||!_[_0xdb09('0x70')](_0x4f038d[0x0][_0xdb09('0x8a')])&&_[_0xdb09('0x70')](_0x4f038d[0x0][_0xdb09('0x8a')][_0xdb09('0x2a')])){ut[_0xdb09('0x62')](_0xdb09('0x115'),_0x4f038d);return{'isValid':![],'message':_0xdb09('0x116')};}var _0x451649=this[_0xdb09('0x13')][_0x4f038d[0x0][_0xdb09('0x72')][_0xdb09('0x2a')]];_0x451649[_0xdb09('0x4f')]=_0xdb09('0x9d');if(_[_0xdb09('0x70')](_0x451649)){ut[_0xdb09('0x62')]('[Preview][validateContact][Empty\x20Campaign]',_0x451649);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xdb09('0x9b')](_0x451649[_0xdb09('0x56')])){ut['logger'](_0xdb09('0x117'),'campaign\x20Name:\x20'+_0x451649[_0xdb09('0x2a')]+_0xdb09('0x118'));if(!this[_0xdb09('0x9b')](_0x451649[_0xdb09('0x9c')])){ut['logger'](_0xdb09('0x117'),_0x451649[_0xdb09('0x2a')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xdb09('0x119')};}}if(!ut[_0xdb09('0x9a')](_0x451649['dialActive'])){ut[_0xdb09('0x62')]('[Preview][validateContact][Campaign\x20Active]',_0x451649[_0xdb09('0x2a')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xdb09('0x11a')+_0x451649['name']+_0xdb09('0x11b')};}return{'isValid':!![],'message':_0xdb09('0x11c')};};Preview[_0xdb09('0x10')][_0xdb09('0xfd')]=function(_0x467127,_0x50d9a8,_0x198585,_0x5885ad){var _0x25e4cd=this;return new BPromise(function(_0xd0f60e,_0x500904){var _0x3fe96d=_0x467127[_0xdb09('0xb0')];var _0x342ffa=_0x25e4cd[_0xdb09('0x9b')](_0x50d9a8[_0xdb09('0x56')])?util[_0xdb09('0x5a')](_0xdb09('0x11d'),_0x50d9a8['Trunk'][_0xdb09('0x2a')],_[_0xdb09('0x70')](_0x50d9a8[_0xdb09('0x38')])?'':_0x50d9a8['dialPrefix'][_0xdb09('0x11e')]()||'',_0x50d9a8['dialCutDigit']>0x0?_0x198585[_0xdb09('0x11f')]['phone']['substring'](_0x50d9a8[_0xdb09('0x120')]):_0x198585[_0xdb09('0x11f')][_0xdb09('0x121')]):util[_0xdb09('0x5a')](_0xdb09('0x11d'),_['isNil'](_0x50d9a8[_0xdb09('0x9c')])?_0x50d9a8[_0xdb09('0x56')][_0xdb09('0x2a')]:_0x50d9a8[_0xdb09('0x9c')][_0xdb09('0x2a')],_[_0xdb09('0x70')](_0x50d9a8['dialPrefix'])?'':_0x50d9a8['dialPrefix'][_0xdb09('0x11e')]()||'',_0x50d9a8[_0xdb09('0x120')]>0x0?_0x198585[_0xdb09('0x11f')][_0xdb09('0x121')][_0xdb09('0x122')](_0x50d9a8[_0xdb09('0x120')]):_0x198585[_0xdb09('0x11f')][_0xdb09('0x121')]);var _0x1c96bc=_0x25e4cd[_0xdb09('0x9b')](_0x50d9a8[_0xdb09('0x56')])?ut[_0xdb09('0x123')](_0x50d9a8['Trunk'][_0xdb09('0x58')],_0x50d9a8[_0xdb09('0x35')],_0x50d9a8['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xdb09('0x124')](_0x50d9a8[_0xdb09('0x36')],_0x50d9a8['dialRandomLastDigitCallerIdNumber']):_0x50d9a8[_0xdb09('0x36')]):ut[_0xdb09('0x123')](_['isNil'](_0x50d9a8[_0xdb09('0x9c')])?_0x50d9a8[_0xdb09('0x56')][_0xdb09('0x58')]:_0x50d9a8['TrunkBackup'][_0xdb09('0x58')],_0x50d9a8['dialOriginateCallerIdName'],_0x50d9a8[_0xdb09('0x125')]>0x0?ut[_0xdb09('0x124')](_0x50d9a8[_0xdb09('0x36')],_0x50d9a8['dialRandomLastDigitCallerIdNumber']):_0x50d9a8[_0xdb09('0x36')]);if(_0x1c96bc){_0x467127[_0xdb09('0x126')]=ut[_0xdb09('0x127')](_0x1c96bc);_0x467127[_0xdb09('0x128')]=ut[_0xdb09('0x129')](_0x1c96bc);}var _0x536558=ut[_0xdb09('0x12a')](_0x50d9a8,_0x198585,_0x342ffa,_0x1c96bc,_0x3fe96d,_0x467127);_[_0xdb09('0x12b')](_0x467127,ut['toLowerVariables'](_0x536558));_0x467127['starttime']=moment()[_0xdb09('0x5a')](_0xdb09('0x8e'));ami[_0xdb09('0x12c')](ut[_0xdb09('0x12d')](_0x467127,_0x50d9a8,_0x536558,_0x467127[_0xdb09('0xab')],_0x5885ad))[_0xdb09('0x86')](function(_0x36f4cc){var _0x42ae13=_0x467127['channelAgent'];if(!_[_0xdb09('0x70')](_0x42ae13)){if(!_[_0xdb09('0x70')](_0x25e4cd[_0xdb09('0x17')][_0x42ae13])){_0x25e4cd[_0xdb09('0x17')][_0x42ae13][_0xdb09('0x12e')]=_0x467127[_0xdb09('0x12f')];emit(util[_0xdb09('0x5a')]('user:%s',_0x25e4cd[_0xdb09('0x17')][_0x42ae13][_0xdb09('0x2a')]),_0xdb09('0x130'),{'destaccountcode':_0x25e4cd[_0xdb09('0x17')][_0x42ae13][_0xdb09('0x131')],'destconnectedlinenum':_0x467127['calleridnum']});}}_0x50d9a8[_0xdb09('0x50')]+=0x1;logger['info'](_0xdb09('0x132'),_0x3fe96d,'\x20Queue',_0x50d9a8['name'],_0xdb09('0xee'),_0x50d9a8[_0xdb09('0x50')]);_0xd0f60e(_0x36f4cc);})[_0xdb09('0x7e')](function(_0x1b1b94){ut['logAgent'](_0x467127,0xe,_0xdb09('0x133'));rpcDb['createAgentHistory'](_0x467127,'[originateFailure][logOriginateFailure]');_0x500904(_0x1b1b94);});});};Preview[_0xdb09('0x10')][_0xdb09('0x20')]=function(_0x4b4413){if(this[_0xdb09('0x16')][_0x4b4413[_0xdb09('0xac')]]){this[_0xdb09('0x16')][_0x4b4413[_0xdb09('0xac')]][_0xdb09('0x7d')]=_0x4b4413[_0xdb09('0x7d')];}};Preview[_0xdb09('0x10')]['syncOriginateResponse']=function(_0x24029e){var _0x1ab4d0=this;var _0x321166=this['actions'][_0x24029e['actionid']];if(_0x321166){if(_0x321166[_0xdb09('0xfc')]&&this[_0xdb09('0x17')][_0x321166[_0xdb09('0xfc')]]){ut[_0xdb09('0x134')](_0x321166,this[_0xdb09('0x17')][_0x321166[_0xdb09('0xfc')]]['name'],this[_0xdb09('0x17')][_0x321166[_0xdb09('0xfc')]]['id']);}var _0x4ebea3=_[_0xdb09('0x135')](_0x321166);_0x4ebea3[_0xdb09('0xae')]=moment()['format'](_0xdb09('0x8e'));var _0x2783b7=_0x1ab4d0['campaignsPreview'][_0x321166[_0xdb09('0x73')]];if(ut[_0xdb09('0x136')](_0x24029e[_0xdb09('0x137')])){if(_0x321166[_0xdb09('0xaa')]){rpcDb[_0xdb09('0x138')](_0x321166[_0xdb09('0x100')]);}if(_0x321166['activeContact']){rpcDb['disableContact'](_0x321166[_0xdb09('0x100')]);}ami[_0xdb09('0x27')]('custom:agentringnoanswer',ut['buildObj'](_0x321166,_0xdb09('0x139'),this[_0xdb09('0x13')][_0x321166[_0xdb09('0x73')]]));this['callProgressDetectingAgent'](_0x4ebea3,_0x2783b7,_0x24029e);}else{_0x321166[_0xdb09('0x13a')]=moment()[_0xdb09('0x5a')](_0xdb09('0x8e'));ut['logAgent'](_0x4ebea3,0x4,_0xdb09('0xba'));rpcDb[_0xdb09('0xf6')](_0x4ebea3,_0xdb09('0x13b'));}}};Preview[_0xdb09('0x10')]['syncHangup']=function(_0xc8962b){var _0x400797=this;var _0x44f596=this['actions'][_0xc8962b[_0xdb09('0xac')]];var _0x1ed73b;if(_0x44f596){_0x1ed73b=this[_0xdb09('0x13')][_0x44f596[_0xdb09('0x73')]];logger['info'](_0xdb09('0x13c'),_0xc8962b[_0xdb09('0xac')],_0xdb09('0xb1'),_0x1ed73b[_0xdb09('0x2a')],_0xdb09('0x75'),_0x1ed73b['pTalking']);}if(this[_0xdb09('0x16')][_0xc8962b[_0xdb09('0xac')]]&&_0xc8962b[_0xdb09('0xac')]!==_0xc8962b['uniqueid']){if(_0xc8962b[_0xdb09('0x13d')]==='16'&&this[_0xdb09('0x16')][_0xc8962b['linkedid']][_0xdb09('0x76')]){this[_0xdb09('0x9e')](_0xc8962b,_0xc8962b[_0xdb09('0xac')],_0xc8962b['cause']);}else if(this[_0xdb09('0x16')][_0xc8962b['linkedid']][_0xdb09('0x76')]){logger['info'](_0xdb09('0x13e'),_0xc8962b[_0xdb09('0xac')],_0xc8962b[_0xdb09('0x13d')],_0xdb09('0xb1'),_0x1ed73b[_0xdb09('0x2a')],_0xdb09('0x75'),_0x1ed73b['pTalking']);this[_0xdb09('0x9e')](_0xc8962b,_0xc8962b[_0xdb09('0xac')],_0xc8962b[_0xdb09('0x13d')]);}}else if(_0x44f596&&_['isNil'](_0x44f596[_0xdb09('0x13f')])&&_0x1ed73b[_0xdb09('0x140')]&&_0xc8962b[_0xdb09('0xac')]===_0xc8962b['uniqueid']&&_['isNil'](_0xc8962b['reason'])&&_0xc8962b[_0xdb09('0x13d')]==='16'&&_0xc8962b[_0xdb09('0x141')]==='6'&&_[_0xdb09('0x142')](_0x44f596['transfer'])){if(_0x44f596[_0xdb09('0xaa')]){rpcDb[_0xdb09('0x138')](_0x44f596['idContact']);}if(_0x44f596[_0xdb09('0xab')]){rpcDb[_0xdb09('0x10d')](_0x44f596[_0xdb09('0x100')]);}_0xc8962b[_0xdb09('0xf1')]='22';this[_0xdb09('0xef')](_0x44f596,_0x1ed73b,_0xc8962b);}else if(_0x44f596&&_0x44f596[_0xdb09('0x143')]){if(_0xc8962b['cause']==='16'&&this[_0xdb09('0x16')][_0xc8962b[_0xdb09('0xac')]][_0xdb09('0x76')]){logger[_0xdb09('0x71')]('[syncHangup][talking][transfer]',_0xc8962b[_0xdb09('0xac')],_0xc8962b['cause'],_0xdb09('0xb1'),_0x1ed73b[_0xdb09('0x2a')],_0xdb09('0x75'),_0x1ed73b['pTalking']);this[_0xdb09('0x9e')](_0xc8962b,_0xc8962b['linkedid'],_0xc8962b[_0xdb09('0x13d')]);}else if(this[_0xdb09('0x16')][_0xc8962b['linkedid']][_0xdb09('0x76')]){logger[_0xdb09('0x71')](_0xdb09('0x13e'),_0xc8962b[_0xdb09('0xac')],_0xc8962b[_0xdb09('0x13d')],_0xdb09('0xb1'),_0x1ed73b[_0xdb09('0x2a')],_0xdb09('0x75'),_0x1ed73b[_0xdb09('0x60')]);this[_0xdb09('0x9e')](_0xc8962b,_0xc8962b[_0xdb09('0xac')],_0xc8962b[_0xdb09('0x13d')]);}}};Preview['prototype']['syncDialEnd']=function(_0x588bde){if(this[_0xdb09('0x16')][_0x588bde[_0xdb09('0x144')]]&&_0x588bde[_0xdb09('0x144')]!==_0x588bde[_0xdb09('0x145')]){this[_0xdb09('0x9e')](_0x588bde,_0x588bde[_0xdb09('0x144')],_0x588bde[_0xdb09('0xe3')]);}};Preview[_0xdb09('0x10')][_0xdb09('0x1f')]=function(_0x4a7543){if(this[_0xdb09('0x16')][_0x4a7543[_0xdb09('0xac')]]&&_0x4a7543[_0xdb09('0xac')]!==_0x4a7543[_0xdb09('0xb0')]&&!this[_0xdb09('0x16')][_0x4a7543[_0xdb09('0xac')]][_0xdb09('0x76')]){if(_0x4a7543[_0xdb09('0x13d')]==='1'){this[_0xdb09('0x9e')](_0x4a7543,_0x4a7543[_0xdb09('0xac')],_0x4a7543['cause']);}}};Preview['prototype'][_0xdb09('0x146')]=function(_0x7a0237,_0x5994b8,_0x14fb72){if(this[_0xdb09('0x16')][_0x7a0237]){if(_[_0xdb09('0x70')](this[_0xdb09('0x16')][_0x7a0237][_0xdb09('0x147')])){this['actions'][_0x7a0237]['variables']={};}this[_0xdb09('0x16')][_0x7a0237][_0xdb09('0x147')][_0x5994b8]=_0x14fb72;}};Preview['prototype'][_0xdb09('0x22')]=function(_0x1a0e05){try{if(!_[_0xdb09('0x70')](_0x1a0e05)){if(ut[_0xdb09('0x148')](_[_0xdb09('0x149')](_0x1a0e05[_0xdb09('0x14a')])[0x0])){this['addVariable'](_0x1a0e05['uniqueid'],_['keys'](_0x1a0e05[_0xdb09('0x14a')])[0x0],_0x1a0e05[_0xdb09('0x14b')]);}}}catch(_0x1e8be8){logger[_0xdb09('0x14c')](_0xdb09('0x14d'),util[_0xdb09('0x14e')](_0x1e8be8,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xdb09('0x24')]=function(_0x244448){if(_0x244448){if(this[_0xdb09('0x16')][_0x244448[_0xdb09('0x14f')]]){this['actions'][_0x244448[_0xdb09('0x14f')]][_0xdb09('0x143')]=!![];}}};Preview[_0xdb09('0x10')][_0xdb09('0x25')]=function(_0x52f20d){if(_0x52f20d){if(this['actions'][_0x52f20d[_0xdb09('0x150')]]){this[_0xdb09('0x16')][_0x52f20d['transfererlinkedid']][_0xdb09('0x143')]=!![];}}};module[_0xdb09('0x151')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 625c26b..c314bbb 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 _0xe24a=['from-sip','exten','xcally-motion-preview','holdtime','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context'];(function(_0x5031f1,_0x5ece37){var _0x35b214=function(_0x490d11){while(--_0x490d11){_0x5031f1['push'](_0x5031f1['shift']());}};_0x35b214(++_0x5ece37);}(_0xe24a,0xe8));var _0xae24=function(_0x3f5d61,_0xcc8fb3){_0x3f5d61=_0x3f5d61-0x0;var _0x4ab83c=_0xe24a[_0x3f5d61];return _0x4ab83c;};'use strict';var util=require(_0xae24('0x0'));var BPromise=require(_0xae24('0x1'));var logger=require(_0xae24('0x2'))(_0xae24('0x3'));var _=require(_0xae24('0x4'));var cmHopper=require(_0xae24('0x5'));var cmHopperFinal=require(_0xae24('0x6'));var cmHopperHistory=require(_0xae24('0x7'));var cmHopperBlack=require(_0xae24('0x8'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xae24('0x9'));var voiceQueueReport=require(_0xae24('0xa'));function loggerCatch(_0x23ac02){return function(_0x4d268f){logger['error'](_0x23ac02,util['inspect'](_0x4d268f,{'showHidden':![],'depth':null}));};}function create(_0x27cfa7){return BPromise['resolve']()['then'](cmHopperHistory[_0xae24('0xb')](_0x27cfa7))[_0xae24('0xc')](loggerCatch(_0xae24('0xd')));}function createAgent(_0x3668e8){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](agentReportPreview[_0xae24('0xb')](_0x3668e8))[_0xae24('0xc')](loggerCatch(_0xae24('0xd')));}function moveContact(_0xd643d9){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper[_0xae24('0x10')](_0xd643d9,!![]))[_0xae24('0xc')](loggerCatch(_0xae24('0x11')));}exports['checkIsBlackList']=function(_0x385617){return BPromise[_0xae24('0xe')]()['then'](cmHopperBlack[_0xae24('0x12')](_0x385617))[_0xae24('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xae24('0x13')]=function(_0x137fd4){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper[_0xae24('0x13')](_0x137fd4))['catch'](loggerCatch(_0xae24('0x14')));};exports['createHistory']=function(_0x3178a2,_0x68706a){create(_0x3178a2)[_0xae24('0xc')](loggerCatch(_0x68706a));moveContact(_0x3178a2)[_0xae24('0xc')](loggerCatch(_0x68706a));};exports[_0xae24('0x15')]=function(_0x3e683e,_0x207cd5){createAgent(_0x3e683e)[_0xae24('0xc')](loggerCatch(_0x207cd5));};exports[_0xae24('0x16')]=function(_0x38c229,_0x28c74f){create(_0x38c229)[_0xae24('0xc')](loggerCatch(_0x28c74f));};exports['createCustomerFinal']=function(_0x518638,_0x34787c){moveContact(_0x518638)[_0xae24('0xc')](loggerCatch(_0x34787c));};exports[_0xae24('0x17')]=function(_0x14cb04,_0x418871,_0x2baa4c){if(_0x418871){_0x14cb04['UserId']=null;}if(_0x2baa4c){_0x14cb04['active']=![];}return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper[_0xae24('0x17')](_0x14cb04))[_0xae24('0xc')](loggerCatch(_0xae24('0x18')));};exports['countReScheduled']=function(_0x5bc25e){return BPromise['resolve']()['then'](cmHopper[_0xae24('0x19')](_0x5bc25e))[_0xae24('0xc')](loggerCatch(_0xae24('0x1a')));};exports[_0xae24('0x1b')]=function(_0x49e586){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper[_0xae24('0x1b')]({'UserId':null},_0x49e586,0x1))['catch'](loggerCatch(_0xae24('0x1c')));};exports['disableContact']=function(_0x4407d0){return BPromise[_0xae24('0xe')]()['then'](cmHopper['unlockContact']({'active':![]},_0x4407d0,0x1))[_0xae24('0xc')](loggerCatch(_0xae24('0x1d')));};exports[_0xae24('0x1e')]=function(_0x64ef69){var _0x5060eb={};_0x5060eb[_0xae24('0x1f')]=_0x64ef69[_0xae24('0x1f')];_0x5060eb['uniqueid']=_0x64ef69['uniqueid'];_0x5060eb['calleridnum']=_0x64ef69[_0xae24('0x20')];_0x5060eb['calleridname']=_0x64ef69[_0xae24('0x21')];_0x5060eb['queue']=_0x64ef69[_0xae24('0x22')];_0x5060eb[_0xae24('0x23')]=_0x64ef69[_0xae24('0x24')];_0x5060eb[_0xae24('0x25')]=_0x64ef69[_0xae24('0x24')];_0x5060eb[_0xae24('0x26')]=0x1;_0x5060eb['queuecallercompleteAt']=_0x64ef69[_0xae24('0x27')];_0x5060eb[_0xae24('0x28')]=_0x64ef69[_0xae24('0x29')];_0x5060eb[_0xae24('0x2a')]=_0xae24('0x2b');_0x5060eb[_0xae24('0x2c')]=_0xae24('0x2d');_0x5060eb[_0xae24('0x2e')]=0x0;_0x5060eb['assigned']=0x1;_0x5060eb['lastAssignedTo']=_0x64ef69[_0xae24('0x29')];_0x5060eb[_0xae24('0x2f')]=_0xae24('0x30');return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](voiceQueueReport[_0xae24('0x31')](_0x5060eb))[_0xae24('0xc')](loggerCatch(_0xae24('0x32')));};exports[_0xae24('0x33')]=function(_0x4a2446,_0x236a3b){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper['getContactRecallMe'](_0x4a2446,_0x236a3b))[_0xae24('0xc')](loggerCatch(_0xae24('0x34')));};exports[_0xae24('0x35')]=function(_0x5d3e3f){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper[_0xae24('0x17')](_0x5d3e3f,!![],!![]))[_0xae24('0xc')](loggerCatch(_0xae24('0x36')));}; \ No newline at end of file +var _0xa12a=['inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error'];(function(_0x4f50d6,_0x100adc){var _0x412340=function(_0x71d209){while(--_0x71d209){_0x4f50d6['push'](_0x4f50d6['shift']());}};_0x412340(++_0x100adc);}(_0xa12a,0x67));var _0xaa12=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa12a[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0xaa12('0x0'));var BPromise=require(_0xaa12('0x1'));var logger=require(_0xaa12('0x2'))(_0xaa12('0x3'));var _=require(_0xaa12('0x4'));var cmHopper=require(_0xaa12('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xaa12('0x6'));var cmHopperBlack=require(_0xaa12('0x7'));var voiceQueueRt=require(_0xaa12('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xaa12('0x9'));function loggerCatch(_0x48fc4d){return function(_0x4c361f){logger[_0xaa12('0xa')](_0x48fc4d,util[_0xaa12('0xb')](_0x4c361f,{'showHidden':![],'depth':null}));};}function create(_0x480c9f){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopperHistory[_0xaa12('0xe')](_0x480c9f))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x10')));}function createAgent(_0x33f7d6){return BPromise['resolve']()[_0xaa12('0xd')](agentReportPreview[_0xaa12('0xe')](_0x33f7d6))[_0xaa12('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0xe8c7cf){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x11')](_0xe8c7cf,!![]))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x12')));}exports['checkIsBlackList']=function(_0x4474c4){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopperBlack[_0xaa12('0x13')](_0x4474c4))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x14')));};exports[_0xaa12('0x15')]=function(_0x35985a){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper['getContactPreview'](_0x35985a))[_0xaa12('0xf')](loggerCatch('[getContactPreview]\x20'));};exports[_0xaa12('0xe')]=function(_0x516c1f,_0x419e9b){create(_0x516c1f)[_0xaa12('0xf')](loggerCatch(_0x419e9b));moveContact(_0x516c1f)[_0xaa12('0xf')](loggerCatch(_0x419e9b));};exports[_0xaa12('0x16')]=function(_0x5be2f2,_0x199f71){createAgent(_0x5be2f2)[_0xaa12('0xf')](loggerCatch(_0x199f71));};exports[_0xaa12('0x17')]=function(_0x4e8970,_0x571207){create(_0x4e8970)[_0xaa12('0xf')](loggerCatch(_0x571207));};exports[_0xaa12('0x18')]=function(_0x2698c9,_0x3ce9cc){moveContact(_0x2698c9)[_0xaa12('0xf')](loggerCatch(_0x3ce9cc));};exports[_0xaa12('0x19')]=function(_0x4cad3e,_0x1cea84,_0x286d01){if(_0x1cea84){_0x4cad3e[_0xaa12('0x1a')]=null;}if(_0x286d01){_0x4cad3e[_0xaa12('0x1b')]=![];}return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x19')](_0x4cad3e))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x1c')));};exports[_0xaa12('0x1d')]=function(_0x4b3a70){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x1d')](_0x4b3a70))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x1e')));};exports[_0xaa12('0x1f')]=function(_0x2458f8){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x1f')]({'UserId':null},_0x2458f8,0x1))[_0xaa12('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0xaa12('0x20')]=function(_0x4d5338){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x1f')]({'active':![]},_0x4d5338,0x1))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x21')));};exports[_0xaa12('0x22')]=function(_0x371c99){var _0x14594f={};_0x14594f[_0xaa12('0x23')]=_0x371c99[_0xaa12('0x23')];_0x14594f['uniqueid']=_0x371c99[_0xaa12('0x24')];_0x14594f['calleridnum']=_0x371c99[_0xaa12('0x25')];_0x14594f[_0xaa12('0x26')]=_0x371c99['calleridname'];_0x14594f[_0xaa12('0x27')]=_0x371c99[_0xaa12('0x27')];_0x14594f[_0xaa12('0x28')]=_0x371c99['answertime'];_0x14594f[_0xaa12('0x29')]=_0x371c99['answertime'];_0x14594f[_0xaa12('0x2a')]=0x1;_0x14594f[_0xaa12('0x2b')]=_0x371c99[_0xaa12('0x2c')];_0x14594f[_0xaa12('0x2d')]=_0x371c99['membername'];_0x14594f[_0xaa12('0x2e')]=_0xaa12('0x2f');_0x14594f['exten']='xcally-motion-preview';_0x14594f[_0xaa12('0x30')]=0x0;_0x14594f[_0xaa12('0x31')]=0x1;_0x14594f[_0xaa12('0x32')]=_0x371c99[_0xaa12('0x33')];_0x14594f[_0xaa12('0x34')]='COMPLETED';return BPromise['resolve']()[_0xaa12('0xd')](voiceQueueReport[_0xaa12('0x35')](_0x14594f))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x36')));};exports['getContactRecallMe']=function(_0x35b52a,_0xc773e3){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper['getContactRecallMe'](_0x35b52a,_0xc773e3))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x37')));};exports[_0xaa12('0x38')]=function(_0x2c1e88){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x19')](_0x2c1e88,!![],!![]))[_0xaa12('0xf')](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 7749497..56f3818 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 _0x46af=['match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','diff','loggerCatch','error','logger','info','inspect','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','membername','logCustomer','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','mandatoryDisposition','buildAcw','agentReadyId','status','reachable','push','getDiff','seconds','createBody','filterKey','idContact','type','campaigntype','dialAnswer','callback','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName'];(function(_0x3aeeed,_0x4e1be5){var _0x3d8c5f=function(_0x16e66b){while(--_0x16e66b){_0x3aeeed['push'](_0x3aeeed['shift']());}};_0x3d8c5f(++_0x4e1be5);}(_0x46af,0x1a9));var _0xf46a=function(_0x1e9edb,_0x2e224b){_0x1e9edb=_0x1e9edb-0x0;var _0x56a40e=_0x46af[_0x1e9edb];return _0x56a40e;};'use strict';var util=require(_0xf46a('0x0'));var _=require(_0xf46a('0x1'));var moment=require('moment');var logger=require(_0xf46a('0x2'))(_0xf46a('0x3'));var ipAgi=process['env'][_0xf46a('0x4')]||'127.0.0.1';function getSeconds(_0x114681,_0x1ec760){var _0x1b310b=moment(_0x114681)[_0xf46a('0x5')](0x0);var _0x4c72a8=moment(_0x1ec760)[_0xf46a('0x5')](0x0);return _0x1b310b[_0xf46a('0x6')](_0x4c72a8,'seconds');}exports[_0xf46a('0x7')]=function(_0x1f1a29){return function(_0x2ca35a){logger[_0xf46a('0x8')](_0x1f1a29,util['inspect'](_0x2ca35a,{'showHidden':![],'depth':null}));};};exports[_0xf46a('0x9')]=function(_0x11f094,_0x5af47c){logger[_0xf46a('0xa')](_0x11f094,util[_0xf46a('0xb')](_0x5af47c,{'showHidden':![],'depth':null}));};exports[_0xf46a('0xc')]=function(_0x25a562,_0x36299f){logger[_0xf46a('0x8')](_0x25a562,util[_0xf46a('0xb')](_0x36299f,{'showHidden':![],'depth':null}));};exports[_0xf46a('0xd')]=function(_0x38ae8c){return function(_0x512580){logger['info'](_0x38ae8c,util[_0xf46a('0xb')](_0x512580,{'showHidden':![],'depth':null}));};};exports[_0xf46a('0xe')]=function(_0x528cbe,_0x1dbf11,_0x94207a){return{'message':_0x528cbe,'unlock':_0x1dbf11,'active':_0x94207a};};exports[_0xf46a('0xf')]=function(_0x19db24,_0x136003,_0x208efa){if(!_[_0xf46a('0x10')](_0x208efa)&&_0xf46a('0x11')===typeof _0x208efa&&!_['isEmpty'](_0x208efa)){if(!_[_0xf46a('0x10')](_0x136003)&&_0xf46a('0x11')===typeof _0x136003&&!_[_0xf46a('0x12')](_0x136003)){return util[_0xf46a('0x13')](_0xf46a('0x14'),_0x136003,_0x208efa);}return util[_0xf46a('0x13')]('\x22%s\x22\x20<%s>',_0x208efa,_0x208efa);}if(!_[_0xf46a('0x10')](_0x19db24)&&_0xf46a('0x11')===typeof _0x19db24&&!_[_0xf46a('0x12')](_0x19db24)){return _0x19db24;}return _0xf46a('0x15');};exports['isActive']=function(_0x1d33e1){if(_[_0xf46a('0x16')](_0x1d33e1)){return![];}return _0x1d33e1;};exports['addVariables']=function(_0x2a5d4d,_0x4016b4,_0x405b9b,_0x1191fb,_0x41e647,_0x143e33){var _0x43a693={'XMD-QUEUE':_0x4016b4[_0xf46a('0x17')]?_0x4016b4['Queue'][_0xf46a('0x18')]:'','XMD-CALLERID':_0x1191fb,'XMD-CALLERID-PREVIEW':_0x143e33?util[_0xf46a('0x13')](_0xf46a('0x14'),_0x143e33[_0xf46a('0x19')],_0x143e33[_0xf46a('0x1a')]):_0x1191fb,'XMD-DIALID':_0x41e647,'XMD-CONTACTID':_0x4016b4[_0xf46a('0x1b')],'XMD-CDRTYPE':_0xf46a('0x1c'),'CALLERID(all)':_0x1191fb,'XMD-VOICEQUEUEID':_0x4016b4[_0xf46a('0x1d')],'XMD-DIALCHANNEL':_0x405b9b,'XMD-DIALTIMEOUT':_0x2a5d4d[_0xf46a('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0xf46a('0x13')](_0xf46a('0x1f'),_0x2a5d4d[_0xf46a('0x20')]?'g':'',_['isEmpty'](_0x2a5d4d[_0xf46a('0x21')])?'':_0xf46a('0x22')),'XMD-DIALURL':_0x2a5d4d[_0xf46a('0x23')]||'','XMD-AGI':_0x2a5d4d[_0xf46a('0x24')]?util['format'](_0xf46a('0x25'),ipAgi,_0x2a5d4d[_0xf46a('0x24')]):_0xf46a('0x26'),'XMD-AGIAFTER':_0x2a5d4d[_0xf46a('0x20')]?util[_0xf46a('0x13')](_0xf46a('0x25'),ipAgi,_0x2a5d4d[_0xf46a('0x20')]):_0xf46a('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x143e33?_0x143e33[_0xf46a('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x143e33?_0x143e33[_0xf46a('0x28')]:'','XMD-DESTINATION':_0xf46a('0x29')};if(!_[_0xf46a('0x12')](_0x2a5d4d[_0xf46a('0x21')])){_0x43a693[util['format']('%s',_0xf46a('0x2a'))]=_0x2a5d4d[_0xf46a('0x21')];_0x43a693[util[_0xf46a('0x13')]('%s',_0xf46a('0x2b'))]=_0x41e647;}if(_0x4016b4&&_0x4016b4[_0xf46a('0x2c')]){for(var _0x4e2a9c in _0x4016b4[_0xf46a('0x2c')]){if(_0x4016b4[_0xf46a('0x2c')][_0xf46a('0x2d')](_0x4e2a9c)){if(!_[_0xf46a('0x16')](_0x4016b4['Contact'][_0x4e2a9c])&&_0x4e2a9c!=='id'&&_0x4e2a9c!==_0xf46a('0x2e')&&_0x4e2a9c!==_0xf46a('0x2f')&&_0x4e2a9c!==_0xf46a('0x30')){_0x43a693[util[_0xf46a('0x13')](_0xf46a('0x31'),_0xf46a('0x32'),_[_0xf46a('0x33')](_0x4e2a9c))]=_0x4016b4['Contact'][_0x4e2a9c];}}}}return _0x43a693;};exports[_0xf46a('0x34')]=function(_0x36623e){var _0x315e80={};for(var _0x2bdf0e in _0x36623e){if(_0x36623e[_0xf46a('0x2d')](_0x2bdf0e)){_0x315e80[util[_0xf46a('0x13')]('%s',_[_0xf46a('0x35')](_0x2bdf0e))]=_0x36623e[_0x2bdf0e];}}return{'variables':_0x315e80};};exports['updateOriginated']=function(_0x5577a1,_0x3981d6){if(!_[_0xf46a('0x16')](_0x5577a1)){if(_0x5577a1[_0xf46a('0x2d')](_0xf46a('0x36'))){if(_0x5577a1[_0xf46a('0x36')]>0x0){_0x5577a1['originated']-=0x1;}else{logger[_0xf46a('0x8')](_0xf46a('0x37'),_0x3981d6);}}}else{logger[_0xf46a('0x8')](_0xf46a('0x38'),_0x3981d6);}};exports['logBlacklist']=function(_0x25328c){var _0x3c400f=moment()[_0xf46a('0x13')](_0xf46a('0x39'));_0x25328c[_0xf46a('0x3a')]=0xd;_0x25328c['statedesc']='Blacklist';_0x25328c[_0xf46a('0x3b')]=_0x3c400f;_0x25328c[_0xf46a('0x3c')]=_0x3c400f;_0x25328c[_0xf46a('0x3d')]=_0x3c400f;};exports[_0xf46a('0x3e')]=function(_0x265520,_0x4076a6,_0xc16d49){var _0x58bf22=moment()[_0xf46a('0x13')](_0xf46a('0x39'));_0x265520[_0xf46a('0x3a')]=_0x4076a6;_0x265520[_0xf46a('0x3f')]=_0xc16d49;_0x265520[_0xf46a('0x3c')]=_0x58bf22;_0x265520[_0xf46a('0x40')]=getSeconds(_0x265520['responsetime'],_0x265520[_0xf46a('0x3b')]);};exports[_0xf46a('0x41')]=function(_0x43426a,_0x418bdb,_0x5bd8a9){_0x43426a[_0xf46a('0x42')]=_0x418bdb;_0x43426a['UserId']=_0x5bd8a9;};exports[_0xf46a('0x43')]=function(_0x291bd0,_0x32444a,_0x5834a4){var _0x8117fd=moment()[_0xf46a('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x291bd0[_0xf46a('0x3a')]=_0x32444a;_0x291bd0['statedesc']=_0x5834a4;_0x291bd0[_0xf46a('0x3c')]=_0x291bd0['responsetime']?_0x291bd0[_0xf46a('0x3c')]:_0x8117fd;_0x291bd0['endtime']=_0x291bd0[_0xf46a('0x3d')]?_0x291bd0[_0xf46a('0x3d')]:_0x8117fd;_0x291bd0[_0xf46a('0x40')]=getSeconds(_0x291bd0['responsetime']||0x0,_0x291bd0['starttime']||0x0);_0x291bd0['talktime']=_0x291bd0[_0xf46a('0x44')]?getSeconds(_0x291bd0[_0xf46a('0x3d')],_0x291bd0[_0xf46a('0x44')]):0x0;};exports[_0xf46a('0x45')]=function(_0x2d5301){return _0x2d5301===_0xf46a('0x46');};exports[_0xf46a('0x47')]=function(_0x19e14e,_0xb2b1e5,_0x512d26,_0x40178b,_0x4aa683){var _0x500cfe=_0x40178b?_0xf46a('0x48'):_0x19e14e[_0xf46a('0x19')];_0x500cfe=_0x4aa683?'BOOKED':_0x500cfe;return{'actionid':_0x19e14e[_0xf46a('0x49')],'action':_0xf46a('0x4a'),'channel':_0x19e14e[_0xf46a('0x4b')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x500cfe,_0x19e14e[_0xf46a('0x1a')]),'Exten':_0xf46a('0x29'),'Context':_0xf46a('0x4c'),'Priority':'1','variable':_0x512d26,'timeout':(_0xb2b1e5[_0xf46a('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x19e14e['uniqueid']};};exports[_0xf46a('0x4e')]=function(_0x5c6cc7){return _0x5c6cc7[_0xf46a('0x4f')]+_0x5c6cc7[_0xf46a('0x50')]+_0x5c6cc7['countnoanswerretry']+_0x5c6cc7['countagentrejectretry']+_0x5c6cc7['countnosuchnumberretry'];};exports[_0xf46a('0x51')]=function(_0x2592dc){var _0x9befaa=_[_0xf46a('0x52')](_0x2592dc);_0x9befaa['state']=0xf;_0x9befaa[_0xf46a('0x3f')]=_0xf46a('0x53');return _0x9befaa;};exports[_0xf46a('0x54')]=function(_0x36bf2a,_0x2a6766,_0x39985e){var _0x1afe87={};_0x1afe87[_0x2a6766]=_0x36bf2a[_0x2a6766];_0x1afe87[_0xf46a('0x55')]=![];_0x1afe87[_0xf46a('0x56')]=moment()[_0xf46a('0x57')](_0x39985e,'minutes')[_0xf46a('0x13')](_0xf46a('0x39'));_0x1afe87['ContactId']=_0x36bf2a[_0xf46a('0x1b')];_0x1afe87['ListId']=_0x36bf2a[_0xf46a('0x58')];_0x1afe87['VoiceQueueId']=_0x36bf2a[_0xf46a('0x1d')]||undefined;return _0x1afe87;};exports[_0xf46a('0x59')]=function(_0x176f7f,_0x429b31){if(!_[_0xf46a('0x16')](_0x176f7f)){if(_0x176f7f[_0xf46a('0x5a')]>0x0){_0x176f7f[_0xf46a('0x5a')]-=0x1;}else{logger[_0xf46a('0x8')](_0x429b31,_0xf46a('0x5b'));}}else{logger[_0xf46a('0x8')](_0x429b31,_0xf46a('0x5c'));}};exports[_0xf46a('0x5d')]=function(_0x1fb166){if(_0x1fb166<=0x0){return!![];}return![];};exports[_0xf46a('0x5e')]=function(_0x3c5697,_0x3ccb6f,_0x2f8d43){_0x3c5697[_0xf46a('0x5f')]=_0x3ccb6f;_0x3c5697[_0xf46a('0x18')]=_0x3c5697[_0xf46a('0x60')];_0x3c5697[_0xf46a('0x61')]=_0x3c5697[_0xf46a('0x4b')];if(_0x2f8d43){_0x3c5697[_0xf46a('0x62')]=_0x2f8d43['mandatoryDisposition'];}return _0x3c5697;};exports[_0xf46a('0x63')]=function(_0x15b18d){var _0x6b7d1d={};_0x6b7d1d[_0xf46a('0x60')]=_0x15b18d[_0xf46a('0x60')];_0x6b7d1d[_0xf46a('0x61')]=_0x15b18d[_0xf46a('0x4b')];_0x6b7d1d['uniqueid']=_0x15b18d[_0xf46a('0x49')];return _0x6b7d1d;};exports[_0xf46a('0x64')]=function(_0x1b2b36){var _0x2991bc=[];for(var _0x3a71e0 in _0x1b2b36){if(_0x1b2b36[_0xf46a('0x2d')](_0x3a71e0)){if(!_[_0xf46a('0x16')](_0x1b2b36[_0x3a71e0])&&_0x1b2b36[_0x3a71e0]['state']==='not_inuse'&&_0x1b2b36[_0x3a71e0][_0xf46a('0x65')]===_0xf46a('0x66')){_0x2991bc[_0xf46a('0x67')](_0x1b2b36[_0x3a71e0]['id']);}}}return _0x2991bc;};exports[_0xf46a('0x68')]=function(_0x20d11b){var _0x26b4fb=moment()[_0xf46a('0x5')](0x0);var _0x482c0a=moment(_0x20d11b)[_0xf46a('0x5')](0x0);return _0x26b4fb[_0xf46a('0x6')](_0x482c0a,_0xf46a('0x69'));};exports[_0xf46a('0x6a')]=function(_0x3b9395){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3b9395[_0xf46a('0x1b')],'ListId':_0x3b9395[_0xf46a('0x58')],'VoiceQueueId':_0x3b9395[_0xf46a('0x1d')]||undefined,'CampaignId':_0x3b9395['CampaignId']||undefined};};exports[_0xf46a('0x6b')]=function(_0xa5e46){if(_0xa5e46==='uniqueid'||_0xa5e46===_0xf46a('0x6c')||_0xa5e46==='queue'||_0xa5e46===_0xf46a('0x6d')||_0xa5e46===_0xf46a('0x6e')||_0xa5e46===_0xf46a('0x6f')||_0xa5e46===_0xf46a('0x42')||_0xa5e46===_0xf46a('0x4b')||_0xa5e46===_0xf46a('0x19')||_0xa5e46===_0xf46a('0x55')||_0xa5e46===_0xf46a('0x1a')||_0xa5e46===_0xf46a('0x56')||_0xa5e46===_0xf46a('0x4f')||_0xa5e46===_0xf46a('0x50')||_0xa5e46==='countnoanswerretry'||_0xa5e46==='countglobal'||_0xa5e46===_0xf46a('0x70')||_0xa5e46==='callbackuniqueid'||_0xa5e46===_0xf46a('0x71')||_0xa5e46==='recallme'||_0xa5e46===_0xf46a('0x1b')||_0xa5e46===_0xf46a('0x58')||_0xa5e46===_0xf46a('0x72')||_0xa5e46===_0xf46a('0x1d')||_0xa5e46===_0xf46a('0x73')||_0xa5e46===_0xf46a('0x74')||_0xa5e46==='xmd-queue'||_0xa5e46==='xmd-phone'||_0xa5e46==='xmd-listid'||_0xa5e46===_0xf46a('0x75')||_0xa5e46===_0xf46a('0x76')||_0xa5e46===_0xf46a('0x77')||_0xa5e46===_0xf46a('0x78')||_0xa5e46==='xmd-dialchannel'||_0xa5e46==='xmd-contactid'||_0xa5e46===_0xf46a('0x79')||_0xa5e46===_0xf46a('0x7a')||_0xa5e46==='xmd-agiafter'||_0xa5e46===_0xf46a('0x7b')||_0xa5e46==='rtpaudioqos'||_0xa5e46==='rtpaudioqosbridged'||_0xa5e46==='rtpaudioqosjitter'||_0xa5e46===_0xf46a('0x7c')||_0xa5e46===_0xf46a('0x7d')||_0xa5e46===_0xf46a('0x7e')||_0xa5e46===_0xf46a('0x7f')||_0xa5e46===_0xf46a('0x80')||_0xa5e46==='rtpaudioqos'||_0xa5e46===_0xf46a('0x81')||_0xa5e46===_0xf46a('0x82')||_0xa5e46===_0xf46a('0x7c')||_0xa5e46===_0xf46a('0x7d')||_0xa5e46===_0xf46a('0x7e')||_0xa5e46===_0xf46a('0x7f')||_0xa5e46===_0xf46a('0x80')||_0xa5e46===_0xf46a('0x83')||_0xa5e46===_0xf46a('0x84')||_0xa5e46==='state'||_0xa5e46===_0xf46a('0x3f')){return![];}return!![];};exports[_0xf46a('0x85')]=function(_0x481f0d,_0x3d08ba){var _0x1165d6,_0x5b01fb,_0x33cd3d;if(_0x3d08ba<=0x0){_0x3d08ba=0x1;}_0x1165d6=new RegExp(_0xf46a('0x86')+_0x3d08ba+'}$');_0x5b01fb=Math['pow'](0xa,_0x3d08ba-0x1);_0x33cd3d=Math[_0xf46a('0x87')](0xa,_0x3d08ba)-0x1;return util[_0xf46a('0x13')]('%s',_[_0xf46a('0x88')](_0x481f0d,_0x1165d6,_[_0xf46a('0x89')](_0x5b01fb,_0x33cd3d)));};exports[_0xf46a('0x8a')]=function(_0x4b4810){var _0x20c5ea=_0x4b4810[_0xf46a('0x8b')](/"(.*?)"/);return _0x20c5ea?_0x20c5ea[0x1]:_0x4b4810;};exports[_0xf46a('0x8c')]=function(_0x4d3301){var _0x2d8a13=_0x4d3301['match'](/<(.*?)>/);return _0x2d8a13?_0x2d8a13[0x1]:_0x4d3301;}; \ No newline at end of file +var _0xf865=['callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','format','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isNil','Queue','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','endtime','logAgent','responsetime','membername','UserId','logCustomer','ringtime','talktime','answertime','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','cloneAction','clone','statedesc','scheduledAt','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','interface','motionChannel','mandatoryDisposition','buildAcw','queue','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','active','countnoanswerretry','countglobal'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf865,0xaa));var _0x5f86=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0xf865[_0x1ca9eb];return _0x2e284e;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5f86('0x0'));var logger=require(_0x5f86('0x1'))(_0x5f86('0x2'));var ipAgi=process[_0x5f86('0x3')]['XCALLY_IP_AGI']||_0x5f86('0x4');function getSeconds(_0x1e1378,_0x276d29){var _0x1cf477=moment(_0x1e1378)[_0x5f86('0x5')](0x0);var _0x5901ec=moment(_0x276d29)[_0x5f86('0x5')](0x0);return _0x1cf477[_0x5f86('0x6')](_0x5901ec,_0x5f86('0x7'));}exports[_0x5f86('0x8')]=function(_0xd8fe03){return function(_0xd1f735){logger[_0x5f86('0x9')](_0xd8fe03,util[_0x5f86('0xa')](_0xd1f735,{'showHidden':![],'depth':null}));};};exports[_0x5f86('0xb')]=function(_0x21609b,_0x47248c){logger[_0x5f86('0xc')](_0x21609b,util['inspect'](_0x47248c,{'showHidden':![],'depth':null}));};exports[_0x5f86('0xd')]=function(_0x1466dd,_0x54f008){logger[_0x5f86('0x9')](_0x1466dd,util[_0x5f86('0xa')](_0x54f008,{'showHidden':![],'depth':null}));};exports[_0x5f86('0xe')]=function(_0x26b0fd){return function(_0x5c68b8){logger[_0x5f86('0xc')](_0x26b0fd,util['inspect'](_0x5c68b8,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x49d10d,_0x200347,_0x79d367){return{'message':_0x49d10d,'unlock':_0x200347,'active':_0x79d367};};exports[_0x5f86('0xf')]=function(_0x4f7b91,_0x200d4d,_0x1852ad){if(!_[_0x5f86('0x10')](_0x1852ad)&&'string'===typeof _0x1852ad&&!_['isEmpty'](_0x1852ad)){if(!_[_0x5f86('0x10')](_0x200d4d)&&_0x5f86('0x11')===typeof _0x200d4d&&!_['isEmpty'](_0x200d4d)){return util[_0x5f86('0x12')](_0x5f86('0x13'),_0x200d4d,_0x1852ad);}return util[_0x5f86('0x12')]('\x22%s\x22\x20<%s>',_0x1852ad,_0x1852ad);}if(!_[_0x5f86('0x10')](_0x4f7b91)&&_0x5f86('0x11')===typeof _0x4f7b91&&!_[_0x5f86('0x14')](_0x4f7b91)){return _0x4f7b91;}return _0x5f86('0x15');};exports['isActive']=function(_0x28cd0f){if(_[_0x5f86('0x16')](_0x28cd0f)){return![];}return _0x28cd0f;};exports['addVariables']=function(_0x3d315f,_0xc3f479,_0x4e5ae6,_0x1ad061,_0x4f730a,_0x389461){var _0x2643fc={'XMD-QUEUE':_0xc3f479['Queue']?_0xc3f479[_0x5f86('0x17')]['name']:'','XMD-CALLERID':_0x1ad061,'XMD-CALLERID-PREVIEW':_0x389461?util['format'](_0x5f86('0x13'),_0x389461['calleridname'],_0x389461[_0x5f86('0x18')]):_0x1ad061,'XMD-DIALID':_0x4f730a,'XMD-CONTACTID':_0xc3f479[_0x5f86('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1ad061,'XMD-VOICEQUEUEID':_0xc3f479[_0x5f86('0x1a')],'XMD-DIALCHANNEL':_0x4e5ae6,'XMD-DIALTIMEOUT':_0x3d315f[_0x5f86('0x1b')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x5f86('0x1c'),_0x3d315f[_0x5f86('0x1d')]?'g':'',_[_0x5f86('0x14')](_0x3d315f[_0x5f86('0x1e')])?'':_0x5f86('0x1f')),'XMD-DIALURL':_0x3d315f[_0x5f86('0x20')]||'','XMD-AGI':_0x3d315f[_0x5f86('0x21')]?util[_0x5f86('0x12')](_0x5f86('0x22'),ipAgi,_0x3d315f[_0x5f86('0x21')]):_0x5f86('0x23'),'XMD-AGIAFTER':_0x3d315f[_0x5f86('0x1d')]?util['format'](_0x5f86('0x22'),ipAgi,_0x3d315f['dialQueueProject2']):_0x5f86('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x389461?_0x389461['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x389461?_0x389461[_0x5f86('0x24')]:'','XMD-DESTINATION':_0x5f86('0x25')};if(!_['isEmpty'](_0x3d315f[_0x5f86('0x1e')])){_0x2643fc[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x3d315f[_0x5f86('0x1e')];_0x2643fc[util[_0x5f86('0x12')]('%s',_0x5f86('0x26'))]=_0x4f730a;}if(_0xc3f479&&_0xc3f479[_0x5f86('0x27')]){for(var _0x4234ff in _0xc3f479[_0x5f86('0x27')]){if(_0xc3f479[_0x5f86('0x27')][_0x5f86('0x28')](_0x4234ff)){if(!_['isNil'](_0xc3f479[_0x5f86('0x27')][_0x4234ff])&&_0x4234ff!=='id'&&_0x4234ff!==_0x5f86('0x29')&&_0x4234ff!==_0x5f86('0x2a')&&_0x4234ff!==_0x5f86('0x2b')){_0x2643fc[util['format'](_0x5f86('0x2c'),_0x5f86('0x2d'),_[_0x5f86('0x2e')](_0x4234ff))]=_0xc3f479[_0x5f86('0x27')][_0x4234ff];}}}}return _0x2643fc;};exports['toLowerVariables']=function(_0x5908be){var _0x44b6d1={};for(var _0x3a30c8 in _0x5908be){if(_0x5908be[_0x5f86('0x28')](_0x3a30c8)){_0x44b6d1[util[_0x5f86('0x12')]('%s',_[_0x5f86('0x2f')](_0x3a30c8))]=_0x5908be[_0x3a30c8];}}return{'variables':_0x44b6d1};};exports[_0x5f86('0x30')]=function(_0xd3b2f2,_0x4eff01){if(!_[_0x5f86('0x16')](_0xd3b2f2)){if(_0xd3b2f2['hasOwnProperty'](_0x5f86('0x31'))){if(_0xd3b2f2['originated']>0x0){_0xd3b2f2[_0x5f86('0x31')]-=0x1;}else{logger[_0x5f86('0x9')](_0x5f86('0x32'),_0x4eff01);}}}else{logger['error'](_0x5f86('0x33'),_0x4eff01);}};exports[_0x5f86('0x34')]=function(_0x4a2922){var _0x250e82=moment()[_0x5f86('0x12')](_0x5f86('0x35'));_0x4a2922[_0x5f86('0x36')]=0xd;_0x4a2922['statedesc']=_0x5f86('0x37');_0x4a2922[_0x5f86('0x38')]=_0x250e82;_0x4a2922['responsetime']=_0x250e82;_0x4a2922[_0x5f86('0x39')]=_0x250e82;};exports[_0x5f86('0x3a')]=function(_0x2b0272,_0x540913,_0x493f7e){var _0x3d91da=moment()['format'](_0x5f86('0x35'));_0x2b0272[_0x5f86('0x36')]=_0x540913;_0x2b0272['statedesc']=_0x493f7e;_0x2b0272[_0x5f86('0x3b')]=_0x3d91da;_0x2b0272['ringtime']=getSeconds(_0x2b0272[_0x5f86('0x3b')],_0x2b0272[_0x5f86('0x38')]);};exports['logLookAgent']=function(_0x905e25,_0x3fee33,_0x14ccc8){_0x905e25[_0x5f86('0x3c')]=_0x3fee33;_0x905e25[_0x5f86('0x3d')]=_0x14ccc8;};exports[_0x5f86('0x3e')]=function(_0x42fdd2,_0x2abce5,_0x39c59a){var _0x3c2963=moment()[_0x5f86('0x12')](_0x5f86('0x35'));_0x42fdd2[_0x5f86('0x36')]=_0x2abce5;_0x42fdd2['statedesc']=_0x39c59a;_0x42fdd2[_0x5f86('0x3b')]=_0x42fdd2[_0x5f86('0x3b')]?_0x42fdd2[_0x5f86('0x3b')]:_0x3c2963;_0x42fdd2[_0x5f86('0x39')]=_0x42fdd2[_0x5f86('0x39')]?_0x42fdd2['endtime']:_0x3c2963;_0x42fdd2[_0x5f86('0x3f')]=getSeconds(_0x42fdd2[_0x5f86('0x3b')]||0x0,_0x42fdd2['starttime']||0x0);_0x42fdd2[_0x5f86('0x40')]=_0x42fdd2[_0x5f86('0x41')]?getSeconds(_0x42fdd2[_0x5f86('0x39')],_0x42fdd2[_0x5f86('0x41')]):0x0;};exports['isFailure']=function(_0x2bcc2a){return _0x2bcc2a===_0x5f86('0x42');};exports[_0x5f86('0x43')]=function(_0x11f406,_0x4a961e,_0x465222,_0x4b6b0e,_0x2972b0){var _0x313095=_0x4b6b0e?_0x5f86('0x44'):_0x11f406[_0x5f86('0x45')];_0x313095=_0x2972b0?_0x5f86('0x46'):_0x313095;return{'actionid':_0x11f406[_0x5f86('0x47')],'action':_0x5f86('0x48'),'channel':_0x11f406[_0x5f86('0x49')],'callerid':util[_0x5f86('0x12')](_0x5f86('0x13'),_0x313095,_0x11f406[_0x5f86('0x18')]),'Exten':_0x5f86('0x25'),'Context':_0x5f86('0x4a'),'Priority':'1','variable':_0x465222,'timeout':(_0x4a961e[_0x5f86('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x11f406[_0x5f86('0x47')]};};exports[_0x5f86('0x4c')]=function(_0x364ec5){return _0x364ec5[_0x5f86('0x4d')]+_0x364ec5[_0x5f86('0x4e')]+_0x364ec5['countnoanswerretry']+_0x364ec5[_0x5f86('0x4f')]+_0x364ec5['countnosuchnumberretry'];};exports[_0x5f86('0x50')]=function(_0x31ed6f){var _0x9eaee0=_[_0x5f86('0x51')](_0x31ed6f);_0x9eaee0[_0x5f86('0x36')]=0xf;_0x9eaee0[_0x5f86('0x52')]='Global';return _0x9eaee0;};exports[_0x5f86('0x53')]=function(_0x549026,_0x35f938,_0x2c504e){var _0x26c759={};_0x26c759[_0x35f938]=_0x549026[_0x35f938];_0x26c759['active']=![];_0x26c759[_0x5f86('0x54')]=moment()[_0x5f86('0x55')](_0x2c504e,_0x5f86('0x56'))['format'](_0x5f86('0x35'));_0x26c759['ContactId']=_0x549026[_0x5f86('0x19')];_0x26c759[_0x5f86('0x57')]=_0x549026[_0x5f86('0x57')];_0x26c759[_0x5f86('0x1a')]=_0x549026['VoiceQueueId']||undefined;return _0x26c759;};exports['decrementTalkink']=function(_0x3dcd32,_0xc8ff66){if(!_['isNil'](_0x3dcd32)){if(_0x3dcd32[_0x5f86('0x58')]>0x0){_0x3dcd32[_0x5f86('0x58')]-=0x1;}else{logger['error'](_0xc8ff66,_0x5f86('0x59'));}}else{logger[_0x5f86('0x9')](_0xc8ff66,_0x5f86('0x5a'));}};exports[_0x5f86('0x5b')]=function(_0x253a8f){if(_0x253a8f<=0x0){return!![];}return![];};exports[_0x5f86('0x5c')]=function(_0x422f39,_0x2d463b,_0x4bf2b8){_0x422f39['lastevent']=_0x2d463b;_0x422f39['name']=_0x422f39['queue'];_0x422f39[_0x5f86('0x5d')]=_0x422f39[_0x5f86('0x49')];_0x422f39[_0x5f86('0x5e')]='voice';if(_0x4bf2b8){_0x422f39[_0x5f86('0x5f')]=_0x4bf2b8[_0x5f86('0x5f')];}return _0x422f39;};exports[_0x5f86('0x60')]=function(_0x2b7c0a){var _0x4b696f={};_0x4b696f['queue']=_0x2b7c0a[_0x5f86('0x61')];_0x4b696f[_0x5f86('0x5d')]=_0x2b7c0a[_0x5f86('0x49')];_0x4b696f[_0x5f86('0x47')]=_0x2b7c0a[_0x5f86('0x47')];return _0x4b696f;};exports['agentReadyId']=function(_0x1aeb17){var _0x5d9535=[];for(var _0x3a66b1 in _0x1aeb17){if(_0x1aeb17['hasOwnProperty'](_0x3a66b1)){if(!_[_0x5f86('0x16')](_0x1aeb17[_0x3a66b1])&&_0x1aeb17[_0x3a66b1][_0x5f86('0x36')]===_0x5f86('0x62')&&_0x1aeb17[_0x3a66b1][_0x5f86('0x63')]===_0x5f86('0x64')){_0x5d9535[_0x5f86('0x65')](_0x1aeb17[_0x3a66b1]['id']);}}}return _0x5d9535;};exports[_0x5f86('0x66')]=function(_0x55fcca){var _0x473621=moment()['milliseconds'](0x0);var _0x150173=moment(_0x55fcca)[_0x5f86('0x5')](0x0);return _0x473621[_0x5f86('0x6')](_0x150173,_0x5f86('0x7'));};exports[_0x5f86('0x67')]=function(_0x383824){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x383824['ContactId'],'ListId':_0x383824[_0x5f86('0x57')],'VoiceQueueId':_0x383824[_0x5f86('0x1a')]||undefined,'CampaignId':_0x383824[_0x5f86('0x68')]||undefined};};exports[_0x5f86('0x69')]=function(_0x36fc3f){if(_0x36fc3f==='uniqueid'||_0x36fc3f===_0x5f86('0x6a')||_0x36fc3f===_0x5f86('0x61')||_0x36fc3f==='type'||_0x36fc3f===_0x5f86('0x6b')||_0x36fc3f===_0x5f86('0x6c')||_0x36fc3f==='membername'||_0x36fc3f===_0x5f86('0x49')||_0x36fc3f===_0x5f86('0x45')||_0x36fc3f===_0x5f86('0x6d')||_0x36fc3f===_0x5f86('0x18')||_0x36fc3f===_0x5f86('0x54')||_0x36fc3f===_0x5f86('0x4d')||_0x36fc3f===_0x5f86('0x4e')||_0x36fc3f===_0x5f86('0x6e')||_0x36fc3f===_0x5f86('0x6f')||_0x36fc3f===_0x5f86('0x70')||_0x36fc3f===_0x5f86('0x71')||_0x36fc3f===_0x5f86('0x72')||_0x36fc3f==='recallme'||_0x36fc3f===_0x5f86('0x19')||_0x36fc3f===_0x5f86('0x57')||_0x36fc3f==='UserId'||_0x36fc3f===_0x5f86('0x1a')||_0x36fc3f===_0x5f86('0x73')||_0x36fc3f===_0x5f86('0x74')||_0x36fc3f===_0x5f86('0x75')||_0x36fc3f===_0x5f86('0x76')||_0x36fc3f===_0x5f86('0x77')||_0x36fc3f===_0x5f86('0x78')||_0x36fc3f===_0x5f86('0x79')||_0x36fc3f==='xmd-dialoptions'||_0x36fc3f===_0x5f86('0x7a')||_0x36fc3f===_0x5f86('0x7b')||_0x36fc3f===_0x5f86('0x7c')||_0x36fc3f==='xmd-cdrtype'||_0x36fc3f==='xmd-callerid'||_0x36fc3f==='xmd-agiafter'||_0x36fc3f===_0x5f86('0x7d')||_0x36fc3f===_0x5f86('0x7e')||_0x36fc3f==='rtpaudioqosbridged'||_0x36fc3f===_0x5f86('0x7f')||_0x36fc3f==='rtpaudioqosjitterbridged'||_0x36fc3f===_0x5f86('0x80')||_0x36fc3f===_0x5f86('0x81')||_0x36fc3f===_0x5f86('0x82')||_0x36fc3f===_0x5f86('0x83')||_0x36fc3f==='rtpaudioqos'||_0x36fc3f===_0x5f86('0x84')||_0x36fc3f===_0x5f86('0x7f')||_0x36fc3f==='rtpaudioqosjitterbridged'||_0x36fc3f===_0x5f86('0x80')||_0x36fc3f===_0x5f86('0x81')||_0x36fc3f===_0x5f86('0x82')||_0x36fc3f==='rtpaudioqosrttbridged'||_0x36fc3f===_0x5f86('0x85')||_0x36fc3f===_0x5f86('0x86')||_0x36fc3f===_0x5f86('0x36')||_0x36fc3f==='statedesc'){return![];}return!![];};exports[_0x5f86('0x87')]=function(_0x370bf3,_0x281df4){var _0x152e39,_0x1c33da,_0x4be341;if(_0x281df4<=0x0){_0x281df4=0x1;}_0x152e39=new RegExp(_0x5f86('0x88')+_0x281df4+'}$');_0x1c33da=Math[_0x5f86('0x89')](0xa,_0x281df4-0x1);_0x4be341=Math[_0x5f86('0x89')](0xa,_0x281df4)-0x1;return util['format']('%s',_[_0x5f86('0x8a')](_0x370bf3,_0x152e39,_[_0x5f86('0x8b')](_0x1c33da,_0x4be341)));};exports['extractCalleridName']=function(_0x1e9ab7){var _0x3c2218=_0x1e9ab7[_0x5f86('0x8c')](/"(.*?)"/);return _0x3c2218?_0x3c2218[0x1]:_0x1e9ab7;};exports['extractCalleridNumber']=function(_0x314dfe){var _0x38837d=_0x314dfe[_0x5f86('0x8c')](/<(.*?)>/);return _0x38837d?_0x38837d[0x1]:_0x314dfe;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f3c303b..034028a 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 _0x84cd=['voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','boolean','queueremove','queuepause','reload'];(function(_0x3e1ae5,_0x223886){var _0x4c7662=function(_0xc5a60){while(--_0xc5a60){_0x3e1ae5['push'](_0x3e1ae5['shift']());}};_0x4c7662(++_0x223886);}(_0x84cd,0x16b));var _0xd84c=function(_0x5e1ad3,_0xea6ae){_0x5e1ad3=_0x5e1ad3-0x0;var _0x3124ac=_0x84cd[_0x5e1ad3];return _0x3124ac;};'use strict';exports[_0xd84c('0x0')]={'queue':{'type':_0xd84c('0x1'),'required':!![]},'interface':{'type':_0xd84c('0x1'),'required':!![]},'membername':{'type':_0xd84c('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xd84c('0x2'),'required':![]}};exports[_0xd84c('0x3')]={'queue':{'type':_0xd84c('0x1'),'required':!![]},'interface':{'type':_0xd84c('0x1'),'required':!![]}};exports[_0xd84c('0x4')]={'interface':{'type':_0xd84c('0x1'),'required':!![]},'paused':{'type':_0xd84c('0x2')},'reason':{'type':_0xd84c('0x1'),'required':![]}};exports[_0xd84c('0x5')]={'module':{'type':_0xd84c('0x1'),'required':![]}};exports[_0xd84c('0x6')]={'uniqueid':{'type':_0xd84c('0x1'),'required':!![]}};exports[_0xd84c('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xd84c('0x1')},'format':{'type':_0xd84c('0x1')},'mixmonitorid':{'type':_0xd84c('0x1')}};exports[_0xd84c('0x8')]={'uniqueid':{'type':_0xd84c('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xd84c('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xd84c('0x1')}}; \ No newline at end of file +var _0x00e2=['queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove'];(function(_0x469515,_0x19aba8){var _0x5b5c08=function(_0x342288){while(--_0x342288){_0x469515['push'](_0x469515['shift']());}};_0x5b5c08(++_0x19aba8);}(_0x00e2,0x109));var _0x200e=function(_0x3cf1b1,_0x445a0a){_0x3cf1b1=_0x3cf1b1-0x0;var _0x347602=_0x00e2[_0x3cf1b1];return _0x347602;};'use strict';exports[_0x200e('0x0')]={'queue':{'type':_0x200e('0x1'),'required':!![]},'interface':{'type':_0x200e('0x1'),'required':!![]},'membername':{'type':_0x200e('0x1'),'required':!![]},'penalty':{'type':_0x200e('0x2'),'required':![]},'paused':{'type':_0x200e('0x3'),'required':![]}};exports[_0x200e('0x4')]={'queue':{'type':_0x200e('0x1'),'required':!![]},'interface':{'type':_0x200e('0x1'),'required':!![]}};exports[_0x200e('0x5')]={'interface':{'type':_0x200e('0x1'),'required':!![]},'paused':{'type':_0x200e('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x200e('0x1'),'required':![]}};exports[_0x200e('0x6')]={'uniqueid':{'type':_0x200e('0x1'),'required':!![]}};exports[_0x200e('0x7')]={'uniqueid':{'type':_0x200e('0x1'),'required':!![]},'filename':{'type':_0x200e('0x1')},'format':{'type':_0x200e('0x1')},'mixmonitorid':{'type':_0x200e('0x1')}};exports[_0x200e('0x8')]={'uniqueid':{'type':_0x200e('0x1'),'required':!![]}};exports[_0x200e('0x9')]={'uniqueid':{'type':_0x200e('0x1'),'required':!![]},'exten':{'type':_0x200e('0x1'),'required':!![]},'context':{'type':_0x200e('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 48fddde..7f07152 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 _0xc3da=['deskAccounts','vtigerAccounts','servicenowAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isUndefined','telephones','length','initVoiceQueues','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initVtigerAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','diff','initVoiceCallReports','duration','disposition','ANSWERED','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','triggers','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts'];(function(_0x28ddc5,_0x39a28c){var _0xa2ebf2=function(_0x373456){while(--_0x373456){_0x28ddc5['push'](_0x28ddc5['shift']());}};_0xa2ebf2(++_0x39a28c);}(_0xc3da,0x122));var _0xac3d=function(_0x53cc16,_0x1c0870){_0x53cc16=_0x53cc16-0x0;var _0x282f65=_0xc3da[_0x53cc16];return _0x282f65;};'use strict';var BPromise=require('bluebird');var util=require(_0xac3d('0x0'));var _=require(_0xac3d('0x1'));var moment=require(_0xac3d('0x2'));var Agent=require(_0xac3d('0x3'));var Telephone=require(_0xac3d('0x4'));var Trunk=require(_0xac3d('0x5'));var VoiceQueue=require(_0xac3d('0x6'));var Trigger=require(_0xac3d('0x7'));var Template=require('../model/template');var Campaign=require(_0xac3d('0x8'));var VoiceExtension=require(_0xac3d('0x9'));var ZendeskAccount=require(_0xac3d('0xa'));var SalesforceAccount=require(_0xac3d('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xac3d('0xc'));var ZohoAccount=require(_0xac3d('0xd'));var DeskAccount=require(_0xac3d('0xe'));var VtigerAccount=require(_0xac3d('0xf'));var ServicenowAccount=require(_0xac3d('0x10'));var Dynamics365Account=require(_0xac3d('0x11'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xac3d('0x12'));var Realtime=function(){this[_0xac3d('0x13')]={};this['telephones']={};this[_0xac3d('0x14')]={};this[_0xac3d('0x15')]={};this[_0xac3d('0x16')]={};this['campaigns']={};this['templates']={};this[_0xac3d('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xac3d('0x18')]={};this[_0xac3d('0x19')]={};this[_0xac3d('0x1a')]={};this[_0xac3d('0x1b')]={};this[_0xac3d('0x1c')]={};this['settings']={};this[_0xac3d('0x1d')]={};this[_0xac3d('0x1e')]={};this[_0xac3d('0x1f')]={};this[_0xac3d('0x20')]={};this[_0xac3d('0x21')]={};this[_0xac3d('0x22')]={};this[_0xac3d('0x23')]={};this[_0xac3d('0x24')]={};this['dynamics365Accounts']={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x22ba28,_0x56caa4,_0x2913f6){var _0x459581=_['mapKeys'](_0x22ba28,function(_0x2c9de3,_0x3a2a4d){return _0x2c9de3[_0x2913f6];});for(var _0x3da7d6 in _0x56caa4){if(_0x56caa4['hasOwnProperty'](_0x3da7d6)){if(!_0x459581[_0x3da7d6]){delete _0x56caa4[_0x3da7d6];}}}}function freeIsNotKeySip(_0x80c892,_0x23c433){var _0x39ae34=_[_0xac3d('0x25')](_0x80c892,function(_0x3a31b2,_0x1c1632){return util[_0xac3d('0x26')](_0xac3d('0x27'),_0x3a31b2[_0xac3d('0x28')]);});for(var _0x54a4f2 in _0x23c433){if(_0x23c433[_0xac3d('0x29')](_0x54a4f2)){if(!_0x39ae34[_0x54a4f2]){delete _0x23c433[_0x54a4f2];}}}}function freeIsNotKeyAgent(_0x1f6d5c,_0x1c5cb2){var _0x288f6f=_[_0xac3d('0x25')](_0x1f6d5c,function(_0x5c6d6c,_0x32dde6){var _0x5ed1dd=_[_0xac3d('0x2a')](_0x5c6d6c['interface'])?util['format'](_0xac3d('0x27'),_0x5c6d6c[_0xac3d('0x28')]):_0x5c6d6c[_0xac3d('0x2b')];return _0x5ed1dd;});for(var _0x2640a6 in _0x1c5cb2){if(_0x1c5cb2[_0xac3d('0x29')](_0x2640a6)){if(!_0x288f6f[_0x2640a6]){delete _0x1c5cb2[_0x2640a6];}}}}function clearVoiceCallReports(_0x557ae6){_0x557ae6[_0xac3d('0x2c')]=0x0;_0x557ae6['answered']=0x0;_0x557ae6[_0xac3d('0x2d')]=0x0;_0x557ae6[_0xac3d('0x2e')]=0x0;_0x557ae6[_0xac3d('0x2f')]=0x0;}function clearCampaigns(_0xf75ca9){if(!_[_0xac3d('0x30')](_0xf75ca9)){for(var _0x1b6237 in _0xf75ca9){if(_0xf75ca9[_0xac3d('0x29')](_0x1b6237)){_0xf75ca9[_0x1b6237][_0xac3d('0x31')]=0x0;_0xf75ca9[_0x1b6237][_0xac3d('0x32')]=0x0;}}}}function clearVoiceQueues(_0x12a40c){if(!_[_0xac3d('0x30')](_0x12a40c)){for(var _0xc411cf in _0x12a40c){if(_0x12a40c['hasOwnProperty'](_0xc411cf)){_0x12a40c[_0xc411cf]['total']=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x33')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x34')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x35')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x2d')]=0x0;_0x12a40c[_0xc411cf]['sumDuration']=0x0;_0x12a40c[_0xc411cf]['sumBillable']=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x36')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x37')]=0x0;_0x12a40c[_0xc411cf]['outboundBusyCallsDay']=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x38')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x39')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3a')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3b')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3c')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3d')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3e')]=0x0;_0x12a40c[_0xc411cf]['outboundRejectCallsDay']=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3f')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x36')]=0x0;_0x12a40c[_0xc411cf]['outboundAnswerCallsDay']=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x40')]=!![];}}}}Realtime[_0xac3d('0x41')][_0xac3d('0x42')]=function(_0x28c41d,_0x398eaa){for(var _0x503bbb in _0x398eaa){if(_0x28c41d[_0xac3d('0x29')](_0x503bbb)){_0x28c41d[_0x503bbb]=_0x398eaa[_0x503bbb];}}};Realtime[_0xac3d('0x41')][_0xac3d('0x43')]=function(){var _0xb0a614=this;return function(_0x588edd){if(_0x588edd){freeIsNotKeyAgent(_0x588edd,_0xb0a614[_0xac3d('0x13')]);for(var _0x50c3dd=0x0,_0xca096a={},_0x3b9072={};_0x50c3dd<_0x588edd['length'];_0x50c3dd+=0x1){_0xca096a=_0x588edd[_0x50c3dd];var _0x165409=_[_0xac3d('0x2a')](_0xca096a[_0xac3d('0x2b')])?util['format'](_0xac3d('0x27'),_0xca096a[_0xac3d('0x28')]):_0xca096a[_0xac3d('0x2b')];if(_[_0xac3d('0x44')](_0xb0a614[_0xac3d('0x13')][_0x165409])){_0xb0a614[_0xac3d('0x13')][_0x165409]=new Agent(_0xca096a);}else{_0xb0a614[_0xac3d('0x42')](_0xb0a614[_0xac3d('0x13')][_0x165409],_0xca096a);}}}return _0xb0a614[_0xac3d('0x13')];};};Realtime[_0xac3d('0x41')]['initTelephones']=function(){var _0x3ed5d9=this;return function(_0x45c695){if(_0x45c695){freeIsNotKeySip(_0x45c695,_0x3ed5d9[_0xac3d('0x45')]);for(var _0x5de230=0x0,_0xe8820e={},_0x5d6ae5={};_0x5de230<_0x45c695[_0xac3d('0x46')];_0x5de230+=0x1){_0xe8820e=_0x45c695[_0x5de230];if(_['isUndefined'](_0x3ed5d9[_0xac3d('0x45')][util[_0xac3d('0x26')]('SIP/%s',_0xe8820e['name'])])){_0x3ed5d9[_0xac3d('0x45')][util[_0xac3d('0x26')](_0xac3d('0x27'),_0xe8820e[_0xac3d('0x28')])]=new Telephone(_0xe8820e);}else{_0x3ed5d9[_0xac3d('0x42')](_0x3ed5d9[_0xac3d('0x45')][util[_0xac3d('0x26')](_0xac3d('0x27'),_0xe8820e[_0xac3d('0x28')])],_0xe8820e);}}}return _0x3ed5d9[_0xac3d('0x45')];};};Realtime[_0xac3d('0x41')]['initTrunks']=function(){var _0x63700b=this;return function(_0x2aaff8){if(_0x2aaff8){freeIsNotKeySip(_0x2aaff8,_0x63700b[_0xac3d('0x14')]);for(var _0xdd1994=0x0,_0x1ba900={},_0x18eb21={};_0xdd1994<_0x2aaff8[_0xac3d('0x46')];_0xdd1994+=0x1){_0x1ba900=_0x2aaff8[_0xdd1994];if(_[_0xac3d('0x44')](_0x63700b[_0xac3d('0x14')][util[_0xac3d('0x26')](_0xac3d('0x27'),_0x1ba900['name'])])){_0x63700b[_0xac3d('0x14')][util['format']('SIP/%s',_0x1ba900[_0xac3d('0x28')])]=new Trunk(_0x1ba900);}else{_0x63700b['mergeFromDatabase'](_0x63700b['trunks'][util['format'](_0xac3d('0x27'),_0x1ba900[_0xac3d('0x28')])],_0x1ba900);}}}return _0x63700b['trunks'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x47')]=function(){var _0x1b117f=this;return function(_0x1c6ed4){if(_0x1c6ed4){freeIsNotKey(_0x1c6ed4,_0x1b117f[_0xac3d('0x15')],_0xac3d('0x28'));for(var _0x45df18=0x0,_0x30dab1={},_0x5d093c={};_0x45df18<_0x1c6ed4[_0xac3d('0x46')];_0x45df18+=0x1){_0x30dab1=_0x1c6ed4[_0x45df18];if(_[_0xac3d('0x44')](_0x1b117f[_0xac3d('0x15')][_0x30dab1[_0xac3d('0x28')]])){_0x1b117f[_0xac3d('0x15')][_0x30dab1[_0xac3d('0x28')]]=new VoiceQueue(_0x30dab1);}else{_0x1b117f[_0xac3d('0x42')](_0x1b117f[_0xac3d('0x15')][_0x30dab1[_0xac3d('0x28')]],_0x30dab1);}}}return _0x1b117f[_0xac3d('0x15')];};};Realtime[_0xac3d('0x41')]['initTriggers']=function(){var _0x547802=this;return function(_0x48cdd9){if(_0x48cdd9){freeIsNotKey(_0x48cdd9,_0x547802['triggers'],'id');for(var _0x1ec962=0x0,_0x5c902d={},_0x1dcae2={};_0x1ec962<_0x48cdd9[_0xac3d('0x46')];_0x1ec962+=0x1){_0x5c902d=_0x48cdd9[_0x1ec962];if(_[_0xac3d('0x44')](_0x547802[_0xac3d('0x16')][_0x5c902d['id']])){_0x547802[_0xac3d('0x16')][_0x5c902d['id']]=new Trigger(_0x5c902d);}else{_0x547802['mergeFromDatabase'](_0x547802[_0xac3d('0x16')][_0x5c902d['id']],_0x5c902d);}}}return _0x547802[_0xac3d('0x16')];};};Realtime[_0xac3d('0x41')][_0xac3d('0x48')]=function(){var _0xdb67e0=this;return function(_0xa34f1b){if(_0xa34f1b){freeIsNotKey(_0xa34f1b,_0xdb67e0[_0xac3d('0x49')],'id');for(var _0x486903=0x0,_0x5b8c3e={},_0x25e190={};_0x486903<_0xa34f1b[_0xac3d('0x46')];_0x486903+=0x1){_0x5b8c3e=_0xa34f1b[_0x486903];if(_[_0xac3d('0x44')](_0xdb67e0[_0xac3d('0x49')][_0x5b8c3e['id']])){_0xdb67e0[_0xac3d('0x49')][_0x5b8c3e['id']]=new Template(_0x5b8c3e);}else{_0xdb67e0[_0xac3d('0x42')](_0xdb67e0['templates'][_0x5b8c3e['id']],_0x5b8c3e);}}}return _0xdb67e0[_0xac3d('0x49')];};};Realtime['prototype'][_0xac3d('0x4a')]=function(){var _0x134015=this;return function(_0x2ccd9a){if(_0x2ccd9a){freeIsNotKey(_0x2ccd9a,_0x134015['zendeskAccounts'],'id');for(var _0x507133=0x0,_0x582928={},_0x2459fe={};_0x507133<_0x2ccd9a[_0xac3d('0x46')];_0x507133+=0x1){_0x582928=_0x2ccd9a[_0x507133];if(_[_0xac3d('0x44')](_0x134015[_0xac3d('0x1d')][_0x582928['id']])){_0x134015[_0xac3d('0x1d')][_0x582928['id']]=new ZendeskAccount(_0x582928);}else{_0x134015[_0xac3d('0x42')](_0x134015['zendeskAccounts'][_0x582928['id']],_0x582928);}}}return _0x134015[_0xac3d('0x1d')];};};Realtime['prototype'][_0xac3d('0x4b')]=function(){var _0x4809fd=this;return function(_0xc6e54a){if(_0xc6e54a){freeIsNotKey(_0xc6e54a,_0x4809fd[_0xac3d('0x1e')],'id');for(var _0x460101=0x0,_0x53a0b3={},_0x2feb83={};_0x460101<_0xc6e54a[_0xac3d('0x46')];_0x460101+=0x1){_0x53a0b3=_0xc6e54a[_0x460101];if(_[_0xac3d('0x44')](_0x4809fd[_0xac3d('0x1e')][_0x53a0b3['id']])){_0x4809fd[_0xac3d('0x1e')][_0x53a0b3['id']]=new SalesforceAccount(_0x53a0b3);}else{_0x4809fd[_0xac3d('0x42')](_0x4809fd[_0xac3d('0x1e')][_0x53a0b3['id']],_0x53a0b3);}}}return _0x4809fd[_0xac3d('0x1e')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x1a8091=this;return function(_0x2898b9){if(_0x2898b9){freeIsNotKey(_0x2898b9,_0x1a8091[_0xac3d('0x20')],'id');for(var _0x266d89=0x0,_0x5cb9fa={},_0x8084cb={};_0x266d89<_0x2898b9[_0xac3d('0x46')];_0x266d89+=0x1){_0x5cb9fa=_0x2898b9[_0x266d89];if(_[_0xac3d('0x44')](_0x1a8091[_0xac3d('0x20')][_0x5cb9fa['id']])){_0x1a8091[_0xac3d('0x20')][_0x5cb9fa['id']]=new FreshdeskAccount(_0x5cb9fa);}else{_0x1a8091[_0xac3d('0x42')](_0x1a8091[_0xac3d('0x20')][_0x5cb9fa['id']],_0x5cb9fa);}}}return _0x1a8091['freshdeskAccounts'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x4c')]=function(){var _0x57efb1=this;return function(_0x2b5cc0){if(_0x2b5cc0){freeIsNotKey(_0x2b5cc0,_0x57efb1[_0xac3d('0x21')],'id');for(var _0x456203=0x0,_0x4a969b={},_0x237d2f={};_0x456203<_0x2b5cc0[_0xac3d('0x46')];_0x456203+=0x1){_0x4a969b=_0x2b5cc0[_0x456203];if(_['isUndefined'](_0x57efb1[_0xac3d('0x21')][_0x4a969b['id']])){_0x57efb1['zohoAccounts'][_0x4a969b['id']]=new ZohoAccount(_0x4a969b);}else{_0x57efb1['mergeFromDatabase'](_0x57efb1[_0xac3d('0x21')][_0x4a969b['id']],_0x4a969b);}}}return _0x57efb1[_0xac3d('0x21')];};};Realtime['prototype'][_0xac3d('0x4d')]=function(){var _0xf236ef=this;return function(_0x48d9f7){if(_0x48d9f7){freeIsNotKey(_0x48d9f7,_0xf236ef['deskAccounts'],'id');for(var _0x591a68=0x0,_0x4feb40={},_0x12cd2d={};_0x591a68<_0x48d9f7['length'];_0x591a68+=0x1){_0x4feb40=_0x48d9f7[_0x591a68];if(_[_0xac3d('0x44')](_0xf236ef[_0xac3d('0x22')][_0x4feb40['id']])){_0xf236ef[_0xac3d('0x22')][_0x4feb40['id']]=new DeskAccount(_0x4feb40);}else{_0xf236ef[_0xac3d('0x42')](_0xf236ef[_0xac3d('0x22')][_0x4feb40['id']],_0x4feb40);}}}return _0xf236ef[_0xac3d('0x22')];};};Realtime[_0xac3d('0x41')]['initSugarcrmAccounts']=function(){var _0x2537ff=this;return function(_0x27a5ad){if(_0x27a5ad){freeIsNotKey(_0x27a5ad,_0x2537ff[_0xac3d('0x1f')],'id');for(var _0x505754=0x0,_0x21addf={},_0x23baef={};_0x505754<_0x27a5ad['length'];_0x505754+=0x1){_0x21addf=_0x27a5ad[_0x505754];if(_[_0xac3d('0x44')](_0x2537ff[_0xac3d('0x1f')][_0x21addf['id']])){_0x2537ff['sugarcrmAccounts'][_0x21addf['id']]=new SugarcrmAccount(_0x21addf);}else{_0x2537ff[_0xac3d('0x42')](_0x2537ff[_0xac3d('0x1f')][_0x21addf['id']],_0x21addf);}}}return _0x2537ff['sugarcrmAccounts'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x4e')]=function(){var _0xdad036=this;return function(_0x39d958){if(_0x39d958){freeIsNotKey(_0x39d958,_0xdad036[_0xac3d('0x23')],'id');for(var _0x15494f=0x0,_0x15cfbe={},_0x181465={};_0x15494f<_0x39d958[_0xac3d('0x46')];_0x15494f+=0x1){_0x15cfbe=_0x39d958[_0x15494f];if(_[_0xac3d('0x44')](_0xdad036[_0xac3d('0x23')][_0x15cfbe['id']])){_0xdad036[_0xac3d('0x23')][_0x15cfbe['id']]=new VtigerAccount(_0x15cfbe);}else{_0xdad036[_0xac3d('0x42')](_0xdad036[_0xac3d('0x23')][_0x15cfbe['id']],_0x15cfbe);}}}return _0xdad036[_0xac3d('0x23')];};};Realtime[_0xac3d('0x41')]['initServicenowAccounts']=function(){var _0x5abe7d=this;return function(_0x11eba1){if(_0x11eba1){freeIsNotKey(_0x11eba1,_0x5abe7d[_0xac3d('0x24')],'id');for(var _0x1cc6ee=0x0,_0x367f36={},_0x19d7fd={};_0x1cc6ee<_0x11eba1[_0xac3d('0x46')];_0x1cc6ee+=0x1){_0x367f36=_0x11eba1[_0x1cc6ee];if(_[_0xac3d('0x44')](_0x5abe7d['servicenowAccounts'][_0x367f36['id']])){_0x5abe7d[_0xac3d('0x24')][_0x367f36['id']]=new ServicenowAccount(_0x367f36);}else{_0x5abe7d[_0xac3d('0x42')](_0x5abe7d[_0xac3d('0x24')][_0x367f36['id']],_0x367f36);}}}return _0x5abe7d[_0xac3d('0x24')];};};Realtime['prototype'][_0xac3d('0x4f')]=function(){var _0x183675=this;return function(_0x5879da){if(_0x5879da){freeIsNotKey(_0x5879da,_0x183675[_0xac3d('0x50')],'id');for(var _0x25e970=0x0,_0x3d71ec={},_0x3c66bb={};_0x25e970<_0x5879da[_0xac3d('0x46')];_0x25e970+=0x1){_0x3d71ec=_0x5879da[_0x25e970];if(_[_0xac3d('0x44')](_0x183675['dynamics365Accounts'][_0x3d71ec['id']])){_0x183675['dynamics365Accounts'][_0x3d71ec['id']]=new Dynamics365Account(_0x3d71ec);}else{_0x183675[_0xac3d('0x42')](_0x183675[_0xac3d('0x50')][_0x3d71ec['id']],_0x3d71ec);}}}return _0x183675[_0xac3d('0x50')];};};Realtime[_0xac3d('0x41')][_0xac3d('0x51')]=function(){var _0xdc7f9e=this;return function(_0x23694c){if(_0x23694c){freeIsNotKey(_0x23694c,_0xdc7f9e[_0xac3d('0x52')],'id');for(var _0x4cf3ca=0x0,_0x4b3f7f={},_0x9b4c34={};_0x4cf3ca<_0x23694c[_0xac3d('0x46')];_0x4cf3ca+=0x1){_0x4b3f7f=_0x23694c[_0x4cf3ca];if(_[_0xac3d('0x44')](_0xdc7f9e[_0xac3d('0x52')][_0x4b3f7f['id']])){_0xdc7f9e[_0xac3d('0x52')][_0x4b3f7f['id']]=new FreshsalesAccount(_0x4b3f7f);}else{_0xdc7f9e['mergeFromDatabase'](_0xdc7f9e[_0xac3d('0x52')][_0x4b3f7f['id']],_0x4b3f7f);}}}return _0xdc7f9e[_0xac3d('0x52')];};};Realtime[_0xac3d('0x41')][_0xac3d('0x53')]=function(){var _0x56d4fd=this;return function(_0x2adb5e){for(var _0xd01360=0x0;_0xd01360<_0x2adb5e[_0xac3d('0x46')];_0xd01360+=0x1){_[_0xac3d('0x54')](_0x56d4fd[_0xac3d('0x15')][_0x2adb5e[_0xd01360][_0xac3d('0x28')]],_0x2adb5e[_0xd01360]);}return _0x56d4fd['voiceQueues'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x55')]=function(){var _0x61f8c=this;return function(_0x37c12d){clearVoiceQueues(_0x61f8c[_0xac3d('0x15')]);if(_0x37c12d){_0x37c12d=_['groupBy'](_0x37c12d,'uniqueid');for(var _0x4e3767 in _0x37c12d){if(_0x37c12d[_0xac3d('0x29')](_0x4e3767)){var _0x3d35f7={};for(var _0x3e59c9=0x0;_0x3e59c9<_0x37c12d[_0x4e3767][_0xac3d('0x46')];_0x3e59c9+=0x1){var _0x4981d9=_0x37c12d[_0x4e3767][_0x3e59c9]['queue'];if(_0x61f8c['voiceQueues'][_0x4981d9]){if(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x56')]){_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x34')]+=0x1;}if(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x57')]){_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x35')]+=0x1;}_0x61f8c['voiceQueues'][_0x4981d9][_0xac3d('0x2d')]+=moment(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x58')])['diff'](moment(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x59')]),_0xac3d('0x5a'))||0x0;if(_0x3e59c9===_0x37c12d[_0x4e3767][_0xac3d('0x46')]-0x1){_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x2e')]+=moment(_0x37c12d[_0x4e3767][_0x3e59c9]['queuecallercompleteAt']||_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x5b')]||_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x5c')])['diff'](moment(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x59')]),_0xac3d('0x5a'))||0x0;_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x2c')]+=0x1;if(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x5d')]){_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x33')]+=0x1;_0x61f8c[_0xac3d('0x15')][_0x4981d9]['sumBillable']+=moment(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x5e')])[_0xac3d('0x5f')](moment(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x58')]),_0xac3d('0x5a'))||0x0;}}else{_0x61f8c['voiceQueues'][_0x4981d9][_0xac3d('0x2e')]+=_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x2d')]||0x0;}}}}}}return _0x61f8c['voiceQueues'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x60')]=function(){var _0x4c6a52=this;return function(_0x8010b0){clearVoiceCallReports(_0x4c6a52[_0xac3d('0x17')]);if(_0x8010b0){for(var _0xfb7338=0x0;_0xfb7338<_0x8010b0[_0xac3d('0x46')];_0xfb7338+=0x1){_0x4c6a52[_0xac3d('0x17')][_0xac3d('0x2c')]+=0x1;_0x4c6a52['outbound'][_0xac3d('0x2e')]+=_0x8010b0[_0xfb7338][_0xac3d('0x61')];if(_0x8010b0[_0xfb7338][_0xac3d('0x62')]===_0xac3d('0x63')){_0x4c6a52['outbound'][_0xac3d('0x33')]+=0x1;_0x4c6a52[_0xac3d('0x17')]['sumHoldTime']+=_0x8010b0[_0xfb7338][_0xac3d('0x61')]-_0x8010b0[_0xfb7338]['billableseconds']||0x0;_0x4c6a52[_0xac3d('0x17')]['sumBillable']+=_0x8010b0[_0xfb7338]['billableseconds'];}}}return _0x4c6a52[_0xac3d('0x17')];};};Realtime['prototype'][_0xac3d('0x64')]=function(){var _0x412987=this;return function(_0x5bb4fe){if(_0x5bb4fe){freeIsNotKey(_0x5bb4fe,_0x412987[_0xac3d('0x65')],_0xac3d('0x28'));for(var _0x25df7b=0x0,_0x23ac15={};_0x25df7b<_0x5bb4fe['length'];_0x25df7b+=0x1){_0x23ac15=_0x5bb4fe[_0x25df7b];if(_[_0xac3d('0x44')](_0x412987[_0xac3d('0x65')][_0x23ac15[_0xac3d('0x28')]])){_0x412987[_0xac3d('0x65')][_0x23ac15[_0xac3d('0x28')]]=new Campaign(_0x23ac15);}else{_0x412987[_0xac3d('0x42')](_0x412987[_0xac3d('0x65')][_0x23ac15[_0xac3d('0x28')]],_0x23ac15);_0x412987[_0xac3d('0x65')][_0x23ac15[_0xac3d('0x28')]][_0xac3d('0x66')]=_0x23ac15[_0xac3d('0x67')]?_0x23ac15[_0xac3d('0x67')][_0xac3d('0x28')]:undefined;}}}return _0x412987[_0xac3d('0x65')];};};Realtime[_0xac3d('0x41')][_0xac3d('0x68')]=function(){var _0x2d5922=this;return function(_0x5839de){if(_0x5839de){freeIsNotKey(_0x5839de,_0x2d5922[_0xac3d('0x18')],'id');for(var _0x2e6bfd=0x0,_0x55d5ff={};_0x2e6bfd<_0x5839de[_0xac3d('0x46')];_0x2e6bfd+=0x1){_0x55d5ff=_0x5839de[_0x2e6bfd];if(_[_0xac3d('0x44')](_0x2d5922[_0xac3d('0x18')][_0x55d5ff['id']])){_0x2d5922['voiceExtensions'][_0x55d5ff['id']]=new VoiceExtension(_0x55d5ff);}else{_0x2d5922[_0xac3d('0x42')](_0x2d5922['voiceExtensions'][_0x55d5ff['id']],_0x55d5ff);}}}return _0x2d5922['voiceExtensions'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x69')]=function(){var _0x1c706c=this;return function(_0x1313b6){clearCampaigns(_0x1c706c[_0xac3d('0x65')]);for(var _0xe6f00b=0x0;_0xe6f00b<_0x1313b6[_0xac3d('0x46')];_0xe6f00b+=0x1){_[_0xac3d('0x54')](_0x1c706c[_0xac3d('0x65')][_0x1313b6[_0xe6f00b][_0xac3d('0x28')]],_0x1313b6[_0xe6f00b]);}return _0x1c706c[_0xac3d('0x65')];};};Realtime[_0xac3d('0x41')]['initFaxAccounts']=function(){var _0xe73e29=this;return function(_0x2da814){if(_0x2da814){freeIsNotKey(_0x2da814,_0xe73e29[_0xac3d('0x6a')],'id');for(var _0x248fbb=0x0,_0x29302e={},_0x556a70={};_0x248fbb<_0x2da814[_0xac3d('0x46')];_0x248fbb+=0x1){_0x29302e=_0x2da814[_0x248fbb];if(_[_0xac3d('0x44')](_0xe73e29[_0xac3d('0x6a')][_0x29302e['id']])){_0xe73e29[_0xac3d('0x6a')][_0x29302e['id']]=new FaxAccount(_0x29302e);}else{_0xe73e29['mergeFromDatabase'](_0xe73e29[_0xac3d('0x6a')][_0x29302e['id']],_0x29302e);}}}return _0xe73e29[_0xac3d('0x6a')];};};module[_0xac3d('0x6b')]=Realtime; \ No newline at end of file +var _0x64b9=['deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','interface','name','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','seconds','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initCampaignHopperHistory','initFaxAccounts','bluebird','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','freshdeskAccounts','zohoAccounts'];(function(_0x1a73e7,_0x166be4){var _0xa7db77=function(_0x118490){while(--_0x118490){_0x1a73e7['push'](_0x1a73e7['shift']());}};_0xa7db77(++_0x166be4);}(_0x64b9,0x127));var _0x964b=function(_0x297694,_0x2d99fa){_0x297694=_0x297694-0x0;var _0x322aee=_0x64b9[_0x297694];return _0x322aee;};'use strict';var BPromise=require(_0x964b('0x0'));var util=require('util');var _=require(_0x964b('0x1'));var moment=require('moment');var Agent=require(_0x964b('0x2'));var Telephone=require(_0x964b('0x3'));var Trunk=require(_0x964b('0x4'));var VoiceQueue=require(_0x964b('0x5'));var Trigger=require(_0x964b('0x6'));var Template=require(_0x964b('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x964b('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x964b('0x9'));var ZohoAccount=require(_0x964b('0xa'));var DeskAccount=require(_0x964b('0xb'));var VtigerAccount=require(_0x964b('0xc'));var ServicenowAccount=require(_0x964b('0xd'));var Dynamics365Account=require(_0x964b('0xe'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x964b('0xf'));var Realtime=function(){this[_0x964b('0x10')]={};this[_0x964b('0x11')]={};this[_0x964b('0x12')]={};this[_0x964b('0x13')]={};this['triggers']={};this[_0x964b('0x14')]={};this[_0x964b('0x15')]={};this[_0x964b('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x964b('0x17')]={};this[_0x964b('0x18')]={};this[_0x964b('0x19')]={};this[_0x964b('0x1a')]={};this[_0x964b('0x1b')]={};this[_0x964b('0x1c')]={};this[_0x964b('0x1d')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0x964b('0x1e')]={};this[_0x964b('0x1f')]={};this[_0x964b('0x20')]={};this['vtigerAccounts']={};this[_0x964b('0x21')]={};this[_0x964b('0x22')]={};this[_0x964b('0x23')]={};this[_0x964b('0x24')]={};};function freeIsNotKey(_0xeb34e8,_0x13b380,_0x1b128a){var _0x463769=_['mapKeys'](_0xeb34e8,function(_0x4e80fb,_0x88ba8d){return _0x4e80fb[_0x1b128a];});for(var _0x5f1530 in _0x13b380){if(_0x13b380[_0x964b('0x25')](_0x5f1530)){if(!_0x463769[_0x5f1530]){delete _0x13b380[_0x5f1530];}}}}function freeIsNotKeySip(_0x2dd47e,_0x4acdb0){var _0x3776d7=_[_0x964b('0x26')](_0x2dd47e,function(_0xec9a09,_0x5afac3){return util[_0x964b('0x27')](_0x964b('0x28'),_0xec9a09['name']);});for(var _0xa87da9 in _0x4acdb0){if(_0x4acdb0[_0x964b('0x25')](_0xa87da9)){if(!_0x3776d7[_0xa87da9]){delete _0x4acdb0[_0xa87da9];}}}}function freeIsNotKeyAgent(_0x1065ae,_0x39cf4b){var _0x32d026=_['mapKeys'](_0x1065ae,function(_0x837e0c,_0x3cc27e){var _0x102814=_['isNil'](_0x837e0c[_0x964b('0x29')])?util['format']('SIP/%s',_0x837e0c[_0x964b('0x2a')]):_0x837e0c[_0x964b('0x29')];return _0x102814;});for(var _0x13b61b in _0x39cf4b){if(_0x39cf4b[_0x964b('0x25')](_0x13b61b)){if(!_0x32d026[_0x13b61b]){delete _0x39cf4b[_0x13b61b];}}}}function clearVoiceCallReports(_0x56d4d0){_0x56d4d0[_0x964b('0x2b')]=0x0;_0x56d4d0[_0x964b('0x2c')]=0x0;_0x56d4d0[_0x964b('0x2d')]=0x0;_0x56d4d0[_0x964b('0x2e')]=0x0;_0x56d4d0[_0x964b('0x2f')]=0x0;}function clearCampaigns(_0xbdfc6c){if(!_[_0x964b('0x30')](_0xbdfc6c)){for(var _0x5da64c in _0xbdfc6c){if(_0xbdfc6c[_0x964b('0x25')](_0x5da64c)){_0xbdfc6c[_0x5da64c][_0x964b('0x31')]=0x0;_0xbdfc6c[_0x5da64c][_0x964b('0x32')]=0x0;}}}}function clearVoiceQueues(_0x22f80e){if(!_['isEmpty'](_0x22f80e)){for(var _0x5d777b in _0x22f80e){if(_0x22f80e[_0x964b('0x25')](_0x5d777b)){_0x22f80e[_0x5d777b][_0x964b('0x2b')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x2c')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x33')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x34')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x2d')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x2e')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x2f')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x35')]=0x0;_0x22f80e[_0x5d777b]['outboundNoAnswerCallsDay']=0x0;_0x22f80e[_0x5d777b][_0x964b('0x36')]=0x0;_0x22f80e[_0x5d777b]['outboundCongestionCallsDay']=0x0;_0x22f80e[_0x5d777b][_0x964b('0x37')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x38')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x39')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x3a')]=0x0;_0x22f80e[_0x5d777b]['outboundBlacklistCallsDay']=0x0;_0x22f80e[_0x5d777b]['outboundOriginateFailureCallsDay']=0x0;_0x22f80e[_0x5d777b][_0x964b('0x3b')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x3c')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x35')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x3d')]=0x0;_0x22f80e[_0x5d777b]['queueStatusComplete']=!![];}}}}Realtime[_0x964b('0x3e')][_0x964b('0x3f')]=function(_0x172b08,_0x17b489){for(var _0x5a863a in _0x17b489){if(_0x172b08[_0x964b('0x25')](_0x5a863a)){_0x172b08[_0x5a863a]=_0x17b489[_0x5a863a];}}};Realtime[_0x964b('0x3e')][_0x964b('0x40')]=function(){var _0x543db3=this;return function(_0x2e53ab){if(_0x2e53ab){freeIsNotKeyAgent(_0x2e53ab,_0x543db3[_0x964b('0x10')]);for(var _0x5d4fdc=0x0,_0x53b1b9={},_0x3c15ab={};_0x5d4fdc<_0x2e53ab[_0x964b('0x41')];_0x5d4fdc+=0x1){_0x53b1b9=_0x2e53ab[_0x5d4fdc];var _0x14e352=_[_0x964b('0x42')](_0x53b1b9['interface'])?util[_0x964b('0x27')](_0x964b('0x28'),_0x53b1b9[_0x964b('0x2a')]):_0x53b1b9[_0x964b('0x29')];if(_[_0x964b('0x43')](_0x543db3[_0x964b('0x10')][_0x14e352])){_0x543db3[_0x964b('0x10')][_0x14e352]=new Agent(_0x53b1b9);}else{_0x543db3[_0x964b('0x3f')](_0x543db3[_0x964b('0x10')][_0x14e352],_0x53b1b9);}}}return _0x543db3[_0x964b('0x10')];};};Realtime[_0x964b('0x3e')][_0x964b('0x44')]=function(){var _0x13a3fd=this;return function(_0x23e2e8){if(_0x23e2e8){freeIsNotKeySip(_0x23e2e8,_0x13a3fd[_0x964b('0x11')]);for(var _0x22e45f=0x0,_0x542af5={},_0x534a82={};_0x22e45f<_0x23e2e8[_0x964b('0x41')];_0x22e45f+=0x1){_0x542af5=_0x23e2e8[_0x22e45f];if(_[_0x964b('0x43')](_0x13a3fd[_0x964b('0x11')][util[_0x964b('0x27')](_0x964b('0x28'),_0x542af5[_0x964b('0x2a')])])){_0x13a3fd[_0x964b('0x11')][util[_0x964b('0x27')]('SIP/%s',_0x542af5[_0x964b('0x2a')])]=new Telephone(_0x542af5);}else{_0x13a3fd['mergeFromDatabase'](_0x13a3fd[_0x964b('0x11')][util['format'](_0x964b('0x28'),_0x542af5['name'])],_0x542af5);}}}return _0x13a3fd['telephones'];};};Realtime[_0x964b('0x3e')][_0x964b('0x45')]=function(){var _0x50e8c8=this;return function(_0x1ca7d8){if(_0x1ca7d8){freeIsNotKeySip(_0x1ca7d8,_0x50e8c8['trunks']);for(var _0xfe5b68=0x0,_0xe0a768={},_0x3c9192={};_0xfe5b68<_0x1ca7d8[_0x964b('0x41')];_0xfe5b68+=0x1){_0xe0a768=_0x1ca7d8[_0xfe5b68];if(_[_0x964b('0x43')](_0x50e8c8['trunks'][util['format'](_0x964b('0x28'),_0xe0a768[_0x964b('0x2a')])])){_0x50e8c8['trunks'][util[_0x964b('0x27')]('SIP/%s',_0xe0a768['name'])]=new Trunk(_0xe0a768);}else{_0x50e8c8[_0x964b('0x3f')](_0x50e8c8[_0x964b('0x12')][util[_0x964b('0x27')](_0x964b('0x28'),_0xe0a768[_0x964b('0x2a')])],_0xe0a768);}}}return _0x50e8c8['trunks'];};};Realtime[_0x964b('0x3e')][_0x964b('0x46')]=function(){var _0x77275f=this;return function(_0x39ec27){if(_0x39ec27){freeIsNotKey(_0x39ec27,_0x77275f['voiceQueues'],_0x964b('0x2a'));for(var _0x901b2c=0x0,_0x509d1c={},_0x43c0a6={};_0x901b2c<_0x39ec27[_0x964b('0x41')];_0x901b2c+=0x1){_0x509d1c=_0x39ec27[_0x901b2c];if(_[_0x964b('0x43')](_0x77275f[_0x964b('0x13')][_0x509d1c[_0x964b('0x2a')]])){_0x77275f[_0x964b('0x13')][_0x509d1c[_0x964b('0x2a')]]=new VoiceQueue(_0x509d1c);}else{_0x77275f['mergeFromDatabase'](_0x77275f[_0x964b('0x13')][_0x509d1c['name']],_0x509d1c);}}}return _0x77275f[_0x964b('0x13')];};};Realtime[_0x964b('0x3e')][_0x964b('0x47')]=function(){var _0x5906a7=this;return function(_0x4fa1cb){if(_0x4fa1cb){freeIsNotKey(_0x4fa1cb,_0x5906a7[_0x964b('0x48')],'id');for(var _0xa69dfb=0x0,_0x8a4e6d={},_0x558092={};_0xa69dfb<_0x4fa1cb[_0x964b('0x41')];_0xa69dfb+=0x1){_0x8a4e6d=_0x4fa1cb[_0xa69dfb];if(_[_0x964b('0x43')](_0x5906a7['triggers'][_0x8a4e6d['id']])){_0x5906a7[_0x964b('0x48')][_0x8a4e6d['id']]=new Trigger(_0x8a4e6d);}else{_0x5906a7[_0x964b('0x3f')](_0x5906a7[_0x964b('0x48')][_0x8a4e6d['id']],_0x8a4e6d);}}}return _0x5906a7[_0x964b('0x48')];};};Realtime[_0x964b('0x3e')][_0x964b('0x49')]=function(){var _0x55d90e=this;return function(_0x6b004e){if(_0x6b004e){freeIsNotKey(_0x6b004e,_0x55d90e[_0x964b('0x15')],'id');for(var _0x12c93c=0x0,_0x10b27d={},_0xa8ba96={};_0x12c93c<_0x6b004e[_0x964b('0x41')];_0x12c93c+=0x1){_0x10b27d=_0x6b004e[_0x12c93c];if(_[_0x964b('0x43')](_0x55d90e[_0x964b('0x15')][_0x10b27d['id']])){_0x55d90e[_0x964b('0x15')][_0x10b27d['id']]=new Template(_0x10b27d);}else{_0x55d90e[_0x964b('0x3f')](_0x55d90e[_0x964b('0x15')][_0x10b27d['id']],_0x10b27d);}}}return _0x55d90e['templates'];};};Realtime[_0x964b('0x3e')][_0x964b('0x4a')]=function(){var _0x54d977=this;return function(_0x358be8){if(_0x358be8){freeIsNotKey(_0x358be8,_0x54d977['zendeskAccounts'],'id');for(var _0x50d9c3=0x0,_0xecf675={},_0x6f1e4e={};_0x50d9c3<_0x358be8[_0x964b('0x41')];_0x50d9c3+=0x1){_0xecf675=_0x358be8[_0x50d9c3];if(_[_0x964b('0x43')](_0x54d977[_0x964b('0x1d')][_0xecf675['id']])){_0x54d977[_0x964b('0x1d')][_0xecf675['id']]=new ZendeskAccount(_0xecf675);}else{_0x54d977['mergeFromDatabase'](_0x54d977[_0x964b('0x1d')][_0xecf675['id']],_0xecf675);}}}return _0x54d977[_0x964b('0x1d')];};};Realtime[_0x964b('0x3e')][_0x964b('0x4b')]=function(){var _0x12dd16=this;return function(_0x3dc1c4){if(_0x3dc1c4){freeIsNotKey(_0x3dc1c4,_0x12dd16['salesforceAccounts'],'id');for(var _0x5986d7=0x0,_0x47ae71={},_0x4e9c92={};_0x5986d7<_0x3dc1c4[_0x964b('0x41')];_0x5986d7+=0x1){_0x47ae71=_0x3dc1c4[_0x5986d7];if(_['isUndefined'](_0x12dd16[_0x964b('0x4c')][_0x47ae71['id']])){_0x12dd16['salesforceAccounts'][_0x47ae71['id']]=new SalesforceAccount(_0x47ae71);}else{_0x12dd16['mergeFromDatabase'](_0x12dd16[_0x964b('0x4c')][_0x47ae71['id']],_0x47ae71);}}}return _0x12dd16[_0x964b('0x4c')];};};Realtime['prototype'][_0x964b('0x4d')]=function(){var _0x2c728d=this;return function(_0xe60c32){if(_0xe60c32){freeIsNotKey(_0xe60c32,_0x2c728d[_0x964b('0x1e')],'id');for(var _0x1bdff3=0x0,_0x41eeef={},_0x52f75b={};_0x1bdff3<_0xe60c32[_0x964b('0x41')];_0x1bdff3+=0x1){_0x41eeef=_0xe60c32[_0x1bdff3];if(_[_0x964b('0x43')](_0x2c728d[_0x964b('0x1e')][_0x41eeef['id']])){_0x2c728d['freshdeskAccounts'][_0x41eeef['id']]=new FreshdeskAccount(_0x41eeef);}else{_0x2c728d['mergeFromDatabase'](_0x2c728d[_0x964b('0x1e')][_0x41eeef['id']],_0x41eeef);}}}return _0x2c728d[_0x964b('0x1e')];};};Realtime[_0x964b('0x3e')][_0x964b('0x4e')]=function(){var _0x1b14b1=this;return function(_0x162605){if(_0x162605){freeIsNotKey(_0x162605,_0x1b14b1['zohoAccounts'],'id');for(var _0x9fcc53=0x0,_0x126327={},_0xc72e4f={};_0x9fcc53<_0x162605[_0x964b('0x41')];_0x9fcc53+=0x1){_0x126327=_0x162605[_0x9fcc53];if(_['isUndefined'](_0x1b14b1[_0x964b('0x1f')][_0x126327['id']])){_0x1b14b1[_0x964b('0x1f')][_0x126327['id']]=new ZohoAccount(_0x126327);}else{_0x1b14b1[_0x964b('0x3f')](_0x1b14b1['zohoAccounts'][_0x126327['id']],_0x126327);}}}return _0x1b14b1[_0x964b('0x1f')];};};Realtime[_0x964b('0x3e')][_0x964b('0x4f')]=function(){var _0x3a0b4d=this;return function(_0xa7f201){if(_0xa7f201){freeIsNotKey(_0xa7f201,_0x3a0b4d[_0x964b('0x20')],'id');for(var _0x2c19d5=0x0,_0xc03ffb={},_0x22227f={};_0x2c19d5<_0xa7f201[_0x964b('0x41')];_0x2c19d5+=0x1){_0xc03ffb=_0xa7f201[_0x2c19d5];if(_['isUndefined'](_0x3a0b4d['deskAccounts'][_0xc03ffb['id']])){_0x3a0b4d[_0x964b('0x20')][_0xc03ffb['id']]=new DeskAccount(_0xc03ffb);}else{_0x3a0b4d[_0x964b('0x3f')](_0x3a0b4d[_0x964b('0x20')][_0xc03ffb['id']],_0xc03ffb);}}}return _0x3a0b4d[_0x964b('0x20')];};};Realtime['prototype'][_0x964b('0x50')]=function(){var _0x4c92fc=this;return function(_0x55ee0b){if(_0x55ee0b){freeIsNotKey(_0x55ee0b,_0x4c92fc[_0x964b('0x51')],'id');for(var _0x226d72=0x0,_0xd4260f={},_0x52f214={};_0x226d72<_0x55ee0b[_0x964b('0x41')];_0x226d72+=0x1){_0xd4260f=_0x55ee0b[_0x226d72];if(_[_0x964b('0x43')](_0x4c92fc[_0x964b('0x51')][_0xd4260f['id']])){_0x4c92fc[_0x964b('0x51')][_0xd4260f['id']]=new SugarcrmAccount(_0xd4260f);}else{_0x4c92fc[_0x964b('0x3f')](_0x4c92fc[_0x964b('0x51')][_0xd4260f['id']],_0xd4260f);}}}return _0x4c92fc['sugarcrmAccounts'];};};Realtime['prototype'][_0x964b('0x52')]=function(){var _0x28d47d=this;return function(_0x1553ac){if(_0x1553ac){freeIsNotKey(_0x1553ac,_0x28d47d['vtigerAccounts'],'id');for(var _0x26bdc3=0x0,_0x100c76={},_0x21319c={};_0x26bdc3<_0x1553ac['length'];_0x26bdc3+=0x1){_0x100c76=_0x1553ac[_0x26bdc3];if(_[_0x964b('0x43')](_0x28d47d[_0x964b('0x53')][_0x100c76['id']])){_0x28d47d[_0x964b('0x53')][_0x100c76['id']]=new VtigerAccount(_0x100c76);}else{_0x28d47d['mergeFromDatabase'](_0x28d47d[_0x964b('0x53')][_0x100c76['id']],_0x100c76);}}}return _0x28d47d[_0x964b('0x53')];};};Realtime[_0x964b('0x3e')][_0x964b('0x54')]=function(){var _0x2cc648=this;return function(_0x235f83){if(_0x235f83){freeIsNotKey(_0x235f83,_0x2cc648[_0x964b('0x21')],'id');for(var _0x33cd30=0x0,_0x37e3cf={},_0x26d4a4={};_0x33cd30<_0x235f83[_0x964b('0x41')];_0x33cd30+=0x1){_0x37e3cf=_0x235f83[_0x33cd30];if(_[_0x964b('0x43')](_0x2cc648[_0x964b('0x21')][_0x37e3cf['id']])){_0x2cc648[_0x964b('0x21')][_0x37e3cf['id']]=new ServicenowAccount(_0x37e3cf);}else{_0x2cc648[_0x964b('0x3f')](_0x2cc648[_0x964b('0x21')][_0x37e3cf['id']],_0x37e3cf);}}}return _0x2cc648[_0x964b('0x21')];};};Realtime['prototype'][_0x964b('0x55')]=function(){var _0x511c90=this;return function(_0x57f467){if(_0x57f467){freeIsNotKey(_0x57f467,_0x511c90[_0x964b('0x22')],'id');for(var _0x499cb5=0x0,_0x2eac01={},_0x13462b={};_0x499cb5<_0x57f467[_0x964b('0x41')];_0x499cb5+=0x1){_0x2eac01=_0x57f467[_0x499cb5];if(_[_0x964b('0x43')](_0x511c90[_0x964b('0x22')][_0x2eac01['id']])){_0x511c90['dynamics365Accounts'][_0x2eac01['id']]=new Dynamics365Account(_0x2eac01);}else{_0x511c90[_0x964b('0x3f')](_0x511c90[_0x964b('0x22')][_0x2eac01['id']],_0x2eac01);}}}return _0x511c90['dynamics365Accounts'];};};Realtime['prototype'][_0x964b('0x56')]=function(){var _0x550188=this;return function(_0xa76de4){if(_0xa76de4){freeIsNotKey(_0xa76de4,_0x550188[_0x964b('0x23')],'id');for(var _0x2301bb=0x0,_0x5dcd0e={},_0x256679={};_0x2301bb<_0xa76de4['length'];_0x2301bb+=0x1){_0x5dcd0e=_0xa76de4[_0x2301bb];if(_['isUndefined'](_0x550188[_0x964b('0x23')][_0x5dcd0e['id']])){_0x550188[_0x964b('0x23')][_0x5dcd0e['id']]=new FreshsalesAccount(_0x5dcd0e);}else{_0x550188[_0x964b('0x3f')](_0x550188['freshsalesAccounts'][_0x5dcd0e['id']],_0x5dcd0e);}}}return _0x550188['freshsalesAccounts'];};};Realtime[_0x964b('0x3e')]['initVoiceQueueHopperHistory']=function(){var _0x270386=this;return function(_0x34217c){for(var _0x19d5dd=0x0;_0x19d5dd<_0x34217c[_0x964b('0x41')];_0x19d5dd+=0x1){_[_0x964b('0x57')](_0x270386['voiceQueues'][_0x34217c[_0x19d5dd][_0x964b('0x2a')]],_0x34217c[_0x19d5dd]);}return _0x270386['voiceQueues'];};};Realtime[_0x964b('0x3e')]['initVoiceQueueReports']=function(){var _0x1a4400=this;return function(_0x44dd37){clearVoiceQueues(_0x1a4400[_0x964b('0x13')]);if(_0x44dd37){_0x44dd37=_[_0x964b('0x58')](_0x44dd37,_0x964b('0x59'));for(var _0x404b4b in _0x44dd37){if(_0x44dd37['hasOwnProperty'](_0x404b4b)){var _0x239648={};for(var _0x32e1c8=0x0;_0x32e1c8<_0x44dd37[_0x404b4b][_0x964b('0x41')];_0x32e1c8+=0x1){var _0x58eed3=_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5a')];if(_0x1a4400[_0x964b('0x13')][_0x58eed3]){if(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5b')]){_0x1a4400['voiceQueues'][_0x58eed3][_0x964b('0x33')]+=0x1;}if(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5c')]){_0x1a4400[_0x964b('0x13')][_0x58eed3][_0x964b('0x34')]+=0x1;}_0x1a4400[_0x964b('0x13')][_0x58eed3]['sumHoldTime']+=moment(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5d')])[_0x964b('0x5e')](moment(_0x44dd37[_0x404b4b][_0x32e1c8]['queuecallerjoinAt']),'seconds')||0x0;if(_0x32e1c8===_0x44dd37[_0x404b4b][_0x964b('0x41')]-0x1){_0x1a4400[_0x964b('0x13')][_0x58eed3]['sumDuration']+=moment(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5f')]||_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x60')]||_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x61')])[_0x964b('0x5e')](moment(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x62')]),_0x964b('0x63'))||0x0;_0x1a4400[_0x964b('0x13')][_0x58eed3]['total']+=0x1;if(_0x44dd37[_0x404b4b][_0x32e1c8]['queuecallercomplete']){_0x1a4400[_0x964b('0x13')][_0x58eed3][_0x964b('0x2c')]+=0x1;_0x1a4400[_0x964b('0x13')][_0x58eed3][_0x964b('0x2f')]+=moment(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5f')])[_0x964b('0x5e')](moment(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5d')]),_0x964b('0x63'))||0x0;}}else{_0x1a4400[_0x964b('0x13')][_0x58eed3][_0x964b('0x2e')]+=_0x1a4400[_0x964b('0x13')][_0x58eed3][_0x964b('0x2d')]||0x0;}}}}}}return _0x1a4400[_0x964b('0x13')];};};Realtime[_0x964b('0x3e')][_0x964b('0x64')]=function(){var _0x32e0e3=this;return function(_0x351e2c){clearVoiceCallReports(_0x32e0e3[_0x964b('0x16')]);if(_0x351e2c){for(var _0x38c7dc=0x0;_0x38c7dc<_0x351e2c['length'];_0x38c7dc+=0x1){_0x32e0e3[_0x964b('0x16')][_0x964b('0x2b')]+=0x1;_0x32e0e3[_0x964b('0x16')][_0x964b('0x2e')]+=_0x351e2c[_0x38c7dc][_0x964b('0x65')];if(_0x351e2c[_0x38c7dc][_0x964b('0x66')]===_0x964b('0x67')){_0x32e0e3[_0x964b('0x16')][_0x964b('0x2c')]+=0x1;_0x32e0e3[_0x964b('0x16')][_0x964b('0x2d')]+=_0x351e2c[_0x38c7dc][_0x964b('0x65')]-_0x351e2c[_0x38c7dc][_0x964b('0x68')]||0x0;_0x32e0e3['outbound'][_0x964b('0x2f')]+=_0x351e2c[_0x38c7dc][_0x964b('0x68')];}}}return _0x32e0e3[_0x964b('0x16')];};};Realtime[_0x964b('0x3e')][_0x964b('0x69')]=function(){var _0x36ebce=this;return function(_0x14efbe){if(_0x14efbe){freeIsNotKey(_0x14efbe,_0x36ebce['campaigns'],'name');for(var _0x28fe5c=0x0,_0x1b1dfd={};_0x28fe5c<_0x14efbe[_0x964b('0x41')];_0x28fe5c+=0x1){_0x1b1dfd=_0x14efbe[_0x28fe5c];if(_['isUndefined'](_0x36ebce[_0x964b('0x14')][_0x1b1dfd[_0x964b('0x2a')]])){_0x36ebce[_0x964b('0x14')][_0x1b1dfd[_0x964b('0x2a')]]=new Campaign(_0x1b1dfd);}else{_0x36ebce[_0x964b('0x3f')](_0x36ebce[_0x964b('0x14')][_0x1b1dfd[_0x964b('0x2a')]],_0x1b1dfd);_0x36ebce[_0x964b('0x14')][_0x1b1dfd[_0x964b('0x2a')]]['dialQueueProject']=_0x1b1dfd[_0x964b('0x6a')]?_0x1b1dfd['SquareProject'][_0x964b('0x2a')]:undefined;}}}return _0x36ebce[_0x964b('0x14')];};};Realtime[_0x964b('0x3e')]['initVoiceExtensions']=function(){var _0x11de8a=this;return function(_0x37f05e){if(_0x37f05e){freeIsNotKey(_0x37f05e,_0x11de8a[_0x964b('0x17')],'id');for(var _0x2154dd=0x0,_0x34750c={};_0x2154dd<_0x37f05e[_0x964b('0x41')];_0x2154dd+=0x1){_0x34750c=_0x37f05e[_0x2154dd];if(_['isUndefined'](_0x11de8a[_0x964b('0x17')][_0x34750c['id']])){_0x11de8a[_0x964b('0x17')][_0x34750c['id']]=new VoiceExtension(_0x34750c);}else{_0x11de8a[_0x964b('0x3f')](_0x11de8a[_0x964b('0x17')][_0x34750c['id']],_0x34750c);}}}return _0x11de8a[_0x964b('0x17')];};};Realtime[_0x964b('0x3e')][_0x964b('0x6b')]=function(){var _0x3e4a3f=this;return function(_0x512f6b){clearCampaigns(_0x3e4a3f[_0x964b('0x14')]);for(var _0x175d2f=0x0;_0x175d2f<_0x512f6b[_0x964b('0x41')];_0x175d2f+=0x1){_['merge'](_0x3e4a3f[_0x964b('0x14')][_0x512f6b[_0x175d2f][_0x964b('0x2a')]],_0x512f6b[_0x175d2f]);}return _0x3e4a3f[_0x964b('0x14')];};};Realtime['prototype'][_0x964b('0x6c')]=function(){var _0x39fcd6=this;return function(_0x187037){if(_0x187037){freeIsNotKey(_0x187037,_0x39fcd6[_0x964b('0x24')],'id');for(var _0x55a17b=0x0,_0x5a2952={},_0x5b1a0a={};_0x55a17b<_0x187037[_0x964b('0x41')];_0x55a17b+=0x1){_0x5a2952=_0x187037[_0x55a17b];if(_[_0x964b('0x43')](_0x39fcd6[_0x964b('0x24')][_0x5a2952['id']])){_0x39fcd6[_0x964b('0x24')][_0x5a2952['id']]=new FaxAccount(_0x5a2952);}else{_0x39fcd6['mergeFromDatabase'](_0x39fcd6['faxAccounts'][_0x5a2952['id']],_0x5a2952);}}}return _0x39fcd6[_0x964b('0x24')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index d9cd724..e139628 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 _0x59a7=['SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','linkedid','transfers','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','findAgent','find','name','isNil','accountcode','interface','format'];(function(_0x5d268f,_0x2ad284){var _0x120b94=function(_0x2c604f){while(--_0x2c604f){_0x5d268f['push'](_0x5d268f['shift']());}};_0x120b94(++_0x2ad284);}(_0x59a7,0x1e0));var _0x759a=function(_0x56d64b,_0x1f961a){_0x56d64b=_0x56d64b-0x0;var _0x41ef0d=_0x59a7[_0x56d64b];return _0x41ef0d;};'use strict';var _=require(_0x759a('0x0'));var moment=require(_0x759a('0x1'));var util=require(_0x759a('0x2'));var config=require(_0x759a('0x3'));var ami=require(_0x759a('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x759a('0x5'));var RpcMemberReport=require(_0x759a('0x6'));var RpcVoiceQueueReport=require(_0x759a('0x7'));var RpcVoiceRecording=require(_0x759a('0x8'));var RpcVoiceTransferReport=require(_0x759a('0x9'));var VoiceQueueReport=require(_0x759a('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x759a('0xb'));var VoiceDialReport=require(_0x759a('0xc'));var UserReport=require(_0x759a('0xd'));function Report(_0x56ebc6){this['realtime']=_0x56ebc6;this[_0x759a('0xe')]=_0x56ebc6[_0x759a('0xe')];this[_0x759a('0xf')]=_0x56ebc6[_0x759a('0xf')];}Report[_0x759a('0x10')][_0x759a('0x11')]=function(_0xdb84aa){var _0x114652=new VoiceQueueReport(this['realtime']);var _0x4e9492=new VoiceAgentReport(this['realtime']);var _0x245ec9=new VoiceDialReport(this['realtime']);var _0x3ee1c2=new VoiceCallReport(this['realtime']);var _0x27f561=new UserReport(this['realtime']);if(config[_0x759a('0x12')]&&config[_0x759a('0x12')][_0x759a('0x13')]){ami['on']('custom:voiceQueueReport',this[_0x759a('0x14')][_0x759a('0x15')](this));ami['on'](_0x759a('0x16'),this[_0x759a('0x17')][_0x759a('0x15')](this));ami['on'](_0x759a('0x18'),this[_0x759a('0x19')][_0x759a('0x15')](this));ami['on'](_0x759a('0x1a'),this[_0x759a('0x1b')][_0x759a('0x15')](this));ami['on']('blindtransfer',this[_0x759a('0x1c')][_0x759a('0x15')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x759a('0x15')](this));}};Report[_0x759a('0x10')][_0x759a('0x1d')]=function(_0x57110e){var _0x3587c5;_0x3587c5=_[_0x759a('0x1e')](this[_0x759a('0xe')],function(_0x35348e){return _0x35348e['accountcode']==_0x57110e||_0x35348e[_0x759a('0x1f')]==_0x57110e;});if(_[_0x759a('0x20')](_0x3587c5)){var _0x3e6e53=_['find'](this['telephones'],function(_0x5c31e9){return _0x5c31e9[_0x759a('0x21')]==_0x57110e||_0x5c31e9[_0x759a('0x1f')]==_0x57110e;});if(_0x3e6e53){_0x3587c5=_[_0x759a('0x1e')](this[_0x759a('0xe')],function(_0x38f1da){return _0x38f1da[_0x759a('0x22')]==util[_0x759a('0x23')](_0x759a('0x24'),_0x3e6e53[_0x759a('0x1f')]);});}}return _0x3587c5;};Report[_0x759a('0x10')][_0x759a('0x14')]=function(_0x5e5a4c){for(var _0x521329=0x0;_0x521329<_0x5e5a4c[_0x759a('0x25')];_0x521329+=0x1){var _0x4788bf=this['findAgent'](_0x5e5a4c[_0x521329][_0x759a('0x26')]);if(_0x4788bf){_0x5e5a4c[_0x521329][_0x759a('0x21')]=_0x4788bf[_0x759a('0x21')];_0x5e5a4c[_0x521329][_0x759a('0x27')]=!![];_0x5e5a4c[_0x521329][_0x759a('0x28')]=_0x4788bf[_0x759a('0x1f')];_0x5e5a4c[_0x521329]['interface']=_[_0x759a('0x20')](_0x4788bf['interface'])?util[_0x759a('0x23')](_0x759a('0x24'),_0x4788bf[_0x759a('0x1f')]):_0x4788bf[_0x759a('0x22')];if(_0x5e5a4c[_0x521329][_0x759a('0x29')]){_0x5e5a4c[_0x521329][_0x759a('0x2a')]=moment()[_0x759a('0x23')](_0x759a('0x2b'));}if(_0x5e5a4c[_0x521329][_0x759a('0x2c')]){_0x5e5a4c[_0x521329][_0x759a('0x2d')]=moment()[_0x759a('0x23')](_0x759a('0x2b'));}RpcMemberReport[_0x759a('0x14')](_0x5e5a4c[_0x521329]);}RpcVoiceQueueReport[_0x759a('0x2e')](_0x5e5a4c[_0x521329]);}};function extractCalleridNumber(_0x18213d){var _0x2d1326=_0x18213d[_0x759a('0x2f')](/<(.*?)>/);return _0x2d1326?_0x2d1326[0x1]:_0x18213d;}Report[_0x759a('0x10')][_0x759a('0x17')]=function(_0xba5889){_0xba5889[_0x759a('0x30')]=_0xba5889[_0x759a('0x30')]||_0xba5889[_0x759a('0x31')];if(_0xba5889[_0x759a('0x32')]=='dialer'){_0xba5889[_0x759a('0x33')]=_0x759a('0x34');_0xba5889[_0x759a('0x35')]=_0xba5889[_0x759a('0x34')];if(_0xba5889['context']==_0x759a('0x36')){_0xba5889[_0x759a('0x21')]='';_0xba5889[_0x759a('0x30')]=extractCalleridNumber(_0xba5889[_0x759a('0x37')]);}else if(_0xba5889[_0x759a('0x38')]==_0x759a('0x39')){if(_0xba5889[_0x759a('0x30')]=='xcally-motion-preview'){_0xba5889['destination']=extractCalleridNumber(_0xba5889[_0x759a('0x3a')]);_0xba5889['calleridnum']=_0xba5889[_0x759a('0x3b')];_0xba5889[_0x759a('0x3c')]=[_0xba5889[_0x759a('0x3d')],_0xba5889[_0x759a('0x3d')]=_0xba5889['destinationchannel']][0x0];_0xba5889[_0x759a('0x37')]=_0xba5889[_0x759a('0x3a')];}else{_0xba5889[_0x759a('0x30')]=_0xba5889[_0x759a('0x3e')];_0xba5889[_0x759a('0x3e')]=_0xba5889['originatecalleridnum'];if(_0xba5889[_0x759a('0x3f')]=='ANSWERED'){_0xba5889[_0x759a('0x21')]=_0xba5889[_0x759a('0x26')];}else{_0xba5889[_0x759a('0x21')]='';}}}}else{_0xba5889[_0x759a('0x37')]=util[_0x759a('0x23')]('\x22%s\x22\x20<%s>',_0xba5889['calleridname'],_0xba5889['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0xba5889[_0x759a('0x40')]]){var _0x18cdd1=RpcVoiceTransferReport[_0x759a('0x41')][_0xba5889[_0x759a('0x40')]];_0x18cdd1[_0x759a('0x42')]=_0xba5889[_0x759a('0x43')];RpcVoiceTransferReport[_0x759a('0x1c')](_0x18cdd1);delete RpcVoiceTransferReport[_0x759a('0x41')][_0xba5889['linkedid']];}RpcVoiceCallReport['create'](_0xba5889);if(_0xba5889[_0x759a('0x44')]){for(var _0x7bcfed=0x0;_0x7bcfed<_0xba5889[_0x759a('0x45')][_0x759a('0x25')];_0x7bcfed+=0x1){_0xba5889[_0x759a('0x46')]=_0xba5889[_0x759a('0x45')][_0x7bcfed][_0x759a('0x47')];_0xba5889[_0x759a('0x48')]=_0xba5889[_0x759a('0x45')][_0x7bcfed][_0x759a('0x48')];if(_0xba5889[_0x759a('0x31')]=='xcally-motion-preview'){_0xba5889[_0x759a('0x3e')]=_0xba5889['connectedlinenum'];_0xba5889[_0x759a('0x49')]=_0xba5889[_0x759a('0x4a')];_0xba5889[_0x759a('0x26')]=_0xba5889[_0x759a('0x21')];_0xba5889['connectedlinename']=_0xba5889[_0x759a('0x4b')];_0xba5889[_0x759a('0x31')]=_0xba5889['originatecalleridnum'];}else if(_0xba5889[_0x759a('0x31')]==_0x759a('0x4c')){_0xba5889[_0x759a('0x3e')]=_0xba5889[_0x759a('0x30')];_0xba5889['exten']=_0xba5889[_0x759a('0x3b')];}RpcVoiceRecording[_0x759a('0x2e')](_0xba5889);}}};Report[_0x759a('0x10')][_0x759a('0x19')]=function(_0x10f308){if(_['isArray'](_0x10f308)){_0x10f308[_0x759a('0x4d')](function(_0x439284){RpcVoiceAgentReport[_0x759a('0x2e')](_0x439284);});}else{RpcVoiceAgentReport[_0x759a('0x2e')](_0x10f308);}};Report[_0x759a('0x10')]['voiceDialReport']=function(_0x4ab396){RpcVoiceDialReport['create'](_0x4ab396);var _0x440776;var _0x43e391;var _0x3c8663=_0x4ab396[_0x759a('0x3d')];if(_[_0x759a('0x4e')](_0x3c8663,'Local')){_0x43e391=_0x3c8663[_0x759a('0x4f')](_0x3c8663[_0x759a('0x50')]('/')+0x1,_0x3c8663[_0x759a('0x50')]('@'));_0x440776=_[_0x759a('0x1e')](this[_0x759a('0xe')],function(_0x348f52){return _0x348f52[_0x759a('0x51')]==_0x43e391||_0x348f52[_0x759a('0x52')]==_0x43e391||_0x348f52[_0x759a('0x21')]==_0x43e391;});}else{_0x43e391=_0x3c8663[_0x759a('0x4f')](_0x3c8663[_0x759a('0x50')]('/')+0x1,_0x3c8663[_0x759a('0x53')]('-'));_0x440776=this['findAgent'](_0x43e391);}if(_0x440776){_0x4ab396['interface']=_[_0x759a('0x20')](_0x440776['interface'])?util['format'](_0x759a('0x24'),_0x440776['name']):_0x440776[_0x759a('0x22')];_0x4ab396['membername']=_0x440776['name'];_0x4ab396[_0x759a('0x21')]=_0x440776[_0x759a('0x21')];RpcMemberReport[_0x759a('0x1b')](_0x4ab396);}};Report['prototype']['blindTransfer']=function(_0x577540){RpcVoiceTransferReport[_0x759a('0x41')][_0x577540[_0x759a('0x54')]]=_0x577540;};Report[_0x759a('0x10')][_0x759a('0x55')]=function(_0x32fbda){RpcVoiceTransferReport[_0x759a('0x55')](_0x32fbda);};module['exports']=Report; \ No newline at end of file +var _0xe94c=['monitors','createdAt','xcally-motion-preview','connectedlinenum','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','membername','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','find','interface','format','SIP/%s','length','lastAssignedTo','name','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','callerid','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','uniqueid','blindTransfer','monitor'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0xe94c,0xcc));var _0xce94=function(_0x171e28,_0x2cc797){_0x171e28=_0x171e28-0x0;var _0x7a3417=_0xe94c[_0x171e28];return _0x7a3417;};'use strict';var _=require(_0xce94('0x0'));var moment=require(_0xce94('0x1'));var util=require(_0xce94('0x2'));var config=require(_0xce94('0x3'));var ami=require(_0xce94('0x4'));var RpcVoiceAgentReport=require(_0xce94('0x5'));var RpcVoiceCallReport=require(_0xce94('0x6'));var RpcVoiceDialReport=require(_0xce94('0x7'));var RpcMemberReport=require(_0xce94('0x8'));var RpcVoiceQueueReport=require(_0xce94('0x9'));var RpcVoiceRecording=require(_0xce94('0xa'));var RpcVoiceTransferReport=require(_0xce94('0xb'));var VoiceQueueReport=require(_0xce94('0xc'));var VoiceCallReport=require(_0xce94('0xd'));var VoiceAgentReport=require(_0xce94('0xe'));var VoiceDialReport=require(_0xce94('0xf'));var UserReport=require(_0xce94('0x10'));function Report(_0x240aa2){this[_0xce94('0x11')]=_0x240aa2;this[_0xce94('0x12')]=_0x240aa2[_0xce94('0x12')];this['telephones']=_0x240aa2[_0xce94('0x13')];}Report[_0xce94('0x14')][_0xce94('0x15')]=function(_0x53f578){var _0x12804e=new VoiceQueueReport(this[_0xce94('0x11')]);var _0x3899d2=new VoiceAgentReport(this[_0xce94('0x11')]);var _0x341ca0=new VoiceDialReport(this[_0xce94('0x11')]);var _0x41694a=new VoiceCallReport(this[_0xce94('0x11')]);var _0x86a1bc=new UserReport(this['realtime']);if(config['xdr']&&config['xdr'][_0xce94('0x16')]){ami['on'](_0xce94('0x17'),this[_0xce94('0x18')]['bind'](this));ami['on'](_0xce94('0x19'),this[_0xce94('0x1a')][_0xce94('0x1b')](this));ami['on'](_0xce94('0x1c'),this[_0xce94('0x1d')]['bind'](this));ami['on'](_0xce94('0x1e'),this[_0xce94('0x1f')][_0xce94('0x1b')](this));ami['on'](_0xce94('0x20'),this['blindTransfer'][_0xce94('0x1b')](this));ami['on'](_0xce94('0x21'),this[_0xce94('0x22')][_0xce94('0x1b')](this));}};Report[_0xce94('0x14')][_0xce94('0x23')]=function(_0x55d3d6){var _0x385f2a;_0x385f2a=_['find'](this['agents'],function(_0x1e8aa7){return _0x1e8aa7[_0xce94('0x24')]==_0x55d3d6||_0x1e8aa7['name']==_0x55d3d6;});if(_['isNil'](_0x385f2a)){var _0x779b7e=_['find'](this[_0xce94('0x13')],function(_0x134343){return _0x134343[_0xce94('0x24')]==_0x55d3d6||_0x134343['name']==_0x55d3d6;});if(_0x779b7e){_0x385f2a=_[_0xce94('0x25')](this[_0xce94('0x12')],function(_0x5a4c4c){return _0x5a4c4c[_0xce94('0x26')]==util[_0xce94('0x27')](_0xce94('0x28'),_0x779b7e['name']);});}}return _0x385f2a;};Report[_0xce94('0x14')][_0xce94('0x18')]=function(_0x58ca14){for(var _0x3ca8cf=0x0;_0x3ca8cf<_0x58ca14[_0xce94('0x29')];_0x3ca8cf+=0x1){var _0x4e573d=this[_0xce94('0x23')](_0x58ca14[_0x3ca8cf]['connectedlinenum']);if(_0x4e573d){_0x58ca14[_0x3ca8cf][_0xce94('0x24')]=_0x4e573d[_0xce94('0x24')];_0x58ca14[_0x3ca8cf]['assigned']=!![];_0x58ca14[_0x3ca8cf][_0xce94('0x2a')]=_0x4e573d[_0xce94('0x2b')];_0x58ca14[_0x3ca8cf][_0xce94('0x26')]=_[_0xce94('0x2c')](_0x4e573d['interface'])?util['format']('SIP/%s',_0x4e573d[_0xce94('0x2b')]):_0x4e573d['interface'];if(_0x58ca14[_0x3ca8cf][_0xce94('0x2d')]){_0x58ca14[_0x3ca8cf][_0xce94('0x2e')]=moment()[_0xce94('0x27')](_0xce94('0x2f'));}if(_0x58ca14[_0x3ca8cf][_0xce94('0x30')]){_0x58ca14[_0x3ca8cf][_0xce94('0x31')]=moment()[_0xce94('0x27')](_0xce94('0x2f'));}RpcMemberReport['voiceQueueReport'](_0x58ca14[_0x3ca8cf]);}RpcVoiceQueueReport[_0xce94('0x32')](_0x58ca14[_0x3ca8cf]);}};function extractCalleridNumber(_0x5194eb){var _0x2d39fc=_0x5194eb[_0xce94('0x33')](/<(.*?)>/);return _0x2d39fc?_0x2d39fc[0x1]:_0x5194eb;}Report[_0xce94('0x14')][_0xce94('0x1a')]=function(_0x28f111){_0x28f111[_0xce94('0x34')]=_0x28f111[_0xce94('0x34')]||_0x28f111[_0xce94('0x35')];if(_0x28f111[_0xce94('0x36')]==_0xce94('0x37')){_0x28f111['lastapplication']=_0xce94('0x38');_0x28f111[_0xce94('0x39')]=_0x28f111[_0xce94('0x38')];if(_0x28f111[_0xce94('0x3a')]==_0xce94('0x3b')){_0x28f111[_0xce94('0x24')]='';_0x28f111[_0xce94('0x34')]=extractCalleridNumber(_0x28f111[_0xce94('0x3c')]);}else if(_0x28f111['context']=='from-sip'){if(_0x28f111['destination']=='xcally-motion-preview'){_0x28f111[_0xce94('0x34')]=extractCalleridNumber(_0x28f111[_0xce94('0x3d')]);_0x28f111[_0xce94('0x3e')]=_0x28f111[_0xce94('0x3f')];_0x28f111[_0xce94('0x40')]=[_0x28f111[_0xce94('0x41')],_0x28f111[_0xce94('0x41')]=_0x28f111[_0xce94('0x40')]][0x0];_0x28f111[_0xce94('0x3c')]=_0x28f111[_0xce94('0x3d')];}else{_0x28f111[_0xce94('0x34')]=_0x28f111['calleridnum'];_0x28f111[_0xce94('0x3e')]=_0x28f111['originatecalleridnum'];if(_0x28f111[_0xce94('0x42')]==_0xce94('0x43')){_0x28f111['accountcode']=_0x28f111['connectedlinenum'];}else{_0x28f111[_0xce94('0x24')]='';}}}}else{_0x28f111[_0xce94('0x3c')]=util['format'](_0xce94('0x44'),_0x28f111[_0xce94('0x45')],_0x28f111[_0xce94('0x3e')]);}if(RpcVoiceTransferReport['transfers'][_0x28f111[_0xce94('0x46')]]){var _0x24ff1e=RpcVoiceTransferReport[_0xce94('0x47')][_0x28f111['linkedid']];_0x24ff1e['transfereelinkedid']=_0x28f111[_0xce94('0x48')];RpcVoiceTransferReport[_0xce94('0x49')](_0x24ff1e);delete RpcVoiceTransferReport[_0xce94('0x47')][_0x28f111[_0xce94('0x46')]];}RpcVoiceCallReport[_0xce94('0x32')](_0x28f111);if(_0x28f111[_0xce94('0x4a')]){for(var _0x216e70=0x0;_0x216e70<_0x28f111['monitors'][_0xce94('0x29')];_0x216e70+=0x1){_0x28f111['monitorFilename']=_0x28f111[_0xce94('0x4b')][_0x216e70]['filename'];_0x28f111[_0xce94('0x4c')]=_0x28f111['monitors'][_0x216e70][_0xce94('0x4c')];if(_0x28f111['exten']==_0xce94('0x4d')){_0x28f111[_0xce94('0x3e')]=_0x28f111[_0xce94('0x4e')];_0x28f111[_0xce94('0x45')]=_0x28f111['connectedlinename'];_0x28f111[_0xce94('0x4e')]=_0x28f111[_0xce94('0x24')];_0x28f111[_0xce94('0x4f')]=_0x28f111['membername'];_0x28f111[_0xce94('0x35')]=_0x28f111['originatecalleridnum'];}else if(_0x28f111[_0xce94('0x35')]==_0xce94('0x50')){_0x28f111[_0xce94('0x3e')]=_0x28f111[_0xce94('0x34')];_0x28f111[_0xce94('0x35')]=_0x28f111[_0xce94('0x3f')];}RpcVoiceRecording[_0xce94('0x32')](_0x28f111);}}};Report[_0xce94('0x14')]['voiceAgentReport']=function(_0x5e963f){if(_[_0xce94('0x51')](_0x5e963f)){_0x5e963f[_0xce94('0x52')](function(_0x2c143b){RpcVoiceAgentReport[_0xce94('0x32')](_0x2c143b);});}else{RpcVoiceAgentReport['create'](_0x5e963f);}};Report[_0xce94('0x14')][_0xce94('0x1f')]=function(_0x41783a){RpcVoiceDialReport[_0xce94('0x32')](_0x41783a);var _0xf89a54;var _0x74cb16;var _0x730398=_0x41783a[_0xce94('0x41')];if(_[_0xce94('0x53')](_0x730398,_0xce94('0x54'))){_0x74cb16=_0x730398[_0xce94('0x55')](_0x730398[_0xce94('0x56')]('/')+0x1,_0x730398[_0xce94('0x56')]('@'));_0xf89a54=_[_0xce94('0x25')](this[_0xce94('0x12')],function(_0x6c7fdc){return _0x6c7fdc[_0xce94('0x57')]==_0x74cb16||_0x6c7fdc[_0xce94('0x58')]==_0x74cb16||_0x6c7fdc[_0xce94('0x24')]==_0x74cb16;});}else{_0x74cb16=_0x730398[_0xce94('0x55')](_0x730398[_0xce94('0x56')]('/')+0x1,_0x730398[_0xce94('0x59')]('-'));_0xf89a54=this[_0xce94('0x23')](_0x74cb16);}if(_0xf89a54){_0x41783a['interface']=_[_0xce94('0x2c')](_0xf89a54[_0xce94('0x26')])?util[_0xce94('0x27')](_0xce94('0x28'),_0xf89a54[_0xce94('0x2b')]):_0xf89a54['interface'];_0x41783a[_0xce94('0x5a')]=_0xf89a54[_0xce94('0x2b')];_0x41783a[_0xce94('0x24')]=_0xf89a54['accountcode'];RpcMemberReport[_0xce94('0x1f')](_0x41783a);}};Report[_0xce94('0x14')][_0xce94('0x49')]=function(_0x5b96b8){RpcVoiceTransferReport[_0xce94('0x47')][_0x5b96b8[_0xce94('0x5b')]]=_0x5b96b8;};Report[_0xce94('0x14')]['attendedTransfer']=function(_0x13565a){RpcVoiceTransferReport[_0xce94('0x22')](_0x13565a);};module[_0xce94('0x5c')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index c0ddd2e..7acd595 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4db=['format','trunk:%s','trunk:save','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','name','telephone:save','startsWith','Local','substring','indexOf','mobile','phone','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','updateStatusRealtime','telephone:%s','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','../ami','defaults','redis','localhost','trunks','agents','telephones','bind','syncRegistry','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','[userReport][sipshowregistry]','inspect','actionDeviceStateList','catch','error','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','state','find','username','stateRegistry','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:'];(function(_0x188832,_0x49101d){var _0x2b990f=function(_0x231635){while(--_0x231635){_0x188832['push'](_0x188832['shift']());}};_0x2b990f(++_0x49101d);}(_0xb4db,0x17e));var _0xbb4d=function(_0x16ce67,_0x49b4a6){_0x16ce67=_0x16ce67-0x0;var _0x505405=_0xb4db[_0x16ce67];return _0x505405;};'use strict';var _=require(_0xbb4d('0x0'));var moment=require(_0xbb4d('0x1'));var util=require(_0xbb4d('0x2'));var Redis=require(_0xbb4d('0x3'));var BPromise=require(_0xbb4d('0x4'));var config=require('../../../config/environment');var logger=require(_0xbb4d('0x5'))(_0xbb4d('0x6'));var ami=require(_0xbb4d('0x7'));config['redis']=_[_0xbb4d('0x8')](config[_0xbb4d('0x9')],{'host':_0xbb4d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbb4d('0x9')]));function UserReport(_0x3e9662){this[_0xbb4d('0xb')]=_0x3e9662['trunks'];this[_0xbb4d('0xc')]=_0x3e9662[_0xbb4d('0xc')];this[_0xbb4d('0xd')]=_0x3e9662['telephones'];ami['on']('registryentry',this['syncRegistry'][_0xbb4d('0xe')](this));ami['on']('registry',this[_0xbb4d('0xf')][_0xbb4d('0xe')](this));ami['on'](_0xbb4d('0x10'),this[_0xbb4d('0x11')][_0xbb4d('0xe')](this));ami['on']('peerstatus',this[_0xbb4d('0x12')][_0xbb4d('0xe')](this));return this[_0xbb4d('0x13')]();}function showSipRegistrations(){Promise[_0xbb4d('0x14')]()[_0xbb4d('0x15')](ami['actionSipShowRegistry']())['catch'](function(_0x13c0a8){logger['error'](_0xbb4d('0x16'),util[_0xbb4d('0x17')](_0x13c0a8,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xbb4d('0x15')](ami[_0xbb4d('0x18')]())[_0xbb4d('0x19')](function(_0x3de31c){logger[_0xbb4d('0x1a')](_0xbb4d('0x1b'),util[_0xbb4d('0x17')](_0x3de31c,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xbb4d('0x14')]()[_0xbb4d('0x15')](ami['actionSipPeerStatus']())[_0xbb4d('0x19')](function(_0xe898d8){logger[_0xbb4d('0x1a')](_0xbb4d('0x1c'),util[_0xbb4d('0x17')](_0xe898d8,{'showHidden':![],'depth':null}));});}UserReport[_0xbb4d('0x1d')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xbb4d('0x14')]()[_0xbb4d('0x15')](showSipRegistrations())[_0xbb4d('0x15')](listDeviceStates())[_0xbb4d('0x15')](showPeersStatus());},0x32c8);};UserReport[_0xbb4d('0x1d')]['isNotNull']=function(_0x1d40d2){return _0x1d40d2!==null&&!_[_0xbb4d('0x1e')](_0x1d40d2);};UserReport['prototype'][_0xbb4d('0x1f')]=function(_0x1d409c,_0x3ed290,_0x686c3f){io['to'](_0x1d409c)[_0xbb4d('0x1f')](_0x3ed290,_0x686c3f);};UserReport['prototype'][_0xbb4d('0xf')]=function(_0x225275){try{if(this[_0xbb4d('0x20')](_0x225275)){logger[_0xbb4d('0x21')](_0xbb4d('0x22'),_0x225275['username'],_0x225275[_0xbb4d('0x23')]);logger['debug']('[userReport][registry]',util[_0xbb4d('0x17')](_0x225275,{'showHidden':![],'depth':null}));var _0x3ce1b7=_[_0xbb4d('0x24')](this[_0xbb4d('0xb')],{'defaultuser':_0x225275[_0xbb4d('0x25')]});if(_0x3ce1b7){_0x225275[_0xbb4d('0x26')]=_0x225275['state'];_['merge'](_0x3ce1b7,_[_0xbb4d('0x27')](_0x225275,[_0xbb4d('0x28'),_0xbb4d('0x29'),'username','state']));logger[_0xbb4d('0x2a')](_0xbb4d('0x2b'),util[_0xbb4d('0x17')](_0x3ce1b7,{'showHidden':![],'depth':null}));this[_0xbb4d('0x1f')](util[_0xbb4d('0x2c')](_0xbb4d('0x2d'),_0x3ce1b7['name']),_0xbb4d('0x2e'),_0x3ce1b7);}}}catch(_0x5736d1){logger[_0xbb4d('0x1a')]('[userReport][registry]',util['inspect'](_0x5736d1,{'showHidden':![],'depth':null}));}};UserReport[_0xbb4d('0x1d')][_0xbb4d('0x11')]=function(_0x21782b){try{if(this[_0xbb4d('0x20')](_0x21782b)){logger[_0xbb4d('0x21')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x21782b[_0xbb4d('0x2f')],_0x21782b[_0xbb4d('0x23')]);logger[_0xbb4d('0x2a')](_0xbb4d('0x30'),util[_0xbb4d('0x17')](_0x21782b,{'showHidden':![],'depth':null}));if(this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]]){if(!this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x31')]||_0x21782b[_0xbb4d('0x23')]['toLowerCase']()=='inuse'){this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x31')]=![];if(this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x23')]!==_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]()){this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x33')]=_[_0xbb4d('0x34')](moment()['format']('x'));}this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]]['state']=_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]();this[_0xbb4d('0xc')][_0x21782b['device']]['updateStatusRealtime'](_0x21782b);}}else if(this[_0xbb4d('0xd')][_0x21782b[_0xbb4d('0x2f')]]){if(this['telephones'][_0x21782b['device']][_0xbb4d('0x23')]!==_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]()){this['telephones'][_0x21782b[_0xbb4d('0x2f')]]['stateTime']=_['toNumber'](moment()[_0xbb4d('0x2c')]('x'));}this[_0xbb4d('0xd')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x23')]=_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]();logger[_0xbb4d('0x2a')](_0xbb4d('0x35'),util[_0xbb4d('0x17')](this[_0xbb4d('0xd')][_0x21782b[_0xbb4d('0x2f')]],{'showHidden':![],'depth':null}));this[_0xbb4d('0x1f')](util['format']('telephone:%s',this[_0xbb4d('0xd')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x36')]),_0xbb4d('0x37'),this[_0xbb4d('0xd')][_0x21782b[_0xbb4d('0x2f')]]);}else if(this[_0xbb4d('0xb')][_0x21782b[_0xbb4d('0x2f')]]){if(this['trunks'][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x23')]!==_0x21782b['state'][_0xbb4d('0x32')]()){this[_0xbb4d('0xb')][_0x21782b[_0xbb4d('0x2f')]]['stateTime']=_['toNumber'](moment()[_0xbb4d('0x2c')]('x'));}this[_0xbb4d('0xb')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x23')]=_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]();logger[_0xbb4d('0x2a')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0xbb4d('0x17')](this[_0xbb4d('0xb')][_0x21782b['device']],{'showHidden':![],'depth':null}));this[_0xbb4d('0x1f')](util[_0xbb4d('0x2c')](_0xbb4d('0x2d'),this[_0xbb4d('0xb')][_0x21782b[_0xbb4d('0x2f')]]['name']),_0xbb4d('0x2e'),this[_0xbb4d('0xb')][_0x21782b[_0xbb4d('0x2f')]]);}else if(_[_0xbb4d('0x38')](_0x21782b[_0xbb4d('0x2f')],_0xbb4d('0x39'))){var _0x1539f2=_0x21782b[_0xbb4d('0x2f')];var _0x59fce5=_0x1539f2[_0xbb4d('0x3a')](_0x1539f2[_0xbb4d('0x3b')]('/')+0x1,_0x1539f2[_0xbb4d('0x3b')]('@'));var _0x1ed32b=_[_0xbb4d('0x24')](this[_0xbb4d('0xc')],function(_0x27f55d){return _0x27f55d[_0xbb4d('0x3c')]==_0x59fce5||_0x27f55d[_0xbb4d('0x3d')]==_0x59fce5||_0x27f55d['accountcode']==_0x59fce5;});if(_0x1ed32b){if(_0x1ed32b['state']!==_0x21782b['state'][_0xbb4d('0x32')]()){_0x1ed32b[_0xbb4d('0x33')]=_[_0xbb4d('0x34')](moment()['format']('x'));}_0x1ed32b[_0xbb4d('0x23')]=_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]();_0x1ed32b[_0xbb4d('0x31')]=!![];_0x1ed32b['updateStatusRealtime'](_0x21782b);}}}}catch(_0x5a536f){logger[_0xbb4d('0x1a')](_0xbb4d('0x30'),util[_0xbb4d('0x17')](_0x5a536f,{'showHidden':![],'depth':null}));}};UserReport[_0xbb4d('0x1d')][_0xbb4d('0x12')]=function(_0x2023d3){try{if(this['isNotNull'](_0x2023d3)&&this[_0xbb4d('0x20')](_0x2023d3[_0xbb4d('0x3e')])){logger[_0xbb4d('0x21')](_0xbb4d('0x3f'),_0x2023d3[_0xbb4d('0x40')],_0x2023d3[_0xbb4d('0x41')],_0x2023d3[_0xbb4d('0x3e')]);logger[_0xbb4d('0x2a')]('[userReport][peerstatus]',util['inspect'](_0x2023d3,{'showHidden':![],'depth':null}));if(this[_0xbb4d('0xc')][_0x2023d3[_0xbb4d('0x40')]]){if(!this[_0xbb4d('0xc')][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x31')]||_0x2023d3[_0xbb4d('0x3e')][_0xbb4d('0x32')]()==_0xbb4d('0x42')){this[_0xbb4d('0xc')][_0x2023d3[_0xbb4d('0x40')]]['local']=![];this[_0xbb4d('0xc')][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x43')]=_0x2023d3[_0xbb4d('0x3e')][_0xbb4d('0x32')]();this[_0xbb4d('0xc')][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x41')]=_0x2023d3[_0xbb4d('0x41')];this[_0xbb4d('0xc')][_0x2023d3['peer']][_0xbb4d('0x44')](_0x2023d3);}}else if(this[_0xbb4d('0xd')][_0x2023d3[_0xbb4d('0x40')]]){this[_0xbb4d('0xd')][_0x2023d3[_0xbb4d('0x40')]]['status']=_0x2023d3[_0xbb4d('0x3e')]['toLowerCase']();this['telephones'][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x41')]=_0x2023d3[_0xbb4d('0x41')];logger[_0xbb4d('0x2a')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xbb4d('0x17')](this[_0xbb4d('0xd')][_0x2023d3[_0xbb4d('0x40')]],{'showHidden':![],'depth':null}));this[_0xbb4d('0x1f')](util[_0xbb4d('0x2c')](_0xbb4d('0x45'),this[_0xbb4d('0xd')][_0x2023d3['peer']][_0xbb4d('0x36')]),_0xbb4d('0x37'),this[_0xbb4d('0xd')][_0x2023d3['peer']]);}else if(this['trunks'][_0x2023d3[_0xbb4d('0x40')]]){this[_0xbb4d('0xb')][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x43')]=_0x2023d3['peerstatus']['toLowerCase']();this[_0xbb4d('0xb')][_0x2023d3['peer']][_0xbb4d('0x41')]=_0x2023d3[_0xbb4d('0x41')];logger[_0xbb4d('0x2a')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util['inspect'](this['trunks'][_0x2023d3[_0xbb4d('0x40')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xbb4d('0x2c')](_0xbb4d('0x2d'),this[_0xbb4d('0xb')][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x36')]),_0xbb4d('0x2e'),this[_0xbb4d('0xb')][_0x2023d3[_0xbb4d('0x40')]]);}}}catch(_0x4b87b8){logger[_0xbb4d('0x1a')]('[userReport][peerstatus]',util[_0xbb4d('0x17')](_0x4b87b8,{'showHidden':![],'depth':null}));}};module[_0xbb4d('0x46')]=UserReport; \ No newline at end of file +var _0x2560=['[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','resolve','then','catch','error','[userReport][sipshowregistry]','inspect','[userReport][devicestatelist]','prototype','isNotNull','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','find','username','stateRegistry','omit','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','[userReport][registry]','device','[userReport][devicestatechange]','local','toLowerCase','toNumber','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','startsWith','Local','substring','indexOf','mobile','phone','accountcode','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','registered','status','address'];(function(_0x1ce1e9,_0x4b7c04){var _0x572136=function(_0x175fe1){while(--_0x175fe1){_0x1ce1e9['push'](_0x1ce1e9['shift']());}};_0x572136(++_0x4b7c04);}(_0x2560,0x9a));var _0x0256=function(_0x31fb93,_0x359977){_0x31fb93=_0x31fb93-0x0;var _0x380ef0=_0x2560[_0x31fb93];return _0x380ef0;};'use strict';var _=require(_0x0256('0x0'));var moment=require(_0x0256('0x1'));var util=require(_0x0256('0x2'));var Redis=require(_0x0256('0x3'));var BPromise=require(_0x0256('0x4'));var config=require(_0x0256('0x5'));var logger=require(_0x0256('0x6'))(_0x0256('0x7'));var ami=require(_0x0256('0x8'));config[_0x0256('0x9')]=_['defaults'](config[_0x0256('0x9')],{'host':_0x0256('0xa'),'port':0x18eb});var io=require(_0x0256('0xb'))(new Redis(config[_0x0256('0x9')]));function UserReport(_0x52b118){this[_0x0256('0xc')]=_0x52b118['trunks'];this[_0x0256('0xd')]=_0x52b118[_0x0256('0xd')];this[_0x0256('0xe')]=_0x52b118[_0x0256('0xe')];ami['on'](_0x0256('0xf'),this['syncRegistry'][_0x0256('0x10')](this));ami['on'](_0x0256('0x11'),this[_0x0256('0x12')][_0x0256('0x10')](this));ami['on'](_0x0256('0x13'),this[_0x0256('0x14')][_0x0256('0x10')](this));ami['on'](_0x0256('0x15'),this['syncPeerStatus']['bind'](this));return this[_0x0256('0x16')]();}function showSipRegistrations(){Promise[_0x0256('0x17')]()[_0x0256('0x18')](ami['actionSipShowRegistry']())[_0x0256('0x19')](function(_0x2a9c88){logger[_0x0256('0x1a')](_0x0256('0x1b'),util[_0x0256('0x1c')](_0x2a9c88,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x0256('0x18')](ami['actionDeviceStateList']())[_0x0256('0x19')](function(_0x5a6da6){logger[_0x0256('0x1a')](_0x0256('0x1d'),util[_0x0256('0x1c')](_0x5a6da6,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x0256('0x17')]()[_0x0256('0x18')](ami['actionSipPeerStatus']())[_0x0256('0x19')](function(_0x4fc7d1){logger[_0x0256('0x1a')]('[userReport][sippeerstatus]',util[_0x0256('0x1c')](_0x4fc7d1,{'showHidden':![],'depth':null}));});}UserReport[_0x0256('0x1e')][_0x0256('0x16')]=function(){setInterval(function(){BPromise['resolve']()[_0x0256('0x18')](showSipRegistrations())[_0x0256('0x18')](listDeviceStates())[_0x0256('0x18')](showPeersStatus());},0x32c8);};UserReport[_0x0256('0x1e')][_0x0256('0x1f')]=function(_0x211386){return _0x211386!==null&&!_['isUndefined'](_0x211386);};UserReport[_0x0256('0x1e')][_0x0256('0x20')]=function(_0x2a54d9,_0x2f048a,_0x5e77de){io['to'](_0x2a54d9)[_0x0256('0x20')](_0x2f048a,_0x5e77de);};UserReport[_0x0256('0x1e')]['syncRegistry']=function(_0x42e3a8){try{if(this[_0x0256('0x1f')](_0x42e3a8)){logger[_0x0256('0x21')](_0x0256('0x22'),_0x42e3a8['username'],_0x42e3a8[_0x0256('0x23')]);logger['debug']('[userReport][registry]',util[_0x0256('0x1c')](_0x42e3a8,{'showHidden':![],'depth':null}));var _0x3d7873=_[_0x0256('0x24')](this[_0x0256('0xc')],{'defaultuser':_0x42e3a8[_0x0256('0x25')]});if(_0x3d7873){_0x42e3a8[_0x0256('0x26')]=_0x42e3a8[_0x0256('0x23')];_['merge'](_0x3d7873,_[_0x0256('0x27')](_0x42e3a8,['event','actionid',_0x0256('0x25'),_0x0256('0x23')]));logger[_0x0256('0x28')](_0x0256('0x29'),util['inspect'](_0x3d7873,{'showHidden':![],'depth':null}));this[_0x0256('0x20')](util[_0x0256('0x2a')](_0x0256('0x2b'),_0x3d7873[_0x0256('0x2c')]),'trunk:save',_0x3d7873);}}}catch(_0x3ec115){logger['error'](_0x0256('0x2d'),util[_0x0256('0x1c')](_0x3ec115,{'showHidden':![],'depth':null}));}};UserReport[_0x0256('0x1e')][_0x0256('0x14')]=function(_0x4d29ef){try{if(this['isNotNull'](_0x4d29ef)){logger[_0x0256('0x21')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x4d29ef[_0x0256('0x2e')],_0x4d29ef[_0x0256('0x23')]);logger[_0x0256('0x28')](_0x0256('0x2f'),util[_0x0256('0x1c')](_0x4d29ef,{'showHidden':![],'depth':null}));if(this[_0x0256('0xd')][_0x4d29ef[_0x0256('0x2e')]]){if(!this[_0x0256('0xd')][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x30')]||_0x4d29ef[_0x0256('0x23')]['toLowerCase']()=='inuse'){this[_0x0256('0xd')][_0x4d29ef['device']][_0x0256('0x30')]=![];if(this[_0x0256('0xd')][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x23')]!==_0x4d29ef[_0x0256('0x23')][_0x0256('0x31')]()){this[_0x0256('0xd')][_0x4d29ef['device']]['stateTime']=_[_0x0256('0x32')](moment()['format']('x'));}this[_0x0256('0xd')][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x23')]=_0x4d29ef[_0x0256('0x23')][_0x0256('0x31')]();this['agents'][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x33')](_0x4d29ef);}}else if(this[_0x0256('0xe')][_0x4d29ef[_0x0256('0x2e')]]){if(this[_0x0256('0xe')][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x23')]!==_0x4d29ef[_0x0256('0x23')]['toLowerCase']()){this['telephones'][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x34')]=_['toNumber'](moment()[_0x0256('0x2a')]('x'));}this['telephones'][_0x4d29ef[_0x0256('0x2e')]]['state']=_0x4d29ef[_0x0256('0x23')][_0x0256('0x31')]();logger['debug'](_0x0256('0x35'),util['inspect'](this[_0x0256('0xe')][_0x4d29ef[_0x0256('0x2e')]],{'showHidden':![],'depth':null}));this[_0x0256('0x20')](util[_0x0256('0x2a')](_0x0256('0x36'),this['telephones'][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x2c')]),_0x0256('0x37'),this['telephones'][_0x4d29ef['device']]);}else if(this[_0x0256('0xc')][_0x4d29ef[_0x0256('0x2e')]]){if(this[_0x0256('0xc')][_0x4d29ef[_0x0256('0x2e')]]['state']!==_0x4d29ef[_0x0256('0x23')][_0x0256('0x31')]()){this[_0x0256('0xc')][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x34')]=_[_0x0256('0x32')](moment()['format']('x'));}this[_0x0256('0xc')][_0x4d29ef['device']][_0x0256('0x23')]=_0x4d29ef[_0x0256('0x23')]['toLowerCase']();logger['debug'](_0x0256('0x38'),util[_0x0256('0x1c')](this[_0x0256('0xc')][_0x4d29ef['device']],{'showHidden':![],'depth':null}));this[_0x0256('0x20')](util[_0x0256('0x2a')](_0x0256('0x2b'),this[_0x0256('0xc')][_0x4d29ef[_0x0256('0x2e')]]['name']),_0x0256('0x39'),this[_0x0256('0xc')][_0x4d29ef[_0x0256('0x2e')]]);}else if(_[_0x0256('0x3a')](_0x4d29ef[_0x0256('0x2e')],_0x0256('0x3b'))){var _0x38da44=_0x4d29ef[_0x0256('0x2e')];var _0x3afe47=_0x38da44[_0x0256('0x3c')](_0x38da44['indexOf']('/')+0x1,_0x38da44[_0x0256('0x3d')]('@'));var _0x1aa5fe=_[_0x0256('0x24')](this['agents'],function(_0x403aa2){return _0x403aa2[_0x0256('0x3e')]==_0x3afe47||_0x403aa2[_0x0256('0x3f')]==_0x3afe47||_0x403aa2[_0x0256('0x40')]==_0x3afe47;});if(_0x1aa5fe){if(_0x1aa5fe[_0x0256('0x23')]!==_0x4d29ef[_0x0256('0x23')][_0x0256('0x31')]()){_0x1aa5fe[_0x0256('0x34')]=_[_0x0256('0x32')](moment()[_0x0256('0x2a')]('x'));}_0x1aa5fe[_0x0256('0x23')]=_0x4d29ef[_0x0256('0x23')]['toLowerCase']();_0x1aa5fe['local']=!![];_0x1aa5fe[_0x0256('0x33')](_0x4d29ef);}}}}catch(_0x4632fe){logger[_0x0256('0x1a')](_0x0256('0x2f'),util[_0x0256('0x1c')](_0x4632fe,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x0256('0x41')]=function(_0x4bcf5f){try{if(this[_0x0256('0x1f')](_0x4bcf5f)&&this['isNotNull'](_0x4bcf5f[_0x0256('0x15')])){logger['info'](_0x0256('0x42'),_0x4bcf5f[_0x0256('0x43')],_0x4bcf5f['address'],_0x4bcf5f[_0x0256('0x15')]);logger[_0x0256('0x28')]('[userReport][peerstatus]',util[_0x0256('0x1c')](_0x4bcf5f,{'showHidden':![],'depth':null}));if(this['agents'][_0x4bcf5f[_0x0256('0x43')]]){if(!this[_0x0256('0xd')][_0x4bcf5f[_0x0256('0x43')]][_0x0256('0x30')]||_0x4bcf5f[_0x0256('0x15')][_0x0256('0x31')]()==_0x0256('0x44')){this[_0x0256('0xd')][_0x4bcf5f['peer']][_0x0256('0x30')]=![];this[_0x0256('0xd')][_0x4bcf5f['peer']][_0x0256('0x45')]=_0x4bcf5f['peerstatus'][_0x0256('0x31')]();this[_0x0256('0xd')][_0x4bcf5f['peer']][_0x0256('0x46')]=_0x4bcf5f['address'];this['agents'][_0x4bcf5f[_0x0256('0x43')]][_0x0256('0x33')](_0x4bcf5f);}}else if(this[_0x0256('0xe')][_0x4bcf5f[_0x0256('0x43')]]){this[_0x0256('0xe')][_0x4bcf5f['peer']]['status']=_0x4bcf5f[_0x0256('0x15')][_0x0256('0x31')]();this[_0x0256('0xe')][_0x4bcf5f[_0x0256('0x43')]]['address']=_0x4bcf5f[_0x0256('0x46')];logger[_0x0256('0x28')](_0x0256('0x47'),util[_0x0256('0x1c')](this[_0x0256('0xe')][_0x4bcf5f[_0x0256('0x43')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0256('0x2a')](_0x0256('0x36'),this[_0x0256('0xe')][_0x4bcf5f['peer']][_0x0256('0x2c')]),'telephone:save',this['telephones'][_0x4bcf5f[_0x0256('0x43')]]);}else if(this[_0x0256('0xc')][_0x4bcf5f[_0x0256('0x43')]]){this[_0x0256('0xc')][_0x4bcf5f['peer']][_0x0256('0x45')]=_0x4bcf5f[_0x0256('0x15')][_0x0256('0x31')]();this['trunks'][_0x4bcf5f[_0x0256('0x43')]]['address']=_0x4bcf5f['address'];logger[_0x0256('0x28')](_0x0256('0x48'),util[_0x0256('0x1c')](this[_0x0256('0xc')][_0x4bcf5f[_0x0256('0x43')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0256('0x2a')](_0x0256('0x2b'),this[_0x0256('0xc')][_0x4bcf5f[_0x0256('0x43')]][_0x0256('0x2c')]),_0x0256('0x39'),this['trunks'][_0x4bcf5f['peer']]);}}}catch(_0x2c3fa3){logger[_0x0256('0x1a')](_0x0256('0x49'),util[_0x0256('0x1c')](_0x2c3fa3,{'showHidden':![],'depth':null}));}};module[_0x0256('0x4a')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 2323b95..541563f 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x3e92f3,_0x48d871){var _0x110145=function(_0x5472b3){while(--_0x5472b3){_0x3e92f3['push'](_0x3e92f3['shift']());}};_0x110145(++_0x48d871);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x184e=['[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','voice','merge','omit','privilege','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','membername','user:agentconnect','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','transfer','talktime','acw','acwtime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberrealtime','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','syncAgentCalled','isNotNull'];(function(_0x30ee4f,_0x6630c7){var _0x420824=function(_0x27ea09){while(--_0x27ea09){_0x30ee4f['push'](_0x30ee4f['shift']());}};_0x420824(++_0x6630c7);}(_0x184e,0x1a0));var _0xe184=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x184e[_0x5a7e3c];return _0x59252b;};'use strict';var _=require(_0xe184('0x0'));var moment=require(_0xe184('0x1'));var util=require(_0xe184('0x2'));var Redis=require(_0xe184('0x3'));var config=require(_0xe184('0x4'));var logger=require(_0xe184('0x5'))(_0xe184('0x6'));var ami=require('../ami');config[_0xe184('0x7')]=_[_0xe184('0x8')](config[_0xe184('0x7')],{'host':_0xe184('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x4d0a6e){this[_0xe184('0xa')]={};this['voiceChannels']=_0x4d0a6e[_0xe184('0xa')];this[_0xe184('0xb')]=_0x4d0a6e[_0xe184('0xb')];this[_0xe184('0xc')]=_0x4d0a6e[_0xe184('0xc')];this[_0xe184('0xd')]={};ami['on'](_0xe184('0xe'),this['syncAgentCalled']['bind'](this));ami['on'](_0xe184('0xf'),this[_0xe184('0x10')][_0xe184('0x11')](this));ami['on'](_0xe184('0x12'),this['syncAgentRingNoAnswer'][_0xe184('0x11')](this));ami['on'](_0xe184('0x13'),this[_0xe184('0x14')]['bind'](this));ami['on'](_0xe184('0x15'),this[_0xe184('0x16')][_0xe184('0x11')](this));ami['on']('varset',this[_0xe184('0x17')][_0xe184('0x11')](this));ami['on']('hangup',this['syncHangup'][_0xe184('0x11')](this));ami['on'](_0xe184('0x18'),this['syncMusicOnHoldStart'][_0xe184('0x11')](this));ami['on']('musiconholdstop',this[_0xe184('0x19')][_0xe184('0x11')](this));ami['on'](_0xe184('0x1a'),this['syncAttendedTransfer'][_0xe184('0x11')](this));ami['on'](_0xe184('0x1b'),this[_0xe184('0x1c')][_0xe184('0x11')](this));}VoiceAgentReport[_0xe184('0x1d')][_0xe184('0x1e')]=function(_0x164ac1,_0x1ec00a,_0x2d8b32){io['to'](_0x164ac1)[_0xe184('0x1e')](_0x1ec00a,_0x2d8b32);};VoiceAgentReport[_0xe184('0x1d')]['isNotNull']=function(_0x59fa2e){return _0x59fa2e!==null&&!_[_0xe184('0x1f')](_0x59fa2e);};VoiceAgentReport[_0xe184('0x1d')][_0xe184('0x20')]=function(_0x2fd3be){try{if(this[_0xe184('0x21')](_0x2fd3be)){logger['info'](_0xe184('0x22'),_0x2fd3be[_0xe184('0x23')],_0x2fd3be['membername'],_0x2fd3be[_0xe184('0x24')]);logger[_0xe184('0x25')](_0xe184('0x26'),_0x2fd3be[_0xe184('0x23')],util[_0xe184('0x27')](_0x2fd3be,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xe184('0xa')][_0x2fd3be['uniqueid']])){this[_0xe184('0xa')][_0x2fd3be[_0xe184('0x23')]]={};}if(_[_0xe184('0x1f')](this[_0xe184('0xa')][_0x2fd3be[_0xe184('0x23')]][_0x2fd3be[_0xe184('0x24')]])){this[_0xe184('0xa')][_0x2fd3be[_0xe184('0x23')]][_0x2fd3be[_0xe184('0x24')]]={'agentcalledAt':moment()[_0xe184('0x28')](_0xe184('0x29')),'lastevent':_0xe184('0x2a'),'mandatoryDisposition':this[_0xe184('0xb')][_0x2fd3be[_0xe184('0x2b')]]?this[_0xe184('0xb')][_0x2fd3be[_0xe184('0x2b')]]['mandatoryDisposition']||![]:![],'type':this[_0xe184('0xb')][_0x2fd3be[_0xe184('0x2b')]]?this['voiceQueues'][_0x2fd3be[_0xe184('0x2b')]][_0xe184('0x2c')]||_0xe184('0x2d'):_0xe184('0x2d'),'variables':this[_0xe184('0xd')][_0x2fd3be[_0xe184('0x23')]],'motionChannel':_0xe184('0x2e')};}_[_0xe184('0x2f')](this['channels'][_0x2fd3be[_0xe184('0x23')]][_0x2fd3be[_0xe184('0x24')]],_[_0xe184('0x30')](_0x2fd3be,['event',_0xe184('0x31')]));logger[_0xe184('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x2fd3be[_0xe184('0x23')],util[_0xe184('0x27')](this[_0xe184('0xa')][_0x2fd3be['uniqueid']][_0x2fd3be[_0xe184('0x24')]],{'showHidden':![],'depth':null}));ami[_0xe184('0x1e')](_0xe184('0x32'),this[_0xe184('0xa')][_0x2fd3be[_0xe184('0x23')]][_0x2fd3be['destuniqueid']]);logger[_0xe184('0x25')](_0xe184('0x33'),_0x2fd3be[_0xe184('0x23')],util[_0xe184('0x27')](this['channels'][_0x2fd3be['uniqueid']][_0x2fd3be[_0xe184('0x24')]],{'showHidden':![],'depth':null}));this[_0xe184('0x1e')](util['format'](_0xe184('0x34'),_0x2fd3be['membername']),_0xe184('0x35'),this[_0xe184('0xa')][_0x2fd3be[_0xe184('0x23')]][_0x2fd3be[_0xe184('0x24')]]);}}catch(_0x46f80a){logger[_0xe184('0x36')]('[%s][voiceAgentReport][agentcalled]',_0x2fd3be['uniqueid'],util['inspect'](_0x46f80a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe184('0x10')]=function(_0x4647e9){try{if(this[_0xe184('0x21')](_0x4647e9)){if(this['channels'][_0x4647e9['uniqueid']]){logger[_0xe184('0x25')](_0xe184('0x37'),_0x4647e9[_0xe184('0x23')],util[_0xe184('0x27')](_0x4647e9,{'showHidden':![],'depth':null}));for(var _0x387608 in this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]]){if(this[_0xe184('0xa')][_0x4647e9['uniqueid']]['hasOwnProperty'](_0x387608)){if(_0x4647e9['destuniqueid']===_0x387608){logger[_0xe184('0x38')](_0xe184('0x39'),_0x4647e9[_0xe184('0x23')],_0x4647e9['membername'],_0x4647e9['destuniqueid']);this[_0xe184('0xa')][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x3a')]=moment()['format'](_0xe184('0x29'));this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608]['connectedlinename']=_0x4647e9[_0xe184('0x3b')];this['channels'][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x3c')]=_0x4647e9[_0xe184('0x3c')];this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x3d')]=_0x4647e9[_0xe184('0x3d')];this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x3e')]=_0x4647e9[_0xe184('0x3e')];this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x3f')]=_0x4647e9[_0xe184('0x3f')];this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x40')]=_0xe184('0x41');if(this[_0xe184('0x42')][this[_0xe184('0xa')][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x23')]]){var _0x2f9d4e=this['voiceChannels'][this[_0xe184('0xa')][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x23')]][_0xe184('0x43')];this[_0xe184('0xa')][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x43')]=_0x2f9d4e;_0x4647e9[_0xe184('0x43')]=_0x2f9d4e;}_['merge'](this['agents'][_0x4647e9[_0xe184('0x44')]],_[_0xe184('0x45')](_0x4647e9,[_0xe184('0x2b'),_0xe184('0x46'),_0xe184('0x43')]));logger['debug'](_0xe184('0x47'),_0x4647e9[_0xe184('0x23')],util['inspect'](this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x4647e9[_0xe184('0x24')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x4647e9['destuniqueid']]);logger['debug'](_0xe184('0x48'),_0x4647e9[_0xe184('0x23')],util[_0xe184('0x27')](this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x4647e9[_0xe184('0x24')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xe184('0x34'),_0x4647e9[_0xe184('0x49')]),_0xe184('0x4a'),this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x4647e9[_0xe184('0x24')]]);}else if(!this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608]['agentringnoanswer']&&!this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608]['agentcomplete']){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4647e9[_0xe184('0x23')],this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x49')],_0x387608);this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x12')]=!![];this['channels'][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x4b')]=moment()[_0xe184('0x28')](_0xe184('0x29'));this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x4c')]=_0x4647e9[_0xe184('0x24')];this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x4d')]=_0x4647e9[_0xe184('0x49')];this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608]['lastevent']='answered_elsewhere';this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x4e')]=_0xe184('0x4f');logger['debug'](_0xe184('0x50'),_0x4647e9['uniqueid'],util[_0xe184('0x27')](this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608],{'showHidden':![],'depth':null}));ami[_0xe184('0x1e')]('custom:agentansweredelsewhere',this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608]);}}}}}}catch(_0x3e80eb){logger[_0xe184('0x36')]('[%s][voiceAgentReport][agentconnect]',_0x4647e9[_0xe184('0x23')],util['inspect'](_0x3e80eb,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe184('0x51')]=function(_0x492a58){try{if(this[_0xe184('0x21')](_0x492a58)){logger['debug'](_0xe184('0x52'),_0x492a58[_0xe184('0x23')],util[_0xe184('0x27')](_0x492a58,{'showHidden':![],'depth':null}));if(this[_0xe184('0xa')][_0x492a58['uniqueid']]&&this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]]){logger[_0xe184('0x38')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x492a58[_0xe184('0x23')],_0x492a58[_0xe184('0x49')],_0x492a58[_0xe184('0x24')]);this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]]['agentringnoanswer']=!![];this['channels'][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]][_0xe184('0x4b')]=moment()[_0xe184('0x28')](_0xe184('0x29'));this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]][_0xe184('0x40')]=_0xe184('0x53');this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]][_0xe184('0x4e')]=_0xe184('0x53');logger[_0xe184('0x25')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x492a58['uniqueid'],util[_0xe184('0x27')](this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]],{'showHidden':![],'depth':null}));ami[_0xe184('0x1e')](_0xe184('0x54'),this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]]);}}}catch(_0x43926a){logger['error']('[%s][voiceAgentReport][agentringnoanswer]',_0x492a58[_0xe184('0x23')],util[_0xe184('0x27')](_0x43926a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x1446d9){try{if(this[_0xe184('0x21')](_0x1446d9)){logger[_0xe184('0x25')](_0xe184('0x55'),_0x1446d9[_0xe184('0x23')],util[_0xe184('0x27')](_0x1446d9,{'showHidden':![],'depth':null}));if(this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]]){for(var _0x53efe1 in this[_0xe184('0xa')][_0x1446d9['uniqueid']]){if(this['channels'][_0x1446d9['uniqueid']][_0xe184('0x56')](_0x53efe1)&&!this[_0xe184('0xa')][_0x1446d9['uniqueid']][_0x53efe1][_0xe184('0x12')]&&!this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1]['agentcomplete']){logger[_0xe184('0x38')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1446d9[_0xe184('0x23')],this['channels'][_0x1446d9['uniqueid']][_0x53efe1][_0xe184('0x49')],_0x53efe1);this['channels'][_0x1446d9[_0xe184('0x23')]][_0x53efe1][_0xe184('0x12')]=!![];this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1][_0xe184('0x4b')]=moment()['format'](_0xe184('0x29'));this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1][_0xe184('0x40')]=_0xe184('0x57');this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1][_0xe184('0x4e')]=_0xe184('0x57');logger[_0xe184('0x25')](_0xe184('0x58'),_0x1446d9[_0xe184('0x23')],util[_0xe184('0x27')](this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1],{'showHidden':![],'depth':null}));ami[_0xe184('0x1e')](_0xe184('0x59'),this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1]);}}}}}catch(_0x3a00b8){logger[_0xe184('0x36')](_0xe184('0x5a'),_0x1446d9[_0xe184('0x23')],util[_0xe184('0x27')](_0x3a00b8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe184('0x1d')][_0xe184('0x16')]=function(_0x4f5459){try{if(this[_0xe184('0x21')](_0x4f5459)){logger['debug'](_0xe184('0x5b'),_0x4f5459[_0xe184('0x23')],util[_0xe184('0x27')](_0x4f5459,{'showHidden':![],'depth':null}));if(this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]]){for(var _0xf0f650 in this[_0xe184('0xa')][_0x4f5459['uniqueid']]){if(this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xe184('0x56')](_0xf0f650)){if(this['channels'][_0x4f5459['uniqueid']][_0xf0f650][_0xe184('0x3a')]&&!this[_0xe184('0xa')][_0x4f5459['uniqueid']][_0xf0f650]['agentcomplete']){logger[_0xe184('0x38')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4f5459[_0xe184('0x23')],this['channels'][_0x4f5459[_0xe184('0x23')]][_0xf0f650][_0xe184('0x49')],_0xf0f650);this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650]['agentcomplete']=!![];this[_0xe184('0xa')][_0x4f5459['uniqueid']][_0xf0f650][_0xe184('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650][_0xe184('0x40')]=_0xe184('0x5d');this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650]['reason']=_0x4f5459[_0xe184('0x4e')]==_0xe184('0x5e')?'agent':_0x4f5459[_0xe184('0x4e')];this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650][_0xe184('0x5f')]=_0x4f5459['talktime'];if(this[_0xe184('0xb')][_0x4f5459[_0xe184('0x2b')]]&&this[_0xe184('0xb')][_0x4f5459[_0xe184('0x2b')]][_0xe184('0x60')]){this['channels'][_0x4f5459['uniqueid']][_0xf0f650][_0xe184('0x61')]=this['voiceQueues'][_0x4f5459[_0xe184('0x2b')]][_0xe184('0x62')];this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650]['agentacw']=!![];}this[_0xe184('0xc')][_0x4f5459[_0xe184('0x44')]]=_[_0xe184('0x30')](this[_0xe184('0xc')][_0x4f5459[_0xe184('0x44')]],['queue','destconnectedlinenum']);logger['debug'](_0xe184('0x63'),_0x4f5459[_0xe184('0x23')],util[_0xe184('0x27')](this[_0xe184('0xa')][_0x4f5459['uniqueid']][_0xf0f650],{'showHidden':![],'depth':null}));ami[_0xe184('0x1e')](_0xe184('0x64'),this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650]);logger['debug'](_0xe184('0x65'),_0x4f5459[_0xe184('0x23')],util['inspect'](this['channels'][_0x4f5459[_0xe184('0x23')]][_0xf0f650],{'showHidden':![],'depth':null}));this[_0xe184('0x1e')](util[_0xe184('0x28')]('user:%s',_0x4f5459[_0xe184('0x49')]),'user:agentcomplete',this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650]);}}}}}}catch(_0x5ef8c0){logger[_0xe184('0x36')](_0xe184('0x66'),_0x4f5459[_0xe184('0x23')],util[_0xe184('0x27')](_0x5ef8c0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncVarSet']=function(_0x27e55b){try{if(this[_0xe184('0x21')](_0x27e55b)){logger['debug'](_0xe184('0x67'),_0x27e55b[_0xe184('0x23')],util['inspect'](_0x27e55b,{'showHidden':![],'depth':null}));this[_0xe184('0x68')](_0x27e55b[_0xe184('0x23')],_[_0xe184('0x69')](_0x27e55b[_0xe184('0x6a')])[0x0],_0x27e55b[_0xe184('0x6b')]);if(this[_0xe184('0xa')][_0x27e55b[_0xe184('0x23')]]){for(var _0x5f22f6 in this[_0xe184('0xa')][_0x27e55b[_0xe184('0x23')]]){if(this['channels'][_0x27e55b[_0xe184('0x23')]][_0xe184('0x56')](_0x5f22f6)){logger[_0xe184('0x38')](_0xe184('0x6c'),_0x27e55b['uniqueid'],_0x5f22f6,_['keys'](_0x27e55b[_0xe184('0x6a')])[0x0],_0x27e55b[_0xe184('0x6b')]);if(_[_0xe184('0x1f')](this[_0xe184('0xa')][_0x27e55b[_0xe184('0x23')]][_0x5f22f6][_0xe184('0xd')])){this[_0xe184('0xa')][_0x27e55b[_0xe184('0x23')]][_0x5f22f6][_0xe184('0xd')]={};}this[_0xe184('0xa')][_0x27e55b[_0xe184('0x23')]][_0x5f22f6][_0xe184('0xd')]=this[_0xe184('0xd')][_0x27e55b['uniqueid']];}}}}}catch(_0x2b7e91){logger['error'](_0xe184('0x6d'),_0x27e55b[_0xe184('0x23')],util[_0xe184('0x27')](_0x2b7e91,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe184('0x68')]=function(_0x164d53,_0x472058,_0x7676a3){var _0x1583c4=['rtpaudioqos',_0xe184('0x6e'),'rtpaudioqosjitter',_0xe184('0x6f'),_0xe184('0x70'),_0xe184('0x71'),_0xe184('0x72'),_0xe184('0x73'),_0xe184('0x74'),_0xe184('0x75'),_0xe184('0x76'),_0xe184('0x77'),_0xe184('0x78'),_0xe184('0x79'),'memberinterface','memberlastcall',_0xe184('0x49'),'memberpenalty',_0xe184('0x7a')];if(!_[_0xe184('0x7b')](_0x472058)&&!_[_0xe184('0x7c')](_0x1583c4,_0x472058)){if(_['isUndefined'](this['variables'][_0x164d53])){this[_0xe184('0xd')][_0x164d53]={};}this[_0xe184('0xd')][_0x164d53][_0x472058]=_0x7676a3;}};VoiceAgentReport['prototype'][_0xe184('0x7d')]=function(_0x50110c){try{if(this[_0xe184('0x21')](_0x50110c)){logger['debug'](_0xe184('0x7e'),_0x50110c[_0xe184('0x23')],util[_0xe184('0x27')](_0x50110c,{'showHidden':![],'depth':null}));if(this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]]){for(var _0x3b0441 in this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]]){if(this['channels'][_0x50110c['uniqueid']]['hasOwnProperty'](_0x3b0441)){if(this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]][_0x3b0441][_0xe184('0x4e')]==_0xe184('0x5e')&&this['channels'][_0x50110c[_0xe184('0x23')]][_0x3b0441]['agentcomplete']){logger['info'](_0xe184('0x7f'),_0x50110c[_0xe184('0x23')],_0x3b0441);this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]][_0x3b0441][_0xe184('0x5c')]=moment()[_0xe184('0x28')](_0xe184('0x29'));}}}logger[_0xe184('0x25')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x50110c[_0xe184('0x23')],util['inspect'](_[_0xe184('0x80')](this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_['values'](this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]]));delete this[_0xe184('0xa')][_0x50110c['uniqueid']];}if(this[_0xe184('0xd')][_0x50110c['uniqueid']]){delete this[_0xe184('0xd')][_0x50110c['uniqueid']];}}}catch(_0x596864){logger['error'](_0xe184('0x81'),_0x50110c[_0xe184('0x23')],util[_0xe184('0x27')](_0x596864,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe184('0x1d')]['syncAttendedTransfer']=function(_0x25541f){try{if(this[_0xe184('0x21')](_0x25541f)){logger['debug']('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x25541f[_0xe184('0x23')],util[_0xe184('0x27')](_0x25541f,{'showHidden':![],'depth':null}));if(this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]]){for(var _0x123e53 in this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]]){if(this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]][_0xe184('0x56')](_0x123e53)){if(_0x25541f[_0xe184('0x83')]===_0x123e53){logger['info'](_0xe184('0x84'),_0x25541f[_0xe184('0x23')],this['channels'][_0x25541f[_0xe184('0x82')]][_0x123e53]['membername'],_0x123e53);var _0x2ba51b=moment();this['channels'][_0x25541f[_0xe184('0x82')]][_0x123e53][_0xe184('0x15')]=!![];this['channels'][_0x25541f[_0xe184('0x82')]][_0x123e53][_0xe184('0x5c')]=moment()[_0xe184('0x28')](_0xe184('0x29'));this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]][_0x123e53][_0xe184('0x40')]='complete';this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]][_0x123e53][_0xe184('0x4e')]='transfer';this[_0xe184('0xa')][_0x25541f['transfereeuniqueid']][_0x123e53]['talktime']=_0x2ba51b[_0xe184('0x85')](this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]][_0x123e53][_0xe184('0x3a')],_0xe184('0x86'));}}}}if(this[_0xe184('0xa')][_0x25541f[_0xe184('0x87')]]){var _0x4a9835=this[_0xe184('0xa')][_0x25541f[_0xe184('0x87')]];this['channels'][_0x25541f['secondtransfereruniqueid']]=this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]];this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]]=_0x4a9835;}}}catch(_0x1ff2a2){logger[_0xe184('0x36')](_0xe184('0x88'),_0x25541f[_0xe184('0x23')],util[_0xe184('0x27')](_0x1ff2a2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe184('0x1d')][_0xe184('0x1c')]=function(_0x8542f9){try{if(this['isNotNull'](_0x8542f9)){logger['debug'](_0xe184('0x89'),_0x8542f9['uniqueid'],util[_0xe184('0x27')](_0x8542f9,{'showHidden':![],'depth':null}));if(this['channels'][_0x8542f9[_0xe184('0x82')]]){for(var _0x2bedf9 in this[_0xe184('0xa')][_0x8542f9[_0xe184('0x82')]]){if(this[_0xe184('0xa')][_0x8542f9['transfereeuniqueid']][_0xe184('0x56')](_0x2bedf9)){if(_0x8542f9[_0xe184('0x8a')]===_0x2bedf9){logger['info'](_0xe184('0x8b'),_0x8542f9[_0xe184('0x23')],this['channels'][_0x8542f9['transfereeuniqueid']][_0x2bedf9]['membername'],_0x2bedf9);var _0x1b6147=moment();this[_0xe184('0xa')][_0x8542f9['transfereeuniqueid']][_0x2bedf9][_0xe184('0x15')]=!![];this[_0xe184('0xa')][_0x8542f9['transfereeuniqueid']][_0x2bedf9]['agentcompleteAt']=_0x1b6147;this[_0xe184('0xa')][_0x8542f9[_0xe184('0x82')]][_0x2bedf9][_0xe184('0x40')]=_0xe184('0x5d');this[_0xe184('0xa')][_0x8542f9[_0xe184('0x82')]][_0x2bedf9]['reason']=_0xe184('0x5e');this['channels'][_0x8542f9[_0xe184('0x82')]][_0x2bedf9][_0xe184('0x5f')]=_0x1b6147[_0xe184('0x85')](this[_0xe184('0xa')][_0x8542f9[_0xe184('0x82')]][_0x2bedf9][_0xe184('0x3a')],_0xe184('0x86'));}}}}}}catch(_0x5dfdda){logger[_0xe184('0x36')]('[%s][voiceAgentReport][blindtransfer]',_0x8542f9[_0xe184('0x23')],util[_0xe184('0x27')](_0x5dfdda,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe184('0x1d')]['syncMusicOnHoldStart']=function(_0x5b911c){var _0x365f0a='';try{if(this[_0xe184('0x21')](_0x5b911c)){logger[_0xe184('0x25')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x5b911c['uniqueid'],util[_0xe184('0x27')](_0x5b911c,{'showHidden':![],'depth':null}));if(_0x5b911c[_0xe184('0x8c')]){_0x365f0a=_0x5b911c[_0xe184('0x8c')][_0xe184('0x8d')](0x0,_0x5b911c['channel'][_0xe184('0x8e')]('-'));if(this['agents'][_0x365f0a]){logger['info'](_0xe184('0x8f'),_0x5b911c['uniqueid'],_0x365f0a);this['agents'][_0x365f0a][_0xe184('0x90')]=!![];}}}}catch(_0x439ace){logger[_0xe184('0x36')](_0xe184('0x91'),_0x5b911c[_0xe184('0x23')],util[_0xe184('0x27')](_0x439ace,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe184('0x19')]=function(_0x166009){var _0x2c0498='';try{if(this[_0xe184('0x21')](_0x166009)){logger['debug'](_0xe184('0x92'),_0x166009[_0xe184('0x23')],util['inspect'](_0x166009,{'showHidden':![],'depth':null}));if(_0x166009[_0xe184('0x8c')]){_0x2c0498=_0x166009[_0xe184('0x8c')][_0xe184('0x8d')](0x0,_0x166009['channel'][_0xe184('0x8e')]('-'));if(this[_0xe184('0xc')][_0x2c0498]){logger[_0xe184('0x38')](_0xe184('0x93'),_0x166009[_0xe184('0x23')],_0x2c0498);this['agents'][_0x2c0498][_0xe184('0x90')]=![];}}}}catch(_0x4dc09f){logger[_0xe184('0x36')](_0xe184('0x94'),_0x166009[_0xe184('0x23')],util[_0xe184('0x27')](_0x4dc09f,{'showHidden':![],'depth':null}));}};module[_0xe184('0x95')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 58cc7f4..6c663cf 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bff=['ringing','ringinuse','onhold','set','queue','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','redis','defaults','localhost','socket.io-emitter','channels','blindTransfers','coreshowchannel','syncNewExten','newexten','bind','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','emit','calleridname','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','isUndefined','merge','pick','keys','from-sip','agents','channel','split','exten','destconnectedlinenum','format','user:%s','name','user:agentconnect','connectedlinenum','[%s][voiceCallReport][newcallerid]','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','disposition','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','holdtime','diff','xcally-motion-preview','connectedlinename','destinationchannel','toNumber','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','.wav49','.WAV','monitorFilename','find','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','duration','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','type','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohstarttime','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','invalid','unavailable'];(function(_0x2352ba,_0x17df46){var _0x349bdb=function(_0x40dc92){while(--_0x40dc92){_0x2352ba['push'](_0x2352ba['shift']());}};_0x349bdb(++_0x17df46);}(_0x8bff,0xc8));var _0xf8bf=function(_0x39d24a,_0x5c0963){_0x39d24a=_0x39d24a-0x0;var _0x1eb6db=_0x8bff[_0x39d24a];return _0x1eb6db;};'use strict';var BPromise=require('bluebird');var _=require(_0xf8bf('0x0'));var moment=require(_0xf8bf('0x1'));var util=require(_0xf8bf('0x2'));var path=require(_0xf8bf('0x3'));var Redis=require(_0xf8bf('0x4'));var config=require(_0xf8bf('0x5'));var logger=require(_0xf8bf('0x6'))('ami');var ami=require(_0xf8bf('0x7'));var Channel=require(_0xf8bf('0x8'));var RpcSetting=require(_0xf8bf('0x9'));var statusDesc=[_0xf8bf('0xa'),_0xf8bf('0xb'),_0xf8bf('0xc'),'busy',_0xf8bf('0xd'),_0xf8bf('0xe'),_0xf8bf('0xf'),_0xf8bf('0x10'),_0xf8bf('0x11')];var applications=[_0xf8bf('0x12'),_0xf8bf('0x13'),'agi',_0xf8bf('0x14'),_0xf8bf('0x15'),_0xf8bf('0x16')];var dispositions=['NO\x20ANSWER',_0xf8bf('0x17'),_0xf8bf('0x17'),_0xf8bf('0x18'),_0xf8bf('0x18'),'NO\x20ANSWER',_0xf8bf('0x19'),'BUSY',_0xf8bf('0x17'),_0xf8bf('0x17'),'FAILED'];var actions={};config[_0xf8bf('0x1a')]=_[_0xf8bf('0x1b')](config[_0xf8bf('0x1a')],{'host':_0xf8bf('0x1c'),'port':0x18eb});var io=require(_0xf8bf('0x1d'))(new Redis(config[_0xf8bf('0x1a')]));function VoiceCallReport(_0x2fcc16){this[_0xf8bf('0x1e')]=_0x2fcc16['channels'];this['agents']=_0x2fcc16['agents'];this[_0xf8bf('0x1f')]={};ami['on'](_0xf8bf('0x20'),this[_0xf8bf('0x21')]['bind'](this));ami['on'](_0xf8bf('0x22'),this[_0xf8bf('0x21')][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x24'),this['syncNewChannel'][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x25'),this[_0xf8bf('0x26')][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x27'),this[_0xf8bf('0x28')][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x29'),this[_0xf8bf('0x2a')][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x2b'),this[_0xf8bf('0x2c')][_0xf8bf('0x23')](this));ami['on']('attendedtransfer',this[_0xf8bf('0x2d')][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x2e'),this['syncBlindTransfer'][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x2f'),this['syncMusicOnHoldStart'][_0xf8bf('0x23')](this));ami['on']('musiconholdstop',this[_0xf8bf('0x30')][_0xf8bf('0x23')](this));try{logger[_0xf8bf('0x31')](_0xf8bf('0x32'));ami[_0xf8bf('0x33')]();}catch(_0x238c37){logger[_0xf8bf('0x34')](_0xf8bf('0x35'),util[_0xf8bf('0x36')](_0x238c37,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x38')]=function(_0x4fdcb4){return _0x4fdcb4!==null&&!_['isUndefined'](_0x4fdcb4);};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x39')]=function(_0x3934d9,_0xc33f8d,_0xf0841c){io['to'](_0x3934d9)[_0xf8bf('0x39')](_0xc33f8d,_0xf0841c);};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x2c')]=function(_0x2cabe1){try{if(this[_0xf8bf('0x38')](_0x2cabe1)){logger[_0xf8bf('0x31')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x2cabe1['uniqueid'],_0x2cabe1[_0xf8bf('0x3a')],_0x2cabe1['calleridnum']);logger['debug'](_0xf8bf('0x3b'),_0x2cabe1[_0xf8bf('0x3c')],util['inspect'](_0x2cabe1,{'showHidden':![],'depth':null}));if(_0x2cabe1[_0xf8bf('0x3c')]===_0x2cabe1[_0xf8bf('0x3d')]){if(!_[_0xf8bf('0x3e')](this[_0xf8bf('0x1e')][_0x2cabe1[_0xf8bf('0x3c')]])){_[_0xf8bf('0x3f')](this[_0xf8bf('0x1e')][_0x2cabe1['uniqueid']],_[_0xf8bf('0x40')](_0x2cabe1,_[_0xf8bf('0x41')](this[_0xf8bf('0x1e')][_0x2cabe1[_0xf8bf('0x3c')]])));}}if(_0x2cabe1['context']===_0xf8bf('0x42')){if(this[_0xf8bf('0x43')][_0x2cabe1[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]){if(_0x2cabe1[_0xf8bf('0x46')]=='xcally-motion-preview'){this['agents'][_0x2cabe1[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x47')]=_0x2cabe1['connectedlinenum'];this[_0xf8bf('0x39')](util[_0xf8bf('0x48')](_0xf8bf('0x49'),this[_0xf8bf('0x43')][_0x2cabe1['channel'][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x4a')]),_0xf8bf('0x4b'),{'destaccountcode':this[_0xf8bf('0x43')][_0x2cabe1[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x2cabe1[_0xf8bf('0x4c')]});}}}}}catch(_0x51be97){logger['error'](_0xf8bf('0x4d'),_0x2cabe1[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x51be97,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x4e')]=function(_0x3daaa0){try{if(this[_0xf8bf('0x38')](_0x3daaa0)){logger[_0xf8bf('0x4f')](_0xf8bf('0x50'),_0x3daaa0[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x3daaa0,{'showHidden':![],'depth':null}));if(_0x3daaa0[_0xf8bf('0x3c')]===_0x3daaa0[_0xf8bf('0x3d')]&&_0x3daaa0[_0xf8bf('0x44')]!=_0xf8bf('0x51')){if(_['isUndefined'](this[_0xf8bf('0x1e')][_0x3daaa0[_0xf8bf('0x3c')]])){logger[_0xf8bf('0x31')](_0xf8bf('0x52'),_0x3daaa0[_0xf8bf('0x3c')],_0x3daaa0[_0xf8bf('0x53')],_0x3daaa0[_0xf8bf('0x46')]);this[_0xf8bf('0x1e')][_0x3daaa0[_0xf8bf('0x3c')]]=new Channel();this[_0xf8bf('0x1e')][_0x3daaa0[_0xf8bf('0x3c')]][_0xf8bf('0x54')]=moment()[_0xf8bf('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf8bf('0x1e')][_0x3daaa0['uniqueid']][_0xf8bf('0x55')]=dispositions[_['toNumber'](_0x3daaa0['channelstate'])];_[_0xf8bf('0x3f')](this[_0xf8bf('0x1e')][_0x3daaa0['uniqueid']],_[_0xf8bf('0x40')](_0x3daaa0,_[_0xf8bf('0x41')](this[_0xf8bf('0x1e')][_0x3daaa0[_0xf8bf('0x3c')]])));if(_0x3daaa0[_0xf8bf('0x53')]==='from-sip'){if(this[_0xf8bf('0x43')][_0x3daaa0[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]){if(_[_0xf8bf('0x3e')](this[_0xf8bf('0x43')][_0x3daaa0[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x47')])){this['agents'][_0x3daaa0[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x47')]=_0x3daaa0['exten'];logger[_0xf8bf('0x4f')](_0xf8bf('0x56'),_0x3daaa0['uniqueid'],util[_0xf8bf('0x36')]({'destaccountcode':this[_0xf8bf('0x43')][_0x3daaa0[_0xf8bf('0x44')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3daaa0[_0xf8bf('0x46')]},{'showHidden':![],'depth':null}));this[_0xf8bf('0x39')](util[_0xf8bf('0x48')](_0xf8bf('0x49'),this[_0xf8bf('0x43')][_0x3daaa0[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x4a')]),_0xf8bf('0x4b'),{'destaccountcode':this[_0xf8bf('0x43')][_0x3daaa0['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3daaa0[_0xf8bf('0x46')]});}}}}}}}catch(_0x1df571){logger[_0xf8bf('0x34')](_0xf8bf('0x57'),_0x3daaa0[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x1df571,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x21')]=function(_0x50a257){try{if(this['isNotNull'](_0x50a257)){logger[_0xf8bf('0x4f')](_0xf8bf('0x58'),_0x50a257[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x50a257,{'showHidden':![],'depth':null}));if(_0x50a257[_0xf8bf('0x3c')]===_0x50a257['linkedid']&&_0x50a257['exten']!='h'&&_0x50a257[_0xf8bf('0x44')]!=_0xf8bf('0x51')){_0x50a257[_0xf8bf('0x59')]=_0x50a257[_0xf8bf('0x59')][_0xf8bf('0x5a')]();_0x50a257[_0xf8bf('0x5b')]=_0x50a257[_0xf8bf('0x5c')]&&_0x50a257[_0xf8bf('0x5c')][_0xf8bf('0x5d')](_0xf8bf('0x5e'))?_0x50a257[_0xf8bf('0x5c')]:(_0x50a257[_0xf8bf('0x5c')]||_0x50a257[_0xf8bf('0x5b')])[_0xf8bf('0x5a')]();logger[_0xf8bf('0x31')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x50a257[_0xf8bf('0x3c')],_0x50a257[_0xf8bf('0x59')],_0x50a257[_0xf8bf('0x5b')]);if(_[_0xf8bf('0x3e')](this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]])){this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]]=new Channel();this[_0xf8bf('0x1e')][_0x50a257['uniqueid']][_0xf8bf('0x54')]=_0x50a257['duration']?moment()['subtract'](moment['duration'](_0x50a257['duration'])[_0xf8bf('0x5f')](),_0xf8bf('0x5f'))[_0xf8bf('0x48')](_0xf8bf('0x60')):moment()[_0xf8bf('0x48')](_0xf8bf('0x60'));this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]][_0xf8bf('0x55')]=_0xf8bf('0x18');}_[_0xf8bf('0x3f')](this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]],_[_0xf8bf('0x40')](_0x50a257,_[_0xf8bf('0x41')](this['channels'][_0x50a257[_0xf8bf('0x3c')]])));if(_[_0xf8bf('0x61')](applications,_0x50a257[_0xf8bf('0x59')])){this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]][_0xf8bf('0x62')]=_0x50a257[_0xf8bf('0x59')];this['channels'][_0x50a257['uniqueid']][_0xf8bf('0x63')]=_0x50a257[_0xf8bf('0x5b')];if(_0x50a257[_0xf8bf('0x59')]===_0xf8bf('0x12')&&_[_0xf8bf('0x5d')](_0x50a257[_0xf8bf('0x5b')][_0xf8bf('0x5a')](),'cdr(')){var _0x381bf0=_0x50a257['applicationdata'][_0xf8bf('0x45')]('=');var _0x1ebd29=_0x381bf0[0x0][_0xf8bf('0x5a')]()['match'](/cdr\((.*)\)/);if(_0x1ebd29){this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]][_0x1ebd29[0x1]]=_0x381bf0[0x1];}}else if(_0x50a257['application']===_0xf8bf('0x13')){this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]][_0xf8bf('0x13')]=_0x50a257[_0xf8bf('0x5b')][_0xf8bf('0x45')](',')[0x0];}}}}}catch(_0x671a1f){logger[_0xf8bf('0x34')]('[%s][voiceCallReport][newexten]',_0x50a257[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x671a1f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x26')]=function(_0x217a92){try{if(this['isNotNull'](_0x217a92)){logger[_0xf8bf('0x31')](_0xf8bf('0x64'),_0x217a92['uniqueid'],_0x217a92['linkedid'],_0x217a92[_0xf8bf('0x3a')],_0x217a92[_0xf8bf('0x65')]);logger[_0xf8bf('0x4f')](_0xf8bf('0x66'),_0x217a92[_0xf8bf('0x3c')],util['inspect'](_0x217a92,{'showHidden':![],'depth':null}));if(_0x217a92['uniqueid']!==_0x217a92[_0xf8bf('0x3d')]){if(this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]]){if(_0x217a92[_0xf8bf('0x67')]==='6'){if(!this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]]['answered']){var _0x436436=moment();this[_0xf8bf('0x1e')][_0x217a92['linkedid']][_0xf8bf('0x68')]=!![];this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]]['answertime']=_0x436436[_0xf8bf('0x48')](_0xf8bf('0x60'));if(this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x54')]){this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x69')]=_0x436436[_0xf8bf('0x6a')](this['channels'][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x54')],_0xf8bf('0x5f'));}}this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x3d')]=_0x217a92['uniqueid'];if(_0x217a92[_0xf8bf('0x65')]!==_0xf8bf('0x6b')){this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x4c')]=_0x217a92[_0xf8bf('0x65')];}this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x6c')]=_0x217a92['calleridname'];this['channels'][_0x217a92['linkedid']][_0xf8bf('0x6d')]=_0x217a92['channel'];this['channels'][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x55')]=dispositions[_[_0xf8bf('0x6e')](_0x217a92['channelstate'])];if(this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]){this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x6f')]=this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')]['split']('-')[0x0]]['id'];this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x70')]=this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')]['split']('-')[0x0]][_0xf8bf('0x4a')];}}}}else{if(this[_0xf8bf('0x1e')][_0x217a92['uniqueid']]){if(_0x217a92['channelstate']==='6'){if(this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]){this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3c')]][_0xf8bf('0x6f')]=this[_0xf8bf('0x43')][_0x217a92['channel'][_0xf8bf('0x45')]('-')[0x0]]['id'];this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3c')]]['membername']=this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]['name'];}}}}if(_0x217a92['channelstate']==='6'&&_0x217a92['context']==='from-sip'){if(this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]){this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x47')]=_0x217a92[_0xf8bf('0x46')];var _0x9601e4;if(this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3c')]])_0x9601e4=this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3c')]][_0xf8bf('0x71')];else if(this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]])_0x9601e4=this[_0xf8bf('0x1e')][_0x217a92['linkedid']][_0xf8bf('0x71')];logger[_0xf8bf('0x4f')](_0xf8bf('0x72'),_0x217a92[_0xf8bf('0x3c')],util[_0xf8bf('0x36')]({'destaccountcode':this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x73')],'destconnectedlinenum':_0x217a92[_0xf8bf('0x46')],'routealias':_0x9601e4},{'showHidden':![],'depth':null}));this['emit'](util[_0xf8bf('0x48')](_0xf8bf('0x49'),this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x4a')]),_0xf8bf('0x4b'),{'destaccountcode':this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x73')],'destconnectedlinenum':_0x217a92[_0xf8bf('0x46')],'routealias':_0x9601e4});}}}}catch(_0x7cc228){logger['error'](_0xf8bf('0x74'),_0x217a92[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x7cc228,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x75')]=function(_0x59cbff,_0x98daac){try{if(this[_0xf8bf('0x1e')][_0x59cbff]){logger[_0xf8bf('0x31')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x59cbff,_0x98daac);this['channels'][_0x59cbff][_0xf8bf('0x76')]=!![];if(_[_0xf8bf('0x77')](_0x98daac,_0xf8bf('0x78'))){_0x98daac=_0x98daac['replace']('.wav49',_0xf8bf('0x79'));}this['channels'][_0x59cbff][_0xf8bf('0x7a')]=_0x98daac;var _0x33b3c4=_[_0xf8bf('0x7b')](this[_0xf8bf('0x1e')][_0x59cbff][_0xf8bf('0x7c')],{'filename':_0x98daac});if(_[_0xf8bf('0x7d')](_0x33b3c4)){this['channels'][_0x59cbff][_0xf8bf('0x7c')]['push']({'filename':_0x98daac,'createdAt':moment()['format'](_0xf8bf('0x60')),'mixmonitorid':'','status':_0xf8bf('0x7e')});}}}catch(_0x51a0b5){logger[_0xf8bf('0x34')](_0xf8bf('0x7f'),_0x59cbff,util['inspect'](_0x51a0b5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf8bf('0x28')]=function(_0x29d8a2){try{if(this['isNotNull'](_0x29d8a2)){logger[_0xf8bf('0x4f')](_0xf8bf('0x80'),_0x29d8a2[_0xf8bf('0x3c')],util['inspect'](_0x29d8a2,{'showHidden':![],'depth':null}));if(this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]]&&_0x29d8a2[_0xf8bf('0x44')]!=_0xf8bf('0x51')){if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')])){if(this['isNotNull'](_0x29d8a2['variable'][_0xf8bf('0x82')])){logger['info'](_0xf8bf('0x83'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x75')](_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);}else if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')][_0xf8bf('0x85')])){logger[_0xf8bf('0x31')](_0xf8bf('0x86'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]]['calleridnum']=_0x29d8a2['value'];}else if(this['isNotNull'](_0x29d8a2['variable'][_0xf8bf('0x87')])){logger[_0xf8bf('0x31')](_0xf8bf('0x88'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2['uniqueid']][_0xf8bf('0x89')]=_0x29d8a2[_0xf8bf('0x84')];}else if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')][_0xf8bf('0x8a')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x29d8a2['uniqueid'],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]]['type']=_0x29d8a2[_0xf8bf('0x84')];}else if(this[_0xf8bf('0x38')](_0x29d8a2['variable'][_0xf8bf('0x8b')])){logger[_0xf8bf('0x31')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')][_0xf8bf('0x45')](',')[0x0]);this['channels'][_0x29d8a2['uniqueid']]['queue']=_0x29d8a2[_0xf8bf('0x84')][_0xf8bf('0x45')](',')[0x0];}else if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')]['xmd-originatecalleridnum'])){logger['info'](_0xf8bf('0x8c'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2['value']);this['channels'][_0x29d8a2[_0xf8bf('0x3c')]][_0xf8bf('0x8d')]=_0x29d8a2[_0xf8bf('0x84')];}else if(this[_0xf8bf('0x38')](_0x29d8a2['variable'][_0xf8bf('0x8e')])){logger[_0xf8bf('0x31')](_0xf8bf('0x8f'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]][_0xf8bf('0x90')]=_0x29d8a2[_0xf8bf('0x84')];}else if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')][_0xf8bf('0x91')])){logger[_0xf8bf('0x31')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2['value']);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]][_0xf8bf('0x92')]=_0x29d8a2[_0xf8bf('0x84')];}else if(this['isNotNull'](_0x29d8a2[_0xf8bf('0x81')][_0xf8bf('0x93')])){logger[_0xf8bf('0x31')](_0xf8bf('0x94'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2['uniqueid']]['queue']=_0x29d8a2[_0xf8bf('0x84')];}else if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')][_0xf8bf('0x95')])){logger[_0xf8bf('0x31')](_0xf8bf('0x96'),_0x29d8a2['uniqueid'],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]][_0xf8bf('0x97')]=_0x29d8a2['value'];}}}else if(this[_0xf8bf('0x38')](_0x29d8a2['variable'][_0xf8bf('0x82')])){if(_0x29d8a2[_0xf8bf('0x84')]){var _0x2efbe3=path[_0xf8bf('0x98')](_0x29d8a2['value'])[_0xf8bf('0x4a')];logger[_0xf8bf('0x31')](_0xf8bf('0x83'),_0x2efbe3,_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x75')](_0x2efbe3,_0x29d8a2['value']);}}else if(this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3d')]]){if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')])){if(this[_0xf8bf('0x38')](_0x29d8a2['variable'][_0xf8bf('0x95')])){logger[_0xf8bf('0x31')](_0xf8bf('0x96'),_0x29d8a2['linkedid'],_0x29d8a2['value']);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3d')]][_0xf8bf('0x99')]=_0x29d8a2['value'];}}}}}catch(_0x2c5ffa){logger['error'](_0xf8bf('0x9a'),_0x29d8a2[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x2c5ffa,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x2a')]=function(_0x3de85c){try{if(this[_0xf8bf('0x38')](_0x3de85c)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x3de85c[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x3de85c,{'showHidden':![],'depth':null}));if(this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]]){logger[_0xf8bf('0x31')](_0xf8bf('0x9b'),_0x3de85c['uniqueid'],_0x3de85c[_0xf8bf('0x9c')]);var _0x30ec06=moment();this[_0xf8bf('0x1e')][_0x3de85c['uniqueid']][_0xf8bf('0x9d')]=_0x30ec06[_0xf8bf('0x48')](_0xf8bf('0x60'));this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]]['duration']=_0x30ec06[_0xf8bf('0x6a')](this['channels'][_0x3de85c['uniqueid']][_0xf8bf('0x54')],_0xf8bf('0x5f'));if(this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x68')]){this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x9e')]=_0x30ec06[_0xf8bf('0x6a')](this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]]['answertime'],_0xf8bf('0x5f'));this['channels'][_0x3de85c['uniqueid']][_0xf8bf('0x69')]=this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x9f')]-this[_0xf8bf('0x1e')][_0x3de85c['uniqueid']]['billableseconds'];}if(_0x3de85c[_0xf8bf('0x53')]===_0xf8bf('0x42')){if(this[_0xf8bf('0x43')][_0x3de85c['channel'][_0xf8bf('0x45')]('-')[0x0]]){this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]=_[_0xf8bf('0xa0')](this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]],[_0xf8bf('0x47')]);logger[_0xf8bf('0x4f')](_0xf8bf('0xa1'),_0x3de85c[_0xf8bf('0x3c')],util[_0xf8bf('0x36')]({'id':this[_0xf8bf('0x43')][_0x3de85c['channel'][_0xf8bf('0x45')]('-')[0x0]]['id'],'destaccountcode':this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0xf8bf('0x48')](_0xf8bf('0x49'),this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x4a')]),_0xf8bf('0xa2'),{'id':this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]['id'],'destaccountcode':this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x73')]});}}var _0x25c794=this;Promise[_0xf8bf('0xa3')]()[_0xf8bf('0xa4')](function(){var _0x2053af=_0x25c794['channels'][_0x3de85c[_0xf8bf('0x3c')]];if(typeof _0x2053af[_0xf8bf('0xa5')]===_0xf8bf('0xa6'))return;if(_[_0xf8bf('0xa7')](_0x2053af[_0xf8bf('0x7c')]))return;return RpcSetting[_0xf8bf('0xa8')]()['then'](function(_0x2661d8){if(!_0x2661d8[_0xf8bf('0xa9')])return;return Promise[_0xf8bf('0xa3')]()['then'](function(){return ami[_0xf8bf('0xaa')]({'action':_0xf8bf('0xab'),'channel':_0x2053af[_0xf8bf('0x44')]})['catch'](function(){});})[_0xf8bf('0xa4')](function(){return ami[_0xf8bf('0xaa')]({'action':_0xf8bf('0xab'),'channel':_0x2053af[_0xf8bf('0x6d')]})[_0xf8bf('0xac')](function(){})[_0xf8bf('0xad')](function(){var _0x39ad0b=_0x25c794[_0xf8bf('0x43')][_0x2053af[_0xf8bf('0x6d')][_0xf8bf('0x45')]('-')[0x0]];if(!_0x39ad0b)return;io[_0xf8bf('0x39')](_0xf8bf('0xae'),{'agentId':_0x39ad0b['id'],'uniqueid':_0x2053af[_0xf8bf('0x3c')]});});});});})[_0xf8bf('0xa4')](function(){if(_0x3de85c[_0xf8bf('0xaf')]===_0xf8bf('0xb0')){_0x25c794[_0xf8bf('0x1f')][_0x3de85c[_0xf8bf('0x3c')]]=_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]];}else{if(_0x25c794['channels'][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0xb1')]==='outbound'&&_0x25c794[_0xf8bf('0x1f')][_0x3de85c[_0xf8bf('0x3c')]]){_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x3c')]=[_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x3d')],_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x3d')]=_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x3c')]][0x0];delete _0x25c794[_0xf8bf('0x1f')][_0x3de85c[_0xf8bf('0x3c')]];}}logger[_0xf8bf('0x4f')](_0xf8bf('0xb2'),_0x3de85c['uniqueid'],util[_0xf8bf('0x36')](_0x25c794['channels'][_0x3de85c['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xf8bf('0xb3'),_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]]);delete _0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]];});}}}catch(_0x4b94ba){logger[_0xf8bf('0x34')](_0xf8bf('0xb4'),_0x3de85c[_0xf8bf('0x3c')],util['inspect'](_0x4b94ba,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x2d')]=function(_0x46123f){try{if(this[_0xf8bf('0x38')](_0x46123f)){logger['info'](_0xf8bf('0xb5'),_0x46123f[_0xf8bf('0x3c')],_0x46123f[_0xf8bf('0xb6')],_0x46123f['transfertargetcalleridnum']);logger[_0xf8bf('0x4f')](_0xf8bf('0xb7'),_0x46123f['uniqueid'],util[_0xf8bf('0x36')](_0x46123f,{'showHidden':![],'depth':null}));if(this['channels'][_0x46123f[_0xf8bf('0xb8')]]){this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xb8')]]['transfercalleridnum']=_0x46123f['origtransferercalleridnum'];this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xb8')]]['transferconnectedlinenum']=_0x46123f[_0xf8bf('0xb9')];if(this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xba')]]){var _0x297e48=this[_0xf8bf('0x1e')][_0x46123f['secondtransfereruniqueid']];this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xba')]]=this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xb8')]];this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xb8')]]=_0x297e48;}}else if(this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbb')]]){this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbb')]][_0xf8bf('0xbc')]=_0x46123f[_0xf8bf('0xb6')];this['channels'][_0x46123f[_0xf8bf('0xbb')]][_0xf8bf('0xbd')]=_0x46123f[_0xf8bf('0xb9')];if(this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbe')]]){var _0x297e48=this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbe')]];this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbe')]]=this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbb')]];this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbb')]]=_0x297e48;}}if((this[_0xf8bf('0x1e')][_0x46123f['origtransfereruniqueid']]||this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbf')]])&&this['channels'][_0x46123f[_0xf8bf('0xba')]]){var _0x1f42d9=_[_0xf8bf('0xc0')]([this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbe')]],this[_0xf8bf('0x1e')][_0x46123f['origtransfererlinkedid']],this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xba')]]],function(_0x523c08){return _0x523c08&&_0x523c08['type']==='outbound'&&_0x523c08[_0xf8bf('0xc1')];});if(_0x1f42d9){if(this[_0xf8bf('0x1e')][_0x46123f['origtransfereruniqueid']])this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbe')]]['transferType']=_0xf8bf('0xc2');if(this[_0xf8bf('0x1e')][_0x46123f['origtransfererlinkedid']])this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbf')]][_0xf8bf('0xa5')]=_0xf8bf('0xc2');this['channels'][_0x46123f['secondtransfereruniqueid']][_0xf8bf('0xa5')]=_0xf8bf('0xc2');}}}}catch(_0x81814c){logger[_0xf8bf('0x34')](_0xf8bf('0xc3'),_0x46123f[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x81814c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf8bf('0xc4')]=function(_0x246a7e){try{if(this['isNotNull'](_0x246a7e)){logger['info'](_0xf8bf('0xc5'),_0x246a7e['uniqueid'],_0x246a7e[_0xf8bf('0xc6')],_0x246a7e[_0xf8bf('0xc7')]);logger[_0xf8bf('0x4f')](_0xf8bf('0xc8'),_0x246a7e[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x246a7e,{'showHidden':![],'depth':null}));if(this[_0xf8bf('0x1e')][_0x246a7e[_0xf8bf('0xb8')]]){this[_0xf8bf('0x1e')][_0x246a7e[_0xf8bf('0xb8')]]['transfercalleridnum']=_0x246a7e[_0xf8bf('0xc6')];this[_0xf8bf('0x1e')][_0x246a7e[_0xf8bf('0xb8')]][_0xf8bf('0xbd')]=_0x246a7e[_0xf8bf('0xc7')];this[_0xf8bf('0x1e')][_0x246a7e[_0xf8bf('0xb8')]][_0xf8bf('0xa5')]=_0xf8bf('0xc9');this[_0xf8bf('0x2a')]({'event':_0xf8bf('0xb0'),'uniqueid':_0x246a7e['transfereeuniqueid'],'context':_0x246a7e[_0xf8bf('0x53')],'channel':_0x246a7e[_0xf8bf('0xca')]});}else{this[_0xf8bf('0x1e')][_0x246a7e[_0xf8bf('0xcb')]][_0xf8bf('0xa5')]=_0xf8bf('0xc9');}}}catch(_0x4b8d97){logger[_0xf8bf('0x34')](_0xf8bf('0xcc'),_0x246a7e[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x4b8d97,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')]['syncMusicOnHoldStart']=function(_0xc10871){try{if(this[_0xf8bf('0x38')](_0xc10871)){logger[_0xf8bf('0x4f')](_0xf8bf('0xcd'),_0xc10871[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0xc10871,{'showHidden':![],'depth':null}));if(this[_0xf8bf('0x1e')][_0xc10871[_0xf8bf('0x3c')]]){if(!_[_0xf8bf('0x7d')](this[_0xf8bf('0x1e')][_0xc10871['uniqueid']]['answertime'])){this[_0xf8bf('0x1e')][_0xc10871[_0xf8bf('0x3c')]]['mohstarttime']=moment()['format'](_0xf8bf('0x60'));logger[_0xf8bf('0x31')](_0xf8bf('0xce'),_0xc10871[_0xf8bf('0x3c')],this[_0xf8bf('0x1e')][_0xc10871['uniqueid']]['mohstarttime']);}}}}catch(_0x5d7591){logger[_0xf8bf('0x34')](_0xf8bf('0xcf'),_0xc10871[_0xf8bf('0x3c')],util['inspect'](_0x5d7591,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')]['syncMusicOnHoldStop']=function(_0x5e82fd){try{if(this[_0xf8bf('0x38')](_0x5e82fd)){logger[_0xf8bf('0x4f')](_0xf8bf('0xd0'),_0x5e82fd[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x5e82fd,{'showHidden':![],'depth':null}));if(this['channels'][_0x5e82fd['uniqueid']]){if(!_[_0xf8bf('0x7d')](this['channels'][_0x5e82fd['uniqueid']][_0xf8bf('0xd1')])){this[_0xf8bf('0x1e')][_0x5e82fd[_0xf8bf('0x3c')]][_0xf8bf('0xd2')]+=moment()[_0xf8bf('0xd3')](0x0)[_0xf8bf('0x6a')](this[_0xf8bf('0x1e')][_0x5e82fd[_0xf8bf('0x3c')]]['mohstarttime'],_0xf8bf('0x5f'));logger[_0xf8bf('0x31')](_0xf8bf('0xd4'),_0x5e82fd['uniqueid'],this['channels'][_0x5e82fd[_0xf8bf('0x3c')]][_0xf8bf('0xd2')]);delete this[_0xf8bf('0x1e')][_0x5e82fd[_0xf8bf('0x3c')]]['mohstarttime'];}}}}catch(_0x43d9b6){logger[_0xf8bf('0x34')](_0xf8bf('0xd5'),_0x5e82fd[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x43d9b6,{'showHidden':![],'depth':null}));}};module[_0xf8bf('0xd6')]=VoiceCallReport; \ No newline at end of file +var _0xe5c9=['stopRecordingOnTransfer','Action','StopMixMonitor','catch','then','finally','webbar:stopmonitors','event','BlindTransfer','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','outbound','routeid','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfercalleridnum','transfereecalleridnum','BLIND','transfererchannel','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','bluebird','lodash','moment','path','../../../config/environment','../../../config/logger','ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','set','queue','agi','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','newexten','bind','newchannel','varset','syncVarSet','syncHangup','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','keys','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','format','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','error','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','pick','includes','lastapplication','lastdata','cdr(','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','holdtime','diff','destinationchannel','UserId','membername','routealias','user:%s','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','isNil','monitors','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','answertime','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','undefined','isEmpty','getSettings'];(function(_0x139805,_0x545173){var _0x517318=function(_0x506c5d){while(--_0x506c5d){_0x139805['push'](_0x139805['shift']());}};_0x517318(++_0x545173);}(_0xe5c9,0x1be));var _0x9e5c=function(_0x10da54,_0x4d9107){_0x10da54=_0x10da54-0x0;var _0x508202=_0xe5c9[_0x10da54];return _0x508202;};'use strict';var BPromise=require(_0x9e5c('0x0'));var _=require(_0x9e5c('0x1'));var moment=require(_0x9e5c('0x2'));var util=require('util');var path=require(_0x9e5c('0x3'));var Redis=require('ioredis');var config=require(_0x9e5c('0x4'));var logger=require(_0x9e5c('0x5'))(_0x9e5c('0x6'));var ami=require('../ami');var Channel=require(_0x9e5c('0x7'));var RpcSetting=require(_0x9e5c('0x8'));var statusDesc=[_0x9e5c('0x9'),_0x9e5c('0xa'),_0x9e5c('0xb'),_0x9e5c('0xc'),_0x9e5c('0xd'),_0x9e5c('0xe'),_0x9e5c('0xf'),_0x9e5c('0x10'),'onhold'];var applications=[_0x9e5c('0x11'),_0x9e5c('0x12'),_0x9e5c('0x13'),'dial',_0x9e5c('0x14'),_0x9e5c('0x15')];var dispositions=['NO\x20ANSWER',_0x9e5c('0x16'),_0x9e5c('0x16'),_0x9e5c('0x17'),_0x9e5c('0x17'),_0x9e5c('0x17'),_0x9e5c('0x18'),_0x9e5c('0x19'),'FAILED','FAILED','FAILED'];var actions={};config[_0x9e5c('0x1a')]=_[_0x9e5c('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9e5c('0x1c'))(new Redis(config['redis']));function VoiceCallReport(_0x94de3b){this[_0x9e5c('0x1d')]=_0x94de3b['channels'];this[_0x9e5c('0x1e')]=_0x94de3b[_0x9e5c('0x1e')];this[_0x9e5c('0x1f')]={};ami['on'](_0x9e5c('0x20'),this[_0x9e5c('0x21')]['bind'](this));ami['on'](_0x9e5c('0x22'),this['syncNewExten'][_0x9e5c('0x23')](this));ami['on'](_0x9e5c('0x24'),this['syncNewChannel'][_0x9e5c('0x23')](this));ami['on']('newstate',this['syncNewState'][_0x9e5c('0x23')](this));ami['on'](_0x9e5c('0x25'),this[_0x9e5c('0x26')]['bind'](this));ami['on']('hangup',this[_0x9e5c('0x27')][_0x9e5c('0x23')](this));ami['on']('newcallerid',this[_0x9e5c('0x28')]['bind'](this));ami['on'](_0x9e5c('0x29'),this['syncAttendedTransfer'][_0x9e5c('0x23')](this));ami['on'](_0x9e5c('0x2a'),this[_0x9e5c('0x2b')][_0x9e5c('0x23')](this));ami['on'](_0x9e5c('0x2c'),this['syncMusicOnHoldStart'][_0x9e5c('0x23')](this));ami['on'](_0x9e5c('0x2d'),this[_0x9e5c('0x2e')][_0x9e5c('0x23')](this));try{logger[_0x9e5c('0x2f')](_0x9e5c('0x30'));ami[_0x9e5c('0x31')]();}catch(_0xae0ddd){logger['error'](_0x9e5c('0x32'),util[_0x9e5c('0x33')](_0xae0ddd,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9e5c('0x34')][_0x9e5c('0x35')]=function(_0x22caad){return _0x22caad!==null&&!_[_0x9e5c('0x36')](_0x22caad);};VoiceCallReport[_0x9e5c('0x34')][_0x9e5c('0x37')]=function(_0x1d522d,_0x439aef,_0x3568cb){io['to'](_0x1d522d)[_0x9e5c('0x37')](_0x439aef,_0x3568cb);};VoiceCallReport['prototype'][_0x9e5c('0x28')]=function(_0x14715a){try{if(this['isNotNull'](_0x14715a)){logger['info'](_0x9e5c('0x38'),_0x14715a[_0x9e5c('0x39')],_0x14715a[_0x9e5c('0x3a')],_0x14715a[_0x9e5c('0x3b')]);logger[_0x9e5c('0x3c')](_0x9e5c('0x3d'),_0x14715a[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x14715a,{'showHidden':![],'depth':null}));if(_0x14715a[_0x9e5c('0x39')]===_0x14715a['linkedid']){if(!_['isUndefined'](this[_0x9e5c('0x1d')][_0x14715a['uniqueid']])){_[_0x9e5c('0x3e')](this[_0x9e5c('0x1d')][_0x14715a[_0x9e5c('0x39')]],_['pick'](_0x14715a,_[_0x9e5c('0x3f')](this[_0x9e5c('0x1d')][_0x14715a[_0x9e5c('0x39')]])));}}if(_0x14715a['context']===_0x9e5c('0x40')){if(this[_0x9e5c('0x1e')][_0x14715a[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]){if(_0x14715a[_0x9e5c('0x43')]==_0x9e5c('0x44')){this[_0x9e5c('0x1e')][_0x14715a['channel'][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x45')]=_0x14715a['connectedlinenum'];this['emit'](util[_0x9e5c('0x46')]('user:%s',this[_0x9e5c('0x1e')][_0x14715a['channel'][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x47')]),_0x9e5c('0x48'),{'destaccountcode':this['agents'][_0x14715a[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x49')],'destconnectedlinenum':_0x14715a['connectedlinenum']});}}}}}catch(_0x236d01){logger['error'](_0x9e5c('0x4a'),_0x14715a[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x236d01,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e5c('0x4b')]=function(_0x3f71ac){try{if(this[_0x9e5c('0x35')](_0x3f71ac)){logger['debug'](_0x9e5c('0x4c'),_0x3f71ac[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x3f71ac,{'showHidden':![],'depth':null}));if(_0x3f71ac['uniqueid']===_0x3f71ac[_0x9e5c('0x4d')]&&_0x3f71ac[_0x9e5c('0x41')]!=_0x9e5c('0x4e')){if(_[_0x9e5c('0x36')](this[_0x9e5c('0x1d')][_0x3f71ac['uniqueid']])){logger[_0x9e5c('0x2f')](_0x9e5c('0x4f'),_0x3f71ac[_0x9e5c('0x39')],_0x3f71ac[_0x9e5c('0x50')],_0x3f71ac['exten']);this[_0x9e5c('0x1d')][_0x3f71ac[_0x9e5c('0x39')]]=new Channel();this[_0x9e5c('0x1d')][_0x3f71ac['uniqueid']][_0x9e5c('0x51')]=moment()['format'](_0x9e5c('0x52'));this[_0x9e5c('0x1d')][_0x3f71ac[_0x9e5c('0x39')]][_0x9e5c('0x53')]=dispositions[_[_0x9e5c('0x54')](_0x3f71ac['channelstate'])];_[_0x9e5c('0x3e')](this[_0x9e5c('0x1d')][_0x3f71ac[_0x9e5c('0x39')]],_['pick'](_0x3f71ac,_[_0x9e5c('0x3f')](this[_0x9e5c('0x1d')][_0x3f71ac[_0x9e5c('0x39')]])));if(_0x3f71ac[_0x9e5c('0x50')]===_0x9e5c('0x40')){if(this[_0x9e5c('0x1e')][_0x3f71ac['channel'][_0x9e5c('0x42')]('-')[0x0]]){if(_[_0x9e5c('0x36')](this[_0x9e5c('0x1e')][_0x3f71ac[_0x9e5c('0x41')]['split']('-')[0x0]][_0x9e5c('0x45')])){this['agents'][_0x3f71ac[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x45')]=_0x3f71ac[_0x9e5c('0x43')];logger[_0x9e5c('0x3c')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x3f71ac[_0x9e5c('0x39')],util[_0x9e5c('0x33')]({'destaccountcode':this['agents'][_0x3f71ac[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x49')],'destconnectedlinenum':_0x3f71ac[_0x9e5c('0x43')]},{'showHidden':![],'depth':null}));this[_0x9e5c('0x37')](util[_0x9e5c('0x46')]('user:%s',this[_0x9e5c('0x1e')][_0x3f71ac[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x47')]),_0x9e5c('0x48'),{'destaccountcode':this[_0x9e5c('0x1e')][_0x3f71ac[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3f71ac[_0x9e5c('0x43')]});}}}}}}}catch(_0x2b7f30){logger[_0x9e5c('0x55')]('[%s][voiceCallReport][newchannel]',_0x3f71ac[_0x9e5c('0x39')],util['inspect'](_0x2b7f30,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')]['syncNewExten']=function(_0x400c63){try{if(this['isNotNull'](_0x400c63)){logger[_0x9e5c('0x3c')](_0x9e5c('0x56'),_0x400c63[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x400c63,{'showHidden':![],'depth':null}));if(_0x400c63[_0x9e5c('0x39')]===_0x400c63[_0x9e5c('0x4d')]&&_0x400c63[_0x9e5c('0x43')]!='h'&&_0x400c63[_0x9e5c('0x41')]!='OutgoingSpoolFailed'){_0x400c63[_0x9e5c('0x57')]=_0x400c63['application'][_0x9e5c('0x58')]();_0x400c63['applicationdata']=_0x400c63[_0x9e5c('0x59')]&&_0x400c63[_0x9e5c('0x59')][_0x9e5c('0x5a')]('CDR(routeAlias)')?_0x400c63[_0x9e5c('0x59')]:(_0x400c63[_0x9e5c('0x59')]||_0x400c63[_0x9e5c('0x5b')])[_0x9e5c('0x58')]();logger[_0x9e5c('0x2f')](_0x9e5c('0x5c'),_0x400c63[_0x9e5c('0x39')],_0x400c63['application'],_0x400c63['applicationdata']);if(_['isUndefined'](this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]])){this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]]=new Channel();this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]][_0x9e5c('0x51')]=_0x400c63[_0x9e5c('0x5d')]?moment()[_0x9e5c('0x5e')](moment['duration'](_0x400c63[_0x9e5c('0x5d')])[_0x9e5c('0x5f')](),'seconds')[_0x9e5c('0x46')](_0x9e5c('0x52')):moment()['format'](_0x9e5c('0x52'));this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]][_0x9e5c('0x53')]='NO\x20ANSWER';}_['merge'](this['channels'][_0x400c63[_0x9e5c('0x39')]],_[_0x9e5c('0x60')](_0x400c63,_[_0x9e5c('0x3f')](this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]])));if(_[_0x9e5c('0x61')](applications,_0x400c63[_0x9e5c('0x57')])){this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]][_0x9e5c('0x62')]=_0x400c63[_0x9e5c('0x57')];this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]][_0x9e5c('0x63')]=_0x400c63[_0x9e5c('0x5b')];if(_0x400c63[_0x9e5c('0x57')]===_0x9e5c('0x11')&&_[_0x9e5c('0x5a')](_0x400c63[_0x9e5c('0x5b')][_0x9e5c('0x58')](),_0x9e5c('0x64'))){var _0x549720=_0x400c63['applicationdata'][_0x9e5c('0x42')]('=');var _0x414cb5=_0x549720[0x0][_0x9e5c('0x58')]()['match'](/cdr\((.*)\)/);if(_0x414cb5){this['channels'][_0x400c63[_0x9e5c('0x39')]][_0x414cb5[0x1]]=_0x549720[0x1];}}else if(_0x400c63['application']==='queue'){this[_0x9e5c('0x1d')][_0x400c63['uniqueid']]['queue']=_0x400c63[_0x9e5c('0x5b')][_0x9e5c('0x42')](',')[0x0];}}}}}catch(_0x449001){logger[_0x9e5c('0x55')](_0x9e5c('0x65'),_0x400c63[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x449001,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e5c('0x66')]=function(_0x40d88e){try{if(this['isNotNull'](_0x40d88e)){logger[_0x9e5c('0x2f')](_0x9e5c('0x67'),_0x40d88e[_0x9e5c('0x39')],_0x40d88e[_0x9e5c('0x4d')],_0x40d88e[_0x9e5c('0x3a')],_0x40d88e[_0x9e5c('0x3b')]);logger[_0x9e5c('0x3c')](_0x9e5c('0x68'),_0x40d88e[_0x9e5c('0x39')],util['inspect'](_0x40d88e,{'showHidden':![],'depth':null}));if(_0x40d88e[_0x9e5c('0x39')]!==_0x40d88e['linkedid']){if(this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]]){if(_0x40d88e[_0x9e5c('0x69')]==='6'){if(!this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x6a')]){var _0x4f836b=moment();this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x6a')]=!![];this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]]['answertime']=_0x4f836b[_0x9e5c('0x46')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x51')]){this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x6b')]=_0x4f836b[_0x9e5c('0x6c')](this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x51')],_0x9e5c('0x5f'));}}this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x4d')]=_0x40d88e[_0x9e5c('0x39')];if(_0x40d88e[_0x9e5c('0x3b')]!==_0x9e5c('0x44')){this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]]['connectedlinenum']=_0x40d88e[_0x9e5c('0x3b')];}this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]]['connectedlinename']=_0x40d88e[_0x9e5c('0x3a')];this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x6d')]=_0x40d88e[_0x9e5c('0x41')];this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x53')]=dispositions[_[_0x9e5c('0x54')](_0x40d88e[_0x9e5c('0x69')])];if(this[_0x9e5c('0x1e')][_0x40d88e['channel'][_0x9e5c('0x42')]('-')[0x0]]){this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x6e')]=this[_0x9e5c('0x1e')][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['id'];this[_0x9e5c('0x1d')][_0x40d88e['linkedid']][_0x9e5c('0x6f')]=this[_0x9e5c('0x1e')][_0x40d88e['channel'][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x47')];}}}}else{if(this[_0x9e5c('0x1d')][_0x40d88e['uniqueid']]){if(_0x40d88e['channelstate']==='6'){if(this[_0x9e5c('0x1e')][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]){this[_0x9e5c('0x1d')][_0x40d88e['uniqueid']]['UserId']=this[_0x9e5c('0x1e')][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['id'];this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x39')]][_0x9e5c('0x6f')]=this['agents'][_0x40d88e['channel'][_0x9e5c('0x42')]('-')[0x0]]['name'];}}}}if(_0x40d88e['channelstate']==='6'&&_0x40d88e[_0x9e5c('0x50')]===_0x9e5c('0x40')){if(this[_0x9e5c('0x1e')][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]){this['agents'][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x45')]=_0x40d88e['exten'];var _0x3eed33;if(this[_0x9e5c('0x1d')][_0x40d88e['uniqueid']])_0x3eed33=this[_0x9e5c('0x1d')][_0x40d88e['uniqueid']]['routealias'];else if(this['channels'][_0x40d88e[_0x9e5c('0x4d')]])_0x3eed33=this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x70')];logger[_0x9e5c('0x3c')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x40d88e['uniqueid'],util[_0x9e5c('0x33')]({'destaccountcode':this['agents'][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x40d88e[_0x9e5c('0x43')],'routealias':_0x3eed33},{'showHidden':![],'depth':null}));this[_0x9e5c('0x37')](util[_0x9e5c('0x46')](_0x9e5c('0x71'),this['agents'][_0x40d88e['channel'][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x47')]),'user:agentconnect',{'destaccountcode':this[_0x9e5c('0x1e')][_0x40d88e['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x40d88e[_0x9e5c('0x43')],'routealias':_0x3eed33});}}}}catch(_0x4d32cb){logger[_0x9e5c('0x55')](_0x9e5c('0x72'),_0x40d88e[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x4d32cb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')][_0x9e5c('0x73')]=function(_0x53d0cf,_0x491888){try{if(this[_0x9e5c('0x1d')][_0x53d0cf]){logger[_0x9e5c('0x2f')](_0x9e5c('0x74'),_0x53d0cf,_0x491888);this[_0x9e5c('0x1d')][_0x53d0cf][_0x9e5c('0x75')]=!![];if(_[_0x9e5c('0x76')](_0x491888,_0x9e5c('0x77'))){_0x491888=_0x491888[_0x9e5c('0x78')](_0x9e5c('0x77'),_0x9e5c('0x79'));}this[_0x9e5c('0x1d')][_0x53d0cf][_0x9e5c('0x7a')]=_0x491888;var _0x48f123=_['find'](this[_0x9e5c('0x1d')][_0x53d0cf]['monitors'],{'filename':_0x491888});if(_[_0x9e5c('0x7b')](_0x48f123)){this[_0x9e5c('0x1d')][_0x53d0cf][_0x9e5c('0x7c')][_0x9e5c('0x7d')]({'filename':_0x491888,'createdAt':moment()[_0x9e5c('0x46')](_0x9e5c('0x52')),'mixmonitorid':'','status':_0x9e5c('0x7e')});}}}catch(_0x414c42){logger[_0x9e5c('0x55')]('[%s][voiceCallReport][mixMonitorFilename]',_0x53d0cf,util[_0x9e5c('0x33')](_0x414c42,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')]['syncVarSet']=function(_0x1d034f){try{if(this['isNotNull'](_0x1d034f)){logger[_0x9e5c('0x3c')](_0x9e5c('0x7f'),_0x1d034f[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x1d034f,{'showHidden':![],'depth':null}));if(this[_0x9e5c('0x1d')][_0x1d034f['uniqueid']]&&_0x1d034f[_0x9e5c('0x41')]!=_0x9e5c('0x4e')){if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')])){if(this[_0x9e5c('0x35')](_0x1d034f['variable'][_0x9e5c('0x81')])){logger['info'](_0x9e5c('0x82'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f['value']);this[_0x9e5c('0x73')](_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);}else if(this[_0x9e5c('0x35')](_0x1d034f['variable'][_0x9e5c('0x84')])){logger[_0x9e5c('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);this[_0x9e5c('0x1d')][_0x1d034f['uniqueid']][_0x9e5c('0x3b')]=_0x1d034f['value'];}else if(this['isNotNull'](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x85')])){logger[_0x9e5c('0x2f')](_0x9e5c('0x86'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);this[_0x9e5c('0x1d')][_0x1d034f[_0x9e5c('0x39')]][_0x9e5c('0x87')]=_0x1d034f['value'];}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x88')])){logger[_0x9e5c('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x1d034f[_0x9e5c('0x39')],_0x1d034f['value']);this['channels'][_0x1d034f[_0x9e5c('0x39')]][_0x9e5c('0x89')]=_0x1d034f['value'];}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x8a')])){logger[_0x9e5c('0x2f')](_0x9e5c('0x8b'),_0x1d034f['uniqueid'],_0x1d034f[_0x9e5c('0x83')][_0x9e5c('0x42')](',')[0x0]);this['channels'][_0x1d034f[_0x9e5c('0x39')]]['queue']=_0x1d034f['value'][_0x9e5c('0x42')](',')[0x0];}else if(this[_0x9e5c('0x35')](_0x1d034f['variable'][_0x9e5c('0x8c')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1d034f[_0x9e5c('0x39')],_0x1d034f['value']);this['channels'][_0x1d034f[_0x9e5c('0x39')]][_0x9e5c('0x8d')]=_0x1d034f[_0x9e5c('0x83')];}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x8e')])){logger[_0x9e5c('0x2f')](_0x9e5c('0x8f'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);this['channels'][_0x1d034f['uniqueid']][_0x9e5c('0x90')]=_0x1d034f[_0x9e5c('0x83')];}else if(this['isNotNull'](_0x1d034f['variable'][_0x9e5c('0x91')])){logger[_0x9e5c('0x2f')](_0x9e5c('0x92'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);this['channels'][_0x1d034f[_0x9e5c('0x39')]][_0x9e5c('0x93')]=_0x1d034f['value'];}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')]['xmcs-queue'])){logger[_0x9e5c('0x2f')](_0x9e5c('0x94'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f['value']);this[_0x9e5c('0x1d')][_0x1d034f[_0x9e5c('0x39')]][_0x9e5c('0x12')]=_0x1d034f['value'];}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x95')])){logger[_0x9e5c('0x2f')](_0x9e5c('0x96'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);this[_0x9e5c('0x1d')][_0x1d034f[_0x9e5c('0x39')]]['sipcalluniqueid']=_0x1d034f['value'];}}}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x81')])){if(_0x1d034f[_0x9e5c('0x83')]){var _0x10db6e=path['parse'](_0x1d034f[_0x9e5c('0x83')])[_0x9e5c('0x47')];logger['info'](_0x9e5c('0x82'),_0x10db6e,_0x1d034f[_0x9e5c('0x83')]);this[_0x9e5c('0x73')](_0x10db6e,_0x1d034f[_0x9e5c('0x83')]);}}else if(this[_0x9e5c('0x1d')][_0x1d034f['linkedid']]){if(this['isNotNull'](_0x1d034f['variable'])){if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x95')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1d034f[_0x9e5c('0x4d')],_0x1d034f[_0x9e5c('0x83')]);this['channels'][_0x1d034f[_0x9e5c('0x4d')]][_0x9e5c('0x97')]=_0x1d034f[_0x9e5c('0x83')];}}}}}catch(_0xcc4d36){logger[_0x9e5c('0x55')]('[%s][voiceCallReport][varset]',_0x1d034f['uniqueid'],util[_0x9e5c('0x33')](_0xcc4d36,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')]['syncHangup']=function(_0x4e55cf){try{if(this[_0x9e5c('0x35')](_0x4e55cf)){logger['debug'](_0x9e5c('0x98'),_0x4e55cf[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x4e55cf,{'showHidden':![],'depth':null}));if(this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]]){logger[_0x9e5c('0x2f')](_0x9e5c('0x99'),_0x4e55cf[_0x9e5c('0x39')],_0x4e55cf[_0x9e5c('0x9a')]);var _0x1b7258=moment();this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x9b')]=_0x1b7258[_0x9e5c('0x46')](_0x9e5c('0x52'));this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]]['duration']=_0x1b7258[_0x9e5c('0x6c')](this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x51')],'seconds');if(this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x6a')]){this['channels'][_0x4e55cf[_0x9e5c('0x39')]]['billableseconds']=_0x1b7258[_0x9e5c('0x6c')](this[_0x9e5c('0x1d')][_0x4e55cf['uniqueid']][_0x9e5c('0x9c')],_0x9e5c('0x5f'));this[_0x9e5c('0x1d')][_0x4e55cf['uniqueid']][_0x9e5c('0x6b')]=this['channels'][_0x4e55cf['uniqueid']][_0x9e5c('0x5d')]-this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]]['billableseconds'];}if(_0x4e55cf[_0x9e5c('0x50')]===_0x9e5c('0x40')){if(this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]){this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]=_['omit'](this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')]['split']('-')[0x0]],[_0x9e5c('0x45')]);logger[_0x9e5c('0x3c')](_0x9e5c('0x9d'),_0x4e55cf['uniqueid'],util[_0x9e5c('0x33')]({'id':this['agents'][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x49')]},{'showHidden':![],'depth':null}));this[_0x9e5c('0x37')](util[_0x9e5c('0x46')](_0x9e5c('0x71'),this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x47')]),_0x9e5c('0x9e'),{'id':this[_0x9e5c('0x1e')][_0x4e55cf['channel'][_0x9e5c('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['accountcode']});}}var _0x1c9b6c=this;Promise[_0x9e5c('0x9f')]()['then'](function(){var _0x144b78=_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]];if(typeof _0x144b78['transferType']===_0x9e5c('0xa0'))return;if(_[_0x9e5c('0xa1')](_0x144b78[_0x9e5c('0x7c')]))return;return RpcSetting[_0x9e5c('0xa2')]()['then'](function(_0x45c65c){if(!_0x45c65c[_0x9e5c('0xa3')])return;return Promise['resolve']()['then'](function(){return ami[_0x9e5c('0xa4')]({'action':_0x9e5c('0xa5'),'channel':_0x144b78[_0x9e5c('0x41')]})[_0x9e5c('0xa6')](function(){});})[_0x9e5c('0xa7')](function(){return ami[_0x9e5c('0xa4')]({'action':'StopMixMonitor','channel':_0x144b78[_0x9e5c('0x6d')]})[_0x9e5c('0xa6')](function(){})[_0x9e5c('0xa8')](function(){var _0x5489e6=_0x1c9b6c[_0x9e5c('0x1e')][_0x144b78[_0x9e5c('0x6d')][_0x9e5c('0x42')]('-')[0x0]];if(!_0x5489e6)return;io['emit'](_0x9e5c('0xa9'),{'agentId':_0x5489e6['id'],'uniqueid':_0x144b78[_0x9e5c('0x39')]});});});});})['then'](function(){if(_0x4e55cf[_0x9e5c('0xaa')]===_0x9e5c('0xab')){_0x1c9b6c[_0x9e5c('0x1f')][_0x4e55cf[_0x9e5c('0x39')]]=_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]];}else{if(_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x89')]==='outbound'&&_0x1c9b6c[_0x9e5c('0x1f')][_0x4e55cf[_0x9e5c('0x39')]]){_0x1c9b6c['channels'][_0x4e55cf[_0x9e5c('0x39')]]['uniqueid']=[_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x4d')],_0x1c9b6c['channels'][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x4d')]=_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]]['uniqueid']][0x0];delete _0x1c9b6c[_0x9e5c('0x1f')][_0x4e55cf['uniqueid']];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x4e55cf['uniqueid'],util[_0x9e5c('0x33')](_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]],{'showHidden':![],'depth':null}));ami['emit'](_0x9e5c('0xac'),_0x1c9b6c['channels'][_0x4e55cf[_0x9e5c('0x39')]]);delete _0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]];});}}}catch(_0x1dfaa0){logger[_0x9e5c('0x55')](_0x9e5c('0xad'),_0x4e55cf[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x1dfaa0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')][_0x9e5c('0xae')]=function(_0x2ae864){try{if(this[_0x9e5c('0x35')](_0x2ae864)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x2ae864[_0x9e5c('0x39')],_0x2ae864[_0x9e5c('0xaf')],_0x2ae864[_0x9e5c('0xb0')]);logger[_0x9e5c('0x3c')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x2ae864[_0x9e5c('0x39')],util['inspect'](_0x2ae864,{'showHidden':![],'depth':null}));if(this['channels'][_0x2ae864['transfereeuniqueid']]){this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb1')]]['transfercalleridnum']=_0x2ae864[_0x9e5c('0xaf')];this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb1')]][_0x9e5c('0xb2')]=_0x2ae864[_0x9e5c('0xb0')];if(this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb3')]]){var _0x187f9f=this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb3')]];this['channels'][_0x2ae864[_0x9e5c('0xb3')]]=this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb1')]];this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb1')]]=_0x187f9f;}}else if(this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb4')]]){this[_0x9e5c('0x1d')][_0x2ae864['transfertargetuniqueid']]['transfercalleridnum']=_0x2ae864[_0x9e5c('0xaf')];this['channels'][_0x2ae864[_0x9e5c('0xb4')]][_0x9e5c('0xb2')]=_0x2ae864[_0x9e5c('0xb0')];if(this[_0x9e5c('0x1d')][_0x2ae864['origtransfereruniqueid']]){var _0x187f9f=this[_0x9e5c('0x1d')][_0x2ae864['origtransfereruniqueid']];this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb5')]]=this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb4')]];this[_0x9e5c('0x1d')][_0x2ae864['transfertargetuniqueid']]=_0x187f9f;}}if((this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb5')]]||this[_0x9e5c('0x1d')][_0x2ae864['origtransfererlinkedid']])&&this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb3')]]){var _0x3ba594=_[_0x9e5c('0xb6')]([this[_0x9e5c('0x1d')][_0x2ae864['origtransfereruniqueid']],this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb7')]],this[_0x9e5c('0x1d')][_0x2ae864['secondtransfereruniqueid']]],function(_0x3133d2){return _0x3133d2&&_0x3133d2[_0x9e5c('0x89')]===_0x9e5c('0xb8')&&_0x3133d2[_0x9e5c('0xb9')];});if(_0x3ba594){if(this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb5')]])this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb5')]][_0x9e5c('0xba')]=_0x9e5c('0xbb');if(this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb7')]])this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb7')]][_0x9e5c('0xba')]='ATTENDED';this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb3')]][_0x9e5c('0xba')]=_0x9e5c('0xbb');}}}}catch(_0x3243de){logger['error'](_0x9e5c('0xbc'),_0x2ae864[_0x9e5c('0x39')],util['inspect'](_0x3243de,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e5c('0x2b')]=function(_0x1280f8){try{if(this[_0x9e5c('0x35')](_0x1280f8)){logger[_0x9e5c('0x2f')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x1280f8[_0x9e5c('0x39')],_0x1280f8['transfereecalleridnum'],_0x1280f8[_0x9e5c('0xbd')]);logger[_0x9e5c('0x3c')](_0x9e5c('0xbe'),_0x1280f8[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x1280f8,{'showHidden':![],'depth':null}));if(this[_0x9e5c('0x1d')][_0x1280f8[_0x9e5c('0xb1')]]){this['channels'][_0x1280f8['transfereeuniqueid']][_0x9e5c('0xbf')]=_0x1280f8[_0x9e5c('0xc0')];this['channels'][_0x1280f8[_0x9e5c('0xb1')]][_0x9e5c('0xb2')]=_0x1280f8[_0x9e5c('0xbd')];this[_0x9e5c('0x1d')][_0x1280f8[_0x9e5c('0xb1')]][_0x9e5c('0xba')]=_0x9e5c('0xc1');this[_0x9e5c('0x27')]({'event':_0x9e5c('0xab'),'uniqueid':_0x1280f8['transfereeuniqueid'],'context':_0x1280f8[_0x9e5c('0x50')],'channel':_0x1280f8[_0x9e5c('0xc2')]});}else{this[_0x9e5c('0x1d')][_0x1280f8['transfereruniqueid']]['transferType']=_0x9e5c('0xc1');}}}catch(_0x2411ea){logger[_0x9e5c('0x55')]('[%s][voiceCallReport][blindtransfer]',_0x1280f8[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x2411ea,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e5c('0xc3')]=function(_0x309044){try{if(this[_0x9e5c('0x35')](_0x309044)){logger[_0x9e5c('0x3c')](_0x9e5c('0xc4'),_0x309044[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x309044,{'showHidden':![],'depth':null}));if(this[_0x9e5c('0x1d')][_0x309044[_0x9e5c('0x39')]]){if(!_[_0x9e5c('0x7b')](this['channels'][_0x309044[_0x9e5c('0x39')]][_0x9e5c('0x9c')])){this['channels'][_0x309044[_0x9e5c('0x39')]][_0x9e5c('0xc5')]=moment()[_0x9e5c('0x46')](_0x9e5c('0x52'));logger[_0x9e5c('0x2f')](_0x9e5c('0xc6'),_0x309044[_0x9e5c('0x39')],this['channels'][_0x309044[_0x9e5c('0x39')]]['mohstarttime']);}}}}catch(_0x5cfc1f){logger[_0x9e5c('0x55')](_0x9e5c('0xc7'),_0x309044['uniqueid'],util['inspect'](_0x5cfc1f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')]['syncMusicOnHoldStop']=function(_0x58894b){try{if(this[_0x9e5c('0x35')](_0x58894b)){logger[_0x9e5c('0x3c')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x58894b[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x58894b,{'showHidden':![],'depth':null}));if(this[_0x9e5c('0x1d')][_0x58894b[_0x9e5c('0x39')]]){if(!_[_0x9e5c('0x7b')](this[_0x9e5c('0x1d')][_0x58894b[_0x9e5c('0x39')]][_0x9e5c('0xc5')])){this[_0x9e5c('0x1d')][_0x58894b[_0x9e5c('0x39')]][_0x9e5c('0xc8')]+=moment()[_0x9e5c('0xc9')](0x0)[_0x9e5c('0x6c')](this['channels'][_0x58894b[_0x9e5c('0x39')]]['mohstarttime'],'seconds');logger[_0x9e5c('0x2f')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x58894b['uniqueid'],this[_0x9e5c('0x1d')][_0x58894b[_0x9e5c('0x39')]]['mohtime']);delete this['channels'][_0x58894b['uniqueid']]['mohstarttime'];}}}}catch(_0x590f15){logger['error'](_0x9e5c('0xca'),_0x58894b['uniqueid'],util[_0x9e5c('0x33')](_0x590f15,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 6008814..0a29366 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81f4=['[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','toLowerCase','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','exports','util','ioredis','ami','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','syncNewExten','hangup','prototype','isNotNull','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','info','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','applications','voice:outbound','voice_outbound_channel:save','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]','addVariable','keys','variable','value','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','error','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','isUndefined','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','seconds','answertime','answered','holdtime','starttime','billableseconds','sumHoldTime','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x81f4,0x16b));var _0x481f=function(_0x495054,_0x41ad4c){_0x495054=_0x495054-0x0;var _0x5776e4=_0x81f4[_0x495054];return _0x5776e4;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x481f('0x0'));var Redis=require(_0x481f('0x1'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x481f('0x2'));var ami=require(_0x481f('0x3'));config[_0x481f('0x4')]=_[_0x481f('0x5')](config['redis'],{'host':_0x481f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x481f('0x4')]));function VoiceDialReport(_0x22d302){this[_0x481f('0x7')]=_0x22d302[_0x481f('0x8')];this[_0x481f('0x9')]=_0x22d302[_0x481f('0x9')];this['applications']={};this['variables']={};ami['on'](_0x481f('0xa'),this[_0x481f('0xb')][_0x481f('0xc')](this));ami['on'](_0x481f('0xd'),this[_0x481f('0xe')][_0x481f('0xc')](this));ami['on']('varset',this[_0x481f('0xf')][_0x481f('0xc')](this));ami['on']('newexten',this[_0x481f('0x10')][_0x481f('0xc')](this));ami['on'](_0x481f('0x11'),this['syncHangup'][_0x481f('0xc')](this));}VoiceDialReport[_0x481f('0x12')][_0x481f('0x13')]=function(_0x32b3df){return _0x32b3df!==null&&!_['isUndefined'](_0x32b3df);};VoiceDialReport['prototype'][_0x481f('0x14')]=function(_0x159a7b,_0x5a5b2e,_0x4f28d7){io['to'](_0x159a7b)[_0x481f('0x14')](_0x5a5b2e,_0x4f28d7);};VoiceDialReport[_0x481f('0x12')][_0x481f('0xb')]=function(_0x1277f9){try{if(this['isNotNull'](_0x1277f9)){logger['debug'](_0x481f('0x15'),_0x1277f9[_0x481f('0x16')],util[_0x481f('0x17')](_0x1277f9,{'showHidden':![],'depth':null}));if(this[_0x481f('0x7')][_0x1277f9[_0x481f('0x16')]]){_[_0x481f('0x18')](this['channels'][_0x1277f9['uniqueid']],{'starttime':moment()[_0x481f('0x19')](_0x481f('0x1a')),'lastevent':_0x481f('0x1b'),'interface':_0x1277f9[_0x481f('0x1c')][_0x481f('0x1d')](0x0,_0x1277f9[_0x481f('0x1c')][_0x481f('0x1e')]('-')),'membername':_0x1277f9[_0x481f('0x1c')][_0x481f('0x1d')](_0x1277f9[_0x481f('0x1c')][_0x481f('0x1e')]('/')+0x1,_0x1277f9['channel']['lastIndexOf']('-'))},_[_0x481f('0x1f')](_0x1277f9,[_0x481f('0x20'),_0x481f('0x21')]));logger[_0x481f('0x22')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x1277f9[_0x481f('0x16')],this['channels'][_0x1277f9['uniqueid']]['membername'],this[_0x481f('0x7')][_0x1277f9['uniqueid']][_0x481f('0x23')]);logger['debug'](_0x481f('0x24'),_0x1277f9[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x1277f9[_0x481f('0x16')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x1277f9[_0x481f('0x16')]])_[_0x481f('0x18')](this['channels'][_0x1277f9[_0x481f('0x16')]],this[_0x481f('0x25')][_0x1277f9[_0x481f('0x16')]]);this['emit'](_0x481f('0x26'),_0x481f('0x27'),this[_0x481f('0x7')][_0x1277f9[_0x481f('0x16')]]);logger[_0x481f('0x28')](_0x481f('0x29'),_0x1277f9[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x1277f9['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x481f('0x14')]('custom:dialbegin',this[_0x481f('0x7')][_0x1277f9[_0x481f('0x16')]]);}}}catch(_0x72615e){logger['error'](_0x481f('0x2a'),_0x1277f9[_0x481f('0x16')],util['inspect'](_0x72615e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481f('0x12')]['syncDialEnd']=function(_0x3c786a){try{if(this['isNotNull'](_0x3c786a)){logger[_0x481f('0x28')](_0x481f('0x2b'),_0x3c786a['uniqueid'],util[_0x481f('0x17')](_0x3c786a,{'showHidden':![],'depth':null}));if(this['channels'][_0x3c786a['uniqueid']]){this['channels'][_0x3c786a[_0x481f('0x16')]][_0x481f('0x2c')]=_0x3c786a[_0x481f('0x2c')];if(_0x3c786a['dialstatus']==='ANSWER'){this['channels'][_0x3c786a[_0x481f('0x16')]]['connectedlinenum']=_0x3c786a[_0x481f('0x2d')];this[_0x481f('0x7')][_0x3c786a[_0x481f('0x16')]][_0x481f('0x2e')]=_0x3c786a[_0x481f('0x2e')];this[_0x481f('0x7')][_0x3c786a[_0x481f('0x16')]]['answertime']=moment()[_0x481f('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3c786a['uniqueid']][_0x481f('0x2f')]='connect';logger[_0x481f('0x22')](_0x481f('0x30'),_0x3c786a[_0x481f('0x16')],_0x3c786a[_0x481f('0x1c')]['substring'](_0x3c786a['channel'][_0x481f('0x1e')]('/')+0x1,_0x3c786a[_0x481f('0x1c')][_0x481f('0x1e')]('-')));logger[_0x481f('0x28')](_0x481f('0x31'),_0x3c786a[_0x481f('0x16')],util['inspect'](this[_0x481f('0x7')][_0x3c786a[_0x481f('0x16')]],{'showHidden':![],'depth':null}));ami[_0x481f('0x14')]('custom:dialconnect',this[_0x481f('0x7')][_0x3c786a[_0x481f('0x16')]]);}logger[_0x481f('0x28')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x3c786a['uniqueid'],util[_0x481f('0x17')](this['channels'][_0x3c786a[_0x481f('0x16')]],{'showHidden':![],'depth':null}));this[_0x481f('0x14')](_0x481f('0x26'),_0x481f('0x27'),this[_0x481f('0x7')][_0x3c786a[_0x481f('0x16')]]);}}}catch(_0x3a7dc7){logger['error'](_0x481f('0x32'),_0x3c786a[_0x481f('0x16')],util[_0x481f('0x17')](_0x3a7dc7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481f('0x12')][_0x481f('0xf')]=function(_0x2edd20){try{if(this[_0x481f('0x13')](_0x2edd20)){logger['debug']('[%s][voiceDialReport][varset]\x20event:',_0x2edd20[_0x481f('0x16')],util[_0x481f('0x17')](_0x2edd20,{'showHidden':![],'depth':null}));this[_0x481f('0x33')](_0x2edd20[_0x481f('0x16')],_[_0x481f('0x34')](_0x2edd20[_0x481f('0x35')])[0x0],_0x2edd20[_0x481f('0x36')]);if(this[_0x481f('0x13')](_0x2edd20[_0x481f('0x35')])&&this[_0x481f('0x13')](_0x2edd20[_0x481f('0x35')]['outboundrouteid'])){if(_['isUndefined'](this['channels'][_0x2edd20['uniqueid']])){this[_0x481f('0x7')][_0x2edd20[_0x481f('0x16')]]={'routeId':_0x2edd20[_0x481f('0x36')],'variables':this[_0x481f('0x37')][_0x2edd20[_0x481f('0x16')]]};logger['info'](_0x481f('0x38'),_0x2edd20['uniqueid'],_0x2edd20[_0x481f('0x35')][_0x481f('0x39')],_['keys'](_0x2edd20['variable'])[0x0],_0x2edd20[_0x481f('0x36')]);logger[_0x481f('0x28')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2edd20[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x2edd20[_0x481f('0x16')]],{'showHidden':![],'depth':null}));this[_0x481f('0x14')]('voice:outbound',_0x481f('0x27'),this[_0x481f('0x7')][_0x2edd20[_0x481f('0x16')]]);}}}}catch(_0x1f20c7){logger[_0x481f('0x3a')](_0x481f('0x3b'),_0x2edd20[_0x481f('0x16')],util[_0x481f('0x17')](_0x1f20c7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481f('0x12')]['addVariable']=function(_0x22307b,_0x3a0781,_0xee62a2){var _0x2a7a8e=['rtpaudioqos',_0x481f('0x3c'),_0x481f('0x3d'),'rtpaudioqosjitterbridged',_0x481f('0x3e'),_0x481f('0x3f'),_0x481f('0x40'),_0x481f('0x41'),_0x481f('0x42'),_0x481f('0x43'),_0x481f('0x44'),_0x481f('0x45'),_0x481f('0x46'),'memberdynamic','memberinterface',_0x481f('0x47'),_0x481f('0x48'),_0x481f('0x49'),_0x481f('0x4a')];if(!_[_0x481f('0x4b')](_0x3a0781)&&!_[_0x481f('0x4c')](_0x2a7a8e,_0x3a0781)){if(_[_0x481f('0x4d')](this[_0x481f('0x37')][_0x22307b])){this[_0x481f('0x37')][_0x22307b]={};}this[_0x481f('0x37')][_0x22307b][_0x3a0781]=_0xee62a2;}};VoiceDialReport[_0x481f('0x12')]['syncHangup']=function(_0x561d7d){try{if(this['isNotNull'](_0x561d7d)){logger[_0x481f('0x28')](_0x481f('0x4e'),_0x561d7d[_0x481f('0x16')],util[_0x481f('0x17')](_0x561d7d,{'showHidden':![],'depth':null}));if(this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]]){logger['info'](_0x481f('0x4f'),_0x561d7d[_0x481f('0x16')],_0x561d7d[_0x481f('0x50')]);this[_0x481f('0x7')][_0x561d7d['uniqueid']][_0x481f('0x51')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x52')]=moment(this['channels'][_0x561d7d[_0x481f('0x16')]][_0x481f('0x51')])[_0x481f('0x53')](this[_0x481f('0x7')][_0x561d7d['uniqueid']]['starttime'],_0x481f('0x54'));this['channels'][_0x561d7d[_0x481f('0x16')]][_0x481f('0x2f')]='complete';this[_0x481f('0x9')]['total']+=0x1;if(this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x55')]){this[_0x481f('0x9')][_0x481f('0x56')]+=0x1;this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x57')]=moment(this['channels'][_0x561d7d['uniqueid']]['answertime'])[_0x481f('0x53')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x58')],_0x481f('0x54'));this['channels'][_0x561d7d['uniqueid']][_0x481f('0x59')]=moment(this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x51')])[_0x481f('0x53')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]]['answertime'],_0x481f('0x54'));this[_0x481f('0x9')][_0x481f('0x5a')]+=this[_0x481f('0x7')][_0x561d7d['uniqueid']][_0x481f('0x57')]||0x0;this[_0x481f('0x9')]['sumBillable']+=this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x59')];}this[_0x481f('0x9')][_0x481f('0x5b')]+=this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x52')];logger[_0x481f('0x28')](_0x481f('0x5c'),_0x561d7d[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]],{'showHidden':![],'depth':null}));ami['emit'](_0x481f('0x5d'),this['channels'][_0x561d7d[_0x481f('0x16')]]);logger[_0x481f('0x28')](_0x481f('0x5e'),_0x561d7d[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]],{'showHidden':![],'depth':null}));ami[_0x481f('0x14')](_0x481f('0x5f'),this['channels'][_0x561d7d['uniqueid']]);logger[_0x481f('0x28')](_0x481f('0x60'),_0x561d7d[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]],{'showHidden':![],'depth':null}));this['emit'](_0x481f('0x26'),_0x481f('0x61'),this[_0x481f('0x9')]);logger[_0x481f('0x22')](_0x481f('0x62'),JSON[_0x481f('0x63')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]]));logger[_0x481f('0x28')](_0x481f('0x64'),_0x561d7d[_0x481f('0x16')],util['inspect'](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]],{'showHidden':![],'depth':null}));this[_0x481f('0x14')](_0x481f('0x26'),_0x481f('0x65'),this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]]);delete this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]];}else if(this['channels'][_0x561d7d[_0x481f('0x66')]]){this[_0x481f('0x7')][_0x561d7d[_0x481f('0x66')]][_0x481f('0x16')]=this[_0x481f('0x7')][_0x561d7d[_0x481f('0x66')]][_0x481f('0x67')];}if(this['variables'][_0x561d7d[_0x481f('0x16')]]){delete this['variables'][_0x561d7d[_0x481f('0x16')]];}}}catch(_0x11fc2b){logger[_0x481f('0x3a')](_0x481f('0x68'),_0x561d7d[_0x481f('0x16')],util[_0x481f('0x17')](_0x11fc2b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481f('0x12')][_0x481f('0x10')]=function(_0x55ef39){try{if(this['isNotNull'](_0x55ef39)){logger[_0x481f('0x28')](_0x481f('0x69'),_0x55ef39['uniqueid'],util[_0x481f('0x17')](_0x55ef39,{'showHidden':![],'depth':null}));if(_0x55ef39[_0x481f('0x6a')]['toLowerCase']()===_0x481f('0x6b')){_0x55ef39[_0x481f('0x6c')]=(_0x55ef39['appdata']||_0x55ef39[_0x481f('0x6c')])[_0x481f('0x6d')]();if(_[_0x481f('0x6e')](_0x55ef39[_0x481f('0x6c')],_0x481f('0x6f'))){if(_[_0x481f('0x4d')](this[_0x481f('0x25')][_0x55ef39[_0x481f('0x16')]]))this[_0x481f('0x25')][_0x55ef39['uniqueid']]={};logger['info'](_0x481f('0x70'),_0x55ef39[_0x481f('0x16')],_0x55ef39[_0x481f('0x6a')],_0x55ef39[_0x481f('0x6c')]);var _0x205124=_0x55ef39[_0x481f('0x6c')][_0x481f('0x71')]('=');var _0x4f1149=_0x205124[0x0][_0x481f('0x72')](/cdr\((.*)\)/);if(_0x4f1149)this['applications'][_0x55ef39[_0x481f('0x16')]][_0x4f1149[0x1]]=_0x205124[0x1];}}}}catch(_0x59bde8){logger['error'](_0x481f('0x73'),_0x55ef39[_0x481f('0x16')],util[_0x481f('0x17')](_0x59bde8,{'showHidden':![],'depth':null}));}};module[_0x481f('0x74')]=VoiceDialReport; \ No newline at end of file +var _0x9daf=['lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','outboundrouteid','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','duration','endtime','starttime','seconds','answered','holdtime','diff','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outbound','applications','dialbegin','bind','dialend','varset','newexten','syncNewExten','syncHangup','prototype','isNotNull','isUndefined','emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','called','channel','substring','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','syncDialEnd','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4c4ab6,_0x67ee9b){var _0x386bdd=function(_0x5189f5){while(--_0x5189f5){_0x4c4ab6['push'](_0x4c4ab6['shift']());}};_0x386bdd(++_0x67ee9b);}(_0x9daf,0xbf));var _0xf9da=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0x9daf[_0x3ad7ad];return _0x225a60;};'use strict';var _=require(_0xf9da('0x0'));var moment=require(_0xf9da('0x1'));var util=require(_0xf9da('0x2'));var Redis=require(_0xf9da('0x3'));var config=require(_0xf9da('0x4'));var logger=require(_0xf9da('0x5'))(_0xf9da('0x6'));var ami=require(_0xf9da('0x7'));config[_0xf9da('0x8')]=_['defaults'](config[_0xf9da('0x8')],{'host':_0xf9da('0x9'),'port':0x18eb});var io=require(_0xf9da('0xa'))(new Redis(config[_0xf9da('0x8')]));function VoiceDialReport(_0x28be5d){this[_0xf9da('0xb')]=_0x28be5d['outboundChannels'];this[_0xf9da('0xc')]=_0x28be5d[_0xf9da('0xc')];this[_0xf9da('0xd')]={};this['variables']={};ami['on'](_0xf9da('0xe'),this['syncDialBegin'][_0xf9da('0xf')](this));ami['on'](_0xf9da('0x10'),this['syncDialEnd'][_0xf9da('0xf')](this));ami['on'](_0xf9da('0x11'),this['syncVarSet']['bind'](this));ami['on'](_0xf9da('0x12'),this[_0xf9da('0x13')][_0xf9da('0xf')](this));ami['on']('hangup',this[_0xf9da('0x14')][_0xf9da('0xf')](this));}VoiceDialReport[_0xf9da('0x15')][_0xf9da('0x16')]=function(_0x741605){return _0x741605!==null&&!_[_0xf9da('0x17')](_0x741605);};VoiceDialReport[_0xf9da('0x15')][_0xf9da('0x18')]=function(_0x74aa19,_0xb3f573,_0x5ee2da){io['to'](_0x74aa19)[_0xf9da('0x18')](_0xb3f573,_0x5ee2da);};VoiceDialReport['prototype'][_0xf9da('0x19')]=function(_0x9ea3a7){try{if(this[_0xf9da('0x16')](_0x9ea3a7)){logger[_0xf9da('0x1a')](_0xf9da('0x1b'),_0x9ea3a7[_0xf9da('0x1c')],util[_0xf9da('0x1d')](_0x9ea3a7,{'showHidden':![],'depth':null}));if(this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]]){_[_0xf9da('0x1e')](this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xf9da('0x1f'),'interface':_0x9ea3a7[_0xf9da('0x20')][_0xf9da('0x21')](0x0,_0x9ea3a7[_0xf9da('0x20')]['lastIndexOf']('-')),'membername':_0x9ea3a7['channel'][_0xf9da('0x21')](_0x9ea3a7['channel'][_0xf9da('0x22')]('/')+0x1,_0x9ea3a7[_0xf9da('0x20')][_0xf9da('0x22')]('-'))},_[_0xf9da('0x23')](_0x9ea3a7,[_0xf9da('0x24'),_0xf9da('0x25')]));logger[_0xf9da('0x26')](_0xf9da('0x27'),_0x9ea3a7[_0xf9da('0x1c')],this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]]['membername'],this['channels'][_0x9ea3a7['uniqueid']][_0xf9da('0x28')]);logger['debug'](_0xf9da('0x29'),_0x9ea3a7['uniqueid'],util[_0xf9da('0x1d')](this['channels'][_0x9ea3a7[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));if(this[_0xf9da('0xd')][_0x9ea3a7['uniqueid']])_[_0xf9da('0x1e')](this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]],this[_0xf9da('0xd')][_0x9ea3a7[_0xf9da('0x1c')]]);this[_0xf9da('0x18')](_0xf9da('0x2a'),_0xf9da('0x2b'),this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]]);logger[_0xf9da('0x1a')](_0xf9da('0x2c'),_0x9ea3a7['uniqueid'],util[_0xf9da('0x1d')](this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xf9da('0x18')](_0xf9da('0x2d'),this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]]);}}}catch(_0x41fae4){logger[_0xf9da('0x2e')]('[%s][voiceDialReport][dialbegin]',_0x9ea3a7['uniqueid'],util[_0xf9da('0x1d')](_0x41fae4,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf9da('0x15')][_0xf9da('0x2f')]=function(_0x250120){try{if(this['isNotNull'](_0x250120)){logger[_0xf9da('0x1a')]('[%s][voiceDialReport][dialend]\x20event:',_0x250120['uniqueid'],util[_0xf9da('0x1d')](_0x250120,{'showHidden':![],'depth':null}));if(this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]]){this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]][_0xf9da('0x30')]=_0x250120[_0xf9da('0x30')];if(_0x250120['dialstatus']===_0xf9da('0x31')){this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]][_0xf9da('0x32')]=_0x250120['connectedlinenum'];this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]]['connectedlinename']=_0x250120[_0xf9da('0x33')];this[_0xf9da('0xb')][_0x250120['uniqueid']][_0xf9da('0x34')]=moment()[_0xf9da('0x35')](_0xf9da('0x36'));this['channels'][_0x250120[_0xf9da('0x1c')]][_0xf9da('0x37')]=_0xf9da('0x38');logger[_0xf9da('0x26')](_0xf9da('0x39'),_0x250120[_0xf9da('0x1c')],_0x250120[_0xf9da('0x20')][_0xf9da('0x21')](_0x250120[_0xf9da('0x20')]['lastIndexOf']('/')+0x1,_0x250120[_0xf9da('0x20')][_0xf9da('0x22')]('-')));logger[_0xf9da('0x1a')](_0xf9da('0x3a'),_0x250120[_0xf9da('0x1c')],util['inspect'](this[_0xf9da('0xb')][_0x250120['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xf9da('0x18')](_0xf9da('0x3b'),this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]]);}logger[_0xf9da('0x1a')](_0xf9da('0x3c'),_0x250120[_0xf9da('0x1c')],util[_0xf9da('0x1d')](this[_0xf9da('0xb')][_0x250120['uniqueid']],{'showHidden':![],'depth':null}));this[_0xf9da('0x18')](_0xf9da('0x2a'),_0xf9da('0x2b'),this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]]);}}}catch(_0x52fee6){logger['error'](_0xf9da('0x3d'),_0x250120['uniqueid'],util[_0xf9da('0x1d')](_0x52fee6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf9da('0x15')]['syncVarSet']=function(_0x4cbb36){try{if(this['isNotNull'](_0x4cbb36)){logger[_0xf9da('0x1a')](_0xf9da('0x3e'),_0x4cbb36['uniqueid'],util['inspect'](_0x4cbb36,{'showHidden':![],'depth':null}));this[_0xf9da('0x3f')](_0x4cbb36[_0xf9da('0x1c')],_[_0xf9da('0x40')](_0x4cbb36['variable'])[0x0],_0x4cbb36[_0xf9da('0x41')]);if(this[_0xf9da('0x16')](_0x4cbb36[_0xf9da('0x42')])&&this['isNotNull'](_0x4cbb36['variable'][_0xf9da('0x43')])){if(_['isUndefined'](this[_0xf9da('0xb')][_0x4cbb36[_0xf9da('0x1c')]])){this['channels'][_0x4cbb36[_0xf9da('0x1c')]]={'routeId':_0x4cbb36[_0xf9da('0x41')],'variables':this[_0xf9da('0x44')][_0x4cbb36[_0xf9da('0x1c')]],'motionChannel':'voice'};logger['info'](_0xf9da('0x45'),_0x4cbb36['uniqueid'],_0x4cbb36['variable'][_0xf9da('0x43')],_[_0xf9da('0x40')](_0x4cbb36[_0xf9da('0x42')])[0x0],_0x4cbb36[_0xf9da('0x41')]);logger[_0xf9da('0x1a')](_0xf9da('0x46'),_0x4cbb36[_0xf9da('0x1c')],util['inspect'](this[_0xf9da('0xb')][_0x4cbb36[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));this[_0xf9da('0x18')](_0xf9da('0x2a'),_0xf9da('0x2b'),this[_0xf9da('0xb')][_0x4cbb36[_0xf9da('0x1c')]]);}}}}catch(_0x1b6912){logger[_0xf9da('0x2e')](_0xf9da('0x47'),_0x4cbb36[_0xf9da('0x1c')],util[_0xf9da('0x1d')](_0x1b6912,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xf9da('0x3f')]=function(_0x4f3cda,_0x1b6379,_0x1435e7){var _0x1022ac=[_0xf9da('0x48'),'rtpaudioqosbridged','rtpaudioqosjitter',_0xf9da('0x49'),_0xf9da('0x4a'),_0xf9da('0x4b'),_0xf9da('0x4c'),_0xf9da('0x4d'),_0xf9da('0x4e'),_0xf9da('0x4f'),'bridgepeer',_0xf9da('0x50'),'membercalls','memberdynamic',_0xf9da('0x51'),_0xf9da('0x52'),_0xf9da('0x53'),_0xf9da('0x54'),'memberrealtime'];if(!_[_0xf9da('0x55')](_0x1b6379)&&!_[_0xf9da('0x56')](_0x1022ac,_0x1b6379)){if(_[_0xf9da('0x17')](this[_0xf9da('0x44')][_0x4f3cda])){this[_0xf9da('0x44')][_0x4f3cda]={};}this['variables'][_0x4f3cda][_0x1b6379]=_0x1435e7;}};VoiceDialReport[_0xf9da('0x15')][_0xf9da('0x14')]=function(_0x4ed735){try{if(this['isNotNull'](_0x4ed735)){logger[_0xf9da('0x1a')](_0xf9da('0x57'),_0x4ed735[_0xf9da('0x1c')],util['inspect'](_0x4ed735,{'showHidden':![],'depth':null}));if(this['channels'][_0x4ed735[_0xf9da('0x1c')]]){logger[_0xf9da('0x26')](_0xf9da('0x58'),_0x4ed735[_0xf9da('0x1c')],_0x4ed735[_0xf9da('0x59')]);this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]]['endtime']=moment()['format'](_0xf9da('0x36'));this[_0xf9da('0xb')][_0x4ed735['uniqueid']][_0xf9da('0x5a')]=moment(this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x5b')])['diff'](this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x5c')],_0xf9da('0x5d'));this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x37')]='complete';this['outbound']['total']+=0x1;if(this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x34')]){this[_0xf9da('0xc')][_0xf9da('0x5e')]+=0x1;this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x5f')]=moment(this[_0xf9da('0xb')][_0x4ed735['uniqueid']][_0xf9da('0x34')])[_0xf9da('0x60')](this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x5c')],_0xf9da('0x5d'));this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x61')]=moment(this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]]['endtime'])[_0xf9da('0x60')](this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x34')],_0xf9da('0x5d'));this[_0xf9da('0xc')][_0xf9da('0x62')]+=this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x5f')]||0x0;this[_0xf9da('0xc')][_0xf9da('0x63')]+=this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x61')];}this[_0xf9da('0xc')][_0xf9da('0x64')]+=this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]]['duration'];logger[_0xf9da('0x1a')](_0xf9da('0x65'),_0x4ed735['uniqueid'],util[_0xf9da('0x1d')](this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xf9da('0x18')](_0xf9da('0x66'),this[_0xf9da('0xb')][_0x4ed735['uniqueid']]);logger['debug'](_0xf9da('0x67'),_0x4ed735[_0xf9da('0x1c')],util[_0xf9da('0x1d')](this[_0xf9da('0xb')][_0x4ed735['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xf9da('0x18')](_0xf9da('0x68'),this[_0xf9da('0xb')][_0x4ed735['uniqueid']]);logger[_0xf9da('0x1a')](_0xf9da('0x69'),_0x4ed735['uniqueid'],util[_0xf9da('0x1d')](this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));this[_0xf9da('0x18')]('voice:outbound',_0xf9da('0x6a'),this[_0xf9da('0xc')]);logger[_0xf9da('0x26')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xf9da('0x6b')](this[_0xf9da('0xb')][_0x4ed735['uniqueid']]));logger[_0xf9da('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x4ed735['uniqueid'],util['inspect'](this['channels'][_0x4ed735[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));this[_0xf9da('0x18')](_0xf9da('0x2a'),_0xf9da('0x6c'),this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]]);delete this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]];}else if(this['channels'][_0x4ed735['linkedid']]){this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x6d')]][_0xf9da('0x1c')]=this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x6d')]][_0xf9da('0x6e')];}if(this[_0xf9da('0x44')][_0x4ed735[_0xf9da('0x1c')]]){delete this[_0xf9da('0x44')][_0x4ed735[_0xf9da('0x1c')]];}}}catch(_0x1c0fa1){logger[_0xf9da('0x2e')](_0xf9da('0x6f'),_0x4ed735[_0xf9da('0x1c')],util['inspect'](_0x1c0fa1,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xf9da('0x13')]=function(_0x2fa4b8){try{if(this[_0xf9da('0x16')](_0x2fa4b8)){logger['debug'](_0xf9da('0x70'),_0x2fa4b8[_0xf9da('0x1c')],util[_0xf9da('0x1d')](_0x2fa4b8,{'showHidden':![],'depth':null}));if(_0x2fa4b8[_0xf9da('0x71')][_0xf9da('0x72')]()==='set'){_0x2fa4b8[_0xf9da('0x73')]=(_0x2fa4b8[_0xf9da('0x74')]||_0x2fa4b8[_0xf9da('0x73')])['toLowerCase']();if(_[_0xf9da('0x75')](_0x2fa4b8[_0xf9da('0x73')],_0xf9da('0x76'))){if(_[_0xf9da('0x17')](this[_0xf9da('0xd')][_0x2fa4b8[_0xf9da('0x1c')]]))this[_0xf9da('0xd')][_0x2fa4b8[_0xf9da('0x1c')]]={};logger[_0xf9da('0x26')](_0xf9da('0x77'),_0x2fa4b8['uniqueid'],_0x2fa4b8[_0xf9da('0x71')],_0x2fa4b8['applicationdata']);var _0x2c9500=_0x2fa4b8[_0xf9da('0x73')][_0xf9da('0x78')]('=');var _0x2159ea=_0x2c9500[0x0][_0xf9da('0x79')](/cdr\((.*)\)/);if(_0x2159ea)this[_0xf9da('0xd')][_0x2fa4b8['uniqueid']][_0x2159ea[0x1]]=_0x2c9500[0x1];}}}}catch(_0x3c3ccd){logger[_0xf9da('0x2e')](_0xf9da('0x7a'),_0x2fa4b8[_0xf9da('0x1c')],util[_0xf9da('0x1d')](_0x3c3ccd,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 138f2ea..d0472b7 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81d5=['queueStatusComplete','unlockRR','clearZombieChannels','switch','enqueue','isNil','Action','channel','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','uniqueid','voice_queue_channel:remove','voice_queue_presence:remove','type','answered','sumBillable','sumDuration','sumHoldTime','total','waiting','Trunk','active','callerid','Interval','stringify',']\x20sending\x20voice_queue:save\x20event:','format','voice_queue:save','isNotNull','queues','[voiceQueueReport][queues]','loopQueueSummary','then','catch','[voiceQueueReport][queuesummary]','queue','info','countBy','callers','loggedIn','toNumber','loggedin','available','talking','custom:queuesummary','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','push','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','transfer','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','add','seconds','transfertype','FORWARD','transferexten','destexten','transferuniqueid','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][varset]','keys','variable','value','queuestatus','TIMEOUT','lastevent','timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','unmanaged','abandoned','diff','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','emitVoiceQueueSummary','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','socket.io-emitter','prototype','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','queuecallerabandon','bind','queuecallerleave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated'];(function(_0x483d76,_0x2c0f05){var _0x2dbecd=function(_0x4ab398){while(--_0x4ab398){_0x483d76['push'](_0x483d76['shift']());}};_0x2dbecd(++_0x2c0f05);}(_0x81d5,0x1ab));var _0x581d=function(_0xba21d1,_0x5ea074){_0xba21d1=_0xba21d1-0x0;var _0xad42b6=_0x81d5[_0xba21d1];return _0xad42b6;};'use strict';var _=require(_0x581d('0x0'));var moment=require(_0x581d('0x1'));var util=require('util');var md5=require(_0x581d('0x2'));var Redis=require(_0x581d('0x3'));var config=require(_0x581d('0x4'));var logger=require(_0x581d('0x5'))(_0x581d('0x6'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0x581d('0x7')]=_[_0x581d('0x8')](config[_0x581d('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x581d('0x9'))(new Redis(config[_0x581d('0x7')]));var Sequence=function(){};Sequence[_0x581d('0xa')]['enqueue']=function(_0xf1a3b6){this['tail']=this['tail']?this['tail'][_0x581d('0xb')](_0xf1a3b6):_0xf1a3b6();};function VoiceQueueReport(_0x3435a9){this[_0x581d('0xc')]=new Sequence();this[_0x581d('0xd')]={};this[_0x581d('0xe')]=_0x3435a9['agents'];this[_0x581d('0xf')]=_0x3435a9[_0x581d('0x10')];this[_0x581d('0x11')]=_0x3435a9[_0x581d('0x11')];this[_0x581d('0x12')]=!![];this[_0x581d('0x13')]=_0x3435a9[_0x581d('0x13')];this[_0x581d('0x14')]={};ami['on'](_0x581d('0x15'),this[_0x581d('0x16')]['bind'](this));ami['on'](_0x581d('0x17'),this[_0x581d('0x18')]['bind'](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin']['bind'](this));ami['on'](_0x581d('0x19'),this['syncQueueCallerAbandon'][_0x581d('0x1a')](this));ami['on'](_0x581d('0x1b'),this['syncQueueCallerLeave'][_0x581d('0x1a')](this));ami['on']('agentcomplete',this[_0x581d('0x1c')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x1d'),this[_0x581d('0x1e')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x1f'),this[_0x581d('0x20')]['bind'](this));ami['on'](_0x581d('0x21'),this[_0x581d('0x22')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x23'),this[_0x581d('0x24')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x25'),this[_0x581d('0x26')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x27'),this[_0x581d('0x28')][_0x581d('0x1a')](this));ami['on']('musiconholdstop',this[_0x581d('0x29')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x2a'),this[_0x581d('0x2b')][_0x581d('0x1a')](this));ami['on']('blindtransfer',this[_0x581d('0x2c')][_0x581d('0x1a')](this));this['loopQueueSummary']();this[_0x581d('0x2d')]();}function clearChannels(_0x23abda){if(!_[_0x581d('0x2e')](_0x23abda)){for(var _0x5a3fd7 in _0x23abda){if(_0x23abda[_0x581d('0x2f')](_0x5a3fd7)){delete _0x23abda[_0x5a3fd7];}}}}function clearCampaigns(_0xdad92){if(!_[_0x581d('0x2e')](_0xdad92)){for(var _0xc270bc in _0xdad92){if(_0xdad92[_0x581d('0x2f')](_0xc270bc)){_0xdad92[_0xc270bc][_0x581d('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4b9b62){if(!_[_0x581d('0x2e')](_0x4b9b62)){for(var _0x2b75d8 in _0x4b9b62){if(_0x4b9b62[_0x581d('0x2f')](_0x2b75d8)){_0x4b9b62[_0x2b75d8]['originated']=0x0;_0x4b9b62[_0x2b75d8]['talking']=0x0;_0x4b9b62[_0x2b75d8]['pTalking']=0x0;_0x4b9b62[_0x2b75d8]['waiting']=0x0;_0x4b9b62[_0x2b75d8][_0x581d('0x31')]=!![];}}}}function clearAgentBooked(_0x266a2b){if(!_[_0x581d('0x2e')](_0x266a2b)){for(var _0x408cce in _0x266a2b){if(_0x266a2b[_0x581d('0x2f')](_0x408cce)){_0x266a2b[_0x408cce][_0x581d('0x32')]=!![];}}}}VoiceQueueReport[_0x581d('0xa')][_0x581d('0x33')]=function(){var _0x163297=this;for(var _0xda8a98 in this[_0x581d('0xf')]){if(this['channels'][_0x581d('0x2f')](_0xda8a98)&&!this['channels'][_0xda8a98][_0x581d('0x34')]){this[_0x581d('0xc')][_0x581d('0x35')](function(){if(!_[_0x581d('0x36')](_0x163297[_0x581d('0xf')][_0xda8a98])){return ami[_0x581d('0x37')]({'action':'status','channel':_0x163297[_0x581d('0xf')][_0xda8a98][_0x581d('0x38')]})['catch'](function(_0x5b2b1d){if(_0x5b2b1d['message']===_0x581d('0x39')){setTimeout(function(){if(_0x163297[_0x581d('0xf')][_0xda8a98]){delete _0x163297[_0x581d('0xf')][_0xda8a98];logger[_0x581d('0x3a')](_0x581d('0x3b'),_0xda8a98,util[_0x581d('0x3c')](_0x5b2b1d,{'showHidden':![],'depth':null}));}if(_0x163297[_0x581d('0xd')][_0xda8a98]){delete _0x163297['queueReports'][_0xda8a98];logger[_0x581d('0x3a')](_0x581d('0x3d'),_0xda8a98,util['inspect'](_0x5b2b1d,{'showHidden':![],'depth':null}));}if(_0x163297[_0x581d('0x14')][_0xda8a98]){delete _0x163297[_0x581d('0x14')][_0xda8a98];logger[_0x581d('0x3a')](_0x581d('0x3e'),_0xda8a98,util[_0x581d('0x3c')](_0x5b2b1d,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x581d('0x24')]=function(){logger['error'](_0x581d('0x3f'));clearChannels(this[_0x581d('0xf')]);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x581d('0x13')]);};VoiceQueueReport['prototype'][_0x581d('0x40')]=function(_0x5d029a){var _0x25ee3f=this;if(!_[_0x581d('0x2e')](_0x5d029a)){for(var _0x115e53 in _0x5d029a){if(_0x5d029a[_0x581d('0x2f')](_0x115e53)){_0x25ee3f[_0x581d('0x41')](_0x5d029a[_0x115e53],_0x581d('0x42'));delete _0x5d029a[_0x115e53];}}}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x43')]=function(_0x215671,_0x5e1ed4,_0x5af47c){io['to'](_0x215671)['emit'](_0x5e1ed4,_0x5af47c);};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x44')]=function(_0x109d34,_0x4ca064){logger[_0x581d('0x45')](_0x581d('0x46')+_0x4ca064+_0x581d('0x47'),_0x109d34['uniqueid'],util[_0x581d('0x3c')](_0x109d34,{'showHidden':![],'depth':null}));this[_0x581d('0x43')](util['format'](_0x581d('0x48'),_0x109d34[_0x581d('0x49')]),_0x581d('0x4a'),_0x109d34);io[_0x581d('0x43')](_0x581d('0x4b'),_0x109d34);};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x41')]=function(_0x5550b4,_0x3cadb3){logger[_0x581d('0x45')](_0x581d('0x46')+_0x3cadb3+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x5550b4[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x5550b4,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x581d('0x48'),_0x5550b4[_0x581d('0x49')]),_0x581d('0x4d'),_0x5550b4);io['emit'](_0x581d('0x4e'),_0x5550b4);};VoiceQueueReport[_0x581d('0xa')]['emitVoiceQueueSummary']=function(_0x31a7ce,_0x47cb2c){if(_0x31a7ce[_0x581d('0x4f')]==='inbound'){var _0x27941b={'id':_0x31a7ce['id'],'name':_0x31a7ce['name'],'strategy':_0x31a7ce['strategy'],'answered':_0x31a7ce[_0x581d('0x50')],'available':_0x31a7ce['available'],'loggedIn':_0x31a7ce['loggedIn'],'pTalking':_0x31a7ce['pTalking'],'sumBillable':_0x31a7ce[_0x581d('0x51')],'sumDuration':_0x31a7ce[_0x581d('0x52')],'sumHoldTime':_0x31a7ce[_0x581d('0x53')]||0x0,'talking':_0x31a7ce['talking'],'total':_0x31a7ce[_0x581d('0x54')],'type':_0x31a7ce[_0x581d('0x4f')],'unmanaged':_0x31a7ce['unmanaged'],'abandoned':_0x31a7ce['abandoned'],'waiting':_0x31a7ce[_0x581d('0x55')]};if(_0x31a7ce['Trunk']){_0x27941b[_0x581d('0x56')]={'id':_0x31a7ce['Trunk']['id'],'name':_0x31a7ce[_0x581d('0x56')][_0x581d('0x49')],'active':_0x31a7ce['Trunk'][_0x581d('0x57')],'callerid':_0x31a7ce[_0x581d('0x56')][_0x581d('0x58')]};}if(_0x31a7ce[_0x581d('0x59')]){_0x27941b[_0x581d('0x59')]={'id':_0x31a7ce['Interval']['id'],'name':_0x31a7ce[_0x581d('0x59')][_0x581d('0x49')]};}var _0xa20325=md5(JSON[_0x581d('0x5a')](_0x27941b));if(_0x31a7ce[_0x581d('0x2')]!==_0xa20325){_0x31a7ce[_0x581d('0x2')]=_0xa20325;logger[_0x581d('0x45')]('[voiceQueueReport]['+_0x47cb2c+_0x581d('0x5b'),util[_0x581d('0x3c')](_0x27941b,{'showHidden':![],'depth':null}));this[_0x581d('0x43')](util[_0x581d('0x5c')](_0x581d('0x48'),_0x27941b[_0x581d('0x49')]),_0x581d('0x5d'),_0x27941b);}}};VoiceQueueReport['prototype'][_0x581d('0x5e')]=function(_0x1f2846){return _0x1f2846!==null&&!_['isUndefined'](_0x1f2846);};VoiceQueueReport[_0x581d('0xa')]['loopQueueShow']=function(){var _0x29f36e=this;setInterval(function(){_0x29f36e[_0x581d('0x33')]();ami[_0x581d('0x37')]({'action':_0x581d('0x5f')})['catch'](function(_0x507e1a){logger[_0x581d('0x3a')](_0x581d('0x60'),util['inspect'](_0x507e1a,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x581d('0x61')]=function(){var _0x291907=this;setInterval(function(){if(_0x291907[_0x581d('0x12')]){return ami[_0x581d('0x37')]({'action':'queuesummary'})[_0x581d('0x62')](function(_0x4350c3){_0x291907[_0x581d('0x12')]=![];})[_0x581d('0x63')](function(_0x23a330){logger[_0x581d('0x3a')](_0x581d('0x64'),util[_0x581d('0x3c')](_0x23a330,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x581d('0xa')]['syncQueueSummary']=function(_0x3749a0){try{if(this[_0x581d('0x5e')](_0x3749a0)&&this[_0x581d('0x5e')](_0x3749a0['queue'])){logger[_0x581d('0x45')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x581d('0x3c')](_0x3749a0,{'showHidden':![],'depth':null}));if(this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]]){logger[_0x581d('0x66')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x3749a0['queue']);var _0x2194da=_[_0x581d('0x67')](this[_0x581d('0xf')],_0x581d('0x65'))[_0x3749a0[_0x581d('0x65')]]||0x0;var _0x5dfb06=_0x2194da-_0x3749a0['callers'];if(this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x55')]!==_['toNumber'](_0x3749a0[_0x581d('0x68')])||this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x69')]!==_[_0x581d('0x6a')](_0x3749a0[_0x581d('0x6b')])||this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]]['available']!==_[_0x581d('0x6a')](_0x3749a0[_0x581d('0x6c')])||this['voiceQueues'][_0x3749a0[_0x581d('0x65')]][_0x581d('0x6d')]!==_0x5dfb06){this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x55')]=_[_0x581d('0x6a')](_0x3749a0[_0x581d('0x68')]);this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x69')]=_[_0x581d('0x6a')](_0x3749a0[_0x581d('0x6b')]);this['voiceQueues'][_0x3749a0[_0x581d('0x65')]]['available']=_[_0x581d('0x6a')](_0x3749a0['available']);this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x6d')]=_0x5dfb06>0x0?_0x5dfb06:0x0;this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]]['talking']=this[_0x581d('0x11')][_0x3749a0['queue']][_0x581d('0x6d')]>_['toNumber'](_0x3749a0[_0x581d('0x6b')])?_[_0x581d('0x6a')](_0x3749a0[_0x581d('0x6b')]):this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x6d')];this['emitVoiceQueueSummary'](this['voiceQueues'][_0x3749a0[_0x581d('0x65')]],_0x581d('0x15'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x581d('0x3c')](this[_0x581d('0x11')][_0x3749a0['queue']],{'showHidden':![],'depth':null}));ami[_0x581d('0x43')](_0x581d('0x6e'),this[_0x581d('0x11')][_0x3749a0['queue']]);}}}catch(_0x2f5310){logger['error']('[voiceQueueReport][queuesummary]',util[_0x581d('0x3c')](_0x2f5310,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x18')]=function(_0x44cee5){logger[_0x581d('0x45')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x581d('0x3c')](_0x44cee5,{'showHidden':![],'depth':null}));this[_0x581d('0x12')]=!![];};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x6f')]=function(_0x303faf){try{if(this[_0x581d('0x5e')](_0x303faf)){logger[_0x581d('0x45')](_0x581d('0x70'),_0x303faf['uniqueid'],util[_0x581d('0x3c')](_0x303faf,{'showHidden':![],'depth':null}));if(_[_0x581d('0x71')](this[_0x581d('0xd')][_0x303faf[_0x581d('0x4c')]]))this[_0x581d('0xd')][_0x303faf[_0x581d('0x4c')]]=[];if(_[_0x581d('0x71')](this[_0x581d('0xf')][_0x303faf[_0x581d('0x4c')]]))this['channels'][_0x303faf[_0x581d('0x4c')]]={};var _0x40b5e5=new QueueReport();_0x40b5e5[_0x581d('0x49')]=_0x303faf['queue'];_0x40b5e5[_0x581d('0x4f')]=this[_0x581d('0x11')][_0x40b5e5[_0x581d('0x49')]]&&this[_0x581d('0x11')][_0x40b5e5[_0x581d('0x49')]][_0x581d('0x4f')]?this[_0x581d('0x11')][_0x40b5e5[_0x581d('0x49')]][_0x581d('0x4f')]||_0x581d('0x72'):'inbound';_0x40b5e5[_0x581d('0x65')]=_0x303faf[_0x581d('0x65')];_0x40b5e5[_0x581d('0x73')]=moment()[_0x581d('0x5c')](_0x581d('0x74'));_0x40b5e5[_0x581d('0x75')]=_0x303faf[_0x581d('0x75')];_0x40b5e5[_0x581d('0x76')]=_0x303faf[_0x581d('0x76')];_0x40b5e5[_0x581d('0x4c')]=_0x303faf['uniqueid'];_0x40b5e5['routealias']=this[_0x581d('0xf')][_0x303faf[_0x581d('0x4c')]][_0x581d('0x77')];logger[_0x581d('0x66')](_0x581d('0x78'),_0x40b5e5[_0x581d('0x49')],_0x40b5e5[_0x581d('0x4f')]);_['merge'](_0x40b5e5,_[_0x581d('0x79')](_0x303faf,_['keys'](_0x40b5e5)));this[_0x581d('0xd')][_0x303faf[_0x581d('0x4c')]][_0x581d('0x7a')](_0x40b5e5);this[_0x581d('0xf')][_0x303faf[_0x581d('0x4c')]]=_0x40b5e5;this[_0x581d('0x44')](_0x40b5e5,'queuecallerjoin');}}catch(_0x5b1b6d){logger[_0x581d('0x3a')](_0x581d('0x70'),_0x303faf[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x5b1b6d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x7b')]=function(_0x1368f2){try{if(this[_0x581d('0x5e')](_0x1368f2)){logger['debug'](_0x581d('0x7c'),_0x1368f2[_0x581d('0x4c')],util['inspect'](_0x1368f2,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x1368f2[_0x581d('0x4c')]]){var _0x52ca16=_[_0x581d('0x7d')](this['queueReports'][_0x1368f2[_0x581d('0x4c')]]);_0x52ca16[_0x581d('0x7e')]=![];_0x52ca16[_0x581d('0x7f')]=null;_0x52ca16[_0x581d('0x80')]=_0x1368f2[_0x581d('0x80')];_0x52ca16['originalposition']=_0x1368f2[_0x581d('0x81')];_0x52ca16['queuecallerabandon']=!![];_0x52ca16[_0x581d('0x82')]=moment()[_0x581d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x52ca16[_0x581d('0x83')]=_0x581d('0x84');_0x52ca16[_0x581d('0x85')]=null;logger['info'](_0x581d('0x86'),_0x52ca16[_0x581d('0x49')],_0x52ca16[_0x581d('0x4f')]);this['channels'][_0x1368f2[_0x581d('0x4c')]]=_0x52ca16;this['emitVoiceQueueChannelRemove'](_0x52ca16,'queuecallerabandon');}}}catch(_0xb676a8){logger['error'](_0x581d('0x7c'),_0x1368f2[_0x581d('0x4c')],util['inspect'](_0xb676a8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')]['syncQueueCallerLeave']=function(_0x1c5fa4){try{if(this[_0x581d('0x5e')](_0x1c5fa4)){logger[_0x581d('0x45')](_0x581d('0x87'),_0x1c5fa4[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x1c5fa4,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x1c5fa4[_0x581d('0x4c')]]){var _0x545f66=_[_0x581d('0x7d')](this['queueReports'][_0x1c5fa4[_0x581d('0x4c')]]);_0x545f66[_0x581d('0x88')]=moment()['format'](_0x581d('0x74'));_0x545f66['connectedlinenum']=_0x1c5fa4[_0x581d('0x89')];_0x545f66['connectedlinename']=_0x1c5fa4[_0x581d('0x8a')];logger[_0x581d('0x66')](_0x581d('0x8b'),_0x545f66['name'],_0x545f66[_0x581d('0x4f')],_0x1c5fa4['connectedlinenum'],_0x1c5fa4['connectedlinename']);this['channels'][_0x1c5fa4['uniqueid']]=_0x545f66;this[_0x581d('0x44')](_0x545f66,_0x581d('0x1b'));}}}catch(_0x58ce83){logger[_0x581d('0x3a')]('[%s][voiceQueueReport][queuecallerleave]',_0x1c5fa4[_0x581d('0x4c')],util['inspect'](_0x58ce83,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')]['syncAgentConnect']=function(_0x182298){try{if(this['isNotNull'](_0x182298)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x182298[_0x581d('0x4c')],util['inspect'](_0x182298,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x182298['uniqueid']]){var _0x82c39c=_[_0x581d('0x7d')](this[_0x581d('0xd')][_0x182298[_0x581d('0x4c')]]);_0x82c39c[_0x581d('0x7e')]=!![];_0x82c39c[_0x581d('0x83')]='COMPLETEDBYAGENT';logger['info'](_0x581d('0x8c'),_0x82c39c[_0x581d('0x49')],_0x82c39c[_0x581d('0x4f')]);}}}catch(_0x396e26){logger[_0x581d('0x3a')](_0x581d('0x8d'),_0x182298[_0x581d('0x4c')],util['inspect'](_0x396e26,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')]['syncAgentComplete']=function(_0x2e8174){try{if(this[_0x581d('0x5e')](_0x2e8174)){logger[_0x581d('0x45')](_0x581d('0x8e'),_0x2e8174[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x2e8174,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x2e8174[_0x581d('0x4c')]]){var _0x3c0f92=_['last'](this['queueReports'][_0x2e8174[_0x581d('0x4c')]]);_0x3c0f92[_0x581d('0x19')]=![];_0x3c0f92[_0x581d('0x82')]=null;_0x3c0f92[_0x581d('0x8f')]=!![];_0x3c0f92[_0x581d('0x85')]=_0x2e8174[_0x581d('0x90')];_0x3c0f92[_0x581d('0x80')]=_0x2e8174['holdtime'];_0x3c0f92[_0x581d('0x7e')]=!![];_0x3c0f92[_0x581d('0x91')]=![];_0x3c0f92['queuecallerexitAt']=null;if(!_0x3c0f92['transfer']){if(_0x2e8174['reason']==_0x581d('0x92')){_0x3c0f92['queuecallerexitreason']=_0x581d('0x93');logger[_0x581d('0x66')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x3c0f92[_0x581d('0x49')],_0x3c0f92['type']);}else{if(_[_0x581d('0x94')](_0x2e8174[_0x581d('0x38')][_0x581d('0x95')](),_0x581d('0x96'))){if(this[_0x581d('0xd')][_0x2e8174[_0x581d('0x97')]]){var _0x2508b6=_['last'](this['queueReports'][_0x2e8174['linkedid']]);_0x2508b6[_0x581d('0x7e')]=![];_0x2508b6['queuecallerexit']=!![];_0x2508b6[_0x581d('0x98')]=moment(_0x3c0f92[_0x581d('0x73')])[_0x581d('0x99')](_0x2e8174[_0x581d('0x80')],_0x581d('0x9a'))[_0x581d('0x5c')](_0x581d('0x74'));_0x2508b6['queuecallerexitreason']='FORWARDTRANSFER';_0x2508b6[_0x581d('0x92')]=!![];_0x2508b6[_0x581d('0x9b')]=_0x581d('0x9c');_0x2508b6[_0x581d('0x9d')]=_0x2e8174[_0x581d('0x9e')];_0x2508b6[_0x581d('0x9f')]=_0x2e8174['uniqueid'];logger[_0x581d('0x66')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x2508b6[_0x581d('0x49')],_0x2508b6[_0x581d('0x4f')]);var _0x192681=this[_0x581d('0xd')][_0x2e8174[_0x581d('0x97')]];this['queueReports'][_0x2e8174[_0x581d('0x97')]]=this['queueReports'][_0x2e8174[_0x581d('0x4c')]];this[_0x581d('0xd')][_0x2e8174[_0x581d('0x4c')]]=_0x192681;}}else{_0x3c0f92[_0x581d('0x83')]='COMPLETEDBY'+_0x2e8174[_0x581d('0xa0')][_0x581d('0xa1')]();logger[_0x581d('0x66')](_0x581d('0xa2'),_0x3c0f92['name'],_0x3c0f92[_0x581d('0x4f')],_0x3c0f92[_0x581d('0x83')]);}}}this[_0x581d('0xf')][_0x2e8174[_0x581d('0x4c')]]=_0x3c0f92;this[_0x581d('0x41')](_0x3c0f92,_0x581d('0xa3'));}}}catch(_0x53dcb4){logger[_0x581d('0x3a')](_0x581d('0x8e'),_0x2e8174['uniqueid'],util[_0x581d('0x3c')](_0x53dcb4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x20')]=function(_0x30d48d){try{if(this[_0x581d('0x5e')](_0x30d48d)){logger['debug'](_0x581d('0xa4'),_0x30d48d[_0x581d('0x4c')],util['inspect'](_0x30d48d,{'showHidden':![],'depth':null}));this['addVariable'](_0x30d48d['uniqueid'],_[_0x581d('0xa5')](_0x30d48d[_0x581d('0xa6')])[0x0],_0x30d48d[_0x581d('0xa7')]);if(this[_0x581d('0xd')][_0x30d48d['uniqueid']]){var _0x5c7ac9=_[_0x581d('0x7d')](this[_0x581d('0xd')][_0x30d48d[_0x581d('0x4c')]]);if(_0x5c7ac9){if(this[_0x581d('0x5e')](_0x30d48d[_0x581d('0xa6')])&&this[_0x581d('0x5e')](_0x30d48d[_0x581d('0xa6')][_0x581d('0xa8')])){switch(_0x30d48d['value']){case'CONTINUE':_0x5c7ac9[_0x581d('0x91')]=![];_0x5c7ac9[_0x581d('0x98')]=null;break;case _0x581d('0xa9'):_0x5c7ac9[_0x581d('0xaa')]=_0x581d('0xab');_0x5c7ac9[_0x581d('0x91')]=!![];_0x5c7ac9[_0x581d('0x98')]=moment()[_0x581d('0x5c')](_0x581d('0x74'));_0x5c7ac9[_0x581d('0x88')]=moment()['format'](_0x581d('0x74'));logger[_0x581d('0x45')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x30d48d[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x5c7ac9,{'showHidden':![],'depth':null}));ami[_0x581d('0x43')]('custom:timeout',_0x5c7ac9);break;default:_0x5c7ac9[_0x581d('0x91')]=!![];_0x5c7ac9[_0x581d('0x98')]=moment()[_0x581d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c7ac9[_0x581d('0x88')]=moment()[_0x581d('0x5c')](_0x581d('0x74'));}_0x5c7ac9[_0x581d('0x19')]=![];_0x5c7ac9['queuecallerabandonAt']=null;_0x5c7ac9[_0x581d('0x83')]=_0x30d48d[_0x581d('0xa7')];this[_0x581d('0xf')][_0x30d48d[_0x581d('0x4c')]]=_0x5c7ac9;this[_0x581d('0x41')](_0x5c7ac9,'varset');}else if(this['isNotNull'](_0x30d48d['variable'])&&this[_0x581d('0x5e')](_0x30d48d[_0x581d('0xa6')]['queueposition'])){if(!_0x5c7ac9[_0x581d('0x19')]){_0x5c7ac9[_0x581d('0x91')]=!![];_0x5c7ac9['queuecallerexitAt']=moment()[_0x581d('0x5c')](_0x581d('0x74'));_0x5c7ac9['queuecallerexitreason']=_0x581d('0xac');_0x5c7ac9[_0x581d('0x88')]=moment()[_0x581d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x30d48d['uniqueid']]=_0x5c7ac9;}}logger['info'](_0x581d('0xad'),_0x30d48d[_0x581d('0x4c')],_0x5c7ac9['name'],_0x5c7ac9[_0x581d('0x4f')],_['keys'](_0x30d48d[_0x581d('0xa6')])[0x0],_0x30d48d[_0x581d('0xa7')]);_0x5c7ac9[_0x581d('0x14')]=this[_0x581d('0x14')][_0x30d48d[_0x581d('0x4c')]];}}}}catch(_0x1f5f06){logger[_0x581d('0x3a')]('[%s][voiceQueueReport][varset]',_0x30d48d[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x1f5f06,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0xae')]=function(_0x2744ec,_0x95de2c,_0x51ebd0){var _0xa5afbc=[_0x581d('0xaf'),_0x581d('0xb0'),'rtpaudioqosjitter',_0x581d('0xb1'),_0x581d('0xb2'),_0x581d('0xb3'),_0x581d('0xb4'),_0x581d('0xb5'),'sipcallid',_0x581d('0xb6'),_0x581d('0xb7'),_0x581d('0xb8'),_0x581d('0xb9'),_0x581d('0xba'),'memberinterface',_0x581d('0xbb'),'membername',_0x581d('0xbc'),_0x581d('0xbd')];if(!_[_0x581d('0x36')](_0x95de2c)&&!_[_0x581d('0xbe')](_0xa5afbc,_0x95de2c)){if(_[_0x581d('0x71')](this['variables'][_0x2744ec])){this[_0x581d('0x14')][_0x2744ec]={};}this['variables'][_0x2744ec][_0x95de2c]=_0x51ebd0;}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x22')]=function(_0x214c4a){try{if(this['isNotNull'](_0x214c4a)){logger[_0x581d('0x45')](_0x581d('0xbf'),_0x214c4a[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x214c4a,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x214c4a[_0x581d('0x4c')]]){for(var _0xd27831=0x0,_0x47bc97={};_0xd278310x0?_0x5f15f6:0x0;this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]][_0x437a('0x30')]=this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]['talking']>_[_0x437a('0x72')](_0x1d3d96[_0x437a('0x71')])?_['toNumber'](_0x1d3d96[_0x437a('0x71')]):this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]['talking'];this[_0x437a('0x4f')](this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]],_0x437a('0x68'));}logger[_0x437a('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x437a('0x3c')](this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]],{'showHidden':![],'depth':null}));ami[_0x437a('0x43')](_0x437a('0x73'),this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]);}}}catch(_0x5c9013){logger['error'](_0x437a('0x6a'),util[_0x437a('0x3c')](_0x5c9013,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x17')]=function(_0x2d098b){logger[_0x437a('0x45')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x437a('0x3c')](_0x2d098b,{'showHidden':![],'depth':null}));this[_0x437a('0x11')]=!![];};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x19')]=function(_0x3f782a){try{if(this['isNotNull'](_0x3f782a)){logger[_0x437a('0x45')](_0x437a('0x74'),_0x3f782a[_0x437a('0x47')],util[_0x437a('0x3c')](_0x3f782a,{'showHidden':![],'depth':null}));if(_[_0x437a('0x64')](this[_0x437a('0xd')][_0x3f782a[_0x437a('0x47')]]))this[_0x437a('0xd')][_0x3f782a[_0x437a('0x47')]]=[];if(_['isUndefined'](this[_0x437a('0x36')][_0x3f782a['uniqueid']]))this['channels'][_0x3f782a[_0x437a('0x47')]]={};var _0x3fb37e=new QueueReport();_0x3fb37e[_0x437a('0x4a')]=_0x3f782a[_0x437a('0x6d')];_0x3fb37e['type']=this[_0x437a('0x10')][_0x3fb37e['name']]&&this[_0x437a('0x10')][_0x3fb37e[_0x437a('0x4a')]][_0x437a('0x50')]?this[_0x437a('0x10')][_0x3fb37e[_0x437a('0x4a')]][_0x437a('0x50')]||_0x437a('0x51'):_0x437a('0x51');_0x3fb37e['queue']=_0x3f782a[_0x437a('0x6d')];_0x3fb37e[_0x437a('0x75')]=moment()[_0x437a('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fb37e[_0x437a('0x76')]=_0x3f782a[_0x437a('0x76')];_0x3fb37e[_0x437a('0x77')]=_0x3f782a[_0x437a('0x77')];_0x3fb37e[_0x437a('0x47')]=_0x3f782a[_0x437a('0x47')];_0x3fb37e[_0x437a('0x78')]=this['channels'][_0x3f782a[_0x437a('0x47')]]['routealias'];logger[_0x437a('0x6e')](_0x437a('0x79'),_0x3fb37e[_0x437a('0x4a')],_0x3fb37e[_0x437a('0x50')]);_[_0x437a('0x7a')](_0x3fb37e,_[_0x437a('0x7b')](_0x3f782a,_['keys'](_0x3fb37e)));this[_0x437a('0xd')][_0x3f782a[_0x437a('0x47')]][_0x437a('0x7c')](_0x3fb37e);this[_0x437a('0x36')][_0x3f782a[_0x437a('0x47')]]=_0x3fb37e;this['emitVoiceQueueChannelSave'](_0x3fb37e,'queuecallerjoin');}}catch(_0x3ff398){logger[_0x437a('0x3a')](_0x437a('0x74'),_0x3f782a['uniqueid'],util[_0x437a('0x3c')](_0x3ff398,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x1b')]=function(_0x58cdb0){try{if(this[_0x437a('0x6b')](_0x58cdb0)){logger[_0x437a('0x45')](_0x437a('0x7d'),_0x58cdb0[_0x437a('0x47')],util[_0x437a('0x3c')](_0x58cdb0,{'showHidden':![],'depth':null}));if(this[_0x437a('0xd')][_0x58cdb0[_0x437a('0x47')]]){var _0x90c883=_[_0x437a('0x7e')](this[_0x437a('0xd')][_0x58cdb0[_0x437a('0x47')]]);_0x90c883[_0x437a('0x7f')]=![];_0x90c883[_0x437a('0x80')]=null;_0x90c883[_0x437a('0x81')]=_0x58cdb0[_0x437a('0x81')];_0x90c883[_0x437a('0x82')]=_0x58cdb0['originalposition'];_0x90c883[_0x437a('0x1a')]=!![];_0x90c883[_0x437a('0x83')]=moment()[_0x437a('0x48')](_0x437a('0x84'));_0x90c883[_0x437a('0x85')]='ABANDONED';_0x90c883['lastAssignedTo']=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x90c883['name'],_0x90c883[_0x437a('0x50')]);this[_0x437a('0x36')][_0x58cdb0[_0x437a('0x47')]]=_0x90c883;this[_0x437a('0x41')](_0x90c883,_0x437a('0x1a'));}}}catch(_0x2c34fb){logger[_0x437a('0x3a')](_0x437a('0x7d'),_0x58cdb0[_0x437a('0x47')],util[_0x437a('0x3c')](_0x2c34fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x86')]=function(_0x470f2f){try{if(this[_0x437a('0x6b')](_0x470f2f)){logger['debug'](_0x437a('0x87'),_0x470f2f[_0x437a('0x47')],util[_0x437a('0x3c')](_0x470f2f,{'showHidden':![],'depth':null}));if(this[_0x437a('0xd')][_0x470f2f[_0x437a('0x47')]]){var _0x124f43=_['last'](this[_0x437a('0xd')][_0x470f2f[_0x437a('0x47')]]);_0x124f43['queuecallerleaveAt']=moment()[_0x437a('0x48')](_0x437a('0x84'));_0x124f43[_0x437a('0x88')]=_0x470f2f[_0x437a('0x88')];_0x124f43[_0x437a('0x89')]=_0x470f2f[_0x437a('0x89')];logger['info'](_0x437a('0x8a'),_0x124f43['name'],_0x124f43[_0x437a('0x50')],_0x470f2f['connectedlinenum'],_0x470f2f['connectedlinename']);this[_0x437a('0x36')][_0x470f2f[_0x437a('0x47')]]=_0x124f43;this[_0x437a('0x44')](_0x124f43,_0x437a('0x1c'));}}}catch(_0x44c5dd){logger[_0x437a('0x3a')](_0x437a('0x87'),_0x470f2f[_0x437a('0x47')],util[_0x437a('0x3c')](_0x44c5dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x437a('0x1f')]=function(_0x3a2ba3){try{if(this['isNotNull'](_0x3a2ba3)){logger['debug'](_0x437a('0x8b'),_0x3a2ba3[_0x437a('0x47')],util[_0x437a('0x3c')](_0x3a2ba3,{'showHidden':![],'depth':null}));if(this[_0x437a('0xd')][_0x3a2ba3['uniqueid']]){var _0x44701a=_[_0x437a('0x7e')](this['queueReports'][_0x3a2ba3[_0x437a('0x47')]]);_0x44701a[_0x437a('0x7f')]=!![];_0x44701a[_0x437a('0x85')]='COMPLETEDBYAGENT';logger[_0x437a('0x6e')](_0x437a('0x8c'),_0x44701a[_0x437a('0x4a')],_0x44701a[_0x437a('0x50')]);}}}catch(_0x25ea62){logger[_0x437a('0x3a')](_0x437a('0x8b'),_0x3a2ba3[_0x437a('0x47')],util[_0x437a('0x3c')](_0x25ea62,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x437a('0x1d')]=function(_0x280307){try{if(this[_0x437a('0x6b')](_0x280307)){logger[_0x437a('0x45')](_0x437a('0x8d'),_0x280307[_0x437a('0x47')],util['inspect'](_0x280307,{'showHidden':![],'depth':null}));if(this[_0x437a('0xd')][_0x280307['uniqueid']]){var _0x1b7be4=_[_0x437a('0x7e')](this[_0x437a('0xd')][_0x280307[_0x437a('0x47')]]);_0x1b7be4[_0x437a('0x1a')]=![];_0x1b7be4[_0x437a('0x83')]=null;_0x1b7be4['assigned']=!![];_0x1b7be4['lastAssignedTo']=_0x280307[_0x437a('0x8e')];_0x1b7be4[_0x437a('0x81')]=_0x280307[_0x437a('0x81')];_0x1b7be4[_0x437a('0x7f')]=!![];_0x1b7be4[_0x437a('0x8f')]=![];_0x1b7be4[_0x437a('0x90')]=null;if(!_0x1b7be4[_0x437a('0x91')]){if(_0x280307['reason']=='transfer'){_0x1b7be4[_0x437a('0x85')]=_0x437a('0x92');logger[_0x437a('0x6e')](_0x437a('0x93'),_0x1b7be4['name'],_0x1b7be4[_0x437a('0x50')]);}else{if(_[_0x437a('0x94')](_0x280307[_0x437a('0x37')]['toLowerCase'](),_0x437a('0x95'))){if(this[_0x437a('0xd')][_0x280307[_0x437a('0x96')]]){var _0x2e7bf2=_['last'](this['queueReports'][_0x280307[_0x437a('0x96')]]);_0x2e7bf2[_0x437a('0x7f')]=![];_0x2e7bf2[_0x437a('0x8f')]=!![];_0x2e7bf2['queuecallerexitAt']=moment(_0x1b7be4['queuecallerjoinAt'])['add'](_0x280307['holdtime'],_0x437a('0x97'))[_0x437a('0x48')](_0x437a('0x84'));_0x2e7bf2[_0x437a('0x85')]=_0x437a('0x98');_0x2e7bf2[_0x437a('0x91')]=!![];_0x2e7bf2[_0x437a('0x99')]='FORWARD';_0x2e7bf2['transferexten']=_0x280307[_0x437a('0x9a')];_0x2e7bf2[_0x437a('0x9b')]=_0x280307[_0x437a('0x47')];logger[_0x437a('0x6e')](_0x437a('0x9c'),_0x2e7bf2[_0x437a('0x4a')],_0x2e7bf2['type']);var _0x2abbe4=this[_0x437a('0xd')][_0x280307[_0x437a('0x96')]];this[_0x437a('0xd')][_0x280307[_0x437a('0x96')]]=this[_0x437a('0xd')][_0x280307[_0x437a('0x47')]];this[_0x437a('0xd')][_0x280307[_0x437a('0x47')]]=_0x2abbe4;}}else{_0x1b7be4['queuecallerexitreason']=_0x437a('0x9d')+_0x280307['reason']['toUpperCase']();logger[_0x437a('0x6e')](_0x437a('0x9e'),_0x1b7be4['name'],_0x1b7be4[_0x437a('0x50')],_0x1b7be4[_0x437a('0x85')]);}}}this[_0x437a('0x36')][_0x280307['uniqueid']]=_0x1b7be4;this['emitVoiceQueueChannelRemove'](_0x1b7be4,_0x437a('0x9f'));}}}catch(_0x14b933){logger[_0x437a('0x3a')]('[%s][voiceQueueReport][agentcomplete]',_0x280307[_0x437a('0x47')],util['inspect'](_0x14b933,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x437a('0xa0')]=function(_0x3db04e){try{if(this[_0x437a('0x6b')](_0x3db04e)){logger[_0x437a('0x45')](_0x437a('0xa1'),_0x3db04e[_0x437a('0x47')],util[_0x437a('0x3c')](_0x3db04e,{'showHidden':![],'depth':null}));this[_0x437a('0xa2')](_0x3db04e['uniqueid'],_[_0x437a('0xa3')](_0x3db04e[_0x437a('0xa4')])[0x0],_0x3db04e[_0x437a('0xa5')]);if(this[_0x437a('0xd')][_0x3db04e[_0x437a('0x47')]]){var _0x507970=_[_0x437a('0x7e')](this[_0x437a('0xd')][_0x3db04e[_0x437a('0x47')]]);if(_0x507970){if(this[_0x437a('0x6b')](_0x3db04e[_0x437a('0xa4')])&&this[_0x437a('0x6b')](_0x3db04e[_0x437a('0xa4')]['queuestatus'])){switch(_0x3db04e[_0x437a('0xa5')]){case _0x437a('0xa6'):_0x507970[_0x437a('0x8f')]=![];_0x507970[_0x437a('0x90')]=null;break;case _0x437a('0xa7'):_0x507970[_0x437a('0xa8')]='timeout';_0x507970[_0x437a('0x8f')]=!![];_0x507970['queuecallerexitAt']=moment()[_0x437a('0x48')](_0x437a('0x84'));_0x507970[_0x437a('0xa9')]=moment()[_0x437a('0x48')](_0x437a('0x84'));logger[_0x437a('0x45')](_0x437a('0xaa'),_0x3db04e[_0x437a('0x47')],util[_0x437a('0x3c')](_0x507970,{'showHidden':![],'depth':null}));ami[_0x437a('0x43')](_0x437a('0xab'),_0x507970);break;default:_0x507970['queuecallerexit']=!![];_0x507970[_0x437a('0x90')]=moment()[_0x437a('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x507970[_0x437a('0xa9')]=moment()['format'](_0x437a('0x84'));}_0x507970[_0x437a('0x1a')]=![];_0x507970[_0x437a('0x83')]=null;_0x507970[_0x437a('0x85')]=_0x3db04e[_0x437a('0xa5')];this[_0x437a('0x36')][_0x3db04e[_0x437a('0x47')]]=_0x507970;this[_0x437a('0x41')](_0x507970,'varset');}else if(this[_0x437a('0x6b')](_0x3db04e['variable'])&&this[_0x437a('0x6b')](_0x3db04e[_0x437a('0xa4')]['queueposition'])){if(!_0x507970[_0x437a('0x1a')]){_0x507970[_0x437a('0x8f')]=!![];_0x507970[_0x437a('0x90')]=moment()[_0x437a('0x48')](_0x437a('0x84'));_0x507970['queuecallerexitreason']='EXITWITHKEY';_0x507970[_0x437a('0xa9')]=moment()[_0x437a('0x48')](_0x437a('0x84'));this['channels'][_0x3db04e[_0x437a('0x47')]]=_0x507970;}}logger[_0x437a('0x6e')](_0x437a('0xac'),_0x3db04e[_0x437a('0x47')],_0x507970['name'],_0x507970['type'],_['keys'](_0x3db04e['variable'])[0x0],_0x3db04e['value']);_0x507970[_0x437a('0x13')]=this['variables'][_0x3db04e[_0x437a('0x47')]];}}}}catch(_0x15f2da){logger[_0x437a('0x3a')]('[%s][voiceQueueReport][varset]',_0x3db04e[_0x437a('0x47')],util[_0x437a('0x3c')](_0x15f2da,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x437a('0xa2')]=function(_0x33e300,_0x19a4d9,_0x425137){var _0x4747f7=['rtpaudioqos',_0x437a('0xad'),'rtpaudioqosjitter',_0x437a('0xae'),'rtpaudioqosloss',_0x437a('0xaf'),_0x437a('0xb0'),_0x437a('0xb1'),'sipcallid',_0x437a('0xb2'),_0x437a('0xb3'),_0x437a('0xb4'),'membercalls',_0x437a('0xb5'),_0x437a('0xb6'),'memberlastcall',_0x437a('0x8e'),_0x437a('0xb7'),_0x437a('0xb8')];if(!_['isNil'](_0x19a4d9)&&!_[_0x437a('0xb9')](_0x4747f7,_0x19a4d9)){if(_[_0x437a('0x64')](this['variables'][_0x33e300])){this['variables'][_0x33e300]={};}this[_0x437a('0x13')][_0x33e300][_0x19a4d9]=_0x425137;}};VoiceQueueReport[_0x437a('0x32')]['syncHangup']=function(_0x34f7b8){try{if(this['isNotNull'](_0x34f7b8)){logger[_0x437a('0x45')](_0x437a('0xba'),_0x34f7b8[_0x437a('0x47')],util[_0x437a('0x3c')](_0x34f7b8,{'showHidden':![],'depth':null}));if(this[_0x437a('0xd')][_0x34f7b8[_0x437a('0x47')]]){for(var _0x105999=0x0,_0x1442c9={};_0x105999=0x0?moment(_0x53309f[_0x62a8('0x1a')])[_0x62a8('0xf')](_0x53309f[_0x62a8('0x19')],_0x62a8('0x10')):null,'data1':_0x62a8('0x1b'),'data2':_0x53309f[_0x62a8('0x14')],'data3':_0x53309f['exten'],'data4':_0x53309f[_0x62a8('0x1c')]||null,'role':'agent','internal':_0x53309f[_0x62a8('0x14')]?_[_0x62a8('0x15')](_0x53309f[_0x62a8('0x14')]):undefined,'uniqueid':_0x53309f[_0x62a8('0x16')]},'log':_0x62a8('0x6')});}; \ No newline at end of file +var _0x0b76=['voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','agent','accountcode','uniqueid','membername','starttime','endtime','seconds','outbound','dialstring','toNumber','moment','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport'];(function(_0x311192,_0x39ec99){var _0x45c239=function(_0x1736a6){while(--_0x1736a6){_0x311192['push'](_0x311192['shift']());}};_0x45c239(++_0x39ec99);}(_0x0b76,0x10f));var _0x60b7=function(_0x40b913,_0x51639d){_0x40b913=_0x40b913-0x0;var _0x367899=_0x0b76[_0x40b913];return _0x367899;};'use strict';var moment=require(_0x60b7('0x0'));var _=require(_0x60b7('0x1'));var util=require(_0x60b7('0x2'));var client=require('../client');exports[_0x60b7('0x3')]=function(_0x3d916a){var _0xee9f62=_0x3d916a[_0x60b7('0x4')]||_0x3d916a[_0x60b7('0x5')];return client[_0x60b7('0x6')](_0x60b7('0x7'),{'body':{'channel':_0x60b7('0x8'),'membername':_0x3d916a[_0x60b7('0x9')],'interface':_[_0x60b7('0xa')](_0x3d916a[_0x60b7('0xb')])?util[_0x60b7('0xc')](_0x60b7('0xd'),_0x3d916a[_0x60b7('0x9')]):_0x3d916a['interface'],'type':_0x60b7('0xe'),'enterAt':_0x3d916a[_0x60b7('0xf')],'exitAt':_0xee9f62,'duration':moment(_0xee9f62)[_0x60b7('0x10')](_0x3d916a[_0x60b7('0xf')],'seconds'),'data1':_0x60b7('0x11'),'data2':_0x3d916a[_0x60b7('0x12')],'data3':_0x3d916a[_0x60b7('0x13')],'data4':null,'data5':_0x3d916a[_0x60b7('0x14')],'role':_0x60b7('0x15'),'internal':_0x3d916a[_0x60b7('0x16')]?_['toNumber'](_0x3d916a[_0x60b7('0x16')]):undefined,'uniqueid':_0x3d916a[_0x60b7('0x17')]},'log':_0x60b7('0x7')});};exports['voiceDialReport']=function(_0x10ef42){return client[_0x60b7('0x6')](_0x60b7('0x7'),{'body':{'channel':_0x60b7('0x8'),'membername':_0x10ef42[_0x60b7('0x18')],'interface':_0x10ef42['interface'],'type':_0x60b7('0xe'),'enterAt':_0x10ef42[_0x60b7('0x19')],'exitAt':_0x10ef42[_0x60b7('0x1a')],'duration':moment(_0x10ef42[_0x60b7('0x1a')])['diff'](_0x10ef42[_0x60b7('0x19')],_0x60b7('0x1b'))>=0x0?moment(_0x10ef42['endtime'])['diff'](_0x10ef42[_0x60b7('0x19')],_0x60b7('0x1b')):null,'data1':_0x60b7('0x1c'),'data2':_0x10ef42['accountcode'],'data3':_0x10ef42[_0x60b7('0x13')],'data4':_0x10ef42[_0x60b7('0x1d')]||null,'role':_0x60b7('0x15'),'internal':_0x10ef42[_0x60b7('0x16')]?_[_0x60b7('0x1e')](_0x10ef42['accountcode']):undefined,'uniqueid':_0x10ef42[_0x60b7('0x17')]},'log':_0x60b7('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 54ef97f..5032fb7 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 _0x4849=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','GetSettings'];(function(_0x11579b,_0x47a336){var _0x1ed761=function(_0x2b5353){while(--_0x2b5353){_0x11579b['push'](_0x11579b['shift']());}};_0x1ed761(++_0x47a336);}(_0x4849,0x181));var _0x9484=function(_0x320f6d,_0x38f00f){_0x320f6d=_0x320f6d-0x0;var _0x50effc=_0x4849[_0x320f6d];return _0x50effc;};'use strict';var client=require('../client');exports[_0x9484('0x0')]=function(){return client[_0x9484('0x1')](_0x9484('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9484('0x3')]},'log':_0x9484('0x4')});}; \ No newline at end of file +var _0x0b30=['ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings','Request'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x0b30,0x1a7));var _0x00b3=function(_0xc70310,_0x4c6be0){_0xc70310=_0xc70310-0x0;var _0x535a4f=_0x0b30[_0xc70310];return _0x535a4f;};'use strict';var client=require(_0x00b3('0x0'));exports[_0x00b3('0x1')]=function(){return client[_0x00b3('0x2')](_0x00b3('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x00b3('0x4')]},'log':_0x00b3('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index a732d61..62f9762 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 _0xbd8e=['getTemplates','Request','name','html','GetTemplate','../client'];(function(_0xc06df3,_0x4ebe01){var _0x3b15d9=function(_0x40ce6c){while(--_0x40ce6c){_0xc06df3['push'](_0xc06df3['shift']());}};_0x3b15d9(++_0x4ebe01);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xbd8e[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0xebd8('0x0'));exports[_0xebd8('0x1')]=function(_0x49fbe9){return function(_0x5b8459){return client[_0xebd8('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xebd8('0x3'),_0xebd8('0x4')]},'log':_0xebd8('0x5')});};}; \ No newline at end of file +var _0xceda=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x5a6a80,_0x466b3f){var _0xb468de=function(_0x2fa9ab){while(--_0x2fa9ab){_0x5a6a80['push'](_0x5a6a80['shift']());}};_0xb468de(++_0x466b3f);}(_0xceda,0x1c4));var _0xaced=function(_0x4132ae,_0x5d8c08){_0x4132ae=_0x4132ae-0x0;var _0x210763=_0xceda[_0x4132ae];return _0x210763;};'use strict';var client=require(_0xaced('0x0'));exports[_0xaced('0x1')]=function(_0x4ab563){return function(_0x261f5e){return client[_0xaced('0x2')](_0xaced('0x3'),{'options':{'raw':!![],'attributes':['id',_0xaced('0x4'),_0xaced('0x5')]},'log':_0xaced('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 95df47b..d3649a6 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 _0x0602=['Action','Actions','action','data2','data3','data4','data5','data6','GetTrigger','../client','getTriggers','Request','name','channel','status','field','operator','value','Condition','AnyConditions'];(function(_0x4a96c5,_0xecf580){var _0x5d8dfd=function(_0x27fcd6){while(--_0x27fcd6){_0x4a96c5['push'](_0x4a96c5['shift']());}};_0x5d8dfd(++_0xecf580);}(_0x0602,0xa9));var _0x2060=function(_0x3f7e43,_0x4d3a03){_0x3f7e43=_0x3f7e43-0x0;var _0x2bf962=_0x0602[_0x3f7e43];return _0x2bf962;};'use strict';var client=require(_0x2060('0x0'));exports[_0x2060('0x1')]=function(_0x43b47e){return function(_0x256d18){return client[_0x2060('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x2060('0x3'),_0x2060('0x4'),_0x2060('0x5')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x2060('0x6'),_0x2060('0x7'),_0x2060('0x8')]},{'model':_0x2060('0x9'),'as':_0x2060('0xa'),'attributes':['id','field',_0x2060('0x7'),_0x2060('0x8')]},{'model':_0x2060('0xb'),'as':_0x2060('0xc'),'attributes':['id',_0x2060('0xd'),'data1',_0x2060('0xe'),_0x2060('0xf'),_0x2060('0x10'),_0x2060('0x11'),_0x2060('0x12'),'data7']}]},'log':_0x2060('0x13')});};}; \ No newline at end of file +var _0xd6af=['AllConditions','field','operator','Condition','AnyConditions','value','Action','Actions','action','data3','data4','data5','data6','data7','../client','getTriggers','GetTrigger','name','status'];(function(_0x7a7770,_0xc7970e){var _0x131a0e=function(_0x165ad2){while(--_0x165ad2){_0x7a7770['push'](_0x7a7770['shift']());}};_0x131a0e(++_0xc7970e);}(_0xd6af,0xa6));var _0xfd6a=function(_0x25f334,_0x44aab9){_0x25f334=_0x25f334-0x0;var _0x11fb6e=_0xd6af[_0x25f334];return _0x11fb6e;};'use strict';var client=require(_0xfd6a('0x0'));exports[_0xfd6a('0x1')]=function(_0x3a71d5){return function(_0xbbfcfb){return client['Request'](_0xfd6a('0x2'),{'options':{'raw':![],'attributes':['id',_0xfd6a('0x3'),'channel',_0xfd6a('0x4')],'include':[{'model':'Condition','as':_0xfd6a('0x5'),'attributes':['id',_0xfd6a('0x6'),_0xfd6a('0x7'),'value']},{'model':_0xfd6a('0x8'),'as':_0xfd6a('0x9'),'attributes':['id','field',_0xfd6a('0x7'),_0xfd6a('0xa')]},{'model':_0xfd6a('0xb'),'as':_0xfd6a('0xc'),'attributes':['id',_0xfd6a('0xd'),'data1','data2',_0xfd6a('0xe'),_0xfd6a('0xf'),_0xfd6a('0x10'),_0xfd6a('0x11'),_0xfd6a('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 ef68e24..db827ef 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 _0x37dc=['registry','../client','getTrunks','GetTrunk'];(function(_0x651e0b,_0x26be9d){var _0x1e7a27=function(_0x3c9f87){while(--_0x3c9f87){_0x651e0b['push'](_0x651e0b['shift']());}};_0x1e7a27(++_0x26be9d);}(_0x37dc,0x1e9));var _0xc37d=function(_0x9e025b,_0x182778){_0x9e025b=_0x9e025b-0x0;var _0x540da9=_0x37dc[_0x9e025b];return _0x540da9;};'use strict';var client=require(_0xc37d('0x0'));exports[_0xc37d('0x1')]=function(_0x1d9c50){return function(_0x409805){return client['Request'](_0xc37d('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xc37d('0x3'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x64b3=['GetTrunk','registry','defaultuser','../client','Request'];(function(_0xd60d7e,_0x58aaf5){var _0xa4a3fa=function(_0x3cbfc1){while(--_0x3cbfc1){_0xd60d7e['push'](_0xd60d7e['shift']());}};_0xa4a3fa(++_0x58aaf5);}(_0x64b3,0x1de));var _0x364b=function(_0x14839f,_0x2d6011){_0x14839f=_0x14839f-0x0;var _0x3678c0=_0x64b3[_0x14839f];return _0x3678c0;};'use strict';var client=require(_0x364b('0x0'));exports['getTrunks']=function(_0x49a796){return function(_0x41a472){return client[_0x364b('0x1')](_0x364b('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x364b('0x3'),_0x364b('0x4')]},'log':_0x364b('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 30b8868..967481f 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x33c939,_0x233816){var _0x377393=function(_0x5edede){while(--_0x5edede){_0x33c939['push'](_0x33c939['shift']());}};_0x377393(++_0x233816);}(_0xedd9,0xfc));var _0x9edd=function(_0x37e775,_0x3bb1c6){_0x37e775=_0x37e775-0x0;var _0x3c1ab5=_0xedd9[_0x37e775];return _0x3c1ab5;};'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 +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe706,0xa3));var _0x6e70=function(_0x50c96f,_0x2ee009){_0x50c96f=_0x50c96f-0x0;var _0x38fcf2=_0xe706[_0x50c96f];return _0x38fcf2;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 9eebd2f..0c18c8a 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 _0x09b3=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x2c50e4,_0x15cd2f){var _0x474118=function(_0xb0201){while(--_0xb0201){_0x2c50e4['push'](_0x2c50e4['shift']());}};_0x474118(++_0x15cd2f);}(_0x09b3,0x1a4));var _0x309b=function(_0x3f6269,_0x3fd5ea){_0x3f6269=_0x3f6269-0x0;var _0x58f14d=_0x09b3[_0x3f6269];return _0x58f14d;};'use strict';var client=require(_0x309b('0x0'));exports[_0x309b('0x1')]=function(_0x563772){return client[_0x309b('0x2')]('CreateVoiceAgentReport',{'body':_0x563772,'log':_0x309b('0x3')});};exports[_0x309b('0x4')]=function(_0xc3c467,_0x48506d,_0x1c1300){return client[_0x309b('0x2')](_0x309b('0x5'),{'body':_0xc3c467,'options':{'where':{'uniqueid':_0x48506d,'interface':_0x1c1300,'agentcomplete':!![]}},'log':_0x309b('0x5')});}; \ No newline at end of file +var _0x35a8=['CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x935ec0,_0x42e171){var _0x36e898=function(_0x2b768a){while(--_0x2b768a){_0x935ec0['push'](_0x935ec0['shift']());}};_0x36e898(++_0x42e171);}(_0x35a8,0x18c));var _0x835a=function(_0x5c0064,_0x53f78c){_0x5c0064=_0x5c0064-0x0;var _0x4db306=_0x35a8[_0x5c0064];return _0x4db306;};'use strict';var client=require('../client');exports['create']=function(_0x38eef3){return client['Request']('CreateVoiceAgentReport',{'body':_0x38eef3,'log':_0x835a('0x0')});};exports[_0x835a('0x1')]=function(_0xf0db1c,_0x2c3e5b,_0xd7d4d3){return client[_0x835a('0x2')](_0x835a('0x3'),{'body':_0xf0db1c,'options':{'where':{'uniqueid':_0x2c3e5b,'interface':_0xd7d4d3,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 5ee74c2..8eb655a 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 _0xdb4e=['outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x185832,_0x53aeea){var _0x253dda=function(_0x5791c7){while(--_0x5791c7){_0x185832['push'](_0x185832['shift']());}};_0x253dda(++_0x53aeea);}(_0xdb4e,0x1d6));var _0xedb4=function(_0x15a345,_0x2e79b6){_0x15a345=_0x15a345-0x0;var _0x315b49=_0xdb4e[_0x15a345];return _0x315b49;};'use strict';var moment=require(_0xedb4('0x0'));var util=require(_0xedb4('0x1'));var _=require(_0xedb4('0x2'));var client=require(_0xedb4('0x3'));exports['create']=function(_0x374359){return client[_0xedb4('0x4')](_0xedb4('0x5'),{'body':_[_0xedb4('0x6')](_0x374359,{'source':_0x374359[_0xedb4('0x7')],'destinationcontext':_0x374359[_0xedb4('0x8')],'callerid':_0x374359[_0xedb4('0x9')],'amaflags':_0xedb4('0xa')}),'log':_0xedb4('0x5')});};exports[_0xedb4('0xb')]=function(){return function(){return client[_0xedb4('0x4')](_0xedb4('0xc'),{'options':{'where':{'type':[_0xedb4('0xd')],'createdAt':{'$between':[moment()[_0xedb4('0xe')](_0xedb4('0xf'))[_0xedb4('0x10')](_0xedb4('0x11')),moment()[_0xedb4('0x12')]('day')[_0xedb4('0x10')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xedb4('0x13'),_0xedb4('0x14'),_0xedb4('0x15'),'billableseconds']},'log':_0xedb4('0x16')});};}; \ No newline at end of file +var _0xf43f=['endOf','duration','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf43f,0x82));var _0xff43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf43f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xff43('0x0'));var util=require(_0xff43('0x1'));var _=require('lodash');var client=require(_0xff43('0x2'));exports[_0xff43('0x3')]=function(_0x3ee906){return client[_0xff43('0x4')](_0xff43('0x5'),{'body':_[_0xff43('0x6')](_0x3ee906,{'source':_0x3ee906[_0xff43('0x7')],'destinationcontext':_0x3ee906[_0xff43('0x8')],'callerid':_0x3ee906[_0xff43('0x9')],'amaflags':_0xff43('0xa')}),'log':_0xff43('0x5')});};exports[_0xff43('0xb')]=function(){return function(){return client[_0xff43('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xff43('0xc')],'createdAt':{'$between':[moment()[_0xff43('0xd')](_0xff43('0xe'))[_0xff43('0xf')](_0xff43('0x10')),moment()[_0xff43('0x11')](_0xff43('0xe'))[_0xff43('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0xff43('0x12'),_0xff43('0x13')]},'log':_0xff43('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index b8f89be..e6b7a43 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 _0x2b04=['create','CreateVoiceDialReport','../client'];(function(_0x21eef2,_0x1480ea){var _0x32f106=function(_0x409e7e){while(--_0x409e7e){_0x21eef2['push'](_0x21eef2['shift']());}};_0x32f106(++_0x1480ea);}(_0x2b04,0x9e));var _0x42b0=function(_0x39cc44,_0x416e62){_0x39cc44=_0x39cc44-0x0;var _0x20c8dc=_0x2b04[_0x39cc44];return _0x20c8dc;};'use strict';var client=require(_0x42b0('0x0'));exports[_0x42b0('0x1')]=function(_0x11ece2){return client['Request']('CreateVoiceDialReport',{'body':_0x11ece2,'log':_0x42b0('0x2')});}; \ No newline at end of file +var _0xb545=['CreateVoiceDialReport','../client'];(function(_0xe719ec,_0x5a280e){var _0x4842a1=function(_0x59b968){while(--_0x59b968){_0xe719ec['push'](_0xe719ec['shift']());}};_0x4842a1(++_0x5a280e);}(_0xb545,0x135));var _0x5b54=function(_0x476392,_0x43d678){_0x476392=_0x476392-0x0;var _0x25d9f4=_0xb545[_0x476392];return _0x25d9f4;};'use strict';var client=require(_0x5b54('0x0'));exports['create']=function(_0xf4b48b){return client['Request']('CreateVoiceDialReport',{'body':_0xf4b48b,'log':_0x5b54('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 86552c2..bac53c1 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 _0x7d98=['recordingFormat','../client','Request','GetVoiceExtension','exten'];(function(_0x5175d8,_0x3dff89){var _0x59e2ad=function(_0x24c475){while(--_0x24c475){_0x5175d8['push'](_0x5175d8['shift']());}};_0x59e2ad(++_0x3dff89);}(_0x7d98,0xe7));var _0x87d9=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0x7d98[_0x555069];return _0x100af7;};'use strict';var client=require(_0x87d9('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x87d9('0x1')](_0x87d9('0x2'),{'options':{'raw':!![],'attributes':['id',_0x87d9('0x3'),_0x87d9('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x71f4=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','Request'];(function(_0x2576bf,_0x5c99fb){var _0x10fde1=function(_0x2bc7e6){while(--_0x2bc7e6){_0x2576bf['push'](_0x2576bf['shift']());}};_0x10fde1(++_0x5c99fb);}(_0x71f4,0xf9));var _0x471f=function(_0x1bdaf5,_0x22045a){_0x1bdaf5=_0x1bdaf5-0x0;var _0x2af1f2=_0x71f4[_0x1bdaf5];return _0x2af1f2;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x471f('0x0')](_0x471f('0x1'),{'options':{'raw':!![],'attributes':['id',_0x471f('0x2'),_0x471f('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x471f('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index acce6aa..b5e6201 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 _0x54d4=['interval','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','TrunkBackup','callerid','Interval','Intervals'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x54d4,0xf5));var _0x454d=function(_0x41acd2,_0x36cc66){_0x41acd2=_0x41acd2-0x0;var _0x4813fe=_0x54d4[_0x41acd2];return _0x4813fe;};'use strict';var client=require('../client');exports[_0x454d('0x0')]=function(){return function(){return client['Request'](_0x454d('0x1'),{'options':{'raw':![],'attributes':['id',_0x454d('0x2'),_0x454d('0x3'),_0x454d('0x4'),_0x454d('0x5'),_0x454d('0x6'),_0x454d('0x7'),'dialActive',_0x454d('0x8'),_0x454d('0x9'),_0x454d('0xa'),_0x454d('0xb'),'dialPredictiveOptimization',_0x454d('0xc'),_0x454d('0xd'),_0x454d('0xe'),'dialOriginateCallerIdNumber',_0x454d('0xf'),_0x454d('0x10'),'dialQueueTimeout',_0x454d('0x11'),'dialCongestionMaxRetry',_0x454d('0x12'),_0x454d('0x13'),_0x454d('0x14'),'dialNoAnswerMaxRetry',_0x454d('0x15'),'dialGlobalMaxRetry',_0x454d('0x16'),_0x454d('0x17'),_0x454d('0x18'),'dialCheckDuplicateType',_0x454d('0x19'),_0x454d('0x1a'),_0x454d('0x1b'),_0x454d('0x1c'),'dialAMDTotalAnalysisTime',_0x454d('0x1d'),'dialAMDBetweenWordsSilence',_0x454d('0x1e'),_0x454d('0x1f'),_0x454d('0x20'),_0x454d('0x21'),_0x454d('0x22'),_0x454d('0x23'),_0x454d('0x24'),_0x454d('0x25'),_0x454d('0x26'),_0x454d('0x27'),_0x454d('0x6'),_0x454d('0x28'),_0x454d('0x29'),_0x454d('0x2a'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0x454d('0x2b'),_0x454d('0x2c'),_0x454d('0x2d'),_0x454d('0x2e'),_0x454d('0x2f'),_0x454d('0x30'),_0x454d('0x31'),_0x454d('0x32'),_0x454d('0x33'),'dialPredictiveIntervalMaxThreshold',_0x454d('0x34')],'include':[{'model':_0x454d('0x35'),'as':'Trunk','attributes':['id',_0x454d('0x2'),'callerid',_0x454d('0x36')]},{'model':_0x454d('0x37'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':_0x454d('0x38'),'attributes':['id',_0x454d('0x2'),_0x454d('0x39'),_0x454d('0x36')]},{'model':_0x454d('0x3a'),'as':'Interval','attributes':['id',_0x454d('0x2')],'include':[{'model':'Interval','as':_0x454d('0x3b'),'attributes':['id','name',_0x454d('0x3c')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xdf1a=['interval','../client','getVoiceQueues','name','acwTimeout','autopause','monitor_format','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdf1a,0x1b9));var _0xadf1=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0xdf1a[_0x919445];return _0x511b3e;};'use strict';var client=require(_0xadf1('0x0'));exports[_0xadf1('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xadf1('0x2'),'acw',_0xadf1('0x3'),_0xadf1('0x4'),_0xadf1('0x5'),'type','dialActive','dialMethod','dialLimitChannel',_0xadf1('0x6'),_0xadf1('0x7'),_0xadf1('0x8'),'dialPredictiveOptimizationPercentage',_0xadf1('0x9'),_0xadf1('0xa'),_0xadf1('0xb'),_0xadf1('0xc'),'dialQueueOptions',_0xadf1('0xd'),'dialQueueProject',_0xadf1('0xe'),_0xadf1('0xf'),_0xadf1('0x10'),_0xadf1('0x11'),_0xadf1('0x12'),'dialNoAnswerRetryFrequency',_0xadf1('0x13'),_0xadf1('0x14'),'dialGlobalInterval',_0xadf1('0x15'),_0xadf1('0x16'),'dialAMDActive',_0xadf1('0x17'),'dialAMDGreeting',_0xadf1('0x18'),_0xadf1('0x19'),_0xadf1('0x1a'),_0xadf1('0x1b'),_0xadf1('0x1c'),_0xadf1('0x1d'),_0xadf1('0x1e'),_0xadf1('0x1f'),_0xadf1('0x20'),_0xadf1('0x21'),_0xadf1('0x22'),_0xadf1('0x23'),'dialAgiAfterHangupClient','dialQueueProject2',_0xadf1('0x5'),_0xadf1('0x24'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xadf1('0x25'),_0xadf1('0x26'),'dialDropMaxRetry',_0xadf1('0x27'),'dialAbandonedMaxRetry',_0xadf1('0x28'),_0xadf1('0x29'),_0xadf1('0x2a'),_0xadf1('0x2b'),_0xadf1('0x2c'),_0xadf1('0x2d'),'dialPredictiveIntervalMaxThreshold',_0xadf1('0x2e')],'include':[{'model':_0xadf1('0x2f'),'as':_0xadf1('0x2f'),'attributes':['id','name',_0xadf1('0x30'),_0xadf1('0x31')]},{'model':_0xadf1('0x32'),'as':_0xadf1('0x33'),'attributes':['id',_0xadf1('0x2')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id','name','callerid',_0xadf1('0x31')]},{'model':_0xadf1('0x34'),'as':'Interval','attributes':['id',_0xadf1('0x2')],'include':[{'model':_0xadf1('0x34'),'as':_0xadf1('0x35'),'attributes':['id',_0xadf1('0x2'),_0xadf1('0x36')]}]}]},'log':_0xadf1('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index faf3a49..e3e6409 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(_0x56272b,_0xde68f2){var _0x27e3ef=function(_0x57cbdd){while(--_0x57cbdd){_0x56272b['push'](_0x56272b['shift']());}};_0x27e3ef(++_0xde68f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x4e52f8,_0x308a08){var _0x5c00dc=function(_0x22ccaa){while(--_0x22ccaa){_0x4e52f8['push'](_0x4e52f8['shift']());}};_0x5c00dc(++_0x308a08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 7c5e51b..5a50ce8 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 _0x2e18=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x5f7a5f,_0x2435a6){var _0x46584c=function(_0x50058d){while(--_0x50058d){_0x5f7a5f['push'](_0x5f7a5f['shift']());}};_0x46584c(++_0x2435a6);}(_0x2e18,0x10a));var _0x82e1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2e18[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0x82e1('0x0'));exports[_0x82e1('0x1')]=function(_0x4cc072){return function(){return client[_0x82e1('0x2')](_0x82e1('0x3'),{'options':{'where':{'VoiceQueueId':_0x4cc072,'paused':!![]},'raw':!![]},'log':_0x82e1('0x1')});};}; \ No newline at end of file +var _0xc729=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x47e92b,_0x29e3b5){var _0x2da694=function(_0x312ce0){while(--_0x312ce0){_0x47e92b['push'](_0x47e92b['shift']());}};_0x2da694(++_0x29e3b5);}(_0xc729,0x12b));var _0x9c72=function(_0x3c06e2,_0x247e9d){_0x3c06e2=_0x3c06e2-0x0;var _0x3eb59f=_0xc729[_0x3c06e2];return _0x3eb59f;};'use strict';var client=require(_0x9c72('0x0'));exports[_0x9c72('0x1')]=function(_0x47ded0){return function(){return client['Request'](_0x9c72('0x2'),{'options':{'where':{'VoiceQueueId':_0x47ded0,'paused':!![]},'raw':!![]},'log':_0x9c72('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index e361c4c..d13dc1c 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(_0x54b7e6,_0xc0136a){var _0xfe9536=function(_0x1558ca){while(--_0x1558ca){_0x54b7e6['push'](_0x54b7e6['shift']());}};_0xfe9536(++_0xc0136a);}(_0x7a54,0x106));var _0x47a5=function(_0x536542,_0x399275){_0x536542=_0x536542-0x0;var _0x6e7762=_0x7a54[_0x536542];return _0x6e7762;};'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(_0x2a5b78,_0x5074e2){var _0x5e05df=function(_0x5d1ae6){while(--_0x5d1ae6){_0x2a5b78['push'](_0x2a5b78['shift']());}};_0x5e05df(++_0x5074e2);}(_0x7a54,0x106));var _0x47a5=function(_0x55fe8b,_0xe4ca39){_0x55fe8b=_0x55fe8b-0x0;var _0x109c1e=_0x7a54[_0x55fe8b];return _0x109c1e;};'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 8eb036a..dcb1ba4 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 _0x669c=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x12f570,_0x2bdad1){var _0x820efc=function(_0xb209d7){while(--_0xb209d7){_0x12f570['push'](_0x12f570['shift']());}};_0x820efc(++_0x2bdad1);}(_0x669c,0x1ec));var _0xc669=function(_0x4d9672,_0x1a6f25){_0x4d9672=_0x4d9672-0x0;var _0x95d0e9=_0x669c[_0x4d9672];return _0x95d0e9;};'use strict';var client=require(_0xc669('0x0'));exports[_0xc669('0x1')]={};exports[_0xc669('0x2')]=function(_0x5104a9){return client['Request'](_0xc669('0x3'),{'body':{'result':_0x5104a9[_0xc669('0x4')],'transfererchannel':_0x5104a9[_0xc669('0x5')],'transferercalleridnum':_0x5104a9[_0xc669('0x6')],'transferercalleridname':_0x5104a9[_0xc669('0x7')],'transfererconnectedlinenum':_0x5104a9[_0xc669('0x8')],'transfererconnectedlinename':_0x5104a9[_0xc669('0x9')],'transfereraccountcode':_0x5104a9[_0xc669('0xa')],'transferercontext':_0x5104a9['transferercontext'],'transfererexten':_0x5104a9[_0xc669('0xb')],'transfererlinkedid':_0x5104a9[_0xc669('0xc')],'transfereechannel':_0x5104a9[_0xc669('0xd')],'transfereecalleridnum':_0x5104a9[_0xc669('0xe')],'transfereecalleridname':_0x5104a9['transfereecalleridname'],'transfereeconnectedlinenum':_0x5104a9['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x5104a9[_0xc669('0xf')],'transfereeaccountcode':_0x5104a9[_0xc669('0x10')],'transfereecontext':_0x5104a9[_0xc669('0x11')],'transfereeexten':_0x5104a9[_0xc669('0x12')],'transfereelinkedid':_0x5104a9[_0xc669('0x13')],'isexternal':_0x5104a9[_0xc669('0x14')],'context':_0x5104a9[_0xc669('0x15')],'extension':_0x5104a9[_0xc669('0x16')],'type':_0xc669('0x17')},'log':_0xc669('0x3')});};exports[_0xc669('0x18')]=function(_0x536817){return client[_0xc669('0x19')](_0xc669('0x3'),{'body':{'result':_0x536817[_0xc669('0x4')],'transfererchannel':_0x536817['origtransfererchannel'],'transferercalleridnum':_0x536817[_0xc669('0x1a')],'transferercalleridname':_0x536817['origtransferercalleridname'],'transfererconnectedlinenum':_0x536817[_0xc669('0x1b')],'transfererconnectedlinename':_0x536817[_0xc669('0x1c')],'transfereraccountcode':_0x536817[_0xc669('0x1d')],'transferercontext':_0x536817[_0xc669('0x1e')],'transfererexten':_0x536817[_0xc669('0x1f')],'transfererlinkedid':_0x536817[_0xc669('0x20')],'transfereechannel':_0x536817[_0xc669('0x21')],'transfereecalleridnum':_0x536817[_0xc669('0x22')],'transfereecalleridname':_0x536817[_0xc669('0x23')],'transfereeconnectedlinenum':_0x536817[_0xc669('0x24')],'transfereeconnectedlinename':_0x536817[_0xc669('0x25')],'transfereeaccountcode':_0x536817[_0xc669('0x26')],'transfereecontext':_0x536817[_0xc669('0x27')],'transfereeexten':_0x536817[_0xc669('0x28')],'transfereelinkedid':_0x536817[_0xc669('0x29')],'isexternal':_0x536817[_0xc669('0x14')],'context':_0x536817[_0xc669('0x2a')],'extension':_0x536817[_0xc669('0x2b')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x14d2=['transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','attendedTransfer','Request','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid'];(function(_0x41a652,_0x1b41d5){var _0x397ba5=function(_0x2cc18d){while(--_0x2cc18d){_0x41a652['push'](_0x41a652['shift']());}};_0x397ba5(++_0x1b41d5);}(_0x14d2,0x15a));var _0x214d=function(_0x25d074,_0x1950eb){_0x25d074=_0x25d074-0x0;var _0x43c987=_0x14d2[_0x25d074];return _0x43c987;};'use strict';var client=require(_0x214d('0x0'));exports[_0x214d('0x1')]={};exports[_0x214d('0x2')]=function(_0x5f2251){return client['Request'](_0x214d('0x3'),{'body':{'result':_0x5f2251[_0x214d('0x4')],'transfererchannel':_0x5f2251[_0x214d('0x5')],'transferercalleridnum':_0x5f2251[_0x214d('0x6')],'transferercalleridname':_0x5f2251[_0x214d('0x7')],'transfererconnectedlinenum':_0x5f2251['transfererconnectedlinenum'],'transfererconnectedlinename':_0x5f2251[_0x214d('0x8')],'transfereraccountcode':_0x5f2251[_0x214d('0x9')],'transferercontext':_0x5f2251[_0x214d('0xa')],'transfererexten':_0x5f2251[_0x214d('0xb')],'transfererlinkedid':_0x5f2251[_0x214d('0xc')],'transfereechannel':_0x5f2251[_0x214d('0xd')],'transfereecalleridnum':_0x5f2251['transfereecalleridnum'],'transfereecalleridname':_0x5f2251[_0x214d('0xe')],'transfereeconnectedlinenum':_0x5f2251[_0x214d('0xf')],'transfereeconnectedlinename':_0x5f2251[_0x214d('0x10')],'transfereeaccountcode':_0x5f2251[_0x214d('0x11')],'transfereecontext':_0x5f2251[_0x214d('0x12')],'transfereeexten':_0x5f2251[_0x214d('0x13')],'transfereelinkedid':_0x5f2251[_0x214d('0x14')],'isexternal':_0x5f2251[_0x214d('0x15')],'context':_0x5f2251[_0x214d('0x16')],'extension':_0x5f2251['extension'],'type':'blind'},'log':_0x214d('0x3')});};exports[_0x214d('0x17')]=function(_0x467350){return client[_0x214d('0x18')](_0x214d('0x3'),{'body':{'result':_0x467350[_0x214d('0x4')],'transfererchannel':_0x467350['origtransfererchannel'],'transferercalleridnum':_0x467350[_0x214d('0x19')],'transferercalleridname':_0x467350[_0x214d('0x1a')],'transfererconnectedlinenum':_0x467350[_0x214d('0x1b')],'transfererconnectedlinename':_0x467350[_0x214d('0x1c')],'transfereraccountcode':_0x467350[_0x214d('0x1d')],'transferercontext':_0x467350['secondtransferercontext'],'transfererexten':_0x467350[_0x214d('0x1e')],'transfererlinkedid':_0x467350[_0x214d('0x1f')],'transfereechannel':_0x467350[_0x214d('0x20')],'transfereecalleridnum':_0x467350[_0x214d('0x21')],'transfereecalleridname':_0x467350[_0x214d('0x22')],'transfereeconnectedlinenum':_0x467350[_0x214d('0x23')],'transfereeconnectedlinename':_0x467350[_0x214d('0x24')],'transfereeaccountcode':_0x467350[_0x214d('0x25')],'transfereecontext':_0x467350[_0x214d('0x26')],'transfereeexten':_0x467350['transfertargetexten'],'transfereelinkedid':_0x467350['transfertargetlinkedid'],'isexternal':_0x467350[_0x214d('0x15')],'context':_0x467350[_0x214d('0x27')],'extension':_0x467350[_0x214d('0x28')],'type':_0x214d('0x29')},'log':_0x214d('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 94eb473..d5fd56f 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 _0x6050=['error','asterisk','username','ami\x20disconnected','join','module','action','Reload','Action','then','message','catch','pick','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','find','omit','undefined','values','channels','length','voicechannel','uniqueid','channel','%s.%s','filename','wav','MixMonitor','/var/spool/asterisk/monitor/','isNil','monitors','push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelredirect','exten','context','telephones','outboundChannels','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../properties','../ami','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected'];(function(_0x4b9a51,_0x20b5f2){var _0x18cae4=function(_0x42dff9){while(--_0x42dff9){_0x4b9a51['push'](_0x4b9a51['shift']());}};_0x18cae4(++_0x20b5f2);}(_0x6050,0x196));var _0x0605=function(_0x3e3cd7,_0x2d1b57){_0x3e3cd7=_0x3e3cd7-0x0;var _0x16b31c=_0x6050[_0x3e3cd7];return _0x16b31c;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var jayson=require(_0x0605('0x2'));var schema=require(_0x0605('0x3'));var BPromise=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var config=require('../../../config/environment');var properties=require(_0x0605('0x6'));var ami=require(_0x0605('0x7'));exports[_0x0605('0x8')]=function(_0x5797b0,_0x533b6d,_0x4aca21){return new BPromise(function(_0xd78d96,_0x578623){var _0x58f7d2={'QueuePause':function(_0x5660ad){return new Promise(function(_0x1629bf,_0x11b8b5){var _0xa08eca=util[_0x0605('0x9')](_0x0605('0xa'),'SIP',_0x5660ad[_0x0605('0xb')]);if(_0x5797b0[_0x0605('0xc')]&&_0x5797b0[_0x0605('0xc')][_0xa08eca]&&_0x5797b0[_0x0605('0xc')][_0xa08eca][_0x0605('0xd')]){_0x5797b0[_0x0605('0xc')][_0xa08eca][_0x0605('0xe')]();}if(_0x5797b0[_0x0605('0xf')][_0xa08eca]){_0x5797b0[_0x0605('0xf')][_0xa08eca][_0x0605('0x10')]({'statePause':_0x5660ad[_0x0605('0x11')]?!![]:![]});}_0x1629bf({'code':0xc8,'message':_0x0605('0x12')});});},'Reload':function(_0x34c9e6){var _0x39a115=this;return new Promise(function(_0x22c011,_0x44e793){if(ami[_0x0605('0x13')]()==![]){return _0x44e793(_0x39a115[_0x0605('0x14')](0x1f4,[config[_0x0605('0x15')]['ip'],config['asterisk'][_0x0605('0x16')],_0x0605('0x17')][_0x0605('0x18')]('\x20')));}_0x34c9e6=_['pick'](_0x34c9e6,_['keys'](properties[_0x0605('0x19')]));_0x34c9e6[_0x0605('0x1a')]=_0x0605('0x1b');return ami[_0x0605('0x1c')](_0x34c9e6)[_0x0605('0x1d')](function(_0x351dbd){_0x22c011({'code':0xc8,'message':_0x351dbd[_0x0605('0x1e')]});})[_0x0605('0x1f')](function(_0x193520){_0x44e793(_0x39a115[_0x0605('0x14')](0x1f5,_0x193520[_0x0605('0x1e')]));});});},'Command':function(_0x2fa77e){var _0x2e2204=this;return new Promise(function(_0x103952,_0x59bc87){if(ami[_0x0605('0x13')]()==![]){return _0x59bc87(_0x2e2204[_0x0605('0x14')](0x1f4,[config[_0x0605('0x15')]['ip'],config[_0x0605('0x15')][_0x0605('0x16')],_0x0605('0x17')][_0x0605('0x18')]('\x20')));}_0x2fa77e=_[_0x0605('0x20')](_0x2fa77e,_0x0605('0x21'));_0x2fa77e['action']=_0x0605('0x22');return ami['Action'](_0x2fa77e)[_0x0605('0x1d')](function(_0x118e9c){_0x103952({'code':0xc8,'message':_0x118e9c[_0x0605('0x23')]});})[_0x0605('0x1f')](function(_0x10c575){_0x59bc87(_0x2e2204[_0x0605('0x14')](0x1f5,_0x10c575[_0x0605('0x1e')]));});});},'VoiceQueues':function(_0x1ae3db){return new Promise(function(_0x234231,_0x2896d7){var _0x9f2833=[];for(var _0x1c3722 in _0x5797b0['voiceQueues']){if(_0x5797b0[_0x0605('0x24')][_0x0605('0x25')](_0x1c3722)){var _0x4b1e0c=_0x5797b0['voiceQueues'][_0x1c3722];var _0x55ebd8={'id':_0x4b1e0c['id'],'name':_0x4b1e0c[_0x0605('0xb')],'strategy':_0x4b1e0c[_0x0605('0x26')],'answered':_0x4b1e0c[_0x0605('0x27')],'available':_0x4b1e0c[_0x0605('0x28')],'loggedIn':_0x4b1e0c[_0x0605('0x29')],'pTalking':_0x4b1e0c[_0x0605('0x2a')],'sumBillable':_0x4b1e0c['sumBillable'],'sumDuration':_0x4b1e0c[_0x0605('0x2b')],'sumHoldTime':_0x4b1e0c['sumHoldTime']||0x0,'talking':_0x4b1e0c[_0x0605('0x2c')],'total':_0x4b1e0c[_0x0605('0x2d')],'type':_0x4b1e0c[_0x0605('0x2e')],'unmanaged':_0x4b1e0c[_0x0605('0x2f')],'abandoned':_0x4b1e0c[_0x0605('0x30')],'waiting':_0x4b1e0c[_0x0605('0x31')],'loggedInDb':_0x4b1e0c['loggedInDb']};if(_0x4b1e0c[_0x0605('0x2e')]===_0x0605('0x32')){_0x55ebd8[_0x0605('0x33')]=_0x4b1e0c[_0x0605('0x33')];_0x55ebd8[_0x0605('0x34')]=_0x4b1e0c[_0x0605('0x34')];_0x55ebd8[_0x0605('0x35')]=_0x4b1e0c[_0x0605('0x35')];_0x55ebd8[_0x0605('0x36')]=_0x4b1e0c[_0x0605('0x36')];_0x55ebd8[_0x0605('0x37')]=_0x4b1e0c[_0x0605('0x37')];_0x55ebd8[_0x0605('0x38')]=_0x4b1e0c[_0x0605('0x38')];_0x55ebd8[_0x0605('0x39')]=_0x4b1e0c[_0x0605('0x39')];_0x55ebd8[_0x0605('0x3a')]=_0x4b1e0c[_0x0605('0x3a')];_0x55ebd8[_0x0605('0x3b')]=_0x4b1e0c[_0x0605('0x3b')];_0x55ebd8[_0x0605('0x3c')]=_0x4b1e0c[_0x0605('0x3c')];_0x55ebd8[_0x0605('0x3d')]=_0x4b1e0c[_0x0605('0x3d')];_0x55ebd8[_0x0605('0x3e')]=_0x4b1e0c[_0x0605('0x3e')];_0x55ebd8[_0x0605('0x3f')]=_0x4b1e0c['outboundDropCallsDayACS'];_0x55ebd8[_0x0605('0x40')]=_0x4b1e0c[_0x0605('0x40')];_0x55ebd8['outboundDropCallsDayTimeout']=_0x4b1e0c[_0x0605('0x41')];_0x55ebd8[_0x0605('0x42')]=_0x4b1e0c['outboundNoAnswerCallsDay'];_0x55ebd8[_0x0605('0x43')]=_0x4b1e0c[_0x0605('0x43')];_0x55ebd8[_0x0605('0x44')]=_0x4b1e0c[_0x0605('0x44')];_0x55ebd8[_0x0605('0x45')]=_0x4b1e0c[_0x0605('0x45')];_0x55ebd8['outboundRejectCallsDay']=_0x4b1e0c['outboundRejectCallsDay'];_0x55ebd8[_0x0605('0x46')]=_0x4b1e0c[_0x0605('0x46')];_0x55ebd8[_0x0605('0x47')]=_0x4b1e0c['predictiveIntervalAnsweredCalls'];_0x55ebd8[_0x0605('0x48')]=_0x4b1e0c['predictiveIntervalAvgHoldtime'];_0x55ebd8[_0x0605('0x49')]=_0x4b1e0c[_0x0605('0x49')];_0x55ebd8[_0x0605('0x4a')]=_0x4b1e0c[_0x0605('0x4a')];_0x55ebd8[_0x0605('0x4b')]=_0x4b1e0c[_0x0605('0x4b')];_0x55ebd8[_0x0605('0x4c')]=_0x4b1e0c[_0x0605('0x4c')];_0x55ebd8[_0x0605('0x4d')]=_0x4b1e0c[_0x0605('0x4d')];_0x55ebd8['predictiveIntervalHitRate']=_0x4b1e0c[_0x0605('0x4e')];_0x55ebd8['predictiveIntervalMultiplicativeFactor']=_0x4b1e0c[_0x0605('0x4f')];_0x55ebd8[_0x0605('0x50')]=_0x4b1e0c[_0x0605('0x50')];_0x55ebd8['predictiveIntervalAvailable']=_0x4b1e0c['predictiveIntervalAvailable'];_0x55ebd8[_0x0605('0x51')]=_0x4b1e0c['predictiveIntervalTotalCalls'];_0x55ebd8[_0x0605('0x1e')]=_0x4b1e0c[_0x0605('0x1e')];_0x55ebd8[_0x0605('0x52')]=_0x4b1e0c[_0x0605('0x52')];_0x55ebd8[_0x0605('0x53')]=_0x4b1e0c[_0x0605('0x53')];_0x55ebd8[_0x0605('0x54')]=_0x4b1e0c[_0x0605('0x54')];_0x55ebd8[_0x0605('0x55')]=_0x4b1e0c[_0x0605('0x55')];_0x55ebd8[_0x0605('0x56')]=_0x4b1e0c[_0x0605('0x56')];_0x55ebd8[_0x0605('0x57')]=_0x4b1e0c['startPredictive'];_0x55ebd8['startProgressive']=_0x4b1e0c[_0x0605('0x58')];}if(_0x4b1e0c['Trunk']){_0x55ebd8[_0x0605('0x59')]={'id':_0x4b1e0c[_0x0605('0x59')]['id'],'name':_0x4b1e0c['Trunk'][_0x0605('0xb')],'active':_0x4b1e0c[_0x0605('0x59')]['active'],'callerid':_0x4b1e0c[_0x0605('0x59')][_0x0605('0x5a')]};}if(_0x4b1e0c['Interval']){_0x55ebd8[_0x0605('0x5b')]={'id':_0x4b1e0c[_0x0605('0x5b')]['id'],'name':_0x4b1e0c['Interval'][_0x0605('0xb')]};}_0x9f2833['push'](_0x55ebd8);}}_0x234231({'count':_0x9f2833['length'],'rows':_0x9f2833});});},'UpdateVoiceQueue':function(_0x1fa208){return new Promise(function(_0x468a3e,_0x45b555){var _0xfd711e=_[_0x0605('0x5c')](_0x5797b0[_0x0605('0x24')],{'id':parseInt(_0x1fa208['id'])});var _0x3d7cfc=_[_0x0605('0x5d')](_0x1fa208,['id']);if(_0xfd711e){for(var _0x56190c in _0x3d7cfc){if(typeof _0x3d7cfc[_0x56190c]!==_0x0605('0x5e')&&typeof _0xfd711e[_0x56190c]!==_0x0605('0x5e')){_0xfd711e[_0x56190c]=_0x3d7cfc[_0x56190c];}}_0x468a3e(_0xfd711e);}else{_0x45b555();}});},'VoiceChannels':function(_0xbecbe5){return new Promise(function(_0x483c20,_0x433d4c){var _0x1fb70b=_[_0x0605('0x5f')](_0x5797b0[_0x0605('0x60')]);_0x483c20({'count':_0x1fb70b[_0x0605('0x61')],'rows':_0x1fb70b});});},'VoiceChannelMixMonitor':function(_0x86434d){var _0x20e27d=this;return new Promise(function(_0xc27400,_0x3cc131){if(ami['isConnected']()==![]){return _0x3cc131(_0x20e27d[_0x0605('0x14')](0x1f4,[config[_0x0605('0x15')]['ip'],config[_0x0605('0x15')][_0x0605('0x16')],_0x0605('0x17')][_0x0605('0x18')]('\x20')));}var _0x18995e=schema(properties[_0x0605('0x62')])[_0x0605('0x3')](_0x86434d);if(_0x18995e[_0x0605('0x61')]>0x0){return _0x3cc131(_0x20e27d['error'](0x1f4,_['map'](_0x18995e,'message')[_0x0605('0x18')](',\x20')));}var _0x7daeb7=_[_0x0605('0x5c')](_0x5797b0[_0x0605('0x60')],{'uniqueid':_0x86434d[_0x0605('0x63')]});if(_0x7daeb7&&_0x7daeb7[_0x0605('0x64')]){var _0x539ded=util[_0x0605('0x9')](_0x0605('0x65'),_0x86434d[_0x0605('0x66')]||_0x86434d[_0x0605('0x63')],_0x86434d['format']||_0x0605('0x67'));return ami[_0x0605('0x1c')]({'action':_0x0605('0x68'),'channel':_0x7daeb7['channel'],'file':_0x539ded,'options':'ai(mixmonitorid)'})[_0x0605('0x1d')](function(_0x1a735c){var _0x523e16=_['find'](_0x7daeb7['monitors'],{'filename':_0x0605('0x69')+_0x539ded['toLowerCase']()});if(_[_0x0605('0x6a')](_0x523e16)){_0x7daeb7[_0x0605('0x6b')][_0x0605('0x6c')]({'filename':_0x0605('0x69')+_0x539ded[_0x0605('0x6d')](),'createdAt':moment()[_0x0605('0x9')](_0x0605('0x6e')),'mixmonitorid':_0x1a735c['mixmonitorid'],'status':_0x0605('0x6f')});}else{_0x523e16['mixmonitorid']=_0x1a735c[_0x0605('0x70')];_0x523e16['status']=_0x0605('0x6f');}_0xc27400({'code':0xc8,'message':[_0x86434d[_0x0605('0x63')],_0x0605('0x71'),_0x1a735c[_0x0605('0x70')]]['join']('\x20'),'mixmonitorid':_0x1a735c['mixmonitorid']});})[_0x0605('0x1f')](function(_0xe1a3e7){_0x3cc131(_0x20e27d['error'](0x1f5,[_0x86434d['uniqueid'],_0xe1a3e7['message'][_0x0605('0x6d')]()][_0x0605('0x18')]('\x20')));});}else{return _0x3cc131(_0x20e27d[_0x0605('0x14')](0x1f5,_0x0605('0x72')));}});},'VoiceChannelStopMixMonitor':function(_0x3af2ad){var _0x50220d=this;return new Promise(function(_0x491ff2,_0x34f2e4){if(ami[_0x0605('0x13')]()==![]){return _0x34f2e4(_0x50220d[_0x0605('0x14')](0x1f4,[config[_0x0605('0x15')]['ip'],config[_0x0605('0x15')][_0x0605('0x16')],_0x0605('0x17')][_0x0605('0x18')]('\x20')));}var _0x533a9c=schema(properties['voicechannel'])['validate'](_0x3af2ad);if(_0x533a9c[_0x0605('0x61')]>0x0){return _0x34f2e4(_0x50220d[_0x0605('0x14')](0x1f4,_[_0x0605('0x73')](_0x533a9c,'message')['join'](',\x20')));}var _0x36fb25=_[_0x0605('0x5c')](_0x5797b0[_0x0605('0x60')],{'uniqueid':_0x3af2ad[_0x0605('0x63')]});if(_0x36fb25){return BPromise[_0x0605('0x74')]()[_0x0605('0x1d')](function(){if(_0x36fb25[_0x0605('0x64')]){return ami[_0x0605('0x1c')]({'action':_0x0605('0x75'),'channel':_0x36fb25[_0x0605('0x64')],'mixmonitorid':_0x3af2ad[_0x0605('0x70')]})[_0x0605('0x1f')](function(_0x5d4e9a){});}})[_0x0605('0x1d')](function(){if(_0x36fb25[_0x0605('0x76')]){return ami[_0x0605('0x1c')]({'action':_0x0605('0x75'),'channel':_0x36fb25[_0x0605('0x76')],'mixmonitorid':_0x3af2ad[_0x0605('0x70')]})['catch'](function(_0x2533a1){});}})['then'](function(_0x5f2063){var _0x3d2414=_[_0x0605('0x5c')](_0x36fb25[_0x0605('0x6b')],{'mixmonitorid':_0x3af2ad[_0x0605('0x70')]});if(_0x3d2414){_0x3d2414[_0x0605('0x77')]=_0x0605('0x78');}})[_0x0605('0x1d')](function(){var _0x25d352=util[_0x0605('0x9')](_0x0605('0x65'),_0x3af2ad['filename']||_0x3af2ad['uniqueid'],_0x3af2ad['format']||'wav');var _0x5e0b7a=_[_0x0605('0x5c')](_0x36fb25[_0x0605('0x6b')],{'filename':_0x0605('0x69')+_0x25d352['toLowerCase']()});if(_0x5e0b7a){_0x5e0b7a[_0x0605('0x77')]=_0x0605('0x78');}})[_0x0605('0x1d')](function(){_0x491ff2({'code':0xc8,'message':[_0x3af2ad[_0x0605('0x63')],_0x0605('0x79')][_0x0605('0x18')]('\x20')});})['catch'](function(_0x2afa0f){_0x34f2e4(_0x50220d[_0x0605('0x14')](0x1f5,[_0x3af2ad[_0x0605('0x63')],_0x2afa0f['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x34f2e4(_0x50220d[_0x0605('0x14')](0x1f5,_0x0605('0x72')));}});},'VoiceQueuesChannels':function(_0xfc544f){return new Promise(function(_0x542607,_0x55d375){var _0x4b6d10=_[_0x0605('0x5f')](_0x5797b0[_0x0605('0x7a')]);_0x542607({'count':_0x4b6d10['length'],'rows':_0x4b6d10});});},'VoiceQueuesChannel':function(_0x20dd76){var _0x1ab06c=this;return new Promise(function(_0x29eca2,_0x2409e8){var _0x8f99=schema(properties[_0x0605('0x7b')])[_0x0605('0x3')](_0x20dd76);if(_0x8f99[_0x0605('0x61')]>0x0){return _0x2409e8(_0x1ab06c[_0x0605('0x14')](0x1f4,_[_0x0605('0x73')](_0x8f99,_0x0605('0x1e'))[_0x0605('0x18')](',\x20')));}var _0x34c223=_['find'](_0x5797b0['queueChannels'],{'uniqueid':_0x20dd76[_0x0605('0x63')]});if(_0x34c223){_0x29eca2(_0x34c223);}else{return _0x2409e8(_0x1ab06c[_0x0605('0x14')](0x1f5,_0x0605('0x72')));}});},'VoiceQueuesChannelHangup':function(_0x59ea0f){var _0x5832d6=this;return new Promise(function(_0x3fa92e,_0x5f21b2){if(ami['isConnected']()==![]){return _0x5f21b2(_0x5832d6[_0x0605('0x14')](0x1f4,[config[_0x0605('0x15')]['ip'],config[_0x0605('0x15')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x2fbd38=schema(properties['voicequeuechannelhangup'])[_0x0605('0x3')](_0x59ea0f);if(_0x2fbd38[_0x0605('0x61')]>0x0){return _0x5f21b2(_0x5832d6[_0x0605('0x14')](0x1f4,_[_0x0605('0x73')](_0x2fbd38,_0x0605('0x1e'))[_0x0605('0x18')](',\x20')));}var _0x24fe36=_[_0x0605('0x5c')](_0x5797b0['queueChannels'],{'uniqueid':_0x59ea0f['uniqueid']});if(_0x24fe36&&_0x24fe36[_0x0605('0x64')]){return ami[_0x0605('0x1c')]({'action':'Hangup','channel':_0x24fe36[_0x0605('0x64')]})['then'](function(_0x1623d5){_0x3fa92e({'code':0xc8,'message':[_0x59ea0f[_0x0605('0x63')],_0x1623d5['message'][_0x0605('0x6d')]()]['join']('\x20')});})[_0x0605('0x1f')](function(_0x21a75d){_0x5f21b2(_0x5832d6[_0x0605('0x14')](0x1f5,[_0x59ea0f[_0x0605('0x63')],_0x21a75d['message'][_0x0605('0x6d')]()][_0x0605('0x18')]('\x20')));});}else{return _0x5f21b2(_0x5832d6['error'](0x1f5,_0x0605('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x3bbcc1){var _0x1e4659=this;return new Promise(function(_0x53646f,_0x909282){if(ami[_0x0605('0x13')]()==![]){return _0x909282(_0x1e4659['error'](0x1f4,[config['asterisk']['ip'],config[_0x0605('0x15')][_0x0605('0x16')],_0x0605('0x17')][_0x0605('0x18')]('\x20')));}var _0x4de957=schema(properties[_0x0605('0x7c')])[_0x0605('0x3')](_0x3bbcc1);if(_0x4de957[_0x0605('0x61')]>0x0){return _0x909282(_0x1e4659[_0x0605('0x14')](0x1f4,_[_0x0605('0x73')](_0x4de957,_0x0605('0x1e'))[_0x0605('0x18')](',\x20')));}var _0x48871d=_[_0x0605('0x5c')](_0x5797b0[_0x0605('0x7a')],{'uniqueid':_0x3bbcc1[_0x0605('0x63')]});if(_0x48871d&&_0x48871d[_0x0605('0x64')]){return ami['Action']({'action':'Redirect','channel':_0x48871d[_0x0605('0x64')],'exten':_0x3bbcc1[_0x0605('0x7d')],'context':_0x3bbcc1['context']||_0x48871d[_0x0605('0x7e')],'priority':0x1})['then'](function(_0x5de76a){_0x53646f({'code':0xc8,'message':[_0x3bbcc1[_0x0605('0x63')],_0x5de76a[_0x0605('0x1e')][_0x0605('0x6d')]()]['join']('\x20')});})[_0x0605('0x1f')](function(_0xdd449){_0x909282(_0x1e4659[_0x0605('0x14')](0x1f5,[_0x3bbcc1[_0x0605('0x63')],_0xdd449[_0x0605('0x1e')][_0x0605('0x6d')]()][_0x0605('0x18')]('\x20')));});}else{return _0x909282(_0x1e4659[_0x0605('0x14')](0x1f5,_0x0605('0x72')));}});},'Agents':function(_0x1c4216){return new Promise(function(_0x342c2b,_0x1bd3a5){var _0x3760a1=_[_0x0605('0x5f')](_0x5797b0[_0x0605('0xf')]);_0x342c2b({'count':_0x3760a1[_0x0605('0x61')],'rows':_0x3760a1});});},'Telephones':function(_0x51d480){return new Promise(function(_0x14c575,_0x106da4){var _0x2f9235=_[_0x0605('0x5f')](_0x5797b0[_0x0605('0x7f')]);_0x14c575({'count':_0x2f9235['length'],'rows':_0x2f9235});});},'Trunks':function(_0xaa5ee9){return new Promise(function(_0x36159d,_0x2eb03a){var _0x5b7e88=_[_0x0605('0x5f')](_0x5797b0['trunks']);_0x36159d({'count':_0x5b7e88[_0x0605('0x61')],'rows':_0x5b7e88});});},'OutboundChannels':function(_0x479b63){return new Promise(function(_0x52aafc,_0x21e559){var _0x5b88e4=_['values'](_0x5797b0[_0x0605('0x80')]);_0x52aafc({'count':_0x5b88e4[_0x0605('0x61')],'rows':_0x5b88e4});});},'Outbound':function(_0x40f33b){return new Promise(function(_0x1a1e63,_0x13e60a){_0x1a1e63(_0x5797b0[_0x0605('0x32')]);});},'Campaigns':function(_0x23a5d8){return new Promise(function(_0x5e5170,_0x5dd481){var _0xe989d1=_[_0x0605('0x5f')](_0x5797b0['campaigns']);_0x5e5170({'count':_0xe989d1[_0x0605('0x61')],'rows':_0xe989d1});});},'VoiceQueuesPreview':function(_0x4e5858){var _0x1f295b=this;return new Promise(function(_0x297aa6,_0x58278d){_0x533b6d[_0x0605('0x81')](_0x4e5858['id'])['then'](function(_0x5bc86f){_0x297aa6({'code':0xc8,'message':_0x5bc86f[_0x0605('0x1e')]});})[_0x0605('0x1f')](function(_0x1765ae){_0x58278d(_0x1f295b['error'](0x1f4,_0x1765ae[_0x0605('0x1e')]));});});},'EventManager':function(_0x2e47d5){var _0x3b365b=this;return new Promise(function(_0x3c2485,_0x15254c){if(!_0x2e47d5[_0x0605('0x82')]){return _0x15254c(_0x3b365b[_0x0605('0x14')](0x1f4,_0x0605('0x83')));}ami[_0x0605('0x84')](_0x0605('0x85')+_0x2e47d5['event'],_0x2e47d5[_0x0605('0x1e')]);_0x3c2485({'code':0xc8,'message':_0x2e47d5});});},'FaxAccounts':function(_0xd838f6){return new Promise(function(_0xb75eda,_0x23a6ef){var _0x42c1fa=_['values'](_0x5797b0[_0x0605('0x86')]);_0xb75eda({'count':_0x42c1fa['length'],'rows':_0x42c1fa});});},'SendFax':function(_0x2c7cbd){var _0x10e19e=this;return new Promise(function(_0x4fb8ed,_0x2420d2){_0x4aca21[_0x0605('0x87')](_0x2c7cbd)[_0x0605('0x1d')](function(_0x1b305a){_0x4fb8ed({'code':0xc8,'message':_0x1b305a[_0x0605('0x1e')]});})[_0x0605('0x1f')](function(_0x40449c){_0x2420d2(_0x10e19e[_0x0605('0x14')](0x1f4,_0x40449c['message']));});});},'CheckAfterSend':function(_0x2932fd){var _0x5c6822=this;return new Promise(function(_0x1ccdbb,_0x2ad1a5){_0x4aca21[_0x0605('0x88')](_0x2932fd)[_0x0605('0x1d')](function(_0x1d37dd){_0x1ccdbb({'code':0xc8,'message':_0x1d37dd['message']});})[_0x0605('0x1f')](function(_0x1310be){_0x2ad1a5(_0x5c6822[_0x0605('0x14')](0x1f4,_0x1310be[_0x0605('0x1e')]));});});}};var _0x3b7846=jayson[_0x0605('0x89')](_0x58f7d2)['http']();_0x3b7846['on'](_0x0605('0x14'),function(_0x3ca4ff){return _0x578623(_0x3ca4ff);});_0x3b7846[_0x0605('0x8')](0x232a,_0x0605('0x8a'),function(){console[_0x0605('0x8b')](_0x0605('0x8c'),0x232a);return _0xd78d96(_0x0605('0x8d')+0x232a);});});}; \ No newline at end of file +var _0xaf1b=['bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','catch','message','username','Command','then','content','voiceQueues','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x331305,_0x2f6659){_0x331305=_0x331305-0x0;var _0x487ba8=_0xaf1b[_0x331305];return _0x487ba8;};'use strict';var _=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var jayson=require(_0xbaf1('0x2'));var schema=require(_0xbaf1('0x3'));var BPromise=require(_0xbaf1('0x4'));var moment=require(_0xbaf1('0x5'));var config=require(_0xbaf1('0x6'));var properties=require(_0xbaf1('0x7'));var ami=require(_0xbaf1('0x8'));exports[_0xbaf1('0x9')]=function(_0x156a67,_0x97aab,_0x7dd657){return new BPromise(function(_0x2f05ad,_0x548a29){var _0x2e05b5={'QueuePause':function(_0x5f337d){return new Promise(function(_0x16a74d,_0x4eeec4){var _0x2052c8=util[_0xbaf1('0xa')](_0xbaf1('0xb'),'SIP',_0x5f337d[_0xbaf1('0xc')]);if(_0x156a67[_0xbaf1('0xd')]&&_0x156a67['timers'][_0x2052c8]&&_0x156a67[_0xbaf1('0xd')][_0x2052c8]['timer']){_0x156a67[_0xbaf1('0xd')][_0x2052c8][_0xbaf1('0xe')]();}if(_0x156a67[_0xbaf1('0xf')][_0x2052c8]){_0x156a67[_0xbaf1('0xf')][_0x2052c8][_0xbaf1('0x10')]({'statePause':_0x5f337d[_0xbaf1('0x11')]?!![]:![]});}_0x16a74d({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x493f3f){var _0x322058=this;return new Promise(function(_0x1a10d6,_0x22edd9){if(ami[_0xbaf1('0x12')]()==![]){return _0x22edd9(_0x322058[_0xbaf1('0x13')](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')]['username'],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}_0x493f3f=_[_0xbaf1('0x17')](_0x493f3f,_[_0xbaf1('0x18')](properties[_0xbaf1('0x19')]));_0x493f3f[_0xbaf1('0x1a')]=_0xbaf1('0x1b');return ami[_0xbaf1('0x1c')](_0x493f3f)['then'](function(_0x33c23b){_0x1a10d6({'code':0xc8,'message':_0x33c23b['message']});})[_0xbaf1('0x1d')](function(_0x3b13b2){_0x22edd9(_0x322058[_0xbaf1('0x13')](0x1f5,_0x3b13b2[_0xbaf1('0x1e')]));});});},'Command':function(_0x498435){var _0x43291c=this;return new Promise(function(_0x52b6da,_0x2ac412){if(ami[_0xbaf1('0x12')]()==![]){return _0x2ac412(_0x43291c['error'](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')][_0xbaf1('0x1f')],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}_0x498435=_[_0xbaf1('0x17')](_0x498435,'command');_0x498435['action']=_0xbaf1('0x20');return ami[_0xbaf1('0x1c')](_0x498435)[_0xbaf1('0x21')](function(_0x496344){_0x52b6da({'code':0xc8,'message':_0x496344[_0xbaf1('0x22')]});})[_0xbaf1('0x1d')](function(_0x40a0fa){_0x2ac412(_0x43291c['error'](0x1f5,_0x40a0fa[_0xbaf1('0x1e')]));});});},'VoiceQueues':function(_0x5ef6db){return new Promise(function(_0x1e7847,_0x181c9d){var _0xae3b42=[];for(var _0x2afb55 in _0x156a67[_0xbaf1('0x23')]){if(_0x156a67['voiceQueues']['hasOwnProperty'](_0x2afb55)){var _0x1cfbcd=_0x156a67[_0xbaf1('0x23')][_0x2afb55];var _0x33abc0={'id':_0x1cfbcd['id'],'name':_0x1cfbcd[_0xbaf1('0xc')],'strategy':_0x1cfbcd['strategy'],'answered':_0x1cfbcd[_0xbaf1('0x24')],'available':_0x1cfbcd['available'],'loggedIn':_0x1cfbcd[_0xbaf1('0x25')],'pTalking':_0x1cfbcd[_0xbaf1('0x26')],'sumBillable':_0x1cfbcd[_0xbaf1('0x27')],'sumDuration':_0x1cfbcd[_0xbaf1('0x28')],'sumHoldTime':_0x1cfbcd[_0xbaf1('0x29')]||0x0,'talking':_0x1cfbcd[_0xbaf1('0x2a')],'total':_0x1cfbcd[_0xbaf1('0x2b')],'type':_0x1cfbcd['type'],'unmanaged':_0x1cfbcd[_0xbaf1('0x2c')],'abandoned':_0x1cfbcd[_0xbaf1('0x2d')],'waiting':_0x1cfbcd[_0xbaf1('0x2e')],'loggedInDb':_0x1cfbcd[_0xbaf1('0x2f')]};if(_0x1cfbcd[_0xbaf1('0x30')]===_0xbaf1('0x31')){_0x33abc0[_0xbaf1('0x32')]=_0x1cfbcd[_0xbaf1('0x32')];_0x33abc0['dialMethod']=_0x1cfbcd[_0xbaf1('0x33')];_0x33abc0[_0xbaf1('0x34')]=_0x1cfbcd[_0xbaf1('0x34')];_0x33abc0[_0xbaf1('0x35')]=_0x1cfbcd['dialOriginateCallerIdNumber'];_0x33abc0[_0xbaf1('0x36')]=_0x1cfbcd['dialOriginateTimeout'];_0x33abc0[_0xbaf1('0x37')]=_0x1cfbcd['dialPrefix'];_0x33abc0[_0xbaf1('0x38')]=_0x1cfbcd[_0xbaf1('0x38')];_0x33abc0[_0xbaf1('0x39')]=_0x1cfbcd[_0xbaf1('0x39')];_0x33abc0['outboundAnswerCallsDay']=_0x1cfbcd[_0xbaf1('0x3a')];_0x33abc0[_0xbaf1('0x3b')]=_0x1cfbcd[_0xbaf1('0x3b')];_0x33abc0[_0xbaf1('0x3c')]=_0x1cfbcd[_0xbaf1('0x3c')];_0x33abc0[_0xbaf1('0x3d')]=_0x1cfbcd[_0xbaf1('0x3d')];_0x33abc0['outboundDropCallsDayACS']=_0x1cfbcd[_0xbaf1('0x3e')];_0x33abc0[_0xbaf1('0x3f')]=_0x1cfbcd[_0xbaf1('0x3f')];_0x33abc0[_0xbaf1('0x40')]=_0x1cfbcd[_0xbaf1('0x40')];_0x33abc0[_0xbaf1('0x41')]=_0x1cfbcd[_0xbaf1('0x41')];_0x33abc0['outboundNoSuchCallsDay']=_0x1cfbcd[_0xbaf1('0x42')];_0x33abc0['outboundOriginateFailureCallsDay']=_0x1cfbcd[_0xbaf1('0x43')];_0x33abc0[_0xbaf1('0x44')]=_0x1cfbcd[_0xbaf1('0x44')];_0x33abc0[_0xbaf1('0x45')]=_0x1cfbcd[_0xbaf1('0x45')];_0x33abc0[_0xbaf1('0x46')]=_0x1cfbcd[_0xbaf1('0x46')];_0x33abc0[_0xbaf1('0x47')]=_0x1cfbcd[_0xbaf1('0x47')];_0x33abc0['predictiveIntervalAvgHoldtime']=_0x1cfbcd['predictiveIntervalAvgHoldtime'];_0x33abc0['predictiveIntervalAvgTalktime']=_0x1cfbcd[_0xbaf1('0x48')];_0x33abc0[_0xbaf1('0x49')]=_0x1cfbcd['predictiveIntervalDroppedCallsCallersExit'];_0x33abc0[_0xbaf1('0x4a')]=_0x1cfbcd[_0xbaf1('0x4a')];_0x33abc0[_0xbaf1('0x4b')]=_0x1cfbcd['predictiveIntervalErlangCalls'];_0x33abc0[_0xbaf1('0x4c')]=_0x1cfbcd[_0xbaf1('0x4c')];_0x33abc0[_0xbaf1('0x4d')]=_0x1cfbcd['predictiveIntervalHitRate'];_0x33abc0[_0xbaf1('0x4e')]=_0x1cfbcd[_0xbaf1('0x4e')];_0x33abc0['predictiveIntervalPauses']=_0x1cfbcd['predictiveIntervalPauses'];_0x33abc0[_0xbaf1('0x4f')]=_0x1cfbcd['predictiveIntervalAvailable'];_0x33abc0['predictiveIntervalTotalCalls']=_0x1cfbcd['predictiveIntervalTotalCalls'];_0x33abc0[_0xbaf1('0x1e')]=_0x1cfbcd[_0xbaf1('0x1e')];_0x33abc0[_0xbaf1('0x50')]=_0x1cfbcd[_0xbaf1('0x50')];_0x33abc0[_0xbaf1('0x51')]=_0x1cfbcd[_0xbaf1('0x51')];_0x33abc0[_0xbaf1('0x52')]=_0x1cfbcd[_0xbaf1('0x52')];_0x33abc0['erlangAbandonmentRate']=_0x1cfbcd[_0xbaf1('0x53')];_0x33abc0[_0xbaf1('0x54')]=_0x1cfbcd[_0xbaf1('0x54')];_0x33abc0[_0xbaf1('0x55')]=_0x1cfbcd['startPredictive'];_0x33abc0[_0xbaf1('0x56')]=_0x1cfbcd['startProgressive'];}if(_0x1cfbcd[_0xbaf1('0x57')]){_0x33abc0[_0xbaf1('0x57')]={'id':_0x1cfbcd[_0xbaf1('0x57')]['id'],'name':_0x1cfbcd['Trunk'][_0xbaf1('0xc')],'active':_0x1cfbcd[_0xbaf1('0x57')][_0xbaf1('0x58')],'callerid':_0x1cfbcd['Trunk'][_0xbaf1('0x59')]};}if(_0x1cfbcd['Interval']){_0x33abc0['Interval']={'id':_0x1cfbcd['Interval']['id'],'name':_0x1cfbcd[_0xbaf1('0x5a')][_0xbaf1('0xc')]};}_0xae3b42[_0xbaf1('0x5b')](_0x33abc0);}}_0x1e7847({'count':_0xae3b42[_0xbaf1('0x5c')],'rows':_0xae3b42});});},'UpdateVoiceQueue':function(_0x3ed8a0){return new Promise(function(_0x1e5955,_0x52bd9a){var _0x2e09b3=_[_0xbaf1('0x5d')](_0x156a67[_0xbaf1('0x23')],{'id':parseInt(_0x3ed8a0['id'])});var _0x752e07=_[_0xbaf1('0x5e')](_0x3ed8a0,['id']);if(_0x2e09b3){for(var _0x21cf40 in _0x752e07){if(typeof _0x752e07[_0x21cf40]!=='undefined'&&typeof _0x2e09b3[_0x21cf40]!==_0xbaf1('0x5f')){_0x2e09b3[_0x21cf40]=_0x752e07[_0x21cf40];}}_0x1e5955(_0x2e09b3);}else{_0x52bd9a();}});},'VoiceChannels':function(_0x58b5a7){return new Promise(function(_0x5847ea,_0x300f67){var _0x12a9a1=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x61')]);_0x5847ea({'count':_0x12a9a1[_0xbaf1('0x5c')],'rows':_0x12a9a1});});},'VoiceChannelMixMonitor':function(_0x55ff0a){var _0x471d44=this;return new Promise(function(_0x4cf95d,_0x20bb7f){if(ami[_0xbaf1('0x12')]()==![]){return _0x20bb7f(_0x471d44[_0xbaf1('0x13')](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')][_0xbaf1('0x1f')],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}var _0x3a1f4d=schema(properties[_0xbaf1('0x62')])[_0xbaf1('0x3')](_0x55ff0a);if(_0x3a1f4d[_0xbaf1('0x5c')]>0x0){return _0x20bb7f(_0x471d44[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x3a1f4d,_0xbaf1('0x1e'))[_0xbaf1('0x16')](',\x20')));}var _0x54f00c=_[_0xbaf1('0x5d')](_0x156a67[_0xbaf1('0x61')],{'uniqueid':_0x55ff0a[_0xbaf1('0x64')]});if(_0x54f00c&&_0x54f00c[_0xbaf1('0x65')]){var _0x55aa1e=util[_0xbaf1('0xa')](_0xbaf1('0x66'),_0x55ff0a[_0xbaf1('0x67')]||_0x55ff0a[_0xbaf1('0x64')],_0x55ff0a[_0xbaf1('0xa')]||_0xbaf1('0x68'));return ami['Action']({'action':_0xbaf1('0x69'),'channel':_0x54f00c[_0xbaf1('0x65')],'file':_0x55aa1e,'options':_0xbaf1('0x6a')})[_0xbaf1('0x21')](function(_0x20de2b){var _0x37ee43=_['find'](_0x54f00c[_0xbaf1('0x6b')],{'filename':'/var/spool/asterisk/monitor/'+_0x55aa1e[_0xbaf1('0x6c')]()});if(_[_0xbaf1('0x6d')](_0x37ee43)){_0x54f00c[_0xbaf1('0x6b')][_0xbaf1('0x5b')]({'filename':_0xbaf1('0x6e')+_0x55aa1e[_0xbaf1('0x6c')](),'createdAt':moment()[_0xbaf1('0xa')](_0xbaf1('0x6f')),'mixmonitorid':_0x20de2b[_0xbaf1('0x70')],'status':_0xbaf1('0x71')});}else{_0x37ee43[_0xbaf1('0x70')]=_0x20de2b['mixmonitorid'];_0x37ee43[_0xbaf1('0x72')]='rec';}_0x4cf95d({'code':0xc8,'message':[_0x55ff0a['uniqueid'],'MixMonitor\x20Success',_0x20de2b[_0xbaf1('0x70')]]['join']('\x20'),'mixmonitorid':_0x20de2b['mixmonitorid']});})[_0xbaf1('0x1d')](function(_0x131281){_0x20bb7f(_0x471d44['error'](0x1f5,[_0x55ff0a[_0xbaf1('0x64')],_0x131281[_0xbaf1('0x1e')][_0xbaf1('0x6c')]()][_0xbaf1('0x16')]('\x20')));});}else{return _0x20bb7f(_0x471d44[_0xbaf1('0x13')](0x1f5,_0xbaf1('0x73')));}});},'VoiceChannelStopMixMonitor':function(_0x1784d8){var _0x18034a=this;return new Promise(function(_0x915a43,_0x2b55aa){if(ami['isConnected']()==![]){return _0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f4,[config['asterisk']['ip'],config[_0xbaf1('0x14')]['username'],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}var _0x3b2146=schema(properties[_0xbaf1('0x62')])[_0xbaf1('0x3')](_0x1784d8);if(_0x3b2146[_0xbaf1('0x5c')]>0x0){return _0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x3b2146,_0xbaf1('0x1e'))[_0xbaf1('0x16')](',\x20')));}var _0x369c22=_['find'](_0x156a67[_0xbaf1('0x61')],{'uniqueid':_0x1784d8['uniqueid']});if(_0x369c22){return BPromise[_0xbaf1('0x74')]()['then'](function(){if(_0x369c22[_0xbaf1('0x65')]){return ami[_0xbaf1('0x1c')]({'action':_0xbaf1('0x75'),'channel':_0x369c22[_0xbaf1('0x65')],'mixmonitorid':_0x1784d8[_0xbaf1('0x70')]})['catch'](function(_0x157d17){});}})[_0xbaf1('0x21')](function(){if(_0x369c22[_0xbaf1('0x76')]){return ami['Action']({'action':_0xbaf1('0x75'),'channel':_0x369c22[_0xbaf1('0x76')],'mixmonitorid':_0x1784d8[_0xbaf1('0x70')]})[_0xbaf1('0x1d')](function(_0x1b695e){});}})[_0xbaf1('0x21')](function(_0x547b62){var _0x2f56d6=_[_0xbaf1('0x5d')](_0x369c22[_0xbaf1('0x6b')],{'mixmonitorid':_0x1784d8[_0xbaf1('0x70')]});if(_0x2f56d6){_0x2f56d6[_0xbaf1('0x72')]=_0xbaf1('0x77');}})['then'](function(){var _0x1c886a=util[_0xbaf1('0xa')](_0xbaf1('0x66'),_0x1784d8['filename']||_0x1784d8['uniqueid'],_0x1784d8[_0xbaf1('0xa')]||_0xbaf1('0x68'));var _0x178dd6=_['find'](_0x369c22[_0xbaf1('0x6b')],{'filename':_0xbaf1('0x6e')+_0x1c886a[_0xbaf1('0x6c')]()});if(_0x178dd6){_0x178dd6[_0xbaf1('0x72')]=_0xbaf1('0x77');}})['then'](function(){_0x915a43({'code':0xc8,'message':[_0x1784d8[_0xbaf1('0x64')],_0xbaf1('0x78')][_0xbaf1('0x16')]('\x20')});})['catch'](function(_0x4f9b26){_0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f5,[_0x1784d8[_0xbaf1('0x64')],_0x4f9b26[_0xbaf1('0x1e')]['toLowerCase']()][_0xbaf1('0x16')]('\x20')));});}else{return _0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f5,_0xbaf1('0x73')));}});},'VoiceQueuesChannels':function(_0x50334e){return new Promise(function(_0x464421,_0x41afbd){var _0x50e9dd=_['values'](_0x156a67[_0xbaf1('0x79')]);_0x464421({'count':_0x50e9dd[_0xbaf1('0x5c')],'rows':_0x50e9dd});});},'VoiceQueuesChannel':function(_0x5d0909){var _0x5d28b9=this;return new Promise(function(_0x38bf32,_0x4d28d7){var _0x1f94a9=schema(properties[_0xbaf1('0x7a')])[_0xbaf1('0x3')](_0x5d0909);if(_0x1f94a9[_0xbaf1('0x5c')]>0x0){return _0x4d28d7(_0x5d28b9[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x1f94a9,_0xbaf1('0x1e'))['join'](',\x20')));}var _0x47df91=_['find'](_0x156a67[_0xbaf1('0x79')],{'uniqueid':_0x5d0909[_0xbaf1('0x64')]});if(_0x47df91){_0x38bf32(_0x47df91);}else{return _0x4d28d7(_0x5d28b9[_0xbaf1('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0xab1f6e){var _0x12e901=this;return new Promise(function(_0x436da0,_0xf6a307){if(ami['isConnected']()==![]){return _0xf6a307(_0x12e901[_0xbaf1('0x13')](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')][_0xbaf1('0x1f')],_0xbaf1('0x15')]['join']('\x20')));}var _0x567211=schema(properties['voicequeuechannelhangup'])[_0xbaf1('0x3')](_0xab1f6e);if(_0x567211[_0xbaf1('0x5c')]>0x0){return _0xf6a307(_0x12e901['error'](0x1f4,_[_0xbaf1('0x63')](_0x567211,'message')[_0xbaf1('0x16')](',\x20')));}var _0x56629a=_[_0xbaf1('0x5d')](_0x156a67[_0xbaf1('0x79')],{'uniqueid':_0xab1f6e['uniqueid']});if(_0x56629a&&_0x56629a[_0xbaf1('0x65')]){return ami[_0xbaf1('0x1c')]({'action':_0xbaf1('0x7b'),'channel':_0x56629a[_0xbaf1('0x65')]})[_0xbaf1('0x21')](function(_0x4f64c7){_0x436da0({'code':0xc8,'message':[_0xab1f6e[_0xbaf1('0x64')],_0x4f64c7[_0xbaf1('0x1e')]['toLowerCase']()][_0xbaf1('0x16')]('\x20')});})[_0xbaf1('0x1d')](function(_0x479a1d){_0xf6a307(_0x12e901[_0xbaf1('0x13')](0x1f5,[_0xab1f6e[_0xbaf1('0x64')],_0x479a1d[_0xbaf1('0x1e')][_0xbaf1('0x6c')]()][_0xbaf1('0x16')]('\x20')));});}else{return _0xf6a307(_0x12e901[_0xbaf1('0x13')](0x1f5,_0xbaf1('0x73')));}});},'VoiceQueuesChannelRedirect':function(_0x215f54){var _0x32bfca=this;return new Promise(function(_0x116b32,_0x1d6e58){if(ami[_0xbaf1('0x12')]()==![]){return _0x1d6e58(_0x32bfca['error'](0x1f4,[config[_0xbaf1('0x14')]['ip'],config['asterisk'][_0xbaf1('0x1f')],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}var _0x1a5d4b=schema(properties[_0xbaf1('0x7c')])[_0xbaf1('0x3')](_0x215f54);if(_0x1a5d4b[_0xbaf1('0x5c')]>0x0){return _0x1d6e58(_0x32bfca[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x1a5d4b,'message')[_0xbaf1('0x16')](',\x20')));}var _0x57505c=_['find'](_0x156a67[_0xbaf1('0x79')],{'uniqueid':_0x215f54[_0xbaf1('0x64')]});if(_0x57505c&&_0x57505c[_0xbaf1('0x65')]){return ami['Action']({'action':'Redirect','channel':_0x57505c[_0xbaf1('0x65')],'exten':_0x215f54[_0xbaf1('0x7d')],'context':_0x215f54['context']||_0x57505c[_0xbaf1('0x7e')],'priority':0x1})[_0xbaf1('0x21')](function(_0x446682){_0x116b32({'code':0xc8,'message':[_0x215f54[_0xbaf1('0x64')],_0x446682[_0xbaf1('0x1e')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x516da1){_0x1d6e58(_0x32bfca[_0xbaf1('0x13')](0x1f5,[_0x215f54[_0xbaf1('0x64')],_0x516da1[_0xbaf1('0x1e')][_0xbaf1('0x6c')]()]['join']('\x20')));});}else{return _0x1d6e58(_0x32bfca[_0xbaf1('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x21ad47){return new Promise(function(_0x537ce3,_0x35814b){var _0x5a999c=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0xf')]);_0x537ce3({'count':_0x5a999c[_0xbaf1('0x5c')],'rows':_0x5a999c});});},'Telephones':function(_0x20cdc9){return new Promise(function(_0x4973c9,_0xde578b){var _0x12c371=_['values'](_0x156a67[_0xbaf1('0x7f')]);_0x4973c9({'count':_0x12c371[_0xbaf1('0x5c')],'rows':_0x12c371});});},'Trunks':function(_0x46d111){return new Promise(function(_0x11ee42,_0x8f2a02){var _0x2ee0d8=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x80')]);_0x11ee42({'count':_0x2ee0d8['length'],'rows':_0x2ee0d8});});},'OutboundChannels':function(_0x3834dc){return new Promise(function(_0x341715,_0x2eea9c){var _0x539508=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x81')]);_0x341715({'count':_0x539508[_0xbaf1('0x5c')],'rows':_0x539508});});},'Outbound':function(_0x133089){return new Promise(function(_0x204920,_0x481aeb){_0x204920(_0x156a67[_0xbaf1('0x31')]);});},'Campaigns':function(_0x2c0572){return new Promise(function(_0x4609c2,_0x3fa01a){var _0x4ae168=_[_0xbaf1('0x60')](_0x156a67['campaigns']);_0x4609c2({'count':_0x4ae168[_0xbaf1('0x5c')],'rows':_0x4ae168});});},'VoiceQueuesPreview':function(_0x1538ec){var _0x4f1136=this;return new Promise(function(_0xca83ff,_0x57eb50){_0x97aab[_0xbaf1('0x82')](_0x1538ec['id'])[_0xbaf1('0x21')](function(_0x195218){_0xca83ff({'code':0xc8,'message':_0x195218[_0xbaf1('0x1e')]});})[_0xbaf1('0x1d')](function(_0x141e1f){_0x57eb50(_0x4f1136[_0xbaf1('0x13')](0x1f4,_0x141e1f[_0xbaf1('0x1e')]));});});},'EventManager':function(_0x24f73a){var _0x52b7ca=this;return new Promise(function(_0x453231,_0x114cdd){if(!_0x24f73a[_0xbaf1('0x83')]){return _0x114cdd(_0x52b7ca[_0xbaf1('0x13')](0x1f4,_0xbaf1('0x84')));}ami[_0xbaf1('0x85')](_0xbaf1('0x86')+_0x24f73a[_0xbaf1('0x83')],_0x24f73a[_0xbaf1('0x1e')]);_0x453231({'code':0xc8,'message':_0x24f73a});});},'FaxAccounts':function(_0x280213){return new Promise(function(_0x13b4ab,_0x281060){var _0x383b8e=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x87')]);_0x13b4ab({'count':_0x383b8e[_0xbaf1('0x5c')],'rows':_0x383b8e});});},'SendFax':function(_0x2098ee){var _0x28f833=this;return new Promise(function(_0x5a914e,_0x21f6b2){_0x7dd657[_0xbaf1('0x88')](_0x2098ee)[_0xbaf1('0x21')](function(_0x584900){_0x5a914e({'code':0xc8,'message':_0x584900['message']});})[_0xbaf1('0x1d')](function(_0x4706cc){_0x21f6b2(_0x28f833[_0xbaf1('0x13')](0x1f4,_0x4706cc['message']));});});},'CheckAfterSend':function(_0x2349c5){var _0x3516fc=this;return new Promise(function(_0x280f35,_0x44fd6c){_0x7dd657[_0xbaf1('0x89')](_0x2349c5)[_0xbaf1('0x21')](function(_0xd9436f){_0x280f35({'code':0xc8,'message':_0xd9436f[_0xbaf1('0x1e')]});})['catch'](function(_0x56b458){_0x44fd6c(_0x3516fc[_0xbaf1('0x13')](0x1f4,_0x56b458[_0xbaf1('0x1e')]));});});}};var _0x1ff946=jayson['server'](_0x2e05b5)[_0xbaf1('0x8a')]();_0x1ff946['on'](_0xbaf1('0x13'),function(_0x1728cf){return _0x548a29(_0x1728cf);});_0x1ff946['listen'](0x232a,_0xbaf1('0x8b'),function(){console[_0xbaf1('0x8c')](_0xbaf1('0x8d'),0x232a);return _0x2f05ad(_0xbaf1('0x8e')+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 94db8c5..33241a2 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 _0x90fb=['push','[CM][%s][%s]\x20Contact\x20created:%s','destcalleridnum','format','user:%s','name','toLowerCase','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data2','xmd-contactid','ListId','data3','split','phone','$or','map','calleridnum','lastName','mobile','createdAt','updatedAt','union','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','firstName','calleridname','','Unknown','destcalleridname','resolve','createContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90fb,0xd7));var _0xb90f=function(_0x31659b,_0x3f07a1){_0x31659b=_0x31659b-0x0;var _0x48b140=_0x90fb[_0x31659b];return _0x48b140;};'use strict';var _=require('lodash');var BPromise=require(_0xb90f('0x0'));var Redis=require(_0xb90f('0x1'));var util=require(_0xb90f('0x2'));var config=require(_0xb90f('0x3'));var logger=require('../../../../config/logger')(_0xb90f('0x4'));var cmContactRpc=require(_0xb90f('0x5'));config[_0xb90f('0x6')]=_['defaults'](config[_0xb90f('0x6')],{'host':_0xb90f('0x7'),'port':0x18eb});var io=require(_0xb90f('0x8'))(new Redis(config[_0xb90f('0x6')]));function emit(_0x2fa396,_0x35b997,_0x5a52dd,_0xc14f25,_0x5b992f){logger['info'](_0xb90f('0x9'),_0x2fa396,_0x35b997['id'],_0x5a52dd,_0xc14f25,JSON[_0xb90f('0xa')](_0x5b992f));io['to'](_0x5a52dd)[_0xb90f('0xb')](_0xc14f25,_0x5b992f);}exports[_0xb90f('0xc')]=function(_0x7b8a1d,_0x15c60b,_0xeae871,_0x2a6ef1){var _0x80ef36,_0xc6abe7;var _0x58c390={};var _0x1da094=Number(_0xeae871['data1']);var _0x2e9c95=_0xeae871['data2']?Boolean(Number(_0xeae871[_0xb90f('0xd')])):![];var _0x12fb33;if(_0x2a6ef1[_0xb90f('0xe')]){_0x58c390['id']=_0x2a6ef1[_0xb90f('0xe')];}if(!_0x58c390['id']){_0x58c390[_0xb90f('0xf')]=_0x1da094;_0x12fb33=_0xeae871[_0xb90f('0x10')]&&_0xeae871[_0xb90f('0x10')]!=='0'?_0xeae871[_0xb90f('0x10')][_0xb90f('0x11')](','):[_0xb90f('0x12')];_0x58c390[_0xb90f('0x13')]=_[_0xb90f('0x14')](_0x12fb33,function(_0x50c0e4){var _0xec49d6={};_0xec49d6[_0x50c0e4]=_0x2a6ef1['routeId']?_0x2a6ef1['destcalleridnum']:_0x2a6ef1[_0xb90f('0x15')];return _0xec49d6;});}var _0x230048=['id','firstName',_0xb90f('0x16'),_0xb90f('0x12'),_0xb90f('0x17'),'fax',_0xb90f('0xf'),_0xb90f('0x18'),'scheduledAt',_0xb90f('0x19')];var _0x1825b3=_[_0xb90f('0x1a')](_0x230048,_0x12fb33);BPromise['resolve']()['then'](cmContactRpc['getContacts']({'attributes':_0x1825b3,'where':_0x58c390}))[_0xb90f('0x1b')](function(_0x5a708e){_0xc6abe7=_0x5a708e;if(!_[_0xb90f('0x1c')](_0xc6abe7)){if(_0xc6abe7[_0xb90f('0x1d')]===0x1){_0x80ef36=_0xc6abe7[0x0];logger[_0xb90f('0x1e')](_0xb90f('0x1f'),_0x2a6ef1[_0xb90f('0x20')],_0x15c60b['id'],_0x80ef36['id']);}else{logger[_0xb90f('0x1e')](_0xb90f('0x21'),_0x2a6ef1['uniqueid'],_0x15c60b['id'],_[_0xb90f('0x14')](_0xc6abe7,'id')[_0xb90f('0x22')](','));}return;}else{logger[_0xb90f('0x1e')](_0xb90f('0x23'),_0x2a6ef1[_0xb90f('0x20')],_0x15c60b['id']);var _0x26b9e1={'ListId':_0x1da094};var _0x2a4b04=_0xeae871[_0xb90f('0x24')]&&_0xeae871[_0xb90f('0x24')]!=='0'?_0xeae871['data4']:_0xb90f('0x12');if(_0x2e9c95){logger[_0xb90f('0x1e')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x2a6ef1[_0xb90f('0x20')],_0x15c60b['id']);_0x26b9e1[_0x2a4b04]=_[_0xb90f('0x25')](_0x2a6ef1['routeId'])?_0x2a6ef1['calleridnum']:_0x2a6ef1['destcalleridnum'];if(_[_0xb90f('0x25')](_0x2a6ef1['routeId'])){_0x26b9e1[_0xb90f('0x26')]=_0x2a6ef1[_0xb90f('0x27')]&&_0x2a6ef1['calleridname']!==_0xb90f('0x28')?_0x2a6ef1[_0xb90f('0x27')]:_0xb90f('0x29');}else{_0x26b9e1[_0xb90f('0x26')]=_0x2a6ef1[_0xb90f('0x2a')]&&_0x2a6ef1['destcalleridname']!==_0xb90f('0x28')?_0x2a6ef1[_0xb90f('0x2a')]:'Unknown';}return BPromise[_0xb90f('0x2b')]()['then'](cmContactRpc[_0xb90f('0x2c')](_0x26b9e1))['then'](function(_0x4ebd38){_0x80ef36=_0x4ebd38;_0xc6abe7[_0xb90f('0x2d')](_0x4ebd38);if(_0x80ef36){logger[_0xb90f('0x1e')](_0xb90f('0x2e'),_0x2a6ef1[_0xb90f('0x20')],_0x15c60b['id'],_0x80ef36['id']);}return;});}else{logger[_0xb90f('0x1e')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2a6ef1['uniqueid'],_0x15c60b['id']);_0x26b9e1[_0x2a4b04]=_['isNil'](_0x2a6ef1['routeId'])?_0x2a6ef1['calleridnum']:_0x2a6ef1[_0xb90f('0x2f')];if(_[_0xb90f('0x25')](_0x2a6ef1['routeId'])){_0x26b9e1[_0xb90f('0x26')]=_0x2a6ef1[_0xb90f('0x27')]&&_0x2a6ef1['calleridname']!==_0xb90f('0x28')?_0x2a6ef1['calleridname']:'Unknown';}else{_0x26b9e1[_0xb90f('0x26')]=_0x2a6ef1[_0xb90f('0x2a')]&&_0x2a6ef1[_0xb90f('0x2a')]!==_0xb90f('0x28')?_0x2a6ef1[_0xb90f('0x2a')]:_0xb90f('0x29');}_0x80ef36=_0x26b9e1;_0xc6abe7['push'](_0x26b9e1);return;}}})[_0xb90f('0x1b')](function(){if(_0x7b8a1d){emit(_0x2a6ef1[_0xb90f('0x20')],_0x15c60b,util[_0xb90f('0x30')](_0xb90f('0x31'),_0x7b8a1d[_0xb90f('0x32')]),util[_0xb90f('0x30')]('trigger:%s',_0xeae871['action'][_0xb90f('0x33')]()),{'evt':_['merge'](_0x2a6ef1,{'autoCreate':_0x2e9c95}),'contact':_0x80ef36===undefined?{}:_0x80ef36,'contacts':_0xc6abe7['length']===0x0?undefined:_0xc6abe7});}});}; \ No newline at end of file +var _0x877d=['union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','isNil','routeId','calleridname','','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','push','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','[CM][%s][%s]','emit','exec','data1','data2','xmd-contactid','ListId','data3','split','$or','map','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt'];(function(_0x26b5e4,_0x1a4fa0){var _0x37ee61=function(_0x5550e8){while(--_0x5550e8){_0x26b5e4['push'](_0x26b5e4['shift']());}};_0x37ee61(++_0x1a4fa0);}(_0x877d,0x7c));var _0xd877=function(_0x123092,_0x4655bc){_0x123092=_0x123092-0x0;var _0x2816cc=_0x877d[_0x123092];return _0x2816cc;};'use strict';var _=require(_0xd877('0x0'));var BPromise=require(_0xd877('0x1'));var Redis=require(_0xd877('0x2'));var util=require(_0xd877('0x3'));var config=require(_0xd877('0x4'));var logger=require(_0xd877('0x5'))(_0xd877('0x6'));var cmContactRpc=require(_0xd877('0x7'));config[_0xd877('0x8')]=_[_0xd877('0x9')](config[_0xd877('0x8')],{'host':_0xd877('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd877('0x8')]));function emit(_0x3822b5,_0x19bed7,_0x2db92d,_0x4f5a82,_0x2ba74a){logger[_0xd877('0xb')](_0xd877('0xc'),_0x3822b5,_0x19bed7['id'],_0x2db92d,_0x4f5a82,JSON['stringify'](_0x2ba74a));io['to'](_0x2db92d)[_0xd877('0xd')](_0x4f5a82,_0x2ba74a);}exports[_0xd877('0xe')]=function(_0x1cf6c9,_0x5f2afc,_0x53d9a2,_0x39db30){var _0x1ccb15,_0x32691d;var _0x30e8b4={};var _0x3c5831=Number(_0x53d9a2[_0xd877('0xf')]);var _0xa42b1f=_0x53d9a2[_0xd877('0x10')]?Boolean(Number(_0x53d9a2['data2'])):![];var _0x3d0448;if(_0x39db30[_0xd877('0x11')]){_0x30e8b4['id']=_0x39db30[_0xd877('0x11')];}if(!_0x30e8b4['id']){_0x30e8b4[_0xd877('0x12')]=_0x3c5831;_0x3d0448=_0x53d9a2[_0xd877('0x13')]&&_0x53d9a2['data3']!=='0'?_0x53d9a2[_0xd877('0x13')][_0xd877('0x14')](','):['phone'];_0x30e8b4[_0xd877('0x15')]=_[_0xd877('0x16')](_0x3d0448,function(_0x221228){var _0x4d079d={};_0x4d079d[_0x221228]=_0x39db30['routeId']?_0x39db30[_0xd877('0x17')]:_0x39db30[_0xd877('0x18')];return _0x4d079d;});}var _0x93b90b=['id',_0xd877('0x19'),_0xd877('0x1a'),_0xd877('0x1b'),_0xd877('0x1c'),_0xd877('0x1d'),_0xd877('0x12'),_0xd877('0x1e'),_0xd877('0x1f'),'updatedAt'];var _0x56087b=_[_0xd877('0x20')](_0x93b90b,_0x3d0448);BPromise[_0xd877('0x21')]()[_0xd877('0x22')](cmContactRpc['getContacts']({'attributes':_0x56087b,'where':_0x30e8b4}))[_0xd877('0x22')](function(_0x3e2348){_0x32691d=_0x3e2348;if(!_[_0xd877('0x23')](_0x32691d)){if(_0x32691d[_0xd877('0x24')]===0x1){_0x1ccb15=_0x32691d[0x0];logger[_0xd877('0xb')](_0xd877('0x25'),_0x39db30[_0xd877('0x26')],_0x5f2afc['id'],_0x1ccb15['id']);}else{logger[_0xd877('0xb')](_0xd877('0x27'),_0x39db30[_0xd877('0x26')],_0x5f2afc['id'],_[_0xd877('0x16')](_0x32691d,'id')[_0xd877('0x28')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x39db30[_0xd877('0x26')],_0x5f2afc['id']);var _0x25d685={'ListId':_0x3c5831};var _0x5ad6aa=_0x53d9a2[_0xd877('0x29')]&&_0x53d9a2[_0xd877('0x29')]!=='0'?_0x53d9a2[_0xd877('0x29')]:_0xd877('0x1b');if(_0xa42b1f){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x39db30[_0xd877('0x26')],_0x5f2afc['id']);_0x25d685[_0x5ad6aa]=_[_0xd877('0x2a')](_0x39db30[_0xd877('0x2b')])?_0x39db30['calleridnum']:_0x39db30[_0xd877('0x17')];if(_[_0xd877('0x2a')](_0x39db30[_0xd877('0x2b')])){_0x25d685[_0xd877('0x19')]=_0x39db30[_0xd877('0x2c')]&&_0x39db30[_0xd877('0x2c')]!==_0xd877('0x2d')?_0x39db30['calleridname']:'Unknown';}else{_0x25d685[_0xd877('0x19')]=_0x39db30['destcalleridname']&&_0x39db30[_0xd877('0x2e')]!==_0xd877('0x2d')?_0x39db30[_0xd877('0x2e')]:'Unknown';}return BPromise[_0xd877('0x21')]()[_0xd877('0x22')](cmContactRpc[_0xd877('0x2f')](_0x25d685))[_0xd877('0x22')](function(_0x396928){_0x1ccb15=_0x396928;_0x32691d['push'](_0x396928);if(_0x1ccb15){logger[_0xd877('0xb')](_0xd877('0x30'),_0x39db30[_0xd877('0x26')],_0x5f2afc['id'],_0x1ccb15['id']);}return;});}else{logger['info'](_0xd877('0x31'),_0x39db30[_0xd877('0x26')],_0x5f2afc['id']);_0x25d685[_0x5ad6aa]=_[_0xd877('0x2a')](_0x39db30[_0xd877('0x2b')])?_0x39db30[_0xd877('0x18')]:_0x39db30['destcalleridnum'];if(_['isNil'](_0x39db30[_0xd877('0x2b')])){_0x25d685['firstName']=_0x39db30[_0xd877('0x2c')]&&_0x39db30['calleridname']!==_0xd877('0x2d')?_0x39db30[_0xd877('0x2c')]:'Unknown';}else{_0x25d685[_0xd877('0x19')]=_0x39db30[_0xd877('0x2e')]&&_0x39db30[_0xd877('0x2e')]!==_0xd877('0x2d')?_0x39db30[_0xd877('0x2e')]:_0xd877('0x32');}_0x1ccb15=_0x25d685;_0x32691d[_0xd877('0x33')](_0x25d685);return;}}})[_0xd877('0x22')](function(){if(_0x1cf6c9){emit(_0x39db30[_0xd877('0x26')],_0x5f2afc,util['format']('user:%s',_0x1cf6c9['name']),util['format']('trigger:%s',_0x53d9a2['action']['toLowerCase']()),{'evt':_['merge'](_0x39db30,{'autoCreate':_0xa42b1f}),'contact':_0x1ccb15===undefined?{}:_0x1ccb15,'contacts':_0x32691d[_0xd877('0x24')]===0x0?undefined:_0x32691d});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 7a85619..2f9ffc0 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 _0x7bd5=['vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','custom:agentconnect','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','custom:dialend','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','interface','checkTriggers','status','checkTrigger','variables','Actions','length','action','contactmanager','motionbar','data1','TemplateId','data2','html','templates','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','800','data5','windowHeight','data6','winApplication','winArguments','format','user:%s','trigger:%s:%s','merge','name','trigger:%s','toLowerCase','exec','integration','queue','routeId','urlforward','script','parse','query','log','trigger.channel,\x20evt.channel','channel','AllConditions','checkConditions','AnyConditions','triggerChannel\x20&&\x20triggerEvery\x20&&\x20triggerSome','ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','message','event','membername','lastevent','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts'];(function(_0x3276e1,_0x3f65bd){var _0x437fb4=function(_0x232cc2){while(--_0x232cc2){_0x3276e1['push'](_0x3276e1['shift']());}};_0x437fb4(++_0x3f65bd);}(_0x7bd5,0xd4));var _0x57bd=function(_0x36a235,_0x1f306e){_0x36a235=_0x36a235-0x0;var _0x376dba=_0x7bd5[_0x36a235];return _0x376dba;};'use strict';var util=require(_0x57bd('0x0'));var _=require(_0x57bd('0x1'));var url=require(_0x57bd('0x2'));var Mustache=require(_0x57bd('0x3'));var Redis=require('ioredis');var urlforward=require(_0x57bd('0x4'));var integration=require(_0x57bd('0x5'));var cmContact=require(_0x57bd('0x6'));var script=require(_0x57bd('0x7'));var config=require(_0x57bd('0x8'));var logger=require(_0x57bd('0x9'))(_0x57bd('0xa'));var ami=require(_0x57bd('0xb'));config[_0x57bd('0xc')]=_[_0x57bd('0xd')](config[_0x57bd('0xc')],{'host':_0x57bd('0xe'),'port':0x18eb});var io=require(_0x57bd('0xf'))(new Redis(config['redis']));var operators={'equals':function(_0x2865da,_0x145f5e){return _0x2865da==_0x145f5e;},'not_equals':function(_0x4179b1,_0x49dbee){return _0x4179b1!=_0x49dbee;}};var barAndWebActions=[_0x57bd('0x10'),_0x57bd('0x2'),_0x57bd('0x11')];function Trigger(_0x24f2e3){this['triggers']=_0x24f2e3[_0x57bd('0x12')];this[_0x57bd('0x13')]=_0x24f2e3[_0x57bd('0x13')];this[_0x57bd('0x14')]=_0x24f2e3[_0x57bd('0x14')];this['templates']=_0x24f2e3['templates'];this[_0x57bd('0x15')]=_0x24f2e3[_0x57bd('0x15')];this[_0x57bd('0x16')]=_0x24f2e3[_0x57bd('0x16')];this['freshdeskAccounts']=_0x24f2e3[_0x57bd('0x17')];this[_0x57bd('0x18')]=_0x24f2e3['salesforceAccounts'];this[_0x57bd('0x19')]=_0x24f2e3[_0x57bd('0x19')];this[_0x57bd('0x1a')]=_0x24f2e3[_0x57bd('0x1a')];this[_0x57bd('0x1b')]=_0x24f2e3[_0x57bd('0x1b')];this[_0x57bd('0x1c')]=_0x24f2e3[_0x57bd('0x1c')];this[_0x57bd('0x1d')]=_0x24f2e3[_0x57bd('0x1d')];this['dynamics365Accounts']=_0x24f2e3[_0x57bd('0x1e')];this[_0x57bd('0x1f')]=_0x24f2e3['freshsalesAccounts'];this[_0x57bd('0x20')]={'zendesk':this[_0x57bd('0x16')],'salesforce':this[_0x57bd('0x18')],'freshdesk':this[_0x57bd('0x17')],'sugarcrm':this[_0x57bd('0x19')],'zoho':this[_0x57bd('0x1a')],'desk':this[_0x57bd('0x1b')],'vtiger':this[_0x57bd('0x1c')],'dynamics365':this[_0x57bd('0x1e')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x57bd('0x1d')]};ami['on'](_0x57bd('0x21'),this['syncCustomEvent']['bind'](this));ami['on'](_0x57bd('0x22'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x25'),this[_0x57bd('0x23')]['bind'](this));ami['on'](_0x57bd('0x26'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x27'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x28'),this[_0x57bd('0x23')]['bind'](this));ami['on'](_0x57bd('0x29'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on']('custom:agentcongestion',this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on']('custom:agentreject',this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on']('custom:amd',this[_0x57bd('0x23')]['bind'](this));ami['on'](_0x57bd('0x2a'),this['syncCustomEvent'][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x2b'),this[_0x57bd('0x23')]['bind'](this));ami['on'](_0x57bd('0x2c'),this['syncAgentDial'][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x2d'),this['syncAgentDial'][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x2e'),this[_0x57bd('0x2f')]['bind'](this));ami['on'](_0x57bd('0x30'),this[_0x57bd('0x23')]['bind'](this));ami['on'](_0x57bd('0x31'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x32'),this['syncCustomEvent'][_0x57bd('0x24')](this));ami['on']('custom:outgoingmessage',this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x33'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x34'),this[_0x57bd('0x23')]['bind'](this));}Trigger[_0x57bd('0x35')][_0x57bd('0x36')]=function(_0x165416,_0x111a04,_0x2f0572){logger[_0x57bd('0x37')](_0x165416,_0x111a04,JSON[_0x57bd('0x38')](_0x2f0572));io['to'](_0x165416)[_0x57bd('0x36')](_0x111a04,_0x2f0572);};Trigger['prototype'][_0x57bd('0x23')]=function(_0x4650eb){var _0x28e63e=_['clone'](_0x4650eb);this['checkTriggers'](_0x28e63e);};Trigger['prototype'][_0x57bd('0x2f')]=function(_0x4c4a85){if(this['agents'][_0x4c4a85[_0x57bd('0x39')]]){this[_0x57bd('0x23')](_0x4c4a85);}};Trigger['prototype'][_0x57bd('0x3a')]=function(_0x301b13){var _0x3e4a03;for(var _0x26df31 in this[_0x57bd('0x12')]){if(this[_0x57bd('0x12')]['hasOwnProperty'](_0x26df31)){if(this[_0x57bd('0x12')][_0x26df31][_0x57bd('0x3b')]){_0x3e4a03=this[_0x57bd('0x3c')](this[_0x57bd('0x12')][_0x26df31],_0x301b13);if(_0x3e4a03){_['merge'](_0x301b13,_0x301b13[_0x57bd('0x3d')]);for(var _0x57827c=0x0,_0x1fbdc0,_0x4c68a0,_0x1abd9a;_0x57827c0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3a4318,_0x13c6eb){_0x3a4318=_0x3a4318-0x0;var _0x36d746=_0x5fc3[_0x3a4318];return _0x36d746;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 9712a78..6b5580d 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 _0x21e5=['ticketId','format','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','remoteUri','username','password','then','toUpperCase','message','GET','Bearer\x20','4.0','validateEmail','userEmail','email','length','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','catch','outbound','destcalleridnum','contacts','/systemusers(','headers','enduserId','toLowerCase','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','value','telephone1','contactid','info',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','customField','idField','indexOf','substring','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecalls','callDirection','queue','lastIndexOf'];(function(_0x285af6,_0x5eea8e){var _0x5df459=function(_0x213bd2){while(--_0x213bd2){_0x285af6['push'](_0x285af6['shift']());}};_0x5df459(++_0x5eea8e);}(_0x21e5,0x1a5));var _0x521e=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0x21e5[_0x37b3e5];return _0x207f20;};'use strict';var _=require(_0x521e('0x0'));var BPromise=require(_0x521e('0x1'));var rp=require(_0x521e('0x2'));var util=require(_0x521e('0x3'));var intUtil=require('./util');var md5=require(_0x521e('0x4'));var Redis=require(_0x521e('0x5'));var logger=require('../../../../config/logger')(_0x521e('0x6'));var config=require(_0x521e('0x7'));config[_0x521e('0x8')]=_[_0x521e('0x9')](config[_0x521e('0x8')],{'host':_0x521e('0xa'),'port':0x18eb});var io=require(_0x521e('0xb'))(new Redis(config[_0x521e('0x8')]));function getAuthToken(_0x873fa0,_0x393957,_0x4e9995){var _0x55d4fa={'method':_0x521e('0xc'),'uri':_0x393957,'form':{'client_id':_0x873fa0['clientId'],'resource':_0x873fa0[_0x521e('0xd')],'username':_0x873fa0[_0x521e('0xe')],'password':_0x873fa0[_0x521e('0xf')],'grant_type':'password','client_secret':_0x873fa0['clientSecret']},'json':!![]};return rp(_0x55d4fa)[_0x521e('0x10')](function(_0x295a01){return _0x295a01['access_token'];})['catch'](function(_0x2f0b42){logger['error']('['+[_0x4e9995[_0x521e('0x11')]()]+']\x20Wrong\x20credentials!');return _0x2f0b42[_0x521e('0x12')];});}function getUser(_0x513231,_0x5666e2,_0x2e3e9d,_0x401338,_0x14efd7,_0x24d7e7){return new BPromise(function(_0x27eddb,_0x159d66){return getAuthToken(_0x5666e2,_0x401338,_0x24d7e7)[_0x521e('0x10')](function(_0x58db80){var _0x397c58={'method':_0x521e('0x13'),'uri':_0x14efd7+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x521e('0x14')+_0x58db80,'OData-Version':_0x521e('0x15')},'json':!![]};return rp(_0x397c58);})[_0x521e('0x10')](function(_0x4bd257){var _0x12415e=_0x4bd257['value'];var _0x5a09cf=![];var _0x495da8=null;if(!_['isNil'](_0x2e3e9d)){if(intUtil[_0x521e('0x16')](_0x2e3e9d['email'])){_0x513231[_0x521e('0x17')]=_0x2e3e9d[_0x521e('0x18')];for(_0x495da8=0x0;_0x495da8<_0x12415e[_0x521e('0x19')];_0x495da8++){if(_0x12415e[_0x495da8]['internalemailaddress']===_0x2e3e9d[_0x521e('0x18')]&&!_0x12415e[_0x495da8][_0x521e('0x1a')]){_0x5a09cf=!![];logger['info']('['+[_0x24d7e7[_0x521e('0x11')]()]+_0x521e('0x1b')+_0x12415e[_0x495da8][_0x521e('0x1c')]+'!');_0x513231[_0x521e('0x1d')]=_0x12415e[_0x495da8][_0x521e('0x1c')];}}}}if(!_0x5a09cf){logger['info']('['+[_0x24d7e7[_0x521e('0x11')]()]+_0x521e('0x1e'));_0x513231['userEmail']=_0x5666e2[_0x521e('0xe')];for(_0x495da8=0x0;_0x495da8<_0x12415e[_0x521e('0x19')];_0x495da8++){if(_0x12415e[_0x495da8][_0x521e('0x1f')]===_0x5666e2['username']){_0x513231['userId']=_0x12415e[_0x495da8][_0x521e('0x1c')];}}}_0x27eddb(_0x513231);})[_0x521e('0x20')](function(_0x2b8120){_0x159d66(_0x2b8120['message']);});});}function createEndUser(_0x2258f8,_0x16f7df,_0x377d97,_0x320951,_0x5dc47f,_0x4d2b7d){return new BPromise(function(_0x3632e4,_0x316c85){return getAuthToken(_0x16f7df,_0x377d97,_0x4d2b7d)[_0x521e('0x10')](function(_0x4986af){var _0x9d1c33=_0x4d2b7d['toLowerCase']()===_0x521e('0x21')?_0x5dc47f[_0x521e('0x22')]:_0x5dc47f['calleridnum'];var _0x3d5673={'method':'POST','uri':_0x320951+_0x521e('0x23'),'body':{'telephone1':_0x9d1c33,'fullname':_0x9d1c33,'firstname':_0x9d1c33,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x521e('0x24')+_0x2258f8['userId']+')'},'headers':{'Authorization':_0x521e('0x14')+_0x4986af,'OData-Version':_0x521e('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3d5673);})[_0x521e('0x10')](function(_0x5e51a4){var _0x6e466d=_0x5e51a4[_0x521e('0x25')]['odata-entityid'];var _0xbeee8f=_0x6e466d['substring'](_0x6e466d['lastIndexOf']('(')+0x1,_0x6e466d['lastIndexOf'](')'));_0x2258f8[_0x521e('0x26')]=_0xbeee8f;_0x3632e4(_0x2258f8);})[_0x521e('0x20')](function(_0x2c9dfa){_0x316c85(_0x2c9dfa[_0x521e('0x12')]);});});}function getEndUser(_0x599041,_0x4c9300,_0x24feb8,_0x5c51c9,_0x3b0a39,_0x1cab22){return new BPromise(function(_0x5ee39a,_0x2df43b){var _0xd457d0=_0x1cab22[_0x521e('0x27')]()===_0x521e('0x21')?_0x3b0a39['destcalleridnum']:_0x3b0a39[_0x521e('0x28')];return getAuthToken(_0x4c9300,_0x24feb8,_0x1cab22)[_0x521e('0x10')](function(_0x5db7f0){var _0x282d2c={'method':_0x521e('0x13'),'uri':_0x5c51c9+_0x521e('0x29')+_0xd457d0['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x521e('0x14')+_0x5db7f0,'If-None-Match':null,'OData-Version':_0x521e('0x15')},'json':!![]};return rp(_0x282d2c);})['then'](function(_0x59c41c){var _0x86cd8d=null;if(_0x59c41c){var _0x4d1216=_0x59c41c[_0x521e('0x2a')];var _0x271164=![];for(_0x86cd8d=0x0;_0x86cd8d<_0x4d1216['length'];_0x86cd8d++){if(_0x4d1216[_0x86cd8d][_0x521e('0x2b')]===_0xd457d0){_0x271164=!![];_0x599041[_0x521e('0x26')]=_0x4d1216[_0x86cd8d][_0x521e('0x2c')];}}if(_0x271164){_0x5ee39a(_0x599041);}else{return createEndUser(_0x599041,_0x4c9300,_0x24feb8,_0x5c51c9,_0x3b0a39,_0x1cab22)[_0x521e('0x10')](function(_0x1351ba){logger[_0x521e('0x2d')]('['+[_0x1cab22['toUpperCase']()]+_0x521e('0x2e'),_0x1351ba[_0x521e('0x26')]);_0x5ee39a(_0x1351ba);});}}else{return createEndUser(_0x599041,_0x4c9300,_0x24feb8,_0x5c51c9,_0x3b0a39,_0x1cab22)[_0x521e('0x10')](function(_0x3a77fe){logger[_0x521e('0x2d')]('['+[_0x1cab22['toUpperCase']()]+_0x521e('0x2f'),_0x3a77fe['enduserId']);_0x5ee39a(_0x3a77fe);});}});});}function getCustomFields(_0x83d12d,_0x4887c2,_0x542492){var _0x293c86={};if(_0x83d12d[_0x521e('0x19')]>0x0){_[_0x521e('0x30')](_0x83d12d,function(_0x2b7a36){if(_[_0x521e('0x31')]([_0x521e('0x32'),_0x521e('0x33')],_0x2b7a36[_0x521e('0x34')])&&_0x2b7a36['nameField']&&!_0x2b7a36[_0x521e('0x35')]){var _0x44c2b6=_0x2b7a36[_0x521e('0x36')][_0x521e('0x27')]();var _0x27efda=_0x44c2b6['substring'](0x0,_0x44c2b6[_0x521e('0x37')]('_'));var _0x2c62e3=_0x44c2b6[_0x521e('0x38')](_0x44c2b6[_0x521e('0x37')]('_')+0x1);if(_0x27efda===_0x542492){_0x293c86[_0x2c62e3]=_0x2b7a36['content'];}}});}return _0x293c86;}function getTicket(_0xc893aa,_0x11f54a,_0x47ec21,_0x1120bd,_0x3238d6,_0x284333,_0x91ca28){return new BPromise(function(_0x2a7139,_0xf0456){var _0x1e93a8;return getAuthToken(_0x11f54a,_0x47ec21,_0x91ca28)['then'](function(_0x37e507){if(_0x284333[_0x521e('0x39')]===_0x521e('0x3a')){_0x1e93a8={'method':_0x521e('0xc'),'uri':_0x1120bd+_0x521e('0x3b'),'body':Object[_0x521e('0x3c')]({},{'title':intUtil[_0x521e('0x3d')](_0x284333[_0x521e('0x3e')],_0x3238d6,'\x20'),'description':intUtil[_0x521e('0x3d')](_0x284333[_0x521e('0x3f')],_0x3238d6,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0xc893aa['enduserId']+')','ownerid@odata.bind':_0x521e('0x24')+_0xc893aa[_0x521e('0x1d')]+')','caseorigincode':'1'},getCustomFields(_0x284333[_0x521e('0x40')],_0x3238d6,_0x284333['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x37e507,'OData-Version':_0x521e('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x284333[_0x521e('0x39')]==='phonecall'){_0x1e93a8={'method':_0x521e('0xc'),'uri':_0x1120bd+_0x521e('0x41'),'body':Object[_0x521e('0x3c')]({},{'subject':intUtil[_0x521e('0x3d')](_0x284333[_0x521e('0x3e')],_0x3238d6,'\x20'),'phonenumber':String(_0x3238d6[_0x521e('0x28')]),'description':intUtil['getString'](_0x284333[_0x521e('0x3f')],_0x3238d6,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0xc893aa['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0xc893aa[_0x521e('0x1d')]+')','directioncode':_0xc893aa['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x521e('0x24')+_0xc893aa[_0x521e('0x1d')]+')','participationtypemask':_0xc893aa[_0x521e('0x42')]===_0x521e('0x43')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0xc893aa[_0x521e('0x26')]+')','participationtypemask':_0xc893aa[_0x521e('0x42')]===_0x521e('0x43')?0x1:0x2}]},getCustomFields(_0x284333[_0x521e('0x40')],_0x3238d6,_0x284333[_0x521e('0x39')])),'headers':{'Authorization':_0x521e('0x14')+_0x37e507,'OData-Version':_0x521e('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1e93a8);})[_0x521e('0x10')](function(_0x517ade){var _0x230882=_0x517ade[_0x521e('0x25')]['odata-entityid'];var _0x4530b6=_0x230882['substring'](_0x230882[_0x521e('0x44')]('(')+0x1,_0x230882[_0x521e('0x44')](')'));_0xc893aa[_0x521e('0x45')]=_0x4530b6;_0x2a7139(_0xc893aa);})[_0x521e('0x20')](function(_0x4a223d){_0xf0456(_0x4a223d[_0x521e('0x12')]);});});}function emit(_0x378bbe,_0x24673c,_0x4ddd4f,_0x26d73b){var _0xd2686a={'uri':util[_0x521e('0x46')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x378bbe,_0x4ddd4f,_0x26d73b)};io['to'](util[_0x521e('0x46')](_0x521e('0x47'),_0x24673c))[_0x521e('0x48')]('trigger:browser:url',_0xd2686a);}exports['cs']=function(_0x193a8d,_0xd8708b,_0x40a339,_0x58cbdd,_0x19a7fe,_0x4bf6c6,_0x374a60,_0x4eafb1){var _0xf015e4={};_0x4bf6c6[_0x521e('0xd')]=intUtil[_0x521e('0x49')](_0x4bf6c6[_0x521e('0xd')]);_0x4bf6c6[_0x521e('0x4a')]=intUtil[_0x521e('0x49')](_0x4bf6c6[_0x521e('0x4a')]);_0xf015e4[_0x521e('0x42')]=_0x4eafb1==='queue'||_0x4eafb1===_0x521e('0x4b')?_0x521e('0x43'):_0x521e('0x21');var _0x413e3a=util[_0x521e('0x46')](_0x521e('0x4c'),_0x4bf6c6['remoteUri']);var _0xcaeb39=util[_0x521e('0x46')](_0x521e('0x4d'),_0x4bf6c6[_0x521e('0x4e')]);var _0x3095c2=util[_0x521e('0x46')](_0x521e('0x4f'),_0x4bf6c6[_0x521e('0x4a')],_0xd8708b[_0x521e('0x50')],md5(_0xd8708b[_0x521e('0x50')]));if(_0x19a7fe&&_0x19a7fe[_0x521e('0x51')]){logger[_0x521e('0x2d')](_0x521e('0x52'),'Recording\x20is\x20enabled!');_0xd8708b[_0x521e('0x53')]=_0x3095c2;}else if(_0x374a60&&_0x374a60[_0x521e('0x54')]&&_0x374a60['recordingFormat']!==_0x521e('0x55')){logger[_0x521e('0x2d')](_0x521e('0x56'),_0x521e('0x57'));_0xd8708b[_0x521e('0x53')]=_0x3095c2;}else{_0xd8708b[_0x521e('0x53')]='';}return getUser(_0xf015e4,_0x4bf6c6,_0x58cbdd,_0xcaeb39,_0x413e3a,_0x4eafb1)[_0x521e('0x10')](function(_0x49b200){logger[_0x521e('0x2d')]('['+_0x4eafb1[_0x521e('0x11')]()+_0x521e('0x58'),_0x49b200[_0x521e('0x1d')]);logger['info']('['+_0x4eafb1[_0x521e('0x11')]()+_0x521e('0x59'),_0x49b200[_0x521e('0x17')]);return getEndUser(_0x49b200,_0x4bf6c6,_0xcaeb39,_0x413e3a,_0xd8708b,_0x4eafb1);})[_0x521e('0x10')](function(_0x395c49){logger['info']('['+_0x4eafb1[_0x521e('0x11')]()+_0x521e('0x5a'),_0x395c49[_0x521e('0x26')]);logger[_0x521e('0x2d')]('['+_0x4eafb1[_0x521e('0x11')]()+']\x20The\x20Enduser\x20phone\x20is:',_0xd8708b[_0x521e('0x28')]);return getTicket(_0x395c49,_0x4bf6c6,_0xcaeb39,_0x413e3a,_0xd8708b,_0x40a339,_0x4eafb1);})['then'](function(_0x1e777e){logger['info'](util[_0x521e('0x46')]('['+_0x4eafb1['toUpperCase']()+_0x521e('0x5b'),_0x40a339['ticketType'],_0x1e777e[_0x521e('0x45')]));logger[_0x521e('0x2d')](util['format']('['+_0x4eafb1[_0x521e('0x11')]()+_0x521e('0x5c'),_0x4eafb1));if(_0x4eafb1!=='unmanaged'){logger[_0x521e('0x2d')]('['+_0x4eafb1['toUpperCase']()+']',_0x521e('0x5d'));emit(_0x4bf6c6['remoteUri'],_0x58cbdd[_0x521e('0x5e')],_0x40a339['ticketType'],_0x1e777e[_0x521e('0x45')]);}})['catch'](function(_0x15c4fd){logger[_0x521e('0x5f')]('['+_0x4eafb1[_0x521e('0x11')]()+_0x521e('0x60'),util[_0x521e('0x61')](_0x15c4fd,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x11fa=['trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','redis','POST','clientId','remoteUri','password','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','username','internalemailaddress','userId','catch','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','length','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','picklist','type','nameField','customField','indexOf','content','incident','incidents','assign','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecalls','getString','callDirection','queue','ticketId','format','user:%s','emit'];(function(_0x4cbf09,_0x5abcfc){var _0x503383=function(_0x294c6b){while(--_0x294c6b){_0x4cbf09['push'](_0x4cbf09['shift']());}};_0x503383(++_0x5abcfc);}(_0x11fa,0x7b));var _0xa11f=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x11fa[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require('lodash');var BPromise=require(_0xa11f('0x0'));var rp=require(_0xa11f('0x1'));var util=require(_0xa11f('0x2'));var intUtil=require('./util');var md5=require(_0xa11f('0x3'));var Redis=require(_0xa11f('0x4'));var logger=require(_0xa11f('0x5'))(_0xa11f('0x6'));var config=require(_0xa11f('0x7'));config['redis']=_[_0xa11f('0x8')](config['redis'],{'host':_0xa11f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa11f('0xa')]));function getAuthToken(_0x2c8f6a,_0x4196b3,_0xb836a){var _0x9f3a19={'method':_0xa11f('0xb'),'uri':_0x4196b3,'form':{'client_id':_0x2c8f6a[_0xa11f('0xc')],'resource':_0x2c8f6a[_0xa11f('0xd')],'username':_0x2c8f6a['username'],'password':_0x2c8f6a[_0xa11f('0xe')],'grant_type':'password','client_secret':_0x2c8f6a['clientSecret']},'json':!![]};return rp(_0x9f3a19)[_0xa11f('0xf')](function(_0x492ca9){return _0x492ca9[_0xa11f('0x10')];})['catch'](function(_0x3798e1){logger[_0xa11f('0x11')]('['+[_0xb836a[_0xa11f('0x12')]()]+_0xa11f('0x13'));return _0x3798e1[_0xa11f('0x14')];});}function getUser(_0x4dd0f0,_0x404c50,_0x19c6b0,_0x3d4c61,_0xdbdade,_0x18815b){return new BPromise(function(_0x152fb2,_0x3bad10){return getAuthToken(_0x404c50,_0x3d4c61,_0x18815b)[_0xa11f('0xf')](function(_0x390b71){var _0xb0735e={'method':'GET','uri':_0xdbdade+_0xa11f('0x15'),'headers':{'Authorization':_0xa11f('0x16')+_0x390b71,'OData-Version':_0xa11f('0x17')},'json':!![]};return rp(_0xb0735e);})[_0xa11f('0xf')](function(_0x1f22c5){var _0x57d860=_0x1f22c5[_0xa11f('0x18')];var _0x55b04c=![];var _0x1718df=null;if(!_['isNil'](_0x19c6b0)){if(intUtil[_0xa11f('0x19')](_0x19c6b0[_0xa11f('0x1a')])){_0x4dd0f0[_0xa11f('0x1b')]=_0x19c6b0[_0xa11f('0x1a')];for(_0x1718df=0x0;_0x1718df<_0x57d860['length'];_0x1718df++){if(_0x57d860[_0x1718df]['internalemailaddress']===_0x19c6b0[_0xa11f('0x1a')]&&!_0x57d860[_0x1718df][_0xa11f('0x1c')]){_0x55b04c=!![];logger[_0xa11f('0x1d')]('['+[_0x18815b['toUpperCase']()]+_0xa11f('0x1e')+_0x57d860[_0x1718df][_0xa11f('0x1f')]+'!');_0x4dd0f0['userId']=_0x57d860[_0x1718df][_0xa11f('0x1f')];}}}}if(!_0x55b04c){logger[_0xa11f('0x1d')]('['+[_0x18815b['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4dd0f0[_0xa11f('0x1b')]=_0x404c50[_0xa11f('0x20')];for(_0x1718df=0x0;_0x1718df<_0x57d860['length'];_0x1718df++){if(_0x57d860[_0x1718df][_0xa11f('0x21')]===_0x404c50[_0xa11f('0x20')]){_0x4dd0f0[_0xa11f('0x22')]=_0x57d860[_0x1718df][_0xa11f('0x1f')];}}}_0x152fb2(_0x4dd0f0);})[_0xa11f('0x23')](function(_0x471d5c){_0x3bad10(_0x471d5c[_0xa11f('0x14')]);});});}function createEndUser(_0x268a5d,_0x1b97dc,_0x478a7c,_0x43d826,_0x4fb9de,_0xa7a77b){return new BPromise(function(_0x15d8cb,_0x56eb9a){return getAuthToken(_0x1b97dc,_0x478a7c,_0xa7a77b)[_0xa11f('0xf')](function(_0x260d04){var _0x44d869=_0xa7a77b[_0xa11f('0x24')]()===_0xa11f('0x25')?_0x4fb9de[_0xa11f('0x26')]:_0x4fb9de['calleridnum'];var _0x2c0987={'method':_0xa11f('0xb'),'uri':_0x43d826+_0xa11f('0x27'),'body':{'telephone1':_0x44d869,'fullname':_0x44d869,'firstname':_0x44d869,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xa11f('0x28')+_0x268a5d['userId']+')'},'headers':{'Authorization':_0xa11f('0x16')+_0x260d04,'OData-Version':_0xa11f('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2c0987);})[_0xa11f('0xf')](function(_0x2f4637){var _0x241f1d=_0x2f4637[_0xa11f('0x29')][_0xa11f('0x2a')];var _0x312e17=_0x241f1d[_0xa11f('0x2b')](_0x241f1d[_0xa11f('0x2c')]('(')+0x1,_0x241f1d['lastIndexOf'](')'));_0x268a5d[_0xa11f('0x2d')]=_0x312e17;_0x15d8cb(_0x268a5d);})['catch'](function(_0x3ef50a){_0x56eb9a(_0x3ef50a[_0xa11f('0x14')]);});});}function getEndUser(_0x111ec4,_0x4da0d6,_0x5765ef,_0x3ea28e,_0x4fd974,_0x1bf9f9){return new BPromise(function(_0x243a80,_0x12affa){var _0x35364c=_0x1bf9f9['toLowerCase']()===_0xa11f('0x25')?_0x4fd974['destcalleridnum']:_0x4fd974[_0xa11f('0x2e')];return getAuthToken(_0x4da0d6,_0x5765ef,_0x1bf9f9)[_0xa11f('0xf')](function(_0x281b96){var _0x5a1f96={'method':'GET','uri':_0x3ea28e+_0xa11f('0x2f')+_0x35364c[_0xa11f('0x30')]('+',_0xa11f('0x31'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x281b96,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5a1f96);})['then'](function(_0x3988a5){var _0x57f2f2=null;if(_0x3988a5){var _0x434c27=_0x3988a5[_0xa11f('0x18')];var _0x57458b=![];for(_0x57f2f2=0x0;_0x57f2f2<_0x434c27[_0xa11f('0x32')];_0x57f2f2++){if(_0x434c27[_0x57f2f2][_0xa11f('0x33')]===_0x35364c){_0x57458b=!![];_0x111ec4['enduserId']=_0x434c27[_0x57f2f2][_0xa11f('0x34')];}}if(_0x57458b){_0x243a80(_0x111ec4);}else{return createEndUser(_0x111ec4,_0x4da0d6,_0x5765ef,_0x3ea28e,_0x4fd974,_0x1bf9f9)[_0xa11f('0xf')](function(_0x5b4988){logger['info']('['+[_0x1bf9f9[_0xa11f('0x12')]()]+_0xa11f('0x35'),_0x5b4988[_0xa11f('0x2d')]);_0x243a80(_0x5b4988);});}}else{return createEndUser(_0x111ec4,_0x4da0d6,_0x5765ef,_0x3ea28e,_0x4fd974,_0x1bf9f9)[_0xa11f('0xf')](function(_0x272815){logger[_0xa11f('0x1d')]('['+[_0x1bf9f9[_0xa11f('0x12')]()]+_0xa11f('0x36'),_0x272815[_0xa11f('0x2d')]);_0x243a80(_0x272815);});}});});}function getCustomFields(_0x232429,_0x58e949,_0x4cc8f2){var _0x4af4ed={};if(_0x232429[_0xa11f('0x32')]>0x0){_[_0xa11f('0x37')](_0x232429,function(_0x2e08ed){if(_[_0xa11f('0x38')](['string',_0xa11f('0x39')],_0x2e08ed[_0xa11f('0x3a')])&&_0x2e08ed[_0xa11f('0x3b')]&&!_0x2e08ed[_0xa11f('0x3c')]){var _0x176559=_0x2e08ed['idField'][_0xa11f('0x24')]();var _0x2b4a55=_0x176559['substring'](0x0,_0x176559[_0xa11f('0x3d')]('_'));var _0x1cc7ea=_0x176559['substring'](_0x176559[_0xa11f('0x3d')]('_')+0x1);if(_0x2b4a55===_0x4cc8f2){_0x4af4ed[_0x1cc7ea]=_0x2e08ed[_0xa11f('0x3e')];}}});}return _0x4af4ed;}function getTicket(_0x1e86fd,_0x3f6ff1,_0x5a56bd,_0x54bfbe,_0x2f627e,_0x425c4d,_0x12b013){return new BPromise(function(_0x3627f5,_0x2c8a74){var _0x3d20a4;return getAuthToken(_0x3f6ff1,_0x5a56bd,_0x12b013)[_0xa11f('0xf')](function(_0x2d8257){if(_0x425c4d['ticketType']===_0xa11f('0x3f')){_0x3d20a4={'method':_0xa11f('0xb'),'uri':_0x54bfbe+_0xa11f('0x40'),'body':Object[_0xa11f('0x41')]({},{'title':intUtil['getString'](_0x425c4d[_0xa11f('0x42')],_0x2f627e,'\x20'),'description':intUtil['getString'](_0x425c4d[_0xa11f('0x43')],_0x2f627e,'\x0a'),'customerid_contact@odata.bind':_0xa11f('0x44')+_0x1e86fd[_0xa11f('0x2d')]+')','ownerid@odata.bind':_0xa11f('0x28')+_0x1e86fd[_0xa11f('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x425c4d[_0xa11f('0x45')],_0x2f627e,_0x425c4d[_0xa11f('0x46')])),'headers':{'Authorization':_0xa11f('0x16')+_0x2d8257,'OData-Version':_0xa11f('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x425c4d[_0xa11f('0x46')]==='phonecall'){_0x3d20a4={'method':_0xa11f('0xb'),'uri':_0x54bfbe+_0xa11f('0x47'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x425c4d['Subjects'],_0x2f627e,'\x20'),'phonenumber':String(_0x2f627e['calleridnum']),'description':intUtil[_0xa11f('0x48')](_0x425c4d[_0xa11f('0x43')],_0x2f627e,'\x0a'),'regardingobjectid_contact@odata.bind':_0xa11f('0x44')+_0x1e86fd[_0xa11f('0x2d')]+')','ownerid@odata.bind':_0xa11f('0x28')+_0x1e86fd[_0xa11f('0x22')]+')','directioncode':_0x1e86fd[_0xa11f('0x49')]===_0xa11f('0x4a')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xa11f('0x28')+_0x1e86fd[_0xa11f('0x22')]+')','participationtypemask':_0x1e86fd['callDirection']===_0xa11f('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0xa11f('0x44')+_0x1e86fd['enduserId']+')','participationtypemask':_0x1e86fd[_0xa11f('0x49')]===_0xa11f('0x4a')?0x1:0x2}]},getCustomFields(_0x425c4d[_0xa11f('0x45')],_0x2f627e,_0x425c4d['ticketType'])),'headers':{'Authorization':_0xa11f('0x16')+_0x2d8257,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3d20a4);})['then'](function(_0x148582){var _0x3324a6=_0x148582[_0xa11f('0x29')][_0xa11f('0x2a')];var _0x4c6a01=_0x3324a6[_0xa11f('0x2b')](_0x3324a6['lastIndexOf']('(')+0x1,_0x3324a6[_0xa11f('0x2c')](')'));_0x1e86fd[_0xa11f('0x4b')]=_0x4c6a01;_0x3627f5(_0x1e86fd);})[_0xa11f('0x23')](function(_0x14a55b){_0x2c8a74(_0x14a55b[_0xa11f('0x14')]);});});}function emit(_0x37ab67,_0x57d38a,_0xeaaba7,_0x530484){var _0x3dd596={'uri':util[_0xa11f('0x4c')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x37ab67,_0xeaaba7,_0x530484)};io['to'](util[_0xa11f('0x4c')](_0xa11f('0x4d'),_0x57d38a))[_0xa11f('0x4e')](_0xa11f('0x4f'),_0x3dd596);}exports['cs']=function(_0x100d21,_0x4ef995,_0x1574cd,_0x3b896a,_0x57bad2,_0x189e1d,_0x42c411,_0x545d38){var _0x50852f={};_0x189e1d[_0xa11f('0xd')]=intUtil[_0xa11f('0x50')](_0x189e1d[_0xa11f('0xd')]);_0x189e1d[_0xa11f('0x51')]=intUtil[_0xa11f('0x50')](_0x189e1d['serverUrl']);_0x50852f[_0xa11f('0x49')]=_0x545d38==='queue'||_0x545d38===_0xa11f('0x52')?'queue':_0xa11f('0x25');var _0x508347=util[_0xa11f('0x4c')](_0xa11f('0x53'),_0x189e1d[_0xa11f('0xd')]);var _0x2b91a0=util[_0xa11f('0x4c')](_0xa11f('0x54'),_0x189e1d[_0xa11f('0x55')]);var _0x4c15d2=util[_0xa11f('0x4c')](_0xa11f('0x56'),_0x189e1d['serverUrl'],_0x4ef995[_0xa11f('0x57')],md5(_0x4ef995[_0xa11f('0x57')]));if(_0x57bad2&&_0x57bad2[_0xa11f('0x58')]){logger[_0xa11f('0x1d')](_0xa11f('0x59'),_0xa11f('0x5a'));_0x4ef995[_0xa11f('0x5b')]=_0x4c15d2;}else if(_0x42c411&&_0x42c411[_0xa11f('0x5c')]&&_0x42c411[_0xa11f('0x5c')]!==_0xa11f('0x5d')){logger[_0xa11f('0x1d')]('[OUTBOUND]',_0xa11f('0x5a'));_0x4ef995['recordingURL']=_0x4c15d2;}else{_0x4ef995['recordingURL']='';}return getUser(_0x50852f,_0x189e1d,_0x3b896a,_0x2b91a0,_0x508347,_0x545d38)[_0xa11f('0xf')](function(_0x3387fb){logger[_0xa11f('0x1d')]('['+_0x545d38[_0xa11f('0x12')]()+']\x20The\x20User\x20ID\x20is:',_0x3387fb[_0xa11f('0x22')]);logger['info']('['+_0x545d38[_0xa11f('0x12')]()+_0xa11f('0x5e'),_0x3387fb[_0xa11f('0x1b')]);return getEndUser(_0x3387fb,_0x189e1d,_0x2b91a0,_0x508347,_0x4ef995,_0x545d38);})[_0xa11f('0xf')](function(_0x41277f){logger[_0xa11f('0x1d')]('['+_0x545d38[_0xa11f('0x12')]()+_0xa11f('0x5f'),_0x41277f[_0xa11f('0x2d')]);logger[_0xa11f('0x1d')]('['+_0x545d38[_0xa11f('0x12')]()+_0xa11f('0x60'),_0x4ef995[_0xa11f('0x2e')]);return getTicket(_0x41277f,_0x189e1d,_0x2b91a0,_0x508347,_0x4ef995,_0x1574cd,_0x545d38);})[_0xa11f('0xf')](function(_0x49bfa7){logger[_0xa11f('0x1d')](util[_0xa11f('0x4c')]('['+_0x545d38[_0xa11f('0x12')]()+_0xa11f('0x61'),_0x1574cd[_0xa11f('0x46')],_0x49bfa7['ticketId']));logger[_0xa11f('0x1d')](util['format']('['+_0x545d38[_0xa11f('0x12')]()+_0xa11f('0x62'),_0x545d38));if(_0x545d38!==_0xa11f('0x52')){logger[_0xa11f('0x1d')]('['+_0x545d38[_0xa11f('0x12')]()+']',_0xa11f('0x63'));emit(_0x189e1d[_0xa11f('0xd')],_0x3b896a['name'],_0x1574cd[_0xa11f('0x46')],_0x49bfa7[_0xa11f('0x4b')]);}})['catch'](function(_0x3fdf0b){logger[_0xa11f('0x11')]('['+_0x545d38[_0xa11f('0x12')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xa11f('0x64')](_0x3fdf0b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index de79541..9bfd27b 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 _0xb28d=['redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','Fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','custom_fields','push','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','error','stringify','unmanaged','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','util','./util','../../../../config/environment','../../../../config/logger'];(function(_0x474cbc,_0xc43570){var _0x3ef6d4=function(_0x17a8da){while(--_0x17a8da){_0x474cbc['push'](_0x474cbc['shift']());}};_0x3ef6d4(++_0xc43570);}(_0xb28d,0x1db));var _0xdb28=function(_0x1c9093,_0x31eb87){_0x1c9093=_0x1c9093-0x0;var _0x32dd36=_0xb28d[_0x1c9093];return _0x32dd36;};'use strict';var _=require(_0xdb28('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xdb28('0x1'));var Redis=require('ioredis');var intUtil=require(_0xdb28('0x2'));var config=require(_0xdb28('0x3'));var logger=require(_0xdb28('0x4'))('freshdesk');config[_0xdb28('0x5')]=_[_0xdb28('0x6')](config[_0xdb28('0x5')],{'host':_0xdb28('0x7'),'port':0x18eb});var io=require(_0xdb28('0x8'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xdb28('0x9')};function emit(_0x594c27,_0x310d95,_0x4b4102){io['to'](_0x594c27)[_0xdb28('0xa')](_0x310d95,_0x4b4102);}function getTicket(_0x3d63a5,_0x523e1f,_0x3f5a31,_0x3e3dd4,_0x2d6d5f){logger[_0xdb28('0xb')](_0xdb28('0xc'));var _0x88ca6d=_[_0xdb28('0xd')]({'responder_id':_0x523e1f['id'],'requester_id':_0x3f5a31['id'],'name':util[_0xdb28('0xe')](_0xdb28('0xf'),_0x2d6d5f[_0xdb28('0x10')]),'phone':_0x2d6d5f['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xdb28('0x11')](_0x3e3dd4[_0xdb28('0x12')],_0x2d6d5f,'\x20'),'description':intUtil[_0xdb28('0x11')](_0x3e3dd4[_0xdb28('0x13')],_0x2d6d5f,_0xdb28('0x14')),'tags':getTags(_0x3e3dd4[_0xdb28('0x15')],'name')},getCustomFields(_0x3e3dd4[_0xdb28('0x16')],_0x2d6d5f));_0x88ca6d['custom_fields']=_[_0xdb28('0x17')](_[_0xdb28('0x18')](_0x88ca6d['custom_fields'],'id'),_0xdb28('0x19'));return request({'uri':util[_0xdb28('0xe')](_0xdb28('0x1a'),_0x3d63a5[_0xdb28('0x1b')]),'method':_0xdb28('0x1c'),'body':_0x88ca6d})[_0xdb28('0x1d')](function(_0x89cb83){logger[_0xdb28('0xb')](_0xdb28('0x1e'));return _0x89cb83;});}function getUser(_0x406a0a,_0x4a8c2b){if(intUtil[_0xdb28('0x1f')](_0x4a8c2b)){return request({'uri':util[_0xdb28('0xe')](_0xdb28('0x20'),_0x406a0a[_0xdb28('0x1b')]),'qs':{'email':_0x4a8c2b}})[_0xdb28('0x1d')](function(_0x31a0a1){if(_0x31a0a1[_0xdb28('0x21')]){logger[_0xdb28('0xb')](_0xdb28('0x22'));return _[_0xdb28('0x23')](_0x31a0a1,function(_0x271a7c){return _0x271a7c[_0xdb28('0x24')][_0xdb28('0x25')]===_0x4a8c2b;});}else{logger[_0xdb28('0xb')](_0xdb28('0x26'));return request({'uri':util['format'](_0xdb28('0x27'),_0x406a0a['remoteUri'])})[_0xdb28('0x1d')](function(_0x54005d){logger[_0xdb28('0xb')](_0xdb28('0x28'));return _0x54005d;});}});}else{logger[_0xdb28('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xdb28('0x27'),_0x406a0a[_0xdb28('0x1b')])})['then'](function(_0x33f891){logger['info'](_0xdb28('0x28'));return _0x33f891;});}}function getEndUser(_0x2c1622,_0x49a31e,_0x3f398f){logger[_0xdb28('0xb')](_0xdb28('0x29'),_0x3f398f);return request({'uri':util[_0xdb28('0xe')](_0xdb28('0x2a'),_0x2c1622['remoteUri']),'qs':{'phone':_0x3f398f}})[_0xdb28('0x1d')](function(_0x3985da){if(_0x3985da[_0xdb28('0x21')]){logger['info'](_0xdb28('0x2b'));return _[_0xdb28('0x23')](_0x3985da,{'phone':_0x3f398f});}else{logger[_0xdb28('0xb')](_0xdb28('0x2c'));return request({'uri':util[_0xdb28('0xe')](_0xdb28('0x2a'),_0x2c1622[_0xdb28('0x1b')]),'method':_0xdb28('0x1c'),'body':{'name':_0x49a31e,'phone':_0x3f398f}})[_0xdb28('0x1d')](function(_0x11c600){logger[_0xdb28('0xb')](_0xdb28('0x2d'));return _0x11c600;});}});}function getAuth(_0x113b13){return util[_0xdb28('0xe')](_0xdb28('0x2e'),new Buffer(_0x113b13[_0xdb28('0x2f')]+':X')['toString']('base64'));}function request(_0x281a38){logger[_0xdb28('0x30')](_0xdb28('0x31'),JSON['stringify'](_0x281a38));return rp(_[_0xdb28('0x6')](_0x281a38,{'method':_0xdb28('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2975df,_0x4f7ffa){var _0x7febe5=[];if(_0x2975df&&_0x2975df[_0xdb28('0x21')]>0x0){_0x7febe5=_[_0xdb28('0x33')](_0x2975df,_0x4f7ffa);}return _0x7febe5;}function getCustomFields(_0x55243c,_0x148f25){var _0x3bcbf1=[];var _0x282d8c={'custom_fields':[]};if(_0x55243c['length']>0x0){_[_0xdb28('0x34')](_0x55243c,function(_0x216b5e){if(_[_0xdb28('0x35')]([_0xdb28('0x36'),_0xdb28('0x37')],_0x216b5e[_0xdb28('0x38')])&&_0x216b5e[_0xdb28('0x39')]&&!_0x216b5e['customField']){_0x282d8c[_0x216b5e[_0xdb28('0x39')][_0xdb28('0x3a')]()]=_0x216b5e[_0xdb28('0x3b')][_0xdb28('0x3c')]();}else if(_[_0xdb28('0x35')](['string',_0xdb28('0x37')],_0x216b5e[_0xdb28('0x38')])&&_0x216b5e[_0xdb28('0x3d')]&&_0x216b5e[_0xdb28('0x3e')]){_0x282d8c[_0xdb28('0x3f')][_0xdb28('0x40')]({'id':_0x216b5e[_0xdb28('0x3d')],'value':_0x216b5e[_0xdb28('0x3b')][_0xdb28('0x3c')]()});}else if(_0x216b5e[_0xdb28('0x38')]==='variable'&&_0x216b5e[_0xdb28('0x41')]&&_0x216b5e['idField']&&_0x216b5e[_0xdb28('0x3e')]){_0x148f25[_0x216b5e['variableName']]&&_0x282d8c[_0xdb28('0x3f')][_0xdb28('0x40')]({'id':_0x216b5e[_0xdb28('0x3d')],'value':_0x148f25[_0x216b5e[_0xdb28('0x41')]][_0xdb28('0x3c')]()});}else if(_0x216b5e[_0xdb28('0x38')]==='customVariable'&&_0x216b5e[_0xdb28('0x42')]&&_0x216b5e[_0xdb28('0x42')][_0xdb28('0x43')]&&_0x216b5e['idField']&&_0x216b5e['customField']){_0x148f25[_0x216b5e[_0xdb28('0x42')][_0xdb28('0x43')][_0xdb28('0x3a')]()]&&_0x282d8c[_0xdb28('0x3f')][_0xdb28('0x40')]({'id':_0x216b5e[_0xdb28('0x3d')],'value':_0x148f25[_0x216b5e[_0xdb28('0x42')][_0xdb28('0x43')][_0xdb28('0x3a')]()][_0xdb28('0x3c')]()});}});}return _0x282d8c;}exports[_0xdb28('0x44')]=function(_0x45b425,_0x4db724,_0x362d5e,_0x32e55f,_0x4cd6f9,_0x3430ee){var _0xe9b4e,_0x4a1618;_0x3430ee[_0xdb28('0x1b')]=intUtil[_0xdb28('0x45')](_0x3430ee['remoteUri']);_0x3430ee[_0xdb28('0x46')]=intUtil[_0xdb28('0x45')](_0x3430ee['serverUrl']);if(_0x4cd6f9&&_0x4cd6f9[_0xdb28('0x47')]){logger[_0xdb28('0xb')](_0xdb28('0x48'),_0xdb28('0x49'));_0x4db724[_0xdb28('0x4a')]=util['format'](_0xdb28('0x4b'),_0x3430ee[_0xdb28('0x46')],_0x4db724['uniqueid'],md5(_0x4db724[_0xdb28('0x4c')]));}else{_0x4db724['recordingURL']='';}headers[_0xdb28('0x4d')]=getAuth(_0x3430ee);return getUser(_0x3430ee,_0x32e55f[_0xdb28('0x25')])['then'](function(_0x2ee955){_0xe9b4e=_0x2ee955;logger['info']('The\x20User\x20ID\x20is:',_0xe9b4e['id']);return getEndUser(_0x3430ee,_0x4db724[_0xdb28('0x10')],_0x4db724[_0xdb28('0x4e')]);})['then'](function(_0x332a62){_0x4a1618=_0x332a62;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4a1618['id']);return getTicket(_0x3430ee,_0xe9b4e,_0x4a1618,_0x362d5e,_0x4db724);})['then'](function(_0x3aa9b5){if(_0x3aa9b5&&_0x3aa9b5['id']){logger[_0xdb28('0xb')](_0xdb28('0x1e'));logger[_0xdb28('0xb')](_0xdb28('0x4f'),_0x3aa9b5['id']);logger[_0xdb28('0xb')](_0xdb28('0x48'),_0xdb28('0x50'));emit(util['format'](_0xdb28('0x51'),_0x32e55f[_0xdb28('0x43')]),_0xdb28('0x52'),{'uri':util['format'](_0xdb28('0x53'),_0x3430ee[_0xdb28('0x1b')],_0x3aa9b5['id'])});}})[_0xdb28('0x54')](function(_0x1fdfb1){logger['error'](_0xdb28('0x48'),JSON['stringify'](_0x1fdfb1));});};exports[_0xdb28('0x55')]=function(_0x5599b3,_0x558855,_0x1ff2bb,_0x4c697a,_0x5ee119,_0x3cdcda,_0x15995f){var _0x46388f,_0x3ebb60;_0x3cdcda[_0xdb28('0x1b')]=intUtil[_0xdb28('0x45')](_0x3cdcda[_0xdb28('0x1b')]);_0x3cdcda[_0xdb28('0x46')]=intUtil[_0xdb28('0x45')](_0x3cdcda[_0xdb28('0x46')]);if(_0x15995f&&_0x15995f[_0xdb28('0x56')]&&_0x15995f['recordingFormat']!=='none'){logger[_0xdb28('0xb')](_0xdb28('0x57'),_0xdb28('0x49'));_0x558855[_0xdb28('0x4a')]=util[_0xdb28('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3cdcda[_0xdb28('0x46')],_0x558855[_0xdb28('0x4c')],md5(_0x558855[_0xdb28('0x4c')]));}headers[_0xdb28('0x4d')]=getAuth(_0x3cdcda);return getUser(_0x3cdcda,_0x4c697a[_0xdb28('0x25')])[_0xdb28('0x1d')](function(_0x348688){_0x46388f=_0x348688;logger[_0xdb28('0xb')](_0xdb28('0x58'),_0x46388f['id']);return getEndUser(_0x3cdcda,_0x558855[_0xdb28('0x59')],_0x558855['destcalleridnum']);})[_0xdb28('0x1d')](function(_0x35a49e){_0x3ebb60=_0x35a49e;logger[_0xdb28('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3ebb60['id']);return getTicket(_0x3cdcda,_0x46388f,_0x3ebb60,_0x1ff2bb,_0x558855);})[_0xdb28('0x1d')](function(_0x52b683){if(_0x52b683&&_0x52b683['id']){logger[_0xdb28('0xb')](_0xdb28('0x1e'));logger[_0xdb28('0xb')](_0xdb28('0x4f'),_0x52b683['id']);logger[_0xdb28('0xb')](_0xdb28('0x57'),_0xdb28('0x50'));emit(util[_0xdb28('0xe')](_0xdb28('0x51'),_0x4c697a[_0xdb28('0x43')]),_0xdb28('0x52'),{'uri':util[_0xdb28('0xe')]('%s/helpdesk/tickets/%d',_0x3cdcda[_0xdb28('0x1b')],_0x52b683['id'])});}})[_0xdb28('0x54')](function(_0x36bf06){logger[_0xdb28('0x5a')](_0xdb28('0x57'),JSON[_0xdb28('0x5b')](_0x36bf06));});};exports[_0xdb28('0x5c')]=function(_0x381a03,_0xa17bd5,_0x306700,_0x4493b1,_0x1b7d9d,_0x483059){var _0x312a7c,_0x17c826;_0x483059[_0xdb28('0x1b')]=intUtil[_0xdb28('0x45')](_0x483059['remoteUri']);_0x483059[_0xdb28('0x46')]=intUtil[_0xdb28('0x45')](_0x483059['serverUrl']);if(_0x1b7d9d&&_0x1b7d9d[_0xdb28('0x47')]){logger[_0xdb28('0xb')]('['+_0xa17bd5[_0xdb28('0x5d')][_0xdb28('0x5e')]()+']',_0xdb28('0x49'));_0xa17bd5[_0xdb28('0x4a')]=util[_0xdb28('0xe')](_0xdb28('0x4b'),_0x483059[_0xdb28('0x46')],_0xa17bd5[_0xdb28('0x4c')],md5(_0xa17bd5[_0xdb28('0x4c')]));}else{_0xa17bd5['recordingURL']='';}headers[_0xdb28('0x4d')]=getAuth(_0x483059);return getUser(_0x483059,'')['then'](function(_0x3f4bfe){_0x312a7c=_0x3f4bfe;logger[_0xdb28('0xb')]('The\x20User\x20ID\x20is:',_0x312a7c['id']);return getEndUser(_0x483059,_0xa17bd5[_0xdb28('0x10')],_0xa17bd5[_0xdb28('0x4e')]);})['then'](function(_0x18ab39){_0x17c826=_0x18ab39;logger[_0xdb28('0xb')](_0xdb28('0x5f'),_0x17c826['id']);return getTicket(_0x483059,_0x312a7c,_0x17c826,_0x306700,_0xa17bd5);})['then'](function(_0x5d1a64){if(_0x5d1a64){logger[_0xdb28('0xb')](_0xdb28('0x1e'));logger[_0xdb28('0xb')](_0xdb28('0x4f'),_0x5d1a64['id']);}})['catch'](function(_0x25f6c1){logger['error']('['+_0xa17bd5[_0xdb28('0x5d')]['toUpperCase']()+']',JSON[_0xdb28('0x5b')](_0x25f6c1));});}; \ No newline at end of file +var _0xd3ac=['idField','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','unmanaged','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridnum','getString','Descriptions','
','Tags','name','Fields','custom_fields','keyBy','value','format','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','GET','map','string','picklist','type','customField','nameField','toLowerCase','content'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xd3ac,0x194));var _0xcd3a=function(_0x3b8339,_0x477c6a){_0x3b8339=_0x3b8339-0x0;var _0x20d062=_0xd3ac[_0x3b8339];return _0x20d062;};'use strict';var _=require(_0xcd3a('0x0'));var rp=require('request-promise');var md5=require(_0xcd3a('0x1'));var util=require(_0xcd3a('0x2'));var Redis=require(_0xcd3a('0x3'));var intUtil=require(_0xcd3a('0x4'));var config=require(_0xcd3a('0x5'));var logger=require(_0xcd3a('0x6'))(_0xcd3a('0x7'));config['redis']=_[_0xcd3a('0x8')](config[_0xcd3a('0x9')],{'host':_0xcd3a('0xa'),'port':0x18eb});var io=require(_0xcd3a('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0xcd3a('0xc'),'Accept':_0xcd3a('0xc')};function emit(_0x3a103b,_0x3cc83b,_0x386c86){io['to'](_0x3a103b)['emit'](_0x3cc83b,_0x386c86);}function getTicket(_0x1ab27a,_0x5757a9,_0x675e7,_0xf791c5,_0xe5e0e2){logger[_0xcd3a('0xd')](_0xcd3a('0xe'));var _0x3a9c57=_[_0xcd3a('0xf')]({'responder_id':_0x5757a9['id'],'requester_id':_0x675e7['id'],'name':util['format'](_0xcd3a('0x10'),_0xe5e0e2['calleridname']),'phone':_0xe5e0e2[_0xcd3a('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcd3a('0x12')](_0xf791c5['Subjects'],_0xe5e0e2,'\x20'),'description':intUtil[_0xcd3a('0x12')](_0xf791c5[_0xcd3a('0x13')],_0xe5e0e2,_0xcd3a('0x14')),'tags':getTags(_0xf791c5[_0xcd3a('0x15')],_0xcd3a('0x16'))},getCustomFields(_0xf791c5[_0xcd3a('0x17')],_0xe5e0e2));_0x3a9c57[_0xcd3a('0x18')]=_['mapValues'](_[_0xcd3a('0x19')](_0x3a9c57[_0xcd3a('0x18')],'id'),_0xcd3a('0x1a'));return request({'uri':util[_0xcd3a('0x1b')](_0xcd3a('0x1c'),_0x1ab27a['remoteUri']),'method':_0xcd3a('0x1d'),'body':_0x3a9c57})[_0xcd3a('0x1e')](function(_0x282f97){logger['info'](_0xcd3a('0x1f'));return _0x282f97;});}function getUser(_0xbc0f9c,_0x18ec81){if(intUtil[_0xcd3a('0x20')](_0x18ec81)){return request({'uri':util[_0xcd3a('0x1b')](_0xcd3a('0x21'),_0xbc0f9c['remoteUri']),'qs':{'email':_0x18ec81}})[_0xcd3a('0x1e')](function(_0x52212c){if(_0x52212c[_0xcd3a('0x22')]){logger[_0xcd3a('0xd')]('Agent\x20found!');return _[_0xcd3a('0x23')](_0x52212c,function(_0x442997){return _0x442997[_0xcd3a('0x24')]['email']===_0x18ec81;});}else{logger[_0xcd3a('0xd')](_0xcd3a('0x25'));return request({'uri':util[_0xcd3a('0x1b')](_0xcd3a('0x26'),_0xbc0f9c[_0xcd3a('0x27')])})[_0xcd3a('0x1e')](function(_0x37ce60){logger[_0xcd3a('0xd')]('Admin\x20account\x20selected.');return _0x37ce60;});}});}else{logger[_0xcd3a('0xd')](_0xcd3a('0x28'));return request({'uri':util['format'](_0xcd3a('0x26'),_0xbc0f9c['remoteUri'])})[_0xcd3a('0x1e')](function(_0x1d12d0){logger[_0xcd3a('0xd')](_0xcd3a('0x29'));return _0x1d12d0;});}}function getEndUser(_0x55afc4,_0x5db7f1,_0x2e37d2){logger[_0xcd3a('0xd')]('Searching\x20enduser\x20with\x20phone',_0x2e37d2);return request({'uri':util[_0xcd3a('0x1b')]('%s/api/v2/contacts',_0x55afc4[_0xcd3a('0x27')]),'qs':{'phone':_0x2e37d2}})['then'](function(_0x38f5d8){if(_0x38f5d8[_0xcd3a('0x22')]){logger[_0xcd3a('0xd')](_0xcd3a('0x2a'));return _[_0xcd3a('0x23')](_0x38f5d8,{'phone':_0x2e37d2});}else{logger[_0xcd3a('0xd')](_0xcd3a('0x2b'));return request({'uri':util[_0xcd3a('0x1b')](_0xcd3a('0x2c'),_0x55afc4[_0xcd3a('0x27')]),'method':_0xcd3a('0x1d'),'body':{'name':_0x5db7f1,'phone':_0x2e37d2}})[_0xcd3a('0x1e')](function(_0x6842d1){logger[_0xcd3a('0xd')](_0xcd3a('0x2d'));return _0x6842d1;});}});}function getAuth(_0x5b6c68){return util[_0xcd3a('0x1b')](_0xcd3a('0x2e'),new Buffer(_0x5b6c68[_0xcd3a('0x2f')]+':X')[_0xcd3a('0x30')](_0xcd3a('0x31')));}function request(_0x14d591){logger['debug'](_0xcd3a('0x32'),JSON[_0xcd3a('0x33')](_0x14d591));return rp(_[_0xcd3a('0x8')](_0x14d591,{'method':_0xcd3a('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x17bf06,_0x12504e){var _0x482ecd=[];if(_0x17bf06&&_0x17bf06[_0xcd3a('0x22')]>0x0){_0x482ecd=_[_0xcd3a('0x35')](_0x17bf06,_0x12504e);}return _0x482ecd;}function getCustomFields(_0x3059a3,_0x34b0c4){var _0x3c1e0c=[];var _0x218438={'custom_fields':[]};if(_0x3059a3[_0xcd3a('0x22')]>0x0){_['forEach'](_0x3059a3,function(_0x1b0b68){if(_['includes']([_0xcd3a('0x36'),_0xcd3a('0x37')],_0x1b0b68[_0xcd3a('0x38')])&&_0x1b0b68['nameField']&&!_0x1b0b68[_0xcd3a('0x39')]){_0x218438[_0x1b0b68[_0xcd3a('0x3a')][_0xcd3a('0x3b')]()]=_0x1b0b68[_0xcd3a('0x3c')][_0xcd3a('0x30')]();}else if(_['includes'](['string',_0xcd3a('0x37')],_0x1b0b68[_0xcd3a('0x38')])&&_0x1b0b68[_0xcd3a('0x3d')]&&_0x1b0b68[_0xcd3a('0x39')]){_0x218438[_0xcd3a('0x18')]['push']({'id':_0x1b0b68[_0xcd3a('0x3d')],'value':_0x1b0b68['content'][_0xcd3a('0x30')]()});}else if(_0x1b0b68['type']==='variable'&&_0x1b0b68[_0xcd3a('0x3e')]&&_0x1b0b68[_0xcd3a('0x3d')]&&_0x1b0b68['customField']){_0x34b0c4[_0x1b0b68['variableName']]&&_0x218438[_0xcd3a('0x18')][_0xcd3a('0x3f')]({'id':_0x1b0b68[_0xcd3a('0x3d')],'value':_0x34b0c4[_0x1b0b68[_0xcd3a('0x3e')]]['toString']()});}else if(_0x1b0b68['type']===_0xcd3a('0x40')&&_0x1b0b68[_0xcd3a('0x41')]&&_0x1b0b68[_0xcd3a('0x41')][_0xcd3a('0x16')]&&_0x1b0b68[_0xcd3a('0x3d')]&&_0x1b0b68[_0xcd3a('0x39')]){_0x34b0c4[_0x1b0b68[_0xcd3a('0x41')]['name'][_0xcd3a('0x3b')]()]&&_0x218438[_0xcd3a('0x18')][_0xcd3a('0x3f')]({'id':_0x1b0b68[_0xcd3a('0x3d')],'value':_0x34b0c4[_0x1b0b68[_0xcd3a('0x41')][_0xcd3a('0x16')]['toLowerCase']()][_0xcd3a('0x30')]()});}});}return _0x218438;}exports[_0xcd3a('0x42')]=function(_0x364b9e,_0x40e878,_0x24bd44,_0x178196,_0x49bd69,_0x6411eb){var _0x2f8f2f,_0x592ad0;_0x6411eb['remoteUri']=intUtil[_0xcd3a('0x43')](_0x6411eb[_0xcd3a('0x27')]);_0x6411eb[_0xcd3a('0x44')]=intUtil[_0xcd3a('0x43')](_0x6411eb[_0xcd3a('0x44')]);if(_0x49bd69&&_0x49bd69[_0xcd3a('0x45')]){logger[_0xcd3a('0xd')](_0xcd3a('0x46'),'Recording\x20is\x20enabled!');_0x40e878[_0xcd3a('0x47')]=util[_0xcd3a('0x1b')](_0xcd3a('0x48'),_0x6411eb[_0xcd3a('0x44')],_0x40e878[_0xcd3a('0x49')],md5(_0x40e878[_0xcd3a('0x49')]));}else{_0x40e878[_0xcd3a('0x47')]='';}headers[_0xcd3a('0x4a')]=getAuth(_0x6411eb);return getUser(_0x6411eb,_0x178196['email'])[_0xcd3a('0x1e')](function(_0x200ce1){_0x2f8f2f=_0x200ce1;logger[_0xcd3a('0xd')](_0xcd3a('0x4b'),_0x2f8f2f['id']);return getEndUser(_0x6411eb,_0x40e878[_0xcd3a('0x4c')],_0x40e878[_0xcd3a('0x11')]);})[_0xcd3a('0x1e')](function(_0x16960b){_0x592ad0=_0x16960b;logger[_0xcd3a('0xd')](_0xcd3a('0x4d'),_0x592ad0['id']);return getTicket(_0x6411eb,_0x2f8f2f,_0x592ad0,_0x24bd44,_0x40e878);})[_0xcd3a('0x1e')](function(_0x598cb4){if(_0x598cb4&&_0x598cb4['id']){logger[_0xcd3a('0xd')](_0xcd3a('0x1f'));logger[_0xcd3a('0xd')](_0xcd3a('0x4e'),_0x598cb4['id']);logger[_0xcd3a('0xd')](_0xcd3a('0x46'),_0xcd3a('0x4f'));emit(util['format'](_0xcd3a('0x50'),_0x178196[_0xcd3a('0x16')]),_0xcd3a('0x51'),{'uri':util[_0xcd3a('0x1b')](_0xcd3a('0x52'),_0x6411eb[_0xcd3a('0x27')],_0x598cb4['id'])});}})[_0xcd3a('0x53')](function(_0x254d15){logger[_0xcd3a('0x54')](_0xcd3a('0x46'),JSON[_0xcd3a('0x33')](_0x254d15));});};exports[_0xcd3a('0x55')]=function(_0x20fa69,_0x5f153a,_0x1fbe44,_0x1f4f53,_0x39f050,_0x188c10,_0x31f79b){var _0x4b1fdb,_0x1076b4;_0x188c10['remoteUri']=intUtil[_0xcd3a('0x43')](_0x188c10[_0xcd3a('0x27')]);_0x188c10[_0xcd3a('0x44')]=intUtil[_0xcd3a('0x43')](_0x188c10[_0xcd3a('0x44')]);if(_0x31f79b&&_0x31f79b[_0xcd3a('0x56')]&&_0x31f79b[_0xcd3a('0x56')]!==_0xcd3a('0x57')){logger[_0xcd3a('0xd')](_0xcd3a('0x58'),_0xcd3a('0x59'));_0x5f153a[_0xcd3a('0x47')]=util[_0xcd3a('0x1b')](_0xcd3a('0x48'),_0x188c10[_0xcd3a('0x44')],_0x5f153a[_0xcd3a('0x49')],md5(_0x5f153a['uniqueid']));}headers['Authorization']=getAuth(_0x188c10);return getUser(_0x188c10,_0x1f4f53['email'])[_0xcd3a('0x1e')](function(_0xf45d59){_0x4b1fdb=_0xf45d59;logger[_0xcd3a('0xd')](_0xcd3a('0x4b'),_0x4b1fdb['id']);return getEndUser(_0x188c10,_0x5f153a[_0xcd3a('0x5a')],_0x5f153a['destcalleridnum']);})[_0xcd3a('0x1e')](function(_0xbeea18){_0x1076b4=_0xbeea18;logger[_0xcd3a('0xd')](_0xcd3a('0x4d'),_0x1076b4['id']);return getTicket(_0x188c10,_0x4b1fdb,_0x1076b4,_0x1fbe44,_0x5f153a);})[_0xcd3a('0x1e')](function(_0x38470f){if(_0x38470f&&_0x38470f['id']){logger[_0xcd3a('0xd')]('Ticket\x20created!');logger[_0xcd3a('0xd')](_0xcd3a('0x4e'),_0x38470f['id']);logger['info']('[OUTBOUND]',_0xcd3a('0x4f'));emit(util[_0xcd3a('0x1b')](_0xcd3a('0x50'),_0x1f4f53[_0xcd3a('0x16')]),_0xcd3a('0x51'),{'uri':util[_0xcd3a('0x1b')]('%s/helpdesk/tickets/%d',_0x188c10[_0xcd3a('0x27')],_0x38470f['id'])});}})['catch'](function(_0x1fb000){logger[_0xcd3a('0x54')](_0xcd3a('0x58'),JSON[_0xcd3a('0x33')](_0x1fb000));});};exports[_0xcd3a('0x5b')]=function(_0x537c11,_0x3210da,_0x2c8cca,_0x1e877f,_0x598069,_0xa506e9){var _0x533db6,_0xf87533;_0xa506e9[_0xcd3a('0x27')]=intUtil[_0xcd3a('0x43')](_0xa506e9['remoteUri']);_0xa506e9[_0xcd3a('0x44')]=intUtil[_0xcd3a('0x43')](_0xa506e9[_0xcd3a('0x44')]);if(_0x598069&&_0x598069[_0xcd3a('0x45')]){logger[_0xcd3a('0xd')]('['+_0x3210da['lastevent']['toUpperCase']()+']',_0xcd3a('0x59'));_0x3210da[_0xcd3a('0x47')]=util[_0xcd3a('0x1b')](_0xcd3a('0x48'),_0xa506e9[_0xcd3a('0x44')],_0x3210da[_0xcd3a('0x49')],md5(_0x3210da[_0xcd3a('0x49')]));}else{_0x3210da['recordingURL']='';}headers[_0xcd3a('0x4a')]=getAuth(_0xa506e9);return getUser(_0xa506e9,'')[_0xcd3a('0x1e')](function(_0x1f3282){_0x533db6=_0x1f3282;logger['info']('The\x20User\x20ID\x20is:',_0x533db6['id']);return getEndUser(_0xa506e9,_0x3210da[_0xcd3a('0x4c')],_0x3210da[_0xcd3a('0x11')]);})['then'](function(_0x228be2){_0xf87533=_0x228be2;logger['info'](_0xcd3a('0x4d'),_0xf87533['id']);return getTicket(_0xa506e9,_0x533db6,_0xf87533,_0x2c8cca,_0x3210da);})[_0xcd3a('0x1e')](function(_0x21c604){if(_0x21c604){logger['info'](_0xcd3a('0x1f'));logger['info'](_0xcd3a('0x4e'),_0x21c604['id']);}})[_0xcd3a('0x53')](function(_0x15be01){logger[_0xcd3a('0x54')]('['+_0x3210da['lastevent'][_0xcd3a('0x5c')]()+']',JSON[_0xcd3a('0x33')](_0x15be01));});}; \ 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 8e0b353..09f2b3a 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 _0x03b7=['remoteUri','username','toLowerCase','destcalleridnum','calleridnum','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','socket.io-emitter','GET','/api/selector/owners','headers','info','users','length','Requested\x20Resource\x20not\x20Found','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','User\x20found:','userId','Admin\x20selected','adminEmail','adminId','catch','toUpperCase','/api/lookup?q=','&f=','&entities=contact','then','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl'];(function(_0x2e1c5f,_0x222266){var _0x16679c=function(_0x126379){while(--_0x126379){_0x2e1c5f['push'](_0x2e1c5f['shift']());}};_0x16679c(++_0x222266);}(_0x03b7,0x16e));var _0x703b=function(_0x12fe71,_0x1ed926){_0x12fe71=_0x12fe71-0x0;var _0x4ad7b1=_0x03b7[_0x12fe71];return _0x4ad7b1;};'use strict';var _=require(_0x703b('0x0'));var rp=require('request-promise');var md5=require(_0x703b('0x1'));var util=require(_0x703b('0x2'));var moment=require(_0x703b('0x3'));var Promise=require(_0x703b('0x4'));var Redis=require(_0x703b('0x5'));var intUtil=require('./util');var config=require(_0x703b('0x6'));var logger=require(_0x703b('0x7'))(_0x703b('0x8'));config['redis']=_[_0x703b('0x9')](config[_0x703b('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x703b('0xb'))(new Redis(config[_0x703b('0xa')]));function getAdminId(_0x5f32cb,_0x43b84e,_0x522463,_0x17e432){return new Promise(function(_0x3c87f0,_0x3c0ecc){var _0x53147a=![];var _0xcfe6d4={'method':_0x703b('0xc'),'uri':_0x17e432+_0x703b('0xd'),'json':!![]};_0xcfe6d4[_0x703b('0xe')]=_0x522463;logger[_0x703b('0xf')]('Getting\x20admin\x20information');return rp(_0xcfe6d4)['then'](function(_0x384f0d){if(_0x384f0d){var _0x51c58a=_0x384f0d[_0x703b('0x10')];var _0x58814a=null;for(_0x58814a=0x0;_0x58814a<_0x51c58a[_0x703b('0x11')];_0x58814a++){if(_0x51c58a[_0x58814a]['email']===_0x5f32cb['adminEmail']){_0x5f32cb['adminId']=_0x51c58a[_0x58814a]['id'];_0x53147a=!![];}}if(_0x53147a){logger[_0x703b('0xf')]('Admin\x20found:',_0x5f32cb['adminId']);_0x3c87f0(_0x5f32cb);}else{_0x3c0ecc({'statusCode':0x194,'message':_0x703b('0x12')});}}else{_0x3c0ecc({'statusCode':0x194,'message':_0x703b('0x12')});}})['catch'](function(_0x3bdcc6){logger[_0x703b('0x13')]('['+[_0x43b84e['toUpperCase']()]+']',_0x3bdcc6[_0x703b('0x14')]);_0x3c0ecc(_0x3bdcc6);});});}function getUser(_0x313001,_0x5e8a0b,_0x3a3561){return function(_0x2baac2){return new Promise(function(_0x33a3f2,_0x5d164c){var _0x1e805d={'method':_0x703b('0xc'),'uri':_0x3a3561+_0x703b('0xd'),'json':!![]};_0x1e805d[_0x703b('0xe')]=_0x5e8a0b;logger['info'](_0x703b('0x15'));return rp(_0x1e805d)['then'](function(_0x40c022){if(_0x40c022){var _0x48fe80=_0x40c022[_0x703b('0x10')];var _0x4d706e=![];var _0x1dce08=null;if(_0x2baac2[_0x703b('0x16')]!==null){logger[_0x703b('0xf')](_0x703b('0x17'),_0x2baac2[_0x703b('0x16')]);_0x2baac2[_0x703b('0x18')]=_0x2baac2[_0x703b('0x16')];for(_0x1dce08=0x0;_0x1dce08<_0x48fe80[_0x703b('0x11')];_0x1dce08++){if(_0x48fe80[_0x1dce08][_0x703b('0x19')]===_0x2baac2[_0x703b('0x16')]){_0x4d706e=!![];_0x2baac2['userId']=_0x48fe80[_0x1dce08]['id'];logger[_0x703b('0xf')](_0x703b('0x1a'),_0x2baac2[_0x703b('0x1b')]);}}}if(!_0x4d706e){logger['info'](_0x703b('0x1c'));_0x2baac2[_0x703b('0x18')]=_0x2baac2[_0x703b('0x1d')];_0x2baac2[_0x703b('0x1b')]=_0x2baac2[_0x703b('0x1e')];_0x4d706e=!![];}if(_0x4d706e){_0x33a3f2(_0x2baac2);}else{_0x5d164c({'statusCode':0x194,'message':_0x703b('0x12')});}}else{_0x5d164c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x703b('0x1f')](function(_0x2e5384){logger[_0x703b('0x13')]('['+[_0x313001[_0x703b('0x20')]()]+']',_0x2e5384[_0x703b('0x14')]);_0x5d164c(_0x2e5384);});});};}function searchContact(_0x3a9a92,_0x3dae63,_0x2b410c,_0x3966eb){return new Promise(function(_0x354ece,_0x390c59){var _0x554bad={'method':'GET','headers':_0x3dae63,'uri':_0x3a9a92+_0x703b('0x21')+_0x3966eb+_0x703b('0x22')+_0x2b410c+_0x703b('0x23'),'json':!![]};rp(_0x554bad)[_0x703b('0x24')](function(_0x10d0b1){var _0x24dc72=_[_0x703b('0x25')](_0x10d0b1[_0x703b('0x26')]['contacts'],[_0x2b410c,_0x3966eb]);_0x354ece(_0x24dc72);})[_0x703b('0x1f')](function(_0x50e8d9){_0x390c59(_0x50e8d9);});});}function getEndUser(_0x48b7b9,_0xd2fc66,_0x220218){return function(_0xa40fd0){return new Promise(function(_0x44c880,_0x1e94bb){logger[_0x703b('0xf')](util[_0x703b('0x27')](_0x703b('0x28'),_0xa40fd0[_0x703b('0x29')]));searchContact(_0x220218,_0xd2fc66,_0x703b('0x2a'),_0xa40fd0[_0x703b('0x29')])[_0x703b('0x24')](function(_0x2608f1){if(_0x2608f1){_0xa40fd0[_0x703b('0x2b')]=_0x2608f1['id'];logger['info'](_0x703b('0x2c'),_0xa40fd0['endUserId']);return _0x44c880(_0xa40fd0);}searchContact(_0x220218,_0xd2fc66,_0x703b('0x2d'),_0xa40fd0[_0x703b('0x29')])[_0x703b('0x24')](function(_0x24b7ff){if(_0x24b7ff){_0xa40fd0[_0x703b('0x2b')]=_0x24b7ff['id'];logger[_0x703b('0xf')](_0x703b('0x2e'),_0xa40fd0['endUserId']);return _0x44c880(_0xa40fd0);}createEndUser(_0xa40fd0,_0x48b7b9,_0xd2fc66,_0x220218)[_0x703b('0x24')](function(_0x6a952b){logger[_0x703b('0xf')](_0x703b('0x2f'),_0x6a952b[_0x703b('0x2b')]);return _0x44c880(_0x6a952b);});});})['catch'](function(_0x4ec8aa){_0x1e94bb(_0x4ec8aa);});});};}function createEndUser(_0x2dcf32,_0x133b61,_0x4aa6af,_0x33c347){return new Promise(function(_0x2e1c04,_0x100058){var _0x2230ee=moment();var _0x5774dd={'method':_0x703b('0x30'),'uri':_0x33c347+_0x703b('0x31'),'body':{'contact':{'last_name':_0x2dcf32['contactNumber'],'work_number':_0x2dcf32[_0x703b('0x29')],'mobile_number':_0x2dcf32[_0x703b('0x29')],'owner_id':_0x2dcf32[_0x703b('0x1b')],'created_at':_0x2230ee[_0x703b('0x27')](_0x703b('0x32'))}},'json':!![]};_0x5774dd[_0x703b('0xe')]=_0x4aa6af;logger[_0x703b('0xf')](_0x703b('0x33'));return rp(_0x5774dd)[_0x703b('0x24')](function(_0x44e218){_0x2dcf32[_0x703b('0x2b')]=_0x44e218[_0x703b('0x34')]['id'];_0x2e1c04(_0x2dcf32);})[_0x703b('0x1f')](function(_0x24b8cd){logger[_0x703b('0x13')]('['+[_0x133b61[_0x703b('0x20')]()]+']',_0x24b8cd['message']);_0x100058(_0x24b8cd[_0x703b('0x14')]);});});}function getTicket(_0x4ffe1a,_0xaeda5c,_0x4e55d4,_0x30ddc2,_0x38ec97){return function(_0x17ccc7){logger[_0x703b('0xf')](_0x703b('0x35'));return new Promise(function(_0xf3bea0,_0x4945c4){var _0x6aee7f=moment();var _0x176297={'method':_0x703b('0x30'),'uri':_0x4e55d4+_0x703b('0x36'),'body':{'title':intUtil[_0x703b('0x37')](_0x30ddc2[_0x703b('0x38')],_0x38ec97,'\x20'),'description':intUtil['getString'](_0x30ddc2[_0x703b('0x39')],_0x38ec97,'\x0a'),'owner_id':_0x17ccc7[_0x703b('0x1b')],'creater_id':_0x17ccc7[_0x703b('0x1e')],'targetable_id':_0x17ccc7[_0x703b('0x2b')],'targetable_type':'Contact','created_at':_0x6aee7f[_0x703b('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x6aee7f[_0x703b('0x3a')](0x1e,'m')[_0x703b('0x27')](_0x703b('0x32'))},'json':!![]};_0x176297[_0x703b('0xe')]=_0xaeda5c;return rp(_0x176297)['then'](function(_0x1574b4){_0x17ccc7[_0x703b('0x3b')]=_0x1574b4[_0x703b('0x3c')]['id'];logger[_0x703b('0xf')](_0x703b('0x3d'),_0x17ccc7[_0x703b('0x3b')]);_0xf3bea0(_0x17ccc7);})[_0x703b('0x1f')](function(_0x11376b){logger[_0x703b('0x13')]('['+[_0x4ffe1a[_0x703b('0x20')]()]+']',_0x11376b[_0x703b('0x14')]);_0x4945c4(_0x11376b[_0x703b('0x14')]);});});};}function emit(_0x119b6a,_0x16ddcd,_0x229a34){var _0x53906f={'uri':_0x119b6a+'/contacts/'+_0x229a34};io['to'](util['format'](_0x703b('0x3e'),_0x16ddcd))[_0x703b('0x3f')](_0x703b('0x40'),_0x53906f);}exports['cs']=function(_0x339950,_0x201103,_0x5a8b10,_0x4b8309,_0x1ad7b9,_0x1bff96,_0x4644aa,_0x37b97e){var _0x588973={};var _0x3e97bd={'Authorization':_0x703b('0x41')+_0x1bff96[_0x703b('0x42')]};_0x1bff96['remoteUri']=intUtil[_0x703b('0x43')](_0x1bff96['remoteUri']);_0x1bff96['serverUrl']=intUtil['stripTrailingSlash'](_0x1bff96[_0x703b('0x44')]);var _0x245792=_0x1bff96[_0x703b('0x45')];_0x588973['adminEmail']=_0x1bff96[_0x703b('0x46')];_0x588973['contactNumber']=_0x37b97e[_0x703b('0x47')]()==='outbound'?_0x201103[_0x703b('0x48')]:_0x201103[_0x703b('0x49')];_0x588973['callDirection']=_0x37b97e===_0x703b('0x4a')||_0x37b97e===_0x703b('0x4b')?'queue':'outbound';if(_0x4b8309){_0x588973[_0x703b('0x16')]=_0x4b8309[_0x703b('0x19')];}var _0x41c6d1=util[_0x703b('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1bff96[_0x703b('0x44')],_0x201103[_0x703b('0x4c')],md5(_0x201103[_0x703b('0x4c')]));if(_0x1ad7b9&&_0x1ad7b9[_0x703b('0x4d')]){logger[_0x703b('0xf')](_0x703b('0x4e'),'Recording\x20is\x20enabled!');_0x201103[_0x703b('0x4f')]=_0x41c6d1;}else if(_0x4644aa&&_0x4644aa[_0x703b('0x50')]&&_0x4644aa[_0x703b('0x50')]!==_0x703b('0x51')){logger['info']('[OUTBOUND]',_0x703b('0x52'));_0x201103[_0x703b('0x4f')]=_0x41c6d1;}else{_0x201103['recordingURL']='';}return getAdminId(_0x588973,_0x37b97e,_0x3e97bd,_0x245792)[_0x703b('0x24')](getUser(_0x37b97e,_0x3e97bd,_0x245792))[_0x703b('0x24')](getEndUser(_0x37b97e,_0x3e97bd,_0x245792))[_0x703b('0x24')](getTicket(_0x37b97e,_0x3e97bd,_0x245792,_0x5a8b10,_0x201103))[_0x703b('0x24')](function(_0x2ead6c){logger['info'](util[_0x703b('0x27')](_0x703b('0x53'),_0x2ead6c[_0x703b('0x3b')]));if(_0x37b97e!==_0x703b('0x4b')){logger[_0x703b('0xf')]('['+[_0x37b97e[_0x703b('0x20')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x245792,_0x4b8309[_0x703b('0x54')],_0x2ead6c[_0x703b('0x2b')]);}})[_0x703b('0x1f')](function(_0x5dc3b1){logger[_0x703b('0x13')]('['+[_0x37b97e[_0x703b('0x20')]()]+_0x703b('0x55'),util[_0x703b('0x56')](_0x5dc3b1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x48c9=['Creating\x20new\x20task','/api/tasks','getString','add','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','toLowerCase','destcalleridnum','queue','unmanaged','%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','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','localhost','socket.io-emitter','redis','GET','/api/selector/owners','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','info','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','Admin\x20selected','/api/lookup?q=','&entities=contact','find','contacts','catch','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact'];(function(_0x43cd28,_0x5f42ee){var _0x23d607=function(_0x43833d){while(--_0x43833d){_0x43cd28['push'](_0x43cd28['shift']());}};_0x23d607(++_0x5f42ee);}(_0x48c9,0x1b2));var _0x948c=function(_0x3c60fc,_0x593ef5){_0x3c60fc=_0x3c60fc-0x0;var _0x495fd2=_0x48c9[_0x3c60fc];return _0x495fd2;};'use strict';var _=require(_0x948c('0x0'));var rp=require(_0x948c('0x1'));var md5=require(_0x948c('0x2'));var util=require(_0x948c('0x3'));var moment=require(_0x948c('0x4'));var Promise=require(_0x948c('0x5'));var Redis=require(_0x948c('0x6'));var intUtil=require(_0x948c('0x7'));var config=require(_0x948c('0x8'));var logger=require(_0x948c('0x9'))(_0x948c('0xa'));config['redis']=_[_0x948c('0xb')](config['redis'],{'host':_0x948c('0xc'),'port':0x18eb});var io=require(_0x948c('0xd'))(new Redis(config[_0x948c('0xe')]));function getAdminId(_0x37d718,_0x5128b4,_0x18fe15,_0x25aa15){return new Promise(function(_0x5c11ed,_0xb8276){var _0x56175e=![];var _0x2eeee4={'method':_0x948c('0xf'),'uri':_0x25aa15+_0x948c('0x10'),'json':!![]};_0x2eeee4['headers']=_0x18fe15;logger['info'](_0x948c('0x11'));return rp(_0x2eeee4)[_0x948c('0x12')](function(_0x2441f4){if(_0x2441f4){var _0x3d740b=_0x2441f4[_0x948c('0x13')];var _0x59e291=null;for(_0x59e291=0x0;_0x59e291<_0x3d740b[_0x948c('0x14')];_0x59e291++){if(_0x3d740b[_0x59e291][_0x948c('0x15')]===_0x37d718[_0x948c('0x16')]){_0x37d718[_0x948c('0x17')]=_0x3d740b[_0x59e291]['id'];_0x56175e=!![];}}if(_0x56175e){logger[_0x948c('0x18')]('Admin\x20found:',_0x37d718[_0x948c('0x17')]);_0x5c11ed(_0x37d718);}else{_0xb8276({'statusCode':0x194,'message':_0x948c('0x19')});}}else{_0xb8276({'statusCode':0x194,'message':_0x948c('0x19')});}})['catch'](function(_0x234b2f){logger[_0x948c('0x1a')]('['+[_0x5128b4[_0x948c('0x1b')]()]+']',_0x234b2f[_0x948c('0x1c')]);_0xb8276(_0x234b2f);});});}function getUser(_0x579503,_0x38a3b4,_0x2a135c){return function(_0x173af7){return new Promise(function(_0x1f6e7a,_0x3e18bd){var _0x526e58={'method':_0x948c('0xf'),'uri':_0x2a135c+'/api/selector/owners','json':!![]};_0x526e58[_0x948c('0x1d')]=_0x38a3b4;logger[_0x948c('0x18')](_0x948c('0x1e'));return rp(_0x526e58)['then'](function(_0x1d90d6){if(_0x1d90d6){var _0x12785f=_0x1d90d6['users'];var _0x23b61b=![];var _0x538fdd=null;if(_0x173af7['agentEmail']!==null){logger['info'](_0x948c('0x1f'),_0x173af7[_0x948c('0x20')]);_0x173af7[_0x948c('0x21')]=_0x173af7[_0x948c('0x20')];for(_0x538fdd=0x0;_0x538fdd<_0x12785f[_0x948c('0x14')];_0x538fdd++){if(_0x12785f[_0x538fdd][_0x948c('0x15')]===_0x173af7[_0x948c('0x20')]){_0x23b61b=!![];_0x173af7[_0x948c('0x22')]=_0x12785f[_0x538fdd]['id'];logger[_0x948c('0x18')]('User\x20found:',_0x173af7['userId']);}}}if(!_0x23b61b){logger['info'](_0x948c('0x23'));_0x173af7[_0x948c('0x21')]=_0x173af7[_0x948c('0x16')];_0x173af7[_0x948c('0x22')]=_0x173af7[_0x948c('0x17')];_0x23b61b=!![];}if(_0x23b61b){_0x1f6e7a(_0x173af7);}else{_0x3e18bd({'statusCode':0x194,'message':_0x948c('0x19')});}}else{_0x3e18bd({'statusCode':0x194,'message':_0x948c('0x19')});}})['catch'](function(_0xafaa4f){logger[_0x948c('0x1a')]('['+[_0x579503['toUpperCase']()]+']',_0xafaa4f[_0x948c('0x1c')]);_0x3e18bd(_0xafaa4f);});});};}function searchContact(_0x3b991f,_0x3f1c2b,_0x4ca59e,_0x24d5db){return new Promise(function(_0x203201,_0x206147){var _0x475c28={'method':_0x948c('0xf'),'headers':_0x3f1c2b,'uri':_0x3b991f+_0x948c('0x24')+_0x24d5db+'&f='+_0x4ca59e+_0x948c('0x25'),'json':!![]};rp(_0x475c28)['then'](function(_0x3a86e8){var _0x51c3f9=_[_0x948c('0x26')](_0x3a86e8[_0x948c('0x27')][_0x948c('0x27')],[_0x4ca59e,_0x24d5db]);_0x203201(_0x51c3f9);})[_0x948c('0x28')](function(_0x5b6d0b){_0x206147(_0x5b6d0b);});});}function getEndUser(_0x26944c,_0x14821e,_0x1cc0b5){return function(_0x22f42d){return new Promise(function(_0x391d29,_0x17c88c){logger[_0x948c('0x18')](util['format'](_0x948c('0x29'),_0x22f42d[_0x948c('0x2a')]));searchContact(_0x1cc0b5,_0x14821e,_0x948c('0x2b'),_0x22f42d[_0x948c('0x2a')])[_0x948c('0x12')](function(_0xaff7c3){if(_0xaff7c3){_0x22f42d['endUserId']=_0xaff7c3['id'];logger[_0x948c('0x18')](_0x948c('0x2c'),_0x22f42d[_0x948c('0x2d')]);return _0x391d29(_0x22f42d);}searchContact(_0x1cc0b5,_0x14821e,'work_number',_0x22f42d['contactNumber'])['then'](function(_0x3bd463){if(_0x3bd463){_0x22f42d[_0x948c('0x2d')]=_0x3bd463['id'];logger[_0x948c('0x18')]('Contact\x20found\x20work_number:',_0x22f42d[_0x948c('0x2d')]);return _0x391d29(_0x22f42d);}createEndUser(_0x22f42d,_0x26944c,_0x14821e,_0x1cc0b5)['then'](function(_0x549587){logger[_0x948c('0x18')](_0x948c('0x2e'),_0x549587['endUserId']);return _0x391d29(_0x549587);});});})[_0x948c('0x28')](function(_0xb873c){_0x17c88c(_0xb873c);});});};}function createEndUser(_0x30138d,_0x2419c,_0x2fe757,_0x18926c){return new Promise(function(_0x1592b9,_0x582409){var _0x18524d=moment();var _0xf484b={'method':_0x948c('0x2f'),'uri':_0x18926c+_0x948c('0x30'),'body':{'contact':{'last_name':_0x30138d['contactNumber'],'work_number':_0x30138d[_0x948c('0x2a')],'mobile_number':_0x30138d[_0x948c('0x2a')],'owner_id':_0x30138d[_0x948c('0x22')],'created_at':_0x18524d[_0x948c('0x31')](_0x948c('0x32'))}},'json':!![]};_0xf484b[_0x948c('0x1d')]=_0x2fe757;logger['info'](_0x948c('0x33'));return rp(_0xf484b)[_0x948c('0x12')](function(_0x196794){_0x30138d['endUserId']=_0x196794['contact']['id'];_0x1592b9(_0x30138d);})[_0x948c('0x28')](function(_0x1360fe){logger['error']('['+[_0x2419c[_0x948c('0x1b')]()]+']',_0x1360fe[_0x948c('0x1c')]);_0x582409(_0x1360fe[_0x948c('0x1c')]);});});}function getTicket(_0x9f3ce9,_0x4efa7c,_0xa12569,_0x9eba71,_0x98ed38){return function(_0x4d0007){logger[_0x948c('0x18')](_0x948c('0x34'));return new Promise(function(_0x4a3923,_0x26f6dc){var _0x1a6c62=moment();var _0x2639d7={'method':'POST','uri':_0xa12569+_0x948c('0x35'),'body':{'title':intUtil[_0x948c('0x36')](_0x9eba71['Subjects'],_0x98ed38,'\x20'),'description':intUtil['getString'](_0x9eba71['Descriptions'],_0x98ed38,'\x0a'),'owner_id':_0x4d0007[_0x948c('0x22')],'creater_id':_0x4d0007[_0x948c('0x17')],'targetable_id':_0x4d0007['endUserId'],'targetable_type':'Contact','created_at':_0x1a6c62[_0x948c('0x31')](_0x948c('0x32')),'due_date':_0x1a6c62[_0x948c('0x37')](0x1e,'m')[_0x948c('0x31')](_0x948c('0x32'))},'json':!![]};_0x2639d7[_0x948c('0x1d')]=_0x4efa7c;return rp(_0x2639d7)[_0x948c('0x12')](function(_0x4ee62f){_0x4d0007[_0x948c('0x38')]=_0x4ee62f[_0x948c('0x39')]['id'];logger['info']('Task\x20created:',_0x4d0007[_0x948c('0x38')]);_0x4a3923(_0x4d0007);})[_0x948c('0x28')](function(_0x629ded){logger[_0x948c('0x1a')]('['+[_0x9f3ce9['toUpperCase']()]+']',_0x629ded['message']);_0x26f6dc(_0x629ded['message']);});});};}function emit(_0x58c2ff,_0x43a89a,_0x29035e){var _0x326f26={'uri':_0x58c2ff+_0x948c('0x3a')+_0x29035e};io['to'](util[_0x948c('0x31')](_0x948c('0x3b'),_0x43a89a))[_0x948c('0x3c')](_0x948c('0x3d'),_0x326f26);}exports['cs']=function(_0x4c61ac,_0x301fee,_0x39ee24,_0x471db9,_0x1a8340,_0x2eee6e,_0x481ece,_0x69ee42){var _0x21a0e4={};var _0x43a4b9={'Authorization':_0x948c('0x3e')+_0x2eee6e[_0x948c('0x3f')]};_0x2eee6e[_0x948c('0x40')]=intUtil[_0x948c('0x41')](_0x2eee6e[_0x948c('0x40')]);_0x2eee6e['serverUrl']=intUtil[_0x948c('0x41')](_0x2eee6e['serverUrl']);var _0x9ffe2=_0x2eee6e['remoteUri'];_0x21a0e4['adminEmail']=_0x2eee6e[_0x948c('0x42')];_0x21a0e4['contactNumber']=_0x69ee42[_0x948c('0x43')]()==='outbound'?_0x301fee[_0x948c('0x44')]:_0x301fee['calleridnum'];_0x21a0e4['callDirection']=_0x69ee42===_0x948c('0x45')||_0x69ee42===_0x948c('0x46')?_0x948c('0x45'):'outbound';if(_0x471db9){_0x21a0e4[_0x948c('0x20')]=_0x471db9[_0x948c('0x15')];}var _0x5bf671=util[_0x948c('0x31')](_0x948c('0x47'),_0x2eee6e['serverUrl'],_0x301fee[_0x948c('0x48')],md5(_0x301fee[_0x948c('0x48')]));if(_0x1a8340&&_0x1a8340[_0x948c('0x49')]){logger[_0x948c('0x18')]('[QUEUE]',_0x948c('0x4a'));_0x301fee['recordingURL']=_0x5bf671;}else if(_0x481ece&&_0x481ece[_0x948c('0x4b')]&&_0x481ece[_0x948c('0x4b')]!==_0x948c('0x4c')){logger[_0x948c('0x18')]('[OUTBOUND]',_0x948c('0x4a'));_0x301fee[_0x948c('0x4d')]=_0x5bf671;}else{_0x301fee[_0x948c('0x4d')]='';}return getAdminId(_0x21a0e4,_0x69ee42,_0x43a4b9,_0x9ffe2)[_0x948c('0x12')](getUser(_0x69ee42,_0x43a4b9,_0x9ffe2))[_0x948c('0x12')](getEndUser(_0x69ee42,_0x43a4b9,_0x9ffe2))[_0x948c('0x12')](getTicket(_0x69ee42,_0x43a4b9,_0x9ffe2,_0x39ee24,_0x301fee))[_0x948c('0x12')](function(_0x3b21b9){logger['info'](util['format'](_0x948c('0x4e'),_0x3b21b9[_0x948c('0x38')]));if(_0x69ee42!==_0x948c('0x46')){logger[_0x948c('0x18')]('['+[_0x69ee42['toUpperCase']()]+']',_0x948c('0x4f'));emit(_0x9ffe2,_0x471db9[_0x948c('0x50')],_0x3b21b9['endUserId']);}})[_0x948c('0x28')](function(_0x2307e3){logger[_0x948c('0x1a')]('['+[_0x69ee42[_0x948c('0x1b')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x2307e3,{'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 14fbb62..aec616a 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 _0x0f07=['./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','exec','includes','data1','find','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','toLowerCase','freshdesk','servicenow','dynamics365','unknown\x20integration','error','%s\x20configuration\x20#%s\x20not\x20found','data3','format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util'];(function(_0x3d8ad2,_0x243691){var _0x3b7f9d=function(_0x213a30){while(--_0x213a30){_0x3d8ad2['push'](_0x3d8ad2['shift']());}};_0x3b7f9d(++_0x243691);}(_0x0f07,0x1df));var _0x70f0=function(_0x15e55a,_0x284ab5){_0x15e55a=_0x15e55a-0x0;var _0x5cf240=_0x0f07[_0x15e55a];return _0x5cf240;};'use strict';var _=require(_0x70f0('0x0'));var util=require(_0x70f0('0x1'));var zendesk=require(_0x70f0('0x2'));var salesforce=require(_0x70f0('0x3'));var sugarcrm=require(_0x70f0('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x70f0('0x5'));var desk=require(_0x70f0('0x6'));var vtiger=require(_0x70f0('0x7'));var servicenow=require(_0x70f0('0x8'));var dynamics365=require(_0x70f0('0x9'));var freshsales=require(_0x70f0('0xa'));var integrations=[_0x70f0('0xb'),_0x70f0('0xc'),_0x70f0('0xd'),'freshdesk',_0x70f0('0xe'),_0x70f0('0xf'),_0x70f0('0x10'),'dynamics365','freshsales','servicenow'];exports[_0x70f0('0x11')]=function(_0x13e2d8,_0x114c0d,_0x25c0cf,_0x546253,_0x3fb952,_0x2de92f){if(_0x25c0cf){if(_[_0x70f0('0x12')](integrations,_0x13e2d8[_0x70f0('0x13')]['toLowerCase']())){try{var _0x4d17de=null;var _0x107c39='';var _0x21049f=_0x25c0cf[_0x13e2d8[_0x70f0('0x13')]['toLowerCase']()];if(_0x21049f){var _0x3d952b=_0x21049f[_0x13e2d8['data2']];if(_0x3d952b){var _0x4db8f5=_[_0x70f0('0x14')](_0x3d952b['Configurations'],{'id':parseInt(_0x13e2d8['data3'],0xa)});if(_0x4db8f5){if(_0x546253){if(_0x3fb952&&_0x114c0d['queue']){_0x107c39='queue';}else if(_0x114c0d[_0x70f0('0x15')]){_0x107c39=_0x70f0('0x16');}else{console[_0x70f0('0x17')](_0x70f0('0x18'),_0x114c0d);}}else{_0x107c39=_0x70f0('0x19');}switch(_0x13e2d8['data1'][_0x70f0('0x1a')]()){case _0x70f0('0xb'):zendesk[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case'salesforce':salesforce[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case _0x70f0('0xd'):sugarcrm[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case _0x70f0('0x1b'):freshdesk[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case _0x70f0('0xe'):zoho[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case _0x70f0('0xf'):desk[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case'vtiger':vtiger[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case'freshsales':freshsales['cs'](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f,_0x107c39);break;case _0x70f0('0x1c'):servicenow['cs'](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f,_0x107c39);break;case _0x70f0('0x1d'):dynamics365['cs'](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f,_0x107c39);break;default:console['log'](_0x70f0('0x1e'));}}else{_0x4d17de=require('../../../../config/logger')(_0x13e2d8[_0x70f0('0x13')]['toLowerCase']());_0x4d17de[_0x70f0('0x1f')]('[EXEC]',util['format'](_0x70f0('0x20'),_0x13e2d8['data1']['toLowerCase'](),_0x13e2d8[_0x70f0('0x21')]));}}else{_0x4d17de=require('../../../../config/logger')(_0x13e2d8['data1'][_0x70f0('0x1a')]());_0x4d17de[_0x70f0('0x1f')]('[EXEC]',util[_0x70f0('0x22')](_0x70f0('0x23'),_0x13e2d8['data1']['toLowerCase'](),_0x13e2d8[_0x70f0('0x24')]));}}else{}}catch(_0x190030){console[_0x70f0('0x1f')](_0x190030);}}}}; \ No newline at end of file +var _0xe3da=['./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','servicenow','exec','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','freshsales','dynamics365','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho'];(function(_0x3c88e5,_0x3c4490){var _0x54c015=function(_0x55477b){while(--_0x55477b){_0x3c88e5['push'](_0x3c88e5['shift']());}};_0x54c015(++_0x3c4490);}(_0xe3da,0x1cd));var _0xae3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe3da[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var zendesk=require(_0xae3d('0x2'));var salesforce=require(_0xae3d('0x3'));var sugarcrm=require(_0xae3d('0x4'));var freshdesk=require(_0xae3d('0x5'));var zoho=require(_0xae3d('0x6'));var desk=require(_0xae3d('0x7'));var vtiger=require(_0xae3d('0x8'));var servicenow=require(_0xae3d('0x9'));var dynamics365=require(_0xae3d('0xa'));var freshsales=require(_0xae3d('0xb'));var integrations=[_0xae3d('0xc'),_0xae3d('0xd'),_0xae3d('0xe'),_0xae3d('0xf'),'zoho',_0xae3d('0x10'),_0xae3d('0x11'),'dynamics365','freshsales',_0xae3d('0x12')];exports[_0xae3d('0x13')]=function(_0x420e28,_0x124833,_0x2705b8,_0x15d6da,_0x4bd4ec,_0x145762){if(_0x2705b8){if(_['includes'](integrations,_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')]())){try{var _0x7770eb=null;var _0x172f7a='';var _0x48aa74=_0x2705b8[_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')]()];if(_0x48aa74){var _0x16fd19=_0x48aa74[_0x420e28[_0xae3d('0x16')]];if(_0x16fd19){var _0x2afdd3=_[_0xae3d('0x17')](_0x16fd19[_0xae3d('0x18')],{'id':parseInt(_0x420e28['data3'],0xa)});if(_0x2afdd3){if(_0x15d6da){if(_0x4bd4ec&&_0x124833[_0xae3d('0x19')]){_0x172f7a=_0xae3d('0x19');}else if(_0x124833[_0xae3d('0x1a')]){_0x172f7a=_0xae3d('0x1b');}else{console[_0xae3d('0x1c')](_0xae3d('0x1d'),_0x124833);}}else{_0x172f7a='unmanaged';}switch(_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')]()){case _0xae3d('0xc'):zendesk[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case'salesforce':salesforce[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case _0xae3d('0xe'):sugarcrm[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case _0xae3d('0xf'):freshdesk[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case'zoho':zoho[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case'desk':desk[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case _0xae3d('0x11'):vtiger[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case _0xae3d('0x1e'):freshsales['cs'](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762,_0x172f7a);break;case _0xae3d('0x12'):servicenow['cs'](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762,_0x172f7a);break;case _0xae3d('0x1f'):dynamics365['cs'](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762,_0x172f7a);break;default:console[_0xae3d('0x1c')]('unknown\x20integration');}}else{_0x7770eb=require(_0xae3d('0x20'))(_0x420e28['data1'][_0xae3d('0x15')]());_0x7770eb[_0xae3d('0x21')](_0xae3d('0x22'),util[_0xae3d('0x23')](_0xae3d('0x24'),_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')](),_0x420e28[_0xae3d('0x25')]));}}else{_0x7770eb=require(_0xae3d('0x20'))(_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')]());_0x7770eb[_0xae3d('0x21')](_0xae3d('0x22'),util[_0xae3d('0x23')](_0xae3d('0x26'),_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')](),_0x420e28[_0xae3d('0x16')]));}}else{}}catch(_0x2131e9){console[_0xae3d('0x21')](_0x2131e9);}}}}; \ 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 5192951..b07f262 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 _0x0c91=['content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','https://login.salesforce.com','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','[OUTBOUND]','Fields','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','isNil',']\x20Ticket\x20%s\x20created.','toUpperCase','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','Subjects','getString','Descriptions','ticketType','Task','utc','IsRecurrence','endUserType','contact','lead','WhoId','WhatId','ContactId','account','AccountId','leadId','info','create','validateEmail','User','find','execute','then','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','sobject','Contact','length','$or','Lead','account_contact_lead','additionalSearchAccount','merge','Account','additionalSearchLead','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','includes','string','picklist','idField'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x0c91,0x1a7));var _0x10c9=function(_0x335464,_0x5f21e5){_0x335464=_0x335464-0x0;var _0x37fe91=_0x0c91[_0x335464];return _0x37fe91;};'use strict';var _=require(_0x10c9('0x0'));var rp=require(_0x10c9('0x1'));var moment=require(_0x10c9('0x2'));var BPromise=require(_0x10c9('0x3'));var md5=require(_0x10c9('0x4'));var jsforce=require('jsforce');var util=require(_0x10c9('0x5'));var Redis=require(_0x10c9('0x6'));var intUtil=require(_0x10c9('0x7'));var config=require(_0x10c9('0x8'));var logger=require(_0x10c9('0x9'))(_0x10c9('0xa'));config[_0x10c9('0xb')]=_[_0x10c9('0xc')](config[_0x10c9('0xb')],{'host':_0x10c9('0xd'),'port':0x18eb});var io=require(_0x10c9('0xe'))(new Redis(config[_0x10c9('0xb')]));function emit(_0x3f51f8,_0x4bda55,_0x1866bb){io['to'](_0x3f51f8)[_0x10c9('0xf')](_0x4bda55,_0x1866bb);}function getTicket(_0x4ec901,_0x4edd58,_0x469e2f,_0x158a71,_0x1cf380,_0x55fa02,_0x48fc3f,_0x3ab20c){var _0x16fa07=Object['assign']({},{'OwnerId':_0x4edd58['id'],'Subject':intUtil['getString'](_0x158a71[_0x10c9('0x10')],_0x1cf380,'\x20'),'Description':intUtil[_0x10c9('0x11')](_0x158a71[_0x10c9('0x12')],_0x1cf380,'\x0a')},getCustomFields(_0x55fa02,_0x1cf380));if(_0x469e2f){if(_0x158a71[_0x10c9('0x13')]===_0x10c9('0x14')){_0x16fa07['ActivityDate']=moment[_0x10c9('0x15')]();_0x16fa07['IsReminderSet']=![];_0x16fa07[_0x10c9('0x16')]=![];if(_0x469e2f[_0x10c9('0x17')]===_0x10c9('0x18')||_0x469e2f[_0x10c9('0x17')]===_0x10c9('0x19')){_0x16fa07[_0x10c9('0x1a')]=_0x469e2f['id'];}else if(_0x469e2f[_0x10c9('0x17')]==='account'){_0x16fa07[_0x10c9('0x1b')]=_0x469e2f['id'];}}else if(_0x158a71['ticketType']==='Case'){if(_0x469e2f['endUserType']===_0x10c9('0x18')){_0x16fa07[_0x10c9('0x1c')]=_0x469e2f['id'];}else if(_0x469e2f['endUserType']===_0x10c9('0x1d')){_0x16fa07[_0x10c9('0x1e')]=_0x469e2f['id'];}else if(_0x469e2f[_0x10c9('0x17')]==='lead'&&_0x158a71[_0x10c9('0x1f')]){_0x16fa07[_0x158a71[_0x10c9('0x1f')]]=_0x469e2f['id'];}else{logger[_0x10c9('0x20')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x48fc3f['sobject'](_0x158a71[_0x10c9('0x13')])[_0x10c9('0x21')](_0x16fa07);}function getUser(_0x136b02,_0x1b6441,_0xf041b9){if(!_['isNil'](_0x1b6441)&&intUtil[_0x10c9('0x22')](_0x1b6441)){var _0x37603d={'Email':_0x1b6441};var _0x28efef={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xf041b9['sobject'](_0x10c9('0x23'))[_0x10c9('0x24')](_0x37603d,_0x28efef)[_0x10c9('0x25')]()[_0x10c9('0x26')](function(_0x49b4e9){if(_0x49b4e9['length']){var _0x20a71e=_[_0x10c9('0x24')](_0x49b4e9,function(_0x4db8b1){return _0x4db8b1['Email']===_0x1b6441;});if(_0x20a71e){logger[_0x10c9('0x20')](_0x10c9('0x27'),_0x1b6441);return BPromise['resolve']({'id':_0x20a71e['Id'],'name':_0x20a71e[_0x10c9('0x28')]});}}else{logger[_0x10c9('0x20')](_0x10c9('0x29'),_0x1b6441);return _0xf041b9['identity']()[_0x10c9('0x26')](function(_0x15bf65){return BPromise['resolve']({'id':_0x15bf65[_0x10c9('0x2a')],'name':_0x15bf65[_0x10c9('0x2b')]});});}});}else{logger[_0x10c9('0x20')](_0x10c9('0x29'),_0x1b6441);return _0xf041b9['identity']()[_0x10c9('0x26')](function(_0x4ec0ef){return BPromise[_0x10c9('0x2c')]({'id':_0x4ec0ef['user_id'],'name':_0x4ec0ef[_0x10c9('0x2b')]});});}}function getEndUser(_0x37737d,_0x40e8a0,_0x3f714b,_0x8427d3,_0x562a6b){var _0x576fea={'$or':{'Phone':_0x8427d3}};var _0x29d7ea={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x10c9('0x2c')]()['then'](function(){logger[_0x10c9('0x20')](_0x10c9('0x2d'),_0x8427d3,_0x40e8a0[_0x10c9('0x2e')]);switch(_0x40e8a0[_0x10c9('0x2e')]){case'contact_lead':var _0x485d45=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x30')]){var _0x54c13b={};_0x54c13b[_0x40e8a0['additionalSearchContact']]=_0x8427d3;_['merge'](_0x485d45['$or'],_0x54c13b);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x32'))['find'](_0x485d45,_0x29d7ea)['execute']()[_0x10c9('0x26')](function(_0x46b3f9){if(_0x46b3f9&&_0x46b3f9[_0x10c9('0x33')]){return _0x46b3f9;}else{var _0x4adefe=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0['additionalSearchLead']){var _0xaf53fb={};_0xaf53fb[_0x40e8a0['additionalSearchLead']]=_0x8427d3;_['merge'](_0x4adefe[_0x10c9('0x34')],_0xaf53fb);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x35'))[_0x10c9('0x24')](_0x4adefe,_0x29d7ea);}});case _0x10c9('0x36'):var _0x8b8b54=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x37')]){var _0x54c13b={};_0x54c13b[_0x40e8a0[_0x10c9('0x37')]]=_0x8427d3;_[_0x10c9('0x38')](_0x8b8b54[_0x10c9('0x34')],_0x54c13b);}return _0x562a6b['sobject'](_0x10c9('0x39'))[_0x10c9('0x24')](_0x8b8b54,_0x29d7ea)[_0x10c9('0x25')]()[_0x10c9('0x26')](function(_0x192885){if(_0x192885&&_0x192885['length']){return _0x192885;}else{var _0x57b757=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x30')]){var _0x147263={};_0x147263[_0x40e8a0[_0x10c9('0x30')]]=_0x8427d3;_[_0x10c9('0x38')](_0x57b757['$or'],_0x147263);}return _0x562a6b[_0x10c9('0x31')]('Contact')[_0x10c9('0x24')](_0x57b757,_0x29d7ea)['then'](function(_0xc62661){if(_0xc62661&&_0xc62661[_0x10c9('0x33')]){return _0xc62661;}else{var _0x22847d=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x3a')]){var _0x43f823={};_0x43f823[_0x40e8a0[_0x10c9('0x3a')]]=_0x8427d3;_[_0x10c9('0x38')](_0x22847d['$or'],_0x43f823);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x35'))['find'](_0x22847d,_0x29d7ea);}});}});case _0x10c9('0x18'):var _0x485d45=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x30')]){var _0x54c13b={};_0x54c13b[_0x40e8a0[_0x10c9('0x30')]]=_0x8427d3;_[_0x10c9('0x38')](_0x485d45[_0x10c9('0x34')],_0x54c13b);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x32'))[_0x10c9('0x24')](_0x485d45,_0x29d7ea)[_0x10c9('0x25')]();case _0x10c9('0x19'):var _0x54ce7a=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x3a')]){var _0x54c13b={};_0x54c13b[_0x40e8a0[_0x10c9('0x3a')]]=_0x8427d3;_['merge'](_0x54ce7a[_0x10c9('0x34')],_0x54c13b);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x35'))[_0x10c9('0x24')](_0x54ce7a,_0x29d7ea);case _0x10c9('0x1d'):var _0x8b8b54=_['cloneDeep'](_0x576fea);if(_0x40e8a0['additionalSearchAccount']){var _0x54c13b={};_0x54c13b[_0x40e8a0[_0x10c9('0x37')]]=_0x8427d3;_[_0x10c9('0x38')](_0x8b8b54['$or'],_0x54c13b);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x39'))[_0x10c9('0x24')](_0x8b8b54,_0x29d7ea);default:return null;}})[_0x10c9('0x26')](function(_0x4b7bba){if(_0x4b7bba&&_0x4b7bba[_0x10c9('0x33')]){var _0x11c3f7=_['first'](_0x4b7bba);if(_0x11c3f7){return BPromise['resolve']({'id':_0x11c3f7['Id'],'name':_0x11c3f7['Name'],'phone':_0x11c3f7[_0x10c9('0x3b')],'endUserType':_0x11c3f7[_0x10c9('0x3c')][_0x10c9('0x3d')][_0x10c9('0x3e')]()});}}})[_0x10c9('0x26')](function(_0x581a39){if(_0x581a39){logger[_0x10c9('0x20')](_0x10c9('0x3f'),_0x581a39[_0x10c9('0x17')],_0x8427d3);return BPromise['resolve'](_0x581a39);}else{logger[_0x10c9('0x20')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x8427d3);var _0x345c62={'Phone':_0x8427d3};if(_0x40e8a0[_0x10c9('0x40')]){if(_0x40e8a0[_0x10c9('0x40')]===_0x10c9('0x18')){logger[_0x10c9('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x8427d3,_0x40e8a0[_0x10c9('0x40')]);_0x345c62[_0x10c9('0x41')]=_0x3f714b!==_0x10c9('0x42')?_0x3f714b:util[_0x10c9('0x43')](_0x10c9('0x44'),_0x8427d3);}else if(_0x40e8a0[_0x10c9('0x40')]===_0x10c9('0x19')){logger[_0x10c9('0x20')](_0x10c9('0x45'),_0x8427d3,_0x40e8a0[_0x10c9('0x40')]);_0x345c62[_0x10c9('0x41')]=_0x3f714b!==_0x10c9('0x42')?_0x3f714b:util['format'](_0x10c9('0x44'),_0x8427d3);_0x345c62[_0x10c9('0x46')]=_0x10c9('0x47');}else if(_0x40e8a0[_0x10c9('0x40')]===_0x10c9('0x1d')){logger[_0x10c9('0x20')](_0x10c9('0x45'),_0x8427d3,_0x40e8a0[_0x10c9('0x40')]);_0x345c62['Name']=_0x3f714b!==_0x10c9('0x42')?_0x3f714b:util[_0x10c9('0x43')]('Caller\x20-\x20%s',_0x8427d3);}else{return null;}}return _0x562a6b[_0x10c9('0x31')](_[_0x10c9('0x48')](_0x40e8a0[_0x10c9('0x40')]))['create'](_0x345c62)[_0x10c9('0x26')](function(_0x304605){return BPromise[_0x10c9('0x2c')]({'id':_0x304605['id'],'endUserType':_0x40e8a0[_0x10c9('0x40')]});});}});}function getCustomFields(_0x5caf83,_0x46832f){var _0x40d98d={};if(_0x5caf83[_0x10c9('0x33')]>0x0){_['forEach'](_0x5caf83,function(_0x3d6696){if(_[_0x10c9('0x49')]([_0x10c9('0x4a'),_0x10c9('0x4b')],_0x3d6696[_0x10c9('0x3d')])&&_0x3d6696[_0x10c9('0x4c')]){_0x40d98d[_0x3d6696['idField']]=_0x3d6696[_0x10c9('0x4d')][_0x10c9('0x4e')]();}else if(_0x3d6696['type']===_0x10c9('0x4f')&&_0x3d6696[_0x10c9('0x50')]&&_0x3d6696['idField']){_0x46832f[_0x3d6696[_0x10c9('0x50')]]&&(_0x40d98d[_0x3d6696[_0x10c9('0x4c')]]=_0x46832f[_0x3d6696['variableName']]['toString']());}else if(_0x3d6696[_0x10c9('0x3d')]===_0x10c9('0x51')&&_0x3d6696[_0x10c9('0x52')]&&_0x3d6696['Variable'][_0x10c9('0x53')]&&_0x3d6696[_0x10c9('0x4c')]){_0x46832f[_0x3d6696[_0x10c9('0x52')][_0x10c9('0x53')][_0x10c9('0x3e')]()]&&(_0x40d98d[_0x3d6696[_0x10c9('0x4c')]]=_0x46832f[_0x3d6696[_0x10c9('0x52')]['name']['toLowerCase']()][_0x10c9('0x4e')]());}});}return _0x40d98d;}function getConnection(_0x1ddd5c){var _0x413d0f=_0x1ddd5c[_0x10c9('0x54')][_0x10c9('0x55')](_0x1ddd5c[_0x10c9('0x56')]);var _0x2d796b=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1ddd5c['remoteUri']||_0x10c9('0x57'),'clientId':_0x1ddd5c['clientId'],'clientSecret':_0x1ddd5c[_0x10c9('0x58')]}});return _0x2d796b[_0x10c9('0x59')](_0x1ddd5c[_0x10c9('0x5a')],_0x413d0f)[_0x10c9('0x26')](function(){logger['info']('Connection\x20established.');return _0x2d796b;});}exports[_0x10c9('0x5b')]=function(_0x5719be,_0x29c4de,_0x554127,_0x24fc98,_0x4e8d76,_0x25449d){var _0x537974,_0x2c4956,_0x7b93f6,_0x5a506d;_0x25449d[_0x10c9('0x5c')]=intUtil[_0x10c9('0x5d')](_0x25449d[_0x10c9('0x5c')]);_0x25449d[_0x10c9('0x5e')]=intUtil[_0x10c9('0x5d')](_0x25449d[_0x10c9('0x5e')]);if(_0x4e8d76&&_0x4e8d76[_0x10c9('0x5f')]){logger['info'](_0x10c9('0x60'),_0x10c9('0x61'));_0x29c4de[_0x10c9('0x62')]=util[_0x10c9('0x43')](_0x10c9('0x63'),_0x25449d[_0x10c9('0x5c')],_0x29c4de[_0x10c9('0x64')],md5(_0x29c4de[_0x10c9('0x64')]));}else{_0x29c4de[_0x10c9('0x62')]='';}return getConnection(_0x25449d)[_0x10c9('0x26')](function(_0xfe8dde){_0x5a506d=_0xfe8dde;return getUser(_0x25449d,_0x24fc98[_0x10c9('0x65')],_0x5a506d);})[_0x10c9('0x26')](function(_0x116055){_0x537974=_0x116055;return getEndUser(_0x25449d,_0x554127,_0x29c4de['calleridname'],_0x29c4de[_0x10c9('0x66')],_0x5a506d);})['then'](function(_0x147572){_0x2c4956=_0x147572;return getTicket(_0x25449d,_0x537974,_0x2c4956,_0x554127,_0x29c4de,_0x554127['Fields'],_0x5a506d,_0x10c9('0x5b'));})[_0x10c9('0x26')](function(_0x48ead3){_0x7b93f6=_0x48ead3;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x7b93f6['id']);logger[_0x10c9('0x20')](_0x10c9('0x67'),_0x7b93f6['id'],_0x24fc98[_0x10c9('0x53')],_0x25449d[_0x10c9('0x3d')]);switch(_0x25449d[_0x10c9('0x3d')]){case _0x10c9('0x68'):emit(util[_0x10c9('0x43')](_0x10c9('0x69'),_0x24fc98[_0x10c9('0x53')]),_0x10c9('0x6a'),{'recordId':_0x7b93f6['id']});break;case _0x10c9('0x6b'):emit(util[_0x10c9('0x43')]('user:%s',_0x24fc98[_0x10c9('0x53')]),'trigger:browser:url',{'uri':util[_0x10c9('0x43')](_0x10c9('0x6c'),_0x5a506d[_0x10c9('0x6d')],_0x7b93f6['id'])});break;default:logger[_0x10c9('0x6e')](_0x10c9('0x6f'));}})[_0x10c9('0x70')](function(_0x17da5e){logger[_0x10c9('0x6e')](_0x10c9('0x60'),_0x17da5e);});};exports['outbound']=function(_0x1103a0,_0x411374,_0x424c89,_0x3b3105,_0x292769,_0x41997c,_0x5475b3){var _0x387c5b,_0xc3b9c9,_0x16fb88,_0x3c8167;_0x41997c[_0x10c9('0x5c')]=intUtil['stripTrailingSlash'](_0x41997c[_0x10c9('0x5c')]);_0x41997c[_0x10c9('0x5e')]=intUtil[_0x10c9('0x5d')](_0x41997c[_0x10c9('0x5e')]);if(_0x5475b3&&_0x5475b3[_0x10c9('0x71')]&&_0x5475b3['recordingFormat']!=='none'){logger[_0x10c9('0x20')](_0x10c9('0x72'),'Recording\x20is\x20enabled!');_0x411374[_0x10c9('0x62')]=util[_0x10c9('0x43')](_0x10c9('0x63'),_0x41997c[_0x10c9('0x5c')],_0x411374['uniqueid'],md5(_0x411374[_0x10c9('0x64')]));}return getConnection(_0x41997c)['then'](function(_0x1e6720){_0x3c8167=_0x1e6720;return getUser(_0x41997c,_0x3b3105[_0x10c9('0x65')],_0x3c8167);})[_0x10c9('0x26')](function(_0x59fb74){_0x387c5b=_0x59fb74;return getEndUser(_0x41997c,_0x424c89,_0x411374['destcalleridname'],_0x411374['destcalleridnum'],_0x3c8167);})[_0x10c9('0x26')](function(_0x5a1b2b){_0xc3b9c9=_0x5a1b2b;return getTicket(_0x41997c,_0x387c5b,_0xc3b9c9,_0x424c89,_0x411374,_0x424c89[_0x10c9('0x73')],_0x3c8167,_0x10c9('0x74'));})[_0x10c9('0x26')](function(_0x2aa358){_0x16fb88=_0x2aa358;logger[_0x10c9('0x20')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x16fb88['id']);logger[_0x10c9('0x20')](_0x10c9('0x75'),_0x16fb88['id'],_0x3b3105['name'],_0x41997c[_0x10c9('0x3d')]);switch(_0x41997c[_0x10c9('0x3d')]){case'integrationTab':emit(util['format'](_0x10c9('0x69'),_0x3b3105[_0x10c9('0x53')]),_0x10c9('0x6a'),{'recordId':_0x16fb88['id']});break;case'newTab':emit(util[_0x10c9('0x43')](_0x10c9('0x69'),_0x3b3105[_0x10c9('0x53')]),_0x10c9('0x76'),{'uri':util[_0x10c9('0x43')]('%s/%s/e',_0x3c8167[_0x10c9('0x6d')],_0x16fb88['id'])});break;default:logger[_0x10c9('0x6e')](_0x10c9('0x72'),_0x10c9('0x77'));}})[_0x10c9('0x70')](function(_0x317b99){logger['error'](_0x10c9('0x72'),_0x317b99);});};exports[_0x10c9('0x78')]=function(_0x404523,_0x470100,_0x3254ee,_0x49390c,_0x47c229,_0x33e7a1){var _0x3197c4,_0x5e62bc,_0x57d28b,_0x627793;_0x33e7a1[_0x10c9('0x5c')]=intUtil[_0x10c9('0x5d')](_0x33e7a1[_0x10c9('0x5c')]);_0x33e7a1[_0x10c9('0x5e')]=intUtil[_0x10c9('0x5d')](_0x33e7a1[_0x10c9('0x5e')]);if(_0x47c229&&_0x47c229[_0x10c9('0x5f')]){logger[_0x10c9('0x20')]('['+_0x470100[_0x10c9('0x79')]['toUpperCase']()+']',_0x10c9('0x61'));_0x470100[_0x10c9('0x62')]=util[_0x10c9('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x33e7a1[_0x10c9('0x5c')],_0x470100[_0x10c9('0x64')],md5(_0x470100['uniqueid']));}else{_0x470100[_0x10c9('0x62')]='';}return getConnection(_0x33e7a1)[_0x10c9('0x26')](function(_0x47f767){_0x627793=_0x47f767;if(!_[_0x10c9('0x7a')](_0x49390c)){return getUser(_0x33e7a1,_0x49390c[_0x10c9('0x53')],_0x627793);}else{return getUser(_0x33e7a1,null,_0x627793);}})[_0x10c9('0x26')](function(_0x247e1c){_0x3197c4=_0x247e1c;return getEndUser(_0x33e7a1,_0x3254ee,_0x470100['calleridname'],_0x470100[_0x10c9('0x66')],_0x627793);})[_0x10c9('0x26')](function(_0x49d3fa){_0x5e62bc=_0x49d3fa;return getTicket(_0x33e7a1,_0x3197c4,_0x5e62bc,_0x3254ee,_0x470100,_0x3254ee[_0x10c9('0x73')],_0x627793);})[_0x10c9('0x26')](function(_0x338879){_0x57d28b=_0x338879;logger['info']('['+_0x470100[_0x10c9('0x79')]['toUpperCase']()+_0x10c9('0x7b'),_0x57d28b['id']);logger['info']('['+_0x470100['lastevent'][_0x10c9('0x7c')]()+']\x20Integration\x20account\x20type\x20%s.',_0x33e7a1[_0x10c9('0x3d')]);})[_0x10c9('0x70')](function(_0x54b859){logger['error']('['+_0x470100[_0x10c9('0x79')][_0x10c9('0x7c')]()+']',_0x54b859);});}; \ No newline at end of file +var _0x1657=['queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lastevent','request-promise','bluebird','jsforce','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','contact','WhoId','endUserType','account','WhatId','Case','ContactId','lead','leadId','info','sobject','create','isNil','validateEmail','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','Lead','account_contact_lead','Account','Contact','additionalSearchAccount','first','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','LastName','','Caller\x20-\x20%s','upperFirst','includes','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.'];(function(_0x10b2c4,_0x4b10ed){var _0xb10a8e=function(_0x58ff68){while(--_0x58ff68){_0x10b2c4['push'](_0x10b2c4['shift']());}};_0xb10a8e(++_0x4b10ed);}(_0x1657,0x11d));var _0x7165=function(_0x5cff60,_0x4172af){_0x5cff60=_0x5cff60-0x0;var _0x4fd7cd=_0x1657[_0x5cff60];return _0x4fd7cd;};'use strict';var _=require('lodash');var rp=require(_0x7165('0x0'));var moment=require('moment');var BPromise=require(_0x7165('0x1'));var md5=require('md5');var jsforce=require(_0x7165('0x2'));var util=require('util');var Redis=require(_0x7165('0x3'));var intUtil=require('./util');var config=require(_0x7165('0x4'));var logger=require(_0x7165('0x5'))(_0x7165('0x6'));config[_0x7165('0x7')]=_[_0x7165('0x8')](config[_0x7165('0x7')],{'host':_0x7165('0x9'),'port':0x18eb});var io=require(_0x7165('0xa'))(new Redis(config[_0x7165('0x7')]));function emit(_0x48d102,_0x2fa6a7,_0x4f19b0){io['to'](_0x48d102)[_0x7165('0xb')](_0x2fa6a7,_0x4f19b0);}function getTicket(_0x71d98e,_0x178541,_0xf33005,_0x572001,_0xc433a9,_0x1035c2,_0x4e47ad,_0x20917c){var _0x3ca102=Object['assign']({},{'OwnerId':_0x178541['id'],'Subject':intUtil[_0x7165('0xc')](_0x572001[_0x7165('0xd')],_0xc433a9,'\x20'),'Description':intUtil[_0x7165('0xc')](_0x572001[_0x7165('0xe')],_0xc433a9,'\x0a')},getCustomFields(_0x1035c2,_0xc433a9));if(_0xf33005){if(_0x572001[_0x7165('0xf')]===_0x7165('0x10')){_0x3ca102['ActivityDate']=moment[_0x7165('0x11')]();_0x3ca102[_0x7165('0x12')]=![];_0x3ca102[_0x7165('0x13')]=![];if(_0xf33005['endUserType']===_0x7165('0x14')||_0xf33005['endUserType']==='lead'){_0x3ca102[_0x7165('0x15')]=_0xf33005['id'];}else if(_0xf33005[_0x7165('0x16')]===_0x7165('0x17')){_0x3ca102[_0x7165('0x18')]=_0xf33005['id'];}}else if(_0x572001[_0x7165('0xf')]===_0x7165('0x19')){if(_0xf33005[_0x7165('0x16')]==='contact'){_0x3ca102[_0x7165('0x1a')]=_0xf33005['id'];}else if(_0xf33005['endUserType']===_0x7165('0x17')){_0x3ca102['AccountId']=_0xf33005['id'];}else if(_0xf33005['endUserType']===_0x7165('0x1b')&&_0x572001[_0x7165('0x1c')]){_0x3ca102[_0x572001[_0x7165('0x1c')]]=_0xf33005['id'];}else{logger[_0x7165('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x4e47ad[_0x7165('0x1e')](_0x572001['ticketType'])[_0x7165('0x1f')](_0x3ca102);}function getUser(_0x2954e7,_0x246886,_0x5bb5fa){if(!_[_0x7165('0x20')](_0x246886)&&intUtil[_0x7165('0x21')](_0x246886)){var _0x39022d={'Email':_0x246886};var _0x377bb9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5bb5fa[_0x7165('0x1e')]('User')[_0x7165('0x22')](_0x39022d,_0x377bb9)[_0x7165('0x23')]()[_0x7165('0x24')](function(_0x21ca39){if(_0x21ca39['length']){var _0x3502db=_[_0x7165('0x22')](_0x21ca39,function(_0x4e92c5){return _0x4e92c5[_0x7165('0x25')]===_0x246886;});if(_0x3502db){logger[_0x7165('0x1d')](_0x7165('0x26'),_0x246886);return BPromise[_0x7165('0x27')]({'id':_0x3502db['Id'],'name':_0x3502db[_0x7165('0x28')]});}}else{logger[_0x7165('0x1d')](_0x7165('0x29'),_0x246886);return _0x5bb5fa['identity']()[_0x7165('0x24')](function(_0x128383){return BPromise['resolve']({'id':_0x128383['user_id'],'name':_0x128383['display_name']});});}});}else{logger[_0x7165('0x1d')](_0x7165('0x29'),_0x246886);return _0x5bb5fa[_0x7165('0x2a')]()[_0x7165('0x24')](function(_0x1bd252){return BPromise['resolve']({'id':_0x1bd252[_0x7165('0x2b')],'name':_0x1bd252[_0x7165('0x2c')]});});}}function getEndUser(_0x5bf989,_0x3e9b37,_0x45f911,_0x5ed509,_0x3789fe){var _0x1dfb2a={'$or':{'Phone':_0x5ed509}};var _0x44ee14={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7165('0x27')]()[_0x7165('0x24')](function(){logger[_0x7165('0x1d')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x5ed509,_0x3e9b37[_0x7165('0x2d')]);switch(_0x3e9b37[_0x7165('0x2d')]){case'contact_lead':var _0x163f11=_[_0x7165('0x2e')](_0x1dfb2a);if(_0x3e9b37['additionalSearchContact']){var _0x5530f2={};_0x5530f2[_0x3e9b37[_0x7165('0x2f')]]=_0x5ed509;_[_0x7165('0x30')](_0x163f11[_0x7165('0x31')],_0x5530f2);}return _0x3789fe[_0x7165('0x1e')]('Contact')[_0x7165('0x22')](_0x163f11,_0x44ee14)[_0x7165('0x23')]()[_0x7165('0x24')](function(_0x4a5c0e){if(_0x4a5c0e&&_0x4a5c0e[_0x7165('0x32')]){return _0x4a5c0e;}else{var _0x65e2a8=_[_0x7165('0x2e')](_0x1dfb2a);if(_0x3e9b37['additionalSearchLead']){var _0x67c180={};_0x67c180[_0x3e9b37[_0x7165('0x33')]]=_0x5ed509;_[_0x7165('0x30')](_0x65e2a8[_0x7165('0x31')],_0x67c180);}return _0x3789fe[_0x7165('0x1e')](_0x7165('0x34'))[_0x7165('0x22')](_0x65e2a8,_0x44ee14);}});case _0x7165('0x35'):var _0x2c524b=_[_0x7165('0x2e')](_0x1dfb2a);if(_0x3e9b37['additionalSearchAccount']){var _0x5530f2={};_0x5530f2[_0x3e9b37['additionalSearchAccount']]=_0x5ed509;_[_0x7165('0x30')](_0x2c524b[_0x7165('0x31')],_0x5530f2);}return _0x3789fe[_0x7165('0x1e')](_0x7165('0x36'))[_0x7165('0x22')](_0x2c524b,_0x44ee14)[_0x7165('0x23')]()[_0x7165('0x24')](function(_0x58a438){if(_0x58a438&&_0x58a438[_0x7165('0x32')]){return _0x58a438;}else{var _0xf9a662=_[_0x7165('0x2e')](_0x1dfb2a);if(_0x3e9b37['additionalSearchContact']){var _0x253520={};_0x253520[_0x3e9b37[_0x7165('0x2f')]]=_0x5ed509;_[_0x7165('0x30')](_0xf9a662[_0x7165('0x31')],_0x253520);}return _0x3789fe[_0x7165('0x1e')](_0x7165('0x37'))[_0x7165('0x22')](_0xf9a662,_0x44ee14)[_0x7165('0x24')](function(_0x266448){if(_0x266448&&_0x266448['length']){return _0x266448;}else{var _0x1305e4=_[_0x7165('0x2e')](_0x1dfb2a);if(_0x3e9b37[_0x7165('0x33')]){var _0xe4d529={};_0xe4d529[_0x3e9b37['additionalSearchLead']]=_0x5ed509;_[_0x7165('0x30')](_0x1305e4[_0x7165('0x31')],_0xe4d529);}return _0x3789fe[_0x7165('0x1e')]('Lead')['find'](_0x1305e4,_0x44ee14);}});}});case _0x7165('0x14'):var _0x163f11=_['cloneDeep'](_0x1dfb2a);if(_0x3e9b37[_0x7165('0x2f')]){var _0x5530f2={};_0x5530f2[_0x3e9b37[_0x7165('0x2f')]]=_0x5ed509;_[_0x7165('0x30')](_0x163f11['$or'],_0x5530f2);}return _0x3789fe[_0x7165('0x1e')](_0x7165('0x37'))[_0x7165('0x22')](_0x163f11,_0x44ee14)[_0x7165('0x23')]();case _0x7165('0x1b'):var _0x5039ac=_['cloneDeep'](_0x1dfb2a);if(_0x3e9b37[_0x7165('0x33')]){var _0x5530f2={};_0x5530f2[_0x3e9b37[_0x7165('0x33')]]=_0x5ed509;_['merge'](_0x5039ac['$or'],_0x5530f2);}return _0x3789fe['sobject']('Lead')['find'](_0x5039ac,_0x44ee14);case _0x7165('0x17'):var _0x2c524b=_['cloneDeep'](_0x1dfb2a);if(_0x3e9b37[_0x7165('0x38')]){var _0x5530f2={};_0x5530f2[_0x3e9b37[_0x7165('0x38')]]=_0x5ed509;_[_0x7165('0x30')](_0x2c524b[_0x7165('0x31')],_0x5530f2);}return _0x3789fe['sobject'](_0x7165('0x36'))[_0x7165('0x22')](_0x2c524b,_0x44ee14);default:return null;}})[_0x7165('0x24')](function(_0x31a762){if(_0x31a762&&_0x31a762['length']){var _0x547307=_[_0x7165('0x39')](_0x31a762);if(_0x547307){return BPromise[_0x7165('0x27')]({'id':_0x547307['Id'],'name':_0x547307[_0x7165('0x28')],'phone':_0x547307[_0x7165('0x3a')],'endUserType':_0x547307[_0x7165('0x3b')]['type'][_0x7165('0x3c')]()});}}})[_0x7165('0x24')](function(_0x5ae188){if(_0x5ae188){logger[_0x7165('0x1d')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x5ae188['endUserType'],_0x5ed509);return BPromise[_0x7165('0x27')](_0x5ae188);}else{logger[_0x7165('0x1d')](_0x7165('0x3d'),_0x5ed509);var _0x4580df={'Phone':_0x5ed509};if(_0x3e9b37[_0x7165('0x3e')]){if(_0x3e9b37[_0x7165('0x3e')]===_0x7165('0x14')){logger[_0x7165('0x1d')](_0x7165('0x3f'),_0x5ed509,_0x3e9b37['moduleCreate']);_0x4580df['LastName']=_0x45f911!==''?_0x45f911:util[_0x7165('0x40')]('Caller\x20-\x20%s',_0x5ed509);}else if(_0x3e9b37[_0x7165('0x3e')]===_0x7165('0x1b')){logger[_0x7165('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5ed509,_0x3e9b37['moduleCreate']);_0x4580df[_0x7165('0x41')]=_0x45f911!==_0x7165('0x42')?_0x45f911:util[_0x7165('0x40')](_0x7165('0x43'),_0x5ed509);_0x4580df['Company']='No\x20Company';}else if(_0x3e9b37[_0x7165('0x3e')]===_0x7165('0x17')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5ed509,_0x3e9b37[_0x7165('0x3e')]);_0x4580df['Name']=_0x45f911!==''?_0x45f911:util[_0x7165('0x40')](_0x7165('0x43'),_0x5ed509);}else{return null;}}return _0x3789fe[_0x7165('0x1e')](_[_0x7165('0x44')](_0x3e9b37[_0x7165('0x3e')]))[_0x7165('0x1f')](_0x4580df)[_0x7165('0x24')](function(_0x4b41d0){return BPromise[_0x7165('0x27')]({'id':_0x4b41d0['id'],'endUserType':_0x3e9b37[_0x7165('0x3e')]});});}});}function getCustomFields(_0x3663db,_0x5ae104){var _0xca1acd={};if(_0x3663db[_0x7165('0x32')]>0x0){_['forEach'](_0x3663db,function(_0x78241b){if(_[_0x7165('0x45')](['string',_0x7165('0x46')],_0x78241b[_0x7165('0x47')])&&_0x78241b[_0x7165('0x48')]){_0xca1acd[_0x78241b[_0x7165('0x48')]]=_0x78241b[_0x7165('0x49')][_0x7165('0x4a')]();}else if(_0x78241b['type']===_0x7165('0x4b')&&_0x78241b[_0x7165('0x4c')]&&_0x78241b[_0x7165('0x48')]){_0x5ae104[_0x78241b[_0x7165('0x4c')]]&&(_0xca1acd[_0x78241b[_0x7165('0x48')]]=_0x5ae104[_0x78241b[_0x7165('0x4c')]][_0x7165('0x4a')]());}else if(_0x78241b['type']===_0x7165('0x4d')&&_0x78241b[_0x7165('0x4e')]&&_0x78241b[_0x7165('0x4e')][_0x7165('0x4f')]&&_0x78241b[_0x7165('0x48')]){_0x5ae104[_0x78241b[_0x7165('0x4e')]['name'][_0x7165('0x3c')]()]&&(_0xca1acd[_0x78241b[_0x7165('0x48')]]=_0x5ae104[_0x78241b[_0x7165('0x4e')][_0x7165('0x4f')][_0x7165('0x3c')]()][_0x7165('0x4a')]());}});}return _0xca1acd;}function getConnection(_0x3550f1){var _0x5071c9=_0x3550f1[_0x7165('0x50')][_0x7165('0x51')](_0x3550f1[_0x7165('0x52')]);var _0x5043a8=new jsforce[(_0x7165('0x53'))]({'oauth2':{'loginUrl':_0x3550f1[_0x7165('0x54')]||_0x7165('0x55'),'clientId':_0x3550f1[_0x7165('0x56')],'clientSecret':_0x3550f1['clientSecret']}});return _0x5043a8[_0x7165('0x57')](_0x3550f1[_0x7165('0x58')],_0x5071c9)[_0x7165('0x24')](function(){logger[_0x7165('0x1d')](_0x7165('0x59'));return _0x5043a8;});}exports[_0x7165('0x5a')]=function(_0x3428cb,_0x568f39,_0x3852cb,_0x38bcdb,_0x532d5b,_0x23ae71){var _0x145497,_0x4e0230,_0x39e774,_0x3f5d83;_0x23ae71['serverUrl']=intUtil['stripTrailingSlash'](_0x23ae71[_0x7165('0x5b')]);_0x23ae71[_0x7165('0x54')]=intUtil[_0x7165('0x5c')](_0x23ae71['remoteUri']);if(_0x532d5b&&_0x532d5b[_0x7165('0x5d')]){logger[_0x7165('0x1d')]('[QUEUE]',_0x7165('0x5e'));_0x568f39[_0x7165('0x5f')]=util[_0x7165('0x40')](_0x7165('0x60'),_0x23ae71[_0x7165('0x5b')],_0x568f39[_0x7165('0x61')],md5(_0x568f39[_0x7165('0x61')]));}else{_0x568f39[_0x7165('0x5f')]='';}return getConnection(_0x23ae71)['then'](function(_0x47bbfc){_0x3f5d83=_0x47bbfc;return getUser(_0x23ae71,_0x38bcdb[_0x7165('0x62')],_0x3f5d83);})[_0x7165('0x24')](function(_0x370bd5){_0x145497=_0x370bd5;return getEndUser(_0x23ae71,_0x3852cb,_0x568f39[_0x7165('0x63')],_0x568f39['calleridnum'],_0x3f5d83);})[_0x7165('0x24')](function(_0x17da61){_0x4e0230=_0x17da61;return getTicket(_0x23ae71,_0x145497,_0x4e0230,_0x3852cb,_0x568f39,_0x3852cb['Fields'],_0x3f5d83,_0x7165('0x5a'));})[_0x7165('0x24')](function(_0x32dd60){_0x39e774=_0x32dd60;logger[_0x7165('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x39e774['id']);logger['info'](_0x7165('0x64'),_0x39e774['id'],_0x38bcdb[_0x7165('0x4f')],_0x23ae71[_0x7165('0x47')]);switch(_0x23ae71['type']){case'integrationTab':emit(util['format']('user:%s',_0x38bcdb['name']),'trigger:salesforce:display',{'recordId':_0x39e774['id']});break;case _0x7165('0x65'):emit(util['format'](_0x7165('0x66'),_0x38bcdb[_0x7165('0x4f')]),_0x7165('0x67'),{'uri':util[_0x7165('0x40')](_0x7165('0x68'),_0x3f5d83[_0x7165('0x69')],_0x39e774['id'])});break;default:logger[_0x7165('0x6a')](_0x7165('0x6b'));}})[_0x7165('0x6c')](function(_0x5a1864){logger[_0x7165('0x6a')]('[QUEUE]',_0x5a1864);});};exports[_0x7165('0x6d')]=function(_0x4cad19,_0x54385f,_0x224d46,_0x3f92d8,_0x51bed3,_0x3d0fe2,_0x127fa1){var _0x105e16,_0x44cfc5,_0xae3920,_0x3e4545;_0x3d0fe2[_0x7165('0x5b')]=intUtil[_0x7165('0x5c')](_0x3d0fe2[_0x7165('0x5b')]);_0x3d0fe2[_0x7165('0x54')]=intUtil[_0x7165('0x5c')](_0x3d0fe2['remoteUri']);if(_0x127fa1&&_0x127fa1[_0x7165('0x6e')]&&_0x127fa1[_0x7165('0x6e')]!==_0x7165('0x6f')){logger[_0x7165('0x1d')](_0x7165('0x70'),_0x7165('0x5e'));_0x54385f[_0x7165('0x5f')]=util[_0x7165('0x40')](_0x7165('0x60'),_0x3d0fe2[_0x7165('0x5b')],_0x54385f[_0x7165('0x61')],md5(_0x54385f['uniqueid']));}return getConnection(_0x3d0fe2)[_0x7165('0x24')](function(_0x554c61){_0x3e4545=_0x554c61;return getUser(_0x3d0fe2,_0x3f92d8[_0x7165('0x62')],_0x3e4545);})['then'](function(_0x129734){_0x105e16=_0x129734;return getEndUser(_0x3d0fe2,_0x224d46,_0x54385f['destcalleridname'],_0x54385f[_0x7165('0x71')],_0x3e4545);})['then'](function(_0x12e6c6){_0x44cfc5=_0x12e6c6;return getTicket(_0x3d0fe2,_0x105e16,_0x44cfc5,_0x224d46,_0x54385f,_0x224d46[_0x7165('0x72')],_0x3e4545,_0x7165('0x6d'));})[_0x7165('0x24')](function(_0x322b83){_0xae3920=_0x322b83;logger[_0x7165('0x1d')](_0x7165('0x73'),_0xae3920['id']);logger[_0x7165('0x1d')](_0x7165('0x74'),_0xae3920['id'],_0x3f92d8[_0x7165('0x4f')],_0x3d0fe2['type']);switch(_0x3d0fe2[_0x7165('0x47')]){case _0x7165('0x75'):emit(util[_0x7165('0x40')]('user:%s',_0x3f92d8[_0x7165('0x4f')]),_0x7165('0x76'),{'recordId':_0xae3920['id']});break;case _0x7165('0x65'):emit(util[_0x7165('0x40')](_0x7165('0x66'),_0x3f92d8[_0x7165('0x4f')]),_0x7165('0x67'),{'uri':util[_0x7165('0x40')](_0x7165('0x68'),_0x3e4545[_0x7165('0x69')],_0xae3920['id'])});break;default:logger['error']('[OUTBOUND]',_0x7165('0x77'));}})[_0x7165('0x6c')](function(_0x3adf0c){logger[_0x7165('0x6a')]('[OUTBOUND]',_0x3adf0c);});};exports['unmanaged']=function(_0x27119b,_0xdfde2a,_0x23d4f0,_0x153eff,_0x298ff6,_0x56f4ee){var _0x546c6a,_0x3a8a85,_0x5c7cba,_0x3a72a2;_0x56f4ee['serverUrl']=intUtil[_0x7165('0x5c')](_0x56f4ee[_0x7165('0x5b')]);_0x56f4ee['remoteUri']=intUtil[_0x7165('0x5c')](_0x56f4ee[_0x7165('0x54')]);if(_0x298ff6&&_0x298ff6[_0x7165('0x5d')]){logger[_0x7165('0x1d')]('['+_0xdfde2a['lastevent'][_0x7165('0x78')]()+']',_0x7165('0x5e'));_0xdfde2a[_0x7165('0x5f')]=util[_0x7165('0x40')](_0x7165('0x60'),_0x56f4ee['serverUrl'],_0xdfde2a[_0x7165('0x61')],md5(_0xdfde2a['uniqueid']));}else{_0xdfde2a['recordingURL']='';}return getConnection(_0x56f4ee)['then'](function(_0x4c22c5){_0x3a72a2=_0x4c22c5;if(!_[_0x7165('0x20')](_0x153eff)){return getUser(_0x56f4ee,_0x153eff[_0x7165('0x4f')],_0x3a72a2);}else{return getUser(_0x56f4ee,null,_0x3a72a2);}})[_0x7165('0x24')](function(_0x3056d7){_0x546c6a=_0x3056d7;return getEndUser(_0x56f4ee,_0x23d4f0,_0xdfde2a['calleridname'],_0xdfde2a[_0x7165('0x79')],_0x3a72a2);})['then'](function(_0x337068){_0x3a8a85=_0x337068;return getTicket(_0x56f4ee,_0x546c6a,_0x3a8a85,_0x23d4f0,_0xdfde2a,_0x23d4f0[_0x7165('0x72')],_0x3a72a2);})[_0x7165('0x24')](function(_0x56e24d){_0x5c7cba=_0x56e24d;logger[_0x7165('0x1d')]('['+_0xdfde2a['lastevent'][_0x7165('0x78')]()+_0x7165('0x7a'),_0x5c7cba['id']);logger[_0x7165('0x1d')]('['+_0xdfde2a['lastevent'][_0x7165('0x78')]()+_0x7165('0x7b'),_0x56f4ee[_0x7165('0x47')]);})[_0x7165('0x6c')](function(_0x21f88b){logger[_0x7165('0x6a')]('['+_0xdfde2a[_0x7165('0x7c')][_0x7165('0x78')]()+']',_0x21f88b);});}; \ 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 9b911c9..33acb73 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 _0x16e8=['destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','./util','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','sys_id','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','variable','variableName','idField','Variable',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','password','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email'];(function(_0x24729b,_0x5b5c7a){var _0x37e64d=function(_0x8480db){while(--_0x8480db){_0x24729b['push'](_0x24729b['shift']());}};_0x37e64d(++_0x5b5c7a);}(_0x16e8,0x1c1));var _0x816e=function(_0x33ccd9,_0x55ce6d){_0x33ccd9=_0x33ccd9-0x0;var _0x3241e0=_0x16e8[_0x33ccd9];return _0x3241e0;};'use strict';var _=require(_0x816e('0x0'));var Promise=require(_0x816e('0x1'));var rp=require(_0x816e('0x2'));var util=require(_0x816e('0x3'));var md5=require(_0x816e('0x4'));var Redis=require('ioredis');var intUtil=require(_0x816e('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config[_0x816e('0x6')]=_[_0x816e('0x7')](config[_0x816e('0x6')],{'host':_0x816e('0x8'),'port':0x18eb});var io=require(_0x816e('0x9'))(new Redis(config[_0x816e('0x6')]));function getAdminUser(_0x4327e5,_0x574a85,_0x37e6eb,_0x396f69,_0x5e3ea3,_0x6e8f3d){return new Promise(function(_0x35d378,_0x2a9a3c){var _0xe9f7e3={'method':_0x816e('0xa'),'uri':_0x396f69+_0x816e('0xb')+'&'+_0x5e3ea3+'&'+_0x6e8f3d,'auth':_0x574a85,'json':!![]};return rp(_0xe9f7e3)['then'](function(_0x343a73){if(_0x343a73[_0x816e('0xc')]['length']>0x0){_0x37e6eb[_0x816e('0xd')]=_0x343a73[_0x816e('0xc')][0x0]['sys_id'];}logger[_0x816e('0xe')]('['+[_0x4327e5[_0x816e('0xf')]()]+_0x816e('0x10'),_0x37e6eb);_0x35d378(_0x37e6eb);})[_0x816e('0x11')](function(_0x41c956){logger[_0x816e('0x12')]('['+[_0x4327e5[_0x816e('0xf')]()]+']',_0x41c956[_0x816e('0x13')]);_0x2a9a3c(_0x41c956[_0x816e('0x13')]);});});}function getUser(_0x3a8b85,_0x4427f0,_0x3fbbe3,_0x1eb7b7,_0x2b3e0f){return function(_0xe9de85){logger[_0x816e('0xe')]('['+[_0x3a8b85[_0x816e('0xf')]()]+_0x816e('0x14'),_0xe9de85);return new Promise(function(_0x288768,_0xce5736){if(intUtil[_0x816e('0x15')](_0xe9de85[_0x816e('0x16')])){var _0x2bf540={'method':'GET','uri':_0x3fbbe3+'sys_user?sysparm_query=email%3D'+_0xe9de85['userEmail']+'&'+_0x1eb7b7+'&'+_0x2b3e0f,'auth':_0x4427f0,'json':!![]};logger[_0x816e('0xe')]('['+[_0x3a8b85[_0x816e('0xf')]()]+_0x816e('0x17'),_0x2bf540);return rp(_0x2bf540)[_0x816e('0x18')](function(_0x226baf){logger['info']('['+[_0x3a8b85['toUpperCase']()]+_0x816e('0x19'),_0x226baf);if(_0x226baf[_0x816e('0xc')]['length']>0x0&&String(_0x226baf[_0x816e('0xc')][0x0]['active'])===_0x816e('0x1a')){_0xe9de85[_0x816e('0x1b')]=_0x226baf[_0x816e('0xc')][0x0]['sys_id'];}else{_0xe9de85['userId']=_0xe9de85[_0x816e('0xd')];_0xe9de85[_0x816e('0x16')]=_0xe9de85[_0x816e('0x1c')];}logger[_0x816e('0xe')]('['+[_0x3a8b85[_0x816e('0xf')]()]+_0x816e('0x1d'),_0xe9de85);_0x288768(_0xe9de85);})[_0x816e('0x11')](function(_0x12bcf7){logger['error']('['+[_0x3a8b85[_0x816e('0xf')]()]+']',_0x12bcf7[_0x816e('0x13')]);_0xce5736(_0x12bcf7[_0x816e('0x13')]);});}else{logger[_0x816e('0xe')]('['+[_0x3a8b85[_0x816e('0xf')]()]+']\x20using\x20admin\x20profile');_0xe9de85[_0x816e('0x1b')]=_0xe9de85[_0x816e('0xd')];_0xe9de85[_0x816e('0x16')]=_0xe9de85[_0x816e('0x1c')];_0x288768(_0xe9de85);}});};}function createEndUser(_0x54d288,_0x2f259b,_0x5ae7e,_0x42ed92,_0x3f78c6){logger[_0x816e('0xe')]('['+[_0x54d288[_0x816e('0xf')]()]+'],\x20createEndUser\x20input\x20crm',_0x5ae7e);return new Promise(function(_0x5df25d,_0x4ea040){var _0x5007b9={'method':_0x816e('0x1e'),'uri':_0x42ed92+_0x816e('0x1f')+_0x3f78c6,'body':{'user_name':_0x5ae7e['endUserNumber'],'roles':_0x816e('0x20'),'first_name':_0x5ae7e[_0x816e('0x21')],'active':_0x816e('0x1a'),'date_format':_0x816e('0x22'),'phone':_0x5ae7e['endUserNumber']},'auth':_0x2f259b,'json':!![]};return rp(_0x5007b9)[_0x816e('0x18')](function(_0x48ccc2){logger[_0x816e('0xe')]('['+[_0x54d288['toUpperCase']()]+_0x816e('0x23'),_0x48ccc2[_0x816e('0xc')]);_0x5ae7e[_0x816e('0x24')]=_0x48ccc2[_0x816e('0xc')][_0x816e('0x25')];_0x5df25d(_0x5ae7e);})[_0x816e('0x11')](function(_0x515a94){logger[_0x816e('0x12')]('['+[_0x54d288[_0x816e('0xf')]()]+']',_0x515a94['message']);_0x4ea040(_0x515a94[_0x816e('0x13')]);});});}function getEndUser(_0x515fac,_0x50e472,_0x143351,_0x40b1d5,_0x31688a){return function(_0x16f983){logger['info']('['+[_0x515fac[_0x816e('0xf')]()]+_0x816e('0x26'),_0x16f983);return new Promise(function(_0x9b5e50,_0x4e8ac3){var _0x1851c7={'method':_0x816e('0xa'),'uri':_0x143351+_0x816e('0x27')+_0x16f983['endUserNumber']+'&'+_0x40b1d5+'&'+_0x31688a,'auth':_0x50e472,'json':!![]};return rp(_0x1851c7)[_0x816e('0x18')](function(_0x43f5bc){if(_0x43f5bc[_0x816e('0xc')]['length']>0x0){_0x16f983['endUserId']=_0x43f5bc['result'][0x0][_0x816e('0x25')];logger[_0x816e('0xe')]('['+[_0x515fac[_0x816e('0xf')]()]+_0x816e('0x28'),_0x16f983);_0x9b5e50(_0x16f983);}else{return createEndUser(_0x515fac,_0x50e472,_0x16f983,_0x143351,_0x40b1d5)[_0x816e('0x18')](function(_0x1e471b){logger[_0x816e('0xe')]('['+[_0x515fac['toUpperCase']()]+_0x816e('0x29'),_0x1e471b);_0x9b5e50(_0x1e471b);});}})[_0x816e('0x11')](function(_0xdfbfbf){logger[_0x816e('0x12')]('['+[_0x515fac['toUpperCase']()]+']',_0xdfbfbf['message']);_0x4e8ac3(_0xdfbfbf['message']);});});};}function getCustomFields(_0x185c85,_0xeedbf8){var _0x3a0c58={};if(_0x185c85[_0x816e('0x2a')]>0x0){_[_0x816e('0x2b')](_0x185c85,function(_0x3a9a18){if(_[_0x816e('0x2c')]([_0x816e('0x2d'),'picklist'],_0x3a9a18[_0x816e('0x2e')])&&_0x3a9a18[_0x816e('0x2f')]&&!_0x3a9a18[_0x816e('0x30')]){_0x3a0c58[_0x3a9a18[_0x816e('0x2f')][_0x816e('0x31')]()]=_0x3a9a18[_0x816e('0x32')][_0x816e('0x33')]();}else if(_[_0x816e('0x2c')]([_0x816e('0x2d'),_0x816e('0x34')],_0x3a9a18[_0x816e('0x2e')])&&_0x3a9a18['idField']&&_0x3a9a18['customField']){_0x3a0c58[_0x3a9a18['idField']['toLowerCase']()]=_0x3a9a18[_0x816e('0x32')][_0x816e('0x33')]();}else if(_0x3a9a18['type']===_0x816e('0x35')&&_0x3a9a18[_0x816e('0x36')]&&_0x3a9a18[_0x816e('0x37')]&&_0x3a9a18[_0x816e('0x30')]){_0x3a0c58[_0x3a9a18[_0x816e('0x37')][_0x816e('0x31')]()]=_0xeedbf8[_0x3a9a18[_0x816e('0x36')]][_0x816e('0x33')]();}else if(_0x3a9a18[_0x816e('0x2e')]==='customVariable'&&_0x3a9a18['Variable']&&_0x3a9a18[_0x816e('0x38')]['name']&&_0x3a9a18[_0x816e('0x37')]&&_0x3a9a18[_0x816e('0x30')]){_0x3a0c58[_0x3a9a18[_0x816e('0x37')][_0x816e('0x31')]()]=_0xeedbf8[_0x3a9a18[_0x816e('0x38')]['name']['toLowerCase']()][_0x816e('0x33')]();}});}return _0x3a0c58;}function getTicket(_0x2d5508,_0x5bdfd8,_0x2f4577,_0x1e586c,_0x1b0bf9,_0x46ed68){return function(_0x5e3de5){logger[_0x816e('0xe')]('['+[_0x2d5508[_0x816e('0xf')]()]+_0x816e('0x39'),_0x5e3de5);return new Promise(function(_0x196032,_0x274651){var _0x58c849=_0x2d5508[_0x816e('0x31')]()==='outbound'?_0x5e3de5[_0x816e('0x1b')]:_0x5e3de5[_0x816e('0x24')];var _0x458c03={'method':_0x816e('0x1e'),'uri':_0x2f4577+_0x816e('0x3a')+'?'+_0x46ed68,'body':Object[_0x816e('0x3b')]({},{'active':_0x816e('0x1a'),'caller_id':_0x58c849,'assigned_to':_0x5e3de5['userId'],'short_description':intUtil[_0x816e('0x3c')](_0x1e586c[_0x816e('0x3d')],_0x1b0bf9,'\x20'),'description':intUtil[_0x816e('0x3c')](_0x1e586c[_0x816e('0x3e')],_0x1b0bf9,'\x0a')},getCustomFields(_0x1e586c[_0x816e('0x3f')],_0x1b0bf9)),'auth':_0x5bdfd8,'json':!![]};return rp(_0x458c03)[_0x816e('0x18')](function(_0x47067f){logger[_0x816e('0xe')]('['+[_0x2d5508[_0x816e('0xf')]()]+_0x816e('0x40'),_0x47067f[_0x816e('0xc')]);_0x5e3de5[_0x816e('0x41')]=_0x47067f[_0x816e('0xc')][_0x816e('0x25')];_0x5e3de5[_0x816e('0x42')]=_0x47067f[_0x816e('0xc')]['number'];logger[_0x816e('0xe')]('['+[_0x2d5508[_0x816e('0xf')]()]+_0x816e('0x43'),_0x5e3de5);_0x196032(_0x5e3de5);})[_0x816e('0x11')](function(_0x1d1fea){logger['error']('['+[_0x2d5508[_0x816e('0xf')]()]+']',_0x1d1fea[_0x816e('0x13')]);_0x274651(_0x1d1fea[_0x816e('0x13')]);});});};}function createRemoteTag(_0xc05844,_0xbedf06,_0x38785d,_0x56fbd7){return new Promise(function(_0x1abf2e,_0x288ee1){var _0x565fef={'method':_0x816e('0x1e'),'uri':_0x38785d+_0x816e('0x44')+'?'+_0x56fbd7,'body':{'short_description':_0xc05844,'global':!![],'active':!![],'name':_0xc05844},'auth':_0xbedf06,'json':!![]};return rp(_0x565fef)[_0x816e('0x18')](function(_0x1037e9){var _0xd8a656=_0x1037e9[_0x816e('0xc')][_0x816e('0x25')];_0x1abf2e(_0xd8a656);});});}function getRemoteTag(_0x40b50a,_0x533e1c,_0x25fa71,_0xa4d460,_0x1b4503){return new Promise(function(_0x2c8bd7,_0x10b2f1){var _0x2c9fd9={'method':_0x816e('0xa'),'uri':_0x25fa71+_0x816e('0x44')+'?sysparm_query=name%3D'+_0x40b50a+'&'+_0xa4d460,'auth':_0x533e1c,'json':!![]};return rp(_0x2c9fd9)[_0x816e('0x18')](function(_0x27e516){if(_0x27e516[_0x816e('0xc')][_0x816e('0x2a')]>0x0){var _0x2347ec=_0x27e516[_0x816e('0xc')][0x0][_0x816e('0x25')];_0x2c8bd7(_0x2347ec);}else{return createRemoteTag(_0x40b50a,_0x533e1c,_0x25fa71,_0xa4d460)[_0x816e('0x18')](function(_0x569448){_0x2c8bd7(_0x569448);});}});});}function assignTagToIncident(_0x2c62ab,_0x22c9f0,_0xd7685,_0x676fc3,_0x585e7c){return new Promise(function(_0x2cf0a0,_0x4b2b10){var _0x1c45c0={'method':_0x816e('0x1e'),'uri':_0xd7685+_0x816e('0x45')+'?'+_0x585e7c,'body':{'label':_0x2c62ab,'table':_0x816e('0x3a'),'id_type':_0x816e('0x46'),'table_key':_0x676fc3['ticketId'],'title':_0x816e('0x47')+_0x676fc3[_0x816e('0x42')],'id_display':_0x676fc3[_0x816e('0x42')]},'auth':_0x22c9f0,'json':!![]};return rp(_0x1c45c0)[_0x816e('0x18')](function(_0x3ca9ee){_0x2cf0a0();})[_0x816e('0x11')](function(){_0x2cf0a0();});});}function manageTags(_0x716df3,_0x51656e,_0x4b6cf9,_0x20ecb0,_0x107d43,_0x3f121e,_0x57f46b){return new Promise(function(_0x6ee5c4,_0x7ad1c){var _0x2db56e=[];_0x51656e[_0x816e('0x2b')](function(_0x4eade8){_0x2db56e[_0x816e('0x48')](getRemoteTag(_0x4eade8,_0x4b6cf9,_0x20ecb0,_0x3f121e,_0x57f46b));});return Promise[_0x816e('0x49')](_0x2db56e)[_0x816e('0x18')](function(_0x18b326){if(_0x18b326['length']){logger[_0x816e('0xe')]('['+[_0x716df3['toUpperCase']()]+_0x816e('0x4a'),_0x18b326);var _0x4b7804=[];_0x18b326['forEach'](function(_0x525d40){_0x4b7804['push'](assignTagToIncident(_0x525d40,_0x4b6cf9,_0x20ecb0,_0x107d43,_0x3f121e));});return Promise['all'](_0x4b7804)['then'](function(){_0x6ee5c4();})['catch'](function(){_0x6ee5c4();});}else{_0x6ee5c4();}});});}function getTags(_0x291dd2,_0x43ea29,_0x218a21,_0x30d080,_0x3985e0,_0x1d09da){return function(_0x545949){return new Promise(function(_0x174768,_0xcd12b3){var _0x298356=[];var _0x574f1f=_0x30d080[_0x816e('0x4b')];if(_0x574f1f&&_0x574f1f[_0x816e('0x2a')]>0x0){_0x298356=_['map'](_0x574f1f,_0x816e('0x4c'));}if(_0x298356[_0x816e('0x2a')]>0x0){return manageTags(_0x291dd2,_0x298356,_0x43ea29,_0x218a21,_0x545949,_0x3985e0,_0x1d09da)[_0x816e('0x18')](function(){_0x174768(_0x545949);});}else{_0x174768(_0x545949);}});};}function emit(_0x458917,_0x88c428,_0x1683eb){var _0x4b8972=_0x816e('0x4d')+_0x816e('0x4e')+_0x816e('0x4f')+'%255EORDERBYDESCnumber';var _0x4c9ce9={'uri':_0x458917+_0x816e('0x50')+_0x1683eb+_0x4b8972};io['to'](util[_0x816e('0x51')](_0x816e('0x52'),_0x88c428))['emit'](_0x816e('0x53'),_0x4c9ce9);}exports['cs']=function(_0x152aeb,_0x3e6ec1,_0x1d66c5,_0x580f73,_0x5ec507,_0x980e64,_0x367f33,_0x1af358){var _0x191d2e={};var _0x3647c0={'user':_0x980e64['username'],'pass':_0x980e64[_0x816e('0x54')]};var _0x1a67d8='sysparm_limit=1';var _0x2ec369='sysparm_display_value=true';_0x980e64[_0x816e('0x55')]=intUtil[_0x816e('0x56')](_0x980e64[_0x816e('0x55')]);_0x980e64[_0x816e('0x57')]=intUtil[_0x816e('0x56')](_0x980e64['serverUrl']);var _0x1aa143=util[_0x816e('0x51')](_0x816e('0x58'),_0x980e64[_0x816e('0x55')]);_0x191d2e[_0x816e('0x16')]=!_[_0x816e('0x59')](_0x580f73)?_0x580f73[_0x816e('0x5a')]:null;_0x191d2e['adminEmail']=_0x980e64[_0x816e('0x5a')];_0x191d2e[_0x816e('0x21')]=_0x1af358[_0x816e('0x31')]()==='outbound'?_0x3e6ec1[_0x816e('0x5b')]:_0x3e6ec1[_0x816e('0x5c')];_0x191d2e[_0x816e('0x5d')]=_0x1af358===_0x816e('0x5e')||_0x1af358===_0x816e('0x5f')?'queue':'outbound';var _0x77416=util['format'](_0x816e('0x60'),_0x980e64[_0x816e('0x57')],_0x3e6ec1['uniqueid'],md5(_0x3e6ec1[_0x816e('0x61')]));if(_0x5ec507&&_0x5ec507[_0x816e('0x62')]){logger['info']('[QUEUE]',_0x816e('0x63'));_0x3e6ec1[_0x816e('0x64')]=_0x77416;}else if(_0x367f33&&_0x367f33[_0x816e('0x65')]&&_0x367f33[_0x816e('0x65')]!==_0x816e('0x66')){logger[_0x816e('0xe')](_0x816e('0x67'),_0x816e('0x63'));_0x3e6ec1[_0x816e('0x64')]=_0x77416;}else{_0x3e6ec1[_0x816e('0x64')]='';}return getAdminUser(_0x1af358,_0x3647c0,_0x191d2e,_0x1aa143,_0x2ec369,_0x1a67d8)[_0x816e('0x18')](getUser(_0x1af358,_0x3647c0,_0x1aa143,_0x2ec369,_0x1a67d8))[_0x816e('0x18')](getEndUser(_0x1af358,_0x3647c0,_0x1aa143,_0x2ec369,_0x1a67d8))[_0x816e('0x18')](getTicket(_0x1af358,_0x3647c0,_0x1aa143,_0x1d66c5,_0x3e6ec1,_0x2ec369))[_0x816e('0x18')](function(_0x44f601){logger['info'](util[_0x816e('0x51')](_0x816e('0x68'),_0x44f601[_0x816e('0x41')]));logger[_0x816e('0xe')](util[_0x816e('0x51')](_0x816e('0x69'),_0x1af358));if(_0x1af358!==_0x816e('0x5f')){logger['info']('['+[_0x1af358[_0x816e('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x980e64[_0x816e('0x55')],_0x580f73[_0x816e('0x4c')],_0x44f601[_0x816e('0x41')]);}})['catch'](function(_0x535873){logger['error']('['+[_0x1af358[_0x816e('0xf')]()]+_0x816e('0x6a'),util[_0x816e('0x6b')](_0x535873,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xcb77=['Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','format','user:%s','emit','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','adminEmail','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','picklist','type','nameField','customField','toString','includes','idField','toLowerCase','content','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','ticketId','ticketNumber','push','forEach','all'];(function(_0xbd46d,_0x39d268){var _0x18f795=function(_0x19361a){while(--_0x19361a){_0xbd46d['push'](_0xbd46d['shift']());}};_0x18f795(++_0x39d268);}(_0xcb77,0x1da));var _0x7cb7=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0xcb77[_0x590b63];return _0x3c9380;};'use strict';var _=require(_0x7cb7('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x7cb7('0x1'));var md5=require(_0x7cb7('0x2'));var Redis=require(_0x7cb7('0x3'));var intUtil=require(_0x7cb7('0x4'));var config=require(_0x7cb7('0x5'));var logger=require(_0x7cb7('0x6'))('servicenow');config['redis']=_[_0x7cb7('0x7')](config[_0x7cb7('0x8')],{'host':_0x7cb7('0x9'),'port':0x18eb});var io=require(_0x7cb7('0xa'))(new Redis(config[_0x7cb7('0x8')]));function getAdminUser(_0x14579b,_0x3d5f12,_0x51961f,_0x193edb,_0x35d695,_0x17b2a2){return new Promise(function(_0x403559,_0x5246a0){var _0x2c2efa={'method':_0x7cb7('0xb'),'uri':_0x193edb+_0x7cb7('0xc')+'&'+_0x35d695+'&'+_0x17b2a2,'auth':_0x3d5f12,'json':!![]};return rp(_0x2c2efa)[_0x7cb7('0xd')](function(_0x57239b){if(_0x57239b[_0x7cb7('0xe')][_0x7cb7('0xf')]>0x0){_0x51961f[_0x7cb7('0x10')]=_0x57239b[_0x7cb7('0xe')][0x0][_0x7cb7('0x11')];}logger[_0x7cb7('0x12')]('['+[_0x14579b[_0x7cb7('0x13')]()]+_0x7cb7('0x14'),_0x51961f);_0x403559(_0x51961f);})[_0x7cb7('0x15')](function(_0x59c7ac){logger['error']('['+[_0x14579b[_0x7cb7('0x13')]()]+']',_0x59c7ac[_0x7cb7('0x16')]);_0x5246a0(_0x59c7ac[_0x7cb7('0x16')]);});});}function getUser(_0x465f50,_0x5bbb4c,_0x2f4544,_0x41fb57,_0x48fe39){return function(_0x3c0eb9){logger[_0x7cb7('0x12')]('['+[_0x465f50[_0x7cb7('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x3c0eb9);return new Promise(function(_0x3a222d,_0x522512){if(intUtil['validateEmail'](_0x3c0eb9[_0x7cb7('0x17')])){var _0x4d0a4c={'method':_0x7cb7('0xb'),'uri':_0x2f4544+_0x7cb7('0x18')+_0x3c0eb9[_0x7cb7('0x17')]+'&'+_0x41fb57+'&'+_0x48fe39,'auth':_0x5bbb4c,'json':!![]};logger[_0x7cb7('0x12')]('['+[_0x465f50[_0x7cb7('0x13')]()]+_0x7cb7('0x19'),_0x4d0a4c);return rp(_0x4d0a4c)['then'](function(_0x55af79){logger[_0x7cb7('0x12')]('['+[_0x465f50[_0x7cb7('0x13')]()]+_0x7cb7('0x1a'),_0x55af79);if(_0x55af79['result']['length']>0x0&&String(_0x55af79['result'][0x0][_0x7cb7('0x1b')])==='true'){_0x3c0eb9[_0x7cb7('0x1c')]=_0x55af79[_0x7cb7('0xe')][0x0][_0x7cb7('0x11')];}else{_0x3c0eb9[_0x7cb7('0x1c')]=_0x3c0eb9[_0x7cb7('0x10')];_0x3c0eb9[_0x7cb7('0x17')]=_0x3c0eb9[_0x7cb7('0x1d')];}logger[_0x7cb7('0x12')]('['+[_0x465f50['toUpperCase']()]+'],\x20getUser\x20crm',_0x3c0eb9);_0x3a222d(_0x3c0eb9);})[_0x7cb7('0x15')](function(_0x2a72b0){logger[_0x7cb7('0x1e')]('['+[_0x465f50[_0x7cb7('0x13')]()]+']',_0x2a72b0[_0x7cb7('0x16')]);_0x522512(_0x2a72b0['message']);});}else{logger['info']('['+[_0x465f50[_0x7cb7('0x13')]()]+_0x7cb7('0x1f'));_0x3c0eb9[_0x7cb7('0x1c')]=_0x3c0eb9[_0x7cb7('0x10')];_0x3c0eb9['userEmail']=_0x3c0eb9[_0x7cb7('0x1d')];_0x3a222d(_0x3c0eb9);}});};}function createEndUser(_0x27d898,_0x470c45,_0x5bc22c,_0x87d108,_0x2fd04e){logger['info']('['+[_0x27d898[_0x7cb7('0x13')]()]+_0x7cb7('0x20'),_0x5bc22c);return new Promise(function(_0x1fd886,_0x18d3e6){var _0x18caed={'method':_0x7cb7('0x21'),'uri':_0x87d108+_0x7cb7('0x22')+_0x2fd04e,'body':{'user_name':_0x5bc22c[_0x7cb7('0x23')],'roles':_0x7cb7('0x24'),'first_name':_0x5bc22c[_0x7cb7('0x23')],'active':_0x7cb7('0x25'),'date_format':_0x7cb7('0x26'),'phone':_0x5bc22c[_0x7cb7('0x23')]},'auth':_0x470c45,'json':!![]};return rp(_0x18caed)[_0x7cb7('0xd')](function(_0x5df259){logger[_0x7cb7('0x12')]('['+[_0x27d898['toUpperCase']()]+'],\x20EndUser\x20schema',_0x5df259[_0x7cb7('0xe')]);_0x5bc22c[_0x7cb7('0x27')]=_0x5df259[_0x7cb7('0xe')][_0x7cb7('0x11')];_0x1fd886(_0x5bc22c);})['catch'](function(_0x52111e){logger['error']('['+[_0x27d898['toUpperCase']()]+']',_0x52111e['message']);_0x18d3e6(_0x52111e[_0x7cb7('0x16')]);});});}function getEndUser(_0xeed042,_0x761365,_0x191a81,_0x28dfbc,_0x4db294){return function(_0x588544){logger[_0x7cb7('0x12')]('['+[_0xeed042[_0x7cb7('0x13')]()]+_0x7cb7('0x28'),_0x588544);return new Promise(function(_0x58c5a1,_0x423087){var _0x15a6aa={'method':_0x7cb7('0xb'),'uri':_0x191a81+_0x7cb7('0x29')+_0x588544[_0x7cb7('0x23')]+'&'+_0x28dfbc+'&'+_0x4db294,'auth':_0x761365,'json':!![]};return rp(_0x15a6aa)[_0x7cb7('0xd')](function(_0x36bf19){if(_0x36bf19[_0x7cb7('0xe')]['length']>0x0){_0x588544['endUserId']=_0x36bf19[_0x7cb7('0xe')][0x0]['sys_id'];logger[_0x7cb7('0x12')]('['+[_0xeed042[_0x7cb7('0x13')]()]+_0x7cb7('0x2a'),_0x588544);_0x58c5a1(_0x588544);}else{return createEndUser(_0xeed042,_0x761365,_0x588544,_0x191a81,_0x28dfbc)[_0x7cb7('0xd')](function(_0x395d18){logger[_0x7cb7('0x12')]('['+[_0xeed042[_0x7cb7('0x13')]()]+_0x7cb7('0x2b'),_0x395d18);_0x58c5a1(_0x395d18);});}})[_0x7cb7('0x15')](function(_0x34f1a7){logger[_0x7cb7('0x1e')]('['+[_0xeed042[_0x7cb7('0x13')]()]+']',_0x34f1a7[_0x7cb7('0x16')]);_0x423087(_0x34f1a7[_0x7cb7('0x16')]);});});};}function getCustomFields(_0x3bfe51,_0x2d8ee3){var _0x4b97da={};if(_0x3bfe51[_0x7cb7('0xf')]>0x0){_['forEach'](_0x3bfe51,function(_0x1fbb36){if(_['includes']([_0x7cb7('0x2c'),_0x7cb7('0x2d')],_0x1fbb36[_0x7cb7('0x2e')])&&_0x1fbb36[_0x7cb7('0x2f')]&&!_0x1fbb36[_0x7cb7('0x30')]){_0x4b97da[_0x1fbb36['nameField']['toLowerCase']()]=_0x1fbb36['content'][_0x7cb7('0x31')]();}else if(_[_0x7cb7('0x32')]([_0x7cb7('0x2c'),'picklist'],_0x1fbb36[_0x7cb7('0x2e')])&&_0x1fbb36[_0x7cb7('0x33')]&&_0x1fbb36[_0x7cb7('0x30')]){_0x4b97da[_0x1fbb36[_0x7cb7('0x33')][_0x7cb7('0x34')]()]=_0x1fbb36[_0x7cb7('0x35')][_0x7cb7('0x31')]();}else if(_0x1fbb36['type']==='variable'&&_0x1fbb36['variableName']&&_0x1fbb36[_0x7cb7('0x33')]&&_0x1fbb36[_0x7cb7('0x30')]){_0x4b97da[_0x1fbb36[_0x7cb7('0x33')]['toLowerCase']()]=_0x2d8ee3[_0x1fbb36[_0x7cb7('0x36')]][_0x7cb7('0x31')]();}else if(_0x1fbb36[_0x7cb7('0x2e')]===_0x7cb7('0x37')&&_0x1fbb36[_0x7cb7('0x38')]&&_0x1fbb36[_0x7cb7('0x38')][_0x7cb7('0x39')]&&_0x1fbb36[_0x7cb7('0x33')]&&_0x1fbb36[_0x7cb7('0x30')]){_0x4b97da[_0x1fbb36['idField'][_0x7cb7('0x34')]()]=_0x2d8ee3[_0x1fbb36[_0x7cb7('0x38')][_0x7cb7('0x39')]['toLowerCase']()][_0x7cb7('0x31')]();}});}return _0x4b97da;}function getTicket(_0x49f799,_0x217620,_0x5adad6,_0x52f6de,_0x3406b3,_0x307678){return function(_0x36182a){logger[_0x7cb7('0x12')]('['+[_0x49f799[_0x7cb7('0x13')]()]+_0x7cb7('0x3a'),_0x36182a);return new Promise(function(_0x21d81b,_0x278fec){var _0x4c99c4=_0x49f799[_0x7cb7('0x34')]()===_0x7cb7('0x3b')?_0x36182a[_0x7cb7('0x1c')]:_0x36182a[_0x7cb7('0x27')];var _0x35a038={'method':'POST','uri':_0x5adad6+'incident'+'?'+_0x307678,'body':Object[_0x7cb7('0x3c')]({},{'active':_0x7cb7('0x25'),'caller_id':_0x4c99c4,'assigned_to':_0x36182a['userId'],'short_description':intUtil[_0x7cb7('0x3d')](_0x52f6de['Subjects'],_0x3406b3,'\x20'),'description':intUtil[_0x7cb7('0x3d')](_0x52f6de[_0x7cb7('0x3e')],_0x3406b3,'\x0a')},getCustomFields(_0x52f6de['Fields'],_0x3406b3)),'auth':_0x217620,'json':!![]};return rp(_0x35a038)[_0x7cb7('0xd')](function(_0x97a606){logger[_0x7cb7('0x12')]('['+[_0x49f799['toUpperCase']()]+_0x7cb7('0x3f'),_0x97a606['result']);_0x36182a['ticketId']=_0x97a606['result']['sys_id'];_0x36182a['ticketNumber']=_0x97a606[_0x7cb7('0xe')][_0x7cb7('0x40')];logger['info']('['+[_0x49f799[_0x7cb7('0x13')]()]+_0x7cb7('0x41'),_0x36182a);_0x21d81b(_0x36182a);})[_0x7cb7('0x15')](function(_0x5aaa02){logger[_0x7cb7('0x1e')]('['+[_0x49f799[_0x7cb7('0x13')]()]+']',_0x5aaa02[_0x7cb7('0x16')]);_0x278fec(_0x5aaa02[_0x7cb7('0x16')]);});});};}function createRemoteTag(_0x465467,_0x1a9d7f,_0x334e7b,_0x1799e0){return new Promise(function(_0x510e46,_0x3fd3c9){var _0x174d6f={'method':_0x7cb7('0x21'),'uri':_0x334e7b+_0x7cb7('0x42')+'?'+_0x1799e0,'body':{'short_description':_0x465467,'global':!![],'active':!![],'name':_0x465467},'auth':_0x1a9d7f,'json':!![]};return rp(_0x174d6f)[_0x7cb7('0xd')](function(_0x92bd9d){var _0x30d46d=_0x92bd9d[_0x7cb7('0xe')][_0x7cb7('0x11')];_0x510e46(_0x30d46d);});});}function getRemoteTag(_0x162ad6,_0x5195a4,_0xccc495,_0x42cf01,_0x18f4f4){return new Promise(function(_0x14f2dd,_0x3da755){var _0x3f6ba0={'method':_0x7cb7('0xb'),'uri':_0xccc495+_0x7cb7('0x42')+_0x7cb7('0x43')+_0x162ad6+'&'+_0x42cf01,'auth':_0x5195a4,'json':!![]};return rp(_0x3f6ba0)[_0x7cb7('0xd')](function(_0x404adc){if(_0x404adc[_0x7cb7('0xe')]['length']>0x0){var _0x26b691=_0x404adc[_0x7cb7('0xe')][0x0][_0x7cb7('0x11')];_0x14f2dd(_0x26b691);}else{return createRemoteTag(_0x162ad6,_0x5195a4,_0xccc495,_0x42cf01)[_0x7cb7('0xd')](function(_0x446de0){_0x14f2dd(_0x446de0);});}});});}function assignTagToIncident(_0xbdd1c1,_0x2750a7,_0x4bd2bb,_0x2ee2ec,_0x480448){return new Promise(function(_0x5a38e6,_0x5ba31c){var _0x431bd6={'method':_0x7cb7('0x21'),'uri':_0x4bd2bb+_0x7cb7('0x44')+'?'+_0x480448,'body':{'label':_0xbdd1c1,'table':_0x7cb7('0x45'),'id_type':_0x7cb7('0x46'),'table_key':_0x2ee2ec[_0x7cb7('0x47')],'title':'Incident\x20-\x20'+_0x2ee2ec[_0x7cb7('0x48')],'id_display':_0x2ee2ec[_0x7cb7('0x48')]},'auth':_0x2750a7,'json':!![]};return rp(_0x431bd6)[_0x7cb7('0xd')](function(_0x491629){_0x5a38e6();})[_0x7cb7('0x15')](function(){_0x5a38e6();});});}function manageTags(_0x4e4a22,_0x5731b6,_0x217e5a,_0x3baafe,_0x3decf8,_0x32dc84,_0x4a9eac){return new Promise(function(_0x334eeb,_0x26cffd){var _0x2f827e=[];_0x5731b6['forEach'](function(_0x465424){_0x2f827e[_0x7cb7('0x49')](getRemoteTag(_0x465424,_0x217e5a,_0x3baafe,_0x32dc84,_0x4a9eac));});return Promise['all'](_0x2f827e)['then'](function(_0x27edc4){if(_0x27edc4[_0x7cb7('0xf')]){logger[_0x7cb7('0x12')]('['+[_0x4e4a22['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x27edc4);var _0x622418=[];_0x27edc4[_0x7cb7('0x4a')](function(_0x463c78){_0x622418[_0x7cb7('0x49')](assignTagToIncident(_0x463c78,_0x217e5a,_0x3baafe,_0x3decf8,_0x32dc84));});return Promise[_0x7cb7('0x4b')](_0x622418)[_0x7cb7('0xd')](function(){_0x334eeb();})[_0x7cb7('0x15')](function(){_0x334eeb();});}else{_0x334eeb();}});});}function getTags(_0x21176d,_0x24c2d9,_0x131f1d,_0x59ffda,_0x1c5106,_0x412bbb){return function(_0x4c4018){return new Promise(function(_0x23ede9,_0x1f487e){var _0x5468e3=[];var _0x1976ea=_0x59ffda[_0x7cb7('0x4c')];if(_0x1976ea&&_0x1976ea[_0x7cb7('0xf')]>0x0){_0x5468e3=_[_0x7cb7('0x4d')](_0x1976ea,_0x7cb7('0x39'));}if(_0x5468e3[_0x7cb7('0xf')]>0x0){return manageTags(_0x21176d,_0x5468e3,_0x24c2d9,_0x131f1d,_0x4c4018,_0x1c5106,_0x412bbb)[_0x7cb7('0xd')](function(){_0x23ede9(_0x4c4018);});}else{_0x23ede9(_0x4c4018);}});};}function emit(_0x31bc07,_0x4fc086,_0x258cb2){var _0x382867=_0x7cb7('0x4e')+_0x7cb7('0x4f')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x31abb9={'uri':_0x31bc07+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x258cb2+_0x382867};io['to'](util[_0x7cb7('0x50')](_0x7cb7('0x51'),_0x4fc086))[_0x7cb7('0x52')]('trigger:browser:url',_0x31abb9);}exports['cs']=function(_0x170a9b,_0x5f2e91,_0xe1a213,_0x12d7ad,_0x58f707,_0x277c15,_0x255fbf,_0x4ab8ab){var _0x2a88d1={};var _0x2ca674={'user':_0x277c15[_0x7cb7('0x53')],'pass':_0x277c15['password']};var _0x13889c=_0x7cb7('0x54');var _0xb89300=_0x7cb7('0x55');_0x277c15[_0x7cb7('0x56')]=intUtil['stripTrailingSlash'](_0x277c15[_0x7cb7('0x56')]);_0x277c15['serverUrl']=intUtil[_0x7cb7('0x57')](_0x277c15[_0x7cb7('0x58')]);var _0x191c2d=util['format'](_0x7cb7('0x59'),_0x277c15[_0x7cb7('0x56')]);_0x2a88d1[_0x7cb7('0x17')]=!_[_0x7cb7('0x5a')](_0x12d7ad)?_0x12d7ad[_0x7cb7('0x5b')]:null;_0x2a88d1[_0x7cb7('0x1d')]=_0x277c15[_0x7cb7('0x5b')];_0x2a88d1[_0x7cb7('0x23')]=_0x4ab8ab['toLowerCase']()===_0x7cb7('0x3b')?_0x5f2e91[_0x7cb7('0x5c')]:_0x5f2e91[_0x7cb7('0x5d')];_0x2a88d1[_0x7cb7('0x5e')]=_0x4ab8ab==='queue'||_0x4ab8ab===_0x7cb7('0x5f')?_0x7cb7('0x60'):'outbound';var _0x5a5f78=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x277c15[_0x7cb7('0x58')],_0x5f2e91[_0x7cb7('0x61')],md5(_0x5f2e91[_0x7cb7('0x61')]));if(_0x58f707&&_0x58f707[_0x7cb7('0x62')]){logger['info'](_0x7cb7('0x63'),_0x7cb7('0x64'));_0x5f2e91[_0x7cb7('0x65')]=_0x5a5f78;}else if(_0x255fbf&&_0x255fbf[_0x7cb7('0x66')]&&_0x255fbf[_0x7cb7('0x66')]!==_0x7cb7('0x67')){logger[_0x7cb7('0x12')](_0x7cb7('0x68'),'Recording\x20is\x20enabled!');_0x5f2e91[_0x7cb7('0x65')]=_0x5a5f78;}else{_0x5f2e91[_0x7cb7('0x65')]='';}return getAdminUser(_0x4ab8ab,_0x2ca674,_0x2a88d1,_0x191c2d,_0xb89300,_0x13889c)[_0x7cb7('0xd')](getUser(_0x4ab8ab,_0x2ca674,_0x191c2d,_0xb89300,_0x13889c))['then'](getEndUser(_0x4ab8ab,_0x2ca674,_0x191c2d,_0xb89300,_0x13889c))[_0x7cb7('0xd')](getTicket(_0x4ab8ab,_0x2ca674,_0x191c2d,_0xe1a213,_0x5f2e91,_0xb89300))[_0x7cb7('0xd')](function(_0x388ed2){logger['info'](util[_0x7cb7('0x50')](_0x7cb7('0x69'),_0x388ed2[_0x7cb7('0x47')]));logger[_0x7cb7('0x12')](util[_0x7cb7('0x50')](_0x7cb7('0x6a'),_0x4ab8ab));if(_0x4ab8ab!==_0x7cb7('0x5f')){logger[_0x7cb7('0x12')]('['+[_0x4ab8ab[_0x7cb7('0x13')]()]+']',_0x7cb7('0x6b'));emit(_0x277c15['remoteUri'],_0x12d7ad[_0x7cb7('0x39')],_0x388ed2[_0x7cb7('0x47')]);}})['catch'](function(_0xcd56d3){logger[_0x7cb7('0x1e')]('['+[_0x4ab8ab[_0x7cb7('0x13')]()]+_0x7cb7('0x6c'),util[_0x7cb7('0x6d')](_0xcd56d3,{'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 ad7091b..768a66a 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 _0x845a=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','length','map','type','string','nameField','customField','toLowerCase','toString','custom_fields','content','variable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','remoteUri','stripTrailingSlash','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','serverUrl','%s/service/v4_1/rest.php','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Outbound','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','isNil','calleridname','lodash','request-promise','bluebird','md5','util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','POST','emit','info','name','getString','description','Descriptions','date_start','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','forEach','variableName','push','idField','set_entry','JSON','Calls','format','apiKey','base64','get_server_info','stringify','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','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','get_entry_list','then','phone_home'];(function(_0x141b62,_0x5a537b){var _0x517519=function(_0x53c2ea){while(--_0x53c2ea){_0x141b62['push'](_0x141b62['shift']());}};_0x517519(++_0x5a537b);}(_0x845a,0xb2));var _0xa845=function(_0x429692,_0x13189d){_0x429692=_0x429692-0x0;var _0xc9a0a4=_0x845a[_0x429692];return _0xc9a0a4;};'use strict';var _=require(_0xa845('0x0'));var rp=require(_0xa845('0x1'));var BPromise=require(_0xa845('0x2'));var md5=require(_0xa845('0x3'));var util=require(_0xa845('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xa845('0x5'));var logger=require(_0xa845('0x6'))('sugarcrm');config['redis']=_[_0xa845('0x7')](config['redis'],{'host':_0xa845('0x8'),'port':0x18eb});var io=require(_0xa845('0x9'))(new Redis(config[_0xa845('0xa')]));var def={'method':_0xa845('0xb'),'json':!![]};function emit(_0x452fff,_0x2f270b,_0x54a0ec){io['to'](_0x452fff)[_0xa845('0xc')](_0x2f270b,_0x54a0ec);}function getTicket(_0x1bae6e,_0xf06142,_0x38a3c2,_0x3e89af,_0x1c425d,_0x16f055,_0x3e721b,_0x4c96da){logger[_0xa845('0xd')]('Creating\x20new\x20ticket...');var _0x54e555=new Date();var _0x2cb342=[{'name':_0xa845('0xe'),'value':intUtil[_0xa845('0xf')](_0x3e89af['Subjects'],_0x1c425d,'\x20')},{'name':'assigned_user_id','value':_0xf06142['id']},{'name':'created_by','value':_0xf06142['id']},{'name':_0xa845('0x10'),'value':intUtil['getString'](_0x3e89af[_0xa845('0x11')],_0x1c425d,'\x0a')},{'name':_0xa845('0x12'),'value':_0x54e555['toISOString']()['slice'](0x0,0x13)[_0xa845('0x13')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xa845('0x14'),'value':'15'},{'name':_0xa845('0x15'),'value':_0x38a3c2['id']},{'name':_0xa845('0x16'),'value':_0xa845('0x17')},{'name':_0xa845('0x18'),'value':_0x38a3c2[_0xa845('0xe')]},{'name':_0xa845('0x19'),'value':_0x4c96da}];if(_0x16f055['length']){_[_0xa845('0x1a')](_0x16f055,function(_0xa5dc08){if(_0x1c425d[_0xa5dc08[_0xa845('0x1b')]]){_0x2cb342[_0xa845('0x1c')]({'name':_0xa5dc08[_0xa845('0x1d')],'value':_0x1c425d[_0xa5dc08[_0xa845('0x1b')]]});}});}return request({'form':{'method':_0xa845('0x1e'),'input_type':_0xa845('0x1f'),'response_type':_0xa845('0x1f'),'rest_data':JSON['stringify']({'session':_0x3e721b['id'],'module_name':_0xa845('0x20'),'name_value_list':_0x2cb342})}});}function getAuth(_0x33eec9){return util[_0xa845('0x21')]('Basic\x20%s',new Buffer(_0x33eec9[_0xa845('0x22')]+':X')['toString'](_0xa845('0x23')));}function getServerInfo(_0x34ce92){return request({'form':{'method':_0xa845('0x24'),'input_type':'JSON','response_type':_0xa845('0x1f'),'rest_data':JSON[_0xa845('0x25')]({'session':_0x34ce92['id']})}});}function getUser(_0x2a3958,_0x34c3b5,_0x4e8a14){if(!_['isNil'](_0x34c3b5)){logger[_0xa845('0xd')]('Getting\x20agent\x20with\x20name',_0x34c3b5);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xa845('0x1f'),'rest_data':JSON[_0xa845('0x25')]({'session':_0x4e8a14['id'],'module_name':'Employees','query':util[_0xa845('0x21')](_0xa845('0x26'),_0x34c3b5),'order_by':'','offset':'0','select_fields':['id',_0xa845('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x53235){if(_0x53235[_0xa845('0x27')]['length']){var _0xea9282=_[_0xa845('0x28')](_0x53235[_0xa845('0x27')],function(_0x37922d){return _0x37922d[_0xa845('0x29')][_0xa845('0x2a')][_0xa845('0x2b')]===_0x34c3b5;});if(_0xea9282){logger[_0xa845('0xd')]('Agent\x20found!');return BPromise[_0xa845('0x2c')]({'id':_0xea9282[_0xa845('0x29')]['id'][_0xa845('0x2b')],'name':_0xea9282[_0xa845('0x29')][_0xa845('0xe')][_0xa845('0x2b')]});}}logger['info'](_0xa845('0x2d'));return BPromise['resolve']({'id':_0x4e8a14[_0xa845('0x29')][_0xa845('0x2e')][_0xa845('0x2b')],'name':_0x4e8a14[_0xa845('0x29')]['user_name'][_0xa845('0x2b')]});});}else{logger[_0xa845('0xd')](_0xa845('0x2f'));return BPromise[_0xa845('0x2c')]({'id':_0x4e8a14[_0xa845('0x29')]['user_id'][_0xa845('0x2b')],'name':_0x4e8a14[_0xa845('0x29')][_0xa845('0x2a')][_0xa845('0x2b')]});}}function getEndUser(_0x319c98,_0x3288fe,_0x2451e6,_0x20c250){logger['info'](_0xa845('0x30'),_0x2451e6);return request({'form':{'method':_0xa845('0x31'),'input_type':_0xa845('0x1f'),'response_type':'JSON','rest_data':JSON[_0xa845('0x25')]({'session':_0x20c250['id'],'module_name':_0xa845('0x17'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x2451e6),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa845('0x32')](function(_0x1d4801){if(_0x1d4801[_0xa845('0x27')]['length']){var _0x1fee13=_[_0xa845('0x28')](_0x1d4801[_0xa845('0x27')],function(_0x4db8be){return _0x4db8be[_0xa845('0x29')][_0xa845('0x33')][_0xa845('0x2b')]===_0x2451e6;});if(_0x1fee13){logger[_0xa845('0xd')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x1fee13[_0xa845('0x29')]['id'][_0xa845('0x2b')],'name':_0x1fee13[_0xa845('0x29')][_0xa845('0xe')][_0xa845('0x2b')],'phone':_0x1fee13[_0xa845('0x29')][_0xa845('0x33')][_0xa845('0x2b')]});}}else{logger[_0xa845('0xd')](_0xa845('0x34'));return request({'form':{'method':'set_entry','input_type':_0xa845('0x1f'),'response_type':'JSON','rest_data':JSON[_0xa845('0x25')]({'session':_0x20c250['id'],'module_name':_0xa845('0x17'),'name_value_list':[{'name':_0xa845('0x35'),'value':_0x3288fe!==_0xa845('0x36')?_0x3288fe:util[_0xa845('0x21')](_0xa845('0x37'),_0x2451e6)},{'name':_0xa845('0x33'),'value':_0x2451e6}]})}})[_0xa845('0x32')](function(_0xc6d8bf){logger[_0xa845('0xd')](_0xa845('0x38'));return BPromise[_0xa845('0x2c')]({'id':_0xc6d8bf['id'],'name':_0xc6d8bf['entry_list']['first_name']['value'],'phone':_0xc6d8bf['entry_list'][_0xa845('0x33')][_0xa845('0x2b')]});});}});}function request(_0x927cba){logger[_0xa845('0x39')]('[HTTP]',JSON[_0xa845('0x25')](_0x927cba));return rp(_['merge'](def,_0x927cba));}function getTags(_0x498b3a,_0x18bbda){var _0x264a17=[];if(_0x498b3a&&_0x498b3a[_0xa845('0x3a')]>0x0){_0x264a17=_[_0xa845('0x3b')](_0x498b3a,_0x18bbda);}return _0x264a17;}function getCustomFields(_0x1af199,_0x4810de){var _0x29a782=[];var _0x363692={'custom_fields':[]};if(_0x1af199[_0xa845('0x3a')]>0x0){_['forEach'](_0x1af199,function(_0x3f0c7e){if(_0x3f0c7e[_0xa845('0x3c')]===_0xa845('0x3d')&&_0x3f0c7e[_0xa845('0x3e')]&&!_0x3f0c7e[_0xa845('0x3f')]){_0x363692[_0x3f0c7e[_0xa845('0x3e')][_0xa845('0x40')]()]=_0x3f0c7e['content'][_0xa845('0x41')]();}else if(_0x3f0c7e[_0xa845('0x3c')]===_0xa845('0x3d')&&_0x3f0c7e['idField']&&_0x3f0c7e['customField']){_0x363692[_0xa845('0x42')][_0xa845('0x1c')]({'id':_0x3f0c7e[_0xa845('0x1d')],'value':_0x3f0c7e[_0xa845('0x43')][_0xa845('0x41')]()});}else if(_0x3f0c7e[_0xa845('0x3c')]===_0xa845('0x44')&&_0x3f0c7e[_0xa845('0x1b')]&&_0x3f0c7e[_0xa845('0x1d')]&&_0x3f0c7e['customField']){_0x4810de[_0x3f0c7e[_0xa845('0x1b')]]&&_0x363692['custom_fields']['push']({'id':_0x3f0c7e[_0xa845('0x1d')],'value':_0x4810de[_0x3f0c7e['variableName']]['toString']()});}else if(_0x3f0c7e[_0xa845('0x3c')]==='customVariable'&&_0x3f0c7e[_0xa845('0x45')]&&_0x3f0c7e[_0xa845('0x45')][_0xa845('0xe')]&&_0x3f0c7e[_0xa845('0x1d')]&&_0x3f0c7e[_0xa845('0x3f')]){_0x4810de[_0x3f0c7e[_0xa845('0x45')]['name'][_0xa845('0x40')]()]&&_0x363692[_0xa845('0x42')][_0xa845('0x1c')]({'id':_0x3f0c7e[_0xa845('0x1d')],'value':_0x4810de[_0x3f0c7e[_0xa845('0x45')][_0xa845('0xe')]['toLowerCase']()][_0xa845('0x41')]()});}});}return _0x363692;}function getConnection(_0x3cafc4){return request({'method':_0xa845('0xb'),'form':{'method':_0xa845('0x46'),'input_type':'JSON','response_type':_0xa845('0x1f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3cafc4[_0xa845('0x47')],'password':_0x3cafc4['password'],'encryption':_0xa845('0x48')},'application':_0xa845('0x49')})}})[_0xa845('0x32')](function(_0x253309){var _0x1a3614=_0x253309;if(_0x1a3614['id']){def[_0xa845('0x4a')]=_0x1a3614['id'];return BPromise[_0xa845('0x2c')](_0x1a3614);}else{throw new Error(util[_0xa845('0x21')](_0xa845('0x4b'),_0x3cafc4['id']));}});}function setRelationship(_0x33caa6,_0x37310d,_0x5f28af,_0x3ca40a){return request({'form':{'method':'set_relationship','input_type':_0xa845('0x1f'),'response_type':'JSON','rest_data':JSON[_0xa845('0x25')]({'session':_0x33caa6['id'],'module_name':_0xa845('0x20'),'module_id':_0x5f28af['id'],'link_field_name':_0x3ca40a,'related_ids':[_0x37310d['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x198c3f,_0x19544e,_0x5cb2c0,_0x4a72f6,_0x18e072,_0xd17875){var _0x1015b7,_0x1d54be,_0x163d10,_0x24abf1;_0xd17875[_0xa845('0x4c')]=intUtil[_0xa845('0x4d')](_0xd17875['remoteUri']);_0xd17875['serverUrl']=intUtil[_0xa845('0x4d')](_0xd17875['serverUrl']);def[_0xa845('0x4e')]=util[_0xa845('0x21')]('%s/service/v4_1/rest.php',_0xd17875['remoteUri']);if(_0x18e072&&_0x18e072[_0xa845('0x4f')]){logger[_0xa845('0xd')](_0xa845('0x50'),_0xa845('0x51'));_0x19544e[_0xa845('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd17875['serverUrl'],_0x19544e[_0xa845('0x53')],md5(_0x19544e[_0xa845('0x53')]));}else{_0x19544e[_0xa845('0x52')]='';}return getConnection(_0xd17875)[_0xa845('0x32')](function(_0x365286){_0x24abf1=_0x365286;return getUser(_0xd17875,_0x4a72f6[_0xa845('0xe')],_0x24abf1);})['then'](function(_0xb6a7cc){_0x1015b7=_0xb6a7cc;logger[_0xa845('0xd')](_0xa845('0x54'),_0x1015b7['id']);return getEndUser(_0xd17875,_0x19544e['calleridname'],_0x19544e[_0xa845('0x55')],_0x24abf1);})['then'](function(_0x50423c){_0x1d54be=_0x50423c;logger[_0xa845('0xd')](_0xa845('0x56'),_0x1d54be['id']);return getTicket(_0xd17875,_0x1015b7,_0x1d54be,_0x5cb2c0,_0x19544e,_0x5cb2c0[_0xa845('0x57')],_0x24abf1,_0xa845('0x58'));})[_0xa845('0x32')](function(_0x2ff2fe){_0x163d10=_0x2ff2fe;logger[_0xa845('0xd')](_0xa845('0x59'));logger[_0xa845('0xd')]('The\x20Ticket\x20ID\x20is:',_0x163d10['id']);return setRelationship(_0x24abf1,_0x1015b7,_0x163d10,_0xa845('0x5a'));})[_0xa845('0x32')](function(){return setRelationship(_0x24abf1,_0x1d54be,_0x163d10,_0xa845('0x5b'));})[_0xa845('0x32')](function(){return getServerInfo(_0x24abf1);})[_0xa845('0x32')](function(_0x3e7808){var _0x5da43e=parseInt(_0x3e7808[_0xa845('0x5c')][_0xa845('0x5d')](0x0));var _0x1f8b49=util[_0xa845('0x21')](_0xa845('0x5e'),_0xd17875['remoteUri'],_0x163d10['id']);if(_0x5da43e>0x6){_0x1f8b49=util[_0xa845('0x21')](_0xa845('0x5f'),_0xd17875[_0xa845('0x4c')],_0x163d10['id']);}logger[_0xa845('0xd')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa845('0x21')](_0xa845('0x60'),_0x4a72f6[_0xa845('0xe')]),_0xa845('0x61'),{'uri':_0x1f8b49});})[_0xa845('0x62')](function(_0xecee36){logger[_0xa845('0x63')](_0xa845('0x50'),JSON[_0xa845('0x25')](_0xecee36));});};exports[_0xa845('0x64')]=function(_0x10d813,_0x2c952f,_0x734e4,_0x1cd9bd,_0x3d2b9e,_0xea7d1,_0x99bef2){var _0x3105ed,_0x58489d,_0x2712bc,_0x302202;_0xea7d1[_0xa845('0x4c')]=intUtil[_0xa845('0x4d')](_0xea7d1[_0xa845('0x4c')]);_0xea7d1[_0xa845('0x65')]=intUtil[_0xa845('0x4d')](_0xea7d1[_0xa845('0x65')]);def[_0xa845('0x4e')]=util[_0xa845('0x21')](_0xa845('0x66'),_0xea7d1[_0xa845('0x4c')]);if(_0x99bef2&&_0x99bef2[_0xa845('0x67')]&&_0x99bef2[_0xa845('0x67')]!==_0xa845('0x68')){logger[_0xa845('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2c952f['recordingURL']=util['format'](_0xa845('0x69'),_0xea7d1['serverUrl'],_0x2c952f[_0xa845('0x53')],md5(_0x2c952f['uniqueid']));}return getConnection(_0xea7d1)[_0xa845('0x32')](function(_0x5a1514){_0x302202=_0x5a1514;return getUser(_0xea7d1,_0x1cd9bd[_0xa845('0xe')],_0x302202);})['then'](function(_0x2fc9aa){_0x3105ed=_0x2fc9aa;logger['info'](_0xa845('0x54'),_0x3105ed['id']);return getEndUser(_0xea7d1,_0x2c952f[_0xa845('0x6a')],_0x2c952f['destcalleridnum'],_0x302202);})[_0xa845('0x32')](function(_0x57b000){_0x58489d=_0x57b000;logger[_0xa845('0xd')](_0xa845('0x56'),_0x58489d['id']);return getTicket(_0xea7d1,_0x3105ed,_0x58489d,_0x734e4,_0x2c952f,_0x734e4[_0xa845('0x57')],_0x302202,_0xa845('0x6b'));})[_0xa845('0x32')](function(_0x5131b6){_0x2712bc=_0x5131b6;logger[_0xa845('0xd')]('Ticket\x20created!');logger[_0xa845('0xd')](_0xa845('0x6c'),_0x2712bc['id']);return setRelationship(_0x302202,_0x3105ed,_0x2712bc,_0xa845('0x5a'));})[_0xa845('0x32')](function(){return setRelationship(_0x302202,_0x58489d,_0x2712bc,_0xa845('0x5b'));})[_0xa845('0x32')](function(){return getServerInfo(_0x302202);})[_0xa845('0x32')](function(_0x4c1538){var _0x5e7aab=parseInt(_0x4c1538[_0xa845('0x5c')][_0xa845('0x5d')](0x0));var _0x29dca6=util[_0xa845('0x21')](_0xa845('0x5e'),_0xea7d1[_0xa845('0x4c')],_0x2712bc['id']);if(_0x5e7aab>0x6){_0x29dca6=util['format'](_0xa845('0x5f'),_0xea7d1[_0xa845('0x4c')],_0x2712bc['id']);}logger[_0xa845('0xd')](_0xa845('0x6d'),_0xa845('0x6e'));emit(util['format'](_0xa845('0x60'),_0x1cd9bd[_0xa845('0xe')]),_0xa845('0x61'),{'uri':_0x29dca6});})[_0xa845('0x62')](function(_0x5b915b){logger[_0xa845('0x63')](_0xa845('0x6d'),JSON[_0xa845('0x25')](_0x5b915b));});};exports[_0xa845('0x6f')]=function(_0x2a5fa5,_0x448ae8,_0x2a11c4,_0x5898cf,_0x594ffa,_0x3d1c73){var _0xa6ce25,_0x455efd,_0x47441e,_0x27cbff;_0x3d1c73[_0xa845('0x4c')]=intUtil[_0xa845('0x4d')](_0x3d1c73[_0xa845('0x4c')]);_0x3d1c73[_0xa845('0x65')]=intUtil[_0xa845('0x4d')](_0x3d1c73[_0xa845('0x65')]);def[_0xa845('0x4e')]=util[_0xa845('0x21')](_0xa845('0x66'),_0x3d1c73[_0xa845('0x4c')]);if(_0x594ffa&&_0x594ffa[_0xa845('0x4f')]){logger[_0xa845('0xd')]('['+_0x448ae8['lastevent'][_0xa845('0x70')]()+']','Recording\x20is\x20enabled!');_0x448ae8[_0xa845('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d1c73['serverUrl'],_0x448ae8[_0xa845('0x53')],md5(_0x448ae8[_0xa845('0x53')]));}else{_0x448ae8[_0xa845('0x52')]='';}return getConnection(_0x3d1c73)[_0xa845('0x32')](function(_0x27493f){_0x27cbff=_0x27493f;if(!_[_0xa845('0x71')](_0x5898cf)){return getUser(_0x3d1c73,_0x5898cf[_0xa845('0xe')],_0x27cbff);}else{return getUser(_0x3d1c73,null,_0x27cbff);}})[_0xa845('0x32')](function(_0x852151){_0xa6ce25=_0x852151;logger[_0xa845('0xd')](_0xa845('0x54'),_0xa6ce25['id']);return getEndUser(_0x3d1c73,_0x448ae8[_0xa845('0x72')],_0x448ae8['calleridnum'],_0x27cbff);})[_0xa845('0x32')](function(_0x2a339f){_0x455efd=_0x2a339f;logger[_0xa845('0xd')]('The\x20Enduser\x20ID\x20is:',_0x455efd['id']);return getTicket(_0x3d1c73,_0xa6ce25,_0x455efd,_0x2a11c4,_0x448ae8,_0x2a11c4[_0xa845('0x57')],_0x27cbff,_0xa845('0x58'));})['then'](function(_0x50a2a0){_0x47441e=_0x50a2a0;logger[_0xa845('0xd')]('Ticket\x20created!');logger[_0xa845('0xd')]('The\x20Ticket\x20ID\x20is:',_0x47441e['id']);return setRelationship(_0x27cbff,_0xa6ce25,_0x47441e,_0xa845('0x5a'));})[_0xa845('0x32')](function(){return setRelationship(_0x27cbff,_0x455efd,_0x47441e,_0xa845('0x5b'));})['then'](function(){return getServerInfo(_0x27cbff);})[_0xa845('0x62')](function(_0x549ae5){logger[_0xa845('0x63')]('['+_0x448ae8['lastevent'][_0xa845('0x70')]()+']',JSON[_0xa845('0x25')](_0x549ae5));});}; \ No newline at end of file +var _0xe842=['remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','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','recordingFormat','recordingURL','uniqueid','destcalleridnum','Outbound','[OUTBOUND]','error','unmanaged','monitor_format','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','Inbound','users','contacts','lodash','request-promise','bluebird','../../../../config/environment','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_minutes','parent_type','parent_name','length','forEach','idField','variableName','JSON','format','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','then','Enduser\x20found!','Contacts','Caller\x20-\x20%s','Enduser\x20created.','first_name','[HTTP]','map','type','string','nameField','customField','toLowerCase','content','custom_fields','push','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue'];(function(_0x171813,_0x3d890a){var _0x51f380=function(_0x3ff6ce){while(--_0x3ff6ce){_0x171813['push'](_0x171813['shift']());}};_0x51f380(++_0x3d890a);}(_0xe842,0x18b));var _0x2e84=function(_0x14b62e,_0x3b8096){_0x14b62e=_0x14b62e-0x0;var _0x42ad69=_0xe842[_0x14b62e];return _0x42ad69;};'use strict';var _=require(_0x2e84('0x0'));var rp=require(_0x2e84('0x1'));var BPromise=require(_0x2e84('0x2'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x2e84('0x3'));var logger=require('../../../../config/logger')(_0x2e84('0x4'));config[_0x2e84('0x5')]=_['defaults'](config[_0x2e84('0x5')],{'host':_0x2e84('0x6'),'port':0x18eb});var io=require(_0x2e84('0x7'))(new Redis(config[_0x2e84('0x5')]));var def={'method':_0x2e84('0x8'),'json':!![]};function emit(_0x1ea9e4,_0x44b8e7,_0x565af6){io['to'](_0x1ea9e4)[_0x2e84('0x9')](_0x44b8e7,_0x565af6);}function getTicket(_0x299b16,_0xa05216,_0x28df05,_0x5a7331,_0x2bddab,_0x37d173,_0x24564c,_0x98e0aa){logger[_0x2e84('0xa')](_0x2e84('0xb'));var _0x4cea18=new Date();var _0x13f6db=[{'name':_0x2e84('0xc'),'value':intUtil[_0x2e84('0xd')](_0x5a7331[_0x2e84('0xe')],_0x2bddab,'\x20')},{'name':_0x2e84('0xf'),'value':_0xa05216['id']},{'name':_0x2e84('0x10'),'value':_0xa05216['id']},{'name':_0x2e84('0x11'),'value':intUtil[_0x2e84('0xd')](_0x5a7331[_0x2e84('0x12')],_0x2bddab,'\x0a')},{'name':_0x2e84('0x13'),'value':_0x4cea18[_0x2e84('0x14')]()['slice'](0x0,0x13)[_0x2e84('0x15')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x2e84('0x16'),'value':'15'},{'name':'parent_id','value':_0x28df05['id']},{'name':_0x2e84('0x17'),'value':'Contacts'},{'name':_0x2e84('0x18'),'value':_0x28df05[_0x2e84('0xc')]},{'name':'direction','value':_0x98e0aa}];if(_0x37d173[_0x2e84('0x19')]){_[_0x2e84('0x1a')](_0x37d173,function(_0x297e77){if(_0x2bddab[_0x297e77['variableName']]){_0x13f6db['push']({'name':_0x297e77[_0x2e84('0x1b')],'value':_0x2bddab[_0x297e77[_0x2e84('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x2e84('0x1d'),'response_type':_0x2e84('0x1d'),'rest_data':JSON['stringify']({'session':_0x24564c['id'],'module_name':'Calls','name_value_list':_0x13f6db})}});}function getAuth(_0x51e36d){return util[_0x2e84('0x1e')](_0x2e84('0x1f'),new Buffer(_0x51e36d[_0x2e84('0x20')]+':X')[_0x2e84('0x21')](_0x2e84('0x22')));}function getServerInfo(_0x36781a){return request({'form':{'method':_0x2e84('0x23'),'input_type':_0x2e84('0x1d'),'response_type':_0x2e84('0x1d'),'rest_data':JSON[_0x2e84('0x24')]({'session':_0x36781a['id']})}});}function getUser(_0x30410f,_0x18d731,_0x284fc9){if(!_[_0x2e84('0x25')](_0x18d731)){logger['info']('Getting\x20agent\x20with\x20name',_0x18d731);return request({'form':{'method':_0x2e84('0x26'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x2e84('0x24')]({'session':_0x284fc9['id'],'module_name':_0x2e84('0x27'),'query':util[_0x2e84('0x1e')](_0x2e84('0x28'),_0x18d731),'order_by':'','offset':'0','select_fields':['id',_0x2e84('0xc'),_0x2e84('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x504531){if(_0x504531[_0x2e84('0x2a')][_0x2e84('0x19')]){var _0x25e604=_[_0x2e84('0x2b')](_0x504531[_0x2e84('0x2a')],function(_0x4e5a56){return _0x4e5a56[_0x2e84('0x2c')]['user_name'][_0x2e84('0x2d')]===_0x18d731;});if(_0x25e604){logger['info'](_0x2e84('0x2e'));return BPromise[_0x2e84('0x2f')]({'id':_0x25e604['name_value_list']['id'][_0x2e84('0x2d')],'name':_0x25e604[_0x2e84('0x2c')][_0x2e84('0xc')]['value']});}}logger['info'](_0x2e84('0x30'));return BPromise[_0x2e84('0x2f')]({'id':_0x284fc9[_0x2e84('0x2c')][_0x2e84('0x31')][_0x2e84('0x2d')],'name':_0x284fc9['name_value_list'][_0x2e84('0x29')][_0x2e84('0x2d')]});});}else{logger[_0x2e84('0xa')](_0x2e84('0x32'));return BPromise[_0x2e84('0x2f')]({'id':_0x284fc9['name_value_list'][_0x2e84('0x31')]['value'],'name':_0x284fc9[_0x2e84('0x2c')][_0x2e84('0x29')][_0x2e84('0x2d')]});}}function getEndUser(_0x262b72,_0xccde51,_0x349f2c,_0x2d4544){logger[_0x2e84('0xa')](_0x2e84('0x33'),_0x349f2c);return request({'form':{'method':_0x2e84('0x26'),'input_type':_0x2e84('0x1d'),'response_type':'JSON','rest_data':JSON[_0x2e84('0x24')]({'session':_0x2d4544['id'],'module_name':'Contacts','query':util[_0x2e84('0x1e')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x349f2c),'order_by':'','offset':'0','select_fields':['id',_0x2e84('0xc'),_0x2e84('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2e84('0x35')](function(_0x6d3f41){if(_0x6d3f41[_0x2e84('0x2a')][_0x2e84('0x19')]){var _0x5d939c=_['find'](_0x6d3f41['entry_list'],function(_0x1c12b0){return _0x1c12b0[_0x2e84('0x2c')]['phone_home'][_0x2e84('0x2d')]===_0x349f2c;});if(_0x5d939c){logger['info'](_0x2e84('0x36'));return BPromise[_0x2e84('0x2f')]({'id':_0x5d939c[_0x2e84('0x2c')]['id'][_0x2e84('0x2d')],'name':_0x5d939c[_0x2e84('0x2c')][_0x2e84('0xc')][_0x2e84('0x2d')],'phone':_0x5d939c[_0x2e84('0x2c')][_0x2e84('0x34')][_0x2e84('0x2d')]});}}else{logger[_0x2e84('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0x2e84('0x1d'),'response_type':_0x2e84('0x1d'),'rest_data':JSON[_0x2e84('0x24')]({'session':_0x2d4544['id'],'module_name':_0x2e84('0x37'),'name_value_list':[{'name':'first_name','value':_0xccde51!==''?_0xccde51:util['format'](_0x2e84('0x38'),_0x349f2c)},{'name':_0x2e84('0x34'),'value':_0x349f2c}]})}})[_0x2e84('0x35')](function(_0x4b36eb){logger['info'](_0x2e84('0x39'));return BPromise['resolve']({'id':_0x4b36eb['id'],'name':_0x4b36eb[_0x2e84('0x2a')][_0x2e84('0x3a')][_0x2e84('0x2d')],'phone':_0x4b36eb[_0x2e84('0x2a')][_0x2e84('0x34')][_0x2e84('0x2d')]});});}});}function request(_0x4d5f22){logger['debug'](_0x2e84('0x3b'),JSON['stringify'](_0x4d5f22));return rp(_['merge'](def,_0x4d5f22));}function getTags(_0x574fca,_0x3c5f49){var _0x2c6bd9=[];if(_0x574fca&&_0x574fca[_0x2e84('0x19')]>0x0){_0x2c6bd9=_[_0x2e84('0x3c')](_0x574fca,_0x3c5f49);}return _0x2c6bd9;}function getCustomFields(_0x44d9d6,_0x1c3b16){var _0x336882=[];var _0x2f1e8f={'custom_fields':[]};if(_0x44d9d6[_0x2e84('0x19')]>0x0){_['forEach'](_0x44d9d6,function(_0x50021e){if(_0x50021e[_0x2e84('0x3d')]===_0x2e84('0x3e')&&_0x50021e[_0x2e84('0x3f')]&&!_0x50021e[_0x2e84('0x40')]){_0x2f1e8f[_0x50021e[_0x2e84('0x3f')][_0x2e84('0x41')]()]=_0x50021e[_0x2e84('0x42')][_0x2e84('0x21')]();}else if(_0x50021e[_0x2e84('0x3d')]===_0x2e84('0x3e')&&_0x50021e[_0x2e84('0x1b')]&&_0x50021e[_0x2e84('0x40')]){_0x2f1e8f[_0x2e84('0x43')]['push']({'id':_0x50021e[_0x2e84('0x1b')],'value':_0x50021e[_0x2e84('0x42')]['toString']()});}else if(_0x50021e[_0x2e84('0x3d')]==='variable'&&_0x50021e['variableName']&&_0x50021e[_0x2e84('0x1b')]&&_0x50021e['customField']){_0x1c3b16[_0x50021e[_0x2e84('0x1c')]]&&_0x2f1e8f[_0x2e84('0x43')][_0x2e84('0x44')]({'id':_0x50021e[_0x2e84('0x1b')],'value':_0x1c3b16[_0x50021e[_0x2e84('0x1c')]]['toString']()});}else if(_0x50021e[_0x2e84('0x3d')]===_0x2e84('0x45')&&_0x50021e[_0x2e84('0x46')]&&_0x50021e[_0x2e84('0x46')][_0x2e84('0xc')]&&_0x50021e[_0x2e84('0x1b')]&&_0x50021e['customField']){_0x1c3b16[_0x50021e[_0x2e84('0x46')][_0x2e84('0xc')]['toLowerCase']()]&&_0x2f1e8f['custom_fields'][_0x2e84('0x44')]({'id':_0x50021e[_0x2e84('0x1b')],'value':_0x1c3b16[_0x50021e[_0x2e84('0x46')][_0x2e84('0xc')][_0x2e84('0x41')]()][_0x2e84('0x21')]()});}});}return _0x2f1e8f;}function getConnection(_0x3e54ea){return request({'method':_0x2e84('0x8'),'form':{'method':_0x2e84('0x47'),'input_type':_0x2e84('0x1d'),'response_type':'JSON','rest_data':JSON[_0x2e84('0x24')]({'user_auth':{'user_name':_0x3e54ea[_0x2e84('0x48')],'password':_0x3e54ea[_0x2e84('0x49')],'encryption':_0x2e84('0x4a')},'application':_0x2e84('0x4b')})}})[_0x2e84('0x35')](function(_0x32dd32){var _0x536aea=_0x32dd32;if(_0x536aea['id']){def[_0x2e84('0x4c')]=_0x536aea['id'];return BPromise[_0x2e84('0x2f')](_0x536aea);}else{throw new Error(util[_0x2e84('0x1e')](_0x2e84('0x4d'),_0x3e54ea['id']));}});}function setRelationship(_0xa50886,_0x514e9c,_0x3daaad,_0x1d8260){return request({'form':{'method':_0x2e84('0x4e'),'input_type':_0x2e84('0x1d'),'response_type':'JSON','rest_data':JSON[_0x2e84('0x24')]({'session':_0xa50886['id'],'module_name':_0x2e84('0x4f'),'module_id':_0x3daaad['id'],'link_field_name':_0x1d8260,'related_ids':[_0x514e9c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2e84('0x50')]=function(_0x64aa2d,_0xd0416b,_0x451810,_0x5785cd,_0x42fe69,_0xad4ef6){var _0x521805,_0x23ca0b,_0x192bab,_0x55ed61;_0xad4ef6[_0x2e84('0x51')]=intUtil[_0x2e84('0x52')](_0xad4ef6[_0x2e84('0x51')]);_0xad4ef6[_0x2e84('0x53')]=intUtil[_0x2e84('0x52')](_0xad4ef6[_0x2e84('0x53')]);def[_0x2e84('0x54')]=util['format'](_0x2e84('0x55'),_0xad4ef6[_0x2e84('0x51')]);if(_0x42fe69&&_0x42fe69['monitor_format']){logger[_0x2e84('0xa')](_0x2e84('0x56'),_0x2e84('0x57'));_0xd0416b['recordingURL']=util[_0x2e84('0x1e')](_0x2e84('0x58'),_0xad4ef6['serverUrl'],_0xd0416b['uniqueid'],md5(_0xd0416b['uniqueid']));}else{_0xd0416b['recordingURL']='';}return getConnection(_0xad4ef6)['then'](function(_0x4d308c){_0x55ed61=_0x4d308c;return getUser(_0xad4ef6,_0x5785cd[_0x2e84('0xc')],_0x55ed61);})[_0x2e84('0x35')](function(_0x517883){_0x521805=_0x517883;logger['info'](_0x2e84('0x59'),_0x521805['id']);return getEndUser(_0xad4ef6,_0xd0416b[_0x2e84('0x5a')],_0xd0416b[_0x2e84('0x5b')],_0x55ed61);})[_0x2e84('0x35')](function(_0x4ebec2){_0x23ca0b=_0x4ebec2;logger[_0x2e84('0xa')]('The\x20Enduser\x20ID\x20is:',_0x23ca0b['id']);return getTicket(_0xad4ef6,_0x521805,_0x23ca0b,_0x451810,_0xd0416b,_0x451810[_0x2e84('0x5c')],_0x55ed61,'Inbound');})['then'](function(_0xb5e843){_0x192bab=_0xb5e843;logger[_0x2e84('0xa')](_0x2e84('0x5d'));logger[_0x2e84('0xa')](_0x2e84('0x5e'),_0x192bab['id']);return setRelationship(_0x55ed61,_0x521805,_0x192bab,'users');})['then'](function(){return setRelationship(_0x55ed61,_0x23ca0b,_0x192bab,'contacts');})[_0x2e84('0x35')](function(){return getServerInfo(_0x55ed61);})[_0x2e84('0x35')](function(_0x109c83){var _0x244a35=parseInt(_0x109c83[_0x2e84('0x5f')][_0x2e84('0x60')](0x0));var _0x5e4e05=util[_0x2e84('0x1e')](_0x2e84('0x61'),_0xad4ef6[_0x2e84('0x51')],_0x192bab['id']);if(_0x244a35>0x6){_0x5e4e05=util[_0x2e84('0x1e')](_0x2e84('0x62'),_0xad4ef6[_0x2e84('0x51')],_0x192bab['id']);}logger[_0x2e84('0xa')](_0x2e84('0x56'),_0x2e84('0x63'));emit(util[_0x2e84('0x1e')](_0x2e84('0x64'),_0x5785cd[_0x2e84('0xc')]),_0x2e84('0x65'),{'uri':_0x5e4e05});})[_0x2e84('0x66')](function(_0x13af70){logger['error']('[QUEUE]',JSON['stringify'](_0x13af70));});};exports[_0x2e84('0x67')]=function(_0x38f153,_0x34292c,_0x48f912,_0x2bd906,_0x3da29a,_0x1d97c8,_0x2b9a89){var _0x3fc97d,_0x368eb8,_0x187e47,_0xef8744;_0x1d97c8[_0x2e84('0x51')]=intUtil[_0x2e84('0x52')](_0x1d97c8[_0x2e84('0x51')]);_0x1d97c8[_0x2e84('0x53')]=intUtil['stripTrailingSlash'](_0x1d97c8[_0x2e84('0x53')]);def['uri']=util[_0x2e84('0x1e')]('%s/service/v4_1/rest.php',_0x1d97c8[_0x2e84('0x51')]);if(_0x2b9a89&&_0x2b9a89['recordingFormat']&&_0x2b9a89[_0x2e84('0x68')]!=='none'){logger[_0x2e84('0xa')]('[OUTBOUND]',_0x2e84('0x57'));_0x34292c[_0x2e84('0x69')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d97c8[_0x2e84('0x53')],_0x34292c['uniqueid'],md5(_0x34292c[_0x2e84('0x6a')]));}return getConnection(_0x1d97c8)[_0x2e84('0x35')](function(_0x27fdfa){_0xef8744=_0x27fdfa;return getUser(_0x1d97c8,_0x2bd906[_0x2e84('0xc')],_0xef8744);})[_0x2e84('0x35')](function(_0xe19810){_0x3fc97d=_0xe19810;logger[_0x2e84('0xa')](_0x2e84('0x59'),_0x3fc97d['id']);return getEndUser(_0x1d97c8,_0x34292c['destcalleridname'],_0x34292c[_0x2e84('0x6b')],_0xef8744);})[_0x2e84('0x35')](function(_0x1d1664){_0x368eb8=_0x1d1664;logger[_0x2e84('0xa')]('The\x20Enduser\x20ID\x20is:',_0x368eb8['id']);return getTicket(_0x1d97c8,_0x3fc97d,_0x368eb8,_0x48f912,_0x34292c,_0x48f912[_0x2e84('0x5c')],_0xef8744,_0x2e84('0x6c'));})[_0x2e84('0x35')](function(_0x34e03a){_0x187e47=_0x34e03a;logger[_0x2e84('0xa')](_0x2e84('0x5d'));logger[_0x2e84('0xa')](_0x2e84('0x5e'),_0x187e47['id']);return setRelationship(_0xef8744,_0x3fc97d,_0x187e47,'users');})['then'](function(){return setRelationship(_0xef8744,_0x368eb8,_0x187e47,'contacts');})[_0x2e84('0x35')](function(){return getServerInfo(_0xef8744);})[_0x2e84('0x35')](function(_0x280ccc){var _0x2d4873=parseInt(_0x280ccc['version'][_0x2e84('0x60')](0x0));var _0x36eb96=util['format'](_0x2e84('0x61'),_0x1d97c8['remoteUri'],_0x187e47['id']);if(_0x2d4873>0x6){_0x36eb96=util['format'](_0x2e84('0x62'),_0x1d97c8[_0x2e84('0x51')],_0x187e47['id']);}logger[_0x2e84('0xa')](_0x2e84('0x6d'),_0x2e84('0x63'));emit(util[_0x2e84('0x1e')](_0x2e84('0x64'),_0x2bd906['name']),_0x2e84('0x65'),{'uri':_0x36eb96});})[_0x2e84('0x66')](function(_0x5f1249){logger[_0x2e84('0x6e')](_0x2e84('0x6d'),JSON['stringify'](_0x5f1249));});};exports[_0x2e84('0x6f')]=function(_0x556273,_0xab8bbc,_0x2a87df,_0x4cfc92,_0x2db01a,_0x2ea92b){var _0x338010,_0x595609,_0x33d43d,_0x4b77d4;_0x2ea92b[_0x2e84('0x51')]=intUtil[_0x2e84('0x52')](_0x2ea92b[_0x2e84('0x51')]);_0x2ea92b[_0x2e84('0x53')]=intUtil[_0x2e84('0x52')](_0x2ea92b[_0x2e84('0x53')]);def[_0x2e84('0x54')]=util[_0x2e84('0x1e')]('%s/service/v4_1/rest.php',_0x2ea92b[_0x2e84('0x51')]);if(_0x2db01a&&_0x2db01a[_0x2e84('0x70')]){logger['info']('['+_0xab8bbc[_0x2e84('0x71')][_0x2e84('0x72')]()+']','Recording\x20is\x20enabled!');_0xab8bbc['recordingURL']=util[_0x2e84('0x1e')](_0x2e84('0x58'),_0x2ea92b[_0x2e84('0x53')],_0xab8bbc[_0x2e84('0x6a')],md5(_0xab8bbc[_0x2e84('0x6a')]));}else{_0xab8bbc['recordingURL']='';}return getConnection(_0x2ea92b)[_0x2e84('0x35')](function(_0x2ad484){_0x4b77d4=_0x2ad484;if(!_[_0x2e84('0x25')](_0x4cfc92)){return getUser(_0x2ea92b,_0x4cfc92[_0x2e84('0xc')],_0x4b77d4);}else{return getUser(_0x2ea92b,null,_0x4b77d4);}})[_0x2e84('0x35')](function(_0x53b4bd){_0x338010=_0x53b4bd;logger[_0x2e84('0xa')](_0x2e84('0x59'),_0x338010['id']);return getEndUser(_0x2ea92b,_0xab8bbc[_0x2e84('0x5a')],_0xab8bbc[_0x2e84('0x5b')],_0x4b77d4);})[_0x2e84('0x35')](function(_0x1df338){_0x595609=_0x1df338;logger['info'](_0x2e84('0x73'),_0x595609['id']);return getTicket(_0x2ea92b,_0x338010,_0x595609,_0x2a87df,_0xab8bbc,_0x2a87df[_0x2e84('0x5c')],_0x4b77d4,_0x2e84('0x74'));})[_0x2e84('0x35')](function(_0x190b55){_0x33d43d=_0x190b55;logger[_0x2e84('0xa')](_0x2e84('0x5d'));logger[_0x2e84('0xa')](_0x2e84('0x5e'),_0x33d43d['id']);return setRelationship(_0x4b77d4,_0x338010,_0x33d43d,_0x2e84('0x75'));})[_0x2e84('0x35')](function(){return setRelationship(_0x4b77d4,_0x595609,_0x33d43d,_0x2e84('0x76'));})[_0x2e84('0x35')](function(){return getServerInfo(_0x4b77d4);})[_0x2e84('0x66')](function(_0x576980){logger[_0x2e84('0x6e')]('['+_0xab8bbc[_0x2e84('0x71')][_0x2e84('0x72')]()+']',JSON[_0x2e84('0x24')](_0x576980));});}; \ 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 6adaa8c..2526ac7 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 _0x2dba=['util','getString','length','sortBy','string','push','content','variable','variableName','toString','type','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2dba,0x1c1));var _0xa2db=function(_0x37bff9,_0x194334){_0x37bff9=_0x37bff9-0x0;var _0x4c57cc=_0x2dba[_0x37bff9];return _0x4c57cc;};'use strict';var _=require(_0xa2db('0x0'));var util=require(_0xa2db('0x1'));exports[_0xa2db('0x2')]=function(_0x391ffb,_0x251775,_0x52ddec){var _0x4be79e=[];if(_0x391ffb[_0xa2db('0x3')]>0x0){var _0x4723a7=_[_0xa2db('0x4')](_0x391ffb,['id']);for(var _0x3ffa30=0x0;_0x3ffa30<_0x4723a7['length'];_0x3ffa30++){var _0x40cab6=_0x4723a7[_0x3ffa30];if(_0x40cab6['type']===_0xa2db('0x5')){_0x4be79e[_0xa2db('0x6')](_0x40cab6[_0xa2db('0x7')]);}else if(_0x40cab6['type']===_0xa2db('0x8')&&_0x40cab6[_0xa2db('0x9')]){_0x251775[_0x40cab6[_0xa2db('0x9')]]&&_0x4be79e[_0xa2db('0x6')](_0x251775[_0x40cab6[_0xa2db('0x9')]][_0xa2db('0xa')]());}else if(_0x40cab6[_0xa2db('0xb')]===_0xa2db('0xc')&&_0x40cab6['Variable']&&_0x40cab6[_0xa2db('0xd')][_0xa2db('0xe')]){_0x251775[_0x40cab6[_0xa2db('0xd')][_0xa2db('0xe')][_0xa2db('0xf')]()]&&_0x4be79e[_0xa2db('0x6')](_0x251775[_0x40cab6['Variable'][_0xa2db('0xe')][_0xa2db('0xf')]()][_0xa2db('0xa')]());}else if(_0x40cab6['type']===_0xa2db('0x10')){if(_0x40cab6[_0xa2db('0x11')]===_0xa2db('0x5')&&_0x40cab6[_0xa2db('0x12')]){_0x4be79e[_0xa2db('0x6')](util[_0xa2db('0x13')](_0xa2db('0x14'),_0x40cab6[_0xa2db('0x12')],_0x40cab6[_0xa2db('0x15')]));}else if(_0x40cab6['keyType']===_0xa2db('0x8')&&_0x40cab6[_0xa2db('0x9')]&&_0x40cab6['key']){_0x251775[_0x40cab6[_0xa2db('0x9')]]&&_0x4be79e[_0xa2db('0x6')](util[_0xa2db('0x13')]('%s:\x20%s',_0x40cab6[_0xa2db('0x12')],_0x251775[_0x40cab6[_0xa2db('0x9')]]));}else if(_0x40cab6[_0xa2db('0x11')]==='customVariable'&&_0x40cab6[_0xa2db('0xd')]&&_0x40cab6['Variable'][_0xa2db('0xe')]&&_0x40cab6[_0xa2db('0x12')]){_0x251775[_0x40cab6['Variable'][_0xa2db('0xe')]['toLowerCase']()]&&_0x4be79e[_0xa2db('0x6')](util[_0xa2db('0x13')](_0xa2db('0x14'),_0x40cab6[_0xa2db('0x12')],_0x251775[_0x40cab6[_0xa2db('0xd')][_0xa2db('0xe')]['toLowerCase']()]));}}}}return _0x4be79e[_0xa2db('0x16')](_0x52ddec);};exports[_0xa2db('0x17')]=function(_0x3290a8){var _0x3dbf2b=_0x3290a8[_0xa2db('0x18')](-0x1);if(_0x3dbf2b==='/'){_0x3290a8=_0x3290a8[_0xa2db('0x19')](0x0,_0x3290a8[_0xa2db('0x1a')](_0x3dbf2b));}return _0x3290a8;};exports[_0xa2db('0x1b')]=function(_0x242df6){if(!_[_0xa2db('0x1c')](_0x242df6)&&_0x242df6!==''){var _0x2fa9d2=/^(([^<>()\[\]\\.,;:\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 _0x2fa9d2[_0xa2db('0x1d')](String(_0x242df6)[_0xa2db('0xf')]());}else{return![];}}; \ No newline at end of file +var _0x3958=['type','push','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyType','string','%s:\x20%s','keyContent','key','format','stripTrailingSlash','slice','validateEmail','isNil','test','lodash','getString','length','sortBy'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x3958,0x1c4));var _0x8395=function(_0x22a656,_0x117294){_0x22a656=_0x22a656-0x0;var _0x3d679d=_0x3958[_0x22a656];return _0x3d679d;};'use strict';var _=require(_0x8395('0x0'));var util=require('util');exports[_0x8395('0x1')]=function(_0x5ff0af,_0x333888,_0x281cb6){var _0x160c7f=[];if(_0x5ff0af[_0x8395('0x2')]>0x0){var _0x10669e=_[_0x8395('0x3')](_0x5ff0af,['id']);for(var _0x3e0a58=0x0;_0x3e0a58<_0x10669e['length'];_0x3e0a58++){var _0x1f8852=_0x10669e[_0x3e0a58];if(_0x1f8852[_0x8395('0x4')]==='string'){_0x160c7f[_0x8395('0x5')](_0x1f8852['content']);}else if(_0x1f8852[_0x8395('0x4')]===_0x8395('0x6')&&_0x1f8852['variableName']){_0x333888[_0x1f8852[_0x8395('0x7')]]&&_0x160c7f['push'](_0x333888[_0x1f8852[_0x8395('0x7')]]['toString']());}else if(_0x1f8852[_0x8395('0x4')]===_0x8395('0x8')&&_0x1f8852[_0x8395('0x9')]&&_0x1f8852['Variable'][_0x8395('0xa')]){_0x333888[_0x1f8852['Variable'][_0x8395('0xa')][_0x8395('0xb')]()]&&_0x160c7f[_0x8395('0x5')](_0x333888[_0x1f8852['Variable']['name'][_0x8395('0xb')]()][_0x8395('0xc')]());}else if(_0x1f8852[_0x8395('0x4')]==='keyValue'){if(_0x1f8852[_0x8395('0xd')]===_0x8395('0xe')&&_0x1f8852['key']){_0x160c7f[_0x8395('0x5')](util['format'](_0x8395('0xf'),_0x1f8852['key'],_0x1f8852[_0x8395('0x10')]));}else if(_0x1f8852[_0x8395('0xd')]===_0x8395('0x6')&&_0x1f8852[_0x8395('0x7')]&&_0x1f8852[_0x8395('0x11')]){_0x333888[_0x1f8852[_0x8395('0x7')]]&&_0x160c7f['push'](util[_0x8395('0x12')](_0x8395('0xf'),_0x1f8852['key'],_0x333888[_0x1f8852[_0x8395('0x7')]]));}else if(_0x1f8852[_0x8395('0xd')]===_0x8395('0x8')&&_0x1f8852[_0x8395('0x9')]&&_0x1f8852[_0x8395('0x9')][_0x8395('0xa')]&&_0x1f8852[_0x8395('0x11')]){_0x333888[_0x1f8852[_0x8395('0x9')]['name']['toLowerCase']()]&&_0x160c7f['push'](util[_0x8395('0x12')](_0x8395('0xf'),_0x1f8852[_0x8395('0x11')],_0x333888[_0x1f8852[_0x8395('0x9')][_0x8395('0xa')][_0x8395('0xb')]()]));}}}}return _0x160c7f['join'](_0x281cb6);};exports[_0x8395('0x13')]=function(_0x40c155){var _0x44db12=_0x40c155[_0x8395('0x14')](-0x1);if(_0x44db12==='/'){_0x40c155=_0x40c155['substring'](0x0,_0x40c155['lastIndexOf'](_0x44db12));}return _0x40c155;};exports[_0x8395('0x15')]=function(_0x4f1019){if(!_[_0x8395('0x16')](_0x4f1019)&&_0x4f1019!==''){var _0x176701=/^(([^<>()\[\]\\.,;:\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 _0x176701[_0x8395('0x17')](String(_0x4f1019)[_0x8395('0xb')]());}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 011bfab..afa4a54 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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 2733e4f..99ac2e0 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 _0x22da=['The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','unmanaged','monitor_format','Authorization','catch','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','./util','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','forEach','includes','string','type','nameField','customField','content','picklist','idField','custom_fields','variable','variableName','push','Variable','name','toLowerCase','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum'];(function(_0x56a259,_0x3e631e){var _0x4fb824=function(_0x2d11be){while(--_0x2d11be){_0x56a259['push'](_0x56a259['shift']());}};_0x4fb824(++_0x3e631e);}(_0x22da,0x8d));var _0xa22d=function(_0x2e66d8,_0x6343d2){_0x2e66d8=_0x2e66d8-0x0;var _0x33d413=_0x22da[_0x2e66d8];return _0x33d413;};'use strict';var _=require(_0xa22d('0x0'));var rp=require(_0xa22d('0x1'));var md5=require(_0xa22d('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa22d('0x3'));var config=require(_0xa22d('0x4'));var logger=require('../../../../config/logger')(_0xa22d('0x5'));config[_0xa22d('0x6')]=_[_0xa22d('0x7')](config['redis'],{'host':_0xa22d('0x8'),'port':0x18eb});var io=require(_0xa22d('0x9'))(new Redis(config[_0xa22d('0x6')]));function emit(_0x591fa6,_0x248a7b,_0x4e61b4){io['to'](_0x591fa6)[_0xa22d('0xa')](_0x248a7b,_0x4e61b4);}var headers={'Content-Type':'application/json','Accept':_0xa22d('0xb')};function getTicket(_0x351424,_0x298d29,_0x5095ec,_0x19f6d0,_0x5cb49d){logger[_0xa22d('0xc')](_0xa22d('0xd'));return request({'uri':util[_0xa22d('0xe')](_0xa22d('0xf'),_0x351424['remoteUri']),'method':_0xa22d('0x10'),'body':{'ticket':_[_0xa22d('0x11')]({'requester_id':_0x5095ec['id'],'submitter_id':_0x298d29?_0x298d29['id']:undefined,'assignee_id':_0x298d29?_0x298d29['id']:undefined,'tags':getTags(_0x19f6d0[_0xa22d('0x12')],'name'),'subject':intUtil[_0xa22d('0x13')](_0x19f6d0['Subjects'],_0x5cb49d,'\x20'),'description':intUtil['getString'](_0x19f6d0[_0xa22d('0x14')],_0x5cb49d,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa22d('0x13')](_0x19f6d0[_0xa22d('0x14')],_0x5cb49d,'\x0a')}},getCustomFields(_0x19f6d0[_0xa22d('0x15')],_0x5cb49d))}})[_0xa22d('0x16')](function(_0x350a0e){logger[_0xa22d('0xc')](_0xa22d('0x17'));return _0x350a0e[_0xa22d('0x18')];});}function getUser(_0x4d9724,_0x243388){if(intUtil['validateEmail'](_0x243388)){logger[_0xa22d('0xc')]('Getting\x20agent\x20with\x20email',_0x243388);return request({'uri':util[_0xa22d('0xe')]('%s/search.json',_0x4d9724[_0xa22d('0x19')]),'qs':{'query':util['format'](_0xa22d('0x1a'),_0x243388)}})[_0xa22d('0x16')](function(_0x54dc89){if(_0x54dc89[_0xa22d('0x1b')]){logger[_0xa22d('0xc')](_0xa22d('0x1c'));return _[_0xa22d('0x1d')](_0x54dc89['results'],{'email':_0x243388,'role':_0xa22d('0x1e')});}else{logger[_0xa22d('0xc')](_0xa22d('0x1f'));return request({'uri':util[_0xa22d('0xe')](_0xa22d('0x20'),_0x4d9724[_0xa22d('0x19')])})[_0xa22d('0x16')](function(_0x5c0d52){logger[_0xa22d('0xc')](_0xa22d('0x21'));return _0x5c0d52['user'];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x4d9724[_0xa22d('0x19')])})['then'](function(_0x276b35){logger[_0xa22d('0xc')](_0xa22d('0x21'));return _0x276b35['user'];});}}function getEndUser(_0x427c2b,_0x3d57e8,_0x547f56){logger[_0xa22d('0xc')]('Searching\x20enduser\x20with\x20phone',_0x547f56);return request({'uri':util[_0xa22d('0xe')](_0xa22d('0x22'),_0x427c2b[_0xa22d('0x19')]),'qs':{'query':util[_0xa22d('0xe')](_0xa22d('0x23'),_0x547f56)}})['then'](function(_0x58face){var _0x2a9223;if(_0x58face[_0xa22d('0x24')][_0xa22d('0x25')]){_0x58face['results']=_[_0xa22d('0x26')](_0x58face[_0xa22d('0x24')],{'suspended':![],'role':_0xa22d('0x27')});if(_0x58face[_0xa22d('0x24')]['length']){_0x2a9223=_[_0xa22d('0x28')](_0x58face[_0xa22d('0x24')]);}}if(_0x2a9223){logger[_0xa22d('0xc')](_0xa22d('0x29'));return _0x2a9223;}else{logger[_0xa22d('0xc')](_0xa22d('0x2a'));return request({'uri':util[_0xa22d('0xe')](_0xa22d('0x2b'),_0x427c2b[_0xa22d('0x19')]),'method':_0xa22d('0x10'),'body':{'user':{'role':_0xa22d('0x27'),'name':util['format']('Caller\x20-\x20%s',_0x3d57e8||_0x547f56),'phone':_0x547f56}}})[_0xa22d('0x16')](function(_0x294f01){logger[_0xa22d('0xc')]('Enduser\x20created.');return _0x294f01['user'];});}});}function getAuth(_0x58d774){var _0x42ee3d;if(_0x58d774[_0xa22d('0x2c')]===_0xa22d('0x2d')){_0x42ee3d=util[_0xa22d('0xe')]('%s:%s',_0x58d774[_0xa22d('0x2e')],_0x58d774[_0xa22d('0x2d')]);}else if(_0x58d774[_0xa22d('0x2c')]===_0xa22d('0x2f')){_0x42ee3d=util['format'](_0xa22d('0x30'),_0x58d774['username'],_0x58d774['token']);}return util[_0xa22d('0xe')](_0xa22d('0x31'),new Buffer(_0x42ee3d)[_0xa22d('0x32')]('base64'));}function request(_0x4c2ac5){logger[_0xa22d('0x33')](_0xa22d('0x34'),JSON[_0xa22d('0x35')](_0x4c2ac5));return rp(_[_0xa22d('0x7')](_0x4c2ac5,{'method':_0xa22d('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x1ef5b9,_0xa87cb7){var _0x15fdae=[];if(_0x1ef5b9&&_0x1ef5b9[_0xa22d('0x25')]>0x0){_0x15fdae=_['map'](_0x1ef5b9,_0xa87cb7);}return _0x15fdae;}function getCustomFields(_0x332183,_0x52cd7e){var _0x3ee93f=[];var _0x5d1e8d={'custom_fields':[]};if(_0x332183[_0xa22d('0x25')]>0x0){_[_0xa22d('0x37')](_0x332183,function(_0x5584b5){if(_[_0xa22d('0x38')]([_0xa22d('0x39'),'picklist'],_0x5584b5[_0xa22d('0x3a')])&&_0x5584b5[_0xa22d('0x3b')]&&!_0x5584b5[_0xa22d('0x3c')]){_0x5d1e8d[_0x5584b5[_0xa22d('0x3b')]['toLowerCase']()]=_0x5584b5[_0xa22d('0x3d')][_0xa22d('0x32')]();}else if(_[_0xa22d('0x38')]([_0xa22d('0x39'),_0xa22d('0x3e')],_0x5584b5[_0xa22d('0x3a')])&&_0x5584b5[_0xa22d('0x3f')]&&_0x5584b5[_0xa22d('0x3c')]){_0x5d1e8d[_0xa22d('0x40')]['push']({'id':_0x5584b5[_0xa22d('0x3f')],'value':_0x5584b5[_0xa22d('0x3d')][_0xa22d('0x32')]()});}else if(_0x5584b5[_0xa22d('0x3a')]===_0xa22d('0x41')&&_0x5584b5[_0xa22d('0x42')]&&_0x5584b5[_0xa22d('0x3f')]&&_0x5584b5[_0xa22d('0x3c')]){_0x52cd7e[_0x5584b5['variableName']]&&_0x5d1e8d[_0xa22d('0x40')][_0xa22d('0x43')]({'id':_0x5584b5[_0xa22d('0x3f')],'value':_0x52cd7e[_0x5584b5[_0xa22d('0x42')]][_0xa22d('0x32')]()});}else if(_0x5584b5[_0xa22d('0x3a')]==='customVariable'&&_0x5584b5[_0xa22d('0x44')]&&_0x5584b5['Variable'][_0xa22d('0x45')]&&_0x5584b5[_0xa22d('0x3f')]&&_0x5584b5[_0xa22d('0x3c')]){_0x52cd7e[_0x5584b5[_0xa22d('0x44')]['name'][_0xa22d('0x46')]()]&&_0x5d1e8d[_0xa22d('0x40')][_0xa22d('0x43')]({'id':_0x5584b5[_0xa22d('0x3f')],'value':_0x52cd7e[_0x5584b5[_0xa22d('0x44')][_0xa22d('0x45')][_0xa22d('0x46')]()][_0xa22d('0x32')]()});}});}return _0x5d1e8d;}exports[_0xa22d('0x47')]=function(_0x35eadd,_0x348512,_0x25a024,_0x34f550,_0x279032,_0x56d39d){var _0x1f7421,_0x15df93;_0x56d39d[_0xa22d('0x19')]=intUtil['stripTrailingSlash'](_0x56d39d[_0xa22d('0x19')]);_0x56d39d[_0xa22d('0x48')]=intUtil[_0xa22d('0x49')](_0x56d39d['serverUrl']);if(_0x279032&&_0x279032['monitor_format']){logger[_0xa22d('0xc')](_0xa22d('0x4a'),_0xa22d('0x4b'));_0x348512[_0xa22d('0x4c')]=util[_0xa22d('0xe')](_0xa22d('0x4d'),_0x56d39d['serverUrl'],_0x348512[_0xa22d('0x4e')],md5(_0x348512[_0xa22d('0x4e')]));}else{_0x348512['recordingURL']='';}headers['Authorization']=getAuth(_0x56d39d);return getUser(_0x56d39d,_0x34f550[_0xa22d('0x4f')])[_0xa22d('0x16')](function(_0x401504){_0x1f7421=_0x401504;logger[_0xa22d('0xc')](_0xa22d('0x50'),_0x1f7421['id']);return getEndUser(_0x56d39d,_0x348512[_0xa22d('0x51')],_0x348512[_0xa22d('0x52')]);})[_0xa22d('0x16')](function(_0x5480b1){_0x15df93=_0x5480b1;logger[_0xa22d('0xc')]('The\x20Enduser\x20ID\x20is:',_0x15df93['id']);return getTicket(_0x56d39d,_0x1f7421,_0x15df93,_0x25a024,_0x348512);})[_0xa22d('0x16')](function(_0x3810d4){if(_0x3810d4){logger[_0xa22d('0xc')](_0xa22d('0x53'),_0x3810d4['id']);switch(_0x56d39d[_0xa22d('0x3a')]){case _0xa22d('0x54'):logger['info'](_0xa22d('0x4a'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xa22d('0xe')](_0xa22d('0x55'),_0x56d39d[_0xa22d('0x19')],_0x1f7421['id'],_0x3810d4['id']),'method':'POST'});case _0xa22d('0x56'):logger['info']('[QUEUE]',_0xa22d('0x57'));emit(util['format']('user:%s',_0x34f550[_0xa22d('0x45')]),_0xa22d('0x58'),{'uri':util[_0xa22d('0xe')](_0xa22d('0x59'),_0x56d39d[_0xa22d('0x19')][_0xa22d('0x5a')](_0xa22d('0x5b'),''),_0x3810d4['id'])});break;default:logger[_0xa22d('0x5c')]('[QUEUE]',_0xa22d('0x5d'));}}})['catch'](function(_0x4c80c6){logger['error'](_0xa22d('0x5e'),util[_0xa22d('0x5f')](_0x4c80c6,{'showHidden':!![],'depth':null}));});};exports[_0xa22d('0x60')]=function(_0x21380b,_0x383898,_0x5e1ab2,_0x1cf0f3,_0x237287,_0x4afadb,_0x118a44){var _0xb010f4,_0x54558a;_0x4afadb[_0xa22d('0x19')]=intUtil[_0xa22d('0x49')](_0x4afadb[_0xa22d('0x19')]);_0x4afadb[_0xa22d('0x48')]=intUtil[_0xa22d('0x49')](_0x4afadb[_0xa22d('0x48')]);if(_0x118a44&&_0x118a44['recordingFormat']&&_0x118a44[_0xa22d('0x61')]!==_0xa22d('0x62')){logger['info'](_0xa22d('0x63'),_0xa22d('0x4b'));_0x383898[_0xa22d('0x4c')]=util[_0xa22d('0xe')](_0xa22d('0x4d'),_0x4afadb['serverUrl'],_0x383898[_0xa22d('0x4e')],md5(_0x383898[_0xa22d('0x4e')]));}headers['Authorization']=getAuth(_0x4afadb);return getUser(_0x4afadb,_0x1cf0f3['email'])['then'](function(_0x2b9730){_0xb010f4=_0x2b9730;logger['info'](_0xa22d('0x50'),_0xb010f4['id']);return getEndUser(_0x4afadb,_0x383898[_0xa22d('0x64')],_0x383898[_0xa22d('0x65')]);})[_0xa22d('0x16')](function(_0x36e663){_0x54558a=_0x36e663;logger[_0xa22d('0xc')](_0xa22d('0x66'),_0x54558a['id']);return getTicket(_0x4afadb,_0xb010f4,_0x54558a,_0x5e1ab2,_0x383898);})[_0xa22d('0x16')](function(_0x5333b8){if(_0x5333b8){logger[_0xa22d('0xc')](_0xa22d('0x53'),_0x5333b8['id']);switch(_0x4afadb['type']){case _0xa22d('0x54'):logger['info'](_0xa22d('0x63'),_0xa22d('0x67'));return request({'uri':util[_0xa22d('0xe')](_0xa22d('0x55'),_0x4afadb['remoteUri'],_0xb010f4['id'],_0x5333b8['id']),'method':_0xa22d('0x10')});case'newTab':logger[_0xa22d('0xc')](_0xa22d('0x63'),_0xa22d('0x57'));emit(util[_0xa22d('0xe')](_0xa22d('0x68'),_0x1cf0f3[_0xa22d('0x45')]),_0xa22d('0x58'),{'uri':util[_0xa22d('0xe')](_0xa22d('0x59'),_0x4afadb[_0xa22d('0x19')][_0xa22d('0x5a')](_0xa22d('0x5b'),''),_0x5333b8['id'])});break;default:logger[_0xa22d('0x5c')]('[OUTBOUND]',_0xa22d('0x5d'));}}})['catch'](function(_0x5bce14){logger[_0xa22d('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xa22d('0x5f')](_0x5bce14,{'showHidden':!![],'depth':null}));});};exports[_0xa22d('0x69')]=function(_0x5d61c0,_0xbd0f16,_0x3e0b94,_0x5d452e,_0x18a3c3,_0x1c888d){var _0x3f056f,_0x494928;_0x1c888d[_0xa22d('0x19')]=intUtil[_0xa22d('0x49')](_0x1c888d[_0xa22d('0x19')]);_0x1c888d['serverUrl']=intUtil[_0xa22d('0x49')](_0x1c888d[_0xa22d('0x48')]);if(_0x18a3c3&&_0x18a3c3[_0xa22d('0x6a')]){logger[_0xa22d('0xc')]('['+_0xbd0f16['lastevent']['toUpperCase']()+']',_0xa22d('0x4b'));_0xbd0f16[_0xa22d('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c888d[_0xa22d('0x48')],_0xbd0f16[_0xa22d('0x4e')],md5(_0xbd0f16[_0xa22d('0x4e')]));}else{_0xbd0f16[_0xa22d('0x4c')]='';}headers[_0xa22d('0x6b')]=getAuth(_0x1c888d);return getUser(_0x1c888d)[_0xa22d('0x16')](function(_0x114337){_0x3f056f=_0x114337;logger[_0xa22d('0xc')](_0xa22d('0x50'),_0x3f056f['id']);return getEndUser(_0x1c888d,_0xbd0f16[_0xa22d('0x51')],_0xbd0f16['calleridnum']);})[_0xa22d('0x16')](function(_0x2d4238){_0x494928=_0x2d4238;logger[_0xa22d('0xc')]('The\x20Enduser\x20ID\x20is:',_0x494928['id']);return getTicket(_0x1c888d,_0x3f056f,_0x494928,_0x3e0b94,_0xbd0f16);})[_0xa22d('0x16')](function(_0x105195){if(_0x105195){logger[_0xa22d('0xc')](_0xa22d('0x53'),_0x105195['id']);}})[_0xa22d('0x6c')](function(_0x430806){logger[_0xa22d('0x5c')]('['+_0xbd0f16[_0xa22d('0x6d')][_0xa22d('0x6e')]()+']'+_0xa22d('0x6f'),util[_0xa22d('0x5f')](_0x430806,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9022=['Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','zendesk','defaults','redis','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','username','authType','%s/token:%s','token','Basic\x20%s','toString','base64','stringify','GET','map','forEach','string','type','nameField','customField','toLowerCase','content','includes','idField','custom_fields','push','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL'];(function(_0x3e9316,_0x2a51c3){var _0x2833a3=function(_0x327d6b){while(--_0x327d6b){_0x3e9316['push'](_0x3e9316['shift']());}};_0x2833a3(++_0x2a51c3);}(_0x9022,0xfe));var _0x2902=function(_0xbaf699,_0x4aa945){_0xbaf699=_0xbaf699-0x0;var _0x55a131=_0x9022[_0xbaf699];return _0x55a131;};'use strict';var _=require(_0x2902('0x0'));var rp=require(_0x2902('0x1'));var md5=require(_0x2902('0x2'));var util=require(_0x2902('0x3'));var Redis=require(_0x2902('0x4'));var intUtil=require(_0x2902('0x5'));var config=require('../../../../config/environment');var logger=require(_0x2902('0x6'))(_0x2902('0x7'));config['redis']=_[_0x2902('0x8')](config[_0x2902('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x2902('0xa'))(new Redis(config[_0x2902('0x9')]));function emit(_0x4faa4e,_0x111810,_0x50c0f4){io['to'](_0x4faa4e)[_0x2902('0xb')](_0x111810,_0x50c0f4);}var headers={'Content-Type':_0x2902('0xc'),'Accept':_0x2902('0xc')};function getTicket(_0xe0c181,_0xff768e,_0x14ac82,_0x36ae69,_0x2d3d83){logger['info'](_0x2902('0xd'));return request({'uri':util[_0x2902('0xe')](_0x2902('0xf'),_0xe0c181[_0x2902('0x10')]),'method':_0x2902('0x11'),'body':{'ticket':_[_0x2902('0x12')]({'requester_id':_0x14ac82['id'],'submitter_id':_0xff768e?_0xff768e['id']:undefined,'assignee_id':_0xff768e?_0xff768e['id']:undefined,'tags':getTags(_0x36ae69[_0x2902('0x13')],_0x2902('0x14')),'subject':intUtil[_0x2902('0x15')](_0x36ae69[_0x2902('0x16')],_0x2d3d83,'\x20'),'description':intUtil['getString'](_0x36ae69[_0x2902('0x17')],_0x2d3d83,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x36ae69[_0x2902('0x17')],_0x2d3d83,'\x0a')}},getCustomFields(_0x36ae69[_0x2902('0x18')],_0x2d3d83))}})[_0x2902('0x19')](function(_0x1188c7){logger[_0x2902('0x1a')](_0x2902('0x1b'));return _0x1188c7['ticket'];});}function getUser(_0x4b0a0d,_0x131448){if(intUtil['validateEmail'](_0x131448)){logger['info'](_0x2902('0x1c'),_0x131448);return request({'uri':util[_0x2902('0xe')]('%s/search.json',_0x4b0a0d[_0x2902('0x10')]),'qs':{'query':util['format'](_0x2902('0x1d'),_0x131448)}})[_0x2902('0x19')](function(_0xf7758f){if(_0xf7758f[_0x2902('0x1e')]){logger[_0x2902('0x1a')]('Agent\x20found!');return _[_0x2902('0x1f')](_0xf7758f[_0x2902('0x20')],{'email':_0x131448,'role':'agent'});}else{logger[_0x2902('0x1a')](_0x2902('0x21'));return request({'uri':util[_0x2902('0xe')](_0x2902('0x22'),_0x4b0a0d[_0x2902('0x10')])})['then'](function(_0x586756){logger[_0x2902('0x1a')]('Admin\x20account\x20selected.');return _0x586756[_0x2902('0x23')];});}});}else{logger[_0x2902('0x1a')](_0x2902('0x21'));return request({'uri':util[_0x2902('0xe')]('%s/users/me.json',_0x4b0a0d['remoteUri'])})[_0x2902('0x19')](function(_0x157080){logger[_0x2902('0x1a')](_0x2902('0x24'));return _0x157080['user'];});}}function getEndUser(_0x1e3ce5,_0x5a0666,_0x1c4711){logger[_0x2902('0x1a')]('Searching\x20enduser\x20with\x20phone',_0x1c4711);return request({'uri':util[_0x2902('0xe')](_0x2902('0x25'),_0x1e3ce5[_0x2902('0x10')]),'qs':{'query':util['format'](_0x2902('0x26'),_0x1c4711)}})[_0x2902('0x19')](function(_0x3ac384){var _0x29935c;if(_0x3ac384[_0x2902('0x20')]['length']){_0x3ac384[_0x2902('0x20')]=_[_0x2902('0x27')](_0x3ac384[_0x2902('0x20')],{'suspended':![],'role':_0x2902('0x28')});if(_0x3ac384[_0x2902('0x20')][_0x2902('0x29')]){_0x29935c=_['first'](_0x3ac384[_0x2902('0x20')]);}}if(_0x29935c){logger['info'](_0x2902('0x2a'));return _0x29935c;}else{logger['info'](_0x2902('0x2b'));return request({'uri':util['format'](_0x2902('0x2c'),_0x1e3ce5[_0x2902('0x10')]),'method':_0x2902('0x11'),'body':{'user':{'role':'end-user','name':util[_0x2902('0xe')](_0x2902('0x2d'),_0x5a0666||_0x1c4711),'phone':_0x1c4711}}})[_0x2902('0x19')](function(_0x12adca){logger[_0x2902('0x1a')](_0x2902('0x2e'));return _0x12adca['user'];});}});}function getAuth(_0x1e97b7){var _0x312929;if(_0x1e97b7['authType']===_0x2902('0x2f')){_0x312929=util[_0x2902('0xe')]('%s:%s',_0x1e97b7[_0x2902('0x30')],_0x1e97b7[_0x2902('0x2f')]);}else if(_0x1e97b7[_0x2902('0x31')]==='token'){_0x312929=util[_0x2902('0xe')](_0x2902('0x32'),_0x1e97b7[_0x2902('0x30')],_0x1e97b7[_0x2902('0x33')]);}return util[_0x2902('0xe')](_0x2902('0x34'),new Buffer(_0x312929)[_0x2902('0x35')](_0x2902('0x36')));}function request(_0x4238d8){logger['debug']('[HTTP]',JSON[_0x2902('0x37')](_0x4238d8));return rp(_[_0x2902('0x8')](_0x4238d8,{'method':_0x2902('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x12a37f,_0x5804b7){var _0x3e20bb=[];if(_0x12a37f&&_0x12a37f[_0x2902('0x29')]>0x0){_0x3e20bb=_[_0x2902('0x39')](_0x12a37f,_0x5804b7);}return _0x3e20bb;}function getCustomFields(_0x4f2a7d,_0x11f198){var _0x4e05ce=[];var _0x484224={'custom_fields':[]};if(_0x4f2a7d[_0x2902('0x29')]>0x0){_[_0x2902('0x3a')](_0x4f2a7d,function(_0x4de5d6){if(_['includes']([_0x2902('0x3b'),'picklist'],_0x4de5d6[_0x2902('0x3c')])&&_0x4de5d6[_0x2902('0x3d')]&&!_0x4de5d6[_0x2902('0x3e')]){_0x484224[_0x4de5d6[_0x2902('0x3d')][_0x2902('0x3f')]()]=_0x4de5d6[_0x2902('0x40')][_0x2902('0x35')]();}else if(_[_0x2902('0x41')]([_0x2902('0x3b'),'picklist'],_0x4de5d6[_0x2902('0x3c')])&&_0x4de5d6[_0x2902('0x42')]&&_0x4de5d6[_0x2902('0x3e')]){_0x484224[_0x2902('0x43')][_0x2902('0x44')]({'id':_0x4de5d6[_0x2902('0x42')],'value':_0x4de5d6['content'][_0x2902('0x35')]()});}else if(_0x4de5d6[_0x2902('0x3c')]==='variable'&&_0x4de5d6['variableName']&&_0x4de5d6[_0x2902('0x42')]&&_0x4de5d6[_0x2902('0x3e')]){_0x11f198[_0x4de5d6[_0x2902('0x45')]]&&_0x484224[_0x2902('0x43')][_0x2902('0x44')]({'id':_0x4de5d6[_0x2902('0x42')],'value':_0x11f198[_0x4de5d6[_0x2902('0x45')]][_0x2902('0x35')]()});}else if(_0x4de5d6[_0x2902('0x3c')]==='customVariable'&&_0x4de5d6[_0x2902('0x46')]&&_0x4de5d6[_0x2902('0x46')][_0x2902('0x14')]&&_0x4de5d6[_0x2902('0x42')]&&_0x4de5d6[_0x2902('0x3e')]){_0x11f198[_0x4de5d6[_0x2902('0x46')]['name'][_0x2902('0x3f')]()]&&_0x484224[_0x2902('0x43')][_0x2902('0x44')]({'id':_0x4de5d6[_0x2902('0x42')],'value':_0x11f198[_0x4de5d6[_0x2902('0x46')][_0x2902('0x14')][_0x2902('0x3f')]()][_0x2902('0x35')]()});}});}return _0x484224;}exports[_0x2902('0x47')]=function(_0x4c8a7e,_0x281da5,_0x4172e0,_0x182b8b,_0x1c55e5,_0x772fa6){var _0x28919c,_0x186ccb;_0x772fa6[_0x2902('0x10')]=intUtil['stripTrailingSlash'](_0x772fa6['remoteUri']);_0x772fa6[_0x2902('0x48')]=intUtil[_0x2902('0x49')](_0x772fa6[_0x2902('0x48')]);if(_0x1c55e5&&_0x1c55e5[_0x2902('0x4a')]){logger[_0x2902('0x1a')](_0x2902('0x4b'),_0x2902('0x4c'));_0x281da5['recordingURL']=util[_0x2902('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x772fa6[_0x2902('0x48')],_0x281da5['uniqueid'],md5(_0x281da5[_0x2902('0x4d')]));}else{_0x281da5[_0x2902('0x4e')]='';}headers[_0x2902('0x4f')]=getAuth(_0x772fa6);return getUser(_0x772fa6,_0x182b8b[_0x2902('0x50')])[_0x2902('0x19')](function(_0x248b46){_0x28919c=_0x248b46;logger[_0x2902('0x1a')](_0x2902('0x51'),_0x28919c['id']);return getEndUser(_0x772fa6,_0x281da5[_0x2902('0x52')],_0x281da5[_0x2902('0x53')]);})[_0x2902('0x19')](function(_0x4861c7){_0x186ccb=_0x4861c7;logger[_0x2902('0x1a')](_0x2902('0x54'),_0x186ccb['id']);return getTicket(_0x772fa6,_0x28919c,_0x186ccb,_0x4172e0,_0x281da5);})['then'](function(_0x1539a2){if(_0x1539a2){logger[_0x2902('0x1a')](_0x2902('0x55'),_0x1539a2['id']);switch(_0x772fa6[_0x2902('0x3c')]){case _0x2902('0x56'):logger['info'](_0x2902('0x4b'),_0x2902('0x57'));return request({'uri':util[_0x2902('0xe')](_0x2902('0x58'),_0x772fa6[_0x2902('0x10')],_0x28919c['id'],_0x1539a2['id']),'method':_0x2902('0x11')});case _0x2902('0x59'):logger[_0x2902('0x1a')](_0x2902('0x4b'),_0x2902('0x5a'));emit(util[_0x2902('0xe')]('user:%s',_0x182b8b[_0x2902('0x14')]),_0x2902('0x5b'),{'uri':util[_0x2902('0xe')](_0x2902('0x5c'),_0x772fa6[_0x2902('0x10')][_0x2902('0x5d')](_0x2902('0x5e'),''),_0x1539a2['id'])});break;default:logger[_0x2902('0x5f')](_0x2902('0x4b'),_0x2902('0x60'));}}})[_0x2902('0x61')](function(_0x2f79ab){logger['error'](_0x2902('0x62'),util[_0x2902('0x63')](_0x2f79ab,{'showHidden':!![],'depth':null}));});};exports[_0x2902('0x64')]=function(_0x2b2c6e,_0x568625,_0x1abc16,_0xcd352d,_0x34afbb,_0x9090ef,_0x344327){var _0x16728d,_0x2f901f;_0x9090ef[_0x2902('0x10')]=intUtil['stripTrailingSlash'](_0x9090ef[_0x2902('0x10')]);_0x9090ef[_0x2902('0x48')]=intUtil['stripTrailingSlash'](_0x9090ef[_0x2902('0x48')]);if(_0x344327&&_0x344327['recordingFormat']&&_0x344327['recordingFormat']!==_0x2902('0x65')){logger['info'](_0x2902('0x66'),_0x2902('0x4c'));_0x568625[_0x2902('0x4e')]=util[_0x2902('0xe')](_0x2902('0x67'),_0x9090ef['serverUrl'],_0x568625[_0x2902('0x4d')],md5(_0x568625[_0x2902('0x4d')]));}headers[_0x2902('0x4f')]=getAuth(_0x9090ef);return getUser(_0x9090ef,_0xcd352d['email'])[_0x2902('0x19')](function(_0xadfbf8){_0x16728d=_0xadfbf8;logger[_0x2902('0x1a')]('The\x20User\x20ID\x20is:',_0x16728d['id']);return getEndUser(_0x9090ef,_0x568625[_0x2902('0x68')],_0x568625['destcalleridnum']);})[_0x2902('0x19')](function(_0x11930b){_0x2f901f=_0x11930b;logger['info'](_0x2902('0x54'),_0x2f901f['id']);return getTicket(_0x9090ef,_0x16728d,_0x2f901f,_0x1abc16,_0x568625);})[_0x2902('0x19')](function(_0x2921e1){if(_0x2921e1){logger[_0x2902('0x1a')]('The\x20Ticket\x20ID\x20is:',_0x2921e1['id']);switch(_0x9090ef[_0x2902('0x3c')]){case _0x2902('0x56'):logger['info'](_0x2902('0x66'),_0x2902('0x57'));return request({'uri':util[_0x2902('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x9090ef[_0x2902('0x10')],_0x16728d['id'],_0x2921e1['id']),'method':'POST'});case _0x2902('0x59'):logger[_0x2902('0x1a')](_0x2902('0x66'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2902('0xe')](_0x2902('0x69'),_0xcd352d[_0x2902('0x14')]),_0x2902('0x5b'),{'uri':util[_0x2902('0xe')](_0x2902('0x5c'),_0x9090ef[_0x2902('0x10')]['replace'](_0x2902('0x5e'),''),_0x2921e1['id'])});break;default:logger[_0x2902('0x5f')](_0x2902('0x66'),_0x2902('0x60'));}}})[_0x2902('0x61')](function(_0x5a6825){logger[_0x2902('0x5f')](_0x2902('0x6a'),util[_0x2902('0x63')](_0x5a6825,{'showHidden':!![],'depth':null}));});};exports[_0x2902('0x6b')]=function(_0x3c09ee,_0xae52ac,_0x40d27a,_0x1f90be,_0x5434e3,_0x5cea9b){var _0x1fb956,_0x46176b;_0x5cea9b['remoteUri']=intUtil[_0x2902('0x49')](_0x5cea9b['remoteUri']);_0x5cea9b[_0x2902('0x48')]=intUtil[_0x2902('0x49')](_0x5cea9b[_0x2902('0x48')]);if(_0x5434e3&&_0x5434e3[_0x2902('0x4a')]){logger[_0x2902('0x1a')]('['+_0xae52ac[_0x2902('0x6c')][_0x2902('0x6d')]()+']',_0x2902('0x4c'));_0xae52ac[_0x2902('0x4e')]=util[_0x2902('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5cea9b[_0x2902('0x48')],_0xae52ac[_0x2902('0x4d')],md5(_0xae52ac[_0x2902('0x4d')]));}else{_0xae52ac[_0x2902('0x4e')]='';}headers[_0x2902('0x4f')]=getAuth(_0x5cea9b);return getUser(_0x5cea9b)['then'](function(_0xaf4df1){_0x1fb956=_0xaf4df1;logger[_0x2902('0x1a')]('The\x20User\x20ID\x20is:',_0x1fb956['id']);return getEndUser(_0x5cea9b,_0xae52ac[_0x2902('0x52')],_0xae52ac[_0x2902('0x53')]);})[_0x2902('0x19')](function(_0x402854){_0x46176b=_0x402854;logger[_0x2902('0x1a')](_0x2902('0x54'),_0x46176b['id']);return getTicket(_0x5cea9b,_0x1fb956,_0x46176b,_0x40d27a,_0xae52ac);})[_0x2902('0x19')](function(_0x5e9176){if(_0x5e9176){logger[_0x2902('0x1a')](_0x2902('0x55'),_0x5e9176['id']);}})[_0x2902('0x61')](function(_0x13ada3){logger['error']('['+_0xae52ac[_0x2902('0x6c')][_0x2902('0x6d')]()+']'+_0x2902('0x6e'),util[_0x2902('0x63')](_0x13ada3,{'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 e7e7c28..35c7888 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 _0x62ee=['toUpperCase','calleridname','lodash','request-promise','md5','util','moment','ioredis','bluebird','zoho','redis','localhost','emit','debug','length','forEach','string','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','refreshToken','clientId','clientSecret','refresh_token','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','details','Error:\x20','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','Contacts','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','mm:ss','answertime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','POST','/crm/v2/Calls','code','SUCCESS','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','zoho.eu','com','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','unmanaged'];(function(_0x37bcdd,_0x4fea5c){var _0x4d32de=function(_0x5064cc){while(--_0x5064cc){_0x37bcdd['push'](_0x37bcdd['shift']());}};_0x4d32de(++_0x4fea5c);}(_0x62ee,0x13a));var _0xe62e=function(_0x642029,_0xb900a){_0x642029=_0x642029-0x0;var _0x22596f=_0x62ee[_0x642029];return _0x22596f;};'use strict';var _=require(_0xe62e('0x0'));var rp=require(_0xe62e('0x1'));var md5=require(_0xe62e('0x2'));var util=require(_0xe62e('0x3'));var intUtil=require('./util');var moment=require(_0xe62e('0x4'));var Redis=require(_0xe62e('0x5'));var BPromise=require(_0xe62e('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xe62e('0x7'));config[_0xe62e('0x8')]=_['defaults'](config[_0xe62e('0x8')],{'host':_0xe62e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe62e('0x8')]));function emit(_0x3fb05a,_0x2b9560,_0x2bda18){io['to'](_0x3fb05a)[_0xe62e('0xa')](_0x2b9560,_0x2bda18);}function request(_0x541d18){logger[_0xe62e('0xb')]('[HTTP]',JSON['stringify'](_0x541d18));return rp(_0x541d18);}function getCustomFields(_0x3f554c,_0x356f4a){var _0x453d5={};if(_0x3f554c[_0xe62e('0xc')]>0x0){_[_0xe62e('0xd')](_0x3f554c,function(_0x2d59dd){if(_['includes']([_0xe62e('0xe'),_0xe62e('0xf')],_0x2d59dd[_0xe62e('0x10')])&&_0x2d59dd[_0xe62e('0x11')]){_0x453d5[_0x2d59dd[_0xe62e('0x11')]]=_0x2d59dd[_0xe62e('0x12')]['toString']();}else if(_0x2d59dd['type']===_0xe62e('0x13')&&_0x2d59dd['variableName']&&_0x2d59dd[_0xe62e('0x11')]&&_0x356f4a[_0x2d59dd['variableName']]){_0x453d5[_0x2d59dd[_0xe62e('0x11')]]=_0x356f4a[_0x2d59dd[_0xe62e('0x14')]][_0xe62e('0x15')]();}else if(_0x2d59dd[_0xe62e('0x10')]===_0xe62e('0x16')&&_0x2d59dd[_0xe62e('0x17')]&&_0x2d59dd[_0xe62e('0x17')][_0xe62e('0x18')]&&_0x2d59dd[_0xe62e('0x11')]&&_0x356f4a[_0x2d59dd[_0xe62e('0x17')][_0xe62e('0x18')][_0xe62e('0x19')]()]){_0x453d5[_0x2d59dd[_0xe62e('0x11')]]=_0x356f4a[_0x2d59dd[_0xe62e('0x17')][_0xe62e('0x18')][_0xe62e('0x19')]()]['toString']();}});}return _0x453d5;}function getName(_0x2382d5){if(_0x2382d5[_0xe62e('0x1a')]('\x20')>0x0){var _0x14cd44=_0x2382d5[_0xe62e('0x1b')](/ (.+)/);if(_0x14cd44[0x1]){return _0x14cd44;}}return[_0x2382d5,_0x2382d5];}var accountsTokens={};function getAccessToken(_0x19231e){return new Promise(function(_0x4fbcf8,_0x14f4a5){if(!_['isNil'](accountsTokens[_0x19231e['id']])&&!_[_0xe62e('0x1c')](accountsTokens[_0x19231e['id']][_0xe62e('0x1d')])){if(moment()[_0xe62e('0x1e')](accountsTokens[_0x19231e['id']]['expires_in'])){_0x4fbcf8(accountsTokens[_0x19231e['id']]['access_token']);}}var _0x295159;switch(_0x19231e['zone']){case'US':_0x295159=_0xe62e('0x1f');break;case'AU':_0x295159=_0xe62e('0x20');break;case'EU':_0x295159=_0xe62e('0x21');break;case'IN':_0x295159=_0xe62e('0x22');break;case'CN':_0x295159='https://accounts.zoho.com.cn';break;default:_0x295159=_0xe62e('0x21');break;}var _0x4c8e32={'method':'POST','uri':_0x295159+'/oauth/v2/token','qs':{'refresh_token':_0x19231e[_0xe62e('0x23')],'client_id':_0x19231e[_0xe62e('0x24')],'client_secret':_0x19231e[_0xe62e('0x25')],'grant_type':_0xe62e('0x26')},'json':!![]};return rp(_0x4c8e32)['then'](function(_0x3785a8){accountsTokens[_0x19231e['id']]={'access_token':_0x3785a8[_0xe62e('0x1d')],'expires_in':moment()[_0xe62e('0x27')](_0x3785a8[_0xe62e('0x28')],_0xe62e('0x29'))};_0x4fbcf8(_0x3785a8[_0xe62e('0x1d')]);})[_0xe62e('0x2a')](function(_0xf0fbfb){logger[_0xe62e('0x2b')](_0xe62e('0x2c'),_0xf0fbfb[_0xe62e('0x2d')]);_0x14f4a5(_0xf0fbfb);});});}function getUser(_0x49ae63,_0x179187,_0x498c54,_0x29d1f9){logger['info'](_0xe62e('0x2e'));return request({'method':'GET','uri':util[_0xe62e('0x2f')](_0xe62e('0x30'),_0x179187),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xe62e('0x31')+_0x49ae63},'json':!![]})[_0xe62e('0x32')](function(_0x40b66c){if(_0x40b66c[_0xe62e('0x33')]){var _0x14b7a7=-0x1;if(_[_0xe62e('0x34')](_0x40b66c[_0xe62e('0x33')])){if(!_[_0xe62e('0x1c')](_0x29d1f9)){_0x14b7a7=_[_0xe62e('0x35')](_0x40b66c[_0xe62e('0x33')],function(_0x480a26){return _0x480a26[_0xe62e('0x36')]===_0x29d1f9;});}if(_0x14b7a7>=0x0){logger[_0xe62e('0x37')](_0xe62e('0x38'));}else{logger[_0xe62e('0x37')](_0xe62e('0x39'));_0x14b7a7=_[_0xe62e('0x35')](_0x40b66c[_0xe62e('0x33')],function(_0x3c0f5d){return _0x3c0f5d[_0xe62e('0x3a')][_0xe62e('0x18')]===_0xe62e('0x3b');});}return _0x40b66c[_0xe62e('0x33')][_0x14b7a7];}else{if(_0x40b66c[_0xe62e('0x3c')][_0xe62e('0x3a')][_0xe62e('0x18')]==='Administrator'){logger[_0xe62e('0x37')](_0xe62e('0x39'));user=_0x40b66c[_0xe62e('0x3c')];return user;}else{logger['error'](_0xe62e('0x3d'),JSON[_0xe62e('0x3e')](_0x40b66c));throw new Error(_0xe62e('0x3f')+JSON[_0xe62e('0x3e')](_0x40b66c));}}}else{logger[_0xe62e('0x2b')]('The\x20failing\x20result\x20is',JSON[_0xe62e('0x3e')](_0x40b66c));throw new Error(_0xe62e('0x3f')+JSON[_0xe62e('0x3e')](_0x40b66c));}})[_0xe62e('0x2a')](function(_0x3b6c16){console[_0xe62e('0x2b')](_0x3b6c16);});}function getZohoUser(_0x23bea8,_0x2682af){return new BPromise(function(_0x367a5e,_0x289d6f){request(_0x23bea8)[_0xe62e('0x32')](function(_0xa898fe){var _0x5179bc=null;if(_0xa898fe){_0x5179bc=_0xa898fe[_0xe62e('0x40')][0x0];_0x5179bc[_0xe62e('0x41')]=_0x2682af;}_0x367a5e(_0x5179bc);})[_0xe62e('0x2a')](function(_0x310251){_0x289d6f(_0x310251);});});}function createEndUser(_0x116a6a,_0x2844bf,_0x57a506,_0x900988,_0x4d2d18,_0x5e8e10){var _0x57a506=getName(_0x57a506);return request({'method':'POST','uri':_0xe62e('0x42')+_0x2844bf+_0xe62e('0x43')+_[_0xe62e('0x44')](_0x5e8e10[_0xe62e('0x45')])+'s','body':{'data':[{'Last_Name':_0x57a506[0x1],'First_Name':_0x57a506[0x0],'Phone':_0x900988,'Owner':{'name':!_[_0xe62e('0x1c')](_0x4d2d18[_0xe62e('0x46')][_0xe62e('0x18')])?_0x4d2d18['role'][_0xe62e('0x18')]:!_[_0xe62e('0x1c')](_0x4d2d18['first_name'])?_0x4d2d18[_0xe62e('0x47')]+'\x20'+_0x4d2d18[_0xe62e('0x48')]:_0x4d2d18[_0xe62e('0x48')],'id':_0x4d2d18['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x116a6a},'json':!![]})[_0xe62e('0x32')](function(_0x4623b8){if(_0x4623b8&&_0x4623b8['data'][0x0]['code']==='SUCCESS'){var _0x3fdb50=_0x4623b8[_0xe62e('0x40')][0x0][_0xe62e('0x49')];_0x3fdb50[_0xe62e('0x41')]=_[_0xe62e('0x44')](_0x5e8e10['moduleCreate'])+'s';return _0x3fdb50;}logger['error'](_0xe62e('0x3d'),JSON['stringify'](data));throw new Error(_0xe62e('0x4a')+JSON[_0xe62e('0x3e')](data));})[_0xe62e('0x2a')](function(_0x32368e){console['log'](_0xe62e('0x4b'),_0x32368e);});}function getEndUser(_0x429ef6,_0x3b346c,_0x15d0e2,_0x4df44a,_0xdc0b74,_0x4a1d03,_0x315b99){var _0x59b54d={'method':_0xe62e('0x4c'),'uri':'','headers':{'Authorization':_0xe62e('0x31')+_0x429ef6},'json':!![]};switch(_0x315b99[_0xe62e('0x4d')]){case _0xe62e('0x4e'):_0x59b54d[_0xe62e('0x4f')]=_0xe62e('0x42')+_0x3b346c+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xdc0b74+'))';return getZohoUser(_0x59b54d,_0xe62e('0x50'))[_0xe62e('0x32')](function(_0x5b18fd){if(_0x5b18fd)return _0x5b18fd;_0x59b54d[_0xe62e('0x4f')]=_0xe62e('0x42')+_0x3b346c+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xdc0b74+'))';return getZohoUser(_0x59b54d,_0xe62e('0x51'))[_0xe62e('0x32')](function(_0x3a08b0){if(_0x3a08b0)return _0x3a08b0;if(_0x315b99['moduleCreate']!=_0xe62e('0x52')){return createEndUser(_0x429ef6,_0x3b346c,_0x4df44a,_0xdc0b74,_0x4a1d03,_0x315b99);}else{return{};}});});break;case'contact':_0x59b54d['uri']=_0xe62e('0x42')+_0x3b346c+_0xe62e('0x53')+_0xdc0b74+'))';return getZohoUser(_0x59b54d,_0xe62e('0x50'))[_0xe62e('0x32')](function(_0x12e36f){if(_0x12e36f)return _0x12e36f;if(_0x315b99[_0xe62e('0x45')]!=_0xe62e('0x52')){return createEndUser(_0x429ef6,_0x3b346c,_0x4df44a,_0xdc0b74,_0x4a1d03,_0x315b99);}else{return{};}});break;case _0xe62e('0x54'):_0x59b54d['uri']='https://www.zohoapis.'+_0x3b346c+_0xe62e('0x55')+_0xdc0b74+'))';return getZohoUser(_0x59b54d,_0xe62e('0x51'))[_0xe62e('0x32')](function(_0x5bdf13){if(_0x5bdf13)return _0x5bdf13;if(_0x315b99[_0xe62e('0x45')]!='nothing'){return createEndUser(_0x429ef6,_0x3b346c,_0x4df44a,_0xdc0b74,_0x4a1d03,_0x315b99);}else{return{};}});break;}}function getCall(_0x19f9ce,_0x506c2b,_0x49ce20,_0x118ae7,_0x309645,_0xdeed53,_0x83bc2,_0x112853){logger[_0xe62e('0x37')](_0xe62e('0x56'));var _0x6250f3={};_0x6250f3[_0xe62e('0x57')]={'name':!_[_0xe62e('0x1c')](_0x118ae7[_0xe62e('0x46')][_0xe62e('0x18')])&&!_['isNil'](_0x118ae7[_0xe62e('0x3a')]['name'])&&_0x118ae7[_0xe62e('0x3a')][_0xe62e('0x18')]==='administrator'?_0x118ae7[_0xe62e('0x46')]['name']:!_[_0xe62e('0x1c')](_0x118ae7[_0xe62e('0x47')])?_0x118ae7[_0xe62e('0x47')]+'\x20'+_0x118ae7['last_name']:_0x118ae7['last_name'],'id':_0x118ae7['id']};_0x6250f3['Subject']=intUtil[_0xe62e('0x58')](_0xdeed53['Subjects'],_0x83bc2,'\x20');_0x6250f3[_0xe62e('0x59')]=intUtil['getString'](_0xdeed53[_0xe62e('0x5a')],_0x83bc2,'\x0a');if(_0x309645[_0xe62e('0x41')]==='Contacts'){_0x6250f3[_0xe62e('0x5b')]={'name':!_[_0xe62e('0x1c')](_0x309645[_0xe62e('0x5c')])?_0x309645['Full_Name']:!_[_0xe62e('0x1c')](_0x309645[_0xe62e('0x5d')])?_0x309645[_0xe62e('0x5d')]+'\x20'+_0x309645['Last_Name']:_0x309645[_0xe62e('0x5e')],'id':_0x309645['id']};}if(_0x309645[_0xe62e('0x41')]==='Leads'){_0x6250f3['What_Id']={'name':!_[_0xe62e('0x1c')](_0x309645[_0xe62e('0x5c')])?_0x309645[_0xe62e('0x5c')]:!_[_0xe62e('0x1c')](_0x309645[_0xe62e('0x5d')])?_0x309645[_0xe62e('0x5d')]+'\x20'+_0x309645['Last_Name']:_0x309645[_0xe62e('0x5e')],'id':_0x309645['id']};_0x6250f3[_0xe62e('0x5f')]=_[_0xe62e('0x44')](_0x309645[_0xe62e('0x41')]);}if(_0x83bc2[_0xe62e('0x60')]){_0x6250f3[_0xe62e('0x61')]=moment['utc'](parseInt(_0x83bc2['talktime'])*0x3e8)[_0xe62e('0x2f')](_0xe62e('0x62'));}else if(_0x83bc2[_0xe62e('0x63')]&&_0x83bc2['endtime']){_0x6250f3[_0xe62e('0x61')]=moment[_0xe62e('0x64')](moment(_0x83bc2['endtime'],_0xe62e('0x65'))[_0xe62e('0x66')](moment(_0x83bc2[_0xe62e('0x67')],'YYYY-MM-DDTHH:mm:ss')))[_0xe62e('0x2f')](_0xe62e('0x62'));}switch(_0x83bc2[_0xe62e('0x68')]){case _0xe62e('0x69'):_0x6250f3['Call_Result']='Called';break;case'complete':case _0xe62e('0x6a'):_0x6250f3[_0xe62e('0x6b')]=_0xe62e('0x6c');break;case _0xe62e('0x6d'):_0x6250f3[_0xe62e('0x6b')]=_0xe62e('0x6e');break;case _0xe62e('0x6f'):_0x6250f3[_0xe62e('0x6b')]=_0xe62e('0x70');break;case _0xe62e('0x71'):_0x6250f3[_0xe62e('0x6b')]=_0xe62e('0x72');default:}_0x6250f3[_0xe62e('0x73')]=(_0x112853==='outbound'?moment(_0x83bc2[_0xe62e('0x67')])['format'](_0xe62e('0x65')):moment(_0x83bc2[_0xe62e('0x74')])['format'](_0xe62e('0x65')))||moment()[_0xe62e('0x2f')](_0xe62e('0x65'));_0x6250f3[_0xe62e('0x75')]=_0x112853||_0xe62e('0x76');_0x6250f3=_['merge'](_0x6250f3,getCustomFields(_0xdeed53['Fields'],_0x83bc2));return request({'method':_0xe62e('0x77'),'uri':_0xe62e('0x42')+_0x506c2b+_0xe62e('0x78'),'headers':{'Authorization':_0xe62e('0x31')+_0x19f9ce},'body':{'data':[_0x6250f3]},'json':!![]})['then'](function(_0x41f2d2){if(_0x41f2d2&&_0x41f2d2['data'][0x0][_0xe62e('0x79')]===_0xe62e('0x7a')){logger[_0xe62e('0x37')](_0xe62e('0x7b'));return{'id':_0x41f2d2['data'][0x0][_0xe62e('0x49')]['id']};}})[_0xe62e('0x2a')](function(_0x2d3b07){logger['info'](_0xe62e('0x7c'),_0x2d3b07['stack']);console[_0xe62e('0x7d')](_0xe62e('0x7c'),_0x2d3b07);});}exports[_0xe62e('0x7e')]=function(_0x4ac9a9,_0xf0a634,_0x556b98,_0xa221aa,_0x1bb4af,_0x1f2471){var _0x169ee8,_0x49c051,_0x46a4ce;_0x1f2471[_0xe62e('0x7f')]=intUtil[_0xe62e('0x80')](_0x1f2471[_0xe62e('0x7f')]);_0x1f2471[_0xe62e('0x81')]=intUtil[_0xe62e('0x80')](_0x1f2471[_0xe62e('0x81')]);if(_0x1bb4af&&_0x1bb4af[_0xe62e('0x82')]){logger['info'](_0xe62e('0x83'),_0xe62e('0x84'));_0xf0a634['recordingURL']=_0x1f2471[_0xe62e('0x81')]+'/api/voice/recordings/'+_0xf0a634[_0xe62e('0x85')]+'/downloads?type=uniqueid&token='+md5(_0xf0a634[_0xe62e('0x85')]);}else{_0xf0a634['recordingURL']='';}var _0x5253fc=_0x1f2471['host']===_0xe62e('0x86')?'eu':_0xe62e('0x87');return getAccessToken(_0x1f2471)[_0xe62e('0x32')](function(_0x58de68){_0x46a4ce=_0x58de68;return getUser(_0x46a4ce,_0x5253fc,_0x1f2471,_0xa221aa['email']);})['then'](function(_0x73b7b0){_0x169ee8=_0x73b7b0;logger[_0xe62e('0x37')]('The\x20User\x20ID\x20is:',_0x169ee8['id']);return getEndUser(_0x46a4ce,_0x5253fc,_0x1f2471,_0xf0a634['calleridname'],_0xf0a634[_0xe62e('0x88')],_0x169ee8,_0x556b98);})[_0xe62e('0x32')](function(_0x453606){_0x49c051=_0x453606;return getCall(_0x46a4ce,_0x5253fc,_0x1f2471,_0x169ee8,_0x49c051,_0x556b98,_0xf0a634,'Inbound');})['then'](function(_0x240008){if(_0x240008){logger[_0xe62e('0x37')](_0xe62e('0x89'),_0x240008['id']);logger['info']('[QUEUE]',_0xe62e('0x8a'));emit(util['format'](_0xe62e('0x8b'),_0xa221aa[_0xe62e('0x18')]),_0xe62e('0x8c'),{'uri':_0xe62e('0x8d')+_0x1f2471[_0xe62e('0x7f')]+_0xe62e('0x8e')+_0x240008['id']});}})[_0xe62e('0x2a')](function(_0x1b00ae){logger[_0xe62e('0x2b')](_0xe62e('0x83'),JSON[_0xe62e('0x3e')](_0x1b00ae));});};exports['outbound']=function(_0xa3b6ce,_0x53cd44,_0x4251a4,_0x46590a,_0x36928f,_0x14e2c1,_0x36c51d){var _0x3ec6ac,_0x15781e,_0x1a67a4;_0x14e2c1[_0xe62e('0x7f')]=intUtil[_0xe62e('0x80')](_0x14e2c1[_0xe62e('0x7f')]);_0x14e2c1['serverUrl']=intUtil[_0xe62e('0x80')](_0x14e2c1[_0xe62e('0x81')]);if(_0x36c51d&&_0x36c51d[_0xe62e('0x8f')]&&_0x36c51d['recordingFormat']!==_0xe62e('0x90')){logger['info'](_0xe62e('0x91'),'Recording\x20is\x20enabled!');_0x53cd44[_0xe62e('0x92')]=_0x14e2c1['serverUrl']+_0xe62e('0x93')+_0x53cd44[_0xe62e('0x85')]+_0xe62e('0x94')+md5(_0x53cd44[_0xe62e('0x85')]);}var _0x1a4ae5=_0x14e2c1['host']===_0xe62e('0x86')?'eu':_0xe62e('0x87');return getAccessToken(_0x14e2c1)[_0xe62e('0x32')](function(_0x1c2c37){_0x1a67a4=_0x1c2c37;return getUser(_0x1a67a4,_0x1a4ae5,_0x14e2c1,_0x46590a[_0xe62e('0x36')]);})['then'](function(_0x10542f){_0x3ec6ac=_0x10542f;logger['info'](_0xe62e('0x95'),_0x3ec6ac['id']);return getEndUser(_0x1a67a4,_0x1a4ae5,_0x14e2c1,_0x53cd44[_0xe62e('0x96')],_0x53cd44[_0xe62e('0x97')],_0x3ec6ac,_0x4251a4);})[_0xe62e('0x32')](function(_0x2ce90e){_0x15781e=_0x2ce90e;return getCall(_0x1a67a4,_0x1a4ae5,_0x14e2c1,_0x3ec6ac,_0x15781e,_0x4251a4,_0x53cd44,_0xe62e('0x98'));})[_0xe62e('0x32')](function(_0x187271){if(_0x187271){logger[_0xe62e('0x37')](_0xe62e('0x89'),_0x187271['id']);logger[_0xe62e('0x37')](_0xe62e('0x91'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe62e('0x2f')]('user:%s',_0x46590a[_0xe62e('0x18')]),_0xe62e('0x8c'),{'uri':_0xe62e('0x8d')+_0x14e2c1[_0xe62e('0x7f')]+_0xe62e('0x8e')+_0x187271['id']});}})[_0xe62e('0x2a')](function(_0x297de0){logger[_0xe62e('0x2b')](_0xe62e('0x91'),JSON[_0xe62e('0x3e')](_0x297de0));});};exports[_0xe62e('0x99')]=function(_0x46f6cb,_0x3c25bb,_0x4c7c36,_0x1cb456,_0x4e7374,_0x1bb8e2){var _0x4c9c1f,_0xfac024,_0x3eb4d1;_0x1bb8e2[_0xe62e('0x7f')]=intUtil[_0xe62e('0x80')](_0x1bb8e2[_0xe62e('0x7f')]);_0x1bb8e2['serverUrl']=intUtil[_0xe62e('0x80')](_0x1bb8e2[_0xe62e('0x81')]);if(_0x4e7374&&_0x4e7374[_0xe62e('0x82')]){logger[_0xe62e('0x37')]('['+_0x3c25bb[_0xe62e('0x68')][_0xe62e('0x9a')]()+']',_0xe62e('0x84'));_0x3c25bb[_0xe62e('0x92')]=_0x1bb8e2['serverUrl']+_0xe62e('0x93')+_0x3c25bb[_0xe62e('0x85')]+_0xe62e('0x94')+md5(_0x3c25bb[_0xe62e('0x85')]);}else{_0x3c25bb['recordingURL']='';}var _0x19a172=_0x1bb8e2[_0xe62e('0x7f')]==='zoho.eu'?'eu':_0xe62e('0x87');return getAccessToken(_0x1bb8e2)[_0xe62e('0x32')](function(_0x550699){_0x3eb4d1=_0x550699;return getUser(_0x3eb4d1,_0x19a172,_0x1bb8e2);})['then'](function(_0xbae9e3){_0x4c9c1f=_0xbae9e3;logger['info'](_0xe62e('0x95'),_0x4c9c1f['id']);return getEndUser(_0x3eb4d1,_0x19a172,_0x1bb8e2,_0x3c25bb[_0xe62e('0x9b')],_0x3c25bb[_0xe62e('0x88')],_0x4c9c1f,_0x4c7c36);})[_0xe62e('0x32')](function(_0x3b0860){_0xfac024=_0x3b0860;return getCall(_0x3eb4d1,_0x19a172,_0x1bb8e2,_0x4c9c1f,_0xfac024,_0x4c7c36,_0x3c25bb,_0xe62e('0x76'));})[_0xe62e('0x32')](function(_0x4c998d){if(_0x4c998d){logger[_0xe62e('0x37')](_0xe62e('0x89'),_0x4c998d['id']);}})[_0xe62e('0x2a')](function(_0x42e472){logger[_0xe62e('0x2b')]('['+_0x3c25bb[_0xe62e('0x68')][_0xe62e('0x9a')]()+']',JSON[_0xe62e('0x3e')](_0x42e472));});}; \ No newline at end of file +var _0x46b3=['error','Failing\x20creating\x20the\x20access_token','stack','ActiveUsers','then','users','isArrayLikeObject','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','role','first_name','code','SUCCESS','details','moduleCreate','Error:\x20','log','Zoho-oauthtoken\x20','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Leads','Creating\x20new\x20call...','Owner','administrator','last_name','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','format','mm:ss','answertime','endtime','Call_Duration','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','merge','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','/downloads?type=uniqueid&token=','calleridnum','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','type','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','expires_in','catch'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x46b3,0x194));var _0x346b=function(_0x3e622d,_0x2a8d3c){_0x3e622d=_0x3e622d-0x0;var _0x9fa129=_0x46b3[_0x3e622d];return _0x9fa129;};'use strict';var _=require(_0x346b('0x0'));var rp=require(_0x346b('0x1'));var md5=require(_0x346b('0x2'));var util=require(_0x346b('0x3'));var intUtil=require(_0x346b('0x4'));var moment=require('moment');var Redis=require(_0x346b('0x5'));var BPromise=require(_0x346b('0x6'));var config=require(_0x346b('0x7'));var logger=require(_0x346b('0x8'))(_0x346b('0x9'));config['redis']=_[_0x346b('0xa')](config[_0x346b('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x346b('0xc'))(new Redis(config[_0x346b('0xb')]));function emit(_0x527854,_0x375833,_0x8d430){io['to'](_0x527854)[_0x346b('0xd')](_0x375833,_0x8d430);}function request(_0x447beb){logger[_0x346b('0xe')](_0x346b('0xf'),JSON[_0x346b('0x10')](_0x447beb));return rp(_0x447beb);}function getCustomFields(_0x37920c,_0x378423){var _0x4c6372={};if(_0x37920c[_0x346b('0x11')]>0x0){_[_0x346b('0x12')](_0x37920c,function(_0x552eec){if(_[_0x346b('0x13')]([_0x346b('0x14'),'picklist'],_0x552eec[_0x346b('0x15')])&&_0x552eec[_0x346b('0x16')]){_0x4c6372[_0x552eec['idField']]=_0x552eec['content'][_0x346b('0x17')]();}else if(_0x552eec[_0x346b('0x15')]===_0x346b('0x18')&&_0x552eec[_0x346b('0x19')]&&_0x552eec[_0x346b('0x16')]&&_0x378423[_0x552eec[_0x346b('0x19')]]){_0x4c6372[_0x552eec[_0x346b('0x16')]]=_0x378423[_0x552eec[_0x346b('0x19')]][_0x346b('0x17')]();}else if(_0x552eec[_0x346b('0x15')]==='customVariable'&&_0x552eec[_0x346b('0x1a')]&&_0x552eec['Variable'][_0x346b('0x1b')]&&_0x552eec[_0x346b('0x16')]&&_0x378423[_0x552eec[_0x346b('0x1a')]['name']['toLowerCase']()]){_0x4c6372[_0x552eec[_0x346b('0x16')]]=_0x378423[_0x552eec['Variable'][_0x346b('0x1b')][_0x346b('0x1c')]()][_0x346b('0x17')]();}});}return _0x4c6372;}function getName(_0x2e26c1){if(_0x2e26c1[_0x346b('0x1d')]('\x20')>0x0){var _0x3db379=_0x2e26c1['split'](/ (.+)/);if(_0x3db379[0x1]){return _0x3db379;}}return[_0x2e26c1,_0x2e26c1];}var accountsTokens={};function getAccessToken(_0x1e2647){return new Promise(function(_0x261734,_0x47d8ab){if(!_['isNil'](accountsTokens[_0x1e2647['id']])&&!_[_0x346b('0x1e')](accountsTokens[_0x1e2647['id']][_0x346b('0x1f')])){if(moment()[_0x346b('0x20')](accountsTokens[_0x1e2647['id']]['expires_in'])){_0x261734(accountsTokens[_0x1e2647['id']][_0x346b('0x1f')]);}}var _0x369096;switch(_0x1e2647[_0x346b('0x21')]){case'US':_0x369096='https://accounts.zoho.com';break;case'AU':_0x369096=_0x346b('0x22');break;case'EU':_0x369096='https://accounts.zoho.eu';break;case'IN':_0x369096=_0x346b('0x23');break;case'CN':_0x369096='https://accounts.zoho.com.cn';break;default:_0x369096=_0x346b('0x24');break;}var _0x1ddc11={'method':_0x346b('0x25'),'uri':_0x369096+_0x346b('0x26'),'qs':{'refresh_token':_0x1e2647['refreshToken'],'client_id':_0x1e2647[_0x346b('0x27')],'client_secret':_0x1e2647[_0x346b('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1ddc11)['then'](function(_0xbcdb3c){accountsTokens[_0x1e2647['id']]={'access_token':_0xbcdb3c[_0x346b('0x1f')],'expires_in':moment()['add'](_0xbcdb3c[_0x346b('0x29')],'seconds')};_0x261734(_0xbcdb3c[_0x346b('0x1f')]);})[_0x346b('0x2a')](function(_0xbf158){logger[_0x346b('0x2b')](_0x346b('0x2c'),_0xbf158[_0x346b('0x2d')]);_0x47d8ab(_0xbf158);});});}function getUser(_0x5d19e2,_0x1d6ba1,_0x18ab90,_0x30aea4){logger['info']('Search\x20user');return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x1d6ba1),'qs':{'type':_0x346b('0x2e')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5d19e2},'json':!![]})[_0x346b('0x2f')](function(_0x2043e5){if(_0x2043e5[_0x346b('0x30')]){var _0x3b81b7=-0x1;if(_[_0x346b('0x31')](_0x2043e5[_0x346b('0x30')])){if(!_[_0x346b('0x1e')](_0x30aea4)){_0x3b81b7=_['findIndex'](_0x2043e5['users'],function(_0xbe772f){return _0xbe772f[_0x346b('0x32')]===_0x30aea4;});}if(_0x3b81b7>=0x0){logger[_0x346b('0x33')](_0x346b('0x34'));}else{logger['info'](_0x346b('0x35'));_0x3b81b7=_[_0x346b('0x36')](_0x2043e5['users'],function(_0x462dac){return _0x462dac[_0x346b('0x37')][_0x346b('0x1b')]==='Administrator';});}return _0x2043e5[_0x346b('0x30')][_0x3b81b7];}else{if(_0x2043e5['user'][_0x346b('0x37')][_0x346b('0x1b')]===_0x346b('0x38')){logger[_0x346b('0x33')](_0x346b('0x35'));user=_0x2043e5[_0x346b('0x39')];return user;}else{logger[_0x346b('0x2b')](_0x346b('0x3a'),JSON['stringify'](_0x2043e5));throw new Error(_0x346b('0x3b')+JSON['stringify'](_0x2043e5));}}}else{logger[_0x346b('0x2b')](_0x346b('0x3a'),JSON[_0x346b('0x10')](_0x2043e5));throw new Error(_0x346b('0x3b')+JSON[_0x346b('0x10')](_0x2043e5));}})[_0x346b('0x2a')](function(_0x51db43){console[_0x346b('0x2b')](_0x51db43);});}function getZohoUser(_0x7c9aaf,_0x3f7be1){return new BPromise(function(_0x53e5de,_0x1fcb31){request(_0x7c9aaf)['then'](function(_0x5e82f5){var _0x1470e4=null;if(_0x5e82f5){_0x1470e4=_0x5e82f5[_0x346b('0x3c')][0x0];_0x1470e4[_0x346b('0x3d')]=_0x3f7be1;}_0x53e5de(_0x1470e4);})['catch'](function(_0x138d48){_0x1fcb31(_0x138d48);});});}function createEndUser(_0x27d6c6,_0x5e7034,_0x5742f4,_0x24bff1,_0x3b47e6,_0x384ae3){var _0x5742f4=getName(_0x5742f4);return request({'method':'POST','uri':_0x346b('0x3e')+_0x5e7034+'/crm/v2/'+_[_0x346b('0x3f')](_0x384ae3['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x5742f4[0x1],'First_Name':_0x5742f4[0x0],'Phone':_0x24bff1,'Owner':{'name':!_[_0x346b('0x1e')](_0x3b47e6[_0x346b('0x40')][_0x346b('0x1b')])?_0x3b47e6['role']['name']:!_[_0x346b('0x1e')](_0x3b47e6['first_name'])?_0x3b47e6[_0x346b('0x41')]+'\x20'+_0x3b47e6['last_name']:_0x3b47e6['last_name'],'id':_0x3b47e6['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x27d6c6},'json':!![]})[_0x346b('0x2f')](function(_0x5ddecf){if(_0x5ddecf&&_0x5ddecf[_0x346b('0x3c')][0x0][_0x346b('0x42')]===_0x346b('0x43')){var _0x544099=_0x5ddecf[_0x346b('0x3c')][0x0][_0x346b('0x44')];_0x544099[_0x346b('0x3d')]=_['startCase'](_0x384ae3[_0x346b('0x45')])+'s';return _0x544099;}logger[_0x346b('0x2b')](_0x346b('0x3a'),JSON['stringify'](data));throw new Error(_0x346b('0x46')+JSON[_0x346b('0x10')](data));})['catch'](function(_0x4517ea){console[_0x346b('0x47')]('CREATE\x20ERROR',_0x4517ea);});}function getEndUser(_0x5083cf,_0x519136,_0x59ce8b,_0x4fe8f6,_0x4cdf70,_0x5dd069,_0x327c9a){var _0x48fc11={'method':'GET','uri':'','headers':{'Authorization':_0x346b('0x48')+_0x5083cf},'json':!![]};switch(_0x327c9a[_0x346b('0x49')]){case _0x346b('0x4a'):_0x48fc11[_0x346b('0x4b')]=_0x346b('0x3e')+_0x519136+_0x346b('0x4c')+_0x4cdf70+'))';return getZohoUser(_0x48fc11,_0x346b('0x4d'))[_0x346b('0x2f')](function(_0x53b3a9){if(_0x53b3a9)return _0x53b3a9;_0x48fc11[_0x346b('0x4b')]=_0x346b('0x3e')+_0x519136+_0x346b('0x4e')+_0x4cdf70+'))';return getZohoUser(_0x48fc11,'Leads')['then'](function(_0x4f84be){if(_0x4f84be)return _0x4f84be;if(_0x327c9a[_0x346b('0x45')]!=_0x346b('0x4f')){return createEndUser(_0x5083cf,_0x519136,_0x4fe8f6,_0x4cdf70,_0x5dd069,_0x327c9a);}else{return{};}});});break;case'contact':_0x48fc11[_0x346b('0x4b')]=_0x346b('0x3e')+_0x519136+_0x346b('0x4c')+_0x4cdf70+'))';return getZohoUser(_0x48fc11,_0x346b('0x4d'))[_0x346b('0x2f')](function(_0xa66b0d){if(_0xa66b0d)return _0xa66b0d;if(_0x327c9a[_0x346b('0x45')]!=_0x346b('0x4f')){return createEndUser(_0x5083cf,_0x519136,_0x4fe8f6,_0x4cdf70,_0x5dd069,_0x327c9a);}else{return{};}});break;case _0x346b('0x50'):_0x48fc11[_0x346b('0x4b')]=_0x346b('0x3e')+_0x519136+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4cdf70+'))';return getZohoUser(_0x48fc11,_0x346b('0x51'))[_0x346b('0x2f')](function(_0x25c1b5){if(_0x25c1b5)return _0x25c1b5;if(_0x327c9a[_0x346b('0x45')]!=_0x346b('0x4f')){return createEndUser(_0x5083cf,_0x519136,_0x4fe8f6,_0x4cdf70,_0x5dd069,_0x327c9a);}else{return{};}});break;}}function getCall(_0x26a95f,_0xd38265,_0x25f5b2,_0xd31ff8,_0x484b5f,_0x4d678c,_0x5d1775,_0x587425){logger[_0x346b('0x33')](_0x346b('0x52'));var _0x438e69={};_0x438e69[_0x346b('0x53')]={'name':!_[_0x346b('0x1e')](_0xd31ff8[_0x346b('0x40')][_0x346b('0x1b')])&&!_[_0x346b('0x1e')](_0xd31ff8[_0x346b('0x37')][_0x346b('0x1b')])&&_0xd31ff8[_0x346b('0x37')][_0x346b('0x1b')]===_0x346b('0x54')?_0xd31ff8[_0x346b('0x40')][_0x346b('0x1b')]:!_[_0x346b('0x1e')](_0xd31ff8[_0x346b('0x41')])?_0xd31ff8['first_name']+'\x20'+_0xd31ff8['last_name']:_0xd31ff8[_0x346b('0x55')],'id':_0xd31ff8['id']};_0x438e69['Subject']=intUtil[_0x346b('0x56')](_0x4d678c['Subjects'],_0x5d1775,'\x20');_0x438e69[_0x346b('0x57')]=intUtil[_0x346b('0x56')](_0x4d678c[_0x346b('0x58')],_0x5d1775,'\x0a');if(_0x484b5f[_0x346b('0x3d')]===_0x346b('0x4d')){_0x438e69[_0x346b('0x59')]={'name':!_[_0x346b('0x1e')](_0x484b5f[_0x346b('0x5a')])?_0x484b5f[_0x346b('0x5a')]:!_[_0x346b('0x1e')](_0x484b5f[_0x346b('0x5b')])?_0x484b5f[_0x346b('0x5b')]+'\x20'+_0x484b5f[_0x346b('0x5c')]:_0x484b5f[_0x346b('0x5c')],'id':_0x484b5f['id']};}if(_0x484b5f['enduserType']===_0x346b('0x51')){_0x438e69['What_Id']={'name':!_[_0x346b('0x1e')](_0x484b5f[_0x346b('0x5a')])?_0x484b5f[_0x346b('0x5a')]:!_[_0x346b('0x1e')](_0x484b5f[_0x346b('0x5b')])?_0x484b5f[_0x346b('0x5b')]+'\x20'+_0x484b5f[_0x346b('0x5c')]:_0x484b5f['Last_Name'],'id':_0x484b5f['id']};_0x438e69[_0x346b('0x5d')]=_[_0x346b('0x3f')](_0x484b5f[_0x346b('0x3d')]);}if(_0x5d1775['talktime']){_0x438e69['Call_Duration']=moment['utc'](parseInt(_0x5d1775['talktime'])*0x3e8)[_0x346b('0x5e')](_0x346b('0x5f'));}else if(_0x5d1775[_0x346b('0x60')]&&_0x5d1775[_0x346b('0x61')]){_0x438e69[_0x346b('0x62')]=moment[_0x346b('0x63')](moment(_0x5d1775['endtime'],_0x346b('0x64'))[_0x346b('0x65')](moment(_0x5d1775[_0x346b('0x66')],_0x346b('0x64'))))['format'](_0x346b('0x5f'));}switch(_0x5d1775[_0x346b('0x67')]){case _0x346b('0x68'):_0x438e69['Call_Result']=_0x346b('0x69');break;case _0x346b('0x6a'):case'connect':_0x438e69[_0x346b('0x6b')]=_0x346b('0x6c');break;case _0x346b('0x6d'):_0x438e69[_0x346b('0x6b')]=_0x346b('0x6e');break;case _0x346b('0x6f'):_0x438e69['Call_Result']=_0x346b('0x70');break;case _0x346b('0x71'):_0x438e69[_0x346b('0x6b')]=_0x346b('0x72');default:}_0x438e69[_0x346b('0x73')]=(_0x587425===_0x346b('0x74')?moment(_0x5d1775[_0x346b('0x66')])[_0x346b('0x5e')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5d1775['agentcalledAt'])[_0x346b('0x5e')](_0x346b('0x64')))||moment()['format'](_0x346b('0x64'));_0x438e69[_0x346b('0x75')]=_0x587425||'Inbound';_0x438e69=_[_0x346b('0x76')](_0x438e69,getCustomFields(_0x4d678c['Fields'],_0x5d1775));return request({'method':'POST','uri':_0x346b('0x3e')+_0xd38265+_0x346b('0x77'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x26a95f},'body':{'data':[_0x438e69]},'json':!![]})[_0x346b('0x2f')](function(_0x84b939){if(_0x84b939&&_0x84b939[_0x346b('0x3c')][0x0]['code']===_0x346b('0x43')){logger[_0x346b('0x33')]('Call\x20created!');return{'id':_0x84b939[_0x346b('0x3c')][0x0][_0x346b('0x44')]['id']};}})[_0x346b('0x2a')](function(_0x159544){logger[_0x346b('0x33')](_0x346b('0x78'),_0x159544[_0x346b('0x2d')]);console[_0x346b('0x47')]('err',_0x159544);});}exports[_0x346b('0x79')]=function(_0x25d378,_0x467681,_0x5a23e8,_0x121c5f,_0x2a8ff1,_0x18a7f1){var _0x57cffb,_0x53e7dd,_0x24b012;_0x18a7f1[_0x346b('0x7a')]=intUtil[_0x346b('0x7b')](_0x18a7f1[_0x346b('0x7a')]);_0x18a7f1[_0x346b('0x7c')]=intUtil[_0x346b('0x7b')](_0x18a7f1['serverUrl']);if(_0x2a8ff1&&_0x2a8ff1[_0x346b('0x7d')]){logger[_0x346b('0x33')](_0x346b('0x7e'),_0x346b('0x7f'));_0x467681[_0x346b('0x80')]=_0x18a7f1['serverUrl']+_0x346b('0x81')+_0x467681[_0x346b('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x467681['uniqueid']);}else{_0x467681['recordingURL']='';}var _0x2227f0=_0x18a7f1['host']===_0x346b('0x83')?'eu':_0x346b('0x84');return getAccessToken(_0x18a7f1)['then'](function(_0x3fe60e){_0x24b012=_0x3fe60e;return getUser(_0x24b012,_0x2227f0,_0x18a7f1,_0x121c5f['email']);})[_0x346b('0x2f')](function(_0x2cb52f){_0x57cffb=_0x2cb52f;logger['info'](_0x346b('0x85'),_0x57cffb['id']);return getEndUser(_0x24b012,_0x2227f0,_0x18a7f1,_0x467681[_0x346b('0x86')],_0x467681['calleridnum'],_0x57cffb,_0x5a23e8);})[_0x346b('0x2f')](function(_0x2f7faf){_0x53e7dd=_0x2f7faf;return getCall(_0x24b012,_0x2227f0,_0x18a7f1,_0x57cffb,_0x53e7dd,_0x5a23e8,_0x467681,'Inbound');})['then'](function(_0x9acdbe){if(_0x9acdbe){logger[_0x346b('0x33')](_0x346b('0x87'),_0x9acdbe['id']);logger[_0x346b('0x33')](_0x346b('0x7e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x346b('0x5e')](_0x346b('0x88'),_0x121c5f[_0x346b('0x1b')]),_0x346b('0x89'),{'uri':_0x346b('0x8a')+_0x18a7f1['host']+_0x346b('0x8b')+_0x9acdbe['id']});}})[_0x346b('0x2a')](function(_0x619df6){logger['error']('[QUEUE]',JSON['stringify'](_0x619df6));});};exports[_0x346b('0x74')]=function(_0x17c1ec,_0x1b8619,_0x34aac3,_0x390d6c,_0x1635fa,_0x57ae09,_0x3a9d54){var _0x1187ea,_0x2712c7,_0x3f0f5f;_0x57ae09['host']=intUtil[_0x346b('0x7b')](_0x57ae09['host']);_0x57ae09[_0x346b('0x7c')]=intUtil[_0x346b('0x7b')](_0x57ae09[_0x346b('0x7c')]);if(_0x3a9d54&&_0x3a9d54['recordingFormat']&&_0x3a9d54['recordingFormat']!=='none'){logger[_0x346b('0x33')](_0x346b('0x8c'),_0x346b('0x7f'));_0x1b8619[_0x346b('0x80')]=_0x57ae09['serverUrl']+_0x346b('0x81')+_0x1b8619[_0x346b('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x1b8619[_0x346b('0x82')]);}var _0x778aa=_0x57ae09[_0x346b('0x7a')]==='zoho.eu'?'eu':_0x346b('0x84');return getAccessToken(_0x57ae09)[_0x346b('0x2f')](function(_0x3625de){_0x3f0f5f=_0x3625de;return getUser(_0x3f0f5f,_0x778aa,_0x57ae09,_0x390d6c[_0x346b('0x32')]);})['then'](function(_0x166529){_0x1187ea=_0x166529;logger['info'](_0x346b('0x85'),_0x1187ea['id']);return getEndUser(_0x3f0f5f,_0x778aa,_0x57ae09,_0x1b8619[_0x346b('0x8d')],_0x1b8619[_0x346b('0x8e')],_0x1187ea,_0x34aac3);})['then'](function(_0x596102){_0x2712c7=_0x596102;return getCall(_0x3f0f5f,_0x778aa,_0x57ae09,_0x1187ea,_0x2712c7,_0x34aac3,_0x1b8619,_0x346b('0x8f'));})['then'](function(_0x56eedd){if(_0x56eedd){logger['info'](_0x346b('0x87'),_0x56eedd['id']);logger[_0x346b('0x33')](_0x346b('0x8c'),_0x346b('0x90'));emit(util[_0x346b('0x5e')](_0x346b('0x88'),_0x390d6c[_0x346b('0x1b')]),_0x346b('0x89'),{'uri':_0x346b('0x8a')+_0x57ae09[_0x346b('0x7a')]+'/crm/EntityInfo.do?module=Calls&id='+_0x56eedd['id']});}})[_0x346b('0x2a')](function(_0x3249dc){logger[_0x346b('0x2b')](_0x346b('0x8c'),JSON[_0x346b('0x10')](_0x3249dc));});};exports[_0x346b('0x91')]=function(_0x4519d1,_0x30001e,_0x3d0e6b,_0x4f4a1e,_0x553faa,_0x3790de){var _0x983053,_0x24ceb4,_0x402576;_0x3790de[_0x346b('0x7a')]=intUtil[_0x346b('0x7b')](_0x3790de[_0x346b('0x7a')]);_0x3790de[_0x346b('0x7c')]=intUtil['stripTrailingSlash'](_0x3790de[_0x346b('0x7c')]);if(_0x553faa&&_0x553faa[_0x346b('0x7d')]){logger[_0x346b('0x33')]('['+_0x30001e['lastevent'][_0x346b('0x92')]()+']','Recording\x20is\x20enabled!');_0x30001e['recordingURL']=_0x3790de[_0x346b('0x7c')]+_0x346b('0x81')+_0x30001e[_0x346b('0x82')]+_0x346b('0x93')+md5(_0x30001e['uniqueid']);}else{_0x30001e[_0x346b('0x80')]='';}var _0x1b153c=_0x3790de['host']===_0x346b('0x83')?'eu':_0x346b('0x84');return getAccessToken(_0x3790de)['then'](function(_0x1cec0f){_0x402576=_0x1cec0f;return getUser(_0x402576,_0x1b153c,_0x3790de);})[_0x346b('0x2f')](function(_0x482ffc){_0x983053=_0x482ffc;logger[_0x346b('0x33')](_0x346b('0x85'),_0x983053['id']);return getEndUser(_0x402576,_0x1b153c,_0x3790de,_0x30001e[_0x346b('0x86')],_0x30001e[_0x346b('0x94')],_0x983053,_0x3d0e6b);})[_0x346b('0x2f')](function(_0x21b5d5){_0x24ceb4=_0x21b5d5;return getCall(_0x402576,_0x1b153c,_0x3790de,_0x983053,_0x24ceb4,_0x3d0e6b,_0x30001e,'Inbound');})['then'](function(_0x546152){if(_0x546152){logger[_0x346b('0x33')](_0x346b('0x87'),_0x546152['id']);}})['catch'](function(_0x50bf4a){logger['error']('['+_0x30001e[_0x346b('0x67')][_0x346b('0x92')]()+']',JSON[_0x346b('0x10')](_0x50bf4a));});}; \ 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 f858b5b..c1a3ab5 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 _0x7bf6=['trigger','exec','data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','mustache'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x7bf6,0xa6));var _0x67bf=function(_0x137586,_0x45152a){_0x137586=_0x137586-0x0;var _0xd4514=_0x7bf6[_0x137586];return _0xd4514;};'use strict';var util=require(_0x67bf('0x0'));var sh=require('shelljs');var Mustache=require(_0x67bf('0x1'));var logger=require('../../../../config/logger')(_0x67bf('0x2'));exports[_0x67bf('0x3')]=function(_0x1a38db,_0x3d2efb){var _0xa952ff=_0x1a38db[_0x67bf('0x4')]?_0x1a38db[_0x67bf('0x4')]:_0x67bf('0x5');var _0x6d40df=_0x1a38db['data3']?Mustache[_0x67bf('0x6')](_0x1a38db[_0x67bf('0x7')],_0x3d2efb):_0x3d2efb;sh[_0x67bf('0x3')](_0x6d40df,function(_0x2aea82,_0x54141e,_0x189bf6){if(_0x2aea82!==0x0){logger[_0x67bf('0x8')](util[_0x67bf('0x9')](_0x67bf('0xa'),_0xa952ff,_0x6d40df,_0x2aea82,_0x189bf6));}else{logger[_0x67bf('0xb')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xa952ff,_0x6d40df,_0x54141e));}});}; \ No newline at end of file +var _0x450f=['util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x14d86c,_0x30d3ae){var _0x4bc4cd=function(_0x338f71){while(--_0x338f71){_0x14d86c['push'](_0x14d86c['shift']());}};_0x4bc4cd(++_0x30d3ae);}(_0x450f,0x70));var _0xf450=function(_0x2eebcc,_0x1e649d){_0x2eebcc=_0x2eebcc-0x0;var _0x39f1a5=_0x450f[_0x2eebcc];return _0x39f1a5;};'use strict';var util=require(_0xf450('0x0'));var sh=require(_0xf450('0x1'));var Mustache=require(_0xf450('0x2'));var logger=require(_0xf450('0x3'))(_0xf450('0x4'));exports[_0xf450('0x5')]=function(_0x2f7fb7,_0x4db0d0){var _0x4ddc92=_0x2f7fb7[_0xf450('0x6')]?_0x2f7fb7[_0xf450('0x6')]:_0xf450('0x7');var _0xdea43=_0x2f7fb7[_0xf450('0x8')]?Mustache[_0xf450('0x9')](_0x2f7fb7[_0xf450('0x8')],_0x4db0d0):_0x4db0d0;sh[_0xf450('0x5')](_0xdea43,function(_0x5649d4,_0x38bf4d,_0x3d94b4){if(_0x5649d4!==0x0){logger[_0xf450('0xa')](util[_0xf450('0xb')](_0xf450('0xc'),_0x4ddc92,_0xdea43,_0x5649d4,_0x3d94b4));}else{logger[_0xf450('0xd')](util[_0xf450('0xb')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x4ddc92,_0xdea43,_0x38bf4d));}});}; \ 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 88e9571..ac716f1 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 _0x841c=['data7','render','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','request-promise','util','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase','data2','data5','number','headers','data6','parse','error','stack','GET','DELETE','POST','PUT'];(function(_0x5cc84d,_0x5b6a48){var _0x3a60ee=function(_0x5d6eb0){while(--_0x5d6eb0){_0x5cc84d['push'](_0x5cc84d['shift']());}};_0x3a60ee(++_0x5b6a48);}(_0x841c,0xd3));var _0xc841=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x841c[_0x57b54c];return _0x59cc19;};'use strict';var rp=require(_0xc841('0x0'));var util=require(_0xc841('0x1'));var _=require(_0xc841('0x2'));var Mustache=require(_0xc841('0x3'));var logger=require(_0xc841('0x4'))(_0xc841('0x5'));exports['exec']=function(_0x11b16b,_0x540128){var _0x1a09c5,_0x41905d;var _0x88af6b={'method':_0x11b16b[_0xc841('0x6')][_0xc841('0x7')](),'uri':Mustache['render'](_0x11b16b[_0xc841('0x8')],_0x540128),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x11b16b[_0xc841('0x9')])===_0xc841('0xa')&&parseInt(_0x11b16b[_0xc841('0x9')])>=0x1&&parseInt(_0x11b16b[_0xc841('0x9')])<=0xa?parseInt(_0x11b16b[_0xc841('0x9')])*0x3e8:0x5*0x3e8};try{_0x88af6b[_0xc841('0xb')]=_0x11b16b[_0xc841('0xc')]?JSON[_0xc841('0xd')](Mustache['render'](_0x11b16b[_0xc841('0xc')],_0x540128)):{};}catch(_0x2b57f6){logger[_0xc841('0xe')](_0x2b57f6[_0xc841('0xf')]);}switch(_0x11b16b['data1'][_0xc841('0x7')]()){case _0xc841('0x10'):case _0xc841('0x11'):_0x1a09c5=null;_0x88af6b['qs']=_0x540128;break;case _0xc841('0x12'):case _0xc841('0x13'):if(_0x11b16b[_0xc841('0x14')]){try{_0x1a09c5=JSON[_0xc841('0xd')](Mustache[_0xc841('0x15')](_0x11b16b[_0xc841('0x14')],_0x540128));_0x88af6b[_0xc841('0x16')]=_0x1a09c5;}catch(_0x9a413){logger[_0xc841('0xe')](_0x9a413[_0xc841('0xf')]);logger['error'](_0xc841('0x17'));}}else{_0x1a09c5=_0x540128;_0x88af6b['body']=_0x1a09c5;}break;}logger[_0xc841('0x18')](util[_0xc841('0x19')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x11b16b[_0xc841('0x6')],_0x11b16b['data2'],JSON[_0xc841('0x1a')](_0x88af6b)));rp(_0x88af6b)[_0xc841('0x1b')](function(_0x21d774){_0x1a09c5=!_['isNil'](_0x1a09c5)?',\x20request\x20body:\x20'+_0x1a09c5:'';_0x41905d=typeof _0x21d774[_0xc841('0x16')]===_0xc841('0x1c')?JSON[_0xc841('0x1a')](_0x21d774[_0xc841('0x16')]):_0x21d774[_0xc841('0x16')];logger['info'](util[_0xc841('0x19')](_0xc841('0x1d'),_0x11b16b['data1'],_0x11b16b[_0xc841('0x8')],_0x21d774[_0xc841('0x1e')],_0x41905d));})[_0xc841('0x1f')](function(_0x1014c6){logger[_0xc841('0xe')](util['format'](_0xc841('0x20'),_0x11b16b[_0xc841('0x6')],_0x11b16b[_0xc841('0x8')],_0x1014c6['statusCode'],_0x1014c6['name'],_0x1014c6['message']));});}; \ No newline at end of file +var _0x2f71=['mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','data6','parse','error','stack','GET','DELETE','POST','PUT','data7','format','then',',\x20request\x20body:\x20','body','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','message','request-promise','util','lodash'];(function(_0x190f00,_0x28c850){var _0x48d523=function(_0x3348a4){while(--_0x3348a4){_0x190f00['push'](_0x190f00['shift']());}};_0x48d523(++_0x28c850);}(_0x2f71,0x133));var _0x12f7=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x2f71[_0x334841];return _0x5beb4b;};'use strict';var rp=require(_0x12f7('0x0'));var util=require(_0x12f7('0x1'));var _=require(_0x12f7('0x2'));var Mustache=require(_0x12f7('0x3'));var logger=require(_0x12f7('0x4'))(_0x12f7('0x5'));exports['exec']=function(_0x4760c9,_0x38dd94){var _0x5d80dd,_0x25dbdb;var _0x47ef9c={'method':_0x4760c9[_0x12f7('0x6')][_0x12f7('0x7')](),'uri':Mustache[_0x12f7('0x8')](_0x4760c9[_0x12f7('0x9')],_0x38dd94),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4760c9[_0x12f7('0xa')])===_0x12f7('0xb')&&parseInt(_0x4760c9[_0x12f7('0xa')])>=0x1&&parseInt(_0x4760c9[_0x12f7('0xa')])<=0xa?parseInt(_0x4760c9[_0x12f7('0xa')])*0x3e8:0x5*0x3e8};try{_0x47ef9c['headers']=_0x4760c9[_0x12f7('0xc')]?JSON[_0x12f7('0xd')](Mustache[_0x12f7('0x8')](_0x4760c9[_0x12f7('0xc')],_0x38dd94)):{};}catch(_0x281cbe){logger[_0x12f7('0xe')](_0x281cbe[_0x12f7('0xf')]);}switch(_0x4760c9[_0x12f7('0x6')][_0x12f7('0x7')]()){case _0x12f7('0x10'):case _0x12f7('0x11'):_0x5d80dd=null;_0x47ef9c['qs']=_0x38dd94;break;case _0x12f7('0x12'):case _0x12f7('0x13'):if(_0x4760c9[_0x12f7('0x14')]){try{_0x5d80dd=JSON['parse'](Mustache[_0x12f7('0x8')](_0x4760c9[_0x12f7('0x14')],_0x38dd94));_0x47ef9c['body']=_0x5d80dd;}catch(_0x16fc4d){logger['error'](_0x16fc4d[_0x12f7('0xf')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x5d80dd=_0x38dd94;_0x47ef9c['body']=_0x5d80dd;}break;}logger['info'](util[_0x12f7('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x4760c9['data1'],_0x4760c9[_0x12f7('0x9')],JSON['stringify'](_0x47ef9c)));rp(_0x47ef9c)[_0x12f7('0x16')](function(_0x3415bd){_0x5d80dd=!_['isNil'](_0x5d80dd)?_0x12f7('0x17')+_0x5d80dd:'';_0x25dbdb=typeof _0x3415bd[_0x12f7('0x18')]===_0x12f7('0x19')?JSON[_0x12f7('0x1a')](_0x3415bd[_0x12f7('0x18')]):_0x3415bd['body'];logger[_0x12f7('0x1b')](util[_0x12f7('0x15')](_0x12f7('0x1c'),_0x4760c9[_0x12f7('0x6')],_0x4760c9[_0x12f7('0x9')],_0x3415bd[_0x12f7('0x1d')],_0x25dbdb));})['catch'](function(_0x2983dc){logger[_0x12f7('0xe')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x4760c9['data1'],_0x4760c9[_0x12f7('0x9')],_0x2983dc[_0x12f7('0x1d')],_0x2983dc['name'],_0x2983dc[_0x12f7('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index bb48c89..28b10da 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 _0xa0c0=['then','debug','error','rpc','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0x2cb6d2,_0x23cff5){var _0xaa9190=function(_0x32d608){while(--_0x32d608){_0x2cb6d2['push'](_0x2cb6d2['shift']());}};_0xaa9190(++_0x23cff5);}(_0xa0c0,0x1ab));var _0x0a0c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa0c0[_0x19950b];return _0x3c6b41;};'use strict';var jayson=require(_0x0a0c('0x0'));var BPromise=require(_0x0a0c('0x1'));var logger=require(_0x0a0c('0x2'))(_0x0a0c('0x3'));var client=jayson[_0x0a0c('0x4')][_0x0a0c('0x5')]({'port':0x2329});client[_0x0a0c('0x6')]=function(_0x15a906,_0x1d2041){return new BPromise(function(_0x1dedca,_0x2261ed){return client[_0x0a0c('0x7')](_0x15a906,_0x1d2041)[_0x0a0c('0x8')](function(_0x3920e7){logger[_0x0a0c('0x9')]('rpc',_0x0a0c('0x3'),_0x15a906,_0x1d2041,_0x3920e7);if(_0x3920e7[_0x0a0c('0xa')]){logger[_0x0a0c('0xa')](_0x0a0c('0xb'),_0x0a0c('0x3'),_0x15a906,_0x3920e7[_0x0a0c('0xa')][_0x0a0c('0xc')],_0x1d2041);return _0x2261ed(_0x3920e7['error']['message']);}else{return _0x1dedca(_0x3920e7['result']);}})[_0x0a0c('0xd')](function(_0x13f5c4){logger[_0x0a0c('0xa')](_0x0a0c('0xb'),_0x0a0c('0x3'),_0x15a906,_0x13f5c4,_0x1d2041);return _0x2261ed(_0x13f5c4);});});};module[_0x0a0c('0xe')]=client; \ No newline at end of file +var _0x5065=['routing','client','http','request','then','debug','rpc','error','message','result','catch','exports','../../config/logger'];(function(_0x1c518c,_0x383352){var _0x2650cb=function(_0x45fe77){while(--_0x45fe77){_0x1c518c['push'](_0x1c518c['shift']());}};_0x2650cb(++_0x383352);}(_0x5065,0x12a));var _0x5506=function(_0x1f6eee,_0x55f845){_0x1f6eee=_0x1f6eee-0x0;var _0x48e34f=_0x5065[_0x1f6eee];return _0x48e34f;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x5506('0x0'))(_0x5506('0x1'));var client=jayson[_0x5506('0x2')][_0x5506('0x3')]({'port':0x2329});client['Request']=function(_0x1a4998,_0xbc4454){return new BPromise(function(_0x30f372,_0x54c4b8){return client[_0x5506('0x4')](_0x1a4998,_0xbc4454)[_0x5506('0x5')](function(_0x3b790c){logger[_0x5506('0x6')](_0x5506('0x7'),_0x5506('0x1'),_0x1a4998,_0xbc4454,_0x3b790c);if(_0x3b790c[_0x5506('0x8')]){logger[_0x5506('0x8')](_0x5506('0x7'),_0x5506('0x1'),_0x1a4998,_0x3b790c['error'][_0x5506('0x9')],_0xbc4454);return _0x54c4b8(_0x3b790c['error'][_0x5506('0x9')]);}else{return _0x30f372(_0x3b790c[_0x5506('0xa')]);}})[_0x5506('0xb')](function(_0x566e3f){logger['error'](_0x5506('0x7'),'routing',_0x1a4998,_0x566e3f,_0xbc4454);return _0x54c4b8(_0x566e3f);});});};module[_0x5506('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 010f02c..3c01369 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 _0xc9fd=['getSettings','loginMailFrequency','catch','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','initMailAccounts','refresh','listen'];(function(_0x406cbd,_0x543b81){var _0x1b9e14=function(_0x2b95c0){while(--_0x2b95c0){_0x406cbd['push'](_0x406cbd['shift']());}};_0x1b9e14(++_0x543b81);}(_0xc9fd,0x13b));var _0xdc9f=function(_0x5ce7de,_0x5f4f06){_0x5ce7de=_0x5ce7de-0x0;var _0x70e403=_0xc9fd[_0x5ce7de];return _0x70e403;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0xdc9f('0x0'));var EmailChannel=require(_0xdc9f('0x1'));var mailAccount=require(_0xdc9f('0x2'));var setting=require(_0xdc9f('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xdc9f('0x4')]()[_0xdc9f('0x5')](mailAccount['getMailAccounts']())['then'](realtime[_0xdc9f('0x6')]())['then'](function(){email[_0xdc9f('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xdc9f('0x8')](realtime,email)['then'](function(){return initRealtime();})[_0xdc9f('0x5')](function(){return setting[_0xdc9f('0x9')]();})[_0xdc9f('0x5')](function(_0x7dbfe1){return setInterval(initRealtime,_0x7dbfe1[_0xdc9f('0xa')]*0x3e8);})[_0xdc9f('0xb')](function(_0x3b252c){console['log'](_0x3b252c);});}main(); \ No newline at end of file +var _0x9b51=['then','getMailAccounts','mailAccounts','listen','getSettings','catch','bluebird','./lib/email','./rpc/mailAccount','resolve'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x9b51,0x1d2));var _0x19b5=function(_0x2cd718,_0x1ab5dd){_0x2cd718=_0x2cd718-0x0;var _0x4c02ba=_0x9b51[_0x2cd718];return _0x4c02ba;};'use strict';var BPromise=require(_0x19b5('0x0'));var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x19b5('0x1'));var mailAccount=require(_0x19b5('0x2'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x19b5('0x3')]()[_0x19b5('0x4')](mailAccount[_0x19b5('0x5')]())['then'](realtime['initMailAccounts']())[_0x19b5('0x4')](function(){email['refresh'](realtime[_0x19b5('0x6')]);return realtime;});}function main(){return server[_0x19b5('0x7')](realtime,email)[_0x19b5('0x4')](function(){return initRealtime();})[_0x19b5('0x4')](function(){return setting[_0x19b5('0x8')]();})[_0x19b5('0x4')](function(_0x34cb75){return setInterval(initRealtime,_0x34cb75['loginMailFrequency']*0x3e8);})[_0x19b5('0x9')](function(_0x518e69){console['log'](_0x518e69);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 1bd785d..eea564e 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 _0x2971=['disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','sendMail','smtp','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','./imap','info','mailAccounts','imapAccounts','emit','name','key','Imap','status','messageStatus','total','isNil','mailAccount:update','prototype','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error'];(function(_0x487613,_0x190716){var _0x30cc0d=function(_0x2db637){while(--_0x2db637){_0x487613['push'](_0x487613['shift']());}};_0x30cc0d(++_0x190716);}(_0x2971,0xe8));var _0x1297=function(_0x2773c5,_0x28a7da){_0x2773c5=_0x2773c5-0x0;var _0x5c5e48=_0x2971[_0x2773c5];return _0x5c5e48;};'use strict';var _=require(_0x1297('0x0'));var moment=require(_0x1297('0x1'));var BPromise=require(_0x1297('0x2'));var md5=require(_0x1297('0x3'));var Redis=require(_0x1297('0x4'));var config=require('../../../config/environment');var logger=require(_0x1297('0x5'))(_0x1297('0x6'));config[_0x1297('0x7')]=_[_0x1297('0x8')](config['redis'],{'host':_0x1297('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1297('0x7')]));var EmailImap=require(_0x1297('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x3e31fa){logger[_0x1297('0xb')]('start\x20email\x20channel');this[_0x1297('0xc')]=_0x3e31fa[_0x1297('0xc')];this[_0x1297('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x1297('0xe')]=function(_0xd46e6a){var _0x5e0053=this[_0x1297('0xc')][_0xd46e6a];var _0x48a917={'id':_0x5e0053['id'],'name':_0x5e0053[_0x1297('0xf')],'key':_0x5e0053[_0x1297('0x10')],'active':_0x5e0053['active'],'Imap':{'status':_0x5e0053[_0x1297('0x11')][_0x1297('0x12')],'messageStatus':_0x5e0053['Imap'][_0x1297('0x13')],'total':_0x5e0053[_0x1297('0x11')][_0x1297('0x14')]}};if(_[_0x1297('0x15')](md5Accounts[_0xd46e6a])){md5Accounts[_0xd46e6a]={};}var _0x21338e=md5(JSON['stringify'](_0x48a917));if(md5Accounts[_0xd46e6a]['md5']!==_0x21338e){md5Accounts[_0xd46e6a][_0x1297('0x3')]=_0x21338e;io[_0x1297('0xe')](_0x1297('0x16'),_0x48a917);}};EmailChannel[_0x1297('0x17')][_0x1297('0x18')]=function(_0x1e1456){for(var _0x3ac34e in _0x1e1456){if(_0x1e1456[_0x1297('0x19')](_0x3ac34e)){if(_0x1e1456[_0x3ac34e]['Imap']&&_0x1e1456[_0x3ac34e]['active']){var _0x52f915=_0x1e1456[_0x3ac34e][_0x1297('0x11')];if(!this[_0x1297('0xd')][_0x1297('0x19')](_0x52f915['id'])){this[_0x1297('0xd')][_0x52f915['id']]=new EmailImap(_0x52f915,_0x1e1456[_0x3ac34e][_0x1297('0x6')]);this[_0x1297('0xd')][_0x52f915['id']]['on'](_0x1297('0x1a'),this[_0x1297('0x1b')][_0x1297('0x1c')](this,_0x3ac34e));this[_0x1297('0xd')][_0x52f915['id']]['on'](_0x1297('0x6'),this[_0x1297('0x1d')]['bind'](this,_0x3ac34e));this[_0x1297('0xd')][_0x52f915['id']]['on'](_0x1297('0x1e'),this[_0x1297('0x1f')][_0x1297('0x1c')](this,_0x3ac34e));this[_0x1297('0xd')][_0x52f915['id']]['on'](_0x1297('0x20'),this['handleImapError'][_0x1297('0x1c')](this,_0x3ac34e));}}else{if(_[_0x1297('0x15')](this[_0x1297('0xc')][_0x3ac34e][_0x1297('0x11')])){this['mailAccounts'][_0x3ac34e][_0x1297('0x11')]={};}this['mailAccounts'][_0x3ac34e][_0x1297('0x11')][_0x1297('0x12')]=_0x1297('0x21');this[_0x1297('0xc')][_0x3ac34e][_0x1297('0x11')][_0x1297('0x13')]='';this[_0x1297('0xe')](_0x3ac34e);}}}};EmailChannel[_0x1297('0x17')][_0x1297('0x1b')]=function(_0x42431d,_0x1a5233){if(this[_0x1297('0xc')][_0x42431d]){this['mailAccounts'][_0x42431d][_0x1297('0x11')]['status']=_0x1297('0x22');this[_0x1297('0xc')][_0x42431d][_0x1297('0x11')][_0x1297('0x13')]=_0x1a5233[_0x1297('0xf')];if(_0x1a5233[_0x1297('0x23')]){this[_0x1297('0xc')][_0x42431d][_0x1297('0x11')][_0x1297('0x14')]=_0x1a5233[_0x1297('0x23')][_0x1297('0x14')];}return this['emit'](_0x42431d);}};EmailChannel['prototype'][_0x1297('0x1d')]=function(_0x5b28f3,_0x32ccaa){logger[_0x1297('0xb')](_0x1297('0x24'),_0x32ccaa[_0x1297('0x25')],_0x32ccaa['lastName'],_0x32ccaa['from'],_0x5b28f3);if(this[_0x1297('0xc')][_0x5b28f3]){return mailAccount[_0x1297('0x26')](_0x5b28f3,_0x32ccaa)[_0x1297('0x27')](function(_0x27e46a){if(_0x27e46a){logger[_0x1297('0xb')](_0x1297('0x28'));}})[_0x1297('0x29')](function(_0x46f78d){logger['error'](_0x1297('0x2a'),JSON[_0x1297('0x2b')](_0x46f78d));});}};EmailChannel['prototype'][_0x1297('0x1f')]=function(_0x56c725){if(this[_0x1297('0xc')][_0x56c725]&&this[_0x1297('0xc')][_0x56c725]['Imap']){if(this[_0x1297('0xd')][this[_0x1297('0xc')][_0x56c725][_0x1297('0x11')]['id']]){delete this[_0x1297('0xd')][this['mailAccounts'][_0x56c725]['Imap']['id']];}this['mailAccounts'][_0x56c725][_0x1297('0x11')][_0x1297('0x2c')]=moment();this[_0x1297('0xe')](_0x56c725);}};EmailChannel[_0x1297('0x17')][_0x1297('0x2d')]=function(_0x224d92,_0x426b55){if(this[_0x1297('0xc')][_0x224d92]){this[_0x1297('0xc')][_0x224d92]['Imap'][_0x1297('0x12')]=_0x1297('0x20');this[_0x1297('0xc')][_0x224d92][_0x1297('0x11')][_0x1297('0x13')]=_0x426b55;return this['emit'](_0x224d92);}};EmailChannel['prototype'][_0x1297('0x2e')]=function(_0xa9ec6e,_0x256062){return this[_0x1297('0x2f')][_0x1297('0x30')](_0xa9ec6e,_0x256062);};EmailChannel[_0x1297('0x17')][_0x1297('0x31')]=function(_0x7aac27){var _0x34127c=this;if(this[_0x1297('0xc')][_0x7aac27['id']]){if(_[_0x1297('0x15')](this[_0x1297('0xc')][_0x7aac27['id']][_0x1297('0x32')])){this['mailAccounts'][_0x7aac27['id']][_0x1297('0x32')]={};}this[_0x1297('0xc')][_0x7aac27['id']][_0x1297('0x32')][_0x1297('0x2c')]=moment();return new BPromise(function(_0x34a658,_0x5789c8){return _0x34127c[_0x1297('0x2f')][_0x1297('0x33')](_0x7aac27)[_0x1297('0x27')](function(_0xac2cb3){_0x34127c[_0x1297('0xc')][_0x7aac27['id']]['Smtp'][_0x1297('0x12')]='verified';_0x34127c[_0x1297('0xc')][_0x7aac27['id']][_0x1297('0x32')]['messageStatus']='';_0x34127c['emit'](_0x7aac27['id']);_0x34a658(_0xac2cb3);})['catch'](function(_0x5614e8){_0x34127c['mailAccounts'][_0x7aac27['id']]['Smtp']['status']=_0x1297('0x20');_0x34127c[_0x1297('0xc')][_0x7aac27['id']][_0x1297('0x32')]['messageStatus']=_0x5614e8;_0x34127c[_0x1297('0xe')](_0x7aac27['id']);_0x5789c8(_0x5614e8);});});}return this[_0x1297('0x2f')][_0x1297('0x33')](_0x7aac27);};module[_0x1297('0x34')]=EmailChannel; \ No newline at end of file +var _0x3623=['isNil','stringify','mailAccount:update','hasOwnProperty','box','bind','handleImapEmail','end','handleImapEnd','handleImapError','status','disabled','handleImapBox','messages','firstName','lastName','from','notify','then','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','lodash','moment','md5','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x3623,0xb8));var _0x3362=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x3623[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x3362('0x0'));var moment=require(_0x3362('0x1'));var BPromise=require('bluebird');var md5=require(_0x3362('0x2'));var Redis=require('ioredis');var config=require(_0x3362('0x3'));var logger=require(_0x3362('0x4'))(_0x3362('0x5'));config[_0x3362('0x6')]=_['defaults'](config[_0x3362('0x6')],{'host':_0x3362('0x7'),'port':0x18eb});var io=require(_0x3362('0x8'))(new Redis(config[_0x3362('0x6')]));var EmailImap=require(_0x3362('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x3362('0xa'));var md5Accounts={};function EmailChannel(_0x1a79b2){logger[_0x3362('0xb')](_0x3362('0xc'));this[_0x3362('0xd')]=_0x1a79b2[_0x3362('0xd')];this[_0x3362('0xe')]={};this[_0x3362('0xf')]=new EmailSmtp();}EmailChannel[_0x3362('0x10')][_0x3362('0x11')]=function(_0x5c2fde){var _0x1c8d57=this[_0x3362('0xd')][_0x5c2fde];var _0x2f66f8={'id':_0x1c8d57['id'],'name':_0x1c8d57[_0x3362('0x12')],'key':_0x1c8d57[_0x3362('0x13')],'active':_0x1c8d57[_0x3362('0x14')],'Imap':{'status':_0x1c8d57[_0x3362('0x15')]['status'],'messageStatus':_0x1c8d57[_0x3362('0x15')][_0x3362('0x16')],'total':_0x1c8d57[_0x3362('0x15')][_0x3362('0x17')]}};if(_[_0x3362('0x18')](md5Accounts[_0x5c2fde])){md5Accounts[_0x5c2fde]={};}var _0x30bfb1=md5(JSON[_0x3362('0x19')](_0x2f66f8));if(md5Accounts[_0x5c2fde][_0x3362('0x2')]!==_0x30bfb1){md5Accounts[_0x5c2fde][_0x3362('0x2')]=_0x30bfb1;io['emit'](_0x3362('0x1a'),_0x2f66f8);}};EmailChannel[_0x3362('0x10')]['refresh']=function(_0x12a187){for(var _0x474796 in _0x12a187){if(_0x12a187[_0x3362('0x1b')](_0x474796)){if(_0x12a187[_0x474796][_0x3362('0x15')]&&_0x12a187[_0x474796]['active']){var _0x44556f=_0x12a187[_0x474796][_0x3362('0x15')];if(!this[_0x3362('0xe')][_0x3362('0x1b')](_0x44556f['id'])){this[_0x3362('0xe')][_0x44556f['id']]=new EmailImap(_0x44556f,_0x12a187[_0x474796][_0x3362('0x5')]);this[_0x3362('0xe')][_0x44556f['id']]['on'](_0x3362('0x1c'),this['handleImapBox'][_0x3362('0x1d')](this,_0x474796));this[_0x3362('0xe')][_0x44556f['id']]['on'](_0x3362('0x5'),this[_0x3362('0x1e')]['bind'](this,_0x474796));this[_0x3362('0xe')][_0x44556f['id']]['on'](_0x3362('0x1f'),this[_0x3362('0x20')][_0x3362('0x1d')](this,_0x474796));this[_0x3362('0xe')][_0x44556f['id']]['on']('error',this[_0x3362('0x21')][_0x3362('0x1d')](this,_0x474796));}}else{if(_[_0x3362('0x18')](this['mailAccounts'][_0x474796]['Imap'])){this[_0x3362('0xd')][_0x474796][_0x3362('0x15')]={};}this[_0x3362('0xd')][_0x474796][_0x3362('0x15')][_0x3362('0x22')]=_0x3362('0x23');this[_0x3362('0xd')][_0x474796][_0x3362('0x15')]['messageStatus']='';this[_0x3362('0x11')](_0x474796);}}}};EmailChannel[_0x3362('0x10')][_0x3362('0x24')]=function(_0x45d03d,_0x4e3098){if(this[_0x3362('0xd')][_0x45d03d]){this[_0x3362('0xd')][_0x45d03d][_0x3362('0x15')]['status']='connected';this['mailAccounts'][_0x45d03d][_0x3362('0x15')][_0x3362('0x16')]=_0x4e3098['name'];if(_0x4e3098[_0x3362('0x25')]){this[_0x3362('0xd')][_0x45d03d][_0x3362('0x15')][_0x3362('0x17')]=_0x4e3098[_0x3362('0x25')][_0x3362('0x17')];}return this[_0x3362('0x11')](_0x45d03d);}};EmailChannel[_0x3362('0x10')]['handleImapEmail']=function(_0x404895,_0x2a74dd){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2a74dd[_0x3362('0x26')],_0x2a74dd[_0x3362('0x27')],_0x2a74dd[_0x3362('0x28')],_0x404895);if(this[_0x3362('0xd')][_0x404895]){return mailAccount[_0x3362('0x29')](_0x404895,_0x2a74dd)[_0x3362('0x2a')](function(_0x2565c2){if(_0x2565c2){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0x3362('0x2b')](function(_0x31ff8b){logger[_0x3362('0x2c')](_0x3362('0x2d'),JSON[_0x3362('0x19')](_0x31ff8b));});}};EmailChannel[_0x3362('0x10')][_0x3362('0x20')]=function(_0x14ed94){if(this[_0x3362('0xd')][_0x14ed94]&&this[_0x3362('0xd')][_0x14ed94][_0x3362('0x15')]){if(this[_0x3362('0xe')][this[_0x3362('0xd')][_0x14ed94][_0x3362('0x15')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x14ed94]['Imap']['id']];}this[_0x3362('0xd')][_0x14ed94][_0x3362('0x15')][_0x3362('0x2e')]=moment();this[_0x3362('0x11')](_0x14ed94);}};EmailChannel[_0x3362('0x10')]['handleImapError']=function(_0x65c73f,_0x3930d5){if(this[_0x3362('0xd')][_0x65c73f]){this[_0x3362('0xd')][_0x65c73f][_0x3362('0x15')][_0x3362('0x22')]='error';this[_0x3362('0xd')][_0x65c73f][_0x3362('0x15')][_0x3362('0x16')]=_0x3930d5;return this['emit'](_0x65c73f);}};EmailChannel['prototype'][_0x3362('0x2f')]=function(_0x53e72e,_0x248b4e){return this[_0x3362('0xf')][_0x3362('0x30')](_0x53e72e,_0x248b4e);};EmailChannel['prototype'][_0x3362('0x31')]=function(_0x6bd65c){var _0x51a70d=this;if(this[_0x3362('0xd')][_0x6bd65c['id']]){if(_[_0x3362('0x18')](this['mailAccounts'][_0x6bd65c['id']]['Smtp'])){this[_0x3362('0xd')][_0x6bd65c['id']][_0x3362('0x32')]={};}this[_0x3362('0xd')][_0x6bd65c['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x5c9d44,_0x3b628b){return _0x51a70d['smtp'][_0x3362('0x33')](_0x6bd65c)[_0x3362('0x2a')](function(_0x31e3df){_0x51a70d[_0x3362('0xd')][_0x6bd65c['id']][_0x3362('0x32')][_0x3362('0x22')]='verified';_0x51a70d[_0x3362('0xd')][_0x6bd65c['id']][_0x3362('0x32')][_0x3362('0x16')]='';_0x51a70d[_0x3362('0x11')](_0x6bd65c['id']);_0x5c9d44(_0x31e3df);})['catch'](function(_0x4040a4){_0x51a70d[_0x3362('0xd')][_0x6bd65c['id']][_0x3362('0x32')]['status']=_0x3362('0x2c');_0x51a70d[_0x3362('0xd')][_0x6bd65c['id']]['Smtp'][_0x3362('0x16')]=_0x4040a4;_0x51a70d['emit'](_0x6bd65c['id']);_0x3b628b(_0x4040a4);});});}return this[_0x3362('0xf')]['verify'](_0x6bd65c);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index c10585c..7a44499 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 _0x59ae=['connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','openBox','handleOpenBox','emit','readUnseen','UNSEEN','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError'];(function(_0x418225,_0x52e214){var _0x4bd3d3=function(_0x4904df){while(--_0x4904df){_0x418225['push'](_0x418225['shift']());}};_0x4bd3d3(++_0x52e214);}(_0x59ae,0xa4));var _0xe59a=function(_0x180ab4,_0xce5eda){_0x180ab4=_0x180ab4-0x0;var _0x2918f6=_0x59ae[_0x180ab4];return _0x2918f6;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xe59a('0x0'));var Imap=require(_0xe59a('0x1'));var _=require(_0xe59a('0x2'));var rs=require(_0xe59a('0x3'));var simpleParser=require(_0xe59a('0x4'))[_0xe59a('0x5')];var Iconv=require(_0xe59a('0x6'))[_0xe59a('0x7')];var EventEmitter=require('events')['EventEmitter'];var utils=require('./utils');var logger=require(_0xe59a('0x8'))(_0xe59a('0x9'));function EmailImap(_0x1f38b8,_0x29edb0){this[_0xe59a('0xa')]=_0xe59a('0xb');this[_0xe59a('0xc')]=this[_0xe59a('0xd')](_0x1f38b8,_0x29edb0);this[_0xe59a('0x1')]=new Imap(this['account']);this['imap'][_0xe59a('0xe')](_0xe59a('0xf'),this[_0xe59a('0x10')][_0xe59a('0x11')](this));this[_0xe59a('0x1')][_0xe59a('0xe')](_0xe59a('0x12'),this[_0xe59a('0x13')][_0xe59a('0x11')](this));this['imap']['on'](_0xe59a('0x14'),this[_0xe59a('0x15')][_0xe59a('0x11')](this));this['imap'][_0xe59a('0x16')]();}util[_0xe59a('0x17')](EmailImap,EventEmitter);EmailImap[_0xe59a('0x18')]['getAccount']=function(_0x3fd724,_0x3f41f8){var _0x2076f1={'connTimeout':_0x3fd724['connTimeout']?_0x3fd724[_0xe59a('0x19')]*0x3e8:0x2710,'authTimeout':_0x3fd724[_0xe59a('0x1a')]?_0x3fd724['authTimeout']*0x3e8:0x1388};if(_[_0xe59a('0x1b')](_0x3fd724[_0xe59a('0x1c')])){if(_0x3fd724[_0xe59a('0x1d')]){_0x2076f1[_0xe59a('0x1e')]=_0x3fd724[_0xe59a('0x1e')];_0x2076f1[_0xe59a('0x1f')]=_0x3fd724[_0xe59a('0x1f')];}_0x2076f1[_0xe59a('0x20')]=_0x3fd724[_0xe59a('0x20')];_0x2076f1[_0xe59a('0x21')]=_0x3fd724[_0xe59a('0x21')]||0x3e1;if(_0x3fd724[_0xe59a('0x22')]){_0x2076f1[_0xe59a('0x22')]=!![];}else{_0x2076f1[_0xe59a('0x22')]=![];_0x2076f1[_0xe59a('0x23')]=_0xe59a('0x24');}}else{_0x2076f1['user']=_0x3fd724[_0xe59a('0x1e')];_0x2076f1[_0xe59a('0x1f')]=_0x3fd724['password'];_0x2076f1[_0xe59a('0x20')]=utils[_0xe59a('0x25')](_0x3fd724[_0xe59a('0x1c')]);_0x2076f1[_0xe59a('0x21')]=0x3e1;_0x2076f1[_0xe59a('0x22')]=!![];}_0x2076f1['email']=_0x3f41f8||_0x3fd724[_0xe59a('0x1e')]||'anonymous@xcally.com';return _0x2076f1;};EmailImap[_0xe59a('0x18')]['handleReady']=function(){this[_0xe59a('0x1')][_0xe59a('0x26')](this[_0xe59a('0xa')],![],this[_0xe59a('0x27')][_0xe59a('0x11')](this));};EmailImap[_0xe59a('0x18')][_0xe59a('0x27')]=function(_0x31c45d,_0x6f4dff){if(_0x31c45d){this[_0xe59a('0x15')](_0x31c45d,!![]);}else{this[_0xe59a('0x28')]('box',_0x6f4dff);this[_0xe59a('0x29')]();}};EmailImap[_0xe59a('0x18')]['handleCloseBox']=function(_0x184bf6){if(_0x184bf6){this[_0xe59a('0x15')](_0x184bf6,!![]);}else{this['imap'][_0xe59a('0x12')]();}};EmailImap[_0xe59a('0x18')][_0xe59a('0x29')]=function(){this['imap']['search']([_0xe59a('0x2a')],this[_0xe59a('0x2b')][_0xe59a('0x11')](this));};EmailImap[_0xe59a('0x18')][_0xe59a('0x2b')]=function(_0x1491d1,_0x4442ea){if(_0x1491d1){this[_0xe59a('0x15')](_0x1491d1,!![]);}else{if(_0x4442ea['length']){try{var _0xb0e3c3=this['imap'][_0xe59a('0x2c')](_0x4442ea,{'bodies':'','markSeen':!![]});_0xb0e3c3['on']('message',this[_0xe59a('0x2d')]['bind'](this));_0xb0e3c3[_0xe59a('0xe')](_0xe59a('0x14'),this[_0xe59a('0x2e')][_0xe59a('0x11')](this));_0xb0e3c3[_0xe59a('0xe')](_0xe59a('0x12'),this[_0xe59a('0x2f')][_0xe59a('0x11')](this));}catch(_0x262221){logger[_0xe59a('0x14')](_0x262221);}}else{this[_0xe59a('0x1')][_0xe59a('0x30')](!![],this[_0xe59a('0x31')][_0xe59a('0x11')](this));}}};EmailImap[_0xe59a('0x18')][_0xe59a('0x2d')]=function(_0x551e5a,_0x5cf38b){_0x551e5a['on'](_0xe59a('0x32'),this[_0xe59a('0x33')][_0xe59a('0x11')](this));_0x551e5a[_0xe59a('0xe')](_0xe59a('0x34'),this[_0xe59a('0x35')][_0xe59a('0x11')](this));_0x551e5a[_0xe59a('0xe')](_0xe59a('0x12'),this[_0xe59a('0x36')][_0xe59a('0x11')](this));};EmailImap[_0xe59a('0x18')]['handleMessageBody']=function(_0x2ff63c,_0xeae95e){simpleParser(_0x2ff63c,{'Iconv':Iconv},this[_0xe59a('0x37')][_0xe59a('0x11')](this));};EmailImap[_0xe59a('0x18')][_0xe59a('0x35')]=function(_0xe117d){};EmailImap[_0xe59a('0x18')][_0xe59a('0x36')]=function(){};EmailImap['prototype'][_0xe59a('0x37')]=function(_0x88ab7b,_0x7e806b){if(_0x88ab7b){logger[_0xe59a('0x14')](_0x88ab7b);}else{var _0x3be2e4=this;utils[_0xe59a('0x38')](this[_0xe59a('0xc')],_0x7e806b,function(_0x395e81){_0x3be2e4[_0xe59a('0x28')]('email',_0x395e81);});}};EmailImap[_0xe59a('0x18')][_0xe59a('0x2f')]=function(){this[_0xe59a('0x1')]['closeBox'](!![],this[_0xe59a('0x31')][_0xe59a('0x11')](this));};EmailImap['prototype']['handleFetchError']=function(_0x3f5f77){this[_0xe59a('0x15')](_0x3f5f77);this[_0xe59a('0x1')][_0xe59a('0x30')](!![],this[_0xe59a('0x31')][_0xe59a('0x11')](this));};EmailImap[_0xe59a('0x18')][_0xe59a('0x13')]=function(){this['emit'](_0xe59a('0x12'));};EmailImap[_0xe59a('0x18')][_0xe59a('0x15')]=function(_0x2f8af6,_0x232afb){logger[_0xe59a('0x14')](_0xe59a('0x15'),this['account'][_0xe59a('0x9')],JSON[_0xe59a('0x39')](_0x2f8af6));var _0x31cf64='';if(_0x2f8af6){if(_0x2f8af6[_0xe59a('0x3a')]){_0x31cf64=_0x2f8af6[_0xe59a('0x3a')];}else{for(var _0x3fe3ef in _0x2f8af6){if(_0x2f8af6[_0xe59a('0x3b')](_0x3fe3ef)){_0x31cf64+=_[_0xe59a('0x3c')](_0x3fe3ef)+':\x20'+_0x2f8af6[_0x3fe3ef]+'\x0a';}}}}if(_0x232afb){this['imap'][_0xe59a('0x12')]();}else{this[_0xe59a('0x28')](_0xe59a('0x14'),_0x31cf64);this[_0xe59a('0x28')]('end');}};module[_0xe59a('0x3d')]=EmailImap; \ No newline at end of file +var _0x5fc7=['account','getAccount','ready','handleReady','bind','end','handleEnd','error','handleError','prototype','connTimeout','authTimeout','isNil','service','user','host','port','tls','autotls','password','getHost','anonymous@xcally.com','handleOpenBox','box','readUnseen','search','handleReadUnseen','length','fetch','handleFetchMessage','once','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x5fc7[_0x5a9c0c];return _0x53c77d;};'use strict';var fs=require('fs');var path=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var Imap=require(_0x75fc('0x2'));var _=require(_0x75fc('0x3'));var rs=require(_0x75fc('0x4'));var simpleParser=require(_0x75fc('0x5'))[_0x75fc('0x6')];var Iconv=require(_0x75fc('0x7'))[_0x75fc('0x8')];var EventEmitter=require(_0x75fc('0x9'))[_0x75fc('0xa')];var utils=require(_0x75fc('0xb'));var logger=require('../../../config/logger')(_0x75fc('0xc'));function EmailImap(_0xc85b45,_0x1430f3){this[_0x75fc('0xd')]=_0x75fc('0xe');this[_0x75fc('0xf')]=this[_0x75fc('0x10')](_0xc85b45,_0x1430f3);this[_0x75fc('0x2')]=new Imap(this[_0x75fc('0xf')]);this[_0x75fc('0x2')]['once'](_0x75fc('0x11'),this[_0x75fc('0x12')][_0x75fc('0x13')](this));this[_0x75fc('0x2')]['once'](_0x75fc('0x14'),this[_0x75fc('0x15')][_0x75fc('0x13')](this));this[_0x75fc('0x2')]['on'](_0x75fc('0x16'),this[_0x75fc('0x17')][_0x75fc('0x13')](this));this['imap']['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x75fc('0x18')][_0x75fc('0x10')]=function(_0x2e073b,_0x2cb4ed){var _0x2a8725={'connTimeout':_0x2e073b[_0x75fc('0x19')]?_0x2e073b[_0x75fc('0x19')]*0x3e8:0x2710,'authTimeout':_0x2e073b[_0x75fc('0x1a')]?_0x2e073b['authTimeout']*0x3e8:0x1388};if(_[_0x75fc('0x1b')](_0x2e073b[_0x75fc('0x1c')])){if(_0x2e073b['authentication']){_0x2a8725[_0x75fc('0x1d')]=_0x2e073b[_0x75fc('0x1d')];_0x2a8725['password']=_0x2e073b['password'];}_0x2a8725[_0x75fc('0x1e')]=_0x2e073b[_0x75fc('0x1e')];_0x2a8725[_0x75fc('0x1f')]=_0x2e073b[_0x75fc('0x1f')]||0x3e1;if(_0x2e073b[_0x75fc('0x20')]){_0x2a8725[_0x75fc('0x20')]=!![];}else{_0x2a8725['tls']=![];_0x2a8725[_0x75fc('0x21')]='required';}}else{_0x2a8725[_0x75fc('0x1d')]=_0x2e073b[_0x75fc('0x1d')];_0x2a8725[_0x75fc('0x22')]=_0x2e073b[_0x75fc('0x22')];_0x2a8725['host']=utils[_0x75fc('0x23')](_0x2e073b[_0x75fc('0x1c')]);_0x2a8725['port']=0x3e1;_0x2a8725[_0x75fc('0x20')]=!![];}_0x2a8725[_0x75fc('0xc')]=_0x2cb4ed||_0x2e073b['user']||_0x75fc('0x24');return _0x2a8725;};EmailImap['prototype'][_0x75fc('0x12')]=function(){this[_0x75fc('0x2')]['openBox'](this[_0x75fc('0xd')],![],this[_0x75fc('0x25')]['bind'](this));};EmailImap[_0x75fc('0x18')][_0x75fc('0x25')]=function(_0x53fcd2,_0x5774bb){if(_0x53fcd2){this[_0x75fc('0x17')](_0x53fcd2,!![]);}else{this['emit'](_0x75fc('0x26'),_0x5774bb);this[_0x75fc('0x27')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x5dd7a9){if(_0x5dd7a9){this[_0x75fc('0x17')](_0x5dd7a9,!![]);}else{this[_0x75fc('0x2')][_0x75fc('0x14')]();}};EmailImap[_0x75fc('0x18')][_0x75fc('0x27')]=function(){this[_0x75fc('0x2')][_0x75fc('0x28')](['UNSEEN'],this[_0x75fc('0x29')][_0x75fc('0x13')](this));};EmailImap[_0x75fc('0x18')][_0x75fc('0x29')]=function(_0x5c8adb,_0x214b30){if(_0x5c8adb){this['handleError'](_0x5c8adb,!![]);}else{if(_0x214b30[_0x75fc('0x2a')]){try{var _0x337032=this[_0x75fc('0x2')][_0x75fc('0x2b')](_0x214b30,{'bodies':'','markSeen':!![]});_0x337032['on']('message',this[_0x75fc('0x2c')]['bind'](this));_0x337032[_0x75fc('0x2d')](_0x75fc('0x16'),this['handleFetchError'][_0x75fc('0x13')](this));_0x337032[_0x75fc('0x2d')]('end',this[_0x75fc('0x2e')][_0x75fc('0x13')](this));}catch(_0xb50e9f){logger[_0x75fc('0x16')](_0xb50e9f);}}else{this[_0x75fc('0x2')][_0x75fc('0x2f')](!![],this[_0x75fc('0x30')][_0x75fc('0x13')](this));}}};EmailImap['prototype'][_0x75fc('0x2c')]=function(_0x447c13,_0x46dfa2){_0x447c13['on'](_0x75fc('0x31'),this[_0x75fc('0x32')][_0x75fc('0x13')](this));_0x447c13[_0x75fc('0x2d')](_0x75fc('0x33'),this[_0x75fc('0x34')][_0x75fc('0x13')](this));_0x447c13[_0x75fc('0x2d')](_0x75fc('0x14'),this[_0x75fc('0x35')]['bind'](this));};EmailImap[_0x75fc('0x18')][_0x75fc('0x32')]=function(_0x9636fe,_0x19e172){simpleParser(_0x9636fe,{'Iconv':Iconv},this['handleSimpleParser'][_0x75fc('0x13')](this));};EmailImap[_0x75fc('0x18')][_0x75fc('0x34')]=function(_0x10221b){};EmailImap[_0x75fc('0x18')][_0x75fc('0x35')]=function(){};EmailImap[_0x75fc('0x18')][_0x75fc('0x36')]=function(_0x5d0fdc,_0x9cd4bd){if(_0x5d0fdc){logger[_0x75fc('0x16')](_0x5d0fdc);}else{var _0x2b7398=this;utils[_0x75fc('0x37')](this[_0x75fc('0xf')],_0x9cd4bd,function(_0x443e1b){_0x2b7398['emit'](_0x75fc('0xc'),_0x443e1b);});}};EmailImap[_0x75fc('0x18')]['handleFetchEnd']=function(){this[_0x75fc('0x2')][_0x75fc('0x2f')](!![],this[_0x75fc('0x30')][_0x75fc('0x13')](this));};EmailImap[_0x75fc('0x18')]['handleFetchError']=function(_0x11434a){this['handleError'](_0x11434a);this[_0x75fc('0x2')][_0x75fc('0x2f')](!![],this[_0x75fc('0x30')][_0x75fc('0x13')](this));};EmailImap[_0x75fc('0x18')][_0x75fc('0x15')]=function(){this[_0x75fc('0x38')](_0x75fc('0x14'));};EmailImap[_0x75fc('0x18')]['handleError']=function(_0x382ca5,_0x3e8ec6){logger[_0x75fc('0x16')](_0x75fc('0x17'),this[_0x75fc('0xf')]['email'],JSON[_0x75fc('0x39')](_0x382ca5));var _0x2e0eab='';if(_0x382ca5){if(_0x382ca5[_0x75fc('0x3a')]){_0x2e0eab=_0x382ca5['textCode'];}else{for(var _0xf0a466 in _0x382ca5){if(_0x382ca5[_0x75fc('0x3b')](_0xf0a466)){_0x2e0eab+=_[_0x75fc('0x3c')](_0xf0a466)+':\x20'+_0x382ca5[_0xf0a466]+'\x0a';}}}}if(_0x3e8ec6){this[_0x75fc('0x2')][_0x75fc('0x14')]();}else{this[_0x75fc('0x38')](_0x75fc('0x16'),_0x2e0eab);this['emit'](_0x75fc('0x14'));}};module[_0x75fc('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 002cce0..01e3462 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 _0x54e5=['exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','send','createTransport','compile','sendMail','toString','prototype','verify','Not\x20verifired'];(function(_0xa24985,_0x1d2c15){var _0x2f7c36=function(_0x28219c){while(--_0x28219c){_0xa24985['push'](_0xa24985['shift']());}};_0x2f7c36(++_0x1d2c15);}(_0x54e5,0xb5));var _0x554e=function(_0x3a508a,_0x358c16){_0x3a508a=_0x3a508a-0x0;var _0x5a8c34=_0x54e5[_0x3a508a];return _0x5a8c34;};'use strict';var nodemailer=require(_0x554e('0x0'));var BPromise=require(_0x554e('0x1'));var inlineBase64=require(_0x554e('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0x554e('0x3')]=function(_0x1904c7,_0x27a8ea){return new BPromise(function(_0x1838c6,_0x359662){var _0x5e967c=nodemailer[_0x554e('0x4')](_0x1904c7);_0x5e967c['use'](_0x554e('0x5'),inlineBase64());_0x5e967c[_0x554e('0x6')](_0x27a8ea,function(_0x194b5b,_0x253591){if(_0x194b5b){_0x359662(_0x194b5b[_0x554e('0x7')]());}else{_0x1838c6(_0x253591);}});});};EmailSmtp[_0x554e('0x8')][_0x554e('0x9')]=function(_0xd016f4){return new BPromise(function(_0x3ccf2b,_0xaa520f){var _0x6796c8=nodemailer[_0x554e('0x4')](_0xd016f4);_0x6796c8[_0x554e('0x9')](function(_0x32725a,_0x2fc5ca){if(_0x32725a){_0xaa520f(_0x32725a[_0x554e('0x7')]());}else{if(_0x2fc5ca){_0x3ccf2b(_0x2fc5ca);}else{_0xaa520f(_0x554e('0xa'));}}});});};module[_0x554e('0xb')]=EmailSmtp; \ No newline at end of file +var _0x6b12=['exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','use','sendMail','toString','createTransport','Not\x20verifired'];(function(_0x16f07d,_0x2ba1b5){var _0x2c3afb=function(_0x4cece0){while(--_0x4cece0){_0x16f07d['push'](_0x16f07d['shift']());}};_0x2c3afb(++_0x2ba1b5);}(_0x6b12,0x1a3));var _0x26b1=function(_0x384229,_0x269e36){_0x384229=_0x384229-0x0;var _0x3141f4=_0x6b12[_0x384229];return _0x3141f4;};'use strict';var nodemailer=require(_0x26b1('0x0'));var BPromise=require(_0x26b1('0x1'));var inlineBase64=require(_0x26b1('0x2'));function EmailSmtp(){}EmailSmtp[_0x26b1('0x3')][_0x26b1('0x4')]=function(_0x4ccde3,_0x18e02d){return new BPromise(function(_0x491a70,_0x422134){var _0x458e1b=nodemailer['createTransport'](_0x4ccde3);_0x458e1b[_0x26b1('0x5')]('compile',inlineBase64());_0x458e1b[_0x26b1('0x6')](_0x18e02d,function(_0x3082bf,_0x56de97){if(_0x3082bf){_0x422134(_0x3082bf[_0x26b1('0x7')]());}else{_0x491a70(_0x56de97);}});});};EmailSmtp['prototype']['verify']=function(_0x135487){return new BPromise(function(_0x555926,_0x2bbbdd){var _0x1eb10f=nodemailer[_0x26b1('0x8')](_0x135487);_0x1eb10f['verify'](function(_0x3fc14c,_0xe871d5){if(_0x3fc14c){_0x2bbbdd(_0x3fc14c[_0x26b1('0x7')]());}else{if(_0xe871d5){_0x555926(_0xe871d5);}else{_0x2bbbdd(_0x26b1('0x9'));}}});});};module[_0x26b1('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 487be38..d15a416 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 _0x2da6=['attach','attachment','format','%s-%s','now','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','parser','from','inReplyTo','date','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','pop','html','test','replace','includes','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','isEmpty','originCc','bcc','attachments'];(function(_0x4ec3f5,_0xc094e4){var _0x3729f2=function(_0x10f411){while(--_0x10f411){_0x4ec3f5['push'](_0x4ec3f5['shift']());}};_0x3729f2(++_0xc094e4);}(_0x2da6,0x1dd));var _0x62da=function(_0x225b7a,_0x453611){_0x225b7a=_0x225b7a-0x0;var _0x480ea8=_0x2da6[_0x225b7a];return _0x480ea8;};'use strict';var _=require(_0x62da('0x0'));var moment=require(_0x62da('0x1'));var random=require(_0x62da('0x2'));var fs=require('fs');var path=require(_0x62da('0x3'));var util=require(_0x62da('0x4'));var tnef=require(_0x62da('0x5'));var logger=require(_0x62da('0x6'))(_0x62da('0x7'));var config=require('../../../config/environment');function getAddress(_0x4a8428){var _0xe28204=_[_0x62da('0x8')](_0x4a8428[_0x62da('0x9')]);return _0xe28204&&_0xe28204[_0x62da('0xa')]?_0xe28204[_0x62da('0xa')]:_0x62da('0xb')+random[_0x62da('0xc')](0x6)+_0x62da('0xd');}function getFirstName(_0xbfd2b0){var _0x4cfc5d=_[_0x62da('0x8')](_0xbfd2b0[_0x62da('0x9')]);if(_0x4cfc5d&&_0x4cfc5d[_0x62da('0xe')]){if(_0x4cfc5d[_0x62da('0xe')]==_0x4cfc5d['address']){return _0x4cfc5d[_0x62da('0xe')][_0x62da('0xf')](0x0,_0x4cfc5d[_0x62da('0xe')][_0x62da('0x10')]('@'));}var _0x23be32=_0x4cfc5d['name'][_0x62da('0x11')](/\s+/);return _0x23be32[_0x62da('0x12')]>0x1?_0x23be32[_0x62da('0x13')](0x0,-0x1)[_0x62da('0x14')]('\x20'):_0x4cfc5d[_0x62da('0xe')];}return'Anonymous';}function getLastName(_0x47c18e){var _0x3ed16d=_[_0x62da('0x8')](_0x47c18e[_0x62da('0x9')]);if(_0x3ed16d&&_0x3ed16d[_0x62da('0xe')]){var _0x23240e=_0x3ed16d[_0x62da('0xe')][_0x62da('0x11')](/\s+/);return _0x23240e[_0x62da('0x12')]>0x1?_0x23240e[_0x62da('0x15')]():'';}return'';}function getMails(_0xcc1a25,_0x33ec53){var _0x27ab5f='';for(var _0x1f6bc8=0x0;_0x1f6bc8<_0x33ec53[_0x62da('0x9')]['length'];_0x1f6bc8+=0x1){if(_0x33ec53['value'][_0x1f6bc8][_0x62da('0xa')]!==_0xcc1a25){if(!_['isEmpty'](_0x27ab5f)){_0x27ab5f+=',';}_0x27ab5f+=_0x33ec53[_0x62da('0x9')][_0x1f6bc8][_0x62da('0xe')]||_0x33ec53[_0x62da('0x9')][_0x1f6bc8]['address']||'';_0x27ab5f+='\x20<';_0x27ab5f+=_0x33ec53[_0x62da('0x9')][_0x1f6bc8]['address']?_0x33ec53[_0x62da('0x9')][_0x1f6bc8][_0x62da('0xa')]:_0x62da('0xb')+random[_0x62da('0xc')](0x6)+_0x62da('0xd');_0x27ab5f+='>';}}return _0x27ab5f;}function parseEmail(_0x267cef,_0x183033,_0x2f2b66){if(_0x183033[_0x62da('0x16')]){var _0x583fc0=/)<[^<]*)*<\/script>/gi;while(_0x583fc0[_0x62da('0x17')](_0x183033[_0x62da('0x16')])){_0x183033[_0x62da('0x16')]=_0x183033[_0x62da('0x16')][_0x62da('0x18')](_0x583fc0,'');}if(_0x183033[_0x62da('0x16')][_0x62da('0x19')]('{_0x55fd3b[_0x62da('0x1b')](_0x1d1ef3[_0x62da('0x1c')]);});var _0x4b1237=/]+>/g;var _0x2b7daa=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3b9c06=_0x183033['html'][_0x62da('0x18')](_0x2b7daa,_0x62da('0x1d'));var _0x1775ea=_0x3b9c06['replace'](_0x4b1237,_0x62da('0x1e'));for(let _0x87f92b=0x0;_0x87f92b<_0x55fd3b[_0x62da('0x12')];_0x87f92b++){var _0x54da45=_0x1775ea['replace'](_0x62da('0x1e'),_0x62da('0x1f')+_0x55fd3b[_0x87f92b]+_0x62da('0x20'));_0x1775ea=_0x54da45;}_0x183033['html']=_0x1775ea;}_0x2f2b66[_0x62da('0x21')]=_0x183033[_0x62da('0x16')];}else{_0x2f2b66[_0x62da('0x21')]=_0x183033[_0x62da('0x22')];}if(_0x2f2b66[_0x62da('0x21')]){_0x2f2b66[_0x62da('0x21')]=_0x2f2b66['body'][_0x62da('0x18')](/0x0){var _0x584a82=[_0x62da('0x33'),_0x62da('0x34'),_0x62da('0x35')];for(var _0x4387ac=0x0;_0x4387ac<_0x183033[_0x62da('0x32')][_0x62da('0x12')];_0x4387ac++){var _0x473e5c=_[_0x62da('0x10')](_0x584a82,_0x183033['headerLines'][_0x4387ac]['line']);if(_0x473e5c>=0x0){_0x2f2b66['isAutoreply']=!![];}}}return _0x2f2b66;}exports[_0x62da('0x36')]=function(_0x54b49c,_0x86f5a8,_0x4a8fe4){var _0x49d45b={'from':getAddress(_0x86f5a8['from']),'firstName':getFirstName(_0x86f5a8[_0x62da('0x37')]),'lastName':getLastName(_0x86f5a8[_0x62da('0x37')]),'mapKey':'email','message':{'from':getMails(_0x54b49c[_0x62da('0x7')],_0x86f5a8['from']),'to':_0x54b49c[_0x62da('0x7')],'cc':'','subject':_0x86f5a8['subject']||'','messageId':_0x86f5a8['messageId'],'inReplyTo':_0x86f5a8[_0x62da('0x38')],'sentAt':moment(_0x86f5a8[_0x62da('0x39')])[_0x62da('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x86f5a8[_0x62da('0x16')]&&!_0x86f5a8[_0x62da('0x22')]){var _0xbe8215=_[_0x62da('0x3a')](_0x86f5a8[_0x62da('0x28')],{'contentType':'application/ms-tnef'});if(_0xbe8215['length']){logger[_0x62da('0x3b')](util[_0x62da('0x2b')](_0x62da('0x3c'),_0x86f5a8[_0x62da('0x3d')]));tnef[_0x62da('0x3e')](_['first'](_0xbe8215)['content'],function(_0x1de958,_0xef94be){if(_0xef94be){_0x86f5a8['html']=_0xef94be[_0x62da('0x3f')]||_0x62da('0x40');if(_0xef94be[_0x62da('0x41')]){for(var _0x29153f=0x0;_0x29153f<_0xef94be[_0x62da('0x41')]['length'];_0x29153f++){var _0x349782=_0xef94be[_0x62da('0x41')][_0x29153f];_0x49d45b[_0x62da('0x23')][_0x62da('0x28')][_0x62da('0x1b')]({'filename':_0x349782[_0x62da('0x42')],'content':Buffer[_0x62da('0x37')](_0x349782[_0x62da('0x43')])});}}}_0x4a8fe4(parseEmail(_0x54b49c,_0x86f5a8,_0x49d45b));});}else{_0x86f5a8[_0x62da('0x16')]='

Empty\x20message

';_0x4a8fe4(parseEmail(_0x54b49c,_0x86f5a8,_0x49d45b));}}else{_0x4a8fe4(parseEmail(_0x54b49c,_0x86f5a8,_0x49d45b));}};exports[_0x62da('0x44')]=function(_0x169560){switch(_0x169560){case'gmail':return'imap.gmail.com';case'yahoo':return _0x62da('0x45');case _0x62da('0x46'):return _0x62da('0x47');case'outlook365':return _0x62da('0x48');}return _0x62da('0x49');}; \ No newline at end of file +var _0x553a=['isEmpty','includes','bcc','attach','type','attachment','attachment-','format','%s-%s','now','join','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','moment','path','util','node-tnef','../../../config/environment','head','address','anonymous','generate','value','name','indexOf','split','length','slice','Anonymous','@xcally.com','html','replace','','body','textAsHtml','message','originCc','email'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x553a,0x192));var _0xa553=function(_0x5bb9ac,_0x417c09){_0x5bb9ac=_0x5bb9ac-0x0;var _0x38fd65=_0x553a[_0x5bb9ac];return _0x38fd65;};'use strict';var _=require('lodash');var moment=require(_0xa553('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0xa553('0x1'));var util=require(_0xa553('0x2'));var tnef=require(_0xa553('0x3'));var logger=require('../../../config/logger')('email');var config=require(_0xa553('0x4'));function getAddress(_0x50ecee){var _0x4b0e9b=_[_0xa553('0x5')](_0x50ecee['value']);return _0x4b0e9b&&_0x4b0e9b['address']?_0x4b0e9b[_0xa553('0x6')]:_0xa553('0x7')+random[_0xa553('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x25bbb7){var _0x5f09d8=_[_0xa553('0x5')](_0x25bbb7[_0xa553('0x9')]);if(_0x5f09d8&&_0x5f09d8[_0xa553('0xa')]){if(_0x5f09d8['name']==_0x5f09d8['address']){return _0x5f09d8[_0xa553('0xa')]['substring'](0x0,_0x5f09d8[_0xa553('0xa')][_0xa553('0xb')]('@'));}var _0x137813=_0x5f09d8['name'][_0xa553('0xc')](/\s+/);return _0x137813[_0xa553('0xd')]>0x1?_0x137813[_0xa553('0xe')](0x0,-0x1)['join']('\x20'):_0x5f09d8[_0xa553('0xa')];}return _0xa553('0xf');}function getLastName(_0x39f000){var _0x51df32=_['head'](_0x39f000[_0xa553('0x9')]);if(_0x51df32&&_0x51df32[_0xa553('0xa')]){var _0x14b019=_0x51df32[_0xa553('0xa')]['split'](/\s+/);return _0x14b019[_0xa553('0xd')]>0x1?_0x14b019['pop']():'';}return'';}function getMails(_0xaedbbc,_0x5a1270){var _0x509342='';for(var _0x1d0f4e=0x0;_0x1d0f4e<_0x5a1270['value'][_0xa553('0xd')];_0x1d0f4e+=0x1){if(_0x5a1270[_0xa553('0x9')][_0x1d0f4e][_0xa553('0x6')]!==_0xaedbbc){if(!_['isEmpty'](_0x509342)){_0x509342+=',';}_0x509342+=_0x5a1270[_0xa553('0x9')][_0x1d0f4e][_0xa553('0xa')]||_0x5a1270['value'][_0x1d0f4e][_0xa553('0x6')]||'';_0x509342+='\x20<';_0x509342+=_0x5a1270[_0xa553('0x9')][_0x1d0f4e]['address']?_0x5a1270[_0xa553('0x9')][_0x1d0f4e]['address']:_0xa553('0x7')+random[_0xa553('0x8')](0x6)+_0xa553('0x10');_0x509342+='>';}}return _0x509342;}function parseEmail(_0x238a99,_0x5792b9,_0x3cbbe8){if(_0x5792b9[_0xa553('0x11')]){var _0x137778=/)<[^<]*)*<\/script>/gi;while(_0x137778['test'](_0x5792b9[_0xa553('0x11')])){_0x5792b9['html']=_0x5792b9['html'][_0xa553('0x12')](_0x137778,'');}if(_0x5792b9[_0xa553('0x11')]['includes'](_0xa553('0x13'))){var _0x1c95bd=[];_0x5792b9[_0xa553('0x14')]['forEach'](_0x1d001a=>{_0x1c95bd[_0xa553('0x15')](_0x1d001a[_0xa553('0x16')]);});var _0x7b0d73=/]+>/g;var _0x247ce3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x49a916=_0x5792b9[_0xa553('0x11')][_0xa553('0x12')](_0x247ce3,'_SRC');var _0x5632f1=_0x49a916[_0xa553('0x12')](_0x7b0d73,_0xa553('0x17'));for(let _0x11b61e=0x0;_0x11b61e<_0x1c95bd[_0xa553('0xd')];_0x11b61e++){var _0x5e8e31=_0x5632f1[_0xa553('0x12')](_0xa553('0x17'),'\x20[Attachment:\x20'+_0x1c95bd[_0x11b61e]+_0xa553('0x18'));_0x5632f1=_0x5e8e31;}_0x5792b9[_0xa553('0x11')]=_0x5632f1;}_0x3cbbe8[_0xa553('0x19')]=_0x5792b9[_0xa553('0x11')];}else{_0x3cbbe8[_0xa553('0x19')]=_0x5792b9[_0xa553('0x1a')];}if(_0x3cbbe8[_0xa553('0x19')]){_0x3cbbe8[_0xa553('0x19')]=_0x3cbbe8[_0xa553('0x19')][_0xa553('0x12')](/0x0){var _0x427eb0=[_0xa553('0x2f'),_0xa553('0x30'),_0xa553('0x31')];for(var _0x2669c8=0x0;_0x2669c8<_0x5792b9[_0xa553('0x2e')][_0xa553('0xd')];_0x2669c8++){var _0xfbccf4=_[_0xa553('0xb')](_0x427eb0,_0x5792b9[_0xa553('0x2e')][_0x2669c8][_0xa553('0x32')]);if(_0xfbccf4>=0x0){_0x3cbbe8['isAutoreply']=!![];}}}return _0x3cbbe8;}exports['parser']=function(_0x30c332,_0x503a9d,_0x1a9d97){var _0x4786f0={'from':getAddress(_0x503a9d['from']),'firstName':getFirstName(_0x503a9d[_0xa553('0x33')]),'lastName':getLastName(_0x503a9d[_0xa553('0x33')]),'mapKey':'email','message':{'from':getMails(_0x30c332[_0xa553('0x1d')],_0x503a9d[_0xa553('0x33')]),'to':_0x30c332['email'],'cc':'','subject':_0x503a9d[_0xa553('0x34')]||'','messageId':_0x503a9d[_0xa553('0x35')],'inReplyTo':_0x503a9d['inReplyTo'],'sentAt':moment(_0x503a9d[_0xa553('0x36')])[_0xa553('0x25')](_0xa553('0x37')),'attach':![],'attachments':[]}};if(!_0x503a9d[_0xa553('0x11')]&&!_0x503a9d['textAsHtml']){var _0x149350=_[_0xa553('0x38')](_0x503a9d[_0xa553('0x14')],{'contentType':'application/ms-tnef'});if(_0x149350[_0xa553('0xd')]){logger[_0xa553('0x39')](util[_0xa553('0x25')](_0xa553('0x3a'),_0x503a9d[_0xa553('0x35')]));tnef[_0xa553('0x3b')](_['first'](_0x149350)['content'],function(_0x299883,_0x1f81bf){if(_0x1f81bf){_0x503a9d[_0xa553('0x11')]=_0x1f81bf[_0xa553('0x3c')]||_0xa553('0x3d');if(_0x1f81bf[_0xa553('0x3e')]){for(var _0x1534ac=0x0;_0x1534ac<_0x1f81bf[_0xa553('0x3e')]['length'];_0x1534ac++){var _0xf7ca1d=_0x1f81bf[_0xa553('0x3e')][_0x1534ac];_0x4786f0[_0xa553('0x1b')][_0xa553('0x14')][_0xa553('0x15')]({'filename':_0xf7ca1d[_0xa553('0x3f')],'content':Buffer[_0xa553('0x33')](_0xf7ca1d[_0xa553('0x40')])});}}}_0x1a9d97(parseEmail(_0x30c332,_0x503a9d,_0x4786f0));});}else{_0x503a9d[_0xa553('0x11')]='

Empty\x20message

';_0x1a9d97(parseEmail(_0x30c332,_0x503a9d,_0x4786f0));}}else{_0x1a9d97(parseEmail(_0x30c332,_0x503a9d,_0x4786f0));}};exports[_0xa553('0x41')]=function(_0x1d4678){switch(_0x1d4678){case'gmail':return _0xa553('0x42');case _0xa553('0x43'):return _0xa553('0x44');case'hotmail':return _0xa553('0x45');case _0xa553('0x46'):return _0xa553('0x47');}return'127.0.0.1';}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 610ea24..0f8596e 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 _0x176f=['name','Service','key','SERV','active','Smtp','exports','lodash'];(function(_0x57018e,_0x3a8f5d){var _0x5f0e01=function(_0x5afb58){while(--_0x5afb58){_0x57018e['push'](_0x57018e['shift']());}};_0x5f0e01(++_0x3a8f5d);}(_0x176f,0x157));var _0xf176=function(_0x1b82ef,_0x3dd938){_0x1b82ef=_0x1b82ef-0x0;var _0x58c260=_0x176f[_0x1b82ef];return _0x58c260;};'use strict';var _=require(_0xf176('0x0'));function MailAccount(_0x48526c){this['id']=_0x48526c['id']||0x0;this[_0xf176('0x1')]=_0x48526c['name']||_0xf176('0x2');this[_0xf176('0x3')]=_0x48526c[_0xf176('0x3')]||_0xf176('0x4');this[_0xf176('0x5')]=_0x48526c[_0xf176('0x5')]||![];this['Imap']=_0x48526c['Imap']||[];this[_0xf176('0x6')]=_0x48526c[_0xf176('0x6')]||[];}module[_0xf176('0x7')]=MailAccount; \ No newline at end of file +var _0xc296=['name','key','SERV','active','Imap','Smtp','exports','lodash'];(function(_0x4292cd,_0x327a40){var _0x5e4838=function(_0x2d3786){while(--_0x2d3786){_0x4292cd['push'](_0x4292cd['shift']());}};_0x5e4838(++_0x327a40);}(_0xc296,0x10f));var _0x6c29=function(_0x2dcaf4,_0x16551d){_0x2dcaf4=_0x2dcaf4-0x0;var _0x58e941=_0xc296[_0x2dcaf4];return _0x58e941;};'use strict';var _=require(_0x6c29('0x0'));function MailAccount(_0x3d4a1c){this['id']=_0x3d4a1c['id']||0x0;this[_0x6c29('0x1')]=_0x3d4a1c[_0x6c29('0x1')]||'Service';this[_0x6c29('0x2')]=_0x3d4a1c[_0x6c29('0x2')]||_0x6c29('0x3');this[_0x6c29('0x4')]=_0x3d4a1c[_0x6c29('0x4')]||![];this[_0x6c29('0x5')]=_0x3d4a1c[_0x6c29('0x5')]||[];this[_0x6c29('0x6')]=_0x3d4a1c[_0x6c29('0x6')]||[];}module[_0x6c29('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 6db3e64..75e34b8 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 _0x647e=['prototype','mergeFromDatabase','initMailAccounts','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x2aa1d0,_0x32ea52){var _0x1ed689=function(_0x100edb){while(--_0x100edb){_0x2aa1d0['push'](_0x2aa1d0['shift']());}};_0x1ed689(++_0x32ea52);}(_0x647e,0x1ea));var _0xe647=function(_0x3b6945,_0x2704e7){_0x3b6945=_0x3b6945-0x0;var _0x338c99=_0x647e[_0x3b6945];return _0x338c99;};'use strict';var _=require(_0xe647('0x0'));var MailAccount=require(_0xe647('0x1'));var Realtime=function(){this[_0xe647('0x2')]={};};function freeIsNotKey(_0x352c8a,_0x2223f5,_0xdc265f){var _0x21af42=_[_0xe647('0x3')](_0x352c8a,function(_0x26bd04,_0x465176){return _0x26bd04[_0xdc265f];});for(var _0x33a81f in _0x2223f5){if(_0x2223f5[_0xe647('0x4')](_0x33a81f)){if(!_0x21af42[_0x33a81f]){delete _0x2223f5[_0x33a81f];}}}}Realtime[_0xe647('0x5')][_0xe647('0x6')]=function(_0x49e782,_0x3df2f2){for(var _0x184e86 in _0x3df2f2){if(_0x49e782['hasOwnProperty'](_0x184e86)){_0x49e782[_0x184e86]=_0x3df2f2[_0x184e86];}}};Realtime[_0xe647('0x5')][_0xe647('0x7')]=function(){var _0x49c1a5=this;return function(_0x435968){if(_0x435968){freeIsNotKey(_0x435968,_0x49c1a5[_0xe647('0x2')],'id');for(var _0x363f36=0x0,_0x404f24={},_0x5950a8={};_0x363f36<_0x435968['length'];_0x363f36+=0x1){_0x404f24=_0x435968[_0x363f36];if(_['isUndefined'](_0x49c1a5[_0xe647('0x2')][_0x404f24['id']])){_0x49c1a5[_0xe647('0x2')][_0x404f24['id']]=new MailAccount(_0x404f24);}else{_['merge'](_0x49c1a5[_0xe647('0x2')][_0x404f24['id']],_0x404f24);}}}return _0x49c1a5[_0xe647('0x2')];};};module[_0xe647('0x8')]=Realtime; \ No newline at end of file +var _0x5304=['mergeFromDatabase','initMailAccounts','length','isUndefined','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x1c3e47,_0x3d1b30){var _0x5d7a1b=function(_0x3aecf7){while(--_0x3aecf7){_0x1c3e47['push'](_0x1c3e47['shift']());}};_0x5d7a1b(++_0x3d1b30);}(_0x5304,0xff));var _0x4530=function(_0x5df033,_0x29458b){_0x5df033=_0x5df033-0x0;var _0x445829=_0x5304[_0x5df033];return _0x445829;};'use strict';var _=require('lodash');var MailAccount=require(_0x4530('0x0'));var Realtime=function(){this[_0x4530('0x1')]={};};function freeIsNotKey(_0x1bea4b,_0x1c1e0d,_0x59774e){var _0x1d21b3=_[_0x4530('0x2')](_0x1bea4b,function(_0x5b6aa7,_0x57e1f0){return _0x5b6aa7[_0x59774e];});for(var _0x1b9548 in _0x1c1e0d){if(_0x1c1e0d[_0x4530('0x3')](_0x1b9548)){if(!_0x1d21b3[_0x1b9548]){delete _0x1c1e0d[_0x1b9548];}}}}Realtime[_0x4530('0x4')][_0x4530('0x5')]=function(_0x58b6f3,_0x597d4c){for(var _0x1cfd2e in _0x597d4c){if(_0x58b6f3[_0x4530('0x3')](_0x1cfd2e)){_0x58b6f3[_0x1cfd2e]=_0x597d4c[_0x1cfd2e];}}};Realtime[_0x4530('0x4')][_0x4530('0x6')]=function(){var _0x624b99=this;return function(_0x5e17ab){if(_0x5e17ab){freeIsNotKey(_0x5e17ab,_0x624b99[_0x4530('0x1')],'id');for(var _0x373348=0x0,_0x5ca8c0={},_0x17fd70={};_0x373348<_0x5e17ab[_0x4530('0x7')];_0x373348+=0x1){_0x5ca8c0=_0x5e17ab[_0x373348];if(_[_0x4530('0x8')](_0x624b99['mailAccounts'][_0x5ca8c0['id']])){_0x624b99['mailAccounts'][_0x5ca8c0['id']]=new MailAccount(_0x5ca8c0);}else{_['merge'](_0x624b99[_0x4530('0x1')][_0x5ca8c0['id']],_0x5ca8c0);}}}return _0x624b99[_0x4530('0x1')];};};module[_0x4530('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index b172ac4..d949141 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 _0x7c7f=['key','ListId','Imap','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','name','service','email'];(function(_0x4483c8,_0x21c771){var _0xf5527d=function(_0x1163ca){while(--_0x1163ca){_0x4483c8['push'](_0x4483c8['shift']());}};_0xf5527d(++_0x21c771);}(_0x7c7f,0x163));var _0xf7c7=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x7c7f[_0x2c7618];return _0x5ce3f0;};'use strict';var client=require(_0xf7c7('0x0'));exports[_0xf7c7('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0xf7c7('0x2'),_0xf7c7('0x3'),_0xf7c7('0x4'),'active',_0xf7c7('0x5'),_0xf7c7('0x6'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xf7c7('0x7')},{'model':'MailServerOut','as':'Smtp'}]},'log':_0xf7c7('0x8')});};};exports[_0xf7c7('0x9')]=function(_0x204fa3,_0x1b2bb4){return client[_0xf7c7('0xa')]('NotifyMailAccount',{'account':{'id':_0x204fa3},'body':_0x1b2bb4,'log':_0xf7c7('0xb')});}; \ No newline at end of file +var _0xb5f3=['getMailAccounts','Request','name','service','email','ListId','TemplateId','MailServerIn','Imap','Smtp','getMailAccount','NotifyMailAccount','../client'];(function(_0x470212,_0x1387de){var _0x5083cb=function(_0x3bec27){while(--_0x3bec27){_0x470212['push'](_0x470212['shift']());}};_0x5083cb(++_0x1387de);}(_0xb5f3,0x137));var _0x3b5f=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xb5f3[_0x2f5a22];return _0x326b70;};'use strict';var client=require(_0x3b5f('0x0'));exports[_0x3b5f('0x1')]=function(){return function(){return client[_0x3b5f('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x3b5f('0x3'),_0x3b5f('0x4'),_0x3b5f('0x5'),'active','key',_0x3b5f('0x6'),_0x3b5f('0x7')],'raw':![],'include':[{'model':_0x3b5f('0x8'),'as':_0x3b5f('0x9')},{'model':'MailServerOut','as':_0x3b5f('0xa')}]},'log':_0x3b5f('0xb')});};};exports['notify']=function(_0x2e213c,_0x48597e){return client[_0x3b5f('0x2')](_0x3b5f('0xc'),{'account':{'id':_0x2e213c},'body':_0x48597e,'log':_0x3b5f('0xc')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 30fbddb..8199447 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 _0x34c5=['GetSettings','loginMailFrequency'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x34c5,0x123));var _0x534c=function(_0x1c43c3,_0x121365){_0x1c43c3=_0x1c43c3-0x0;var _0x23be01=_0x34c5[_0x1c43c3];return _0x23be01;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x534c('0x0')]},'log':_0x534c('0x1')});}; \ No newline at end of file +var _0x0ce1=['getSettings','Request','ShowSetting'];(function(_0x474958,_0x32b2c3){var _0x48a8c7=function(_0x3880f3){while(--_0x3880f3){_0x474958['push'](_0x474958['shift']());}};_0x48a8c7(++_0x32b2c3);}(_0x0ce1,0xe1));var _0x10ce=function(_0x2fc917,_0x338d4c){_0x2fc917=_0x2fc917-0x0;var _0x17fa32=_0x0ce1[_0x2fc917];return _0x17fa32;};'use strict';var client=require('../client');exports[_0x10ce('0x0')]=function(){return client[_0x10ce('0x1')](_0x10ce('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 5e07997..d85beb3 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(_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 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 aeb6b1a..40f0dc9 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 _0x84f0=['../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x84f0,0xed));var _0x084f=function(_0x10ae40,_0x445780){_0x10ae40=_0x10ae40-0x0;var _0x259ae6=_0x84f0[_0x10ae40];return _0x259ae6;};'use strict';var _=require(_0x084f('0x0'));var http=require(_0x084f('0x1'));var express=require('express');var sticky=require(_0x084f('0x2'));var Redis=require(_0x084f('0x3'));var config=require(_0x084f('0x4'));var app=express();var server=http[_0x084f('0x5')](app);server[_0x084f('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x084f('0x7')])){var socketio=require(_0x084f('0x8'))(server,{'transports':['websocket','polling']});config[_0x084f('0x9')]=_[_0x084f('0xa')](config[_0x084f('0x9')],{'host':_0x084f('0xb'),'port':0x18eb});socketio[_0x084f('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0x084f('0x9')]),'subClient':new Redis(config[_0x084f('0x9')])}));require(_0x084f('0xd'))[_0x084f('0xe')]();require(_0x084f('0xf'))[_0x084f('0xe')](socketio);require(_0x084f('0x10'))['default'](app);require(_0x084f('0x11'))[_0x084f('0xe')](app);}else{server[_0x084f('0x12')](_0x084f('0x13'),function(){console[_0x084f('0x14')](_0x084f('0x15'),config[_0x084f('0x7')]);});}exports=module[_0x084f('0x16')]=app; \ No newline at end of file +var _0xd2a9=['polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','ioredis','../../config/environment','timeout','port','socket.io','websocket'];(function(_0x5cca5f,_0xc1ed0){var _0x35acb7=function(_0x31bc46){while(--_0x31bc46){_0x5cca5f['push'](_0x5cca5f['shift']());}};_0x35acb7(++_0xc1ed0);}(_0xd2a9,0x87));var _0x9d2a=function(_0x361190,_0x5517e1){_0x361190=_0x361190-0x0;var _0x56efe6=_0xd2a9[_0x361190];return _0x56efe6;};'use strict';var _=require('lodash');var http=require(_0x9d2a('0x0'));var express=require(_0x9d2a('0x1'));var sticky=require(_0x9d2a('0x2'));var Redis=require(_0x9d2a('0x3'));var config=require(_0x9d2a('0x4'));var app=express();var server=http['createServer'](app);server[_0x9d2a('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0x9d2a('0x6')])){var socketio=require(_0x9d2a('0x7'))(server,{'transports':[_0x9d2a('0x8'),_0x9d2a('0x9')]});config[_0x9d2a('0xa')]=_[_0x9d2a('0xb')](config[_0x9d2a('0xa')],{'host':_0x9d2a('0xc'),'port':0x18eb});socketio[_0x9d2a('0xd')](require(_0x9d2a('0xe'))({'pubClient':new Redis(config[_0x9d2a('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x9d2a('0xf'))[_0x9d2a('0x10')]();require('../../config/socketio')['default'](socketio);require(_0x9d2a('0x11'))[_0x9d2a('0x10')](app);require(_0x9d2a('0x12'))[_0x9d2a('0x10')](app);}else{server[_0x9d2a('0x13')](_0x9d2a('0x14'),function(){console[_0x9d2a('0x15')](_0x9d2a('0x16'),config[_0x9d2a('0x6')]);});}exports=module[_0x9d2a('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index b447393..ea57ca1 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 _0x4b16=['rpc','error','message','result','catch','exports','bluebird','routing','client','http','Request','request','debug'];(function(_0x36430f,_0x726529){var _0x45b0e7=function(_0x5c525e){while(--_0x5c525e){_0x36430f['push'](_0x36430f['shift']());}};_0x45b0e7(++_0x726529);}(_0x4b16,0x165));var _0x64b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b16[_0x14add3];return _0x4a174f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x64b1('0x0'));var logger=require('../../config/logger')(_0x64b1('0x1'));var client=jayson[_0x64b1('0x2')][_0x64b1('0x3')]({'port':0x2329});client[_0x64b1('0x4')]=function(_0x5ba5cc,_0x37a517){return new BPromise(function(_0x25ee29,_0x3f692c){return client[_0x64b1('0x5')](_0x5ba5cc,_0x37a517)['then'](function(_0x4c2ba9){logger[_0x64b1('0x6')](_0x64b1('0x7'),_0x64b1('0x1'),_0x5ba5cc,_0x37a517,_0x4c2ba9);if(_0x4c2ba9[_0x64b1('0x8')]){logger[_0x64b1('0x8')]('rpc',_0x64b1('0x1'),_0x5ba5cc,_0x4c2ba9[_0x64b1('0x8')][_0x64b1('0x9')],_0x37a517);return _0x3f692c(_0x4c2ba9['error']['message']);}else{return _0x25ee29(_0x4c2ba9[_0x64b1('0xa')]);}})[_0x64b1('0xb')](function(_0x175e7d){logger[_0x64b1('0x8')]('rpc',_0x64b1('0x1'),_0x5ba5cc,_0x175e7d,_0x37a517);return _0x3f692c(_0x175e7d);});});};module[_0x64b1('0xc')]=client; \ No newline at end of file +var _0x2af6=['routing','client','http','Request','request','then','error','rpc','message','result','catch','exports','jayson/promise','../../config/logger'];(function(_0xf3c348,_0x3e61c7){var _0x2cf48c=function(_0x50ea10){while(--_0x50ea10){_0xf3c348['push'](_0xf3c348['shift']());}};_0x2cf48c(++_0x3e61c7);}(_0x2af6,0x1e8));var _0x62af=function(_0x2cc418,_0x4e7c39){_0x2cc418=_0x2cc418-0x0;var _0x333a37=_0x2af6[_0x2cc418];return _0x333a37;};'use strict';var jayson=require(_0x62af('0x0'));var BPromise=require('bluebird');var logger=require(_0x62af('0x1'))(_0x62af('0x2'));var client=jayson[_0x62af('0x3')][_0x62af('0x4')]({'port':0x2329});client[_0x62af('0x5')]=function(_0x272e2e,_0x59cac0){return new BPromise(function(_0x35e23f,_0x2feb57){return client[_0x62af('0x6')](_0x272e2e,_0x59cac0)[_0x62af('0x7')](function(_0x4abf16){logger['debug']('rpc',_0x62af('0x2'),_0x272e2e,_0x59cac0,_0x4abf16);if(_0x4abf16[_0x62af('0x8')]){logger[_0x62af('0x8')](_0x62af('0x9'),_0x62af('0x2'),_0x272e2e,_0x4abf16['error']['message'],_0x59cac0);return _0x2feb57(_0x4abf16['error'][_0x62af('0xa')]);}else{return _0x35e23f(_0x4abf16[_0x62af('0xb')]);}})[_0x62af('0xc')](function(_0x1485ea){logger[_0x62af('0x8')]('rpc','routing',_0x272e2e,_0x1485ea,_0x59cac0);return _0x2feb57(_0x1485ea);});});};module[_0x62af('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 03189b3..903c2f7 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 _0x4903=['getWhatsappQueues','catch','log','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','initChatQueues','getSmsQueues','initFaxQueues'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x4903,0x1e3));var _0x3490=function(_0x55a42c,_0x5ef7f5){_0x55a42c=_0x55a42c-0x0;var _0x5a8f95=_0x4903[_0x55a42c];return _0x5a8f95;};'use strict';var BPromise=require('bluebird');var server=require(_0x3490('0x0'));var Realtime=require(_0x3490('0x1'));var user=require('./rpc/user');var interval=require(_0x3490('0x2'));var openchannelQueue=require(_0x3490('0x3'));var chatQueue=require(_0x3490('0x4'));var smsQueue=require(_0x3490('0x5'));var mailQueue=require(_0x3490('0x6'));var faxQueue=require(_0x3490('0x7'));var whatsappQueue=require(_0x3490('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x3490('0x9')]()[_0x3490('0xa')](user[_0x3490('0xb')]())[_0x3490('0xa')](realtime[_0x3490('0xc')]())[_0x3490('0xa')](interval['getIntervals']())['then'](realtime[_0x3490('0xd')]())[_0x3490('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x3490('0xa')](realtime['initOpenchannelQueues']())[_0x3490('0xa')](chatQueue['getChatQueues']())[_0x3490('0xa')](realtime[_0x3490('0xe')]())['then'](smsQueue[_0x3490('0xf')]())['then'](realtime['initSmsQueues']())['then'](mailQueue['getMailQueues']())[_0x3490('0xa')](realtime['initMailQueues']())['then'](faxQueue['getFaxQueues']())['then'](realtime[_0x3490('0x10')]())[_0x3490('0xa')](whatsappQueue[_0x3490('0x11')]())[_0x3490('0xa')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x3490('0xa')](function(_0x25a563){return initRealtime();})[_0x3490('0xa')](function(_0x3b722c){return setInterval(initRealtime,0x1388);})[_0x3490('0x12')](function(_0x3fd58c){console[_0x3490('0x13')](_0x3fd58c);});}main(); \ No newline at end of file +var _0x55fd=['getAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve'];(function(_0x2c3c92,_0x1f7932){var _0x5e95a4=function(_0x7da12c){while(--_0x7da12c){_0x2c3c92['push'](_0x2c3c92['shift']());}};_0x5e95a4(++_0x1f7932);}(_0x55fd,0x13b));var _0xd55f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x55fd[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0xd55f('0x0'));var server=require(_0xd55f('0x1'));var Realtime=require('./realtime');var user=require(_0xd55f('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xd55f('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xd55f('0x4'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xd55f('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xd55f('0x6')]()['then'](user[_0xd55f('0x7')]())['then'](realtime['initAgents']())[_0xd55f('0x8')](interval[_0xd55f('0x9')]())[_0xd55f('0x8')](realtime[_0xd55f('0xa')]())[_0xd55f('0x8')](openchannelQueue[_0xd55f('0xb')]())[_0xd55f('0x8')](realtime[_0xd55f('0xc')]())[_0xd55f('0x8')](chatQueue[_0xd55f('0xd')]())[_0xd55f('0x8')](realtime[_0xd55f('0xe')]())['then'](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0xd55f('0x8')](mailQueue[_0xd55f('0xf')]())[_0xd55f('0x8')](realtime['initMailQueues']())[_0xd55f('0x8')](faxQueue[_0xd55f('0x10')]())[_0xd55f('0x8')](realtime[_0xd55f('0x11')]())['then'](whatsappQueue[_0xd55f('0x12')]())['then'](realtime[_0xd55f('0x13')]())[_0xd55f('0x8')](function(){return realtime;});}function main(){return server[_0xd55f('0x14')](realtime)[_0xd55f('0x8')](function(_0x4f5a41){return initRealtime();})[_0xd55f('0x8')](function(_0x40175c){return setInterval(initRealtime,0x1388);})[_0xd55f('0x15')](function(_0x2a33de){console[_0xd55f('0x16')](_0x2a33de);});}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 410af3d..363c764 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 _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x507f9e,_0x308d20){_0x507f9e=_0x507f9e-0x0;var _0x250f7e=_0x1261[_0x507f9e];return _0x250f7e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1261,0x144));var _0x1126=function(_0x422994,_0x99047b){_0x422994=_0x422994-0x0;var _0x43ad8f=_0x1261[_0x422994];return _0x43ad8f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 8b62044..a89c8c1 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 _0xe7c5=['request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x1068b6,_0x3eba53){var _0x490f5c=function(_0x18b149){while(--_0x18b149){_0x1068b6['push'](_0x1068b6['shift']());}};_0x490f5c(++_0x3eba53);}(_0xe7c5,0xce));var _0x5e7c=function(_0x305e72,_0x1f2c2a){_0x305e72=_0x305e72-0x0;var _0x18dcf9=_0xe7c5[_0x305e72];return _0x18dcf9;};'use strict';var BPromise=require(_0x5e7c('0x0'));var jayson=require(_0x5e7c('0x1'));var client=jayson[_0x5e7c('0x2')]['http']({'port':0x232b});function request(_0x5eee7e,_0x232c8e){return new BPromise(function(_0x1452bc,_0x5b1660){return client[_0x5e7c('0x3')](_0x5eee7e,_0x232c8e)[_0x5e7c('0x4')](function(_0x1a59a8){if(_0x1a59a8[_0x5e7c('0x5')]){return _0x5b1660(_0x1a59a8['error'][_0x5e7c('0x6')]);}else{return _0x1452bc(_0x1a59a8[_0x5e7c('0x7')]);}})[_0x5e7c('0x8')](function(_0x50b198){return _0x5b1660(_0x50b198);});});}exports[_0x5e7c('0x9')]=function(_0x8e7e38,_0x4e55fe){return request(_0x5e7c('0xa'),{'account':_0x8e7e38,'message':_0x4e55fe});}; \ No newline at end of file +var _0x34c0=['result','catch','sendMailMessage','jayson/promise','client','http','then','error','message'];(function(_0x334461,_0xe01226){var _0x11a893=function(_0xbb86bb){while(--_0xbb86bb){_0x334461['push'](_0x334461['shift']());}};_0x11a893(++_0xe01226);}(_0x34c0,0x18f));var _0x034c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34c0[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x034c('0x0'));var client=jayson[_0x034c('0x1')][_0x034c('0x2')]({'port':0x232b});function request(_0xa80f73,_0x36060d){return new BPromise(function(_0x1c23f5,_0x4454bd){return client['request'](_0xa80f73,_0x36060d)[_0x034c('0x3')](function(_0x43285b){if(_0x43285b[_0x034c('0x4')]){return _0x4454bd(_0x43285b['error'][_0x034c('0x5')]);}else{return _0x1c23f5(_0x43285b[_0x034c('0x6')]);}})[_0x034c('0x7')](function(_0x42c2eb){return _0x4454bd(_0x42c2eb);});});}exports[_0x034c('0x8')]=function(_0x2f1713,_0x5e141e){return request('SendMail',{'account':_0x2f1713,'message':_0x5e141e});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 152e445..981a1e6 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 _0x74a2=['openchannelCapacity','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','getChannelStatus','Status','StatusTime','toNumber','format','chatStatusTime','faxStatus','smsStatusTime','busy','busyQueue','stringify','emit','user:save','exports','moment','md5','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime'];(function(_0x32d132,_0x7a0a3f){var _0x368635=function(_0x2d4ddb){while(--_0x2d4ddb){_0x32d132['push'](_0x32d132['shift']());}};_0x368635(++_0x7a0a3f);}(_0x74a2,0x1bf));var _0x274a=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x74a2[_0x21af3a];return _0x268a49;};'use strict';var _=require('lodash');var moment=require(_0x274a('0x0'));var md5=require(_0x274a('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x274a('0x2')]=_[_0x274a('0x3')](config[_0x274a('0x2')],{'host':_0x274a('0x4'),'port':0x18eb});var io=require(_0x274a('0x5'))(new Redis(config[_0x274a('0x2')]));function Agent(_0xa5be81){this['id']=_0xa5be81['id']||0x0;this[_0x274a('0x6')]=_0xa5be81[_0x274a('0x6')]||'';this[_0x274a('0x7')]=_0xa5be81[_0x274a('0x7')]||!![];this[_0x274a('0x8')]=_0xa5be81[_0x274a('0x8')]||![];this[_0x274a('0x9')]=_0xa5be81[_0x274a('0x9')]||![];this['mailPause']=_0xa5be81[_0x274a('0xa')]||![];this[_0x274a('0xb')]=_0xa5be81['faxPause']||![];this[_0x274a('0xc')]=_0xa5be81[_0x274a('0xc')]||![];this[_0x274a('0xd')]=_0xa5be81['openchannelPause']||![];this[_0x274a('0xe')]=_0x274a('0xf');this['chatStatusTime']=0x0;this[_0x274a('0x10')]=_0xa5be81['chatCapacity']||0x0;this[_0x274a('0x11')]=0x0;this[_0x274a('0x12')]='unknown';this[_0x274a('0x13')]=0x0;this[_0x274a('0x14')]=_0xa5be81['mailCapacity']||0x0;this[_0x274a('0x15')]=0x0;this['faxStatus']='unknown';this[_0x274a('0x16')]=0x0;this['faxCapacity']=_0xa5be81[_0x274a('0x17')]||0x0;this[_0x274a('0x18')]=0x0;this[_0x274a('0x19')]='unknown';this['smsStatusTime']=0x0;this['smsCapacity']=_0xa5be81[_0x274a('0x1a')]||0x0;this[_0x274a('0x1b')]=0x0;this[_0x274a('0x1c')]=_0x274a('0xf');this[_0x274a('0x1d')]=0x0;this[_0x274a('0x1e')]=_0xa5be81[_0x274a('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x274a('0x1f')]=_0x274a('0xf');this[_0x274a('0x20')]=0x0;this['openchannelCapacity']=_0xa5be81[_0x274a('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this['busyQueue']=undefined;this['md5']='';this[_0x274a('0x22')]();}Agent[_0x274a('0x23')]['getChannelStatus']=function(_0xdeee1b){if(this[_0xdeee1b+_0x274a('0x24')]>0x0){if(this[_0xdeee1b+_0x274a('0x25')]>0x0&&this[_0xdeee1b+_0x274a('0x24')]>=this[_0xdeee1b+_0x274a('0x25')]){return _0x274a('0x26');}else{return _0x274a('0x27');}}else{return _0x274a('0x28');}};Agent['prototype'][_0x274a('0x22')]=function(){var _0x44f84e=[_0x274a('0x29'),_0x274a('0x2a'),'openchannel',_0x274a('0x2b'),_0x274a('0x2c'),_0x274a('0x2d')];for(var _0x22e17a=0x0;_0x22e17a<_0x44f84e['length'];_0x22e17a+=0x1){var _0x1788d6=this[_0x274a('0x2e')](_0x44f84e[_0x22e17a]);if(this[_0x44f84e[_0x22e17a]+_0x274a('0x2f')]!==_0x1788d6){this[_0x44f84e[_0x22e17a]+_0x274a('0x30')]=_[_0x274a('0x31')](moment()[_0x274a('0x32')]('x'));}this[_0x44f84e[_0x22e17a]+_0x274a('0x2f')]=_0x1788d6;}var _0x4f1b1c={'id':this['id'],'name':this[_0x274a('0x6')],'online':this['online'],'voicePause':this[_0x274a('0x8')],'chatPause':this[_0x274a('0x9')],'mailPause':this[_0x274a('0xa')],'smsPause':this[_0x274a('0xc')],'faxPause':this[_0x274a('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x274a('0x33')],'chatCapacity':this[_0x274a('0x10')],'chatCurrentCapacity':this[_0x274a('0x11')],'mailStatus':this[_0x274a('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x274a('0x14')],'mailCurrentCapacity':this[_0x274a('0x15')],'faxStatus':this[_0x274a('0x34')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x274a('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x274a('0x35')],'smsCapacity':this[_0x274a('0x1a')],'smsCurrentCapacity':this[_0x274a('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x274a('0x1d')],'whatsappCapacity':this[_0x274a('0x1e')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x274a('0x1f')],'openchannelStatusTime':this[_0x274a('0x20')],'openchannelCapacity':this[_0x274a('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x274a('0x36')],'busyQueue':this[_0x274a('0x37')]};var _0x3f3839=md5(JSON[_0x274a('0x38')](_0x4f1b1c));if(this[_0x274a('0x1')]!==_0x3f3839){this[_0x274a('0x1')]=_0x3f3839;io[_0x274a('0x39')](_0x274a('0x3a'),_0x4f1b1c);}};module[_0x274a('0x3b')]=Agent; \ No newline at end of file +var _0xb1dc=['stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','chat','fax','sms','whatsapp','length','StatusTime','Status','chatCapacity','faxCurrentCapacity','openchannelCurrentCapacity','busyQueue'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb1dc,0xb7));var _0xcb1d=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xb1dc[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xcb1d('0x0'));var moment=require(_0xcb1d('0x1'));var md5=require(_0xcb1d('0x2'));var Redis=require(_0xcb1d('0x3'));var config=require(_0xcb1d('0x4'));config[_0xcb1d('0x5')]=_[_0xcb1d('0x6')](config[_0xcb1d('0x5')],{'host':_0xcb1d('0x7'),'port':0x18eb});var io=require(_0xcb1d('0x8'))(new Redis(config[_0xcb1d('0x5')]));function Agent(_0x88b451){this['id']=_0x88b451['id']||0x0;this[_0xcb1d('0x9')]=_0x88b451[_0xcb1d('0x9')]||'';this[_0xcb1d('0xa')]=_0x88b451[_0xcb1d('0xa')]||!![];this[_0xcb1d('0xb')]=_0x88b451['voicePause']||![];this[_0xcb1d('0xc')]=_0x88b451[_0xcb1d('0xc')]||![];this[_0xcb1d('0xd')]=_0x88b451[_0xcb1d('0xd')]||![];this[_0xcb1d('0xe')]=_0x88b451[_0xcb1d('0xe')]||![];this['smsPause']=_0x88b451[_0xcb1d('0xf')]||![];this[_0xcb1d('0x10')]=_0x88b451[_0xcb1d('0x10')]||![];this['chatStatus']=_0xcb1d('0x11');this[_0xcb1d('0x12')]=0x0;this['chatCapacity']=_0x88b451['chatCapacity']||0x0;this[_0xcb1d('0x13')]=0x0;this[_0xcb1d('0x14')]=_0xcb1d('0x11');this[_0xcb1d('0x15')]=0x0;this[_0xcb1d('0x16')]=_0x88b451[_0xcb1d('0x16')]||0x0;this[_0xcb1d('0x17')]=0x0;this[_0xcb1d('0x18')]=_0xcb1d('0x11');this[_0xcb1d('0x19')]=0x0;this[_0xcb1d('0x1a')]=_0x88b451[_0xcb1d('0x1a')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xcb1d('0x1b')]='unknown';this[_0xcb1d('0x1c')]=0x0;this[_0xcb1d('0x1d')]=_0x88b451[_0xcb1d('0x1d')]||0x0;this[_0xcb1d('0x1e')]=0x0;this[_0xcb1d('0x1f')]=_0xcb1d('0x11');this[_0xcb1d('0x20')]=0x0;this[_0xcb1d('0x21')]=_0x88b451['whatsappCapacity']||0x0;this[_0xcb1d('0x22')]=0x0;this[_0xcb1d('0x23')]=_0xcb1d('0x11');this[_0xcb1d('0x24')]=0x0;this[_0xcb1d('0x25')]=_0x88b451['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xcb1d('0x26')]=![];this['busyQueue']=undefined;this['md5']='';this[_0xcb1d('0x27')]();}Agent[_0xcb1d('0x28')][_0xcb1d('0x29')]=function(_0x7df727){if(this[_0x7df727+_0xcb1d('0x2a')]>0x0){if(this[_0x7df727+_0xcb1d('0x2b')]>0x0&&this[_0x7df727+_0xcb1d('0x2a')]>=this[_0x7df727+'Capacity']){return _0xcb1d('0x2c');}else{return'working';}}else{return _0xcb1d('0x2d');}};Agent[_0xcb1d('0x28')][_0xcb1d('0x27')]=function(){var _0x22dcc9=['mail',_0xcb1d('0x2e'),'openchannel',_0xcb1d('0x2f'),_0xcb1d('0x30'),_0xcb1d('0x31')];for(var _0x3d610d=0x0;_0x3d610d<_0x22dcc9[_0xcb1d('0x32')];_0x3d610d+=0x1){var _0x56132d=this[_0xcb1d('0x29')](_0x22dcc9[_0x3d610d]);if(this[_0x22dcc9[_0x3d610d]+'Status']!==_0x56132d){this[_0x22dcc9[_0x3d610d]+_0xcb1d('0x33')]=_['toNumber'](moment()['format']('x'));}this[_0x22dcc9[_0x3d610d]+_0xcb1d('0x34')]=_0x56132d;}var _0x3fd39e={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xcb1d('0xb')],'chatPause':this[_0xcb1d('0xc')],'mailPause':this[_0xcb1d('0xd')],'smsPause':this[_0xcb1d('0xf')],'faxPause':this[_0xcb1d('0xe')],'openchannelPause':this[_0xcb1d('0x10')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xcb1d('0x12')],'chatCapacity':this[_0xcb1d('0x35')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xcb1d('0x14')],'mailStatusTime':this[_0xcb1d('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xcb1d('0x18')],'faxStatusTime':this[_0xcb1d('0x19')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xcb1d('0x36')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xcb1d('0x1c')],'smsCapacity':this[_0xcb1d('0x1d')],'smsCurrentCapacity':this[_0xcb1d('0x1e')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xcb1d('0x20')],'whatsappCapacity':this[_0xcb1d('0x21')],'whatsappCurrentCapacity':this[_0xcb1d('0x22')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xcb1d('0x25')],'openchannelCurrentCapacity':this[_0xcb1d('0x37')],'busy':this[_0xcb1d('0x26')],'busyQueue':this[_0xcb1d('0x38')]};var _0x1dc8c4=md5(JSON[_0xcb1d('0x39')](_0x3fd39e));if(this[_0xcb1d('0x2')]!==_0x1dc8c4){this['md5']=_0x1dc8c4;io[_0xcb1d('0x3a')]('user:save',_0x3fd39e);}};module[_0xcb1d('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 315c4ba..9f0ee8b 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 _0xbcb2=['map','loggedIn','paused','length','online','available','waiting','stringify','format','chat:queue:%s','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','updateRealtime','prototype','updateRouting','_rr','mapAgentsId'];(function(_0x34b2f5,_0x5ef505){var _0x3637f4=function(_0x1b698b){while(--_0x1b698b){_0x34b2f5['push'](_0x34b2f5['shift']());}};_0x3637f4(++_0x5ef505);}(_0xbcb2,0xf4));var _0x2bcb=function(_0x52ed8e,_0x4bcc46){_0x52ed8e=_0x52ed8e-0x0;var _0x718686=_0xbcb2[_0x52ed8e];return _0x718686;};'use strict';var _=require('lodash');var md5=require(_0x2bcb('0x0'));var util=require(_0x2bcb('0x1'));var Redis=require(_0x2bcb('0x2'));var config=require(_0x2bcb('0x3'));config['redis']=_[_0x2bcb('0x4')](config[_0x2bcb('0x5')],{'host':_0x2bcb('0x6'),'port':0x18eb});var io=require(_0x2bcb('0x7'))(new Redis(config[_0x2bcb('0x5')]));function ChatQueue(_0x2479ed){this['id']=_0x2479ed['id']||0x0;this[_0x2bcb('0x8')]=_0x2479ed[_0x2bcb('0x8')]||'';this[_0x2bcb('0x9')]=_0x2479ed[_0x2bcb('0x9')]||0xa;this['strategy']=_0x2479ed['strategy']||_0x2bcb('0xa');this[_0x2bcb('0xb')]=_0x2479ed['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0x2bcb('0x0')]='';this['updateRouting']();this[_0x2bcb('0xc')]();}ChatQueue[_0x2bcb('0xd')][_0x2bcb('0xe')]=function(){var _0x41b7a7=this['mapAgentsId'][_0x2bcb('0xf')];this[_0x2bcb('0x10')]=_[_0x2bcb('0x11')](this[_0x2bcb('0xb')],'id');this[_0x2bcb('0x10')]['_rr']=_0x41b7a7;};ChatQueue[_0x2bcb('0xd')][_0x2bcb('0xc')]=function(){this[_0x2bcb('0x12')]=0x0;this[_0x2bcb('0x13')]=0x0;for(var _0x4775bc=0x0;_0x4775bc=0x0?this['available']:0x0;var _0x3fba61={'id':this['id'],'available':this[_0x2bcb('0x16')],'loggedIn':this[_0x2bcb('0x12')],'name':this[_0x2bcb('0x8')],'paused':this[_0x2bcb('0x13')],'waiting':this[_0x2bcb('0x17')]};var _0x4424a1=md5(JSON[_0x2bcb('0x18')](_0x3fba61));if(this['md5']!==_0x4424a1){this[_0x2bcb('0x0')]=_0x4424a1;io['to'](util[_0x2bcb('0x19')](_0x2bcb('0x1a'),_0x3fba61[_0x2bcb('0x8')]))['emit'](_0x2bcb('0x1b'),_0x3fba61);}};module[_0x2bcb('0x1c')]=ChatQueue; \ No newline at end of file +var _0x8093=['defaults','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','online','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0x8093,0x67));var _0x3809=function(_0x513835,_0x93de04){_0x513835=_0x513835-0x0;var _0x567b24=_0x8093[_0x513835];return _0x567b24;};'use strict';var _=require(_0x3809('0x0'));var md5=require(_0x3809('0x1'));var util=require('util');var Redis=require(_0x3809('0x2'));var config=require(_0x3809('0x3'));config[_0x3809('0x4')]=_[_0x3809('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3809('0x4')]));function ChatQueue(_0x18de16){this['id']=_0x18de16['id']||0x0;this[_0x3809('0x6')]=_0x18de16[_0x3809('0x6')]||'';this[_0x3809('0x7')]=_0x18de16[_0x3809('0x7')]||0xa;this['strategy']=_0x18de16[_0x3809('0x8')]||'beepall';this[_0x3809('0x9')]=_0x18de16[_0x3809('0x9')];this[_0x3809('0xa')]={};this['waiting']=0x0;this[_0x3809('0x1')]='';this[_0x3809('0xb')]();this[_0x3809('0xc')]();}ChatQueue['prototype'][_0x3809('0xb')]=function(){var _0x3984e0=this[_0x3809('0xa')][_0x3809('0xd')];this[_0x3809('0xa')]=_['map'](this[_0x3809('0x9')],'id');this[_0x3809('0xa')][_0x3809('0xd')]=_0x3984e0;};ChatQueue[_0x3809('0xe')][_0x3809('0xc')]=function(){this[_0x3809('0xf')]=0x0;this[_0x3809('0x10')]=0x0;for(var _0x364e22=0x0;_0x364e22=0x0?this['available']:0x0;var _0x33146f={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3809('0xf')],'name':this[_0x3809('0x6')],'paused':this[_0x3809('0x10')],'waiting':this[_0x3809('0x14')]};var _0x13cd75=md5(JSON[_0x3809('0x15')](_0x33146f));if(this[_0x3809('0x1')]!==_0x13cd75){this['md5']=_0x13cd75;io['to'](util[_0x3809('0x16')](_0x3809('0x17'),_0x33146f[_0x3809('0x6')]))[_0x3809('0x18')](_0x3809('0x19'),_0x33146f);}};module[_0x3809('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index dbb0072..cf5f90e 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 _0x4ab3=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','ioredis'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x4ab3,0x183));var _0x34ab=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x4ab3[_0x4ca333];return _0x13b2e1;};'use strict';var _=require(_0x34ab('0x0'));var md5=require(_0x34ab('0x1'));var util=require('util');var Redis=require(_0x34ab('0x2'));var config=require('../../../config/environment');config[_0x34ab('0x3')]=_[_0x34ab('0x4')](config[_0x34ab('0x3')],{'host':_0x34ab('0x5'),'port':0x18eb});var io=require(_0x34ab('0x6'))(new Redis(config[_0x34ab('0x3')]));function FaxQueue(_0x2f914b){this['id']=_0x2f914b['id']||0x0;this[_0x34ab('0x7')]=_0x2f914b[_0x34ab('0x7')]||'';this[_0x34ab('0x8')]=_0x2f914b[_0x34ab('0x8')]||0xa;this[_0x34ab('0x9')]=_0x2f914b[_0x34ab('0x9')]||_0x34ab('0xa');this[_0x34ab('0xb')]=_0x2f914b[_0x34ab('0xb')];this[_0x34ab('0xc')]={};this[_0x34ab('0xd')]=0x0;this[_0x34ab('0x1')]='';this[_0x34ab('0xe')]();this[_0x34ab('0xf')]();}FaxQueue[_0x34ab('0x10')][_0x34ab('0xe')]=function(){var _0x10a5e3=this[_0x34ab('0xc')][_0x34ab('0x11')];this[_0x34ab('0xc')]=_[_0x34ab('0x12')](this[_0x34ab('0xb')],'id');this[_0x34ab('0xc')]['_rr']=_0x10a5e3;};FaxQueue[_0x34ab('0x10')][_0x34ab('0xf')]=function(){this[_0x34ab('0x13')]=0x0;this[_0x34ab('0x14')]=0x0;for(var _0x1b6aea=0x0;_0x1b6aea=0x0?this[_0x34ab('0x18')]:0x0;var _0x96775d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x34ab('0x13')],'name':this[_0x34ab('0x7')],'paused':this[_0x34ab('0x14')],'waiting':this['waiting']};var _0x4eb50b=md5(JSON[_0x34ab('0x19')](_0x96775d));if(this[_0x34ab('0x1')]!==_0x4eb50b){this[_0x34ab('0x1')]=_0x4eb50b;io['to'](util[_0x34ab('0x1a')](_0x34ab('0x1b'),_0x96775d[_0x34ab('0x7')]))['emit'](_0x34ab('0x1c'),_0x96775d);}};module[_0x34ab('0x1d')]=FaxQueue; \ No newline at end of file +var _0x5aa0=['Agents','mapAgentsId','md5','updateRouting','prototype','_rr','updateRealtime','length','online','faxPause','paused','loggedIn','available','waiting','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x5aa0,0x1b7));var _0x05aa=function(_0x1e56a4,_0x2f288d){_0x1e56a4=_0x1e56a4-0x0;var _0x5cafe0=_0x5aa0[_0x1e56a4];return _0x5cafe0;};'use strict';var _=require(_0x05aa('0x0'));var md5=require('md5');var util=require(_0x05aa('0x1'));var Redis=require(_0x05aa('0x2'));var config=require(_0x05aa('0x3'));config[_0x05aa('0x4')]=_[_0x05aa('0x5')](config[_0x05aa('0x4')],{'host':_0x05aa('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x05aa('0x4')]));function FaxQueue(_0x1685f3){this['id']=_0x1685f3['id']||0x0;this[_0x05aa('0x7')]=_0x1685f3[_0x05aa('0x7')]||'';this[_0x05aa('0x8')]=_0x1685f3['timeout']||0xa;this[_0x05aa('0x9')]=_0x1685f3[_0x05aa('0x9')]||_0x05aa('0xa');this[_0x05aa('0xb')]=_0x1685f3[_0x05aa('0xb')];this[_0x05aa('0xc')]={};this['waiting']=0x0;this[_0x05aa('0xd')]='';this[_0x05aa('0xe')]();this['updateRealtime']();}FaxQueue[_0x05aa('0xf')]['updateRouting']=function(){var _0x557e41=this[_0x05aa('0xc')][_0x05aa('0x10')];this['mapAgentsId']=_['map'](this[_0x05aa('0xb')],'id');this[_0x05aa('0xc')][_0x05aa('0x10')]=_0x557e41;};FaxQueue['prototype'][_0x05aa('0x11')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4cbd98=0x0;_0x4cbd98=0x0?this[_0x05aa('0x17')]:0x0;var _0x28c69f={'id':this['id'],'available':this[_0x05aa('0x17')],'loggedIn':this[_0x05aa('0x16')],'name':this[_0x05aa('0x7')],'paused':this[_0x05aa('0x15')],'waiting':this[_0x05aa('0x18')]};var _0x41d808=md5(JSON[_0x05aa('0x19')](_0x28c69f));if(this['md5']!==_0x41d808){this[_0x05aa('0xd')]=_0x41d808;io['to'](util[_0x05aa('0x1a')](_0x05aa('0x1b'),_0x28c69f[_0x05aa('0x7')]))['emit'](_0x05aa('0x1c'),_0x28c69f);}};module[_0x05aa('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 523c107..c85bccb 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 _0xb234=['Intervals','exports','name'];(function(_0x353766,_0x2ea6ce){var _0x4450e3=function(_0x590862){while(--_0x590862){_0x353766['push'](_0x353766['shift']());}};_0x4450e3(++_0x2ea6ce);}(_0xb234,0x137));var _0x4b23=function(_0x54b4aa,_0x5cca85){_0x54b4aa=_0x54b4aa-0x0;var _0x104a21=_0xb234[_0x54b4aa];return _0x104a21;};'use strict';function Interval(_0x22de15){this['id']=_0x22de15['id']||0x0;this[_0x4b23('0x0')]=_0x22de15['name']||'';this[_0x4b23('0x1')]=_0x22de15[_0x4b23('0x1')]||{};}module[_0x4b23('0x2')]=Interval; \ No newline at end of file +var _0x783d=['exports','name','Intervals'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x783d,0x97));var _0xd783=function(_0x28e0ff,_0x5bb56c){_0x28e0ff=_0x28e0ff-0x0;var _0x23f7be=_0x783d[_0x28e0ff];return _0x23f7be;};'use strict';function Interval(_0x2e605d){this['id']=_0x2e605d['id']||0x0;this['name']=_0x2e605d[_0xd783('0x0')]||'';this[_0xd783('0x1')]=_0x2e605d[_0xd783('0x1')]||{};}module[_0xd783('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 e7f2edb..fb35d8d 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 _0xef07=['stringify','format','emit','mail_queue:save','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','prototype','map','Agents','_rr','updateRealtime','loggedIn','paused','online','mailPause','available'];(function(_0x325cc3,_0xe3eaf6){var _0x2f4fc4=function(_0x2494ce){while(--_0x2494ce){_0x325cc3['push'](_0x325cc3['shift']());}};_0x2f4fc4(++_0xe3eaf6);}(_0xef07,0xec));var _0x7ef0=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0xef07[_0xcfc44];return _0x307a25;};'use strict';var _=require(_0x7ef0('0x0'));var md5=require(_0x7ef0('0x1'));var util=require(_0x7ef0('0x2'));var Redis=require(_0x7ef0('0x3'));var config=require('../../../config/environment');config[_0x7ef0('0x4')]=_[_0x7ef0('0x5')](config['redis'],{'host':_0x7ef0('0x6'),'port':0x18eb});var io=require(_0x7ef0('0x7'))(new Redis(config[_0x7ef0('0x4')]));function MailQueue(_0x8acc13){this['id']=_0x8acc13['id']||0x0;this[_0x7ef0('0x8')]=_0x8acc13[_0x7ef0('0x8')]||'';this[_0x7ef0('0x9')]=_0x8acc13[_0x7ef0('0x9')]||0xa;this['strategy']=_0x8acc13[_0x7ef0('0xa')]||_0x7ef0('0xb');this['Agents']=_0x8acc13['Agents'];this[_0x7ef0('0xc')]={};this[_0x7ef0('0xd')]=0x0;this[_0x7ef0('0x1')]='';this[_0x7ef0('0xe')]();this['updateRealtime']();}MailQueue[_0x7ef0('0xf')][_0x7ef0('0xe')]=function(){var _0x1f9a8e=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x7ef0('0x10')](this[_0x7ef0('0x11')],'id');this[_0x7ef0('0xc')][_0x7ef0('0x12')]=_0x1f9a8e;};MailQueue[_0x7ef0('0xf')][_0x7ef0('0x13')]=function(){this[_0x7ef0('0x14')]=0x0;this[_0x7ef0('0x15')]=0x0;for(var _0x24d290=0x0;_0x24d290=0x0?this[_0x7ef0('0x18')]:0x0;var _0xd303df={'id':this['id'],'available':this[_0x7ef0('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x7ef0('0x8')],'paused':this['paused'],'waiting':this[_0x7ef0('0xd')]};var _0xec39=md5(JSON[_0x7ef0('0x19')](_0xd303df));if(this['md5']!==_0xec39){this[_0x7ef0('0x1')]=_0xec39;io['to'](util[_0x7ef0('0x1a')]('mail:queue:%s',_0xd303df['name']))[_0x7ef0('0x1b')](_0x7ef0('0x1c'),_0xd303df);}};module['exports']=MailQueue; \ No newline at end of file +var _0x1a9f=['map','loggedIn','paused','length','online','mailPause','available','format','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr'];(function(_0x7b2615,_0x70d3e0){var _0x1ab413=function(_0x2bb167){while(--_0x2bb167){_0x7b2615['push'](_0x7b2615['shift']());}};_0x1ab413(++_0x70d3e0);}(_0x1a9f,0x184));var _0xf1a9=function(_0x26d2a9,_0x154f8b){_0x26d2a9=_0x26d2a9-0x0;var _0x5d31f1=_0x1a9f[_0x26d2a9];return _0x5d31f1;};'use strict';var _=require(_0xf1a9('0x0'));var md5=require(_0xf1a9('0x1'));var util=require(_0xf1a9('0x2'));var Redis=require(_0xf1a9('0x3'));var config=require(_0xf1a9('0x4'));config[_0xf1a9('0x5')]=_[_0xf1a9('0x6')](config[_0xf1a9('0x5')],{'host':_0xf1a9('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf1a9('0x5')]));function MailQueue(_0x14e668){this['id']=_0x14e668['id']||0x0;this[_0xf1a9('0x8')]=_0x14e668[_0xf1a9('0x8')]||'';this[_0xf1a9('0x9')]=_0x14e668[_0xf1a9('0x9')]||0xa;this[_0xf1a9('0xa')]=_0x14e668[_0xf1a9('0xa')]||_0xf1a9('0xb');this[_0xf1a9('0xc')]=_0x14e668['Agents'];this[_0xf1a9('0xd')]={};this['waiting']=0x0;this[_0xf1a9('0x1')]='';this[_0xf1a9('0xe')]();this['updateRealtime']();}MailQueue[_0xf1a9('0xf')][_0xf1a9('0xe')]=function(){var _0x2ece5d=this[_0xf1a9('0xd')][_0xf1a9('0x10')];this['mapAgentsId']=_[_0xf1a9('0x11')](this[_0xf1a9('0xc')],'id');this[_0xf1a9('0xd')]['_rr']=_0x2ece5d;};MailQueue[_0xf1a9('0xf')]['updateRealtime']=function(){this[_0xf1a9('0x12')]=0x0;this[_0xf1a9('0x13')]=0x0;for(var _0x4029=0x0;_0x4029=0x0?this[_0xf1a9('0x17')]:0x0;var _0x28fb11={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xf1a9('0x8')],'paused':this[_0xf1a9('0x13')],'waiting':this['waiting']};var _0xaa42cf=md5(JSON['stringify'](_0x28fb11));if(this[_0xf1a9('0x1')]!==_0xaa42cf){this[_0xf1a9('0x1')]=_0xaa42cf;io['to'](util[_0xf1a9('0x18')]('mail:queue:%s',_0x28fb11['name']))[_0xf1a9('0x19')]('mail_queue:save',_0x28fb11);}};module[_0xf1a9('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index f11c5f3..7f762b2 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x34d3fd,_0x318265){var _0x4730c8=function(_0x5e9006){while(--_0x5e9006){_0x34d3fd['push'](_0x34d3fd['shift']());}};_0x4730c8(++_0x318265);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0x5fc3[_0xd9f102];return _0x2652e4;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x1261,0x144));var _0x1126=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x1261[_0xb875ee];return _0x4c7f3a;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 0c48767..cb530d0 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 _0x6f0d=['waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','smsPause','available','format','sms:queue:%s','emit','sms_queue:save','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x262ff6,_0x158799){var _0x4c9b82=function(_0x2d854d){while(--_0x2d854d){_0x262ff6['push'](_0x262ff6['shift']());}};_0x4c9b82(++_0x158799);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x5a8e13,_0x3dad1b){_0x5a8e13=_0x5a8e13-0x0;var _0x407095=_0x6f0d[_0x5a8e13];return _0x407095;};'use strict';var _=require('lodash');var md5=require(_0xd6f0('0x0'));var util=require(_0xd6f0('0x1'));var Redis=require(_0xd6f0('0x2'));var config=require(_0xd6f0('0x3'));config['redis']=_[_0xd6f0('0x4')](config[_0xd6f0('0x5')],{'host':_0xd6f0('0x6'),'port':0x18eb});var io=require(_0xd6f0('0x7'))(new Redis(config[_0xd6f0('0x5')]));function SmsQueue(_0x59f5d2){this['id']=_0x59f5d2['id']||0x0;this[_0xd6f0('0x8')]=_0x59f5d2['name']||'';this[_0xd6f0('0x9')]=_0x59f5d2[_0xd6f0('0x9')]||0xa;this[_0xd6f0('0xa')]=_0x59f5d2[_0xd6f0('0xa')]||'beepall';this['Agents']=_0x59f5d2[_0xd6f0('0xb')];this[_0xd6f0('0xc')]={};this[_0xd6f0('0xd')]=0x0;this[_0xd6f0('0x0')]='';this[_0xd6f0('0xe')]();this['updateRealtime']();}SmsQueue[_0xd6f0('0xf')][_0xd6f0('0xe')]=function(){var _0x329f69=this[_0xd6f0('0xc')]['_rr'];this[_0xd6f0('0xc')]=_[_0xd6f0('0x10')](this[_0xd6f0('0xb')],'id');this[_0xd6f0('0xc')][_0xd6f0('0x11')]=_0x329f69;};SmsQueue[_0xd6f0('0xf')][_0xd6f0('0x12')]=function(){this[_0xd6f0('0x13')]=0x0;this[_0xd6f0('0x14')]=0x0;for(var _0x4ab979=0x0;_0x4ab979=0x0?this[_0xd6f0('0x18')]:0x0;var _0x1862a9={'id':this['id'],'available':this[_0xd6f0('0x18')],'loggedIn':this[_0xd6f0('0x13')],'name':this[_0xd6f0('0x8')],'paused':this[_0xd6f0('0x14')],'waiting':this[_0xd6f0('0xd')]};var _0xde87d4=md5(JSON['stringify'](_0x1862a9));if(this['md5']!==_0xde87d4){this[_0xd6f0('0x0')]=_0xde87d4;io['to'](util[_0xd6f0('0x19')](_0xd6f0('0x1a'),_0x1862a9['name']))[_0xd6f0('0x1b')](_0xd6f0('0x1c'),_0x1862a9);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xa631=['sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','redis','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','available','name','stringify','format'];(function(_0x2f0f52,_0x1b6426){var _0x2e0086=function(_0xf9002b){while(--_0xf9002b){_0x2f0f52['push'](_0x2f0f52['shift']());}};_0x2e0086(++_0x1b6426);}(_0xa631,0xe4));var _0x1a63=function(_0x161d3c,_0xce464e){_0x161d3c=_0x161d3c-0x0;var _0x4410a0=_0xa631[_0x161d3c];return _0x4410a0;};'use strict';var _=require('lodash');var md5=require(_0x1a63('0x0'));var util=require(_0x1a63('0x1'));var Redis=require(_0x1a63('0x2'));var config=require('../../../config/environment');config[_0x1a63('0x3')]=_['defaults'](config['redis'],{'host':_0x1a63('0x4'),'port':0x18eb});var io=require(_0x1a63('0x5'))(new Redis(config[_0x1a63('0x3')]));function SmsQueue(_0x4eed61){this['id']=_0x4eed61['id']||0x0;this['name']=_0x4eed61['name']||'';this['timeout']=_0x4eed61[_0x1a63('0x6')]||0xa;this[_0x1a63('0x7')]=_0x4eed61[_0x1a63('0x7')]||'beepall';this['Agents']=_0x4eed61[_0x1a63('0x8')];this[_0x1a63('0x9')]={};this[_0x1a63('0xa')]=0x0;this[_0x1a63('0x0')]='';this[_0x1a63('0xb')]();this['updateRealtime']();}SmsQueue[_0x1a63('0xc')][_0x1a63('0xb')]=function(){var _0x1899b9=this[_0x1a63('0x9')]['_rr'];this[_0x1a63('0x9')]=_[_0x1a63('0xd')](this[_0x1a63('0x8')],'id');this['mapAgentsId'][_0x1a63('0xe')]=_0x1899b9;};SmsQueue['prototype'][_0x1a63('0xf')]=function(){this[_0x1a63('0x10')]=0x0;this[_0x1a63('0x11')]=0x0;for(var _0x5301b6=0x0;_0x5301b6=0x0?this[_0x1a63('0x14')]:0x0;var _0x24996e={'id':this['id'],'available':this[_0x1a63('0x14')],'loggedIn':this[_0x1a63('0x10')],'name':this[_0x1a63('0x15')],'paused':this[_0x1a63('0x11')],'waiting':this['waiting']};var _0x34ad77=md5(JSON[_0x1a63('0x16')](_0x24996e));if(this['md5']!==_0x34ad77){this[_0x1a63('0x0')]=_0x34ad77;io['to'](util[_0x1a63('0x17')](_0x1a63('0x18'),_0x24996e[_0x1a63('0x15')]))[_0x1a63('0x19')](_0x1a63('0x1a'),_0x24996e);}};module[_0x1a63('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 598cc93..78f0825 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 _0x26a3=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util'];(function(_0x551906,_0x569941){var _0x58bfb6=function(_0x1eb6de){while(--_0x1eb6de){_0x551906['push'](_0x551906['shift']());}};_0x58bfb6(++_0x569941);}(_0x26a3,0x115));var _0x326a=function(_0x5c7eff,_0x5a7cba){_0x5c7eff=_0x5c7eff-0x0;var _0x209ee2=_0x26a3[_0x5c7eff];return _0x209ee2;};'use strict';var _=require(_0x326a('0x0'));var md5=require(_0x326a('0x1'));var util=require(_0x326a('0x2'));var Redis=require('ioredis');var config=require(_0x326a('0x3'));config[_0x326a('0x4')]=_[_0x326a('0x5')](config[_0x326a('0x4')],{'host':_0x326a('0x6'),'port':0x18eb});var io=require(_0x326a('0x7'))(new Redis(config[_0x326a('0x4')]));function WhatsappQueue(_0x36ede6){this['id']=_0x36ede6['id']||0x0;this['name']=_0x36ede6[_0x326a('0x8')]||'';this[_0x326a('0x9')]=_0x36ede6[_0x326a('0x9')]||0xa;this[_0x326a('0xa')]=_0x36ede6[_0x326a('0xa')]||'beepall';this[_0x326a('0xb')]=_0x36ede6[_0x326a('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x326a('0x1')]='';this[_0x326a('0xc')]();this[_0x326a('0xd')]();}WhatsappQueue[_0x326a('0xe')][_0x326a('0xc')]=function(){var _0x47d876=this[_0x326a('0xf')][_0x326a('0x10')];this[_0x326a('0xf')]=_[_0x326a('0x11')](this[_0x326a('0xb')],'id');this[_0x326a('0xf')][_0x326a('0x10')]=_0x47d876;};WhatsappQueue[_0x326a('0xe')][_0x326a('0xd')]=function(){this[_0x326a('0x12')]=0x0;this[_0x326a('0x13')]=0x0;for(var _0x321eee=0x0;_0x321eee=0x0?this['available']:0x0;var _0x4e2edf={'id':this['id'],'available':this[_0x326a('0x16')],'loggedIn':this[_0x326a('0x12')],'name':this['name'],'paused':this[_0x326a('0x13')],'waiting':this['waiting']};var _0x522f38=md5(JSON[_0x326a('0x17')](_0x4e2edf));if(this[_0x326a('0x1')]!==_0x522f38){this[_0x326a('0x1')]=_0x522f38;io['to'](util[_0x326a('0x18')](_0x326a('0x19'),_0x4e2edf[_0x326a('0x8')]))[_0x326a('0x1a')](_0x326a('0x1b'),_0x4e2edf);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x9e1a=['lodash','md5','redis','defaults','localhost','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','whatsappPause','available','stringify','format','whatsapp_queue:save','exports'];(function(_0xc587ed,_0x11cbc2){var _0x41d137=function(_0x2d288f){while(--_0x2d288f){_0xc587ed['push'](_0xc587ed['shift']());}};_0x41d137(++_0x11cbc2);}(_0x9e1a,0x16c));var _0xa9e1=function(_0x26ef48,_0x4576f8){_0x26ef48=_0x26ef48-0x0;var _0x59a138=_0x9e1a[_0x26ef48];return _0x59a138;};'use strict';var _=require(_0xa9e1('0x0'));var md5=require(_0xa9e1('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xa9e1('0x2')]=_[_0xa9e1('0x3')](config['redis'],{'host':_0xa9e1('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa9e1('0x2')]));function WhatsappQueue(_0x26b68d){this['id']=_0x26b68d['id']||0x0;this[_0xa9e1('0x5')]=_0x26b68d[_0xa9e1('0x5')]||'';this[_0xa9e1('0x6')]=_0x26b68d[_0xa9e1('0x6')]||0xa;this['strategy']=_0x26b68d['strategy']||_0xa9e1('0x7');this['Agents']=_0x26b68d[_0xa9e1('0x8')];this[_0xa9e1('0x9')]={};this[_0xa9e1('0xa')]=0x0;this[_0xa9e1('0x1')]='';this[_0xa9e1('0xb')]();this[_0xa9e1('0xc')]();}WhatsappQueue[_0xa9e1('0xd')][_0xa9e1('0xb')]=function(){var _0x17a653=this[_0xa9e1('0x9')][_0xa9e1('0xe')];this[_0xa9e1('0x9')]=_[_0xa9e1('0xf')](this['Agents'],'id');this[_0xa9e1('0x9')]['_rr']=_0x17a653;};WhatsappQueue[_0xa9e1('0xd')][_0xa9e1('0xc')]=function(){this['loggedIn']=0x0;this[_0xa9e1('0x10')]=0x0;for(var _0xe0f76b=0x0;_0xe0f76b=0x0?this[_0xa9e1('0x15')]:0x0;var _0x513e91={'id':this['id'],'available':this[_0xa9e1('0x15')],'loggedIn':this[_0xa9e1('0x13')],'name':this[_0xa9e1('0x5')],'paused':this[_0xa9e1('0x10')],'waiting':this['waiting']};var _0x1f44c7=md5(JSON[_0xa9e1('0x16')](_0x513e91));if(this[_0xa9e1('0x1')]!==_0x1f44c7){this['md5']=_0x1f44c7;io['to'](util[_0xa9e1('0x17')]('whatsapp:queue:%s',_0x513e91[_0xa9e1('0x5')]))['emit'](_0xa9e1('0x18'),_0x513e91);}};module[_0xa9e1('0x19')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index d65743a..f9b9622 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3e219f,_0x38d0c5){var _0x25039f=function(_0x1eb4cc){while(--_0x1eb4cc){_0x3e219f['push'](_0x3e219f['shift']());}};_0x25039f(++_0x38d0c5);}(_0xb10b,0x12a));var _0xbb10=function(_0x39aedf,_0x2f5df8){_0x39aedf=_0x39aedf-0x0;var _0x39356c=_0xb10b[_0x39aedf];return _0x39356c;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 526b4aa..1836df4 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 _0xb273=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction'];(function(_0x5d82b0,_0x5b550e){var _0x4ec4ce=function(_0x338a23){while(--_0x338a23){_0x5d82b0['push'](_0x5d82b0['shift']());}};_0x4ec4ce(++_0x5b550e);}(_0xb273,0xc5));var _0x3b27=function(_0x4abe18,_0x51f0e4){_0x4abe18=_0x4abe18-0x0;var _0x39c8e7=_0xb273[_0x4abe18];return _0x39c8e7;};'use strict';var client=require(_0x3b27('0x0'));exports[_0x3b27('0x1')]=function(_0x15cd87,_0x1bb6a0){return client[_0x3b27('0x2')](_0x3b27('0x3'),{'body':_0x1bb6a0,'options':{'where':{'id':_0x15cd87}},'log':_0x3b27('0x4')});};exports['addTags']=function(_0x30dcdb,_0x4d88e3){return client['Request'](_0x3b27('0x5'),{'body':_0x4d88e3,'options':{'where':{'id':_0x30dcdb}},'log':_0x3b27('0x6')});}; \ No newline at end of file +var _0x5398=['updateChatInteraction','Request','AddTagsToChatInteraction','addTagsToChatInteraction','update'];(function(_0x3457df,_0x94b599){var _0xa2ee6=function(_0x7f55eb){while(--_0x7f55eb){_0x3457df['push'](_0x3457df['shift']());}};_0xa2ee6(++_0x94b599);}(_0x5398,0x135));var _0x8539=function(_0x224d5e,_0x27de6b){_0x224d5e=_0x224d5e-0x0;var _0x4e7c72=_0x5398[_0x224d5e];return _0x4e7c72;};'use strict';var client=require('../client');exports[_0x8539('0x0')]=function(_0x5951bf,_0x1829a3){return client['Request']('UpdateChatInteraction',{'body':_0x1829a3,'options':{'where':{'id':_0x5951bf}},'log':_0x8539('0x1')});};exports['addTags']=function(_0x5d6265,_0x2bf318){return client[_0x8539('0x2')](_0x8539('0x3'),{'body':_0x2bf318,'options':{'where':{'id':_0x5d6265}},'log':_0x8539('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 43f9422..a0b4957 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 _0xcf77=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x2755a0,_0x4b3247){var _0xd48bf3=function(_0x4db61c){while(--_0x4db61c){_0x2755a0['push'](_0x2755a0['shift']());}};_0xd48bf3(++_0x4b3247);}(_0xcf77,0x14f));var _0x7cf7=function(_0x5b3d35,_0x2d660e){_0x5b3d35=_0x5b3d35-0x0;var _0x286618=_0xcf77[_0x5b3d35];return _0x286618;};'use strict';var client=require(_0x7cf7('0x0'));exports[_0x7cf7('0x1')]=function(_0x16271f){return client[_0x7cf7('0x2')](_0x7cf7('0x3'),{'body':_0x16271f,'log':_0x7cf7('0x4')});}; \ No newline at end of file +var _0x4e6b=['createChatMessage','../client','create','Request'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0x4e6b,0xe9));var _0xb4e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4e6b[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0xb4e6('0x0'));exports[_0xb4e6('0x1')]=function(_0x4579e7){return client[_0xb4e6('0x2')]('CreateChatMessage',{'body':_0x4579e7,'log':_0xb4e6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 23413bf..0de3a6c 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 _0xde64=['Agents','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','User'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0xde64,0x17c));var _0x4de6=function(_0x2e02a0,_0x4e440a){_0x2e02a0=_0x2e02a0-0x0;var _0x2b2383=_0xde64[_0x2e02a0];return _0x2b2383;};'use strict';var client=require(_0x4de6('0x0'));exports[_0x4de6('0x1')]=function(){return function(){return client[_0x4de6('0x2')](_0x4de6('0x3'),{'options':{'raw':![],'attributes':['id',_0x4de6('0x4'),_0x4de6('0x5'),'strategy'],'include':[{'model':_0x4de6('0x6'),'as':_0x4de6('0x7'),'attributes':['id','name','online',_0x4de6('0x8')]}]},'log':_0x4de6('0x1')});};}; \ No newline at end of file +var _0x818f=['User','Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x319261,_0x2b165a){var _0x4a5cc9=function(_0x54149b){while(--_0x54149b){_0x319261['push'](_0x319261['shift']());}};_0x4a5cc9(++_0x2b165a);}(_0x818f,0x1da));var _0xf818=function(_0x297cd2,_0x5110cf){_0x297cd2=_0x297cd2-0x0;var _0x4bb84b=_0x818f[_0x297cd2];return _0x4bb84b;};'use strict';var client=require(_0xf818('0x0'));exports[_0xf818('0x1')]=function(){return function(){return client[_0xf818('0x2')](_0xf818('0x3'),{'options':{'raw':![],'attributes':['id',_0xf818('0x4'),_0xf818('0x5'),'strategy'],'include':[{'model':_0xf818('0x6'),'as':_0xf818('0x7'),'attributes':['id',_0xf818('0x4'),_0xf818('0x8'),_0xf818('0x9')]}]},'log':_0xf818('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 7133302..e3365c7 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 _0x1666=['CreateChatQueueReport','update','UpdateChatQueueReport','../client','create','Request'];(function(_0x32f966,_0x2dbb2f){var _0x17534d=function(_0x1de21f){while(--_0x1de21f){_0x32f966['push'](_0x32f966['shift']());}};_0x17534d(++_0x2dbb2f);}(_0x1666,0x75));var _0x6166=function(_0x9c9a2c,_0x2a6bff){_0x9c9a2c=_0x9c9a2c-0x0;var _0x408421=_0x1666[_0x9c9a2c];return _0x408421;};'use strict';var client=require(_0x6166('0x0'));exports[_0x6166('0x1')]=function(_0x4f60ad){return client[_0x6166('0x2')](_0x6166('0x3'),{'body':_0x4f60ad,'log':_0x6166('0x3')});};exports[_0x6166('0x4')]=function(_0x364bba,_0x15afdd){return client[_0x6166('0x2')](_0x6166('0x5'),{'body':_0x15afdd,'options':{'where':{'uniqueid':_0x364bba},'order':[['id','DESC']],'limit':0x1},'log':_0x6166('0x5')});}; \ No newline at end of file +var _0x25a3=['DESC','../client','create','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x25e95a,_0x2efe4a){var _0x2b35e8=function(_0x1cd36a){while(--_0x1cd36a){_0x25e95a['push'](_0x25e95a['shift']());}};_0x2b35e8(++_0x2efe4a);}(_0x25a3,0x121));var _0x325a=function(_0x5b670d,_0x4e6d01){_0x5b670d=_0x5b670d-0x0;var _0x32c35b=_0x25a3[_0x5b670d];return _0x32c35b;};'use strict';var client=require(_0x325a('0x0'));exports[_0x325a('0x1')]=function(_0x236732){return client['Request'](_0x325a('0x2'),{'body':_0x236732,'log':'CreateChatQueueReport'});};exports[_0x325a('0x3')]=function(_0x3b887a,_0x1f6e3d){return client['Request'](_0x325a('0x4'),{'body':_0x1f6e3d,'options':{'where':{'uniqueid':_0x3b887a},'order':[['id',_0x325a('0x5')]],'limit':0x1},'log':_0x325a('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index ecea2a7..b0fb545 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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1c8b26,_0x2b1211){var _0x52e32b=function(_0x340ebb){while(--_0x340ebb){_0x1c8b26['push'](_0x1c8b26['shift']());}};_0x52e32b(++_0x2b1211);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1c8fdc,_0x4210b1){var _0x39e241=function(_0x1c1faf){while(--_0x1c1faf){_0x1c8fdc['push'](_0x1c8fdc['shift']());}};_0x39e241(++_0x4210b1);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 2e90a63..0328a18 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 _0x1939=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x4ce8a4,_0x40c3aa){var _0x4200bb=function(_0x225fe9){while(--_0x225fe9){_0x4ce8a4['push'](_0x4ce8a4['shift']());}};_0x4200bb(++_0x40c3aa);}(_0x1939,0x17d));var _0x9193=function(_0x5e3cef,_0x3c57f5){_0x5e3cef=_0x5e3cef-0x0;var _0x34c370=_0x1939[_0x5e3cef];return _0x34c370;};'use strict';var client=require('../client');exports[_0x9193('0x0')]=function(_0x853ca3){return client[_0x9193('0x1')](_0x9193('0x2'),{'body':_0x853ca3,'log':_0x9193('0x3')});}; \ No newline at end of file +var _0x89b5=['CreateFaxMessage','create','Request'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x89b5,0x19f));var _0x589b=function(_0x46c68e,_0x21809c){_0x46c68e=_0x46c68e-0x0;var _0xa759d6=_0x89b5[_0x46c68e];return _0xa759d6;};'use strict';var client=require('../client');exports[_0x589b('0x0')]=function(_0x4ce2f0){return client[_0x589b('0x1')](_0x589b('0x2'),{'body':_0x4ce2f0,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index c3fd058..ade2ea1 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 _0x798a=['name','online','getFaxQueues','../client','timeout','User','Agents'];(function(_0x175488,_0x28aecf){var _0x3d698f=function(_0x415f48){while(--_0x415f48){_0x175488['push'](_0x175488['shift']());}};_0x3d698f(++_0x28aecf);}(_0x798a,0xb2));var _0xa798=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x798a[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0xa798('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0xa798('0x1'),'strategy'],'include':[{'model':_0xa798('0x2'),'as':_0xa798('0x3'),'attributes':['id',_0xa798('0x4'),_0xa798('0x5'),'faxPause']}]},'log':_0xa798('0x6')});};}; \ No newline at end of file +var _0x5bd4=['getFaxQueues','timeout','strategy','User','Agents','name','faxPause','../client'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0x5bd4,0x1ef));var _0x45bd=function(_0x415b1e,_0x5322f8){_0x415b1e=_0x415b1e-0x0;var _0x7e82e=_0x5bd4[_0x415b1e];return _0x7e82e;};'use strict';var client=require(_0x45bd('0x0'));exports[_0x45bd('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x45bd('0x2'),_0x45bd('0x3')],'include':[{'model':_0x45bd('0x4'),'as':_0x45bd('0x5'),'attributes':['id',_0x45bd('0x6'),'online',_0x45bd('0x7')]}]},'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 9f4837e..d388dc5 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 _0xe13d=['update','DESC','UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport'];(function(_0x30e05a,_0x23f2c9){var _0x17fffd=function(_0x504831){while(--_0x504831){_0x30e05a['push'](_0x30e05a['shift']());}};_0x17fffd(++_0x23f2c9);}(_0xe13d,0x96));var _0xde13=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xe13d[_0x4fc9e6];return _0x551d28;};'use strict';var client=require(_0xde13('0x0'));exports[_0xde13('0x1')]=function(_0x324f9f){return client[_0xde13('0x2')](_0xde13('0x3'),{'body':_0x324f9f,'log':_0xde13('0x3')});};exports[_0xde13('0x4')]=function(_0x363f9b,_0x1a3943){return client[_0xde13('0x2')]('UpdateFaxQueueReport',{'body':_0x1a3943,'options':{'where':{'uniqueid':_0x363f9b},'order':[['id',_0xde13('0x5')]],'limit':0x1},'log':_0xde13('0x6')});}; \ No newline at end of file +var _0x856e=['update','UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x613566,_0x143ab4){var _0x518a69=function(_0x62e65e){while(--_0x62e65e){_0x613566['push'](_0x613566['shift']());}};_0x518a69(++_0x143ab4);}(_0x856e,0x106));var _0xe856=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0x856e[_0x24392f];return _0x591e33;};'use strict';var client=require(_0xe856('0x0'));exports[_0xe856('0x1')]=function(_0x285106){return client[_0xe856('0x2')](_0xe856('0x3'),{'body':_0x285106,'log':_0xe856('0x3')});};exports[_0xe856('0x4')]=function(_0x546a34,_0x57d367){return client['Request'](_0xe856('0x5'),{'body':_0x57d367,'options':{'where':{'uniqueid':_0x546a34},'order':[['id',_0xe856('0x6')]],'limit':0x1},'log':_0xe856('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e76b8e6..8003e4c 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 _0x54eb=['getIntervals','Request','Interval','Intervals','name','interval','../client'];(function(_0x1efa5c,_0x4deafb){var _0x4f8376=function(_0x132a82){while(--_0x132a82){_0x1efa5c['push'](_0x1efa5c['shift']());}};_0x4f8376(++_0x4deafb);}(_0x54eb,0xae));var _0xb54e=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x54eb[_0x50a0c2];return _0x5ebadd;};'use strict';var client=require(_0xb54e('0x0'));exports[_0xb54e('0x1')]=function(){return function(){return client[_0xb54e('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xb54e('0x3'),'as':_0xb54e('0x4'),'attributes':['id',_0xb54e('0x5'),_0xb54e('0x6')]}]},'log':_0xb54e('0x1')});};}; \ No newline at end of file +var _0xb22c=['GetInterval','name','interval','../client','getIntervals'];(function(_0x3e2a18,_0x3029dd){var _0x6ce6ba=function(_0x585b6a){while(--_0x585b6a){_0x3e2a18['push'](_0x3e2a18['shift']());}};_0x6ce6ba(++_0x3029dd);}(_0xb22c,0x18e));var _0xcb22=function(_0x40c8a2,_0x33c8e0){_0x40c8a2=_0x40c8a2-0x0;var _0x109831=_0xb22c[_0x40c8a2];return _0x109831;};'use strict';var client=require(_0xcb22('0x0'));exports[_0xcb22('0x1')]=function(){return function(){return client['Request'](_0xcb22('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xcb22('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xcb22('0x3'),_0xcb22('0x4')]}]},'log':_0xcb22('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 22b2617..b8f313b 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 _0xbbbc=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xbbbc,0xf6));var _0xcbbb=function(_0xa5aaf9,_0x51c384){_0xa5aaf9=_0xa5aaf9-0x0;var _0x2c05d0=_0xbbbc[_0xa5aaf9];return _0x2c05d0;};'use strict';var client=require(_0xcbbb('0x0'));exports[_0xcbbb('0x1')]=function(_0x4314a8,_0x4538f9){return client[_0xcbbb('0x2')](_0xcbbb('0x3'),{'body':_0x4538f9,'options':{'where':{'id':_0x4314a8}},'log':_0xcbbb('0x4')});};exports['addTags']=function(_0xb1ad23,_0x938376){return client[_0xcbbb('0x2')](_0xcbbb('0x5'),{'body':_0x938376,'options':{'where':{'id':_0xb1ad23}},'log':_0xcbbb('0x6')});}; \ No newline at end of file +var _0x160f=['UpdateMailInteraction','updateMailInteraction','addTags','Request','addTagsToChatInteraction','../client','update'];(function(_0x5cba0e,_0x4fb1a6){var _0x5e1e19=function(_0x76779c){while(--_0x76779c){_0x5cba0e['push'](_0x5cba0e['shift']());}};_0x5e1e19(++_0x4fb1a6);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf160('0x0'));exports[_0xf160('0x1')]=function(_0x2d4cde,_0x2966aa){return client['Request'](_0xf160('0x2'),{'body':_0x2966aa,'options':{'where':{'id':_0x2d4cde}},'log':_0xf160('0x3')});};exports[_0xf160('0x4')]=function(_0x3b2d7b,_0x194331){return client[_0xf160('0x5')]('AddTagsToMailInteraction',{'body':_0x194331,'options':{'where':{'id':_0x3b2d7b}},'log':_0xf160('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 37a94c2..6269c53 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 _0x5de7=['../client','Request'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5de7,0x10a));var _0x75de=function(_0xe42aa5,_0x4fc95a){_0xe42aa5=_0xe42aa5-0x0;var _0x31b93a=_0x5de7[_0xe42aa5];return _0x31b93a;};'use strict';var client=require(_0x75de('0x0'));exports['create']=function(_0x4b4b72){return client[_0x75de('0x1')]('CreateMailMessage',{'body':_0x4b4b72,'log':'createMailMessage'});}; \ No newline at end of file +var _0xf3f1=['../client','create','Request'];(function(_0x145810,_0x23585d){var _0x30fa7d=function(_0x5d7095){while(--_0x5d7095){_0x145810['push'](_0x145810['shift']());}};_0x30fa7d(++_0x23585d);}(_0xf3f1,0x105));var _0x1f3f=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xf3f1[_0x4bacb6];return _0x58c029;};'use strict';var client=require(_0x1f3f('0x0'));exports[_0x1f3f('0x1')]=function(_0x1a7490){return client[_0x1f3f('0x2')]('CreateMailMessage',{'body':_0x1a7490,'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 4c4b923..b8ba5d0 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 _0x6aa1=['User','Agents','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy'];(function(_0x520043,_0x13b217){var _0x455caa=function(_0x1478af){while(--_0x1478af){_0x520043['push'](_0x520043['shift']());}};_0x455caa(++_0x13b217);}(_0x6aa1,0x7b));var _0x16aa=function(_0x3a991e,_0x3c71e8){_0x3a991e=_0x3a991e-0x0;var _0x5acb5d=_0x6aa1[_0x3a991e];return _0x5acb5d;};'use strict';var client=require(_0x16aa('0x0'));exports[_0x16aa('0x1')]=function(){return function(){return client[_0x16aa('0x2')](_0x16aa('0x3'),{'options':{'raw':![],'attributes':['id',_0x16aa('0x4'),_0x16aa('0x5'),_0x16aa('0x6')],'include':[{'model':_0x16aa('0x7'),'as':_0x16aa('0x8'),'attributes':['id','name','online',_0x16aa('0x9')]}]},'log':_0x16aa('0x1')});};}; \ No newline at end of file +var _0x0ee2=['User','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','strategy'];(function(_0x130aee,_0x5efdac){var _0x452dcc=function(_0x2a4a7d){while(--_0x2a4a7d){_0x130aee['push'](_0x130aee['shift']());}};_0x452dcc(++_0x5efdac);}(_0x0ee2,0x90));var _0x20ee=function(_0x562eb5,_0x2c086c){_0x562eb5=_0x562eb5-0x0;var _0x190e9f=_0x0ee2[_0x562eb5];return _0x190e9f;};'use strict';var client=require(_0x20ee('0x0'));exports[_0x20ee('0x1')]=function(){return function(){return client[_0x20ee('0x2')](_0x20ee('0x3'),{'options':{'raw':![],'attributes':['id',_0x20ee('0x4'),'timeout',_0x20ee('0x5')],'include':[{'model':_0x20ee('0x6'),'as':_0x20ee('0x7'),'attributes':['id',_0x20ee('0x4'),_0x20ee('0x8'),_0x20ee('0x9')]}]},'log':_0x20ee('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index bfd5e94..2089d98 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 _0x3d91=['../client','create','Request','CreateMailQueueReport','update','DESC','UpdateMailQueueReport'];(function(_0x1fed51,_0x59685b){var _0x17b840=function(_0x2a5524){while(--_0x2a5524){_0x1fed51['push'](_0x1fed51['shift']());}};_0x17b840(++_0x59685b);}(_0x3d91,0x157));var _0x13d9=function(_0x561bd8,_0x2458de){_0x561bd8=_0x561bd8-0x0;var _0x355db5=_0x3d91[_0x561bd8];return _0x355db5;};'use strict';var client=require(_0x13d9('0x0'));exports[_0x13d9('0x1')]=function(_0x44850c){return client[_0x13d9('0x2')](_0x13d9('0x3'),{'body':_0x44850c,'log':_0x13d9('0x3')});};exports[_0x13d9('0x4')]=function(_0x441999,_0xfa00a1){return client[_0x13d9('0x2')]('UpdateMailQueueReport',{'body':_0xfa00a1,'options':{'where':{'uniqueid':_0x441999},'order':[['id',_0x13d9('0x5')]],'limit':0x1},'log':_0x13d9('0x6')});}; \ No newline at end of file +var _0xb44e=['CreateMailQueueReport','UpdateMailQueueReport','DESC','../client','Request'];(function(_0xf2437e,_0x30249d){var _0x3153cd=function(_0x5dcb9a){while(--_0x5dcb9a){_0xf2437e['push'](_0xf2437e['shift']());}};_0x3153cd(++_0x30249d);}(_0xb44e,0xf8));var _0xeb44=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xb44e[_0x16de68];return _0x1c277e;};'use strict';var client=require(_0xeb44('0x0'));exports['create']=function(_0x83583){return client[_0xeb44('0x1')](_0xeb44('0x2'),{'body':_0x83583,'log':_0xeb44('0x2')});};exports['update']=function(_0x515f03,_0x30788f){return client['Request'](_0xeb44('0x3'),{'body':_0x30788f,'options':{'where':{'uniqueid':_0x515f03},'order':[['id',_0xeb44('0x4')]],'limit':0x1},'log':_0xeb44('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 88202e1..565174d 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 _0x50df=['AddTagsToOpenchannelInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x50df,0x166));var _0xf50d=function(_0x43b73c,_0x39d0d1){_0x43b73c=_0x43b73c-0x0;var _0x50fe88=_0x50df[_0x43b73c];return _0x50fe88;};'use strict';var client=require(_0xf50d('0x0'));exports[_0xf50d('0x1')]=function(_0x39ecc9,_0x44782a){return client[_0xf50d('0x2')](_0xf50d('0x3'),{'body':_0x44782a,'options':{'where':{'id':_0x39ecc9}},'log':_0xf50d('0x4')});};exports[_0xf50d('0x5')]=function(_0xcaa20f,_0x893196){return client[_0xf50d('0x2')](_0xf50d('0x6'),{'body':_0x893196,'options':{'where':{'id':_0xcaa20f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x300b=['addTags','AddTagsToOpenchannelInteraction','../client','update','Request','updateOpenchannelInteraction'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x300b,0x170));var _0xb300=function(_0x8a6e9d,_0x159c88){_0x8a6e9d=_0x8a6e9d-0x0;var _0x171a68=_0x300b[_0x8a6e9d];return _0x171a68;};'use strict';var client=require(_0xb300('0x0'));exports[_0xb300('0x1')]=function(_0x11fe2b,_0x48d335){return client[_0xb300('0x2')]('UpdateOpenchannelInteraction',{'body':_0x48d335,'options':{'where':{'id':_0x11fe2b}},'log':_0xb300('0x3')});};exports[_0xb300('0x4')]=function(_0x662d5a,_0x47c81a){return client[_0xb300('0x2')](_0xb300('0x5'),{'body':_0x47c81a,'options':{'where':{'id':_0x662d5a}},'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 d006d17..1d894b7 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 _0x7859=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x141abb,_0x1549b9){var _0x160ed0=function(_0x1d5577){while(--_0x1d5577){_0x141abb['push'](_0x141abb['shift']());}};_0x160ed0(++_0x1549b9);}(_0x7859,0x15e));var _0x9785=function(_0xc54d94,_0x2a96fd){_0xc54d94=_0xc54d94-0x0;var _0x333e1c=_0x7859[_0xc54d94];return _0x333e1c;};'use strict';var client=require(_0x9785('0x0'));exports[_0x9785('0x1')]=function(_0x31852c){return client[_0x9785('0x2')](_0x9785('0x3'),{'body':_0x31852c,'log':_0x9785('0x4')});}; \ No newline at end of file +var _0x1a42=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x5d347a,_0x13c656){var _0x2eee8b=function(_0x27d50f){while(--_0x27d50f){_0x5d347a['push'](_0x5d347a['shift']());}};_0x2eee8b(++_0x13c656);}(_0x1a42,0x180));var _0x21a4=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x1a42[_0x4605dc];return _0x5d3e81;};'use strict';var client=require(_0x21a4('0x0'));exports[_0x21a4('0x1')]=function(_0x1c1be3){return client[_0x21a4('0x2')](_0x21a4('0x3'),{'body':_0x1c1be3,'log':_0x21a4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index c99c100..859b2b1 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 _0xc577=['getOpenchannelQueues','../client','GetOpenchannelQueue','name','timeout','strategy','User','Agents','openchannelPause'];(function(_0x1c42ba,_0xdb48db){var _0x542bd6=function(_0x2d47d6){while(--_0x2d47d6){_0x1c42ba['push'](_0x1c42ba['shift']());}};_0x542bd6(++_0xdb48db);}(_0xc577,0x172));var _0x7c57=function(_0x163691,_0x3d10c4){_0x163691=_0x163691-0x0;var _0x543ae5=_0xc577[_0x163691];return _0x543ae5;};'use strict';var client=require(_0x7c57('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x7c57('0x1'),{'options':{'raw':![],'attributes':['id',_0x7c57('0x2'),_0x7c57('0x3'),_0x7c57('0x4')],'include':[{'model':_0x7c57('0x5'),'as':_0x7c57('0x6'),'attributes':['id',_0x7c57('0x2'),'online',_0x7c57('0x7')]}]},'log':_0x7c57('0x8')});};}; \ No newline at end of file +var _0x102a=['online','../client','getOpenchannelQueues','Request','name','timeout','User','Agents'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x102a,0x109));var _0xa102=function(_0xfe2b32,_0x120d82){_0xfe2b32=_0xfe2b32-0x0;var _0x29a157=_0x102a[_0xfe2b32];return _0x29a157;};'use strict';var client=require(_0xa102('0x0'));exports[_0xa102('0x1')]=function(){return function(){return client[_0xa102('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xa102('0x3'),_0xa102('0x4'),'strategy'],'include':[{'model':_0xa102('0x5'),'as':_0xa102('0x6'),'attributes':['id','name',_0xa102('0x7'),'openchannelPause']}]},'log':_0xa102('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 01f2b73..63c2eb8 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 _0x8ee5=['Request','CreateOpenchannelQueueReport','update','../client','create'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0x8ee5,0xbc));var _0x58ee=function(_0x7cf397,_0x26f1a4){_0x7cf397=_0x7cf397-0x0;var _0x4b5f6c=_0x8ee5[_0x7cf397];return _0x4b5f6c;};'use strict';var client=require(_0x58ee('0x0'));exports[_0x58ee('0x1')]=function(_0x234af7){return client[_0x58ee('0x2')](_0x58ee('0x3'),{'body':_0x234af7,'log':_0x58ee('0x3')});};exports[_0x58ee('0x4')]=function(_0x555b62,_0x203950){return client[_0x58ee('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x203950,'options':{'where':{'uniqueid':_0x555b62},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x25c2=['Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client'];(function(_0x3aa513,_0xbfbc63){var _0x2219c6=function(_0x4047ba){while(--_0x4047ba){_0x3aa513['push'](_0x3aa513['shift']());}};_0x2219c6(++_0xbfbc63);}(_0x25c2,0xdd));var _0x225c=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x25c2[_0x349367];return _0x14179b;};'use strict';var client=require(_0x225c('0x0'));exports['create']=function(_0xbe7f12){return client[_0x225c('0x1')]('CreateOpenchannelQueueReport',{'body':_0xbe7f12,'log':_0x225c('0x2')});};exports[_0x225c('0x3')]=function(_0x49fe6f,_0x24bca2){return client[_0x225c('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x24bca2,'options':{'where':{'uniqueid':_0x49fe6f},'order':[['id',_0x225c('0x4')]],'limit':0x1},'log':_0x225c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 92aeffd..77648cb 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 _0xaa48=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x12f86a,_0x353c98){var _0x481b4f=function(_0x278587){while(--_0x278587){_0x12f86a['push'](_0x12f86a['shift']());}};_0x481b4f(++_0x353c98);}(_0xaa48,0x15a));var _0x8aa4=function(_0x3c0ac7,_0x5c0bb3){_0x3c0ac7=_0x3c0ac7-0x0;var _0x4fc90a=_0xaa48[_0x3c0ac7];return _0x4fc90a;};'use strict';var client=require(_0x8aa4('0x0'));exports[_0x8aa4('0x1')]=function(_0x2ae309,_0x50d619){return client[_0x8aa4('0x2')](_0x8aa4('0x3'),{'body':_0x50d619,'options':{'where':{'id':_0x2ae309}},'log':_0x8aa4('0x4')});};exports[_0x8aa4('0x5')]=function(_0x229357,_0x1005db){return client[_0x8aa4('0x2')](_0x8aa4('0x6'),{'body':_0x1005db,'options':{'where':{'id':_0x229357}},'log':_0x8aa4('0x7')});}; \ No newline at end of file +var _0xdf70=['addTags','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x2e650d,_0x58436b){var _0x582488=function(_0x136231){while(--_0x136231){_0x2e650d['push'](_0x2e650d['shift']());}};_0x582488(++_0x58436b);}(_0xdf70,0x86));var _0x0df7=function(_0x1e3c6e,_0x21da32){_0x1e3c6e=_0x1e3c6e-0x0;var _0xa34dcf=_0xdf70[_0x1e3c6e];return _0xa34dcf;};'use strict';var client=require(_0x0df7('0x0'));exports[_0x0df7('0x1')]=function(_0x97711f,_0x54fb87){return client[_0x0df7('0x2')](_0x0df7('0x3'),{'body':_0x54fb87,'options':{'where':{'id':_0x97711f}},'log':'updateSmsInteraction'});};exports[_0x0df7('0x4')]=function(_0x4ae128,_0x278b96){return client[_0x0df7('0x2')]('AddTagsToSmsInteraction',{'body':_0x278b96,'options':{'where':{'id':_0x4ae128}},'log':_0x0df7('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 42889c4..facf01e 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 _0xaa79=['CreateSmsMessage','createSmsMessage','../client','Request'];(function(_0x2e0021,_0x53b876){var _0x35ac07=function(_0x4d6fdf){while(--_0x4d6fdf){_0x2e0021['push'](_0x2e0021['shift']());}};_0x35ac07(++_0x53b876);}(_0xaa79,0x16e));var _0x9aa7=function(_0x5494e8,_0x54c5ed){_0x5494e8=_0x5494e8-0x0;var _0x57b727=_0xaa79[_0x5494e8];return _0x57b727;};'use strict';var client=require(_0x9aa7('0x0'));exports['create']=function(_0xaa8e73){return client[_0x9aa7('0x1')](_0x9aa7('0x2'),{'body':_0xaa8e73,'log':_0x9aa7('0x3')});}; \ No newline at end of file +var _0xe141=['CreateSmsMessage','../client','create','Request'];(function(_0x5418b4,_0x32c24e){var _0x6d93b4=function(_0x170f45){while(--_0x170f45){_0x5418b4['push'](_0x5418b4['shift']());}};_0x6d93b4(++_0x32c24e);}(_0xe141,0xfd));var _0x1e14=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0xe141[_0x5a7e3c];return _0x59252b;};'use strict';var client=require(_0x1e14('0x0'));exports[_0x1e14('0x1')]=function(_0x49b1d0){return client[_0x1e14('0x2')](_0x1e14('0x3'),{'body':_0x49b1d0,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 1d5de08..0922a0d 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 _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x4b1dcb,_0x13f405){var _0x4b994d=function(_0x14bc0b){while(--_0x14bc0b){_0x4b1dcb['push'](_0x4b1dcb['shift']());}};_0x4b994d(++_0x13f405);}(_0xe706,0xa3));var _0x6e70=function(_0x5ab951,_0x2513ca){_0x5ab951=_0x5ab951-0x0;var _0x1e4abd=_0xe706[_0x5ab951];return _0x1e4abd;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x4641f0,_0x4f315b){var _0x308ddc=function(_0x2bd265){while(--_0x2bd265){_0x4641f0['push'](_0x4641f0['shift']());}};_0x308ddc(++_0x4f315b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index e27f3a0..2bdd2ce 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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0xedd9,0xfc));var _0x9edd=function(_0x1c80b4,_0x183d93){_0x1c80b4=_0x1c80b4-0x0;var _0x2bcc18=_0xedd9[_0x1c80b4];return _0x2bcc18;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x8eb4eb,_0xa70079){var _0x1ff8e3=function(_0x1e118e){while(--_0x1e118e){_0x8eb4eb['push'](_0x8eb4eb['shift']());}};_0x1ff8e3(++_0xa70079);}(_0x008c,0x188));var _0xc008=function(_0xa4b8e1,_0x49d30b){_0xa4b8e1=_0xa4b8e1-0x0;var _0x507e42=_0x008c[_0xa4b8e1];return _0x507e42;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index d428032..b011efe 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(_0x2d5f34,_0x3be582){var _0x2c234c=function(_0x184b02){while(--_0x184b02){_0x2d5f34['push'](_0x2d5f34['shift']());}};_0x2c234c(++_0x3be582);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x56b389,_0x56a28f){var _0x7cc435=function(_0x3ad2ce){while(--_0x3ad2ce){_0x56b389['push'](_0x56b389['shift']());}};_0x7cc435(++_0x56a28f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 46d0f42..52c6451 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 _0xd046=['update','UpdateWhatsappInteraction','Request'];(function(_0x15e7d8,_0x14b5be){var _0x3be91f=function(_0x287852){while(--_0x287852){_0x15e7d8['push'](_0x15e7d8['shift']());}};_0x3be91f(++_0x14b5be);}(_0xd046,0x129));var _0x6d04=function(_0x22f48f,_0x4dbfa8){_0x22f48f=_0x22f48f-0x0;var _0x5747b0=_0xd046[_0x22f48f];return _0x5747b0;};'use strict';var client=require('../client');exports[_0x6d04('0x0')]=function(_0x1a46d8,_0x32aaa4){return client['Request'](_0x6d04('0x1'),{'body':_0x32aaa4,'options':{'where':{'id':_0x1a46d8}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x33720a,_0x4d2121){return client[_0x6d04('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x4d2121,'options':{'where':{'id':_0x33720a}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x6c45=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x536d70,_0xa88ce3){var _0x455ed3=function(_0xaa6b){while(--_0xaa6b){_0x536d70['push'](_0x536d70['shift']());}};_0x455ed3(++_0xa88ce3);}(_0x6c45,0xb1));var _0x56c4=function(_0x83d81a,_0x499188){_0x83d81a=_0x83d81a-0x0;var _0x33e44e=_0x6c45[_0x83d81a];return _0x33e44e;};'use strict';var client=require(_0x56c4('0x0'));exports[_0x56c4('0x1')]=function(_0x559ee6,_0x2f7ee3){return client[_0x56c4('0x2')](_0x56c4('0x3'),{'body':_0x2f7ee3,'options':{'where':{'id':_0x559ee6}},'log':_0x56c4('0x4')});};exports[_0x56c4('0x5')]=function(_0x18d229,_0x1096ce){return client[_0x56c4('0x2')](_0x56c4('0x6'),{'body':_0x1096ce,'options':{'where':{'id':_0x18d229}},'log':_0x56c4('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index af60426..56cde2f 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 _0xb486=['Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x52b395,_0x1afa64){var _0x55d9d4=function(_0x35614d){while(--_0x35614d){_0x52b395['push'](_0x52b395['shift']());}};_0x55d9d4(++_0x1afa64);}(_0xb486,0x99));var _0x6b48=function(_0x1c81ea,_0x40e45d){_0x1c81ea=_0x1c81ea-0x0;var _0x309c1e=_0xb486[_0x1c81ea];return _0x309c1e;};'use strict';var client=require('../client');exports['create']=function(_0x40ef8d){return client[_0x6b48('0x0')](_0x6b48('0x1'),{'body':_0x40ef8d,'log':_0x6b48('0x2')});}; \ No newline at end of file +var _0x22e4=['Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x393761,_0x1d1138){var _0x2e842f=function(_0x17663c){while(--_0x17663c){_0x393761['push'](_0x393761['shift']());}};_0x2e842f(++_0x1d1138);}(_0x22e4,0x1c7));var _0x422e=function(_0x29d98a,_0x1ff65c){_0x29d98a=_0x29d98a-0x0;var _0x261b15=_0x22e4[_0x29d98a];return _0x261b15;};'use strict';var client=require(_0x422e('0x0'));exports['create']=function(_0x4ac793){return client[_0x422e('0x1')](_0x422e('0x2'),{'body':_0x4ac793,'log':_0x422e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 72f7c57..2c922d4 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 _0x0f93=['../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','User','Agents','name','online','whatsappPause'];(function(_0x36de4f,_0x350d30){var _0x1a91c2=function(_0x475034){while(--_0x475034){_0x36de4f['push'](_0x36de4f['shift']());}};_0x1a91c2(++_0x350d30);}(_0x0f93,0x12c));var _0x30f9=function(_0x421e90,_0x40ff82){_0x421e90=_0x421e90-0x0;var _0xde56d0=_0x0f93[_0x421e90];return _0xde56d0;};'use strict';var client=require(_0x30f9('0x0'));exports[_0x30f9('0x1')]=function(){return function(){return client[_0x30f9('0x2')](_0x30f9('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x30f9('0x4'),'strategy'],'include':[{'model':_0x30f9('0x5'),'as':_0x30f9('0x6'),'attributes':['id',_0x30f9('0x7'),_0x30f9('0x8'),_0x30f9('0x9')]}]},'log':_0x30f9('0x1')});};}; \ No newline at end of file +var _0x6fbb=['GetWhatsappQueue','name','timeout','strategy','User','online','../client','getWhatsappQueues','Request'];(function(_0x339d5e,_0x4a3bcb){var _0x39b51b=function(_0x35a2af){while(--_0x35a2af){_0x339d5e['push'](_0x339d5e['shift']());}};_0x39b51b(++_0x4a3bcb);}(_0x6fbb,0xa8));var _0xb6fb=function(_0x1bc59c,_0x1fbd70){_0x1bc59c=_0x1bc59c-0x0;var _0x4333eb=_0x6fbb[_0x1bc59c];return _0x4333eb;};'use strict';var client=require(_0xb6fb('0x0'));exports[_0xb6fb('0x1')]=function(){return function(){return client[_0xb6fb('0x2')](_0xb6fb('0x3'),{'options':{'raw':![],'attributes':['id',_0xb6fb('0x4'),_0xb6fb('0x5'),_0xb6fb('0x6')],'include':[{'model':_0xb6fb('0x7'),'as':'Agents','attributes':['id','name',_0xb6fb('0x8'),'whatsappPause']}]},'log':_0xb6fb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index aaefbac..258f4f7 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 _0xee9b=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create'];(function(_0x5e632d,_0x2d3b59){var _0x5253cc=function(_0x45b0cf){while(--_0x45b0cf){_0x5e632d['push'](_0x5e632d['shift']());}};_0x5253cc(++_0x2d3b59);}(_0xee9b,0x12a));var _0xbee9=function(_0x3db0dc,_0x2fb362){_0x3db0dc=_0x3db0dc-0x0;var _0xcdbf0c=_0xee9b[_0x3db0dc];return _0xcdbf0c;};'use strict';var client=require(_0xbee9('0x0'));exports[_0xbee9('0x1')]=function(_0xac4ec2){return client[_0xbee9('0x2')]('CreateWhatsappQueueReport',{'body':_0xac4ec2,'log':_0xbee9('0x3')});};exports[_0xbee9('0x4')]=function(_0x2b7f22,_0x33be4e){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x33be4e,'options':{'where':{'uniqueid':_0x2b7f22},'order':[['id','DESC']],'limit':0x1},'log':_0xbee9('0x5')});}; \ No newline at end of file +var _0xf03a=['UpdateWhatsappQueueReport','../client','Request','CreateWhatsappQueueReport','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf03a,0x19b));var _0xaf03=function(_0x4780c2,_0x570b81){_0x4780c2=_0x4780c2-0x0;var _0x3967b9=_0xf03a[_0x4780c2];return _0x3967b9;};'use strict';var client=require(_0xaf03('0x0'));exports['create']=function(_0x187f39){return client[_0xaf03('0x1')](_0xaf03('0x2'),{'body':_0x187f39,'log':_0xaf03('0x2')});};exports[_0xaf03('0x3')]=function(_0x2c4df9,_0x26c5ce){return client[_0xaf03('0x1')](_0xaf03('0x4'),{'body':_0x26c5ce,'options':{'where':{'uniqueid':_0x2c4df9},'order':[['id','DESC']],'limit':0x1},'log':_0xaf03('0x4')});}; \ 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 61fb8cf..dbe732c 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 _0x751a=['close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','validate','util','seq-queue','../../../../config/logger','string','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED'];(function(_0x300768,_0x515b0c){var _0x27bb75=function(_0x3b25c7){while(--_0x3b25c7){_0x300768['push'](_0x300768['shift']());}};_0x27bb75(++_0x515b0c);}(_0x751a,0x1e7));var _0xa751=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0x751a[_0x335271];return _0xa9fff8;};'use strict';var schema=require(_0xa751('0x0'));var _=require('lodash');var util=require(_0xa751('0x1'));var seqqueue=require(_0xa751('0x2'));var logger=require(_0xa751('0x3'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0xa751('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xa751('0x5'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x28ac75,_0x3b415a,_0x21bc55){return logger[_0xa751('0x6')](util[_0xa751('0x7')](_0xa751('0x8'),_0x28ac75,_0x3b415a[_0xa751('0x9')],_0x21bc55));}function handleFindAgent(_0x3c3079){return function(_0x2b2d64){return _0x2b2d64[_0xa751('0x9')][_0xa751('0xa')]()===_0x3c3079[_0xa751('0xa')]();};}exports[_0xa751('0xb')]=function(_0xf0cbc2,_0x167bcc,_0x2b1f63,_0x5e8a4c){return function(_0x2cc0f0){try{var _0x312cbf={'name':_0x167bcc[0x0],'timeout':_0x167bcc[0x1]};var _0x30a127=queue[_0xa751('0x0')](_0x312cbf,{'typecast':!![]});if(_0x30a127[_0xa751('0xc')]){logger[_0xa751('0xd')](_0xa751('0xe'),_0xf0cbc2,_[_0xa751('0xf')](_0x30a127,'message')[_0xa751('0x10')](',\x20'));_0x2cc0f0[_0xa751('0x11')]();}else{var _0x29eb4b=_['find'](_0x2b1f63['agents'],handleFindAgent(_0x312cbf[_0xa751('0x9')]));if(_0x29eb4b){var _0xa6d241=(_0x312cbf[_0xa751('0x12')]||0xa)*0x3e8;var _0x89d597,_0x14ccf7;var _0x485fb4=seqqueue[_0xa751('0x13')](_0xa6d241);_0x485fb4['id']=_0xf0cbc2;_0x485fb4['atimeout']=_0xa6d241;_0x485fb4['channel']=_0x5e8a4c[_0xa751('0x14')];writeLog(_0xf0cbc2,_0x29eb4b,util['format'](_0xa751('0x15'),_0xa6d241));_0x2b1f63[_0xa751('0x16')][_0xf0cbc2]['on'](_0xa751('0x17'),function(){logger[_0xa751('0x6')](_0xa751('0x18'),_0xf0cbc2);clearTimeout(_0x14ccf7);_0x14ccf7=undefined;_0x485fb4[_0xa751('0x19')]();if(_0x2b1f63[_0xa751('0x16')][_0xf0cbc2]){delete _0x2b1f63['rules'][_0xf0cbc2];}_0x2cc0f0[_0xa751('0x11')]();});_0x2b1f63['rules'][_0xf0cbc2]['on'](_0xa751('0x1a'),function(){if(_0x2b1f63[_0xa751('0x16')][_0xf0cbc2]){delete _0x2b1f63['rules'][_0xf0cbc2];}});_0x14ccf7=setTimeout(function(){logger[_0xa751('0x6')](_0xa751('0x1b'),_0xf0cbc2);clearTimeout(_0x14ccf7);_0x485fb4[_0xa751('0x19')]();_0x2cc0f0[_0xa751('0x1c')]();},_0xa6d241);strategy[_0xa751('0x1d')](_0x485fb4,_0x29eb4b,_0x2b1f63,_0x5e8a4c);}else{logger[_0xa751('0xd')](_0xa751('0x1e'),_0xf0cbc2,_0x312cbf['name']);_0x2cc0f0[_0xa751('0x11')]();}}}catch(_0x129a11){console['log'](_0x129a11);logger['error']('[%s][QUEUE]\x20%s',_0xf0cbc2,_0x129a11[_0xa751('0x1f')]);_0x2cc0f0[_0xa751('0x11')]();}};}; \ No newline at end of file +var _0x9aed=['agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','createQueue','atimeout','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','info','next'];(function(_0x3f6460,_0x3bdb9b){var _0x5d9ac6=function(_0x1ebb5e){while(--_0x1ebb5e){_0x3f6460['push'](_0x3f6460['shift']());}};_0x5d9ac6(++_0x3bdb9b);}(_0x9aed,0xa4));var _0xd9ae=function(_0x5bef75,_0x43a9a){_0x5bef75=_0x5bef75-0x0;var _0x36b977=_0x9aed[_0x5bef75];return _0x36b977;};'use strict';var schema=require(_0xd9ae('0x0'));var _=require(_0xd9ae('0x1'));var util=require(_0xd9ae('0x2'));var seqqueue=require(_0xd9ae('0x3'));var logger=require(_0xd9ae('0x4'))(_0xd9ae('0x5'));var strategy=require(_0xd9ae('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xd9ae('0x7')}});function writeLog(_0x41303d,_0x533f33,_0xaec8b){return logger['info'](util[_0xd9ae('0x8')](_0xd9ae('0x9'),_0x41303d,_0x533f33[_0xd9ae('0xa')],_0xaec8b));}function handleFindAgent(_0x494fe6){return function(_0x514d01){return _0x514d01['name'][_0xd9ae('0xb')]()===_0x494fe6[_0xd9ae('0xb')]();};}exports[_0xd9ae('0xc')]=function(_0x2f8f7b,_0x56ad85,_0x336736,_0x3d3e95){return function(_0x274e3b){try{var _0x416f00={'name':_0x56ad85[0x0],'timeout':_0x56ad85[0x1]};var _0xaf9e8a=queue[_0xd9ae('0x0')](_0x416f00,{'typecast':!![]});if(_0xaf9e8a[_0xd9ae('0xd')]){logger[_0xd9ae('0xe')](_0xd9ae('0xf'),_0x2f8f7b,_[_0xd9ae('0x10')](_0xaf9e8a,_0xd9ae('0x11'))[_0xd9ae('0x12')](',\x20'));_0x274e3b[_0xd9ae('0x13')]();}else{var _0x300378=_['find'](_0x336736['agents'],handleFindAgent(_0x416f00[_0xd9ae('0xa')]));if(_0x300378){var _0x38be49=(_0x416f00['timeout']||0xa)*0x3e8;var _0xbab7ee,_0x4e232f;var _0x5d8764=seqqueue[_0xd9ae('0x14')](_0x38be49);_0x5d8764['id']=_0x2f8f7b;_0x5d8764[_0xd9ae('0x15')]=_0x38be49;_0x5d8764['channel']=_0x3d3e95['channel'];writeLog(_0x2f8f7b,_0x300378,util['format']('START:%s',_0x38be49));_0x336736['rules'][_0x2f8f7b]['on'](_0xd9ae('0x16'),function(){logger['info'](_0xd9ae('0x17'),_0x2f8f7b);clearTimeout(_0x4e232f);_0x4e232f=undefined;_0x5d8764[_0xd9ae('0x18')]();if(_0x336736[_0xd9ae('0x19')][_0x2f8f7b]){delete _0x336736[_0xd9ae('0x19')][_0x2f8f7b];}_0x274e3b[_0xd9ae('0x13')]();});_0x336736[_0xd9ae('0x19')][_0x2f8f7b]['on']('complete',function(){if(_0x336736[_0xd9ae('0x19')][_0x2f8f7b]){delete _0x336736[_0xd9ae('0x19')][_0x2f8f7b];}});_0x4e232f=setTimeout(function(){logger[_0xd9ae('0x1a')]('[%s][AGENT]\x20ROUTING\x20END',_0x2f8f7b);clearTimeout(_0x4e232f);_0x5d8764[_0xd9ae('0x18')]();_0x274e3b[_0xd9ae('0x1b')]();},_0x38be49);strategy[_0xd9ae('0x1c')](_0x5d8764,_0x300378,_0x336736,_0x3d3e95);}else{logger['error'](_0xd9ae('0x1d'),_0x2f8f7b,_0x416f00[_0xd9ae('0xa')]);_0x274e3b['stop']();}}}catch(_0x18aa41){console[_0xd9ae('0x1e')](_0x18aa41);logger['error'](_0xd9ae('0x1f'),_0x2f8f7b,_0x18aa41['stack']);_0x274e3b[_0xd9ae('0x13')]();}};}; \ 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 05bc1f8..4d7bef9 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 _0xb232=['catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','then','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','error','amazonlex','providerResponse','Message','create','Failed','stop'];(function(_0x1b63b5,_0x1f1294){var _0x561ef5=function(_0x42f9b4){while(--_0x42f9b4){_0x1b63b5['push'](_0x1b63b5['shift']());}};_0x561ef5(++_0x1f1294);}(_0xb232,0x15f));var _0x2b23=function(_0xf6aec0,_0x51ffd6){_0xf6aec0=_0xf6aec0-0x0;var _0x59a51b=_0xb232[_0xf6aec0];return _0x59a51b;};'use strict';var _=require(_0x2b23('0x0'));var moment=require(_0x2b23('0x1'));var AWS=require(_0x2b23('0x2'));var utils=require(_0x2b23('0x3'));var logger=require(_0x2b23('0x4'))(_0x2b23('0x5'));var rpc={'chatMessage':require(_0x2b23('0x6')),'openchannelMessage':require(_0x2b23('0x7')),'mailMessage':require(_0x2b23('0x8')),'smsMessage':require(_0x2b23('0x9')),'faxMessage':require(_0x2b23('0xa')),'whatsappMessage':require(_0x2b23('0xb'))};exports['consequence']=function(_0x3d7e6f,_0xf979f1){return function(_0x4d40d1){try{if(!_[_0x2b23('0xc')](this['interaction'][_0x2b23('0xd')])){logger[_0x2b23('0xe')]('[%s][AMAZONLEX]\x20%s',_0x3d7e6f,_0x2b23('0xf'));return _0x4d40d1[_0x2b23('0x10')]();}var _0x58a320={'ContactId':this[_0x2b23('0x11')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2b23('0x12')};if(this[_0x2b23('0x13')]==='sms'||this[_0x2b23('0x13')]===_0x2b23('0x14')){_0x58a320[_0x2b23('0x15')]=this[_0x2b23('0x16')][_0x2b23('0x15')];}var _0x4fdf29=this[_0x2b23('0x13')];if(_0x4fdf29===_0x2b23('0x17')){_0x58a320[_0x2b23('0x18')]=this[_0x2b23('0x19')]['id'];}else{_0x58a320[_[_0x2b23('0x1a')](_0x4fdf29)+_0x2b23('0x1b')]=this[_0x2b23('0x19')]['id'];}_0x58a320[_[_0x2b23('0x1a')](_0x4fdf29)+'InteractionId']=this[_0x2b23('0x16')]['id'];if(this[_0x2b23('0x16')][_0x2b23('0x1c')]){var _0x588f48=_0xf979f1[0x4];if(!_[_0x2b23('0x1d')](_0x588f48)){_0x58a320[_0x2b23('0x1e')]=utils['getMustacheRender'](_0x588f48,this);return rpc[_0x4fdf29+'Message']['create'](_0x58a320)[_0x2b23('0x1f')](function(_0x2ca0e2){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3d7e6f,_0x58a320['body']);})['catch'](function(_0x37218d){logger['error'](_0x2b23('0x20'),_0x3d7e6f,JSON[_0x2b23('0x21')](_0x37218d));})[_0x2b23('0x22')](function(){logger['info'](_0x2b23('0x23'),_0x3d7e6f);_0x4d40d1['stop']();});}else{logger[_0x2b23('0xe')](_0x2b23('0x24'),_0x3d7e6f);_0x4d40d1['stop']();}}else{var _0x29e3ad=this;var _0x6d4bd8=new AWS[(_0x2b23('0x25'))]({'accessKeyId':_0xf979f1[0x0],'secretAccessKey':_0xf979f1[0x1],'region':_0xf979f1[0x2]});var _0x162972={'botAlias':_0x2b23('0x26'),'botName':_0xf979f1[0x3],'inputText':this[_0x2b23('0x27')][_0x2b23('0x1e')],'userId':this['channel']+':'+this[_0x2b23('0x16')]['id'][_0x2b23('0x28')]()};_0x6d4bd8[_0x2b23('0x29')](_0x162972,function(_0x1af5c6,_0x5195d1){if(_0x1af5c6){logger[_0x2b23('0x2a')]('[%s][AMAZONLEX]\x20%s',_0x3d7e6f,_0x1af5c6[_0x2b23('0x27')]);_0x4d40d1[_0x2b23('0x10')]();}else if(_0x5195d1&&_0x5195d1[_0x2b23('0x27')]){_0x29e3ad[_0x2b23('0x1e')][_0x2b23('0x2b')]=_0x5195d1;_0x58a320[_0x2b23('0x1e')]=_0x5195d1[_0x2b23('0x27')];_0x58a320['providerName']=_0x2b23('0x2b');_0x58a320[_0x2b23('0x2c')]=JSON[_0x2b23('0x21')](_0x5195d1);return rpc[_0x4fdf29+_0x2b23('0x2d')][_0x2b23('0x2e')](_0x58a320)[_0x2b23('0x1f')](function(_0x23af22){logger[_0x2b23('0xe')]('[%s][AMAZONLEX]\x20%s',_0x3d7e6f,_0x58a320[_0x2b23('0x1e')]);if(_0x5195d1['dialogState']==_0x2b23('0x2f')){_0x4d40d1[_0x2b23('0x10')]();}else{_0x4d40d1[_0x2b23('0x30')]();}})[_0x2b23('0x31')](function(_0x2a8afe){logger[_0x2b23('0x2a')](_0x2b23('0x20'),_0x3d7e6f,JSON[_0x2b23('0x21')](_0x2a8afe));_0x4d40d1[_0x2b23('0x10')]();});}else{_0x4d40d1[_0x2b23('0x10')]();}});}}catch(_0x5e7c33){logger[_0x2b23('0x2a')](_0x2b23('0x20'),_0x3d7e6f,JSON[_0x2b23('0x21')](_0x5e7c33));_0x4d40d1[_0x2b23('0x30')]();}};}; \ No newline at end of file +var _0xd3f0=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','body','postText','error','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','getMustacheRender','Message','create','catch','stringify','finally'];(function(_0x87c20e,_0x427f12){var _0x285635=function(_0x87b694){while(--_0x87b694){_0x87c20e['push'](_0x87c20e['shift']());}};_0x285635(++_0x427f12);}(_0xd3f0,0x1d9));var _0x0d3f=function(_0xa1445e,_0x12ac58){_0xa1445e=_0xa1445e-0x0;var _0x1b2bef=_0xd3f0[_0xa1445e];return _0x1b2bef;};'use strict';var _=require(_0x0d3f('0x0'));var moment=require(_0x0d3f('0x1'));var AWS=require(_0x0d3f('0x2'));var utils=require(_0x0d3f('0x3'));var logger=require(_0x0d3f('0x4'))(_0x0d3f('0x5'));var rpc={'chatMessage':require(_0x0d3f('0x6')),'openchannelMessage':require(_0x0d3f('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0d3f('0x8')),'faxMessage':require(_0x0d3f('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x4564ba,_0x4d4e4a){return function(_0x43eddd){try{if(!_[_0x0d3f('0xa')](this['interaction'][_0x0d3f('0xb')])){logger[_0x0d3f('0xc')](_0x0d3f('0xd'),_0x4564ba,_0x0d3f('0xe'));return _0x43eddd[_0x0d3f('0xf')]();}var _0x10cb85={'ContactId':this['contact']['id'],'sentAt':moment()[_0x0d3f('0x10')](_0x0d3f('0x11')),'direction':_0x0d3f('0x12')};if(this[_0x0d3f('0x13')]===_0x0d3f('0x14')||this[_0x0d3f('0x13')]===_0x0d3f('0x15')){_0x10cb85[_0x0d3f('0x16')]=this[_0x0d3f('0x17')]['phone'];}var _0x3490fe=this[_0x0d3f('0x13')];if(_0x3490fe===_0x0d3f('0x18')){_0x10cb85[_0x0d3f('0x19')]=this[_0x0d3f('0x1a')]['id'];}else{_0x10cb85[_['upperFirst'](_0x3490fe)+_0x0d3f('0x1b')]=this[_0x0d3f('0x1a')]['id'];}_0x10cb85[_[_0x0d3f('0x1c')](_0x3490fe)+_0x0d3f('0x1d')]=this['interaction']['id'];if(this['interaction']['created']){var _0x1a33fd=_0x4d4e4a[0x4];if(!_[_0x0d3f('0x1e')](_0x1a33fd)){_0x10cb85['body']=utils[_0x0d3f('0x1f')](_0x1a33fd,this);return rpc[_0x3490fe+_0x0d3f('0x20')][_0x0d3f('0x21')](_0x10cb85)['then'](function(_0x7a9e5c){logger[_0x0d3f('0xc')](_0x0d3f('0xd'),_0x4564ba,_0x10cb85['body']);})[_0x0d3f('0x22')](function(_0x2ca707){logger['error']('[%s][AMAZONLEX]\x20%s',_0x4564ba,JSON[_0x0d3f('0x23')](_0x2ca707));})[_0x0d3f('0x24')](function(){logger[_0x0d3f('0xc')](_0x0d3f('0x25'),_0x4564ba);_0x43eddd['stop']();});}else{logger[_0x0d3f('0xc')](_0x0d3f('0x26'),_0x4564ba);_0x43eddd[_0x0d3f('0x27')]();}}else{var _0x4c6811=this;var _0x44cc5c=new AWS[(_0x0d3f('0x28'))]({'accessKeyId':_0x4d4e4a[0x0],'secretAccessKey':_0x4d4e4a[0x1],'region':_0x4d4e4a[0x2]});var _0x4d95f6={'botAlias':_0x0d3f('0x29'),'botName':_0x4d4e4a[0x3],'inputText':this[_0x0d3f('0x2a')][_0x0d3f('0x2b')],'userId':this[_0x0d3f('0x13')]+':'+this[_0x0d3f('0x17')]['id']['toString']()};_0x44cc5c[_0x0d3f('0x2c')](_0x4d95f6,function(_0x3ecfb7,_0x490c60){if(_0x3ecfb7){logger[_0x0d3f('0x2d')](_0x0d3f('0xd'),_0x4564ba,_0x3ecfb7[_0x0d3f('0x2a')]);_0x43eddd[_0x0d3f('0xf')]();}else if(_0x490c60&&_0x490c60[_0x0d3f('0x2a')]){_0x4c6811[_0x0d3f('0x2b')][_0x0d3f('0x2e')]=_0x490c60;_0x10cb85[_0x0d3f('0x2b')]=_0x490c60['message'];_0x10cb85[_0x0d3f('0x2f')]=_0x0d3f('0x2e');_0x10cb85[_0x0d3f('0x30')]=JSON[_0x0d3f('0x23')](_0x490c60);return rpc[_0x3490fe+_0x0d3f('0x20')][_0x0d3f('0x21')](_0x10cb85)['then'](function(_0x3e7d05){logger[_0x0d3f('0xc')]('[%s][AMAZONLEX]\x20%s',_0x4564ba,_0x10cb85['body']);if(_0x490c60[_0x0d3f('0x31')]==_0x0d3f('0x32')){_0x43eddd['next']();}else{_0x43eddd[_0x0d3f('0x27')]();}})[_0x0d3f('0x22')](function(_0x11ceab){logger['error'](_0x0d3f('0xd'),_0x4564ba,JSON[_0x0d3f('0x23')](_0x11ceab));_0x43eddd['next']();});}else{_0x43eddd[_0x0d3f('0xf')]();}});}}catch(_0x5c8925){logger[_0x0d3f('0x2d')](_0x0d3f('0xd'),_0x4564ba,JSON[_0x0d3f('0x23')](_0x5c8925));_0x43eddd[_0x0d3f('0x27')]();}};}; \ 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 0b805e3..6465010 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 _0x8808=['inReplyTo','messageId','html','','headers','auto-replied','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','catch','error','stringify','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','body','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','mail','getMustacheRender','message','from','phone','subject','Re:','upperFirst','account','InteractionId','Message','Smtp','service','host','secure','authentication','auth','user'];(function(_0x11f9f2,_0x3b1a7e){var _0x56a2b6=function(_0x4eb565){while(--_0x4eb565){_0x11f9f2['push'](_0x11f9f2['shift']());}};_0x56a2b6(++_0x3b1a7e);}(_0x8808,0x11e));var _0x8880=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8808[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0x8880('0x0'));var utils=require(_0x8880('0x1'));var logger=require('../../../../config/logger')(_0x8880('0x2'));var rpc={'chatMessage':require(_0x8880('0x3')),'openchannelMessage':require(_0x8880('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x8880('0x5')),'faxMessage':require(_0x8880('0x6')),'whatsappMessage':require(_0x8880('0x7')),'chatInteraction':require(_0x8880('0x8')),'openchannelInteraction':require(_0x8880('0x9')),'mailInteraction':require(_0x8880('0xa')),'smsInteraction':require(_0x8880('0xb')),'faxInteraction':require(_0x8880('0xc')),'whatsappInteraction':require(_0x8880('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x8880('0xe')]=function(_0xc6273,_0x473876,_0x4ee283,_0x3744ac){return function(_0x7bc0cc){try{var _0x52aef0=this['channel'];if(_0x52aef0==='mail'&&_0x3744ac[_0x8880('0xf')]['isAutoreply']){logger['info']('[%s][AUTOREPLY]\x20%s',_0xc6273,_0x8880('0x10'));return _0x7bc0cc[_0x8880('0x11')]();}if(_0x473876[0x0]==='1'&&(_[_0x8880('0x12')](this[_0x8880('0x13')][_0x8880('0x14')])||!this['interaction'][_0x8880('0x14')])){logger['info'](_0x8880('0x15'),_0xc6273,_0x8880('0x16'));return _0x7bc0cc[_0x8880('0x11')]();}if(_0x473876[0x0]==='2'&&this[_0x8880('0x13')][_0x8880('0x17')]){logger[_0x8880('0x18')](_0x8880('0x19'),_0xc6273,'One\x20Time\x20already\x20sent');return _0x7bc0cc[_0x8880('0x11')]();}var _0x49224b={'ContactId':this[_0x8880('0x1a')]['id'],'sentAt':moment()[_0x8880('0x1b')](_0x8880('0x1c')),'direction':_0x8880('0x1d')};if(this[_0x8880('0x1e')]===_0x8880('0x1f')){_0x49224b[_0x8880('0xf')]=utils[_0x8880('0x20')](_0x473876[0x2],this);}else{_0x49224b[_0x8880('0xf')]=utils[_0x8880('0x20')](_0x473876[0x1],this);}if(this[_0x8880('0x21')]){_0x49224b['to']=this['message'][_0x8880('0x22')]||'';if(this[_0x8880('0x1e')]==='mail'&&_0x473876[0x1]==='1'){_0x49224b['cc']=this['message']['cc']||'';}_0x49224b[_0x8880('0x22')]=this[_0x8880('0x21')]['to']||'';_0x49224b[_0x8880('0x23')]=this['message'][_0x8880('0x23')]||'';_0x49224b['read']=!![];if(this['message'][_0x8880('0x24')]){_0x49224b['subject']='';_0x49224b[_0x8880('0x24')]+=_['startsWith'](this['message'][_0x8880('0x24')],_0x8880('0x25'))?'':'Re:\x20';_0x49224b['subject']+=this[_0x8880('0x21')][_0x8880('0x24')];}}if(this[_0x8880('0x1e')]==='chat'){_0x49224b['ChatWebsiteId']=this['account']['id'];}else{_0x49224b[_[_0x8880('0x26')](this[_0x8880('0x1e')])+'AccountId']=this[_0x8880('0x27')]['id'];}_0x49224b[_[_0x8880('0x26')](this[_0x8880('0x1e')])+_0x8880('0x28')]=this[_0x8880('0x13')]['id'];var _0x261606=this[_0x8880('0x13')];if(rpc[this[_0x8880('0x1e')]+_0x8880('0x29')]){if(this[_0x8880('0x1e')]==='mail'){var _0x406def={'tls':{'rejectUnauthorized':![]}};if(this[_0x8880('0x27')][_0x8880('0x2a')][_0x8880('0x2b')]){_0x406def[_0x8880('0x2b')]=this[_0x8880('0x27')][_0x8880('0x2a')]['service'];}else{_0x406def[_0x8880('0x2c')]=this['account'][_0x8880('0x2a')]['host'];_0x406def['port']=this[_0x8880('0x27')][_0x8880('0x2a')]['port'];_0x406def[_0x8880('0x2d')]=this[_0x8880('0x27')]['Smtp']['secure'];}if(this[_0x8880('0x27')][_0x8880('0x2a')][_0x8880('0x2e')]){_0x406def[_0x8880('0x2f')]={'user':this[_0x8880('0x27')][_0x8880('0x2a')][_0x8880('0x30')],'pass':this[_0x8880('0x27')][_0x8880('0x2a')]['pass']};}_0x49224b[_0x8880('0x31')]=this[_0x8880('0x21')][_0x8880('0x32')];_0x49224b[_0x8880('0x33')]=''+_['replace'](_0x49224b[_0x8880('0xf')],'','replace','';_0x230d25['headers']={'Auto-Submitted':_0xced2('0x3c'),'X-Auto-Response-Suppress':'All','Precedence':_0xced2('0x3d')};return mailRpc[_0xced2('0x3e')](_0x339e43,_0x230d25)['then'](function(_0x52297f){logger[_0xced2('0x10')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x18d96b);_0x230d25[_0xced2('0x37')]=_0x52297f[_0xced2('0x20')][_0xced2('0x37')];return rpc[_0x26a221+_0xced2('0x2d')][_0xced2('0x3f')](_0x230d25);})['then'](function(_0x935f2e){logger[_0xced2('0x10')](_0xced2('0x11'),_0x18d96b,JSON[_0xced2('0x40')](_0x935f2e));})[_0xced2('0x41')](function(_0x549bcf){logger[_0xced2('0x42')](_0xced2('0x43'),_0x18d96b,JSON['stringify'](_0x549bcf));})[_0xced2('0x44')](function(){Promise[_0xced2('0x45')]()[_0xced2('0x46')](function(){if(_0x11dedf[0x0]!=='2'||_0x1fa547[_0xced2('0x18')])return;return rpc[_0x26a221+'Interaction'][_0xced2('0x47')](_0x1fa547['id'],{'autoreplyExecuted':!![]})[_0xced2('0x46')](function(_0x25a7fd){logger[_0xced2('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x18d96b,JSON[_0xced2('0x40')](_0x25a7fd));})[_0xced2('0x41')](function(_0x5c07c6){logger[_0xced2('0x42')](_0xced2('0x48'),_0x18d96b,JSON[_0xced2('0x40')](_0x5c07c6));});})[_0xced2('0x46')](function(){_0x26c94b[_0xced2('0x17')]();});});}else{return rpc[this['channel']+'Message']['create'](_0x230d25)[_0xced2('0x46')](function(_0x3c46e3){logger['info']('[%s][AUTOREPLY]\x20%s',_0x18d96b,_0x230d25[_0xced2('0x1e')]);})[_0xced2('0x41')](function(_0x59cc57){logger[_0xced2('0x42')](_0xced2('0x11'),_0x18d96b,JSON[_0xced2('0x40')](_0x59cc57));})[_0xced2('0x44')](function(){Promise[_0xced2('0x45')]()['then'](function(){if(_0x11dedf[0x0]!=='2'||_0x1fa547[_0xced2('0x18')])return;return rpc[_0x26a221+_0xced2('0x49')]['update'](_0x1fa547['id'],{'autoreplyExecuted':!![]})[_0xced2('0x46')](function(_0x37bf62){logger[_0xced2('0x10')](_0xced2('0x4a'),_0x18d96b,JSON['stringify'](_0x37bf62));})['catch'](function(_0x5680ac){logger[_0xced2('0x42')](_0xced2('0x48'),_0x18d96b,JSON[_0xced2('0x40')](_0x5680ac));});})['then'](function(){_0x26c94b[_0xced2('0x17')]();});});}}}catch(_0xa4fb65){logger[_0xced2('0x42')](_0xced2('0x11'),_0x18d96b,JSON[_0xced2('0x40')](_0xa4fb65));_0x26c94b[_0xced2('0x4b')]();}};}; \ 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 95ad54d..f2fa131 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 _0xa2d8=['consequence','info','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x2db5b6,_0x3b53b9){var _0x53a212=function(_0x2560fb){while(--_0x2560fb){_0x2db5b6['push'](_0x2db5b6['shift']());}};_0x53a212(++_0x3b53b9);}(_0xa2d8,0x1dd));var _0x8a2d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa2d8[_0x618414];return _0x21c19a;};'use strict';var moment=require('moment');var logger=require(_0x8a2d('0x0'))(_0x8a2d('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x8a2d('0x2')),'smsInteraction':require(_0x8a2d('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x8a2d('0x4')),'whatsappInteraction':require(_0x8a2d('0x5'))};exports[_0x8a2d('0x6')]=function(_0x14ce90,_0x5e0fb0,_0x23ee1a,_0x30d82c){return function(_0x263fc9){try{logger[_0x8a2d('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0x14ce90,_0x5e0fb0[0x0]);var _0x2a84df={'closed':0x1,'closedAt':moment()['format'](_0x8a2d('0x8')),'closeReason':_0x8a2d('0x9'),'disposition':_0x5e0fb0[0x0]};if(rpc[_0x30d82c[_0x8a2d('0xa')]+_0x8a2d('0xb')]){rpc[_0x30d82c[_0x8a2d('0xa')]+_0x8a2d('0xb')][_0x8a2d('0xc')](_0x30d82c[_0x8a2d('0xd')]['id'],_0x2a84df)[_0x8a2d('0xe')](function(_0x1205ec){logger[_0x8a2d('0x7')](_0x8a2d('0xf'),_0x14ce90,_0x30d82c[_0x8a2d('0xd')]['id']);})[_0x8a2d('0x10')](function(_0x5ab53e){logger[_0x8a2d('0x11')](_0x8a2d('0x12'),_0x14ce90,JSON['stringify'](_0x5ab53e));})[_0x8a2d('0x13')](function(){_0x263fc9[_0x8a2d('0x14')]();});}}catch(_0x1e602f){logger['error'](_0x8a2d('0x12'),_0x14ce90,JSON['stringify'](_0x1e602f));_0x263fc9[_0x8a2d('0x14')]();}};}; \ No newline at end of file +var _0x968d=['[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','error','stringify','stop','[%s][CLOSE]\x20%s','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info'];(function(_0x2b1df8,_0x22a65e){var _0x356c3e=function(_0x44958c){while(--_0x44958c){_0x2b1df8['push'](_0x2b1df8['shift']());}};_0x356c3e(++_0x22a65e);}(_0x968d,0xf9));var _0xd968=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x968d[_0x31a576];return _0x30b1d3;};'use strict';var moment=require('moment');var logger=require(_0xd968('0x0'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xd968('0x1')),'smsInteraction':require(_0xd968('0x2')),'mailInteraction':require(_0xd968('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xd968('0x4'))};exports[_0xd968('0x5')]=function(_0x398c14,_0x1a95a6,_0x4ae928,_0x17d073){return function(_0x35f2ae){try{logger[_0xd968('0x6')](_0xd968('0x7'),_0x398c14,_0x1a95a6[0x0]);var _0x40e005={'closed':0x1,'closedAt':moment()['format'](_0xd968('0x8')),'closeReason':_0xd968('0x9'),'disposition':_0x1a95a6[0x0]};if(rpc[_0x17d073[_0xd968('0xa')]+_0xd968('0xb')]){rpc[_0x17d073[_0xd968('0xa')]+'Interaction']['update'](_0x17d073['interaction']['id'],_0x40e005)['then'](function(_0x269376){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x398c14,_0x17d073['interaction']['id']);})['catch'](function(_0x467d26){logger[_0xd968('0xc')]('[%s][CLOSE]\x20%s',_0x398c14,JSON[_0xd968('0xd')](_0x467d26));})['finally'](function(){_0x35f2ae[_0xd968('0xe')]();});}}catch(_0x308400){logger[_0xd968('0xc')](_0xd968('0xf'),_0x398c14,JSON[_0xd968('0xd')](_0x308400));_0x35f2ae[_0xd968('0xe')]();}};}; \ 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 1362e4e..177a396 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 _0x07d7=['account','upperFirst','created','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','fulfillment','speech','providerName','providerResponse','Message','result','metadata','endConversation','next','message','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','sms','phone','chat'];(function(_0x2505f2,_0x258a35){var _0x393941=function(_0x34ffda){while(--_0x34ffda){_0x2505f2['push'](_0x2505f2['shift']());}};_0x393941(++_0x258a35);}(_0x07d7,0x85));var _0x707d=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x07d7[_0x479160];return _0x47ac6d;};'use strict';var _=require(_0x707d('0x0'));var moment=require(_0x707d('0x1'));var apiai=require(_0x707d('0x2'));var md5=require(_0x707d('0x3'));var utils=require(_0x707d('0x4'));var logger=require(_0x707d('0x5'))(_0x707d('0x6'));var rpc={'chatMessage':require(_0x707d('0x7')),'openchannelMessage':require(_0x707d('0x8')),'mailMessage':require(_0x707d('0x9')),'smsMessage':require(_0x707d('0xa')),'faxMessage':require(_0x707d('0xb')),'whatsappMessage':require(_0x707d('0xc'))};exports[_0x707d('0xd')]=function(_0x1bdf46,_0x13df54){return function(_0x50de20){try{if(!_['isNil'](this[_0x707d('0xe')][_0x707d('0xf')])){logger[_0x707d('0x10')](_0x707d('0x11'),_0x1bdf46,_0x707d('0x12'));return _0x50de20['next']();}var _0x3f45f5={'ContactId':this[_0x707d('0x13')]['id'],'sentAt':moment()[_0x707d('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x707d('0x15')};if(this[_0x707d('0x16')]===_0x707d('0x17')||this['channel']==='whatsapp'){_0x3f45f5['phone']=this[_0x707d('0xe')][_0x707d('0x18')];}var _0x5c4815=this['channel'];if(_0x5c4815===_0x707d('0x19')){_0x3f45f5['ChatWebsiteId']=this[_0x707d('0x1a')]['id'];}else{_0x3f45f5[_[_0x707d('0x1b')](_0x5c4815)+'AccountId']=this['account']['id'];}_0x3f45f5[_[_0x707d('0x1b')](_0x5c4815)+'InteractionId']=this[_0x707d('0xe')]['id'];if(this[_0x707d('0xe')][_0x707d('0x1c')]){var _0x1f4f0e=_0x13df54[0x2];if(!_[_0x707d('0x1d')](_0x1f4f0e)){_0x3f45f5[_0x707d('0x1e')]=utils[_0x707d('0x1f')](_0x1f4f0e,this);return rpc[_0x5c4815+'Message'][_0x707d('0x20')](_0x3f45f5)[_0x707d('0x21')](function(_0x3617c3){logger['info'](_0x707d('0x11'),_0x1bdf46,_0x3f45f5[_0x707d('0x1e')]);})[_0x707d('0x22')](function(_0x8e524c){logger[_0x707d('0x23')](_0x707d('0x11'),_0x1bdf46,JSON[_0x707d('0x24')](_0x8e524c));})[_0x707d('0x25')](function(){logger[_0x707d('0x10')](_0x707d('0x26'),_0x1bdf46);_0x50de20[_0x707d('0x27')]();});}else{logger[_0x707d('0x10')](_0x707d('0x28'),_0x1bdf46);_0x50de20[_0x707d('0x27')]();}}else{var _0xd97d6b=this;var _0x30d175=apiai(_0x13df54[0x0],{'language':_0x13df54[0x1]||'en'});return _0x30d175[_0x707d('0x29')](this['message'][_0x707d('0x1e')],{'sessionId':md5(this['interaction']['id'])})[_0x707d('0x21')](function(_0x139ad5){_0xd97d6b[_0x707d('0x1e')][_0x707d('0x2a')]=_0x139ad5;_0x3f45f5[_0x707d('0x1e')]=_0x139ad5['result'][_0x707d('0x2b')][_0x707d('0x2c')];_0x3f45f5[_0x707d('0x2d')]=_0x707d('0x2a');_0x3f45f5[_0x707d('0x2e')]=JSON[_0x707d('0x24')](_0x139ad5);return rpc[_0x5c4815+_0x707d('0x2f')][_0x707d('0x20')](_0x3f45f5)[_0x707d('0x21')](function(_0x2f03bc){logger[_0x707d('0x10')](_0x707d('0x11'),_0x1bdf46,_0x3f45f5[_0x707d('0x1e')]);if(_0x139ad5[_0x707d('0x30')][_0x707d('0x31')][_0x707d('0x32')]){_0x50de20[_0x707d('0x33')]();}else{_0x50de20[_0x707d('0x27')]();}})['catch'](function(_0x17bb4e){logger[_0x707d('0x23')](_0x707d('0x11'),_0x1bdf46,JSON['stringify'](_0x17bb4e));_0x50de20['next']();});})['catch'](function(_0x18c7e4){logger[_0x707d('0x23')](_0x707d('0x11'),_0x1bdf46,_0x18c7e4[_0x707d('0x34')]);_0x50de20[_0x707d('0x33')]();});}}catch(_0x327623){logger[_0x707d('0x23')](_0x707d('0x11'),_0x1bdf46,JSON[_0x707d('0x24')](_0x327623));_0x50de20[_0x707d('0x27')]();}};}; \ No newline at end of file +var _0x510e=['fulfillment','speech','dialogflow','stringify','result','metadata','endConversation','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','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','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','finally','stop','textRequest','message'];(function(_0x3d43ce,_0x433f16){var _0x5069e8=function(_0xc0b970){while(--_0xc0b970){_0x3d43ce['push'](_0x3d43ce['shift']());}};_0x5069e8(++_0x433f16);}(_0x510e,0x1ed));var _0xe510=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x510e[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xe510('0x0'));var moment=require(_0xe510('0x1'));var apiai=require(_0xe510('0x2'));var md5=require(_0xe510('0x3'));var utils=require(_0xe510('0x4'));var logger=require(_0xe510('0x5'))(_0xe510('0x6'));var rpc={'chatMessage':require(_0xe510('0x7')),'openchannelMessage':require(_0xe510('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe510('0x9')),'faxMessage':require(_0xe510('0xa')),'whatsappMessage':require(_0xe510('0xb'))};exports[_0xe510('0xc')]=function(_0x26cffc,_0x18ec55){return function(_0x27ca15){try{if(!_[_0xe510('0xd')](this[_0xe510('0xe')][_0xe510('0xf')])){logger[_0xe510('0x10')](_0xe510('0x11'),_0x26cffc,_0xe510('0x12'));return _0x27ca15[_0xe510('0x13')]();}var _0x521561={'ContactId':this[_0xe510('0x14')]['id'],'sentAt':moment()[_0xe510('0x15')](_0xe510('0x16')),'direction':_0xe510('0x17')};if(this[_0xe510('0x18')]===_0xe510('0x19')||this['channel']===_0xe510('0x1a')){_0x521561[_0xe510('0x1b')]=this[_0xe510('0xe')][_0xe510('0x1b')];}var _0x2efee5=this[_0xe510('0x18')];if(_0x2efee5===_0xe510('0x1c')){_0x521561[_0xe510('0x1d')]=this[_0xe510('0x1e')]['id'];}else{_0x521561[_[_0xe510('0x1f')](_0x2efee5)+_0xe510('0x20')]=this[_0xe510('0x1e')]['id'];}_0x521561[_['upperFirst'](_0x2efee5)+_0xe510('0x21')]=this['interaction']['id'];if(this['interaction'][_0xe510('0x22')]){var _0x43b191=_0x18ec55[0x2];if(!_[_0xe510('0x23')](_0x43b191)){_0x521561[_0xe510('0x24')]=utils[_0xe510('0x25')](_0x43b191,this);return rpc[_0x2efee5+_0xe510('0x26')][_0xe510('0x27')](_0x521561)[_0xe510('0x28')](function(_0x48e676){logger[_0xe510('0x10')](_0xe510('0x11'),_0x26cffc,_0x521561[_0xe510('0x24')]);})[_0xe510('0x29')](function(_0x3177d6){logger[_0xe510('0x2a')](_0xe510('0x11'),_0x26cffc,JSON['stringify'](_0x3177d6));})[_0xe510('0x2b')](function(){logger[_0xe510('0x10')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x26cffc);_0x27ca15[_0xe510('0x2c')]();});}else{logger[_0xe510('0x10')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x26cffc);_0x27ca15[_0xe510('0x2c')]();}}else{var _0x460d28=this;var _0x4a0c3d=apiai(_0x18ec55[0x0],{'language':_0x18ec55[0x1]||'en'});return _0x4a0c3d[_0xe510('0x2d')](this[_0xe510('0x2e')][_0xe510('0x24')],{'sessionId':md5(this[_0xe510('0xe')]['id'])})[_0xe510('0x28')](function(_0x4c034f){_0x460d28[_0xe510('0x24')]['dialogflow']=_0x4c034f;_0x521561['body']=_0x4c034f['result'][_0xe510('0x2f')][_0xe510('0x30')];_0x521561['providerName']=_0xe510('0x31');_0x521561['providerResponse']=JSON[_0xe510('0x32')](_0x4c034f);return rpc[_0x2efee5+_0xe510('0x26')][_0xe510('0x27')](_0x521561)[_0xe510('0x28')](function(_0x1cd9c4){logger[_0xe510('0x10')](_0xe510('0x11'),_0x26cffc,_0x521561[_0xe510('0x24')]);if(_0x4c034f[_0xe510('0x33')][_0xe510('0x34')][_0xe510('0x35')]){_0x27ca15['next']();}else{_0x27ca15[_0xe510('0x2c')]();}})[_0xe510('0x29')](function(_0x49a33f){logger['error'](_0xe510('0x11'),_0x26cffc,JSON[_0xe510('0x32')](_0x49a33f));_0x27ca15['next']();});})[_0xe510('0x29')](function(_0x40008f){logger[_0xe510('0x2a')](_0xe510('0x11'),_0x26cffc,_0x40008f[_0xe510('0x2e')]);_0x27ca15['next']();});}}catch(_0x3a194a){logger[_0xe510('0x2a')](_0xe510('0x11'),_0x26cffc,JSON[_0xe510('0x32')](_0x3a194a));_0x27ca15[_0xe510('0x2c')]();}};}; \ 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 ad3bf8e..24d1077 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 _0x450f=['stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','message','detectIntent','length','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','info','next','contact','out','channel','sms','whatsapp','phone','interaction','chat','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','finally'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x450f,0x15d));var _0xf450=function(_0x28d025,_0x4eb1f1){_0x28d025=_0x28d025-0x0;var _0x160d9c=_0x450f[_0x28d025];return _0x160d9c;};'use strict';var _=require(_0xf450('0x0'));var dialogflow=require(_0xf450('0x1'));var md5=require(_0xf450('0x2'));var moment=require(_0xf450('0x3'));var Promise=require(_0xf450('0x4'));var logger=require(_0xf450('0x5'))(_0xf450('0x6'));var utils=require(_0xf450('0x7'));var rpc={'chatMessage':require(_0xf450('0x8')),'openchannelMessage':require(_0xf450('0x9')),'mailMessage':require(_0xf450('0xa')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf450('0xb')),'whatsappMessage':require(_0xf450('0xc'))};function createMessage(_0x181481,_0xe54b6b,_0xd1c751,_0x28fbad){return new Promise(function(_0x424e7d,_0x414561){var _0x147308=_['clone'](_0xd1c751);_0x147308[_0xf450('0xd')]=_0x28fbad;return rpc[_0xe54b6b+_0xf450('0xe')][_0xf450('0xf')](_0x147308)[_0xf450('0x10')](function(){logger['info'](_0xf450('0x11'),_0x181481,_0x147308[_0xf450('0xd')]);_0x424e7d();})[_0xf450('0x12')](function(_0x3adecf){logger[_0xf450('0x13')](_0xf450('0x11'),_0x181481,JSON[_0xf450('0x14')](_0x3adecf));_0x414561(_0x3adecf);});});}exports[_0xf450('0x15')]=function(_0x10b48c,_0x3163ef){return function(_0x1cdb27){try{if(!_[_0xf450('0x16')](this['interaction'][_0xf450('0x17')])){logger[_0xf450('0x18')](_0xf450('0x11'),_0x10b48c,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1cdb27[_0xf450('0x19')]();}var _0x763781={'ContactId':this[_0xf450('0x1a')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf450('0x1b')};if(this[_0xf450('0x1c')]===_0xf450('0x1d')||this[_0xf450('0x1c')]===_0xf450('0x1e')){_0x763781[_0xf450('0x1f')]=this[_0xf450('0x20')][_0xf450('0x1f')];}var _0x20b3a3=this[_0xf450('0x1c')];if(_0x20b3a3===_0xf450('0x21')){_0x763781['ChatWebsiteId']=this[_0xf450('0x22')]['id'];}else{_0x763781[_[_0xf450('0x23')](_0x20b3a3)+_0xf450('0x24')]=this[_0xf450('0x22')]['id'];}_0x763781[_[_0xf450('0x23')](_0x20b3a3)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0xf450('0x25')]){var _0x1b7f6d=_0x3163ef[0x4];if(!_[_0xf450('0x26')](_0x1b7f6d)){_0x763781[_0xf450('0xd')]=utils[_0xf450('0x27')](_0x1b7f6d,this);return rpc[_0x20b3a3+'Message'][_0xf450('0xf')](_0x763781)[_0xf450('0x10')](function(_0x696fb5){logger[_0xf450('0x18')]('[%s][DIALOGFLOWV2]\x20%s',_0x10b48c,_0x763781[_0xf450('0xd')]);})['catch'](function(_0x36a7e4){logger['error'](_0xf450('0x11'),_0x10b48c,JSON[_0xf450('0x14')](_0x36a7e4));})[_0xf450('0x28')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x10b48c);_0x1cdb27[_0xf450('0x29')]();});}else{logger['info'](_0xf450('0x2a'),_0x10b48c);_0x1cdb27[_0xf450('0x29')]();}}else{var _0x50570f=this;var _0x4e6412=_0x3163ef[0x2]['replace'](/\\n/g,'\x0a');var _0x3aff74={'credentials':{'private_key':_0x4e6412,'client_email':_0x3163ef[0x1]}};var _0x1d5b63=new dialogflow['SessionsClient'](_0x3aff74);var _0x21da2b=_0x1d5b63[_0xf450('0x2b')](_0x3163ef[0x0],md5(_0x50570f[_0xf450('0x20')]['id']));var _0x32e9a7={'session':_0x21da2b,'queryInput':{'text':{'text':_0x50570f[_0xf450('0x2c')][_0xf450('0xd')],'languageCode':_0x3163ef[0x3]||'en'}}};return _0x1d5b63[_0xf450('0x2d')](_0x32e9a7)[_0xf450('0x10')](function(_0xc24042){if(_0xc24042&&_0xc24042[_0xf450('0x2e')]){_0x50570f['body']['dialogflowV2']=_0xc24042;var _0x3a0e88=_0xc24042[0x0];var _0x5c4567=_0x3a0e88['queryResult'][_0xf450('0x2f')]&&_0x3a0e88[_0xf450('0x30')][_0xf450('0x2f')][_0xf450('0x31')]?_0x3a0e88[_0xf450('0x30')]['diagnosticInfo'][_0xf450('0x31')][_0xf450('0x32')][_0xf450('0x33')]:![];_0x50570f[_0xf450('0xd')][_0xf450('0x34')]=_0x3a0e88[_0xf450('0x30')]['action'];_0x50570f['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x3a0e88[_0xf450('0x30')]['allRequiredParamsPresent'];_0x50570f[_0xf450('0xd')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x3a0e88[_0xf450('0x30')][_0xf450('0x2f')]&&_0x3a0e88['queryResult'][_0xf450('0x2f')][_0xf450('0x31')]?_0x3a0e88[_0xf450('0x30')]['diagnosticInfo']['fields'][_0xf450('0x32')][_0xf450('0x33')]:![];_0x50570f[_0xf450('0xd')][_0xf450('0x35')]=_0x3a0e88[_0xf450('0x30')][_0xf450('0x36')][_0xf450('0x37')];_0x50570f[_0xf450('0xd')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x3a0e88[_0xf450('0x30')][_0xf450('0x36')]['displayName'];_0x50570f[_0xf450('0xd')][_0xf450('0x38')]=_0x3a0e88[_0xf450('0x30')][_0xf450('0x36')]['isFallback'];_0x50570f['body'][_0xf450('0x39')]=_0x3a0e88[_0xf450('0x30')]['languageCode'];_0x50570f[_0xf450('0xd')][_0xf450('0x3a')]=_0x3a0e88[_0xf450('0x30')]['queryText'];_0x50570f[_0xf450('0xd')][_0xf450('0x3b')]=_0x3a0e88[_0xf450('0x30')]['intentDetectionConfidence'];_0x763781[_0xf450('0x3c')]='dialogflowV2';_0x763781[_0xf450('0x3d')]=JSON[_0xf450('0x14')](_0xc24042);var _0x150323=[];for(var _0x4d2584=0x0;_0x4d2584<_0xc24042['length'];_0x4d2584++){var _0x18a02e=_0xc24042[_0x4d2584];if(_0x18a02e&&_0x18a02e[_0xf450('0x30')]&&_0x18a02e[_0xf450('0x30')][_0xf450('0x3e')]){_0x150323[_0xf450('0x3f')](createMessage(_0x10b48c,_0x20b3a3,_0x763781,_0x18a02e[_0xf450('0x30')][_0xf450('0x3e')]));}}return Promise[_0xf450('0x40')](_0x150323)[_0xf450('0x10')](function(){if(_0x5c4567){_0x1cdb27['next']();}else{_0x1cdb27[_0xf450('0x29')]();}})[_0xf450('0x12')](function(_0x3002c9){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x10b48c,JSON['stringify'](_0x3002c9));_0x1cdb27[_0xf450('0x19')]();});}})[_0xf450('0x12')](function(_0x1a391e){logger[_0xf450('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x10b48c,_0x1a391e[_0xf450('0x2c')]);_0x1cdb27[_0xf450('0x19')]();});}}catch(_0x1455c5){logger[_0xf450('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x10b48c,JSON['stringify'](_0x1455c5));_0x1cdb27['stop']();}};}; \ No newline at end of file +var _0x6c84=['../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','create','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','isNil','interaction','UserId','next','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','chat','account','upperFirst','AccountId','isEmpty','Message','then','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','lodash','dialogflow','md5','moment','bluebird','routing'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x6c84,0x112));var _0x46c8=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x6c84[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x46c8('0x0'));var dialogflow=require(_0x46c8('0x1'));var md5=require(_0x46c8('0x2'));var moment=require(_0x46c8('0x3'));var Promise=require(_0x46c8('0x4'));var logger=require('../../../../config/logger')(_0x46c8('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x46c8('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x46c8('0x7')),'faxMessage':require(_0x46c8('0x8')),'whatsappMessage':require(_0x46c8('0x9'))};function createMessage(_0x2d239a,_0x13bf93,_0x3c1e2a,_0xfe26c8){return new Promise(function(_0x1727f4,_0x5c0684){var _0x27c1a5=_['clone'](_0x3c1e2a);_0x27c1a5['body']=_0xfe26c8;return rpc[_0x13bf93+'Message'][_0x46c8('0xa')](_0x27c1a5)['then'](function(){logger[_0x46c8('0xb')](_0x46c8('0xc'),_0x2d239a,_0x27c1a5[_0x46c8('0xd')]);_0x1727f4();})[_0x46c8('0xe')](function(_0xf99f51){logger[_0x46c8('0xf')](_0x46c8('0xc'),_0x2d239a,JSON['stringify'](_0xf99f51));_0x5c0684(_0xf99f51);});});}exports['consequence']=function(_0x5adfbd,_0x201cac){return function(_0x5d5bb7){try{if(!_[_0x46c8('0x10')](this[_0x46c8('0x11')][_0x46c8('0x12')])){logger[_0x46c8('0xb')](_0x46c8('0xc'),_0x5adfbd,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5d5bb7[_0x46c8('0x13')]();}var _0x26ab24={'ContactId':this['contact']['id'],'sentAt':moment()[_0x46c8('0x14')](_0x46c8('0x15')),'direction':'out'};if(this['channel']===_0x46c8('0x16')||this[_0x46c8('0x17')]===_0x46c8('0x18')){_0x26ab24[_0x46c8('0x19')]=this[_0x46c8('0x11')][_0x46c8('0x19')];}var _0xc20113=this[_0x46c8('0x17')];if(_0xc20113===_0x46c8('0x1a')){_0x26ab24['ChatWebsiteId']=this[_0x46c8('0x1b')]['id'];}else{_0x26ab24[_[_0x46c8('0x1c')](_0xc20113)+_0x46c8('0x1d')]=this[_0x46c8('0x1b')]['id'];}_0x26ab24[_[_0x46c8('0x1c')](_0xc20113)+'InteractionId']=this[_0x46c8('0x11')]['id'];if(this[_0x46c8('0x11')]['created']){var _0x482323=_0x201cac[0x4];if(!_[_0x46c8('0x1e')](_0x482323)){_0x26ab24[_0x46c8('0xd')]=utils['getMustacheRender'](_0x482323,this);return rpc[_0xc20113+_0x46c8('0x1f')]['create'](_0x26ab24)[_0x46c8('0x20')](function(_0x1d724b){logger[_0x46c8('0xb')](_0x46c8('0xc'),_0x5adfbd,_0x26ab24[_0x46c8('0xd')]);})[_0x46c8('0xe')](function(_0x2131ed){logger[_0x46c8('0xf')](_0x46c8('0xc'),_0x5adfbd,JSON[_0x46c8('0x21')](_0x2131ed));})[_0x46c8('0x22')](function(){logger[_0x46c8('0xb')](_0x46c8('0x23'),_0x5adfbd);_0x5d5bb7['stop']();});}else{logger[_0x46c8('0xb')](_0x46c8('0x24'),_0x5adfbd);_0x5d5bb7[_0x46c8('0x25')]();}}else{var _0x35effc=this;var _0x21f6d9=_0x201cac[0x2][_0x46c8('0x26')](/\\n/g,'\x0a');var _0x2c78f9={'credentials':{'private_key':_0x21f6d9,'client_email':_0x201cac[0x1]}};var _0x2603f9=new dialogflow[(_0x46c8('0x27'))](_0x2c78f9);var _0x1744bd=_0x2603f9[_0x46c8('0x28')](_0x201cac[0x0],md5(_0x35effc[_0x46c8('0x11')]['id']));var _0x54bbbf={'session':_0x1744bd,'queryInput':{'text':{'text':_0x35effc[_0x46c8('0x29')][_0x46c8('0xd')],'languageCode':_0x201cac[0x3]||'en'}}};return _0x2603f9[_0x46c8('0x2a')](_0x54bbbf)['then'](function(_0x582b48){if(_0x582b48&&_0x582b48[_0x46c8('0x2b')]){_0x35effc[_0x46c8('0xd')][_0x46c8('0x2c')]=_0x582b48;var _0x404335=_0x582b48[0x0];var _0x3d3988=_0x404335[_0x46c8('0x2d')][_0x46c8('0x2e')]&&_0x404335[_0x46c8('0x2d')][_0x46c8('0x2e')][_0x46c8('0x2f')]?_0x404335['queryResult']['diagnosticInfo'][_0x46c8('0x2f')]['end_conversation'][_0x46c8('0x30')]:![];_0x35effc[_0x46c8('0xd')][_0x46c8('0x31')]=_0x404335[_0x46c8('0x2d')][_0x46c8('0x32')];_0x35effc[_0x46c8('0xd')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x404335[_0x46c8('0x2d')][_0x46c8('0x33')];_0x35effc[_0x46c8('0xd')][_0x46c8('0x34')]=_0x404335[_0x46c8('0x2d')][_0x46c8('0x2e')]&&_0x404335['queryResult'][_0x46c8('0x2e')]['fields']?_0x404335[_0x46c8('0x2d')][_0x46c8('0x2e')][_0x46c8('0x2f')][_0x46c8('0x35')][_0x46c8('0x30')]:![];_0x35effc[_0x46c8('0xd')][_0x46c8('0x36')]=_0x404335[_0x46c8('0x2d')]['intent'][_0x46c8('0x37')];_0x35effc[_0x46c8('0xd')][_0x46c8('0x38')]=_0x404335[_0x46c8('0x2d')]['intent'][_0x46c8('0x39')];_0x35effc[_0x46c8('0xd')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x404335[_0x46c8('0x2d')][_0x46c8('0x3a')][_0x46c8('0x3b')];_0x35effc['body'][_0x46c8('0x3c')]=_0x404335[_0x46c8('0x2d')][_0x46c8('0x3d')];_0x35effc[_0x46c8('0xd')][_0x46c8('0x3e')]=_0x404335[_0x46c8('0x2d')][_0x46c8('0x3f')];_0x35effc[_0x46c8('0xd')][_0x46c8('0x40')]=_0x404335['queryResult'][_0x46c8('0x41')];_0x26ab24[_0x46c8('0x42')]=_0x46c8('0x2c');_0x26ab24[_0x46c8('0x43')]=JSON[_0x46c8('0x21')](_0x582b48);var _0xd3b2ba=[];for(var _0x22f58a=0x0;_0x22f58a<_0x582b48[_0x46c8('0x2b')];_0x22f58a++){var _0xd206a3=_0x582b48[_0x22f58a];if(_0xd206a3&&_0xd206a3['queryResult']&&_0xd206a3[_0x46c8('0x2d')][_0x46c8('0x44')]){_0xd3b2ba['push'](createMessage(_0x5adfbd,_0xc20113,_0x26ab24,_0xd206a3[_0x46c8('0x2d')]['fulfillmentText']));}}return Promise[_0x46c8('0x45')](_0xd3b2ba)[_0x46c8('0x20')](function(){if(_0x3d3988){_0x5d5bb7[_0x46c8('0x13')]();}else{_0x5d5bb7[_0x46c8('0x25')]();}})[_0x46c8('0xe')](function(_0x5dc563){logger[_0x46c8('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x5adfbd,JSON[_0x46c8('0x21')](_0x5dc563));_0x5d5bb7[_0x46c8('0x13')]();});}})[_0x46c8('0xe')](function(_0x102fc7){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5adfbd,_0x102fc7[_0x46c8('0x29')]);_0x5d5bb7['next']();});}}catch(_0x44611b){logger[_0x46c8('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x5adfbd,JSON[_0x46c8('0x21')](_0x44611b));_0x5d5bb7[_0x46c8('0x25')]();}};}; \ 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 3f5d3ff..0b1bf66 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 _0x8671=['validate','lodash','html-to-text','./utils','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x8671,0x1ee));var _0x1867=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8671[_0x5c351c];return _0x26f3b3;};'use strict';var schema=require(_0x1867('0x0'));var _=require(_0x1867('0x1'));var htmlToText=require(_0x1867('0x2'));var utils=require(_0x1867('0x3'));var logger=require('../../../../config/logger')(_0x1867('0x4'));var gotoif=schema({'condition':{'type':_0x1867('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x1867('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x1867('0x6'),'message':_0x1867('0x7')}});exports[_0x1867('0x8')]=function(_0x5f4400,_0x14851d){return function(_0x512350){try{var _0x287e5e={'condition':htmlToText[_0x1867('0x9')](utils[_0x1867('0xa')](_0x14851d[0x0],this),{'wordwrap':![]})[_0x1867('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x14851d[0x1],'priorityFalse':_0x14851d[0x2]};var _0x5bf25f=gotoif[_0x1867('0x0')](_0x287e5e,{'typecast':!![]});if(_0x5bf25f[_0x1867('0xc')]){logger['error'](_0x1867('0xd'),_0x5f4400,_[_0x1867('0xe')](_0x5bf25f,_0x1867('0xf'))[_0x1867('0x10')](',\x20'));_0x512350[_0x1867('0x11')]();}else{try{var _0x23a1d8=eval('('+_0x287e5e[_0x1867('0x12')]+')');var _0x5722e5=_0x23a1d8?_0x287e5e[_0x1867('0x13')]:_0x287e5e['priorityFalse'];logger[_0x1867('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x5f4400,_0x287e5e[_0x1867('0x12')],_0x23a1d8,_0x5722e5||_0x1867('0x15'));if(_0x5722e5){var _0x3cfab3=_[_0x1867('0x16')](_0x512350[_0x1867('0x17')](),{'p':_0x5722e5});if(_0x3cfab3>=0x0){logger[_0x1867('0x14')](_0x1867('0x18'),_0x5f4400,_0x5722e5||_0x1867('0x15'),_0x3cfab3);_0x512350[_0x1867('0x15')](_0x3cfab3);}else{logger[_0x1867('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x5f4400,_0x5722e5||_0x1867('0x15'));_0x512350[_0x1867('0x11')]();}}else{_0x512350['next']();}}catch(_0x324410){logger[_0x1867('0x19')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5f4400,_0x324410[_0x1867('0xf')]);_0x512350[_0x1867('0x11')]();}}}catch(_0x1c0f77){logger[_0x1867('0x19')](_0x1867('0xd'),_0x5f4400,JSON['stringify'](_0x1c0f77));_0x512350[_0x1867('0x11')]();}};}; \ No newline at end of file +var _0x2869=['error','[%s][GOTOIF]\x20%s','map','stop','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','fromString','getMustacheRender','replace','validate','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2869,0x143));var _0x9286=function(_0x3f0bee,_0x162dfa){_0x3f0bee=_0x3f0bee-0x0;var _0x4f9013=_0x2869[_0x3f0bee];return _0x4f9013;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x9286('0x0'));var utils=require(_0x9286('0x1'));var logger=require(_0x9286('0x2'))(_0x9286('0x3'));var gotoif=schema({'condition':{'type':_0x9286('0x4'),'required':!![],'message':_0x9286('0x5')},'priorityTrue':{'type':_0x9286('0x6'),'message':_0x9286('0x7')},'priorityFalse':{'type':_0x9286('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x4a20d2,_0x60435){return function(_0x1675bf){try{var _0x2834f={'condition':htmlToText[_0x9286('0x8')](utils[_0x9286('0x9')](_0x60435[0x0],this),{'wordwrap':![]})[_0x9286('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x60435[0x1],'priorityFalse':_0x60435[0x2]};var _0x1a969e=gotoif[_0x9286('0xb')](_0x2834f,{'typecast':!![]});if(_0x1a969e[_0x9286('0xc')]){logger[_0x9286('0xd')](_0x9286('0xe'),_0x4a20d2,_[_0x9286('0xf')](_0x1a969e,'message')['join'](',\x20'));_0x1675bf[_0x9286('0x10')]();}else{try{var _0xd6eaf8=eval('('+_0x2834f[_0x9286('0x11')]+')');var _0x1ae0c4=_0xd6eaf8?_0x2834f[_0x9286('0x12')]:_0x2834f['priorityFalse'];logger['info'](_0x9286('0x13'),_0x4a20d2,_0x2834f[_0x9286('0x11')],_0xd6eaf8,_0x1ae0c4||_0x9286('0x14'));if(_0x1ae0c4){var _0x480c31=_[_0x9286('0x15')](_0x1675bf['rules'](),{'p':_0x1ae0c4});if(_0x480c31>=0x0){logger[_0x9286('0x16')](_0x9286('0x17'),_0x4a20d2,_0x1ae0c4||_0x9286('0x14'),_0x480c31);_0x1675bf['next'](_0x480c31);}else{logger['info'](_0x9286('0x18'),_0x4a20d2,_0x1ae0c4||'next');_0x1675bf['stop']();}}else{_0x1675bf[_0x9286('0x14')]();}}catch(_0x21cb5e){logger[_0x9286('0xd')](_0x9286('0x19'),_0x4a20d2,_0x21cb5e[_0x9286('0x1a')]);_0x1675bf[_0x9286('0x10')]();}}}catch(_0x1e10d1){logger['error'](_0x9286('0xe'),_0x4a20d2,JSON[_0x9286('0x1b')](_0x1e10d1));_0x1675bf[_0x9286('0x10')]();}};}; \ 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 c7ec485..8a85e34 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 _0xc805=['[%s][GOTOP]\x20%s','map','message','join','stop','info','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','../../../../config/logger','routing','number','length'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc805,0x6c));var _0x5c80=function(_0x41f96e,_0x333851){_0x41f96e=_0x41f96e-0x0;var _0x48a4ac=_0xc805[_0x41f96e];return _0x48a4ac;};'use strict';var schema=require(_0x5c80('0x0'));var _=require(_0x5c80('0x1'));var logger=require(_0x5c80('0x2'))(_0x5c80('0x3'));var gotop=schema({'priority':{'type':_0x5c80('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x9ced1f,_0x58bc06){return function(_0x4ec8a0){try{var _0x3d89a6={'priority':_0x58bc06[0x0]};var _0xa0d1fa=gotop['validate'](_0x3d89a6,{'typecast':!![]});if(_0xa0d1fa[_0x5c80('0x5')]){logger['error'](_0x5c80('0x6'),_0x9ced1f,_[_0x5c80('0x7')](_0xa0d1fa,_0x5c80('0x8'))[_0x5c80('0x9')](',\x20'));_0x4ec8a0[_0x5c80('0xa')]();}else{logger[_0x5c80('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x9ced1f,_0x3d89a6[_0x5c80('0xc')]);if(_0x3d89a6['priority']){var _0x40f5ca=_[_0x5c80('0xd')](_0x4ec8a0['rules'](),{'p':_0x3d89a6[_0x5c80('0xc')]});if(_0x40f5ca>=0x0){logger['info'](_0x5c80('0xe'),_0x9ced1f,_0x3d89a6[_0x5c80('0xc')]||_0x5c80('0xf'),_0x40f5ca);_0x4ec8a0['next'](_0x40f5ca);}else{logger[_0x5c80('0xb')](_0x5c80('0x10'),_0x9ced1f,_0x3d89a6[_0x5c80('0xc')]||_0x5c80('0xf'));_0x4ec8a0['stop']();}}else{_0x4ec8a0[_0x5c80('0xf')]();}}}catch(_0x306156){logger[_0x5c80('0x11')]('[%s][GOTOP]\x20%s',_0x9ced1f,JSON[_0x5c80('0x12')](_0x306156));_0x4ec8a0[_0x5c80('0xa')]();}};}; \ No newline at end of file +var _0x52cb=['map','message','join','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0x52cb,0x83));var _0xb52c=function(_0x59accc,_0x6097fa){_0x59accc=_0x59accc-0x0;var _0x810133=_0x52cb[_0x59accc];return _0x810133;};'use strict';var schema=require(_0xb52c('0x0'));var _=require('lodash');var logger=require(_0xb52c('0x1'))(_0xb52c('0x2'));var gotop=schema({'priority':{'type':_0xb52c('0x3'),'required':!![],'message':_0xb52c('0x4')}});exports[_0xb52c('0x5')]=function(_0xadd841,_0x1e6372){return function(_0xebd7fd){try{var _0x2ed4ba={'priority':_0x1e6372[0x0]};var _0x1498f5=gotop[_0xb52c('0x0')](_0x2ed4ba,{'typecast':!![]});if(_0x1498f5[_0xb52c('0x6')]){logger[_0xb52c('0x7')](_0xb52c('0x8'),_0xadd841,_[_0xb52c('0x9')](_0x1498f5,_0xb52c('0xa'))[_0xb52c('0xb')](',\x20'));_0xebd7fd['stop']();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0xadd841,_0x2ed4ba[_0xb52c('0xc')]);if(_0x2ed4ba[_0xb52c('0xc')]){var _0x5d1492=_[_0xb52c('0xd')](_0xebd7fd[_0xb52c('0xe')](),{'p':_0x2ed4ba[_0xb52c('0xc')]});if(_0x5d1492>=0x0){logger[_0xb52c('0xf')](_0xb52c('0x10'),_0xadd841,_0x2ed4ba[_0xb52c('0xc')]||_0xb52c('0x11'),_0x5d1492);_0xebd7fd[_0xb52c('0x11')](_0x5d1492);}else{logger[_0xb52c('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0xadd841,_0x2ed4ba[_0xb52c('0xc')]||'next');_0xebd7fd[_0xb52c('0x12')]();}}else{_0xebd7fd[_0xb52c('0x11')]();}}}catch(_0x44466f){logger['error']('[%s][GOTOP]\x20%s',_0xadd841,JSON[_0xb52c('0x13')](_0x44466f));_0xebd7fd['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 5e17d05..587ad2a 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 _0xdd1d=['AccountId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','next','catch','error','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','channel','chat','ChatWebsiteId','account','upperFirst'];(function(_0x504c36,_0x44bbea){var _0x253151=function(_0x47f31c){while(--_0x47f31c){_0x504c36['push'](_0x504c36['shift']());}};_0x253151(++_0x44bbea);}(_0xdd1d,0xb2));var _0xddd1=function(_0x39de58,_0x158a4c){_0x39de58=_0x39de58-0x0;var _0x5ce2d1=_0xdd1d[_0x39de58];return _0x5ce2d1;};'use strict';var _=require(_0xddd1('0x0'));var utils=require(_0xddd1('0x1'));var logger=require(_0xddd1('0x2'))(_0xddd1('0x3'));var rpc={'chatMessage':require(_0xddd1('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xddd1('0x5')),'smsMessage':require(_0xddd1('0x6')),'faxMessage':require(_0xddd1('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xddd1('0x8')]=function(_0x5e7e44,_0x18f5d2){return function(_0x3ba6a9){try{var _0x268896={'body':utils['getMustacheRender'](_0x18f5d2[0x0],this),'ContactId':this['contact']['id']};if(this[_0xddd1('0x9')]===_0xddd1('0xa')){_0x268896[_0xddd1('0xb')]=this[_0xddd1('0xc')]['id'];}else{_0x268896[_[_0xddd1('0xd')](this[_0xddd1('0x9')])+_0xddd1('0xe')]=this[_0xddd1('0xc')]['id'];}_0x268896[_['upperFirst'](this[_0xddd1('0x9')])+'InteractionId']=this[_0xddd1('0xf')]['id'];if(rpc[this['channel']+_0xddd1('0x10')]){return rpc[this['channel']+'Message'][_0xddd1('0x11')](_0x268896)[_0xddd1('0x12')](function(_0x8f310e){logger['info'](_0xddd1('0x13'),_0x5e7e44,_0x268896['body']);_0x3ba6a9[_0xddd1('0x14')]();})[_0xddd1('0x15')](function(_0x322271){logger[_0xddd1('0x16')](_0xddd1('0x13'),_0x5e7e44,JSON[_0xddd1('0x17')](_0x322271));_0x3ba6a9['stop']();});}}catch(_0x105992){logger[_0xddd1('0x16')](_0xddd1('0x13'),_0x5e7e44,JSON[_0xddd1('0x17')](_0x105992));_0x3ba6a9['stop']();}};}; \ No newline at end of file +var _0x01f0=['interaction','Message','create','then','next','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x01f0,0x93));var _0x001f=function(_0x2ad8ea,_0x32b828){_0x2ad8ea=_0x2ad8ea-0x0;var _0x1dd376=_0x01f0[_0x2ad8ea];return _0x1dd376;};'use strict';var _=require(_0x001f('0x0'));var utils=require('./utils');var logger=require(_0x001f('0x1'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x001f('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x001f('0x3')),'whatsappMessage':require(_0x001f('0x4'))};exports['consequence']=function(_0x55b660,_0x148647){return function(_0x591a49){try{var _0x5e1b23={'body':utils[_0x001f('0x5')](_0x148647[0x0],this),'ContactId':this[_0x001f('0x6')]['id']};if(this[_0x001f('0x7')]===_0x001f('0x8')){_0x5e1b23[_0x001f('0x9')]=this['account']['id'];}else{_0x5e1b23[_['upperFirst'](this['channel'])+_0x001f('0xa')]=this[_0x001f('0xb')]['id'];}_0x5e1b23[_[_0x001f('0xc')](this[_0x001f('0x7')])+_0x001f('0xd')]=this[_0x001f('0xe')]['id'];if(rpc[this['channel']+_0x001f('0xf')]){return rpc[this[_0x001f('0x7')]+_0x001f('0xf')][_0x001f('0x10')](_0x5e1b23)[_0x001f('0x11')](function(_0x533a03){logger['info']('[%s][MESSAGE]\x20%s',_0x55b660,_0x5e1b23['body']);_0x591a49[_0x001f('0x12')]();})['catch'](function(_0x685867){logger[_0x001f('0x13')](_0x001f('0x14'),_0x55b660,JSON[_0x001f('0x15')](_0x685867));_0x591a49[_0x001f('0x16')]();});}}catch(_0x5e7198){logger['error']('[%s][MESSAGE]\x20%s',_0x55b660,JSON[_0x001f('0x15')](_0x5e7198));_0x591a49['stop']();}};}; \ 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 9e24253..f8b4368 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 _0xb598=['consequence','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','routing'];(function(_0x3a9d05,_0x367e7c){var _0x3b9c5e=function(_0x48df9f){while(--_0x48df9f){_0x3a9d05['push'](_0x3a9d05['shift']());}};_0x3b9c5e(++_0x367e7c);}(_0xb598,0x11e));var _0x8b59=function(_0x5a0cec,_0x3f4d27){_0x5a0cec=_0x5a0cec-0x0;var _0x3b634a=_0xb598[_0x5a0cec];return _0x3b634a;};'use strict';var utils=require(_0x8b59('0x0'));var logger=require('../../../../config/logger')(_0x8b59('0x1'));exports[_0x8b59('0x2')]=function(_0x2e1175,_0x1efa29){return function(_0x8c5bb6){try{logger['info'](_0x8b59('0x3'),_0x2e1175,utils['getMustacheRender'](_0x1efa29[0x0],this));_0x8c5bb6[_0x8b59('0x4')]();}catch(_0x1cfcfd){logger[_0x8b59('0x5')](_0x8b59('0x3'),_0x2e1175,JSON[_0x8b59('0x6')](_0x1cfcfd));_0x8c5bb6[_0x8b59('0x7')]();}};}; \ No newline at end of file +var _0xa1bf=['./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop'];(function(_0x3b89cb,_0x356ca9){var _0x4b6c3d=function(_0x16dbe9){while(--_0x16dbe9){_0x3b89cb['push'](_0x3b89cb['shift']());}};_0x4b6c3d(++_0x356ca9);}(_0xa1bf,0x122));var _0xfa1b=function(_0x39df29,_0x450cdc){_0x39df29=_0x39df29-0x0;var _0x4cecc6=_0xa1bf[_0x39df29];return _0x4cecc6;};'use strict';var utils=require(_0xfa1b('0x0'));var logger=require(_0xfa1b('0x1'))(_0xfa1b('0x2'));exports[_0xfa1b('0x3')]=function(_0x2a1d06,_0x3b747d){return function(_0x2980da){try{logger[_0xfa1b('0x4')](_0xfa1b('0x5'),_0x2a1d06,utils[_0xfa1b('0x6')](_0x3b747d[0x0],this));_0x2980da[_0xfa1b('0x7')]();}catch(_0x2beb69){logger['error']('[%s][NOOP]\x20%s',_0x2a1d06,JSON[_0xfa1b('0x8')](_0x2beb69));_0x2980da[_0xfa1b('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 92448f4..2325996 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 _0x989b=['catch','create\x20queue\x20report','accepted','info','update','error','update\x20queue\x20report','timeout','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','Queues','createQueue','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','moment','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','clone','format','%sQueuesWaitingInteractions','pick','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat','AccountId','WebsiteId','name','QueueReport','create'];(function(_0x4be903,_0x152dc8){var _0x3e79b5=function(_0x8242d0){while(--_0x8242d0){_0x4be903['push'](_0x4be903['shift']());}};_0x3e79b5(++_0x152dc8);}(_0x989b,0x198));var _0xb989=function(_0x3e8b12,_0x418dc8){_0x3e8b12=_0x3e8b12-0x0;var _0x2df443=_0x989b[_0x3e8b12];return _0x2df443;};'use strict';var schema=require(_0xb989('0x0'));var _=require(_0xb989('0x1'));var util=require(_0xb989('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xb989('0x3'));var Redis=require(_0xb989('0x4'));var config=require('../../../../config/environment');var logger=require(_0xb989('0x5'))('routing');var strategy=require('./strategy');config[_0xb989('0x6')]=_[_0xb989('0x7')](config[_0xb989('0x6')],{'host':_0xb989('0x8'),'port':0x18eb});var io=require(_0xb989('0x9'))(new Redis(config[_0xb989('0x6')]));var attributes=['id',_0xb989('0xa'),_0xb989('0xb'),_0xb989('0xc'),'from',_0xb989('0xd')];function emit(_0x1f5b60,_0x2b8f00,_0x2b5beb){io['to'](_0x1f5b60)['emit'](_0x2b8f00,_0x2b5beb);}function emitChannelQueueInteraction(_0x20ca7b,_0x5e0046,_0x48d6d9,_0x833c87,_0x5626e3,_0x43caa1,_0x49136a,_0x83b92){var _0x1ada8c=_[_0xb989('0xe')](_0x48d6d9);_0x1ada8c[_0xb989('0xa')]=_0x83b92;_0x1ada8c[_0xb989('0xc')]=_0x5e0046;_0x1ada8c[_0xb989('0xb')]=_0x833c87;_0x1ada8c['id']=_0x5626e3;if(_0x43caa1){_0x49136a[util[_0xb989('0xf')](_0xb989('0x10'),_0x20ca7b)][_0x5626e3]=_[_0xb989('0x11')](_0x1ada8c,attributes);}else{delete _0x49136a[util[_0xb989('0xf')](_0xb989('0x10'),_0x20ca7b)][_0x5626e3];}emit(util[_0xb989('0xf')]('%s:queue:%s',_0x20ca7b,_0x5e0046),util[_0xb989('0xf')]('%s_queue_waiting_interaction:%s',_0x20ca7b,_0x43caa1?_0xb989('0x12'):_0xb989('0x13')),_[_0xb989('0x11')](_0x1ada8c,attributes));}var rpc={'openchannelQueueReport':require(_0xb989('0x14')),'mailQueueReport':require(_0xb989('0x15')),'chatQueueReport':require(_0xb989('0x16')),'smsQueueReport':require(_0xb989('0x17')),'faxQueueReport':require(_0xb989('0x18')),'whatsappQueueReport':require(_0xb989('0x19'))};var queue=schema({'name':{'type':_0xb989('0x1a'),'required':!![],'message':_0xb989('0x1b')},'timeout':{'type':_0xb989('0x1c'),'message':_0xb989('0x1d')}});function startRouting(_0x396293,_0x125b76,_0x940616,_0x4aa0c5){if(_0x396293&&_0x125b76&&_0x940616){_0x125b76[_0xb989('0x1e')]+=0x1;var _0x290594={'uniqueid':_0x396293,'from':_0x940616[_0xb989('0x1f')]?_0x940616[_0xb989('0x1f')][_0xb989('0x20')]:'','joinAt':moment()['format'](_0xb989('0x21')),'ContactId':_0x940616[_0xb989('0x22')]?_0x940616[_0xb989('0x22')]['id']:null,'ListId':_0x940616[_0xb989('0x23')]?_0x940616['list']['id']:null};_0x290594[_[_0xb989('0x24')](_0x940616[_0xb989('0x25')])+_0xb989('0x26')]=_0x125b76['id']||null;_0x290594[_[_0xb989('0x24')](_0x940616[_0xb989('0x25')])+_0xb989('0x27')]=_0x940616['interaction']?_0x940616[_0xb989('0x28')]['id']:null;_0x290594[_[_0xb989('0x24')](_0x940616['channel'])+'MessageId']=_0x940616[_0xb989('0x29')]?_0x940616[_0xb989('0x29')]['id']:null;_0x290594[_[_0xb989('0x24')](_0x940616[_0xb989('0x25')])+(_0x940616['channel']!==_0xb989('0x2a')?_0xb989('0x2b'):_0xb989('0x2c'))]=_0x940616['account']?_0x940616['account']['id']:null;logger['info'](util[_0xb989('0xf')]('[%s][START:QUEUE][NAME:%s]',_0x396293,_0x125b76['name']));emitChannelQueueInteraction(_0x940616[_0xb989('0x25')],_0x125b76[_0xb989('0x2d')],_0x290594,_0x940616[_0xb989('0xb')]['name'],_0x940616[_0xb989('0x29')]['id'],!![],_0x4aa0c5,_0x125b76['id']);if(rpc[_0x940616[_0xb989('0x25')]+'QueueReport']){return rpc[_0x940616[_0xb989('0x25')]+_0xb989('0x2e')][_0xb989('0x2f')](_0x290594)[_0xb989('0x30')](function(_0x410cb0){logger['error'](_0xb989('0x31'));});}}}function stopRouting(_0xbce251,_0x3c034c,_0x1fa1d8,_0x75f47){if(_0xbce251&&_0x3c034c){_0x3c034c[_0xb989('0x1e')]-=0x1;var _0x5c61aa={'leaveAt':moment()[_0xb989('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xb989('0xf')](_0xb989('0x21')),'reason':_0xb989('0x32')};logger[_0xb989('0x33')](util[_0xb989('0xf')]('[%s][STOP:QUEUE][NAME:%s]',_0xbce251,_0x3c034c[_0xb989('0x2d')]));emitChannelQueueInteraction(_0x1fa1d8['channel'],_0x3c034c[_0xb989('0x2d')],_0x1fa1d8[_0xb989('0x1f')],_0x1fa1d8['account'][_0xb989('0x2d')],_0x1fa1d8[_0xb989('0x29')]['id'],![],_0x75f47,_0x3c034c['id']);if(rpc[_0x1fa1d8['channel']+_0xb989('0x2e')]){return rpc[_0x1fa1d8['channel']+'QueueReport'][_0xb989('0x34')](_0xbce251,_0x5c61aa)[_0xb989('0x30')](function(_0x126edd){logger[_0xb989('0x35')](_0xb989('0x36'));});}}}function endRouting(_0x3a2188,_0xb7a33f,_0x54237d,_0x17d1be){if(_0x3a2188&&_0xb7a33f){_0xb7a33f[_0xb989('0x1e')]-=0x1;var _0x3d0e25={'leaveAt':moment()[_0xb989('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xb989('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xb989('0x37')};logger[_0xb989('0x33')](util[_0xb989('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x3a2188,_0xb7a33f[_0xb989('0x2d')]));emitChannelQueueInteraction(_0x54237d['channel'],_0xb7a33f['name'],_0x54237d[_0xb989('0x1f')],_0x54237d[_0xb989('0xb')][_0xb989('0x2d')],_0x54237d[_0xb989('0x29')]['id'],![],_0x17d1be);if(rpc[_0x54237d['channel']+_0xb989('0x2e')]){return rpc[_0x54237d[_0xb989('0x25')]+_0xb989('0x2e')][_0xb989('0x34')](_0x3a2188,_0x3d0e25)[_0xb989('0x30')](function(_0x268d58){logger[_0xb989('0x35')](_0xb989('0x36'));});}}}function handleFindQueue(_0x1bf548){return function(_0x5f447b){return _0x5f447b[_0xb989('0x2d')][_0xb989('0x38')]()===_0x1bf548['toLowerCase']();};}exports['consequence']=function(_0x26eecb,_0x50d55b,_0x45c480,_0x1950a5){return function(_0x430a88){try{var _0x29c33f={'name':_0x50d55b[0x0],'timeout':_0x50d55b[0x1]};var _0x5e3fab=queue[_0xb989('0x0')](_0x29c33f,{'typecast':!![]});if(_0x5e3fab[_0xb989('0x39')]){logger[_0xb989('0x35')](_0xb989('0x3a'),_0x26eecb,_['map'](_0x5e3fab,_0xb989('0x29'))[_0xb989('0x3b')](',\x20'));_0x430a88[_0xb989('0x3c')]();}else{var _0x3422b4=_['find'](_0x45c480[_0x1950a5['channel']+_0xb989('0x3d')],handleFindQueue(_0x29c33f['name']));if(_0x3422b4){startRouting(_0x26eecb,_0x3422b4,_0x1950a5,_0x45c480);var _0x5c1097=(_0x3422b4[_0xb989('0x37')]||0xa)*0x3e8;var _0x57c071=(_0x29c33f[_0xb989('0x37')]||0x14)*0x3e8;var _0x478baa,_0x3cb025;if(_0x5c1097>_0x57c071){_0x57c071=_0x5c1097;}var _0x2f718e=seqqueue[_0xb989('0x3e')](_0x5c1097);_0x2f718e['id']=_0x26eecb;_0x2f718e[_0xb989('0x3f')]=_0x5c1097;_0x2f718e['qtimeout']=_0x57c071;_0x2f718e[_0xb989('0x25')]=_0x1950a5[_0xb989('0x25')];_0x45c480['rules'][_0x26eecb]['on'](_0xb989('0x40'),function(){logger['info'](_0xb989('0x41'),_0x26eecb);stopRouting(_0x26eecb,_0x3422b4,_0x1950a5,_0x45c480);clearTimeout(_0x478baa);_0x478baa=undefined;_0x2f718e['close'](!![]);if(_0x45c480[_0xb989('0x42')][_0x26eecb]){delete _0x45c480[_0xb989('0x42')][_0x26eecb];}_0x430a88[_0xb989('0x3c')]();});_0x45c480[_0xb989('0x42')][_0x26eecb]['on'](_0xb989('0x43'),function(){if(_0x45c480[_0xb989('0x42')][_0x26eecb]){delete _0x45c480[_0xb989('0x42')][_0x26eecb];}});_0x478baa=setTimeout(function(){logger[_0xb989('0x33')](_0xb989('0x44'),_0x26eecb);endRouting(_0x26eecb,_0x3422b4,_0x1950a5,_0x45c480);clearTimeout(_0x478baa);_0x2f718e[_0xb989('0x45')](!![]);_0x430a88[_0xb989('0x46')]();},_0x57c071);switch(_0x3422b4[_0xb989('0x47')]){case _0xb989('0x48'):strategy[_0xb989('0x48')](_0x2f718e,_0x3422b4,_0x45c480,_0x1950a5);break;default:strategy['beepall'](_0x2f718e,_0x3422b4,_0x45c480,_0x1950a5);}}else{logger[_0xb989('0x35')](_0xb989('0x49'),_0x26eecb,_0x29c33f[_0xb989('0x2d')]);_0x430a88[_0xb989('0x3c')]();}}}catch(_0x5cce57){console[_0xb989('0x4a')](_0x5cce57);logger[_0xb989('0x35')]('[%s][QUEUE]\x20%s',_0x26eecb,_0x5cce57[_0xb989('0x4b')]);_0x430a88['stop']();}};}; \ No newline at end of file +var _0x3589=['next','strategy','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','moment','ioredis','../../../../config/environment','routing','./strategy','redis','localhost','socket.io-emitter','account','queue','from','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','contact','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','name','QueueReport','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','info','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x3589,0x94));var _0x9358=function(_0xbe2e8,_0x424ee5){_0xbe2e8=_0xbe2e8-0x0;var _0x41dbf4=_0x3589[_0xbe2e8];return _0x41dbf4;};'use strict';var schema=require(_0x9358('0x0'));var _=require('lodash');var util=require(_0x9358('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x9358('0x2'));var Redis=require(_0x9358('0x3'));var config=require(_0x9358('0x4'));var logger=require('../../../../config/logger')(_0x9358('0x5'));var strategy=require(_0x9358('0x6'));config['redis']=_['defaults'](config[_0x9358('0x7')],{'host':_0x9358('0x8'),'port':0x18eb});var io=require(_0x9358('0x9'))(new Redis(config[_0x9358('0x7')]));var attributes=['id','queue_id',_0x9358('0xa'),_0x9358('0xb'),_0x9358('0xc'),'joinAt'];function emit(_0x1b400c,_0xf57a6a,_0xc1d876){io['to'](_0x1b400c)['emit'](_0xf57a6a,_0xc1d876);}function emitChannelQueueInteraction(_0x1fb2cf,_0x53021d,_0x2963d9,_0x29a9ef,_0x26add6,_0x130a4b,_0x462679,_0x3679cb){var _0x1618fe=_['clone'](_0x2963d9);_0x1618fe['queue_id']=_0x3679cb;_0x1618fe[_0x9358('0xb')]=_0x53021d;_0x1618fe[_0x9358('0xa')]=_0x29a9ef;_0x1618fe['id']=_0x26add6;if(_0x130a4b){_0x462679[util[_0x9358('0xd')](_0x9358('0xe'),_0x1fb2cf)][_0x26add6]=_[_0x9358('0xf')](_0x1618fe,attributes);}else{delete _0x462679[util[_0x9358('0xd')](_0x9358('0xe'),_0x1fb2cf)][_0x26add6];}emit(util[_0x9358('0xd')](_0x9358('0x10'),_0x1fb2cf,_0x53021d),util['format'](_0x9358('0x11'),_0x1fb2cf,_0x130a4b?_0x9358('0x12'):'remove'),_[_0x9358('0xf')](_0x1618fe,attributes));}var rpc={'openchannelQueueReport':require(_0x9358('0x13')),'mailQueueReport':require(_0x9358('0x14')),'chatQueueReport':require(_0x9358('0x15')),'smsQueueReport':require(_0x9358('0x16')),'faxQueueReport':require(_0x9358('0x17')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0x9358('0x18')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x146282,_0x3e3904,_0x1b4a1f,_0x8d6c07){if(_0x146282&&_0x3e3904&&_0x1b4a1f){_0x3e3904[_0x9358('0x19')]+=0x1;var _0xf1e778={'uniqueid':_0x146282,'from':_0x1b4a1f[_0x9358('0x1a')]?_0x1b4a1f['body'][_0x9358('0xc')]:'','joinAt':moment()[_0x9358('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b4a1f['contact']?_0x1b4a1f[_0x9358('0x1b')]['id']:null,'ListId':_0x1b4a1f['list']?_0x1b4a1f['list']['id']:null};_0xf1e778[_[_0x9358('0x1c')](_0x1b4a1f[_0x9358('0x1d')])+'QueueId']=_0x3e3904['id']||null;_0xf1e778[_[_0x9358('0x1c')](_0x1b4a1f[_0x9358('0x1d')])+_0x9358('0x1e')]=_0x1b4a1f[_0x9358('0x1f')]?_0x1b4a1f[_0x9358('0x1f')]['id']:null;_0xf1e778[_[_0x9358('0x1c')](_0x1b4a1f[_0x9358('0x1d')])+_0x9358('0x20')]=_0x1b4a1f[_0x9358('0x21')]?_0x1b4a1f[_0x9358('0x21')]['id']:null;_0xf1e778[_[_0x9358('0x1c')](_0x1b4a1f[_0x9358('0x1d')])+(_0x1b4a1f[_0x9358('0x1d')]!==_0x9358('0x22')?_0x9358('0x23'):_0x9358('0x24'))]=_0x1b4a1f[_0x9358('0xa')]?_0x1b4a1f[_0x9358('0xa')]['id']:null;logger['info'](util[_0x9358('0xd')]('[%s][START:QUEUE][NAME:%s]',_0x146282,_0x3e3904[_0x9358('0x25')]));emitChannelQueueInteraction(_0x1b4a1f['channel'],_0x3e3904[_0x9358('0x25')],_0xf1e778,_0x1b4a1f['account'][_0x9358('0x25')],_0x1b4a1f[_0x9358('0x21')]['id'],!![],_0x8d6c07,_0x3e3904['id']);if(rpc[_0x1b4a1f['channel']+_0x9358('0x26')]){return rpc[_0x1b4a1f[_0x9358('0x1d')]+_0x9358('0x26')]['create'](_0xf1e778)[_0x9358('0x27')](function(_0x1b72b0){logger[_0x9358('0x28')](_0x9358('0x29'));});}}}function stopRouting(_0x3f2971,_0x2c31c2,_0x1af22b,_0x80924d){if(_0x3f2971&&_0x2c31c2){_0x2c31c2[_0x9358('0x19')]-=0x1;var _0x38e9cb={'leaveAt':moment()[_0x9358('0xd')](_0x9358('0x2a')),'acceptAt':moment()[_0x9358('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x9358('0x2b')};logger[_0x9358('0x2c')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x3f2971,_0x2c31c2[_0x9358('0x25')]));emitChannelQueueInteraction(_0x1af22b[_0x9358('0x1d')],_0x2c31c2[_0x9358('0x25')],_0x1af22b[_0x9358('0x1a')],_0x1af22b[_0x9358('0xa')][_0x9358('0x25')],_0x1af22b['message']['id'],![],_0x80924d,_0x2c31c2['id']);if(rpc[_0x1af22b['channel']+_0x9358('0x26')]){return rpc[_0x1af22b[_0x9358('0x1d')]+_0x9358('0x26')][_0x9358('0x2d')](_0x3f2971,_0x38e9cb)[_0x9358('0x27')](function(_0xb7744d){logger[_0x9358('0x28')](_0x9358('0x2e'));});}}}function endRouting(_0x2e8876,_0x4f26d3,_0x4109d5,_0x4e8590){if(_0x2e8876&&_0x4f26d3){_0x4f26d3['waiting']-=0x1;var _0x4d90ba={'leaveAt':moment()[_0x9358('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x9358('0xd')](_0x9358('0x2a')),'reason':_0x9358('0x2f')};logger[_0x9358('0x2c')](util[_0x9358('0xd')](_0x9358('0x30'),_0x2e8876,_0x4f26d3[_0x9358('0x25')]));emitChannelQueueInteraction(_0x4109d5[_0x9358('0x1d')],_0x4f26d3[_0x9358('0x25')],_0x4109d5[_0x9358('0x1a')],_0x4109d5[_0x9358('0xa')][_0x9358('0x25')],_0x4109d5[_0x9358('0x21')]['id'],![],_0x4e8590);if(rpc[_0x4109d5['channel']+_0x9358('0x26')]){return rpc[_0x4109d5[_0x9358('0x1d')]+_0x9358('0x26')]['update'](_0x2e8876,_0x4d90ba)[_0x9358('0x27')](function(_0x67e84a){logger[_0x9358('0x28')](_0x9358('0x2e'));});}}}function handleFindQueue(_0x3ab2e6){return function(_0x4054c2){return _0x4054c2[_0x9358('0x25')][_0x9358('0x31')]()===_0x3ab2e6[_0x9358('0x31')]();};}exports[_0x9358('0x32')]=function(_0x243541,_0x5f2b36,_0x544ae2,_0x49c4bc){return function(_0x2f3135){try{var _0xb85216={'name':_0x5f2b36[0x0],'timeout':_0x5f2b36[0x1]};var _0x474776=queue['validate'](_0xb85216,{'typecast':!![]});if(_0x474776[_0x9358('0x33')]){logger[_0x9358('0x28')](_0x9358('0x34'),_0x243541,_['map'](_0x474776,'message')[_0x9358('0x35')](',\x20'));_0x2f3135[_0x9358('0x36')]();}else{var _0x3d992c=_[_0x9358('0x37')](_0x544ae2[_0x49c4bc[_0x9358('0x1d')]+'Queues'],handleFindQueue(_0xb85216[_0x9358('0x25')]));if(_0x3d992c){startRouting(_0x243541,_0x3d992c,_0x49c4bc,_0x544ae2);var _0x218a3e=(_0x3d992c['timeout']||0xa)*0x3e8;var _0x38999d=(_0xb85216[_0x9358('0x2f')]||0x14)*0x3e8;var _0x9a8276,_0x2454f1;if(_0x218a3e>_0x38999d){_0x38999d=_0x218a3e;}var _0x51067e=seqqueue[_0x9358('0x38')](_0x218a3e);_0x51067e['id']=_0x243541;_0x51067e[_0x9358('0x39')]=_0x218a3e;_0x51067e[_0x9358('0x3a')]=_0x38999d;_0x51067e['channel']=_0x49c4bc[_0x9358('0x1d')];_0x544ae2[_0x9358('0x3b')][_0x243541]['on'](_0x9358('0x3c'),function(){logger[_0x9358('0x2c')](_0x9358('0x3d'),_0x243541);stopRouting(_0x243541,_0x3d992c,_0x49c4bc,_0x544ae2);clearTimeout(_0x9a8276);_0x9a8276=undefined;_0x51067e[_0x9358('0x3e')](!![]);if(_0x544ae2[_0x9358('0x3b')][_0x243541]){delete _0x544ae2[_0x9358('0x3b')][_0x243541];}_0x2f3135[_0x9358('0x36')]();});_0x544ae2[_0x9358('0x3b')][_0x243541]['on'](_0x9358('0x3f'),function(){if(_0x544ae2[_0x9358('0x3b')][_0x243541]){delete _0x544ae2['rules'][_0x243541];}});_0x9a8276=setTimeout(function(){logger[_0x9358('0x2c')](_0x9358('0x40'),_0x243541);endRouting(_0x243541,_0x3d992c,_0x49c4bc,_0x544ae2);clearTimeout(_0x9a8276);_0x51067e[_0x9358('0x3e')](!![]);_0x2f3135[_0x9358('0x41')]();},_0x38999d);switch(_0x3d992c[_0x9358('0x42')]){case'rrmemory':strategy['rrmemory'](_0x51067e,_0x3d992c,_0x544ae2,_0x49c4bc);break;default:strategy[_0x9358('0x43')](_0x51067e,_0x3d992c,_0x544ae2,_0x49c4bc);}}else{logger['error'](_0x9358('0x44'),_0x243541,_0xb85216[_0x9358('0x25')]);_0x2f3135[_0x9358('0x36')]();}}}catch(_0x56702a){console[_0x9358('0x45')](_0x56702a);logger['error']('[%s][QUEUE]\x20%s',_0x243541,_0x56702a[_0x9358('0x46')]);_0x2f3135['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 fa84c10..fd553f0 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 _0x75a7=['info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','busy','STOP','TIMEOUT','exports','lodash','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push'];(function(_0x14885f,_0x43cc2b){var _0x3ded9e=function(_0x422cbb){while(--_0x422cbb){_0x14885f['push'](_0x14885f['shift']());}};_0x3ded9e(++_0x43cc2b);}(_0x75a7,0x91));var _0x775a=function(_0x619a57,_0x4c76b1){_0x619a57=_0x619a57-0x0;var _0x49cdb0=_0x75a7[_0x619a57];return _0x49cdb0;};'use strict';var _=require(_0x775a('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x775a('0x1'))('routing');var Agent=function(_0x1ef2e0,_0x487664,_0x46822e,_0x57e712){this[_0x775a('0x2')]=uuid['v4']();this[_0x775a('0x3')]=_0x1ef2e0;this[_0x775a('0x4')]=_0x487664;this[_0x775a('0x5')]=_0x46822e;this[_0x775a('0x6')]=_0x57e712;this[_0x775a('0x3')]['push'](this[_0x775a('0x7')][_0x775a('0x8')](this),this[_0x775a('0x9')]['bind'](this));this[_0x775a('0x3')]['on'](_0x775a('0xa'),this[_0x775a('0x9')][_0x775a('0x8')](this));this[_0x775a('0x3')]['on'](_0x775a('0xb'),this[_0x775a('0xc')][_0x775a('0x8')](this));};Agent[_0x775a('0xd')][_0x775a('0xe')]=function(){this['squeue'][_0x775a('0xe')](this[_0x775a('0x7')][_0x775a('0x8')](this),this[_0x775a('0x9')][_0x775a('0x8')](this));};Agent[_0x775a('0xd')]['handleDrained']=function(){this[_0x775a('0x9')](!![]);};Agent[_0x775a('0xd')]['handleRun']=function(_0x4e0bcf){logger[_0x775a('0xf')](_0x775a('0x10'),this[_0x775a('0x3')]['id'],this['agent']['id']);if(_[_0x775a('0x11')](this[_0x775a('0x5')][_0x775a('0x12')][this[_0x775a('0x4')]['id']])){logger[_0x775a('0xf')](_0x775a('0x13'),this[_0x775a('0x3')]['id'],this[_0x775a('0x4')]['id']);setTimeout(this[_0x775a('0xe')]['bind'](this),0x3e8);}else{if(this[_0x775a('0x6')][_0x775a('0x14')]||util[_0x775a('0x15')](this[_0x775a('0x3')]['id'],this[_0x775a('0x5')][_0x775a('0x12')][this['agent']['id']],this[_0x775a('0x3')][_0x775a('0x16')],![])){this[_0x775a('0x5')][_0x775a('0x12')][this[_0x775a('0x4')]['id']]['busy']=!![];this[_0x775a('0x5')][_0x775a('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x775a('0x17')](this[_0x775a('0x2')],this[_0x775a('0x3')]['id'],this[_0x775a('0x5')]['agents'][this[_0x775a('0x4')]['id']],null,this[_0x775a('0x6')]);util[_0x775a('0x18')](this[_0x775a('0x3')]['id'],this['realtime'][_0x775a('0x12')][this[_0x775a('0x4')]['id']],_0x775a('0x19')+(this[_0x775a('0x6')]['forcedOwnership']?_0x775a('0x1a'):''));}else{logger[_0x775a('0xf')](_0x775a('0x1b'),this[_0x775a('0x3')]['id'],this[_0x775a('0x4')]['id']);setTimeout(this[_0x775a('0xe')][_0x775a('0x8')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x4a5b50){if(_[_0x775a('0x11')](this[_0x775a('0x5')][_0x775a('0x12')][this[_0x775a('0x4')]['id']])){return logger[_0x775a('0xf')](_0x775a('0x13'),this['squeue']['id'],this[_0x775a('0x4')]['id']);}else{logger[_0x775a('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this['agent']['id']);util['hideNotification'](this['notificationId'],this[_0x775a('0x3')]['id'],this[_0x775a('0x5')][_0x775a('0x12')][this['agent']['id']],null,this['routing']);this['realtime'][_0x775a('0x12')][this[_0x775a('0x4')]['id']][_0x775a('0x1c')]=![];this[_0x775a('0x5')][_0x775a('0x12')][this[_0x775a('0x4')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0x775a('0x3')]['id'],this[_0x775a('0x5')][_0x775a('0x12')][this[_0x775a('0x4')]['id']],_0x4a5b50?_0x775a('0x1d'):_0x775a('0x1e'));}if(!_0x4a5b50){setTimeout(this['push'][_0x775a('0x8')](this),0x3e8);}};function agent(_0x41618b,_0x4d07ab,_0x548f74,_0x11639c){return new Agent(_0x41618b,_0x4d07ab,_0x548f74,_0x11639c);}module[_0x775a('0x1f')]=agent; \ No newline at end of file +var _0x9ab3=['agent','push','bind','handleTimeout','drained','handleDrained','prototype','handleRun','isNil','realtime','agents','info','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x3eab0b,_0x291b6d){var _0x59e91d=function(_0x10439b){while(--_0x10439b){_0x3eab0b['push'](_0x3eab0b['shift']());}};_0x59e91d(++_0x291b6d);}(_0x9ab3,0xcd));var _0x39ab=function(_0x4de131,_0x4ea93d){_0x4de131=_0x4de131-0x0;var _0x39481b=_0x9ab3[_0x4de131];return _0x39481b;};'use strict';var _=require('lodash');var uuid=require(_0x39ab('0x0'));var util=require('./util');var logger=require(_0x39ab('0x1'))(_0x39ab('0x2'));var Agent=function(_0x2164a2,_0xc9a3e3,_0x3b0872,_0x5d87a9){this[_0x39ab('0x3')]=uuid['v4']();this[_0x39ab('0x4')]=_0x2164a2;this[_0x39ab('0x5')]=_0xc9a3e3;this['realtime']=_0x3b0872;this['routing']=_0x5d87a9;this['squeue'][_0x39ab('0x6')](this['handleRun'][_0x39ab('0x7')](this),this['handleTimeout'][_0x39ab('0x7')](this));this['squeue']['on']('timeout',this[_0x39ab('0x8')]['bind'](this));this[_0x39ab('0x4')]['on'](_0x39ab('0x9'),this[_0x39ab('0xa')]['bind'](this));};Agent[_0x39ab('0xb')][_0x39ab('0x6')]=function(){this[_0x39ab('0x4')][_0x39ab('0x6')](this[_0x39ab('0xc')][_0x39ab('0x7')](this),this['handleTimeout'][_0x39ab('0x7')](this));};Agent[_0x39ab('0xb')][_0x39ab('0xa')]=function(){this[_0x39ab('0x8')](!![]);};Agent[_0x39ab('0xb')]['handleRun']=function(_0x3a3b7f){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x39ab('0x4')]['id'],this[_0x39ab('0x5')]['id']);if(_[_0x39ab('0xd')](this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']])){logger[_0x39ab('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x39ab('0x4')]['id'],this[_0x39ab('0x5')]['id']);setTimeout(this[_0x39ab('0x6')][_0x39ab('0x7')](this),0x3e8);}else{if(this[_0x39ab('0x2')][_0x39ab('0x11')]||util[_0x39ab('0x12')](this[_0x39ab('0x4')]['id'],this[_0x39ab('0xe')][_0x39ab('0xf')][this['agent']['id']],this['squeue']['channel'],![])){this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']][_0x39ab('0x13')]=!![];this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']][_0x39ab('0x14')]=undefined;util[_0x39ab('0x15')](this[_0x39ab('0x3')],this['squeue']['id'],this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']],null,this[_0x39ab('0x2')]);util[_0x39ab('0x16')](this[_0x39ab('0x4')]['id'],this['realtime'][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']],_0x39ab('0x17')+(this[_0x39ab('0x2')]['forcedOwnership']?_0x39ab('0x18'):''));}else{logger[_0x39ab('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x39ab('0x4')]['id'],this[_0x39ab('0x5')]['id']);setTimeout(this[_0x39ab('0x6')][_0x39ab('0x7')](this),0x3e8);}}};Agent[_0x39ab('0xb')][_0x39ab('0x8')]=function(_0x19f430){if(_[_0x39ab('0xd')](this['realtime']['agents'][this[_0x39ab('0x5')]['id']])){return logger['info'](_0x39ab('0x19'),this[_0x39ab('0x4')]['id'],this[_0x39ab('0x5')]['id']);}else{logger[_0x39ab('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x39ab('0x4')]['id'],this[_0x39ab('0x5')]['id']);util[_0x39ab('0x1a')](this[_0x39ab('0x3')],this['squeue']['id'],this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']],null,this[_0x39ab('0x2')]);this['realtime']['agents'][this[_0x39ab('0x5')]['id']]['busy']=![];this['realtime']['agents'][this['agent']['id']][_0x39ab('0x14')]=undefined;util[_0x39ab('0x16')](this[_0x39ab('0x4')]['id'],this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']],_0x19f430?_0x39ab('0x1b'):_0x39ab('0x1c'));}if(!_0x19f430){setTimeout(this['push'][_0x39ab('0x7')](this),0x3e8);}};function agent(_0x3a0d80,_0x484dfb,_0x2ef7df,_0x5523ad){return new Agent(_0x3a0d80,_0x484dfb,_0x2ef7df,_0x5523ad);}module[_0x39ab('0x1d')]=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 f763699..ba2a91b 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 _0x8d0a=['[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','busy','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleDrained','prototype','handleTimeout','isNil','queue','Agents','length','agents','info','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY'];(function(_0x3658ca,_0x6061d){var _0x4c2eea=function(_0x47906f){while(--_0x47906f){_0x3658ca['push'](_0x3658ca['shift']());}};_0x4c2eea(++_0x6061d);}(_0x8d0a,0x65));var _0xa8d0=function(_0x44061d,_0x41eda2){_0x44061d=_0x44061d-0x0;var _0x274fb3=_0x8d0a[_0x44061d];return _0x274fb3;};'use strict';var _=require(_0xa8d0('0x0'));var uuid=require('uuid');var util=require(_0xa8d0('0x1'));var logger=require(_0xa8d0('0x2'))(_0xa8d0('0x3'));var Beepall=function(_0x10995c,_0x6ec9e7,_0x477190,_0x528287){this[_0xa8d0('0x4')]=uuid['v4']();this[_0xa8d0('0x5')]=_0x10995c;this['queue']=_0x6ec9e7;this[_0xa8d0('0x6')]=_0x477190;this[_0xa8d0('0x3')]=_0x528287;this[_0xa8d0('0x5')][_0xa8d0('0x7')](this[_0xa8d0('0x8')]['bind'](this),this['handleTimeout'][_0xa8d0('0x9')](this));this[_0xa8d0('0x5')]['on']('timeout',this['handleTimeout']['bind'](this));this[_0xa8d0('0x5')]['on']('drained',this[_0xa8d0('0xa')][_0xa8d0('0x9')](this));};Beepall[_0xa8d0('0xb')][_0xa8d0('0x7')]=function(){this[_0xa8d0('0x5')][_0xa8d0('0x7')](this[_0xa8d0('0x8')][_0xa8d0('0x9')](this),this[_0xa8d0('0xc')][_0xa8d0('0x9')](this));};Beepall[_0xa8d0('0xb')]['handleDrained']=function(_0x757540){this['handleTimeout'](!![]);};Beepall['prototype'][_0xa8d0('0x8')]=function(_0x2816d1){var _0x523ec0=!![];if(!_[_0xa8d0('0xd')](this[_0xa8d0('0xe')])&&!_[_0xa8d0('0xd')](this[_0xa8d0('0xe')][_0xa8d0('0xf')])&&this[_0xa8d0('0xe')]['Agents'][_0xa8d0('0x10')]>0x0){for(var _0x470b4a=0x0,_0x5cf619;_0x470b4a0x0){for(var _0x14837d=0x0,_0x3a05ca;_0x14837d0x0&&_0x4ecf4c[_0x41f89e+_0x6704('0x2b')]>=_0x4ecf4c[_0x41f89e+_0x6704('0x2a')]){writeLog(_0x3cd12e,_0x4ecf4c,_0x41f89e['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x6704('0x2c')]=function(_0xf875dc,_0x86fc1d,_0x38f9fe,_0x4a9c3e,_0x1def46){return sendNotification(!![],_0xf875dc,_0x86fc1d,_0x38f9fe,_0x4a9c3e,_0x1def46);};exports[_0x6704('0x2d')]=function(_0x5c229d,_0x588814,_0x16e749,_0x5363c9,_0x812ba2){return sendNotification(![],_0x5c229d,_0x588814,_0x16e749,_0x5363c9,_0x812ba2);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x627e=['notificationSound','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','message','user:%s','save','remove','info','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','routing','redis','socket.io-emitter','emit','name','user:save','split','\x20interaction'];(function(_0xa91f96,_0x28ef8a){var _0x110c35=function(_0x4a9722){while(--_0x4a9722){_0xa91f96['push'](_0xa91f96['shift']());}};_0x110c35(++_0x28ef8a);}(_0x627e,0x14a));var _0xe627=function(_0xedbcb,_0x1f198d){_0xedbcb=_0xedbcb-0x0;var _0x10aa53=_0x627e[_0xedbcb];return _0x10aa53;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var utils=require(_0xe627('0x2'));var Mustache=require(_0xe627('0x3'));var Redis=require(_0xe627('0x4'));var config=require('../../../../../config/environment');var logger=require(_0xe627('0x5'))(_0xe627('0x6'));config[_0xe627('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe627('0x8'))(new Redis(config[_0xe627('0x7')]));function emit(_0x45e49a,_0x2d4f63,_0xd5016e){io['to'](_0x45e49a)[_0xe627('0x9')](_0x2d4f63,_0xd5016e);}function sendNotification(_0x4bae52,_0x3f2948,_0x4c9bf9,_0x56549e,_0x4411c0,_0x952c23){io['to'](util['format']('user:%s',_0x56549e[_0xe627('0xa')]))[_0xe627('0x9')](_0xe627('0xb'),_0x56549e);var _0x4543f5=_0x952c23||{};var _0x3d3c22=_0x4c9bf9[_0xe627('0xc')]('.');var _0x24261d={'uniqueid':_0x3f2948,'channel':_0x3d3c22[0x0],'id':_0x3d3c22[0x1],'title':_0x3d3c22[0x0]+_0xe627('0xd'),'interactionId':_0x3d3c22[0x2],'queue':_0x4411c0?_0x4411c0[_0xe627('0xa')]:null,'sound':_0x4543f5['account'][_0xe627('0xe')],'shake':_0x4543f5[_0xe627('0xf')][_0xe627('0x10')]};try{if(!_0x4543f5['body']){_0x4543f5[_0xe627('0x11')]={};}if(_0x4411c0){_0x4543f5[_0xe627('0x11')][_0xe627('0x12')]=_0x4411c0;}else if(_0x4543f5[_0xe627('0x11')][_0xe627('0x12')]){delete _0x4543f5[_0xe627('0x11')][_0xe627('0x12')];}_0x24261d['msg']=utils[_0xe627('0x13')](_0x4543f5[_0xe627('0xf')][_0xe627('0x14')],_0x4543f5);}catch(_0x76fac){_0x24261d[_0xe627('0x15')]=_0xe627('0x16');logger[_0xe627('0x17')](util[_0xe627('0x18')]('[%s][QUEUE]\x20%s',_0x3f2948,_0x76fac[_0xe627('0x19')]));}io['to'](util['format'](_0xe627('0x1a'),_0x56549e['name']))['emit'](util[_0xe627('0x18')]('notification:%s',_0x4bae52?_0xe627('0x1b'):_0xe627('0x1c')),_0x24261d);}function writeLog(_0x4adde7,_0x4c9b97,_0x4ecfa6){return logger[_0xe627('0x1d')](util[_0xe627('0x18')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x4adde7,_0x4c9b97[_0xe627('0xa')],_0x4ecfa6));}exports[_0xe627('0x1e')]=function(_0x4873e6,_0x44861b,_0x29221b,_0x52d492){if(_0x44861b[_0xe627('0x1f')]){writeLog(_0x4873e6,_0x44861b,_0xe627('0x20'));return![];}if(!_0x44861b[_0xe627('0x21')]){writeLog(_0x4873e6,_0x44861b,'OFFLINE');return![];}if(_0x44861b[_0x29221b+_0xe627('0x22')]){writeLog(_0x4873e6,_0x44861b,_0xe627('0x23'));return![];}if(_0x52d492&&_0x44861b[_0xe627('0x24')](_0x29221b+_0xe627('0x25'))&&_0x44861b['hasOwnProperty'](_0x29221b+_0xe627('0x26'))){if(_0x44861b[_0x29221b+_0xe627('0x25')]>0x0&&_0x44861b[_0x29221b+_0xe627('0x26')]>=_0x44861b[_0x29221b+_0xe627('0x25')]){writeLog(_0x4873e6,_0x44861b,_0x29221b[_0xe627('0x27')]()+_0xe627('0x28'));return![];}}return!![];};exports[_0xe627('0x29')]=function(_0x44c9f7,_0x3e9eda,_0x58c728,_0x5ad327,_0x5aeba1){return sendNotification(!![],_0x44c9f7,_0x3e9eda,_0x58c728,_0x5ad327,_0x5aeba1);};exports['hideNotification']=function(_0x1e0bd7,_0xdf63c8,_0x5799a3,_0x39c23f,_0x54029d){return sendNotification(![],_0x1e0bd7,_0xdf63c8,_0x5799a3,_0x39c23f,_0x54029d);};exports[_0xe627('0x2a')]=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 5081099..58fc393 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 _0xc688=['validate','shelljs','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','map','message','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','stringify'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0xc688,0xc0));var _0x8c68=function(_0x3e7d3c,_0x42973c){_0x3e7d3c=_0x3e7d3c-0x0;var _0x5c862e=_0xc688[_0x3e7d3c];return _0x5c862e;};'use strict';var schema=require(_0x8c68('0x0'));var sh=require(_0x8c68('0x1'));var _=require('lodash');var utils=require(_0x8c68('0x2'));var logger=require(_0x8c68('0x3'))('routing');var system=schema({'command':{'type':_0x8c68('0x4'),'required':!![],'message':_0x8c68('0x5')}});exports['consequence']=function(_0x59d028,_0x5302c4){return function(_0x177d30){try{var _0x4d08b8={'command':_0x5302c4[0x0]};var _0x488bd4=system['validate'](_0x4d08b8,{'typecast':!![]});if(_0x488bd4[_0x8c68('0x6')]){logger['error']('[%s][SYSTEM]\x20%s',_0x59d028,_[_0x8c68('0x7')](_0x488bd4,_0x8c68('0x8'))['join'](',\x20'));logger[_0x8c68('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x59d028);_0x177d30[_0x8c68('0xa')]();}else{var _0x150f09=this;var _0xcb9bee=utils[_0x8c68('0xb')](_0x5302c4[0x0],this);logger['info'](_0x8c68('0xc'),_0x59d028,_0xcb9bee);sh[_0x8c68('0xd')](_[_0x8c68('0xe')](_0xcb9bee),function(_0x5bb6ac,_0x1774c4){logger[_0x8c68('0x9')](_0x8c68('0xf'),_0x59d028,_0x5bb6ac);if(_0x5bb6ac==0x0){var _0x2530e5=_0x1774c4[_0x8c68('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x8c68('0x11')](_0x5302c4[0x1])||_[_0x8c68('0x12')](_0x5302c4[0x1])){logger[_0x8c68('0x9')](_0x8c68('0x13'),_0x59d028);_0x150f09['body'][_0x5302c4[0x1]]=_0x2530e5;}else{logger[_0x8c68('0x9')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x59d028,_0x5302c4[0x1],_0x2530e5);_0x150f09[_0x8c68('0x14')][_0x5302c4[0x1]]=_0x2530e5;}}_0x177d30['next']();});}}catch(_0x513d82){logger[_0x8c68('0x15')]('[%s][SYSTEM]\x20%s',_0x59d028,_[_0x8c68('0x16')](_0x513d82)?JSON[_0x8c68('0x17')](_0x513d82):_0x513d82);logger[_0x8c68('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x59d028);_0x177d30['next']();}};}; \ No newline at end of file +var _0xbaf4=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','shelljs','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','message','join','info'];(function(_0x49bef5,_0x5da5e6){var _0x4a6d37=function(_0x45dcb0){while(--_0x45dcb0){_0x49bef5['push'](_0x49bef5['shift']());}};_0x4a6d37(++_0x5da5e6);}(_0xbaf4,0xc4));var _0x4baf=function(_0x22fabc,_0x2fd77b){_0x22fabc=_0x22fabc-0x0;var _0x40d1e6=_0xbaf4[_0x22fabc];return _0x40d1e6;};'use strict';var schema=require('validate');var sh=require(_0x4baf('0x0'));var _=require('lodash');var utils=require(_0x4baf('0x1'));var logger=require(_0x4baf('0x2'))(_0x4baf('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x4baf('0x4')}});exports[_0x4baf('0x5')]=function(_0x1548a7,_0x191d5a){return function(_0xa3d4d4){try{var _0x138a3f={'command':_0x191d5a[0x0]};var _0x6a9f22=system[_0x4baf('0x6')](_0x138a3f,{'typecast':!![]});if(_0x6a9f22[_0x4baf('0x7')]){logger[_0x4baf('0x8')]('[%s][SYSTEM]\x20%s',_0x1548a7,_['map'](_0x6a9f22,_0x4baf('0x9'))[_0x4baf('0xa')](',\x20'));logger[_0x4baf('0xb')](_0x4baf('0xc'),_0x1548a7);_0xa3d4d4[_0x4baf('0xd')]();}else{var _0x21c28a=this;var _0x57d68f=utils[_0x4baf('0xe')](_0x191d5a[0x0],this);logger[_0x4baf('0xb')](_0x4baf('0xf'),_0x1548a7,_0x57d68f);sh[_0x4baf('0x10')](_['trim'](_0x57d68f),function(_0x20d120,_0x86b8eb){logger[_0x4baf('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x1548a7,_0x20d120);if(_0x20d120==0x0){var _0x2ed962=_0x86b8eb[_0x4baf('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x4baf('0x12')](_0x191d5a[0x1])||_[_0x4baf('0x13')](_0x191d5a[0x1])){logger[_0x4baf('0xb')](_0x4baf('0x14'),_0x1548a7);_0x21c28a[_0x4baf('0x15')][_0x191d5a[0x1]]=_0x2ed962;}else{logger[_0x4baf('0xb')](_0x4baf('0x16'),_0x1548a7,_0x191d5a[0x1],_0x2ed962);_0x21c28a[_0x4baf('0x15')][_0x191d5a[0x1]]=_0x2ed962;}}_0xa3d4d4[_0x4baf('0xd')]();});}}catch(_0x303fac){logger['error'](_0x4baf('0x17'),_0x1548a7,_[_0x4baf('0x18')](_0x303fac)?JSON[_0x4baf('0x19')](_0x303fac):_0x303fac);logger[_0x4baf('0xb')](_0x4baf('0xc'),_0x1548a7);_0xa3d4d4['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 e7be501..e1035c9 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 _0xf6a0=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','info','catch','stringify','next','isObject','validate','lodash'];(function(_0x309359,_0x8711b6){var _0x9f542f=function(_0x264db3){while(--_0x264db3){_0x309359['push'](_0x309359['shift']());}};_0x9f542f(++_0x8711b6);}(_0xf6a0,0x136));var _0x0f6a=function(_0x3834cc,_0x358c72){_0x3834cc=_0x3834cc-0x0;var _0x4efc32=_0xf6a0[_0x3834cc];return _0x4efc32;};'use strict';var schema=require(_0x0f6a('0x0'));var _=require(_0x0f6a('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x0f6a('0x2')),'faxInteraction':require(_0x0f6a('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x0f6a('0x4'))(_0x0f6a('0x5'));var tag=schema({'tag':{'type':_0x0f6a('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x129d04,_0x5304d0,_0x114dd6,_0x5e97fb){return function(_0x3e1019){try{var _0x3f29cb={'tag':_0x5304d0[0x0]};var _0x136190=tag[_0x0f6a('0x0')](_0x3f29cb,{'typecast':!![]});if(_0x136190[_0x0f6a('0x7')]){logger[_0x0f6a('0x8')](_0x0f6a('0x9'),_0x129d04,_[_0x0f6a('0xa')](_0x136190,_0x0f6a('0xb'))[_0x0f6a('0xc')](',\x20'));logger['info'](_0x0f6a('0xd'),_0x129d04);_0x3e1019['next']();}else{var _0x4c8d60={'ids':[_0x5304d0[0x0]]};if(rpc[_0x5e97fb[_0x0f6a('0xe')]+_0x0f6a('0xf')]){rpc[_0x5e97fb[_0x0f6a('0xe')]+_0x0f6a('0xf')][_0x0f6a('0x10')](_0x5e97fb[_0x0f6a('0x11')]['id'],_0x4c8d60)[_0x0f6a('0x12')](function(_0x217803){logger[_0x0f6a('0x13')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x129d04,_0x5304d0[0x1],_0x5e97fb['channel'],_0x5e97fb[_0x0f6a('0x11')]['id']);})[_0x0f6a('0x14')](function(_0x500178){logger['error'](_0x0f6a('0x9'),_0x129d04,JSON[_0x0f6a('0x15')](_0x500178));logger[_0x0f6a('0x13')](_0x0f6a('0xd'),_0x129d04);})['finally'](function(){_0x3e1019[_0x0f6a('0x16')]();});}}}catch(_0x114a9e){logger[_0x0f6a('0x8')](_0x0f6a('0x9'),_0x129d04,_[_0x0f6a('0x17')](_0x114a9e)?JSON['stringify'](_0x114a9e):_0x114a9e);logger[_0x0f6a('0x13')](_0x0f6a('0xd'),_0x129d04);_0x3e1019[_0x0f6a('0x16')]();}};}; \ No newline at end of file +var _0x45b8=['stringify','finally','next','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error'];(function(_0x21ac5c,_0x2eee06){var _0x4d85ff=function(_0x3f11eb){while(--_0x3f11eb){_0x21ac5c['push'](_0x21ac5c['shift']());}};_0x4d85ff(++_0x2eee06);}(_0x45b8,0xf7));var _0x845b=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x45b8[_0x45d3f0];return _0x314b79;};'use strict';var schema=require('validate');var _=require(_0x845b('0x0'));var rpc={'chatInteraction':require(_0x845b('0x1')),'openchannelInteraction':require(_0x845b('0x2')),'smsInteraction':require(_0x845b('0x3')),'mailInteraction':require(_0x845b('0x4')),'faxInteraction':require(_0x845b('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x845b('0x6'))(_0x845b('0x7'));var tag=schema({'tag':{'type':_0x845b('0x8'),'required':!![],'message':_0x845b('0x9')}});exports[_0x845b('0xa')]=function(_0x11ca99,_0x2f856a,_0x45c8b8,_0x4f5ba7){return function(_0x341584){try{var _0x2c3b66={'tag':_0x2f856a[0x0]};var _0x12d900=tag[_0x845b('0xb')](_0x2c3b66,{'typecast':!![]});if(_0x12d900[_0x845b('0xc')]){logger['error'](_0x845b('0xd'),_0x11ca99,_[_0x845b('0xe')](_0x12d900,'message')[_0x845b('0xf')](',\x20'));logger[_0x845b('0x10')](_0x845b('0x11'),_0x11ca99);_0x341584['next']();}else{var _0x3a8c8c={'ids':[_0x2f856a[0x0]]};if(rpc[_0x4f5ba7[_0x845b('0x12')]+_0x845b('0x13')]){rpc[_0x4f5ba7[_0x845b('0x12')]+'Interaction']['addTags'](_0x4f5ba7['interaction']['id'],_0x3a8c8c)['then'](function(_0xb402a1){logger[_0x845b('0x10')](_0x845b('0x14'),_0x11ca99,_0x2f856a[0x1],_0x4f5ba7[_0x845b('0x12')],_0x4f5ba7['interaction']['id']);})[_0x845b('0x15')](function(_0x1d19b4){logger[_0x845b('0x16')](_0x845b('0xd'),_0x11ca99,JSON[_0x845b('0x17')](_0x1d19b4));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x11ca99);})[_0x845b('0x18')](function(){_0x341584[_0x845b('0x19')]();});}}}catch(_0x1e9e7a){logger[_0x845b('0x16')]('[%s][TAG]\x20%s',_0x11ca99,_[_0x845b('0x1a')](_0x1e9e7a)?JSON['stringify'](_0x1e9e7a):_0x1e9e7a);logger[_0x845b('0x10')](_0x845b('0x11'),_0x11ca99);_0x341584['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 537f96a..d1764da 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(_0x5c0902,_0x4cd1a5){var _0xb62a2c=function(_0x4d1bf7){while(--_0x4d1bf7){_0x5c0902['push'](_0x5c0902['shift']());}};_0xb62a2c(++_0x4cd1a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x3f4f49,_0xb0e03f){var _0x254263=function(_0x22a23b){while(--_0x22a23b){_0x3f4f49['push'](_0x3f4f49['shift']());}};_0x254263(++_0xb0e03f);}(_0xe706,0xa3));var _0x6e70=function(_0x1d20e5,_0x3d4f74){_0x1d20e5=_0x1d20e5-0x0;var _0x14c8d3=_0xe706[_0x1d20e5];return _0x14c8d3;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index d390deb..b373836 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 _0x0102=['hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','push','slice','dialogflow','appdata','split','dialogflowv2','TagId','format','%s:%s:%s','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','stack','message\x20is\x20empty','busyQueue'];(function(_0x559c93,_0x537220){var _0x11a162=function(_0x49fa76){while(--_0x49fa76){_0x559c93['push'](_0x559c93['shift']());}};_0x11a162(++_0x537220);}(_0x0102,0x186));var _0x2010=function(_0x435e35,_0xd784ab){_0x435e35=_0x435e35-0x0;var _0x4723af=_0x0102[_0x435e35];return _0x4723af;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var path=require(_0x2010('0x1'));var fs=require('fs');var jayson=require(_0x2010('0x2'));var BPromise=require(_0x2010('0x3'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2010('0x4')),'chatQueueReport':require(_0x2010('0x5')),'smsQueueReport':require(_0x2010('0x6')),'faxQueueReport':require(_0x2010('0x7')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x2010('0x8'));function getId(_0x495d98,_0x4728c0,_0x160e41){return util['format'](_0x2010('0x9'),_0x495d98,_0x4728c0||0x0,_0x160e41||0x0);}function getIntervals(_0x3c2d98,_0x3d34d4){var _0x3acdbb=[];if(!_[_0x2010('0xa')](_0x3d34d4[_0x2010('0xb')])&&!_[_0x2010('0xa')](_0x3c2d98[_0x3d34d4[_0x2010('0xb')]])&&!_[_0x2010('0xa')](_0x3c2d98[_0x3d34d4[_0x2010('0xb')]][_0x2010('0xc')])){_0x3acdbb=_[_0x2010('0xd')](_0x3c2d98[_0x3d34d4[_0x2010('0xb')]][_0x2010('0xc')],_0x2010('0xe'));}else if(!_[_0x2010('0xa')](_0x3d34d4['interval'])){_0x3acdbb=[_0x3d34d4['interval']];}return _0x3acdbb;}exports[_0x2010('0xf')]=function(_0x385720){_0x385720[_0x2010('0x10')]={};return new BPromise(function(_0x10b587,_0x32d791){var _0x335be4={'Start':function(_0x517ff4){var _0x3195fa=this;return new Promise(function(_0x136418,_0x5ad412){if(_0x517ff4){try{var _0x41e267=[];var _0x11c94b=getId(_0x517ff4[_0x2010('0x11')],_0x517ff4[_0x2010('0x12')]?_0x517ff4[_0x2010('0x12')]['id']:0x0,_0x517ff4[_0x2010('0x13')]?_0x517ff4[_0x2010('0x13')]['id']:0x0);if(_0x517ff4[_0x2010('0x14')]&&_[_0x2010('0x15')](_0x517ff4['applications'])&&_0x517ff4['applications'][_0x2010('0x16')]){for(var _0x38a15a=0x0;_0x38a15a<_0x517ff4[_0x2010('0x14')][_0x2010('0x16')];_0x38a15a+=0x1){var _0x569a79=_0x517ff4['applications'][_0x38a15a];if(fs[_0x2010('0x17')](path[_0x2010('0x18')](__dirname,_0x2010('0x14'),_0x569a79[_0x2010('0x19')]+_0x2010('0x1a')))){var _0x131a26=[];switch(_0x569a79['app'][_0x2010('0x1b')]()){case _0x2010('0x1c'):var _0x58ff30=_0x569a79['appdata']['split'](',');if(_0x517ff4[_0x2010('0x11')]==='mail'){_0x131a26[_0x2010('0x1d')](_0x58ff30[0x0]);_0x131a26['push'](_0x58ff30[0x1]);_0x131a26['push'](_0x58ff30[_0x2010('0x1e')](0x2,_0x58ff30[_0x2010('0x16')])['join'](','));}else{_0x131a26[_0x2010('0x1d')](_0x58ff30[0x0]);_0x131a26['push'](_0x58ff30[_0x2010('0x1e')](0x1,_0x58ff30[_0x2010('0x16')])[_0x2010('0x18')](','));}break;case _0x2010('0x1f'):var _0x3c5862=_0x569a79[_0x2010('0x20')][_0x2010('0x21')](',');_0x131a26[_0x2010('0x1d')](_0x3c5862[0x0]);_0x131a26[_0x2010('0x1d')](_0x3c5862[0x1]);_0x131a26[_0x2010('0x1d')](_0x3c5862[_0x2010('0x1e')](0x2,_0x3c5862[_0x2010('0x16')])['join'](','));break;case _0x2010('0x22'):var _0x52fe5e=_0x569a79[_0x2010('0x20')][_0x2010('0x21')](',');_0x131a26[_0x2010('0x1d')](_0x52fe5e[0x0]);_0x131a26[_0x2010('0x1d')](_0x52fe5e[0x1]);_0x131a26['push'](_0x52fe5e[0x2]);_0x131a26['push'](_0x52fe5e[0x3]);_0x131a26[_0x2010('0x1d')](_0x52fe5e['slice'](0x4,_0x52fe5e[_0x2010('0x16')])[_0x2010('0x18')](','));break;case'amazonlex':var _0xe5fd24=_0x569a79[_0x2010('0x20')][_0x2010('0x21')](',');_0x131a26[_0x2010('0x1d')](_0xe5fd24[0x0]);_0x131a26[_0x2010('0x1d')](_0xe5fd24[0x1]);_0x131a26['push'](_0xe5fd24[0x2]);_0x131a26[_0x2010('0x1d')](_0xe5fd24[0x3]);_0x131a26[_0x2010('0x1d')](_0xe5fd24[_0x2010('0x1e')](0x4,_0xe5fd24['length'])['join'](','));break;case _0x2010('0x12'):_0x131a26[_0x2010('0x1d')](_0x569a79[_0x2010('0x20')]);break;case'tag':_0x131a26['push'](_0x569a79[_0x2010('0x23')]);_0x131a26[_0x2010('0x1d')](_0x569a79[_0x2010('0x20')]);break;default:_0x131a26=_[_0x2010('0xa')](_0x569a79[_0x2010('0x20')])?[]:_0x569a79['appdata']['split'](',');}var _0x554c5e={'id':util[_0x2010('0x24')](_0x2010('0x25'),_0x11c94b,_0x569a79['id'],_0x569a79[_0x2010('0x19')]),'condition':require('./interval')[_0x2010('0x26')](_0x11c94b,getIntervals(_0x385720[_0x2010('0x27')],_0x569a79),_0x385720),'consequence':require(_0x2010('0x28')+_0x569a79[_0x2010('0x19')])['consequence'](_0x11c94b,_0x131a26,_0x385720,_0x517ff4),'p':_0x569a79[_0x2010('0x29')]||0x0};logger[_0x2010('0x2a')](_0x2010('0x2b'),_0x554c5e['id'],'on\x20interval',getIntervals(_0x385720[_0x2010('0x27')],_0x569a79)['join'](_0x2010('0x2c')));_0x41e267[_0x2010('0x1d')](_0x554c5e);}else{logger[_0x2010('0x2d')](_0x2010('0x2e'),path[_0x2010('0x18')](__dirname,_0x2010('0x14'),_0x569a79['app']+_0x2010('0x1a')));}}_0x385720['rules'][_0x11c94b]=new RuleEngine(_0x41e267);_0x385720[_0x2010('0x10')][_0x11c94b][_0x2010('0x2f')](_0x517ff4,function(_0x236a04){logger[_0x2010('0x2a')](_0x2010('0x30'),JSON[_0x2010('0x31')](_0x236a04[_0x2010('0x32')]));if(_0x385720[_0x2010('0x10')][_0x11c94b]){_0x385720[_0x2010('0x10')][_0x11c94b][_0x2010('0x33')](_0x2010('0x34'));}});return _0x136418({'code':0xc8,'message':_0x517ff4});}else{logger[_0x2010('0x2a')](_0x2010('0x35'));return _0x136418({'code':0xc8,'message':_0x517ff4});}}catch(_0x223fd0){logger['error'](_0x223fd0['stack']);return _0x5ad412(_0x3195fa[_0x2010('0x2d')](0x1f4,_0x223fd0));}}return _0x5ad412(_0x2010('0x36'));});},'AcceptMessage':function(_0x31af67){var _0x35d631=this;return new Promise(function(_0x3d5906,_0x5a38ee){if(_0x31af67[_0x2010('0x37')]&&_0x31af67['agent']['id']){if(_0x385720[_0x2010('0x38')][_0x31af67['agent']['id']]){_0x385720[_0x2010('0x38')][_0x31af67[_0x2010('0x37')]['id']][_0x2010('0x39')]=![];_0x385720[_0x2010('0x38')][_0x31af67[_0x2010('0x37')]['id']]['busyQueue']=undefined;}}if(_0x31af67[_0x2010('0x12')]&&_0x31af67[_0x2010('0x12')]['id']){try{var _0x3dd83c=getId(_0x31af67[_0x2010('0x11')],_0x31af67['message']?_0x31af67[_0x2010('0x12')]['id']:0x0,_0x31af67['interaction']?_0x31af67['interaction']['id']:0x0);if(_0x385720['rules'][_0x3dd83c]){_0x385720[_0x2010('0x10')][_0x3dd83c][_0x2010('0x33')](_0x2010('0x3a'));if(rpc[_0x31af67[_0x2010('0x11')]+_0x2010('0x3b')]){rpc[_0x31af67[_0x2010('0x11')]+'QueueReport'][_0x2010('0x3c')](_0x3dd83c,{'UserId':_0x31af67[_0x2010('0x12')][_0x2010('0x3d')]})['catch'](function(_0x5d6e2c){logger[_0x2010('0x2d')]('error\x20update\x20queue\x20report');});}}return _0x3d5906({'code':0xc8,'message':_0x31af67});}catch(_0x31ff4c){logger[_0x2010('0x2d')](_0x31ff4c[_0x2010('0x3e')]);return _0x5a38ee(_0x35d631[_0x2010('0x2d')](0x1f4,_0x31ff4c));}}logger['error'](_0x2010('0x3f'));return _0x5a38ee(_0x35d631[_0x2010('0x2d')](0x1f4,_0x2010('0x3f')));});},'RejectMessage':function(_0x231db7){var _0x3ec24c=this;return new Promise(function(_0x2a53b3,_0x5c1b19){if(_0x231db7[_0x2010('0x37')]&&_0x231db7[_0x2010('0x37')]['id']){try{if(_0x385720[_0x2010('0x38')][_0x231db7['agent']['id']]){_0x385720[_0x2010('0x38')][_0x231db7[_0x2010('0x37')]['id']]['busy']=![];_0x385720[_0x2010('0x38')][_0x231db7[_0x2010('0x37')]['id']][_0x2010('0x40')]=undefined;}return _0x2a53b3({'code':0xc8,'message':_0x231db7});}catch(_0x242274){logger[_0x2010('0x2d')](_0x242274[_0x2010('0x3e')]);return _0x5c1b19(_0x3ec24c[_0x2010('0x2d')](0x1f4,_0x242274));}}logger[_0x2010('0x2d')]('message\x20is\x20empty');return _0x5c1b19(_0x3ec24c['error'](0x1f4,_0x2010('0x3f')));});},'AbandonInteraction':function(_0xe1721f){var _0x5397f4=this;return new Promise(function(_0x422b3c,_0x46776b){if(_0xe1721f[_0x2010('0x11')]&&_0xe1721f[_0x2010('0x13')]&&_0xe1721f[_0x2010('0x13')]['id']){try{var _0x506943=getId(_0xe1721f['channel'],_0xe1721f[_0x2010('0x12')]?_0xe1721f[_0x2010('0x12')]['id']:0x0,_0xe1721f[_0x2010('0x13')]?_0xe1721f[_0x2010('0x13')]['id']:0x0);if(_0x385720[_0x2010('0x10')][_0x506943]){_0x385720[_0x2010('0x10')][_0x506943][_0x2010('0x33')](_0x2010('0x3a'));}return _0x422b3c({'code':0xc8,'message':_0xe1721f});}catch(_0x279c80){logger[_0x2010('0x2d')](_0x279c80[_0x2010('0x3e')]);return _0x46776b(_0x5397f4['error'](0x1f4,_0x279c80));}}logger[_0x2010('0x2d')](_0x2010('0x3f'));return _0x46776b(_0x5397f4['error'](0x1f4,_0x2010('0x3f')));});},'AgentCapacity':function(_0x43d529){var _0x2e5f24=this;return new Promise(function(_0x22e553,_0x778ea6){if(_0x385720[_0x2010('0x38')][_0x2010('0x41')](_0x43d529['id'])){for(var _0x2fba22 in _0x43d529[_0x2010('0x42')]){if(_0x43d529[_0x2010('0x42')][_0x2010('0x41')](_0x2fba22)){if(_0x385720[_0x2010('0x38')][_0x43d529['id']][_0x2010('0x41')](_0x2fba22+_0x2010('0x43'))){_0x385720[_0x2010('0x38')][_0x43d529['id']][_0x2fba22+_0x2010('0x43')]=parseInt(_0x43d529[_0x2010('0x42')][_0x2fba22],0xa);}}}_0x385720[_0x2010('0x38')][_0x43d529['id']][_0x2010('0x44')]();return _0x22e553({'code':0xc8,'message':_0x385720[_0x2010('0x38')][_0x43d529['id']]});}else{return _0x778ea6(_0x2e5f24[_0x2010('0x2d')](0x1f4,_0x2010('0x45')));}});},'Agents':function(_0x656253){return new Promise(function(_0x5a31f7,_0x1a9ed0){var _0x4aaa74=_['values'](_0x385720[_0x2010('0x38')]);_0x5a31f7({'count':_0x4aaa74[_0x2010('0x16')],'rows':_0x4aaa74});});},'ChatQueues':function(_0x4fb5d5){return new Promise(function(_0x4d124e,_0x268543){var _0xf0cfce=[];for(var _0x63ae67 in _0x385720['chatQueues']){if(_0x385720[_0x2010('0x46')][_0x2010('0x41')](_0x63ae67)){var _0x343687=_0x385720[_0x2010('0x46')][_0x63ae67];var _0x4b4145={'id':_0x343687['id'],'available':_0x343687[_0x2010('0x47')],'loggedIn':_0x343687['loggedIn'],'name':_0x343687[_0x2010('0x48')],'paused':_0x343687[_0x2010('0x49')],'waiting':_0x343687[_0x2010('0x4a')]};_0xf0cfce[_0x2010('0x1d')](_0x4b4145);}}_0x4d124e({'count':_0xf0cfce['length'],'rows':_0xf0cfce});});},'MailQueues':function(_0x51e15b){return new Promise(function(_0x444793,_0x126be7){var _0x5e77e2=[];for(var _0x487d13 in _0x385720[_0x2010('0x4b')]){if(_0x385720[_0x2010('0x4b')][_0x2010('0x41')](_0x487d13)){var _0xcce231=_0x385720['mailQueues'][_0x487d13];var _0x5cf608={'id':_0xcce231['id'],'available':_0xcce231['available'],'loggedIn':_0xcce231[_0x2010('0x4c')],'name':_0xcce231[_0x2010('0x48')],'paused':_0xcce231[_0x2010('0x49')],'waiting':_0xcce231[_0x2010('0x4a')]};_0x5e77e2['push'](_0x5cf608);}}_0x444793({'count':_0x5e77e2[_0x2010('0x16')],'rows':_0x5e77e2});});},'OpenchannelQueues':function(_0x31d8be){return new Promise(function(_0x478b8e,_0x3841fa){var _0x3a608e=[];for(var _0x23c7d9 in _0x385720[_0x2010('0x4d')]){if(_0x385720[_0x2010('0x4d')][_0x2010('0x41')](_0x23c7d9)){var _0x548273=_0x385720[_0x2010('0x4d')][_0x23c7d9];var _0x3f60e4={'id':_0x548273['id'],'available':_0x548273[_0x2010('0x47')],'loggedIn':_0x548273[_0x2010('0x4c')],'name':_0x548273[_0x2010('0x48')],'paused':_0x548273['paused'],'waiting':_0x548273[_0x2010('0x4a')]};_0x3a608e[_0x2010('0x1d')](_0x3f60e4);}}_0x478b8e({'count':_0x3a608e[_0x2010('0x16')],'rows':_0x3a608e});});},'SmsQueues':function(_0x5f5230){return new Promise(function(_0x5ca75a,_0x24466f){var _0x16c583=[];for(var _0x38a37b in _0x385720[_0x2010('0x4e')]){if(_0x385720[_0x2010('0x4e')][_0x2010('0x41')](_0x38a37b)){var _0x57c0f7=_0x385720[_0x2010('0x4e')][_0x38a37b];var _0xd6a734={'id':_0x57c0f7['id'],'available':_0x57c0f7[_0x2010('0x47')],'loggedIn':_0x57c0f7['loggedIn'],'name':_0x57c0f7[_0x2010('0x48')],'paused':_0x57c0f7[_0x2010('0x49')],'waiting':_0x57c0f7[_0x2010('0x4a')]};_0x16c583['push'](_0xd6a734);}}_0x5ca75a({'count':_0x16c583[_0x2010('0x16')],'rows':_0x16c583});});},'FaxQueues':function(_0x22f654){return new Promise(function(_0x4adc1c,_0x493c89){var _0x30b13d=[];for(var _0x487d55 in _0x385720['faxQueues']){if(_0x385720[_0x2010('0x4f')][_0x2010('0x41')](_0x487d55)){var _0x1e1fb7=_0x385720[_0x2010('0x4f')][_0x487d55];var _0x3499fa={'id':_0x1e1fb7['id'],'available':_0x1e1fb7[_0x2010('0x47')],'loggedIn':_0x1e1fb7[_0x2010('0x4c')],'name':_0x1e1fb7[_0x2010('0x48')],'paused':_0x1e1fb7[_0x2010('0x49')],'waiting':_0x1e1fb7[_0x2010('0x4a')]};_0x30b13d['push'](_0x3499fa);}}_0x4adc1c({'count':_0x30b13d[_0x2010('0x16')],'rows':_0x30b13d});});},'WhatsappQueues':function(_0x1c1373){return new Promise(function(_0x5a1a8e,_0x449295){var _0x151ced=[];for(var _0xd515c9 in _0x385720[_0x2010('0x50')]){if(_0x385720['whatsappQueues'][_0x2010('0x41')](_0xd515c9)){var _0x2a5cb3=_0x385720['whatsappQueues'][_0xd515c9];var _0x4d22c5={'id':_0x2a5cb3['id'],'available':_0x2a5cb3[_0x2010('0x47')],'loggedIn':_0x2a5cb3['loggedIn'],'name':_0x2a5cb3[_0x2010('0x48')],'paused':_0x2a5cb3[_0x2010('0x49')],'waiting':_0x2a5cb3[_0x2010('0x4a')]};_0x151ced[_0x2010('0x1d')](_0x4d22c5);}}_0x5a1a8e({'count':_0x151ced[_0x2010('0x16')],'rows':_0x151ced});});},'ChatQueuesWaitingInteractions':function(_0x294288){return new Promise(function(_0x381c5c,_0x5dd0d6){var _0x27a23e=_[_0x2010('0x51')](_0x385720[_0x2010('0x52')]);_0x381c5c({'count':_0x27a23e['length'],'rows':_0x27a23e});});},'MailQueuesWaitingInteractions':function(_0x421016){return new Promise(function(_0x340a20,_0x13d7ff){var _0x44604d=_[_0x2010('0x51')](_0x385720[_0x2010('0x53')]);_0x340a20({'count':_0x44604d[_0x2010('0x16')],'rows':_0x44604d});});},'OpenchannelQueuesWaitingInteractions':function(_0x120c26){return new Promise(function(_0x4e3692,_0x459ddf){var _0x42f536=_[_0x2010('0x51')](_0x385720['openchannelQueuesWaitingInteractions']);_0x4e3692({'count':_0x42f536[_0x2010('0x16')],'rows':_0x42f536});});},'SmsQueuesWaitingInteractions':function(_0x9f414d){return new Promise(function(_0x490483,_0x43896e){var _0x10f81c=_[_0x2010('0x51')](_0x385720[_0x2010('0x54')]);_0x490483({'count':_0x10f81c[_0x2010('0x16')],'rows':_0x10f81c});});},'FaxQueuesWaitingInteractions':function(_0x543db2){return new Promise(function(_0xe2c487,_0x31e669){var _0x57201d=_[_0x2010('0x51')](_0x385720[_0x2010('0x55')]);_0xe2c487({'count':_0x57201d['length'],'rows':_0x57201d});});},'WhatsappQueuesWaitingInteractions':function(_0xdc9f3c){return new Promise(function(_0x5781ca,_0x4df54c){var _0x44e47e=_[_0x2010('0x51')](_0x385720[_0x2010('0x56')]);_0x5781ca({'count':_0x44e47e[_0x2010('0x16')],'rows':_0x44e47e});});}};var _0x2d6d50=jayson[_0x2010('0x57')](_0x335be4)['http']();_0x2d6d50['on'](_0x2010('0x2d'),function(_0x881954){logger[_0x2010('0x2d')](JSON[_0x2010('0x31')](_0x881954));return _0x32d791(_0x881954);});_0x2d6d50['listen'](0x232c,_0x2010('0x58'),function(){console['log'](_0x2010('0x59'),0x232c);return _0x10b587(_0x2010('0x5a')+0x232c);});});}; \ No newline at end of file +var _0xa644=['intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','stringify','matchPath','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','rules','message','interaction','isArray','applications','length','existsSync','join','.js','app','toLowerCase','autoreply','split','channel','mail','push','slice','dialogflow','appdata','dialogflowv2','tag','format','%s:%s:%s','./interval','condition'];(function(_0x388493,_0x23301e){var _0x5300a1=function(_0x1d9c91){while(--_0x1d9c91){_0x388493['push'](_0x388493['shift']());}};_0x5300a1(++_0x23301e);}(_0xa644,0x1a8));var _0x4a64=function(_0x551de1,_0xf8a93){_0x551de1=_0x551de1-0x0;var _0x243a3d=_0xa644[_0x551de1];return _0x243a3d;};'use strict';var _=require(_0x4a64('0x0'));var util=require(_0x4a64('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x4a64('0x2'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0x4a64('0x3'));var logger=require('../../../config/logger')(_0x4a64('0x4'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x4a64('0x5')),'chatQueueReport':require(_0x4a64('0x6')),'smsQueueReport':require(_0x4a64('0x7')),'faxQueueReport':require(_0x4a64('0x8')),'whatsappQueueReport':require(_0x4a64('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2e85df,_0x1c3b6d,_0x151276){return util['format'](_0x4a64('0xa'),_0x2e85df,_0x1c3b6d||0x0,_0x151276||0x0);}function getIntervals(_0x368cad,_0x2ae34f){var _0x47d042=[];if(!_[_0x4a64('0xb')](_0x2ae34f[_0x4a64('0xc')])&&!_[_0x4a64('0xb')](_0x368cad[_0x2ae34f[_0x4a64('0xc')]])&&!_[_0x4a64('0xb')](_0x368cad[_0x2ae34f['IntervalId']]['Intervals'])){_0x47d042=_[_0x4a64('0xd')](_0x368cad[_0x2ae34f[_0x4a64('0xc')]][_0x4a64('0xe')],_0x4a64('0xf'));}else if(!_[_0x4a64('0xb')](_0x2ae34f[_0x4a64('0xf')])){_0x47d042=[_0x2ae34f[_0x4a64('0xf')]];}return _0x47d042;}exports['listen']=function(_0x1eba0e){_0x1eba0e[_0x4a64('0x10')]={};return new BPromise(function(_0x35e322,_0x4a62d6){var _0x50c8a3={'Start':function(_0xabf3fb){var _0x332188=this;return new Promise(function(_0xd8edc7,_0x301e37){if(_0xabf3fb){try{var _0x1c0a13=[];var _0x27cc83=getId(_0xabf3fb['channel'],_0xabf3fb[_0x4a64('0x11')]?_0xabf3fb[_0x4a64('0x11')]['id']:0x0,_0xabf3fb['interaction']?_0xabf3fb[_0x4a64('0x12')]['id']:0x0);if(_0xabf3fb['applications']&&_[_0x4a64('0x13')](_0xabf3fb[_0x4a64('0x14')])&&_0xabf3fb[_0x4a64('0x14')][_0x4a64('0x15')]){for(var _0x35da23=0x0;_0x35da23<_0xabf3fb['applications'][_0x4a64('0x15')];_0x35da23+=0x1){var _0x234383=_0xabf3fb[_0x4a64('0x14')][_0x35da23];if(fs[_0x4a64('0x16')](path[_0x4a64('0x17')](__dirname,'applications',_0x234383['app']+_0x4a64('0x18')))){var _0x478b0b=[];switch(_0x234383[_0x4a64('0x19')][_0x4a64('0x1a')]()){case _0x4a64('0x1b'):var _0x53590d=_0x234383['appdata'][_0x4a64('0x1c')](',');if(_0xabf3fb[_0x4a64('0x1d')]===_0x4a64('0x1e')){_0x478b0b[_0x4a64('0x1f')](_0x53590d[0x0]);_0x478b0b['push'](_0x53590d[0x1]);_0x478b0b[_0x4a64('0x1f')](_0x53590d['slice'](0x2,_0x53590d[_0x4a64('0x15')])[_0x4a64('0x17')](','));}else{_0x478b0b[_0x4a64('0x1f')](_0x53590d[0x0]);_0x478b0b[_0x4a64('0x1f')](_0x53590d[_0x4a64('0x20')](0x1,_0x53590d['length'])[_0x4a64('0x17')](','));}break;case _0x4a64('0x21'):var _0x3a36ea=_0x234383[_0x4a64('0x22')][_0x4a64('0x1c')](',');_0x478b0b[_0x4a64('0x1f')](_0x3a36ea[0x0]);_0x478b0b[_0x4a64('0x1f')](_0x3a36ea[0x1]);_0x478b0b[_0x4a64('0x1f')](_0x3a36ea[_0x4a64('0x20')](0x2,_0x3a36ea[_0x4a64('0x15')])[_0x4a64('0x17')](','));break;case _0x4a64('0x23'):var _0x1e3d30=_0x234383[_0x4a64('0x22')][_0x4a64('0x1c')](',');_0x478b0b['push'](_0x1e3d30[0x0]);_0x478b0b[_0x4a64('0x1f')](_0x1e3d30[0x1]);_0x478b0b[_0x4a64('0x1f')](_0x1e3d30[0x2]);_0x478b0b['push'](_0x1e3d30[0x3]);_0x478b0b[_0x4a64('0x1f')](_0x1e3d30[_0x4a64('0x20')](0x4,_0x1e3d30['length'])[_0x4a64('0x17')](','));break;case'amazonlex':var _0x33a68b=_0x234383[_0x4a64('0x22')][_0x4a64('0x1c')](',');_0x478b0b['push'](_0x33a68b[0x0]);_0x478b0b[_0x4a64('0x1f')](_0x33a68b[0x1]);_0x478b0b[_0x4a64('0x1f')](_0x33a68b[0x2]);_0x478b0b[_0x4a64('0x1f')](_0x33a68b[0x3]);_0x478b0b[_0x4a64('0x1f')](_0x33a68b['slice'](0x4,_0x33a68b[_0x4a64('0x15')])[_0x4a64('0x17')](','));break;case _0x4a64('0x11'):_0x478b0b[_0x4a64('0x1f')](_0x234383['appdata']);break;case _0x4a64('0x24'):_0x478b0b['push'](_0x234383['TagId']);_0x478b0b[_0x4a64('0x1f')](_0x234383[_0x4a64('0x22')]);break;default:_0x478b0b=_[_0x4a64('0xb')](_0x234383[_0x4a64('0x22')])?[]:_0x234383[_0x4a64('0x22')][_0x4a64('0x1c')](',');}var _0xac7591={'id':util[_0x4a64('0x25')](_0x4a64('0x26'),_0x27cc83,_0x234383['id'],_0x234383[_0x4a64('0x19')]),'condition':require(_0x4a64('0x27'))[_0x4a64('0x28')](_0x27cc83,getIntervals(_0x1eba0e[_0x4a64('0x29')],_0x234383),_0x1eba0e),'consequence':require(_0x4a64('0x2a')+_0x234383['app'])[_0x4a64('0x2b')](_0x27cc83,_0x478b0b,_0x1eba0e,_0xabf3fb),'p':_0x234383[_0x4a64('0x2c')]||0x0};logger[_0x4a64('0x2d')](_0x4a64('0x2e'),_0xac7591['id'],_0x4a64('0x2f'),getIntervals(_0x1eba0e[_0x4a64('0x29')],_0x234383)[_0x4a64('0x17')](_0x4a64('0x30')));_0x1c0a13[_0x4a64('0x1f')](_0xac7591);}else{logger[_0x4a64('0x31')](_0x4a64('0x32'),path[_0x4a64('0x17')](__dirname,_0x4a64('0x14'),_0x234383[_0x4a64('0x19')]+_0x4a64('0x18')));}}_0x1eba0e[_0x4a64('0x10')][_0x27cc83]=new RuleEngine(_0x1c0a13);_0x1eba0e[_0x4a64('0x10')][_0x27cc83]['execute'](_0xabf3fb,function(_0x489880){logger[_0x4a64('0x2d')]('Applications\x20executed',JSON[_0x4a64('0x33')](_0x489880[_0x4a64('0x34')]));if(_0x1eba0e[_0x4a64('0x10')][_0x27cc83]){_0x1eba0e[_0x4a64('0x10')][_0x27cc83]['emit'](_0x4a64('0x35'));}});return _0xd8edc7({'code':0xc8,'message':_0xabf3fb});}else{logger[_0x4a64('0x2d')](_0x4a64('0x36'));return _0xd8edc7({'code':0xc8,'message':_0xabf3fb});}}catch(_0x49867b){logger['error'](_0x49867b[_0x4a64('0x37')]);return _0x301e37(_0x332188[_0x4a64('0x31')](0x1f4,_0x49867b));}}return _0x301e37(_0x4a64('0x38'));});},'AcceptMessage':function(_0x70d811){var _0x8afa40=this;return new Promise(function(_0x1db1d7,_0x390ccc){if(_0x70d811[_0x4a64('0x39')]&&_0x70d811[_0x4a64('0x39')]['id']){if(_0x1eba0e['agents'][_0x70d811[_0x4a64('0x39')]['id']]){_0x1eba0e[_0x4a64('0x3a')][_0x70d811[_0x4a64('0x39')]['id']][_0x4a64('0x3b')]=![];_0x1eba0e[_0x4a64('0x3a')][_0x70d811[_0x4a64('0x39')]['id']][_0x4a64('0x3c')]=undefined;}}if(_0x70d811[_0x4a64('0x11')]&&_0x70d811[_0x4a64('0x11')]['id']){try{var _0x41bf34=getId(_0x70d811[_0x4a64('0x1d')],_0x70d811[_0x4a64('0x11')]?_0x70d811[_0x4a64('0x11')]['id']:0x0,_0x70d811[_0x4a64('0x12')]?_0x70d811[_0x4a64('0x12')]['id']:0x0);if(_0x1eba0e[_0x4a64('0x10')][_0x41bf34]){_0x1eba0e[_0x4a64('0x10')][_0x41bf34][_0x4a64('0x3d')](_0x4a64('0x3e'));if(rpc[_0x70d811[_0x4a64('0x1d')]+_0x4a64('0x3f')]){rpc[_0x70d811[_0x4a64('0x1d')]+_0x4a64('0x3f')]['update'](_0x41bf34,{'UserId':_0x70d811[_0x4a64('0x11')][_0x4a64('0x40')]})[_0x4a64('0x41')](function(_0x2b2dde){logger['error'](_0x4a64('0x42'));});}}return _0x1db1d7({'code':0xc8,'message':_0x70d811});}catch(_0x48a603){logger['error'](_0x48a603[_0x4a64('0x37')]);return _0x390ccc(_0x8afa40['error'](0x1f4,_0x48a603));}}logger['error']('message\x20is\x20empty');return _0x390ccc(_0x8afa40[_0x4a64('0x31')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x32cbf5){var _0x310d66=this;return new Promise(function(_0x330dbe,_0x25793f){if(_0x32cbf5[_0x4a64('0x39')]&&_0x32cbf5[_0x4a64('0x39')]['id']){try{if(_0x1eba0e[_0x4a64('0x3a')][_0x32cbf5[_0x4a64('0x39')]['id']]){_0x1eba0e[_0x4a64('0x3a')][_0x32cbf5[_0x4a64('0x39')]['id']][_0x4a64('0x3b')]=![];_0x1eba0e[_0x4a64('0x3a')][_0x32cbf5[_0x4a64('0x39')]['id']][_0x4a64('0x3c')]=undefined;}return _0x330dbe({'code':0xc8,'message':_0x32cbf5});}catch(_0x384482){logger[_0x4a64('0x31')](_0x384482['stack']);return _0x25793f(_0x310d66[_0x4a64('0x31')](0x1f4,_0x384482));}}logger[_0x4a64('0x31')]('message\x20is\x20empty');return _0x25793f(_0x310d66['error'](0x1f4,_0x4a64('0x43')));});},'AbandonInteraction':function(_0xe1dee6){var _0x562ea8=this;return new Promise(function(_0x5b00b9,_0x29577c){if(_0xe1dee6[_0x4a64('0x1d')]&&_0xe1dee6[_0x4a64('0x12')]&&_0xe1dee6[_0x4a64('0x12')]['id']){try{var _0xedce54=getId(_0xe1dee6[_0x4a64('0x1d')],_0xe1dee6[_0x4a64('0x11')]?_0xe1dee6['message']['id']:0x0,_0xe1dee6[_0x4a64('0x12')]?_0xe1dee6[_0x4a64('0x12')]['id']:0x0);if(_0x1eba0e['rules'][_0xedce54]){_0x1eba0e[_0x4a64('0x10')][_0xedce54][_0x4a64('0x3d')](_0x4a64('0x3e'));}return _0x5b00b9({'code':0xc8,'message':_0xe1dee6});}catch(_0x21a772){logger[_0x4a64('0x31')](_0x21a772['stack']);return _0x29577c(_0x562ea8[_0x4a64('0x31')](0x1f4,_0x21a772));}}logger['error'](_0x4a64('0x43'));return _0x29577c(_0x562ea8[_0x4a64('0x31')](0x1f4,_0x4a64('0x43')));});},'AgentCapacity':function(_0x2829c3){var _0x82aca4=this;return new Promise(function(_0xc35b80,_0x5757a2){if(_0x1eba0e[_0x4a64('0x3a')][_0x4a64('0x44')](_0x2829c3['id'])){for(var _0x4531b5 in _0x2829c3[_0x4a64('0x45')]){if(_0x2829c3[_0x4a64('0x45')][_0x4a64('0x44')](_0x4531b5)){if(_0x1eba0e[_0x4a64('0x3a')][_0x2829c3['id']]['hasOwnProperty'](_0x4531b5+_0x4a64('0x46'))){_0x1eba0e['agents'][_0x2829c3['id']][_0x4531b5+_0x4a64('0x46')]=parseInt(_0x2829c3[_0x4a64('0x45')][_0x4531b5],0xa);}}}_0x1eba0e['agents'][_0x2829c3['id']]['updateRealtime']();return _0xc35b80({'code':0xc8,'message':_0x1eba0e[_0x4a64('0x3a')][_0x2829c3['id']]});}else{return _0x5757a2(_0x82aca4[_0x4a64('0x31')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x385f85){return new Promise(function(_0x30ca03,_0x2d8e32){var _0x43638a=_[_0x4a64('0x47')](_0x1eba0e[_0x4a64('0x3a')]);_0x30ca03({'count':_0x43638a[_0x4a64('0x15')],'rows':_0x43638a});});},'ChatQueues':function(_0x1e5b6d){return new Promise(function(_0x57be89,_0x1a9bed){var _0x4c9a77=[];for(var _0x3e1342 in _0x1eba0e[_0x4a64('0x48')]){if(_0x1eba0e[_0x4a64('0x48')][_0x4a64('0x44')](_0x3e1342)){var _0x590686=_0x1eba0e[_0x4a64('0x48')][_0x3e1342];var _0xf1bb99={'id':_0x590686['id'],'available':_0x590686[_0x4a64('0x49')],'loggedIn':_0x590686[_0x4a64('0x4a')],'name':_0x590686[_0x4a64('0x4b')],'paused':_0x590686[_0x4a64('0x4c')],'waiting':_0x590686[_0x4a64('0x4d')]};_0x4c9a77[_0x4a64('0x1f')](_0xf1bb99);}}_0x57be89({'count':_0x4c9a77[_0x4a64('0x15')],'rows':_0x4c9a77});});},'MailQueues':function(_0x18bd17){return new Promise(function(_0x352405,_0x4c3bef){var _0x5acc39=[];for(var _0x348df5 in _0x1eba0e['mailQueues']){if(_0x1eba0e['mailQueues'][_0x4a64('0x44')](_0x348df5)){var _0x4e9a9d=_0x1eba0e[_0x4a64('0x4e')][_0x348df5];var _0x4f53d1={'id':_0x4e9a9d['id'],'available':_0x4e9a9d['available'],'loggedIn':_0x4e9a9d['loggedIn'],'name':_0x4e9a9d[_0x4a64('0x4b')],'paused':_0x4e9a9d[_0x4a64('0x4c')],'waiting':_0x4e9a9d[_0x4a64('0x4d')]};_0x5acc39[_0x4a64('0x1f')](_0x4f53d1);}}_0x352405({'count':_0x5acc39[_0x4a64('0x15')],'rows':_0x5acc39});});},'OpenchannelQueues':function(_0x4de990){return new Promise(function(_0xd63a27,_0x20b298){var _0x17a775=[];for(var _0x177090 in _0x1eba0e[_0x4a64('0x4f')]){if(_0x1eba0e[_0x4a64('0x4f')]['hasOwnProperty'](_0x177090)){var _0x27a058=_0x1eba0e['openchannelQueues'][_0x177090];var _0x275209={'id':_0x27a058['id'],'available':_0x27a058[_0x4a64('0x49')],'loggedIn':_0x27a058['loggedIn'],'name':_0x27a058[_0x4a64('0x4b')],'paused':_0x27a058[_0x4a64('0x4c')],'waiting':_0x27a058[_0x4a64('0x4d')]};_0x17a775[_0x4a64('0x1f')](_0x275209);}}_0xd63a27({'count':_0x17a775['length'],'rows':_0x17a775});});},'SmsQueues':function(_0x25092e){return new Promise(function(_0x1d3b93,_0x721040){var _0x1d539f=[];for(var _0x4e9187 in _0x1eba0e[_0x4a64('0x50')]){if(_0x1eba0e[_0x4a64('0x50')]['hasOwnProperty'](_0x4e9187)){var _0x32e1e2=_0x1eba0e['smsQueues'][_0x4e9187];var _0x352b3a={'id':_0x32e1e2['id'],'available':_0x32e1e2[_0x4a64('0x49')],'loggedIn':_0x32e1e2[_0x4a64('0x4a')],'name':_0x32e1e2[_0x4a64('0x4b')],'paused':_0x32e1e2[_0x4a64('0x4c')],'waiting':_0x32e1e2['waiting']};_0x1d539f['push'](_0x352b3a);}}_0x1d3b93({'count':_0x1d539f[_0x4a64('0x15')],'rows':_0x1d539f});});},'FaxQueues':function(_0x55ae9f){return new Promise(function(_0x1179f0,_0x4a9c73){var _0x2ae2b3=[];for(var _0x168214 in _0x1eba0e[_0x4a64('0x51')]){if(_0x1eba0e[_0x4a64('0x51')][_0x4a64('0x44')](_0x168214)){var _0x10356b=_0x1eba0e['faxQueues'][_0x168214];var _0x36ff0d={'id':_0x10356b['id'],'available':_0x10356b[_0x4a64('0x49')],'loggedIn':_0x10356b['loggedIn'],'name':_0x10356b[_0x4a64('0x4b')],'paused':_0x10356b[_0x4a64('0x4c')],'waiting':_0x10356b[_0x4a64('0x4d')]};_0x2ae2b3[_0x4a64('0x1f')](_0x36ff0d);}}_0x1179f0({'count':_0x2ae2b3['length'],'rows':_0x2ae2b3});});},'WhatsappQueues':function(_0x1736ab){return new Promise(function(_0x31ae59,_0x4f0fb2){var _0x7b3e8=[];for(var _0x17e193 in _0x1eba0e[_0x4a64('0x52')]){if(_0x1eba0e['whatsappQueues'][_0x4a64('0x44')](_0x17e193)){var _0x34545f=_0x1eba0e['whatsappQueues'][_0x17e193];var _0x230ef4={'id':_0x34545f['id'],'available':_0x34545f[_0x4a64('0x49')],'loggedIn':_0x34545f[_0x4a64('0x4a')],'name':_0x34545f[_0x4a64('0x4b')],'paused':_0x34545f[_0x4a64('0x4c')],'waiting':_0x34545f[_0x4a64('0x4d')]};_0x7b3e8[_0x4a64('0x1f')](_0x230ef4);}}_0x31ae59({'count':_0x7b3e8['length'],'rows':_0x7b3e8});});},'ChatQueuesWaitingInteractions':function(_0x4bd175){return new Promise(function(_0x135f06,_0x3775bb){var _0x25b9fa=_[_0x4a64('0x47')](_0x1eba0e[_0x4a64('0x53')]);_0x135f06({'count':_0x25b9fa['length'],'rows':_0x25b9fa});});},'MailQueuesWaitingInteractions':function(_0x5660b7){return new Promise(function(_0x48eb31,_0x55845a){var _0x366139=_['values'](_0x1eba0e[_0x4a64('0x54')]);_0x48eb31({'count':_0x366139[_0x4a64('0x15')],'rows':_0x366139});});},'OpenchannelQueuesWaitingInteractions':function(_0x306204){return new Promise(function(_0x5c2412,_0x417d30){var _0x519c5b=_[_0x4a64('0x47')](_0x1eba0e[_0x4a64('0x55')]);_0x5c2412({'count':_0x519c5b[_0x4a64('0x15')],'rows':_0x519c5b});});},'SmsQueuesWaitingInteractions':function(_0x409aa2){return new Promise(function(_0x48dd75,_0x45bb76){var _0x50dcac=_[_0x4a64('0x47')](_0x1eba0e[_0x4a64('0x56')]);_0x48dd75({'count':_0x50dcac['length'],'rows':_0x50dcac});});},'FaxQueuesWaitingInteractions':function(_0x550c5d){return new Promise(function(_0x40008b,_0x4d13ec){var _0x3aa0cf=_[_0x4a64('0x47')](_0x1eba0e['faxQueuesWaitingInteractions']);_0x40008b({'count':_0x3aa0cf[_0x4a64('0x15')],'rows':_0x3aa0cf});});},'WhatsappQueuesWaitingInteractions':function(_0x42fa5b){return new Promise(function(_0x775e71,_0x1525dd){var _0x3fe973=_['values'](_0x1eba0e[_0x4a64('0x57')]);_0x775e71({'count':_0x3fe973[_0x4a64('0x15')],'rows':_0x3fe973});});}};var _0x113b61=jayson[_0x4a64('0x58')](_0x50c8a3)['http']();_0x113b61['on'](_0x4a64('0x31'),function(_0x2d64e4){logger[_0x4a64('0x31')](JSON['stringify'](_0x2d64e4));return _0x4a62d6(_0x2d64e4);});_0x113b61[_0x4a64('0x59')](0x232c,_0x4a64('0x5a'),function(){console[_0x4a64('0x5b')](_0x4a64('0x5c'),0x232c);return _0x35e322('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 8a8bd21..bef0b48 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 _0xe149=['client','http','request','then','error','message','result','catch','condition','rules','info','stop','length','Command','format','iftime\x20%s','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','util','bluebird','jayson/promise','lodash','routing'];(function(_0x1285c3,_0x428ce9){var _0x5bfce9=function(_0x3b49bd){while(--_0x3b49bd){_0x1285c3['push'](_0x1285c3['shift']());}};_0x5bfce9(++_0x428ce9);}(_0xe149,0x73));var _0x9e14=function(_0x450272,_0x21b29e){_0x450272=_0x450272-0x0;var _0x3819f2=_0xe149[_0x450272];return _0x3819f2;};'use strict';var util=require(_0x9e14('0x0'));var BPromise=require(_0x9e14('0x1'));var jayson=require(_0x9e14('0x2'));var _=require(_0x9e14('0x3'));var logger=require('../../../config/logger')(_0x9e14('0x4'));var client=jayson[_0x9e14('0x5')][_0x9e14('0x6')]({'port':0x232a});function request(_0x5d1e70,_0x177cd9){return new BPromise(function(_0x4308f0,_0xd13e73){return client[_0x9e14('0x7')](_0x5d1e70,_0x177cd9)[_0x9e14('0x8')](function(_0x5b0b96){if(_0x5b0b96['error']){return _0xd13e73(_0x5b0b96[_0x9e14('0x9')][_0x9e14('0xa')]);}else{return _0x4308f0(_0x5b0b96[_0x9e14('0xb')]);}})[_0x9e14('0xc')](function(_0x3aadb3){return _0xd13e73(_0x3aadb3);});});}exports[_0x9e14('0xd')]=function(_0x2de6b2,_0x59841c,_0x5df147){return function(_0x2bcfaf){if(_0x5df147[_0x9e14('0xe')]&&!_0x5df147[_0x9e14('0xe')][_0x2de6b2]){logger[_0x9e14('0xf')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x2de6b2);return _0x2bcfaf[_0x9e14('0x10')]();}var _0x31147a=[];for(var _0x270445=0x0;_0x270445<_0x59841c[_0x9e14('0x11')];_0x270445+=0x1){_0x31147a['push'](request(_0x9e14('0x12'),{'command':util[_0x9e14('0x13')](_0x9e14('0x14'),_0x59841c[_0x270445])})[_0x9e14('0x8')](function(_0x5b20d3){return _0x5b20d3&&_0x5b20d3[_0x9e14('0xa')]&&_0x5b20d3[_0x9e14('0xa')][_0x9e14('0x15')](_0x9e14('0x16'))>=0x0?!![]:![];})['catch'](function(_0xc760bc){logger[_0x9e14('0x9')]('[%s][INTERVAL]\x20%s',_0x2de6b2,_0x59841c[_0x270445]);}));}BPromise[_0x9e14('0x17')](_0x31147a)[_0x9e14('0x8')](function(_0x4cdd4b){var _0x2e789d=_[_0x9e14('0x18')](_0x4cdd4b);logger['info'](_0x9e14('0x19'),_0x2de6b2,_0x59841c[_0x9e14('0x1a')](_0x9e14('0x1b')),_0x2e789d);_0x2bcfaf['when'](_0x2e789d);})[_0x9e14('0xc')](function(_0x2ab2d7){console[_0x9e14('0x1c')](_0x2ab2d7);logger['error'](_0x9e14('0x19'),_0x2de6b2,_0x59841c[_0x9e14('0x1a')]('\x20|\x20'),_0x2ab2d7[_0x9e14('0x1d')]);_0x2bcfaf[_0x9e14('0x10')]();});};}; \ No newline at end of file +var _0x82ff=['format','indexOf','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','catch','stack','util','bluebird','lodash','routing','http','request','then','error','message','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command'];(function(_0x2d1991,_0x34eaeb){var _0x104578=function(_0x38ba6b){while(--_0x38ba6b){_0x2d1991['push'](_0x2d1991['shift']());}};_0x104578(++_0x34eaeb);}(_0x82ff,0x11c));var _0xf82f=function(_0xa66512,_0x865052){_0xa66512=_0xa66512-0x0;var _0x4e5b18=_0x82ff[_0xa66512];return _0x4e5b18;};'use strict';var util=require(_0xf82f('0x0'));var BPromise=require(_0xf82f('0x1'));var jayson=require('jayson/promise');var _=require(_0xf82f('0x2'));var logger=require('../../../config/logger')(_0xf82f('0x3'));var client=jayson['client'][_0xf82f('0x4')]({'port':0x232a});function request(_0x34106a,_0x5c4684){return new BPromise(function(_0x5f5609,_0x82e821){return client[_0xf82f('0x5')](_0x34106a,_0x5c4684)[_0xf82f('0x6')](function(_0x4e81ae){if(_0x4e81ae[_0xf82f('0x7')]){return _0x82e821(_0x4e81ae[_0xf82f('0x7')][_0xf82f('0x8')]);}else{return _0x5f5609(_0x4e81ae['result']);}})['catch'](function(_0x44a856){return _0x82e821(_0x44a856);});});}exports[_0xf82f('0x9')]=function(_0x23574f,_0x21dd93,_0x56526e){return function(_0x240b99){if(_0x56526e[_0xf82f('0xa')]&&!_0x56526e['rules'][_0x23574f]){logger[_0xf82f('0xb')](_0xf82f('0xc'),_0x23574f);return _0x240b99[_0xf82f('0xd')]();}var _0x5cacb0=[];for(var _0x34123d=0x0;_0x34123d<_0x21dd93['length'];_0x34123d+=0x1){_0x5cacb0[_0xf82f('0xe')](request(_0xf82f('0xf'),{'command':util[_0xf82f('0x10')]('iftime\x20%s',_0x21dd93[_0x34123d])})['then'](function(_0x524247){return _0x524247&&_0x524247[_0xf82f('0x8')]&&_0x524247['message'][_0xf82f('0x11')](_0xf82f('0x12'))>=0x0?!![]:![];})['catch'](function(_0x234ba8){logger['error'](_0xf82f('0x13'),_0x23574f,_0x21dd93[_0x34123d]);}));}BPromise['all'](_0x5cacb0)[_0xf82f('0x6')](function(_0x7e7461){var _0x15f816=_[_0xf82f('0x14')](_0x7e7461);logger[_0xf82f('0xb')](_0xf82f('0x15'),_0x23574f,_0x21dd93['join'](_0xf82f('0x16')),_0x15f816);_0x240b99['when'](_0x15f816);})[_0xf82f('0x17')](function(_0x426fb2){console['log'](_0x426fb2);logger[_0xf82f('0x7')](_0xf82f('0x15'),_0x23574f,_0x21dd93['join']('\x20|\x20'),_0x426fb2[_0xf82f('0x18')]);_0x240b99['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 74d3776..e51d57b 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 _0x0713=['cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','destuniqueid','agentcalledAt','now','called','connectedlinename','[%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','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]'];(function(_0x1e9254,_0x262668){var _0xcfca7d=function(_0x56b929){while(--_0x56b929){_0x1e9254['push'](_0x1e9254['shift']());}};_0xcfca7d(++_0x262668);}(_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 utils=require(_0x3071('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2afa91,_0x27405a){utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2afa91[_0x3071('0x3')],_0x2afa91[_0x3071('0x4')],_0x2afa91[_0x3071('0x5')],_0x2afa91[_0x3071('0x6')],_0x2afa91[_0x3071('0x7')],_0x2afa91[_0x3071('0x8')],_0x2afa91[_0x3071('0x9')],_0x2afa91[_0x3071('0xa')]));if(_0x2afa91[_0x3071('0x5')]){utils[_0x3071('0xb')](_0x2afa91[_0x3071('0x5')])[_0x3071('0xc')](function(_0x1a868e){if(_0x1a868e){_0x2afa91['type']=_0x1a868e[_0x3071('0xd')];_0x2afa91[_0x3071('0xe')]=_0x2afa91[_0x3071('0xf')]?_0x1a868e[_0x3071('0x10')]:![];_0x2afa91[_0x3071('0x11')]=_0x2afa91['agentacw']?_0x1a868e[_0x3071('0x12')]:0x0;}utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);});}else{utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);}if(_0x27405a){delete transfers[_0x2afa91['uniqueid']];}else{delete agents[_0x2afa91['destuniqueid']];}}exports[_0x3071('0x15')]=function(_0x5dc13b){try{utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][agentcalled]',_0x5dc13b[_0x3071('0x3')]),_0x5dc13b);agents[_0x5dc13b['destuniqueid']]=_0x5dc13b;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x18')]=utils[_0x3071('0x19')]();agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x1a');agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x9')]=null;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x1b')]=null;utils['info'](util[_0x3071('0x2')](_0x3071('0x1c'),_0x5dc13b[_0x3071('0x3')],agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x6')],_0x5dc13b[_0x3071('0x17')]));}catch(_0x105bbb){utils[_0x3071('0x1d')](util['format'](_0x3071('0x1e'),_0x5dc13b[_0x3071('0x3')]),_0x105bbb);}};exports[_0x3071('0x1f')]=function(_0x56c267){try{if(!_[_0x3071('0x20')](agents[_0x56c267['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x56c267);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x22'),_0x56c267[_0x3071('0x3')],agents[_0x56c267['destuniqueid']]['membername'],_0x56c267[_0x3071('0x17')]));agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x1f')]=!![];agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x23')]=utils[_0x3071('0x19')]();agents[_0x56c267[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x24');agents[_0x56c267['destuniqueid']][_0x3071('0x25')]=_0x3071('0x24');agents[_0x56c267[_0x3071('0x17')]]['holdtime']=_0x56c267[_0x3071('0x26')]?parseInt(_0x56c267[_0x3071('0x26')])/0x3e8:0x0;agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x27')]=0x0;unanswered[_0x3071('0x28')](_0x56c267[_0x3071('0x17')]);}}catch(_0x177b5f){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x177b5f);}};exports['queuecallerabandon']=function(_0x4f1484){try{_[_0x3071('0x29')](agents,function(_0x149e0d,_0x6ddf96){if(_0x149e0d[_0x3071('0x3')]==_0x4f1484[_0x3071('0x3')]&&!_[_0x3071('0x2a')](unanswered,_0x149e0d[_0x3071('0x17')])){utils[_0x3071('0x16')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484['uniqueid']),_0x4f1484);utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x4f1484[_0x3071('0x3')],_0x149e0d[_0x3071('0x6')],_0x149e0d[_0x3071('0x17')]));_0x149e0d[_0x3071('0x1f')]=!![];_0x149e0d['agentringnoanswerAt']=utils[_0x3071('0x19')]();_0x149e0d[_0x3071('0xa')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x25')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x2c')]=_0x4f1484[_0x3071('0x2c')];_0x149e0d[_0x3071('0x27')]=0x0;writeDB(_0x149e0d);}});}catch(_0x596cc3){utils[_0x3071('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484[_0x3071('0x3')]),_0x596cc3);}};exports[_0x3071('0x2d')]=function(_0x54d9c3){try{if(agents[_0x54d9c3[_0x3071('0x17')]]){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x54d9c3);utils[_0x3071('0x1')](util['format'](_0x3071('0x2f'),_0x54d9c3[_0x3071('0x3')],agents[_0x54d9c3['destuniqueid']][_0x3071('0x6')],_0x54d9c3['destuniqueid']));agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0x30')]=utils['now']();agents[_0x54d9c3['destuniqueid']][_0x3071('0x9')]=_0x54d9c3[_0x3071('0x9')];agents[_0x54d9c3[_0x3071('0x17')]]['connectedlinename']=_0x54d9c3[_0x3071('0x1b')];agents[_0x54d9c3['destuniqueid']][_0x3071('0x2c')]=_0x54d9c3['ringtime'];agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x31');_[_0x3071('0x29')](agents,function(_0x30ab68,_0x593c9c){if(_0x30ab68['destuniqueid']!=_0x54d9c3[_0x3071('0x17')]&&_0x30ab68[_0x3071('0x3')]==_0x54d9c3[_0x3071('0x3')]){_0x30ab68[_0x3071('0x27')]=0x0;_0x30ab68['holdtime']=_0x54d9c3[_0x3071('0x26')];_0x30ab68[_0x3071('0x1f')]=!![];_0x30ab68[_0x3071('0x23')]=utils[_0x3071('0x19')]();_0x30ab68[_0x3071('0xa')]=_0x3071('0x32');_0x30ab68['reason']=_0x3071('0x32');_0x30ab68['answeredelsewheredestinationuniqueid']=_0x54d9c3['destuniqueid'];_0x30ab68['answeredelsewheremembername']=_0x54d9c3['membername'];writeDB(_0x30ab68);}});}}catch(_0x2992e6){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x2992e6);}};exports[_0x3071('0xf')]=function(_0xa711b5){try{if(!_[_0x3071('0x20')](agents[_0xa711b5['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x33'),_0xa711b5[_0x3071('0x3')]),_0xa711b5);utils[_0x3071('0x1')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xa711b5[_0x3071('0x3')],agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x6')],_0xa711b5[_0x3071('0x17')]));agents[_0xa711b5[_0x3071('0x17')]]['agentcomplete']=!![];agents[_0xa711b5[_0x3071('0x17')]]['agentcompleteAt']=utils[_0x3071('0x19')]();agents[_0xa711b5['destuniqueid']]['talktime']=utils[_0x3071('0x34')](agents[_0xa711b5['destuniqueid']][_0x3071('0x35')],agents[_0xa711b5['destuniqueid']][_0x3071('0x30')]);agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x25')]=_0xa711b5[_0x3071('0x25')];agents[_0xa711b5['destuniqueid']][_0x3071('0xa')]='complete';writeDB(agents[_0xa711b5[_0x3071('0x17')]]);}}catch(_0x4b6bbb){utils[_0x3071('0x1d')](util[_0x3071('0x2')]('[%s][agents][agentcomplete]',_0xa711b5[_0x3071('0x3')]),_0x4b6bbb);}};exports[_0x3071('0x36')]=function(_0x224a70){try{if(!_[_0x3071('0x20')](agents[_0x224a70[_0x3071('0x37')]])){utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x224a70);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x38'),_0x224a70['uniqueid'],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x6')],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')]));agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x39')]=!![];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3a')]=_0x3071('0x3b');agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3c')]=_0x224a70[_0x3071('0x3d')];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3e')]=agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')];}}catch(_0x596cdd){utils['error'](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x596cdd);}};exports[_0x3071('0x3f')]=function(_0x15c6f8){try{utils['debug'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x15c6f8);if(_0x15c6f8['origtransfereruniqueid']==_0x15c6f8[_0x3071('0x41')]){if(!_[_0x3071('0x20')](agents[_0x15c6f8[_0x3071('0x42')]])){utils[_0x3071('0x1')](util['format'](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x42')]]['transfer']=!![];agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3a')]=_0x3071('0x45');agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x46')];agents[_0x15c6f8[_0x3071('0x42')]]['transferuniqueid']=_0x15c6f8['origtransfereruniqueid'];}if(_0x15c6f8[_0x3071('0x47')]&&agents[_0x15c6f8['transfereeuniqueid']]){agents[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x1;transfers[_0x15c6f8['transfereeuniqueid']]=_[_0x3071('0x49')](agents[_0x15c6f8[_0x3071('0x47')]]);transfers[_0x15c6f8['transfereeuniqueid']][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x8')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x4a')]=agents[_0x15c6f8['secondtransfereruniqueid']][_0x3071('0x4a')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x18')]=utils['now']();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x2;}}else if(_0x15c6f8[_0x3071('0x42')]==_0x15c6f8[_0x3071('0x4b')]){if(!_['isNil'](agents[_0x15c6f8[_0x3071('0x44')]])){utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x39')]=!![];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3a')]='ATTENDED';agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x4c')];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3e')]=_0x15c6f8[_0x3071('0x42')];}if(_0x15c6f8[_0x3071('0x4d')]&&agents[_0x15c6f8[_0x3071('0x4d')]]){agents[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x48')]=0x1;transfers[_0x15c6f8[_0x3071('0x4d')]]=_['clone'](agents[_0x15c6f8['transfertargetuniqueid']]);transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x8')];transfers[_0x15c6f8['transfertargetuniqueid']]['calleridname']=agents[_0x15c6f8[_0x3071('0x44')]]['calleridname'];transfers[_0x15c6f8['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x48')]=0x2;}}}catch(_0x19a03d){utils['error'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x19a03d);}};exports[_0x3071('0x4e')]=function(_0x29ee70){try{utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70[_0x3071('0x3')]),_0x29ee70);if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']]['reason']===_0x3071('0x24')){if(_0x29ee70[_0x3071('0x50')]==='21'){agents[_0x29ee70[_0x3071('0x3')]]['reason']='rejected';agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x51');}utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]]['membername'],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);var _0x2fbac7=unanswered[_0x3071('0x53')](_0x29ee70[_0x3071('0x3')]);if(_0x2fbac7>-0x1){unanswered[_0x3071('0x54')](_0x2fbac7,0x1);}}if(transfers[_0x29ee70[_0x3071('0x3')]]){transfers[_0x29ee70['uniqueid']][_0x3071('0xf')]=!![];transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils['now']();transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](transfers[_0x29ee70['uniqueid']]['agentcompleteAt'],transfers[_0x29ee70[_0x3071('0x3')]]['agentconnectAt']);transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')]=_0x3071('0x55');transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x56');utils[_0x3071('0x1')](util['format'](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(transfers[_0x29ee70['uniqueid']],!![]);}if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']][_0x3071('0x30')]){agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xf')]=!![];agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils[_0x3071('0x19')]();agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](agents[_0x29ee70[_0x3071('0x3')]]['agentcompleteAt'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x30')]);agents[_0x29ee70['uniqueid']][_0x3071('0x25')]=agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x39')]?_0x3071('0x39'):_0x3071('0x55');agents[_0x29ee70['uniqueid']]['lastevent']=_0x3071('0x56');utils['info'](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);}}catch(_0x291bb9){utils['error'](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70['uniqueid']),_0x291bb9);}}; \ No newline at end of file +var _0x4522=['agent','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalledAt','called','info','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','timeout','holdtime','ringtime','talktime','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','debug','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connect','forIn','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','transfer','transfertype','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transferexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agentcompleteAt'];(function(_0x3c24ee,_0x4ea664){var _0x28b006=function(_0xcc4d15){while(--_0xcc4d15){_0x3c24ee['push'](_0x3c24ee['shift']());}};_0x28b006(++_0x4ea664);}(_0x4522,0x1a0));var _0x2452=function(_0x1427f8,_0x417f31){_0x1427f8=_0x1427f8-0x0;var _0x30a432=_0x4522[_0x1427f8];return _0x30a432;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x2452('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xa5f6b7,_0x4a08d4){utils['info'](util[_0x2452('0x1')](_0x2452('0x2'),_0xa5f6b7[_0x2452('0x3')],_0xa5f6b7[_0x2452('0x4')],_0xa5f6b7[_0x2452('0x5')],_0xa5f6b7[_0x2452('0x6')],_0xa5f6b7[_0x2452('0x7')],_0xa5f6b7[_0x2452('0x8')],_0xa5f6b7[_0x2452('0x9')],_0xa5f6b7[_0x2452('0xa')]));if(_0xa5f6b7[_0x2452('0x5')]){utils[_0x2452('0xb')](_0xa5f6b7[_0x2452('0x5')])[_0x2452('0xc')](function(_0x2e5caa){if(_0x2e5caa){_0xa5f6b7[_0x2452('0xd')]=_0x2e5caa['type'];_0xa5f6b7['agentacw']=_0xa5f6b7[_0x2452('0xe')]?_0x2e5caa['acw']:![];_0xa5f6b7['acwtime']=_0xa5f6b7[_0x2452('0xf')]?_0x2e5caa[_0x2452('0x10')]:0x0;}utils[_0x2452('0x11')](_0x2452('0x12'),_0xa5f6b7);});}else{utils[_0x2452('0x11')](_0x2452('0x12'),_0xa5f6b7);}if(_0x4a08d4){delete transfers[_0xa5f6b7[_0x2452('0x3')]];}else{delete agents[_0xa5f6b7[_0x2452('0x13')]];}}exports['agentcalled']=function(_0x529fb2){try{utils['debug'](util[_0x2452('0x1')]('[%s][agents][agentcalled]',_0x529fb2[_0x2452('0x3')]),_0x529fb2);agents[_0x529fb2['destuniqueid']]=_0x529fb2;agents[_0x529fb2[_0x2452('0x13')]][_0x2452('0x14')]=utils['now']();agents[_0x529fb2[_0x2452('0x13')]]['lastevent']=_0x2452('0x15');agents[_0x529fb2[_0x2452('0x13')]][_0x2452('0x9')]=null;agents[_0x529fb2[_0x2452('0x13')]]['connectedlinename']=null;utils[_0x2452('0x16')](util[_0x2452('0x1')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x529fb2['uniqueid'],agents[_0x529fb2[_0x2452('0x13')]][_0x2452('0x6')],_0x529fb2[_0x2452('0x13')]));}catch(_0x57cb03){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x18'),_0x529fb2[_0x2452('0x3')]),_0x57cb03);}};exports[_0x2452('0x19')]=function(_0x1c70cb){try{if(!_[_0x2452('0x1a')](agents[_0x1c70cb[_0x2452('0x13')]])){utils['debug'](util['format'](_0x2452('0x1b'),_0x1c70cb[_0x2452('0x3')]),_0x1c70cb);utils['info'](util[_0x2452('0x1')](_0x2452('0x1c'),_0x1c70cb[_0x2452('0x3')],agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x6')],_0x1c70cb[_0x2452('0x13')]));agents[_0x1c70cb[_0x2452('0x13')]]['agentringnoanswer']=!![];agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x1d')]=utils[_0x2452('0x1e')]();agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0xa')]='timeout';agents[_0x1c70cb['destuniqueid']][_0x2452('0x1f')]=_0x2452('0x20');agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x21')]=_0x1c70cb[_0x2452('0x22')]?parseInt(_0x1c70cb['ringtime'])/0x3e8:0x0;agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x23')]=0x0;unanswered['push'](_0x1c70cb['destuniqueid']);}}catch(_0x332878){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x1b'),_0x1c70cb[_0x2452('0x3')]),_0x332878);}};exports[_0x2452('0x24')]=function(_0x504162){try{_['forIn'](agents,function(_0x46b611,_0x454e0a){if(_0x46b611[_0x2452('0x3')]==_0x504162['uniqueid']&&!_[_0x2452('0x25')](unanswered,_0x46b611[_0x2452('0x13')])){utils['debug'](util[_0x2452('0x1')](_0x2452('0x26'),_0x504162[_0x2452('0x3')]),_0x504162);utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x27'),_0x504162[_0x2452('0x3')],_0x46b611[_0x2452('0x6')],_0x46b611[_0x2452('0x13')]));_0x46b611[_0x2452('0x19')]=!![];_0x46b611[_0x2452('0x1d')]=utils[_0x2452('0x1e')]();_0x46b611[_0x2452('0xa')]='abandoned';_0x46b611[_0x2452('0x1f')]=_0x2452('0x28');_0x46b611['holdtime']=_0x504162[_0x2452('0x21')];_0x46b611['talktime']=0x0;writeDB(_0x46b611);}});}catch(_0x2c6843){utils[_0x2452('0x17')](util['format'](_0x2452('0x26'),_0x504162[_0x2452('0x3')]),_0x2c6843);}};exports[_0x2452('0x29')]=function(_0x5ce5fb){try{if(agents[_0x5ce5fb[_0x2452('0x13')]]){utils[_0x2452('0x2a')](util['format'](_0x2452('0x2b'),_0x5ce5fb[_0x2452('0x3')]),_0x5ce5fb);utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x2c'),_0x5ce5fb['uniqueid'],agents[_0x5ce5fb['destuniqueid']]['membername'],_0x5ce5fb[_0x2452('0x13')]));agents[_0x5ce5fb[_0x2452('0x13')]][_0x2452('0x2d')]=utils[_0x2452('0x1e')]();agents[_0x5ce5fb[_0x2452('0x13')]]['connectedlinenum']=_0x5ce5fb[_0x2452('0x9')];agents[_0x5ce5fb['destuniqueid']]['connectedlinename']=_0x5ce5fb[_0x2452('0x2e')];agents[_0x5ce5fb['destuniqueid']][_0x2452('0x21')]=_0x5ce5fb[_0x2452('0x22')];agents[_0x5ce5fb['destuniqueid']][_0x2452('0xa')]=_0x2452('0x2f');_[_0x2452('0x30')](agents,function(_0x34d7f9,_0x2babbe){if(_0x34d7f9[_0x2452('0x13')]!=_0x5ce5fb[_0x2452('0x13')]&&_0x34d7f9[_0x2452('0x3')]==_0x5ce5fb['uniqueid']){_0x34d7f9[_0x2452('0x23')]=0x0;_0x34d7f9['holdtime']=_0x5ce5fb[_0x2452('0x22')];_0x34d7f9[_0x2452('0x19')]=!![];_0x34d7f9['agentringnoanswerAt']=utils[_0x2452('0x1e')]();_0x34d7f9[_0x2452('0xa')]=_0x2452('0x31');_0x34d7f9[_0x2452('0x1f')]=_0x2452('0x31');_0x34d7f9['answeredelsewheredestinationuniqueid']=_0x5ce5fb[_0x2452('0x13')];_0x34d7f9[_0x2452('0x32')]=_0x5ce5fb['membername'];writeDB(_0x34d7f9);}});}}catch(_0xfabbd8){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x2b'),_0x5ce5fb['uniqueid']),_0xfabbd8);}};exports[_0x2452('0xe')]=function(_0x304942){try{if(!_[_0x2452('0x1a')](agents[_0x304942[_0x2452('0x13')]])){utils[_0x2452('0x2a')](util[_0x2452('0x1')]('[%s][agents][agentcomplete]',_0x304942[_0x2452('0x3')]),_0x304942);utils['info'](util[_0x2452('0x1')](_0x2452('0x33'),_0x304942['uniqueid'],agents[_0x304942['destuniqueid']]['membername'],_0x304942['destuniqueid']));agents[_0x304942[_0x2452('0x13')]]['agentcomplete']=!![];agents[_0x304942[_0x2452('0x13')]]['agentcompleteAt']=utils[_0x2452('0x1e')]();agents[_0x304942[_0x2452('0x13')]]['talktime']=utils['diffTime'](agents[_0x304942[_0x2452('0x13')]]['agentcompleteAt'],agents[_0x304942[_0x2452('0x13')]][_0x2452('0x2d')]);agents[_0x304942[_0x2452('0x13')]][_0x2452('0x1f')]=_0x304942['reason'];agents[_0x304942['destuniqueid']][_0x2452('0xa')]=_0x2452('0x34');writeDB(agents[_0x304942[_0x2452('0x13')]]);}}catch(_0x2d06f2){utils[_0x2452('0x17')](util['format'](_0x2452('0x35'),_0x304942['uniqueid']),_0x2d06f2);}};exports[_0x2452('0x36')]=function(_0x53fd05){try{if(!_[_0x2452('0x1a')](agents[_0x53fd05[_0x2452('0x37')]])){utils['debug'](util[_0x2452('0x1')]('[%s][agents][blindtransfer]',_0x53fd05[_0x2452('0x3')]),_0x53fd05);utils['info'](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x53fd05[_0x2452('0x3')],agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x6')],agents[_0x53fd05['transfereruniqueid']][_0x2452('0x3')]));agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x38')]=!![];agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x39')]='blind';agents[_0x53fd05[_0x2452('0x37')]]['transferexten']=_0x53fd05[_0x2452('0x3a')];agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x3b')]=agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x3')];}}catch(_0x2096e2){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x3c'),_0x53fd05['uniqueid']),_0x2096e2);}};exports[_0x2452('0x3d')]=function(_0x595f9f){try{utils[_0x2452('0x2a')](util['format'](_0x2452('0x3e'),_0x595f9f[_0x2452('0x3f')]),_0x595f9f);if(_0x595f9f['origtransfereruniqueid']==_0x595f9f[_0x2452('0x40')]){if(!_[_0x2452('0x1a')](agents[_0x595f9f[_0x2452('0x41')]])){utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x42'),_0x595f9f[_0x2452('0x3f')],agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x6')]));agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x38')]=!![];agents[_0x595f9f['secondtransfereruniqueid']][_0x2452('0x39')]='ATTENDED';agents[_0x595f9f[_0x2452('0x41')]]['transferexten']=_0x595f9f[_0x2452('0x43')];agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x3b')]=_0x595f9f[_0x2452('0x3f')];}if(_0x595f9f[_0x2452('0x44')]&&agents[_0x595f9f[_0x2452('0x44')]]){agents[_0x595f9f[_0x2452('0x44')]][_0x2452('0x45')]=0x1;transfers[_0x595f9f[_0x2452('0x44')]]=_[_0x2452('0x46')](agents[_0x595f9f[_0x2452('0x44')]]);transfers[_0x595f9f['transfereeuniqueid']][_0x2452('0x8')]=agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x8')];transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x47')]=agents[_0x595f9f[_0x2452('0x41')]]['calleridname'];transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x14')]=utils['now']();transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x2d')]=utils[_0x2452('0x1e')]();transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x21')]=0x0;transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x45')]=0x2;}}else if(_0x595f9f[_0x2452('0x41')]==_0x595f9f[_0x2452('0x48')]){if(!_[_0x2452('0x1a')](agents[_0x595f9f[_0x2452('0x3f')]])){utils['info'](util['format'](_0x2452('0x42'),_0x595f9f['origtransfereruniqueid'],agents[_0x595f9f[_0x2452('0x3f')]][_0x2452('0x6')]));agents[_0x595f9f[_0x2452('0x3f')]][_0x2452('0x38')]=!![];agents[_0x595f9f[_0x2452('0x3f')]][_0x2452('0x39')]='ATTENDED';agents[_0x595f9f['origtransfereruniqueid']][_0x2452('0x49')]=_0x595f9f['secondtransfererexten'];agents[_0x595f9f[_0x2452('0x3f')]]['transferuniqueid']=_0x595f9f[_0x2452('0x41')];}if(_0x595f9f[_0x2452('0x4a')]&&agents[_0x595f9f[_0x2452('0x4a')]]){agents[_0x595f9f[_0x2452('0x4a')]]['agententerreason']=0x1;transfers[_0x595f9f['transfertargetuniqueid']]=_['clone'](agents[_0x595f9f[_0x2452('0x4a')]]);transfers[_0x595f9f[_0x2452('0x4a')]]['calleridnum']=agents[_0x595f9f['origtransfereruniqueid']]['calleridnum'];transfers[_0x595f9f['transfertargetuniqueid']]['calleridname']=agents[_0x595f9f[_0x2452('0x3f')]]['calleridname'];transfers[_0x595f9f['transfertargetuniqueid']][_0x2452('0x14')]=utils[_0x2452('0x1e')]();transfers[_0x595f9f[_0x2452('0x4a')]][_0x2452('0x2d')]=utils[_0x2452('0x1e')]();transfers[_0x595f9f[_0x2452('0x4a')]]['holdtime']=0x0;transfers[_0x595f9f[_0x2452('0x4a')]][_0x2452('0x45')]=0x2;}}}catch(_0x45c850){utils['error'](util['format'](_0x2452('0x3e'),_0x595f9f[_0x2452('0x3f')]),_0x45c850);}};exports[_0x2452('0x4b')]=function(_0x1dec54){try{utils[_0x2452('0x2a')](util[_0x2452('0x1')](_0x2452('0x4c'),_0x1dec54[_0x2452('0x3')]),_0x1dec54);if(agents[_0x1dec54['uniqueid']]&&agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')]===_0x2452('0x20')){if(_0x1dec54[_0x2452('0x4d')]==='21'){agents[_0x1dec54['uniqueid']][_0x2452('0x1f')]=_0x2452('0x4e');agents[_0x1dec54['uniqueid']][_0x2452('0xa')]=_0x2452('0x4e');}utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x4f'),_0x1dec54[_0x2452('0x3')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x6')],agents[_0x1dec54['uniqueid']]['reason'],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]));writeDB(agents[_0x1dec54[_0x2452('0x3')]]);var _0x1530fe=unanswered['indexOf'](_0x1dec54[_0x2452('0x3')]);if(_0x1530fe>-0x1){unanswered[_0x2452('0x50')](_0x1530fe,0x1);}}if(transfers[_0x1dec54[_0x2452('0x3')]]){transfers[_0x1dec54[_0x2452('0x3')]]['agentcomplete']=!![];transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x51')]=utils[_0x2452('0x1e')]();transfers[_0x1dec54[_0x2452('0x3')]]['talktime']=utils['diffTime'](transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x51')],transfers[_0x1dec54['uniqueid']][_0x2452('0x2d')]);transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')]=_0x2452('0x52');transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]=_0x2452('0x34');utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x4f'),_0x1dec54[_0x2452('0x3')],transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x6')],transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')],transfers[_0x1dec54[_0x2452('0x3')]]['lastevent']));writeDB(transfers[_0x1dec54[_0x2452('0x3')]],!![]);}if(agents[_0x1dec54[_0x2452('0x3')]]&&agents[_0x1dec54[_0x2452('0x3')]]['agentconnectAt']){agents[_0x1dec54['uniqueid']]['agentcomplete']=!![];agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x51')]=utils[_0x2452('0x1e')]();agents[_0x1dec54[_0x2452('0x3')]]['talktime']=utils['diffTime'](agents[_0x1dec54['uniqueid']][_0x2452('0x51')],agents[_0x1dec54['uniqueid']][_0x2452('0x2d')]);agents[_0x1dec54['uniqueid']][_0x2452('0x1f')]=agents[_0x1dec54['uniqueid']][_0x2452('0x38')]?'transfer':_0x2452('0x52');agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]=_0x2452('0x34');utils[_0x2452('0x16')](util['format'](_0x2452('0x4f'),_0x1dec54[_0x2452('0x3')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x6')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]));writeDB(agents[_0x1dec54[_0x2452('0x3')]]);}}catch(_0x3b681c){utils[_0x2452('0x17')](util['format'](_0x2452('0x4c'),_0x1dec54['uniqueid']),_0x3b681c);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 92821a7..637f213 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 _0x5a59=['[%s][calls][newchannel]','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','origtransfererchannel','_attended','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','includes','hangup','noop','gotoif','lastapplication','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x5a59,0x19c));var _0x95a5=function(_0x69383f,_0x2f3815){_0x69383f=_0x69383f-0x0;var _0x22a350=_0x5a59[_0x69383f];return _0x22a350;};'use strict';var _=require(_0x95a5('0x0'));var util=require(_0x95a5('0x1'));var utils=require(_0x95a5('0x2'));var transfers=require(_0x95a5('0x3'));var dispositions=[_0x95a5('0x4'),_0x95a5('0x5'),_0x95a5('0x5'),_0x95a5('0x4'),_0x95a5('0x4'),_0x95a5('0x4'),_0x95a5('0x6'),_0x95a5('0x7'),_0x95a5('0x5'),'FAILED','FAILED'];var channels={};function writeDB(_0x1057ad){var _0x13d332;if(transfers[_0x95a5('0x8')][_0x1057ad[_0x95a5('0x9')]]){_0x13d332=_0x1057ad[_0x95a5('0x9')];_0x1057ad[_0x95a5('0x9')]=transfers[_0x95a5('0x8')][_0x1057ad[_0x95a5('0x9')]][_0x95a5('0xa')];}utils[_0x95a5('0xb')](util[_0x95a5('0xc')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1057ad['uniqueid'],_0x1057ad['channel'],_0x1057ad[_0x95a5('0xd')],_0x1057ad[_0x95a5('0xe')],_0x1057ad[_0x95a5('0xf')],_0x1057ad[_0x95a5('0x10')],_0x1057ad[_0x95a5('0x11')],_0x1057ad[_0x95a5('0x12')]));if(_0x1057ad['accountcode']){utils[_0x95a5('0x13')](_0x1057ad[_0x95a5('0x14')])[_0x95a5('0x15')](function(_0x5a77ba){if(_0x5a77ba){_0x1057ad[_0x95a5('0x16')]=_0x5a77ba['id'];}utils[_0x95a5('0x17')](_0x95a5('0x18'),_0x1057ad);});}else{utils['request'](_0x95a5('0x18'),_0x1057ad);}if(channels[_0x1057ad[_0x95a5('0x9')]]){delete channels[_0x1057ad['uniqueid']];}else if(_0x13d332&&channels[_0x13d332]){delete transfers[_0x95a5('0x8')][_0x13d332];delete channels[_0x13d332];}}exports[_0x95a5('0x19')]=function(_0x437c1c){try{utils[_0x95a5('0x1a')](util['format']('[%s][calls][newchannel]',_0x437c1c['uniqueid']),_0x437c1c);if(_0x437c1c[_0x95a5('0x9')]==_0x437c1c[_0x95a5('0x1b')]&&_0x437c1c[_0x95a5('0x1c')]!=_0x95a5('0x1d')){utils[_0x95a5('0xb')](util['format'](_0x95a5('0x1e'),_0x437c1c[_0x95a5('0x9')],_0x437c1c['context'],_0x437c1c[_0x95a5('0x1f')]));channels[_0x437c1c['uniqueid']]={'uniqueid':_0x437c1c[_0x95a5('0x9')],'accountcode':_0x437c1c['accountcode'],'source':_0x437c1c[_0x95a5('0x10')],'destination':_0x437c1c[_0x95a5('0x1f')],'destinationcontext':_0x437c1c[_0x95a5('0x20')],'channel':_0x437c1c[_0x95a5('0x1c')],'starttime':utils[_0x95a5('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x95a5('0x4'),'amaflags':_0x95a5('0x22')};}}catch(_0x667944){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x24'),_0x437c1c['uniqueid']),_0x667944);}};exports['newstate']=function(_0x1bd9c3){try{utils[_0x95a5('0x1a')](util[_0x95a5('0xc')](_0x95a5('0x25'),_0x1bd9c3[_0x95a5('0x9')]),_0x1bd9c3);if(!_[_0x95a5('0x26')](channels[_0x1bd9c3[_0x95a5('0x9')]])&&_0x1bd9c3[_0x95a5('0x27')]==0x6){utils['info'](util[_0x95a5('0xc')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1bd9c3[_0x95a5('0x9')],_0x1bd9c3[_0x95a5('0x20')],_0x1bd9c3['channel']));if(_[_0x95a5('0x26')](channels[_0x1bd9c3[_0x95a5('0x9')]][_0x95a5('0x28')])){channels[_0x1bd9c3[_0x95a5('0x9')]]['systemanswertime']=utils['now']();}}else if(!_[_0x95a5('0x26')](channels[_0x1bd9c3[_0x95a5('0x1b')]])&&_0x1bd9c3[_0x95a5('0x27')]==0x6&&_0x1bd9c3['context']!=_0x95a5('0x29')){utils['info'](util[_0x95a5('0xc')](_0x95a5('0x2a'),_0x1bd9c3[_0x95a5('0x9')],_0x1bd9c3[_0x95a5('0x1b')],_0x1bd9c3['context'],_0x1bd9c3[_0x95a5('0x1c')]));channels[_0x1bd9c3[_0x95a5('0x1b')]][_0x95a5('0x14')]=_0x1bd9c3[_0x95a5('0x14')];channels[_0x1bd9c3[_0x95a5('0x1b')]][_0x95a5('0x2b')]=_0x1bd9c3[_0x95a5('0x1c')];if(_['isNil'](channels[_0x1bd9c3['linkedid']][_0x95a5('0x2c')])){channels[_0x1bd9c3[_0x95a5('0x1b')]][_0x95a5('0x2c')]=utils[_0x95a5('0x21')]();}channels[_0x1bd9c3[_0x95a5('0x1b')]][_0x95a5('0x2d')]=dispositions[_[_0x95a5('0x2e')](_0x1bd9c3[_0x95a5('0x27')])]||_0x95a5('0x6');}}catch(_0x430cdf){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x25'),_0x1bd9c3[_0x95a5('0x9')]),_0x430cdf);}};exports['hangup']=function(_0x2b6361){try{if(!_[_0x95a5('0x26')](channels[_0x2b6361[_0x95a5('0x9')]])){utils['debug'](util[_0x95a5('0xc')](_0x95a5('0x2f'),_0x2b6361[_0x95a5('0x9')]),_0x2b6361);if(_['isNil'](channels[_0x2b6361[_0x95a5('0x9')]]['callerid'])){channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x30')]=_0x2b6361[_0x95a5('0x31')]+'\x20<'+_0x2b6361[_0x95a5('0x10')]+'>';}utils[_0x95a5('0xb')](util[_0x95a5('0xc')](_0x95a5('0x32'),_0x2b6361['uniqueid'],channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x30')],_0x2b6361[_0x95a5('0x33')]));channels[_0x2b6361['uniqueid']][_0x95a5('0x34')]=utils['now']();channels[_0x2b6361[_0x95a5('0x9')]]['duration']=utils['diffTime'](channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x34')],channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x35')]);channels[_0x2b6361['uniqueid']][_0x95a5('0x36')]=channels[_0x2b6361['uniqueid']]['answertime']?utils[_0x95a5('0x37')](channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x34')],channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x2c')]):0x0;writeDB(channels[_0x2b6361[_0x95a5('0x9')]]);}}catch(_0x4c9b3a){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x2f'),_0x2b6361[_0x95a5('0x9')]),_0x4c9b3a);}};exports[_0x95a5('0x38')]=function(_0x14fbe3){try{if(!_[_0x95a5('0x26')](channels[_0x14fbe3[_0x95a5('0x39')]])){utils['debug'](util[_0x95a5('0xc')]('[%s][calls][attendedtransfer]',_0x14fbe3['origtransfereruniqueid']),_0x14fbe3);if(channels[_0x14fbe3[_0x95a5('0x39')]]['channel']==_0x14fbe3[_0x95a5('0x3a')]){utils[_0x95a5('0xb')](util[_0x95a5('0xc')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x14fbe3['origtransfereruniqueid'],_0x14fbe3['localtwolinkedid'],_0x14fbe3[_0x95a5('0x3b')]));channels[_0x14fbe3[_0x95a5('0x39')]][_0x95a5('0x2b')]=_0x14fbe3[_0x95a5('0x3b')];channels[_0x14fbe3[_0x95a5('0x39')]][_0x95a5('0x3c')]='_attended';}else if(channels[_0x14fbe3['localtwolinkedid']]['channel']=_0x14fbe3[_0x95a5('0x3d')]){utils[_0x95a5('0xb')](util[_0x95a5('0xc')](_0x95a5('0x3e'),_0x14fbe3[_0x95a5('0x3f')],_0x14fbe3['localtwolinkedid'],_0x14fbe3[_0x95a5('0x40')]));channels[_0x14fbe3['localtwolinkedid']][_0x95a5('0x2b')]=_0x14fbe3[_0x95a5('0x40')];channels[_0x14fbe3['localtwolinkedid']][_0x95a5('0x3c')]=_0x95a5('0x41');}}}catch(_0x436ea7){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x42'),_0x14fbe3['origtransfereruniqueid']),_0x436ea7);}};exports['musiconholdstart']=function(_0xbf8fcf){try{if(!_[_0x95a5('0x26')](channels[_0xbf8fcf[_0x95a5('0x9')]])){utils[_0x95a5('0x1a')](util[_0x95a5('0xc')](_0x95a5('0x43'),_0xbf8fcf[_0x95a5('0x9')]),_0xbf8fcf);channels[_0xbf8fcf[_0x95a5('0x9')]][_0x95a5('0x44')]=utils[_0x95a5('0x21')]();utils['info'](util[_0x95a5('0xc')](_0x95a5('0x45'),_0xbf8fcf[_0x95a5('0x9')],channels[_0xbf8fcf[_0x95a5('0x9')]][_0x95a5('0x44')]));}}catch(_0x1b901b){utils['error'](util[_0x95a5('0xc')]('[%s][calls][musiconholdstart]',_0xbf8fcf[_0x95a5('0x9')]),_0x1b901b);}};exports[_0x95a5('0x46')]=function(_0x2df7e9){try{if(!_['isNil'](channels[_0x2df7e9[_0x95a5('0x9')]])){utils['debug'](util['format'](_0x95a5('0x47'),_0x2df7e9[_0x95a5('0x9')]),_0x2df7e9);if(!_[_0x95a5('0x26')](channels[_0x2df7e9[_0x95a5('0x9')]]['musiconholdstartAt'])){channels[_0x2df7e9[_0x95a5('0x9')]][_0x95a5('0x48')]+=utils[_0x95a5('0x37')](utils[_0x95a5('0x21')](),channels[_0x2df7e9[_0x95a5('0x9')]][_0x95a5('0x44')]);utils[_0x95a5('0xb')](util['format'](_0x95a5('0x49'),_0x2df7e9['uniqueid'],channels[_0x2df7e9['uniqueid']][_0x95a5('0x48')]));delete channels[_0x2df7e9[_0x95a5('0x9')]]['musiconholdstartAt'];}}}catch(_0x2ba326){utils[_0x95a5('0x23')](util['format']('[%s][calls][musiconholdstop]',_0x2df7e9['uniqueid']),_0x2ba326);}};exports[_0x95a5('0x4a')]=function(_0x232980){try{if(!_[_0x95a5('0x26')](channels[_0x232980[_0x95a5('0x9')]])){utils['debug'](util[_0x95a5('0xc')](_0x95a5('0x4b'),_0x232980[_0x95a5('0x9')]),_0x232980);if(!_[_0x95a5('0x26')](_0x232980['variable'][_0x95a5('0x4c')])){utils[_0x95a5('0xb')](util[_0x95a5('0xc')](_0x95a5('0x4d'),_0x232980[_0x95a5('0x9')],_0x232980[_0x95a5('0x4e')]));channels[_0x232980[_0x95a5('0x9')]]['source']=_0x232980[_0x95a5('0x4e')];}if(!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')]['xmd-phone'])){utils[_0x95a5('0xb')](util[_0x95a5('0xc')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x232980[_0x95a5('0x9')],_0x232980[_0x95a5('0x4e')]));channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0x50')]=_0x232980['value'];channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0x30')]='\x22'+_0x232980[_0x95a5('0x4e')]+_0x95a5('0x51')+_0x232980[_0x95a5('0x4e')]+'>';}if(!_[_0x95a5('0x26')](_0x232980['variable'][_0x95a5('0x52')])||!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')]['xmd-callerid'])){utils[_0x95a5('0xb')](util['format'](_0x95a5('0x53'),_0x232980[_0x95a5('0x9')],!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')][_0x95a5('0x52')])?_0x95a5('0x52'):_0x95a5('0x54'),_0x232980[_0x95a5('0x4e')]));channels[_0x232980['uniqueid']][_0x95a5('0x30')]=_0x232980[_0x95a5('0x4e')];}if(!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')][_0x95a5('0x55')])||!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')]['xmcs-queue'])){utils[_0x95a5('0xb')](util['format'](_0x95a5('0x53'),_0x232980[_0x95a5('0x9')],!_['isNil'](_0x232980[_0x95a5('0x4f')][_0x95a5('0x55')])?_0x95a5('0x55'):'xmcs-queue',_0x232980[_0x95a5('0x4e')]));channels[_0x232980[_0x95a5('0x9')]]['lastapplication']=_0x95a5('0x56');channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0x57')]=_0x232980[_0x95a5('0x4e')];channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0xd')]=!![];}if(!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')]['xmd-contactid'])){utils['info'](util[_0x95a5('0xc')](_0x95a5('0x58'),_0x232980['uniqueid'],_0x232980['value']));channels[_0x232980['uniqueid']][_0x95a5('0x59')]=_0x232980['value'];}if(!_['isNil'](_0x232980[_0x95a5('0x4f')][_0x95a5('0x5a')])){utils[_0x95a5('0xb')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x232980['uniqueid'],_0x232980[_0x95a5('0x4e')]));channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0x5b')]=_0x232980[_0x95a5('0x4e')];}if(!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')][_0x95a5('0x5c')])){utils[_0x95a5('0xb')](util[_0x95a5('0xc')](_0x95a5('0x5d'),_0x232980['uniqueid'],_0x232980[_0x95a5('0x4e')]));channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0x5e')]=_0x232980[_0x95a5('0x4e')];}if(!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')][_0x95a5('0x5f')])){utils[_0x95a5('0xb')](util['format'](_0x95a5('0x60'),_0x232980['uniqueid'],_0x232980['value']));channels[_0x232980[_0x95a5('0x9')]]['sipcallid']=_0x232980[_0x95a5('0x4e')];}}}catch(_0x5eff92){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x4b'),_0x232980[_0x95a5('0x9')]),_0x5eff92);}};exports[_0x95a5('0x61')]=function(_0x3340a3){try{if(!_[_0x95a5('0x26')](channels[_0x3340a3[_0x95a5('0x9')]])){utils[_0x95a5('0x1a')](util['format']('[%s][calls][newexten]',_0x3340a3[_0x95a5('0x9')]),_0x3340a3);utils[_0x95a5('0xb')](util[_0x95a5('0xc')](_0x95a5('0x62'),_0x3340a3[_0x95a5('0x9')],_0x3340a3[_0x95a5('0x63')],_0x3340a3[_0x95a5('0x64')]));if(_0x3340a3[_0x95a5('0x63')][_0x95a5('0x65')]()==_0x95a5('0x66')&&_[_0x95a5('0x67')](_0x3340a3[_0x95a5('0x64')][_0x95a5('0x65')](),_0x95a5('0x68'))){var _0x128641=_0x3340a3[_0x95a5('0x64')][_0x95a5('0x69')]('=');var _0x252bf5=_0x128641[0x0]['substring'](_0x128641[0x0]['lastIndexOf']('(')+0x1,_0x128641[0x0]['lastIndexOf'](')'));var _0xc88a11=_0x128641[0x1];channels[_0x3340a3[_0x95a5('0x9')]][_0x252bf5]=_0xc88a11;}if(!_[_0x95a5('0x6a')]([_0x95a5('0x6b'),_0x95a5('0x6c'),'execif','set',_0x95a5('0x6d')],_0x3340a3[_0x95a5('0x63')][_0x95a5('0x65')]())){channels[_0x3340a3['uniqueid']][_0x95a5('0x6e')]=_0x3340a3[_0x95a5('0x63')];channels[_0x3340a3['uniqueid']][_0x95a5('0x57')]=_0x3340a3[_0x95a5('0x64')];}}}catch(_0x2f05a0){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x6f'),_0x3340a3[_0x95a5('0x9')]),_0x2f05a0);}}; \ No newline at end of file +var _0x9023=['[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','hangup','noop','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug','linkedid','exten','context','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','callerid','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid'];(function(_0x4cf82b,_0x36462a){var _0x10da53=function(_0x18e9e1){while(--_0x18e9e1){_0x4cf82b['push'](_0x4cf82b['shift']());}};_0x10da53(++_0x36462a);}(_0x9023,0x87));var _0x3902=function(_0x55deff,_0x386fed){_0x55deff=_0x55deff-0x0;var _0x2a612e=_0x9023[_0x55deff];return _0x2a612e;};'use strict';var _=require('lodash');var util=require(_0x3902('0x0'));var utils=require(_0x3902('0x1'));var transfers=require(_0x3902('0x2'));var dispositions=[_0x3902('0x3'),_0x3902('0x4'),'FAILED',_0x3902('0x3'),'NO\x20ANSWER',_0x3902('0x3'),_0x3902('0x5'),_0x3902('0x6'),_0x3902('0x4'),_0x3902('0x4'),_0x3902('0x4')];var channels={};function writeDB(_0x1f1090){var _0x4a65e0;if(transfers[_0x3902('0x7')][_0x1f1090['uniqueid']]){_0x4a65e0=_0x1f1090[_0x3902('0x8')];_0x1f1090[_0x3902('0x8')]=transfers['blinds'][_0x1f1090['uniqueid']][_0x3902('0x9')];}utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0xc'),_0x1f1090[_0x3902('0x8')],_0x1f1090[_0x3902('0xd')],_0x1f1090[_0x3902('0xe')],_0x1f1090[_0x3902('0xf')],_0x1f1090[_0x3902('0x10')],_0x1f1090[_0x3902('0x11')],_0x1f1090[_0x3902('0x12')],_0x1f1090[_0x3902('0x13')]));if(_0x1f1090[_0x3902('0x14')]){utils[_0x3902('0x15')](_0x1f1090[_0x3902('0x14')])[_0x3902('0x16')](function(_0x15bd1c){if(_0x15bd1c){_0x1f1090['UserId']=_0x15bd1c['id'];}utils[_0x3902('0x17')](_0x3902('0x18'),_0x1f1090);});}else{utils['request'](_0x3902('0x18'),_0x1f1090);}if(channels[_0x1f1090[_0x3902('0x8')]]){delete channels[_0x1f1090['uniqueid']];}else if(_0x4a65e0&&channels[_0x4a65e0]){delete transfers[_0x3902('0x7')][_0x4a65e0];delete channels[_0x4a65e0];}}exports[_0x3902('0x19')]=function(_0x24ab5c){try{utils[_0x3902('0x1a')](util[_0x3902('0xb')]('[%s][calls][newchannel]',_0x24ab5c[_0x3902('0x8')]),_0x24ab5c);if(_0x24ab5c[_0x3902('0x8')]==_0x24ab5c[_0x3902('0x1b')]&&_0x24ab5c[_0x3902('0xd')]!='OutgoingSpoolFailed'){utils['info'](util[_0x3902('0xb')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x24ab5c[_0x3902('0x8')],_0x24ab5c['context'],_0x24ab5c[_0x3902('0x1c')]));channels[_0x24ab5c[_0x3902('0x8')]]={'uniqueid':_0x24ab5c[_0x3902('0x8')],'accountcode':_0x24ab5c[_0x3902('0x14')],'source':_0x24ab5c[_0x3902('0x11')],'destination':_0x24ab5c[_0x3902('0x1c')],'destinationcontext':_0x24ab5c[_0x3902('0x1d')],'channel':_0x24ab5c['channel'],'starttime':utils[_0x3902('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x3902('0x1f')};}}catch(_0x4d9e38){utils[_0x3902('0x20')](util[_0x3902('0xb')](_0x3902('0x21'),_0x24ab5c['uniqueid']),_0x4d9e38);}};exports[_0x3902('0x22')]=function(_0x51e3e1){try{utils[_0x3902('0x1a')](util[_0x3902('0xb')](_0x3902('0x23'),_0x51e3e1[_0x3902('0x8')]),_0x51e3e1);if(!_[_0x3902('0x24')](channels[_0x51e3e1[_0x3902('0x8')]])&&_0x51e3e1[_0x3902('0x25')]==0x6){utils[_0x3902('0xa')](util[_0x3902('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x51e3e1['uniqueid'],_0x51e3e1[_0x3902('0x1d')],_0x51e3e1[_0x3902('0xd')]));if(_['isNil'](channels[_0x51e3e1['uniqueid']][_0x3902('0x26')])){channels[_0x51e3e1[_0x3902('0x8')]][_0x3902('0x26')]=utils[_0x3902('0x1e')]();}}else if(!_[_0x3902('0x24')](channels[_0x51e3e1[_0x3902('0x1b')]])&&_0x51e3e1['channelstate']==0x6&&_0x51e3e1[_0x3902('0x1d')]!=_0x3902('0x27')){utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0x28'),_0x51e3e1['uniqueid'],_0x51e3e1['linkedid'],_0x51e3e1['context'],_0x51e3e1[_0x3902('0xd')]));channels[_0x51e3e1['linkedid']][_0x3902('0x14')]=_0x51e3e1[_0x3902('0x14')];channels[_0x51e3e1[_0x3902('0x1b')]][_0x3902('0x29')]=_0x51e3e1['channel'];if(_[_0x3902('0x24')](channels[_0x51e3e1[_0x3902('0x1b')]][_0x3902('0x2a')])){channels[_0x51e3e1['linkedid']][_0x3902('0x2a')]=utils[_0x3902('0x1e')]();}channels[_0x51e3e1[_0x3902('0x1b')]][_0x3902('0x2b')]=dispositions[_[_0x3902('0x2c')](_0x51e3e1[_0x3902('0x25')])]||_0x3902('0x5');}}catch(_0x5eba8e){utils[_0x3902('0x20')](util[_0x3902('0xb')]('[%s][calls][newstate]',_0x51e3e1[_0x3902('0x8')]),_0x5eba8e);}};exports['hangup']=function(_0x4a6f78){try{if(!_[_0x3902('0x24')](channels[_0x4a6f78[_0x3902('0x8')]])){utils[_0x3902('0x1a')](util[_0x3902('0xb')]('[%s][calls][hangup]',_0x4a6f78[_0x3902('0x8')]),_0x4a6f78);if(_[_0x3902('0x24')](channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x2d')])){channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x2d')]=_0x4a6f78['calleridname']+'\x20<'+_0x4a6f78['calleridnum']+'>';}utils[_0x3902('0xa')](util[_0x3902('0xb')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x4a6f78['uniqueid'],channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x2d')],_0x4a6f78[_0x3902('0x2e')]));channels[_0x4a6f78['uniqueid']][_0x3902('0x2f')]=utils[_0x3902('0x1e')]();channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x30')]=utils[_0x3902('0x31')](channels[_0x4a6f78[_0x3902('0x8')]]['endtime'],channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x32')]);channels[_0x4a6f78['uniqueid']][_0x3902('0x33')]=channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x2a')]?utils[_0x3902('0x31')](channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x2f')],channels[_0x4a6f78[_0x3902('0x8')]]['answertime']):0x0;writeDB(channels[_0x4a6f78[_0x3902('0x8')]]);}}catch(_0x46853d){utils[_0x3902('0x20')](util[_0x3902('0xb')](_0x3902('0x34'),_0x4a6f78[_0x3902('0x8')]),_0x46853d);}};exports[_0x3902('0x35')]=function(_0x2db709){try{if(!_[_0x3902('0x24')](channels[_0x2db709[_0x3902('0x36')]])){utils[_0x3902('0x1a')](util['format']('[%s][calls][attendedtransfer]',_0x2db709[_0x3902('0x37')]),_0x2db709);if(channels[_0x2db709[_0x3902('0x36')]][_0x3902('0xd')]==_0x2db709[_0x3902('0x38')]){utils[_0x3902('0xa')](util[_0x3902('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2db709[_0x3902('0x37')],_0x2db709[_0x3902('0x36')],_0x2db709['secondtransfererchannel']));channels[_0x2db709[_0x3902('0x36')]][_0x3902('0x29')]=_0x2db709[_0x3902('0x39')];channels[_0x2db709[_0x3902('0x36')]][_0x3902('0x3a')]=_0x3902('0x3b');}else if(channels[_0x2db709[_0x3902('0x36')]][_0x3902('0xd')]=_0x2db709[_0x3902('0x3c')]){utils[_0x3902('0xa')](util[_0x3902('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2db709[_0x3902('0x37')],_0x2db709['localtwolinkedid'],_0x2db709[_0x3902('0x3d')]));channels[_0x2db709['localtwolinkedid']][_0x3902('0x29')]=_0x2db709[_0x3902('0x3d')];channels[_0x2db709[_0x3902('0x36')]][_0x3902('0x3a')]='_attended';}}}catch(_0x10cc1b){utils['error'](util[_0x3902('0xb')](_0x3902('0x3e'),_0x2db709[_0x3902('0x37')]),_0x10cc1b);}};exports['musiconholdstart']=function(_0x37a513){try{if(!_[_0x3902('0x24')](channels[_0x37a513[_0x3902('0x8')]])){utils[_0x3902('0x1a')](util['format'](_0x3902('0x3f'),_0x37a513[_0x3902('0x8')]),_0x37a513);channels[_0x37a513[_0x3902('0x8')]][_0x3902('0x40')]=utils[_0x3902('0x1e')]();utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0x41'),_0x37a513[_0x3902('0x8')],channels[_0x37a513[_0x3902('0x8')]][_0x3902('0x40')]));}}catch(_0x16f26c){utils['error'](util['format'](_0x3902('0x3f'),_0x37a513[_0x3902('0x8')]),_0x16f26c);}};exports[_0x3902('0x42')]=function(_0x17998f){try{if(!_[_0x3902('0x24')](channels[_0x17998f['uniqueid']])){utils[_0x3902('0x1a')](util[_0x3902('0xb')](_0x3902('0x43'),_0x17998f[_0x3902('0x8')]),_0x17998f);if(!_[_0x3902('0x24')](channels[_0x17998f[_0x3902('0x8')]]['musiconholdstartAt'])){channels[_0x17998f['uniqueid']][_0x3902('0x44')]+=utils[_0x3902('0x31')](utils['now'](),channels[_0x17998f['uniqueid']][_0x3902('0x40')]);utils[_0x3902('0xa')](util['format'](_0x3902('0x45'),_0x17998f['uniqueid'],channels[_0x17998f[_0x3902('0x8')]][_0x3902('0x44')]));delete channels[_0x17998f[_0x3902('0x8')]][_0x3902('0x40')];}}}catch(_0x255458){utils[_0x3902('0x20')](util[_0x3902('0xb')](_0x3902('0x43'),_0x17998f[_0x3902('0x8')]),_0x255458);}};exports[_0x3902('0x46')]=function(_0xb16dd0){try{if(!_[_0x3902('0x24')](channels[_0xb16dd0['uniqueid']])){utils[_0x3902('0x1a')](util[_0x3902('0xb')](_0x3902('0x47'),_0xb16dd0[_0x3902('0x8')]),_0xb16dd0);if(!_['isNil'](_0xb16dd0[_0x3902('0x48')][_0x3902('0x49')])){utils[_0x3902('0xa')](util['format'](_0x3902('0x4a'),_0xb16dd0[_0x3902('0x8')],_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]][_0x3902('0x4c')]=_0xb16dd0['value'];}if(!_[_0x3902('0x24')](_0xb16dd0['variable'][_0x3902('0x4d')])){utils[_0x3902('0xa')](util['format'](_0x3902('0x4e'),_0xb16dd0[_0x3902('0x8')],_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]]['destination']=_0xb16dd0[_0x3902('0x4b')];channels[_0xb16dd0['uniqueid']][_0x3902('0x2d')]='\x22'+_0xb16dd0[_0x3902('0x4b')]+_0x3902('0x4f')+_0xb16dd0[_0x3902('0x4b')]+'>';}if(!_['isNil'](_0xb16dd0[_0x3902('0x48')][_0x3902('0x50')])||!_[_0x3902('0x24')](_0xb16dd0[_0x3902('0x48')][_0x3902('0x51')])){utils['info'](util[_0x3902('0xb')](_0x3902('0x52'),_0xb16dd0['uniqueid'],!_[_0x3902('0x24')](_0xb16dd0[_0x3902('0x48')][_0x3902('0x50')])?'xmd-callerid-preview':_0x3902('0x51'),_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]]['callerid']=_0xb16dd0[_0x3902('0x4b')];}if(!_['isNil'](_0xb16dd0[_0x3902('0x48')][_0x3902('0x53')])||!_[_0x3902('0x24')](_0xb16dd0['variable'][_0x3902('0x54')])){utils[_0x3902('0xa')](util[_0x3902('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xb16dd0[_0x3902('0x8')],!_[_0x3902('0x24')](_0xb16dd0['variable'][_0x3902('0x53')])?_0x3902('0x53'):'xmcs-queue',_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]][_0x3902('0x55')]=_0x3902('0x56');channels[_0xb16dd0[_0x3902('0x8')]][_0x3902('0x57')]=_0xb16dd0[_0x3902('0x4b')];channels[_0xb16dd0[_0x3902('0x8')]]['queue']=!![];}if(!_[_0x3902('0x24')](_0xb16dd0[_0x3902('0x48')][_0x3902('0x58')])){utils['info'](util['format'](_0x3902('0x59'),_0xb16dd0[_0x3902('0x8')],_0xb16dd0['value']));channels[_0xb16dd0['uniqueid']]['ContactId']=_0xb16dd0['value'];}if(!_[_0x3902('0x24')](_0xb16dd0[_0x3902('0x48')][_0x3902('0x5a')])){utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0x5b'),_0xb16dd0[_0x3902('0x8')],_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]][_0x3902('0x5c')]=_0xb16dd0['value'];}if(!_[_0x3902('0x24')](_0xb16dd0[_0x3902('0x48')][_0x3902('0x5d')])){utils[_0x3902('0xa')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0xb16dd0['uniqueid'],_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]][_0x3902('0x5e')]=_0xb16dd0[_0x3902('0x4b')];}if(!_['isNil'](_0xb16dd0['variable']['sipcallid'])){utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0x5f'),_0xb16dd0[_0x3902('0x8')],_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0['uniqueid']][_0x3902('0x60')]=_0xb16dd0[_0x3902('0x4b')];}}}catch(_0x1e5744){utils[_0x3902('0x20')](util[_0x3902('0xb')]('[%s][calls][varset]',_0xb16dd0['uniqueid']),_0x1e5744);}};exports[_0x3902('0x61')]=function(_0x5ae78a){try{if(!_[_0x3902('0x24')](channels[_0x5ae78a[_0x3902('0x8')]])){utils[_0x3902('0x1a')](util['format'](_0x3902('0x62'),_0x5ae78a[_0x3902('0x8')]),_0x5ae78a);utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0x63'),_0x5ae78a['uniqueid'],_0x5ae78a[_0x3902('0x64')],_0x5ae78a[_0x3902('0x65')]));if(_0x5ae78a['application'][_0x3902('0x66')]()==_0x3902('0x67')&&_[_0x3902('0x68')](_0x5ae78a[_0x3902('0x65')][_0x3902('0x66')](),_0x3902('0x69'))){var _0x2185c1=_0x5ae78a[_0x3902('0x65')][_0x3902('0x6a')]('=');var _0x2ace94=_0x2185c1[0x0][_0x3902('0x6b')](_0x2185c1[0x0][_0x3902('0x6c')]('(')+0x1,_0x2185c1[0x0][_0x3902('0x6c')](')'));var _0x4a69d5=_0x2185c1[0x1];channels[_0x5ae78a[_0x3902('0x8')]][_0x2ace94]=_0x4a69d5;}if(!_[_0x3902('0x6d')]([_0x3902('0x6e'),_0x3902('0x6f'),'execif',_0x3902('0x67'),'gotoif'],_0x5ae78a['application'][_0x3902('0x66')]())){channels[_0x5ae78a['uniqueid']]['lastapplication']=_0x5ae78a[_0x3902('0x64')];channels[_0x5ae78a[_0x3902('0x8')]][_0x3902('0x57')]=_0x5ae78a[_0x3902('0x65')];}}}catch(_0x5056c8){utils[_0x3902('0x20')](util[_0x3902('0xb')]('[%s][calls][newexten]',_0x5ae78a[_0x3902('0x8')]),_0x5056c8);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e0e3c61..6dcb76b 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 _0x1701=['managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x1701,0x18d));var _0x1170=function(_0xc7de08,_0x32245a){_0xc7de08=_0xc7de08-0x0;var _0x20275b=_0x1701[_0xc7de08];return _0x20275b;};'use strict';var utils=require(_0x1170('0x0'));exports[_0x1170('0x1')]=function(){utils[_0x1170('0x2')](_0x1170('0x3'));};exports[_0x1170('0x4')]=function(){utils['info'](_0x1170('0x5'));};exports[_0x1170('0x6')]=function(){utils[_0x1170('0x2')](_0x1170('0x7'));};exports['error']=function(_0x1e6bff){utils[_0x1170('0x8')]('[core]\x20error',_0x1e6bff);};exports[_0x1170('0x9')]=function(){utils[_0x1170('0x2')](_0x1170('0xa'));};exports[_0x1170('0xb')]=function(_0x2c18a8){}; \ No newline at end of file +var _0x933b=['[core]\x20fullybooted','error','[core]\x20error','close','managerevent','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted'];(function(_0x329169,_0x4a1e72){var _0x3d5690=function(_0x1eb5d1){while(--_0x1eb5d1){_0x329169['push'](_0x329169['shift']());}};_0x3d5690(++_0x4a1e72);}(_0x933b,0xf7));var _0xb933=function(_0x4540a8,_0x56056f){_0x4540a8=_0x4540a8-0x0;var _0x168164=_0x933b[_0x4540a8];return _0x168164;};'use strict';var utils=require(_0xb933('0x0'));exports['connect']=function(){utils[_0xb933('0x1')](_0xb933('0x2'));};exports[_0xb933('0x3')]=function(){utils[_0xb933('0x1')](_0xb933('0x4'));};exports[_0xb933('0x5')]=function(){utils[_0xb933('0x1')](_0xb933('0x6'));};exports[_0xb933('0x7')]=function(_0x60dcc9){utils[_0xb933('0x7')](_0xb933('0x8'),_0x60dcc9);};exports[_0xb933('0x9')]=function(){utils['info']('[core]\x20close');};exports[_0xb933('0xa')]=function(_0x3fcf1e){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 878670d..4a2bd67 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 _0x08ca=['newexten','debug','format','[%s][dials][newexten]','info','application','appdata','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','isNil','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','endtime','holdtime','diffTime','billableseconds','lodash','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x08ca,0x1e1));var _0xa08c=function(_0x4d2716,_0x11d867){_0x4d2716=_0x4d2716-0x0;var _0x3ea8a1=_0x08ca[_0x4d2716];return _0x3ea8a1;};'use strict';var _=require(_0xa08c('0x0'));var util=require('util');var utils=require(_0xa08c('0x1'));var dials={};function writeDB(_0x428e4f){utils['info'](util['format'](_0xa08c('0x2'),_0x428e4f['uniqueid'],_0x428e4f[_0xa08c('0x3')],_0x428e4f['dialstring'],_0x428e4f[_0xa08c('0x4')],_0x428e4f['connectedlinenum'],_0x428e4f[_0xa08c('0x5')]));utils[_0xa08c('0x6')](_0xa08c('0x7'),_0x428e4f);delete dials[_0x428e4f[_0xa08c('0x8')]];}exports[_0xa08c('0x9')]=function(_0x524d26){try{utils[_0xa08c('0xa')](util[_0xa08c('0xb')](_0xa08c('0xc'),_0x524d26['uniqueid']),_0x524d26);utils[_0xa08c('0xd')](util[_0xa08c('0xb')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x524d26[_0xa08c('0x8')],_0x524d26[_0xa08c('0xe')],_0x524d26[_0xa08c('0xf')]));if(_0x524d26[_0xa08c('0xe')][_0xa08c('0x10')]()=='set'&&_['startsWith'](_0x524d26[_0xa08c('0xf')][_0xa08c('0x10')](),_0xa08c('0x11'))){var _0x24ab3c=_0x524d26[_0xa08c('0xf')][_0xa08c('0x12')]('=');dials[_0x524d26[_0xa08c('0x8')]]={'routeId':_0x24ab3c[0x1]};}}catch(_0x4da7d1){utils[_0xa08c('0x13')](util['format'](_0xa08c('0xc'),_0x524d26[_0xa08c('0x8')]),_0x4da7d1);}};exports[_0xa08c('0x14')]=function(_0x3fbc84){try{utils[_0xa08c('0xa')](util[_0xa08c('0xb')](_0xa08c('0x15'),_0x3fbc84[_0xa08c('0x8')]),_0x3fbc84);if(!_['isNil'](_0x3fbc84[_0xa08c('0x16')][_0xa08c('0x17')])){utils['info'](util['format'](_0xa08c('0x18'),_0x3fbc84[_0xa08c('0x8')],_0x3fbc84['value']));dials[_0x3fbc84[_0xa08c('0x8')]]={'routeId':_0x3fbc84[_0xa08c('0x19')]};}}catch(_0x317cd4){utils[_0xa08c('0x13')](util[_0xa08c('0xb')](_0xa08c('0x15'),_0x3fbc84['uniqueid']),_0x317cd4);}};exports[_0xa08c('0x1a')]=function(_0x394a2b){try{if(!_['isNil'](dials[_0x394a2b[_0xa08c('0x8')]])){utils[_0xa08c('0xa')](util['format']('[%s][dials][dialbegin]',_0x394a2b[_0xa08c('0x8')]),_0x394a2b);dials[_0x394a2b[_0xa08c('0x8')]]=_[_0xa08c('0x1b')](dials[_0x394a2b[_0xa08c('0x8')]],_0x394a2b);dials[_0x394a2b[_0xa08c('0x8')]][_0xa08c('0x1c')]=utils['now']();dials[_0x394a2b[_0xa08c('0x8')]][_0xa08c('0x1d')]=_0xa08c('0x1e');utils[_0xa08c('0xd')](util[_0xa08c('0xb')](_0xa08c('0x1f'),_0x394a2b[_0xa08c('0x8')],dials[_0x394a2b[_0xa08c('0x8')]]['starttime']));}}catch(_0x2bcc0d){utils[_0xa08c('0x13')](util['format'](_0xa08c('0x20'),_0x394a2b[_0xa08c('0x8')]),_0x2bcc0d);}};exports['dialend']=function(_0x4cc22e){try{if(!_['isNil'](dials[_0x4cc22e[_0xa08c('0x8')]])){utils[_0xa08c('0xa')](util[_0xa08c('0xb')]('[%s][dials][dialend]',_0x4cc22e[_0xa08c('0x8')]),_0x4cc22e);dials[_0x4cc22e['uniqueid']]['dialstatus']=_0x4cc22e[_0xa08c('0x5')];if(_0x4cc22e['dialstatus']==_0xa08c('0x21')){dials[_0x4cc22e['uniqueid']]=_[_0xa08c('0x1b')](dials[_0x4cc22e['uniqueid']],_0x4cc22e);dials[_0x4cc22e[_0xa08c('0x8')]][_0xa08c('0x22')]=utils[_0xa08c('0x23')]();dials[_0x4cc22e[_0xa08c('0x8')]][_0xa08c('0x1d')]=_0xa08c('0x24');utils[_0xa08c('0xd')](util[_0xa08c('0xb')](_0xa08c('0x25'),_0x4cc22e[_0xa08c('0x8')],_0x4cc22e['dialstatus'],dials[_0x4cc22e[_0xa08c('0x8')]]['answertime']));}else{utils[_0xa08c('0xd')](util[_0xa08c('0xb')]('[%s][dials][dialend]\x20dialstatus:%s',_0x4cc22e[_0xa08c('0x8')],_0x4cc22e['dialstatus']));}}}catch(_0x13d249){utils[_0xa08c('0x13')](util[_0xa08c('0xb')]('[%s][dials][dialend]',_0x4cc22e[_0xa08c('0x8')]),_0x13d249);}};exports[_0xa08c('0x26')]=function(_0x48ddb1){try{if(!_[_0xa08c('0x27')](dials[_0x48ddb1[_0xa08c('0x8')]])){utils[_0xa08c('0xa')](util[_0xa08c('0xb')](_0xa08c('0x28'),_0x48ddb1['uniqueid']),_0x48ddb1);utils[_0xa08c('0xd')](util[_0xa08c('0xb')](_0xa08c('0x29'),_0x48ddb1[_0xa08c('0x8')],_0x48ddb1[_0xa08c('0x4')],_0x48ddb1[_0xa08c('0x2a')],_0x48ddb1['cause-txt']));dials[_0x48ddb1[_0xa08c('0x8')]]=_[_0xa08c('0x1b')](dials[_0x48ddb1[_0xa08c('0x8')]],{'endtime':utils['now'](),'lastevent':_0xa08c('0x2b')});dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x2c')]=utils['diffTime'](dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x2d')],dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x1c')]);dials[_0x48ddb1['uniqueid']][_0xa08c('0x2e')]=utils[_0xa08c('0x2f')](dials[_0x48ddb1[_0xa08c('0x8')]]['answertime']||dials[_0x48ddb1['uniqueid']][_0xa08c('0x2d')],dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x1c')]);dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x30')]=dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x22')]?utils[_0xa08c('0x2f')](dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x2d')],dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x22')]):0x0;writeDB(dials[_0x48ddb1[_0xa08c('0x8')]]);}}catch(_0x59e109){utils[_0xa08c('0x13')](util[_0xa08c('0xb')](_0xa08c('0x28'),_0x48ddb1[_0xa08c('0x8')]),_0x59e109);}}; \ No newline at end of file +var _0xb671=['connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','assign','complete','duration','diffTime','endtime','billableseconds','lodash','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','connectedlinenum','dialstatus','request','uniqueid','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','error','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','now','[%s][dials][dialend]','ANSWER'];(function(_0xdea0a1,_0x3bc98e){var _0x39b1e3=function(_0x1c5d4a){while(--_0x1c5d4a){_0xdea0a1['push'](_0xdea0a1['shift']());}};_0x39b1e3(++_0x3bc98e);}(_0xb671,0xcf));var _0x1b67=function(_0x48d23b,_0x10b494){_0x48d23b=_0x48d23b-0x0;var _0x1bb0e0=_0xb671[_0x48d23b];return _0x1bb0e0;};'use strict';var _=require(_0x1b67('0x0'));var util=require('util');var utils=require(_0x1b67('0x1'));var dials={};function writeDB(_0x1c7dff){utils['info'](util[_0x1b67('0x2')](_0x1b67('0x3'),_0x1c7dff['uniqueid'],_0x1c7dff['channel'],_0x1c7dff[_0x1b67('0x4')],_0x1c7dff[_0x1b67('0x5')],_0x1c7dff[_0x1b67('0x6')],_0x1c7dff[_0x1b67('0x7')]));utils[_0x1b67('0x8')]('CreateVoiceDialReport',_0x1c7dff);delete dials[_0x1c7dff[_0x1b67('0x9')]];}exports[_0x1b67('0xa')]=function(_0x98930d){try{utils[_0x1b67('0xb')](util['format'](_0x1b67('0xc'),_0x98930d[_0x1b67('0x9')]),_0x98930d);utils[_0x1b67('0xd')](util['format'](_0x1b67('0xe'),_0x98930d['uniqueid'],_0x98930d[_0x1b67('0xf')],_0x98930d[_0x1b67('0x10')]));if(_0x98930d[_0x1b67('0xf')][_0x1b67('0x11')]()==_0x1b67('0x12')&&_['startsWith'](_0x98930d[_0x1b67('0x10')][_0x1b67('0x11')](),_0x1b67('0x13'))){var _0x285499=_0x98930d[_0x1b67('0x10')]['split']('=');dials[_0x98930d[_0x1b67('0x9')]]={'routeId':_0x285499[0x1]};}}catch(_0x3c311c){utils[_0x1b67('0x14')](util[_0x1b67('0x2')]('[%s][dials][newexten]',_0x98930d[_0x1b67('0x9')]),_0x3c311c);}};exports['varset']=function(_0xe2c10d){try{utils[_0x1b67('0xb')](util[_0x1b67('0x2')](_0x1b67('0x15'),_0xe2c10d[_0x1b67('0x9')]),_0xe2c10d);if(!_[_0x1b67('0x16')](_0xe2c10d[_0x1b67('0x17')][_0x1b67('0x18')])){utils['info'](util[_0x1b67('0x2')](_0x1b67('0x19'),_0xe2c10d[_0x1b67('0x9')],_0xe2c10d[_0x1b67('0x1a')]));dials[_0xe2c10d[_0x1b67('0x9')]]={'routeId':_0xe2c10d[_0x1b67('0x1a')]};}}catch(_0x32905c){utils[_0x1b67('0x14')](util[_0x1b67('0x2')]('[%s][dials][varset]',_0xe2c10d[_0x1b67('0x9')]),_0x32905c);}};exports[_0x1b67('0x1b')]=function(_0x4e4ec5){try{if(!_[_0x1b67('0x16')](dials[_0x4e4ec5[_0x1b67('0x9')]])){utils['debug'](util[_0x1b67('0x2')](_0x1b67('0x1c'),_0x4e4ec5[_0x1b67('0x9')]),_0x4e4ec5);dials[_0x4e4ec5[_0x1b67('0x9')]]=_['assign'](dials[_0x4e4ec5['uniqueid']],_0x4e4ec5);dials[_0x4e4ec5[_0x1b67('0x9')]][_0x1b67('0x1d')]=utils[_0x1b67('0x1e')]();dials[_0x4e4ec5['uniqueid']]['lastevent']='called';utils[_0x1b67('0xd')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x4e4ec5[_0x1b67('0x9')],dials[_0x4e4ec5['uniqueid']][_0x1b67('0x1d')]));}}catch(_0x556a38){utils[_0x1b67('0x14')](util[_0x1b67('0x2')](_0x1b67('0x1c'),_0x4e4ec5[_0x1b67('0x9')]),_0x556a38);}};exports['dialend']=function(_0xe42dbe){try{if(!_['isNil'](dials[_0xe42dbe['uniqueid']])){utils[_0x1b67('0xb')](util[_0x1b67('0x2')](_0x1b67('0x1f'),_0xe42dbe[_0x1b67('0x9')]),_0xe42dbe);dials[_0xe42dbe[_0x1b67('0x9')]][_0x1b67('0x7')]=_0xe42dbe[_0x1b67('0x7')];if(_0xe42dbe[_0x1b67('0x7')]==_0x1b67('0x20')){dials[_0xe42dbe[_0x1b67('0x9')]]=_['assign'](dials[_0xe42dbe[_0x1b67('0x9')]],_0xe42dbe);dials[_0xe42dbe['uniqueid']]['answertime']=utils['now']();dials[_0xe42dbe[_0x1b67('0x9')]]['lastevent']=_0x1b67('0x21');utils[_0x1b67('0xd')](util['format'](_0x1b67('0x22'),_0xe42dbe[_0x1b67('0x9')],_0xe42dbe[_0x1b67('0x7')],dials[_0xe42dbe['uniqueid']][_0x1b67('0x23')]));}else{utils['info'](util[_0x1b67('0x2')](_0x1b67('0x24'),_0xe42dbe[_0x1b67('0x9')],_0xe42dbe[_0x1b67('0x7')]));}}}catch(_0x213dd5){utils[_0x1b67('0x14')](util[_0x1b67('0x2')]('[%s][dials][dialend]',_0xe42dbe[_0x1b67('0x9')]),_0x213dd5);}};exports[_0x1b67('0x25')]=function(_0x3ef880){try{if(!_['isNil'](dials[_0x3ef880[_0x1b67('0x9')]])){utils[_0x1b67('0xb')](util['format'](_0x1b67('0x26'),_0x3ef880[_0x1b67('0x9')]),_0x3ef880);utils['info'](util[_0x1b67('0x2')](_0x1b67('0x27'),_0x3ef880[_0x1b67('0x9')],_0x3ef880[_0x1b67('0x5')],_0x3ef880[_0x1b67('0x28')],_0x3ef880[_0x1b67('0x29')]));dials[_0x3ef880[_0x1b67('0x9')]]=_[_0x1b67('0x2a')](dials[_0x3ef880[_0x1b67('0x9')]],{'endtime':utils[_0x1b67('0x1e')](),'lastevent':_0x1b67('0x2b')});dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x2c')]=utils[_0x1b67('0x2d')](dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x2e')],dials[_0x3ef880['uniqueid']]['starttime']);dials[_0x3ef880[_0x1b67('0x9')]]['holdtime']=utils[_0x1b67('0x2d')](dials[_0x3ef880[_0x1b67('0x9')]]['answertime']||dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x2e')],dials[_0x3ef880[_0x1b67('0x9')]]['starttime']);dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x2f')]=dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x23')]?utils['diffTime'](dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x2e')],dials[_0x3ef880[_0x1b67('0x9')]]['answertime']):0x0;writeDB(dials[_0x3ef880[_0x1b67('0x9')]]);}}catch(_0x4caa2d){utils[_0x1b67('0x14')](util[_0x1b67('0x2')](_0x1b67('0x26'),_0x3ef880[_0x1b67('0x9')]),_0x4caa2d);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index b628111..e8234c3 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 _0xb2f9=['[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','port','asterisk','username','password','keepConnected','xdr','info','./queues.controller','./recordings.controller','./members.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][newstate]','newstate','hangup'];(function(_0x279f7e,_0xe593f){var _0x6bc76e=function(_0x3665a9){while(--_0x3665a9){_0x279f7e['push'](_0x279f7e['shift']());}};_0x6bc76e(++_0xe593f);}(_0xb2f9,0xcf));var _0x9b2f=function(_0x35cb5f,_0x108f10){_0x35cb5f=_0x35cb5f-0x0;var _0xdb2122=_0xb2f9[_0x35cb5f];return _0xdb2122;};var AsteriskManager=require(_0x9b2f('0x0'));var config=require('../../config/environment');var utils=require(_0x9b2f('0x1'));var util=require('util');var ami=new AsteriskManager(config['asterisk'][_0x9b2f('0x2')],config[_0x9b2f('0x3')]['ip'],config['asterisk'][_0x9b2f('0x4')],config[_0x9b2f('0x3')][_0x9b2f('0x5')],!![]);ami[_0x9b2f('0x6')]();if(config[_0x9b2f('0x7')]&&config[_0x9b2f('0x7')]['disabled']){utils[_0x9b2f('0x8')]('XDR\x20DISABLED');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0x9b2f('0x9'));var recordings=require(_0x9b2f('0xa'));var members=require(_0x9b2f('0xb'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0x9b2f('0xc'));ami['on'](_0x9b2f('0xd'),core[_0x9b2f('0xd')]);ami['on'](_0x9b2f('0xe'),core[_0x9b2f('0xe')]);ami['on'](_0x9b2f('0xf'),core[_0x9b2f('0xf')]);ami['on'](_0x9b2f('0x10'),core[_0x9b2f('0x10')]);ami['on']('close',core[_0x9b2f('0x11')]);ami['on'](_0x9b2f('0x12'),core[_0x9b2f('0x12')]);ami['on'](_0x9b2f('0x13'),function(_0xd7a01){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')]('[%s][index][devicestatechange]',_0xd7a01[_0x9b2f('0x16')]),_0xd7a01);members['devicestatechange'](_0xd7a01);}catch(_0x1e37b2){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')](_0x9b2f('0x17'),_0xd7a01[_0x9b2f('0x16')]),_0x1e37b2);}});ami['on'](_0x9b2f('0x18'),function(_0x4363c9){try{utils[_0x9b2f('0x14')](util['format'](_0x9b2f('0x19'),_0x4363c9[_0x9b2f('0x1a')]),_0x4363c9);agents[_0x9b2f('0x18')](_0x4363c9);}catch(_0x887498){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')]('[%s][index][agentcalled]',_0x4363c9[_0x9b2f('0x1a')]),_0x887498);}});ami['on'](_0x9b2f('0x1b'),function(_0x2241cd){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x1c'),_0x2241cd['uniqueid']),_0x2241cd);agents[_0x9b2f('0x1b')](_0x2241cd);}catch(_0x4a713c){utils[_0x9b2f('0x10')](util['format'](_0x9b2f('0x1c'),_0x2241cd[_0x9b2f('0x1a')]),_0x4a713c);}});ami['on']('agentconnect',function(_0x5cb8f3){try{utils['debug'](util[_0x9b2f('0x15')](_0x9b2f('0x1d'),_0x5cb8f3['uniqueid']),_0x5cb8f3);agents[_0x9b2f('0x1e')](_0x5cb8f3);queues[_0x9b2f('0x1e')](_0x5cb8f3);}catch(_0x44fcae){utils['error'](util[_0x9b2f('0x15')]('[%s][index][agentconnect]',_0x5cb8f3[_0x9b2f('0x1a')]),_0x44fcae);}});ami['on'](_0x9b2f('0x1f'),function(_0x52ff69){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x20'),_0x52ff69[_0x9b2f('0x1a')]),_0x52ff69);agents[_0x9b2f('0x1f')](_0x52ff69);queues['agentcomplete'](_0x52ff69);members[_0x9b2f('0x1f')](_0x52ff69);}catch(_0x2873f3){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')](_0x9b2f('0x20'),_0x52ff69[_0x9b2f('0x1a')]),_0x2873f3);}});ami['on']('queuecallerabandon',function(_0x334f46){try{utils['debug'](util[_0x9b2f('0x15')](_0x9b2f('0x21'),_0x334f46[_0x9b2f('0x1a')]),_0x334f46);agents['queuecallerabandon'](_0x334f46);queues[_0x9b2f('0x22')](_0x334f46);}catch(_0x306a5b){utils[_0x9b2f('0x10')](util['format']('[%s][index][queuecallerabandon]',_0x334f46['uniqueid']),_0x306a5b);}});ami['on']('queuecallerjoin',function(_0x1fe7ea){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x23'),_0x1fe7ea['uniqueid']),_0x1fe7ea);queues[_0x9b2f('0x24')](_0x1fe7ea);recordings[_0x9b2f('0x24')](_0x1fe7ea);}catch(_0x1ee6fc){utils['error'](util[_0x9b2f('0x15')](_0x9b2f('0x23'),_0x1fe7ea[_0x9b2f('0x1a')]),_0x1ee6fc);}});ami['on'](_0x9b2f('0x25'),function(_0x3831dd){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x26'),_0x3831dd[_0x9b2f('0x1a')]),_0x3831dd);queues[_0x9b2f('0x25')](_0x3831dd);}catch(_0x3b7c87){utils['error'](util['format']('[%s][index][queuecallerleave]',_0x3831dd['uniqueid']),_0x3b7c87);}});ami['on'](_0x9b2f('0x27'),function(_0x26a527){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x28'),_0x26a527[_0x9b2f('0x1a')]),_0x26a527);queues['musiconholdstart'](_0x26a527);calls[_0x9b2f('0x27')](_0x26a527);}catch(_0x34cae5){utils['error'](util['format'](_0x9b2f('0x28'),_0x26a527[_0x9b2f('0x1a')]),_0x34cae5);}});ami['on']('musiconholdstop',function(_0x32dbc5){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')]('[%s][index][musiconholdstop]',_0x32dbc5[_0x9b2f('0x1a')]),_0x32dbc5);queues['musiconholdstop'](_0x32dbc5);calls[_0x9b2f('0x29')](_0x32dbc5);}catch(_0x204217){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')]('[%s][index][musiconholdstop]',_0x32dbc5[_0x9b2f('0x1a')]),_0x204217);}});ami['on']('newstate',function(_0xef3f4f){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x2a'),_0xef3f4f[_0x9b2f('0x1a')]),_0xef3f4f);calls[_0x9b2f('0x2b')](_0xef3f4f);recordings[_0x9b2f('0x2b')](_0xef3f4f);}catch(_0x54a711){utils[_0x9b2f('0x10')](util['format'](_0x9b2f('0x2a'),_0xef3f4f['uniqueid']),_0x54a711);}});ami['on'](_0x9b2f('0x2c'),function(_0x125c69){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')]('[%s][index][hangup]',_0x125c69[_0x9b2f('0x1a')]),_0x125c69);calls['hangup'](_0x125c69);recordings['hangup'](_0x125c69);dials[_0x9b2f('0x2c')](_0x125c69);agents[_0x9b2f('0x2c')](_0x125c69);queues[_0x9b2f('0x2c')](_0x125c69);}catch(_0x5bf86c){utils[_0x9b2f('0x10')](util['format'](_0x9b2f('0x2d'),_0x125c69[_0x9b2f('0x1a')]),_0x5bf86c);}});ami['on'](_0x9b2f('0x2e'),function(_0x12fe48){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x2f'),_0x12fe48[_0x9b2f('0x1a')]),_0x12fe48);members[_0x9b2f('0x2e')](_0x12fe48);}catch(_0x19d9d0){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')]('[%s][index][cdr]',_0x12fe48['uniqueid']),_0x19d9d0);}});ami['on'](_0x9b2f('0x30'),function(_0x373fbe){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x31'),_0x373fbe[_0x9b2f('0x1a')]),_0x373fbe);queues[_0x9b2f('0x30')](_0x373fbe);agents['blindtransfer'](_0x373fbe);transfers[_0x9b2f('0x30')](_0x373fbe);}catch(_0x3b1151){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')](_0x9b2f('0x31'),_0x373fbe[_0x9b2f('0x1a')]),_0x3b1151);}});ami['on'](_0x9b2f('0x32'),function(_0x45ff2a){try{utils[_0x9b2f('0x14')](util['format'](_0x9b2f('0x33'),_0x45ff2a[_0x9b2f('0x34')]),_0x45ff2a);queues[_0x9b2f('0x32')](_0x45ff2a);transfers[_0x9b2f('0x32')](_0x45ff2a);agents[_0x9b2f('0x32')](_0x45ff2a);calls[_0x9b2f('0x32')](_0x45ff2a);}catch(_0x535cf2){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')](_0x9b2f('0x33'),_0x45ff2a[_0x9b2f('0x34')]),_0x535cf2);}});ami['on'](_0x9b2f('0x35'),function(_0x53833a){try{utils['debug'](util[_0x9b2f('0x15')]('[%s][index][varset]',_0x53833a[_0x9b2f('0x1a')]),_0x53833a);queues[_0x9b2f('0x35')](_0x53833a);recordings['varset'](_0x53833a);calls[_0x9b2f('0x35')](_0x53833a);dials[_0x9b2f('0x35')](_0x53833a);}catch(_0xb568db){utils['error'](util[_0x9b2f('0x15')](_0x9b2f('0x36'),_0x53833a[_0x9b2f('0x1a')]),_0xb568db);}});ami['on'](_0x9b2f('0x37'),function(_0x5a655a){try{utils[_0x9b2f('0x14')](util['format'](_0x9b2f('0x38'),_0x5a655a['uniqueid']),_0x5a655a);calls[_0x9b2f('0x37')](_0x5a655a);recordings['newexten'](_0x5a655a);dials[_0x9b2f('0x37')](_0x5a655a);}catch(_0x1d61af){utils['error'](util[_0x9b2f('0x15')](_0x9b2f('0x38'),_0x5a655a['uniqueid']),_0x1d61af);}});ami['on'](_0x9b2f('0x39'),function(_0x5d48bc){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')]('[%s][index][newchannel]',_0x5d48bc[_0x9b2f('0x1a')]),_0x5d48bc);calls[_0x9b2f('0x39')](_0x5d48bc);recordings[_0x9b2f('0x39')](_0x5d48bc);}catch(_0x573d6e){utils['error'](util[_0x9b2f('0x15')](_0x9b2f('0x3a'),_0x5d48bc[_0x9b2f('0x1a')]),_0x573d6e);}});ami['on'](_0x9b2f('0x3b'),function(_0x2d9c52){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x3c'),_0x2d9c52[_0x9b2f('0x1a')]),_0x2d9c52);dials['dialbegin'](_0x2d9c52);}catch(_0x24966f){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')]('[%s]dialbegin',_0x2d9c52[_0x9b2f('0x1a')]),_0x24966f);}});ami['on'](_0x9b2f('0x3d'),function(_0x4df2c9){try{utils[_0x9b2f('0x14')](util['format'](_0x9b2f('0x3e'),_0x4df2c9[_0x9b2f('0x1a')]),_0x4df2c9);dials[_0x9b2f('0x3d')](_0x4df2c9);}catch(_0x3f1d2e){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')](_0x9b2f('0x3e'),_0x4df2c9['uniqueid']),_0x3f1d2e);}});} \ No newline at end of file +var _0x0ac5=['queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','asterisk','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./calls.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]'];(function(_0x14a683,_0x40a302){var _0x4bedd6=function(_0x5a2571){while(--_0x5a2571){_0x14a683['push'](_0x14a683['shift']());}};_0x4bedd6(++_0x40a302);}(_0x0ac5,0xe1));var _0x50ac=function(_0x180d02,_0xf063d9){_0x180d02=_0x180d02-0x0;var _0x2d7a2b=_0x0ac5[_0x180d02];return _0x2d7a2b;};var AsteriskManager=require('asterisk-manager');var config=require(_0x50ac('0x0'));var utils=require(_0x50ac('0x1'));var util=require('util');var ami=new AsteriskManager(config['asterisk']['port'],config['asterisk']['ip'],config[_0x50ac('0x2')]['username'],config['asterisk'][_0x50ac('0x3')],!![]);ami[_0x50ac('0x4')]();if(config[_0x50ac('0x5')]&&config[_0x50ac('0x5')][_0x50ac('0x6')]){utils['info'](_0x50ac('0x7'));}else{var agents=require('./agents.controller');var calls=require(_0x50ac('0x8'));var queues=require(_0x50ac('0x9'));var recordings=require('./recordings.controller');var members=require(_0x50ac('0xa'));var dials=require('./dials.controller');var transfers=require(_0x50ac('0xb'));var core=require(_0x50ac('0xc'));ami['on'](_0x50ac('0xd'),core['connect']);ami['on'](_0x50ac('0xe'),core[_0x50ac('0xe')]);ami['on'](_0x50ac('0xf'),core['fullybooted']);ami['on']('error',core[_0x50ac('0x10')]);ami['on'](_0x50ac('0x11'),core[_0x50ac('0x11')]);ami['on'](_0x50ac('0x12'),core[_0x50ac('0x12')]);ami['on']('devicestatechange',function(_0x443214){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x15'),_0x443214[_0x50ac('0x16')]),_0x443214);members[_0x50ac('0x17')](_0x443214);}catch(_0x6d8c95){utils[_0x50ac('0x10')](util['format'](_0x50ac('0x15'),_0x443214[_0x50ac('0x16')]),_0x6d8c95);}});ami['on'](_0x50ac('0x18'),function(_0x585ea8){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x19'),_0x585ea8[_0x50ac('0x1a')]),_0x585ea8);agents['agentcalled'](_0x585ea8);}catch(_0x58fc2b){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x19'),_0x585ea8[_0x50ac('0x1a')]),_0x58fc2b);}});ami['on']('agentringnoanswer',function(_0x4410c3){try{utils[_0x50ac('0x13')](util['format'](_0x50ac('0x1b'),_0x4410c3[_0x50ac('0x1a')]),_0x4410c3);agents[_0x50ac('0x1c')](_0x4410c3);}catch(_0xc3409b){utils[_0x50ac('0x10')](util[_0x50ac('0x14')]('[%s][index][agentringnoanswer]',_0x4410c3[_0x50ac('0x1a')]),_0xc3409b);}});ami['on'](_0x50ac('0x1d'),function(_0x1a49a6){try{utils[_0x50ac('0x13')](util['format'](_0x50ac('0x1e'),_0x1a49a6[_0x50ac('0x1a')]),_0x1a49a6);agents[_0x50ac('0x1d')](_0x1a49a6);queues[_0x50ac('0x1d')](_0x1a49a6);}catch(_0x52d222){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x1e'),_0x1a49a6[_0x50ac('0x1a')]),_0x52d222);}});ami['on']('agentcomplete',function(_0x350ded){try{utils['debug'](util[_0x50ac('0x14')](_0x50ac('0x1f'),_0x350ded[_0x50ac('0x1a')]),_0x350ded);agents[_0x50ac('0x20')](_0x350ded);queues['agentcomplete'](_0x350ded);members[_0x50ac('0x20')](_0x350ded);}catch(_0x1ade65){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x1f'),_0x350ded[_0x50ac('0x1a')]),_0x1ade65);}});ami['on'](_0x50ac('0x21'),function(_0x2bacdc){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')]('[%s][index][queuecallerabandon]',_0x2bacdc[_0x50ac('0x1a')]),_0x2bacdc);agents[_0x50ac('0x21')](_0x2bacdc);queues[_0x50ac('0x21')](_0x2bacdc);}catch(_0x2480c0){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x22'),_0x2bacdc[_0x50ac('0x1a')]),_0x2480c0);}});ami['on'](_0x50ac('0x23'),function(_0x25a3bd){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x24'),_0x25a3bd[_0x50ac('0x1a')]),_0x25a3bd);queues[_0x50ac('0x23')](_0x25a3bd);recordings[_0x50ac('0x23')](_0x25a3bd);}catch(_0x35d729){utils[_0x50ac('0x10')](util['format'](_0x50ac('0x24'),_0x25a3bd[_0x50ac('0x1a')]),_0x35d729);}});ami['on'](_0x50ac('0x25'),function(_0x3ee2e6){try{utils['debug'](util[_0x50ac('0x14')](_0x50ac('0x26'),_0x3ee2e6[_0x50ac('0x1a')]),_0x3ee2e6);queues[_0x50ac('0x25')](_0x3ee2e6);}catch(_0x57177e){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x26'),_0x3ee2e6[_0x50ac('0x1a')]),_0x57177e);}});ami['on'](_0x50ac('0x27'),function(_0x3cb332){try{utils['debug'](util[_0x50ac('0x14')](_0x50ac('0x28'),_0x3cb332['uniqueid']),_0x3cb332);queues[_0x50ac('0x27')](_0x3cb332);calls[_0x50ac('0x27')](_0x3cb332);}catch(_0x2c1e63){utils['error'](util['format'](_0x50ac('0x28'),_0x3cb332['uniqueid']),_0x2c1e63);}});ami['on'](_0x50ac('0x29'),function(_0x2309ff){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x2a'),_0x2309ff[_0x50ac('0x1a')]),_0x2309ff);queues[_0x50ac('0x29')](_0x2309ff);calls[_0x50ac('0x29')](_0x2309ff);}catch(_0x222d4a){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x2a'),_0x2309ff['uniqueid']),_0x222d4a);}});ami['on']('newstate',function(_0x4a5eb3){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x2b'),_0x4a5eb3['uniqueid']),_0x4a5eb3);calls[_0x50ac('0x2c')](_0x4a5eb3);recordings[_0x50ac('0x2c')](_0x4a5eb3);}catch(_0x2812cb){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x2b'),_0x4a5eb3[_0x50ac('0x1a')]),_0x2812cb);}});ami['on'](_0x50ac('0x2d'),function(_0x3f904c){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')]('[%s][index][hangup]',_0x3f904c[_0x50ac('0x1a')]),_0x3f904c);calls['hangup'](_0x3f904c);recordings[_0x50ac('0x2d')](_0x3f904c);dials[_0x50ac('0x2d')](_0x3f904c);agents[_0x50ac('0x2d')](_0x3f904c);queues[_0x50ac('0x2d')](_0x3f904c);}catch(_0x363416){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x2e'),_0x3f904c[_0x50ac('0x1a')]),_0x363416);}});ami['on']('cdr',function(_0x440ca5){try{utils[_0x50ac('0x13')](util['format'](_0x50ac('0x2f'),_0x440ca5['uniqueid']),_0x440ca5);members[_0x50ac('0x30')](_0x440ca5);}catch(_0x4bc67f){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x2f'),_0x440ca5[_0x50ac('0x1a')]),_0x4bc67f);}});ami['on'](_0x50ac('0x31'),function(_0x1ae230){try{utils['debug'](util[_0x50ac('0x14')]('[%s][index][blindtransfer]',_0x1ae230[_0x50ac('0x1a')]),_0x1ae230);queues['blindtransfer'](_0x1ae230);agents[_0x50ac('0x31')](_0x1ae230);transfers[_0x50ac('0x31')](_0x1ae230);}catch(_0x4323de){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x32'),_0x1ae230[_0x50ac('0x1a')]),_0x4323de);}});ami['on'](_0x50ac('0x33'),function(_0x521236){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x34'),_0x521236[_0x50ac('0x35')]),_0x521236);queues[_0x50ac('0x33')](_0x521236);transfers['attendedtransfer'](_0x521236);agents[_0x50ac('0x33')](_0x521236);calls[_0x50ac('0x33')](_0x521236);}catch(_0x294fac){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x34'),_0x521236[_0x50ac('0x35')]),_0x294fac);}});ami['on'](_0x50ac('0x36'),function(_0x362c46){try{utils[_0x50ac('0x13')](util['format'](_0x50ac('0x37'),_0x362c46[_0x50ac('0x1a')]),_0x362c46);queues['varset'](_0x362c46);recordings[_0x50ac('0x36')](_0x362c46);calls[_0x50ac('0x36')](_0x362c46);dials[_0x50ac('0x36')](_0x362c46);}catch(_0x3f97de){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x37'),_0x362c46[_0x50ac('0x1a')]),_0x3f97de);}});ami['on'](_0x50ac('0x38'),function(_0x165379){try{utils['debug'](util[_0x50ac('0x14')](_0x50ac('0x39'),_0x165379['uniqueid']),_0x165379);calls['newexten'](_0x165379);recordings['newexten'](_0x165379);dials[_0x50ac('0x38')](_0x165379);}catch(_0x17f804){utils['error'](util[_0x50ac('0x14')](_0x50ac('0x39'),_0x165379[_0x50ac('0x1a')]),_0x17f804);}});ami['on'](_0x50ac('0x3a'),function(_0xa163c0){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x3b'),_0xa163c0['uniqueid']),_0xa163c0);calls[_0x50ac('0x3a')](_0xa163c0);recordings['newchannel'](_0xa163c0);}catch(_0x57d7e5){utils['error'](util[_0x50ac('0x14')](_0x50ac('0x3b'),_0xa163c0[_0x50ac('0x1a')]),_0x57d7e5);}});ami['on'](_0x50ac('0x3c'),function(_0x235146){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x3d'),_0x235146[_0x50ac('0x1a')]),_0x235146);dials[_0x50ac('0x3c')](_0x235146);}catch(_0x4b6ea1){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x3e'),_0x235146['uniqueid']),_0x4b6ea1);}});ami['on'](_0x50ac('0x3f'),function(_0x5a7635){try{utils['debug'](util[_0x50ac('0x14')](_0x50ac('0x40'),_0x5a7635[_0x50ac('0x1a')]),_0x5a7635);dials[_0x50ac('0x3f')](_0x5a7635);}catch(_0x94dac5){utils[_0x50ac('0x10')](util['format'](_0x50ac('0x40'),_0x5a7635['uniqueid']),_0x94dac5);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 646e357..18a17af 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 _0x8135=['[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','some','startsWith','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','cdr','debug','[%s][members][cdr]','channel','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','util','./utils','Local/_attended@transfer','Queue:','info','format'];(function(_0x22cd98,_0x4af73c){var _0x5ab0f7=function(_0x147635){while(--_0x147635){_0x22cd98['push'](_0x22cd98['shift']());}};_0x5ab0f7(++_0x4af73c);}(_0x8135,0x99));var _0x5813=function(_0x14db00,_0x4ca78d){_0x14db00=_0x14db00-0x0;var _0x1e4be1=_0x8135[_0x14db00];return _0x1e4be1;};'use strict';var _=require('lodash');var util=require(_0x5813('0x0'));var utils=require(_0x5813('0x1'));var members={};var exclude=[_0x5813('0x2'),_0x5813('0x3')];function writeDB(_0x4b43a8){utils[_0x5813('0x4')](util[_0x5813('0x5')](_0x5813('0x6'),_0x4b43a8[_0x5813('0x7')],_0x4b43a8[_0x5813('0x8')],_0x4b43a8['channel'],_0x4b43a8['data2'],_0x4b43a8[_0x5813('0x9')],_0x4b43a8[_0x5813('0xa')]));if(_0x4b43a8[_0x5813('0x8')]){utils[_0x5813('0xb')](_0x4b43a8[_0x5813('0x8')])[_0x5813('0xc')](function(_0xcb7307){if(_0xcb7307){_0x4b43a8[_0x5813('0x9')]=_0xcb7307[_0x5813('0xd')];_0x4b43a8[_0x5813('0xe')]=_0xcb7307[_0x5813('0xe')];utils[_0x5813('0xf')](_0x5813('0x10'),_0x4b43a8);}else{utils[_0x5813('0x11')](_0x4b43a8[_0x5813('0x8')][_0x5813('0x12')]('/')[0x1])[_0x5813('0xc')](function(_0x58f641){if(_0x58f641){_0x4b43a8[_0x5813('0x9')]=_0x58f641[_0x5813('0xd')];_0x4b43a8[_0x5813('0xe')]=_0x58f641['internal'];utils[_0x5813('0xf')](_0x5813('0x10'),_0x4b43a8);}});}})['catch'](function(_0x183445){utils[_0x5813('0x13')](util['format'](_0x5813('0x14'),_0x4b43a8[_0x5813('0x7')]),_0x183445);});}delete members[_0x4b43a8[_0x5813('0x8')]];}function startsWith(_0x5044e9,_0x2bbf85){return _[_0x5813('0x15')](_0x5044e9,function(_0x5d2724){return _[_0x5813('0x16')](_0x2bbf85,_0x5d2724);});}exports['devicestatechange']=function(_0x56ebc0){try{utils['debug'](util['format']('[%s][members][devicestatechange]',members[_0x56ebc0[_0x5813('0x17')]]?members[_0x56ebc0[_0x5813('0x17')]][_0x5813('0x7')]:_0x56ebc0['device']),_0x56ebc0);utils[_0x5813('0x4')](util[_0x5813('0x5')](_0x5813('0x18'),members[_0x56ebc0[_0x5813('0x17')]]?members[_0x56ebc0['device']][_0x5813('0x7')]:_0x56ebc0[_0x5813('0x17')],_0x56ebc0[_0x5813('0x19')],_0x56ebc0[_0x5813('0x17')]));switch(_0x56ebc0['state']){case _0x5813('0x1a'):case _0x5813('0x1b'):if(!startsWith(exclude,_0x56ebc0[_0x5813('0x17')])){members[_0x56ebc0['device']]={'channel':_0x5813('0x1c'),'interface':_0x56ebc0[_0x5813('0x17')],'type':_0x5813('0x1d'),'enterAt':utils[_0x5813('0x1e')](),'role':_0x5813('0x1f')};}break;case _0x5813('0x20'):if(!_[_0x5813('0x21')](members[_0x56ebc0[_0x5813('0x17')]])){members[_0x56ebc0['device']][_0x5813('0x22')]=utils[_0x5813('0x1e')]();members[_0x56ebc0[_0x5813('0x17')]][_0x5813('0x23')]=utils[_0x5813('0x24')](members[_0x56ebc0[_0x5813('0x17')]][_0x5813('0x22')],members[_0x56ebc0['device']][_0x5813('0x25')]);if(members[_0x56ebc0[_0x5813('0x17')]][_0x5813('0x7')]){writeDB(members[_0x56ebc0['device']]);}}break;default:break;}}catch(_0x2051e9){utils[_0x5813('0x13')](util['format']('[%s][members][devicestatechange]',members[_0x56ebc0[_0x5813('0x17')]]?members[_0x56ebc0[_0x5813('0x17')]]['uniqueid']:_0x56ebc0['device']),_0x2051e9);}};exports[_0x5813('0x26')]=function(_0x6c57bd){try{if(!_[_0x5813('0x21')](members[_0x6c57bd[_0x5813('0x8')]])){utils['debug'](util['format'](_0x5813('0x27'),_0x6c57bd[_0x5813('0x7')]),_0x6c57bd);utils[_0x5813('0x4')](util['format'](_0x5813('0x28'),_0x6c57bd[_0x5813('0x7')],_0x6c57bd[_0x5813('0x8')],_0x6c57bd['queue']));members[_0x6c57bd[_0x5813('0x8')]]=_[_0x5813('0x29')](members[_0x6c57bd[_0x5813('0x8')]],{'data4':_0x6c57bd['queue'],'uniqueid':_0x6c57bd[_0x5813('0x7')]});}}catch(_0x7c1a02){utils[_0x5813('0x13')](util[_0x5813('0x5')](_0x5813('0x27'),_0x6c57bd[_0x5813('0x7')]),_0x7c1a02);}};exports[_0x5813('0x2a')]=function(_0x506ba9){try{utils[_0x5813('0x2b')](util[_0x5813('0x5')](_0x5813('0x2c'),_0x506ba9[_0x5813('0x7')]),_0x506ba9);if(_0x506ba9[_0x5813('0x2d')]){var _0x55bcd0=_0x506ba9[_0x5813('0x2d')][_0x5813('0x12')]('-')[0x0];if(!_[_0x5813('0x21')](members[_0x55bcd0])){members[_0x55bcd0]=_[_0x5813('0x29')](members[_0x55bcd0],{'data1':members[_0x55bcd0]['data1']||_0x506ba9['type'],'data2':members[_0x55bcd0][_0x5813('0x2e')]||_0x506ba9[_0x5813('0x2f')],'data3':members[_0x55bcd0][_0x5813('0x30')]||_0x506ba9[_0x5813('0x31')],'uniqueid':members[_0x55bcd0]['uniqueid']||_0x506ba9[_0x5813('0x7')]});utils['info'](util[_0x5813('0x5')](_0x5813('0x32'),_0x506ba9[_0x5813('0x7')],members[_0x55bcd0][_0x5813('0x33')],members[_0x55bcd0][_0x5813('0x2e')],members[_0x55bcd0][_0x5813('0x30')]));if(members[_0x55bcd0][_0x5813('0x22')]){writeDB(members[_0x55bcd0]);}}}if(_0x506ba9['destinationchannel']){var _0x3d7e7f=_0x506ba9[_0x5813('0x34')]['split']('-')[0x0];if(!_[_0x5813('0x21')](members[_0x3d7e7f])){members[_0x3d7e7f]=_[_0x5813('0x29')](members[_0x3d7e7f],{'data1':members[_0x3d7e7f][_0x5813('0x33')]||_0x506ba9[_0x5813('0xa')],'data2':members[_0x3d7e7f][_0x5813('0x2e')]||_0x506ba9[_0x5813('0x2f')],'data3':members[_0x3d7e7f][_0x5813('0x30')]||_0x506ba9['destination'],'uniqueid':members[_0x3d7e7f][_0x5813('0x7')]||_0x506ba9[_0x5813('0x7')]});utils[_0x5813('0x4')](util[_0x5813('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x506ba9[_0x5813('0x7')],members[_0x3d7e7f][_0x5813('0x33')],members[_0x3d7e7f][_0x5813('0x2e')],members[_0x3d7e7f]['data3']));if(members[_0x3d7e7f][_0x5813('0x22')]){writeDB(members[_0x3d7e7f]);}}}}catch(_0xcfe61a){utils['error'](util[_0x5813('0x5')](_0x5813('0x2c'),_0x506ba9[_0x5813('0x7')]),_0xcfe61a);}}; \ No newline at end of file +var _0xa854=['util','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','format','[%s][members][writeDB]','uniqueid','some','startsWith','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','destinationchannel','lodash'];(function(_0x400a64,_0x5ec493){var _0x3108af=function(_0x421106){while(--_0x421106){_0x400a64['push'](_0x400a64['shift']());}};_0x3108af(++_0x5ec493);}(_0xa854,0x103));var _0x4a85=function(_0x51305d,_0x519fba){_0x51305d=_0x51305d-0x0;var _0x1efa1b=_0xa854[_0x51305d];return _0x1efa1b;};'use strict';var _=require(_0x4a85('0x0'));var util=require(_0x4a85('0x1'));var utils=require(_0x4a85('0x2'));var members={};var exclude=[_0x4a85('0x3'),_0x4a85('0x4')];function writeDB(_0x491f7c){utils[_0x4a85('0x5')](util['format'](_0x4a85('0x6'),_0x491f7c['uniqueid'],_0x491f7c[_0x4a85('0x7')],_0x491f7c[_0x4a85('0x8')],_0x491f7c['data2'],_0x491f7c[_0x4a85('0x9')],_0x491f7c[_0x4a85('0xa')]));if(_0x491f7c['interface']){utils[_0x4a85('0xb')](_0x491f7c['interface'])[_0x4a85('0xc')](function(_0x1131cd){if(_0x1131cd){_0x491f7c[_0x4a85('0x9')]=_0x1131cd[_0x4a85('0xd')];_0x491f7c[_0x4a85('0xe')]=_0x1131cd[_0x4a85('0xe')];utils[_0x4a85('0xf')](_0x4a85('0x10'),_0x491f7c);}else{utils[_0x4a85('0x11')](_0x491f7c['interface'][_0x4a85('0x12')]('/')[0x1])[_0x4a85('0xc')](function(_0x42b7b9){if(_0x42b7b9){_0x491f7c[_0x4a85('0x9')]=_0x42b7b9[_0x4a85('0xd')];_0x491f7c[_0x4a85('0xe')]=_0x42b7b9[_0x4a85('0xe')];utils[_0x4a85('0xf')](_0x4a85('0x10'),_0x491f7c);}});}})['catch'](function(_0x35e857){utils[_0x4a85('0x13')](util[_0x4a85('0x14')](_0x4a85('0x15'),_0x491f7c[_0x4a85('0x16')]),_0x35e857);});}delete members[_0x491f7c[_0x4a85('0x7')]];}function startsWith(_0x34743a,_0x256a3c){return _[_0x4a85('0x17')](_0x34743a,function(_0x397f4a){return _[_0x4a85('0x18')](_0x256a3c,_0x397f4a);});}exports['devicestatechange']=function(_0x28a7d3){try{utils[_0x4a85('0x19')](util['format'](_0x4a85('0x1a'),members[_0x28a7d3[_0x4a85('0x1b')]]?members[_0x28a7d3[_0x4a85('0x1b')]]['uniqueid']:_0x28a7d3[_0x4a85('0x1b')]),_0x28a7d3);utils[_0x4a85('0x5')](util[_0x4a85('0x14')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x28a7d3['device']]?members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x16')]:_0x28a7d3[_0x4a85('0x1b')],_0x28a7d3[_0x4a85('0x1c')],_0x28a7d3[_0x4a85('0x1b')]));switch(_0x28a7d3[_0x4a85('0x1c')]){case _0x4a85('0x1d'):case _0x4a85('0x1e'):if(!startsWith(exclude,_0x28a7d3['device'])){members[_0x28a7d3['device']]={'channel':'voice','interface':_0x28a7d3[_0x4a85('0x1b')],'type':_0x4a85('0x1f'),'enterAt':utils[_0x4a85('0x20')](),'role':_0x4a85('0x21')};}break;case'NOT_INUSE':if(!_[_0x4a85('0x22')](members[_0x28a7d3[_0x4a85('0x1b')]])){members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x23')]=utils[_0x4a85('0x20')]();members[_0x28a7d3['device']][_0x4a85('0x24')]=utils[_0x4a85('0x25')](members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x23')],members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x26')]);if(members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x16')]){writeDB(members[_0x28a7d3[_0x4a85('0x1b')]]);}}break;default:break;}}catch(_0x377796){utils['error'](util[_0x4a85('0x14')]('[%s][members][devicestatechange]',members[_0x28a7d3[_0x4a85('0x1b')]]?members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x16')]:_0x28a7d3[_0x4a85('0x1b')]),_0x377796);}};exports[_0x4a85('0x27')]=function(_0x37095a){try{if(!_[_0x4a85('0x22')](members[_0x37095a[_0x4a85('0x7')]])){utils['debug'](util[_0x4a85('0x14')]('[%s][members][agentcomplete]',_0x37095a[_0x4a85('0x16')]),_0x37095a);utils[_0x4a85('0x5')](util['format'](_0x4a85('0x28'),_0x37095a[_0x4a85('0x16')],_0x37095a[_0x4a85('0x7')],_0x37095a[_0x4a85('0x29')]));members[_0x37095a[_0x4a85('0x7')]]=_[_0x4a85('0x2a')](members[_0x37095a[_0x4a85('0x7')]],{'data4':_0x37095a[_0x4a85('0x29')],'uniqueid':_0x37095a[_0x4a85('0x16')]});}}catch(_0x89e5bb){utils[_0x4a85('0x13')](util[_0x4a85('0x14')]('[%s][members][agentcomplete]',_0x37095a[_0x4a85('0x16')]),_0x89e5bb);}};exports[_0x4a85('0x2b')]=function(_0x41adff){try{utils[_0x4a85('0x19')](util['format'](_0x4a85('0x2c'),_0x41adff[_0x4a85('0x16')]),_0x41adff);if(_0x41adff[_0x4a85('0x8')]){var _0x117c3d=_0x41adff[_0x4a85('0x8')][_0x4a85('0x12')]('-')[0x0];if(!_[_0x4a85('0x22')](members[_0x117c3d])){members[_0x117c3d]=_['assign'](members[_0x117c3d],{'data1':members[_0x117c3d][_0x4a85('0x2d')]||_0x41adff[_0x4a85('0xa')],'data2':members[_0x117c3d]['data2']||_0x41adff[_0x4a85('0x2e')],'data3':members[_0x117c3d][_0x4a85('0x2f')]||_0x41adff[_0x4a85('0x30')],'uniqueid':members[_0x117c3d]['uniqueid']||_0x41adff[_0x4a85('0x16')]});utils[_0x4a85('0x5')](util[_0x4a85('0x14')](_0x4a85('0x31'),_0x41adff[_0x4a85('0x16')],members[_0x117c3d][_0x4a85('0x2d')],members[_0x117c3d][_0x4a85('0x32')],members[_0x117c3d][_0x4a85('0x2f')]));if(members[_0x117c3d][_0x4a85('0x23')]){writeDB(members[_0x117c3d]);}}}if(_0x41adff['destinationchannel']){var _0x200598=_0x41adff[_0x4a85('0x33')][_0x4a85('0x12')]('-')[0x0];if(!_['isNil'](members[_0x200598])){members[_0x200598]=_[_0x4a85('0x2a')](members[_0x200598],{'data1':members[_0x200598]['data1']||_0x41adff[_0x4a85('0xa')],'data2':members[_0x200598][_0x4a85('0x32')]||_0x41adff['source'],'data3':members[_0x200598][_0x4a85('0x2f')]||_0x41adff[_0x4a85('0x30')],'uniqueid':members[_0x200598][_0x4a85('0x16')]||_0x41adff['uniqueid']});utils['info'](util[_0x4a85('0x14')](_0x4a85('0x31'),_0x41adff['uniqueid'],members[_0x200598]['data1'],members[_0x200598]['data2'],members[_0x200598][_0x4a85('0x2f')]));if(members[_0x200598][_0x4a85('0x23')]){writeDB(members[_0x200598]);}}}}catch(_0x4fd1de){utils['error'](util[_0x4a85('0x14')](_0x4a85('0x2c'),_0x41adff[_0x4a85('0x16')]),_0x4fd1de);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 57d8780..619f148 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 _0x6a42=['secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','calleridnum','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','util','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid'];(function(_0x4c6850,_0x4a8d10){var _0x453564=function(_0x79e91){while(--_0x79e91){_0x4c6850['push'](_0x4c6850['shift']());}};_0x453564(++_0x4a8d10);}(_0x6a42,0xe8));var _0x26a4=function(_0x3c84c5,_0x1d6b22){_0x3c84c5=_0x3c84c5-0x0;var _0x4d94a4=_0x6a42[_0x3c84c5];return _0x4d94a4;};'use strict';var _=require('lodash');var util=require(_0x26a4('0x0'));var utils=require(_0x26a4('0x1'));var queues={};function writeDB(_0x418cf1){utils['info'](util['format'](_0x26a4('0x2'),_0x418cf1[_0x26a4('0x3')],_0x418cf1[_0x26a4('0x4')],_0x418cf1[_0x26a4('0x5')],_0x418cf1[_0x26a4('0x6')],_0x418cf1['calleridnum'],_0x418cf1[_0x26a4('0x7')],_0x418cf1[_0x26a4('0x8')]));if(_0x418cf1[_0x26a4('0x5')]){utils[_0x26a4('0x9')](_0x418cf1[_0x26a4('0x5')])[_0x26a4('0xa')](function(_0x483e17){if(_0x483e17){_0x418cf1[_0x26a4('0xb')]=_0x483e17['type'];}utils[_0x26a4('0xc')](_0x26a4('0xd'),_0x418cf1);});}else{utils[_0x26a4('0xc')]('CreateVoiceQueueReport',_0x418cf1);}if(_0x418cf1[_0x26a4('0xe')]){delete queues[_0x418cf1[_0x26a4('0xe')]];}else{delete queues[_0x418cf1['uniqueid']];}}exports[_0x26a4('0xf')]=function(_0x3f77f0){try{utils[_0x26a4('0x10')](util[_0x26a4('0x11')](_0x26a4('0x12'),_0x3f77f0[_0x26a4('0x3')]),_0x3f77f0);utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x14'),_0x3f77f0[_0x26a4('0x3')],_0x3f77f0[_0x26a4('0x5')],_0x3f77f0[_0x26a4('0x15')]));queues[_0x3f77f0[_0x26a4('0x3')]]=_[_0x26a4('0x16')](_0x3f77f0,{'originalposition':_0x3f77f0['position'],'queuecallerjoinAt':utils[_0x26a4('0x17')](),'mohtime':0x0});}catch(_0x1864c9){utils[_0x26a4('0x18')](util[_0x26a4('0x11')](_0x26a4('0x12'),_0x3f77f0['uniqueid']),_0x1864c9);}};exports[_0x26a4('0x19')]=function(_0x1f2813){try{if(!_[_0x26a4('0x1a')](queues[_0x1f2813[_0x26a4('0x3')]])){utils[_0x26a4('0x10')](util[_0x26a4('0x11')](_0x26a4('0x1b'),_0x1f2813['uniqueid']),_0x1f2813);if(queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0x1c')]){if(!queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0x1d')]&&!queues[_0x1f2813['uniqueid']]['queuecallerexit']){queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0x1e')]=!![];queues[_0x1f2813[_0x26a4('0x3')]]['queuecallercompleteAt']=utils[_0x26a4('0x17')]();queues[_0x1f2813['uniqueid']][_0x26a4('0x8')]=_0x26a4('0x1f');}utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x20'),_0x1f2813[_0x26a4('0x3')],queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0x21')],queues[_0x1f2813[_0x26a4('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x1f2813[_0x26a4('0x3')]]);}else if(queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0xe')]){utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x22'),_0x1f2813[_0x26a4('0x3')],queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0x21')],queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0xe')]));queues[queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0xe')]]=queues[_0x1f2813[_0x26a4('0x3')]];queues[queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0xe')]][_0x26a4('0x23')]=0x2;delete queues[_0x1f2813['uniqueid']];}}}catch(_0x2b027d){utils['error'](util[_0x26a4('0x11')]('[%s][queues][hangup]',_0x1f2813[_0x26a4('0x3')]),_0x2b027d);}};exports[_0x26a4('0x24')]=function(_0x48b31f){try{utils[_0x26a4('0x10')](util[_0x26a4('0x11')]('[%s][queues][varset]',_0x48b31f[_0x26a4('0x3')]),_0x48b31f);if(!_[_0x26a4('0x1a')](_0x48b31f[_0x26a4('0x25')][_0x26a4('0x26')])&&_0x48b31f[_0x26a4('0x27')][_0x26a4('0x28')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x48b31f[_0x26a4('0x3')]])){queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x29')]=null;queues[_0x48b31f['uniqueid']][_0x26a4('0x2a')]=!![];queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x2b')]=utils[_0x26a4('0x17')]();queues[_0x48b31f['uniqueid']][_0x26a4('0x8')]=_0x48b31f[_0x26a4('0x27')][_0x26a4('0x28')]();utils[_0x26a4('0x13')](util['format'](_0x26a4('0x2c'),_0x48b31f['uniqueid'],queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x21')],_0x48b31f['value'],queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x8')]));writeDB(queues[_0x48b31f[_0x26a4('0x3')]]);}}else if(!_[_0x26a4('0x1a')](_0x48b31f[_0x26a4('0x25')][_0x26a4('0x2d')])){if(!_[_0x26a4('0x1a')](queues[_0x48b31f[_0x26a4('0x3')]])&&!queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x1d')]){queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x29')]=null;queues[_0x48b31f['uniqueid']][_0x26a4('0x2a')]=!![];queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x2b')]=utils[_0x26a4('0x17')]();queues[_0x48b31f[_0x26a4('0x3')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x2e'),_0x48b31f[_0x26a4('0x3')],queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x21')],_0x48b31f[_0x26a4('0x27')],queues[_0x48b31f['uniqueid']][_0x26a4('0x8')]));}}}catch(_0x25d680){utils[_0x26a4('0x18')](util[_0x26a4('0x11')](_0x26a4('0x2f'),_0x48b31f[_0x26a4('0x3')]),_0x25d680);}};exports[_0x26a4('0x1d')]=function(_0x62618c){try{if(!_[_0x26a4('0x1a')](queues[_0x62618c[_0x26a4('0x3')]])){utils['debug'](util[_0x26a4('0x11')](_0x26a4('0x30'),_0x62618c[_0x26a4('0x3')]),_0x62618c);queues[_0x62618c['uniqueid']][_0x26a4('0x2a')]=![];queues[_0x62618c[_0x26a4('0x3')]][_0x26a4('0x2b')]=null;queues[_0x62618c[_0x26a4('0x3')]][_0x26a4('0x1d')]=!![];queues[_0x62618c['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x62618c[_0x26a4('0x3')]]['queuecallerexitreason']=_0x26a4('0x31');utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x32'),_0x62618c[_0x26a4('0x3')],queues[_0x62618c['uniqueid']][_0x26a4('0x21')],queues[_0x62618c['uniqueid']][_0x26a4('0x8')]));}}catch(_0x5aaf40){utils[_0x26a4('0x18')](util['format']('[%s][queues][queuecallerabandon]',_0x62618c[_0x26a4('0x3')]),_0x5aaf40);}};exports[_0x26a4('0x33')]=function(_0x231076){try{if(!_[_0x26a4('0x1a')](queues[_0x231076[_0x26a4('0x3')]])){utils[_0x26a4('0x10')](util['format'](_0x26a4('0x34'),_0x231076[_0x26a4('0x3')]),_0x231076);utils['info'](util[_0x26a4('0x11')](_0x26a4('0x35'),_0x231076[_0x26a4('0x3')],queues[_0x231076[_0x26a4('0x3')]]['name'],_0x231076[_0x26a4('0x36')],_0x231076[_0x26a4('0x37')]));queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x33')]=!![];queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x1c')]=utils[_0x26a4('0x17')]();queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x38')]=utils['diffTime'](queues[_0x231076['uniqueid']][_0x26a4('0x1c')],queues[_0x231076['uniqueid']]['queuecallerjoinAt']);queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x15')]=_0x231076[_0x26a4('0x15')];queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x39')]=_0x231076[_0x26a4('0x39')];queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x36')]=_0x231076[_0x26a4('0x36')];queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x37')]=_0x231076[_0x26a4('0x37')];}}catch(_0x5969e2){utils[_0x26a4('0x18')](util[_0x26a4('0x11')]('[%s][queues][queuecallerleave]',_0x231076[_0x26a4('0x3')]),_0x5969e2);}};exports[_0x26a4('0x3a')]=function(_0x5b111f){try{if(!_[_0x26a4('0x1a')](queues[_0x5b111f['uniqueid']])){utils[_0x26a4('0x10')](util[_0x26a4('0x11')](_0x26a4('0x3b'),_0x5b111f[_0x26a4('0x3')]),_0x5b111f);utils[_0x26a4('0x13')](util['format'](_0x26a4('0x3c'),_0x5b111f[_0x26a4('0x3')],queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x21')],_0x5b111f[_0x26a4('0x3d')],_0x5b111f[_0x26a4('0x3e')]));queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x29')]=null;queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x2a')]=![];queues[_0x5b111f['uniqueid']]['queuecallerexitreason']=null;queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x2b')]=null;queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x3f')]=!![];queues[_0x5b111f[_0x26a4('0x3')]]['accountcode']=_0x5b111f[_0x26a4('0x3e')];queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x6')]=_0x5b111f[_0x26a4('0x3d')];}}catch(_0x53dfb7){utils[_0x26a4('0x18')](util[_0x26a4('0x11')](_0x26a4('0x3b'),_0x5b111f['uniqueid']),_0x53dfb7);}};exports['agentcomplete']=function(_0x364f19){try{if(!_[_0x26a4('0x1a')](queues[_0x364f19['uniqueid']])){if(queues[_0x364f19[_0x26a4('0x3')]]['queuecallerleaveAt']){utils[_0x26a4('0x10')](util[_0x26a4('0x11')]('[%s][queues][agentcomplete]',_0x364f19[_0x26a4('0x3')]),_0x364f19);queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x29')]=null;queues[_0x364f19[_0x26a4('0x3')]]['queuecallerexit']=![];queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x2b')]=null;queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x3f')]=!![];queues[_0x364f19[_0x26a4('0x3')]]['lastAssignedTo']=_0x364f19['membername'];queues[_0x364f19[_0x26a4('0x3')]]['queuecallercomplete']=!![];queues[_0x364f19[_0x26a4('0x3')]]['queuecallercompleteAt']=utils[_0x26a4('0x17')]();if(_0x364f19['reason']==_0x26a4('0x40')){if(!queues[_0x364f19['uniqueid']]['transfer']){queues[_0x364f19['uniqueid']][_0x26a4('0x8')]='TRANSFER';}}else{queues[_0x364f19['uniqueid']][_0x26a4('0x8')]=_0x26a4('0x41')+_0x364f19[_0x26a4('0x42')][_0x26a4('0x28')]();}utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x43'),_0x364f19['uniqueid'],queues[_0x364f19['uniqueid']][_0x26a4('0x21')],_0x364f19[_0x26a4('0x3d')],queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x8')]));writeDB(queues[_0x364f19[_0x26a4('0x3')]]);}}}catch(_0x312830){utils[_0x26a4('0x18')](util[_0x26a4('0x11')](_0x26a4('0x44'),_0x364f19[_0x26a4('0x3')]),_0x312830);}};exports[_0x26a4('0x45')]=function(_0x4eeca8){try{if(!_[_0x26a4('0x1a')](queues[_0x4eeca8[_0x26a4('0x46')]])){utils['debug'](util[_0x26a4('0x11')](_0x26a4('0x47'),_0x4eeca8[_0x26a4('0x3')]),_0x4eeca8);queues[_0x4eeca8[_0x26a4('0x46')]][_0x26a4('0x40')]=!![];queues[_0x4eeca8[_0x26a4('0x46')]][_0x26a4('0x48')]=_0x26a4('0x49');queues[_0x4eeca8[_0x26a4('0x46')]][_0x26a4('0x4a')]=_0x4eeca8[_0x26a4('0x4b')];queues[_0x4eeca8[_0x26a4('0x46')]][_0x26a4('0x4c')]=_0x4eeca8[_0x26a4('0x46')];queues[_0x4eeca8[_0x26a4('0x46')]][_0x26a4('0x8')]=_0x26a4('0x4d');utils[_0x26a4('0x13')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x4eeca8[_0x26a4('0x3')],queues[_0x4eeca8['transfereeuniqueid']][_0x26a4('0x21')],_0x4eeca8[_0x26a4('0x46')],_0x4eeca8[_0x26a4('0x4b')]));}}catch(_0x4df4e6){utils['error'](util['format']('[%s][queues][blindtransfer]',_0x4eeca8['uniqueid']),_0x4df4e6);}};exports[_0x26a4('0x4e')]=function(_0x30a30b){try{utils[_0x26a4('0x10')](util[_0x26a4('0x11')]('[%s][queues][attendedtransfer]',_0x30a30b[_0x26a4('0x4f')]),_0x30a30b);if(_0x30a30b[_0x26a4('0x4f')]==_0x30a30b['origtransfererlinkedid']){if(!_[_0x26a4('0x1a')](queues[_0x30a30b['secondtransfererlinkedid']])){utils['info'](util[_0x26a4('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x30a30b[_0x26a4('0x4f')],queues[_0x30a30b[_0x26a4('0x50')]]['name'],_0x30a30b[_0x26a4('0x51')]));queues[_0x30a30b[_0x26a4('0x50')]]['transfer']=!![];queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0x48')]=_0x26a4('0x52');queues[_0x30a30b['secondtransfererlinkedid']][_0x26a4('0x4a')]=_0x30a30b['origtransfererexten'];queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0x4c')]=_0x30a30b[_0x26a4('0x4f')];queues[_0x30a30b['secondtransfererlinkedid']][_0x26a4('0x8')]=_0x26a4('0x53');}if(!_[_0x26a4('0x1a')](queues[_0x30a30b[_0x26a4('0x54')]])){if(_0x30a30b[_0x26a4('0x55')]&&queues[_0x30a30b[_0x26a4('0x55')]]){queues[_0x30a30b[_0x26a4('0x55')]]['queuecallerenterreason']=0x1;queues[_0x30a30b['transfereeuniqueid']]=_[_0x26a4('0x56')](queues[_0x30a30b[_0x26a4('0x55')]]);queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0xe')]=_0x30a30b['transfertargetuniqueid'];queues[_0x30a30b['transfereeuniqueid']][_0x26a4('0x23')]=0x2;queues[_0x30a30b[_0x26a4('0x46')]]['calleridnum']=queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0x57')];queues[_0x30a30b['transfereeuniqueid']][_0x26a4('0x58')]=queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0x58')];queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0x59')]=utils[_0x26a4('0x17')]();queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0x1c')]=utils[_0x26a4('0x17')]();queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0x38')]=0x0;queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0x5a')]=0x0;utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x5b'),_0x30a30b[_0x26a4('0x4f')],queues[_0x30a30b['transfereeuniqueid']][_0x26a4('0x21')],queues[_0x30a30b['transfereeuniqueid']][_0x26a4('0x57')],queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0x58')]));}else{utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x5c'),_0x30a30b[_0x26a4('0x4f')],queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x21')],_0x30a30b[_0x26a4('0x50')]));queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0xe')]=_0x30a30b[_0x26a4('0x50')];}}}else if(_0x30a30b[_0x26a4('0x5d')]==_0x30a30b['secondtransfererlinkedid']){if(!_[_0x26a4('0x1a')](queues[_0x30a30b['origtransfererlinkedid']])){utils[_0x26a4('0x13')](util[_0x26a4('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x30a30b['origtransfereruniqueid'],queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x21')],_0x30a30b[_0x26a4('0x5d')],_0x30a30b[_0x26a4('0x5e')]));queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x40')]=!![];queues[_0x30a30b[_0x26a4('0x54')]]['transfertype']=_0x26a4('0x52');queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x4a')]=_0x30a30b[_0x26a4('0x5e')];queues[_0x30a30b['origtransfererlinkedid']][_0x26a4('0x4c')]=_0x30a30b[_0x26a4('0x5d')];queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x8')]=_0x26a4('0x53');}if(!_[_0x26a4('0x1a')](queues[_0x30a30b[_0x26a4('0x50')]])){if(_0x30a30b[_0x26a4('0x5f')]&&queues[_0x30a30b[_0x26a4('0x5f')]]){queues[_0x30a30b[_0x26a4('0x5f')]][_0x26a4('0x23')]=0x1;queues[_0x30a30b[_0x26a4('0x60')]]=_[_0x26a4('0x56')](queues[_0x30a30b[_0x26a4('0x5f')]]);queues[_0x30a30b['transfertargetuniqueid']]['transfereduniqueid']=_0x30a30b[_0x26a4('0x60')];queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x23')]=0x2;queues[_0x30a30b[_0x26a4('0x60')]]['calleridnum']=queues[_0x30a30b[_0x26a4('0x54')]]['calleridnum'];queues[_0x30a30b['transfertargetuniqueid']]['calleridname']=queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x58')];queues[_0x30a30b['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0x26a4('0x17')]();queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x1c')]=utils['now']();queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x38')]=0x0;queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x5a')]=0x0;utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x61'),_0x30a30b[_0x26a4('0x4f')],queues[_0x30a30b['transfertargetuniqueid']][_0x26a4('0x21')],queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0xe')],queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x57')],queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x58')]));}else{utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x5c'),_0x30a30b[_0x26a4('0x4f')],queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0x21')],_0x30a30b[_0x26a4('0x54')]));queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0xe')]=_0x30a30b['origtransfererlinkedid'];}}}}catch(_0x12aea7){utils[_0x26a4('0x18')](util['format'](_0x26a4('0x62'),_0x30a30b[_0x26a4('0x4f')]),_0x12aea7);}};exports[_0x26a4('0x63')]=function(_0xbbf4b2){try{if(!_['isNil'](queues[_0xbbf4b2[_0x26a4('0x3')]])){utils['debug'](util[_0x26a4('0x11')](_0x26a4('0x64'),_0xbbf4b2[_0x26a4('0x3')]),_0xbbf4b2);queues[_0xbbf4b2['uniqueid']][_0x26a4('0x65')]=utils['now']();utils[_0x26a4('0x13')](util[_0x26a4('0x11')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0xbbf4b2[_0x26a4('0x3')],queues[_0xbbf4b2['uniqueid']][_0x26a4('0x21')],queues[_0xbbf4b2['uniqueid']]['musiconholdstartAt']));}}catch(_0x439347){utils[_0x26a4('0x18')](util[_0x26a4('0x11')](_0x26a4('0x64'),_0xbbf4b2[_0x26a4('0x3')]),_0x439347);}};exports[_0x26a4('0x66')]=function(_0x71d8d8){try{if(!_[_0x26a4('0x1a')](queues[_0x71d8d8['uniqueid']])){if(!_[_0x26a4('0x1a')](queues[_0x71d8d8[_0x26a4('0x3')]][_0x26a4('0x65')])){utils['debug'](util[_0x26a4('0x11')](_0x26a4('0x67'),_0x71d8d8[_0x26a4('0x3')]),_0x71d8d8);queues[_0x71d8d8[_0x26a4('0x3')]][_0x26a4('0x5a')]+=utils['diffTime'](utils['now'](),queues[_0x71d8d8[_0x26a4('0x3')]][_0x26a4('0x65')]);utils[_0x26a4('0x13')](util[_0x26a4('0x11')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x71d8d8[_0x26a4('0x3')],queues[_0x71d8d8[_0x26a4('0x3')]]['name'],queues[_0x71d8d8['uniqueid']][_0x26a4('0x5a')]));delete queues[_0x71d8d8[_0x26a4('0x3')]]['musiconholdstartAt'];}}}catch(_0x584ea7){utils[_0x26a4('0x18')](util['format'](_0x26a4('0x67'),_0x71d8d8[_0x26a4('0x3')]),_0x584ea7);}}; \ No newline at end of file +var _0x7f51=['extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten'];(function(_0x3116d6,_0x2d574f){var _0x18729d=function(_0x1945a0){while(--_0x1945a0){_0x3116d6['push'](_0x3116d6['shift']());}};_0x18729d(++_0x2d574f);}(_0x7f51,0x155));var _0x17f5=function(_0x2d025a,_0x2de4e3){_0x2d025a=_0x2d025a-0x0;var _0x47e307=_0x7f51[_0x2d025a];return _0x47e307;};'use strict';var _=require('lodash');var util=require(_0x17f5('0x0'));var utils=require(_0x17f5('0x1'));var queues={};function writeDB(_0x479809){utils['info'](util[_0x17f5('0x2')](_0x17f5('0x3'),_0x479809[_0x17f5('0x4')],_0x479809[_0x17f5('0x5')],_0x479809[_0x17f5('0x6')],_0x479809[_0x17f5('0x7')],_0x479809[_0x17f5('0x8')],_0x479809['accountcode'],_0x479809[_0x17f5('0x9')]));if(_0x479809['queue']){utils[_0x17f5('0xa')](_0x479809[_0x17f5('0x6')])['then'](function(_0x3185e0){if(_0x3185e0){_0x479809[_0x17f5('0xb')]=_0x3185e0[_0x17f5('0xb')];}utils[_0x17f5('0xc')](_0x17f5('0xd'),_0x479809);});}else{utils[_0x17f5('0xc')](_0x17f5('0xd'),_0x479809);}if(_0x479809[_0x17f5('0xe')]){delete queues[_0x479809[_0x17f5('0xe')]];}else{delete queues[_0x479809[_0x17f5('0x4')]];}}exports[_0x17f5('0xf')]=function(_0x3207c6){try{utils[_0x17f5('0x10')](util[_0x17f5('0x2')](_0x17f5('0x11'),_0x3207c6[_0x17f5('0x4')]),_0x3207c6);utils[_0x17f5('0x12')](util['format'](_0x17f5('0x13'),_0x3207c6[_0x17f5('0x4')],_0x3207c6[_0x17f5('0x6')],_0x3207c6[_0x17f5('0x14')]));queues[_0x3207c6[_0x17f5('0x4')]]=_[_0x17f5('0x15')](_0x3207c6,{'originalposition':_0x3207c6[_0x17f5('0x14')],'queuecallerjoinAt':utils[_0x17f5('0x16')](),'mohtime':0x0});}catch(_0x13f1f3){utils[_0x17f5('0x17')](util[_0x17f5('0x2')]('[%s][queues][queuecallerjoin]',_0x3207c6[_0x17f5('0x4')]),_0x13f1f3);}};exports[_0x17f5('0x18')]=function(_0x4b7611){try{if(!_[_0x17f5('0x19')](queues[_0x4b7611[_0x17f5('0x4')]])){utils[_0x17f5('0x10')](util[_0x17f5('0x2')](_0x17f5('0x1a'),_0x4b7611['uniqueid']),_0x4b7611);if(queues[_0x4b7611[_0x17f5('0x4')]][_0x17f5('0x1b')]){if(!queues[_0x4b7611[_0x17f5('0x4')]]['queuecallerabandon']&&!queues[_0x4b7611['uniqueid']]['queuecallerexit']){queues[_0x4b7611[_0x17f5('0x4')]]['queuecallercomplete']=!![];queues[_0x4b7611[_0x17f5('0x4')]][_0x17f5('0x1c')]=utils['now']();queues[_0x4b7611[_0x17f5('0x4')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x1d'),_0x4b7611[_0x17f5('0x4')],queues[_0x4b7611[_0x17f5('0x4')]][_0x17f5('0x1e')],queues[_0x4b7611['uniqueid']][_0x17f5('0x9')]));writeDB(queues[_0x4b7611['uniqueid']]);}else if(queues[_0x4b7611[_0x17f5('0x4')]]['transfereduniqueid']){utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x1f'),_0x4b7611[_0x17f5('0x4')],queues[_0x4b7611['uniqueid']]['name'],queues[_0x4b7611[_0x17f5('0x4')]][_0x17f5('0xe')]));queues[queues[_0x4b7611['uniqueid']][_0x17f5('0xe')]]=queues[_0x4b7611[_0x17f5('0x4')]];queues[queues[_0x4b7611['uniqueid']]['transfereduniqueid']][_0x17f5('0x20')]=0x2;delete queues[_0x4b7611[_0x17f5('0x4')]];}}}catch(_0xf7ff3f){utils[_0x17f5('0x17')](util[_0x17f5('0x2')]('[%s][queues][hangup]',_0x4b7611['uniqueid']),_0xf7ff3f);}};exports[_0x17f5('0x21')]=function(_0xca74cd){try{utils['debug'](util['format']('[%s][queues][varset]',_0xca74cd[_0x17f5('0x4')]),_0xca74cd);if(!_[_0x17f5('0x19')](_0xca74cd[_0x17f5('0x22')][_0x17f5('0x23')])&&_0xca74cd[_0x17f5('0x24')][_0x17f5('0x25')]()!=='CONTINUE'){if(!_['isNil'](queues[_0xca74cd[_0x17f5('0x4')]])){queues[_0xca74cd['uniqueid']][_0x17f5('0x26')]=![];queues[_0xca74cd['uniqueid']][_0x17f5('0x27')]=null;queues[_0xca74cd['uniqueid']][_0x17f5('0x28')]=!![];queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x29')]=utils[_0x17f5('0x16')]();queues[_0xca74cd['uniqueid']]['queuecallerexitreason']=_0xca74cd[_0x17f5('0x24')]['toUpperCase']();utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x2a'),_0xca74cd[_0x17f5('0x4')],queues[_0xca74cd['uniqueid']][_0x17f5('0x1e')],_0xca74cd[_0x17f5('0x24')],queues[_0xca74cd['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0xca74cd['uniqueid']]);}}else if(!_[_0x17f5('0x19')](_0xca74cd[_0x17f5('0x22')][_0x17f5('0x2b')])){if(!_['isNil'](queues[_0xca74cd['uniqueid']])&&!queues[_0xca74cd[_0x17f5('0x4')]]['queuecallerabandon']){queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x26')]=![];queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x27')]=null;queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x28')]=!![];queues[_0xca74cd[_0x17f5('0x4')]]['queuecallerexitAt']=utils[_0x17f5('0x16')]();queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x9')]=_0x17f5('0x2c');utils[_0x17f5('0x12')](util['format'](_0x17f5('0x2d'),_0xca74cd[_0x17f5('0x4')],queues[_0xca74cd['uniqueid']][_0x17f5('0x1e')],_0xca74cd[_0x17f5('0x24')],queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x9')]));}}}catch(_0x207009){utils[_0x17f5('0x17')](util[_0x17f5('0x2')](_0x17f5('0x2e'),_0xca74cd[_0x17f5('0x4')]),_0x207009);}};exports['queuecallerabandon']=function(_0x12bbd6){try{if(!_[_0x17f5('0x19')](queues[_0x12bbd6['uniqueid']])){utils['debug'](util['format'](_0x17f5('0x2f'),_0x12bbd6[_0x17f5('0x4')]),_0x12bbd6);queues[_0x12bbd6[_0x17f5('0x4')]][_0x17f5('0x28')]=![];queues[_0x12bbd6[_0x17f5('0x4')]][_0x17f5('0x29')]=null;queues[_0x12bbd6['uniqueid']][_0x17f5('0x26')]=!![];queues[_0x12bbd6[_0x17f5('0x4')]]['queuecallerabandonAt']=utils[_0x17f5('0x16')]();queues[_0x12bbd6[_0x17f5('0x4')]][_0x17f5('0x9')]='ABANDONED';utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x30'),_0x12bbd6['uniqueid'],queues[_0x12bbd6[_0x17f5('0x4')]][_0x17f5('0x1e')],queues[_0x12bbd6[_0x17f5('0x4')]][_0x17f5('0x9')]));}}catch(_0x43f1fe){utils[_0x17f5('0x17')](util[_0x17f5('0x2')](_0x17f5('0x2f'),_0x12bbd6[_0x17f5('0x4')]),_0x43f1fe);}};exports[_0x17f5('0x31')]=function(_0x428a34){try{if(!_[_0x17f5('0x19')](queues[_0x428a34['uniqueid']])){utils[_0x17f5('0x10')](util[_0x17f5('0x2')]('[%s][queues][queuecallerleave]',_0x428a34[_0x17f5('0x4')]),_0x428a34);utils['info'](util[_0x17f5('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x428a34[_0x17f5('0x4')],queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x1e')],_0x428a34[_0x17f5('0x32')],_0x428a34[_0x17f5('0x33')]));queues[_0x428a34[_0x17f5('0x4')]]['queuecallerleave']=!![];queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x1b')]=utils[_0x17f5('0x16')]();queues[_0x428a34[_0x17f5('0x4')]]['holdtime']=utils[_0x17f5('0x34')](queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x1b')],queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x35')]);queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x14')]=_0x428a34[_0x17f5('0x14')];queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x36')]=_0x428a34[_0x17f5('0x36')];queues[_0x428a34[_0x17f5('0x4')]]['connectedlinenum']=_0x428a34[_0x17f5('0x32')];queues[_0x428a34[_0x17f5('0x4')]]['connectedlinename']=_0x428a34[_0x17f5('0x33')];}}catch(_0xe0cc33){utils['error'](util[_0x17f5('0x2')](_0x17f5('0x37'),_0x428a34[_0x17f5('0x4')]),_0xe0cc33);}};exports['agentconnect']=function(_0x1d1f7f){try{if(!_[_0x17f5('0x19')](queues[_0x1d1f7f[_0x17f5('0x4')]])){utils[_0x17f5('0x10')](util[_0x17f5('0x2')]('[%s][queues][agentconnect]',_0x1d1f7f[_0x17f5('0x4')]),_0x1d1f7f);utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x38'),_0x1d1f7f['uniqueid'],queues[_0x1d1f7f['uniqueid']][_0x17f5('0x1e')],_0x1d1f7f[_0x17f5('0x39')],_0x1d1f7f[_0x17f5('0x3a')]));queues[_0x1d1f7f[_0x17f5('0x4')]]['queuecallerabandon']=![];queues[_0x1d1f7f[_0x17f5('0x4')]][_0x17f5('0x26')]=![];queues[_0x1d1f7f[_0x17f5('0x4')]][_0x17f5('0x27')]=null;queues[_0x1d1f7f[_0x17f5('0x4')]][_0x17f5('0x28')]=![];queues[_0x1d1f7f[_0x17f5('0x4')]]['queuecallerexitreason']=null;queues[_0x1d1f7f[_0x17f5('0x4')]]['queuecallerexitAt']=null;queues[_0x1d1f7f['uniqueid']][_0x17f5('0x3b')]=!![];queues[_0x1d1f7f[_0x17f5('0x4')]]['accountcode']=_0x1d1f7f['destaccountcode'];queues[_0x1d1f7f[_0x17f5('0x4')]][_0x17f5('0x7')]=_0x1d1f7f['membername'];}}catch(_0x95869a){utils['error'](util[_0x17f5('0x2')](_0x17f5('0x3c'),_0x1d1f7f[_0x17f5('0x4')]),_0x95869a);}};exports[_0x17f5('0x3d')]=function(_0x10392b){try{if(!_['isNil'](queues[_0x10392b['uniqueid']])){if(queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x1b')]){utils['debug'](util[_0x17f5('0x2')](_0x17f5('0x3e'),_0x10392b[_0x17f5('0x4')]),_0x10392b);queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x26')]=![];queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x26')]=![];queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x27')]=null;queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x28')]=![];queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x29')]=null;queues[_0x10392b[_0x17f5('0x4')]]['assigned']=!![];queues[_0x10392b['uniqueid']][_0x17f5('0x7')]=_0x10392b['membername'];queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x3f')]=!![];queues[_0x10392b['uniqueid']][_0x17f5('0x1c')]=utils['now']();if(_0x10392b[_0x17f5('0x40')]==_0x17f5('0x41')){if(!queues[_0x10392b[_0x17f5('0x4')]]['transfer']){queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x9')]=_0x17f5('0x42');}}else{queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x9')]=_0x17f5('0x43')+_0x10392b[_0x17f5('0x40')]['toUpperCase']();}utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x44'),_0x10392b['uniqueid'],queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x1e')],_0x10392b[_0x17f5('0x39')],queues[_0x10392b[_0x17f5('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x10392b['uniqueid']]);}}}catch(_0x236058){utils[_0x17f5('0x17')](util[_0x17f5('0x2')](_0x17f5('0x3e'),_0x10392b['uniqueid']),_0x236058);}};exports[_0x17f5('0x45')]=function(_0x1550c9){try{if(!_[_0x17f5('0x19')](queues[_0x1550c9[_0x17f5('0x46')]])){utils['debug'](util['format'](_0x17f5('0x47'),_0x1550c9['uniqueid']),_0x1550c9);queues[_0x1550c9[_0x17f5('0x46')]][_0x17f5('0x41')]=!![];queues[_0x1550c9['transfereeuniqueid']][_0x17f5('0x48')]=_0x17f5('0x49');queues[_0x1550c9[_0x17f5('0x46')]][_0x17f5('0x4a')]=_0x1550c9[_0x17f5('0x4b')];queues[_0x1550c9['transfereeuniqueid']][_0x17f5('0x4c')]=_0x1550c9[_0x17f5('0x46')];queues[_0x1550c9[_0x17f5('0x46')]][_0x17f5('0x9')]='BLINDTRANSFER';utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x4d'),_0x1550c9[_0x17f5('0x4')],queues[_0x1550c9[_0x17f5('0x46')]]['name'],_0x1550c9[_0x17f5('0x46')],_0x1550c9[_0x17f5('0x4b')]));}}catch(_0x3352d5){utils[_0x17f5('0x17')](util['format'](_0x17f5('0x47'),_0x1550c9['uniqueid']),_0x3352d5);}};exports[_0x17f5('0x4e')]=function(_0x463050){try{utils['debug'](util[_0x17f5('0x2')]('[%s][queues][attendedtransfer]',_0x463050[_0x17f5('0x4f')]),_0x463050);if(_0x463050[_0x17f5('0x4f')]==_0x463050[_0x17f5('0x50')]){if(!_[_0x17f5('0x19')](queues[_0x463050[_0x17f5('0x51')]])){utils[_0x17f5('0x12')](util[_0x17f5('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x463050[_0x17f5('0x4f')],queues[_0x463050[_0x17f5('0x51')]]['name'],_0x463050['origtransfererexten']));queues[_0x463050[_0x17f5('0x51')]][_0x17f5('0x41')]=!![];queues[_0x463050[_0x17f5('0x51')]][_0x17f5('0x48')]=_0x17f5('0x52');queues[_0x463050['secondtransfererlinkedid']][_0x17f5('0x4a')]=_0x463050['origtransfererexten'];queues[_0x463050[_0x17f5('0x51')]][_0x17f5('0x4c')]=_0x463050[_0x17f5('0x4f')];queues[_0x463050['secondtransfererlinkedid']][_0x17f5('0x9')]=_0x17f5('0x53');}if(!_[_0x17f5('0x19')](queues[_0x463050[_0x17f5('0x50')]])){if(_0x463050[_0x17f5('0x54')]&&queues[_0x463050[_0x17f5('0x54')]]){queues[_0x463050[_0x17f5('0x54')]][_0x17f5('0x20')]=0x1;queues[_0x463050['transfereeuniqueid']]=_[_0x17f5('0x55')](queues[_0x463050[_0x17f5('0x54')]]);queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0xe')]=_0x463050[_0x17f5('0x56')];queues[_0x463050['transfereeuniqueid']][_0x17f5('0x20')]=0x2;queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0x8')]=queues[_0x463050[_0x17f5('0x51')]]['calleridnum'];queues[_0x463050['transfereeuniqueid']][_0x17f5('0x57')]=queues[_0x463050[_0x17f5('0x51')]]['calleridname'];queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0x35')]=utils[_0x17f5('0x16')]();queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0x1b')]=utils['now']();queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0x58')]=0x0;queues[_0x463050['transfereeuniqueid']][_0x17f5('0x59')]=0x0;utils[_0x17f5('0x12')](util['format'](_0x17f5('0x5a'),_0x463050[_0x17f5('0x4f')],queues[_0x463050['transfereeuniqueid']][_0x17f5('0x1e')],queues[_0x463050['transfereeuniqueid']][_0x17f5('0x8')],queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0x57')]));}else{utils['info'](util[_0x17f5('0x2')](_0x17f5('0x5b'),_0x463050[_0x17f5('0x4f')],queues[_0x463050[_0x17f5('0x50')]][_0x17f5('0x1e')],_0x463050[_0x17f5('0x51')]));queues[_0x463050[_0x17f5('0x50')]][_0x17f5('0xe')]=_0x463050[_0x17f5('0x51')];}}}else if(_0x463050[_0x17f5('0x5c')]==_0x463050[_0x17f5('0x51')]){if(!_[_0x17f5('0x19')](queues[_0x463050[_0x17f5('0x50')]])){utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x5d'),_0x463050[_0x17f5('0x4f')],queues[_0x463050['origtransfererlinkedid']][_0x17f5('0x1e')],_0x463050[_0x17f5('0x5c')],_0x463050[_0x17f5('0x5e')]));queues[_0x463050['origtransfererlinkedid']][_0x17f5('0x41')]=!![];queues[_0x463050['origtransfererlinkedid']][_0x17f5('0x48')]=_0x17f5('0x52');queues[_0x463050[_0x17f5('0x50')]][_0x17f5('0x4a')]=_0x463050['secondtransfererexten'];queues[_0x463050['origtransfererlinkedid']][_0x17f5('0x4c')]=_0x463050[_0x17f5('0x5c')];queues[_0x463050[_0x17f5('0x50')]][_0x17f5('0x9')]=_0x17f5('0x53');}if(!_['isNil'](queues[_0x463050[_0x17f5('0x51')]])){if(_0x463050['transfertargetlinkedid']&&queues[_0x463050[_0x17f5('0x5f')]]){queues[_0x463050[_0x17f5('0x5f')]][_0x17f5('0x20')]=0x1;queues[_0x463050['transfertargetuniqueid']]=_[_0x17f5('0x55')](queues[_0x463050[_0x17f5('0x5f')]]);queues[_0x463050['transfertargetuniqueid']][_0x17f5('0xe')]=_0x463050['transfertargetuniqueid'];queues[_0x463050['transfertargetuniqueid']][_0x17f5('0x20')]=0x2;queues[_0x463050[_0x17f5('0x56')]][_0x17f5('0x8')]=queues[_0x463050[_0x17f5('0x50')]][_0x17f5('0x8')];queues[_0x463050['transfertargetuniqueid']][_0x17f5('0x57')]=queues[_0x463050[_0x17f5('0x50')]]['calleridname'];queues[_0x463050['transfertargetuniqueid']][_0x17f5('0x35')]=utils[_0x17f5('0x16')]();queues[_0x463050[_0x17f5('0x56')]]['queuecallerleaveAt']=utils[_0x17f5('0x16')]();queues[_0x463050[_0x17f5('0x56')]][_0x17f5('0x58')]=0x0;queues[_0x463050['transfertargetuniqueid']]['mohtime']=0x0;utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x60'),_0x463050[_0x17f5('0x4f')],queues[_0x463050['transfertargetuniqueid']][_0x17f5('0x1e')],queues[_0x463050[_0x17f5('0x56')]]['transfereduniqueid'],queues[_0x463050[_0x17f5('0x56')]]['calleridnum'],queues[_0x463050['transfertargetuniqueid']][_0x17f5('0x57')]));}else{utils[_0x17f5('0x12')](util[_0x17f5('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x463050[_0x17f5('0x4f')],queues[_0x463050[_0x17f5('0x51')]][_0x17f5('0x1e')],_0x463050['origtransfererlinkedid']));queues[_0x463050[_0x17f5('0x51')]][_0x17f5('0xe')]=_0x463050[_0x17f5('0x50')];}}}}catch(_0x2be485){utils['error'](util['format'](_0x17f5('0x61'),_0x463050[_0x17f5('0x4f')]),_0x2be485);}};exports[_0x17f5('0x62')]=function(_0x344d92){try{if(!_[_0x17f5('0x19')](queues[_0x344d92['uniqueid']])){utils[_0x17f5('0x10')](util[_0x17f5('0x2')](_0x17f5('0x63'),_0x344d92['uniqueid']),_0x344d92);queues[_0x344d92[_0x17f5('0x4')]][_0x17f5('0x64')]=utils['now']();utils['info'](util['format'](_0x17f5('0x65'),_0x344d92[_0x17f5('0x4')],queues[_0x344d92[_0x17f5('0x4')]][_0x17f5('0x1e')],queues[_0x344d92['uniqueid']][_0x17f5('0x64')]));}}catch(_0x2d5202){utils['error'](util[_0x17f5('0x2')](_0x17f5('0x63'),_0x344d92[_0x17f5('0x4')]),_0x2d5202);}};exports[_0x17f5('0x66')]=function(_0x464f3a){try{if(!_[_0x17f5('0x19')](queues[_0x464f3a[_0x17f5('0x4')]])){if(!_[_0x17f5('0x19')](queues[_0x464f3a[_0x17f5('0x4')]][_0x17f5('0x64')])){utils[_0x17f5('0x10')](util['format']('[%s][queues][musiconholdstop]',_0x464f3a[_0x17f5('0x4')]),_0x464f3a);queues[_0x464f3a['uniqueid']]['mohtime']+=utils[_0x17f5('0x34')](utils[_0x17f5('0x16')](),queues[_0x464f3a[_0x17f5('0x4')]][_0x17f5('0x64')]);utils[_0x17f5('0x12')](util[_0x17f5('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x464f3a[_0x17f5('0x4')],queues[_0x464f3a[_0x17f5('0x4')]]['name'],queues[_0x464f3a[_0x17f5('0x4')]][_0x17f5('0x59')]));delete queues[_0x464f3a[_0x17f5('0x4')]][_0x17f5('0x64')];}}}catch(_0x4134a5){utils[_0x17f5('0x17')](util['format'](_0x17f5('0x67'),_0x464f3a['uniqueid']),_0x4134a5);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 95a98fe..5b881d0 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 _0xbb25=['set','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','name','UserId','CreateVoiceRecording','request','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','isNil','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','endsWith','value','replace','.WAV','find','monitors','push','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbb25,0x13f));var _0x5bb2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbb25[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5bb2('0x0'));var util=require('util');var utils=require(_0x5bb2('0x1'));var recordings={};function writeDB(_0x206821){utils[_0x5bb2('0x2')](util[_0x5bb2('0x3')](_0x5bb2('0x4'),_0x206821[_0x5bb2('0x5')]));if(_0x206821['accountcode']){utils[_0x5bb2('0x6')](_0x206821[_0x5bb2('0x7')])[_0x5bb2('0x8')](function(_0x179d62){if(_0x179d62){_0x206821['membername']=_0x179d62[_0x5bb2('0x9')];_0x206821[_0x5bb2('0xa')]=_0x179d62['id'];}utils['request'](_0x5bb2('0xb'),_0x206821);});}else{utils[_0x5bb2('0xc')](_0x5bb2('0xb'),_0x206821);}}exports[_0x5bb2('0xd')]=function(_0x532085){try{utils[_0x5bb2('0xe')](util['format']('[%s][recordings][newchannel]',_0x532085[_0x5bb2('0x5')]),_0x532085);if(_0x532085[_0x5bb2('0x5')]==_0x532085[_0x5bb2('0xf')]){utils[_0x5bb2('0x2')](util[_0x5bb2('0x3')](_0x5bb2('0x10'),_0x532085[_0x5bb2('0x5')],_0x532085[_0x5bb2('0x11')],_0x532085[_0x5bb2('0x12')]));recordings[_0x532085[_0x5bb2('0x5')]]={'uniqueid':_0x532085[_0x5bb2('0x5')],'accountcode':_0x532085[_0x5bb2('0x7')],'exten':_0x532085[_0x5bb2('0x12')],'context':_0x532085[_0x5bb2('0x11')],'channel':_0x532085[_0x5bb2('0x13')],'monitors':[]};}}catch(_0x5d51eb){utils['error'](util[_0x5bb2('0x3')](_0x5bb2('0x14'),_0x532085['uniqueid']),_0x5d51eb);}};exports[_0x5bb2('0x15')]=function(_0x5a9feb){try{utils['debug'](util['format'](_0x5bb2('0x16'),_0x5a9feb['uniqueid']),_0x5a9feb);if(!_['isNil'](recordings[_0x5a9feb[_0x5bb2('0x5')]])&&_0x5a9feb['channelstate']==0x6){utils[_0x5bb2('0x2')](util[_0x5bb2('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x5a9feb[_0x5bb2('0x5')],_0x5a9feb[_0x5bb2('0x11')],_0x5a9feb[_0x5bb2('0x13')]));}else if(!_['isNil'](recordings[_0x5a9feb[_0x5bb2('0xf')]])&&_0x5a9feb['channelstate']==0x6&&_0x5a9feb[_0x5bb2('0x11')]!='transfer'){utils[_0x5bb2('0x2')](util['format'](_0x5bb2('0x17'),_0x5a9feb['uniqueid'],_0x5a9feb[_0x5bb2('0xf')],_0x5a9feb[_0x5bb2('0x11')],_0x5a9feb[_0x5bb2('0x13')]));recordings[_0x5a9feb[_0x5bb2('0xf')]]['accountcode']=_0x5a9feb[_0x5bb2('0x7')];}}catch(_0x56e74b){utils[_0x5bb2('0x18')](util['format']('[%s][recordings][newstate]',_0x5a9feb['uniqueid']),_0x56e74b);}};exports[_0x5bb2('0x19')]=function(_0x40dd55){try{if(!_['isNil'](_0x40dd55['variable'])&&!_[_0x5bb2('0x1a')](_0x40dd55['variable'][_0x5bb2('0x1b')])){utils[_0x5bb2('0xe')](util[_0x5bb2('0x3')](_0x5bb2('0x1c'),_0x40dd55['uniqueid']),_0x40dd55);utils['info'](util['format'](_0x5bb2('0x1d'),_0x40dd55[_0x5bb2('0x5')],_0x40dd55[_0x5bb2('0x1e')],_0x40dd55['value']));if(_[_0x5bb2('0x1f')](_0x40dd55[_0x5bb2('0x20')],'.wav49')){_0x40dd55[_0x5bb2('0x20')]=_0x40dd55[_0x5bb2('0x20')][_0x5bb2('0x21')]('.wav49',_0x5bb2('0x22'));}if(recordings[_0x40dd55[_0x5bb2('0xf')]]){var _0x14b01a=_[_0x5bb2('0x23')](recordings[_0x40dd55[_0x5bb2('0xf')]][_0x5bb2('0x24')],{'value':_0x40dd55[_0x5bb2('0x20')]});if(_[_0x5bb2('0x1a')](_0x14b01a)){recordings[_0x40dd55[_0x5bb2('0xf')]][_0x5bb2('0x24')][_0x5bb2('0x25')]({'value':_0x40dd55[_0x5bb2('0x20')]});}}}}catch(_0x50dd5a){utils[_0x5bb2('0x18')](util[_0x5bb2('0x3')]('[%s][recordings][varset]',_0x40dd55[_0x5bb2('0x5')]),_0x50dd5a);}};exports['hangup']=function(_0x3230ce){try{if(!_[_0x5bb2('0x1a')](recordings[_0x3230ce['uniqueid']])){utils['debug'](util[_0x5bb2('0x3')]('[%s][recordings][hangup]',_0x3230ce[_0x5bb2('0x5')]),_0x3230ce);utils[_0x5bb2('0x2')](util[_0x5bb2('0x3')](_0x5bb2('0x26'),_0x3230ce[_0x5bb2('0x5')],_0x3230ce['calleridnum'],_0x3230ce[_0x5bb2('0x27')],_0x3230ce['cause-txt']));recordings[_0x3230ce['uniqueid']][_0x5bb2('0x28')]=_0x3230ce[_0x5bb2('0x28')];recordings[_0x3230ce[_0x5bb2('0x5')]][_0x5bb2('0x27')]=_0x3230ce[_0x5bb2('0x27')];recordings[_0x3230ce[_0x5bb2('0x5')]]['connectedlinenum']=_0x3230ce[_0x5bb2('0x29')];recordings[_0x3230ce[_0x5bb2('0x5')]]['connectedlinename']=_0x3230ce[_0x5bb2('0x2a')];if(recordings[_0x3230ce['uniqueid']][_0x5bb2('0x2b')]==_0x5bb2('0x2c')&&recordings[_0x3230ce['uniqueid']][_0x5bb2('0x7')]){recordings[_0x3230ce[_0x5bb2('0x5')]][_0x5bb2('0x29')]=recordings[_0x3230ce[_0x5bb2('0x5')]]['accountcode'];recordings[_0x3230ce[_0x5bb2('0x5')]][_0x5bb2('0x2a')]='';}recordings[_0x3230ce[_0x5bb2('0x5')]][_0x5bb2('0x24')][_0x5bb2('0x2d')](function(_0x10aa4a){var _0x48ae3b=_[_0x5bb2('0x2e')](recordings[_0x3230ce['uniqueid']]);_0x48ae3b[_0x5bb2('0x20')]=_0x10aa4a['value'];writeDB(_0x48ae3b);});delete recordings[_0x3230ce['uniqueid']];}}catch(_0x57e2eb){utils[_0x5bb2('0x18')](util[_0x5bb2('0x3')](_0x5bb2('0x2f'),_0x3230ce['uniqueid']),_0x57e2eb);}};exports[_0x5bb2('0x30')]=function(_0x21d821){try{if(!_['isNil'](recordings[_0x21d821[_0x5bb2('0x5')]])){utils[_0x5bb2('0xe')](util[_0x5bb2('0x3')](_0x5bb2('0x31'),_0x21d821[_0x5bb2('0x5')]),_0x21d821);utils['info'](util[_0x5bb2('0x3')](_0x5bb2('0x32'),_0x21d821[_0x5bb2('0x5')],_0x21d821[_0x5bb2('0x33')],_0x21d821[_0x5bb2('0x34')]));if(_0x21d821['application']['toLowerCase']()==_0x5bb2('0x35')&&_[_0x5bb2('0x36')](_0x21d821[_0x5bb2('0x34')]['toLowerCase'](),'cdr')){var _0x577c8f=_0x21d821[_0x5bb2('0x34')][_0x5bb2('0x37')]('=');var _0x50e220=_0x577c8f[0x0][_0x5bb2('0x38')](_0x577c8f[0x0][_0x5bb2('0x39')]('(')+0x1,_0x577c8f[0x0][_0x5bb2('0x39')](')'));var _0x241aec=_0x577c8f[0x1];recordings[_0x21d821['uniqueid']][_0x50e220]=_0x241aec;}}}catch(_0x8d950d){utils[_0x5bb2('0x18')](util['format'](_0x5bb2('0x31'),_0x21d821[_0x5bb2('0x5')]),_0x8d950d);}};exports[_0x5bb2('0x3a')]=function(_0x5d68b4){try{if(!_[_0x5bb2('0x1a')](recordings[_0x5d68b4[_0x5bb2('0x5')]])){utils[_0x5bb2('0xe')](util[_0x5bb2('0x3')](_0x5bb2('0x3b'),_0x5d68b4[_0x5bb2('0x5')]),_0x5d68b4);utils[_0x5bb2('0x2')](util[_0x5bb2('0x3')](_0x5bb2('0x3c'),_0x5d68b4['uniqueid'],_0x5d68b4[_0x5bb2('0x3d')]));recordings[_0x5d68b4[_0x5bb2('0x5')]][_0x5bb2('0x3d')]=_0x5d68b4['queue'];}}catch(_0x46be80){utils['error'](util[_0x5bb2('0x3')](_0x5bb2('0x3b'),_0x5d68b4[_0x5bb2('0x5')]),_0x46be80);}}; \ No newline at end of file +var _0x6abc=['debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','find','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','monitors','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','uniqueid','accountcode','then','membername','name','request','CreateVoiceRecording'];(function(_0x1433b2,_0x2a23de){var _0x253c75=function(_0x59df3b){while(--_0x59df3b){_0x1433b2['push'](_0x1433b2['shift']());}};_0x253c75(++_0x2a23de);}(_0x6abc,0x1b5));var _0xc6ab=function(_0x3f1438,_0x2fb615){_0x3f1438=_0x3f1438-0x0;var _0x2d209f=_0x6abc[_0x3f1438];return _0x2d209f;};'use strict';var _=require(_0xc6ab('0x0'));var util=require(_0xc6ab('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x182a46){utils[_0xc6ab('0x2')](util[_0xc6ab('0x3')]('[%s][recordings][writeDB]',_0x182a46[_0xc6ab('0x4')]));if(_0x182a46['accountcode']){utils['getUserByInternal'](_0x182a46[_0xc6ab('0x5')])[_0xc6ab('0x6')](function(_0x227163){if(_0x227163){_0x182a46[_0xc6ab('0x7')]=_0x227163[_0xc6ab('0x8')];_0x182a46['UserId']=_0x227163['id'];}utils[_0xc6ab('0x9')](_0xc6ab('0xa'),_0x182a46);});}else{utils['request']('CreateVoiceRecording',_0x182a46);}}exports['newchannel']=function(_0xbb9d47){try{utils[_0xc6ab('0xb')](util[_0xc6ab('0x3')](_0xc6ab('0xc'),_0xbb9d47['uniqueid']),_0xbb9d47);if(_0xbb9d47['uniqueid']==_0xbb9d47[_0xc6ab('0xd')]){utils['info'](util[_0xc6ab('0x3')](_0xc6ab('0xe'),_0xbb9d47['uniqueid'],_0xbb9d47[_0xc6ab('0xf')],_0xbb9d47[_0xc6ab('0x10')]));recordings[_0xbb9d47[_0xc6ab('0x4')]]={'uniqueid':_0xbb9d47[_0xc6ab('0x4')],'accountcode':_0xbb9d47['accountcode'],'exten':_0xbb9d47[_0xc6ab('0x10')],'context':_0xbb9d47[_0xc6ab('0xf')],'channel':_0xbb9d47[_0xc6ab('0x11')],'monitors':[]};}}catch(_0x3df627){utils[_0xc6ab('0x12')](util['format'](_0xc6ab('0xc'),_0xbb9d47[_0xc6ab('0x4')]),_0x3df627);}};exports[_0xc6ab('0x13')]=function(_0x26dfaa){try{utils[_0xc6ab('0xb')](util[_0xc6ab('0x3')](_0xc6ab('0x14'),_0x26dfaa['uniqueid']),_0x26dfaa);if(!_['isNil'](recordings[_0x26dfaa['uniqueid']])&&_0x26dfaa[_0xc6ab('0x15')]==0x6){utils[_0xc6ab('0x2')](util[_0xc6ab('0x3')](_0xc6ab('0x16'),_0x26dfaa[_0xc6ab('0x4')],_0x26dfaa[_0xc6ab('0xf')],_0x26dfaa['channel']));}else if(!_[_0xc6ab('0x17')](recordings[_0x26dfaa['linkedid']])&&_0x26dfaa[_0xc6ab('0x15')]==0x6&&_0x26dfaa[_0xc6ab('0xf')]!=_0xc6ab('0x18')){utils['info'](util[_0xc6ab('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x26dfaa[_0xc6ab('0x4')],_0x26dfaa[_0xc6ab('0xd')],_0x26dfaa[_0xc6ab('0xf')],_0x26dfaa[_0xc6ab('0x11')]));recordings[_0x26dfaa['linkedid']]['accountcode']=_0x26dfaa[_0xc6ab('0x5')];}}catch(_0xda43db){utils[_0xc6ab('0x12')](util[_0xc6ab('0x3')]('[%s][recordings][newstate]',_0x26dfaa[_0xc6ab('0x4')]),_0xda43db);}};exports[_0xc6ab('0x19')]=function(_0x19a140){try{if(!_['isNil'](_0x19a140[_0xc6ab('0x1a')])&&!_[_0xc6ab('0x17')](_0x19a140[_0xc6ab('0x1a')][_0xc6ab('0x1b')])){utils['debug'](util[_0xc6ab('0x3')](_0xc6ab('0x1c'),_0x19a140[_0xc6ab('0x4')]),_0x19a140);utils['info'](util[_0xc6ab('0x3')](_0xc6ab('0x1d'),_0x19a140[_0xc6ab('0x4')],_0x19a140['variable'],_0x19a140['value']));if(_[_0xc6ab('0x1e')](_0x19a140[_0xc6ab('0x1f')],_0xc6ab('0x20'))){_0x19a140['value']=_0x19a140[_0xc6ab('0x1f')][_0xc6ab('0x21')]('.wav49','.WAV');}if(recordings[_0x19a140[_0xc6ab('0xd')]]){var _0x209767=_[_0xc6ab('0x22')](recordings[_0x19a140[_0xc6ab('0xd')]]['monitors'],{'value':_0x19a140['value']});if(_['isNil'](_0x209767)){recordings[_0x19a140['linkedid']]['monitors'][_0xc6ab('0x23')]({'value':_0x19a140[_0xc6ab('0x1f')]});}}}}catch(_0x3aef43){utils[_0xc6ab('0x12')](util[_0xc6ab('0x3')]('[%s][recordings][varset]',_0x19a140[_0xc6ab('0x4')]),_0x3aef43);}};exports[_0xc6ab('0x24')]=function(_0x4e8d63){try{if(!_[_0xc6ab('0x17')](recordings[_0x4e8d63[_0xc6ab('0x4')]])){utils[_0xc6ab('0xb')](util['format'](_0xc6ab('0x25'),_0x4e8d63['uniqueid']),_0x4e8d63);utils[_0xc6ab('0x2')](util[_0xc6ab('0x3')](_0xc6ab('0x26'),_0x4e8d63[_0xc6ab('0x4')],_0x4e8d63[_0xc6ab('0x27')],_0x4e8d63[_0xc6ab('0x28')],_0x4e8d63[_0xc6ab('0x29')]));recordings[_0x4e8d63[_0xc6ab('0x4')]]['calleridnum']=_0x4e8d63[_0xc6ab('0x27')];recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x28')]=_0x4e8d63['calleridname'];recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2a')]=_0x4e8d63[_0xc6ab('0x2a')];recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2b')]=_0x4e8d63['connectedlinename'];if(recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2c')]==_0xc6ab('0x2d')&&recordings[_0x4e8d63[_0xc6ab('0x4')]]['accountcode']){recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2a')]=recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x5')];recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2b')]='';}recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2e')][_0xc6ab('0x2f')](function(_0x27f318){var _0x4ebc91=_[_0xc6ab('0x30')](recordings[_0x4e8d63[_0xc6ab('0x4')]]);_0x4ebc91[_0xc6ab('0x1f')]=_0x27f318[_0xc6ab('0x1f')];writeDB(_0x4ebc91);});delete recordings[_0x4e8d63[_0xc6ab('0x4')]];}}catch(_0x5d140c){utils['error'](util['format'](_0xc6ab('0x25'),_0x4e8d63[_0xc6ab('0x4')]),_0x5d140c);}};exports[_0xc6ab('0x31')]=function(_0x3b3610){try{if(!_[_0xc6ab('0x17')](recordings[_0x3b3610['uniqueid']])){utils[_0xc6ab('0xb')](util[_0xc6ab('0x3')](_0xc6ab('0x32'),_0x3b3610[_0xc6ab('0x4')]),_0x3b3610);utils['info'](util[_0xc6ab('0x3')](_0xc6ab('0x33'),_0x3b3610['uniqueid'],_0x3b3610[_0xc6ab('0x34')],_0x3b3610[_0xc6ab('0x35')]));if(_0x3b3610['application'][_0xc6ab('0x36')]()==_0xc6ab('0x37')&&_[_0xc6ab('0x38')](_0x3b3610[_0xc6ab('0x35')][_0xc6ab('0x36')](),_0xc6ab('0x39'))){var _0x54c5fc=_0x3b3610['appdata']['split']('=');var _0x1dd414=_0x54c5fc[0x0][_0xc6ab('0x3a')](_0x54c5fc[0x0][_0xc6ab('0x3b')]('(')+0x1,_0x54c5fc[0x0][_0xc6ab('0x3b')](')'));var _0x496f16=_0x54c5fc[0x1];recordings[_0x3b3610['uniqueid']][_0x1dd414]=_0x496f16;}}}catch(_0x26cbac){utils[_0xc6ab('0x12')](util[_0xc6ab('0x3')]('[%s][recordings][newexten]',_0x3b3610['uniqueid']),_0x26cbac);}};exports[_0xc6ab('0x3c')]=function(_0x2a7e30){try{if(!_[_0xc6ab('0x17')](recordings[_0x2a7e30[_0xc6ab('0x4')]])){utils[_0xc6ab('0xb')](util['format'](_0xc6ab('0x3d'),_0x2a7e30[_0xc6ab('0x4')]),_0x2a7e30);utils[_0xc6ab('0x2')](util[_0xc6ab('0x3')](_0xc6ab('0x3e'),_0x2a7e30[_0xc6ab('0x4')],_0x2a7e30['queue']));recordings[_0x2a7e30[_0xc6ab('0x4')]][_0xc6ab('0x3f')]=_0x2a7e30[_0xc6ab('0x3f')];}}catch(_0x3bb727){utils[_0xc6ab('0x12')](util[_0xc6ab('0x3')]('[%s][recordings][queuecallerjoin]',_0x2a7e30[_0xc6ab('0x4')]),_0x3bb727);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2e18a6f..39aec62 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 _0x1143=['[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','attended','assign','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]'];(function(_0x55a672,_0x466350){var _0x106178=function(_0x231974){while(--_0x231974){_0x55a672['push'](_0x55a672['shift']());}};_0x106178(++_0x466350);}(_0x1143,0x1c1));var _0x3114=function(_0x377743,_0x584cab){_0x377743=_0x377743-0x0;var _0x30ae30=_0x1143[_0x377743];return _0x30ae30;};'use strict';var _=require(_0x3114('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x33e0df){utils[_0x3114('0x1')](util[_0x3114('0x2')](_0x3114('0x3'),_0x33e0df[_0x3114('0x4')]==='attended'?_0x33e0df[_0x3114('0x5')]:_0x33e0df['uniqueid'],_0x33e0df[_0x3114('0x4')]));utils[_0x3114('0x6')]('CreateVoiceTransferReport',_0x33e0df);}exports[_0x3114('0x7')]={};exports[_0x3114('0x8')]=function(_0x403785){try{utils[_0x3114('0x9')](util[_0x3114('0x2')](_0x3114('0xa'),_0x403785[_0x3114('0xb')]),_0x403785);utils['info'](util[_0x3114('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x403785[_0x3114('0xb')],_0x403785[_0x3114('0xc')],_0x403785[_0x3114('0xd')],_0x403785[_0x3114('0xe')],_0x403785['transfereecalleridname']));_0x403785['type']=_0x3114('0xf');exports[_0x3114('0x7')][_0x403785['transfereruniqueid']]=_0x403785;writeDB(_0x403785);}catch(_0x4c63d4){utils[_0x3114('0x10')](util['format'](_0x3114('0xa'),_0x403785[_0x3114('0xb')]),_0x4c63d4);}};exports[_0x3114('0x11')]=function(_0x4b9319){try{utils[_0x3114('0x9')](util[_0x3114('0x2')](_0x3114('0x12'),_0x4b9319[_0x3114('0x5')]),_0x4b9319);utils[_0x3114('0x1')](util[_0x3114('0x2')](_0x3114('0x13'),_0x4b9319['origtransfereruniqueid'],_0x4b9319[_0x3114('0x14')],_0x4b9319[_0x3114('0x15')],_0x4b9319[_0x3114('0x16')],_0x4b9319[_0x3114('0x17')]));_0x4b9319=_['assign'](_0x4b9319,{'transfererchannel':_0x4b9319[_0x3114('0x18')],'transferercalleridnum':_0x4b9319[_0x3114('0x14')],'transferercalleridname':_0x4b9319[_0x3114('0x15')],'transfererconnectedlinenum':_0x4b9319[_0x3114('0x19')],'transfererconnectedlinename':_0x4b9319[_0x3114('0x1a')],'transfereraccountcode':_0x4b9319[_0x3114('0x1b')],'transferercontext':_0x4b9319[_0x3114('0x1c')],'transfererexten':_0x4b9319['secondtransfererexten'],'transfererlinkedid':_0x4b9319[_0x3114('0x1d')],'context':_0x4b9319[_0x3114('0x1e')],'extension':_0x4b9319['origtransfererexten'],'type':_0x3114('0x1f')});if(_['isNil'](_0x4b9319['transfereechannel'])){_0x4b9319=_[_0x3114('0x20')](_0x4b9319,{'transfereechannel':_0x4b9319['transfertargetchannel'],'transfereecalleridnum':_0x4b9319['transfertargetcalleridnum'],'transfereecalleridname':_0x4b9319[_0x3114('0x17')],'transfereeconnectedlinenum':_0x4b9319[_0x3114('0x21')],'transfereeconnectedlinename':_0x4b9319[_0x3114('0x22')],'transfereeaccountcode':_0x4b9319[_0x3114('0x23')],'transfereecontext':_0x4b9319[_0x3114('0x24')],'transfereeexten':_0x4b9319[_0x3114('0x25')],'transfereelinkedid':_0x4b9319[_0x3114('0x26')]});}writeDB(_0x4b9319);}catch(_0x27ac73){utils[_0x3114('0x10')](util['format'](_0x3114('0x12'),_0x4b9319[_0x3114('0x5')]),_0x27ac73);}}; \ No newline at end of file +var _0xc868=['[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer'];(function(_0x39e58f,_0xf91bc5){var _0x541ec7=function(_0x17028a){while(--_0x17028a){_0x39e58f['push'](_0x39e58f['shift']());}};_0x541ec7(++_0xf91bc5);}(_0xc868,0x93));var _0x8c86=function(_0x534e9c,_0x521703){_0x534e9c=_0x534e9c-0x0;var _0x53192f=_0xc868[_0x534e9c];return _0x53192f;};'use strict';var _=require(_0x8c86('0x0'));var util=require(_0x8c86('0x1'));var utils=require(_0x8c86('0x2'));function writeDB(_0x43573a){utils[_0x8c86('0x3')](util[_0x8c86('0x4')](_0x8c86('0x5'),_0x43573a[_0x8c86('0x6')]===_0x8c86('0x7')?_0x43573a[_0x8c86('0x8')]:_0x43573a['uniqueid'],_0x43573a[_0x8c86('0x6')]));utils[_0x8c86('0x9')](_0x8c86('0xa'),_0x43573a);}exports[_0x8c86('0xb')]={};exports[_0x8c86('0xc')]=function(_0x1325c8){try{utils['debug'](util[_0x8c86('0x4')](_0x8c86('0xd'),_0x1325c8[_0x8c86('0xe')]),_0x1325c8);utils[_0x8c86('0x3')](util[_0x8c86('0x4')](_0x8c86('0xf'),_0x1325c8[_0x8c86('0xe')],_0x1325c8[_0x8c86('0x10')],_0x1325c8['transferercalleridname'],_0x1325c8[_0x8c86('0x11')],_0x1325c8[_0x8c86('0x12')]));_0x1325c8[_0x8c86('0x6')]='blind';exports[_0x8c86('0xb')][_0x1325c8[_0x8c86('0x13')]]=_0x1325c8;writeDB(_0x1325c8);}catch(_0x50970d){utils[_0x8c86('0x14')](util[_0x8c86('0x4')](_0x8c86('0xd'),_0x1325c8[_0x8c86('0xe')]),_0x50970d);}};exports[_0x8c86('0x15')]=function(_0xe2798b){try{utils['debug'](util['format']('[%s][transfers][attendedtransfer]',_0xe2798b['origtransfereruniqueid']),_0xe2798b);utils[_0x8c86('0x3')](util['format'](_0x8c86('0x16'),_0xe2798b[_0x8c86('0x8')],_0xe2798b[_0x8c86('0x17')],_0xe2798b[_0x8c86('0x18')],_0xe2798b['transfertargetcalleridnum'],_0xe2798b[_0x8c86('0x19')]));_0xe2798b=_[_0x8c86('0x1a')](_0xe2798b,{'transfererchannel':_0xe2798b[_0x8c86('0x1b')],'transferercalleridnum':_0xe2798b[_0x8c86('0x17')],'transferercalleridname':_0xe2798b['origtransferercalleridname'],'transfererconnectedlinenum':_0xe2798b['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xe2798b[_0x8c86('0x1c')],'transfereraccountcode':_0xe2798b['origtransfereraccountcode'],'transferercontext':_0xe2798b['secondtransferercontext'],'transfererexten':_0xe2798b[_0x8c86('0x1d')],'transfererlinkedid':_0xe2798b[_0x8c86('0x1e')],'context':_0xe2798b['origtransferercontext'],'extension':_0xe2798b[_0x8c86('0x1f')],'type':_0x8c86('0x7')});if(_['isNil'](_0xe2798b[_0x8c86('0x20')])){_0xe2798b=_['assign'](_0xe2798b,{'transfereechannel':_0xe2798b[_0x8c86('0x21')],'transfereecalleridnum':_0xe2798b[_0x8c86('0x22')],'transfereecalleridname':_0xe2798b[_0x8c86('0x19')],'transfereeconnectedlinenum':_0xe2798b[_0x8c86('0x23')],'transfereeconnectedlinename':_0xe2798b['transfertargetconnectedlinename'],'transfereeaccountcode':_0xe2798b[_0x8c86('0x24')],'transfereecontext':_0xe2798b[_0x8c86('0x25')],'transfereeexten':_0xe2798b[_0x8c86('0x26')],'transfereelinkedid':_0xe2798b[_0x8c86('0x27')]});}writeDB(_0xe2798b);}catch(_0x2a2c82){utils['error'](util['format']('[%s][transfers][attendedtransfer]',_0xe2798b[_0x8c86('0x8')]),_0x2a2c82);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 8287e1f..d5b454b 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 _0xde36=['[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','util','http','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s'];(function(_0x2b06d0,_0xca0d0){var _0x2c2202=function(_0x5e437a){while(--_0x5e437a){_0x2b06d0['push'](_0x2b06d0['shift']());}};_0x2c2202(++_0xca0d0);}(_0xde36,0x1a5));var _0x6de3=function(_0x2d6476,_0x2cdb28){_0x2d6476=_0x2d6476-0x0;var _0x4f096c=_0xde36[_0x2d6476];return _0x4f096c;};'use strict';var BPromise=require(_0x6de3('0x0'));var jayson=require(_0x6de3('0x1'));var moment=require('moment');var util=require(_0x6de3('0x2'));var client=jayson['client'][_0x6de3('0x3')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x6de3('0x4')]=function(_0x15a010,_0x5731c9){logger[_0x6de3('0x4')](_0x15a010,_0x5731c9?util[_0x6de3('0x5')](_0x5731c9,{'showHidden':![],'depth':null}):'');};exports[_0x6de3('0x6')]=function(_0x1fbcbb,_0x19e3ab){logger['debug'](_0x1fbcbb,_0x19e3ab?util[_0x6de3('0x5')](_0x19e3ab,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x19648a,_0x18c838){logger[_0x6de3('0x7')](_0x19648a,_0x18c838?util[_0x6de3('0x5')](_0x18c838,{'showHidden':![],'depth':null}):'');};exports[_0x6de3('0x8')]=function(_0x25b0a5,_0x18b973){return client[_0x6de3('0x8')](_0x25b0a5,{'body':_0x18b973})['then'](function(_0x9d2d92){logger[_0x6de3('0x6')](_0x6de3('0x9'),_0x25b0a5,_0x9d2d92?util[_0x6de3('0x5')](_0x9d2d92,{'showHidden':![],'depth':null}):'');})[_0x6de3('0xa')](function(_0x47ccda){logger[_0x6de3('0x7')](_0x6de3('0x9'),_0x25b0a5,_0x47ccda?util[_0x6de3('0x5')](_0x47ccda,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4732fb){return client[_0x6de3('0x8')](_0x6de3('0xb'),{'options':{'raw':!![],'attributes':['id','internal',_0x6de3('0xc'),_0x6de3('0xd')],'where':_0x4732fb,'limit':0x1}})[_0x6de3('0xe')](function(_0x3e7ce7){logger['debug'](_0x6de3('0xf'),JSON[_0x6de3('0x10')](_0x4732fb),_0x3e7ce7?util[_0x6de3('0x5')](_0x3e7ce7,{'showHidden':![],'depth':null}):'');return _0x3e7ce7[_0x6de3('0x11')][_0x6de3('0x12')]?_0x3e7ce7['result'][0x0]:null;});}exports[_0x6de3('0x13')]=function(_0x268c48){return new BPromise(function(_0x417b8b,_0x47ab50){if(_0x268c48){return getUser({'internal':_0x268c48})[_0x6de3('0xe')](function(_0x1cc286){logger[_0x6de3('0x4')](_0x6de3('0x14'),_0x268c48,_0x1cc286?_0x6de3('0x15'):_0x6de3('0x16'));return _0x417b8b(_0x1cc286);})[_0x6de3('0xa')](function(_0x5580d4){logger[_0x6de3('0x7')](_0x6de3('0x17'),_0x5580d4?util['inspect'](_0x5580d4,{'showHidden':![],'depth':null}):'');return _0x417b8b(null);});}return _0x417b8b(null);});};exports[_0x6de3('0x18')]=function(_0x1a9dda){return new BPromise(function(_0x5488dc,_0x4ee51d){if(_0x1a9dda){return getUser({'interface':_0x1a9dda})['then'](function(_0x10daaf){logger[_0x6de3('0x4')](_0x6de3('0x19'),_0x1a9dda,_0x10daaf?'found':'notfound');return _0x5488dc(_0x10daaf);})[_0x6de3('0xa')](function(_0x3d1a48){logger[_0x6de3('0x7')](_0x6de3('0x1a'),_0x3d1a48?util['inspect'](_0x3d1a48,{'showHidden':![],'depth':null}):'');return _0x5488dc(null);});}return _0x5488dc(null);});};exports[_0x6de3('0x1b')]=function(_0x2bcb5d){return new BPromise(function(_0x56a5a4,_0x2ba4c3){if(_0x2bcb5d){return getUser({'name':_0x2bcb5d})[_0x6de3('0xe')](function(_0x1d08c9){logger[_0x6de3('0x4')](_0x6de3('0x1c'),_0x2bcb5d,_0x1d08c9?_0x6de3('0x15'):_0x6de3('0x16'));return _0x56a5a4(_0x1d08c9);})['catch'](function(_0x90868a){logger['error'](_0x6de3('0x1d'),_0x90868a?util['inspect'](_0x90868a,{'showHidden':![],'depth':null}):'');return _0x56a5a4(null);});}return _0x56a5a4(null);});};exports['getVoiceQueueByName']=function(_0x549139){return new BPromise(function(_0x2e352a,_0x4bff66){if(_0x549139){return client[_0x6de3('0x8')](_0x6de3('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x6de3('0xc'),_0x6de3('0x1f'),_0x6de3('0x20'),_0x6de3('0x21')],'where':{'name':_0x549139},'limit':0x1}})[_0x6de3('0xe')](function(_0x3aa4e1){logger[_0x6de3('0x6')](_0x6de3('0x22'),_0x549139,_0x3aa4e1?util[_0x6de3('0x5')](_0x3aa4e1,{'showHidden':![],'depth':null}):'');logger[_0x6de3('0x4')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x549139,_0x3aa4e1?'found':'notfound');return _0x2e352a(_0x3aa4e1[_0x6de3('0x11')][_0x6de3('0x12')]?_0x3aa4e1[_0x6de3('0x11')][0x0]:null);})['catch'](function(_0x4a96e5){logger[_0x6de3('0x7')](_0x6de3('0x23'),_0x4a96e5?util[_0x6de3('0x5')](_0x4a96e5,{'showHidden':![],'depth':null}):'');return _0x2e352a(null);});}return _0x2e352a(null);});};exports[_0x6de3('0x24')]=function(_0x1b397a,_0xed5a3d){return moment(_0x1b397a)['add'](_0xed5a3d,_0x6de3('0x25'))[_0x6de3('0x26')](_0x6de3('0x27'));};exports[_0x6de3('0x28')]=function(_0x11c2e1,_0x3c88ef){return moment(_0x11c2e1)['subtract'](_0x3c88ef,_0x6de3('0x25'))['format'](_0x6de3('0x27'));};exports['diffTime']=function(_0xba34f,_0x27fbcb){return moment(_0xba34f)[_0x6de3('0x29')](moment(_0x27fbcb),_0x6de3('0x25'));};exports[_0x6de3('0x2a')]=function(_0x31628,_0x57a930){return parseInt(_0x31628,0xa)+parseInt(_0x57a930,0xa);};exports['now']=function(){return moment()['format'](_0x6de3('0x27'));};exports[_0x6de3('0x2b')]=function(_0x519ac9,_0x23efb8){if(_0x23efb8){return moment(_0x519ac9)[_0x6de3('0x2b')](_0x23efb8);}return!![];};exports[_0x6de3('0x2c')]=function(_0xf7d7dd,_0x3b666f){if(_0x3b666f){return moment(_0xf7d7dd)['isBefore'](_0x3b666f);}else if(_0xf7d7dd){return!![];}return![];}; \ No newline at end of file +var _0x76ce=['[utils][getVoiceQueueByName]\x20name:%s','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isBefore','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','GetUser','internal','name','stringify','length','result','then','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout'];(function(_0x4dd7c2,_0x5e86af){var _0x48ae97=function(_0x477727){while(--_0x477727){_0x4dd7c2['push'](_0x4dd7c2['shift']());}};_0x48ae97(++_0x5e86af);}(_0x76ce,0xb6));var _0xe76c=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x76ce[_0x297fd3];return _0x2af381;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xe76c('0x0'));var moment=require('moment');var util=require(_0xe76c('0x1'));var client=jayson[_0xe76c('0x2')][_0xe76c('0x3')]({'port':0x2329});var logger=require(_0xe76c('0x4'))(_0xe76c('0x5'));exports[_0xe76c('0x6')]=function(_0x2af400,_0x4ecb71){logger[_0xe76c('0x6')](_0x2af400,_0x4ecb71?util[_0xe76c('0x7')](_0x4ecb71,{'showHidden':![],'depth':null}):'');};exports[_0xe76c('0x8')]=function(_0x2bab39,_0x709b29){logger[_0xe76c('0x8')](_0x2bab39,_0x709b29?util[_0xe76c('0x7')](_0x709b29,{'showHidden':![],'depth':null}):'');};exports[_0xe76c('0x9')]=function(_0x5ad201,_0x3c3e1b){logger[_0xe76c('0x9')](_0x5ad201,_0x3c3e1b?util['inspect'](_0x3c3e1b,{'showHidden':![],'depth':null}):'');};exports[_0xe76c('0xa')]=function(_0x267895,_0x2713d1){return client[_0xe76c('0xa')](_0x267895,{'body':_0x2713d1})['then'](function(_0xe4ce57){logger['debug']('[utils][request]\x20name:%s',_0x267895,_0xe4ce57?util[_0xe76c('0x7')](_0xe4ce57,{'showHidden':![],'depth':null}):'');})[_0xe76c('0xb')](function(_0x421030){logger[_0xe76c('0x9')](_0xe76c('0xc'),_0x267895,_0x421030?util['inspect'](_0x421030,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3e4a6d){return client[_0xe76c('0xa')](_0xe76c('0xd'),{'options':{'raw':!![],'attributes':['id',_0xe76c('0xe'),_0xe76c('0xf'),'interface'],'where':_0x3e4a6d,'limit':0x1}})['then'](function(_0x61a869){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0xe76c('0x10')](_0x3e4a6d),_0x61a869?util[_0xe76c('0x7')](_0x61a869,{'showHidden':![],'depth':null}):'');return _0x61a869['result'][_0xe76c('0x11')]?_0x61a869[_0xe76c('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x1c5f18){return new BPromise(function(_0x1ea908,_0x42f65e){if(_0x1c5f18){return getUser({'internal':_0x1c5f18})[_0xe76c('0x13')](function(_0x421c3f){logger[_0xe76c('0x6')](_0xe76c('0x14'),_0x1c5f18,_0x421c3f?_0xe76c('0x15'):_0xe76c('0x16'));return _0x1ea908(_0x421c3f);})[_0xe76c('0xb')](function(_0x48bb96){logger['error'](_0xe76c('0x17'),_0x48bb96?util[_0xe76c('0x7')](_0x48bb96,{'showHidden':![],'depth':null}):'');return _0x1ea908(null);});}return _0x1ea908(null);});};exports[_0xe76c('0x18')]=function(_0x1a000e){return new BPromise(function(_0x169fbf,_0x52b41a){if(_0x1a000e){return getUser({'interface':_0x1a000e})['then'](function(_0x1fc558){logger[_0xe76c('0x6')](_0xe76c('0x19'),_0x1a000e,_0x1fc558?_0xe76c('0x15'):_0xe76c('0x16'));return _0x169fbf(_0x1fc558);})[_0xe76c('0xb')](function(_0x1b85d8){logger[_0xe76c('0x9')](_0xe76c('0x1a'),_0x1b85d8?util[_0xe76c('0x7')](_0x1b85d8,{'showHidden':![],'depth':null}):'');return _0x169fbf(null);});}return _0x169fbf(null);});};exports[_0xe76c('0x1b')]=function(_0xe87142){return new BPromise(function(_0x40128f,_0x25558d){if(_0xe87142){return getUser({'name':_0xe87142})[_0xe76c('0x13')](function(_0x147dfe){logger['info'](_0xe76c('0x1c'),_0xe87142,_0x147dfe?_0xe76c('0x15'):_0xe76c('0x16'));return _0x40128f(_0x147dfe);})['catch'](function(_0x1cb32f){logger['error']('[utils][getUserByName]',_0x1cb32f?util['inspect'](_0x1cb32f,{'showHidden':![],'depth':null}):'');return _0x40128f(null);});}return _0x40128f(null);});};exports[_0xe76c('0x1d')]=function(_0x4ed006){return new BPromise(function(_0x130fe8,_0x29e1fa){if(_0x4ed006){return client[_0xe76c('0xa')](_0xe76c('0x1e'),{'options':{'raw':!![],'attributes':['id','name','type',_0xe76c('0x1f'),_0xe76c('0x20')],'where':{'name':_0x4ed006},'limit':0x1}})[_0xe76c('0x13')](function(_0x5ce18e){logger[_0xe76c('0x8')](_0xe76c('0x21'),_0x4ed006,_0x5ce18e?util[_0xe76c('0x7')](_0x5ce18e,{'showHidden':![],'depth':null}):'');logger[_0xe76c('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x4ed006,_0x5ce18e?_0xe76c('0x15'):_0xe76c('0x16'));return _0x130fe8(_0x5ce18e[_0xe76c('0x12')][_0xe76c('0x11')]?_0x5ce18e['result'][0x0]:null);})['catch'](function(_0x500078){logger[_0xe76c('0x9')]('[utils][getVoiceQueueByName]',_0x500078?util[_0xe76c('0x7')](_0x500078,{'showHidden':![],'depth':null}):'');return _0x130fe8(null);});}return _0x130fe8(null);});};exports[_0xe76c('0x22')]=function(_0x93fe01,_0x15c384){return moment(_0x93fe01)['add'](_0x15c384,_0xe76c('0x23'))[_0xe76c('0x24')](_0xe76c('0x25'));};exports['subtractTime']=function(_0x52fdff,_0x25b9e4){return moment(_0x52fdff)['subtract'](_0x25b9e4,_0xe76c('0x23'))['format'](_0xe76c('0x25'));};exports[_0xe76c('0x26')]=function(_0x39b085,_0x5565a2){return moment(_0x39b085)[_0xe76c('0x27')](moment(_0x5565a2),_0xe76c('0x23'));};exports[_0xe76c('0x28')]=function(_0x38e5b1,_0x1986f4){return parseInt(_0x38e5b1,0xa)+parseInt(_0x1986f4,0xa);};exports[_0xe76c('0x29')]=function(){return moment()[_0xe76c('0x24')](_0xe76c('0x25'));};exports['isAfter']=function(_0x11b8c6,_0x1a270b){if(_0x1a270b){return moment(_0x11b8c6)['isAfter'](_0x1a270b);}return!![];};exports[_0xe76c('0x2a')]=function(_0x4a9b6e,_0x10b9f7){if(_0x10b9f7){return moment(_0x4a9b6e)[_0xe76c('0x2a')](_0x10b9f7);}else if(_0x4a9b6e){return!![];}return![];}; \ No newline at end of file